From a29809e61f3d8a5e2578dd07f0cd961a7d53b035 Mon Sep 17 00:00:00 2001 From: Andrea Bianco Date: Sun, 31 Oct 2021 19:32:50 +0100 Subject: [PATCH] Built motion from commit a8fc54dc.|2.5.37 --- apidoc/api_project.js | 2 +- apidoc/api_project.json | 2 +- server/api/action/action.attributes.js | 2 +- server/api/action/action.controller.js | 2 +- server/api/action/action.model.js | 2 +- server/api/action/action.rpc.js | 2 +- server/api/action/index.js | 2 +- .../analyticCustomReport.attributes.js | 2 +- .../analyticCustomReport.controller.js | 2 +- .../analyticCustomReport.model.js | 2 +- .../analyticCustomReport.rpc.js | 2 +- server/api/analyticCustomReport/index.js | 2 +- .../analyticDefaultReport.attributes.js | 2 +- .../analyticDefaultReport.controller.js | 2 +- .../analyticDefaultReport.model.js | 2 +- .../analyticDefaultReport.rpc.js | 2 +- server/api/analyticDefaultReport/index.js | 2 +- .../analyticExtractedReport.attributes.js | 2 +- .../analyticExtractedReport.controller.js | 2 +- .../analyticExtractedReport.model.js | 2 +- .../analyticExtractedReport.rpc.js | 2 +- server/api/analyticExtractedReport/index.js | 2 +- .../analyticFieldReport.attributes.js | 2 +- .../analyticFieldReport.controller.js | 2 +- .../analyticFieldReport.model.js | 2 +- .../analyticFieldReport/analyticFieldReport.rpc.js | 2 +- server/api/analyticFieldReport/index.js | 2 +- .../analyticMetric/analyticMetric.attributes.js | 2 +- .../analyticMetric/analyticMetric.controller.js | 2 +- server/api/analyticMetric/analyticMetric.model.js | 2 +- server/api/analyticMetric/analyticMetric.rpc.js | 2 +- server/api/analyticMetric/index.js | 2 +- .../analyticTreeReport.attributes.js | 2 +- .../analyticTreeReport.controller.js | 2 +- .../analyticTreeReport/analyticTreeReport.model.js | 2 +- .../analyticTreeReport/analyticTreeReport.rpc.js | 2 +- server/api/analyticTreeReport/index.js | 2 +- server/api/attachment/attachment.attributes.js | 2 +- server/api/attachment/attachment.controller.js | 2 +- server/api/attachment/attachment.model.js | 2 +- server/api/attachment/attachment.rpc.js | 2 +- server/api/attachment/index.js | 2 +- .../authActiveDirectory.controller.js | 2 +- server/api/authActiveDirectory/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- server/api/chatWebsite/index.js | 2 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.js | 2 +- server/api/cloudProvider/cloudProvider.rpc.js | 2 +- server/api/cloudProvider/index.js | 2 +- server/api/cmCompany/cmCompany.attributes.js | 2 +- server/api/cmCompany/cmCompany.controller.js | 2 +- server/api/cmCompany/cmCompany.model.js | 2 +- server/api/cmCompany/cmCompany.rpc.js | 2 +- server/api/cmCompany/index.js | 2 +- server/api/cmContact/cmContact.attributes.js | 2 +- server/api/cmContact/cmContact.controller.js | 2 +- server/api/cmContact/cmContact.events.js | 2 +- server/api/cmContact/cmContact.model.js | 2 +- server/api/cmContact/cmContact.rpc.js | 2 +- server/api/cmContact/cmContact.socket.js | 2 +- server/api/cmContact/index.js | 2 +- .../api/cmCustomField/cmCustomField.attributes.js | 2 +- .../api/cmCustomField/cmCustomField.controller.js | 2 +- server/api/cmCustomField/cmCustomField.model.js | 2 +- server/api/cmCustomField/cmCustomField.rpc.js | 2 +- server/api/cmCustomField/index.js | 2 +- server/api/cmHopper/cmHopper.attributes.js | 2 +- server/api/cmHopper/cmHopper.controller.js | 2 +- server/api/cmHopper/cmHopper.model.js | 2 +- server/api/cmHopper/cmHopper.rpc.js | 2 +- server/api/cmHopper/index.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +- server/api/cmHopperBlack/index.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +- server/api/cmHopperFinal/index.js | 2 +- .../cmHopperHistory/cmHopperHistory.attributes.js | 2 +- .../cmHopperHistory/cmHopperHistory.controller.js | 2 +- .../api/cmHopperHistory/cmHopperHistory.model.js | 2 +- server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +- server/api/cmHopperHistory/index.js | 2 +- server/api/cmList/cmList.attributes.js | 2 +- server/api/cmList/cmList.controller.js | 2 +- server/api/cmList/cmList.events.js | 2 +- server/api/cmList/cmList.model.js | 2 +- server/api/cmList/cmList.rpc.js | 2 +- server/api/cmList/cmList.socket.js | 2 +- server/api/cmList/index.js | 2 +- server/api/condition/condition.attributes.js | 2 +- server/api/condition/condition.controller.js | 2 +- server/api/condition/condition.model.js | 2 +- server/api/condition/condition.rpc.js | 2 +- server/api/condition/index.js | 2 +- server/api/dashboard/dashboard.attributes.js | 2 +- server/api/dashboard/dashboard.controller.js | 2 +- server/api/dashboard/dashboard.events.js | 2 +- server/api/dashboard/dashboard.model.js | 2 +- server/api/dashboard/dashboard.rpc.js | 2 +- server/api/dashboard/dashboard.socket.js | 2 +- server/api/dashboard/index.js | 2 +- .../api/dashboardItem/dashboardItem.attributes.js | 2 +- .../api/dashboardItem/dashboardItem.controller.js | 2 +- server/api/dashboardItem/dashboardItem.events.js | 2 +- server/api/dashboardItem/dashboardItem.model.js | 2 +- server/api/dashboardItem/dashboardItem.rpc.js | 2 +- server/api/dashboardItem/dashboardItem.socket.js | 2 +- server/api/dashboardItem/index.js | 2 +- server/api/disposition/disposition.attributes.js | 2 +- server/api/disposition/disposition.controller.js | 2 +- server/api/disposition/disposition.model.js | 2 +- server/api/disposition/disposition.rpc.js | 2 +- server/api/disposition/index.js | 2 +- server/api/faxAccount/faxAccount.attributes.js | 2 +- server/api/faxAccount/faxAccount.controller.js | 2 +- server/api/faxAccount/faxAccount.events.js | 2 +- server/api/faxAccount/faxAccount.model.js | 2 +- server/api/faxAccount/faxAccount.rpc.js | 2 +- server/api/faxAccount/faxAccount.socket.js | 2 +- server/api/faxAccount/index.js | 2 +- .../faxApplication/faxApplication.attributes.js | 2 +- .../faxApplication/faxApplication.controller.js | 2 +- server/api/faxApplication/faxApplication.model.js | 2 +- server/api/faxApplication/faxApplication.rpc.js | 2 +- server/api/faxApplication/index.js | 2 +- .../faxInteraction/faxInteraction.attributes.js | 2 +- .../faxInteraction/faxInteraction.controller.js | 2 +- server/api/faxInteraction/faxInteraction.events.js | 2 +- server/api/faxInteraction/faxInteraction.model.js | 2 +- server/api/faxInteraction/faxInteraction.rpc.js | 2 +- server/api/faxInteraction/faxInteraction.socket.js | 2 +- server/api/faxInteraction/index.js | 2 +- server/api/faxMessage/faxMessage.attributes.js | 2 +- server/api/faxMessage/faxMessage.controller.js | 2 +- server/api/faxMessage/faxMessage.events.js | 2 +- server/api/faxMessage/faxMessage.model.js | 2 +- server/api/faxMessage/faxMessage.rpc.js | 2 +- server/api/faxMessage/faxMessage.socket.js | 2 +- server/api/faxMessage/index.js | 2 +- server/api/faxQueue/faxQueue.attributes.js | 2 +- server/api/faxQueue/faxQueue.controller.js | 2 +- server/api/faxQueue/faxQueue.events.js | 2 +- server/api/faxQueue/faxQueue.model.js | 2 +- server/api/faxQueue/faxQueue.rpc.js | 2 +- server/api/faxQueue/faxQueue.socket.js | 2 +- server/api/faxQueue/index.js | 2 +- .../faxQueueReport/faxQueueReport.attributes.js | 2 +- .../faxQueueReport/faxQueueReport.controller.js | 2 +- server/api/faxQueueReport/faxQueueReport.model.js | 2 +- server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +- server/api/faxQueueReport/index.js | 2 +- .../faxTransferReport.attributes.js | 2 +- .../faxTransferReport.controller.js | 2 +- .../faxTransferReport/faxTransferReport.model.js | 2 +- .../api/faxTransferReport/faxTransferReport.rpc.js | 2 +- server/api/faxTransferReport/index.js | 2 +- server/api/intDeskAccount/index.js | 2 +- .../intDeskAccount/intDeskAccount.attributes.js | 2 +- .../intDeskAccount/intDeskAccount.controller.js | 2 +- server/api/intDeskAccount/intDeskAccount.model.js | 2 +- server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +- server/api/intDeskConfiguration/index.js | 2 +- .../intDeskConfiguration.attributes.js | 2 +- .../intDeskConfiguration.controller.js | 2 +- .../intDeskConfiguration.model.js | 2 +- .../intDeskConfiguration.rpc.js | 2 +- server/api/intDeskField/index.js | 2 +- server/api/intDeskField/intDeskField.attributes.js | 2 +- server/api/intDeskField/intDeskField.controller.js | 2 +- server/api/intDeskField/intDeskField.model.js | 2 +- server/api/intDeskField/intDeskField.rpc.js | 2 +- server/api/intDynamics365Account/index.js | 2 +- .../intDynamics365Account.attributes.js | 2 +- .../intDynamics365Account.controller.js | 2 +- .../intDynamics365Account.model.js | 2 +- .../intDynamics365Account.rpc.js | 2 +- server/api/intDynamics365Configuration/index.js | 2 +- .../intDynamics365Configuration.attributes.js | 2 +- .../intDynamics365Configuration.controller.js | 2 +- .../intDynamics365Configuration.model.js | 2 +- .../intDynamics365Configuration.rpc.js | 2 +- server/api/intDynamics365Field/index.js | 2 +- .../intDynamics365Field.attributes.js | 2 +- .../intDynamics365Field.controller.js | 2 +- .../intDynamics365Field.model.js | 2 +- .../intDynamics365Field/intDynamics365Field.rpc.js | 2 +- server/api/intFreshdeskAccount/index.js | 2 +- .../intFreshdeskAccount.attributes.js | 2 +- .../intFreshdeskAccount.controller.js | 2 +- .../intFreshdeskAccount.model.js | 2 +- .../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +- server/api/intFreshdeskConfiguration/index.js | 2 +- .../intFreshdeskConfiguration.attributes.js | 2 +- .../intFreshdeskConfiguration.controller.js | 2 +- .../intFreshdeskConfiguration.model.js | 2 +- .../intFreshdeskConfiguration.rpc.js | 2 +- server/api/intFreshdeskField/index.js | 2 +- .../intFreshdeskField.attributes.js | 2 +- .../intFreshdeskField.controller.js | 2 +- .../intFreshdeskField/intFreshdeskField.model.js | 2 +- .../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +- server/api/intFreshsalesAccount/index.js | 2 +- .../intFreshsalesAccount.attributes.js | 2 +- .../intFreshsalesAccount.controller.js | 2 +- .../intFreshsalesAccount.model.js | 2 +- .../intFreshsalesAccount.rpc.js | 2 +- server/api/intFreshsalesConfiguration/index.js | 2 +- .../intFreshsalesConfiguration.attributes.js | 2 +- .../intFreshsalesConfiguration.controller.js | 2 +- .../intFreshsalesConfiguration.model.js | 2 +- .../intFreshsalesConfiguration.rpc.js | 2 +- server/api/intFreshsalesField/index.js | 2 +- .../intFreshsalesField.attributes.js | 2 +- .../intFreshsalesField.controller.js | 2 +- .../intFreshsalesField/intFreshsalesField.model.js | 2 +- .../intFreshsalesField/intFreshsalesField.rpc.js | 2 +- server/api/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.events.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/realtime/index.js | 2 +- server/api/realtime/realtime.controller.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- .../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +- .../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +- server/api/teamVoiceQueue/index.js | 2 +- .../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +- server/api/template/index.js | 2 +- server/api/template/template.attributes.js | 2 +- server/api/template/template.controller.js | 2 +- server/api/template/template.model.js | 2 +- server/api/template/template.rpc.js | 2 +- server/api/trigger/index.js | 2 +- server/api/trigger/trigger.attributes.js | 2 +- server/api/trigger/trigger.controller.js | 2 +- server/api/trigger/trigger.model.js | 2 +- server/api/trigger/trigger.rpc.js | 2 +- server/api/trunk/index.js | 2 +- server/api/trunk/trunk.attributes.js | 2 +- server/api/trunk/trunk.controller.js | 2 +- server/api/trunk/trunk.model.js | 2 +- server/api/trunk/trunk.rpc.js | 2 +- server/api/user/index.js | 2 +- server/api/user/user.attributes.js | 2 +- server/api/user/user.controller.js | 2 +- server/api/user/user.events.js | 2 +- server/api/user/user.model.js | 2 +- server/api/user/user.rpc.js | 2 +- server/api/user/user.socket.js | 2 +- server/api/userChatQueue/index.js | 2 +- .../api/userChatQueue/userChatQueue.attributes.js | 2 +- server/api/userChatQueue/userChatQueue.model.js | 2 +- server/api/userChatQueue/userChatQueue.rpc.js | 2 +- server/api/userFaxQueue/index.js | 2 +- server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +- server/api/userFaxQueue/userFaxQueue.model.js | 2 +- server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +- server/api/userMailQueue/index.js | 2 +- .../api/userMailQueue/userMailQueue.attributes.js | 2 +- server/api/userMailQueue/userMailQueue.model.js | 2 +- server/api/userMailQueue/userMailQueue.rpc.js | 2 +- server/api/userNotification/index.js | 2 +- .../userNotification.attributes.js | 2 +- .../userNotification.controller.js | 2 +- .../userNotification/userNotification.events.js | 2 +- .../api/userNotification/userNotification.model.js | 2 +- .../api/userNotification/userNotification.rpc.js | 2 +- .../userNotification/userNotification.socket.js | 2 +- server/api/userOpenchannelQueue/index.js | 2 +- .../userOpenchannelQueue.attributes.js | 2 +- .../userOpenchannelQueue.model.js | 2 +- .../userOpenchannelQueue.rpc.js | 2 +- server/api/userProfile/index.js | 2 +- server/api/userProfile/userProfile.attributes.js | 2 +- server/api/userProfile/userProfile.controller.js | 2 +- server/api/userProfile/userProfile.events.js | 2 +- server/api/userProfile/userProfile.model.js | 2 +- server/api/userProfile/userProfile.rpc.js | 2 +- server/api/userProfile/userProfile.socket.js | 2 +- server/api/userProfileResource/index.js | 2 +- .../userProfileResource.attributes.js | 2 +- .../userProfileResource.controller.js | 2 +- .../userProfileResource.model.js | 2 +- .../userProfileResource/userProfileResource.rpc.js | 2 +- server/api/userProfileSection/index.js | 2 +- .../userProfileSection.attributes.js | 2 +- .../userProfileSection.controller.js | 2 +- .../userProfileSection/userProfileSection.model.js | 2 +- .../userProfileSection/userProfileSection.rpc.js | 2 +- server/api/userSmsQueue/index.js | 2 +- server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +- server/api/userSmsQueue/userSmsQueue.model.js | 2 +- server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +- .../userVoicePrefix/userVoicePrefix.attributes.js | 2 +- .../api/userVoicePrefix/userVoicePrefix.model.js | 2 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/encryptor/index.js | 2 +- server/components/export/csv.js | 2 +- server/components/export/pdf.js | 2 +- server/components/export/xlsx.js | 2 +- server/components/extensions/rewrite.js | 2 +- server/components/import/cm/csv.js | 2 +- server/components/import/cm/csv2.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/index.js | 2 +- server/migrations/2.5.37.js | 12 -- server/migrations/2.5.38.js | 179 ++++++++++++++++++++ server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/safe-template.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/action.js | 2 +- server/services/ami/dialer/agentComplete.js | 2 +- server/services/ami/dialer/final.js | 2 +- server/services/ami/dialer/hangup.js | 2 +- server/services/ami/dialer/history.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/queueCallerAbandon.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/tvox.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- 1158 files changed, 1335 insertions(+), 1168 deletions(-) create mode 100644 server/migrations/2.5.38.js diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 81d846c..f377ada 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-10-30T17:31:38.768Z", + "time": "2021-10-31T18:22:11.872Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 7d67e8a..cada34d 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-10-30T17:31:38.768Z", + "time": "2021-10-31T18:22:11.872Z", "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 7e118d4..afb49cf 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 _0x3713=['bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','VIRTUAL','getDataValue','action','contactManager','integration','jscripty','urlForward','browser'];(function(_0x1d1676,_0x3f7843){var _0x205857=function(_0x523e99){while(--_0x523e99){_0x1d1676['push'](_0x1d1676['shift']());}};_0x205857(++_0x3f7843);}(_0x3713,0xe7));var _0x3371=function(_0x291884,_0xd6741){_0x291884=_0x291884-0x0;var _0x2fa5be=_0x3713[_0x291884];return _0x2fa5be;};'use strict';var Sequelize=require(_0x3371('0x0'));module['exports']={'name':{'type':Sequelize[_0x3371('0x1')],'get':function(_0x3e04ad){return this[_0x3371('0x2')](_0x3371('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x3371('0x4'),_0x3371('0x5'),'motionbar',_0x3371('0x6'),_0x3371('0x7'),_0x3371('0x8'),_0x3371('0x9'),_0x3371('0xa')]],'msg':_0x3371('0xb')}},'comment':_0x3371('0xb')},'data1':{'type':Sequelize[_0x3371('0xc')](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[_0x3371('0xc')](0x1000),'comment':_0x3371('0xd')},'data3':{'type':Sequelize[_0x3371('0xc')](0x1000),'comment':_0x3371('0xe')},'data4':{'type':Sequelize[_0x3371('0xc')](0x1000),'comments':_0x3371('0xf')},'data5':{'type':Sequelize[_0x3371('0xc')](0x1000),'comments':_0x3371('0x10')},'data6':{'type':Sequelize['STRING'],'comments':_0x3371('0x11')},'data7':{'type':Sequelize[_0x3371('0x12')],'comments':_0x3371('0x13')}}; \ No newline at end of file +var _0x192f=['action','STRING','contactManager','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x18c627,_0x926f18){var _0x1e9cbf=function(_0x63fb22){while(--_0x63fb22){_0x18c627['push'](_0x18c627['shift']());}};_0x1e9cbf(++_0x926f18);}(_0x192f,0x19a));var _0xf192=function(_0x25c00b,_0x39ee52){_0x25c00b=_0x25c00b-0x0;var _0x55bdac=_0x192f[_0x25c00b];return _0x55bdac;};'use strict';var Sequelize=require(_0xf192('0x0'));module[_0xf192('0x1')]={'name':{'type':Sequelize[_0xf192('0x2')],'get':function(_0x2942d9){return this[_0xf192('0x3')](_0xf192('0x4'));}},'action':{'type':Sequelize[_0xf192('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xf192('0x6'),'integration','motionbar','jscripty',_0xf192('0x7'),_0xf192('0x8'),'bot',_0xf192('0x9')]],'msg':_0xf192('0xa')}},'comment':_0xf192('0xa')},'data1':{'type':Sequelize[_0xf192('0x5')](0x1000),'comment':_0xf192('0xb')},'data2':{'type':Sequelize[_0xf192('0x5')](0x1000),'comment':_0xf192('0xc')},'data3':{'type':Sequelize[_0xf192('0x5')](0x1000),'comment':_0xf192('0xd')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xf192('0xe')},'data5':{'type':Sequelize[_0xf192('0x5')](0x1000),'comments':_0xf192('0xf')},'data6':{'type':Sequelize[_0xf192('0x5')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xf192('0x10')],'comments':_0xf192('0x11')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index c892b5b..f119300 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 _0xb301=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','body','Action','find','catch'];(function(_0x5013ed,_0x52e6b6){var _0x3591bc=function(_0x443eae){while(--_0x443eae){_0x5013ed['push'](_0x5013ed['shift']());}};_0x3591bc(++_0x52e6b6);}(_0xb301,0xe6));var _0x1b30=function(_0x5df3ab,_0xf2b88f){_0x5df3ab=_0x5df3ab-0x0;var _0x34907e=_0xb301[_0x5df3ab];return _0x34907e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b30('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1b30('0x1'));var rp=require(_0x1b30('0x2'));var moment=require(_0x1b30('0x3'));var BPromise=require(_0x1b30('0x4'));var Mustache=require(_0x1b30('0x5'));var util=require(_0x1b30('0x6'));var path=require(_0x1b30('0x7'));var sox=require(_0x1b30('0x8'));var csv=require(_0x1b30('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b30('0xa'));var _=require('lodash');var squel=require(_0x1b30('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1b30('0xc'));var toCsv=require(_0x1b30('0x9'));var querystring=require(_0x1b30('0xd'));var Papa=require(_0x1b30('0xe'));var Redis=require(_0x1b30('0xf'));var authService=require(_0x1b30('0x10'));var qs=require(_0x1b30('0x11'));var as=require(_0x1b30('0x12'));var hardwareService=require(_0x1b30('0x13'));var logger=require(_0x1b30('0x14'))(_0x1b30('0x15'));var utils=require('../../config/utils');var config=require(_0x1b30('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x708a33,_0x37eaf3){_0x37eaf3=_0x37eaf3||0xcc;return function(_0x2bfab4){if(_0x2bfab4){return _0x708a33[_0x1b30('0x17')](_0x37eaf3);}return _0x708a33[_0x1b30('0x18')](_0x37eaf3)[_0x1b30('0x19')]();};}function respondWithResult(_0x28a367,_0xf77129){_0xf77129=_0xf77129||0xc8;return function(_0x374ed3){if(_0x374ed3){return _0x28a367[_0x1b30('0x18')](_0xf77129)[_0x1b30('0x1a')](_0x374ed3);}};}function respondWithFilteredResult(_0xbc0886,_0x3355f8){return function(_0x85e309){if(_0x85e309){var _0x29e87a=typeof _0x3355f8[_0x1b30('0x1b')]===_0x1b30('0x1c')&&typeof _0x3355f8['limit']===_0x1b30('0x1c');var _0x1a9114=_0x85e309[_0x1b30('0x1d')];var _0x4f9456=_0x29e87a?0x0:_0x3355f8[_0x1b30('0x1b')];var _0x56f695=_0x29e87a?_0x85e309['count']:_0x3355f8[_0x1b30('0x1b')]+_0x3355f8[_0x1b30('0x1e')];var _0x2b9506;if(_0x56f695>=_0x1a9114){_0x56f695=_0x1a9114;_0x2b9506=0xc8;}else{_0x2b9506=0xce;}_0xbc0886[_0x1b30('0x18')](_0x2b9506);return _0xbc0886[_0x1b30('0x1f')](_0x1b30('0x20'),_0x4f9456+'-'+_0x56f695+'/'+_0x1a9114)[_0x1b30('0x1a')](_0x85e309);}return null;};}function patchUpdates(_0x108c72){return function(_0x3adca5){try{jsonpatch[_0x1b30('0x21')](_0x3adca5,_0x108c72,!![]);}catch(_0x1780fb){return BPromise[_0x1b30('0x22')](_0x1780fb);}return _0x3adca5[_0x1b30('0x23')]();};}function saveUpdates(_0x1811b1,_0x508a8b){return function(_0x31c6d2){if(_0x31c6d2){return _0x31c6d2[_0x1b30('0x24')](_0x1811b1)[_0x1b30('0x25')](function(_0xa481a7){return _0xa481a7;});}return null;};}function removeEntity(_0x2c9ad6,_0x5c1f7e){return function(_0x490c57){if(_0x490c57){return _0x490c57[_0x1b30('0x26')]()[_0x1b30('0x25')](function(){_0x2c9ad6['status'](0xcc)[_0x1b30('0x19')]();});}};}function handleEntityNotFound(_0x27a682,_0x2d18c0){return function(_0x266328){if(!_0x266328){_0x27a682[_0x1b30('0x17')](0x194);}return _0x266328;};}function handleError(_0xa19e8e,_0x107578){_0x107578=_0x107578||0x1f4;return function(_0x4fe4fa){logger[_0x1b30('0x27')](_0x4fe4fa['stack']);if(_0x4fe4fa[_0x1b30('0x28')]){delete _0x4fe4fa[_0x1b30('0x28')];}_0xa19e8e[_0x1b30('0x18')](_0x107578)[_0x1b30('0x29')](_0x4fe4fa);};}exports['update']=function(_0x341d4d,_0x7219d){if(_0x341d4d['body']['id']){delete _0x341d4d[_0x1b30('0x2a')]['id'];}return db[_0x1b30('0x2b')][_0x1b30('0x2c')]({'where':{'id':_0x341d4d['params']['id']}})[_0x1b30('0x25')](handleEntityNotFound(_0x7219d,null))[_0x1b30('0x25')](saveUpdates(_0x341d4d['body'],null))[_0x1b30('0x25')](respondWithResult(_0x7219d,null))[_0x1b30('0x2d')](handleError(_0x7219d,null));};exports[_0x1b30('0x26')]=function(_0x53ef59,_0x1f75ba){return db[_0x1b30('0x2b')][_0x1b30('0x2c')]({'where':{'id':_0x53ef59['params']['id']}})[_0x1b30('0x25')](handleEntityNotFound(_0x1f75ba,null))[_0x1b30('0x25')](removeEntity(_0x1f75ba,null))['catch'](handleError(_0x1f75ba,null));}; \ No newline at end of file +var _0x29de=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','destroy','error','stack','name','update','body','Action','find','params','catch','eml-format'];(function(_0x28059d,_0x16255b){var _0x41d60f=function(_0x4ad065){while(--_0x4ad065){_0x28059d['push'](_0x28059d['shift']());}};_0x41d60f(++_0x16255b);}(_0x29de,0xcb));var _0xe29d=function(_0x4842f5,_0x2a668f){_0x4842f5=_0x4842f5-0x0;var _0x178dc0=_0x29de[_0x4842f5];return _0x178dc0;};'use strict';var emlformat=require(_0xe29d('0x0'));var rimraf=require(_0xe29d('0x1'));var zipdir=require(_0xe29d('0x2'));var jsonpatch=require(_0xe29d('0x3'));var rp=require(_0xe29d('0x4'));var moment=require(_0xe29d('0x5'));var BPromise=require(_0xe29d('0x6'));var Mustache=require(_0xe29d('0x7'));var util=require(_0xe29d('0x8'));var path=require(_0xe29d('0x9'));var sox=require(_0xe29d('0xa'));var csv=require(_0xe29d('0xb'));var ejs=require(_0xe29d('0xc'));var fs=require('fs');var fs_extra=require(_0xe29d('0xd'));var _=require(_0xe29d('0xe'));var squel=require(_0xe29d('0xf'));var crypto=require('crypto');var jsforce=require(_0xe29d('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe29d('0x11'));var Papa=require(_0xe29d('0x12'));var Redis=require(_0xe29d('0x13'));var authService=require(_0xe29d('0x14'));var qs=require(_0xe29d('0x15'));var as=require(_0xe29d('0x16'));var hardwareService=require(_0xe29d('0x17'));var logger=require(_0xe29d('0x18'))('api');var utils=require('../../config/utils');var config=require(_0xe29d('0x19'));var licenseUtil=require(_0xe29d('0x1a'));var db=require(_0xe29d('0x1b'))['db'];function respondWithStatusCode(_0x3e17ac,_0x5a2c18){_0x5a2c18=_0x5a2c18||0xcc;return function(_0x4500f4){if(_0x4500f4){return _0x3e17ac[_0xe29d('0x1c')](_0x5a2c18);}return _0x3e17ac[_0xe29d('0x1d')](_0x5a2c18)[_0xe29d('0x1e')]();};}function respondWithResult(_0x1567df,_0x5dd582){_0x5dd582=_0x5dd582||0xc8;return function(_0x4204b5){if(_0x4204b5){return _0x1567df[_0xe29d('0x1d')](_0x5dd582)['json'](_0x4204b5);}};}function respondWithFilteredResult(_0x16d7f2,_0x2ed486){return function(_0x330e5a){if(_0x330e5a){var _0x2cccb3=typeof _0x2ed486[_0xe29d('0x1f')]===_0xe29d('0x20')&&typeof _0x2ed486[_0xe29d('0x21')]===_0xe29d('0x20');var _0x552f75=_0x330e5a[_0xe29d('0x22')];var _0x673324=_0x2cccb3?0x0:_0x2ed486[_0xe29d('0x1f')];var _0xac895d=_0x2cccb3?_0x330e5a[_0xe29d('0x22')]:_0x2ed486[_0xe29d('0x1f')]+_0x2ed486[_0xe29d('0x21')];var _0x421b04;if(_0xac895d>=_0x552f75){_0xac895d=_0x552f75;_0x421b04=0xc8;}else{_0x421b04=0xce;}_0x16d7f2['status'](_0x421b04);return _0x16d7f2[_0xe29d('0x23')](_0xe29d('0x24'),_0x673324+'-'+_0xac895d+'/'+_0x552f75)[_0xe29d('0x25')](_0x330e5a);}return null;};}function patchUpdates(_0x34f311){return function(_0x57f8e9){try{jsonpatch[_0xe29d('0x26')](_0x57f8e9,_0x34f311,!![]);}catch(_0x2a1866){return BPromise[_0xe29d('0x27')](_0x2a1866);}return _0x57f8e9['save']();};}function saveUpdates(_0x226da3,_0x4efae5){return function(_0x37000c){if(_0x37000c){return _0x37000c['update'](_0x226da3)[_0xe29d('0x28')](function(_0x3f1158){return _0x3f1158;});}return null;};}function removeEntity(_0x5e8c14,_0x48f71c){return function(_0x5b94ed){if(_0x5b94ed){return _0x5b94ed[_0xe29d('0x29')]()['then'](function(){_0x5e8c14[_0xe29d('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9c1977,_0x4c7512){return function(_0x21a9eb){if(!_0x21a9eb){_0x9c1977[_0xe29d('0x1c')](0x194);}return _0x21a9eb;};}function handleError(_0x159d05,_0x288794){_0x288794=_0x288794||0x1f4;return function(_0x10be72){logger[_0xe29d('0x2a')](_0x10be72[_0xe29d('0x2b')]);if(_0x10be72[_0xe29d('0x2c')]){delete _0x10be72[_0xe29d('0x2c')];}_0x159d05['status'](_0x288794)['send'](_0x10be72);};}exports[_0xe29d('0x2d')]=function(_0x4d3fcd,_0x3af7c0){if(_0x4d3fcd[_0xe29d('0x2e')]['id']){delete _0x4d3fcd[_0xe29d('0x2e')]['id'];}return db[_0xe29d('0x2f')][_0xe29d('0x30')]({'where':{'id':_0x4d3fcd[_0xe29d('0x31')]['id']}})['then'](handleEntityNotFound(_0x3af7c0,null))[_0xe29d('0x28')](saveUpdates(_0x4d3fcd['body'],null))[_0xe29d('0x28')](respondWithResult(_0x3af7c0,null))[_0xe29d('0x32')](handleError(_0x3af7c0,null));};exports[_0xe29d('0x29')]=function(_0x17ab61,_0x5bb4e6){return db[_0xe29d('0x2f')][_0xe29d('0x30')]({'where':{'id':_0x17ab61['params']['id']}})[_0xe29d('0x28')](handleEntityNotFound(_0x5bb4e6,null))[_0xe29d('0x28')](removeEntity(_0x5bb4e6,null))[_0xe29d('0x32')](handleError(_0x5bb4e6,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index d4c8d90..e9df471 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 _0xd6da=['../../config/logger','path','./action.attributes','exports','define','Action','util'];(function(_0x4a713d,_0x1219f8){var _0x48bb69=function(_0x9771e0){while(--_0x9771e0){_0x4a713d['push'](_0x4a713d['shift']());}};_0x48bb69(++_0x1219f8);}(_0xd6da,0x76));var _0xad6d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd6da[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xad6d('0x0'));var logger=require(_0xad6d('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xad6d('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xad6d('0x3'));module[_0xad6d('0x4')]=function(_0x36c772,_0x1ea4f2){return _0x36c772[_0xad6d('0x5')](_0xad6d('0x6'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3276=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','tools_actions','lodash'];(function(_0x30ffc9,_0x2b08ab){var _0x7f22a9=function(_0x2a3f34){while(--_0x2a3f34){_0x30ffc9['push'](_0x30ffc9['shift']());}};_0x7f22a9(++_0x2b08ab);}(_0x3276,0xc7));var _0x6327=function(_0x1c03c2,_0x512c06){_0x1c03c2=_0x1c03c2-0x0;var _0x4d8b73=_0x3276[_0x1c03c2];return _0x4d8b73;};'use strict';var _=require(_0x6327('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6327('0x1'));var moment=require(_0x6327('0x2'));var BPromise=require(_0x6327('0x3'));var rp=require(_0x6327('0x4'));var fs=require('fs');var path=require(_0x6327('0x5'));var rimraf=require(_0x6327('0x6'));var config=require(_0x6327('0x7'));var attributes=require('./action.attributes');module['exports']=function(_0x10b982,_0x37adde){return _0x10b982[_0x6327('0x8')]('Action',attributes,{'tableName':_0x6327('0x9'),'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 30ccdb0..85eec8f 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x520281,_0x2c042f){var _0x64fd88=function(_0x161bfa){while(--_0x161bfa){_0x520281['push'](_0x520281['shift']());}};_0x64fd88(++_0x2c042f);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1c8cc6,_0x411e5c){_0x1c8cc6=_0x1c8cc6-0x0;var _0x522936=_0x5fc3[_0x1c8cc6];return _0x522936;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});} \ No newline at end of file +var _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(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x1cb9,0x14e));var _0x91cb=function(_0x20092e,_0x394907){_0x20092e=_0x20092e-0x0;var _0x161c0e=_0x1cb9[_0x20092e];return _0x161c0e;};'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 diff --git a/server/api/action/index.js b/server/api/action/index.js index 4969564..8e4bbd6 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 _0xf822=['../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','delete','/:id','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1ba420,_0x4539b5){var _0x2ab29d=function(_0x40149e){while(--_0x40149e){_0x1ba420['push'](_0x1ba420['shift']());}};_0x2ab29d(++_0x4539b5);}(_0xf822,0x159));var _0x2f82=function(_0x1a70f9,_0x2252d5){_0x1a70f9=_0x1a70f9-0x0;var _0x55c78b=_0xf822[_0x1a70f9];return _0x55c78b;};'use strict';var multer=require(_0x2f82('0x0'));var util=require('util');var path=require(_0x2f82('0x1'));var timeout=require(_0x2f82('0x2'));var express=require(_0x2f82('0x3'));var router=express[_0x2f82('0x4')]();var fs_extra=require(_0x2f82('0x5'));var auth=require(_0x2f82('0x6'));var interaction=require(_0x2f82('0x7'));var config=require(_0x2f82('0x8'));var controller=require(_0x2f82('0x9'));router[_0x2f82('0xa')]('/:id',auth[_0x2f82('0xb')](),controller[_0x2f82('0xc')]);router[_0x2f82('0xd')](_0x2f82('0xe'),auth[_0x2f82('0xb')](),controller[_0x2f82('0xf')]);module['exports']=router; \ No newline at end of file +var _0x45b2=['express','Router','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id','isAuthenticated','delete','destroy','multer','util','path','connect-timeout'];(function(_0xb83515,_0x15f73b){var _0x57dc1f=function(_0x55b921){while(--_0x55b921){_0xb83515['push'](_0xb83515['shift']());}};_0x57dc1f(++_0x15f73b);}(_0x45b2,0x6c));var _0x245b=function(_0x4dd37a,_0x1ab586){_0x4dd37a=_0x4dd37a-0x0;var _0x4e3f21=_0x45b2[_0x4dd37a];return _0x4e3f21;};'use strict';var multer=require(_0x245b('0x0'));var util=require(_0x245b('0x1'));var path=require(_0x245b('0x2'));var timeout=require(_0x245b('0x3'));var express=require(_0x245b('0x4'));var router=express[_0x245b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x245b('0x6'));var interaction=require(_0x245b('0x7'));var config=require('../../config/environment');var controller=require(_0x245b('0x8'));router[_0x245b('0x9')](_0x245b('0xa'),auth[_0x245b('0xb')](),controller['update']);router[_0x245b('0xc')](_0x245b('0xa'),auth[_0x245b('0xb')](),controller[_0x245b('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 828e61f..3f57c50 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 _0xeec6=['STRING','TEXT','sequelize','exports'];(function(_0x2dc1fd,_0x1f799b){var _0x3e0dca=function(_0x464221){while(--_0x464221){_0x2dc1fd['push'](_0x2dc1fd['shift']());}};_0x3e0dca(++_0x1f799b);}(_0xeec6,0x1c2));var _0x6eec=function(_0x3ca7a9,_0x4fc0c7){_0x3ca7a9=_0x3ca7a9-0x0;var _0x399428=_0xeec6[_0x3ca7a9];return _0x399428;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'name':{'type':Sequelize[_0x6eec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6eec('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x6eec('0x2')]},'conditions':{'type':Sequelize[_0x6eec('0x3')]},'joins':{'type':Sequelize[_0x6eec('0x3')]}}; \ No newline at end of file +var _0xf494=['STRING','TEXT','sequelize','exports'];(function(_0x39e164,_0x2cb93b){var _0x13fa6b=function(_0x511cb2){while(--_0x511cb2){_0x39e164['push'](_0x39e164['shift']());}};_0x13fa6b(++_0x2cb93b);}(_0xf494,0x1c6));var _0x4f49=function(_0x439af5,_0x267b72){_0x439af5=_0x439af5-0x0;var _0x49e8b2=_0xf494[_0x439af5];return _0x49e8b2;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'name':{'type':Sequelize[_0x4f49('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4f49('0x2')]},'table':{'type':Sequelize[_0x4f49('0x2')]},'conditions':{'type':Sequelize[_0x4f49('0x3')]},'joins':{'type':Sequelize[_0x4f49('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 36681f8..f8036ce 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 _0x13d6=['IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','right_join','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','Sequelize','from','groupBy','orderBy','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','COUNT(%s)','operator','Please\x20insert\x20at\x20least\x20one\x20field','debug','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','CustomReports','destroy','error','stack','name','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL'];(function(_0x2f4f25,_0x592d31){var _0x6a112a=function(_0x112d68){while(--_0x112d68){_0x2f4f25['push'](_0x2f4f25['shift']());}};_0x6a112a(++_0x592d31);}(_0x13d6,0x196));var _0x613d=function(_0x1a57c7,_0x1f0c32){_0x1a57c7=_0x1a57c7-0x0;var _0xb5899c=_0x13d6[_0x1a57c7];return _0xb5899c;};'use strict';var emlformat=require(_0x613d('0x0'));var rimraf=require(_0x613d('0x1'));var zipdir=require(_0x613d('0x2'));var jsonpatch=require(_0x613d('0x3'));var rp=require(_0x613d('0x4'));var moment=require(_0x613d('0x5'));var BPromise=require(_0x613d('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x613d('0x7'));var sox=require(_0x613d('0x8'));var csv=require(_0x613d('0x9'));var ejs=require(_0x613d('0xa'));var fs=require('fs');var fs_extra=require(_0x613d('0xb'));var _=require(_0x613d('0xc'));var squel=require(_0x613d('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x613d('0xe'));var toCsv=require(_0x613d('0x9'));var querystring=require(_0x613d('0xf'));var Papa=require(_0x613d('0x10'));var Redis=require('ioredis');var authService=require(_0x613d('0x11'));var qs=require(_0x613d('0x12'));var as=require(_0x613d('0x13'));var hardwareService=require(_0x613d('0x14'));var logger=require('../../config/logger')(_0x613d('0x15'));var utils=require(_0x613d('0x16'));var config=require(_0x613d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x613d('0x18'))['db'];var dbH=require(_0x613d('0x18'))[_0x613d('0x19')];function respondWithStatusCode(_0x5887fa,_0x38bf9b){_0x38bf9b=_0x38bf9b||0xcc;return function(_0x23f43f){if(_0x23f43f){return _0x5887fa[_0x613d('0x1a')](_0x38bf9b);}return _0x5887fa[_0x613d('0x1b')](_0x38bf9b)[_0x613d('0x1c')]();};}function respondWithResult(_0x566583,_0x3dea50){_0x3dea50=_0x3dea50||0xc8;return function(_0xc63268){if(_0xc63268){return _0x566583['status'](_0x3dea50)[_0x613d('0x1d')](_0xc63268);}};}function respondWithFilteredResult(_0x404d4c,_0x5bb993){return function(_0x4f6f11){if(_0x4f6f11){var _0x25e830=typeof _0x5bb993[_0x613d('0x1e')]===_0x613d('0x1f')&&typeof _0x5bb993[_0x613d('0x20')]===_0x613d('0x1f');var _0x3a4c6e=_0x4f6f11[_0x613d('0x21')];var _0x4017a8=_0x25e830?0x0:_0x5bb993[_0x613d('0x1e')];var _0x52f4b2=_0x25e830?_0x4f6f11['count']:_0x5bb993[_0x613d('0x1e')]+_0x5bb993[_0x613d('0x20')];var _0x48c98d;if(_0x52f4b2>=_0x3a4c6e){_0x52f4b2=_0x3a4c6e;_0x48c98d=0xc8;}else{_0x48c98d=0xce;}_0x404d4c['status'](_0x48c98d);return _0x404d4c['set'](_0x613d('0x22'),_0x4017a8+'-'+_0x52f4b2+'/'+_0x3a4c6e)[_0x613d('0x1d')](_0x4f6f11);}return null;};}function patchUpdates(_0x5ea374){return function(_0x1f67e4){try{jsonpatch[_0x613d('0x23')](_0x1f67e4,_0x5ea374,!![]);}catch(_0x290e03){return BPromise[_0x613d('0x24')](_0x290e03);}return _0x1f67e4[_0x613d('0x25')]();};}function saveUpdates(_0x37fd5a,_0x5257ee){return function(_0x36b850){if(_0x36b850){return _0x36b850[_0x613d('0x26')](_0x37fd5a)['then'](function(_0x1c85a9){return _0x1c85a9;});}return null;};}function removeEntity(_0x199a0f,_0xf49371){return function(_0x4dcfa7){if(_0x4dcfa7){return _0x4dcfa7['destroy']()[_0x613d('0x27')](function(){var _0x5d6b80=_0x4dcfa7[_0x613d('0x28')]({'plain':!![]});var _0x4dd122=_0x613d('0x29');return db['UserProfileResource'][_0x613d('0x2a')]({'where':{'type':_0x4dd122,'resourceId':_0x5d6b80['id']}})[_0x613d('0x27')](function(){return _0x4dcfa7;});})[_0x613d('0x27')](function(){_0x199a0f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x205513,_0x32baf4){return function(_0x499b7d){if(!_0x499b7d){_0x205513[_0x613d('0x1a')](0x194);}return _0x499b7d;};}function handleError(_0xc06fad,_0x3fb0fd){_0x3fb0fd=_0x3fb0fd||0x1f4;return function(_0x5ccac3){logger[_0x613d('0x2b')](_0x5ccac3[_0x613d('0x2c')]);if(_0x5ccac3[_0x613d('0x2d')]){delete _0x5ccac3[_0x613d('0x2d')];}_0xc06fad[_0x613d('0x1b')](_0x3fb0fd)['send'](_0x5ccac3);};}exports['index']=function(_0x38e3e0,_0x20a09c){var _0x3c7e2c={},_0x26a8c9={},_0x16e65b={'count':0x0,'rows':[]};var _0x3444b3=_[_0x613d('0x2e')](db[_0x613d('0x2f')][_0x613d('0x30')],function(_0x4019ee){return{'name':_0x4019ee[_0x613d('0x31')],'type':_0x4019ee[_0x613d('0x32')][_0x613d('0x33')]};});_0x26a8c9[_0x613d('0x34')]=_[_0x613d('0x2e')](_0x3444b3,'name');_0x26a8c9[_0x613d('0x35')]=_['keys'](_0x38e3e0[_0x613d('0x35')]);_0x26a8c9[_0x613d('0x36')]=_['intersection'](_0x26a8c9[_0x613d('0x34')],_0x26a8c9[_0x613d('0x35')]);_0x3c7e2c[_0x613d('0x37')]=_[_0x613d('0x38')](_0x26a8c9['model'],qs[_0x613d('0x39')](_0x38e3e0[_0x613d('0x35')][_0x613d('0x39')]));_0x3c7e2c[_0x613d('0x37')]=_0x3c7e2c[_0x613d('0x37')][_0x613d('0x3a')]?_0x3c7e2c['attributes']:_0x26a8c9['model'];if(!_0x38e3e0[_0x613d('0x35')][_0x613d('0x3b')](_0x613d('0x3c'))){_0x3c7e2c['limit']=qs[_0x613d('0x20')](_0x38e3e0['query'][_0x613d('0x20')]);_0x3c7e2c['offset']=qs['offset'](_0x38e3e0[_0x613d('0x35')]['offset']);}_0x3c7e2c['order']=qs[_0x613d('0x3d')](_0x38e3e0['query'][_0x613d('0x3d')]);_0x3c7e2c[_0x613d('0x3e')]=qs[_0x613d('0x36')](_[_0x613d('0x3f')](_0x38e3e0[_0x613d('0x35')],_0x26a8c9[_0x613d('0x36')]),_0x3444b3);if(_0x38e3e0['query'][_0x613d('0x40')]){_0x3c7e2c[_0x613d('0x3e')]=_[_0x613d('0x41')](_0x3c7e2c['where'],{'$or':_[_0x613d('0x2e')](_0x3444b3,function(_0x2a3f4e){if(_0x2a3f4e[_0x613d('0x32')]!=='VIRTUAL'){var _0x36da95={};_0x36da95[_0x2a3f4e['name']]={'$like':'%'+_0x38e3e0['query']['filter']+'%'};return _0x36da95;}})});}_0x3c7e2c=_[_0x613d('0x41')]({},_0x3c7e2c,_0x38e3e0[_0x613d('0x42')]);var _0x37dd73={'where':_0x3c7e2c['where']};return db[_0x613d('0x2f')][_0x613d('0x21')](_0x37dd73)[_0x613d('0x27')](function(_0x26a64a){_0x16e65b[_0x613d('0x21')]=_0x26a64a;if(_0x38e3e0[_0x613d('0x35')]['includeAll']){_0x3c7e2c[_0x613d('0x43')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x613d('0x44')](_0x3c7e2c);})[_0x613d('0x27')](function(_0x7bf8d6){_0x16e65b[_0x613d('0x45')]=_0x7bf8d6;return _0x16e65b;})[_0x613d('0x27')](respondWithFilteredResult(_0x20a09c,_0x3c7e2c))[_0x613d('0x46')](handleError(_0x20a09c,null));};exports[_0x613d('0x47')]=function(_0x5a2b8e,_0x12bda7){var _0x345b34={'raw':![],'where':{'id':_0x5a2b8e[_0x613d('0x48')]['id']}},_0x5637b3={};_0x5637b3[_0x613d('0x34')]=_['keys'](db[_0x613d('0x2f')][_0x613d('0x30')]);_0x5637b3[_0x613d('0x35')]=_['keys'](_0x5a2b8e[_0x613d('0x35')]);_0x5637b3[_0x613d('0x36')]=_[_0x613d('0x38')](_0x5637b3[_0x613d('0x34')],_0x5637b3[_0x613d('0x35')]);_0x345b34['attributes']=_[_0x613d('0x38')](_0x5637b3[_0x613d('0x34')],qs[_0x613d('0x39')](_0x5a2b8e['query']['fields']));_0x345b34[_0x613d('0x37')]=_0x345b34['attributes'][_0x613d('0x3a')]?_0x345b34[_0x613d('0x37')]:_0x5637b3[_0x613d('0x34')];if(_0x5a2b8e[_0x613d('0x35')][_0x613d('0x49')]){_0x345b34['include']=[{'all':!![]}];}_0x345b34=_[_0x613d('0x41')]({},_0x345b34,_0x5a2b8e['options']);return db[_0x613d('0x2f')][_0x613d('0x4a')](_0x345b34)['then'](handleEntityNotFound(_0x12bda7,null))[_0x613d('0x27')](respondWithResult(_0x12bda7,null))[_0x613d('0x46')](handleError(_0x12bda7,null));};exports[_0x613d('0x4b')]=function(_0x1b6a3d,_0x265411){return db[_0x613d('0x2f')][_0x613d('0x4b')](_0x1b6a3d[_0x613d('0x4c')],{})[_0x613d('0x27')](function(_0x4b5256){var _0x18fc73=_0x1b6a3d[_0x613d('0x4d')][_0x613d('0x28')]({'plain':!![]});if(!_0x18fc73)throw new Error(_0x613d('0x4e'));if(_0x18fc73[_0x613d('0x4f')]===_0x613d('0x4d')){var _0x15a082=_0x4b5256[_0x613d('0x28')]({'plain':!![]});var _0x58b092=_0x613d('0x50');return db[_0x613d('0x51')][_0x613d('0x4a')]({'where':{'name':_0x58b092,'userProfileId':_0x18fc73[_0x613d('0x52')]},'raw':!![]})['then'](function(_0x577acd){if(_0x577acd&&_0x577acd['autoAssociation']===0x0){return db[_0x613d('0x53')][_0x613d('0x4b')]({'name':_0x15a082[_0x613d('0x2d')],'resourceId':_0x15a082['id'],'type':'CustomReports','sectionId':_0x577acd['id']},{})['then'](function(){return _0x4b5256;});}else{return _0x4b5256;}})[_0x613d('0x46')](function(_0x5f207b){logger[_0x613d('0x2b')](_0x613d('0x54'),_0x5f207b);throw _0x5f207b;});}return _0x4b5256;})[_0x613d('0x27')](respondWithResult(_0x265411,0xc9))[_0x613d('0x46')](handleError(_0x265411,null));};exports[_0x613d('0x26')]=function(_0x4c68d1,_0x2ed10a){if(_0x4c68d1[_0x613d('0x4c')]['id']){delete _0x4c68d1[_0x613d('0x4c')]['id'];}return db[_0x613d('0x2f')][_0x613d('0x4a')]({'where':{'id':_0x4c68d1[_0x613d('0x48')]['id']}})[_0x613d('0x27')](handleEntityNotFound(_0x2ed10a,null))[_0x613d('0x27')](saveUpdates(_0x4c68d1[_0x613d('0x4c')],null))[_0x613d('0x27')](respondWithResult(_0x2ed10a,null))[_0x613d('0x46')](handleError(_0x2ed10a,null));};exports[_0x613d('0x2a')]=function(_0x2da796,_0x4d0298){return db[_0x613d('0x2f')]['find']({'where':{'id':_0x2da796[_0x613d('0x48')]['id']}})[_0x613d('0x27')](handleEntityNotFound(_0x4d0298,null))[_0x613d('0x27')](removeEntity(_0x4d0298,null))[_0x613d('0x46')](handleError(_0x4d0298,null));};exports[_0x613d('0x55')]=function(_0x1ca0ae,_0x5d73f0){var _0x3a55fa=0xa;var _0x2d9186=[_0x613d('0x56'),_0x613d('0x57'),'right_join',_0x613d('0x58')];var _0x311a2b={'SUM':_0x613d('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x613d('0x5a'),'MAX':_0x613d('0x5b'),'MIN':_0x613d('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x613d('0x5d'),'GROUP_CONCAT ASC':_0x613d('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x12b5b8={'SEC_TO_TIME':_0x613d('0x5f'),'DATE':_0x613d('0x60'),'HOUR':'HOUR(%s)','ROUND':_0x613d('0x61'),'UNIX_TIMESTAMP':_0x613d('0x62')};var _0x35100c=function(_0x286584){return!_[_0x613d('0x63')]([_0x613d('0x64'),_0x613d('0x65'),_0x613d('0x66'),_0x613d('0x67')],_0x286584);};var _0x11c5a7=function(_0x23df8b){if(!_0x23df8b||!_0x23df8b['rules'][_0x613d('0x3a')]){return'';}for(var _0x51fa98='(',_0x3d76fc=0x0;_0x3d76fc<_0x23df8b[_0x613d('0x68')][_0x613d('0x3a')];_0x3d76fc+=0x1){_0x3d76fc>0x0&&(_0x51fa98+='\x20'+_0x23df8b['operator']+'\x20');_0x51fa98+=_0x23df8b['rules'][_0x3d76fc][_0x613d('0x69')]?_0x11c5a7(_0x23df8b[_0x613d('0x68')][_0x3d76fc][_0x613d('0x69')]):_0x23df8b[_0x613d('0x68')][_0x3d76fc][_0x613d('0x6a')]+'\x20'+_0x23df8b['rules'][_0x3d76fc][_0x613d('0x6b')]+(_0x35100c(_0x23df8b[_0x613d('0x68')][_0x3d76fc][_0x613d('0x6b')])?'\x20'+_0x23df8b[_0x613d('0x68')][_0x3d76fc][_0x613d('0x6c')]:'');}return _0x51fa98+')';};var _0x3746ce={'where':{'id':_0x1ca0ae[_0x613d('0x48')]['id']}},_0x495492,_0x235cf8,_0x39ec7a,_0x2ef31d,_0x299097;_0x3746ce=_[_0x613d('0x41')]({},_0x3746ce,_0x1ca0ae[_0x613d('0x42')]);return db[_0x613d('0x2f')]['find'](_0x3746ce)[_0x613d('0x27')](function(_0x3c6a26){if(_0x3c6a26){_0x495492=_0x3c6a26;return _0x3c6a26[_0x613d('0x6d')]();}return null;})[_0x613d('0x27')](function(_0x3c2f7c){if(_0x3c2f7c){if(!_0x3c2f7c[_0x613d('0x3a')]){throw new db['Sequelize'][(_0x613d('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x235cf8=_0x3c2f7c;return db[_0x613d('0x6f')]['findAll']({'raw':!![]});}return null;})[_0x613d('0x27')](function(_0x54b08e){if(_0x54b08e){_0x39ec7a=_[_0x613d('0x70')](_0x54b08e,'id');var _0x44bbfd;var _0x1dd303=squel[_0x613d('0x71')]();_0x1dd303['from'](_0x495492[_0x613d('0x72')]);for(var _0x488beb=0x0;_0x488beb<_0x235cf8[_0x613d('0x3a')];_0x488beb+=0x1){_0x44bbfd=_0x235cf8[_0x488beb]['MetricId']?_0x39ec7a[_0x235cf8[_0x488beb][_0x613d('0x73')]][_0x613d('0x74')]:_0x235cf8[_0x488beb][_0x613d('0x6a')];_0x44bbfd=_0x235cf8[_0x488beb][_0x613d('0x75')]?_[_0x613d('0x76')](_0x311a2b[_0x235cf8[_0x488beb][_0x613d('0x75')]],'%s',_0x44bbfd):_0x44bbfd;_0x44bbfd=_0x235cf8[_0x488beb]['format']?_['replace'](_0x12b5b8[_0x235cf8[_0x488beb][_0x613d('0x77')]],'%s',_0x44bbfd):_0x44bbfd;if(_0x235cf8[_0x488beb]['groupBy']){_0x1dd303[_0x613d('0x69')](_0x44bbfd);}_0x235cf8[_0x488beb]['orderBy']&&_0x1dd303[_0x613d('0x78')](_0x44bbfd,_0x235cf8[_0x488beb]['orderBy']===_0x613d('0x79')?![]:!![]);_0x1dd303['field'](_0x44bbfd,_0x235cf8[_0x488beb][_0x613d('0x7a')]||_0x44bbfd);}if(_0x495492[_0x613d('0x7b')]){_0x495492[_0x613d('0x7b')]=JSON[_0x613d('0x7c')](_0x495492[_0x613d('0x7b')]);for(var _0x1684a0=0x0;_0x1684a0<_0x495492[_0x613d('0x7b')][_0x613d('0x3a')];_0x1684a0+=0x1){if(_0x495492[_0x613d('0x7b')][_0x1684a0]['type']&&_[_0x613d('0x63')](_0x2d9186,_0x495492['joins'][_0x1684a0][_0x613d('0x32')])&&_0x495492[_0x613d('0x7b')][_0x1684a0][_0x613d('0x7d')]&&_0x495492[_0x613d('0x7b')][_0x1684a0][_0x613d('0x7e')]&&_0x495492[_0x613d('0x7b')][_0x1684a0][_0x613d('0x7f')]){_0x1dd303[_0x495492['joins'][_0x1684a0][_0x613d('0x32')]](_0x495492[_0x613d('0x7b')][_0x1684a0]['foreignTable'],null,util[_0x613d('0x77')](_0x613d('0x80'),_0x495492[_0x613d('0x72')],_0x495492[_0x613d('0x7b')][_0x1684a0][_0x613d('0x7d')],_0x495492['joins'][_0x1684a0][_0x613d('0x7e')],_0x495492['joins'][_0x1684a0][_0x613d('0x7f')]));}}}if(_0x495492['conditions']){_0x495492['conditions']=JSON[_0x613d('0x7c')](_0x495492[_0x613d('0x81')]);_0x1dd303[_0x613d('0x3e')](_0x11c5a7(_0x495492[_0x613d('0x81')][_0x613d('0x69')]));}_0x299097=_0x1dd303[_0x613d('0x82')]();_0x1dd303[_0x613d('0x20')](_0x3a55fa);_0x1dd303[_0x613d('0x1e')](0x0);logger['debug'](_0x613d('0x83'),_0x1dd303[_0x613d('0x84')]());return dbH[_0x613d('0x85')][_0x613d('0x35')](_0x1dd303[_0x613d('0x84')](),{'type':dbH[_0x613d('0x85')][_0x613d('0x86')][_0x613d('0x87')]});}})['then'](respondWithResult(_0x5d73f0,null))[_0x613d('0x46')](handleError(_0x5d73f0,null));};function runReport(_0x107af1,_0x5026a8,_0xe883a5){var _0x3542a8=_0x5026a8['name'];var _0x5ac4bf=0xa;var _0xd5edd5=[_0x613d('0x56'),_0x613d('0x57'),_0x613d('0x88'),'cross_join'];var _0x4dc9c7={'SUM':_0x613d('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x613d('0x5a'),'MAX':_0x613d('0x5b'),'MIN':_0x613d('0x5c'),'AVG':_0x613d('0x89'),'GROUP_CONCAT':_0x613d('0x5d'),'GROUP_CONCAT ASC':_0x613d('0x5e'),'GROUP_CONCAT DESC':_0x613d('0x8a')};var _0x5f3ad7={'SEC_TO_TIME':_0x613d('0x5f'),'DATE':_0x613d('0x60'),'HOUR':_0x613d('0x8b'),'ROUND':_0x613d('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5095bb=function(_0x1b5bbd){return!_['includes']([_0x613d('0x64'),_0x613d('0x65'),'IS\x20EMPTY',_0x613d('0x67')],_0x1b5bbd);};var _0x3fac09=function(_0x43875c){if(!_0x43875c||!_0x43875c[_0x613d('0x68')][_0x613d('0x3a')]){return'';}for(var _0x535eb5='(',_0x36c094=0x0;_0x36c094<_0x43875c[_0x613d('0x68')][_0x613d('0x3a')];_0x36c094+=0x1){_0x36c094>0x0&&(_0x535eb5+='\x20'+_0x43875c['operator']+'\x20');_0x535eb5+=_0x43875c['rules'][_0x36c094][_0x613d('0x69')]?_0x3fac09(_0x43875c[_0x613d('0x68')][_0x36c094]['group']):_0x43875c[_0x613d('0x68')][_0x36c094][_0x613d('0x6a')]+'\x20'+_0x43875c[_0x613d('0x68')][_0x36c094][_0x613d('0x6b')]+(_0x5095bb(_0x43875c['rules'][_0x36c094][_0x613d('0x6b')])?'\x20'+_0x43875c[_0x613d('0x68')][_0x36c094]['value']:'');}return _0x535eb5+')';};var _0x464742={'where':{'id':_0x107af1['id']}},_0x2bf5b9,_0x27c6b1,_0x5b6bf2,_0x1a08ba,_0x44e273;_0x464742=_[_0x613d('0x41')]({},_0x464742,_0xe883a5);return db[_0x613d('0x2f')][_0x613d('0x4a')](_0x464742)[_0x613d('0x27')](function(_0x1f7801){if(_0x1f7801){_0x2bf5b9=_0x1f7801;return _0x1f7801[_0x613d('0x6d')]();}return null;})[_0x613d('0x27')](function(_0x831811){if(_0x831811){if(!_0x831811['length']){throw new db[(_0x613d('0x8c'))][(_0x613d('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x27c6b1=_0x831811;return db[_0x613d('0x6f')][_0x613d('0x44')]({'raw':!![]});}return null;})['then'](function(_0x3e0115){if(_0x3e0115){_0x5b6bf2=_[_0x613d('0x70')](_0x3e0115,'id');var _0x264f58;var _0x21f1d9=squel['select']();_0x21f1d9[_0x613d('0x8d')](_0x2bf5b9[_0x613d('0x72')]);for(var _0x471362=0x0;_0x471362<_0x27c6b1[_0x613d('0x3a')];_0x471362+=0x1){_0x264f58=_0x27c6b1[_0x471362][_0x613d('0x73')]?_0x5b6bf2[_0x27c6b1[_0x471362][_0x613d('0x73')]][_0x613d('0x74')]:_0x27c6b1[_0x471362][_0x613d('0x6a')];_0x264f58=_0x27c6b1[_0x471362][_0x613d('0x75')]?_['replace'](_0x4dc9c7[_0x27c6b1[_0x471362]['function']],'%s',_0x264f58):_0x264f58;_0x264f58=_0x27c6b1[_0x471362][_0x613d('0x77')]?_[_0x613d('0x76')](_0x5f3ad7[_0x27c6b1[_0x471362]['format']],'%s',_0x264f58):_0x264f58;if(_0x27c6b1[_0x471362][_0x613d('0x8e')]){_0x21f1d9[_0x613d('0x69')](_0x264f58);}_0x27c6b1[_0x471362][_0x613d('0x8f')]&&_0x21f1d9[_0x613d('0x78')](_0x264f58,_0x27c6b1[_0x471362]['orderBy']==='DESC'?![]:!![]);_0x21f1d9[_0x613d('0x6a')](_0x264f58,_0x27c6b1[_0x471362][_0x613d('0x7a')]||_0x264f58);}if(_0x2bf5b9[_0x613d('0x7b')]){_0x2bf5b9['joins']=JSON[_0x613d('0x7c')](_0x2bf5b9['joins']);for(var _0x54df4=0x0;_0x54df4<_0x2bf5b9[_0x613d('0x7b')][_0x613d('0x3a')];_0x54df4+=0x1){if(_0x2bf5b9[_0x613d('0x7b')][_0x54df4]['type']&&_[_0x613d('0x63')](_0xd5edd5,_0x2bf5b9[_0x613d('0x7b')][_0x54df4][_0x613d('0x32')])&&_0x2bf5b9[_0x613d('0x7b')][_0x54df4]['parentKey']&&_0x2bf5b9[_0x613d('0x7b')][_0x54df4][_0x613d('0x7e')]&&_0x2bf5b9[_0x613d('0x7b')][_0x54df4][_0x613d('0x7f')]){_0x21f1d9[_0x2bf5b9[_0x613d('0x7b')][_0x54df4][_0x613d('0x32')]](_0x2bf5b9[_0x613d('0x7b')][_0x54df4][_0x613d('0x7e')],null,util[_0x613d('0x77')]('%s.%s\x20=\x20%s.%s',_0x2bf5b9['table'],_0x2bf5b9[_0x613d('0x7b')][_0x54df4][_0x613d('0x7d')],_0x2bf5b9['joins'][_0x54df4][_0x613d('0x7e')],_0x2bf5b9[_0x613d('0x7b')][_0x54df4][_0x613d('0x7f')]));}}}if(_0x2bf5b9[_0x613d('0x81')]){_0x2bf5b9[_0x613d('0x81')]=JSON[_0x613d('0x7c')](_0x2bf5b9[_0x613d('0x81')]);_0x21f1d9[_0x613d('0x3e')](_0x3fac09(_0x2bf5b9[_0x613d('0x81')][_0x613d('0x69')]));}_0x44e273=_0x21f1d9[_0x613d('0x82')]();_0x21f1d9['limit'](_0x5ac4bf);_0x21f1d9[_0x613d('0x1e')](0x0);return;}})[_0x613d('0x27')](function(){if(_0x5026a8[_0x613d('0x90')]===_0x613d('0x91')){return null;}var _0x299191=_[_0x613d('0x41')](_0x5026a8,{'name':_0x5026a8[_0x613d('0x92')]||_0x5026a8[_0x613d('0x2d')]||_0x2bf5b9[_0x613d('0x2d')],'basename':_0x3542a8,'savename':util['format'](_0x613d('0x93'),_0x5026a8[_0x613d('0x2d')]||_0x2bf5b9[_0x613d('0x2d')],require(_0x613d('0x94'))[_0x613d('0x95')](0x4),_0x5026a8['output']||_0x613d('0x96')),'reportId':_0x2bf5b9['id'],'reportType':'custom'});return db[_0x613d('0x97')][_0x613d('0x4b')](_0x299191,{'raw':!![]});})[_0x613d('0x27')](function(_0x1812c5){if(_0x2bf5b9['table']===_0x613d('0x98')){_0x44e273[_0x613d('0x3e')](_0x2bf5b9[_0x613d('0x72')]+_0x613d('0x99'),_0x5026a8[_0x613d('0x9a')],_0x5026a8[_0x613d('0x9b')]);}else{_0x44e273['where'](_0x2bf5b9[_0x613d('0x72')]+_0x613d('0x9c'),_0x5026a8[_0x613d('0x9a')],_0x5026a8[_0x613d('0x9b')]);}if(_0x1812c5){logger[_0x613d('0x9d')](_0x613d('0x9e'),_0x44e273[_0x613d('0x84')]());require(_0x613d('0x9f'))['fork'](path[_0x613d('0x56')](__dirname,_0x613d('0xa0'),_0x1812c5['output']),[_0x1812c5['id'],_0x44e273[_0x613d('0x84')](),path[_0x613d('0x56')](__dirname,_0x613d('0xa1'),_0x1812c5[_0x613d('0xa2')]),_0x3542a8]);return _0x1812c5;}else{var _0x504675=squel[_0x613d('0x71')]();_0x504675[_0x613d('0x8d')]('('+_0x44e273['toString']()+')',_0x613d('0xa3'));_0x504675[_0x613d('0x6a')](_0x613d('0xa4'),_0x613d('0x21'));_0x44e273[_0x613d('0x20')](_0x5026a8[_0x613d('0x20')]||_0x5ac4bf);_0x44e273[_0x613d('0x1e')](_0x5026a8[_0x613d('0x1e')]||0x0);return dbH[_0x613d('0x85')]['query'](_0x504675[_0x613d('0x84')](),{'type':dbH[_0x613d('0x85')]['QueryTypes'][_0x613d('0x87')]})[_0x613d('0x27')](function(_0x5ad775){if(!_0x5ad775[_0x613d('0x3a')]){_0x1a08ba=0x0;}else{_0x1a08ba=_0x5ad775[0x0][_0x613d('0x21')]||0x0;}return dbH['sequelize'][_0x613d('0x35')](_0x44e273[_0x613d('0x84')](),{'type':dbH['sequelize']['QueryTypes'][_0x613d('0x87')]});})['then'](function(_0x5516be){return{'rows':_0x5516be||[],'count':_0x1a08ba};});}});}exports['run']=function(_0x3873b5,_0x1cb61b){return runReport(_0x3873b5[_0x613d('0x48')],_0x3873b5[_0x613d('0x35')],_0x3873b5['options'])['then'](respondWithResult(_0x1cb61b,null))[_0x613d('0x46')](handleError(_0x1cb61b,null));};exports['runReport']=runReport;exports[_0x613d('0x35')]=function(_0x2ee140,_0x5d3bbe){var _0x5a68b9=0xa;var _0x40656d=[_0x613d('0x56'),_0x613d('0x57'),_0x613d('0x88'),'cross_join'];var _0x208d08={'SUM':'SUM(%s)','COUNT':_0x613d('0xa5'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x613d('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x613d('0x5d'),'GROUP_CONCAT ASC':_0x613d('0x5e'),'GROUP_CONCAT DESC':_0x613d('0x8a')};var _0x250417={'SEC_TO_TIME':_0x613d('0x5f'),'DATE':_0x613d('0x60'),'HOUR':_0x613d('0x8b'),'ROUND':_0x613d('0x61'),'UNIX_TIMESTAMP':_0x613d('0x62')};var _0x39b5c9=function(_0x6ba44){return!_[_0x613d('0x63')]([_0x613d('0x64'),_0x613d('0x65'),_0x613d('0x66'),_0x613d('0x67')],_0x6ba44);};var _0x64246d=function(_0x47002f){if(!_0x47002f||!_0x47002f['rules']['length']){return'';}for(var _0x51de3b='(',_0x167d55=0x0;_0x167d55<_0x47002f[_0x613d('0x68')][_0x613d('0x3a')];_0x167d55+=0x1){_0x167d55>0x0&&(_0x51de3b+='\x20'+_0x47002f[_0x613d('0xa6')]+'\x20');_0x51de3b+=_0x47002f['rules'][_0x167d55][_0x613d('0x69')]?_0x64246d(_0x47002f[_0x613d('0x68')][_0x167d55]['group']):_0x47002f[_0x613d('0x68')][_0x167d55][_0x613d('0x6a')]+'\x20'+_0x47002f[_0x613d('0x68')][_0x167d55]['condition']+(_0x39b5c9(_0x47002f[_0x613d('0x68')][_0x167d55][_0x613d('0x6b')])?'\x20'+_0x47002f[_0x613d('0x68')][_0x167d55][_0x613d('0x6c')]:'');}return _0x51de3b+')';};var _0x23cdce={'where':{'id':_0x2ee140[_0x613d('0x48')]['id']}},_0x190e0d,_0x552ccc,_0x52eb3b,_0x30d5a1,_0x5bb11f;_0x23cdce=_[_0x613d('0x41')]({},_0x23cdce,_0x2ee140[_0x613d('0x42')]);return db[_0x613d('0x2f')][_0x613d('0x4a')](_0x23cdce)[_0x613d('0x27')](function(_0x5a5475){if(_0x5a5475){_0x190e0d=_0x5a5475;return _0x5a5475[_0x613d('0x6d')]();}return null;})[_0x613d('0x27')](function(_0x326f61){if(_0x326f61){if(!_0x326f61[_0x613d('0x3a')]){throw new db['Sequelize'][(_0x613d('0x6e'))](_0x613d('0xa7'),0x193);}_0x552ccc=_0x326f61;return db[_0x613d('0x6f')][_0x613d('0x44')]({'raw':!![]});}return null;})[_0x613d('0x27')](function(_0x204505){if(_0x204505){_0x52eb3b=_[_0x613d('0x70')](_0x204505,'id');var _0x39a9f7;var _0x452517=squel[_0x613d('0x71')]();_0x452517[_0x613d('0x8d')](_0x190e0d[_0x613d('0x72')]);for(var _0x1149fb=0x0;_0x1149fb<_0x552ccc['length'];_0x1149fb+=0x1){_0x39a9f7=_0x552ccc[_0x1149fb][_0x613d('0x73')]?_0x52eb3b[_0x552ccc[_0x1149fb][_0x613d('0x73')]][_0x613d('0x74')]:_0x552ccc[_0x1149fb][_0x613d('0x6a')];_0x39a9f7=_0x552ccc[_0x1149fb][_0x613d('0x75')]?_['replace'](_0x208d08[_0x552ccc[_0x1149fb][_0x613d('0x75')]],'%s',_0x39a9f7):_0x39a9f7;_0x39a9f7=_0x552ccc[_0x1149fb]['format']?_[_0x613d('0x76')](_0x250417[_0x552ccc[_0x1149fb]['format']],'%s',_0x39a9f7):_0x39a9f7;if(_0x552ccc[_0x1149fb][_0x613d('0x8e')]){_0x452517[_0x613d('0x69')](_0x39a9f7);}_0x552ccc[_0x1149fb]['orderBy']&&_0x452517[_0x613d('0x78')](_0x39a9f7,_0x552ccc[_0x1149fb][_0x613d('0x8f')]===_0x613d('0x79')?![]:!![]);_0x452517[_0x613d('0x6a')](_0x39a9f7,_0x552ccc[_0x1149fb]['alias']||_0x39a9f7);}if(_0x190e0d['joins']){_0x190e0d[_0x613d('0x7b')]=JSON[_0x613d('0x7c')](_0x190e0d[_0x613d('0x7b')]);for(var _0x3c0397=0x0;_0x3c0397<_0x190e0d[_0x613d('0x7b')][_0x613d('0x3a')];_0x3c0397+=0x1){if(_0x190e0d[_0x613d('0x7b')][_0x3c0397][_0x613d('0x32')]&&_[_0x613d('0x63')](_0x40656d,_0x190e0d[_0x613d('0x7b')][_0x3c0397][_0x613d('0x32')])&&_0x190e0d['joins'][_0x3c0397][_0x613d('0x7d')]&&_0x190e0d['joins'][_0x3c0397][_0x613d('0x7e')]&&_0x190e0d[_0x613d('0x7b')][_0x3c0397]['foreignKey']){_0x452517[_0x190e0d['joins'][_0x3c0397][_0x613d('0x32')]](_0x190e0d[_0x613d('0x7b')][_0x3c0397][_0x613d('0x7e')],null,util[_0x613d('0x77')]('%s.%s\x20=\x20%s.%s',_0x190e0d['table'],_0x190e0d[_0x613d('0x7b')][_0x3c0397][_0x613d('0x7d')],_0x190e0d[_0x613d('0x7b')][_0x3c0397][_0x613d('0x7e')],_0x190e0d[_0x613d('0x7b')][_0x3c0397][_0x613d('0x7f')]));}}}if(_0x190e0d['conditions']){_0x190e0d['conditions']=JSON[_0x613d('0x7c')](_0x190e0d['conditions']);_0x452517[_0x613d('0x3e')](_0x64246d(_0x190e0d[_0x613d('0x81')][_0x613d('0x69')]));}_0x5bb11f=_0x452517[_0x613d('0x82')]();_0x452517['limit'](_0x5a68b9);_0x452517[_0x613d('0x1e')](0x0);logger[_0x613d('0xa8')](_0x613d('0x83'),_0x452517['toString']());return dbH['sequelize'][_0x613d('0x35')](_0x452517['toString'](),{'type':dbH[_0x613d('0x85')][_0x613d('0x86')][_0x613d('0x87')]});}})[_0x613d('0x27')](function(){return{'sql':_0x5bb11f[_0x613d('0x84')]()};})[_0x613d('0x27')](respondWithResult(_0x5d3bbe,null))[_0x613d('0x46')](handleError(_0x5d3bbe,null));}; \ No newline at end of file +var _0x40d5=['SELECT','left_join','MIN(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','alias','output','web','randomstring','generate','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','toString','child_process','fork','../../components/export/','run','runReport','COUNT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DESC','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','CustomReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','sequelize','QueryTypes'];(function(_0x1d3cf5,_0x30b143){var _0x2bf198=function(_0x313d81){while(--_0x313d81){_0x1d3cf5['push'](_0x1d3cf5['shift']());}};_0x2bf198(++_0x30b143);}(_0x40d5,0x15d));var _0x540d=function(_0x52ba3d,_0x3ce09c){_0x52ba3d=_0x52ba3d-0x0;var _0x968ee9=_0x40d5[_0x52ba3d];return _0x968ee9;};'use strict';var emlformat=require(_0x540d('0x0'));var rimraf=require(_0x540d('0x1'));var zipdir=require(_0x540d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x540d('0x3'));var BPromise=require(_0x540d('0x4'));var Mustache=require(_0x540d('0x5'));var util=require(_0x540d('0x6'));var path=require(_0x540d('0x7'));var sox=require(_0x540d('0x8'));var csv=require('to-csv');var ejs=require(_0x540d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x540d('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x540d('0xb'));var deskjs=require(_0x540d('0xc'));var toCsv=require(_0x540d('0xd'));var querystring=require(_0x540d('0xe'));var Papa=require('papaparse');var Redis=require(_0x540d('0xf'));var authService=require(_0x540d('0x10'));var qs=require(_0x540d('0x11'));var as=require(_0x540d('0x12'));var hardwareService=require(_0x540d('0x13'));var logger=require('../../config/logger')(_0x540d('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x540d('0x15'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x29d354,_0x162fe5){_0x162fe5=_0x162fe5||0xcc;return function(_0x3c2ea7){if(_0x3c2ea7){return _0x29d354['sendStatus'](_0x162fe5);}return _0x29d354[_0x540d('0x16')](_0x162fe5)[_0x540d('0x17')]();};}function respondWithResult(_0x51cac9,_0x3743bf){_0x3743bf=_0x3743bf||0xc8;return function(_0x5c0b76){if(_0x5c0b76){return _0x51cac9[_0x540d('0x16')](_0x3743bf)[_0x540d('0x18')](_0x5c0b76);}};}function respondWithFilteredResult(_0x5a8241,_0x10cfa5){return function(_0xdd93c6){if(_0xdd93c6){var _0x1ede95=typeof _0x10cfa5[_0x540d('0x19')]===_0x540d('0x1a')&&typeof _0x10cfa5[_0x540d('0x1b')]===_0x540d('0x1a');var _0x15c737=_0xdd93c6[_0x540d('0x1c')];var _0x5d30a0=_0x1ede95?0x0:_0x10cfa5[_0x540d('0x19')];var _0x10d40c=_0x1ede95?_0xdd93c6['count']:_0x10cfa5[_0x540d('0x19')]+_0x10cfa5[_0x540d('0x1b')];var _0x135ff2;if(_0x10d40c>=_0x15c737){_0x10d40c=_0x15c737;_0x135ff2=0xc8;}else{_0x135ff2=0xce;}_0x5a8241['status'](_0x135ff2);return _0x5a8241[_0x540d('0x1d')](_0x540d('0x1e'),_0x5d30a0+'-'+_0x10d40c+'/'+_0x15c737)['json'](_0xdd93c6);}return null;};}function patchUpdates(_0x5e7a2a){return function(_0x3403b2){try{jsonpatch[_0x540d('0x1f')](_0x3403b2,_0x5e7a2a,!![]);}catch(_0x4ebfc8){return BPromise[_0x540d('0x20')](_0x4ebfc8);}return _0x3403b2[_0x540d('0x21')]();};}function saveUpdates(_0x8cb779,_0x4c40fc){return function(_0x15d44f){if(_0x15d44f){return _0x15d44f[_0x540d('0x22')](_0x8cb779)[_0x540d('0x23')](function(_0x293e97){return _0x293e97;});}return null;};}function removeEntity(_0x569fca,_0x4e987c){return function(_0x79953d){if(_0x79953d){return _0x79953d[_0x540d('0x24')]()[_0x540d('0x23')](function(){var _0x2a51d2=_0x79953d['get']({'plain':!![]});var _0x4c6809=_0x540d('0x25');return db[_0x540d('0x26')][_0x540d('0x24')]({'where':{'type':_0x4c6809,'resourceId':_0x2a51d2['id']}})[_0x540d('0x23')](function(){return _0x79953d;});})['then'](function(){_0x569fca[_0x540d('0x16')](0xcc)[_0x540d('0x17')]();});}};}function handleEntityNotFound(_0x8c2263,_0x50f188){return function(_0x55e282){if(!_0x55e282){_0x8c2263[_0x540d('0x27')](0x194);}return _0x55e282;};}function handleError(_0x1d5b33,_0x3486b9){_0x3486b9=_0x3486b9||0x1f4;return function(_0x390343){logger[_0x540d('0x28')](_0x390343[_0x540d('0x29')]);if(_0x390343[_0x540d('0x2a')]){delete _0x390343['name'];}_0x1d5b33[_0x540d('0x16')](_0x3486b9)[_0x540d('0x2b')](_0x390343);};}exports[_0x540d('0x2c')]=function(_0x5cc913,_0x3260f4){var _0x1537e8={},_0x55d5ce={},_0x97e67a={'count':0x0,'rows':[]};var _0x12fa6b=_[_0x540d('0x2d')](db[_0x540d('0x2e')][_0x540d('0x2f')],function(_0x492445){return{'name':_0x492445['fieldName'],'type':_0x492445[_0x540d('0x30')][_0x540d('0x31')]};});_0x55d5ce['model']=_['map'](_0x12fa6b,_0x540d('0x2a'));_0x55d5ce['query']=_['keys'](_0x5cc913[_0x540d('0x32')]);_0x55d5ce[_0x540d('0x33')]=_[_0x540d('0x34')](_0x55d5ce[_0x540d('0x35')],_0x55d5ce[_0x540d('0x32')]);_0x1537e8[_0x540d('0x36')]=_[_0x540d('0x34')](_0x55d5ce[_0x540d('0x35')],qs[_0x540d('0x37')](_0x5cc913[_0x540d('0x32')]['fields']));_0x1537e8['attributes']=_0x1537e8['attributes'][_0x540d('0x38')]?_0x1537e8[_0x540d('0x36')]:_0x55d5ce['model'];if(!_0x5cc913[_0x540d('0x32')][_0x540d('0x39')]('nolimit')){_0x1537e8[_0x540d('0x1b')]=qs['limit'](_0x5cc913[_0x540d('0x32')][_0x540d('0x1b')]);_0x1537e8[_0x540d('0x19')]=qs[_0x540d('0x19')](_0x5cc913['query'][_0x540d('0x19')]);}_0x1537e8[_0x540d('0x3a')]=qs[_0x540d('0x3b')](_0x5cc913['query'][_0x540d('0x3b')]);_0x1537e8[_0x540d('0x3c')]=qs['filters'](_[_0x540d('0x3d')](_0x5cc913[_0x540d('0x32')],_0x55d5ce['filters']),_0x12fa6b);if(_0x5cc913[_0x540d('0x32')][_0x540d('0x3e')]){_0x1537e8[_0x540d('0x3c')]=_[_0x540d('0x3f')](_0x1537e8[_0x540d('0x3c')],{'$or':_['map'](_0x12fa6b,function(_0x3d9520){if(_0x3d9520[_0x540d('0x30')]!=='VIRTUAL'){var _0x2dd08={};_0x2dd08[_0x3d9520[_0x540d('0x2a')]]={'$like':'%'+_0x5cc913[_0x540d('0x32')]['filter']+'%'};return _0x2dd08;}})});}_0x1537e8=_[_0x540d('0x3f')]({},_0x1537e8,_0x5cc913[_0x540d('0x40')]);var _0x560289={'where':_0x1537e8['where']};return db[_0x540d('0x2e')][_0x540d('0x1c')](_0x560289)[_0x540d('0x23')](function(_0x36f639){_0x97e67a[_0x540d('0x1c')]=_0x36f639;if(_0x5cc913['query'][_0x540d('0x41')]){_0x1537e8[_0x540d('0x42')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x540d('0x43')](_0x1537e8);})['then'](function(_0x530f14){_0x97e67a['rows']=_0x530f14;return _0x97e67a;})[_0x540d('0x23')](respondWithFilteredResult(_0x3260f4,_0x1537e8))[_0x540d('0x44')](handleError(_0x3260f4,null));};exports[_0x540d('0x45')]=function(_0x158a35,_0x5b4116){var _0x4f830e={'raw':![],'where':{'id':_0x158a35[_0x540d('0x46')]['id']}},_0x351b0a={};_0x351b0a[_0x540d('0x35')]=_[_0x540d('0x47')](db[_0x540d('0x2e')][_0x540d('0x2f')]);_0x351b0a[_0x540d('0x32')]=_[_0x540d('0x47')](_0x158a35['query']);_0x351b0a[_0x540d('0x33')]=_[_0x540d('0x34')](_0x351b0a[_0x540d('0x35')],_0x351b0a[_0x540d('0x32')]);_0x4f830e[_0x540d('0x36')]=_[_0x540d('0x34')](_0x351b0a[_0x540d('0x35')],qs['fields'](_0x158a35['query']['fields']));_0x4f830e['attributes']=_0x4f830e[_0x540d('0x36')][_0x540d('0x38')]?_0x4f830e['attributes']:_0x351b0a['model'];if(_0x158a35['query']['includeAll']){_0x4f830e[_0x540d('0x42')]=[{'all':!![]}];}_0x4f830e=_['merge']({},_0x4f830e,_0x158a35[_0x540d('0x40')]);return db['AnalyticCustomReport']['find'](_0x4f830e)[_0x540d('0x23')](handleEntityNotFound(_0x5b4116,null))[_0x540d('0x23')](respondWithResult(_0x5b4116,null))['catch'](handleError(_0x5b4116,null));};exports[_0x540d('0x48')]=function(_0x3b4d3f,_0x303de4){return db['AnalyticCustomReport'][_0x540d('0x48')](_0x3b4d3f['body'],{})['then'](function(_0x2df393){var _0x83c19e=_0x3b4d3f[_0x540d('0x49')][_0x540d('0x4a')]({'plain':!![]});if(!_0x83c19e)throw new Error(_0x540d('0x4b'));if(_0x83c19e[_0x540d('0x4c')]===_0x540d('0x49')){var _0x37e324=_0x2df393[_0x540d('0x4a')]({'plain':!![]});var _0x15aac8=_0x540d('0x4d');return db['UserProfileSection'][_0x540d('0x4e')]({'where':{'name':_0x15aac8,'userProfileId':_0x83c19e[_0x540d('0x4f')]},'raw':!![]})[_0x540d('0x23')](function(_0xd07efa){if(_0xd07efa&&_0xd07efa['autoAssociation']===0x0){return db[_0x540d('0x26')][_0x540d('0x48')]({'name':_0x37e324[_0x540d('0x2a')],'resourceId':_0x37e324['id'],'type':_0x540d('0x25'),'sectionId':_0xd07efa['id']},{})[_0x540d('0x23')](function(){return _0x2df393;});}else{return _0x2df393;}})[_0x540d('0x44')](function(_0x5359a0){logger['error'](_0x540d('0x50'),_0x5359a0);throw _0x5359a0;});}return _0x2df393;})[_0x540d('0x23')](respondWithResult(_0x303de4,0xc9))[_0x540d('0x44')](handleError(_0x303de4,null));};exports[_0x540d('0x22')]=function(_0x2e2dc3,_0x11af65){if(_0x2e2dc3['body']['id']){delete _0x2e2dc3[_0x540d('0x51')]['id'];}return db[_0x540d('0x2e')]['find']({'where':{'id':_0x2e2dc3[_0x540d('0x46')]['id']}})[_0x540d('0x23')](handleEntityNotFound(_0x11af65,null))['then'](saveUpdates(_0x2e2dc3[_0x540d('0x51')],null))['then'](respondWithResult(_0x11af65,null))[_0x540d('0x44')](handleError(_0x11af65,null));};exports[_0x540d('0x24')]=function(_0x1d0316,_0x1c31ac){return db[_0x540d('0x2e')][_0x540d('0x4e')]({'where':{'id':_0x1d0316[_0x540d('0x46')]['id']}})[_0x540d('0x23')](handleEntityNotFound(_0x1c31ac,null))[_0x540d('0x23')](removeEntity(_0x1c31ac,null))[_0x540d('0x44')](handleError(_0x1c31ac,null));};exports[_0x540d('0x52')]=function(_0x189ffc,_0x447426){var _0x43f32e=0xa;var _0x28a7aa=[_0x540d('0x53'),'left_join',_0x540d('0x54'),_0x540d('0x55')];var _0x2be5f5={'SUM':_0x540d('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x540d('0x57'),'MAX':_0x540d('0x58'),'MIN':'MIN(%s)','AVG':_0x540d('0x59'),'GROUP_CONCAT':_0x540d('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x540d('0x5b')};var _0xf0952b={'SEC_TO_TIME':_0x540d('0x5c'),'DATE':_0x540d('0x5d'),'HOUR':'HOUR(%s)','ROUND':_0x540d('0x5e'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5584d7=function(_0x286c79){return!_[_0x540d('0x5f')]([_0x540d('0x60'),_0x540d('0x61'),_0x540d('0x62'),_0x540d('0x63')],_0x286c79);};var _0x5968e0=function(_0xfae43c){if(!_0xfae43c||!_0xfae43c[_0x540d('0x64')][_0x540d('0x38')]){return'';}for(var _0x5e8ffb='(',_0x3cd8=0x0;_0x3cd8<_0xfae43c[_0x540d('0x64')][_0x540d('0x38')];_0x3cd8+=0x1){_0x3cd8>0x0&&(_0x5e8ffb+='\x20'+_0xfae43c[_0x540d('0x65')]+'\x20');_0x5e8ffb+=_0xfae43c['rules'][_0x3cd8][_0x540d('0x66')]?_0x5968e0(_0xfae43c[_0x540d('0x64')][_0x3cd8][_0x540d('0x66')]):_0xfae43c[_0x540d('0x64')][_0x3cd8][_0x540d('0x67')]+'\x20'+_0xfae43c[_0x540d('0x64')][_0x3cd8][_0x540d('0x68')]+(_0x5584d7(_0xfae43c['rules'][_0x3cd8]['condition'])?'\x20'+_0xfae43c[_0x540d('0x64')][_0x3cd8][_0x540d('0x69')]:'');}return _0x5e8ffb+')';};var _0x1a03cb={'where':{'id':_0x189ffc[_0x540d('0x46')]['id']}},_0x47c126,_0x4554a5,_0x127eb5,_0x341a87,_0x278bae;_0x1a03cb=_['merge']({},_0x1a03cb,_0x189ffc[_0x540d('0x40')]);return db['AnalyticCustomReport'][_0x540d('0x4e')](_0x1a03cb)[_0x540d('0x23')](function(_0x4341be){if(_0x4341be){_0x47c126=_0x4341be;return _0x4341be[_0x540d('0x6a')]();}return null;})['then'](function(_0x352e67){if(_0x352e67){if(!_0x352e67['length']){throw new db[(_0x540d('0x6b'))][(_0x540d('0x6c'))](_0x540d('0x6d'),0x193);}_0x4554a5=_0x352e67;return db[_0x540d('0x6e')][_0x540d('0x43')]({'raw':!![]});}return null;})[_0x540d('0x23')](function(_0x388856){if(_0x388856){_0x127eb5=_[_0x540d('0x6f')](_0x388856,'id');var _0x3fdd15;var _0x18f354=squel[_0x540d('0x70')]();_0x18f354[_0x540d('0x71')](_0x47c126[_0x540d('0x72')]);for(var _0x3dbe15=0x0;_0x3dbe15<_0x4554a5[_0x540d('0x38')];_0x3dbe15+=0x1){_0x3fdd15=_0x4554a5[_0x3dbe15][_0x540d('0x73')]?_0x127eb5[_0x4554a5[_0x3dbe15][_0x540d('0x73')]][_0x540d('0x74')]:_0x4554a5[_0x3dbe15][_0x540d('0x67')];_0x3fdd15=_0x4554a5[_0x3dbe15][_0x540d('0x75')]?_[_0x540d('0x76')](_0x2be5f5[_0x4554a5[_0x3dbe15][_0x540d('0x75')]],'%s',_0x3fdd15):_0x3fdd15;_0x3fdd15=_0x4554a5[_0x3dbe15]['format']?_[_0x540d('0x76')](_0xf0952b[_0x4554a5[_0x3dbe15][_0x540d('0x77')]],'%s',_0x3fdd15):_0x3fdd15;if(_0x4554a5[_0x3dbe15][_0x540d('0x78')]){_0x18f354[_0x540d('0x66')](_0x3fdd15);}_0x4554a5[_0x3dbe15][_0x540d('0x79')]&&_0x18f354[_0x540d('0x3a')](_0x3fdd15,_0x4554a5[_0x3dbe15][_0x540d('0x79')]==='DESC'?![]:!![]);_0x18f354['field'](_0x3fdd15,_0x4554a5[_0x3dbe15]['alias']||_0x3fdd15);}if(_0x47c126[_0x540d('0x7a')]){_0x47c126[_0x540d('0x7a')]=JSON['parse'](_0x47c126[_0x540d('0x7a')]);for(var _0x8653ae=0x0;_0x8653ae<_0x47c126[_0x540d('0x7a')][_0x540d('0x38')];_0x8653ae+=0x1){if(_0x47c126[_0x540d('0x7a')][_0x8653ae][_0x540d('0x30')]&&_[_0x540d('0x5f')](_0x28a7aa,_0x47c126[_0x540d('0x7a')][_0x8653ae][_0x540d('0x30')])&&_0x47c126['joins'][_0x8653ae][_0x540d('0x7b')]&&_0x47c126[_0x540d('0x7a')][_0x8653ae]['foreignTable']&&_0x47c126[_0x540d('0x7a')][_0x8653ae][_0x540d('0x7c')]){_0x18f354[_0x47c126[_0x540d('0x7a')][_0x8653ae][_0x540d('0x30')]](_0x47c126[_0x540d('0x7a')][_0x8653ae][_0x540d('0x7d')],null,util[_0x540d('0x77')](_0x540d('0x7e'),_0x47c126[_0x540d('0x72')],_0x47c126[_0x540d('0x7a')][_0x8653ae][_0x540d('0x7b')],_0x47c126[_0x540d('0x7a')][_0x8653ae][_0x540d('0x7d')],_0x47c126[_0x540d('0x7a')][_0x8653ae][_0x540d('0x7c')]));}}}if(_0x47c126[_0x540d('0x7f')]){_0x47c126[_0x540d('0x7f')]=JSON[_0x540d('0x80')](_0x47c126[_0x540d('0x7f')]);_0x18f354['where'](_0x5968e0(_0x47c126['conditions'][_0x540d('0x66')]));}_0x278bae=_0x18f354[_0x540d('0x81')]();_0x18f354['limit'](_0x43f32e);_0x18f354['offset'](0x0);logger[_0x540d('0x82')](_0x540d('0x83'),_0x18f354['toString']());return dbH[_0x540d('0x84')][_0x540d('0x32')](_0x18f354['toString'](),{'type':dbH[_0x540d('0x84')][_0x540d('0x85')][_0x540d('0x86')]});}})['then'](respondWithResult(_0x447426,null))['catch'](handleError(_0x447426,null));};function runReport(_0x20dc00,_0xfaf1d9,_0x57b064){var _0x24570f=_0xfaf1d9[_0x540d('0x2a')];var _0x4125a4=0xa;var _0x1b15b4=[_0x540d('0x53'),_0x540d('0x87'),_0x540d('0x54'),'cross_join'];var _0x5c1267={'SUM':_0x540d('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x540d('0x57'),'MAX':_0x540d('0x58'),'MIN':_0x540d('0x88'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x540d('0x5b')};var _0x5bb860={'SEC_TO_TIME':_0x540d('0x5c'),'DATE':_0x540d('0x5d'),'HOUR':_0x540d('0x89'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x540d('0x8a')};var _0xbe9886=function(_0x20fed0){return!_[_0x540d('0x5f')](['IS\x20NULL',_0x540d('0x61'),'IS\x20EMPTY',_0x540d('0x63')],_0x20fed0);};var _0x324f14=function(_0xb40bc){if(!_0xb40bc||!_0xb40bc['rules'][_0x540d('0x38')]){return'';}for(var _0x2c0d8f='(',_0x384afe=0x0;_0x384afe<_0xb40bc[_0x540d('0x64')]['length'];_0x384afe+=0x1){_0x384afe>0x0&&(_0x2c0d8f+='\x20'+_0xb40bc[_0x540d('0x65')]+'\x20');_0x2c0d8f+=_0xb40bc[_0x540d('0x64')][_0x384afe][_0x540d('0x66')]?_0x324f14(_0xb40bc[_0x540d('0x64')][_0x384afe][_0x540d('0x66')]):_0xb40bc[_0x540d('0x64')][_0x384afe][_0x540d('0x67')]+'\x20'+_0xb40bc[_0x540d('0x64')][_0x384afe][_0x540d('0x68')]+(_0xbe9886(_0xb40bc[_0x540d('0x64')][_0x384afe][_0x540d('0x68')])?'\x20'+_0xb40bc['rules'][_0x384afe][_0x540d('0x69')]:'');}return _0x2c0d8f+')';};var _0x2493be={'where':{'id':_0x20dc00['id']}},_0x29bdfc,_0x12ca50,_0xd5f074,_0x341c12,_0x2576e5;_0x2493be=_[_0x540d('0x3f')]({},_0x2493be,_0x57b064);return db[_0x540d('0x2e')][_0x540d('0x4e')](_0x2493be)['then'](function(_0x2fae17){if(_0x2fae17){_0x29bdfc=_0x2fae17;return _0x2fae17[_0x540d('0x6a')]();}return null;})['then'](function(_0xe3cd02){if(_0xe3cd02){if(!_0xe3cd02[_0x540d('0x38')]){throw new db[(_0x540d('0x6b'))]['ValidationErrorItem'](_0x540d('0x6d'),0x193);}_0x12ca50=_0xe3cd02;return db[_0x540d('0x6e')][_0x540d('0x43')]({'raw':!![]});}return null;})[_0x540d('0x23')](function(_0x538071){if(_0x538071){_0xd5f074=_[_0x540d('0x6f')](_0x538071,'id');var _0x37a39d;var _0x568aae=squel[_0x540d('0x70')]();_0x568aae['from'](_0x29bdfc[_0x540d('0x72')]);for(var _0x10bd5a=0x0;_0x10bd5a<_0x12ca50[_0x540d('0x38')];_0x10bd5a+=0x1){_0x37a39d=_0x12ca50[_0x10bd5a][_0x540d('0x73')]?_0xd5f074[_0x12ca50[_0x10bd5a][_0x540d('0x73')]]['metric']:_0x12ca50[_0x10bd5a]['field'];_0x37a39d=_0x12ca50[_0x10bd5a][_0x540d('0x75')]?_[_0x540d('0x76')](_0x5c1267[_0x12ca50[_0x10bd5a][_0x540d('0x75')]],'%s',_0x37a39d):_0x37a39d;_0x37a39d=_0x12ca50[_0x10bd5a][_0x540d('0x77')]?_[_0x540d('0x76')](_0x5bb860[_0x12ca50[_0x10bd5a][_0x540d('0x77')]],'%s',_0x37a39d):_0x37a39d;if(_0x12ca50[_0x10bd5a][_0x540d('0x78')]){_0x568aae[_0x540d('0x66')](_0x37a39d);}_0x12ca50[_0x10bd5a][_0x540d('0x79')]&&_0x568aae[_0x540d('0x3a')](_0x37a39d,_0x12ca50[_0x10bd5a][_0x540d('0x79')]==='DESC'?![]:!![]);_0x568aae[_0x540d('0x67')](_0x37a39d,_0x12ca50[_0x10bd5a][_0x540d('0x8b')]||_0x37a39d);}if(_0x29bdfc[_0x540d('0x7a')]){_0x29bdfc[_0x540d('0x7a')]=JSON[_0x540d('0x80')](_0x29bdfc[_0x540d('0x7a')]);for(var _0x54b9dc=0x0;_0x54b9dc<_0x29bdfc[_0x540d('0x7a')]['length'];_0x54b9dc+=0x1){if(_0x29bdfc['joins'][_0x54b9dc][_0x540d('0x30')]&&_[_0x540d('0x5f')](_0x1b15b4,_0x29bdfc['joins'][_0x54b9dc]['type'])&&_0x29bdfc['joins'][_0x54b9dc][_0x540d('0x7b')]&&_0x29bdfc[_0x540d('0x7a')][_0x54b9dc][_0x540d('0x7d')]&&_0x29bdfc[_0x540d('0x7a')][_0x54b9dc][_0x540d('0x7c')]){_0x568aae[_0x29bdfc[_0x540d('0x7a')][_0x54b9dc][_0x540d('0x30')]](_0x29bdfc[_0x540d('0x7a')][_0x54b9dc]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x29bdfc[_0x540d('0x72')],_0x29bdfc['joins'][_0x54b9dc][_0x540d('0x7b')],_0x29bdfc[_0x540d('0x7a')][_0x54b9dc]['foreignTable'],_0x29bdfc[_0x540d('0x7a')][_0x54b9dc]['foreignKey']));}}}if(_0x29bdfc[_0x540d('0x7f')]){_0x29bdfc['conditions']=JSON['parse'](_0x29bdfc[_0x540d('0x7f')]);_0x568aae[_0x540d('0x3c')](_0x324f14(_0x29bdfc[_0x540d('0x7f')][_0x540d('0x66')]));}_0x2576e5=_0x568aae[_0x540d('0x81')]();_0x568aae['limit'](_0x4125a4);_0x568aae[_0x540d('0x19')](0x0);return;}})['then'](function(){if(_0xfaf1d9[_0x540d('0x8c')]===_0x540d('0x8d')){return null;}var _0x40e6ed=_[_0x540d('0x3f')](_0xfaf1d9,{'name':_0xfaf1d9['fullPath']||_0xfaf1d9[_0x540d('0x2a')]||_0x29bdfc[_0x540d('0x2a')],'basename':_0x24570f,'savename':util[_0x540d('0x77')]('%s-%s.%s',_0xfaf1d9['name']||_0x29bdfc['name'],require(_0x540d('0x8e'))[_0x540d('0x8f')](0x4),_0xfaf1d9[_0x540d('0x8c')]||'csv'),'reportId':_0x29bdfc['id'],'reportType':_0x540d('0x90')});return db[_0x540d('0x91')][_0x540d('0x48')](_0x40e6ed,{'raw':!![]});})['then'](function(_0x1c7f8c){if(_0x29bdfc[_0x540d('0x72')]===_0x540d('0x92')){_0x2576e5['where'](_0x29bdfc[_0x540d('0x72')]+_0x540d('0x93'),_0xfaf1d9[_0x540d('0x94')],_0xfaf1d9['endDate']);}else{_0x2576e5['where'](_0x29bdfc[_0x540d('0x72')]+_0x540d('0x95'),_0xfaf1d9[_0x540d('0x94')],_0xfaf1d9['endDate']);}if(_0x1c7f8c){logger[_0x540d('0x96')](_0x540d('0x97'),_0x2576e5[_0x540d('0x98')]());require(_0x540d('0x99'))[_0x540d('0x9a')](path[_0x540d('0x53')](__dirname,_0x540d('0x9b'),_0x1c7f8c[_0x540d('0x8c')]),[_0x1c7f8c['id'],_0x2576e5[_0x540d('0x98')](),path[_0x540d('0x53')](__dirname,'../../files/reports',_0x1c7f8c['savename']),_0x24570f]);return _0x1c7f8c;}else{var _0xd1925a=squel['select']();_0xd1925a[_0x540d('0x71')]('('+_0x2576e5[_0x540d('0x98')]()+')','countTable');_0xd1925a[_0x540d('0x67')]('COUNT(*)',_0x540d('0x1c'));_0x2576e5[_0x540d('0x1b')](_0xfaf1d9[_0x540d('0x1b')]||_0x4125a4);_0x2576e5[_0x540d('0x19')](_0xfaf1d9[_0x540d('0x19')]||0x0);return dbH[_0x540d('0x84')]['query'](_0xd1925a['toString'](),{'type':dbH['sequelize'][_0x540d('0x85')][_0x540d('0x86')]})['then'](function(_0x482a83){if(!_0x482a83[_0x540d('0x38')]){_0x341c12=0x0;}else{_0x341c12=_0x482a83[0x0][_0x540d('0x1c')]||0x0;}return dbH[_0x540d('0x84')][_0x540d('0x32')](_0x2576e5[_0x540d('0x98')](),{'type':dbH[_0x540d('0x84')][_0x540d('0x85')][_0x540d('0x86')]});})[_0x540d('0x23')](function(_0x5231cf){return{'rows':_0x5231cf||[],'count':_0x341c12};});}});}exports[_0x540d('0x9c')]=function(_0x12c0bf,_0x2fe582){return runReport(_0x12c0bf[_0x540d('0x46')],_0x12c0bf[_0x540d('0x32')],_0x12c0bf[_0x540d('0x40')])[_0x540d('0x23')](respondWithResult(_0x2fe582,null))[_0x540d('0x44')](handleError(_0x2fe582,null));};exports[_0x540d('0x9d')]=runReport;exports[_0x540d('0x32')]=function(_0x6ef6e3,_0x536eaa){var _0x432fa7=0xa;var _0x4bca59=[_0x540d('0x53'),_0x540d('0x87'),'right_join','cross_join'];var _0x388957={'SUM':'SUM(%s)','COUNT':_0x540d('0x9e'),'COUNT DISTINCT':_0x540d('0x57'),'MAX':'MAX(%s)','MIN':_0x540d('0x88'),'AVG':_0x540d('0x59'),'GROUP_CONCAT':_0x540d('0x5a'),'GROUP_CONCAT ASC':_0x540d('0x9f'),'GROUP_CONCAT DESC':_0x540d('0x5b')};var _0x3a9378={'SEC_TO_TIME':_0x540d('0x5c'),'DATE':_0x540d('0x5d'),'HOUR':'HOUR(%s)','ROUND':_0x540d('0x5e'),'UNIX_TIMESTAMP':_0x540d('0x8a')};var _0x37b140=function(_0x13df3d){return!_[_0x540d('0x5f')]([_0x540d('0x60'),_0x540d('0x61'),_0x540d('0x62'),_0x540d('0x63')],_0x13df3d);};var _0x148e0f=function(_0x323417){if(!_0x323417||!_0x323417[_0x540d('0x64')][_0x540d('0x38')]){return'';}for(var _0x19c5d5='(',_0x4307f1=0x0;_0x4307f1<_0x323417['rules'][_0x540d('0x38')];_0x4307f1+=0x1){_0x4307f1>0x0&&(_0x19c5d5+='\x20'+_0x323417[_0x540d('0x65')]+'\x20');_0x19c5d5+=_0x323417['rules'][_0x4307f1][_0x540d('0x66')]?_0x148e0f(_0x323417[_0x540d('0x64')][_0x4307f1][_0x540d('0x66')]):_0x323417[_0x540d('0x64')][_0x4307f1][_0x540d('0x67')]+'\x20'+_0x323417['rules'][_0x4307f1][_0x540d('0x68')]+(_0x37b140(_0x323417[_0x540d('0x64')][_0x4307f1][_0x540d('0x68')])?'\x20'+_0x323417[_0x540d('0x64')][_0x4307f1][_0x540d('0x69')]:'');}return _0x19c5d5+')';};var _0x5985a7={'where':{'id':_0x6ef6e3[_0x540d('0x46')]['id']}},_0x4adaa6,_0x10a8d6,_0x310246,_0xf39d80,_0x71d64;_0x5985a7=_[_0x540d('0x3f')]({},_0x5985a7,_0x6ef6e3[_0x540d('0x40')]);return db['AnalyticCustomReport'][_0x540d('0x4e')](_0x5985a7)['then'](function(_0x640245){if(_0x640245){_0x4adaa6=_0x640245;return _0x640245[_0x540d('0x6a')]();}return null;})[_0x540d('0x23')](function(_0x2b240e){if(_0x2b240e){if(!_0x2b240e[_0x540d('0x38')]){throw new db['Sequelize']['ValidationErrorItem'](_0x540d('0x6d'),0x193);}_0x10a8d6=_0x2b240e;return db[_0x540d('0x6e')][_0x540d('0x43')]({'raw':!![]});}return null;})[_0x540d('0x23')](function(_0x440894){if(_0x440894){_0x310246=_[_0x540d('0x6f')](_0x440894,'id');var _0x453b4c;var _0x40fe07=squel[_0x540d('0x70')]();_0x40fe07[_0x540d('0x71')](_0x4adaa6['table']);for(var _0x432234=0x0;_0x432234<_0x10a8d6['length'];_0x432234+=0x1){_0x453b4c=_0x10a8d6[_0x432234][_0x540d('0x73')]?_0x310246[_0x10a8d6[_0x432234]['MetricId']][_0x540d('0x74')]:_0x10a8d6[_0x432234][_0x540d('0x67')];_0x453b4c=_0x10a8d6[_0x432234][_0x540d('0x75')]?_[_0x540d('0x76')](_0x388957[_0x10a8d6[_0x432234]['function']],'%s',_0x453b4c):_0x453b4c;_0x453b4c=_0x10a8d6[_0x432234][_0x540d('0x77')]?_[_0x540d('0x76')](_0x3a9378[_0x10a8d6[_0x432234][_0x540d('0x77')]],'%s',_0x453b4c):_0x453b4c;if(_0x10a8d6[_0x432234][_0x540d('0x78')]){_0x40fe07[_0x540d('0x66')](_0x453b4c);}_0x10a8d6[_0x432234][_0x540d('0x79')]&&_0x40fe07['order'](_0x453b4c,_0x10a8d6[_0x432234][_0x540d('0x79')]===_0x540d('0xa0')?![]:!![]);_0x40fe07[_0x540d('0x67')](_0x453b4c,_0x10a8d6[_0x432234][_0x540d('0x8b')]||_0x453b4c);}if(_0x4adaa6[_0x540d('0x7a')]){_0x4adaa6['joins']=JSON['parse'](_0x4adaa6['joins']);for(var _0x3e1582=0x0;_0x3e1582<_0x4adaa6[_0x540d('0x7a')]['length'];_0x3e1582+=0x1){if(_0x4adaa6[_0x540d('0x7a')][_0x3e1582][_0x540d('0x30')]&&_['includes'](_0x4bca59,_0x4adaa6[_0x540d('0x7a')][_0x3e1582][_0x540d('0x30')])&&_0x4adaa6[_0x540d('0x7a')][_0x3e1582]['parentKey']&&_0x4adaa6[_0x540d('0x7a')][_0x3e1582]['foreignTable']&&_0x4adaa6['joins'][_0x3e1582][_0x540d('0x7c')]){_0x40fe07[_0x4adaa6[_0x540d('0x7a')][_0x3e1582][_0x540d('0x30')]](_0x4adaa6[_0x540d('0x7a')][_0x3e1582][_0x540d('0x7d')],null,util[_0x540d('0x77')](_0x540d('0x7e'),_0x4adaa6[_0x540d('0x72')],_0x4adaa6['joins'][_0x3e1582]['parentKey'],_0x4adaa6['joins'][_0x3e1582][_0x540d('0x7d')],_0x4adaa6[_0x540d('0x7a')][_0x3e1582][_0x540d('0x7c')]));}}}if(_0x4adaa6[_0x540d('0x7f')]){_0x4adaa6[_0x540d('0x7f')]=JSON[_0x540d('0x80')](_0x4adaa6[_0x540d('0x7f')]);_0x40fe07[_0x540d('0x3c')](_0x148e0f(_0x4adaa6[_0x540d('0x7f')]['group']));}_0x71d64=_0x40fe07[_0x540d('0x81')]();_0x40fe07[_0x540d('0x1b')](_0x432fa7);_0x40fe07[_0x540d('0x19')](0x0);logger[_0x540d('0x82')](_0x540d('0x83'),_0x40fe07['toString']());return dbH['sequelize'][_0x540d('0x32')](_0x40fe07[_0x540d('0x98')](),{'type':dbH[_0x540d('0x84')]['QueryTypes'][_0x540d('0x86')]});}})[_0x540d('0x23')](function(){return{'sql':_0x71d64[_0x540d('0x98')]()};})[_0x540d('0x23')](respondWithResult(_0x536eaa,null))[_0x540d('0x44')](handleError(_0x536eaa,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 4c4fd7c..86ccb84 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 _0xf4bc=['../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','util','request-promise','path','rimraf'];(function(_0xfa2e1e,_0x4002ed){var _0x2f1d12=function(_0x222fe6){while(--_0x222fe6){_0xfa2e1e['push'](_0xfa2e1e['shift']());}};_0x2f1d12(++_0x4002ed);}(_0xf4bc,0x1d2));var _0xcf4b=function(_0x21576a,_0x573718){_0x21576a=_0x21576a-0x0;var _0x398841=_0xf4bc[_0x21576a];return _0x398841;};'use strict';var _=require('lodash');var util=require(_0xcf4b('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcf4b('0x1'));var fs=require('fs');var path=require(_0xcf4b('0x2'));var rimraf=require(_0xcf4b('0x3'));var config=require(_0xcf4b('0x4'));var attributes=require(_0xcf4b('0x5'));module[_0xcf4b('0x6')]=function(_0xc5dea7,_0x161ae5){return _0xc5dea7[_0xcf4b('0x7')](_0xcf4b('0x8'),attributes,{'tableName':_0xcf4b('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8305=['analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0x246a11,_0x5c68a6){var _0x593d4d=function(_0x94e370){while(--_0x94e370){_0x246a11['push'](_0x246a11['shift']());}};_0x593d4d(++_0x5c68a6);}(_0x8305,0x15a));var _0x5830=function(_0x1acf79,_0x2cb20f){_0x1acf79=_0x1acf79-0x0;var _0x262ef9=_0x8305[_0x1acf79];return _0x262ef9;};'use strict';var _=require(_0x5830('0x0'));var util=require(_0x5830('0x1'));var logger=require(_0x5830('0x2'))(_0x5830('0x3'));var moment=require(_0x5830('0x4'));var BPromise=require(_0x5830('0x5'));var rp=require(_0x5830('0x6'));var fs=require('fs');var path=require(_0x5830('0x7'));var rimraf=require(_0x5830('0x8'));var config=require(_0x5830('0x9'));var attributes=require(_0x5830('0xa'));module[_0x5830('0xb')]=function(_0x2fa5b0,_0x34b8a3){return _0x2fa5b0[_0x5830('0xc')](_0x5830('0xd'),attributes,{'tableName':_0x5830('0xe'),'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 0a45cd6..efeed80 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 _0x27d4=['info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','request','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x581feb,_0x475a85){var _0x29fe1a=function(_0x34b44d){while(--_0x34b44d){_0x581feb['push'](_0x581feb['shift']());}};_0x29fe1a(++_0x475a85);}(_0x27d4,0x1a4));var _0x427d=function(_0x23328d,_0x417dbc){_0x23328d=_0x23328d-0x0;var _0x1e0f9c=_0x27d4[_0x23328d];return _0x1e0f9c;};'use strict';var _=require(_0x427d('0x0'));var util=require(_0x427d('0x1'));var moment=require(_0x427d('0x2'));var BPromise=require(_0x427d('0x3'));var rs=require(_0x427d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x427d('0x5'))['db'];var utils=require(_0x427d('0x6'));var logger=require(_0x427d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x427d('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xb4d0c7,_0x342f4d,_0x202ff7){return new BPromise(function(_0x4c652d,_0x351399){return client[_0x427d('0x9')](_0xb4d0c7,_0x202ff7)['then'](function(_0x3aa0bf){logger['info'](_0x427d('0xa'),_0x342f4d,_0x427d('0xb'));logger['debug'](_0x427d('0xc'),_0x342f4d,_0x427d('0xb'),JSON[_0x427d('0xd')](_0x3aa0bf));if(_0x3aa0bf[_0x427d('0xe')]){if(_0x3aa0bf[_0x427d('0xe')][_0x427d('0xf')]===0x1f4){logger[_0x427d('0xe')](_0x427d('0xa'),_0x342f4d,_0x3aa0bf[_0x427d('0xe')][_0x427d('0x10')]);return _0x351399(_0x3aa0bf[_0x427d('0xe')][_0x427d('0x10')]);}logger[_0x427d('0xe')](_0x427d('0xa'),_0x342f4d,_0x3aa0bf[_0x427d('0xe')][_0x427d('0x10')]);return _0x4c652d(_0x3aa0bf[_0x427d('0xe')][_0x427d('0x10')]);}else{logger[_0x427d('0x11')](_0x427d('0xa'),_0x342f4d,'request\x20sent');_0x4c652d(_0x3aa0bf[_0x427d('0x12')][_0x427d('0x10')]);}})['catch'](function(_0x2ac83d){logger[_0x427d('0xe')](_0x427d('0xa'),_0x342f4d,_0x2ac83d);_0x351399(_0x2ac83d);});});} \ No newline at end of file +var _0xd117=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x4bf9aa,_0xafa1ec){var _0x1db38a=function(_0x44540e){while(--_0x44540e){_0x4bf9aa['push'](_0x4bf9aa['shift']());}};_0x1db38a(++_0xafa1ec);}(_0xd117,0xf0));var _0x7d11=function(_0x3dda0f,_0x5b9902){_0x3dda0f=_0x3dda0f-0x0;var _0x1b0488=_0xd117[_0x3dda0f];return _0x1b0488;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var moment=require(_0x7d11('0x2'));var BPromise=require(_0x7d11('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d11('0x4'));var db=require(_0x7d11('0x5'))['db'];var utils=require(_0x7d11('0x6'));var logger=require('../../config/logger')(_0x7d11('0x7'));var config=require(_0x7d11('0x8'));var jayson=require(_0x7d11('0x9'));var client=jayson[_0x7d11('0xa')][_0x7d11('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11a04f,_0x424f63,_0xc0a984){return new BPromise(function(_0x18cbff,_0xa6f121){return client['request'](_0x11a04f,_0xc0a984)[_0x7d11('0xc')](function(_0x1cd3c6){logger[_0x7d11('0xd')](_0x7d11('0xe'),_0x424f63,'request\x20sent');logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x424f63,_0x7d11('0x11'),JSON[_0x7d11('0x12')](_0x1cd3c6));if(_0x1cd3c6[_0x7d11('0x13')]){if(_0x1cd3c6['error'][_0x7d11('0x14')]===0x1f4){logger[_0x7d11('0x13')](_0x7d11('0xe'),_0x424f63,_0x1cd3c6[_0x7d11('0x13')]['message']);return _0xa6f121(_0x1cd3c6['error'][_0x7d11('0x15')]);}logger[_0x7d11('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x424f63,_0x1cd3c6['error'][_0x7d11('0x15')]);return _0x18cbff(_0x1cd3c6['error'][_0x7d11('0x15')]);}else{logger[_0x7d11('0xd')](_0x7d11('0xe'),_0x424f63,'request\x20sent');_0x18cbff(_0x1cd3c6[_0x7d11('0x16')][_0x7d11('0x15')]);}})[_0x7d11('0x17')](function(_0x1fb132){logger[_0x7d11('0x13')](_0x7d11('0xe'),_0x424f63,_0x1fb132);_0xa6f121(_0x1fb132);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index d59e45e..54aa3ae 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 _0x8858=['preview','/:id/run','run','/:id/query','query','post','create','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id'];(function(_0x316c6d,_0x24ee7d){var _0x4cba14=function(_0x1460d9){while(--_0x1460d9){_0x316c6d['push'](_0x316c6d['shift']());}};_0x4cba14(++_0x24ee7d);}(_0x8858,0x17a));var _0x8885=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x8858[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require('multer');var util=require(_0x8885('0x0'));var path=require(_0x8885('0x1'));var timeout=require(_0x8885('0x2'));var express=require(_0x8885('0x3'));var router=express['Router']();var fs_extra=require(_0x8885('0x4'));var auth=require(_0x8885('0x5'));var interaction=require(_0x8885('0x6'));var config=require(_0x8885('0x7'));var controller=require(_0x8885('0x8'));router[_0x8885('0x9')]('/',auth[_0x8885('0xa')](),controller[_0x8885('0xb')]);router[_0x8885('0x9')](_0x8885('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x8885('0x9')]('/:id/preview',auth[_0x8885('0xa')](),controller[_0x8885('0xd')]);router[_0x8885('0x9')](_0x8885('0xe'),auth[_0x8885('0xa')](),controller[_0x8885('0xf')]);router[_0x8885('0x9')](_0x8885('0x10'),auth[_0x8885('0xa')](),controller[_0x8885('0x11')]);router[_0x8885('0x12')]('/',auth['isAuthenticated'](),controller[_0x8885('0x13')]);router['put'](_0x8885('0xc'),auth[_0x8885('0xa')](),controller['update']);router[_0x8885('0x14')]('/:id',auth[_0x8885('0xa')](),controller[_0x8885('0x15')]);module[_0x8885('0x16')]=router; \ No newline at end of file +var _0x27a9=['fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','/:id/query','post','create','update','/:id','destroy','multer','util','path','connect-timeout','Router'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x27a9,0x119));var _0x927a=function(_0x1bf8b1,_0x1b11cd){_0x1bf8b1=_0x1bf8b1-0x0;var _0x37fb94=_0x27a9[_0x1bf8b1];return _0x37fb94;};'use strict';var multer=require(_0x927a('0x0'));var util=require(_0x927a('0x1'));var path=require(_0x927a('0x2'));var timeout=require(_0x927a('0x3'));var express=require('express');var router=express[_0x927a('0x4')]();var fs_extra=require(_0x927a('0x5'));var auth=require(_0x927a('0x6'));var interaction=require(_0x927a('0x7'));var config=require('../../config/environment');var controller=require(_0x927a('0x8'));router[_0x927a('0x9')]('/',auth[_0x927a('0xa')](),controller[_0x927a('0xb')]);router['get']('/:id',auth[_0x927a('0xa')](),controller[_0x927a('0xc')]);router['get'](_0x927a('0xd'),auth[_0x927a('0xa')](),controller[_0x927a('0xe')]);router[_0x927a('0x9')](_0x927a('0xf'),auth[_0x927a('0xa')](),controller['run']);router[_0x927a('0x9')](_0x927a('0x10'),auth[_0x927a('0xa')](),controller['query']);router[_0x927a('0x11')]('/',auth[_0x927a('0xa')](),controller[_0x927a('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x927a('0x13')]);router['delete'](_0x927a('0x14'),auth[_0x927a('0xa')](),controller[_0x927a('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index ac7a400..51c8207 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 _0xac9d=['TEXT','sequelize','exports','STRING'];(function(_0x571f7c,_0x450489){var _0x374a19=function(_0x5ddfdf){while(--_0x5ddfdf){_0x571f7c['push'](_0x571f7c['shift']());}};_0x374a19(++_0x450489);}(_0xac9d,0x14d));var _0xdac9=function(_0x163977,_0x4ef72e){_0x163977=_0x163977-0x0;var _0x28bf3a=_0xac9d[_0x163977];return _0x28bf3a;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'name':{'type':Sequelize[_0xdac9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdac9('0x2')]},'parent':{'type':Sequelize[_0xdac9('0x2')]},'table':{'type':Sequelize[_0xdac9('0x2')]},'conditions':{'type':Sequelize[_0xdac9('0x3')]},'joins':{'type':Sequelize[_0xdac9('0x3')]}}; \ No newline at end of file +var _0x5075=['exports','STRING','TEXT','sequelize'];(function(_0x2ceba7,_0x451ce4){var _0x5348eb=function(_0x3596fc){while(--_0x3596fc){_0x2ceba7['push'](_0x2ceba7['shift']());}};_0x5348eb(++_0x451ce4);}(_0x5075,0x73));var _0x5507=function(_0x1911ed,_0x4e8c73){_0x1911ed=_0x1911ed-0x0;var _0x11edaa=_0x5075[_0x1911ed];return _0x11edaa;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'name':{'type':Sequelize[_0x5507('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5507('0x2')]},'parent':{'type':Sequelize[_0x5507('0x2')]},'table':{'type':Sequelize[_0x5507('0x2')]},'conditions':{'type':Sequelize[_0x5507('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 7476bb4..c71d77b 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(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x12fc8d,_0x230b9d){_0x12fc8d=_0x12fc8d-0x0;var _0x198032=_0xc6ac[_0x12fc8d];return _0x198032;};'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 _0x31f0=['fullPath','%s-%s.%s','randomstring','generate','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','DATE(%s)','keyBy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','DefaultReports','destroy','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','include','findAll','rows','catch','params','length','find','create','user','role','Reports','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','function','replace','format','orderBy','DESC','field','alias','parse','joins','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','AVG(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','getFields','MetricId','metric','groupBy','output','web'];(function(_0x3588ef,_0x2bca77){var _0x891e61=function(_0x3f9dec){while(--_0x3f9dec){_0x3588ef['push'](_0x3588ef['shift']());}};_0x891e61(++_0x2bca77);}(_0x31f0,0xb7));var _0x031f=function(_0x4b7a17,_0x2e992f){_0x4b7a17=_0x4b7a17-0x0;var _0x19088d=_0x31f0[_0x4b7a17];return _0x19088d;};'use strict';var emlformat=require(_0x031f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x031f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x031f('0x2'));var moment=require(_0x031f('0x3'));var BPromise=require(_0x031f('0x4'));var Mustache=require(_0x031f('0x5'));var util=require('util');var path=require(_0x031f('0x6'));var sox=require(_0x031f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x031f('0x8'));var squel=require('squel');var crypto=require(_0x031f('0x9'));var jsforce=require(_0x031f('0xa'));var deskjs=require(_0x031f('0xb'));var toCsv=require(_0x031f('0xc'));var querystring=require('querystring');var Papa=require(_0x031f('0xd'));var Redis=require(_0x031f('0xe'));var authService=require(_0x031f('0xf'));var qs=require(_0x031f('0x10'));var as=require(_0x031f('0x11'));var hardwareService=require(_0x031f('0x12'));var logger=require(_0x031f('0x13'))(_0x031f('0x14'));var utils=require('../../config/utils');var config=require(_0x031f('0x15'));var licenseUtil=require(_0x031f('0x16'));var db=require(_0x031f('0x17'))['db'];var dbH=require(_0x031f('0x17'))[_0x031f('0x18')];function respondWithStatusCode(_0x405896,_0x1c230d){_0x1c230d=_0x1c230d||0xcc;return function(_0x5d0457){if(_0x5d0457){return _0x405896[_0x031f('0x19')](_0x1c230d);}return _0x405896[_0x031f('0x1a')](_0x1c230d)[_0x031f('0x1b')]();};}function respondWithResult(_0x2e3dfe,_0x2ea549){_0x2ea549=_0x2ea549||0xc8;return function(_0x57f9c0){if(_0x57f9c0){return _0x2e3dfe['status'](_0x2ea549)[_0x031f('0x1c')](_0x57f9c0);}};}function respondWithFilteredResult(_0x3a10aa,_0xe4fc1d){return function(_0x286177){if(_0x286177){var _0x5196b1=typeof _0xe4fc1d[_0x031f('0x1d')]===_0x031f('0x1e')&&typeof _0xe4fc1d['limit']===_0x031f('0x1e');var _0x535e70=_0x286177[_0x031f('0x1f')];var _0x5f2199=_0x5196b1?0x0:_0xe4fc1d[_0x031f('0x1d')];var _0xaa155=_0x5196b1?_0x286177[_0x031f('0x1f')]:_0xe4fc1d[_0x031f('0x1d')]+_0xe4fc1d[_0x031f('0x20')];var _0x2825ef;if(_0xaa155>=_0x535e70){_0xaa155=_0x535e70;_0x2825ef=0xc8;}else{_0x2825ef=0xce;}_0x3a10aa[_0x031f('0x1a')](_0x2825ef);return _0x3a10aa[_0x031f('0x21')](_0x031f('0x22'),_0x5f2199+'-'+_0xaa155+'/'+_0x535e70)['json'](_0x286177);}return null;};}function patchUpdates(_0xf72793){return function(_0x33926c){try{jsonpatch[_0x031f('0x23')](_0x33926c,_0xf72793,!![]);}catch(_0x4d6706){return BPromise['reject'](_0x4d6706);}return _0x33926c[_0x031f('0x24')]();};}function saveUpdates(_0x4d0f92,_0x3472a2){return function(_0x57f6c4){if(_0x57f6c4){return _0x57f6c4['update'](_0x4d0f92)['then'](function(_0x971691){return _0x971691;});}return null;};}function removeEntity(_0x12c406,_0x2920cd){return function(_0x4c8126){if(_0x4c8126){return _0x4c8126['destroy']()[_0x031f('0x25')](function(){var _0x5a64c0=_0x4c8126[_0x031f('0x26')]({'plain':!![]});var _0x1f5a14=_0x031f('0x27');return db['UserProfileResource'][_0x031f('0x28')]({'where':{'type':_0x1f5a14,'resourceId':_0x5a64c0['id']}})[_0x031f('0x25')](function(){return _0x4c8126;});})['then'](function(){_0x12c406[_0x031f('0x1a')](0xcc)[_0x031f('0x1b')]();});}};}function handleEntityNotFound(_0x2403e9,_0x5395ea){return function(_0xa308b){if(!_0xa308b){_0x2403e9[_0x031f('0x19')](0x194);}return _0xa308b;};}function handleError(_0xb6ed6c,_0xaf5bea){_0xaf5bea=_0xaf5bea||0x1f4;return function(_0xfaa36){logger[_0x031f('0x29')](_0xfaa36['stack']);if(_0xfaa36[_0x031f('0x2a')]){delete _0xfaa36[_0x031f('0x2a')];}_0xb6ed6c[_0x031f('0x1a')](_0xaf5bea)[_0x031f('0x2b')](_0xfaa36);};}exports[_0x031f('0x2c')]=function(_0x2d24f0,_0x378692){var _0x87dc07={},_0x2034ac={},_0xfc4a89={'count':0x0,'rows':[]};var _0x2cf3a8=_['map'](db[_0x031f('0x2d')][_0x031f('0x2e')],function(_0xb3a6bd){return{'name':_0xb3a6bd[_0x031f('0x2f')],'type':_0xb3a6bd[_0x031f('0x30')][_0x031f('0x31')]};});_0x2034ac[_0x031f('0x32')]=_[_0x031f('0x33')](_0x2cf3a8,_0x031f('0x2a'));_0x2034ac[_0x031f('0x34')]=_[_0x031f('0x35')](_0x2d24f0[_0x031f('0x34')]);_0x2034ac[_0x031f('0x36')]=_['intersection'](_0x2034ac[_0x031f('0x32')],_0x2034ac[_0x031f('0x34')]);_0x87dc07['attributes']=_[_0x031f('0x37')](_0x2034ac[_0x031f('0x32')],qs['fields'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x38')]));_0x87dc07[_0x031f('0x39')]=_0x87dc07[_0x031f('0x39')]['length']?_0x87dc07['attributes']:_0x2034ac[_0x031f('0x32')];if(!_0x2d24f0['query'][_0x031f('0x3a')](_0x031f('0x3b'))){_0x87dc07[_0x031f('0x20')]=qs['limit'](_0x2d24f0['query'][_0x031f('0x20')]);_0x87dc07['offset']=qs['offset'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x1d')]);}_0x87dc07[_0x031f('0x3c')]=qs[_0x031f('0x3d')](_0x2d24f0[_0x031f('0x34')][_0x031f('0x3d')]);_0x87dc07[_0x031f('0x3e')]=qs['filters'](_[_0x031f('0x3f')](_0x2d24f0[_0x031f('0x34')],_0x2034ac[_0x031f('0x36')]),_0x2cf3a8);if(_0x2d24f0[_0x031f('0x34')]['filter']){_0x87dc07[_0x031f('0x3e')]=_[_0x031f('0x40')](_0x87dc07[_0x031f('0x3e')],{'$or':_['map'](_0x2cf3a8,function(_0x24ec95){if(_0x24ec95[_0x031f('0x30')]!=='VIRTUAL'){var _0x36bafa={};_0x36bafa[_0x24ec95[_0x031f('0x2a')]]={'$like':'%'+_0x2d24f0['query']['filter']+'%'};return _0x36bafa;}})});}_0x87dc07=_[_0x031f('0x40')]({},_0x87dc07,_0x2d24f0[_0x031f('0x41')]);var _0x9efbc4={'where':_0x87dc07[_0x031f('0x3e')]};return db[_0x031f('0x2d')][_0x031f('0x1f')](_0x9efbc4)[_0x031f('0x25')](function(_0x5a212c){_0xfc4a89[_0x031f('0x1f')]=_0x5a212c;if(_0x2d24f0[_0x031f('0x34')]['includeAll']){_0x87dc07[_0x031f('0x42')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x031f('0x43')](_0x87dc07);})[_0x031f('0x25')](function(_0x56dd24){_0xfc4a89[_0x031f('0x44')]=_0x56dd24;return _0xfc4a89;})[_0x031f('0x25')](respondWithFilteredResult(_0x378692,_0x87dc07))[_0x031f('0x45')](handleError(_0x378692,null));};exports['show']=function(_0x98747f,_0x213e1c){var _0x1d3324={'raw':!![],'where':{'id':_0x98747f[_0x031f('0x46')]['id']}},_0x2a6cba={};_0x2a6cba[_0x031f('0x32')]=_[_0x031f('0x35')](db[_0x031f('0x2d')][_0x031f('0x2e')]);_0x2a6cba['query']=_[_0x031f('0x35')](_0x98747f[_0x031f('0x34')]);_0x2a6cba[_0x031f('0x36')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],_0x2a6cba[_0x031f('0x34')]);_0x1d3324[_0x031f('0x39')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],qs['fields'](_0x98747f[_0x031f('0x34')]['fields']));_0x1d3324['attributes']=_0x1d3324[_0x031f('0x39')][_0x031f('0x47')]?_0x1d3324[_0x031f('0x39')]:_0x2a6cba[_0x031f('0x32')];if(_0x98747f[_0x031f('0x34')]['includeAll']){_0x1d3324[_0x031f('0x42')]=[{'all':!![]}];}_0x1d3324=_[_0x031f('0x40')]({},_0x1d3324,_0x98747f[_0x031f('0x41')]);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0x1d3324)[_0x031f('0x25')](handleEntityNotFound(_0x213e1c,null))[_0x031f('0x25')](respondWithResult(_0x213e1c,null))[_0x031f('0x45')](handleError(_0x213e1c,null));};exports[_0x031f('0x49')]=function(_0x12d28e,_0x5caeb5){return db['AnalyticDefaultReport'][_0x031f('0x49')](_0x12d28e['body'],{})[_0x031f('0x25')](function(_0x3bba44){var _0x5a29e0=_0x12d28e[_0x031f('0x4a')]['get']({'plain':!![]});if(!_0x5a29e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a29e0[_0x031f('0x4b')]==='user'){var _0x16bade=_0x3bba44['get']({'plain':!![]});var _0x11bf43=_0x031f('0x4c');return db['UserProfileSection'][_0x031f('0x48')]({'where':{'name':_0x11bf43,'userProfileId':_0x5a29e0[_0x031f('0x4d')]},'raw':!![]})['then'](function(_0x46471a){if(_0x46471a&&_0x46471a['autoAssociation']===0x0){return db[_0x031f('0x4e')]['create']({'name':_0x16bade[_0x031f('0x2a')],'resourceId':_0x16bade['id'],'type':_0x031f('0x27'),'sectionId':_0x46471a['id']},{})[_0x031f('0x25')](function(){return _0x3bba44;});}else{return _0x3bba44;}})[_0x031f('0x45')](function(_0x691a68){logger['error'](_0x031f('0x4f'),_0x691a68);throw _0x691a68;});}return _0x3bba44;})['then'](respondWithResult(_0x5caeb5,0xc9))[_0x031f('0x45')](handleError(_0x5caeb5,null));};exports[_0x031f('0x50')]=function(_0x4d49f8,_0x1f9c55){if(_0x4d49f8[_0x031f('0x51')]['id']){delete _0x4d49f8['body']['id'];}return db[_0x031f('0x2d')][_0x031f('0x48')]({'where':{'id':_0x4d49f8[_0x031f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f9c55,null))[_0x031f('0x25')](saveUpdates(_0x4d49f8['body'],null))[_0x031f('0x25')](respondWithResult(_0x1f9c55,null))['catch'](handleError(_0x1f9c55,null));};exports[_0x031f('0x28')]=function(_0x561a2b,_0xa52a54){return db[_0x031f('0x2d')]['find']({'where':{'id':_0x561a2b['params']['id']}})[_0x031f('0x25')](handleEntityNotFound(_0xa52a54,null))[_0x031f('0x25')](removeEntity(_0xa52a54,null))['catch'](handleError(_0xa52a54,null));};exports[_0x031f('0x52')]=function(_0xb44c73,_0x255003){var _0x286d4e=0xa;var _0x21a89d=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),'cross_join'];var _0xe452c2={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x031f('0x58'),'MIN':_0x031f('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x198e2e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x031f('0x5d')};var _0xcf8b7=function(_0x4a7fbb){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),'IS\x20NOT\x20NULL',_0x031f('0x60'),_0x031f('0x61')],_0x4a7fbb);};var _0x451c71=function(_0x22d211){if(!_0x22d211||!_0x22d211[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x2ddf15='(',_0x4527e5=0x0;_0x4527e5<_0x22d211[_0x031f('0x62')]['length'];_0x4527e5+=0x1){_0x4527e5>0x0&&(_0x2ddf15+='\x20'+_0x22d211[_0x031f('0x63')]+'\x20');_0x2ddf15+=_0x22d211['rules'][_0x4527e5][_0x031f('0x64')]?_0x451c71(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x64')]):_0x22d211['rules'][_0x4527e5]['field']+'\x20'+_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')]+(_0xcf8b7(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')])?'\x20'+_0x22d211['rules'][_0x4527e5][_0x031f('0x66')]:'');}return _0x2ddf15+')';};var _0x5a181c={'where':{'id':_0xb44c73[_0x031f('0x46')]['id']}},_0x478982,_0x2179ee,_0x534bae,_0x50d618,_0x71e67;_0x5a181c=_[_0x031f('0x40')]({},_0x5a181c,_0xb44c73[_0x031f('0x41')]);return db[_0x031f('0x2d')]['find'](_0x5a181c)['then'](function(_0x214eec){if(_0x214eec){_0x478982=_0x214eec;return _0x214eec['getFields']();}return null;})[_0x031f('0x25')](function(_0xa921b2){if(_0xa921b2){if(!_0xa921b2['length']){throw new db[(_0x031f('0x67'))][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2179ee=_0xa921b2;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5bea08){if(_0x5bea08){_0x534bae=_['keyBy'](_0x5bea08,'id');var _0x3bcc7e;var _0x232b62=squel[_0x031f('0x6b')]();_0x232b62[_0x031f('0x6c')](_0x478982[_0x031f('0x6d')]);for(var _0x26fa57=0x0;_0x26fa57<_0x2179ee[_0x031f('0x47')];_0x26fa57+=0x1){_0x3bcc7e=_0x2179ee[_0x26fa57]['MetricId']?_0x534bae[_0x2179ee[_0x26fa57]['MetricId']]['metric']:_0x2179ee[_0x26fa57]['field'];_0x3bcc7e=_0x2179ee[_0x26fa57][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xe452c2[_0x2179ee[_0x26fa57][_0x031f('0x6e')]],'%s',_0x3bcc7e):_0x3bcc7e;_0x3bcc7e=_0x2179ee[_0x26fa57]['format']?_[_0x031f('0x6f')](_0x198e2e[_0x2179ee[_0x26fa57][_0x031f('0x70')]],'%s',_0x3bcc7e):_0x3bcc7e;if(_0x2179ee[_0x26fa57]['groupBy']){_0x232b62[_0x031f('0x64')](_0x3bcc7e);}_0x2179ee[_0x26fa57][_0x031f('0x71')]&&_0x232b62[_0x031f('0x3c')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x232b62[_0x031f('0x73')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x74')]||_0x3bcc7e);}if(_0x478982['joins']){_0x478982['joins']=JSON[_0x031f('0x75')](_0x478982['joins']);for(var _0x2ed9c1=0x0;_0x2ed9c1<_0x478982['joins'][_0x031f('0x47')];_0x2ed9c1+=0x1){if(_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]&&_['includes'](_0x21a89d,_0x478982[_0x031f('0x76')][_0x2ed9c1]['type'])&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x77')]&&_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable']&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]){_0x232b62[_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]](_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable'],null,util['format'](_0x031f('0x79'),_0x478982[_0x031f('0x6d')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x77')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x7a')],_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]));}}}if(_0x478982[_0x031f('0x7b')]){_0x478982['conditions']=JSON[_0x031f('0x75')](_0x478982[_0x031f('0x7b')]);_0x232b62[_0x031f('0x3e')](_0x451c71(_0x478982['conditions'][_0x031f('0x64')]));}_0x71e67=_0x232b62[_0x031f('0x7c')]();_0x232b62['limit'](_0x286d4e);_0x232b62[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x232b62[_0x031f('0x7f')]());return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232b62[_0x031f('0x7f')](),{'type':dbH['sequelize'][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](respondWithResult(_0x255003,null))['catch'](handleError(_0x255003,null));};function runReport(_0x4f4aff,_0x26de7c,_0x5bd344){var _0x54f02d=_0x26de7c[_0x031f('0x2a')];var _0x184bbd=0xa;var _0x1c8055=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),_0x031f('0x83')];var _0x32c626={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':_0x031f('0x59'),'AVG':_0x031f('0x85'),'GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6970f5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x031f('0x86'),'ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x510bb6=function(_0x3cfaa4){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x3cfaa4);};var _0x5e0853=function(_0x263658){if(!_0x263658||!_0x263658[_0x031f('0x62')]['length']){return'';}for(var _0x25ea89='(',_0x2f2e96=0x0;_0x2f2e96<_0x263658[_0x031f('0x62')][_0x031f('0x47')];_0x2f2e96+=0x1){_0x2f2e96>0x0&&(_0x25ea89+='\x20'+_0x263658[_0x031f('0x63')]+'\x20');_0x25ea89+=_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x64')]?_0x5e0853(_0x263658['rules'][_0x2f2e96][_0x031f('0x64')]):_0x263658['rules'][_0x2f2e96][_0x031f('0x73')]+'\x20'+_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x65')]+(_0x510bb6(_0x263658['rules'][_0x2f2e96]['condition'])?'\x20'+_0x263658['rules'][_0x2f2e96][_0x031f('0x66')]:'');}return _0x25ea89+')';};var _0xee744={'where':{'id':_0x4f4aff['id']}},_0x8f0afd,_0x2985fe,_0x290f82,_0x307246,_0x232aa0;_0xee744=_['merge']({},_0xee744,_0x5bd344);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0xee744)[_0x031f('0x25')](function(_0x54d86e){if(_0x54d86e){_0x8f0afd=_0x54d86e;return _0x54d86e[_0x031f('0x89')]();}return null;})['then'](function(_0x1c31d5){if(_0x1c31d5){if(!_0x1c31d5[_0x031f('0x47')]){throw new db['Sequelize'][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2985fe=_0x1c31d5;return db['AnalyticMetric'][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x1b588e){if(_0x1b588e){_0x290f82=_['keyBy'](_0x1b588e,'id');var _0xa9b5e2;var _0x31504b=squel[_0x031f('0x6b')]();_0x31504b[_0x031f('0x6c')](_0x8f0afd[_0x031f('0x6d')]);for(var _0x2b3326=0x0;_0x2b3326<_0x2985fe['length'];_0x2b3326+=0x1){_0xa9b5e2=_0x2985fe[_0x2b3326][_0x031f('0x8a')]?_0x290f82[_0x2985fe[_0x2b3326][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x2985fe[_0x2b3326][_0x031f('0x73')];_0xa9b5e2=_0x2985fe[_0x2b3326]['function']?_[_0x031f('0x6f')](_0x32c626[_0x2985fe[_0x2b3326][_0x031f('0x6e')]],'%s',_0xa9b5e2):_0xa9b5e2;_0xa9b5e2=_0x2985fe[_0x2b3326]['format']?_[_0x031f('0x6f')](_0x6970f5[_0x2985fe[_0x2b3326][_0x031f('0x70')]],'%s',_0xa9b5e2):_0xa9b5e2;if(_0x2985fe[_0x2b3326][_0x031f('0x8c')]){_0x31504b[_0x031f('0x64')](_0xa9b5e2);}_0x2985fe[_0x2b3326][_0x031f('0x71')]&&_0x31504b[_0x031f('0x3c')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x31504b[_0x031f('0x73')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x74')]||_0xa9b5e2);}if(_0x8f0afd[_0x031f('0x76')]){_0x8f0afd[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x76')]);for(var _0x2433ce=0x0;_0x2433ce<_0x8f0afd['joins'][_0x031f('0x47')];_0x2433ce+=0x1){if(_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0x1c8055,_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')])&&_0x8f0afd['joins'][_0x2433ce]['parentKey']&&_0x8f0afd['joins'][_0x2433ce][_0x031f('0x7a')]&&_0x8f0afd[_0x031f('0x76')][_0x2433ce]['foreignKey']){_0x31504b[_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]](_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],null,util['format'](_0x031f('0x79'),_0x8f0afd[_0x031f('0x6d')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x77')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x78')]));}}}if(_0x8f0afd[_0x031f('0x7b')]){_0x8f0afd[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x7b')]);_0x31504b['where'](_0x5e0853(_0x8f0afd[_0x031f('0x7b')][_0x031f('0x64')]));}_0x232aa0=_0x31504b['clone']();_0x31504b[_0x031f('0x20')](_0x184bbd);_0x31504b[_0x031f('0x1d')](0x0);return;}})['then'](function(){if(_0x26de7c[_0x031f('0x8d')]===_0x031f('0x8e')){return null;}var _0x1ade73=_[_0x031f('0x40')](_0x26de7c,{'name':_0x26de7c[_0x031f('0x8f')]||_0x26de7c[_0x031f('0x2a')]||_0x8f0afd[_0x031f('0x2a')],'basename':_0x54f02d,'savename':util[_0x031f('0x70')](_0x031f('0x90'),_0x26de7c['name']||_0x8f0afd[_0x031f('0x2a')],require(_0x031f('0x91'))[_0x031f('0x92')](0x4),_0x26de7c['output']||'csv'),'reportId':_0x8f0afd['id'],'reportType':_0x031f('0x93')});return db['AnalyticExtractedReport'][_0x031f('0x49')](_0x1ade73,{'raw':!![]});})[_0x031f('0x25')](function(_0x4a96f2){if(_0x8f0afd[_0x031f('0x6d')]===_0x031f('0x94')){_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x95'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}else{_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x98'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}if(_0x4a96f2){logger[_0x031f('0x99')]('Run\x20Query:',_0x232aa0['toString']());require(_0x031f('0x9a'))['fork'](path[_0x031f('0x53')](__dirname,_0x031f('0x9b'),_0x4a96f2[_0x031f('0x8d')]),[_0x4a96f2['id'],_0x232aa0['toString'](),path[_0x031f('0x53')](__dirname,_0x031f('0x9c'),_0x4a96f2['savename']),_0x54f02d]);return _0x4a96f2;}else{var _0x185085=squel[_0x031f('0x6b')]();_0x185085[_0x031f('0x6c')]('('+_0x232aa0[_0x031f('0x7f')]()+')',_0x031f('0x9d'));_0x185085[_0x031f('0x73')](_0x031f('0x9e'),'count');_0x232aa0[_0x031f('0x20')](_0x26de7c[_0x031f('0x20')]||_0x184bbd);_0x232aa0[_0x031f('0x1d')](_0x26de7c[_0x031f('0x1d')]||0x0);return dbH['sequelize']['query'](_0x185085[_0x031f('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x031f('0x82')]})['then'](function(_0x579ade){if(!_0x579ade[_0x031f('0x47')]){_0x307246=0x0;}else{_0x307246=_0x579ade[0x0][_0x031f('0x1f')]||0x0;}return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232aa0[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')]['QueryTypes'][_0x031f('0x82')]});})[_0x031f('0x25')](function(_0x52a3f0){return{'rows':_0x52a3f0||[],'count':_0x307246};});}});}exports[_0x031f('0x9f')]=function(_0x355e1a,_0x30c32f){return runReport(_0x355e1a[_0x031f('0x46')],_0x355e1a['query'],_0x355e1a['options'])['then'](respondWithResult(_0x30c32f,null))[_0x031f('0x45')](handleError(_0x30c32f,null));};exports[_0x031f('0xa0')]=runReport;exports[_0x031f('0x34')]=function(_0x3ec98a,_0x3ed663){var _0xac324f=0xa;var _0xcf0af9=[_0x031f('0x53'),_0x031f('0x54'),'right_join',_0x031f('0x83')];var _0xde544e={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x84cd0c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x031f('0xa1'),'HOUR':'HOUR(%s)','ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':_0x031f('0x5d')};var _0x24aff3=function(_0x35a1f1){return!_[_0x031f('0x5e')](['IS\x20NULL',_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x35a1f1);};var _0x3cb099=function(_0x4a4d8f){if(!_0x4a4d8f||!_0x4a4d8f[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x578201='(',_0xdbf09f=0x0;_0xdbf09f<_0x4a4d8f['rules'][_0x031f('0x47')];_0xdbf09f+=0x1){_0xdbf09f>0x0&&(_0x578201+='\x20'+_0x4a4d8f[_0x031f('0x63')]+'\x20');_0x578201+=_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x64')]?_0x3cb099(_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['group']):_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['field']+'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x65')]+(_0x24aff3(_0x4a4d8f['rules'][_0xdbf09f][_0x031f('0x65')])?'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x66')]:'');}return _0x578201+')';};var _0x123b4d={'where':{'id':_0x3ec98a['params']['id']}},_0x3f80b5,_0x53cd67,_0x516f11,_0x50cdb2,_0x2e9a3b;_0x123b4d=_[_0x031f('0x40')]({},_0x123b4d,_0x3ec98a[_0x031f('0x41')]);return db[_0x031f('0x2d')][_0x031f('0x48')](_0x123b4d)[_0x031f('0x25')](function(_0x53911d){if(_0x53911d){_0x3f80b5=_0x53911d;return _0x53911d[_0x031f('0x89')]();}return null;})['then'](function(_0x30fa18){if(_0x30fa18){if(!_0x30fa18[_0x031f('0x47')]){throw new db[(_0x031f('0x67'))]['ValidationErrorItem'](_0x031f('0x69'),0x193);}_0x53cd67=_0x30fa18;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5b092c){if(_0x5b092c){_0x516f11=_[_0x031f('0xa2')](_0x5b092c,'id');var _0x7b8699;var _0x14a497=squel[_0x031f('0x6b')]();_0x14a497[_0x031f('0x6c')](_0x3f80b5[_0x031f('0x6d')]);for(var _0x59fd9a=0x0;_0x59fd9a<_0x53cd67[_0x031f('0x47')];_0x59fd9a+=0x1){_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x8a')]?_0x516f11[_0x53cd67[_0x59fd9a][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x53cd67[_0x59fd9a][_0x031f('0x73')];_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xde544e[_0x53cd67[_0x59fd9a]['function']],'%s',_0x7b8699):_0x7b8699;_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x70')]?_[_0x031f('0x6f')](_0x84cd0c[_0x53cd67[_0x59fd9a][_0x031f('0x70')]],'%s',_0x7b8699):_0x7b8699;if(_0x53cd67[_0x59fd9a][_0x031f('0x8c')]){_0x14a497[_0x031f('0x64')](_0x7b8699);}_0x53cd67[_0x59fd9a]['orderBy']&&_0x14a497[_0x031f('0x3c')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x14a497[_0x031f('0x73')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x74')]||_0x7b8699);}if(_0x3f80b5['joins']){_0x3f80b5[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x76')]);for(var _0x110747=0x0;_0x110747<_0x3f80b5[_0x031f('0x76')]['length'];_0x110747+=0x1){if(_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0xcf0af9,_0x3f80b5['joins'][_0x110747][_0x031f('0x30')])&&_0x3f80b5['joins'][_0x110747][_0x031f('0x77')]&&_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')]&&_0x3f80b5[_0x031f('0x76')][_0x110747]['foreignKey']){_0x14a497[_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]](_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')],null,util[_0x031f('0x70')]('%s.%s\x20=\x20%s.%s',_0x3f80b5[_0x031f('0x6d')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x77')],_0x3f80b5['joins'][_0x110747][_0x031f('0x7a')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x78')]));}}}if(_0x3f80b5['conditions']){_0x3f80b5[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x7b')]);_0x14a497[_0x031f('0x3e')](_0x3cb099(_0x3f80b5[_0x031f('0x7b')]['group']));}_0x2e9a3b=_0x14a497[_0x031f('0x7c')]();_0x14a497[_0x031f('0x20')](_0xac324f);_0x14a497[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x14a497[_0x031f('0x7f')]());return dbH['sequelize']['query'](_0x14a497[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](function(){return{'sql':_0x2e9a3b[_0x031f('0x7f')]()};})[_0x031f('0x25')](respondWithResult(_0x3ed663,null))['catch'](handleError(_0x3ed663,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 73c6f1b..9f47184 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 _0x1f92=['./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','api','moment','path','rimraf'];(function(_0x1c2478,_0x466bf3){var _0x36c4af=function(_0x3b3541){while(--_0x3b3541){_0x1c2478['push'](_0x1c2478['shift']());}};_0x36c4af(++_0x466bf3);}(_0x1f92,0xf4));var _0x21f9=function(_0x23a46d,_0x7ac88f){_0x23a46d=_0x23a46d-0x0;var _0x2a8fb9=_0x1f92[_0x23a46d];return _0x2a8fb9;};'use strict';var _=require(_0x21f9('0x0'));var util=require(_0x21f9('0x1'));var logger=require('../../config/logger')(_0x21f9('0x2'));var moment=require(_0x21f9('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x21f9('0x4'));var rimraf=require(_0x21f9('0x5'));var config=require('../../config/environment');var attributes=require(_0x21f9('0x6'));module['exports']=function(_0x595f72,_0x3043b8){return _0x595f72[_0x21f9('0x7')](_0x21f9('0x8'),attributes,{'tableName':_0x21f9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ac9=['bluebird','request-promise','path','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash','api','moment'];(function(_0xf67b48,_0x879184){var _0x1f1f25=function(_0x938741){while(--_0x938741){_0xf67b48['push'](_0xf67b48['shift']());}};_0x1f1f25(++_0x879184);}(_0x9ac9,0xa2));var _0x99ac=function(_0x89e14f,_0x253300){_0x89e14f=_0x89e14f-0x0;var _0x360088=_0x9ac9[_0x89e14f];return _0x360088;};'use strict';var _=require(_0x99ac('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x99ac('0x1'));var moment=require(_0x99ac('0x2'));var BPromise=require(_0x99ac('0x3'));var rp=require(_0x99ac('0x4'));var fs=require('fs');var path=require(_0x99ac('0x5'));var rimraf=require('rimraf');var config=require(_0x99ac('0x6'));var attributes=require(_0x99ac('0x7'));module['exports']=function(_0x156fed,_0x11e410){return _0x156fed[_0x99ac('0x8')](_0x99ac('0x9'),attributes,{'tableName':_0x99ac('0xa'),'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 9e81797..4f8d551 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 _0x40a2=['catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x4e16a1,_0x36da9d){var _0x19c330=function(_0x541245){while(--_0x541245){_0x4e16a1['push'](_0x4e16a1['shift']());}};_0x19c330(++_0x36da9d);}(_0x40a2,0x155));var _0x240a=function(_0x5455e5,_0x587fa1){_0x5455e5=_0x5455e5-0x0;var _0x991e9d=_0x40a2[_0x5455e5];return _0x991e9d;};'use strict';var _=require(_0x240a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x240a('0x1'));var rs=require(_0x240a('0x2'));var fs=require('fs');var Redis=require(_0x240a('0x3'));var db=require(_0x240a('0x4'))['db'];var utils=require(_0x240a('0x5'));var logger=require('../../config/logger')(_0x240a('0x6'));var config=require(_0x240a('0x7'));var jayson=require(_0x240a('0x8'));var client=jayson['client'][_0x240a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4be502,_0x5c0b6d,_0x44aa04){return new BPromise(function(_0x29f429,_0x46c3e4){return client[_0x240a('0xa')](_0x4be502,_0x44aa04)['then'](function(_0x1efef8){logger[_0x240a('0xb')](_0x240a('0xc'),_0x5c0b6d,_0x240a('0xd'));logger[_0x240a('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x5c0b6d,_0x240a('0xd'),JSON[_0x240a('0xf')](_0x1efef8));if(_0x1efef8[_0x240a('0x10')]){if(_0x1efef8[_0x240a('0x10')]['code']===0x1f4){logger[_0x240a('0x10')](_0x240a('0xc'),_0x5c0b6d,_0x1efef8[_0x240a('0x10')][_0x240a('0x11')]);return _0x46c3e4(_0x1efef8['error'][_0x240a('0x11')]);}logger[_0x240a('0x10')](_0x240a('0xc'),_0x5c0b6d,_0x1efef8['error'][_0x240a('0x11')]);return _0x29f429(_0x1efef8[_0x240a('0x10')][_0x240a('0x11')]);}else{logger[_0x240a('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5c0b6d,'request\x20sent');_0x29f429(_0x1efef8[_0x240a('0x12')][_0x240a('0x11')]);}})[_0x240a('0x13')](function(_0x37ee89){logger[_0x240a('0x10')](_0x240a('0xc'),_0x5c0b6d,_0x37ee89);_0x46c3e4(_0x37ee89);});});} \ No newline at end of file +var _0x123a=['util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x123a,0xbf));var _0xa123=function(_0x55a440,_0x5dacbc){_0x55a440=_0x55a440-0x0;var _0x1561b9=_0x123a[_0x55a440];return _0x1561b9;};'use strict';var _=require(_0xa123('0x0'));var util=require(_0xa123('0x1'));var moment=require(_0xa123('0x2'));var BPromise=require('bluebird');var rs=require(_0xa123('0x3'));var fs=require('fs');var Redis=require(_0xa123('0x4'));var db=require(_0xa123('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa123('0x6'))(_0xa123('0x7'));var config=require(_0xa123('0x8'));var jayson=require(_0xa123('0x9'));var client=jayson[_0xa123('0xa')][_0xa123('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ca97d,_0x308284,_0x143999){return new BPromise(function(_0xa01cf3,_0x2c1f08){return client[_0xa123('0xc')](_0x2ca97d,_0x143999)[_0xa123('0xd')](function(_0x51d5a1){logger[_0xa123('0xe')](_0xa123('0xf'),_0x308284,_0xa123('0x10'));logger[_0xa123('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x308284,_0xa123('0x10'),JSON[_0xa123('0x12')](_0x51d5a1));if(_0x51d5a1[_0xa123('0x13')]){if(_0x51d5a1[_0xa123('0x13')][_0xa123('0x14')]===0x1f4){logger[_0xa123('0x13')](_0xa123('0xf'),_0x308284,_0x51d5a1[_0xa123('0x13')][_0xa123('0x15')]);return _0x2c1f08(_0x51d5a1[_0xa123('0x13')][_0xa123('0x15')]);}logger[_0xa123('0x13')](_0xa123('0xf'),_0x308284,_0x51d5a1[_0xa123('0x13')][_0xa123('0x15')]);return _0xa01cf3(_0x51d5a1[_0xa123('0x13')][_0xa123('0x15')]);}else{logger['info'](_0xa123('0xf'),_0x308284,'request\x20sent');_0xa01cf3(_0x51d5a1[_0xa123('0x16')][_0xa123('0x15')]);}})[_0xa123('0x17')](function(_0x4d5545){logger[_0xa123('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x308284,_0x4d5545);_0x2c1f08(_0x4d5545);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 3161f66..afe9638 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 _0x4f81=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','get','/:id','show','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports'];(function(_0x460191,_0x8dd4a2){var _0x422c3f=function(_0x33b8a3){while(--_0x33b8a3){_0x460191['push'](_0x460191['shift']());}};_0x422c3f(++_0x8dd4a2);}(_0x4f81,0x1e3));var _0x14f8=function(_0x2242c6,_0x5c16a8){_0x2242c6=_0x2242c6-0x0;var _0x129de0=_0x4f81[_0x2242c6];return _0x129de0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x14f8('0x0'));var timeout=require('connect-timeout');var express=require(_0x14f8('0x1'));var router=express[_0x14f8('0x2')]();var fs_extra=require(_0x14f8('0x3'));var auth=require(_0x14f8('0x4'));var interaction=require(_0x14f8('0x5'));var config=require(_0x14f8('0x6'));var controller=require(_0x14f8('0x7'));router['get']('/',auth[_0x14f8('0x8')](),controller['index']);router[_0x14f8('0x9')](_0x14f8('0xa'),auth['isAuthenticated'](),controller[_0x14f8('0xb')]);router[_0x14f8('0x9')]('/:id/preview',auth[_0x14f8('0x8')](),controller['preview']);router['get'](_0x14f8('0xc'),auth[_0x14f8('0x8')](),controller[_0x14f8('0xd')]);router[_0x14f8('0x9')](_0x14f8('0xe'),auth[_0x14f8('0x8')](),controller[_0x14f8('0xf')]);router[_0x14f8('0x10')]('/',auth[_0x14f8('0x8')](),controller[_0x14f8('0x11')]);router[_0x14f8('0x12')](_0x14f8('0xa'),auth['isAuthenticated'](),controller[_0x14f8('0x13')]);router[_0x14f8('0x14')](_0x14f8('0xa'),auth[_0x14f8('0x8')](),controller[_0x14f8('0x15')]);module[_0x14f8('0x16')]=router; \ No newline at end of file +var _0x7a7d=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','get','/:id','show','/:id/preview','preview','/:id/run','query','post','create','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x266c74,_0x1f219c){var _0x4c2afe=function(_0x2b9cd3){while(--_0x2b9cd3){_0x266c74['push'](_0x266c74['shift']());}};_0x4c2afe(++_0x1f219c);}(_0x7a7d,0x165));var _0xd7a7=function(_0x104ffe,_0x4babd3){_0x104ffe=_0x104ffe-0x0;var _0x5b6831=_0x7a7d[_0x104ffe];return _0x5b6831;};'use strict';var multer=require('multer');var util=require(_0xd7a7('0x0'));var path=require(_0xd7a7('0x1'));var timeout=require(_0xd7a7('0x2'));var express=require(_0xd7a7('0x3'));var router=express['Router']();var fs_extra=require(_0xd7a7('0x4'));var auth=require(_0xd7a7('0x5'));var interaction=require(_0xd7a7('0x6'));var config=require(_0xd7a7('0x7'));var controller=require(_0xd7a7('0x8'));router['get']('/',auth[_0xd7a7('0x9')](),controller['index']);router[_0xd7a7('0xa')](_0xd7a7('0xb'),auth['isAuthenticated'](),controller[_0xd7a7('0xc')]);router['get'](_0xd7a7('0xd'),auth[_0xd7a7('0x9')](),controller[_0xd7a7('0xe')]);router['get'](_0xd7a7('0xf'),auth[_0xd7a7('0x9')](),controller['run']);router[_0xd7a7('0xa')]('/:id/query',auth['isAuthenticated'](),controller[_0xd7a7('0x10')]);router[_0xd7a7('0x11')]('/',auth['isAuthenticated'](),controller[_0xd7a7('0x12')]);router[_0xd7a7('0x13')](_0xd7a7('0xb'),auth[_0xd7a7('0x9')](),controller[_0xd7a7('0x14')]);router[_0xd7a7('0x15')](_0xd7a7('0xb'),auth[_0xd7a7('0x9')](),controller[_0xd7a7('0x16')]);module[_0xd7a7('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index bc590f6..671e678 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 _0x3a84=['sequelize','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','scheduled','INTEGER','UNSIGNED'];(function(_0x489474,_0x4e04ec){var _0x3c7048=function(_0x57354f){while(--_0x57354f){_0x489474['push'](_0x489474['shift']());}};_0x3c7048(++_0x4e04ec);}(_0x3a84,0x12c));var _0x43a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a84[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x43a8('0x0'));var moment=require('moment');module[_0x43a8('0x1')]={'name':{'type':Sequelize[_0x43a8('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x43a8('0x3')](_0x43a8('0x4'),_0x43a8('0x5'),_0x43a8('0x6')),'allowNull':![],'defaultValue':_0x43a8('0x4')},'savename':{'type':Sequelize[_0x43a8('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x43a8('0x7')]},'endDate':{'type':Sequelize[_0x43a8('0x7')]},'status':{'type':Sequelize[_0x43a8('0x2')],'defaultValue':_0x43a8('0x8')},'type':{'type':Sequelize[_0x43a8('0x3')]('manual',_0x43a8('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x43a8('0xa')](0xb)[_0x43a8('0xb')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe866=['INTEGER','UNSIGNED','moment','exports','STRING','csv','pdf','DATE','Loading','ENUM','manual','scheduled'];(function(_0xc7acfd,_0x39622d){var _0x1d89c4=function(_0x4dbe6a){while(--_0x4dbe6a){_0xc7acfd['push'](_0xc7acfd['shift']());}};_0x1d89c4(++_0x39622d);}(_0xe866,0x16a));var _0x6e86=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe866[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6e86('0x0'));module[_0x6e86('0x1')]={'name':{'type':Sequelize[_0x6e86('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x6e86('0x3'),_0x6e86('0x4'),'xlsx'),'allowNull':![],'defaultValue':_0x6e86('0x3')},'savename':{'type':Sequelize[_0x6e86('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x6e86('0x5')]},'endDate':{'type':Sequelize[_0x6e86('0x5')]},'status':{'type':Sequelize[_0x6e86('0x2')],'defaultValue':_0x6e86('0x6')},'type':{'type':Sequelize[_0x6e86('0x7')](_0x6e86('0x8'),_0x6e86('0x9')),'allowNull':![],'defaultValue':_0x6e86('0x8')},'reportId':{'type':Sequelize[_0x6e86('0xa')](0xb)[_0x6e86('0xb')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 32850a9..e24f7a1 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 _0x2839=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','json','offset','count','limit','status','set','apply','reject','save','update','destroy','then','get','ExtractedReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','rawAttributes','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','squel','jsforce'];(function(_0x825b02,_0x2ff597){var _0x33c5ad=function(_0x14c4f7){while(--_0x14c4f7){_0x825b02['push'](_0x825b02['shift']());}};_0x33c5ad(++_0x2ff597);}(_0x2839,0x1bb));var _0x9283=function(_0xce3c88,_0x49b8bf){_0xce3c88=_0xce3c88-0x0;var _0x1cb6cb=_0x2839[_0xce3c88];return _0x1cb6cb;};'use strict';var emlformat=require(_0x9283('0x0'));var rimraf=require(_0x9283('0x1'));var zipdir=require(_0x9283('0x2'));var jsonpatch=require(_0x9283('0x3'));var rp=require(_0x9283('0x4'));var moment=require(_0x9283('0x5'));var BPromise=require(_0x9283('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x9283('0x7'));var csv=require(_0x9283('0x8'));var ejs=require(_0x9283('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9283('0xa'));var crypto=require('crypto');var jsforce=require(_0x9283('0xb'));var deskjs=require(_0x9283('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9283('0xd'));var Redis=require(_0x9283('0xe'));var authService=require(_0x9283('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9283('0x10'));var hardwareService=require(_0x9283('0x11'));var logger=require(_0x9283('0x12'))(_0x9283('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9283('0x14'))['db'];function respondWithStatusCode(_0x5baaaa,_0x404c8f){_0x404c8f=_0x404c8f||0xcc;return function(_0x13a084){if(_0x13a084){return _0x5baaaa['sendStatus'](_0x404c8f);}return _0x5baaaa['status'](_0x404c8f)[_0x9283('0x15')]();};}function respondWithResult(_0x2ebef9,_0x1bead4){_0x1bead4=_0x1bead4||0xc8;return function(_0x35985b){if(_0x35985b){return _0x2ebef9['status'](_0x1bead4)[_0x9283('0x16')](_0x35985b);}};}function respondWithFilteredResult(_0x5daecc,_0x30550f){return function(_0x5144b6){if(_0x5144b6){var _0x4ec601=typeof _0x30550f[_0x9283('0x17')]==='undefined'&&typeof _0x30550f['limit']==='undefined';var _0x594968=_0x5144b6[_0x9283('0x18')];var _0x470e13=_0x4ec601?0x0:_0x30550f['offset'];var _0x1c09f7=_0x4ec601?_0x5144b6[_0x9283('0x18')]:_0x30550f['offset']+_0x30550f[_0x9283('0x19')];var _0x3ad12f;if(_0x1c09f7>=_0x594968){_0x1c09f7=_0x594968;_0x3ad12f=0xc8;}else{_0x3ad12f=0xce;}_0x5daecc[_0x9283('0x1a')](_0x3ad12f);return _0x5daecc[_0x9283('0x1b')]('Content-Range',_0x470e13+'-'+_0x1c09f7+'/'+_0x594968)['json'](_0x5144b6);}return null;};}function patchUpdates(_0xd461ec){return function(_0xa44b65){try{jsonpatch[_0x9283('0x1c')](_0xa44b65,_0xd461ec,!![]);}catch(_0x22bb8f){return BPromise[_0x9283('0x1d')](_0x22bb8f);}return _0xa44b65[_0x9283('0x1e')]();};}function saveUpdates(_0x3f12fb,_0x4577c2){return function(_0x3be91d){if(_0x3be91d){return _0x3be91d[_0x9283('0x1f')](_0x3f12fb)['then'](function(_0x40cc75){return _0x40cc75;});}return null;};}function removeEntity(_0x3857a9,_0x2c1489){return function(_0xd78847){if(_0xd78847){return _0xd78847[_0x9283('0x20')]()[_0x9283('0x21')](function(){var _0x324164=_0xd78847[_0x9283('0x22')]({'plain':!![]});var _0x591be1=_0x9283('0x23');return db[_0x9283('0x24')][_0x9283('0x20')]({'where':{'type':_0x591be1,'resourceId':_0x324164['id']}})[_0x9283('0x21')](function(){return _0xd78847;});})[_0x9283('0x21')](function(){_0x3857a9[_0x9283('0x1a')](0xcc)[_0x9283('0x15')]();});}};}function handleEntityNotFound(_0x2ba01a,_0x4ccf89){return function(_0x1564fa){if(!_0x1564fa){_0x2ba01a[_0x9283('0x25')](0x194);}return _0x1564fa;};}function handleError(_0xdda86c,_0x5e971a){_0x5e971a=_0x5e971a||0x1f4;return function(_0x3399c1){logger[_0x9283('0x26')](_0x3399c1[_0x9283('0x27')]);if(_0x3399c1['name']){delete _0x3399c1[_0x9283('0x28')];}_0xdda86c[_0x9283('0x1a')](_0x5e971a)[_0x9283('0x29')](_0x3399c1);};}exports[_0x9283('0x2a')]=function(_0xc8a24b,_0xec9d3c){var _0x4b4015={},_0x5d5b75={},_0x25de32={'count':0x0,'rows':[]};var _0x27f3e0=_[_0x9283('0x2b')](db[_0x9283('0x2c')]['rawAttributes'],function(_0x2961c3){return{'name':_0x2961c3[_0x9283('0x2d')],'type':_0x2961c3[_0x9283('0x2e')][_0x9283('0x2f')]};});_0x5d5b75[_0x9283('0x30')]=_['map'](_0x27f3e0,_0x9283('0x28'));_0x5d5b75[_0x9283('0x31')]=_[_0x9283('0x32')](_0xc8a24b[_0x9283('0x31')]);_0x5d5b75[_0x9283('0x33')]=_['intersection'](_0x5d5b75['model'],_0x5d5b75[_0x9283('0x31')]);_0x4b4015[_0x9283('0x34')]=_[_0x9283('0x35')](_0x5d5b75[_0x9283('0x30')],qs[_0x9283('0x36')](_0xc8a24b[_0x9283('0x31')][_0x9283('0x36')]));_0x4b4015[_0x9283('0x34')]=_0x4b4015[_0x9283('0x34')]['length']?_0x4b4015[_0x9283('0x34')]:_0x5d5b75[_0x9283('0x30')];if(!_0xc8a24b['query'][_0x9283('0x37')](_0x9283('0x38'))){_0x4b4015[_0x9283('0x19')]=qs['limit'](_0xc8a24b[_0x9283('0x31')][_0x9283('0x19')]);_0x4b4015[_0x9283('0x17')]=qs[_0x9283('0x17')](_0xc8a24b[_0x9283('0x31')]['offset']);}_0x4b4015[_0x9283('0x39')]=qs[_0x9283('0x3a')](_0xc8a24b[_0x9283('0x31')]['sort']);_0x4b4015[_0x9283('0x3b')]=qs[_0x9283('0x33')](_[_0x9283('0x3c')](_0xc8a24b['query'],_0x5d5b75[_0x9283('0x33')]),_0x27f3e0);if(_0xc8a24b[_0x9283('0x31')][_0x9283('0x3d')]){_0x4b4015[_0x9283('0x3b')]=_[_0x9283('0x3e')](_0x4b4015[_0x9283('0x3b')],{'$or':_[_0x9283('0x2b')](_0x27f3e0,function(_0x40d029){if(_0x40d029[_0x9283('0x2e')]!==_0x9283('0x3f')){var _0x5bbf2c={};_0x5bbf2c[_0x40d029[_0x9283('0x28')]]={'$like':'%'+_0xc8a24b[_0x9283('0x31')][_0x9283('0x3d')]+'%'};return _0x5bbf2c;}})});}_0x4b4015=_[_0x9283('0x3e')]({},_0x4b4015,_0xc8a24b[_0x9283('0x40')]);var _0x492052={'where':_0x4b4015[_0x9283('0x3b')]};return db[_0x9283('0x2c')]['count'](_0x492052)[_0x9283('0x21')](function(_0x452b6d){_0x25de32[_0x9283('0x18')]=_0x452b6d;if(_0xc8a24b['query'][_0x9283('0x41')]){_0x4b4015[_0x9283('0x42')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x4b4015);})['then'](function(_0x373643){_0x25de32['rows']=_0x373643;return _0x25de32;})[_0x9283('0x21')](respondWithFilteredResult(_0xec9d3c,_0x4b4015))[_0x9283('0x43')](handleError(_0xec9d3c,null));};exports[_0x9283('0x44')]=function(_0x511e7a,_0x29c174){var _0x1149bc={'raw':!![],'where':{'id':_0x511e7a['params']['id']}},_0x5c2712={};_0x5c2712['model']=_[_0x9283('0x32')](db[_0x9283('0x2c')][_0x9283('0x45')]);_0x5c2712[_0x9283('0x31')]=_[_0x9283('0x32')](_0x511e7a[_0x9283('0x31')]);_0x5c2712[_0x9283('0x33')]=_[_0x9283('0x35')](_0x5c2712[_0x9283('0x30')],_0x5c2712['query']);_0x1149bc[_0x9283('0x34')]=_['intersection'](_0x5c2712[_0x9283('0x30')],qs['fields'](_0x511e7a[_0x9283('0x31')][_0x9283('0x36')]));_0x1149bc['attributes']=_0x1149bc['attributes'][_0x9283('0x46')]?_0x1149bc[_0x9283('0x34')]:_0x5c2712[_0x9283('0x30')];if(_0x511e7a[_0x9283('0x31')]['includeAll']){_0x1149bc[_0x9283('0x42')]=[{'all':!![]}];}_0x1149bc=_[_0x9283('0x3e')]({},_0x1149bc,_0x511e7a['options']);return db[_0x9283('0x2c')]['find'](_0x1149bc)['then'](handleEntityNotFound(_0x29c174,null))['then'](respondWithResult(_0x29c174,null))[_0x9283('0x43')](handleError(_0x29c174,null));};exports[_0x9283('0x47')]=function(_0x5c12ac,_0x1257c2){return db[_0x9283('0x2c')][_0x9283('0x47')](_0x5c12ac['body'],{})[_0x9283('0x21')](function(_0x9c2b2c){var _0xa8a6b4=_0x5c12ac[_0x9283('0x48')][_0x9283('0x22')]({'plain':!![]});if(!_0xa8a6b4)throw new Error(_0x9283('0x49'));if(_0xa8a6b4[_0x9283('0x4a')]===_0x9283('0x48')){var _0x8aedf4=_0x9c2b2c[_0x9283('0x22')]({'plain':!![]});var _0x305f8b=_0x9283('0x23');return db['UserProfileSection'][_0x9283('0x4b')]({'where':{'name':_0x305f8b,'userProfileId':_0xa8a6b4['userProfileId']},'raw':!![]})['then'](function(_0x2931be){if(_0x2931be&&_0x2931be[_0x9283('0x4c')]===0x0){return db['UserProfileResource'][_0x9283('0x47')]({'name':_0x8aedf4[_0x9283('0x28')],'resourceId':_0x8aedf4['id'],'type':_0x2931be['name'],'sectionId':_0x2931be['id']},{})[_0x9283('0x21')](function(){return _0x9c2b2c;});}else{return _0x9c2b2c;}})['catch'](function(_0x852310){logger[_0x9283('0x26')](_0x9283('0x4d'),_0x852310);throw _0x852310;});}return _0x9c2b2c;})[_0x9283('0x21')](respondWithResult(_0x1257c2,0xc9))[_0x9283('0x43')](handleError(_0x1257c2,null));};exports[_0x9283('0x1f')]=function(_0x14896f,_0xea2b99){if(_0x14896f[_0x9283('0x4e')]['id']){delete _0x14896f[_0x9283('0x4e')]['id'];}return db[_0x9283('0x2c')][_0x9283('0x4b')]({'where':{'id':_0x14896f[_0x9283('0x4f')]['id']}})[_0x9283('0x21')](handleEntityNotFound(_0xea2b99,null))[_0x9283('0x21')](saveUpdates(_0x14896f['body'],null))['then'](respondWithResult(_0xea2b99,null))[_0x9283('0x43')](handleError(_0xea2b99,null));};exports[_0x9283('0x20')]=function(_0xdb4c85,_0x4126ee){return db['AnalyticExtractedReport'][_0x9283('0x4b')]({'where':{'id':_0xdb4c85[_0x9283('0x4f')]['id']}})[_0x9283('0x21')](handleEntityNotFound(_0x4126ee,null))[_0x9283('0x21')](removeEntity(_0x4126ee,null))[_0x9283('0x43')](handleError(_0x4126ee,null));};exports['download']=function(_0xeb5d53,_0x1b6d4d,_0xa96d2b){return db[_0x9283('0x2c')][_0x9283('0x4b')]({'where':{'id':_0xeb5d53[_0x9283('0x4f')]['id']},'attributes':[_0x9283('0x28'),_0x9283('0x50'),_0x9283('0x51'),_0x9283('0x52')],'raw':!![]})[_0x9283('0x21')](handleEntityNotFound(_0x1b6d4d,null))[_0x9283('0x21')](function(_0x393699){if(_0x393699){if(!fs[_0x9283('0x53')](path[_0x9283('0x54')](config[_0x9283('0x55')],_0x9283('0x56'),_0x393699[_0x9283('0x51')]))){throw new db['Sequelize'][(_0x9283('0x57'))](_0x9283('0x58'));}if(_0xeb5d53[_0x9283('0x31')]['exists']){return _0x1b6d4d[_0x9283('0x25')](0xc8);}return _0x1b6d4d['download'](path[_0x9283('0x54')](config[_0x9283('0x55')],'server/files/reports',_0x393699['savename']),util['format'](_0x9283('0x59'),_0x393699[_0x9283('0x50')]||_0x393699[_0x9283('0x28')],_0x393699[_0x9283('0x52')][_0x9283('0x5a')]()));}})[_0x9283('0x43')](handleError(_0x1b6d4d,null));}; \ No newline at end of file +var _0xcca5=['filter','merge','options','includeAll','findAll','keys','include','find','catch','create','body','user','role','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','savename','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','format','basename','output','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','limit','count','offset','set','Content-Range','save','update','destroy','get','then','end','error','stack','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','order','sort','where','pick'];(function(_0x712393,_0x5ba83a){var _0xc2c9b9=function(_0x20ed98){while(--_0x20ed98){_0x712393['push'](_0x712393['shift']());}};_0xc2c9b9(++_0x5ba83a);}(_0xcca5,0x18d));var _0x5cca=function(_0x421c56,_0x4efd00){_0x421c56=_0x421c56-0x0;var _0x49b244=_0xcca5[_0x421c56];return _0x49b244;};'use strict';var emlformat=require(_0x5cca('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5cca('0x1'));var jsonpatch=require(_0x5cca('0x2'));var rp=require('request-promise');var moment=require(_0x5cca('0x3'));var BPromise=require(_0x5cca('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5cca('0x5'));var sox=require(_0x5cca('0x6'));var csv=require(_0x5cca('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5cca('0x8'));var _=require(_0x5cca('0x9'));var squel=require(_0x5cca('0xa'));var crypto=require(_0x5cca('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5cca('0xc'));var toCsv=require(_0x5cca('0x7'));var querystring=require(_0x5cca('0xd'));var Papa=require(_0x5cca('0xe'));var Redis=require(_0x5cca('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5cca('0x10'));var as=require(_0x5cca('0x11'));var hardwareService=require(_0x5cca('0x12'));var logger=require('../../config/logger')(_0x5cca('0x13'));var utils=require(_0x5cca('0x14'));var config=require(_0x5cca('0x15'));var licenseUtil=require(_0x5cca('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d55df,_0x3dab37){_0x3dab37=_0x3dab37||0xcc;return function(_0x55dd7c){if(_0x55dd7c){return _0x3d55df[_0x5cca('0x17')](_0x3dab37);}return _0x3d55df[_0x5cca('0x18')](_0x3dab37)['end']();};}function respondWithResult(_0x3bb3e8,_0x587d7c){_0x587d7c=_0x587d7c||0xc8;return function(_0x53ef7f){if(_0x53ef7f){return _0x3bb3e8[_0x5cca('0x18')](_0x587d7c)['json'](_0x53ef7f);}};}function respondWithFilteredResult(_0x4e34d6,_0x2e84a7){return function(_0x61a4fa){if(_0x61a4fa){var _0x547e97=typeof _0x2e84a7['offset']==='undefined'&&typeof _0x2e84a7[_0x5cca('0x19')]==='undefined';var _0x17b327=_0x61a4fa[_0x5cca('0x1a')];var _0x10621f=_0x547e97?0x0:_0x2e84a7[_0x5cca('0x1b')];var _0x2dd30e=_0x547e97?_0x61a4fa['count']:_0x2e84a7['offset']+_0x2e84a7[_0x5cca('0x19')];var _0x372fee;if(_0x2dd30e>=_0x17b327){_0x2dd30e=_0x17b327;_0x372fee=0xc8;}else{_0x372fee=0xce;}_0x4e34d6['status'](_0x372fee);return _0x4e34d6[_0x5cca('0x1c')](_0x5cca('0x1d'),_0x10621f+'-'+_0x2dd30e+'/'+_0x17b327)['json'](_0x61a4fa);}return null;};}function patchUpdates(_0x18000e){return function(_0x914c0a){try{jsonpatch['apply'](_0x914c0a,_0x18000e,!![]);}catch(_0x18915c){return BPromise['reject'](_0x18915c);}return _0x914c0a[_0x5cca('0x1e')]();};}function saveUpdates(_0x5c771d,_0x393a7f){return function(_0x1accd8){if(_0x1accd8){return _0x1accd8[_0x5cca('0x1f')](_0x5c771d)['then'](function(_0xbffbb6){return _0xbffbb6;});}return null;};}function removeEntity(_0xadf43f,_0x5525e6){return function(_0x54c003){if(_0x54c003){return _0x54c003[_0x5cca('0x20')]()['then'](function(){var _0xf42d96=_0x54c003[_0x5cca('0x21')]({'plain':!![]});var _0x287fdf='ExtractedReports';return db['UserProfileResource'][_0x5cca('0x20')]({'where':{'type':_0x287fdf,'resourceId':_0xf42d96['id']}})[_0x5cca('0x22')](function(){return _0x54c003;});})[_0x5cca('0x22')](function(){_0xadf43f[_0x5cca('0x18')](0xcc)[_0x5cca('0x23')]();});}};}function handleEntityNotFound(_0x45a349,_0xaa80c){return function(_0x45b077){if(!_0x45b077){_0x45a349[_0x5cca('0x17')](0x194);}return _0x45b077;};}function handleError(_0x171c83,_0x59c5a7){_0x59c5a7=_0x59c5a7||0x1f4;return function(_0x1a4e30){logger[_0x5cca('0x24')](_0x1a4e30[_0x5cca('0x25')]);if(_0x1a4e30[_0x5cca('0x26')]){delete _0x1a4e30[_0x5cca('0x26')];}_0x171c83[_0x5cca('0x18')](_0x59c5a7)[_0x5cca('0x27')](_0x1a4e30);};}exports[_0x5cca('0x28')]=function(_0xf68d9a,_0x52c4c7){var _0x21fcbe={},_0x59c5b9={},_0xd48cb={'count':0x0,'rows':[]};var _0x14fbb0=_['map'](db[_0x5cca('0x29')][_0x5cca('0x2a')],function(_0x5ed5f7){return{'name':_0x5ed5f7[_0x5cca('0x2b')],'type':_0x5ed5f7[_0x5cca('0x2c')][_0x5cca('0x2d')]};});_0x59c5b9[_0x5cca('0x2e')]=_[_0x5cca('0x2f')](_0x14fbb0,_0x5cca('0x26'));_0x59c5b9[_0x5cca('0x30')]=_['keys'](_0xf68d9a[_0x5cca('0x30')]);_0x59c5b9[_0x5cca('0x31')]=_[_0x5cca('0x32')](_0x59c5b9[_0x5cca('0x2e')],_0x59c5b9[_0x5cca('0x30')]);_0x21fcbe[_0x5cca('0x33')]=_[_0x5cca('0x32')](_0x59c5b9[_0x5cca('0x2e')],qs[_0x5cca('0x34')](_0xf68d9a[_0x5cca('0x30')][_0x5cca('0x34')]));_0x21fcbe[_0x5cca('0x33')]=_0x21fcbe['attributes'][_0x5cca('0x35')]?_0x21fcbe[_0x5cca('0x33')]:_0x59c5b9[_0x5cca('0x2e')];if(!_0xf68d9a[_0x5cca('0x30')]['hasOwnProperty']('nolimit')){_0x21fcbe[_0x5cca('0x19')]=qs[_0x5cca('0x19')](_0xf68d9a['query'][_0x5cca('0x19')]);_0x21fcbe[_0x5cca('0x1b')]=qs['offset'](_0xf68d9a[_0x5cca('0x30')]['offset']);}_0x21fcbe[_0x5cca('0x36')]=qs[_0x5cca('0x37')](_0xf68d9a[_0x5cca('0x30')][_0x5cca('0x37')]);_0x21fcbe[_0x5cca('0x38')]=qs[_0x5cca('0x31')](_[_0x5cca('0x39')](_0xf68d9a[_0x5cca('0x30')],_0x59c5b9[_0x5cca('0x31')]),_0x14fbb0);if(_0xf68d9a['query'][_0x5cca('0x3a')]){_0x21fcbe[_0x5cca('0x38')]=_['merge'](_0x21fcbe['where'],{'$or':_[_0x5cca('0x2f')](_0x14fbb0,function(_0x1cfe51){if(_0x1cfe51[_0x5cca('0x2c')]!=='VIRTUAL'){var _0x4764ec={};_0x4764ec[_0x1cfe51['name']]={'$like':'%'+_0xf68d9a['query'][_0x5cca('0x3a')]+'%'};return _0x4764ec;}})});}_0x21fcbe=_[_0x5cca('0x3b')]({},_0x21fcbe,_0xf68d9a[_0x5cca('0x3c')]);var _0x55519e={'where':_0x21fcbe['where']};return db[_0x5cca('0x29')][_0x5cca('0x1a')](_0x55519e)['then'](function(_0x27e4c9){_0xd48cb[_0x5cca('0x1a')]=_0x27e4c9;if(_0xf68d9a[_0x5cca('0x30')][_0x5cca('0x3d')]){_0x21fcbe['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x5cca('0x3e')](_0x21fcbe);})[_0x5cca('0x22')](function(_0x5b698b){_0xd48cb['rows']=_0x5b698b;return _0xd48cb;})['then'](respondWithFilteredResult(_0x52c4c7,_0x21fcbe))['catch'](handleError(_0x52c4c7,null));};exports['show']=function(_0x459cd1,_0x5139d4){var _0x2d6ab9={'raw':!![],'where':{'id':_0x459cd1['params']['id']}},_0x112c38={};_0x112c38['model']=_['keys'](db[_0x5cca('0x29')][_0x5cca('0x2a')]);_0x112c38[_0x5cca('0x30')]=_[_0x5cca('0x3f')](_0x459cd1[_0x5cca('0x30')]);_0x112c38[_0x5cca('0x31')]=_[_0x5cca('0x32')](_0x112c38[_0x5cca('0x2e')],_0x112c38['query']);_0x2d6ab9[_0x5cca('0x33')]=_[_0x5cca('0x32')](_0x112c38[_0x5cca('0x2e')],qs['fields'](_0x459cd1['query'][_0x5cca('0x34')]));_0x2d6ab9[_0x5cca('0x33')]=_0x2d6ab9[_0x5cca('0x33')][_0x5cca('0x35')]?_0x2d6ab9['attributes']:_0x112c38[_0x5cca('0x2e')];if(_0x459cd1[_0x5cca('0x30')][_0x5cca('0x3d')]){_0x2d6ab9[_0x5cca('0x40')]=[{'all':!![]}];}_0x2d6ab9=_[_0x5cca('0x3b')]({},_0x2d6ab9,_0x459cd1[_0x5cca('0x3c')]);return db[_0x5cca('0x29')][_0x5cca('0x41')](_0x2d6ab9)[_0x5cca('0x22')](handleEntityNotFound(_0x5139d4,null))[_0x5cca('0x22')](respondWithResult(_0x5139d4,null))[_0x5cca('0x42')](handleError(_0x5139d4,null));};exports[_0x5cca('0x43')]=function(_0x50ce66,_0x1fd7eb){return db['AnalyticExtractedReport']['create'](_0x50ce66[_0x5cca('0x44')],{})['then'](function(_0x2263a1){var _0x233b26=_0x50ce66[_0x5cca('0x45')][_0x5cca('0x21')]({'plain':!![]});if(!_0x233b26)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x233b26[_0x5cca('0x46')]===_0x5cca('0x45')){var _0x439dcc=_0x2263a1['get']({'plain':!![]});var _0x1636f9=_0x5cca('0x47');return db[_0x5cca('0x48')][_0x5cca('0x41')]({'where':{'name':_0x1636f9,'userProfileId':_0x233b26[_0x5cca('0x49')]},'raw':!![]})[_0x5cca('0x22')](function(_0x4b3709){if(_0x4b3709&&_0x4b3709[_0x5cca('0x4a')]===0x0){return db[_0x5cca('0x4b')][_0x5cca('0x43')]({'name':_0x439dcc['name'],'resourceId':_0x439dcc['id'],'type':_0x4b3709[_0x5cca('0x26')],'sectionId':_0x4b3709['id']},{})['then'](function(){return _0x2263a1;});}else{return _0x2263a1;}})['catch'](function(_0x4b8923){logger[_0x5cca('0x24')](_0x5cca('0x4c'),_0x4b8923);throw _0x4b8923;});}return _0x2263a1;})[_0x5cca('0x22')](respondWithResult(_0x1fd7eb,0xc9))[_0x5cca('0x42')](handleError(_0x1fd7eb,null));};exports['update']=function(_0x43e7bf,_0x587990){if(_0x43e7bf['body']['id']){delete _0x43e7bf[_0x5cca('0x44')]['id'];}return db[_0x5cca('0x29')][_0x5cca('0x41')]({'where':{'id':_0x43e7bf[_0x5cca('0x4d')]['id']}})[_0x5cca('0x22')](handleEntityNotFound(_0x587990,null))[_0x5cca('0x22')](saveUpdates(_0x43e7bf[_0x5cca('0x44')],null))[_0x5cca('0x22')](respondWithResult(_0x587990,null))['catch'](handleError(_0x587990,null));};exports[_0x5cca('0x20')]=function(_0x315ff0,_0x313d10){return db['AnalyticExtractedReport'][_0x5cca('0x41')]({'where':{'id':_0x315ff0[_0x5cca('0x4d')]['id']}})[_0x5cca('0x22')](handleEntityNotFound(_0x313d10,null))[_0x5cca('0x22')](removeEntity(_0x313d10,null))[_0x5cca('0x42')](handleError(_0x313d10,null));};exports['download']=function(_0x1ae74c,_0xc1dfb6,_0x2104d4){return db[_0x5cca('0x29')][_0x5cca('0x41')]({'where':{'id':_0x1ae74c['params']['id']},'attributes':['name','basename',_0x5cca('0x4e'),'output'],'raw':!![]})[_0x5cca('0x22')](handleEntityNotFound(_0xc1dfb6,null))[_0x5cca('0x22')](function(_0x480efc){if(_0x480efc){if(!fs[_0x5cca('0x4f')](path[_0x5cca('0x50')](config[_0x5cca('0x51')],_0x5cca('0x52'),_0x480efc[_0x5cca('0x4e')]))){throw new db[(_0x5cca('0x53'))][(_0x5cca('0x54'))](_0x5cca('0x55'));}if(_0x1ae74c[_0x5cca('0x30')][_0x5cca('0x56')]){return _0xc1dfb6[_0x5cca('0x17')](0xc8);}return _0xc1dfb6[_0x5cca('0x57')](path[_0x5cca('0x50')](config[_0x5cca('0x51')],_0x5cca('0x52'),_0x480efc[_0x5cca('0x4e')]),util[_0x5cca('0x58')]('%s.%s',_0x480efc[_0x5cca('0x59')]||_0x480efc['name'],_0x480efc[_0x5cca('0x5a')]['toLowerCase']()));}})[_0x5cca('0x42')](handleError(_0xc1dfb6,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 9df6db8..7498f63 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 _0x1c40=['request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','AnalyticExtractedReport','analytics_extracted_reports','../../config/logger','moment'];(function(_0x5c356a,_0x221fae){var _0x2bbd38=function(_0x27b95d){while(--_0x27b95d){_0x5c356a['push'](_0x5c356a['shift']());}};_0x2bbd38(++_0x221fae);}(_0x1c40,0xdf));var _0x01c4=function(_0x272638,_0x42b993){_0x272638=_0x272638-0x0;var _0x19d027=_0x1c40[_0x272638];return _0x19d027;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x01c4('0x0'))('api');var moment=require(_0x01c4('0x1'));var BPromise=require('bluebird');var rp=require(_0x01c4('0x2'));var fs=require('fs');var path=require(_0x01c4('0x3'));var rimraf=require(_0x01c4('0x4'));var config=require(_0x01c4('0x5'));var attributes=require(_0x01c4('0x6'));module['exports']=function(_0x56b401,_0x3a14fb){return _0x56b401['define'](_0x01c4('0x7'),attributes,{'tableName':_0x01c4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd3e=['util','api','request-promise','path','rimraf','./analyticExtractedReport.attributes','exports','analytics_extracted_reports','lodash'];(function(_0x5295c6,_0x226c81){var _0x9dcf96=function(_0x5272aa){while(--_0x5272aa){_0x5295c6['push'](_0x5295c6['shift']());}};_0x9dcf96(++_0x226c81);}(_0xdd3e,0xe9));var _0xedd3=function(_0x1ca903,_0x197849){_0x1ca903=_0x1ca903-0x0;var _0x25826f=_0xdd3e[_0x1ca903];return _0x25826f;};'use strict';var _=require(_0xedd3('0x0'));var util=require(_0xedd3('0x1'));var logger=require('../../config/logger')(_0xedd3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xedd3('0x3'));var fs=require('fs');var path=require(_0xedd3('0x4'));var rimraf=require(_0xedd3('0x5'));var config=require('../../config/environment');var attributes=require(_0xedd3('0x6'));module[_0xedd3('0x7')]=function(_0x5b2e39,_0x24b572){return _0x5b2e39['define']('AnalyticExtractedReport',attributes,{'tableName':_0xedd3('0x8'),'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 f8c68bc..291dc11 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 _0x8226=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x5752af,_0x3a3bff){var _0x116ad4=function(_0x875f75){while(--_0x875f75){_0x5752af['push'](_0x5752af['shift']());}};_0x116ad4(++_0x3a3bff);}(_0x8226,0xe7));var _0x6822=function(_0x25806f,_0x16dbdd){_0x25806f=_0x25806f-0x0;var _0x163f12=_0x8226[_0x25806f];return _0x163f12;};'use strict';var _=require(_0x6822('0x0'));var util=require('util');var moment=require(_0x6822('0x1'));var BPromise=require(_0x6822('0x2'));var rs=require(_0x6822('0x3'));var fs=require('fs');var Redis=require(_0x6822('0x4'));var db=require(_0x6822('0x5'))['db'];var utils=require(_0x6822('0x6'));var logger=require(_0x6822('0x7'))(_0x6822('0x8'));var config=require(_0x6822('0x9'));var jayson=require(_0x6822('0xa'));var client=jayson[_0x6822('0xb')][_0x6822('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x48dfd0,_0x2c7ea5,_0x4fbf59){return new BPromise(function(_0x56a7fe,_0x2c94cf){return client[_0x6822('0xd')](_0x48dfd0,_0x4fbf59)[_0x6822('0xe')](function(_0x28e7e9){logger[_0x6822('0xf')](_0x6822('0x10'),_0x2c7ea5,_0x6822('0x11'));logger[_0x6822('0x12')](_0x6822('0x13'),_0x2c7ea5,'request\x20sent',JSON[_0x6822('0x14')](_0x28e7e9));if(_0x28e7e9[_0x6822('0x15')]){if(_0x28e7e9[_0x6822('0x15')][_0x6822('0x16')]===0x1f4){logger['error'](_0x6822('0x10'),_0x2c7ea5,_0x28e7e9['error'][_0x6822('0x17')]);return _0x2c94cf(_0x28e7e9[_0x6822('0x15')][_0x6822('0x17')]);}logger[_0x6822('0x15')](_0x6822('0x10'),_0x2c7ea5,_0x28e7e9[_0x6822('0x15')][_0x6822('0x17')]);return _0x56a7fe(_0x28e7e9[_0x6822('0x15')][_0x6822('0x17')]);}else{logger[_0x6822('0xf')](_0x6822('0x10'),_0x2c7ea5,_0x6822('0x11'));_0x56a7fe(_0x28e7e9[_0x6822('0x18')][_0x6822('0x17')]);}})[_0x6822('0x19')](function(_0xb363a){logger[_0x6822('0x15')](_0x6822('0x10'),_0x2c7ea5,_0xb363a);_0x2c94cf(_0xb363a);});});} \ No newline at end of file +var _0xd654=['catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x280170,_0x211c74){var _0x3fc209=function(_0x35c2d8){while(--_0x35c2d8){_0x280170['push'](_0x280170['shift']());}};_0x3fc209(++_0x211c74);}(_0xd654,0x15a));var _0x4d65=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd654[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x4d65('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4d65('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4d65('0x2'));var db=require(_0x4d65('0x3'))['db'];var utils=require(_0x4d65('0x4'));var logger=require(_0x4d65('0x5'))(_0x4d65('0x6'));var config=require(_0x4d65('0x7'));var jayson=require(_0x4d65('0x8'));var client=jayson[_0x4d65('0x9')][_0x4d65('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c71cc,_0x4ad314,_0x20413e){return new BPromise(function(_0x333acd,_0x4b1e8b){return client[_0x4d65('0xb')](_0x4c71cc,_0x20413e)[_0x4d65('0xc')](function(_0x150de3){logger[_0x4d65('0xd')](_0x4d65('0xe'),_0x4ad314,_0x4d65('0xf'));logger[_0x4d65('0x10')](_0x4d65('0x11'),_0x4ad314,_0x4d65('0xf'),JSON[_0x4d65('0x12')](_0x150de3));if(_0x150de3[_0x4d65('0x13')]){if(_0x150de3[_0x4d65('0x13')][_0x4d65('0x14')]===0x1f4){logger[_0x4d65('0x13')](_0x4d65('0xe'),_0x4ad314,_0x150de3[_0x4d65('0x13')][_0x4d65('0x15')]);return _0x4b1e8b(_0x150de3[_0x4d65('0x13')][_0x4d65('0x15')]);}logger[_0x4d65('0x13')](_0x4d65('0xe'),_0x4ad314,_0x150de3[_0x4d65('0x13')]['message']);return _0x333acd(_0x150de3[_0x4d65('0x13')]['message']);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x4ad314,_0x4d65('0xf'));_0x333acd(_0x150de3['result']['message']);}})[_0x4d65('0x16')](function(_0x1da44c){logger[_0x4d65('0x13')](_0x4d65('0xe'),_0x4ad314,_0x1da44c);_0x4b1e8b(_0x1da44c);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 5838854..767b868 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 _0x951b=['../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x4f43ca,_0x551365){var _0x5229a4=function(_0x226d9c){while(--_0x226d9c){_0x4f43ca['push'](_0x4f43ca['shift']());}};_0x5229a4(++_0x551365);}(_0x951b,0xd5));var _0xb951=function(_0x15364c,_0x577f8c){_0x15364c=_0x15364c-0x0;var _0x4c958c=_0x951b[_0x15364c];return _0x4c958c;};'use strict';var multer=require(_0xb951('0x0'));var util=require(_0xb951('0x1'));var path=require(_0xb951('0x2'));var timeout=require(_0xb951('0x3'));var express=require(_0xb951('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb951('0x5'));var interaction=require(_0xb951('0x6'));var config=require(_0xb951('0x7'));var controller=require(_0xb951('0x8'));router[_0xb951('0x9')]('/',auth[_0xb951('0xa')](),controller[_0xb951('0xb')]);router[_0xb951('0x9')](_0xb951('0xc'),auth[_0xb951('0xa')](),controller[_0xb951('0xd')]);router[_0xb951('0x9')](_0xb951('0xe'),auth[_0xb951('0xa')](),controller[_0xb951('0xf')]);router[_0xb951('0x10')]('/',auth[_0xb951('0xa')](),controller[_0xb951('0x11')]);router['put'](_0xb951('0xc'),auth[_0xb951('0xa')](),controller[_0xb951('0x12')]);router[_0xb951('0x13')](_0xb951('0xc'),auth[_0xb951('0xa')](),controller[_0xb951('0x14')]);module[_0xb951('0x15')]=router; \ No newline at end of file +var _0x9a5d=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','download','create','/:id','update','delete'];(function(_0x3ee952,_0x565e0f){var _0xc0c8b1=function(_0x57e219){while(--_0x57e219){_0x3ee952['push'](_0x3ee952['shift']());}};_0xc0c8b1(++_0x565e0f);}(_0x9a5d,0x122));var _0xd9a5=function(_0x488ebb,_0x232137){_0x488ebb=_0x488ebb-0x0;var _0x1c1a33=_0x9a5d[_0x488ebb];return _0x1c1a33;};'use strict';var multer=require(_0xd9a5('0x0'));var util=require(_0xd9a5('0x1'));var path=require(_0xd9a5('0x2'));var timeout=require(_0xd9a5('0x3'));var express=require('express');var router=express[_0xd9a5('0x4')]();var fs_extra=require(_0xd9a5('0x5'));var auth=require(_0xd9a5('0x6'));var interaction=require(_0xd9a5('0x7'));var config=require(_0xd9a5('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0xd9a5('0x9')]('/',auth[_0xd9a5('0xa')](),controller['index']);router[_0xd9a5('0x9')]('/:id',auth[_0xd9a5('0xa')](),controller['show']);router[_0xd9a5('0x9')]('/:id/download',auth[_0xd9a5('0xa')](),controller[_0xd9a5('0xb')]);router['post']('/',auth[_0xd9a5('0xa')](),controller[_0xd9a5('0xc')]);router['put'](_0xd9a5('0xd'),auth[_0xd9a5('0xa')](),controller[_0xd9a5('0xe')]);router[_0xd9a5('0xf')]('/:id',auth[_0xd9a5('0xa')](),controller[_0xd9a5('0x10')]);module[_0xd9a5('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 7b253cc..b9057a1 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 _0xcb48=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x2c6050,_0x46173b){var _0x316164=function(_0x118fd1){while(--_0x118fd1){_0x2c6050['push'](_0x2c6050['shift']());}};_0x316164(++_0x46173b);}(_0xcb48,0xf1));var _0x8cb4=function(_0x15023b,_0x1d7e17){_0x15023b=_0x15023b-0x0;var _0x378857=_0xcb48[_0x15023b];return _0x378857;};'use strict';var Sequelize=require(_0x8cb4('0x0'));module[_0x8cb4('0x1')]={'field':{'type':Sequelize[_0x8cb4('0x2')]},'alias':{'type':Sequelize[_0x8cb4('0x3')]},'function':{'type':Sequelize[_0x8cb4('0x3')]},'format':{'type':Sequelize[_0x8cb4('0x3')]},'groupBy':{'type':Sequelize[_0x8cb4('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x8cb4('0x3')]},'custom':{'type':Sequelize[_0x8cb4('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x0da5=['sequelize','TEXT','STRING','BOOLEAN'];(function(_0x2806d5,_0x32d3bb){var _0x3b7418=function(_0xed4bd4){while(--_0xed4bd4){_0x2806d5['push'](_0x2806d5['shift']());}};_0x3b7418(++_0x32d3bb);}(_0x0da5,0xc4));var _0x50da=function(_0x35d564,_0x15f604){_0x35d564=_0x35d564-0x0;var _0x3c10d5=_0x0da5[_0x35d564];return _0x3c10d5;};'use strict';var Sequelize=require(_0x50da('0x0'));module['exports']={'field':{'type':Sequelize[_0x50da('0x1')]},'alias':{'type':Sequelize[_0x50da('0x2')]},'function':{'type':Sequelize[_0x50da('0x2')]},'format':{'type':Sequelize[_0x50da('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x50da('0x2')]},'custom':{'type':Sequelize[_0x50da('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 2c57ed0..8917c32 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 _0x5d58=['map','AnalyticFieldReport','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','filters','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','CustomReportId','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index'];(function(_0xb1c23f,_0x381cb2){var _0x373a11=function(_0x5a55d2){while(--_0x5a55d2){_0xb1c23f['push'](_0xb1c23f['shift']());}};_0x373a11(++_0x381cb2);}(_0x5d58,0x173));var _0x85d5=function(_0x27b293,_0xcfbc04){_0x27b293=_0x27b293-0x0;var _0x5e1e9b=_0x5d58[_0x27b293];return _0x5e1e9b;};'use strict';var emlformat=require(_0x85d5('0x0'));var rimraf=require(_0x85d5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x85d5('0x2'));var rp=require('request-promise');var moment=require(_0x85d5('0x3'));var BPromise=require(_0x85d5('0x4'));var Mustache=require(_0x85d5('0x5'));var util=require(_0x85d5('0x6'));var path=require(_0x85d5('0x7'));var sox=require(_0x85d5('0x8'));var csv=require(_0x85d5('0x9'));var ejs=require(_0x85d5('0xa'));var fs=require('fs');var fs_extra=require(_0x85d5('0xb'));var _=require(_0x85d5('0xc'));var squel=require(_0x85d5('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x85d5('0xe'));var toCsv=require(_0x85d5('0x9'));var querystring=require(_0x85d5('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x85d5('0x10'));var qs=require(_0x85d5('0x11'));var as=require(_0x85d5('0x12'));var hardwareService=require(_0x85d5('0x13'));var logger=require(_0x85d5('0x14'))(_0x85d5('0x15'));var utils=require(_0x85d5('0x16'));var config=require(_0x85d5('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x85d5('0x18'))['db'];function respondWithStatusCode(_0x5a13f4,_0x1197f8){_0x1197f8=_0x1197f8||0xcc;return function(_0x233d65){if(_0x233d65){return _0x5a13f4[_0x85d5('0x19')](_0x1197f8);}return _0x5a13f4[_0x85d5('0x1a')](_0x1197f8)[_0x85d5('0x1b')]();};}function respondWithResult(_0x9b2be3,_0x91fdd5){_0x91fdd5=_0x91fdd5||0xc8;return function(_0x1c5714){if(_0x1c5714){return _0x9b2be3[_0x85d5('0x1a')](_0x91fdd5)['json'](_0x1c5714);}};}function respondWithFilteredResult(_0x1c1551,_0x38103e){return function(_0x14df86){if(_0x14df86){var _0x549216=typeof _0x38103e[_0x85d5('0x1c')]===_0x85d5('0x1d')&&typeof _0x38103e[_0x85d5('0x1e')]===_0x85d5('0x1d');var _0x280b0d=_0x14df86[_0x85d5('0x1f')];var _0x9f8f21=_0x549216?0x0:_0x38103e[_0x85d5('0x1c')];var _0xf05a9d=_0x549216?_0x14df86[_0x85d5('0x1f')]:_0x38103e[_0x85d5('0x1c')]+_0x38103e[_0x85d5('0x1e')];var _0x537961;if(_0xf05a9d>=_0x280b0d){_0xf05a9d=_0x280b0d;_0x537961=0xc8;}else{_0x537961=0xce;}_0x1c1551[_0x85d5('0x1a')](_0x537961);return _0x1c1551['set'](_0x85d5('0x20'),_0x9f8f21+'-'+_0xf05a9d+'/'+_0x280b0d)[_0x85d5('0x21')](_0x14df86);}return null;};}function patchUpdates(_0x4e63ff){return function(_0x115aef){try{jsonpatch[_0x85d5('0x22')](_0x115aef,_0x4e63ff,!![]);}catch(_0x216943){return BPromise[_0x85d5('0x23')](_0x216943);}return _0x115aef[_0x85d5('0x24')]();};}function saveUpdates(_0x23ad05,_0x2bb8d6){return function(_0x596dfe){if(_0x596dfe){return _0x596dfe['update'](_0x23ad05)[_0x85d5('0x25')](function(_0x359f42){return _0x359f42;});}return null;};}function removeEntity(_0x328afa,_0x5d800f){return function(_0x562a30){if(_0x562a30){return _0x562a30[_0x85d5('0x26')]()[_0x85d5('0x25')](function(){_0x328afa[_0x85d5('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37a820,_0x5cac2c){return function(_0x5c5448){if(!_0x5c5448){_0x37a820[_0x85d5('0x19')](0x194);}return _0x5c5448;};}function handleError(_0x1de68d,_0x4a9c6f){_0x4a9c6f=_0x4a9c6f||0x1f4;return function(_0x4043ef){logger[_0x85d5('0x27')](_0x4043ef[_0x85d5('0x28')]);if(_0x4043ef[_0x85d5('0x29')]){delete _0x4043ef['name'];}_0x1de68d['status'](_0x4a9c6f)[_0x85d5('0x2a')](_0x4043ef);};}exports[_0x85d5('0x2b')]=function(_0x2e336e,_0x1c0282){var _0xb6aa40={},_0x57f66d={},_0x22013c={'count':0x0,'rows':[]};var _0x51de70=_[_0x85d5('0x2c')](db[_0x85d5('0x2d')][_0x85d5('0x2e')],function(_0x50521a){return{'name':_0x50521a['fieldName'],'type':_0x50521a[_0x85d5('0x2f')][_0x85d5('0x30')]};});_0x57f66d[_0x85d5('0x31')]=_[_0x85d5('0x2c')](_0x51de70,_0x85d5('0x29'));_0x57f66d[_0x85d5('0x32')]=_['keys'](_0x2e336e['query']);_0x57f66d['filters']=_[_0x85d5('0x33')](_0x57f66d[_0x85d5('0x31')],_0x57f66d[_0x85d5('0x32')]);_0xb6aa40[_0x85d5('0x34')]=_[_0x85d5('0x33')](_0x57f66d[_0x85d5('0x31')],qs['fields'](_0x2e336e[_0x85d5('0x32')][_0x85d5('0x35')]));_0xb6aa40['attributes']=_0xb6aa40[_0x85d5('0x34')][_0x85d5('0x36')]?_0xb6aa40[_0x85d5('0x34')]:_0x57f66d['model'];if(!_0x2e336e[_0x85d5('0x32')][_0x85d5('0x37')](_0x85d5('0x38'))){_0xb6aa40['limit']=qs[_0x85d5('0x1e')](_0x2e336e[_0x85d5('0x32')][_0x85d5('0x1e')]);_0xb6aa40[_0x85d5('0x1c')]=qs[_0x85d5('0x1c')](_0x2e336e[_0x85d5('0x32')][_0x85d5('0x1c')]);}_0xb6aa40['order']=qs[_0x85d5('0x39')](_0x2e336e[_0x85d5('0x32')][_0x85d5('0x39')]);_0xb6aa40[_0x85d5('0x3a')]=qs['filters'](_[_0x85d5('0x3b')](_0x2e336e['query'],_0x57f66d['filters']),_0x51de70);if(_0x2e336e['query'][_0x85d5('0x3c')]){_0xb6aa40['where']=_[_0x85d5('0x3d')](_0xb6aa40['where'],{'$or':_[_0x85d5('0x2c')](_0x51de70,function(_0x131b22){if(_0x131b22[_0x85d5('0x2f')]!==_0x85d5('0x3e')){var _0x77a995={};_0x77a995[_0x131b22[_0x85d5('0x29')]]={'$like':'%'+_0x2e336e[_0x85d5('0x32')][_0x85d5('0x3c')]+'%'};return _0x77a995;}})});}_0xb6aa40=_[_0x85d5('0x3d')]({},_0xb6aa40,_0x2e336e[_0x85d5('0x3f')]);var _0x1f5014={'where':_0xb6aa40[_0x85d5('0x3a')]};return db[_0x85d5('0x2d')][_0x85d5('0x1f')](_0x1f5014)[_0x85d5('0x25')](function(_0x3bc8ee){_0x22013c[_0x85d5('0x1f')]=_0x3bc8ee;if(_0x2e336e[_0x85d5('0x32')][_0x85d5('0x40')]){_0xb6aa40[_0x85d5('0x41')]=[{'all':!![]}];}return db[_0x85d5('0x2d')][_0x85d5('0x42')](_0xb6aa40);})[_0x85d5('0x25')](function(_0x10603f){_0x22013c[_0x85d5('0x43')]=_0x10603f;return _0x22013c;})[_0x85d5('0x25')](respondWithFilteredResult(_0x1c0282,_0xb6aa40))[_0x85d5('0x44')](handleError(_0x1c0282,null));};exports[_0x85d5('0x45')]=function(_0x4b49fc,_0x32ae77){var _0x45c66c={'raw':![],'where':{'id':_0x4b49fc[_0x85d5('0x46')]['id']}},_0x1f8e7a={};_0x1f8e7a['model']=_[_0x85d5('0x47')](db[_0x85d5('0x2d')]['rawAttributes']);_0x1f8e7a['query']=_[_0x85d5('0x47')](_0x4b49fc[_0x85d5('0x32')]);_0x1f8e7a[_0x85d5('0x48')]=_[_0x85d5('0x33')](_0x1f8e7a['model'],_0x1f8e7a[_0x85d5('0x32')]);_0x45c66c[_0x85d5('0x34')]=_[_0x85d5('0x33')](_0x1f8e7a[_0x85d5('0x31')],qs[_0x85d5('0x35')](_0x4b49fc[_0x85d5('0x32')]['fields']));_0x45c66c[_0x85d5('0x34')]=_0x45c66c[_0x85d5('0x34')][_0x85d5('0x36')]?_0x45c66c['attributes']:_0x1f8e7a[_0x85d5('0x31')];if(_0x4b49fc[_0x85d5('0x32')][_0x85d5('0x40')]){_0x45c66c[_0x85d5('0x41')]=[{'all':!![]}];}_0x45c66c=_['merge']({},_0x45c66c,_0x4b49fc[_0x85d5('0x3f')]);return db['AnalyticFieldReport'][_0x85d5('0x49')](_0x45c66c)[_0x85d5('0x25')](handleEntityNotFound(_0x32ae77,null))['then'](respondWithResult(_0x32ae77,null))['catch'](handleError(_0x32ae77,null));};exports[_0x85d5('0x4a')]=function(_0x4fd88c,_0x386cfa){return db[_0x85d5('0x2d')][_0x85d5('0x4a')](_0x4fd88c[_0x85d5('0x4b')],{})['then'](respondWithResult(_0x386cfa,0xc9))[_0x85d5('0x44')](handleError(_0x386cfa,null));};exports[_0x85d5('0x4c')]=function(_0xc85187,_0x7fc35c){return db['AnalyticFieldReport'][_0x85d5('0x4c')](_0xc85187['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x7fc35c,0xc9))['catch'](handleError(_0x7fc35c,null));};exports['update']=function(_0x42d7df,_0x394e43){if(_0x42d7df[_0x85d5('0x4b')]['id']){delete _0x42d7df[_0x85d5('0x4b')]['id'];}return db[_0x85d5('0x2d')][_0x85d5('0x49')]({'where':{'id':_0x42d7df['params']['id']}})['then'](handleEntityNotFound(_0x394e43,null))['then'](saveUpdates(_0x42d7df[_0x85d5('0x4b')],null))[_0x85d5('0x25')](respondWithResult(_0x394e43,null))['catch'](handleError(_0x394e43,null));};exports[_0x85d5('0x26')]=function(_0x284e32,_0x14ff82){return db[_0x85d5('0x2d')]['find']({'where':{'id':_0x284e32[_0x85d5('0x46')]['id']}})['then'](handleEntityNotFound(_0x14ff82,null))[_0x85d5('0x25')](removeEntity(_0x14ff82,null))[_0x85d5('0x44')](handleError(_0x14ff82,null));};exports[_0x85d5('0x4d')]=function(_0x5b74d8,_0x58a535){return db[_0x85d5('0x2d')]['destroy']({'where':{'id':_0x5b74d8[_0x85d5('0x32')][_0x85d5('0x4e')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x58a535,0xcc))['catch'](handleError(_0x58a535,null));};exports[_0x85d5('0x4f')]=function(_0x4ba3c9,_0x505af7,_0xa80032){return db[_0x85d5('0x50')][_0x85d5('0x51')]({'where':{'id':_0x4ba3c9[_0x85d5('0x46')]['id']}})[_0x85d5('0x25')](handleEntityNotFound(_0x505af7,null))['then'](function(_0x51372d){if(_0x51372d){return db['sequelize']['transaction'](function(_0x1ff31b){return db[_0x85d5('0x2d')]['destroy']({'where':{'CustomReportId':_0x4ba3c9[_0x85d5('0x46')]['id']},'transaction':_0x1ff31b})['then'](function(_0x3ed3dd){var _0x5386bb=_[_0x85d5('0x2c')](_0x4ba3c9[_0x85d5('0x4b')],function(_0x58d6bb){delete _0x58d6bb['id'];_0x58d6bb[_0x85d5('0x52')]=_0x4ba3c9[_0x85d5('0x46')]['id'];return _0x58d6bb;});return db[_0x85d5('0x2d')][_0x85d5('0x4c')](_0x5386bb,{'transaction':_0x1ff31b});});})['then'](function(){return db['AnalyticFieldReport'][_0x85d5('0x42')]({'where':{'CustomReportId':_0x4ba3c9[_0x85d5('0x46')]['id']}});});}})[_0x85d5('0x25')](respondWithResult(_0x505af7,null))[_0x85d5('0x44')](handleError(_0x505af7,null));}; \ No newline at end of file +var _0x7758=['to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','type','model','keys','query','filters','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','options','includeAll','include','AnalyticFieldReport','findAll','params','intersection','merge','find','catch','create','bulkCreate','body','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox'];(function(_0x4d6ba0,_0x533048){var _0x34b9c2=function(_0x237641){while(--_0x237641){_0x4d6ba0['push'](_0x4d6ba0['shift']());}};_0x34b9c2(++_0x533048);}(_0x7758,0x186));var _0x8775=function(_0x20c0f3,_0x102e80){_0x20c0f3=_0x20c0f3-0x0;var _0x44da4c=_0x7758[_0x20c0f3];return _0x44da4c;};'use strict';var emlformat=require(_0x8775('0x0'));var rimraf=require(_0x8775('0x1'));var zipdir=require(_0x8775('0x2'));var jsonpatch=require(_0x8775('0x3'));var rp=require(_0x8775('0x4'));var moment=require(_0x8775('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8775('0x6'));var util=require(_0x8775('0x7'));var path=require(_0x8775('0x8'));var sox=require(_0x8775('0x9'));var csv=require(_0x8775('0xa'));var ejs=require(_0x8775('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8775('0xc'));var squel=require(_0x8775('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8775('0xe'));var toCsv=require(_0x8775('0xa'));var querystring=require(_0x8775('0xf'));var Papa=require(_0x8775('0x10'));var Redis=require(_0x8775('0x11'));var authService=require(_0x8775('0x12'));var qs=require(_0x8775('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8775('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x8775('0x15'));var licenseUtil=require(_0x8775('0x16'));var db=require(_0x8775('0x17'))['db'];function respondWithStatusCode(_0x4137f8,_0x421290){_0x421290=_0x421290||0xcc;return function(_0x40d95e){if(_0x40d95e){return _0x4137f8[_0x8775('0x18')](_0x421290);}return _0x4137f8['status'](_0x421290)[_0x8775('0x19')]();};}function respondWithResult(_0x18be74,_0x2d9dd1){_0x2d9dd1=_0x2d9dd1||0xc8;return function(_0x49e1a9){if(_0x49e1a9){return _0x18be74[_0x8775('0x1a')](_0x2d9dd1)['json'](_0x49e1a9);}};}function respondWithFilteredResult(_0xecd658,_0x354a7){return function(_0x283232){if(_0x283232){var _0x1be825=typeof _0x354a7[_0x8775('0x1b')]===_0x8775('0x1c')&&typeof _0x354a7['limit']===_0x8775('0x1c');var _0x4da989=_0x283232[_0x8775('0x1d')];var _0x3daa9b=_0x1be825?0x0:_0x354a7[_0x8775('0x1b')];var _0x1a2b54=_0x1be825?_0x283232[_0x8775('0x1d')]:_0x354a7[_0x8775('0x1b')]+_0x354a7['limit'];var _0x5cb104;if(_0x1a2b54>=_0x4da989){_0x1a2b54=_0x4da989;_0x5cb104=0xc8;}else{_0x5cb104=0xce;}_0xecd658[_0x8775('0x1a')](_0x5cb104);return _0xecd658['set'](_0x8775('0x1e'),_0x3daa9b+'-'+_0x1a2b54+'/'+_0x4da989)[_0x8775('0x1f')](_0x283232);}return null;};}function patchUpdates(_0xf16add){return function(_0x4284c9){try{jsonpatch[_0x8775('0x20')](_0x4284c9,_0xf16add,!![]);}catch(_0x4a1560){return BPromise[_0x8775('0x21')](_0x4a1560);}return _0x4284c9[_0x8775('0x22')]();};}function saveUpdates(_0x1af5f9,_0x4d9a64){return function(_0x471963){if(_0x471963){return _0x471963[_0x8775('0x23')](_0x1af5f9)['then'](function(_0x3a2302){return _0x3a2302;});}return null;};}function removeEntity(_0x54715e,_0x4bf51e){return function(_0x9c76cd){if(_0x9c76cd){return _0x9c76cd[_0x8775('0x24')]()[_0x8775('0x25')](function(){_0x54715e[_0x8775('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x526e6b,_0x1a04ce){return function(_0x2c0d9e){if(!_0x2c0d9e){_0x526e6b[_0x8775('0x18')](0x194);}return _0x2c0d9e;};}function handleError(_0xb94a37,_0x15c566){_0x15c566=_0x15c566||0x1f4;return function(_0xed8b5f){logger[_0x8775('0x26')](_0xed8b5f[_0x8775('0x27')]);if(_0xed8b5f[_0x8775('0x28')]){delete _0xed8b5f[_0x8775('0x28')];}_0xb94a37[_0x8775('0x1a')](_0x15c566)[_0x8775('0x29')](_0xed8b5f);};}exports[_0x8775('0x2a')]=function(_0x3dacdd,_0x1b1ab7){var _0x40005c={},_0x51a12c={},_0x22996f={'count':0x0,'rows':[]};var _0x239267=_[_0x8775('0x2b')](db['AnalyticFieldReport'][_0x8775('0x2c')],function(_0xd890f8){return{'name':_0xd890f8['fieldName'],'type':_0xd890f8[_0x8775('0x2d')]['key']};});_0x51a12c[_0x8775('0x2e')]=_[_0x8775('0x2b')](_0x239267,_0x8775('0x28'));_0x51a12c['query']=_[_0x8775('0x2f')](_0x3dacdd[_0x8775('0x30')]);_0x51a12c[_0x8775('0x31')]=_['intersection'](_0x51a12c[_0x8775('0x2e')],_0x51a12c[_0x8775('0x30')]);_0x40005c[_0x8775('0x32')]=_['intersection'](_0x51a12c[_0x8775('0x2e')],qs['fields'](_0x3dacdd[_0x8775('0x30')][_0x8775('0x33')]));_0x40005c[_0x8775('0x32')]=_0x40005c[_0x8775('0x32')][_0x8775('0x34')]?_0x40005c[_0x8775('0x32')]:_0x51a12c[_0x8775('0x2e')];if(!_0x3dacdd[_0x8775('0x30')][_0x8775('0x35')]('nolimit')){_0x40005c[_0x8775('0x36')]=qs[_0x8775('0x36')](_0x3dacdd[_0x8775('0x30')][_0x8775('0x36')]);_0x40005c[_0x8775('0x1b')]=qs['offset'](_0x3dacdd[_0x8775('0x30')]['offset']);}_0x40005c[_0x8775('0x37')]=qs[_0x8775('0x38')](_0x3dacdd[_0x8775('0x30')]['sort']);_0x40005c[_0x8775('0x39')]=qs[_0x8775('0x31')](_[_0x8775('0x3a')](_0x3dacdd['query'],_0x51a12c[_0x8775('0x31')]),_0x239267);if(_0x3dacdd['query'][_0x8775('0x3b')]){_0x40005c[_0x8775('0x39')]=_['merge'](_0x40005c[_0x8775('0x39')],{'$or':_['map'](_0x239267,function(_0x1c8854){if(_0x1c8854['type']!=='VIRTUAL'){var _0x56031f={};_0x56031f[_0x1c8854[_0x8775('0x28')]]={'$like':'%'+_0x3dacdd['query'][_0x8775('0x3b')]+'%'};return _0x56031f;}})});}_0x40005c=_['merge']({},_0x40005c,_0x3dacdd[_0x8775('0x3c')]);var _0x1f1072={'where':_0x40005c[_0x8775('0x39')]};return db['AnalyticFieldReport'][_0x8775('0x1d')](_0x1f1072)[_0x8775('0x25')](function(_0x574d1c){_0x22996f[_0x8775('0x1d')]=_0x574d1c;if(_0x3dacdd[_0x8775('0x30')][_0x8775('0x3d')]){_0x40005c[_0x8775('0x3e')]=[{'all':!![]}];}return db[_0x8775('0x3f')][_0x8775('0x40')](_0x40005c);})[_0x8775('0x25')](function(_0x135413){_0x22996f['rows']=_0x135413;return _0x22996f;})['then'](respondWithFilteredResult(_0x1b1ab7,_0x40005c))['catch'](handleError(_0x1b1ab7,null));};exports['show']=function(_0x46d303,_0x42249c){var _0x561b6b={'raw':![],'where':{'id':_0x46d303[_0x8775('0x41')]['id']}},_0x5cd9a1={};_0x5cd9a1[_0x8775('0x2e')]=_['keys'](db['AnalyticFieldReport'][_0x8775('0x2c')]);_0x5cd9a1[_0x8775('0x30')]=_[_0x8775('0x2f')](_0x46d303['query']);_0x5cd9a1['filters']=_['intersection'](_0x5cd9a1[_0x8775('0x2e')],_0x5cd9a1[_0x8775('0x30')]);_0x561b6b[_0x8775('0x32')]=_[_0x8775('0x42')](_0x5cd9a1[_0x8775('0x2e')],qs['fields'](_0x46d303[_0x8775('0x30')][_0x8775('0x33')]));_0x561b6b[_0x8775('0x32')]=_0x561b6b['attributes'][_0x8775('0x34')]?_0x561b6b[_0x8775('0x32')]:_0x5cd9a1[_0x8775('0x2e')];if(_0x46d303[_0x8775('0x30')]['includeAll']){_0x561b6b[_0x8775('0x3e')]=[{'all':!![]}];}_0x561b6b=_[_0x8775('0x43')]({},_0x561b6b,_0x46d303[_0x8775('0x3c')]);return db[_0x8775('0x3f')][_0x8775('0x44')](_0x561b6b)[_0x8775('0x25')](handleEntityNotFound(_0x42249c,null))[_0x8775('0x25')](respondWithResult(_0x42249c,null))[_0x8775('0x45')](handleError(_0x42249c,null));};exports[_0x8775('0x46')]=function(_0x20fe26,_0x22d535){return db['AnalyticFieldReport'][_0x8775('0x46')](_0x20fe26['body'],{})[_0x8775('0x25')](respondWithResult(_0x22d535,0xc9))[_0x8775('0x45')](handleError(_0x22d535,null));};exports[_0x8775('0x47')]=function(_0x187965,_0x300289){return db[_0x8775('0x3f')][_0x8775('0x47')](_0x187965[_0x8775('0x48')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x300289,0xc9))[_0x8775('0x45')](handleError(_0x300289,null));};exports['update']=function(_0x2f4bf3,_0xc1e771){if(_0x2f4bf3[_0x8775('0x48')]['id']){delete _0x2f4bf3[_0x8775('0x48')]['id'];}return db[_0x8775('0x3f')][_0x8775('0x44')]({'where':{'id':_0x2f4bf3[_0x8775('0x41')]['id']}})['then'](handleEntityNotFound(_0xc1e771,null))[_0x8775('0x25')](saveUpdates(_0x2f4bf3['body'],null))[_0x8775('0x25')](respondWithResult(_0xc1e771,null))['catch'](handleError(_0xc1e771,null));};exports[_0x8775('0x24')]=function(_0x50f091,_0x2bb135){return db['AnalyticFieldReport'][_0x8775('0x44')]({'where':{'id':_0x50f091[_0x8775('0x41')]['id']}})[_0x8775('0x25')](handleEntityNotFound(_0x2bb135,null))[_0x8775('0x25')](removeEntity(_0x2bb135,null))['catch'](handleError(_0x2bb135,null));};exports[_0x8775('0x49')]=function(_0x2b3b15,_0x3a3ace){return db[_0x8775('0x3f')][_0x8775('0x24')]({'where':{'id':_0x2b3b15[_0x8775('0x30')][_0x8775('0x4a')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3a3ace,0xcc))[_0x8775('0x45')](handleError(_0x3a3ace,null));};exports[_0x8775('0x4b')]=function(_0x28bf82,_0x310315,_0x45966d){return db[_0x8775('0x4c')][_0x8775('0x4d')]({'where':{'id':_0x28bf82[_0x8775('0x41')]['id']}})[_0x8775('0x25')](handleEntityNotFound(_0x310315,null))[_0x8775('0x25')](function(_0x4a2765){if(_0x4a2765){return db['sequelize'][_0x8775('0x4e')](function(_0x194dfa){return db[_0x8775('0x3f')][_0x8775('0x24')]({'where':{'CustomReportId':_0x28bf82[_0x8775('0x41')]['id']},'transaction':_0x194dfa})[_0x8775('0x25')](function(_0x479ceb){var _0x206c64=_[_0x8775('0x2b')](_0x28bf82['body'],function(_0x33957d){delete _0x33957d['id'];_0x33957d[_0x8775('0x4f')]=_0x28bf82[_0x8775('0x41')]['id'];return _0x33957d;});return db[_0x8775('0x3f')]['bulkCreate'](_0x206c64,{'transaction':_0x194dfa});});})['then'](function(){return db[_0x8775('0x3f')]['findAll']({'where':{'CustomReportId':_0x28bf82[_0x8775('0x41')]['id']}});});}})['then'](respondWithResult(_0x310315,null))[_0x8775('0x45')](handleError(_0x310315,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 7ad478e..d581921 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 _0x03b0=['rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x03b0,0x1c2));var _0x003b=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x03b0[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x003b('0x0'));var util=require(_0x003b('0x1'));var logger=require(_0x003b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x003b('0x3'));var rp=require(_0x003b('0x4'));var fs=require('fs');var path=require(_0x003b('0x5'));var rimraf=require(_0x003b('0x6'));var config=require(_0x003b('0x7'));var attributes=require(_0x003b('0x8'));module[_0x003b('0x9')]=function(_0x492873,_0xd6d2d9){return _0x492873['define'](_0x003b('0xa'),attributes,{'tableName':_0x003b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2550=['define','AnalyticFieldReport','analytics_report_fields','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0x1d3707,_0x20f724){var _0x3f8c7a=function(_0x509397){while(--_0x509397){_0x1d3707['push'](_0x1d3707['shift']());}};_0x3f8c7a(++_0x20f724);}(_0x2550,0x114));var _0x0255=function(_0x6a05c4,_0x20eb0e){_0x6a05c4=_0x6a05c4-0x0;var _0x77b7c7=_0x2550[_0x6a05c4];return _0x77b7c7;};'use strict';var _=require(_0x0255('0x0'));var util=require(_0x0255('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0255('0x2'));var BPromise=require(_0x0255('0x3'));var rp=require(_0x0255('0x4'));var fs=require('fs');var path=require(_0x0255('0x5'));var rimraf=require(_0x0255('0x6'));var config=require(_0x0255('0x7'));var attributes=require(_0x0255('0x8'));module[_0x0255('0x9')]=function(_0x347545,_0x458638){return _0x347545[_0x0255('0xa')](_0x0255('0xb'),attributes,{'tableName':_0x0255('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 470be68..bb30a79 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 _0x8cd4=['info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x8cd4,0x98));var _0x48cd=function(_0x4ed2c1,_0x8c9475){_0x4ed2c1=_0x4ed2c1-0x0;var _0x397295=_0x8cd4[_0x4ed2c1];return _0x397295;};'use strict';var _=require(_0x48cd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x48cd('0x1'));var rs=require(_0x48cd('0x2'));var fs=require('fs');var Redis=require(_0x48cd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x48cd('0x4'));var logger=require(_0x48cd('0x5'))('rpc');var config=require(_0x48cd('0x6'));var jayson=require(_0x48cd('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x40722e,_0x155d91,_0x261940){return new BPromise(function(_0x1fd37e,_0x13e22e){return client[_0x48cd('0x8')](_0x40722e,_0x261940)[_0x48cd('0x9')](function(_0x179b68){logger[_0x48cd('0xa')](_0x48cd('0xb'),_0x155d91,_0x48cd('0xc'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x155d91,_0x48cd('0xc'),JSON[_0x48cd('0xd')](_0x179b68));if(_0x179b68[_0x48cd('0xe')]){if(_0x179b68[_0x48cd('0xe')]['code']===0x1f4){logger[_0x48cd('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x155d91,_0x179b68[_0x48cd('0xe')][_0x48cd('0xf')]);return _0x13e22e(_0x179b68[_0x48cd('0xe')][_0x48cd('0xf')]);}logger['error'](_0x48cd('0xb'),_0x155d91,_0x179b68[_0x48cd('0xe')][_0x48cd('0xf')]);return _0x1fd37e(_0x179b68[_0x48cd('0xe')][_0x48cd('0xf')]);}else{logger[_0x48cd('0xa')]('AnalyticFieldReport,\x20%s,\x20%s',_0x155d91,_0x48cd('0xc'));_0x1fd37e(_0x179b68[_0x48cd('0x10')][_0x48cd('0xf')]);}})[_0x48cd('0x11')](function(_0x2dfc70){logger[_0x48cd('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x155d91,_0x2dfc70);_0x13e22e(_0x2dfc70);});});} \ No newline at end of file +var _0x523f=['request\x20sent','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x523f,0x137));var _0xf523=function(_0x4011a4,_0xee3fdb){_0x4011a4=_0x4011a4-0x0;var _0xc1a536=_0x523f[_0x4011a4];return _0xc1a536;};'use strict';var _=require(_0xf523('0x0'));var util=require(_0xf523('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf523('0x2'));var fs=require('fs');var Redis=require(_0xf523('0x3'));var db=require(_0xf523('0x4'))['db'];var utils=require(_0xf523('0x5'));var logger=require(_0xf523('0x6'))(_0xf523('0x7'));var config=require(_0xf523('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf523('0x9')][_0xf523('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x144a81,_0x5a958a,_0x4fa545){return new BPromise(function(_0x317b2d,_0x5aea22){return client['request'](_0x144a81,_0x4fa545)['then'](function(_0x16ff82){logger[_0xf523('0xb')](_0xf523('0xc'),_0x5a958a,'request\x20sent');logger[_0xf523('0xd')](_0xf523('0xe'),_0x5a958a,'request\x20sent',JSON[_0xf523('0xf')](_0x16ff82));if(_0x16ff82[_0xf523('0x10')]){if(_0x16ff82[_0xf523('0x10')][_0xf523('0x11')]===0x1f4){logger[_0xf523('0x10')](_0xf523('0xc'),_0x5a958a,_0x16ff82['error'][_0xf523('0x12')]);return _0x5aea22(_0x16ff82[_0xf523('0x10')][_0xf523('0x12')]);}logger[_0xf523('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5a958a,_0x16ff82[_0xf523('0x10')][_0xf523('0x12')]);return _0x317b2d(_0x16ff82[_0xf523('0x10')][_0xf523('0x12')]);}else{logger[_0xf523('0xb')](_0xf523('0xc'),_0x5a958a,_0xf523('0x13'));_0x317b2d(_0x16ff82[_0xf523('0x14')][_0xf523('0x12')]);}})[_0xf523('0x15')](function(_0x98c767){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x5a958a,_0x98c767);_0x5aea22(_0x98c767);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 946aa79..95abb3f 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(_0x217211,_0x4401d1){var _0x3ec896=function(_0x3b4d52){while(--_0x3b4d52){_0x217211['push'](_0x217211['shift']());}};_0x3ec896(++_0x4401d1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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(_0x2248c4,_0x2f73be){var _0x573531=function(_0x2de380){while(--_0x2de380){_0x2248c4['push'](_0x2248c4['shift']());}};_0x573531(++_0x2f73be);}(_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('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 da6985a..060997c 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 _0x7497=['STRING','sequelize','exports'];(function(_0x13e7be,_0x39db7a){var _0x5d0c5e=function(_0x47793e){while(--_0x47793e){_0x13e7be['push'](_0x13e7be['shift']());}};_0x5d0c5e(++_0x39db7a);}(_0x7497,0xd0));var _0x7749=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7497[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7749('0x0'));module[_0x7749('0x1')]={'name':{'type':Sequelize[_0x7749('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x7749('0x2')]}}; \ No newline at end of file +var _0xe812=['exports','STRING','TEXT'];(function(_0x23fd49,_0x433b7d){var _0x2b4d27=function(_0x4cb858){while(--_0x4cb858){_0x23fd49['push'](_0x23fd49['shift']());}};_0x2b4d27(++_0x433b7d);}(_0xe812,0x1f2));var _0x2e81=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe812[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0x2e81('0x0')]={'name':{'type':Sequelize[_0x2e81('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x2e81('0x2')]},'description':{'type':Sequelize[_0x2e81('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index a39e4b7..fd85665 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 _0xdbf5=['../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','get','Metrics','UserProfileResource','end','error','name','send','index','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','AnalyticMetric','includeAll','include','findAll','rows','catch','show','keys','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x1185fa,_0x12f4a1){var _0xa6dcf6=function(_0x351edb){while(--_0x351edb){_0x1185fa['push'](_0x1185fa['shift']());}};_0xa6dcf6(++_0x12f4a1);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x35de4b,_0x1fbfb1){_0x35de4b=_0x35de4b-0x0;var _0x2e9260=_0xdbf5[_0x35de4b];return _0x2e9260;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x182cec,_0x2bb7ed){_0x2bb7ed=_0x2bb7ed||0xcc;return function(_0x1453a9){if(_0x1453a9){return _0x182cec[_0x5dbf('0x16')](_0x2bb7ed);}return _0x182cec[_0x5dbf('0x17')](_0x2bb7ed)['end']();};}function respondWithResult(_0x4803ca,_0x2b4e1c){_0x2b4e1c=_0x2b4e1c||0xc8;return function(_0x3480c8){if(_0x3480c8){return _0x4803ca['status'](_0x2b4e1c)[_0x5dbf('0x18')](_0x3480c8);}};}function respondWithFilteredResult(_0x248e3c,_0x23f763){return function(_0x2dfa44){if(_0x2dfa44){var _0x181816=typeof _0x23f763[_0x5dbf('0x19')]===_0x5dbf('0x1a')&&typeof _0x23f763['limit']==='undefined';var _0x16dc82=_0x2dfa44[_0x5dbf('0x1b')];var _0x39c7aa=_0x181816?0x0:_0x23f763[_0x5dbf('0x19')];var _0x20c2b0=_0x181816?_0x2dfa44['count']:_0x23f763[_0x5dbf('0x19')]+_0x23f763['limit'];var _0x565efa;if(_0x20c2b0>=_0x16dc82){_0x20c2b0=_0x16dc82;_0x565efa=0xc8;}else{_0x565efa=0xce;}_0x248e3c['status'](_0x565efa);return _0x248e3c[_0x5dbf('0x1c')](_0x5dbf('0x1d'),_0x39c7aa+'-'+_0x20c2b0+'/'+_0x16dc82)[_0x5dbf('0x18')](_0x2dfa44);}return null;};}function patchUpdates(_0x2ab57c){return function(_0x1e3cce){try{jsonpatch['apply'](_0x1e3cce,_0x2ab57c,!![]);}catch(_0x2764ea){return BPromise['reject'](_0x2764ea);}return _0x1e3cce[_0x5dbf('0x1e')]();};}function saveUpdates(_0x11cc67,_0x14d133){return function(_0x43a612){if(_0x43a612){return _0x43a612[_0x5dbf('0x1f')](_0x11cc67)[_0x5dbf('0x20')](function(_0x58085e){return _0x58085e;});}return null;};}function removeEntity(_0x4027c3,_0x3e3a2d){return function(_0x2d3e1b){if(_0x2d3e1b){return _0x2d3e1b[_0x5dbf('0x21')]()[_0x5dbf('0x20')](function(){var _0x226b93=_0x2d3e1b[_0x5dbf('0x22')]({'plain':!![]});var _0x20ab1b=_0x5dbf('0x23');return db[_0x5dbf('0x24')][_0x5dbf('0x21')]({'where':{'type':_0x20ab1b,'resourceId':_0x226b93['id']}})[_0x5dbf('0x20')](function(){return _0x2d3e1b;});})[_0x5dbf('0x20')](function(){_0x4027c3[_0x5dbf('0x17')](0xcc)[_0x5dbf('0x25')]();});}};}function handleEntityNotFound(_0x17f135,_0x466985){return function(_0x3f8341){if(!_0x3f8341){_0x17f135[_0x5dbf('0x16')](0x194);}return _0x3f8341;};}function handleError(_0x22ec42,_0x6a9757){_0x6a9757=_0x6a9757||0x1f4;return function(_0x471027){logger[_0x5dbf('0x26')](_0x471027['stack']);if(_0x471027[_0x5dbf('0x27')]){delete _0x471027[_0x5dbf('0x27')];}_0x22ec42[_0x5dbf('0x17')](_0x6a9757)[_0x5dbf('0x28')](_0x471027);};}exports[_0x5dbf('0x29')]=function(_0x6a276d,_0x2a65c5){var _0x31d57a={},_0x406ce6={},_0x273b63={'count':0x0,'rows':[]};var _0x294dd7=_['map'](db['AnalyticMetric'][_0x5dbf('0x2a')],function(_0x19015a){return{'name':_0x19015a[_0x5dbf('0x2b')],'type':_0x19015a[_0x5dbf('0x2c')][_0x5dbf('0x2d')]};});_0x406ce6['model']=_['map'](_0x294dd7,_0x5dbf('0x27'));_0x406ce6[_0x5dbf('0x2e')]=_['keys'](_0x6a276d[_0x5dbf('0x2e')]);_0x406ce6[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0x406ce6[_0x5dbf('0x31')],_0x406ce6[_0x5dbf('0x2e')]);_0x31d57a['attributes']=_[_0x5dbf('0x30')](_0x406ce6[_0x5dbf('0x31')],qs[_0x5dbf('0x32')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x32')]));_0x31d57a['attributes']=_0x31d57a[_0x5dbf('0x33')][_0x5dbf('0x34')]?_0x31d57a[_0x5dbf('0x33')]:_0x406ce6[_0x5dbf('0x31')];if(!_0x6a276d['query'][_0x5dbf('0x35')](_0x5dbf('0x36'))){_0x31d57a[_0x5dbf('0x37')]=qs[_0x5dbf('0x37')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x37')]);_0x31d57a[_0x5dbf('0x19')]=qs[_0x5dbf('0x19')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x19')]);}_0x31d57a[_0x5dbf('0x38')]=qs['sort'](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x39')]);_0x31d57a[_0x5dbf('0x3a')]=qs['filters'](_[_0x5dbf('0x3b')](_0x6a276d[_0x5dbf('0x2e')],_0x406ce6[_0x5dbf('0x2f')]),_0x294dd7);if(_0x6a276d['query'][_0x5dbf('0x3c')]){_0x31d57a[_0x5dbf('0x3a')]=_[_0x5dbf('0x3d')](_0x31d57a['where'],{'$or':_[_0x5dbf('0x3e')](_0x294dd7,function(_0x29a62d){if(_0x29a62d[_0x5dbf('0x2c')]!==_0x5dbf('0x3f')){var _0x10537d={};_0x10537d[_0x29a62d[_0x5dbf('0x27')]]={'$like':'%'+_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x3c')]+'%'};return _0x10537d;}})});}_0x31d57a=_['merge']({},_0x31d57a,_0x6a276d['options']);var _0x57ee72={'where':_0x31d57a['where']};return db[_0x5dbf('0x40')][_0x5dbf('0x1b')](_0x57ee72)['then'](function(_0x3ef0eb){_0x273b63[_0x5dbf('0x1b')]=_0x3ef0eb;if(_0x6a276d['query'][_0x5dbf('0x41')]){_0x31d57a[_0x5dbf('0x42')]=[{'all':!![]}];}return db[_0x5dbf('0x40')][_0x5dbf('0x43')](_0x31d57a);})[_0x5dbf('0x20')](function(_0x7c390d){_0x273b63[_0x5dbf('0x44')]=_0x7c390d;return _0x273b63;})[_0x5dbf('0x20')](respondWithFilteredResult(_0x2a65c5,_0x31d57a))[_0x5dbf('0x45')](handleError(_0x2a65c5,null));};exports[_0x5dbf('0x46')]=function(_0x50ac70,_0x78aef3){var _0x22f958={'raw':!![],'where':{'id':_0x50ac70['params']['id']}},_0xec1d28={};_0xec1d28[_0x5dbf('0x31')]=_[_0x5dbf('0x47')](db[_0x5dbf('0x40')][_0x5dbf('0x2a')]);_0xec1d28['query']=_[_0x5dbf('0x47')](_0x50ac70['query']);_0xec1d28[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0xec1d28[_0x5dbf('0x31')],_0xec1d28[_0x5dbf('0x2e')]);_0x22f958['attributes']=_['intersection'](_0xec1d28[_0x5dbf('0x31')],qs[_0x5dbf('0x32')](_0x50ac70[_0x5dbf('0x2e')]['fields']));_0x22f958[_0x5dbf('0x33')]=_0x22f958['attributes']['length']?_0x22f958['attributes']:_0xec1d28['model'];if(_0x50ac70[_0x5dbf('0x2e')][_0x5dbf('0x41')]){_0x22f958['include']=[{'all':!![]}];}_0x22f958=_[_0x5dbf('0x3d')]({},_0x22f958,_0x50ac70[_0x5dbf('0x48')]);return db['AnalyticMetric'][_0x5dbf('0x49')](_0x22f958)[_0x5dbf('0x20')](handleEntityNotFound(_0x78aef3,null))['then'](respondWithResult(_0x78aef3,null))[_0x5dbf('0x45')](handleError(_0x78aef3,null));};exports['create']=function(_0x5ab862,_0x337897){return db[_0x5dbf('0x40')][_0x5dbf('0x4a')](_0x5ab862['body'],{})['then'](function(_0x442a43){var _0x3e8612=_0x5ab862[_0x5dbf('0x4b')][_0x5dbf('0x22')]({'plain':!![]});if(!_0x3e8612)throw new Error(_0x5dbf('0x4c'));if(_0x3e8612[_0x5dbf('0x4d')]===_0x5dbf('0x4b')){var _0x319906=_0x442a43['get']({'plain':!![]});var _0x3f38a0=_0x5dbf('0x23');return db[_0x5dbf('0x4e')][_0x5dbf('0x49')]({'where':{'name':_0x3f38a0,'userProfileId':_0x3e8612[_0x5dbf('0x4f')]},'raw':!![]})[_0x5dbf('0x20')](function(_0x328dc5){if(_0x328dc5&&_0x328dc5['autoAssociation']===0x0){return db[_0x5dbf('0x24')]['create']({'name':_0x319906[_0x5dbf('0x27')],'resourceId':_0x319906['id'],'type':_0x328dc5[_0x5dbf('0x27')],'sectionId':_0x328dc5['id']},{})[_0x5dbf('0x20')](function(){return _0x442a43;});}else{return _0x442a43;}})[_0x5dbf('0x45')](function(_0x78ab84){logger[_0x5dbf('0x26')](_0x5dbf('0x50'),_0x78ab84);throw _0x78ab84;});}return _0x442a43;})['then'](respondWithResult(_0x337897,0xc9))['catch'](handleError(_0x337897,null));};exports['update']=function(_0x1e1876,_0xfdacc7){if(_0x1e1876[_0x5dbf('0x51')]['id']){delete _0x1e1876['body']['id'];}return db['AnalyticMetric'][_0x5dbf('0x49')]({'where':{'id':_0x1e1876[_0x5dbf('0x52')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0xfdacc7,null))['then'](saveUpdates(_0x1e1876[_0x5dbf('0x51')],null))['then'](respondWithResult(_0xfdacc7,null))[_0x5dbf('0x45')](handleError(_0xfdacc7,null));};exports[_0x5dbf('0x21')]=function(_0x2145ea,_0x5da14b){return db['AnalyticMetric'][_0x5dbf('0x49')]({'where':{'id':_0x2145ea[_0x5dbf('0x52')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0x5da14b,null))[_0x5dbf('0x20')](removeEntity(_0x5da14b,null))['catch'](handleError(_0x5da14b,null));}; \ No newline at end of file +var _0x24ca=['find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params'];(function(_0x202207,_0x3f2fb5){var _0x4599da=function(_0x2f9bf6){while(--_0x2f9bf6){_0x202207['push'](_0x202207['shift']());}};_0x4599da(++_0x3f2fb5);}(_0x24ca,0x1bc));var _0xa24c=function(_0x1f8053,_0x111077){_0x1f8053=_0x1f8053-0x0;var _0x174fd8=_0x24ca[_0x1f8053];return _0x174fd8;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];function respondWithStatusCode(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xcc;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['sendStatus'](_0xcee4fe);}return _0x11090c[_0xa24c('0x1b')](_0xcee4fe)[_0xa24c('0x1c')]();};}function respondWithResult(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0xc8;return function(_0x1cb08e){if(_0x1cb08e){return _0x26ff28[_0xa24c('0x1b')](_0x2fcd8b)[_0xa24c('0x1d')](_0x1cb08e);}};}function respondWithFilteredResult(_0x5d4727,_0x47a063){return function(_0xb80781){if(_0xb80781){var _0x87aa90=typeof _0x47a063['offset']==='undefined'&&typeof _0x47a063[_0xa24c('0x1e')]===_0xa24c('0x1f');var _0x5c479e=_0xb80781[_0xa24c('0x20')];var _0x5de3e6=_0x87aa90?0x0:_0x47a063[_0xa24c('0x21')];var _0x2a610a=_0x87aa90?_0xb80781[_0xa24c('0x20')]:_0x47a063[_0xa24c('0x21')]+_0x47a063['limit'];var _0x16d363;if(_0x2a610a>=_0x5c479e){_0x2a610a=_0x5c479e;_0x16d363=0xc8;}else{_0x16d363=0xce;}_0x5d4727[_0xa24c('0x1b')](_0x16d363);return _0x5d4727[_0xa24c('0x22')]('Content-Range',_0x5de3e6+'-'+_0x2a610a+'/'+_0x5c479e)['json'](_0xb80781);}return null;};}function patchUpdates(_0x506424){return function(_0x4cd77e){try{jsonpatch[_0xa24c('0x23')](_0x4cd77e,_0x506424,!![]);}catch(_0x174b69){return BPromise[_0xa24c('0x24')](_0x174b69);}return _0x4cd77e[_0xa24c('0x25')]();};}function saveUpdates(_0x51a275,_0x30ec21){return function(_0x5f299e){if(_0x5f299e){return _0x5f299e[_0xa24c('0x26')](_0x51a275)[_0xa24c('0x27')](function(_0x4a1cda){return _0x4a1cda;});}return null;};}function removeEntity(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(_0x43a0c0){return _0x43a0c0[_0xa24c('0x28')]()[_0xa24c('0x27')](function(){var _0x47e0eb=_0x43a0c0[_0xa24c('0x29')]({'plain':!![]});var _0x5cc9cb=_0xa24c('0x2a');return db[_0xa24c('0x2b')][_0xa24c('0x28')]({'where':{'type':_0x5cc9cb,'resourceId':_0x47e0eb['id']}})['then'](function(){return _0x43a0c0;});})[_0xa24c('0x27')](function(){_0x346ee8[_0xa24c('0x1b')](0xcc)[_0xa24c('0x1c')]();});}};}function handleEntityNotFound(_0x314121,_0x11e4e0){return function(_0x3ad0e6){if(!_0x3ad0e6){_0x314121[_0xa24c('0x2c')](0x194);}return _0x3ad0e6;};}function handleError(_0x5b23f4,_0xa0c48e){_0xa0c48e=_0xa0c48e||0x1f4;return function(_0x28675f){logger[_0xa24c('0x2d')](_0x28675f[_0xa24c('0x2e')]);if(_0x28675f['name']){delete _0x28675f[_0xa24c('0x2f')];}_0x5b23f4[_0xa24c('0x1b')](_0xa0c48e)[_0xa24c('0x30')](_0x28675f);};}exports['index']=function(_0x15eaaf,_0x3dcb1b){var _0x253d83={},_0x4ae35c={},_0x245fb2={'count':0x0,'rows':[]};var _0x5e0226=_[_0xa24c('0x31')](db[_0xa24c('0x32')][_0xa24c('0x33')],function(_0x5d025a){return{'name':_0x5d025a[_0xa24c('0x34')],'type':_0x5d025a[_0xa24c('0x35')][_0xa24c('0x36')]};});_0x4ae35c['model']=_[_0xa24c('0x31')](_0x5e0226,'name');_0x4ae35c[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x15eaaf['query']);_0x4ae35c['filters']=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],_0x4ae35c[_0xa24c('0x37')]);_0x253d83[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],qs[_0xa24c('0x3c')](_0x15eaaf['query'][_0xa24c('0x3c')]));_0x253d83[_0xa24c('0x3b')]=_0x253d83[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x253d83[_0xa24c('0x3b')]:_0x4ae35c[_0xa24c('0x3a')];if(!_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x3e')](_0xa24c('0x3f'))){_0x253d83[_0xa24c('0x1e')]=qs['limit'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x1e')]);_0x253d83[_0xa24c('0x21')]=qs[_0xa24c('0x21')](_0x15eaaf['query']['offset']);}_0x253d83[_0xa24c('0x40')]=qs['sort'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x41')]);_0x253d83[_0xa24c('0x42')]=qs[_0xa24c('0x43')](_[_0xa24c('0x44')](_0x15eaaf['query'],_0x4ae35c['filters']),_0x5e0226);if(_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]){_0x253d83[_0xa24c('0x42')]=_[_0xa24c('0x46')](_0x253d83[_0xa24c('0x42')],{'$or':_[_0xa24c('0x31')](_0x5e0226,function(_0x5080d0){if(_0x5080d0['type']!==_0xa24c('0x47')){var _0x1ce83e={};_0x1ce83e[_0x5080d0[_0xa24c('0x2f')]]={'$like':'%'+_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]+'%'};return _0x1ce83e;}})});}_0x253d83=_['merge']({},_0x253d83,_0x15eaaf[_0xa24c('0x48')]);var _0x7895e={'where':_0x253d83['where']};return db['AnalyticMetric'][_0xa24c('0x20')](_0x7895e)[_0xa24c('0x27')](function(_0x231eea){_0x245fb2['count']=_0x231eea;if(_0x15eaaf['query'][_0xa24c('0x49')]){_0x253d83[_0xa24c('0x4a')]=[{'all':!![]}];}return db[_0xa24c('0x32')][_0xa24c('0x4b')](_0x253d83);})[_0xa24c('0x27')](function(_0x1b7faf){_0x245fb2[_0xa24c('0x4c')]=_0x1b7faf;return _0x245fb2;})[_0xa24c('0x27')](respondWithFilteredResult(_0x3dcb1b,_0x253d83))['catch'](handleError(_0x3dcb1b,null));};exports['show']=function(_0x430ba3,_0x44f7d4){var _0x455256={'raw':!![],'where':{'id':_0x430ba3[_0xa24c('0x4d')]['id']}},_0x5972d7={};_0x5972d7[_0xa24c('0x3a')]=_[_0xa24c('0x38')](db[_0xa24c('0x32')][_0xa24c('0x33')]);_0x5972d7[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x430ba3[_0xa24c('0x37')]);_0x5972d7[_0xa24c('0x43')]=_[_0xa24c('0x39')](_0x5972d7['model'],_0x5972d7[_0xa24c('0x37')]);_0x455256[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x5972d7['model'],qs[_0xa24c('0x3c')](_0x430ba3[_0xa24c('0x37')][_0xa24c('0x3c')]));_0x455256[_0xa24c('0x3b')]=_0x455256[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x455256[_0xa24c('0x3b')]:_0x5972d7[_0xa24c('0x3a')];if(_0x430ba3[_0xa24c('0x37')][_0xa24c('0x49')]){_0x455256[_0xa24c('0x4a')]=[{'all':!![]}];}_0x455256=_['merge']({},_0x455256,_0x430ba3[_0xa24c('0x48')]);return db[_0xa24c('0x32')][_0xa24c('0x4e')](_0x455256)[_0xa24c('0x27')](handleEntityNotFound(_0x44f7d4,null))[_0xa24c('0x27')](respondWithResult(_0x44f7d4,null))[_0xa24c('0x4f')](handleError(_0x44f7d4,null));};exports[_0xa24c('0x50')]=function(_0x2250b9,_0x184179){return db['AnalyticMetric']['create'](_0x2250b9[_0xa24c('0x51')],{})['then'](function(_0xc078ef){var _0x1f436c=_0x2250b9['user'][_0xa24c('0x29')]({'plain':!![]});if(!_0x1f436c)throw new Error(_0xa24c('0x52'));if(_0x1f436c[_0xa24c('0x53')]==='user'){var _0x55978e=_0xc078ef[_0xa24c('0x29')]({'plain':!![]});var _0x5ba726=_0xa24c('0x2a');return db[_0xa24c('0x54')][_0xa24c('0x4e')]({'where':{'name':_0x5ba726,'userProfileId':_0x1f436c[_0xa24c('0x55')]},'raw':!![]})[_0xa24c('0x27')](function(_0x1fa739){if(_0x1fa739&&_0x1fa739[_0xa24c('0x56')]===0x0){return db[_0xa24c('0x2b')][_0xa24c('0x50')]({'name':_0x55978e[_0xa24c('0x2f')],'resourceId':_0x55978e['id'],'type':_0x1fa739['name'],'sectionId':_0x1fa739['id']},{})[_0xa24c('0x27')](function(){return _0xc078ef;});}else{return _0xc078ef;}})[_0xa24c('0x4f')](function(_0x233f8e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x233f8e);throw _0x233f8e;});}return _0xc078ef;})['then'](respondWithResult(_0x184179,0xc9))[_0xa24c('0x4f')](handleError(_0x184179,null));};exports['update']=function(_0x4757ff,_0x21d0fc){if(_0x4757ff['body']['id']){delete _0x4757ff[_0xa24c('0x51')]['id'];}return db[_0xa24c('0x32')][_0xa24c('0x4e')]({'where':{'id':_0x4757ff[_0xa24c('0x4d')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x21d0fc,null))[_0xa24c('0x27')](saveUpdates(_0x4757ff[_0xa24c('0x51')],null))[_0xa24c('0x27')](respondWithResult(_0x21d0fc,null))['catch'](handleError(_0x21d0fc,null));};exports[_0xa24c('0x28')]=function(_0x47af80,_0x5abd45){return db['AnalyticMetric']['find']({'where':{'id':_0x47af80['params']['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x5abd45,null))['then'](removeEntity(_0x5abd45,null))[_0xa24c('0x4f')](handleError(_0x5abd45,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 9445a52..2bf0df8 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 _0xf88f=['analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric'];(function(_0x4fec64,_0x4031c3){var _0xafb4d2=function(_0x4987f2){while(--_0x4987f2){_0x4fec64['push'](_0x4fec64['shift']());}};_0xafb4d2(++_0x4031c3);}(_0xf88f,0x1bb));var _0xff88=function(_0x304958,_0x3872ab){_0x304958=_0x304958-0x0;var _0x22f57c=_0xf88f[_0x304958];return _0x22f57c;};'use strict';var _=require(_0xff88('0x0'));var util=require(_0xff88('0x1'));var logger=require(_0xff88('0x2'))(_0xff88('0x3'));var moment=require(_0xff88('0x4'));var BPromise=require(_0xff88('0x5'));var rp=require(_0xff88('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xff88('0x7'));var config=require(_0xff88('0x8'));var attributes=require(_0xff88('0x9'));module['exports']=function(_0x38e1df,_0x406a2e){return _0x38e1df[_0xff88('0xa')](_0xff88('0xb'),attributes,{'tableName':_0xff88('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x21b7=['../../config/environment','./analyticMetric.attributes','exports','define','analytics_metrics','api','moment','bluebird','request-promise'];(function(_0x1b7d42,_0x176be6){var _0x33b0af=function(_0x1b2129){while(--_0x1b2129){_0x1b7d42['push'](_0x1b7d42['shift']());}};_0x33b0af(++_0x176be6);}(_0x21b7,0xef));var _0x721b=function(_0x1ebf64,_0x246f66){_0x1ebf64=_0x1ebf64-0x0;var _0x293751=_0x21b7[_0x1ebf64];return _0x293751;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x721b('0x0'));var moment=require(_0x721b('0x1'));var BPromise=require(_0x721b('0x2'));var rp=require(_0x721b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x721b('0x4'));var attributes=require(_0x721b('0x5'));module[_0x721b('0x6')]=function(_0x343cd3,_0x168d33){return _0x343cd3[_0x721b('0x7')]('AnalyticMetric',attributes,{'tableName':_0x721b('0x8'),'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 ef5b689..2b754ac 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 _0xca44=['../../config/utils','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0xf6c10f,_0x57ae81){var _0x49d30b=function(_0x3e3ba0){while(--_0x3e3ba0){_0xf6c10f['push'](_0xf6c10f['shift']());}};_0x49d30b(++_0x57ae81);}(_0xca44,0x126));var _0x4ca4=function(_0x2d268b,_0x1d59d1){_0x2d268b=_0x2d268b-0x0;var _0x2daf29=_0xca44[_0x2d268b];return _0x2daf29;};'use strict';var _=require(_0x4ca4('0x0'));var util=require(_0x4ca4('0x1'));var moment=require(_0x4ca4('0x2'));var BPromise=require(_0x4ca4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4ca4('0x4'));var db=require(_0x4ca4('0x5'))['db'];var utils=require(_0x4ca4('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4ca4('0x7'));var client=jayson[_0x4ca4('0x8')][_0x4ca4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5372c2,_0x21a016,_0x3d4f05){return new BPromise(function(_0x2496b9,_0x4495dc){return client[_0x4ca4('0xa')](_0x5372c2,_0x3d4f05)[_0x4ca4('0xb')](function(_0x5070e6){logger[_0x4ca4('0xc')](_0x4ca4('0xd'),_0x21a016,_0x4ca4('0xe'));logger[_0x4ca4('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x21a016,_0x4ca4('0xe'),JSON['stringify'](_0x5070e6));if(_0x5070e6[_0x4ca4('0x10')]){if(_0x5070e6['error'][_0x4ca4('0x11')]===0x1f4){logger['error'](_0x4ca4('0xd'),_0x21a016,_0x5070e6[_0x4ca4('0x10')][_0x4ca4('0x12')]);return _0x4495dc(_0x5070e6[_0x4ca4('0x10')][_0x4ca4('0x12')]);}logger[_0x4ca4('0x10')](_0x4ca4('0xd'),_0x21a016,_0x5070e6[_0x4ca4('0x10')][_0x4ca4('0x12')]);return _0x2496b9(_0x5070e6[_0x4ca4('0x10')][_0x4ca4('0x12')]);}else{logger[_0x4ca4('0xc')](_0x4ca4('0xd'),_0x21a016,_0x4ca4('0xe'));_0x2496b9(_0x5070e6['result'][_0x4ca4('0x12')]);}})[_0x4ca4('0x13')](function(_0x1fc419){logger['error'](_0x4ca4('0xd'),_0x21a016,_0x1fc419);_0x4495dc(_0x1fc419);});});} \ No newline at end of file +var _0x3ea9=['request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s'];(function(_0x13606d,_0x30f265){var _0x1b85b0=function(_0x285c1b){while(--_0x285c1b){_0x13606d['push'](_0x13606d['shift']());}};_0x1b85b0(++_0x30f265);}(_0x3ea9,0x153));var _0x93ea=function(_0x2f6a3f,_0x87db21){_0x2f6a3f=_0x2f6a3f-0x0;var _0x26b83c=_0x3ea9[_0x2f6a3f];return _0x26b83c;};'use strict';var _=require(_0x93ea('0x0'));var util=require(_0x93ea('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x93ea('0x2'));var db=require(_0x93ea('0x3'))['db'];var utils=require(_0x93ea('0x4'));var logger=require('../../config/logger')(_0x93ea('0x5'));var config=require('../../config/environment');var jayson=require(_0x93ea('0x6'));var client=jayson[_0x93ea('0x7')][_0x93ea('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x272daf,_0x4f54c8,_0x81e63d){return new BPromise(function(_0x4b5fc3,_0xa93f07){return client[_0x93ea('0x9')](_0x272daf,_0x81e63d)[_0x93ea('0xa')](function(_0x5ea70a){logger[_0x93ea('0xb')](_0x93ea('0xc'),_0x4f54c8,_0x93ea('0xd'));logger[_0x93ea('0xe')](_0x93ea('0xf'),_0x4f54c8,_0x93ea('0xd'),JSON[_0x93ea('0x10')](_0x5ea70a));if(_0x5ea70a[_0x93ea('0x11')]){if(_0x5ea70a['error'][_0x93ea('0x12')]===0x1f4){logger[_0x93ea('0x11')](_0x93ea('0xc'),_0x4f54c8,_0x5ea70a[_0x93ea('0x11')][_0x93ea('0x13')]);return _0xa93f07(_0x5ea70a[_0x93ea('0x11')][_0x93ea('0x13')]);}logger[_0x93ea('0x11')](_0x93ea('0xc'),_0x4f54c8,_0x5ea70a[_0x93ea('0x11')]['message']);return _0x4b5fc3(_0x5ea70a[_0x93ea('0x11')][_0x93ea('0x13')]);}else{logger[_0x93ea('0xb')](_0x93ea('0xc'),_0x4f54c8,_0x93ea('0xd'));_0x4b5fc3(_0x5ea70a[_0x93ea('0x14')][_0x93ea('0x13')]);}})[_0x93ea('0x15')](function(_0x1e2ed7){logger[_0x93ea('0x11')](_0x93ea('0xc'),_0x4f54c8,_0x1e2ed7);_0xa93f07(_0x1e2ed7);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index a379f8e..9e38658 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 _0x598a=['util','path','connect-timeout','express','fs-extra','./analyticMetric.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','destroy','exports','multer'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x598a,0xfb));var _0xa598=function(_0x111bcf,_0x5f411b){_0x111bcf=_0x111bcf-0x0;var _0x3aaddd=_0x598a[_0x111bcf];return _0x3aaddd;};'use strict';var multer=require(_0xa598('0x0'));var util=require(_0xa598('0x1'));var path=require(_0xa598('0x2'));var timeout=require(_0xa598('0x3'));var express=require(_0xa598('0x4'));var router=express['Router']();var fs_extra=require(_0xa598('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa598('0x6'));router[_0xa598('0x7')]('/',auth[_0xa598('0x8')](),controller[_0xa598('0x9')]);router[_0xa598('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xa598('0xa')]);router[_0xa598('0xb')]('/',auth[_0xa598('0x8')](),controller[_0xa598('0xc')]);router[_0xa598('0xd')](_0xa598('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xa598('0xf')](_0xa598('0xe'),auth[_0xa598('0x8')](),controller[_0xa598('0x10')]);module[_0xa598('0x11')]=router; \ No newline at end of file +var _0x6c84=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','update'];(function(_0x30103d,_0x5ed539){var _0x35e583=function(_0x56f56a){while(--_0x56f56a){_0x30103d['push'](_0x30103d['shift']());}};_0x35e583(++_0x5ed539);}(_0x6c84,0x112));var _0x46c8=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x6c84[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0x46c8('0x0'));var util=require(_0x46c8('0x1'));var path=require(_0x46c8('0x2'));var timeout=require(_0x46c8('0x3'));var express=require(_0x46c8('0x4'));var router=express['Router']();var fs_extra=require(_0x46c8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x46c8('0x6'));var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router[_0x46c8('0x7')]('/',auth[_0x46c8('0x8')](),controller[_0x46c8('0x9')]);router[_0x46c8('0x7')](_0x46c8('0xa'),auth[_0x46c8('0x8')](),controller[_0x46c8('0xb')]);router[_0x46c8('0xc')]('/',auth['isAuthenticated'](),controller[_0x46c8('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x46c8('0xe')]);router['delete'](_0x46c8('0xa'),auth[_0x46c8('0x8')](),controller[_0x46c8('0xf')]);module[_0x46c8('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 7c0733a..3b03c91 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 _0x6d67=['sequelize','exports','TEXT'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x6d67,0x19e));var _0x76d6=function(_0x56461f,_0x4d08fc){_0x56461f=_0x56461f-0x0;var _0x6894f7=_0x6d67[_0x56461f];return _0x6894f7;};'use strict';var Sequelize=require(_0x76d6('0x0'));module[_0x76d6('0x1')]={'tree':{'type':Sequelize[_0x76d6('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xf492=['TEXT','sequelize','exports'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xf492,0x67));var _0x2f49=function(_0x46a67b,_0x4d7b77){_0x46a67b=_0x46a67b-0x0;var _0x47e8bf=_0xf492[_0x46a67b];return _0x47e8bf;};'use strict';var Sequelize=require(_0x2f49('0x0'));module[_0x2f49('0x1')]={'tree':{'type':Sequelize[_0x2f49('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 915d9d3..619c5b1 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 _0xf0a8=['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','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filters','filter','VIRTUAL','merge','options','AnalyticTreeReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','lodash','crypto'];(function(_0x29b398,_0xa9b84a){var _0x4c86a4=function(_0x52950c){while(--_0x52950c){_0x29b398['push'](_0x29b398['shift']());}};_0x4c86a4(++_0xa9b84a);}(_0xf0a8,0x176));var _0x8f0a=function(_0x159be7,_0x3a5660){_0x159be7=_0x159be7-0x0;var _0x4ba87a=_0xf0a8[_0x159be7];return _0x4ba87a;};'use strict';var emlformat=require(_0x8f0a('0x0'));var rimraf=require(_0x8f0a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8f0a('0x2'));var moment=require(_0x8f0a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8f0a('0x4'));var util=require(_0x8f0a('0x5'));var path=require(_0x8f0a('0x6'));var sox=require(_0x8f0a('0x7'));var csv=require(_0x8f0a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8f0a('0x9'));var squel=require('squel');var crypto=require(_0x8f0a('0xa'));var jsforce=require(_0x8f0a('0xb'));var deskjs=require(_0x8f0a('0xc'));var toCsv=require(_0x8f0a('0x8'));var querystring=require(_0x8f0a('0xd'));var Papa=require(_0x8f0a('0xe'));var Redis=require('ioredis');var authService=require(_0x8f0a('0xf'));var qs=require(_0x8f0a('0x10'));var as=require(_0x8f0a('0x11'));var hardwareService=require(_0x8f0a('0x12'));var logger=require(_0x8f0a('0x13'))(_0x8f0a('0x14'));var utils=require(_0x8f0a('0x15'));var config=require(_0x8f0a('0x16'));var licenseUtil=require(_0x8f0a('0x17'));var db=require(_0x8f0a('0x18'))['db'];function respondWithStatusCode(_0x14c609,_0x29e352){_0x29e352=_0x29e352||0xcc;return function(_0x2ec472){if(_0x2ec472){return _0x14c609[_0x8f0a('0x19')](_0x29e352);}return _0x14c609[_0x8f0a('0x1a')](_0x29e352)[_0x8f0a('0x1b')]();};}function respondWithResult(_0x57ec58,_0x11c945){_0x11c945=_0x11c945||0xc8;return function(_0x5e3c3c){if(_0x5e3c3c){return _0x57ec58[_0x8f0a('0x1a')](_0x11c945)[_0x8f0a('0x1c')](_0x5e3c3c);}};}function respondWithFilteredResult(_0x3a6b74,_0x4e76b5){return function(_0x2c5b2d){if(_0x2c5b2d){var _0x1773ad=typeof _0x4e76b5['offset']===_0x8f0a('0x1d')&&typeof _0x4e76b5[_0x8f0a('0x1e')]===_0x8f0a('0x1d');var _0x4d60c2=_0x2c5b2d[_0x8f0a('0x1f')];var _0x139252=_0x1773ad?0x0:_0x4e76b5[_0x8f0a('0x20')];var _0xe701ab=_0x1773ad?_0x2c5b2d[_0x8f0a('0x1f')]:_0x4e76b5[_0x8f0a('0x20')]+_0x4e76b5['limit'];var _0x5559b1;if(_0xe701ab>=_0x4d60c2){_0xe701ab=_0x4d60c2;_0x5559b1=0xc8;}else{_0x5559b1=0xce;}_0x3a6b74[_0x8f0a('0x1a')](_0x5559b1);return _0x3a6b74[_0x8f0a('0x21')](_0x8f0a('0x22'),_0x139252+'-'+_0xe701ab+'/'+_0x4d60c2)[_0x8f0a('0x1c')](_0x2c5b2d);}return null;};}function patchUpdates(_0x3a7b73){return function(_0x36ca09){try{jsonpatch[_0x8f0a('0x23')](_0x36ca09,_0x3a7b73,!![]);}catch(_0x521b2b){return BPromise[_0x8f0a('0x24')](_0x521b2b);}return _0x36ca09[_0x8f0a('0x25')]();};}function saveUpdates(_0x4cc233,_0x75d7fd){return function(_0x4d1757){if(_0x4d1757){return _0x4d1757[_0x8f0a('0x26')](_0x4cc233)[_0x8f0a('0x27')](function(_0x27b20d){return _0x27b20d;});}return null;};}function removeEntity(_0x41c959,_0x5aa334){return function(_0x198593){if(_0x198593){return _0x198593[_0x8f0a('0x28')]()[_0x8f0a('0x27')](function(){_0x41c959[_0x8f0a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x80ccbe,_0x3f52a6){return function(_0xecd819){if(!_0xecd819){_0x80ccbe['sendStatus'](0x194);}return _0xecd819;};}function handleError(_0x233510,_0x4c2896){_0x4c2896=_0x4c2896||0x1f4;return function(_0x35343f){logger[_0x8f0a('0x29')](_0x35343f[_0x8f0a('0x2a')]);if(_0x35343f[_0x8f0a('0x2b')]){delete _0x35343f[_0x8f0a('0x2b')];}_0x233510['status'](_0x4c2896)[_0x8f0a('0x2c')](_0x35343f);};}exports[_0x8f0a('0x2d')]=function(_0x7a783,_0x3b3d1a){var _0x487156={},_0x2ce7aa={},_0xc23413={'count':0x0,'rows':[]};var _0x2ffe96=_[_0x8f0a('0x2e')](db['AnalyticTreeReport'][_0x8f0a('0x2f')],function(_0x3ac601){return{'name':_0x3ac601[_0x8f0a('0x30')],'type':_0x3ac601[_0x8f0a('0x31')]['key']};});_0x2ce7aa['model']=_[_0x8f0a('0x2e')](_0x2ffe96,'name');_0x2ce7aa[_0x8f0a('0x32')]=_[_0x8f0a('0x33')](_0x7a783[_0x8f0a('0x32')]);_0x2ce7aa['filters']=_[_0x8f0a('0x34')](_0x2ce7aa['model'],_0x2ce7aa[_0x8f0a('0x32')]);_0x487156[_0x8f0a('0x35')]=_[_0x8f0a('0x34')](_0x2ce7aa[_0x8f0a('0x36')],qs[_0x8f0a('0x37')](_0x7a783[_0x8f0a('0x32')][_0x8f0a('0x37')]));_0x487156[_0x8f0a('0x35')]=_0x487156[_0x8f0a('0x35')][_0x8f0a('0x38')]?_0x487156[_0x8f0a('0x35')]:_0x2ce7aa[_0x8f0a('0x36')];if(!_0x7a783[_0x8f0a('0x32')][_0x8f0a('0x39')]('nolimit')){_0x487156[_0x8f0a('0x1e')]=qs[_0x8f0a('0x1e')](_0x7a783[_0x8f0a('0x32')]['limit']);_0x487156['offset']=qs[_0x8f0a('0x20')](_0x7a783[_0x8f0a('0x32')][_0x8f0a('0x20')]);}_0x487156[_0x8f0a('0x3a')]=qs[_0x8f0a('0x3b')](_0x7a783[_0x8f0a('0x32')][_0x8f0a('0x3b')]);_0x487156[_0x8f0a('0x3c')]=qs['filters'](_['pick'](_0x7a783[_0x8f0a('0x32')],_0x2ce7aa[_0x8f0a('0x3d')]),_0x2ffe96);if(_0x7a783[_0x8f0a('0x32')][_0x8f0a('0x3e')]){_0x487156[_0x8f0a('0x3c')]=_['merge'](_0x487156[_0x8f0a('0x3c')],{'$or':_['map'](_0x2ffe96,function(_0x327894){if(_0x327894['type']!==_0x8f0a('0x3f')){var _0x1499aa={};_0x1499aa[_0x327894[_0x8f0a('0x2b')]]={'$like':'%'+_0x7a783[_0x8f0a('0x32')][_0x8f0a('0x3e')]+'%'};return _0x1499aa;}})});}_0x487156=_[_0x8f0a('0x40')]({},_0x487156,_0x7a783[_0x8f0a('0x41')]);var _0x7208b0={'where':_0x487156[_0x8f0a('0x3c')]};return db[_0x8f0a('0x42')]['count'](_0x7208b0)[_0x8f0a('0x27')](function(_0x5ceaa7){_0xc23413[_0x8f0a('0x1f')]=_0x5ceaa7;if(_0x7a783[_0x8f0a('0x32')][_0x8f0a('0x43')]){_0x487156[_0x8f0a('0x44')]=[{'all':!![]}];}return db[_0x8f0a('0x42')][_0x8f0a('0x45')](_0x487156);})['then'](function(_0x26accc){_0xc23413[_0x8f0a('0x46')]=_0x26accc;return _0xc23413;})[_0x8f0a('0x27')](respondWithFilteredResult(_0x3b3d1a,_0x487156))[_0x8f0a('0x47')](handleError(_0x3b3d1a,null));};exports[_0x8f0a('0x48')]=function(_0x2e1f58,_0x1952af){var _0x2d9ba8={'raw':!![],'where':{'id':_0x2e1f58[_0x8f0a('0x49')]['id']}},_0x3808f8={};_0x3808f8[_0x8f0a('0x36')]=_[_0x8f0a('0x33')](db['AnalyticTreeReport']['rawAttributes']);_0x3808f8['query']=_['keys'](_0x2e1f58['query']);_0x3808f8[_0x8f0a('0x3d')]=_[_0x8f0a('0x34')](_0x3808f8[_0x8f0a('0x36')],_0x3808f8[_0x8f0a('0x32')]);_0x2d9ba8[_0x8f0a('0x35')]=_[_0x8f0a('0x34')](_0x3808f8[_0x8f0a('0x36')],qs[_0x8f0a('0x37')](_0x2e1f58[_0x8f0a('0x32')][_0x8f0a('0x37')]));_0x2d9ba8[_0x8f0a('0x35')]=_0x2d9ba8[_0x8f0a('0x35')][_0x8f0a('0x38')]?_0x2d9ba8['attributes']:_0x3808f8[_0x8f0a('0x36')];if(_0x2e1f58[_0x8f0a('0x32')][_0x8f0a('0x43')]){_0x2d9ba8[_0x8f0a('0x44')]=[{'all':!![]}];}_0x2d9ba8=_[_0x8f0a('0x40')]({},_0x2d9ba8,_0x2e1f58[_0x8f0a('0x41')]);return db[_0x8f0a('0x42')][_0x8f0a('0x4a')](_0x2d9ba8)[_0x8f0a('0x27')](handleEntityNotFound(_0x1952af,null))[_0x8f0a('0x27')](respondWithResult(_0x1952af,null))[_0x8f0a('0x47')](handleError(_0x1952af,null));};exports[_0x8f0a('0x4b')]=function(_0x5f6ee0,_0x259d69){return db[_0x8f0a('0x42')]['create'](_0x5f6ee0[_0x8f0a('0x4c')],{})[_0x8f0a('0x27')](respondWithResult(_0x259d69,0xc9))[_0x8f0a('0x47')](handleError(_0x259d69,null));};exports[_0x8f0a('0x26')]=function(_0x166ac6,_0x94044c){if(_0x166ac6['body']['id']){delete _0x166ac6[_0x8f0a('0x4c')]['id'];}return db[_0x8f0a('0x42')]['find']({'where':{'id':_0x166ac6[_0x8f0a('0x49')]['id']}})[_0x8f0a('0x27')](handleEntityNotFound(_0x94044c,null))[_0x8f0a('0x27')](saveUpdates(_0x166ac6[_0x8f0a('0x4c')],null))[_0x8f0a('0x27')](respondWithResult(_0x94044c,null))[_0x8f0a('0x47')](handleError(_0x94044c,null));};exports[_0x8f0a('0x28')]=function(_0x566a6e,_0x4c82aa){return db[_0x8f0a('0x42')][_0x8f0a('0x4a')]({'where':{'id':_0x566a6e['params']['id']}})[_0x8f0a('0x27')](handleEntityNotFound(_0x4c82aa,null))[_0x8f0a('0x27')](removeEntity(_0x4c82aa,null))['catch'](handleError(_0x4c82aa,null));}; \ No newline at end of file +var _0x0af2=['../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','count','limit','Content-Range','reject','save','then','destroy','end','sendStatus','error','stack','name','index','map','AnalyticTreeReport','rawAttributes','type','key','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','params','keys','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x451402,_0x561cb8){var _0x4ffb7f=function(_0x1c263a){while(--_0x1c263a){_0x451402['push'](_0x451402['shift']());}};_0x4ffb7f(++_0x561cb8);}(_0x0af2,0xbe));var _0x20af=function(_0x240069,_0x378f63){_0x240069=_0x240069-0x0;var _0x465688=_0x0af2[_0x240069];return _0x465688;};'use strict';var emlformat=require(_0x20af('0x0'));var rimraf=require(_0x20af('0x1'));var zipdir=require(_0x20af('0x2'));var jsonpatch=require(_0x20af('0x3'));var rp=require(_0x20af('0x4'));var moment=require(_0x20af('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x20af('0x6'));var util=require(_0x20af('0x7'));var path=require(_0x20af('0x8'));var sox=require('sox');var csv=require(_0x20af('0x9'));var ejs=require(_0x20af('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x20af('0xb'));var squel=require('squel');var crypto=require(_0x20af('0xc'));var jsforce=require(_0x20af('0xd'));var deskjs=require(_0x20af('0xe'));var toCsv=require(_0x20af('0x9'));var querystring=require(_0x20af('0xf'));var Papa=require(_0x20af('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x20af('0x11'));var as=require(_0x20af('0x12'));var hardwareService=require(_0x20af('0x13'));var logger=require(_0x20af('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x20af('0x15'));var licenseUtil=require(_0x20af('0x16'));var db=require(_0x20af('0x17'))['db'];function respondWithStatusCode(_0x621a25,_0x324b1f){_0x324b1f=_0x324b1f||0xcc;return function(_0x5c2de0){if(_0x5c2de0){return _0x621a25['sendStatus'](_0x324b1f);}return _0x621a25[_0x20af('0x18')](_0x324b1f)['end']();};}function respondWithResult(_0x10e4cf,_0x4469e1){_0x4469e1=_0x4469e1||0xc8;return function(_0xe55e3f){if(_0xe55e3f){return _0x10e4cf[_0x20af('0x18')](_0x4469e1)[_0x20af('0x19')](_0xe55e3f);}};}function respondWithFilteredResult(_0x1066c1,_0x8a38a4){return function(_0x36cc95){if(_0x36cc95){var _0x10090e=typeof _0x8a38a4[_0x20af('0x1a')]==='undefined'&&typeof _0x8a38a4['limit']==='undefined';var _0x1eaee7=_0x36cc95['count'];var _0x28e101=_0x10090e?0x0:_0x8a38a4[_0x20af('0x1a')];var _0xfabf01=_0x10090e?_0x36cc95[_0x20af('0x1b')]:_0x8a38a4[_0x20af('0x1a')]+_0x8a38a4[_0x20af('0x1c')];var _0x163bfc;if(_0xfabf01>=_0x1eaee7){_0xfabf01=_0x1eaee7;_0x163bfc=0xc8;}else{_0x163bfc=0xce;}_0x1066c1['status'](_0x163bfc);return _0x1066c1['set'](_0x20af('0x1d'),_0x28e101+'-'+_0xfabf01+'/'+_0x1eaee7)[_0x20af('0x19')](_0x36cc95);}return null;};}function patchUpdates(_0x5e2acc){return function(_0x557533){try{jsonpatch['apply'](_0x557533,_0x5e2acc,!![]);}catch(_0x5e0e36){return BPromise[_0x20af('0x1e')](_0x5e0e36);}return _0x557533[_0x20af('0x1f')]();};}function saveUpdates(_0x2319dd,_0xd7d266){return function(_0x2a5c58){if(_0x2a5c58){return _0x2a5c58['update'](_0x2319dd)[_0x20af('0x20')](function(_0x2eac9d){return _0x2eac9d;});}return null;};}function removeEntity(_0x40e28f,_0x4dc791){return function(_0x464813){if(_0x464813){return _0x464813[_0x20af('0x21')]()[_0x20af('0x20')](function(){_0x40e28f[_0x20af('0x18')](0xcc)[_0x20af('0x22')]();});}};}function handleEntityNotFound(_0x34d76a,_0x43c467){return function(_0x58a8ff){if(!_0x58a8ff){_0x34d76a[_0x20af('0x23')](0x194);}return _0x58a8ff;};}function handleError(_0x21818f,_0x295e42){_0x295e42=_0x295e42||0x1f4;return function(_0x4bc8f9){logger[_0x20af('0x24')](_0x4bc8f9[_0x20af('0x25')]);if(_0x4bc8f9['name']){delete _0x4bc8f9[_0x20af('0x26')];}_0x21818f[_0x20af('0x18')](_0x295e42)['send'](_0x4bc8f9);};}exports[_0x20af('0x27')]=function(_0x499b3b,_0x16e7c6){var _0x18a844={},_0x4f67ac={},_0x542b2b={'count':0x0,'rows':[]};var _0x2a9775=_[_0x20af('0x28')](db[_0x20af('0x29')][_0x20af('0x2a')],function(_0x26b0c5){return{'name':_0x26b0c5['fieldName'],'type':_0x26b0c5[_0x20af('0x2b')][_0x20af('0x2c')]};});_0x4f67ac['model']=_['map'](_0x2a9775,_0x20af('0x26'));_0x4f67ac['query']=_['keys'](_0x499b3b[_0x20af('0x2d')]);_0x4f67ac[_0x20af('0x2e')]=_['intersection'](_0x4f67ac[_0x20af('0x2f')],_0x4f67ac[_0x20af('0x2d')]);_0x18a844['attributes']=_[_0x20af('0x30')](_0x4f67ac[_0x20af('0x2f')],qs[_0x20af('0x31')](_0x499b3b[_0x20af('0x2d')]['fields']));_0x18a844[_0x20af('0x32')]=_0x18a844['attributes'][_0x20af('0x33')]?_0x18a844['attributes']:_0x4f67ac[_0x20af('0x2f')];if(!_0x499b3b[_0x20af('0x2d')][_0x20af('0x34')]('nolimit')){_0x18a844['limit']=qs['limit'](_0x499b3b[_0x20af('0x2d')][_0x20af('0x1c')]);_0x18a844[_0x20af('0x1a')]=qs[_0x20af('0x1a')](_0x499b3b['query'][_0x20af('0x1a')]);}_0x18a844[_0x20af('0x35')]=qs[_0x20af('0x36')](_0x499b3b[_0x20af('0x2d')][_0x20af('0x36')]);_0x18a844['where']=qs[_0x20af('0x2e')](_[_0x20af('0x37')](_0x499b3b['query'],_0x4f67ac['filters']),_0x2a9775);if(_0x499b3b[_0x20af('0x2d')][_0x20af('0x38')]){_0x18a844[_0x20af('0x39')]=_[_0x20af('0x3a')](_0x18a844[_0x20af('0x39')],{'$or':_[_0x20af('0x28')](_0x2a9775,function(_0x532a71){if(_0x532a71[_0x20af('0x2b')]!==_0x20af('0x3b')){var _0x29e90f={};_0x29e90f[_0x532a71[_0x20af('0x26')]]={'$like':'%'+_0x499b3b['query'][_0x20af('0x38')]+'%'};return _0x29e90f;}})});}_0x18a844=_['merge']({},_0x18a844,_0x499b3b['options']);var _0x9ba8d4={'where':_0x18a844[_0x20af('0x39')]};return db[_0x20af('0x29')][_0x20af('0x1b')](_0x9ba8d4)[_0x20af('0x20')](function(_0x54fab7){_0x542b2b['count']=_0x54fab7;if(_0x499b3b[_0x20af('0x2d')][_0x20af('0x3c')]){_0x18a844['include']=[{'all':!![]}];}return db[_0x20af('0x29')][_0x20af('0x3d')](_0x18a844);})[_0x20af('0x20')](function(_0x2f2baf){_0x542b2b[_0x20af('0x3e')]=_0x2f2baf;return _0x542b2b;})['then'](respondWithFilteredResult(_0x16e7c6,_0x18a844))[_0x20af('0x3f')](handleError(_0x16e7c6,null));};exports['show']=function(_0x560a40,_0x301e2d){var _0x279bcb={'raw':!![],'where':{'id':_0x560a40[_0x20af('0x40')]['id']}},_0x2d16e0={};_0x2d16e0[_0x20af('0x2f')]=_[_0x20af('0x41')](db[_0x20af('0x29')][_0x20af('0x2a')]);_0x2d16e0['query']=_['keys'](_0x560a40[_0x20af('0x2d')]);_0x2d16e0['filters']=_['intersection'](_0x2d16e0[_0x20af('0x2f')],_0x2d16e0[_0x20af('0x2d')]);_0x279bcb[_0x20af('0x32')]=_[_0x20af('0x30')](_0x2d16e0[_0x20af('0x2f')],qs['fields'](_0x560a40['query'][_0x20af('0x31')]));_0x279bcb['attributes']=_0x279bcb[_0x20af('0x32')]['length']?_0x279bcb[_0x20af('0x32')]:_0x2d16e0['model'];if(_0x560a40[_0x20af('0x2d')]['includeAll']){_0x279bcb['include']=[{'all':!![]}];}_0x279bcb=_[_0x20af('0x3a')]({},_0x279bcb,_0x560a40[_0x20af('0x42')]);return db[_0x20af('0x29')][_0x20af('0x43')](_0x279bcb)[_0x20af('0x20')](handleEntityNotFound(_0x301e2d,null))[_0x20af('0x20')](respondWithResult(_0x301e2d,null))[_0x20af('0x3f')](handleError(_0x301e2d,null));};exports[_0x20af('0x44')]=function(_0x10c7e7,_0x8357d3){return db[_0x20af('0x29')][_0x20af('0x44')](_0x10c7e7['body'],{})[_0x20af('0x20')](respondWithResult(_0x8357d3,0xc9))[_0x20af('0x3f')](handleError(_0x8357d3,null));};exports['update']=function(_0x287d6f,_0x450e5a){if(_0x287d6f['body']['id']){delete _0x287d6f[_0x20af('0x45')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x287d6f[_0x20af('0x40')]['id']}})[_0x20af('0x20')](handleEntityNotFound(_0x450e5a,null))[_0x20af('0x20')](saveUpdates(_0x287d6f['body'],null))[_0x20af('0x20')](respondWithResult(_0x450e5a,null))[_0x20af('0x3f')](handleError(_0x450e5a,null));};exports[_0x20af('0x21')]=function(_0xd5dfe2,_0x527e99){return db['AnalyticTreeReport'][_0x20af('0x43')]({'where':{'id':_0xd5dfe2[_0x20af('0x40')]['id']}})[_0x20af('0x20')](handleEntityNotFound(_0x527e99,null))[_0x20af('0x20')](removeEntity(_0x527e99,null))[_0x20af('0x3f')](handleError(_0x527e99,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index ffe5fd3..5f6d6ee 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 _0xa14f=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xa14f,0x180));var _0xfa14=function(_0x2790ac,_0x52d8ec){_0x2790ac=_0x2790ac-0x0;var _0x3ba6de=_0xa14f[_0x2790ac];return _0x3ba6de;};'use strict';var _=require('lodash');var util=require(_0xfa14('0x0'));var logger=require(_0xfa14('0x1'))(_0xfa14('0x2'));var moment=require(_0xfa14('0x3'));var BPromise=require(_0xfa14('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa14('0x5'));var rimraf=require(_0xfa14('0x6'));var config=require(_0xfa14('0x7'));var attributes=require(_0xfa14('0x8'));module['exports']=function(_0x398012,_0x4cce45){return _0x398012[_0xfa14('0x9')](_0xfa14('0xa'),attributes,{'tableName':_0xfa14('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc4d=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','util'];(function(_0x1f869c,_0x118fd4){var _0x47eb58=function(_0x402660){while(--_0x402660){_0x1f869c['push'](_0x1f869c['shift']());}};_0x47eb58(++_0x118fd4);}(_0xdc4d,0x103));var _0xddc4=function(_0x95fc01,_0x8ee446){_0x95fc01=_0x95fc01-0x0;var _0x5681d3=_0xdc4d[_0x95fc01];return _0x5681d3;};'use strict';var _=require('lodash');var util=require(_0xddc4('0x0'));var logger=require(_0xddc4('0x1'))(_0xddc4('0x2'));var moment=require('moment');var BPromise=require(_0xddc4('0x3'));var rp=require(_0xddc4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xddc4('0x5'));var config=require(_0xddc4('0x6'));var attributes=require(_0xddc4('0x7'));module[_0xddc4('0x8')]=function(_0x9c35fb,_0x1df7af){return _0x9c35fb[_0xddc4('0x9')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','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 642fb06..d7cdfe9 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x50b081,_0x356c8a){var _0x1b0918=function(_0x373e6a){while(--_0x373e6a){_0x50b081['push'](_0x50b081['shift']());}};_0x1b0918(++_0x356c8a);}(_0x2ef3,0xba));var _0x32ef=function(_0x3969bf,_0x4cda0e){_0x3969bf=_0x3969bf-0x0;var _0x6829b9=_0x2ef3[_0x3969bf];return _0x6829b9;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x2ff9a6,_0x149014){var _0x15775a=function(_0x3a19ce){while(--_0x3a19ce){_0x2ff9a6['push'](_0x2ff9a6['shift']());}};_0x15775a(++_0x149014);}(_0x5f2f,0x73));var _0xf5f2=function(_0x33da87,_0x67dad1){_0x33da87=_0x33da87-0x0;var _0x3d094d=_0x5f2f[_0x33da87];return _0x3d094d;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 39b0f38..75dba5b 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 _0x9e2e=['delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','/:id','isAuthenticated','post','create','update'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9e2e,0xdb));var _0xe9e2=function(_0x58cca0,_0x49b8e3){_0x58cca0=_0x58cca0-0x0;var _0x143bf4=_0x9e2e[_0x58cca0];return _0x143bf4;};'use strict';var multer=require('multer');var util=require(_0xe9e2('0x0'));var path=require(_0xe9e2('0x1'));var timeout=require('connect-timeout');var express=require(_0xe9e2('0x2'));var router=express['Router']();var fs_extra=require(_0xe9e2('0x3'));var auth=require(_0xe9e2('0x4'));var interaction=require(_0xe9e2('0x5'));var config=require(_0xe9e2('0x6'));var controller=require(_0xe9e2('0x7'));router[_0xe9e2('0x8')]('/',auth['isAuthenticated'](),controller[_0xe9e2('0x9')]);router[_0xe9e2('0x8')](_0xe9e2('0xa'),auth[_0xe9e2('0xb')](),controller['show']);router[_0xe9e2('0xc')]('/',auth[_0xe9e2('0xb')](),controller[_0xe9e2('0xd')]);router['put'](_0xe9e2('0xa'),auth[_0xe9e2('0xb')](),controller[_0xe9e2('0xe')]);router[_0xe9e2('0xf')](_0xe9e2('0xa'),auth[_0xe9e2('0xb')](),controller[_0xe9e2('0x10')]);module[_0xe9e2('0x11')]=router; \ No newline at end of file +var _0x55ec=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','util'];(function(_0x1c57a5,_0x433064){var _0x3dadb9=function(_0x5cf957){while(--_0x5cf957){_0x1c57a5['push'](_0x1c57a5['shift']());}};_0x3dadb9(++_0x433064);}(_0x55ec,0x17b));var _0xc55e=function(_0x4c184d,_0x4278ab){_0x4c184d=_0x4c184d-0x0;var _0x23d997=_0x55ec[_0x4c184d];return _0x23d997;};'use strict';var multer=require('multer');var util=require(_0xc55e('0x0'));var path=require(_0xc55e('0x1'));var timeout=require(_0xc55e('0x2'));var express=require(_0xc55e('0x3'));var router=express[_0xc55e('0x4')]();var fs_extra=require(_0xc55e('0x5'));var auth=require(_0xc55e('0x6'));var interaction=require(_0xc55e('0x7'));var config=require(_0xc55e('0x8'));var controller=require(_0xc55e('0x9'));router[_0xc55e('0xa')]('/',auth[_0xc55e('0xb')](),controller[_0xc55e('0xc')]);router[_0xc55e('0xa')](_0xc55e('0xd'),auth[_0xc55e('0xb')](),controller[_0xc55e('0xe')]);router[_0xc55e('0xf')]('/',auth['isAuthenticated'](),controller[_0xc55e('0x10')]);router[_0xc55e('0x11')](_0xc55e('0xd'),auth[_0xc55e('0xb')](),controller[_0xc55e('0x12')]);router['delete'](_0xc55e('0xd'),auth[_0xc55e('0xb')](),controller['destroy']);module[_0xc55e('0x13')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 586fbbc..d432312 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 _0xac65=['sequelize','exports','STRING'];(function(_0x5eb062,_0x97f5d6){var _0x32f82e=function(_0x75d263){while(--_0x75d263){_0x5eb062['push'](_0x5eb062['shift']());}};_0x32f82e(++_0x97f5d6);}(_0xac65,0x11d));var _0x5ac6=function(_0x1d5a2b,_0x8ee135){_0x1d5a2b=_0x1d5a2b-0x0;var _0xde1ffe=_0xac65[_0x1d5a2b];return _0xde1ffe;};'use strict';var Sequelize=require(_0x5ac6('0x0'));module[_0x5ac6('0x1')]={'name':{'type':Sequelize[_0x5ac6('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5ac6('0x2')]}}; \ No newline at end of file +var _0xea1a=['exports','STRING','sequelize'];(function(_0x541260,_0x4c7f2e){var _0x1dd2b5=function(_0x4140de){while(--_0x4140de){_0x541260['push'](_0x541260['shift']());}};_0x1dd2b5(++_0x4c7f2e);}(_0xea1a,0x158));var _0xaea1=function(_0xf69ad0,_0x1c9649){_0xf69ad0=_0xf69ad0-0x0;var _0x185767=_0xea1a[_0xf69ad0];return _0x185767;};'use strict';var Sequelize=require(_0xaea1('0x0'));module[_0xaea1('0x1')]={'name':{'type':Sequelize[_0xaea1('0x2')]},'basename':{'type':Sequelize[_0xaea1('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 0b50f8f..5d6c18c 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 _0x731e=['root','server/files/attachments/','offline-chat/','basename','eml-format','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','then','destroy','end','error','stack','name','send','index','Attachment','rawAttributes','fieldName','type','model','map','filters','intersection','attributes','fields','length','query','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','keys','find','clone','get','omit','createdAt','updatedAt','body','create','file','originalname','mimetype','findOne','ChatOfflineMessageId','join'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x731e,0xfd));var _0xe731=function(_0x24bc18,_0x2b4308){_0x24bc18=_0x24bc18-0x0;var _0x3ddcd3=_0x731e[_0x24bc18];return _0x3ddcd3;};'use strict';var emlformat=require(_0xe731('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe731('0x1'));var rp=require('request-promise');var moment=require(_0xe731('0x2'));var BPromise=require(_0xe731('0x3'));var Mustache=require('mustache');var util=require(_0xe731('0x4'));var path=require(_0xe731('0x5'));var sox=require(_0xe731('0x6'));var csv=require('to-csv');var ejs=require(_0xe731('0x7'));var fs=require('fs');var fs_extra=require(_0xe731('0x8'));var _=require('lodash');var squel=require(_0xe731('0x9'));var crypto=require(_0xe731('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe731('0xb'));var toCsv=require('to-csv');var querystring=require(_0xe731('0xc'));var Papa=require(_0xe731('0xd'));var Redis=require(_0xe731('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe731('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe731('0x10'))(_0xe731('0x11'));var utils=require(_0xe731('0x12'));var config=require(_0xe731('0x13'));var licenseUtil=require(_0xe731('0x14'));var db=require(_0xe731('0x15'))['db'];function respondWithStatusCode(_0x58f056,_0x17d61f){_0x17d61f=_0x17d61f||0xcc;return function(_0x546fbd){if(_0x546fbd){return _0x58f056[_0xe731('0x16')](_0x17d61f);}return _0x58f056['status'](_0x17d61f)['end']();};}function respondWithResult(_0x29118e,_0x59289c){_0x59289c=_0x59289c||0xc8;return function(_0x2817ae){if(_0x2817ae){return _0x29118e[_0xe731('0x17')](_0x59289c)[_0xe731('0x18')](_0x2817ae);}};}function respondWithFilteredResult(_0x5bd8cf,_0x5d618e){return function(_0x97a11c){if(_0x97a11c){var _0x474844=typeof _0x5d618e[_0xe731('0x19')]===_0xe731('0x1a')&&typeof _0x5d618e[_0xe731('0x1b')]===_0xe731('0x1a');var _0x39f651=_0x97a11c[_0xe731('0x1c')];var _0x44ed93=_0x474844?0x0:_0x5d618e[_0xe731('0x19')];var _0xa66de2=_0x474844?_0x97a11c['count']:_0x5d618e[_0xe731('0x19')]+_0x5d618e[_0xe731('0x1b')];var _0x599bc1;if(_0xa66de2>=_0x39f651){_0xa66de2=_0x39f651;_0x599bc1=0xc8;}else{_0x599bc1=0xce;}_0x5bd8cf[_0xe731('0x17')](_0x599bc1);return _0x5bd8cf['set'](_0xe731('0x1d'),_0x44ed93+'-'+_0xa66de2+'/'+_0x39f651)[_0xe731('0x18')](_0x97a11c);}return null;};}function patchUpdates(_0x3db7b0){return function(_0x117c66){try{jsonpatch['apply'](_0x117c66,_0x3db7b0,!![]);}catch(_0x549fe0){return BPromise[_0xe731('0x1e')](_0x549fe0);}return _0x117c66[_0xe731('0x1f')]();};}function saveUpdates(_0x407599,_0x2f048b){return function(_0x28bb8a){if(_0x28bb8a){return _0x28bb8a['update'](_0x407599)[_0xe731('0x20')](function(_0x44d33c){return _0x44d33c;});}return null;};}function removeEntity(_0x54e4bb,_0x35cf41){return function(_0x177ddd){if(_0x177ddd){return _0x177ddd[_0xe731('0x21')]()[_0xe731('0x20')](function(){_0x54e4bb[_0xe731('0x17')](0xcc)[_0xe731('0x22')]();});}};}function handleEntityNotFound(_0x4e0baf,_0xb04b68){return function(_0x325932){if(!_0x325932){_0x4e0baf['sendStatus'](0x194);}return _0x325932;};}function handleError(_0x22c022,_0x15f10b){_0x15f10b=_0x15f10b||0x1f4;return function(_0x55a6c5){logger[_0xe731('0x23')](_0x55a6c5[_0xe731('0x24')]);if(_0x55a6c5['name']){delete _0x55a6c5[_0xe731('0x25')];}_0x22c022[_0xe731('0x17')](_0x15f10b)[_0xe731('0x26')](_0x55a6c5);};}exports[_0xe731('0x27')]=function(_0x36541d,_0x4d101b){var _0x3d1087={},_0x1697fa={},_0x2fb65c={'count':0x0,'rows':[]};var _0x203be3=_['map'](db[_0xe731('0x28')][_0xe731('0x29')],function(_0x529923){return{'name':_0x529923[_0xe731('0x2a')],'type':_0x529923[_0xe731('0x2b')]['key']};});_0x1697fa[_0xe731('0x2c')]=_[_0xe731('0x2d')](_0x203be3,'name');_0x1697fa['query']=_['keys'](_0x36541d['query']);_0x1697fa[_0xe731('0x2e')]=_[_0xe731('0x2f')](_0x1697fa[_0xe731('0x2c')],_0x1697fa['query']);_0x3d1087[_0xe731('0x30')]=_[_0xe731('0x2f')](_0x1697fa['model'],qs[_0xe731('0x31')](_0x36541d['query'][_0xe731('0x31')]));_0x3d1087['attributes']=_0x3d1087[_0xe731('0x30')][_0xe731('0x32')]?_0x3d1087[_0xe731('0x30')]:_0x1697fa[_0xe731('0x2c')];if(!_0x36541d[_0xe731('0x33')]['hasOwnProperty']('nolimit')){_0x3d1087[_0xe731('0x1b')]=qs['limit'](_0x36541d[_0xe731('0x33')][_0xe731('0x1b')]);_0x3d1087[_0xe731('0x19')]=qs[_0xe731('0x19')](_0x36541d[_0xe731('0x33')]['offset']);}_0x3d1087[_0xe731('0x34')]=qs['sort'](_0x36541d[_0xe731('0x33')]['sort']);_0x3d1087[_0xe731('0x35')]=qs[_0xe731('0x2e')](_[_0xe731('0x36')](_0x36541d[_0xe731('0x33')],_0x1697fa['filters']),_0x203be3);if(_0x36541d['query'][_0xe731('0x37')]){_0x3d1087[_0xe731('0x35')]=_[_0xe731('0x38')](_0x3d1087[_0xe731('0x35')],{'$or':_[_0xe731('0x2d')](_0x203be3,function(_0x3927ed){if(_0x3927ed[_0xe731('0x2b')]!==_0xe731('0x39')){var _0x3fcb08={};_0x3fcb08[_0x3927ed['name']]={'$like':'%'+_0x36541d[_0xe731('0x33')][_0xe731('0x37')]+'%'};return _0x3fcb08;}})});}_0x3d1087=_[_0xe731('0x38')]({},_0x3d1087,_0x36541d[_0xe731('0x3a')]);var _0xc61191={'where':_0x3d1087[_0xe731('0x35')]};return db[_0xe731('0x28')]['count'](_0xc61191)['then'](function(_0x8e3e63){_0x2fb65c[_0xe731('0x1c')]=_0x8e3e63;if(_0x36541d[_0xe731('0x33')][_0xe731('0x3b')]){_0x3d1087[_0xe731('0x3c')]=[{'all':!![]}];}return db[_0xe731('0x28')]['findAll'](_0x3d1087);})[_0xe731('0x20')](function(_0x2ceb3b){_0x2fb65c['rows']=_0x2ceb3b;return _0x2fb65c;})[_0xe731('0x20')](respondWithFilteredResult(_0x4d101b,_0x3d1087))[_0xe731('0x3d')](handleError(_0x4d101b,null));};exports[_0xe731('0x3e')]=function(_0xae56b7,_0xc9169a){var _0x2cd350={'raw':!![],'where':{'id':_0xae56b7[_0xe731('0x3f')]['id']}},_0x4c3d2f={};_0x4c3d2f['model']=_[_0xe731('0x40')](db[_0xe731('0x28')][_0xe731('0x29')]);_0x4c3d2f[_0xe731('0x33')]=_['keys'](_0xae56b7[_0xe731('0x33')]);_0x4c3d2f[_0xe731('0x2e')]=_[_0xe731('0x2f')](_0x4c3d2f[_0xe731('0x2c')],_0x4c3d2f[_0xe731('0x33')]);_0x2cd350[_0xe731('0x30')]=_[_0xe731('0x2f')](_0x4c3d2f[_0xe731('0x2c')],qs[_0xe731('0x31')](_0xae56b7[_0xe731('0x33')][_0xe731('0x31')]));_0x2cd350[_0xe731('0x30')]=_0x2cd350[_0xe731('0x30')][_0xe731('0x32')]?_0x2cd350[_0xe731('0x30')]:_0x4c3d2f[_0xe731('0x2c')];if(_0xae56b7['query'][_0xe731('0x3b')]){_0x2cd350[_0xe731('0x3c')]=[{'all':!![]}];}_0x2cd350=_['merge']({},_0x2cd350,_0xae56b7[_0xe731('0x3a')]);return db['Attachment'][_0xe731('0x41')](_0x2cd350)['then'](handleEntityNotFound(_0xc9169a,null))[_0xe731('0x20')](respondWithResult(_0xc9169a,null))[_0xe731('0x3d')](handleError(_0xc9169a,null));};exports[_0xe731('0x42')]=function(_0x4786ae,_0x54ef69){var _0x476942={'where':{'id':_0x4786ae[_0xe731('0x3f')]['id']}},_0x30cc1e={};_0x30cc1e['model']=_['keys'](db['Attachment'][_0xe731('0x29')]);_0x476942[_0xe731('0x30')]=_['intersection'](_0x30cc1e[_0xe731('0x2c')],qs[_0xe731('0x31')](_0x4786ae[_0xe731('0x33')][_0xe731('0x31')]));_0x476942['attributes']=_0x476942['attributes'][_0xe731('0x32')]?_0x476942['attributes']:_0x30cc1e['model'];if(_0x4786ae['query'][_0xe731('0x3b')]){_0x476942[_0xe731('0x3c')]=[{'all':!![]}];}_0x476942=_['merge']({},_0x476942,_0x4786ae[_0xe731('0x3a')]);return db[_0xe731('0x28')]['find'](_0x476942)[_0xe731('0x20')](handleEntityNotFound(_0x54ef69,null))[_0xe731('0x20')](function(_0xe57ecc){if(_0xe57ecc){var _0x5c0f46=_0xe57ecc[_0xe731('0x43')]({'plain':!![]});_0x5c0f46=qs[_0xe731('0x44')](_0x5c0f46,['id',_0xe731('0x45'),_0xe731('0x46')]);_0x4786ae['body']=_[_0xe731('0x44')](_0x4786ae[_0xe731('0x47')],['id',_0xe731('0x45'),_0xe731('0x46')]);return db[_0xe731('0x28')][_0xe731('0x48')](_[_0xe731('0x38')](_0x5c0f46,_0x4786ae[_0xe731('0x47')]),{'include':_0x4786ae[_0xe731('0x33')][_0xe731('0x3b')]?[{'all':!![]}]:undefined});}})[_0xe731('0x20')](respondWithResult(_0x54ef69,0xc9))[_0xe731('0x3d')](handleError(_0x54ef69,null));};exports['update']=function(_0x50e89d,_0x490a4d){if(_0x50e89d[_0xe731('0x47')]['id']){delete _0x50e89d[_0xe731('0x47')]['id'];}return db[_0xe731('0x28')][_0xe731('0x41')]({'where':{'id':_0x50e89d[_0xe731('0x3f')]['id']}})[_0xe731('0x20')](handleEntityNotFound(_0x490a4d,null))[_0xe731('0x20')](saveUpdates(_0x50e89d['body'],null))[_0xe731('0x20')](respondWithResult(_0x490a4d,null))[_0xe731('0x3d')](handleError(_0x490a4d,null));};exports[_0xe731('0x21')]=function(_0x33c611,_0x61ab98){return db[_0xe731('0x28')][_0xe731('0x41')]({'where':{'id':_0x33c611[_0xe731('0x3f')]['id']}})[_0xe731('0x20')](handleEntityNotFound(_0x61ab98,null))['then'](removeEntity(_0x61ab98,null))[_0xe731('0x3d')](handleError(_0x61ab98,null));};exports[_0xe731('0x48')]=function(_0x1ad830,_0x57a173,_0x38ed00){_0x1ad830[_0xe731('0x47')][_0xe731('0x25')]=_0x1ad830[_0xe731('0x49')][_0xe731('0x4a')];_0x1ad830[_0xe731('0x47')]['basename']=_0x1ad830[_0xe731('0x49')]['filename'];_0x1ad830['body']['type']=_0x1ad830['file'][_0xe731('0x4b')];return db[_0xe731('0x28')][_0xe731('0x48')](_0x1ad830[_0xe731('0x47')])[_0xe731('0x20')](respondWithResult(_0x57a173,0xc9))[_0xe731('0x3d')](handleError(_0x57a173,null));};exports['download']=function(_0x323cce,_0x200056,_0x12be9f){return db[_0xe731('0x28')][_0xe731('0x4c')]({'where':{'id':_0x323cce[_0xe731('0x3f')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x200056,null))[_0xe731('0x20')](function(_0x149061){if(_0x149061){var _0x2f790a=_0x149061[_0xe731('0x4d')]!==null;var _0x9bc7a0=path[_0xe731('0x4e')](config[_0xe731('0x4f')],_0xe731('0x50'));if(_0x2f790a){_0x9bc7a0=path[_0xe731('0x4e')](_0x9bc7a0,_0xe731('0x51'));}var _0x589316=path['join'](_0x9bc7a0,_0x149061[_0xe731('0x52')]);return _0x200056['download'](_0x589316);}})[_0xe731('0x3d')](handleError(_0x200056,null));}; \ No newline at end of file +var _0x21df=['undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','Attachment','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','merge','options','includeAll','include','rows','catch','rawAttributes','find','params','get','omit','createdAt','body','updatedAt','create','originalname','basename','file','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json'];(function(_0x2b2deb,_0x33430f){var _0x162fb0=function(_0x3947ac){while(--_0x3947ac){_0x2b2deb['push'](_0x2b2deb['shift']());}};_0x162fb0(++_0x33430f);}(_0x21df,0xe7));var _0xf21d=function(_0x1295fb,_0x1b5717){_0x1295fb=_0x1295fb-0x0;var _0x2e94bc=_0x21df[_0x1295fb];return _0x2e94bc;};'use strict';var emlformat=require(_0xf21d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf21d('0x1'));var jsonpatch=require(_0xf21d('0x2'));var rp=require(_0xf21d('0x3'));var moment=require(_0xf21d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf21d('0x5'));var util=require(_0xf21d('0x6'));var path=require('path');var sox=require(_0xf21d('0x7'));var csv=require(_0xf21d('0x8'));var ejs=require(_0xf21d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf21d('0xa'));var crypto=require('crypto');var jsforce=require(_0xf21d('0xb'));var deskjs=require(_0xf21d('0xc'));var toCsv=require(_0xf21d('0x8'));var querystring=require(_0xf21d('0xd'));var Papa=require(_0xf21d('0xe'));var Redis=require(_0xf21d('0xf'));var authService=require(_0xf21d('0x10'));var qs=require(_0xf21d('0x11'));var as=require(_0xf21d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf21d('0x13'))(_0xf21d('0x14'));var utils=require(_0xf21d('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf21d('0x16'))['db'];function respondWithStatusCode(_0x128d2c,_0x36ea0e){_0x36ea0e=_0x36ea0e||0xcc;return function(_0x5119a5){if(_0x5119a5){return _0x128d2c[_0xf21d('0x17')](_0x36ea0e);}return _0x128d2c[_0xf21d('0x18')](_0x36ea0e)[_0xf21d('0x19')]();};}function respondWithResult(_0x461304,_0x2b4c79){_0x2b4c79=_0x2b4c79||0xc8;return function(_0x5c9817){if(_0x5c9817){return _0x461304[_0xf21d('0x18')](_0x2b4c79)[_0xf21d('0x1a')](_0x5c9817);}};}function respondWithFilteredResult(_0x39cefb,_0x1d304d){return function(_0x1f329f){if(_0x1f329f){var _0x1a9156=typeof _0x1d304d['offset']===_0xf21d('0x1b')&&typeof _0x1d304d[_0xf21d('0x1c')]===_0xf21d('0x1b');var _0x408549=_0x1f329f[_0xf21d('0x1d')];var _0xc2198f=_0x1a9156?0x0:_0x1d304d[_0xf21d('0x1e')];var _0x1d2b62=_0x1a9156?_0x1f329f[_0xf21d('0x1d')]:_0x1d304d['offset']+_0x1d304d[_0xf21d('0x1c')];var _0x2906e4;if(_0x1d2b62>=_0x408549){_0x1d2b62=_0x408549;_0x2906e4=0xc8;}else{_0x2906e4=0xce;}_0x39cefb[_0xf21d('0x18')](_0x2906e4);return _0x39cefb['set'](_0xf21d('0x1f'),_0xc2198f+'-'+_0x1d2b62+'/'+_0x408549)[_0xf21d('0x1a')](_0x1f329f);}return null;};}function patchUpdates(_0x82f351){return function(_0x296aef){try{jsonpatch[_0xf21d('0x20')](_0x296aef,_0x82f351,!![]);}catch(_0x1048ce){return BPromise[_0xf21d('0x21')](_0x1048ce);}return _0x296aef['save']();};}function saveUpdates(_0x55f8e4,_0x41cfa2){return function(_0x119ad7){if(_0x119ad7){return _0x119ad7[_0xf21d('0x22')](_0x55f8e4)[_0xf21d('0x23')](function(_0x27ea24){return _0x27ea24;});}return null;};}function removeEntity(_0x2fbef4,_0x2cd80a){return function(_0x6d17fe){if(_0x6d17fe){return _0x6d17fe[_0xf21d('0x24')]()[_0xf21d('0x23')](function(){_0x2fbef4['status'](0xcc)[_0xf21d('0x19')]();});}};}function handleEntityNotFound(_0x244753,_0x466758){return function(_0x583a22){if(!_0x583a22){_0x244753['sendStatus'](0x194);}return _0x583a22;};}function handleError(_0x1d9895,_0x480a8b){_0x480a8b=_0x480a8b||0x1f4;return function(_0x32dc82){logger[_0xf21d('0x25')](_0x32dc82[_0xf21d('0x26')]);if(_0x32dc82[_0xf21d('0x27')]){delete _0x32dc82['name'];}_0x1d9895[_0xf21d('0x18')](_0x480a8b)[_0xf21d('0x28')](_0x32dc82);};}exports['index']=function(_0xc7c68a,_0x586289){var _0x5ce4a9={},_0x24bcf6={},_0x47d05a={'count':0x0,'rows':[]};var _0x1f265e=_[_0xf21d('0x29')](db[_0xf21d('0x2a')]['rawAttributes'],function(_0x8e8b01){return{'name':_0x8e8b01[_0xf21d('0x2b')],'type':_0x8e8b01['type']['key']};});_0x24bcf6[_0xf21d('0x2c')]=_[_0xf21d('0x29')](_0x1f265e,_0xf21d('0x27'));_0x24bcf6[_0xf21d('0x2d')]=_[_0xf21d('0x2e')](_0xc7c68a[_0xf21d('0x2d')]);_0x24bcf6[_0xf21d('0x2f')]=_[_0xf21d('0x30')](_0x24bcf6[_0xf21d('0x2c')],_0x24bcf6[_0xf21d('0x2d')]);_0x5ce4a9[_0xf21d('0x31')]=_[_0xf21d('0x30')](_0x24bcf6[_0xf21d('0x2c')],qs['fields'](_0xc7c68a[_0xf21d('0x2d')][_0xf21d('0x32')]));_0x5ce4a9[_0xf21d('0x31')]=_0x5ce4a9[_0xf21d('0x31')][_0xf21d('0x33')]?_0x5ce4a9['attributes']:_0x24bcf6[_0xf21d('0x2c')];if(!_0xc7c68a['query'][_0xf21d('0x34')](_0xf21d('0x35'))){_0x5ce4a9[_0xf21d('0x1c')]=qs['limit'](_0xc7c68a[_0xf21d('0x2d')][_0xf21d('0x1c')]);_0x5ce4a9[_0xf21d('0x1e')]=qs['offset'](_0xc7c68a[_0xf21d('0x2d')][_0xf21d('0x1e')]);}_0x5ce4a9[_0xf21d('0x36')]=qs[_0xf21d('0x37')](_0xc7c68a[_0xf21d('0x2d')][_0xf21d('0x37')]);_0x5ce4a9['where']=qs[_0xf21d('0x2f')](_['pick'](_0xc7c68a['query'],_0x24bcf6['filters']),_0x1f265e);if(_0xc7c68a['query']['filter']){_0x5ce4a9[_0xf21d('0x38')]=_['merge'](_0x5ce4a9[_0xf21d('0x38')],{'$or':_[_0xf21d('0x29')](_0x1f265e,function(_0x541fea){if(_0x541fea[_0xf21d('0x39')]!==_0xf21d('0x3a')){var _0x237716={};_0x237716[_0x541fea[_0xf21d('0x27')]]={'$like':'%'+_0xc7c68a['query']['filter']+'%'};return _0x237716;}})});}_0x5ce4a9=_[_0xf21d('0x3b')]({},_0x5ce4a9,_0xc7c68a[_0xf21d('0x3c')]);var _0x30abed={'where':_0x5ce4a9[_0xf21d('0x38')]};return db[_0xf21d('0x2a')][_0xf21d('0x1d')](_0x30abed)[_0xf21d('0x23')](function(_0x303716){_0x47d05a[_0xf21d('0x1d')]=_0x303716;if(_0xc7c68a[_0xf21d('0x2d')][_0xf21d('0x3d')]){_0x5ce4a9[_0xf21d('0x3e')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x5ce4a9);})[_0xf21d('0x23')](function(_0x1428e9){_0x47d05a[_0xf21d('0x3f')]=_0x1428e9;return _0x47d05a;})[_0xf21d('0x23')](respondWithFilteredResult(_0x586289,_0x5ce4a9))[_0xf21d('0x40')](handleError(_0x586289,null));};exports['show']=function(_0x3907d6,_0x492ca9){var _0x1b4a9a={'raw':!![],'where':{'id':_0x3907d6['params']['id']}},_0x273b2c={};_0x273b2c[_0xf21d('0x2c')]=_['keys'](db[_0xf21d('0x2a')][_0xf21d('0x41')]);_0x273b2c[_0xf21d('0x2d')]=_[_0xf21d('0x2e')](_0x3907d6[_0xf21d('0x2d')]);_0x273b2c[_0xf21d('0x2f')]=_[_0xf21d('0x30')](_0x273b2c[_0xf21d('0x2c')],_0x273b2c[_0xf21d('0x2d')]);_0x1b4a9a[_0xf21d('0x31')]=_[_0xf21d('0x30')](_0x273b2c[_0xf21d('0x2c')],qs[_0xf21d('0x32')](_0x3907d6[_0xf21d('0x2d')][_0xf21d('0x32')]));_0x1b4a9a[_0xf21d('0x31')]=_0x1b4a9a[_0xf21d('0x31')]['length']?_0x1b4a9a[_0xf21d('0x31')]:_0x273b2c[_0xf21d('0x2c')];if(_0x3907d6['query'][_0xf21d('0x3d')]){_0x1b4a9a['include']=[{'all':!![]}];}_0x1b4a9a=_['merge']({},_0x1b4a9a,_0x3907d6[_0xf21d('0x3c')]);return db[_0xf21d('0x2a')][_0xf21d('0x42')](_0x1b4a9a)[_0xf21d('0x23')](handleEntityNotFound(_0x492ca9,null))[_0xf21d('0x23')](respondWithResult(_0x492ca9,null))['catch'](handleError(_0x492ca9,null));};exports['clone']=function(_0x3e63c9,_0x94adc3){var _0x2889da={'where':{'id':_0x3e63c9[_0xf21d('0x43')]['id']}},_0xd86cde={};_0xd86cde[_0xf21d('0x2c')]=_[_0xf21d('0x2e')](db[_0xf21d('0x2a')][_0xf21d('0x41')]);_0x2889da[_0xf21d('0x31')]=_[_0xf21d('0x30')](_0xd86cde[_0xf21d('0x2c')],qs[_0xf21d('0x32')](_0x3e63c9[_0xf21d('0x2d')]['fields']));_0x2889da[_0xf21d('0x31')]=_0x2889da[_0xf21d('0x31')][_0xf21d('0x33')]?_0x2889da['attributes']:_0xd86cde[_0xf21d('0x2c')];if(_0x3e63c9[_0xf21d('0x2d')][_0xf21d('0x3d')]){_0x2889da[_0xf21d('0x3e')]=[{'all':!![]}];}_0x2889da=_['merge']({},_0x2889da,_0x3e63c9[_0xf21d('0x3c')]);return db[_0xf21d('0x2a')][_0xf21d('0x42')](_0x2889da)['then'](handleEntityNotFound(_0x94adc3,null))[_0xf21d('0x23')](function(_0x116e68){if(_0x116e68){var _0x26917=_0x116e68[_0xf21d('0x44')]({'plain':!![]});_0x26917=qs[_0xf21d('0x45')](_0x26917,['id',_0xf21d('0x46'),'updatedAt']);_0x3e63c9[_0xf21d('0x47')]=_[_0xf21d('0x45')](_0x3e63c9[_0xf21d('0x47')],['id',_0xf21d('0x46'),_0xf21d('0x48')]);return db[_0xf21d('0x2a')][_0xf21d('0x49')](_[_0xf21d('0x3b')](_0x26917,_0x3e63c9[_0xf21d('0x47')]),{'include':_0x3e63c9[_0xf21d('0x2d')][_0xf21d('0x3d')]?[{'all':!![]}]:undefined});}})[_0xf21d('0x23')](respondWithResult(_0x94adc3,0xc9))['catch'](handleError(_0x94adc3,null));};exports[_0xf21d('0x22')]=function(_0x22afe8,_0x398473){if(_0x22afe8[_0xf21d('0x47')]['id']){delete _0x22afe8[_0xf21d('0x47')]['id'];}return db['Attachment'][_0xf21d('0x42')]({'where':{'id':_0x22afe8[_0xf21d('0x43')]['id']}})['then'](handleEntityNotFound(_0x398473,null))[_0xf21d('0x23')](saveUpdates(_0x22afe8[_0xf21d('0x47')],null))[_0xf21d('0x23')](respondWithResult(_0x398473,null))['catch'](handleError(_0x398473,null));};exports[_0xf21d('0x24')]=function(_0x155085,_0x53ece6){return db[_0xf21d('0x2a')]['find']({'where':{'id':_0x155085[_0xf21d('0x43')]['id']}})['then'](handleEntityNotFound(_0x53ece6,null))[_0xf21d('0x23')](removeEntity(_0x53ece6,null))[_0xf21d('0x40')](handleError(_0x53ece6,null));};exports[_0xf21d('0x49')]=function(_0x5410e9,_0x4121d7,_0x35181f){_0x5410e9['body'][_0xf21d('0x27')]=_0x5410e9['file'][_0xf21d('0x4a')];_0x5410e9[_0xf21d('0x47')][_0xf21d('0x4b')]=_0x5410e9[_0xf21d('0x4c')][_0xf21d('0x4d')];_0x5410e9['body'][_0xf21d('0x39')]=_0x5410e9[_0xf21d('0x4c')][_0xf21d('0x4e')];return db['Attachment'][_0xf21d('0x49')](_0x5410e9[_0xf21d('0x47')])[_0xf21d('0x23')](respondWithResult(_0x4121d7,0xc9))['catch'](handleError(_0x4121d7,null));};exports[_0xf21d('0x4f')]=function(_0x3d2099,_0x5b7ae0,_0x2e56a1){return db[_0xf21d('0x2a')][_0xf21d('0x50')]({'where':{'id':_0x3d2099[_0xf21d('0x43')]['id']},'raw':!![]})[_0xf21d('0x23')](handleEntityNotFound(_0x5b7ae0,null))[_0xf21d('0x23')](function(_0x4c92e2){if(_0x4c92e2){var _0x46681a=_0x4c92e2[_0xf21d('0x51')]!==null;var _0x37ced4=path[_0xf21d('0x52')](config[_0xf21d('0x53')],_0xf21d('0x54'));if(_0x46681a){_0x37ced4=path['join'](_0x37ced4,_0xf21d('0x55'));}var _0xc26a45=path[_0xf21d('0x52')](_0x37ced4,_0x4c92e2['basename']);return _0x5b7ae0[_0xf21d('0x4f')](_0xc26a45);}})[_0xf21d('0x40')](handleError(_0x5b7ae0,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index a2b6821..5939c91 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 _0x07f1=['request-promise','../../config/environment','./attachment.attributes','exports','define','attachments','util','../../config/logger','api','bluebird'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x07f1,0xb0));var _0x107f=function(_0x4c065c,_0x37a698){_0x4c065c=_0x4c065c-0x0;var _0x175d98=_0x07f1[_0x4c065c];return _0x175d98;};'use strict';var _=require('lodash');var util=require(_0x107f('0x0'));var logger=require(_0x107f('0x1'))(_0x107f('0x2'));var moment=require('moment');var BPromise=require(_0x107f('0x3'));var rp=require(_0x107f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x107f('0x5'));var attributes=require(_0x107f('0x6'));module[_0x107f('0x7')]=function(_0x15c987,_0x25118d){return _0x15c987[_0x107f('0x8')]('Attachment',attributes,{'tableName':_0x107f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2bc5=['exports','define','attachments','lodash','util','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x2bc5,0x1bb));var _0x52bc=function(_0x21d0c3,_0x16c71c){_0x21d0c3=_0x21d0c3-0x0;var _0x4df18e=_0x2bc5[_0x21d0c3];return _0x4df18e;};'use strict';var _=require(_0x52bc('0x0'));var util=require(_0x52bc('0x1'));var logger=require('../../config/logger')(_0x52bc('0x2'));var moment=require(_0x52bc('0x3'));var BPromise=require(_0x52bc('0x4'));var rp=require(_0x52bc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x52bc('0x6'));var attributes=require('./attachment.attributes');module[_0x52bc('0x7')]=function(_0x263aa1,_0x173cf6){return _0x263aa1[_0x52bc('0x8')]('Attachment',attributes,{'tableName':_0x52bc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index de9bef8..9676c83 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 _0x4c4e=['request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateAttachment','create','body','options','then','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','Attachment,\x20%s,\x20%s'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x4c4e,0x152));var _0xe4c4=function(_0x2a412d,_0x299bda){_0x2a412d=_0x2a412d-0x0;var _0x3ec235=_0x4c4e[_0x2a412d];return _0x3ec235;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var moment=require(_0xe4c4('0x1'));var BPromise=require(_0xe4c4('0x2'));var rs=require(_0xe4c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4c4('0x4'))['db'];var utils=require(_0xe4c4('0x5'));var logger=require(_0xe4c4('0x6'))('rpc');var config=require(_0xe4c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe4c4('0x8')][_0xe4c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x262b64,_0xad105,_0x22085a){return new BPromise(function(_0x329d29,_0x28a42e){return client[_0xe4c4('0xa')](_0x262b64,_0x22085a)['then'](function(_0x589b2e){logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));logger[_0xe4c4('0xe')](_0xe4c4('0xf'),_0xad105,_0xe4c4('0xd'),JSON['stringify'](_0x589b2e));if(_0x589b2e[_0xe4c4('0x10')]){if(_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x11')]===0x1f4){logger[_0xe4c4('0x10')]('Attachment,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x28a42e(_0x589b2e['error'][_0xe4c4('0x12')]);}logger[_0xe4c4('0x10')]('Attachment,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x329d29(_0x589b2e['error'][_0xe4c4('0x12')]);}else{logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));_0x329d29(_0x589b2e[_0xe4c4('0x13')][_0xe4c4('0x12')]);}})[_0xe4c4('0x14')](function(_0x1038cb){logger[_0xe4c4('0x10')](_0xe4c4('0xc'),_0xad105,_0x1038cb);_0x28a42e(_0x1038cb);});});}exports[_0xe4c4('0x15')]=function(_0x42242c){var _0x3820c7=this;return new Promise(function(_0x43a9ce,_0x376585){return db['Attachment'][_0xe4c4('0x16')](_0x42242c[_0xe4c4('0x17')],{'raw':_0x42242c[_0xe4c4('0x18')]?_0x42242c[_0xe4c4('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xe4c4('0x19')](function(_0x1cad5d){logger[_0xe4c4('0xb')](_0xe4c4('0x15'),_0x42242c);logger[_0xe4c4('0xe')](_0xe4c4('0x15'),_0x42242c,JSON[_0xe4c4('0x1a')](_0x1cad5d));_0x43a9ce(_0x1cad5d);})[_0xe4c4('0x14')](function(_0x21bbb1){logger[_0xe4c4('0x10')](_0xe4c4('0x15'),_0x21bbb1[_0xe4c4('0x12')],_0x42242c);_0x376585(_0x3820c7[_0xe4c4('0x10')](0x1f4,_0x21bbb1[_0xe4c4('0x12')]));});});}; \ No newline at end of file +var _0x9b9b=['create','body','options','raw','then','debug','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment'];(function(_0x7230b5,_0x4020a1){var _0x10e25d=function(_0x12c068){while(--_0x12c068){_0x7230b5['push'](_0x7230b5['shift']());}};_0x10e25d(++_0x4020a1);}(_0x9b9b,0x114));var _0xb9b9=function(_0x124728,_0x463dca){_0x124728=_0x124728-0x0;var _0x8eb20f=_0x9b9b[_0x124728];return _0x8eb20f;};'use strict';var _=require('lodash');var util=require(_0xb9b9('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb9b9('0x1'));var fs=require('fs');var Redis=require(_0xb9b9('0x2'));var db=require(_0xb9b9('0x3'))['db'];var utils=require(_0xb9b9('0x4'));var logger=require(_0xb9b9('0x5'))(_0xb9b9('0x6'));var config=require(_0xb9b9('0x7'));var jayson=require(_0xb9b9('0x8'));var client=jayson[_0xb9b9('0x9')][_0xb9b9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x85eec,_0x3ef9c1,_0x5be5bc){return new BPromise(function(_0x297cb6,_0x222cba){return client[_0xb9b9('0xb')](_0x85eec,_0x5be5bc)['then'](function(_0x4a645a){logger[_0xb9b9('0xc')](_0xb9b9('0xd'),_0x3ef9c1,_0xb9b9('0xe'));logger['debug'](_0xb9b9('0xf'),_0x3ef9c1,_0xb9b9('0xe'),JSON[_0xb9b9('0x10')](_0x4a645a));if(_0x4a645a['error']){if(_0x4a645a[_0xb9b9('0x11')][_0xb9b9('0x12')]===0x1f4){logger[_0xb9b9('0x11')](_0xb9b9('0xd'),_0x3ef9c1,_0x4a645a[_0xb9b9('0x11')][_0xb9b9('0x13')]);return _0x222cba(_0x4a645a['error']['message']);}logger[_0xb9b9('0x11')]('Attachment,\x20%s,\x20%s',_0x3ef9c1,_0x4a645a[_0xb9b9('0x11')]['message']);return _0x297cb6(_0x4a645a[_0xb9b9('0x11')][_0xb9b9('0x13')]);}else{logger[_0xb9b9('0xc')](_0xb9b9('0xd'),_0x3ef9c1,_0xb9b9('0xe'));_0x297cb6(_0x4a645a[_0xb9b9('0x14')][_0xb9b9('0x13')]);}})[_0xb9b9('0x15')](function(_0x4ae8e6){logger[_0xb9b9('0x11')]('Attachment,\x20%s,\x20%s',_0x3ef9c1,_0x4ae8e6);_0x222cba(_0x4ae8e6);});});}exports[_0xb9b9('0x16')]=function(_0x3e6d23){var _0x3a2fed=this;return new Promise(function(_0x11bb05,_0x49b412){return db[_0xb9b9('0x17')][_0xb9b9('0x18')](_0x3e6d23[_0xb9b9('0x19')],{'raw':_0x3e6d23[_0xb9b9('0x1a')]?_0x3e6d23[_0xb9b9('0x1a')][_0xb9b9('0x1b')]===undefined?!![]:![]:!![]})[_0xb9b9('0x1c')](function(_0x3d0edb){logger[_0xb9b9('0xc')](_0xb9b9('0x16'),_0x3e6d23);logger[_0xb9b9('0x1d')](_0xb9b9('0x16'),_0x3e6d23,JSON[_0xb9b9('0x10')](_0x3d0edb));_0x11bb05(_0x3d0edb);})['catch'](function(_0x10b7e1){logger[_0xb9b9('0x11')](_0xb9b9('0x16'),_0x10b7e1['message'],_0x3e6d23);_0x49b412(_0x3a2fed[_0xb9b9('0x11')](0x1f4,_0x10b7e1[_0xb9b9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 52ab653..2918eb0 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(_0x2ae2ad,_0xac5b0c){var _0x26dbd7=function(_0x5e685b){while(--_0x5e685b){_0x2ae2ad['push'](_0x2ae2ad['shift']());}};_0x26dbd7(++_0xac5b0c);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5f66[_0x3ab9ee];return _0x82ee88;};'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(_0x2b7603,_0x1bc785){var _0x410cfd=function(_0x2918cb){while(--_0x2918cb){_0x2b7603['push'](_0x2b7603['shift']());}};_0x410cfd(++_0x1bc785);}(_0xb10b,0x12a));var _0xbb10=function(_0x2f2601,_0x10b8be){_0x2f2601=_0x2f2601-0x0;var _0x3c6e6=_0xb10b[_0x2f2601];return _0x3c6e6;};'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 e7d7956..cb3cc8b 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 _0x9957=['disabled','add','minutes','clearBlockUser','getLicense','catch','login','ad-local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','ad-login','User','passport','passport-local','Strategy','moment','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/logger','api','activedirectory','undefined','baseDN','domain','authenticate','log','adAuthenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','settings','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','salt','blocked','blockedAt','user','name','then','res'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var passport=require(_0x7995('0x0'));var LocalStrategy=require(_0x7995('0x1'))[_0x7995('0x2')];var moment=require(_0x7995('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var authService=require(_0x7995('0x6'));var utils=require(_0x7995('0x7'));var config=require('../../config/environment');var logger=require(_0x7995('0x8'))(_0x7995('0x9'));function isActiveDirectoryConfigured(_0x137b6b){var _0x219534=![];if(typeof _0x137b6b[_0x7995('0xa')]!==_0x7995('0xb')){_0x219534=_0x137b6b['activedirectory'][_0x7995('0xc')]&&_0x137b6b[_0x7995('0xa')]['url']&&_0x137b6b[_0x7995('0xa')][_0x7995('0xd')];}return _0x219534;}function adAuthenticate(_0x18c8a3,_0x35b5fe,_0x3c1d19){return new BPromise(function(_0x1e400a,_0x341672){try{var _0x524f7b=new ActiveDirectory(_0x18c8a3);_0x524f7b[_0x7995('0xe')](_0x35b5fe,_0x3c1d19,function(_0x41c652,_0x581f22){console[_0x7995('0xf')](_0x7995('0x10'),_0x41c652,_0x581f22);if(_0x41c652){_0x341672(_0x41c652);}else if(!_0x581f22){_0x341672(_0x7995('0x11'));}else{_0x1e400a(_0x581f22);}});}catch(_0x385f00){_0x341672(_0x385f00);}});}function ActiveDirectoryAuthenticate(_0x281576,_0x23999f,_0x2bbe7a,_0x4cc004){var _0x58f5ad,_0x2b4e94;if(!isActiveDirectoryConfigured(config)){logger[_0x7995('0x12')](_0x7995('0x13'),_0x23999f);return _0x4cc004(null,![],{'message':_0x7995('0x11')});}return db[_0x7995('0x14')][_0x7995('0x15')]({'where':{'id':0x1},'attributes':[_0x7995('0x16'),_0x7995('0x17')],'raw':!![]})['then'](function(_0x2eeacc){console['log'](_0x7995('0x18'),_0x2eeacc);_0x58f5ad=_0x2eeacc;if(!_0x58f5ad[_0x7995('0x16')]){logger[_0x7995('0x12')](_0x7995('0x19'),_0x23999f);throw new Error(_0x7995('0x11'));}return _0x281576[_0x7995('0x15')]({'attributes':['id','name','password',_0x7995('0x1a'),'role','disabled',_0x7995('0x1b'),_0x7995('0x1c')],'where':{'name':_0x23999f,'role':{'$or':['admin',_0x7995('0x1d'),'agent']},'adSsoEnabled':!![]}});})['then'](function(_0x3e4c54){console[_0x7995('0xf')](_0x7995('0x1d'),_0x3e4c54);if(!_0x3e4c54||_0x3e4c54&&_0x3e4c54[_0x7995('0x1e')]!==_0x23999f){throw new Error(_0x7995('0x11'));}_0x2b4e94=_0x3e4c54;var _0x1c278a=_0x2b4e94['name']+'@'+config[_0x7995('0xa')][_0x7995('0xd')];return adAuthenticate(config[_0x7995('0xa')],_0x1c278a,_0x2bbe7a);})[_0x7995('0x1f')](function(_0x563799){console[_0x7995('0xf')](_0x7995('0x20'),_0x563799);if(_0x2b4e94[_0x7995('0x21')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x58f5ad[_0x7995('0x17')]>0x0){if(_0x2b4e94[_0x7995('0x1b')]){if(moment(_0x2b4e94[_0x7995('0x1c')])[_0x7995('0x22')](_0x58f5ad[_0x7995('0x17')],_0x7995('0x23'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x7995('0x24')](_0x2b4e94,0x0,![],null)['then'](function(){return utils[_0x7995('0x25')](_0x2b4e94);})[_0x7995('0x1f')](function(){return _0x4cc004(null,_0x2b4e94);});}else{return utils[_0x7995('0x25')](_0x2b4e94)[_0x7995('0x1f')](function(){return _0x4cc004(null,_0x2b4e94);});}}else{return utils[_0x7995('0x25')](_0x2b4e94)['then'](function(){return _0x4cc004(null,_0x2b4e94);});}})[_0x7995('0x26')](function(_0x514445){return _0x4cc004(null,![],_0x514445);});}function handleError(_0x456a28,_0x3250e0,_0x4253e5){return _0x456a28['status'](_0x3250e0||0x1f4)['send']({'message':_0x4253e5?_0x4253e5['message']||_0x4253e5:''});}exports[_0x7995('0x27')]=function(_0xe6b0b3,_0x327a81,_0x2b874d){passport[_0x7995('0xe')](_0x7995('0x28'),function(_0x538841,_0x481c74,_0xfa8f15){console['log'](_0x7995('0x27'),_0x538841,_0x481c74,_0xfa8f15);var _0x3eb566=_0x538841||_0xfa8f15;if(_0x3eb566){return handleError(_0x327a81,0x191,_0x3eb566);}if(!_0x481c74){return handleError(_0x327a81,0x194,{'message':_0x7995('0x29')});}else{var _0x1e9fa4={'payload':{'id':_0x481c74['id'],'role':_0x481c74[_0x7995('0x2a')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1e9fa4)[_0x7995('0x1f')](function(_0x33e24e){_0x327a81['json']({'id':_0x481c74['id'],'token':_0x33e24e,'statusCall':'','isAlreadyLogged':_0x481c74['online']});});}})(_0xe6b0b3,_0x327a81,_0x2b874d);};passport['use'](_0x7995('0x2b'),new LocalStrategy({'usernameField':_0x7995('0x1e'),'passwordField':'password'},function(_0x3e7020,_0x51b95d,_0x37917b){return ActiveDirectoryAuthenticate(db[_0x7995('0x2c')],_0x3e7020,_0x51b95d,_0x37917b);})); \ No newline at end of file +var _0x4521=['User','passport','passport-local','moment','activedirectory2','bluebird','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','baseDN','url','domain','adAuthenticate','error','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','adSsoEnabled','blockDuration','then','log','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role','blocked','user','agent','disabled','blockedAt','add','minutes','getLicense','catch','status','send','message','authenticate','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','ad-login'];(function(_0x44d943,_0x105d2d){var _0x7aef84=function(_0x40a71a){while(--_0x40a71a){_0x44d943['push'](_0x44d943['shift']());}};_0x7aef84(++_0x105d2d);}(_0x4521,0x151));var _0x1452=function(_0x53560b,_0x24213a){_0x53560b=_0x53560b-0x0;var _0x287094=_0x4521[_0x53560b];return _0x287094;};'use strict';var passport=require(_0x1452('0x0'));var LocalStrategy=require(_0x1452('0x1'))['Strategy'];var moment=require(_0x1452('0x2'));var ActiveDirectory=require(_0x1452('0x3'));var BPromise=require(_0x1452('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0x1452('0x5'));var utils=require(_0x1452('0x6'));var config=require(_0x1452('0x7'));var logger=require(_0x1452('0x8'))(_0x1452('0x9'));function isActiveDirectoryConfigured(_0x5ecb52){var _0x3c85c1=![];if(typeof _0x5ecb52[_0x1452('0xa')]!=='undefined'){_0x3c85c1=_0x5ecb52[_0x1452('0xa')][_0x1452('0xb')]&&_0x5ecb52['activedirectory'][_0x1452('0xc')]&&_0x5ecb52['activedirectory'][_0x1452('0xd')];}return _0x3c85c1;}function adAuthenticate(_0x1617ea,_0x648495,_0x2d7813){return new BPromise(function(_0x576d45,_0x48d3f3){try{var _0x5c84cb=new ActiveDirectory(_0x1617ea);_0x5c84cb['authenticate'](_0x648495,_0x2d7813,function(_0x1c45b0,_0xc54d26){console['log'](_0x1452('0xe'),_0x1c45b0,_0xc54d26);if(_0x1c45b0){_0x48d3f3(_0x1c45b0);}else if(!_0xc54d26){_0x48d3f3('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x576d45(_0xc54d26);}});}catch(_0x1ad97b){_0x48d3f3(_0x1ad97b);}});}function ActiveDirectoryAuthenticate(_0x440d0b,_0xc3aead,_0x494d84,_0x4feae8){var _0x34f592,_0x3b304d;if(!isActiveDirectoryConfigured(config)){logger[_0x1452('0xf')](_0x1452('0x10'),_0xc3aead);return _0x4feae8(null,![],{'message':_0x1452('0x11')});}return db[_0x1452('0x12')][_0x1452('0x13')]({'where':{'id':0x1},'attributes':[_0x1452('0x14'),_0x1452('0x15')],'raw':!![]})[_0x1452('0x16')](function(_0x5f25df){console[_0x1452('0x17')]('settings',_0x5f25df);_0x34f592=_0x5f25df;if(!_0x34f592['adSsoEnabled']){logger[_0x1452('0xf')](_0x1452('0x18'),_0xc3aead);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x440d0b['findOne']({'logging':!![],'attributes':['id',_0x1452('0x19'),_0x1452('0x1a'),'salt',_0x1452('0x1b'),'disabled',_0x1452('0x1c'),'blockedAt'],'where':{'name':_0xc3aead,'role':{'$or':['admin',_0x1452('0x1d'),_0x1452('0x1e')]},'adSsoEnabled':!![]}});})[_0x1452('0x16')](function(_0x196a8c){console[_0x1452('0x17')](_0x1452('0x1d'),_0x196a8c);if(!_0x196a8c||_0x196a8c&&_0x196a8c[_0x1452('0x19')]!==_0xc3aead){throw new Error(_0x1452('0x11'));}_0x3b304d=_0x196a8c;var _0x18587e=_0x3b304d[_0x1452('0x19')]+'@'+config[_0x1452('0xa')]['domain'];return adAuthenticate(config[_0x1452('0xa')],_0x18587e,_0x494d84);})['then'](function(_0x33a9a1){console[_0x1452('0x17')]('res',_0x33a9a1);if(_0x3b304d[_0x1452('0x1f')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x34f592[_0x1452('0x15')]>0x0){if(_0x3b304d[_0x1452('0x1c')]){if(moment(_0x3b304d[_0x1452('0x20')])[_0x1452('0x21')](_0x34f592[_0x1452('0x15')],_0x1452('0x22'))>moment()){throw new Error(_0x1452('0x11'));}return utils['clearBlockUser'](_0x3b304d,0x0,![],null)[_0x1452('0x16')](function(){return utils[_0x1452('0x23')](_0x3b304d);})[_0x1452('0x16')](function(){return _0x4feae8(null,_0x3b304d);});}else{return utils[_0x1452('0x23')](_0x3b304d)[_0x1452('0x16')](function(){return _0x4feae8(null,_0x3b304d);});}}else{return utils[_0x1452('0x23')](_0x3b304d)[_0x1452('0x16')](function(){return _0x4feae8(null,_0x3b304d);});}})[_0x1452('0x24')](function(_0x196a9f){return _0x4feae8(null,![],_0x196a9f);});}function handleError(_0x39f6ff,_0x2b94ec,_0x132fd8){return _0x39f6ff[_0x1452('0x25')](_0x2b94ec||0x1f4)[_0x1452('0x26')]({'message':_0x132fd8?_0x132fd8[_0x1452('0x27')]||_0x132fd8:''});}exports['login']=function(_0x6b7ba6,_0x16332f,_0xc00445){passport[_0x1452('0x28')]('ad-login',function(_0x1bcd8d,_0x59ca7f,_0x1862e8){console[_0x1452('0x17')](_0x1452('0x29'),_0x1bcd8d,_0x59ca7f,_0x1862e8);var _0x32f612=_0x1bcd8d||_0x1862e8;if(_0x32f612){return handleError(_0x16332f,0x191,_0x32f612);}if(!_0x59ca7f){return handleError(_0x16332f,0x194,{'message':_0x1452('0x2a')});}else{var _0x25b0b5={'payload':{'id':_0x59ca7f['id'],'role':_0x59ca7f['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x25b0b5)[_0x1452('0x16')](function(_0xe5cd39){_0x16332f[_0x1452('0x2b')]({'id':_0x59ca7f['id'],'token':_0xe5cd39,'statusCall':'','isAlreadyLogged':_0x59ca7f[_0x1452('0x2c')]});});}})(_0x6b7ba6,_0x16332f,_0xc00445);};passport[_0x1452('0x2d')](_0x1452('0x2e'),new LocalStrategy({'usernameField':_0x1452('0x19'),'passwordField':_0x1452('0x1a')},function(_0xe00b29,_0x39e3bc,_0x4163bf){return ActiveDirectoryAuthenticate(db[_0x1452('0x2f')],_0xe00b29,_0x39e3bc,_0x4163bf);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 7369fa9..dfe7ff9 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 _0xadb1=['post','exports','express','./authActiveDirectory.controller'];(function(_0x213361,_0x3a2ff3){var _0x5d82ee=function(_0x22d073){while(--_0x22d073){_0x213361['push'](_0x213361['shift']());}};_0x5d82ee(++_0x3a2ff3);}(_0xadb1,0xe2));var _0x1adb=function(_0x119bb6,_0x5a33ea){_0x119bb6=_0x119bb6-0x0;var _0x54daa5=_0xadb1[_0x119bb6];return _0x54daa5;};'use strict';var express=require(_0x1adb('0x0'));var router=express['Router']();var controller=require(_0x1adb('0x1'));router[_0x1adb('0x2')]('/',controller['login']);module[_0x1adb('0x3')]=router; \ No newline at end of file +var _0x760b=['post','login','express','Router','./authActiveDirectory.controller'];(function(_0x4be09e,_0x1fc541){var _0x14f0fe=function(_0x55cc23){while(--_0x55cc23){_0x4be09e['push'](_0x4be09e['shift']());}};_0x14f0fe(++_0x1fc541);}(_0x760b,0x14c));var _0xb760=function(_0x623d1f,_0x25782b){_0x623d1f=_0x623d1f-0x0;var _0x41d02e=_0x760b[_0x623d1f];return _0x41d02e;};'use strict';var express=require(_0xb760('0x0'));var router=express[_0xb760('0x1')]();var controller=require(_0xb760('0x2'));router[_0xb760('0x3')]('/',controller[_0xb760('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 3cc9a7e..4271f7f 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 _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x5eae84,_0x193d5e){var _0x5b44cc=function(_0x501640){while(--_0x501640){_0x5eae84['push'](_0x5eae84['shift']());}};_0x5b44cc(++_0x193d5e);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +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(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x7a54,0x106));var _0x47a5=function(_0x4b7205,_0x228c77){_0x4b7205=_0x4b7205-0x0;var _0x104499=_0x7a54[_0x4b7205];return _0x104499;};'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 e460ad8..299b413 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 _0x9981=['login','/callback','isMiddleware','setTokenCookie','exports','Router','get'];(function(_0x36db65,_0x2b4af1){var _0x5bea6a=function(_0x513889){while(--_0x513889){_0x36db65['push'](_0x36db65['shift']());}};_0x5bea6a(++_0x2b4af1);}(_0x9981,0x163));var _0x1998=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9981[_0x2b7764];return _0x848dcb;};'use strict';var express=require('express');var passport=require('passport');var router=express[_0x1998('0x0')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0x1998('0x1')]('/',controller[_0x1998('0x2')]);router[_0x1998('0x1')](_0x1998('0x3'),controller['callback'],authService[_0x1998('0x4')],userController['login'],authService[_0x1998('0x5')]);module[_0x1998('0x6')]=router; \ No newline at end of file +var _0x60b8=['../user/user.controller.js','../../components/auth/service','get','login','callback','isMiddleware','exports','express','./authGoogle.controller'];(function(_0x42bdc2,_0x13ffc9){var _0x1a36c7=function(_0xd52c94){while(--_0xd52c94){_0x42bdc2['push'](_0x42bdc2['shift']());}};_0x1a36c7(++_0x13ffc9);}(_0x60b8,0x1e4));var _0x860b=function(_0x1f5db0,_0x1ce78c){_0x1f5db0=_0x1f5db0-0x0;var _0x55464d=_0x60b8[_0x1f5db0];return _0x55464d;};'use strict';var express=require(_0x860b('0x0'));var passport=require('passport');var router=express['Router']();var controller=require(_0x860b('0x1'));var userController=require(_0x860b('0x2'));var authService=require(_0x860b('0x3'));router[_0x860b('0x4')]('/',controller[_0x860b('0x5')]);router['get']('/callback',controller[_0x860b('0x6')],authService[_0x860b('0x7')],userController[_0x860b('0x5')],authService['setTokenCookie']);module[_0x860b('0x8')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index e1e1ceb..37e4c6d 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 _0x89c1=['passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','Password\x20reset!','use','passport','passport-local','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','salt','disabled','blocked','loginAttempts','admin','user','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockedAt','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','authentication','auth','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','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','enforcePasswordHistory'];(function(_0x1553d0,_0x1f7093){var _0xd35bcd=function(_0x551d07){while(--_0x551d07){_0x1553d0['push'](_0x1553d0['shift']());}};_0xd35bcd(++_0x1f7093);}(_0x89c1,0x10b));var _0x189c=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x89c1[_0x17d9e3];return _0x14192d;};'use strict';var util=require('util');var passport=require(_0x189c('0x0'));var LocalStrategy=require(_0x189c('0x1'))[_0x189c('0x2')];var jayson=require(_0x189c('0x3'));var _=require('lodash');var rs=require(_0x189c('0x4'));var moment=require(_0x189c('0x5'));var db=require(_0x189c('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x189c('0x7'));var client=jayson['client'][_0x189c('0x8')]({'port':0x232b});function localAuthenticate(_0x23b81a,_0x5e19ac,_0x4c4518,_0x42ce09){var _0x2d6252,_0x2dae24;return db[_0x189c('0x9')][_0x189c('0xa')]({'where':{'id':0x1},'attributes':[_0x189c('0xb'),_0x189c('0xc')],'raw':!![]})['then'](function(_0x240aa4){_0x2d6252=_0x240aa4;return _0x23b81a[_0x189c('0xa')]({'attributes':['id',_0x189c('0xd'),'password',_0x189c('0xe'),'role',_0x189c('0xf'),_0x189c('0x10'),'blockedAt',_0x189c('0x11')],'where':{'name':_0x5e19ac,'role':{'$or':[_0x189c('0x12'),_0x189c('0x13'),'agent']}}});})[_0x189c('0x14')](function(_0x5dc272){if(!_0x5dc272||_0x5dc272&&_0x5dc272['name']!==_0x5e19ac){throw new Error(_0x189c('0x15'));}else{_0x2dae24=_0x5dc272;return _0x2dae24;}})[_0x189c('0x14')](function(){_0x2dae24[_0x189c('0x16')](_0x4c4518,function(_0x575734,_0x35fad2){var _0x26f163=_0x2dae24['loginAttempts']+0x1;if(_0x575734){return _0x42ce09(_0x575734);}else if(!_0x35fad2){if(_0x2dae24['disabled']){return _0x42ce09(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2d6252['allowedLoginAttempts']>0x0){if(_0x2dae24['blocked']){if(_0x2d6252[_0x189c('0xc')]>0x0){if(moment(_0x2dae24[_0x189c('0x17')])[_0x189c('0x18')](_0x2d6252[_0x189c('0xc')],_0x189c('0x19'))>moment()){return _0x42ce09(null,![],{'message':_0x189c('0x15')});}else{return utils['clearBlockUser'](_0x2dae24,_0x26f163,![],null)['then'](function(){return _0x42ce09(null,![],{'message':_0x189c('0x15')});});}}else{return _0x42ce09(null,![],{'message':_0x189c('0x15')});}}else{if(_0x26f163>=_0x2d6252[_0x189c('0xb')]){return utils[_0x189c('0x1a')](_0x2dae24,0x0,!![],moment())[_0x189c('0x14')](function(){return _0x42ce09(null,![],{'message':_0x189c('0x15')});});}else{return utils[_0x189c('0x1a')](_0x2dae24,_0x26f163,![],null)[_0x189c('0x14')](function(){return _0x42ce09(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x42ce09(null,![],{'message':_0x189c('0x15')});}}else{if(_0x2dae24[_0x189c('0xf')]){return _0x42ce09(null,![],{'message':_0x189c('0x15')});}else if(_0x2d6252['allowedLoginAttempts']>0x0){if(_0x2dae24[_0x189c('0x10')]){if(_0x2d6252[_0x189c('0xc')]>0x0){if(moment(_0x2dae24[_0x189c('0x17')])['add'](_0x2d6252[_0x189c('0xc')],_0x189c('0x19'))>moment()){return _0x42ce09(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x189c('0x1a')](_0x2dae24,0x0,![],null)['then'](function(){return utils[_0x189c('0x1b')](_0x2dae24);})[_0x189c('0x14')](function(){return _0x42ce09(null,_0x2dae24);});}}else{return _0x42ce09(null,![],{'message':_0x189c('0x15')});}}else{return utils[_0x189c('0x1a')](_0x2dae24,0x0,![],null)[_0x189c('0x14')](function(){return utils[_0x189c('0x1b')](_0x2dae24);})[_0x189c('0x14')](function(){return _0x42ce09(null,_0x2dae24);})[_0x189c('0x1c')](function(_0x2c6abb){return _0x42ce09(null,![],_0x2c6abb);});}}else{if(_0x2dae24[_0x189c('0x10')]){return _0x42ce09(null,![],{'message':_0x189c('0x15')});}else{return utils[_0x189c('0x1b')](_0x2dae24)[_0x189c('0x14')](function(){return _0x42ce09(null,_0x2dae24);});}}}});})[_0x189c('0x1c')](function(_0x3a0555){return _0x42ce09(null,![],_0x3a0555);});}function sendServiceMail(_0x3693c7){return db[_0x189c('0x1d')][_0x189c('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x189c('0xd'),_0x189c('0x1f')],'include':[{'model':db[_0x189c('0x20')],'as':_0x189c('0x21')}]})['then'](function(_0x479396){if(!_0x479396){throw new Error(_0x189c('0x22'));}var _0x4f2dd0={'tls':{'rejectUnauthorized':![]}};if(_0x479396[_0x189c('0x21')][_0x189c('0x23')]){_0x4f2dd0['service']=_0x479396[_0x189c('0x21')][_0x189c('0x23')];}else{_0x4f2dd0[_0x189c('0x24')]=_0x479396['Smtp']['host'];_0x4f2dd0[_0x189c('0x25')]=_0x479396[_0x189c('0x21')]['port'];_0x4f2dd0['secure']=_0x479396[_0x189c('0x21')]['secure'];}if(_0x479396[_0x189c('0x21')][_0x189c('0x26')]){_0x4f2dd0[_0x189c('0x27')]={'user':_0x479396[_0x189c('0x21')][_0x189c('0x13')],'pass':_0x479396[_0x189c('0x21')]['pass']};}var _0x184fc6={'account':_0x4f2dd0,'message':_[_0x189c('0x28')]({'from':util[_0x189c('0x29')](_0x189c('0x2a'),_0x479396[_0x189c('0xd')],_0x479396[_0x189c('0x1f')]||_0x479396[_0x189c('0x21')]['user'])},_0x3693c7)};return client[_0x189c('0x2b')](_0x189c('0x2c'),_0x184fc6);})[_0x189c('0x14')](function(_0xb19eac){if(_0xb19eac[_0x189c('0x2d')]){throw new Error(util[_0x189c('0x29')](_0x189c('0x2e'),_0xb19eac['error']['message']||JSON[_0x189c('0x2f')](_0xb19eac['error'])));}return!![];});}function handleError(_0x57eaff,_0x5d8147,_0x1fc0ff){return _0x57eaff[_0x189c('0x30')](_0x5d8147||0x1f4)[_0x189c('0x31')]({'message':_0x1fc0ff?_0x1fc0ff['message']||_0x1fc0ff:''});}exports[_0x189c('0x32')]=function(_0x4a1c4b,_0x327b41,_0x5b8480){passport[_0x189c('0x16')](_0x189c('0x33'),function(_0x53dec0,_0x198362,_0x16c9bc){var _0x44098e=_0x53dec0||_0x16c9bc;if(_0x44098e){return handleError(_0x327b41,0x191,_0x44098e);}if(!_0x198362){return handleError(_0x327b41,0x194,{'message':_0x189c('0x34')});}else{var _0x1c6682={'payload':{'id':_0x198362['id'],'role':_0x198362[_0x189c('0x35')]},'options':{'expiresIn':0x15180}};return authService[_0x189c('0x36')](_0x1c6682)[_0x189c('0x14')](function(_0x218ec1){_0x327b41[_0x189c('0x37')]({'id':_0x198362['id'],'token':_0x218ec1,'statusCall':'','isAlreadyLogged':_0x198362[_0x189c('0x38')]});});}})(_0x4a1c4b,_0x327b41,_0x5b8480);};exports[_0x189c('0x39')]=function(_0x58f196,_0x6f3e7a,_0xa46ef1){if(!_0x58f196[_0x189c('0x3a')]['email']){return handleError(_0x6f3e7a,0x1f4,{'message':_0x189c('0x3b')});}var _0x516952=rs[_0x189c('0x3c')]();_0x58f196['body'][_0x189c('0x1f')]=_0x58f196['body'][_0x189c('0x1f')][_0x189c('0x3d')]()[_0x189c('0x3e')]();var _0x4f50dc;return db['Setting'][_0x189c('0xa')]({'where':{'id':0x1},'attributes':[_0x189c('0xb'),'blockDuration'],'raw':!![]})[_0x189c('0x14')](function(_0xd3429d){_0x4f50dc=_0xd3429d;return db[_0x189c('0x3f')][_0x189c('0x1e')]({'where':{'email':_0x58f196['body'][_0x189c('0x1f')]}});})[_0x189c('0x14')](function(_0x18072f){if(!_0x18072f){throw new Error(_0x189c('0x40'));}if(_0x18072f['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x18072f[_0x189c('0x10')]){if(moment(_0x18072f[_0x189c('0x17')])['add'](_0x4f50dc[_0x189c('0xc')],'minutes')>moment()){throw new Error(_0x189c('0x41'));}else{_0x18072f[_0x189c('0x10')]=![];_0x18072f[_0x189c('0x17')]=null;}}_0x18072f[_0x189c('0x42')]=_0x516952;_0x18072f[_0x189c('0x43')]=Date[_0x189c('0x44')]()+0x36ee80;return _0x18072f[_0x189c('0x45')]();})[_0x189c('0x14')](function(){return sendServiceMail({'to':_0x58f196[_0x189c('0x3a')][_0x189c('0x1f')],'subject':_0x189c('0x46'),'text':_0x189c('0x47')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x58f196[_0x189c('0x48')][_0x189c('0x24')]+_0x189c('0x49')+_0x516952+'\x0a\x0a'+_0x189c('0x4a')});})['then'](function(){_0x6f3e7a[_0x189c('0x30')](0xc8)['send']({'message':_0x189c('0x4b')});})[_0x189c('0x1c')](function(_0x462761){return handleError(_0x6f3e7a,0x1f4,_0x462761);});};exports[_0x189c('0x4c')]=function(_0x54c44a,_0x254797,_0x9b5e99){return db[_0x189c('0x3f')][_0x189c('0x1e')]({'where':{'resetPasswordToken':_0x54c44a[_0x189c('0x4d')]['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x189c('0x14')](function(_0x595a0e){if(!_0x595a0e){throw new Error(_0x189c('0x4e'));}return db[_0x189c('0x9')]['findOne']({'attributes':['id',_0x189c('0x4f'),_0x189c('0x50'),_0x189c('0x51')]})[_0x189c('0x14')](function(_0x502f0a){if(_0x502f0a[_0x189c('0x4f')])authService[_0x189c('0x52')](_0x54c44a[_0x189c('0x3a')][_0x189c('0x53')]);if(!_0x502f0a[_0x189c('0x50')]||!_0x595a0e['previousPasswords'])return _0x595a0e;authService['validatePasswordHistory'](_0x54c44a['body'][_0x189c('0x53')],_0x595a0e[_0x189c('0x54')],_0x502f0a['passwordHistoryLimit']);return _0x595a0e;})[_0x189c('0x14')](function(){_0x595a0e[_0x189c('0x53')]=_0x54c44a['body'][_0x189c('0x53')];_0x595a0e[_0x189c('0x42')]=null;_0x595a0e[_0x189c('0x43')]=null;return _0x595a0e['save']();});})[_0x189c('0x14')](function(){_0x254797[_0x189c('0x30')](0xc8)[_0x189c('0x31')]({'message':_0x189c('0x55')});})[_0x189c('0x1c')](function(_0x36c7db){return handleError(_0x254797,0x1f4,_0x36c7db);});};passport[_0x189c('0x56')](_0x189c('0x33'),new LocalStrategy({'usernameField':_0x189c('0xd'),'passwordField':'password'},function(_0x23f1fb,_0x5931c3,_0x22a0a6){return localAuthenticate(db['User'],_0x23f1fb,_0x5931c3,_0x22a0a6);})); \ No newline at end of file +var _0x86d9=['MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','merge','format','\x22%s\x22\x20<%s>','request','error','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','params','token','now','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','use','util','passport','passport-local','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','name','password','role','disabled','loginAttempts','admin','user','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','blockDuration','blockedAt','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email'];(function(_0x1a8e02,_0x409ec5){var _0x5222f9=function(_0x1b8d9c){while(--_0x1b8d9c){_0x1a8e02['push'](_0x1a8e02['shift']());}};_0x5222f9(++_0x409ec5);}(_0x86d9,0x1d0));var _0x986d=function(_0x5738ea,_0x29900e){_0x5738ea=_0x5738ea-0x0;var _0x71091=_0x86d9[_0x5738ea];return _0x71091;};'use strict';var util=require(_0x986d('0x0'));var passport=require(_0x986d('0x1'));var LocalStrategy=require(_0x986d('0x2'))['Strategy'];var jayson=require(_0x986d('0x3'));var _=require(_0x986d('0x4'));var rs=require('randomstring');var moment=require(_0x986d('0x5'));var db=require(_0x986d('0x6'))['db'];var authService=require(_0x986d('0x7'));var utils=require(_0x986d('0x8'));var client=jayson[_0x986d('0x9')][_0x986d('0xa')]({'port':0x232b});function localAuthenticate(_0x22a965,_0x28211a,_0x1807a9,_0x38897d){var _0x4adfd0,_0x419bb4;return db[_0x986d('0xb')][_0x986d('0xc')]({'where':{'id':0x1},'attributes':[_0x986d('0xd'),'blockDuration'],'raw':!![]})['then'](function(_0xbd3f72){_0x4adfd0=_0xbd3f72;return _0x22a965[_0x986d('0xc')]({'attributes':['id',_0x986d('0xe'),_0x986d('0xf'),'salt',_0x986d('0x10'),_0x986d('0x11'),'blocked','blockedAt',_0x986d('0x12')],'where':{'name':_0x28211a,'role':{'$or':[_0x986d('0x13'),_0x986d('0x14'),'agent']}}});})[_0x986d('0x15')](function(_0x120633){if(!_0x120633||_0x120633&&_0x120633['name']!==_0x28211a){throw new Error(_0x986d('0x16'));}else{_0x419bb4=_0x120633;return _0x419bb4;}})[_0x986d('0x15')](function(){_0x419bb4[_0x986d('0x17')](_0x1807a9,function(_0x51ff26,_0x4f156f){var _0x2bde86=_0x419bb4['loginAttempts']+0x1;if(_0x51ff26){return _0x38897d(_0x51ff26);}else if(!_0x4f156f){if(_0x419bb4[_0x986d('0x11')]){return _0x38897d(null,![],{'message':_0x986d('0x16')});}else if(_0x4adfd0[_0x986d('0xd')]>0x0){if(_0x419bb4[_0x986d('0x18')]){if(_0x4adfd0[_0x986d('0x19')]>0x0){if(moment(_0x419bb4[_0x986d('0x1a')])['add'](_0x4adfd0[_0x986d('0x19')],_0x986d('0x1b'))>moment()){return _0x38897d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x986d('0x1c')](_0x419bb4,_0x2bde86,![],null)[_0x986d('0x15')](function(){return _0x38897d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x38897d(null,![],{'message':_0x986d('0x16')});}}else{if(_0x2bde86>=_0x4adfd0['allowedLoginAttempts']){return utils[_0x986d('0x1c')](_0x419bb4,0x0,!![],moment())[_0x986d('0x15')](function(){return _0x38897d(null,![],{'message':_0x986d('0x16')});});}else{return utils['clearBlockUser'](_0x419bb4,_0x2bde86,![],null)[_0x986d('0x15')](function(){return _0x38897d(null,![],{'message':_0x986d('0x16')});});}}}else{return _0x38897d(null,![],{'message':_0x986d('0x16')});}}else{if(_0x419bb4[_0x986d('0x11')]){return _0x38897d(null,![],{'message':_0x986d('0x16')});}else if(_0x4adfd0['allowedLoginAttempts']>0x0){if(_0x419bb4[_0x986d('0x18')]){if(_0x4adfd0[_0x986d('0x19')]>0x0){if(moment(_0x419bb4[_0x986d('0x1a')])['add'](_0x4adfd0[_0x986d('0x19')],_0x986d('0x1b'))>moment()){return _0x38897d(null,![],{'message':_0x986d('0x16')});}else{return utils[_0x986d('0x1c')](_0x419bb4,0x0,![],null)[_0x986d('0x15')](function(){return utils[_0x986d('0x1d')](_0x419bb4);})[_0x986d('0x15')](function(){return _0x38897d(null,_0x419bb4);});}}else{return _0x38897d(null,![],{'message':_0x986d('0x16')});}}else{return utils[_0x986d('0x1c')](_0x419bb4,0x0,![],null)['then'](function(){return utils[_0x986d('0x1d')](_0x419bb4);})[_0x986d('0x15')](function(){return _0x38897d(null,_0x419bb4);})[_0x986d('0x1e')](function(_0x975758){return _0x38897d(null,![],_0x975758);});}}else{if(_0x419bb4[_0x986d('0x18')]){return _0x38897d(null,![],{'message':_0x986d('0x16')});}else{return utils['getLicense'](_0x419bb4)[_0x986d('0x15')](function(){return _0x38897d(null,_0x419bb4);});}}}});})['catch'](function(_0x5a7e92){return _0x38897d(null,![],_0x5a7e92);});}function sendServiceMail(_0x1dcf7a){return db[_0x986d('0x1f')][_0x986d('0x20')]({'where':{'service':!![]},'attributes':['id','name',_0x986d('0x21')],'include':[{'model':db[_0x986d('0x22')],'as':_0x986d('0x23')}]})[_0x986d('0x15')](function(_0x1ce8a1){if(!_0x1ce8a1){throw new Error(_0x986d('0x24'));}var _0x4dbbe4={'tls':{'rejectUnauthorized':![]}};if(_0x1ce8a1['Smtp'][_0x986d('0x25')]){_0x4dbbe4[_0x986d('0x25')]=_0x1ce8a1[_0x986d('0x23')][_0x986d('0x25')];}else{_0x4dbbe4[_0x986d('0x26')]=_0x1ce8a1[_0x986d('0x23')]['host'];_0x4dbbe4[_0x986d('0x27')]=_0x1ce8a1[_0x986d('0x23')][_0x986d('0x27')];_0x4dbbe4[_0x986d('0x28')]=_0x1ce8a1[_0x986d('0x23')][_0x986d('0x28')];}if(_0x1ce8a1[_0x986d('0x23')][_0x986d('0x29')]){_0x4dbbe4[_0x986d('0x2a')]={'user':_0x1ce8a1['Smtp'][_0x986d('0x14')],'pass':_0x1ce8a1[_0x986d('0x23')]['pass']};}var _0x1b314e={'account':_0x4dbbe4,'message':_[_0x986d('0x2b')]({'from':util[_0x986d('0x2c')](_0x986d('0x2d'),_0x1ce8a1[_0x986d('0xe')],_0x1ce8a1['email']||_0x1ce8a1['Smtp'][_0x986d('0x14')])},_0x1dcf7a)};return client[_0x986d('0x2e')]('SendMail',_0x1b314e);})[_0x986d('0x15')](function(_0x4ce5c3){if(_0x4ce5c3[_0x986d('0x2f')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x4ce5c3[_0x986d('0x2f')][_0x986d('0x30')]||JSON[_0x986d('0x31')](_0x4ce5c3[_0x986d('0x2f')])));}return!![];});}function handleError(_0x510154,_0x41efa6,_0x579f7d){return _0x510154[_0x986d('0x32')](_0x41efa6||0x1f4)[_0x986d('0x33')]({'message':_0x579f7d?_0x579f7d[_0x986d('0x30')]||_0x579f7d:''});}exports[_0x986d('0x34')]=function(_0x5ece11,_0x516baf,_0x14156b){passport[_0x986d('0x17')](_0x986d('0x35'),function(_0x461508,_0xaa450d,_0x5e0816){var _0x27325a=_0x461508||_0x5e0816;if(_0x27325a){return handleError(_0x516baf,0x191,_0x27325a);}if(!_0xaa450d){return handleError(_0x516baf,0x194,{'message':_0x986d('0x36')});}else{var _0x24557f={'payload':{'id':_0xaa450d['id'],'role':_0xaa450d[_0x986d('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x986d('0x37')](_0x24557f)['then'](function(_0x20e5d3){_0x516baf['json']({'id':_0xaa450d['id'],'token':_0x20e5d3,'statusCall':'','isAlreadyLogged':_0xaa450d[_0x986d('0x38')]});});}})(_0x5ece11,_0x516baf,_0x14156b);};exports[_0x986d('0x39')]=function(_0x1c5f6c,_0x1be29f,_0x3b8e84){if(!_0x1c5f6c[_0x986d('0x3a')][_0x986d('0x21')]){return handleError(_0x1be29f,0x1f4,{'message':_0x986d('0x3b')});}var _0x2485ac=rs[_0x986d('0x3c')]();_0x1c5f6c[_0x986d('0x3a')][_0x986d('0x21')]=_0x1c5f6c[_0x986d('0x3a')]['email'][_0x986d('0x3d')]()['toLowerCase']();var _0x13d1d5;return db[_0x986d('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0x986d('0xd'),_0x986d('0x19')],'raw':!![]})['then'](function(_0x4d8790){_0x13d1d5=_0x4d8790;return db[_0x986d('0x3e')]['find']({'where':{'email':_0x1c5f6c[_0x986d('0x3a')][_0x986d('0x21')]}});})['then'](function(_0x2d15dd){if(!_0x2d15dd){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x2d15dd[_0x986d('0x11')]){throw new Error(_0x986d('0x3f'));}if(_0x2d15dd[_0x986d('0x18')]){if(moment(_0x2d15dd[_0x986d('0x1a')])['add'](_0x13d1d5[_0x986d('0x19')],_0x986d('0x1b'))>moment()){throw new Error(_0x986d('0x40'));}else{_0x2d15dd[_0x986d('0x18')]=![];_0x2d15dd[_0x986d('0x1a')]=null;}}_0x2d15dd[_0x986d('0x41')]=_0x2485ac;_0x2d15dd[_0x986d('0x42')]=Date['now']()+0x36ee80;return _0x2d15dd[_0x986d('0x43')]();})[_0x986d('0x15')](function(){return sendServiceMail({'to':_0x1c5f6c['body']['email'],'subject':_0x986d('0x44'),'text':_0x986d('0x45')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x986d('0x46')+_0x1c5f6c['headers'][_0x986d('0x26')]+_0x986d('0x47')+_0x2485ac+'\x0a\x0a'+_0x986d('0x48')});})[_0x986d('0x15')](function(){_0x1be29f['status'](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})[_0x986d('0x1e')](function(_0x2cd556){return handleError(_0x1be29f,0x1f4,_0x2cd556);});};exports['reset']=function(_0x367c85,_0x16b6a7,_0x584d6b){return db[_0x986d('0x3e')][_0x986d('0x20')]({'where':{'resetPasswordToken':_0x367c85[_0x986d('0x49')][_0x986d('0x4a')],'resetPasswordExpires':{'$gt':Date[_0x986d('0x4b')]()}}})[_0x986d('0x15')](function(_0x457033){if(!_0x457033){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting']['findOne']({'attributes':['id','securePassword',_0x986d('0x4c'),_0x986d('0x4d')]})['then'](function(_0x1d2d2d){if(_0x1d2d2d[_0x986d('0x4e')])authService[_0x986d('0x4f')](_0x367c85[_0x986d('0x3a')][_0x986d('0xf')]);if(!_0x1d2d2d[_0x986d('0x4c')]||!_0x457033[_0x986d('0x50')])return _0x457033;authService[_0x986d('0x51')](_0x367c85['body'][_0x986d('0xf')],_0x457033['previousPasswords'],_0x1d2d2d[_0x986d('0x4d')]);return _0x457033;})['then'](function(){_0x457033[_0x986d('0xf')]=_0x367c85[_0x986d('0x3a')][_0x986d('0xf')];_0x457033[_0x986d('0x41')]=null;_0x457033[_0x986d('0x42')]=null;return _0x457033['save']();});})[_0x986d('0x15')](function(){_0x16b6a7[_0x986d('0x32')](0xc8)['send']({'message':'Password\x20reset!'});})[_0x986d('0x1e')](function(_0x31da60){return handleError(_0x16b6a7,0x1f4,_0x31da60);});};passport[_0x986d('0x52')]('local-login',new LocalStrategy({'usernameField':_0x986d('0xe'),'passwordField':_0x986d('0xf')},function(_0x46deda,_0x466ce9,_0x3910c2){return localAuthenticate(db[_0x986d('0x3e')],_0x46deda,_0x466ce9,_0x3910c2);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 507bbef..52c8e03 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 _0x3e19=['login','forgot','post','exports','express'];(function(_0x3dc9bc,_0x77bc87){var _0x23a813=function(_0x166ab9){while(--_0x166ab9){_0x3dc9bc['push'](_0x3dc9bc['shift']());}};_0x23a813(++_0x77bc87);}(_0x3e19,0x77));var _0x93e1=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x3e19[_0x58e469];return _0x4c01c5;};'use strict';var express=require(_0x93e1('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router['post']('/',controller[_0x93e1('0x1')]);router['post']('/forgot',controller[_0x93e1('0x2')]);router[_0x93e1('0x3')]('/reset/:token',controller['reset']);module[_0x93e1('0x4')]=router; \ No newline at end of file +var _0x0a2b=['/reset/:token','reset','exports','express','Router','./authLocal.controller','post','login','/forgot','forgot'];(function(_0x588920,_0x595dfb){var _0x5e082b=function(_0x42a70b){while(--_0x42a70b){_0x588920['push'](_0x588920['shift']());}};_0x5e082b(++_0x595dfb);}(_0x0a2b,0x111));var _0xb0a2=function(_0x59e821,_0x86c723){_0x59e821=_0x59e821-0x0;var _0x5333f6=_0x0a2b[_0x59e821];return _0x5333f6;};'use strict';var express=require(_0xb0a2('0x0'));var router=express[_0xb0a2('0x1')]();var controller=require(_0xb0a2('0x2'));router[_0xb0a2('0x3')]('/',controller[_0xb0a2('0x4')]);router[_0xb0a2('0x3')](_0xb0a2('0x5'),controller[_0xb0a2('0x6')]);router[_0xb0a2('0x3')](_0xb0a2('0x7'),controller[_0xb0a2('0x8')]);module[_0xb0a2('0x9')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 8c38b06..3134c7b 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 _0xda36=['STRING','sequelize'];(function(_0x14c8ee,_0x34d4fb){var _0x51acc2=function(_0x4c1277){while(--_0x4c1277){_0x14c8ee['push'](_0x14c8ee['shift']());}};_0x51acc2(++_0x34d4fb);}(_0xda36,0x163));var _0x6da3=function(_0x9f7f64,_0x24a2a5){_0x9f7f64=_0x9f7f64-0x0;var _0x3a4987=_0xda36[_0x9f7f64];return _0x3a4987;};'use strict';var Sequelize=require(_0x6da3('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x6da3('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0x7115=['STRING','BOOLEAN','INTEGER','exports'];(function(_0x4c0ccf,_0x109f71){var _0x5501fa=function(_0x23012c){while(--_0x23012c){_0x4c0ccf['push'](_0x4c0ccf['shift']());}};_0x5501fa(++_0x109f71);}(_0x7115,0xcb));var _0x5711=function(_0x124b9a,_0x806a26){_0x124b9a=_0x124b9a-0x0;var _0x4c1085=_0x7115[_0x124b9a];return _0x4c1085;};'use strict';var Sequelize=require('sequelize');module[_0x5711('0x0')]={'name':{'type':Sequelize[_0x5711('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x5711('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x5711('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x5711('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index fae6e00..82df4a8 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 _0x088b=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','stack','name','send','map','Automation','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filter','merge','VIRTUAL','where','includeAll','catch','params','keys','rawAttributes','find','create','body','destroy','Condition','addConditions','ids','omit','getConditions','findOne','pick','length','addActions','Action','getActions','options','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x4c71f0,_0x52151f){var _0x2ceb53=function(_0x882b0e){while(--_0x882b0e){_0x4c71f0['push'](_0x4c71f0['shift']());}};_0x2ceb53(++_0x52151f);}(_0x088b,0x187));var _0xb088=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x088b[_0xfae23b];return _0x200640;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb088('0x0'));var zipdir=require(_0xb088('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb088('0x2'));var moment=require(_0xb088('0x3'));var BPromise=require(_0xb088('0x4'));var Mustache=require(_0xb088('0x5'));var util=require(_0xb088('0x6'));var path=require(_0xb088('0x7'));var sox=require(_0xb088('0x8'));var csv=require(_0xb088('0x9'));var ejs=require(_0xb088('0xa'));var fs=require('fs');var fs_extra=require(_0xb088('0xb'));var _=require(_0xb088('0xc'));var squel=require(_0xb088('0xd'));var crypto=require(_0xb088('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb088('0x9'));var querystring=require('querystring');var Papa=require(_0xb088('0xf'));var Redis=require('ioredis');var authService=require(_0xb088('0x10'));var qs=require(_0xb088('0x11'));var as=require(_0xb088('0x12'));var hardwareService=require(_0xb088('0x13'));var logger=require(_0xb088('0x14'))(_0xb088('0x15'));var utils=require(_0xb088('0x16'));var config=require(_0xb088('0x17'));var licenseUtil=require(_0xb088('0x18'));var db=require(_0xb088('0x19'))['db'];function respondWithStatusCode(_0x511b09,_0x5be9f4){_0x5be9f4=_0x5be9f4||0xcc;return function(_0x16e310){if(_0x16e310){return _0x511b09[_0xb088('0x1a')](_0x5be9f4);}return _0x511b09[_0xb088('0x1b')](_0x5be9f4)[_0xb088('0x1c')]();};}function respondWithResult(_0x26e03a,_0x1d41d7){_0x1d41d7=_0x1d41d7||0xc8;return function(_0xee4ccd){if(_0xee4ccd){return _0x26e03a[_0xb088('0x1b')](_0x1d41d7)[_0xb088('0x1d')](_0xee4ccd);}};}function respondWithFilteredResult(_0x43b962,_0x325b58){return function(_0xf806d7){if(_0xf806d7){var _0x34e062=typeof _0x325b58[_0xb088('0x1e')]===_0xb088('0x1f')&&typeof _0x325b58[_0xb088('0x20')]===_0xb088('0x1f');var _0x2f3162=_0xf806d7[_0xb088('0x21')];var _0x3e01c9=_0x34e062?0x0:_0x325b58[_0xb088('0x1e')];var _0xdc12b9=_0x34e062?_0xf806d7[_0xb088('0x21')]:_0x325b58[_0xb088('0x1e')]+_0x325b58[_0xb088('0x20')];var _0x4f9a9a;if(_0xdc12b9>=_0x2f3162){_0xdc12b9=_0x2f3162;_0x4f9a9a=0xc8;}else{_0x4f9a9a=0xce;}_0x43b962[_0xb088('0x1b')](_0x4f9a9a);return _0x43b962['set'](_0xb088('0x22'),_0x3e01c9+'-'+_0xdc12b9+'/'+_0x2f3162)[_0xb088('0x1d')](_0xf806d7);}return null;};}function patchUpdates(_0x38b0e3){return function(_0x502c1a){try{jsonpatch[_0xb088('0x23')](_0x502c1a,_0x38b0e3,!![]);}catch(_0x435feb){return BPromise[_0xb088('0x24')](_0x435feb);}return _0x502c1a['save']();};}function saveUpdates(_0x49f089,_0x4e3711){return function(_0x265c25){if(_0x265c25){return _0x265c25[_0xb088('0x25')](_0x49f089)[_0xb088('0x26')](function(_0x25aafc){return _0x25aafc;});}return null;};}function removeEntity(_0x4d261c,_0x5f248c){return function(_0x55ff6c){if(_0x55ff6c){return _0x55ff6c['destroy']()[_0xb088('0x26')](function(){_0x4d261c[_0xb088('0x1b')](0xcc)[_0xb088('0x1c')]();});}};}function handleEntityNotFound(_0x180758,_0x14b4e4){return function(_0x4fd33a){if(!_0x4fd33a){_0x180758['sendStatus'](0x194);}return _0x4fd33a;};}function handleError(_0xb1ba64,_0x468a68){_0x468a68=_0x468a68||0x1f4;return function(_0x2319be){logger[_0xb088('0x27')](_0x2319be[_0xb088('0x28')]);if(_0x2319be[_0xb088('0x29')]){delete _0x2319be['name'];}_0xb1ba64['status'](_0x468a68)[_0xb088('0x2a')](_0x2319be);};}exports['index']=function(_0x427bc4,_0x4fe05e){var _0x412d0f={},_0x5ae694={},_0x5ceed7={'count':0x0,'rows':[]};var _0x315a1a=_[_0xb088('0x2b')](db[_0xb088('0x2c')]['rawAttributes'],function(_0x33d542){return{'name':_0x33d542[_0xb088('0x2d')],'type':_0x33d542[_0xb088('0x2e')][_0xb088('0x2f')]};});_0x5ae694[_0xb088('0x30')]=_[_0xb088('0x2b')](_0x315a1a,_0xb088('0x29'));_0x5ae694[_0xb088('0x31')]=_['keys'](_0x427bc4[_0xb088('0x31')]);_0x5ae694[_0xb088('0x32')]=_['intersection'](_0x5ae694[_0xb088('0x30')],_0x5ae694[_0xb088('0x31')]);_0x412d0f[_0xb088('0x33')]=_[_0xb088('0x34')](_0x5ae694['model'],qs['fields'](_0x427bc4['query'][_0xb088('0x35')]));_0x412d0f[_0xb088('0x33')]=_0x412d0f[_0xb088('0x33')]['length']?_0x412d0f['attributes']:_0x5ae694[_0xb088('0x30')];if(!_0x427bc4[_0xb088('0x31')][_0xb088('0x36')](_0xb088('0x37'))){_0x412d0f[_0xb088('0x20')]=qs[_0xb088('0x20')](_0x427bc4[_0xb088('0x31')]['limit']);_0x412d0f[_0xb088('0x1e')]=qs[_0xb088('0x1e')](_0x427bc4[_0xb088('0x31')][_0xb088('0x1e')]);}_0x412d0f[_0xb088('0x38')]=qs['sort'](_0x427bc4[_0xb088('0x31')][_0xb088('0x39')]);_0x412d0f['where']=qs[_0xb088('0x32')](_['pick'](_0x427bc4[_0xb088('0x31')],_0x5ae694[_0xb088('0x32')]),_0x315a1a);if(_0x427bc4['query'][_0xb088('0x3a')]){_0x412d0f['where']=_[_0xb088('0x3b')](_0x412d0f['where'],{'$or':_[_0xb088('0x2b')](_0x315a1a,function(_0x1d168d){if(_0x1d168d[_0xb088('0x2e')]!==_0xb088('0x3c')){var _0xc810b={};_0xc810b[_0x1d168d[_0xb088('0x29')]]={'$like':'%'+_0x427bc4[_0xb088('0x31')][_0xb088('0x3a')]+'%'};return _0xc810b;}})});}_0x412d0f=_[_0xb088('0x3b')]({},_0x412d0f,_0x427bc4['options']);var _0x269022={'where':_0x412d0f[_0xb088('0x3d')]};return db[_0xb088('0x2c')]['count'](_0x269022)['then'](function(_0x37631e){_0x5ceed7['count']=_0x37631e;if(_0x427bc4[_0xb088('0x31')][_0xb088('0x3e')]){_0x412d0f['include']=[{'all':!![]}];}return db[_0xb088('0x2c')]['findAll'](_0x412d0f);})[_0xb088('0x26')](function(_0x3dfea7){_0x5ceed7['rows']=_0x3dfea7;return _0x5ceed7;})[_0xb088('0x26')](respondWithFilteredResult(_0x4fe05e,_0x412d0f))[_0xb088('0x3f')](handleError(_0x4fe05e,null));};exports['show']=function(_0x191988,_0x41fee1){var _0x34c2c2={'raw':![],'where':{'id':_0x191988[_0xb088('0x40')]['id']}},_0x40b5bb={};_0x40b5bb[_0xb088('0x30')]=_[_0xb088('0x41')](db[_0xb088('0x2c')][_0xb088('0x42')]);_0x40b5bb['query']=_['keys'](_0x191988[_0xb088('0x31')]);_0x40b5bb[_0xb088('0x32')]=_[_0xb088('0x34')](_0x40b5bb['model'],_0x40b5bb[_0xb088('0x31')]);_0x34c2c2[_0xb088('0x33')]=_[_0xb088('0x34')](_0x40b5bb[_0xb088('0x30')],qs[_0xb088('0x35')](_0x191988['query']['fields']));_0x34c2c2[_0xb088('0x33')]=_0x34c2c2['attributes']['length']?_0x34c2c2[_0xb088('0x33')]:_0x40b5bb[_0xb088('0x30')];if(_0x191988['query'][_0xb088('0x3e')]){_0x34c2c2['include']=[{'all':!![]}];}_0x34c2c2=_[_0xb088('0x3b')]({},_0x34c2c2,_0x191988['options']);return db['Automation'][_0xb088('0x43')](_0x34c2c2)[_0xb088('0x26')](handleEntityNotFound(_0x41fee1,null))['then'](respondWithResult(_0x41fee1,null))[_0xb088('0x3f')](handleError(_0x41fee1,null));};exports[_0xb088('0x44')]=function(_0x56f627,_0x498821){return db[_0xb088('0x2c')][_0xb088('0x44')](_0x56f627[_0xb088('0x45')],{})[_0xb088('0x26')](respondWithResult(_0x498821,0xc9))[_0xb088('0x3f')](handleError(_0x498821,null));};exports[_0xb088('0x25')]=function(_0x5b3ed7,_0x4c89c8){if(_0x5b3ed7[_0xb088('0x45')]['id']){delete _0x5b3ed7['body']['id'];}return db[_0xb088('0x2c')]['find']({'where':{'id':_0x5b3ed7[_0xb088('0x40')]['id']}})[_0xb088('0x26')](handleEntityNotFound(_0x4c89c8,null))[_0xb088('0x26')](saveUpdates(_0x5b3ed7[_0xb088('0x45')],null))[_0xb088('0x26')](respondWithResult(_0x4c89c8,null))['catch'](handleError(_0x4c89c8,null));};exports[_0xb088('0x46')]=function(_0x1031b1,_0x525bff){return db[_0xb088('0x2c')][_0xb088('0x43')]({'where':{'id':_0x1031b1[_0xb088('0x40')]['id']}})['then'](handleEntityNotFound(_0x525bff,null))['then'](removeEntity(_0x525bff,null))[_0xb088('0x3f')](handleError(_0x525bff,null));};exports['addConditions']=function(_0x7c0659,_0x13d8a2,_0x4a3bcf){return db[_0xb088('0x47')][_0xb088('0x43')]({'where':{'id':_0x7c0659[_0xb088('0x40')]['id']}})[_0xb088('0x26')](handleEntityNotFound(_0x13d8a2,null))['then'](function(_0x430718){if(_0x430718){return _0x430718[_0xb088('0x48')](_0x7c0659[_0xb088('0x45')][_0xb088('0x49')],_[_0xb088('0x4a')](_0x7c0659[_0xb088('0x45')],['ids','id'])||{});}})[_0xb088('0x26')](respondWithResult(_0x13d8a2,null))[_0xb088('0x3f')](handleError(_0x13d8a2,null));};exports[_0xb088('0x4b')]=function(_0x15c81a,_0xe5d15c,_0x4eeb14){var _0xae76b6={};var _0x24ee0d={};var _0x11f32e;var _0x271a73;return db[_0xb088('0x2c')][_0xb088('0x4c')]({'where':{'id':_0x15c81a[_0xb088('0x40')]['id']}})[_0xb088('0x26')](handleEntityNotFound(_0xe5d15c,null))[_0xb088('0x26')](function(_0x250929){if(_0x250929){_0x11f32e=_0x250929;_0x24ee0d[_0xb088('0x30')]=_[_0xb088('0x41')](db[_0xb088('0x47')]['rawAttributes']);_0x24ee0d['query']=_['keys'](_0x15c81a[_0xb088('0x31')]);_0x24ee0d[_0xb088('0x32')]=_['intersection'](_0x24ee0d['model'],_0x24ee0d[_0xb088('0x31')]);_0xae76b6[_0xb088('0x33')]=_[_0xb088('0x34')](_0x24ee0d[_0xb088('0x30')],qs[_0xb088('0x35')](_0x15c81a[_0xb088('0x31')][_0xb088('0x35')]));_0xae76b6[_0xb088('0x33')]=_0xae76b6[_0xb088('0x33')]['length']?_0xae76b6[_0xb088('0x33')]:_0x24ee0d[_0xb088('0x30')];_0xae76b6[_0xb088('0x38')]=qs['sort'](_0x15c81a[_0xb088('0x31')]['sort']);_0xae76b6[_0xb088('0x3d')]=qs[_0xb088('0x32')](_[_0xb088('0x4d')](_0x15c81a['query'],_0x24ee0d[_0xb088('0x32')]));if(_0x15c81a[_0xb088('0x31')][_0xb088('0x3a')]){_0xae76b6['where']=_['merge'](_0xae76b6[_0xb088('0x3d')],{'$or':_[_0xb088('0x2b')](_0xae76b6[_0xb088('0x33')],function(_0xdc4c3f){var _0x44e94d={};_0x44e94d[_0xdc4c3f]={'$like':'%'+_0x15c81a[_0xb088('0x31')]['filter']+'%'};return _0x44e94d;})});}_0xae76b6=_['merge']({},_0xae76b6,_0x15c81a['options']);return _0x11f32e[_0xb088('0x4b')](_0xae76b6);}})[_0xb088('0x26')](function(_0x68a237){if(_0x68a237){_0x271a73=_0x68a237[_0xb088('0x4e')];if(!_0x15c81a[_0xb088('0x31')]['hasOwnProperty']('nolimit')){_0xae76b6[_0xb088('0x20')]=qs[_0xb088('0x20')](_0x15c81a[_0xb088('0x31')]['limit']);_0xae76b6[_0xb088('0x1e')]=qs['offset'](_0x15c81a[_0xb088('0x31')][_0xb088('0x1e')]);}return _0x11f32e[_0xb088('0x4b')](_0xae76b6);}})[_0xb088('0x26')](function(_0x5d3b60){if(_0x5d3b60){return _0x5d3b60?{'count':_0x271a73,'rows':_0x5d3b60}:null;}})[_0xb088('0x26')](respondWithResult(_0xe5d15c,null))[_0xb088('0x3f')](handleError(_0xe5d15c,null));};exports[_0xb088('0x4f')]=function(_0x2b3905,_0x173b27,_0x239af5){return db[_0xb088('0x50')][_0xb088('0x43')]({'where':{'id':_0x2b3905[_0xb088('0x40')]['id']}})['then'](handleEntityNotFound(_0x173b27,null))[_0xb088('0x26')](function(_0x1fd51f){if(_0x1fd51f){return _0x1fd51f[_0xb088('0x4f')](_0x2b3905[_0xb088('0x45')]['ids'],_['omit'](_0x2b3905[_0xb088('0x45')],[_0xb088('0x49'),'id'])||{});}})[_0xb088('0x26')](respondWithResult(_0x173b27,null))['catch'](handleError(_0x173b27,null));};exports[_0xb088('0x51')]=function(_0x252630,_0x50376b,_0x5b8ef9){var _0x1c81c2={};var _0xb86079={};var _0x59f4b4;var _0x19219d;return db['Automation'][_0xb088('0x4c')]({'where':{'id':_0x252630[_0xb088('0x40')]['id']}})[_0xb088('0x26')](handleEntityNotFound(_0x50376b,null))[_0xb088('0x26')](function(_0x375976){if(_0x375976){_0x59f4b4=_0x375976;_0xb86079[_0xb088('0x30')]=_[_0xb088('0x41')](db[_0xb088('0x50')][_0xb088('0x42')]);_0xb86079[_0xb088('0x31')]=_[_0xb088('0x41')](_0x252630[_0xb088('0x31')]);_0xb86079[_0xb088('0x32')]=_['intersection'](_0xb86079[_0xb088('0x30')],_0xb86079[_0xb088('0x31')]);_0x1c81c2[_0xb088('0x33')]=_['intersection'](_0xb86079[_0xb088('0x30')],qs[_0xb088('0x35')](_0x252630[_0xb088('0x31')][_0xb088('0x35')]));_0x1c81c2[_0xb088('0x33')]=_0x1c81c2[_0xb088('0x33')][_0xb088('0x4e')]?_0x1c81c2[_0xb088('0x33')]:_0xb86079[_0xb088('0x30')];_0x1c81c2[_0xb088('0x38')]=qs[_0xb088('0x39')](_0x252630[_0xb088('0x31')][_0xb088('0x39')]);_0x1c81c2[_0xb088('0x3d')]=qs['filters'](_[_0xb088('0x4d')](_0x252630[_0xb088('0x31')],_0xb86079[_0xb088('0x32')]));if(_0x252630[_0xb088('0x31')]['filter']){_0x1c81c2[_0xb088('0x3d')]=_[_0xb088('0x3b')](_0x1c81c2[_0xb088('0x3d')],{'$or':_[_0xb088('0x2b')](_0x1c81c2['attributes'],function(_0x5a0a63){var _0x11f41f={};_0x11f41f[_0x5a0a63]={'$like':'%'+_0x252630[_0xb088('0x31')][_0xb088('0x3a')]+'%'};return _0x11f41f;})});}_0x1c81c2=_[_0xb088('0x3b')]({},_0x1c81c2,_0x252630[_0xb088('0x52')]);return _0x59f4b4[_0xb088('0x51')](_0x1c81c2);}})[_0xb088('0x26')](function(_0x257edb){if(_0x257edb){_0x19219d=_0x257edb[_0xb088('0x4e')];if(!_0x252630['query'][_0xb088('0x36')]('nolimit')){_0x1c81c2[_0xb088('0x20')]=qs[_0xb088('0x20')](_0x252630[_0xb088('0x31')][_0xb088('0x20')]);_0x1c81c2['offset']=qs[_0xb088('0x1e')](_0x252630[_0xb088('0x31')][_0xb088('0x1e')]);}return _0x59f4b4[_0xb088('0x51')](_0x1c81c2);}})[_0xb088('0x26')](function(_0x4c41bf){if(_0x4c41bf){return _0x4c41bf?{'count':_0x19219d,'rows':_0x4c41bf}:null;}})[_0xb088('0x26')](respondWithResult(_0x50376b,null))[_0xb088('0x3f')](handleError(_0x50376b,null));}; \ No newline at end of file +var _0xe417=['Automation','fieldName','type','key','name','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','count','includeAll','rows','catch','show','rawAttributes','include','create','body','find','params','addConditions','ids','omit','getConditions','order','pick','addActions','Action','getActions','eml-format','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','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','json','undefined','limit','offset','Content-Range','reject','save','update','destroy','then','end','error','stack','index','map'];(function(_0x12033b,_0x50fad7){var _0x15d0ac=function(_0x3e6a9e){while(--_0x3e6a9e){_0x12033b['push'](_0x12033b['shift']());}};_0x15d0ac(++_0x50fad7);}(_0xe417,0x1b3));var _0x7e41=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xe417[_0x17928f];return _0x500b63;};'use strict';var emlformat=require(_0x7e41('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7e41('0x1'));var BPromise=require(_0x7e41('0x2'));var Mustache=require('mustache');var util=require(_0x7e41('0x3'));var path=require(_0x7e41('0x4'));var sox=require(_0x7e41('0x5'));var csv=require(_0x7e41('0x6'));var ejs=require(_0x7e41('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e41('0x8'));var squel=require(_0x7e41('0x9'));var crypto=require(_0x7e41('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7e41('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7e41('0xc'));var Redis=require(_0x7e41('0xd'));var authService=require(_0x7e41('0xe'));var qs=require(_0x7e41('0xf'));var as=require(_0x7e41('0x10'));var hardwareService=require(_0x7e41('0x11'));var logger=require(_0x7e41('0x12'))('api');var utils=require(_0x7e41('0x13'));var config=require(_0x7e41('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x7e41('0x15'))['db'];function respondWithStatusCode(_0x2fc111,_0x1e7e51){_0x1e7e51=_0x1e7e51||0xcc;return function(_0x4a808e){if(_0x4a808e){return _0x2fc111[_0x7e41('0x16')](_0x1e7e51);}return _0x2fc111['status'](_0x1e7e51)['end']();};}function respondWithResult(_0x2f6cbc,_0x2f767f){_0x2f767f=_0x2f767f||0xc8;return function(_0xa67c9c){if(_0xa67c9c){return _0x2f6cbc[_0x7e41('0x17')](_0x2f767f)[_0x7e41('0x18')](_0xa67c9c);}};}function respondWithFilteredResult(_0x1cbeb7,_0x4b1df0){return function(_0x3aefaa){if(_0x3aefaa){var _0x558b36=typeof _0x4b1df0['offset']===_0x7e41('0x19')&&typeof _0x4b1df0[_0x7e41('0x1a')]===_0x7e41('0x19');var _0x270377=_0x3aefaa['count'];var _0x1ba722=_0x558b36?0x0:_0x4b1df0['offset'];var _0x14a8c5=_0x558b36?_0x3aefaa['count']:_0x4b1df0[_0x7e41('0x1b')]+_0x4b1df0[_0x7e41('0x1a')];var _0x451af4;if(_0x14a8c5>=_0x270377){_0x14a8c5=_0x270377;_0x451af4=0xc8;}else{_0x451af4=0xce;}_0x1cbeb7[_0x7e41('0x17')](_0x451af4);return _0x1cbeb7['set'](_0x7e41('0x1c'),_0x1ba722+'-'+_0x14a8c5+'/'+_0x270377)[_0x7e41('0x18')](_0x3aefaa);}return null;};}function patchUpdates(_0x3e3f59){return function(_0x2b2800){try{jsonpatch['apply'](_0x2b2800,_0x3e3f59,!![]);}catch(_0x36c664){return BPromise[_0x7e41('0x1d')](_0x36c664);}return _0x2b2800[_0x7e41('0x1e')]();};}function saveUpdates(_0x28ae12,_0x2884c8){return function(_0x8a0020){if(_0x8a0020){return _0x8a0020[_0x7e41('0x1f')](_0x28ae12)['then'](function(_0x370bd1){return _0x370bd1;});}return null;};}function removeEntity(_0x1e697a,_0x215859){return function(_0xf4a40a){if(_0xf4a40a){return _0xf4a40a[_0x7e41('0x20')]()[_0x7e41('0x21')](function(){_0x1e697a[_0x7e41('0x17')](0xcc)[_0x7e41('0x22')]();});}};}function handleEntityNotFound(_0x816908,_0x27f152){return function(_0x54d870){if(!_0x54d870){_0x816908[_0x7e41('0x16')](0x194);}return _0x54d870;};}function handleError(_0x472a2e,_0x35045e){_0x35045e=_0x35045e||0x1f4;return function(_0x39feef){logger[_0x7e41('0x23')](_0x39feef[_0x7e41('0x24')]);if(_0x39feef['name']){delete _0x39feef['name'];}_0x472a2e[_0x7e41('0x17')](_0x35045e)['send'](_0x39feef);};}exports[_0x7e41('0x25')]=function(_0x167db1,_0xa71f85){var _0x2da954={},_0x335216={},_0x1ef6a4={'count':0x0,'rows':[]};var _0x3bc7e5=_[_0x7e41('0x26')](db[_0x7e41('0x27')]['rawAttributes'],function(_0xa1bfd4){return{'name':_0xa1bfd4[_0x7e41('0x28')],'type':_0xa1bfd4[_0x7e41('0x29')][_0x7e41('0x2a')]};});_0x335216['model']=_[_0x7e41('0x26')](_0x3bc7e5,_0x7e41('0x2b'));_0x335216[_0x7e41('0x2c')]=_[_0x7e41('0x2d')](_0x167db1[_0x7e41('0x2c')]);_0x335216[_0x7e41('0x2e')]=_['intersection'](_0x335216[_0x7e41('0x2f')],_0x335216['query']);_0x2da954['attributes']=_[_0x7e41('0x30')](_0x335216[_0x7e41('0x2f')],qs[_0x7e41('0x31')](_0x167db1[_0x7e41('0x2c')][_0x7e41('0x31')]));_0x2da954[_0x7e41('0x32')]=_0x2da954[_0x7e41('0x32')][_0x7e41('0x33')]?_0x2da954[_0x7e41('0x32')]:_0x335216[_0x7e41('0x2f')];if(!_0x167db1[_0x7e41('0x2c')][_0x7e41('0x34')](_0x7e41('0x35'))){_0x2da954[_0x7e41('0x1a')]=qs[_0x7e41('0x1a')](_0x167db1[_0x7e41('0x2c')][_0x7e41('0x1a')]);_0x2da954[_0x7e41('0x1b')]=qs[_0x7e41('0x1b')](_0x167db1['query'][_0x7e41('0x1b')]);}_0x2da954['order']=qs[_0x7e41('0x36')](_0x167db1[_0x7e41('0x2c')]['sort']);_0x2da954[_0x7e41('0x37')]=qs[_0x7e41('0x2e')](_['pick'](_0x167db1[_0x7e41('0x2c')],_0x335216[_0x7e41('0x2e')]),_0x3bc7e5);if(_0x167db1['query'][_0x7e41('0x38')]){_0x2da954[_0x7e41('0x37')]=_[_0x7e41('0x39')](_0x2da954[_0x7e41('0x37')],{'$or':_[_0x7e41('0x26')](_0x3bc7e5,function(_0x5c4cea){if(_0x5c4cea['type']!=='VIRTUAL'){var _0x59328c={};_0x59328c[_0x5c4cea[_0x7e41('0x2b')]]={'$like':'%'+_0x167db1['query'][_0x7e41('0x38')]+'%'};return _0x59328c;}})});}_0x2da954=_['merge']({},_0x2da954,_0x167db1[_0x7e41('0x3a')]);var _0x467a81={'where':_0x2da954[_0x7e41('0x37')]};return db[_0x7e41('0x27')][_0x7e41('0x3b')](_0x467a81)[_0x7e41('0x21')](function(_0x2be33c){_0x1ef6a4[_0x7e41('0x3b')]=_0x2be33c;if(_0x167db1[_0x7e41('0x2c')][_0x7e41('0x3c')]){_0x2da954['include']=[{'all':!![]}];}return db[_0x7e41('0x27')]['findAll'](_0x2da954);})[_0x7e41('0x21')](function(_0x481a58){_0x1ef6a4[_0x7e41('0x3d')]=_0x481a58;return _0x1ef6a4;})[_0x7e41('0x21')](respondWithFilteredResult(_0xa71f85,_0x2da954))[_0x7e41('0x3e')](handleError(_0xa71f85,null));};exports[_0x7e41('0x3f')]=function(_0x25729d,_0x53f9a5){var _0x3eea66={'raw':![],'where':{'id':_0x25729d['params']['id']}},_0x1eaaff={};_0x1eaaff[_0x7e41('0x2f')]=_[_0x7e41('0x2d')](db[_0x7e41('0x27')][_0x7e41('0x40')]);_0x1eaaff['query']=_[_0x7e41('0x2d')](_0x25729d[_0x7e41('0x2c')]);_0x1eaaff[_0x7e41('0x2e')]=_[_0x7e41('0x30')](_0x1eaaff['model'],_0x1eaaff[_0x7e41('0x2c')]);_0x3eea66[_0x7e41('0x32')]=_[_0x7e41('0x30')](_0x1eaaff[_0x7e41('0x2f')],qs[_0x7e41('0x31')](_0x25729d[_0x7e41('0x2c')][_0x7e41('0x31')]));_0x3eea66[_0x7e41('0x32')]=_0x3eea66[_0x7e41('0x32')][_0x7e41('0x33')]?_0x3eea66[_0x7e41('0x32')]:_0x1eaaff[_0x7e41('0x2f')];if(_0x25729d[_0x7e41('0x2c')][_0x7e41('0x3c')]){_0x3eea66[_0x7e41('0x41')]=[{'all':!![]}];}_0x3eea66=_[_0x7e41('0x39')]({},_0x3eea66,_0x25729d['options']);return db[_0x7e41('0x27')]['find'](_0x3eea66)[_0x7e41('0x21')](handleEntityNotFound(_0x53f9a5,null))[_0x7e41('0x21')](respondWithResult(_0x53f9a5,null))[_0x7e41('0x3e')](handleError(_0x53f9a5,null));};exports[_0x7e41('0x42')]=function(_0x44a2cf,_0x4243e4){return db[_0x7e41('0x27')]['create'](_0x44a2cf['body'],{})[_0x7e41('0x21')](respondWithResult(_0x4243e4,0xc9))[_0x7e41('0x3e')](handleError(_0x4243e4,null));};exports[_0x7e41('0x1f')]=function(_0x19878e,_0x322497){if(_0x19878e[_0x7e41('0x43')]['id']){delete _0x19878e[_0x7e41('0x43')]['id'];}return db['Automation'][_0x7e41('0x44')]({'where':{'id':_0x19878e['params']['id']}})['then'](handleEntityNotFound(_0x322497,null))[_0x7e41('0x21')](saveUpdates(_0x19878e[_0x7e41('0x43')],null))['then'](respondWithResult(_0x322497,null))[_0x7e41('0x3e')](handleError(_0x322497,null));};exports['destroy']=function(_0x11a3d7,_0x54f15a){return db[_0x7e41('0x27')][_0x7e41('0x44')]({'where':{'id':_0x11a3d7[_0x7e41('0x45')]['id']}})[_0x7e41('0x21')](handleEntityNotFound(_0x54f15a,null))[_0x7e41('0x21')](removeEntity(_0x54f15a,null))[_0x7e41('0x3e')](handleError(_0x54f15a,null));};exports[_0x7e41('0x46')]=function(_0x24338b,_0x972eaf,_0x3f971c){return db['Condition'][_0x7e41('0x44')]({'where':{'id':_0x24338b[_0x7e41('0x45')]['id']}})['then'](handleEntityNotFound(_0x972eaf,null))[_0x7e41('0x21')](function(_0x54b8bf){if(_0x54b8bf){return _0x54b8bf[_0x7e41('0x46')](_0x24338b[_0x7e41('0x43')][_0x7e41('0x47')],_[_0x7e41('0x48')](_0x24338b[_0x7e41('0x43')],[_0x7e41('0x47'),'id'])||{});}})[_0x7e41('0x21')](respondWithResult(_0x972eaf,null))['catch'](handleError(_0x972eaf,null));};exports[_0x7e41('0x49')]=function(_0x3457a6,_0x59871b,_0x1b1675){var _0x2c1f3d={};var _0x5016c2={};var _0x24d64c;var _0x39155c;return db[_0x7e41('0x27')]['findOne']({'where':{'id':_0x3457a6['params']['id']}})['then'](handleEntityNotFound(_0x59871b,null))['then'](function(_0x42c872){if(_0x42c872){_0x24d64c=_0x42c872;_0x5016c2[_0x7e41('0x2f')]=_['keys'](db['Condition']['rawAttributes']);_0x5016c2[_0x7e41('0x2c')]=_[_0x7e41('0x2d')](_0x3457a6['query']);_0x5016c2[_0x7e41('0x2e')]=_[_0x7e41('0x30')](_0x5016c2['model'],_0x5016c2['query']);_0x2c1f3d[_0x7e41('0x32')]=_[_0x7e41('0x30')](_0x5016c2[_0x7e41('0x2f')],qs[_0x7e41('0x31')](_0x3457a6[_0x7e41('0x2c')][_0x7e41('0x31')]));_0x2c1f3d[_0x7e41('0x32')]=_0x2c1f3d[_0x7e41('0x32')][_0x7e41('0x33')]?_0x2c1f3d['attributes']:_0x5016c2[_0x7e41('0x2f')];_0x2c1f3d[_0x7e41('0x4a')]=qs['sort'](_0x3457a6[_0x7e41('0x2c')][_0x7e41('0x36')]);_0x2c1f3d['where']=qs['filters'](_[_0x7e41('0x4b')](_0x3457a6[_0x7e41('0x2c')],_0x5016c2[_0x7e41('0x2e')]));if(_0x3457a6[_0x7e41('0x2c')]['filter']){_0x2c1f3d[_0x7e41('0x37')]=_['merge'](_0x2c1f3d[_0x7e41('0x37')],{'$or':_['map'](_0x2c1f3d[_0x7e41('0x32')],function(_0x221677){var _0x515d14={};_0x515d14[_0x221677]={'$like':'%'+_0x3457a6[_0x7e41('0x2c')]['filter']+'%'};return _0x515d14;})});}_0x2c1f3d=_[_0x7e41('0x39')]({},_0x2c1f3d,_0x3457a6[_0x7e41('0x3a')]);return _0x24d64c[_0x7e41('0x49')](_0x2c1f3d);}})[_0x7e41('0x21')](function(_0x5eb1e4){if(_0x5eb1e4){_0x39155c=_0x5eb1e4[_0x7e41('0x33')];if(!_0x3457a6[_0x7e41('0x2c')]['hasOwnProperty'](_0x7e41('0x35'))){_0x2c1f3d['limit']=qs['limit'](_0x3457a6['query'][_0x7e41('0x1a')]);_0x2c1f3d[_0x7e41('0x1b')]=qs[_0x7e41('0x1b')](_0x3457a6[_0x7e41('0x2c')][_0x7e41('0x1b')]);}return _0x24d64c[_0x7e41('0x49')](_0x2c1f3d);}})[_0x7e41('0x21')](function(_0x15a3bd){if(_0x15a3bd){return _0x15a3bd?{'count':_0x39155c,'rows':_0x15a3bd}:null;}})[_0x7e41('0x21')](respondWithResult(_0x59871b,null))[_0x7e41('0x3e')](handleError(_0x59871b,null));};exports[_0x7e41('0x4c')]=function(_0x1b9392,_0x5ba612,_0x52f1f6){return db[_0x7e41('0x4d')][_0x7e41('0x44')]({'where':{'id':_0x1b9392['params']['id']}})[_0x7e41('0x21')](handleEntityNotFound(_0x5ba612,null))[_0x7e41('0x21')](function(_0x522e8f){if(_0x522e8f){return _0x522e8f[_0x7e41('0x4c')](_0x1b9392[_0x7e41('0x43')][_0x7e41('0x47')],_[_0x7e41('0x48')](_0x1b9392[_0x7e41('0x43')],[_0x7e41('0x47'),'id'])||{});}})[_0x7e41('0x21')](respondWithResult(_0x5ba612,null))['catch'](handleError(_0x5ba612,null));};exports['getActions']=function(_0x13f61d,_0x285266,_0x3a9d33){var _0x31f35a={};var _0x288e08={};var _0x2fe30b;var _0x3a9f56;return db[_0x7e41('0x27')]['findOne']({'where':{'id':_0x13f61d[_0x7e41('0x45')]['id']}})[_0x7e41('0x21')](handleEntityNotFound(_0x285266,null))[_0x7e41('0x21')](function(_0x55dbbc){if(_0x55dbbc){_0x2fe30b=_0x55dbbc;_0x288e08[_0x7e41('0x2f')]=_[_0x7e41('0x2d')](db[_0x7e41('0x4d')]['rawAttributes']);_0x288e08[_0x7e41('0x2c')]=_[_0x7e41('0x2d')](_0x13f61d[_0x7e41('0x2c')]);_0x288e08[_0x7e41('0x2e')]=_[_0x7e41('0x30')](_0x288e08['model'],_0x288e08[_0x7e41('0x2c')]);_0x31f35a['attributes']=_[_0x7e41('0x30')](_0x288e08[_0x7e41('0x2f')],qs['fields'](_0x13f61d[_0x7e41('0x2c')][_0x7e41('0x31')]));_0x31f35a[_0x7e41('0x32')]=_0x31f35a[_0x7e41('0x32')]['length']?_0x31f35a[_0x7e41('0x32')]:_0x288e08[_0x7e41('0x2f')];_0x31f35a['order']=qs[_0x7e41('0x36')](_0x13f61d[_0x7e41('0x2c')][_0x7e41('0x36')]);_0x31f35a['where']=qs[_0x7e41('0x2e')](_[_0x7e41('0x4b')](_0x13f61d['query'],_0x288e08[_0x7e41('0x2e')]));if(_0x13f61d[_0x7e41('0x2c')]['filter']){_0x31f35a[_0x7e41('0x37')]=_['merge'](_0x31f35a['where'],{'$or':_[_0x7e41('0x26')](_0x31f35a[_0x7e41('0x32')],function(_0x3886a3){var _0x23d62f={};_0x23d62f[_0x3886a3]={'$like':'%'+_0x13f61d['query'][_0x7e41('0x38')]+'%'};return _0x23d62f;})});}_0x31f35a=_['merge']({},_0x31f35a,_0x13f61d[_0x7e41('0x3a')]);return _0x2fe30b[_0x7e41('0x4e')](_0x31f35a);}})[_0x7e41('0x21')](function(_0x47045e){if(_0x47045e){_0x3a9f56=_0x47045e[_0x7e41('0x33')];if(!_0x13f61d[_0x7e41('0x2c')][_0x7e41('0x34')](_0x7e41('0x35'))){_0x31f35a[_0x7e41('0x1a')]=qs[_0x7e41('0x1a')](_0x13f61d['query'][_0x7e41('0x1a')]);_0x31f35a[_0x7e41('0x1b')]=qs[_0x7e41('0x1b')](_0x13f61d[_0x7e41('0x2c')][_0x7e41('0x1b')]);}return _0x2fe30b[_0x7e41('0x4e')](_0x31f35a);}})[_0x7e41('0x21')](function(_0x6bac9){if(_0x6bac9){return _0x6bac9?{'count':_0x3a9f56,'rows':_0x6bac9}:null;}})[_0x7e41('0x21')](respondWithResult(_0x285266,null))['catch'](handleError(_0x285266,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index d5cc68b..82af16f 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 _0x7d1b=['moment','path','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','../../config/logger','api'];(function(_0x8b0118,_0x435387){var _0x5068af=function(_0x2477ac){while(--_0x2477ac){_0x8b0118['push'](_0x8b0118['shift']());}};_0x5068af(++_0x435387);}(_0x7d1b,0x97));var _0xb7d1=function(_0x597235,_0x29ae4b){_0x597235=_0x597235-0x0;var _0x4d77bf=_0x7d1b[_0x597235];return _0x4d77bf;};'use strict';var _=require(_0xb7d1('0x0'));var util=require('util');var logger=require(_0xb7d1('0x1'))(_0xb7d1('0x2'));var moment=require(_0xb7d1('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb7d1('0x4'));var rimraf=require('rimraf');var config=require(_0xb7d1('0x5'));var attributes=require(_0xb7d1('0x6'));module[_0xb7d1('0x7')]=function(_0x4a26c0,_0x3b9241){return _0x4a26c0[_0xb7d1('0x8')](_0xb7d1('0x9'),attributes,{'tableName':_0xb7d1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x292c=['./automation.attributes','exports','define','Automation','tools_automations','lodash','../../config/logger','path','rimraf','../../config/environment'];(function(_0x50d3e0,_0x15a289){var _0x2ba9d1=function(_0x35344c){while(--_0x35344c){_0x50d3e0['push'](_0x50d3e0['shift']());}};_0x2ba9d1(++_0x15a289);}(_0x292c,0x19f));var _0xc292=function(_0x45346d,_0xffd56b){_0x45346d=_0x45346d-0x0;var _0x5ce7ca=_0x292c[_0x45346d];return _0x5ce7ca;};'use strict';var _=require(_0xc292('0x0'));var util=require('util');var logger=require(_0xc292('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc292('0x2'));var rimraf=require(_0xc292('0x3'));var config=require(_0xc292('0x4'));var attributes=require(_0xc292('0x5'));module[_0xc292('0x6')]=function(_0x125c9f,_0x14417a){return _0x125c9f[_0xc292('0x7')](_0xc292('0x8'),attributes,{'tableName':_0xc292('0x9'),'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 384ebb9..914348e 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 _0xe820=['message','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2ec2bf,_0x64e983){var _0x2c279c=function(_0x41fe42){while(--_0x41fe42){_0x2ec2bf['push'](_0x2ec2bf['shift']());}};_0x2c279c(++_0x64e983);}(_0xe820,0xd2));var _0x0e82=function(_0x59c954,_0x12db52){_0x59c954=_0x59c954-0x0;var _0x15b6db=_0xe820[_0x59c954];return _0x15b6db;};'use strict';var _=require(_0x0e82('0x0'));var util=require('util');var moment=require(_0x0e82('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e82('0x2'));var db=require(_0x0e82('0x3'))['db'];var utils=require(_0x0e82('0x4'));var logger=require('../../config/logger')(_0x0e82('0x5'));var config=require('../../config/environment');var jayson=require(_0x0e82('0x6'));var client=jayson[_0x0e82('0x7')][_0x0e82('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x328b32,_0x2a0f9b,_0x55f277){return new BPromise(function(_0x10013b,_0x33c8a2){return client[_0x0e82('0x9')](_0x328b32,_0x55f277)[_0x0e82('0xa')](function(_0x3b7792){logger['info'](_0x0e82('0xb'),_0x2a0f9b,_0x0e82('0xc'));logger[_0x0e82('0xd')](_0x0e82('0xe'),_0x2a0f9b,_0x0e82('0xc'),JSON[_0x0e82('0xf')](_0x3b7792));if(_0x3b7792[_0x0e82('0x10')]){if(_0x3b7792['error'][_0x0e82('0x11')]===0x1f4){logger[_0x0e82('0x10')](_0x0e82('0xb'),_0x2a0f9b,_0x3b7792[_0x0e82('0x10')][_0x0e82('0x12')]);return _0x33c8a2(_0x3b7792[_0x0e82('0x10')]['message']);}logger[_0x0e82('0x10')]('Automation,\x20%s,\x20%s',_0x2a0f9b,_0x3b7792['error'][_0x0e82('0x12')]);return _0x10013b(_0x3b7792['error']['message']);}else{logger['info'](_0x0e82('0xb'),_0x2a0f9b,'request\x20sent');_0x10013b(_0x3b7792['result'][_0x0e82('0x12')]);}})['catch'](function(_0x319303){logger[_0x0e82('0x10')](_0x0e82('0xb'),_0x2a0f9b,_0x319303);_0x33c8a2(_0x319303);});});} \ No newline at end of file +var _0x48ac=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','bluebird','randomstring','ioredis'];(function(_0x11725e,_0x5c97da){var _0xb8cd4d=function(_0x3866d0){while(--_0x3866d0){_0x11725e['push'](_0x11725e['shift']());}};_0xb8cd4d(++_0x5c97da);}(_0x48ac,0xe0));var _0xc48a=function(_0x4486f4,_0x175d78){_0x4486f4=_0x4486f4-0x0;var _0x2d82c5=_0x48ac[_0x4486f4];return _0x2d82c5;};'use strict';var _=require('lodash');var util=require(_0xc48a('0x0'));var moment=require('moment');var BPromise=require(_0xc48a('0x1'));var rs=require(_0xc48a('0x2'));var fs=require('fs');var Redis=require(_0xc48a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc48a('0x4'));var logger=require(_0xc48a('0x5'))(_0xc48a('0x6'));var config=require(_0xc48a('0x7'));var jayson=require(_0xc48a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5df462,_0x5cffd4,_0x1e1e1a){return new BPromise(function(_0xf0c31b,_0x2c3285){return client['request'](_0x5df462,_0x1e1e1a)[_0xc48a('0x9')](function(_0x43461a){logger[_0xc48a('0xa')](_0xc48a('0xb'),_0x5cffd4,_0xc48a('0xc'));logger[_0xc48a('0xd')](_0xc48a('0xe'),_0x5cffd4,_0xc48a('0xc'),JSON[_0xc48a('0xf')](_0x43461a));if(_0x43461a[_0xc48a('0x10')]){if(_0x43461a[_0xc48a('0x10')]['code']===0x1f4){logger[_0xc48a('0x10')](_0xc48a('0xb'),_0x5cffd4,_0x43461a[_0xc48a('0x10')]['message']);return _0x2c3285(_0x43461a[_0xc48a('0x10')][_0xc48a('0x11')]);}logger['error'](_0xc48a('0xb'),_0x5cffd4,_0x43461a[_0xc48a('0x10')][_0xc48a('0x11')]);return _0xf0c31b(_0x43461a['error'][_0xc48a('0x11')]);}else{logger[_0xc48a('0xa')](_0xc48a('0xb'),_0x5cffd4,'request\x20sent');_0xf0c31b(_0x43461a[_0xc48a('0x12')][_0xc48a('0x11')]);}})['catch'](function(_0x5c319b){logger[_0xc48a('0x10')]('Automation,\x20%s,\x20%s',_0x5cffd4,_0x5c319b);_0x2c3285(_0x5c319b);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index c8b7b0f..0c91636 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 _0x5735=['/:id/actions','post','/:id/conditions','addConditions','addActions','put','update','delete','destroy','exports','multer','connect-timeout','express','../../components/interaction/service','../../config/environment','./automation.controller','get','index','/:id','isAuthenticated','show','getConditions'];(function(_0x519fc9,_0x2ffcb7){var _0xb3c7c1=function(_0x54090b){while(--_0x54090b){_0x519fc9['push'](_0x519fc9['shift']());}};_0xb3c7c1(++_0x2ffcb7);}(_0x5735,0x16a));var _0x5573=function(_0x2900bf,_0x396900){_0x2900bf=_0x2900bf-0x0;var _0x4ff896=_0x5735[_0x2900bf];return _0x4ff896;};'use strict';var multer=require(_0x5573('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5573('0x1'));var express=require(_0x5573('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5573('0x3'));var config=require(_0x5573('0x4'));var controller=require(_0x5573('0x5'));router[_0x5573('0x6')]('/',auth['isAuthenticated'](),controller[_0x5573('0x7')]);router[_0x5573('0x6')](_0x5573('0x8'),auth[_0x5573('0x9')](),controller[_0x5573('0xa')]);router[_0x5573('0x6')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x5573('0xb')]);router[_0x5573('0x6')](_0x5573('0xc'),auth[_0x5573('0x9')](),controller['getActions']);router['post']('/',auth[_0x5573('0x9')](),controller['create']);router[_0x5573('0xd')](_0x5573('0xe'),auth[_0x5573('0x9')](),controller[_0x5573('0xf')]);router[_0x5573('0xd')](_0x5573('0xc'),auth[_0x5573('0x9')](),controller[_0x5573('0x10')]);router[_0x5573('0x11')](_0x5573('0x8'),auth['isAuthenticated'](),controller[_0x5573('0x12')]);router[_0x5573('0x13')]('/:id',auth[_0x5573('0x9')](),controller[_0x5573('0x14')]);module[_0x5573('0x15')]=router; \ No newline at end of file +var _0xc5e6=['post','addActions','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./automation.controller','get','index','/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','create'];(function(_0x1526cd,_0xf3ea74){var _0x195505=function(_0x726bd){while(--_0x726bd){_0x1526cd['push'](_0x1526cd['shift']());}};_0x195505(++_0xf3ea74);}(_0xc5e6,0x83));var _0x6c5e=function(_0x8c64d9,_0x45535c){_0x8c64d9=_0x8c64d9-0x0;var _0x22b21e=_0xc5e6[_0x8c64d9];return _0x22b21e;};'use strict';var multer=require(_0x6c5e('0x0'));var util=require(_0x6c5e('0x1'));var path=require(_0x6c5e('0x2'));var timeout=require(_0x6c5e('0x3'));var express=require(_0x6c5e('0x4'));var router=express[_0x6c5e('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6c5e('0x6'));var config=require(_0x6c5e('0x7'));var controller=require(_0x6c5e('0x8'));router[_0x6c5e('0x9')]('/',auth['isAuthenticated'](),controller[_0x6c5e('0xa')]);router[_0x6c5e('0x9')](_0x6c5e('0xb'),auth[_0x6c5e('0xc')](),controller[_0x6c5e('0xd')]);router['get'](_0x6c5e('0xe'),auth[_0x6c5e('0xc')](),controller[_0x6c5e('0xf')]);router[_0x6c5e('0x9')](_0x6c5e('0x10'),auth['isAuthenticated'](),controller[_0x6c5e('0x11')]);router['post']('/',auth[_0x6c5e('0xc')](),controller[_0x6c5e('0x12')]);router['post'](_0x6c5e('0xe'),auth[_0x6c5e('0xc')](),controller['addConditions']);router[_0x6c5e('0x13')](_0x6c5e('0x10'),auth[_0x6c5e('0xc')](),controller[_0x6c5e('0x14')]);router['put'](_0x6c5e('0xb'),auth['isAuthenticated'](),controller[_0x6c5e('0x15')]);router[_0x6c5e('0x16')]('/:id',auth[_0x6c5e('0xc')](),controller[_0x6c5e('0x17')]);module[_0x6c5e('0x18')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 6d11146..de6fcd9 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 _0x011a=['INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\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)','STRING','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','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)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','ENUM','ivr','BOOLEAN'];(function(_0x2bdce2,_0x133bec){var _0x13052d=function(_0x2e0030){while(--_0x2e0030){_0x2bdce2['push'](_0x2bdce2['shift']());}};_0x13052d(++_0x133bec);}(_0x011a,0x16d));var _0xa011=function(_0x2c8350,_0x5126ed){_0x2c8350=_0x2c8350-0x0;var _0x4d5530=_0x011a[_0x2c8350];return _0x4d5530;};'use strict';var Sequelize=require(_0xa011('0x0'));module[_0xa011('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xa011('0x2')]('ivr'),'allowNull':![],'defaultValue':_0xa011('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xa011('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xa011('0x5')](0x4)[_0xa011('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xa011('0x7')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xa011('0x5')](0x3)[_0xa011('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa011('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xa011('0x5')](0x3)[_0xa011('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa011('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xa011('0x5')](0x5)[_0xa011('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa011('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa011('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xa011('0x5')](0x5)[_0xa011('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa011('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa011('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xa011('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa011('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa011('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa011('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa011('0xe')},'dialTimezone':{'type':Sequelize[_0xa011('0xf')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa011('0xf')],'defaultValue':_0xa011('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xa011('0x11'),_0xa011('0x12'),_0xa011('0x13')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xa011('0x4')],'defaultValue':0x0,'comment':_0xa011('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xa011('0x5')](0x9)[_0xa011('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa011('0x15')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xa011('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xa011('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa011('0x5')](0x9)[_0xa011('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa011('0x5')](0x9)[_0xa011('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa011('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xa011('0x5')](0x9)[_0xa011('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa011('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa011('0x5')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa011('0x5')](0x9)[_0xa011('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa011('0x5')](0x5)[_0xa011('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa011('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa011('0x5')](0x9)[_0xa011('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa011('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xa011('0x2')](_0xa011('0x1b'),_0xa011('0x1c')),'defaultValue':_0xa011('0x1b')},'dialPrefix':{'type':Sequelize[_0xa011('0xf')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xa011('0x5')](0x3)[_0xa011('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa011('0x1d')},'dialCutDigit':{'type':Sequelize[_0xa011('0x5')](0x3)[_0xa011('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa011('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa011('0x5')](0x3)[_0xa011('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa011('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa011('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xa011('0x5')](0x3)[_0xa011('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xa011('0x5')](0x5)[_0xa011('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa011('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa011('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa011('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa011('0x5')](0x5)[_0xa011('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa011('0x23')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa011('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xa011('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xa011('0x5')](0x3)[_0xa011('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa011('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa011('0x24')}}; \ No newline at end of file +var _0xd3a2=['Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','STRING'];(function(_0x54b283,_0x5eb8a6){var _0x2462b3=function(_0x13fca7){while(--_0x13fca7){_0x54b283['push'](_0x54b283['shift']());}};_0x2462b3(++_0x5eb8a6);}(_0xd3a2,0x7c));var _0x2d3a=function(_0x4d86ee,_0xc48f04){_0x4d86ee=_0x4d86ee-0x0;var _0x4df757=_0xd3a2[_0x4d86ee];return _0x4df757;};'use strict';var Sequelize=require('sequelize');module[_0x2d3a('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x2d3a('0x1')]('ivr'),'allowNull':![],'defaultValue':_0x2d3a('0x2')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2d3a('0x3')},'limitCalls':{'type':Sequelize[_0x2d3a('0x4')](0x4)[_0x2d3a('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x2d3a('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0x2d3a('0x7')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x2d3a('0x4')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2d3a('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x2d3a('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2d3a('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2d3a('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x2d3a('0x4')](0x3)[_0x2d3a('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2d3a('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x2d3a('0x4')](0x5)[_0x2d3a('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2d3a('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x2d3a('0x4')](0x3)[_0x2d3a('0x5')],'defaultValue':0x3,'comment':_0x2d3a('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x2d3a('0x4')](0x5)[_0x2d3a('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2d3a('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x2d3a('0xe')},'dialTimezone':{'type':Sequelize[_0x2d3a('0x7')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x2d3a('0x7')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x2d3a('0xf'),_0x2d3a('0x10'),_0x2d3a('0x11')),'defaultValue':_0x2d3a('0xf')},'dialAMDActive':{'type':Sequelize[_0x2d3a('0x12')],'defaultValue':0x0,'comment':_0x2d3a('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x2d3a('0x4')](0x9)[_0x2d3a('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x2d3a('0x4')](0x9)[_0x2d3a('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x2d3a('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x2d3a('0x4')](0x9)[_0x2d3a('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2d3a('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x2d3a('0x4')](0x9)[_0x2d3a('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x2d3a('0x4')](0x9)[_0x2d3a('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x2d3a('0x4')](0x9)[_0x2d3a('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x2d3a('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x2d3a('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x2d3a('0x4')](0x9)[_0x2d3a('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2d3a('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0x2d3a('0x1')](_0x2d3a('0x18'),'ASC'),'defaultValue':_0x2d3a('0x18')},'dialPrefix':{'type':Sequelize[_0x2d3a('0x7')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2d3a('0x19')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x2d3a('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2d3a('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2d3a('0x1a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x2d3a('0x4')](0x5)[_0x2d3a('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2d3a('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0x2d3a('0x4')](0x3)[_0x2d3a('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x2d3a('0x4')](0x5)[_0x2d3a('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2d3a('0x1c')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x2d3a('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2d3a('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x2d3a('0x4')](0x5)[_0x2d3a('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x2d3a('0x4')](0x3)[_0x2d3a('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2d3a('0x1e')},'dialMachineRetryFrequency':{'type':Sequelize[_0x2d3a('0x4')](0x5)[_0x2d3a('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2d3a('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2d3a('0x1f')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x2d3a('0x4')](0x5)[_0x2d3a('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2d3a('0x20')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 8967918..df3f9f7 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 _0x633b=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','clone','rawAttributes','createdAt','updatedAt','omit','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','order','getHopperFinals','CmHopperFinal','getHopperBlacks','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','phone','scheduledAt','ContactId','ListId','select','field','NOW()','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','CampaignId\x20=\x20?','onlyIfOpen','fromQuery','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','CmHopperBlack','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','save','update','then','destroy','get','IvrCampaigns','error','stack','index','map','Campaign','fieldName','type','key','name','query','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','show','params','keys','fields','include','find','catch'];(function(_0x49ab86,_0x4b73c7){var _0xd7df69=function(_0x2658ff){while(--_0x2658ff){_0x49ab86['push'](_0x49ab86['shift']());}};_0xd7df69(++_0x4b73c7);}(_0x633b,0x153));var _0xb633=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x633b[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xb633('0x0'));var rimraf=require(_0xb633('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb633('0x2'));var rp=require(_0xb633('0x3'));var moment=require(_0xb633('0x4'));var BPromise=require(_0xb633('0x5'));var Mustache=require(_0xb633('0x6'));var util=require('util');var path=require('path');var sox=require(_0xb633('0x7'));var csv=require(_0xb633('0x8'));var ejs=require(_0xb633('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb633('0xa'));var squel=require(_0xb633('0xb'));var crypto=require(_0xb633('0xc'));var jsforce=require(_0xb633('0xd'));var deskjs=require(_0xb633('0xe'));var toCsv=require(_0xb633('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb633('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb633('0x10'));var as=require(_0xb633('0x11'));var hardwareService=require(_0xb633('0x12'));var logger=require(_0xb633('0x13'))('api');var utils=require(_0xb633('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb633('0x15'));var db=require(_0xb633('0x16'))['db'];function respondWithStatusCode(_0x42821b,_0x550ced){_0x550ced=_0x550ced||0xcc;return function(_0x2aa82b){if(_0x2aa82b){return _0x42821b[_0xb633('0x17')](_0x550ced);}return _0x42821b[_0xb633('0x18')](_0x550ced)[_0xb633('0x19')]();};}function respondWithResult(_0x2cac80,_0x2fef52){_0x2fef52=_0x2fef52||0xc8;return function(_0x176ca7){if(_0x176ca7){return _0x2cac80['status'](_0x2fef52)['json'](_0x176ca7);}};}function respondWithFilteredResult(_0x498148,_0x4d447b){return function(_0x289984){if(_0x289984){var _0x5ece56=typeof _0x4d447b[_0xb633('0x1a')]==='undefined'&&typeof _0x4d447b['limit']===_0xb633('0x1b');var _0x1f75bc=_0x289984['count'];var _0x15f45c=_0x5ece56?0x0:_0x4d447b['offset'];var _0x489092=_0x5ece56?_0x289984[_0xb633('0x1c')]:_0x4d447b[_0xb633('0x1a')]+_0x4d447b[_0xb633('0x1d')];var _0x1384a9;if(_0x489092>=_0x1f75bc){_0x489092=_0x1f75bc;_0x1384a9=0xc8;}else{_0x1384a9=0xce;}_0x498148[_0xb633('0x18')](_0x1384a9);return _0x498148[_0xb633('0x1e')](_0xb633('0x1f'),_0x15f45c+'-'+_0x489092+'/'+_0x1f75bc)[_0xb633('0x20')](_0x289984);}return null;};}function patchUpdates(_0x5b4339){return function(_0x8fe8d0){try{jsonpatch['apply'](_0x8fe8d0,_0x5b4339,!![]);}catch(_0x1642e4){return BPromise['reject'](_0x1642e4);}return _0x8fe8d0[_0xb633('0x21')]();};}function saveUpdates(_0x5ce4fe,_0x5645d3){return function(_0x4d6142){if(_0x4d6142){return _0x4d6142[_0xb633('0x22')](_0x5ce4fe)[_0xb633('0x23')](function(_0x4a4009){return _0x4a4009;});}return null;};}function removeEntity(_0x3756bc,_0x1ad7ea){return function(_0x12c639){if(_0x12c639){return _0x12c639[_0xb633('0x24')]()['then'](function(){var _0xa5214c=_0x12c639[_0xb633('0x25')]({'plain':!![]});var _0x518dc2=_0xb633('0x26');return db['UserProfileResource'][_0xb633('0x24')]({'where':{'type':_0x518dc2,'resourceId':_0xa5214c['id']}})[_0xb633('0x23')](function(){return _0x12c639;});})[_0xb633('0x23')](function(){_0x3756bc[_0xb633('0x18')](0xcc)[_0xb633('0x19')]();});}};}function handleEntityNotFound(_0x364ff3,_0x16b73d){return function(_0xdd833e){if(!_0xdd833e){_0x364ff3['sendStatus'](0x194);}return _0xdd833e;};}function handleError(_0x261054,_0x4952e9){_0x4952e9=_0x4952e9||0x1f4;return function(_0x89b9e8){logger[_0xb633('0x27')](_0x89b9e8[_0xb633('0x28')]);if(_0x89b9e8['name']){delete _0x89b9e8['name'];}_0x261054['status'](_0x4952e9)['send'](_0x89b9e8);};}exports[_0xb633('0x29')]=function(_0xab28c8,_0x16ecb4){var _0x52ee95={},_0x5622ab={},_0x56b908={'count':0x0,'rows':[]};var _0x5a6e9c=_[_0xb633('0x2a')](db[_0xb633('0x2b')]['rawAttributes'],function(_0x33ab5a){return{'name':_0x33ab5a[_0xb633('0x2c')],'type':_0x33ab5a[_0xb633('0x2d')][_0xb633('0x2e')]};});_0x5622ab['model']=_[_0xb633('0x2a')](_0x5a6e9c,_0xb633('0x2f'));_0x5622ab[_0xb633('0x30')]=_['keys'](_0xab28c8[_0xb633('0x30')]);_0x5622ab['filters']=_[_0xb633('0x31')](_0x5622ab['model'],_0x5622ab[_0xb633('0x30')]);_0x52ee95['attributes']=_[_0xb633('0x31')](_0x5622ab[_0xb633('0x32')],qs['fields'](_0xab28c8[_0xb633('0x30')]['fields']));_0x52ee95[_0xb633('0x33')]=_0x52ee95[_0xb633('0x33')][_0xb633('0x34')]?_0x52ee95['attributes']:_0x5622ab[_0xb633('0x32')];if(!_0xab28c8[_0xb633('0x30')][_0xb633('0x35')](_0xb633('0x36'))){_0x52ee95[_0xb633('0x1d')]=qs[_0xb633('0x1d')](_0xab28c8[_0xb633('0x30')][_0xb633('0x1d')]);_0x52ee95[_0xb633('0x1a')]=qs[_0xb633('0x1a')](_0xab28c8[_0xb633('0x30')]['offset']);}_0x52ee95['order']=qs[_0xb633('0x37')](_0xab28c8[_0xb633('0x30')][_0xb633('0x37')]);_0x52ee95[_0xb633('0x38')]=qs[_0xb633('0x39')](_[_0xb633('0x3a')](_0xab28c8['query'],_0x5622ab[_0xb633('0x39')]),_0x5a6e9c);if(_0xab28c8[_0xb633('0x30')][_0xb633('0x3b')]){_0x52ee95[_0xb633('0x38')]=_['merge'](_0x52ee95[_0xb633('0x38')],{'$or':_[_0xb633('0x2a')](_0x5a6e9c,function(_0xc8acd7){if(_0xc8acd7[_0xb633('0x2d')]!=='VIRTUAL'){var _0x523fac={};_0x523fac[_0xc8acd7[_0xb633('0x2f')]]={'$like':'%'+_0xab28c8[_0xb633('0x30')][_0xb633('0x3b')]+'%'};return _0x523fac;}})});}_0x52ee95=_[_0xb633('0x3c')]({},_0x52ee95,_0xab28c8[_0xb633('0x3d')]);var _0x237c71={'where':_0x52ee95[_0xb633('0x38')]};return db['Campaign'][_0xb633('0x1c')](_0x237c71)['then'](function(_0x50fe4b){_0x56b908[_0xb633('0x1c')]=_0x50fe4b;if(_0xab28c8[_0xb633('0x30')][_0xb633('0x3e')]){_0x52ee95['include']=[{'all':!![]}];}return db[_0xb633('0x2b')][_0xb633('0x3f')](_0x52ee95);})[_0xb633('0x23')](function(_0x279af6){_0x56b908[_0xb633('0x40')]=_0x279af6;return _0x56b908;})[_0xb633('0x23')](respondWithFilteredResult(_0x16ecb4,_0x52ee95))['catch'](handleError(_0x16ecb4,null));};exports[_0xb633('0x41')]=function(_0x308906,_0x500c0d){var _0x5ab4e4={'raw':![],'where':{'id':_0x308906[_0xb633('0x42')]['id']}},_0x436a7b={};_0x436a7b[_0xb633('0x32')]=_[_0xb633('0x43')](db[_0xb633('0x2b')]['rawAttributes']);_0x436a7b[_0xb633('0x30')]=_[_0xb633('0x43')](_0x308906['query']);_0x436a7b[_0xb633('0x39')]=_[_0xb633('0x31')](_0x436a7b['model'],_0x436a7b['query']);_0x5ab4e4[_0xb633('0x33')]=_[_0xb633('0x31')](_0x436a7b[_0xb633('0x32')],qs[_0xb633('0x44')](_0x308906[_0xb633('0x30')][_0xb633('0x44')]));_0x5ab4e4[_0xb633('0x33')]=_0x5ab4e4['attributes'][_0xb633('0x34')]?_0x5ab4e4[_0xb633('0x33')]:_0x436a7b[_0xb633('0x32')];if(_0x308906[_0xb633('0x30')]['includeAll']){_0x5ab4e4[_0xb633('0x45')]=[{'all':!![]}];}_0x5ab4e4=_['merge']({},_0x5ab4e4,_0x308906[_0xb633('0x3d')]);return db[_0xb633('0x2b')][_0xb633('0x46')](_0x5ab4e4)['then'](handleEntityNotFound(_0x500c0d,null))[_0xb633('0x23')](respondWithResult(_0x500c0d,null))[_0xb633('0x47')](handleError(_0x500c0d,null));};exports[_0xb633('0x48')]=function(_0xca280,_0x38f514){return db['Campaign'][_0xb633('0x48')](_0xca280[_0xb633('0x49')],{})['then'](function(_0x11a27b){var _0x2b0fd4=_0xca280[_0xb633('0x4a')]['get']({'plain':!![]});if(!_0x2b0fd4)throw new Error(_0xb633('0x4b'));if(_0x2b0fd4[_0xb633('0x4c')]===_0xb633('0x4a')){var _0x343c9f=_0x11a27b[_0xb633('0x25')]({'plain':!![]});var _0x30a0ea='IvrCampaigns';return db[_0xb633('0x4d')][_0xb633('0x46')]({'where':{'name':_0x30a0ea,'userProfileId':_0x2b0fd4[_0xb633('0x4e')]},'raw':!![]})['then'](function(_0x56dc5e){if(_0x56dc5e&&_0x56dc5e['autoAssociation']===0x0){return db[_0xb633('0x4f')][_0xb633('0x48')]({'name':_0x343c9f[_0xb633('0x2f')],'resourceId':_0x343c9f['id'],'type':_0x56dc5e['name'],'sectionId':_0x56dc5e['id']},{})[_0xb633('0x23')](function(){return _0x11a27b;});}else{return _0x11a27b;}})[_0xb633('0x47')](function(_0x50cf6d){logger[_0xb633('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50cf6d);throw _0x50cf6d;});}return _0x11a27b;})[_0xb633('0x23')](respondWithResult(_0x38f514,0xc9))[_0xb633('0x47')](handleError(_0x38f514,null));};exports[_0xb633('0x50')]=function(_0x496b3d,_0x4a0be9){var _0x31f75a={'where':{'id':_0x496b3d[_0xb633('0x42')]['id']}},_0x45e42c={};_0x45e42c[_0xb633('0x32')]=_[_0xb633('0x43')](db[_0xb633('0x2b')][_0xb633('0x51')]);_0x31f75a[_0xb633('0x33')]=_[_0xb633('0x31')](_0x45e42c[_0xb633('0x32')],qs[_0xb633('0x44')](_0x496b3d[_0xb633('0x30')]['fields']));_0x31f75a[_0xb633('0x33')]=_0x31f75a[_0xb633('0x33')][_0xb633('0x34')]?_0x31f75a['attributes']:_0x45e42c['model'];if(_0x496b3d[_0xb633('0x30')]['includeAll']){_0x31f75a[_0xb633('0x45')]=[{'all':!![]}];}_0x31f75a=_['merge']({},_0x31f75a,_0x496b3d[_0xb633('0x3d')]);return db['Campaign']['find'](_0x31f75a)[_0xb633('0x23')](handleEntityNotFound(_0x4a0be9,null))[_0xb633('0x23')](function(_0x3aa4f3){if(_0x3aa4f3){var _0x1c01b1=_0x3aa4f3['get']({'plain':!![]});_0x1c01b1=qs['omit'](_0x1c01b1,['id',_0xb633('0x52'),_0xb633('0x53')]);_0x496b3d[_0xb633('0x49')]=_[_0xb633('0x54')](_0x496b3d[_0xb633('0x49')],['id','createdAt',_0xb633('0x53')]);return db[_0xb633('0x2b')]['create'](_[_0xb633('0x3c')](_0x1c01b1,_0x496b3d[_0xb633('0x49')]),{'include':_0x496b3d[_0xb633('0x30')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x341470){var _0x193b3b=_0x496b3d[_0xb633('0x4a')][_0xb633('0x25')]({'plain':!![]});if(!_0x193b3b)throw new Error(_0xb633('0x4b'));if(_0x193b3b[_0xb633('0x4c')]===_0xb633('0x4a')){var _0x234376=_0x341470[_0xb633('0x25')]({'plain':!![]});var _0x5c7311='IvrCampaigns';return db[_0xb633('0x4d')][_0xb633('0x46')]({'where':{'name':_0x5c7311,'userProfileId':_0x193b3b[_0xb633('0x4e')]},'raw':!![]})['then'](function(_0x1e55be){if(_0x1e55be&&_0x1e55be[_0xb633('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x234376[_0xb633('0x2f')],'resourceId':_0x234376['id'],'type':_0x1e55be['name'],'sectionId':_0x1e55be['id']},{})[_0xb633('0x23')](function(){return _0x341470;});}else{return _0x341470;}})[_0xb633('0x47')](function(_0x3b55e1){logger[_0xb633('0x27')](_0xb633('0x56'),_0x3b55e1);throw _0x3b55e1;});}return _0x341470;});}})['then'](respondWithResult(_0x4a0be9,0xc9))[_0xb633('0x47')](handleError(_0x4a0be9,null));};exports[_0xb633('0x22')]=function(_0x1412f9,_0x1a73ad){if(_0x1412f9[_0xb633('0x49')]['id']){delete _0x1412f9[_0xb633('0x49')]['id'];}return db[_0xb633('0x2b')]['find']({'where':{'id':_0x1412f9[_0xb633('0x42')]['id']}})['then'](handleEntityNotFound(_0x1a73ad,null))[_0xb633('0x23')](saveUpdates(_0x1412f9[_0xb633('0x49')],null))[_0xb633('0x23')](respondWithResult(_0x1a73ad,null))[_0xb633('0x47')](handleError(_0x1a73ad,null));};exports['destroy']=function(_0x75a4ac,_0x55862d){return db[_0xb633('0x2b')][_0xb633('0x46')]({'where':{'id':_0x75a4ac['params']['id']}})[_0xb633('0x23')](handleEntityNotFound(_0x55862d,null))[_0xb633('0x23')](removeEntity(_0x55862d,null))['catch'](handleError(_0x55862d,null));};exports[_0xb633('0x57')]=function(_0x42380a,_0xf50ba4,_0x2b9ffc){var _0x117ee4={'raw':!![],'where':{}};var _0x3d8958={};var _0x46b5c2={'count':0x0,'rows':[]};return db[_0xb633('0x2b')][_0xb633('0x58')]({'where':{'id':_0x42380a[_0xb633('0x42')]['id']}})[_0xb633('0x23')](handleEntityNotFound(_0xf50ba4,null))[_0xb633('0x23')](function(_0x347d0b){if(_0x347d0b){_0x3d8958[_0xb633('0x32')]=_['keys'](db['CmHopper']['rawAttributes']);_0x3d8958[_0xb633('0x30')]=_['keys'](_0x42380a[_0xb633('0x30')]);_0x3d8958[_0xb633('0x39')]=_['intersection'](_0x3d8958[_0xb633('0x32')],_0x3d8958[_0xb633('0x30')]);_0x117ee4[_0xb633('0x33')]=_['intersection'](_0x3d8958[_0xb633('0x32')],qs['fields'](_0x42380a[_0xb633('0x30')][_0xb633('0x44')]));_0x117ee4[_0xb633('0x33')]=_0x117ee4[_0xb633('0x33')][_0xb633('0x34')]?_0x117ee4[_0xb633('0x33')]:_0x3d8958[_0xb633('0x32')];if(!_0x42380a[_0xb633('0x30')][_0xb633('0x35')](_0xb633('0x36'))){_0x117ee4[_0xb633('0x1d')]=qs[_0xb633('0x1d')](_0x42380a[_0xb633('0x30')][_0xb633('0x1d')]);_0x117ee4[_0xb633('0x1a')]=qs['offset'](_0x42380a[_0xb633('0x30')][_0xb633('0x1a')]);}_0x117ee4['order']=qs[_0xb633('0x37')](_0x42380a[_0xb633('0x30')][_0xb633('0x37')]);_0x117ee4[_0xb633('0x38')]=qs['filters'](_[_0xb633('0x3a')](_0x42380a[_0xb633('0x30')],_0x3d8958[_0xb633('0x39')]));_0x117ee4[_0xb633('0x38')][_0xb633('0x59')]=_0x347d0b['id'];if(_0x42380a[_0xb633('0x30')][_0xb633('0x3b')]){_0x117ee4[_0xb633('0x38')]=_[_0xb633('0x3c')](_0x117ee4[_0xb633('0x38')],{'$or':_['map'](_0x117ee4[_0xb633('0x33')],function(_0x3fddc9){var _0x1b74b7={};_0x1b74b7[_0x3fddc9]={'$like':'%'+_0x42380a['query']['filter']+'%'};return _0x1b74b7;})});}_0x117ee4=_['merge']({},_0x117ee4,_0x42380a[_0xb633('0x3d')]);return db[_0xb633('0x5a')][_0xb633('0x1c')]({'where':_0x117ee4[_0xb633('0x38')]})[_0xb633('0x23')](function(_0x43ca32){_0x46b5c2[_0xb633('0x1c')]=_0x43ca32;if(_0x42380a['query']['includeAll']){_0x117ee4[_0xb633('0x45')]=[{'all':!![]}];}return db[_0xb633('0x5a')]['findAll'](_0x117ee4);})[_0xb633('0x23')](function(_0x44da53){_0x46b5c2[_0xb633('0x40')]=_0x44da53;return _0x46b5c2;});}})[_0xb633('0x23')](respondWithFilteredResult(_0xf50ba4,_0x117ee4))[_0xb633('0x47')](handleError(_0xf50ba4,null));};exports[_0xb633('0x5b')]=function(_0x101e31,_0x231c32,_0x47fb4f){var _0x166ed8={'raw':!![],'where':{}};var _0xd45f28={};var _0x4e7e2f={'count':0x0,'rows':[]};return db[_0xb633('0x2b')][_0xb633('0x58')]({'where':{'id':_0x101e31['params']['id']}})[_0xb633('0x23')](handleEntityNotFound(_0x231c32,null))[_0xb633('0x23')](function(_0x3f7684){if(_0x3f7684){_0xd45f28[_0xb633('0x32')]=_[_0xb633('0x43')](db[_0xb633('0x5c')]['rawAttributes']);_0xd45f28[_0xb633('0x30')]=_['keys'](_0x101e31[_0xb633('0x30')]);_0xd45f28[_0xb633('0x39')]=_['intersection'](_0xd45f28['model'],_0xd45f28['query']);_0x166ed8[_0xb633('0x33')]=_[_0xb633('0x31')](_0xd45f28[_0xb633('0x32')],qs['fields'](_0x101e31['query'][_0xb633('0x44')]));_0x166ed8['attributes']=_0x166ed8[_0xb633('0x33')][_0xb633('0x34')]?_0x166ed8[_0xb633('0x33')]:_0xd45f28[_0xb633('0x32')];if(!_0x101e31[_0xb633('0x30')][_0xb633('0x35')](_0xb633('0x36'))){_0x166ed8['limit']=qs[_0xb633('0x1d')](_0x101e31[_0xb633('0x30')][_0xb633('0x1d')]);_0x166ed8[_0xb633('0x1a')]=qs[_0xb633('0x1a')](_0x101e31[_0xb633('0x30')][_0xb633('0x1a')]);}_0x166ed8[_0xb633('0x5d')]=qs[_0xb633('0x37')](_0x101e31[_0xb633('0x30')][_0xb633('0x37')]);_0x166ed8['where']=qs[_0xb633('0x39')](_['pick'](_0x101e31[_0xb633('0x30')],_0xd45f28[_0xb633('0x39')]));_0x166ed8[_0xb633('0x38')][_0xb633('0x59')]=_0x3f7684['id'];if(_0x101e31['query'][_0xb633('0x3b')]){_0x166ed8['where']=_[_0xb633('0x3c')](_0x166ed8[_0xb633('0x38')],{'$or':_[_0xb633('0x2a')](_0x166ed8[_0xb633('0x33')],function(_0x355bf7){var _0x4ca84a={};_0x4ca84a[_0x355bf7]={'$like':'%'+_0x101e31[_0xb633('0x30')][_0xb633('0x3b')]+'%'};return _0x4ca84a;})});}_0x166ed8=_[_0xb633('0x3c')]({},_0x166ed8,_0x101e31[_0xb633('0x3d')]);return db[_0xb633('0x5c')][_0xb633('0x1c')]({'where':_0x166ed8[_0xb633('0x38')]})[_0xb633('0x23')](function(_0x22171b){_0x4e7e2f['count']=_0x22171b;if(_0x101e31[_0xb633('0x30')]['includeAll']){_0x166ed8['include']=[{'all':!![]}];}return db[_0xb633('0x5c')][_0xb633('0x3f')](_0x166ed8);})['then'](function(_0x4de4e8){_0x4e7e2f[_0xb633('0x40')]=_0x4de4e8;return _0x4e7e2f;});}})[_0xb633('0x23')](respondWithFilteredResult(_0x231c32,_0x166ed8))[_0xb633('0x47')](handleError(_0x231c32,null));};exports[_0xb633('0x5e')]=function(_0x4d5c45,_0x5862f4,_0x4b5865){var _0x5c533e={'raw':!![],'where':{}};var _0x2ce42b={};var _0x5c7f05={'count':0x0,'rows':[]};return db[_0xb633('0x2b')][_0xb633('0x58')]({'where':{'id':_0x4d5c45[_0xb633('0x42')]['id']}})['then'](handleEntityNotFound(_0x5862f4,null))['then'](function(_0x2d3540){if(_0x2d3540){_0x2ce42b['model']=_[_0xb633('0x43')](db[_0xb633('0x5f')][_0xb633('0x51')]);_0x2ce42b[_0xb633('0x30')]=_['keys'](_0x4d5c45[_0xb633('0x30')]);_0x2ce42b['filters']=_['intersection'](_0x2ce42b['model'],_0x2ce42b['query']);_0x5c533e[_0xb633('0x33')]=_[_0xb633('0x31')](_0x2ce42b[_0xb633('0x32')],qs[_0xb633('0x44')](_0x4d5c45[_0xb633('0x30')][_0xb633('0x44')]));_0x5c533e[_0xb633('0x33')]=_0x5c533e[_0xb633('0x33')][_0xb633('0x34')]?_0x5c533e[_0xb633('0x33')]:_0x2ce42b[_0xb633('0x32')];if(!_0x4d5c45[_0xb633('0x30')][_0xb633('0x35')](_0xb633('0x36'))){_0x5c533e[_0xb633('0x1d')]=qs[_0xb633('0x1d')](_0x4d5c45[_0xb633('0x30')][_0xb633('0x1d')]);_0x5c533e[_0xb633('0x1a')]=qs[_0xb633('0x1a')](_0x4d5c45[_0xb633('0x30')][_0xb633('0x1a')]);}_0x5c533e[_0xb633('0x5d')]=qs[_0xb633('0x37')](_0x4d5c45[_0xb633('0x30')][_0xb633('0x37')]);_0x5c533e[_0xb633('0x38')]=qs[_0xb633('0x39')](_[_0xb633('0x3a')](_0x4d5c45[_0xb633('0x30')],_0x2ce42b[_0xb633('0x39')]));_0x5c533e[_0xb633('0x38')][_0xb633('0x59')]=_0x2d3540['id'];if(_0x4d5c45[_0xb633('0x30')][_0xb633('0x3b')]){_0x5c533e['where']=_[_0xb633('0x3c')](_0x5c533e[_0xb633('0x38')],{'$or':_['map'](_0x5c533e[_0xb633('0x33')],function(_0x1efd34){var _0x29ebbb={};_0x29ebbb[_0x1efd34]={'$like':'%'+_0x4d5c45[_0xb633('0x30')][_0xb633('0x3b')]+'%'};return _0x29ebbb;})});}_0x5c533e=_['merge']({},_0x5c533e,_0x4d5c45['options']);return db[_0xb633('0x5f')]['count']({'where':_0x5c533e[_0xb633('0x38')]})[_0xb633('0x23')](function(_0x10d5fc){_0x5c7f05[_0xb633('0x1c')]=_0x10d5fc;if(_0x4d5c45[_0xb633('0x30')][_0xb633('0x3e')]){_0x5c533e[_0xb633('0x45')]=[{'all':!![]}];}return db[_0xb633('0x5f')][_0xb633('0x3f')](_0x5c533e);})[_0xb633('0x23')](function(_0x10e05d){_0x5c7f05['rows']=_0x10e05d;return _0x5c7f05;});}})['then'](respondWithFilteredResult(_0x5862f4,_0x5c533e))[_0xb633('0x47')](handleError(_0x5862f4,null));};exports[_0xb633('0x60')]=function(_0x445ea5,_0x18bb5b,_0x5da11f){var _0x2de035={'raw':!![],'where':{}};var _0x5df278={};var _0x217a95={'count':0x0,'rows':[]};return db[_0xb633('0x2b')][_0xb633('0x58')]({'where':{'id':_0x445ea5[_0xb633('0x42')]['id']}})['then'](handleEntityNotFound(_0x18bb5b,null))[_0xb633('0x23')](function(_0x5971f7){if(_0x5971f7){_0x5df278[_0xb633('0x32')]=_[_0xb633('0x43')](db['CmHopperBlack']['rawAttributes']);_0x5df278['query']=_['keys'](_0x445ea5[_0xb633('0x30')]);_0x5df278[_0xb633('0x39')]=_[_0xb633('0x31')](_0x5df278['model'],_0x5df278[_0xb633('0x30')]);_0x2de035[_0xb633('0x33')]=_[_0xb633('0x31')](_0x5df278[_0xb633('0x32')],qs[_0xb633('0x44')](_0x445ea5['query'][_0xb633('0x44')]));_0x2de035[_0xb633('0x33')]=_0x2de035[_0xb633('0x33')]['length']?_0x2de035[_0xb633('0x33')]:_0x5df278[_0xb633('0x32')];if(!_0x445ea5['query']['hasOwnProperty'](_0xb633('0x36'))){_0x2de035[_0xb633('0x1d')]=qs[_0xb633('0x1d')](_0x445ea5[_0xb633('0x30')][_0xb633('0x1d')]);_0x2de035['offset']=qs['offset'](_0x445ea5['query'][_0xb633('0x1a')]);}_0x2de035[_0xb633('0x5d')]=qs['sort'](_0x445ea5[_0xb633('0x30')][_0xb633('0x37')]);_0x2de035[_0xb633('0x38')]=qs[_0xb633('0x39')](_[_0xb633('0x3a')](_0x445ea5[_0xb633('0x30')],_0x5df278['filters']));_0x2de035[_0xb633('0x38')][_0xb633('0x59')]=_0x5971f7['id'];if(_0x445ea5[_0xb633('0x30')][_0xb633('0x3b')]){_0x2de035[_0xb633('0x38')]=_[_0xb633('0x3c')](_0x2de035[_0xb633('0x38')],{'$or':_[_0xb633('0x2a')](_0x2de035[_0xb633('0x33')],function(_0x29406c){var _0x1e49e9={};_0x1e49e9[_0x29406c]={'$like':'%'+_0x445ea5[_0xb633('0x30')][_0xb633('0x3b')]+'%'};return _0x1e49e9;})});}_0x2de035=_[_0xb633('0x3c')]({},_0x2de035,_0x445ea5['options']);return db['CmHopperBlack'][_0xb633('0x1c')]({'where':_0x2de035['where']})[_0xb633('0x23')](function(_0x1fa232){_0x217a95['count']=_0x1fa232;if(_0x445ea5[_0xb633('0x30')][_0xb633('0x3e')]){_0x2de035[_0xb633('0x45')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xb633('0x3f')](_0x2de035);})['then'](function(_0x2ac7fa){_0x217a95[_0xb633('0x40')]=_0x2ac7fa;return _0x217a95;});}})[_0xb633('0x23')](respondWithFilteredResult(_0x18bb5b,_0x2de035))[_0xb633('0x47')](handleError(_0x18bb5b,null));};exports['getLists']=function(_0x18dbfa,_0x300d9a,_0x5a9a7e){var _0x15e259={};var _0x4df11d={};var _0x5ccb60;var _0x171718;return db[_0xb633('0x2b')][_0xb633('0x58')]({'where':{'id':_0x18dbfa[_0xb633('0x42')]['id']}})[_0xb633('0x23')](handleEntityNotFound(_0x300d9a,null))[_0xb633('0x23')](function(_0x3f3d91){if(_0x3f3d91){_0x5ccb60=_0x3f3d91;_0x4df11d[_0xb633('0x32')]=_[_0xb633('0x43')](db[_0xb633('0x61')][_0xb633('0x51')]);_0x4df11d['query']=_['keys'](_0x18dbfa['query']);_0x4df11d[_0xb633('0x39')]=_[_0xb633('0x31')](_0x4df11d[_0xb633('0x32')],_0x4df11d[_0xb633('0x30')]);_0x15e259['attributes']=_[_0xb633('0x31')](_0x4df11d['model'],qs[_0xb633('0x44')](_0x18dbfa[_0xb633('0x30')][_0xb633('0x44')]));_0x15e259[_0xb633('0x33')]=_0x15e259[_0xb633('0x33')][_0xb633('0x34')]?_0x15e259[_0xb633('0x33')]:_0x4df11d[_0xb633('0x32')];_0x15e259['order']=qs[_0xb633('0x37')](_0x18dbfa[_0xb633('0x30')]['sort']);_0x15e259[_0xb633('0x38')]=qs[_0xb633('0x39')](_['pick'](_0x18dbfa[_0xb633('0x30')],_0x4df11d[_0xb633('0x39')]));if(_0x18dbfa[_0xb633('0x30')]['filter']){_0x15e259[_0xb633('0x38')]=_['merge'](_0x15e259[_0xb633('0x38')],{'$or':_['map'](_0x15e259[_0xb633('0x33')],function(_0x1298a2){var _0x1fcb4d={};_0x1fcb4d[_0x1298a2]={'$like':'%'+_0x18dbfa[_0xb633('0x30')][_0xb633('0x3b')]+'%'};return _0x1fcb4d;})});}_0x15e259=_['merge']({},_0x15e259,_0x18dbfa[_0xb633('0x3d')]);return _0x5ccb60[_0xb633('0x62')](_0x15e259);}})[_0xb633('0x23')](function(_0x448554){if(_0x448554){_0x171718=_0x448554[_0xb633('0x34')];if(!_0x18dbfa[_0xb633('0x30')]['hasOwnProperty'](_0xb633('0x36'))){_0x15e259[_0xb633('0x1d')]=qs[_0xb633('0x1d')](_0x18dbfa[_0xb633('0x30')][_0xb633('0x1d')]);_0x15e259[_0xb633('0x1a')]=qs[_0xb633('0x1a')](_0x18dbfa[_0xb633('0x30')][_0xb633('0x1a')]);}return _0x5ccb60[_0xb633('0x62')](_0x15e259);}})[_0xb633('0x23')](function(_0x5f4ecb){if(_0x5f4ecb){return _0x5f4ecb?{'count':_0x171718,'rows':_0x5f4ecb}:null;}})[_0xb633('0x23')](respondWithResult(_0x300d9a,null))[_0xb633('0x47')](handleError(_0x300d9a,null));};exports[_0xb633('0x63')]=function(_0x180a46,_0x5cd6da,_0xf09a4d){var _0x3129a5,_0x158fce;return db['Campaign'][_0xb633('0x46')]({'where':{'id':_0x180a46['params']['id']}})['then'](handleEntityNotFound(_0x5cd6da,null))[_0xb633('0x23')](function(_0x497fdb){if(_0x497fdb){_0x158fce=_0x497fdb;return _0x497fdb[_0xb633('0x63')](_0x180a46['body'][_0xb633('0x64')],_['omit'](_0x180a46[_0xb633('0x49')],[_0xb633('0x64'),'id'])||{});}return null;})[_0xb633('0x65')](function(_0x2867e7){var _0x5984d0;_0x3129a5=_0x2867e7||[];var _0x133c4f=[];if(_0x2867e7){for(var _0x6bb308=0x0;_0x6bb308<_0x2867e7[_0xb633('0x34')];_0x6bb308+=0x1){var _0xb274fa=_0x2867e7[_0x6bb308][_0xb633('0x25')]({'plain':!![]});_0x158fce[_0xb633('0x66')]=_0x180a46[_0xb633('0x49')][_0xb633('0x66')]?_0x180a46[_0xb633('0x49')][_0xb633('0x66')]:_0x158fce['dialCheckDuplicateType'];switch(_0x158fce[_0xb633('0x66')]){case _0xb633('0x67'):_0x5984d0=squel[_0xb633('0x68')]()[_0xb633('0x69')]('cm_hopper')['fromQuery']([_0xb633('0x6a'),_0xb633('0x6b'),_0xb633('0x6c'),_0xb633('0x6d'),_0xb633('0x59'),_0xb633('0x52'),_0xb633('0x53')],squel[_0xb633('0x6e')]()[_0xb633('0x6f')](_0xb633('0x6a'),_0xb633('0x6a'))[_0xb633('0x6f')](_0xb633('0x70'),'scheduledAt')['field']('id',_0xb633('0x6c'))[_0xb633('0x6f')](_0xb274fa['CmListId'][_0xb633('0x71')](),_0xb633('0x6d'))[_0xb633('0x6f')](_0x180a46['params']['id'][_0xb633('0x71')](),_0xb633('0x59'))[_0xb633('0x6f')](_0xb633('0x70'),_0xb633('0x52'))[_0xb633('0x6f')](_0xb633('0x70'),_0xb633('0x53'))['from'](_0xb633('0x72'))[_0xb633('0x38')](_0xb633('0x73'))[_0xb633('0x38')](_0xb633('0x74'),_0xb274fa[_0xb633('0x75')][_0xb633('0x71')]())[_0xb633('0x38')](_0xb633('0x76'))[_0xb633('0x38')](_0xb633('0x77'),squel[_0xb633('0x6e')]()[_0xb633('0x6f')](_0xb633('0x78'))[_0xb633('0x79')](_0xb633('0x7a'))[_0xb633('0x38')]('CampaignId\x20=\x20?',_0x180a46['params']['id'][_0xb633('0x71')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xb633('0x6e')]()[_0xb633('0x6f')](_0xb633('0x7b'))['from'](_0xb633('0x7c'))['where'](_0xb633('0x7d'),_0x180a46[_0xb633('0x42')]['id']['toString']())))[_0xb633('0x71')]();break;case _0xb633('0x7e'):_0x5984d0=squel[_0xb633('0x68')]()['into'](_0xb633('0x7c'))[_0xb633('0x7f')]([_0xb633('0x6a'),_0xb633('0x6b'),'ContactId',_0xb633('0x6d'),_0xb633('0x59'),_0xb633('0x52'),_0xb633('0x53')],squel[_0xb633('0x6e')]()[_0xb633('0x6f')](_0xb633('0x6a'),'phone')[_0xb633('0x6f')](_0xb633('0x70'),'scheduledAt')['field']('id',_0xb633('0x6c'))[_0xb633('0x6f')](_0xb274fa[_0xb633('0x75')][_0xb633('0x71')](),'ListId')[_0xb633('0x6f')](_0x180a46['params']['id'][_0xb633('0x71')](),_0xb633('0x59'))[_0xb633('0x6f')](_0xb633('0x70'),_0xb633('0x52'))['field'](_0xb633('0x70'),_0xb633('0x53'))[_0xb633('0x79')](_0xb633('0x72'))[_0xb633('0x38')](_0xb633('0x73'))[_0xb633('0x38')](_0xb633('0x74'),_0xb274fa['CmListId'][_0xb633('0x71')]())[_0xb633('0x38')](_0xb633('0x76'))[_0xb633('0x38')](_0xb633('0x77'),squel[_0xb633('0x6e')]()[_0xb633('0x6f')](_0xb633('0x7b'))[_0xb633('0x79')](_0xb633('0x7c'))['where'](_0xb633('0x7d'),_0x180a46[_0xb633('0x42')]['id']['toString']())))[_0xb633('0x71')]();break;default:_0x5984d0=squel[_0xb633('0x68')]()[_0xb633('0x69')](_0xb633('0x7c'))[_0xb633('0x7f')]([_0xb633('0x6a'),_0xb633('0x6b'),_0xb633('0x6c'),'ListId','CampaignId',_0xb633('0x52'),_0xb633('0x53')],squel[_0xb633('0x6e')]()['field']('phone','phone')['field'](_0xb633('0x70'),_0xb633('0x6b'))[_0xb633('0x6f')]('id','ContactId')['field'](_0xb274fa[_0xb633('0x75')][_0xb633('0x71')](),_0xb633('0x6d'))[_0xb633('0x6f')](_0x180a46[_0xb633('0x42')]['id'][_0xb633('0x71')](),_0xb633('0x59'))[_0xb633('0x6f')](_0xb633('0x70'),_0xb633('0x52'))['field'](_0xb633('0x70'),_0xb633('0x53'))['from'](_0xb633('0x72'))[_0xb633('0x38')](_0xb633('0x73'))[_0xb633('0x38')](_0xb633('0x74'),_0xb274fa['CmListId'][_0xb633('0x71')]())[_0xb633('0x38')](_0xb633('0x76')))[_0xb633('0x71')]();}_0x133c4f[_0xb633('0x80')](db['sequelize'][_0xb633('0x30')](_0x5984d0));}return BPromise[_0xb633('0x81')](_0x133c4f);}})[_0xb633('0x23')](function(){return _0x3129a5;})[_0xb633('0x23')](respondWithResult(_0x5cd6da,null))[_0xb633('0x47')](handleError(_0x5cd6da,null));};exports[_0xb633('0x82')]=function(_0x4475e9,_0x172a20,_0x55a300){return db[_0xb633('0x2b')][_0xb633('0x46')]({'where':{'id':_0x4475e9[_0xb633('0x42')]['id']}})[_0xb633('0x23')](handleEntityNotFound(_0x172a20,null))['then'](function(_0x16e1a1){if(_0x16e1a1){return _0x16e1a1['removeLists'](_0x4475e9[_0xb633('0x30')][_0xb633('0x64')]);}})[_0xb633('0x23')](function(_0x1d41d5){if(_0x1d41d5){return db[_0xb633('0x5a')][_0xb633('0x24')]({'where':{'ListId':_0x4475e9[_0xb633('0x30')][_0xb633('0x64')],'CampaignId':_0x4475e9[_0xb633('0x42')]['id']}})[_0xb633('0x23')](function(){return _0x1d41d5;});}})[_0xb633('0x23')](respondWithStatusCode(_0x172a20,null))['catch'](handleError(_0x172a20,null));};exports[_0xb633('0x83')]=function(_0x16f02e,_0x5f4b04,_0x6fee4){var _0x30b014={};var _0x29455f={};var _0x3767d5;var _0x1e03c6;return db['Campaign']['findOne']({'where':{'id':_0x16f02e[_0xb633('0x42')]['id']}})['then'](handleEntityNotFound(_0x5f4b04,null))[_0xb633('0x23')](function(_0x113451){if(_0x113451){_0x3767d5=_0x113451;_0x29455f['model']=_[_0xb633('0x43')](db[_0xb633('0x61')][_0xb633('0x51')]);_0x29455f['query']=_['keys'](_0x16f02e[_0xb633('0x30')]);_0x29455f[_0xb633('0x39')]=_['intersection'](_0x29455f[_0xb633('0x32')],_0x29455f[_0xb633('0x30')]);_0x30b014['attributes']=_[_0xb633('0x31')](_0x29455f['model'],qs[_0xb633('0x44')](_0x16f02e[_0xb633('0x30')]['fields']));_0x30b014[_0xb633('0x33')]=_0x30b014['attributes'][_0xb633('0x34')]?_0x30b014[_0xb633('0x33')]:_0x29455f[_0xb633('0x32')];_0x30b014[_0xb633('0x5d')]=qs[_0xb633('0x37')](_0x16f02e[_0xb633('0x30')][_0xb633('0x37')]);_0x30b014[_0xb633('0x38')]=qs['filters'](_[_0xb633('0x3a')](_0x16f02e[_0xb633('0x30')],_0x29455f[_0xb633('0x39')]));if(_0x16f02e['query']['filter']){_0x30b014[_0xb633('0x38')]=_['merge'](_0x30b014[_0xb633('0x38')],{'$or':_['map'](_0x30b014[_0xb633('0x33')],function(_0x371cd3){var _0x49cae1={};_0x49cae1[_0x371cd3]={'$like':'%'+_0x16f02e[_0xb633('0x30')]['filter']+'%'};return _0x49cae1;})});}_0x30b014=_[_0xb633('0x3c')]({},_0x30b014,_0x16f02e['options']);return _0x3767d5[_0xb633('0x83')](_0x30b014);}})[_0xb633('0x23')](function(_0x1c10b6){if(_0x1c10b6){_0x1e03c6=_0x1c10b6[_0xb633('0x34')];if(!_0x16f02e[_0xb633('0x30')]['hasOwnProperty'](_0xb633('0x36'))){_0x30b014['limit']=qs['limit'](_0x16f02e[_0xb633('0x30')][_0xb633('0x1d')]);_0x30b014['offset']=qs[_0xb633('0x1a')](_0x16f02e[_0xb633('0x30')][_0xb633('0x1a')]);}return _0x3767d5[_0xb633('0x83')](_0x30b014);}})[_0xb633('0x23')](function(_0x128085){if(_0x128085){return _0x128085?{'count':_0x1e03c6,'rows':_0x128085}:null;}})[_0xb633('0x23')](respondWithResult(_0x5f4b04,null))[_0xb633('0x47')](handleError(_0x5f4b04,null));};exports['addBlackLists']=function(_0x515506,_0x27b1f7,_0x18b4b2){var _0x2ea938,_0x41d3e7;return db[_0xb633('0x2b')][_0xb633('0x46')]({'where':{'id':_0x515506[_0xb633('0x42')]['id']}})['then'](handleEntityNotFound(_0x27b1f7,null))[_0xb633('0x23')](function(_0x47112f){if(_0x47112f){_0x41d3e7=_0x47112f;return _0x47112f[_0xb633('0x84')](_0x515506['body'][_0xb633('0x64')],_['omit'](_0x515506[_0xb633('0x49')],[_0xb633('0x64'),'id'])||{});}return null;})['spread'](function(_0x5c8313){var _0x5ecc28;_0x2ea938=_0x5c8313||[];var _0x2be67c=[];if(_0x5c8313){for(var _0x15dd80=0x0;_0x15dd80<_0x5c8313['length'];_0x15dd80+=0x1){var _0x1d32f4=_0x5c8313[_0x15dd80][_0xb633('0x25')]({'plain':!![]});_0x5ecc28=squel[_0xb633('0x68')]()['into'](_0xb633('0x85'))[_0xb633('0x7f')](['phone',_0xb633('0x6c'),_0xb633('0x6d'),_0xb633('0x59'),_0xb633('0x52'),_0xb633('0x53')],squel[_0xb633('0x6e')]()[_0xb633('0x6f')](_0xb633('0x6a'),_0xb633('0x6a'))['field']('id',_0xb633('0x6c'))[_0xb633('0x6f')](_0x1d32f4[_0xb633('0x75')][_0xb633('0x71')](),_0xb633('0x6d'))[_0xb633('0x6f')](_0x515506[_0xb633('0x42')]['id'][_0xb633('0x71')](),_0xb633('0x59'))['field'](_0xb633('0x70'),_0xb633('0x52'))[_0xb633('0x6f')](_0xb633('0x70'),_0xb633('0x53'))[_0xb633('0x79')]('cm_contacts')[_0xb633('0x38')](_0xb633('0x73'))['where'](_0xb633('0x74'),_0x1d32f4['CmListId'][_0xb633('0x71')]())[_0xb633('0x38')](_0xb633('0x76')))['toString']();_0x2be67c['push'](db[_0xb633('0x86')][_0xb633('0x30')](_0x5ecc28));}return BPromise['all'](_0x2be67c);}})['then'](function(){return _0x2ea938;})[_0xb633('0x23')](respondWithResult(_0x27b1f7,null))[_0xb633('0x47')](handleError(_0x27b1f7,null));};exports[_0xb633('0x87')]=function(_0xc719a0,_0x51bd22,_0x53ca14){return db[_0xb633('0x2b')][_0xb633('0x46')]({'where':{'id':_0xc719a0[_0xb633('0x42')]['id']}})[_0xb633('0x23')](handleEntityNotFound(_0x51bd22,null))[_0xb633('0x23')](function(_0x2753e3){if(_0x2753e3){return _0x2753e3[_0xb633('0x87')](_0xc719a0['query']['ids']);}})['then'](function(_0x26b251){if(_0x26b251){return db[_0xb633('0x88')]['destroy']({'where':{'ListId':_0xc719a0[_0xb633('0x30')][_0xb633('0x64')],'CampaignId':_0xc719a0[_0xb633('0x42')]['id']}})['then'](function(){return _0x26b251;});}})[_0xb633('0x23')](respondWithStatusCode(_0x51bd22,null))[_0xb633('0x47')](handleError(_0x51bd22,null));}; \ No newline at end of file +var _0x634f=['error','stack','name','send','index','Campaign','rawAttributes','fieldName','type','key','map','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','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','omit','createdAt','updatedAt','params','CmHopper','hasOwnProperty','CampaignId','getHopperHistories','findOne','CmHopperHistory','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','phone','ContactId','ListId','select','field','scheduledAt','CmListId','NOW()','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','toString','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_contacts','fromQuery','push','sequelize','removeLists','getBlackLists','addBlackLists','cm_hopper_black','all','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','IvrCampaigns','UserProfileResource','destroy'];(function(_0x172d29,_0x2a70b4){var _0x17df2b=function(_0x151eb2){while(--_0x151eb2){_0x172d29['push'](_0x172d29['shift']());}};_0x17df2b(++_0x2a70b4);}(_0x634f,0x16a));var _0xf634=function(_0x3cf6bc,_0x2b16d9){_0x3cf6bc=_0x3cf6bc-0x0;var _0x3b7862=_0x634f[_0x3cf6bc];return _0x3b7862;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf634('0x0'));var zipdir=require(_0xf634('0x1'));var jsonpatch=require(_0xf634('0x2'));var rp=require(_0xf634('0x3'));var moment=require(_0xf634('0x4'));var BPromise=require(_0xf634('0x5'));var Mustache=require(_0xf634('0x6'));var util=require(_0xf634('0x7'));var path=require(_0xf634('0x8'));var sox=require(_0xf634('0x9'));var csv=require(_0xf634('0xa'));var ejs=require(_0xf634('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf634('0xc'));var squel=require(_0xf634('0xd'));var crypto=require(_0xf634('0xe'));var jsforce=require(_0xf634('0xf'));var deskjs=require(_0xf634('0x10'));var toCsv=require(_0xf634('0xa'));var querystring=require(_0xf634('0x11'));var Papa=require(_0xf634('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf634('0x13'));var logger=require(_0xf634('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xf634('0x15'));var licenseUtil=require(_0xf634('0x16'));var db=require(_0xf634('0x17'))['db'];function respondWithStatusCode(_0x598366,_0x400910){_0x400910=_0x400910||0xcc;return function(_0x26a8e9){if(_0x26a8e9){return _0x598366[_0xf634('0x18')](_0x400910);}return _0x598366[_0xf634('0x19')](_0x400910)[_0xf634('0x1a')]();};}function respondWithResult(_0x31e163,_0x1157e7){_0x1157e7=_0x1157e7||0xc8;return function(_0x414576){if(_0x414576){return _0x31e163[_0xf634('0x19')](_0x1157e7)[_0xf634('0x1b')](_0x414576);}};}function respondWithFilteredResult(_0x1deb9f,_0x16a51d){return function(_0x36d1b2){if(_0x36d1b2){var _0x14be13=typeof _0x16a51d[_0xf634('0x1c')]===_0xf634('0x1d')&&typeof _0x16a51d[_0xf634('0x1e')]===_0xf634('0x1d');var _0x4a308e=_0x36d1b2['count'];var _0x5d7dec=_0x14be13?0x0:_0x16a51d['offset'];var _0x14c0cb=_0x14be13?_0x36d1b2[_0xf634('0x1f')]:_0x16a51d['offset']+_0x16a51d[_0xf634('0x1e')];var _0x50e8e8;if(_0x14c0cb>=_0x4a308e){_0x14c0cb=_0x4a308e;_0x50e8e8=0xc8;}else{_0x50e8e8=0xce;}_0x1deb9f['status'](_0x50e8e8);return _0x1deb9f[_0xf634('0x20')](_0xf634('0x21'),_0x5d7dec+'-'+_0x14c0cb+'/'+_0x4a308e)[_0xf634('0x1b')](_0x36d1b2);}return null;};}function patchUpdates(_0x37be2e){return function(_0x2172cc){try{jsonpatch[_0xf634('0x22')](_0x2172cc,_0x37be2e,!![]);}catch(_0x3e2594){return BPromise[_0xf634('0x23')](_0x3e2594);}return _0x2172cc[_0xf634('0x24')]();};}function saveUpdates(_0x43d89a,_0x3c3dd8){return function(_0x391764){if(_0x391764){return _0x391764[_0xf634('0x25')](_0x43d89a)[_0xf634('0x26')](function(_0x15f4f5){return _0x15f4f5;});}return null;};}function removeEntity(_0x1a1848,_0x45811c){return function(_0xeb5711){if(_0xeb5711){return _0xeb5711['destroy']()[_0xf634('0x26')](function(){var _0xbb4710=_0xeb5711[_0xf634('0x27')]({'plain':!![]});var _0xda2a70=_0xf634('0x28');return db[_0xf634('0x29')][_0xf634('0x2a')]({'where':{'type':_0xda2a70,'resourceId':_0xbb4710['id']}})[_0xf634('0x26')](function(){return _0xeb5711;});})[_0xf634('0x26')](function(){_0x1a1848[_0xf634('0x19')](0xcc)[_0xf634('0x1a')]();});}};}function handleEntityNotFound(_0x4f551e,_0x18d7d5){return function(_0x28f0b9){if(!_0x28f0b9){_0x4f551e['sendStatus'](0x194);}return _0x28f0b9;};}function handleError(_0x4dbef5,_0x3de70b){_0x3de70b=_0x3de70b||0x1f4;return function(_0x52618e){logger[_0xf634('0x2b')](_0x52618e[_0xf634('0x2c')]);if(_0x52618e['name']){delete _0x52618e[_0xf634('0x2d')];}_0x4dbef5[_0xf634('0x19')](_0x3de70b)[_0xf634('0x2e')](_0x52618e);};}exports[_0xf634('0x2f')]=function(_0x58d75c,_0x3f3c21){var _0xbea1a2={},_0x49fcd6={},_0x35ca4d={'count':0x0,'rows':[]};var _0x167832=_['map'](db[_0xf634('0x30')][_0xf634('0x31')],function(_0xe416a6){return{'name':_0xe416a6[_0xf634('0x32')],'type':_0xe416a6[_0xf634('0x33')][_0xf634('0x34')]};});_0x49fcd6['model']=_[_0xf634('0x35')](_0x167832,_0xf634('0x2d'));_0x49fcd6['query']=_['keys'](_0x58d75c[_0xf634('0x36')]);_0x49fcd6[_0xf634('0x37')]=_[_0xf634('0x38')](_0x49fcd6['model'],_0x49fcd6[_0xf634('0x36')]);_0xbea1a2[_0xf634('0x39')]=_[_0xf634('0x38')](_0x49fcd6[_0xf634('0x3a')],qs[_0xf634('0x3b')](_0x58d75c['query']['fields']));_0xbea1a2[_0xf634('0x39')]=_0xbea1a2[_0xf634('0x39')][_0xf634('0x3c')]?_0xbea1a2[_0xf634('0x39')]:_0x49fcd6[_0xf634('0x3a')];if(!_0x58d75c['query']['hasOwnProperty'](_0xf634('0x3d'))){_0xbea1a2[_0xf634('0x1e')]=qs[_0xf634('0x1e')](_0x58d75c[_0xf634('0x36')][_0xf634('0x1e')]);_0xbea1a2['offset']=qs[_0xf634('0x1c')](_0x58d75c[_0xf634('0x36')][_0xf634('0x1c')]);}_0xbea1a2[_0xf634('0x3e')]=qs['sort'](_0x58d75c[_0xf634('0x36')][_0xf634('0x3f')]);_0xbea1a2[_0xf634('0x40')]=qs['filters'](_[_0xf634('0x41')](_0x58d75c[_0xf634('0x36')],_0x49fcd6[_0xf634('0x37')]),_0x167832);if(_0x58d75c['query'][_0xf634('0x42')]){_0xbea1a2[_0xf634('0x40')]=_[_0xf634('0x43')](_0xbea1a2[_0xf634('0x40')],{'$or':_['map'](_0x167832,function(_0x1cd226){if(_0x1cd226['type']!==_0xf634('0x44')){var _0x4aff6b={};_0x4aff6b[_0x1cd226[_0xf634('0x2d')]]={'$like':'%'+_0x58d75c[_0xf634('0x36')][_0xf634('0x42')]+'%'};return _0x4aff6b;}})});}_0xbea1a2=_['merge']({},_0xbea1a2,_0x58d75c[_0xf634('0x45')]);var _0x148c29={'where':_0xbea1a2[_0xf634('0x40')]};return db[_0xf634('0x30')]['count'](_0x148c29)['then'](function(_0x573830){_0x35ca4d[_0xf634('0x1f')]=_0x573830;if(_0x58d75c[_0xf634('0x36')][_0xf634('0x46')]){_0xbea1a2[_0xf634('0x47')]=[{'all':!![]}];}return db[_0xf634('0x30')][_0xf634('0x48')](_0xbea1a2);})[_0xf634('0x26')](function(_0x4a6fc0){_0x35ca4d[_0xf634('0x49')]=_0x4a6fc0;return _0x35ca4d;})[_0xf634('0x26')](respondWithFilteredResult(_0x3f3c21,_0xbea1a2))[_0xf634('0x4a')](handleError(_0x3f3c21,null));};exports['show']=function(_0x55da1d,_0x7d2ec7){var _0x530edf={'raw':![],'where':{'id':_0x55da1d['params']['id']}},_0x5c3311={};_0x5c3311[_0xf634('0x3a')]=_[_0xf634('0x4b')](db[_0xf634('0x30')]['rawAttributes']);_0x5c3311[_0xf634('0x36')]=_[_0xf634('0x4b')](_0x55da1d[_0xf634('0x36')]);_0x5c3311[_0xf634('0x37')]=_[_0xf634('0x38')](_0x5c3311[_0xf634('0x3a')],_0x5c3311[_0xf634('0x36')]);_0x530edf[_0xf634('0x39')]=_['intersection'](_0x5c3311['model'],qs[_0xf634('0x3b')](_0x55da1d[_0xf634('0x36')][_0xf634('0x3b')]));_0x530edf[_0xf634('0x39')]=_0x530edf[_0xf634('0x39')][_0xf634('0x3c')]?_0x530edf[_0xf634('0x39')]:_0x5c3311['model'];if(_0x55da1d[_0xf634('0x36')][_0xf634('0x46')]){_0x530edf[_0xf634('0x47')]=[{'all':!![]}];}_0x530edf=_[_0xf634('0x43')]({},_0x530edf,_0x55da1d[_0xf634('0x45')]);return db[_0xf634('0x30')]['find'](_0x530edf)[_0xf634('0x26')](handleEntityNotFound(_0x7d2ec7,null))[_0xf634('0x26')](respondWithResult(_0x7d2ec7,null))[_0xf634('0x4a')](handleError(_0x7d2ec7,null));};exports[_0xf634('0x4c')]=function(_0x45f039,_0x2af6b6){return db[_0xf634('0x30')][_0xf634('0x4c')](_0x45f039[_0xf634('0x4d')],{})[_0xf634('0x26')](function(_0x227326){var _0x37f45e=_0x45f039[_0xf634('0x4e')]['get']({'plain':!![]});if(!_0x37f45e)throw new Error(_0xf634('0x4f'));if(_0x37f45e[_0xf634('0x50')]==='user'){var _0x303be5=_0x227326['get']({'plain':!![]});var _0x5cb926=_0xf634('0x28');return db[_0xf634('0x51')][_0xf634('0x52')]({'where':{'name':_0x5cb926,'userProfileId':_0x37f45e[_0xf634('0x53')]},'raw':!![]})[_0xf634('0x26')](function(_0x4d4099){if(_0x4d4099&&_0x4d4099[_0xf634('0x54')]===0x0){return db[_0xf634('0x29')][_0xf634('0x4c')]({'name':_0x303be5[_0xf634('0x2d')],'resourceId':_0x303be5['id'],'type':_0x4d4099[_0xf634('0x2d')],'sectionId':_0x4d4099['id']},{})[_0xf634('0x26')](function(){return _0x227326;});}else{return _0x227326;}})[_0xf634('0x4a')](function(_0x1772bc){logger[_0xf634('0x2b')](_0xf634('0x55'),_0x1772bc);throw _0x1772bc;});}return _0x227326;})[_0xf634('0x26')](respondWithResult(_0x2af6b6,0xc9))[_0xf634('0x4a')](handleError(_0x2af6b6,null));};exports['clone']=function(_0x273c11,_0x5c5694){var _0x526526={'where':{'id':_0x273c11['params']['id']}},_0x196efa={};_0x196efa[_0xf634('0x3a')]=_[_0xf634('0x4b')](db['Campaign'][_0xf634('0x31')]);_0x526526['attributes']=_[_0xf634('0x38')](_0x196efa[_0xf634('0x3a')],qs[_0xf634('0x3b')](_0x273c11[_0xf634('0x36')][_0xf634('0x3b')]));_0x526526[_0xf634('0x39')]=_0x526526[_0xf634('0x39')][_0xf634('0x3c')]?_0x526526[_0xf634('0x39')]:_0x196efa[_0xf634('0x3a')];if(_0x273c11[_0xf634('0x36')][_0xf634('0x46')]){_0x526526[_0xf634('0x47')]=[{'all':!![]}];}_0x526526=_['merge']({},_0x526526,_0x273c11['options']);return db['Campaign'][_0xf634('0x52')](_0x526526)[_0xf634('0x26')](handleEntityNotFound(_0x5c5694,null))[_0xf634('0x26')](function(_0x19de13){if(_0x19de13){var _0x354e22=_0x19de13['get']({'plain':!![]});_0x354e22=qs[_0xf634('0x56')](_0x354e22,['id','createdAt','updatedAt']);_0x273c11[_0xf634('0x4d')]=_[_0xf634('0x56')](_0x273c11['body'],['id',_0xf634('0x57'),_0xf634('0x58')]);return db[_0xf634('0x30')][_0xf634('0x4c')](_[_0xf634('0x43')](_0x354e22,_0x273c11[_0xf634('0x4d')]),{'include':_0x273c11[_0xf634('0x36')][_0xf634('0x46')]?[{'all':!![]}]:undefined})[_0xf634('0x26')](function(_0x5ebe21){var _0xba79e3=_0x273c11['user'][_0xf634('0x27')]({'plain':!![]});if(!_0xba79e3)throw new Error(_0xf634('0x4f'));if(_0xba79e3['role']===_0xf634('0x4e')){var _0x5a79c7=_0x5ebe21[_0xf634('0x27')]({'plain':!![]});var _0x3e8c42=_0xf634('0x28');return db['UserProfileSection'][_0xf634('0x52')]({'where':{'name':_0x3e8c42,'userProfileId':_0xba79e3[_0xf634('0x53')]},'raw':!![]})[_0xf634('0x26')](function(_0x112d7a){if(_0x112d7a&&_0x112d7a[_0xf634('0x54')]===0x0){return db[_0xf634('0x29')][_0xf634('0x4c')]({'name':_0x5a79c7['name'],'resourceId':_0x5a79c7['id'],'type':_0x112d7a[_0xf634('0x2d')],'sectionId':_0x112d7a['id']},{})[_0xf634('0x26')](function(){return _0x5ebe21;});}else{return _0x5ebe21;}})[_0xf634('0x4a')](function(_0x1d9b16){logger[_0xf634('0x2b')](_0xf634('0x55'),_0x1d9b16);throw _0x1d9b16;});}return _0x5ebe21;});}})[_0xf634('0x26')](respondWithResult(_0x5c5694,0xc9))['catch'](handleError(_0x5c5694,null));};exports[_0xf634('0x25')]=function(_0x4e77d1,_0x6fd9dd){if(_0x4e77d1[_0xf634('0x4d')]['id']){delete _0x4e77d1['body']['id'];}return db['Campaign'][_0xf634('0x52')]({'where':{'id':_0x4e77d1[_0xf634('0x59')]['id']}})[_0xf634('0x26')](handleEntityNotFound(_0x6fd9dd,null))['then'](saveUpdates(_0x4e77d1['body'],null))[_0xf634('0x26')](respondWithResult(_0x6fd9dd,null))[_0xf634('0x4a')](handleError(_0x6fd9dd,null));};exports[_0xf634('0x2a')]=function(_0x5168d4,_0x5b0ab7){return db[_0xf634('0x30')]['find']({'where':{'id':_0x5168d4[_0xf634('0x59')]['id']}})['then'](handleEntityNotFound(_0x5b0ab7,null))[_0xf634('0x26')](removeEntity(_0x5b0ab7,null))[_0xf634('0x4a')](handleError(_0x5b0ab7,null));};exports['getHoppers']=function(_0x2cc74d,_0x12ee76,_0x1260cb){var _0x2683c4={'raw':!![],'where':{}};var _0xd0e006={};var _0x4e25e1={'count':0x0,'rows':[]};return db[_0xf634('0x30')]['findOne']({'where':{'id':_0x2cc74d[_0xf634('0x59')]['id']}})['then'](handleEntityNotFound(_0x12ee76,null))[_0xf634('0x26')](function(_0x49a70d){if(_0x49a70d){_0xd0e006[_0xf634('0x3a')]=_[_0xf634('0x4b')](db[_0xf634('0x5a')][_0xf634('0x31')]);_0xd0e006[_0xf634('0x36')]=_['keys'](_0x2cc74d[_0xf634('0x36')]);_0xd0e006[_0xf634('0x37')]=_['intersection'](_0xd0e006[_0xf634('0x3a')],_0xd0e006[_0xf634('0x36')]);_0x2683c4[_0xf634('0x39')]=_[_0xf634('0x38')](_0xd0e006[_0xf634('0x3a')],qs['fields'](_0x2cc74d[_0xf634('0x36')][_0xf634('0x3b')]));_0x2683c4[_0xf634('0x39')]=_0x2683c4[_0xf634('0x39')]['length']?_0x2683c4[_0xf634('0x39')]:_0xd0e006['model'];if(!_0x2cc74d[_0xf634('0x36')][_0xf634('0x5b')](_0xf634('0x3d'))){_0x2683c4[_0xf634('0x1e')]=qs['limit'](_0x2cc74d[_0xf634('0x36')][_0xf634('0x1e')]);_0x2683c4[_0xf634('0x1c')]=qs[_0xf634('0x1c')](_0x2cc74d['query'][_0xf634('0x1c')]);}_0x2683c4[_0xf634('0x3e')]=qs[_0xf634('0x3f')](_0x2cc74d[_0xf634('0x36')][_0xf634('0x3f')]);_0x2683c4[_0xf634('0x40')]=qs[_0xf634('0x37')](_[_0xf634('0x41')](_0x2cc74d[_0xf634('0x36')],_0xd0e006[_0xf634('0x37')]));_0x2683c4['where'][_0xf634('0x5c')]=_0x49a70d['id'];if(_0x2cc74d[_0xf634('0x36')][_0xf634('0x42')]){_0x2683c4[_0xf634('0x40')]=_[_0xf634('0x43')](_0x2683c4['where'],{'$or':_[_0xf634('0x35')](_0x2683c4[_0xf634('0x39')],function(_0x12ee43){var _0x3f4c99={};_0x3f4c99[_0x12ee43]={'$like':'%'+_0x2cc74d[_0xf634('0x36')][_0xf634('0x42')]+'%'};return _0x3f4c99;})});}_0x2683c4=_[_0xf634('0x43')]({},_0x2683c4,_0x2cc74d['options']);return db[_0xf634('0x5a')][_0xf634('0x1f')]({'where':_0x2683c4[_0xf634('0x40')]})['then'](function(_0x2226db){_0x4e25e1[_0xf634('0x1f')]=_0x2226db;if(_0x2cc74d[_0xf634('0x36')][_0xf634('0x46')]){_0x2683c4['include']=[{'all':!![]}];}return db[_0xf634('0x5a')][_0xf634('0x48')](_0x2683c4);})[_0xf634('0x26')](function(_0x46667c){_0x4e25e1[_0xf634('0x49')]=_0x46667c;return _0x4e25e1;});}})[_0xf634('0x26')](respondWithFilteredResult(_0x12ee76,_0x2683c4))[_0xf634('0x4a')](handleError(_0x12ee76,null));};exports[_0xf634('0x5d')]=function(_0x409f55,_0x132e11,_0x584569){var _0x421ec9={'raw':!![],'where':{}};var _0x2d3b25={};var _0x3807bc={'count':0x0,'rows':[]};return db[_0xf634('0x30')][_0xf634('0x5e')]({'where':{'id':_0x409f55['params']['id']}})[_0xf634('0x26')](handleEntityNotFound(_0x132e11,null))[_0xf634('0x26')](function(_0x346821){if(_0x346821){_0x2d3b25[_0xf634('0x3a')]=_[_0xf634('0x4b')](db[_0xf634('0x5f')]['rawAttributes']);_0x2d3b25[_0xf634('0x36')]=_[_0xf634('0x4b')](_0x409f55[_0xf634('0x36')]);_0x2d3b25[_0xf634('0x37')]=_['intersection'](_0x2d3b25['model'],_0x2d3b25[_0xf634('0x36')]);_0x421ec9[_0xf634('0x39')]=_[_0xf634('0x38')](_0x2d3b25[_0xf634('0x3a')],qs['fields'](_0x409f55[_0xf634('0x36')][_0xf634('0x3b')]));_0x421ec9[_0xf634('0x39')]=_0x421ec9[_0xf634('0x39')][_0xf634('0x3c')]?_0x421ec9['attributes']:_0x2d3b25['model'];if(!_0x409f55[_0xf634('0x36')][_0xf634('0x5b')](_0xf634('0x3d'))){_0x421ec9[_0xf634('0x1e')]=qs[_0xf634('0x1e')](_0x409f55[_0xf634('0x36')][_0xf634('0x1e')]);_0x421ec9[_0xf634('0x1c')]=qs[_0xf634('0x1c')](_0x409f55[_0xf634('0x36')][_0xf634('0x1c')]);}_0x421ec9[_0xf634('0x3e')]=qs[_0xf634('0x3f')](_0x409f55['query'][_0xf634('0x3f')]);_0x421ec9['where']=qs['filters'](_['pick'](_0x409f55[_0xf634('0x36')],_0x2d3b25[_0xf634('0x37')]));_0x421ec9[_0xf634('0x40')][_0xf634('0x5c')]=_0x346821['id'];if(_0x409f55[_0xf634('0x36')][_0xf634('0x42')]){_0x421ec9['where']=_[_0xf634('0x43')](_0x421ec9[_0xf634('0x40')],{'$or':_['map'](_0x421ec9['attributes'],function(_0x19c04e){var _0x224291={};_0x224291[_0x19c04e]={'$like':'%'+_0x409f55[_0xf634('0x36')][_0xf634('0x42')]+'%'};return _0x224291;})});}_0x421ec9=_[_0xf634('0x43')]({},_0x421ec9,_0x409f55[_0xf634('0x45')]);return db['CmHopperHistory'][_0xf634('0x1f')]({'where':_0x421ec9['where']})[_0xf634('0x26')](function(_0x58e404){_0x3807bc[_0xf634('0x1f')]=_0x58e404;if(_0x409f55[_0xf634('0x36')]['includeAll']){_0x421ec9[_0xf634('0x47')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xf634('0x48')](_0x421ec9);})['then'](function(_0x3d46da){_0x3807bc['rows']=_0x3d46da;return _0x3807bc;});}})[_0xf634('0x26')](respondWithFilteredResult(_0x132e11,_0x421ec9))['catch'](handleError(_0x132e11,null));};exports['getHopperFinals']=function(_0x256551,_0xc69d88,_0x1c5e07){var _0x360041={'raw':!![],'where':{}};var _0x2cb895={};var _0x2092d9={'count':0x0,'rows':[]};return db[_0xf634('0x30')]['findOne']({'where':{'id':_0x256551[_0xf634('0x59')]['id']}})[_0xf634('0x26')](handleEntityNotFound(_0xc69d88,null))[_0xf634('0x26')](function(_0x26a577){if(_0x26a577){_0x2cb895[_0xf634('0x3a')]=_['keys'](db['CmHopperFinal'][_0xf634('0x31')]);_0x2cb895[_0xf634('0x36')]=_[_0xf634('0x4b')](_0x256551[_0xf634('0x36')]);_0x2cb895['filters']=_[_0xf634('0x38')](_0x2cb895['model'],_0x2cb895[_0xf634('0x36')]);_0x360041['attributes']=_[_0xf634('0x38')](_0x2cb895['model'],qs[_0xf634('0x3b')](_0x256551[_0xf634('0x36')][_0xf634('0x3b')]));_0x360041[_0xf634('0x39')]=_0x360041[_0xf634('0x39')][_0xf634('0x3c')]?_0x360041[_0xf634('0x39')]:_0x2cb895[_0xf634('0x3a')];if(!_0x256551[_0xf634('0x36')][_0xf634('0x5b')](_0xf634('0x3d'))){_0x360041['limit']=qs[_0xf634('0x1e')](_0x256551['query'][_0xf634('0x1e')]);_0x360041[_0xf634('0x1c')]=qs['offset'](_0x256551[_0xf634('0x36')][_0xf634('0x1c')]);}_0x360041[_0xf634('0x3e')]=qs[_0xf634('0x3f')](_0x256551['query'][_0xf634('0x3f')]);_0x360041[_0xf634('0x40')]=qs['filters'](_['pick'](_0x256551[_0xf634('0x36')],_0x2cb895[_0xf634('0x37')]));_0x360041['where'][_0xf634('0x5c')]=_0x26a577['id'];if(_0x256551[_0xf634('0x36')][_0xf634('0x42')]){_0x360041[_0xf634('0x40')]=_[_0xf634('0x43')](_0x360041['where'],{'$or':_[_0xf634('0x35')](_0x360041[_0xf634('0x39')],function(_0x74bf2d){var _0x1f4665={};_0x1f4665[_0x74bf2d]={'$like':'%'+_0x256551[_0xf634('0x36')][_0xf634('0x42')]+'%'};return _0x1f4665;})});}_0x360041=_[_0xf634('0x43')]({},_0x360041,_0x256551[_0xf634('0x45')]);return db[_0xf634('0x60')]['count']({'where':_0x360041[_0xf634('0x40')]})[_0xf634('0x26')](function(_0xaaf9e7){_0x2092d9[_0xf634('0x1f')]=_0xaaf9e7;if(_0x256551[_0xf634('0x36')]['includeAll']){_0x360041[_0xf634('0x47')]=[{'all':!![]}];}return db[_0xf634('0x60')][_0xf634('0x48')](_0x360041);})[_0xf634('0x26')](function(_0x3fc87f){_0x2092d9[_0xf634('0x49')]=_0x3fc87f;return _0x2092d9;});}})[_0xf634('0x26')](respondWithFilteredResult(_0xc69d88,_0x360041))[_0xf634('0x4a')](handleError(_0xc69d88,null));};exports['getHopperBlacks']=function(_0x42a04e,_0x38eeae,_0x498dad){var _0x41028c={'raw':!![],'where':{}};var _0x43c7d2={};var _0x21861d={'count':0x0,'rows':[]};return db[_0xf634('0x30')]['findOne']({'where':{'id':_0x42a04e[_0xf634('0x59')]['id']}})['then'](handleEntityNotFound(_0x38eeae,null))['then'](function(_0x5ab6f9){if(_0x5ab6f9){_0x43c7d2[_0xf634('0x3a')]=_[_0xf634('0x4b')](db['CmHopperBlack'][_0xf634('0x31')]);_0x43c7d2['query']=_['keys'](_0x42a04e[_0xf634('0x36')]);_0x43c7d2[_0xf634('0x37')]=_[_0xf634('0x38')](_0x43c7d2[_0xf634('0x3a')],_0x43c7d2[_0xf634('0x36')]);_0x41028c[_0xf634('0x39')]=_['intersection'](_0x43c7d2[_0xf634('0x3a')],qs['fields'](_0x42a04e['query'][_0xf634('0x3b')]));_0x41028c[_0xf634('0x39')]=_0x41028c[_0xf634('0x39')][_0xf634('0x3c')]?_0x41028c[_0xf634('0x39')]:_0x43c7d2[_0xf634('0x3a')];if(!_0x42a04e[_0xf634('0x36')]['hasOwnProperty'](_0xf634('0x3d'))){_0x41028c[_0xf634('0x1e')]=qs[_0xf634('0x1e')](_0x42a04e[_0xf634('0x36')]['limit']);_0x41028c[_0xf634('0x1c')]=qs['offset'](_0x42a04e[_0xf634('0x36')][_0xf634('0x1c')]);}_0x41028c[_0xf634('0x3e')]=qs[_0xf634('0x3f')](_0x42a04e['query']['sort']);_0x41028c['where']=qs[_0xf634('0x37')](_[_0xf634('0x41')](_0x42a04e['query'],_0x43c7d2[_0xf634('0x37')]));_0x41028c[_0xf634('0x40')][_0xf634('0x5c')]=_0x5ab6f9['id'];if(_0x42a04e[_0xf634('0x36')][_0xf634('0x42')]){_0x41028c[_0xf634('0x40')]=_[_0xf634('0x43')](_0x41028c[_0xf634('0x40')],{'$or':_[_0xf634('0x35')](_0x41028c[_0xf634('0x39')],function(_0x44f13f){var _0x1bec7e={};_0x1bec7e[_0x44f13f]={'$like':'%'+_0x42a04e[_0xf634('0x36')]['filter']+'%'};return _0x1bec7e;})});}_0x41028c=_[_0xf634('0x43')]({},_0x41028c,_0x42a04e[_0xf634('0x45')]);return db[_0xf634('0x61')][_0xf634('0x1f')]({'where':_0x41028c[_0xf634('0x40')]})['then'](function(_0x4875c1){_0x21861d['count']=_0x4875c1;if(_0x42a04e['query']['includeAll']){_0x41028c[_0xf634('0x47')]=[{'all':!![]}];}return db[_0xf634('0x61')][_0xf634('0x48')](_0x41028c);})['then'](function(_0x1cc1df){_0x21861d[_0xf634('0x49')]=_0x1cc1df;return _0x21861d;});}})[_0xf634('0x26')](respondWithFilteredResult(_0x38eeae,_0x41028c))[_0xf634('0x4a')](handleError(_0x38eeae,null));};exports[_0xf634('0x62')]=function(_0x59b320,_0x58ca2a,_0x3a363c){var _0x4652b6={};var _0x1aa530={};var _0x58119e;var _0x21982a;return db[_0xf634('0x30')][_0xf634('0x5e')]({'where':{'id':_0x59b320[_0xf634('0x59')]['id']}})[_0xf634('0x26')](handleEntityNotFound(_0x58ca2a,null))['then'](function(_0x110aa0){if(_0x110aa0){_0x58119e=_0x110aa0;_0x1aa530['model']=_[_0xf634('0x4b')](db[_0xf634('0x63')]['rawAttributes']);_0x1aa530['query']=_[_0xf634('0x4b')](_0x59b320[_0xf634('0x36')]);_0x1aa530[_0xf634('0x37')]=_['intersection'](_0x1aa530[_0xf634('0x3a')],_0x1aa530[_0xf634('0x36')]);_0x4652b6['attributes']=_['intersection'](_0x1aa530[_0xf634('0x3a')],qs[_0xf634('0x3b')](_0x59b320['query'][_0xf634('0x3b')]));_0x4652b6[_0xf634('0x39')]=_0x4652b6[_0xf634('0x39')][_0xf634('0x3c')]?_0x4652b6[_0xf634('0x39')]:_0x1aa530[_0xf634('0x3a')];_0x4652b6['order']=qs[_0xf634('0x3f')](_0x59b320['query']['sort']);_0x4652b6[_0xf634('0x40')]=qs[_0xf634('0x37')](_[_0xf634('0x41')](_0x59b320[_0xf634('0x36')],_0x1aa530[_0xf634('0x37')]));if(_0x59b320[_0xf634('0x36')]['filter']){_0x4652b6[_0xf634('0x40')]=_['merge'](_0x4652b6[_0xf634('0x40')],{'$or':_['map'](_0x4652b6['attributes'],function(_0x3e8120){var _0x1c68d1={};_0x1c68d1[_0x3e8120]={'$like':'%'+_0x59b320[_0xf634('0x36')][_0xf634('0x42')]+'%'};return _0x1c68d1;})});}_0x4652b6=_[_0xf634('0x43')]({},_0x4652b6,_0x59b320[_0xf634('0x45')]);return _0x58119e[_0xf634('0x62')](_0x4652b6);}})['then'](function(_0x130252){if(_0x130252){_0x21982a=_0x130252[_0xf634('0x3c')];if(!_0x59b320[_0xf634('0x36')][_0xf634('0x5b')]('nolimit')){_0x4652b6[_0xf634('0x1e')]=qs['limit'](_0x59b320[_0xf634('0x36')][_0xf634('0x1e')]);_0x4652b6['offset']=qs[_0xf634('0x1c')](_0x59b320['query'][_0xf634('0x1c')]);}return _0x58119e[_0xf634('0x62')](_0x4652b6);}})['then'](function(_0x12916c){if(_0x12916c){return _0x12916c?{'count':_0x21982a,'rows':_0x12916c}:null;}})[_0xf634('0x26')](respondWithResult(_0x58ca2a,null))['catch'](handleError(_0x58ca2a,null));};exports[_0xf634('0x64')]=function(_0x446a04,_0x5a3746,_0x1a64dc){var _0x27f6f1,_0x3fbce2;return db[_0xf634('0x30')][_0xf634('0x52')]({'where':{'id':_0x446a04[_0xf634('0x59')]['id']}})['then'](handleEntityNotFound(_0x5a3746,null))[_0xf634('0x26')](function(_0x20b611){if(_0x20b611){_0x3fbce2=_0x20b611;return _0x20b611['addLists'](_0x446a04[_0xf634('0x4d')][_0xf634('0x65')],_['omit'](_0x446a04['body'],[_0xf634('0x65'),'id'])||{});}return null;})[_0xf634('0x66')](function(_0xf9f5b1){var _0x42c0e3;_0x27f6f1=_0xf9f5b1||[];var _0x328627=[];if(_0xf9f5b1){for(var _0x487fa9=0x0;_0x487fa9<_0xf9f5b1[_0xf634('0x3c')];_0x487fa9+=0x1){var _0x44eca3=_0xf9f5b1[_0x487fa9][_0xf634('0x27')]({'plain':!![]});_0x3fbce2[_0xf634('0x67')]=_0x446a04[_0xf634('0x4d')][_0xf634('0x67')]?_0x446a04[_0xf634('0x4d')][_0xf634('0x67')]:_0x3fbce2[_0xf634('0x67')];switch(_0x3fbce2[_0xf634('0x67')]){case'always':_0x42c0e3=squel[_0xf634('0x68')]()[_0xf634('0x69')](_0xf634('0x6a'))['fromQuery']([_0xf634('0x6b'),'scheduledAt',_0xf634('0x6c'),_0xf634('0x6d'),_0xf634('0x5c'),'createdAt',_0xf634('0x58')],squel[_0xf634('0x6e')]()[_0xf634('0x6f')]('phone','phone')[_0xf634('0x6f')]('NOW()',_0xf634('0x70'))[_0xf634('0x6f')]('id',_0xf634('0x6c'))['field'](_0x44eca3[_0xf634('0x71')]['toString'](),_0xf634('0x6d'))[_0xf634('0x6f')](_0x446a04[_0xf634('0x59')]['id']['toString'](),'CampaignId')['field'](_0xf634('0x72'),_0xf634('0x57'))['field'](_0xf634('0x72'),_0xf634('0x58'))[_0xf634('0x73')]('cm_contacts')['where'](_0xf634('0x74'))[_0xf634('0x40')](_0xf634('0x75'),_0x44eca3[_0xf634('0x71')][_0xf634('0x76')]())[_0xf634('0x40')](_0xf634('0x77'))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xf634('0x6f')](_0xf634('0x78'))[_0xf634('0x73')](_0xf634('0x79'))[_0xf634('0x40')](_0xf634('0x7a'),_0x446a04[_0xf634('0x59')]['id'][_0xf634('0x76')]()))['where'](_0xf634('0x7b'),squel[_0xf634('0x6e')]()[_0xf634('0x6f')](_0xf634('0x7c'))[_0xf634('0x73')](_0xf634('0x6a'))['where']('CampaignId\x20=\x20?',_0x446a04[_0xf634('0x59')]['id'][_0xf634('0x76')]())))[_0xf634('0x76')]();break;case'onlyIfOpen':_0x42c0e3=squel[_0xf634('0x68')]()[_0xf634('0x69')](_0xf634('0x6a'))['fromQuery']([_0xf634('0x6b'),_0xf634('0x70'),_0xf634('0x6c'),_0xf634('0x6d'),'CampaignId',_0xf634('0x57'),_0xf634('0x58')],squel[_0xf634('0x6e')]()[_0xf634('0x6f')]('phone',_0xf634('0x6b'))[_0xf634('0x6f')](_0xf634('0x72'),_0xf634('0x70'))['field']('id',_0xf634('0x6c'))['field'](_0x44eca3['CmListId'][_0xf634('0x76')](),_0xf634('0x6d'))[_0xf634('0x6f')](_0x446a04[_0xf634('0x59')]['id'][_0xf634('0x76')](),_0xf634('0x5c'))[_0xf634('0x6f')](_0xf634('0x72'),_0xf634('0x57'))[_0xf634('0x6f')](_0xf634('0x72'),_0xf634('0x58'))['from'](_0xf634('0x7d'))[_0xf634('0x40')]('deletedAt\x20IS\x20NULL')['where'](_0xf634('0x75'),_0x44eca3[_0xf634('0x71')][_0xf634('0x76')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xf634('0x40')](_0xf634('0x7b'),squel[_0xf634('0x6e')]()[_0xf634('0x6f')](_0xf634('0x7c'))[_0xf634('0x73')](_0xf634('0x6a'))[_0xf634('0x40')](_0xf634('0x7a'),_0x446a04[_0xf634('0x59')]['id'][_0xf634('0x76')]())))[_0xf634('0x76')]();break;default:_0x42c0e3=squel[_0xf634('0x68')]()[_0xf634('0x69')](_0xf634('0x6a'))[_0xf634('0x7e')](['phone','scheduledAt',_0xf634('0x6c'),_0xf634('0x6d'),_0xf634('0x5c'),_0xf634('0x57'),_0xf634('0x58')],squel['select']()['field'](_0xf634('0x6b'),_0xf634('0x6b'))[_0xf634('0x6f')](_0xf634('0x72'),_0xf634('0x70'))['field']('id',_0xf634('0x6c'))[_0xf634('0x6f')](_0x44eca3['CmListId']['toString'](),_0xf634('0x6d'))[_0xf634('0x6f')](_0x446a04[_0xf634('0x59')]['id']['toString'](),_0xf634('0x5c'))[_0xf634('0x6f')](_0xf634('0x72'),_0xf634('0x57'))[_0xf634('0x6f')](_0xf634('0x72'),_0xf634('0x58'))[_0xf634('0x73')](_0xf634('0x7d'))[_0xf634('0x40')]('deletedAt\x20IS\x20NULL')['where'](_0xf634('0x75'),_0x44eca3['CmListId'][_0xf634('0x76')]())[_0xf634('0x40')](_0xf634('0x77')))['toString']();}_0x328627[_0xf634('0x7f')](db[_0xf634('0x80')][_0xf634('0x36')](_0x42c0e3));}return BPromise['all'](_0x328627);}})[_0xf634('0x26')](function(){return _0x27f6f1;})[_0xf634('0x26')](respondWithResult(_0x5a3746,null))[_0xf634('0x4a')](handleError(_0x5a3746,null));};exports['removeLists']=function(_0xa21f39,_0x398d17,_0x22144a){return db[_0xf634('0x30')][_0xf634('0x52')]({'where':{'id':_0xa21f39[_0xf634('0x59')]['id']}})[_0xf634('0x26')](handleEntityNotFound(_0x398d17,null))[_0xf634('0x26')](function(_0x44df25){if(_0x44df25){return _0x44df25[_0xf634('0x81')](_0xa21f39[_0xf634('0x36')][_0xf634('0x65')]);}})[_0xf634('0x26')](function(_0x26acda){if(_0x26acda){return db['CmHopper'][_0xf634('0x2a')]({'where':{'ListId':_0xa21f39[_0xf634('0x36')][_0xf634('0x65')],'CampaignId':_0xa21f39[_0xf634('0x59')]['id']}})['then'](function(){return _0x26acda;});}})[_0xf634('0x26')](respondWithStatusCode(_0x398d17,null))[_0xf634('0x4a')](handleError(_0x398d17,null));};exports[_0xf634('0x82')]=function(_0x5847cb,_0x4d8a36,_0x474734){var _0x538cee={};var _0x4f904b={};var _0xe19330;var _0x1819de;return db['Campaign']['findOne']({'where':{'id':_0x5847cb[_0xf634('0x59')]['id']}})[_0xf634('0x26')](handleEntityNotFound(_0x4d8a36,null))['then'](function(_0xf813f9){if(_0xf813f9){_0xe19330=_0xf813f9;_0x4f904b[_0xf634('0x3a')]=_['keys'](db[_0xf634('0x63')]['rawAttributes']);_0x4f904b[_0xf634('0x36')]=_[_0xf634('0x4b')](_0x5847cb[_0xf634('0x36')]);_0x4f904b[_0xf634('0x37')]=_[_0xf634('0x38')](_0x4f904b['model'],_0x4f904b[_0xf634('0x36')]);_0x538cee[_0xf634('0x39')]=_[_0xf634('0x38')](_0x4f904b['model'],qs[_0xf634('0x3b')](_0x5847cb['query']['fields']));_0x538cee[_0xf634('0x39')]=_0x538cee[_0xf634('0x39')][_0xf634('0x3c')]?_0x538cee[_0xf634('0x39')]:_0x4f904b[_0xf634('0x3a')];_0x538cee[_0xf634('0x3e')]=qs[_0xf634('0x3f')](_0x5847cb['query'][_0xf634('0x3f')]);_0x538cee[_0xf634('0x40')]=qs[_0xf634('0x37')](_[_0xf634('0x41')](_0x5847cb['query'],_0x4f904b[_0xf634('0x37')]));if(_0x5847cb[_0xf634('0x36')][_0xf634('0x42')]){_0x538cee[_0xf634('0x40')]=_[_0xf634('0x43')](_0x538cee[_0xf634('0x40')],{'$or':_['map'](_0x538cee[_0xf634('0x39')],function(_0xc89691){var _0x16d1ba={};_0x16d1ba[_0xc89691]={'$like':'%'+_0x5847cb[_0xf634('0x36')][_0xf634('0x42')]+'%'};return _0x16d1ba;})});}_0x538cee=_[_0xf634('0x43')]({},_0x538cee,_0x5847cb['options']);return _0xe19330[_0xf634('0x82')](_0x538cee);}})[_0xf634('0x26')](function(_0x4607fc){if(_0x4607fc){_0x1819de=_0x4607fc[_0xf634('0x3c')];if(!_0x5847cb[_0xf634('0x36')][_0xf634('0x5b')](_0xf634('0x3d'))){_0x538cee[_0xf634('0x1e')]=qs['limit'](_0x5847cb[_0xf634('0x36')][_0xf634('0x1e')]);_0x538cee['offset']=qs[_0xf634('0x1c')](_0x5847cb[_0xf634('0x36')][_0xf634('0x1c')]);}return _0xe19330[_0xf634('0x82')](_0x538cee);}})['then'](function(_0x280dc6){if(_0x280dc6){return _0x280dc6?{'count':_0x1819de,'rows':_0x280dc6}:null;}})[_0xf634('0x26')](respondWithResult(_0x4d8a36,null))[_0xf634('0x4a')](handleError(_0x4d8a36,null));};exports[_0xf634('0x83')]=function(_0x1826d3,_0x4c54df,_0x4a2100){var _0x334d20,_0x4a578e;return db[_0xf634('0x30')][_0xf634('0x52')]({'where':{'id':_0x1826d3[_0xf634('0x59')]['id']}})[_0xf634('0x26')](handleEntityNotFound(_0x4c54df,null))[_0xf634('0x26')](function(_0x4281a1){if(_0x4281a1){_0x4a578e=_0x4281a1;return _0x4281a1[_0xf634('0x83')](_0x1826d3['body'][_0xf634('0x65')],_[_0xf634('0x56')](_0x1826d3[_0xf634('0x4d')],[_0xf634('0x65'),'id'])||{});}return null;})[_0xf634('0x66')](function(_0x4f0292){var _0x276ba8;_0x334d20=_0x4f0292||[];var _0x28891b=[];if(_0x4f0292){for(var _0x59f12d=0x0;_0x59f12d<_0x4f0292[_0xf634('0x3c')];_0x59f12d+=0x1){var _0x2b8f12=_0x4f0292[_0x59f12d][_0xf634('0x27')]({'plain':!![]});_0x276ba8=squel[_0xf634('0x68')]()[_0xf634('0x69')](_0xf634('0x84'))[_0xf634('0x7e')]([_0xf634('0x6b'),_0xf634('0x6c'),'ListId',_0xf634('0x5c'),_0xf634('0x57'),_0xf634('0x58')],squel[_0xf634('0x6e')]()[_0xf634('0x6f')](_0xf634('0x6b'),_0xf634('0x6b'))[_0xf634('0x6f')]('id',_0xf634('0x6c'))['field'](_0x2b8f12[_0xf634('0x71')]['toString'](),_0xf634('0x6d'))['field'](_0x1826d3[_0xf634('0x59')]['id'][_0xf634('0x76')](),_0xf634('0x5c'))[_0xf634('0x6f')]('NOW()',_0xf634('0x57'))[_0xf634('0x6f')](_0xf634('0x72'),_0xf634('0x58'))[_0xf634('0x73')](_0xf634('0x7d'))['where'](_0xf634('0x74'))['where']('ListId\x20=\x20?',_0x2b8f12[_0xf634('0x71')][_0xf634('0x76')]())['where'](_0xf634('0x77')))[_0xf634('0x76')]();_0x28891b[_0xf634('0x7f')](db[_0xf634('0x80')]['query'](_0x276ba8));}return BPromise[_0xf634('0x85')](_0x28891b);}})[_0xf634('0x26')](function(){return _0x334d20;})[_0xf634('0x26')](respondWithResult(_0x4c54df,null))[_0xf634('0x4a')](handleError(_0x4c54df,null));};exports[_0xf634('0x86')]=function(_0x5a3ca0,_0x462959,_0x310aec){return db['Campaign'][_0xf634('0x52')]({'where':{'id':_0x5a3ca0[_0xf634('0x59')]['id']}})['then'](handleEntityNotFound(_0x462959,null))[_0xf634('0x26')](function(_0x374f9b){if(_0x374f9b){return _0x374f9b[_0xf634('0x86')](_0x5a3ca0[_0xf634('0x36')][_0xf634('0x65')]);}})['then'](function(_0x24b9ec){if(_0x24b9ec){return db[_0xf634('0x61')][_0xf634('0x2a')]({'where':{'ListId':_0x5a3ca0['query'][_0xf634('0x65')],'CampaignId':_0x5a3ca0['params']['id']}})[_0xf634('0x26')](function(){return _0x24b9ec;});}})[_0xf634('0x26')](respondWithStatusCode(_0x462959,null))[_0xf634('0x4a')](handleError(_0x462959,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index f7c763b..e1c970a 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(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 95e7819..34bc028 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 _0xce25=['code','message','result','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error'];(function(_0x1686dd,_0x45296b){var _0xd7bbb1=function(_0x590894){while(--_0x590894){_0x1686dd['push'](_0x1686dd['shift']());}};_0xd7bbb1(++_0x45296b);}(_0xce25,0x196));var _0x5ce2=function(_0x5a7508,_0xa07e6c){_0x5a7508=_0x5a7508-0x0;var _0x441471=_0xce25[_0x5a7508];return _0x441471;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5ce2('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ce2('0x1'))['db'];var utils=require(_0x5ce2('0x2'));var logger=require('../../config/logger')(_0x5ce2('0x3'));var config=require(_0x5ce2('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5ce2('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x417149,_0x1ab2e7,_0xcb80ee){return new BPromise(function(_0x4a57a6,_0x2ccf81){return client[_0x5ce2('0x6')](_0x417149,_0xcb80ee)[_0x5ce2('0x7')](function(_0x49ede4){logger[_0x5ce2('0x8')](_0x5ce2('0x9'),_0x1ab2e7,_0x5ce2('0xa'));logger[_0x5ce2('0xb')](_0x5ce2('0xc'),_0x1ab2e7,_0x5ce2('0xa'),JSON['stringify'](_0x49ede4));if(_0x49ede4[_0x5ce2('0xd')]){if(_0x49ede4['error'][_0x5ce2('0xe')]===0x1f4){logger[_0x5ce2('0xd')]('Campaign,\x20%s,\x20%s',_0x1ab2e7,_0x49ede4['error']['message']);return _0x2ccf81(_0x49ede4['error'][_0x5ce2('0xf')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x1ab2e7,_0x49ede4[_0x5ce2('0xd')]['message']);return _0x4a57a6(_0x49ede4[_0x5ce2('0xd')][_0x5ce2('0xf')]);}else{logger[_0x5ce2('0x8')]('Campaign,\x20%s,\x20%s',_0x1ab2e7,_0x5ce2('0xa'));_0x4a57a6(_0x49ede4[_0x5ce2('0x10')][_0x5ce2('0xf')]);}})['catch'](function(_0x4b89d3){logger[_0x5ce2('0xd')](_0x5ce2('0x9'),_0x1ab2e7,_0x4b89d3);_0x2ccf81(_0x4b89d3);});});}exports[_0x5ce2('0x11')]=function(_0x5369e7){var _0x19915d=this;return new Promise(function(_0x30cb39,_0x3dd57a){return db[_0x5ce2('0x12')][_0x5ce2('0x13')]({'raw':_0x5369e7[_0x5ce2('0x14')]?_0x5369e7[_0x5ce2('0x14')][_0x5ce2('0x15')]===undefined?!![]:![]:!![],'where':_0x5369e7[_0x5ce2('0x14')]?_0x5369e7[_0x5ce2('0x14')][_0x5ce2('0x16')]||null:null,'attributes':_0x5369e7[_0x5ce2('0x14')]?_0x5369e7[_0x5ce2('0x14')][_0x5ce2('0x17')]||null:null,'limit':_0x5369e7[_0x5ce2('0x14')]?_0x5369e7[_0x5ce2('0x14')][_0x5ce2('0x18')]||null:null,'include':_0x5369e7[_0x5ce2('0x14')]?_0x5369e7[_0x5ce2('0x14')]['include']?_['map'](_0x5369e7[_0x5ce2('0x14')][_0x5ce2('0x19')],function(_0x3440b5){return{'model':db[_0x3440b5['model']],'as':_0x3440b5['as'],'attributes':_0x3440b5['attributes'],'include':_0x3440b5[_0x5ce2('0x19')]?_[_0x5ce2('0x1a')](_0x3440b5['include'],function(_0x3008af){return{'model':db[_0x3008af[_0x5ce2('0x1b')]],'as':_0x3008af['as'],'attributes':_0x3008af[_0x5ce2('0x17')],'include':_0x3008af[_0x5ce2('0x19')]?_[_0x5ce2('0x1a')](_0x3008af[_0x5ce2('0x19')],function(_0x3a4bb9){return{'model':db[_0x3a4bb9[_0x5ce2('0x1b')]],'as':_0x3a4bb9['as'],'attributes':_0x3a4bb9[_0x5ce2('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5ce2('0x7')](function(_0x2f4ccd){logger[_0x5ce2('0x8')](_0x5ce2('0x11'),_0x5369e7);logger[_0x5ce2('0xb')](_0x5ce2('0x11'),_0x5369e7,JSON[_0x5ce2('0x1c')](_0x2f4ccd));_0x30cb39(_0x2f4ccd);})[_0x5ce2('0x1d')](function(_0x2898ae){logger[_0x5ce2('0xd')](_0x5ce2('0x11'),_0x2898ae[_0x5ce2('0xf')],_0x5369e7);_0x3dd57a(_0x19915d[_0x5ce2('0xd')](0x1f4,_0x2898ae[_0x5ce2('0xf')]));});});}; \ No newline at end of file +var _0xb469=['include','model','map','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','Campaign,\x20%s,\x20%s','debug','request\x20sent','error','message','info','result','GetCampaign','findAll','options','raw','attributes','limit'];(function(_0x38eb46,_0x366b44){var _0x42d083=function(_0x4c555b){while(--_0x4c555b){_0x38eb46['push'](_0x38eb46['shift']());}};_0x42d083(++_0x366b44);}(_0xb469,0x13b));var _0x9b46=function(_0x2b7e85,_0x20350a){_0x2b7e85=_0x2b7e85-0x0;var _0x5107e8=_0xb469[_0x2b7e85];return _0x5107e8;};'use strict';var _=require(_0x9b46('0x0'));var util=require(_0x9b46('0x1'));var moment=require(_0x9b46('0x2'));var BPromise=require(_0x9b46('0x3'));var rs=require(_0x9b46('0x4'));var fs=require('fs');var Redis=require(_0x9b46('0x5'));var db=require(_0x9b46('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9b46('0x7'))(_0x9b46('0x8'));var config=require('../../config/environment');var jayson=require(_0x9b46('0x9'));var client=jayson[_0x9b46('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b2dd3,_0x5bd834,_0x4c1ed9){return new BPromise(function(_0x34c0de,_0x545b6c){return client[_0x9b46('0xb')](_0x1b2dd3,_0x4c1ed9)[_0x9b46('0xc')](function(_0x43a112){logger['info'](_0x9b46('0xd'),_0x5bd834,'request\x20sent');logger[_0x9b46('0xe')]('Campaign,\x20%s,\x20%s,\x20%s',_0x5bd834,_0x9b46('0xf'),JSON['stringify'](_0x43a112));if(_0x43a112[_0x9b46('0x10')]){if(_0x43a112[_0x9b46('0x10')]['code']===0x1f4){logger[_0x9b46('0x10')](_0x9b46('0xd'),_0x5bd834,_0x43a112['error'][_0x9b46('0x11')]);return _0x545b6c(_0x43a112[_0x9b46('0x10')][_0x9b46('0x11')]);}logger[_0x9b46('0x10')](_0x9b46('0xd'),_0x5bd834,_0x43a112[_0x9b46('0x10')][_0x9b46('0x11')]);return _0x34c0de(_0x43a112[_0x9b46('0x10')][_0x9b46('0x11')]);}else{logger[_0x9b46('0x12')](_0x9b46('0xd'),_0x5bd834,_0x9b46('0xf'));_0x34c0de(_0x43a112[_0x9b46('0x13')]['message']);}})['catch'](function(_0x52c1b8){logger[_0x9b46('0x10')](_0x9b46('0xd'),_0x5bd834,_0x52c1b8);_0x545b6c(_0x52c1b8);});});}exports[_0x9b46('0x14')]=function(_0x5c5cc9){var _0x5dd7bd=this;return new Promise(function(_0x3d9efa,_0x4ccfd0){return db['Campaign'][_0x9b46('0x15')]({'raw':_0x5c5cc9[_0x9b46('0x16')]?_0x5c5cc9['options'][_0x9b46('0x17')]===undefined?!![]:![]:!![],'where':_0x5c5cc9[_0x9b46('0x16')]?_0x5c5cc9['options']['where']||null:null,'attributes':_0x5c5cc9[_0x9b46('0x16')]?_0x5c5cc9[_0x9b46('0x16')][_0x9b46('0x18')]||null:null,'limit':_0x5c5cc9['options']?_0x5c5cc9['options'][_0x9b46('0x19')]||null:null,'include':_0x5c5cc9['options']?_0x5c5cc9[_0x9b46('0x16')][_0x9b46('0x1a')]?_['map'](_0x5c5cc9[_0x9b46('0x16')]['include'],function(_0x141cb6){return{'model':db[_0x141cb6[_0x9b46('0x1b')]],'as':_0x141cb6['as'],'attributes':_0x141cb6['attributes'],'include':_0x141cb6[_0x9b46('0x1a')]?_[_0x9b46('0x1c')](_0x141cb6[_0x9b46('0x1a')],function(_0x319930){return{'model':db[_0x319930[_0x9b46('0x1b')]],'as':_0x319930['as'],'attributes':_0x319930[_0x9b46('0x18')],'include':_0x319930[_0x9b46('0x1a')]?_['map'](_0x319930[_0x9b46('0x1a')],function(_0x3ac37e){return{'model':db[_0x3ac37e[_0x9b46('0x1b')]],'as':_0x3ac37e['as'],'attributes':_0x3ac37e[_0x9b46('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9b46('0xc')](function(_0x2a79a5){logger[_0x9b46('0x12')]('GetCampaign',_0x5c5cc9);logger[_0x9b46('0xe')](_0x9b46('0x14'),_0x5c5cc9,JSON[_0x9b46('0x1d')](_0x2a79a5));_0x3d9efa(_0x2a79a5);})[_0x9b46('0x1e')](function(_0x28b289){logger[_0x9b46('0x10')](_0x9b46('0x14'),_0x28b289[_0x9b46('0x11')],_0x5c5cc9);_0x4ccfd0(_0x5dd7bd[_0x9b46('0x10')](0x1f4,_0x28b289[_0x9b46('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 34e4388..69741be 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 _0x6fd4=['post','create','/:id/clone','clone','addLists','addBlackLists','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','fs-extra','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_black','/:id/lists','/:id/blacklists'];(function(_0xcb19e1,_0x465489){var _0x121872=function(_0x5c9cd1){while(--_0x5c9cd1){_0xcb19e1['push'](_0xcb19e1['shift']());}};_0x121872(++_0x465489);}(_0x6fd4,0x118));var _0x46fd=function(_0x1b3e49,_0x299f04){_0x1b3e49=_0x1b3e49-0x0;var _0x596fb2=_0x6fd4[_0x1b3e49];return _0x596fb2;};'use strict';var multer=require(_0x46fd('0x0'));var util=require(_0x46fd('0x1'));var path=require(_0x46fd('0x2'));var timeout=require(_0x46fd('0x3'));var express=require(_0x46fd('0x4'));var router=express['Router']();var fs_extra=require(_0x46fd('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x46fd('0x6'));router[_0x46fd('0x7')]('/',auth[_0x46fd('0x8')](),controller[_0x46fd('0x9')]);router[_0x46fd('0x7')](_0x46fd('0xa'),auth[_0x46fd('0x8')](),controller['show']);router[_0x46fd('0x7')](_0x46fd('0xb'),auth[_0x46fd('0x8')](),controller['getHoppers']);router[_0x46fd('0x7')](_0x46fd('0xc'),auth[_0x46fd('0x8')](),controller[_0x46fd('0xd')]);router[_0x46fd('0x7')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router[_0x46fd('0x7')](_0x46fd('0xe'),auth[_0x46fd('0x8')](),controller['getHopperBlacks']);router[_0x46fd('0x7')](_0x46fd('0xf'),auth[_0x46fd('0x8')](),controller['getLists']);router[_0x46fd('0x7')](_0x46fd('0x10'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0x46fd('0x11')]('/',auth['isAuthenticated'](),controller[_0x46fd('0x12')]);router['post'](_0x46fd('0x13'),auth[_0x46fd('0x8')](),controller[_0x46fd('0x14')]);router[_0x46fd('0x11')]('/:id/lists',auth['isAuthenticated'](),controller[_0x46fd('0x15')]);router['post'](_0x46fd('0x10'),auth[_0x46fd('0x8')](),controller[_0x46fd('0x16')]);router['put'](_0x46fd('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x46fd('0x17')](_0x46fd('0xa'),auth[_0x46fd('0x8')](),controller['destroy']);router[_0x46fd('0x17')](_0x46fd('0xf'),auth['isAuthenticated'](),controller[_0x46fd('0x18')]);router[_0x46fd('0x17')](_0x46fd('0x10'),auth[_0x46fd('0x8')](),controller[_0x46fd('0x19')]);module[_0x46fd('0x1a')]=router; \ No newline at end of file +var _0x4eaf=['../../components/interaction/service','../../config/environment','./campaign.controller','get','/:id','isAuthenticated','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists','put','delete','removeBlackLists','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5bfcdb,_0x542098){var _0x3c13c0=function(_0x1cb487){while(--_0x1cb487){_0x5bfcdb['push'](_0x5bfcdb['shift']());}};_0x3c13c0(++_0x542098);}(_0x4eaf,0x112));var _0xf4ea=function(_0x283476,_0xaae5d7){_0x283476=_0x283476-0x0;var _0x122d8e=_0x4eaf[_0x283476];return _0x122d8e;};'use strict';var multer=require(_0xf4ea('0x0'));var util=require('util');var path=require(_0xf4ea('0x1'));var timeout=require(_0xf4ea('0x2'));var express=require(_0xf4ea('0x3'));var router=express['Router']();var fs_extra=require(_0xf4ea('0x4'));var auth=require(_0xf4ea('0x5'));var interaction=require(_0xf4ea('0x6'));var config=require(_0xf4ea('0x7'));var controller=require(_0xf4ea('0x8'));router[_0xf4ea('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xf4ea('0xa'),auth[_0xf4ea('0xb')](),controller['show']);router[_0xf4ea('0x9')]('/:id/hoppers',auth[_0xf4ea('0xb')](),controller['getHoppers']);router[_0xf4ea('0x9')](_0xf4ea('0xc'),auth['isAuthenticated'](),controller[_0xf4ea('0xd')]);router[_0xf4ea('0x9')](_0xf4ea('0xe'),auth[_0xf4ea('0xb')](),controller[_0xf4ea('0xf')]);router[_0xf4ea('0x9')](_0xf4ea('0x10'),auth[_0xf4ea('0xb')](),controller[_0xf4ea('0x11')]);router[_0xf4ea('0x9')](_0xf4ea('0x12'),auth[_0xf4ea('0xb')](),controller['getLists']);router[_0xf4ea('0x9')](_0xf4ea('0x13'),auth[_0xf4ea('0xb')](),controller[_0xf4ea('0x14')]);router[_0xf4ea('0x15')]('/',auth[_0xf4ea('0xb')](),controller['create']);router[_0xf4ea('0x15')](_0xf4ea('0x16'),auth[_0xf4ea('0xb')](),controller[_0xf4ea('0x17')]);router['post']('/:id/lists',auth[_0xf4ea('0xb')](),controller[_0xf4ea('0x18')]);router['post']('/:id/blacklists',auth[_0xf4ea('0xb')](),controller['addBlackLists']);router[_0xf4ea('0x19')](_0xf4ea('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xf4ea('0x1a')](_0xf4ea('0xa'),auth[_0xf4ea('0xb')](),controller['destroy']);router['delete']('/:id/lists',auth[_0xf4ea('0xb')](),controller['removeLists']);router[_0xf4ea('0x1a')]('/:id/blacklists',auth[_0xf4ea('0xb')](),controller[_0xf4ea('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 4afdbeb..c32c6ae 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 _0x0056=['key','STRING','TEXT','VIRTUAL'];(function(_0x1bd44d,_0xbab50d){var _0x2bc632=function(_0x36fd8b){while(--_0x36fd8b){_0x1bd44d['push'](_0x1bd44d['shift']());}};_0x2bc632(++_0xbab50d);}(_0x0056,0x69));var _0x6005=function(_0x1a0600,_0x41feef){_0x1a0600=_0x1a0600-0x0;var _0x734670=_0x0056[_0x1a0600];return _0x734670;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x6005('0x0')],'allowNull':![]},'value':{'type':Sequelize[_0x6005('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x6005('0x0')]},'name':{'type':Sequelize[_0x6005('0x2')],'get':function(){return this['getDataValue'](_0x6005('0x3'));}}}; \ No newline at end of file +var _0x9ddc=['getDataValue','key','sequelize','exports','TEXT','STRING','VIRTUAL'];(function(_0x3231da,_0x3ae101){var _0x256829=function(_0x57e2d7){while(--_0x57e2d7){_0x3231da['push'](_0x3231da['shift']());}};_0x256829(++_0x3ae101);}(_0x9ddc,0x64));var _0xc9dd=function(_0x258ccf,_0x59e5be){_0x258ccf=_0x258ccf-0x0;var _0x17df41=_0x9ddc[_0x258ccf];return _0x17df41;};'use strict';var Sequelize=require(_0xc9dd('0x0'));module[_0xc9dd('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xc9dd('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc9dd('0x3')]},'name':{'type':Sequelize[_0xc9dd('0x4')],'get':function(){return this[_0xc9dd('0x5')](_0xc9dd('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 2048108..0eb45c8 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 _0xf8f5=['UserProfileResource','sendStatus','error','stack','name','index','map','CannedAnswer','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','fields','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','get'];(function(_0x405496,_0x2da8ad){var _0x3c3a5c=function(_0x232817){while(--_0x232817){_0x405496['push'](_0x405496['shift']());}};_0x3c3a5c(++_0x2da8ad);}(_0xf8f5,0x1e0));var _0x5f8f=function(_0x3d4641,_0x59df6d){_0x3d4641=_0x3d4641-0x0;var _0x54bfd3=_0xf8f5[_0x3d4641];return _0x54bfd3;};'use strict';var emlformat=require(_0x5f8f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5f8f('0x1'));var moment=require(_0x5f8f('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5f8f('0x3'));var path=require('path');var sox=require(_0x5f8f('0x4'));var csv=require(_0x5f8f('0x5'));var ejs=require(_0x5f8f('0x6'));var fs=require('fs');var fs_extra=require(_0x5f8f('0x7'));var _=require(_0x5f8f('0x8'));var squel=require('squel');var crypto=require(_0x5f8f('0x9'));var jsforce=require(_0x5f8f('0xa'));var deskjs=require(_0x5f8f('0xb'));var toCsv=require(_0x5f8f('0x5'));var querystring=require(_0x5f8f('0xc'));var Papa=require(_0x5f8f('0xd'));var Redis=require('ioredis');var authService=require(_0x5f8f('0xe'));var qs=require(_0x5f8f('0xf'));var as=require(_0x5f8f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5f8f('0x11'))(_0x5f8f('0x12'));var utils=require(_0x5f8f('0x13'));var config=require(_0x5f8f('0x14'));var licenseUtil=require(_0x5f8f('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ef6df,_0x52c6fa){_0x52c6fa=_0x52c6fa||0xcc;return function(_0x32f67f){if(_0x32f67f){return _0x5ef6df['sendStatus'](_0x52c6fa);}return _0x5ef6df[_0x5f8f('0x16')](_0x52c6fa)[_0x5f8f('0x17')]();};}function respondWithResult(_0x13a382,_0x1ea400){_0x1ea400=_0x1ea400||0xc8;return function(_0x28cce7){if(_0x28cce7){return _0x13a382[_0x5f8f('0x16')](_0x1ea400)[_0x5f8f('0x18')](_0x28cce7);}};}function respondWithFilteredResult(_0x162776,_0x4b2eed){return function(_0x4db5e0){if(_0x4db5e0){var _0x3ad606=typeof _0x4b2eed['offset']===_0x5f8f('0x19')&&typeof _0x4b2eed[_0x5f8f('0x1a')]===_0x5f8f('0x19');var _0x58a259=_0x4db5e0[_0x5f8f('0x1b')];var _0x1ffbfa=_0x3ad606?0x0:_0x4b2eed[_0x5f8f('0x1c')];var _0x38e6f8=_0x3ad606?_0x4db5e0[_0x5f8f('0x1b')]:_0x4b2eed['offset']+_0x4b2eed['limit'];var _0x4a6085;if(_0x38e6f8>=_0x58a259){_0x38e6f8=_0x58a259;_0x4a6085=0xc8;}else{_0x4a6085=0xce;}_0x162776['status'](_0x4a6085);return _0x162776[_0x5f8f('0x1d')](_0x5f8f('0x1e'),_0x1ffbfa+'-'+_0x38e6f8+'/'+_0x58a259)[_0x5f8f('0x18')](_0x4db5e0);}return null;};}function patchUpdates(_0xc68388){return function(_0x523fe9){try{jsonpatch['apply'](_0x523fe9,_0xc68388,!![]);}catch(_0x14b88f){return BPromise['reject'](_0x14b88f);}return _0x523fe9[_0x5f8f('0x1f')]();};}function saveUpdates(_0xd5174b,_0x37a1f0){return function(_0x337b1d){if(_0x337b1d){return _0x337b1d[_0x5f8f('0x20')](_0xd5174b)[_0x5f8f('0x21')](function(_0x4a4bb3){return _0x4a4bb3;});}return null;};}function removeEntity(_0x3bf6f3,_0x2bbc0c){return function(_0x54abd2){if(_0x54abd2){return _0x54abd2[_0x5f8f('0x22')]()[_0x5f8f('0x21')](function(){var _0x58cded=_0x54abd2[_0x5f8f('0x23')]({'plain':!![]});var _0x59f701='CannedAnswers';return db[_0x5f8f('0x24')][_0x5f8f('0x22')]({'where':{'type':_0x59f701,'resourceId':_0x58cded['id']}})[_0x5f8f('0x21')](function(){return _0x54abd2;});})[_0x5f8f('0x21')](function(){_0x3bf6f3[_0x5f8f('0x16')](0xcc)[_0x5f8f('0x17')]();});}};}function handleEntityNotFound(_0x470efa,_0x35772e){return function(_0x14bfba){if(!_0x14bfba){_0x470efa[_0x5f8f('0x25')](0x194);}return _0x14bfba;};}function handleError(_0x120174,_0x4d5af1){_0x4d5af1=_0x4d5af1||0x1f4;return function(_0x77b7a3){logger[_0x5f8f('0x26')](_0x77b7a3[_0x5f8f('0x27')]);if(_0x77b7a3[_0x5f8f('0x28')]){delete _0x77b7a3['name'];}_0x120174[_0x5f8f('0x16')](_0x4d5af1)['send'](_0x77b7a3);};}exports[_0x5f8f('0x29')]=function(_0x3a53d0,_0x3eccb3){var _0x466f7d={},_0x1d8e6b={},_0x2a3bc1={'count':0x0,'rows':[]};var _0x36cc97=_[_0x5f8f('0x2a')](db[_0x5f8f('0x2b')][_0x5f8f('0x2c')],function(_0x315e59){return{'name':_0x315e59['fieldName'],'type':_0x315e59[_0x5f8f('0x2d')][_0x5f8f('0x2e')]};});_0x1d8e6b[_0x5f8f('0x2f')]=_[_0x5f8f('0x2a')](_0x36cc97,_0x5f8f('0x28'));_0x1d8e6b['query']=_[_0x5f8f('0x30')](_0x3a53d0[_0x5f8f('0x31')]);_0x1d8e6b[_0x5f8f('0x32')]=_[_0x5f8f('0x33')](_0x1d8e6b['model'],_0x1d8e6b[_0x5f8f('0x31')]);_0x466f7d[_0x5f8f('0x34')]=_[_0x5f8f('0x33')](_0x1d8e6b['model'],qs['fields'](_0x3a53d0[_0x5f8f('0x31')]['fields']));_0x466f7d[_0x5f8f('0x34')]=_0x466f7d[_0x5f8f('0x34')][_0x5f8f('0x35')]?_0x466f7d[_0x5f8f('0x34')]:_0x1d8e6b[_0x5f8f('0x2f')];if(!_0x3a53d0[_0x5f8f('0x31')][_0x5f8f('0x36')](_0x5f8f('0x37'))){_0x466f7d['limit']=qs[_0x5f8f('0x1a')](_0x3a53d0[_0x5f8f('0x31')]['limit']);_0x466f7d[_0x5f8f('0x1c')]=qs[_0x5f8f('0x1c')](_0x3a53d0[_0x5f8f('0x31')][_0x5f8f('0x1c')]);}_0x466f7d['order']=qs[_0x5f8f('0x38')](_0x3a53d0[_0x5f8f('0x31')][_0x5f8f('0x38')]);_0x466f7d[_0x5f8f('0x39')]=qs['filters'](_[_0x5f8f('0x3a')](_0x3a53d0[_0x5f8f('0x31')],_0x1d8e6b[_0x5f8f('0x32')]),_0x36cc97);if(_0x3a53d0[_0x5f8f('0x31')][_0x5f8f('0x3b')]){_0x466f7d[_0x5f8f('0x39')]=_['merge'](_0x466f7d[_0x5f8f('0x39')],{'$or':[{'key':{'$like':'%'+_0x3a53d0['query'][_0x5f8f('0x3b')]+'%'}},{'value':{'$like':'%'+_0x3a53d0[_0x5f8f('0x31')]['filter']+'%'}}]});}_0x466f7d=_[_0x5f8f('0x3c')]({},_0x466f7d,_0x3a53d0[_0x5f8f('0x3d')]);var _0xf1f8d={'where':_0x466f7d[_0x5f8f('0x39')]};return db[_0x5f8f('0x2b')]['count'](_0xf1f8d)[_0x5f8f('0x21')](function(_0x3b28d){_0x2a3bc1[_0x5f8f('0x1b')]=_0x3b28d;if(_0x3a53d0[_0x5f8f('0x31')][_0x5f8f('0x3e')]){_0x466f7d[_0x5f8f('0x3f')]=[{'all':!![]}];}return db[_0x5f8f('0x2b')][_0x5f8f('0x40')](_0x466f7d);})[_0x5f8f('0x21')](function(_0x2b4f67){_0x2a3bc1[_0x5f8f('0x41')]=_0x2b4f67;return _0x2a3bc1;})['then'](respondWithFilteredResult(_0x3eccb3,_0x466f7d))[_0x5f8f('0x42')](handleError(_0x3eccb3,null));};exports[_0x5f8f('0x43')]=function(_0x10fc49,_0x182544){var _0x1bd293={'raw':!![],'where':{'id':_0x10fc49['params']['id']}},_0x2928b4={};_0x2928b4['model']=_['keys'](db['CannedAnswer'][_0x5f8f('0x2c')]);_0x2928b4[_0x5f8f('0x31')]=_['keys'](_0x10fc49[_0x5f8f('0x31')]);_0x2928b4[_0x5f8f('0x32')]=_[_0x5f8f('0x33')](_0x2928b4[_0x5f8f('0x2f')],_0x2928b4[_0x5f8f('0x31')]);_0x1bd293[_0x5f8f('0x34')]=_[_0x5f8f('0x33')](_0x2928b4[_0x5f8f('0x2f')],qs[_0x5f8f('0x44')](_0x10fc49[_0x5f8f('0x31')][_0x5f8f('0x44')]));_0x1bd293[_0x5f8f('0x34')]=_0x1bd293[_0x5f8f('0x34')][_0x5f8f('0x35')]?_0x1bd293[_0x5f8f('0x34')]:_0x2928b4[_0x5f8f('0x2f')];if(_0x10fc49['query']['includeAll']){_0x1bd293[_0x5f8f('0x3f')]=[{'all':!![]}];}_0x1bd293=_[_0x5f8f('0x3c')]({},_0x1bd293,_0x10fc49['options']);return db[_0x5f8f('0x2b')][_0x5f8f('0x45')](_0x1bd293)[_0x5f8f('0x21')](handleEntityNotFound(_0x182544,null))['then'](respondWithResult(_0x182544,null))[_0x5f8f('0x42')](handleError(_0x182544,null));};exports[_0x5f8f('0x20')]=function(_0x50284d,_0x46ac81){if(_0x50284d[_0x5f8f('0x46')]['id']){delete _0x50284d[_0x5f8f('0x46')]['id'];}return db[_0x5f8f('0x2b')][_0x5f8f('0x45')]({'where':{'id':_0x50284d[_0x5f8f('0x47')]['id']}})[_0x5f8f('0x21')](handleEntityNotFound(_0x46ac81,null))[_0x5f8f('0x21')](saveUpdates(_0x50284d[_0x5f8f('0x46')],null))[_0x5f8f('0x21')](respondWithResult(_0x46ac81,null))[_0x5f8f('0x42')](handleError(_0x46ac81,null));};exports[_0x5f8f('0x22')]=function(_0x359be2,_0x565c39){return db[_0x5f8f('0x2b')]['find']({'where':{'id':_0x359be2[_0x5f8f('0x47')]['id']}})[_0x5f8f('0x21')](handleEntityNotFound(_0x565c39,null))[_0x5f8f('0x21')](removeEntity(_0x565c39,null))[_0x5f8f('0x42')](handleError(_0x565c39,null));};exports[_0x5f8f('0x48')]=function(_0x3d96ea,_0xf62985){var _0x45eb38={'key':_0x3d96ea[_0x5f8f('0x46')][_0x5f8f('0x2e')]};if(_0x3d96ea[_0x5f8f('0x46')]['MailAccountId']){_0x45eb38[_0x5f8f('0x49')]=_0x3d96ea[_0x5f8f('0x46')][_0x5f8f('0x49')];}else if(_0x3d96ea['body'][_0x5f8f('0x4a')]){_0x45eb38[_0x5f8f('0x4a')]=_0x3d96ea[_0x5f8f('0x46')][_0x5f8f('0x4a')];}else if(_0x3d96ea['body']['OpenchannelAccountId']){_0x45eb38[_0x5f8f('0x4b')]=_0x3d96ea[_0x5f8f('0x46')]['OpenchannelAccountId'];}else if(_0x3d96ea[_0x5f8f('0x46')][_0x5f8f('0x4c')]){_0x45eb38['ChatWebsiteId']=_0x3d96ea[_0x5f8f('0x46')][_0x5f8f('0x4c')];}return db['CannedAnswer'][_0x5f8f('0x45')]({'where':_0x45eb38})[_0x5f8f('0x21')](function(_0xe11904){if(_0xe11904){throw new db['Sequelize'][(_0x5f8f('0x4d'))](_0x5f8f('0x4e'));}return db[_0x5f8f('0x2b')]['create'](_0x3d96ea[_0x5f8f('0x46')]);})[_0x5f8f('0x21')](function(_0x2a70fc){var _0xcc2b0a=_0x3d96ea[_0x5f8f('0x4f')]['get']({'plain':!![]});if(!_0xcc2b0a)throw new Error(_0x5f8f('0x50'));if(_0xcc2b0a['role']===_0x5f8f('0x4f')){var _0x5cc561=_0x2a70fc[_0x5f8f('0x23')]({'plain':!![]});return db[_0x5f8f('0x51')][_0x5f8f('0x45')]({'where':{'name':_0x5f8f('0x52'),'userProfileId':_0xcc2b0a[_0x5f8f('0x53')]},'raw':!![]})[_0x5f8f('0x21')](function(_0x1a91db){if(_0x1a91db&&_0x1a91db[_0x5f8f('0x54')]===0x0){return db[_0x5f8f('0x24')][_0x5f8f('0x48')]({'name':_0x5cc561[_0x5f8f('0x28')],'resourceId':_0x5cc561['id'],'type':_0x1a91db[_0x5f8f('0x28')],'sectionId':_0x1a91db['id']},{})['then'](function(){return _0x2a70fc;});}else{return _0x2a70fc;}})[_0x5f8f('0x42')](function(_0x58230c){logger[_0x5f8f('0x26')](_0x5f8f('0x55'),_0x58230c);throw _0x58230c;});}return _0x2a70fc;})[_0x5f8f('0x21')](respondWithResult(_0xf62985,0xc9))['catch'](handleError(_0xf62985,null));}; \ No newline at end of file +var _0x0bc9=['where','pick','filter','merge','options','show','params','rawAttributes','keys','includeAll','include','find','catch','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','CannedAnswers','UserProfileResource','destroy','error','stack','name','index','map','CannedAnswer','type','key','model','query','filters','intersection','fields','attributes','length','sort'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0bc9,0x71));var _0x90bc=function(_0x46a0cf,_0x4493d3){_0x46a0cf=_0x46a0cf-0x0;var _0x2e7c80=_0x0bc9[_0x46a0cf];return _0x2e7c80;};'use strict';var emlformat=require(_0x90bc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x90bc('0x1'));var jsonpatch=require(_0x90bc('0x2'));var rp=require(_0x90bc('0x3'));var moment=require(_0x90bc('0x4'));var BPromise=require(_0x90bc('0x5'));var Mustache=require(_0x90bc('0x6'));var util=require(_0x90bc('0x7'));var path=require(_0x90bc('0x8'));var sox=require('sox');var csv=require(_0x90bc('0x9'));var ejs=require(_0x90bc('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x90bc('0xb'));var crypto=require('crypto');var jsforce=require(_0x90bc('0xc'));var deskjs=require(_0x90bc('0xd'));var toCsv=require(_0x90bc('0x9'));var querystring=require('querystring');var Papa=require(_0x90bc('0xe'));var Redis=require(_0x90bc('0xf'));var authService=require(_0x90bc('0x10'));var qs=require(_0x90bc('0x11'));var as=require(_0x90bc('0x12'));var hardwareService=require(_0x90bc('0x13'));var logger=require(_0x90bc('0x14'))(_0x90bc('0x15'));var utils=require(_0x90bc('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x90bc('0x17'));var db=require(_0x90bc('0x18'))['db'];function respondWithStatusCode(_0x585913,_0x1941ec){_0x1941ec=_0x1941ec||0xcc;return function(_0x2c7563){if(_0x2c7563){return _0x585913[_0x90bc('0x19')](_0x1941ec);}return _0x585913[_0x90bc('0x1a')](_0x1941ec)[_0x90bc('0x1b')]();};}function respondWithResult(_0x2e88e3,_0x5d6200){_0x5d6200=_0x5d6200||0xc8;return function(_0xaec95f){if(_0xaec95f){return _0x2e88e3[_0x90bc('0x1a')](_0x5d6200)[_0x90bc('0x1c')](_0xaec95f);}};}function respondWithFilteredResult(_0x24d50f,_0x17d7d8){return function(_0x285a7a){if(_0x285a7a){var _0x227570=typeof _0x17d7d8['offset']===_0x90bc('0x1d')&&typeof _0x17d7d8[_0x90bc('0x1e')]===_0x90bc('0x1d');var _0x564f56=_0x285a7a[_0x90bc('0x1f')];var _0x59940c=_0x227570?0x0:_0x17d7d8[_0x90bc('0x20')];var _0x1733a3=_0x227570?_0x285a7a[_0x90bc('0x1f')]:_0x17d7d8[_0x90bc('0x20')]+_0x17d7d8[_0x90bc('0x1e')];var _0x12b00b;if(_0x1733a3>=_0x564f56){_0x1733a3=_0x564f56;_0x12b00b=0xc8;}else{_0x12b00b=0xce;}_0x24d50f[_0x90bc('0x1a')](_0x12b00b);return _0x24d50f[_0x90bc('0x21')](_0x90bc('0x22'),_0x59940c+'-'+_0x1733a3+'/'+_0x564f56)['json'](_0x285a7a);}return null;};}function patchUpdates(_0x3c2b36){return function(_0x57627d){try{jsonpatch[_0x90bc('0x23')](_0x57627d,_0x3c2b36,!![]);}catch(_0xfb8105){return BPromise[_0x90bc('0x24')](_0xfb8105);}return _0x57627d[_0x90bc('0x25')]();};}function saveUpdates(_0xa1bdad,_0x243250){return function(_0xcf9904){if(_0xcf9904){return _0xcf9904[_0x90bc('0x26')](_0xa1bdad)[_0x90bc('0x27')](function(_0x1416c3){return _0x1416c3;});}return null;};}function removeEntity(_0x4bf38a,_0x36f740){return function(_0x497a18){if(_0x497a18){return _0x497a18['destroy']()[_0x90bc('0x27')](function(){var _0x573979=_0x497a18['get']({'plain':!![]});var _0x52ae72=_0x90bc('0x28');return db[_0x90bc('0x29')][_0x90bc('0x2a')]({'where':{'type':_0x52ae72,'resourceId':_0x573979['id']}})[_0x90bc('0x27')](function(){return _0x497a18;});})[_0x90bc('0x27')](function(){_0x4bf38a[_0x90bc('0x1a')](0xcc)[_0x90bc('0x1b')]();});}};}function handleEntityNotFound(_0x53ac3e,_0x5e5dac){return function(_0x4090c5){if(!_0x4090c5){_0x53ac3e['sendStatus'](0x194);}return _0x4090c5;};}function handleError(_0x20bc42,_0x906008){_0x906008=_0x906008||0x1f4;return function(_0x2a846d){logger[_0x90bc('0x2b')](_0x2a846d[_0x90bc('0x2c')]);if(_0x2a846d['name']){delete _0x2a846d[_0x90bc('0x2d')];}_0x20bc42[_0x90bc('0x1a')](_0x906008)['send'](_0x2a846d);};}exports[_0x90bc('0x2e')]=function(_0x5c8f4d,_0x1e21cf){var _0x21ec7d={},_0x439e7c={},_0x2525c9={'count':0x0,'rows':[]};var _0x191e82=_[_0x90bc('0x2f')](db[_0x90bc('0x30')]['rawAttributes'],function(_0x148fb8){return{'name':_0x148fb8['fieldName'],'type':_0x148fb8[_0x90bc('0x31')][_0x90bc('0x32')]};});_0x439e7c[_0x90bc('0x33')]=_[_0x90bc('0x2f')](_0x191e82,_0x90bc('0x2d'));_0x439e7c[_0x90bc('0x34')]=_['keys'](_0x5c8f4d['query']);_0x439e7c[_0x90bc('0x35')]=_['intersection'](_0x439e7c[_0x90bc('0x33')],_0x439e7c[_0x90bc('0x34')]);_0x21ec7d['attributes']=_[_0x90bc('0x36')](_0x439e7c[_0x90bc('0x33')],qs[_0x90bc('0x37')](_0x5c8f4d[_0x90bc('0x34')]['fields']));_0x21ec7d[_0x90bc('0x38')]=_0x21ec7d[_0x90bc('0x38')][_0x90bc('0x39')]?_0x21ec7d['attributes']:_0x439e7c['model'];if(!_0x5c8f4d[_0x90bc('0x34')]['hasOwnProperty']('nolimit')){_0x21ec7d['limit']=qs[_0x90bc('0x1e')](_0x5c8f4d[_0x90bc('0x34')][_0x90bc('0x1e')]);_0x21ec7d[_0x90bc('0x20')]=qs[_0x90bc('0x20')](_0x5c8f4d[_0x90bc('0x34')]['offset']);}_0x21ec7d['order']=qs['sort'](_0x5c8f4d[_0x90bc('0x34')][_0x90bc('0x3a')]);_0x21ec7d[_0x90bc('0x3b')]=qs[_0x90bc('0x35')](_[_0x90bc('0x3c')](_0x5c8f4d[_0x90bc('0x34')],_0x439e7c[_0x90bc('0x35')]),_0x191e82);if(_0x5c8f4d[_0x90bc('0x34')][_0x90bc('0x3d')]){_0x21ec7d[_0x90bc('0x3b')]=_[_0x90bc('0x3e')](_0x21ec7d[_0x90bc('0x3b')],{'$or':[{'key':{'$like':'%'+_0x5c8f4d[_0x90bc('0x34')][_0x90bc('0x3d')]+'%'}},{'value':{'$like':'%'+_0x5c8f4d[_0x90bc('0x34')]['filter']+'%'}}]});}_0x21ec7d=_[_0x90bc('0x3e')]({},_0x21ec7d,_0x5c8f4d[_0x90bc('0x3f')]);var _0x4ab8e5={'where':_0x21ec7d[_0x90bc('0x3b')]};return db[_0x90bc('0x30')]['count'](_0x4ab8e5)[_0x90bc('0x27')](function(_0x3b100f){_0x2525c9[_0x90bc('0x1f')]=_0x3b100f;if(_0x5c8f4d[_0x90bc('0x34')]['includeAll']){_0x21ec7d['include']=[{'all':!![]}];}return db[_0x90bc('0x30')]['findAll'](_0x21ec7d);})[_0x90bc('0x27')](function(_0x37fd82){_0x2525c9['rows']=_0x37fd82;return _0x2525c9;})[_0x90bc('0x27')](respondWithFilteredResult(_0x1e21cf,_0x21ec7d))['catch'](handleError(_0x1e21cf,null));};exports[_0x90bc('0x40')]=function(_0x17052c,_0x5e4610){var _0x4566e6={'raw':!![],'where':{'id':_0x17052c[_0x90bc('0x41')]['id']}},_0x2d5390={};_0x2d5390[_0x90bc('0x33')]=_['keys'](db[_0x90bc('0x30')][_0x90bc('0x42')]);_0x2d5390[_0x90bc('0x34')]=_[_0x90bc('0x43')](_0x17052c[_0x90bc('0x34')]);_0x2d5390[_0x90bc('0x35')]=_[_0x90bc('0x36')](_0x2d5390[_0x90bc('0x33')],_0x2d5390[_0x90bc('0x34')]);_0x4566e6[_0x90bc('0x38')]=_[_0x90bc('0x36')](_0x2d5390['model'],qs[_0x90bc('0x37')](_0x17052c[_0x90bc('0x34')]['fields']));_0x4566e6[_0x90bc('0x38')]=_0x4566e6['attributes'][_0x90bc('0x39')]?_0x4566e6[_0x90bc('0x38')]:_0x2d5390[_0x90bc('0x33')];if(_0x17052c['query'][_0x90bc('0x44')]){_0x4566e6[_0x90bc('0x45')]=[{'all':!![]}];}_0x4566e6=_[_0x90bc('0x3e')]({},_0x4566e6,_0x17052c[_0x90bc('0x3f')]);return db[_0x90bc('0x30')][_0x90bc('0x46')](_0x4566e6)[_0x90bc('0x27')](handleEntityNotFound(_0x5e4610,null))[_0x90bc('0x27')](respondWithResult(_0x5e4610,null))[_0x90bc('0x47')](handleError(_0x5e4610,null));};exports[_0x90bc('0x26')]=function(_0x5d67fc,_0x1c0c2a){if(_0x5d67fc[_0x90bc('0x48')]['id']){delete _0x5d67fc['body']['id'];}return db[_0x90bc('0x30')]['find']({'where':{'id':_0x5d67fc['params']['id']}})[_0x90bc('0x27')](handleEntityNotFound(_0x1c0c2a,null))['then'](saveUpdates(_0x5d67fc[_0x90bc('0x48')],null))[_0x90bc('0x27')](respondWithResult(_0x1c0c2a,null))['catch'](handleError(_0x1c0c2a,null));};exports['destroy']=function(_0x3f6b1e,_0x2f0e07){return db[_0x90bc('0x30')]['find']({'where':{'id':_0x3f6b1e[_0x90bc('0x41')]['id']}})[_0x90bc('0x27')](handleEntityNotFound(_0x2f0e07,null))[_0x90bc('0x27')](removeEntity(_0x2f0e07,null))[_0x90bc('0x47')](handleError(_0x2f0e07,null));};exports['create']=function(_0xee284a,_0x197539){var _0x11687f={'key':_0xee284a[_0x90bc('0x48')][_0x90bc('0x32')]};if(_0xee284a[_0x90bc('0x48')]['MailAccountId']){_0x11687f['MailAccountId']=_0xee284a[_0x90bc('0x48')][_0x90bc('0x49')];}else if(_0xee284a[_0x90bc('0x48')][_0x90bc('0x4a')]){_0x11687f[_0x90bc('0x4a')]=_0xee284a['body'][_0x90bc('0x4a')];}else if(_0xee284a['body'][_0x90bc('0x4b')]){_0x11687f['OpenchannelAccountId']=_0xee284a[_0x90bc('0x48')][_0x90bc('0x4b')];}else if(_0xee284a['body'][_0x90bc('0x4c')]){_0x11687f['ChatWebsiteId']=_0xee284a[_0x90bc('0x48')][_0x90bc('0x4c')];}return db[_0x90bc('0x30')]['find']({'where':_0x11687f})[_0x90bc('0x27')](function(_0x44cab3){if(_0x44cab3){throw new db[(_0x90bc('0x4d'))][(_0x90bc('0x4e'))](_0x90bc('0x4f'));}return db[_0x90bc('0x30')]['create'](_0xee284a[_0x90bc('0x48')]);})[_0x90bc('0x27')](function(_0x4816a4){var _0x32c495=_0xee284a[_0x90bc('0x50')][_0x90bc('0x51')]({'plain':!![]});if(!_0x32c495)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x32c495[_0x90bc('0x52')]===_0x90bc('0x50')){var _0xb9982f=_0x4816a4['get']({'plain':!![]});return db[_0x90bc('0x53')]['find']({'where':{'name':_0x90bc('0x28'),'userProfileId':_0x32c495[_0x90bc('0x54')]},'raw':!![]})['then'](function(_0x56a941){if(_0x56a941&&_0x56a941['autoAssociation']===0x0){return db[_0x90bc('0x29')]['create']({'name':_0xb9982f[_0x90bc('0x2d')],'resourceId':_0xb9982f['id'],'type':_0x56a941[_0x90bc('0x2d')],'sectionId':_0x56a941['id']},{})[_0x90bc('0x27')](function(){return _0x4816a4;});}else{return _0x4816a4;}})[_0x90bc('0x47')](function(_0xae3493){logger['error'](_0x90bc('0x55'),_0xae3493);throw _0xae3493;});}return _0x4816a4;})['then'](respondWithResult(_0x197539,0xc9))[_0x90bc('0x47')](handleError(_0x197539,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 041dd37..f46e27d 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 _0x1bd9=['rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4','lodash','util','api','moment','bluebird','request-promise'];(function(_0x1c9ce8,_0x5f4a9f){var _0x265023=function(_0x52b54d){while(--_0x52b54d){_0x1c9ce8['push'](_0x1c9ce8['shift']());}};_0x265023(++_0x5f4a9f);}(_0x1bd9,0xbd));var _0x91bd=function(_0x4b14fd,_0x538b42){_0x4b14fd=_0x4b14fd-0x0;var _0x1ab6b0=_0x1bd9[_0x4b14fd];return _0x1ab6b0;};'use strict';var _=require(_0x91bd('0x0'));var util=require(_0x91bd('0x1'));var logger=require('../../config/logger')(_0x91bd('0x2'));var moment=require(_0x91bd('0x3'));var BPromise=require(_0x91bd('0x4'));var rp=require(_0x91bd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x91bd('0x6'));var config=require(_0x91bd('0x7'));var attributes=require(_0x91bd('0x8'));module[_0x91bd('0x9')]=function(_0x69bcc9,_0x4a3b70){return _0x69bcc9[_0x91bd('0xa')]('CannedAnswer',attributes,{'tableName':_0x91bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x91bd('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x63cf=['exports','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./cannedAnswer.attributes'];(function(_0x4ea86,_0x9c41f7){var _0x3d9ab0=function(_0x2a9c13){while(--_0x2a9c13){_0x4ea86['push'](_0x4ea86['shift']());}};_0x3d9ab0(++_0x9c41f7);}(_0x63cf,0xc9));var _0xf63c=function(_0x237f8b,_0xc5eddb){_0x237f8b=_0x237f8b-0x0;var _0x423f94=_0x63cf[_0x237f8b];return _0x423f94;};'use strict';var _=require(_0xf63c('0x0'));var util=require(_0xf63c('0x1'));var logger=require(_0xf63c('0x2'))(_0xf63c('0x3'));var moment=require(_0xf63c('0x4'));var BPromise=require(_0xf63c('0x5'));var rp=require(_0xf63c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf63c('0x7'));var config=require('../../config/environment');var attributes=require(_0xf63c('0x8'));module[_0xf63c('0x9')]=function(_0x30da33,_0x2fe800){return _0x30da33[_0xf63c('0xa')]('CannedAnswer',attributes,{'tableName':_0xf63c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf63c('0xc'),'collate':_0xf63c('0xd')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 7a7e219..d37efd1 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(_0x1f74de,_0x495470){var _0x4e8aff=function(_0x382e0c){while(--_0x382e0c){_0x1f74de['push'](_0x1f74de['shift']());}};_0x4e8aff(++_0x495470);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +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(_0x594323,_0xb0be8c){var _0x517ee6=function(_0x364edd){while(--_0x364edd){_0x594323['push'](_0x594323['shift']());}};_0x517ee6(++_0xb0be8c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 f12d724..cea65cd 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 _0xd5b8=['./cannedAnswer.controller','isAuthenticated','index','get','show','post','create','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x47c32b,_0x29d7d4){var _0x3ecff4=function(_0xa47e){while(--_0xa47e){_0x47c32b['push'](_0x47c32b['shift']());}};_0x3ecff4(++_0x29d7d4);}(_0xd5b8,0x171));var _0x8d5b=function(_0xc8a6a4,_0x5c38ff){_0xc8a6a4=_0xc8a6a4-0x0;var _0x3ac6fa=_0xd5b8[_0xc8a6a4];return _0x3ac6fa;};'use strict';var multer=require(_0x8d5b('0x0'));var util=require(_0x8d5b('0x1'));var path=require('path');var timeout=require(_0x8d5b('0x2'));var express=require(_0x8d5b('0x3'));var router=express[_0x8d5b('0x4')]();var fs_extra=require(_0x8d5b('0x5'));var auth=require(_0x8d5b('0x6'));var interaction=require(_0x8d5b('0x7'));var config=require(_0x8d5b('0x8'));var controller=require(_0x8d5b('0x9'));router['get']('/',auth[_0x8d5b('0xa')](),controller[_0x8d5b('0xb')]);router[_0x8d5b('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x8d5b('0xd')]);router[_0x8d5b('0xe')]('/',auth[_0x8d5b('0xa')](),controller[_0x8d5b('0xf')]);router[_0x8d5b('0x10')](_0x8d5b('0x11'),auth[_0x8d5b('0xa')](),controller['update']);router[_0x8d5b('0x12')](_0x8d5b('0x11'),auth[_0x8d5b('0xa')](),controller[_0x8d5b('0x13')]);module[_0x8d5b('0x14')]=router; \ No newline at end of file +var _0x5d2a=['express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','update','delete','exports','util','path','connect-timeout'];(function(_0x428c3b,_0x54b081){var _0x424c6f=function(_0x20accc){while(--_0x20accc){_0x428c3b['push'](_0x428c3b['shift']());}};_0x424c6f(++_0x54b081);}(_0x5d2a,0xcd));var _0xa5d2=function(_0x761c1b,_0x3b5c90){_0x761c1b=_0x761c1b-0x0;var _0x1f7529=_0x5d2a[_0x761c1b];return _0x1f7529;};'use strict';var multer=require('multer');var util=require(_0xa5d2('0x0'));var path=require(_0xa5d2('0x1'));var timeout=require(_0xa5d2('0x2'));var express=require(_0xa5d2('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa5d2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa5d2('0x5'));var controller=require('./cannedAnswer.controller');router[_0xa5d2('0x6')]('/',auth[_0xa5d2('0x7')](),controller[_0xa5d2('0x8')]);router[_0xa5d2('0x6')](_0xa5d2('0x9'),auth[_0xa5d2('0x7')](),controller[_0xa5d2('0xa')]);router['post']('/',auth[_0xa5d2('0x7')](),controller[_0xa5d2('0xb')]);router[_0xa5d2('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xa5d2('0xd')]);router[_0xa5d2('0xe')](_0xa5d2('0x9'),auth[_0xa5d2('0x7')](),controller['destroy']);module[_0xa5d2('0xf')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index c1d962d..9d5d5c7 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 _0x6de9=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x36ad2a,_0x44a246){var _0x4c1f5d=function(_0x1b0fa1){while(--_0x1b0fa1){_0x36ad2a['push'](_0x36ad2a['shift']());}};_0x4c1f5d(++_0x44a246);}(_0x6de9,0xe6));var _0x96de=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x6de9[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x96de('0x0'));module[_0x96de('0x1')]={'calldate':{'type':Sequelize[_0x96de('0x2')],'allowNull':![],'defaultValue':_0x96de('0x3')},'clid':{'type':Sequelize[_0x96de('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x96de('0x4')]},'dcontext':{'type':Sequelize[_0x96de('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x96de('0x4')]},'lastapp':{'type':Sequelize[_0x96de('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x96de('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x96de('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x96de('0x4')]},'amaflags':{'type':Sequelize[_0x96de('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x96de('0x4')]},'uniqueid':{'type':Sequelize[_0x96de('0x4')]},'linkedid':{'type':Sequelize[_0x96de('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x96de('0x4')]},'type':{'type':Sequelize[_0x96de('0x4')]},'tag':{'type':Sequelize[_0x96de('0x4')]}}; \ No newline at end of file +var _0xc743=['exports','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x313b82,_0x43290f){var _0x2f8aa3=function(_0x5e3a41){while(--_0x5e3a41){_0x313b82['push'](_0x313b82['shift']());}};_0x2f8aa3(++_0x43290f);}(_0xc743,0x15c));var _0x3c74=function(_0x4d4475,_0x4f99dd){_0x4d4475=_0x4d4475-0x0;var _0x5a41c6=_0xc743[_0x4d4475];return _0x5a41c6;};'use strict';var Sequelize=require('sequelize');module[_0x3c74('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x3c74('0x1')},'clid':{'type':Sequelize[_0x3c74('0x2')]},'src':{'type':Sequelize[_0x3c74('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x3c74('0x2')]},'dstchannel':{'type':Sequelize[_0x3c74('0x2')]},'lastapp':{'type':Sequelize[_0x3c74('0x2')]},'lastdata':{'type':Sequelize[_0x3c74('0x2')]},'duration':{'type':Sequelize[_0x3c74('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x3c74('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x3c74('0x2')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x3c74('0x2')]},'userfield':{'type':Sequelize[_0x3c74('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x3c74('0x2')]},'sequence':{'type':Sequelize[_0x3c74('0x2')]},'peeraccount':{'type':Sequelize[_0x3c74('0x2')]},'type':{'type':Sequelize['STRING']},'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 df85310..11ac122 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 _0x2675=['limit','count','Content-Range','json','apply','reject','destroy','then','error','name','send','index','map','Cdr','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','rawAttributes','length','options','find','create','body','update','params','describe','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x9a74cf,_0x2ef298){var _0xa99efc=function(_0x1d66cb){while(--_0x1d66cb){_0x9a74cf['push'](_0x9a74cf['shift']());}};_0xa99efc(++_0x2ef298);}(_0x2675,0x75));var _0x5267=function(_0xd227da,_0x578344){_0xd227da=_0xd227da-0x0;var _0x3c8eb4=_0x2675[_0xd227da];return _0x3c8eb4;};'use strict';var emlformat=require(_0x5267('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5267('0x3'));var util=require(_0x5267('0x4'));var path=require('path');var sox=require(_0x5267('0x5'));var csv=require(_0x5267('0x6'));var ejs=require(_0x5267('0x7'));var fs=require('fs');var fs_extra=require(_0x5267('0x8'));var _=require(_0x5267('0x9'));var squel=require(_0x5267('0xa'));var crypto=require('crypto');var jsforce=require(_0x5267('0xb'));var deskjs=require(_0x5267('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5267('0xd'));var Papa=require('papaparse');var Redis=require(_0x5267('0xe'));var authService=require(_0x5267('0xf'));var qs=require(_0x5267('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5267('0x11'));var logger=require('../../config/logger')(_0x5267('0x12'));var utils=require('../../config/utils');var config=require(_0x5267('0x13'));var licenseUtil=require(_0x5267('0x14'));var db=require(_0x5267('0x15'))['db'];function respondWithStatusCode(_0x1f9be3,_0x1d7090){_0x1d7090=_0x1d7090||0xcc;return function(_0x1171b9){if(_0x1171b9){return _0x1f9be3[_0x5267('0x16')](_0x1d7090);}return _0x1f9be3[_0x5267('0x17')](_0x1d7090)[_0x5267('0x18')]();};}function respondWithResult(_0x1e2d3b,_0x16e5a7){_0x16e5a7=_0x16e5a7||0xc8;return function(_0x29349a){if(_0x29349a){return _0x1e2d3b[_0x5267('0x17')](_0x16e5a7)['json'](_0x29349a);}};}function respondWithFilteredResult(_0x52e24e,_0xa593fb){return function(_0x40d897){if(_0x40d897){var _0x38a147=typeof _0xa593fb[_0x5267('0x19')]===_0x5267('0x1a')&&typeof _0xa593fb[_0x5267('0x1b')]===_0x5267('0x1a');var _0x6831e0=_0x40d897[_0x5267('0x1c')];var _0xb1c97a=_0x38a147?0x0:_0xa593fb[_0x5267('0x19')];var _0x1ab03=_0x38a147?_0x40d897['count']:_0xa593fb[_0x5267('0x19')]+_0xa593fb[_0x5267('0x1b')];var _0x5069e8;if(_0x1ab03>=_0x6831e0){_0x1ab03=_0x6831e0;_0x5069e8=0xc8;}else{_0x5069e8=0xce;}_0x52e24e[_0x5267('0x17')](_0x5069e8);return _0x52e24e['set'](_0x5267('0x1d'),_0xb1c97a+'-'+_0x1ab03+'/'+_0x6831e0)[_0x5267('0x1e')](_0x40d897);}return null;};}function patchUpdates(_0x39c0c3){return function(_0x2a9f99){try{jsonpatch[_0x5267('0x1f')](_0x2a9f99,_0x39c0c3,!![]);}catch(_0x4dd637){return BPromise[_0x5267('0x20')](_0x4dd637);}return _0x2a9f99['save']();};}function saveUpdates(_0xa32663,_0x420fb8){return function(_0x3b53ac){if(_0x3b53ac){return _0x3b53ac['update'](_0xa32663)['then'](function(_0x5546e2){return _0x5546e2;});}return null;};}function removeEntity(_0x4a17c7,_0x5ea6a6){return function(_0x26c7f8){if(_0x26c7f8){return _0x26c7f8[_0x5267('0x21')]()[_0x5267('0x22')](function(){_0x4a17c7[_0x5267('0x17')](0xcc)[_0x5267('0x18')]();});}};}function handleEntityNotFound(_0x40d1be,_0x126a97){return function(_0x220e03){if(!_0x220e03){_0x40d1be[_0x5267('0x16')](0x194);}return _0x220e03;};}function handleError(_0x59f112,_0x5cb64f){_0x5cb64f=_0x5cb64f||0x1f4;return function(_0x354111){logger[_0x5267('0x23')](_0x354111['stack']);if(_0x354111[_0x5267('0x24')]){delete _0x354111['name'];}_0x59f112['status'](_0x5cb64f)[_0x5267('0x25')](_0x354111);};}exports[_0x5267('0x26')]=function(_0x1f33b7,_0x2d2ace){var _0x33c431={},_0x4f3d4d={},_0x5e87eb={'count':0x0,'rows':[]};var _0x18020c=_[_0x5267('0x27')](db[_0x5267('0x28')]['rawAttributes'],function(_0x58d685){return{'name':_0x58d685[_0x5267('0x29')],'type':_0x58d685[_0x5267('0x2a')][_0x5267('0x2b')]};});_0x4f3d4d['model']=_['map'](_0x18020c,_0x5267('0x24'));_0x4f3d4d[_0x5267('0x2c')]=_[_0x5267('0x2d')](_0x1f33b7[_0x5267('0x2c')]);_0x4f3d4d['filters']=_[_0x5267('0x2e')](_0x4f3d4d[_0x5267('0x2f')],_0x4f3d4d[_0x5267('0x2c')]);_0x33c431[_0x5267('0x30')]=_[_0x5267('0x2e')](_0x4f3d4d[_0x5267('0x2f')],qs[_0x5267('0x31')](_0x1f33b7[_0x5267('0x2c')]['fields']));_0x33c431['attributes']=_0x33c431[_0x5267('0x30')]['length']?_0x33c431[_0x5267('0x30')]:_0x4f3d4d[_0x5267('0x2f')];if(!_0x1f33b7[_0x5267('0x2c')][_0x5267('0x32')]('nolimit')){_0x33c431[_0x5267('0x1b')]=qs[_0x5267('0x1b')](_0x1f33b7[_0x5267('0x2c')][_0x5267('0x1b')]);_0x33c431[_0x5267('0x19')]=qs[_0x5267('0x19')](_0x1f33b7[_0x5267('0x2c')][_0x5267('0x19')]);}_0x33c431['order']=qs[_0x5267('0x33')](_0x1f33b7['query'][_0x5267('0x33')]);_0x33c431[_0x5267('0x34')]=qs[_0x5267('0x35')](_[_0x5267('0x36')](_0x1f33b7[_0x5267('0x2c')],_0x4f3d4d[_0x5267('0x35')]),_0x18020c);if(_0x1f33b7[_0x5267('0x2c')]['filter']){_0x33c431[_0x5267('0x34')]=_[_0x5267('0x37')](_0x33c431[_0x5267('0x34')],{'$or':_[_0x5267('0x27')](_0x18020c,function(_0x82cea7){if(_0x82cea7[_0x5267('0x2a')]!==_0x5267('0x38')){var _0x487dfc={};_0x487dfc[_0x82cea7[_0x5267('0x24')]]={'$like':'%'+_0x1f33b7['query'][_0x5267('0x39')]+'%'};return _0x487dfc;}})});}_0x33c431=_['merge']({},_0x33c431,_0x1f33b7['options']);var _0x51bddd={'where':_0x33c431[_0x5267('0x34')]};return db['Cdr'][_0x5267('0x1c')](_0x51bddd)[_0x5267('0x22')](function(_0x3d4b19){_0x5e87eb[_0x5267('0x1c')]=_0x3d4b19;if(_0x1f33b7['query'][_0x5267('0x3a')]){_0x33c431[_0x5267('0x3b')]=[{'all':!![]}];}return db['Cdr']['findAll'](_0x33c431);})[_0x5267('0x22')](function(_0x560cdf){_0x5e87eb[_0x5267('0x3c')]=_0x560cdf;return _0x5e87eb;})[_0x5267('0x22')](respondWithFilteredResult(_0x2d2ace,_0x33c431))[_0x5267('0x3d')](handleError(_0x2d2ace,null));};exports[_0x5267('0x3e')]=function(_0x36d0f1,_0x3012cb){var _0x27add5={'raw':!![],'where':{'id':_0x36d0f1['params']['id']}},_0x5697b3={};_0x5697b3[_0x5267('0x2f')]=_['keys'](db[_0x5267('0x28')][_0x5267('0x3f')]);_0x5697b3['query']=_[_0x5267('0x2d')](_0x36d0f1[_0x5267('0x2c')]);_0x5697b3[_0x5267('0x35')]=_[_0x5267('0x2e')](_0x5697b3[_0x5267('0x2f')],_0x5697b3[_0x5267('0x2c')]);_0x27add5[_0x5267('0x30')]=_[_0x5267('0x2e')](_0x5697b3[_0x5267('0x2f')],qs['fields'](_0x36d0f1[_0x5267('0x2c')][_0x5267('0x31')]));_0x27add5[_0x5267('0x30')]=_0x27add5[_0x5267('0x30')][_0x5267('0x40')]?_0x27add5['attributes']:_0x5697b3[_0x5267('0x2f')];if(_0x36d0f1['query'][_0x5267('0x3a')]){_0x27add5['include']=[{'all':!![]}];}_0x27add5=_['merge']({},_0x27add5,_0x36d0f1[_0x5267('0x41')]);return db['Cdr'][_0x5267('0x42')](_0x27add5)[_0x5267('0x22')](handleEntityNotFound(_0x3012cb,null))[_0x5267('0x22')](respondWithResult(_0x3012cb,null))[_0x5267('0x3d')](handleError(_0x3012cb,null));};exports['create']=function(_0x12d6a8,_0x4ee826){return db['Cdr'][_0x5267('0x43')](_0x12d6a8[_0x5267('0x44')],{})['then'](respondWithResult(_0x4ee826,0xc9))['catch'](handleError(_0x4ee826,null));};exports[_0x5267('0x45')]=function(_0xe0439e,_0x3d2436){if(_0xe0439e[_0x5267('0x44')]['id']){delete _0xe0439e[_0x5267('0x44')]['id'];}return db[_0x5267('0x28')][_0x5267('0x42')]({'where':{'id':_0xe0439e[_0x5267('0x46')]['id']}})[_0x5267('0x22')](handleEntityNotFound(_0x3d2436,null))[_0x5267('0x22')](saveUpdates(_0xe0439e[_0x5267('0x44')],null))[_0x5267('0x22')](respondWithResult(_0x3d2436,null))[_0x5267('0x3d')](handleError(_0x3d2436,null));};exports[_0x5267('0x21')]=function(_0x4f7f75,_0x8636d0){return db[_0x5267('0x28')][_0x5267('0x42')]({'where':{'id':_0x4f7f75['params']['id']}})[_0x5267('0x22')](handleEntityNotFound(_0x8636d0,null))[_0x5267('0x22')](removeEntity(_0x8636d0,null))[_0x5267('0x3d')](handleError(_0x8636d0,null));};exports[_0x5267('0x47')]=function(_0x119546,_0x1457cf){return db['Cdr'][_0x5267('0x47')]()['then'](respondWithResult(_0x1457cf,null))[_0x5267('0x3d')](handleError(_0x1457cf,null));}; \ No newline at end of file +var _0xef17=['key','map','intersection','model','attributes','fields','length','query','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','count','include','findAll','rows','catch','show','keys','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','sendStatus','status','end','offset','json','apply','reject','save','then','destroy','error','stack','name','send','index','Cdr','rawAttributes','fieldName'];(function(_0x1d602d,_0x36d9a6){var _0x59a466=function(_0x34eded){while(--_0x34eded){_0x1d602d['push'](_0x1d602d['shift']());}};_0x59a466(++_0x36d9a6);}(_0xef17,0x136));var _0x7ef1=function(_0x46f1d3,_0x27b738){_0x46f1d3=_0x46f1d3-0x0;var _0x4885c3=_0xef17[_0x46f1d3];return _0x4885c3;};'use strict';var emlformat=require(_0x7ef1('0x0'));var rimraf=require(_0x7ef1('0x1'));var zipdir=require(_0x7ef1('0x2'));var jsonpatch=require(_0x7ef1('0x3'));var rp=require(_0x7ef1('0x4'));var moment=require(_0x7ef1('0x5'));var BPromise=require(_0x7ef1('0x6'));var Mustache=require(_0x7ef1('0x7'));var util=require(_0x7ef1('0x8'));var path=require('path');var sox=require(_0x7ef1('0x9'));var csv=require('to-csv');var ejs=require(_0x7ef1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7ef1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7ef1('0xc'));var deskjs=require(_0x7ef1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7ef1('0xe'));var Papa=require(_0x7ef1('0xf'));var Redis=require(_0x7ef1('0x10'));var authService=require(_0x7ef1('0x11'));var qs=require(_0x7ef1('0x12'));var as=require(_0x7ef1('0x13'));var hardwareService=require(_0x7ef1('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x7ef1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x122c8a,_0x51e226){_0x51e226=_0x51e226||0xcc;return function(_0x36ddf9){if(_0x36ddf9){return _0x122c8a[_0x7ef1('0x16')](_0x51e226);}return _0x122c8a[_0x7ef1('0x17')](_0x51e226)[_0x7ef1('0x18')]();};}function respondWithResult(_0x39ea9c,_0x317125){_0x317125=_0x317125||0xc8;return function(_0x26e9fb){if(_0x26e9fb){return _0x39ea9c[_0x7ef1('0x17')](_0x317125)['json'](_0x26e9fb);}};}function respondWithFilteredResult(_0x4de80f,_0x267f0e){return function(_0x5d0499){if(_0x5d0499){var _0x20b843=typeof _0x267f0e[_0x7ef1('0x19')]==='undefined'&&typeof _0x267f0e['limit']==='undefined';var _0x300645=_0x5d0499['count'];var _0x3a5835=_0x20b843?0x0:_0x267f0e['offset'];var _0x5a7b2b=_0x20b843?_0x5d0499['count']:_0x267f0e[_0x7ef1('0x19')]+_0x267f0e['limit'];var _0x38c5a7;if(_0x5a7b2b>=_0x300645){_0x5a7b2b=_0x300645;_0x38c5a7=0xc8;}else{_0x38c5a7=0xce;}_0x4de80f[_0x7ef1('0x17')](_0x38c5a7);return _0x4de80f['set']('Content-Range',_0x3a5835+'-'+_0x5a7b2b+'/'+_0x300645)[_0x7ef1('0x1a')](_0x5d0499);}return null;};}function patchUpdates(_0x5490b9){return function(_0x458459){try{jsonpatch[_0x7ef1('0x1b')](_0x458459,_0x5490b9,!![]);}catch(_0x2f8164){return BPromise[_0x7ef1('0x1c')](_0x2f8164);}return _0x458459[_0x7ef1('0x1d')]();};}function saveUpdates(_0xf24942,_0x20887b){return function(_0xd71594){if(_0xd71594){return _0xd71594['update'](_0xf24942)[_0x7ef1('0x1e')](function(_0x3b118f){return _0x3b118f;});}return null;};}function removeEntity(_0x3f26fb,_0x3324d4){return function(_0x31b5bf){if(_0x31b5bf){return _0x31b5bf[_0x7ef1('0x1f')]()[_0x7ef1('0x1e')](function(){_0x3f26fb[_0x7ef1('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b1ace,_0x33e008){return function(_0x12ef5a){if(!_0x12ef5a){_0x4b1ace[_0x7ef1('0x16')](0x194);}return _0x12ef5a;};}function handleError(_0xcfce5e,_0x19c2c2){_0x19c2c2=_0x19c2c2||0x1f4;return function(_0x4cfa16){logger[_0x7ef1('0x20')](_0x4cfa16[_0x7ef1('0x21')]);if(_0x4cfa16[_0x7ef1('0x22')]){delete _0x4cfa16[_0x7ef1('0x22')];}_0xcfce5e[_0x7ef1('0x17')](_0x19c2c2)[_0x7ef1('0x23')](_0x4cfa16);};}exports[_0x7ef1('0x24')]=function(_0x58e7ee,_0x2e8f1b){var _0x4b0380={},_0x3306b0={},_0x2546bf={'count':0x0,'rows':[]};var _0x4b5fde=_['map'](db[_0x7ef1('0x25')][_0x7ef1('0x26')],function(_0x5ab3a5){return{'name':_0x5ab3a5[_0x7ef1('0x27')],'type':_0x5ab3a5['type'][_0x7ef1('0x28')]};});_0x3306b0['model']=_[_0x7ef1('0x29')](_0x4b5fde,_0x7ef1('0x22'));_0x3306b0['query']=_['keys'](_0x58e7ee['query']);_0x3306b0['filters']=_[_0x7ef1('0x2a')](_0x3306b0[_0x7ef1('0x2b')],_0x3306b0['query']);_0x4b0380[_0x7ef1('0x2c')]=_['intersection'](_0x3306b0['model'],qs[_0x7ef1('0x2d')](_0x58e7ee['query'][_0x7ef1('0x2d')]));_0x4b0380[_0x7ef1('0x2c')]=_0x4b0380[_0x7ef1('0x2c')][_0x7ef1('0x2e')]?_0x4b0380['attributes']:_0x3306b0[_0x7ef1('0x2b')];if(!_0x58e7ee[_0x7ef1('0x2f')]['hasOwnProperty']('nolimit')){_0x4b0380['limit']=qs['limit'](_0x58e7ee[_0x7ef1('0x2f')]['limit']);_0x4b0380[_0x7ef1('0x19')]=qs[_0x7ef1('0x19')](_0x58e7ee[_0x7ef1('0x2f')][_0x7ef1('0x19')]);}_0x4b0380[_0x7ef1('0x30')]=qs[_0x7ef1('0x31')](_0x58e7ee[_0x7ef1('0x2f')][_0x7ef1('0x31')]);_0x4b0380[_0x7ef1('0x32')]=qs[_0x7ef1('0x33')](_[_0x7ef1('0x34')](_0x58e7ee['query'],_0x3306b0[_0x7ef1('0x33')]),_0x4b5fde);if(_0x58e7ee[_0x7ef1('0x2f')]['filter']){_0x4b0380[_0x7ef1('0x32')]=_[_0x7ef1('0x35')](_0x4b0380[_0x7ef1('0x32')],{'$or':_[_0x7ef1('0x29')](_0x4b5fde,function(_0x8ef5b3){if(_0x8ef5b3['type']!==_0x7ef1('0x36')){var _0x1ccbfb={};_0x1ccbfb[_0x8ef5b3[_0x7ef1('0x22')]]={'$like':'%'+_0x58e7ee[_0x7ef1('0x2f')][_0x7ef1('0x37')]+'%'};return _0x1ccbfb;}})});}_0x4b0380=_[_0x7ef1('0x35')]({},_0x4b0380,_0x58e7ee[_0x7ef1('0x38')]);var _0x238aa7={'where':_0x4b0380[_0x7ef1('0x32')]};return db[_0x7ef1('0x25')][_0x7ef1('0x39')](_0x238aa7)[_0x7ef1('0x1e')](function(_0x2da912){_0x2546bf[_0x7ef1('0x39')]=_0x2da912;if(_0x58e7ee[_0x7ef1('0x2f')]['includeAll']){_0x4b0380[_0x7ef1('0x3a')]=[{'all':!![]}];}return db[_0x7ef1('0x25')][_0x7ef1('0x3b')](_0x4b0380);})[_0x7ef1('0x1e')](function(_0x3889d7){_0x2546bf[_0x7ef1('0x3c')]=_0x3889d7;return _0x2546bf;})[_0x7ef1('0x1e')](respondWithFilteredResult(_0x2e8f1b,_0x4b0380))[_0x7ef1('0x3d')](handleError(_0x2e8f1b,null));};exports[_0x7ef1('0x3e')]=function(_0x1cff0b,_0x3e5ecd){var _0x374bf5={'raw':!![],'where':{'id':_0x1cff0b['params']['id']}},_0x2fb6c4={};_0x2fb6c4[_0x7ef1('0x2b')]=_[_0x7ef1('0x3f')](db[_0x7ef1('0x25')][_0x7ef1('0x26')]);_0x2fb6c4[_0x7ef1('0x2f')]=_[_0x7ef1('0x3f')](_0x1cff0b['query']);_0x2fb6c4[_0x7ef1('0x33')]=_[_0x7ef1('0x2a')](_0x2fb6c4[_0x7ef1('0x2b')],_0x2fb6c4[_0x7ef1('0x2f')]);_0x374bf5[_0x7ef1('0x2c')]=_[_0x7ef1('0x2a')](_0x2fb6c4['model'],qs[_0x7ef1('0x2d')](_0x1cff0b[_0x7ef1('0x2f')][_0x7ef1('0x2d')]));_0x374bf5[_0x7ef1('0x2c')]=_0x374bf5['attributes'][_0x7ef1('0x2e')]?_0x374bf5['attributes']:_0x2fb6c4['model'];if(_0x1cff0b[_0x7ef1('0x2f')]['includeAll']){_0x374bf5[_0x7ef1('0x3a')]=[{'all':!![]}];}_0x374bf5=_['merge']({},_0x374bf5,_0x1cff0b[_0x7ef1('0x38')]);return db[_0x7ef1('0x25')][_0x7ef1('0x40')](_0x374bf5)[_0x7ef1('0x1e')](handleEntityNotFound(_0x3e5ecd,null))[_0x7ef1('0x1e')](respondWithResult(_0x3e5ecd,null))[_0x7ef1('0x3d')](handleError(_0x3e5ecd,null));};exports[_0x7ef1('0x41')]=function(_0x106096,_0x49e089){return db['Cdr'][_0x7ef1('0x41')](_0x106096[_0x7ef1('0x42')],{})['then'](respondWithResult(_0x49e089,0xc9))[_0x7ef1('0x3d')](handleError(_0x49e089,null));};exports[_0x7ef1('0x43')]=function(_0xd06ca9,_0x5ce876){if(_0xd06ca9['body']['id']){delete _0xd06ca9[_0x7ef1('0x42')]['id'];}return db['Cdr']['find']({'where':{'id':_0xd06ca9[_0x7ef1('0x44')]['id']}})[_0x7ef1('0x1e')](handleEntityNotFound(_0x5ce876,null))[_0x7ef1('0x1e')](saveUpdates(_0xd06ca9[_0x7ef1('0x42')],null))[_0x7ef1('0x1e')](respondWithResult(_0x5ce876,null))['catch'](handleError(_0x5ce876,null));};exports[_0x7ef1('0x1f')]=function(_0x4e425b,_0x350dde){return db['Cdr'][_0x7ef1('0x40')]({'where':{'id':_0x4e425b['params']['id']}})['then'](handleEntityNotFound(_0x350dde,null))[_0x7ef1('0x1e')](removeEntity(_0x350dde,null))['catch'](handleError(_0x350dde,null));};exports[_0x7ef1('0x45')]=function(_0x30a4ce,_0x54a0bb){return db[_0x7ef1('0x25')][_0x7ef1('0x45')]()[_0x7ef1('0x1e')](respondWithResult(_0x54a0bb,null))['catch'](handleError(_0x54a0bb,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 38855fd..ffed71b 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(_0x2e7a45,_0x48960d){var _0x3eaeff=function(_0x269d72){while(--_0x269d72){_0x2e7a45['push'](_0x2e7a45['shift']());}};_0x3eaeff(++_0x48960d);}(_0x7a54,0x106));var _0x47a5=function(_0x134245,_0x3ac1e7){_0x134245=_0x134245-0x0;var _0x1e24b2=_0x7a54[_0x134245];return _0x1e24b2;};'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(_0x177008,_0x3806b7){var _0x36d641=function(_0x4f8e32){while(--_0x4f8e32){_0x177008['push'](_0x177008['shift']());}};_0x36d641(++_0x3806b7);}(_0x7a54,0x106));var _0x47a5=function(_0x1cbe51,_0x5a1c2f){_0x1cbe51=_0x1cbe51-0x0;var _0x730377=_0x7a54[_0x1cbe51];return _0x730377;};'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 7ddb802..602f07f 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 _0x2581=['jayson/promise','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x2581,0xfb));var _0x1258=function(_0x520477,_0x5ea467){_0x520477=_0x520477-0x0;var _0x3856e1=_0x2581[_0x520477];return _0x3856e1;};'use strict';var _=require(_0x1258('0x0'));var util=require('util');var moment=require(_0x1258('0x1'));var BPromise=require(_0x1258('0x2'));var rs=require(_0x1258('0x3'));var fs=require('fs');var Redis=require(_0x1258('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1258('0x5'));var logger=require(_0x1258('0x6'))(_0x1258('0x7'));var config=require(_0x1258('0x8'));var jayson=require(_0x1258('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x53cf01,_0x3d9193,_0x29e668){return new BPromise(function(_0x498cd3,_0x4d7801){return client[_0x1258('0xa')](_0x53cf01,_0x29e668)[_0x1258('0xb')](function(_0x36bd1e){logger[_0x1258('0xc')](_0x1258('0xd'),_0x3d9193,_0x1258('0xe'));logger[_0x1258('0xf')](_0x1258('0x10'),_0x3d9193,_0x1258('0xe'),JSON['stringify'](_0x36bd1e));if(_0x36bd1e[_0x1258('0x11')]){if(_0x36bd1e[_0x1258('0x11')]['code']===0x1f4){logger['error'](_0x1258('0xd'),_0x3d9193,_0x36bd1e[_0x1258('0x11')]['message']);return _0x4d7801(_0x36bd1e[_0x1258('0x11')]['message']);}logger[_0x1258('0x11')](_0x1258('0xd'),_0x3d9193,_0x36bd1e[_0x1258('0x11')][_0x1258('0x12')]);return _0x498cd3(_0x36bd1e['error'][_0x1258('0x12')]);}else{logger[_0x1258('0xc')]('Cdr,\x20%s,\x20%s',_0x3d9193,_0x1258('0xe'));_0x498cd3(_0x36bd1e['result'][_0x1258('0x12')]);}})[_0x1258('0x13')](function(_0x4db0e6){logger[_0x1258('0x11')]('Cdr,\x20%s,\x20%s',_0x3d9193,_0x4db0e6);_0x4d7801(_0x4db0e6);});});} \ No newline at end of file +var _0xd54d=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x41f4d3,_0x5e0883){var _0x12b528=function(_0x2ddba4){while(--_0x2ddba4){_0x41f4d3['push'](_0x41f4d3['shift']());}};_0x12b528(++_0x5e0883);}(_0xd54d,0x171));var _0xdd54=function(_0x44f16c,_0x4ea669){_0x44f16c=_0x44f16c-0x0;var _0x230de8=_0xd54d[_0x44f16c];return _0x230de8;};'use strict';var _=require(_0xdd54('0x0'));var util=require('util');var moment=require(_0xdd54('0x1'));var BPromise=require(_0xdd54('0x2'));var rs=require(_0xdd54('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdd54('0x4'))['db'];var utils=require(_0xdd54('0x5'));var logger=require(_0xdd54('0x6'))('rpc');var config=require(_0xdd54('0x7'));var jayson=require(_0xdd54('0x8'));var client=jayson[_0xdd54('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5314eb,_0x548ec9,_0xe3ffd){return new BPromise(function(_0x45fc61,_0x1561c2){return client[_0xdd54('0xa')](_0x5314eb,_0xe3ffd)['then'](function(_0x480d20){logger[_0xdd54('0xb')]('Cdr,\x20%s,\x20%s',_0x548ec9,_0xdd54('0xc'));logger[_0xdd54('0xd')](_0xdd54('0xe'),_0x548ec9,'request\x20sent',JSON[_0xdd54('0xf')](_0x480d20));if(_0x480d20['error']){if(_0x480d20[_0xdd54('0x10')][_0xdd54('0x11')]===0x1f4){logger['error'](_0xdd54('0x12'),_0x548ec9,_0x480d20[_0xdd54('0x10')][_0xdd54('0x13')]);return _0x1561c2(_0x480d20[_0xdd54('0x10')][_0xdd54('0x13')]);}logger['error'](_0xdd54('0x12'),_0x548ec9,_0x480d20['error']['message']);return _0x45fc61(_0x480d20[_0xdd54('0x10')]['message']);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x548ec9,'request\x20sent');_0x45fc61(_0x480d20[_0xdd54('0x14')][_0xdd54('0x13')]);}})[_0xdd54('0x15')](function(_0x30892c){logger[_0xdd54('0x10')](_0xdd54('0x12'),_0x548ec9,_0x30892c);_0x1561c2(_0x30892c);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 52628d0..d310c18 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x4d7a70,_0x2d3bfa){var _0x3aafbb=function(_0x43fbf2){while(--_0x43fbf2){_0x4d7a70['push'](_0x4d7a70['shift']());}};_0x3aafbb(++_0x2d3bfa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_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 cc5cc75..60cc55e 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 _0x8d95=['STRING','noop','*,*,*,*','INTEGER'];(function(_0x38de33,_0x4361bb){var _0x40f16d=function(_0x25975c){while(--_0x25975c){_0x38de33['push'](_0x38de33['shift']());}};_0x40f16d(++_0x4361bb);}(_0x8d95,0x113));var _0x58d9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8d95[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x58d9('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x58d9('0x1')],'allowNull':![],'defaultValue':_0x58d9('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x58d9('0x1')]},'interval':{'type':Sequelize[_0x58d9('0x1')],'defaultValue':_0x58d9('0x3')}}; \ No newline at end of file +var _0x479d=['sequelize','exports','STRING'];(function(_0x49b0a8,_0x409294){var _0x162a83=function(_0x30ae56){while(--_0x30ae56){_0x49b0a8['push'](_0x49b0a8['shift']());}};_0x162a83(++_0x409294);}(_0x479d,0x1b0));var _0xd479=function(_0x2188aa,_0x33561f){_0x2188aa=_0x2188aa-0x0;var _0x30b27=_0x479d[_0x2188aa];return _0x30b27;};'use strict';var Sequelize=require(_0xd479('0x0'));module[_0xd479('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xd479('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xd479('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 0f1f40d..fb965bb 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 _0xc125=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','update','destroy','then','sendStatus','error','stack','name','show','params','model','ChatApplication','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','find','catch','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x13a17f,_0x259096){var _0x18d626=function(_0x561140){while(--_0x561140){_0x13a17f['push'](_0x13a17f['shift']());}};_0x18d626(++_0x259096);}(_0xc125,0x150));var _0x5c12=function(_0x56f1d2,_0x582e60){_0x56f1d2=_0x56f1d2-0x0;var _0x4cc092=_0xc125[_0x56f1d2];return _0x4cc092;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5c12('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5c12('0x1'));var rp=require(_0x5c12('0x2'));var moment=require(_0x5c12('0x3'));var BPromise=require(_0x5c12('0x4'));var Mustache=require(_0x5c12('0x5'));var util=require(_0x5c12('0x6'));var path=require(_0x5c12('0x7'));var sox=require(_0x5c12('0x8'));var csv=require(_0x5c12('0x9'));var ejs=require(_0x5c12('0xa'));var fs=require('fs');var fs_extra=require(_0x5c12('0xb'));var _=require(_0x5c12('0xc'));var squel=require('squel');var crypto=require(_0x5c12('0xd'));var jsforce=require(_0x5c12('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5c12('0x9'));var querystring=require(_0x5c12('0xf'));var Papa=require(_0x5c12('0x10'));var Redis=require(_0x5c12('0x11'));var authService=require(_0x5c12('0x12'));var qs=require(_0x5c12('0x13'));var as=require(_0x5c12('0x14'));var hardwareService=require(_0x5c12('0x15'));var logger=require('../../config/logger')(_0x5c12('0x16'));var utils=require(_0x5c12('0x17'));var config=require(_0x5c12('0x18'));var licenseUtil=require(_0x5c12('0x19'));var db=require(_0x5c12('0x1a'))['db'];function respondWithStatusCode(_0x4a1279,_0x4f40ae){_0x4f40ae=_0x4f40ae||0xcc;return function(_0x40d80b){if(_0x40d80b){return _0x4a1279['sendStatus'](_0x4f40ae);}return _0x4a1279[_0x5c12('0x1b')](_0x4f40ae)[_0x5c12('0x1c')]();};}function respondWithResult(_0x448667,_0x4a9910){_0x4a9910=_0x4a9910||0xc8;return function(_0x5676a9){if(_0x5676a9){return _0x448667[_0x5c12('0x1b')](_0x4a9910)[_0x5c12('0x1d')](_0x5676a9);}};}function respondWithFilteredResult(_0x5cb237,_0x460ff1){return function(_0xf18ba2){if(_0xf18ba2){var _0x244216=typeof _0x460ff1['offset']==='undefined'&&typeof _0x460ff1[_0x5c12('0x1e')]===_0x5c12('0x1f');var _0x319cc8=_0xf18ba2[_0x5c12('0x20')];var _0x1bd895=_0x244216?0x0:_0x460ff1[_0x5c12('0x21')];var _0x16543f=_0x244216?_0xf18ba2[_0x5c12('0x20')]:_0x460ff1['offset']+_0x460ff1['limit'];var _0x2f7d71;if(_0x16543f>=_0x319cc8){_0x16543f=_0x319cc8;_0x2f7d71=0xc8;}else{_0x2f7d71=0xce;}_0x5cb237[_0x5c12('0x1b')](_0x2f7d71);return _0x5cb237[_0x5c12('0x22')](_0x5c12('0x23'),_0x1bd895+'-'+_0x16543f+'/'+_0x319cc8)['json'](_0xf18ba2);}return null;};}function patchUpdates(_0x3ea1b5){return function(_0x4c096d){try{jsonpatch[_0x5c12('0x24')](_0x4c096d,_0x3ea1b5,!![]);}catch(_0x26aa3f){return BPromise['reject'](_0x26aa3f);}return _0x4c096d['save']();};}function saveUpdates(_0xa1ad8f,_0x5f7e40){return function(_0x5b0552){if(_0x5b0552){return _0x5b0552[_0x5c12('0x25')](_0xa1ad8f)['then'](function(_0xfa7c1e){return _0xfa7c1e;});}return null;};}function removeEntity(_0x7bc2ff,_0x1d9e30){return function(_0x40f6ab){if(_0x40f6ab){return _0x40f6ab[_0x5c12('0x26')]()[_0x5c12('0x27')](function(){_0x7bc2ff[_0x5c12('0x1b')](0xcc)[_0x5c12('0x1c')]();});}};}function handleEntityNotFound(_0xca0f79,_0x1d6d76){return function(_0x23e787){if(!_0x23e787){_0xca0f79[_0x5c12('0x28')](0x194);}return _0x23e787;};}function handleError(_0x146bce,_0x598c2b){_0x598c2b=_0x598c2b||0x1f4;return function(_0x37979e){logger[_0x5c12('0x29')](_0x37979e[_0x5c12('0x2a')]);if(_0x37979e[_0x5c12('0x2b')]){delete _0x37979e[_0x5c12('0x2b')];}_0x146bce[_0x5c12('0x1b')](_0x598c2b)['send'](_0x37979e);};}exports[_0x5c12('0x2c')]=function(_0x3e9bf5,_0x4d21b6){var _0x5939a8={'raw':!![],'where':{'id':_0x3e9bf5[_0x5c12('0x2d')]['id']}},_0x5815d4={};_0x5815d4[_0x5c12('0x2e')]=_['keys'](db[_0x5c12('0x2f')][_0x5c12('0x30')]);_0x5815d4[_0x5c12('0x31')]=_['keys'](_0x3e9bf5[_0x5c12('0x31')]);_0x5815d4['filters']=_[_0x5c12('0x32')](_0x5815d4[_0x5c12('0x2e')],_0x5815d4[_0x5c12('0x31')]);_0x5939a8[_0x5c12('0x33')]=_[_0x5c12('0x32')](_0x5815d4[_0x5c12('0x2e')],qs[_0x5c12('0x34')](_0x3e9bf5['query']['fields']));_0x5939a8[_0x5c12('0x33')]=_0x5939a8[_0x5c12('0x33')][_0x5c12('0x35')]?_0x5939a8[_0x5c12('0x33')]:_0x5815d4['model'];if(_0x3e9bf5['query'][_0x5c12('0x36')]){_0x5939a8[_0x5c12('0x37')]=[{'all':!![]}];}_0x5939a8=_['merge']({},_0x5939a8,_0x3e9bf5['options']);return db['ChatApplication'][_0x5c12('0x38')](_0x5939a8)[_0x5c12('0x27')](handleEntityNotFound(_0x4d21b6,null))[_0x5c12('0x27')](respondWithResult(_0x4d21b6,null))[_0x5c12('0x39')](handleError(_0x4d21b6,null));};exports[_0x5c12('0x25')]=function(_0x5617cc,_0x2ab7bf){if(_0x5617cc[_0x5c12('0x3a')]['id']){delete _0x5617cc['body']['id'];}return db[_0x5c12('0x2f')][_0x5c12('0x38')]({'where':{'id':_0x5617cc[_0x5c12('0x2d')]['id']}})[_0x5c12('0x27')](handleEntityNotFound(_0x2ab7bf,null))[_0x5c12('0x27')](saveUpdates(_0x5617cc['body'],null))[_0x5c12('0x27')](respondWithResult(_0x2ab7bf,null))[_0x5c12('0x39')](handleError(_0x2ab7bf,null));};exports['destroy']=function(_0x3600ed,_0x11556c){return db[_0x5c12('0x2f')]['find']({'where':{'id':_0x3600ed[_0x5c12('0x2d')]['id']}})[_0x5c12('0x27')](handleEntityNotFound(_0x11556c,null))[_0x5c12('0x27')](removeEntity(_0x11556c,null))['catch'](handleError(_0x11556c,null));}; \ No newline at end of file +var _0xe87e=['then','destroy','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0x4c9fcc,_0x2bde89){var _0xcb4f7d=function(_0x5dd49b){while(--_0x5dd49b){_0x4c9fcc['push'](_0x4c9fcc['shift']());}};_0xcb4f7d(++_0x2bde89);}(_0xe87e,0x17d));var _0xee87=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xe87e[_0x35885a];return _0xe86249;};'use strict';var emlformat=require(_0xee87('0x0'));var rimraf=require(_0xee87('0x1'));var zipdir=require(_0xee87('0x2'));var jsonpatch=require(_0xee87('0x3'));var rp=require(_0xee87('0x4'));var moment=require('moment');var BPromise=require(_0xee87('0x5'));var Mustache=require(_0xee87('0x6'));var util=require(_0xee87('0x7'));var path=require(_0xee87('0x8'));var sox=require(_0xee87('0x9'));var csv=require(_0xee87('0xa'));var ejs=require(_0xee87('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xee87('0xc'));var crypto=require(_0xee87('0xd'));var jsforce=require(_0xee87('0xe'));var deskjs=require(_0xee87('0xf'));var toCsv=require(_0xee87('0xa'));var querystring=require('querystring');var Papa=require(_0xee87('0x10'));var Redis=require(_0xee87('0x11'));var authService=require(_0xee87('0x12'));var qs=require(_0xee87('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xee87('0x14'));var logger=require(_0xee87('0x15'))('api');var utils=require(_0xee87('0x16'));var config=require(_0xee87('0x17'));var licenseUtil=require(_0xee87('0x18'));var db=require(_0xee87('0x19'))['db'];function respondWithStatusCode(_0x252418,_0x2768f7){_0x2768f7=_0x2768f7||0xcc;return function(_0x317dcd){if(_0x317dcd){return _0x252418[_0xee87('0x1a')](_0x2768f7);}return _0x252418['status'](_0x2768f7)[_0xee87('0x1b')]();};}function respondWithResult(_0x2377a7,_0x49df11){_0x49df11=_0x49df11||0xc8;return function(_0x4be77d){if(_0x4be77d){return _0x2377a7[_0xee87('0x1c')](_0x49df11)[_0xee87('0x1d')](_0x4be77d);}};}function respondWithFilteredResult(_0x5175e6,_0x420526){return function(_0x35d1c7){if(_0x35d1c7){var _0x67df24=typeof _0x420526[_0xee87('0x1e')]==='undefined'&&typeof _0x420526[_0xee87('0x1f')]==='undefined';var _0x2f7ad3=_0x35d1c7[_0xee87('0x20')];var _0x1fa2be=_0x67df24?0x0:_0x420526['offset'];var _0x48a330=_0x67df24?_0x35d1c7[_0xee87('0x20')]:_0x420526[_0xee87('0x1e')]+_0x420526[_0xee87('0x1f')];var _0x4eb271;if(_0x48a330>=_0x2f7ad3){_0x48a330=_0x2f7ad3;_0x4eb271=0xc8;}else{_0x4eb271=0xce;}_0x5175e6[_0xee87('0x1c')](_0x4eb271);return _0x5175e6[_0xee87('0x21')](_0xee87('0x22'),_0x1fa2be+'-'+_0x48a330+'/'+_0x2f7ad3)[_0xee87('0x1d')](_0x35d1c7);}return null;};}function patchUpdates(_0x42ba7a){return function(_0x1d48c6){try{jsonpatch[_0xee87('0x23')](_0x1d48c6,_0x42ba7a,!![]);}catch(_0x504d15){return BPromise[_0xee87('0x24')](_0x504d15);}return _0x1d48c6[_0xee87('0x25')]();};}function saveUpdates(_0x406fde,_0x35e7cf){return function(_0x3176c6){if(_0x3176c6){return _0x3176c6[_0xee87('0x26')](_0x406fde)[_0xee87('0x27')](function(_0x1f5dc3){return _0x1f5dc3;});}return null;};}function removeEntity(_0xb41cbc,_0x49e9f5){return function(_0x5cc9a3){if(_0x5cc9a3){return _0x5cc9a3[_0xee87('0x28')]()[_0xee87('0x27')](function(){_0xb41cbc['status'](0xcc)[_0xee87('0x1b')]();});}};}function handleEntityNotFound(_0xb68987,_0x36a651){return function(_0x55236e){if(!_0x55236e){_0xb68987['sendStatus'](0x194);}return _0x55236e;};}function handleError(_0x18dd0d,_0x48fe19){_0x48fe19=_0x48fe19||0x1f4;return function(_0x36e381){logger['error'](_0x36e381[_0xee87('0x29')]);if(_0x36e381[_0xee87('0x2a')]){delete _0x36e381['name'];}_0x18dd0d[_0xee87('0x1c')](_0x48fe19)[_0xee87('0x2b')](_0x36e381);};}exports[_0xee87('0x2c')]=function(_0x1bd42a,_0x3fcc5e){var _0x5ac56a={'raw':!![],'where':{'id':_0x1bd42a[_0xee87('0x2d')]['id']}},_0x3eb538={};_0x3eb538[_0xee87('0x2e')]=_[_0xee87('0x2f')](db[_0xee87('0x30')][_0xee87('0x31')]);_0x3eb538[_0xee87('0x32')]=_['keys'](_0x1bd42a[_0xee87('0x32')]);_0x3eb538[_0xee87('0x33')]=_[_0xee87('0x34')](_0x3eb538[_0xee87('0x2e')],_0x3eb538[_0xee87('0x32')]);_0x5ac56a[_0xee87('0x35')]=_[_0xee87('0x34')](_0x3eb538[_0xee87('0x2e')],qs[_0xee87('0x36')](_0x1bd42a['query']['fields']));_0x5ac56a[_0xee87('0x35')]=_0x5ac56a['attributes'][_0xee87('0x37')]?_0x5ac56a[_0xee87('0x35')]:_0x3eb538[_0xee87('0x2e')];if(_0x1bd42a[_0xee87('0x32')][_0xee87('0x38')]){_0x5ac56a[_0xee87('0x39')]=[{'all':!![]}];}_0x5ac56a=_['merge']({},_0x5ac56a,_0x1bd42a['options']);return db[_0xee87('0x30')]['find'](_0x5ac56a)['then'](handleEntityNotFound(_0x3fcc5e,null))[_0xee87('0x27')](respondWithResult(_0x3fcc5e,null))[_0xee87('0x3a')](handleError(_0x3fcc5e,null));};exports[_0xee87('0x26')]=function(_0x5746e7,_0x27420a){if(_0x5746e7[_0xee87('0x3b')]['id']){delete _0x5746e7[_0xee87('0x3b')]['id'];}return db[_0xee87('0x30')]['find']({'where':{'id':_0x5746e7[_0xee87('0x2d')]['id']}})[_0xee87('0x27')](handleEntityNotFound(_0x27420a,null))[_0xee87('0x27')](saveUpdates(_0x5746e7['body'],null))[_0xee87('0x27')](respondWithResult(_0x27420a,null))[_0xee87('0x3a')](handleError(_0x27420a,null));};exports[_0xee87('0x28')]=function(_0x1c8d10,_0x512f54){return db[_0xee87('0x30')]['find']({'where':{'id':_0x1c8d10[_0xee87('0x2d')]['id']}})[_0xee87('0x27')](handleEntityNotFound(_0x512f54,null))[_0xee87('0x27')](removeEntity(_0x512f54,null))['catch'](handleError(_0x512f54,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 66d2121..5db65be 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 _0x19be=['../../config/logger','api','bluebird','path','rimraf','./chatApplication.attributes','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0xaa0140,_0xd6c719){var _0x11ac88=function(_0x563a95){while(--_0x563a95){_0xaa0140['push'](_0xaa0140['shift']());}};_0x11ac88(++_0xd6c719);}(_0x19be,0x1de));var _0xe19b=function(_0xf292c0,_0x28bf0b){_0xf292c0=_0xf292c0-0x0;var _0x423063=_0x19be[_0xf292c0];return _0x423063;};'use strict';var _=require(_0xe19b('0x0'));var util=require(_0xe19b('0x1'));var logger=require(_0xe19b('0x2'))(_0xe19b('0x3'));var moment=require('moment');var BPromise=require(_0xe19b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe19b('0x5'));var rimraf=require(_0xe19b('0x6'));var config=require('../../config/environment');var attributes=require(_0xe19b('0x7'));module['exports']=function(_0x4b6cea,_0x48a611){return _0x4b6cea[_0xe19b('0x8')]('ChatApplication',attributes,{'tableName':_0xe19b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe19b('0xa'),'collate':_0xe19b('0xb')});}; \ No newline at end of file +var _0x7429=['ChatApplication','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x7429,0x6f));var _0x9742=function(_0x4481dc,_0x200eeb){_0x4481dc=_0x4481dc-0x0;var _0x2a5b20=_0x7429[_0x4481dc];return _0x2a5b20;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9742('0x0'))('api');var moment=require(_0x9742('0x1'));var BPromise=require(_0x9742('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9742('0x3'));var rimraf=require(_0x9742('0x4'));var config=require(_0x9742('0x5'));var attributes=require(_0x9742('0x6'));module[_0x9742('0x7')]=function(_0x5a1528,_0x5a7ef9){return _0x5a1528[_0x9742('0x8')](_0x9742('0x9'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9742('0xa'),'collate':_0x9742('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 84c9024..7d288d7 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 _0x03f3=['catch','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','ChatApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x4aedd6,_0x4d511e){var _0x531211=function(_0x41a137){while(--_0x41a137){_0x4aedd6['push'](_0x4aedd6['shift']());}};_0x531211(++_0x4d511e);}(_0x03f3,0x1ef));var _0x303f=function(_0x1d558c,_0x1e497c){_0x1d558c=_0x1d558c-0x0;var _0x15767d=_0x03f3[_0x1d558c];return _0x15767d;};'use strict';var _=require(_0x303f('0x0'));var util=require(_0x303f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x303f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x303f('0x3'));var logger=require(_0x303f('0x4'))(_0x303f('0x5'));var config=require(_0x303f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x303f('0x7')][_0x303f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f457a,_0xd949d1,_0x420c9a){return new BPromise(function(_0x9290a,_0x218260){return client[_0x303f('0x9')](_0x3f457a,_0x420c9a)[_0x303f('0xa')](function(_0x10a151){logger['info'](_0x303f('0xb'),_0xd949d1,'request\x20sent');logger[_0x303f('0xc')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0xd949d1,_0x303f('0xd'),JSON[_0x303f('0xe')](_0x10a151));if(_0x10a151[_0x303f('0xf')]){if(_0x10a151[_0x303f('0xf')][_0x303f('0x10')]===0x1f4){logger[_0x303f('0xf')](_0x303f('0xb'),_0xd949d1,_0x10a151[_0x303f('0xf')][_0x303f('0x11')]);return _0x218260(_0x10a151[_0x303f('0xf')]['message']);}logger[_0x303f('0xf')](_0x303f('0xb'),_0xd949d1,_0x10a151['error']['message']);return _0x9290a(_0x10a151['error'][_0x303f('0x11')]);}else{logger['info'](_0x303f('0xb'),_0xd949d1,'request\x20sent');_0x9290a(_0x10a151['result']['message']);}})[_0x303f('0x12')](function(_0x56ddf0){logger[_0x303f('0xf')]('ChatApplication,\x20%s,\x20%s',_0xd949d1,_0x56ddf0);_0x218260(_0x56ddf0);});});} \ No newline at end of file +var _0x2b86=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment'];(function(_0x3c7f1d,_0x44b37b){var _0xd7ab0c=function(_0x1dd6b2){while(--_0x1dd6b2){_0x3c7f1d['push'](_0x3c7f1d['shift']());}};_0xd7ab0c(++_0x44b37b);}(_0x2b86,0x1b2));var _0x62b8=function(_0x3f5ae8,_0x176bf1){_0x3f5ae8=_0x3f5ae8-0x0;var _0x1a8573=_0x2b86[_0x3f5ae8];return _0x1a8573;};'use strict';var _=require(_0x62b8('0x0'));var util=require(_0x62b8('0x1'));var moment=require(_0x62b8('0x2'));var BPromise=require(_0x62b8('0x3'));var rs=require(_0x62b8('0x4'));var fs=require('fs');var Redis=require(_0x62b8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x62b8('0x6'));var logger=require('../../config/logger')(_0x62b8('0x7'));var config=require(_0x62b8('0x8'));var jayson=require(_0x62b8('0x9'));var client=jayson[_0x62b8('0xa')][_0x62b8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3278b7,_0x1b3a84,_0xf95861){return new BPromise(function(_0xf9981a,_0x1e1897){return client[_0x62b8('0xc')](_0x3278b7,_0xf95861)[_0x62b8('0xd')](function(_0x818841){logger[_0x62b8('0xe')](_0x62b8('0xf'),_0x1b3a84,_0x62b8('0x10'));logger[_0x62b8('0x11')](_0x62b8('0x12'),_0x1b3a84,_0x62b8('0x10'),JSON[_0x62b8('0x13')](_0x818841));if(_0x818841[_0x62b8('0x14')]){if(_0x818841[_0x62b8('0x14')][_0x62b8('0x15')]===0x1f4){logger['error'](_0x62b8('0xf'),_0x1b3a84,_0x818841['error']['message']);return _0x1e1897(_0x818841[_0x62b8('0x14')][_0x62b8('0x16')]);}logger[_0x62b8('0x14')](_0x62b8('0xf'),_0x1b3a84,_0x818841[_0x62b8('0x14')]['message']);return _0xf9981a(_0x818841[_0x62b8('0x14')][_0x62b8('0x16')]);}else{logger[_0x62b8('0xe')](_0x62b8('0xf'),_0x1b3a84,'request\x20sent');_0xf9981a(_0x818841['result'][_0x62b8('0x16')]);}})['catch'](function(_0x304d16){logger['error'](_0x62b8('0xf'),_0x1b3a84,_0x304d16);_0x1e1897(_0x304d16);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 39dca3c..59bd673 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 _0xef09=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x799b5,_0x40e55f){var _0x581230=function(_0x51f010){while(--_0x51f010){_0x799b5['push'](_0x799b5['shift']());}};_0x581230(++_0x40e55f);}(_0xef09,0x18c));var _0x9ef0=function(_0x28ec7b,_0x2413fa){_0x28ec7b=_0x28ec7b-0x0;var _0xce0aa1=_0xef09[_0x28ec7b];return _0xce0aa1;};'use strict';var multer=require(_0x9ef0('0x0'));var util=require('util');var path=require(_0x9ef0('0x1'));var timeout=require(_0x9ef0('0x2'));var express=require(_0x9ef0('0x3'));var router=express[_0x9ef0('0x4')]();var fs_extra=require(_0x9ef0('0x5'));var auth=require(_0x9ef0('0x6'));var interaction=require(_0x9ef0('0x7'));var config=require(_0x9ef0('0x8'));var controller=require(_0x9ef0('0x9'));router[_0x9ef0('0xa')](_0x9ef0('0xb'),auth[_0x9ef0('0xc')](),controller[_0x9ef0('0xd')]);router[_0x9ef0('0xe')](_0x9ef0('0xb'),auth[_0x9ef0('0xc')](),controller[_0x9ef0('0xf')]);router[_0x9ef0('0x10')](_0x9ef0('0xb'),auth['isAuthenticated'](),controller[_0x9ef0('0x11')]);module[_0x9ef0('0x12')]=router; \ No newline at end of file +var _0x92a2=['destroy','exports','multer','util','path','connect-timeout','Router','./chatApplication.controller','get','/:id','show','put','isAuthenticated','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x92a2,0x98));var _0x292a=function(_0x16cbb7,_0x51301){_0x16cbb7=_0x16cbb7-0x0;var _0x4507bf=_0x92a2[_0x16cbb7];return _0x4507bf;};'use strict';var multer=require(_0x292a('0x0'));var util=require(_0x292a('0x1'));var path=require(_0x292a('0x2'));var timeout=require(_0x292a('0x3'));var express=require('express');var router=express[_0x292a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x292a('0x5'));router[_0x292a('0x6')](_0x292a('0x7'),auth['isAuthenticated'](),controller[_0x292a('0x8')]);router[_0x292a('0x9')]('/:id',auth[_0x292a('0xa')](),controller[_0x292a('0xb')]);router[_0x292a('0xc')](_0x292a('0x7'),auth[_0x292a('0xa')](),controller[_0x292a('0xd')]);module[_0x292a('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 69345f9..7135b88 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 _0x5f77=['sequelize','exports','STRING','BOOLEAN'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x5f77,0x108));var _0x75f7=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0x5f77[_0x26f702];return _0x11417d;};'use strict';var Sequelize=require(_0x75f7('0x0'));module[_0x75f7('0x1')]={'name':{'type':Sequelize[_0x75f7('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x75f7('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x6a80=['exports','STRING','BOOLEAN','sequelize'];(function(_0x53b74a,_0x40eddd){var _0x5a7c78=function(_0x465f38){while(--_0x465f38){_0x53b74a['push'](_0x53b74a['shift']());}};_0x5a7c78(++_0x40eddd);}(_0x6a80,0x1e7));var _0x06a8=function(_0x5d6e33,_0x4d5804){_0x5d6e33=_0x5d6e33-0x0;var _0x3fd62d=_0x6a80[_0x5d6e33];return _0x3fd62d;};'use strict';var Sequelize=require(_0x06a8('0x0'));module[_0x06a8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x06a8('0x2')]},'write':{'type':Sequelize[_0x06a8('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 3197327..9c15797 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 _0x3ae8=['create','body','describe','getUnread','toInteger','addMembers','ids','getMembers','User','removeMembers','addMessage','ChatInternalMessage','getMessages','findOne','$gte','split','format','nolimit','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatGroup.socket','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','type','map','keys','query','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filters','merge','filter','options','includeAll','include','findAll','rows','show','params','ChatGroup','length','find','catch'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x3ae8,0xd0));var _0x83ae=function(_0xbfd47a,_0x46861a){_0xbfd47a=_0xbfd47a-0x0;var _0x5612ee=_0x3ae8[_0xbfd47a];return _0x5612ee;};'use strict';var emlformat=require(_0x83ae('0x0'));var rimraf=require(_0x83ae('0x1'));var zipdir=require(_0x83ae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x83ae('0x3'));var moment=require(_0x83ae('0x4'));var BPromise=require(_0x83ae('0x5'));var Mustache=require(_0x83ae('0x6'));var util=require(_0x83ae('0x7'));var path=require(_0x83ae('0x8'));var sox=require(_0x83ae('0x9'));var csv=require(_0x83ae('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x83ae('0xb'));var _=require(_0x83ae('0xc'));var squel=require(_0x83ae('0xd'));var crypto=require(_0x83ae('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x83ae('0xa'));var querystring=require(_0x83ae('0xf'));var Papa=require(_0x83ae('0x10'));var Redis=require(_0x83ae('0x11'));var authService=require(_0x83ae('0x12'));var qs=require(_0x83ae('0x13'));var as=require(_0x83ae('0x14'));var hardwareService=require(_0x83ae('0x15'));var logger=require(_0x83ae('0x16'))('api');var utils=require(_0x83ae('0x17'));var config=require(_0x83ae('0x18'));var licenseUtil=require(_0x83ae('0x19'));var db=require(_0x83ae('0x1a'))['db'];config['redis']=_['defaults'](config[_0x83ae('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x83ae('0x1c'))(new Redis(config[_0x83ae('0x1b')]));require(_0x83ae('0x1d'))['register'](socket);function respondWithStatusCode(_0x447e8f,_0x120dbf){_0x120dbf=_0x120dbf||0xcc;return function(_0x47ce0b){if(_0x47ce0b){return _0x447e8f['sendStatus'](_0x120dbf);}return _0x447e8f[_0x83ae('0x1e')](_0x120dbf)[_0x83ae('0x1f')]();};}function respondWithResult(_0x130521,_0x87c227){_0x87c227=_0x87c227||0xc8;return function(_0x2899dc){if(_0x2899dc){return _0x130521[_0x83ae('0x1e')](_0x87c227)[_0x83ae('0x20')](_0x2899dc);}};}function respondWithFilteredResult(_0x4a1a89,_0x18e0b1){return function(_0xd65a1){if(_0xd65a1){var _0x6faf54=typeof _0x18e0b1[_0x83ae('0x21')]===_0x83ae('0x22')&&typeof _0x18e0b1[_0x83ae('0x23')]===_0x83ae('0x22');var _0x5c7806=_0xd65a1[_0x83ae('0x24')];var _0x4f78bf=_0x6faf54?0x0:_0x18e0b1[_0x83ae('0x21')];var _0x43c002=_0x6faf54?_0xd65a1[_0x83ae('0x24')]:_0x18e0b1[_0x83ae('0x21')]+_0x18e0b1[_0x83ae('0x23')];var _0x3be6f7;if(_0x43c002>=_0x5c7806){_0x43c002=_0x5c7806;_0x3be6f7=0xc8;}else{_0x3be6f7=0xce;}_0x4a1a89[_0x83ae('0x1e')](_0x3be6f7);return _0x4a1a89[_0x83ae('0x25')](_0x83ae('0x26'),_0x4f78bf+'-'+_0x43c002+'/'+_0x5c7806)[_0x83ae('0x20')](_0xd65a1);}return null;};}function patchUpdates(_0x2b5599){return function(_0x50ee1d){try{jsonpatch[_0x83ae('0x27')](_0x50ee1d,_0x2b5599,!![]);}catch(_0x50b3a9){return BPromise['reject'](_0x50b3a9);}return _0x50ee1d['save']();};}function saveUpdates(_0x2045df,_0xac334a){return function(_0x4fdc08){if(_0x4fdc08){return _0x4fdc08[_0x83ae('0x28')](_0x2045df)[_0x83ae('0x29')](function(_0x57f112){return _0x57f112;});}return null;};}function removeEntity(_0x359935,_0x26c98e){return function(_0x4d3c12){if(_0x4d3c12){return _0x4d3c12[_0x83ae('0x2a')]()[_0x83ae('0x29')](function(){_0x359935[_0x83ae('0x1e')](0xcc)[_0x83ae('0x1f')]();});}};}function handleEntityNotFound(_0x41e54b,_0x65c00d){return function(_0x3d16ba){if(!_0x3d16ba){_0x41e54b[_0x83ae('0x2b')](0x194);}return _0x3d16ba;};}function handleError(_0x56a6b1,_0x2f44a2){_0x2f44a2=_0x2f44a2||0x1f4;return function(_0x1de424){logger[_0x83ae('0x2c')](_0x1de424[_0x83ae('0x2d')]);if(_0x1de424[_0x83ae('0x2e')]){delete _0x1de424[_0x83ae('0x2e')];}_0x56a6b1[_0x83ae('0x1e')](_0x2f44a2)[_0x83ae('0x2f')](_0x1de424);};}exports[_0x83ae('0x30')]=function(_0x1bde4f,_0x5d9fbf){var _0x48e8f7={},_0x44efc0={},_0xd71104={'count':0x0,'rows':[]};var _0x2b0940=_['map'](db['ChatGroup'][_0x83ae('0x31')],function(_0x992ea8){return{'name':_0x992ea8['fieldName'],'type':_0x992ea8[_0x83ae('0x32')]['key']};});_0x44efc0['model']=_[_0x83ae('0x33')](_0x2b0940,'name');_0x44efc0['query']=_[_0x83ae('0x34')](_0x1bde4f[_0x83ae('0x35')]);_0x44efc0['filters']=_[_0x83ae('0x36')](_0x44efc0[_0x83ae('0x37')],_0x44efc0[_0x83ae('0x35')]);_0x48e8f7[_0x83ae('0x38')]=_[_0x83ae('0x36')](_0x44efc0['model'],qs[_0x83ae('0x39')](_0x1bde4f[_0x83ae('0x35')][_0x83ae('0x39')]));_0x48e8f7[_0x83ae('0x38')]=_0x48e8f7[_0x83ae('0x38')]['length']?_0x48e8f7[_0x83ae('0x38')]:_0x44efc0[_0x83ae('0x37')];if(!_0x1bde4f['query'][_0x83ae('0x3a')]('nolimit')){_0x48e8f7[_0x83ae('0x23')]=qs[_0x83ae('0x23')](_0x1bde4f['query']['limit']);_0x48e8f7[_0x83ae('0x21')]=qs[_0x83ae('0x21')](_0x1bde4f[_0x83ae('0x35')]['offset']);}_0x48e8f7[_0x83ae('0x3b')]=qs[_0x83ae('0x3c')](_0x1bde4f[_0x83ae('0x35')][_0x83ae('0x3c')]);_0x48e8f7[_0x83ae('0x3d')]=qs['filters'](_[_0x83ae('0x3e')](_0x1bde4f[_0x83ae('0x35')],_0x44efc0[_0x83ae('0x3f')]),_0x2b0940);if(_0x1bde4f[_0x83ae('0x35')]['filter']){_0x48e8f7[_0x83ae('0x3d')]=_[_0x83ae('0x40')](_0x48e8f7[_0x83ae('0x3d')],{'$or':_[_0x83ae('0x33')](_0x2b0940,function(_0x17564b){if(_0x17564b['type']!=='VIRTUAL'){var _0x54c827={};_0x54c827[_0x17564b[_0x83ae('0x2e')]]={'$like':'%'+_0x1bde4f[_0x83ae('0x35')][_0x83ae('0x41')]+'%'};return _0x54c827;}})});}_0x48e8f7=_['merge']({},_0x48e8f7,_0x1bde4f[_0x83ae('0x42')]);var _0x420da2={'where':_0x48e8f7[_0x83ae('0x3d')]};return db['ChatGroup'][_0x83ae('0x24')](_0x420da2)['then'](function(_0x3ef747){_0xd71104[_0x83ae('0x24')]=_0x3ef747;if(_0x1bde4f[_0x83ae('0x35')][_0x83ae('0x43')]){_0x48e8f7[_0x83ae('0x44')]=[{'all':!![]}];}return db['ChatGroup'][_0x83ae('0x45')](_0x48e8f7);})[_0x83ae('0x29')](function(_0x133952){_0xd71104[_0x83ae('0x46')]=_0x133952;return _0xd71104;})[_0x83ae('0x29')](respondWithFilteredResult(_0x5d9fbf,_0x48e8f7))['catch'](handleError(_0x5d9fbf,null));};exports[_0x83ae('0x47')]=function(_0x1274b8,_0x586e96){var _0x26b780={'raw':!![],'where':{'id':_0x1274b8[_0x83ae('0x48')]['id']}},_0x204c98={};_0x204c98[_0x83ae('0x37')]=_[_0x83ae('0x34')](db[_0x83ae('0x49')]['rawAttributes']);_0x204c98[_0x83ae('0x35')]=_['keys'](_0x1274b8[_0x83ae('0x35')]);_0x204c98[_0x83ae('0x3f')]=_[_0x83ae('0x36')](_0x204c98['model'],_0x204c98[_0x83ae('0x35')]);_0x26b780[_0x83ae('0x38')]=_['intersection'](_0x204c98[_0x83ae('0x37')],qs[_0x83ae('0x39')](_0x1274b8['query'][_0x83ae('0x39')]));_0x26b780['attributes']=_0x26b780[_0x83ae('0x38')][_0x83ae('0x4a')]?_0x26b780[_0x83ae('0x38')]:_0x204c98['model'];if(_0x1274b8[_0x83ae('0x35')]['includeAll']){_0x26b780['include']=[{'all':!![]}];}_0x26b780=_[_0x83ae('0x40')]({},_0x26b780,_0x1274b8[_0x83ae('0x42')]);return db[_0x83ae('0x49')][_0x83ae('0x4b')](_0x26b780)[_0x83ae('0x29')](handleEntityNotFound(_0x586e96,null))[_0x83ae('0x29')](respondWithResult(_0x586e96,null))[_0x83ae('0x4c')](handleError(_0x586e96,null));};exports['create']=function(_0x2e0340,_0x587b5a){return db[_0x83ae('0x49')][_0x83ae('0x4d')](_0x2e0340[_0x83ae('0x4e')],{})[_0x83ae('0x29')](respondWithResult(_0x587b5a,0xc9))[_0x83ae('0x4c')](handleError(_0x587b5a,null));};exports[_0x83ae('0x28')]=function(_0x25b74f,_0x179fa7){if(_0x25b74f['body']['id']){delete _0x25b74f[_0x83ae('0x4e')]['id'];}return db[_0x83ae('0x49')]['find']({'where':{'id':_0x25b74f['params']['id']}})['then'](handleEntityNotFound(_0x179fa7,null))[_0x83ae('0x29')](saveUpdates(_0x25b74f[_0x83ae('0x4e')],null))[_0x83ae('0x29')](respondWithResult(_0x179fa7,null))[_0x83ae('0x4c')](handleError(_0x179fa7,null));};exports[_0x83ae('0x2a')]=function(_0x18a696,_0x4d5aee){return db['ChatGroup']['find']({'where':{'id':_0x18a696[_0x83ae('0x48')]['id']}})['then'](handleEntityNotFound(_0x4d5aee,null))['then'](removeEntity(_0x4d5aee,null))[_0x83ae('0x4c')](handleError(_0x4d5aee,null));};exports[_0x83ae('0x4f')]=function(_0x3bb9f2,_0x56a3bc){return db[_0x83ae('0x49')][_0x83ae('0x4f')]()[_0x83ae('0x29')](respondWithResult(_0x56a3bc,null))['catch'](handleError(_0x56a3bc,null));};exports[_0x83ae('0x50')]=function(_0x373db5,_0x51b9a7,_0xf45bcf){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x373db5['params']['id'],'ToId':_0x373db5['user']['id'],'read':![]}})[_0x83ae('0x29')](function(_0x36a864){return{'id':_[_0x83ae('0x51')](_0x373db5[_0x83ae('0x48')]['id']),'count':_0x36a864};})[_0x83ae('0x29')](respondWithResult(_0x51b9a7,null))[_0x83ae('0x4c')](handleError(_0x51b9a7,null));};exports[_0x83ae('0x52')]=function(_0x46a092,_0x30e468,_0x58ca12){return db[_0x83ae('0x49')][_0x83ae('0x4b')]({'where':{'id':_0x46a092[_0x83ae('0x48')]['id']}})[_0x83ae('0x29')](handleEntityNotFound(_0x30e468,null))[_0x83ae('0x29')](function(_0x1aff90){if(_0x1aff90){return _0x1aff90[_0x83ae('0x52')](_0x46a092['body'][_0x83ae('0x53')],_['omit'](_0x46a092[_0x83ae('0x4e')],[_0x83ae('0x53'),'id'])||{});}})[_0x83ae('0x29')](respondWithResult(_0x30e468,null))[_0x83ae('0x4c')](handleError(_0x30e468,null));};exports[_0x83ae('0x54')]=function(_0x3cc65f,_0xf259a5,_0xc1a9a1){var _0xcbc62a={};var _0x588cf1={};var _0x315e6c;var _0x2602bb;return db['ChatGroup']['findOne']({'where':{'id':_0x3cc65f[_0x83ae('0x48')]['id']}})[_0x83ae('0x29')](handleEntityNotFound(_0xf259a5,null))[_0x83ae('0x29')](function(_0x33ef86){if(_0x33ef86){_0x315e6c=_0x33ef86;_0x588cf1[_0x83ae('0x37')]=_[_0x83ae('0x34')](db[_0x83ae('0x55')][_0x83ae('0x31')]);_0x588cf1[_0x83ae('0x35')]=_[_0x83ae('0x34')](_0x3cc65f['query']);_0x588cf1[_0x83ae('0x3f')]=_[_0x83ae('0x36')](_0x588cf1[_0x83ae('0x37')],_0x588cf1[_0x83ae('0x35')]);_0xcbc62a[_0x83ae('0x38')]=_[_0x83ae('0x36')](_0x588cf1[_0x83ae('0x37')],qs[_0x83ae('0x39')](_0x3cc65f[_0x83ae('0x35')][_0x83ae('0x39')]));_0xcbc62a[_0x83ae('0x38')]=_0xcbc62a[_0x83ae('0x38')][_0x83ae('0x4a')]?_0xcbc62a[_0x83ae('0x38')]:_0x588cf1[_0x83ae('0x37')];_0xcbc62a[_0x83ae('0x3b')]=qs[_0x83ae('0x3c')](_0x3cc65f[_0x83ae('0x35')][_0x83ae('0x3c')]);_0xcbc62a[_0x83ae('0x3d')]=qs[_0x83ae('0x3f')](_['pick'](_0x3cc65f[_0x83ae('0x35')],_0x588cf1[_0x83ae('0x3f')]));if(_0x3cc65f['query'][_0x83ae('0x41')]){_0xcbc62a['where']=_[_0x83ae('0x40')](_0xcbc62a[_0x83ae('0x3d')],{'$or':_[_0x83ae('0x33')](_0xcbc62a[_0x83ae('0x38')],function(_0x1bab05){var _0x3aa6b1={};_0x3aa6b1[_0x1bab05]={'$like':'%'+_0x3cc65f[_0x83ae('0x35')][_0x83ae('0x41')]+'%'};return _0x3aa6b1;})});}_0xcbc62a=_[_0x83ae('0x40')]({},_0xcbc62a,_0x3cc65f[_0x83ae('0x42')]);return _0x315e6c[_0x83ae('0x54')](_0xcbc62a);}})[_0x83ae('0x29')](function(_0x10b365){if(_0x10b365){_0x2602bb=_0x10b365[_0x83ae('0x4a')];if(!_0x3cc65f[_0x83ae('0x35')][_0x83ae('0x3a')]('nolimit')){_0xcbc62a[_0x83ae('0x23')]=qs['limit'](_0x3cc65f['query']['limit']);_0xcbc62a[_0x83ae('0x21')]=qs[_0x83ae('0x21')](_0x3cc65f[_0x83ae('0x35')][_0x83ae('0x21')]);}return _0x315e6c[_0x83ae('0x54')](_0xcbc62a);}})['then'](function(_0x821023){if(_0x821023){return _0x821023?{'count':_0x2602bb,'rows':_0x821023}:null;}})[_0x83ae('0x29')](respondWithResult(_0xf259a5,null))[_0x83ae('0x4c')](handleError(_0xf259a5,null));};exports[_0x83ae('0x56')]=function(_0xfda6b7,_0x3e56f8,_0x4fe48c){return db[_0x83ae('0x49')][_0x83ae('0x4b')]({'where':{'id':_0xfda6b7[_0x83ae('0x48')]['id']}})['then'](handleEntityNotFound(_0x3e56f8,null))[_0x83ae('0x29')](function(_0x464f0c){if(_0x464f0c){return _0x464f0c[_0x83ae('0x56')](_0xfda6b7[_0x83ae('0x35')]['ids']);}})[_0x83ae('0x29')](respondWithStatusCode(_0x3e56f8,null))[_0x83ae('0x4c')](handleError(_0x3e56f8,null));};exports[_0x83ae('0x57')]=function(_0x456c70,_0x44c09b,_0x4bc4ef){if(_0x456c70[_0x83ae('0x4e')]['id']){delete _0x456c70['body']['id'];}return db[_0x83ae('0x49')][_0x83ae('0x4b')]({'where':{'id':_0x456c70[_0x83ae('0x48')]['id']}})['then'](handleEntityNotFound(_0x44c09b,null))[_0x83ae('0x29')](function(_0xbb0a22){if(_0xbb0a22){_0x456c70[_0x83ae('0x4e')]['ChatGroupId']=_0xbb0a22['id'];return db[_0x83ae('0x58')]['create'](_0x456c70[_0x83ae('0x4e')]);}})[_0x83ae('0x29')](respondWithResult(_0x44c09b,null))[_0x83ae('0x4c')](handleError(_0x44c09b,null));};exports[_0x83ae('0x59')]=function(_0x174923,_0x28a99f,_0x5bfc26){var _0x57f615={};var _0x56e4d4={};var _0x52964d;var _0x585611;return db[_0x83ae('0x49')][_0x83ae('0x5a')]({'where':{'id':_0x174923[_0x83ae('0x48')]['id']}})[_0x83ae('0x29')](handleEntityNotFound(_0x28a99f,null))[_0x83ae('0x29')](function(_0x3675d1){if(_0x3675d1){_0x52964d=_0x3675d1;_0x56e4d4[_0x83ae('0x37')]=_['keys'](db[_0x83ae('0x58')][_0x83ae('0x31')]);_0x56e4d4[_0x83ae('0x35')]=_['keys'](_0x174923['query']);_0x56e4d4['filters']=_['intersection'](_0x56e4d4[_0x83ae('0x37')],_0x56e4d4[_0x83ae('0x35')]);_0x57f615['attributes']=_[_0x83ae('0x36')](_0x56e4d4['model'],qs[_0x83ae('0x39')](_0x174923[_0x83ae('0x35')]['fields']));_0x57f615[_0x83ae('0x38')]=_0x57f615[_0x83ae('0x38')][_0x83ae('0x4a')]?_0x57f615[_0x83ae('0x38')]:_0x56e4d4[_0x83ae('0x37')];_0x57f615['order']=qs['sort'](_0x174923['query'][_0x83ae('0x3c')]);_0x57f615[_0x83ae('0x3d')]=qs[_0x83ae('0x3f')](_[_0x83ae('0x3e')](_0x174923[_0x83ae('0x35')],_0x56e4d4[_0x83ae('0x3f')]));if(_0x174923['query']['filter']){_0x57f615[_0x83ae('0x3d')]=_['merge'](_0x57f615[_0x83ae('0x3d')],{'$or':_[_0x83ae('0x33')](_0x57f615[_0x83ae('0x38')],function(_0xbe3e6c){var _0x528327={};_0x528327[_0xbe3e6c]={'$like':'%'+_0x174923['query'][_0x83ae('0x41')]+'%'};return _0x528327;})});}if(_0x174923[_0x83ae('0x35')][_0x83ae('0x5b')]){var _0x10e11d=_0x174923[_0x83ae('0x35')][_0x83ae('0x5b')][_0x83ae('0x5c')](',');var _0x2cd4d8={};_0x2cd4d8[_0x10e11d[0x0]]={'$gte':moment(_0x10e11d[0x1])[_0x83ae('0x5d')]('YYYY-MM-DD\x20HH:mm:ss')};_0x57f615[_0x83ae('0x3d')]=_['merge'](_0x57f615[_0x83ae('0x3d')],_0x2cd4d8);}_0x57f615=_['merge']({},_0x57f615,_0x174923[_0x83ae('0x42')]);return _0x52964d['getMessages'](_0x57f615);}})[_0x83ae('0x29')](function(_0x4b74d2){if(_0x4b74d2){_0x585611=_0x4b74d2[_0x83ae('0x4a')];if(!_0x174923[_0x83ae('0x35')][_0x83ae('0x3a')](_0x83ae('0x5e'))){_0x57f615[_0x83ae('0x23')]=qs[_0x83ae('0x23')](_0x174923['query'][_0x83ae('0x23')]);_0x57f615['offset']=qs[_0x83ae('0x21')](_0x174923[_0x83ae('0x35')][_0x83ae('0x21')]);}return _0x52964d[_0x83ae('0x59')](_0x57f615);}})[_0x83ae('0x29')](function(_0x21d2da){if(_0x21d2da){return _0x21d2da?{'count':_0x585611,'rows':_0x21d2da}:null;}})[_0x83ae('0x29')](respondWithResult(_0x28a99f,null))[_0x83ae('0x4c')](handleError(_0x28a99f,null));}; \ No newline at end of file +var _0xe8cb=['hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','ChatGroup','includeAll','include','findAll','rows','params','intersection','catch','create','body','update','find','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','order','removeMembers','addMessage','ChatGroupId','$gte','format','getMessages','eml-format','rimraf','zip-dir','request-promise','mustache','util','sox','to-csv','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','end','error','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length'];(function(_0x1318f8,_0x3a4626){var _0x284b66=function(_0x470f16){while(--_0x470f16){_0x1318f8['push'](_0x1318f8['shift']());}};_0x284b66(++_0x3a4626);}(_0xe8cb,0xde));var _0xbe8c=function(_0x4185cb,_0x123951){_0x4185cb=_0x4185cb-0x0;var _0x4884c3=_0xe8cb[_0x4185cb];return _0x4884c3;};'use strict';var emlformat=require(_0xbe8c('0x0'));var rimraf=require(_0xbe8c('0x1'));var zipdir=require(_0xbe8c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbe8c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbe8c('0x4'));var util=require(_0xbe8c('0x5'));var path=require('path');var sox=require(_0xbe8c('0x6'));var csv=require(_0xbe8c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbe8c('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbe8c('0x9'));var deskjs=require(_0xbe8c('0xa'));var toCsv=require('to-csv');var querystring=require(_0xbe8c('0xb'));var Papa=require('papaparse');var Redis=require(_0xbe8c('0xc'));var authService=require(_0xbe8c('0xd'));var qs=require(_0xbe8c('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe8c('0xf'));var logger=require(_0xbe8c('0x10'))(_0xbe8c('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbe8c('0x12'));var db=require(_0xbe8c('0x13'))['db'];config[_0xbe8c('0x14')]=_[_0xbe8c('0x15')](config[_0xbe8c('0x14')],{'host':_0xbe8c('0x16'),'port':0x18eb});var socket=require(_0xbe8c('0x17'))(new Redis(config[_0xbe8c('0x14')]));require(_0xbe8c('0x18'))[_0xbe8c('0x19')](socket);function respondWithStatusCode(_0x174cee,_0x262dfd){_0x262dfd=_0x262dfd||0xcc;return function(_0x3a950b){if(_0x3a950b){return _0x174cee[_0xbe8c('0x1a')](_0x262dfd);}return _0x174cee[_0xbe8c('0x1b')](_0x262dfd)['end']();};}function respondWithResult(_0x4fabd2,_0x29c696){_0x29c696=_0x29c696||0xc8;return function(_0x1c3c16){if(_0x1c3c16){return _0x4fabd2[_0xbe8c('0x1b')](_0x29c696)[_0xbe8c('0x1c')](_0x1c3c16);}};}function respondWithFilteredResult(_0x1a2c1,_0x280453){return function(_0xe62154){if(_0xe62154){var _0x2163b0=typeof _0x280453[_0xbe8c('0x1d')]===_0xbe8c('0x1e')&&typeof _0x280453['limit']===_0xbe8c('0x1e');var _0x5364b2=_0xe62154['count'];var _0x207300=_0x2163b0?0x0:_0x280453[_0xbe8c('0x1d')];var _0x30f3ef=_0x2163b0?_0xe62154[_0xbe8c('0x1f')]:_0x280453[_0xbe8c('0x1d')]+_0x280453[_0xbe8c('0x20')];var _0x2dcd81;if(_0x30f3ef>=_0x5364b2){_0x30f3ef=_0x5364b2;_0x2dcd81=0xc8;}else{_0x2dcd81=0xce;}_0x1a2c1['status'](_0x2dcd81);return _0x1a2c1[_0xbe8c('0x21')](_0xbe8c('0x22'),_0x207300+'-'+_0x30f3ef+'/'+_0x5364b2)[_0xbe8c('0x1c')](_0xe62154);}return null;};}function patchUpdates(_0x54061b){return function(_0x46af49){try{jsonpatch[_0xbe8c('0x23')](_0x46af49,_0x54061b,!![]);}catch(_0x78afd0){return BPromise[_0xbe8c('0x24')](_0x78afd0);}return _0x46af49['save']();};}function saveUpdates(_0x1c125b,_0x380805){return function(_0x4fa014){if(_0x4fa014){return _0x4fa014['update'](_0x1c125b)[_0xbe8c('0x25')](function(_0x164d8f){return _0x164d8f;});}return null;};}function removeEntity(_0x30736d,_0xaa8ed4){return function(_0x596864){if(_0x596864){return _0x596864[_0xbe8c('0x26')]()[_0xbe8c('0x25')](function(){_0x30736d[_0xbe8c('0x1b')](0xcc)[_0xbe8c('0x27')]();});}};}function handleEntityNotFound(_0x2682b8,_0x174860){return function(_0x3a07a5){if(!_0x3a07a5){_0x2682b8[_0xbe8c('0x1a')](0x194);}return _0x3a07a5;};}function handleError(_0x27d90b,_0x209a41){_0x209a41=_0x209a41||0x1f4;return function(_0x1c703a){logger[_0xbe8c('0x28')](_0x1c703a['stack']);if(_0x1c703a[_0xbe8c('0x29')]){delete _0x1c703a[_0xbe8c('0x29')];}_0x27d90b[_0xbe8c('0x1b')](_0x209a41)['send'](_0x1c703a);};}exports[_0xbe8c('0x2a')]=function(_0x5b91d8,_0x30c701){var _0x483c22={},_0x545141={},_0x2b6cc3={'count':0x0,'rows':[]};var _0x1f4ab1=_[_0xbe8c('0x2b')](db['ChatGroup'][_0xbe8c('0x2c')],function(_0x21dc8e){return{'name':_0x21dc8e[_0xbe8c('0x2d')],'type':_0x21dc8e[_0xbe8c('0x2e')]['key']};});_0x545141[_0xbe8c('0x2f')]=_[_0xbe8c('0x2b')](_0x1f4ab1,_0xbe8c('0x29'));_0x545141[_0xbe8c('0x30')]=_[_0xbe8c('0x31')](_0x5b91d8[_0xbe8c('0x30')]);_0x545141[_0xbe8c('0x32')]=_['intersection'](_0x545141['model'],_0x545141[_0xbe8c('0x30')]);_0x483c22[_0xbe8c('0x33')]=_['intersection'](_0x545141[_0xbe8c('0x2f')],qs[_0xbe8c('0x34')](_0x5b91d8['query'][_0xbe8c('0x34')]));_0x483c22[_0xbe8c('0x33')]=_0x483c22[_0xbe8c('0x33')][_0xbe8c('0x35')]?_0x483c22[_0xbe8c('0x33')]:_0x545141[_0xbe8c('0x2f')];if(!_0x5b91d8[_0xbe8c('0x30')][_0xbe8c('0x36')](_0xbe8c('0x37'))){_0x483c22[_0xbe8c('0x20')]=qs[_0xbe8c('0x20')](_0x5b91d8[_0xbe8c('0x30')][_0xbe8c('0x20')]);_0x483c22['offset']=qs['offset'](_0x5b91d8[_0xbe8c('0x30')][_0xbe8c('0x1d')]);}_0x483c22['order']=qs['sort'](_0x5b91d8[_0xbe8c('0x30')][_0xbe8c('0x38')]);_0x483c22['where']=qs[_0xbe8c('0x32')](_[_0xbe8c('0x39')](_0x5b91d8[_0xbe8c('0x30')],_0x545141[_0xbe8c('0x32')]),_0x1f4ab1);if(_0x5b91d8[_0xbe8c('0x30')][_0xbe8c('0x3a')]){_0x483c22[_0xbe8c('0x3b')]=_[_0xbe8c('0x3c')](_0x483c22[_0xbe8c('0x3b')],{'$or':_[_0xbe8c('0x2b')](_0x1f4ab1,function(_0x31dcb0){if(_0x31dcb0[_0xbe8c('0x2e')]!=='VIRTUAL'){var _0x137f23={};_0x137f23[_0x31dcb0[_0xbe8c('0x29')]]={'$like':'%'+_0x5b91d8['query'][_0xbe8c('0x3a')]+'%'};return _0x137f23;}})});}_0x483c22=_['merge']({},_0x483c22,_0x5b91d8[_0xbe8c('0x3d')]);var _0x20252f={'where':_0x483c22[_0xbe8c('0x3b')]};return db[_0xbe8c('0x3e')][_0xbe8c('0x1f')](_0x20252f)['then'](function(_0x3eca7d){_0x2b6cc3[_0xbe8c('0x1f')]=_0x3eca7d;if(_0x5b91d8[_0xbe8c('0x30')][_0xbe8c('0x3f')]){_0x483c22[_0xbe8c('0x40')]=[{'all':!![]}];}return db['ChatGroup'][_0xbe8c('0x41')](_0x483c22);})[_0xbe8c('0x25')](function(_0x27a53d){_0x2b6cc3[_0xbe8c('0x42')]=_0x27a53d;return _0x2b6cc3;})[_0xbe8c('0x25')](respondWithFilteredResult(_0x30c701,_0x483c22))['catch'](handleError(_0x30c701,null));};exports['show']=function(_0x4d3ffa,_0x7e9384){var _0x59c524={'raw':!![],'where':{'id':_0x4d3ffa[_0xbe8c('0x43')]['id']}},_0x282f79={};_0x282f79[_0xbe8c('0x2f')]=_[_0xbe8c('0x31')](db[_0xbe8c('0x3e')]['rawAttributes']);_0x282f79['query']=_['keys'](_0x4d3ffa[_0xbe8c('0x30')]);_0x282f79[_0xbe8c('0x32')]=_[_0xbe8c('0x44')](_0x282f79['model'],_0x282f79[_0xbe8c('0x30')]);_0x59c524[_0xbe8c('0x33')]=_[_0xbe8c('0x44')](_0x282f79[_0xbe8c('0x2f')],qs[_0xbe8c('0x34')](_0x4d3ffa['query']['fields']));_0x59c524[_0xbe8c('0x33')]=_0x59c524[_0xbe8c('0x33')][_0xbe8c('0x35')]?_0x59c524['attributes']:_0x282f79[_0xbe8c('0x2f')];if(_0x4d3ffa['query'][_0xbe8c('0x3f')]){_0x59c524[_0xbe8c('0x40')]=[{'all':!![]}];}_0x59c524=_[_0xbe8c('0x3c')]({},_0x59c524,_0x4d3ffa[_0xbe8c('0x3d')]);return db['ChatGroup']['find'](_0x59c524)['then'](handleEntityNotFound(_0x7e9384,null))[_0xbe8c('0x25')](respondWithResult(_0x7e9384,null))[_0xbe8c('0x45')](handleError(_0x7e9384,null));};exports[_0xbe8c('0x46')]=function(_0x31fda0,_0x169750){return db[_0xbe8c('0x3e')]['create'](_0x31fda0[_0xbe8c('0x47')],{})[_0xbe8c('0x25')](respondWithResult(_0x169750,0xc9))[_0xbe8c('0x45')](handleError(_0x169750,null));};exports[_0xbe8c('0x48')]=function(_0x2b1952,_0x5e7531){if(_0x2b1952['body']['id']){delete _0x2b1952[_0xbe8c('0x47')]['id'];}return db[_0xbe8c('0x3e')][_0xbe8c('0x49')]({'where':{'id':_0x2b1952[_0xbe8c('0x43')]['id']}})[_0xbe8c('0x25')](handleEntityNotFound(_0x5e7531,null))[_0xbe8c('0x25')](saveUpdates(_0x2b1952[_0xbe8c('0x47')],null))['then'](respondWithResult(_0x5e7531,null))[_0xbe8c('0x45')](handleError(_0x5e7531,null));};exports[_0xbe8c('0x26')]=function(_0x313154,_0x2f69d5){return db[_0xbe8c('0x3e')]['find']({'where':{'id':_0x313154[_0xbe8c('0x43')]['id']}})[_0xbe8c('0x25')](handleEntityNotFound(_0x2f69d5,null))[_0xbe8c('0x25')](removeEntity(_0x2f69d5,null))[_0xbe8c('0x45')](handleError(_0x2f69d5,null));};exports[_0xbe8c('0x4a')]=function(_0x2b4fe9,_0x4f8996){return db[_0xbe8c('0x3e')][_0xbe8c('0x4a')]()[_0xbe8c('0x25')](respondWithResult(_0x4f8996,null))[_0xbe8c('0x45')](handleError(_0x4f8996,null));};exports[_0xbe8c('0x4b')]=function(_0x414216,_0x4a4fe8,_0x1c3ff1){return db[_0xbe8c('0x4c')]['count']({'where':{'ChatGroupId':_0x414216['params']['id'],'ToId':_0x414216[_0xbe8c('0x4d')]['id'],'read':![]}})[_0xbe8c('0x25')](function(_0x1d699e){return{'id':_[_0xbe8c('0x4e')](_0x414216[_0xbe8c('0x43')]['id']),'count':_0x1d699e};})[_0xbe8c('0x25')](respondWithResult(_0x4a4fe8,null))[_0xbe8c('0x45')](handleError(_0x4a4fe8,null));};exports[_0xbe8c('0x4f')]=function(_0x44bf0f,_0x57747d,_0x291c2f){return db[_0xbe8c('0x3e')][_0xbe8c('0x49')]({'where':{'id':_0x44bf0f[_0xbe8c('0x43')]['id']}})[_0xbe8c('0x25')](handleEntityNotFound(_0x57747d,null))['then'](function(_0x13347c){if(_0x13347c){return _0x13347c[_0xbe8c('0x4f')](_0x44bf0f[_0xbe8c('0x47')][_0xbe8c('0x50')],_[_0xbe8c('0x51')](_0x44bf0f[_0xbe8c('0x47')],[_0xbe8c('0x50'),'id'])||{});}})[_0xbe8c('0x25')](respondWithResult(_0x57747d,null))[_0xbe8c('0x45')](handleError(_0x57747d,null));};exports[_0xbe8c('0x52')]=function(_0x4af367,_0x47c374,_0xa51235){var _0x903d48={};var _0x1caffb={};var _0x1ed9b1;var _0x47c367;return db[_0xbe8c('0x3e')][_0xbe8c('0x53')]({'where':{'id':_0x4af367['params']['id']}})[_0xbe8c('0x25')](handleEntityNotFound(_0x47c374,null))[_0xbe8c('0x25')](function(_0x4cb320){if(_0x4cb320){_0x1ed9b1=_0x4cb320;_0x1caffb[_0xbe8c('0x2f')]=_[_0xbe8c('0x31')](db[_0xbe8c('0x54')][_0xbe8c('0x2c')]);_0x1caffb['query']=_[_0xbe8c('0x31')](_0x4af367[_0xbe8c('0x30')]);_0x1caffb[_0xbe8c('0x32')]=_[_0xbe8c('0x44')](_0x1caffb[_0xbe8c('0x2f')],_0x1caffb[_0xbe8c('0x30')]);_0x903d48['attributes']=_[_0xbe8c('0x44')](_0x1caffb[_0xbe8c('0x2f')],qs[_0xbe8c('0x34')](_0x4af367[_0xbe8c('0x30')][_0xbe8c('0x34')]));_0x903d48['attributes']=_0x903d48[_0xbe8c('0x33')][_0xbe8c('0x35')]?_0x903d48[_0xbe8c('0x33')]:_0x1caffb[_0xbe8c('0x2f')];_0x903d48[_0xbe8c('0x55')]=qs[_0xbe8c('0x38')](_0x4af367[_0xbe8c('0x30')][_0xbe8c('0x38')]);_0x903d48[_0xbe8c('0x3b')]=qs[_0xbe8c('0x32')](_[_0xbe8c('0x39')](_0x4af367[_0xbe8c('0x30')],_0x1caffb[_0xbe8c('0x32')]));if(_0x4af367[_0xbe8c('0x30')][_0xbe8c('0x3a')]){_0x903d48[_0xbe8c('0x3b')]=_[_0xbe8c('0x3c')](_0x903d48[_0xbe8c('0x3b')],{'$or':_[_0xbe8c('0x2b')](_0x903d48['attributes'],function(_0x4730ad){var _0x706b1a={};_0x706b1a[_0x4730ad]={'$like':'%'+_0x4af367['query'][_0xbe8c('0x3a')]+'%'};return _0x706b1a;})});}_0x903d48=_['merge']({},_0x903d48,_0x4af367[_0xbe8c('0x3d')]);return _0x1ed9b1[_0xbe8c('0x52')](_0x903d48);}})[_0xbe8c('0x25')](function(_0x88db10){if(_0x88db10){_0x47c367=_0x88db10[_0xbe8c('0x35')];if(!_0x4af367[_0xbe8c('0x30')]['hasOwnProperty'](_0xbe8c('0x37'))){_0x903d48['limit']=qs['limit'](_0x4af367[_0xbe8c('0x30')]['limit']);_0x903d48[_0xbe8c('0x1d')]=qs[_0xbe8c('0x1d')](_0x4af367[_0xbe8c('0x30')][_0xbe8c('0x1d')]);}return _0x1ed9b1[_0xbe8c('0x52')](_0x903d48);}})[_0xbe8c('0x25')](function(_0x15e11d){if(_0x15e11d){return _0x15e11d?{'count':_0x47c367,'rows':_0x15e11d}:null;}})[_0xbe8c('0x25')](respondWithResult(_0x47c374,null))[_0xbe8c('0x45')](handleError(_0x47c374,null));};exports[_0xbe8c('0x56')]=function(_0x3e8647,_0x2b1fc2,_0x42a250){return db[_0xbe8c('0x3e')][_0xbe8c('0x49')]({'where':{'id':_0x3e8647[_0xbe8c('0x43')]['id']}})[_0xbe8c('0x25')](handleEntityNotFound(_0x2b1fc2,null))[_0xbe8c('0x25')](function(_0x1884a4){if(_0x1884a4){return _0x1884a4['removeMembers'](_0x3e8647['query']['ids']);}})['then'](respondWithStatusCode(_0x2b1fc2,null))[_0xbe8c('0x45')](handleError(_0x2b1fc2,null));};exports[_0xbe8c('0x57')]=function(_0x259d90,_0x460cb0,_0x42fc8e){if(_0x259d90[_0xbe8c('0x47')]['id']){delete _0x259d90['body']['id'];}return db[_0xbe8c('0x3e')][_0xbe8c('0x49')]({'where':{'id':_0x259d90[_0xbe8c('0x43')]['id']}})[_0xbe8c('0x25')](handleEntityNotFound(_0x460cb0,null))[_0xbe8c('0x25')](function(_0x2260b2){if(_0x2260b2){_0x259d90[_0xbe8c('0x47')][_0xbe8c('0x58')]=_0x2260b2['id'];return db[_0xbe8c('0x4c')]['create'](_0x259d90['body']);}})[_0xbe8c('0x25')](respondWithResult(_0x460cb0,null))[_0xbe8c('0x45')](handleError(_0x460cb0,null));};exports['getMessages']=function(_0x4db020,_0x45ae11,_0x140772){var _0x488c01={};var _0xf5dab2={};var _0x545bfa;var _0x180969;return db[_0xbe8c('0x3e')][_0xbe8c('0x53')]({'where':{'id':_0x4db020['params']['id']}})[_0xbe8c('0x25')](handleEntityNotFound(_0x45ae11,null))[_0xbe8c('0x25')](function(_0x21892){if(_0x21892){_0x545bfa=_0x21892;_0xf5dab2['model']=_[_0xbe8c('0x31')](db[_0xbe8c('0x4c')][_0xbe8c('0x2c')]);_0xf5dab2['query']=_['keys'](_0x4db020[_0xbe8c('0x30')]);_0xf5dab2[_0xbe8c('0x32')]=_['intersection'](_0xf5dab2[_0xbe8c('0x2f')],_0xf5dab2['query']);_0x488c01[_0xbe8c('0x33')]=_[_0xbe8c('0x44')](_0xf5dab2[_0xbe8c('0x2f')],qs[_0xbe8c('0x34')](_0x4db020[_0xbe8c('0x30')][_0xbe8c('0x34')]));_0x488c01[_0xbe8c('0x33')]=_0x488c01[_0xbe8c('0x33')][_0xbe8c('0x35')]?_0x488c01[_0xbe8c('0x33')]:_0xf5dab2[_0xbe8c('0x2f')];_0x488c01[_0xbe8c('0x55')]=qs[_0xbe8c('0x38')](_0x4db020[_0xbe8c('0x30')]['sort']);_0x488c01[_0xbe8c('0x3b')]=qs[_0xbe8c('0x32')](_[_0xbe8c('0x39')](_0x4db020[_0xbe8c('0x30')],_0xf5dab2[_0xbe8c('0x32')]));if(_0x4db020[_0xbe8c('0x30')][_0xbe8c('0x3a')]){_0x488c01[_0xbe8c('0x3b')]=_[_0xbe8c('0x3c')](_0x488c01[_0xbe8c('0x3b')],{'$or':_[_0xbe8c('0x2b')](_0x488c01['attributes'],function(_0x48c921){var _0x1409f9={};_0x1409f9[_0x48c921]={'$like':'%'+_0x4db020[_0xbe8c('0x30')][_0xbe8c('0x3a')]+'%'};return _0x1409f9;})});}if(_0x4db020[_0xbe8c('0x30')]['$gte']){var _0x2b3134=_0x4db020[_0xbe8c('0x30')][_0xbe8c('0x59')]['split'](',');var _0x4cd83d={};_0x4cd83d[_0x2b3134[0x0]]={'$gte':moment(_0x2b3134[0x1])[_0xbe8c('0x5a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x488c01[_0xbe8c('0x3b')]=_[_0xbe8c('0x3c')](_0x488c01[_0xbe8c('0x3b')],_0x4cd83d);}_0x488c01=_[_0xbe8c('0x3c')]({},_0x488c01,_0x4db020[_0xbe8c('0x3d')]);return _0x545bfa[_0xbe8c('0x5b')](_0x488c01);}})[_0xbe8c('0x25')](function(_0xb5ab29){if(_0xb5ab29){_0x180969=_0xb5ab29['length'];if(!_0x4db020['query'][_0xbe8c('0x36')](_0xbe8c('0x37'))){_0x488c01[_0xbe8c('0x20')]=qs[_0xbe8c('0x20')](_0x4db020[_0xbe8c('0x30')]['limit']);_0x488c01['offset']=qs['offset'](_0x4db020[_0xbe8c('0x30')][_0xbe8c('0x1d')]);}return _0x545bfa[_0xbe8c('0x5b')](_0x488c01);}})[_0xbe8c('0x25')](function(_0xf71ef4){if(_0xf71ef4){return _0xf71ef4?{'count':_0x180969,'rows':_0xf71ef4}:null;}})[_0xbe8c('0x25')](respondWithResult(_0x45ae11,null))[_0xbe8c('0x45')](handleError(_0x45ae11,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index ba15369..db2590a 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 _0x5a13=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x3b2fb0,_0x2c3a06){var _0x24af10=function(_0x1e7f76){while(--_0x1e7f76){_0x3b2fb0['push'](_0x3b2fb0['shift']());}};_0x24af10(++_0x2c3a06);}(_0x5a13,0x145));var _0x35a1=function(_0x4d9277,_0x583ba2){_0x4d9277=_0x4d9277-0x0;var _0x3c5126=_0x5a13[_0x4d9277];return _0x3c5126;};'use strict';var EventEmitter=require(_0x35a1('0x0'));var ChatGroup=require(_0x35a1('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x35a1('0x2')](0x0);var events={'afterCreate':_0x35a1('0x3'),'afterUpdate':_0x35a1('0x4'),'afterDestroy':_0x35a1('0x5')};function emitEvent(_0x135bd){return function(_0xcbad2f,_0x233e91,_0x57d474){ChatGroupEvents[_0x35a1('0x6')](_0x135bd+':'+_0xcbad2f['id'],_0xcbad2f);ChatGroupEvents[_0x35a1('0x6')](_0x135bd,_0xcbad2f);_0x57d474(null);};}for(var e in events){if(events[_0x35a1('0x7')](e)){var event=events[e];ChatGroup[_0x35a1('0x8')](e,emitEvent(event));}}module[_0x35a1('0x9')]=ChatGroupEvents; \ No newline at end of file +var _0x2323=['exports','events','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x539724,_0x555dd1){var _0x51b522=function(_0x2aa9c4){while(--_0x2aa9c4){_0x539724['push'](_0x539724['shift']());}};_0x51b522(++_0x555dd1);}(_0x2323,0x7f));var _0x3232=function(_0x58c9ce,_0x375cd1){_0x58c9ce=_0x58c9ce-0x0;var _0x59e23b=_0x2323[_0x58c9ce];return _0x59e23b;};'use strict';var EventEmitter=require(_0x3232('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x3232('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x3232('0x2')](0x0);var events={'afterCreate':_0x3232('0x3'),'afterUpdate':_0x3232('0x4'),'afterDestroy':_0x3232('0x5')};function emitEvent(_0x37dd1a){return function(_0x476485,_0x3663da,_0x55d0ad){ChatGroupEvents[_0x3232('0x6')](_0x37dd1a+':'+_0x476485['id'],_0x476485);ChatGroupEvents[_0x3232('0x6')](_0x37dd1a,_0x476485);_0x55d0ad(null);};}for(var e in events){if(events[_0x3232('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x3232('0x8')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index dad3c71..55d2eac 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 _0xb2de=['moment','path','../../config/environment','./chatGroup.attributes','define','ChatGroup'];(function(_0x1db269,_0x4a3871){var _0x36d0cd=function(_0x2becb9){while(--_0x2becb9){_0x1db269['push'](_0x1db269['shift']());}};_0x36d0cd(++_0x4a3871);}(_0xb2de,0x14a));var _0xeb2d=function(_0x267fe1,_0x115b5f){_0x267fe1=_0x267fe1-0x0;var _0x39b67a=_0xb2de[_0x267fe1];return _0x39b67a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xeb2d('0x0'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb2d('0x1'));var rimraf=require('rimraf');var config=require(_0xeb2d('0x2'));var attributes=require(_0xeb2d('0x3'));module['exports']=function(_0x8ec31d,_0x58b93f){return _0x8ec31d[_0xeb2d('0x4')](_0xeb2d('0x5'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad9d=['define','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatGroup.attributes'];(function(_0x532ab7,_0x35a7be){var _0xa84ea=function(_0x359844){while(--_0x359844){_0x532ab7['push'](_0x532ab7['shift']());}};_0xa84ea(++_0x35a7be);}(_0xad9d,0x12d));var _0xdad9=function(_0x5ec6bb,_0x120d78){_0x5ec6bb=_0x5ec6bb-0x0;var _0x18d622=_0xad9d[_0x5ec6bb];return _0x18d622;};'use strict';var _=require(_0xdad9('0x0'));var util=require(_0xdad9('0x1'));var logger=require(_0xdad9('0x2'))(_0xdad9('0x3'));var moment=require('moment');var BPromise=require(_0xdad9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdad9('0x5'));var rimraf=require(_0xdad9('0x6'));var config=require(_0xdad9('0x7'));var attributes=require(_0xdad9('0x8'));module['exports']=function(_0x5444cd,_0x239457){return _0x5444cd[_0xdad9('0x9')]('ChatGroup',attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index f225611..5ce0fff 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 _0x9f60=['request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','then','ChatGroup,\x20%s,\x20%s'];(function(_0x8dc04d,_0xaa7559){var _0x2f5f28=function(_0xdd2d1d){while(--_0xdd2d1d){_0x8dc04d['push'](_0x8dc04d['shift']());}};_0x2f5f28(++_0xaa7559);}(_0x9f60,0x1ae));var _0x09f6=function(_0x5ac976,_0x25888b){_0x5ac976=_0x5ac976-0x0;var _0xf23e4c=_0x9f60[_0x5ac976];return _0xf23e4c;};'use strict';var _=require(_0x09f6('0x0'));var util=require('util');var moment=require(_0x09f6('0x1'));var BPromise=require(_0x09f6('0x2'));var rs=require(_0x09f6('0x3'));var fs=require('fs');var Redis=require(_0x09f6('0x4'));var db=require(_0x09f6('0x5'))['db'];var utils=require(_0x09f6('0x6'));var logger=require(_0x09f6('0x7'))('rpc');var config=require(_0x09f6('0x8'));var jayson=require(_0x09f6('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x09f6('0xa')](config[_0x09f6('0xb')],{'host':_0x09f6('0xc'),'port':0x18eb});var socket=require(_0x09f6('0xd'))(new Redis(config[_0x09f6('0xb')]));require(_0x09f6('0xe'))[_0x09f6('0xf')](socket);function respondWithRpcPromise(_0x2e1bb3,_0x5b5038,_0x14d079){return new BPromise(function(_0x978b31,_0x1e10e2){return client['request'](_0x2e1bb3,_0x14d079)[_0x09f6('0x10')](function(_0x3a9988){logger['info'](_0x09f6('0x11'),_0x5b5038,_0x09f6('0x12'));logger[_0x09f6('0x13')](_0x09f6('0x14'),_0x5b5038,_0x09f6('0x12'),JSON[_0x09f6('0x15')](_0x3a9988));if(_0x3a9988[_0x09f6('0x16')]){if(_0x3a9988[_0x09f6('0x16')][_0x09f6('0x17')]===0x1f4){logger[_0x09f6('0x16')]('ChatGroup,\x20%s,\x20%s',_0x5b5038,_0x3a9988[_0x09f6('0x16')][_0x09f6('0x18')]);return _0x1e10e2(_0x3a9988['error'][_0x09f6('0x18')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x5b5038,_0x3a9988[_0x09f6('0x16')][_0x09f6('0x18')]);return _0x978b31(_0x3a9988['error'][_0x09f6('0x18')]);}else{logger[_0x09f6('0x19')]('ChatGroup,\x20%s,\x20%s',_0x5b5038,_0x09f6('0x12'));_0x978b31(_0x3a9988[_0x09f6('0x1a')][_0x09f6('0x18')]);}})[_0x09f6('0x1b')](function(_0x1ab9f6){logger['error']('ChatGroup,\x20%s,\x20%s',_0x5b5038,_0x1ab9f6);_0x1e10e2(_0x1ab9f6);});});} \ No newline at end of file +var _0x41f2=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x44ac18,_0x8036a1){var _0x289db9=function(_0x3ec63e){while(--_0x3ec63e){_0x44ac18['push'](_0x44ac18['shift']());}};_0x289db9(++_0x8036a1);}(_0x41f2,0x14f));var _0x241f=function(_0x868ad,_0x86b626){_0x868ad=_0x868ad-0x0;var _0x1f93e0=_0x41f2[_0x868ad];return _0x1f93e0;};'use strict';var _=require(_0x241f('0x0'));var util=require(_0x241f('0x1'));var moment=require('moment');var BPromise=require(_0x241f('0x2'));var rs=require(_0x241f('0x3'));var fs=require('fs');var Redis=require(_0x241f('0x4'));var db=require(_0x241f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x241f('0x6'))(_0x241f('0x7'));var config=require('../../config/environment');var jayson=require(_0x241f('0x8'));var client=jayson[_0x241f('0x9')][_0x241f('0xa')]({'port':0x232a});config[_0x241f('0xb')]=_[_0x241f('0xc')](config['redis'],{'host':_0x241f('0xd'),'port':0x18eb});var socket=require(_0x241f('0xe'))(new Redis(config['redis']));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x307b1f,_0x481686,_0x171efa){return new BPromise(function(_0x497212,_0xdabda7){return client['request'](_0x307b1f,_0x171efa)[_0x241f('0xf')](function(_0x4ce752){logger[_0x241f('0x10')](_0x241f('0x11'),_0x481686,_0x241f('0x12'));logger['debug'](_0x241f('0x13'),_0x481686,_0x241f('0x12'),JSON[_0x241f('0x14')](_0x4ce752));if(_0x4ce752[_0x241f('0x15')]){if(_0x4ce752['error'][_0x241f('0x16')]===0x1f4){logger['error'](_0x241f('0x11'),_0x481686,_0x4ce752[_0x241f('0x15')]['message']);return _0xdabda7(_0x4ce752[_0x241f('0x15')][_0x241f('0x17')]);}logger[_0x241f('0x15')](_0x241f('0x11'),_0x481686,_0x4ce752['error'][_0x241f('0x17')]);return _0x497212(_0x4ce752[_0x241f('0x15')]['message']);}else{logger[_0x241f('0x10')]('ChatGroup,\x20%s,\x20%s',_0x481686,_0x241f('0x12'));_0x497212(_0x4ce752[_0x241f('0x18')]['message']);}})[_0x241f('0x19')](function(_0x76f461){logger['error']('ChatGroup,\x20%s,\x20%s',_0x481686,_0x76f461);_0xdabda7(_0x76f461);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index e32a2c0..1d1f7a2 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 _0x0816=['emit','removeListener','length','chatGroup:','./chatGroup.events','save','remove'];(function(_0x104ed9,_0x14fdd7){var _0x2639ab=function(_0x354401){while(--_0x354401){_0x104ed9['push'](_0x104ed9['shift']());}};_0x2639ab(++_0x14fdd7);}(_0x0816,0xe4));var _0x6081=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x0816[_0x2235bf];return _0x4c3a64;};'use strict';var ChatGroupEvents=require(_0x6081('0x0'));var events=[_0x6081('0x1'),_0x6081('0x2'),'update'];function createListener(_0x4b9995,_0x147339){return function(_0x2f5cbe){_0x147339[_0x6081('0x3')](_0x4b9995,_0x2f5cbe);};}function removeListener(_0x34f75a,_0x2e1c84){return function(){ChatGroupEvents[_0x6081('0x4')](_0x34f75a,_0x2e1c84);};}exports['register']=function(_0x3c0975){for(var _0x140b69=0x0,_0x455e93=events[_0x6081('0x5')];_0x140b69<_0x455e93;_0x140b69++){var _0x115e1b=events[_0x140b69];var _0xdc7319=createListener(_0x6081('0x6')+_0x115e1b,_0x3c0975);ChatGroupEvents['on'](_0x115e1b,_0xdc7319);}}; \ No newline at end of file +var _0x2587=['chatGroup:','./chatGroup.events','save','update','emit','removeListener','register'];(function(_0x210718,_0x247b55){var _0x541bfc=function(_0x5dbcad){while(--_0x5dbcad){_0x210718['push'](_0x210718['shift']());}};_0x541bfc(++_0x247b55);}(_0x2587,0x1c8));var _0x7258=function(_0x487131,_0x2c86e8){_0x487131=_0x487131-0x0;var _0xf320ff=_0x2587[_0x487131];return _0xf320ff;};'use strict';var ChatGroupEvents=require(_0x7258('0x0'));var events=[_0x7258('0x1'),'remove',_0x7258('0x2')];function createListener(_0x580023,_0x57012b){return function(_0x3017ef){_0x57012b[_0x7258('0x3')](_0x580023,_0x3017ef);};}function removeListener(_0x302fdd,_0x188de9){return function(){ChatGroupEvents[_0x7258('0x4')](_0x302fdd,_0x188de9);};}exports[_0x7258('0x5')]=function(_0x37db63){for(var _0x22af3a=0x0,_0x274ac5=events['length'];_0x22af3a<_0x274ac5;_0x22af3a++){var _0x37b491=events[_0x22af3a];var _0x10dd4f=createListener(_0x7258('0x6')+_0x37b491,_0x37db63);ChatGroupEvents['on'](_0x37b491,_0x10dd4f);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 452c3b2..d1ede5a 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 _0x95b2=['removeMembers','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getUnread','getMembers','/:id/messages','post','create','addMembers','addMessage','put','destroy','delete','/:id/members'];(function(_0x2835db,_0x12e852){var _0x5df667=function(_0x3d14aa){while(--_0x3d14aa){_0x2835db['push'](_0x2835db['shift']());}};_0x5df667(++_0x12e852);}(_0x95b2,0x11a));var _0x295b=function(_0x341d58,_0x526ba2){_0x341d58=_0x341d58-0x0;var _0xce2267=_0x95b2[_0x341d58];return _0xce2267;};'use strict';var multer=require(_0x295b('0x0'));var util=require(_0x295b('0x1'));var path=require(_0x295b('0x2'));var timeout=require('connect-timeout');var express=require(_0x295b('0x3'));var router=express['Router']();var fs_extra=require(_0x295b('0x4'));var auth=require(_0x295b('0x5'));var interaction=require(_0x295b('0x6'));var config=require('../../config/environment');var controller=require(_0x295b('0x7'));router[_0x295b('0x8')]('/',auth[_0x295b('0x9')](),controller[_0x295b('0xa')]);router[_0x295b('0x8')](_0x295b('0xb'),auth[_0x295b('0x9')](),controller[_0x295b('0xc')]);router['get'](_0x295b('0xd'),auth['isAuthenticated'](),controller[_0x295b('0xe')]);router[_0x295b('0x8')]('/:id/unread',auth['isAuthenticated'](),controller[_0x295b('0xf')]);router[_0x295b('0x8')]('/:id/members',auth[_0x295b('0x9')](),controller[_0x295b('0x10')]);router[_0x295b('0x8')](_0x295b('0x11'),auth[_0x295b('0x9')](),controller['getMessages']);router[_0x295b('0x12')]('/',auth['isAuthenticated'](),controller[_0x295b('0x13')]);router[_0x295b('0x12')]('/:id/members',auth['isAuthenticated'](),controller[_0x295b('0x14')]);router[_0x295b('0x12')](_0x295b('0x11'),auth[_0x295b('0x9')](),controller[_0x295b('0x15')]);router[_0x295b('0x16')](_0x295b('0xd'),auth[_0x295b('0x9')](),controller['update']);router['delete'](_0x295b('0xd'),auth[_0x295b('0x9')](),controller[_0x295b('0x17')]);router[_0x295b('0x18')](_0x295b('0x19'),auth[_0x295b('0x9')](),controller[_0x295b('0x1a')]);module[_0x295b('0x1b')]=router; \ No newline at end of file +var _0x3e7e=['index','get','/describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','post','create','/:id/messages','put','delete','removeMembers','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated'];(function(_0x2a5fdd,_0xa280fe){var _0x59f368=function(_0xbc12de){while(--_0xbc12de){_0x2a5fdd['push'](_0x2a5fdd['shift']());}};_0x59f368(++_0xa280fe);}(_0x3e7e,0xe9));var _0xe3e7=function(_0x297007,_0x1219a0){_0x297007=_0x297007-0x0;var _0x573981=_0x3e7e[_0x297007];return _0x573981;};'use strict';var multer=require(_0xe3e7('0x0'));var util=require(_0xe3e7('0x1'));var path=require(_0xe3e7('0x2'));var timeout=require(_0xe3e7('0x3'));var express=require(_0xe3e7('0x4'));var router=express['Router']();var fs_extra=require(_0xe3e7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe3e7('0x6'));var config=require(_0xe3e7('0x7'));var controller=require(_0xe3e7('0x8'));router['get']('/',auth[_0xe3e7('0x9')](),controller[_0xe3e7('0xa')]);router[_0xe3e7('0xb')](_0xe3e7('0xc'),auth[_0xe3e7('0x9')](),controller['describe']);router[_0xe3e7('0xb')](_0xe3e7('0xd'),auth[_0xe3e7('0x9')](),controller[_0xe3e7('0xe')]);router[_0xe3e7('0xb')](_0xe3e7('0xf'),auth['isAuthenticated'](),controller[_0xe3e7('0x10')]);router[_0xe3e7('0xb')](_0xe3e7('0x11'),auth[_0xe3e7('0x9')](),controller[_0xe3e7('0x12')]);router[_0xe3e7('0xb')]('/:id/messages',auth[_0xe3e7('0x9')](),controller[_0xe3e7('0x13')]);router[_0xe3e7('0x14')]('/',auth[_0xe3e7('0x9')](),controller[_0xe3e7('0x15')]);router[_0xe3e7('0x14')](_0xe3e7('0x11'),auth['isAuthenticated'](),controller['addMembers']);router[_0xe3e7('0x14')](_0xe3e7('0x16'),auth['isAuthenticated'](),controller['addMessage']);router[_0xe3e7('0x17')](_0xe3e7('0xd'),auth[_0xe3e7('0x9')](),controller['update']);router[_0xe3e7('0x18')](_0xe3e7('0xd'),auth[_0xe3e7('0x9')](),controller['destroy']);router[_0xe3e7('0x18')](_0xe3e7('0x11'),auth['isAuthenticated'](),controller[_0xe3e7('0x19')]);module[_0xe3e7('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 43eb50e..348cb89 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 _0x9532=['INTEGER','ENUM','star','TEXT','STRING','long','DATE','out','sequelize','exports','BOOLEAN'];(function(_0x26c9a0,_0xf32296){var _0x4f9403=function(_0x44b4da){while(--_0x44b4da){_0x26c9a0['push'](_0x26c9a0['shift']());}};_0x4f9403(++_0xf32296);}(_0x9532,0x8c));var _0x2953=function(_0x16365f,_0x4bf858){_0x16365f=_0x16365f-0x0;var _0x545bcc=_0x9532[_0x16365f];return _0x545bcc;};'use strict';var Sequelize=require(_0x2953('0x0'));module[_0x2953('0x1')]={'closed':{'type':Sequelize[_0x2953('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2953('0x3')]},'ratingType':{'type':Sequelize[_0x2953('0x4')](_0x2953('0x5'),'thumb'),'defaultValue':_0x2953('0x5')},'ratingMessage':{'type':Sequelize[_0x2953('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x2953('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x2953('0x7')]},'secondDisposition':{'type':Sequelize[_0x2953('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x2953('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x2953('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x2953('0x7')]},'deviceType':{'type':Sequelize[_0x2953('0x7')]},'referer':{'type':Sequelize[_0x2953('0x6')]},'customerIp':{'type':Sequelize[_0x2953('0x7')]},'formData':{'type':Sequelize['TEXT'](_0x2953('0x8'))},'read1stAt':{'type':Sequelize[_0x2953('0x9')]},'lastMsgAt':{'type':Sequelize[_0x2953('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x2953('0x4')]('in',_0x2953('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x2953('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x2953('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x83e1=['star','TEXT','STRING','DATE','ENUM','out','sequelize','exports','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x83e1,0x1ad));var _0x183e=function(_0x51b665,_0x39ba8e){_0x51b665=_0x51b665-0x0;var _0x5bef86=_0x83e1[_0x51b665];return _0x5bef86;};'use strict';var Sequelize=require(_0x183e('0x0'));module[_0x183e('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x183e('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x183e('0x3'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x183e('0x4')]},'pathTranscript':{'type':Sequelize[_0x183e('0x4')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x183e('0x5')]},'thirdDisposition':{'type':Sequelize[_0x183e('0x5')]},'note':{'type':Sequelize[_0x183e('0x5')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x183e('0x5')]},'osName':{'type':Sequelize[_0x183e('0x5')]},'osVersion':{'type':Sequelize[_0x183e('0x5')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x183e('0x5')]},'deviceType':{'type':Sequelize[_0x183e('0x5')]},'referer':{'type':Sequelize[_0x183e('0x4')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x183e('0x4')]('long')},'read1stAt':{'type':Sequelize[_0x183e('0x6')]},'lastMsgAt':{'type':Sequelize[_0x183e('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x183e('0x7')]('in',_0x183e('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x183e('0x5')]},'customerPort':{'type':Sequelize[_0x183e('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x183e('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 8c9d82e..1943656 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 _0x5f66=['email','isNull','vidaooNote','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','disposition','file','originalname','filename','Attachment','attachmentDownload','closed','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','%s%d','agentAlias','System','customer','agentIdentifier','agent_alias','alias','agent_fullname','createdAt','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','filter','findAll','getMyMessages','includeAgent','addTags','setTags','spread','emit','removeTags','unix','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','Account','Owner','get','mkdirSync','Chat','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','renderFile','views','transcript-','.pdf','log','err','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','request\x20sent','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','name','merge','agent','interaction','account','map','fullname','TagIds','Tags','split','forEach','push','index','ChatInteraction','fieldName','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','select','field','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','u.id\x20=\x20ui.UserId','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','length','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','union','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','keys','some','compact','ChatWebsiteId','where','i.ChatWebsiteId\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','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','isEmpty','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','toString','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','show','params','includeAll','include','options','create','body','destroy','describe','createVidaooSession','ChatWebsite','findOne','vidaooEscalation','vidaooTopic','vidaooApiKey','https://api-vidaoo.xcally.com/api/v1/meetings'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_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 pdf=require(_0x65f6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x65f6('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x65f6('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x65f6('0x14'))['db'];config['redis']=_[_0x65f6('0x15')](config[_0x65f6('0x16')],{'host':_0x65f6('0x17'),'port':0x18eb});var socket=require(_0x65f6('0x18'))(new Redis(config[_0x65f6('0x16')]));require(_0x65f6('0x19'))[_0x65f6('0x1a')](socket);var jayson=require(_0x65f6('0x1b'));var client=jayson[_0x65f6('0x1c')][_0x65f6('0x1d')]({'port':0x232b});var client9004=jayson['client'][_0x65f6('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x49a913,_0x5dd324,_0x1693e6,_0x5c69f8){return new BPromise(function(_0x37330d,_0x1c955c){var _0x1b1cbb=_0x5c69f8||client;return _0x1b1cbb[_0x65f6('0x1e')](_0x49a913,_0x1693e6)[_0x65f6('0x1f')](function(_0x18380e){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x5dd324,_0x65f6('0x20'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x5dd324,'request\x20sent',JSON[_0x65f6('0x21')](_0x18380e));if(_0x18380e[_0x65f6('0x22')]){if(_0x18380e['error'][_0x65f6('0x23')]===0x1f4){logger[_0x65f6('0x22')](_0x65f6('0x24'),_0x5dd324,_0x18380e[_0x65f6('0x22')][_0x65f6('0x25')]);return _0x1c955c(_0x18380e[_0x65f6('0x22')]['message']);}logger[_0x65f6('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x5dd324,_0x18380e['error'][_0x65f6('0x25')]);return _0x37330d(_0x18380e[_0x65f6('0x22')]['message']);}else{logger[_0x65f6('0x26')](_0x65f6('0x24'),_0x5dd324,_0x65f6('0x20'));_0x37330d(_0x18380e[_0x65f6('0x27')]['message']);}})[_0x65f6('0x28')](function(_0x59ea32){logger[_0x65f6('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x5dd324,_0x59ea32);_0x1c955c(_0x59ea32);});});}function respondWithStatusCode(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0xcc;return function(_0x29abdb){if(_0x29abdb){return _0x5cb131[_0x65f6('0x29')](_0x4fde2f);}return _0x5cb131['status'](_0x4fde2f)[_0x65f6('0x2a')]();};}function respondWithResult(_0x28f710,_0x52277c){_0x52277c=_0x52277c||0xc8;return function(_0x325cb4){if(_0x325cb4){return _0x28f710[_0x65f6('0x2b')](_0x52277c)[_0x65f6('0x2c')](_0x325cb4);}};}function respondWithFilteredResult(_0x559330,_0x4ac04b){return function(_0x488d36){if(_0x488d36){var _0x266cfe=typeof _0x4ac04b[_0x65f6('0x2d')]===_0x65f6('0x2e')&&typeof _0x4ac04b[_0x65f6('0x2f')]===_0x65f6('0x2e');var _0x14a387=_0x488d36[_0x65f6('0x30')];var _0x4ace4c=_0x266cfe?0x0:_0x4ac04b['offset'];var _0x154cbd=_0x266cfe?_0x488d36[_0x65f6('0x30')]:_0x4ac04b['offset']+_0x4ac04b['limit'];var _0x10b368;if(_0x154cbd>=_0x14a387){_0x154cbd=_0x14a387;_0x10b368=0xc8;}else{_0x10b368=0xce;}_0x559330[_0x65f6('0x2b')](_0x10b368);return _0x559330[_0x65f6('0x31')](_0x65f6('0x32'),_0x4ace4c+'-'+_0x154cbd+'/'+_0x14a387)[_0x65f6('0x2c')](_0x488d36);}return null;};}function patchUpdates(_0x2d32be){return function(_0x5792a0){try{jsonpatch[_0x65f6('0x33')](_0x5792a0,_0x2d32be,!![]);}catch(_0x38f3c6){return BPromise[_0x65f6('0x34')](_0x38f3c6);}return _0x5792a0['save']();};}function saveUpdates(_0x217f35,_0x2a7aa8){return function(_0xbaed3c){if(_0xbaed3c){return _0xbaed3c[_0x65f6('0x35')](_0x217f35)[_0x65f6('0x1f')](function(_0x2f054c){return _0x2f054c;});}return null;};}function removeEntity(_0x4d4d84,_0x3c7c58){return function(_0x1b24ea){if(_0x1b24ea){return _0x1b24ea['destroy']()[_0x65f6('0x1f')](function(){_0x4d4d84['status'](0xcc)[_0x65f6('0x2a')]();});}};}function handleEntityNotFound(_0x50494b,_0x2b9fb6){return function(_0x24f7fd){if(!_0x24f7fd){_0x50494b['sendStatus'](0x194);}return _0x24f7fd;};}function handleError(_0x12dee6,_0x13e41a){_0x13e41a=_0x13e41a||0x1f4;return function(_0x3b261d){logger['error'](_0x3b261d['stack']);if(_0x3b261d[_0x65f6('0x36')]){delete _0x3b261d['name'];}_0x12dee6[_0x65f6('0x2b')](_0x13e41a)['send'](_0x3b261d);};}function getMustacheRender(_0x22d760,_0x2b9675){return Mustache['render'](_0x22d760,_[_0x65f6('0x37')](_0x2b9675['body'],{'contact':_0x2b9675['contact'],'message':_0x2b9675[_0x65f6('0x25')],'agent':_0x2b9675[_0x65f6('0x38')],'interaction':_0x2b9675[_0x65f6('0x39')],'account':_0x2b9675[_0x65f6('0x3a')]}))||'';}function getInteractionUsers(_0xbe54fe,_0x28845a){return new BPromise(function(_0x1a55da,_0x1153f1){try{if(_0x28845a[_0xbe54fe['id']]){_0xbe54fe['Users']=_[_0x65f6('0x3b')](_0x28845a[_0xbe54fe['id']],function(_0x49d8ee){return{'id':_0x49d8ee['id'],'fullname':_0x49d8ee[_0x65f6('0x3c')]};});}}catch(_0xa4394a){_0x1153f1(_0xa4394a);}_0x1a55da(_0xbe54fe);});}function getInteractionTags(_0x4ba7db,_0x2ea7f7){return new BPromise(function(_0x5ef5c2,_0x32148f){try{if(_0x4ba7db[_0x65f6('0x3d')]){_0x4ba7db[_0x65f6('0x3e')]=[];_0x4ba7db[_0x65f6('0x3d')][_0x65f6('0x3f')](',')[_0x65f6('0x40')](function(_0xed4c96){_0x4ba7db[_0x65f6('0x3e')][_0x65f6('0x41')](_0x2ea7f7[_0xed4c96]);});}delete _0x4ba7db['TagIds'];}catch(_0x170d3e){_0x32148f(_0x170d3e);}_0x5ef5c2(_0x4ba7db);});}function updateChatInteraction(_0x400ed2,_0x377ae5,_0x181798){return new BPromise(function(_0x83e2d9,_0x1ac040){return getInteractionUsers(_0x400ed2,_0x181798)[_0x65f6('0x1f')](function(_0x2e91e8){return getInteractionTags(_0x2e91e8,_0x377ae5);})[_0x65f6('0x1f')](function(_0x2abbed){_0x83e2d9(_0x2abbed);})[_0x65f6('0x28')](function(_0x2c008a){_0x1ac040(_0x2c008a);});});}exports[_0x65f6('0x42')]=function(_0x27157d,_0xb1a132){var _0x2cb38d={},_0x5119ee={},_0x2dd16c={'count':0x0,'rows':[]};var _0x37cd36=_[_0x65f6('0x3b')](db[_0x65f6('0x43')]['rawAttributes'],function(_0x1bf5bf){return{'name':_0x1bf5bf[_0x65f6('0x44')],'type':_0x1bf5bf[_0x65f6('0x45')]['key']};});_0x5119ee[_0x65f6('0x46')]=_[_0x65f6('0x3b')](_0x37cd36,_0x65f6('0x36'));_0x5119ee[_0x65f6('0x47')]=_['keys'](_0x27157d[_0x65f6('0x47')]);_0x5119ee['filters']=_[_0x65f6('0x48')](_0x5119ee[_0x65f6('0x46')],_0x5119ee['query']);_0x2cb38d[_0x65f6('0x49')]=_['intersection'](_0x5119ee[_0x65f6('0x46')],qs[_0x65f6('0x4a')](_0x27157d[_0x65f6('0x47')][_0x65f6('0x4a')]));_0x2cb38d[_0x65f6('0x49')]=_0x2cb38d[_0x65f6('0x49')]['length']?_0x2cb38d['attributes']:_0x5119ee[_0x65f6('0x46')];if(!_0x27157d[_0x65f6('0x47')][_0x65f6('0x4b')](_0x65f6('0x4c'))){_0x2cb38d[_0x65f6('0x2f')]=qs[_0x65f6('0x2f')](_0x27157d[_0x65f6('0x47')][_0x65f6('0x2f')]);_0x2cb38d[_0x65f6('0x2d')]=qs['offset'](_0x27157d[_0x65f6('0x47')][_0x65f6('0x2d')]);}_0x2cb38d[_0x65f6('0x4d')]=qs['sort'](_0x27157d[_0x65f6('0x47')][_0x65f6('0x4e')]);_0x2cb38d['where']=qs[_0x65f6('0x4f')](_[_0x65f6('0x50')](_0x27157d['query'],_0x5119ee[_0x65f6('0x4f')]),_0x37cd36);var _0x4f96c4=[];var _0x247be3=squel[_0x65f6('0x51')]()[_0x65f6('0x52')]('id')['field'](_0x65f6('0x36'))[_0x65f6('0x52')]('color')[_0x65f6('0x53')](_0x65f6('0x54'));var _0x48a2ed=squel[_0x65f6('0x51')]()[_0x65f6('0x52')](_0x65f6('0x55'))[_0x65f6('0x52')](_0x65f6('0x56'))[_0x65f6('0x52')](_0x65f6('0x57'))[_0x65f6('0x53')]('user_has_chat_interactions','ui')['left_join']('users','u',_0x65f6('0x58'));var _0x2091f1=squel[_0x65f6('0x51')]()[_0x65f6('0x53')]('chat_interactions','i')[_0x65f6('0x59')](_0x65f6('0x5a'),'c',_0x65f6('0x5b'))['left_join'](_0x65f6('0x5c'),'o',_0x65f6('0x5d'))[_0x65f6('0x59')]('chat_websites','a','a.id\x20=\x20i.ChatWebsiteId')[_0x65f6('0x59')](_0x65f6('0x5e'),'me',_0x65f6('0x5f'))[_0x65f6('0x59')](_0x65f6('0x60'),'it',_0x65f6('0x61'))[_0x65f6('0x59')](_0x65f6('0x54'),'t',_0x65f6('0x62'));var _0xddbd90=squel[_0x65f6('0x63')]();var _0x141fcc=[];var _0x30adee=squel[_0x65f6('0x63')]();var _0x5ba9c6;if(_0x27157d[_0x65f6('0x47')][_0x65f6('0x64')]){_0x5ba9c6=as[_0x65f6('0x65')](_0x27157d['query'][_0x65f6('0x64')]);var _0x16dec0=_0x5ba9c6[_0x65f6('0x66')];for(var _0x3096b8=0x0;_0x3096b8<_0x5ba9c6['conditions'][_0x65f6('0x67')];_0x3096b8++){var _0x4227f5=_0x5ba9c6[_0x65f6('0x68')][_0x3096b8];var _0x3e0d8b='i';var _0x553ff0=_[_0x65f6('0x69')](_0x37cd36,[_0x65f6('0x36'),_0x4227f5['field']]);if(!_0x553ff0){switch(_0x4227f5[_0x65f6('0x52')]){case _0x65f6('0x6a'):if(_0x4227f5[_0x65f6('0x6b')]==0x1){_0x2091f1['having']('`'+_0x4227f5[_0x65f6('0x52')]+_0x65f6('0x6c'));}else{_0x2091f1[_0x65f6('0x6d')]('`'+_0x4227f5[_0x65f6('0x52')]+_0x65f6('0x6e'));}break;case _0x65f6('0x6f'):if(_0x4227f5['operator']==='$substring'){if(_0x4227f5['value'][_0x65f6('0x3f')]('\x20')[_0x65f6('0x67')]>0x1){_0xddbd90[_0x16dec0](_0x65f6('0x70'),qs[_0x65f6('0x71')](_0x4227f5[_0x65f6('0x6b')]),null);}else{var _0x304cf9='%'+_0x4227f5['value']+'%';_0xddbd90[_0x16dec0](_0x65f6('0x72'),_0x304cf9,_0x304cf9,_0x304cf9);}}else{_0x553ff0=_[_0x65f6('0x69')](_0x37cd36,['name',_0x65f6('0x73')]);_0x4227f5[_0x65f6('0x52')]=_0x65f6('0x73');_0xf69bf6=as['buildExpression'](_0x3e0d8b,_0x553ff0[_0x65f6('0x45')],_0x4227f5);_0xddbd90[_0x16dec0](_0xf69bf6[_0x65f6('0x74')],_0xf69bf6['value'][_0x65f6('0x75')],_0xf69bf6[_0x65f6('0x6b')][_0x65f6('0x2a')]);}break;case _0x65f6('0x76'):var _0x3d55f7=_0x4227f5[_0x65f6('0x6b')][_0x65f6('0x3f')](',')['map'](function(_0x4e5e94){return Number(_0x4e5e94);});_0x3d55f7[_0x65f6('0x40')](function(_0x3da139){_0x30adee['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3da139+',%');});_0x141fcc=_[_0x65f6('0x77')](_0x141fcc,_0x3d55f7);break;case'User':if(_0x4227f5[_0x65f6('0x78')]==='$substring'){_0xddbd90[_0x16dec0](_0x65f6('0x79'),'%'+_0x4227f5[_0x65f6('0x6b')]+'%',null);}else{_0x553ff0=_[_0x65f6('0x69')](_0x37cd36,[_0x65f6('0x36'),_0x65f6('0x7a')]);_0x4227f5[_0x65f6('0x52')]=_0x65f6('0x7a');_0xf69bf6=as[_0x65f6('0x7b')](_0x3e0d8b,_0x553ff0[_0x65f6('0x45')],_0x4227f5);_0xddbd90[_0x16dec0](_0xf69bf6['text'],_0xf69bf6['value'][_0x65f6('0x75')],_0xf69bf6[_0x65f6('0x6b')][_0x65f6('0x2a')]);}break;case'body':_0xf69bf6=as['buildExpression']('me',null,_0x4227f5);_0xddbd90[_0x16dec0](_0xf69bf6[_0x65f6('0x74')],_0xf69bf6[_0x65f6('0x6b')][_0x65f6('0x75')],_0xf69bf6[_0x65f6('0x6b')][_0x65f6('0x2a')]);break;}}else{var _0xf69bf6=as['buildExpression'](_0x3e0d8b,_0x553ff0['type'],_0x4227f5);_0xddbd90[_0x16dec0](_0xf69bf6[_0x65f6('0x74')],_0xf69bf6[_0x65f6('0x6b')]['start'],_0xf69bf6[_0x65f6('0x6b')]['end']);}}}else{var _0x254e9f=_(_0x27157d[_0x65f6('0x47')])[_0x65f6('0x7c')]()[_0x65f6('0x3b')](function(_0x558888){return _[_0x65f6('0x7d')](_0x37cd36,[_0x65f6('0x36'),_0x558888])?_0x558888:undefined;})[_0x65f6('0x7e')]()['value']();if(!_['isEmpty'](_0x254e9f)){_0x254e9f[_0x65f6('0x40')](function(_0x583a01){if(_0x583a01===_0x65f6('0x7f')){_0x2091f1[_0x65f6('0x80')](_0x65f6('0x81'),[][_0x65f6('0x82')](_0x27157d['query'][_0x583a01]));}else if(_0x583a01==='createdAt'){var _0x56f7f1=JSON[_0x65f6('0x83')](_0x27157d[_0x65f6('0x47')][_0x583a01])[_0x65f6('0x84')];var _0x57464e=JSON[_0x65f6('0x83')](_0x27157d[_0x65f6('0x47')][_0x583a01])[_0x65f6('0x85')];_0x2091f1['where'](_0x65f6('0x86'),_0x56f7f1,_0x57464e);}else{if(_0x27157d[_0x65f6('0x47')][_0x583a01]==='null'){_0x2091f1[_0x65f6('0x80')]('i.'+_0x583a01+_0x65f6('0x87'));}else{_0x2091f1['where']('i.'+_0x583a01+_0x65f6('0x88'),_0x27157d['query'][_0x583a01]);}}});}if(_0x27157d[_0x65f6('0x47')]['read']){if(_0x27157d[_0x65f6('0x47')][_0x65f6('0x89')]==0x1){_0x2091f1['having'](_0x65f6('0x8a'));}else{_0x2091f1[_0x65f6('0x6d')](_0x65f6('0x8b'));}}if(_0x27157d[_0x65f6('0x47')][_0x65f6('0x8c')]){_0x141fcc=_[_0x65f6('0x8d')](_0x27157d[_0x65f6('0x47')][_0x65f6('0x8c')])?_0x27157d[_0x65f6('0x47')][_0x65f6('0x8c')]:new Array(_0x27157d[_0x65f6('0x47')]['tag']);_0x141fcc[_0x65f6('0x40')](function(_0x1cf1bd){_0x30adee['or'](_0x65f6('0x8e'),'%,'+_0x1cf1bd+',%');});}if(_0x27157d[_0x65f6('0x47')]['filter']){var _0x453080=_0x27157d[_0x65f6('0x47')]['filter'][_0x65f6('0x8f')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x65f6('0x90')](_0x453080)){_0xddbd90['or']('i.id\x20LIKE\x20?',_0x453080+'%');}else{_0xddbd90['or'](_0x65f6('0x91'),qs[_0x65f6('0x71')](_0x453080))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x453080+'%');}}}_0x2091f1['where'](_0xddbd90);_0x2091f1[_0x65f6('0x92')](_0x65f6('0x93'));var _0x5158c9={'type':db[_0x65f6('0x94')][_0x65f6('0x95')][_0x65f6('0x96')],'raw':!![]};var _0x4edba0=_0x2091f1[_0x65f6('0x97')]();_0x4edba0[_0x65f6('0x52')]('i.id');_0x4edba0[_0x65f6('0x52')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x65f6('0x6a'));if(_0x2cb38d['order']){_0x2cb38d['order'][_0x65f6('0x40')](function(_0x1cf4ed){var _0x199d63=_0x1cf4ed[0x0]===_0x65f6('0x98')?_0x1cf4ed[0x0]:'i.'+_0x1cf4ed[0x0];_0x2091f1[_0x65f6('0x4d')](_0x199d63,_0x1cf4ed[0x1]===_0x65f6('0x99')?![]:!![]);});}if(!_[_0x65f6('0x9a')](_0x141fcc)){_0x2091f1[_0x65f6('0x6d')](_0x30adee);_0x4edba0['where']('t.id\x20IN\x20?',_0x141fcc);}BPromise[_0x65f6('0x9b')]()['then'](function(){if(!_0x5ba9c6){if(_0x27157d[_0x65f6('0x47')][_0x65f6('0x7f')])return;_0x4edba0[_0x65f6('0x80')](_0x65f6('0x9c'));_0x2091f1[_0x65f6('0x80')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x27157d[_0x65f6('0x9d')][_0x65f6('0x9e')]!==_0x65f6('0x38'))return;return _0x27157d['user'][_0x65f6('0x9f')]({'attributes':['id'],'raw':!![]})[_0x65f6('0x1f')](function(_0x4254c2){if(_[_0x65f6('0x9a')](_0x4254c2)){_0x4edba0[_0x65f6('0x80')](_0x65f6('0xa0'));_0x2091f1['where']('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x4edba0[_0x65f6('0x80')](_0x65f6('0x81'),_[_0x65f6('0x3b')](_0x4254c2,'id'));_0x2091f1[_0x65f6('0x80')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x4254c2,'id'));}});})[_0x65f6('0x1f')](function(){if(_0x27157d[_0x65f6('0x9d')][_0x65f6('0x9e')]===_0x65f6('0x38')&&!_0x5ba9c6&&!_0x27157d[_0x65f6('0x47')][_0x65f6('0x7f')])return[];return db['sequelize']['query'](_0x4edba0['toString'](),_0x5158c9);})[_0x65f6('0x1f')](function(_0x2e63bb){_0x2dd16c[_0x65f6('0x30')]=_0x2e63bb[_0x65f6('0x67')];if(_0x2dd16c['count']===0x0)return[];return db['sequelize'][_0x65f6('0x47')](_0x247be3[_0x65f6('0xa1')](),_0x5158c9)['then'](function(_0x346fa9){_0x4f96c4=_['keyBy'](_0x346fa9,'id');_0x5158c9=_[_0x65f6('0x37')](_0x5158c9,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x27157d[_0x65f6('0x47')][_0x65f6('0x4a')]){_0x2cb38d['attributes'][_0x65f6('0x40')](function(_0x330e18){_0x2091f1[_0x65f6('0x52')]('i.'+_0x330e18);});}else{_0x2091f1[_0x65f6('0x52')](_0x65f6('0xa2'),_0x65f6('0x6a'));_0x2091f1['field'](_0x65f6('0xa3'),'Account.key');_0x2091f1[_0x65f6('0x52')]('a.mandatoryDisposition',_0x65f6('0xa4'));_0x2091f1[_0x65f6('0x52')](_0x65f6('0xa5'),_0x65f6('0x98'));_0x2091f1['field'](_0x65f6('0xa6'));_0x2091f1[_0x65f6('0x52')](_0x65f6('0xa7'),'Contact.firstName');_0x2091f1['field'](_0x65f6('0xa8'),_0x65f6('0xa9'));_0x2091f1['field'](_0x65f6('0xaa'),_0x65f6('0xab'));_0x2091f1[_0x65f6('0x52')]('c.phone',_0x65f6('0xac'));_0x2091f1[_0x65f6('0x52')]('c.mobile',_0x65f6('0xad'));_0x2091f1[_0x65f6('0x52')](_0x65f6('0xae'),'Contact.fax');_0x2091f1[_0x65f6('0x52')](_0x65f6('0xaf'),_0x65f6('0xb0'));_0x2091f1['field'](_0x65f6('0xb1'),'Owner.internal');_0x2091f1[_0x65f6('0x52')](_0x65f6('0xb2'),_0x65f6('0x3d'));}if(_0x2cb38d[_0x65f6('0x2f')])_0x2091f1[_0x65f6('0x2f')](_0x2cb38d[_0x65f6('0x2f')]);if(_0x2cb38d['offset'])_0x2091f1[_0x65f6('0x2d')](_0x2cb38d[_0x65f6('0x2d')]);return db[_0x65f6('0xb3')][_0x65f6('0x47')](_0x2091f1[_0x65f6('0xa1')](),_0x5158c9);})['then'](function(_0x59f421){if(_0x59f421['length']>0x0)_0x48a2ed[_0x65f6('0x80')](_0x65f6('0xb4'),_[_0x65f6('0x3b')](_0x59f421,'id'));return db['sequelize'][_0x65f6('0x47')](_0x48a2ed['toString'](),_0x5158c9)['then'](function(_0x3133f4){var _0x41b58b=_['groupBy'](_0x3133f4,_0x65f6('0xb5'));var _0x3c5053=[];_0x59f421[_0x65f6('0x40')](function(_0x2ba1f7){_0x3c5053[_0x65f6('0x41')](updateChatInteraction(_0x2ba1f7,_0x4f96c4,_0x41b58b));});return BPromise[_0x65f6('0xb6')](_0x3c5053);});});})[_0x65f6('0x1f')](function(_0x3291ac){_0x2dd16c[_0x65f6('0xb7')]=_0x3291ac;return _0x2dd16c;})[_0x65f6('0x1f')](respondWithFilteredResult(_0xb1a132,_0x2cb38d))[_0x65f6('0x28')](handleError(_0xb1a132,null));};exports[_0x65f6('0xb8')]=function(_0x5c9cc0,_0x349af7){var _0x52dc75={'raw':![],'where':{'id':_0x5c9cc0[_0x65f6('0xb9')]['id']}},_0x55355f={};_0x55355f[_0x65f6('0x46')]=_[_0x65f6('0x7c')](db[_0x65f6('0x43')]['rawAttributes']);_0x55355f[_0x65f6('0x47')]=_['keys'](_0x5c9cc0['query']);_0x55355f[_0x65f6('0x4f')]=_[_0x65f6('0x48')](_0x55355f[_0x65f6('0x46')],_0x55355f[_0x65f6('0x47')]);_0x52dc75[_0x65f6('0x49')]=_[_0x65f6('0x48')](_0x55355f['model'],qs[_0x65f6('0x4a')](_0x5c9cc0['query'][_0x65f6('0x4a')]));_0x52dc75[_0x65f6('0x49')]=_0x52dc75[_0x65f6('0x49')]['length']?_0x52dc75[_0x65f6('0x49')]:_0x55355f['model'];if(_0x5c9cc0['query'][_0x65f6('0xba')]){_0x52dc75[_0x65f6('0xbb')]=[{'all':!![]}];}_0x52dc75=_[_0x65f6('0x37')]({},_0x52dc75,_0x5c9cc0[_0x65f6('0xbc')]);return db[_0x65f6('0x43')]['find'](_0x52dc75)[_0x65f6('0x1f')](handleEntityNotFound(_0x349af7,null))[_0x65f6('0x1f')](respondWithResult(_0x349af7,null))[_0x65f6('0x28')](handleError(_0x349af7,null));};exports[_0x65f6('0xbd')]=function(_0x51f1e5,_0x3cd4c1){return db[_0x65f6('0x43')][_0x65f6('0xbd')](_0x51f1e5[_0x65f6('0xbe')],{})[_0x65f6('0x1f')](respondWithResult(_0x3cd4c1,0xc9))[_0x65f6('0x28')](handleError(_0x3cd4c1,null));};exports[_0x65f6('0x35')]=function(_0x8aab06,_0x558410){if(_0x8aab06[_0x65f6('0xbe')]['id']){delete _0x8aab06[_0x65f6('0xbe')]['id'];}return db[_0x65f6('0x43')][_0x65f6('0x69')]({'where':{'id':_0x8aab06[_0x65f6('0xb9')]['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0x558410,null))['then'](saveUpdates(_0x8aab06[_0x65f6('0xbe')],null))[_0x65f6('0x1f')](respondWithResult(_0x558410,null))['catch'](handleError(_0x558410,null));};exports[_0x65f6('0xbf')]=function(_0x547275,_0x24ff7c){return db[_0x65f6('0x43')][_0x65f6('0x69')]({'where':{'id':_0x547275[_0x65f6('0xb9')]['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0x24ff7c,null))['then'](removeEntity(_0x24ff7c,null))[_0x65f6('0x28')](handleError(_0x24ff7c,null));};exports[_0x65f6('0xc0')]=function(_0x2394eb,_0x31870f){return db[_0x65f6('0x43')]['describe']()['then'](respondWithResult(_0x31870f,null))[_0x65f6('0x28')](handleError(_0x31870f,null));};exports[_0x65f6('0xc1')]=function(_0x2993ee,_0x3cf2d9){var _0x4c070f=_0x2993ee['params']['id'];var _0x534004;var _0x42a2f6;var _0x3b0a97;return db[_0x65f6('0x43')]['findOne']({'where':{'id':_0x4c070f}})[_0x65f6('0x1f')](function(_0x3b5592){_0x534004=_0x3b5592;return db[_0x65f6('0xc2')][_0x65f6('0xc3')]({'where':{'id':_0x3b5592[_0x65f6('0x7f')]},'attributes':['id','vidaooApiKey',_0x65f6('0xc4'),_0x65f6('0xc5'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0x65f6('0x1f')](function(_0x173b54){if(_0x173b54&&_0x173b54[_0x65f6('0xc6')]&&_0x173b54[_0x65f6('0xc4')]){_0x42a2f6=_0x173b54;var _0x17bbc9={'interaction':{'id':_0x4c070f},'agent':{'id':_0x2993ee['user']['id'],'name':_0x2993ee[_0x65f6('0x9d')]['name'],'fullname':_0x2993ee[_0x65f6('0x9d')]['fullname'],'email':_0x2993ee[_0x65f6('0x9d')]['email']},'contact':_0x2993ee[_0x65f6('0xbe')]['contact'],'account':_0x2993ee[_0x65f6('0xbe')][_0x65f6('0x3a')]};var _0x494f9c={'rejectUnauthorized':![],'method':'POST','url':_0x65f6('0xc7'),'headers':{'X-APIKEY':_0x173b54[_0x65f6('0xc6')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2993ee[_0x65f6('0x9d')][_0x65f6('0xc8')]],'buttons':null,'topic':_0x42a2f6[_0x65f6('0xc5')],'note':_[_0x65f6('0xc9')](_0x42a2f6[_0x65f6('0xca')])?null:getMustacheRender(_0x42a2f6[_0x65f6('0xca')],_0x17bbc9),'metadata':null},'redirect':_0x65f6('0xcb'),'json':!![]};try{if(!_[_0x65f6('0xc9')](_0x42a2f6[_0x65f6('0xcc')])){var _0x6babec=getMustacheRender(_0x42a2f6[_0x65f6('0xcc')],_0x17bbc9);var _0x42177e=JSON[_0x65f6('0x83')](_0x6babec);_0x494f9c[_0x65f6('0xbe')][_0x65f6('0xcd')]=_0x42177e;}}catch(_0x5efe82){throw new db[(_0x65f6('0x94'))][(_0x65f6('0xce'))](_0x65f6('0xcf'));}return rp(_0x494f9c);}else{throw new db[(_0x65f6('0x94'))][(_0x65f6('0xce'))](_0x65f6('0xd0'));}})[_0x65f6('0x1f')](function(_0x2b3415){_0x3b0a97=_0x2b3415;if(_0x3b0a97['id']){var _0x3c9d49={'body':_0x3b0a97['join_url'],'ChatWebsiteId':_0x42a2f6['id'],'ChatInteractionId':_0x534004['id'],'direction':_0x65f6('0xd1'),'UserId':_0x2993ee[_0x65f6('0x9d')]['id']};return db[_0x65f6('0xd2')][_0x65f6('0xbd')](_0x3c9d49,{});}else{throw new db['Sequelize'][(_0x65f6('0xce'))](_0x65f6('0xd3'));}})['then'](function(){return _0x534004[_0x65f6('0xd4')]({'vidaooSessionId':_0x3b0a97['id']});})[_0x65f6('0x1f')](respondWithResult(_0x3cf2d9,null))[_0x65f6('0x28')](handleError(_0x3cf2d9,null));};exports[_0x65f6('0xd5')]=function(_0x2b89d5,_0x409dd7){if(_0x2b89d5['body']['id']){delete _0x2b89d5[_0x65f6('0xbe')]['id'];}return db[_0x65f6('0x43')][_0x65f6('0x69')]({'where':{'id':_0x2b89d5[_0x65f6('0xb9')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})['then'](handleEntityNotFound(_0x409dd7,null))[_0x65f6('0x1f')](saveUpdates(_0x2b89d5[_0x65f6('0xbe')],null))[_0x65f6('0x1f')](respondWithResult(_0x409dd7,null))[_0x65f6('0x28')](handleError(_0x409dd7,null));};exports[_0x65f6('0xd6')]=function(_0x5515a4,_0x542805,_0x2281d5){if(_0x5515a4[_0x65f6('0xbe')]['id']){delete _0x5515a4[_0x65f6('0xbe')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x5515a4[_0x65f6('0xb9')]['id']}})['then'](function(_0x10a218){if(!_0x10a218){logger[_0x65f6('0x22')](_0x65f6('0xd7'),_0x65f6('0xd6'),0x194,_0x65f6('0xd8'));_0x542805[_0x65f6('0x29')](0x194);}else{if(_0x10a218[_0x65f6('0x7a')]){throw new db[(_0x65f6('0x94'))][(_0x65f6('0xce'))]('Interaction\x20already\x20assigned');}}return _0x10a218;})[_0x65f6('0x1f')](function(_0x129ae0){if(_0x129ae0){return _0x129ae0['update']({'closed':_0x5515a4[_0x65f6('0xbe')]['closed'],'disposition':_0x5515a4[_0x65f6('0xbe')][_0x65f6('0xd9')]})[_0x65f6('0x1f')](function(_0x579d52){return _0x579d52;});}})[_0x65f6('0x1f')](function(_0x5745e8){return respondWithRpcPromise('AbandonInteraction',_0x65f6('0xd6'),_0x5515a4[_0x65f6('0xbe')],client9004);})['then'](respondWithResult(_0x542805,null))[_0x65f6('0x28')](handleError(_0x542805,null));};exports['attachmentUpload']=function(_0x2b8edf,_0x28b9f4,_0x24e7f7){_0x2b8edf[_0x65f6('0xbe')][_0x65f6('0x36')]=_0x2b8edf[_0x65f6('0xda')][_0x65f6('0xdb')];_0x2b8edf[_0x65f6('0xbe')]['basename']=_0x2b8edf[_0x65f6('0xda')][_0x65f6('0xdc')];_0x2b8edf[_0x65f6('0xbe')][_0x65f6('0x45')]=_0x2b8edf[_0x65f6('0xda')]['mimetype'];return db[_0x65f6('0xdd')]['create'](_0x2b8edf[_0x65f6('0xbe')])['then'](respondWithResult(_0x28b9f4,0xc9))[_0x65f6('0x28')](handleError(_0x28b9f4,null));};exports[_0x65f6('0xde')]=function(_0x83ec2e,_0x3f61c4,_0x230eb9){return db[_0x65f6('0x43')][_0x65f6('0xc3')]({'where':{'id':_0x83ec2e[_0x65f6('0xb9')]['id']},'raw':!![]})[_0x65f6('0x1f')](handleEntityNotFound(_0x3f61c4,null))[_0x65f6('0x1f')](function(_0x72a333){if(_0x72a333){if(_0x72a333[_0x65f6('0xdf')]){return _0x3f61c4[_0x65f6('0x2b')](0x193)[_0x65f6('0x2c')]({'status':0x193,'message':_0x65f6('0xe0')});}return db[_0x65f6('0xdd')][_0x65f6('0xc3')]({'where':{'id':_0x83ec2e['query'][_0x65f6('0xe1')]},'raw':!![]})['then'](handleEntityNotFound(_0x3f61c4,null));}})[_0x65f6('0x1f')](function(_0x34f1cf){if(_0x34f1cf){var _0x431691=_0x34f1cf[_0x65f6('0xe2')]!==null;var _0x17f1f6=path[_0x65f6('0xe3')](config['root'],_0x65f6('0xe4'));if(_0x431691){_0x17f1f6=path[_0x65f6('0xe3')](_0x17f1f6,_0x65f6('0xe5'));}var _0x359734=path[_0x65f6('0xe3')](_0x17f1f6,_0x34f1cf[_0x65f6('0xe6')]);return _0x3f61c4[_0x65f6('0xe7')](_0x359734);}})[_0x65f6('0x28')](handleError(_0x3f61c4,null));};exports[_0x65f6('0xe8')]=function(_0x53da3a,_0x33831f){var _0x4ecd83=null;var _0x5e4778=null;var _0x4427bf=null;var _0x927c22=null;if(_0x53da3a[_0x65f6('0xbe')]['id']){delete _0x53da3a[_0x65f6('0xbe')]['id'];}if(_0x53da3a[_0x65f6('0xbe')][_0x65f6('0xe9')]){_0x927c22=path[_0x65f6('0xe3')](config['root'],_0x65f6('0xea'),util[_0x65f6('0xeb')](_0x65f6('0xec'),Date[_0x65f6('0xed')]()));_0x53da3a[_0x65f6('0xbe')][_0x65f6('0xee')]=_0x927c22;}return db[_0x65f6('0x43')][_0x65f6('0x69')]({'where':{'id':_0x53da3a[_0x65f6('0xb9')]['id']},'include':[{'model':db[_0x65f6('0xd2')],'as':_0x65f6('0xef'),'include':[{'model':db[_0x65f6('0xf0')],'as':_0x65f6('0xf0')}]}]})['then'](handleEntityNotFound(_0x33831f,null))['then'](saveUpdates(_0x53da3a['body'],null))[_0x65f6('0x1f')](function(_0x3edd09){if(_0x3edd09){_0x4ecd83=_0x3edd09;return db[_0x65f6('0xc2')]['find']({'where':{'id':_0x4ecd83[_0x65f6('0x7f')]}});}})[_0x65f6('0x1f')](function(_0x10d421){if(_0x10d421){_0x4427bf=_0x10d421;return db['CmContact'][_0x65f6('0x69')]({'where':{'id':_0x4ecd83[_0x65f6('0x73')]}});}})['then'](function(_0x346aa3){if(_0x346aa3){_0x5e4778=_0x346aa3;if(_0x927c22){var _0x1f4a0d=null;for(var _0x3369b6=0x1;_0x3369b6<_0x4ecd83['Messages'][_0x65f6('0x67')];++_0x3369b6){_0x1f4a0d=_0x4ecd83[_0x65f6('0xef')][_0x3369b6];var _0x29656f=_0x1f4a0d[_0x65f6('0x7a')]?util[_0x65f6('0xeb')](_0x65f6('0xf1'),_0x4427bf[_0x65f6('0xf2')],_0x1f4a0d[_0x65f6('0x7a')]):_0x65f6('0xf3');var _0x128304=_0x53da3a['body'][_0x65f6('0xf4')]||util[_0x65f6('0xeb')](_0x65f6('0xf1'),'Visitor',_0x1f4a0d['ContactId']);switch(_0x4427bf[_0x65f6('0xf5')]){case'website_alias':_0x29656f=_0x1f4a0d[_0x65f6('0x7a')]?util[_0x65f6('0xeb')](_0x65f6('0xf1'),_0x4427bf[_0x65f6('0xf2')],_0x1f4a0d[_0x65f6('0x7a')]):'System';break;case _0x65f6('0xf6'):_0x29656f=_0x1f4a0d[_0x65f6('0x7a')]?_0x1f4a0d[_0x65f6('0xf0')][_0x65f6('0xf7')]||_0x1f4a0d['User'][_0x65f6('0x3c')]:_0x65f6('0xf3');break;case _0x65f6('0xf8'):_0x29656f=_0x1f4a0d[_0x65f6('0x7a')]?_0x1f4a0d[_0x65f6('0xf0')][_0x65f6('0x3c')]:_0x65f6('0xf3');break;default:_0x29656f=_0x1f4a0d[_0x65f6('0x7a')]?util[_0x65f6('0xeb')](_0x65f6('0xf1'),_0x4427bf[_0x65f6('0xf2')],_0x1f4a0d[_0x65f6('0x7a')]):_0x65f6('0xf3');}var _0x31e87d=util[_0x65f6('0xeb')]('[%s]\x20%s:\x20%s\x0a',moment(_0x1f4a0d[_0x65f6('0xf9')])[_0x65f6('0xeb')]('MM/DD/YYYY\x20HH:mm:ss'),_0x1f4a0d['direction']==='in'?_0x128304:_0x29656f,_0x1f4a0d[_0x65f6('0xbe')]);if(!_0x1f4a0d[_0x65f6('0xfa')]){fs[_0x65f6('0xfb')](_0x927c22,_0x31e87d);}}return db[_0x65f6('0xfc')][_0x65f6('0xc3')]({'where':{'service':!![]},'include':[{'model':db[_0x65f6('0xfd')],'as':_0x65f6('0xfe'),'raw':!![]}]});}}})['then'](function(_0x2922b9){if(_0x2922b9&&_0x2922b9['Smtp']&&_0x53da3a['body']){var _0x35062f={'tls':{'rejectUnauthorized':![]}};if(_0x2922b9[_0x65f6('0xfe')][_0x65f6('0xff')]){_0x35062f[_0x65f6('0xff')]=_0x2922b9['Smtp']['service'];}else{_0x35062f[_0x65f6('0x100')]=_0x2922b9[_0x65f6('0xfe')]['host'];_0x35062f['port']=_0x2922b9['Smtp'][_0x65f6('0x101')];_0x35062f[_0x65f6('0x102')]=_0x2922b9[_0x65f6('0xfe')][_0x65f6('0x102')];}if(_0x2922b9[_0x65f6('0xfe')]['authentication']){_0x35062f['auth']={'user':_0x2922b9[_0x65f6('0xfe')][_0x65f6('0x9d')],'pass':_0x2922b9[_0x65f6('0xfe')]['pass']};}return respondWithRpcPromise('SendMail',_0x65f6('0x103'),{'account':_0x35062f,'message':{'from':util[_0x65f6('0xeb')]('\x22%s\x22\x20<%s>',_0x2922b9[_0x65f6('0x36')],_0x2922b9[_0x65f6('0xc8')]||_0x2922b9['Smtp'][_0x65f6('0x9d')]),'to':_0x53da3a['body'][_0x65f6('0xe9')],'subject':_0x65f6('0x104'),'text':util[_0x65f6('0xeb')](_0x65f6('0x105'),_0x53da3a[_0x65f6('0xbe')][_0x65f6('0xe9')]),'attachments':[{'path':_0x927c22}]}})['then'](function(){return _0x4ecd83;})[_0x65f6('0x28')](function(_0x31f4ae){console['error'](_0x31f4ae);});}else{return _0x4ecd83;}})[_0x65f6('0x1f')](respondWithStatusCode(_0x33831f,0xc8))[_0x65f6('0x28')](handleError(_0x33831f,null));};exports[_0x65f6('0x106')]=function(_0x4b2f42,_0x491533,_0x322df1){return db[_0x65f6('0xd2')][_0x65f6('0x69')]({'where':{'id':_0x4b2f42[_0x65f6('0xb9')]['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0x491533,null))[_0x65f6('0x1f')](function(_0x5e4078){if(_0x5e4078){return _0x5e4078['addMessage'](_0x4b2f42[_0x65f6('0xbe')][_0x65f6('0x107')],_[_0x65f6('0x108')](_0x4b2f42[_0x65f6('0xbe')],[_0x65f6('0x107'),'id'])||{});}})[_0x65f6('0x1f')](respondWithResult(_0x491533,null))[_0x65f6('0x28')](handleError(_0x491533,null));};exports[_0x65f6('0x109')]=function(_0x201edb,_0x42c4b8,_0x169632){var _0x32f5d5={'raw':![],'where':{}};var _0x594789={};var _0x624c21={'count':0x0,'rows':[]};return db[_0x65f6('0x43')][_0x65f6('0xc3')]({'where':{'id':_0x201edb[_0x65f6('0xb9')]['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0x42c4b8,null))[_0x65f6('0x1f')](function(_0xd00f2f){if(_0xd00f2f){_0x594789[_0x65f6('0x46')]=_[_0x65f6('0x7c')](db[_0x65f6('0xd2')]['rawAttributes']);_0x594789[_0x65f6('0x47')]=_[_0x65f6('0x7c')](_0x201edb[_0x65f6('0x47')]);_0x594789['filters']=_[_0x65f6('0x48')](_0x594789[_0x65f6('0x46')],_0x594789[_0x65f6('0x47')]);_0x32f5d5['attributes']=_['intersection'](_0x594789[_0x65f6('0x46')],qs[_0x65f6('0x4a')](_0x201edb[_0x65f6('0x47')][_0x65f6('0x4a')]));_0x32f5d5[_0x65f6('0x49')]=_0x32f5d5[_0x65f6('0x49')][_0x65f6('0x67')]?_0x32f5d5[_0x65f6('0x49')]:_0x594789[_0x65f6('0x46')];if(!_0x201edb[_0x65f6('0x47')][_0x65f6('0x4b')](_0x65f6('0x4c'))){_0x32f5d5[_0x65f6('0x2f')]=qs[_0x65f6('0x2f')](_0x201edb[_0x65f6('0x47')][_0x65f6('0x2f')]);_0x32f5d5[_0x65f6('0x2d')]=qs[_0x65f6('0x2d')](_0x201edb['query'][_0x65f6('0x2d')]);}_0x32f5d5[_0x65f6('0x4d')]=qs[_0x65f6('0x4e')](_0x201edb[_0x65f6('0x47')]['sort']);_0x32f5d5[_0x65f6('0x80')]=qs['filters'](_[_0x65f6('0x50')](_0x201edb[_0x65f6('0x47')],_0x594789[_0x65f6('0x4f')]));_0x32f5d5[_0x65f6('0x80')][_0x65f6('0xb5')]=_0xd00f2f['id'];if(_0x201edb['query'][_0x65f6('0x10a')]){_0x32f5d5['where']=_['merge'](_0x32f5d5['where'],{'$or':_[_0x65f6('0x3b')](_0x32f5d5['attributes'],function(_0x28caab){var _0x3db2fd={};_0x3db2fd[_0x28caab]={'$like':'%'+_0x201edb[_0x65f6('0x47')][_0x65f6('0x10a')]+'%'};return _0x3db2fd;})});}if(_0x201edb[_0x65f6('0x47')][_0x65f6('0x84')]){var _0x18461c=_0x201edb[_0x65f6('0x47')]['$gte']['split'](',');var _0x13af41={};_0x13af41[_0x18461c[0x0]]={'$gte':moment(_0x18461c[0x1])[_0x65f6('0xeb')]('YYYY-MM-DD\x20HH:mm:ss')};_0x32f5d5[_0x65f6('0x80')]=_['merge'](_0x32f5d5['where'],_0x13af41);}_0x32f5d5=_[_0x65f6('0x37')]({},_0x32f5d5,_0x201edb[_0x65f6('0xbc')]);return db[_0x65f6('0xd2')][_0x65f6('0x30')]({'where':_0x32f5d5[_0x65f6('0x80')]})['then'](function(_0x1bc75c){_0x624c21['count']=_0x1bc75c;if(_0x201edb[_0x65f6('0x47')]['includeAll']){_0x32f5d5['include']=[{'all':!![]}];}return db[_0x65f6('0xd2')][_0x65f6('0x10b')](_0x32f5d5);})[_0x65f6('0x1f')](function(_0x27e5fa){_0x624c21[_0x65f6('0xb7')]=_0x27e5fa;return _0x624c21;});}})[_0x65f6('0x1f')](respondWithFilteredResult(_0x42c4b8,_0x32f5d5))[_0x65f6('0x28')](handleError(_0x42c4b8,null));};exports[_0x65f6('0x10c')]=function(_0x504520,_0xe8f14f,_0x494de7){var _0x13e006={'where':{}},_0x186cf6={},_0x21ce60={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x65f6('0xc3')]({'where':{'id':_0x504520[_0x65f6('0xb9')]['id']}})['then'](handleEntityNotFound(_0xe8f14f,null))[_0x65f6('0x1f')](function(_0x3e1f7c){if(_0x3e1f7c){_0x186cf6[_0x65f6('0x46')]=_[_0x65f6('0x7c')](db[_0x65f6('0xd2')]['rawAttributes']);_0x186cf6[_0x65f6('0x47')]=_[_0x65f6('0x7c')](_0x504520[_0x65f6('0x47')]);_0x186cf6['filters']=_['intersection'](_0x186cf6[_0x65f6('0x46')],_0x186cf6[_0x65f6('0x47')]);_0x13e006[_0x65f6('0x49')]=_[_0x65f6('0x48')](_0x186cf6[_0x65f6('0x46')],qs['fields'](_0x504520['query']['fields']));_0x13e006[_0x65f6('0x49')]=_0x13e006[_0x65f6('0x49')]['length']?_0x13e006['attributes']:_0x186cf6['model'];if(!_0x504520[_0x65f6('0x47')][_0x65f6('0x4b')](_0x65f6('0x4c'))){_0x13e006[_0x65f6('0x2f')]=qs[_0x65f6('0x2f')](_0x504520[_0x65f6('0x47')][_0x65f6('0x2f')]);_0x13e006[_0x65f6('0x2d')]=qs[_0x65f6('0x2d')](_0x504520[_0x65f6('0x47')][_0x65f6('0x2d')]);}_0x13e006[_0x65f6('0x4d')]=qs[_0x65f6('0x4e')](_0x504520[_0x65f6('0x47')][_0x65f6('0x4e')]);_0x13e006['where']=qs[_0x65f6('0x4f')](_[_0x65f6('0x50')](_0x504520[_0x65f6('0x47')],_0x186cf6[_0x65f6('0x4f')]));_0x13e006[_0x65f6('0x80')][_0x65f6('0xb5')]=_0x3e1f7c['id'];if(_0x504520['query'][_0x65f6('0x10a')]){_0x13e006[_0x65f6('0x80')]=_['merge'](_0x13e006['where'],{'$or':_[_0x65f6('0x3b')](_0x13e006['attributes'],function(_0x4fd7ca){var _0x343d7b={};_0x343d7b[_0x4fd7ca]={'$like':'%'+_0x504520[_0x65f6('0x47')]['filter']+'%'};return _0x343d7b;})});}_0x13e006[_0x65f6('0x80')][_0x65f6('0xfa')]=![];if(_0x504520['query']['id']){_0x13e006[_0x65f6('0x80')]['id']={'$gt':_0x504520[_0x65f6('0x47')]['id']};}_0x13e006=_[_0x65f6('0x37')]({},_0x13e006,_0x504520[_0x65f6('0xbc')]);return db[_0x65f6('0xd2')][_0x65f6('0x30')]({'where':_0x13e006[_0x65f6('0x80')]})[_0x65f6('0x1f')](function(_0x443f1f){_0x21ce60['count']=_0x443f1f;_0x13e006[_0x65f6('0xbb')]=[];if(_0x504520[_0x65f6('0x47')][_0x65f6('0x10d')]){_0x13e006[_0x65f6('0xbb')][_0x65f6('0x41')]({'model':db[_0x65f6('0xf0')],'as':'User','attributes':['id',_0x65f6('0x3c'),'alias']});}if(_0x504520['query']['includeAll']){_0x13e006[_0x65f6('0xbb')]=[{'all':!![]}];}return db['ChatMessage'][_0x65f6('0x10b')](_0x13e006);})[_0x65f6('0x1f')](function(_0x285cef){_0x21ce60[_0x65f6('0xb7')]=_0x285cef;return _0x21ce60;});}})[_0x65f6('0x1f')](respondWithFilteredResult(_0xe8f14f,_0x13e006))[_0x65f6('0x28')](handleError(_0xe8f14f,null));};exports[_0x65f6('0x10e')]=function(_0x5a4c42,_0x5db63d,_0x352012){return db[_0x65f6('0x43')][_0x65f6('0x69')]({'where':{'id':_0x5a4c42['params']['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0x5db63d,null))['then'](function(_0x1188a2){if(_0x1188a2){return _0x1188a2[_0x65f6('0x10f')](_0x5a4c42[_0x65f6('0xbe')]['ids'],_[_0x65f6('0x108')](_0x5a4c42[_0x65f6('0xbe')],[_0x65f6('0x107'),'id'])||{})[_0x65f6('0x110')](function(){return db['Tag']['findAll']({'attributes':['id',_0x65f6('0x36'),'color'],'where':{'id':_0x5a4c42[_0x65f6('0xbe')]['ids']}});})[_0x65f6('0x1f')](function(_0x38b1ed){socket[_0x65f6('0x111')]('chatInteractionTags:save',{'id':Number(_0x5a4c42[_0x65f6('0xb9')]['id']),'tags':_0x38b1ed||[]});return{'id':Number(_0x5a4c42[_0x65f6('0xb9')]['id']),'tags':_0x38b1ed||[]};});}})[_0x65f6('0x1f')](respondWithResult(_0x5db63d,null))[_0x65f6('0x28')](handleError(_0x5db63d,null));};exports[_0x65f6('0x112')]=function(_0x5fb1fa,_0x19c8d4,_0x4e40d4){return db[_0x65f6('0x43')][_0x65f6('0x69')]({'where':{'id':_0x5fb1fa[_0x65f6('0xb9')]['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0x19c8d4,null))[_0x65f6('0x1f')](function(_0x41da12){if(_0x41da12){return _0x41da12[_0x65f6('0x112')](_0x5fb1fa[_0x65f6('0x47')][_0x65f6('0x107')]);}})['then'](respondWithStatusCode(_0x19c8d4,null))[_0x65f6('0x28')](handleError(_0x19c8d4,null));};exports['download']=function(_0xa3fb44,_0x459924){var _0x286c97=moment()[_0x65f6('0x113')]()[_0x65f6('0xa1')]();var _0x36f46f=path[_0x65f6('0xe3')](config[_0x65f6('0x114')],_0x65f6('0x115'),_0x65f6('0x116'),_0x65f6('0x117'));var _0x38e6ff=path[_0x65f6('0xe3')](config[_0x65f6('0x114')],_0x65f6('0x115'),_0x65f6('0x116'),_0x65f6('0x118'));var _0x560dbb=path[_0x65f6('0xe3')](_0x36f46f,_0x286c97);var _0x2315bc=util['format'](_0x65f6('0x119'),_0xa3fb44[_0x65f6('0xb9')]['id'],_0x286c97);var _0x2eda77=path[_0x65f6('0xe3')](_0x36f46f,_0x2315bc);var _0x2a163e=[];_0x2a163e[_0x65f6('0x41')]({'model':db['User'],'as':'User','attributes':['id',_0x65f6('0x3c')],'raw':!![]});_0x2a163e[_0x65f6('0x41')]({'model':db[_0x65f6('0x11a')],'as':'Contact','attributes':['id',_0x65f6('0x11b'),'lastName'],'raw':!![]});if(_0xa3fb44[_0x65f6('0x47')][_0x65f6('0x118')]){_0x2a163e[_0x65f6('0x41')]({'model':db[_0x65f6('0xdd')],'as':'Attachment','raw':!![]});}var _0x41156f=[{'model':db['ChatMessage'],'as':_0x65f6('0xef'),'attributes':['id',_0x65f6('0xbe'),_0x65f6('0xf9'),'direction',_0x65f6('0xfa'),'read'],'include':_0x2a163e}];_0x41156f['push']({'model':db[_0x65f6('0xc2')],'as':_0x65f6('0x11c'),'attributes':['id',_0x65f6('0x36')]});_0x41156f[_0x65f6('0x41')]({'model':db[_0x65f6('0xf0')],'as':_0x65f6('0x11d'),'attributes':['id',_0x65f6('0x3c')]});return db[_0x65f6('0x43')][_0x65f6('0x69')]({'where':{'id':_0xa3fb44[_0x65f6('0xb9')]['id']},'include':_0x41156f})[_0x65f6('0x1f')](handleEntityNotFound(_0x459924,null))['then'](function(_0x168cac){if(_0x168cac){var _0x5d4415=_0x168cac[_0x65f6('0x11e')]({'plain':!![]});fs[_0x65f6('0x11f')](_0x560dbb);var _0x4943cd={'channel':_0x65f6('0x120'),'account':_0x5d4415[_0x65f6('0x11c')]['name'],'agent':_0x5d4415['Owner']?_0x5d4415[_0x65f6('0x11d')]['fullname']:'N.A.','createdAt':moment(_0x5d4415[_0x65f6('0xf9')])[_0x65f6('0xeb')](_0x65f6('0x121'))[_0x65f6('0xa1')](),'closedAt':_0x5d4415[_0x65f6('0xdf')]?moment(_0x5d4415[_0x65f6('0x122')])[_0x65f6('0xeb')](_0x65f6('0x121'))[_0x65f6('0xa1')]():'','disposition':_0x5d4415['disposition'],'chatInfo':{'browser':_0x5d4415[_0x65f6('0x123')],'os':_0x5d4415[_0x65f6('0x124')],'referer':_0x5d4415['referer'],'customerIp':_0x5d4415[_0x65f6('0x125')],'customerPort':_0x5d4415[_0x65f6('0x126')]?_0x5d4415[_0x65f6('0x126')]:_0x65f6('0x127')},'messages':_(_0x5d4415[_0x65f6('0xef')])[_0x65f6('0x128')]()['filter']({'secret':![]})['map'](function(_0x9d51e3){if(_0x9d51e3[_0x65f6('0xdd')]){var _0x22aac6=path[_0x65f6('0xe3')](_0x38e6ff,_0x9d51e3[_0x65f6('0xdd')]['basename']);if(fs[_0x65f6('0x129')](_0x22aac6)){fs[_0x65f6('0x12a')](_0x22aac6)[_0x65f6('0x12b')](fs[_0x65f6('0x12c')](path[_0x65f6('0xe3')](_0x560dbb,_0x9d51e3[_0x65f6('0xdd')][_0x65f6('0xe6')])));}}return{'date':moment(_0x9d51e3[_0x65f6('0xf9')])[_0x65f6('0xeb')](_0x65f6('0x121'))[_0x65f6('0xa1')](),'sender':_0x9d51e3['direction']===_0x65f6('0xd1')?_0x9d51e3[_0x65f6('0xf0')]?_0x9d51e3['User']['fullname']:_0x65f6('0xf3'):_0x9d51e3[_0x65f6('0x6f')][_0x65f6('0x11b')]+(_0x9d51e3['Contact'][_0x65f6('0x12d')]?'\x20'+_0x9d51e3[_0x65f6('0x6f')][_0x65f6('0x12d')]:''),'body':_0x9d51e3[_0x65f6('0xdd')]?_0x9d51e3[_0x65f6('0xdd')][_0x65f6('0xe6')]:_0x9d51e3[_0x65f6('0xbe')],'direction':_0x9d51e3['direction']===_0x65f6('0xd1')?'A':'C','secret':_0x9d51e3['secret'],'read':_0x9d51e3[_0x65f6('0x89')],'attachment':_0x9d51e3[_0x65f6('0xdd')]};})[_0x65f6('0x6b')]()};return ejs[_0x65f6('0x12e')](path[_0x65f6('0xe3')](config[_0x65f6('0x114')],'server',_0x65f6('0x12f'),'downloadInteraction.ejs'),{'interaction':_0x4943cd})[_0x65f6('0x1f')](function(_0x5081ad){var _0x32829e=path['join'](_0x560dbb,_0x65f6('0x130')+_0x5d4415['id']+'-'+_0x286c97+_0x65f6('0x131'));var _0x3f421f={'path':_0x32829e,'channel':_0x65f6('0x120'),'interactionId':_0x5d4415['id']};return pdf['createPdfFromHTML'](_0x5081ad,_0x3f421f);})[_0x65f6('0x1f')](function(){return new BPromise(function(_0xbf09f6,_0x3d6e08){zipdir(_0x560dbb,{'saveTo':_0x2eda77},function(_0x2c4af8,_0x71483f){if(_0x2c4af8)return _0x3d6e08(_0x2c4af8);return _0xbf09f6(_0x71483f);});})[_0x65f6('0x1f')](function(){return new BPromise(function(_0xd06566,_0x21bf41){rimraf(_0x560dbb,function(_0x538dae){if(_0x538dae)_0x21bf41(_0x538dae);return _0xd06566();});});})['then'](function(){return _0x459924[_0x65f6('0xe7')](_0x2eda77,_0x2315bc,function(_0x121e5b){if(_0x121e5b){console[_0x65f6('0x132')](_0x65f6('0x133'),_0x121e5b);}else{fs['unlinkSync'](_0x2eda77);}});});});}else{return _0x459924[_0x65f6('0x29')](0xc8);}})[_0x65f6('0x28')](handleError(_0x459924,null));}; \ No newline at end of file +var _0x5f66=['email','isNull','vidaooNote','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','disposition','file','originalname','filename','Attachment','attachmentDownload','closed','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','%s%d','agentAlias','System','customer','agentIdentifier','agent_alias','alias','agent_fullname','createdAt','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','filter','findAll','getMyMessages','includeAgent','addTags','setTags','spread','emit','removeTags','unix','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','Account','Owner','get','mkdirSync','Chat','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','renderFile','views','transcript-','.pdf','log','err','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','request\x20sent','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','name','merge','agent','interaction','account','map','fullname','TagIds','Tags','split','forEach','push','index','ChatInteraction','fieldName','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','select','field','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','u.id\x20=\x20ui.UserId','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','length','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','union','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','keys','some','compact','ChatWebsiteId','where','i.ChatWebsiteId\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','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','isEmpty','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','toString','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','show','params','includeAll','include','options','create','body','destroy','describe','createVidaooSession','ChatWebsite','findOne','vidaooEscalation','vidaooTopic','vidaooApiKey','https://api-vidaoo.xcally.com/api/v1/meetings'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5f66[_0x5d4607];return _0x5e4a86;};'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 pdf=require(_0x65f6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x65f6('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x65f6('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x65f6('0x14'))['db'];config['redis']=_[_0x65f6('0x15')](config[_0x65f6('0x16')],{'host':_0x65f6('0x17'),'port':0x18eb});var socket=require(_0x65f6('0x18'))(new Redis(config[_0x65f6('0x16')]));require(_0x65f6('0x19'))[_0x65f6('0x1a')](socket);var jayson=require(_0x65f6('0x1b'));var client=jayson[_0x65f6('0x1c')][_0x65f6('0x1d')]({'port':0x232b});var client9004=jayson['client'][_0x65f6('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x49a913,_0x5dd324,_0x1693e6,_0x5c69f8){return new BPromise(function(_0x37330d,_0x1c955c){var _0x1b1cbb=_0x5c69f8||client;return _0x1b1cbb[_0x65f6('0x1e')](_0x49a913,_0x1693e6)[_0x65f6('0x1f')](function(_0x18380e){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x5dd324,_0x65f6('0x20'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x5dd324,'request\x20sent',JSON[_0x65f6('0x21')](_0x18380e));if(_0x18380e[_0x65f6('0x22')]){if(_0x18380e['error'][_0x65f6('0x23')]===0x1f4){logger[_0x65f6('0x22')](_0x65f6('0x24'),_0x5dd324,_0x18380e[_0x65f6('0x22')][_0x65f6('0x25')]);return _0x1c955c(_0x18380e[_0x65f6('0x22')]['message']);}logger[_0x65f6('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x5dd324,_0x18380e['error'][_0x65f6('0x25')]);return _0x37330d(_0x18380e[_0x65f6('0x22')]['message']);}else{logger[_0x65f6('0x26')](_0x65f6('0x24'),_0x5dd324,_0x65f6('0x20'));_0x37330d(_0x18380e[_0x65f6('0x27')]['message']);}})[_0x65f6('0x28')](function(_0x59ea32){logger[_0x65f6('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x5dd324,_0x59ea32);_0x1c955c(_0x59ea32);});});}function respondWithStatusCode(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0xcc;return function(_0x29abdb){if(_0x29abdb){return _0x5cb131[_0x65f6('0x29')](_0x4fde2f);}return _0x5cb131['status'](_0x4fde2f)[_0x65f6('0x2a')]();};}function respondWithResult(_0x28f710,_0x52277c){_0x52277c=_0x52277c||0xc8;return function(_0x325cb4){if(_0x325cb4){return _0x28f710[_0x65f6('0x2b')](_0x52277c)[_0x65f6('0x2c')](_0x325cb4);}};}function respondWithFilteredResult(_0x559330,_0x4ac04b){return function(_0x488d36){if(_0x488d36){var _0x266cfe=typeof _0x4ac04b[_0x65f6('0x2d')]===_0x65f6('0x2e')&&typeof _0x4ac04b[_0x65f6('0x2f')]===_0x65f6('0x2e');var _0x14a387=_0x488d36[_0x65f6('0x30')];var _0x4ace4c=_0x266cfe?0x0:_0x4ac04b['offset'];var _0x154cbd=_0x266cfe?_0x488d36[_0x65f6('0x30')]:_0x4ac04b['offset']+_0x4ac04b['limit'];var _0x10b368;if(_0x154cbd>=_0x14a387){_0x154cbd=_0x14a387;_0x10b368=0xc8;}else{_0x10b368=0xce;}_0x559330[_0x65f6('0x2b')](_0x10b368);return _0x559330[_0x65f6('0x31')](_0x65f6('0x32'),_0x4ace4c+'-'+_0x154cbd+'/'+_0x14a387)[_0x65f6('0x2c')](_0x488d36);}return null;};}function patchUpdates(_0x2d32be){return function(_0x5792a0){try{jsonpatch[_0x65f6('0x33')](_0x5792a0,_0x2d32be,!![]);}catch(_0x38f3c6){return BPromise[_0x65f6('0x34')](_0x38f3c6);}return _0x5792a0['save']();};}function saveUpdates(_0x217f35,_0x2a7aa8){return function(_0xbaed3c){if(_0xbaed3c){return _0xbaed3c[_0x65f6('0x35')](_0x217f35)[_0x65f6('0x1f')](function(_0x2f054c){return _0x2f054c;});}return null;};}function removeEntity(_0x4d4d84,_0x3c7c58){return function(_0x1b24ea){if(_0x1b24ea){return _0x1b24ea['destroy']()[_0x65f6('0x1f')](function(){_0x4d4d84['status'](0xcc)[_0x65f6('0x2a')]();});}};}function handleEntityNotFound(_0x50494b,_0x2b9fb6){return function(_0x24f7fd){if(!_0x24f7fd){_0x50494b['sendStatus'](0x194);}return _0x24f7fd;};}function handleError(_0x12dee6,_0x13e41a){_0x13e41a=_0x13e41a||0x1f4;return function(_0x3b261d){logger['error'](_0x3b261d['stack']);if(_0x3b261d[_0x65f6('0x36')]){delete _0x3b261d['name'];}_0x12dee6[_0x65f6('0x2b')](_0x13e41a)['send'](_0x3b261d);};}function getMustacheRender(_0x22d760,_0x2b9675){return Mustache['render'](_0x22d760,_[_0x65f6('0x37')](_0x2b9675['body'],{'contact':_0x2b9675['contact'],'message':_0x2b9675[_0x65f6('0x25')],'agent':_0x2b9675[_0x65f6('0x38')],'interaction':_0x2b9675[_0x65f6('0x39')],'account':_0x2b9675[_0x65f6('0x3a')]}))||'';}function getInteractionUsers(_0xbe54fe,_0x28845a){return new BPromise(function(_0x1a55da,_0x1153f1){try{if(_0x28845a[_0xbe54fe['id']]){_0xbe54fe['Users']=_[_0x65f6('0x3b')](_0x28845a[_0xbe54fe['id']],function(_0x49d8ee){return{'id':_0x49d8ee['id'],'fullname':_0x49d8ee[_0x65f6('0x3c')]};});}}catch(_0xa4394a){_0x1153f1(_0xa4394a);}_0x1a55da(_0xbe54fe);});}function getInteractionTags(_0x4ba7db,_0x2ea7f7){return new BPromise(function(_0x5ef5c2,_0x32148f){try{if(_0x4ba7db[_0x65f6('0x3d')]){_0x4ba7db[_0x65f6('0x3e')]=[];_0x4ba7db[_0x65f6('0x3d')][_0x65f6('0x3f')](',')[_0x65f6('0x40')](function(_0xed4c96){_0x4ba7db[_0x65f6('0x3e')][_0x65f6('0x41')](_0x2ea7f7[_0xed4c96]);});}delete _0x4ba7db['TagIds'];}catch(_0x170d3e){_0x32148f(_0x170d3e);}_0x5ef5c2(_0x4ba7db);});}function updateChatInteraction(_0x400ed2,_0x377ae5,_0x181798){return new BPromise(function(_0x83e2d9,_0x1ac040){return getInteractionUsers(_0x400ed2,_0x181798)[_0x65f6('0x1f')](function(_0x2e91e8){return getInteractionTags(_0x2e91e8,_0x377ae5);})[_0x65f6('0x1f')](function(_0x2abbed){_0x83e2d9(_0x2abbed);})[_0x65f6('0x28')](function(_0x2c008a){_0x1ac040(_0x2c008a);});});}exports[_0x65f6('0x42')]=function(_0x27157d,_0xb1a132){var _0x2cb38d={},_0x5119ee={},_0x2dd16c={'count':0x0,'rows':[]};var _0x37cd36=_[_0x65f6('0x3b')](db[_0x65f6('0x43')]['rawAttributes'],function(_0x1bf5bf){return{'name':_0x1bf5bf[_0x65f6('0x44')],'type':_0x1bf5bf[_0x65f6('0x45')]['key']};});_0x5119ee[_0x65f6('0x46')]=_[_0x65f6('0x3b')](_0x37cd36,_0x65f6('0x36'));_0x5119ee[_0x65f6('0x47')]=_['keys'](_0x27157d[_0x65f6('0x47')]);_0x5119ee['filters']=_[_0x65f6('0x48')](_0x5119ee[_0x65f6('0x46')],_0x5119ee['query']);_0x2cb38d[_0x65f6('0x49')]=_['intersection'](_0x5119ee[_0x65f6('0x46')],qs[_0x65f6('0x4a')](_0x27157d[_0x65f6('0x47')][_0x65f6('0x4a')]));_0x2cb38d[_0x65f6('0x49')]=_0x2cb38d[_0x65f6('0x49')]['length']?_0x2cb38d['attributes']:_0x5119ee[_0x65f6('0x46')];if(!_0x27157d[_0x65f6('0x47')][_0x65f6('0x4b')](_0x65f6('0x4c'))){_0x2cb38d[_0x65f6('0x2f')]=qs[_0x65f6('0x2f')](_0x27157d[_0x65f6('0x47')][_0x65f6('0x2f')]);_0x2cb38d[_0x65f6('0x2d')]=qs['offset'](_0x27157d[_0x65f6('0x47')][_0x65f6('0x2d')]);}_0x2cb38d[_0x65f6('0x4d')]=qs['sort'](_0x27157d[_0x65f6('0x47')][_0x65f6('0x4e')]);_0x2cb38d['where']=qs[_0x65f6('0x4f')](_[_0x65f6('0x50')](_0x27157d['query'],_0x5119ee[_0x65f6('0x4f')]),_0x37cd36);var _0x4f96c4=[];var _0x247be3=squel[_0x65f6('0x51')]()[_0x65f6('0x52')]('id')['field'](_0x65f6('0x36'))[_0x65f6('0x52')]('color')[_0x65f6('0x53')](_0x65f6('0x54'));var _0x48a2ed=squel[_0x65f6('0x51')]()[_0x65f6('0x52')](_0x65f6('0x55'))[_0x65f6('0x52')](_0x65f6('0x56'))[_0x65f6('0x52')](_0x65f6('0x57'))[_0x65f6('0x53')]('user_has_chat_interactions','ui')['left_join']('users','u',_0x65f6('0x58'));var _0x2091f1=squel[_0x65f6('0x51')]()[_0x65f6('0x53')]('chat_interactions','i')[_0x65f6('0x59')](_0x65f6('0x5a'),'c',_0x65f6('0x5b'))['left_join'](_0x65f6('0x5c'),'o',_0x65f6('0x5d'))[_0x65f6('0x59')]('chat_websites','a','a.id\x20=\x20i.ChatWebsiteId')[_0x65f6('0x59')](_0x65f6('0x5e'),'me',_0x65f6('0x5f'))[_0x65f6('0x59')](_0x65f6('0x60'),'it',_0x65f6('0x61'))[_0x65f6('0x59')](_0x65f6('0x54'),'t',_0x65f6('0x62'));var _0xddbd90=squel[_0x65f6('0x63')]();var _0x141fcc=[];var _0x30adee=squel[_0x65f6('0x63')]();var _0x5ba9c6;if(_0x27157d[_0x65f6('0x47')][_0x65f6('0x64')]){_0x5ba9c6=as[_0x65f6('0x65')](_0x27157d['query'][_0x65f6('0x64')]);var _0x16dec0=_0x5ba9c6[_0x65f6('0x66')];for(var _0x3096b8=0x0;_0x3096b8<_0x5ba9c6['conditions'][_0x65f6('0x67')];_0x3096b8++){var _0x4227f5=_0x5ba9c6[_0x65f6('0x68')][_0x3096b8];var _0x3e0d8b='i';var _0x553ff0=_[_0x65f6('0x69')](_0x37cd36,[_0x65f6('0x36'),_0x4227f5['field']]);if(!_0x553ff0){switch(_0x4227f5[_0x65f6('0x52')]){case _0x65f6('0x6a'):if(_0x4227f5[_0x65f6('0x6b')]==0x1){_0x2091f1['having']('`'+_0x4227f5[_0x65f6('0x52')]+_0x65f6('0x6c'));}else{_0x2091f1[_0x65f6('0x6d')]('`'+_0x4227f5[_0x65f6('0x52')]+_0x65f6('0x6e'));}break;case _0x65f6('0x6f'):if(_0x4227f5['operator']==='$substring'){if(_0x4227f5['value'][_0x65f6('0x3f')]('\x20')[_0x65f6('0x67')]>0x1){_0xddbd90[_0x16dec0](_0x65f6('0x70'),qs[_0x65f6('0x71')](_0x4227f5[_0x65f6('0x6b')]),null);}else{var _0x304cf9='%'+_0x4227f5['value']+'%';_0xddbd90[_0x16dec0](_0x65f6('0x72'),_0x304cf9,_0x304cf9,_0x304cf9);}}else{_0x553ff0=_[_0x65f6('0x69')](_0x37cd36,['name',_0x65f6('0x73')]);_0x4227f5[_0x65f6('0x52')]=_0x65f6('0x73');_0xf69bf6=as['buildExpression'](_0x3e0d8b,_0x553ff0[_0x65f6('0x45')],_0x4227f5);_0xddbd90[_0x16dec0](_0xf69bf6[_0x65f6('0x74')],_0xf69bf6['value'][_0x65f6('0x75')],_0xf69bf6[_0x65f6('0x6b')][_0x65f6('0x2a')]);}break;case _0x65f6('0x76'):var _0x3d55f7=_0x4227f5[_0x65f6('0x6b')][_0x65f6('0x3f')](',')['map'](function(_0x4e5e94){return Number(_0x4e5e94);});_0x3d55f7[_0x65f6('0x40')](function(_0x3da139){_0x30adee['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3da139+',%');});_0x141fcc=_[_0x65f6('0x77')](_0x141fcc,_0x3d55f7);break;case'User':if(_0x4227f5[_0x65f6('0x78')]==='$substring'){_0xddbd90[_0x16dec0](_0x65f6('0x79'),'%'+_0x4227f5[_0x65f6('0x6b')]+'%',null);}else{_0x553ff0=_[_0x65f6('0x69')](_0x37cd36,[_0x65f6('0x36'),_0x65f6('0x7a')]);_0x4227f5[_0x65f6('0x52')]=_0x65f6('0x7a');_0xf69bf6=as[_0x65f6('0x7b')](_0x3e0d8b,_0x553ff0[_0x65f6('0x45')],_0x4227f5);_0xddbd90[_0x16dec0](_0xf69bf6['text'],_0xf69bf6['value'][_0x65f6('0x75')],_0xf69bf6[_0x65f6('0x6b')][_0x65f6('0x2a')]);}break;case'body':_0xf69bf6=as['buildExpression']('me',null,_0x4227f5);_0xddbd90[_0x16dec0](_0xf69bf6[_0x65f6('0x74')],_0xf69bf6[_0x65f6('0x6b')][_0x65f6('0x75')],_0xf69bf6[_0x65f6('0x6b')][_0x65f6('0x2a')]);break;}}else{var _0xf69bf6=as['buildExpression'](_0x3e0d8b,_0x553ff0['type'],_0x4227f5);_0xddbd90[_0x16dec0](_0xf69bf6[_0x65f6('0x74')],_0xf69bf6[_0x65f6('0x6b')]['start'],_0xf69bf6[_0x65f6('0x6b')]['end']);}}}else{var _0x254e9f=_(_0x27157d[_0x65f6('0x47')])[_0x65f6('0x7c')]()[_0x65f6('0x3b')](function(_0x558888){return _[_0x65f6('0x7d')](_0x37cd36,[_0x65f6('0x36'),_0x558888])?_0x558888:undefined;})[_0x65f6('0x7e')]()['value']();if(!_['isEmpty'](_0x254e9f)){_0x254e9f[_0x65f6('0x40')](function(_0x583a01){if(_0x583a01===_0x65f6('0x7f')){_0x2091f1[_0x65f6('0x80')](_0x65f6('0x81'),[][_0x65f6('0x82')](_0x27157d['query'][_0x583a01]));}else if(_0x583a01==='createdAt'){var _0x56f7f1=JSON[_0x65f6('0x83')](_0x27157d[_0x65f6('0x47')][_0x583a01])[_0x65f6('0x84')];var _0x57464e=JSON[_0x65f6('0x83')](_0x27157d[_0x65f6('0x47')][_0x583a01])[_0x65f6('0x85')];_0x2091f1['where'](_0x65f6('0x86'),_0x56f7f1,_0x57464e);}else{if(_0x27157d[_0x65f6('0x47')][_0x583a01]==='null'){_0x2091f1[_0x65f6('0x80')]('i.'+_0x583a01+_0x65f6('0x87'));}else{_0x2091f1['where']('i.'+_0x583a01+_0x65f6('0x88'),_0x27157d['query'][_0x583a01]);}}});}if(_0x27157d[_0x65f6('0x47')]['read']){if(_0x27157d[_0x65f6('0x47')][_0x65f6('0x89')]==0x1){_0x2091f1['having'](_0x65f6('0x8a'));}else{_0x2091f1[_0x65f6('0x6d')](_0x65f6('0x8b'));}}if(_0x27157d[_0x65f6('0x47')][_0x65f6('0x8c')]){_0x141fcc=_[_0x65f6('0x8d')](_0x27157d[_0x65f6('0x47')][_0x65f6('0x8c')])?_0x27157d[_0x65f6('0x47')][_0x65f6('0x8c')]:new Array(_0x27157d[_0x65f6('0x47')]['tag']);_0x141fcc[_0x65f6('0x40')](function(_0x1cf1bd){_0x30adee['or'](_0x65f6('0x8e'),'%,'+_0x1cf1bd+',%');});}if(_0x27157d[_0x65f6('0x47')]['filter']){var _0x453080=_0x27157d[_0x65f6('0x47')]['filter'][_0x65f6('0x8f')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x65f6('0x90')](_0x453080)){_0xddbd90['or']('i.id\x20LIKE\x20?',_0x453080+'%');}else{_0xddbd90['or'](_0x65f6('0x91'),qs[_0x65f6('0x71')](_0x453080))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x453080+'%');}}}_0x2091f1['where'](_0xddbd90);_0x2091f1[_0x65f6('0x92')](_0x65f6('0x93'));var _0x5158c9={'type':db[_0x65f6('0x94')][_0x65f6('0x95')][_0x65f6('0x96')],'raw':!![]};var _0x4edba0=_0x2091f1[_0x65f6('0x97')]();_0x4edba0[_0x65f6('0x52')]('i.id');_0x4edba0[_0x65f6('0x52')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x65f6('0x6a'));if(_0x2cb38d['order']){_0x2cb38d['order'][_0x65f6('0x40')](function(_0x1cf4ed){var _0x199d63=_0x1cf4ed[0x0]===_0x65f6('0x98')?_0x1cf4ed[0x0]:'i.'+_0x1cf4ed[0x0];_0x2091f1[_0x65f6('0x4d')](_0x199d63,_0x1cf4ed[0x1]===_0x65f6('0x99')?![]:!![]);});}if(!_[_0x65f6('0x9a')](_0x141fcc)){_0x2091f1[_0x65f6('0x6d')](_0x30adee);_0x4edba0['where']('t.id\x20IN\x20?',_0x141fcc);}BPromise[_0x65f6('0x9b')]()['then'](function(){if(!_0x5ba9c6){if(_0x27157d[_0x65f6('0x47')][_0x65f6('0x7f')])return;_0x4edba0[_0x65f6('0x80')](_0x65f6('0x9c'));_0x2091f1[_0x65f6('0x80')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x27157d[_0x65f6('0x9d')][_0x65f6('0x9e')]!==_0x65f6('0x38'))return;return _0x27157d['user'][_0x65f6('0x9f')]({'attributes':['id'],'raw':!![]})[_0x65f6('0x1f')](function(_0x4254c2){if(_[_0x65f6('0x9a')](_0x4254c2)){_0x4edba0[_0x65f6('0x80')](_0x65f6('0xa0'));_0x2091f1['where']('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x4edba0[_0x65f6('0x80')](_0x65f6('0x81'),_[_0x65f6('0x3b')](_0x4254c2,'id'));_0x2091f1[_0x65f6('0x80')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x4254c2,'id'));}});})[_0x65f6('0x1f')](function(){if(_0x27157d[_0x65f6('0x9d')][_0x65f6('0x9e')]===_0x65f6('0x38')&&!_0x5ba9c6&&!_0x27157d[_0x65f6('0x47')][_0x65f6('0x7f')])return[];return db['sequelize']['query'](_0x4edba0['toString'](),_0x5158c9);})[_0x65f6('0x1f')](function(_0x2e63bb){_0x2dd16c[_0x65f6('0x30')]=_0x2e63bb[_0x65f6('0x67')];if(_0x2dd16c['count']===0x0)return[];return db['sequelize'][_0x65f6('0x47')](_0x247be3[_0x65f6('0xa1')](),_0x5158c9)['then'](function(_0x346fa9){_0x4f96c4=_['keyBy'](_0x346fa9,'id');_0x5158c9=_[_0x65f6('0x37')](_0x5158c9,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x27157d[_0x65f6('0x47')][_0x65f6('0x4a')]){_0x2cb38d['attributes'][_0x65f6('0x40')](function(_0x330e18){_0x2091f1[_0x65f6('0x52')]('i.'+_0x330e18);});}else{_0x2091f1[_0x65f6('0x52')](_0x65f6('0xa2'),_0x65f6('0x6a'));_0x2091f1['field'](_0x65f6('0xa3'),'Account.key');_0x2091f1[_0x65f6('0x52')]('a.mandatoryDisposition',_0x65f6('0xa4'));_0x2091f1[_0x65f6('0x52')](_0x65f6('0xa5'),_0x65f6('0x98'));_0x2091f1['field'](_0x65f6('0xa6'));_0x2091f1[_0x65f6('0x52')](_0x65f6('0xa7'),'Contact.firstName');_0x2091f1['field'](_0x65f6('0xa8'),_0x65f6('0xa9'));_0x2091f1['field'](_0x65f6('0xaa'),_0x65f6('0xab'));_0x2091f1[_0x65f6('0x52')]('c.phone',_0x65f6('0xac'));_0x2091f1[_0x65f6('0x52')]('c.mobile',_0x65f6('0xad'));_0x2091f1[_0x65f6('0x52')](_0x65f6('0xae'),'Contact.fax');_0x2091f1[_0x65f6('0x52')](_0x65f6('0xaf'),_0x65f6('0xb0'));_0x2091f1['field'](_0x65f6('0xb1'),'Owner.internal');_0x2091f1[_0x65f6('0x52')](_0x65f6('0xb2'),_0x65f6('0x3d'));}if(_0x2cb38d[_0x65f6('0x2f')])_0x2091f1[_0x65f6('0x2f')](_0x2cb38d[_0x65f6('0x2f')]);if(_0x2cb38d['offset'])_0x2091f1[_0x65f6('0x2d')](_0x2cb38d[_0x65f6('0x2d')]);return db[_0x65f6('0xb3')][_0x65f6('0x47')](_0x2091f1[_0x65f6('0xa1')](),_0x5158c9);})['then'](function(_0x59f421){if(_0x59f421['length']>0x0)_0x48a2ed[_0x65f6('0x80')](_0x65f6('0xb4'),_[_0x65f6('0x3b')](_0x59f421,'id'));return db['sequelize'][_0x65f6('0x47')](_0x48a2ed['toString'](),_0x5158c9)['then'](function(_0x3133f4){var _0x41b58b=_['groupBy'](_0x3133f4,_0x65f6('0xb5'));var _0x3c5053=[];_0x59f421[_0x65f6('0x40')](function(_0x2ba1f7){_0x3c5053[_0x65f6('0x41')](updateChatInteraction(_0x2ba1f7,_0x4f96c4,_0x41b58b));});return BPromise[_0x65f6('0xb6')](_0x3c5053);});});})[_0x65f6('0x1f')](function(_0x3291ac){_0x2dd16c[_0x65f6('0xb7')]=_0x3291ac;return _0x2dd16c;})[_0x65f6('0x1f')](respondWithFilteredResult(_0xb1a132,_0x2cb38d))[_0x65f6('0x28')](handleError(_0xb1a132,null));};exports[_0x65f6('0xb8')]=function(_0x5c9cc0,_0x349af7){var _0x52dc75={'raw':![],'where':{'id':_0x5c9cc0[_0x65f6('0xb9')]['id']}},_0x55355f={};_0x55355f[_0x65f6('0x46')]=_[_0x65f6('0x7c')](db[_0x65f6('0x43')]['rawAttributes']);_0x55355f[_0x65f6('0x47')]=_['keys'](_0x5c9cc0['query']);_0x55355f[_0x65f6('0x4f')]=_[_0x65f6('0x48')](_0x55355f[_0x65f6('0x46')],_0x55355f[_0x65f6('0x47')]);_0x52dc75[_0x65f6('0x49')]=_[_0x65f6('0x48')](_0x55355f['model'],qs[_0x65f6('0x4a')](_0x5c9cc0['query'][_0x65f6('0x4a')]));_0x52dc75[_0x65f6('0x49')]=_0x52dc75[_0x65f6('0x49')]['length']?_0x52dc75[_0x65f6('0x49')]:_0x55355f['model'];if(_0x5c9cc0['query'][_0x65f6('0xba')]){_0x52dc75[_0x65f6('0xbb')]=[{'all':!![]}];}_0x52dc75=_[_0x65f6('0x37')]({},_0x52dc75,_0x5c9cc0[_0x65f6('0xbc')]);return db[_0x65f6('0x43')]['find'](_0x52dc75)[_0x65f6('0x1f')](handleEntityNotFound(_0x349af7,null))[_0x65f6('0x1f')](respondWithResult(_0x349af7,null))[_0x65f6('0x28')](handleError(_0x349af7,null));};exports[_0x65f6('0xbd')]=function(_0x51f1e5,_0x3cd4c1){return db[_0x65f6('0x43')][_0x65f6('0xbd')](_0x51f1e5[_0x65f6('0xbe')],{})[_0x65f6('0x1f')](respondWithResult(_0x3cd4c1,0xc9))[_0x65f6('0x28')](handleError(_0x3cd4c1,null));};exports[_0x65f6('0x35')]=function(_0x8aab06,_0x558410){if(_0x8aab06[_0x65f6('0xbe')]['id']){delete _0x8aab06[_0x65f6('0xbe')]['id'];}return db[_0x65f6('0x43')][_0x65f6('0x69')]({'where':{'id':_0x8aab06[_0x65f6('0xb9')]['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0x558410,null))['then'](saveUpdates(_0x8aab06[_0x65f6('0xbe')],null))[_0x65f6('0x1f')](respondWithResult(_0x558410,null))['catch'](handleError(_0x558410,null));};exports[_0x65f6('0xbf')]=function(_0x547275,_0x24ff7c){return db[_0x65f6('0x43')][_0x65f6('0x69')]({'where':{'id':_0x547275[_0x65f6('0xb9')]['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0x24ff7c,null))['then'](removeEntity(_0x24ff7c,null))[_0x65f6('0x28')](handleError(_0x24ff7c,null));};exports[_0x65f6('0xc0')]=function(_0x2394eb,_0x31870f){return db[_0x65f6('0x43')]['describe']()['then'](respondWithResult(_0x31870f,null))[_0x65f6('0x28')](handleError(_0x31870f,null));};exports[_0x65f6('0xc1')]=function(_0x2993ee,_0x3cf2d9){var _0x4c070f=_0x2993ee['params']['id'];var _0x534004;var _0x42a2f6;var _0x3b0a97;return db[_0x65f6('0x43')]['findOne']({'where':{'id':_0x4c070f}})[_0x65f6('0x1f')](function(_0x3b5592){_0x534004=_0x3b5592;return db[_0x65f6('0xc2')][_0x65f6('0xc3')]({'where':{'id':_0x3b5592[_0x65f6('0x7f')]},'attributes':['id','vidaooApiKey',_0x65f6('0xc4'),_0x65f6('0xc5'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0x65f6('0x1f')](function(_0x173b54){if(_0x173b54&&_0x173b54[_0x65f6('0xc6')]&&_0x173b54[_0x65f6('0xc4')]){_0x42a2f6=_0x173b54;var _0x17bbc9={'interaction':{'id':_0x4c070f},'agent':{'id':_0x2993ee['user']['id'],'name':_0x2993ee[_0x65f6('0x9d')]['name'],'fullname':_0x2993ee[_0x65f6('0x9d')]['fullname'],'email':_0x2993ee[_0x65f6('0x9d')]['email']},'contact':_0x2993ee[_0x65f6('0xbe')]['contact'],'account':_0x2993ee[_0x65f6('0xbe')][_0x65f6('0x3a')]};var _0x494f9c={'rejectUnauthorized':![],'method':'POST','url':_0x65f6('0xc7'),'headers':{'X-APIKEY':_0x173b54[_0x65f6('0xc6')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2993ee[_0x65f6('0x9d')][_0x65f6('0xc8')]],'buttons':null,'topic':_0x42a2f6[_0x65f6('0xc5')],'note':_[_0x65f6('0xc9')](_0x42a2f6[_0x65f6('0xca')])?null:getMustacheRender(_0x42a2f6[_0x65f6('0xca')],_0x17bbc9),'metadata':null},'redirect':_0x65f6('0xcb'),'json':!![]};try{if(!_[_0x65f6('0xc9')](_0x42a2f6[_0x65f6('0xcc')])){var _0x6babec=getMustacheRender(_0x42a2f6[_0x65f6('0xcc')],_0x17bbc9);var _0x42177e=JSON[_0x65f6('0x83')](_0x6babec);_0x494f9c[_0x65f6('0xbe')][_0x65f6('0xcd')]=_0x42177e;}}catch(_0x5efe82){throw new db[(_0x65f6('0x94'))][(_0x65f6('0xce'))](_0x65f6('0xcf'));}return rp(_0x494f9c);}else{throw new db[(_0x65f6('0x94'))][(_0x65f6('0xce'))](_0x65f6('0xd0'));}})[_0x65f6('0x1f')](function(_0x2b3415){_0x3b0a97=_0x2b3415;if(_0x3b0a97['id']){var _0x3c9d49={'body':_0x3b0a97['join_url'],'ChatWebsiteId':_0x42a2f6['id'],'ChatInteractionId':_0x534004['id'],'direction':_0x65f6('0xd1'),'UserId':_0x2993ee[_0x65f6('0x9d')]['id']};return db[_0x65f6('0xd2')][_0x65f6('0xbd')](_0x3c9d49,{});}else{throw new db['Sequelize'][(_0x65f6('0xce'))](_0x65f6('0xd3'));}})['then'](function(){return _0x534004[_0x65f6('0xd4')]({'vidaooSessionId':_0x3b0a97['id']});})[_0x65f6('0x1f')](respondWithResult(_0x3cf2d9,null))[_0x65f6('0x28')](handleError(_0x3cf2d9,null));};exports[_0x65f6('0xd5')]=function(_0x2b89d5,_0x409dd7){if(_0x2b89d5['body']['id']){delete _0x2b89d5[_0x65f6('0xbe')]['id'];}return db[_0x65f6('0x43')][_0x65f6('0x69')]({'where':{'id':_0x2b89d5[_0x65f6('0xb9')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})['then'](handleEntityNotFound(_0x409dd7,null))[_0x65f6('0x1f')](saveUpdates(_0x2b89d5[_0x65f6('0xbe')],null))[_0x65f6('0x1f')](respondWithResult(_0x409dd7,null))[_0x65f6('0x28')](handleError(_0x409dd7,null));};exports[_0x65f6('0xd6')]=function(_0x5515a4,_0x542805,_0x2281d5){if(_0x5515a4[_0x65f6('0xbe')]['id']){delete _0x5515a4[_0x65f6('0xbe')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x5515a4[_0x65f6('0xb9')]['id']}})['then'](function(_0x10a218){if(!_0x10a218){logger[_0x65f6('0x22')](_0x65f6('0xd7'),_0x65f6('0xd6'),0x194,_0x65f6('0xd8'));_0x542805[_0x65f6('0x29')](0x194);}else{if(_0x10a218[_0x65f6('0x7a')]){throw new db[(_0x65f6('0x94'))][(_0x65f6('0xce'))]('Interaction\x20already\x20assigned');}}return _0x10a218;})[_0x65f6('0x1f')](function(_0x129ae0){if(_0x129ae0){return _0x129ae0['update']({'closed':_0x5515a4[_0x65f6('0xbe')]['closed'],'disposition':_0x5515a4[_0x65f6('0xbe')][_0x65f6('0xd9')]})[_0x65f6('0x1f')](function(_0x579d52){return _0x579d52;});}})[_0x65f6('0x1f')](function(_0x5745e8){return respondWithRpcPromise('AbandonInteraction',_0x65f6('0xd6'),_0x5515a4[_0x65f6('0xbe')],client9004);})['then'](respondWithResult(_0x542805,null))[_0x65f6('0x28')](handleError(_0x542805,null));};exports['attachmentUpload']=function(_0x2b8edf,_0x28b9f4,_0x24e7f7){_0x2b8edf[_0x65f6('0xbe')][_0x65f6('0x36')]=_0x2b8edf[_0x65f6('0xda')][_0x65f6('0xdb')];_0x2b8edf[_0x65f6('0xbe')]['basename']=_0x2b8edf[_0x65f6('0xda')][_0x65f6('0xdc')];_0x2b8edf[_0x65f6('0xbe')][_0x65f6('0x45')]=_0x2b8edf[_0x65f6('0xda')]['mimetype'];return db[_0x65f6('0xdd')]['create'](_0x2b8edf[_0x65f6('0xbe')])['then'](respondWithResult(_0x28b9f4,0xc9))[_0x65f6('0x28')](handleError(_0x28b9f4,null));};exports[_0x65f6('0xde')]=function(_0x83ec2e,_0x3f61c4,_0x230eb9){return db[_0x65f6('0x43')][_0x65f6('0xc3')]({'where':{'id':_0x83ec2e[_0x65f6('0xb9')]['id']},'raw':!![]})[_0x65f6('0x1f')](handleEntityNotFound(_0x3f61c4,null))[_0x65f6('0x1f')](function(_0x72a333){if(_0x72a333){if(_0x72a333[_0x65f6('0xdf')]){return _0x3f61c4[_0x65f6('0x2b')](0x193)[_0x65f6('0x2c')]({'status':0x193,'message':_0x65f6('0xe0')});}return db[_0x65f6('0xdd')][_0x65f6('0xc3')]({'where':{'id':_0x83ec2e['query'][_0x65f6('0xe1')]},'raw':!![]})['then'](handleEntityNotFound(_0x3f61c4,null));}})[_0x65f6('0x1f')](function(_0x34f1cf){if(_0x34f1cf){var _0x431691=_0x34f1cf[_0x65f6('0xe2')]!==null;var _0x17f1f6=path[_0x65f6('0xe3')](config['root'],_0x65f6('0xe4'));if(_0x431691){_0x17f1f6=path[_0x65f6('0xe3')](_0x17f1f6,_0x65f6('0xe5'));}var _0x359734=path[_0x65f6('0xe3')](_0x17f1f6,_0x34f1cf[_0x65f6('0xe6')]);return _0x3f61c4[_0x65f6('0xe7')](_0x359734);}})[_0x65f6('0x28')](handleError(_0x3f61c4,null));};exports[_0x65f6('0xe8')]=function(_0x53da3a,_0x33831f){var _0x4ecd83=null;var _0x5e4778=null;var _0x4427bf=null;var _0x927c22=null;if(_0x53da3a[_0x65f6('0xbe')]['id']){delete _0x53da3a[_0x65f6('0xbe')]['id'];}if(_0x53da3a[_0x65f6('0xbe')][_0x65f6('0xe9')]){_0x927c22=path[_0x65f6('0xe3')](config['root'],_0x65f6('0xea'),util[_0x65f6('0xeb')](_0x65f6('0xec'),Date[_0x65f6('0xed')]()));_0x53da3a[_0x65f6('0xbe')][_0x65f6('0xee')]=_0x927c22;}return db[_0x65f6('0x43')][_0x65f6('0x69')]({'where':{'id':_0x53da3a[_0x65f6('0xb9')]['id']},'include':[{'model':db[_0x65f6('0xd2')],'as':_0x65f6('0xef'),'include':[{'model':db[_0x65f6('0xf0')],'as':_0x65f6('0xf0')}]}]})['then'](handleEntityNotFound(_0x33831f,null))['then'](saveUpdates(_0x53da3a['body'],null))[_0x65f6('0x1f')](function(_0x3edd09){if(_0x3edd09){_0x4ecd83=_0x3edd09;return db[_0x65f6('0xc2')]['find']({'where':{'id':_0x4ecd83[_0x65f6('0x7f')]}});}})[_0x65f6('0x1f')](function(_0x10d421){if(_0x10d421){_0x4427bf=_0x10d421;return db['CmContact'][_0x65f6('0x69')]({'where':{'id':_0x4ecd83[_0x65f6('0x73')]}});}})['then'](function(_0x346aa3){if(_0x346aa3){_0x5e4778=_0x346aa3;if(_0x927c22){var _0x1f4a0d=null;for(var _0x3369b6=0x1;_0x3369b6<_0x4ecd83['Messages'][_0x65f6('0x67')];++_0x3369b6){_0x1f4a0d=_0x4ecd83[_0x65f6('0xef')][_0x3369b6];var _0x29656f=_0x1f4a0d[_0x65f6('0x7a')]?util[_0x65f6('0xeb')](_0x65f6('0xf1'),_0x4427bf[_0x65f6('0xf2')],_0x1f4a0d[_0x65f6('0x7a')]):_0x65f6('0xf3');var _0x128304=_0x53da3a['body'][_0x65f6('0xf4')]||util[_0x65f6('0xeb')](_0x65f6('0xf1'),'Visitor',_0x1f4a0d['ContactId']);switch(_0x4427bf[_0x65f6('0xf5')]){case'website_alias':_0x29656f=_0x1f4a0d[_0x65f6('0x7a')]?util[_0x65f6('0xeb')](_0x65f6('0xf1'),_0x4427bf[_0x65f6('0xf2')],_0x1f4a0d[_0x65f6('0x7a')]):'System';break;case _0x65f6('0xf6'):_0x29656f=_0x1f4a0d[_0x65f6('0x7a')]?_0x1f4a0d[_0x65f6('0xf0')][_0x65f6('0xf7')]||_0x1f4a0d['User'][_0x65f6('0x3c')]:_0x65f6('0xf3');break;case _0x65f6('0xf8'):_0x29656f=_0x1f4a0d[_0x65f6('0x7a')]?_0x1f4a0d[_0x65f6('0xf0')][_0x65f6('0x3c')]:_0x65f6('0xf3');break;default:_0x29656f=_0x1f4a0d[_0x65f6('0x7a')]?util[_0x65f6('0xeb')](_0x65f6('0xf1'),_0x4427bf[_0x65f6('0xf2')],_0x1f4a0d[_0x65f6('0x7a')]):_0x65f6('0xf3');}var _0x31e87d=util[_0x65f6('0xeb')]('[%s]\x20%s:\x20%s\x0a',moment(_0x1f4a0d[_0x65f6('0xf9')])[_0x65f6('0xeb')]('MM/DD/YYYY\x20HH:mm:ss'),_0x1f4a0d['direction']==='in'?_0x128304:_0x29656f,_0x1f4a0d[_0x65f6('0xbe')]);if(!_0x1f4a0d[_0x65f6('0xfa')]){fs[_0x65f6('0xfb')](_0x927c22,_0x31e87d);}}return db[_0x65f6('0xfc')][_0x65f6('0xc3')]({'where':{'service':!![]},'include':[{'model':db[_0x65f6('0xfd')],'as':_0x65f6('0xfe'),'raw':!![]}]});}}})['then'](function(_0x2922b9){if(_0x2922b9&&_0x2922b9['Smtp']&&_0x53da3a['body']){var _0x35062f={'tls':{'rejectUnauthorized':![]}};if(_0x2922b9[_0x65f6('0xfe')][_0x65f6('0xff')]){_0x35062f[_0x65f6('0xff')]=_0x2922b9['Smtp']['service'];}else{_0x35062f[_0x65f6('0x100')]=_0x2922b9[_0x65f6('0xfe')]['host'];_0x35062f['port']=_0x2922b9['Smtp'][_0x65f6('0x101')];_0x35062f[_0x65f6('0x102')]=_0x2922b9[_0x65f6('0xfe')][_0x65f6('0x102')];}if(_0x2922b9[_0x65f6('0xfe')]['authentication']){_0x35062f['auth']={'user':_0x2922b9[_0x65f6('0xfe')][_0x65f6('0x9d')],'pass':_0x2922b9[_0x65f6('0xfe')]['pass']};}return respondWithRpcPromise('SendMail',_0x65f6('0x103'),{'account':_0x35062f,'message':{'from':util[_0x65f6('0xeb')]('\x22%s\x22\x20<%s>',_0x2922b9[_0x65f6('0x36')],_0x2922b9[_0x65f6('0xc8')]||_0x2922b9['Smtp'][_0x65f6('0x9d')]),'to':_0x53da3a['body'][_0x65f6('0xe9')],'subject':_0x65f6('0x104'),'text':util[_0x65f6('0xeb')](_0x65f6('0x105'),_0x53da3a[_0x65f6('0xbe')][_0x65f6('0xe9')]),'attachments':[{'path':_0x927c22}]}})['then'](function(){return _0x4ecd83;})[_0x65f6('0x28')](function(_0x31f4ae){console['error'](_0x31f4ae);});}else{return _0x4ecd83;}})[_0x65f6('0x1f')](respondWithStatusCode(_0x33831f,0xc8))[_0x65f6('0x28')](handleError(_0x33831f,null));};exports[_0x65f6('0x106')]=function(_0x4b2f42,_0x491533,_0x322df1){return db[_0x65f6('0xd2')][_0x65f6('0x69')]({'where':{'id':_0x4b2f42[_0x65f6('0xb9')]['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0x491533,null))[_0x65f6('0x1f')](function(_0x5e4078){if(_0x5e4078){return _0x5e4078['addMessage'](_0x4b2f42[_0x65f6('0xbe')][_0x65f6('0x107')],_[_0x65f6('0x108')](_0x4b2f42[_0x65f6('0xbe')],[_0x65f6('0x107'),'id'])||{});}})[_0x65f6('0x1f')](respondWithResult(_0x491533,null))[_0x65f6('0x28')](handleError(_0x491533,null));};exports[_0x65f6('0x109')]=function(_0x201edb,_0x42c4b8,_0x169632){var _0x32f5d5={'raw':![],'where':{}};var _0x594789={};var _0x624c21={'count':0x0,'rows':[]};return db[_0x65f6('0x43')][_0x65f6('0xc3')]({'where':{'id':_0x201edb[_0x65f6('0xb9')]['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0x42c4b8,null))[_0x65f6('0x1f')](function(_0xd00f2f){if(_0xd00f2f){_0x594789[_0x65f6('0x46')]=_[_0x65f6('0x7c')](db[_0x65f6('0xd2')]['rawAttributes']);_0x594789[_0x65f6('0x47')]=_[_0x65f6('0x7c')](_0x201edb[_0x65f6('0x47')]);_0x594789['filters']=_[_0x65f6('0x48')](_0x594789[_0x65f6('0x46')],_0x594789[_0x65f6('0x47')]);_0x32f5d5['attributes']=_['intersection'](_0x594789[_0x65f6('0x46')],qs[_0x65f6('0x4a')](_0x201edb[_0x65f6('0x47')][_0x65f6('0x4a')]));_0x32f5d5[_0x65f6('0x49')]=_0x32f5d5[_0x65f6('0x49')][_0x65f6('0x67')]?_0x32f5d5[_0x65f6('0x49')]:_0x594789[_0x65f6('0x46')];if(!_0x201edb[_0x65f6('0x47')][_0x65f6('0x4b')](_0x65f6('0x4c'))){_0x32f5d5[_0x65f6('0x2f')]=qs[_0x65f6('0x2f')](_0x201edb[_0x65f6('0x47')][_0x65f6('0x2f')]);_0x32f5d5[_0x65f6('0x2d')]=qs[_0x65f6('0x2d')](_0x201edb['query'][_0x65f6('0x2d')]);}_0x32f5d5[_0x65f6('0x4d')]=qs[_0x65f6('0x4e')](_0x201edb[_0x65f6('0x47')]['sort']);_0x32f5d5[_0x65f6('0x80')]=qs['filters'](_[_0x65f6('0x50')](_0x201edb[_0x65f6('0x47')],_0x594789[_0x65f6('0x4f')]));_0x32f5d5[_0x65f6('0x80')][_0x65f6('0xb5')]=_0xd00f2f['id'];if(_0x201edb['query'][_0x65f6('0x10a')]){_0x32f5d5['where']=_['merge'](_0x32f5d5['where'],{'$or':_[_0x65f6('0x3b')](_0x32f5d5['attributes'],function(_0x28caab){var _0x3db2fd={};_0x3db2fd[_0x28caab]={'$like':'%'+_0x201edb[_0x65f6('0x47')][_0x65f6('0x10a')]+'%'};return _0x3db2fd;})});}if(_0x201edb[_0x65f6('0x47')][_0x65f6('0x84')]){var _0x18461c=_0x201edb[_0x65f6('0x47')]['$gte']['split'](',');var _0x13af41={};_0x13af41[_0x18461c[0x0]]={'$gte':moment(_0x18461c[0x1])[_0x65f6('0xeb')]('YYYY-MM-DD\x20HH:mm:ss')};_0x32f5d5[_0x65f6('0x80')]=_['merge'](_0x32f5d5['where'],_0x13af41);}_0x32f5d5=_[_0x65f6('0x37')]({},_0x32f5d5,_0x201edb[_0x65f6('0xbc')]);return db[_0x65f6('0xd2')][_0x65f6('0x30')]({'where':_0x32f5d5[_0x65f6('0x80')]})['then'](function(_0x1bc75c){_0x624c21['count']=_0x1bc75c;if(_0x201edb[_0x65f6('0x47')]['includeAll']){_0x32f5d5['include']=[{'all':!![]}];}return db[_0x65f6('0xd2')][_0x65f6('0x10b')](_0x32f5d5);})[_0x65f6('0x1f')](function(_0x27e5fa){_0x624c21[_0x65f6('0xb7')]=_0x27e5fa;return _0x624c21;});}})[_0x65f6('0x1f')](respondWithFilteredResult(_0x42c4b8,_0x32f5d5))[_0x65f6('0x28')](handleError(_0x42c4b8,null));};exports[_0x65f6('0x10c')]=function(_0x504520,_0xe8f14f,_0x494de7){var _0x13e006={'where':{}},_0x186cf6={},_0x21ce60={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x65f6('0xc3')]({'where':{'id':_0x504520[_0x65f6('0xb9')]['id']}})['then'](handleEntityNotFound(_0xe8f14f,null))[_0x65f6('0x1f')](function(_0x3e1f7c){if(_0x3e1f7c){_0x186cf6[_0x65f6('0x46')]=_[_0x65f6('0x7c')](db[_0x65f6('0xd2')]['rawAttributes']);_0x186cf6[_0x65f6('0x47')]=_[_0x65f6('0x7c')](_0x504520[_0x65f6('0x47')]);_0x186cf6['filters']=_['intersection'](_0x186cf6[_0x65f6('0x46')],_0x186cf6[_0x65f6('0x47')]);_0x13e006[_0x65f6('0x49')]=_[_0x65f6('0x48')](_0x186cf6[_0x65f6('0x46')],qs['fields'](_0x504520['query']['fields']));_0x13e006[_0x65f6('0x49')]=_0x13e006[_0x65f6('0x49')]['length']?_0x13e006['attributes']:_0x186cf6['model'];if(!_0x504520[_0x65f6('0x47')][_0x65f6('0x4b')](_0x65f6('0x4c'))){_0x13e006[_0x65f6('0x2f')]=qs[_0x65f6('0x2f')](_0x504520[_0x65f6('0x47')][_0x65f6('0x2f')]);_0x13e006[_0x65f6('0x2d')]=qs[_0x65f6('0x2d')](_0x504520[_0x65f6('0x47')][_0x65f6('0x2d')]);}_0x13e006[_0x65f6('0x4d')]=qs[_0x65f6('0x4e')](_0x504520[_0x65f6('0x47')][_0x65f6('0x4e')]);_0x13e006['where']=qs[_0x65f6('0x4f')](_[_0x65f6('0x50')](_0x504520[_0x65f6('0x47')],_0x186cf6[_0x65f6('0x4f')]));_0x13e006[_0x65f6('0x80')][_0x65f6('0xb5')]=_0x3e1f7c['id'];if(_0x504520['query'][_0x65f6('0x10a')]){_0x13e006[_0x65f6('0x80')]=_['merge'](_0x13e006['where'],{'$or':_[_0x65f6('0x3b')](_0x13e006['attributes'],function(_0x4fd7ca){var _0x343d7b={};_0x343d7b[_0x4fd7ca]={'$like':'%'+_0x504520[_0x65f6('0x47')]['filter']+'%'};return _0x343d7b;})});}_0x13e006[_0x65f6('0x80')][_0x65f6('0xfa')]=![];if(_0x504520['query']['id']){_0x13e006[_0x65f6('0x80')]['id']={'$gt':_0x504520[_0x65f6('0x47')]['id']};}_0x13e006=_[_0x65f6('0x37')]({},_0x13e006,_0x504520[_0x65f6('0xbc')]);return db[_0x65f6('0xd2')][_0x65f6('0x30')]({'where':_0x13e006[_0x65f6('0x80')]})[_0x65f6('0x1f')](function(_0x443f1f){_0x21ce60['count']=_0x443f1f;_0x13e006[_0x65f6('0xbb')]=[];if(_0x504520[_0x65f6('0x47')][_0x65f6('0x10d')]){_0x13e006[_0x65f6('0xbb')][_0x65f6('0x41')]({'model':db[_0x65f6('0xf0')],'as':'User','attributes':['id',_0x65f6('0x3c'),'alias']});}if(_0x504520['query']['includeAll']){_0x13e006[_0x65f6('0xbb')]=[{'all':!![]}];}return db['ChatMessage'][_0x65f6('0x10b')](_0x13e006);})[_0x65f6('0x1f')](function(_0x285cef){_0x21ce60[_0x65f6('0xb7')]=_0x285cef;return _0x21ce60;});}})[_0x65f6('0x1f')](respondWithFilteredResult(_0xe8f14f,_0x13e006))[_0x65f6('0x28')](handleError(_0xe8f14f,null));};exports[_0x65f6('0x10e')]=function(_0x5a4c42,_0x5db63d,_0x352012){return db[_0x65f6('0x43')][_0x65f6('0x69')]({'where':{'id':_0x5a4c42['params']['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0x5db63d,null))['then'](function(_0x1188a2){if(_0x1188a2){return _0x1188a2[_0x65f6('0x10f')](_0x5a4c42[_0x65f6('0xbe')]['ids'],_[_0x65f6('0x108')](_0x5a4c42[_0x65f6('0xbe')],[_0x65f6('0x107'),'id'])||{})[_0x65f6('0x110')](function(){return db['Tag']['findAll']({'attributes':['id',_0x65f6('0x36'),'color'],'where':{'id':_0x5a4c42[_0x65f6('0xbe')]['ids']}});})[_0x65f6('0x1f')](function(_0x38b1ed){socket[_0x65f6('0x111')]('chatInteractionTags:save',{'id':Number(_0x5a4c42[_0x65f6('0xb9')]['id']),'tags':_0x38b1ed||[]});return{'id':Number(_0x5a4c42[_0x65f6('0xb9')]['id']),'tags':_0x38b1ed||[]};});}})[_0x65f6('0x1f')](respondWithResult(_0x5db63d,null))[_0x65f6('0x28')](handleError(_0x5db63d,null));};exports[_0x65f6('0x112')]=function(_0x5fb1fa,_0x19c8d4,_0x4e40d4){return db[_0x65f6('0x43')][_0x65f6('0x69')]({'where':{'id':_0x5fb1fa[_0x65f6('0xb9')]['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0x19c8d4,null))[_0x65f6('0x1f')](function(_0x41da12){if(_0x41da12){return _0x41da12[_0x65f6('0x112')](_0x5fb1fa[_0x65f6('0x47')][_0x65f6('0x107')]);}})['then'](respondWithStatusCode(_0x19c8d4,null))[_0x65f6('0x28')](handleError(_0x19c8d4,null));};exports['download']=function(_0xa3fb44,_0x459924){var _0x286c97=moment()[_0x65f6('0x113')]()[_0x65f6('0xa1')]();var _0x36f46f=path[_0x65f6('0xe3')](config[_0x65f6('0x114')],_0x65f6('0x115'),_0x65f6('0x116'),_0x65f6('0x117'));var _0x38e6ff=path[_0x65f6('0xe3')](config[_0x65f6('0x114')],_0x65f6('0x115'),_0x65f6('0x116'),_0x65f6('0x118'));var _0x560dbb=path[_0x65f6('0xe3')](_0x36f46f,_0x286c97);var _0x2315bc=util['format'](_0x65f6('0x119'),_0xa3fb44[_0x65f6('0xb9')]['id'],_0x286c97);var _0x2eda77=path[_0x65f6('0xe3')](_0x36f46f,_0x2315bc);var _0x2a163e=[];_0x2a163e[_0x65f6('0x41')]({'model':db['User'],'as':'User','attributes':['id',_0x65f6('0x3c')],'raw':!![]});_0x2a163e[_0x65f6('0x41')]({'model':db[_0x65f6('0x11a')],'as':'Contact','attributes':['id',_0x65f6('0x11b'),'lastName'],'raw':!![]});if(_0xa3fb44[_0x65f6('0x47')][_0x65f6('0x118')]){_0x2a163e[_0x65f6('0x41')]({'model':db[_0x65f6('0xdd')],'as':'Attachment','raw':!![]});}var _0x41156f=[{'model':db['ChatMessage'],'as':_0x65f6('0xef'),'attributes':['id',_0x65f6('0xbe'),_0x65f6('0xf9'),'direction',_0x65f6('0xfa'),'read'],'include':_0x2a163e}];_0x41156f['push']({'model':db[_0x65f6('0xc2')],'as':_0x65f6('0x11c'),'attributes':['id',_0x65f6('0x36')]});_0x41156f[_0x65f6('0x41')]({'model':db[_0x65f6('0xf0')],'as':_0x65f6('0x11d'),'attributes':['id',_0x65f6('0x3c')]});return db[_0x65f6('0x43')][_0x65f6('0x69')]({'where':{'id':_0xa3fb44[_0x65f6('0xb9')]['id']},'include':_0x41156f})[_0x65f6('0x1f')](handleEntityNotFound(_0x459924,null))['then'](function(_0x168cac){if(_0x168cac){var _0x5d4415=_0x168cac[_0x65f6('0x11e')]({'plain':!![]});fs[_0x65f6('0x11f')](_0x560dbb);var _0x4943cd={'channel':_0x65f6('0x120'),'account':_0x5d4415[_0x65f6('0x11c')]['name'],'agent':_0x5d4415['Owner']?_0x5d4415[_0x65f6('0x11d')]['fullname']:'N.A.','createdAt':moment(_0x5d4415[_0x65f6('0xf9')])[_0x65f6('0xeb')](_0x65f6('0x121'))[_0x65f6('0xa1')](),'closedAt':_0x5d4415[_0x65f6('0xdf')]?moment(_0x5d4415[_0x65f6('0x122')])[_0x65f6('0xeb')](_0x65f6('0x121'))[_0x65f6('0xa1')]():'','disposition':_0x5d4415['disposition'],'chatInfo':{'browser':_0x5d4415[_0x65f6('0x123')],'os':_0x5d4415[_0x65f6('0x124')],'referer':_0x5d4415['referer'],'customerIp':_0x5d4415[_0x65f6('0x125')],'customerPort':_0x5d4415[_0x65f6('0x126')]?_0x5d4415[_0x65f6('0x126')]:_0x65f6('0x127')},'messages':_(_0x5d4415[_0x65f6('0xef')])[_0x65f6('0x128')]()['filter']({'secret':![]})['map'](function(_0x9d51e3){if(_0x9d51e3[_0x65f6('0xdd')]){var _0x22aac6=path[_0x65f6('0xe3')](_0x38e6ff,_0x9d51e3[_0x65f6('0xdd')]['basename']);if(fs[_0x65f6('0x129')](_0x22aac6)){fs[_0x65f6('0x12a')](_0x22aac6)[_0x65f6('0x12b')](fs[_0x65f6('0x12c')](path[_0x65f6('0xe3')](_0x560dbb,_0x9d51e3[_0x65f6('0xdd')][_0x65f6('0xe6')])));}}return{'date':moment(_0x9d51e3[_0x65f6('0xf9')])[_0x65f6('0xeb')](_0x65f6('0x121'))[_0x65f6('0xa1')](),'sender':_0x9d51e3['direction']===_0x65f6('0xd1')?_0x9d51e3[_0x65f6('0xf0')]?_0x9d51e3['User']['fullname']:_0x65f6('0xf3'):_0x9d51e3[_0x65f6('0x6f')][_0x65f6('0x11b')]+(_0x9d51e3['Contact'][_0x65f6('0x12d')]?'\x20'+_0x9d51e3[_0x65f6('0x6f')][_0x65f6('0x12d')]:''),'body':_0x9d51e3[_0x65f6('0xdd')]?_0x9d51e3[_0x65f6('0xdd')][_0x65f6('0xe6')]:_0x9d51e3[_0x65f6('0xbe')],'direction':_0x9d51e3['direction']===_0x65f6('0xd1')?'A':'C','secret':_0x9d51e3['secret'],'read':_0x9d51e3[_0x65f6('0x89')],'attachment':_0x9d51e3[_0x65f6('0xdd')]};})[_0x65f6('0x6b')]()};return ejs[_0x65f6('0x12e')](path[_0x65f6('0xe3')](config[_0x65f6('0x114')],'server',_0x65f6('0x12f'),'downloadInteraction.ejs'),{'interaction':_0x4943cd})[_0x65f6('0x1f')](function(_0x5081ad){var _0x32829e=path['join'](_0x560dbb,_0x65f6('0x130')+_0x5d4415['id']+'-'+_0x286c97+_0x65f6('0x131'));var _0x3f421f={'path':_0x32829e,'channel':_0x65f6('0x120'),'interactionId':_0x5d4415['id']};return pdf['createPdfFromHTML'](_0x5081ad,_0x3f421f);})[_0x65f6('0x1f')](function(){return new BPromise(function(_0xbf09f6,_0x3d6e08){zipdir(_0x560dbb,{'saveTo':_0x2eda77},function(_0x2c4af8,_0x71483f){if(_0x2c4af8)return _0x3d6e08(_0x2c4af8);return _0xbf09f6(_0x71483f);});})[_0x65f6('0x1f')](function(){return new BPromise(function(_0xd06566,_0x21bf41){rimraf(_0x560dbb,function(_0x538dae){if(_0x538dae)_0x21bf41(_0x538dae);return _0xd06566();});});})['then'](function(){return _0x459924[_0x65f6('0xe7')](_0x2eda77,_0x2315bc,function(_0x121e5b){if(_0x121e5b){console[_0x65f6('0x132')](_0x65f6('0x133'),_0x121e5b);}else{fs['unlinkSync'](_0x2eda77);}});});});}else{return _0x459924[_0x65f6('0x29')](0xc8);}})[_0x65f6('0x28')](handleError(_0x459924,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 72b54c2..1ce3dc0 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 _0xc869=['emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','update','remove','getUsers','then','Users','map','unreadMessages','length'];(function(_0x145133,_0xa23578){var _0x468ef0=function(_0xda69e0){while(--_0xda69e0){_0x145133['push'](_0x145133['shift']());}};_0x468ef0(++_0xa23578);}(_0xc869,0x16a));var _0x9c86=function(_0x3b221d,_0x3494f6){_0x3b221d=_0x3b221d-0x0;var _0x4b893a=_0xc869[_0x3b221d];return _0x4b893a;};'use strict';var EventEmitter=require(_0x9c86('0x0'));var ChatInteraction=require(_0x9c86('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x9c86('0x1'))['db'][_0x9c86('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x9c86('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9c86('0x4'),'afterDestroy':_0x9c86('0x5')};function emitEvent(_0xfda309){return function(_0x34f9b7,_0x34137b,_0x52b93b){_0x34f9b7[_0x9c86('0x6')]({'attributes':['id'],'raw':!![]})[_0x9c86('0x7')](function(_0x3b6804){_0x34f9b7['setDataValue'](_0x9c86('0x8'),_0x3b6804[_0x9c86('0x9')](function(_0x2695fc){return{'id':_0x2695fc['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x34f9b7['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9c86('0x7')](function(_0x552701){_0x34f9b7['setDataValue'](_0x9c86('0xa'),_0x552701[_0x9c86('0xb')]);ChatInteractionEvents['emit'](_0xfda309+':'+_0x34f9b7['id'],_0x34f9b7);ChatInteractionEvents[_0x9c86('0xc')](_0xfda309,_0x34f9b7);_0x52b93b(null);})[_0x9c86('0xd')](_0x52b93b(null));};}for(var e in events){if(events[_0x9c86('0xe')](e)){var event=events[e];ChatInteraction[_0x9c86('0xf')](e,emitEvent(event));}}module[_0x9c86('0x10')]=ChatInteractionEvents; \ No newline at end of file +var _0x9f03=['map','findAll','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x100e0c,_0x5523b8){var _0x4db1aa=function(_0x29f480){while(--_0x29f480){_0x100e0c['push'](_0x100e0c['shift']());}};_0x4db1aa(++_0x5523b8);}(_0x9f03,0xc6));var _0x39f0=function(_0x43d4ba,_0x22dfc6){_0x43d4ba=_0x43d4ba-0x0;var _0x52f78f=_0x9f03[_0x43d4ba];return _0x52f78f;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x39f0('0x0'))['db'][_0x39f0('0x1')];var ChatMessage=require(_0x39f0('0x0'))['db'][_0x39f0('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x39f0('0x3')](0x0);var events={'afterCreate':_0x39f0('0x4'),'afterUpdate':_0x39f0('0x5'),'afterDestroy':_0x39f0('0x6')};function emitEvent(_0x3f2ac9){return function(_0x3fdd82,_0xa8cf73,_0x446e7a){_0x3fdd82[_0x39f0('0x7')]({'attributes':['id'],'raw':!![]})[_0x39f0('0x8')](function(_0x305924){_0x3fdd82[_0x39f0('0x9')](_0x39f0('0xa'),_0x305924[_0x39f0('0xb')](function(_0x411af0){return{'id':_0x411af0['id']};}));return ChatMessage[_0x39f0('0xc')]({'where':{'ChatInteractionId':_0x3fdd82['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x46004b){_0x3fdd82[_0x39f0('0x9')]('unreadMessages',_0x46004b[_0x39f0('0xd')]);ChatInteractionEvents[_0x39f0('0xe')](_0x3f2ac9+':'+_0x3fdd82['id'],_0x3fdd82);ChatInteractionEvents[_0x39f0('0xe')](_0x3f2ac9,_0x3fdd82);_0x446e7a(null);})[_0x39f0('0xf')](_0x446e7a(null));};}for(var e in events){if(events[_0x39f0('0x10')](e)){var event=events[e];ChatInteraction[_0x39f0('0x11')](e,emitEvent(event));}}module[_0x39f0('0x12')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 07c91a9..428a165 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 _0x0dcd=['closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed'];(function(_0x221c0e,_0x1cf4e5){var _0x1ffc3a=function(_0x5acf10){while(--_0x5acf10){_0x221c0e['push'](_0x221c0e['shift']());}};_0x1ffc3a(++_0x1cf4e5);}(_0x0dcd,0x91));var _0xd0dc=function(_0x3b9f2e,_0x822dd9){_0x3b9f2e=_0x3b9f2e-0x0;var _0xb2b765=_0x0dcd[_0x3b9f2e];return _0xb2b765;};'use strict';var _=require(_0xd0dc('0x0'));var util=require(_0xd0dc('0x1'));var logger=require(_0xd0dc('0x2'))(_0xd0dc('0x3'));var moment=require(_0xd0dc('0x4'));var BPromise=require(_0xd0dc('0x5'));var rp=require(_0xd0dc('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd0dc('0x7'));var config=require(_0xd0dc('0x8'));var attributes=require(_0xd0dc('0x9'));module[_0xd0dc('0xa')]=function(_0x584dae,_0x381049){return _0x584dae[_0xd0dc('0xb')](_0xd0dc('0xc'),attributes,{'tableName':_0xd0dc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x387d48,_0x3c8dc2,_0x1a7eba){if(_0x387d48[_0xd0dc('0xe')](_0xd0dc('0xf'))){_0x387d48[_0xd0dc('0x10')]=moment()[_0xd0dc('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1a7eba(null,_0x387d48);}},'charset':_0xd0dc('0x12'),'collate':_0xd0dc('0x13')});}; \ No newline at end of file +var _0x7755=['YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','api','request-promise','path','rimraf','exports','define','ChatInteraction','closed','closedAt','format'];(function(_0x1b2255,_0x3de34f){var _0x33e57d=function(_0x2f9cce){while(--_0x2f9cce){_0x1b2255['push'](_0x1b2255['shift']());}};_0x33e57d(++_0x3de34f);}(_0x7755,0x161));var _0x5775=function(_0x3aaf78,_0x27aa1f){_0x3aaf78=_0x3aaf78-0x0;var _0x1c97b7=_0x7755[_0x3aaf78];return _0x1c97b7;};'use strict';var _=require(_0x5775('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5775('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5775('0x2'));var fs=require('fs');var path=require(_0x5775('0x3'));var rimraf=require(_0x5775('0x4'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0x5775('0x5')]=function(_0x1dcfb2,_0x59c20c){return _0x1dcfb2[_0x5775('0x6')](_0x5775('0x7'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1292d3,_0x5ac436,_0x346456){if(_0x1292d3['changed'](_0x5775('0x8'))){_0x1292d3[_0x5775('0x9')]=moment()[_0x5775('0xa')](_0x5775('0xb'));}_0x346456(null,_0x1292d3);}},'charset':_0x5775('0xc'),'collate':_0x5775('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index c5e86c4..918fd4e 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 _0x329b=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateChatInteraction','ChatInteraction','update','options','raw','where','attributes','limit','catch','AddTagsToChatInteraction','find','then','addTags','body','ids','omit','AddTags','lodash','util','moment','bluebird'];(function(_0x1ad74c,_0x459f26){var _0x566148=function(_0x2efdd1){while(--_0x2efdd1){_0x1ad74c['push'](_0x1ad74c['shift']());}};_0x566148(++_0x459f26);}(_0x329b,0x1b4));var _0xb329=function(_0x1e11c2,_0x1bcbca){_0x1e11c2=_0x1e11c2-0x0;var _0x4faa44=_0x329b[_0x1e11c2];return _0x4faa44;};'use strict';var _=require(_0xb329('0x0'));var util=require(_0xb329('0x1'));var moment=require(_0xb329('0x2'));var BPromise=require(_0xb329('0x3'));var rs=require(_0xb329('0x4'));var fs=require('fs');var Redis=require(_0xb329('0x5'));var db=require(_0xb329('0x6'))['db'];var utils=require(_0xb329('0x7'));var logger=require(_0xb329('0x8'))(_0xb329('0x9'));var config=require(_0xb329('0xa'));var jayson=require(_0xb329('0xb'));var client=jayson[_0xb329('0xc')][_0xb329('0xd')]({'port':0x232a});config[_0xb329('0xe')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb329('0xf'))[_0xb329('0x10')](socket);function respondWithRpcPromise(_0x49620e,_0x59412b,_0x1be630){return new BPromise(function(_0x1921ba,_0xb059df){return client[_0xb329('0x11')](_0x49620e,_0x1be630)['then'](function(_0x2be380){logger[_0xb329('0x12')](_0xb329('0x13'),_0x59412b,_0xb329('0x14'));logger[_0xb329('0x15')](_0xb329('0x16'),_0x59412b,_0xb329('0x14'),JSON[_0xb329('0x17')](_0x2be380));if(_0x2be380[_0xb329('0x18')]){if(_0x2be380['error'][_0xb329('0x19')]===0x1f4){logger[_0xb329('0x18')](_0xb329('0x13'),_0x59412b,_0x2be380[_0xb329('0x18')][_0xb329('0x1a')]);return _0xb059df(_0x2be380[_0xb329('0x18')]['message']);}logger[_0xb329('0x18')](_0xb329('0x13'),_0x59412b,_0x2be380['error'][_0xb329('0x1a')]);return _0x1921ba(_0x2be380[_0xb329('0x18')][_0xb329('0x1a')]);}else{logger['info'](_0xb329('0x13'),_0x59412b,_0xb329('0x14'));_0x1921ba(_0x2be380['result']['message']);}})['catch'](function(_0xb4681e){logger[_0xb329('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x59412b,_0xb4681e);_0xb059df(_0xb4681e);});});}exports[_0xb329('0x1b')]=function(_0x80bd6a){var _0x49d3a3=this;return new Promise(function(_0x4e60b4,_0x2ae5dd){return db[_0xb329('0x1c')][_0xb329('0x1d')](_0x80bd6a['body'],{'raw':_0x80bd6a[_0xb329('0x1e')]?_0x80bd6a[_0xb329('0x1e')][_0xb329('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x80bd6a['options']?_0x80bd6a[_0xb329('0x1e')][_0xb329('0x20')]||null:null,'attributes':_0x80bd6a[_0xb329('0x1e')]?_0x80bd6a[_0xb329('0x1e')][_0xb329('0x21')]||null:null,'limit':_0x80bd6a[_0xb329('0x1e')]?_0x80bd6a['options'][_0xb329('0x22')]||null:null})['then'](function(_0x529864){logger[_0xb329('0x12')](_0xb329('0x1b'),_0x80bd6a);logger['debug']('UpdateChatInteraction',_0x80bd6a,JSON[_0xb329('0x17')](_0x529864));_0x4e60b4(_0x529864);})[_0xb329('0x23')](function(_0x561049){logger[_0xb329('0x18')](_0xb329('0x1b'),_0x561049[_0xb329('0x1a')],_0x80bd6a);_0x2ae5dd(_0x49d3a3['error'](0x1f4,_0x561049[_0xb329('0x1a')]));});});};exports[_0xb329('0x24')]=function(_0x404725){return new Promise(function(_0x385e7f,_0x4ab201){return db['ChatInteraction'][_0xb329('0x25')]({'where':_0x404725[_0xb329('0x1e')]?_0x404725[_0xb329('0x1e')][_0xb329('0x20')]||null:null})[_0xb329('0x26')](function(_0x1589ca){if(_0x1589ca){return _0x1589ca[_0xb329('0x27')](_0x404725[_0xb329('0x28')][_0xb329('0x29')],_[_0xb329('0x2a')](_0x404725[_0xb329('0x28')],[_0xb329('0x29'),'id'])||{});}})['spread'](function(_0x5d29ad){logger[_0xb329('0x12')](_0xb329('0x2b'),_0x404725);logger[_0xb329('0x15')](_0xb329('0x2b'),_0x404725,JSON[_0xb329('0x17')](_0x5d29ad));_0x385e7f(_0x5d29ad);})[_0xb329('0x23')](function(_0x3b03d6){logger['error']('AddTags',_0x3b03d6[_0xb329('0x1a')],_0x404725);_0x4ab201(_this[_0xb329('0x18')](0x1f4,_0x3b03d6[_0xb329('0x1a')]));});});}; \ No newline at end of file +var _0x2f35=['message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','where','attributes','limit','then','AddTagsToChatInteraction','find','addTags','ids','omit','body','spread','AddTags','lodash','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','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x187ef8,_0x19eb9a){var _0x5666c1=function(_0x29b788){while(--_0x29b788){_0x187ef8['push'](_0x187ef8['shift']());}};_0x5666c1(++_0x19eb9a);}(_0x2f35,0x1ea));var _0x52f3=function(_0x12f451,_0x3b618f){_0x12f451=_0x12f451-0x0;var _0x5e9589=_0x2f35[_0x12f451];return _0x5e9589;};'use strict';var _=require(_0x52f3('0x0'));var util=require('util');var moment=require(_0x52f3('0x1'));var BPromise=require(_0x52f3('0x2'));var rs=require(_0x52f3('0x3'));var fs=require('fs');var Redis=require(_0x52f3('0x4'));var db=require(_0x52f3('0x5'))['db'];var utils=require(_0x52f3('0x6'));var logger=require(_0x52f3('0x7'))(_0x52f3('0x8'));var config=require(_0x52f3('0x9'));var jayson=require(_0x52f3('0xa'));var client=jayson[_0x52f3('0xb')]['http']({'port':0x232a});config[_0x52f3('0xc')]=_[_0x52f3('0xd')](config['redis'],{'host':_0x52f3('0xe'),'port':0x18eb});var socket=require(_0x52f3('0xf'))(new Redis(config[_0x52f3('0xc')]));require(_0x52f3('0x10'))[_0x52f3('0x11')](socket);function respondWithRpcPromise(_0x2131dc,_0x1c17f5,_0x470dee){return new BPromise(function(_0x4c4f13,_0x45c4b5){return client[_0x52f3('0x12')](_0x2131dc,_0x470dee)['then'](function(_0x379342){logger[_0x52f3('0x13')](_0x52f3('0x14'),_0x1c17f5,'request\x20sent');logger[_0x52f3('0x15')](_0x52f3('0x16'),_0x1c17f5,_0x52f3('0x17'),JSON[_0x52f3('0x18')](_0x379342));if(_0x379342['error']){if(_0x379342[_0x52f3('0x19')][_0x52f3('0x1a')]===0x1f4){logger[_0x52f3('0x19')](_0x52f3('0x14'),_0x1c17f5,_0x379342[_0x52f3('0x19')][_0x52f3('0x1b')]);return _0x45c4b5(_0x379342[_0x52f3('0x19')][_0x52f3('0x1b')]);}logger[_0x52f3('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x1c17f5,_0x379342['error']['message']);return _0x4c4f13(_0x379342['error']['message']);}else{logger['info'](_0x52f3('0x14'),_0x1c17f5,_0x52f3('0x17'));_0x4c4f13(_0x379342[_0x52f3('0x1c')]['message']);}})[_0x52f3('0x1d')](function(_0xe4df2f){logger['error'](_0x52f3('0x14'),_0x1c17f5,_0xe4df2f);_0x45c4b5(_0xe4df2f);});});}exports[_0x52f3('0x1e')]=function(_0x1eb661){var _0x4b33ce=this;return new Promise(function(_0x20de7a,_0x23bdc8){return db[_0x52f3('0x1f')][_0x52f3('0x20')](_0x1eb661['body'],{'raw':_0x1eb661[_0x52f3('0x21')]?_0x1eb661[_0x52f3('0x21')][_0x52f3('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1eb661['options']?_0x1eb661['options'][_0x52f3('0x23')]||null:null,'attributes':_0x1eb661['options']?_0x1eb661['options'][_0x52f3('0x24')]||null:null,'limit':_0x1eb661[_0x52f3('0x21')]?_0x1eb661[_0x52f3('0x21')][_0x52f3('0x25')]||null:null})[_0x52f3('0x26')](function(_0x37ae38){logger[_0x52f3('0x13')](_0x52f3('0x1e'),_0x1eb661);logger[_0x52f3('0x15')](_0x52f3('0x1e'),_0x1eb661,JSON['stringify'](_0x37ae38));_0x20de7a(_0x37ae38);})[_0x52f3('0x1d')](function(_0xca042e){logger[_0x52f3('0x19')](_0x52f3('0x1e'),_0xca042e[_0x52f3('0x1b')],_0x1eb661);_0x23bdc8(_0x4b33ce[_0x52f3('0x19')](0x1f4,_0xca042e[_0x52f3('0x1b')]));});});};exports[_0x52f3('0x27')]=function(_0x246ac1){return new Promise(function(_0x47e9be,_0x3deade){return db[_0x52f3('0x1f')][_0x52f3('0x28')]({'where':_0x246ac1[_0x52f3('0x21')]?_0x246ac1[_0x52f3('0x21')]['where']||null:null})['then'](function(_0x118f7e){if(_0x118f7e){return _0x118f7e[_0x52f3('0x29')](_0x246ac1['body'][_0x52f3('0x2a')],_[_0x52f3('0x2b')](_0x246ac1[_0x52f3('0x2c')],['ids','id'])||{});}})[_0x52f3('0x2d')](function(_0x1bdb1b){logger[_0x52f3('0x13')](_0x52f3('0x2e'),_0x246ac1);logger[_0x52f3('0x15')](_0x52f3('0x2e'),_0x246ac1,JSON[_0x52f3('0x18')](_0x1bdb1b));_0x47e9be(_0x1bdb1b);})['catch'](function(_0x25a61d){logger['error'](_0x52f3('0x2e'),_0x25a61d[_0x52f3('0x1b')],_0x246ac1);_0x3deade(_this['error'](0x1f4,_0x25a61d[_0x52f3('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 2207b3e..f1ad7c5 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 _0x7288=['emit','removeListener','register','chatInteraction:','./chatInteraction.events','save','remove','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7288,0x11c));var _0x8728=function(_0x1bca87,_0x8f74b5){_0x1bca87=_0x1bca87-0x0;var _0x382f2=_0x7288[_0x1bca87];return _0x382f2;};'use strict';var ChatInteractionEvents=require(_0x8728('0x0'));var events=[_0x8728('0x1'),_0x8728('0x2'),_0x8728('0x3')];function createListener(_0x96a708,_0x5ced48){return function(_0x3bed69){_0x5ced48[_0x8728('0x4')](_0x96a708,_0x3bed69);};}function removeListener(_0x54418e,_0x2769a3){return function(){ChatInteractionEvents[_0x8728('0x5')](_0x54418e,_0x2769a3);};}exports[_0x8728('0x6')]=function(_0x44b3a9){for(var _0x433037=0x0,_0x1fff41=events['length'];_0x433037<_0x1fff41;_0x433037++){var _0xc5aa75=events[_0x433037];var _0x7b563e=createListener(_0x8728('0x7')+_0xc5aa75,_0x44b3a9);ChatInteractionEvents['on'](_0xc5aa75,_0x7b563e);}}; \ No newline at end of file +var _0x2eea=['./chatInteraction.events','remove','update','emit','removeListener','register','chatInteraction:'];(function(_0x283470,_0x42a99f){var _0x55d54a=function(_0x4da491){while(--_0x4da491){_0x283470['push'](_0x283470['shift']());}};_0x55d54a(++_0x42a99f);}(_0x2eea,0x188));var _0xa2ee=function(_0x554c8c,_0x23fa96){_0x554c8c=_0x554c8c-0x0;var _0x1e3284=_0x2eea[_0x554c8c];return _0x1e3284;};'use strict';var ChatInteractionEvents=require(_0xa2ee('0x0'));var events=['save',_0xa2ee('0x1'),_0xa2ee('0x2')];function createListener(_0x492317,_0x1e12b4){return function(_0xc3909b){_0x1e12b4[_0xa2ee('0x3')](_0x492317,_0xc3909b);};}function removeListener(_0x1f20cf,_0x485c09){return function(){ChatInteractionEvents[_0xa2ee('0x4')](_0x1f20cf,_0x485c09);};}exports[_0xa2ee('0x5')]=function(_0x1d3495){for(var _0x418c0c=0x0,_0x59ccc5=events['length'];_0x418c0c<_0x59ccc5;_0x418c0c++){var _0x3c9164=events[_0x418c0c];var _0x458122=createListener(_0xa2ee('0x6')+_0x3c9164,_0x1d3495);ChatInteractionEvents['on'](_0x3c9164,_0x458122);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 4eaa906..cd62b60 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 _0x179f=['multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','describe','get','/:id','show','isChatInteractionAuthorized','getMessages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','/:id/tags','chatinteraction:addtags','addTags','put','tracked','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','delete','destroy','exports'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0x179f,0x9c));var _0xf179=function(_0x5f3730,_0x968294){_0x5f3730=_0x5f3730-0x0;var _0x387506=_0x179f[_0x5f3730];return _0x387506;};'use strict';var multer=require(_0xf179('0x0'));var util=require(_0xf179('0x1'));var path=require('path');var timeout=require(_0xf179('0x2'));var express=require(_0xf179('0x3'));var router=express['Router']();var fs_extra=require(_0xf179('0x4'));var auth=require(_0xf179('0x5'));var interaction=require(_0xf179('0x6'));var config=require(_0xf179('0x7'));var controller=require(_0xf179('0x8'));router['get']('/',auth[_0xf179('0x9')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xf179('0xa')]);router[_0xf179('0xb')](_0xf179('0xc'),auth['isChatInteractionAuthorized'](),controller[_0xf179('0xd')]);router[_0xf179('0xb')]('/:id/attachment_download',auth[_0xf179('0xe')](),controller['attachmentDownload']);router[_0xf179('0xb')]('/:id/messages',auth['isAuthenticated'](),controller[_0xf179('0xf')]);router[_0xf179('0xb')]('/:id/my_messages',auth[_0xf179('0xe')](),controller[_0xf179('0x10')]);router['get'](_0xf179('0x11'),auth[_0xf179('0x9')](),controller[_0xf179('0x12')]);router[_0xf179('0x13')]('/',auth[_0xf179('0x9')](),controller[_0xf179('0x14')]);router[_0xf179('0x13')](_0xf179('0x15'),auth[_0xf179('0x9')](),controller[_0xf179('0x16')]);var upload=multer({'storage':multer[_0xf179('0x17')]({'destination':function(_0x47c3e4,_0x5a7660,_0x4b3c26){_0x4b3c26(null,path[_0xf179('0x18')](config[_0xf179('0x19')],_0xf179('0x1a')));},'filename':function(_0x4e6470,_0x16374c,_0x4220ad){_0x4220ad(null,util[_0xf179('0x1b')]('%s-%s',Date[_0xf179('0x1c')](),_0x16374c[_0xf179('0x1d')][_0xf179('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf179('0x13')](_0xf179('0x1f'),upload[_0xf179('0x20')](_0xf179('0x21')),controller[_0xf179('0x22')]);router[_0xf179('0x13')](_0xf179('0x23'),auth[_0xf179('0xe')](),controller['addMessage']);router[_0xf179('0x13')](_0xf179('0x24'),auth['isAuthenticated'](),interaction['tracked']('chat',_0xf179('0x25')),controller[_0xf179('0x26')]);router[_0xf179('0x27')](_0xf179('0xc'),auth['isAuthenticated'](),interaction[_0xf179('0x28')](_0xf179('0x29'),_0xf179('0x2a')),controller[_0xf179('0x2b')]);router[_0xf179('0x27')](_0xf179('0x2c'),controller[_0xf179('0x2d')]);router[_0xf179('0x27')](_0xf179('0x2e'),auth[_0xf179('0xe')](),controller['abandon']);router[_0xf179('0x27')](_0xf179('0x2f'),controller[_0xf179('0x30')]);router[_0xf179('0x31')](_0xf179('0xc'),auth['isAuthenticated'](),interaction[_0xf179('0x28')]('chat','chatinteraction:destroy'),controller[_0xf179('0x32')]);router[_0xf179('0x31')](_0xf179('0x24'),auth[_0xf179('0x9')](),controller['removeTags']);module[_0xf179('0x33')]=router; \ No newline at end of file +var _0x5415=['put','/:id','update','/:id/custom_update','customUpdate','abandon','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','format','%s-%s','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x5415,0x191));var _0x5541=function(_0x4e0958,_0x37b6d7){_0x4e0958=_0x4e0958-0x0;var _0x413afe=_0x5415[_0x4e0958];return _0x413afe;};'use strict';var multer=require('multer');var util=require(_0x5541('0x0'));var path=require(_0x5541('0x1'));var timeout=require(_0x5541('0x2'));var express=require(_0x5541('0x3'));var router=express[_0x5541('0x4')]();var fs_extra=require(_0x5541('0x5'));var auth=require(_0x5541('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5541('0x7'));var controller=require('./chatInteraction.controller');router[_0x5541('0x8')]('/',auth[_0x5541('0x9')](),controller['index']);router[_0x5541('0x8')](_0x5541('0xa'),auth[_0x5541('0x9')](),controller[_0x5541('0xb')]);router[_0x5541('0x8')]('/:id',auth[_0x5541('0xc')](),controller[_0x5541('0xd')]);router['get']('/:id/attachment_download',auth[_0x5541('0xc')](),controller[_0x5541('0xe')]);router['get'](_0x5541('0xf'),auth[_0x5541('0x9')](),controller[_0x5541('0x10')]);router['get'](_0x5541('0x11'),auth[_0x5541('0xc')](),controller[_0x5541('0x12')]);router[_0x5541('0x8')](_0x5541('0x13'),auth[_0x5541('0x9')](),controller[_0x5541('0x14')]);router['post']('/',auth[_0x5541('0x9')](),controller['create']);router[_0x5541('0x15')](_0x5541('0x16'),auth[_0x5541('0x9')](),controller[_0x5541('0x17')]);var upload=multer({'storage':multer[_0x5541('0x18')]({'destination':function(_0xfb285c,_0x1340f8,_0x24eb66){_0x24eb66(null,path[_0x5541('0x19')](config['root'],'server/files/attachments/'));},'filename':function(_0x1be80b,_0x135027,_0x3a087a){_0x3a087a(null,util[_0x5541('0x1a')](_0x5541('0x1b'),Date[_0x5541('0x1c')](),_0x135027[_0x5541('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5541('0x15')](_0x5541('0x1e'),upload[_0x5541('0x1f')](_0x5541('0x20')),controller[_0x5541('0x21')]);router[_0x5541('0x15')](_0x5541('0xf'),auth[_0x5541('0xc')](),controller[_0x5541('0x22')]);router['post'](_0x5541('0x23'),auth[_0x5541('0x9')](),interaction[_0x5541('0x24')](_0x5541('0x25'),_0x5541('0x26')),controller[_0x5541('0x27')]);router[_0x5541('0x28')](_0x5541('0x29'),auth[_0x5541('0x9')](),interaction[_0x5541('0x24')](_0x5541('0x25'),'chatinteraction:update'),controller[_0x5541('0x2a')]);router['put'](_0x5541('0x2b'),controller[_0x5541('0x2c')]);router['put']('/:id/abandon',auth[_0x5541('0xc')](),controller[_0x5541('0x2d')]);router[_0x5541('0x28')]('/:id/close',controller['close']);router[_0x5541('0x2e')](_0x5541('0x29'),auth[_0x5541('0x9')](),interaction['tracked'](_0x5541('0x25'),'chatinteraction:destroy'),controller[_0x5541('0x2f')]);router[_0x5541('0x2e')](_0x5541('0x23'),auth[_0x5541('0x9')](),controller['removeTags']);module[_0x5541('0x30')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index da46d79..e596d24 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 _0xa801=['exports','medium','INTEGER','sequelize'];(function(_0x4d3924,_0x327b56){var _0x844555=function(_0x387a6d){while(--_0x387a6d){_0x4d3924['push'](_0x4d3924['shift']());}};_0x844555(++_0x327b56);}(_0xa801,0xff));var _0x1a80=function(_0x66a617,_0x404f3f){_0x66a617=_0x66a617-0x0;var _0x76e7b4=_0xa801[_0x66a617];return _0x76e7b4;};'use strict';var Sequelize=require(_0x1a80('0x0'));module[_0x1a80('0x1')]={'body':{'type':Sequelize['TEXT'](_0x1a80('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x1a80('0x3')]}}; \ No newline at end of file +var _0xc9e9=['exports','TEXT','BOOLEAN','INTEGER','sequelize'];(function(_0x8c1005,_0x1f3f16){var _0x175354=function(_0xd0e9c4){while(--_0xd0e9c4){_0x8c1005['push'](_0x8c1005['shift']());}};_0x175354(++_0x1f3f16);}(_0xc9e9,0xb8));var _0x9c9e=function(_0x352e09,_0x37a7da){_0x352e09=_0x352e09-0x0;var _0x1b7094=_0xc9e9[_0x352e09];return _0x1b7094;};'use strict';var Sequelize=require(_0x9c9e('0x0'));module[_0x9c9e('0x1')]={'body':{'type':Sequelize[_0x9c9e('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x9c9e('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x9c9e('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index bd69fbb..82bffea 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 _0xc923=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','redis','sendStatus','status','end','json','offset','undefined','count','set','apply','save','update','then','destroy','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filters','where','merge','type','VIRTUAL','filter','findAll','rows','catch','show','params','options','find','create','body','describe','get','messages','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','agent','admin','user','role','internal','online','lastLoginAt','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','isEmpty','resourceId','push','createdAt','FromId','ToId','read','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service'];(function(_0x1f0ccb,_0x2cca8f){var _0x41d556=function(_0x1fc247){while(--_0x1fc247){_0x1f0ccb['push'](_0x1f0ccb['shift']());}};_0x41d556(++_0x2cca8f);}(_0xc923,0x128));var _0x3c92=function(_0x3f36fb,_0x3ff603){_0x3f36fb=_0x3f36fb-0x0;var _0x460c50=_0xc923[_0x3f36fb];return _0x460c50;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3c92('0x0'));var zipdir=require(_0x3c92('0x1'));var jsonpatch=require(_0x3c92('0x2'));var rp=require(_0x3c92('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3c92('0x4'));var util=require(_0x3c92('0x5'));var path=require('path');var sox=require(_0x3c92('0x6'));var csv=require('to-csv');var ejs=require(_0x3c92('0x7'));var fs=require('fs');var fs_extra=require(_0x3c92('0x8'));var _=require(_0x3c92('0x9'));var squel=require(_0x3c92('0xa'));var crypto=require(_0x3c92('0xb'));var jsforce=require(_0x3c92('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3c92('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3c92('0xe'));var authService=require(_0x3c92('0xf'));var qs=require(_0x3c92('0x10'));var as=require(_0x3c92('0x11'));var hardwareService=require(_0x3c92('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3c92('0x13'));var licenseUtil=require(_0x3c92('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x3c92('0x15')](config['redis'],{'host':_0x3c92('0x16'),'port':0x18eb});var socket=require(_0x3c92('0x17'))(new Redis(config[_0x3c92('0x18')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x4426dd,_0x42f9bc){_0x42f9bc=_0x42f9bc||0xcc;return function(_0x4c1612){if(_0x4c1612){return _0x4426dd[_0x3c92('0x19')](_0x42f9bc);}return _0x4426dd[_0x3c92('0x1a')](_0x42f9bc)[_0x3c92('0x1b')]();};}function respondWithResult(_0x262f9f,_0x1d9b26){_0x1d9b26=_0x1d9b26||0xc8;return function(_0x3a57ee){if(_0x3a57ee){return _0x262f9f[_0x3c92('0x1a')](_0x1d9b26)[_0x3c92('0x1c')](_0x3a57ee);}};}function respondWithFilteredResult(_0x232a20,_0x367bd6){return function(_0x29e355){if(_0x29e355){var _0x2a432d=typeof _0x367bd6[_0x3c92('0x1d')]==='undefined'&&typeof _0x367bd6['limit']===_0x3c92('0x1e');var _0x5a52a4=_0x29e355[_0x3c92('0x1f')];var _0x464cfc=_0x2a432d?0x0:_0x367bd6['offset'];var _0x2aa046=_0x2a432d?_0x29e355[_0x3c92('0x1f')]:_0x367bd6['offset']+_0x367bd6['limit'];var _0x24d650;if(_0x2aa046>=_0x5a52a4){_0x2aa046=_0x5a52a4;_0x24d650=0xc8;}else{_0x24d650=0xce;}_0x232a20[_0x3c92('0x1a')](_0x24d650);return _0x232a20[_0x3c92('0x20')]('Content-Range',_0x464cfc+'-'+_0x2aa046+'/'+_0x5a52a4)[_0x3c92('0x1c')](_0x29e355);}return null;};}function patchUpdates(_0x31a786){return function(_0x54ac2a){try{jsonpatch[_0x3c92('0x21')](_0x54ac2a,_0x31a786,!![]);}catch(_0x4a6ef6){return BPromise['reject'](_0x4a6ef6);}return _0x54ac2a[_0x3c92('0x22')]();};}function saveUpdates(_0x28cbd6,_0x2e4bcd){return function(_0x159d46){if(_0x159d46){return _0x159d46[_0x3c92('0x23')](_0x28cbd6)[_0x3c92('0x24')](function(_0x1d73d9){return _0x1d73d9;});}return null;};}function removeEntity(_0x461a65,_0x26687e){return function(_0x3d152c){if(_0x3d152c){return _0x3d152c[_0x3c92('0x25')]()['then'](function(){_0x461a65[_0x3c92('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43bfaf,_0x3799c5){return function(_0x521815){if(!_0x521815){_0x43bfaf[_0x3c92('0x19')](0x194);}return _0x521815;};}function handleError(_0x277c07,_0x5c4924){_0x5c4924=_0x5c4924||0x1f4;return function(_0x5967e1){logger['error'](_0x5967e1[_0x3c92('0x26')]);if(_0x5967e1['name']){delete _0x5967e1[_0x3c92('0x27')];}_0x277c07[_0x3c92('0x1a')](_0x5c4924)[_0x3c92('0x28')](_0x5967e1);};}exports[_0x3c92('0x29')]=function(_0x224a46,_0x59e382){var _0x1c6772={},_0x1f9aaa={},_0x26a3cc={'count':0x0,'rows':[]};var _0x3b4087=_['map'](db[_0x3c92('0x2a')][_0x3c92('0x2b')],function(_0x368d07){return{'name':_0x368d07[_0x3c92('0x2c')],'type':_0x368d07['type'][_0x3c92('0x2d')]};});_0x1f9aaa[_0x3c92('0x2e')]=_[_0x3c92('0x2f')](_0x3b4087,_0x3c92('0x27'));_0x1f9aaa[_0x3c92('0x30')]=_[_0x3c92('0x31')](_0x224a46[_0x3c92('0x30')]);_0x1f9aaa['filters']=_[_0x3c92('0x32')](_0x1f9aaa[_0x3c92('0x2e')],_0x1f9aaa[_0x3c92('0x30')]);_0x1c6772['attributes']=_[_0x3c92('0x32')](_0x1f9aaa[_0x3c92('0x2e')],qs[_0x3c92('0x33')](_0x224a46[_0x3c92('0x30')][_0x3c92('0x33')]));_0x1c6772[_0x3c92('0x34')]=_0x1c6772[_0x3c92('0x34')][_0x3c92('0x35')]?_0x1c6772['attributes']:_0x1f9aaa[_0x3c92('0x2e')];if(!_0x224a46[_0x3c92('0x30')][_0x3c92('0x36')](_0x3c92('0x37'))){_0x1c6772[_0x3c92('0x38')]=qs[_0x3c92('0x38')](_0x224a46[_0x3c92('0x30')][_0x3c92('0x38')]);_0x1c6772[_0x3c92('0x1d')]=qs[_0x3c92('0x1d')](_0x224a46['query'][_0x3c92('0x1d')]);}_0x1c6772[_0x3c92('0x39')]=qs[_0x3c92('0x3a')](_0x224a46[_0x3c92('0x30')][_0x3c92('0x3a')]);_0x1c6772['where']=qs[_0x3c92('0x3b')](_['pick'](_0x224a46['query'],_0x1f9aaa[_0x3c92('0x3b')]),_0x3b4087);if(_0x224a46[_0x3c92('0x30')]['filter']){_0x1c6772[_0x3c92('0x3c')]=_[_0x3c92('0x3d')](_0x1c6772['where'],{'$or':_[_0x3c92('0x2f')](_0x3b4087,function(_0x27e965){if(_0x27e965[_0x3c92('0x3e')]!==_0x3c92('0x3f')){var _0x1ab70c={};_0x1ab70c[_0x27e965[_0x3c92('0x27')]]={'$like':'%'+_0x224a46[_0x3c92('0x30')][_0x3c92('0x40')]+'%'};return _0x1ab70c;}})});}_0x1c6772=_['merge']({},_0x1c6772,_0x224a46['options']);var _0x1726a6={'where':_0x1c6772['where']};return db[_0x3c92('0x2a')]['count'](_0x1726a6)[_0x3c92('0x24')](function(_0x158176){_0x26a3cc['count']=_0x158176;if(_0x224a46[_0x3c92('0x30')]['includeAll']){_0x1c6772['include']=[{'all':!![]}];}return db['ChatInternalMessage'][_0x3c92('0x41')](_0x1c6772);})[_0x3c92('0x24')](function(_0x62d474){_0x26a3cc[_0x3c92('0x42')]=_0x62d474;return _0x26a3cc;})[_0x3c92('0x24')](respondWithFilteredResult(_0x59e382,_0x1c6772))[_0x3c92('0x43')](handleError(_0x59e382,null));};exports[_0x3c92('0x44')]=function(_0x57d67c,_0x5caf0a){var _0x10d2a2={'raw':!![],'where':{'id':_0x57d67c[_0x3c92('0x45')]['id']}},_0x161ba8={};_0x161ba8[_0x3c92('0x2e')]=_[_0x3c92('0x31')](db[_0x3c92('0x2a')][_0x3c92('0x2b')]);_0x161ba8['query']=_[_0x3c92('0x31')](_0x57d67c[_0x3c92('0x30')]);_0x161ba8['filters']=_[_0x3c92('0x32')](_0x161ba8[_0x3c92('0x2e')],_0x161ba8[_0x3c92('0x30')]);_0x10d2a2[_0x3c92('0x34')]=_[_0x3c92('0x32')](_0x161ba8[_0x3c92('0x2e')],qs[_0x3c92('0x33')](_0x57d67c[_0x3c92('0x30')]['fields']));_0x10d2a2['attributes']=_0x10d2a2[_0x3c92('0x34')][_0x3c92('0x35')]?_0x10d2a2['attributes']:_0x161ba8[_0x3c92('0x2e')];if(_0x57d67c[_0x3c92('0x30')]['includeAll']){_0x10d2a2['include']=[{'all':!![]}];}_0x10d2a2=_[_0x3c92('0x3d')]({},_0x10d2a2,_0x57d67c[_0x3c92('0x46')]);return db[_0x3c92('0x2a')][_0x3c92('0x47')](_0x10d2a2)[_0x3c92('0x24')](handleEntityNotFound(_0x5caf0a,null))[_0x3c92('0x24')](respondWithResult(_0x5caf0a,null))[_0x3c92('0x43')](handleError(_0x5caf0a,null));};exports[_0x3c92('0x48')]=function(_0x2c0f59,_0x4aa97c){return db[_0x3c92('0x2a')][_0x3c92('0x48')](_0x2c0f59['body'],{})[_0x3c92('0x24')](respondWithResult(_0x4aa97c,0xc9))[_0x3c92('0x43')](handleError(_0x4aa97c,null));};exports[_0x3c92('0x23')]=function(_0xd5efc7,_0x555354){if(_0xd5efc7[_0x3c92('0x49')]['id']){delete _0xd5efc7['body']['id'];}return db[_0x3c92('0x2a')][_0x3c92('0x47')]({'where':{'id':_0xd5efc7[_0x3c92('0x45')]['id']}})[_0x3c92('0x24')](handleEntityNotFound(_0x555354,null))[_0x3c92('0x24')](saveUpdates(_0xd5efc7[_0x3c92('0x49')],null))[_0x3c92('0x24')](respondWithResult(_0x555354,null))[_0x3c92('0x43')](handleError(_0x555354,null));};exports[_0x3c92('0x25')]=function(_0x56aee6,_0x5822b6){return db[_0x3c92('0x2a')][_0x3c92('0x47')]({'where':{'id':_0x56aee6[_0x3c92('0x45')]['id']}})[_0x3c92('0x24')](handleEntityNotFound(_0x5822b6,null))[_0x3c92('0x24')](removeEntity(_0x5822b6,null))[_0x3c92('0x43')](handleError(_0x5822b6,null));};exports[_0x3c92('0x4a')]=function(_0x374b58,_0x38c260){return db[_0x3c92('0x2a')][_0x3c92('0x4a')]()[_0x3c92('0x24')](respondWithResult(_0x38c260,null))['catch'](handleError(_0x38c260,null));};function wrapUser(_0x15068e){return function(_0x4a3e07){var _0x225523=_0x15068e[_0x3c92('0x4b')]({'plain':!![]});_0x225523[_0x3c92('0x4c')]=[];if(_0x4a3e07){_0x225523['lastMessageAt']=_0x4a3e07['createdAt'];_0x225523['lastMessage']=_0x4a3e07;}else{_0x225523['lastMessageAt']=moment(0x0)[_0x3c92('0x4d')](_0x3c92('0x4e'));_0x225523[_0x3c92('0x4f')]={};}return _0x225523;};}exports[_0x3c92('0x50')]=function(_0x58dec9,_0x5cf50e,_0x3b3647){var _0x1a2472=[];return db['User'][_0x3c92('0x41')]({'where':{'role':[_0x3c92('0x51'),_0x3c92('0x52'),_0x3c92('0x53')]},'attributes':['id','fullname','name',_0x3c92('0x54'),'userpic',_0x3c92('0x55'),_0x3c92('0x56'),_0x3c92('0x57'),'allowmessenger','showWebBar'],'order':qs[_0x3c92('0x3a')]('-online'),'include':[{'model':db[_0x3c92('0x58')],'as':_0x3c92('0x59'),'attributes':['id',_0x3c92('0x27'),'type'],'through':{'attributes':[]}}]})[_0x3c92('0x24')](function(_0x240e08){if(_0x240e08){var _0x50b9b1=_0x58dec9[_0x3c92('0x53')][_0x3c92('0x4b')]({'plain':!![]});if(!_0x50b9b1)throw new Error(_0x3c92('0x5a'));if(_0x50b9b1[_0x3c92('0x54')]===_0x3c92('0x53')){return db[_0x3c92('0x5b')][_0x3c92('0x47')]({'where':{'name':_0x3c92('0x5c'),'userProfileId':_0x50b9b1[_0x3c92('0x5d')]},'raw':!![]})[_0x3c92('0x24')](function(_0x154cc6){if(_0x154cc6){if(_0x154cc6[_0x3c92('0x5e')]===0x0){return db['UserProfileResource'][_0x3c92('0x41')]({'where':{'sectionId':_0x154cc6['id']},'raw':!![]})[_0x3c92('0x24')](function(_0x40206d){var _0x573d41=[];if(_[_0x3c92('0x5f')](_0x40206d)){_0x573d41=_[_0x3c92('0x40')](_0x240e08,function(_0x4881b5){if(_0x4881b5[_0x3c92('0x54')]!==_0x3c92('0x51')){return _0x4881b5;}});return _0x573d41;}else{for(var _0x125e09=0x0;_0x125e09<_0x240e08[_0x3c92('0x35')];_0x125e09++){var _0x405a52=_0x240e08[_0x125e09];if(_0x405a52[_0x3c92('0x54')]===_0x3c92('0x51')){var _0x24c95f=_[_0x3c92('0x47')](_0x40206d,function(_0x13c58a){return _0x13c58a[_0x3c92('0x60')]===_0x405a52['id'];});if(_0x24c95f)_0x573d41['push'](_0x405a52);}else{_0x573d41[_0x3c92('0x61')](_0x405a52);}}return _0x573d41;}});}else{return _0x240e08;}}else{var _0x475a9a=_['filter'](_0x240e08,function(_0x1ca1aa){if(_0x1ca1aa[_0x3c92('0x54')]!==_0x3c92('0x51')){return _0x1ca1aa;}});return _0x475a9a;}});}else{return _0x240e08;}}})[_0x3c92('0x24')](function(_0x2e8789){var _0x105bc8=[];if(_0x2e8789){_0x1a2472=_0x2e8789;for(var _0x5795cc=0x0;_0x5795cc<_0x2e8789['length'];_0x5795cc+=0x1){_0x1a2472[_0x5795cc][_0x3c92('0x4c')]=[];_0x105bc8[_0x3c92('0x61')](db['ChatInternalMessage'][_0x3c92('0x47')]({'where':{'FromId':[_0x58dec9[_0x3c92('0x53')]['id'],_0x2e8789[_0x5795cc]['id']],'ToId':[_0x58dec9['user']['id'],_0x2e8789[_0x5795cc]['id']],'ChatGroupId':null},'attributes':['id',_0x3c92('0x62'),_0x3c92('0x63'),_0x3c92('0x64'),_0x3c92('0x65'),_0x3c92('0x49')],'order':qs[_0x3c92('0x3a')](_0x3c92('0x66')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x3c92('0x24')](wrapUser(_0x2e8789[_0x5795cc])));}return BPromise[_0x3c92('0x67')](_0x105bc8);}return[];})[_0x3c92('0x24')](function(_0x5edb17){return{'rows':_0x5edb17,'count':_0x5edb17['length']};})['then'](respondWithResult(_0x5cf50e,null))['catch'](handleError(_0x5cf50e,null));}; \ No newline at end of file +var _0xeb82=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','./chatInternalMessage.socket','end','status','json','offset','count','limit','set','Content-Range','reject','save','update','destroy','then','stack','send','map','ChatInternalMessage','rawAttributes','fieldName','key','model','name','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','options','rows','catch','show','params','keys','length','include','find','create','body','describe','get','messages','lastMessageAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','User','findAll','agent','admin','user','fullname','role','userpic','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','createdAt','FromId','ToId','read','-createdAt','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x2ba6b6,_0xd11764){var _0x435f1e=function(_0x42f16e){while(--_0x42f16e){_0x2ba6b6['push'](_0x2ba6b6['shift']());}};_0x435f1e(++_0xd11764);}(_0xeb82,0x199));var _0x2eb8=function(_0x22a99c,_0x5b0985){_0x22a99c=_0x22a99c-0x0;var _0x5a10bf=_0xeb82[_0x22a99c];return _0x5a10bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2eb8('0x0'));var zipdir=require(_0x2eb8('0x1'));var jsonpatch=require(_0x2eb8('0x2'));var rp=require(_0x2eb8('0x3'));var moment=require('moment');var BPromise=require(_0x2eb8('0x4'));var Mustache=require(_0x2eb8('0x5'));var util=require(_0x2eb8('0x6'));var path=require(_0x2eb8('0x7'));var sox=require('sox');var csv=require(_0x2eb8('0x8'));var ejs=require(_0x2eb8('0x9'));var fs=require('fs');var fs_extra=require(_0x2eb8('0xa'));var _=require(_0x2eb8('0xb'));var squel=require(_0x2eb8('0xc'));var crypto=require('crypto');var jsforce=require(_0x2eb8('0xd'));var deskjs=require(_0x2eb8('0xe'));var toCsv=require(_0x2eb8('0x8'));var querystring=require('querystring');var Papa=require(_0x2eb8('0xf'));var Redis=require(_0x2eb8('0x10'));var authService=require(_0x2eb8('0x11'));var qs=require(_0x2eb8('0x12'));var as=require(_0x2eb8('0x13'));var hardwareService=require(_0x2eb8('0x14'));var logger=require(_0x2eb8('0x15'))(_0x2eb8('0x16'));var utils=require(_0x2eb8('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2eb8('0x18'));var db=require(_0x2eb8('0x19'))['db'];config['redis']=_[_0x2eb8('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2eb8('0x1b'))(new Redis(config['redis']));require(_0x2eb8('0x1c'))['register'](socket);function respondWithStatusCode(_0x51a775,_0x201078){_0x201078=_0x201078||0xcc;return function(_0x57d7e8){if(_0x57d7e8){return _0x51a775['sendStatus'](_0x201078);}return _0x51a775['status'](_0x201078)[_0x2eb8('0x1d')]();};}function respondWithResult(_0x33c81e,_0x321d5f){_0x321d5f=_0x321d5f||0xc8;return function(_0x4d691b){if(_0x4d691b){return _0x33c81e[_0x2eb8('0x1e')](_0x321d5f)[_0x2eb8('0x1f')](_0x4d691b);}};}function respondWithFilteredResult(_0x14512f,_0x1f9b22){return function(_0x59458c){if(_0x59458c){var _0x3b8e34=typeof _0x1f9b22[_0x2eb8('0x20')]==='undefined'&&typeof _0x1f9b22['limit']==='undefined';var _0x5b6ea7=_0x59458c[_0x2eb8('0x21')];var _0x3cc59e=_0x3b8e34?0x0:_0x1f9b22['offset'];var _0x13d01b=_0x3b8e34?_0x59458c[_0x2eb8('0x21')]:_0x1f9b22[_0x2eb8('0x20')]+_0x1f9b22[_0x2eb8('0x22')];var _0x414839;if(_0x13d01b>=_0x5b6ea7){_0x13d01b=_0x5b6ea7;_0x414839=0xc8;}else{_0x414839=0xce;}_0x14512f[_0x2eb8('0x1e')](_0x414839);return _0x14512f[_0x2eb8('0x23')](_0x2eb8('0x24'),_0x3cc59e+'-'+_0x13d01b+'/'+_0x5b6ea7)[_0x2eb8('0x1f')](_0x59458c);}return null;};}function patchUpdates(_0x30c3db){return function(_0x1e96f3){try{jsonpatch['apply'](_0x1e96f3,_0x30c3db,!![]);}catch(_0x53c73f){return BPromise[_0x2eb8('0x25')](_0x53c73f);}return _0x1e96f3[_0x2eb8('0x26')]();};}function saveUpdates(_0x690b80,_0x2e7642){return function(_0x5c6036){if(_0x5c6036){return _0x5c6036[_0x2eb8('0x27')](_0x690b80)['then'](function(_0x5a024d){return _0x5a024d;});}return null;};}function removeEntity(_0x2f682c,_0xed74d0){return function(_0x43186f){if(_0x43186f){return _0x43186f[_0x2eb8('0x28')]()[_0x2eb8('0x29')](function(){_0x2f682c['status'](0xcc)[_0x2eb8('0x1d')]();});}};}function handleEntityNotFound(_0x5774aa,_0x4d1aaa){return function(_0x5089a2){if(!_0x5089a2){_0x5774aa['sendStatus'](0x194);}return _0x5089a2;};}function handleError(_0x460afb,_0x7444c){_0x7444c=_0x7444c||0x1f4;return function(_0x7bfc31){logger['error'](_0x7bfc31[_0x2eb8('0x2a')]);if(_0x7bfc31['name']){delete _0x7bfc31['name'];}_0x460afb[_0x2eb8('0x1e')](_0x7444c)[_0x2eb8('0x2b')](_0x7bfc31);};}exports['index']=function(_0x975e4a,_0x1b5dc9){var _0x3db4f3={},_0x3e3639={},_0x4f1279={'count':0x0,'rows':[]};var _0x106ad8=_[_0x2eb8('0x2c')](db[_0x2eb8('0x2d')][_0x2eb8('0x2e')],function(_0x5982ec){return{'name':_0x5982ec[_0x2eb8('0x2f')],'type':_0x5982ec['type'][_0x2eb8('0x30')]};});_0x3e3639[_0x2eb8('0x31')]=_['map'](_0x106ad8,_0x2eb8('0x32'));_0x3e3639['query']=_['keys'](_0x975e4a['query']);_0x3e3639[_0x2eb8('0x33')]=_[_0x2eb8('0x34')](_0x3e3639[_0x2eb8('0x31')],_0x3e3639[_0x2eb8('0x35')]);_0x3db4f3[_0x2eb8('0x36')]=_[_0x2eb8('0x34')](_0x3e3639[_0x2eb8('0x31')],qs[_0x2eb8('0x37')](_0x975e4a[_0x2eb8('0x35')]['fields']));_0x3db4f3[_0x2eb8('0x36')]=_0x3db4f3['attributes']['length']?_0x3db4f3[_0x2eb8('0x36')]:_0x3e3639[_0x2eb8('0x31')];if(!_0x975e4a[_0x2eb8('0x35')][_0x2eb8('0x38')]('nolimit')){_0x3db4f3['limit']=qs['limit'](_0x975e4a[_0x2eb8('0x35')][_0x2eb8('0x22')]);_0x3db4f3[_0x2eb8('0x20')]=qs['offset'](_0x975e4a[_0x2eb8('0x35')]['offset']);}_0x3db4f3[_0x2eb8('0x39')]=qs[_0x2eb8('0x3a')](_0x975e4a[_0x2eb8('0x35')][_0x2eb8('0x3a')]);_0x3db4f3[_0x2eb8('0x3b')]=qs[_0x2eb8('0x33')](_[_0x2eb8('0x3c')](_0x975e4a[_0x2eb8('0x35')],_0x3e3639[_0x2eb8('0x33')]),_0x106ad8);if(_0x975e4a[_0x2eb8('0x35')][_0x2eb8('0x3d')]){_0x3db4f3[_0x2eb8('0x3b')]=_['merge'](_0x3db4f3[_0x2eb8('0x3b')],{'$or':_[_0x2eb8('0x2c')](_0x106ad8,function(_0x5a06a5){if(_0x5a06a5[_0x2eb8('0x3e')]!==_0x2eb8('0x3f')){var _0x128e7a={};_0x128e7a[_0x5a06a5[_0x2eb8('0x32')]]={'$like':'%'+_0x975e4a['query'][_0x2eb8('0x3d')]+'%'};return _0x128e7a;}})});}_0x3db4f3=_['merge']({},_0x3db4f3,_0x975e4a[_0x2eb8('0x40')]);var _0x19bf72={'where':_0x3db4f3['where']};return db[_0x2eb8('0x2d')][_0x2eb8('0x21')](_0x19bf72)[_0x2eb8('0x29')](function(_0x275915){_0x4f1279['count']=_0x275915;if(_0x975e4a[_0x2eb8('0x35')]['includeAll']){_0x3db4f3['include']=[{'all':!![]}];}return db[_0x2eb8('0x2d')]['findAll'](_0x3db4f3);})[_0x2eb8('0x29')](function(_0x3b2f13){_0x4f1279[_0x2eb8('0x41')]=_0x3b2f13;return _0x4f1279;})[_0x2eb8('0x29')](respondWithFilteredResult(_0x1b5dc9,_0x3db4f3))[_0x2eb8('0x42')](handleError(_0x1b5dc9,null));};exports[_0x2eb8('0x43')]=function(_0x2fe730,_0x3d491e){var _0xd2b736={'raw':!![],'where':{'id':_0x2fe730[_0x2eb8('0x44')]['id']}},_0x1cf634={};_0x1cf634[_0x2eb8('0x31')]=_[_0x2eb8('0x45')](db[_0x2eb8('0x2d')]['rawAttributes']);_0x1cf634[_0x2eb8('0x35')]=_[_0x2eb8('0x45')](_0x2fe730[_0x2eb8('0x35')]);_0x1cf634[_0x2eb8('0x33')]=_[_0x2eb8('0x34')](_0x1cf634[_0x2eb8('0x31')],_0x1cf634['query']);_0xd2b736[_0x2eb8('0x36')]=_['intersection'](_0x1cf634[_0x2eb8('0x31')],qs[_0x2eb8('0x37')](_0x2fe730[_0x2eb8('0x35')]['fields']));_0xd2b736[_0x2eb8('0x36')]=_0xd2b736[_0x2eb8('0x36')][_0x2eb8('0x46')]?_0xd2b736[_0x2eb8('0x36')]:_0x1cf634['model'];if(_0x2fe730['query']['includeAll']){_0xd2b736[_0x2eb8('0x47')]=[{'all':!![]}];}_0xd2b736=_['merge']({},_0xd2b736,_0x2fe730['options']);return db['ChatInternalMessage'][_0x2eb8('0x48')](_0xd2b736)[_0x2eb8('0x29')](handleEntityNotFound(_0x3d491e,null))[_0x2eb8('0x29')](respondWithResult(_0x3d491e,null))[_0x2eb8('0x42')](handleError(_0x3d491e,null));};exports['create']=function(_0x2deb4f,_0x203980){return db[_0x2eb8('0x2d')][_0x2eb8('0x49')](_0x2deb4f['body'],{})[_0x2eb8('0x29')](respondWithResult(_0x203980,0xc9))[_0x2eb8('0x42')](handleError(_0x203980,null));};exports[_0x2eb8('0x27')]=function(_0x5364ae,_0x96eb0){if(_0x5364ae[_0x2eb8('0x4a')]['id']){delete _0x5364ae[_0x2eb8('0x4a')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x5364ae['params']['id']}})['then'](handleEntityNotFound(_0x96eb0,null))[_0x2eb8('0x29')](saveUpdates(_0x5364ae[_0x2eb8('0x4a')],null))['then'](respondWithResult(_0x96eb0,null))['catch'](handleError(_0x96eb0,null));};exports[_0x2eb8('0x28')]=function(_0x77c178,_0xff6c77){return db[_0x2eb8('0x2d')][_0x2eb8('0x48')]({'where':{'id':_0x77c178[_0x2eb8('0x44')]['id']}})[_0x2eb8('0x29')](handleEntityNotFound(_0xff6c77,null))[_0x2eb8('0x29')](removeEntity(_0xff6c77,null))[_0x2eb8('0x42')](handleError(_0xff6c77,null));};exports[_0x2eb8('0x4b')]=function(_0x1550c7,_0x2f0079){return db[_0x2eb8('0x2d')][_0x2eb8('0x4b')]()[_0x2eb8('0x29')](respondWithResult(_0x2f0079,null))['catch'](handleError(_0x2f0079,null));};function wrapUser(_0x25916e){return function(_0x4175ea){var _0x243d96=_0x25916e[_0x2eb8('0x4c')]({'plain':!![]});_0x243d96[_0x2eb8('0x4d')]=[];if(_0x4175ea){_0x243d96[_0x2eb8('0x4e')]=_0x4175ea['createdAt'];_0x243d96[_0x2eb8('0x4f')]=_0x4175ea;}else{_0x243d96['lastMessageAt']=moment(0x0)['format'](_0x2eb8('0x50'));_0x243d96['lastMessage']={};}return _0x243d96;};}exports['getUsers']=function(_0x216200,_0x4a8ba0,_0x48e323){var _0x14b5fd=[];return db[_0x2eb8('0x51')][_0x2eb8('0x52')]({'where':{'role':[_0x2eb8('0x53'),_0x2eb8('0x54'),_0x2eb8('0x55')]},'attributes':['id',_0x2eb8('0x56'),'name',_0x2eb8('0x57'),_0x2eb8('0x58'),'internal','online',_0x2eb8('0x59'),_0x2eb8('0x5a'),_0x2eb8('0x5b')],'order':qs['sort'](_0x2eb8('0x5c')),'include':[{'model':db[_0x2eb8('0x5d')],'as':_0x2eb8('0x5e'),'attributes':['id',_0x2eb8('0x32'),_0x2eb8('0x3e')],'through':{'attributes':[]}}]})['then'](function(_0x444a81){if(_0x444a81){var _0x239e58=_0x216200[_0x2eb8('0x55')][_0x2eb8('0x4c')]({'plain':!![]});if(!_0x239e58)throw new Error(_0x2eb8('0x5f'));if(_0x239e58[_0x2eb8('0x57')]===_0x2eb8('0x55')){return db['UserProfileSection'][_0x2eb8('0x48')]({'where':{'name':_0x2eb8('0x60'),'userProfileId':_0x239e58[_0x2eb8('0x61')]},'raw':!![]})[_0x2eb8('0x29')](function(_0x3a55c1){if(_0x3a55c1){if(_0x3a55c1[_0x2eb8('0x62')]===0x0){return db[_0x2eb8('0x63')][_0x2eb8('0x52')]({'where':{'sectionId':_0x3a55c1['id']},'raw':!![]})[_0x2eb8('0x29')](function(_0x3db4e0){var _0x41301f=[];if(_[_0x2eb8('0x64')](_0x3db4e0)){_0x41301f=_['filter'](_0x444a81,function(_0x3143a8){if(_0x3143a8[_0x2eb8('0x57')]!=='agent'){return _0x3143a8;}});return _0x41301f;}else{for(var _0x250f27=0x0;_0x250f27<_0x444a81[_0x2eb8('0x46')];_0x250f27++){var _0x5a2c62=_0x444a81[_0x250f27];if(_0x5a2c62[_0x2eb8('0x57')]==='agent'){var _0x3d4844=_[_0x2eb8('0x48')](_0x3db4e0,function(_0x467cc4){return _0x467cc4['resourceId']===_0x5a2c62['id'];});if(_0x3d4844)_0x41301f[_0x2eb8('0x65')](_0x5a2c62);}else{_0x41301f[_0x2eb8('0x65')](_0x5a2c62);}}return _0x41301f;}});}else{return _0x444a81;}}else{var _0x10dbfa=_[_0x2eb8('0x3d')](_0x444a81,function(_0x3d378e){if(_0x3d378e[_0x2eb8('0x57')]!==_0x2eb8('0x53')){return _0x3d378e;}});return _0x10dbfa;}});}else{return _0x444a81;}}})[_0x2eb8('0x29')](function(_0x53b97a){var _0x1bfd9c=[];if(_0x53b97a){_0x14b5fd=_0x53b97a;for(var _0x18ffc7=0x0;_0x18ffc7<_0x53b97a[_0x2eb8('0x46')];_0x18ffc7+=0x1){_0x14b5fd[_0x18ffc7][_0x2eb8('0x4d')]=[];_0x1bfd9c['push'](db['ChatInternalMessage'][_0x2eb8('0x48')]({'where':{'FromId':[_0x216200['user']['id'],_0x53b97a[_0x18ffc7]['id']],'ToId':[_0x216200[_0x2eb8('0x55')]['id'],_0x53b97a[_0x18ffc7]['id']],'ChatGroupId':null},'attributes':['id',_0x2eb8('0x66'),_0x2eb8('0x67'),_0x2eb8('0x68'),_0x2eb8('0x69'),_0x2eb8('0x4a')],'order':qs[_0x2eb8('0x3a')](_0x2eb8('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x2eb8('0x29')](wrapUser(_0x53b97a[_0x18ffc7])));}return BPromise['all'](_0x1bfd9c);}return[];})[_0x2eb8('0x29')](function(_0x3752b1){return{'rows':_0x3752b1,'count':_0x3752b1['length']};})[_0x2eb8('0x29')](respondWithResult(_0x4a8ba0,null))['catch'](handleError(_0x4a8ba0,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index ddc2eb6..61831ef 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 _0x92ac=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','update','remove'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x92ac,0x151));var _0xc92a=function(_0x43d16c,_0x2b5447){_0x43d16c=_0x43d16c-0x0;var _0x208cce=_0x92ac[_0x43d16c];return _0x208cce;};'use strict';var EventEmitter=require(_0xc92a('0x0'));var ChatInternalMessage=require(_0xc92a('0x1'))['db'][_0xc92a('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc92a('0x3'),'afterDestroy':_0xc92a('0x4')};function emitEvent(_0xa914c5){return function(_0x4d3ce8,_0xd28bb9,_0x361ff2){ChatInternalMessageEvents['emit'](_0xa914c5+':'+_0x4d3ce8['id'],_0x4d3ce8);ChatInternalMessageEvents[_0xc92a('0x5')](_0xa914c5,_0x4d3ce8);_0x361ff2(null);};}for(var e in events){if(events[_0xc92a('0x6')](e)){var event=events[e];ChatInternalMessage[_0xc92a('0x7')](e,emitEvent(event));}}module[_0xc92a('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x41b5=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save'];(function(_0x13945b,_0x289c94){var _0x1b1643=function(_0x18f4c3){while(--_0x18f4c3){_0x13945b['push'](_0x13945b['shift']());}};_0x1b1643(++_0x289c94);}(_0x41b5,0x124));var _0x541b=function(_0x2cc702,_0x378584){_0x2cc702=_0x2cc702-0x0;var _0x1f515e=_0x41b5[_0x2cc702];return _0x1f515e;};'use strict';var EventEmitter=require(_0x541b('0x0'));var ChatInternalMessage=require(_0x541b('0x1'))['db'][_0x541b('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x541b('0x3')](0x0);var events={'afterCreate':_0x541b('0x4'),'afterUpdate':_0x541b('0x5'),'afterDestroy':_0x541b('0x6')};function emitEvent(_0x409852){return function(_0x142a70,_0x269f35,_0x444e11){ChatInternalMessageEvents[_0x541b('0x7')](_0x409852+':'+_0x142a70['id'],_0x142a70);ChatInternalMessageEvents[_0x541b('0x7')](_0x409852,_0x142a70);_0x444e11(null);};}for(var e in events){if(events[_0x541b('0x8')](e)){var event=events[e];ChatInternalMessage[_0x541b('0x9')](e,emitEvent(event));}}module[_0x541b('0xa')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 7c8b988..90fdda4 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 _0x8428=['rimraf','exports','chat_internal_messages','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x5e7f72,_0x513ece){var _0x319000=function(_0xf80af2){while(--_0xf80af2){_0x5e7f72['push'](_0x5e7f72['shift']());}};_0x319000(++_0x513ece);}(_0x8428,0xc9));var _0x8842=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8428[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8842('0x0'));var util=require(_0x8842('0x1'));var logger=require(_0x8842('0x2'))('api');var moment=require(_0x8842('0x3'));var BPromise=require(_0x8842('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8842('0x5'));var rimraf=require(_0x8842('0x6'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x8842('0x7')]=function(_0x361ebe,_0x2e6f0b){return _0x361ebe['define']('ChatInternalMessage',attributes,{'tableName':_0x8842('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xcccc=['moment','request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x2df1ad,_0x2aaadf){var _0x5b16b4=function(_0x4a5289){while(--_0x4a5289){_0x2df1ad['push'](_0x2df1ad['shift']());}};_0x5b16b4(++_0x2aaadf);}(_0xcccc,0xf4));var _0xcccc=function(_0x406696,_0x39f9b1){_0x406696=_0x406696-0x0;var _0x10e35c=_0xcccc[_0x406696];return _0x10e35c;};'use strict';var _=require('lodash');var util=require(_0xcccc('0x0'));var logger=require(_0xcccc('0x1'))(_0xcccc('0x2'));var moment=require(_0xcccc('0x3'));var BPromise=require('bluebird');var rp=require(_0xcccc('0x4'));var fs=require('fs');var path=require(_0xcccc('0x5'));var rimraf=require('rimraf');var config=require(_0xcccc('0x6'));var attributes=require(_0xcccc('0x7'));module[_0xcccc('0x8')]=function(_0xd26c17,_0x36abf2){return _0xd26c17[_0xcccc('0x9')](_0xcccc('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcccc('0xb'),'collate':_0xcccc('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 3f0f84e..964c0cb 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 _0x94c9=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInternalMessage.socket','register','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x3f4c0c,_0x5bf2af){var _0x2525b4=function(_0x302c9e){while(--_0x302c9e){_0x3f4c0c['push'](_0x3f4c0c['shift']());}};_0x2525b4(++_0x5bf2af);}(_0x94c9,0x1dd));var _0x994c=function(_0x2106d8,_0x2bc8a1){_0x2106d8=_0x2106d8-0x0;var _0x2fb792=_0x94c9[_0x2106d8];return _0x2fb792;};'use strict';var _=require(_0x994c('0x0'));var util=require(_0x994c('0x1'));var moment=require(_0x994c('0x2'));var BPromise=require('bluebird');var rs=require(_0x994c('0x3'));var fs=require('fs');var Redis=require(_0x994c('0x4'));var db=require(_0x994c('0x5'))['db'];var utils=require(_0x994c('0x6'));var logger=require(_0x994c('0x7'))('rpc');var config=require(_0x994c('0x8'));var jayson=require(_0x994c('0x9'));var client=jayson[_0x994c('0xa')][_0x994c('0xb')]({'port':0x232a});config[_0x994c('0xc')]=_[_0x994c('0xd')](config[_0x994c('0xc')],{'host':_0x994c('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x994c('0xc')]));require(_0x994c('0xf'))[_0x994c('0x10')](socket);function respondWithRpcPromise(_0x35ed1e,_0x19231c,_0xbce452){return new BPromise(function(_0x46bdb9,_0x1651aa){return client[_0x994c('0x11')](_0x35ed1e,_0xbce452)[_0x994c('0x12')](function(_0x17ae17){logger[_0x994c('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x19231c,_0x994c('0x14'));logger[_0x994c('0x15')](_0x994c('0x16'),_0x19231c,_0x994c('0x14'),JSON[_0x994c('0x17')](_0x17ae17));if(_0x17ae17['error']){if(_0x17ae17[_0x994c('0x18')][_0x994c('0x19')]===0x1f4){logger[_0x994c('0x18')](_0x994c('0x1a'),_0x19231c,_0x17ae17[_0x994c('0x18')]['message']);return _0x1651aa(_0x17ae17['error']['message']);}logger['error'](_0x994c('0x1a'),_0x19231c,_0x17ae17[_0x994c('0x18')]['message']);return _0x46bdb9(_0x17ae17[_0x994c('0x18')][_0x994c('0x1b')]);}else{logger[_0x994c('0x13')](_0x994c('0x1a'),_0x19231c,'request\x20sent');_0x46bdb9(_0x17ae17[_0x994c('0x1c')][_0x994c('0x1b')]);}})[_0x994c('0x1d')](function(_0x275fea){logger[_0x994c('0x18')](_0x994c('0x1a'),_0x19231c,_0x275fea);_0x1651aa(_0x275fea);});});} \ No newline at end of file +var _0x6f2a=['register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatInternalMessage.socket'];(function(_0x36266a,_0x3d4bf8){var _0x17a395=function(_0x2b0ef2){while(--_0x2b0ef2){_0x36266a['push'](_0x36266a['shift']());}};_0x17a395(++_0x3d4bf8);}(_0x6f2a,0x1e0));var _0xa6f2=function(_0x532a60,_0x247971){_0x532a60=_0x532a60-0x0;var _0x42dcb5=_0x6f2a[_0x532a60];return _0x42dcb5;};'use strict';var _=require(_0xa6f2('0x0'));var util=require('util');var moment=require(_0xa6f2('0x1'));var BPromise=require(_0xa6f2('0x2'));var rs=require(_0xa6f2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa6f2('0x4'));var logger=require(_0xa6f2('0x5'))(_0xa6f2('0x6'));var config=require(_0xa6f2('0x7'));var jayson=require(_0xa6f2('0x8'));var client=jayson[_0xa6f2('0x9')][_0xa6f2('0xa')]({'port':0x232a});config[_0xa6f2('0xb')]=_[_0xa6f2('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa6f2('0xb')]));require(_0xa6f2('0xd'))[_0xa6f2('0xe')](socket);function respondWithRpcPromise(_0x1fcff0,_0x327050,_0x867227){return new BPromise(function(_0x39680c,_0x5c5599){return client[_0xa6f2('0xf')](_0x1fcff0,_0x867227)[_0xa6f2('0x10')](function(_0xd0b0de){logger[_0xa6f2('0x11')](_0xa6f2('0x12'),_0x327050,_0xa6f2('0x13'));logger['debug'](_0xa6f2('0x14'),_0x327050,'request\x20sent',JSON['stringify'](_0xd0b0de));if(_0xd0b0de['error']){if(_0xd0b0de[_0xa6f2('0x15')][_0xa6f2('0x16')]===0x1f4){logger[_0xa6f2('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x327050,_0xd0b0de[_0xa6f2('0x15')][_0xa6f2('0x17')]);return _0x5c5599(_0xd0b0de[_0xa6f2('0x15')]['message']);}logger[_0xa6f2('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x327050,_0xd0b0de[_0xa6f2('0x15')][_0xa6f2('0x17')]);return _0x39680c(_0xd0b0de['error'][_0xa6f2('0x17')]);}else{logger['info'](_0xa6f2('0x12'),_0x327050,_0xa6f2('0x13'));_0x39680c(_0xd0b0de[_0xa6f2('0x18')][_0xa6f2('0x17')]);}})[_0xa6f2('0x19')](function(_0x219693){logger[_0xa6f2('0x15')](_0xa6f2('0x12'),_0x327050,_0x219693);_0x5c5599(_0x219693);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 003d91f..7c5ac60 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 _0x448b=['removeListener','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x448b,0x166));var _0xb448=function(_0x2aee99,_0x1f9aae){_0x2aee99=_0x2aee99-0x0;var _0xf3e43a=_0x448b[_0x2aee99];return _0xf3e43a;};'use strict';var ChatInternalMessageEvents=require(_0xb448('0x0'));var events=[_0xb448('0x1'),'remove','update'];function createListener(_0x11d07f,_0x5accc2){return function(_0x36574f){_0x5accc2['emit'](_0x11d07f,_0x36574f);};}function removeListener(_0x1a4b32,_0x2f726e){return function(){ChatInternalMessageEvents[_0xb448('0x2')](_0x1a4b32,_0x2f726e);};}exports['register']=function(_0x5e3058){for(var _0x15b37e=0x0,_0x1a4c5f=events[_0xb448('0x3')];_0x15b37e<_0x1a4c5f;_0x15b37e++){var _0x11963f=events[_0x15b37e];var _0x397d5d=createListener(_0xb448('0x4')+_0x11963f,_0x5e3058);ChatInternalMessageEvents['on'](_0x11963f,_0x397d5d);}}; \ No newline at end of file +var _0x7e6d=['chatInternalMessage:','./chatInternalMessage.events','save','remove','emit','removeListener','length'];(function(_0x1e8a46,_0x56bd89){var _0x1aff64=function(_0x323845){while(--_0x323845){_0x1e8a46['push'](_0x1e8a46['shift']());}};_0x1aff64(++_0x56bd89);}(_0x7e6d,0x94));var _0xd7e6=function(_0x39ef10,_0x2ac239){_0x39ef10=_0x39ef10-0x0;var _0x340a98=_0x7e6d[_0x39ef10];return _0x340a98;};'use strict';var ChatInternalMessageEvents=require(_0xd7e6('0x0'));var events=[_0xd7e6('0x1'),_0xd7e6('0x2'),'update'];function createListener(_0x11bbc2,_0x231504){return function(_0x17049d){_0x231504[_0xd7e6('0x3')](_0x11bbc2,_0x17049d);};}function removeListener(_0x59d56b,_0x5a4a39){return function(){ChatInternalMessageEvents[_0xd7e6('0x4')](_0x59d56b,_0x5a4a39);};}exports['register']=function(_0x57ef5c){for(var _0x55db22=0x0,_0xcbd025=events[_0xd7e6('0x5')];_0x55db22<_0xcbd025;_0x55db22++){var _0x482189=events[_0x55db22];var _0x1d2ab5=createListener(_0xd7e6('0x6')+_0x482189,_0x57ef5c);ChatInternalMessageEvents['on'](_0x482189,_0x1d2ab5);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 714c7f2..bc9ee1c 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 _0xf735=['describe','getUsers','/:id','show','post','create','put','update','delete','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','isAuthenticated'];(function(_0x2e04ef,_0x31a596){var _0x5722b0=function(_0x386fbd){while(--_0x386fbd){_0x2e04ef['push'](_0x2e04ef['shift']());}};_0x5722b0(++_0x31a596);}(_0xf735,0x87));var _0x5f73=function(_0x1a1016,_0x3d1ebe){_0x1a1016=_0x1a1016-0x0;var _0x5d49d6=_0xf735[_0x1a1016];return _0x5d49d6;};'use strict';var multer=require(_0x5f73('0x0'));var util=require(_0x5f73('0x1'));var path=require(_0x5f73('0x2'));var timeout=require(_0x5f73('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5f73('0x4'));var auth=require(_0x5f73('0x5'));var interaction=require(_0x5f73('0x6'));var config=require(_0x5f73('0x7'));var controller=require(_0x5f73('0x8'));router[_0x5f73('0x9')]('/',auth['isAuthenticated'](),controller[_0x5f73('0xa')]);router['get']('/describe',auth[_0x5f73('0xb')](),controller[_0x5f73('0xc')]);router['get']('/users',auth[_0x5f73('0xb')](),controller[_0x5f73('0xd')]);router['get'](_0x5f73('0xe'),auth[_0x5f73('0xb')](),controller[_0x5f73('0xf')]);router[_0x5f73('0x10')]('/',auth['isAuthenticated'](),controller[_0x5f73('0x11')]);router[_0x5f73('0x12')](_0x5f73('0xe'),controller[_0x5f73('0x13')]);router[_0x5f73('0x14')](_0x5f73('0xe'),auth[_0x5f73('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0aa0=['put','update','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/users','getUsers','/:id','show','post','create'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0x0aa0,0x179));var _0x00aa=function(_0x4ad0c4,_0x255b72){_0x4ad0c4=_0x4ad0c4-0x0;var _0x12326c=_0x0aa0[_0x4ad0c4];return _0x12326c;};'use strict';var multer=require(_0x00aa('0x0'));var util=require('util');var path=require(_0x00aa('0x1'));var timeout=require(_0x00aa('0x2'));var express=require(_0x00aa('0x3'));var router=express[_0x00aa('0x4')]();var fs_extra=require(_0x00aa('0x5'));var auth=require(_0x00aa('0x6'));var interaction=require(_0x00aa('0x7'));var config=require(_0x00aa('0x8'));var controller=require('./chatInternalMessage.controller');router[_0x00aa('0x9')]('/',auth[_0x00aa('0xa')](),controller['index']);router[_0x00aa('0x9')](_0x00aa('0xb'),auth[_0x00aa('0xa')](),controller[_0x00aa('0xc')]);router['get'](_0x00aa('0xd'),auth[_0x00aa('0xa')](),controller[_0x00aa('0xe')]);router['get'](_0x00aa('0xf'),auth[_0x00aa('0xa')](),controller[_0x00aa('0x10')]);router[_0x00aa('0x11')]('/',auth['isAuthenticated'](),controller[_0x00aa('0x12')]);router[_0x00aa('0x13')](_0x00aa('0xf'),controller[_0x00aa('0x14')]);router['delete'](_0x00aa('0xf'),auth['isAuthenticated'](),controller[_0x00aa('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index b8f3bb0..e2c935c 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 _0x9d5b=['BOOLEAN','out','DATE','STRING','exports','TEXT','medium'];(function(_0x18a3d2,_0x2a11f0){var _0x1c7d21=function(_0x1d255d){while(--_0x1d255d){_0x18a3d2['push'](_0x18a3d2['shift']());}};_0x1c7d21(++_0x2a11f0);}(_0x9d5b,0x14d));var _0xb9d5=function(_0x412ad0,_0x1cd78e){_0x412ad0=_0x412ad0-0x0;var _0x20ba51=_0x9d5b[_0x412ad0];return _0x20ba51;};'use strict';var Sequelize=require('sequelize');module[_0xb9d5('0x0')]={'body':{'type':Sequelize[_0xb9d5('0x1')](_0xb9d5('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb9d5('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb9d5('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb9d5('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xb9d5('0x5')]},'providerName':{'type':Sequelize[_0xb9d5('0x6')]},'providerResponse':{'type':Sequelize[_0xb9d5('0x1')]}}; \ No newline at end of file +var _0x0b70=['ENUM','out','STRING','exports','medium','BOOLEAN'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x0b70,0x159));var _0x00b7=function(_0x4f722d,_0x54dfd6){_0x4f722d=_0x4f722d-0x0;var _0x434171=_0x0b70[_0x4f722d];return _0x434171;};'use strict';var Sequelize=require('sequelize');module[_0x00b7('0x0')]={'body':{'type':Sequelize['TEXT'](_0x00b7('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x00b7('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x00b7('0x3')]('in',_0x00b7('0x4')),'defaultValue':_0x00b7('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x00b7('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 4edc7c6..ecd1884 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 _0xe1e5=['get','ChatInteraction','ChatInteractionId','update','isNil','format','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','contact','fullname','email','internal','SIP/%s','channel','event','EventManager','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','sequelize','Sequelize','SELECT','interface','motionChannel','rejectmessage','parse','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','client','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','destroy','stack','name','send','index','ChatMessage','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filters','merge','map','filter','includeAll','include','findAll','show','length','create','body','find','params','describe','chat-interactions','accept','chat','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent'];(function(_0x58c86a,_0x602654){var _0x2bb374=function(_0x1302a9){while(--_0x1302a9){_0x58c86a['push'](_0x58c86a['shift']());}};_0x2bb374(++_0x602654);}(_0xe1e5,0xa5));var _0x5e1e=function(_0x5562fe,_0x4e809c){_0x5562fe=_0x5562fe-0x0;var _0x1829c7=_0xe1e5[_0x5562fe];return _0x1829c7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5e1e('0x0'));var zipdir=require(_0x5e1e('0x1'));var jsonpatch=require(_0x5e1e('0x2'));var rp=require(_0x5e1e('0x3'));var moment=require(_0x5e1e('0x4'));var BPromise=require(_0x5e1e('0x5'));var Mustache=require(_0x5e1e('0x6'));var util=require('util');var path=require(_0x5e1e('0x7'));var sox=require(_0x5e1e('0x8'));var csv=require('to-csv');var ejs=require(_0x5e1e('0x9'));var fs=require('fs');var fs_extra=require(_0x5e1e('0xa'));var _=require(_0x5e1e('0xb'));var squel=require(_0x5e1e('0xc'));var crypto=require('crypto');var jsforce=require(_0x5e1e('0xd'));var deskjs=require(_0x5e1e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5e1e('0xf'));var Papa=require('papaparse');var Redis=require(_0x5e1e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5e1e('0x11'));var as=require(_0x5e1e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e1e('0x13'))(_0x5e1e('0x14'));var utils=require(_0x5e1e('0x15'));var config=require(_0x5e1e('0x16'));var licenseUtil=require(_0x5e1e('0x17'));var db=require(_0x5e1e('0x18'))['db'];config[_0x5e1e('0x19')]=_[_0x5e1e('0x1a')](config[_0x5e1e('0x19')],{'host':_0x5e1e('0x1b'),'port':0x18eb});var socket=require(_0x5e1e('0x1c'))(new Redis(config['redis']));require(_0x5e1e('0x1d'))[_0x5e1e('0x1e')](socket);var jayson=require(_0x5e1e('0x1f'));var client=jayson['client'][_0x5e1e('0x20')]({'port':0x232c});var client9002=jayson[_0x5e1e('0x21')][_0x5e1e('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x879a03,_0x5ef367,_0x52597b,_0x3aa14e){return new BPromise(function(_0x16a926,_0x169bfd){var _0x516ac9=_0x3aa14e||client;return _0x516ac9[_0x5e1e('0x22')](_0x879a03,_0x52597b)[_0x5e1e('0x23')](function(_0x1e0492){logger[_0x5e1e('0x24')](_0x5e1e('0x25'),_0x5ef367,_0x5e1e('0x26'));logger['debug'](_0x5e1e('0x27'),_0x5ef367,'request\x20sent',JSON[_0x5e1e('0x28')](_0x1e0492));if(_0x1e0492['error']){if(_0x1e0492[_0x5e1e('0x29')]['code']===0x1f4){logger['error'](_0x5e1e('0x25'),_0x5ef367,_0x1e0492[_0x5e1e('0x29')]['message']);return _0x169bfd(_0x1e0492[_0x5e1e('0x29')][_0x5e1e('0x2a')]);}logger[_0x5e1e('0x29')](_0x5e1e('0x25'),_0x5ef367,_0x1e0492[_0x5e1e('0x29')][_0x5e1e('0x2a')]);return _0x16a926(_0x1e0492[_0x5e1e('0x29')][_0x5e1e('0x2a')]);}else{logger[_0x5e1e('0x24')](_0x5e1e('0x25'),_0x5ef367,_0x5e1e('0x26'));_0x16a926(_0x1e0492['result'][_0x5e1e('0x2a')]);}})[_0x5e1e('0x2b')](function(_0x1019d2){logger[_0x5e1e('0x29')](_0x5e1e('0x25'),_0x5ef367,_0x1019d2);_0x169bfd(_0x1019d2);});});}function respondWithStatusCode(_0x400751,_0x218e67){_0x218e67=_0x218e67||0xcc;return function(_0x2fa76c){if(_0x2fa76c){return _0x400751[_0x5e1e('0x2c')](_0x218e67);}return _0x400751['status'](_0x218e67)[_0x5e1e('0x2d')]();};}function respondWithResult(_0xfcb337,_0x461b0a){_0x461b0a=_0x461b0a||0xc8;return function(_0x271df0){if(_0x271df0){return _0xfcb337['status'](_0x461b0a)['json'](_0x271df0);}};}function respondWithFilteredResult(_0x57b1ea,_0x14bfa9){return function(_0x57e116){if(_0x57e116){var _0x3bc65b=typeof _0x14bfa9[_0x5e1e('0x2e')]===_0x5e1e('0x2f')&&typeof _0x14bfa9[_0x5e1e('0x30')]===_0x5e1e('0x2f');var _0xb83a9a=_0x57e116[_0x5e1e('0x31')];var _0x388f16=_0x3bc65b?0x0:_0x14bfa9[_0x5e1e('0x2e')];var _0x28d3ae=_0x3bc65b?_0x57e116[_0x5e1e('0x31')]:_0x14bfa9[_0x5e1e('0x2e')]+_0x14bfa9[_0x5e1e('0x30')];var _0x230c6f;if(_0x28d3ae>=_0xb83a9a){_0x28d3ae=_0xb83a9a;_0x230c6f=0xc8;}else{_0x230c6f=0xce;}_0x57b1ea[_0x5e1e('0x32')](_0x230c6f);return _0x57b1ea[_0x5e1e('0x33')](_0x5e1e('0x34'),_0x388f16+'-'+_0x28d3ae+'/'+_0xb83a9a)[_0x5e1e('0x35')](_0x57e116);}return null;};}function patchUpdates(_0x17b39e){return function(_0x4cdeea){try{jsonpatch[_0x5e1e('0x36')](_0x4cdeea,_0x17b39e,!![]);}catch(_0x4aaa6b){return BPromise[_0x5e1e('0x37')](_0x4aaa6b);}return _0x4cdeea[_0x5e1e('0x38')]();};}function saveUpdates(_0x5aaf1f,_0x2e0fe8){return function(_0x1a66bf){if(_0x1a66bf){return _0x1a66bf['update'](_0x5aaf1f)[_0x5e1e('0x23')](function(_0x170f2f){return _0x170f2f;});}return null;};}function removeEntity(_0xae0323,_0xc5d451){return function(_0x48a1b5){if(_0x48a1b5){return _0x48a1b5[_0x5e1e('0x39')]()[_0x5e1e('0x23')](function(){_0xae0323[_0x5e1e('0x32')](0xcc)[_0x5e1e('0x2d')]();});}};}function handleEntityNotFound(_0x38783e,_0x13c77b){return function(_0x14c19d){if(!_0x14c19d){_0x38783e[_0x5e1e('0x2c')](0x194);}return _0x14c19d;};}function handleError(_0x1380bb,_0x10d04e){_0x10d04e=_0x10d04e||0x1f4;return function(_0x4e9c29){logger['error'](_0x4e9c29[_0x5e1e('0x3a')]);if(_0x4e9c29[_0x5e1e('0x3b')]){delete _0x4e9c29[_0x5e1e('0x3b')];}_0x1380bb[_0x5e1e('0x32')](_0x10d04e)[_0x5e1e('0x3c')](_0x4e9c29);};}exports[_0x5e1e('0x3d')]=function(_0x3f7045,_0x578857){var _0x1cd47f={},_0x4358ce={},_0x545f99={'count':0x0,'rows':[]};var _0x4eaa26=_['map'](db[_0x5e1e('0x3e')][_0x5e1e('0x3f')],function(_0x3069e4){return{'name':_0x3069e4[_0x5e1e('0x40')],'type':_0x3069e4[_0x5e1e('0x41')][_0x5e1e('0x42')]};});_0x4358ce['model']=_['map'](_0x4eaa26,_0x5e1e('0x3b'));_0x4358ce[_0x5e1e('0x43')]=_[_0x5e1e('0x44')](_0x3f7045[_0x5e1e('0x43')]);_0x4358ce['filters']=_[_0x5e1e('0x45')](_0x4358ce[_0x5e1e('0x46')],_0x4358ce[_0x5e1e('0x43')]);_0x1cd47f[_0x5e1e('0x47')]=_[_0x5e1e('0x45')](_0x4358ce[_0x5e1e('0x46')],qs[_0x5e1e('0x48')](_0x3f7045[_0x5e1e('0x43')]['fields']));_0x1cd47f[_0x5e1e('0x47')]=_0x1cd47f[_0x5e1e('0x47')]['length']?_0x1cd47f[_0x5e1e('0x47')]:_0x4358ce[_0x5e1e('0x46')];if(!_0x3f7045[_0x5e1e('0x43')][_0x5e1e('0x49')]('nolimit')){_0x1cd47f['limit']=qs[_0x5e1e('0x30')](_0x3f7045[_0x5e1e('0x43')][_0x5e1e('0x30')]);_0x1cd47f[_0x5e1e('0x2e')]=qs[_0x5e1e('0x2e')](_0x3f7045[_0x5e1e('0x43')][_0x5e1e('0x2e')]);}_0x1cd47f[_0x5e1e('0x4a')]=qs[_0x5e1e('0x4b')](_0x3f7045['query']['sort']);_0x1cd47f[_0x5e1e('0x4c')]=qs['filters'](_['pick'](_0x3f7045[_0x5e1e('0x43')],_0x4358ce[_0x5e1e('0x4d')]),_0x4eaa26);if(_0x3f7045[_0x5e1e('0x43')]['filter']){_0x1cd47f['where']=_[_0x5e1e('0x4e')](_0x1cd47f[_0x5e1e('0x4c')],{'$or':_[_0x5e1e('0x4f')](_0x4eaa26,function(_0x4ab523){if(_0x4ab523[_0x5e1e('0x41')]!=='VIRTUAL'){var _0x31cd61={};_0x31cd61[_0x4ab523[_0x5e1e('0x3b')]]={'$like':'%'+_0x3f7045[_0x5e1e('0x43')][_0x5e1e('0x50')]+'%'};return _0x31cd61;}})});}_0x1cd47f=_[_0x5e1e('0x4e')]({},_0x1cd47f,_0x3f7045['options']);var _0x2b9f76={'where':_0x1cd47f[_0x5e1e('0x4c')]};return db[_0x5e1e('0x3e')]['count'](_0x2b9f76)[_0x5e1e('0x23')](function(_0x24cdc8){_0x545f99[_0x5e1e('0x31')]=_0x24cdc8;if(_0x3f7045[_0x5e1e('0x43')][_0x5e1e('0x51')]){_0x1cd47f[_0x5e1e('0x52')]=[{'all':!![]}];}return db[_0x5e1e('0x3e')][_0x5e1e('0x53')](_0x1cd47f);})[_0x5e1e('0x23')](function(_0x4eaa4c){_0x545f99['rows']=_0x4eaa4c;return _0x545f99;})['then'](respondWithFilteredResult(_0x578857,_0x1cd47f))[_0x5e1e('0x2b')](handleError(_0x578857,null));};exports[_0x5e1e('0x54')]=function(_0x24a987,_0x5318ee){var _0x430432={'raw':!![],'where':{'id':_0x24a987['params']['id']}},_0x3db61e={};_0x3db61e['model']=_['keys'](db[_0x5e1e('0x3e')]['rawAttributes']);_0x3db61e[_0x5e1e('0x43')]=_[_0x5e1e('0x44')](_0x24a987[_0x5e1e('0x43')]);_0x3db61e['filters']=_[_0x5e1e('0x45')](_0x3db61e['model'],_0x3db61e['query']);_0x430432[_0x5e1e('0x47')]=_['intersection'](_0x3db61e[_0x5e1e('0x46')],qs[_0x5e1e('0x48')](_0x24a987['query'][_0x5e1e('0x48')]));_0x430432[_0x5e1e('0x47')]=_0x430432[_0x5e1e('0x47')][_0x5e1e('0x55')]?_0x430432[_0x5e1e('0x47')]:_0x3db61e[_0x5e1e('0x46')];if(_0x24a987[_0x5e1e('0x43')][_0x5e1e('0x51')]){_0x430432['include']=[{'all':!![]}];}_0x430432=_[_0x5e1e('0x4e')]({},_0x430432,_0x24a987['options']);return db[_0x5e1e('0x3e')]['find'](_0x430432)[_0x5e1e('0x23')](handleEntityNotFound(_0x5318ee,null))[_0x5e1e('0x23')](respondWithResult(_0x5318ee,null))[_0x5e1e('0x2b')](handleError(_0x5318ee,null));};exports[_0x5e1e('0x56')]=function(_0x53a486,_0x4c63ce){return db['ChatMessage']['create'](_0x53a486[_0x5e1e('0x57')],{})['then'](respondWithResult(_0x4c63ce,0xc9))[_0x5e1e('0x2b')](handleError(_0x4c63ce,null));};exports['update']=function(_0x25c3c5,_0x354220){if(_0x25c3c5[_0x5e1e('0x57')]['id']){delete _0x25c3c5[_0x5e1e('0x57')]['id'];}return db['ChatMessage'][_0x5e1e('0x58')]({'where':{'id':_0x25c3c5[_0x5e1e('0x59')]['id']}})[_0x5e1e('0x23')](handleEntityNotFound(_0x354220,null))['then'](saveUpdates(_0x25c3c5[_0x5e1e('0x57')],null))[_0x5e1e('0x23')](respondWithResult(_0x354220,null))['catch'](handleError(_0x354220,null));};exports[_0x5e1e('0x39')]=function(_0x3d575a,_0x4b321a){return db[_0x5e1e('0x3e')][_0x5e1e('0x58')]({'where':{'id':_0x3d575a[_0x5e1e('0x59')]['id']}})[_0x5e1e('0x23')](handleEntityNotFound(_0x4b321a,null))[_0x5e1e('0x23')](removeEntity(_0x4b321a,null))['catch'](handleError(_0x4b321a,null));};exports['describe']=function(_0xc831f6,_0x12963d){return db[_0x5e1e('0x3e')][_0x5e1e('0x5a')]()[_0x5e1e('0x23')](respondWithResult(_0x12963d,null))[_0x5e1e('0x2b')](handleError(_0x12963d,null));};var interaction_log=require(_0x5e1e('0x13'))(_0x5e1e('0x5b'));exports[_0x5e1e('0x5c')]=function(_0x1a3286,_0x54b33c,_0xf74b4){var _0xb415a0={'agent':{},'channel':_0x5e1e('0x5d')};if(_0x1a3286[_0x5e1e('0x57')]['id']){delete _0x1a3286[_0x5e1e('0x57')]['id'];}_0x1a3286[_0x5e1e('0x57')][_0x5e1e('0x5e')]=!![];_0x1a3286[_0x5e1e('0x57')]['readAt']=moment()['format'](_0x5e1e('0x5f'));_0x1a3286['body'][_0x5e1e('0x60')]=_0x1a3286[_0x5e1e('0x57')][_0x5e1e('0x60')]||_0x1a3286[_0x5e1e('0x61')]['id'];_0xb415a0[_0x5e1e('0x62')]['id']=_0x1a3286[_0x5e1e('0x57')]['UserId'];return db[_0x5e1e('0x3e')][_0x5e1e('0x58')]({'where':{'id':_0x1a3286[_0x5e1e('0x59')]['id'],'UserId':null}})[_0x5e1e('0x23')](handleEntityNotFound(_0x54b33c,null))['then'](saveUpdates(_0x1a3286[_0x5e1e('0x57')],null))[_0x5e1e('0x23')](function(_0x1fa137){if(_0x1fa137){_0xb415a0['message']=_0x1fa137[_0x5e1e('0x63')]({'plain':!![]});return db[_0x5e1e('0x64')]['find']({'where':{'id':_0x1fa137[_0x5e1e('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x54b33c,null))[_0x5e1e('0x23')](function(_0x2efe28){if(_0x2efe28){return _0x2efe28[_0x5e1e('0x66')]({'UserId':_0x1a3286[_0x5e1e('0x57')][_0x5e1e('0x60')],'read1stAt':_[_0x5e1e('0x67')](_0x2efe28['read1stAt'])?moment()[_0x5e1e('0x68')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5e1e('0x23')](function(_0x9f24c0){if(_0x9f24c0){_0xb415a0['interaction']=_0x9f24c0[_0x5e1e('0x63')]({'plain':!![]});interaction_log[_0x5e1e('0x24')](_0x5e1e('0x69'),_0x1a3286[_0x5e1e('0x61')]['id'],_0x1a3286[_0x5e1e('0x61')]['name'],_0x1a3286['user'][_0x5e1e('0x6a')],_0xb415a0[_0x5e1e('0x6b')]['id'],_0x1a3286[_0x5e1e('0x57')]?JSON[_0x5e1e('0x28')](_0x1a3286[_0x5e1e('0x57')]):_0x5e1e('0x6c'));return respondWithRpcPromise(_0x5e1e('0x6d'),_0x5e1e('0x6e'),_0xb415a0);}return null;})[_0x5e1e('0x23')](function(_0x4a48ba){var _0x3ee216=_0x5e1e('0x6f')+_0x4a48ba[_0x5e1e('0x2a')][_0x5e1e('0x70')];return db['sequelize']['query'](_0x3ee216,{'type':db['Sequelize'][_0x5e1e('0x71')]['SELECT'],'raw':!![]})[_0x5e1e('0x23')](function(_0x857916){return _0x857916;});})[_0x5e1e('0x23')](function(_0x5efa95){if(_0x5efa95){_0xb415a0[_0x5e1e('0x2a')][_0x5e1e('0x72')]=_0x5efa95[0x0];if(!_0x1a3286[_0x5e1e('0x57')][_0x5e1e('0x60')])return;return db['User'][_0x5e1e('0x58')]({'where':{'id':_0x1a3286[_0x5e1e('0x57')][_0x5e1e('0x60')],'role':_0x5e1e('0x62')},'attributes':['id','name',_0x5e1e('0x73'),_0x5e1e('0x74'),_0x5e1e('0x75')],'raw':!![]});}return null;})['then'](function(_0xc102d6){if(!_0xc102d6)return null;_0xb415a0[_0x5e1e('0x2a')][_0x5e1e('0x62')]=_0xc102d6;return _0xb415a0;})['then'](function(_0x3c3820){if(_0x3c3820){if(_0x1a3286[_0x5e1e('0x57')]['manual']){_0xb415a0[_0x5e1e('0x2a')]['interface']=util[_0x5e1e('0x68')](_0x5e1e('0x76'),_0x1a3286['user']['name']);_0xb415a0[_0x5e1e('0x2a')][_0x5e1e('0x77')]=_0xb415a0[_0x5e1e('0x77')];_0xb415a0[_0x5e1e('0x2a')]['motionChannel']=_0xb415a0[_0x5e1e('0x77')];_0xb415a0[_0x5e1e('0x2a')][_0x5e1e('0x78')]=_0x5e1e('0x5c');return respondWithRpcPromise('EventManager',_0x5e1e('0x79'),{'event':'acceptmessage','message':_[_0x5e1e('0x4e')](_0xb415a0['message'],JSON['parse'](_0xb415a0[_0x5e1e('0x6b')][_0x5e1e('0x7a')]))},client9002)[_0x5e1e('0x23')](function(){return _0xb415a0;});}return _0xb415a0;}return null;})[_0x5e1e('0x23')](respondWithResult(_0x54b33c,null))[_0x5e1e('0x2b')](handleError(_0x54b33c,null));};var interaction_log=require(_0x5e1e('0x13'))('chat-interactions');exports['reject']=function(_0x50d53e,_0x1fd77d,_0x3dda83){var _0x1ca527={'agent':{},'channel':'chat'};if(_0x50d53e[_0x5e1e('0x57')]['id']){delete _0x50d53e[_0x5e1e('0x57')]['id'];}_0x50d53e[_0x5e1e('0x57')][_0x5e1e('0x60')]=_0x50d53e[_0x5e1e('0x57')][_0x5e1e('0x60')]||_0x50d53e[_0x5e1e('0x61')]['id'];_0x1ca527[_0x5e1e('0x62')]['id']=_0x50d53e[_0x5e1e('0x57')][_0x5e1e('0x60')];return db['ChatMessage'][_0x5e1e('0x58')]({'where':{'id':_0x50d53e[_0x5e1e('0x59')]['id'],'UserId':null}})[_0x5e1e('0x23')](handleEntityNotFound(_0x1fd77d,null))['then'](function(_0x3bcc55){if(_0x3bcc55){_0x1ca527['message']=_0x3bcc55[_0x5e1e('0x63')]({'plain':!![]});return db['ChatInteraction'][_0x5e1e('0x58')]({'where':{'id':_0x3bcc55[_0x5e1e('0x65')]}});}return null;})[_0x5e1e('0x23')](handleEntityNotFound(_0x1fd77d,null))[_0x5e1e('0x23')](function(_0x16e58d){if(_0x16e58d){_0x1ca527['interaction']=_0x16e58d['get']({'plain':!![]});interaction_log[_0x5e1e('0x24')](_0x5e1e('0x7b'),_0x50d53e[_0x5e1e('0x61')]['id'],_0x50d53e[_0x5e1e('0x61')][_0x5e1e('0x3b')],_0x50d53e[_0x5e1e('0x61')]['role'],_0x1ca527[_0x5e1e('0x6b')]['id'],_0x50d53e[_0x5e1e('0x57')]?JSON[_0x5e1e('0x28')](_0x50d53e[_0x5e1e('0x57')]):_0x5e1e('0x6c'));return respondWithRpcPromise(_0x5e1e('0x7c'),'rejectMessage',_0x1ca527);}return null;})['then'](function(_0x499474){var _0x279cfc=_0x5e1e('0x6f')+_0x499474[_0x5e1e('0x2a')]['ContactId'];return db[_0x5e1e('0x7d')]['query'](_0x279cfc,{'type':db[_0x5e1e('0x7e')][_0x5e1e('0x71')][_0x5e1e('0x7f')],'raw':!![]})[_0x5e1e('0x23')](function(_0x40da03){return _0x40da03;});})[_0x5e1e('0x23')](function(_0x3db430){if(_0x3db430){_0x1ca527[_0x5e1e('0x2a')]['contact']=_0x3db430[0x0];if(!_0x50d53e[_0x5e1e('0x57')][_0x5e1e('0x60')])return;return db['User'][_0x5e1e('0x58')]({'where':{'id':_0x50d53e['body'][_0x5e1e('0x60')],'role':_0x5e1e('0x62')},'attributes':['id',_0x5e1e('0x3b'),_0x5e1e('0x73'),'email',_0x5e1e('0x75')],'raw':!![]});}return null;})[_0x5e1e('0x23')](function(_0x2f641d){if(!_0x2f641d)return null;_0x1ca527[_0x5e1e('0x2a')][_0x5e1e('0x62')]=_0x2f641d;return _0x1ca527;})[_0x5e1e('0x23')](function(_0x37fe7a){if(_0x37fe7a){_0x37fe7a[_0x5e1e('0x2a')][_0x5e1e('0x80')]=util[_0x5e1e('0x68')](_0x5e1e('0x76'),_0x50d53e[_0x5e1e('0x61')][_0x5e1e('0x3b')]);_0x37fe7a[_0x5e1e('0x2a')][_0x5e1e('0x77')]=_0x1ca527[_0x5e1e('0x77')];_0x37fe7a[_0x5e1e('0x2a')][_0x5e1e('0x81')]=_0x1ca527[_0x5e1e('0x77')];_0x37fe7a[_0x5e1e('0x2a')]['event']=_0x5e1e('0x37');respondWithRpcPromise(_0x5e1e('0x79'),_0x5e1e('0x79'),{'event':_0x5e1e('0x82'),'message':_[_0x5e1e('0x4e')](_0x1ca527[_0x5e1e('0x2a')],JSON[_0x5e1e('0x83')](_0x1ca527[_0x5e1e('0x6b')][_0x5e1e('0x7a')]))},client9002);return _0x1ca527;}return null;})[_0x5e1e('0x23')](respondWithResult(_0x1fd77d,null))['catch'](handleError(_0x1fd77d,null));}; \ No newline at end of file +var _0xee89=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','undefined','count','offset','limit','set','json','apply','reject','save','update','destroy','stack','name','send','index','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','ChatMessage','includeAll','rows','show','params','include','find','create','body','describe','chat-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteraction','ChatInteractionId','isNil','interaction','get','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','User','agent','fullname','internal','manual','SIP/%s','channel','EventManager','acceptmessage','parse','chat','role','null','RejectMessage','rejectMessage','sequelize','contact','email','interface','motionChannel','event','rejectmessage','formData','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash'];(function(_0x4409e7,_0x307f17){var _0x24c751=function(_0x3a7d33){while(--_0x3a7d33){_0x4409e7['push'](_0x4409e7['shift']());}};_0x24c751(++_0x307f17);}(_0xee89,0x7c));var _0x9ee8=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xee89[_0x4fc9e6];return _0x551d28;};'use strict';var emlformat=require(_0x9ee8('0x0'));var rimraf=require(_0x9ee8('0x1'));var zipdir=require(_0x9ee8('0x2'));var jsonpatch=require(_0x9ee8('0x3'));var rp=require(_0x9ee8('0x4'));var moment=require(_0x9ee8('0x5'));var BPromise=require(_0x9ee8('0x6'));var Mustache=require(_0x9ee8('0x7'));var util=require(_0x9ee8('0x8'));var path=require(_0x9ee8('0x9'));var sox=require('sox');var csv=require(_0x9ee8('0xa'));var ejs=require(_0x9ee8('0xb'));var fs=require('fs');var fs_extra=require(_0x9ee8('0xc'));var _=require(_0x9ee8('0xd'));var squel=require(_0x9ee8('0xe'));var crypto=require(_0x9ee8('0xf'));var jsforce=require(_0x9ee8('0x10'));var deskjs=require(_0x9ee8('0x11'));var toCsv=require(_0x9ee8('0xa'));var querystring=require(_0x9ee8('0x12'));var Papa=require(_0x9ee8('0x13'));var Redis=require(_0x9ee8('0x14'));var authService=require(_0x9ee8('0x15'));var qs=require(_0x9ee8('0x16'));var as=require(_0x9ee8('0x17'));var hardwareService=require(_0x9ee8('0x18'));var logger=require(_0x9ee8('0x19'))('api');var utils=require(_0x9ee8('0x1a'));var config=require(_0x9ee8('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x9ee8('0x1c'))['db'];config[_0x9ee8('0x1d')]=_[_0x9ee8('0x1e')](config[_0x9ee8('0x1d')],{'host':_0x9ee8('0x1f'),'port':0x18eb});var socket=require(_0x9ee8('0x20'))(new Redis(config['redis']));require(_0x9ee8('0x21'))[_0x9ee8('0x22')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9ee8('0x23')][_0x9ee8('0x24')]({'port':0x232c});var client9002=jayson[_0x9ee8('0x23')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d4342,_0x312212,_0x41fad6,_0x5a8223){return new BPromise(function(_0x5f1f73,_0x1c9003){var _0x1196a5=_0x5a8223||client;return _0x1196a5['request'](_0x4d4342,_0x41fad6)[_0x9ee8('0x25')](function(_0x4ebc82){logger[_0x9ee8('0x26')](_0x9ee8('0x27'),_0x312212,_0x9ee8('0x28'));logger[_0x9ee8('0x29')](_0x9ee8('0x2a'),_0x312212,_0x9ee8('0x28'),JSON[_0x9ee8('0x2b')](_0x4ebc82));if(_0x4ebc82[_0x9ee8('0x2c')]){if(_0x4ebc82[_0x9ee8('0x2c')][_0x9ee8('0x2d')]===0x1f4){logger[_0x9ee8('0x2c')](_0x9ee8('0x27'),_0x312212,_0x4ebc82['error']['message']);return _0x1c9003(_0x4ebc82['error'][_0x9ee8('0x2e')]);}logger[_0x9ee8('0x2c')](_0x9ee8('0x27'),_0x312212,_0x4ebc82['error'][_0x9ee8('0x2e')]);return _0x5f1f73(_0x4ebc82[_0x9ee8('0x2c')][_0x9ee8('0x2e')]);}else{logger['info'](_0x9ee8('0x27'),_0x312212,_0x9ee8('0x28'));_0x5f1f73(_0x4ebc82[_0x9ee8('0x2f')][_0x9ee8('0x2e')]);}})[_0x9ee8('0x30')](function(_0x3460da){logger[_0x9ee8('0x2c')](_0x9ee8('0x27'),_0x312212,_0x3460da);_0x1c9003(_0x3460da);});});}function respondWithStatusCode(_0x588f12,_0x2cab0e){_0x2cab0e=_0x2cab0e||0xcc;return function(_0x483aa7){if(_0x483aa7){return _0x588f12[_0x9ee8('0x31')](_0x2cab0e);}return _0x588f12['status'](_0x2cab0e)['end']();};}function respondWithResult(_0x135310,_0x21d226){_0x21d226=_0x21d226||0xc8;return function(_0x38d046){if(_0x38d046){return _0x135310[_0x9ee8('0x32')](_0x21d226)['json'](_0x38d046);}};}function respondWithFilteredResult(_0xc420e2,_0x42bb14){return function(_0x376b86){if(_0x376b86){var _0x31afbe=typeof _0x42bb14['offset']===_0x9ee8('0x33')&&typeof _0x42bb14['limit']===_0x9ee8('0x33');var _0x572f36=_0x376b86[_0x9ee8('0x34')];var _0x52ffca=_0x31afbe?0x0:_0x42bb14[_0x9ee8('0x35')];var _0x4911a5=_0x31afbe?_0x376b86[_0x9ee8('0x34')]:_0x42bb14[_0x9ee8('0x35')]+_0x42bb14[_0x9ee8('0x36')];var _0x45c9ec;if(_0x4911a5>=_0x572f36){_0x4911a5=_0x572f36;_0x45c9ec=0xc8;}else{_0x45c9ec=0xce;}_0xc420e2[_0x9ee8('0x32')](_0x45c9ec);return _0xc420e2[_0x9ee8('0x37')]('Content-Range',_0x52ffca+'-'+_0x4911a5+'/'+_0x572f36)[_0x9ee8('0x38')](_0x376b86);}return null;};}function patchUpdates(_0x20d7fd){return function(_0x1caa2c){try{jsonpatch[_0x9ee8('0x39')](_0x1caa2c,_0x20d7fd,!![]);}catch(_0x25fe10){return BPromise[_0x9ee8('0x3a')](_0x25fe10);}return _0x1caa2c[_0x9ee8('0x3b')]();};}function saveUpdates(_0x1ee6a8,_0xe1eaa3){return function(_0x45fcef){if(_0x45fcef){return _0x45fcef[_0x9ee8('0x3c')](_0x1ee6a8)['then'](function(_0x342e83){return _0x342e83;});}return null;};}function removeEntity(_0x145c27,_0x52184c){return function(_0x2afa9f){if(_0x2afa9f){return _0x2afa9f[_0x9ee8('0x3d')]()[_0x9ee8('0x25')](function(){_0x145c27['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x80084e,_0x1f8ee4){return function(_0x2f3c51){if(!_0x2f3c51){_0x80084e[_0x9ee8('0x31')](0x194);}return _0x2f3c51;};}function handleError(_0x2b4626,_0x4ef0c7){_0x4ef0c7=_0x4ef0c7||0x1f4;return function(_0x491e3c){logger[_0x9ee8('0x2c')](_0x491e3c[_0x9ee8('0x3e')]);if(_0x491e3c[_0x9ee8('0x3f')]){delete _0x491e3c[_0x9ee8('0x3f')];}_0x2b4626[_0x9ee8('0x32')](_0x4ef0c7)[_0x9ee8('0x40')](_0x491e3c);};}exports[_0x9ee8('0x41')]=function(_0x199b8e,_0x5a6848){var _0x324c10={},_0x346dd7={},_0x5cc1dd={'count':0x0,'rows':[]};var _0x386570=_['map'](db['ChatMessage'][_0x9ee8('0x42')],function(_0x17151e){return{'name':_0x17151e[_0x9ee8('0x43')],'type':_0x17151e[_0x9ee8('0x44')]['key']};});_0x346dd7['model']=_[_0x9ee8('0x45')](_0x386570,_0x9ee8('0x3f'));_0x346dd7[_0x9ee8('0x46')]=_[_0x9ee8('0x47')](_0x199b8e['query']);_0x346dd7[_0x9ee8('0x48')]=_[_0x9ee8('0x49')](_0x346dd7[_0x9ee8('0x4a')],_0x346dd7[_0x9ee8('0x46')]);_0x324c10[_0x9ee8('0x4b')]=_['intersection'](_0x346dd7[_0x9ee8('0x4a')],qs['fields'](_0x199b8e[_0x9ee8('0x46')][_0x9ee8('0x4c')]));_0x324c10[_0x9ee8('0x4b')]=_0x324c10[_0x9ee8('0x4b')][_0x9ee8('0x4d')]?_0x324c10['attributes']:_0x346dd7[_0x9ee8('0x4a')];if(!_0x199b8e[_0x9ee8('0x46')][_0x9ee8('0x4e')](_0x9ee8('0x4f'))){_0x324c10[_0x9ee8('0x36')]=qs[_0x9ee8('0x36')](_0x199b8e[_0x9ee8('0x46')][_0x9ee8('0x36')]);_0x324c10['offset']=qs[_0x9ee8('0x35')](_0x199b8e[_0x9ee8('0x46')][_0x9ee8('0x35')]);}_0x324c10[_0x9ee8('0x50')]=qs[_0x9ee8('0x51')](_0x199b8e['query'][_0x9ee8('0x51')]);_0x324c10[_0x9ee8('0x52')]=qs[_0x9ee8('0x48')](_['pick'](_0x199b8e[_0x9ee8('0x46')],_0x346dd7['filters']),_0x386570);if(_0x199b8e[_0x9ee8('0x46')][_0x9ee8('0x53')]){_0x324c10[_0x9ee8('0x52')]=_[_0x9ee8('0x54')](_0x324c10['where'],{'$or':_[_0x9ee8('0x45')](_0x386570,function(_0x212819){if(_0x212819[_0x9ee8('0x44')]!==_0x9ee8('0x55')){var _0x3d5bdf={};_0x3d5bdf[_0x212819[_0x9ee8('0x3f')]]={'$like':'%'+_0x199b8e[_0x9ee8('0x46')][_0x9ee8('0x53')]+'%'};return _0x3d5bdf;}})});}_0x324c10=_[_0x9ee8('0x54')]({},_0x324c10,_0x199b8e[_0x9ee8('0x56')]);var _0x51b64e={'where':_0x324c10['where']};return db[_0x9ee8('0x57')][_0x9ee8('0x34')](_0x51b64e)[_0x9ee8('0x25')](function(_0x2d33e6){_0x5cc1dd['count']=_0x2d33e6;if(_0x199b8e['query'][_0x9ee8('0x58')]){_0x324c10['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x324c10);})['then'](function(_0x1f194b){_0x5cc1dd[_0x9ee8('0x59')]=_0x1f194b;return _0x5cc1dd;})[_0x9ee8('0x25')](respondWithFilteredResult(_0x5a6848,_0x324c10))[_0x9ee8('0x30')](handleError(_0x5a6848,null));};exports[_0x9ee8('0x5a')]=function(_0xf56abd,_0x1996bc){var _0x16462c={'raw':!![],'where':{'id':_0xf56abd[_0x9ee8('0x5b')]['id']}},_0x318f77={};_0x318f77[_0x9ee8('0x4a')]=_[_0x9ee8('0x47')](db[_0x9ee8('0x57')][_0x9ee8('0x42')]);_0x318f77['query']=_[_0x9ee8('0x47')](_0xf56abd['query']);_0x318f77[_0x9ee8('0x48')]=_[_0x9ee8('0x49')](_0x318f77['model'],_0x318f77['query']);_0x16462c[_0x9ee8('0x4b')]=_[_0x9ee8('0x49')](_0x318f77['model'],qs[_0x9ee8('0x4c')](_0xf56abd['query']['fields']));_0x16462c[_0x9ee8('0x4b')]=_0x16462c[_0x9ee8('0x4b')][_0x9ee8('0x4d')]?_0x16462c['attributes']:_0x318f77['model'];if(_0xf56abd['query'][_0x9ee8('0x58')]){_0x16462c[_0x9ee8('0x5c')]=[{'all':!![]}];}_0x16462c=_['merge']({},_0x16462c,_0xf56abd[_0x9ee8('0x56')]);return db[_0x9ee8('0x57')][_0x9ee8('0x5d')](_0x16462c)[_0x9ee8('0x25')](handleEntityNotFound(_0x1996bc,null))['then'](respondWithResult(_0x1996bc,null))[_0x9ee8('0x30')](handleError(_0x1996bc,null));};exports[_0x9ee8('0x5e')]=function(_0x29b8cc,_0x1fdc58){return db[_0x9ee8('0x57')][_0x9ee8('0x5e')](_0x29b8cc[_0x9ee8('0x5f')],{})[_0x9ee8('0x25')](respondWithResult(_0x1fdc58,0xc9))['catch'](handleError(_0x1fdc58,null));};exports[_0x9ee8('0x3c')]=function(_0x57089f,_0x5728a6){if(_0x57089f[_0x9ee8('0x5f')]['id']){delete _0x57089f[_0x9ee8('0x5f')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x57089f[_0x9ee8('0x5b')]['id']}})[_0x9ee8('0x25')](handleEntityNotFound(_0x5728a6,null))['then'](saveUpdates(_0x57089f[_0x9ee8('0x5f')],null))[_0x9ee8('0x25')](respondWithResult(_0x5728a6,null))['catch'](handleError(_0x5728a6,null));};exports['destroy']=function(_0x5061b4,_0x52ef0c){return db['ChatMessage'][_0x9ee8('0x5d')]({'where':{'id':_0x5061b4[_0x9ee8('0x5b')]['id']}})['then'](handleEntityNotFound(_0x52ef0c,null))[_0x9ee8('0x25')](removeEntity(_0x52ef0c,null))[_0x9ee8('0x30')](handleError(_0x52ef0c,null));};exports[_0x9ee8('0x60')]=function(_0x4bbc78,_0x1ba2cc){return db[_0x9ee8('0x57')][_0x9ee8('0x60')]()[_0x9ee8('0x25')](respondWithResult(_0x1ba2cc,null))['catch'](handleError(_0x1ba2cc,null));};var interaction_log=require(_0x9ee8('0x19'))(_0x9ee8('0x61'));exports[_0x9ee8('0x62')]=function(_0x126765,_0x2112bb,_0x320d86){var _0x2534c0={'agent':{},'channel':'chat'};if(_0x126765[_0x9ee8('0x5f')]['id']){delete _0x126765[_0x9ee8('0x5f')]['id'];}_0x126765[_0x9ee8('0x5f')]['read']=!![];_0x126765[_0x9ee8('0x5f')][_0x9ee8('0x63')]=moment()[_0x9ee8('0x64')](_0x9ee8('0x65'));_0x126765[_0x9ee8('0x5f')]['UserId']=_0x126765['body'][_0x9ee8('0x66')]||_0x126765[_0x9ee8('0x67')]['id'];_0x2534c0['agent']['id']=_0x126765['body']['UserId'];return db[_0x9ee8('0x57')][_0x9ee8('0x5d')]({'where':{'id':_0x126765[_0x9ee8('0x5b')]['id'],'UserId':null}})[_0x9ee8('0x25')](handleEntityNotFound(_0x2112bb,null))[_0x9ee8('0x25')](saveUpdates(_0x126765[_0x9ee8('0x5f')],null))[_0x9ee8('0x25')](function(_0x30a45d){if(_0x30a45d){_0x2534c0[_0x9ee8('0x2e')]=_0x30a45d['get']({'plain':!![]});return db[_0x9ee8('0x68')][_0x9ee8('0x5d')]({'where':{'id':_0x30a45d[_0x9ee8('0x69')]}});}return null;})[_0x9ee8('0x25')](handleEntityNotFound(_0x2112bb,null))[_0x9ee8('0x25')](function(_0x276bb0){if(_0x276bb0){return _0x276bb0['update']({'UserId':_0x126765['body'][_0x9ee8('0x66')],'read1stAt':_[_0x9ee8('0x6a')](_0x276bb0['read1stAt'])?moment()[_0x9ee8('0x64')](_0x9ee8('0x65')):undefined});}return null;})[_0x9ee8('0x25')](function(_0x599054){if(_0x599054){_0x2534c0[_0x9ee8('0x6b')]=_0x599054[_0x9ee8('0x6c')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x126765[_0x9ee8('0x67')]['id'],_0x126765[_0x9ee8('0x67')][_0x9ee8('0x3f')],_0x126765[_0x9ee8('0x67')]['role'],_0x2534c0['interaction']['id'],_0x126765[_0x9ee8('0x5f')]?JSON[_0x9ee8('0x2b')](_0x126765['body']):'null');return respondWithRpcPromise(_0x9ee8('0x6d'),_0x9ee8('0x6e'),_0x2534c0);}return null;})[_0x9ee8('0x25')](function(_0x5acb32){var _0x6acfbb=_0x9ee8('0x6f')+_0x5acb32[_0x9ee8('0x2e')][_0x9ee8('0x70')];return db['sequelize']['query'](_0x6acfbb,{'type':db['Sequelize'][_0x9ee8('0x71')][_0x9ee8('0x72')],'raw':!![]})[_0x9ee8('0x25')](function(_0x27a183){return _0x27a183;});})[_0x9ee8('0x25')](function(_0x85ac89){if(_0x85ac89){_0x2534c0[_0x9ee8('0x2e')]['contact']=_0x85ac89[0x0];if(!_0x126765[_0x9ee8('0x5f')][_0x9ee8('0x66')])return;return db[_0x9ee8('0x73')][_0x9ee8('0x5d')]({'where':{'id':_0x126765[_0x9ee8('0x5f')]['UserId'],'role':_0x9ee8('0x74')},'attributes':['id',_0x9ee8('0x3f'),_0x9ee8('0x75'),'email',_0x9ee8('0x76')],'raw':!![]});}return null;})[_0x9ee8('0x25')](function(_0x1ebd1f){if(!_0x1ebd1f)return null;_0x2534c0[_0x9ee8('0x2e')][_0x9ee8('0x74')]=_0x1ebd1f;return _0x2534c0;})[_0x9ee8('0x25')](function(_0x2ed1a3){if(_0x2ed1a3){if(_0x126765[_0x9ee8('0x5f')][_0x9ee8('0x77')]){_0x2534c0[_0x9ee8('0x2e')]['interface']=util[_0x9ee8('0x64')](_0x9ee8('0x78'),_0x126765[_0x9ee8('0x67')][_0x9ee8('0x3f')]);_0x2534c0['message']['channel']=_0x2534c0[_0x9ee8('0x79')];_0x2534c0['message']['motionChannel']=_0x2534c0[_0x9ee8('0x79')];_0x2534c0['message']['event']=_0x9ee8('0x62');return respondWithRpcPromise(_0x9ee8('0x7a'),_0x9ee8('0x7a'),{'event':_0x9ee8('0x7b'),'message':_[_0x9ee8('0x54')](_0x2534c0[_0x9ee8('0x2e')],JSON[_0x9ee8('0x7c')](_0x2534c0[_0x9ee8('0x6b')]['formData']))},client9002)['then'](function(){return _0x2534c0;});}return _0x2534c0;}return null;})[_0x9ee8('0x25')](respondWithResult(_0x2112bb,null))[_0x9ee8('0x30')](handleError(_0x2112bb,null));};var interaction_log=require(_0x9ee8('0x19'))(_0x9ee8('0x61'));exports['reject']=function(_0x2c9173,_0x398f67,_0x2b3777){var _0x315eac={'agent':{},'channel':_0x9ee8('0x7d')};if(_0x2c9173[_0x9ee8('0x5f')]['id']){delete _0x2c9173[_0x9ee8('0x5f')]['id'];}_0x2c9173[_0x9ee8('0x5f')][_0x9ee8('0x66')]=_0x2c9173[_0x9ee8('0x5f')]['UserId']||_0x2c9173['user']['id'];_0x315eac[_0x9ee8('0x74')]['id']=_0x2c9173[_0x9ee8('0x5f')][_0x9ee8('0x66')];return db[_0x9ee8('0x57')][_0x9ee8('0x5d')]({'where':{'id':_0x2c9173[_0x9ee8('0x5b')]['id'],'UserId':null}})[_0x9ee8('0x25')](handleEntityNotFound(_0x398f67,null))[_0x9ee8('0x25')](function(_0x3fef07){if(_0x3fef07){_0x315eac[_0x9ee8('0x2e')]=_0x3fef07['get']({'plain':!![]});return db[_0x9ee8('0x68')][_0x9ee8('0x5d')]({'where':{'id':_0x3fef07[_0x9ee8('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x398f67,null))[_0x9ee8('0x25')](function(_0x439659){if(_0x439659){_0x315eac[_0x9ee8('0x6b')]=_0x439659[_0x9ee8('0x6c')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2c9173[_0x9ee8('0x67')]['id'],_0x2c9173[_0x9ee8('0x67')]['name'],_0x2c9173[_0x9ee8('0x67')][_0x9ee8('0x7e')],_0x315eac[_0x9ee8('0x6b')]['id'],_0x2c9173[_0x9ee8('0x5f')]?JSON['stringify'](_0x2c9173[_0x9ee8('0x5f')]):_0x9ee8('0x7f'));return respondWithRpcPromise(_0x9ee8('0x80'),_0x9ee8('0x81'),_0x315eac);}return null;})['then'](function(_0x13608c){var _0x2b93b7=_0x9ee8('0x6f')+_0x13608c['message']['ContactId'];return db[_0x9ee8('0x82')][_0x9ee8('0x46')](_0x2b93b7,{'type':db['Sequelize'][_0x9ee8('0x71')][_0x9ee8('0x72')],'raw':!![]})[_0x9ee8('0x25')](function(_0x2861b5){return _0x2861b5;});})[_0x9ee8('0x25')](function(_0x5de87b){if(_0x5de87b){_0x315eac[_0x9ee8('0x2e')][_0x9ee8('0x83')]=_0x5de87b[0x0];if(!_0x2c9173['body']['UserId'])return;return db[_0x9ee8('0x73')]['find']({'where':{'id':_0x2c9173[_0x9ee8('0x5f')][_0x9ee8('0x66')],'role':_0x9ee8('0x74')},'attributes':['id',_0x9ee8('0x3f'),_0x9ee8('0x75'),_0x9ee8('0x84'),_0x9ee8('0x76')],'raw':!![]});}return null;})[_0x9ee8('0x25')](function(_0x43be9d){if(!_0x43be9d)return null;_0x315eac[_0x9ee8('0x2e')][_0x9ee8('0x74')]=_0x43be9d;return _0x315eac;})[_0x9ee8('0x25')](function(_0x1b2c4f){if(_0x1b2c4f){_0x1b2c4f[_0x9ee8('0x2e')][_0x9ee8('0x85')]=util[_0x9ee8('0x64')](_0x9ee8('0x78'),_0x2c9173[_0x9ee8('0x67')][_0x9ee8('0x3f')]);_0x1b2c4f[_0x9ee8('0x2e')][_0x9ee8('0x79')]=_0x315eac[_0x9ee8('0x79')];_0x1b2c4f[_0x9ee8('0x2e')][_0x9ee8('0x86')]=_0x315eac[_0x9ee8('0x79')];_0x1b2c4f[_0x9ee8('0x2e')][_0x9ee8('0x87')]=_0x9ee8('0x3a');respondWithRpcPromise(_0x9ee8('0x7a'),_0x9ee8('0x7a'),{'event':_0x9ee8('0x88'),'message':_[_0x9ee8('0x54')](_0x315eac[_0x9ee8('0x2e')],JSON['parse'](_0x315eac['interaction'][_0x9ee8('0x89')]))},client9002);return _0x315eac;}return null;})[_0x9ee8('0x25')](respondWithResult(_0x398f67,null))[_0x9ee8('0x30')](handleError(_0x398f67,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index f71df49..5cb8172 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 _0x8498=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x8498,0xc3));var _0x8849=function(_0x1bd51d,_0x46f25e){_0x1bd51d=_0x1bd51d-0x0;var _0x116b83=_0x8498[_0x1bd51d];return _0x116b83;};'use strict';var EventEmitter=require(_0x8849('0x0'));var ChatMessage=require(_0x8849('0x1'))['db'][_0x8849('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x8849('0x3')](0x0);var events={'afterCreate':_0x8849('0x4'),'afterUpdate':_0x8849('0x5'),'afterDestroy':_0x8849('0x6')};function emitEvent(_0x52791d){return function(_0x4a4473,_0x666391,_0x7853f1){ChatMessageEvents[_0x8849('0x7')](_0x52791d+':'+_0x4a4473['id'],_0x4a4473);ChatMessageEvents['emit'](_0x52791d,_0x4a4473);_0x7853f1(null);};}for(var e in events){if(events[_0x8849('0x8')](e)){var event=events[e];ChatMessage[_0x8849('0x9')](e,emitEvent(event));}}module[_0x8849('0xa')]=ChatMessageEvents; \ No newline at end of file +var _0xc914=['remove','emit','hasOwnProperty','../../mysqldb','ChatMessage','setMaxListeners','save','update'];(function(_0x40fea4,_0x8757e0){var _0x10197c=function(_0x42c986){while(--_0x42c986){_0x40fea4['push'](_0x40fea4['shift']());}};_0x10197c(++_0x8757e0);}(_0xc914,0x83));var _0x4c91=function(_0xdf6baf,_0x13d18f){_0xdf6baf=_0xdf6baf-0x0;var _0x587021=_0xc914[_0xdf6baf];return _0x587021;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x4c91('0x0'))['db'][_0x4c91('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x4c91('0x2')](0x0);var events={'afterCreate':_0x4c91('0x3'),'afterUpdate':_0x4c91('0x4'),'afterDestroy':_0x4c91('0x5')};function emitEvent(_0x557759){return function(_0x175957,_0x261182,_0x57ce0b){ChatMessageEvents[_0x4c91('0x6')](_0x557759+':'+_0x175957['id'],_0x175957);ChatMessageEvents[_0x4c91('0x6')](_0x557759,_0x175957);_0x57ce0b(null);};}for(var e in events){if(events[_0x4c91('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 453a956..5861c47 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 _0x1306=['catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt'];(function(_0x5b45fb,_0x4a8523){var _0x43c96e=function(_0x3a63ae){while(--_0x3a63ae){_0x5b45fb['push'](_0x5b45fb['shift']());}};_0x43c96e(++_0x4a8523);}(_0x1306,0x17a));var _0x6130=function(_0xef3257,_0x2d52d0){_0xef3257=_0xef3257-0x0;var _0x30ac27=_0x1306[_0xef3257];return _0x30ac27;};'use strict';var _=require(_0x6130('0x0'));var util=require(_0x6130('0x1'));var logger=require(_0x6130('0x2'))(_0x6130('0x3'));var moment=require(_0x6130('0x4'));var BPromise=require(_0x6130('0x5'));var rp=require(_0x6130('0x6'));var fs=require('fs');var path=require(_0x6130('0x7'));var rimraf=require(_0x6130('0x8'));var config=require(_0x6130('0x9'));var attributes=require(_0x6130('0xa'));module[_0x6130('0xb')]=function(_0x213e6a,_0x2b965d){return _0x213e6a[_0x6130('0xc')](_0x6130('0xd'),attributes,{'tableName':_0x6130('0xe'),'paranoid':![],'indexes':[{'name':_0x6130('0xf'),'fields':[_0x6130('0x10')],'type':_0x6130('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3d2f77,_0x33b116,_0xb9c7e6){var _0x34d1a6=_0x213e6a[_0x6130('0x12')];var _0x107d80=_0x3d2f77[_0x6130('0x13')]({'plain':!![]});if(_0x107d80[_0x6130('0x14')][_0x6130('0x15')]()==='in'||_0x107d80['direction'][_0x6130('0x15')]()==='out'&&!_0x107d80[_0x6130('0x16')]&&!_[_0x6130('0x17')](_0x107d80['UserId'])){_0x34d1a6[_0x6130('0x18')][_0x6130('0x19')]({'where':{'id':_0x107d80[_0x6130('0x1a')]}})[_0x6130('0x1b')](function(_0x1d736c){if(_0x1d736c){_0x1d736c[_0x6130('0x1c')]({'lastMsgAt':_0x107d80[_0x6130('0x1d')],'lastMsgDirection':_0x107d80[_0x6130('0x14')][_0x6130('0x15')]()});}})[_0x6130('0x1e')](function(_0x401a70){console[_0x6130('0x1f')](_0x401a70);});}_0xb9c7e6();}},'charset':_0x6130('0x20'),'collate':_0x6130('0x21')});}; \ No newline at end of file +var _0xad7f=['then','update','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatMessage','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil'];(function(_0x3b88fa,_0x5366f){var _0xbc3533=function(_0x53c6ad){while(--_0x53c6ad){_0x3b88fa['push'](_0x3b88fa['shift']());}};_0xbc3533(++_0x5366f);}(_0xad7f,0x1a5));var _0xfad7=function(_0x16c314,_0x4bcd8e){_0x16c314=_0x16c314-0x0;var _0x1b0580=_0xad7f[_0x16c314];return _0x1b0580;};'use strict';var _=require(_0xfad7('0x0'));var util=require(_0xfad7('0x1'));var logger=require(_0xfad7('0x2'))(_0xfad7('0x3'));var moment=require(_0xfad7('0x4'));var BPromise=require(_0xfad7('0x5'));var rp=require(_0xfad7('0x6'));var fs=require('fs');var path=require(_0xfad7('0x7'));var rimraf=require(_0xfad7('0x8'));var config=require(_0xfad7('0x9'));var attributes=require('./chatMessage.attributes');module[_0xfad7('0xa')]=function(_0x5b067d,_0x57774f){return _0x5b067d['define'](_0xfad7('0xb'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xfad7('0xc'),'fields':[_0xfad7('0xd')],'type':_0xfad7('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x7e5802,_0x14a662,_0x2bd913){var _0x17cfbf=_0x5b067d['models'];var _0x1a2d12=_0x7e5802[_0xfad7('0xf')]({'plain':!![]});if(_0x1a2d12[_0xfad7('0x10')][_0xfad7('0x11')]()==='in'||_0x1a2d12['direction'][_0xfad7('0x11')]()===_0xfad7('0x12')&&!_0x1a2d12[_0xfad7('0x13')]&&!_[_0xfad7('0x14')](_0x1a2d12['UserId'])){_0x17cfbf['ChatInteraction']['findOne']({'where':{'id':_0x1a2d12['ChatInteractionId']}})[_0xfad7('0x15')](function(_0x430b10){if(_0x430b10){_0x430b10[_0xfad7('0x16')]({'lastMsgAt':_0x1a2d12['createdAt'],'lastMsgDirection':_0x1a2d12[_0xfad7('0x10')][_0xfad7('0x11')]()});}})['catch'](function(_0x20dd62){console[_0xfad7('0x17')](_0x20dd62);});}_0x2bd913();}},'charset':_0xfad7('0x18'),'collate':_0xfad7('0x19')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 96cfc6d..555e205 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 _0x870c=['../../config/environment','jayson/promise','http','redis','defaults','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3e91a9,_0x53c466){var _0x25c9ad=function(_0x69ee2d){while(--_0x69ee2d){_0x3e91a9['push'](_0x3e91a9['shift']());}};_0x25c9ad(++_0x53c466);}(_0x870c,0x1b9));var _0xc870=function(_0x5be992,_0x47b69c){_0x5be992=_0x5be992-0x0;var _0x3312c5=_0x870c[_0x5be992];return _0x3312c5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc870('0x0'));var BPromise=require(_0xc870('0x1'));var rs=require(_0xc870('0x2'));var fs=require('fs');var Redis=require(_0xc870('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc870('0x4'));var logger=require(_0xc870('0x5'))(_0xc870('0x6'));var config=require(_0xc870('0x7'));var jayson=require(_0xc870('0x8'));var client=jayson['client'][_0xc870('0x9')]({'port':0x232a});config[_0xc870('0xa')]=_[_0xc870('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc870('0xa')]));require(_0xc870('0xc'))[_0xc870('0xd')](socket);function respondWithRpcPromise(_0x26d0df,_0xe47522,_0x1c0804){return new BPromise(function(_0x45aa03,_0x10441c){return client[_0xc870('0xe')](_0x26d0df,_0x1c0804)[_0xc870('0xf')](function(_0xb84d8){logger[_0xc870('0x10')](_0xc870('0x11'),_0xe47522,_0xc870('0x12'));logger[_0xc870('0x13')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0xe47522,_0xc870('0x12'),JSON[_0xc870('0x14')](_0xb84d8));if(_0xb84d8[_0xc870('0x15')]){if(_0xb84d8[_0xc870('0x15')][_0xc870('0x16')]===0x1f4){logger[_0xc870('0x15')](_0xc870('0x11'),_0xe47522,_0xb84d8['error'][_0xc870('0x17')]);return _0x10441c(_0xb84d8[_0xc870('0x15')][_0xc870('0x17')]);}logger[_0xc870('0x15')]('ChatMessage,\x20%s,\x20%s',_0xe47522,_0xb84d8[_0xc870('0x15')][_0xc870('0x17')]);return _0x45aa03(_0xb84d8[_0xc870('0x15')][_0xc870('0x17')]);}else{logger[_0xc870('0x10')](_0xc870('0x11'),_0xe47522,_0xc870('0x12'));_0x45aa03(_0xb84d8[_0xc870('0x18')][_0xc870('0x17')]);}})[_0xc870('0x19')](function(_0x1e0135){logger[_0xc870('0x15')](_0xc870('0x11'),_0xe47522,_0x1e0135);_0x10441c(_0x1e0135);});});}exports[_0xc870('0x1a')]=function(_0xa6cc49){var _0x3ab88a=this;return new Promise(function(_0x759ede,_0x4f506f){return db[_0xc870('0x1b')][_0xc870('0x1c')](_0xa6cc49[_0xc870('0x1d')],{'raw':_0xa6cc49[_0xc870('0x1e')]?_0xa6cc49[_0xc870('0x1e')][_0xc870('0x1f')]===undefined?!![]:![]:!![]})[_0xc870('0xf')](function(_0x3dd59b){logger[_0xc870('0x10')]('CreateChatMessage',_0xa6cc49);logger[_0xc870('0x13')](_0xc870('0x1a'),_0xa6cc49,JSON['stringify'](_0x3dd59b));_0x759ede(_0x3dd59b);})['catch'](function(_0x5d5fc7){logger[_0xc870('0x15')]('CreateChatMessage',_0x5d5fc7['message'],_0xa6cc49);_0x4f506f(_0x3ab88a[_0xc870('0x15')](0x1f4,_0x5d5fc7[_0xc870('0x17')]));});});}; \ No newline at end of file +var _0xe86b=['code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','then','stringify','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0xff70d1,_0x12166f){var _0x144b71=function(_0x29dd){while(--_0x29dd){_0xff70d1['push'](_0xff70d1['shift']());}};_0x144b71(++_0x12166f);}(_0xe86b,0x182));var _0xbe86=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe86b[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xbe86('0x0'));var util=require(_0xbe86('0x1'));var moment=require('moment');var BPromise=require(_0xbe86('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbe86('0x3'));var db=require(_0xbe86('0x4'))['db'];var utils=require(_0xbe86('0x5'));var logger=require(_0xbe86('0x6'))(_0xbe86('0x7'));var config=require(_0xbe86('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbe86('0x9')]({'port':0x232a});config['redis']=_[_0xbe86('0xa')](config[_0xbe86('0xb')],{'host':_0xbe86('0xc'),'port':0x18eb});var socket=require(_0xbe86('0xd'))(new Redis(config[_0xbe86('0xb')]));require(_0xbe86('0xe'))[_0xbe86('0xf')](socket);function respondWithRpcPromise(_0x162f66,_0x5bb316,_0x2fd79f){return new BPromise(function(_0x23fa97,_0x10b292){return client[_0xbe86('0x10')](_0x162f66,_0x2fd79f)['then'](function(_0x2eb681){logger[_0xbe86('0x11')](_0xbe86('0x12'),_0x5bb316,_0xbe86('0x13'));logger[_0xbe86('0x14')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5bb316,_0xbe86('0x13'),JSON['stringify'](_0x2eb681));if(_0x2eb681[_0xbe86('0x15')]){if(_0x2eb681[_0xbe86('0x15')][_0xbe86('0x16')]===0x1f4){logger[_0xbe86('0x15')]('ChatMessage,\x20%s,\x20%s',_0x5bb316,_0x2eb681[_0xbe86('0x15')]['message']);return _0x10b292(_0x2eb681[_0xbe86('0x15')][_0xbe86('0x17')]);}logger[_0xbe86('0x15')](_0xbe86('0x12'),_0x5bb316,_0x2eb681[_0xbe86('0x15')][_0xbe86('0x17')]);return _0x23fa97(_0x2eb681[_0xbe86('0x15')]['message']);}else{logger[_0xbe86('0x11')](_0xbe86('0x12'),_0x5bb316,'request\x20sent');_0x23fa97(_0x2eb681[_0xbe86('0x18')][_0xbe86('0x17')]);}})[_0xbe86('0x19')](function(_0x2004ac){logger[_0xbe86('0x15')](_0xbe86('0x12'),_0x5bb316,_0x2004ac);_0x10b292(_0x2004ac);});});}exports[_0xbe86('0x1a')]=function(_0xdd781b){var _0x563392=this;return new Promise(function(_0x1dad5f,_0x2d801f){return db[_0xbe86('0x1b')][_0xbe86('0x1c')](_0xdd781b[_0xbe86('0x1d')],{'raw':_0xdd781b[_0xbe86('0x1e')]?_0xdd781b['options'][_0xbe86('0x1f')]===undefined?!![]:![]:!![]})[_0xbe86('0x20')](function(_0x36801f){logger[_0xbe86('0x11')]('CreateChatMessage',_0xdd781b);logger[_0xbe86('0x14')]('CreateChatMessage',_0xdd781b,JSON[_0xbe86('0x21')](_0x36801f));_0x1dad5f(_0x36801f);})[_0xbe86('0x19')](function(_0x5b8428){logger[_0xbe86('0x15')]('CreateChatMessage',_0x5b8428[_0xbe86('0x17')],_0xdd781b);_0x2d801f(_0x563392[_0xbe86('0x15')](0x1f4,_0x5b8428['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 42c1e39..e5a20df 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 _0x0d4d=['remove','update','emit','removeListener','chatMessage:','./chatMessage.events','save'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0d4d,0x132));var _0xd0d4=function(_0x5b7f31,_0x2647d7){_0x5b7f31=_0x5b7f31-0x0;var _0x2c8503=_0x0d4d[_0x5b7f31];return _0x2c8503;};'use strict';var ChatMessageEvents=require(_0xd0d4('0x0'));var events=[_0xd0d4('0x1'),_0xd0d4('0x2'),_0xd0d4('0x3')];function createListener(_0x1f74ab,_0x1515e0){return function(_0x4d5c19){_0x1515e0[_0xd0d4('0x4')](_0x1f74ab,_0x4d5c19);};}function removeListener(_0x58909f,_0x2e99ee){return function(){ChatMessageEvents[_0xd0d4('0x5')](_0x58909f,_0x2e99ee);};}exports['register']=function(_0x34d93b){for(var _0x3db5ab=0x0,_0x1c5d01=events['length'];_0x3db5ab<_0x1c5d01;_0x3db5ab++){var _0x5bfae8=events[_0x3db5ab];var _0x5403c0=createListener(_0xd0d4('0x6')+_0x5bfae8,_0x34d93b);ChatMessageEvents['on'](_0x5bfae8,_0x5403c0);}}; \ No newline at end of file +var _0xb647=['register','length','chatMessage:','./chatMessage.events','save','remove','update','emit'];(function(_0x1d414c,_0x34cc20){var _0x498ebf=function(_0x3cc9d4){while(--_0x3cc9d4){_0x1d414c['push'](_0x1d414c['shift']());}};_0x498ebf(++_0x34cc20);}(_0xb647,0xdb));var _0x7b64=function(_0x472479,_0x2b06e8){_0x472479=_0x472479-0x0;var _0x160c6d=_0xb647[_0x472479];return _0x160c6d;};'use strict';var ChatMessageEvents=require(_0x7b64('0x0'));var events=[_0x7b64('0x1'),_0x7b64('0x2'),_0x7b64('0x3')];function createListener(_0x38de52,_0x3b659e){return function(_0x274824){_0x3b659e[_0x7b64('0x4')](_0x38de52,_0x274824);};}function removeListener(_0x54eee8,_0x36ff12){return function(){ChatMessageEvents['removeListener'](_0x54eee8,_0x36ff12);};}exports[_0x7b64('0x5')]=function(_0x38ebf7){for(var _0x31915b=0x0,_0x80721a=events[_0x7b64('0x6')];_0x31915b<_0x80721a;_0x31915b++){var _0x22eca3=events[_0x31915b];var _0x727684=createListener(_0x7b64('0x7')+_0x22eca3,_0x38ebf7);ChatMessageEvents['on'](_0x22eca3,_0x727684);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 5be6ee5..a06c8c1 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 _0x0b87=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','tracked','chat','create','update','put','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util'];(function(_0x3d27a4,_0x851ffa){var _0x1d0a3c=function(_0x339390){while(--_0x339390){_0x3d27a4['push'](_0x3d27a4['shift']());}};_0x1d0a3c(++_0x851ffa);}(_0x0b87,0x111));var _0x70b8=function(_0x11ecb5,_0x2477d5){_0x11ecb5=_0x11ecb5-0x0;var _0x2efeb1=_0x0b87[_0x11ecb5];return _0x2efeb1;};'use strict';var multer=require(_0x70b8('0x0'));var util=require(_0x70b8('0x1'));var path=require(_0x70b8('0x2'));var timeout=require(_0x70b8('0x3'));var express=require(_0x70b8('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x70b8('0x5'));var interaction=require(_0x70b8('0x6'));var config=require('../../config/environment');var controller=require(_0x70b8('0x7'));router[_0x70b8('0x8')]('/',auth[_0x70b8('0x9')](),controller['index']);router[_0x70b8('0x8')](_0x70b8('0xa'),auth[_0x70b8('0x9')](),controller[_0x70b8('0xb')]);router['get'](_0x70b8('0xc'),auth[_0x70b8('0x9')](),controller[_0x70b8('0xd')]);router['post']('/',auth[_0x70b8('0x9')](),interaction[_0x70b8('0xe')](_0x70b8('0xf'),'chatmessage:create'),controller[_0x70b8('0x10')]);router['put'](_0x70b8('0xc'),controller[_0x70b8('0x11')]);router[_0x70b8('0x12')](_0x70b8('0x13'),auth['isAuthenticated'](),controller[_0x70b8('0x14')]);router[_0x70b8('0x12')](_0x70b8('0x15'),auth['isAuthenticated'](),controller[_0x70b8('0x16')]);router[_0x70b8('0x17')](_0x70b8('0xc'),auth[_0x70b8('0x9')](),controller['destroy']);module[_0x70b8('0x18')]=router; \ No newline at end of file +var _0x980e=['/:id','update','/:id/accept','/:id/reject','reject','delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','/describe','describe','show','post','chat','create','put'];(function(_0x4a3ee3,_0x304512){var _0x56d16d=function(_0x280251){while(--_0x280251){_0x4a3ee3['push'](_0x4a3ee3['shift']());}};_0x56d16d(++_0x304512);}(_0x980e,0x1b7));var _0xe980=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x980e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe980('0x0'));var util=require(_0xe980('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe980('0x2'));var router=express[_0xe980('0x3')]();var fs_extra=require(_0xe980('0x4'));var auth=require(_0xe980('0x5'));var interaction=require(_0xe980('0x6'));var config=require('../../config/environment');var controller=require(_0xe980('0x7'));router[_0xe980('0x8')]('/',auth[_0xe980('0x9')](),controller['index']);router['get'](_0xe980('0xa'),auth['isAuthenticated'](),controller[_0xe980('0xb')]);router[_0xe980('0x8')]('/:id',auth[_0xe980('0x9')](),controller[_0xe980('0xc')]);router[_0xe980('0xd')]('/',auth[_0xe980('0x9')](),interaction['tracked'](_0xe980('0xe'),'chatmessage:create'),controller[_0xe980('0xf')]);router[_0xe980('0x10')](_0xe980('0x11'),controller[_0xe980('0x12')]);router[_0xe980('0x10')](_0xe980('0x13'),auth[_0xe980('0x9')](),controller['accept']);router[_0xe980('0x10')](_0xe980('0x14'),auth['isAuthenticated'](),controller[_0xe980('0x15')]);router[_0xe980('0x16')](_0xe980('0x11'),auth['isAuthenticated'](),controller[_0xe980('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 01d65a5..46a0b4a 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 _0x0b4f=['exports','TEXT','medium','sequelize'];(function(_0x5d8034,_0x313d81){var _0x5f54fb=function(_0x5c915f){while(--_0x5c915f){_0x5d8034['push'](_0x5d8034['shift']());}};_0x5f54fb(++_0x313d81);}(_0x0b4f,0xcb));var _0xf0b4=function(_0x279a95,_0x51633e){_0x279a95=_0x279a95-0x0;var _0x47cf1e=_0x0b4f[_0x279a95];return _0x47cf1e;};'use strict';var Sequelize=require(_0xf0b4('0x0'));module[_0xf0b4('0x1')]={'body':{'type':Sequelize[_0xf0b4('0x2')](_0xf0b4('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0x46e9=['TEXT','medium','sequelize','exports'];(function(_0x476b5f,_0x1f9952){var _0x5a23d8=function(_0x50b464){while(--_0x50b464){_0x476b5f['push'](_0x476b5f['shift']());}};_0x5a23d8(++_0x1f9952);}(_0x46e9,0x96));var _0x946e=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x46e9[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x946e('0x0'));module[_0x946e('0x1')]={'body':{'type':Sequelize[_0x946e('0x2')](_0x946e('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 0406dce..99993fc 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(_0x4ac0ce,_0x440d26){var _0x3088e5=function(_0x3d8414){while(--_0x3d8414){_0x4ac0ce['push'](_0x4ac0ce['shift']());}};_0x3088e5(++_0x440d26);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x7a54,0x106));var _0x47a5=function(_0x42f855,_0x55ca2b){_0x42f855=_0x42f855-0x0;var _0x3a15ea=_0x7a54[_0x42f855];return _0x3a15ea;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 128432f..9b2dd0a 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 _0x160a=['lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatOfflineMessage.attributes','define','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x160a,0x8f));var _0xa160=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x160a[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0xa160('0x0'));var util=require(_0xa160('0x1'));var logger=require(_0xa160('0x2'))(_0xa160('0x3'));var moment=require(_0xa160('0x4'));var BPromise=require('bluebird');var rp=require(_0xa160('0x5'));var fs=require('fs');var path=require(_0xa160('0x6'));var rimraf=require('rimraf');var config=require(_0xa160('0x7'));var attributes=require(_0xa160('0x8'));module['exports']=function(_0x28ff00,_0x9b3c4f){return _0x28ff00[_0xa160('0x9')]('ChatOfflineMessage',attributes,{'tableName':_0xa160('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa160('0xb'),'collate':_0xa160('0xc')});}; \ No newline at end of file +var _0x9c83=['api','path','./chatOfflineMessage.attributes','exports','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x1bc9b8,_0x379fc7){var _0x1a9a13=function(_0x3a73ea){while(--_0x3a73ea){_0x1bc9b8['push'](_0x1bc9b8['shift']());}};_0x1a9a13(++_0x379fc7);}(_0x9c83,0x13f));var _0x39c8=function(_0x167baa,_0x3f814f){_0x167baa=_0x167baa-0x0;var _0x4e082c=_0x9c83[_0x167baa];return _0x4e082c;};'use strict';var _=require('lodash');var util=require(_0x39c8('0x0'));var logger=require('../../config/logger')(_0x39c8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x39c8('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x39c8('0x3'));module[_0x39c8('0x4')]=function(_0x316ef6,_0x55dc54){return _0x316ef6['define']('ChatOfflineMessage',attributes,{'tableName':_0x39c8('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x39c8('0x6'),'collate':_0x39c8('0x7')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 847f47f..b45a57c 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 _0xa1e9=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash'];(function(_0x2935b2,_0x2aa718){var _0x58e217=function(_0x330c42){while(--_0x330c42){_0x2935b2['push'](_0x2935b2['shift']());}};_0x58e217(++_0x2aa718);}(_0xa1e9,0x1ed));var _0x9a1e=function(_0x45fae8,_0xae3903){_0x45fae8=_0x45fae8-0x0;var _0x307de2=_0xa1e9[_0x45fae8];return _0x307de2;};'use strict';var _=require(_0x9a1e('0x0'));var util=require(_0x9a1e('0x1'));var moment=require(_0x9a1e('0x2'));var BPromise=require(_0x9a1e('0x3'));var rs=require(_0x9a1e('0x4'));var fs=require('fs');var Redis=require(_0x9a1e('0x5'));var db=require(_0x9a1e('0x6'))['db'];var utils=require(_0x9a1e('0x7'));var logger=require(_0x9a1e('0x8'))(_0x9a1e('0x9'));var config=require(_0x9a1e('0xa'));var jayson=require(_0x9a1e('0xb'));var client=jayson[_0x9a1e('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2427f1,_0x156f3e,_0x31395c){return new BPromise(function(_0x462a2e,_0x2bcb06){return client[_0x9a1e('0xd')](_0x2427f1,_0x31395c)[_0x9a1e('0xe')](function(_0x41a923){logger[_0x9a1e('0xf')](_0x9a1e('0x10'),_0x156f3e,_0x9a1e('0x11'));logger[_0x9a1e('0x12')](_0x9a1e('0x13'),_0x156f3e,_0x9a1e('0x11'),JSON[_0x9a1e('0x14')](_0x41a923));if(_0x41a923['error']){if(_0x41a923['error'][_0x9a1e('0x15')]===0x1f4){logger['error'](_0x9a1e('0x10'),_0x156f3e,_0x41a923[_0x9a1e('0x16')][_0x9a1e('0x17')]);return _0x2bcb06(_0x41a923[_0x9a1e('0x16')][_0x9a1e('0x17')]);}logger[_0x9a1e('0x16')](_0x9a1e('0x10'),_0x156f3e,_0x41a923[_0x9a1e('0x16')][_0x9a1e('0x17')]);return _0x462a2e(_0x41a923[_0x9a1e('0x16')]['message']);}else{logger[_0x9a1e('0xf')](_0x9a1e('0x10'),_0x156f3e,_0x9a1e('0x11'));_0x462a2e(_0x41a923[_0x9a1e('0x18')][_0x9a1e('0x17')]);}})[_0x9a1e('0x19')](function(_0x2ee642){logger['error'](_0x9a1e('0x10'),_0x156f3e,_0x2ee642);_0x2bcb06(_0x2ee642);});});} \ No newline at end of file +var _0x9f82=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','ChatOfflineMessage,\x20%s,\x20%s','message','info','catch','util','moment','bluebird'];(function(_0x37c8ef,_0x334449){var _0x5eaee9=function(_0x4b1b98){while(--_0x4b1b98){_0x37c8ef['push'](_0x37c8ef['shift']());}};_0x5eaee9(++_0x334449);}(_0x9f82,0x111));var _0x29f8=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9f82[_0x334841];return _0x5beb4b;};'use strict';var _=require('lodash');var util=require(_0x29f8('0x0'));var moment=require(_0x29f8('0x1'));var BPromise=require(_0x29f8('0x2'));var rs=require(_0x29f8('0x3'));var fs=require('fs');var Redis=require(_0x29f8('0x4'));var db=require(_0x29f8('0x5'))['db'];var utils=require(_0x29f8('0x6'));var logger=require(_0x29f8('0x7'))(_0x29f8('0x8'));var config=require(_0x29f8('0x9'));var jayson=require(_0x29f8('0xa'));var client=jayson[_0x29f8('0xb')][_0x29f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xa8366c,_0x5c1cbc,_0x4fc691){return new BPromise(function(_0x30185e,_0x5d12f5){return client['request'](_0xa8366c,_0x4fc691)['then'](function(_0x249dc7){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x5c1cbc,_0x29f8('0xd'));logger[_0x29f8('0xe')](_0x29f8('0xf'),_0x5c1cbc,_0x29f8('0xd'),JSON[_0x29f8('0x10')](_0x249dc7));if(_0x249dc7['error']){if(_0x249dc7['error'][_0x29f8('0x11')]===0x1f4){logger[_0x29f8('0x12')](_0x29f8('0x13'),_0x5c1cbc,_0x249dc7['error']['message']);return _0x5d12f5(_0x249dc7[_0x29f8('0x12')]['message']);}logger['error'](_0x29f8('0x13'),_0x5c1cbc,_0x249dc7[_0x29f8('0x12')][_0x29f8('0x14')]);return _0x30185e(_0x249dc7[_0x29f8('0x12')]['message']);}else{logger[_0x29f8('0x15')](_0x29f8('0x13'),_0x5c1cbc,_0x29f8('0xd'));_0x30185e(_0x249dc7['result'][_0x29f8('0x14')]);}})[_0x29f8('0x16')](function(_0x1a362f){logger[_0x29f8('0x12')](_0x29f8('0x13'),_0x5c1cbc,_0x1a362f);_0x5d12f5(_0x1a362f);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 5245f2f..5702eac 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 _0x5650=['path','connect-timeout','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','/:id','isAuthenticated','show','put','delete','exports','multer','util'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x5650,0xde));var _0x0565=function(_0x506a19,_0x1aa991){_0x506a19=_0x506a19-0x0;var _0x23f2b5=_0x5650[_0x506a19];return _0x23f2b5;};'use strict';var multer=require(_0x0565('0x0'));var util=require(_0x0565('0x1'));var path=require(_0x0565('0x2'));var timeout=require(_0x0565('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0565('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0565('0x5'));var controller=require(_0x0565('0x6'));router[_0x0565('0x7')]('/',auth['isAuthenticated'](),controller[_0x0565('0x8')]);router[_0x0565('0x7')](_0x0565('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x0565('0xa'),auth[_0x0565('0xb')](),controller[_0x0565('0xc')]);router['post']('/',auth[_0x0565('0xb')](),controller['create']);router[_0x0565('0xd')](_0x0565('0xa'),auth[_0x0565('0xb')](),controller['update']);router[_0x0565('0xe')](_0x0565('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x0565('0xf')]=router; \ No newline at end of file +var _0xc7db=['./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x410dbd,_0x210e38){var _0x2c85ed=function(_0x5e97f8){while(--_0x5e97f8){_0x410dbd['push'](_0x410dbd['shift']());}};_0x2c85ed(++_0x210e38);}(_0xc7db,0x188));var _0xbc7d=function(_0x30bfcf,_0x3e168){_0x30bfcf=_0x30bfcf-0x0;var _0x41f723=_0xc7db[_0x30bfcf];return _0x41f723;};'use strict';var multer=require(_0xbc7d('0x0'));var util=require(_0xbc7d('0x1'));var path=require('path');var timeout=require(_0xbc7d('0x2'));var express=require(_0xbc7d('0x3'));var router=express[_0xbc7d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbc7d('0x5'));var interaction=require(_0xbc7d('0x6'));var config=require('../../config/environment');var controller=require(_0xbc7d('0x7'));router[_0xbc7d('0x8')]('/',auth[_0xbc7d('0x9')](),controller[_0xbc7d('0xa')]);router[_0xbc7d('0x8')](_0xbc7d('0xb'),auth[_0xbc7d('0x9')](),controller[_0xbc7d('0xc')]);router['get'](_0xbc7d('0xd'),auth[_0xbc7d('0x9')](),controller[_0xbc7d('0xe')]);router[_0xbc7d('0xf')]('/',auth[_0xbc7d('0x9')](),controller[_0xbc7d('0x10')]);router[_0xbc7d('0x11')](_0xbc7d('0xd'),auth[_0xbc7d('0x9')](),controller[_0xbc7d('0x12')]);router[_0xbc7d('0x13')](_0xbc7d('0xd'),auth['isAuthenticated'](),controller[_0xbc7d('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 1ce0e0a..bde2508 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 _0x669e=['STRING','ENUM','mouseOver','sequelize'];(function(_0x1bbd48,_0x10a01b){var _0x3655a9=function(_0x11e48a){while(--_0x11e48a){_0x1bbd48['push'](_0x1bbd48['shift']());}};_0x3655a9(++_0x10a01b);}(_0x669e,0xef));var _0xe669=function(_0x3b327f,_0x2b6488){_0x3b327f=_0x3b327f-0x0;var _0x442e47=_0x669e[_0x3b327f];return _0x442e47;};'use strict';var Sequelize=require(_0xe669('0x0'));module['exports']={'name':{'type':Sequelize[_0xe669('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xe669('0x2')](_0xe669('0x3'),'timeout'),'defaultValue':_0xe669('0x3')},'selector':{'type':Sequelize[_0xe669('0x1')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x43d4=['INTEGER','exports','STRING','ENUM','mouseOver','timeout'];(function(_0x5cf506,_0x315793){var _0x25e12d=function(_0x18cea2){while(--_0x18cea2){_0x5cf506['push'](_0x5cf506['shift']());}};_0x25e12d(++_0x315793);}(_0x43d4,0x109));var _0x443d=function(_0xbedfe8,_0x16fc10){_0xbedfe8=_0xbedfe8-0x0;var _0x3e7f56=_0x43d4[_0xbedfe8];return _0x3e7f56;};'use strict';var Sequelize=require('sequelize');module[_0x443d('0x0')]={'name':{'type':Sequelize[_0x443d('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x443d('0x2')](_0x443d('0x3'),_0x443d('0x4')),'defaultValue':_0x443d('0x3')},'selector':{'type':Sequelize[_0x443d('0x1')]},'timeout':{'type':Sequelize[_0x443d('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 2877550..67962e0 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 _0xab29=['limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','send','show','params','model','keys','rawAttributes','query','intersection','attributes','fields','includeAll','include','merge','find','catch','create','ChatProactiveAction','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','json','undefined'];(function(_0x6d97b2,_0x3c1332){var _0x514465=function(_0x13c3ce){while(--_0x13c3ce){_0x6d97b2['push'](_0x6d97b2['shift']());}};_0x514465(++_0x3c1332);}(_0xab29,0x145));var _0x9ab2=function(_0x3da1d0,_0x4c7f2f){_0x3da1d0=_0x3da1d0-0x0;var _0x2b5084=_0xab29[_0x3da1d0];return _0x2b5084;};'use strict';var emlformat=require(_0x9ab2('0x0'));var rimraf=require(_0x9ab2('0x1'));var zipdir=require(_0x9ab2('0x2'));var jsonpatch=require(_0x9ab2('0x3'));var rp=require('request-promise');var moment=require(_0x9ab2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9ab2('0x5'));var util=require(_0x9ab2('0x6'));var path=require(_0x9ab2('0x7'));var sox=require(_0x9ab2('0x8'));var csv=require(_0x9ab2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9ab2('0xa'));var _=require(_0x9ab2('0xb'));var squel=require(_0x9ab2('0xc'));var crypto=require(_0x9ab2('0xd'));var jsforce=require(_0x9ab2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9ab2('0x9'));var querystring=require(_0x9ab2('0xf'));var Papa=require(_0x9ab2('0x10'));var Redis=require(_0x9ab2('0x11'));var authService=require(_0x9ab2('0x12'));var qs=require(_0x9ab2('0x13'));var as=require(_0x9ab2('0x14'));var hardwareService=require(_0x9ab2('0x15'));var logger=require(_0x9ab2('0x16'))('api');var utils=require(_0x9ab2('0x17'));var config=require(_0x9ab2('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb6abfa,_0x1b23ae){_0x1b23ae=_0x1b23ae||0xcc;return function(_0x3ae1eb){if(_0x3ae1eb){return _0xb6abfa['sendStatus'](_0x1b23ae);}return _0xb6abfa[_0x9ab2('0x19')](_0x1b23ae)[_0x9ab2('0x1a')]();};}function respondWithResult(_0x55c9d6,_0x3a594f){_0x3a594f=_0x3a594f||0xc8;return function(_0x43debd){if(_0x43debd){return _0x55c9d6[_0x9ab2('0x19')](_0x3a594f)[_0x9ab2('0x1b')](_0x43debd);}};}function respondWithFilteredResult(_0x24f858,_0x117a33){return function(_0x9d89c6){if(_0x9d89c6){var _0x44e9d5=typeof _0x117a33['offset']===_0x9ab2('0x1c')&&typeof _0x117a33[_0x9ab2('0x1d')]===_0x9ab2('0x1c');var _0x2240dc=_0x9d89c6[_0x9ab2('0x1e')];var _0x87f705=_0x44e9d5?0x0:_0x117a33['offset'];var _0x53635c=_0x44e9d5?_0x9d89c6[_0x9ab2('0x1e')]:_0x117a33['offset']+_0x117a33[_0x9ab2('0x1d')];var _0xd0e052;if(_0x53635c>=_0x2240dc){_0x53635c=_0x2240dc;_0xd0e052=0xc8;}else{_0xd0e052=0xce;}_0x24f858['status'](_0xd0e052);return _0x24f858[_0x9ab2('0x1f')](_0x9ab2('0x20'),_0x87f705+'-'+_0x53635c+'/'+_0x2240dc)['json'](_0x9d89c6);}return null;};}function patchUpdates(_0x1226e4){return function(_0x1f286c){try{jsonpatch[_0x9ab2('0x21')](_0x1f286c,_0x1226e4,!![]);}catch(_0x987699){return BPromise[_0x9ab2('0x22')](_0x987699);}return _0x1f286c[_0x9ab2('0x23')]();};}function saveUpdates(_0x953106,_0x3a0733){return function(_0x1fa05b){if(_0x1fa05b){return _0x1fa05b[_0x9ab2('0x24')](_0x953106)[_0x9ab2('0x25')](function(_0x248cc6){return _0x248cc6;});}return null;};}function removeEntity(_0x3b7037,_0x5a0b32){return function(_0x37a1da){if(_0x37a1da){return _0x37a1da[_0x9ab2('0x26')]()[_0x9ab2('0x25')](function(){_0x3b7037['status'](0xcc)[_0x9ab2('0x1a')]();});}};}function handleEntityNotFound(_0x4486cc,_0x2f560d){return function(_0x357b7b){if(!_0x357b7b){_0x4486cc[_0x9ab2('0x27')](0x194);}return _0x357b7b;};}function handleError(_0x393223,_0x1c7142){_0x1c7142=_0x1c7142||0x1f4;return function(_0x2d9db7){logger[_0x9ab2('0x28')](_0x2d9db7['stack']);if(_0x2d9db7['name']){delete _0x2d9db7['name'];}_0x393223[_0x9ab2('0x19')](_0x1c7142)[_0x9ab2('0x29')](_0x2d9db7);};}exports[_0x9ab2('0x2a')]=function(_0x3f6662,_0x224390){var _0x2a01dc={'raw':!![],'where':{'id':_0x3f6662[_0x9ab2('0x2b')]['id']}},_0x134aed={};_0x134aed[_0x9ab2('0x2c')]=_[_0x9ab2('0x2d')](db['ChatProactiveAction'][_0x9ab2('0x2e')]);_0x134aed['query']=_[_0x9ab2('0x2d')](_0x3f6662[_0x9ab2('0x2f')]);_0x134aed['filters']=_[_0x9ab2('0x30')](_0x134aed['model'],_0x134aed[_0x9ab2('0x2f')]);_0x2a01dc[_0x9ab2('0x31')]=_[_0x9ab2('0x30')](_0x134aed[_0x9ab2('0x2c')],qs[_0x9ab2('0x32')](_0x3f6662[_0x9ab2('0x2f')][_0x9ab2('0x32')]));_0x2a01dc[_0x9ab2('0x31')]=_0x2a01dc[_0x9ab2('0x31')]['length']?_0x2a01dc['attributes']:_0x134aed[_0x9ab2('0x2c')];if(_0x3f6662[_0x9ab2('0x2f')][_0x9ab2('0x33')]){_0x2a01dc[_0x9ab2('0x34')]=[{'all':!![]}];}_0x2a01dc=_[_0x9ab2('0x35')]({},_0x2a01dc,_0x3f6662['options']);return db['ChatProactiveAction'][_0x9ab2('0x36')](_0x2a01dc)['then'](handleEntityNotFound(_0x224390,null))[_0x9ab2('0x25')](respondWithResult(_0x224390,null))[_0x9ab2('0x37')](handleError(_0x224390,null));};exports[_0x9ab2('0x38')]=function(_0x73d13a,_0x64b4c){return db[_0x9ab2('0x39')][_0x9ab2('0x38')](_0x73d13a[_0x9ab2('0x3a')],{})[_0x9ab2('0x25')](respondWithResult(_0x64b4c,0xc9))[_0x9ab2('0x37')](handleError(_0x64b4c,null));};exports[_0x9ab2('0x24')]=function(_0x397af8,_0x220d58){if(_0x397af8[_0x9ab2('0x3a')]['id']){delete _0x397af8[_0x9ab2('0x3a')]['id'];}return db['ChatProactiveAction'][_0x9ab2('0x36')]({'where':{'id':_0x397af8[_0x9ab2('0x2b')]['id']}})[_0x9ab2('0x25')](handleEntityNotFound(_0x220d58,null))[_0x9ab2('0x25')](saveUpdates(_0x397af8[_0x9ab2('0x3a')],null))[_0x9ab2('0x25')](respondWithResult(_0x220d58,null))[_0x9ab2('0x37')](handleError(_0x220d58,null));};exports['destroy']=function(_0x3df054,_0x4a273){return db['ChatProactiveAction'][_0x9ab2('0x36')]({'where':{'id':_0x3df054[_0x9ab2('0x2b')]['id']}})[_0x9ab2('0x25')](handleEntityNotFound(_0x4a273,null))[_0x9ab2('0x25')](removeEntity(_0x4a273,null))[_0x9ab2('0x37')](handleError(_0x4a273,null));}; \ No newline at end of file +var _0x9330=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','end','stack','name','show','params','model','keys','ChatProactiveAction','query','filters','intersection','attributes','fields','length','include','merge','find','catch','create','body','eml-format','fast-json-patch','bluebird','mustache','util','path'];(function(_0x3b8888,_0x536fe9){var _0x289891=function(_0x22bae2){while(--_0x22bae2){_0x3b8888['push'](_0x3b8888['shift']());}};_0x289891(++_0x536fe9);}(_0x9330,0x14a));var _0x0933=function(_0x218927,_0x3eb444){_0x218927=_0x218927-0x0;var _0x20bc64=_0x9330[_0x218927];return _0x20bc64;};'use strict';var emlformat=require(_0x0933('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0933('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0933('0x2'));var Mustache=require(_0x0933('0x3'));var util=require(_0x0933('0x4'));var path=require(_0x0933('0x5'));var sox=require(_0x0933('0x6'));var csv=require(_0x0933('0x7'));var ejs=require(_0x0933('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0933('0x9'));var squel=require(_0x0933('0xa'));var crypto=require(_0x0933('0xb'));var jsforce=require(_0x0933('0xc'));var deskjs=require(_0x0933('0xd'));var toCsv=require(_0x0933('0x7'));var querystring=require(_0x0933('0xe'));var Papa=require(_0x0933('0xf'));var Redis=require(_0x0933('0x10'));var authService=require(_0x0933('0x11'));var qs=require(_0x0933('0x12'));var as=require(_0x0933('0x13'));var hardwareService=require(_0x0933('0x14'));var logger=require(_0x0933('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0933('0x16'))['db'];function respondWithStatusCode(_0x4b5927,_0x51cdc6){_0x51cdc6=_0x51cdc6||0xcc;return function(_0x56febc){if(_0x56febc){return _0x4b5927[_0x0933('0x17')](_0x51cdc6);}return _0x4b5927[_0x0933('0x18')](_0x51cdc6)['end']();};}function respondWithResult(_0x2ec08f,_0x145954){_0x145954=_0x145954||0xc8;return function(_0x5cb5ba){if(_0x5cb5ba){return _0x2ec08f['status'](_0x145954)[_0x0933('0x19')](_0x5cb5ba);}};}function respondWithFilteredResult(_0xb019db,_0x52144e){return function(_0x14b507){if(_0x14b507){var _0x15672a=typeof _0x52144e[_0x0933('0x1a')]===_0x0933('0x1b')&&typeof _0x52144e[_0x0933('0x1c')]===_0x0933('0x1b');var _0x536799=_0x14b507['count'];var _0x1394dd=_0x15672a?0x0:_0x52144e[_0x0933('0x1a')];var _0x2a433e=_0x15672a?_0x14b507[_0x0933('0x1d')]:_0x52144e[_0x0933('0x1a')]+_0x52144e[_0x0933('0x1c')];var _0x1afd61;if(_0x2a433e>=_0x536799){_0x2a433e=_0x536799;_0x1afd61=0xc8;}else{_0x1afd61=0xce;}_0xb019db[_0x0933('0x18')](_0x1afd61);return _0xb019db[_0x0933('0x1e')]('Content-Range',_0x1394dd+'-'+_0x2a433e+'/'+_0x536799)['json'](_0x14b507);}return null;};}function patchUpdates(_0x30f857){return function(_0x5a5eae){try{jsonpatch[_0x0933('0x1f')](_0x5a5eae,_0x30f857,!![]);}catch(_0x220511){return BPromise['reject'](_0x220511);}return _0x5a5eae[_0x0933('0x20')]();};}function saveUpdates(_0x28e7fe,_0x427d39){return function(_0x5b46ca){if(_0x5b46ca){return _0x5b46ca[_0x0933('0x21')](_0x28e7fe)[_0x0933('0x22')](function(_0x4374bf){return _0x4374bf;});}return null;};}function removeEntity(_0x59d08c,_0x4ff665){return function(_0x631379){if(_0x631379){return _0x631379[_0x0933('0x23')]()[_0x0933('0x22')](function(){_0x59d08c[_0x0933('0x18')](0xcc)[_0x0933('0x24')]();});}};}function handleEntityNotFound(_0x541511,_0x1fc5be){return function(_0x95bee6){if(!_0x95bee6){_0x541511[_0x0933('0x17')](0x194);}return _0x95bee6;};}function handleError(_0x241b8d,_0x3ab616){_0x3ab616=_0x3ab616||0x1f4;return function(_0x23b187){logger['error'](_0x23b187[_0x0933('0x25')]);if(_0x23b187[_0x0933('0x26')]){delete _0x23b187[_0x0933('0x26')];}_0x241b8d[_0x0933('0x18')](_0x3ab616)['send'](_0x23b187);};}exports[_0x0933('0x27')]=function(_0x277553,_0x5bcb34){var _0x447310={'raw':!![],'where':{'id':_0x277553[_0x0933('0x28')]['id']}},_0x35d37d={};_0x35d37d[_0x0933('0x29')]=_[_0x0933('0x2a')](db[_0x0933('0x2b')]['rawAttributes']);_0x35d37d[_0x0933('0x2c')]=_[_0x0933('0x2a')](_0x277553[_0x0933('0x2c')]);_0x35d37d[_0x0933('0x2d')]=_[_0x0933('0x2e')](_0x35d37d['model'],_0x35d37d[_0x0933('0x2c')]);_0x447310[_0x0933('0x2f')]=_[_0x0933('0x2e')](_0x35d37d[_0x0933('0x29')],qs['fields'](_0x277553['query'][_0x0933('0x30')]));_0x447310[_0x0933('0x2f')]=_0x447310[_0x0933('0x2f')][_0x0933('0x31')]?_0x447310[_0x0933('0x2f')]:_0x35d37d['model'];if(_0x277553['query']['includeAll']){_0x447310[_0x0933('0x32')]=[{'all':!![]}];}_0x447310=_[_0x0933('0x33')]({},_0x447310,_0x277553['options']);return db[_0x0933('0x2b')][_0x0933('0x34')](_0x447310)[_0x0933('0x22')](handleEntityNotFound(_0x5bcb34,null))[_0x0933('0x22')](respondWithResult(_0x5bcb34,null))[_0x0933('0x35')](handleError(_0x5bcb34,null));};exports[_0x0933('0x36')]=function(_0x8a752e,_0x1625db){return db['ChatProactiveAction']['create'](_0x8a752e['body'],{})['then'](respondWithResult(_0x1625db,0xc9))[_0x0933('0x35')](handleError(_0x1625db,null));};exports[_0x0933('0x21')]=function(_0x306f49,_0x1a4c2f){if(_0x306f49[_0x0933('0x37')]['id']){delete _0x306f49[_0x0933('0x37')]['id'];}return db[_0x0933('0x2b')][_0x0933('0x34')]({'where':{'id':_0x306f49[_0x0933('0x28')]['id']}})[_0x0933('0x22')](handleEntityNotFound(_0x1a4c2f,null))[_0x0933('0x22')](saveUpdates(_0x306f49['body'],null))['then'](respondWithResult(_0x1a4c2f,null))[_0x0933('0x35')](handleError(_0x1a4c2f,null));};exports[_0x0933('0x23')]=function(_0xc3784b,_0x370696){return db[_0x0933('0x2b')][_0x0933('0x34')]({'where':{'id':_0xc3784b[_0x0933('0x28')]['id']}})[_0x0933('0x22')](handleEntityNotFound(_0x370696,null))['then'](removeEntity(_0x370696,null))[_0x0933('0x35')](handleError(_0x370696,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 819e7ae..1686383 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 _0x7793=['request-promise','path','../../config/environment','./chatProactiveAction.attributes','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3b9f98,_0x388ffe){var _0x126107=function(_0x335203){while(--_0x335203){_0x3b9f98['push'](_0x3b9f98['shift']());}};_0x126107(++_0x388ffe);}(_0x7793,0x89));var _0x3779=function(_0xe0b738,_0x332d6d){_0xe0b738=_0xe0b738-0x0;var _0x18a6f3=_0x7793[_0xe0b738];return _0x18a6f3;};'use strict';var _=require(_0x3779('0x0'));var util=require(_0x3779('0x1'));var logger=require(_0x3779('0x2'))(_0x3779('0x3'));var moment=require(_0x3779('0x4'));var BPromise=require(_0x3779('0x5'));var rp=require(_0x3779('0x6'));var fs=require('fs');var path=require(_0x3779('0x7'));var rimraf=require('rimraf');var config=require(_0x3779('0x8'));var attributes=require(_0x3779('0x9'));module['exports']=function(_0x122786,_0x58b857){return _0x122786[_0x3779('0xa')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x69ea=['util','api','moment','path','../../config/environment','./chatProactiveAction.attributes','exports','chat_proactive_actions','lodash'];(function(_0x4e1acf,_0x4b1669){var _0x139d96=function(_0x2b8485){while(--_0x2b8485){_0x4e1acf['push'](_0x4e1acf['shift']());}};_0x139d96(++_0x4b1669);}(_0x69ea,0xc5));var _0xa69e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x69ea[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xa69e('0x0'));var util=require(_0xa69e('0x1'));var logger=require('../../config/logger')(_0xa69e('0x2'));var moment=require(_0xa69e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa69e('0x4'));var rimraf=require('rimraf');var config=require(_0xa69e('0x5'));var attributes=require(_0xa69e('0x6'));module[_0xa69e('0x7')]=function(_0x4995e1,_0x1009ee){return _0x4995e1['define']('ChatProactiveAction',attributes,{'tableName':_0xa69e('0x8'),'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 3cfae76..30adaac 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 _0x16df=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x1b7b13,_0x5e87f5){var _0x45479c=function(_0x193804){while(--_0x193804){_0x1b7b13['push'](_0x1b7b13['shift']());}};_0x45479c(++_0x5e87f5);}(_0x16df,0x72));var _0xf16d=function(_0x44003a,_0x1f6953){_0x44003a=_0x44003a-0x0;var _0x2cedbc=_0x16df[_0x44003a];return _0x2cedbc;};'use strict';var _=require(_0xf16d('0x0'));var util=require(_0xf16d('0x1'));var moment=require(_0xf16d('0x2'));var BPromise=require(_0xf16d('0x3'));var rs=require(_0xf16d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf16d('0x5'))['db'];var utils=require(_0xf16d('0x6'));var logger=require(_0xf16d('0x7'))(_0xf16d('0x8'));var config=require(_0xf16d('0x9'));var jayson=require(_0xf16d('0xa'));var client=jayson['client'][_0xf16d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc6c5cb,_0x32b8df,_0x5aea71){return new BPromise(function(_0x1f2935,_0x3fb212){return client[_0xf16d('0xc')](_0xc6c5cb,_0x5aea71)[_0xf16d('0xd')](function(_0x31ef08){logger[_0xf16d('0xe')](_0xf16d('0xf'),_0x32b8df,_0xf16d('0x10'));logger[_0xf16d('0x11')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x32b8df,'request\x20sent',JSON[_0xf16d('0x12')](_0x31ef08));if(_0x31ef08[_0xf16d('0x13')]){if(_0x31ef08[_0xf16d('0x13')][_0xf16d('0x14')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x32b8df,_0x31ef08[_0xf16d('0x13')][_0xf16d('0x15')]);return _0x3fb212(_0x31ef08['error'][_0xf16d('0x15')]);}logger[_0xf16d('0x13')](_0xf16d('0xf'),_0x32b8df,_0x31ef08['error']['message']);return _0x1f2935(_0x31ef08[_0xf16d('0x13')]['message']);}else{logger['info'](_0xf16d('0xf'),_0x32b8df,_0xf16d('0x10'));_0x1f2935(_0x31ef08[_0xf16d('0x16')][_0xf16d('0x15')]);}})[_0xf16d('0x17')](function(_0x15c995){logger[_0xf16d('0x13')](_0xf16d('0xf'),_0x32b8df,_0x15c995);_0x3fb212(_0x15c995);});});} \ No newline at end of file +var _0x7e4b=['code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5da745,_0x5e54f2){var _0x4f0eda=function(_0x55635e){while(--_0x55635e){_0x5da745['push'](_0x5da745['shift']());}};_0x4f0eda(++_0x5e54f2);}(_0x7e4b,0x64));var _0xb7e4=function(_0x4cdc0f,_0x1d41da){_0x4cdc0f=_0x4cdc0f-0x0;var _0xae57ee=_0x7e4b[_0x4cdc0f];return _0xae57ee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb7e4('0x0'));var BPromise=require(_0xb7e4('0x1'));var rs=require(_0xb7e4('0x2'));var fs=require('fs');var Redis=require(_0xb7e4('0x3'));var db=require(_0xb7e4('0x4'))['db'];var utils=require(_0xb7e4('0x5'));var logger=require(_0xb7e4('0x6'))(_0xb7e4('0x7'));var config=require(_0xb7e4('0x8'));var jayson=require(_0xb7e4('0x9'));var client=jayson[_0xb7e4('0xa')][_0xb7e4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29715c,_0x511f0c,_0x256926){return new BPromise(function(_0x1f215c,_0xab55d2){return client['request'](_0x29715c,_0x256926)[_0xb7e4('0xc')](function(_0x17f54e){logger[_0xb7e4('0xd')](_0xb7e4('0xe'),_0x511f0c,_0xb7e4('0xf'));logger[_0xb7e4('0x10')](_0xb7e4('0x11'),_0x511f0c,_0xb7e4('0xf'),JSON[_0xb7e4('0x12')](_0x17f54e));if(_0x17f54e[_0xb7e4('0x13')]){if(_0x17f54e[_0xb7e4('0x13')][_0xb7e4('0x14')]===0x1f4){logger[_0xb7e4('0x13')](_0xb7e4('0xe'),_0x511f0c,_0x17f54e[_0xb7e4('0x13')]['message']);return _0xab55d2(_0x17f54e['error'][_0xb7e4('0x15')]);}logger['error'](_0xb7e4('0xe'),_0x511f0c,_0x17f54e[_0xb7e4('0x13')]['message']);return _0x1f215c(_0x17f54e['error'][_0xb7e4('0x15')]);}else{logger[_0xb7e4('0xd')](_0xb7e4('0xe'),_0x511f0c,_0xb7e4('0xf'));_0x1f215c(_0x17f54e[_0xb7e4('0x16')][_0xb7e4('0x15')]);}})[_0xb7e4('0x17')](function(_0x3fc8df){logger[_0xb7e4('0x13')](_0xb7e4('0xe'),_0x511f0c,_0x3fc8df);_0xab55d2(_0x3fc8df);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 6aefcc4..14ee73f 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 _0x6f47=['show','post','create','put','/:id','update','destroy','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','isAuthenticated'];(function(_0x10484a,_0x105add){var _0xb4fa45=function(_0x2a839f){while(--_0x2a839f){_0x10484a['push'](_0x10484a['shift']());}};_0xb4fa45(++_0x105add);}(_0x6f47,0xc7));var _0x76f4=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x6f47[_0x40220a];return _0x3903cc;};'use strict';var multer=require('multer');var util=require(_0x76f4('0x0'));var path=require(_0x76f4('0x1'));var timeout=require('connect-timeout');var express=require(_0x76f4('0x2'));var router=express['Router']();var fs_extra=require(_0x76f4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var controller=require(_0x76f4('0x6'));router[_0x76f4('0x7')]('/:id',auth[_0x76f4('0x8')](),controller[_0x76f4('0x9')]);router[_0x76f4('0xa')]('/',auth['isAuthenticated'](),controller[_0x76f4('0xb')]);router[_0x76f4('0xc')](_0x76f4('0xd'),auth[_0x76f4('0x8')](),controller[_0x76f4('0xe')]);router['delete']('/:id',auth[_0x76f4('0x8')](),controller[_0x76f4('0xf')]);module['exports']=router; \ No newline at end of file +var _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','create','put','update','delete','exports','multer','util'];(function(_0x102382,_0x28c7ec){var _0x2adc79=function(_0x3babb1){while(--_0x3babb1){_0x102382['push'](_0x102382['shift']());}};_0x2adc79(++_0x28c7ec);}(_0xf494,0x1c6));var _0x4f49=function(_0x31e549,_0x331ce8){_0x31e549=_0x31e549-0x0;var _0x1e8bb6=_0xf494[_0x31e549];return _0x1e8bb6;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4f49('0xe')]);router[_0x4f49('0xf')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0x10')]);router[_0x4f49('0x11')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller['destroy']);module[_0x4f49('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 65b14b9..b01439d 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 _0x10ca=['sequelize','exports','STRING','name','INTEGER','ENUM','beepall','roundrobin'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x10ca,0xd0));var _0xa10c=function(_0x3d7bfd,_0x44eaba){_0x3d7bfd=_0x3d7bfd-0x0;var _0x16c96c=_0x10ca[_0x3d7bfd];return _0x16c96c;};'use strict';var Sequelize=require(_0xa10c('0x0'));module[_0xa10c('0x1')]={'name':{'type':Sequelize[_0xa10c('0x2')],'unique':_0xa10c('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa10c('0x2')]},'timeout':{'type':Sequelize[_0xa10c('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa10c('0x5')]('rrmemory',_0xa10c('0x6'),_0xa10c('0x7'))}}; \ No newline at end of file +var _0x110f=['rrmemory','roundrobin','STRING','name','INTEGER','ENUM'];(function(_0x19f728,_0x557141){var _0x5e03bb=function(_0x5ecb5b){while(--_0x5ecb5b){_0x19f728['push'](_0x19f728['shift']());}};_0x5e03bb(++_0x557141);}(_0x110f,0x134));var _0xf110=function(_0x191fdb,_0x49b69b){_0x191fdb=_0x191fdb-0x0;var _0x3e3796=_0x110f[_0x191fdb];return _0x3e3796;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf110('0x0')],'unique':_0xf110('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf110('0x0')]},'timeout':{'type':Sequelize[_0xf110('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf110('0x3')](_0xf110('0x4'),'beepall',_0xf110('0x5'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 05fcf5b..2a5ab40 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 _0xb4b4=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','then','get','ChatQueues','UserProfileResource','destroy','end','stack','index','map','ChatQueue','rawAttributes','fieldName','key','query','model','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','type','filter','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','user','role','UserProfileSection','autoAssociation','name','update','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','ChatQueueId','merge','User','UserId','agent','chatPause','createdAt','format','SIP','updatedAt','getTeams','Team','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','removeTeams','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','forEach','emit','userChatQueue:remove','addAgents','ids','omit','spread','userChatQueue:save','isArray','getAgents','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xb4b4,0x88));var _0x4b4b=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xb4b4[_0x4fc9e6];return _0x551d28;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4b4b('0x0'));var jsonpatch=require(_0x4b4b('0x1'));var rp=require(_0x4b4b('0x2'));var moment=require(_0x4b4b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4b4b('0x4'));var path=require(_0x4b4b('0x5'));var sox=require(_0x4b4b('0x6'));var csv=require(_0x4b4b('0x7'));var ejs=require(_0x4b4b('0x8'));var fs=require('fs');var fs_extra=require(_0x4b4b('0x9'));var _=require(_0x4b4b('0xa'));var squel=require(_0x4b4b('0xb'));var crypto=require(_0x4b4b('0xc'));var jsforce=require(_0x4b4b('0xd'));var deskjs=require(_0x4b4b('0xe'));var toCsv=require(_0x4b4b('0x7'));var querystring=require(_0x4b4b('0xf'));var Papa=require(_0x4b4b('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4b4b('0x11'));var hardwareService=require(_0x4b4b('0x12'));var logger=require(_0x4b4b('0x13'))(_0x4b4b('0x14'));var utils=require(_0x4b4b('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4b4b('0x16'))['db'];config[_0x4b4b('0x17')]=_['defaults'](config[_0x4b4b('0x17')],{'host':_0x4b4b('0x18'),'port':0x18eb});var socket=require(_0x4b4b('0x19'))(new Redis(config[_0x4b4b('0x17')]));require(_0x4b4b('0x1a'))[_0x4b4b('0x1b')](socket);var jayson=require(_0x4b4b('0x1c'));var client=jayson['client'][_0x4b4b('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x38eb71,_0x31e484,_0x59f44c,_0x1a6c65){return new BPromise(function(_0x426679,_0x4aaa58){var _0x3aa119=_0x1a6c65||client;return _0x3aa119['request'](_0x38eb71,_0x59f44c)['then'](function(_0x40abae){logger[_0x4b4b('0x1e')](_0x4b4b('0x1f'),_0x31e484,_0x4b4b('0x20'));logger[_0x4b4b('0x21')](_0x4b4b('0x22'),_0x31e484,_0x4b4b('0x20'),JSON[_0x4b4b('0x23')](_0x40abae));if(_0x40abae[_0x4b4b('0x24')]){if(_0x40abae['error'][_0x4b4b('0x25')]===0x1f4){logger[_0x4b4b('0x24')](_0x4b4b('0x1f'),_0x31e484,_0x40abae[_0x4b4b('0x24')]['message']);return _0x4aaa58(_0x40abae[_0x4b4b('0x24')][_0x4b4b('0x26')]);}logger[_0x4b4b('0x24')](_0x4b4b('0x1f'),_0x31e484,_0x40abae[_0x4b4b('0x24')][_0x4b4b('0x26')]);return _0x426679(_0x40abae[_0x4b4b('0x24')]['message']);}else{logger[_0x4b4b('0x1e')](_0x4b4b('0x1f'),_0x31e484,'request\x20sent');_0x426679(_0x40abae[_0x4b4b('0x27')][_0x4b4b('0x26')]);}})['catch'](function(_0x3f84f7){logger['error'](_0x4b4b('0x1f'),_0x31e484,_0x3f84f7);_0x4aaa58(_0x3f84f7);});});}function respondWithStatusCode(_0x4efcb6,_0x249de3){_0x249de3=_0x249de3||0xcc;return function(_0x1f8993){if(_0x1f8993){return _0x4efcb6[_0x4b4b('0x28')](_0x249de3);}return _0x4efcb6[_0x4b4b('0x29')](_0x249de3)['end']();};}function respondWithResult(_0x106e77,_0x53ac35){_0x53ac35=_0x53ac35||0xc8;return function(_0x702727){if(_0x702727){return _0x106e77['status'](_0x53ac35)[_0x4b4b('0x2a')](_0x702727);}};}function respondWithFilteredResult(_0xd6c08e,_0x5d777d){return function(_0x1068c6){if(_0x1068c6){var _0x46c934=typeof _0x5d777d[_0x4b4b('0x2b')]===_0x4b4b('0x2c')&&typeof _0x5d777d[_0x4b4b('0x2d')]===_0x4b4b('0x2c');var _0x26af9a=_0x1068c6[_0x4b4b('0x2e')];var _0x58b6b2=_0x46c934?0x0:_0x5d777d['offset'];var _0x52656d=_0x46c934?_0x1068c6[_0x4b4b('0x2e')]:_0x5d777d['offset']+_0x5d777d['limit'];var _0x2a8f57;if(_0x52656d>=_0x26af9a){_0x52656d=_0x26af9a;_0x2a8f57=0xc8;}else{_0x2a8f57=0xce;}_0xd6c08e[_0x4b4b('0x29')](_0x2a8f57);return _0xd6c08e[_0x4b4b('0x2f')]('Content-Range',_0x58b6b2+'-'+_0x52656d+'/'+_0x26af9a)[_0x4b4b('0x2a')](_0x1068c6);}return null;};}function patchUpdates(_0x12a847){return function(_0x1f439b){try{jsonpatch[_0x4b4b('0x30')](_0x1f439b,_0x12a847,!![]);}catch(_0x5e9e73){return BPromise[_0x4b4b('0x31')](_0x5e9e73);}return _0x1f439b[_0x4b4b('0x32')]();};}function saveUpdates(_0x355ee7,_0x35f944){return function(_0x15191d){if(_0x15191d){return _0x15191d['update'](_0x355ee7)[_0x4b4b('0x33')](function(_0x2337c2){return _0x2337c2;});}return null;};}function removeEntity(_0x521cd0,_0x10b21a){return function(_0x6d28cc){if(_0x6d28cc){return _0x6d28cc['destroy']()[_0x4b4b('0x33')](function(){var _0x5d8377=_0x6d28cc[_0x4b4b('0x34')]({'plain':!![]});var _0x581b17=_0x4b4b('0x35');return db[_0x4b4b('0x36')][_0x4b4b('0x37')]({'where':{'type':_0x581b17,'resourceId':_0x5d8377['id']}})[_0x4b4b('0x33')](function(){return _0x6d28cc;});})[_0x4b4b('0x33')](function(){_0x521cd0[_0x4b4b('0x29')](0xcc)[_0x4b4b('0x38')]();});}};}function handleEntityNotFound(_0x4fae5e,_0x3dc4da){return function(_0x22e017){if(!_0x22e017){_0x4fae5e[_0x4b4b('0x28')](0x194);}return _0x22e017;};}function handleError(_0x549aa8,_0x487304){_0x487304=_0x487304||0x1f4;return function(_0x455d5d){logger['error'](_0x455d5d[_0x4b4b('0x39')]);if(_0x455d5d['name']){delete _0x455d5d['name'];}_0x549aa8[_0x4b4b('0x29')](_0x487304)['send'](_0x455d5d);};}exports[_0x4b4b('0x3a')]=function(_0x57a94c,_0x5b19e8){var _0x366432={},_0x17e4a4={},_0x442402={'count':0x0,'rows':[]};var _0x448b2e=_[_0x4b4b('0x3b')](db[_0x4b4b('0x3c')][_0x4b4b('0x3d')],function(_0x46c5d2){return{'name':_0x46c5d2[_0x4b4b('0x3e')],'type':_0x46c5d2['type'][_0x4b4b('0x3f')]};});_0x17e4a4['model']=_['map'](_0x448b2e,'name');_0x17e4a4[_0x4b4b('0x40')]=_['keys'](_0x57a94c[_0x4b4b('0x40')]);_0x17e4a4['filters']=_['intersection'](_0x17e4a4[_0x4b4b('0x41')],_0x17e4a4['query']);_0x366432[_0x4b4b('0x42')]=_[_0x4b4b('0x43')](_0x17e4a4[_0x4b4b('0x41')],qs['fields'](_0x57a94c['query'][_0x4b4b('0x44')]));_0x366432['attributes']=_0x366432['attributes'][_0x4b4b('0x45')]?_0x366432[_0x4b4b('0x42')]:_0x17e4a4['model'];if(!_0x57a94c['query']['hasOwnProperty'](_0x4b4b('0x46'))){_0x366432[_0x4b4b('0x2d')]=qs[_0x4b4b('0x2d')](_0x57a94c[_0x4b4b('0x40')]['limit']);_0x366432[_0x4b4b('0x2b')]=qs[_0x4b4b('0x2b')](_0x57a94c[_0x4b4b('0x40')][_0x4b4b('0x2b')]);}_0x366432[_0x4b4b('0x47')]=qs[_0x4b4b('0x48')](_0x57a94c[_0x4b4b('0x40')][_0x4b4b('0x48')]);_0x366432[_0x4b4b('0x49')]=qs[_0x4b4b('0x4a')](_[_0x4b4b('0x4b')](_0x57a94c['query'],_0x17e4a4[_0x4b4b('0x4a')]),_0x448b2e);if(_0x57a94c[_0x4b4b('0x40')]['filter']){_0x366432[_0x4b4b('0x49')]=_['merge'](_0x366432[_0x4b4b('0x49')],{'$or':_[_0x4b4b('0x3b')](_0x448b2e,function(_0x2a5f50){if(_0x2a5f50[_0x4b4b('0x4c')]!=='VIRTUAL'){var _0x5591c7={};_0x5591c7[_0x2a5f50['name']]={'$like':'%'+_0x57a94c['query'][_0x4b4b('0x4d')]+'%'};return _0x5591c7;}})});}_0x366432=_['merge']({},_0x366432,_0x57a94c[_0x4b4b('0x4e')]);var _0x1b858a={'where':_0x366432[_0x4b4b('0x49')]};return db[_0x4b4b('0x3c')]['count'](_0x1b858a)[_0x4b4b('0x33')](function(_0x44dab8){_0x442402[_0x4b4b('0x2e')]=_0x44dab8;if(_0x57a94c['query']['includeAll']){_0x366432[_0x4b4b('0x4f')]=[{'all':!![]}];}return db[_0x4b4b('0x3c')][_0x4b4b('0x50')](_0x366432);})[_0x4b4b('0x33')](function(_0x4bb39d){_0x442402[_0x4b4b('0x51')]=_0x4bb39d;return _0x442402;})[_0x4b4b('0x33')](respondWithFilteredResult(_0x5b19e8,_0x366432))[_0x4b4b('0x52')](handleError(_0x5b19e8,null));};exports[_0x4b4b('0x53')]=function(_0x317f1e,_0xe88f2){var _0x32de1f={'raw':!![],'where':{'id':_0x317f1e[_0x4b4b('0x54')]['id']}},_0x24c711={};_0x24c711[_0x4b4b('0x41')]=_[_0x4b4b('0x55')](db[_0x4b4b('0x3c')][_0x4b4b('0x3d')]);_0x24c711[_0x4b4b('0x40')]=_[_0x4b4b('0x55')](_0x317f1e[_0x4b4b('0x40')]);_0x24c711['filters']=_['intersection'](_0x24c711[_0x4b4b('0x41')],_0x24c711[_0x4b4b('0x40')]);_0x32de1f[_0x4b4b('0x42')]=_[_0x4b4b('0x43')](_0x24c711[_0x4b4b('0x41')],qs[_0x4b4b('0x44')](_0x317f1e[_0x4b4b('0x40')]['fields']));_0x32de1f[_0x4b4b('0x42')]=_0x32de1f[_0x4b4b('0x42')]['length']?_0x32de1f['attributes']:_0x24c711[_0x4b4b('0x41')];if(_0x317f1e[_0x4b4b('0x40')][_0x4b4b('0x56')]){_0x32de1f['include']=[{'all':!![]}];}_0x32de1f=_['merge']({},_0x32de1f,_0x317f1e[_0x4b4b('0x4e')]);return db['ChatQueue'][_0x4b4b('0x57')](_0x32de1f)[_0x4b4b('0x33')](handleEntityNotFound(_0xe88f2,null))[_0x4b4b('0x33')](respondWithResult(_0xe88f2,null))[_0x4b4b('0x52')](handleError(_0xe88f2,null));};exports[_0x4b4b('0x58')]=function(_0x3eeae3,_0x2d0b5f){return db['ChatQueue'][_0x4b4b('0x58')](_0x3eeae3[_0x4b4b('0x59')],{})['then'](function(_0x3fcbd1){var _0x2b6856=_0x3eeae3[_0x4b4b('0x5a')][_0x4b4b('0x34')]({'plain':!![]});if(!_0x2b6856)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b6856[_0x4b4b('0x5b')]===_0x4b4b('0x5a')){var _0x5bf721=_0x3fcbd1[_0x4b4b('0x34')]({'plain':!![]});var _0x3aabc8=_0x4b4b('0x35');return db[_0x4b4b('0x5c')][_0x4b4b('0x57')]({'where':{'name':_0x3aabc8,'userProfileId':_0x2b6856['userProfileId']},'raw':!![]})['then'](function(_0x55d3f4){if(_0x55d3f4&&_0x55d3f4[_0x4b4b('0x5d')]===0x0){return db[_0x4b4b('0x36')][_0x4b4b('0x58')]({'name':_0x5bf721[_0x4b4b('0x5e')],'resourceId':_0x5bf721['id'],'type':_0x55d3f4['name'],'sectionId':_0x55d3f4['id']},{})[_0x4b4b('0x33')](function(){return _0x3fcbd1;});}else{return _0x3fcbd1;}})['catch'](function(_0x5c7594){logger[_0x4b4b('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c7594);throw _0x5c7594;});}return _0x3fcbd1;})[_0x4b4b('0x33')](respondWithResult(_0x2d0b5f,0xc9))[_0x4b4b('0x52')](handleError(_0x2d0b5f,null));};exports[_0x4b4b('0x5f')]=function(_0x2659cd,_0x18297d){if(_0x2659cd['body']['id']){delete _0x2659cd[_0x4b4b('0x59')]['id'];}return db[_0x4b4b('0x3c')][_0x4b4b('0x57')]({'where':{'id':_0x2659cd[_0x4b4b('0x54')]['id']}})['then'](handleEntityNotFound(_0x18297d,null))[_0x4b4b('0x33')](saveUpdates(_0x2659cd[_0x4b4b('0x59')],null))[_0x4b4b('0x33')](respondWithResult(_0x18297d,null))[_0x4b4b('0x52')](handleError(_0x18297d,null));};exports[_0x4b4b('0x37')]=function(_0xca3be2,_0x154c5d){return db[_0x4b4b('0x3c')]['find']({'where':{'id':_0xca3be2[_0x4b4b('0x54')]['id']}})[_0x4b4b('0x33')](handleEntityNotFound(_0x154c5d,null))[_0x4b4b('0x33')](removeEntity(_0x154c5d,null))[_0x4b4b('0x52')](handleError(_0x154c5d,null));};exports[_0x4b4b('0x60')]=function(_0x43873b,_0x91faf6){return db[_0x4b4b('0x3c')][_0x4b4b('0x60')]()[_0x4b4b('0x33')](respondWithResult(_0x91faf6,null))[_0x4b4b('0x52')](handleError(_0x91faf6,null));};exports[_0x4b4b('0x61')]=function(_0x273e49,_0x4908ad,_0x440292){var _0x349444={'raw':!![],'where':{}},_0x1b8bc6={},_0x57c3b6;return db[_0x4b4b('0x3c')][_0x4b4b('0x62')]({'where':{'id':_0x273e49[_0x4b4b('0x54')]['id']}})[_0x4b4b('0x33')](handleEntityNotFound(_0x4908ad,null))[_0x4b4b('0x33')](function(_0x568d65){if(_0x568d65){_0x57c3b6=_0x568d65[_0x4b4b('0x34')]({'plain':!![]});_0x1b8bc6['model']=_[_0x4b4b('0x55')](db[_0x4b4b('0x63')]['rawAttributes']);_0x1b8bc6['query']=_[_0x4b4b('0x55')](_0x273e49[_0x4b4b('0x40')]);_0x1b8bc6['filters']=_[_0x4b4b('0x43')](_0x1b8bc6[_0x4b4b('0x41')],_0x1b8bc6[_0x4b4b('0x40')]);_0x349444[_0x4b4b('0x42')]=_[_0x4b4b('0x43')](_0x1b8bc6['model'],qs[_0x4b4b('0x44')](_0x273e49[_0x4b4b('0x40')][_0x4b4b('0x44')]));_0x349444['attributes']=_0x349444[_0x4b4b('0x42')][_0x4b4b('0x45')]?_0x349444[_0x4b4b('0x42')]:_0x1b8bc6['model'];if(!_0x273e49[_0x4b4b('0x40')][_0x4b4b('0x64')](_0x4b4b('0x46'))){_0x349444[_0x4b4b('0x2d')]=qs[_0x4b4b('0x2d')](_0x273e49[_0x4b4b('0x40')][_0x4b4b('0x2d')]);_0x349444[_0x4b4b('0x2b')]=qs[_0x4b4b('0x2b')](_0x273e49[_0x4b4b('0x40')]['offset']);}_0x349444[_0x4b4b('0x47')]=qs[_0x4b4b('0x48')](_0x273e49['query'][_0x4b4b('0x48')]);_0x349444['where']=qs[_0x4b4b('0x4a')](_[_0x4b4b('0x4b')](_0x273e49[_0x4b4b('0x40')],_0x1b8bc6[_0x4b4b('0x4a')]));_0x349444['where'][_0x4b4b('0x65')]=_0x568d65['id'];if(_0x273e49[_0x4b4b('0x40')]['filter']){_0x349444[_0x4b4b('0x49')]=_['merge'](_0x349444['where'],{'$or':_[_0x4b4b('0x3b')](_0x349444['attributes'],function(_0x51491e){var _0x44f66c={};_0x44f66c[_0x51491e]={'$like':'%'+_0x273e49[_0x4b4b('0x40')][_0x4b4b('0x4d')]+'%'};return _0x44f66c;})});}_0x349444=_[_0x4b4b('0x66')]({},_0x349444,_0x273e49[_0x4b4b('0x4e')]);return db[_0x4b4b('0x63')]['findAll'](_0x349444);}})[_0x4b4b('0x33')](function(_0x19ab6a){if(_0x19ab6a){return db[_0x4b4b('0x67')]['findAndCountAll']({'where':{'id':_[_0x4b4b('0x3b')](_0x19ab6a,_0x4b4b('0x68')),'role':_0x4b4b('0x69')},'attributes':['id',_0x4b4b('0x5e'),_0x4b4b('0x6a'),'updatedAt',_0x4b4b('0x6b')]});}})[_0x4b4b('0x33')](function(_0x41a000){if(_0x41a000){return{'count':_0x41a000[_0x4b4b('0x2e')],'rows':_[_0x4b4b('0x3b')](_0x41a000[_0x4b4b('0x51')],function(_0x56244c){return{'membername':_0x56244c[_0x4b4b('0x5e')],'UserId':_0x56244c['id'],'queue_name':_0x57c3b6[_0x4b4b('0x5e')],'ChatQueueId':_0x57c3b6['id'],'interface':util[_0x4b4b('0x6c')]('%s/%s',_0x4b4b('0x6d'),_0x56244c['name']),'penalty':0x0,'paused':_0x56244c[_0x4b4b('0x6a')],'createdAt':_0x56244c[_0x4b4b('0x6b')],'updatedAt':_0x56244c[_0x4b4b('0x6e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4908ad,_0x349444))[_0x4b4b('0x52')](handleError(_0x4908ad,null));};exports['getTeams']=function(_0x54b856,_0x3d0e42,_0x15dc79){var _0x542e26={};var _0xaba8d1={};var _0x3e7430;var _0x26dd79;return db[_0x4b4b('0x3c')][_0x4b4b('0x62')]({'where':{'id':_0x54b856[_0x4b4b('0x54')]['id']}})[_0x4b4b('0x33')](handleEntityNotFound(_0x3d0e42,null))[_0x4b4b('0x33')](function(_0x4ba711){if(_0x4ba711){_0x3e7430=_0x4ba711;_0xaba8d1[_0x4b4b('0x41')]=_[_0x4b4b('0x55')](db['Team'][_0x4b4b('0x3d')]);_0xaba8d1['query']=_[_0x4b4b('0x55')](_0x54b856[_0x4b4b('0x40')]);_0xaba8d1['filters']=_[_0x4b4b('0x43')](_0xaba8d1[_0x4b4b('0x41')],_0xaba8d1[_0x4b4b('0x40')]);_0x542e26[_0x4b4b('0x42')]=_[_0x4b4b('0x43')](_0xaba8d1[_0x4b4b('0x41')],qs['fields'](_0x54b856[_0x4b4b('0x40')][_0x4b4b('0x44')]));_0x542e26['attributes']=_0x542e26[_0x4b4b('0x42')][_0x4b4b('0x45')]?_0x542e26['attributes']:_0xaba8d1[_0x4b4b('0x41')];_0x542e26[_0x4b4b('0x47')]=qs[_0x4b4b('0x48')](_0x54b856[_0x4b4b('0x40')][_0x4b4b('0x48')]);_0x542e26['where']=qs[_0x4b4b('0x4a')](_['pick'](_0x54b856[_0x4b4b('0x40')],_0xaba8d1['filters']));if(_0x54b856['query'][_0x4b4b('0x4d')]){_0x542e26['where']=_[_0x4b4b('0x66')](_0x542e26['where'],{'$or':_[_0x4b4b('0x3b')](_0x542e26[_0x4b4b('0x42')],function(_0x4e80a1){var _0x3e101b={};_0x3e101b[_0x4e80a1]={'$like':'%'+_0x54b856[_0x4b4b('0x40')]['filter']+'%'};return _0x3e101b;})});}_0x542e26=_[_0x4b4b('0x66')]({},_0x542e26,_0x54b856[_0x4b4b('0x4e')]);return _0x3e7430['getTeams'](_0x542e26);}})[_0x4b4b('0x33')](function(_0xcb3cc8){if(_0xcb3cc8){_0x26dd79=_0xcb3cc8[_0x4b4b('0x45')];if(!_0x54b856['query'][_0x4b4b('0x64')](_0x4b4b('0x46'))){_0x542e26['limit']=qs['limit'](_0x54b856['query'][_0x4b4b('0x2d')]);_0x542e26[_0x4b4b('0x2b')]=qs[_0x4b4b('0x2b')](_0x54b856[_0x4b4b('0x40')][_0x4b4b('0x2b')]);}return _0x3e7430[_0x4b4b('0x6f')](_0x542e26);}})[_0x4b4b('0x33')](function(_0x2ece74){if(_0x2ece74){return _0x2ece74?{'count':_0x26dd79,'rows':_0x2ece74}:null;}})['then'](respondWithResult(_0x3d0e42,null))[_0x4b4b('0x52')](handleError(_0x3d0e42,null));};exports['addTeams']=function(_0x2b1c84,_0x5ae105,_0x49834a){var _0x58562b=_0x2b1c84[_0x4b4b('0x59')]['ids'];return db[_0x4b4b('0x70')][_0x4b4b('0x50')]({'where':{'id':_0x58562b},'attributes':['id'],'include':[{'model':db[_0x4b4b('0x67')],'as':_0x4b4b('0x71'),'attributes':['id',_0x4b4b('0x5e'),_0x4b4b('0x72'),_0x4b4b('0x73'),_0x4b4b('0x74')],'raw':!![]}]})[_0x4b4b('0x33')](function(_0x4bc828){if(_0x4bc828){var _0xd048ee=_[_0x4b4b('0x75')](_0x4bc828,function(_0x4c7acd){var _0x3bfe75=_0x4c7acd[_0x4b4b('0x34')]({'plain':!![]});return _0x3bfe75[_0x4b4b('0x71')];});return db[_0x4b4b('0x3c')][_0x4b4b('0x57')]({'where':{'id':_0x2b1c84[_0x4b4b('0x54')]['id']}})[_0x4b4b('0x33')](function(_0x45b422){return db['sequelize'][_0x4b4b('0x76')](function(_0x57b882){return _0x45b422['addTeams'](_0x58562b,{'transaction':_0x57b882})[_0x4b4b('0x33')](function(){return BPromise[_0x4b4b('0x77')](_0xd048ee,function(_0x1e321b){return db[_0x4b4b('0x63')][_0x4b4b('0x78')]({'where':{'UserId':_0x1e321b['id'],'ChatQueueId':_0x2b1c84[_0x4b4b('0x54')]['id']},'transaction':_0x57b882});});})[_0x4b4b('0x33')](function(){_0xd048ee['forEach'](function(_0x163b78){socket['emit']('userChatQueue:save',{'UserId':_0x163b78['id'],'ChatQueueId':_0x45b422['id']});});});});});}})[_0x4b4b('0x33')](respondWithStatusCode(_0x5ae105,null))[_0x4b4b('0x52')](handleError(_0x5ae105,null));};exports[_0x4b4b('0x79')]=function(_0x487e81,_0x45822c,_0x4c15c8){return db[_0x4b4b('0x70')][_0x4b4b('0x50')]({'where':{'id':_0x487e81[_0x4b4b('0x40')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x4b4b('0x33')](handleEntityNotFound(_0x45822c,null))[_0x4b4b('0x33')](function(_0x23b711){var _0x4ac602=_[_0x4b4b('0x3b')](_0x23b711,'id');var _0x68546b=[];var _0x4453f2=[];var _0x346a84=squel['select']();_0x346a84[_0x4b4b('0x7a')](_0x4b4b('0x7b'))[_0x4b4b('0x7c')](_0x4b4b('0x7d'),'tq')[_0x4b4b('0x7e')](_0x4b4b('0x7f'),'ut',_0x4b4b('0x80'))[_0x4b4b('0x49')](_0x4b4b('0x81'),_0x487e81[_0x4b4b('0x54')]['id']);for(var _0x290598=0x0;_0x290598<_0x23b711[_0x4b4b('0x45')];_0x290598+=0x1){let _0x4d2fc4=_0x23b711[_0x290598];for(var _0x107b3d=0x0;_0x107b3d<_0x4d2fc4['Agents']['length'];_0x107b3d+=0x1){let _0x3cd7ac=_0x4d2fc4[_0x4b4b('0x71')][_0x107b3d];var _0x9de4dc=_0x346a84[_0x4b4b('0x82')]();_0x9de4dc[_0x4b4b('0x49')]('ut.UserId\x20=\x20?',_0x3cd7ac['id']);_0x4453f2[_0x4b4b('0x83')](db[_0x4b4b('0x84')][_0x4b4b('0x40')](_0x9de4dc[_0x4b4b('0x85')](),{'type':db[_0x4b4b('0x84')][_0x4b4b('0x86')][_0x4b4b('0x87')]})[_0x4b4b('0x33')](function(_0x46c4df){if(_0x46c4df[_0x4b4b('0x45')]===0x1){return _0x3cd7ac['id'];}else{var _0x2eb0ed=_[_0x4b4b('0x88')](_[_0x4b4b('0x3b')](_0x46c4df,_0x4b4b('0x89')),function(_0x27b616){return _[_0x4b4b('0x8a')](_0x4ac602,_0x27b616);});if(_0x2eb0ed){return _0x3cd7ac['id'];}}}));}}return BPromise[_0x4b4b('0x8b')](_0x4453f2)['then'](function(_0x4a6a2a){_0x68546b=_(_0x68546b)[_0x4b4b('0x8c')](_0x4a6a2a)['compact']()[_0x4b4b('0x8d')]();return db['ChatQueue'][_0x4b4b('0x57')]({'where':{'id':_0x487e81['params']['id']}})['then'](function(_0x576ad3){return db[_0x4b4b('0x84')][_0x4b4b('0x76')](function(_0x3d2665){return _0x576ad3['removeTeams'](_0x487e81[_0x4b4b('0x40')]['ids'],{'transaction':_0x3d2665})[_0x4b4b('0x33')](function(){if(!_[_0x4b4b('0x8e')](_0x68546b)){return _0x576ad3[_0x4b4b('0x8f')](_0x68546b,{'transaction':_0x3d2665});}})['then'](function(){_0x68546b[_0x4b4b('0x90')](function(_0x259d64){socket[_0x4b4b('0x91')](_0x4b4b('0x92'),{'UserId':_0x259d64,'ChatQueueId':_0x576ad3['id']});});});});});});})[_0x4b4b('0x33')](respondWithStatusCode(_0x45822c,null))['catch'](handleError(_0x45822c,null));};exports[_0x4b4b('0x93')]=function(_0x1bdef1,_0x3ba898,_0x5a8ac){return db[_0x4b4b('0x3c')]['find']({'where':{'id':_0x1bdef1[_0x4b4b('0x54')]['id']}})[_0x4b4b('0x33')](handleEntityNotFound(_0x3ba898,null))[_0x4b4b('0x33')](function(_0x410b70){if(_0x410b70){return _0x410b70[_0x4b4b('0x93')](_0x1bdef1[_0x4b4b('0x59')][_0x4b4b('0x94')],_[_0x4b4b('0x95')](_0x1bdef1[_0x4b4b('0x59')],[_0x4b4b('0x94'),'id'])||{})[_0x4b4b('0x96')](function(_0x1244cb){for(var _0x464b67=0x0;_0x464b67<_0x1bdef1[_0x4b4b('0x59')][_0x4b4b('0x94')][_0x4b4b('0x45')];_0x464b67+=0x1){socket[_0x4b4b('0x91')](_0x4b4b('0x97'),{'UserId':Number(_0x1bdef1['body']['ids'][_0x464b67]),'ChatQueueId':Number(_0x1bdef1['params']['id'])});}return _0x1244cb;});}})[_0x4b4b('0x33')](respondWithResult(_0x3ba898,null))[_0x4b4b('0x52')](handleError(_0x3ba898,null));};exports[_0x4b4b('0x8f')]=function(_0x595d7f,_0x2a5655,_0x193b52){return db['ChatQueue']['find']({'where':{'id':_0x595d7f[_0x4b4b('0x54')]['id']}})['then'](handleEntityNotFound(_0x2a5655,null))[_0x4b4b('0x33')](function(_0x1ebf92){if(_0x1ebf92){return _0x1ebf92[_0x4b4b('0x8f')](_0x595d7f[_0x4b4b('0x40')][_0x4b4b('0x94')])[_0x4b4b('0x33')](function(){if(_[_0x4b4b('0x98')](_0x595d7f[_0x4b4b('0x40')][_0x4b4b('0x94')])){for(var _0x163d4b=0x0;_0x163d4b<_0x595d7f[_0x4b4b('0x40')]['ids'][_0x4b4b('0x45')];_0x163d4b+=0x1){socket[_0x4b4b('0x91')](_0x4b4b('0x92'),{'UserId':Number(_0x595d7f['query'][_0x4b4b('0x94')][_0x163d4b]),'ChatQueueId':Number(_0x595d7f[_0x4b4b('0x54')]['id'])});}}else{socket[_0x4b4b('0x91')](_0x4b4b('0x92'),{'UserId':Number(_0x595d7f['query'][_0x4b4b('0x94')]),'ChatQueueId':Number(_0x595d7f[_0x4b4b('0x54')]['id'])});}});}})[_0x4b4b('0x33')](respondWithStatusCode(_0x2a5655,null))[_0x4b4b('0x52')](handleError(_0x2a5655,null));};exports[_0x4b4b('0x99')]=function(_0x4a8748,_0x52eb56,_0x455134){var _0x45d9f2={};var _0x31f2c8={};var _0x554d07;var _0x49d4e4;return db[_0x4b4b('0x3c')][_0x4b4b('0x62')]({'where':{'id':_0x4a8748[_0x4b4b('0x54')]['id']}})['then'](handleEntityNotFound(_0x52eb56,null))[_0x4b4b('0x33')](function(_0x14a7f7){if(_0x14a7f7){_0x554d07=_0x14a7f7;_0x31f2c8[_0x4b4b('0x41')]=_[_0x4b4b('0x55')](db[_0x4b4b('0x67')]['rawAttributes']);_0x31f2c8[_0x4b4b('0x40')]=_[_0x4b4b('0x55')](_0x4a8748[_0x4b4b('0x40')]);_0x31f2c8[_0x4b4b('0x4a')]=_[_0x4b4b('0x43')](_0x31f2c8['model'],_0x31f2c8[_0x4b4b('0x40')]);_0x45d9f2['attributes']=_[_0x4b4b('0x43')](_0x31f2c8[_0x4b4b('0x41')],qs[_0x4b4b('0x44')](_0x4a8748[_0x4b4b('0x40')]['fields']));_0x45d9f2[_0x4b4b('0x42')]=_0x45d9f2['attributes'][_0x4b4b('0x45')]?_0x45d9f2[_0x4b4b('0x42')]:_0x31f2c8[_0x4b4b('0x41')];_0x45d9f2['order']=qs[_0x4b4b('0x48')](_0x4a8748[_0x4b4b('0x40')][_0x4b4b('0x48')]);_0x45d9f2[_0x4b4b('0x49')]=qs[_0x4b4b('0x4a')](_[_0x4b4b('0x4b')](_0x4a8748[_0x4b4b('0x40')],_0x31f2c8[_0x4b4b('0x4a')]));if(_0x4a8748['query'][_0x4b4b('0x4d')]){_0x45d9f2[_0x4b4b('0x49')]=_[_0x4b4b('0x66')](_0x45d9f2[_0x4b4b('0x49')],{'$or':_[_0x4b4b('0x3b')](_0x45d9f2[_0x4b4b('0x42')],function(_0x2b8d86){var _0x2f232c={};_0x2f232c[_0x2b8d86]={'$like':'%'+_0x4a8748[_0x4b4b('0x40')]['filter']+'%'};return _0x2f232c;})});}_0x45d9f2=_[_0x4b4b('0x66')]({},_0x45d9f2,_0x4a8748['options']);return _0x554d07[_0x4b4b('0x99')](_0x45d9f2);}})[_0x4b4b('0x33')](function(_0x4f6cc9){if(_0x4f6cc9){_0x49d4e4=_0x4f6cc9[_0x4b4b('0x45')];if(!_0x4a8748[_0x4b4b('0x40')][_0x4b4b('0x64')]('nolimit')){_0x45d9f2[_0x4b4b('0x2d')]=qs[_0x4b4b('0x2d')](_0x4a8748[_0x4b4b('0x40')][_0x4b4b('0x2d')]);_0x45d9f2[_0x4b4b('0x2b')]=qs[_0x4b4b('0x2b')](_0x4a8748[_0x4b4b('0x40')][_0x4b4b('0x2b')]);}return _0x554d07['getAgents'](_0x45d9f2);}})['then'](function(_0x4bd55d){if(_0x4bd55d){return _0x4bd55d?{'count':_0x49d4e4,'rows':_0x4bd55d}:null;}})[_0x4b4b('0x33')](respondWithResult(_0x52eb56,null))[_0x4b4b('0x52')](handleError(_0x52eb56,null));}; \ No newline at end of file +var _0x428f=['where','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','length','find','create','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserChatQueue','ChatQueueId','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','params','addTeams','Team','online','voicePause','flatMap','sequelize','each','findOrCreate','forEach','userChatQueue:save','ids','User','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','Agents','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','all','union','compact','transaction','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','request-promise','moment','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','client','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ChatQueues','UserProfileResource','end','stack','name','send','map','ChatQueue','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x56ff21,_0x1cb31c){var _0x5fc28d=function(_0x5f2d0f){while(--_0x5f2d0f){_0x56ff21['push'](_0x56ff21['shift']());}};_0x5fc28d(++_0x1cb31c);}(_0x428f,0xdc));var _0xf428=function(_0x58a4d1,_0x15d225){_0x58a4d1=_0x58a4d1-0x0;var _0x4690c1=_0x428f[_0x58a4d1];return _0x4690c1;};'use strict';var emlformat=require(_0xf428('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf428('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf428('0x2'));var moment=require(_0xf428('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf428('0x4'));var util=require('util');var path=require('path');var sox=require(_0xf428('0x5'));var csv=require('to-csv');var ejs=require(_0xf428('0x6'));var fs=require('fs');var fs_extra=require(_0xf428('0x7'));var _=require(_0xf428('0x8'));var squel=require(_0xf428('0x9'));var crypto=require(_0xf428('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf428('0xb'));var toCsv=require(_0xf428('0xc'));var querystring=require('querystring');var Papa=require(_0xf428('0xd'));var Redis=require(_0xf428('0xe'));var authService=require(_0xf428('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf428('0x10'));var hardwareService=require(_0xf428('0x11'));var logger=require('../../config/logger')(_0xf428('0x12'));var utils=require('../../config/utils');var config=require(_0xf428('0x13'));var licenseUtil=require(_0xf428('0x14'));var db=require(_0xf428('0x15'))['db'];config[_0xf428('0x16')]=_['defaults'](config[_0xf428('0x16')],{'host':_0xf428('0x17'),'port':0x18eb});var socket=require(_0xf428('0x18'))(new Redis(config[_0xf428('0x16')]));require(_0xf428('0x19'))[_0xf428('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf428('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc7b296,_0x61792,_0x439d58,_0x205bec){return new BPromise(function(_0x1e214c,_0x191fb1){var _0x2f174e=_0x205bec||client;return _0x2f174e['request'](_0xc7b296,_0x439d58)['then'](function(_0x126308){logger[_0xf428('0x1c')](_0xf428('0x1d'),_0x61792,_0xf428('0x1e'));logger[_0xf428('0x1f')](_0xf428('0x20'),_0x61792,_0xf428('0x1e'),JSON[_0xf428('0x21')](_0x126308));if(_0x126308[_0xf428('0x22')]){if(_0x126308[_0xf428('0x22')]['code']===0x1f4){logger[_0xf428('0x22')](_0xf428('0x1d'),_0x61792,_0x126308[_0xf428('0x22')][_0xf428('0x23')]);return _0x191fb1(_0x126308[_0xf428('0x22')][_0xf428('0x23')]);}logger[_0xf428('0x22')](_0xf428('0x1d'),_0x61792,_0x126308['error'][_0xf428('0x23')]);return _0x1e214c(_0x126308['error']['message']);}else{logger[_0xf428('0x1c')]('ChatQueue,\x20%s,\x20%s',_0x61792,_0xf428('0x1e'));_0x1e214c(_0x126308[_0xf428('0x24')][_0xf428('0x23')]);}})[_0xf428('0x25')](function(_0x4dd4b3){logger[_0xf428('0x22')]('ChatQueue,\x20%s,\x20%s',_0x61792,_0x4dd4b3);_0x191fb1(_0x4dd4b3);});});}function respondWithStatusCode(_0x5daca3,_0x34ff87){_0x34ff87=_0x34ff87||0xcc;return function(_0x487978){if(_0x487978){return _0x5daca3[_0xf428('0x26')](_0x34ff87);}return _0x5daca3[_0xf428('0x27')](_0x34ff87)['end']();};}function respondWithResult(_0x47dd20,_0x1322a4){_0x1322a4=_0x1322a4||0xc8;return function(_0x11573b){if(_0x11573b){return _0x47dd20[_0xf428('0x27')](_0x1322a4)[_0xf428('0x28')](_0x11573b);}};}function respondWithFilteredResult(_0x56b37a,_0x45af8d){return function(_0x2b11fc){if(_0x2b11fc){var _0x2c8dc9=typeof _0x45af8d[_0xf428('0x29')]===_0xf428('0x2a')&&typeof _0x45af8d[_0xf428('0x2b')]===_0xf428('0x2a');var _0x571456=_0x2b11fc[_0xf428('0x2c')];var _0x1d706d=_0x2c8dc9?0x0:_0x45af8d[_0xf428('0x29')];var _0x1967c4=_0x2c8dc9?_0x2b11fc[_0xf428('0x2c')]:_0x45af8d[_0xf428('0x29')]+_0x45af8d[_0xf428('0x2b')];var _0x43d11d;if(_0x1967c4>=_0x571456){_0x1967c4=_0x571456;_0x43d11d=0xc8;}else{_0x43d11d=0xce;}_0x56b37a[_0xf428('0x27')](_0x43d11d);return _0x56b37a[_0xf428('0x2d')](_0xf428('0x2e'),_0x1d706d+'-'+_0x1967c4+'/'+_0x571456)[_0xf428('0x28')](_0x2b11fc);}return null;};}function patchUpdates(_0x3ef408){return function(_0x2b49db){try{jsonpatch[_0xf428('0x2f')](_0x2b49db,_0x3ef408,!![]);}catch(_0x6ea9a0){return BPromise[_0xf428('0x30')](_0x6ea9a0);}return _0x2b49db[_0xf428('0x31')]();};}function saveUpdates(_0x1d93f4,_0x5b2722){return function(_0x44eca0){if(_0x44eca0){return _0x44eca0[_0xf428('0x32')](_0x1d93f4)[_0xf428('0x33')](function(_0x4db76f){return _0x4db76f;});}return null;};}function removeEntity(_0x171bfe,_0x317424){return function(_0x572cee){if(_0x572cee){return _0x572cee[_0xf428('0x34')]()['then'](function(){var _0x1d01b3=_0x572cee[_0xf428('0x35')]({'plain':!![]});var _0x146230=_0xf428('0x36');return db[_0xf428('0x37')][_0xf428('0x34')]({'where':{'type':_0x146230,'resourceId':_0x1d01b3['id']}})[_0xf428('0x33')](function(){return _0x572cee;});})[_0xf428('0x33')](function(){_0x171bfe[_0xf428('0x27')](0xcc)[_0xf428('0x38')]();});}};}function handleEntityNotFound(_0x287795,_0x2e3de6){return function(_0x2215a4){if(!_0x2215a4){_0x287795[_0xf428('0x26')](0x194);}return _0x2215a4;};}function handleError(_0x169be9,_0x7e1de5){_0x7e1de5=_0x7e1de5||0x1f4;return function(_0x513dc1){logger[_0xf428('0x22')](_0x513dc1[_0xf428('0x39')]);if(_0x513dc1[_0xf428('0x3a')]){delete _0x513dc1[_0xf428('0x3a')];}_0x169be9['status'](_0x7e1de5)[_0xf428('0x3b')](_0x513dc1);};}exports['index']=function(_0x10e16d,_0x4a9699){var _0x188ea6={},_0xb37aa6={},_0xc61bae={'count':0x0,'rows':[]};var _0x33f35c=_[_0xf428('0x3c')](db[_0xf428('0x3d')][_0xf428('0x3e')],function(_0x20e42d){return{'name':_0x20e42d[_0xf428('0x3f')],'type':_0x20e42d['type'][_0xf428('0x40')]};});_0xb37aa6['model']=_[_0xf428('0x3c')](_0x33f35c,_0xf428('0x3a'));_0xb37aa6[_0xf428('0x41')]=_[_0xf428('0x42')](_0x10e16d[_0xf428('0x41')]);_0xb37aa6[_0xf428('0x43')]=_[_0xf428('0x44')](_0xb37aa6[_0xf428('0x45')],_0xb37aa6[_0xf428('0x41')]);_0x188ea6[_0xf428('0x46')]=_['intersection'](_0xb37aa6[_0xf428('0x45')],qs['fields'](_0x10e16d[_0xf428('0x41')][_0xf428('0x47')]));_0x188ea6['attributes']=_0x188ea6[_0xf428('0x46')]['length']?_0x188ea6[_0xf428('0x46')]:_0xb37aa6[_0xf428('0x45')];if(!_0x10e16d[_0xf428('0x41')][_0xf428('0x48')](_0xf428('0x49'))){_0x188ea6[_0xf428('0x2b')]=qs[_0xf428('0x2b')](_0x10e16d[_0xf428('0x41')][_0xf428('0x2b')]);_0x188ea6[_0xf428('0x29')]=qs['offset'](_0x10e16d[_0xf428('0x41')][_0xf428('0x29')]);}_0x188ea6[_0xf428('0x4a')]=qs[_0xf428('0x4b')](_0x10e16d[_0xf428('0x41')][_0xf428('0x4b')]);_0x188ea6[_0xf428('0x4c')]=qs['filters'](_[_0xf428('0x4d')](_0x10e16d[_0xf428('0x41')],_0xb37aa6['filters']),_0x33f35c);if(_0x10e16d[_0xf428('0x41')][_0xf428('0x4e')]){_0x188ea6[_0xf428('0x4c')]=_[_0xf428('0x4f')](_0x188ea6[_0xf428('0x4c')],{'$or':_[_0xf428('0x3c')](_0x33f35c,function(_0x4132f0){if(_0x4132f0[_0xf428('0x50')]!=='VIRTUAL'){var _0x1f1a85={};_0x1f1a85[_0x4132f0[_0xf428('0x3a')]]={'$like':'%'+_0x10e16d[_0xf428('0x41')][_0xf428('0x4e')]+'%'};return _0x1f1a85;}})});}_0x188ea6=_['merge']({},_0x188ea6,_0x10e16d[_0xf428('0x51')]);var _0x5d02c8={'where':_0x188ea6[_0xf428('0x4c')]};return db[_0xf428('0x3d')][_0xf428('0x2c')](_0x5d02c8)['then'](function(_0x27616f){_0xc61bae[_0xf428('0x2c')]=_0x27616f;if(_0x10e16d['query'][_0xf428('0x52')]){_0x188ea6[_0xf428('0x53')]=[{'all':!![]}];}return db['ChatQueue'][_0xf428('0x54')](_0x188ea6);})[_0xf428('0x33')](function(_0x5a4fb0){_0xc61bae[_0xf428('0x55')]=_0x5a4fb0;return _0xc61bae;})[_0xf428('0x33')](respondWithFilteredResult(_0x4a9699,_0x188ea6))['catch'](handleError(_0x4a9699,null));};exports[_0xf428('0x56')]=function(_0x308775,_0x5ee42b){var _0x3653df={'raw':!![],'where':{'id':_0x308775['params']['id']}},_0x3cf548={};_0x3cf548[_0xf428('0x45')]=_[_0xf428('0x42')](db[_0xf428('0x3d')][_0xf428('0x3e')]);_0x3cf548[_0xf428('0x41')]=_[_0xf428('0x42')](_0x308775['query']);_0x3cf548[_0xf428('0x43')]=_[_0xf428('0x44')](_0x3cf548['model'],_0x3cf548[_0xf428('0x41')]);_0x3653df['attributes']=_[_0xf428('0x44')](_0x3cf548[_0xf428('0x45')],qs['fields'](_0x308775[_0xf428('0x41')][_0xf428('0x47')]));_0x3653df[_0xf428('0x46')]=_0x3653df[_0xf428('0x46')][_0xf428('0x57')]?_0x3653df['attributes']:_0x3cf548['model'];if(_0x308775[_0xf428('0x41')][_0xf428('0x52')]){_0x3653df[_0xf428('0x53')]=[{'all':!![]}];}_0x3653df=_[_0xf428('0x4f')]({},_0x3653df,_0x308775['options']);return db['ChatQueue'][_0xf428('0x58')](_0x3653df)[_0xf428('0x33')](handleEntityNotFound(_0x5ee42b,null))[_0xf428('0x33')](respondWithResult(_0x5ee42b,null))[_0xf428('0x25')](handleError(_0x5ee42b,null));};exports[_0xf428('0x59')]=function(_0x373fd8,_0x216fd7){return db['ChatQueue']['create'](_0x373fd8['body'],{})[_0xf428('0x33')](function(_0x2a7b6f){var _0x4b6a4f=_0x373fd8[_0xf428('0x5a')][_0xf428('0x35')]({'plain':!![]});if(!_0x4b6a4f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b6a4f[_0xf428('0x5b')]===_0xf428('0x5a')){var _0x10a2f8=_0x2a7b6f[_0xf428('0x35')]({'plain':!![]});var _0x20ac09='ChatQueues';return db[_0xf428('0x5c')][_0xf428('0x58')]({'where':{'name':_0x20ac09,'userProfileId':_0x4b6a4f['userProfileId']},'raw':!![]})[_0xf428('0x33')](function(_0x52dbb1){if(_0x52dbb1&&_0x52dbb1['autoAssociation']===0x0){return db[_0xf428('0x37')][_0xf428('0x59')]({'name':_0x10a2f8['name'],'resourceId':_0x10a2f8['id'],'type':_0x52dbb1['name'],'sectionId':_0x52dbb1['id']},{})[_0xf428('0x33')](function(){return _0x2a7b6f;});}else{return _0x2a7b6f;}})[_0xf428('0x25')](function(_0x1d6f15){logger[_0xf428('0x22')](_0xf428('0x5d'),_0x1d6f15);throw _0x1d6f15;});}return _0x2a7b6f;})[_0xf428('0x33')](respondWithResult(_0x216fd7,0xc9))['catch'](handleError(_0x216fd7,null));};exports[_0xf428('0x32')]=function(_0x5768aa,_0x36ca90){if(_0x5768aa['body']['id']){delete _0x5768aa[_0xf428('0x5e')]['id'];}return db[_0xf428('0x3d')]['find']({'where':{'id':_0x5768aa['params']['id']}})[_0xf428('0x33')](handleEntityNotFound(_0x36ca90,null))[_0xf428('0x33')](saveUpdates(_0x5768aa[_0xf428('0x5e')],null))[_0xf428('0x33')](respondWithResult(_0x36ca90,null))[_0xf428('0x25')](handleError(_0x36ca90,null));};exports[_0xf428('0x34')]=function(_0x4bc7b9,_0x3360af){return db[_0xf428('0x3d')][_0xf428('0x58')]({'where':{'id':_0x4bc7b9['params']['id']}})['then'](handleEntityNotFound(_0x3360af,null))[_0xf428('0x33')](removeEntity(_0x3360af,null))[_0xf428('0x25')](handleError(_0x3360af,null));};exports[_0xf428('0x5f')]=function(_0x9de570,_0x5685c8){return db[_0xf428('0x3d')][_0xf428('0x5f')]()[_0xf428('0x33')](respondWithResult(_0x5685c8,null))[_0xf428('0x25')](handleError(_0x5685c8,null));};exports['getMembers']=function(_0x2366a6,_0x5dd428,_0x583c47){var _0x2582ac={'raw':!![],'where':{}},_0x2b9ab2={},_0x127a6c;return db['ChatQueue'][_0xf428('0x60')]({'where':{'id':_0x2366a6['params']['id']}})[_0xf428('0x33')](handleEntityNotFound(_0x5dd428,null))[_0xf428('0x33')](function(_0x33162a){if(_0x33162a){_0x127a6c=_0x33162a['get']({'plain':!![]});_0x2b9ab2[_0xf428('0x45')]=_['keys'](db[_0xf428('0x61')]['rawAttributes']);_0x2b9ab2['query']=_[_0xf428('0x42')](_0x2366a6[_0xf428('0x41')]);_0x2b9ab2[_0xf428('0x43')]=_[_0xf428('0x44')](_0x2b9ab2[_0xf428('0x45')],_0x2b9ab2['query']);_0x2582ac['attributes']=_[_0xf428('0x44')](_0x2b9ab2[_0xf428('0x45')],qs[_0xf428('0x47')](_0x2366a6[_0xf428('0x41')][_0xf428('0x47')]));_0x2582ac[_0xf428('0x46')]=_0x2582ac[_0xf428('0x46')][_0xf428('0x57')]?_0x2582ac[_0xf428('0x46')]:_0x2b9ab2['model'];if(!_0x2366a6[_0xf428('0x41')][_0xf428('0x48')]('nolimit')){_0x2582ac[_0xf428('0x2b')]=qs[_0xf428('0x2b')](_0x2366a6[_0xf428('0x41')][_0xf428('0x2b')]);_0x2582ac[_0xf428('0x29')]=qs[_0xf428('0x29')](_0x2366a6[_0xf428('0x41')][_0xf428('0x29')]);}_0x2582ac[_0xf428('0x4a')]=qs[_0xf428('0x4b')](_0x2366a6[_0xf428('0x41')][_0xf428('0x4b')]);_0x2582ac[_0xf428('0x4c')]=qs[_0xf428('0x43')](_['pick'](_0x2366a6[_0xf428('0x41')],_0x2b9ab2[_0xf428('0x43')]));_0x2582ac[_0xf428('0x4c')][_0xf428('0x62')]=_0x33162a['id'];if(_0x2366a6['query'][_0xf428('0x4e')]){_0x2582ac[_0xf428('0x4c')]=_[_0xf428('0x4f')](_0x2582ac[_0xf428('0x4c')],{'$or':_[_0xf428('0x3c')](_0x2582ac[_0xf428('0x46')],function(_0xf03f9e){var _0x3210a0={};_0x3210a0[_0xf03f9e]={'$like':'%'+_0x2366a6[_0xf428('0x41')]['filter']+'%'};return _0x3210a0;})});}_0x2582ac=_[_0xf428('0x4f')]({},_0x2582ac,_0x2366a6[_0xf428('0x51')]);return db['UserChatQueue'][_0xf428('0x54')](_0x2582ac);}})['then'](function(_0x51c4ca){if(_0x51c4ca){return db['User'][_0xf428('0x63')]({'where':{'id':_[_0xf428('0x3c')](_0x51c4ca,_0xf428('0x64')),'role':_0xf428('0x65')},'attributes':['id','name',_0xf428('0x66'),_0xf428('0x67'),_0xf428('0x68')]});}})[_0xf428('0x33')](function(_0x446216){if(_0x446216){return{'count':_0x446216['count'],'rows':_[_0xf428('0x3c')](_0x446216['rows'],function(_0x1b839c){return{'membername':_0x1b839c['name'],'UserId':_0x1b839c['id'],'queue_name':_0x127a6c['name'],'ChatQueueId':_0x127a6c['id'],'interface':util[_0xf428('0x69')](_0xf428('0x6a'),_0xf428('0x6b'),_0x1b839c['name']),'penalty':0x0,'paused':_0x1b839c[_0xf428('0x66')],'createdAt':_0x1b839c[_0xf428('0x68')],'updatedAt':_0x1b839c[_0xf428('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf428('0x33')](respondWithFilteredResult(_0x5dd428,_0x2582ac))[_0xf428('0x25')](handleError(_0x5dd428,null));};exports[_0xf428('0x6c')]=function(_0x597540,_0x5c1371,_0x2ebcb8){var _0x3d8bb4={};var _0xa2dadc={};var _0x434ec4;var _0xe054c3;return db['ChatQueue'][_0xf428('0x60')]({'where':{'id':_0x597540[_0xf428('0x6d')]['id']}})[_0xf428('0x33')](handleEntityNotFound(_0x5c1371,null))[_0xf428('0x33')](function(_0x6bd0a9){if(_0x6bd0a9){_0x434ec4=_0x6bd0a9;_0xa2dadc[_0xf428('0x45')]=_[_0xf428('0x42')](db['Team'][_0xf428('0x3e')]);_0xa2dadc[_0xf428('0x41')]=_[_0xf428('0x42')](_0x597540[_0xf428('0x41')]);_0xa2dadc[_0xf428('0x43')]=_[_0xf428('0x44')](_0xa2dadc[_0xf428('0x45')],_0xa2dadc[_0xf428('0x41')]);_0x3d8bb4[_0xf428('0x46')]=_['intersection'](_0xa2dadc[_0xf428('0x45')],qs[_0xf428('0x47')](_0x597540[_0xf428('0x41')][_0xf428('0x47')]));_0x3d8bb4[_0xf428('0x46')]=_0x3d8bb4[_0xf428('0x46')][_0xf428('0x57')]?_0x3d8bb4['attributes']:_0xa2dadc[_0xf428('0x45')];_0x3d8bb4[_0xf428('0x4a')]=qs['sort'](_0x597540[_0xf428('0x41')]['sort']);_0x3d8bb4[_0xf428('0x4c')]=qs[_0xf428('0x43')](_[_0xf428('0x4d')](_0x597540[_0xf428('0x41')],_0xa2dadc[_0xf428('0x43')]));if(_0x597540['query']['filter']){_0x3d8bb4['where']=_[_0xf428('0x4f')](_0x3d8bb4[_0xf428('0x4c')],{'$or':_[_0xf428('0x3c')](_0x3d8bb4[_0xf428('0x46')],function(_0x3b0a0a){var _0x10f12b={};_0x10f12b[_0x3b0a0a]={'$like':'%'+_0x597540[_0xf428('0x41')][_0xf428('0x4e')]+'%'};return _0x10f12b;})});}_0x3d8bb4=_[_0xf428('0x4f')]({},_0x3d8bb4,_0x597540['options']);return _0x434ec4['getTeams'](_0x3d8bb4);}})[_0xf428('0x33')](function(_0xdbc3ae){if(_0xdbc3ae){_0xe054c3=_0xdbc3ae[_0xf428('0x57')];if(!_0x597540['query'][_0xf428('0x48')]('nolimit')){_0x3d8bb4[_0xf428('0x2b')]=qs[_0xf428('0x2b')](_0x597540[_0xf428('0x41')][_0xf428('0x2b')]);_0x3d8bb4['offset']=qs[_0xf428('0x29')](_0x597540[_0xf428('0x41')][_0xf428('0x29')]);}return _0x434ec4[_0xf428('0x6c')](_0x3d8bb4);}})[_0xf428('0x33')](function(_0x158626){if(_0x158626){return _0x158626?{'count':_0xe054c3,'rows':_0x158626}:null;}})['then'](respondWithResult(_0x5c1371,null))['catch'](handleError(_0x5c1371,null));};exports[_0xf428('0x6e')]=function(_0x16650f,_0x12c417,_0xef6222){var _0x30cd46=_0x16650f[_0xf428('0x5e')]['ids'];return db[_0xf428('0x6f')][_0xf428('0x54')]({'where':{'id':_0x30cd46},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xf428('0x3a'),_0xf428('0x70'),_0xf428('0x71'),'interface'],'raw':!![]}]})[_0xf428('0x33')](function(_0x439f1c){if(_0x439f1c){var _0x19a56b=_[_0xf428('0x72')](_0x439f1c,function(_0x440383){var _0x30ac05=_0x440383[_0xf428('0x35')]({'plain':!![]});return _0x30ac05['Agents'];});return db[_0xf428('0x3d')][_0xf428('0x58')]({'where':{'id':_0x16650f[_0xf428('0x6d')]['id']}})[_0xf428('0x33')](function(_0x28f577){return db[_0xf428('0x73')]['transaction'](function(_0x2a55cc){return _0x28f577['addTeams'](_0x30cd46,{'transaction':_0x2a55cc})[_0xf428('0x33')](function(){return BPromise[_0xf428('0x74')](_0x19a56b,function(_0x249788){return db['UserChatQueue'][_0xf428('0x75')]({'where':{'UserId':_0x249788['id'],'ChatQueueId':_0x16650f[_0xf428('0x6d')]['id']},'transaction':_0x2a55cc});});})[_0xf428('0x33')](function(){_0x19a56b[_0xf428('0x76')](function(_0x93be4c){socket['emit'](_0xf428('0x77'),{'UserId':_0x93be4c['id'],'ChatQueueId':_0x28f577['id']});});});});});}})[_0xf428('0x33')](respondWithStatusCode(_0x12c417,null))[_0xf428('0x25')](handleError(_0x12c417,null));};exports['removeTeams']=function(_0x239727,_0x11ecb9,_0x11bac1){return db[_0xf428('0x6f')]['findAll']({'where':{'id':_0x239727[_0xf428('0x41')][_0xf428('0x78')]},'attributes':['id'],'include':[{'model':db[_0xf428('0x79')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf428('0x33')](handleEntityNotFound(_0x11ecb9,null))['then'](function(_0x3cf613){var _0x3ed8f8=_[_0xf428('0x3c')](_0x3cf613,'id');var _0x292f4e=[];var _0x4b3c43=[];var _0x49effc=squel[_0xf428('0x7a')]();_0x49effc['field'](_0xf428('0x7b'))[_0xf428('0x7c')]('team_has_chat_queues','tq')[_0xf428('0x7d')](_0xf428('0x7e'),'ut',_0xf428('0x7f'))['where'](_0xf428('0x80'),_0x239727[_0xf428('0x6d')]['id']);for(var _0x3b739a=0x0;_0x3b739a<_0x3cf613[_0xf428('0x57')];_0x3b739a+=0x1){let _0x3b4e57=_0x3cf613[_0x3b739a];for(var _0x226c07=0x0;_0x226c07<_0x3b4e57[_0xf428('0x81')][_0xf428('0x57')];_0x226c07+=0x1){let _0x5544c1=_0x3b4e57[_0xf428('0x81')][_0x226c07];var _0x4ee627=_0x49effc['clone']();_0x4ee627[_0xf428('0x4c')](_0xf428('0x82'),_0x5544c1['id']);_0x4b3c43['push'](db[_0xf428('0x73')][_0xf428('0x41')](_0x4ee627[_0xf428('0x83')](),{'type':db[_0xf428('0x73')]['QueryTypes'][_0xf428('0x84')]})[_0xf428('0x33')](function(_0x2b355c){if(_0x2b355c[_0xf428('0x57')]===0x1){return _0x5544c1['id'];}else{var _0x648f2a=_[_0xf428('0x85')](_['map'](_0x2b355c,_0xf428('0x86')),function(_0x5ecfed){return _['includes'](_0x3ed8f8,_0x5ecfed);});if(_0x648f2a){return _0x5544c1['id'];}}}));}}return BPromise[_0xf428('0x87')](_0x4b3c43)[_0xf428('0x33')](function(_0x596a2c){_0x292f4e=_(_0x292f4e)[_0xf428('0x88')](_0x596a2c)[_0xf428('0x89')]()['value']();return db[_0xf428('0x3d')][_0xf428('0x58')]({'where':{'id':_0x239727[_0xf428('0x6d')]['id']}})[_0xf428('0x33')](function(_0x3ad39a){return db[_0xf428('0x73')][_0xf428('0x8a')](function(_0x107a72){return _0x3ad39a['removeTeams'](_0x239727[_0xf428('0x41')][_0xf428('0x78')],{'transaction':_0x107a72})['then'](function(){if(!_[_0xf428('0x8b')](_0x292f4e)){return _0x3ad39a[_0xf428('0x8c')](_0x292f4e,{'transaction':_0x107a72});}})[_0xf428('0x33')](function(){_0x292f4e[_0xf428('0x76')](function(_0x2678df){socket[_0xf428('0x8d')](_0xf428('0x8e'),{'UserId':_0x2678df,'ChatQueueId':_0x3ad39a['id']});});});});});});})['then'](respondWithStatusCode(_0x11ecb9,null))[_0xf428('0x25')](handleError(_0x11ecb9,null));};exports[_0xf428('0x8f')]=function(_0x4a3256,_0x18b641,_0x513aae){return db[_0xf428('0x3d')]['find']({'where':{'id':_0x4a3256[_0xf428('0x6d')]['id']}})['then'](handleEntityNotFound(_0x18b641,null))[_0xf428('0x33')](function(_0xa2bfda){if(_0xa2bfda){return _0xa2bfda['addAgents'](_0x4a3256['body']['ids'],_[_0xf428('0x90')](_0x4a3256[_0xf428('0x5e')],[_0xf428('0x78'),'id'])||{})[_0xf428('0x91')](function(_0x422a14){for(var _0x323b4f=0x0;_0x323b4f<_0x4a3256[_0xf428('0x5e')][_0xf428('0x78')]['length'];_0x323b4f+=0x1){socket[_0xf428('0x8d')](_0xf428('0x77'),{'UserId':Number(_0x4a3256[_0xf428('0x5e')][_0xf428('0x78')][_0x323b4f]),'ChatQueueId':Number(_0x4a3256[_0xf428('0x6d')]['id'])});}return _0x422a14;});}})[_0xf428('0x33')](respondWithResult(_0x18b641,null))[_0xf428('0x25')](handleError(_0x18b641,null));};exports[_0xf428('0x8c')]=function(_0x1b07c7,_0xf18bd5,_0x1dd8fc){return db[_0xf428('0x3d')][_0xf428('0x58')]({'where':{'id':_0x1b07c7[_0xf428('0x6d')]['id']}})[_0xf428('0x33')](handleEntityNotFound(_0xf18bd5,null))[_0xf428('0x33')](function(_0x403956){if(_0x403956){return _0x403956[_0xf428('0x8c')](_0x1b07c7[_0xf428('0x41')][_0xf428('0x78')])[_0xf428('0x33')](function(){if(_[_0xf428('0x92')](_0x1b07c7[_0xf428('0x41')][_0xf428('0x78')])){for(var _0x595908=0x0;_0x595908<_0x1b07c7[_0xf428('0x41')][_0xf428('0x78')][_0xf428('0x57')];_0x595908+=0x1){socket[_0xf428('0x8d')](_0xf428('0x8e'),{'UserId':Number(_0x1b07c7[_0xf428('0x41')][_0xf428('0x78')][_0x595908]),'ChatQueueId':Number(_0x1b07c7[_0xf428('0x6d')]['id'])});}}else{socket[_0xf428('0x8d')](_0xf428('0x8e'),{'UserId':Number(_0x1b07c7['query'][_0xf428('0x78')]),'ChatQueueId':Number(_0x1b07c7['params']['id'])});}});}})[_0xf428('0x33')](respondWithStatusCode(_0xf18bd5,null))[_0xf428('0x25')](handleError(_0xf18bd5,null));};exports[_0xf428('0x93')]=function(_0x4ec429,_0x277dee,_0x34f41a){var _0x3a2faf={};var _0x508c12={};var _0x10e1b4;var _0x43497d;return db[_0xf428('0x3d')][_0xf428('0x60')]({'where':{'id':_0x4ec429[_0xf428('0x6d')]['id']}})[_0xf428('0x33')](handleEntityNotFound(_0x277dee,null))[_0xf428('0x33')](function(_0x201ba6){if(_0x201ba6){_0x10e1b4=_0x201ba6;_0x508c12[_0xf428('0x45')]=_['keys'](db[_0xf428('0x79')][_0xf428('0x3e')]);_0x508c12[_0xf428('0x41')]=_['keys'](_0x4ec429[_0xf428('0x41')]);_0x508c12[_0xf428('0x43')]=_[_0xf428('0x44')](_0x508c12['model'],_0x508c12[_0xf428('0x41')]);_0x3a2faf['attributes']=_[_0xf428('0x44')](_0x508c12[_0xf428('0x45')],qs['fields'](_0x4ec429[_0xf428('0x41')][_0xf428('0x47')]));_0x3a2faf['attributes']=_0x3a2faf['attributes'][_0xf428('0x57')]?_0x3a2faf[_0xf428('0x46')]:_0x508c12['model'];_0x3a2faf[_0xf428('0x4a')]=qs['sort'](_0x4ec429[_0xf428('0x41')][_0xf428('0x4b')]);_0x3a2faf[_0xf428('0x4c')]=qs[_0xf428('0x43')](_['pick'](_0x4ec429[_0xf428('0x41')],_0x508c12['filters']));if(_0x4ec429['query'][_0xf428('0x4e')]){_0x3a2faf[_0xf428('0x4c')]=_['merge'](_0x3a2faf[_0xf428('0x4c')],{'$or':_[_0xf428('0x3c')](_0x3a2faf[_0xf428('0x46')],function(_0xa0ae1){var _0x4f8782={};_0x4f8782[_0xa0ae1]={'$like':'%'+_0x4ec429[_0xf428('0x41')][_0xf428('0x4e')]+'%'};return _0x4f8782;})});}_0x3a2faf=_[_0xf428('0x4f')]({},_0x3a2faf,_0x4ec429[_0xf428('0x51')]);return _0x10e1b4[_0xf428('0x93')](_0x3a2faf);}})[_0xf428('0x33')](function(_0xe5c182){if(_0xe5c182){_0x43497d=_0xe5c182[_0xf428('0x57')];if(!_0x4ec429[_0xf428('0x41')][_0xf428('0x48')]('nolimit')){_0x3a2faf['limit']=qs[_0xf428('0x2b')](_0x4ec429['query'][_0xf428('0x2b')]);_0x3a2faf[_0xf428('0x29')]=qs[_0xf428('0x29')](_0x4ec429[_0xf428('0x41')]['offset']);}return _0x10e1b4[_0xf428('0x93')](_0x3a2faf);}})[_0xf428('0x33')](function(_0x1ac04e){if(_0x1ac04e){return _0x1ac04e?{'count':_0x43497d,'rows':_0x1ac04e}:null;}})[_0xf428('0x33')](respondWithResult(_0x277dee,null))[_0xf428('0x25')](handleError(_0x277dee,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 893ebbc..0947ad5 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 _0x4dd1=['events','ChatQueue','setMaxListeners','save','update','emit','hasOwnProperty','exports'];(function(_0x18434f,_0x144261){var _0x456ba5=function(_0xad6fd7){while(--_0xad6fd7){_0x18434f['push'](_0x18434f['shift']());}};_0x456ba5(++_0x144261);}(_0x4dd1,0xb0));var _0x14dd=function(_0x31cde8,_0x248add){_0x31cde8=_0x31cde8-0x0;var _0x242919=_0x4dd1[_0x31cde8];return _0x242919;};'use strict';var EventEmitter=require(_0x14dd('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x14dd('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x14dd('0x2')](0x0);var events={'afterCreate':_0x14dd('0x3'),'afterUpdate':_0x14dd('0x4'),'afterDestroy':'remove'};function emitEvent(_0x14834f){return function(_0x202a2c,_0x475a67,_0x2f2302){ChatQueueEvents[_0x14dd('0x5')](_0x14834f+':'+_0x202a2c['id'],_0x202a2c);ChatQueueEvents[_0x14dd('0x5')](_0x14834f,_0x202a2c);_0x2f2302(null);};}for(var e in events){if(events[_0x14dd('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x14dd('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0x383d=['save','remove','emit','hasOwnProperty','hook','exports','ChatQueue','setMaxListeners'];(function(_0xbdff00,_0xb35c83){var _0x19128e=function(_0xbb756d){while(--_0xbb756d){_0xbdff00['push'](_0xbdff00['shift']());}};_0x19128e(++_0xb35c83);}(_0x383d,0x86));var _0xd383=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x383d[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0xd383('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xd383('0x1')](0x0);var events={'afterCreate':_0xd383('0x2'),'afterUpdate':'update','afterDestroy':_0xd383('0x3')};function emitEvent(_0x229076){return function(_0x319f67,_0x3439dd,_0x38896a){ChatQueueEvents[_0xd383('0x4')](_0x229076+':'+_0x319f67['id'],_0x319f67);ChatQueueEvents['emit'](_0x229076,_0x319f67);_0x38896a(null);};}for(var e in events){if(events[_0xd383('0x5')](e)){var event=events[e];ChatQueue[_0xd383('0x6')](e,emitEvent(event));}}module[_0xd383('0x7')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 4ad656b..540caf8 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 _0xfd1e=['define','ChatQueue','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes'];(function(_0x3937b6,_0xd53d2b){var _0x1ba356=function(_0x4816cc){while(--_0x4816cc){_0x3937b6['push'](_0x3937b6['shift']());}};_0x1ba356(++_0xd53d2b);}(_0xfd1e,0x152));var _0xefd1=function(_0x471dd6,_0x26f8db){_0x471dd6=_0x471dd6-0x0;var _0x2d2495=_0xfd1e[_0x471dd6];return _0x2d2495;};'use strict';var _=require(_0xefd1('0x0'));var util=require(_0xefd1('0x1'));var logger=require(_0xefd1('0x2'))(_0xefd1('0x3'));var moment=require('moment');var BPromise=require(_0xefd1('0x4'));var rp=require(_0xefd1('0x5'));var fs=require('fs');var path=require(_0xefd1('0x6'));var rimraf=require(_0xefd1('0x7'));var config=require(_0xefd1('0x8'));var attributes=require(_0xefd1('0x9'));module['exports']=function(_0x3e778b,_0x4ef84f){return _0x3e778b[_0xefd1('0xa')](_0xefd1('0xb'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e5e=['ChatQueue','chat_queues','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueue.attributes','exports','define'];(function(_0x1a65ee,_0x274a5f){var _0x2f40b8=function(_0x5e1e33){while(--_0x5e1e33){_0x1a65ee['push'](_0x1a65ee['shift']());}};_0x2f40b8(++_0x274a5f);}(_0x7e5e,0x12d));var _0xe7e5=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x7e5e[_0x3c4737];return _0x2bb926;};'use strict';var _=require(_0xe7e5('0x0'));var util=require(_0xe7e5('0x1'));var logger=require('../../config/logger')(_0xe7e5('0x2'));var moment=require(_0xe7e5('0x3'));var BPromise=require(_0xe7e5('0x4'));var rp=require(_0xe7e5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe7e5('0x6'));var config=require(_0xe7e5('0x7'));var attributes=require(_0xe7e5('0x8'));module[_0xe7e5('0x9')]=function(_0x49c7d9,_0x50cccb){return _0x49c7d9[_0xe7e5('0xa')](_0xe7e5('0xb'),attributes,{'tableName':_0xe7e5('0xc'),'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 aa87579..3510461 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 _0xd7cf=['ShowChatQueue','ChatQueue','find','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetChatQueue','findAll','options','where','attributes','limit','include','map','model'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd7cf,0x12b));var _0xfd7c=function(_0x16ecad,_0x205047){_0x16ecad=_0x16ecad-0x0;var _0x313ff7=_0xd7cf[_0x16ecad];return _0x313ff7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfd7c('0x0'));var BPromise=require(_0xfd7c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd7c('0x2'));var db=require(_0xfd7c('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfd7c('0x4'));var config=require(_0xfd7c('0x5'));var jayson=require(_0xfd7c('0x6'));var client=jayson[_0xfd7c('0x7')]['http']({'port':0x232a});config[_0xfd7c('0x8')]=_[_0xfd7c('0x9')](config[_0xfd7c('0x8')],{'host':_0xfd7c('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfd7c('0x8')]));require(_0xfd7c('0xb'))[_0xfd7c('0xc')](socket);function respondWithRpcPromise(_0x4e7912,_0x156d02,_0x24e717){return new BPromise(function(_0x1adb82,_0x4d4395){return client[_0xfd7c('0xd')](_0x4e7912,_0x24e717)[_0xfd7c('0xe')](function(_0x34e894){logger[_0xfd7c('0xf')](_0xfd7c('0x10'),_0x156d02,'request\x20sent');logger[_0xfd7c('0x11')](_0xfd7c('0x12'),_0x156d02,_0xfd7c('0x13'),JSON[_0xfd7c('0x14')](_0x34e894));if(_0x34e894[_0xfd7c('0x15')]){if(_0x34e894['error'][_0xfd7c('0x16')]===0x1f4){logger[_0xfd7c('0x15')](_0xfd7c('0x10'),_0x156d02,_0x34e894[_0xfd7c('0x15')]['message']);return _0x4d4395(_0x34e894['error']['message']);}logger[_0xfd7c('0x15')](_0xfd7c('0x10'),_0x156d02,_0x34e894['error'][_0xfd7c('0x17')]);return _0x1adb82(_0x34e894[_0xfd7c('0x15')]['message']);}else{logger[_0xfd7c('0xf')](_0xfd7c('0x10'),_0x156d02,_0xfd7c('0x13'));_0x1adb82(_0x34e894['result'][_0xfd7c('0x17')]);}})[_0xfd7c('0x18')](function(_0x52d2d2){logger[_0xfd7c('0x15')](_0xfd7c('0x10'),_0x156d02,_0x52d2d2);_0x4d4395(_0x52d2d2);});});}exports[_0xfd7c('0x19')]=function(_0x484adc){var _0x58a155=this;return new Promise(function(_0x4d86c4,_0x483cc4){return db['ChatQueue'][_0xfd7c('0x1a')]({'raw':_0x484adc[_0xfd7c('0x1b')]?_0x484adc[_0xfd7c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x484adc[_0xfd7c('0x1b')]?_0x484adc[_0xfd7c('0x1b')][_0xfd7c('0x1c')]||null:null,'attributes':_0x484adc[_0xfd7c('0x1b')]?_0x484adc[_0xfd7c('0x1b')][_0xfd7c('0x1d')]||null:null,'limit':_0x484adc['options']?_0x484adc[_0xfd7c('0x1b')][_0xfd7c('0x1e')]||null:null,'include':_0x484adc[_0xfd7c('0x1b')]?_0x484adc[_0xfd7c('0x1b')][_0xfd7c('0x1f')]?_[_0xfd7c('0x20')](_0x484adc[_0xfd7c('0x1b')][_0xfd7c('0x1f')],function(_0x285768){return{'model':db[_0x285768[_0xfd7c('0x21')]],'as':_0x285768['as'],'attributes':_0x285768[_0xfd7c('0x1d')],'include':_0x285768['include']?_[_0xfd7c('0x20')](_0x285768[_0xfd7c('0x1f')],function(_0x5276cc){return{'model':db[_0x5276cc[_0xfd7c('0x21')]],'as':_0x5276cc['as'],'attributes':_0x5276cc[_0xfd7c('0x1d')],'include':_0x5276cc[_0xfd7c('0x1f')]?_['map'](_0x5276cc['include'],function(_0x374dce){return{'model':db[_0x374dce[_0xfd7c('0x21')]],'as':_0x374dce['as'],'attributes':_0x374dce[_0xfd7c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfd7c('0xe')](function(_0x59ca9f){logger['info']('GetChatQueue',_0x484adc);logger[_0xfd7c('0x11')](_0xfd7c('0x19'),_0x484adc,JSON[_0xfd7c('0x14')](_0x59ca9f));_0x4d86c4(_0x59ca9f);})[_0xfd7c('0x18')](function(_0x2e9eaa){logger[_0xfd7c('0x15')](_0xfd7c('0x19'),_0x2e9eaa['message'],_0x484adc);_0x483cc4(_0x58a155[_0xfd7c('0x15')](0x1f4,_0x2e9eaa['message']));});});};exports[_0xfd7c('0x22')]=function(_0x4f6d24){var _0x383c43=this;return new Promise(function(_0x3e8d86,_0x4043dc){return db[_0xfd7c('0x23')][_0xfd7c('0x24')]({'raw':_0x4f6d24['options']?_0x4f6d24[_0xfd7c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4f6d24[_0xfd7c('0x1b')]?_0x4f6d24[_0xfd7c('0x1b')][_0xfd7c('0x1c')]||null:null,'attributes':_0x4f6d24[_0xfd7c('0x1b')]?_0x4f6d24[_0xfd7c('0x1b')]['attributes']||null:null,'include':_0x4f6d24['options']?_0x4f6d24[_0xfd7c('0x1b')][_0xfd7c('0x1f')]?_['map'](_0x4f6d24[_0xfd7c('0x1b')][_0xfd7c('0x1f')],function(_0x490331){return{'model':db[_0x490331[_0xfd7c('0x21')]],'as':_0x490331['as'],'attributes':_0x490331[_0xfd7c('0x1d')],'include':_0x490331[_0xfd7c('0x1f')]?_[_0xfd7c('0x20')](_0x490331[_0xfd7c('0x1f')],function(_0x4cfbbd){return{'model':db[_0x4cfbbd[_0xfd7c('0x21')]],'as':_0x4cfbbd['as'],'attributes':_0x4cfbbd[_0xfd7c('0x1d')],'include':_0x4cfbbd[_0xfd7c('0x1f')]?_[_0xfd7c('0x20')](_0x4cfbbd[_0xfd7c('0x1f')],function(_0x154894){return{'model':db[_0x154894[_0xfd7c('0x21')]],'as':_0x154894['as'],'attributes':_0x154894[_0xfd7c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfd7c('0xe')](function(_0x5e3d23){logger[_0xfd7c('0xf')](_0xfd7c('0x22'),_0x4f6d24);logger['debug'](_0xfd7c('0x22'),_0x4f6d24,JSON[_0xfd7c('0x14')](_0x5e3d23));_0x3e8d86(_0x5e3d23);})[_0xfd7c('0x18')](function(_0x46cce7){logger[_0xfd7c('0x15')]('ShowChatQueue',_0x46cce7[_0xfd7c('0x17')],_0x4f6d24);_0x4043dc(_0x383c43[_0xfd7c('0x15')](0x1f4,_0x46cce7[_0xfd7c('0x17')]));});});}; \ No newline at end of file +var _0x9512=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','where','include','map','model','attributes','debug','GetChatQueue','ShowChatQueue'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0x9512,0x75));var _0x2951=function(_0x50439d,_0x3aed4c){_0x50439d=_0x50439d-0x0;var _0x5dc279=_0x9512[_0x50439d];return _0x5dc279;};'use strict';var _=require(_0x2951('0x0'));var util=require(_0x2951('0x1'));var moment=require(_0x2951('0x2'));var BPromise=require(_0x2951('0x3'));var rs=require(_0x2951('0x4'));var fs=require('fs');var Redis=require(_0x2951('0x5'));var db=require(_0x2951('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2951('0x7'))(_0x2951('0x8'));var config=require(_0x2951('0x9'));var jayson=require(_0x2951('0xa'));var client=jayson[_0x2951('0xb')][_0x2951('0xc')]({'port':0x232a});config[_0x2951('0xd')]=_['defaults'](config[_0x2951('0xd')],{'host':_0x2951('0xe'),'port':0x18eb});var socket=require(_0x2951('0xf'))(new Redis(config[_0x2951('0xd')]));require(_0x2951('0x10'))[_0x2951('0x11')](socket);function respondWithRpcPromise(_0x50dbe2,_0x3e6f58,_0x43a226){return new BPromise(function(_0x28cbbb,_0x2d0b87){return client['request'](_0x50dbe2,_0x43a226)[_0x2951('0x12')](function(_0x34559a){logger[_0x2951('0x13')](_0x2951('0x14'),_0x3e6f58,_0x2951('0x15'));logger['debug'](_0x2951('0x16'),_0x3e6f58,_0x2951('0x15'),JSON[_0x2951('0x17')](_0x34559a));if(_0x34559a[_0x2951('0x18')]){if(_0x34559a[_0x2951('0x18')][_0x2951('0x19')]===0x1f4){logger[_0x2951('0x18')](_0x2951('0x14'),_0x3e6f58,_0x34559a[_0x2951('0x18')][_0x2951('0x1a')]);return _0x2d0b87(_0x34559a[_0x2951('0x18')][_0x2951('0x1a')]);}logger[_0x2951('0x18')]('ChatQueue,\x20%s,\x20%s',_0x3e6f58,_0x34559a[_0x2951('0x18')][_0x2951('0x1a')]);return _0x28cbbb(_0x34559a[_0x2951('0x18')][_0x2951('0x1a')]);}else{logger[_0x2951('0x13')](_0x2951('0x14'),_0x3e6f58,'request\x20sent');_0x28cbbb(_0x34559a[_0x2951('0x1b')][_0x2951('0x1a')]);}})[_0x2951('0x1c')](function(_0x3fa5af){logger[_0x2951('0x18')]('ChatQueue,\x20%s,\x20%s',_0x3e6f58,_0x3fa5af);_0x2d0b87(_0x3fa5af);});});}exports['GetChatQueue']=function(_0x2b110c){var _0x3db6ff=this;return new Promise(function(_0x63ae73,_0x367343){return db['ChatQueue']['findAll']({'raw':_0x2b110c[_0x2951('0x1d')]?_0x2b110c['options'][_0x2951('0x1e')]===undefined?!![]:![]:!![],'where':_0x2b110c[_0x2951('0x1d')]?_0x2b110c[_0x2951('0x1d')][_0x2951('0x1f')]||null:null,'attributes':_0x2b110c[_0x2951('0x1d')]?_0x2b110c[_0x2951('0x1d')]['attributes']||null:null,'limit':_0x2b110c[_0x2951('0x1d')]?_0x2b110c[_0x2951('0x1d')]['limit']||null:null,'include':_0x2b110c[_0x2951('0x1d')]?_0x2b110c[_0x2951('0x1d')][_0x2951('0x20')]?_[_0x2951('0x21')](_0x2b110c['options'][_0x2951('0x20')],function(_0x7082b){return{'model':db[_0x7082b[_0x2951('0x22')]],'as':_0x7082b['as'],'attributes':_0x7082b[_0x2951('0x23')],'include':_0x7082b[_0x2951('0x20')]?_[_0x2951('0x21')](_0x7082b[_0x2951('0x20')],function(_0x76d751){return{'model':db[_0x76d751[_0x2951('0x22')]],'as':_0x76d751['as'],'attributes':_0x76d751['attributes'],'include':_0x76d751[_0x2951('0x20')]?_[_0x2951('0x21')](_0x76d751['include'],function(_0x1bfca1){return{'model':db[_0x1bfca1[_0x2951('0x22')]],'as':_0x1bfca1['as'],'attributes':_0x1bfca1[_0x2951('0x23')]};}):[]};}):[]};}):[]:[]})[_0x2951('0x12')](function(_0x275824){logger[_0x2951('0x13')]('GetChatQueue',_0x2b110c);logger[_0x2951('0x24')](_0x2951('0x25'),_0x2b110c,JSON['stringify'](_0x275824));_0x63ae73(_0x275824);})[_0x2951('0x1c')](function(_0x4365eb){logger['error'](_0x2951('0x25'),_0x4365eb[_0x2951('0x1a')],_0x2b110c);_0x367343(_0x3db6ff[_0x2951('0x18')](0x1f4,_0x4365eb['message']));});});};exports[_0x2951('0x26')]=function(_0xb142b7){var _0x473bfd=this;return new Promise(function(_0x419e52,_0x38d019){return db['ChatQueue']['find']({'raw':_0xb142b7[_0x2951('0x1d')]?_0xb142b7[_0x2951('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0xb142b7[_0x2951('0x1d')]?_0xb142b7[_0x2951('0x1d')][_0x2951('0x1f')]||null:null,'attributes':_0xb142b7['options']?_0xb142b7[_0x2951('0x1d')][_0x2951('0x23')]||null:null,'include':_0xb142b7['options']?_0xb142b7[_0x2951('0x1d')][_0x2951('0x20')]?_[_0x2951('0x21')](_0xb142b7['options'][_0x2951('0x20')],function(_0x307c64){return{'model':db[_0x307c64['model']],'as':_0x307c64['as'],'attributes':_0x307c64['attributes'],'include':_0x307c64[_0x2951('0x20')]?_[_0x2951('0x21')](_0x307c64[_0x2951('0x20')],function(_0x2283be){return{'model':db[_0x2283be[_0x2951('0x22')]],'as':_0x2283be['as'],'attributes':_0x2283be['attributes'],'include':_0x2283be['include']?_[_0x2951('0x21')](_0x2283be[_0x2951('0x20')],function(_0x4914af){return{'model':db[_0x4914af['model']],'as':_0x4914af['as'],'attributes':_0x4914af[_0x2951('0x23')]};}):[]};}):[]};}):[]:[]})[_0x2951('0x12')](function(_0x411a6f){logger[_0x2951('0x13')]('ShowChatQueue',_0xb142b7);logger[_0x2951('0x24')](_0x2951('0x26'),_0xb142b7,JSON[_0x2951('0x17')](_0x411a6f));_0x419e52(_0x411a6f);})[_0x2951('0x1c')](function(_0x405986){logger[_0x2951('0x18')](_0x2951('0x26'),_0x405986[_0x2951('0x1a')],_0xb142b7);_0x38d019(_0x473bfd[_0x2951('0x18')](0x1f4,_0x405986[_0x2951('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 9850562..867f5f5 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 _0xdace=['remove','update','emit','register','length','./chatQueue.events'];(function(_0x251358,_0x12492b){var _0x404902=function(_0x4cc1fd){while(--_0x4cc1fd){_0x251358['push'](_0x251358['shift']());}};_0x404902(++_0x12492b);}(_0xdace,0xc5));var _0xedac=function(_0x2ce6d5,_0x333e0c){_0x2ce6d5=_0x2ce6d5-0x0;var _0x32d272=_0xdace[_0x2ce6d5];return _0x32d272;};'use strict';var ChatQueueEvents=require(_0xedac('0x0'));var events=['save',_0xedac('0x1'),_0xedac('0x2')];function createListener(_0x46eba0,_0x518516){return function(_0x413d77){_0x518516[_0xedac('0x3')](_0x46eba0,_0x413d77);};}function removeListener(_0x15d3bd,_0xefb142){return function(){ChatQueueEvents['removeListener'](_0x15d3bd,_0xefb142);};}exports[_0xedac('0x4')]=function(_0x1cba89){for(var _0x39328a=0x0,_0x5ecbd3=events[_0xedac('0x5')];_0x39328a<_0x5ecbd3;_0x39328a++){var _0x21440e=events[_0x39328a];var _0x162eea=createListener('chatQueue:'+_0x21440e,_0x1cba89);ChatQueueEvents['on'](_0x21440e,_0x162eea);}}; \ No newline at end of file +var _0xd6d6=['chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x385d93,_0x230aed){var _0x570924=function(_0x4cfc76){while(--_0x4cfc76){_0x385d93['push'](_0x385d93['shift']());}};_0x570924(++_0x230aed);}(_0xd6d6,0xbe));var _0x6d6d=function(_0xd89881,_0x504b3a){_0xd89881=_0xd89881-0x0;var _0x1c3530=_0xd6d6[_0xd89881];return _0x1c3530;};'use strict';var ChatQueueEvents=require(_0x6d6d('0x0'));var events=[_0x6d6d('0x1'),_0x6d6d('0x2'),_0x6d6d('0x3')];function createListener(_0x536523,_0x2e1aed){return function(_0x3b743d){_0x2e1aed[_0x6d6d('0x4')](_0x536523,_0x3b743d);};}function removeListener(_0x2a838a,_0x5207c9){return function(){ChatQueueEvents[_0x6d6d('0x5')](_0x2a838a,_0x5207c9);};}exports[_0x6d6d('0x6')]=function(_0x5702dc){for(var _0x210ff7=0x0,_0x1bf731=events[_0x6d6d('0x7')];_0x210ff7<_0x1bf731;_0x210ff7++){var _0x18f824=events[_0x210ff7];var _0xd49f57=createListener(_0x6d6d('0x8')+_0x18f824,_0x5702dc);ChatQueueEvents['on'](_0x18f824,_0xd49f57);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 92d2d71..38a674a 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 _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3e74,0x175));var _0x43e7=function(_0x768316,_0x3cfdb2){_0x768316=_0x768316-0x0;var _0x3ee183=_0x3e74[_0x768316];return _0x3ee183;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router; \ No newline at end of file +var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x3be72b,_0x5a63f8){var _0x4b8677=function(_0x22654f){while(--_0x22654f){_0x3be72b['push'](_0x3be72b['shift']());}};_0x4b8677(++_0x5a63f8);}(_0x55ca,0x126));var _0xa55c=function(_0x4e71ac,_0x42aced){_0x4e71ac=_0x4e71ac-0x0;var _0x11d76c=_0x55ca[_0x4e71ac];return _0x11d76c;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index cc77c4c..aea8983 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 _0xe953=['DATE','moment','sequelize','STRING'];(function(_0xc1a4cf,_0x17141b){var _0x2930d1=function(_0x2e6e7a){while(--_0x2e6e7a){_0xc1a4cf['push'](_0xc1a4cf['shift']());}};_0x2930d1(++_0x17141b);}(_0xe953,0xc9));var _0x3e95=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0xe953[_0x4ae829];return _0x256b31;};'use strict';var moment=require(_0x3e95('0x0'));var Sequelize=require(_0x3e95('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x3e95('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x3e95('0x3')]},'leaveAt':{'type':Sequelize[_0x3e95('0x3')]},'acceptAt':{'type':Sequelize[_0x3e95('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x3e95('0x2')]}}; \ No newline at end of file +var _0x5770=['moment','sequelize','STRING','DATE'];(function(_0x113156,_0x58a687){var _0x1d8bb5=function(_0x4e45e6){while(--_0x4e45e6){_0x113156['push'](_0x113156['shift']());}};_0x1d8bb5(++_0x58a687);}(_0x5770,0x1b0));var _0x0577=function(_0x57a353,_0x21498d){_0x57a353=_0x57a353-0x0;var _0x4d1690=_0x5770[_0x57a353];return _0x4d1690;};'use strict';var moment=require(_0x0577('0x0'));var Sequelize=require(_0x0577('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x0577('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0577('0x2')]},'joinAt':{'type':Sequelize[_0x0577('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x0577('0x3')]},'exitAt':{'type':Sequelize[_0x0577('0x3')]},'reason':{'type':Sequelize[_0x0577('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index cfe3e61..5a3d906 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 _0xc1d3=['body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','ChatQueueReport','includeAll','include','findAll','rows','catch','show','find','create'];(function(_0x2c93e2,_0x4fb5e2){var _0x57264e=function(_0x386895){while(--_0x386895){_0x2c93e2['push'](_0x2c93e2['shift']());}};_0x57264e(++_0x4fb5e2);}(_0xc1d3,0x147));var _0x3c1d=function(_0x527b5f,_0xb7d2fb){_0x527b5f=_0x527b5f-0x0;var _0x354358=_0xc1d3[_0x527b5f];return _0x354358;};'use strict';var emlformat=require(_0x3c1d('0x0'));var rimraf=require(_0x3c1d('0x1'));var zipdir=require(_0x3c1d('0x2'));var jsonpatch=require(_0x3c1d('0x3'));var rp=require(_0x3c1d('0x4'));var moment=require(_0x3c1d('0x5'));var BPromise=require(_0x3c1d('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3c1d('0x7'));var sox=require(_0x3c1d('0x8'));var csv=require(_0x3c1d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3c1d('0xa'));var _=require(_0x3c1d('0xb'));var squel=require(_0x3c1d('0xc'));var crypto=require(_0x3c1d('0xd'));var jsforce=require(_0x3c1d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3c1d('0x9'));var querystring=require(_0x3c1d('0xf'));var Papa=require(_0x3c1d('0x10'));var Redis=require(_0x3c1d('0x11'));var authService=require(_0x3c1d('0x12'));var qs=require(_0x3c1d('0x13'));var as=require(_0x3c1d('0x14'));var hardwareService=require(_0x3c1d('0x15'));var logger=require('../../config/logger')(_0x3c1d('0x16'));var utils=require(_0x3c1d('0x17'));var config=require(_0x3c1d('0x18'));var licenseUtil=require(_0x3c1d('0x19'));var db=require(_0x3c1d('0x1a'))['db'];function respondWithStatusCode(_0x5a2402,_0xf3cd6d){_0xf3cd6d=_0xf3cd6d||0xcc;return function(_0x209b55){if(_0x209b55){return _0x5a2402['sendStatus'](_0xf3cd6d);}return _0x5a2402[_0x3c1d('0x1b')](_0xf3cd6d)['end']();};}function respondWithResult(_0x4ed530,_0x4b941d){_0x4b941d=_0x4b941d||0xc8;return function(_0x2875a9){if(_0x2875a9){return _0x4ed530[_0x3c1d('0x1b')](_0x4b941d)[_0x3c1d('0x1c')](_0x2875a9);}};}function respondWithFilteredResult(_0x434dbc,_0x2ed7af){return function(_0x2c0b83){if(_0x2c0b83){var _0x4e6157=typeof _0x2ed7af['offset']===_0x3c1d('0x1d')&&typeof _0x2ed7af['limit']===_0x3c1d('0x1d');var _0x295467=_0x2c0b83['count'];var _0x4a7e42=_0x4e6157?0x0:_0x2ed7af['offset'];var _0x33637d=_0x4e6157?_0x2c0b83[_0x3c1d('0x1e')]:_0x2ed7af[_0x3c1d('0x1f')]+_0x2ed7af[_0x3c1d('0x20')];var _0x9dce85;if(_0x33637d>=_0x295467){_0x33637d=_0x295467;_0x9dce85=0xc8;}else{_0x9dce85=0xce;}_0x434dbc['status'](_0x9dce85);return _0x434dbc['set'](_0x3c1d('0x21'),_0x4a7e42+'-'+_0x33637d+'/'+_0x295467)[_0x3c1d('0x1c')](_0x2c0b83);}return null;};}function patchUpdates(_0x3c7455){return function(_0x233dff){try{jsonpatch[_0x3c1d('0x22')](_0x233dff,_0x3c7455,!![]);}catch(_0x5b2720){return BPromise[_0x3c1d('0x23')](_0x5b2720);}return _0x233dff[_0x3c1d('0x24')]();};}function saveUpdates(_0xa5fd81,_0x5211d7){return function(_0x129497){if(_0x129497){return _0x129497[_0x3c1d('0x25')](_0xa5fd81)[_0x3c1d('0x26')](function(_0x210e9c){return _0x210e9c;});}return null;};}function removeEntity(_0x2e1af4,_0x1a853d){return function(_0x41a683){if(_0x41a683){return _0x41a683[_0x3c1d('0x27')]()[_0x3c1d('0x26')](function(){_0x2e1af4['status'](0xcc)[_0x3c1d('0x28')]();});}};}function handleEntityNotFound(_0x2a8854,_0x2078d5){return function(_0x4f7cd8){if(!_0x4f7cd8){_0x2a8854[_0x3c1d('0x29')](0x194);}return _0x4f7cd8;};}function handleError(_0x3bde45,_0x4e1f79){_0x4e1f79=_0x4e1f79||0x1f4;return function(_0x392bb1){logger[_0x3c1d('0x2a')](_0x392bb1[_0x3c1d('0x2b')]);if(_0x392bb1['name']){delete _0x392bb1[_0x3c1d('0x2c')];}_0x3bde45['status'](_0x4e1f79)[_0x3c1d('0x2d')](_0x392bb1);};}exports[_0x3c1d('0x2e')]=function(_0x59db0a,_0x4ff12a){var _0x356f61={},_0x2f7af9={},_0x93a3b1={'count':0x0,'rows':[]};var _0x52ab2b=_[_0x3c1d('0x2f')](db['ChatQueueReport'][_0x3c1d('0x30')],function(_0x438b09){return{'name':_0x438b09[_0x3c1d('0x31')],'type':_0x438b09['type'][_0x3c1d('0x32')]};});_0x2f7af9[_0x3c1d('0x33')]=_[_0x3c1d('0x2f')](_0x52ab2b,_0x3c1d('0x2c'));_0x2f7af9[_0x3c1d('0x34')]=_[_0x3c1d('0x35')](_0x59db0a[_0x3c1d('0x34')]);_0x2f7af9[_0x3c1d('0x36')]=_[_0x3c1d('0x37')](_0x2f7af9['model'],_0x2f7af9['query']);_0x356f61[_0x3c1d('0x38')]=_['intersection'](_0x2f7af9[_0x3c1d('0x33')],qs[_0x3c1d('0x39')](_0x59db0a[_0x3c1d('0x34')][_0x3c1d('0x39')]));_0x356f61[_0x3c1d('0x38')]=_0x356f61['attributes'][_0x3c1d('0x3a')]?_0x356f61[_0x3c1d('0x38')]:_0x2f7af9['model'];if(!_0x59db0a['query'][_0x3c1d('0x3b')](_0x3c1d('0x3c'))){_0x356f61[_0x3c1d('0x20')]=qs[_0x3c1d('0x20')](_0x59db0a[_0x3c1d('0x34')]['limit']);_0x356f61[_0x3c1d('0x1f')]=qs[_0x3c1d('0x1f')](_0x59db0a['query']['offset']);}_0x356f61['order']=qs[_0x3c1d('0x3d')](_0x59db0a[_0x3c1d('0x34')][_0x3c1d('0x3d')]);_0x356f61[_0x3c1d('0x3e')]=qs['filters'](_[_0x3c1d('0x3f')](_0x59db0a['query'],_0x2f7af9[_0x3c1d('0x36')]),_0x52ab2b);if(_0x59db0a[_0x3c1d('0x34')][_0x3c1d('0x40')]){_0x356f61[_0x3c1d('0x3e')]=_[_0x3c1d('0x41')](_0x356f61['where'],{'$or':_[_0x3c1d('0x2f')](_0x52ab2b,function(_0x28c575){if(_0x28c575[_0x3c1d('0x42')]!==_0x3c1d('0x43')){var _0x59c8fb={};_0x59c8fb[_0x28c575[_0x3c1d('0x2c')]]={'$like':'%'+_0x59db0a['query']['filter']+'%'};return _0x59c8fb;}})});}_0x356f61=_[_0x3c1d('0x41')]({},_0x356f61,_0x59db0a[_0x3c1d('0x44')]);var _0x58c490={'where':_0x356f61['where']};return db[_0x3c1d('0x45')][_0x3c1d('0x1e')](_0x58c490)['then'](function(_0x4f07d6){_0x93a3b1[_0x3c1d('0x1e')]=_0x4f07d6;if(_0x59db0a[_0x3c1d('0x34')][_0x3c1d('0x46')]){_0x356f61[_0x3c1d('0x47')]=[{'all':!![]}];}return db[_0x3c1d('0x45')][_0x3c1d('0x48')](_0x356f61);})[_0x3c1d('0x26')](function(_0x11bca2){_0x93a3b1[_0x3c1d('0x49')]=_0x11bca2;return _0x93a3b1;})[_0x3c1d('0x26')](respondWithFilteredResult(_0x4ff12a,_0x356f61))[_0x3c1d('0x4a')](handleError(_0x4ff12a,null));};exports[_0x3c1d('0x4b')]=function(_0x4b0f40,_0x21dbef){var _0x5ca02c={'raw':!![],'where':{'id':_0x4b0f40['params']['id']}},_0x415a61={};_0x415a61[_0x3c1d('0x33')]=_['keys'](db[_0x3c1d('0x45')][_0x3c1d('0x30')]);_0x415a61[_0x3c1d('0x34')]=_[_0x3c1d('0x35')](_0x4b0f40['query']);_0x415a61[_0x3c1d('0x36')]=_['intersection'](_0x415a61[_0x3c1d('0x33')],_0x415a61[_0x3c1d('0x34')]);_0x5ca02c[_0x3c1d('0x38')]=_[_0x3c1d('0x37')](_0x415a61['model'],qs[_0x3c1d('0x39')](_0x4b0f40[_0x3c1d('0x34')][_0x3c1d('0x39')]));_0x5ca02c[_0x3c1d('0x38')]=_0x5ca02c[_0x3c1d('0x38')]['length']?_0x5ca02c[_0x3c1d('0x38')]:_0x415a61[_0x3c1d('0x33')];if(_0x4b0f40[_0x3c1d('0x34')]['includeAll']){_0x5ca02c['include']=[{'all':!![]}];}_0x5ca02c=_[_0x3c1d('0x41')]({},_0x5ca02c,_0x4b0f40[_0x3c1d('0x44')]);return db[_0x3c1d('0x45')][_0x3c1d('0x4c')](_0x5ca02c)[_0x3c1d('0x26')](handleEntityNotFound(_0x21dbef,null))[_0x3c1d('0x26')](respondWithResult(_0x21dbef,null))['catch'](handleError(_0x21dbef,null));};exports[_0x3c1d('0x4d')]=function(_0x4c533e,_0x34ad3a){return db[_0x3c1d('0x45')][_0x3c1d('0x4d')](_0x4c533e[_0x3c1d('0x4e')],{})[_0x3c1d('0x26')](respondWithResult(_0x34ad3a,0xc9))[_0x3c1d('0x4a')](handleError(_0x34ad3a,null));};exports[_0x3c1d('0x25')]=function(_0x4f0b44,_0x576552){if(_0x4f0b44['body']['id']){delete _0x4f0b44[_0x3c1d('0x4e')]['id'];}return db[_0x3c1d('0x45')][_0x3c1d('0x4c')]({'where':{'id':_0x4f0b44[_0x3c1d('0x4f')]['id']}})[_0x3c1d('0x26')](handleEntityNotFound(_0x576552,null))[_0x3c1d('0x26')](saveUpdates(_0x4f0b44['body'],null))[_0x3c1d('0x26')](respondWithResult(_0x576552,null))[_0x3c1d('0x4a')](handleError(_0x576552,null));};exports['destroy']=function(_0x4bc4ac,_0x4302f3){return db[_0x3c1d('0x45')][_0x3c1d('0x4c')]({'where':{'id':_0x4bc4ac[_0x3c1d('0x4f')]['id']}})[_0x3c1d('0x26')](handleEntityNotFound(_0x4302f3,null))[_0x3c1d('0x26')](removeEntity(_0x4302f3,null))[_0x3c1d('0x4a')](handleError(_0x4302f3,null));};exports[_0x3c1d('0x50')]=function(_0x56d651,_0x21b8ef){return db['ChatQueueReport'][_0x3c1d('0x50')]()[_0x3c1d('0x26')](respondWithResult(_0x21b8ef,null))['catch'](handleError(_0x21b8ef,null));}; \ No newline at end of file +var _0xef96=['util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','save','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','ChatQueueReport','findAll','rows','show','params','intersection','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x1255d6,_0x481067){var _0x1397af=function(_0x59a5ad){while(--_0x59a5ad){_0x1255d6['push'](_0x1255d6['shift']());}};_0x1397af(++_0x481067);}(_0xef96,0x162));var _0x6ef9=function(_0x2e111f,_0xdca1a2){_0x2e111f=_0x2e111f-0x0;var _0x428e6f=_0xef96[_0x2e111f];return _0x428e6f;};'use strict';var emlformat=require(_0x6ef9('0x0'));var rimraf=require(_0x6ef9('0x1'));var zipdir=require(_0x6ef9('0x2'));var jsonpatch=require(_0x6ef9('0x3'));var rp=require(_0x6ef9('0x4'));var moment=require(_0x6ef9('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6ef9('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6ef9('0x7'));var ejs=require(_0x6ef9('0x8'));var fs=require('fs');var fs_extra=require(_0x6ef9('0x9'));var _=require('lodash');var squel=require(_0x6ef9('0xa'));var crypto=require('crypto');var jsforce=require(_0x6ef9('0xb'));var deskjs=require(_0x6ef9('0xc'));var toCsv=require(_0x6ef9('0x7'));var querystring=require('querystring');var Papa=require(_0x6ef9('0xd'));var Redis=require('ioredis');var authService=require(_0x6ef9('0xe'));var qs=require(_0x6ef9('0xf'));var as=require(_0x6ef9('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ef9('0x11'))(_0x6ef9('0x12'));var utils=require(_0x6ef9('0x13'));var config=require(_0x6ef9('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6ef9('0x15'))['db'];function respondWithStatusCode(_0x428156,_0x2e732f){_0x2e732f=_0x2e732f||0xcc;return function(_0x100591){if(_0x100591){return _0x428156[_0x6ef9('0x16')](_0x2e732f);}return _0x428156[_0x6ef9('0x17')](_0x2e732f)[_0x6ef9('0x18')]();};}function respondWithResult(_0x5e2fc1,_0x24681e){_0x24681e=_0x24681e||0xc8;return function(_0x2942bc){if(_0x2942bc){return _0x5e2fc1[_0x6ef9('0x17')](_0x24681e)[_0x6ef9('0x19')](_0x2942bc);}};}function respondWithFilteredResult(_0xce5672,_0x297af7){return function(_0x2c373c){if(_0x2c373c){var _0x253b13=typeof _0x297af7[_0x6ef9('0x1a')]==='undefined'&&typeof _0x297af7[_0x6ef9('0x1b')]===_0x6ef9('0x1c');var _0x4fac02=_0x2c373c['count'];var _0x1cb130=_0x253b13?0x0:_0x297af7['offset'];var _0x1855e1=_0x253b13?_0x2c373c[_0x6ef9('0x1d')]:_0x297af7[_0x6ef9('0x1a')]+_0x297af7[_0x6ef9('0x1b')];var _0x1d975c;if(_0x1855e1>=_0x4fac02){_0x1855e1=_0x4fac02;_0x1d975c=0xc8;}else{_0x1d975c=0xce;}_0xce5672[_0x6ef9('0x17')](_0x1d975c);return _0xce5672['set']('Content-Range',_0x1cb130+'-'+_0x1855e1+'/'+_0x4fac02)[_0x6ef9('0x19')](_0x2c373c);}return null;};}function patchUpdates(_0x243de4){return function(_0x587d43){try{jsonpatch[_0x6ef9('0x1e')](_0x587d43,_0x243de4,!![]);}catch(_0x3e74d2){return BPromise[_0x6ef9('0x1f')](_0x3e74d2);}return _0x587d43[_0x6ef9('0x20')]();};}function saveUpdates(_0x168cd5,_0x1ef6ee){return function(_0x404515){if(_0x404515){return _0x404515['update'](_0x168cd5)['then'](function(_0xae1b6e){return _0xae1b6e;});}return null;};}function removeEntity(_0x35bc5e,_0x4d664d){return function(_0x49faeb){if(_0x49faeb){return _0x49faeb[_0x6ef9('0x21')]()['then'](function(){_0x35bc5e[_0x6ef9('0x17')](0xcc)[_0x6ef9('0x18')]();});}};}function handleEntityNotFound(_0xdbc856,_0x383197){return function(_0x1bdb00){if(!_0x1bdb00){_0xdbc856[_0x6ef9('0x16')](0x194);}return _0x1bdb00;};}function handleError(_0x196ec0,_0x4f6c85){_0x4f6c85=_0x4f6c85||0x1f4;return function(_0x2e503b){logger['error'](_0x2e503b[_0x6ef9('0x22')]);if(_0x2e503b[_0x6ef9('0x23')]){delete _0x2e503b[_0x6ef9('0x23')];}_0x196ec0[_0x6ef9('0x17')](_0x4f6c85)[_0x6ef9('0x24')](_0x2e503b);};}exports[_0x6ef9('0x25')]=function(_0x212d32,_0x4eb696){var _0x57f6f9={},_0x569649={},_0x50750d={'count':0x0,'rows':[]};var _0x5e0a13=_[_0x6ef9('0x26')](db['ChatQueueReport'][_0x6ef9('0x27')],function(_0x5a8f0c){return{'name':_0x5a8f0c[_0x6ef9('0x28')],'type':_0x5a8f0c[_0x6ef9('0x29')][_0x6ef9('0x2a')]};});_0x569649[_0x6ef9('0x2b')]=_['map'](_0x5e0a13,_0x6ef9('0x23'));_0x569649[_0x6ef9('0x2c')]=_[_0x6ef9('0x2d')](_0x212d32['query']);_0x569649[_0x6ef9('0x2e')]=_['intersection'](_0x569649[_0x6ef9('0x2b')],_0x569649[_0x6ef9('0x2c')]);_0x57f6f9[_0x6ef9('0x2f')]=_['intersection'](_0x569649[_0x6ef9('0x2b')],qs[_0x6ef9('0x30')](_0x212d32['query'][_0x6ef9('0x30')]));_0x57f6f9[_0x6ef9('0x2f')]=_0x57f6f9[_0x6ef9('0x2f')][_0x6ef9('0x31')]?_0x57f6f9[_0x6ef9('0x2f')]:_0x569649[_0x6ef9('0x2b')];if(!_0x212d32['query']['hasOwnProperty']('nolimit')){_0x57f6f9['limit']=qs[_0x6ef9('0x1b')](_0x212d32['query']['limit']);_0x57f6f9[_0x6ef9('0x1a')]=qs[_0x6ef9('0x1a')](_0x212d32['query'][_0x6ef9('0x1a')]);}_0x57f6f9['order']=qs['sort'](_0x212d32[_0x6ef9('0x2c')][_0x6ef9('0x32')]);_0x57f6f9['where']=qs[_0x6ef9('0x2e')](_[_0x6ef9('0x33')](_0x212d32[_0x6ef9('0x2c')],_0x569649['filters']),_0x5e0a13);if(_0x212d32[_0x6ef9('0x2c')][_0x6ef9('0x34')]){_0x57f6f9[_0x6ef9('0x35')]=_[_0x6ef9('0x36')](_0x57f6f9['where'],{'$or':_[_0x6ef9('0x26')](_0x5e0a13,function(_0x2d6370){if(_0x2d6370['type']!==_0x6ef9('0x37')){var _0x305c34={};_0x305c34[_0x2d6370['name']]={'$like':'%'+_0x212d32[_0x6ef9('0x2c')][_0x6ef9('0x34')]+'%'};return _0x305c34;}})});}_0x57f6f9=_[_0x6ef9('0x36')]({},_0x57f6f9,_0x212d32[_0x6ef9('0x38')]);var _0x43a62b={'where':_0x57f6f9[_0x6ef9('0x35')]};return db['ChatQueueReport'][_0x6ef9('0x1d')](_0x43a62b)[_0x6ef9('0x39')](function(_0x5e275a){_0x50750d[_0x6ef9('0x1d')]=_0x5e275a;if(_0x212d32['query'][_0x6ef9('0x3a')]){_0x57f6f9[_0x6ef9('0x3b')]=[{'all':!![]}];}return db[_0x6ef9('0x3c')][_0x6ef9('0x3d')](_0x57f6f9);})[_0x6ef9('0x39')](function(_0x4e6f10){_0x50750d[_0x6ef9('0x3e')]=_0x4e6f10;return _0x50750d;})[_0x6ef9('0x39')](respondWithFilteredResult(_0x4eb696,_0x57f6f9))['catch'](handleError(_0x4eb696,null));};exports[_0x6ef9('0x3f')]=function(_0x150cf8,_0x42382e){var _0x335fbf={'raw':!![],'where':{'id':_0x150cf8[_0x6ef9('0x40')]['id']}},_0x4fcd39={};_0x4fcd39[_0x6ef9('0x2b')]=_[_0x6ef9('0x2d')](db[_0x6ef9('0x3c')][_0x6ef9('0x27')]);_0x4fcd39['query']=_['keys'](_0x150cf8['query']);_0x4fcd39[_0x6ef9('0x2e')]=_[_0x6ef9('0x41')](_0x4fcd39['model'],_0x4fcd39[_0x6ef9('0x2c')]);_0x335fbf[_0x6ef9('0x2f')]=_['intersection'](_0x4fcd39[_0x6ef9('0x2b')],qs['fields'](_0x150cf8[_0x6ef9('0x2c')][_0x6ef9('0x30')]));_0x335fbf[_0x6ef9('0x2f')]=_0x335fbf[_0x6ef9('0x2f')][_0x6ef9('0x31')]?_0x335fbf['attributes']:_0x4fcd39[_0x6ef9('0x2b')];if(_0x150cf8[_0x6ef9('0x2c')][_0x6ef9('0x3a')]){_0x335fbf[_0x6ef9('0x3b')]=[{'all':!![]}];}_0x335fbf=_[_0x6ef9('0x36')]({},_0x335fbf,_0x150cf8[_0x6ef9('0x38')]);return db['ChatQueueReport'][_0x6ef9('0x42')](_0x335fbf)[_0x6ef9('0x39')](handleEntityNotFound(_0x42382e,null))[_0x6ef9('0x39')](respondWithResult(_0x42382e,null))[_0x6ef9('0x43')](handleError(_0x42382e,null));};exports[_0x6ef9('0x44')]=function(_0xdf2b5b,_0x2d3d8e){return db['ChatQueueReport'][_0x6ef9('0x44')](_0xdf2b5b[_0x6ef9('0x45')],{})[_0x6ef9('0x39')](respondWithResult(_0x2d3d8e,0xc9))[_0x6ef9('0x43')](handleError(_0x2d3d8e,null));};exports[_0x6ef9('0x46')]=function(_0x397258,_0x22cd98){if(_0x397258[_0x6ef9('0x45')]['id']){delete _0x397258['body']['id'];}return db[_0x6ef9('0x3c')][_0x6ef9('0x42')]({'where':{'id':_0x397258['params']['id']}})[_0x6ef9('0x39')](handleEntityNotFound(_0x22cd98,null))['then'](saveUpdates(_0x397258[_0x6ef9('0x45')],null))[_0x6ef9('0x39')](respondWithResult(_0x22cd98,null))['catch'](handleError(_0x22cd98,null));};exports[_0x6ef9('0x21')]=function(_0x39f1a8,_0x17cac8){return db[_0x6ef9('0x3c')][_0x6ef9('0x42')]({'where':{'id':_0x39f1a8['params']['id']}})[_0x6ef9('0x39')](handleEntityNotFound(_0x17cac8,null))[_0x6ef9('0x39')](removeEntity(_0x17cac8,null))[_0x6ef9('0x43')](handleError(_0x17cac8,null));};exports[_0x6ef9('0x47')]=function(_0x303967,_0x1ea78b){return db['ChatQueueReport']['describe']()['then'](respondWithResult(_0x1ea78b,null))[_0x6ef9('0x43')](handleError(_0x1ea78b,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 86ee795..f79a643 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x522e32,_0x440e6d){var _0x216842=function(_0x467028){while(--_0x467028){_0x522e32['push'](_0x522e32['shift']());}};_0x216842(++_0x440e6d);}(_0xe706,0xa3));var _0x6e70=function(_0x3e0f20,_0x4c1204){_0x3e0f20=_0x3e0f20-0x0;var _0x4dc50e=_0xe706[_0x3e0f20];return _0x4dc50e;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x273987,_0x44056f){var _0x50ebc7=function(_0x4efbf0){while(--_0x4efbf0){_0x273987['push'](_0x273987['shift']());}};_0x50ebc7(++_0x44056f);}(_0xb10b,0x12a));var _0xbb10=function(_0x219935,_0x5b7d02){_0x219935=_0x219935-0x0;var _0x130409=_0xb10b[_0x219935];return _0x130409;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index d0aefc3..4b48619 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 _0x3b44=['create','body','options','raw','CreateChatQueueReport','update','where','attributes','limit','UpdateChatQueueReport','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch'];(function(_0x4efc91,_0x46c55f){var _0x25f684=function(_0x368f72){while(--_0x368f72){_0x4efc91['push'](_0x4efc91['shift']());}};_0x25f684(++_0x46c55f);}(_0x3b44,0xa0));var _0x43b4=function(_0x3d3411,_0x4aa338){_0x3d3411=_0x3d3411-0x0;var _0x421830=_0x3b44[_0x3d3411];return _0x421830;};'use strict';var _=require(_0x43b4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x43b4('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43b4('0x2'))['db'];var utils=require(_0x43b4('0x3'));var logger=require(_0x43b4('0x4'))(_0x43b4('0x5'));var config=require(_0x43b4('0x6'));var jayson=require(_0x43b4('0x7'));var client=jayson['client'][_0x43b4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a279a,_0x1e461f,_0x413dd5){return new BPromise(function(_0x4b4341,_0x25c3c8){return client['request'](_0x3a279a,_0x413dd5)[_0x43b4('0x9')](function(_0x2a95bb){logger[_0x43b4('0xa')](_0x43b4('0xb'),_0x1e461f,'request\x20sent');logger[_0x43b4('0xc')](_0x43b4('0xd'),_0x1e461f,'request\x20sent',JSON[_0x43b4('0xe')](_0x2a95bb));if(_0x2a95bb[_0x43b4('0xf')]){if(_0x2a95bb[_0x43b4('0xf')][_0x43b4('0x10')]===0x1f4){logger['error'](_0x43b4('0xb'),_0x1e461f,_0x2a95bb[_0x43b4('0xf')][_0x43b4('0x11')]);return _0x25c3c8(_0x2a95bb[_0x43b4('0xf')][_0x43b4('0x11')]);}logger[_0x43b4('0xf')](_0x43b4('0xb'),_0x1e461f,_0x2a95bb[_0x43b4('0xf')][_0x43b4('0x11')]);return _0x4b4341(_0x2a95bb[_0x43b4('0xf')][_0x43b4('0x11')]);}else{logger['info'](_0x43b4('0xb'),_0x1e461f,_0x43b4('0x12'));_0x4b4341(_0x2a95bb['result']['message']);}})[_0x43b4('0x13')](function(_0x3a5462){logger[_0x43b4('0xf')](_0x43b4('0xb'),_0x1e461f,_0x3a5462);_0x25c3c8(_0x3a5462);});});}exports['CreateChatQueueReport']=function(_0x2d4bd5){var _0x339757=this;return new Promise(function(_0x33b6e3,_0x3ffad0){return db['ChatQueueReport'][_0x43b4('0x14')](_0x2d4bd5[_0x43b4('0x15')],{'raw':_0x2d4bd5[_0x43b4('0x16')]?_0x2d4bd5[_0x43b4('0x16')][_0x43b4('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x143c27){logger[_0x43b4('0xa')]('CreateChatQueueReport',_0x2d4bd5);logger[_0x43b4('0xc')](_0x43b4('0x18'),_0x2d4bd5,JSON['stringify'](_0x143c27));_0x33b6e3(_0x143c27);})[_0x43b4('0x13')](function(_0x4e018b){logger[_0x43b4('0xf')](_0x43b4('0x18'),_0x4e018b[_0x43b4('0x11')],_0x2d4bd5);_0x3ffad0(_0x339757['error'](0x1f4,_0x4e018b[_0x43b4('0x11')]));});});};exports['UpdateChatQueueReport']=function(_0x42e1c9){var _0x7daca8=this;return new Promise(function(_0x239100,_0x13f6c0){return db['ChatQueueReport'][_0x43b4('0x19')](_0x42e1c9[_0x43b4('0x15')],{'raw':_0x42e1c9[_0x43b4('0x16')]?_0x42e1c9['options'][_0x43b4('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42e1c9['options']?_0x42e1c9[_0x43b4('0x16')][_0x43b4('0x1a')]||null:null,'attributes':_0x42e1c9['options']?_0x42e1c9[_0x43b4('0x16')][_0x43b4('0x1b')]||null:null,'limit':_0x42e1c9['options']?_0x42e1c9['options'][_0x43b4('0x1c')]||null:null})[_0x43b4('0x9')](function(_0x489bef){logger['info'](_0x43b4('0x1d'),_0x42e1c9);logger[_0x43b4('0xc')](_0x43b4('0x1d'),_0x42e1c9,JSON[_0x43b4('0xe')](_0x489bef));_0x239100(_0x489bef);})[_0x43b4('0x13')](function(_0x3f8b9b){logger[_0x43b4('0xf')]('UpdateChatQueueReport',_0x3f8b9b[_0x43b4('0x11')],_0x42e1c9);_0x13f6c0(_0x7daca8[_0x43b4('0xf')](0x1f4,_0x3f8b9b[_0x43b4('0x11')]));});});}; \ No newline at end of file +var _0xb72f=['limit','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','raw','then','stringify','UpdateChatQueueReport','update','options','where','attributes'];(function(_0x97820c,_0x2b6f84){var _0x4d1bfe=function(_0x558c1b){while(--_0x558c1b){_0x97820c['push'](_0x97820c['shift']());}};_0x4d1bfe(++_0x2b6f84);}(_0xb72f,0x161));var _0xfb72=function(_0x582f72,_0x886d8){_0x582f72=_0x582f72-0x0;var _0x4cd5fe=_0xb72f[_0x582f72];return _0x4cd5fe;};'use strict';var _=require(_0xfb72('0x0'));var util=require(_0xfb72('0x1'));var moment=require('moment');var BPromise=require(_0xfb72('0x2'));var rs=require(_0xfb72('0x3'));var fs=require('fs');var Redis=require(_0xfb72('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfb72('0x5'))(_0xfb72('0x6'));var config=require(_0xfb72('0x7'));var jayson=require(_0xfb72('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x195533,_0x5abebc,_0x4ebd26){return new BPromise(function(_0x29314f,_0x1a4f88){return client[_0xfb72('0x9')](_0x195533,_0x4ebd26)['then'](function(_0x4347ec){logger[_0xfb72('0xa')](_0xfb72('0xb'),_0x5abebc,_0xfb72('0xc'));logger[_0xfb72('0xd')](_0xfb72('0xe'),_0x5abebc,_0xfb72('0xc'),JSON['stringify'](_0x4347ec));if(_0x4347ec[_0xfb72('0xf')]){if(_0x4347ec['error'][_0xfb72('0x10')]===0x1f4){logger['error'](_0xfb72('0xb'),_0x5abebc,_0x4347ec[_0xfb72('0xf')]['message']);return _0x1a4f88(_0x4347ec[_0xfb72('0xf')]['message']);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x5abebc,_0x4347ec['error'][_0xfb72('0x11')]);return _0x29314f(_0x4347ec[_0xfb72('0xf')][_0xfb72('0x11')]);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x5abebc,_0xfb72('0xc'));_0x29314f(_0x4347ec['result']['message']);}})[_0xfb72('0x12')](function(_0x595051){logger[_0xfb72('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x5abebc,_0x595051);_0x1a4f88(_0x595051);});});}exports[_0xfb72('0x13')]=function(_0x55cba4){var _0x159be0=this;return new Promise(function(_0x4f1067,_0x41d331){return db[_0xfb72('0x14')][_0xfb72('0x15')](_0x55cba4[_0xfb72('0x16')],{'raw':_0x55cba4['options']?_0x55cba4['options'][_0xfb72('0x17')]===undefined?!![]:![]:!![]})[_0xfb72('0x18')](function(_0x513632){logger[_0xfb72('0xa')](_0xfb72('0x13'),_0x55cba4);logger[_0xfb72('0xd')](_0xfb72('0x13'),_0x55cba4,JSON[_0xfb72('0x19')](_0x513632));_0x4f1067(_0x513632);})[_0xfb72('0x12')](function(_0x351e16){logger[_0xfb72('0xf')](_0xfb72('0x13'),_0x351e16[_0xfb72('0x11')],_0x55cba4);_0x41d331(_0x159be0[_0xfb72('0xf')](0x1f4,_0x351e16[_0xfb72('0x11')]));});});};exports[_0xfb72('0x1a')]=function(_0x85146f){var _0x2d85bd=this;return new Promise(function(_0x40e1b2,_0x30c6f6){return db[_0xfb72('0x14')][_0xfb72('0x1b')](_0x85146f[_0xfb72('0x16')],{'raw':_0x85146f['options']?_0x85146f[_0xfb72('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x85146f[_0xfb72('0x1c')]?_0x85146f['options'][_0xfb72('0x1d')]||null:null,'attributes':_0x85146f[_0xfb72('0x1c')]?_0x85146f[_0xfb72('0x1c')][_0xfb72('0x1e')]||null:null,'limit':_0x85146f[_0xfb72('0x1c')]?_0x85146f[_0xfb72('0x1c')][_0xfb72('0x1f')]||null:null})['then'](function(_0x529430){logger[_0xfb72('0xa')](_0xfb72('0x1a'),_0x85146f);logger[_0xfb72('0xd')](_0xfb72('0x1a'),_0x85146f,JSON['stringify'](_0x529430));_0x40e1b2(_0x529430);})[_0xfb72('0x12')](function(_0x39d55b){logger[_0xfb72('0xf')]('UpdateChatQueueReport',_0x39d55b[_0xfb72('0x11')],_0x85146f);_0x30c6f6(_0x2d85bd[_0xfb72('0xf')](0x1f4,_0x39d55b[_0xfb72('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index c3ec1eb..c545af5 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 _0x72fe=['exports','util','path','express','Router','fs-extra','../../components/interaction/service','./chatQueueReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x72fe,0x13c));var _0xe72f=function(_0x193afb,_0x44d2f3){_0x193afb=_0x193afb-0x0;var _0x59a697=_0x72fe[_0x193afb];return _0x59a697;};'use strict';var multer=require('multer');var util=require(_0xe72f('0x0'));var path=require(_0xe72f('0x1'));var timeout=require('connect-timeout');var express=require(_0xe72f('0x2'));var router=express[_0xe72f('0x3')]();var fs_extra=require(_0xe72f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe72f('0x5'));var config=require('../../config/environment');var controller=require(_0xe72f('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xe72f('0x7')]);router[_0xe72f('0x8')](_0xe72f('0x9'),auth[_0xe72f('0xa')](),controller[_0xe72f('0xb')]);router[_0xe72f('0x8')](_0xe72f('0xc'),auth[_0xe72f('0xa')](),controller[_0xe72f('0xd')]);router[_0xe72f('0xe')]('/',auth[_0xe72f('0xa')](),controller[_0xe72f('0xf')]);router[_0xe72f('0x10')](_0xe72f('0xc'),auth[_0xe72f('0xa')](),controller[_0xe72f('0x11')]);router[_0xe72f('0x12')](_0xe72f('0xc'),auth[_0xe72f('0xa')](),controller[_0xe72f('0x13')]);module[_0xe72f('0x14')]=router; \ No newline at end of file +var _0x3d9a=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','put','update','/:id','exports','multer'];(function(_0x5e2f80,_0x2afd67){var _0x15d05e=function(_0x52251d){while(--_0x52251d){_0x5e2f80['push'](_0x5e2f80['shift']());}};_0x15d05e(++_0x2afd67);}(_0x3d9a,0x18e));var _0xa3d9=function(_0x570e1,_0x5579e1){_0x570e1=_0x570e1-0x0;var _0x4b9f83=_0x3d9a[_0x570e1];return _0x4b9f83;};'use strict';var multer=require(_0xa3d9('0x0'));var util=require(_0xa3d9('0x1'));var path=require('path');var timeout=require(_0xa3d9('0x2'));var express=require(_0xa3d9('0x3'));var router=express[_0xa3d9('0x4')]();var fs_extra=require(_0xa3d9('0x5'));var auth=require(_0xa3d9('0x6'));var interaction=require(_0xa3d9('0x7'));var config=require(_0xa3d9('0x8'));var controller=require(_0xa3d9('0x9'));router[_0xa3d9('0xa')]('/',auth[_0xa3d9('0xb')](),controller[_0xa3d9('0xc')]);router['get'](_0xa3d9('0xd'),auth[_0xa3d9('0xb')](),controller[_0xa3d9('0xe')]);router[_0xa3d9('0xa')]('/:id',auth[_0xa3d9('0xb')](),controller[_0xa3d9('0xf')]);router[_0xa3d9('0x10')]('/',auth[_0xa3d9('0xb')](),controller['create']);router[_0xa3d9('0x11')]('/:id',auth[_0xa3d9('0xb')](),controller[_0xa3d9('0x12')]);router['delete'](_0xa3d9('0x13'),auth[_0xa3d9('0xb')](),controller['destroy']);module[_0xa3d9('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 37501c6..9c7f0d4 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x51e310,_0x23fb7d){var _0x590a6b=function(_0x5913d1){while(--_0x5913d1){_0x51e310['push'](_0x51e310['shift']());}};_0x590a6b(++_0x23fb7d);}(_0xedd9,0xfc));var _0x9edd=function(_0x8a0f1b,_0x2d4e7c){_0x8a0f1b=_0x8a0f1b-0x0;var _0x4af837=_0xedd9[_0x8a0f1b];return _0x4af837;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x40176b,_0x168e9f){var _0x874f78=function(_0x241b18){while(--_0x241b18){_0x40176b['push'](_0x40176b['shift']());}};_0x874f78(++_0x168e9f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 7e04227..c67ec7b 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 _0x1711=['apply','save','update','then','end','error','name','send','map','ChatTransferReport','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','length','catch','create','body','find','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1711,0x1e9));var _0x1171=function(_0x1d9fb2,_0x10540c){_0x1d9fb2=_0x1d9fb2-0x0;var _0x1cc6bb=_0x1711[_0x1d9fb2];return _0x1cc6bb;};'use strict';var emlformat=require(_0x1171('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1171('0x1'));var jsonpatch=require(_0x1171('0x2'));var rp=require(_0x1171('0x3'));var moment=require(_0x1171('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1171('0x5'));var util=require('util');var path=require(_0x1171('0x6'));var sox=require(_0x1171('0x7'));var csv=require(_0x1171('0x8'));var ejs=require(_0x1171('0x9'));var fs=require('fs');var fs_extra=require(_0x1171('0xa'));var _=require(_0x1171('0xb'));var squel=require(_0x1171('0xc'));var crypto=require(_0x1171('0xd'));var jsforce=require(_0x1171('0xe'));var deskjs=require(_0x1171('0xf'));var toCsv=require(_0x1171('0x8'));var querystring=require('querystring');var Papa=require(_0x1171('0x10'));var Redis=require(_0x1171('0x11'));var authService=require(_0x1171('0x12'));var qs=require(_0x1171('0x13'));var as=require(_0x1171('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1171('0x15'))(_0x1171('0x16'));var utils=require(_0x1171('0x17'));var config=require(_0x1171('0x18'));var licenseUtil=require(_0x1171('0x19'));var db=require(_0x1171('0x1a'))['db'];function respondWithStatusCode(_0x1fa717,_0x1a92bd){_0x1a92bd=_0x1a92bd||0xcc;return function(_0x557eaa){if(_0x557eaa){return _0x1fa717[_0x1171('0x1b')](_0x1a92bd);}return _0x1fa717[_0x1171('0x1c')](_0x1a92bd)['end']();};}function respondWithResult(_0x20bcb4,_0x1039c8){_0x1039c8=_0x1039c8||0xc8;return function(_0x522e49){if(_0x522e49){return _0x20bcb4[_0x1171('0x1c')](_0x1039c8)[_0x1171('0x1d')](_0x522e49);}};}function respondWithFilteredResult(_0x275488,_0x32b597){return function(_0x56bfc7){if(_0x56bfc7){var _0x176cf9=typeof _0x32b597[_0x1171('0x1e')]===_0x1171('0x1f')&&typeof _0x32b597[_0x1171('0x20')]===_0x1171('0x1f');var _0x1c8c0c=_0x56bfc7[_0x1171('0x21')];var _0x7107bd=_0x176cf9?0x0:_0x32b597[_0x1171('0x1e')];var _0x2541a6=_0x176cf9?_0x56bfc7['count']:_0x32b597['offset']+_0x32b597[_0x1171('0x20')];var _0x17be1c;if(_0x2541a6>=_0x1c8c0c){_0x2541a6=_0x1c8c0c;_0x17be1c=0xc8;}else{_0x17be1c=0xce;}_0x275488[_0x1171('0x1c')](_0x17be1c);return _0x275488[_0x1171('0x22')](_0x1171('0x23'),_0x7107bd+'-'+_0x2541a6+'/'+_0x1c8c0c)[_0x1171('0x1d')](_0x56bfc7);}return null;};}function patchUpdates(_0x34454e){return function(_0x512ce7){try{jsonpatch[_0x1171('0x24')](_0x512ce7,_0x34454e,!![]);}catch(_0x3c8244){return BPromise['reject'](_0x3c8244);}return _0x512ce7[_0x1171('0x25')]();};}function saveUpdates(_0x341e3b,_0x5790d7){return function(_0x54432f){if(_0x54432f){return _0x54432f[_0x1171('0x26')](_0x341e3b)[_0x1171('0x27')](function(_0x32dcfb){return _0x32dcfb;});}return null;};}function removeEntity(_0x100c12,_0xb296dc){return function(_0x4ce47f){if(_0x4ce47f){return _0x4ce47f['destroy']()[_0x1171('0x27')](function(){_0x100c12[_0x1171('0x1c')](0xcc)[_0x1171('0x28')]();});}};}function handleEntityNotFound(_0x1e9732,_0x59c502){return function(_0x4987c4){if(!_0x4987c4){_0x1e9732['sendStatus'](0x194);}return _0x4987c4;};}function handleError(_0x381901,_0x590080){_0x590080=_0x590080||0x1f4;return function(_0x2c47c9){logger[_0x1171('0x29')](_0x2c47c9['stack']);if(_0x2c47c9[_0x1171('0x2a')]){delete _0x2c47c9['name'];}_0x381901['status'](_0x590080)[_0x1171('0x2b')](_0x2c47c9);};}exports['index']=function(_0x5d28a0,_0x470e2a){var _0x4fbd2a={},_0x5c08d2={},_0x251d67={'count':0x0,'rows':[]};var _0x239db7=_[_0x1171('0x2c')](db[_0x1171('0x2d')][_0x1171('0x2e')],function(_0x4fcb60){return{'name':_0x4fcb60['fieldName'],'type':_0x4fcb60[_0x1171('0x2f')]['key']};});_0x5c08d2[_0x1171('0x30')]=_[_0x1171('0x2c')](_0x239db7,_0x1171('0x2a'));_0x5c08d2[_0x1171('0x31')]=_[_0x1171('0x32')](_0x5d28a0['query']);_0x5c08d2[_0x1171('0x33')]=_['intersection'](_0x5c08d2[_0x1171('0x30')],_0x5c08d2['query']);_0x4fbd2a[_0x1171('0x34')]=_[_0x1171('0x35')](_0x5c08d2[_0x1171('0x30')],qs[_0x1171('0x36')](_0x5d28a0[_0x1171('0x31')][_0x1171('0x36')]));_0x4fbd2a[_0x1171('0x34')]=_0x4fbd2a[_0x1171('0x34')]['length']?_0x4fbd2a['attributes']:_0x5c08d2[_0x1171('0x30')];if(!_0x5d28a0[_0x1171('0x31')][_0x1171('0x37')]('nolimit')){_0x4fbd2a['limit']=qs[_0x1171('0x20')](_0x5d28a0['query']['limit']);_0x4fbd2a['offset']=qs[_0x1171('0x1e')](_0x5d28a0['query']['offset']);}_0x4fbd2a['order']=qs[_0x1171('0x38')](_0x5d28a0['query'][_0x1171('0x38')]);_0x4fbd2a[_0x1171('0x39')]=qs[_0x1171('0x33')](_[_0x1171('0x3a')](_0x5d28a0[_0x1171('0x31')],_0x5c08d2[_0x1171('0x33')]),_0x239db7);if(_0x5d28a0[_0x1171('0x31')][_0x1171('0x3b')]){_0x4fbd2a[_0x1171('0x39')]=_[_0x1171('0x3c')](_0x4fbd2a['where'],{'$or':_['map'](_0x239db7,function(_0x2ae563){if(_0x2ae563[_0x1171('0x2f')]!==_0x1171('0x3d')){var _0x27ba34={};_0x27ba34[_0x2ae563['name']]={'$like':'%'+_0x5d28a0[_0x1171('0x31')][_0x1171('0x3b')]+'%'};return _0x27ba34;}})});}_0x4fbd2a=_[_0x1171('0x3c')]({},_0x4fbd2a,_0x5d28a0[_0x1171('0x3e')]);var _0x539ccf={'where':_0x4fbd2a[_0x1171('0x39')]};return db[_0x1171('0x2d')][_0x1171('0x21')](_0x539ccf)[_0x1171('0x27')](function(_0x2e1df0){_0x251d67[_0x1171('0x21')]=_0x2e1df0;if(_0x5d28a0[_0x1171('0x31')][_0x1171('0x3f')]){_0x4fbd2a[_0x1171('0x40')]=[{'all':!![]}];}return db[_0x1171('0x2d')]['findAll'](_0x4fbd2a);})[_0x1171('0x27')](function(_0x15b362){_0x251d67[_0x1171('0x41')]=_0x15b362;return _0x251d67;})[_0x1171('0x27')](respondWithFilteredResult(_0x470e2a,_0x4fbd2a))['catch'](handleError(_0x470e2a,null));};exports[_0x1171('0x42')]=function(_0x5d42dc,_0xe57792){var _0x3ba110={'raw':!![],'where':{'id':_0x5d42dc[_0x1171('0x43')]['id']}},_0x4903cc={};_0x4903cc[_0x1171('0x30')]=_[_0x1171('0x32')](db[_0x1171('0x2d')][_0x1171('0x2e')]);_0x4903cc[_0x1171('0x31')]=_[_0x1171('0x32')](_0x5d42dc[_0x1171('0x31')]);_0x4903cc[_0x1171('0x33')]=_[_0x1171('0x35')](_0x4903cc[_0x1171('0x30')],_0x4903cc[_0x1171('0x31')]);_0x3ba110[_0x1171('0x34')]=_[_0x1171('0x35')](_0x4903cc[_0x1171('0x30')],qs['fields'](_0x5d42dc[_0x1171('0x31')]['fields']));_0x3ba110[_0x1171('0x34')]=_0x3ba110['attributes'][_0x1171('0x44')]?_0x3ba110[_0x1171('0x34')]:_0x4903cc[_0x1171('0x30')];if(_0x5d42dc[_0x1171('0x31')][_0x1171('0x3f')]){_0x3ba110[_0x1171('0x40')]=[{'all':!![]}];}_0x3ba110=_[_0x1171('0x3c')]({},_0x3ba110,_0x5d42dc[_0x1171('0x3e')]);return db[_0x1171('0x2d')]['find'](_0x3ba110)['then'](handleEntityNotFound(_0xe57792,null))[_0x1171('0x27')](respondWithResult(_0xe57792,null))[_0x1171('0x45')](handleError(_0xe57792,null));};exports[_0x1171('0x46')]=function(_0x2ae869,_0x47ff3d){return db[_0x1171('0x2d')][_0x1171('0x46')](_0x2ae869[_0x1171('0x47')],{})['then'](respondWithResult(_0x47ff3d,0xc9))['catch'](handleError(_0x47ff3d,null));};exports[_0x1171('0x26')]=function(_0x2a0658,_0x4871f8){if(_0x2a0658['body']['id']){delete _0x2a0658[_0x1171('0x47')]['id'];}return db[_0x1171('0x2d')][_0x1171('0x48')]({'where':{'id':_0x2a0658[_0x1171('0x43')]['id']}})['then'](handleEntityNotFound(_0x4871f8,null))[_0x1171('0x27')](saveUpdates(_0x2a0658['body'],null))['then'](respondWithResult(_0x4871f8,null))[_0x1171('0x45')](handleError(_0x4871f8,null));};exports[_0x1171('0x49')]=function(_0x8b0eeb,_0x28c701){return db[_0x1171('0x2d')][_0x1171('0x48')]({'where':{'id':_0x8b0eeb['params']['id']}})[_0x1171('0x27')](handleEntityNotFound(_0x28c701,null))[_0x1171('0x27')](removeEntity(_0x28c701,null))[_0x1171('0x45')](handleError(_0x28c701,null));};exports[_0x1171('0x4a')]=function(_0x1a323b,_0x5ae70b){return db['ChatTransferReport']['describe']()['then'](respondWithResult(_0x5ae70b,null))[_0x1171('0x45')](handleError(_0x5ae70b,null));}; \ No newline at end of file +var _0x1f05=['body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','includeAll','include','catch','show','params','length','merge','options','find','create'];(function(_0x3d0716,_0x139260){var _0x4aa768=function(_0xa4426a){while(--_0xa4426a){_0x3d0716['push'](_0x3d0716['shift']());}};_0x4aa768(++_0x139260);}(_0x1f05,0x98));var _0x51f0=function(_0x314bdc,_0x17962d){_0x314bdc=_0x314bdc-0x0;var _0x173802=_0x1f05[_0x314bdc];return _0x173802;};'use strict';var emlformat=require(_0x51f0('0x0'));var rimraf=require(_0x51f0('0x1'));var zipdir=require(_0x51f0('0x2'));var jsonpatch=require(_0x51f0('0x3'));var rp=require('request-promise');var moment=require(_0x51f0('0x4'));var BPromise=require(_0x51f0('0x5'));var Mustache=require(_0x51f0('0x6'));var util=require(_0x51f0('0x7'));var path=require(_0x51f0('0x8'));var sox=require(_0x51f0('0x9'));var csv=require(_0x51f0('0xa'));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(_0x51f0('0xb'));var deskjs=require(_0x51f0('0xc'));var toCsv=require(_0x51f0('0xa'));var querystring=require('querystring');var Papa=require(_0x51f0('0xd'));var Redis=require(_0x51f0('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x51f0('0xf'));var as=require(_0x51f0('0x10'));var hardwareService=require(_0x51f0('0x11'));var logger=require(_0x51f0('0x12'))(_0x51f0('0x13'));var utils=require(_0x51f0('0x14'));var config=require(_0x51f0('0x15'));var licenseUtil=require(_0x51f0('0x16'));var db=require(_0x51f0('0x17'))['db'];function respondWithStatusCode(_0x812595,_0x2f940b){_0x2f940b=_0x2f940b||0xcc;return function(_0x5f25da){if(_0x5f25da){return _0x812595['sendStatus'](_0x2f940b);}return _0x812595[_0x51f0('0x18')](_0x2f940b)[_0x51f0('0x19')]();};}function respondWithResult(_0x8cd28,_0x369850){_0x369850=_0x369850||0xc8;return function(_0x54f490){if(_0x54f490){return _0x8cd28[_0x51f0('0x18')](_0x369850)[_0x51f0('0x1a')](_0x54f490);}};}function respondWithFilteredResult(_0x412f57,_0x45b31){return function(_0x4fc254){if(_0x4fc254){var _0x49d042=typeof _0x45b31['offset']===_0x51f0('0x1b')&&typeof _0x45b31[_0x51f0('0x1c')]==='undefined';var _0x8caa4b=_0x4fc254['count'];var _0x536d7b=_0x49d042?0x0:_0x45b31[_0x51f0('0x1d')];var _0x5b781f=_0x49d042?_0x4fc254[_0x51f0('0x1e')]:_0x45b31['offset']+_0x45b31[_0x51f0('0x1c')];var _0x391094;if(_0x5b781f>=_0x8caa4b){_0x5b781f=_0x8caa4b;_0x391094=0xc8;}else{_0x391094=0xce;}_0x412f57[_0x51f0('0x18')](_0x391094);return _0x412f57[_0x51f0('0x1f')](_0x51f0('0x20'),_0x536d7b+'-'+_0x5b781f+'/'+_0x8caa4b)[_0x51f0('0x1a')](_0x4fc254);}return null;};}function patchUpdates(_0xd5cfda){return function(_0x11bc74){try{jsonpatch['apply'](_0x11bc74,_0xd5cfda,!![]);}catch(_0x1f99c4){return BPromise[_0x51f0('0x21')](_0x1f99c4);}return _0x11bc74[_0x51f0('0x22')]();};}function saveUpdates(_0x4f90fc,_0x36eb6a){return function(_0x537567){if(_0x537567){return _0x537567[_0x51f0('0x23')](_0x4f90fc)[_0x51f0('0x24')](function(_0x51603f){return _0x51603f;});}return null;};}function removeEntity(_0x2d1c49,_0x522ab3){return function(_0x58b04f){if(_0x58b04f){return _0x58b04f[_0x51f0('0x25')]()['then'](function(){_0x2d1c49['status'](0xcc)[_0x51f0('0x19')]();});}};}function handleEntityNotFound(_0x290a6e,_0x2d6633){return function(_0x3c39c0){if(!_0x3c39c0){_0x290a6e[_0x51f0('0x26')](0x194);}return _0x3c39c0;};}function handleError(_0x318985,_0x557de8){_0x557de8=_0x557de8||0x1f4;return function(_0x4c7627){logger[_0x51f0('0x27')](_0x4c7627[_0x51f0('0x28')]);if(_0x4c7627[_0x51f0('0x29')]){delete _0x4c7627[_0x51f0('0x29')];}_0x318985[_0x51f0('0x18')](_0x557de8)[_0x51f0('0x2a')](_0x4c7627);};}exports[_0x51f0('0x2b')]=function(_0x5f3c86,_0xeebe6a){var _0x2f0922={},_0x18dedf={},_0x31b53a={'count':0x0,'rows':[]};var _0x40c54f=_[_0x51f0('0x2c')](db[_0x51f0('0x2d')][_0x51f0('0x2e')],function(_0x516824){return{'name':_0x516824[_0x51f0('0x2f')],'type':_0x516824[_0x51f0('0x30')][_0x51f0('0x31')]};});_0x18dedf['model']=_[_0x51f0('0x2c')](_0x40c54f,_0x51f0('0x29'));_0x18dedf[_0x51f0('0x32')]=_[_0x51f0('0x33')](_0x5f3c86[_0x51f0('0x32')]);_0x18dedf['filters']=_[_0x51f0('0x34')](_0x18dedf[_0x51f0('0x35')],_0x18dedf[_0x51f0('0x32')]);_0x2f0922[_0x51f0('0x36')]=_[_0x51f0('0x34')](_0x18dedf['model'],qs[_0x51f0('0x37')](_0x5f3c86['query'][_0x51f0('0x37')]));_0x2f0922[_0x51f0('0x36')]=_0x2f0922[_0x51f0('0x36')]['length']?_0x2f0922['attributes']:_0x18dedf['model'];if(!_0x5f3c86[_0x51f0('0x32')][_0x51f0('0x38')]('nolimit')){_0x2f0922[_0x51f0('0x1c')]=qs[_0x51f0('0x1c')](_0x5f3c86['query'][_0x51f0('0x1c')]);_0x2f0922['offset']=qs['offset'](_0x5f3c86[_0x51f0('0x32')]['offset']);}_0x2f0922['order']=qs['sort'](_0x5f3c86['query'][_0x51f0('0x39')]);_0x2f0922[_0x51f0('0x3a')]=qs[_0x51f0('0x3b')](_[_0x51f0('0x3c')](_0x5f3c86[_0x51f0('0x32')],_0x18dedf['filters']),_0x40c54f);if(_0x5f3c86['query'][_0x51f0('0x3d')]){_0x2f0922['where']=_['merge'](_0x2f0922[_0x51f0('0x3a')],{'$or':_[_0x51f0('0x2c')](_0x40c54f,function(_0x2f39f5){if(_0x2f39f5[_0x51f0('0x30')]!==_0x51f0('0x3e')){var _0x128a81={};_0x128a81[_0x2f39f5[_0x51f0('0x29')]]={'$like':'%'+_0x5f3c86[_0x51f0('0x32')][_0x51f0('0x3d')]+'%'};return _0x128a81;}})});}_0x2f0922=_['merge']({},_0x2f0922,_0x5f3c86['options']);var _0x48bbb9={'where':_0x2f0922[_0x51f0('0x3a')]};return db[_0x51f0('0x2d')][_0x51f0('0x1e')](_0x48bbb9)['then'](function(_0x22d1b6){_0x31b53a[_0x51f0('0x1e')]=_0x22d1b6;if(_0x5f3c86['query'][_0x51f0('0x3f')]){_0x2f0922[_0x51f0('0x40')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x2f0922);})[_0x51f0('0x24')](function(_0x14a902){_0x31b53a['rows']=_0x14a902;return _0x31b53a;})[_0x51f0('0x24')](respondWithFilteredResult(_0xeebe6a,_0x2f0922))[_0x51f0('0x41')](handleError(_0xeebe6a,null));};exports[_0x51f0('0x42')]=function(_0x2ee132,_0x30b719){var _0x4e7e47={'raw':!![],'where':{'id':_0x2ee132[_0x51f0('0x43')]['id']}},_0x11d779={};_0x11d779[_0x51f0('0x35')]=_[_0x51f0('0x33')](db[_0x51f0('0x2d')][_0x51f0('0x2e')]);_0x11d779[_0x51f0('0x32')]=_[_0x51f0('0x33')](_0x2ee132[_0x51f0('0x32')]);_0x11d779[_0x51f0('0x3b')]=_[_0x51f0('0x34')](_0x11d779[_0x51f0('0x35')],_0x11d779['query']);_0x4e7e47[_0x51f0('0x36')]=_[_0x51f0('0x34')](_0x11d779[_0x51f0('0x35')],qs[_0x51f0('0x37')](_0x2ee132['query']['fields']));_0x4e7e47[_0x51f0('0x36')]=_0x4e7e47['attributes'][_0x51f0('0x44')]?_0x4e7e47[_0x51f0('0x36')]:_0x11d779['model'];if(_0x2ee132[_0x51f0('0x32')][_0x51f0('0x3f')]){_0x4e7e47[_0x51f0('0x40')]=[{'all':!![]}];}_0x4e7e47=_[_0x51f0('0x45')]({},_0x4e7e47,_0x2ee132[_0x51f0('0x46')]);return db[_0x51f0('0x2d')][_0x51f0('0x47')](_0x4e7e47)[_0x51f0('0x24')](handleEntityNotFound(_0x30b719,null))[_0x51f0('0x24')](respondWithResult(_0x30b719,null))['catch'](handleError(_0x30b719,null));};exports['create']=function(_0x5e9596,_0x300564){return db['ChatTransferReport'][_0x51f0('0x48')](_0x5e9596[_0x51f0('0x49')],{})[_0x51f0('0x24')](respondWithResult(_0x300564,0xc9))[_0x51f0('0x41')](handleError(_0x300564,null));};exports[_0x51f0('0x23')]=function(_0x6fddc3,_0x437384){if(_0x6fddc3[_0x51f0('0x49')]['id']){delete _0x6fddc3[_0x51f0('0x49')]['id'];}return db[_0x51f0('0x2d')]['find']({'where':{'id':_0x6fddc3['params']['id']}})[_0x51f0('0x24')](handleEntityNotFound(_0x437384,null))['then'](saveUpdates(_0x6fddc3[_0x51f0('0x49')],null))[_0x51f0('0x24')](respondWithResult(_0x437384,null))[_0x51f0('0x41')](handleError(_0x437384,null));};exports['destroy']=function(_0x154d10,_0x132fe7){return db[_0x51f0('0x2d')][_0x51f0('0x47')]({'where':{'id':_0x154d10['params']['id']}})[_0x51f0('0x24')](handleEntityNotFound(_0x132fe7,null))['then'](removeEntity(_0x132fe7,null))['catch'](handleError(_0x132fe7,null));};exports['describe']=function(_0x2d01b5,_0x13dfb6){return db[_0x51f0('0x2d')][_0x51f0('0x4a')]()[_0x51f0('0x24')](respondWithResult(_0x13dfb6,null))[_0x51f0('0x41')](handleError(_0x13dfb6,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 0e6e982..1033e91 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 _0xbd25=['uniqueid','../../config/logger','api','request-promise','path','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer'];(function(_0x32382c,_0x4e2dac){var _0x7ee9be=function(_0x2c773d){while(--_0x2c773d){_0x32382c['push'](_0x32382c['shift']());}};_0x7ee9be(++_0x4e2dac);}(_0xbd25,0x65));var _0x5bd2=function(_0xd6a0c2,_0x4e66af){_0xd6a0c2=_0xd6a0c2-0x0;var _0x39b3ae=_0xbd25[_0xd6a0c2];return _0x39b3ae;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5bd2('0x0'))(_0x5bd2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5bd2('0x2'));var fs=require('fs');var path=require(_0x5bd2('0x3'));var rimraf=require('rimraf');var config=require(_0x5bd2('0x4'));var attributes=require(_0x5bd2('0x5'));module[_0x5bd2('0x6')]=function(_0x504873,_0xcba353){return _0x504873['define'](_0x5bd2('0x7'),attributes,{'tableName':_0x5bd2('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5bd2('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xede9=['lodash','util','../../config/logger','api','moment','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid'];(function(_0x3d8fd8,_0x6ab03e){var _0x4d9124=function(_0x1f6917){while(--_0x1f6917){_0x3d8fd8['push'](_0x3d8fd8['shift']());}};_0x4d9124(++_0x6ab03e);}(_0xede9,0x1e0));var _0x9ede=function(_0x2424ee,_0x2dee67){_0x2424ee=_0x2424ee-0x0;var _0x57acb4=_0xede9[_0x2424ee];return _0x57acb4;};'use strict';var _=require(_0x9ede('0x0'));var util=require(_0x9ede('0x1'));var logger=require(_0x9ede('0x2'))(_0x9ede('0x3'));var moment=require(_0x9ede('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(_0x9ede('0x5'));var attributes=require(_0x9ede('0x6'));module[_0x9ede('0x7')]=function(_0x45886f,_0x345e49){return _0x45886f[_0x9ede('0x8')](_0x9ede('0x9'),attributes,{'tableName':_0x9ede('0xa'),'paranoid':![],'indexes':[{'name':_0x9ede('0xb'),'fields':[_0x9ede('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 8f0db71..f6de656 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 _0x62ef=['code','message','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x2aaf8d,_0x213189){var _0xf8790=function(_0x53b697){while(--_0x53b697){_0x2aaf8d['push'](_0x2aaf8d['shift']());}};_0xf8790(++_0x213189);}(_0x62ef,0xc9));var _0xf62e=function(_0x1fd2e6,_0x319411){_0x1fd2e6=_0x1fd2e6-0x0;var _0x38284b=_0x62ef[_0x1fd2e6];return _0x38284b;};'use strict';var _=require(_0xf62e('0x0'));var util=require(_0xf62e('0x1'));var moment=require('moment');var BPromise=require(_0xf62e('0x2'));var rs=require(_0xf62e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf62e('0x4'));var logger=require(_0xf62e('0x5'))(_0xf62e('0x6'));var config=require(_0xf62e('0x7'));var jayson=require(_0xf62e('0x8'));var client=jayson[_0xf62e('0x9')][_0xf62e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xdb33ed,_0x3263da,_0xa48b2c){return new BPromise(function(_0x51ba52,_0x4577fa){return client[_0xf62e('0xb')](_0xdb33ed,_0xa48b2c)[_0xf62e('0xc')](function(_0x2bce4c){logger[_0xf62e('0xd')](_0xf62e('0xe'),_0x3263da,_0xf62e('0xf'));logger[_0xf62e('0x10')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x3263da,'request\x20sent',JSON[_0xf62e('0x11')](_0x2bce4c));if(_0x2bce4c[_0xf62e('0x12')]){if(_0x2bce4c[_0xf62e('0x12')][_0xf62e('0x13')]===0x1f4){logger['error'](_0xf62e('0xe'),_0x3263da,_0x2bce4c[_0xf62e('0x12')][_0xf62e('0x14')]);return _0x4577fa(_0x2bce4c['error'][_0xf62e('0x14')]);}logger[_0xf62e('0x12')](_0xf62e('0xe'),_0x3263da,_0x2bce4c['error']['message']);return _0x51ba52(_0x2bce4c[_0xf62e('0x12')][_0xf62e('0x14')]);}else{logger['info'](_0xf62e('0xe'),_0x3263da,_0xf62e('0xf'));_0x51ba52(_0x2bce4c['result'][_0xf62e('0x14')]);}})[_0xf62e('0x15')](function(_0x1d07ac){logger[_0xf62e('0x12')](_0xf62e('0xe'),_0x3263da,_0x1d07ac);_0x4577fa(_0x1d07ac);});});} \ No newline at end of file +var _0x2c3b=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','http','request','then','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result'];(function(_0x1ec127,_0xb74c7e){var _0x36b6bd=function(_0x4b1e28){while(--_0x4b1e28){_0x1ec127['push'](_0x1ec127['shift']());}};_0x36b6bd(++_0xb74c7e);}(_0x2c3b,0x168));var _0xb2c3=function(_0x1ed46f,_0x7691d7){_0x1ed46f=_0x1ed46f-0x0;var _0x43b931=_0x2c3b[_0x1ed46f];return _0x43b931;};'use strict';var _=require(_0xb2c3('0x0'));var util=require(_0xb2c3('0x1'));var moment=require(_0xb2c3('0x2'));var BPromise=require(_0xb2c3('0x3'));var rs=require(_0xb2c3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb2c3('0x5'))['db'];var utils=require(_0xb2c3('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb2c3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x290418,_0x1004bc,_0x5b2cd1){return new BPromise(function(_0x227012,_0x2908c6){return client[_0xb2c3('0x8')](_0x290418,_0x5b2cd1)[_0xb2c3('0x9')](function(_0x1ae9ad){logger['info'](_0xb2c3('0xa'),_0x1004bc,'request\x20sent');logger[_0xb2c3('0xb')](_0xb2c3('0xc'),_0x1004bc,'request\x20sent',JSON[_0xb2c3('0xd')](_0x1ae9ad));if(_0x1ae9ad[_0xb2c3('0xe')]){if(_0x1ae9ad['error'][_0xb2c3('0xf')]===0x1f4){logger[_0xb2c3('0xe')](_0xb2c3('0xa'),_0x1004bc,_0x1ae9ad[_0xb2c3('0xe')]['message']);return _0x2908c6(_0x1ae9ad['error'][_0xb2c3('0x10')]);}logger[_0xb2c3('0xe')](_0xb2c3('0xa'),_0x1004bc,_0x1ae9ad[_0xb2c3('0xe')][_0xb2c3('0x10')]);return _0x227012(_0x1ae9ad[_0xb2c3('0xe')][_0xb2c3('0x10')]);}else{logger[_0xb2c3('0x11')](_0xb2c3('0xa'),_0x1004bc,_0xb2c3('0x12'));_0x227012(_0x1ae9ad[_0xb2c3('0x13')][_0xb2c3('0x10')]);}})['catch'](function(_0x3d1548){logger['error'](_0xb2c3('0xa'),_0x1004bc,_0x3d1548);_0x2908c6(_0x3d1548);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 528f802..2354d50 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 _0x22d4=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util'];(function(_0x8b1205,_0x4376c5){var _0x59936c=function(_0x2419af){while(--_0x2419af){_0x8b1205['push'](_0x8b1205['shift']());}};_0x59936c(++_0x4376c5);}(_0x22d4,0xa6));var _0x422d=function(_0x2c00b3,_0x29b200){_0x2c00b3=_0x2c00b3-0x0;var _0x595512=_0x22d4[_0x2c00b3];return _0x595512;};'use strict';var multer=require(_0x422d('0x0'));var util=require(_0x422d('0x1'));var path=require('path');var timeout=require(_0x422d('0x2'));var express=require(_0x422d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x422d('0x4'));var interaction=require(_0x422d('0x5'));var config=require(_0x422d('0x6'));var controller=require(_0x422d('0x7'));router['get']('/',auth[_0x422d('0x8')](),controller[_0x422d('0x9')]);router[_0x422d('0xa')](_0x422d('0xb'),auth[_0x422d('0x8')](),controller[_0x422d('0xc')]);router[_0x422d('0xa')](_0x422d('0xd'),auth[_0x422d('0x8')](),controller[_0x422d('0xe')]);router[_0x422d('0xf')]('/',auth[_0x422d('0x8')](),controller[_0x422d('0x10')]);router[_0x422d('0x11')](_0x422d('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x422d('0x12')](_0x422d('0xd'),auth[_0x422d('0x8')](),controller[_0x422d('0x13')]);module[_0x422d('0x14')]=router; \ No newline at end of file +var _0x8833=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x118657,_0x2acddb){var _0x504b05=function(_0x3afe52){while(--_0x3afe52){_0x118657['push'](_0x118657['shift']());}};_0x504b05(++_0x2acddb);}(_0x8833,0x8a));var _0x3883=function(_0x44cca4,_0x1c0550){_0x44cca4=_0x44cca4-0x0;var _0x46c0d6=_0x8833[_0x44cca4];return _0x46c0d6;};'use strict';var multer=require(_0x3883('0x0'));var util=require(_0x3883('0x1'));var path=require(_0x3883('0x2'));var timeout=require(_0x3883('0x3'));var express=require(_0x3883('0x4'));var router=express[_0x3883('0x5')]();var fs_extra=require(_0x3883('0x6'));var auth=require(_0x3883('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3883('0x8'));router[_0x3883('0x9')]('/',auth[_0x3883('0xa')](),controller[_0x3883('0xb')]);router[_0x3883('0x9')](_0x3883('0xc'),auth['isAuthenticated'](),controller[_0x3883('0xd')]);router['get'](_0x3883('0xe'),auth['isAuthenticated'](),controller[_0x3883('0xf')]);router[_0x3883('0x10')]('/',auth['isAuthenticated'](),controller[_0x3883('0x11')]);router[_0x3883('0x12')]('/:id',auth[_0x3883('0xa')](),controller[_0x3883('0x13')]);router[_0x3883('0x14')](_0x3883('0xe'),auth[_0x3883('0xa')](),controller[_0x3883('0x15')]);module[_0x3883('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index f336d5b..60c22a2 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 _0x1c1f=['Note','Skip','Feedback','star','TEXT','stringify','input','name','onlineForm','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','#fafafa','System','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x1c1f,0x1b8));var _0xf1c1=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x1c1f[_0x288f5e];return _0x476cc9;};'use strict';var Sequelize=require(_0xf1c1('0x0'));var rs=require(_0xf1c1('0x1'));module[_0xf1c1('0x2')]={'name':{'type':Sequelize[_0xf1c1('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xf1c1('0x3')],'allowNull':![],'unique':_0xf1c1('0x4')},'description':{'type':Sequelize[_0xf1c1('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xf1c1('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xf1c1('0x5')},'key':{'type':Sequelize[_0xf1c1('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xf1c1('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xf1c1('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf1c1('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf1c1('0x3')],'allowNull':![],'defaultValue':_0xf1c1('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xf1c1('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf1c1('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xf1c1('0x9')](_0xf1c1('0xa'),'squared'),'defaultValue':_0xf1c1('0xa')},'header_online':{'type':Sequelize[_0xf1c1('0x3')],'defaultValue':_0xf1c1('0xb')},'start_chat_button':{'type':Sequelize[_0xf1c1('0x3')],'defaultValue':_0xf1c1('0xc')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xf1c1('0xd')},'header_offline':{'type':Sequelize[_0xf1c1('0x3')],'defaultValue':_0xf1c1('0xe')},'download_transcript':{'type':Sequelize[_0xf1c1('0xf')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xf1c1('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xf1c1('0x3')],'defaultValue':_0xf1c1('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0xf1c1('0xf')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xf1c1('0x3')],'defaultValue':_0xf1c1('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xf1c1('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xf1c1('0x3')],'defaultValue':_0xf1c1('0x13')},'noteTitle':{'type':Sequelize[_0xf1c1('0x3')],'defaultValue':_0xf1c1('0x14')},'placeholderMessage':{'type':Sequelize[_0xf1c1('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xf1c1('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xf1c1('0xd')},'skipMessageButton':{'type':Sequelize[_0xf1c1('0x3')],'defaultValue':_0xf1c1('0x15')},'conditionAgreement':{'type':Sequelize[_0xf1c1('0xf')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xf1c1('0xf')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xf1c1('0xf')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xf1c1('0xf')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xf1c1('0x3')],'defaultValue':_0xf1c1('0x16')},'ratingType':{'type':Sequelize[_0xf1c1('0x9')](_0xf1c1('0x17'),'thumb'),'defaultValue':_0xf1c1('0x17')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xf1c1('0x18')],'defaultValue':function(){return JSON[_0xf1c1('0x19')]({'items':[{'type':_0xf1c1('0x1a'),'variable':null,'config':{'placeholder':_0xf1c1('0x1b'),'type':'text','required':!![]},'props':{'title':_0xf1c1('0x1b'),'helpText':''}},{'type':_0xf1c1('0x1a'),'props':{'title':_0xf1c1('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xf1c1('0x5'),'type':_0xf1c1('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xf1c1('0x1c'))?JSON['parse'](this[_0xf1c1('0x1d')](_0xf1c1('0x1c'))):{};},'set':function(_0x344458){return this[_0xf1c1('0x1e')](_0xf1c1('0x1c'),JSON['stringify'](_0x344458));}},'offlineForm':{'type':Sequelize[_0xf1c1('0x18')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xf1c1('0x1a'),'props':{'title':_0xf1c1('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xf1c1('0x5'),'type':_0xf1c1('0x5')},'variable':null},{'type':_0xf1c1('0x1f'),'config':{'placeholder':_0xf1c1('0x20')},'props':{'title':'Comments','helpText':_0xf1c1('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0xf1c1('0x1d')](_0xf1c1('0x22'))?JSON[_0xf1c1('0x23')](this[_0xf1c1('0x1d')](_0xf1c1('0x22'))):{};},'set':function(_0x2bf425){return this['setDataValue'](_0xf1c1('0x22'),JSON['stringify'](_0x2bf425));}},'token':{'type':Sequelize[_0xf1c1('0x3')],'defaultValue':function(){return rs[_0xf1c1('0x24')]();}},'autoclose':{'type':Sequelize[_0xf1c1('0xf')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xf1c1('0xf')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xf1c1('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xf1c1('0x3')]},'waitingTitle':{'type':Sequelize[_0xf1c1('0x3')],'defaultValue':_0xf1c1('0x25')},'waitingMessage':{'type':Sequelize[_0xf1c1('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xf1c1('0x3')],'defaultValue':_0xf1c1('0x26')},'offlineMessageBody':{'type':Sequelize[_0xf1c1('0x3')],'defaultValue':_0xf1c1('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0xf1c1('0xf')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xf1c1('0x3')],'defaultValue':_0xf1c1('0x28')},'skipUnmanaged':{'type':Sequelize[_0xf1c1('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xf1c1('0x3')],'defaultValue':_0xf1c1('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xf1c1('0xf')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xf1c1('0xf')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xf1c1('0x18')]},'showAgentAvatar':{'type':Sequelize[_0xf1c1('0xf')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xf1c1('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xf1c1('0x29');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf1c1('0xf')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xf1c1('0xf')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xf1c1('0x3')],'defaultValue':_0xf1c1('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0xf1c1('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xf1c1('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xf1c1('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xf1c1('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xf1c1('0x3')]},'customerAvatar':{'type':Sequelize[_0xf1c1('0x18')]},'showCustomerAvatar':{'type':Sequelize[_0xf1c1('0xf')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf1c1('0x3')],'allowNull':![],'defaultValue':_0xf1c1('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf1c1('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf1c1('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf1c1('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xf1c1('0x3')],'defaultValue':_0xf1c1('0x2c')},'systemAvatar':{'type':Sequelize[_0xf1c1('0x18')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf1c1('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x12c77a){if(!_0x12c77a)this['setDataValue'](_0xf1c1('0x2d'),null);this[_0xf1c1('0x1e')]('mandatoryDisposition',_0x12c77a);}},'vidaooEscalation':{'type':Sequelize[_0xf1c1('0xf')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xf1c1('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xf1c1('0x18')]}}; \ No newline at end of file +var _0x5db6=['Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','#011F6A','#ffffff','ENUM','rounded','squared','Send','Contact\x20us','BOOLEAN','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','stringify','input','name','text','getDataValue','onlineForm','parse','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x2da59f,_0x163460){var _0x274208=function(_0x410c2c){while(--_0x410c2c){_0x2da59f['push'](_0x2da59f['shift']());}};_0x274208(++_0x163460);}(_0x5db6,0x106));var _0x65db=function(_0x1d056a,_0x293d07){_0x1d056a=_0x1d056a-0x0;var _0x8e14c0=_0x5db6[_0x1d056a];return _0x8e14c0;};'use strict';var Sequelize=require(_0x65db('0x0'));var rs=require(_0x65db('0x1'));module[_0x65db('0x2')]={'name':{'type':Sequelize[_0x65db('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x65db('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x65db('0x3')]},'mapKey':{'type':Sequelize[_0x65db('0x3')],'defaultValue':_0x65db('0x4')},'mapKeyOffline':{'type':Sequelize[_0x65db('0x3')],'defaultValue':_0x65db('0x4')},'key':{'type':Sequelize[_0x65db('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x65db('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x65db('0x3')],'allowNull':![],'defaultValue':_0x65db('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x65db('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x65db('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x65db('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x65db('0x7')](_0x65db('0x8'),_0x65db('0x9')),'defaultValue':_0x65db('0x8')},'header_online':{'type':Sequelize[_0x65db('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x65db('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x65db('0x3')],'defaultValue':_0x65db('0xa')},'header_offline':{'type':Sequelize[_0x65db('0x3')],'defaultValue':_0x65db('0xb')},'download_transcript':{'type':Sequelize[_0x65db('0xc')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x65db('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x65db('0x3')],'defaultValue':_0x65db('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x65db('0xf')]},'closingQuestion':{'type':Sequelize[_0x65db('0x3')],'defaultValue':_0x65db('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x65db('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x65db('0x3')],'defaultValue':_0x65db('0x12')},'noteTitle':{'type':Sequelize[_0x65db('0x3')],'defaultValue':_0x65db('0x13')},'placeholderMessage':{'type':Sequelize[_0x65db('0x3')],'defaultValue':_0x65db('0x14')},'closingMessage':{'type':Sequelize[_0x65db('0x3')],'defaultValue':_0x65db('0x15')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x65db('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x65db('0xc')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x65db('0xc')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x65db('0x3')],'defaultValue':_0x65db('0x16')},'ratingType':{'type':Sequelize['ENUM'](_0x65db('0x17'),'thumb'),'defaultValue':_0x65db('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x65db('0xd')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x65db('0xf')],'defaultValue':function(){return JSON[_0x65db('0x18')]({'items':[{'type':_0x65db('0x19'),'variable':null,'config':{'placeholder':_0x65db('0x1a'),'type':_0x65db('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x65db('0x19'),'props':{'title':_0x65db('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x65db('0x1c')](_0x65db('0x1d'))?JSON[_0x65db('0x1e')](this[_0x65db('0x1c')](_0x65db('0x1d'))):{};},'set':function(_0x71a86a){return this['setDataValue'](_0x65db('0x1d'),JSON[_0x65db('0x18')](_0x71a86a));}},'offlineForm':{'type':Sequelize[_0x65db('0xf')],'defaultValue':function(){return JSON[_0x65db('0x18')]({'items':[{'type':'input','props':{'title':_0x65db('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x65db('0x4')},'variable':null},{'type':_0x65db('0x1f'),'config':{'placeholder':_0x65db('0x20')},'props':{'title':_0x65db('0x20'),'helpText':_0x65db('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x65db('0x1c')](_0x65db('0x22'))?JSON[_0x65db('0x1e')](this[_0x65db('0x1c')](_0x65db('0x22'))):{};},'set':function(_0x56384f){return this['setDataValue'](_0x65db('0x22'),JSON[_0x65db('0x18')](_0x56384f));}},'token':{'type':Sequelize[_0x65db('0x3')],'defaultValue':function(){return rs[_0x65db('0x23')]();}},'autoclose':{'type':Sequelize[_0x65db('0xc')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x65db('0xc')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x65db('0xc')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x65db('0x3')]},'forwardOffline':{'type':Sequelize[_0x65db('0xc')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x65db('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x65db('0x24')},'waitingMessage':{'type':Sequelize[_0x65db('0x3')],'defaultValue':_0x65db('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x65db('0x3')],'defaultValue':_0x65db('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x65db('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x65db('0xc')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x65db('0x3')],'defaultValue':_0x65db('0x28')},'skipUnmanaged':{'type':Sequelize[_0x65db('0x3')],'defaultValue':_0x65db('0x29')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x65db('0xc')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x65db('0xc')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x65db('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x65db('0xc')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x65db('0x3')]},'notificationTemplate':{'type':Sequelize[_0x65db('0xf')],'defaultValue':function(){return _0x65db('0x2a');}},'notificationSound':{'type':Sequelize[_0x65db('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x65db('0xc')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x65db('0xc')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x65db('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x65db('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x65db('0x3')],'defaultValue':_0x65db('0x2c')},'verticalAlignment':{'type':Sequelize[_0x65db('0xd')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x65db('0x2d')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x65db('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x65db('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x65db('0x3')],'allowNull':![],'defaultValue':_0x65db('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x65db('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x65db('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x65db('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x65db('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x65db('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x65db('0xd')],'comment':_0x65db('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0x65db('0xc')],'defaultValue':![],'comment':_0x65db('0x30'),'set':function(_0x2273ee){if(!_0x2273ee)this[_0x65db('0x31')]('mandatoryDispositionPauseId',null);this[_0x65db('0x31')]('mandatoryDisposition',_0x2273ee);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x65db('0x3')]},'vidaooTopic':{'type':Sequelize[_0x65db('0x3')],'allowNull':![],'defaultValue':_0x65db('0x32')},'vidaooNote':{'type':Sequelize[_0x65db('0x3')],'defaultValue':function(){return _0x65db('0x33');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x65db('0xc')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x65db('0xf')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index a3a1eb8..3d3b521 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 _0x0b85=['root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','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','DESC','ChatApplication','List','account','applications','Applications','priority','asc','Contacts','from','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','stringify','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','messageId','created','push','close','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','startRouting','Start','EventManager','files','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','email','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Owner','fullname','Tag','tag','Command','getSnippet','timezone','interval','iftime\x20%s','indexOf','true','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','x-real-ip','remoteAddress','virtual','replace','alignment','textColor','color_button','addApplications','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','ChatProactiveAction','getFields','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','addAgents','userChatWebsite:save','removeAgents','emit','userChatWebsite:remove','getAgents','bluebird','mustache','util','ejs','fs-extra','lodash','querystring','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','destroy','ChatWebsites','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','pick','filter','merge','where','options','include','ChatWebsite','findAll','rows','params','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','sort','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','findOne','rawAttributes','order','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0b85,0x1da));var _0x50b8=function(_0x4e74ca,_0x478fcc){_0x4e74ca=_0x4e74ca-0x0;var _0x45a301=_0x0b85[_0x4e74ca];return _0x45a301;};'use strict';var BPromise=require(_0x50b8('0x0'));var Mustache=require(_0x50b8('0x1'));var util=require(_0x50b8('0x2'));var path=require('path');var ejs=require(_0x50b8('0x3'));var fs=require('fs');var fs_extra=require(_0x50b8('0x4'));var _=require(_0x50b8('0x5'));var querystring=require(_0x50b8('0x6'));var Redis=require(_0x50b8('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0x50b8('0x8'))('api');var config=require(_0x50b8('0x9'));var db=require(_0x50b8('0xa'))['db'];config[_0x50b8('0xb')]=_[_0x50b8('0xc')](config[_0x50b8('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x50b8('0xd'))(new Redis(config['redis']));require('./chatWebsite.socket')['register'](socket);var jayson=require(_0x50b8('0xe'));var client=jayson[_0x50b8('0xf')][_0x50b8('0x10')]({'port':0x232c});var client9002=jayson[_0x50b8('0xf')][_0x50b8('0x10')]({'port':0x232a});var client9003=jayson[_0x50b8('0xf')][_0x50b8('0x10')]({'port':0x232b});var client9001=jayson[_0x50b8('0xf')][_0x50b8('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x13ea22,_0x267d0f,_0x4d1480,_0x3b0c8e){return new BPromise(function(_0xf4bd20,_0x5e2ad3){var _0x33a416=_0x3b0c8e||client;return _0x33a416[_0x50b8('0x11')](_0x13ea22,_0x4d1480)[_0x50b8('0x12')](function(_0xe36e25){logger['info'](_0x50b8('0x13'),_0x267d0f,_0x50b8('0x14'));logger[_0x50b8('0x15')](_0x50b8('0x16'),_0x267d0f,_0x50b8('0x14'),JSON['stringify'](_0xe36e25));if(_0xe36e25[_0x50b8('0x17')]){if(_0xe36e25[_0x50b8('0x17')][_0x50b8('0x18')]===0x1f4){logger[_0x50b8('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x267d0f,_0xe36e25[_0x50b8('0x17')]['message']);return _0x5e2ad3(_0xe36e25[_0x50b8('0x17')][_0x50b8('0x19')]);}logger[_0x50b8('0x17')](_0x50b8('0x13'),_0x267d0f,_0xe36e25[_0x50b8('0x17')][_0x50b8('0x19')]);return _0xf4bd20(_0xe36e25[_0x50b8('0x17')][_0x50b8('0x19')]);}else{logger['info'](_0x50b8('0x13'),_0x267d0f,_0x50b8('0x14'));_0xf4bd20(_0xe36e25[_0x50b8('0x1a')][_0x50b8('0x19')]);}})[_0x50b8('0x1b')](function(_0x13a97a){logger['error'](_0x50b8('0x13'),_0x267d0f,_0x13a97a);_0x5e2ad3(_0x13a97a);});});}function respondWithStatusCode(_0x4b32c1,_0xe41f50){_0xe41f50=_0xe41f50||0xcc;return function(_0x16ea92){if(_0x16ea92){return _0x4b32c1[_0x50b8('0x1c')](_0xe41f50);}return _0x4b32c1[_0x50b8('0x1d')](_0xe41f50)[_0x50b8('0x1e')]();};}function respondWithResult(_0x9e1d7b,_0x2dd406){_0x2dd406=_0x2dd406||0xc8;return function(_0x3ef321){if(_0x3ef321){return _0x9e1d7b[_0x50b8('0x1d')](_0x2dd406)[_0x50b8('0x1f')](_0x3ef321);}};}function respondWithFilteredResult(_0xf32b89,_0x4a4710){return function(_0x2de00d){if(_0x2de00d){var _0x18859a=typeof _0x4a4710[_0x50b8('0x20')]==='undefined'&&typeof _0x4a4710[_0x50b8('0x21')]===_0x50b8('0x22');var _0x3f944b=_0x2de00d[_0x50b8('0x23')];var _0x9a64dc=_0x18859a?0x0:_0x4a4710[_0x50b8('0x20')];var _0x7e2d23=_0x18859a?_0x2de00d[_0x50b8('0x23')]:_0x4a4710['offset']+_0x4a4710[_0x50b8('0x21')];var _0x319ea1;if(_0x7e2d23>=_0x3f944b){_0x7e2d23=_0x3f944b;_0x319ea1=0xc8;}else{_0x319ea1=0xce;}_0xf32b89['status'](_0x319ea1);return _0xf32b89[_0x50b8('0x24')](_0x50b8('0x25'),_0x9a64dc+'-'+_0x7e2d23+'/'+_0x3f944b)[_0x50b8('0x1f')](_0x2de00d);}return null;};}function saveUpdates(_0x3da2a6){return function(_0x1f82cd){if(_0x1f82cd){return _0x1f82cd[_0x50b8('0x26')](_0x3da2a6)[_0x50b8('0x12')](function(_0x459b34){return _0x459b34;});}return null;};}function removeEntity(_0x220656){return function(_0x5f3851){if(_0x5f3851){return _0x5f3851[_0x50b8('0x27')]()[_0x50b8('0x12')](function(){var _0x431c7d=_0x5f3851['get']({'plain':!![]});var _0x26ed35=_0x50b8('0x28');return db[_0x50b8('0x29')][_0x50b8('0x27')]({'where':{'type':_0x26ed35,'resourceId':_0x431c7d['id']}})[_0x50b8('0x12')](function(){return _0x5f3851;});})[_0x50b8('0x12')](function(){_0x220656[_0x50b8('0x1d')](0xcc)[_0x50b8('0x1e')]();});}};}function handleEntityNotFound(_0x2c2cc2){return function(_0x4896a9){if(!_0x4896a9){_0x2c2cc2[_0x50b8('0x1c')](0x194);}return _0x4896a9;};}function handleError(_0x183b08,_0x3c59e2){_0x3c59e2=_0x3c59e2||0x1f4;return function(_0x3fac8d){logger[_0x50b8('0x17')](_0x3fac8d[_0x50b8('0x2a')]);if(_0x3fac8d['name']){delete _0x3fac8d[_0x50b8('0x2b')];}_0x183b08[_0x50b8('0x1d')](_0x3c59e2)['send'](_0x3fac8d);};}exports[_0x50b8('0x2c')]=function(_0x76d9cb,_0x3490a6){var _0x3946f3={'include':[{'model':db[_0x50b8('0x2d')],'as':_0x50b8('0x2e')}]},_0x4f3d44={},_0x457f87={'count':0x0,'rows':[]};var _0x49d784=_[_0x50b8('0x2f')](db['ChatWebsite']['rawAttributes'],function(_0x55b20f){return{'name':_0x55b20f[_0x50b8('0x30')],'type':_0x55b20f[_0x50b8('0x31')][_0x50b8('0x32')]};});_0x4f3d44[_0x50b8('0x33')]=_[_0x50b8('0x2f')](_0x49d784,_0x50b8('0x2b'));_0x4f3d44[_0x50b8('0x34')]=_[_0x50b8('0x35')](_0x76d9cb['query']);_0x4f3d44[_0x50b8('0x36')]=_[_0x50b8('0x37')](_0x4f3d44[_0x50b8('0x33')],_0x4f3d44[_0x50b8('0x34')]);_0x3946f3[_0x50b8('0x38')]=_[_0x50b8('0x37')](_0x4f3d44[_0x50b8('0x33')],qs[_0x50b8('0x39')](_0x76d9cb[_0x50b8('0x34')][_0x50b8('0x39')]));_0x3946f3[_0x50b8('0x38')]=_0x3946f3[_0x50b8('0x38')][_0x50b8('0x3a')]?_0x3946f3['attributes']:_0x4f3d44[_0x50b8('0x33')];if(!_0x76d9cb[_0x50b8('0x34')][_0x50b8('0x3b')](_0x50b8('0x3c'))){_0x3946f3[_0x50b8('0x21')]=qs[_0x50b8('0x21')](_0x76d9cb[_0x50b8('0x34')][_0x50b8('0x21')]);_0x3946f3[_0x50b8('0x20')]=qs[_0x50b8('0x20')](_0x76d9cb['query'][_0x50b8('0x20')]);}_0x3946f3['order']=qs['sort'](_0x76d9cb[_0x50b8('0x34')]['sort']);_0x3946f3['where']=qs[_0x50b8('0x36')](_[_0x50b8('0x3d')](_0x76d9cb['query'],_0x4f3d44[_0x50b8('0x36')]),_0x49d784);if(_0x76d9cb[_0x50b8('0x34')][_0x50b8('0x3e')]){_0x3946f3['where']=_[_0x50b8('0x3f')](_0x3946f3[_0x50b8('0x40')],{'$or':_['map'](_0x49d784,function(_0x423a84){if(_0x423a84[_0x50b8('0x31')]!=='VIRTUAL'){var _0x414f1f={};_0x414f1f[_0x423a84['name']]={'$like':'%'+_0x76d9cb[_0x50b8('0x34')][_0x50b8('0x3e')]+'%'};return _0x414f1f;}})});}_0x3946f3=_['merge']({},_0x3946f3,_0x76d9cb[_0x50b8('0x41')]);var _0x2ed106={'where':_0x3946f3[_0x50b8('0x40')]};return db['ChatWebsite'][_0x50b8('0x23')](_0x2ed106)[_0x50b8('0x12')](function(_0x457c72){_0x457f87['count']=_0x457c72;if(_0x76d9cb[_0x50b8('0x34')]['includeAll']){_0x3946f3[_0x50b8('0x42')]=[{'all':!![]}];}return db[_0x50b8('0x43')][_0x50b8('0x44')](_0x3946f3);})[_0x50b8('0x12')](function(_0x1648c3){_0x457f87[_0x50b8('0x45')]=_0x1648c3;return _0x457f87;})['then'](respondWithFilteredResult(_0x3490a6,_0x3946f3))[_0x50b8('0x1b')](handleError(_0x3490a6,null));};exports['show']=function(_0x59c3e8,_0xfb121d){var _0x50e36d={'raw':![],'where':{'id':_0x59c3e8[_0x50b8('0x46')]['id']},'include':[{'model':db[_0x50b8('0x2d')],'as':_0x50b8('0x2e')}]},_0x8d3e42={};_0x8d3e42[_0x50b8('0x33')]=_[_0x50b8('0x35')](db[_0x50b8('0x43')]['rawAttributes']);_0x8d3e42['query']=_[_0x50b8('0x35')](_0x59c3e8[_0x50b8('0x34')]);_0x8d3e42[_0x50b8('0x36')]=_[_0x50b8('0x37')](_0x8d3e42[_0x50b8('0x33')],_0x8d3e42[_0x50b8('0x34')]);_0x50e36d[_0x50b8('0x38')]=_[_0x50b8('0x37')](_0x8d3e42[_0x50b8('0x33')],qs[_0x50b8('0x39')](_0x59c3e8[_0x50b8('0x34')][_0x50b8('0x39')]));_0x50e36d[_0x50b8('0x38')]=_0x50e36d[_0x50b8('0x38')][_0x50b8('0x3a')]?_0x50e36d[_0x50b8('0x38')]:_0x8d3e42['model'];if(_0x59c3e8[_0x50b8('0x34')]['includeAll']){_0x50e36d[_0x50b8('0x42')]=[{'all':!![]}];}_0x50e36d=_[_0x50b8('0x3f')]({},_0x50e36d,_0x59c3e8[_0x50b8('0x41')]);return db[_0x50b8('0x43')][_0x50b8('0x47')](_0x50e36d)[_0x50b8('0x12')](handleEntityNotFound(_0xfb121d,null))[_0x50b8('0x12')](respondWithResult(_0xfb121d,null))[_0x50b8('0x1b')](handleError(_0xfb121d,null));};exports[_0x50b8('0x48')]=function(_0xa163ff,_0x173b1a){return db['ChatWebsite'][_0x50b8('0x48')](_0xa163ff[_0x50b8('0x49')],{})['then'](function(_0x856873){var _0x3462ef=_0xa163ff[_0x50b8('0x4a')][_0x50b8('0x4b')]({'plain':!![]});if(!_0x3462ef)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3462ef[_0x50b8('0x4c')]==='user'){var _0x5a96ad=_0x856873[_0x50b8('0x4b')]({'plain':!![]});var _0x5107dc=_0x50b8('0x28');return db[_0x50b8('0x4d')][_0x50b8('0x47')]({'where':{'name':_0x5107dc,'userProfileId':_0x3462ef[_0x50b8('0x4e')]},'raw':!![]})[_0x50b8('0x12')](function(_0x2cd560){if(_0x2cd560&&_0x2cd560[_0x50b8('0x4f')]===0x0){return db['UserProfileResource'][_0x50b8('0x48')]({'name':_0x5a96ad[_0x50b8('0x2b')],'resourceId':_0x5a96ad['id'],'type':_0x2cd560[_0x50b8('0x2b')],'sectionId':_0x2cd560['id']},{})['then'](function(){return _0x856873;});}else{return _0x856873;}})[_0x50b8('0x1b')](function(_0x14bbdf){logger[_0x50b8('0x17')](_0x50b8('0x50'),_0x14bbdf);throw _0x14bbdf;});}return _0x856873;})[_0x50b8('0x12')](respondWithResult(_0x173b1a,0xc9))[_0x50b8('0x1b')](handleError(_0x173b1a,null));};exports[_0x50b8('0x26')]=function(_0x3861cd,_0xfaa89d){if(_0x3861cd[_0x50b8('0x49')]['id']){delete _0x3861cd[_0x50b8('0x49')]['id'];}return db[_0x50b8('0x43')][_0x50b8('0x47')]({'where':{'id':_0x3861cd[_0x50b8('0x46')]['id']},'include':[{'model':db[_0x50b8('0x2d')],'as':_0x50b8('0x2e')}]})[_0x50b8('0x12')](handleEntityNotFound(_0xfaa89d,null))[_0x50b8('0x12')](saveUpdates(_0x3861cd[_0x50b8('0x49')],null))['then'](respondWithResult(_0xfaa89d,null))[_0x50b8('0x1b')](handleError(_0xfaa89d,null));};exports[_0x50b8('0x27')]=function(_0x7f8866,_0x4d32cc){return db[_0x50b8('0x43')][_0x50b8('0x47')]({'where':{'id':_0x7f8866['params']['id']}})[_0x50b8('0x12')](handleEntityNotFound(_0x4d32cc,null))['then'](removeEntity(_0x4d32cc,null))['catch'](handleError(_0x4d32cc,null));};exports[_0x50b8('0x51')]=function(_0x8f8c5a,_0x17d7ef){return db['ChatWebsite'][_0x50b8('0x51')]()['then'](respondWithResult(_0x17d7ef,null))[_0x50b8('0x1b')](handleError(_0x17d7ef,null));};exports[_0x50b8('0x52')]=function(_0x514210,_0x297d73){if(_0x514210[_0x50b8('0x49')]['id']){delete _0x514210[_0x50b8('0x49')]['id'];}return db['ChatWebsite'][_0x50b8('0x47')]({'where':{'id':_0x514210[_0x50b8('0x46')]['id']}})[_0x50b8('0x12')](handleEntityNotFound(_0x297d73,null))[_0x50b8('0x12')](function(_0xa85b22){if(_0xa85b22){_0x514210[_0x50b8('0x49')][_0x50b8('0x53')]=_0xa85b22['id'];return db[_0x50b8('0x54')][_0x50b8('0x48')](_0x514210[_0x50b8('0x49')]);}})[_0x50b8('0x12')](respondWithResult(_0x297d73,null))[_0x50b8('0x1b')](handleError(_0x297d73,null));};exports[_0x50b8('0x55')]=function(_0x27c391,_0x228433){var _0x5ed06b={'raw':![],'where':{}};var _0x27066c={};var _0x4b450b={'count':0x0,'rows':[]};return db[_0x50b8('0x43')]['findOne']({'where':{'id':_0x27c391[_0x50b8('0x46')]['id']}})['then'](handleEntityNotFound(_0x228433,null))[_0x50b8('0x12')](function(_0x50c256){if(_0x50c256){_0x27066c[_0x50b8('0x33')]=_[_0x50b8('0x35')](db[_0x50b8('0x54')]['rawAttributes']);_0x27066c['query']=_[_0x50b8('0x35')](_0x27c391['query']);_0x27066c['filters']=_[_0x50b8('0x37')](_0x27066c[_0x50b8('0x33')],_0x27066c[_0x50b8('0x34')]);_0x5ed06b[_0x50b8('0x38')]=_[_0x50b8('0x37')](_0x27066c[_0x50b8('0x33')],qs[_0x50b8('0x39')](_0x27c391[_0x50b8('0x34')][_0x50b8('0x39')]));_0x5ed06b['attributes']=_0x5ed06b['attributes'][_0x50b8('0x3a')]?_0x5ed06b[_0x50b8('0x38')]:_0x27066c[_0x50b8('0x33')];if(!_0x27c391[_0x50b8('0x34')][_0x50b8('0x3b')](_0x50b8('0x3c'))){_0x5ed06b[_0x50b8('0x21')]=qs[_0x50b8('0x21')](_0x27c391[_0x50b8('0x34')]['limit']);_0x5ed06b[_0x50b8('0x20')]=qs[_0x50b8('0x20')](_0x27c391[_0x50b8('0x34')][_0x50b8('0x20')]);}_0x5ed06b['order']=qs[_0x50b8('0x56')](_0x27c391['query'][_0x50b8('0x56')]);_0x5ed06b[_0x50b8('0x40')]=qs[_0x50b8('0x36')](_[_0x50b8('0x3d')](_0x27c391[_0x50b8('0x34')],_0x27066c[_0x50b8('0x36')]));_0x5ed06b[_0x50b8('0x40')][_0x50b8('0x53')]=_0x50c256['id'];if(_0x27c391[_0x50b8('0x34')][_0x50b8('0x3e')]){_0x5ed06b[_0x50b8('0x40')]=_[_0x50b8('0x3f')](_0x5ed06b[_0x50b8('0x40')],{'$or':_[_0x50b8('0x2f')](_0x5ed06b[_0x50b8('0x38')],function(_0x157a5d){var _0x27dd0a={};_0x27dd0a[_0x157a5d]={'$like':'%'+_0x27c391[_0x50b8('0x34')][_0x50b8('0x3e')]+'%'};return _0x27dd0a;})});}_0x5ed06b=_[_0x50b8('0x3f')]({},_0x5ed06b,_0x27c391[_0x50b8('0x41')]);return db[_0x50b8('0x54')][_0x50b8('0x23')]({'where':_0x5ed06b[_0x50b8('0x40')]})[_0x50b8('0x12')](function(_0x560938){_0x4b450b[_0x50b8('0x23')]=_0x560938;if(_0x27c391['query'][_0x50b8('0x57')]){_0x5ed06b['include']=[{'all':!![]}];}return db[_0x50b8('0x54')][_0x50b8('0x44')](_0x5ed06b);})[_0x50b8('0x12')](function(_0x3641c5){_0x4b450b[_0x50b8('0x45')]=_0x3641c5;return _0x4b450b;});}})[_0x50b8('0x12')](respondWithFilteredResult(_0x228433,_0x5ed06b))[_0x50b8('0x1b')](handleError(_0x228433,null));};exports[_0x50b8('0x58')]=function(_0xa9fdf6,_0x4ac337){return db[_0x50b8('0x43')][_0x50b8('0x47')]({'where':{'id':_0xa9fdf6[_0x50b8('0x46')]['id']}})['then'](handleEntityNotFound(_0x4ac337,null))[_0x50b8('0x12')](function(_0x50f2ce){if(_0x50f2ce){return _0x50f2ce[_0x50b8('0x58')](_0xa9fdf6[_0x50b8('0x34')][_0x50b8('0x59')]);}})[_0x50b8('0x12')](respondWithStatusCode(_0x4ac337,null))[_0x50b8('0x1b')](handleError(_0x4ac337,null));};exports[_0x50b8('0x5a')]=function(_0x5eac8e,_0x5e6796){if(_0x5eac8e[_0x50b8('0x49')]['id']){delete _0x5eac8e['body']['id'];}return db['ChatWebsite'][_0x50b8('0x47')]({'where':{'id':_0x5eac8e['params']['id']}})[_0x50b8('0x12')](handleEntityNotFound(_0x5e6796,null))[_0x50b8('0x12')](function(_0x25413c){if(_0x25413c){_0x5eac8e[_0x50b8('0x49')][_0x50b8('0x53')]=_0x25413c['id'];return db[_0x50b8('0x5b')][_0x50b8('0x48')](_0x5eac8e[_0x50b8('0x49')]);}})[_0x50b8('0x12')](respondWithResult(_0x5e6796,null))['catch'](handleError(_0x5e6796,null));};exports['getAnswers']=function(_0x1177ad,_0x554018){var _0x9dde7={'raw':![],'where':{}};var _0x5697be={};var _0x7fb91a={'count':0x0,'rows':[]};return db[_0x50b8('0x43')][_0x50b8('0x5c')]({'where':{'id':_0x1177ad[_0x50b8('0x46')]['id']}})[_0x50b8('0x12')](handleEntityNotFound(_0x554018,null))['then'](function(_0x2510c9){if(_0x2510c9){_0x5697be[_0x50b8('0x33')]=_[_0x50b8('0x35')](db[_0x50b8('0x5b')][_0x50b8('0x5d')]);_0x5697be[_0x50b8('0x34')]=_[_0x50b8('0x35')](_0x1177ad[_0x50b8('0x34')]);_0x5697be[_0x50b8('0x36')]=_[_0x50b8('0x37')](_0x5697be[_0x50b8('0x33')],_0x5697be[_0x50b8('0x34')]);_0x9dde7[_0x50b8('0x38')]=_['intersection'](_0x5697be['model'],qs[_0x50b8('0x39')](_0x1177ad[_0x50b8('0x34')][_0x50b8('0x39')]));_0x9dde7[_0x50b8('0x38')]=_0x9dde7[_0x50b8('0x38')][_0x50b8('0x3a')]?_0x9dde7[_0x50b8('0x38')]:_0x5697be[_0x50b8('0x33')];if(!_0x1177ad[_0x50b8('0x34')][_0x50b8('0x3b')]('nolimit')){_0x9dde7[_0x50b8('0x21')]=qs[_0x50b8('0x21')](_0x1177ad['query'][_0x50b8('0x21')]);_0x9dde7[_0x50b8('0x20')]=qs[_0x50b8('0x20')](_0x1177ad['query'][_0x50b8('0x20')]);}_0x9dde7[_0x50b8('0x5e')]=qs[_0x50b8('0x56')](_0x1177ad[_0x50b8('0x34')][_0x50b8('0x56')]);_0x9dde7[_0x50b8('0x40')]=qs[_0x50b8('0x36')](_['pick'](_0x1177ad[_0x50b8('0x34')],_0x5697be[_0x50b8('0x36')]));_0x9dde7[_0x50b8('0x40')][_0x50b8('0x53')]=_0x2510c9['id'];if(_0x1177ad[_0x50b8('0x34')]['filter']){_0x9dde7[_0x50b8('0x40')]=_[_0x50b8('0x3f')](_0x9dde7[_0x50b8('0x40')],{'$or':_['map'](_0x9dde7['attributes'],function(_0x491fb3){var _0x448411={};_0x448411[_0x491fb3]={'$like':'%'+_0x1177ad['query'][_0x50b8('0x3e')]+'%'};return _0x448411;})});}_0x9dde7=_[_0x50b8('0x3f')]({},_0x9dde7,_0x1177ad['options']);return db[_0x50b8('0x5b')]['count']({'where':_0x9dde7['where']})[_0x50b8('0x12')](function(_0x33a243){_0x7fb91a[_0x50b8('0x23')]=_0x33a243;if(_0x1177ad[_0x50b8('0x34')]['includeAll']){_0x9dde7[_0x50b8('0x42')]=[{'all':!![]}];}return db[_0x50b8('0x5b')][_0x50b8('0x44')](_0x9dde7);})[_0x50b8('0x12')](function(_0x3e7539){_0x7fb91a[_0x50b8('0x45')]=_0x3e7539;return _0x7fb91a;});}})[_0x50b8('0x12')](respondWithFilteredResult(_0x554018,_0x9dde7))['catch'](handleError(_0x554018,null));};exports[_0x50b8('0x5f')]=function(_0x24a8ce,_0x984e29){return db[_0x50b8('0x43')][_0x50b8('0x47')]({'where':{'id':_0x24a8ce[_0x50b8('0x46')]['id']}})[_0x50b8('0x12')](handleEntityNotFound(_0x984e29,null))[_0x50b8('0x12')](function(_0x30b3d8){if(_0x30b3d8){return _0x30b3d8[_0x50b8('0x5f')](_0x24a8ce[_0x50b8('0x34')][_0x50b8('0x59')]);}})[_0x50b8('0x12')](respondWithStatusCode(_0x984e29,null))[_0x50b8('0x1b')](handleError(_0x984e29,null));};exports[_0x50b8('0x60')]=function(_0x55d420,_0x14a8f8){_0x55d420[_0x50b8('0x49')][_0x50b8('0x61')]=_0x55d420[_0x50b8('0x62')][_0x50b8('0x63')];return db['ChatWebsite'][_0x50b8('0x47')]({'where':{'id':_0x55d420['params']['id']}})[_0x50b8('0x12')](handleEntityNotFound(_0x14a8f8,null))[_0x50b8('0x12')](saveUpdates(_0x55d420['body'],null))[_0x50b8('0x12')](respondWithResult(_0x14a8f8,null))[_0x50b8('0x1b')](handleError(_0x14a8f8,null));};exports[_0x50b8('0x64')]=function(_0x4498e8,_0x1a2861){_0x4498e8[_0x50b8('0x49')][_0x50b8('0x65')]=_0x4498e8[_0x50b8('0x62')][_0x50b8('0x63')];return db[_0x50b8('0x43')][_0x50b8('0x47')]({'where':{'id':_0x4498e8['params']['id']}})[_0x50b8('0x12')](handleEntityNotFound(_0x1a2861,null))[_0x50b8('0x12')](saveUpdates(_0x4498e8[_0x50b8('0x49')],null))['then'](respondWithResult(_0x1a2861,null))['catch'](handleError(_0x1a2861,null));};exports[_0x50b8('0x66')]=function(_0x5bc944,_0x169085){_0x5bc944['body'][_0x50b8('0x67')]=_0x5bc944['file']['filename'];return db[_0x50b8('0x43')][_0x50b8('0x47')]({'where':{'id':_0x5bc944['params']['id']}})[_0x50b8('0x12')](handleEntityNotFound(_0x169085,null))['then'](saveUpdates(_0x5bc944[_0x50b8('0x49')],null))[_0x50b8('0x12')](respondWithResult(_0x169085,null))[_0x50b8('0x1b')](handleError(_0x169085,null));};exports[_0x50b8('0x68')]=function(_0x4cfcbf,_0x454008){_0x4cfcbf['body'][_0x50b8('0x69')]=_0x4cfcbf[_0x50b8('0x62')][_0x50b8('0x63')];return db[_0x50b8('0x43')][_0x50b8('0x47')]({'where':{'id':_0x4cfcbf[_0x50b8('0x46')]['id']}})[_0x50b8('0x12')](handleEntityNotFound(_0x454008,null))['then'](saveUpdates(_0x4cfcbf['body'],null))[_0x50b8('0x12')](respondWithResult(_0x454008,null))[_0x50b8('0x1b')](handleError(_0x454008,null));};exports[_0x50b8('0x6a')]=function(_0x4d4fe0,_0x4785af){var _0xc6716b=path[_0x50b8('0x6b')](config[_0x50b8('0x6c')],_0x50b8('0x6d'));var _0x2579eb={'where':{'id':_0x4d4fe0[_0x50b8('0x46')]['id']},'attributes':['id',_0x50b8('0x61')],'raw':!![]};var _0x4bebaf=![];return require('../../config/license/util')[_0x50b8('0x6e')]()[_0x50b8('0x12')](function(_0x4d2e0d){if(_0x4d2e0d){_0x4bebaf=_0x4d2e0d[_0x50b8('0x6f')];}})[_0x50b8('0x12')](function(){return db[_0x50b8('0x43')][_0x50b8('0x47')](_0x2579eb);})['then'](handleEntityNotFound(_0x4785af,null))[_0x50b8('0x12')](function(_0x7fb286){if(_0x7fb286){if(!_[_0x50b8('0x70')](_0x7fb286[_0x50b8('0x61')])){if(fs[_0x50b8('0x71')](path[_0x50b8('0x6b')](config['root'],'server/files/images/logos/',_0x7fb286[_0x50b8('0x61')]))&&_0x4bebaf){_0xc6716b=path[_0x50b8('0x6b')](config[_0x50b8('0x6c')],_0x50b8('0x72'),_0x7fb286[_0x50b8('0x61')]);}}return _0x4785af[_0x50b8('0x73')](_0xc6716b);}})[_0x50b8('0x1b')](handleError(_0x4785af,null));};exports[_0x50b8('0x74')]=function(_0x429ef7,_0xaca9e8){var _0x51ab25=path[_0x50b8('0x6b')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x751d24={'where':{'id':_0x429ef7[_0x50b8('0x46')]['id']},'attributes':['id',_0x50b8('0x65')],'raw':!![]};return db['ChatWebsite'][_0x50b8('0x47')](_0x751d24)[_0x50b8('0x12')](handleEntityNotFound(_0xaca9e8,null))[_0x50b8('0x12')](function(_0x3f069e){if(_0x3f069e){if(!_[_0x50b8('0x70')](_0x3f069e[_0x50b8('0x65')])){if(fs[_0x50b8('0x71')](path[_0x50b8('0x6b')](config[_0x50b8('0x6c')],_0x50b8('0x75'),_0x3f069e['agentAvatar']))){_0x51ab25=path[_0x50b8('0x6b')](config[_0x50b8('0x6c')],_0x50b8('0x75'),_0x3f069e['agentAvatar']);}}return _0xaca9e8[_0x50b8('0x73')](_0x51ab25);}})[_0x50b8('0x1b')](handleError(_0xaca9e8,null));};exports[_0x50b8('0x76')]=function(_0x2255a1,_0x159a3d){var _0x336466=path['join'](config[_0x50b8('0x6c')],_0x50b8('0x77'));var _0x2d5ae5={'where':{'id':_0x2255a1[_0x50b8('0x46')]['id']},'attributes':['id','customerAvatar',_0x50b8('0x78')],'raw':!![]};return db[_0x50b8('0x43')][_0x50b8('0x47')](_0x2d5ae5)[_0x50b8('0x12')](handleEntityNotFound(_0x159a3d,null))[_0x50b8('0x12')](function(_0x19a2e7){if(_0x19a2e7){if(!_[_0x50b8('0x70')](_0x19a2e7[_0x50b8('0x67')])){if(fs[_0x50b8('0x71')](path['join'](config['root'],_0x50b8('0x75'),_0x19a2e7[_0x50b8('0x67')]))&&_0x19a2e7[_0x50b8('0x78')]){_0x336466=path[_0x50b8('0x6b')](config[_0x50b8('0x6c')],_0x50b8('0x75'),_0x19a2e7[_0x50b8('0x67')]);}}return _0x159a3d['download'](_0x336466);}})[_0x50b8('0x1b')](handleError(_0x159a3d,null));};exports[_0x50b8('0x79')]=function(_0x4997d9,_0x81b205){var _0x106d31=path[_0x50b8('0x6b')](config[_0x50b8('0x6c')],_0x50b8('0x7a'));var _0xec96ef={'where':{'id':_0x4997d9[_0x50b8('0x46')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x50b8('0x43')][_0x50b8('0x47')](_0xec96ef)['then'](handleEntityNotFound(_0x81b205,null))[_0x50b8('0x12')](function(_0x6fcaef){if(_0x6fcaef){if(!_[_0x50b8('0x70')](_0x6fcaef[_0x50b8('0x69')])){if(fs[_0x50b8('0x71')](path['join'](config[_0x50b8('0x6c')],_0x50b8('0x75'),_0x6fcaef[_0x50b8('0x69')]))){_0x106d31=path['join'](config[_0x50b8('0x6c')],_0x50b8('0x75'),_0x6fcaef[_0x50b8('0x69')]);}}return _0x81b205[_0x50b8('0x73')](_0x106d31);}})['catch'](handleError(_0x81b205,null));};exports[_0x50b8('0x7b')]=function(_0x1463d0,_0x1e7533){var _0x30d047=require(_0x50b8('0x7c'));var _0x582704=new _0x30d047();var _0x1438f6=_0x582704[_0x50b8('0x7d')](_0x1463d0['headers']['user-agent'])['getResult']();var _0x5f276e={'body':_0x1463d0['body'],'channel':'chat'};var _0x3024be=[];var _0x1dc9ba=[];var _0x40b846={};var _0x6075b7=![];return db[_0x50b8('0x7e')][_0x50b8('0x51')]()[_0x50b8('0x12')](function(_0xa49872){if(!_0xa49872){throw new db[(_0x50b8('0x7f'))][(_0x50b8('0x80'))](_0x50b8('0x81'));}_0x3024be=_[_0x50b8('0x82')](_[_0x50b8('0x35')](_0xa49872),[_0x50b8('0x83'),_0x50b8('0x84')]);_0x1dc9ba=_[_0x50b8('0x82')](_[_0x50b8('0x35')](_0xa49872),[_0x50b8('0x83'),_0x50b8('0x84'),_0x50b8('0x85'),_0x50b8('0x86')]);if(_0x1463d0['body']['id']){delete _0x1463d0['body']['id'];}if(_[_0x50b8('0x70')](_0x1463d0[_0x50b8('0x49')]['from'])){throw new db[(_0x50b8('0x7f'))]['ValidationError'](_0x50b8('0x87'));}if(_[_0x50b8('0x70')](_0x1463d0[_0x50b8('0x49')][_0x50b8('0x49')])||_0x1463d0[_0x50b8('0x49')]['body']===''){throw new db[(_0x50b8('0x7f'))][(_0x50b8('0x80'))](_0x50b8('0x88'));}if(_['isNil'](_0x1463d0[_0x50b8('0x49')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0x50b8('0x89')+_0x1dc9ba);}if(!_[_0x50b8('0x8a')](_0x1dc9ba,_0x1463d0['body'][_0x50b8('0x8b')])){throw new db[(_0x50b8('0x7f'))]['ValidationError'](_0x50b8('0x8c')+_0x1dc9ba);}_0x40b846[_0x1463d0[_0x50b8('0x49')][_0x50b8('0x8b')]]=_0x1463d0[_0x50b8('0x49')]['from'];})[_0x50b8('0x12')](function(){return db[_0x50b8('0x43')][_0x50b8('0x47')]({'where':{'id':_0x1463d0['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x40b846,'limit':0x1,'order':[['updatedAt',_0x50b8('0x8d')]]}]},{'model':db[_0x50b8('0x8e')],'as':'Applications'}]});})[_0x50b8('0x12')](handleEntityNotFound(_0x1e7533,null))[_0x50b8('0x12')](function(_0x571eb7){if(_0x571eb7&&_0x571eb7[_0x50b8('0x8f')]){_0x5f276e[_0x50b8('0x90')]=_0x571eb7;_0x5f276e[_0x50b8('0x91')]=_0x571eb7[_0x50b8('0x92')];_0x5f276e['list']=_0x571eb7[_0x50b8('0x8f')];_0x5f276e['applications']=_['orderBy'](_0x5f276e[_0x50b8('0x91')],[_0x50b8('0x93')],[_0x50b8('0x94')]);if(_0x5f276e['account'][_0x50b8('0x92')]){delete _0x5f276e[_0x50b8('0x90')]['Applications'];}if(_0x5f276e[_0x50b8('0x90')][_0x50b8('0x8f')]&&_0x5f276e[_0x50b8('0x90')][_0x50b8('0x8f')][_0x50b8('0x95')]['length']){return _0x5f276e[_0x50b8('0x90')][_0x50b8('0x8f')][_0x50b8('0x95')][0x0];}var _0x4ba023=_[_0x50b8('0xc')](_0x1463d0[_0x50b8('0x49')],{'firstName':_0x1463d0[_0x50b8('0x49')][_0x50b8('0x96')],'ListId':_0x571eb7[_0x50b8('0x86')]});_0x4ba023[_0x1463d0[_0x50b8('0x49')][_0x50b8('0x8b')]]=_0x1463d0[_0x50b8('0x49')][_0x50b8('0x96')];return db['CmContact'][_0x50b8('0x48')](_0x4ba023,{'fields':_0x3024be,'raw':!![]});}})['then'](handleEntityNotFound(_0x1e7533,null))[_0x50b8('0x12')](function(_0x31b56d){_0x5f276e[_0x50b8('0x97')]=_0x31b56d;var _0x16d8b8=_0x1463d0[_0x50b8('0x49')][_0x50b8('0x98')];if(_0x1463d0[_0x50b8('0x99')]['cf-connecting-ip']){_0x16d8b8=_0x1463d0[_0x50b8('0x99')][_0x50b8('0x9a')];}else if(_0x1463d0['headers'][_0x50b8('0x9b')]){_0x16d8b8=_[_0x50b8('0x9c')](_0x1463d0[_0x50b8('0x99')][_0x50b8('0x9b')][_0x50b8('0x9d')](','));}if(_0x31b56d){var _0x4e119c={'ContactId':_0x31b56d['id'],'ChatWebsiteId':_0x1463d0['params']['id'],'from':(_0x31b56d[_0x50b8('0x9e')]||'')+'\x20'+(_0x31b56d[_0x50b8('0x9f')]||''),'customerIp':_0x16d8b8,'customerPort':_0x1463d0[_0x50b8('0x99')][_0x50b8('0xa0')]?_0x1463d0[_0x50b8('0x99')]['x-real-port']:null,'referer':_0x1463d0['body']['referer'],'browserName':_0x1438f6[_0x50b8('0xa1')][_0x50b8('0x2b')]&&_0x1438f6[_0x50b8('0xa1')][_0x50b8('0xa2')]?util[_0x50b8('0xa3')]('%s\x20%s',_0x1438f6['browser'][_0x50b8('0x2b')],_0x1438f6[_0x50b8('0xa1')]['version']):_0x50b8('0xa4'),'browserVersion':_0x1438f6['browser']['version']||_0x50b8('0xa4'),'osName':util['format'](_0x50b8('0xa5'),_0x1438f6['os'][_0x50b8('0x2b')],_0x1438f6['os'][_0x50b8('0xa2')]),'osVersion':_0x1438f6['os']['version'],'deviceModel':_0x1438f6[_0x50b8('0xa6')][_0x50b8('0x33')]&&_0x1438f6[_0x50b8('0xa6')][_0x50b8('0xa7')]?util['format'](_0x50b8('0xa8'),_0x1438f6[_0x50b8('0xa6')]['model'],_0x1438f6[_0x50b8('0xa6')][_0x50b8('0xa7')],_0x1438f6[_0x50b8('0xa6')]['type']):null,'deviceVendor':_0x1438f6[_0x50b8('0xa6')][_0x50b8('0xa7')],'deviceType':_0x1438f6[_0x50b8('0xa6')]['type'],'formData':JSON[_0x50b8('0xa9')](_0x1463d0['body'])};var _0x280c0f={'ChatWebsiteId':_0x1463d0['params']['id'],'closed':![]};if(_0x1463d0[_0x50b8('0x49')][_0x50b8('0xaa')]){_0x280c0f[_0x50b8('0xaa')]=_0x1463d0['body'][_0x50b8('0xaa')];return db['ChatInteraction'][_0x50b8('0x47')]({'where':_0x280c0f})['then'](function(_0x2b3908){if(_0x2b3908){return[_0x2b3908,![]];}_0x4e119c[_0x50b8('0xaa')]=_0x1463d0[_0x50b8('0x49')][_0x50b8('0xaa')];_0x4e119c['externalUrl']=_0x1463d0[_0x50b8('0x49')][_0x50b8('0xab')];return db[_0x50b8('0xac')]['create'](_0x4e119c)['then'](function(_0x1a7185){return[_0x1a7185,!![]];});});}_0x280c0f[_0x50b8('0xad')]=_0x31b56d['id'];if(_0x1463d0[_0x50b8('0x49')]['interaction']&&_0x1463d0[_0x50b8('0x49')][_0x50b8('0xae')]['id']){_0x280c0f['id']=_0x1463d0[_0x50b8('0x49')]['interaction']['id'];return db[_0x50b8('0xac')][_0x50b8('0x47')]({'where':_0x280c0f})['then'](function(_0xc3ab56){if(_0xc3ab56){return[_0xc3ab56,![]];}return db['ChatInteraction'][_0x50b8('0x48')](_0x4e119c)['then'](function(_0x1c997d){return[_0x1c997d,!![]];});});}return db[_0x50b8('0xac')]['create'](_0x4e119c)[_0x50b8('0x12')](function(_0x283c){return[_0x283c,!![]];});}})[_0x50b8('0xaf')](function(_0x2df685,_0x233f20){if(_0x2df685){_0x6075b7=_0x233f20;if(!_0x233f20){var _0x3a37fd={'from':(_0x5f276e['contact'][_0x50b8('0x9e')]||'')+'\x20'+(_0x5f276e[_0x50b8('0x97')]['lastName']||'')};if(_0x1463d0['body'][_0x50b8('0xaa')]&&_0x1463d0[_0x50b8('0x49')]['messageId']&&_0x1463d0[_0x50b8('0x49')][_0x50b8('0xaa')]!=_0x1463d0['body'][_0x50b8('0xb0')]){_0x3a37fd[_0x50b8('0xaa')]=_0x1463d0['body']['messageId'];}return _0x2df685['update'](_0x3a37fd);}else{return _0x2df685;}}})[_0x50b8('0x12')](function(_0x59be5b){_0x5f276e['interaction']=_0x59be5b[_0x50b8('0x4b')]({'plain':!![]});_0x5f276e[_0x50b8('0xae')][_0x50b8('0xb1')]=_0x6075b7;if(_0x5f276e[_0x50b8('0xae')][_0x50b8('0xb1')]){if(_0x5f276e['account']['autoclose']){_0x5f276e[_0x50b8('0x91')][_0x50b8('0xb2')]({'id':0x0,'priority':_0x5f276e['applications']['length']+0x1,'app':_0x50b8('0xb3'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x50b8('0xb4')][_0x50b8('0x48')]({'body':_0x1463d0[_0x50b8('0x49')][_0x50b8('0x49')],'ChatWebsiteId':_0x1463d0[_0x50b8('0x46')]['id'],'ChatInteractionId':_0x59be5b['id'],'direction':'in','ContactId':_0x5f276e[_0x50b8('0x97')]['id'],'AttachmentId':_0x1463d0[_0x50b8('0x49')][_0x50b8('0xb5')]});})[_0x50b8('0x12')](function(_0x4dcb98){_0x5f276e[_0x50b8('0x19')]=_0x4dcb98;if(_0x5f276e[_0x50b8('0xae')][_0x50b8('0xb6')]){return db[_0x50b8('0xb7')]['find']({'attributes':['id',_0x50b8('0x2b')],'where':{'id':_0x5f276e['interaction'][_0x50b8('0xb6')]}})[_0x50b8('0x12')](function(_0xec097b){if(_0xec097b){_0x5f276e['applications'][_0x50b8('0xb8')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xec097b[_0x50b8('0x2b')]+','+(_0x5f276e[_0x50b8('0x90')][_0x50b8('0xb9')]||0xa),'interval':_0x50b8('0xba')});_0x5f276e[_0x50b8('0xbb')]=!![];}return respondWithRpcPromise('Start',_0x50b8('0xbc'),_0x5f276e);});}return respondWithRpcPromise(_0x50b8('0xbd'),_0x50b8('0xbc'),_0x5f276e);})[_0x50b8('0x12')](function(_0x21987d){respondWithRpcPromise(_0x50b8('0xbe'),_0x50b8('0xbe'),{'event':'notify','message':_0x21987d},client9002);return _0x21987d;})[_0x50b8('0x12')](respondWithResult(_0x1e7533,null))[_0x50b8('0x1b')](handleError(_0x1e7533,null));};exports['offline']=function(_0x4c4daf,_0x34731e){var _0x341ff8,_0x240fa7,_0x5218b5;var _0x4e6c9e=[];var _0x1ce54b={};var _0x32f2b1=_0x4c4daf[_0x50b8('0xbf')]||[];var _0x1511e3=[];var _0x388aa8;return db[_0x50b8('0x7e')][_0x50b8('0x51')]()['then'](function(_0x58a73a){if(!_0x58a73a){throw new db['Sequelize'][(_0x50b8('0x80'))](_0x50b8('0x81'));}_0x4e6c9e=_[_0x50b8('0x82')](_[_0x50b8('0x35')](_0x58a73a),['createdAt',_0x50b8('0x84'),_0x50b8('0x85'),_0x50b8('0x86')]);if(_0x4c4daf['body']['id']){delete _0x4c4daf['body']['id'];}if(_[_0x50b8('0x70')](_0x4c4daf[_0x50b8('0x49')]['from'])){throw _0x34731e[_0x50b8('0x1d')](0x1f4)[_0x50b8('0xc0')](new db['Sequelize'][(_0x50b8('0x80'))](_0x50b8('0x87')));}if(_[_0x50b8('0x70')](_0x4c4daf[_0x50b8('0x49')][_0x50b8('0x49')])||_0x4c4daf[_0x50b8('0x49')][_0x50b8('0x49')]===''){throw _0x34731e[_0x50b8('0x1d')](0x1f4)[_0x50b8('0xc0')](new db[(_0x50b8('0x7f'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x50b8('0x70')](_0x4c4daf[_0x50b8('0x49')][_0x50b8('0xc1')])){throw _0x34731e[_0x50b8('0x1d')](0x1f4)[_0x50b8('0xc0')](new db[(_0x50b8('0x7f'))]['ValidationError'](_0x50b8('0xc2')+_0x4e6c9e));}if(!_['includes'](_0x4e6c9e,_0x4c4daf['body'][_0x50b8('0xc1')])){throw _0x34731e[_0x50b8('0x1d')](0x1f4)['send'](new db[(_0x50b8('0x7f'))]['ValidationError'](_0x50b8('0xc3')+_0x4e6c9e));}_0x1ce54b[_0x4c4daf['body'][_0x50b8('0xc1')]]=_0x4c4daf[_0x50b8('0x49')][_0x50b8('0x96')];})[_0x50b8('0x12')](function(){return db['ChatWebsite'][_0x50b8('0x47')]({'where':{'id':_0x4c4daf[_0x50b8('0x46')]['id']},'include':[{'model':db[_0x50b8('0xc4')],'as':_0x50b8('0x8f')},{'model':db[_0x50b8('0xc5')],'as':_0x50b8('0xc5')}]});})[_0x50b8('0x12')](handleEntityNotFound(_0x34731e,null))[_0x50b8('0x12')](function(_0x1d2e4d){if(_0x1d2e4d&&_0x1d2e4d[_0x50b8('0x8f')]){_0x240fa7=_0x1d2e4d;var _0x5b88c1=_['defaults'](_0x4c4daf['body'],{'firstName':_0x4c4daf[_0x50b8('0x49')][_0x50b8('0x96')],'phone':_0x4c4daf['body'][_0x50b8('0x96')],'ListId':_0x1d2e4d[_0x50b8('0x86')]});_0x5b88c1[_0x4c4daf[_0x50b8('0x49')][_0x50b8('0xc1')]]=_0x4c4daf[_0x50b8('0x49')]['from'];return db[_0x50b8('0x7e')][_0x50b8('0xc6')]({'where':_0x1ce54b,'defaults':_0x5b88c1});}})[_0x50b8('0xaf')](function(_0x493593){if(_0x493593){_0x5218b5=_0x493593;var _0x20098f=fs[_0x50b8('0xc7')](path['join'](config[_0x50b8('0x6c')],_0x50b8('0xc8')),_0x50b8('0xc9'));var _0x37de81=ejs[_0x50b8('0xca')](_0x20098f,{'body':_[_0x50b8('0xcb')](_0x4c4daf[_0x50b8('0x49')][_0x50b8('0x49')]),'bodyTitle':_0x240fa7[_0x50b8('0xcc')]});return db[_0x50b8('0xcd')][_0x50b8('0x48')]({'body':_0x37de81,'ContactId':_0x493593['id'],'ChatWebsiteId':_0x240fa7['id']});}})[_0x50b8('0x12')](function(_0x451b59){_0x388aa8=_0x451b59;if(_0x32f2b1[_0x50b8('0x3a')]){var _0x23dbbf=_0x32f2b1['map'](function(_0x1951df){return{'name':_0x1951df[_0x50b8('0xce')],'basename':_0x1951df[_0x50b8('0x63')],'type':_0x1951df['mimetype'],'ChatOfflineMessageId':_0x451b59['id']};});_0x1511e3=_0x23dbbf['map'](_0x3db371=>{var _0x3e2712={'filename':_0x3db371[_0x50b8('0x2b')],'path':path['join'](config['root'],'server',_0x50b8('0xbf'),_0x50b8('0xcf'),_0x50b8('0xd0'),_0x3db371[_0x50b8('0xd1')])};return _0x3e2712;});if(!_0x240fa7[_0x50b8('0xd2')]){return db[_0x50b8('0xd3')][_0x50b8('0xd4')](function(_0x14e954){return db[_0x50b8('0xd5')][_0x50b8('0xd6')](_0x23dbbf,{'transaction':_0x14e954});});}}})['then'](function(){if(_0x388aa8){_0x341ff8=_0x388aa8;return db['MailAccount'][_0x50b8('0x5c')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x50b8('0xd7'),'raw':!![]}]});}})[_0x50b8('0x12')](function(_0x2aaa5d){if(_0x2aaa5d&&_0x2aaa5d['Smtp']&&_0x240fa7[_0x50b8('0xd8')]&&_0x240fa7[_0x50b8('0xd9')]){var _0x5d3cdb={'tls':{'rejectUnauthorized':![]}};if(_0x2aaa5d[_0x50b8('0xd7')][_0x50b8('0xda')]){_0x5d3cdb[_0x50b8('0xda')]=_0x2aaa5d[_0x50b8('0xd7')][_0x50b8('0xda')];}else{_0x5d3cdb[_0x50b8('0xdb')]=_0x2aaa5d[_0x50b8('0xd7')][_0x50b8('0xdb')];_0x5d3cdb[_0x50b8('0xdc')]=_0x2aaa5d[_0x50b8('0xd7')][_0x50b8('0xdc')];_0x5d3cdb['secure']=_0x2aaa5d[_0x50b8('0xd7')][_0x50b8('0xdd')];}if(_0x2aaa5d['Smtp'][_0x50b8('0xde')]){_0x5d3cdb[_0x50b8('0xdf')]={'user':_0x2aaa5d[_0x50b8('0xd7')][_0x50b8('0x4a')],'pass':_0x2aaa5d[_0x50b8('0xd7')][_0x50b8('0xe0')]};}return respondWithRpcPromise(_0x50b8('0xe1'),_0x50b8('0xe2'),{'account':_0x5d3cdb,'message':{'from':util[_0x50b8('0xa3')]('\x22%s\x22\x20<%s>',_0x2aaa5d[_0x50b8('0x2b')],_0x2aaa5d['email']||_0x2aaa5d[_0x50b8('0xd7')][_0x50b8('0x4a')]),'to':_0x240fa7[_0x50b8('0xd9')],'subject':_0x240fa7[_0x50b8('0xe3')],'html':_0x341ff8[_0x50b8('0x49')],'attachments':_0x1511e3}},client9003)['then'](function(){return _0x341ff8;})[_0x50b8('0x1b')](function(_0x156e39){console[_0x50b8('0x17')](_0x156e39);});}})[_0x50b8('0x12')](function(){if(_0x240fa7&&_0x240fa7[_0x50b8('0xd2')]&&_0x240fa7[_0x50b8('0xe4')]){var _0x4f80d2=[];if(_0x32f2b1['length']){_0x4f80d2=_0x32f2b1[_0x50b8('0x2f')](function(_0x140e46){return{'name':_0x140e46[_0x50b8('0xce')],'basename':_0x140e46[_0x50b8('0x63')],'type':_0x140e46['mimetype'],'ChatOfflineMessageId':_0x388aa8['id']};});}var _0x517374;if(!_[_0x50b8('0x70')](_0x240fa7[_0x50b8('0xe5')])){var _0x4524c5=_[_0x50b8('0x2f')](_0x4c4daf[_0x50b8('0x49')],function(_0x3d3282){return _0x3d3282;});var _0x2b911f=_[_0x50b8('0xe6')](_0x4524c5)[0x0];var _0x4ef6bb=_[_0x50b8('0xe7')](_0x2b911f,function(_0x16c70c){return _0x16c70c;});_0x517374=_0x4ef6bb[0x1][_0x240fa7[_0x50b8('0xe5')]];}var _0x1ae360={'from':_0x5218b5[_0x50b8('0xe8')],'firstName':_0x5218b5[_0x50b8('0x9e')],'lastName':_0x5218b5[_0x50b8('0x9f')],'mapKey':_0x50b8('0xe8'),'message':{'from':_0x5218b5[_0x50b8('0xe8')],'to':_0x240fa7[_0x50b8('0xc5')]['email'],'cc':'','subject':_['isNil'](_0x517374)?_0x240fa7[_0x50b8('0xe3')]:_0x517374,'messageId':'','sentAt':new Date(),'attach':_0x4f80d2[_0x50b8('0x3a')],'attachments':_0x4f80d2,'originChannel':_0x50b8('0xe9'),'ChatWebsiteId':_0x240fa7['id'],'ChatOfflineMessageId':_0x341ff8['id'],'originTo':_0x240fa7['MailAccount'][_0x50b8('0xe8')]},'body':_0x341ff8[_0x50b8('0x49')]};var _0x172bda={'account':{'id':_0x240fa7[_0x50b8('0xe4')]},'body':_0x1ae360,'log':_0x50b8('0xea')};return respondWithRpcPromise(_0x50b8('0xea'),_0x50b8('0xeb'),_0x172bda,client9001)[_0x50b8('0x12')](function(){return _0x341ff8;})[_0x50b8('0x1b')](function(_0x453e86){console[_0x50b8('0x17')](_0x453e86);});}return;})['then'](function(){if(_0x341ff8){return _0x341ff8;}})[_0x50b8('0x12')](respondWithResult(_0x34731e,null))[_0x50b8('0x1b')](function(_0x51b591){console[_0x50b8('0x17')](_0x50b8('0x1b'),_0x51b591);for(var _0x155d89 of _0x32f2b1){var _0xc5847c=path['join'](config['root'],'server',_0x50b8('0xbf'),'attachments',_0x50b8('0xd0'),_0x155d89['filename']);fs_extra[_0x50b8('0xec')](_0xc5847c)['catch'](function(_0x2b4964){console[_0x50b8('0x17')](_0x50b8('0xed'),_0xc5847c,_0x2b4964);});}});};exports[_0x50b8('0xee')]=function(_0x2e0f2d,_0x4c8fba){return db['ChatInteraction'][_0x50b8('0x47')]({'where':{'id':_0x2e0f2d[_0x50b8('0x46')]['id']}})[_0x50b8('0x12')](handleEntityNotFound(_0x4c8fba,null))[_0x50b8('0x12')](function(_0x18f7ec){if(_0x18f7ec){return _0x18f7ec[_0x50b8('0xee')](_0x2e0f2d[_0x50b8('0x49')][_0x50b8('0x59')],_[_0x50b8('0xef')](_0x2e0f2d['body'],[_0x50b8('0x59'),'id'])||{});}})['then'](respondWithResult(_0x4c8fba,null))['catch'](handleError(_0x4c8fba,null));};exports['getInteractions']=function(_0x4676db,_0xc0f617){var _0xd715d4={'raw':![],'where':{}};var _0x535015={};var _0x1dca87={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x50b8('0x5c')]({'where':{'id':_0x4676db[_0x50b8('0x46')]['id']}})[_0x50b8('0x12')](handleEntityNotFound(_0xc0f617,null))[_0x50b8('0x12')](function(_0x5129a0){if(_0x5129a0){_0x535015[_0x50b8('0x33')]=_[_0x50b8('0x35')](db[_0x50b8('0xac')][_0x50b8('0x5d')]);_0x535015['query']=_[_0x50b8('0x35')](_0x4676db[_0x50b8('0x34')]);_0x535015[_0x50b8('0x36')]=_[_0x50b8('0x37')](_0x535015[_0x50b8('0x33')],_0x535015[_0x50b8('0x34')]);_0xd715d4['attributes']=_[_0x50b8('0x37')](_0x535015[_0x50b8('0x33')],qs['fields'](_0x4676db[_0x50b8('0x34')]['fields']));_0xd715d4[_0x50b8('0x38')]=_0xd715d4[_0x50b8('0x38')][_0x50b8('0x3a')]?_0xd715d4[_0x50b8('0x38')]:_0x535015[_0x50b8('0x33')];if(!_0x4676db[_0x50b8('0x34')]['hasOwnProperty']('nolimit')){_0xd715d4[_0x50b8('0x21')]=qs[_0x50b8('0x21')](_0x4676db[_0x50b8('0x34')]['limit']);_0xd715d4['offset']=qs[_0x50b8('0x20')](_0x4676db[_0x50b8('0x34')]['offset']);}_0xd715d4[_0x50b8('0x5e')]=qs[_0x50b8('0x56')](_0x4676db[_0x50b8('0x34')][_0x50b8('0x56')]);_0xd715d4[_0x50b8('0x40')]=qs[_0x50b8('0x36')](_['pick'](_0x4676db[_0x50b8('0x34')],_0x535015[_0x50b8('0x36')]));_0xd715d4[_0x50b8('0x40')][_0x50b8('0x53')]=_0x5129a0['id'];if(_0x4676db[_0x50b8('0x34')][_0x50b8('0x3e')]){_0xd715d4[_0x50b8('0x40')]=_[_0x50b8('0x3f')](_0xd715d4[_0x50b8('0x40')],{'$or':_[_0x50b8('0x2f')](_0xd715d4['attributes'],function(_0x56c6e0){var _0x1a7d6e={};_0x1a7d6e[_0x56c6e0]={'$like':'%'+_0x4676db[_0x50b8('0x34')][_0x50b8('0x3e')]+'%'};return _0x1a7d6e;})});}_0xd715d4=_[_0x50b8('0x3f')]({},_0xd715d4,_0x4676db['options']);return db[_0x50b8('0xac')]['count']({'where':_0xd715d4[_0x50b8('0x40')]})['then'](function(_0x143a6f){_0x1dca87[_0x50b8('0x23')]=_0x143a6f;if(_0x4676db[_0x50b8('0x34')][_0x50b8('0x57')]){_0xd715d4[_0x50b8('0x42')]=[{'model':db[_0x50b8('0x7e')],'as':'Contact','required':![]},{'model':db[_0x50b8('0xb7')],'as':_0x50b8('0xf0'),'attributes':[_0x50b8('0x2b'),_0x50b8('0xf1'),'internal'],'required':![]},{'model':db[_0x50b8('0xf2')],'as':'Tags','attributes':['id',_0x50b8('0x2b'),'color'],'where':_0x4676db[_0x50b8('0x34')][_0x50b8('0xf3')]?{'id':_0x4676db['query'][_0x50b8('0xf3')]}:undefined,'required':_0x4676db[_0x50b8('0x34')][_0x50b8('0xf3')]?!![]:![]}];}return db[_0x50b8('0xac')][_0x50b8('0x44')](_0xd715d4);})[_0x50b8('0x12')](function(_0x22cfa7){_0x1dca87[_0x50b8('0x45')]=_0x22cfa7;return _0x1dca87;});}})['then'](respondWithFilteredResult(_0xc0f617,_0xd715d4))[_0x50b8('0x1b')](handleError(_0xc0f617,null));};function iftimePromise(_0x5542bc,_0x4cf995){return respondWithRpcPromise(_0x50b8('0xf4'),_0x50b8('0xf5'),{'command':_0x4cf995[_0x50b8('0xf6')]?util[_0x50b8('0xa3')]('iftime\x20%s,%s',_0x5542bc[_0x50b8('0xf7')],_0x4cf995[_0x50b8('0xf6')]):util[_0x50b8('0xa3')](_0x50b8('0xf8'),_0x5542bc[_0x50b8('0xf7')])},client9002)[_0x50b8('0x12')](function(_0x513d6a){var _0x3f3552=_0x513d6a&&_0x513d6a[_0x50b8('0xf9')](_0x50b8('0xfa'))>=0x0?!![]:![];logger[_0x50b8('0xfb')](_0x50b8('0xfc'),_0x4cf995['id'],_0x5542bc['id'],_0x5542bc['interval'],_0x3f3552?_0x50b8('0xfd'):_0x50b8('0xfe'),_0x4cf995[_0x50b8('0xf6')]?_0x4cf995[_0x50b8('0xf6')]:_0x50b8('0xff'));return _0x3f3552;})[_0x50b8('0x1b')](function(_0x17a389){logger[_0x50b8('0x17')](_0x50b8('0xfc'),_0x4cf995['id'],_0x5542bc['id'],_0x5542bc['interval'],util[_0x50b8('0x100')](_0x17a389,{'showHidden':![],'depth':null}),_0x4cf995[_0x50b8('0xf6')]?_0x4cf995['timezone']:_0x50b8('0xff'));return![];});}exports['getSnippet']=function(_0x148671,_0xf19537){var _0x1e292a=0x0;var _0x20e7bf=0x0;var _0x21ccab=![];var _0x3f632e;var _0x4c1204;return db[_0x50b8('0x43')]['find']({'where':{'id':_0x148671['params']['id']},'include':[{'model':db[_0x50b8('0x101')],'as':_0x50b8('0x101'),'include':[{'model':db[_0x50b8('0x101')],'as':'Intervals','attributes':['id',_0x50b8('0xf7')],'raw':!![]}]}]})[_0x50b8('0x12')](handleEntityNotFound(_0xf19537,null))['then'](function(_0x10f3ae){if(_0x10f3ae){_0x3f632e=_0x10f3ae;return _0x10f3ae[_0x50b8('0x102')]({'raw':!![]});}})[_0x50b8('0x12')](function(_0xe8496){if(_0x3f632e){if(_0xe8496){_0x4c1204=_0xe8496;}}return require('../../config/license/util')[_0x50b8('0x6e')]();})[_0x50b8('0x12')](function(_0x396b15){if(_0x396b15){_0x20e7bf=_0x396b15['virtual'];_0x21ccab=_0x396b15[_0x50b8('0x6f')];}})[_0x50b8('0x12')](function(){return db[_0x50b8('0xac')][_0x50b8('0x23')]({'where':{'closed':![]}});})[_0x50b8('0x12')](function(_0x5ce903){_0x1e292a=_0x5ce903;if(_0x20e7bf&&_0x5ce903>_0x20e7bf){return db['License'][_0x50b8('0x5c')]({'where':{'id':0x1}})[_0x50b8('0x12')](function(_0x37b6a3){if(_0x37b6a3){_0x37b6a3['increment'](_0x50b8('0x103'));}});}})[_0x50b8('0x12')](function(){if(_0x3f632e['Interval']&&_0x3f632e[_0x50b8('0x101')][_0x50b8('0x104')]){var _0x302b9f=[];for(var _0x487ce6=0x0;_0x487ce6<_0x3f632e['Interval'][_0x50b8('0x104')][_0x50b8('0x3a')];_0x487ce6++){var _0x1a515d=_0x3f632e[_0x50b8('0x101')][_0x50b8('0x104')][_0x487ce6][_0x50b8('0x4b')]({'plain':!![]});_0x302b9f[_0x50b8('0xb2')](iftimePromise(_0x1a515d,_0x3f632e));}return BPromise[_0x50b8('0x105')](_0x302b9f)['then'](function(_0x6d9934){return _[_0x50b8('0x106')](_0x6d9934);});}else{return!![];}})[_0x50b8('0x12')](function(_0x419a33){var _0x146a82=fs[_0x50b8('0xc7')](path[_0x50b8('0x6b')](config[_0x50b8('0x6c')],_0x50b8('0x107')),'utf8');var _0x14060f={'remote':_0x3f632e['remote'],'query':querystring['stringify'](_['merge'](_0x3f632e[_0x50b8('0x4b')]({'plain':!![]}),{'customerIp':_0x148671['headers'][_0x50b8('0x9b')]||_0x148671['headers'][_0x50b8('0x108')]||_0x148671['connection'][_0x50b8('0x109')]||_0x148671['ip'],'referer':_0x148671[_0x50b8('0x99')]['referer'],'openedInteractions':_0x1e292a,'maxInteractions':_0x20e7bf,'virtual':_0x21ccab[_0x50b8('0x10a')],'online':_0x419a33,'custom':_0x21ccab}))[_0x50b8('0x10b')](/'/g,'\x5c\x27')};_0xf19537[_0x50b8('0xc0')](ejs[_0x50b8('0xca')](Mustache[_0x50b8('0xca')](_0x146a82,_0x14060f),{'proactiveActions':_0x4c1204,'alignment':_0x3f632e[_0x50b8('0x10c')],'verticalAlignment':_0x3f632e['verticalAlignment'],'div_color':_0x3f632e['color'],'text_color':_0x3f632e[_0x50b8('0x10d')],'button_color':_0x3f632e[_0x50b8('0x10e')],'background_color':_0x3f632e['backgroundColor']}));})['catch'](handleError(_0xf19537,null));};exports[_0x50b8('0x10f')]=function(_0x365f7a,_0x5350fb){var _0x201f42=_0x365f7a['params']['id'];var _0x17b0f1=_0x365f7a[_0x50b8('0x49')];var _0x327471=0xc8;var _0x101a1e=null;return db[_0x50b8('0xd3')][_0x50b8('0xd4')]({'isolationLevel':db['sequelize']['Transaction'][_0x50b8('0x110')][_0x50b8('0x111')]},function(_0x295723){return db[_0x50b8('0x43')][_0x50b8('0x5c')]({'where':{'id':_0x201f42},'transaction':_0x295723})[_0x50b8('0x12')](function(_0x36bd59){if(_0x36bd59){return db[_0x50b8('0x8e')]['destroy']({'where':{'ChatWebsiteId':_0x201f42},'transaction':_0x295723})[_0x50b8('0x12')](function(){var _0xf4f50c=_[_0x50b8('0x2f')](_0x17b0f1,function(_0x4037e4){_0x4037e4['ChatWebsiteId']=_0x201f42;return _0x4037e4;});return db[_0x50b8('0x8e')][_0x50b8('0xd6')](_0xf4f50c,{'transaction':_0x295723});});}else{_0x327471=0x194;_0x101a1e=[];}});})[_0x50b8('0x12')](function(){if(_0x327471!==0x194){return db['ChatApplication'][_0x50b8('0x112')]({'where':{'ChatWebsiteId':_0x201f42},'order':_0x50b8('0x93')})[_0x50b8('0x12')](function(_0x6dc22c){_0x101a1e=_0x6dc22c;});}})[_0x50b8('0x1b')](function(_0x344832){_0x327471=0x1f4;logger[_0x50b8('0x17')](_0x344832['stack']);if(_0x344832[_0x50b8('0x2b')]){delete _0x344832['name'];}_0x101a1e=_0x344832;})[_0x50b8('0x113')](function(){if(_0x101a1e===null){_0x5350fb[_0x50b8('0x1c')](_0x327471);}else{if(_0x327471===0x1f4){_0x5350fb[_0x50b8('0x1d')](_0x327471)['send'](_0x101a1e);}else{_0x5350fb[_0x50b8('0x1d')](_0x327471)[_0x50b8('0x1f')](_0x101a1e);}}});};exports[_0x50b8('0x114')]=function(_0x102457,_0x187dcc){var _0x59b155={};var _0x433163={};var _0x37c991;var _0x609ddf;return db[_0x50b8('0x43')][_0x50b8('0x5c')]({'where':{'id':_0x102457[_0x50b8('0x46')]['id']}})[_0x50b8('0x12')](handleEntityNotFound(_0x187dcc,null))['then'](function(_0x23a559){if(_0x23a559){_0x37c991=_0x23a559;_0x433163['model']=_[_0x50b8('0x35')](db[_0x50b8('0x8e')]['rawAttributes']);_0x433163[_0x50b8('0x34')]=_[_0x50b8('0x35')](_0x102457[_0x50b8('0x34')]);_0x433163[_0x50b8('0x36')]=_[_0x50b8('0x37')](_0x433163['model'],_0x433163[_0x50b8('0x34')]);_0x59b155[_0x50b8('0x38')]=_[_0x50b8('0x37')](_0x433163[_0x50b8('0x33')],qs[_0x50b8('0x39')](_0x102457['query'][_0x50b8('0x39')]));_0x59b155[_0x50b8('0x38')]=_0x59b155[_0x50b8('0x38')][_0x50b8('0x3a')]?_0x59b155[_0x50b8('0x38')]:_0x433163[_0x50b8('0x33')];_0x59b155[_0x50b8('0x5e')]=qs[_0x50b8('0x56')](_0x102457['query'][_0x50b8('0x56')]);_0x59b155[_0x50b8('0x40')]=qs[_0x50b8('0x36')](_[_0x50b8('0x3d')](_0x102457['query'],_0x433163[_0x50b8('0x36')]));if(_0x102457[_0x50b8('0x34')][_0x50b8('0x3e')]){_0x59b155['where']=_[_0x50b8('0x3f')](_0x59b155[_0x50b8('0x40')],{'$or':_[_0x50b8('0x2f')](_0x59b155['attributes'],function(_0x1b45c2){var _0x131bb9={};_0x131bb9[_0x1b45c2]={'$like':'%'+_0x102457['query'][_0x50b8('0x3e')]+'%'};return _0x131bb9;})});}_0x59b155=_[_0x50b8('0x3f')]({},_0x59b155,_0x102457[_0x50b8('0x41')]);return _0x37c991[_0x50b8('0x114')](_0x59b155);}})['then'](function(_0x203e89){if(_0x203e89){_0x609ddf=_0x203e89['length'];if(!_0x102457['query'][_0x50b8('0x3b')](_0x50b8('0x3c'))){_0x59b155['limit']=qs[_0x50b8('0x21')](_0x102457[_0x50b8('0x34')][_0x50b8('0x21')]);_0x59b155['offset']=qs[_0x50b8('0x20')](_0x102457[_0x50b8('0x34')][_0x50b8('0x20')]);}return _0x37c991[_0x50b8('0x114')](_0x59b155);}})['then'](function(_0x213909){if(_0x213909){return _0x213909?{'count':_0x609ddf,'rows':_0x213909}:null;}})[_0x50b8('0x12')](respondWithResult(_0x187dcc,null))[_0x50b8('0x1b')](handleError(_0x187dcc,null));};exports['addProactiveActions']=function(_0x57676d,_0x32ffd4){return db['chatProactiveAction'][_0x50b8('0x47')]({'where':{'id':_0x57676d['params']['id']}})['then'](handleEntityNotFound(_0x32ffd4,null))[_0x50b8('0x12')](function(_0x566385){if(_0x566385){return _0x566385['addProactiveActions'](_0x57676d[_0x50b8('0x49')][_0x50b8('0x59')],_[_0x50b8('0xef')](_0x57676d[_0x50b8('0x49')],[_0x50b8('0x59'),'id'])||{});}})[_0x50b8('0x12')](respondWithResult(_0x32ffd4,null))[_0x50b8('0x1b')](handleError(_0x32ffd4,null));};exports[_0x50b8('0x102')]=function(_0x47124e,_0x4c73e6){var _0x4c953e={};var _0x1da2e5={};var _0x3e527e;var _0x5e1c23;return db['ChatWebsite']['findOne']({'where':{'id':_0x47124e[_0x50b8('0x46')]['id']}})[_0x50b8('0x12')](handleEntityNotFound(_0x4c73e6,null))[_0x50b8('0x12')](function(_0x19b944){if(_0x19b944){_0x3e527e=_0x19b944;_0x1da2e5[_0x50b8('0x33')]=_[_0x50b8('0x35')](db[_0x50b8('0x115')][_0x50b8('0x5d')]);_0x1da2e5[_0x50b8('0x34')]=_[_0x50b8('0x35')](_0x47124e[_0x50b8('0x34')]);_0x1da2e5['filters']=_[_0x50b8('0x37')](_0x1da2e5[_0x50b8('0x33')],_0x1da2e5[_0x50b8('0x34')]);_0x4c953e[_0x50b8('0x38')]=_[_0x50b8('0x37')](_0x1da2e5[_0x50b8('0x33')],qs[_0x50b8('0x39')](_0x47124e['query']['fields']));_0x4c953e[_0x50b8('0x38')]=_0x4c953e['attributes'][_0x50b8('0x3a')]?_0x4c953e[_0x50b8('0x38')]:_0x1da2e5['model'];_0x4c953e['order']=qs[_0x50b8('0x56')](_0x47124e[_0x50b8('0x34')]['sort']);_0x4c953e[_0x50b8('0x40')]=qs[_0x50b8('0x36')](_[_0x50b8('0x3d')](_0x47124e[_0x50b8('0x34')],_0x1da2e5['filters']));if(_0x47124e['query']['filter']){_0x4c953e['where']=_['merge'](_0x4c953e[_0x50b8('0x40')],{'$or':_[_0x50b8('0x2f')](_0x4c953e[_0x50b8('0x38')],function(_0x5d5d55){var _0x15a7a9={};_0x15a7a9[_0x5d5d55]={'$like':'%'+_0x47124e['query'][_0x50b8('0x3e')]+'%'};return _0x15a7a9;})});}_0x4c953e=_[_0x50b8('0x3f')]({},_0x4c953e,_0x47124e[_0x50b8('0x41')]);return _0x3e527e[_0x50b8('0x102')](_0x4c953e);}})['then'](function(_0x258b35){if(_0x258b35){_0x5e1c23=_0x258b35[_0x50b8('0x3a')];if(!_0x47124e['query'][_0x50b8('0x3b')]('nolimit')){_0x4c953e[_0x50b8('0x21')]=qs['limit'](_0x47124e[_0x50b8('0x34')][_0x50b8('0x21')]);_0x4c953e[_0x50b8('0x20')]=qs[_0x50b8('0x20')](_0x47124e['query'][_0x50b8('0x20')]);}return _0x3e527e['getProactiveActions'](_0x4c953e);}})[_0x50b8('0x12')](function(_0x4bbd55){if(_0x4bbd55){return _0x4bbd55?{'count':_0x5e1c23,'rows':_0x4bbd55}:null;}})[_0x50b8('0x12')](respondWithResult(_0x4c73e6,null))[_0x50b8('0x1b')](handleError(_0x4c73e6,null));};exports[_0x50b8('0x116')]=function(_0x1d8bc8,_0x4bf95a){var _0x37a070=_0x1d8bc8['query']['online']==='false'?_0x50b8('0x117'):_0x50b8('0x118');return db[_0x50b8('0x43')]['find']({'attributes':['id',_0x37a070],'where':{'id':_0x1d8bc8['params']['id']}})[_0x50b8('0x12')](handleEntityNotFound(_0x4bf95a,null))['then'](function(_0x4b561d){if(_0x4b561d){var _0x492ead=_0x4b561d[_0x37a070];var _0x1d217e=_0x492ead&&_0x492ead[_0x50b8('0x119')]?_0x492ead[_0x50b8('0x119')]:[];_0x4bf95a[_0x50b8('0xc0')]({'fromKey':_[_0x50b8('0x70')](_0x492ead[_0x50b8('0x11a')])?undefined:_0x492ead['fromKey'],'count':_0x1d217e[_0x50b8('0x3a')],'rows':_0x1d217e});}})['catch'](handleError(_0x4bf95a,null));};exports[_0x50b8('0x11b')]=function(_0x33a6d4,_0x426fcb){var _0xc50e5a={'raw':![],'where':{}};var _0x9301ad={};var _0x4fa002={'count':0x0,'rows':[]};return db[_0x50b8('0x43')]['findOne']({'where':{'id':_0x33a6d4[_0x50b8('0x46')]['id']}})[_0x50b8('0x12')](handleEntityNotFound(_0x426fcb,null))[_0x50b8('0x12')](function(_0x37aaec){if(_0x37aaec){_0x9301ad[_0x50b8('0x33')]=_['keys'](db[_0x50b8('0xcd')][_0x50b8('0x5d')]);_0x9301ad['query']=_[_0x50b8('0x35')](_0x33a6d4[_0x50b8('0x34')]);_0x9301ad[_0x50b8('0x36')]=_[_0x50b8('0x37')](_0x9301ad[_0x50b8('0x33')],_0x9301ad[_0x50b8('0x34')]);_0xc50e5a[_0x50b8('0x38')]=_[_0x50b8('0x37')](_0x9301ad['model'],qs[_0x50b8('0x39')](_0x33a6d4[_0x50b8('0x34')]['fields']));_0xc50e5a[_0x50b8('0x38')]=_0xc50e5a['attributes'][_0x50b8('0x3a')]?_0xc50e5a[_0x50b8('0x38')]:_0x9301ad[_0x50b8('0x33')];if(!_0x33a6d4['query'][_0x50b8('0x3b')]('nolimit')){_0xc50e5a[_0x50b8('0x21')]=qs[_0x50b8('0x21')](_0x33a6d4[_0x50b8('0x34')]['limit']);_0xc50e5a[_0x50b8('0x20')]=qs['offset'](_0x33a6d4[_0x50b8('0x34')][_0x50b8('0x20')]);}_0xc50e5a['order']=qs[_0x50b8('0x56')](_0x33a6d4['query']['sort']);_0xc50e5a[_0x50b8('0x40')]=qs['filters'](_[_0x50b8('0x3d')](_0x33a6d4[_0x50b8('0x34')],_0x9301ad[_0x50b8('0x36')]));_0xc50e5a[_0x50b8('0x40')]['ChatWebsiteId']=_0x37aaec['id'];if(_0x33a6d4[_0x50b8('0x34')][_0x50b8('0x3e')]){_0xc50e5a[_0x50b8('0x40')]=_[_0x50b8('0x3f')](_0xc50e5a['where'],{'$or':_[_0x50b8('0x2f')](_0xc50e5a[_0x50b8('0x38')],function(_0x317504){var _0x8d4b71={};_0x8d4b71[_0x317504]={'$like':'%'+_0x33a6d4[_0x50b8('0x34')]['filter']+'%'};return _0x8d4b71;})});}_0xc50e5a=_[_0x50b8('0x3f')]({},_0xc50e5a,_0x33a6d4['options']);return db['ChatOfflineMessage'][_0x50b8('0x23')]({'where':_0xc50e5a['where']})[_0x50b8('0x12')](function(_0x49a0be){_0x4fa002[_0x50b8('0x23')]=_0x49a0be;if(_0x33a6d4[_0x50b8('0x34')][_0x50b8('0x57')]){_0xc50e5a[_0x50b8('0x42')]=[{'all':!![]}];}else{_0xc50e5a[_0x50b8('0x42')]=[{'model':db[_0x50b8('0x7e')],'as':_0x50b8('0x11c'),'required':![]},{'model':db[_0x50b8('0xd5')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0x50b8('0x44')](_0xc50e5a);})[_0x50b8('0x12')](function(_0x86e4f5){_0x4fa002[_0x50b8('0x45')]=_0x86e4f5;return _0x4fa002;});}})[_0x50b8('0x12')](respondWithFilteredResult(_0x426fcb,_0xc50e5a))['catch'](handleError(_0x426fcb,null));};exports[_0x50b8('0x11d')]=function(_0x52133e,_0x20a4ef){return db[_0x50b8('0x43')]['find']({'where':{'id':_0x52133e[_0x50b8('0x46')]['id']}})[_0x50b8('0x12')](handleEntityNotFound(_0x20a4ef,null))[_0x50b8('0x12')](function(_0x5ae826){if(_0x5ae826){return _0x5ae826[_0x50b8('0x11d')](_0x52133e[_0x50b8('0x49')][_0x50b8('0x59')],_['omit'](_0x52133e[_0x50b8('0x49')],[_0x50b8('0x59'),'id'])||{})[_0x50b8('0xaf')](function(_0x5f0312){for(var _0x33bc15=0x0;_0x33bc15<_0x52133e[_0x50b8('0x49')][_0x50b8('0x59')][_0x50b8('0x3a')];_0x33bc15+=0x1){socket['emit'](_0x50b8('0x11e'),{'UserId':Number(_0x52133e[_0x50b8('0x49')][_0x50b8('0x59')][_0x33bc15]),'ChatWebsiteId':Number(_0x52133e[_0x50b8('0x46')]['id'])});}return _0x5f0312;});}})['then'](respondWithResult(_0x20a4ef,null))[_0x50b8('0x1b')](handleError(_0x20a4ef,null));};exports[_0x50b8('0x11f')]=function(_0x5290a9,_0x31936e){return db[_0x50b8('0x43')][_0x50b8('0x47')]({'where':{'id':_0x5290a9['params']['id']}})[_0x50b8('0x12')](handleEntityNotFound(_0x31936e,null))[_0x50b8('0x12')](function(_0x38b6eb){if(_0x38b6eb){return _0x38b6eb[_0x50b8('0x11f')](_0x5290a9[_0x50b8('0x34')][_0x50b8('0x59')])[_0x50b8('0x12')](function(){if(_['isArray'](_0x5290a9['query'][_0x50b8('0x59')])){for(var _0x50273f=0x0;_0x50273f<_0x5290a9[_0x50b8('0x34')][_0x50b8('0x59')][_0x50b8('0x3a')];_0x50273f+=0x1){socket[_0x50b8('0x120')](_0x50b8('0x121'),{'UserId':Number(_0x5290a9[_0x50b8('0x34')]['ids'][_0x50273f]),'ChatWebsiteId':Number(_0x5290a9[_0x50b8('0x46')]['id'])});}}else{socket[_0x50b8('0x120')](_0x50b8('0x121'),{'UserId':Number(_0x5290a9[_0x50b8('0x34')][_0x50b8('0x59')]),'ChatWebsiteId':Number(_0x5290a9[_0x50b8('0x46')]['id'])});}});}})[_0x50b8('0x12')](respondWithStatusCode(_0x31936e,null))[_0x50b8('0x1b')](handleError(_0x31936e,null));};exports['getAgents']=function(_0x49c0d4,_0x535d36){var _0x5e30e6={};var _0x29b320={};var _0x102cba;var _0x36cbdf;return db[_0x50b8('0x43')]['findOne']({'where':{'id':_0x49c0d4['params']['id']}})[_0x50b8('0x12')](handleEntityNotFound(_0x535d36,null))[_0x50b8('0x12')](function(_0xc5bb2){if(_0xc5bb2){_0x102cba=_0xc5bb2;_0x29b320[_0x50b8('0x33')]=_[_0x50b8('0x35')](db[_0x50b8('0xb7')][_0x50b8('0x5d')]);_0x29b320[_0x50b8('0x34')]=_[_0x50b8('0x35')](_0x49c0d4['query']);_0x29b320[_0x50b8('0x36')]=_['intersection'](_0x29b320[_0x50b8('0x33')],_0x29b320[_0x50b8('0x34')]);_0x5e30e6[_0x50b8('0x38')]=_[_0x50b8('0x37')](_0x29b320[_0x50b8('0x33')],qs[_0x50b8('0x39')](_0x49c0d4[_0x50b8('0x34')][_0x50b8('0x39')]));_0x5e30e6['attributes']=_0x5e30e6[_0x50b8('0x38')][_0x50b8('0x3a')]?_0x5e30e6[_0x50b8('0x38')]:_0x29b320[_0x50b8('0x33')];_0x5e30e6[_0x50b8('0x5e')]=qs[_0x50b8('0x56')](_0x49c0d4[_0x50b8('0x34')][_0x50b8('0x56')]);_0x5e30e6[_0x50b8('0x40')]=qs[_0x50b8('0x36')](_['pick'](_0x49c0d4[_0x50b8('0x34')],_0x29b320['filters']));if(_0x49c0d4[_0x50b8('0x34')][_0x50b8('0x3e')]){_0x5e30e6[_0x50b8('0x40')]=_['merge'](_0x5e30e6[_0x50b8('0x40')],{'$or':_[_0x50b8('0x2f')](_0x5e30e6[_0x50b8('0x38')],function(_0x404711){var _0x52f530={};_0x52f530[_0x404711]={'$like':'%'+_0x49c0d4[_0x50b8('0x34')][_0x50b8('0x3e')]+'%'};return _0x52f530;})});}_0x5e30e6=_[_0x50b8('0x3f')]({},_0x5e30e6,_0x49c0d4[_0x50b8('0x41')]);return _0x102cba[_0x50b8('0x122')](_0x5e30e6);}})[_0x50b8('0x12')](function(_0x565066){if(_0x565066){_0x36cbdf=_0x565066[_0x50b8('0x3a')];if(!_0x49c0d4[_0x50b8('0x34')]['hasOwnProperty'](_0x50b8('0x3c'))){_0x5e30e6[_0x50b8('0x21')]=qs[_0x50b8('0x21')](_0x49c0d4[_0x50b8('0x34')][_0x50b8('0x21')]);_0x5e30e6[_0x50b8('0x20')]=qs[_0x50b8('0x20')](_0x49c0d4[_0x50b8('0x34')][_0x50b8('0x20')]);}return _0x102cba[_0x50b8('0x122')](_0x5e30e6);}})[_0x50b8('0x12')](function(_0x4de939){if(_0x4de939){return _0x4de939?{'count':_0x36cbdf,'rows':_0x4de939}:null;}})[_0x50b8('0x12')](respondWithResult(_0x535d36,null))['catch'](handleError(_0x535d36,null));}; \ No newline at end of file +var _0xdb59=['getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','lodash','querystring','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','update','destroy','then','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','ChatWebsiteId','Disposition','getDispositions','nolimit','include','removeDispositions','addAnswer','getAnswers','findOne','CannedAnswer','findAll','removeAnswers','ids','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','setUA','user-agent','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','CompanyId','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','Contacts','DESC','ChatApplication','Applications','List','applications','list','orderBy','priority','asc','account','ListId','contact','customerIp','headers','cf-connecting-ip','first','x-forwarded-for','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','close','*,*,*,*','ChatMessage','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','offline','files','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','ChatOfflineMessage','originalname','server','basename','openNewInteraction','sequelize','transaction','bulkCreate','MailServerOut','Smtp','forwardOfflineAddress','service','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','attachments','offline-chat','remove','addInteraction','omit','Contact','Tag','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','replace','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','READ_COMMITTED','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction'];(function(_0x179c4a,_0x10eb06){var _0x5d1879=function(_0x1f1dcd){while(--_0x1f1dcd){_0x179c4a['push'](_0x179c4a['shift']());}};_0x5d1879(++_0x10eb06);}(_0xdb59,0x134));var _0x9db5=function(_0x4cdf87,_0x200caf){_0x4cdf87=_0x4cdf87-0x0;var _0x14d49d=_0xdb59[_0x4cdf87];return _0x14d49d;};'use strict';var BPromise=require(_0x9db5('0x0'));var Mustache=require(_0x9db5('0x1'));var util=require(_0x9db5('0x2'));var path=require(_0x9db5('0x3'));var ejs=require(_0x9db5('0x4'));var fs=require('fs');var fs_extra=require(_0x9db5('0x5'));var _=require(_0x9db5('0x6'));var querystring=require(_0x9db5('0x7'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x9db5('0x8'))('api');var config=require(_0x9db5('0x9'));var db=require(_0x9db5('0xa'))['db'];config[_0x9db5('0xb')]=_[_0x9db5('0xc')](config[_0x9db5('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x9db5('0xd'))(new Redis(config[_0x9db5('0xb')]));require(_0x9db5('0xe'))[_0x9db5('0xf')](socket);var jayson=require(_0x9db5('0x10'));var client=jayson[_0x9db5('0x11')][_0x9db5('0x12')]({'port':0x232c});var client9002=jayson[_0x9db5('0x11')][_0x9db5('0x12')]({'port':0x232a});var client9003=jayson[_0x9db5('0x11')][_0x9db5('0x12')]({'port':0x232b});var client9001=jayson[_0x9db5('0x11')][_0x9db5('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x5806f8,_0x5e2372,_0x2f22d9,_0x241a58){return new BPromise(function(_0x5706c7,_0x46ab49){var _0x1da0a9=_0x241a58||client;return _0x1da0a9['request'](_0x5806f8,_0x2f22d9)['then'](function(_0x3572a2){logger['info'](_0x9db5('0x13'),_0x5e2372,_0x9db5('0x14'));logger[_0x9db5('0x15')](_0x9db5('0x16'),_0x5e2372,_0x9db5('0x14'),JSON[_0x9db5('0x17')](_0x3572a2));if(_0x3572a2[_0x9db5('0x18')]){if(_0x3572a2[_0x9db5('0x18')]['code']===0x1f4){logger[_0x9db5('0x18')](_0x9db5('0x13'),_0x5e2372,_0x3572a2[_0x9db5('0x18')]['message']);return _0x46ab49(_0x3572a2[_0x9db5('0x18')][_0x9db5('0x19')]);}logger[_0x9db5('0x18')](_0x9db5('0x13'),_0x5e2372,_0x3572a2[_0x9db5('0x18')]['message']);return _0x5706c7(_0x3572a2[_0x9db5('0x18')][_0x9db5('0x19')]);}else{logger[_0x9db5('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x5e2372,'request\x20sent');_0x5706c7(_0x3572a2['result']['message']);}})[_0x9db5('0x1b')](function(_0x3b3c74){logger[_0x9db5('0x18')](_0x9db5('0x13'),_0x5e2372,_0x3b3c74);_0x46ab49(_0x3b3c74);});});}function respondWithStatusCode(_0x7642f4,_0x1fb080){_0x1fb080=_0x1fb080||0xcc;return function(_0x2327c1){if(_0x2327c1){return _0x7642f4[_0x9db5('0x1c')](_0x1fb080);}return _0x7642f4[_0x9db5('0x1d')](_0x1fb080)[_0x9db5('0x1e')]();};}function respondWithResult(_0x312043,_0x5a929c){_0x5a929c=_0x5a929c||0xc8;return function(_0x44b30e){if(_0x44b30e){return _0x312043[_0x9db5('0x1d')](_0x5a929c)[_0x9db5('0x1f')](_0x44b30e);}};}function respondWithFilteredResult(_0xa94c78,_0x2d744c){return function(_0x3ab47a){if(_0x3ab47a){var _0x1aaa98=typeof _0x2d744c['offset']===_0x9db5('0x20')&&typeof _0x2d744c[_0x9db5('0x21')]===_0x9db5('0x20');var _0x1a28f3=_0x3ab47a[_0x9db5('0x22')];var _0x4a6a2b=_0x1aaa98?0x0:_0x2d744c['offset'];var _0x26b808=_0x1aaa98?_0x3ab47a[_0x9db5('0x22')]:_0x2d744c[_0x9db5('0x23')]+_0x2d744c[_0x9db5('0x21')];var _0x10b1ca;if(_0x26b808>=_0x1a28f3){_0x26b808=_0x1a28f3;_0x10b1ca=0xc8;}else{_0x10b1ca=0xce;}_0xa94c78[_0x9db5('0x1d')](_0x10b1ca);return _0xa94c78['set'](_0x9db5('0x24'),_0x4a6a2b+'-'+_0x26b808+'/'+_0x1a28f3)['json'](_0x3ab47a);}return null;};}function saveUpdates(_0x2713f9){return function(_0xb413b4){if(_0xb413b4){return _0xb413b4[_0x9db5('0x25')](_0x2713f9)['then'](function(_0x4ea482){return _0x4ea482;});}return null;};}function removeEntity(_0x1138a5){return function(_0xe9e4c2){if(_0xe9e4c2){return _0xe9e4c2[_0x9db5('0x26')]()[_0x9db5('0x27')](function(){var _0x4bf7f5=_0xe9e4c2['get']({'plain':!![]});var _0x483844=_0x9db5('0x28');return db[_0x9db5('0x29')][_0x9db5('0x26')]({'where':{'type':_0x483844,'resourceId':_0x4bf7f5['id']}})[_0x9db5('0x27')](function(){return _0xe9e4c2;});})[_0x9db5('0x27')](function(){_0x1138a5[_0x9db5('0x1d')](0xcc)[_0x9db5('0x1e')]();});}};}function handleEntityNotFound(_0x5e4276){return function(_0x2793f3){if(!_0x2793f3){_0x5e4276[_0x9db5('0x1c')](0x194);}return _0x2793f3;};}function handleError(_0x57acbb,_0x3ae594){_0x3ae594=_0x3ae594||0x1f4;return function(_0x451b79){logger['error'](_0x451b79[_0x9db5('0x2a')]);if(_0x451b79[_0x9db5('0x2b')]){delete _0x451b79[_0x9db5('0x2b')];}_0x57acbb['status'](_0x3ae594)[_0x9db5('0x2c')](_0x451b79);};}exports[_0x9db5('0x2d')]=function(_0x42daff,_0x30e104){var _0x52ff93={'include':[{'model':db[_0x9db5('0x2e')],'as':_0x9db5('0x2f')}]},_0x4f7374={},_0x10755a={'count':0x0,'rows':[]};var _0x587a74=_['map'](db[_0x9db5('0x30')][_0x9db5('0x31')],function(_0x29b5df){return{'name':_0x29b5df[_0x9db5('0x32')],'type':_0x29b5df['type'][_0x9db5('0x33')]};});_0x4f7374[_0x9db5('0x34')]=_[_0x9db5('0x35')](_0x587a74,_0x9db5('0x2b'));_0x4f7374['query']=_[_0x9db5('0x36')](_0x42daff[_0x9db5('0x37')]);_0x4f7374[_0x9db5('0x38')]=_['intersection'](_0x4f7374[_0x9db5('0x34')],_0x4f7374[_0x9db5('0x37')]);_0x52ff93[_0x9db5('0x39')]=_[_0x9db5('0x3a')](_0x4f7374[_0x9db5('0x34')],qs[_0x9db5('0x3b')](_0x42daff[_0x9db5('0x37')][_0x9db5('0x3b')]));_0x52ff93[_0x9db5('0x39')]=_0x52ff93[_0x9db5('0x39')][_0x9db5('0x3c')]?_0x52ff93[_0x9db5('0x39')]:_0x4f7374['model'];if(!_0x42daff[_0x9db5('0x37')][_0x9db5('0x3d')]('nolimit')){_0x52ff93[_0x9db5('0x21')]=qs[_0x9db5('0x21')](_0x42daff['query'][_0x9db5('0x21')]);_0x52ff93[_0x9db5('0x23')]=qs[_0x9db5('0x23')](_0x42daff[_0x9db5('0x37')][_0x9db5('0x23')]);}_0x52ff93[_0x9db5('0x3e')]=qs[_0x9db5('0x3f')](_0x42daff[_0x9db5('0x37')]['sort']);_0x52ff93[_0x9db5('0x40')]=qs[_0x9db5('0x38')](_[_0x9db5('0x41')](_0x42daff['query'],_0x4f7374['filters']),_0x587a74);if(_0x42daff[_0x9db5('0x37')][_0x9db5('0x42')]){_0x52ff93[_0x9db5('0x40')]=_[_0x9db5('0x43')](_0x52ff93[_0x9db5('0x40')],{'$or':_['map'](_0x587a74,function(_0x5c3d2f){if(_0x5c3d2f[_0x9db5('0x44')]!==_0x9db5('0x45')){var _0x420764={};_0x420764[_0x5c3d2f[_0x9db5('0x2b')]]={'$like':'%'+_0x42daff[_0x9db5('0x37')]['filter']+'%'};return _0x420764;}})});}_0x52ff93=_[_0x9db5('0x43')]({},_0x52ff93,_0x42daff[_0x9db5('0x46')]);var _0x1f0036={'where':_0x52ff93[_0x9db5('0x40')]};return db[_0x9db5('0x30')][_0x9db5('0x22')](_0x1f0036)[_0x9db5('0x27')](function(_0x2bf013){_0x10755a[_0x9db5('0x22')]=_0x2bf013;if(_0x42daff[_0x9db5('0x37')][_0x9db5('0x47')]){_0x52ff93['include']=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x52ff93);})['then'](function(_0x340160){_0x10755a[_0x9db5('0x48')]=_0x340160;return _0x10755a;})['then'](respondWithFilteredResult(_0x30e104,_0x52ff93))[_0x9db5('0x1b')](handleError(_0x30e104,null));};exports['show']=function(_0x155526,_0x51dc33){var _0x573b58={'raw':![],'where':{'id':_0x155526[_0x9db5('0x49')]['id']},'include':[{'model':db[_0x9db5('0x2e')],'as':'mandatoryDispositionPause'}]},_0x1452cd={};_0x1452cd[_0x9db5('0x34')]=_[_0x9db5('0x36')](db[_0x9db5('0x30')][_0x9db5('0x31')]);_0x1452cd[_0x9db5('0x37')]=_['keys'](_0x155526[_0x9db5('0x37')]);_0x1452cd[_0x9db5('0x38')]=_['intersection'](_0x1452cd[_0x9db5('0x34')],_0x1452cd['query']);_0x573b58[_0x9db5('0x39')]=_[_0x9db5('0x3a')](_0x1452cd[_0x9db5('0x34')],qs[_0x9db5('0x3b')](_0x155526[_0x9db5('0x37')][_0x9db5('0x3b')]));_0x573b58['attributes']=_0x573b58[_0x9db5('0x39')]['length']?_0x573b58['attributes']:_0x1452cd[_0x9db5('0x34')];if(_0x155526[_0x9db5('0x37')][_0x9db5('0x47')]){_0x573b58['include']=[{'all':!![]}];}_0x573b58=_[_0x9db5('0x43')]({},_0x573b58,_0x155526[_0x9db5('0x46')]);return db[_0x9db5('0x30')][_0x9db5('0x4a')](_0x573b58)[_0x9db5('0x27')](handleEntityNotFound(_0x51dc33,null))['then'](respondWithResult(_0x51dc33,null))['catch'](handleError(_0x51dc33,null));};exports['create']=function(_0x259d42,_0x429409){return db[_0x9db5('0x30')][_0x9db5('0x4b')](_0x259d42[_0x9db5('0x4c')],{})[_0x9db5('0x27')](function(_0xfdbf53){var _0x4992ac=_0x259d42[_0x9db5('0x4d')][_0x9db5('0x4e')]({'plain':!![]});if(!_0x4992ac)throw new Error(_0x9db5('0x4f'));if(_0x4992ac[_0x9db5('0x50')]==='user'){var _0x1e2a1c=_0xfdbf53['get']({'plain':!![]});var _0x599d2c=_0x9db5('0x28');return db[_0x9db5('0x51')][_0x9db5('0x4a')]({'where':{'name':_0x599d2c,'userProfileId':_0x4992ac[_0x9db5('0x52')]},'raw':!![]})['then'](function(_0x2d8a11){if(_0x2d8a11&&_0x2d8a11[_0x9db5('0x53')]===0x0){return db[_0x9db5('0x29')]['create']({'name':_0x1e2a1c[_0x9db5('0x2b')],'resourceId':_0x1e2a1c['id'],'type':_0x2d8a11[_0x9db5('0x2b')],'sectionId':_0x2d8a11['id']},{})['then'](function(){return _0xfdbf53;});}else{return _0xfdbf53;}})[_0x9db5('0x1b')](function(_0x391cbe){logger[_0x9db5('0x18')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x391cbe);throw _0x391cbe;});}return _0xfdbf53;})['then'](respondWithResult(_0x429409,0xc9))['catch'](handleError(_0x429409,null));};exports[_0x9db5('0x25')]=function(_0x5c761a,_0x3d461c){if(_0x5c761a[_0x9db5('0x4c')]['id']){delete _0x5c761a[_0x9db5('0x4c')]['id'];}return db[_0x9db5('0x30')]['find']({'where':{'id':_0x5c761a[_0x9db5('0x49')]['id']},'include':[{'model':db['Pause'],'as':_0x9db5('0x2f')}]})['then'](handleEntityNotFound(_0x3d461c,null))['then'](saveUpdates(_0x5c761a[_0x9db5('0x4c')],null))[_0x9db5('0x27')](respondWithResult(_0x3d461c,null))[_0x9db5('0x1b')](handleError(_0x3d461c,null));};exports[_0x9db5('0x26')]=function(_0x24953,_0x4053d3){return db[_0x9db5('0x30')][_0x9db5('0x4a')]({'where':{'id':_0x24953[_0x9db5('0x49')]['id']}})[_0x9db5('0x27')](handleEntityNotFound(_0x4053d3,null))['then'](removeEntity(_0x4053d3,null))['catch'](handleError(_0x4053d3,null));};exports['describe']=function(_0x12a204,_0x526d0b){return db[_0x9db5('0x30')][_0x9db5('0x54')]()[_0x9db5('0x27')](respondWithResult(_0x526d0b,null))['catch'](handleError(_0x526d0b,null));};exports['addDisposition']=function(_0x240bdd,_0x516e0f){if(_0x240bdd[_0x9db5('0x4c')]['id']){delete _0x240bdd[_0x9db5('0x4c')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x240bdd['params']['id']}})[_0x9db5('0x27')](handleEntityNotFound(_0x516e0f,null))[_0x9db5('0x27')](function(_0x109f27){if(_0x109f27){_0x240bdd[_0x9db5('0x4c')][_0x9db5('0x55')]=_0x109f27['id'];return db[_0x9db5('0x56')][_0x9db5('0x4b')](_0x240bdd[_0x9db5('0x4c')]);}})[_0x9db5('0x27')](respondWithResult(_0x516e0f,null))[_0x9db5('0x1b')](handleError(_0x516e0f,null));};exports[_0x9db5('0x57')]=function(_0x2e436a,_0x1f76f4){var _0x33f112={'raw':![],'where':{}};var _0x6d6174={};var _0x5c73ed={'count':0x0,'rows':[]};return db[_0x9db5('0x30')]['findOne']({'where':{'id':_0x2e436a[_0x9db5('0x49')]['id']}})[_0x9db5('0x27')](handleEntityNotFound(_0x1f76f4,null))[_0x9db5('0x27')](function(_0x3ecdec){if(_0x3ecdec){_0x6d6174[_0x9db5('0x34')]=_[_0x9db5('0x36')](db[_0x9db5('0x56')][_0x9db5('0x31')]);_0x6d6174[_0x9db5('0x37')]=_[_0x9db5('0x36')](_0x2e436a[_0x9db5('0x37')]);_0x6d6174[_0x9db5('0x38')]=_[_0x9db5('0x3a')](_0x6d6174[_0x9db5('0x34')],_0x6d6174['query']);_0x33f112[_0x9db5('0x39')]=_[_0x9db5('0x3a')](_0x6d6174[_0x9db5('0x34')],qs['fields'](_0x2e436a[_0x9db5('0x37')][_0x9db5('0x3b')]));_0x33f112['attributes']=_0x33f112[_0x9db5('0x39')][_0x9db5('0x3c')]?_0x33f112[_0x9db5('0x39')]:_0x6d6174[_0x9db5('0x34')];if(!_0x2e436a['query'][_0x9db5('0x3d')](_0x9db5('0x58'))){_0x33f112[_0x9db5('0x21')]=qs[_0x9db5('0x21')](_0x2e436a[_0x9db5('0x37')]['limit']);_0x33f112[_0x9db5('0x23')]=qs[_0x9db5('0x23')](_0x2e436a[_0x9db5('0x37')][_0x9db5('0x23')]);}_0x33f112['order']=qs['sort'](_0x2e436a[_0x9db5('0x37')][_0x9db5('0x3f')]);_0x33f112[_0x9db5('0x40')]=qs['filters'](_['pick'](_0x2e436a[_0x9db5('0x37')],_0x6d6174['filters']));_0x33f112[_0x9db5('0x40')][_0x9db5('0x55')]=_0x3ecdec['id'];if(_0x2e436a['query'][_0x9db5('0x42')]){_0x33f112[_0x9db5('0x40')]=_['merge'](_0x33f112[_0x9db5('0x40')],{'$or':_[_0x9db5('0x35')](_0x33f112[_0x9db5('0x39')],function(_0x3999a1){var _0x2689a6={};_0x2689a6[_0x3999a1]={'$like':'%'+_0x2e436a[_0x9db5('0x37')][_0x9db5('0x42')]+'%'};return _0x2689a6;})});}_0x33f112=_[_0x9db5('0x43')]({},_0x33f112,_0x2e436a['options']);return db[_0x9db5('0x56')][_0x9db5('0x22')]({'where':_0x33f112[_0x9db5('0x40')]})[_0x9db5('0x27')](function(_0x568b40){_0x5c73ed[_0x9db5('0x22')]=_0x568b40;if(_0x2e436a[_0x9db5('0x37')]['includeAll']){_0x33f112[_0x9db5('0x59')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x33f112);})[_0x9db5('0x27')](function(_0x2ede31){_0x5c73ed[_0x9db5('0x48')]=_0x2ede31;return _0x5c73ed;});}})[_0x9db5('0x27')](respondWithFilteredResult(_0x1f76f4,_0x33f112))[_0x9db5('0x1b')](handleError(_0x1f76f4,null));};exports[_0x9db5('0x5a')]=function(_0x3e0763,_0x5b9860){return db[_0x9db5('0x30')]['find']({'where':{'id':_0x3e0763['params']['id']}})[_0x9db5('0x27')](handleEntityNotFound(_0x5b9860,null))[_0x9db5('0x27')](function(_0x7244a1){if(_0x7244a1){return _0x7244a1[_0x9db5('0x5a')](_0x3e0763[_0x9db5('0x37')]['ids']);}})[_0x9db5('0x27')](respondWithStatusCode(_0x5b9860,null))[_0x9db5('0x1b')](handleError(_0x5b9860,null));};exports[_0x9db5('0x5b')]=function(_0x42e0df,_0x43ec7a){if(_0x42e0df['body']['id']){delete _0x42e0df['body']['id'];}return db['ChatWebsite'][_0x9db5('0x4a')]({'where':{'id':_0x42e0df[_0x9db5('0x49')]['id']}})[_0x9db5('0x27')](handleEntityNotFound(_0x43ec7a,null))[_0x9db5('0x27')](function(_0x3984ff){if(_0x3984ff){_0x42e0df['body'][_0x9db5('0x55')]=_0x3984ff['id'];return db['CannedAnswer'][_0x9db5('0x4b')](_0x42e0df[_0x9db5('0x4c')]);}})[_0x9db5('0x27')](respondWithResult(_0x43ec7a,null))['catch'](handleError(_0x43ec7a,null));};exports[_0x9db5('0x5c')]=function(_0x516222,_0x5bc7f7){var _0x2cb3e5={'raw':![],'where':{}};var _0x3345d5={};var _0x3457cd={'count':0x0,'rows':[]};return db[_0x9db5('0x30')][_0x9db5('0x5d')]({'where':{'id':_0x516222[_0x9db5('0x49')]['id']}})[_0x9db5('0x27')](handleEntityNotFound(_0x5bc7f7,null))['then'](function(_0x4efcc7){if(_0x4efcc7){_0x3345d5[_0x9db5('0x34')]=_['keys'](db[_0x9db5('0x5e')][_0x9db5('0x31')]);_0x3345d5[_0x9db5('0x37')]=_['keys'](_0x516222[_0x9db5('0x37')]);_0x3345d5[_0x9db5('0x38')]=_[_0x9db5('0x3a')](_0x3345d5[_0x9db5('0x34')],_0x3345d5[_0x9db5('0x37')]);_0x2cb3e5[_0x9db5('0x39')]=_[_0x9db5('0x3a')](_0x3345d5[_0x9db5('0x34')],qs[_0x9db5('0x3b')](_0x516222[_0x9db5('0x37')][_0x9db5('0x3b')]));_0x2cb3e5[_0x9db5('0x39')]=_0x2cb3e5[_0x9db5('0x39')][_0x9db5('0x3c')]?_0x2cb3e5[_0x9db5('0x39')]:_0x3345d5[_0x9db5('0x34')];if(!_0x516222[_0x9db5('0x37')]['hasOwnProperty']('nolimit')){_0x2cb3e5[_0x9db5('0x21')]=qs[_0x9db5('0x21')](_0x516222[_0x9db5('0x37')][_0x9db5('0x21')]);_0x2cb3e5['offset']=qs[_0x9db5('0x23')](_0x516222[_0x9db5('0x37')]['offset']);}_0x2cb3e5['order']=qs[_0x9db5('0x3f')](_0x516222['query'][_0x9db5('0x3f')]);_0x2cb3e5[_0x9db5('0x40')]=qs['filters'](_[_0x9db5('0x41')](_0x516222[_0x9db5('0x37')],_0x3345d5[_0x9db5('0x38')]));_0x2cb3e5['where'][_0x9db5('0x55')]=_0x4efcc7['id'];if(_0x516222[_0x9db5('0x37')][_0x9db5('0x42')]){_0x2cb3e5[_0x9db5('0x40')]=_[_0x9db5('0x43')](_0x2cb3e5['where'],{'$or':_['map'](_0x2cb3e5[_0x9db5('0x39')],function(_0xf03140){var _0x3ed584={};_0x3ed584[_0xf03140]={'$like':'%'+_0x516222[_0x9db5('0x37')][_0x9db5('0x42')]+'%'};return _0x3ed584;})});}_0x2cb3e5=_[_0x9db5('0x43')]({},_0x2cb3e5,_0x516222[_0x9db5('0x46')]);return db['CannedAnswer'][_0x9db5('0x22')]({'where':_0x2cb3e5['where']})['then'](function(_0x34593c){_0x3457cd[_0x9db5('0x22')]=_0x34593c;if(_0x516222[_0x9db5('0x37')][_0x9db5('0x47')]){_0x2cb3e5[_0x9db5('0x59')]=[{'all':!![]}];}return db['CannedAnswer'][_0x9db5('0x5f')](_0x2cb3e5);})['then'](function(_0x2ef06e){_0x3457cd[_0x9db5('0x48')]=_0x2ef06e;return _0x3457cd;});}})[_0x9db5('0x27')](respondWithFilteredResult(_0x5bc7f7,_0x2cb3e5))[_0x9db5('0x1b')](handleError(_0x5bc7f7,null));};exports['removeAnswers']=function(_0x1f1462,_0x341b7){return db['ChatWebsite']['find']({'where':{'id':_0x1f1462['params']['id']}})[_0x9db5('0x27')](handleEntityNotFound(_0x341b7,null))[_0x9db5('0x27')](function(_0x54ff22){if(_0x54ff22){return _0x54ff22[_0x9db5('0x60')](_0x1f1462[_0x9db5('0x37')][_0x9db5('0x61')]);}})[_0x9db5('0x27')](respondWithStatusCode(_0x341b7,null))[_0x9db5('0x1b')](handleError(_0x341b7,null));};exports[_0x9db5('0x62')]=function(_0x5e45ab,_0x54be42){_0x5e45ab[_0x9db5('0x4c')][_0x9db5('0x63')]=_0x5e45ab[_0x9db5('0x64')][_0x9db5('0x65')];return db[_0x9db5('0x30')]['find']({'where':{'id':_0x5e45ab[_0x9db5('0x49')]['id']}})[_0x9db5('0x27')](handleEntityNotFound(_0x54be42,null))[_0x9db5('0x27')](saveUpdates(_0x5e45ab[_0x9db5('0x4c')],null))['then'](respondWithResult(_0x54be42,null))['catch'](handleError(_0x54be42,null));};exports[_0x9db5('0x66')]=function(_0x3b5f56,_0x465a12){_0x3b5f56[_0x9db5('0x4c')][_0x9db5('0x67')]=_0x3b5f56['file'][_0x9db5('0x65')];return db[_0x9db5('0x30')][_0x9db5('0x4a')]({'where':{'id':_0x3b5f56[_0x9db5('0x49')]['id']}})[_0x9db5('0x27')](handleEntityNotFound(_0x465a12,null))[_0x9db5('0x27')](saveUpdates(_0x3b5f56[_0x9db5('0x4c')],null))[_0x9db5('0x27')](respondWithResult(_0x465a12,null))[_0x9db5('0x1b')](handleError(_0x465a12,null));};exports[_0x9db5('0x68')]=function(_0xdd7bdf,_0x1a14f0){_0xdd7bdf[_0x9db5('0x4c')]['customerAvatar']=_0xdd7bdf[_0x9db5('0x64')][_0x9db5('0x65')];return db['ChatWebsite'][_0x9db5('0x4a')]({'where':{'id':_0xdd7bdf[_0x9db5('0x49')]['id']}})[_0x9db5('0x27')](handleEntityNotFound(_0x1a14f0,null))[_0x9db5('0x27')](saveUpdates(_0xdd7bdf[_0x9db5('0x4c')],null))[_0x9db5('0x27')](respondWithResult(_0x1a14f0,null))[_0x9db5('0x1b')](handleError(_0x1a14f0,null));};exports[_0x9db5('0x69')]=function(_0x3596d3,_0x56cca6){_0x3596d3[_0x9db5('0x4c')]['systemAvatar']=_0x3596d3[_0x9db5('0x64')][_0x9db5('0x65')];return db['ChatWebsite'][_0x9db5('0x4a')]({'where':{'id':_0x3596d3['params']['id']}})['then'](handleEntityNotFound(_0x56cca6,null))[_0x9db5('0x27')](saveUpdates(_0x3596d3[_0x9db5('0x4c')],null))[_0x9db5('0x27')](respondWithResult(_0x56cca6,null))[_0x9db5('0x1b')](handleError(_0x56cca6,null));};exports[_0x9db5('0x6a')]=function(_0x5cb3fb,_0x4f5952){var _0x14fdf8=path['join'](config[_0x9db5('0x6b')],_0x9db5('0x6c'));var _0x43f0d1={'where':{'id':_0x5cb3fb[_0x9db5('0x49')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x4fbac9=![];return require(_0x9db5('0x6d'))['getLicense']()[_0x9db5('0x27')](function(_0x1a7d12){if(_0x1a7d12){_0x4fbac9=_0x1a7d12[_0x9db5('0x6e')];}})[_0x9db5('0x27')](function(){return db['ChatWebsite'][_0x9db5('0x4a')](_0x43f0d1);})['then'](handleEntityNotFound(_0x4f5952,null))[_0x9db5('0x27')](function(_0x589d8c){if(_0x589d8c){if(!_[_0x9db5('0x6f')](_0x589d8c['sitepic'])){if(fs[_0x9db5('0x70')](path[_0x9db5('0x71')](config[_0x9db5('0x6b')],_0x9db5('0x72'),_0x589d8c[_0x9db5('0x63')]))&&_0x4fbac9){_0x14fdf8=path[_0x9db5('0x71')](config[_0x9db5('0x6b')],_0x9db5('0x72'),_0x589d8c[_0x9db5('0x63')]);}}return _0x4f5952[_0x9db5('0x73')](_0x14fdf8);}})[_0x9db5('0x1b')](handleError(_0x4f5952,null));};exports[_0x9db5('0x74')]=function(_0xf2c417,_0x5aa6cc){var _0x528008=path[_0x9db5('0x71')](config[_0x9db5('0x6b')],_0x9db5('0x75'));var _0x1c813e={'where':{'id':_0xf2c417[_0x9db5('0x49')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite'][_0x9db5('0x4a')](_0x1c813e)['then'](handleEntityNotFound(_0x5aa6cc,null))[_0x9db5('0x27')](function(_0xf7da64){if(_0xf7da64){if(!_['isNil'](_0xf7da64['agentAvatar'])){if(fs['existsSync'](path[_0x9db5('0x71')](config['root'],_0x9db5('0x76'),_0xf7da64[_0x9db5('0x67')]))){_0x528008=path['join'](config['root'],_0x9db5('0x76'),_0xf7da64[_0x9db5('0x67')]);}}return _0x5aa6cc[_0x9db5('0x73')](_0x528008);}})[_0x9db5('0x1b')](handleError(_0x5aa6cc,null));};exports['getCustomerAvatar']=function(_0x4a53a7,_0x563005){var _0x5e3f71=path['join'](config[_0x9db5('0x6b')],_0x9db5('0x77'));var _0x460d09={'where':{'id':_0x4a53a7[_0x9db5('0x49')]['id']},'attributes':['id',_0x9db5('0x78'),_0x9db5('0x79')],'raw':!![]};return db[_0x9db5('0x30')][_0x9db5('0x4a')](_0x460d09)[_0x9db5('0x27')](handleEntityNotFound(_0x563005,null))[_0x9db5('0x27')](function(_0x2eb2ce){if(_0x2eb2ce){if(!_[_0x9db5('0x6f')](_0x2eb2ce[_0x9db5('0x78')])){if(fs[_0x9db5('0x70')](path[_0x9db5('0x71')](config[_0x9db5('0x6b')],_0x9db5('0x76'),_0x2eb2ce[_0x9db5('0x78')]))&&_0x2eb2ce[_0x9db5('0x79')]){_0x5e3f71=path['join'](config['root'],_0x9db5('0x76'),_0x2eb2ce[_0x9db5('0x78')]);}}return _0x563005[_0x9db5('0x73')](_0x5e3f71);}})[_0x9db5('0x1b')](handleError(_0x563005,null));};exports['getSystemAvatar']=function(_0xef1a2c,_0x1aeeb4){var _0x43799e=path[_0x9db5('0x71')](config[_0x9db5('0x6b')],_0x9db5('0x7a'));var _0xfd8af9={'where':{'id':_0xef1a2c[_0x9db5('0x49')]['id']},'attributes':['id',_0x9db5('0x7b')],'raw':!![]};return db[_0x9db5('0x30')]['find'](_0xfd8af9)[_0x9db5('0x27')](handleEntityNotFound(_0x1aeeb4,null))[_0x9db5('0x27')](function(_0x1d532c){if(_0x1d532c){if(!_[_0x9db5('0x6f')](_0x1d532c[_0x9db5('0x7b')])){if(fs['existsSync'](path[_0x9db5('0x71')](config[_0x9db5('0x6b')],'server/files/images/avatars/',_0x1d532c[_0x9db5('0x7b')]))){_0x43799e=path['join'](config[_0x9db5('0x6b')],_0x9db5('0x76'),_0x1d532c[_0x9db5('0x7b')]);}}return _0x1aeeb4[_0x9db5('0x73')](_0x43799e);}})[_0x9db5('0x1b')](handleError(_0x1aeeb4,null));};exports[_0x9db5('0x7c')]=function(_0x38be57,_0x1bce12){var _0x2af504=require('user-agent-parser');var _0x373d31=new _0x2af504();var _0x26edf8=_0x373d31[_0x9db5('0x7d')](_0x38be57['headers'][_0x9db5('0x7e')])[_0x9db5('0x7f')]();var _0x3e79a9={'body':_0x38be57['body'],'channel':_0x9db5('0x80')};var _0x4f2f10=[];var _0x5d95c7=[];var _0x43d8a8={};var _0x170cae=![];return db[_0x9db5('0x81')][_0x9db5('0x54')]()[_0x9db5('0x27')](function(_0x26724a){if(!_0x26724a){throw new db[(_0x9db5('0x82'))]['ValidationError'](_0x9db5('0x83'));}_0x4f2f10=_[_0x9db5('0x84')](_['keys'](_0x26724a),['createdAt',_0x9db5('0x85')]);_0x5d95c7=_['difference'](_['keys'](_0x26724a),['createdAt',_0x9db5('0x85'),_0x9db5('0x86'),'ListId']);if(_0x38be57[_0x9db5('0x4c')]['id']){delete _0x38be57[_0x9db5('0x4c')]['id'];}if(_[_0x9db5('0x6f')](_0x38be57[_0x9db5('0x4c')]['from'])){throw new db[(_0x9db5('0x82'))][(_0x9db5('0x87'))]('from\x20is\x20mandatory');}if(_[_0x9db5('0x6f')](_0x38be57[_0x9db5('0x4c')]['body'])||_0x38be57['body'][_0x9db5('0x4c')]===''){throw new db[(_0x9db5('0x82'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9db5('0x6f')](_0x38be57[_0x9db5('0x4c')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0x9db5('0x88')+_0x5d95c7);}if(!_[_0x9db5('0x89')](_0x5d95c7,_0x38be57[_0x9db5('0x4c')][_0x9db5('0x8a')])){throw new db[(_0x9db5('0x82'))][(_0x9db5('0x87'))](_0x9db5('0x8b')+_0x5d95c7);}_0x43d8a8[_0x38be57[_0x9db5('0x4c')][_0x9db5('0x8a')]]=_0x38be57[_0x9db5('0x4c')][_0x9db5('0x8c')];})[_0x9db5('0x27')](function(){return db[_0x9db5('0x30')][_0x9db5('0x4a')]({'where':{'id':_0x38be57[_0x9db5('0x49')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x9db5('0x81')],'as':_0x9db5('0x8d'),'where':_0x43d8a8,'limit':0x1,'order':[[_0x9db5('0x85'),_0x9db5('0x8e')]]}]},{'model':db[_0x9db5('0x8f')],'as':_0x9db5('0x90')}]});})['then'](handleEntityNotFound(_0x1bce12,null))['then'](function(_0xc81e79){if(_0xc81e79&&_0xc81e79[_0x9db5('0x91')]){_0x3e79a9['account']=_0xc81e79;_0x3e79a9[_0x9db5('0x92')]=_0xc81e79[_0x9db5('0x90')];_0x3e79a9[_0x9db5('0x93')]=_0xc81e79[_0x9db5('0x91')];_0x3e79a9[_0x9db5('0x92')]=_[_0x9db5('0x94')](_0x3e79a9[_0x9db5('0x92')],[_0x9db5('0x95')],[_0x9db5('0x96')]);if(_0x3e79a9[_0x9db5('0x97')][_0x9db5('0x90')]){delete _0x3e79a9['account'][_0x9db5('0x90')];}if(_0x3e79a9[_0x9db5('0x97')][_0x9db5('0x91')]&&_0x3e79a9[_0x9db5('0x97')][_0x9db5('0x91')][_0x9db5('0x8d')][_0x9db5('0x3c')]){return _0x3e79a9['account'][_0x9db5('0x91')][_0x9db5('0x8d')][0x0];}var _0x572055=_[_0x9db5('0xc')](_0x38be57[_0x9db5('0x4c')],{'firstName':_0x38be57[_0x9db5('0x4c')][_0x9db5('0x8c')],'ListId':_0xc81e79[_0x9db5('0x98')]});_0x572055[_0x38be57[_0x9db5('0x4c')]['mapKey']]=_0x38be57['body'][_0x9db5('0x8c')];return db[_0x9db5('0x81')][_0x9db5('0x4b')](_0x572055,{'fields':_0x4f2f10,'raw':!![]});}})[_0x9db5('0x27')](handleEntityNotFound(_0x1bce12,null))[_0x9db5('0x27')](function(_0x3c5c27){_0x3e79a9[_0x9db5('0x99')]=_0x3c5c27;var _0x29acdc=_0x38be57[_0x9db5('0x4c')][_0x9db5('0x9a')];if(_0x38be57[_0x9db5('0x9b')][_0x9db5('0x9c')]){_0x29acdc=_0x38be57[_0x9db5('0x9b')][_0x9db5('0x9c')];}else if(_0x38be57[_0x9db5('0x9b')]['x-forwarded-for']){_0x29acdc=_[_0x9db5('0x9d')](_0x38be57[_0x9db5('0x9b')][_0x9db5('0x9e')]['split'](','));}if(_0x3c5c27){var _0x2f25b1={'ContactId':_0x3c5c27['id'],'ChatWebsiteId':_0x38be57['params']['id'],'from':(_0x3c5c27['firstName']||'')+'\x20'+(_0x3c5c27[_0x9db5('0x9f')]||''),'customerIp':_0x29acdc,'customerPort':_0x38be57[_0x9db5('0x9b')][_0x9db5('0xa0')]?_0x38be57[_0x9db5('0x9b')][_0x9db5('0xa0')]:null,'referer':_0x38be57[_0x9db5('0x4c')]['referer'],'browserName':_0x26edf8['browser']['name']&&_0x26edf8[_0x9db5('0xa1')][_0x9db5('0xa2')]?util[_0x9db5('0xa3')](_0x9db5('0xa4'),_0x26edf8[_0x9db5('0xa1')][_0x9db5('0x2b')],_0x26edf8[_0x9db5('0xa1')][_0x9db5('0xa2')]):_0x9db5('0xa5'),'browserVersion':_0x26edf8[_0x9db5('0xa1')]['version']||_0x9db5('0xa5'),'osName':util[_0x9db5('0xa3')](_0x9db5('0xa4'),_0x26edf8['os']['name'],_0x26edf8['os']['version']),'osVersion':_0x26edf8['os'][_0x9db5('0xa2')],'deviceModel':_0x26edf8[_0x9db5('0xa6')][_0x9db5('0x34')]&&_0x26edf8[_0x9db5('0xa6')][_0x9db5('0xa7')]?util['format'](_0x9db5('0xa8'),_0x26edf8[_0x9db5('0xa6')]['model'],_0x26edf8[_0x9db5('0xa6')][_0x9db5('0xa7')],_0x26edf8['device'][_0x9db5('0x44')]):null,'deviceVendor':_0x26edf8['device'][_0x9db5('0xa7')],'deviceType':_0x26edf8[_0x9db5('0xa6')][_0x9db5('0x44')],'formData':JSON[_0x9db5('0x17')](_0x38be57[_0x9db5('0x4c')])};var _0x34a9fa={'ChatWebsiteId':_0x38be57[_0x9db5('0x49')]['id'],'closed':![]};if(_0x38be57[_0x9db5('0x4c')]['threadId']){_0x34a9fa[_0x9db5('0xa9')]=_0x38be57[_0x9db5('0x4c')]['threadId'];return db[_0x9db5('0xaa')]['find']({'where':_0x34a9fa})[_0x9db5('0x27')](function(_0x537884){if(_0x537884){return[_0x537884,![]];}_0x2f25b1[_0x9db5('0xa9')]=_0x38be57[_0x9db5('0x4c')][_0x9db5('0xa9')];_0x2f25b1['externalUrl']=_0x38be57[_0x9db5('0x4c')][_0x9db5('0xab')];return db[_0x9db5('0xaa')][_0x9db5('0x4b')](_0x2f25b1)['then'](function(_0x469219){return[_0x469219,!![]];});});}_0x34a9fa[_0x9db5('0xac')]=_0x3c5c27['id'];if(_0x38be57['body'][_0x9db5('0xad')]&&_0x38be57[_0x9db5('0x4c')]['interaction']['id']){_0x34a9fa['id']=_0x38be57[_0x9db5('0x4c')][_0x9db5('0xad')]['id'];return db[_0x9db5('0xaa')][_0x9db5('0x4a')]({'where':_0x34a9fa})['then'](function(_0x3bd520){if(_0x3bd520){return[_0x3bd520,![]];}return db[_0x9db5('0xaa')][_0x9db5('0x4b')](_0x2f25b1)[_0x9db5('0x27')](function(_0x37be1f){return[_0x37be1f,!![]];});});}return db[_0x9db5('0xaa')][_0x9db5('0x4b')](_0x2f25b1)[_0x9db5('0x27')](function(_0x5229ce){return[_0x5229ce,!![]];});}})['spread'](function(_0x41824c,_0x2e096a){if(_0x41824c){_0x170cae=_0x2e096a;if(!_0x2e096a){var _0x2ebe86={'from':(_0x3e79a9[_0x9db5('0x99')]['firstName']||'')+'\x20'+(_0x3e79a9['contact']['lastName']||'')};if(_0x38be57[_0x9db5('0x4c')][_0x9db5('0xa9')]&&_0x38be57[_0x9db5('0x4c')][_0x9db5('0xae')]&&_0x38be57[_0x9db5('0x4c')]['threadId']!=_0x38be57[_0x9db5('0x4c')][_0x9db5('0xae')]){_0x2ebe86[_0x9db5('0xa9')]=_0x38be57[_0x9db5('0x4c')][_0x9db5('0xae')];}return _0x41824c['update'](_0x2ebe86);}else{return _0x41824c;}}})[_0x9db5('0x27')](function(_0x4fb61e){_0x3e79a9['interaction']=_0x4fb61e[_0x9db5('0x4e')]({'plain':!![]});_0x3e79a9[_0x9db5('0xad')]['created']=_0x170cae;if(_0x3e79a9[_0x9db5('0xad')][_0x9db5('0xaf')]){if(_0x3e79a9['account'][_0x9db5('0xb0')]){_0x3e79a9[_0x9db5('0x92')][_0x9db5('0xb1')]({'id':0x0,'priority':_0x3e79a9[_0x9db5('0x92')][_0x9db5('0x3c')]+0x1,'app':_0x9db5('0xb2'),'appdata':'unmanaged','interval':_0x9db5('0xb3')});}}return db[_0x9db5('0xb4')]['create']({'body':_0x38be57[_0x9db5('0x4c')]['body'],'ChatWebsiteId':_0x38be57[_0x9db5('0x49')]['id'],'ChatInteractionId':_0x4fb61e['id'],'direction':'in','ContactId':_0x3e79a9[_0x9db5('0x99')]['id'],'AttachmentId':_0x38be57[_0x9db5('0x4c')]['AttachmentId']});})[_0x9db5('0x27')](function(_0x458a6c){_0x3e79a9['message']=_0x458a6c;if(_0x3e79a9[_0x9db5('0xad')]['UserId']){return db[_0x9db5('0xb5')][_0x9db5('0x4a')]({'attributes':['id','name'],'where':{'id':_0x3e79a9[_0x9db5('0xad')]['UserId']}})['then'](function(_0x2ce6d8){if(_0x2ce6d8){_0x3e79a9['applications'][_0x9db5('0xb6')]({'id':0x0,'priority':0x0,'app':_0x9db5('0xb7'),'appdata':_0x2ce6d8[_0x9db5('0x2b')]+','+(_0x3e79a9[_0x9db5('0x97')][_0x9db5('0xb8')]||0xa),'interval':'*,*,*,*'});_0x3e79a9[_0x9db5('0xb9')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x3e79a9);});}return respondWithRpcPromise(_0x9db5('0xba'),_0x9db5('0xbb'),_0x3e79a9);})[_0x9db5('0x27')](function(_0x74809b){respondWithRpcPromise('EventManager','EventManager',{'event':_0x9db5('0x7c'),'message':_0x74809b},client9002);return _0x74809b;})['then'](respondWithResult(_0x1bce12,null))[_0x9db5('0x1b')](handleError(_0x1bce12,null));};exports[_0x9db5('0xbc')]=function(_0xd4e25a,_0x509a20){var _0x18b1ed,_0x4be959,_0x470bb4;var _0x2918d6=[];var _0x558c5c={};var _0x569df2=_0xd4e25a[_0x9db5('0xbd')]||[];var _0x1ac2b8=[];var _0x1710e3;return db[_0x9db5('0x81')][_0x9db5('0x54')]()[_0x9db5('0x27')](function(_0x3c769d){if(!_0x3c769d){throw new db[(_0x9db5('0x82'))]['ValidationError'](_0x9db5('0x83'));}_0x2918d6=_[_0x9db5('0x84')](_[_0x9db5('0x36')](_0x3c769d),['createdAt','updatedAt',_0x9db5('0x86'),'ListId']);if(_0xd4e25a[_0x9db5('0x4c')]['id']){delete _0xd4e25a[_0x9db5('0x4c')]['id'];}if(_['isNil'](_0xd4e25a[_0x9db5('0x4c')][_0x9db5('0x8c')])){throw _0x509a20[_0x9db5('0x1d')](0x1f4)[_0x9db5('0x2c')](new db[(_0x9db5('0x82'))][(_0x9db5('0x87'))](_0x9db5('0xbe')));}if(_[_0x9db5('0x6f')](_0xd4e25a[_0x9db5('0x4c')][_0x9db5('0x4c')])||_0xd4e25a[_0x9db5('0x4c')][_0x9db5('0x4c')]===''){throw _0x509a20[_0x9db5('0x1d')](0x1f4)[_0x9db5('0x2c')](new db[(_0x9db5('0x82'))]['ValidationError'](_0x9db5('0xbf')));}if(_['isNil'](_0xd4e25a[_0x9db5('0x4c')][_0x9db5('0xc0')])){throw _0x509a20[_0x9db5('0x1d')](0x1f4)[_0x9db5('0x2c')](new db['Sequelize']['ValidationError'](_0x9db5('0xc1')+_0x2918d6));}if(!_[_0x9db5('0x89')](_0x2918d6,_0xd4e25a[_0x9db5('0x4c')][_0x9db5('0xc0')])){throw _0x509a20[_0x9db5('0x1d')](0x1f4)[_0x9db5('0x2c')](new db[(_0x9db5('0x82'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2918d6));}_0x558c5c[_0xd4e25a['body'][_0x9db5('0xc0')]]=_0xd4e25a[_0x9db5('0x4c')][_0x9db5('0x8c')];})[_0x9db5('0x27')](function(){return db[_0x9db5('0x30')][_0x9db5('0x4a')]({'where':{'id':_0xd4e25a[_0x9db5('0x49')]['id']},'include':[{'model':db[_0x9db5('0xc2')],'as':_0x9db5('0x91')},{'model':db[_0x9db5('0xc3')],'as':_0x9db5('0xc3')}]});})[_0x9db5('0x27')](handleEntityNotFound(_0x509a20,null))[_0x9db5('0x27')](function(_0x5760c5){if(_0x5760c5&&_0x5760c5[_0x9db5('0x91')]){_0x4be959=_0x5760c5;var _0x31d146=_[_0x9db5('0xc')](_0xd4e25a[_0x9db5('0x4c')],{'firstName':_0xd4e25a[_0x9db5('0x4c')]['from'],'phone':_0xd4e25a[_0x9db5('0x4c')][_0x9db5('0x8c')],'ListId':_0x5760c5['ListId']});_0x31d146[_0xd4e25a[_0x9db5('0x4c')][_0x9db5('0xc0')]]=_0xd4e25a[_0x9db5('0x4c')][_0x9db5('0x8c')];return db['CmContact'][_0x9db5('0xc4')]({'where':_0x558c5c,'defaults':_0x31d146});}})[_0x9db5('0xc5')](function(_0x3caa60){if(_0x3caa60){_0x470bb4=_0x3caa60;var _0x4f76ca=fs[_0x9db5('0xc6')](path['join'](config[_0x9db5('0x6b')],_0x9db5('0xc7')),_0x9db5('0xc8'));var _0x536879=ejs[_0x9db5('0xc9')](_0x4f76ca,{'body':_['toPairs'](_0xd4e25a[_0x9db5('0x4c')][_0x9db5('0x4c')]),'bodyTitle':_0x4be959['offlineMessageBody']});return db[_0x9db5('0xca')][_0x9db5('0x4b')]({'body':_0x536879,'ContactId':_0x3caa60['id'],'ChatWebsiteId':_0x4be959['id']});}})[_0x9db5('0x27')](function(_0x3c3796){_0x1710e3=_0x3c3796;if(_0x569df2[_0x9db5('0x3c')]){var _0x465ac7=_0x569df2[_0x9db5('0x35')](function(_0x5a272c){return{'name':_0x5a272c[_0x9db5('0xcb')],'basename':_0x5a272c['filename'],'type':_0x5a272c['mimetype'],'ChatOfflineMessageId':_0x3c3796['id']};});_0x1ac2b8=_0x465ac7[_0x9db5('0x35')](_0x4403b3=>{var _0x4356c9={'filename':_0x4403b3[_0x9db5('0x2b')],'path':path[_0x9db5('0x71')](config['root'],_0x9db5('0xcc'),'files','attachments','offline-chat',_0x4403b3[_0x9db5('0xcd')])};return _0x4356c9;});if(!_0x4be959[_0x9db5('0xce')]){return db[_0x9db5('0xcf')][_0x9db5('0xd0')](function(_0x11fba6){return db['Attachment'][_0x9db5('0xd1')](_0x465ac7,{'transaction':_0x11fba6});});}}})[_0x9db5('0x27')](function(){if(_0x1710e3){_0x18b1ed=_0x1710e3;return db['MailAccount'][_0x9db5('0x5d')]({'where':{'active':!![]},'include':[{'model':db[_0x9db5('0xd2')],'as':'Smtp','raw':!![]}]});}})[_0x9db5('0x27')](function(_0x3295f2){if(_0x3295f2&&_0x3295f2[_0x9db5('0xd3')]&&_0x4be959['forwardOffline']&&_0x4be959[_0x9db5('0xd4')]){var _0x345fee={'tls':{'rejectUnauthorized':![]}};if(_0x3295f2[_0x9db5('0xd3')]['service']){_0x345fee['service']=_0x3295f2[_0x9db5('0xd3')][_0x9db5('0xd5')];}else{_0x345fee['host']=_0x3295f2['Smtp']['host'];_0x345fee['port']=_0x3295f2[_0x9db5('0xd3')][_0x9db5('0xd6')];_0x345fee[_0x9db5('0xd7')]=_0x3295f2[_0x9db5('0xd3')][_0x9db5('0xd7')];}if(_0x3295f2[_0x9db5('0xd3')][_0x9db5('0xd8')]){_0x345fee[_0x9db5('0xd9')]={'user':_0x3295f2['Smtp']['user'],'pass':_0x3295f2[_0x9db5('0xd3')][_0x9db5('0xda')]};}return respondWithRpcPromise(_0x9db5('0xdb'),_0x9db5('0xdc'),{'account':_0x345fee,'message':{'from':util[_0x9db5('0xa3')](_0x9db5('0xdd'),_0x3295f2[_0x9db5('0x2b')],_0x3295f2[_0x9db5('0xde')]||_0x3295f2['Smtp'][_0x9db5('0x4d')]),'to':_0x4be959[_0x9db5('0xd4')],'subject':_0x4be959[_0x9db5('0xdf')],'html':_0x18b1ed[_0x9db5('0x4c')],'attachments':_0x1ac2b8}},client9003)[_0x9db5('0x27')](function(){return _0x18b1ed;})[_0x9db5('0x1b')](function(_0x4575fc){console[_0x9db5('0x18')](_0x4575fc);});}})[_0x9db5('0x27')](function(){if(_0x4be959&&_0x4be959[_0x9db5('0xce')]&&_0x4be959[_0x9db5('0xe0')]){var _0x1c6f90=[];if(_0x569df2[_0x9db5('0x3c')]){_0x1c6f90=_0x569df2[_0x9db5('0x35')](function(_0x268ea8){return{'name':_0x268ea8[_0x9db5('0xcb')],'basename':_0x268ea8[_0x9db5('0x65')],'type':_0x268ea8[_0x9db5('0xe1')],'ChatOfflineMessageId':_0x1710e3['id']};});}var _0x4f301d;if(!_['isNil'](_0x4be959[_0x9db5('0xe2')])){var _0x1b9efd=_[_0x9db5('0x35')](_0xd4e25a[_0x9db5('0x4c')],function(_0x520503){return _0x520503;});var _0x3d2506=_[_0x9db5('0xe3')](_0x1b9efd)[0x0];var _0x4403c4=_[_0x9db5('0xe4')](_0x3d2506,function(_0x5f2d34){return _0x5f2d34;});_0x4f301d=_0x4403c4[0x1][_0x4be959[_0x9db5('0xe2')]];}var _0x53f6fd={'from':_0x470bb4[_0x9db5('0xde')],'firstName':_0x470bb4['firstName'],'lastName':_0x470bb4[_0x9db5('0x9f')],'mapKey':_0x9db5('0xde'),'message':{'from':_0x470bb4[_0x9db5('0xde')],'to':_0x4be959[_0x9db5('0xc3')][_0x9db5('0xde')],'cc':'','subject':_[_0x9db5('0x6f')](_0x4f301d)?_0x4be959[_0x9db5('0xdf')]:_0x4f301d,'messageId':'','sentAt':new Date(),'attach':_0x1c6f90[_0x9db5('0x3c')],'attachments':_0x1c6f90,'originChannel':_0x9db5('0xe5'),'ChatWebsiteId':_0x4be959['id'],'ChatOfflineMessageId':_0x18b1ed['id'],'originTo':_0x4be959[_0x9db5('0xc3')]['email']},'body':_0x18b1ed[_0x9db5('0x4c')]};var _0x699ee7={'account':{'id':_0x4be959[_0x9db5('0xe0')]},'body':_0x53f6fd,'log':_0x9db5('0xe6')};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x699ee7,client9001)['then'](function(){return _0x18b1ed;})[_0x9db5('0x1b')](function(_0x259a3e){console[_0x9db5('0x18')](_0x259a3e);});}return;})['then'](function(){if(_0x18b1ed){return _0x18b1ed;}})[_0x9db5('0x27')](respondWithResult(_0x509a20,null))['catch'](function(_0x2bbc7b){console[_0x9db5('0x18')](_0x9db5('0x1b'),_0x2bbc7b);for(var _0x16355a of _0x569df2){var _0x1bbbbe=path[_0x9db5('0x71')](config['root'],_0x9db5('0xcc'),_0x9db5('0xbd'),_0x9db5('0xe7'),_0x9db5('0xe8'),_0x16355a['filename']);fs_extra[_0x9db5('0xe9')](_0x1bbbbe)[_0x9db5('0x1b')](function(_0x4efb3c){console['error']('Could\x20not\x20remove\x20attachment\x20file',_0x1bbbbe,_0x4efb3c);});}});};exports[_0x9db5('0xea')]=function(_0x12dc70,_0x36674a){return db[_0x9db5('0xaa')][_0x9db5('0x4a')]({'where':{'id':_0x12dc70['params']['id']}})[_0x9db5('0x27')](handleEntityNotFound(_0x36674a,null))[_0x9db5('0x27')](function(_0x46262f){if(_0x46262f){return _0x46262f['addInteraction'](_0x12dc70[_0x9db5('0x4c')][_0x9db5('0x61')],_[_0x9db5('0xeb')](_0x12dc70['body'],['ids','id'])||{});}})[_0x9db5('0x27')](respondWithResult(_0x36674a,null))[_0x9db5('0x1b')](handleError(_0x36674a,null));};exports['getInteractions']=function(_0xaaf9db,_0x3f29be){var _0x31c103={'raw':![],'where':{}};var _0x1e2ba8={};var _0x156549={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x9db5('0x5d')]({'where':{'id':_0xaaf9db[_0x9db5('0x49')]['id']}})[_0x9db5('0x27')](handleEntityNotFound(_0x3f29be,null))[_0x9db5('0x27')](function(_0x3acf3b){if(_0x3acf3b){_0x1e2ba8[_0x9db5('0x34')]=_[_0x9db5('0x36')](db[_0x9db5('0xaa')][_0x9db5('0x31')]);_0x1e2ba8['query']=_['keys'](_0xaaf9db['query']);_0x1e2ba8[_0x9db5('0x38')]=_['intersection'](_0x1e2ba8[_0x9db5('0x34')],_0x1e2ba8['query']);_0x31c103[_0x9db5('0x39')]=_['intersection'](_0x1e2ba8[_0x9db5('0x34')],qs[_0x9db5('0x3b')](_0xaaf9db[_0x9db5('0x37')]['fields']));_0x31c103[_0x9db5('0x39')]=_0x31c103[_0x9db5('0x39')]['length']?_0x31c103[_0x9db5('0x39')]:_0x1e2ba8[_0x9db5('0x34')];if(!_0xaaf9db[_0x9db5('0x37')][_0x9db5('0x3d')]('nolimit')){_0x31c103[_0x9db5('0x21')]=qs['limit'](_0xaaf9db[_0x9db5('0x37')][_0x9db5('0x21')]);_0x31c103[_0x9db5('0x23')]=qs['offset'](_0xaaf9db[_0x9db5('0x37')][_0x9db5('0x23')]);}_0x31c103['order']=qs[_0x9db5('0x3f')](_0xaaf9db[_0x9db5('0x37')]['sort']);_0x31c103[_0x9db5('0x40')]=qs[_0x9db5('0x38')](_['pick'](_0xaaf9db[_0x9db5('0x37')],_0x1e2ba8['filters']));_0x31c103[_0x9db5('0x40')][_0x9db5('0x55')]=_0x3acf3b['id'];if(_0xaaf9db[_0x9db5('0x37')][_0x9db5('0x42')]){_0x31c103['where']=_[_0x9db5('0x43')](_0x31c103[_0x9db5('0x40')],{'$or':_[_0x9db5('0x35')](_0x31c103[_0x9db5('0x39')],function(_0x464543){var _0x534f73={};_0x534f73[_0x464543]={'$like':'%'+_0xaaf9db['query'][_0x9db5('0x42')]+'%'};return _0x534f73;})});}_0x31c103=_[_0x9db5('0x43')]({},_0x31c103,_0xaaf9db[_0x9db5('0x46')]);return db[_0x9db5('0xaa')][_0x9db5('0x22')]({'where':_0x31c103[_0x9db5('0x40')]})[_0x9db5('0x27')](function(_0x3faee6){_0x156549['count']=_0x3faee6;if(_0xaaf9db[_0x9db5('0x37')][_0x9db5('0x47')]){_0x31c103['include']=[{'model':db[_0x9db5('0x81')],'as':_0x9db5('0xec'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x9db5('0x2b'),'fullname','internal'],'required':![]},{'model':db[_0x9db5('0xed')],'as':'Tags','attributes':['id','name',_0x9db5('0xee')],'where':_0xaaf9db[_0x9db5('0x37')][_0x9db5('0xef')]?{'id':_0xaaf9db[_0x9db5('0x37')]['tag']}:undefined,'required':_0xaaf9db[_0x9db5('0x37')]['tag']?!![]:![]}];}return db[_0x9db5('0xaa')][_0x9db5('0x5f')](_0x31c103);})[_0x9db5('0x27')](function(_0x56d609){_0x156549['rows']=_0x56d609;return _0x156549;});}})[_0x9db5('0x27')](respondWithFilteredResult(_0x3f29be,_0x31c103))[_0x9db5('0x1b')](handleError(_0x3f29be,null));};function iftimePromise(_0x489182,_0x48c075){return respondWithRpcPromise(_0x9db5('0xf0'),_0x9db5('0xf1'),{'command':_0x48c075['timezone']?util[_0x9db5('0xa3')](_0x9db5('0xf2'),_0x489182[_0x9db5('0xf3')],_0x48c075[_0x9db5('0xf4')]):util[_0x9db5('0xa3')](_0x9db5('0xf5'),_0x489182[_0x9db5('0xf3')])},client9002)[_0x9db5('0x27')](function(_0x21b2d1){var _0x75d645=_0x21b2d1&&_0x21b2d1[_0x9db5('0xf6')]('true')>=0x0?!![]:![];logger[_0x9db5('0x1a')](_0x9db5('0xf7'),_0x48c075['id'],_0x489182['id'],_0x489182[_0x9db5('0xf3')],_0x75d645?_0x9db5('0xf8'):'OFFLINE',_0x48c075['timezone']?_0x48c075[_0x9db5('0xf4')]:_0x9db5('0xf9'));return _0x75d645;})[_0x9db5('0x1b')](function(_0x40aa62){logger[_0x9db5('0x18')](_0x9db5('0xf7'),_0x48c075['id'],_0x489182['id'],_0x489182['interval'],util[_0x9db5('0xfa')](_0x40aa62,{'showHidden':![],'depth':null}),_0x48c075[_0x9db5('0xf4')]?_0x48c075[_0x9db5('0xf4')]:_0x9db5('0xf9'));return![];});}exports[_0x9db5('0xf1')]=function(_0x488627,_0x26aa32){var _0x2e3fdf=0x0;var _0x141dbb=0x0;var _0x150191=![];var _0x1c90f6;var _0xc2481d;return db[_0x9db5('0x30')]['find']({'where':{'id':_0x488627['params']['id']},'include':[{'model':db[_0x9db5('0xfb')],'as':_0x9db5('0xfb'),'include':[{'model':db[_0x9db5('0xfb')],'as':_0x9db5('0xfc'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x9db5('0x27')](handleEntityNotFound(_0x26aa32,null))[_0x9db5('0x27')](function(_0x491db6){if(_0x491db6){_0x1c90f6=_0x491db6;return _0x491db6[_0x9db5('0xfd')]({'raw':!![]});}})['then'](function(_0x14d847){if(_0x1c90f6){if(_0x14d847){_0xc2481d=_0x14d847;}}return require(_0x9db5('0x6d'))['getLicense']();})['then'](function(_0x17cbaa){if(_0x17cbaa){_0x141dbb=_0x17cbaa[_0x9db5('0xfe')];_0x150191=_0x17cbaa['custom'];}})[_0x9db5('0x27')](function(){return db['ChatInteraction'][_0x9db5('0x22')]({'where':{'closed':![]}});})[_0x9db5('0x27')](function(_0x181c07){_0x2e3fdf=_0x181c07;if(_0x141dbb&&_0x181c07>_0x141dbb){return db[_0x9db5('0xff')][_0x9db5('0x5d')]({'where':{'id':0x1}})[_0x9db5('0x27')](function(_0x3113ab){if(_0x3113ab){_0x3113ab[_0x9db5('0x100')](_0x9db5('0x101'));}});}})[_0x9db5('0x27')](function(){if(_0x1c90f6[_0x9db5('0xfb')]&&_0x1c90f6[_0x9db5('0xfb')][_0x9db5('0xfc')]){var _0x3a887e=[];for(var _0x2a28e4=0x0;_0x2a28e4<_0x1c90f6[_0x9db5('0xfb')]['Intervals']['length'];_0x2a28e4++){var _0x45e288=_0x1c90f6[_0x9db5('0xfb')][_0x9db5('0xfc')][_0x2a28e4][_0x9db5('0x4e')]({'plain':!![]});_0x3a887e[_0x9db5('0xb1')](iftimePromise(_0x45e288,_0x1c90f6));}return BPromise[_0x9db5('0x102')](_0x3a887e)[_0x9db5('0x27')](function(_0x5e0b27){return _[_0x9db5('0x103')](_0x5e0b27);});}else{return!![];}})[_0x9db5('0x27')](function(_0xd089b7){var _0x3e67c3=fs[_0x9db5('0xc6')](path['join'](config['root'],_0x9db5('0x104')),_0x9db5('0xc8'));var _0x3de718={'remote':_0x1c90f6[_0x9db5('0x105')],'query':querystring[_0x9db5('0x17')](_[_0x9db5('0x43')](_0x1c90f6[_0x9db5('0x4e')]({'plain':!![]}),{'customerIp':_0x488627[_0x9db5('0x9b')][_0x9db5('0x9e')]||_0x488627[_0x9db5('0x9b')][_0x9db5('0x106')]||_0x488627['connection']['remoteAddress']||_0x488627['ip'],'referer':_0x488627[_0x9db5('0x9b')]['referer'],'openedInteractions':_0x2e3fdf,'maxInteractions':_0x141dbb,'virtual':_0x150191[_0x9db5('0xfe')],'online':_0xd089b7,'custom':_0x150191}))[_0x9db5('0x107')](/'/g,'\x5c\x27')};_0x26aa32[_0x9db5('0x2c')](ejs['render'](Mustache[_0x9db5('0xc9')](_0x3e67c3,_0x3de718),{'proactiveActions':_0xc2481d,'alignment':_0x1c90f6[_0x9db5('0x108')],'verticalAlignment':_0x1c90f6[_0x9db5('0x109')],'div_color':_0x1c90f6[_0x9db5('0xee')],'text_color':_0x1c90f6[_0x9db5('0x10a')],'button_color':_0x1c90f6[_0x9db5('0x10b')],'background_color':_0x1c90f6[_0x9db5('0x10c')]}));})['catch'](handleError(_0x26aa32,null));};exports[_0x9db5('0x10d')]=function(_0x209405,_0x5741c5){var _0xa7e395=_0x209405[_0x9db5('0x49')]['id'];var _0x3274df=_0x209405[_0x9db5('0x4c')];var _0x3418db=0xc8;var _0x2476dc=null;return db['sequelize'][_0x9db5('0xd0')]({'isolationLevel':db[_0x9db5('0xcf')]['Transaction']['ISOLATION_LEVELS'][_0x9db5('0x10e')]},function(_0x1be1c8){return db[_0x9db5('0x30')][_0x9db5('0x5d')]({'where':{'id':_0xa7e395},'transaction':_0x1be1c8})['then'](function(_0x62384a){if(_0x62384a){return db[_0x9db5('0x8f')]['destroy']({'where':{'ChatWebsiteId':_0xa7e395},'transaction':_0x1be1c8})[_0x9db5('0x27')](function(){var _0x1a6270=_['map'](_0x3274df,function(_0x390fc6){_0x390fc6['ChatWebsiteId']=_0xa7e395;return _0x390fc6;});return db[_0x9db5('0x8f')]['bulkCreate'](_0x1a6270,{'transaction':_0x1be1c8});});}else{_0x3418db=0x194;_0x2476dc=[];}});})[_0x9db5('0x27')](function(){if(_0x3418db!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0xa7e395},'order':_0x9db5('0x95')})[_0x9db5('0x27')](function(_0x573f02){_0x2476dc=_0x573f02;});}})[_0x9db5('0x1b')](function(_0x2ca041){_0x3418db=0x1f4;logger['error'](_0x2ca041['stack']);if(_0x2ca041[_0x9db5('0x2b')]){delete _0x2ca041[_0x9db5('0x2b')];}_0x2476dc=_0x2ca041;})[_0x9db5('0x10f')](function(){if(_0x2476dc===null){_0x5741c5[_0x9db5('0x1c')](_0x3418db);}else{if(_0x3418db===0x1f4){_0x5741c5['status'](_0x3418db)['send'](_0x2476dc);}else{_0x5741c5[_0x9db5('0x1d')](_0x3418db)['json'](_0x2476dc);}}});};exports[_0x9db5('0x110')]=function(_0x681b72,_0x1556ef){var _0x254d34={};var _0x57699b={};var _0x9e6b9b;var _0x24a2a0;return db[_0x9db5('0x30')]['findOne']({'where':{'id':_0x681b72[_0x9db5('0x49')]['id']}})[_0x9db5('0x27')](handleEntityNotFound(_0x1556ef,null))[_0x9db5('0x27')](function(_0xa6b873){if(_0xa6b873){_0x9e6b9b=_0xa6b873;_0x57699b[_0x9db5('0x34')]=_[_0x9db5('0x36')](db[_0x9db5('0x8f')][_0x9db5('0x31')]);_0x57699b[_0x9db5('0x37')]=_[_0x9db5('0x36')](_0x681b72[_0x9db5('0x37')]);_0x57699b[_0x9db5('0x38')]=_[_0x9db5('0x3a')](_0x57699b[_0x9db5('0x34')],_0x57699b['query']);_0x254d34[_0x9db5('0x39')]=_[_0x9db5('0x3a')](_0x57699b[_0x9db5('0x34')],qs[_0x9db5('0x3b')](_0x681b72[_0x9db5('0x37')][_0x9db5('0x3b')]));_0x254d34[_0x9db5('0x39')]=_0x254d34[_0x9db5('0x39')]['length']?_0x254d34[_0x9db5('0x39')]:_0x57699b[_0x9db5('0x34')];_0x254d34['order']=qs[_0x9db5('0x3f')](_0x681b72[_0x9db5('0x37')][_0x9db5('0x3f')]);_0x254d34[_0x9db5('0x40')]=qs[_0x9db5('0x38')](_[_0x9db5('0x41')](_0x681b72[_0x9db5('0x37')],_0x57699b[_0x9db5('0x38')]));if(_0x681b72['query'][_0x9db5('0x42')]){_0x254d34['where']=_[_0x9db5('0x43')](_0x254d34['where'],{'$or':_[_0x9db5('0x35')](_0x254d34['attributes'],function(_0x207a5e){var _0x2de776={};_0x2de776[_0x207a5e]={'$like':'%'+_0x681b72[_0x9db5('0x37')][_0x9db5('0x42')]+'%'};return _0x2de776;})});}_0x254d34=_[_0x9db5('0x43')]({},_0x254d34,_0x681b72[_0x9db5('0x46')]);return _0x9e6b9b[_0x9db5('0x110')](_0x254d34);}})['then'](function(_0x360d65){if(_0x360d65){_0x24a2a0=_0x360d65[_0x9db5('0x3c')];if(!_0x681b72[_0x9db5('0x37')][_0x9db5('0x3d')](_0x9db5('0x58'))){_0x254d34[_0x9db5('0x21')]=qs[_0x9db5('0x21')](_0x681b72[_0x9db5('0x37')][_0x9db5('0x21')]);_0x254d34[_0x9db5('0x23')]=qs['offset'](_0x681b72[_0x9db5('0x37')][_0x9db5('0x23')]);}return _0x9e6b9b[_0x9db5('0x110')](_0x254d34);}})[_0x9db5('0x27')](function(_0x2eed3a){if(_0x2eed3a){return _0x2eed3a?{'count':_0x24a2a0,'rows':_0x2eed3a}:null;}})[_0x9db5('0x27')](respondWithResult(_0x1556ef,null))[_0x9db5('0x1b')](handleError(_0x1556ef,null));};exports[_0x9db5('0x111')]=function(_0x154dc3,_0x5da1a1){return db[_0x9db5('0x112')]['find']({'where':{'id':_0x154dc3['params']['id']}})[_0x9db5('0x27')](handleEntityNotFound(_0x5da1a1,null))[_0x9db5('0x27')](function(_0x3c83f7){if(_0x3c83f7){return _0x3c83f7[_0x9db5('0x111')](_0x154dc3['body']['ids'],_[_0x9db5('0xeb')](_0x154dc3['body'],['ids','id'])||{});}})[_0x9db5('0x27')](respondWithResult(_0x5da1a1,null))[_0x9db5('0x1b')](handleError(_0x5da1a1,null));};exports[_0x9db5('0xfd')]=function(_0x2e0f54,_0x5902f4){var _0x235adf={};var _0xf956b0={};var _0x1278f8;var _0x46ee89;return db[_0x9db5('0x30')][_0x9db5('0x5d')]({'where':{'id':_0x2e0f54['params']['id']}})[_0x9db5('0x27')](handleEntityNotFound(_0x5902f4,null))[_0x9db5('0x27')](function(_0x34008a){if(_0x34008a){_0x1278f8=_0x34008a;_0xf956b0[_0x9db5('0x34')]=_[_0x9db5('0x36')](db[_0x9db5('0x113')][_0x9db5('0x31')]);_0xf956b0[_0x9db5('0x37')]=_['keys'](_0x2e0f54['query']);_0xf956b0['filters']=_[_0x9db5('0x3a')](_0xf956b0[_0x9db5('0x34')],_0xf956b0['query']);_0x235adf[_0x9db5('0x39')]=_[_0x9db5('0x3a')](_0xf956b0[_0x9db5('0x34')],qs[_0x9db5('0x3b')](_0x2e0f54[_0x9db5('0x37')][_0x9db5('0x3b')]));_0x235adf['attributes']=_0x235adf[_0x9db5('0x39')][_0x9db5('0x3c')]?_0x235adf['attributes']:_0xf956b0[_0x9db5('0x34')];_0x235adf[_0x9db5('0x3e')]=qs['sort'](_0x2e0f54[_0x9db5('0x37')][_0x9db5('0x3f')]);_0x235adf['where']=qs[_0x9db5('0x38')](_[_0x9db5('0x41')](_0x2e0f54[_0x9db5('0x37')],_0xf956b0[_0x9db5('0x38')]));if(_0x2e0f54['query'][_0x9db5('0x42')]){_0x235adf[_0x9db5('0x40')]=_['merge'](_0x235adf['where'],{'$or':_['map'](_0x235adf[_0x9db5('0x39')],function(_0x367df4){var _0x1a2671={};_0x1a2671[_0x367df4]={'$like':'%'+_0x2e0f54['query'][_0x9db5('0x42')]+'%'};return _0x1a2671;})});}_0x235adf=_[_0x9db5('0x43')]({},_0x235adf,_0x2e0f54[_0x9db5('0x46')]);return _0x1278f8['getProactiveActions'](_0x235adf);}})[_0x9db5('0x27')](function(_0x1d865a){if(_0x1d865a){_0x46ee89=_0x1d865a[_0x9db5('0x3c')];if(!_0x2e0f54['query']['hasOwnProperty'](_0x9db5('0x58'))){_0x235adf[_0x9db5('0x21')]=qs[_0x9db5('0x21')](_0x2e0f54[_0x9db5('0x37')][_0x9db5('0x21')]);_0x235adf[_0x9db5('0x23')]=qs[_0x9db5('0x23')](_0x2e0f54[_0x9db5('0x37')][_0x9db5('0x23')]);}return _0x1278f8['getProactiveActions'](_0x235adf);}})[_0x9db5('0x27')](function(_0x42c0fa){if(_0x42c0fa){return _0x42c0fa?{'count':_0x46ee89,'rows':_0x42c0fa}:null;}})[_0x9db5('0x27')](respondWithResult(_0x5902f4,null))['catch'](handleError(_0x5902f4,null));};exports[_0x9db5('0x114')]=function(_0x29ebdc,_0x1dbe45){var _0x4d53=_0x29ebdc[_0x9db5('0x37')][_0x9db5('0x115')]===_0x9db5('0x116')?_0x9db5('0x117'):'onlineForm';return db[_0x9db5('0x30')][_0x9db5('0x4a')]({'attributes':['id',_0x4d53],'where':{'id':_0x29ebdc[_0x9db5('0x49')]['id']}})[_0x9db5('0x27')](handleEntityNotFound(_0x1dbe45,null))[_0x9db5('0x27')](function(_0x4cb61a){if(_0x4cb61a){var _0x532e8f=_0x4cb61a[_0x4d53];var _0x565fbd=_0x532e8f&&_0x532e8f[_0x9db5('0x118')]?_0x532e8f['items']:[];_0x1dbe45['send']({'fromKey':_['isNil'](_0x532e8f[_0x9db5('0x119')])?undefined:_0x532e8f[_0x9db5('0x119')],'count':_0x565fbd[_0x9db5('0x3c')],'rows':_0x565fbd});}})[_0x9db5('0x1b')](handleError(_0x1dbe45,null));};exports[_0x9db5('0x11a')]=function(_0x568856,_0x47bd61){var _0xba5602={'raw':![],'where':{}};var _0x43b46d={};var _0x5a4ef1={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x9db5('0x5d')]({'where':{'id':_0x568856['params']['id']}})[_0x9db5('0x27')](handleEntityNotFound(_0x47bd61,null))[_0x9db5('0x27')](function(_0x2c3ca0){if(_0x2c3ca0){_0x43b46d[_0x9db5('0x34')]=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x43b46d['query']=_[_0x9db5('0x36')](_0x568856[_0x9db5('0x37')]);_0x43b46d[_0x9db5('0x38')]=_[_0x9db5('0x3a')](_0x43b46d[_0x9db5('0x34')],_0x43b46d[_0x9db5('0x37')]);_0xba5602['attributes']=_[_0x9db5('0x3a')](_0x43b46d[_0x9db5('0x34')],qs[_0x9db5('0x3b')](_0x568856['query'][_0x9db5('0x3b')]));_0xba5602[_0x9db5('0x39')]=_0xba5602[_0x9db5('0x39')][_0x9db5('0x3c')]?_0xba5602[_0x9db5('0x39')]:_0x43b46d[_0x9db5('0x34')];if(!_0x568856['query'][_0x9db5('0x3d')](_0x9db5('0x58'))){_0xba5602[_0x9db5('0x21')]=qs[_0x9db5('0x21')](_0x568856[_0x9db5('0x37')][_0x9db5('0x21')]);_0xba5602[_0x9db5('0x23')]=qs[_0x9db5('0x23')](_0x568856['query'][_0x9db5('0x23')]);}_0xba5602[_0x9db5('0x3e')]=qs[_0x9db5('0x3f')](_0x568856[_0x9db5('0x37')][_0x9db5('0x3f')]);_0xba5602['where']=qs['filters'](_['pick'](_0x568856[_0x9db5('0x37')],_0x43b46d[_0x9db5('0x38')]));_0xba5602['where'][_0x9db5('0x55')]=_0x2c3ca0['id'];if(_0x568856[_0x9db5('0x37')]['filter']){_0xba5602[_0x9db5('0x40')]=_[_0x9db5('0x43')](_0xba5602['where'],{'$or':_[_0x9db5('0x35')](_0xba5602['attributes'],function(_0x5b1b01){var _0x3ac878={};_0x3ac878[_0x5b1b01]={'$like':'%'+_0x568856[_0x9db5('0x37')][_0x9db5('0x42')]+'%'};return _0x3ac878;})});}_0xba5602=_[_0x9db5('0x43')]({},_0xba5602,_0x568856[_0x9db5('0x46')]);return db[_0x9db5('0xca')][_0x9db5('0x22')]({'where':_0xba5602[_0x9db5('0x40')]})[_0x9db5('0x27')](function(_0x3c3c16){_0x5a4ef1[_0x9db5('0x22')]=_0x3c3c16;if(_0x568856[_0x9db5('0x37')][_0x9db5('0x47')]){_0xba5602['include']=[{'all':!![]}];}else{_0xba5602[_0x9db5('0x59')]=[{'model':db[_0x9db5('0x81')],'as':'Contact','required':![]},{'model':db[_0x9db5('0x11b')],'as':_0x9db5('0x11c'),'required':![]}];}return db[_0x9db5('0xca')]['findAll'](_0xba5602);})['then'](function(_0x7ce35b){_0x5a4ef1['rows']=_0x7ce35b;return _0x5a4ef1;});}})[_0x9db5('0x27')](respondWithFilteredResult(_0x47bd61,_0xba5602))[_0x9db5('0x1b')](handleError(_0x47bd61,null));};exports[_0x9db5('0x11d')]=function(_0x50ad0a,_0x32046d){return db[_0x9db5('0x30')][_0x9db5('0x4a')]({'where':{'id':_0x50ad0a[_0x9db5('0x49')]['id']}})[_0x9db5('0x27')](handleEntityNotFound(_0x32046d,null))['then'](function(_0x370ca2){if(_0x370ca2){return _0x370ca2[_0x9db5('0x11d')](_0x50ad0a[_0x9db5('0x4c')][_0x9db5('0x61')],_['omit'](_0x50ad0a['body'],[_0x9db5('0x61'),'id'])||{})[_0x9db5('0xc5')](function(_0x5e556d){for(var _0x27b27f=0x0;_0x27b27f<_0x50ad0a[_0x9db5('0x4c')][_0x9db5('0x61')]['length'];_0x27b27f+=0x1){socket[_0x9db5('0x11e')](_0x9db5('0x11f'),{'UserId':Number(_0x50ad0a[_0x9db5('0x4c')][_0x9db5('0x61')][_0x27b27f]),'ChatWebsiteId':Number(_0x50ad0a['params']['id'])});}return _0x5e556d;});}})[_0x9db5('0x27')](respondWithResult(_0x32046d,null))[_0x9db5('0x1b')](handleError(_0x32046d,null));};exports['removeAgents']=function(_0x30e461,_0x2aaf54){return db[_0x9db5('0x30')][_0x9db5('0x4a')]({'where':{'id':_0x30e461['params']['id']}})[_0x9db5('0x27')](handleEntityNotFound(_0x2aaf54,null))['then'](function(_0x44fbaf){if(_0x44fbaf){return _0x44fbaf[_0x9db5('0x120')](_0x30e461[_0x9db5('0x37')][_0x9db5('0x61')])[_0x9db5('0x27')](function(){if(_[_0x9db5('0x121')](_0x30e461[_0x9db5('0x37')][_0x9db5('0x61')])){for(var _0x3b8a59=0x0;_0x3b8a59<_0x30e461['query'][_0x9db5('0x61')][_0x9db5('0x3c')];_0x3b8a59+=0x1){socket[_0x9db5('0x11e')](_0x9db5('0x122'),{'UserId':Number(_0x30e461[_0x9db5('0x37')]['ids'][_0x3b8a59]),'ChatWebsiteId':Number(_0x30e461['params']['id'])});}}else{socket[_0x9db5('0x11e')]('userChatWebsite:remove',{'UserId':Number(_0x30e461[_0x9db5('0x37')][_0x9db5('0x61')]),'ChatWebsiteId':Number(_0x30e461[_0x9db5('0x49')]['id'])});}});}})[_0x9db5('0x27')](respondWithStatusCode(_0x2aaf54,null))[_0x9db5('0x1b')](handleError(_0x2aaf54,null));};exports[_0x9db5('0x123')]=function(_0x58e081,_0x3892de){var _0x18879b={};var _0x50f544={};var _0x8b6ebb;var _0x19315d;return db[_0x9db5('0x30')][_0x9db5('0x5d')]({'where':{'id':_0x58e081[_0x9db5('0x49')]['id']}})[_0x9db5('0x27')](handleEntityNotFound(_0x3892de,null))[_0x9db5('0x27')](function(_0xfb4519){if(_0xfb4519){_0x8b6ebb=_0xfb4519;_0x50f544[_0x9db5('0x34')]=_[_0x9db5('0x36')](db[_0x9db5('0xb5')]['rawAttributes']);_0x50f544['query']=_[_0x9db5('0x36')](_0x58e081['query']);_0x50f544[_0x9db5('0x38')]=_[_0x9db5('0x3a')](_0x50f544['model'],_0x50f544[_0x9db5('0x37')]);_0x18879b[_0x9db5('0x39')]=_[_0x9db5('0x3a')](_0x50f544['model'],qs['fields'](_0x58e081[_0x9db5('0x37')][_0x9db5('0x3b')]));_0x18879b[_0x9db5('0x39')]=_0x18879b[_0x9db5('0x39')][_0x9db5('0x3c')]?_0x18879b['attributes']:_0x50f544[_0x9db5('0x34')];_0x18879b['order']=qs['sort'](_0x58e081['query'][_0x9db5('0x3f')]);_0x18879b[_0x9db5('0x40')]=qs[_0x9db5('0x38')](_['pick'](_0x58e081[_0x9db5('0x37')],_0x50f544[_0x9db5('0x38')]));if(_0x58e081[_0x9db5('0x37')][_0x9db5('0x42')]){_0x18879b['where']=_[_0x9db5('0x43')](_0x18879b[_0x9db5('0x40')],{'$or':_[_0x9db5('0x35')](_0x18879b['attributes'],function(_0x56105d){var _0xc8fde9={};_0xc8fde9[_0x56105d]={'$like':'%'+_0x58e081[_0x9db5('0x37')][_0x9db5('0x42')]+'%'};return _0xc8fde9;})});}_0x18879b=_[_0x9db5('0x43')]({},_0x18879b,_0x58e081[_0x9db5('0x46')]);return _0x8b6ebb[_0x9db5('0x123')](_0x18879b);}})[_0x9db5('0x27')](function(_0x1a9af6){if(_0x1a9af6){_0x19315d=_0x1a9af6['length'];if(!_0x58e081['query'][_0x9db5('0x3d')](_0x9db5('0x58'))){_0x18879b[_0x9db5('0x21')]=qs['limit'](_0x58e081[_0x9db5('0x37')]['limit']);_0x18879b[_0x9db5('0x23')]=qs[_0x9db5('0x23')](_0x58e081[_0x9db5('0x37')][_0x9db5('0x23')]);}return _0x8b6ebb[_0x9db5('0x123')](_0x18879b);}})['then'](function(_0x1ebdc6){if(_0x1ebdc6){return _0x1ebdc6?{'count':_0x19315d,'rows':_0x1ebdc6}:null;}})['then'](respondWithResult(_0x3892de,null))[_0x9db5('0x1b')](handleError(_0x3892de,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index f7c1793..375cc58 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 _0x37f8=['hasOwnProperty','hook','exports','../../mysqldb','ChatWebsite','setMaxListeners','save','remove','emit'];(function(_0x4da3b6,_0x233aff){var _0x574d38=function(_0x4fa45b){while(--_0x4fa45b){_0x4da3b6['push'](_0x4da3b6['shift']());}};_0x574d38(++_0x233aff);}(_0x37f8,0xd2));var _0x837f=function(_0x4f28fd,_0x394c2c){_0x4f28fd=_0x4f28fd-0x0;var _0x3c1495=_0x37f8[_0x4f28fd];return _0x3c1495;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x837f('0x0'))['db'][_0x837f('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x837f('0x2')](0x0);var events={'afterCreate':_0x837f('0x3'),'afterUpdate':'update','afterDestroy':_0x837f('0x4')};function emitEvent(_0x5184ad){return function(_0x5f2d01,_0x5a04e7,_0x4dd037){ChatWebsiteEvents['emit'](_0x5184ad+':'+_0x5f2d01['id'],_0x5f2d01);ChatWebsiteEvents[_0x837f('0x5')](_0x5184ad,_0x5f2d01);_0x4dd037(null);};}for(var e in events){if(events[_0x837f('0x6')](e)){var event=events[e];ChatWebsite[_0x837f('0x7')](e,emitEvent(event));}}module[_0x837f('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0xe79a=['ChatWebsite','save','update','remove','emit','hasOwnProperty','hook'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe79a,0x70));var _0xae79=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xe79a[_0x164eca];return _0x2ce562;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0xae79('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xae79('0x1'),'afterUpdate':_0xae79('0x2'),'afterDestroy':_0xae79('0x3')};function emitEvent(_0x324375){return function(_0x492be8,_0x33b85d,_0x45a28b){ChatWebsiteEvents[_0xae79('0x4')](_0x324375+':'+_0x492be8['id'],_0x492be8);ChatWebsiteEvents['emit'](_0x324375,_0x492be8);_0x45a28b(null);};}for(var e in events){if(events[_0xae79('0x5')](e)){var event=events[e];ChatWebsite[_0xae79('0x6')](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 4d84120..6acdbe8 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 _0x9f56=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','define','chat_websites'];(function(_0x3a2fac,_0x36826d){var _0x5921ba=function(_0x403688){while(--_0x403688){_0x3a2fac['push'](_0x3a2fac['shift']());}};_0x5921ba(++_0x36826d);}(_0x9f56,0x13f));var _0x69f5=function(_0x367e5b,_0x5721e4){_0x367e5b=_0x367e5b-0x0;var _0x4b909e=_0x9f56[_0x367e5b];return _0x4b909e;};'use strict';var _=require(_0x69f5('0x0'));var util=require('util');var logger=require(_0x69f5('0x1'))('api');var moment=require(_0x69f5('0x2'));var BPromise=require(_0x69f5('0x3'));var rp=require(_0x69f5('0x4'));var fs=require('fs');var path=require(_0x69f5('0x5'));var rimraf=require(_0x69f5('0x6'));var config=require('../../config/environment');var attributes=require(_0x69f5('0x7'));module[_0x69f5('0x8')]=function(_0x4c98bd,_0x19f043){return _0x4c98bd[_0x69f5('0x9')]('ChatWebsite',attributes,{'tableName':_0x69f5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46e0=['ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatWebsite.attributes'];(function(_0x58bc38,_0xe455b6){var _0x42802c=function(_0x92c225){while(--_0x92c225){_0x58bc38['push'](_0x58bc38['shift']());}};_0x42802c(++_0xe455b6);}(_0x46e0,0x9c));var _0x046e=function(_0x44f183,_0x313bdd){_0x44f183=_0x44f183-0x0;var _0x555253=_0x46e0[_0x44f183];return _0x555253;};'use strict';var _=require(_0x046e('0x0'));var util=require(_0x046e('0x1'));var logger=require(_0x046e('0x2'))(_0x046e('0x3'));var moment=require(_0x046e('0x4'));var BPromise=require('bluebird');var rp=require(_0x046e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x046e('0x6'));var config=require(_0x046e('0x7'));var attributes=require(_0x046e('0x8'));module['exports']=function(_0x49cd9a,_0x3b8d43){return _0x49cd9a['define'](_0x046e('0x9'),attributes,{'tableName':_0x046e('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 0fe21ec..4da6c87 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 _0xf361=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','result','lodash','util','moment'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xf361,0x1b7));var _0x1f36=function(_0x4d0003,_0xdcdbde){_0x4d0003=_0x4d0003-0x0;var _0x55b682=_0xf361[_0x4d0003];return _0x55b682;};'use strict';var _=require(_0x1f36('0x0'));var util=require(_0x1f36('0x1'));var moment=require(_0x1f36('0x2'));var BPromise=require(_0x1f36('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1f36('0x4'));var db=require(_0x1f36('0x5'))['db'];var utils=require(_0x1f36('0x6'));var logger=require(_0x1f36('0x7'))('rpc');var config=require(_0x1f36('0x8'));var jayson=require(_0x1f36('0x9'));var client=jayson[_0x1f36('0xa')][_0x1f36('0xb')]({'port':0x232a});config[_0x1f36('0xc')]=_[_0x1f36('0xd')](config['redis'],{'host':_0x1f36('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1f36('0xc')]));require('./chatWebsite.socket')[_0x1f36('0xf')](socket);function respondWithRpcPromise(_0x24ff79,_0x1dcc60,_0x3f7429){return new BPromise(function(_0x1d17f5,_0x5112ed){return client[_0x1f36('0x10')](_0x24ff79,_0x3f7429)[_0x1f36('0x11')](function(_0x5c9209){logger[_0x1f36('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x1dcc60,_0x1f36('0x13'));logger['debug'](_0x1f36('0x14'),_0x1dcc60,_0x1f36('0x13'),JSON[_0x1f36('0x15')](_0x5c9209));if(_0x5c9209[_0x1f36('0x16')]){if(_0x5c9209[_0x1f36('0x16')]['code']===0x1f4){logger[_0x1f36('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x1dcc60,_0x5c9209['error']['message']);return _0x5112ed(_0x5c9209[_0x1f36('0x16')]['message']);}logger[_0x1f36('0x16')](_0x1f36('0x17'),_0x1dcc60,_0x5c9209[_0x1f36('0x16')][_0x1f36('0x18')]);return _0x1d17f5(_0x5c9209[_0x1f36('0x16')][_0x1f36('0x18')]);}else{logger[_0x1f36('0x12')](_0x1f36('0x17'),_0x1dcc60,'request\x20sent');_0x1d17f5(_0x5c9209[_0x1f36('0x19')]['message']);}})['catch'](function(_0x35c894){logger[_0x1f36('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x1dcc60,_0x35c894);_0x5112ed(_0x35c894);});});} \ No newline at end of file +var _0x41be=['http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0x41be,0xf1));var _0xe41b=function(_0x3c6dce,_0x5424dd){_0x3c6dce=_0x3c6dce-0x0;var _0x1450e9=_0x41be[_0x3c6dce];return _0x1450e9;};'use strict';var _=require(_0xe41b('0x0'));var util=require(_0xe41b('0x1'));var moment=require(_0xe41b('0x2'));var BPromise=require(_0xe41b('0x3'));var rs=require(_0xe41b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe41b('0x5'))['db'];var utils=require(_0xe41b('0x6'));var logger=require(_0xe41b('0x7'))(_0xe41b('0x8'));var config=require(_0xe41b('0x9'));var jayson=require(_0xe41b('0xa'));var client=jayson['client'][_0xe41b('0xb')]({'port':0x232a});config[_0xe41b('0xc')]=_[_0xe41b('0xd')](config[_0xe41b('0xc')],{'host':_0xe41b('0xe'),'port':0x18eb});var socket=require(_0xe41b('0xf'))(new Redis(config[_0xe41b('0xc')]));require('./chatWebsite.socket')[_0xe41b('0x10')](socket);function respondWithRpcPromise(_0x307abe,_0x303c39,_0x12e7d5){return new BPromise(function(_0x494f30,_0x273149){return client[_0xe41b('0x11')](_0x307abe,_0x12e7d5)[_0xe41b('0x12')](function(_0x3e2319){logger[_0xe41b('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x303c39,'request\x20sent');logger['debug'](_0xe41b('0x14'),_0x303c39,_0xe41b('0x15'),JSON['stringify'](_0x3e2319));if(_0x3e2319[_0xe41b('0x16')]){if(_0x3e2319['error'][_0xe41b('0x17')]===0x1f4){logger['error'](_0xe41b('0x18'),_0x303c39,_0x3e2319['error'][_0xe41b('0x19')]);return _0x273149(_0x3e2319[_0xe41b('0x16')][_0xe41b('0x19')]);}logger[_0xe41b('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x303c39,_0x3e2319[_0xe41b('0x16')]['message']);return _0x494f30(_0x3e2319[_0xe41b('0x16')][_0xe41b('0x19')]);}else{logger[_0xe41b('0x13')](_0xe41b('0x18'),_0x303c39,_0xe41b('0x15'));_0x494f30(_0x3e2319[_0xe41b('0x1a')][_0xe41b('0x19')]);}})[_0xe41b('0x1b')](function(_0x2a810b){logger[_0xe41b('0x16')](_0xe41b('0x18'),_0x303c39,_0x2a810b);_0x273149(_0x2a810b);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index a422570..eddd645 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 _0xd8b5=['./chatWebsite.events','save','remove','length','chatWebsite:'];(function(_0x499e37,_0x1dc185){var _0x213f17=function(_0x56cf49){while(--_0x56cf49){_0x499e37['push'](_0x499e37['shift']());}};_0x213f17(++_0x1dc185);}(_0xd8b5,0x168));var _0x5d8b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd8b5[_0x14add3];return _0x4a174f;};'use strict';var ChatWebsiteEvents=require(_0x5d8b('0x0'));var events=[_0x5d8b('0x1'),_0x5d8b('0x2'),'update'];function createListener(_0x3726fc,_0x4ae268){return function(_0x4229aa){_0x4ae268['emit'](_0x3726fc,_0x4229aa);};}function removeListener(_0x2d633a,_0xb64a2e){return function(){ChatWebsiteEvents['removeListener'](_0x2d633a,_0xb64a2e);};}exports['register']=function(_0x9a9f13){for(var _0x3698de=0x0,_0x20bc55=events[_0x5d8b('0x3')];_0x3698de<_0x20bc55;_0x3698de++){var _0x17f4f8=events[_0x3698de];var _0x40e14d=createListener(_0x5d8b('0x4')+_0x17f4f8,_0x9a9f13);ChatWebsiteEvents['on'](_0x17f4f8,_0x40e14d);}}; \ No newline at end of file +var _0xbbe8=['remove','update','length','save'];(function(_0x1b21d8,_0xe6eafe){var _0x4313d8=function(_0x5cc95e){while(--_0x5cc95e){_0x1b21d8['push'](_0x1b21d8['shift']());}};_0x4313d8(++_0xe6eafe);}(_0xbbe8,0x17f));var _0x8bbe=function(_0x453d74,_0x2dd33b){_0x453d74=_0x453d74-0x0;var _0x2a641a=_0xbbe8[_0x453d74];return _0x2a641a;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x8bbe('0x0'),_0x8bbe('0x1'),_0x8bbe('0x2')];function createListener(_0x545f83,_0x446d62){return function(_0x21e44e){_0x446d62['emit'](_0x545f83,_0x21e44e);};}function removeListener(_0x4189ce,_0x3bbdc7){return function(){ChatWebsiteEvents['removeListener'](_0x4189ce,_0x3bbdc7);};}exports['register']=function(_0x649a13){for(var _0x980405=0x0,_0x3dd0de=events[_0x8bbe('0x3')];_0x980405<_0x3dd0de;_0x980405++){var _0x27f6a5=events[_0x980405];var _0x42a486=createListener('chatWebsite:'+_0x27f6a5,_0x649a13);ChatWebsiteEvents['on'](_0x27f6a5,_0x42a486);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 3c8e66b..6b6adea 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 _0xf150=['show','/:id/dispositions','isAuthenticated','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','/:id/offline_messages','/:id/users','getAgents','post','create','join','format','%s-%s','/:id/logo','single','file','addLogo','diskStorage','root','originalname','addAvatar','now','addCustomerAvatar','server/files/images/avatars/','/:id/system_avatar','addSystemAvatar','server/files','attachments','replace','extname','offline','addInteraction','addProactiveActions','addAgents','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatWebsite.controller','get','index','/describe','describe','/:id'];(function(_0x1c4ff0,_0x2c93cb){var _0x392915=function(_0x49d14a){while(--_0x49d14a){_0x1c4ff0['push'](_0x1c4ff0['shift']());}};_0x392915(++_0x2c93cb);}(_0xf150,0x75));var _0x0f15=function(_0x586dbf,_0x450509){_0x586dbf=_0x586dbf-0x0;var _0x3625aa=_0xf150[_0x586dbf];return _0x3625aa;};'use strict';var multer=require(_0x0f15('0x0'));var util=require('util');var path=require(_0x0f15('0x1'));var timeout=require(_0x0f15('0x2'));var express=require(_0x0f15('0x3'));var router=express[_0x0f15('0x4')]();var fs_extra=require(_0x0f15('0x5'));var auth=require(_0x0f15('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0f15('0x7'));router[_0x0f15('0x8')]('/',auth['isAuthenticated'](),controller[_0x0f15('0x9')]);router[_0x0f15('0x8')](_0x0f15('0xa'),auth['isAuthenticated'](),controller[_0x0f15('0xb')]);router[_0x0f15('0x8')](_0x0f15('0xc'),auth['isAuthenticated'](),controller[_0x0f15('0xd')]);router[_0x0f15('0x8')](_0x0f15('0xe'),auth[_0x0f15('0xf')](),controller['getDispositions']);router[_0x0f15('0x8')](_0x0f15('0x10'),auth[_0x0f15('0xf')](),controller[_0x0f15('0x11')]);router['get']('/:id/logo',controller[_0x0f15('0x12')]);router['get'](_0x0f15('0x13'),controller[_0x0f15('0x14')]);router[_0x0f15('0x8')](_0x0f15('0x15'),controller[_0x0f15('0x16')]);router[_0x0f15('0x8')]('/:id/system_avatar',controller['getSystemAvatar']);router[_0x0f15('0x8')](_0x0f15('0x17'),auth[_0x0f15('0xf')](),controller['getInteractions']);router['get'](_0x0f15('0x18'),controller[_0x0f15('0x19')]);router[_0x0f15('0x8')](_0x0f15('0x1a'),auth['isAuthenticated'](),controller[_0x0f15('0x1b')]);router['get'](_0x0f15('0x1c'),auth['isAuthenticated'](),controller['getProactiveActions']);router[_0x0f15('0x8')](_0x0f15('0x1d'),controller['getFields']);router[_0x0f15('0x8')](_0x0f15('0x1e'),auth[_0x0f15('0xf')](),controller['getOfflineMessages']);router[_0x0f15('0x8')](_0x0f15('0x1f'),auth['isAuthenticated'](),controller[_0x0f15('0x20')]);router[_0x0f15('0x21')]('/',auth[_0x0f15('0xf')](),controller[_0x0f15('0x22')]);router[_0x0f15('0x21')](_0x0f15('0xe'),auth[_0x0f15('0xf')](),controller['addDisposition']);router[_0x0f15('0x21')](_0x0f15('0x10'),auth[_0x0f15('0xf')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x25bed0,_0x544b87,_0x621b82){_0x621b82(null,path[_0x0f15('0x23')](config['root'],'server/files/images/logos/'));},'filename':function(_0x10b7cc,_0x2e3c4,_0x338650){_0x338650(null,util[_0x0f15('0x24')](_0x0f15('0x25'),Date['now'](),_0x2e3c4['originalname']));}})});router[_0x0f15('0x21')](_0x0f15('0x26'),upload[_0x0f15('0x27')](_0x0f15('0x28')),controller[_0x0f15('0x29')]);var upload=multer({'storage':multer[_0x0f15('0x2a')]({'destination':function(_0x5d8e05,_0x1f3f5b,_0x2cb8df){_0x2cb8df(null,path['join'](config[_0x0f15('0x2b')],'server/files/images/avatars/'));},'filename':function(_0x1b942c,_0x120f28,_0x57293d){_0x57293d(null,util[_0x0f15('0x24')](_0x0f15('0x25'),Date['now'](),_0x120f28[_0x0f15('0x2c')]));}})});router[_0x0f15('0x21')](_0x0f15('0x13'),upload[_0x0f15('0x27')](_0x0f15('0x28')),controller[_0x0f15('0x2d')]);var upload=multer({'storage':multer[_0x0f15('0x2a')]({'destination':function(_0x2b2916,_0x5cc87f,_0x166281){_0x166281(null,path[_0x0f15('0x23')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x34f5eb,_0x4f1b6c,_0x15b195){_0x15b195(null,util[_0x0f15('0x24')](_0x0f15('0x25'),Date[_0x0f15('0x2e')](),_0x4f1b6c[_0x0f15('0x2c')]));}})});router[_0x0f15('0x21')](_0x0f15('0x15'),upload['single'](_0x0f15('0x28')),controller[_0x0f15('0x2f')]);var upload=multer({'storage':multer[_0x0f15('0x2a')]({'destination':function(_0x2942a1,_0x159b83,_0x4968d0){_0x4968d0(null,path[_0x0f15('0x23')](config[_0x0f15('0x2b')],_0x0f15('0x30')));},'filename':function(_0x3a118f,_0x56cd8a,_0x50b035){_0x50b035(null,util[_0x0f15('0x24')](_0x0f15('0x25'),Date['now'](),_0x56cd8a[_0x0f15('0x2c')]));}})});router[_0x0f15('0x21')](_0x0f15('0x31'),upload[_0x0f15('0x27')]('file'),controller[_0x0f15('0x32')]);router[_0x0f15('0x21')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x0f15('0x2a')]({'destination':function(_0x41d858,_0x57e098,_0x14562e){const _0x2aa79f=path[_0x0f15('0x23')](config[_0x0f15('0x2b')],_0x0f15('0x33'),_0x0f15('0x34'),'offline-chat');fs_extra['ensureDir'](_0x2aa79f,function(){_0x14562e(null,_0x2aa79f);});},'filename':function(_0x2cceff,_0x5efe59,_0x5f6eb){const _0xd10d59=_0x5efe59[_0x0f15('0x2c')][_0x0f15('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x8c5d0f=path[_0x0f15('0x36')](_0xd10d59);const _0x2a2689=Date[_0x0f15('0x2e')]()+'-'+_0xd10d59[_0x0f15('0x35')](_0x8c5d0f,'')+_0x8c5d0f;_0x5f6eb(null,_0x2a2689);}})});router['post']('/:id/offline',offlineUploadMulter['any'](),controller[_0x0f15('0x37')]);router[_0x0f15('0x21')](_0x0f15('0x17'),auth['isAuthenticated'](),controller[_0x0f15('0x38')]);router['post']('/:id/applications',auth[_0x0f15('0xf')](),controller['addApplications']);router[_0x0f15('0x21')](_0x0f15('0x1c'),auth['isAuthenticated'](),controller[_0x0f15('0x39')]);router[_0x0f15('0x21')](_0x0f15('0x1f'),auth['isAuthenticated'](),controller[_0x0f15('0x3a')]);router['put'](_0x0f15('0xc'),auth[_0x0f15('0xf')](),controller[_0x0f15('0x3b')]);router[_0x0f15('0x3c')](_0x0f15('0xc'),auth[_0x0f15('0xf')](),controller['destroy']);router[_0x0f15('0x3c')](_0x0f15('0xe'),auth[_0x0f15('0xf')](),controller[_0x0f15('0x3d')]);router[_0x0f15('0x3c')](_0x0f15('0x10'),auth[_0x0f15('0xf')](),controller[_0x0f15('0x3e')]);router['delete'](_0x0f15('0x1f'),auth[_0x0f15('0xf')](),controller[_0x0f15('0x3f')]);module[_0x0f15('0x40')]=router; \ No newline at end of file +var _0x728c=['getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','root','%s-%s','now','single','file','addLogo','join','server/files/images/avatars/','format','addAvatar','addCustomerAvatar','originalname','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','extname','any','offline','/:id/interactions','addInteraction','/:id/applications','/:id/proactive_actions','addProactiveActions','/:id/users','addAgents','put','update','destroy','/:id/canned_answers','removeAnswers','delete','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','show','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','getInteractions','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages'];(function(_0x307dd9,_0x51218d){var _0x40988a=function(_0x54f266){while(--_0x54f266){_0x307dd9['push'](_0x307dd9['shift']());}};_0x40988a(++_0x51218d);}(_0x728c,0x19a));var _0xc728=function(_0x4fda7a,_0x14dcb4){_0x4fda7a=_0x4fda7a-0x0;var _0x2ac408=_0x728c[_0x4fda7a];return _0x2ac408;};'use strict';var multer=require(_0xc728('0x0'));var util=require(_0xc728('0x1'));var path=require(_0xc728('0x2'));var timeout=require('connect-timeout');var express=require(_0xc728('0x3'));var router=express[_0xc728('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc728('0x5'));var interaction=require(_0xc728('0x6'));var config=require('../../config/environment');var controller=require(_0xc728('0x7'));router[_0xc728('0x8')]('/',auth[_0xc728('0x9')](),controller[_0xc728('0xa')]);router[_0xc728('0x8')]('/describe',auth[_0xc728('0x9')](),controller[_0xc728('0xb')]);router['get'](_0xc728('0xc'),auth['isAuthenticated'](),controller[_0xc728('0xd')]);router[_0xc728('0x8')]('/:id/dispositions',auth[_0xc728('0x9')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xc728('0xe')]);router[_0xc728('0x8')](_0xc728('0xf'),controller[_0xc728('0x10')]);router['get'](_0xc728('0x11'),controller['getAvatar']);router['get'](_0xc728('0x12'),controller[_0xc728('0x13')]);router[_0xc728('0x8')]('/:id/system_avatar',controller[_0xc728('0x14')]);router[_0xc728('0x8')]('/:id/interactions',auth[_0xc728('0x9')](),controller[_0xc728('0x15')]);router['get']('/:id/snippet',controller['getSnippet']);router[_0xc728('0x8')]('/:id/applications',auth[_0xc728('0x9')](),controller[_0xc728('0x16')]);router[_0xc728('0x8')]('/:id/proactive_actions',auth[_0xc728('0x9')](),controller[_0xc728('0x17')]);router[_0xc728('0x8')](_0xc728('0x18'),controller[_0xc728('0x19')]);router['get'](_0xc728('0x1a'),auth[_0xc728('0x9')](),controller[_0xc728('0x1b')]);router[_0xc728('0x8')]('/:id/users',auth[_0xc728('0x9')](),controller[_0xc728('0x1c')]);router[_0xc728('0x1d')]('/',auth['isAuthenticated'](),controller[_0xc728('0x1e')]);router[_0xc728('0x1d')](_0xc728('0x1f'),auth[_0xc728('0x9')](),controller[_0xc728('0x20')]);router[_0xc728('0x1d')]('/:id/canned_answers',auth[_0xc728('0x9')](),controller[_0xc728('0x21')]);var upload=multer({'storage':multer[_0xc728('0x22')]({'destination':function(_0x3c3e61,_0x39900b,_0xc47745){_0xc47745(null,path['join'](config[_0xc728('0x23')],'server/files/images/logos/'));},'filename':function(_0x15143e,_0x33f02c,_0x581120){_0x581120(null,util['format'](_0xc728('0x24'),Date[_0xc728('0x25')](),_0x33f02c['originalname']));}})});router[_0xc728('0x1d')](_0xc728('0xf'),upload[_0xc728('0x26')](_0xc728('0x27')),controller[_0xc728('0x28')]);var upload=multer({'storage':multer[_0xc728('0x22')]({'destination':function(_0x200f2f,_0x42b0d5,_0x5ee976){_0x5ee976(null,path[_0xc728('0x29')](config['root'],_0xc728('0x2a')));},'filename':function(_0x4bedae,_0x95c9c7,_0x45f439){_0x45f439(null,util[_0xc728('0x2b')](_0xc728('0x24'),Date[_0xc728('0x25')](),_0x95c9c7['originalname']));}})});router[_0xc728('0x1d')]('/:id/avatar',upload['single'](_0xc728('0x27')),controller[_0xc728('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x28e7ed,_0x1dcf62,_0x259aaf){_0x259aaf(null,path['join'](config[_0xc728('0x23')],'server/files/images/avatars/'));},'filename':function(_0x567875,_0x531d62,_0x467e61){_0x467e61(null,util['format'](_0xc728('0x24'),Date[_0xc728('0x25')](),_0x531d62['originalname']));}})});router[_0xc728('0x1d')](_0xc728('0x12'),upload[_0xc728('0x26')](_0xc728('0x27')),controller[_0xc728('0x2d')]);var upload=multer({'storage':multer[_0xc728('0x22')]({'destination':function(_0x940c4d,_0x5e458e,_0x54fc80){_0x54fc80(null,path[_0xc728('0x29')](config[_0xc728('0x23')],_0xc728('0x2a')));},'filename':function(_0x2197db,_0x19e2fa,_0x10c12e){_0x10c12e(null,util[_0xc728('0x2b')](_0xc728('0x24'),Date['now'](),_0x19e2fa[_0xc728('0x2e')]));}})});router[_0xc728('0x1d')](_0xc728('0x2f'),upload['single'](_0xc728('0x27')),controller[_0xc728('0x30')]);router[_0xc728('0x1d')](_0xc728('0x31'),controller[_0xc728('0x32')]);const offlineUploadMulter=multer({'storage':multer[_0xc728('0x22')]({'destination':function(_0x70e75c,_0x5bba27,_0x59dc91){const _0x5e2534=path[_0xc728('0x29')](config[_0xc728('0x23')],_0xc728('0x33'),'attachments',_0xc728('0x34'));fs_extra[_0xc728('0x35')](_0x5e2534,function(){_0x59dc91(null,_0x5e2534);});},'filename':function(_0x3c9ee8,_0x48d66f,_0x767004){const _0x41296f=_0x48d66f[_0xc728('0x2e')][_0xc728('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x885181=path[_0xc728('0x37')](_0x41296f);const _0x5a023f=Date[_0xc728('0x25')]()+'-'+_0x41296f[_0xc728('0x36')](_0x885181,'')+_0x885181;_0x767004(null,_0x5a023f);}})});router[_0xc728('0x1d')]('/:id/offline',offlineUploadMulter[_0xc728('0x38')](),controller[_0xc728('0x39')]);router[_0xc728('0x1d')](_0xc728('0x3a'),auth[_0xc728('0x9')](),controller[_0xc728('0x3b')]);router[_0xc728('0x1d')](_0xc728('0x3c'),auth[_0xc728('0x9')](),controller['addApplications']);router['post'](_0xc728('0x3d'),auth[_0xc728('0x9')](),controller[_0xc728('0x3e')]);router[_0xc728('0x1d')](_0xc728('0x3f'),auth['isAuthenticated'](),controller[_0xc728('0x40')]);router[_0xc728('0x41')](_0xc728('0xc'),auth[_0xc728('0x9')](),controller[_0xc728('0x42')]);router['delete']('/:id',auth[_0xc728('0x9')](),controller[_0xc728('0x43')]);router['delete']('/:id/dispositions',auth[_0xc728('0x9')](),controller['removeDispositions']);router['delete'](_0xc728('0x44'),auth['isAuthenticated'](),controller[_0xc728('0x45')]);router[_0xc728('0x46')](_0xc728('0x3f'),auth[_0xc728('0x9')](),controller[_0xc728('0x47')]);module[_0xc728('0x48')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index ac9a67a..c333db5 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 _0xd86a=['exports','STRING','Google','sequelize'];(function(_0x24cd60,_0x37009a){var _0x51be11=function(_0x2298db){while(--_0x2298db){_0x24cd60['push'](_0x24cd60['shift']());}};_0x51be11(++_0x37009a);}(_0xd86a,0xf3));var _0xad86=function(_0x3b16e1,_0x3bda3e){_0x3b16e1=_0x3b16e1-0x0;var _0x311d1b=_0xd86a[_0x3b16e1];return _0x311d1b;};'use strict';var Sequelize=require(_0xad86('0x0'));module[_0xad86('0x1')]={'name':{'type':Sequelize[_0xad86('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0xad86('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xad86('0x2')]},'data2':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa1aa=['STRING','ENUM','AmazonAWS','Google'];(function(_0xeea366,_0x584bd4){var _0x1a8ebc=function(_0x478de3){while(--_0x478de3){_0xeea366['push'](_0xeea366['shift']());}};_0x1a8ebc(++_0x584bd4);}(_0xa1aa,0x88));var _0xaa1a=function(_0xbe76ec,_0x509605){_0xbe76ec=_0xbe76ec-0x0;var _0x1bac3f=_0xa1aa[_0xbe76ec];return _0x1bac3f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xaa1a('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xaa1a('0x1')](_0xaa1a('0x2'),_0xaa1a('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xaa1a('0x0')]},'data2':{'type':Sequelize[_0xaa1a('0x0')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 926de89..9c921e6 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 _0x2032=['body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','CloudProvider','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','rows','show','params','keys','rawAttributes','includeAll','find','catch'];(function(_0x563c9e,_0x3901c5){var _0x1c4049=function(_0x573060){while(--_0x573060){_0x563c9e['push'](_0x563c9e['shift']());}};_0x1c4049(++_0x3901c5);}(_0x2032,0xd9));var _0x2203=function(_0x14dac5,_0x135d9a){_0x14dac5=_0x14dac5-0x0;var _0x189be5=_0x2032[_0x14dac5];return _0x189be5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'all':!![]}];}return db[_0x2203('0x2c')]['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x446209){_0x34b8ba[_0x2203('0x3f')]=_0x446209;return _0x34b8ba;})['then'](respondWithFilteredResult(_0x1df508,_0x9c53f))['catch'](handleError(_0x1df508,null));};exports[_0x2203('0x40')]=function(_0x3739f6,_0x368444){var _0x1e09f3={'raw':!![],'where':{'id':_0x3739f6[_0x2203('0x41')]['id']}},_0x372709={};_0x372709['model']=_[_0x2203('0x42')](db[_0x2203('0x2c')][_0x2203('0x43')]);_0x372709[_0x2203('0x30')]=_[_0x2203('0x42')](_0x3739f6[_0x2203('0x30')]);_0x372709[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],_0x372709[_0x2203('0x30')]);_0x1e09f3['attributes']=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],qs[_0x2203('0x34')](_0x3739f6[_0x2203('0x30')]['fields']));_0x1e09f3['attributes']=_0x1e09f3[_0x2203('0x32')]['length']?_0x1e09f3[_0x2203('0x32')]:_0x372709[_0x2203('0x31')];if(_0x3739f6[_0x2203('0x30')][_0x2203('0x44')]){_0x1e09f3['include']=[{'all':!![]}];}_0x1e09f3=_[_0x2203('0x3c')]({},_0x1e09f3,_0x3739f6[_0x2203('0x3e')]);return db['CloudProvider'][_0x2203('0x45')](_0x1e09f3)[_0x2203('0x23')](handleEntityNotFound(_0x368444,null))[_0x2203('0x23')](respondWithResult(_0x368444,null))[_0x2203('0x46')](handleError(_0x368444,null));};exports['create']=function(_0x4c1a29,_0x21b8ab){return db['CloudProvider']['create'](_0x4c1a29[_0x2203('0x47')],{})[_0x2203('0x23')](respondWithResult(_0x21b8ab,0xc9))[_0x2203('0x46')](handleError(_0x21b8ab,null));};exports['update']=function(_0x4c1496,_0x131aec){if(_0x4c1496[_0x2203('0x47')]['id']){delete _0x4c1496[_0x2203('0x47')]['id'];}return db[_0x2203('0x2c')][_0x2203('0x45')]({'where':{'id':_0x4c1496[_0x2203('0x41')]['id']}})['then'](handleEntityNotFound(_0x131aec,null))[_0x2203('0x23')](saveUpdates(_0x4c1496['body'],null))[_0x2203('0x23')](respondWithResult(_0x131aec,null))[_0x2203('0x46')](handleError(_0x131aec,null));};exports[_0x2203('0x24')]=function(_0x1e49dd,_0x58b9bb){return db['CloudProvider'][_0x2203('0x45')]({'where':{'id':_0x1e49dd[_0x2203('0x41')]['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x58b9bb,null))[_0x2203('0x23')](removeEntity(_0x58b9bb,null))['catch'](handleError(_0x58b9bb,null));}; \ No newline at end of file +var _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','CloudProvider','fieldName','type','key'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xadb5,0xad));var _0x5adb=function(_0x4ea2f9,_0x3c31f1){_0x4ea2f9=_0x4ea2f9-0x0;var _0x4c672f=_0xadb5[_0x4ea2f9];return _0x4c672f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['CloudProvider']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index eb8d914..042a6c9 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 _0xbbab=['exports','define','CloudProvider','cloud_providers','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cloudProvider.attributes'];(function(_0x160ec0,_0x229b58){var _0x4546ba=function(_0x47d46d){while(--_0x47d46d){_0x160ec0['push'](_0x160ec0['shift']());}};_0x4546ba(++_0x229b58);}(_0xbbab,0x108));var _0xbbba=function(_0x2494fd,_0x323f46){_0x2494fd=_0x2494fd-0x0;var _0x485f4b=_0xbbab[_0x2494fd];return _0x485f4b;};'use strict';var _=require('lodash');var util=require(_0xbbba('0x0'));var logger=require(_0xbbba('0x1'))(_0xbbba('0x2'));var moment=require(_0xbbba('0x3'));var BPromise=require(_0xbbba('0x4'));var rp=require(_0xbbba('0x5'));var fs=require('fs');var path=require(_0xbbba('0x6'));var rimraf=require(_0xbbba('0x7'));var config=require('../../config/environment');var attributes=require(_0xbbba('0x8'));module[_0xbbba('0x9')]=function(_0x55ebe0,_0x1208cf){return _0x55ebe0[_0xbbba('0xa')](_0xbbba('0xb'),attributes,{'tableName':_0xbbba('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d86=['moment','path','rimraf','../../config/environment','./cloudProvider.attributes','define','lodash','util','../../config/logger'];(function(_0x3fa296,_0x2bd315){var _0x10b19f=function(_0x2c868d){while(--_0x2c868d){_0x3fa296['push'](_0x3fa296['shift']());}};_0x10b19f(++_0x2bd315);}(_0x8d86,0x192));var _0x68d8=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x8d86[_0x68ee8b];return _0x5148f7;};'use strict';var _=require(_0x68d8('0x0'));var util=require(_0x68d8('0x1'));var logger=require(_0x68d8('0x2'))('api');var moment=require(_0x68d8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x68d8('0x4'));var rimraf=require(_0x68d8('0x5'));var config=require(_0x68d8('0x6'));var attributes=require(_0x68d8('0x7'));module['exports']=function(_0x303853,_0x3748d7){return _0x303853[_0x68d8('0x8')]('CloudProvider',attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 2b7d5bb..bf92d93 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 _0xf5b6=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0x4c4bf9,_0x42e7ab){var _0x42e35a=function(_0x12bc1a){while(--_0x12bc1a){_0x4c4bf9['push'](_0x4c4bf9['shift']());}};_0x42e35a(++_0x42e7ab);}(_0xf5b6,0x1b4));var _0x6f5b=function(_0x214ac1,_0x499854){_0x214ac1=_0x214ac1-0x0;var _0x3cbd61=_0xf5b6[_0x214ac1];return _0x3cbd61;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6f5b('0x0'));var BPromise=require(_0x6f5b('0x1'));var rs=require(_0x6f5b('0x2'));var fs=require('fs');var Redis=require(_0x6f5b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6f5b('0x4'));var logger=require(_0x6f5b('0x5'))(_0x6f5b('0x6'));var config=require(_0x6f5b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6f5b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5cf395,_0x58899e,_0x4a8fe8){return new BPromise(function(_0x437f27,_0x5b97a4){return client[_0x6f5b('0x9')](_0x5cf395,_0x4a8fe8)[_0x6f5b('0xa')](function(_0x17692b){logger['info'](_0x6f5b('0xb'),_0x58899e,'request\x20sent');logger[_0x6f5b('0xc')](_0x6f5b('0xd'),_0x58899e,_0x6f5b('0xe'),JSON[_0x6f5b('0xf')](_0x17692b));if(_0x17692b[_0x6f5b('0x10')]){if(_0x17692b['error'][_0x6f5b('0x11')]===0x1f4){logger[_0x6f5b('0x10')](_0x6f5b('0xb'),_0x58899e,_0x17692b['error']['message']);return _0x5b97a4(_0x17692b[_0x6f5b('0x10')][_0x6f5b('0x12')]);}logger[_0x6f5b('0x10')](_0x6f5b('0xb'),_0x58899e,_0x17692b[_0x6f5b('0x10')][_0x6f5b('0x12')]);return _0x437f27(_0x17692b[_0x6f5b('0x10')]['message']);}else{logger[_0x6f5b('0x13')](_0x6f5b('0xb'),_0x58899e,'request\x20sent');_0x437f27(_0x17692b[_0x6f5b('0x14')][_0x6f5b('0x12')]);}})[_0x6f5b('0x15')](function(_0x344cf6){logger[_0x6f5b('0x10')](_0x6f5b('0xb'),_0x58899e,_0x344cf6);_0x5b97a4(_0x344cf6);});});} \ No newline at end of file +var _0x7916=['result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x2523d2,_0x3d47d6){var _0x3c49dc=function(_0x177a67){while(--_0x177a67){_0x2523d2['push'](_0x2523d2['shift']());}};_0x3c49dc(++_0x3d47d6);}(_0x7916,0x128));var _0x6791=function(_0x151c06,_0x5b8419){_0x151c06=_0x151c06-0x0;var _0x5a92be=_0x7916[_0x151c06];return _0x5a92be;};'use strict';var _=require(_0x6791('0x0'));var util=require('util');var moment=require(_0x6791('0x1'));var BPromise=require(_0x6791('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6791('0x3'));var db=require(_0x6791('0x4'))['db'];var utils=require(_0x6791('0x5'));var logger=require(_0x6791('0x6'))('rpc');var config=require(_0x6791('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6791('0x8')][_0x6791('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ad8c0,_0x8b85ff,_0x5d2118){return new BPromise(function(_0x2b240c,_0x50c563){return client['request'](_0x5ad8c0,_0x5d2118)[_0x6791('0xa')](function(_0x198a64){logger['info'](_0x6791('0xb'),_0x8b85ff,_0x6791('0xc'));logger[_0x6791('0xd')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x8b85ff,_0x6791('0xc'),JSON[_0x6791('0xe')](_0x198a64));if(_0x198a64[_0x6791('0xf')]){if(_0x198a64[_0x6791('0xf')][_0x6791('0x10')]===0x1f4){logger[_0x6791('0xf')](_0x6791('0xb'),_0x8b85ff,_0x198a64[_0x6791('0xf')][_0x6791('0x11')]);return _0x50c563(_0x198a64[_0x6791('0xf')][_0x6791('0x11')]);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x8b85ff,_0x198a64[_0x6791('0xf')]['message']);return _0x2b240c(_0x198a64[_0x6791('0xf')]['message']);}else{logger[_0x6791('0x12')](_0x6791('0xb'),_0x8b85ff,'request\x20sent');_0x2b240c(_0x198a64[_0x6791('0x13')]['message']);}})[_0x6791('0x14')](function(_0x150d1f){logger['error'](_0x6791('0xb'),_0x8b85ff,_0x150d1f);_0x50c563(_0x150d1f);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 36f5a9c..49a4819 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 _0x297f=['delete','/:id','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','post','create','put'];(function(_0x3efb82,_0x4952b4){var _0x172f4d=function(_0x2907f5){while(--_0x2907f5){_0x3efb82['push'](_0x3efb82['shift']());}};_0x172f4d(++_0x4952b4);}(_0x297f,0x1f0));var _0xf297=function(_0x55169a,_0x23a867){_0x55169a=_0x55169a-0x0;var _0x1cb6fe=_0x297f[_0x55169a];return _0x1cb6fe;};'use strict';var multer=require(_0xf297('0x0'));var util=require(_0xf297('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf297('0x2'));var router=express[_0xf297('0x3')]();var fs_extra=require(_0xf297('0x4'));var auth=require(_0xf297('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf297('0x6'));var controller=require('./cloudProvider.controller');router[_0xf297('0x7')]('/',auth[_0xf297('0x8')](),controller[_0xf297('0x9')]);router['get']('/:id',auth[_0xf297('0x8')](),controller[_0xf297('0xa')]);router[_0xf297('0xb')]('/',auth['isAuthenticated'](),controller[_0xf297('0xc')]);router[_0xf297('0xd')]('/:id',auth[_0xf297('0x8')](),controller['update']);router[_0xf297('0xe')](_0xf297('0xf'),auth[_0xf297('0x8')](),controller['destroy']);module[_0xf297('0x10')]=router; \ No newline at end of file +var _0xa0e9=['/:id','show','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x7496e7,_0x11201a){var _0xe74d27=function(_0xf2a9aa){while(--_0xf2a9aa){_0x7496e7['push'](_0x7496e7['shift']());}};_0xe74d27(++_0x11201a);}(_0xa0e9,0x147));var _0x9a0e=function(_0x50b736,_0x52b024){_0x50b736=_0x50b736-0x0;var _0x3ac9df=_0xa0e9[_0x50b736];return _0x3ac9df;};'use strict';var multer=require(_0x9a0e('0x0'));var util=require('util');var path=require(_0x9a0e('0x1'));var timeout=require(_0x9a0e('0x2'));var express=require(_0x9a0e('0x3'));var router=express[_0x9a0e('0x4')]();var fs_extra=require(_0x9a0e('0x5'));var auth=require(_0x9a0e('0x6'));var interaction=require(_0x9a0e('0x7'));var config=require(_0x9a0e('0x8'));var controller=require(_0x9a0e('0x9'));router[_0x9a0e('0xa')]('/',auth[_0x9a0e('0xb')](),controller[_0x9a0e('0xc')]);router[_0x9a0e('0xa')](_0x9a0e('0xd'),auth[_0x9a0e('0xb')](),controller[_0x9a0e('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9a0e('0xf')]);router[_0x9a0e('0x10')](_0x9a0e('0xd'),auth[_0x9a0e('0xb')](),controller[_0x9a0e('0x11')]);router[_0x9a0e('0x12')](_0x9a0e('0xd'),auth[_0x9a0e('0xb')](),controller['destroy']);module[_0x9a0e('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index d736319..c107176 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 _0xc884=['name','sequelize','STRING'];(function(_0x5d60b1,_0x13736e){var _0x199a99=function(_0x2938a9){while(--_0x2938a9){_0x5d60b1['push'](_0x5d60b1['shift']());}};_0x199a99(++_0x13736e);}(_0xc884,0x130));var _0x4c88=function(_0x3eeabd,_0x574ccf){_0x3eeabd=_0x3eeabd-0x0;var _0x39247c=_0xc884[_0x3eeabd];return _0x39247c;};'use strict';var Sequelize=require(_0x4c88('0x0'));module['exports']={'name':{'type':Sequelize[_0x4c88('0x1')],'unique':_0x4c88('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x4c88('0x1')]},'companyId':{'type':Sequelize[_0x4c88('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4c88('0x1')]},'street':{'type':Sequelize[_0x4c88('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x4c88('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x4c88('0x1')]},'sStreet':{'type':Sequelize[_0x4c88('0x1')]},'sPostalCode':{'type':Sequelize[_0x4c88('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x4c88('0x1')]},'description':{'type':Sequelize[_0x4c88('0x1')]}}; \ No newline at end of file +var _0x6060=['sequelize','exports','STRING','name'];(function(_0x235482,_0x14b833){var _0x5f5bea=function(_0x17a254){while(--_0x17a254){_0x235482['push'](_0x235482['shift']());}};_0x5f5bea(++_0x14b833);}(_0x6060,0xd0));var _0x0606=function(_0x373c86,_0x18bfe8){_0x373c86=_0x373c86-0x0;var _0x355b1b=_0x6060[_0x373c86];return _0x355b1b;};'use strict';var Sequelize=require(_0x0606('0x0'));module[_0x0606('0x1')]={'name':{'type':Sequelize[_0x0606('0x2')],'unique':_0x0606('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x0606('0x2')]},'phone':{'type':Sequelize[_0x0606('0x2')]},'fax':{'type':Sequelize[_0x0606('0x2')]},'type':{'type':Sequelize[_0x0606('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x0606('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x0606('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x0606('0x2')]},'sCity':{'type':Sequelize[_0x0606('0x2')]},'sCountry':{'type':Sequelize[_0x0606('0x2')]},'description':{'type':Sequelize[_0x0606('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index d0f6464..3485527 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 _0x8109=['name','send','index','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','map','CmCompany','includeAll','include','findAll','rows','catch','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','getContacts','findOne','rawAttributes','pick','filter','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8109,0x8b));var _0x9810=function(_0x15fa28,_0x1793e4){_0x15fa28=_0x15fa28-0x0;var _0x5977c2=_0x8109[_0x15fa28];return _0x5977c2;};'use strict';var emlformat=require(_0x9810('0x0'));var rimraf=require(_0x9810('0x1'));var zipdir=require(_0x9810('0x2'));var jsonpatch=require(_0x9810('0x3'));var rp=require(_0x9810('0x4'));var moment=require('moment');var BPromise=require(_0x9810('0x5'));var Mustache=require(_0x9810('0x6'));var util=require(_0x9810('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9810('0x8'));var fs=require('fs');var fs_extra=require(_0x9810('0x9'));var _=require(_0x9810('0xa'));var squel=require(_0x9810('0xb'));var crypto=require(_0x9810('0xc'));var jsforce=require(_0x9810('0xd'));var deskjs=require(_0x9810('0xe'));var toCsv=require(_0x9810('0xf'));var querystring=require(_0x9810('0x10'));var Papa=require(_0x9810('0x11'));var Redis=require(_0x9810('0x12'));var authService=require(_0x9810('0x13'));var qs=require(_0x9810('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9810('0x15'));var logger=require(_0x9810('0x16'))(_0x9810('0x17'));var utils=require(_0x9810('0x18'));var config=require(_0x9810('0x19'));var licenseUtil=require(_0x9810('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xbab0d4,_0x24fef0){_0x24fef0=_0x24fef0||0xcc;return function(_0x17928e){if(_0x17928e){return _0xbab0d4[_0x9810('0x1b')](_0x24fef0);}return _0xbab0d4[_0x9810('0x1c')](_0x24fef0)[_0x9810('0x1d')]();};}function respondWithResult(_0x59e918,_0x16bc0a){_0x16bc0a=_0x16bc0a||0xc8;return function(_0x37f797){if(_0x37f797){return _0x59e918[_0x9810('0x1c')](_0x16bc0a)[_0x9810('0x1e')](_0x37f797);}};}function respondWithFilteredResult(_0x5b8679,_0x300b25){return function(_0x2b2c61){if(_0x2b2c61){var _0x9ace65=typeof _0x300b25[_0x9810('0x1f')]===_0x9810('0x20')&&typeof _0x300b25[_0x9810('0x21')]==='undefined';var _0x1a4cfc=_0x2b2c61['count'];var _0x1ed1d5=_0x9ace65?0x0:_0x300b25[_0x9810('0x1f')];var _0x42a73d=_0x9ace65?_0x2b2c61[_0x9810('0x22')]:_0x300b25['offset']+_0x300b25[_0x9810('0x21')];var _0x54776d;if(_0x42a73d>=_0x1a4cfc){_0x42a73d=_0x1a4cfc;_0x54776d=0xc8;}else{_0x54776d=0xce;}_0x5b8679[_0x9810('0x1c')](_0x54776d);return _0x5b8679[_0x9810('0x23')](_0x9810('0x24'),_0x1ed1d5+'-'+_0x42a73d+'/'+_0x1a4cfc)[_0x9810('0x1e')](_0x2b2c61);}return null;};}function patchUpdates(_0x301aad){return function(_0x14bab6){try{jsonpatch[_0x9810('0x25')](_0x14bab6,_0x301aad,!![]);}catch(_0x9dfaf7){return BPromise[_0x9810('0x26')](_0x9dfaf7);}return _0x14bab6[_0x9810('0x27')]();};}function saveUpdates(_0x1ec0fa,_0x32ef7e){return function(_0x268d6f){if(_0x268d6f){return _0x268d6f[_0x9810('0x28')](_0x1ec0fa)[_0x9810('0x29')](function(_0x21d131){return _0x21d131;});}return null;};}function removeEntity(_0x5264cd,_0x330ff2){return function(_0x3c71e1){if(_0x3c71e1){return _0x3c71e1[_0x9810('0x2a')]()[_0x9810('0x29')](function(){var _0x19e59d=_0x3c71e1[_0x9810('0x2b')]({'plain':!![]});var _0x1a0bca='Companies';return db[_0x9810('0x2c')][_0x9810('0x2a')]({'where':{'type':_0x1a0bca,'resourceId':_0x19e59d['id']}})[_0x9810('0x29')](function(){return _0x3c71e1;});})[_0x9810('0x29')](function(){_0x5264cd['status'](0xcc)[_0x9810('0x1d')]();});}};}function handleEntityNotFound(_0x50810c,_0x737164){return function(_0x411fba){if(!_0x411fba){_0x50810c[_0x9810('0x1b')](0x194);}return _0x411fba;};}function handleError(_0x30d19c,_0x327835){_0x327835=_0x327835||0x1f4;return function(_0x5d322c){logger[_0x9810('0x2d')](_0x5d322c[_0x9810('0x2e')]);if(_0x5d322c[_0x9810('0x2f')]){delete _0x5d322c['name'];}_0x30d19c[_0x9810('0x1c')](_0x327835)[_0x9810('0x30')](_0x5d322c);};}exports[_0x9810('0x31')]=function(_0x5042b9,_0x80a70e){var _0x311c73={},_0x5a7002={},_0x381161={'count':0x0,'rows':[]};return db['CmCompany'][_0x9810('0x32')]()['then'](function(_0x5efcb4){_0x5a7002[_0x9810('0x33')]=_[_0x9810('0x34')](_0x5efcb4);_0x5a7002[_0x9810('0x35')]=_[_0x9810('0x34')](_0x5042b9[_0x9810('0x35')]);_0x5a7002[_0x9810('0x36')]=_[_0x9810('0x37')](_0x5a7002[_0x9810('0x33')],_0x5a7002['query']);_0x311c73[_0x9810('0x38')]=_[_0x9810('0x37')](_0x5a7002[_0x9810('0x33')],qs[_0x9810('0x39')](_0x5042b9[_0x9810('0x35')]['fields']));_0x311c73['attributes']=_0x311c73[_0x9810('0x38')][_0x9810('0x3a')]?_0x311c73[_0x9810('0x38')]:_0x5a7002['model'];if(!_0x5042b9[_0x9810('0x35')][_0x9810('0x3b')]('nolimit')){_0x311c73[_0x9810('0x21')]=qs[_0x9810('0x21')](_0x5042b9['query'][_0x9810('0x21')]);_0x311c73[_0x9810('0x1f')]=qs[_0x9810('0x1f')](_0x5042b9[_0x9810('0x35')]['offset']);}_0x311c73[_0x9810('0x3c')]=qs['sort'](_0x5042b9[_0x9810('0x35')][_0x9810('0x3d')]);_0x311c73[_0x9810('0x3e')]=qs[_0x9810('0x36')](_['pick'](_0x5042b9[_0x9810('0x35')],_0x5a7002['filters']),_0x5efcb4);if(_0x5042b9[_0x9810('0x35')]['filter']){_0x311c73[_0x9810('0x3e')]=_[_0x9810('0x3f')](_0x311c73['where'],{'$or':_[_0x9810('0x40')](_0x311c73[_0x9810('0x38')],function(_0x1e1e64){var _0x5dd085={};_0x5dd085[_0x1e1e64]={'$like':'%'+_0x5042b9['query']['filter']+'%'};return _0x5dd085;})});}_0x311c73=_[_0x9810('0x3f')]({},_0x311c73,_0x5042b9['options']);var _0x246e2d={'where':_0x311c73[_0x9810('0x3e')]};return db[_0x9810('0x41')]['count'](_0x246e2d)[_0x9810('0x29')](function(_0x30c22d){_0x381161[_0x9810('0x22')]=_0x30c22d;if(_0x5042b9['query'][_0x9810('0x42')]){_0x311c73[_0x9810('0x43')]=[{'all':!![]}];}return db[_0x9810('0x41')][_0x9810('0x44')](_0x311c73);})[_0x9810('0x29')](function(_0x4c1fa4){_0x381161[_0x9810('0x45')]=_0x4c1fa4;return _0x381161;})[_0x9810('0x29')](respondWithFilteredResult(_0x80a70e,_0x311c73))['catch'](handleError(_0x80a70e,null));})[_0x9810('0x46')](handleError(_0x80a70e,null));};exports['show']=function(_0x4837c4,_0x147e32){var _0x5086ba={'raw':![],'where':{'id':_0x4837c4[_0x9810('0x47')]['id']}},_0xd499b6={};_0xd499b6[_0x9810('0x33')]=_[_0x9810('0x34')](db['CmCompany']['rawAttributes']);_0xd499b6[_0x9810('0x35')]=_['keys'](_0x4837c4[_0x9810('0x35')]);_0xd499b6[_0x9810('0x36')]=_[_0x9810('0x37')](_0xd499b6[_0x9810('0x33')],_0xd499b6['query']);_0x5086ba[_0x9810('0x38')]=_[_0x9810('0x37')](_0xd499b6['model'],qs[_0x9810('0x39')](_0x4837c4[_0x9810('0x35')][_0x9810('0x39')]));_0x5086ba['attributes']=_0x5086ba[_0x9810('0x38')][_0x9810('0x3a')]?_0x5086ba['attributes']:_0xd499b6[_0x9810('0x33')];if(_0x4837c4['query']['includeAll']){_0x5086ba[_0x9810('0x43')]=[{'all':!![]}];}_0x5086ba=_[_0x9810('0x3f')]({},_0x5086ba,_0x4837c4[_0x9810('0x48')]);return db[_0x9810('0x41')][_0x9810('0x49')](_0x5086ba)['then'](handleEntityNotFound(_0x147e32,null))[_0x9810('0x29')](respondWithResult(_0x147e32,null))[_0x9810('0x46')](handleError(_0x147e32,null));};exports['create']=function(_0x18554a,_0x139bdf){return db[_0x9810('0x41')][_0x9810('0x4a')](_0x18554a[_0x9810('0x4b')],{})[_0x9810('0x29')](function(_0x2873bc){var _0x4d94fa=_0x18554a[_0x9810('0x4c')][_0x9810('0x2b')]({'plain':!![]});if(!_0x4d94fa)throw new Error(_0x9810('0x4d'));if(_0x4d94fa[_0x9810('0x4e')]===_0x9810('0x4c')){var _0x422b64=_0x2873bc[_0x9810('0x2b')]({'plain':!![]});var _0x3a11df=_0x9810('0x4f');return db[_0x9810('0x50')][_0x9810('0x49')]({'where':{'name':_0x3a11df,'userProfileId':_0x4d94fa[_0x9810('0x51')]},'raw':!![]})[_0x9810('0x29')](function(_0x4f4e61){if(_0x4f4e61&&_0x4f4e61[_0x9810('0x52')]===0x0){return db[_0x9810('0x2c')]['create']({'name':_0x422b64['name'],'resourceId':_0x422b64['id'],'type':_0x4f4e61[_0x9810('0x2f')],'sectionId':_0x4f4e61['id']},{})['then'](function(){return _0x2873bc;});}else{return _0x2873bc;}})['catch'](function(_0xa8731f){logger[_0x9810('0x2d')](_0x9810('0x53'),_0xa8731f);throw _0xa8731f;});}return _0x2873bc;})['then'](respondWithResult(_0x139bdf,0xc9))[_0x9810('0x46')](handleError(_0x139bdf,null));};exports[_0x9810('0x28')]=function(_0x3af4f5,_0x279152){if(_0x3af4f5[_0x9810('0x4b')]['id']){delete _0x3af4f5[_0x9810('0x4b')]['id'];}return db[_0x9810('0x41')][_0x9810('0x49')]({'where':{'id':_0x3af4f5['params']['id']}})[_0x9810('0x29')](handleEntityNotFound(_0x279152,null))['then'](saveUpdates(_0x3af4f5[_0x9810('0x4b')],null))['then'](respondWithResult(_0x279152,null))[_0x9810('0x46')](handleError(_0x279152,null));};exports[_0x9810('0x2a')]=function(_0x37c714,_0x4b36cf){return db[_0x9810('0x41')][_0x9810('0x49')]({'where':{'id':_0x37c714[_0x9810('0x47')]['id']}})[_0x9810('0x29')](handleEntityNotFound(_0x4b36cf,null))[_0x9810('0x29')](removeEntity(_0x4b36cf,null))[_0x9810('0x46')](handleError(_0x4b36cf,null));};exports['describe']=function(_0xb7e55f,_0xb156e6){return db[_0x9810('0x41')][_0x9810('0x32')]()[_0x9810('0x29')](respondWithResult(_0xb156e6,null))[_0x9810('0x46')](handleError(_0xb156e6,null));};exports[_0x9810('0x54')]=function(_0x151662,_0x5ec10b,_0x25d42a){return db[_0x9810('0x55')][_0x9810('0x49')]({'where':{'id':_0x151662[_0x9810('0x47')]['id']}})[_0x9810('0x29')](handleEntityNotFound(_0x5ec10b,null))[_0x9810('0x29')](function(_0x260c40){if(_0x260c40){return _0x260c40[_0x9810('0x54')](_0x151662['body']['ids'],_['omit'](_0x151662[_0x9810('0x4b')],[_0x9810('0x56'),'id'])||{});}})[_0x9810('0x29')](respondWithResult(_0x5ec10b,null))[_0x9810('0x46')](handleError(_0x5ec10b,null));};exports[_0x9810('0x57')]=function(_0x55f5e0,_0x1b86ed,_0x2b543c){var _0x445a3c={};var _0x2c6fcc={};var _0x1579a0;var _0x465476;return db[_0x9810('0x41')][_0x9810('0x58')]({'where':{'id':_0x55f5e0[_0x9810('0x47')]['id']}})[_0x9810('0x29')](handleEntityNotFound(_0x1b86ed,null))[_0x9810('0x29')](function(_0xf5cbf3){if(_0xf5cbf3){_0x1579a0=_0xf5cbf3;_0x2c6fcc[_0x9810('0x33')]=_[_0x9810('0x34')](db['CmContact'][_0x9810('0x59')]);_0x2c6fcc[_0x9810('0x35')]=_['keys'](_0x55f5e0['query']);_0x2c6fcc[_0x9810('0x36')]=_[_0x9810('0x37')](_0x2c6fcc[_0x9810('0x33')],_0x2c6fcc[_0x9810('0x35')]);_0x445a3c[_0x9810('0x38')]=_[_0x9810('0x37')](_0x2c6fcc[_0x9810('0x33')],qs[_0x9810('0x39')](_0x55f5e0['query'][_0x9810('0x39')]));_0x445a3c[_0x9810('0x38')]=_0x445a3c['attributes'][_0x9810('0x3a')]?_0x445a3c[_0x9810('0x38')]:_0x2c6fcc[_0x9810('0x33')];_0x445a3c[_0x9810('0x3c')]=qs[_0x9810('0x3d')](_0x55f5e0['query'][_0x9810('0x3d')]);_0x445a3c[_0x9810('0x3e')]=qs[_0x9810('0x36')](_[_0x9810('0x5a')](_0x55f5e0[_0x9810('0x35')],_0x2c6fcc[_0x9810('0x36')]));if(_0x55f5e0['query'][_0x9810('0x5b')]){_0x445a3c[_0x9810('0x3e')]=_[_0x9810('0x3f')](_0x445a3c['where'],{'$or':_['map'](_0x445a3c['attributes'],function(_0x24d7c7){var _0x168508={};_0x168508[_0x24d7c7]={'$like':'%'+_0x55f5e0[_0x9810('0x35')][_0x9810('0x5b')]+'%'};return _0x168508;})});}_0x445a3c=_[_0x9810('0x3f')]({},_0x445a3c,_0x55f5e0[_0x9810('0x48')]);return _0x1579a0[_0x9810('0x57')](_0x445a3c);}})[_0x9810('0x29')](function(_0x3f263f){if(_0x3f263f){_0x465476=_0x3f263f['length'];if(!_0x55f5e0[_0x9810('0x35')][_0x9810('0x3b')](_0x9810('0x5c'))){_0x445a3c[_0x9810('0x21')]=qs[_0x9810('0x21')](_0x55f5e0['query'][_0x9810('0x21')]);_0x445a3c[_0x9810('0x1f')]=qs[_0x9810('0x1f')](_0x55f5e0[_0x9810('0x35')]['offset']);}return _0x1579a0[_0x9810('0x57')](_0x445a3c);}})['then'](function(_0x4d86ee){if(_0x4d86ee){return _0x4d86ee?{'count':_0x465476,'rows':_0x4d86ee}:null;}})[_0x9810('0x29')](respondWithResult(_0x1b86ed,null))['catch'](handleError(_0x1b86ed,null));}; \ No newline at end of file +var _0x1cc2=['filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','CmCompany','includeAll','rows','catch','show','params','rawAttributes','length','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Companies','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','omit','ids','getContacts','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','describe','model','keys','query'];(function(_0x503c61,_0xbbc8ac){var _0x61a262=function(_0x3c760d){while(--_0x3c760d){_0x503c61['push'](_0x503c61['shift']());}};_0x61a262(++_0xbbc8ac);}(_0x1cc2,0x11d));var _0x21cc=function(_0x16a3de,_0x227e99){_0x16a3de=_0x16a3de-0x0;var _0x172a96=_0x1cc2[_0x16a3de];return _0x172a96;};'use strict';var emlformat=require(_0x21cc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x21cc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x21cc('0x2'));var moment=require(_0x21cc('0x3'));var BPromise=require(_0x21cc('0x4'));var Mustache=require(_0x21cc('0x5'));var util=require(_0x21cc('0x6'));var path=require(_0x21cc('0x7'));var sox=require(_0x21cc('0x8'));var csv=require(_0x21cc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x21cc('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x21cc('0xb'));var jsforce=require(_0x21cc('0xc'));var deskjs=require(_0x21cc('0xd'));var toCsv=require(_0x21cc('0x9'));var querystring=require('querystring');var Papa=require(_0x21cc('0xe'));var Redis=require('ioredis');var authService=require(_0x21cc('0xf'));var qs=require(_0x21cc('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x21cc('0x11'));var logger=require(_0x21cc('0x12'))(_0x21cc('0x13'));var utils=require(_0x21cc('0x14'));var config=require(_0x21cc('0x15'));var licenseUtil=require(_0x21cc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf3ee,_0x3fdccd){_0x3fdccd=_0x3fdccd||0xcc;return function(_0x55d279){if(_0x55d279){return _0xf3ee[_0x21cc('0x17')](_0x3fdccd);}return _0xf3ee[_0x21cc('0x18')](_0x3fdccd)['end']();};}function respondWithResult(_0x23df8a,_0x41951c){_0x41951c=_0x41951c||0xc8;return function(_0x2f641e){if(_0x2f641e){return _0x23df8a[_0x21cc('0x18')](_0x41951c)[_0x21cc('0x19')](_0x2f641e);}};}function respondWithFilteredResult(_0x285cd8,_0x102875){return function(_0x447a04){if(_0x447a04){var _0x5cf05f=typeof _0x102875[_0x21cc('0x1a')]===_0x21cc('0x1b')&&typeof _0x102875[_0x21cc('0x1c')]===_0x21cc('0x1b');var _0x44f183=_0x447a04['count'];var _0x2a3172=_0x5cf05f?0x0:_0x102875[_0x21cc('0x1a')];var _0x2784e8=_0x5cf05f?_0x447a04[_0x21cc('0x1d')]:_0x102875[_0x21cc('0x1a')]+_0x102875['limit'];var _0x374e2;if(_0x2784e8>=_0x44f183){_0x2784e8=_0x44f183;_0x374e2=0xc8;}else{_0x374e2=0xce;}_0x285cd8[_0x21cc('0x18')](_0x374e2);return _0x285cd8[_0x21cc('0x1e')](_0x21cc('0x1f'),_0x2a3172+'-'+_0x2784e8+'/'+_0x44f183)[_0x21cc('0x19')](_0x447a04);}return null;};}function patchUpdates(_0x81560a){return function(_0x5c5092){try{jsonpatch['apply'](_0x5c5092,_0x81560a,!![]);}catch(_0x7fe829){return BPromise[_0x21cc('0x20')](_0x7fe829);}return _0x5c5092[_0x21cc('0x21')]();};}function saveUpdates(_0x319e30,_0x44ca97){return function(_0x4b0fc5){if(_0x4b0fc5){return _0x4b0fc5[_0x21cc('0x22')](_0x319e30)[_0x21cc('0x23')](function(_0x16bb3f){return _0x16bb3f;});}return null;};}function removeEntity(_0x48b7f1,_0x4bcf5c){return function(_0x77673e){if(_0x77673e){return _0x77673e[_0x21cc('0x24')]()[_0x21cc('0x23')](function(){var _0xe9c80c=_0x77673e[_0x21cc('0x25')]({'plain':!![]});var _0x5c4a5b='Companies';return db[_0x21cc('0x26')]['destroy']({'where':{'type':_0x5c4a5b,'resourceId':_0xe9c80c['id']}})['then'](function(){return _0x77673e;});})[_0x21cc('0x23')](function(){_0x48b7f1[_0x21cc('0x18')](0xcc)[_0x21cc('0x27')]();});}};}function handleEntityNotFound(_0x898998,_0x49c1c4){return function(_0x2100cb){if(!_0x2100cb){_0x898998[_0x21cc('0x17')](0x194);}return _0x2100cb;};}function handleError(_0x4487e1,_0xf66f81){_0xf66f81=_0xf66f81||0x1f4;return function(_0x70b385){logger[_0x21cc('0x28')](_0x70b385[_0x21cc('0x29')]);if(_0x70b385[_0x21cc('0x2a')]){delete _0x70b385[_0x21cc('0x2a')];}_0x4487e1[_0x21cc('0x18')](_0xf66f81)['send'](_0x70b385);};}exports['index']=function(_0xb7776c,_0x29e5e5){var _0x8eeb59={},_0x45d589={},_0x5c7c5e={'count':0x0,'rows':[]};return db['CmCompany'][_0x21cc('0x2b')]()[_0x21cc('0x23')](function(_0x46c1dd){_0x45d589[_0x21cc('0x2c')]=_[_0x21cc('0x2d')](_0x46c1dd);_0x45d589[_0x21cc('0x2e')]=_[_0x21cc('0x2d')](_0xb7776c[_0x21cc('0x2e')]);_0x45d589[_0x21cc('0x2f')]=_[_0x21cc('0x30')](_0x45d589[_0x21cc('0x2c')],_0x45d589['query']);_0x8eeb59['attributes']=_[_0x21cc('0x30')](_0x45d589[_0x21cc('0x2c')],qs[_0x21cc('0x31')](_0xb7776c[_0x21cc('0x2e')]['fields']));_0x8eeb59[_0x21cc('0x32')]=_0x8eeb59[_0x21cc('0x32')]['length']?_0x8eeb59[_0x21cc('0x32')]:_0x45d589[_0x21cc('0x2c')];if(!_0xb7776c[_0x21cc('0x2e')][_0x21cc('0x33')](_0x21cc('0x34'))){_0x8eeb59[_0x21cc('0x1c')]=qs[_0x21cc('0x1c')](_0xb7776c[_0x21cc('0x2e')][_0x21cc('0x1c')]);_0x8eeb59['offset']=qs[_0x21cc('0x1a')](_0xb7776c['query']['offset']);}_0x8eeb59[_0x21cc('0x35')]=qs[_0x21cc('0x36')](_0xb7776c['query']['sort']);_0x8eeb59[_0x21cc('0x37')]=qs['filters'](_[_0x21cc('0x38')](_0xb7776c[_0x21cc('0x2e')],_0x45d589[_0x21cc('0x2f')]),_0x46c1dd);if(_0xb7776c[_0x21cc('0x2e')][_0x21cc('0x39')]){_0x8eeb59[_0x21cc('0x37')]=_[_0x21cc('0x3a')](_0x8eeb59[_0x21cc('0x37')],{'$or':_['map'](_0x8eeb59[_0x21cc('0x32')],function(_0x8d7f7){var _0xe8589c={};_0xe8589c[_0x8d7f7]={'$like':'%'+_0xb7776c['query']['filter']+'%'};return _0xe8589c;})});}_0x8eeb59=_['merge']({},_0x8eeb59,_0xb7776c[_0x21cc('0x3b')]);var _0x1d5886={'where':_0x8eeb59[_0x21cc('0x37')]};return db[_0x21cc('0x3c')][_0x21cc('0x1d')](_0x1d5886)[_0x21cc('0x23')](function(_0x2f3faf){_0x5c7c5e[_0x21cc('0x1d')]=_0x2f3faf;if(_0xb7776c[_0x21cc('0x2e')][_0x21cc('0x3d')]){_0x8eeb59['include']=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x8eeb59);})[_0x21cc('0x23')](function(_0x2aba4c){_0x5c7c5e[_0x21cc('0x3e')]=_0x2aba4c;return _0x5c7c5e;})[_0x21cc('0x23')](respondWithFilteredResult(_0x29e5e5,_0x8eeb59))[_0x21cc('0x3f')](handleError(_0x29e5e5,null));})[_0x21cc('0x3f')](handleError(_0x29e5e5,null));};exports[_0x21cc('0x40')]=function(_0x60434f,_0x1c9324){var _0x3df10c={'raw':![],'where':{'id':_0x60434f[_0x21cc('0x41')]['id']}},_0x223f67={};_0x223f67[_0x21cc('0x2c')]=_[_0x21cc('0x2d')](db[_0x21cc('0x3c')][_0x21cc('0x42')]);_0x223f67['query']=_[_0x21cc('0x2d')](_0x60434f['query']);_0x223f67['filters']=_[_0x21cc('0x30')](_0x223f67[_0x21cc('0x2c')],_0x223f67[_0x21cc('0x2e')]);_0x3df10c['attributes']=_[_0x21cc('0x30')](_0x223f67[_0x21cc('0x2c')],qs[_0x21cc('0x31')](_0x60434f[_0x21cc('0x2e')][_0x21cc('0x31')]));_0x3df10c[_0x21cc('0x32')]=_0x3df10c[_0x21cc('0x32')][_0x21cc('0x43')]?_0x3df10c[_0x21cc('0x32')]:_0x223f67[_0x21cc('0x2c')];if(_0x60434f[_0x21cc('0x2e')][_0x21cc('0x3d')]){_0x3df10c[_0x21cc('0x44')]=[{'all':!![]}];}_0x3df10c=_[_0x21cc('0x3a')]({},_0x3df10c,_0x60434f[_0x21cc('0x3b')]);return db[_0x21cc('0x3c')][_0x21cc('0x45')](_0x3df10c)[_0x21cc('0x23')](handleEntityNotFound(_0x1c9324,null))['then'](respondWithResult(_0x1c9324,null))[_0x21cc('0x3f')](handleError(_0x1c9324,null));};exports['create']=function(_0x4532a8,_0x261960){return db[_0x21cc('0x3c')][_0x21cc('0x46')](_0x4532a8[_0x21cc('0x47')],{})[_0x21cc('0x23')](function(_0x106d25){var _0x156c07=_0x4532a8['user'][_0x21cc('0x25')]({'plain':!![]});if(!_0x156c07)throw new Error(_0x21cc('0x48'));if(_0x156c07['role']===_0x21cc('0x49')){var _0x2d483e=_0x106d25[_0x21cc('0x25')]({'plain':!![]});var _0x19ea24=_0x21cc('0x4a');return db[_0x21cc('0x4b')][_0x21cc('0x45')]({'where':{'name':_0x19ea24,'userProfileId':_0x156c07[_0x21cc('0x4c')]},'raw':!![]})[_0x21cc('0x23')](function(_0x3859a3){if(_0x3859a3&&_0x3859a3['autoAssociation']===0x0){return db[_0x21cc('0x26')][_0x21cc('0x46')]({'name':_0x2d483e[_0x21cc('0x2a')],'resourceId':_0x2d483e['id'],'type':_0x3859a3['name'],'sectionId':_0x3859a3['id']},{})['then'](function(){return _0x106d25;});}else{return _0x106d25;}})[_0x21cc('0x3f')](function(_0x23574c){logger[_0x21cc('0x28')](_0x21cc('0x4d'),_0x23574c);throw _0x23574c;});}return _0x106d25;})[_0x21cc('0x23')](respondWithResult(_0x261960,0xc9))[_0x21cc('0x3f')](handleError(_0x261960,null));};exports[_0x21cc('0x22')]=function(_0x35b9c0,_0x36da5f){if(_0x35b9c0[_0x21cc('0x47')]['id']){delete _0x35b9c0[_0x21cc('0x47')]['id'];}return db[_0x21cc('0x3c')][_0x21cc('0x45')]({'where':{'id':_0x35b9c0[_0x21cc('0x41')]['id']}})[_0x21cc('0x23')](handleEntityNotFound(_0x36da5f,null))[_0x21cc('0x23')](saveUpdates(_0x35b9c0[_0x21cc('0x47')],null))[_0x21cc('0x23')](respondWithResult(_0x36da5f,null))[_0x21cc('0x3f')](handleError(_0x36da5f,null));};exports[_0x21cc('0x24')]=function(_0x1f9f1a,_0x3d4746){return db[_0x21cc('0x3c')]['find']({'where':{'id':_0x1f9f1a[_0x21cc('0x41')]['id']}})[_0x21cc('0x23')](handleEntityNotFound(_0x3d4746,null))['then'](removeEntity(_0x3d4746,null))['catch'](handleError(_0x3d4746,null));};exports[_0x21cc('0x2b')]=function(_0xf65a7,_0x385b71){return db[_0x21cc('0x3c')][_0x21cc('0x2b')]()[_0x21cc('0x23')](respondWithResult(_0x385b71,null))[_0x21cc('0x3f')](handleError(_0x385b71,null));};exports[_0x21cc('0x4e')]=function(_0x567e34,_0x5765c0,_0x430ce4){return db[_0x21cc('0x4f')]['find']({'where':{'id':_0x567e34[_0x21cc('0x41')]['id']}})[_0x21cc('0x23')](handleEntityNotFound(_0x5765c0,null))[_0x21cc('0x23')](function(_0x20143b){if(_0x20143b){return _0x20143b[_0x21cc('0x4e')](_0x567e34[_0x21cc('0x47')]['ids'],_[_0x21cc('0x50')](_0x567e34['body'],[_0x21cc('0x51'),'id'])||{});}})[_0x21cc('0x23')](respondWithResult(_0x5765c0,null))['catch'](handleError(_0x5765c0,null));};exports['getContacts']=function(_0x50f951,_0x4b511f,_0x57d519){var _0x34b38a={};var _0x56d597={};var _0x518519;var _0x164510;return db[_0x21cc('0x3c')]['findOne']({'where':{'id':_0x50f951[_0x21cc('0x41')]['id']}})[_0x21cc('0x23')](handleEntityNotFound(_0x4b511f,null))['then'](function(_0x3ea9c6){if(_0x3ea9c6){_0x518519=_0x3ea9c6;_0x56d597[_0x21cc('0x2c')]=_[_0x21cc('0x2d')](db['CmContact']['rawAttributes']);_0x56d597['query']=_[_0x21cc('0x2d')](_0x50f951[_0x21cc('0x2e')]);_0x56d597[_0x21cc('0x2f')]=_[_0x21cc('0x30')](_0x56d597[_0x21cc('0x2c')],_0x56d597[_0x21cc('0x2e')]);_0x34b38a[_0x21cc('0x32')]=_[_0x21cc('0x30')](_0x56d597[_0x21cc('0x2c')],qs[_0x21cc('0x31')](_0x50f951['query']['fields']));_0x34b38a[_0x21cc('0x32')]=_0x34b38a[_0x21cc('0x32')][_0x21cc('0x43')]?_0x34b38a['attributes']:_0x56d597[_0x21cc('0x2c')];_0x34b38a[_0x21cc('0x35')]=qs[_0x21cc('0x36')](_0x50f951[_0x21cc('0x2e')][_0x21cc('0x36')]);_0x34b38a[_0x21cc('0x37')]=qs[_0x21cc('0x2f')](_['pick'](_0x50f951[_0x21cc('0x2e')],_0x56d597[_0x21cc('0x2f')]));if(_0x50f951['query'][_0x21cc('0x39')]){_0x34b38a[_0x21cc('0x37')]=_[_0x21cc('0x3a')](_0x34b38a['where'],{'$or':_['map'](_0x34b38a['attributes'],function(_0x1f8216){var _0x104727={};_0x104727[_0x1f8216]={'$like':'%'+_0x50f951[_0x21cc('0x2e')]['filter']+'%'};return _0x104727;})});}_0x34b38a=_[_0x21cc('0x3a')]({},_0x34b38a,_0x50f951[_0x21cc('0x3b')]);return _0x518519[_0x21cc('0x52')](_0x34b38a);}})[_0x21cc('0x23')](function(_0x2d7387){if(_0x2d7387){_0x164510=_0x2d7387['length'];if(!_0x50f951[_0x21cc('0x2e')]['hasOwnProperty'](_0x21cc('0x34'))){_0x34b38a[_0x21cc('0x1c')]=qs['limit'](_0x50f951['query'][_0x21cc('0x1c')]);_0x34b38a[_0x21cc('0x1a')]=qs['offset'](_0x50f951['query'][_0x21cc('0x1a')]);}return _0x518519['getContacts'](_0x34b38a);}})[_0x21cc('0x23')](function(_0x392b39){if(_0x392b39){return _0x392b39?{'count':_0x164510,'rows':_0x392b39}:null;}})[_0x21cc('0x23')](respondWithResult(_0x4b511f,null))[_0x21cc('0x3f')](handleError(_0x4b511f,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 0068abc..c393b0b 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 _0x29bc=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash'];(function(_0x5dbba4,_0x28693d){var _0x1cf011=function(_0x1a4eaf){while(--_0x1a4eaf){_0x5dbba4['push'](_0x5dbba4['shift']());}};_0x1cf011(++_0x28693d);}(_0x29bc,0x1cd));var _0xc29b=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x29bc[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0xc29b('0x0'));var util=require(_0xc29b('0x1'));var logger=require(_0xc29b('0x2'))(_0xc29b('0x3'));var moment=require(_0xc29b('0x4'));var BPromise=require(_0xc29b('0x5'));var rp=require(_0xc29b('0x6'));var fs=require('fs');var path=require(_0xc29b('0x7'));var rimraf=require(_0xc29b('0x8'));var config=require(_0xc29b('0x9'));var attributes=require(_0xc29b('0xa'));module['exports']=function(_0x249fef,_0x34feb2){return _0x249fef[_0xc29b('0xb')](_0xc29b('0xc'),attributes,{'tableName':_0xc29b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2f8=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash'];(function(_0x9ba548,_0x3e7164){var _0x35b867=function(_0x12f483){while(--_0x12f483){_0x9ba548['push'](_0x9ba548['shift']());}};_0x35b867(++_0x3e7164);}(_0xd2f8,0x15d));var _0x8d2f=function(_0x1263cc,_0x34b0a6){_0x1263cc=_0x1263cc-0x0;var _0x4132a0=_0xd2f8[_0x1263cc];return _0x4132a0;};'use strict';var _=require(_0x8d2f('0x0'));var util=require(_0x8d2f('0x1'));var logger=require(_0x8d2f('0x2'))(_0x8d2f('0x3'));var moment=require(_0x8d2f('0x4'));var BPromise=require('bluebird');var rp=require(_0x8d2f('0x5'));var fs=require('fs');var path=require(_0x8d2f('0x6'));var rimraf=require(_0x8d2f('0x7'));var config=require(_0x8d2f('0x8'));var attributes=require(_0x8d2f('0x9'));module[_0x8d2f('0xa')]=function(_0x465f48,_0x48e3ca){return _0x465f48[_0x8d2f('0xb')](_0x8d2f('0xc'),attributes,{'tableName':_0x8d2f('0xd'),'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 1109cd1..d436a49 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 _0x1a6f=['CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xe0510d,_0x32c331){var _0x55d363=function(_0x29bb3f){while(--_0x29bb3f){_0xe0510d['push'](_0xe0510d['shift']());}};_0x55d363(++_0x32c331);}(_0x1a6f,0x7a));var _0xf1a6=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x1a6f[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0xf1a6('0x0'));var util=require(_0xf1a6('0x1'));var moment=require('moment');var BPromise=require(_0xf1a6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf1a6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf1a6('0x4'))(_0xf1a6('0x5'));var config=require(_0xf1a6('0x6'));var jayson=require(_0xf1a6('0x7'));var client=jayson[_0xf1a6('0x8')][_0xf1a6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x58f626,_0x13fc4a,_0x5b5ccb){return new BPromise(function(_0x294fa1,_0xcceeac){return client[_0xf1a6('0xa')](_0x58f626,_0x5b5ccb)[_0xf1a6('0xb')](function(_0x1952bd){logger[_0xf1a6('0xc')](_0xf1a6('0xd'),_0x13fc4a,_0xf1a6('0xe'));logger[_0xf1a6('0xf')](_0xf1a6('0x10'),_0x13fc4a,_0xf1a6('0xe'),JSON[_0xf1a6('0x11')](_0x1952bd));if(_0x1952bd[_0xf1a6('0x12')]){if(_0x1952bd['error'][_0xf1a6('0x13')]===0x1f4){logger[_0xf1a6('0x12')](_0xf1a6('0xd'),_0x13fc4a,_0x1952bd[_0xf1a6('0x12')]['message']);return _0xcceeac(_0x1952bd[_0xf1a6('0x12')][_0xf1a6('0x14')]);}logger[_0xf1a6('0x12')](_0xf1a6('0xd'),_0x13fc4a,_0x1952bd[_0xf1a6('0x12')]['message']);return _0x294fa1(_0x1952bd[_0xf1a6('0x12')]['message']);}else{logger[_0xf1a6('0xc')]('CmCompany,\x20%s,\x20%s',_0x13fc4a,_0xf1a6('0xe'));_0x294fa1(_0x1952bd[_0xf1a6('0x15')][_0xf1a6('0x14')]);}})[_0xf1a6('0x16')](function(_0x1f15bf){logger['error'](_0xf1a6('0xd'),_0x13fc4a,_0x1f15bf);_0xcceeac(_0x1f15bf);});});} \ No newline at end of file +var _0x869c=['http','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client'];(function(_0x29a30d,_0x5d0800){var _0x102801=function(_0x13ea89){while(--_0x13ea89){_0x29a30d['push'](_0x29a30d['shift']());}};_0x102801(++_0x5d0800);}(_0x869c,0x198));var _0xc869=function(_0x12f2c2,_0x9e8677){_0x12f2c2=_0x12f2c2-0x0;var _0x3ea4d7=_0x869c[_0x12f2c2];return _0x3ea4d7;};'use strict';var _=require(_0xc869('0x0'));var util=require(_0xc869('0x1'));var moment=require(_0xc869('0x2'));var BPromise=require(_0xc869('0x3'));var rs=require(_0xc869('0x4'));var fs=require('fs');var Redis=require(_0xc869('0x5'));var db=require(_0xc869('0x6'))['db'];var utils=require(_0xc869('0x7'));var logger=require(_0xc869('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc869('0x9')][_0xc869('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d4c1c,_0x2ff0fc,_0x317349){return new BPromise(function(_0x3314df,_0x32225f){return client[_0xc869('0xb')](_0x4d4c1c,_0x317349)['then'](function(_0xb9a2b7){logger[_0xc869('0xc')](_0xc869('0xd'),_0x2ff0fc,_0xc869('0xe'));logger[_0xc869('0xf')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x2ff0fc,_0xc869('0xe'),JSON[_0xc869('0x10')](_0xb9a2b7));if(_0xb9a2b7[_0xc869('0x11')]){if(_0xb9a2b7['error']['code']===0x1f4){logger[_0xc869('0x11')](_0xc869('0xd'),_0x2ff0fc,_0xb9a2b7['error'][_0xc869('0x12')]);return _0x32225f(_0xb9a2b7[_0xc869('0x11')][_0xc869('0x12')]);}logger['error']('CmCompany,\x20%s,\x20%s',_0x2ff0fc,_0xb9a2b7[_0xc869('0x11')][_0xc869('0x12')]);return _0x3314df(_0xb9a2b7[_0xc869('0x11')]['message']);}else{logger['info'](_0xc869('0xd'),_0x2ff0fc,_0xc869('0xe'));_0x3314df(_0xb9a2b7['result'][_0xc869('0x12')]);}})['catch'](function(_0x29004a){logger[_0xc869('0x11')]('CmCompany,\x20%s,\x20%s',_0x2ff0fc,_0x29004a);_0x32225f(_0x29004a);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 2d3fdf0..38c3c87 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 _0x2ca0=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','isAuthenticated','describe','/:id','show','/:id/contacts','post','create','addContacts','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3c87c9,_0x302140){var _0x345b85=function(_0x153837){while(--_0x153837){_0x3c87c9['push'](_0x3c87c9['shift']());}};_0x345b85(++_0x302140);}(_0x2ca0,0x154));var _0x02ca=function(_0x24cf7f,_0x31a459){_0x24cf7f=_0x24cf7f-0x0;var _0x522347=_0x2ca0[_0x24cf7f];return _0x522347;};'use strict';var multer=require(_0x02ca('0x0'));var util=require(_0x02ca('0x1'));var path=require(_0x02ca('0x2'));var timeout=require(_0x02ca('0x3'));var express=require(_0x02ca('0x4'));var router=express['Router']();var fs_extra=require(_0x02ca('0x5'));var auth=require(_0x02ca('0x6'));var interaction=require(_0x02ca('0x7'));var config=require(_0x02ca('0x8'));var controller=require(_0x02ca('0x9'));router[_0x02ca('0xa')]('/',auth['isAuthenticated'](),controller[_0x02ca('0xb')]);router[_0x02ca('0xa')]('/describe',auth[_0x02ca('0xc')](),controller[_0x02ca('0xd')]);router['get'](_0x02ca('0xe'),auth['isAuthenticated'](),controller[_0x02ca('0xf')]);router[_0x02ca('0xa')](_0x02ca('0x10'),auth[_0x02ca('0xc')](),controller['getContacts']);router[_0x02ca('0x11')]('/',auth[_0x02ca('0xc')](),controller[_0x02ca('0x12')]);router[_0x02ca('0x11')](_0x02ca('0x10'),auth[_0x02ca('0xc')](),controller[_0x02ca('0x13')]);router['put']('/:id',auth[_0x02ca('0xc')](),controller['update']);router[_0x02ca('0x14')](_0x02ca('0xe'),auth['isAuthenticated'](),controller[_0x02ca('0x15')]);module[_0x02ca('0x16')]=router; \ No newline at end of file +var _0x9eab=['/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe'];(function(_0x8d0c91,_0x26ba76){var _0x2e48c8=function(_0x5ded95){while(--_0x5ded95){_0x8d0c91['push'](_0x8d0c91['shift']());}};_0x2e48c8(++_0x26ba76);}(_0x9eab,0x185));var _0xb9ea=function(_0x7ae6c6,_0x29301f){_0x7ae6c6=_0x7ae6c6-0x0;var _0x523c8d=_0x9eab[_0x7ae6c6];return _0x523c8d;};'use strict';var multer=require('multer');var util=require(_0xb9ea('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb9ea('0x1'));var router=express[_0xb9ea('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xb9ea('0x3'));var interaction=require(_0xb9ea('0x4'));var config=require(_0xb9ea('0x5'));var controller=require('./cmCompany.controller');router[_0xb9ea('0x6')]('/',auth[_0xb9ea('0x7')](),controller[_0xb9ea('0x8')]);router['get']('/describe',auth[_0xb9ea('0x7')](),controller[_0xb9ea('0x9')]);router[_0xb9ea('0x6')](_0xb9ea('0xa'),auth['isAuthenticated'](),controller[_0xb9ea('0xb')]);router[_0xb9ea('0x6')](_0xb9ea('0xc'),auth[_0xb9ea('0x7')](),controller[_0xb9ea('0xd')]);router[_0xb9ea('0xe')]('/',auth[_0xb9ea('0x7')](),controller[_0xb9ea('0xf')]);router['post'](_0xb9ea('0xc'),auth[_0xb9ea('0x7')](),controller[_0xb9ea('0x10')]);router[_0xb9ea('0x11')]('/:id',auth[_0xb9ea('0x7')](),controller[_0xb9ea('0x12')]);router[_0xb9ea('0x13')](_0xb9ea('0xa'),auth[_0xb9ea('0x7')](),controller[_0xb9ea('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index a9ad880..bb67ab4 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 _0xdae0=['UNSIGNED','lodash','STRING','TEXT','INTEGER'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xdae0,0x169));var _0x0dae=function(_0x386597,_0x1aa639){_0x386597=_0x386597-0x0;var _0x1397f2=_0xdae0[_0x386597];return _0x1397f2;};'use strict';var _=require(_0x0dae('0x0'));var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize[_0x0dae('0x1')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x0dae('0x1')]},'city':{'type':Sequelize[_0x0dae('0x1')]},'country':{'type':Sequelize[_0x0dae('0x1')]},'dateOfBirth':{'type':Sequelize[_0x0dae('0x1')]},'description':{'type':Sequelize[_0x0dae('0x2')]},'phone':{'type':Sequelize[_0x0dae('0x1')]},'mobile':{'type':Sequelize[_0x0dae('0x1')]},'fax':{'type':Sequelize[_0x0dae('0x1')]},'email':{'type':Sequelize[_0x0dae('0x1')]},'url':{'type':Sequelize[_0x0dae('0x1')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x0dae('0x1')]},'teams':{'type':Sequelize[_0x0dae('0x1')]},'viber':{'type':Sequelize[_0x0dae('0x1')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x0dae('0x1')]},'telegram':{'type':Sequelize[_0x0dae('0x1')]},'UserId':{'type':Sequelize[_0x0dae('0x3')]},'priority':{'type':Sequelize[_0x0dae('0x3')](0x2)[_0x0dae('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xab3f=['UNSIGNED','DATE','NOW','lodash','sequelize','STRING','TEXT','INTEGER'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xab3f,0x1a3));var _0xfab3=function(_0x1781de,_0x5c4b38){_0x1781de=_0x1781de-0x0;var _0x48d7fc=_0xab3f[_0x1781de];return _0x48d7fc;};'use strict';var _=require(_0xfab3('0x0'));var Sequelize=require(_0xfab3('0x1'));module['exports']={'firstName':{'type':Sequelize[_0xfab3('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xfab3('0x2')]},'street':{'type':Sequelize[_0xfab3('0x2')]},'postalCode':{'type':Sequelize[_0xfab3('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xfab3('0x2')]},'dateOfBirth':{'type':Sequelize[_0xfab3('0x2')]},'description':{'type':Sequelize[_0xfab3('0x3')]},'phone':{'type':Sequelize[_0xfab3('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xfab3('0x2')]},'email':{'type':Sequelize[_0xfab3('0x2')]},'url':{'type':Sequelize[_0xfab3('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xfab3('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xfab3('0x2')]},'viber':{'type':Sequelize[_0xfab3('0x2')]},'line':{'type':Sequelize[_0xfab3('0x2')]},'wechat':{'type':Sequelize[_0xfab3('0x2')]},'telegram':{'type':Sequelize[_0xfab3('0x2')]},'UserId':{'type':Sequelize[_0xfab3('0x4')]},'priority':{'type':Sequelize[_0xfab3('0x4')](0x2)[_0xfab3('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xfab3('0x6')],'defaultValue':Sequelize[_0xfab3('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 5414101..42bdb16 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 _0xbf70=['values','body','get','mergeWith','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','bulkCreate','each','duplicates','$or','findOrCreate','spread','show','isNil','$and','omit','format','cf_%d','pickBy','table','cm_contacts','setFields','toParam','phone','getTags','rawAttributes','options','setTags','ids','getHoppers','ContactId','includeAll','include','getHopperHistories','CmHopperHistory','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Incorrect\x20binding\x20parameters\x20passed!','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','chmodSync','0777','child_process','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','import','binding','No\x20phone\x20column\x20specified','firstName','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','mail','chat','openchannel','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','voice','uniqueid','destination','callerid','starttime','endtime','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','Website','Account','closed','disposition','secondDisposition','thirdDisposition','key','customerIp','customerPort','osName','ratingMessage','ratingType','referer','subject','substatus','externalUrl','Interaction','Owner','flatten','reverse','slice','moment','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','limit','count','Content-Range','destroy','end','sendStatus','error','stack','name','send','index','length','keys','startsWith','cf_','push','CmCustomField','findOne','trimStart','then','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','tools_tags','left_join','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','value','split','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','dateOfBirth','fieldType','datetime','castTo','DATE','text','start','filter','Contact','isEmpty','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','forEach','replace','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','Sequelize','QueryTypes','clone','DESC','having','t.id\x20IN\x20?','resolve','role','agent','user','getLists','c.ListId\x20IS\x20NULL','ListId','sequelize','toString','keyBy','merge','CmContact','c.firstName','c.lastName','c.phone','c.fax','c.email','c.ListId','c.createdAt','c.CompanyId','Tags','TagIds','rows','catch','params','describe','tags','columnName','displayName','analytics','findAll','custom'];(function(_0x2f2249,_0x1766a2){var _0x32e592=function(_0x345987){while(--_0x345987){_0x2f2249['push'](_0x2f2249['shift']());}};_0x32e592(++_0x1766a2);}(_0xbf70,0x1b0));var _0x0bf7=function(_0x394f3d,_0x23ca6e){_0x394f3d=_0x394f3d-0x0;var _0x559320=_0xbf70[_0x394f3d];return _0x559320;};'use strict';var moment=require(_0x0bf7('0x0'));var BPromise=require(_0x0bf7('0x1'));var util=require(_0x0bf7('0x2'));var path=require(_0x0bf7('0x3'));var fs=require('fs');var _=require(_0x0bf7('0x4'));var squel=require(_0x0bf7('0x5'));var Papa=require(_0x0bf7('0x6'));var Redis=require(_0x0bf7('0x7'));var qs=require(_0x0bf7('0x8'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x0bf7('0x9'))(_0x0bf7('0xa'));var config=require(_0x0bf7('0xb'));var db=require(_0x0bf7('0xc'))['db'];config['redis']=_[_0x0bf7('0xd')](config[_0x0bf7('0xe')],{'host':_0x0bf7('0xf'),'port':0x18eb});var socket=require(_0x0bf7('0x10'))(new Redis(config[_0x0bf7('0xe')]));require(_0x0bf7('0x11'))[_0x0bf7('0x12')](socket);function respondWithResult(_0x32d14c,_0x861de5){_0x861de5=_0x861de5||0xc8;return function(_0xdf5daf){if(_0xdf5daf){return _0x32d14c[_0x0bf7('0x13')](_0x861de5)[_0x0bf7('0x14')](_0xdf5daf);}};}function respondWithFilteredResult(_0x55d474,_0xce0bbc){return function(_0x264e12){if(_0x264e12){var _0x20e1b3=typeof _0xce0bbc[_0x0bf7('0x15')]===_0x0bf7('0x16')&&typeof _0xce0bbc[_0x0bf7('0x17')]===_0x0bf7('0x16');var _0x1ef562=_0x264e12['count'];var _0x598e48=_0x20e1b3?0x0:_0xce0bbc[_0x0bf7('0x15')];var _0x4ba753=_0x20e1b3?_0x264e12[_0x0bf7('0x18')]:_0xce0bbc[_0x0bf7('0x15')]+_0xce0bbc[_0x0bf7('0x17')];var _0x410ffb;if(_0x4ba753>=_0x1ef562){_0x4ba753=_0x1ef562;_0x410ffb=0xc8;}else{_0x410ffb=0xce;}_0x55d474[_0x0bf7('0x13')](_0x410ffb);return _0x55d474['set'](_0x0bf7('0x19'),_0x598e48+'-'+_0x4ba753+'/'+_0x1ef562)[_0x0bf7('0x14')](_0x264e12);}return null;};}function saveUpdates(_0xb0e54c){return function(_0x8f3b52){if(_0x8f3b52){return _0x8f3b52['update'](_0xb0e54c)['then'](function(_0x1f00ba){return _0x1f00ba;});}return null;};}function removeEntity(_0x4e3c0b){return function(_0x39d88c){if(_0x39d88c){return _0x39d88c[_0x0bf7('0x1a')]()['then'](function(){_0x4e3c0b[_0x0bf7('0x13')](0xcc)[_0x0bf7('0x1b')]();});}};}function handleEntityNotFound(_0xada82f){return function(_0x383bd2){if(!_0x383bd2){_0xada82f[_0x0bf7('0x1c')](0x194);}return _0x383bd2;};}function handleError(_0x161ac9,_0x22038e){_0x22038e=_0x22038e||0x1f4;return function(_0x1d1f06){logger[_0x0bf7('0x1d')](_0x1d1f06[_0x0bf7('0x1e')]);if(_0x1d1f06[_0x0bf7('0x1f')]){delete _0x1d1f06['name'];}_0x161ac9[_0x0bf7('0x13')](_0x22038e)[_0x0bf7('0x20')](_0x1d1f06);};}exports[_0x0bf7('0x21')]=function(_0x24955b,_0x2146cd){var _0x3b0dd7={},_0x13003d={},_0x26017b={'count':0x0,'rows':[]};return db['CmContact']['describe']()['then'](function(_0x4833ba){var _0x24fa11=[];for(var _0x2d9d93=0x0;_0x2d9d930x1){_0x36c317['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0bf7('0x61')](_0x484fd0),null);}else{if(qs[_0x0bf7('0x62')](_0x484fd0)){_0x36c317['or'](_0x0bf7('0x63'),_0x484fd0+'%');_0x36c317['or'](_0x0bf7('0x64'),_0x484fd0+'%');_0x36c317['or'](_0x0bf7('0x65'),_0x484fd0+'%');_0x36c317['or'](_0x0bf7('0x66'),_0x484fd0+'%');}else if(qs[_0x0bf7('0x67')](_0x484fd0)){_0x36c317['or'](_0x0bf7('0x68'),_0x484fd0+'%');}else{_0x36c317['or'](_0x0bf7('0x69'),'%'+_0x484fd0+'%');_0x36c317['or'](_0x0bf7('0x6a'),'%'+_0x484fd0+'%');_0x36c317['or'](_0x0bf7('0x68'),'%'+_0x484fd0+'%');}}}}_0xb15534['where'](_0x36c317);_0xb15534['group'](_0x0bf7('0x6b'));var _0x48bde4={'type':db[_0x0bf7('0x6c')][_0x0bf7('0x6d')]['SELECT'],'raw':!![]};var _0x5447a6=_0xb15534[_0x0bf7('0x6e')]()['field'](_0x0bf7('0x6b'));if(_0x3b0dd7['order']){_0x3b0dd7[_0x0bf7('0x34')][_0x0bf7('0x5f')](function(_0x452b5a){_0xb15534[_0x0bf7('0x34')]('c.'+_0x452b5a[0x0],_0x452b5a[0x1]===_0x0bf7('0x6f')?![]:!![]);});}if(!_[_0x0bf7('0x59')](_0x565b94)){_0xb15534[_0x0bf7('0x70')](_0x4f5d5c);_0x5447a6[_0x0bf7('0x40')](_0x0bf7('0x71'),_0x565b94);}BPromise[_0x0bf7('0x72')]()[_0x0bf7('0x2a')](function(){if(!_0x453d96)return;if(_0x24955b['user'][_0x0bf7('0x73')]!==_0x0bf7('0x74'))return;if(!_['some'](_0x453d96['conditions'],[_0x0bf7('0x38'),_0x0bf7('0x4e')])){return _0x24955b[_0x0bf7('0x75')][_0x0bf7('0x76')]({'attributes':['id'],'raw':!![]})[_0x0bf7('0x2a')](function(_0x51deb3){if(_[_0x0bf7('0x59')](_0x51deb3)){_0x5447a6['where'](_0x0bf7('0x77'));_0xb15534[_0x0bf7('0x40')](_0x0bf7('0x77'));}else{_0x5447a6[_0x0bf7('0x40')]('c.ListId\x20IN\x20?',_[_0x0bf7('0x4b')](_0x51deb3,'id'));_0xb15534[_0x0bf7('0x40')](_0x0bf7('0x5a'),_[_0x0bf7('0x4b')](_0x51deb3,'id'));}});}})[_0x0bf7('0x2a')](function(){if(_0x24955b[_0x0bf7('0x75')][_0x0bf7('0x73')]==='agent'&&!_0x453d96&&!_0x24955b[_0x0bf7('0x2d')][_0x0bf7('0x78')])return[];return db[_0x0bf7('0x79')][_0x0bf7('0x2d')](_0x5447a6[_0x0bf7('0x7a')](),_0x48bde4);})['then'](function(_0x9c5456){_0x26017b['count']=_0x9c5456[_0x0bf7('0x22')];if(_0x26017b[_0x0bf7('0x18')]===0x0)return[];return db[_0x0bf7('0x79')]['query'](_0x414498[_0x0bf7('0x7a')](),_0x48bde4)['then'](function(_0x58ebd0){_0x3d3080=_[_0x0bf7('0x7b')](_0x58ebd0,'id');_0x48bde4=_[_0x0bf7('0x7c')](_0x48bde4,{'model':db[_0x0bf7('0x7d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x24955b['query'][_0x0bf7('0x31')]){_0x3b0dd7[_0x0bf7('0x30')][_0x0bf7('0x5f')](function(_0xc11581){_0xb15534['field']('c.'+_0xc11581);});}else{_0xb15534['field']('c.id');_0xb15534[_0x0bf7('0x38')](_0x0bf7('0x7e'));_0xb15534['field'](_0x0bf7('0x7f'));_0xb15534[_0x0bf7('0x38')](_0x0bf7('0x80'));_0xb15534['field']('c.mobile');_0xb15534[_0x0bf7('0x38')](_0x0bf7('0x81'));_0xb15534['field'](_0x0bf7('0x82'));_0xb15534[_0x0bf7('0x38')](_0x0bf7('0x83'));_0xb15534[_0x0bf7('0x38')](_0x0bf7('0x84'));_0xb15534[_0x0bf7('0x38')]('c.deletedAt');_0xb15534[_0x0bf7('0x38')](_0x0bf7('0x85'));_0xb15534[_0x0bf7('0x38')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x3b0dd7['limit'])_0xb15534['limit'](_0x3b0dd7[_0x0bf7('0x17')]);if(_0x3b0dd7[_0x0bf7('0x15')])_0xb15534['offset'](_0x3b0dd7[_0x0bf7('0x15')]);return db[_0x0bf7('0x79')][_0x0bf7('0x2d')](_0xb15534[_0x0bf7('0x7a')](),_0x48bde4);});})[_0x0bf7('0x2a')](function(_0x2a594b){_0x2a594b[_0x0bf7('0x5f')](function(_0x311f4e){if(_0x311f4e['TagIds']){_0x311f4e[_0x0bf7('0x86')]=[];_0x311f4e[_0x0bf7('0x87')][_0x0bf7('0x4a')](',')[_0x0bf7('0x5f')](function(_0x4c1894){_0x311f4e['Tags']['push'](_0x3d3080[_0x4c1894]);});}delete _0x311f4e[_0x0bf7('0x87')];});_0x26017b[_0x0bf7('0x88')]=_0x2a594b;return _0x26017b;})['then'](respondWithFilteredResult(_0x2146cd,_0x3b0dd7));})[_0x0bf7('0x89')](handleError(_0x2146cd,null));};exports[_0x0bf7('0x1a')]=function(_0x41465c,_0x3e45eb){return db[_0x0bf7('0x7d')][_0x0bf7('0x47')]({'where':{'id':_0x41465c[_0x0bf7('0x8a')]['id']}})[_0x0bf7('0x2a')](handleEntityNotFound(_0x3e45eb,null))[_0x0bf7('0x2a')](removeEntity(_0x3e45eb,null))[_0x0bf7('0x89')](handleError(_0x3e45eb,null));};exports[_0x0bf7('0x8b')]=function(_0x101d79,_0x27525d){return db['CmContact'][_0x0bf7('0x8b')]()[_0x0bf7('0x2a')](function(_0x5ed6cd){delete _0x5ed6cd[_0x0bf7('0x8c')];for(var _0x590811=0x0;_0x590811=_0x533e51){_0x1e855f=_0x533e51;_0x49c4c3=0xc8;}else{_0x49c4c3=0xce;}_0x1b1a8c['status'](_0x49c4c3);return _0x1b1a8c['set'](_0x8d6a('0x18'),_0x21ff4f+'-'+_0x1e855f+'/'+_0x533e51)['json'](_0x527978);}return null;};}function saveUpdates(_0x13f143){return function(_0x1f1312){if(_0x1f1312){return _0x1f1312[_0x8d6a('0x19')](_0x13f143)[_0x8d6a('0x1a')](function(_0x1e9ad6){return _0x1e9ad6;});}return null;};}function removeEntity(_0x2f92ab){return function(_0xd637e2){if(_0xd637e2){return _0xd637e2[_0x8d6a('0x1b')]()[_0x8d6a('0x1a')](function(){_0x2f92ab[_0x8d6a('0x12')](0xcc)[_0x8d6a('0x1c')]();});}};}function handleEntityNotFound(_0x3db921){return function(_0x42b471){if(!_0x42b471){_0x3db921[_0x8d6a('0x1d')](0x194);}return _0x42b471;};}function handleError(_0x488f37,_0x59c4f7){_0x59c4f7=_0x59c4f7||0x1f4;return function(_0x23411e){logger[_0x8d6a('0x1e')](_0x23411e[_0x8d6a('0x1f')]);if(_0x23411e[_0x8d6a('0x20')]){delete _0x23411e[_0x8d6a('0x20')];}_0x488f37[_0x8d6a('0x12')](_0x59c4f7)[_0x8d6a('0x21')](_0x23411e);};}exports[_0x8d6a('0x22')]=function(_0x4bfe69,_0xf5acf){var _0x2ff890={},_0x4a506a={},_0x20e546={'count':0x0,'rows':[]};return db[_0x8d6a('0x23')]['describe']()[_0x8d6a('0x1a')](function(_0x28da73){var _0x414196=[];for(var _0x526017=0x0;_0x5260170x1){_0x2bb84a['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8d6a('0x5f')](_0x54465e),null);}else{if(qs['isNumeric'](_0x54465e)){_0x2bb84a['or'](_0x8d6a('0x60'),_0x54465e+'%');_0x2bb84a['or']('c.phone\x20LIKE\x20?',_0x54465e+'%');_0x2bb84a['or'](_0x8d6a('0x61'),_0x54465e+'%');_0x2bb84a['or'](_0x8d6a('0x62'),_0x54465e+'%');}else if(qs[_0x8d6a('0x63')](_0x54465e)){_0x2bb84a['or'](_0x8d6a('0x64'),_0x54465e+'%');}else{_0x2bb84a['or']('c.firstName\x20LIKE\x20?','%'+_0x54465e+'%');_0x2bb84a['or'](_0x8d6a('0x65'),'%'+_0x54465e+'%');_0x2bb84a['or'](_0x8d6a('0x64'),'%'+_0x54465e+'%');}}}}_0x1cb850[_0x8d6a('0x36')](_0x2bb84a);_0x1cb850['group']('c.id');var _0x461244={'type':db[_0x8d6a('0x66')][_0x8d6a('0x67')][_0x8d6a('0x68')],'raw':!![]};var _0x4f10c5=_0x1cb850[_0x8d6a('0x69')]()[_0x8d6a('0x37')]('c.id');if(_0x2ff890[_0x8d6a('0x34')]){_0x2ff890[_0x8d6a('0x34')][_0x8d6a('0x57')](function(_0x1c8864){_0x1cb850['order']('c.'+_0x1c8864[0x0],_0x1c8864[0x1]===_0x8d6a('0x6a')?![]:!![]);});}if(!_['isEmpty'](_0x392f1f)){_0x1cb850[_0x8d6a('0x6b')](_0x4c38dc);_0x4f10c5[_0x8d6a('0x36')](_0x8d6a('0x6c'),_0x392f1f);}BPromise[_0x8d6a('0x6d')]()[_0x8d6a('0x1a')](function(){if(!_0x60ad4a)return;if(_0x4bfe69[_0x8d6a('0x6e')][_0x8d6a('0x6f')]!==_0x8d6a('0x70'))return;if(!_['some'](_0x60ad4a[_0x8d6a('0x43')],[_0x8d6a('0x37'),'User'])){return _0x4bfe69[_0x8d6a('0x6e')]['getLists']({'attributes':['id'],'raw':!![]})['then'](function(_0x397e1e){if(_[_0x8d6a('0x56')](_0x397e1e)){_0x4f10c5['where']('c.ListId\x20IS\x20NULL');_0x1cb850[_0x8d6a('0x36')](_0x8d6a('0x71'));}else{_0x4f10c5['where'](_0x8d6a('0x72'),_[_0x8d6a('0x73')](_0x397e1e,'id'));_0x1cb850['where']('c.ListId\x20IN\x20?',_[_0x8d6a('0x73')](_0x397e1e,'id'));}});}})['then'](function(){if(_0x4bfe69[_0x8d6a('0x6e')]['role']===_0x8d6a('0x70')&&!_0x60ad4a&&!_0x4bfe69[_0x8d6a('0x2f')][_0x8d6a('0x58')])return[];return db[_0x8d6a('0x74')]['query'](_0x4f10c5[_0x8d6a('0x75')](),_0x461244);})[_0x8d6a('0x1a')](function(_0x368215){_0x20e546[_0x8d6a('0x16')]=_0x368215[_0x8d6a('0x25')];if(_0x20e546[_0x8d6a('0x16')]===0x0)return[];return db['sequelize'][_0x8d6a('0x2f')](_0x5cb275[_0x8d6a('0x75')](),_0x461244)[_0x8d6a('0x1a')](function(_0x3e5239){_0x3c526e=_['keyBy'](_0x3e5239,'id');_0x461244=_[_0x8d6a('0x76')](_0x461244,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4bfe69[_0x8d6a('0x2f')][_0x8d6a('0x30')]){_0x2ff890[_0x8d6a('0x31')][_0x8d6a('0x57')](function(_0xafb87e){_0x1cb850['field']('c.'+_0xafb87e);});}else{_0x1cb850[_0x8d6a('0x37')]('c.id');_0x1cb850['field'](_0x8d6a('0x77'));_0x1cb850[_0x8d6a('0x37')]('c.lastName');_0x1cb850[_0x8d6a('0x37')](_0x8d6a('0x78'));_0x1cb850[_0x8d6a('0x37')](_0x8d6a('0x79'));_0x1cb850[_0x8d6a('0x37')](_0x8d6a('0x7a'));_0x1cb850[_0x8d6a('0x37')](_0x8d6a('0x7b'));_0x1cb850['field']('c.ListId');_0x1cb850['field']('c.createdAt');_0x1cb850[_0x8d6a('0x37')]('c.deletedAt');_0x1cb850[_0x8d6a('0x37')](_0x8d6a('0x7c'));_0x1cb850['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x8d6a('0x7d'));}if(_0x2ff890[_0x8d6a('0x17')])_0x1cb850[_0x8d6a('0x17')](_0x2ff890[_0x8d6a('0x17')]);if(_0x2ff890[_0x8d6a('0x14')])_0x1cb850[_0x8d6a('0x14')](_0x2ff890[_0x8d6a('0x14')]);return db[_0x8d6a('0x74')][_0x8d6a('0x2f')](_0x1cb850[_0x8d6a('0x75')](),_0x461244);});})['then'](function(_0x532e94){_0x532e94[_0x8d6a('0x57')](function(_0x1334bd){if(_0x1334bd[_0x8d6a('0x7d')]){_0x1334bd[_0x8d6a('0x7e')]=[];_0x1334bd[_0x8d6a('0x7d')][_0x8d6a('0x46')](',')['forEach'](function(_0x44b733){_0x1334bd['Tags'][_0x8d6a('0x55')](_0x3c526e[_0x44b733]);});}delete _0x1334bd[_0x8d6a('0x7d')];});_0x20e546[_0x8d6a('0x7f')]=_0x532e94;return _0x20e546;})[_0x8d6a('0x1a')](respondWithFilteredResult(_0xf5acf,_0x2ff890));})[_0x8d6a('0x80')](handleError(_0xf5acf,null));};exports[_0x8d6a('0x1b')]=function(_0x49afb8,_0x5d58fc){return db[_0x8d6a('0x23')][_0x8d6a('0x44')]({'where':{'id':_0x49afb8['params']['id']}})[_0x8d6a('0x1a')](handleEntityNotFound(_0x5d58fc,null))[_0x8d6a('0x1a')](removeEntity(_0x5d58fc,null))[_0x8d6a('0x80')](handleError(_0x5d58fc,null));};exports[_0x8d6a('0x81')]=function(_0x5546c4,_0x137cf8){return db['CmContact'][_0x8d6a('0x81')]()[_0x8d6a('0x1a')](function(_0x28f2ee){delete _0x28f2ee['tags'];for(var _0x4b2776=0x0;_0x4b2776{}\s\\|]/g,'-');_0x56300e(null,util[_0x00be('0x20')](_0x00be('0x21'),path[_0x00be('0x22')](_0x1dd854[_0x00be('0x1e')],path[_0x00be('0x23')](_0x1dd854[_0x00be('0x1e')])),Date[_0x00be('0x24')](),path[_0x00be('0x23')](_0x1dd854[_0x00be('0x1e')])));}})});router[_0x00be('0x16')](_0x00be('0x25'),upload[_0x00be('0x26')](_0x00be('0x27')),controller[_0x00be('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x14b743,_0x18c071,_0x551597){_0x551597(null,path[_0x00be('0x29')](config[_0x00be('0x1c')],'server/files/tmp'));},'filename':function(_0x333485,_0x1954ca,_0x116b4e){_0x1954ca[_0x00be('0x1e')]=_0x1954ca['originalname'][_0x00be('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x116b4e(null,util[_0x00be('0x20')](_0x00be('0x21'),path['basename'](_0x1954ca[_0x00be('0x1e')],path[_0x00be('0x23')](_0x1954ca[_0x00be('0x1e')])),Date[_0x00be('0x24')](),path[_0x00be('0x23')](_0x1954ca[_0x00be('0x1e')])));}})});router[_0x00be('0x16')](_0x00be('0x2a'),upload[_0x00be('0x26')](_0x00be('0x27')),controller[_0x00be('0x2b')]);router[_0x00be('0x16')](_0x00be('0x2c'),auth[_0x00be('0x9')](),controller['import']);router[_0x00be('0x2d')](_0x00be('0xc'),auth['isAuthenticated'](),controller[_0x00be('0x2e')]);router[_0x00be('0x2f')](_0x00be('0xc'),auth[_0x00be('0x9')](),controller[_0x00be('0x30')]);module['exports']=router; \ No newline at end of file +var _0x4b41=['express','Router','../../components/auth/service','../../components/interaction/service','get','/describe','isAuthenticated','/:id','/:id/tags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','getJourney','post','/merge','merge','create','bulkCreate','setTags','diskStorage','join','root','server/files/tmp','originalname','format','%s-%s%s','extname','now','/csv','single','file','uploadCsv','replace','basename','/upload','upload','/upload/:id','import','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x11e30d,_0x5584aa){var _0x2d4e29=function(_0x2486ce){while(--_0x2486ce){_0x11e30d['push'](_0x11e30d['shift']());}};_0x2d4e29(++_0x5584aa);}(_0x4b41,0x128));var _0x14b4=function(_0x48438d,_0x12c3a9){_0x48438d=_0x48438d-0x0;var _0x1e85a3=_0x4b41[_0x48438d];return _0x1e85a3;};'use strict';var multer=require(_0x14b4('0x0'));var util=require(_0x14b4('0x1'));var path=require(_0x14b4('0x2'));var timeout=require(_0x14b4('0x3'));var express=require(_0x14b4('0x4'));var router=express[_0x14b4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x14b4('0x6'));var interaction=require(_0x14b4('0x7'));var config=require('../../config/environment');var controller=require('./cmContact.controller');router[_0x14b4('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x14b4('0x8')](_0x14b4('0x9'),auth[_0x14b4('0xa')](),controller['describe']);router[_0x14b4('0x8')](_0x14b4('0xb'),auth[_0x14b4('0xa')](),controller['show']);router[_0x14b4('0x8')](_0x14b4('0xc'),auth[_0x14b4('0xa')](),controller['getTags']);router[_0x14b4('0x8')](_0x14b4('0xd'),auth[_0x14b4('0xa')](),controller[_0x14b4('0xe')]);router['get'](_0x14b4('0xf'),auth[_0x14b4('0xa')](),controller[_0x14b4('0x10')]);router[_0x14b4('0x8')](_0x14b4('0x11'),auth[_0x14b4('0xa')](),controller[_0x14b4('0x12')]);router[_0x14b4('0x8')](_0x14b4('0x13'),auth[_0x14b4('0xa')](),controller[_0x14b4('0x14')]);router[_0x14b4('0x8')]('/:id/journey',auth['isAuthenticated'](),controller[_0x14b4('0x15')]);router[_0x14b4('0x16')](_0x14b4('0x17'),auth['isAuthenticated'](),controller[_0x14b4('0x18')]);router[_0x14b4('0x16')]('/',auth[_0x14b4('0xa')](),controller[_0x14b4('0x19')]);router[_0x14b4('0x16')]('/create_many',auth[_0x14b4('0xa')](),controller[_0x14b4('0x1a')]);router[_0x14b4('0x16')]('/:id/tags',auth[_0x14b4('0xa')](),controller[_0x14b4('0x1b')]);var upload=multer({'storage':multer[_0x14b4('0x1c')]({'destination':function(_0x16521f,_0x4b5068,_0x106501){_0x106501(null,path[_0x14b4('0x1d')](config[_0x14b4('0x1e')],_0x14b4('0x1f')));},'filename':function(_0x43382f,_0x34f397,_0x443afb){_0x34f397[_0x14b4('0x20')]=_0x34f397['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x443afb(null,util[_0x14b4('0x21')](_0x14b4('0x22'),path['basename'](_0x34f397[_0x14b4('0x20')],path[_0x14b4('0x23')](_0x34f397[_0x14b4('0x20')])),Date[_0x14b4('0x24')](),path['extname'](_0x34f397[_0x14b4('0x20')])));}})});router['post'](_0x14b4('0x25'),upload[_0x14b4('0x26')](_0x14b4('0x27')),controller[_0x14b4('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4fbee4,_0x53454e,_0x29200c){_0x29200c(null,path[_0x14b4('0x1d')](config['root'],'server/files/tmp'));},'filename':function(_0x1a5dcb,_0x796c02,_0x12e2c3){_0x796c02['originalname']=_0x796c02[_0x14b4('0x20')][_0x14b4('0x29')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x12e2c3(null,util[_0x14b4('0x21')](_0x14b4('0x22'),path[_0x14b4('0x2a')](_0x796c02[_0x14b4('0x20')],path[_0x14b4('0x23')](_0x796c02[_0x14b4('0x20')])),Date[_0x14b4('0x24')](),path['extname'](_0x796c02[_0x14b4('0x20')])));}})});router[_0x14b4('0x16')](_0x14b4('0x2b'),upload[_0x14b4('0x26')]('file'),controller[_0x14b4('0x2c')]);router[_0x14b4('0x16')](_0x14b4('0x2d'),auth[_0x14b4('0xa')](),controller[_0x14b4('0x2e')]);router['put'](_0x14b4('0xb'),auth['isAuthenticated'](),controller[_0x14b4('0x2f')]);router['delete']('/:id',auth[_0x14b4('0xa')](),controller[_0x14b4('0x30')]);module[_0x14b4('0x31')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 36f6485..72e977d 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 _0xa7b3=['TEXT','long','getDataValue','select','parse','values','isArray','setDataValue','BOOLEAN','ENUM','voice','lodash','alias','STRING','name'];(function(_0x26e9a5,_0x5e86dc){var _0x4a9b4f=function(_0x40990){while(--_0x40990){_0x26e9a5['push'](_0x26e9a5['shift']());}};_0x4a9b4f(++_0x5e86dc);}(_0xa7b3,0x1eb));var _0x3a7b=function(_0x1589bf,_0x3ab00b){_0x1589bf=_0x1589bf-0x0;var _0x27d5aa=_0xa7b3[_0x1589bf];return _0x27d5aa;};'use strict';var Sequelize=require('sequelize');var _=require(_0x3a7b('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x30b005){return this['getDataValue'](_0x3a7b('0x1'));}},'alias':{'type':Sequelize[_0x3a7b('0x2')],'allowNull':![],'set':function(_0x1569ee){this['setDataValue']('alias',_0x1569ee?_0x1569ee:this['getDataValue'](_0x3a7b('0x3')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x3a7b('0x4')](_0x3a7b('0x5')),'get':function(){if(this[_0x3a7b('0x6')]('type')===_0x3a7b('0x7')){return JSON[_0x3a7b('0x8')](this[_0x3a7b('0x6')](_0x3a7b('0x9')));}else{return this[_0x3a7b('0x6')](_0x3a7b('0x9'));}},'set':function(_0x18a7c1){if(Array[_0x3a7b('0xa')](_0x18a7c1)){this['setDataValue'](_0x3a7b('0x9'),JSON['stringify'](_0x18a7c1));}else{this[_0x3a7b('0xb')]('values',_0x18a7c1);}}},'required':{'type':Sequelize[_0x3a7b('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x3a7b('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x3a7b('0xd')](_0x3a7b('0xe'))}}; \ No newline at end of file +var _0x612e=['select','parse','values','isArray','BOOLEAN','ENUM','voice','lodash','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','TEXT','type'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x612e,0xd7));var _0xe612=function(_0x559f10,_0x112c00){_0x559f10=_0x559f10-0x0;var _0x2bacf7=_0x612e[_0x559f10];return _0x2bacf7;};'use strict';var Sequelize=require('sequelize');var _=require(_0xe612('0x0'));module['exports']={'name':{'type':Sequelize[_0xe612('0x1')],'get':function(_0x3ff2d5){return this[_0xe612('0x2')](_0xe612('0x3'));}},'alias':{'type':Sequelize[_0xe612('0x4')],'allowNull':![],'set':function(_0x3140e9){this[_0xe612('0x5')](_0xe612('0x3'),_0x3140e9?_0x3140e9:this[_0xe612('0x2')](_0xe612('0x6')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0xe612('0x7')]('long'),'get':function(){if(this['getDataValue'](_0xe612('0x8'))===_0xe612('0x9')){return JSON[_0xe612('0xa')](this['getDataValue'](_0xe612('0xb')));}else{return this[_0xe612('0x2')](_0xe612('0xb'));}},'set':function(_0x40824c){if(Array[_0xe612('0xc')](_0x40824c)){this['setDataValue'](_0xe612('0xb'),JSON['stringify'](_0x40824c));}else{this['setDataValue'](_0xe612('0xb'),_0x40824c);}}},'required':{'type':Sequelize[_0xe612('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xe612('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xe612('0xe')](_0xe612('0xf'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 4d07850..9f29c85 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 _0x1a80=['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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','CmCustomField','include','rows','catch','params','includeAll','find','create','transaction','body','TEXT','text','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x1e1493,_0x1a455b){var _0x3296a9=function(_0x35626b){while(--_0x35626b){_0x1e1493['push'](_0x1e1493['shift']());}};_0x3296a9(++_0x1a455b);}(_0x1a80,0x11a));var _0x01a8=function(_0x14212c,_0x59b600){_0x14212c=_0x14212c-0x0;var _0x1d90b5=_0x1a80[_0x14212c];return _0x1d90b5;};'use strict';var emlformat=require(_0x01a8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x01a8('0x1'));var jsonpatch=require(_0x01a8('0x2'));var rp=require(_0x01a8('0x3'));var moment=require(_0x01a8('0x4'));var BPromise=require(_0x01a8('0x5'));var Mustache=require(_0x01a8('0x6'));var util=require(_0x01a8('0x7'));var path=require(_0x01a8('0x8'));var sox=require(_0x01a8('0x9'));var csv=require(_0x01a8('0xa'));var ejs=require(_0x01a8('0xb'));var fs=require('fs');var fs_extra=require(_0x01a8('0xc'));var _=require(_0x01a8('0xd'));var squel=require(_0x01a8('0xe'));var crypto=require('crypto');var jsforce=require(_0x01a8('0xf'));var deskjs=require(_0x01a8('0x10'));var toCsv=require('to-csv');var querystring=require(_0x01a8('0x11'));var Papa=require(_0x01a8('0x12'));var Redis=require(_0x01a8('0x13'));var authService=require(_0x01a8('0x14'));var qs=require(_0x01a8('0x15'));var as=require(_0x01a8('0x16'));var hardwareService=require(_0x01a8('0x17'));var logger=require(_0x01a8('0x18'))(_0x01a8('0x19'));var utils=require(_0x01a8('0x1a'));var config=require(_0x01a8('0x1b'));var licenseUtil=require(_0x01a8('0x1c'));var db=require(_0x01a8('0x1d'))['db'];function respondWithStatusCode(_0x5c9027,_0x23f147){_0x23f147=_0x23f147||0xcc;return function(_0x53d65f){if(_0x53d65f){return _0x5c9027[_0x01a8('0x1e')](_0x23f147);}return _0x5c9027[_0x01a8('0x1f')](_0x23f147)[_0x01a8('0x20')]();};}function respondWithResult(_0x2435c1,_0x2aed27){_0x2aed27=_0x2aed27||0xc8;return function(_0x4d5ecf){if(_0x4d5ecf){return _0x2435c1[_0x01a8('0x1f')](_0x2aed27)[_0x01a8('0x21')](_0x4d5ecf);}};}function respondWithFilteredResult(_0x2496a8,_0x3bf501){return function(_0x3fda37){if(_0x3fda37){var _0x177255=typeof _0x3bf501[_0x01a8('0x22')]==='undefined'&&typeof _0x3bf501[_0x01a8('0x23')]===_0x01a8('0x24');var _0x4e37e6=_0x3fda37[_0x01a8('0x25')];var _0x1d2d4f=_0x177255?0x0:_0x3bf501[_0x01a8('0x22')];var _0x3d1a65=_0x177255?_0x3fda37[_0x01a8('0x25')]:_0x3bf501[_0x01a8('0x22')]+_0x3bf501[_0x01a8('0x23')];var _0x546162;if(_0x3d1a65>=_0x4e37e6){_0x3d1a65=_0x4e37e6;_0x546162=0xc8;}else{_0x546162=0xce;}_0x2496a8[_0x01a8('0x1f')](_0x546162);return _0x2496a8[_0x01a8('0x26')](_0x01a8('0x27'),_0x1d2d4f+'-'+_0x3d1a65+'/'+_0x4e37e6)[_0x01a8('0x21')](_0x3fda37);}return null;};}function patchUpdates(_0x4fa59a){return function(_0x7411be){try{jsonpatch[_0x01a8('0x28')](_0x7411be,_0x4fa59a,!![]);}catch(_0x5e8284){return BPromise[_0x01a8('0x29')](_0x5e8284);}return _0x7411be['save']();};}function saveUpdates(_0x51c776,_0x47381d){return function(_0x19b8e0){if(_0x19b8e0){return _0x19b8e0[_0x01a8('0x2a')](_0x51c776)[_0x01a8('0x2b')](function(_0x53281e){return _0x53281e;});}return null;};}function removeEntity(_0x58e7bf,_0x21e825){return function(_0x1fab68){if(_0x1fab68){return _0x1fab68[_0x01a8('0x2c')]()[_0x01a8('0x2b')](function(){_0x58e7bf[_0x01a8('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bebc3,_0x48ebdb){return function(_0x2b49f6){if(!_0x2b49f6){_0x4bebc3[_0x01a8('0x1e')](0x194);}return _0x2b49f6;};}function handleError(_0x88dde3,_0x2a5949){_0x2a5949=_0x2a5949||0x1f4;return function(_0x56ac35){logger[_0x01a8('0x2d')](_0x56ac35[_0x01a8('0x2e')]);if(_0x56ac35['name']){delete _0x56ac35[_0x01a8('0x2f')];}_0x88dde3[_0x01a8('0x1f')](_0x2a5949)[_0x01a8('0x30')](_0x56ac35);};}exports[_0x01a8('0x31')]=function(_0x17e8d4,_0x27ab8d){var _0x41bd63={},_0x38147c={},_0x3e8878={'count':0x0,'rows':[]};var _0x16ea86=_[_0x01a8('0x32')](db['CmCustomField'][_0x01a8('0x33')],function(_0xb6f391){return{'name':_0xb6f391[_0x01a8('0x34')],'type':_0xb6f391[_0x01a8('0x35')][_0x01a8('0x36')]};});_0x38147c[_0x01a8('0x37')]=_['differenceBy'](_[_0x01a8('0x32')](_0x16ea86,_0x01a8('0x2f')),['name']);_0x38147c[_0x01a8('0x38')]=_[_0x01a8('0x39')](_0x17e8d4['query']);_0x38147c[_0x01a8('0x3a')]=_[_0x01a8('0x3b')](_0x38147c['model'],_0x38147c[_0x01a8('0x38')]);_0x41bd63[_0x01a8('0x3c')]=_[_0x01a8('0x3b')](_0x38147c[_0x01a8('0x37')],qs[_0x01a8('0x3d')](_0x17e8d4['query'][_0x01a8('0x3d')]));_0x41bd63[_0x01a8('0x3c')]=_0x41bd63[_0x01a8('0x3c')][_0x01a8('0x3e')]?_0x41bd63['attributes']:_0x38147c[_0x01a8('0x37')];if(!_0x17e8d4[_0x01a8('0x38')][_0x01a8('0x3f')](_0x01a8('0x40'))){_0x41bd63[_0x01a8('0x23')]=qs[_0x01a8('0x23')](_0x17e8d4[_0x01a8('0x38')][_0x01a8('0x23')]);_0x41bd63[_0x01a8('0x22')]=qs['offset'](_0x17e8d4[_0x01a8('0x38')][_0x01a8('0x22')]);}_0x41bd63[_0x01a8('0x41')]=qs[_0x01a8('0x42')](_0x17e8d4[_0x01a8('0x38')]['sort']);_0x41bd63[_0x01a8('0x43')]=qs[_0x01a8('0x3a')](_[_0x01a8('0x44')](_0x17e8d4['query'],_0x38147c['filters']),_0x16ea86);if(_0x17e8d4['query'][_0x01a8('0x45')]){_0x41bd63[_0x01a8('0x43')]=_[_0x01a8('0x46')](_0x41bd63[_0x01a8('0x43')],{'$or':_[_0x01a8('0x32')](_0x16ea86,function(_0x5159e3){if(_0x5159e3[_0x01a8('0x35')]!==_0x01a8('0x47')){var _0x3fa70c={};_0x3fa70c[_0x5159e3[_0x01a8('0x2f')]]={'$like':'%'+_0x17e8d4[_0x01a8('0x38')][_0x01a8('0x45')]+'%'};return _0x3fa70c;}})});}_0x41bd63=_[_0x01a8('0x46')]({},_0x41bd63,_0x17e8d4[_0x01a8('0x48')]);var _0x42f51d={'where':_0x41bd63['where']};return db[_0x01a8('0x49')][_0x01a8('0x25')](_0x42f51d)['then'](function(_0x205935){_0x3e8878[_0x01a8('0x25')]=_0x205935;if(_0x17e8d4[_0x01a8('0x38')]['includeAll']){_0x41bd63[_0x01a8('0x4a')]=[{'all':!![]}];}return db[_0x01a8('0x49')]['findAll'](_0x41bd63);})[_0x01a8('0x2b')](function(_0x279b3b){_0x3e8878[_0x01a8('0x4b')]=_0x279b3b;return _0x3e8878;})[_0x01a8('0x2b')](respondWithFilteredResult(_0x27ab8d,_0x41bd63))[_0x01a8('0x4c')](handleError(_0x27ab8d,null));};exports['show']=function(_0x290818,_0x498991){var _0x165ab5={'raw':!![],'where':{'id':_0x290818[_0x01a8('0x4d')]['id']}},_0x328b2d={};_0x328b2d['model']=_[_0x01a8('0x39')](db[_0x01a8('0x49')][_0x01a8('0x33')]);_0x328b2d['query']=_[_0x01a8('0x39')](_0x290818[_0x01a8('0x38')]);_0x328b2d[_0x01a8('0x3a')]=_[_0x01a8('0x3b')](_0x328b2d[_0x01a8('0x37')],_0x328b2d['query']);_0x165ab5[_0x01a8('0x3c')]=_['intersection'](_0x328b2d['model'],qs[_0x01a8('0x3d')](_0x290818[_0x01a8('0x38')]['fields']));_0x165ab5[_0x01a8('0x3c')]=_0x165ab5[_0x01a8('0x3c')]['length']?_0x165ab5[_0x01a8('0x3c')]:_0x328b2d['model'];if(_0x290818[_0x01a8('0x38')][_0x01a8('0x4e')]){_0x165ab5[_0x01a8('0x4a')]=[{'all':!![]}];}_0x165ab5=_[_0x01a8('0x46')]({},_0x165ab5,_0x290818[_0x01a8('0x48')]);return db[_0x01a8('0x49')][_0x01a8('0x4f')](_0x165ab5)['then'](handleEntityNotFound(_0x498991,null))[_0x01a8('0x2b')](respondWithResult(_0x498991,null))[_0x01a8('0x4c')](handleError(_0x498991,null));};exports[_0x01a8('0x2a')]=function(_0x5b8248,_0x4cb86a){if(_0x5b8248['body']['id']){delete _0x5b8248['body']['id'];}return db['CmCustomField'][_0x01a8('0x4f')]({'where':{'id':_0x5b8248['params']['id']}})['then'](handleEntityNotFound(_0x4cb86a,null))['then'](saveUpdates(_0x5b8248['body'],null))[_0x01a8('0x2b')](respondWithResult(_0x4cb86a,null))[_0x01a8('0x4c')](handleError(_0x4cb86a,null));};exports['destroy']=function(_0x4b7f08,_0x4359a5){return db[_0x01a8('0x49')]['find']({'where':{'id':_0x4b7f08[_0x01a8('0x4d')]['id']}})[_0x01a8('0x2b')](handleEntityNotFound(_0x4359a5,null))['then'](removeEntity(_0x4359a5,null))[_0x01a8('0x4c')](handleError(_0x4359a5,null));};exports[_0x01a8('0x50')]=function(_0x24393d,_0x1cc253){var _0x47a476;return db['sequelize'][_0x01a8('0x51')](function(_0x178d57){return db[_0x01a8('0x49')][_0x01a8('0x50')](_0x24393d[_0x01a8('0x52')],{'transaction':_0x178d57})['then'](function(_0x20b7a2){_0x47a476=_0x20b7a2;var _0x132185={'type':db['Sequelize'][_0x01a8('0x53')],'transaction':_0x178d57};switch(_0x24393d['body'][_0x01a8('0x35')]){case _0x01a8('0x54'):_0x132185[_0x01a8('0x35')]=db[_0x01a8('0x55')][_0x01a8('0x53')];break;case _0x01a8('0x56'):_0x132185[_0x01a8('0x35')]=db[_0x01a8('0x55')][_0x01a8('0x57')];break;case _0x01a8('0x58'):_0x132185[_0x01a8('0x35')]=db['Sequelize'][_0x01a8('0x59')];_0x132185[_0x01a8('0x5a')]=![];break;default:}return db['sequelize'][_0x01a8('0x5b')][_0x01a8('0x5c')](_0x01a8('0x5d'),util[_0x01a8('0x5e')](_0x01a8('0x5f'),_0x47a476['id']),_0x132185);})[_0x01a8('0x2b')](function(){return _0x47a476;});})[_0x01a8('0x2b')](respondWithResult(_0x1cc253,0xc9))[_0x01a8('0x4c')](handleError(_0x1cc253,null));}; \ No newline at end of file +var _0x08a2=['include','body','find','sequelize','transaction','create','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','queryInterface','format','cf_%d','eml-format','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','send','index','rawAttributes','fieldName','type','model','differenceBy','map','name','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','CmCustomField','rows','catch','show','params'];(function(_0x29dc35,_0x1f1be3){var _0x3993d8=function(_0x512901){while(--_0x512901){_0x29dc35['push'](_0x29dc35['shift']());}};_0x3993d8(++_0x1f1be3);}(_0x08a2,0x15f));var _0x208a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x08a2[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x208a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x208a('0x1'));var rp=require(_0x208a('0x2'));var moment=require(_0x208a('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x208a('0x4'));var path=require(_0x208a('0x5'));var sox=require(_0x208a('0x6'));var csv=require(_0x208a('0x7'));var ejs=require(_0x208a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x208a('0x9'));var squel=require('squel');var crypto=require(_0x208a('0xa'));var jsforce=require(_0x208a('0xb'));var deskjs=require(_0x208a('0xc'));var toCsv=require(_0x208a('0x7'));var querystring=require('querystring');var Papa=require(_0x208a('0xd'));var Redis=require(_0x208a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x208a('0xf'));var as=require(_0x208a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x208a('0x11'))(_0x208a('0x12'));var utils=require(_0x208a('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x208a('0x14'));var db=require(_0x208a('0x15'))['db'];function respondWithStatusCode(_0xd14437,_0x4ee1e5){_0x4ee1e5=_0x4ee1e5||0xcc;return function(_0x2c9391){if(_0x2c9391){return _0xd14437[_0x208a('0x16')](_0x4ee1e5);}return _0xd14437[_0x208a('0x17')](_0x4ee1e5)[_0x208a('0x18')]();};}function respondWithResult(_0x4a82f4,_0x538526){_0x538526=_0x538526||0xc8;return function(_0x5c762a){if(_0x5c762a){return _0x4a82f4[_0x208a('0x17')](_0x538526)[_0x208a('0x19')](_0x5c762a);}};}function respondWithFilteredResult(_0x474d9d,_0x1b2c01){return function(_0x15003f){if(_0x15003f){var _0xfd1ceb=typeof _0x1b2c01[_0x208a('0x1a')]===_0x208a('0x1b')&&typeof _0x1b2c01[_0x208a('0x1c')]==='undefined';var _0x86e992=_0x15003f[_0x208a('0x1d')];var _0x27760b=_0xfd1ceb?0x0:_0x1b2c01['offset'];var _0x8a74ea=_0xfd1ceb?_0x15003f[_0x208a('0x1d')]:_0x1b2c01[_0x208a('0x1a')]+_0x1b2c01['limit'];var _0x11ca3e;if(_0x8a74ea>=_0x86e992){_0x8a74ea=_0x86e992;_0x11ca3e=0xc8;}else{_0x11ca3e=0xce;}_0x474d9d[_0x208a('0x17')](_0x11ca3e);return _0x474d9d[_0x208a('0x1e')](_0x208a('0x1f'),_0x27760b+'-'+_0x8a74ea+'/'+_0x86e992)[_0x208a('0x19')](_0x15003f);}return null;};}function patchUpdates(_0x988a73){return function(_0x10b537){try{jsonpatch[_0x208a('0x20')](_0x10b537,_0x988a73,!![]);}catch(_0x52e7ab){return BPromise[_0x208a('0x21')](_0x52e7ab);}return _0x10b537['save']();};}function saveUpdates(_0xa572fa,_0x4a2863){return function(_0x374d9e){if(_0x374d9e){return _0x374d9e[_0x208a('0x22')](_0xa572fa)['then'](function(_0xbfd188){return _0xbfd188;});}return null;};}function removeEntity(_0x1a4f05,_0x5d0ff6){return function(_0x1635de){if(_0x1635de){return _0x1635de[_0x208a('0x23')]()[_0x208a('0x24')](function(){_0x1a4f05[_0x208a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24cf0,_0x3b8f5f){return function(_0x431444){if(!_0x431444){_0x24cf0[_0x208a('0x16')](0x194);}return _0x431444;};}function handleError(_0x20585e,_0x1df26c){_0x1df26c=_0x1df26c||0x1f4;return function(_0x4f62d2){logger[_0x208a('0x25')](_0x4f62d2[_0x208a('0x26')]);if(_0x4f62d2['name']){delete _0x4f62d2['name'];}_0x20585e[_0x208a('0x17')](_0x1df26c)[_0x208a('0x27')](_0x4f62d2);};}exports[_0x208a('0x28')]=function(_0x320b62,_0x1a7257){var _0x411406={},_0x4bc9a4={},_0x5eb227={'count':0x0,'rows':[]};var _0x316b9e=_['map'](db['CmCustomField'][_0x208a('0x29')],function(_0x389299){return{'name':_0x389299[_0x208a('0x2a')],'type':_0x389299[_0x208a('0x2b')]['key']};});_0x4bc9a4[_0x208a('0x2c')]=_[_0x208a('0x2d')](_[_0x208a('0x2e')](_0x316b9e,'name'),[_0x208a('0x2f')]);_0x4bc9a4['query']=_[_0x208a('0x30')](_0x320b62[_0x208a('0x31')]);_0x4bc9a4[_0x208a('0x32')]=_['intersection'](_0x4bc9a4[_0x208a('0x2c')],_0x4bc9a4['query']);_0x411406[_0x208a('0x33')]=_[_0x208a('0x34')](_0x4bc9a4['model'],qs['fields'](_0x320b62[_0x208a('0x31')][_0x208a('0x35')]));_0x411406[_0x208a('0x33')]=_0x411406['attributes'][_0x208a('0x36')]?_0x411406[_0x208a('0x33')]:_0x4bc9a4[_0x208a('0x2c')];if(!_0x320b62[_0x208a('0x31')][_0x208a('0x37')](_0x208a('0x38'))){_0x411406[_0x208a('0x1c')]=qs[_0x208a('0x1c')](_0x320b62['query'][_0x208a('0x1c')]);_0x411406[_0x208a('0x1a')]=qs[_0x208a('0x1a')](_0x320b62[_0x208a('0x31')][_0x208a('0x1a')]);}_0x411406[_0x208a('0x39')]=qs['sort'](_0x320b62[_0x208a('0x31')][_0x208a('0x3a')]);_0x411406[_0x208a('0x3b')]=qs[_0x208a('0x32')](_[_0x208a('0x3c')](_0x320b62['query'],_0x4bc9a4[_0x208a('0x32')]),_0x316b9e);if(_0x320b62[_0x208a('0x31')][_0x208a('0x3d')]){_0x411406[_0x208a('0x3b')]=_[_0x208a('0x3e')](_0x411406[_0x208a('0x3b')],{'$or':_['map'](_0x316b9e,function(_0x55efc6){if(_0x55efc6[_0x208a('0x2b')]!=='VIRTUAL'){var _0x4a4d7d={};_0x4a4d7d[_0x55efc6['name']]={'$like':'%'+_0x320b62[_0x208a('0x31')]['filter']+'%'};return _0x4a4d7d;}})});}_0x411406=_[_0x208a('0x3e')]({},_0x411406,_0x320b62[_0x208a('0x3f')]);var _0x4989a7={'where':_0x411406[_0x208a('0x3b')]};return db[_0x208a('0x40')][_0x208a('0x1d')](_0x4989a7)[_0x208a('0x24')](function(_0x2c99cf){_0x5eb227[_0x208a('0x1d')]=_0x2c99cf;if(_0x320b62['query']['includeAll']){_0x411406['include']=[{'all':!![]}];}return db[_0x208a('0x40')]['findAll'](_0x411406);})[_0x208a('0x24')](function(_0x202252){_0x5eb227[_0x208a('0x41')]=_0x202252;return _0x5eb227;})[_0x208a('0x24')](respondWithFilteredResult(_0x1a7257,_0x411406))[_0x208a('0x42')](handleError(_0x1a7257,null));};exports[_0x208a('0x43')]=function(_0xd47f51,_0x5801d6){var _0x44bb28={'raw':!![],'where':{'id':_0xd47f51[_0x208a('0x44')]['id']}},_0x20b453={};_0x20b453['model']=_[_0x208a('0x30')](db[_0x208a('0x40')][_0x208a('0x29')]);_0x20b453[_0x208a('0x31')]=_[_0x208a('0x30')](_0xd47f51['query']);_0x20b453['filters']=_[_0x208a('0x34')](_0x20b453[_0x208a('0x2c')],_0x20b453['query']);_0x44bb28[_0x208a('0x33')]=_[_0x208a('0x34')](_0x20b453[_0x208a('0x2c')],qs[_0x208a('0x35')](_0xd47f51[_0x208a('0x31')]['fields']));_0x44bb28['attributes']=_0x44bb28[_0x208a('0x33')]['length']?_0x44bb28[_0x208a('0x33')]:_0x20b453[_0x208a('0x2c')];if(_0xd47f51[_0x208a('0x31')]['includeAll']){_0x44bb28[_0x208a('0x45')]=[{'all':!![]}];}_0x44bb28=_[_0x208a('0x3e')]({},_0x44bb28,_0xd47f51[_0x208a('0x3f')]);return db['CmCustomField']['find'](_0x44bb28)[_0x208a('0x24')](handleEntityNotFound(_0x5801d6,null))[_0x208a('0x24')](respondWithResult(_0x5801d6,null))[_0x208a('0x42')](handleError(_0x5801d6,null));};exports[_0x208a('0x22')]=function(_0x3743a6,_0xb526d0){if(_0x3743a6[_0x208a('0x46')]['id']){delete _0x3743a6['body']['id'];}return db[_0x208a('0x40')][_0x208a('0x47')]({'where':{'id':_0x3743a6[_0x208a('0x44')]['id']}})[_0x208a('0x24')](handleEntityNotFound(_0xb526d0,null))[_0x208a('0x24')](saveUpdates(_0x3743a6[_0x208a('0x46')],null))[_0x208a('0x24')](respondWithResult(_0xb526d0,null))['catch'](handleError(_0xb526d0,null));};exports[_0x208a('0x23')]=function(_0x3828a4,_0x4861c1){return db[_0x208a('0x40')][_0x208a('0x47')]({'where':{'id':_0x3828a4[_0x208a('0x44')]['id']}})[_0x208a('0x24')](handleEntityNotFound(_0x4861c1,null))[_0x208a('0x24')](removeEntity(_0x4861c1,null))[_0x208a('0x42')](handleError(_0x4861c1,null));};exports['create']=function(_0x5623c8,_0x12728c){var _0x4b014f;return db[_0x208a('0x48')][_0x208a('0x49')](function(_0x555bef){return db[_0x208a('0x40')][_0x208a('0x4a')](_0x5623c8[_0x208a('0x46')],{'transaction':_0x555bef})[_0x208a('0x24')](function(_0x276842){_0x4b014f=_0x276842;var _0x5e831f={'type':db[_0x208a('0x4b')][_0x208a('0x4c')],'transaction':_0x555bef};switch(_0x5623c8[_0x208a('0x46')][_0x208a('0x2b')]){case _0x208a('0x4d'):_0x5e831f[_0x208a('0x2b')]=db[_0x208a('0x4b')][_0x208a('0x4c')];break;case _0x208a('0x4e'):_0x5e831f[_0x208a('0x2b')]=db[_0x208a('0x4b')][_0x208a('0x4f')];break;case'switch':_0x5e831f[_0x208a('0x2b')]=db[_0x208a('0x4b')][_0x208a('0x50')];_0x5e831f['defaultValue']=![];break;default:}return db['sequelize'][_0x208a('0x51')]['addColumn']('cm_contacts',util[_0x208a('0x52')](_0x208a('0x53'),_0x4b014f['id']),_0x5e831f);})['then'](function(){return _0x4b014f;});})['then'](respondWithResult(_0x12728c,0xc9))['catch'](handleError(_0x12728c,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 7be5b8b..f911c9c 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 _0x979a=['moment','bluebird','request-promise','../../config/environment','./cmCustomField.attributes','CmCustomField','lodash','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x979a,0x86));var _0xa979=function(_0x5341d2,_0x2da6d6){_0x5341d2=_0x5341d2-0x0;var _0x3a4d6a=_0x979a[_0x5341d2];return _0x3a4d6a;};'use strict';var _=require(_0xa979('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa979('0x1'));var moment=require(_0xa979('0x2'));var BPromise=require(_0xa979('0x3'));var rp=require(_0xa979('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa979('0x5'));var attributes=require(_0xa979('0x6'));module['exports']=function(_0x59eebf,_0x5f22f2){return _0x59eebf['define'](_0xa979('0x7'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7095=['define','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./cmCustomField.attributes','exports'];(function(_0x3fc2fe,_0x4dd01d){var _0x4d439e=function(_0x3f2576){while(--_0x3f2576){_0x3fc2fe['push'](_0x3fc2fe['shift']());}};_0x4d439e(++_0x4dd01d);}(_0x7095,0x187));var _0x5709=function(_0x3da143,_0x71b28b){_0x3da143=_0x3da143-0x0;var _0x299878=_0x7095[_0x3da143];return _0x299878;};'use strict';var _=require(_0x5709('0x0'));var util=require(_0x5709('0x1'));var logger=require(_0x5709('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5709('0x3'));var rp=require(_0x5709('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5709('0x5'));var config=require(_0x5709('0x6'));var attributes=require(_0x5709('0x7'));module[_0x5709('0x8')]=function(_0x3f66c6,_0xdb3adc){return _0x3f66c6[_0x5709('0x9')]('CmCustomField',attributes,{'tableName':'cm_custom_fields','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 75da11e..fc7a158 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 _0x057f=['catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result'];(function(_0x14f4b0,_0xb9facd){var _0x30a3f2=function(_0x56b82b){while(--_0x56b82b){_0x14f4b0['push'](_0x14f4b0['shift']());}};_0x30a3f2(++_0xb9facd);}(_0x057f,0xf1));var _0xf057=function(_0x1144ba,_0x142a9c){_0x1144ba=_0x1144ba-0x0;var _0xa91dcf=_0x057f[_0x1144ba];return _0xa91dcf;};'use strict';var _=require('lodash');var util=require(_0xf057('0x0'));var moment=require(_0xf057('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf057('0x2'))['db'];var utils=require(_0xf057('0x3'));var logger=require(_0xf057('0x4'))(_0xf057('0x5'));var config=require(_0xf057('0x6'));var jayson=require(_0xf057('0x7'));var client=jayson[_0xf057('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x465902,_0x1bf20f,_0x2f7533){return new BPromise(function(_0x25c1e8,_0x3735ff){return client['request'](_0x465902,_0x2f7533)[_0xf057('0x9')](function(_0x1e0ec5){logger[_0xf057('0xa')](_0xf057('0xb'),_0x1bf20f,'request\x20sent');logger[_0xf057('0xc')](_0xf057('0xd'),_0x1bf20f,'request\x20sent',JSON[_0xf057('0xe')](_0x1e0ec5));if(_0x1e0ec5[_0xf057('0xf')]){if(_0x1e0ec5[_0xf057('0xf')]['code']===0x1f4){logger['error']('CmCustomField,\x20%s,\x20%s',_0x1bf20f,_0x1e0ec5[_0xf057('0xf')][_0xf057('0x10')]);return _0x3735ff(_0x1e0ec5[_0xf057('0xf')][_0xf057('0x10')]);}logger['error'](_0xf057('0xb'),_0x1bf20f,_0x1e0ec5[_0xf057('0xf')]['message']);return _0x25c1e8(_0x1e0ec5[_0xf057('0xf')][_0xf057('0x10')]);}else{logger[_0xf057('0xa')]('CmCustomField,\x20%s,\x20%s',_0x1bf20f,_0xf057('0x11'));_0x25c1e8(_0x1e0ec5[_0xf057('0x12')][_0xf057('0x10')]);}})[_0xf057('0x13')](function(_0x4656e2){logger[_0xf057('0xf')](_0xf057('0xb'),_0x1bf20f,_0x4656e2);_0x3735ff(_0x4656e2);});});} \ No newline at end of file +var _0xb999=['info','catch','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x53f964,_0x3b52b8){var _0x17be6c=function(_0x25a732){while(--_0x25a732){_0x53f964['push'](_0x53f964['shift']());}};_0x17be6c(++_0x3b52b8);}(_0xb999,0xad));var _0x9b99=function(_0x12331f,_0x4bdd87){_0x12331f=_0x12331f-0x0;var _0x2d785b=_0xb999[_0x12331f];return _0x2d785b;};'use strict';var _=require(_0x9b99('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9b99('0x1'));var rs=require(_0x9b99('0x2'));var fs=require('fs');var Redis=require(_0x9b99('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9b99('0x4'))(_0x9b99('0x5'));var config=require(_0x9b99('0x6'));var jayson=require(_0x9b99('0x7'));var client=jayson[_0x9b99('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ea3b5,_0x38e7cc,_0x4bb474){return new BPromise(function(_0x303850,_0x553c22){return client[_0x9b99('0x9')](_0x2ea3b5,_0x4bb474)['then'](function(_0x1bf66a){logger['info'](_0x9b99('0xa'),_0x38e7cc,_0x9b99('0xb'));logger[_0x9b99('0xc')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x38e7cc,_0x9b99('0xb'),JSON[_0x9b99('0xd')](_0x1bf66a));if(_0x1bf66a[_0x9b99('0xe')]){if(_0x1bf66a[_0x9b99('0xe')][_0x9b99('0xf')]===0x1f4){logger['error']('CmCustomField,\x20%s,\x20%s',_0x38e7cc,_0x1bf66a[_0x9b99('0xe')]['message']);return _0x553c22(_0x1bf66a['error'][_0x9b99('0x10')]);}logger['error'](_0x9b99('0xa'),_0x38e7cc,_0x1bf66a[_0x9b99('0xe')][_0x9b99('0x10')]);return _0x303850(_0x1bf66a[_0x9b99('0xe')][_0x9b99('0x10')]);}else{logger[_0x9b99('0x11')](_0x9b99('0xa'),_0x38e7cc,_0x9b99('0xb'));_0x303850(_0x1bf66a['result'][_0x9b99('0x10')]);}})[_0x9b99('0x12')](function(_0x1f136){logger[_0x9b99('0xe')](_0x9b99('0xa'),_0x38e7cc,_0x1f136);_0x553c22(_0x1f136);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 2b6ec0d..b1f92f3 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 _0x7b27=['../../components/interaction/service','./cmCustomField.controller','get','isAuthenticated','/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x7b27,0x186));var _0x77b2=function(_0x178e3e,_0xd002c4){_0x178e3e=_0x178e3e-0x0;var _0x25066c=_0x7b27[_0x178e3e];return _0x25066c;};'use strict';var multer=require(_0x77b2('0x0'));var util=require('util');var path=require(_0x77b2('0x1'));var timeout=require(_0x77b2('0x2'));var express=require(_0x77b2('0x3'));var router=express[_0x77b2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x77b2('0x5'));var interaction=require(_0x77b2('0x6'));var config=require('../../config/environment');var controller=require(_0x77b2('0x7'));router[_0x77b2('0x8')]('/',auth[_0x77b2('0x9')](),controller['index']);router[_0x77b2('0x8')](_0x77b2('0xa'),auth[_0x77b2('0x9')](),controller[_0x77b2('0xb')]);router['post']('/',auth[_0x77b2('0x9')](),controller[_0x77b2('0xc')]);router[_0x77b2('0xd')](_0x77b2('0xa'),auth[_0x77b2('0x9')](),controller[_0x77b2('0xe')]);router[_0x77b2('0xf')](_0x77b2('0xa'),auth['isAuthenticated'](),controller[_0x77b2('0x10')]);module[_0x77b2('0x11')]=router; \ No newline at end of file +var _0x4c60=['path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','exports','multer','util'];(function(_0x5a3172,_0xc91375){var _0x5b1002=function(_0x4ceec7){while(--_0x4ceec7){_0x5a3172['push'](_0x5a3172['shift']());}};_0x5b1002(++_0xc91375);}(_0x4c60,0x166));var _0x04c6=function(_0x56830a,_0x5cca3b){_0x56830a=_0x56830a-0x0;var _0x1b21d1=_0x4c60[_0x56830a];return _0x1b21d1;};'use strict';var multer=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var path=require(_0x04c6('0x2'));var timeout=require(_0x04c6('0x3'));var express=require('express');var router=express[_0x04c6('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x04c6('0x5'));var config=require(_0x04c6('0x6'));var controller=require(_0x04c6('0x7'));router[_0x04c6('0x8')]('/',auth['isAuthenticated'](),controller[_0x04c6('0x9')]);router[_0x04c6('0x8')](_0x04c6('0xa'),auth[_0x04c6('0xb')](),controller[_0x04c6('0xc')]);router[_0x04c6('0xd')]('/',auth['isAuthenticated'](),controller[_0x04c6('0xe')]);router[_0x04c6('0xf')](_0x04c6('0xa'),auth[_0x04c6('0xb')](),controller[_0x04c6('0x10')]);router['delete'](_0x04c6('0xa'),auth[_0x04c6('0xb')](),controller['destroy']);module[_0x04c6('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 d16a424..ef596a7 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 _0xb788=['DATE','format','INTEGER','UNSIGNED','contactListQueue','sequelize','exports','STRING','BOOLEAN'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xb788,0xc2));var _0x8b78=function(_0x2d9e27,_0x5965b2){_0x2d9e27=_0x2d9e27-0x0;var _0xd35381=_0xb788[_0x2d9e27];return _0xd35381;};'use strict';var moment=require('moment');var Sequelize=require(_0x8b78('0x0'));module[_0x8b78('0x1')]={'phone':{'type':Sequelize[_0x8b78('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x8b78('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x8b78('0x4')],'defaultValue':moment()[_0x8b78('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x8b78('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8b78('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x8b78('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8b78('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x8b78('0x6')](0x2)[_0x8b78('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x8b78('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x8b78('0x6')],'unique':_0x8b78('0x8')},'ListId':{'type':Sequelize[_0x8b78('0x6')],'unique':_0x8b78('0x8')},'UserId':{'type':Sequelize[_0x8b78('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x8b78('0x8')},'CampaignId':{'type':Sequelize[_0x8b78('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8b78('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8b78('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9c9c=['STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports'];(function(_0x340964,_0x3127ea){var _0x237f14=function(_0x5b0a11){while(--_0x5b0a11){_0x340964['push'](_0x340964['shift']());}};_0x237f14(++_0x3127ea);}(_0x9c9c,0xc3));var _0xc9c9=function(_0x54b0f3,_0x1fe2f7){_0x54b0f3=_0x54b0f3-0x0;var _0x5ae957=_0x9c9c[_0x54b0f3];return _0x5ae957;};'use strict';var moment=require(_0xc9c9('0x0'));var Sequelize=require(_0xc9c9('0x1'));module[_0xc9c9('0x2')]={'phone':{'type':Sequelize[_0xc9c9('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xc9c9('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xc9c9('0x5')],'defaultValue':moment()[_0xc9c9('0x6')](_0xc9c9('0x7'))},'countbusyretry':{'type':Sequelize[_0xc9c9('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc9c9('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc9c9('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc9c9('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc9c9('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xc9c9('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xc9c9('0x8')],'unique':_0xc9c9('0xa')},'ListId':{'type':Sequelize[_0xc9c9('0x8')],'unique':_0xc9c9('0xa')},'UserId':{'type':Sequelize[_0xc9c9('0x8')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xc9c9('0xa')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0xc9c9('0x8')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc9c9('0x8')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc9c9('0x8')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 9396244..0a34873 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 _0xfb58=['calleridname','lastName','finally','getVoiceQueues','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','hopperIds','priority','scheduledAt','DESC','ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','Contact','Company','CmList','Queue','dialActive','outbound','getOpenContacts','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','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','../../mysqldb','sendStatus','status','json','offset','undefined','set','Content-Range','save','update','destroy','then','end','error','stack','index','map','CmHopper','rawAttributes','fieldName','type','key','model','name','keys','query','intersection','filters','concat','$and','$gt','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$overlap','$contains','$contained','$any','fields','attributes','length','hasOwnProperty','nolimit','limit','pick','filter','where','merge','VIRTUAL','options','count','includeAll','findAll','rows','show','params','find','catch','create','body','describe','CampaignId','VoiceQueue','VoiceQueueId','omit','dataValues','createdAt','state','statedesc','campaign','membername','user','UserId','deleted','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','firstName','isNil'];(function(_0x39fd11,_0x5d7883){var _0x302799=function(_0x4a0615){while(--_0x4a0615){_0x39fd11['push'](_0x39fd11['shift']());}};_0x302799(++_0x5d7883);}(_0xfb58,0x143));var _0x8fb5=function(_0x11c569,_0x210066){_0x11c569=_0x11c569-0x0;var _0x4306f0=_0xfb58[_0x11c569];return _0x4306f0;};'use strict';var emlformat=require(_0x8fb5('0x0'));var rimraf=require(_0x8fb5('0x1'));var zipdir=require(_0x8fb5('0x2'));var jsonpatch=require(_0x8fb5('0x3'));var rp=require('request-promise');var moment=require(_0x8fb5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8fb5('0x5'));var util=require('util');var path=require(_0x8fb5('0x6'));var sox=require('sox');var csv=require(_0x8fb5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8fb5('0x8'));var _=require('lodash');var squel=require(_0x8fb5('0x9'));var crypto=require('crypto');var jsforce=require(_0x8fb5('0xa'));var deskjs=require(_0x8fb5('0xb'));var toCsv=require(_0x8fb5('0x7'));var querystring=require('querystring');var Papa=require(_0x8fb5('0xc'));var Redis=require(_0x8fb5('0xd'));var authService=require(_0x8fb5('0xe'));var qs=require(_0x8fb5('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8fb5('0x10'));var logger=require(_0x8fb5('0x11'))(_0x8fb5('0x12'));var utils=require(_0x8fb5('0x13'));var config=require(_0x8fb5('0x14'));var licenseUtil=require(_0x8fb5('0x15'));var db=require(_0x8fb5('0x16'))['db'];function respondWithStatusCode(_0x318452,_0x534615){_0x534615=_0x534615||0xcc;return function(_0x5adbd0){if(_0x5adbd0){return _0x318452[_0x8fb5('0x17')](_0x534615);}return _0x318452[_0x8fb5('0x18')](_0x534615)['end']();};}function respondWithResult(_0x4a2003,_0x3b3c8a){_0x3b3c8a=_0x3b3c8a||0xc8;return function(_0x55cea1){if(_0x55cea1){return _0x4a2003['status'](_0x3b3c8a)[_0x8fb5('0x19')](_0x55cea1);}};}function respondWithFilteredResult(_0x2cb435,_0x2b54b0){return function(_0xfca943){if(_0xfca943){var _0x542d55=typeof _0x2b54b0[_0x8fb5('0x1a')]===_0x8fb5('0x1b')&&typeof _0x2b54b0['limit']===_0x8fb5('0x1b');var _0xa3b585=_0xfca943['count'];var _0x5b04ee=_0x542d55?0x0:_0x2b54b0[_0x8fb5('0x1a')];var _0xdee0b2=_0x542d55?_0xfca943['count']:_0x2b54b0[_0x8fb5('0x1a')]+_0x2b54b0['limit'];var _0x48e1b5;if(_0xdee0b2>=_0xa3b585){_0xdee0b2=_0xa3b585;_0x48e1b5=0xc8;}else{_0x48e1b5=0xce;}_0x2cb435[_0x8fb5('0x18')](_0x48e1b5);return _0x2cb435[_0x8fb5('0x1c')](_0x8fb5('0x1d'),_0x5b04ee+'-'+_0xdee0b2+'/'+_0xa3b585)[_0x8fb5('0x19')](_0xfca943);}return null;};}function patchUpdates(_0x3c144b){return function(_0x40f29f){try{jsonpatch['apply'](_0x40f29f,_0x3c144b,!![]);}catch(_0x337610){return BPromise['reject'](_0x337610);}return _0x40f29f[_0x8fb5('0x1e')]();};}function saveUpdates(_0x476e7c,_0x374470){return function(_0x514327){if(_0x514327){return _0x514327[_0x8fb5('0x1f')](_0x476e7c)['then'](function(_0x492c4e){return _0x492c4e;});}return null;};}function removeEntity(_0x57f6dc,_0x4f4687){return function(_0x28348f){if(_0x28348f){return _0x28348f[_0x8fb5('0x20')]()[_0x8fb5('0x21')](function(){_0x57f6dc[_0x8fb5('0x18')](0xcc)[_0x8fb5('0x22')]();});}};}function handleEntityNotFound(_0x292fad,_0x40ac62){return function(_0x55bf33){if(!_0x55bf33){_0x292fad[_0x8fb5('0x17')](0x194);}return _0x55bf33;};}function handleError(_0x3957b8,_0xa34579){_0xa34579=_0xa34579||0x1f4;return function(_0x55b4ed){logger[_0x8fb5('0x23')](_0x55b4ed[_0x8fb5('0x24')]);if(_0x55b4ed['name']){delete _0x55b4ed['name'];}_0x3957b8['status'](_0xa34579)['send'](_0x55b4ed);};}exports[_0x8fb5('0x25')]=function(_0x2bec33,_0x15f607){var _0x16ebb5={},_0x3dc27e={},_0xa94434={'count':0x0,'rows':[]};var _0x2a3ddf=_[_0x8fb5('0x26')](db[_0x8fb5('0x27')][_0x8fb5('0x28')],function(_0x334f7a){return{'name':_0x334f7a[_0x8fb5('0x29')],'type':_0x334f7a[_0x8fb5('0x2a')][_0x8fb5('0x2b')]};});_0x3dc27e[_0x8fb5('0x2c')]=_['map'](_0x2a3ddf,_0x8fb5('0x2d'));_0x3dc27e['query']=_[_0x8fb5('0x2e')](_0x2bec33[_0x8fb5('0x2f')]);_0x3dc27e['filters']=_[_0x8fb5('0x30')](_0x3dc27e[_0x8fb5('0x2c')],_0x3dc27e[_0x8fb5('0x2f')]);_0x3dc27e[_0x8fb5('0x31')]=_[_0x8fb5('0x32')](_0x3dc27e[_0x8fb5('0x31')],[_0x8fb5('0x33'),'$or',_0x8fb5('0x34'),_0x8fb5('0x35'),'$lt',_0x8fb5('0x36'),_0x8fb5('0x37'),_0x8fb5('0x38'),_0x8fb5('0x39'),_0x8fb5('0x3a'),_0x8fb5('0x3b'),_0x8fb5('0x3c'),_0x8fb5('0x3d'),_0x8fb5('0x3e'),_0x8fb5('0x3f'),_0x8fb5('0x40'),'$notILike','$like',_0x8fb5('0x41'),_0x8fb5('0x42'),_0x8fb5('0x43'),_0x8fb5('0x44')]);_0x16ebb5['attributes']=_['intersection'](_0x3dc27e[_0x8fb5('0x2c')],qs[_0x8fb5('0x45')](_0x2bec33[_0x8fb5('0x2f')]['fields']));_0x16ebb5[_0x8fb5('0x46')]=_0x16ebb5[_0x8fb5('0x46')][_0x8fb5('0x47')]?_0x16ebb5[_0x8fb5('0x46')]:_0x3dc27e['model'];if(!_0x2bec33[_0x8fb5('0x2f')][_0x8fb5('0x48')](_0x8fb5('0x49'))){_0x16ebb5[_0x8fb5('0x4a')]=qs['limit'](_0x2bec33[_0x8fb5('0x2f')]['limit']);_0x16ebb5[_0x8fb5('0x1a')]=qs[_0x8fb5('0x1a')](_0x2bec33[_0x8fb5('0x2f')][_0x8fb5('0x1a')]);}_0x16ebb5['order']=qs['sort'](_0x2bec33[_0x8fb5('0x2f')]['sort']);_0x16ebb5['where']=qs['filters'](_[_0x8fb5('0x4b')](_0x2bec33[_0x8fb5('0x2f')],_0x3dc27e[_0x8fb5('0x31')]),_0x2a3ddf);if(_0x2bec33['query'][_0x8fb5('0x4c')]){_0x16ebb5[_0x8fb5('0x4d')]=_[_0x8fb5('0x4e')](_0x16ebb5['where'],{'$or':_[_0x8fb5('0x26')](_0x2a3ddf,function(_0xfea239){if(_0xfea239[_0x8fb5('0x2a')]!==_0x8fb5('0x4f')){var _0x5608b4={};_0x5608b4[_0xfea239[_0x8fb5('0x2d')]]={'$like':'%'+_0x2bec33[_0x8fb5('0x2f')][_0x8fb5('0x4c')]+'%'};return _0x5608b4;}})});}_0x16ebb5=_[_0x8fb5('0x4e')]({},_0x16ebb5,_0x2bec33[_0x8fb5('0x50')]);var _0x308d65={'where':_0x16ebb5[_0x8fb5('0x4d')]};return db[_0x8fb5('0x27')]['count'](_0x308d65)[_0x8fb5('0x21')](function(_0x193327){_0xa94434[_0x8fb5('0x51')]=_0x193327;if(_0x2bec33['query'][_0x8fb5('0x52')]){_0x16ebb5['include']=[{'all':!![]}];}return db[_0x8fb5('0x27')][_0x8fb5('0x53')](_0x16ebb5);})[_0x8fb5('0x21')](function(_0x64d32d){_0xa94434[_0x8fb5('0x54')]=_0x64d32d;return _0xa94434;})[_0x8fb5('0x21')](respondWithFilteredResult(_0x15f607,_0x16ebb5))['catch'](handleError(_0x15f607,null));};exports[_0x8fb5('0x55')]=function(_0x367e77,_0x123678){var _0x2f3cfe={'raw':!![],'where':{'id':_0x367e77[_0x8fb5('0x56')]['id']}},_0x1b3c70={};_0x1b3c70['model']=_[_0x8fb5('0x2e')](db['CmHopper']['rawAttributes']);_0x1b3c70['query']=_[_0x8fb5('0x2e')](_0x367e77[_0x8fb5('0x2f')]);_0x1b3c70[_0x8fb5('0x31')]=_[_0x8fb5('0x30')](_0x1b3c70[_0x8fb5('0x2c')],_0x1b3c70[_0x8fb5('0x2f')]);_0x2f3cfe[_0x8fb5('0x46')]=_['intersection'](_0x1b3c70[_0x8fb5('0x2c')],qs['fields'](_0x367e77['query']['fields']));_0x2f3cfe[_0x8fb5('0x46')]=_0x2f3cfe[_0x8fb5('0x46')]['length']?_0x2f3cfe[_0x8fb5('0x46')]:_0x1b3c70[_0x8fb5('0x2c')];if(_0x367e77[_0x8fb5('0x2f')][_0x8fb5('0x52')]){_0x2f3cfe['include']=[{'all':!![]}];}_0x2f3cfe=_[_0x8fb5('0x4e')]({},_0x2f3cfe,_0x367e77[_0x8fb5('0x50')]);return db['CmHopper'][_0x8fb5('0x57')](_0x2f3cfe)[_0x8fb5('0x21')](handleEntityNotFound(_0x123678,null))[_0x8fb5('0x21')](respondWithResult(_0x123678,null))[_0x8fb5('0x58')](handleError(_0x123678,null));};exports[_0x8fb5('0x59')]=function(_0x19c0ea,_0x31a34b){return db[_0x8fb5('0x27')][_0x8fb5('0x59')](_0x19c0ea[_0x8fb5('0x5a')],{})[_0x8fb5('0x21')](respondWithResult(_0x31a34b,0xc9))[_0x8fb5('0x58')](handleError(_0x31a34b,null));};exports['update']=function(_0x834634,_0x476332){if(_0x834634[_0x8fb5('0x5a')]['id']){delete _0x834634[_0x8fb5('0x5a')]['id'];}return db[_0x8fb5('0x27')][_0x8fb5('0x57')]({'where':{'id':_0x834634['params']['id']}})[_0x8fb5('0x21')](handleEntityNotFound(_0x476332,null))[_0x8fb5('0x21')](saveUpdates(_0x834634[_0x8fb5('0x5a')],null))[_0x8fb5('0x21')](respondWithResult(_0x476332,null))[_0x8fb5('0x58')](handleError(_0x476332,null));};exports[_0x8fb5('0x5b')]=function(_0x313b85,_0xaa881b){return db[_0x8fb5('0x27')][_0x8fb5('0x5b')]()[_0x8fb5('0x21')](respondWithResult(_0xaa881b,null))[_0x8fb5('0x58')](handleError(_0xaa881b,null));};exports[_0x8fb5('0x20')]=function(_0xe87fdb,_0x5973db){var _0x539fe6;return db[_0x8fb5('0x27')][_0x8fb5('0x57')]({'where':{'id':_0xe87fdb['params']['id']}})['then'](handleEntityNotFound(_0x5973db,null))[_0x8fb5('0x21')](function(_0x552466){if(_0x552466){return _0x552466['destroy']()[_0x8fb5('0x21')](function(_0x52b05d){return _0x52b05d;});}})[_0x8fb5('0x21')](function(_0xe3d142){_0x539fe6=_0xe3d142;if(_0xe3d142){if(_0xe3d142['VoiceQueueId']||_0xe3d142[_0x8fb5('0x5c')]){return db[_0xe3d142['VoiceQueueId']?_0x8fb5('0x5d'):'Campaign'][_0x8fb5('0x57')]({'where':{'id':_0xe3d142[_0x8fb5('0x5e')]?_0xe3d142[_0x8fb5('0x5e')]:_0xe3d142[_0x8fb5('0x5c')]},'attributes':['id',_0x8fb5('0x2d')],'raw':!![]});}}})[_0x8fb5('0x21')](function(_0x1dc25b){var _0x5c332b={};if(_0x1dc25b){_[_0x8fb5('0x4e')](_0x5c332b,_[_0x8fb5('0x5f')](_0x539fe6[_0x8fb5('0x60')],[_0x8fb5('0x61'),'updatedAt','id']));_0x5c332b[_0x8fb5('0x62')]=0x15;_0x5c332b[_0x8fb5('0x63')]='deleted';_0x5c332b[_0x8fb5('0x64')]=_0x1dc25b['name'];_0x5c332b[_0x8fb5('0x65')]=_0xe87fdb[_0x8fb5('0x66')][_0x8fb5('0x2d')];_0x5c332b[_0x8fb5('0x67')]=_0xe87fdb[_0x8fb5('0x66')]['id'];_0x5c332b[_0x8fb5('0x68')]=!![];_0x5c332b['deletedat']=moment()[_0x8fb5('0x69')](_0x8fb5('0x6a'));_0x5c332b[_0x8fb5('0x6b')]=_0x539fe6[_0x8fb5('0x6c')];_0x5c332b[_0x8fb5('0x6d')]=_0x539fe6[_0x8fb5('0x5e')]?_0x8fb5('0x6e'):_0x8fb5('0x6f');return db[_0x8fb5('0x70')][_0x8fb5('0x57')]({'where':{'id':_0x5c332b['ContactId']},'attributes':[_0x8fb5('0x71'),'lastName']})[_0x8fb5('0x21')](function(_0x1d61d1){if(!_[_0x8fb5('0x72')](_0x5973db)&&!_['isNil'](_0x1d61d1[_0x8fb5('0x71')])){_0x5c332b[_0x8fb5('0x73')]=_0x1d61d1['firstName'];if(!_[_0x8fb5('0x72')](_0x1d61d1[_0x8fb5('0x74')])){_0x5c332b[_0x8fb5('0x73')]+='\x20'+_0x1d61d1['lastName'];}}})[_0x8fb5('0x75')](function(){return db['CmHopperFinal'][_0x8fb5('0x59')](_0x5c332b);});}})['then'](function(){return _0x5973db[_0x8fb5('0x18')](0xcc)['end']();})[_0x8fb5('0x58')](handleError(_0x5973db,null));};exports['getPreview']=function(_0x2d798d,_0x47f19d,_0x5d2fe1){var _0x4e8dcd=[];return db[_0x8fb5('0x70')][_0x8fb5('0x5b')]()[_0x8fb5('0x21')](function(_0x57c0ef){_0x4e8dcd=_[_0x8fb5('0x2e')](_0x57c0ef);return _0x2d798d[_0x8fb5('0x66')][_0x8fb5('0x76')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x8fb5('0x77')},'attributes':['id',_0x8fb5('0x78'),_0x8fb5('0x79')],'raw':!![]});})[_0x8fb5('0x21')](function(_0x43ca69){if(_0x43ca69&&_0x43ca69['length']){return db[_0x8fb5('0x7a')][_0x8fb5('0x7b')](function(_0x57d8c8){var _0x1b66d6={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x8fb5('0x69')](_0x8fb5('0x6a'))},'VoiceQueueId':{'$in':_[_0x8fb5('0x26')](_0x43ca69,'id')},'$or':[{'UserId':null},{'UserId':_0x2d798d[_0x8fb5('0x66')]['id']}]};var _0x3b4381={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x43ca69)[_0x8fb5('0x4c')]([_0x8fb5('0x79'),0x0])[_0x8fb5('0x26')]('id')[_0x8fb5('0x7c')]()},'$or':[{'UserId':null},{'UserId':_0x2d798d[_0x8fb5('0x66')]['id']}]};var _0x5b4384={'$or':[_0x1b66d6,_0x3b4381]};var _0x44c2d0=[];if(_0x2d798d[_0x8fb5('0x5a')][_0x8fb5('0x7d')]&&_0x2d798d[_0x8fb5('0x5a')][_0x8fb5('0x7d')]===_0x8fb5('0x7e')){if(!_['isEmpty'](_0x2d798d['body'][_0x8fb5('0x7f')])){_0x5b4384['id']={'$in':_0x2d798d[_0x8fb5('0x5a')][_0x8fb5('0x7f')]};}_0x44c2d0=[[_0x8fb5('0x80'),'ASC'],[_0x8fb5('0x81'),_0x43ca69[0x0][_0x8fb5('0x78')]==='ASC'?_0x8fb5('0x82'):_0x8fb5('0x83')],db[_0x8fb5('0x7a')][_0x8fb5('0x84')](_0x8fb5('0x85')),['id','DESC']];}else{if(!_[_0x8fb5('0x86')](_0x2d798d[_0x8fb5('0x5a')][_0x8fb5('0x7f')])){_0x5b4384['id']={'$notIn':_0x2d798d['body']['hopperIds']};}_0x44c2d0=[[_0x8fb5('0x80'),_0x8fb5('0x82')],[_0x8fb5('0x81'),_0x43ca69[0x0]['dialOrderByScheduledAt']],db[_0x8fb5('0x7a')][_0x8fb5('0x84')](_0x8fb5('0x87')),['id','ASC']];}return db['CmHopper'][_0x8fb5('0x88')]({'attributes':['id',_0x8fb5('0x89'),'recallme'],'where':_0x5b4384,'order':_0x44c2d0,'transaction':_0x57d8c8,'lock':_0x57d8c8[_0x8fb5('0x8a')]['UPDATE'],'include':[{'model':db[_0x8fb5('0x70')],'as':_0x8fb5('0x8b'),'attributes':_0x4e8dcd,'include':[{'model':db['CmCompany'],'as':_0x8fb5('0x8c'),'attributes':['id',_0x8fb5('0x2d')]}]},{'model':db[_0x8fb5('0x8d')],'as':'List','attributes':['id','name']},{'model':db[_0x8fb5('0x5d')],'as':_0x8fb5('0x8e'),'attributes':['id',_0x8fb5('0x2d'),_0x8fb5('0x8f')]}]})['then'](function(_0x117d58){if(_0x117d58){return _0x117d58['update']({'UserId':_0x2d798d[_0x8fb5('0x66')]['id']},{'transaction':_0x57d8c8});}});});}})[_0x8fb5('0x21')](handleEntityNotFound(_0x47f19d,null))[_0x8fb5('0x21')](respondWithResult(_0x47f19d,null))[_0x8fb5('0x58')](handleError(_0x47f19d,null));};exports['getOpenContacts']=function(_0x35dd61,_0x2673b4,_0x4d272e){return _0x35dd61[_0x8fb5('0x66')][_0x8fb5('0x76')]({'where':{'type':_0x8fb5('0x90'),'dialActive':!![],'dialMethod':_0x8fb5('0x77')},'attributes':['id'],'raw':!![]})[_0x8fb5('0x21')](function(_0x85a5ff){if(_0x85a5ff&&_0x85a5ff[_0x8fb5('0x47')]){return db[_0x8fb5('0x27')][_0x8fb5('0x51')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x8fb5('0x6a'))},'VoiceQueueId':{'$in':_[_0x8fb5('0x26')](_0x85a5ff,'id')},'$or':[{'UserId':null},{'UserId':_0x35dd61['user']['id']}]}});}return 0x0;})[_0x8fb5('0x21')](function(_0x28072a){if(!_[_0x8fb5('0x72')](_0x28072a)&&_['isNumber'](_0x28072a)){return _0x2673b4[_0x8fb5('0x18')](0xc8)[_0x8fb5('0x19')]({'contacts':_0x28072a});}else{logger[_0x8fb5('0x23')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x8fb5('0x91'),0x194,'entity\x20not\x20found');_0x2673b4[_0x8fb5('0x17')](0x194);}})['catch'](handleError(_0x2673b4,null));}; \ No newline at end of file +var _0x30fc=['CmHopper','rawAttributes','type','key','model','query','filters','intersection','concat','$and','$or','$gt','$gte','$lte','$between','$notBetween','$notIn','$like','$notLike','$overlap','$contains','$any','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','length','include','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','omit','dataValues','createdAt','updatedAt','state','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','end','getPreview','getVoiceQueues','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','direction','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','CmContact','Contact','CmCompany','Company','List','Queue','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','eml-format','rimraf','fast-json-patch','request-promise','bluebird','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','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map'];(function(_0x5e9d69,_0x5c493b){var _0x12916b=function(_0x1a228c){while(--_0x1a228c){_0x5e9d69['push'](_0x5e9d69['shift']());}};_0x12916b(++_0x5c493b);}(_0x30fc,0xfa));var _0xc30f=function(_0x4f1946,_0x2d29f4){_0x4f1946=_0x4f1946-0x0;var _0xf6b11a=_0x30fc[_0x4f1946];return _0xf6b11a;};'use strict';var emlformat=require(_0xc30f('0x0'));var rimraf=require(_0xc30f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc30f('0x2'));var rp=require(_0xc30f('0x3'));var moment=require('moment');var BPromise=require(_0xc30f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc30f('0x5'));var sox=require(_0xc30f('0x6'));var csv=require(_0xc30f('0x7'));var ejs=require(_0xc30f('0x8'));var fs=require('fs');var fs_extra=require(_0xc30f('0x9'));var _=require(_0xc30f('0xa'));var squel=require(_0xc30f('0xb'));var crypto=require(_0xc30f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc30f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc30f('0xe'));var Papa=require(_0xc30f('0xf'));var Redis=require(_0xc30f('0x10'));var authService=require(_0xc30f('0x11'));var qs=require(_0xc30f('0x12'));var as=require(_0xc30f('0x13'));var hardwareService=require(_0xc30f('0x14'));var logger=require(_0xc30f('0x15'))(_0xc30f('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc30f('0x17'))['db'];function respondWithStatusCode(_0x368ddf,_0x4ca444){_0x4ca444=_0x4ca444||0xcc;return function(_0x239c39){if(_0x239c39){return _0x368ddf[_0xc30f('0x18')](_0x4ca444);}return _0x368ddf['status'](_0x4ca444)['end']();};}function respondWithResult(_0x214c1f,_0x5c5370){_0x5c5370=_0x5c5370||0xc8;return function(_0xc183b8){if(_0xc183b8){return _0x214c1f['status'](_0x5c5370)[_0xc30f('0x19')](_0xc183b8);}};}function respondWithFilteredResult(_0x597609,_0x142d7f){return function(_0x47018e){if(_0x47018e){var _0xc8ebe3=typeof _0x142d7f[_0xc30f('0x1a')]===_0xc30f('0x1b')&&typeof _0x142d7f[_0xc30f('0x1c')]===_0xc30f('0x1b');var _0x25c82c=_0x47018e[_0xc30f('0x1d')];var _0x2cc86f=_0xc8ebe3?0x0:_0x142d7f[_0xc30f('0x1a')];var _0x42be8f=_0xc8ebe3?_0x47018e[_0xc30f('0x1d')]:_0x142d7f[_0xc30f('0x1a')]+_0x142d7f[_0xc30f('0x1c')];var _0x32ea68;if(_0x42be8f>=_0x25c82c){_0x42be8f=_0x25c82c;_0x32ea68=0xc8;}else{_0x32ea68=0xce;}_0x597609[_0xc30f('0x1e')](_0x32ea68);return _0x597609[_0xc30f('0x1f')](_0xc30f('0x20'),_0x2cc86f+'-'+_0x42be8f+'/'+_0x25c82c)['json'](_0x47018e);}return null;};}function patchUpdates(_0x50b38c){return function(_0x521a30){try{jsonpatch[_0xc30f('0x21')](_0x521a30,_0x50b38c,!![]);}catch(_0x5b0ab6){return BPromise[_0xc30f('0x22')](_0x5b0ab6);}return _0x521a30[_0xc30f('0x23')]();};}function saveUpdates(_0x3a5dbb,_0x517874){return function(_0xc3d24){if(_0xc3d24){return _0xc3d24[_0xc30f('0x24')](_0x3a5dbb)[_0xc30f('0x25')](function(_0xd0830e){return _0xd0830e;});}return null;};}function removeEntity(_0x1df4bf,_0x163752){return function(_0x33b899){if(_0x33b899){return _0x33b899[_0xc30f('0x26')]()['then'](function(){_0x1df4bf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f4f6b,_0x3f6677){return function(_0x3ab05f){if(!_0x3ab05f){_0x1f4f6b[_0xc30f('0x18')](0x194);}return _0x3ab05f;};}function handleError(_0x586f63,_0x3c37a4){_0x3c37a4=_0x3c37a4||0x1f4;return function(_0x3d9cdc){logger[_0xc30f('0x27')](_0x3d9cdc[_0xc30f('0x28')]);if(_0x3d9cdc[_0xc30f('0x29')]){delete _0x3d9cdc['name'];}_0x586f63['status'](_0x3c37a4)['send'](_0x3d9cdc);};}exports[_0xc30f('0x2a')]=function(_0x4c26fd,_0x433295){var _0x478de2={},_0x3cb105={},_0x2793a2={'count':0x0,'rows':[]};var _0x4a8346=_[_0xc30f('0x2b')](db[_0xc30f('0x2c')][_0xc30f('0x2d')],function(_0x58a559){return{'name':_0x58a559['fieldName'],'type':_0x58a559[_0xc30f('0x2e')][_0xc30f('0x2f')]};});_0x3cb105[_0xc30f('0x30')]=_[_0xc30f('0x2b')](_0x4a8346,_0xc30f('0x29'));_0x3cb105[_0xc30f('0x31')]=_['keys'](_0x4c26fd[_0xc30f('0x31')]);_0x3cb105[_0xc30f('0x32')]=_[_0xc30f('0x33')](_0x3cb105[_0xc30f('0x30')],_0x3cb105[_0xc30f('0x31')]);_0x3cb105[_0xc30f('0x32')]=_[_0xc30f('0x34')](_0x3cb105['filters'],[_0xc30f('0x35'),_0xc30f('0x36'),_0xc30f('0x37'),_0xc30f('0x38'),'$lt',_0xc30f('0x39'),'$ne','$eq','$not',_0xc30f('0x3a'),_0xc30f('0x3b'),'$in',_0xc30f('0x3c'),_0xc30f('0x3d'),_0xc30f('0x3e'),'$iLike','$notILike',_0xc30f('0x3d'),_0xc30f('0x3f'),_0xc30f('0x40'),'$contained',_0xc30f('0x41')]);_0x478de2[_0xc30f('0x42')]=_[_0xc30f('0x33')](_0x3cb105[_0xc30f('0x30')],qs[_0xc30f('0x43')](_0x4c26fd[_0xc30f('0x31')][_0xc30f('0x43')]));_0x478de2['attributes']=_0x478de2['attributes']['length']?_0x478de2[_0xc30f('0x42')]:_0x3cb105[_0xc30f('0x30')];if(!_0x4c26fd[_0xc30f('0x31')][_0xc30f('0x44')](_0xc30f('0x45'))){_0x478de2[_0xc30f('0x1c')]=qs[_0xc30f('0x1c')](_0x4c26fd[_0xc30f('0x31')][_0xc30f('0x1c')]);_0x478de2[_0xc30f('0x1a')]=qs[_0xc30f('0x1a')](_0x4c26fd[_0xc30f('0x31')][_0xc30f('0x1a')]);}_0x478de2['order']=qs[_0xc30f('0x46')](_0x4c26fd[_0xc30f('0x31')]['sort']);_0x478de2[_0xc30f('0x47')]=qs[_0xc30f('0x32')](_[_0xc30f('0x48')](_0x4c26fd[_0xc30f('0x31')],_0x3cb105[_0xc30f('0x32')]),_0x4a8346);if(_0x4c26fd[_0xc30f('0x31')][_0xc30f('0x49')]){_0x478de2[_0xc30f('0x47')]=_[_0xc30f('0x4a')](_0x478de2[_0xc30f('0x47')],{'$or':_[_0xc30f('0x2b')](_0x4a8346,function(_0x143e28){if(_0x143e28[_0xc30f('0x2e')]!==_0xc30f('0x4b')){var _0x5d5d6e={};_0x5d5d6e[_0x143e28[_0xc30f('0x29')]]={'$like':'%'+_0x4c26fd[_0xc30f('0x31')]['filter']+'%'};return _0x5d5d6e;}})});}_0x478de2=_['merge']({},_0x478de2,_0x4c26fd[_0xc30f('0x4c')]);var _0x241314={'where':_0x478de2['where']};return db[_0xc30f('0x2c')][_0xc30f('0x1d')](_0x241314)[_0xc30f('0x25')](function(_0x49c0b7){_0x2793a2[_0xc30f('0x1d')]=_0x49c0b7;if(_0x4c26fd[_0xc30f('0x31')][_0xc30f('0x4d')]){_0x478de2['include']=[{'all':!![]}];}return db[_0xc30f('0x2c')]['findAll'](_0x478de2);})['then'](function(_0xa19e04){_0x2793a2[_0xc30f('0x4e')]=_0xa19e04;return _0x2793a2;})['then'](respondWithFilteredResult(_0x433295,_0x478de2))[_0xc30f('0x4f')](handleError(_0x433295,null));};exports[_0xc30f('0x50')]=function(_0x1602bb,_0x19572e){var _0x28ae7c={'raw':!![],'where':{'id':_0x1602bb[_0xc30f('0x51')]['id']}},_0x135458={};_0x135458[_0xc30f('0x30')]=_['keys'](db['CmHopper']['rawAttributes']);_0x135458[_0xc30f('0x31')]=_[_0xc30f('0x52')](_0x1602bb[_0xc30f('0x31')]);_0x135458[_0xc30f('0x32')]=_[_0xc30f('0x33')](_0x135458[_0xc30f('0x30')],_0x135458['query']);_0x28ae7c['attributes']=_[_0xc30f('0x33')](_0x135458[_0xc30f('0x30')],qs[_0xc30f('0x43')](_0x1602bb[_0xc30f('0x31')][_0xc30f('0x43')]));_0x28ae7c[_0xc30f('0x42')]=_0x28ae7c[_0xc30f('0x42')][_0xc30f('0x53')]?_0x28ae7c['attributes']:_0x135458[_0xc30f('0x30')];if(_0x1602bb[_0xc30f('0x31')][_0xc30f('0x4d')]){_0x28ae7c[_0xc30f('0x54')]=[{'all':!![]}];}_0x28ae7c=_[_0xc30f('0x4a')]({},_0x28ae7c,_0x1602bb[_0xc30f('0x4c')]);return db[_0xc30f('0x2c')][_0xc30f('0x55')](_0x28ae7c)['then'](handleEntityNotFound(_0x19572e,null))[_0xc30f('0x25')](respondWithResult(_0x19572e,null))[_0xc30f('0x4f')](handleError(_0x19572e,null));};exports[_0xc30f('0x56')]=function(_0x4f45f6,_0x85e40a){return db[_0xc30f('0x2c')]['create'](_0x4f45f6[_0xc30f('0x57')],{})[_0xc30f('0x25')](respondWithResult(_0x85e40a,0xc9))['catch'](handleError(_0x85e40a,null));};exports['update']=function(_0x2fb1aa,_0x3c0ee6){if(_0x2fb1aa[_0xc30f('0x57')]['id']){delete _0x2fb1aa['body']['id'];}return db[_0xc30f('0x2c')][_0xc30f('0x55')]({'where':{'id':_0x2fb1aa[_0xc30f('0x51')]['id']}})[_0xc30f('0x25')](handleEntityNotFound(_0x3c0ee6,null))[_0xc30f('0x25')](saveUpdates(_0x2fb1aa[_0xc30f('0x57')],null))[_0xc30f('0x25')](respondWithResult(_0x3c0ee6,null))['catch'](handleError(_0x3c0ee6,null));};exports['describe']=function(_0x2fac4c,_0x163972){return db[_0xc30f('0x2c')][_0xc30f('0x58')]()[_0xc30f('0x25')](respondWithResult(_0x163972,null))[_0xc30f('0x4f')](handleError(_0x163972,null));};exports[_0xc30f('0x26')]=function(_0x5967bf,_0x32808b){var _0x5962a1;return db[_0xc30f('0x2c')][_0xc30f('0x55')]({'where':{'id':_0x5967bf['params']['id']}})[_0xc30f('0x25')](handleEntityNotFound(_0x32808b,null))['then'](function(_0x4275c0){if(_0x4275c0){return _0x4275c0[_0xc30f('0x26')]()[_0xc30f('0x25')](function(_0x3e4fee){return _0x3e4fee;});}})[_0xc30f('0x25')](function(_0x2df82d){_0x5962a1=_0x2df82d;if(_0x2df82d){if(_0x2df82d[_0xc30f('0x59')]||_0x2df82d[_0xc30f('0x5a')]){return db[_0x2df82d[_0xc30f('0x59')]?_0xc30f('0x5b'):'Campaign'][_0xc30f('0x55')]({'where':{'id':_0x2df82d[_0xc30f('0x59')]?_0x2df82d[_0xc30f('0x59')]:_0x2df82d['CampaignId']},'attributes':['id',_0xc30f('0x29')],'raw':!![]});}}})[_0xc30f('0x25')](function(_0x3ab6cf){var _0xf3218d={};if(_0x3ab6cf){_[_0xc30f('0x4a')](_0xf3218d,_[_0xc30f('0x5c')](_0x5962a1[_0xc30f('0x5d')],[_0xc30f('0x5e'),_0xc30f('0x5f'),'id']));_0xf3218d[_0xc30f('0x60')]=0x15;_0xf3218d['statedesc']=_0xc30f('0x61');_0xf3218d[_0xc30f('0x62')]=_0x3ab6cf['name'];_0xf3218d[_0xc30f('0x63')]=_0x5967bf[_0xc30f('0x64')]['name'];_0xf3218d[_0xc30f('0x65')]=_0x5967bf[_0xc30f('0x64')]['id'];_0xf3218d[_0xc30f('0x61')]=!![];_0xf3218d[_0xc30f('0x66')]=moment()[_0xc30f('0x67')](_0xc30f('0x68'));_0xf3218d[_0xc30f('0x69')]=_0x5962a1[_0xc30f('0x6a')];_0xf3218d[_0xc30f('0x6b')]=_0x5962a1[_0xc30f('0x59')]?_0xc30f('0x6c'):'ivr';return db['CmContact'][_0xc30f('0x55')]({'where':{'id':_0xf3218d[_0xc30f('0x6d')]},'attributes':[_0xc30f('0x6e'),_0xc30f('0x6f')]})[_0xc30f('0x25')](function(_0x1c7943){if(!_['isNil'](_0x32808b)&&!_[_0xc30f('0x70')](_0x1c7943[_0xc30f('0x6e')])){_0xf3218d[_0xc30f('0x71')]=_0x1c7943[_0xc30f('0x6e')];if(!_['isNil'](_0x1c7943['lastName'])){_0xf3218d[_0xc30f('0x71')]+='\x20'+_0x1c7943[_0xc30f('0x6f')];}}})[_0xc30f('0x72')](function(){return db[_0xc30f('0x73')][_0xc30f('0x56')](_0xf3218d);});}})[_0xc30f('0x25')](function(){return _0x32808b['status'](0xcc)[_0xc30f('0x74')]();})[_0xc30f('0x4f')](handleError(_0x32808b,null));};exports[_0xc30f('0x75')]=function(_0x341e07,_0x34ab48,_0x410817){var _0x3c31fd=[];return db['CmContact'][_0xc30f('0x58')]()[_0xc30f('0x25')](function(_0x39a270){_0x3c31fd=_['keys'](_0x39a270);return _0x341e07[_0xc30f('0x64')][_0xc30f('0x76')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xc30f('0x77')},'attributes':['id',_0xc30f('0x78'),_0xc30f('0x79')],'raw':!![]});})[_0xc30f('0x25')](function(_0x2e8d65){if(_0x2e8d65&&_0x2e8d65[_0xc30f('0x53')]){return db[_0xc30f('0x7a')]['transaction'](function(_0x3801cc){var _0x2fb066={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xc30f('0x68'))},'VoiceQueueId':{'$in':_[_0xc30f('0x2b')](_0x2e8d65,'id')},'$or':[{'UserId':null},{'UserId':_0x341e07['user']['id']}]};var _0x416540={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x2e8d65)['filter'](['dialPreviewAutoRecallMe',0x0])['map']('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x341e07[_0xc30f('0x64')]['id']}]};var _0x314d4b={'$or':[_0x2fb066,_0x416540]};var _0x2dc75d=[];if(_0x341e07[_0xc30f('0x57')]['direction']&&_0x341e07[_0xc30f('0x57')][_0xc30f('0x7b')]==='prev'){if(!_[_0xc30f('0x7c')](_0x341e07[_0xc30f('0x57')][_0xc30f('0x7d')])){_0x314d4b['id']={'$in':_0x341e07[_0xc30f('0x57')]['hopperIds']};}_0x2dc75d=[[_0xc30f('0x7e'),_0xc30f('0x7f')],[_0xc30f('0x80'),_0x2e8d65[0x0][_0xc30f('0x78')]==='ASC'?_0xc30f('0x81'):_0xc30f('0x7f')],db[_0xc30f('0x7a')][_0xc30f('0x82')](_0xc30f('0x83')),['id',_0xc30f('0x81')]];}else{if(!_[_0xc30f('0x7c')](_0x341e07[_0xc30f('0x57')][_0xc30f('0x7d')])){_0x314d4b['id']={'$notIn':_0x341e07[_0xc30f('0x57')][_0xc30f('0x7d')]};}_0x2dc75d=[[_0xc30f('0x7e'),'DESC'],[_0xc30f('0x80'),_0x2e8d65[0x0][_0xc30f('0x78')]],db[_0xc30f('0x7a')]['literal'](_0xc30f('0x84')),['id',_0xc30f('0x7f')]];}return db[_0xc30f('0x2c')][_0xc30f('0x85')]({'attributes':['id',_0xc30f('0x86'),_0xc30f('0x87')],'where':_0x314d4b,'order':_0x2dc75d,'transaction':_0x3801cc,'lock':_0x3801cc[_0xc30f('0x88')][_0xc30f('0x89')],'include':[{'model':db[_0xc30f('0x8a')],'as':_0xc30f('0x8b'),'attributes':_0x3c31fd,'include':[{'model':db[_0xc30f('0x8c')],'as':_0xc30f('0x8d'),'attributes':['id',_0xc30f('0x29')]}]},{'model':db['CmList'],'as':_0xc30f('0x8e'),'attributes':['id',_0xc30f('0x29')]},{'model':db[_0xc30f('0x5b')],'as':_0xc30f('0x8f'),'attributes':['id','name','dialActive']}]})[_0xc30f('0x25')](function(_0x1d06ef){if(_0x1d06ef){return _0x1d06ef[_0xc30f('0x24')]({'UserId':_0x341e07[_0xc30f('0x64')]['id']},{'transaction':_0x3801cc});}});});}})[_0xc30f('0x25')](handleEntityNotFound(_0x34ab48,null))[_0xc30f('0x25')](respondWithResult(_0x34ab48,null))[_0xc30f('0x4f')](handleError(_0x34ab48,null));};exports['getOpenContacts']=function(_0x5cac82,_0x2cc0e9,_0x5581e4){return _0x5cac82[_0xc30f('0x64')][_0xc30f('0x76')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xc30f('0x77')},'attributes':['id'],'raw':!![]})[_0xc30f('0x25')](function(_0x234327){if(_0x234327&&_0x234327[_0xc30f('0x53')]){return db[_0xc30f('0x2c')][_0xc30f('0x1d')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xc30f('0x68'))},'VoiceQueueId':{'$in':_[_0xc30f('0x2b')](_0x234327,'id')},'$or':[{'UserId':null},{'UserId':_0x5cac82['user']['id']}]}});}return 0x0;})[_0xc30f('0x25')](function(_0x5da71f){if(!_[_0xc30f('0x70')](_0x5da71f)&&_['isNumber'](_0x5da71f)){return _0x2cc0e9[_0xc30f('0x1e')](0xc8)[_0xc30f('0x19')]({'contacts':_0x5da71f});}else{logger['error'](_0xc30f('0x90'),_0xc30f('0x91'),0x194,_0xc30f('0x92'));_0x2cc0e9[_0xc30f('0x18')](0x194);}})[_0xc30f('0x4f')](handleError(_0x2cc0e9,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index bb5311b..902bf57 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 _0xbd51=['./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','../../config/logger','api','moment','bluebird'];(function(_0x2e7c1b,_0x232f79){var _0x42f565=function(_0x31ee5a){while(--_0x31ee5a){_0x2e7c1b['push'](_0x2e7c1b['shift']());}};_0x42f565(++_0x232f79);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x31ddf7,_0x35bf8e){_0x31ddf7=_0x31ddf7-0x0;var _0x44ef2f=_0xbd51[_0x31ddf7];return _0x44ef2f;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var logger=require(_0x1bd5('0x1'))(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var BPromise=require(_0x1bd5('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(_0x1bd5('0x5'));module[_0x1bd5('0x6')]=function(_0x43e6b6,_0x59ddfb){return _0x43e6b6[_0x1bd5('0x7')](_0x1bd5('0x8'),attributes,{'tableName':_0x1bd5('0x9'),'paranoid':![],'indexes':[{'name':_0x1bd5('0xa'),'fields':[_0x1bd5('0xa')]},{'name':'phone','fields':[_0x1bd5('0xb')]},{'name':'priority','fields':[_0x1bd5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x33af=['request-promise','path','rimraf','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','util','api','moment','bluebird'];(function(_0x2e2e81,_0xb44318){var _0x4561a7=function(_0x5341fd){while(--_0x5341fd){_0x2e2e81['push'](_0x2e2e81['shift']());}};_0x4561a7(++_0xb44318);}(_0x33af,0xec));var _0xf33a=function(_0x2a0a38,_0x4a6de5){_0x2a0a38=_0x2a0a38-0x0;var _0x4a200e=_0x33af[_0x2a0a38];return _0x4a200e;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var logger=require('../../config/logger')(_0xf33a('0x1'));var moment=require(_0xf33a('0x2'));var BPromise=require(_0xf33a('0x3'));var rp=require(_0xf33a('0x4'));var fs=require('fs');var path=require(_0xf33a('0x5'));var rimraf=require(_0xf33a('0x6'));var config=require('../../config/environment');var attributes=require(_0xf33a('0x7'));module[_0xf33a('0x8')]=function(_0x583e54,_0xc0dd13){return _0x583e54[_0xf33a('0x9')](_0xf33a('0xa'),attributes,{'tableName':_0xf33a('0xb'),'paranoid':![],'indexes':[{'name':_0xf33a('0xc'),'fields':[_0xf33a('0xc')]},{'name':'phone','fields':[_0xf33a('0xd')]},{'name':_0xf33a('0xe'),'fields':[_0xf33a('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 5aa65e3..1ed329c 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 _0x5090=['message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','map','model','include','ShowCmHopper','find','CreateCmHopper','create','update','body','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','destroy','GetContactDialer','CmContact','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','User','name','voicePause','length','includes','push','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','describe','UserId','all','GetContactRecallMe','GetCmHopperPreview','ResetActiveCalls','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1ca4cc,_0x36a77f){var _0x5d5068=function(_0x55edb2){while(--_0x55edb2){_0x1ca4cc['push'](_0x1ca4cc['shift']());}};_0x5d5068(++_0x36a77f);}(_0x5090,0x120));var _0x0509=function(_0x4fa36e,_0x501adb){_0x4fa36e=_0x4fa36e-0x0;var _0x27b3de=_0x5090[_0x4fa36e];return _0x27b3de;};'use strict';var _=require(_0x0509('0x0'));var util=require(_0x0509('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0509('0x2'));var fs=require('fs');var Redis=require(_0x0509('0x3'));var db=require(_0x0509('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0509('0x5'))(_0x0509('0x6'));var config=require(_0x0509('0x7'));var jayson=require(_0x0509('0x8'));var client=jayson['client'][_0x0509('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d8432,_0x1f446a,_0xd402eb){return new BPromise(function(_0x45291d,_0x3b6d81){return client[_0x0509('0xa')](_0x5d8432,_0xd402eb)[_0x0509('0xb')](function(_0x327541){logger[_0x0509('0xc')](_0x0509('0xd'),_0x1f446a,_0x0509('0xe'));logger[_0x0509('0xf')](_0x0509('0x10'),_0x1f446a,_0x0509('0xe'),JSON[_0x0509('0x11')](_0x327541));if(_0x327541[_0x0509('0x12')]){if(_0x327541[_0x0509('0x12')][_0x0509('0x13')]===0x1f4){logger[_0x0509('0x12')](_0x0509('0xd'),_0x1f446a,_0x327541[_0x0509('0x12')][_0x0509('0x14')]);return _0x3b6d81(_0x327541[_0x0509('0x12')][_0x0509('0x14')]);}logger[_0x0509('0x12')](_0x0509('0xd'),_0x1f446a,_0x327541['error'][_0x0509('0x14')]);return _0x45291d(_0x327541[_0x0509('0x12')][_0x0509('0x14')]);}else{logger[_0x0509('0xc')]('CmHopper,\x20%s,\x20%s',_0x1f446a,_0x0509('0xe'));_0x45291d(_0x327541[_0x0509('0x15')][_0x0509('0x14')]);}})[_0x0509('0x16')](function(_0x2acd81){logger[_0x0509('0x12')](_0x0509('0xd'),_0x1f446a,_0x2acd81);_0x3b6d81(_0x2acd81);});});}exports[_0x0509('0x17')]=function(_0x53291a){var _0x15d8b5=this;return new Promise(function(_0x1ddc62,_0x1cccd5){return db[_0x0509('0x18')][_0x0509('0x19')]({'raw':_0x53291a[_0x0509('0x1a')]?_0x53291a[_0x0509('0x1a')][_0x0509('0x1b')]===undefined?!![]:![]:!![],'where':_0x53291a[_0x0509('0x1a')]?_0x53291a[_0x0509('0x1a')][_0x0509('0x1c')]||null:null,'attributes':_0x53291a['options']?_0x53291a[_0x0509('0x1a')][_0x0509('0x1d')]||null:null,'limit':_0x53291a['options']?_0x53291a['options'][_0x0509('0x1e')]||null:null,'include':_0x53291a[_0x0509('0x1a')]?_0x53291a[_0x0509('0x1a')]['include']?_[_0x0509('0x1f')](_0x53291a['options']['include'],function(_0x565b23){return{'model':db[_0x565b23[_0x0509('0x20')]],'as':_0x565b23['as'],'attributes':_0x565b23[_0x0509('0x1d')],'include':_0x565b23[_0x0509('0x21')]?_[_0x0509('0x1f')](_0x565b23[_0x0509('0x21')],function(_0x4d1ee9){return{'model':db[_0x4d1ee9['model']],'as':_0x4d1ee9['as'],'attributes':_0x4d1ee9[_0x0509('0x1d')],'include':_0x4d1ee9[_0x0509('0x21')]?_[_0x0509('0x1f')](_0x4d1ee9[_0x0509('0x21')],function(_0x2ca4bd){return{'model':db[_0x2ca4bd['model']],'as':_0x2ca4bd['as'],'attributes':_0x2ca4bd[_0x0509('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0509('0xb')](function(_0x22eaec){logger['info'](_0x0509('0x17'),_0x53291a);logger['debug']('GetCmHopper',_0x53291a,JSON[_0x0509('0x11')](_0x22eaec));_0x1ddc62(_0x22eaec);})['catch'](function(_0x204c3d){logger[_0x0509('0x12')](_0x0509('0x17'),_0x204c3d[_0x0509('0x14')],_0x53291a);_0x1cccd5(_0x15d8b5[_0x0509('0x12')](0x1f4,_0x204c3d[_0x0509('0x14')]));});});};exports[_0x0509('0x22')]=function(_0x10fb49){var _0x6f76fd=this;return new Promise(function(_0xc66119,_0x2c10a6){return db[_0x0509('0x18')][_0x0509('0x23')]({'raw':_0x10fb49['options']?_0x10fb49[_0x0509('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x10fb49[_0x0509('0x1a')]?_0x10fb49[_0x0509('0x1a')][_0x0509('0x1c')]||null:null,'attributes':_0x10fb49[_0x0509('0x1a')]?_0x10fb49['options'][_0x0509('0x1d')]||null:null,'include':_0x10fb49[_0x0509('0x1a')]?_0x10fb49[_0x0509('0x1a')][_0x0509('0x21')]?_['map'](_0x10fb49[_0x0509('0x1a')][_0x0509('0x21')],function(_0x28a971){return{'model':db[_0x28a971[_0x0509('0x20')]],'as':_0x28a971['as'],'attributes':_0x28a971['attributes'],'include':_0x28a971[_0x0509('0x21')]?_['map'](_0x28a971[_0x0509('0x21')],function(_0x140bd2){return{'model':db[_0x140bd2[_0x0509('0x20')]],'as':_0x140bd2['as'],'attributes':_0x140bd2['attributes'],'include':_0x140bd2[_0x0509('0x21')]?_[_0x0509('0x1f')](_0x140bd2['include'],function(_0x3110b8){return{'model':db[_0x3110b8[_0x0509('0x20')]],'as':_0x3110b8['as'],'attributes':_0x3110b8[_0x0509('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c78c0){logger[_0x0509('0xc')](_0x0509('0x22'),_0x10fb49);logger[_0x0509('0xf')](_0x0509('0x22'),_0x10fb49,JSON['stringify'](_0x5c78c0));_0xc66119(_0x5c78c0);})[_0x0509('0x16')](function(_0x5c5dfe){logger[_0x0509('0x12')]('ShowCmHopper',_0x5c5dfe['message'],_0x10fb49);_0x2c10a6(_0x6f76fd[_0x0509('0x12')](0x1f4,_0x5c5dfe[_0x0509('0x14')]));});});};exports[_0x0509('0x24')]=function(_0x49d290){var _0x254118=this;return new Promise(function(_0x1488dd,_0x489d92){return db[_0x0509('0x18')][_0x0509('0x25')](_0x49d290['body'],{'raw':_0x49d290['options']?_0x49d290[_0x0509('0x1a')][_0x0509('0x1b')]===undefined?!![]:![]:!![]})[_0x0509('0xb')](function(_0x3bcd9b){logger[_0x0509('0xc')]('CreateCmHopper',_0x49d290);logger['debug']('CreateCmHopper',_0x49d290,JSON['stringify'](_0x3bcd9b));_0x1488dd(_0x3bcd9b);})[_0x0509('0x16')](function(_0x14a9b8){logger[_0x0509('0x12')](_0x0509('0x24'),_0x14a9b8['message'],_0x49d290);_0x489d92(_0x254118[_0x0509('0x12')](0x1f4,_0x14a9b8[_0x0509('0x14')]));});});};exports['UpdateCmHopper']=function(_0x3e957c){var _0x46d221=this;return new Promise(function(_0x19f9e1,_0x5209a1){return db[_0x0509('0x18')][_0x0509('0x26')](_0x3e957c[_0x0509('0x27')],{'raw':_0x3e957c[_0x0509('0x1a')]?_0x3e957c[_0x0509('0x1a')][_0x0509('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e957c[_0x0509('0x1a')]?_0x3e957c['options'][_0x0509('0x1c')]||null:null,'attributes':_0x3e957c['options']?_0x3e957c[_0x0509('0x1a')][_0x0509('0x1d')]||null:null,'limit':_0x3e957c[_0x0509('0x1a')]?_0x3e957c[_0x0509('0x1a')][_0x0509('0x1e')]||null:null})[_0x0509('0xb')](function(_0x20e5e5){logger['info'](_0x0509('0x28'),_0x3e957c);logger[_0x0509('0xc')](_0x0509('0x29'),JSON[_0x0509('0x11')](_0x3e957c[_0x0509('0x1a')][_0x0509('0x1c')]),_0x3e957c[_0x0509('0x27')][_0x0509('0x2a')]);logger[_0x0509('0xf')](_0x0509('0x28'),_0x3e957c,JSON[_0x0509('0x11')](_0x20e5e5));_0x19f9e1(_0x20e5e5);})['catch'](function(_0x5b1eff){logger[_0x0509('0x12')]('UpdateCmHopper',_0x5b1eff[_0x0509('0x14')],_0x3e957c);_0x5209a1(_0x46d221[_0x0509('0x12')](0x1f4,_0x5b1eff[_0x0509('0x14')]));});});};exports['DestroyCmHopper']=function(_0x4ce300){var _0x3b4eb4=this;return new Promise(function(_0x2637d3,_0xf38861){return db[_0x0509('0x18')][_0x0509('0x2b')]({'where':_0x4ce300[_0x0509('0x1a')]?_0x4ce300[_0x0509('0x1a')][_0x0509('0x1c')]||null:null})[_0x0509('0xb')](function(_0xf0d05){logger[_0x0509('0xc')]('DestroyCmHopper',_0x4ce300);logger[_0x0509('0xf')]('DestroyCmHopper',_0x4ce300,JSON[_0x0509('0x11')](_0xf0d05));_0x2637d3(_0xf0d05);})[_0x0509('0x16')](function(_0x1bbafb){logger[_0x0509('0x12')]('DestroyCmHopper',_0x1bbafb[_0x0509('0x14')],_0x4ce300);_0xf38861(_0x3b4eb4[_0x0509('0x12')](0x1f4,_0x1bbafb[_0x0509('0x14')]));});});};exports[_0x0509('0x2c')]=function(_0xf50caf){var _0x22955d=this;return new Promise(function(_0x46b192,_0x50d824){return db[_0x0509('0x2d')]['describe']()[_0x0509('0xb')](function(_0x135246){return db[_0x0509('0x2e')][_0x0509('0x2f')](function(_0x532355){return db[_0x0509('0x18')]['findAll']({'where':_0xf50caf[_0x0509('0x1a')]?_0xf50caf[_0x0509('0x1a')]['where']||null:null,'attributes':_0xf50caf[_0x0509('0x1a')]?_0xf50caf[_0x0509('0x1a')][_0x0509('0x1d')]||null:null,'limit':_0xf50caf[_0x0509('0x1a')]?_0xf50caf[_0x0509('0x1a')][_0x0509('0x1e')]||null:null,'order':_0xf50caf[_0x0509('0x1a')]?_0xf50caf[_0x0509('0x1a')][_0x0509('0x30')]||null:null,'transaction':_0x532355,'lock':_0x532355[_0x0509('0x31')][_0x0509('0x32')],'include':[{'model':db['CmContact'],'as':_0x0509('0x33'),'attributes':_[_0x0509('0x34')](_0x135246)},{'model':db[_0x0509('0x35')],'as':'Agent','attributes':['id',_0x0509('0x36'),_0x0509('0x37')]}]})[_0x0509('0xb')](function(_0x345a57){var _0xcd7c51=[];var _0x43a2ad=[];for(var _0x2cc9a5=0x0;_0x2cc9a5<_0x345a57[_0x0509('0x38')];_0x2cc9a5+=0x1){var _0x2624eb=_0x345a57[_0x2cc9a5]['UserId'];if(_0x2624eb===null){_0xcd7c51['push'](_0x345a57[_0x2cc9a5]['update'](_0xf50caf[_0x0509('0x27')],{'transaction':_0x532355}));}else if(!_0x43a2ad[_0x0509('0x39')](_0x2624eb)){_0x43a2ad[_0x0509('0x3a')](_0x2624eb);_0xcd7c51[_0x0509('0x3a')](_0x345a57[_0x2cc9a5][_0x0509('0x26')](_0xf50caf[_0x0509('0x27')],{'transaction':_0x532355}));}}return BPromise['all'](_0xcd7c51);});})[_0x0509('0xb')](function(_0x2f8d99){logger['info'](_0x0509('0x2c'),_0xf50caf);if(_0x2f8d99[_0x0509('0x38')]>0x0){logger[_0x0509('0xc')](_0x0509('0x3b'),_0x2f8d99[0x0][_0x0509('0x3c')]['id'],_0x2f8d99[0x0]['dataValues'][_0x0509('0x3d')],_0x2f8d99[0x0][_0x0509('0x3c')][_0x0509('0x2a')]);}logger[_0x0509('0xf')](_0x0509('0x2c'),_0xf50caf,JSON[_0x0509('0x11')](_0x2f8d99));_0x46b192(_0x2f8d99);})[_0x0509('0x16')](function(_0x3df131){logger[_0x0509('0x12')]('GetContactDialer',_0x3df131[_0x0509('0x14')],_0xf50caf);_0x50d824(_0x22955d[_0x0509('0x12')](0x1f4,_0x3df131[_0x0509('0x14')]));});});});};exports['MoveContactManagedDialer']=function(_0x45901c){var _0x1ef4a1=this;return new Promise(function(_0x5b4091,_0x3b03c7){return db[_0x0509('0x2e')][_0x0509('0x2f')](function(_0x4870e9){return db['CmHopperFinal'][_0x0509('0x25')](_0x45901c['body'],{'raw':_0x45901c['options']?_0x45901c[_0x0509('0x1a')][_0x0509('0x1b')]===undefined?!![]:![]:!![],'transaction':_0x4870e9})[_0x0509('0xb')](function(){logger['info']('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x45901c[_0x0509('0x1a')][_0x0509('0x1c')]),_0x45901c[_0x0509('0x1a')][_0x0509('0x1c')][_0x0509('0x2a')]);return db[_0x0509('0x18')][_0x0509('0x2b')]({'where':_0x45901c[_0x0509('0x1a')]?_0x45901c[_0x0509('0x1a')][_0x0509('0x1c')]||null:null,'transaction':_0x4870e9});});})[_0x0509('0xb')](function(_0x2ff0e3){logger['info'](_0x0509('0x3e'),_0x45901c);logger[_0x0509('0xf')]('MoveContactManagedDialer',_0x45901c,JSON['stringify'](_0x2ff0e3));_0x5b4091(_0x2ff0e3);})['catch'](function(_0x172566){logger[_0x0509('0x12')](_0x0509('0x3e'),_0x172566[_0x0509('0x14')],_0x45901c);_0x3b03c7(_0x1ef4a1['error'](0x1f4,_0x172566['message']));});});};exports[_0x0509('0x3f')]=function(_0x6786cc){var _0x4981b3=this;return new Promise(function(_0xe3e86f,_0x208ce4){return db[_0x0509('0x18')][_0x0509('0x19')]({'raw':_0x6786cc['options']?_0x6786cc[_0x0509('0x1a')][_0x0509('0x1b')]===undefined?!![]:![]:!![],'where':_0x6786cc[_0x0509('0x1a')]?_0x6786cc[_0x0509('0x1a')][_0x0509('0x1c')]||null:null,'attributes':[[db['sequelize']['fn'](_0x0509('0x40'),db[_0x0509('0x2e')]['fn']('IF',db[_0x0509('0x2e')][_0x0509('0x41')](_0x0509('0x42')+util[_0x0509('0x43')](_0x0509('0x44'),moment()['format'](_0x0509('0x45')))+_0x0509('0x46')))),'contactsRescheduled']]})[_0x0509('0xb')](function(_0x5cf026){logger[_0x0509('0xc')](_0x0509('0x3f'),_0x6786cc);logger['debug'](_0x0509('0x3f'),_0x6786cc,JSON[_0x0509('0x11')](_0x5cf026));_0xe3e86f(_0x5cf026);})[_0x0509('0x16')](function(_0x1fc454){logger[_0x0509('0x12')]('CountReScheduled',_0x1fc454[_0x0509('0x14')],_0x6786cc);_0x208ce4(_0x4981b3[_0x0509('0x12')](0x1f4,_0x1fc454['message']));});});};exports['GetContactRecallMe']=function(_0x12bf47){var _0x30747b=this;return new Promise(function(_0x5ea91f,_0x1f7f97){return db[_0x0509('0x2d')][_0x0509('0x47')]()['then'](function(_0x343019){return db[_0x0509('0x2e')][_0x0509('0x2f')](function(_0x1a4274){return db[_0x0509('0x18')][_0x0509('0x19')]({'where':_0x12bf47['options']?_0x12bf47[_0x0509('0x1a')]['where']||null:null,'attributes':_0x12bf47[_0x0509('0x1a')]?_0x12bf47['options'][_0x0509('0x1d')]||null:null,'limit':0x1,'order':_0x12bf47['options']?_0x12bf47[_0x0509('0x1a')][_0x0509('0x30')]||null:null,'group':db['CmHopper'][_0x0509('0x48')],'transaction':_0x1a4274,'lock':_0x1a4274[_0x0509('0x31')][_0x0509('0x32')],'include':_0x12bf47['options']?_0x12bf47[_0x0509('0x1a')][_0x0509('0x21')]?_['map'](_0x12bf47['options'][_0x0509('0x21')],function(_0x24e705){return{'model':db[_0x24e705[_0x0509('0x20')]],'as':_0x24e705['as'],'attributes':_0x24e705[_0x0509('0x1d')],'include':_0x24e705[_0x0509('0x21')]?_[_0x0509('0x1f')](_0x24e705[_0x0509('0x21')],function(_0x4d4299){return{'model':db[_0x4d4299['model']],'as':_0x4d4299['as'],'attributes':_0x4d4299[_0x0509('0x1d')],'include':_0x4d4299[_0x0509('0x21')]?_[_0x0509('0x1f')](_0x4d4299[_0x0509('0x21')],function(_0x3c7499){return{'model':db[_0x3c7499['model']],'as':_0x3c7499['as'],'attributes':_0x3c7499['attributes']};}):[]};}):[]};}):[]:[]})[_0x0509('0xb')](function(_0x18a554){var _0x842e28=[];for(var _0x1ca26d=0x0;_0x1ca26d<_0x18a554[_0x0509('0x38')];_0x1ca26d+=0x1){_0x842e28[_0x0509('0x3a')](_0x18a554[_0x1ca26d][_0x0509('0x26')](_0x12bf47[_0x0509('0x27')],{'transaction':_0x1a4274}));}return BPromise[_0x0509('0x49')](_0x842e28);});})[_0x0509('0xb')](function(_0x4a2c47){logger[_0x0509('0xc')](_0x0509('0x4a'),_0x12bf47);logger[_0x0509('0xf')](_0x0509('0x4a'),_0x12bf47,JSON['stringify'](_0x4a2c47));_0x5ea91f(_0x4a2c47);})[_0x0509('0x16')](function(_0x210d6b){logger['error']('GetContactRecallMe',_0x210d6b[_0x0509('0x14')],_0x12bf47);_0x1f7f97(_0x30747b[_0x0509('0x12')](0x1f4,_0x210d6b[_0x0509('0x14')]));});});});};exports[_0x0509('0x4b')]=function(_0x1eaa26){var _0x587343=this;return new Promise(function(_0x355f7c,_0xa0fa93){db['CmContact'][_0x0509('0x47')]()[_0x0509('0xb')](function(_0x448498){return db[_0x0509('0x18')]['findAll']({'raw':_0x1eaa26[_0x0509('0x1a')]?_0x1eaa26[_0x0509('0x1a')][_0x0509('0x1b')]===undefined?!![]:![]:!![],'where':_0x1eaa26[_0x0509('0x1a')]?_0x1eaa26[_0x0509('0x1a')][_0x0509('0x1c')]||null:null,'attributes':_0x1eaa26[_0x0509('0x1a')]?_0x1eaa26['options'][_0x0509('0x1d')]||null:null,'limit':_0x1eaa26[_0x0509('0x1a')]?_0x1eaa26[_0x0509('0x1a')][_0x0509('0x1e')]||null:null,'include':_0x1eaa26['options']?_0x1eaa26[_0x0509('0x1a')][_0x0509('0x21')]?_[_0x0509('0x1f')](_0x1eaa26['options'][_0x0509('0x21')],function(_0x15eec6){return{'model':db[_0x15eec6[_0x0509('0x20')]],'as':_0x15eec6['as'],'attributes':_0x15eec6['as']==='Contact'?_['keys'](_0x448498):_0x15eec6[_0x0509('0x1d')],'include':_0x15eec6[_0x0509('0x21')]?_[_0x0509('0x1f')](_0x15eec6['include'],function(_0x234cee){return{'model':db[_0x234cee[_0x0509('0x20')]],'as':_0x234cee['as'],'attributes':_0x234cee[_0x0509('0x1d')],'include':_0x234cee[_0x0509('0x21')]?_[_0x0509('0x1f')](_0x234cee[_0x0509('0x21')],function(_0x260fbe){return{'model':db[_0x260fbe[_0x0509('0x20')]],'as':_0x260fbe['as'],'attributes':_0x260fbe[_0x0509('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x482be4){logger[_0x0509('0xc')](_0x0509('0x17'),_0x1eaa26);logger[_0x0509('0xf')](_0x0509('0x17'),_0x1eaa26,JSON[_0x0509('0x11')](_0x482be4));_0x355f7c(_0x482be4);})[_0x0509('0x16')](function(_0xfe91e2){logger[_0x0509('0x12')]('GetCmHopper',_0xfe91e2['message'],_0x1eaa26);_0xa0fa93(_0x587343['error'](0x1f4,_0xfe91e2[_0x0509('0x14')]));});});});};exports[_0x0509('0x4c')]=function(_0x1143af){var _0x2af080=this;return new Promise(function(_0x1ad6f3,_0x3c9c28){return db[_0x0509('0x2e')][_0x0509('0x2f')](function(_0x2b1754){return db[_0x0509('0x18')]['update']({'active':![]},{'where':{},'transaction':_0x2b1754})[_0x0509('0xb')](function(_0x26d1e1){logger[_0x0509('0xc')]('ResetActiveCalls',_0x1143af);logger['debug'](_0x0509('0x4c'),_0x1143af,JSON[_0x0509('0x11')](_0x26d1e1));_0x1ad6f3(_0x26d1e1);})['catch'](function(_0x56f6c6){logger[_0x0509('0x12')](_0x0509('0x4c'),_0x56f6c6[_0x0509('0x14')],_0x1143af);_0x3c9c28(_0x2af080[_0x0509('0x12')](0x1f4,_0x56f6c6[_0x0509('0x14')]));});});});}; \ No newline at end of file +var _0x3584=['User','Agent','name','voicePause','length','UserId','push','update','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','Contact','ResetActiveCalls','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmHopper','findAll','options','raw','where','attributes','include','model','map','debug','stringify','ShowCmHopper','find','CreateCmHopper','CmHopper','create','body','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','describe','sequelize','transaction','limit','order','LOCK','UPDATE','CmContact','keys'];(function(_0xee4c5f,_0x1bf72d){var _0x5accbc=function(_0x5ca2aa){while(--_0x5ca2aa){_0xee4c5f['push'](_0xee4c5f['shift']());}};_0x5accbc(++_0x1bf72d);}(_0x3584,0x15e));var _0x4358=function(_0xbb6b05,_0x1874d5){_0xbb6b05=_0xbb6b05-0x0;var _0x264fd2=_0x3584[_0xbb6b05];return _0x264fd2;};'use strict';var _=require(_0x4358('0x0'));var util=require(_0x4358('0x1'));var moment=require(_0x4358('0x2'));var BPromise=require(_0x4358('0x3'));var rs=require(_0x4358('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4358('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4358('0x6'))(_0x4358('0x7'));var config=require(_0x4358('0x8'));var jayson=require(_0x4358('0x9'));var client=jayson[_0x4358('0xa')][_0x4358('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8a80d4,_0x5da0e8,_0x320cb8){return new BPromise(function(_0x46ebf1,_0x40de20){return client[_0x4358('0xc')](_0x8a80d4,_0x320cb8)[_0x4358('0xd')](function(_0x57ec89){logger[_0x4358('0xe')](_0x4358('0xf'),_0x5da0e8,_0x4358('0x10'));logger['debug'](_0x4358('0x11'),_0x5da0e8,_0x4358('0x10'),JSON['stringify'](_0x57ec89));if(_0x57ec89[_0x4358('0x12')]){if(_0x57ec89[_0x4358('0x12')][_0x4358('0x13')]===0x1f4){logger['error'](_0x4358('0xf'),_0x5da0e8,_0x57ec89[_0x4358('0x12')][_0x4358('0x14')]);return _0x40de20(_0x57ec89[_0x4358('0x12')][_0x4358('0x14')]);}logger[_0x4358('0x12')](_0x4358('0xf'),_0x5da0e8,_0x57ec89[_0x4358('0x12')][_0x4358('0x14')]);return _0x46ebf1(_0x57ec89[_0x4358('0x12')][_0x4358('0x14')]);}else{logger['info'](_0x4358('0xf'),_0x5da0e8,'request\x20sent');_0x46ebf1(_0x57ec89[_0x4358('0x15')][_0x4358('0x14')]);}})[_0x4358('0x16')](function(_0x40b4e4){logger[_0x4358('0x12')](_0x4358('0xf'),_0x5da0e8,_0x40b4e4);_0x40de20(_0x40b4e4);});});}exports[_0x4358('0x17')]=function(_0x3088f4){var _0x5cdf5b=this;return new Promise(function(_0x4ae726,_0x4dc7bb){return db['CmHopper'][_0x4358('0x18')]({'raw':_0x3088f4[_0x4358('0x19')]?_0x3088f4['options'][_0x4358('0x1a')]===undefined?!![]:![]:!![],'where':_0x3088f4[_0x4358('0x19')]?_0x3088f4[_0x4358('0x19')][_0x4358('0x1b')]||null:null,'attributes':_0x3088f4[_0x4358('0x19')]?_0x3088f4[_0x4358('0x19')][_0x4358('0x1c')]||null:null,'limit':_0x3088f4[_0x4358('0x19')]?_0x3088f4[_0x4358('0x19')]['limit']||null:null,'include':_0x3088f4[_0x4358('0x19')]?_0x3088f4[_0x4358('0x19')][_0x4358('0x1d')]?_['map'](_0x3088f4['options'][_0x4358('0x1d')],function(_0x5b977c){return{'model':db[_0x5b977c[_0x4358('0x1e')]],'as':_0x5b977c['as'],'attributes':_0x5b977c['attributes'],'include':_0x5b977c[_0x4358('0x1d')]?_[_0x4358('0x1f')](_0x5b977c[_0x4358('0x1d')],function(_0x35c713){return{'model':db[_0x35c713[_0x4358('0x1e')]],'as':_0x35c713['as'],'attributes':_0x35c713[_0x4358('0x1c')],'include':_0x35c713['include']?_[_0x4358('0x1f')](_0x35c713[_0x4358('0x1d')],function(_0x11a4b8){return{'model':db[_0x11a4b8[_0x4358('0x1e')]],'as':_0x11a4b8['as'],'attributes':_0x11a4b8[_0x4358('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4358('0xd')](function(_0x423f98){logger['info'](_0x4358('0x17'),_0x3088f4);logger[_0x4358('0x20')](_0x4358('0x17'),_0x3088f4,JSON[_0x4358('0x21')](_0x423f98));_0x4ae726(_0x423f98);})[_0x4358('0x16')](function(_0x6943eb){logger['error'](_0x4358('0x17'),_0x6943eb[_0x4358('0x14')],_0x3088f4);_0x4dc7bb(_0x5cdf5b['error'](0x1f4,_0x6943eb[_0x4358('0x14')]));});});};exports[_0x4358('0x22')]=function(_0x52c005){var _0x3c47bc=this;return new Promise(function(_0x2432cb,_0x41f4d0){return db['CmHopper'][_0x4358('0x23')]({'raw':_0x52c005[_0x4358('0x19')]?_0x52c005['options'][_0x4358('0x1a')]===undefined?!![]:![]:!![],'where':_0x52c005['options']?_0x52c005[_0x4358('0x19')][_0x4358('0x1b')]||null:null,'attributes':_0x52c005[_0x4358('0x19')]?_0x52c005[_0x4358('0x19')][_0x4358('0x1c')]||null:null,'include':_0x52c005[_0x4358('0x19')]?_0x52c005[_0x4358('0x19')][_0x4358('0x1d')]?_[_0x4358('0x1f')](_0x52c005[_0x4358('0x19')]['include'],function(_0x295f5a){return{'model':db[_0x295f5a[_0x4358('0x1e')]],'as':_0x295f5a['as'],'attributes':_0x295f5a['attributes'],'include':_0x295f5a[_0x4358('0x1d')]?_[_0x4358('0x1f')](_0x295f5a[_0x4358('0x1d')],function(_0x354406){return{'model':db[_0x354406[_0x4358('0x1e')]],'as':_0x354406['as'],'attributes':_0x354406[_0x4358('0x1c')],'include':_0x354406[_0x4358('0x1d')]?_[_0x4358('0x1f')](_0x354406['include'],function(_0x1d3243){return{'model':db[_0x1d3243[_0x4358('0x1e')]],'as':_0x1d3243['as'],'attributes':_0x1d3243['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x23438a){logger[_0x4358('0xe')]('ShowCmHopper',_0x52c005);logger[_0x4358('0x20')](_0x4358('0x22'),_0x52c005,JSON[_0x4358('0x21')](_0x23438a));_0x2432cb(_0x23438a);})['catch'](function(_0x29ffdd){logger[_0x4358('0x12')](_0x4358('0x22'),_0x29ffdd['message'],_0x52c005);_0x41f4d0(_0x3c47bc[_0x4358('0x12')](0x1f4,_0x29ffdd[_0x4358('0x14')]));});});};exports[_0x4358('0x24')]=function(_0x4c3fea){var _0x3e7971=this;return new Promise(function(_0x1a19ac,_0x2facb7){return db[_0x4358('0x25')][_0x4358('0x26')](_0x4c3fea['body'],{'raw':_0x4c3fea[_0x4358('0x19')]?_0x4c3fea[_0x4358('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x4358('0xd')](function(_0x32f35f){logger['info'](_0x4358('0x24'),_0x4c3fea);logger[_0x4358('0x20')](_0x4358('0x24'),_0x4c3fea,JSON[_0x4358('0x21')](_0x32f35f));_0x1a19ac(_0x32f35f);})[_0x4358('0x16')](function(_0x184d79){logger['error'](_0x4358('0x24'),_0x184d79[_0x4358('0x14')],_0x4c3fea);_0x2facb7(_0x3e7971[_0x4358('0x12')](0x1f4,_0x184d79[_0x4358('0x14')]));});});};exports['UpdateCmHopper']=function(_0x409dc9){var _0x2dfad7=this;return new Promise(function(_0x429795,_0x3703c7){return db[_0x4358('0x25')]['update'](_0x409dc9[_0x4358('0x27')],{'raw':_0x409dc9[_0x4358('0x19')]?_0x409dc9[_0x4358('0x19')][_0x4358('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x409dc9[_0x4358('0x19')]?_0x409dc9[_0x4358('0x19')][_0x4358('0x1b')]||null:null,'attributes':_0x409dc9['options']?_0x409dc9[_0x4358('0x19')][_0x4358('0x1c')]||null:null,'limit':_0x409dc9[_0x4358('0x19')]?_0x409dc9[_0x4358('0x19')]['limit']||null:null})[_0x4358('0xd')](function(_0x4e0a84){logger[_0x4358('0xe')]('UpdateCmHopper',_0x409dc9);logger[_0x4358('0xe')](_0x4358('0x28'),JSON[_0x4358('0x21')](_0x409dc9[_0x4358('0x19')][_0x4358('0x1b')]),_0x409dc9[_0x4358('0x27')][_0x4358('0x29')]);logger[_0x4358('0x20')](_0x4358('0x2a'),_0x409dc9,JSON['stringify'](_0x4e0a84));_0x429795(_0x4e0a84);})[_0x4358('0x16')](function(_0x1f1162){logger['error']('UpdateCmHopper',_0x1f1162[_0x4358('0x14')],_0x409dc9);_0x3703c7(_0x2dfad7['error'](0x1f4,_0x1f1162['message']));});});};exports[_0x4358('0x2b')]=function(_0x33a566){var _0xe8934c=this;return new Promise(function(_0x17b19c,_0x1627e9){return db[_0x4358('0x25')][_0x4358('0x2c')]({'where':_0x33a566['options']?_0x33a566[_0x4358('0x19')][_0x4358('0x1b')]||null:null})[_0x4358('0xd')](function(_0x53eb48){logger[_0x4358('0xe')](_0x4358('0x2b'),_0x33a566);logger[_0x4358('0x20')](_0x4358('0x2b'),_0x33a566,JSON[_0x4358('0x21')](_0x53eb48));_0x17b19c(_0x53eb48);})['catch'](function(_0x3e06b0){logger[_0x4358('0x12')](_0x4358('0x2b'),_0x3e06b0[_0x4358('0x14')],_0x33a566);_0x1627e9(_0xe8934c[_0x4358('0x12')](0x1f4,_0x3e06b0['message']));});});};exports[_0x4358('0x2d')]=function(_0xd7c01a){var _0x57c5a2=this;return new Promise(function(_0x1a4d01,_0x47f9bb){return db['CmContact'][_0x4358('0x2e')]()[_0x4358('0xd')](function(_0x2cfd50){return db[_0x4358('0x2f')][_0x4358('0x30')](function(_0x203102){return db[_0x4358('0x25')]['findAll']({'where':_0xd7c01a[_0x4358('0x19')]?_0xd7c01a['options'][_0x4358('0x1b')]||null:null,'attributes':_0xd7c01a['options']?_0xd7c01a[_0x4358('0x19')]['attributes']||null:null,'limit':_0xd7c01a[_0x4358('0x19')]?_0xd7c01a['options'][_0x4358('0x31')]||null:null,'order':_0xd7c01a[_0x4358('0x19')]?_0xd7c01a[_0x4358('0x19')][_0x4358('0x32')]||null:null,'transaction':_0x203102,'lock':_0x203102[_0x4358('0x33')][_0x4358('0x34')],'include':[{'model':db[_0x4358('0x35')],'as':'Contact','attributes':_[_0x4358('0x36')](_0x2cfd50)},{'model':db[_0x4358('0x37')],'as':_0x4358('0x38'),'attributes':['id',_0x4358('0x39'),_0x4358('0x3a')]}]})[_0x4358('0xd')](function(_0x9ce0c6){var _0x4198e7=[];var _0x731a01=[];for(var _0x4fc5fa=0x0;_0x4fc5fa<_0x9ce0c6[_0x4358('0x3b')];_0x4fc5fa+=0x1){var _0x47d167=_0x9ce0c6[_0x4fc5fa][_0x4358('0x3c')];if(_0x47d167===null){_0x4198e7[_0x4358('0x3d')](_0x9ce0c6[_0x4fc5fa][_0x4358('0x3e')](_0xd7c01a[_0x4358('0x27')],{'transaction':_0x203102}));}else if(!_0x731a01[_0x4358('0x3f')](_0x47d167)){_0x731a01[_0x4358('0x3d')](_0x47d167);_0x4198e7[_0x4358('0x3d')](_0x9ce0c6[_0x4fc5fa][_0x4358('0x3e')](_0xd7c01a['body'],{'transaction':_0x203102}));}}return BPromise[_0x4358('0x40')](_0x4198e7);});})[_0x4358('0xd')](function(_0xf45f17){logger[_0x4358('0xe')](_0x4358('0x2d'),_0xd7c01a);if(_0xf45f17[_0x4358('0x3b')]>0x0){logger[_0x4358('0xe')](_0x4358('0x41'),_0xf45f17[0x0][_0x4358('0x42')]['id'],_0xf45f17[0x0][_0x4358('0x42')]['ContactId'],_0xf45f17[0x0][_0x4358('0x42')]['active']);}logger['debug'](_0x4358('0x2d'),_0xd7c01a,JSON[_0x4358('0x21')](_0xf45f17));_0x1a4d01(_0xf45f17);})[_0x4358('0x16')](function(_0x5c92c4){logger[_0x4358('0x12')](_0x4358('0x2d'),_0x5c92c4[_0x4358('0x14')],_0xd7c01a);_0x47f9bb(_0x57c5a2['error'](0x1f4,_0x5c92c4[_0x4358('0x14')]));});});});};exports[_0x4358('0x43')]=function(_0x5f0afa){var _0x4d34a3=this;return new Promise(function(_0x165175,_0x4e8ed1){return db[_0x4358('0x2f')][_0x4358('0x30')](function(_0x1221b3){return db[_0x4358('0x44')]['create'](_0x5f0afa[_0x4358('0x27')],{'raw':_0x5f0afa[_0x4358('0x19')]?_0x5f0afa[_0x4358('0x19')][_0x4358('0x1a')]===undefined?!![]:![]:!![],'transaction':_0x1221b3})[_0x4358('0xd')](function(){logger[_0x4358('0xe')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x5f0afa[_0x4358('0x19')]['where']),_0x5f0afa[_0x4358('0x19')]['where']['active']);return db[_0x4358('0x25')]['destroy']({'where':_0x5f0afa[_0x4358('0x19')]?_0x5f0afa[_0x4358('0x19')][_0x4358('0x1b')]||null:null,'transaction':_0x1221b3});});})[_0x4358('0xd')](function(_0x484db4){logger[_0x4358('0xe')]('MoveContactManagedDialer',_0x5f0afa);logger[_0x4358('0x20')](_0x4358('0x43'),_0x5f0afa,JSON[_0x4358('0x21')](_0x484db4));_0x165175(_0x484db4);})[_0x4358('0x16')](function(_0x2a1d9a){logger[_0x4358('0x12')](_0x4358('0x43'),_0x2a1d9a[_0x4358('0x14')],_0x5f0afa);_0x4e8ed1(_0x4d34a3[_0x4358('0x12')](0x1f4,_0x2a1d9a[_0x4358('0x14')]));});});};exports[_0x4358('0x45')]=function(_0x444733){var _0x5a049d=this;return new Promise(function(_0x506dde,_0x4150af){return db[_0x4358('0x25')][_0x4358('0x18')]({'raw':_0x444733[_0x4358('0x19')]?_0x444733[_0x4358('0x19')][_0x4358('0x1a')]===undefined?!![]:![]:!![],'where':_0x444733[_0x4358('0x19')]?_0x444733[_0x4358('0x19')][_0x4358('0x1b')]||null:null,'attributes':[[db['sequelize']['fn'](_0x4358('0x46'),db[_0x4358('0x2f')]['fn']('IF',db['sequelize']['literal'](_0x4358('0x47')+util[_0x4358('0x48')](_0x4358('0x49'),moment()[_0x4358('0x48')](_0x4358('0x4a')))+_0x4358('0x4b')))),_0x4358('0x4c')]]})[_0x4358('0xd')](function(_0x22dfba){logger[_0x4358('0xe')](_0x4358('0x45'),_0x444733);logger[_0x4358('0x20')]('CountReScheduled',_0x444733,JSON[_0x4358('0x21')](_0x22dfba));_0x506dde(_0x22dfba);})[_0x4358('0x16')](function(_0x287597){logger[_0x4358('0x12')](_0x4358('0x45'),_0x287597[_0x4358('0x14')],_0x444733);_0x4150af(_0x5a049d['error'](0x1f4,_0x287597['message']));});});};exports[_0x4358('0x4d')]=function(_0x5bc4f3){var _0x5d1e22=this;return new Promise(function(_0x4cb153,_0x8c2d08){return db[_0x4358('0x35')][_0x4358('0x2e')]()[_0x4358('0xd')](function(_0x29f87b){return db[_0x4358('0x2f')][_0x4358('0x30')](function(_0x5db0af){return db[_0x4358('0x25')]['findAll']({'where':_0x5bc4f3[_0x4358('0x19')]?_0x5bc4f3[_0x4358('0x19')][_0x4358('0x1b')]||null:null,'attributes':_0x5bc4f3[_0x4358('0x19')]?_0x5bc4f3[_0x4358('0x19')][_0x4358('0x1c')]||null:null,'limit':0x1,'order':_0x5bc4f3['options']?_0x5bc4f3['options']['order']||null:null,'group':db[_0x4358('0x25')]['UserId'],'transaction':_0x5db0af,'lock':_0x5db0af['LOCK']['UPDATE'],'include':_0x5bc4f3[_0x4358('0x19')]?_0x5bc4f3[_0x4358('0x19')][_0x4358('0x1d')]?_[_0x4358('0x1f')](_0x5bc4f3[_0x4358('0x19')]['include'],function(_0x2dfaf6){return{'model':db[_0x2dfaf6[_0x4358('0x1e')]],'as':_0x2dfaf6['as'],'attributes':_0x2dfaf6[_0x4358('0x1c')],'include':_0x2dfaf6[_0x4358('0x1d')]?_[_0x4358('0x1f')](_0x2dfaf6[_0x4358('0x1d')],function(_0x5cd5b0){return{'model':db[_0x5cd5b0[_0x4358('0x1e')]],'as':_0x5cd5b0['as'],'attributes':_0x5cd5b0['attributes'],'include':_0x5cd5b0[_0x4358('0x1d')]?_[_0x4358('0x1f')](_0x5cd5b0[_0x4358('0x1d')],function(_0xe04fce){return{'model':db[_0xe04fce[_0x4358('0x1e')]],'as':_0xe04fce['as'],'attributes':_0xe04fce[_0x4358('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4358('0xd')](function(_0x11c373){var _0x3d5acd=[];for(var _0x3e51ec=0x0;_0x3e51ec<_0x11c373[_0x4358('0x3b')];_0x3e51ec+=0x1){_0x3d5acd[_0x4358('0x3d')](_0x11c373[_0x3e51ec]['update'](_0x5bc4f3[_0x4358('0x27')],{'transaction':_0x5db0af}));}return BPromise['all'](_0x3d5acd);});})[_0x4358('0xd')](function(_0x5f0efd){logger[_0x4358('0xe')](_0x4358('0x4d'),_0x5bc4f3);logger[_0x4358('0x20')](_0x4358('0x4d'),_0x5bc4f3,JSON['stringify'](_0x5f0efd));_0x4cb153(_0x5f0efd);})[_0x4358('0x16')](function(_0x2928ff){logger[_0x4358('0x12')](_0x4358('0x4d'),_0x2928ff[_0x4358('0x14')],_0x5bc4f3);_0x8c2d08(_0x5d1e22[_0x4358('0x12')](0x1f4,_0x2928ff[_0x4358('0x14')]));});});});};exports[_0x4358('0x4e')]=function(_0x267db7){var _0x1018ed=this;return new Promise(function(_0xa6db9c,_0x8d1062){db[_0x4358('0x35')]['describe']()['then'](function(_0x288b12){return db[_0x4358('0x25')][_0x4358('0x18')]({'raw':_0x267db7['options']?_0x267db7[_0x4358('0x19')][_0x4358('0x1a')]===undefined?!![]:![]:!![],'where':_0x267db7[_0x4358('0x19')]?_0x267db7[_0x4358('0x19')][_0x4358('0x1b')]||null:null,'attributes':_0x267db7[_0x4358('0x19')]?_0x267db7[_0x4358('0x19')][_0x4358('0x1c')]||null:null,'limit':_0x267db7[_0x4358('0x19')]?_0x267db7[_0x4358('0x19')][_0x4358('0x31')]||null:null,'include':_0x267db7[_0x4358('0x19')]?_0x267db7[_0x4358('0x19')][_0x4358('0x1d')]?_[_0x4358('0x1f')](_0x267db7[_0x4358('0x19')][_0x4358('0x1d')],function(_0x3536f5){return{'model':db[_0x3536f5[_0x4358('0x1e')]],'as':_0x3536f5['as'],'attributes':_0x3536f5['as']===_0x4358('0x4f')?_[_0x4358('0x36')](_0x288b12):_0x3536f5[_0x4358('0x1c')],'include':_0x3536f5[_0x4358('0x1d')]?_[_0x4358('0x1f')](_0x3536f5[_0x4358('0x1d')],function(_0x456cb3){return{'model':db[_0x456cb3[_0x4358('0x1e')]],'as':_0x456cb3['as'],'attributes':_0x456cb3[_0x4358('0x1c')],'include':_0x456cb3[_0x4358('0x1d')]?_[_0x4358('0x1f')](_0x456cb3['include'],function(_0x26a7cd){return{'model':db[_0x26a7cd[_0x4358('0x1e')]],'as':_0x26a7cd['as'],'attributes':_0x26a7cd['attributes']};}):[]};}):[]};}):[]:[]})[_0x4358('0xd')](function(_0x13ef53){logger['info'](_0x4358('0x17'),_0x267db7);logger[_0x4358('0x20')](_0x4358('0x17'),_0x267db7,JSON[_0x4358('0x21')](_0x13ef53));_0xa6db9c(_0x13ef53);})[_0x4358('0x16')](function(_0x4c0489){logger[_0x4358('0x12')](_0x4358('0x17'),_0x4c0489[_0x4358('0x14')],_0x267db7);_0x8d1062(_0x1018ed[_0x4358('0x12')](0x1f4,_0x4c0489['message']));});});});};exports[_0x4358('0x50')]=function(_0x4b46f3){var _0x256b6c=this;return new Promise(function(_0x156ed8,_0x4752ba){return db[_0x4358('0x2f')][_0x4358('0x30')](function(_0x402058){return db[_0x4358('0x25')][_0x4358('0x3e')]({'active':![]},{'where':{},'transaction':_0x402058})[_0x4358('0xd')](function(_0x32ebe3){logger['info']('ResetActiveCalls',_0x4b46f3);logger[_0x4358('0x20')]('ResetActiveCalls',_0x4b46f3,JSON[_0x4358('0x21')](_0x32ebe3));_0x156ed8(_0x32ebe3);})[_0x4358('0x16')](function(_0x54c9fa){logger['error'](_0x4358('0x50'),_0x54c9fa[_0x4358('0x14')],_0x4b46f3);_0x4752ba(_0x256b6c['error'](0x1f4,_0x54c9fa[_0x4358('0x14')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index a5b3b74..6748637 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 _0x56ed=['get','isAuthenticated','index','/describe','describe','/:id','create','/preview','getPreview','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller'];(function(_0x251170,_0x32fb45){var _0x32583d=function(_0x55ece5){while(--_0x55ece5){_0x251170['push'](_0x251170['shift']());}};_0x32583d(++_0x32fb45);}(_0x56ed,0x1f1));var _0xd56e=function(_0x2bd635,_0x3a8ae8){_0x2bd635=_0x2bd635-0x0;var _0x3008fa=_0x56ed[_0x2bd635];return _0x3008fa;};'use strict';var multer=require(_0xd56e('0x0'));var util=require(_0xd56e('0x1'));var path=require(_0xd56e('0x2'));var timeout=require(_0xd56e('0x3'));var express=require('express');var router=express[_0xd56e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd56e('0x5'));var interaction=require(_0xd56e('0x6'));var config=require(_0xd56e('0x7'));var controller=require(_0xd56e('0x8'));router[_0xd56e('0x9')]('/',auth[_0xd56e('0xa')](),controller[_0xd56e('0xb')]);router[_0xd56e('0x9')](_0xd56e('0xc'),auth['isAuthenticated'](),controller[_0xd56e('0xd')]);router[_0xd56e('0x9')]('/opencontacts',auth[_0xd56e('0xa')](),controller['getOpenContacts']);router[_0xd56e('0x9')](_0xd56e('0xe'),auth[_0xd56e('0xa')](),controller['show']);router['post']('/',auth[_0xd56e('0xa')](),controller[_0xd56e('0xf')]);router['post'](_0xd56e('0x10'),auth[_0xd56e('0xa')](),controller[_0xd56e('0x11')]);router[_0xd56e('0x12')](_0xd56e('0xe'),auth[_0xd56e('0xa')](),controller[_0xd56e('0x13')]);router[_0xd56e('0x14')](_0xd56e('0xe'),auth[_0xd56e('0xa')](),controller[_0xd56e('0x15')]);module[_0xd56e('0x16')]=router; \ No newline at end of file +var _0xc403=['delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','./cmHopper.controller','get','index','/describe','isAuthenticated','describe','/opencontacts','getOpenContacts','/:id','show','post','create','/preview','getPreview','put','update'];(function(_0x3c4322,_0x145a37){var _0x225310=function(_0x51a0a2){while(--_0x51a0a2){_0x3c4322['push'](_0x3c4322['shift']());}};_0x225310(++_0x145a37);}(_0xc403,0xc2));var _0x3c40=function(_0xd68296,_0x18e488){_0xd68296=_0xd68296-0x0;var _0x595fde=_0xc403[_0xd68296];return _0x595fde;};'use strict';var multer=require(_0x3c40('0x0'));var util=require('util');var path=require(_0x3c40('0x1'));var timeout=require(_0x3c40('0x2'));var express=require(_0x3c40('0x3'));var router=express['Router']();var fs_extra=require(_0x3c40('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3c40('0x5'));var config=require('../../config/environment');var controller=require(_0x3c40('0x6'));router[_0x3c40('0x7')]('/',auth['isAuthenticated'](),controller[_0x3c40('0x8')]);router['get'](_0x3c40('0x9'),auth[_0x3c40('0xa')](),controller[_0x3c40('0xb')]);router[_0x3c40('0x7')](_0x3c40('0xc'),auth[_0x3c40('0xa')](),controller[_0x3c40('0xd')]);router[_0x3c40('0x7')](_0x3c40('0xe'),auth[_0x3c40('0xa')](),controller[_0x3c40('0xf')]);router[_0x3c40('0x10')]('/',auth[_0x3c40('0xa')](),controller[_0x3c40('0x11')]);router['post'](_0x3c40('0x12'),auth[_0x3c40('0xa')](),controller[_0x3c40('0x13')]);router[_0x3c40('0x14')]('/:id',auth[_0x3c40('0xa')](),controller[_0x3c40('0x15')]);router[_0x3c40('0x16')](_0x3c40('0xe'),auth[_0x3c40('0xa')](),controller['destroy']);module[_0x3c40('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 92802d3..6f619aa 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 _0xee14=['INTEGER','contactListQueue','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee14,0x13a));var _0x4ee1=function(_0x1a3beb,_0x195c11){_0x1a3beb=_0x1a3beb-0x0;var _0x21ecf6=_0xee14[_0x1a3beb];return _0x21ecf6;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x4ee1('0x0')]={'phone':{'type':Sequelize[_0x4ee1('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x4ee1('0x2')],'unique':_0x4ee1('0x3')},'ListId':{'type':Sequelize[_0x4ee1('0x2')],'unique':_0x4ee1('0x3')},'VoiceQueueId':{'type':Sequelize[_0x4ee1('0x2')],'unique':_0x4ee1('0x3')}}; \ No newline at end of file +var _0xbd10=['exports','INTEGER','contactListQueue','moment','sequelize'];(function(_0x434783,_0xff395d){var _0x13efcf=function(_0x235dac){while(--_0x235dac){_0x434783['push'](_0x434783['shift']());}};_0x13efcf(++_0xff395d);}(_0xbd10,0x85));var _0x0bd1=function(_0x3427d9,_0x2492c1){_0x3427d9=_0x3427d9-0x0;var _0x3995c2=_0xbd10[_0x3427d9];return _0x3995c2;};'use strict';var moment=require(_0x0bd1('0x0'));var Sequelize=require(_0x0bd1('0x1'));module[_0x0bd1('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x0bd1('0x3')],'unique':_0x0bd1('0x4')},'ListId':{'type':Sequelize[_0x0bd1('0x3')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x0bd1('0x3')],'unique':_0x0bd1('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 512dd1d..5197b3f 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 _0xcafa=['sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','sendStatus','error','stack','name','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','body','find','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util'];(function(_0x8cee81,_0x52e3ce){var _0x24ac56=function(_0x3cdb6c){while(--_0x3cdb6c){_0x8cee81['push'](_0x8cee81['shift']());}};_0x24ac56(++_0x52e3ce);}(_0xcafa,0x8f));var _0xacaf=function(_0x1fecb1,_0x315608){_0x1fecb1=_0x1fecb1-0x0;var _0x24ff5d=_0xcafa[_0x1fecb1];return _0x24ff5d;};'use strict';var emlformat=require(_0xacaf('0x0'));var rimraf=require(_0xacaf('0x1'));var zipdir=require(_0xacaf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xacaf('0x3'));var BPromise=require(_0xacaf('0x4'));var Mustache=require(_0xacaf('0x5'));var util=require(_0xacaf('0x6'));var path=require('path');var sox=require(_0xacaf('0x7'));var csv=require('to-csv');var ejs=require(_0xacaf('0x8'));var fs=require('fs');var fs_extra=require(_0xacaf('0x9'));var _=require(_0xacaf('0xa'));var squel=require(_0xacaf('0xb'));var crypto=require(_0xacaf('0xc'));var jsforce=require(_0xacaf('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xacaf('0xe'));var querystring=require(_0xacaf('0xf'));var Papa=require(_0xacaf('0x10'));var Redis=require(_0xacaf('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xacaf('0x12'));var as=require(_0xacaf('0x13'));var hardwareService=require(_0xacaf('0x14'));var logger=require(_0xacaf('0x15'))(_0xacaf('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xacaf('0x17'))['db'];function respondWithStatusCode(_0x15bb5d,_0x277dd2){_0x277dd2=_0x277dd2||0xcc;return function(_0x4129d4){if(_0x4129d4){return _0x15bb5d['sendStatus'](_0x277dd2);}return _0x15bb5d[_0xacaf('0x18')](_0x277dd2)[_0xacaf('0x19')]();};}function respondWithResult(_0x58310a,_0x51f677){_0x51f677=_0x51f677||0xc8;return function(_0x541732){if(_0x541732){return _0x58310a[_0xacaf('0x18')](_0x51f677)[_0xacaf('0x1a')](_0x541732);}};}function respondWithFilteredResult(_0x5e824b,_0x92afa){return function(_0x10cfa2){if(_0x10cfa2){var _0x1f80c4=typeof _0x92afa[_0xacaf('0x1b')]===_0xacaf('0x1c')&&typeof _0x92afa[_0xacaf('0x1d')]==='undefined';var _0x3ad95c=_0x10cfa2[_0xacaf('0x1e')];var _0x4c25c8=_0x1f80c4?0x0:_0x92afa[_0xacaf('0x1b')];var _0x5f5a93=_0x1f80c4?_0x10cfa2[_0xacaf('0x1e')]:_0x92afa[_0xacaf('0x1b')]+_0x92afa[_0xacaf('0x1d')];var _0x268f85;if(_0x5f5a93>=_0x3ad95c){_0x5f5a93=_0x3ad95c;_0x268f85=0xc8;}else{_0x268f85=0xce;}_0x5e824b[_0xacaf('0x18')](_0x268f85);return _0x5e824b[_0xacaf('0x1f')](_0xacaf('0x20'),_0x4c25c8+'-'+_0x5f5a93+'/'+_0x3ad95c)[_0xacaf('0x1a')](_0x10cfa2);}return null;};}function patchUpdates(_0x3ed37f){return function(_0x22ad61){try{jsonpatch['apply'](_0x22ad61,_0x3ed37f,!![]);}catch(_0x527586){return BPromise['reject'](_0x527586);}return _0x22ad61[_0xacaf('0x21')]();};}function saveUpdates(_0x3200bc,_0x2c58b0){return function(_0x32754c){if(_0x32754c){return _0x32754c[_0xacaf('0x22')](_0x3200bc)[_0xacaf('0x23')](function(_0x1ebe9e){return _0x1ebe9e;});}return null;};}function removeEntity(_0x2d0120,_0x2629d1){return function(_0x67e55d){if(_0x67e55d){return _0x67e55d[_0xacaf('0x24')]()[_0xacaf('0x23')](function(){_0x2d0120['status'](0xcc)[_0xacaf('0x19')]();});}};}function handleEntityNotFound(_0x3e6b95,_0x4b76c4){return function(_0x436f0f){if(!_0x436f0f){_0x3e6b95[_0xacaf('0x25')](0x194);}return _0x436f0f;};}function handleError(_0x51cc6f,_0x32a68a){_0x32a68a=_0x32a68a||0x1f4;return function(_0x13b987){logger[_0xacaf('0x26')](_0x13b987[_0xacaf('0x27')]);if(_0x13b987[_0xacaf('0x28')]){delete _0x13b987[_0xacaf('0x28')];}_0x51cc6f[_0xacaf('0x18')](_0x32a68a)['send'](_0x13b987);};}exports[_0xacaf('0x29')]=function(_0x493025,_0xc86f0f){var _0x3719ca={},_0x2aabc8={},_0x507d5d={'count':0x0,'rows':[]};var _0x25ca15=_[_0xacaf('0x2a')](db[_0xacaf('0x2b')][_0xacaf('0x2c')],function(_0x25ac3c){return{'name':_0x25ac3c[_0xacaf('0x2d')],'type':_0x25ac3c[_0xacaf('0x2e')][_0xacaf('0x2f')]};});_0x2aabc8[_0xacaf('0x30')]=_[_0xacaf('0x2a')](_0x25ca15,_0xacaf('0x28'));_0x2aabc8[_0xacaf('0x31')]=_[_0xacaf('0x32')](_0x493025[_0xacaf('0x31')]);_0x2aabc8[_0xacaf('0x33')]=_[_0xacaf('0x34')](_0x2aabc8[_0xacaf('0x30')],_0x2aabc8[_0xacaf('0x31')]);_0x3719ca['attributes']=_[_0xacaf('0x34')](_0x2aabc8[_0xacaf('0x30')],qs[_0xacaf('0x35')](_0x493025[_0xacaf('0x31')][_0xacaf('0x35')]));_0x3719ca[_0xacaf('0x36')]=_0x3719ca[_0xacaf('0x36')][_0xacaf('0x37')]?_0x3719ca['attributes']:_0x2aabc8['model'];if(!_0x493025[_0xacaf('0x31')][_0xacaf('0x38')](_0xacaf('0x39'))){_0x3719ca[_0xacaf('0x1d')]=qs[_0xacaf('0x1d')](_0x493025[_0xacaf('0x31')][_0xacaf('0x1d')]);_0x3719ca[_0xacaf('0x1b')]=qs['offset'](_0x493025[_0xacaf('0x31')]['offset']);}_0x3719ca[_0xacaf('0x3a')]=qs['sort'](_0x493025['query'][_0xacaf('0x3b')]);_0x3719ca['where']=qs['filters'](_['pick'](_0x493025[_0xacaf('0x31')],_0x2aabc8[_0xacaf('0x33')]),_0x25ca15);if(_0x493025['query'][_0xacaf('0x3c')]){_0x3719ca[_0xacaf('0x3d')]=_[_0xacaf('0x3e')](_0x3719ca[_0xacaf('0x3d')],{'$or':_[_0xacaf('0x2a')](_0x25ca15,function(_0x4c0ff5){if(_0x4c0ff5[_0xacaf('0x2e')]!==_0xacaf('0x3f')){var _0x46fe65={};_0x46fe65[_0x4c0ff5[_0xacaf('0x28')]]={'$like':'%'+_0x493025[_0xacaf('0x31')][_0xacaf('0x3c')]+'%'};return _0x46fe65;}})});}_0x3719ca=_[_0xacaf('0x3e')]({},_0x3719ca,_0x493025[_0xacaf('0x40')]);var _0xdb87a1={'where':_0x3719ca[_0xacaf('0x3d')]};return db[_0xacaf('0x2b')][_0xacaf('0x1e')](_0xdb87a1)[_0xacaf('0x23')](function(_0x383875){_0x507d5d[_0xacaf('0x1e')]=_0x383875;if(_0x493025[_0xacaf('0x31')][_0xacaf('0x41')]){_0x3719ca[_0xacaf('0x42')]=[{'all':!![]}];}return db[_0xacaf('0x2b')][_0xacaf('0x43')](_0x3719ca);})[_0xacaf('0x23')](function(_0x64633a){_0x507d5d[_0xacaf('0x44')]=_0x64633a;return _0x507d5d;})['then'](respondWithFilteredResult(_0xc86f0f,_0x3719ca))[_0xacaf('0x45')](handleError(_0xc86f0f,null));};exports[_0xacaf('0x46')]=function(_0x100e26,_0x49f719){var _0x348611={'raw':!![],'where':{'id':_0x100e26[_0xacaf('0x47')]['id']}},_0x155dff={};_0x155dff[_0xacaf('0x30')]=_['keys'](db[_0xacaf('0x2b')][_0xacaf('0x2c')]);_0x155dff['query']=_[_0xacaf('0x32')](_0x100e26['query']);_0x155dff[_0xacaf('0x33')]=_[_0xacaf('0x34')](_0x155dff['model'],_0x155dff[_0xacaf('0x31')]);_0x348611[_0xacaf('0x36')]=_[_0xacaf('0x34')](_0x155dff['model'],qs['fields'](_0x100e26[_0xacaf('0x31')][_0xacaf('0x35')]));_0x348611['attributes']=_0x348611[_0xacaf('0x36')]['length']?_0x348611[_0xacaf('0x36')]:_0x155dff['model'];if(_0x100e26['query'][_0xacaf('0x41')]){_0x348611[_0xacaf('0x42')]=[{'all':!![]}];}_0x348611=_[_0xacaf('0x3e')]({},_0x348611,_0x100e26['options']);return db[_0xacaf('0x2b')]['find'](_0x348611)[_0xacaf('0x23')](handleEntityNotFound(_0x49f719,null))[_0xacaf('0x23')](respondWithResult(_0x49f719,null))[_0xacaf('0x45')](handleError(_0x49f719,null));};exports[_0xacaf('0x22')]=function(_0x3ce741,_0xd6d9f){if(_0x3ce741[_0xacaf('0x48')]['id']){delete _0x3ce741[_0xacaf('0x48')]['id'];}return db['CmHopperBlack'][_0xacaf('0x49')]({'where':{'id':_0x3ce741[_0xacaf('0x47')]['id']}})['then'](handleEntityNotFound(_0xd6d9f,null))['then'](saveUpdates(_0x3ce741[_0xacaf('0x48')],null))[_0xacaf('0x23')](respondWithResult(_0xd6d9f,null))[_0xacaf('0x45')](handleError(_0xd6d9f,null));};exports[_0xacaf('0x24')]=function(_0x12043a,_0x2848bd){return db[_0xacaf('0x2b')][_0xacaf('0x49')]({'where':{'id':_0x12043a['params']['id']}})[_0xacaf('0x23')](handleEntityNotFound(_0x2848bd,null))[_0xacaf('0x23')](removeEntity(_0x2848bd,null))[_0xacaf('0x45')](handleError(_0x2848bd,null));};exports[_0xacaf('0x4a')]=function(_0xc850c1,_0x594ef9){return db['CmHopperBlack'][_0xacaf('0x4a')]()[_0xacaf('0x23')](respondWithResult(_0x594ef9,null))[_0xacaf('0x45')](handleError(_0x594ef9,null));}; \ No newline at end of file +var _0x98ee=['model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','findAll','rows','catch','params','length','includeAll','options','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','key'];(function(_0xb84552,_0x35fa43){var _0x3cb084=function(_0x3cc76a){while(--_0x3cc76a){_0xb84552['push'](_0xb84552['shift']());}};_0x3cb084(++_0x35fa43);}(_0x98ee,0x131));var _0xe98e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x98ee[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xe98e('0x0'));var rimraf=require(_0xe98e('0x1'));var zipdir=require(_0xe98e('0x2'));var jsonpatch=require(_0xe98e('0x3'));var rp=require(_0xe98e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe98e('0x5'));var util=require(_0xe98e('0x6'));var path=require(_0xe98e('0x7'));var sox=require(_0xe98e('0x8'));var csv=require(_0xe98e('0x9'));var ejs=require(_0xe98e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe98e('0xb'));var squel=require('squel');var crypto=require(_0xe98e('0xc'));var jsforce=require(_0xe98e('0xd'));var deskjs=require(_0xe98e('0xe'));var toCsv=require(_0xe98e('0x9'));var querystring=require('querystring');var Papa=require(_0xe98e('0xf'));var Redis=require('ioredis');var authService=require(_0xe98e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe98e('0x11'));var hardwareService=require(_0xe98e('0x12'));var logger=require(_0xe98e('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe98e('0x14'));var db=require(_0xe98e('0x15'))['db'];function respondWithStatusCode(_0x559d9f,_0x15314e){_0x15314e=_0x15314e||0xcc;return function(_0x26553d){if(_0x26553d){return _0x559d9f[_0xe98e('0x16')](_0x15314e);}return _0x559d9f[_0xe98e('0x17')](_0x15314e)[_0xe98e('0x18')]();};}function respondWithResult(_0x12a590,_0x37b91e){_0x37b91e=_0x37b91e||0xc8;return function(_0x44f80e){if(_0x44f80e){return _0x12a590['status'](_0x37b91e)[_0xe98e('0x19')](_0x44f80e);}};}function respondWithFilteredResult(_0x51c379,_0x2fe62c){return function(_0x3735b1){if(_0x3735b1){var _0x1549a1=typeof _0x2fe62c[_0xe98e('0x1a')]==='undefined'&&typeof _0x2fe62c[_0xe98e('0x1b')]===_0xe98e('0x1c');var _0x56b686=_0x3735b1[_0xe98e('0x1d')];var _0x1eacdb=_0x1549a1?0x0:_0x2fe62c['offset'];var _0x27fe66=_0x1549a1?_0x3735b1[_0xe98e('0x1d')]:_0x2fe62c[_0xe98e('0x1a')]+_0x2fe62c[_0xe98e('0x1b')];var _0x3e2af1;if(_0x27fe66>=_0x56b686){_0x27fe66=_0x56b686;_0x3e2af1=0xc8;}else{_0x3e2af1=0xce;}_0x51c379['status'](_0x3e2af1);return _0x51c379['set'](_0xe98e('0x1e'),_0x1eacdb+'-'+_0x27fe66+'/'+_0x56b686)['json'](_0x3735b1);}return null;};}function patchUpdates(_0x5350d6){return function(_0x4a6c81){try{jsonpatch[_0xe98e('0x1f')](_0x4a6c81,_0x5350d6,!![]);}catch(_0x12398a){return BPromise['reject'](_0x12398a);}return _0x4a6c81[_0xe98e('0x20')]();};}function saveUpdates(_0x35a1ea,_0x10ad80){return function(_0x389812){if(_0x389812){return _0x389812[_0xe98e('0x21')](_0x35a1ea)[_0xe98e('0x22')](function(_0x777857){return _0x777857;});}return null;};}function removeEntity(_0x37894c,_0x519162){return function(_0xd33468){if(_0xd33468){return _0xd33468[_0xe98e('0x23')]()[_0xe98e('0x22')](function(){_0x37894c[_0xe98e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22fad5,_0x3a02dd){return function(_0x3ad40b){if(!_0x3ad40b){_0x22fad5[_0xe98e('0x16')](0x194);}return _0x3ad40b;};}function handleError(_0x2b37b8,_0x5ed5f3){_0x5ed5f3=_0x5ed5f3||0x1f4;return function(_0x305502){logger['error'](_0x305502[_0xe98e('0x24')]);if(_0x305502[_0xe98e('0x25')]){delete _0x305502[_0xe98e('0x25')];}_0x2b37b8['status'](_0x5ed5f3)[_0xe98e('0x26')](_0x305502);};}exports[_0xe98e('0x27')]=function(_0x566858,_0x57438c){var _0xd3b22e={},_0x2c40bb={},_0x578442={'count':0x0,'rows':[]};var _0x47f4c5=_[_0xe98e('0x28')](db[_0xe98e('0x29')][_0xe98e('0x2a')],function(_0x946c63){return{'name':_0x946c63[_0xe98e('0x2b')],'type':_0x946c63['type'][_0xe98e('0x2c')]};});_0x2c40bb[_0xe98e('0x2d')]=_[_0xe98e('0x28')](_0x47f4c5,'name');_0x2c40bb[_0xe98e('0x2e')]=_[_0xe98e('0x2f')](_0x566858['query']);_0x2c40bb[_0xe98e('0x30')]=_['intersection'](_0x2c40bb['model'],_0x2c40bb['query']);_0xd3b22e[_0xe98e('0x31')]=_[_0xe98e('0x32')](_0x2c40bb[_0xe98e('0x2d')],qs[_0xe98e('0x33')](_0x566858['query'][_0xe98e('0x33')]));_0xd3b22e[_0xe98e('0x31')]=_0xd3b22e['attributes']['length']?_0xd3b22e[_0xe98e('0x31')]:_0x2c40bb[_0xe98e('0x2d')];if(!_0x566858[_0xe98e('0x2e')][_0xe98e('0x34')]('nolimit')){_0xd3b22e[_0xe98e('0x1b')]=qs['limit'](_0x566858[_0xe98e('0x2e')][_0xe98e('0x1b')]);_0xd3b22e['offset']=qs[_0xe98e('0x1a')](_0x566858[_0xe98e('0x2e')][_0xe98e('0x1a')]);}_0xd3b22e[_0xe98e('0x35')]=qs[_0xe98e('0x36')](_0x566858['query'][_0xe98e('0x36')]);_0xd3b22e['where']=qs[_0xe98e('0x30')](_[_0xe98e('0x37')](_0x566858[_0xe98e('0x2e')],_0x2c40bb[_0xe98e('0x30')]),_0x47f4c5);if(_0x566858[_0xe98e('0x2e')][_0xe98e('0x38')]){_0xd3b22e[_0xe98e('0x39')]=_[_0xe98e('0x3a')](_0xd3b22e['where'],{'$or':_[_0xe98e('0x28')](_0x47f4c5,function(_0x15696c){if(_0x15696c['type']!==_0xe98e('0x3b')){var _0x352a79={};_0x352a79[_0x15696c[_0xe98e('0x25')]]={'$like':'%'+_0x566858[_0xe98e('0x2e')][_0xe98e('0x38')]+'%'};return _0x352a79;}})});}_0xd3b22e=_['merge']({},_0xd3b22e,_0x566858['options']);var _0x2ec0ab={'where':_0xd3b22e[_0xe98e('0x39')]};return db['CmHopperBlack'][_0xe98e('0x1d')](_0x2ec0ab)[_0xe98e('0x22')](function(_0x13a7e4){_0x578442[_0xe98e('0x1d')]=_0x13a7e4;if(_0x566858['query']['includeAll']){_0xd3b22e['include']=[{'all':!![]}];}return db[_0xe98e('0x29')][_0xe98e('0x3c')](_0xd3b22e);})['then'](function(_0x2189d0){_0x578442[_0xe98e('0x3d')]=_0x2189d0;return _0x578442;})[_0xe98e('0x22')](respondWithFilteredResult(_0x57438c,_0xd3b22e))[_0xe98e('0x3e')](handleError(_0x57438c,null));};exports['show']=function(_0x525384,_0xbfd07a){var _0x4f6da1={'raw':!![],'where':{'id':_0x525384[_0xe98e('0x3f')]['id']}},_0x5f0b04={};_0x5f0b04['model']=_['keys'](db[_0xe98e('0x29')]['rawAttributes']);_0x5f0b04['query']=_[_0xe98e('0x2f')](_0x525384['query']);_0x5f0b04[_0xe98e('0x30')]=_['intersection'](_0x5f0b04[_0xe98e('0x2d')],_0x5f0b04['query']);_0x4f6da1[_0xe98e('0x31')]=_['intersection'](_0x5f0b04['model'],qs[_0xe98e('0x33')](_0x525384['query'][_0xe98e('0x33')]));_0x4f6da1['attributes']=_0x4f6da1[_0xe98e('0x31')][_0xe98e('0x40')]?_0x4f6da1[_0xe98e('0x31')]:_0x5f0b04['model'];if(_0x525384[_0xe98e('0x2e')][_0xe98e('0x41')]){_0x4f6da1['include']=[{'all':!![]}];}_0x4f6da1=_[_0xe98e('0x3a')]({},_0x4f6da1,_0x525384[_0xe98e('0x42')]);return db[_0xe98e('0x29')][_0xe98e('0x43')](_0x4f6da1)[_0xe98e('0x22')](handleEntityNotFound(_0xbfd07a,null))[_0xe98e('0x22')](respondWithResult(_0xbfd07a,null))[_0xe98e('0x3e')](handleError(_0xbfd07a,null));};exports[_0xe98e('0x21')]=function(_0x35441f,_0x2e3be3){if(_0x35441f[_0xe98e('0x44')]['id']){delete _0x35441f[_0xe98e('0x44')]['id'];}return db['CmHopperBlack'][_0xe98e('0x43')]({'where':{'id':_0x35441f['params']['id']}})[_0xe98e('0x22')](handleEntityNotFound(_0x2e3be3,null))[_0xe98e('0x22')](saveUpdates(_0x35441f['body'],null))['then'](respondWithResult(_0x2e3be3,null))['catch'](handleError(_0x2e3be3,null));};exports[_0xe98e('0x23')]=function(_0x2f6770,_0x4786eb){return db[_0xe98e('0x29')][_0xe98e('0x43')]({'where':{'id':_0x2f6770[_0xe98e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4786eb,null))[_0xe98e('0x22')](removeEntity(_0x4786eb,null))[_0xe98e('0x3e')](handleError(_0x4786eb,null));};exports['describe']=function(_0x5b9eb0,_0x241507){return db[_0xe98e('0x29')][_0xe98e('0x45')]()['then'](respondWithResult(_0x241507,null))[_0xe98e('0x3e')](handleError(_0x241507,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index a83cf16..c9b4e8b 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 _0xbc59=['define','CmHopperBlack','lodash','util','api','moment','bluebird','request-promise','rimraf','./cmHopperBlack.attributes'];(function(_0x3baa08,_0x49e097){var _0x46043c=function(_0x42002c){while(--_0x42002c){_0x3baa08['push'](_0x3baa08['shift']());}};_0x46043c(++_0x49e097);}(_0xbc59,0x110));var _0x9bc5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xbc59[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x9bc5('0x0'));var util=require(_0x9bc5('0x1'));var logger=require('../../config/logger')(_0x9bc5('0x2'));var moment=require(_0x9bc5('0x3'));var BPromise=require(_0x9bc5('0x4'));var rp=require(_0x9bc5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9bc5('0x6'));var config=require('../../config/environment');var attributes=require(_0x9bc5('0x7'));module['exports']=function(_0x4a5f85,_0x4578d3){return _0x4a5f85[_0x9bc5('0x8')](_0x9bc5('0x9'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d5c=['./cmHopperBlack.attributes','define','cm_hopper_black','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5d5c,0x14d));var _0xc5d5=function(_0x8c5bf6,_0x3f85ea){_0x8c5bf6=_0x8c5bf6-0x0;var _0x502693=_0x5d5c[_0x8c5bf6];return _0x502693;};'use strict';var _=require(_0xc5d5('0x0'));var util=require(_0xc5d5('0x1'));var logger=require(_0xc5d5('0x2'))(_0xc5d5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc5d5('0x4'));var fs=require('fs');var path=require(_0xc5d5('0x5'));var rimraf=require(_0xc5d5('0x6'));var config=require(_0xc5d5('0x7'));var attributes=require(_0xc5d5('0x8'));module['exports']=function(_0x2e9a3f,_0x31dc6c){return _0x2e9a3f[_0xc5d5('0x9')]('CmHopperBlack',attributes,{'tableName':_0xc5d5('0xa'),'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 5a857d6..286438d 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 _0xc8e7=['info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','limit','include','map','model','stringify','update','body','DestroyCmHopperBlack','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then'];(function(_0x427eed,_0x1da5b4){var _0x272a8a=function(_0x4abe63){while(--_0x4abe63){_0x427eed['push'](_0x427eed['shift']());}};_0x272a8a(++_0x1da5b4);}(_0xc8e7,0x84));var _0x7c8e=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xc8e7[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0x7c8e('0x0'));var util=require('util');var moment=require(_0x7c8e('0x1'));var BPromise=require(_0x7c8e('0x2'));var rs=require(_0x7c8e('0x3'));var fs=require('fs');var Redis=require(_0x7c8e('0x4'));var db=require(_0x7c8e('0x5'))['db'];var utils=require(_0x7c8e('0x6'));var logger=require(_0x7c8e('0x7'))(_0x7c8e('0x8'));var config=require('../../config/environment');var jayson=require(_0x7c8e('0x9'));var client=jayson['client'][_0x7c8e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2dd412,_0xa4dde2,_0x4c67c4){return new BPromise(function(_0x4eb3f6,_0x58e4ac){return client['request'](_0x2dd412,_0x4c67c4)[_0x7c8e('0xb')](function(_0x1f7672){logger[_0x7c8e('0xc')](_0x7c8e('0xd'),_0xa4dde2,_0x7c8e('0xe'));logger[_0x7c8e('0xf')](_0x7c8e('0x10'),_0xa4dde2,_0x7c8e('0xe'),JSON['stringify'](_0x1f7672));if(_0x1f7672['error']){if(_0x1f7672[_0x7c8e('0x11')][_0x7c8e('0x12')]===0x1f4){logger['error'](_0x7c8e('0xd'),_0xa4dde2,_0x1f7672['error'][_0x7c8e('0x13')]);return _0x58e4ac(_0x1f7672[_0x7c8e('0x11')][_0x7c8e('0x13')]);}logger[_0x7c8e('0x11')](_0x7c8e('0xd'),_0xa4dde2,_0x1f7672['error'][_0x7c8e('0x13')]);return _0x4eb3f6(_0x1f7672[_0x7c8e('0x11')][_0x7c8e('0x13')]);}else{logger[_0x7c8e('0xc')]('CmHopperBlack,\x20%s,\x20%s',_0xa4dde2,_0x7c8e('0xe'));_0x4eb3f6(_0x1f7672[_0x7c8e('0x14')]['message']);}})[_0x7c8e('0x15')](function(_0x44d2f3){logger[_0x7c8e('0x11')](_0x7c8e('0xd'),_0xa4dde2,_0x44d2f3);_0x58e4ac(_0x44d2f3);});});}exports[_0x7c8e('0x16')]=function(_0x115299){var _0x296f82=this;return new Promise(function(_0x43fe94,_0x2f5412){return db[_0x7c8e('0x17')]['findAll']({'raw':_0x115299['options']?_0x115299[_0x7c8e('0x18')][_0x7c8e('0x19')]===undefined?!![]:![]:!![],'where':_0x115299[_0x7c8e('0x18')]?_0x115299[_0x7c8e('0x18')][_0x7c8e('0x1a')]||null:null,'attributes':_0x115299[_0x7c8e('0x18')]?_0x115299['options'][_0x7c8e('0x1b')]||null:null,'limit':_0x115299['options']?_0x115299['options'][_0x7c8e('0x1c')]||null:null,'include':_0x115299['options']?_0x115299[_0x7c8e('0x18')][_0x7c8e('0x1d')]?_[_0x7c8e('0x1e')](_0x115299[_0x7c8e('0x18')][_0x7c8e('0x1d')],function(_0x55c78d){return{'model':db[_0x55c78d[_0x7c8e('0x1f')]],'as':_0x55c78d['as'],'attributes':_0x55c78d[_0x7c8e('0x1b')],'include':_0x55c78d[_0x7c8e('0x1d')]?_[_0x7c8e('0x1e')](_0x55c78d['include'],function(_0x3ef439){return{'model':db[_0x3ef439[_0x7c8e('0x1f')]],'as':_0x3ef439['as'],'attributes':_0x3ef439[_0x7c8e('0x1b')],'include':_0x3ef439[_0x7c8e('0x1d')]?_['map'](_0x3ef439[_0x7c8e('0x1d')],function(_0x262fc3){return{'model':db[_0x262fc3['model']],'as':_0x262fc3['as'],'attributes':_0x262fc3[_0x7c8e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7c8e('0xb')](function(_0xed69a6){logger['info'](_0x7c8e('0x16'),_0x115299);logger['debug'](_0x7c8e('0x16'),_0x115299,JSON[_0x7c8e('0x20')](_0xed69a6));_0x43fe94(_0xed69a6);})[_0x7c8e('0x15')](function(_0x302053){logger[_0x7c8e('0x11')](_0x7c8e('0x16'),_0x302053['message'],_0x115299);_0x2f5412(_0x296f82[_0x7c8e('0x11')](0x1f4,_0x302053['message']));});});};exports['UpdateCmHopperBlack']=function(_0x223639){var _0x3e194d=this;return new Promise(function(_0x5d1db2,_0x5919dc){return db[_0x7c8e('0x17')][_0x7c8e('0x21')](_0x223639[_0x7c8e('0x22')],{'raw':_0x223639[_0x7c8e('0x18')]?_0x223639[_0x7c8e('0x18')][_0x7c8e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x223639[_0x7c8e('0x18')]?_0x223639['options'][_0x7c8e('0x1a')]||null:null,'attributes':_0x223639[_0x7c8e('0x18')]?_0x223639[_0x7c8e('0x18')][_0x7c8e('0x1b')]||null:null,'limit':_0x223639['options']?_0x223639[_0x7c8e('0x18')][_0x7c8e('0x1c')]||null:null})[_0x7c8e('0xb')](function(_0x6a9edb){logger[_0x7c8e('0xc')]('UpdateCmHopperBlack',_0x223639);logger[_0x7c8e('0xf')]('UpdateCmHopperBlack',_0x223639,JSON['stringify'](_0x6a9edb));_0x5d1db2(_0x6a9edb);})[_0x7c8e('0x15')](function(_0x5dceb4){logger[_0x7c8e('0x11')]('UpdateCmHopperBlack',_0x5dceb4['message'],_0x223639);_0x5919dc(_0x3e194d['error'](0x1f4,_0x5dceb4['message']));});});};exports['DestroyCmHopperBlack']=function(_0x4152c7){var _0x176951=this;return new Promise(function(_0x3c0a6c,_0x438ef5){return db[_0x7c8e('0x17')]['destroy']({'where':_0x4152c7['options']?_0x4152c7[_0x7c8e('0x18')][_0x7c8e('0x1a')]||null:null})['then'](function(_0x11101a){logger[_0x7c8e('0xc')]('DestroyCmHopperBlack',_0x4152c7);logger['debug'](_0x7c8e('0x23'),_0x4152c7,JSON[_0x7c8e('0x20')](_0x11101a));_0x3c0a6c(_0x11101a);})[_0x7c8e('0x15')](function(_0xf0a67e){logger[_0x7c8e('0x11')]('DestroyCmHopperBlack',_0xf0a67e[_0x7c8e('0x13')],_0x4152c7);_0x438ef5(_0x176951[_0x7c8e('0x11')](0x1f4,_0xf0a67e['message']));});});}; \ No newline at end of file +var _0xf7af=['util','moment','bluebird','randomstring','../../mysqldb','rpc','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','map','include','model','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy'];(function(_0x4cc492,_0x162c85){var _0x1f36b9=function(_0xce4b2){while(--_0xce4b2){_0x4cc492['push'](_0x4cc492['shift']());}};_0x1f36b9(++_0x162c85);}(_0xf7af,0xde));var _0xff7a=function(_0x53cd9f,_0xac8289){_0x53cd9f=_0x53cd9f-0x0;var _0x3cab9e=_0xf7af[_0x53cd9f];return _0x3cab9e;};'use strict';var _=require('lodash');var util=require(_0xff7a('0x0'));var moment=require(_0xff7a('0x1'));var BPromise=require(_0xff7a('0x2'));var rs=require(_0xff7a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xff7a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xff7a('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xff7a('0x6')][_0xff7a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x11919a,_0xd08767,_0x24f037){return new BPromise(function(_0x5e013f,_0x21469b){return client[_0xff7a('0x8')](_0x11919a,_0x24f037)[_0xff7a('0x9')](function(_0x5bd852){logger[_0xff7a('0xa')](_0xff7a('0xb'),_0xd08767,'request\x20sent');logger[_0xff7a('0xc')](_0xff7a('0xd'),_0xd08767,_0xff7a('0xe'),JSON[_0xff7a('0xf')](_0x5bd852));if(_0x5bd852['error']){if(_0x5bd852['error'][_0xff7a('0x10')]===0x1f4){logger['error'](_0xff7a('0xb'),_0xd08767,_0x5bd852[_0xff7a('0x11')][_0xff7a('0x12')]);return _0x21469b(_0x5bd852[_0xff7a('0x11')][_0xff7a('0x12')]);}logger[_0xff7a('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0xd08767,_0x5bd852[_0xff7a('0x11')][_0xff7a('0x12')]);return _0x5e013f(_0x5bd852[_0xff7a('0x11')]['message']);}else{logger[_0xff7a('0xa')](_0xff7a('0xb'),_0xd08767,_0xff7a('0xe'));_0x5e013f(_0x5bd852[_0xff7a('0x13')][_0xff7a('0x12')]);}})[_0xff7a('0x14')](function(_0x5ca97e){logger['error'](_0xff7a('0xb'),_0xd08767,_0x5ca97e);_0x21469b(_0x5ca97e);});});}exports[_0xff7a('0x15')]=function(_0x37a1c2){var _0x81b3b7=this;return new Promise(function(_0x228de6,_0xc05c7b){return db[_0xff7a('0x16')][_0xff7a('0x17')]({'raw':_0x37a1c2[_0xff7a('0x18')]?_0x37a1c2[_0xff7a('0x18')][_0xff7a('0x19')]===undefined?!![]:![]:!![],'where':_0x37a1c2[_0xff7a('0x18')]?_0x37a1c2['options'][_0xff7a('0x1a')]||null:null,'attributes':_0x37a1c2[_0xff7a('0x18')]?_0x37a1c2[_0xff7a('0x18')][_0xff7a('0x1b')]||null:null,'limit':_0x37a1c2['options']?_0x37a1c2[_0xff7a('0x18')][_0xff7a('0x1c')]||null:null,'include':_0x37a1c2['options']?_0x37a1c2['options']['include']?_[_0xff7a('0x1d')](_0x37a1c2[_0xff7a('0x18')][_0xff7a('0x1e')],function(_0x36cc8c){return{'model':db[_0x36cc8c[_0xff7a('0x1f')]],'as':_0x36cc8c['as'],'attributes':_0x36cc8c[_0xff7a('0x1b')],'include':_0x36cc8c['include']?_['map'](_0x36cc8c[_0xff7a('0x1e')],function(_0x4e28ea){return{'model':db[_0x4e28ea[_0xff7a('0x1f')]],'as':_0x4e28ea['as'],'attributes':_0x4e28ea['attributes'],'include':_0x4e28ea[_0xff7a('0x1e')]?_[_0xff7a('0x1d')](_0x4e28ea[_0xff7a('0x1e')],function(_0x373b64){return{'model':db[_0x373b64['model']],'as':_0x373b64['as'],'attributes':_0x373b64[_0xff7a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x265c81){logger[_0xff7a('0xa')]('GetCmHopperBlack',_0x37a1c2);logger[_0xff7a('0xc')](_0xff7a('0x15'),_0x37a1c2,JSON['stringify'](_0x265c81));_0x228de6(_0x265c81);})['catch'](function(_0x396554){logger[_0xff7a('0x11')](_0xff7a('0x15'),_0x396554[_0xff7a('0x12')],_0x37a1c2);_0xc05c7b(_0x81b3b7['error'](0x1f4,_0x396554[_0xff7a('0x12')]));});});};exports[_0xff7a('0x20')]=function(_0x2a7b00){var _0x4abf36=this;return new Promise(function(_0x3cbd6b,_0x370f84){return db[_0xff7a('0x16')][_0xff7a('0x21')](_0x2a7b00[_0xff7a('0x22')],{'raw':_0x2a7b00[_0xff7a('0x18')]?_0x2a7b00['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a7b00['options']?_0x2a7b00[_0xff7a('0x18')][_0xff7a('0x1a')]||null:null,'attributes':_0x2a7b00['options']?_0x2a7b00['options'][_0xff7a('0x1b')]||null:null,'limit':_0x2a7b00[_0xff7a('0x18')]?_0x2a7b00[_0xff7a('0x18')][_0xff7a('0x1c')]||null:null})[_0xff7a('0x9')](function(_0x1d52af){logger[_0xff7a('0xa')](_0xff7a('0x20'),_0x2a7b00);logger['debug'](_0xff7a('0x20'),_0x2a7b00,JSON['stringify'](_0x1d52af));_0x3cbd6b(_0x1d52af);})[_0xff7a('0x14')](function(_0x1c95d8){logger['error'](_0xff7a('0x20'),_0x1c95d8[_0xff7a('0x12')],_0x2a7b00);_0x370f84(_0x4abf36['error'](0x1f4,_0x1c95d8[_0xff7a('0x12')]));});});};exports[_0xff7a('0x23')]=function(_0x448937){var _0x6793e3=this;return new Promise(function(_0x38d5fb,_0x447ca7){return db[_0xff7a('0x16')][_0xff7a('0x24')]({'where':_0x448937[_0xff7a('0x18')]?_0x448937['options'][_0xff7a('0x1a')]||null:null})[_0xff7a('0x9')](function(_0x23b606){logger[_0xff7a('0xa')]('DestroyCmHopperBlack',_0x448937);logger[_0xff7a('0xc')]('DestroyCmHopperBlack',_0x448937,JSON[_0xff7a('0xf')](_0x23b606));_0x38d5fb(_0x23b606);})[_0xff7a('0x14')](function(_0x12001d){logger[_0xff7a('0x11')](_0xff7a('0x23'),_0x12001d[_0xff7a('0x12')],_0x448937);_0x447ca7(_0x6793e3[_0xff7a('0x11')](0x1f4,_0x12001d[_0xff7a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 2b5db30..a1a1c0e 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 _0x0424=['isAuthenticated','index','/describe','/:id','show','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','./cmHopperBlack.controller','get'];(function(_0x2e63e8,_0xed68f5){var _0x3fe904=function(_0x10e876){while(--_0x10e876){_0x2e63e8['push'](_0x2e63e8['shift']());}};_0x3fe904(++_0xed68f5);}(_0x0424,0x159));var _0x4042=function(_0x2b0267,_0x59cab1){_0x2b0267=_0x2b0267-0x0;var _0x289a4a=_0x0424[_0x2b0267];return _0x289a4a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4042('0x0'));var timeout=require(_0x4042('0x1'));var express=require(_0x4042('0x2'));var router=express[_0x4042('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4042('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4042('0x5'));router[_0x4042('0x6')]('/',auth[_0x4042('0x7')](),controller[_0x4042('0x8')]);router[_0x4042('0x6')](_0x4042('0x9'),auth[_0x4042('0x7')](),controller['describe']);router['get'](_0x4042('0xa'),auth[_0x4042('0x7')](),controller[_0x4042('0xb')]);router['put'](_0x4042('0xa'),auth[_0x4042('0x7')](),controller[_0x4042('0xc')]);router[_0x4042('0xd')](_0x4042('0xa'),auth[_0x4042('0x7')](),controller[_0x4042('0xe')]);module[_0x4042('0xf')]=router; \ No newline at end of file +var _0x4fb4=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','show','put','/:id','update','delete','destroy'];(function(_0x468a77,_0x1382be){var _0x2d1c33=function(_0x2f2e83){while(--_0x2f2e83){_0x468a77['push'](_0x468a77['shift']());}};_0x2d1c33(++_0x1382be);}(_0x4fb4,0x190));var _0x44fb=function(_0x157dc7,_0x540581){_0x157dc7=_0x157dc7-0x0;var _0x21371f=_0x4fb4[_0x157dc7];return _0x21371f;};'use strict';var multer=require('multer');var util=require(_0x44fb('0x0'));var path=require(_0x44fb('0x1'));var timeout=require(_0x44fb('0x2'));var express=require(_0x44fb('0x3'));var router=express[_0x44fb('0x4')]();var fs_extra=require(_0x44fb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x44fb('0x6'));var config=require(_0x44fb('0x7'));var controller=require(_0x44fb('0x8'));router[_0x44fb('0x9')]('/',auth[_0x44fb('0xa')](),controller[_0x44fb('0xb')]);router[_0x44fb('0x9')](_0x44fb('0xc'),auth['isAuthenticated'](),controller[_0x44fb('0xd')]);router[_0x44fb('0x9')]('/:id',auth[_0x44fb('0xa')](),controller[_0x44fb('0xe')]);router[_0x44fb('0xf')](_0x44fb('0x10'),auth[_0x44fb('0xa')](),controller[_0x44fb('0x11')]);router[_0x44fb('0x12')](_0x44fb('0x10'),auth[_0x44fb('0xa')](),controller[_0x44fb('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index e899b21..76fcf3f 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 _0x2e8a=['BOOLEAN','exports','STRING','DATE','INTEGER','getDataValue','endtime','followuptime','diff','seconds','dispositionat'];(function(_0x23c8de,_0x132069){var _0x3628b6=function(_0x270abe){while(--_0x270abe){_0x23c8de['push'](_0x23c8de['shift']());}};_0x3628b6(++_0x132069);}(_0x2e8a,0x7a));var _0xa2e8=function(_0x179b74,_0x5dc97d){_0x179b74=_0x179b74-0x0;var _0x268f76=_0x2e8a[_0x179b74];return _0x268f76;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xa2e8('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xa2e8('0x1')]},'scheduledat':{'type':Sequelize[_0xa2e8('0x2')]},'countbusyretry':{'type':Sequelize[_0xa2e8('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa2e8('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa2e8('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xa2e8('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xa2e8('0x1')]},'originatecalleridnum':{'type':Sequelize[_0xa2e8('0x1')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xa2e8('0x1')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xa2e8('0x2')]},'droptime':{'type':Sequelize[_0xa2e8('0x2')]},'endtime':{'type':Sequelize[_0xa2e8('0x2')]},'ringtime':{'type':Sequelize[_0xa2e8('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xa2e8('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xa2e8('0x1')]},'campaign':{'type':Sequelize[_0xa2e8('0x1')]},'campaigntype':{'type':Sequelize[_0xa2e8('0x1')]},'membername':{'type':Sequelize[_0xa2e8('0x1')]},'reason':{'type':Sequelize[_0xa2e8('0x1')]},'disposition':{'type':Sequelize[_0xa2e8('0x1')]},'secondDisposition':{'type':Sequelize[_0xa2e8('0x1')]},'thirdDisposition':{'type':Sequelize[_0xa2e8('0x1')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0xd49800){var _0x175bc1=this[_0xa2e8('0x4')](_0xa2e8('0x5'));if(_0x175bc1&&_0xd49800){this['setDataValue'](_0xa2e8('0x6'),moment(_0xd49800)[_0xa2e8('0x7')](moment(_0x175bc1),_0xa2e8('0x8')));}return this['setDataValue'](_0xa2e8('0x9'),_0xd49800);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xa2e8('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xa2e8('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xa2e8('0x2')]},'callback':{'type':Sequelize[_0xa2e8('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa2e8('0x2')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xa2e8('0x2')]},'recallme':{'type':Sequelize[_0xa2e8('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xa2e8('0x2')]},'countnosuchnumberretry':{'type':Sequelize[_0xa2e8('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa2e8('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa2e8('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa2e8('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x247f=['INTEGER','getDataValue','endtime','setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize','moment','exports','STRING','DATE'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x247f,0xd8));var _0xf247=function(_0xac2e59,_0x24a451){_0xac2e59=_0xac2e59-0x0;var _0x8c6cf2=_0x247f[_0xac2e59];return _0x8c6cf2;};'use strict';var Sequelize=require(_0xf247('0x0'));var moment=require(_0xf247('0x1'));module[_0xf247('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xf247('0x3')]},'scheduledat':{'type':Sequelize[_0xf247('0x4')]},'countbusyretry':{'type':Sequelize[_0xf247('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf247('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf247('0x5')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xf247('0x5')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xf247('0x3')]},'originatecalleridname':{'type':Sequelize[_0xf247('0x3')]},'calleridnum':{'type':Sequelize[_0xf247('0x3')]},'calleridname':{'type':Sequelize[_0xf247('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xf247('0x4')]},'answertime':{'type':Sequelize[_0xf247('0x4')]},'droptime':{'type':Sequelize[_0xf247('0x4')]},'endtime':{'type':Sequelize[_0xf247('0x4')]},'ringtime':{'type':Sequelize[_0xf247('0x5')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xf247('0x5')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xf247('0x5')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xf247('0x5')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xf247('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xf247('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xf247('0x3')]},'secondDisposition':{'type':Sequelize[_0xf247('0x3')]},'thirdDisposition':{'type':Sequelize[_0xf247('0x3')]},'dispositionat':{'type':Sequelize[_0xf247('0x4')],'set':function(_0xad6c2e){var _0x385a69=this[_0xf247('0x6')](_0xf247('0x7'));if(_0x385a69&&_0xad6c2e){this[_0xf247('0x8')](_0xf247('0x9'),moment(_0xad6c2e)[_0xf247('0xa')](moment(_0x385a69),_0xf247('0xb')));}return this[_0xf247('0x8')]('dispositionat',_0xad6c2e);}},'amd':{'type':Sequelize[_0xf247('0xc')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xf247('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xf247('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0xf247('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xf247('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xf247('0x4')]},'deleted':{'type':Sequelize[_0xf247('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xf247('0x4')]},'recallme':{'type':Sequelize[_0xf247('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xf247('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xf247('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf247('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index ed6022a..ac240be 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 _0xf494=['find','describe','body','uniqueid','params','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','COUNT','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','congestionContacts','reCallContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','select','ANY_VALUE(calleridnum)','field','NOW()','createdAt','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','group','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','CmHopperFinal','includeAll','include','findAll','rows','catch','length'];(function(_0x492bf2,_0x3dc9ce){var _0x413bb4=function(_0x5bc54a){while(--_0x5bc54a){_0x492bf2['push'](_0x492bf2['shift']());}};_0x413bb4(++_0x3dc9ce);}(_0xf494,0x1c6));var _0x4f49=function(_0x2e3657,_0x753c06){_0x2e3657=_0x2e3657-0x0;var _0x505603=_0xf494[_0x2e3657];return _0x505603;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];function respondWithStatusCode(_0x12527d,_0x4bf89f){_0x4bf89f=_0x4bf89f||0xcc;return function(_0x1e1c37){if(_0x1e1c37){return _0x12527d[_0x4f49('0x19')](_0x4bf89f);}return _0x12527d[_0x4f49('0x1a')](_0x4bf89f)[_0x4f49('0x1b')]();};}function respondWithResult(_0x1a0f1e,_0x2f0131){_0x2f0131=_0x2f0131||0xc8;return function(_0xfdb477){if(_0xfdb477){return _0x1a0f1e['status'](_0x2f0131)[_0x4f49('0x1c')](_0xfdb477);}};}function respondWithFilteredResult(_0x1f2d0d,_0x415e83){return function(_0x5878f4){if(_0x5878f4){var _0x5bdfaf=typeof _0x415e83[_0x4f49('0x1d')]===_0x4f49('0x1e')&&typeof _0x415e83[_0x4f49('0x1f')]==='undefined';var _0x1dccfd=_0x5878f4[_0x4f49('0x20')];var _0x4e85df=_0x5bdfaf?0x0:_0x415e83['offset'];var _0x5bb23b=_0x5bdfaf?_0x5878f4['count']:_0x415e83['offset']+_0x415e83[_0x4f49('0x1f')];var _0x1834f4;if(_0x5bb23b>=_0x1dccfd){_0x5bb23b=_0x1dccfd;_0x1834f4=0xc8;}else{_0x1834f4=0xce;}_0x1f2d0d[_0x4f49('0x1a')](_0x1834f4);return _0x1f2d0d[_0x4f49('0x21')]('Content-Range',_0x4e85df+'-'+_0x5bb23b+'/'+_0x1dccfd)[_0x4f49('0x1c')](_0x5878f4);}return null;};}function patchUpdates(_0x2aed27){return function(_0x197a49){try{jsonpatch[_0x4f49('0x22')](_0x197a49,_0x2aed27,!![]);}catch(_0xea82f8){return BPromise['reject'](_0xea82f8);}return _0x197a49[_0x4f49('0x23')]();};}function saveUpdates(_0x357446,_0x3ae590){return function(_0x53b57d){if(_0x53b57d){return _0x53b57d[_0x4f49('0x24')](_0x357446)[_0x4f49('0x25')](function(_0x32ca7b){return _0x32ca7b;});}return null;};}function removeEntity(_0x43c458,_0x9d30aa){return function(_0x36187b){if(_0x36187b){return _0x36187b['destroy']()['then'](function(){_0x43c458[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x4fedbb,_0x408552){return function(_0x2c1519){if(!_0x2c1519){_0x4fedbb[_0x4f49('0x19')](0x194);}return _0x2c1519;};}function handleError(_0x525950,_0xc54070){_0xc54070=_0xc54070||0x1f4;return function(_0x2eed1c){logger[_0x4f49('0x26')](_0x2eed1c[_0x4f49('0x27')]);if(_0x2eed1c[_0x4f49('0x28')]){delete _0x2eed1c[_0x4f49('0x28')];}_0x525950['status'](_0xc54070)['send'](_0x2eed1c);};}exports[_0x4f49('0x29')]=function(_0x2c00ee,_0x605c91){var _0x560050={},_0x3cbfbd={},_0x206203={'count':0x0,'rows':[]};var _0x43d8e3=_['map'](db['CmHopperFinal'][_0x4f49('0x2a')],function(_0x27d004){return{'name':_0x27d004[_0x4f49('0x2b')],'type':_0x27d004['type'][_0x4f49('0x2c')]};});_0x3cbfbd[_0x4f49('0x2d')]=_[_0x4f49('0x2e')](_0x43d8e3,_0x4f49('0x28'));_0x3cbfbd[_0x4f49('0x2f')]=_[_0x4f49('0x30')](_0x2c00ee[_0x4f49('0x2f')]);_0x3cbfbd[_0x4f49('0x31')]=_[_0x4f49('0x32')](_0x3cbfbd[_0x4f49('0x2d')],_0x3cbfbd[_0x4f49('0x2f')]);_0x560050[_0x4f49('0x33')]=_[_0x4f49('0x32')](_0x3cbfbd[_0x4f49('0x2d')],qs[_0x4f49('0x34')](_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x34')]));_0x560050[_0x4f49('0x33')]=_0x560050[_0x4f49('0x33')]['length']?_0x560050[_0x4f49('0x33')]:_0x3cbfbd[_0x4f49('0x2d')];if(!_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x35')](_0x4f49('0x36'))){_0x560050[_0x4f49('0x1f')]=qs[_0x4f49('0x1f')](_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x1f')]);_0x560050[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x1d')]);}_0x560050['order']=qs[_0x4f49('0x37')](_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x37')]);_0x560050[_0x4f49('0x38')]=qs[_0x4f49('0x31')](_[_0x4f49('0x39')](_0x2c00ee[_0x4f49('0x2f')],_0x3cbfbd[_0x4f49('0x31')]),_0x43d8e3);if(_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x3a')]){_0x560050[_0x4f49('0x38')]=_[_0x4f49('0x3b')](_0x560050[_0x4f49('0x38')],{'$or':_[_0x4f49('0x2e')](_0x43d8e3,function(_0x4e3f72){if(_0x4e3f72[_0x4f49('0x3c')]!==_0x4f49('0x3d')){var _0x543605={};_0x543605[_0x4e3f72[_0x4f49('0x28')]]={'$like':'%'+_0x2c00ee[_0x4f49('0x2f')]['filter']+'%'};return _0x543605;}})});}_0x560050=_[_0x4f49('0x3b')]({},_0x560050,_0x2c00ee[_0x4f49('0x3e')]);var _0x2548ad={'where':_0x560050[_0x4f49('0x38')]};return db[_0x4f49('0x3f')][_0x4f49('0x20')](_0x2548ad)[_0x4f49('0x25')](function(_0x5d464e){_0x206203['count']=_0x5d464e;if(_0x2c00ee['query'][_0x4f49('0x40')]){_0x560050[_0x4f49('0x41')]=[{'all':!![]}];}return db[_0x4f49('0x3f')][_0x4f49('0x42')](_0x560050);})[_0x4f49('0x25')](function(_0x1ecf6c){_0x206203[_0x4f49('0x43')]=_0x1ecf6c;return _0x206203;})[_0x4f49('0x25')](respondWithFilteredResult(_0x605c91,_0x560050))[_0x4f49('0x44')](handleError(_0x605c91,null));};exports['show']=function(_0x5238a3,_0x412395){var _0x432b5d={'raw':!![],'where':{'id':_0x5238a3['params']['id']}},_0x159642={};_0x159642[_0x4f49('0x2d')]=_['keys'](db['CmHopperFinal'][_0x4f49('0x2a')]);_0x159642[_0x4f49('0x2f')]=_[_0x4f49('0x30')](_0x5238a3['query']);_0x159642[_0x4f49('0x31')]=_[_0x4f49('0x32')](_0x159642['model'],_0x159642[_0x4f49('0x2f')]);_0x432b5d['attributes']=_[_0x4f49('0x32')](_0x159642[_0x4f49('0x2d')],qs[_0x4f49('0x34')](_0x5238a3['query'][_0x4f49('0x34')]));_0x432b5d[_0x4f49('0x33')]=_0x432b5d[_0x4f49('0x33')][_0x4f49('0x45')]?_0x432b5d[_0x4f49('0x33')]:_0x159642[_0x4f49('0x2d')];if(_0x5238a3[_0x4f49('0x2f')][_0x4f49('0x40')]){_0x432b5d[_0x4f49('0x41')]=[{'all':!![]}];}_0x432b5d=_[_0x4f49('0x3b')]({},_0x432b5d,_0x5238a3['options']);return db[_0x4f49('0x3f')][_0x4f49('0x46')](_0x432b5d)['then'](handleEntityNotFound(_0x412395,null))[_0x4f49('0x25')](respondWithResult(_0x412395,null))['catch'](handleError(_0x412395,null));};exports[_0x4f49('0x47')]=function(_0x41c580,_0x2d3dcd){return db[_0x4f49('0x3f')]['describe']()[_0x4f49('0x25')](respondWithResult(_0x2d3dcd,null))[_0x4f49('0x44')](handleError(_0x2d3dcd,null));};exports[_0x4f49('0x24')]=function(_0x973099,_0x3ec266){if(_0x973099[_0x4f49('0x48')][_0x4f49('0x49')]){delete _0x973099[_0x4f49('0x48')][_0x4f49('0x49')];}return db[_0x4f49('0x3f')][_0x4f49('0x46')]({'where':{'uniqueid':_0x973099[_0x4f49('0x4a')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0x3ec266,null))[_0x4f49('0x25')](saveUpdates(_0x973099[_0x4f49('0x48')],null))[_0x4f49('0x25')](respondWithResult(_0x3ec266,null))['catch'](handleError(_0x3ec266,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0xce5121,_0x197670,_0x36bcc2){return db[_0x4f49('0x3f')][_0x4f49('0x42')]({'raw':![],'where':{'VoiceQueueId':_0xce5121[_0x4f49('0x4a')]['id']},'attributes':[[db[_0x4f49('0x4b')]['fn']('COUNT',db[_0x4f49('0x4b')]['fn']('IF',db['sequelize'][_0x4f49('0x4c')](_0x4f49('0x4d')))),_0x4f49('0x4e')],[db[_0x4f49('0x4b')]['fn']('COUNT',db[_0x4f49('0x4b')]['fn']('IF',db['sequelize']['literal'](_0x4f49('0x4f')))),_0x4f49('0x50')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db['sequelize']['fn']('IF',db['sequelize'][_0x4f49('0x4c')](_0x4f49('0x52')))),'busyContacts'],[db[_0x4f49('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4f49('0x4b')]['literal'](_0x4f49('0x53')))),'congestionContacts'],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')](_0x4f49('0x54')))),_0x4f49('0x55')],[db[_0x4f49('0x4b')]['fn']('COUNT',db[_0x4f49('0x4b')]['fn']('IF',db['sequelize'][_0x4f49('0x4c')](_0x4f49('0x56')))),_0x4f49('0x57')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db['sequelize'][_0x4f49('0x4c')](_0x4f49('0x58')))),'reCallContacts'],[db['sequelize']['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')](_0x4f49('0x59')))),'answeringMachine']]})[_0x4f49('0x25')](handleEntityNotFound(_0x197670,null))['then'](respondWithResult(_0x197670,null))[_0x4f49('0x44')](handleError(_0x197670,null));};exports[_0x4f49('0x5a')]=function(_0x2a2b0d,_0x4aae7c,_0x1dade6){return db[_0x4f49('0x3f')][_0x4f49('0x42')]({'raw':![],'where':{'CampaignId':_0x2a2b0d[_0x4f49('0x4a')]['id']},'attributes':[[db['sequelize']['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db['sequelize'][_0x4f49('0x4c')](_0x4f49('0x4d')))),_0x4f49('0x4e')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')]('`state`\x20=\x203,\x201,\x20null'))),_0x4f49('0x50')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')](_0x4f49('0x52')))),'busyContacts'],[db[_0x4f49('0x4b')]['fn']('COUNT',db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')](_0x4f49('0x53')))),_0x4f49('0x5b')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x4f49('0x55')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db['sequelize']['literal'](_0x4f49('0x56')))),'abandonedContacts'],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')](_0x4f49('0x58')))),_0x4f49('0x5c')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')](_0x4f49('0x59')))),_0x4f49('0x5d')]]})[_0x4f49('0x25')](handleEntityNotFound(_0x4aae7c,null))[_0x4f49('0x25')](respondWithResult(_0x4aae7c,null))[_0x4f49('0x44')](handleError(_0x4aae7c,null));};exports[_0x4f49('0x5e')]=function(_0x1f9161,_0x1434ea,_0x2c3962){return db[_0x4f49('0x5f')][_0x4f49('0x46')]({'where':{'id':_0x1f9161[_0x4f49('0x4a')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0x1434ea,null))['then'](function(_0x3e9460){var _0x4ff0c1;if(_0x3e9460){_0x4ff0c1=squel[_0x4f49('0x60')]()[_0x4f49('0x61')](_0x4f49('0x62'))[_0x4f49('0x63')]([_0x4f49('0x64'),_0x4f49('0x65'),_0x4f49('0x66'),_0x4f49('0x67'),_0x4f49('0x68'),'createdAt','updatedAt'],squel[_0x4f49('0x69')]()['field'](_0x4f49('0x6a'),_0x4f49('0x64'))[_0x4f49('0x6b')](_0x4f49('0x6c'),_0x4f49('0x65'))['field']('ANY_VALUE(ContactId)',_0x4f49('0x66'))[_0x4f49('0x6b')]('ANY_VALUE(ListId)',_0x4f49('0x67'))[_0x4f49('0x6b')]('ANY_VALUE(VoiceQueueId)',_0x4f49('0x68'))['field'](_0x4f49('0x6c'),_0x4f49('0x6d'))['field'](_0x4f49('0x6c'),_0x4f49('0x6e'))[_0x4f49('0x6f')](_0x4f49('0x70'))[_0x4f49('0x38')](_0x4f49('0x71'),_0x1f9161['params']['id'][_0x4f49('0x72')]())['where'](_0x4f49('0x73'),_0x1f9161['body'][_0x4f49('0x74')]['toString']())[_0x4f49('0x38')](_0x4f49('0x75'))[_0x4f49('0x38')](_0x4f49('0x76'),squel['select']()[_0x4f49('0x6b')]('phone')[_0x4f49('0x6f')]('cm_hopper')[_0x4f49('0x38')]('VoiceQueueId\x20=\x20?',_0x1f9161['params']['id'][_0x4f49('0x72')]()))[_0x4f49('0x38')](_0x4f49('0x76'),squel['select']()[_0x4f49('0x6b')](_0x4f49('0x77'))['from']('cm_hopper_final')['where'](_0x4f49('0x71'),_0x1f9161[_0x4f49('0x4a')]['id'][_0x4f49('0x72')]())[_0x4f49('0x38')](_0x4f49('0x78')))['group'](_0x4f49('0x66')))[_0x4f49('0x72')]();return db[_0x4f49('0x4b')]['query'](_0x4ff0c1);}return[];})[_0x4f49('0x25')](respondWithResult(_0x1434ea,null))[_0x4f49('0x44')](handleError(_0x1434ea,null));};exports[_0x4f49('0x79')]=function(_0x2902a1,_0x5ea6b4,_0x249799){return db[_0x4f49('0x7a')][_0x4f49('0x46')]({'where':{'id':_0x2902a1[_0x4f49('0x4a')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0x5ea6b4,null))['then'](function(_0x2409a8){var _0x32539c;if(_0x2409a8){_0x32539c=squel['insert']()[_0x4f49('0x61')]('cm_hopper')[_0x4f49('0x63')](['phone',_0x4f49('0x65'),_0x4f49('0x66'),_0x4f49('0x67'),_0x4f49('0x7b'),_0x4f49('0x6d'),'updatedAt'],squel[_0x4f49('0x69')]()[_0x4f49('0x6b')](_0x4f49('0x6a'),_0x4f49('0x64'))['field'](_0x4f49('0x6c'),'scheduledAt')[_0x4f49('0x6b')]('ANY_VALUE(ContactId)',_0x4f49('0x66'))[_0x4f49('0x6b')](_0x4f49('0x7c'),_0x4f49('0x67'))[_0x4f49('0x6b')](_0x4f49('0x7d'),_0x4f49('0x7b'))[_0x4f49('0x6b')](_0x4f49('0x6c'),_0x4f49('0x6d'))['field'](_0x4f49('0x6c'),_0x4f49('0x6e'))[_0x4f49('0x6f')](_0x4f49('0x70'))[_0x4f49('0x38')](_0x4f49('0x7e'),_0x2902a1['params']['id'][_0x4f49('0x72')]())[_0x4f49('0x38')](_0x4f49('0x73'),_0x2902a1[_0x4f49('0x48')]['state'][_0x4f49('0x72')]())['where'](_0x4f49('0x75'))[_0x4f49('0x38')](_0x4f49('0x76'),squel[_0x4f49('0x69')]()['field'](_0x4f49('0x64'))[_0x4f49('0x6f')](_0x4f49('0x62'))[_0x4f49('0x38')](_0x4f49('0x7e'),_0x2902a1[_0x4f49('0x4a')]['id'][_0x4f49('0x72')]()))[_0x4f49('0x38')](_0x4f49('0x76'),squel[_0x4f49('0x69')]()[_0x4f49('0x6b')](_0x4f49('0x77'))[_0x4f49('0x6f')](_0x4f49('0x70'))[_0x4f49('0x38')](_0x4f49('0x7e'),_0x2902a1[_0x4f49('0x4a')]['id'][_0x4f49('0x72')]())['where'](_0x4f49('0x78')))[_0x4f49('0x7f')](_0x4f49('0x66')))[_0x4f49('0x72')]();return db['sequelize'][_0x4f49('0x2f')](_0x32539c);}return[];})[_0x4f49('0x25')](respondWithResult(_0x5ea6b4,null))['catch'](handleError(_0x5ea6b4,null));};exports[_0x4f49('0x80')]=function(_0x57c86c,_0xf6bc4c,_0x3bc245){return db[_0x4f49('0x81')][_0x4f49('0x82')]({'where':{'VoiceQueueId':_0x57c86c[_0x4f49('0x48')][_0x4f49('0x68')],'CampaignId':_0x57c86c[_0x4f49('0x48')][_0x4f49('0x7b')],'ContactId':_0x57c86c[_0x4f49('0x48')][_0x4f49('0x66')]}})['then'](handleEntityNotFound(_0xf6bc4c,null))['then'](function(_0x32b4b4){if(_0x32b4b4){return _0x32b4b4;}return null;})['then'](respondWithResult(_0xf6bc4c,null))[_0x4f49('0x44')](handleError(_0xf6bc4c,null));}; \ No newline at end of file +var _0x6d38=['calleridnum\x20IS\x20NOT\x20NULL','CmHopper','findOne','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','stack','name','send','index','map','CmHopperFinal','rawAttributes','type','key','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','keys','filters','intersection','describe','catch','body','uniqueid','find','params','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','busyContacts','`state`\x20=\x208,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','moveContactsQueueCampaignHopperFinal','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','from','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','Campaign','cm_hopper','CampaignId','ANY_VALUE(ListId)','CampaignId\x20=\x20?','state'];(function(_0x3c2bce,_0x2ae59f){var _0x19f3f5=function(_0x4d5c62){while(--_0x4d5c62){_0x3c2bce['push'](_0x3c2bce['shift']());}};_0x19f3f5(++_0x2ae59f);}(_0x6d38,0x1ef));var _0x86d3=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x6d38[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];function respondWithStatusCode(_0x7d4d2e,_0x440a55){_0x440a55=_0x440a55||0xcc;return function(_0x26d64c){if(_0x26d64c){return _0x7d4d2e[_0x86d3('0x14')](_0x440a55);}return _0x7d4d2e[_0x86d3('0x15')](_0x440a55)[_0x86d3('0x16')]();};}function respondWithResult(_0x12ef4a,_0x5ce2ff){_0x5ce2ff=_0x5ce2ff||0xc8;return function(_0x1c1ba8){if(_0x1c1ba8){return _0x12ef4a[_0x86d3('0x15')](_0x5ce2ff)[_0x86d3('0x17')](_0x1c1ba8);}};}function respondWithFilteredResult(_0x207f6f,_0x1ea535){return function(_0x34fb3b){if(_0x34fb3b){var _0x1ff008=typeof _0x1ea535[_0x86d3('0x18')]==='undefined'&&typeof _0x1ea535[_0x86d3('0x19')]===_0x86d3('0x1a');var _0x431b3f=_0x34fb3b[_0x86d3('0x1b')];var _0x46feec=_0x1ff008?0x0:_0x1ea535[_0x86d3('0x18')];var _0x33e459=_0x1ff008?_0x34fb3b[_0x86d3('0x1b')]:_0x1ea535[_0x86d3('0x18')]+_0x1ea535['limit'];var _0x191ba5;if(_0x33e459>=_0x431b3f){_0x33e459=_0x431b3f;_0x191ba5=0xc8;}else{_0x191ba5=0xce;}_0x207f6f['status'](_0x191ba5);return _0x207f6f[_0x86d3('0x1c')]('Content-Range',_0x46feec+'-'+_0x33e459+'/'+_0x431b3f)['json'](_0x34fb3b);}return null;};}function patchUpdates(_0x41486a){return function(_0x1edb6d){try{jsonpatch[_0x86d3('0x1d')](_0x1edb6d,_0x41486a,!![]);}catch(_0x1720ae){return BPromise['reject'](_0x1720ae);}return _0x1edb6d[_0x86d3('0x1e')]();};}function saveUpdates(_0x55e1c3,_0x36e0fa){return function(_0x3fdf67){if(_0x3fdf67){return _0x3fdf67[_0x86d3('0x1f')](_0x55e1c3)['then'](function(_0x39d819){return _0x39d819;});}return null;};}function removeEntity(_0x72b3d4,_0x1fa4ac){return function(_0x4bf5b8){if(_0x4bf5b8){return _0x4bf5b8['destroy']()[_0x86d3('0x20')](function(){_0x72b3d4['status'](0xcc)[_0x86d3('0x16')]();});}};}function handleEntityNotFound(_0x1bea5e,_0x3dfecd){return function(_0x3c5fe4){if(!_0x3c5fe4){_0x1bea5e['sendStatus'](0x194);}return _0x3c5fe4;};}function handleError(_0x481077,_0x3359e4){_0x3359e4=_0x3359e4||0x1f4;return function(_0x611764){logger['error'](_0x611764[_0x86d3('0x21')]);if(_0x611764['name']){delete _0x611764[_0x86d3('0x22')];}_0x481077[_0x86d3('0x15')](_0x3359e4)[_0x86d3('0x23')](_0x611764);};}exports[_0x86d3('0x24')]=function(_0x11a6fd,_0x14c9ff){var _0x1f203e={},_0x35d708={},_0x303f13={'count':0x0,'rows':[]};var _0x44dacf=_[_0x86d3('0x25')](db[_0x86d3('0x26')][_0x86d3('0x27')],function(_0x28c25e){return{'name':_0x28c25e['fieldName'],'type':_0x28c25e[_0x86d3('0x28')][_0x86d3('0x29')]};});_0x35d708[_0x86d3('0x2a')]=_[_0x86d3('0x25')](_0x44dacf,_0x86d3('0x22'));_0x35d708[_0x86d3('0x2b')]=_['keys'](_0x11a6fd[_0x86d3('0x2b')]);_0x35d708['filters']=_['intersection'](_0x35d708[_0x86d3('0x2a')],_0x35d708[_0x86d3('0x2b')]);_0x1f203e[_0x86d3('0x2c')]=_['intersection'](_0x35d708[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x11a6fd['query'][_0x86d3('0x2d')]));_0x1f203e[_0x86d3('0x2c')]=_0x1f203e[_0x86d3('0x2c')][_0x86d3('0x2e')]?_0x1f203e[_0x86d3('0x2c')]:_0x35d708[_0x86d3('0x2a')];if(!_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x2f')]('nolimit')){_0x1f203e['limit']=qs['limit'](_0x11a6fd[_0x86d3('0x2b')]['limit']);_0x1f203e[_0x86d3('0x18')]=qs['offset'](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x18')]);}_0x1f203e[_0x86d3('0x30')]=qs[_0x86d3('0x31')](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x31')]);_0x1f203e[_0x86d3('0x32')]=qs['filters'](_[_0x86d3('0x33')](_0x11a6fd[_0x86d3('0x2b')],_0x35d708['filters']),_0x44dacf);if(_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]){_0x1f203e[_0x86d3('0x32')]=_[_0x86d3('0x35')](_0x1f203e['where'],{'$or':_[_0x86d3('0x25')](_0x44dacf,function(_0x42ac0d){if(_0x42ac0d[_0x86d3('0x28')]!=='VIRTUAL'){var _0x5762ca={};_0x5762ca[_0x42ac0d[_0x86d3('0x22')]]={'$like':'%'+_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]+'%'};return _0x5762ca;}})});}_0x1f203e=_[_0x86d3('0x35')]({},_0x1f203e,_0x11a6fd[_0x86d3('0x36')]);var _0x3666fc={'where':_0x1f203e[_0x86d3('0x32')]};return db['CmHopperFinal'][_0x86d3('0x1b')](_0x3666fc)[_0x86d3('0x20')](function(_0x2bdc67){_0x303f13[_0x86d3('0x1b')]=_0x2bdc67;if(_0x11a6fd['query'][_0x86d3('0x37')]){_0x1f203e[_0x86d3('0x38')]=[{'all':!![]}];}return db[_0x86d3('0x26')][_0x86d3('0x39')](_0x1f203e);})['then'](function(_0x587747){_0x303f13[_0x86d3('0x3a')]=_0x587747;return _0x303f13;})['then'](respondWithFilteredResult(_0x14c9ff,_0x1f203e))['catch'](handleError(_0x14c9ff,null));};exports[_0x86d3('0x3b')]=function(_0x1385fc,_0x43490a){var _0x35d6fe={'raw':!![],'where':{'id':_0x1385fc['params']['id']}},_0x23ef72={};_0x23ef72[_0x86d3('0x2a')]=_[_0x86d3('0x3c')](db[_0x86d3('0x26')]['rawAttributes']);_0x23ef72[_0x86d3('0x2b')]=_[_0x86d3('0x3c')](_0x1385fc['query']);_0x23ef72[_0x86d3('0x3d')]=_[_0x86d3('0x3e')](_0x23ef72['model'],_0x23ef72['query']);_0x35d6fe['attributes']=_[_0x86d3('0x3e')](_0x23ef72[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x2d')]));_0x35d6fe[_0x86d3('0x2c')]=_0x35d6fe['attributes'][_0x86d3('0x2e')]?_0x35d6fe[_0x86d3('0x2c')]:_0x23ef72['model'];if(_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x37')]){_0x35d6fe[_0x86d3('0x38')]=[{'all':!![]}];}_0x35d6fe=_[_0x86d3('0x35')]({},_0x35d6fe,_0x1385fc[_0x86d3('0x36')]);return db[_0x86d3('0x26')]['find'](_0x35d6fe)[_0x86d3('0x20')](handleEntityNotFound(_0x43490a,null))[_0x86d3('0x20')](respondWithResult(_0x43490a,null))['catch'](handleError(_0x43490a,null));};exports[_0x86d3('0x3f')]=function(_0x412d0e,_0xd20863){return db[_0x86d3('0x26')][_0x86d3('0x3f')]()['then'](respondWithResult(_0xd20863,null))[_0x86d3('0x40')](handleError(_0xd20863,null));};exports[_0x86d3('0x1f')]=function(_0x3226b5,_0x14fa58){if(_0x3226b5[_0x86d3('0x41')][_0x86d3('0x42')]){delete _0x3226b5[_0x86d3('0x41')][_0x86d3('0x42')];}return db[_0x86d3('0x26')][_0x86d3('0x43')]({'where':{'uniqueid':_0x3226b5[_0x86d3('0x44')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x14fa58,null))['then'](saveUpdates(_0x3226b5[_0x86d3('0x41')],null))[_0x86d3('0x20')](respondWithResult(_0x14fa58,null))['catch'](handleError(_0x14fa58,null));};exports[_0x86d3('0x45')]=function(_0x23a6ee,_0x197047,_0x2e9af5){return db[_0x86d3('0x26')][_0x86d3('0x39')]({'raw':![],'where':{'VoiceQueueId':_0x23a6ee['params']['id']},'attributes':[[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x48')))),_0x86d3('0x49')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db['sequelize'][_0x86d3('0x47')](_0x86d3('0x4b')))),_0x86d3('0x4c')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')]['literal'](_0x86d3('0x4d')))),'busyContacts'],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')]('`state`\x20=\x208,\x201,\x20null'))),_0x86d3('0x4e')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x86d3('0x4f')))),'dropContacts'],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x50')))),_0x86d3('0x51')],[db[_0x86d3('0x46')]['fn']('COUNT',db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x52')))),'answeringMachine']]})[_0x86d3('0x20')](handleEntityNotFound(_0x197047,null))[_0x86d3('0x20')](respondWithResult(_0x197047,null))['catch'](handleError(_0x197047,null));};exports[_0x86d3('0x53')]=function(_0x416428,_0x15cdd0,_0x29bdee){return db[_0x86d3('0x26')][_0x86d3('0x39')]({'raw':![],'where':{'CampaignId':_0x416428[_0x86d3('0x44')]['id']},'attributes':[[db['sequelize']['fn']('COUNT',db[_0x86d3('0x46')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x86d3('0x49')],[db['sequelize']['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x4b')))),'noAnswerContacts'],[db['sequelize']['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x4d')))),_0x86d3('0x54')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x55')))),_0x86d3('0x4e')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x86d3('0x56')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x57')))),_0x86d3('0x58')],[db['sequelize']['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x50')))),_0x86d3('0x51')],[db[_0x86d3('0x46')]['fn']('COUNT',db[_0x86d3('0x46')]['fn']('IF',db['sequelize'][_0x86d3('0x47')](_0x86d3('0x52')))),'answeringMachine']]})[_0x86d3('0x20')](handleEntityNotFound(_0x15cdd0,null))[_0x86d3('0x20')](respondWithResult(_0x15cdd0,null))[_0x86d3('0x40')](handleError(_0x15cdd0,null));};exports[_0x86d3('0x59')]=function(_0x308fed,_0x1c966a,_0x379799){return db['VoiceQueue'][_0x86d3('0x43')]({'where':{'id':_0x308fed[_0x86d3('0x44')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x1c966a,null))[_0x86d3('0x20')](function(_0x46e356){var _0x47f72e;if(_0x46e356){_0x47f72e=squel[_0x86d3('0x5a')]()[_0x86d3('0x5b')]('cm_hopper')[_0x86d3('0x5c')]([_0x86d3('0x5d'),_0x86d3('0x5e'),_0x86d3('0x5f'),_0x86d3('0x60'),_0x86d3('0x61'),_0x86d3('0x62'),_0x86d3('0x63')],squel[_0x86d3('0x64')]()[_0x86d3('0x65')](_0x86d3('0x66'),_0x86d3('0x5d'))[_0x86d3('0x65')](_0x86d3('0x67'),'scheduledAt')[_0x86d3('0x65')](_0x86d3('0x68'),_0x86d3('0x5f'))[_0x86d3('0x65')]('ANY_VALUE(ListId)',_0x86d3('0x60'))[_0x86d3('0x65')](_0x86d3('0x69'),_0x86d3('0x61'))['field']('NOW()',_0x86d3('0x62'))['field'](_0x86d3('0x67'),'updatedAt')['from'](_0x86d3('0x6a'))[_0x86d3('0x32')](_0x86d3('0x6b'),_0x308fed[_0x86d3('0x44')]['id'][_0x86d3('0x6c')]())['where'](_0x86d3('0x6d'),_0x308fed[_0x86d3('0x41')]['state'][_0x86d3('0x6c')]())[_0x86d3('0x32')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x86d3('0x32')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x86d3('0x64')]()['field']('phone')[_0x86d3('0x6e')]('cm_hopper')[_0x86d3('0x32')](_0x86d3('0x6b'),_0x308fed[_0x86d3('0x44')]['id'][_0x86d3('0x6c')]()))[_0x86d3('0x32')](_0x86d3('0x6f'),squel[_0x86d3('0x64')]()[_0x86d3('0x65')]('calleridnum')[_0x86d3('0x6e')](_0x86d3('0x6a'))[_0x86d3('0x32')](_0x86d3('0x6b'),_0x308fed[_0x86d3('0x44')]['id']['toString']())[_0x86d3('0x32')](_0x86d3('0x70')))[_0x86d3('0x71')](_0x86d3('0x5f')))[_0x86d3('0x6c')]();return db[_0x86d3('0x46')][_0x86d3('0x2b')](_0x47f72e);}return[];})['then'](respondWithResult(_0x1c966a,null))[_0x86d3('0x40')](handleError(_0x1c966a,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0xca2e0,_0x596b1d,_0x5a22ca){return db[_0x86d3('0x72')][_0x86d3('0x43')]({'where':{'id':_0xca2e0['params']['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x596b1d,null))[_0x86d3('0x20')](function(_0x879a8b){var _0x1c1384;if(_0x879a8b){_0x1c1384=squel[_0x86d3('0x5a')]()[_0x86d3('0x5b')](_0x86d3('0x73'))['fromQuery'](['phone',_0x86d3('0x5e'),_0x86d3('0x5f'),_0x86d3('0x60'),_0x86d3('0x74'),_0x86d3('0x62'),_0x86d3('0x63')],squel['select']()[_0x86d3('0x65')](_0x86d3('0x66'),_0x86d3('0x5d'))[_0x86d3('0x65')](_0x86d3('0x67'),_0x86d3('0x5e'))[_0x86d3('0x65')](_0x86d3('0x68'),_0x86d3('0x5f'))['field'](_0x86d3('0x75'),_0x86d3('0x60'))['field']('ANY_VALUE(CampaignId)',_0x86d3('0x74'))[_0x86d3('0x65')](_0x86d3('0x67'),'createdAt')[_0x86d3('0x65')](_0x86d3('0x67'),_0x86d3('0x63'))[_0x86d3('0x6e')](_0x86d3('0x6a'))['where'](_0x86d3('0x76'),_0xca2e0[_0x86d3('0x44')]['id']['toString']())[_0x86d3('0x32')](_0x86d3('0x6d'),_0xca2e0[_0x86d3('0x41')][_0x86d3('0x77')]['toString']())[_0x86d3('0x32')](_0x86d3('0x78'))[_0x86d3('0x32')](_0x86d3('0x6f'),squel[_0x86d3('0x64')]()['field'](_0x86d3('0x5d'))[_0x86d3('0x6e')](_0x86d3('0x73'))[_0x86d3('0x32')](_0x86d3('0x76'),_0xca2e0[_0x86d3('0x44')]['id'][_0x86d3('0x6c')]()))[_0x86d3('0x32')](_0x86d3('0x6f'),squel[_0x86d3('0x64')]()['field']('calleridnum')[_0x86d3('0x6e')](_0x86d3('0x6a'))['where'](_0x86d3('0x76'),_0xca2e0[_0x86d3('0x44')]['id'][_0x86d3('0x6c')]())[_0x86d3('0x32')](_0x86d3('0x70')))[_0x86d3('0x71')](_0x86d3('0x5f')))[_0x86d3('0x6c')]();return db[_0x86d3('0x46')]['query'](_0x1c1384);}return[];})['then'](respondWithResult(_0x596b1d,null))['catch'](handleError(_0x596b1d,null));};exports['checkContactHopper']=function(_0xad83bf,_0x2514c1,_0x28a509){return db[_0x86d3('0x79')][_0x86d3('0x7a')]({'where':{'VoiceQueueId':_0xad83bf[_0x86d3('0x41')][_0x86d3('0x61')],'CampaignId':_0xad83bf['body'][_0x86d3('0x74')],'ContactId':_0xad83bf[_0x86d3('0x41')][_0x86d3('0x5f')]}})[_0x86d3('0x20')](handleEntityNotFound(_0x2514c1,null))['then'](function(_0xe239b5){if(_0xe239b5){return _0xe239b5;}return null;})['then'](respondWithResult(_0x2514c1,null))[_0x86d3('0x40')](handleError(_0x2514c1,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index d0198c1..7fbda97 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 _0x42cb=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperFinal.attributes','define','cm_hopper_final','calleridnum','uniqueid','lodash'];(function(_0x53b266,_0x50675f){var _0x296297=function(_0x472ec4){while(--_0x472ec4){_0x53b266['push'](_0x53b266['shift']());}};_0x296297(++_0x50675f);}(_0x42cb,0x1d3));var _0xb42c=function(_0x2e7bbc,_0x2481c1){_0x2e7bbc=_0x2e7bbc-0x0;var _0x2731a6=_0x42cb[_0x2e7bbc];return _0x2731a6;};'use strict';var _=require(_0xb42c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb42c('0x1'));var moment=require(_0xb42c('0x2'));var BPromise=require(_0xb42c('0x3'));var rp=require(_0xb42c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb42c('0x5'));var config=require(_0xb42c('0x6'));var attributes=require(_0xb42c('0x7'));module['exports']=function(_0x9d97c5,_0x18390d){return _0x9d97c5[_0xb42c('0x8')]('CmHopperFinal',attributes,{'tableName':_0xb42c('0x9'),'paranoid':![],'indexes':[{'name':_0xb42c('0xa'),'fields':[_0xb42c('0xa')]},{'name':_0xb42c('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf3b0=['define','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports'];(function(_0x4885c5,_0x119853){var _0x2cd0f1=function(_0x2483c5){while(--_0x2483c5){_0x4885c5['push'](_0x4885c5['shift']());}};_0x2cd0f1(++_0x119853);}(_0xf3b0,0x1c6));var _0x0f3b=function(_0x4a0e68,_0x45c08c){_0x4a0e68=_0x4a0e68-0x0;var _0x4fb274=_0xf3b0[_0x4a0e68];return _0x4fb274;};'use strict';var _=require(_0x0f3b('0x0'));var util=require(_0x0f3b('0x1'));var logger=require(_0x0f3b('0x2'))(_0x0f3b('0x3'));var moment=require(_0x0f3b('0x4'));var BPromise=require('bluebird');var rp=require(_0x0f3b('0x5'));var fs=require('fs');var path=require(_0x0f3b('0x6'));var rimraf=require(_0x0f3b('0x7'));var config=require(_0x0f3b('0x8'));var attributes=require(_0x0f3b('0x9'));module[_0x0f3b('0xa')]=function(_0x2a5f67,_0x3488b7){return _0x2a5f67[_0x0f3b('0xb')]('CmHopperFinal',attributes,{'tableName':_0x0f3b('0xc'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x0f3b('0xd')]},{'name':_0x0f3b('0xe'),'fields':[_0x0f3b('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 152e125..95f0a20 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x3dc036,_0x20c6f6){var _0xdce2f=function(_0x4e2cd5){while(--_0x4e2cd5){_0x3dc036['push'](_0x3dc036['shift']());}};_0xdce2f(++_0x20c6f6);}(_0xb10b,0x12a));var _0xbb10=function(_0x4fbde2,_0x364951){_0x4fbde2=_0x4fbde2-0x0;var _0x2bce29=_0xb10b[_0x4fbde2];return _0x2bce29;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x406725,_0x7b2fb8){var _0x1af3d4=function(_0xebf752){while(--_0xebf752){_0x406725['push'](_0x406725['shift']());}};_0x1af3d4(++_0x7b2fb8);}(_0x7a54,0x106));var _0x47a5=function(_0x17540e,_0x393619){_0x17540e=_0x17540e-0x0;var _0x1e71d8=_0x7a54[_0x17540e];return _0x1e71d8;};'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 6e3b99c..446ea21 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 _0x087a=['get','isAuthenticated','index','/describe','describe','show','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','put','/:id','update','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x4edb68,_0x58a318){var _0x1449f8=function(_0x4dcbd4){while(--_0x4dcbd4){_0x4edb68['push'](_0x4edb68['shift']());}};_0x1449f8(++_0x58a318);}(_0x087a,0x1b0));var _0xa087=function(_0x312d5b,_0xdb0d27){_0x312d5b=_0x312d5b-0x0;var _0x487aff=_0x087a[_0x312d5b];return _0x487aff;};'use strict';var multer=require(_0xa087('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa087('0x1'));var express=require(_0xa087('0x2'));var router=express['Router']();var fs_extra=require(_0xa087('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa087('0x4'));var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router[_0xa087('0x5')]('/',auth[_0xa087('0x6')](),controller[_0xa087('0x7')]);router['get'](_0xa087('0x8'),auth[_0xa087('0x6')](),controller[_0xa087('0x9')]);router[_0xa087('0x5')]('/:id',auth['isAuthenticated'](),controller[_0xa087('0xa')]);router[_0xa087('0x5')]('/voice/queue/countAttributes/:id',auth[_0xa087('0x6')](),controller['countContactsQueueCampaignHopperFinal']);router[_0xa087('0x5')](_0xa087('0xb'),auth[_0xa087('0x6')](),controller[_0xa087('0xc')]);router['post'](_0xa087('0xd'),auth['isAuthenticated'](),controller[_0xa087('0xe')]);router[_0xa087('0xf')](_0xa087('0x10'),auth[_0xa087('0x6')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xa087('0xf')](_0xa087('0x11'),auth['isAuthenticated'](),controller[_0xa087('0x12')]);router[_0xa087('0x13')](_0xa087('0x14'),auth[_0xa087('0x6')](),controller[_0xa087('0x15')]);module[_0xa087('0x16')]=router; \ No newline at end of file +var _0xa5aa=['/checkContactHopper','put','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','get','isAuthenticated','/describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal'];(function(_0x5875bf,_0x201039){var _0x11a28d=function(_0x250949){while(--_0x250949){_0x5875bf['push'](_0x5875bf['shift']());}};_0x11a28d(++_0x201039);}(_0xa5aa,0x1ac));var _0xaa5a=function(_0x4f6f1a,_0x3e3bc1){_0x4f6f1a=_0x4f6f1a-0x0;var _0x26df43=_0xa5aa[_0x4f6f1a];return _0x26df43;};'use strict';var multer=require(_0xaa5a('0x0'));var util=require(_0xaa5a('0x1'));var path=require('path');var timeout=require(_0xaa5a('0x2'));var express=require(_0xaa5a('0x3'));var router=express[_0xaa5a('0x4')]();var fs_extra=require(_0xaa5a('0x5'));var auth=require(_0xaa5a('0x6'));var interaction=require(_0xaa5a('0x7'));var config=require('../../config/environment');var controller=require(_0xaa5a('0x8'));router[_0xaa5a('0x9')]('/',auth[_0xaa5a('0xa')](),controller['index']);router['get'](_0xaa5a('0xb'),auth[_0xaa5a('0xa')](),controller['describe']);router[_0xaa5a('0x9')](_0xaa5a('0xc'),auth[_0xaa5a('0xa')](),controller['show']);router[_0xaa5a('0x9')](_0xaa5a('0xd'),auth[_0xaa5a('0xa')](),controller[_0xaa5a('0xe')]);router[_0xaa5a('0x9')](_0xaa5a('0xf'),auth['isAuthenticated'](),controller[_0xaa5a('0x10')]);router[_0xaa5a('0x11')](_0xaa5a('0x12'),auth[_0xaa5a('0xa')](),controller[_0xaa5a('0x13')]);router[_0xaa5a('0x11')](_0xaa5a('0x14'),auth[_0xaa5a('0xa')](),controller[_0xaa5a('0x15')]);router[_0xaa5a('0x11')](_0xaa5a('0x16'),auth[_0xaa5a('0xa')](),controller['checkContactHopper']);router[_0xaa5a('0x17')](_0xaa5a('0xc'),auth[_0xaa5a('0xa')](),controller['update']);module[_0xaa5a('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index aa8e51b..e06a397 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 _0x405e=['INTEGER','STRING','BOOLEAN','exports','DATE'];(function(_0x3c77c7,_0x2287bd){var _0x2fcbd4=function(_0x225f71){while(--_0x225f71){_0x3c77c7['push'](_0x3c77c7['shift']());}};_0x2fcbd4(++_0x2287bd);}(_0x405e,0x14d));var _0xe405=function(_0x3f4c58,_0x39bb0b){_0x3f4c58=_0x3f4c58-0x0;var _0x5241c3=_0x405e[_0x3f4c58];return _0x5241c3;};'use strict';var Sequelize=require('sequelize');module[_0xe405('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xe405('0x1')]},'countbusyretry':{'type':Sequelize[_0xe405('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe405('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xe405('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xe405('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xe405('0x3')]},'originatecalleridname':{'type':Sequelize[_0xe405('0x3')]},'calleridnum':{'type':Sequelize[_0xe405('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xe405('0x1')]},'answertime':{'type':Sequelize[_0xe405('0x1')]},'droptime':{'type':Sequelize[_0xe405('0x1')]},'endtime':{'type':Sequelize[_0xe405('0x1')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xe405('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xe405('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xe405('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xe405('0x3')]},'campaign':{'type':Sequelize[_0xe405('0x3')]},'campaigntype':{'type':Sequelize[_0xe405('0x3')]},'membername':{'type':Sequelize[_0xe405('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xe405('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xe405('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0xe405('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe405('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xe405('0x1')]},'recallme':{'type':Sequelize[_0xe405('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xe405('0x1')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xe405('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe405('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xe405('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xe405('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x7460=['BOOLEAN','sequelize','exports','INTEGER','STRING','DATE'];(function(_0x24ef02,_0x5b1d47){var _0x37ec45=function(_0xeffc47){while(--_0xeffc47){_0x24ef02['push'](_0x24ef02['shift']());}};_0x37ec45(++_0x5b1d47);}(_0x7460,0xc1));var _0x0746=function(_0x53afdb,_0x2e743a){_0x53afdb=_0x53afdb-0x0;var _0x1cb9f3=_0x7460[_0x53afdb];return _0x1cb9f3;};'use strict';var Sequelize=require(_0x0746('0x0'));module[_0x0746('0x1')]={'state':{'type':Sequelize[_0x0746('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x0746('0x3')]},'scheduledat':{'type':Sequelize[_0x0746('0x4')]},'countbusyretry':{'type':Sequelize[_0x0746('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0746('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0746('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x0746('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x0746('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x0746('0x3')]},'calleridname':{'type':Sequelize[_0x0746('0x3')]},'starttime':{'type':Sequelize[_0x0746('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x0746('0x4')]},'droptime':{'type':Sequelize[_0x0746('0x4')]},'endtime':{'type':Sequelize[_0x0746('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x0746('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x0746('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x0746('0x3')]},'campaign':{'type':Sequelize[_0x0746('0x3')]},'campaigntype':{'type':Sequelize[_0x0746('0x3')]},'membername':{'type':Sequelize[_0x0746('0x3')]},'reason':{'type':Sequelize[_0x0746('0x3')]},'amd':{'type':Sequelize[_0x0746('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x0746('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x0746('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0746('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x0746('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x0746('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0746('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0746('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 13a4b4b..60890f3 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 _0xf598=['update','destroy','then','error','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','filters','pick','filter','merge','where','VIRTUAL','CmHopperHistory','includeAll','findAll','rows','catch','params','options','find','body','describe','uniqueid','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save'];(function(_0x47038f,_0x1060e5){var _0x193431=function(_0xc59f87){while(--_0xc59f87){_0x47038f['push'](_0x47038f['shift']());}};_0x193431(++_0x1060e5);}(_0xf598,0x1e3));var _0x8f59=function(_0x136dab,_0x398d92){_0x136dab=_0x136dab-0x0;var _0x1271d7=_0xf598[_0x136dab];return _0x1271d7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8f59('0x0'));var zipdir=require(_0x8f59('0x1'));var jsonpatch=require(_0x8f59('0x2'));var rp=require(_0x8f59('0x3'));var moment=require(_0x8f59('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8f59('0x5'));var path=require(_0x8f59('0x6'));var sox=require(_0x8f59('0x7'));var csv=require(_0x8f59('0x8'));var ejs=require(_0x8f59('0x9'));var fs=require('fs');var fs_extra=require(_0x8f59('0xa'));var _=require('lodash');var squel=require(_0x8f59('0xb'));var crypto=require('crypto');var jsforce=require(_0x8f59('0xc'));var deskjs=require(_0x8f59('0xd'));var toCsv=require(_0x8f59('0x8'));var querystring=require(_0x8f59('0xe'));var Papa=require(_0x8f59('0xf'));var Redis=require('ioredis');var authService=require(_0x8f59('0x10'));var qs=require(_0x8f59('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8f59('0x12'));var logger=require('../../config/logger')(_0x8f59('0x13'));var utils=require(_0x8f59('0x14'));var config=require(_0x8f59('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8f59('0x16'))['db'];function respondWithStatusCode(_0x27411d,_0x26d3f1){_0x26d3f1=_0x26d3f1||0xcc;return function(_0x51aa54){if(_0x51aa54){return _0x27411d[_0x8f59('0x17')](_0x26d3f1);}return _0x27411d[_0x8f59('0x18')](_0x26d3f1)[_0x8f59('0x19')]();};}function respondWithResult(_0x2b3920,_0x40c834){_0x40c834=_0x40c834||0xc8;return function(_0x212f42){if(_0x212f42){return _0x2b3920[_0x8f59('0x18')](_0x40c834)[_0x8f59('0x1a')](_0x212f42);}};}function respondWithFilteredResult(_0x17f50c,_0x426dd1){return function(_0x3a7a7c){if(_0x3a7a7c){var _0x490caa=typeof _0x426dd1[_0x8f59('0x1b')]===_0x8f59('0x1c')&&typeof _0x426dd1[_0x8f59('0x1d')]==='undefined';var _0x5c6a1a=_0x3a7a7c[_0x8f59('0x1e')];var _0x479e92=_0x490caa?0x0:_0x426dd1['offset'];var _0x37f422=_0x490caa?_0x3a7a7c[_0x8f59('0x1e')]:_0x426dd1[_0x8f59('0x1b')]+_0x426dd1[_0x8f59('0x1d')];var _0x3c3f8b;if(_0x37f422>=_0x5c6a1a){_0x37f422=_0x5c6a1a;_0x3c3f8b=0xc8;}else{_0x3c3f8b=0xce;}_0x17f50c[_0x8f59('0x18')](_0x3c3f8b);return _0x17f50c[_0x8f59('0x1f')]('Content-Range',_0x479e92+'-'+_0x37f422+'/'+_0x5c6a1a)['json'](_0x3a7a7c);}return null;};}function patchUpdates(_0x230d9c){return function(_0x29cca6){try{jsonpatch[_0x8f59('0x20')](_0x29cca6,_0x230d9c,!![]);}catch(_0x45ce33){return BPromise[_0x8f59('0x21')](_0x45ce33);}return _0x29cca6[_0x8f59('0x22')]();};}function saveUpdates(_0x14029a,_0x1cf8e7){return function(_0x1da9a0){if(_0x1da9a0){return _0x1da9a0[_0x8f59('0x23')](_0x14029a)['then'](function(_0x3e47f2){return _0x3e47f2;});}return null;};}function removeEntity(_0x9d5b9f,_0x410163){return function(_0x216d74){if(_0x216d74){return _0x216d74[_0x8f59('0x24')]()[_0x8f59('0x25')](function(){_0x9d5b9f['status'](0xcc)[_0x8f59('0x19')]();});}};}function handleEntityNotFound(_0x500a36,_0x4061b7){return function(_0x1f86be){if(!_0x1f86be){_0x500a36[_0x8f59('0x17')](0x194);}return _0x1f86be;};}function handleError(_0x26fdc9,_0x237d8b){_0x237d8b=_0x237d8b||0x1f4;return function(_0x545bef){logger[_0x8f59('0x26')](_0x545bef['stack']);if(_0x545bef['name']){delete _0x545bef[_0x8f59('0x27')];}_0x26fdc9[_0x8f59('0x18')](_0x237d8b)[_0x8f59('0x28')](_0x545bef);};}exports[_0x8f59('0x29')]=function(_0x48b4ae,_0x4f85dd){var _0x437e8f={},_0x371272={},_0x28f5ec={'count':0x0,'rows':[]};var _0x5df276=_[_0x8f59('0x2a')](db['CmHopperHistory'][_0x8f59('0x2b')],function(_0x2206d1){return{'name':_0x2206d1[_0x8f59('0x2c')],'type':_0x2206d1[_0x8f59('0x2d')][_0x8f59('0x2e')]};});_0x371272['model']=_[_0x8f59('0x2a')](_0x5df276,'name');_0x371272['query']=_[_0x8f59('0x2f')](_0x48b4ae[_0x8f59('0x30')]);_0x371272['filters']=_[_0x8f59('0x31')](_0x371272['model'],_0x371272[_0x8f59('0x30')]);_0x437e8f['attributes']=_['intersection'](_0x371272[_0x8f59('0x32')],qs[_0x8f59('0x33')](_0x48b4ae[_0x8f59('0x30')][_0x8f59('0x33')]));_0x437e8f[_0x8f59('0x34')]=_0x437e8f[_0x8f59('0x34')][_0x8f59('0x35')]?_0x437e8f[_0x8f59('0x34')]:_0x371272[_0x8f59('0x32')];if(!_0x48b4ae[_0x8f59('0x30')][_0x8f59('0x36')](_0x8f59('0x37'))){_0x437e8f['limit']=qs[_0x8f59('0x1d')](_0x48b4ae[_0x8f59('0x30')]['limit']);_0x437e8f[_0x8f59('0x1b')]=qs[_0x8f59('0x1b')](_0x48b4ae['query'][_0x8f59('0x1b')]);}_0x437e8f[_0x8f59('0x38')]=qs['sort'](_0x48b4ae[_0x8f59('0x30')]['sort']);_0x437e8f['where']=qs[_0x8f59('0x39')](_[_0x8f59('0x3a')](_0x48b4ae[_0x8f59('0x30')],_0x371272[_0x8f59('0x39')]),_0x5df276);if(_0x48b4ae[_0x8f59('0x30')][_0x8f59('0x3b')]){_0x437e8f['where']=_[_0x8f59('0x3c')](_0x437e8f[_0x8f59('0x3d')],{'$or':_[_0x8f59('0x2a')](_0x5df276,function(_0x2e2350){if(_0x2e2350[_0x8f59('0x2d')]!==_0x8f59('0x3e')){var _0x10852e={};_0x10852e[_0x2e2350['name']]={'$like':'%'+_0x48b4ae[_0x8f59('0x30')][_0x8f59('0x3b')]+'%'};return _0x10852e;}})});}_0x437e8f=_[_0x8f59('0x3c')]({},_0x437e8f,_0x48b4ae['options']);var _0x29c104={'where':_0x437e8f[_0x8f59('0x3d')]};return db[_0x8f59('0x3f')]['count'](_0x29c104)['then'](function(_0x4333f8){_0x28f5ec[_0x8f59('0x1e')]=_0x4333f8;if(_0x48b4ae[_0x8f59('0x30')][_0x8f59('0x40')]){_0x437e8f['include']=[{'all':!![]}];}return db[_0x8f59('0x3f')][_0x8f59('0x41')](_0x437e8f);})[_0x8f59('0x25')](function(_0xdeb885){_0x28f5ec[_0x8f59('0x42')]=_0xdeb885;return _0x28f5ec;})[_0x8f59('0x25')](respondWithFilteredResult(_0x4f85dd,_0x437e8f))[_0x8f59('0x43')](handleError(_0x4f85dd,null));};exports['show']=function(_0x4b34ed,_0x1888c7){var _0x1aab93={'raw':!![],'where':{'id':_0x4b34ed[_0x8f59('0x44')]['id']}},_0x4efca3={};_0x4efca3[_0x8f59('0x32')]=_[_0x8f59('0x2f')](db[_0x8f59('0x3f')]['rawAttributes']);_0x4efca3[_0x8f59('0x30')]=_[_0x8f59('0x2f')](_0x4b34ed[_0x8f59('0x30')]);_0x4efca3['filters']=_[_0x8f59('0x31')](_0x4efca3[_0x8f59('0x32')],_0x4efca3[_0x8f59('0x30')]);_0x1aab93[_0x8f59('0x34')]=_[_0x8f59('0x31')](_0x4efca3[_0x8f59('0x32')],qs['fields'](_0x4b34ed['query'][_0x8f59('0x33')]));_0x1aab93[_0x8f59('0x34')]=_0x1aab93['attributes'][_0x8f59('0x35')]?_0x1aab93[_0x8f59('0x34')]:_0x4efca3['model'];if(_0x4b34ed['query'][_0x8f59('0x40')]){_0x1aab93['include']=[{'all':!![]}];}_0x1aab93=_[_0x8f59('0x3c')]({},_0x1aab93,_0x4b34ed[_0x8f59('0x45')]);return db['CmHopperHistory'][_0x8f59('0x46')](_0x1aab93)[_0x8f59('0x25')](handleEntityNotFound(_0x1888c7,null))[_0x8f59('0x25')](respondWithResult(_0x1888c7,null))[_0x8f59('0x43')](handleError(_0x1888c7,null));};exports['create']=function(_0x2acb5d,_0x1509dc){return db[_0x8f59('0x3f')]['create'](_0x2acb5d[_0x8f59('0x47')],{})[_0x8f59('0x25')](respondWithResult(_0x1509dc,0xc9))[_0x8f59('0x43')](handleError(_0x1509dc,null));};exports['describe']=function(_0x503623,_0x33a124){return db[_0x8f59('0x3f')][_0x8f59('0x48')]()['then'](respondWithResult(_0x33a124,null))[_0x8f59('0x43')](handleError(_0x33a124,null));};exports[_0x8f59('0x23')]=function(_0x4be1e1,_0x4f8dff){if(_0x4be1e1['body'][_0x8f59('0x49')]){delete _0x4be1e1['body'][_0x8f59('0x49')];}return db['CmHopperHistory']['find']({'where':{'uniqueid':_0x4be1e1['params']['id']}})['then'](handleEntityNotFound(_0x4f8dff,null))[_0x8f59('0x25')](saveUpdates(_0x4be1e1[_0x8f59('0x47')],null))[_0x8f59('0x25')](respondWithResult(_0x4f8dff,null))[_0x8f59('0x43')](handleError(_0x4f8dff,null));}; \ No newline at end of file +var _0x7da1=['filter','type','VIRTUAL','merge','options','includeAll','CmHopperHistory','findAll','catch','length','find','create','describe','body','uniqueid','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick'];(function(_0x5055f1,_0x3cbb87){var _0x28a9f0=function(_0x31433d){while(--_0x31433d){_0x5055f1['push'](_0x5055f1['shift']());}};_0x28a9f0(++_0x3cbb87);}(_0x7da1,0x130));var _0x17da=function(_0x18407c,_0x12e210){_0x18407c=_0x18407c-0x0;var _0x494712=_0x7da1[_0x18407c];return _0x494712;};'use strict';var emlformat=require(_0x17da('0x0'));var rimraf=require(_0x17da('0x1'));var zipdir=require(_0x17da('0x2'));var jsonpatch=require(_0x17da('0x3'));var rp=require('request-promise');var moment=require(_0x17da('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x17da('0x5'));var path=require(_0x17da('0x6'));var sox=require(_0x17da('0x7'));var csv=require(_0x17da('0x8'));var ejs=require(_0x17da('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x17da('0xa'));var squel=require(_0x17da('0xb'));var crypto=require(_0x17da('0xc'));var jsforce=require(_0x17da('0xd'));var deskjs=require(_0x17da('0xe'));var toCsv=require(_0x17da('0x8'));var querystring=require(_0x17da('0xf'));var Papa=require(_0x17da('0x10'));var Redis=require(_0x17da('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x17da('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x17da('0x13'));var utils=require(_0x17da('0x14'));var config=require(_0x17da('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x17da('0x16'))['db'];function respondWithStatusCode(_0x4af536,_0x2917b5){_0x2917b5=_0x2917b5||0xcc;return function(_0x1a1f36){if(_0x1a1f36){return _0x4af536[_0x17da('0x17')](_0x2917b5);}return _0x4af536['status'](_0x2917b5)[_0x17da('0x18')]();};}function respondWithResult(_0x9e0d2d,_0x4ed807){_0x4ed807=_0x4ed807||0xc8;return function(_0x4d567c){if(_0x4d567c){return _0x9e0d2d[_0x17da('0x19')](_0x4ed807)[_0x17da('0x1a')](_0x4d567c);}};}function respondWithFilteredResult(_0x1bb3bb,_0x4f1a61){return function(_0x4320d0){if(_0x4320d0){var _0x3185c7=typeof _0x4f1a61['offset']===_0x17da('0x1b')&&typeof _0x4f1a61[_0x17da('0x1c')]===_0x17da('0x1b');var _0x54a299=_0x4320d0[_0x17da('0x1d')];var _0x45f390=_0x3185c7?0x0:_0x4f1a61[_0x17da('0x1e')];var _0x3de4e4=_0x3185c7?_0x4320d0[_0x17da('0x1d')]:_0x4f1a61[_0x17da('0x1e')]+_0x4f1a61[_0x17da('0x1c')];var _0x3b8733;if(_0x3de4e4>=_0x54a299){_0x3de4e4=_0x54a299;_0x3b8733=0xc8;}else{_0x3b8733=0xce;}_0x1bb3bb['status'](_0x3b8733);return _0x1bb3bb[_0x17da('0x1f')](_0x17da('0x20'),_0x45f390+'-'+_0x3de4e4+'/'+_0x54a299)[_0x17da('0x1a')](_0x4320d0);}return null;};}function patchUpdates(_0x24fb25){return function(_0x1344b5){try{jsonpatch[_0x17da('0x21')](_0x1344b5,_0x24fb25,!![]);}catch(_0x13cf31){return BPromise[_0x17da('0x22')](_0x13cf31);}return _0x1344b5[_0x17da('0x23')]();};}function saveUpdates(_0x1c7397,_0x769ab){return function(_0x42d5ce){if(_0x42d5ce){return _0x42d5ce[_0x17da('0x24')](_0x1c7397)[_0x17da('0x25')](function(_0x595030){return _0x595030;});}return null;};}function removeEntity(_0x281c3f,_0x354773){return function(_0x5d057b){if(_0x5d057b){return _0x5d057b['destroy']()['then'](function(){_0x281c3f[_0x17da('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25d868,_0x1ab278){return function(_0x4ba09a){if(!_0x4ba09a){_0x25d868[_0x17da('0x17')](0x194);}return _0x4ba09a;};}function handleError(_0x2124ac,_0x565972){_0x565972=_0x565972||0x1f4;return function(_0x2840ae){logger['error'](_0x2840ae[_0x17da('0x26')]);if(_0x2840ae[_0x17da('0x27')]){delete _0x2840ae[_0x17da('0x27')];}_0x2124ac[_0x17da('0x19')](_0x565972)['send'](_0x2840ae);};}exports[_0x17da('0x28')]=function(_0x504c6a,_0x3d3085){var _0x39b22c={},_0x506dcb={},_0x1926dd={'count':0x0,'rows':[]};var _0xac0c11=_[_0x17da('0x29')](db['CmHopperHistory'][_0x17da('0x2a')],function(_0x147b52){return{'name':_0x147b52[_0x17da('0x2b')],'type':_0x147b52['type'][_0x17da('0x2c')]};});_0x506dcb[_0x17da('0x2d')]=_['map'](_0xac0c11,_0x17da('0x27'));_0x506dcb[_0x17da('0x2e')]=_[_0x17da('0x2f')](_0x504c6a[_0x17da('0x2e')]);_0x506dcb[_0x17da('0x30')]=_[_0x17da('0x31')](_0x506dcb[_0x17da('0x2d')],_0x506dcb['query']);_0x39b22c[_0x17da('0x32')]=_[_0x17da('0x31')](_0x506dcb[_0x17da('0x2d')],qs[_0x17da('0x33')](_0x504c6a[_0x17da('0x2e')][_0x17da('0x33')]));_0x39b22c[_0x17da('0x32')]=_0x39b22c['attributes']['length']?_0x39b22c['attributes']:_0x506dcb[_0x17da('0x2d')];if(!_0x504c6a['query']['hasOwnProperty']('nolimit')){_0x39b22c[_0x17da('0x1c')]=qs['limit'](_0x504c6a['query'][_0x17da('0x1c')]);_0x39b22c[_0x17da('0x1e')]=qs[_0x17da('0x1e')](_0x504c6a[_0x17da('0x2e')][_0x17da('0x1e')]);}_0x39b22c[_0x17da('0x34')]=qs[_0x17da('0x35')](_0x504c6a[_0x17da('0x2e')][_0x17da('0x35')]);_0x39b22c[_0x17da('0x36')]=qs[_0x17da('0x30')](_[_0x17da('0x37')](_0x504c6a[_0x17da('0x2e')],_0x506dcb[_0x17da('0x30')]),_0xac0c11);if(_0x504c6a[_0x17da('0x2e')][_0x17da('0x38')]){_0x39b22c[_0x17da('0x36')]=_['merge'](_0x39b22c['where'],{'$or':_['map'](_0xac0c11,function(_0x8eb929){if(_0x8eb929[_0x17da('0x39')]!==_0x17da('0x3a')){var _0x1d546a={};_0x1d546a[_0x8eb929[_0x17da('0x27')]]={'$like':'%'+_0x504c6a[_0x17da('0x2e')][_0x17da('0x38')]+'%'};return _0x1d546a;}})});}_0x39b22c=_[_0x17da('0x3b')]({},_0x39b22c,_0x504c6a[_0x17da('0x3c')]);var _0x585f74={'where':_0x39b22c['where']};return db['CmHopperHistory']['count'](_0x585f74)[_0x17da('0x25')](function(_0x11232c){_0x1926dd[_0x17da('0x1d')]=_0x11232c;if(_0x504c6a[_0x17da('0x2e')][_0x17da('0x3d')]){_0x39b22c['include']=[{'all':!![]}];}return db[_0x17da('0x3e')][_0x17da('0x3f')](_0x39b22c);})[_0x17da('0x25')](function(_0x5c25de){_0x1926dd['rows']=_0x5c25de;return _0x1926dd;})['then'](respondWithFilteredResult(_0x3d3085,_0x39b22c))[_0x17da('0x40')](handleError(_0x3d3085,null));};exports['show']=function(_0x24f688,_0x55bedc){var _0x1fbc4e={'raw':!![],'where':{'id':_0x24f688['params']['id']}},_0xa6ef9b={};_0xa6ef9b[_0x17da('0x2d')]=_[_0x17da('0x2f')](db['CmHopperHistory'][_0x17da('0x2a')]);_0xa6ef9b[_0x17da('0x2e')]=_[_0x17da('0x2f')](_0x24f688[_0x17da('0x2e')]);_0xa6ef9b[_0x17da('0x30')]=_['intersection'](_0xa6ef9b['model'],_0xa6ef9b['query']);_0x1fbc4e[_0x17da('0x32')]=_[_0x17da('0x31')](_0xa6ef9b[_0x17da('0x2d')],qs[_0x17da('0x33')](_0x24f688[_0x17da('0x2e')][_0x17da('0x33')]));_0x1fbc4e['attributes']=_0x1fbc4e['attributes'][_0x17da('0x41')]?_0x1fbc4e[_0x17da('0x32')]:_0xa6ef9b['model'];if(_0x24f688['query']['includeAll']){_0x1fbc4e['include']=[{'all':!![]}];}_0x1fbc4e=_[_0x17da('0x3b')]({},_0x1fbc4e,_0x24f688[_0x17da('0x3c')]);return db[_0x17da('0x3e')][_0x17da('0x42')](_0x1fbc4e)[_0x17da('0x25')](handleEntityNotFound(_0x55bedc,null))['then'](respondWithResult(_0x55bedc,null))[_0x17da('0x40')](handleError(_0x55bedc,null));};exports[_0x17da('0x43')]=function(_0x5f24e6,_0x23a6e5){return db[_0x17da('0x3e')]['create'](_0x5f24e6['body'],{})[_0x17da('0x25')](respondWithResult(_0x23a6e5,0xc9))[_0x17da('0x40')](handleError(_0x23a6e5,null));};exports[_0x17da('0x44')]=function(_0x37227c,_0x50569b){return db[_0x17da('0x3e')][_0x17da('0x44')]()[_0x17da('0x25')](respondWithResult(_0x50569b,null))[_0x17da('0x40')](handleError(_0x50569b,null));};exports[_0x17da('0x24')]=function(_0x2119b1,_0x1384c0){if(_0x2119b1[_0x17da('0x45')][_0x17da('0x46')]){delete _0x2119b1['body'][_0x17da('0x46')];}return db[_0x17da('0x3e')][_0x17da('0x42')]({'where':{'uniqueid':_0x2119b1[_0x17da('0x47')]['id']}})[_0x17da('0x25')](handleEntityNotFound(_0x1384c0,null))[_0x17da('0x25')](saveUpdates(_0x2119b1['body'],null))['then'](respondWithResult(_0x1384c0,null))[_0x17da('0x40')](handleError(_0x1384c0,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 2c446ad..111ebb7 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 _0x8325=['define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x1075ad,_0x5b2f97){var _0x4b5bd8=function(_0x2a7572){while(--_0x2a7572){_0x1075ad['push'](_0x1075ad['shift']());}};_0x4b5bd8(++_0x5b2f97);}(_0x8325,0x1f1));var _0x5832=function(_0x1c6b25,_0x2c9218){_0x1c6b25=_0x1c6b25-0x0;var _0x146860=_0x8325[_0x1c6b25];return _0x146860;};'use strict';var _=require(_0x5832('0x0'));var util=require('util');var logger=require(_0x5832('0x1'))('api');var moment=require(_0x5832('0x2'));var BPromise=require('bluebird');var rp=require(_0x5832('0x3'));var fs=require('fs');var path=require(_0x5832('0x4'));var rimraf=require(_0x5832('0x5'));var config=require(_0x5832('0x6'));var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0x1c40ca,_0x2c7977){return _0x1c40ca[_0x5832('0x7')](_0x5832('0x8'),attributes,{'tableName':_0x5832('0x9'),'paranoid':![],'indexes':[{'name':_0x5832('0xa'),'fields':['endtime']},{'name':_0x5832('0xb'),'fields':[_0x5832('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb114=['../../config/environment','./cmHopperHistory.attributes','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x2311e2,_0x383855){var _0x43bf6a=function(_0x4a3e48){while(--_0x4a3e48){_0x2311e2['push'](_0x2311e2['shift']());}};_0x43bf6a(++_0x383855);}(_0xb114,0x11f));var _0x4b11=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xb114[_0x6cf19c];return _0xce14f3;};'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':[{'name':_0x4b11('0xc'),'fields':[_0x4b11('0xc')]},{'name':'uniqueid','fields':[_0x4b11('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 624ca4a..bbef0b8 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 _0x364e=['predictiveIntervalTotalCalls','sequelize','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','ivrTotalCallsDays','GetCampaignHopperHistory','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','stringify','AvgHandleTime','findAll','where','col'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x364e,0xfa));var _0xe364=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x364e[_0x11ce46];return _0x368a1e;};'use strict';var _=require(_0xe364('0x0'));var util=require(_0xe364('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe364('0x2'));var fs=require('fs');var Redis=require(_0xe364('0x3'));var db=require(_0xe364('0x4'))['db'];var utils=require(_0xe364('0x5'));var logger=require(_0xe364('0x6'))(_0xe364('0x7'));var config=require('../../config/environment');var jayson=require(_0xe364('0x8'));var client=jayson[_0xe364('0x9')][_0xe364('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a0c51,_0x11d38a,_0x1eacd0){return new BPromise(function(_0xafde28,_0xded8b9){return client[_0xe364('0xb')](_0x2a0c51,_0x1eacd0)[_0xe364('0xc')](function(_0x3210cd){logger[_0xe364('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x11d38a,_0xe364('0xe'));logger[_0xe364('0xf')](_0xe364('0x10'),_0x11d38a,_0xe364('0xe'),JSON['stringify'](_0x3210cd));if(_0x3210cd[_0xe364('0x11')]){if(_0x3210cd[_0xe364('0x11')][_0xe364('0x12')]===0x1f4){logger['error'](_0xe364('0x13'),_0x11d38a,_0x3210cd[_0xe364('0x11')][_0xe364('0x14')]);return _0xded8b9(_0x3210cd['error'][_0xe364('0x14')]);}logger[_0xe364('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x11d38a,_0x3210cd[_0xe364('0x11')][_0xe364('0x14')]);return _0xafde28(_0x3210cd[_0xe364('0x11')]['message']);}else{logger[_0xe364('0xd')](_0xe364('0x13'),_0x11d38a,_0xe364('0xe'));_0xafde28(_0x3210cd[_0xe364('0x15')][_0xe364('0x14')]);}})[_0xe364('0x16')](function(_0x181ec2){logger[_0xe364('0x11')](_0xe364('0x13'),_0x11d38a,_0x181ec2);_0xded8b9(_0x181ec2);});});}exports[_0xe364('0x17')]=function(_0x416c16){var _0x558a7a=this;return new Promise(function(_0x1ae44d,_0x71cfdc){return db[_0xe364('0x18')][_0xe364('0x19')](_0x416c16[_0xe364('0x1a')],{'raw':_0x416c16[_0xe364('0x1b')]?_0x416c16[_0xe364('0x1b')][_0xe364('0x1c')]===undefined?!![]:![]:!![]})[_0xe364('0xc')](function(_0x3a1720){logger['info'](_0xe364('0x17'),_0x416c16);logger[_0xe364('0xf')]('CreateCmHopperHistory',_0x416c16,JSON[_0xe364('0x1d')](_0x3a1720));_0x1ae44d(_0x3a1720);})[_0xe364('0x16')](function(_0x4085eb){logger[_0xe364('0x11')](_0xe364('0x17'),_0x4085eb[_0xe364('0x14')],_0x416c16);_0x71cfdc(_0x558a7a[_0xe364('0x11')](0x1f4,_0x4085eb[_0xe364('0x14')]));});});};exports[_0xe364('0x1e')]=function(_0x1b63ea){var _0x6cf125=this;return new Promise(function(_0x38d7fc,_0x4c6e29){return db[_0xe364('0x18')][_0xe364('0x1f')]({'raw':_0x1b63ea[_0xe364('0x1b')]?_0x1b63ea['options'][_0xe364('0x1c')]===undefined?!![]:![]:!![],'where':_0x1b63ea['options']?_0x1b63ea['options'][_0xe364('0x20')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db['sequelize'][_0xe364('0x21')]('id')),_0xe364('0x22')],[db[_0xe364('0x23')]['fn'](_0xe364('0x24'),db[_0xe364('0x23')]['fn']('IF',db['sequelize'][_0xe364('0x25')](_0xe364('0x26')))),_0xe364('0x27')],[db[_0xe364('0x23')]['fn']('COUNT',db[_0xe364('0x23')]['fn']('IF',db['sequelize'][_0xe364('0x25')](_0xe364('0x28')))),'predictiveIntervalDroppedCallsTimeout'],[db['sequelize']['fn'](_0xe364('0x24'),db[_0xe364('0x23')]['fn']('IF',db[_0xe364('0x23')][_0xe364('0x25')](_0xe364('0x29')))),'predictiveIntervalDroppedCallsCallersExit'],[db['sequelize']['fn'](_0xe364('0x2a'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xe364('0x2b')))),_0xe364('0x2c')],[db[_0xe364('0x23')]['fn'](_0xe364('0x2a'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xe364('0x2d')))),_0xe364('0x2e')]]})['then'](function(_0x59e27b){logger[_0xe364('0xd')](_0xe364('0x1e'),_0x1b63ea);logger[_0xe364('0xf')](_0xe364('0x1e'),_0x1b63ea,JSON['stringify'](_0x59e27b));_0x38d7fc(_0x59e27b);})[_0xe364('0x16')](function(_0x18c5b9){logger['error'](_0xe364('0x1e'),_0x18c5b9[_0xe364('0x14')],_0x1b63ea);_0x4c6e29(_0x6cf125[_0xe364('0x11')](0x1f4,_0x18c5b9[_0xe364('0x14')]));});});};exports[_0xe364('0x2f')]=function(_0x118a66){var _0x2f5bdf=this;return new Promise(function(_0x51c80a,_0x1ad709){return db[_0xe364('0x18')][_0xe364('0x1f')]({'raw':_0x118a66[_0xe364('0x1b')]?_0x118a66[_0xe364('0x1b')][_0xe364('0x1c')]===undefined?!![]:![]:!![],'where':_0x118a66['options']?_0x118a66[_0xe364('0x1b')][_0xe364('0x20')]||null:null,'attributes':[[_0xe364('0x30'),_0xe364('0x31')],[db['sequelize']['fn'](_0xe364('0x24'),db[_0xe364('0x23')]['fn']('IF',db[_0xe364('0x23')][_0xe364('0x25')](_0xe364('0x32')))),_0xe364('0x33')],[db[_0xe364('0x23')]['fn'](_0xe364('0x24'),db[_0xe364('0x23')]['fn']('IF',db[_0xe364('0x23')][_0xe364('0x25')]('`state`\x20=\x203,\x201,\x20null'))),_0xe364('0x34')],[db[_0xe364('0x23')]['fn'](_0xe364('0x24'),db[_0xe364('0x23')]['fn']('IF',db[_0xe364('0x23')]['literal'](_0xe364('0x26')))),'outboundAnswerCallsDay'],[db[_0xe364('0x23')]['fn'](_0xe364('0x24'),db[_0xe364('0x23')]['fn']('IF',db[_0xe364('0x23')][_0xe364('0x25')](_0xe364('0x35')))),_0xe364('0x36')],[db['sequelize']['fn'](_0xe364('0x24'),db[_0xe364('0x23')]['fn']('IF',db['sequelize'][_0xe364('0x25')](_0xe364('0x37')))),_0xe364('0x38')],[db[_0xe364('0x23')]['fn']('COUNT',db[_0xe364('0x23')]['fn']('IF',db[_0xe364('0x23')]['literal'](_0xe364('0x39')))),_0xe364('0x3a')],[db['sequelize']['fn'](_0xe364('0x24'),db[_0xe364('0x23')]['fn']('IF',db[_0xe364('0x23')][_0xe364('0x25')](_0xe364('0x3b')))),_0xe364('0x3c')],[db[_0xe364('0x23')]['fn'](_0xe364('0x24'),db[_0xe364('0x23')]['fn']('IF',db[_0xe364('0x23')][_0xe364('0x25')](_0xe364('0x3d')))),_0xe364('0x3e')],[db[_0xe364('0x23')]['fn'](_0xe364('0x24'),db[_0xe364('0x23')]['fn']('IF',db['sequelize']['literal'](_0xe364('0x3f')))),_0xe364('0x40')],[db[_0xe364('0x23')]['fn'](_0xe364('0x24'),db[_0xe364('0x23')]['fn']('IF',db['sequelize'][_0xe364('0x25')]('`state`\x20=\x2014,\x201,\x20null'))),_0xe364('0x41')],[db[_0xe364('0x23')]['fn'](_0xe364('0x24'),db[_0xe364('0x23')]['fn']('IF',db[_0xe364('0x23')]['literal']('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db['sequelize']['fn'](_0xe364('0x24'),db[_0xe364('0x23')]['fn']('IF',db[_0xe364('0x23')][_0xe364('0x25')](_0xe364('0x42')))),_0xe364('0x43')],[db[_0xe364('0x23')]['fn'](_0xe364('0x24'),db[_0xe364('0x23')]['fn']('IF',db[_0xe364('0x23')][_0xe364('0x25')]('`state`\x20=\x2020,\x201,\x20null'))),'outboundRejectCallsDay'],[db['sequelize']['fn']('COUNT',db[_0xe364('0x23')]['fn']('IF',db[_0xe364('0x23')][_0xe364('0x25')](_0xe364('0x44')))),'outboundReCallsDay']],'group':['campaign']})[_0xe364('0xc')](function(_0x19be72){logger['info'](_0xe364('0x2f'),_0x118a66);logger[_0xe364('0xf')](_0xe364('0x2f'),_0x118a66,JSON[_0xe364('0x1d')](_0x19be72));_0x51c80a(_0x19be72);})[_0xe364('0x16')](function(_0x3b9afe){logger['error']('GetVoiceQueueHopperHistory',_0x3b9afe[_0xe364('0x14')],_0x118a66);_0x1ad709(_0x2f5bdf['error'](0x1f4,_0x3b9afe[_0xe364('0x14')]));});});};exports['GetCampaignHopperHistory']=function(_0x3a83c2){var _0x20e8a6=this;return new Promise(function(_0x23d807,_0x55c185){return db['CmHopperHistory'][_0xe364('0x1f')]({'raw':_0x3a83c2[_0xe364('0x1b')]?_0x3a83c2[_0xe364('0x1b')][_0xe364('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a83c2[_0xe364('0x1b')]?_0x3a83c2[_0xe364('0x1b')][_0xe364('0x20')]||null:null,'attributes':[[_0xe364('0x30'),_0xe364('0x31')],[db[_0xe364('0x23')]['fn'](_0xe364('0x24'),db[_0xe364('0x23')]['col']('id')),_0xe364('0x45')],[db[_0xe364('0x23')]['fn'](_0xe364('0x24'),db['sequelize']['fn']('IF',db[_0xe364('0x23')][_0xe364('0x25')]('`state`\x20=\x204,\x201,\x20null'))),'ivrAnswerCallsDay']],'group':[_0xe364('0x30')]})[_0xe364('0xc')](function(_0x36a074){logger[_0xe364('0xd')](_0xe364('0x46'),_0x3a83c2);logger[_0xe364('0xf')]('GetCampaignHopperHistory',_0x3a83c2,JSON['stringify'](_0x36a074));_0x23d807(_0x36a074);})[_0xe364('0x16')](function(_0x209902){logger[_0xe364('0x11')](_0xe364('0x46'),_0x209902[_0xe364('0x14')],_0x3a83c2);_0x55c185(_0x20e8a6['error'](0x1f4,_0x209902[_0xe364('0x14')]));});});}; \ No newline at end of file +var _0xdd64=['GetCampaignHopperHistory','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','CmHopperHistory','create','body','raw','CreateCmHopperHistory','AvgHandleTime','findAll','options','COUNT','col','predictiveIntervalTotalCalls','sequelize','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','where','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay'];(function(_0x2b5cdc,_0x3045c9){var _0x1cb285=function(_0x473c0a){while(--_0x473c0a){_0x2b5cdc['push'](_0x2b5cdc['shift']());}};_0x1cb285(++_0x3045c9);}(_0xdd64,0xd3));var _0x4dd6=function(_0x439e06,_0xe6d21c){_0x439e06=_0x439e06-0x0;var _0xaa57c1=_0xdd64[_0x439e06];return _0xaa57c1;};'use strict';var _=require(_0x4dd6('0x0'));var util=require(_0x4dd6('0x1'));var moment=require(_0x4dd6('0x2'));var BPromise=require(_0x4dd6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4dd6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4dd6('0x5'));var logger=require(_0x4dd6('0x6'))(_0x4dd6('0x7'));var config=require('../../config/environment');var jayson=require(_0x4dd6('0x8'));var client=jayson[_0x4dd6('0x9')][_0x4dd6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51f2b3,_0x5cd8e0,_0x32b759){return new BPromise(function(_0x2efc76,_0x2592df){return client[_0x4dd6('0xb')](_0x51f2b3,_0x32b759)[_0x4dd6('0xc')](function(_0x59563c){logger['info'](_0x4dd6('0xd'),_0x5cd8e0,_0x4dd6('0xe'));logger[_0x4dd6('0xf')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x5cd8e0,_0x4dd6('0xe'),JSON[_0x4dd6('0x10')](_0x59563c));if(_0x59563c[_0x4dd6('0x11')]){if(_0x59563c[_0x4dd6('0x11')]['code']===0x1f4){logger[_0x4dd6('0x11')](_0x4dd6('0xd'),_0x5cd8e0,_0x59563c[_0x4dd6('0x11')][_0x4dd6('0x12')]);return _0x2592df(_0x59563c[_0x4dd6('0x11')][_0x4dd6('0x12')]);}logger['error'](_0x4dd6('0xd'),_0x5cd8e0,_0x59563c[_0x4dd6('0x11')][_0x4dd6('0x12')]);return _0x2efc76(_0x59563c[_0x4dd6('0x11')][_0x4dd6('0x12')]);}else{logger[_0x4dd6('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x5cd8e0,_0x4dd6('0xe'));_0x2efc76(_0x59563c[_0x4dd6('0x14')][_0x4dd6('0x12')]);}})[_0x4dd6('0x15')](function(_0xea5cbd){logger[_0x4dd6('0x11')](_0x4dd6('0xd'),_0x5cd8e0,_0xea5cbd);_0x2592df(_0xea5cbd);});});}exports['CreateCmHopperHistory']=function(_0xd28dde){var _0x8a6a07=this;return new Promise(function(_0x248fa4,_0x4634a1){return db[_0x4dd6('0x16')][_0x4dd6('0x17')](_0xd28dde[_0x4dd6('0x18')],{'raw':_0xd28dde['options']?_0xd28dde['options'][_0x4dd6('0x19')]===undefined?!![]:![]:!![]})[_0x4dd6('0xc')](function(_0x8e680c){logger[_0x4dd6('0x13')](_0x4dd6('0x1a'),_0xd28dde);logger[_0x4dd6('0xf')](_0x4dd6('0x1a'),_0xd28dde,JSON[_0x4dd6('0x10')](_0x8e680c));_0x248fa4(_0x8e680c);})[_0x4dd6('0x15')](function(_0x205c05){logger[_0x4dd6('0x11')](_0x4dd6('0x1a'),_0x205c05['message'],_0xd28dde);_0x4634a1(_0x8a6a07[_0x4dd6('0x11')](0x1f4,_0x205c05[_0x4dd6('0x12')]));});});};exports[_0x4dd6('0x1b')]=function(_0x3b1d0c){var _0x22e09b=this;return new Promise(function(_0x31232b,_0x32cd26){return db[_0x4dd6('0x16')][_0x4dd6('0x1c')]({'raw':_0x3b1d0c[_0x4dd6('0x1d')]?_0x3b1d0c[_0x4dd6('0x1d')][_0x4dd6('0x19')]===undefined?!![]:![]:!![],'where':_0x3b1d0c[_0x4dd6('0x1d')]?_0x3b1d0c[_0x4dd6('0x1d')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x4dd6('0x1e'),db['sequelize'][_0x4dd6('0x1f')]('id')),_0x4dd6('0x20')],[db[_0x4dd6('0x21')]['fn']('COUNT',db[_0x4dd6('0x21')]['fn']('IF',db[_0x4dd6('0x21')][_0x4dd6('0x22')](_0x4dd6('0x23')))),_0x4dd6('0x24')],[db['sequelize']['fn'](_0x4dd6('0x1e'),db[_0x4dd6('0x21')]['fn']('IF',db[_0x4dd6('0x21')]['literal'](_0x4dd6('0x25')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x4dd6('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4dd6('0x21')][_0x4dd6('0x22')]('`state`\x20=\x2011,\x201,\x20null'))),_0x4dd6('0x26')],[db[_0x4dd6('0x21')]['fn'](_0x4dd6('0x27'),db[_0x4dd6('0x21')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x4dd6('0x28')],[db[_0x4dd6('0x21')]['fn'](_0x4dd6('0x27'),db['sequelize']['fn']('IF',db[_0x4dd6('0x21')][_0x4dd6('0x22')](_0x4dd6('0x29')))),_0x4dd6('0x2a')]]})[_0x4dd6('0xc')](function(_0x2c037e){logger['info'](_0x4dd6('0x1b'),_0x3b1d0c);logger['debug'](_0x4dd6('0x1b'),_0x3b1d0c,JSON[_0x4dd6('0x10')](_0x2c037e));_0x31232b(_0x2c037e);})[_0x4dd6('0x15')](function(_0xcfc983){logger[_0x4dd6('0x11')](_0x4dd6('0x1b'),_0xcfc983['message'],_0x3b1d0c);_0x32cd26(_0x22e09b[_0x4dd6('0x11')](0x1f4,_0xcfc983[_0x4dd6('0x12')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x3b96d9){var _0x58e722=this;return new Promise(function(_0x46c00a,_0x18c295){return db[_0x4dd6('0x16')]['findAll']({'raw':_0x3b96d9[_0x4dd6('0x1d')]?_0x3b96d9[_0x4dd6('0x1d')][_0x4dd6('0x19')]===undefined?!![]:![]:!![],'where':_0x3b96d9[_0x4dd6('0x1d')]?_0x3b96d9['options'][_0x4dd6('0x2b')]||null:null,'attributes':[[_0x4dd6('0x2c'),_0x4dd6('0x2d')],[db[_0x4dd6('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4dd6('0x21')][_0x4dd6('0x22')](_0x4dd6('0x2e')))),_0x4dd6('0x2f')],[db[_0x4dd6('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4dd6('0x21')]['literal'](_0x4dd6('0x30')))),_0x4dd6('0x31')],[db[_0x4dd6('0x21')]['fn'](_0x4dd6('0x1e'),db[_0x4dd6('0x21')]['fn']('IF',db[_0x4dd6('0x21')][_0x4dd6('0x22')](_0x4dd6('0x23')))),_0x4dd6('0x32')],[db['sequelize']['fn'](_0x4dd6('0x1e'),db[_0x4dd6('0x21')]['fn']('IF',db[_0x4dd6('0x21')]['literal'](_0x4dd6('0x33')))),_0x4dd6('0x34')],[db[_0x4dd6('0x21')]['fn'](_0x4dd6('0x1e'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x4dd6('0x35')))),_0x4dd6('0x36')],[db[_0x4dd6('0x21')]['fn'](_0x4dd6('0x1e'),db[_0x4dd6('0x21')]['fn']('IF',db[_0x4dd6('0x21')][_0x4dd6('0x22')](_0x4dd6('0x37')))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn']('COUNT',db[_0x4dd6('0x21')]['fn']('IF',db[_0x4dd6('0x21')]['literal'](_0x4dd6('0x38')))),_0x4dd6('0x39')],[db['sequelize']['fn'](_0x4dd6('0x1e'),db[_0x4dd6('0x21')]['fn']('IF',db[_0x4dd6('0x21')][_0x4dd6('0x22')](_0x4dd6('0x3a')))),_0x4dd6('0x3b')],[db['sequelize']['fn'](_0x4dd6('0x1e'),db[_0x4dd6('0x21')]['fn']('IF',db[_0x4dd6('0x21')]['literal']('`state`\x20=\x2013,\x201,\x20null'))),_0x4dd6('0x3c')],[db[_0x4dd6('0x21')]['fn'](_0x4dd6('0x1e'),db[_0x4dd6('0x21')]['fn']('IF',db[_0x4dd6('0x21')][_0x4dd6('0x22')](_0x4dd6('0x3d')))),'outboundOriginateFailureCallsDay'],[db['sequelize']['fn'](_0x4dd6('0x1e'),db[_0x4dd6('0x21')]['fn']('IF',db[_0x4dd6('0x21')][_0x4dd6('0x22')]('`state`\x20=\x2018,\x201,\x20null'))),_0x4dd6('0x3e')],[db['sequelize']['fn']('COUNT',db[_0x4dd6('0x21')]['fn']('IF',db[_0x4dd6('0x21')][_0x4dd6('0x22')]('`state`\x20=\x2016,\x201,\x20null'))),'outboundAnswerAgiCallsDay'],[db[_0x4dd6('0x21')]['fn']('COUNT',db[_0x4dd6('0x21')]['fn']('IF',db['sequelize'][_0x4dd6('0x22')](_0x4dd6('0x3f')))),_0x4dd6('0x3e')],[db[_0x4dd6('0x21')]['fn'](_0x4dd6('0x1e'),db[_0x4dd6('0x21')]['fn']('IF',db['sequelize'][_0x4dd6('0x22')](_0x4dd6('0x40')))),_0x4dd6('0x41')]],'group':['campaign']})[_0x4dd6('0xc')](function(_0x361082){logger[_0x4dd6('0x13')]('GetVoiceQueueHopperHistory',_0x3b96d9);logger['debug'](_0x4dd6('0x42'),_0x3b96d9,JSON[_0x4dd6('0x10')](_0x361082));_0x46c00a(_0x361082);})[_0x4dd6('0x15')](function(_0x3e70da){logger[_0x4dd6('0x11')](_0x4dd6('0x42'),_0x3e70da[_0x4dd6('0x12')],_0x3b96d9);_0x18c295(_0x58e722[_0x4dd6('0x11')](0x1f4,_0x3e70da[_0x4dd6('0x12')]));});});};exports['GetCampaignHopperHistory']=function(_0xe28f8){var _0x1291d6=this;return new Promise(function(_0x2775fb,_0x5a5e29){return db[_0x4dd6('0x16')][_0x4dd6('0x1c')]({'raw':_0xe28f8[_0x4dd6('0x1d')]?_0xe28f8[_0x4dd6('0x1d')][_0x4dd6('0x19')]===undefined?!![]:![]:!![],'where':_0xe28f8['options']?_0xe28f8[_0x4dd6('0x1d')][_0x4dd6('0x2b')]||null:null,'attributes':[[_0x4dd6('0x2c'),_0x4dd6('0x2d')],[db['sequelize']['fn'](_0x4dd6('0x1e'),db['sequelize'][_0x4dd6('0x1f')]('id')),_0x4dd6('0x43')],[db[_0x4dd6('0x21')]['fn'](_0x4dd6('0x1e'),db[_0x4dd6('0x21')]['fn']('IF',db[_0x4dd6('0x21')][_0x4dd6('0x22')](_0x4dd6('0x23')))),_0x4dd6('0x44')]],'group':[_0x4dd6('0x2c')]})[_0x4dd6('0xc')](function(_0x353133){logger[_0x4dd6('0x13')](_0x4dd6('0x45'),_0xe28f8);logger[_0x4dd6('0xf')]('GetCampaignHopperHistory',_0xe28f8,JSON[_0x4dd6('0x10')](_0x353133));_0x2775fb(_0x353133);})['catch'](function(_0x1205d3){logger[_0x4dd6('0x11')](_0x4dd6('0x45'),_0x1205d3[_0x4dd6('0x12')],_0xe28f8);_0x5a5e29(_0x1291d6[_0x4dd6('0x11')](0x1f4,_0x1205d3[_0x4dd6('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 71047ce..8aea18b 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 _0xd8c1=['get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xd8c1,0x19a));var _0x1d8c=function(_0x47970a,_0x5aa671){_0x47970a=_0x47970a-0x0;var _0x4e6d16=_0xd8c1[_0x47970a];return _0x4e6d16;};'use strict';var multer=require(_0x1d8c('0x0'));var util=require(_0x1d8c('0x1'));var path=require(_0x1d8c('0x2'));var timeout=require(_0x1d8c('0x3'));var express=require(_0x1d8c('0x4'));var router=express[_0x1d8c('0x5')]();var fs_extra=require(_0x1d8c('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1d8c('0x7'));var controller=require('./cmHopperHistory.controller');router[_0x1d8c('0x8')]('/',auth['isAuthenticated'](),controller[_0x1d8c('0x9')]);router['get'](_0x1d8c('0xa'),auth[_0x1d8c('0xb')](),controller['describe']);router[_0x1d8c('0x8')](_0x1d8c('0xc'),auth['isAuthenticated'](),controller[_0x1d8c('0xd')]);router[_0x1d8c('0xe')]('/',auth['isAuthenticated'](),controller[_0x1d8c('0xf')]);router[_0x1d8c('0x10')](_0x1d8c('0xc'),auth[_0x1d8c('0xb')](),controller[_0x1d8c('0x11')]);module[_0x1d8c('0x12')]=router; \ No newline at end of file +var _0xb407=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','get','/describe','describe','show','post','create','put','/:id','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3c9e74,_0x4334c5){var _0x4fea21=function(_0x5a2cbb){while(--_0x5a2cbb){_0x3c9e74['push'](_0x3c9e74['shift']());}};_0x4fea21(++_0x4334c5);}(_0xb407,0x1c8));var _0x7b40=function(_0x1c42e4,_0x559ca5){_0x1c42e4=_0x1c42e4-0x0;var _0x258df3=_0xb407[_0x1c42e4];return _0x258df3;};'use strict';var multer=require(_0x7b40('0x0'));var util=require(_0x7b40('0x1'));var path=require(_0x7b40('0x2'));var timeout=require(_0x7b40('0x3'));var express=require(_0x7b40('0x4'));var router=express[_0x7b40('0x5')]();var fs_extra=require(_0x7b40('0x6'));var auth=require(_0x7b40('0x7'));var interaction=require(_0x7b40('0x8'));var config=require(_0x7b40('0x9'));var controller=require(_0x7b40('0xa'));router['get']('/',auth[_0x7b40('0xb')](),controller['index']);router[_0x7b40('0xc')](_0x7b40('0xd'),auth[_0x7b40('0xb')](),controller[_0x7b40('0xe')]);router[_0x7b40('0xc')]('/:id',auth[_0x7b40('0xb')](),controller[_0x7b40('0xf')]);router[_0x7b40('0x10')]('/',auth[_0x7b40('0xb')](),controller[_0x7b40('0x11')]);router[_0x7b40('0x12')](_0x7b40('0x13'),auth['isAuthenticated'](),controller['update']);module[_0x7b40('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index f144be6..1473f82 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 _0x6c7b=['STRING','sequelize'];(function(_0x1c4a9c,_0x2ad32c){var _0x5411c2=function(_0x3f4b6c){while(--_0x3f4b6c){_0x1c4a9c['push'](_0x1c4a9c['shift']());}};_0x5411c2(++_0x2ad32c);}(_0x6c7b,0x10b));var _0xb6c7=function(_0xadc19e,_0x5d422a){_0xadc19e=_0xadc19e-0x0;var _0x5dc2f7=_0x6c7b[_0xadc19e];return _0x5dc2f7;};'use strict';var Sequelize=require(_0xb6c7('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb6c7('0x1')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x943c=['sequelize','exports','STRING','name'];(function(_0x6f4e96,_0x296366){var _0x4edc79=function(_0x5d8cfb){while(--_0x5d8cfb){_0x6f4e96['push'](_0x6f4e96['shift']());}};_0x4edc79(++_0x296366);}(_0x943c,0xd8));var _0xc943=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x943c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc943('0x0'));module[_0xc943('0x1')]={'name':{'type':Sequelize[_0xc943('0x2')],'unique':_0xc943('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index be08f5a..dfe75f4 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 _0x6728=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./cmList.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','CmList','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','user','role','Lists','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','order','pick','removeDispositions','addContacts','CmContact','isArray','tags','join','each','ids','success','push','errors','message','Malformed\x20request\x20syntax','CmCustomField','concat','CustomFields','format','getContactsCsv','getContacts','isEmpty','now','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','setHeader','Content-type','text/csv','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','findAndCountAll','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse'];(function(_0x33a8f1,_0xe7b90c){var _0x28b846=function(_0x64959b){while(--_0x64959b){_0x33a8f1['push'](_0x33a8f1['shift']());}};_0x28b846(++_0xe7b90c);}(_0x6728,0x85));var _0x8672=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0x6728[_0xbb9dbf];return _0x30223c;};'use strict';var emlformat=require(_0x8672('0x0'));var rimraf=require(_0x8672('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8672('0x2'));var moment=require(_0x8672('0x3'));var BPromise=require(_0x8672('0x4'));var Mustache=require(_0x8672('0x5'));var util=require(_0x8672('0x6'));var path=require(_0x8672('0x7'));var sox=require(_0x8672('0x8'));var csv=require(_0x8672('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8672('0xa'));var _=require(_0x8672('0xb'));var squel=require(_0x8672('0xc'));var crypto=require(_0x8672('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8672('0x9'));var querystring=require(_0x8672('0xe'));var Papa=require(_0x8672('0xf'));var Redis=require(_0x8672('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8672('0x11'));var as=require(_0x8672('0x12'));var hardwareService=require(_0x8672('0x13'));var logger=require(_0x8672('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x8672('0x15'));var licenseUtil=require(_0x8672('0x16'));var db=require(_0x8672('0x17'))['db'];config['redis']=_['defaults'](config[_0x8672('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x8672('0x19'))(new Redis(config[_0x8672('0x18')]));require(_0x8672('0x1a'))[_0x8672('0x1b')](socket);function respondWithStatusCode(_0x505927,_0x3f3b08){_0x3f3b08=_0x3f3b08||0xcc;return function(_0x5055fd){if(_0x5055fd){return _0x505927[_0x8672('0x1c')](_0x3f3b08);}return _0x505927['status'](_0x3f3b08)[_0x8672('0x1d')]();};}function respondWithResult(_0x426d68,_0xb24254){_0xb24254=_0xb24254||0xc8;return function(_0x6a9ceb){if(_0x6a9ceb){return _0x426d68[_0x8672('0x1e')](_0xb24254)[_0x8672('0x1f')](_0x6a9ceb);}};}function respondWithFilteredResult(_0x4e15a9,_0x4ea2d0){return function(_0x36dcdc){if(_0x36dcdc){var _0x338d48=typeof _0x4ea2d0[_0x8672('0x20')]===_0x8672('0x21')&&typeof _0x4ea2d0[_0x8672('0x22')]===_0x8672('0x21');var _0x24142d=_0x36dcdc['count'];var _0x582f25=_0x338d48?0x0:_0x4ea2d0[_0x8672('0x20')];var _0x19acd2=_0x338d48?_0x36dcdc[_0x8672('0x23')]:_0x4ea2d0[_0x8672('0x20')]+_0x4ea2d0[_0x8672('0x22')];var _0x1076d9;if(_0x19acd2>=_0x24142d){_0x19acd2=_0x24142d;_0x1076d9=0xc8;}else{_0x1076d9=0xce;}_0x4e15a9[_0x8672('0x1e')](_0x1076d9);return _0x4e15a9[_0x8672('0x24')](_0x8672('0x25'),_0x582f25+'-'+_0x19acd2+'/'+_0x24142d)[_0x8672('0x1f')](_0x36dcdc);}return null;};}function patchUpdates(_0xaa833c){return function(_0x27e1a4){try{jsonpatch[_0x8672('0x26')](_0x27e1a4,_0xaa833c,!![]);}catch(_0xdb107){return BPromise[_0x8672('0x27')](_0xdb107);}return _0x27e1a4[_0x8672('0x28')]();};}function saveUpdates(_0x2bfab1,_0x29fbdb){return function(_0x3c64d5){if(_0x3c64d5){return _0x3c64d5[_0x8672('0x29')](_0x2bfab1)[_0x8672('0x2a')](function(_0x512b1b){return _0x512b1b;});}return null;};}function removeEntity(_0x4eed41,_0x1e6d82){return function(_0xf334c5){if(_0xf334c5){return _0xf334c5[_0x8672('0x2b')]()[_0x8672('0x2a')](function(){var _0x18062f=_0xf334c5[_0x8672('0x2c')]({'plain':!![]});var _0x4f10d5='Lists';return db['UserProfileResource'][_0x8672('0x2b')]({'where':{'type':_0x4f10d5,'resourceId':_0x18062f['id']}})[_0x8672('0x2a')](function(){return _0xf334c5;});})[_0x8672('0x2a')](function(){_0x4eed41[_0x8672('0x1e')](0xcc)[_0x8672('0x1d')]();});}};}function handleEntityNotFound(_0x594ce0,_0x531a10){return function(_0x212e9b){if(!_0x212e9b){_0x594ce0[_0x8672('0x1c')](0x194);}return _0x212e9b;};}function handleError(_0x5b5a66,_0x280c32){_0x280c32=_0x280c32||0x1f4;return function(_0x3bec0a){logger[_0x8672('0x2d')](_0x3bec0a[_0x8672('0x2e')]);if(_0x3bec0a[_0x8672('0x2f')]){delete _0x3bec0a[_0x8672('0x2f')];}_0x5b5a66[_0x8672('0x1e')](_0x280c32)[_0x8672('0x30')](_0x3bec0a);};}exports[_0x8672('0x31')]=function(_0x2d2753,_0x4fe4b7){var _0x29d939={},_0x339484={},_0x3af0eb={'count':0x0,'rows':[]};var _0x49a0a6=_[_0x8672('0x32')](db['CmList'][_0x8672('0x33')],function(_0x14a0a1){return{'name':_0x14a0a1[_0x8672('0x34')],'type':_0x14a0a1[_0x8672('0x35')][_0x8672('0x36')]};});_0x339484[_0x8672('0x37')]=_[_0x8672('0x32')](_0x49a0a6,_0x8672('0x2f'));_0x339484[_0x8672('0x38')]=_[_0x8672('0x39')](_0x2d2753['query']);_0x339484[_0x8672('0x3a')]=_[_0x8672('0x3b')](_0x339484[_0x8672('0x37')],_0x339484['query']);_0x29d939[_0x8672('0x3c')]=_['intersection'](_0x339484[_0x8672('0x37')],qs[_0x8672('0x3d')](_0x2d2753[_0x8672('0x38')][_0x8672('0x3d')]));_0x29d939[_0x8672('0x3c')]=_0x29d939['attributes']['length']?_0x29d939[_0x8672('0x3c')]:_0x339484[_0x8672('0x37')];if(!_0x2d2753['query'][_0x8672('0x3e')](_0x8672('0x3f'))){_0x29d939['limit']=qs[_0x8672('0x22')](_0x2d2753[_0x8672('0x38')][_0x8672('0x22')]);_0x29d939[_0x8672('0x20')]=qs[_0x8672('0x20')](_0x2d2753['query'][_0x8672('0x20')]);}_0x29d939['order']=qs[_0x8672('0x40')](_0x2d2753[_0x8672('0x38')]['sort']);_0x29d939[_0x8672('0x41')]=qs[_0x8672('0x3a')](_['pick'](_0x2d2753[_0x8672('0x38')],_0x339484[_0x8672('0x3a')]),_0x49a0a6);if(_0x2d2753[_0x8672('0x38')][_0x8672('0x42')]){_0x29d939[_0x8672('0x41')]=_[_0x8672('0x43')](_0x29d939['where'],{'$or':_[_0x8672('0x32')](_0x49a0a6,function(_0x5d8e1d){if(_0x5d8e1d[_0x8672('0x35')]!==_0x8672('0x44')){var _0x5bd52c={};_0x5bd52c[_0x5d8e1d['name']]={'$like':'%'+_0x2d2753['query'][_0x8672('0x42')]+'%'};return _0x5bd52c;}})});}_0x29d939=_[_0x8672('0x43')]({},_0x29d939,_0x2d2753[_0x8672('0x45')]);var _0x46cdb7={'where':_0x29d939[_0x8672('0x41')]};return db[_0x8672('0x46')]['count'](_0x46cdb7)[_0x8672('0x2a')](function(_0x460f67){_0x3af0eb['count']=_0x460f67;if(_0x2d2753['query']['includeAll']){_0x29d939[_0x8672('0x47')]=[{'all':!![]}];}return db[_0x8672('0x46')][_0x8672('0x48')](_0x29d939);})[_0x8672('0x2a')](function(_0x5b895e){_0x3af0eb[_0x8672('0x49')]=_0x5b895e;return _0x3af0eb;})[_0x8672('0x2a')](respondWithFilteredResult(_0x4fe4b7,_0x29d939))[_0x8672('0x4a')](handleError(_0x4fe4b7,null));};exports[_0x8672('0x4b')]=function(_0xc06570,_0xfd618){var _0x279f2e={'raw':![],'where':{'id':_0xc06570[_0x8672('0x4c')]['id']}},_0x4dfd15={};_0x4dfd15[_0x8672('0x37')]=_[_0x8672('0x39')](db[_0x8672('0x46')][_0x8672('0x33')]);_0x4dfd15[_0x8672('0x38')]=_[_0x8672('0x39')](_0xc06570['query']);_0x4dfd15['filters']=_[_0x8672('0x3b')](_0x4dfd15[_0x8672('0x37')],_0x4dfd15[_0x8672('0x38')]);_0x279f2e['attributes']=_[_0x8672('0x3b')](_0x4dfd15[_0x8672('0x37')],qs[_0x8672('0x3d')](_0xc06570['query'][_0x8672('0x3d')]));_0x279f2e[_0x8672('0x3c')]=_0x279f2e[_0x8672('0x3c')][_0x8672('0x4d')]?_0x279f2e[_0x8672('0x3c')]:_0x4dfd15[_0x8672('0x37')];if(_0xc06570[_0x8672('0x38')][_0x8672('0x4e')]){_0x279f2e['include']=[{'all':!![]}];}_0x279f2e=_['merge']({},_0x279f2e,_0xc06570[_0x8672('0x45')]);return db['CmList'][_0x8672('0x4f')](_0x279f2e)[_0x8672('0x2a')](handleEntityNotFound(_0xfd618,null))[_0x8672('0x2a')](respondWithResult(_0xfd618,null))[_0x8672('0x4a')](handleError(_0xfd618,null));};exports[_0x8672('0x50')]=function(_0x584ddb,_0x125728){return db[_0x8672('0x46')][_0x8672('0x50')](_0x584ddb[_0x8672('0x51')],{})[_0x8672('0x2a')](function(_0x81c321){var _0x32965c=_0x584ddb[_0x8672('0x52')][_0x8672('0x2c')]({'plain':!![]});if(!_0x32965c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x32965c[_0x8672('0x53')]==='user'){var _0x1d1608=_0x81c321[_0x8672('0x2c')]({'plain':!![]});var _0x135f7f=_0x8672('0x54');return db[_0x8672('0x55')][_0x8672('0x4f')]({'where':{'name':_0x135f7f,'userProfileId':_0x32965c[_0x8672('0x56')]},'raw':!![]})[_0x8672('0x2a')](function(_0x374b39){if(_0x374b39&&_0x374b39[_0x8672('0x57')]===0x0){return db[_0x8672('0x58')][_0x8672('0x50')]({'name':_0x1d1608[_0x8672('0x2f')],'resourceId':_0x1d1608['id'],'type':_0x374b39['name'],'sectionId':_0x374b39['id']},{})['then'](function(){return _0x81c321;});}else{return _0x81c321;}})[_0x8672('0x4a')](function(_0xc8bc73){logger['error'](_0x8672('0x59'),_0xc8bc73);throw _0xc8bc73;});}return _0x81c321;})['then'](respondWithResult(_0x125728,0xc9))['catch'](handleError(_0x125728,null));};exports[_0x8672('0x29')]=function(_0x2cede0,_0x2e8987){if(_0x2cede0[_0x8672('0x51')]['id']){delete _0x2cede0['body']['id'];}return db['CmList'][_0x8672('0x4f')]({'where':{'id':_0x2cede0[_0x8672('0x4c')]['id']}})[_0x8672('0x2a')](handleEntityNotFound(_0x2e8987,null))[_0x8672('0x2a')](saveUpdates(_0x2cede0[_0x8672('0x51')],null))['then'](respondWithResult(_0x2e8987,null))[_0x8672('0x4a')](handleError(_0x2e8987,null));};exports['destroy']=function(_0x39c68a,_0x563597){return db[_0x8672('0x46')]['find']({'where':{'id':_0x39c68a[_0x8672('0x4c')]['id']}})[_0x8672('0x2a')](handleEntityNotFound(_0x563597,null))[_0x8672('0x2a')](removeEntity(_0x563597,null))[_0x8672('0x4a')](handleError(_0x563597,null));};exports[_0x8672('0x5a')]=function(_0x427390,_0x3fb88d){return db['CmList'][_0x8672('0x5a')]()[_0x8672('0x2a')](respondWithResult(_0x3fb88d,null))[_0x8672('0x4a')](handleError(_0x3fb88d,null));};exports[_0x8672('0x5b')]=function(_0x1fc265,_0x427628,_0x5226f0){if(_0x1fc265[_0x8672('0x51')]['id']){delete _0x1fc265[_0x8672('0x51')]['id'];}return db[_0x8672('0x46')]['find']({'where':{'id':_0x1fc265[_0x8672('0x4c')]['id']}})[_0x8672('0x2a')](handleEntityNotFound(_0x427628,null))['then'](function(_0x339627){if(_0x339627){_0x1fc265['body'][_0x8672('0x5c')]=_0x339627['id'];return db[_0x8672('0x5d')][_0x8672('0x50')](_0x1fc265['body']);}})[_0x8672('0x2a')](respondWithResult(_0x427628,null))[_0x8672('0x4a')](handleError(_0x427628,null));};exports[_0x8672('0x5e')]=function(_0x6eb2a4,_0x2d299b,_0x14b5b5){var _0x57bc83={'raw':![],'where':{}};var _0x7508c2={};var _0x453cad={'count':0x0,'rows':[]};return db[_0x8672('0x46')][_0x8672('0x5f')]({'where':{'id':_0x6eb2a4[_0x8672('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2d299b,null))['then'](function(_0x323403){if(_0x323403){_0x7508c2[_0x8672('0x37')]=_[_0x8672('0x39')](db[_0x8672('0x5d')][_0x8672('0x33')]);_0x7508c2['query']=_[_0x8672('0x39')](_0x6eb2a4[_0x8672('0x38')]);_0x7508c2[_0x8672('0x3a')]=_[_0x8672('0x3b')](_0x7508c2[_0x8672('0x37')],_0x7508c2['query']);_0x57bc83['attributes']=_[_0x8672('0x3b')](_0x7508c2[_0x8672('0x37')],qs[_0x8672('0x3d')](_0x6eb2a4[_0x8672('0x38')][_0x8672('0x3d')]));_0x57bc83[_0x8672('0x3c')]=_0x57bc83[_0x8672('0x3c')][_0x8672('0x4d')]?_0x57bc83['attributes']:_0x7508c2['model'];if(!_0x6eb2a4[_0x8672('0x38')][_0x8672('0x3e')](_0x8672('0x3f'))){_0x57bc83[_0x8672('0x22')]=qs[_0x8672('0x22')](_0x6eb2a4[_0x8672('0x38')]['limit']);_0x57bc83[_0x8672('0x20')]=qs[_0x8672('0x20')](_0x6eb2a4[_0x8672('0x38')][_0x8672('0x20')]);}_0x57bc83[_0x8672('0x60')]=qs[_0x8672('0x40')](_0x6eb2a4[_0x8672('0x38')][_0x8672('0x40')]);_0x57bc83[_0x8672('0x41')]=qs[_0x8672('0x3a')](_[_0x8672('0x61')](_0x6eb2a4['query'],_0x7508c2[_0x8672('0x3a')]));_0x57bc83[_0x8672('0x41')][_0x8672('0x5c')]=_0x323403['id'];if(_0x6eb2a4[_0x8672('0x38')][_0x8672('0x42')]){_0x57bc83[_0x8672('0x41')]=_[_0x8672('0x43')](_0x57bc83[_0x8672('0x41')],{'$or':_[_0x8672('0x32')](_0x57bc83['attributes'],function(_0x40cb75){var _0x35f6c0={};_0x35f6c0[_0x40cb75]={'$like':'%'+_0x6eb2a4[_0x8672('0x38')][_0x8672('0x42')]+'%'};return _0x35f6c0;})});}_0x57bc83=_[_0x8672('0x43')]({},_0x57bc83,_0x6eb2a4[_0x8672('0x45')]);return db[_0x8672('0x5d')][_0x8672('0x23')]({'where':_0x57bc83[_0x8672('0x41')]})[_0x8672('0x2a')](function(_0x3056b4){_0x453cad['count']=_0x3056b4;if(_0x6eb2a4['query']['includeAll']){_0x57bc83[_0x8672('0x47')]=[{'all':!![]}];}return db[_0x8672('0x5d')][_0x8672('0x48')](_0x57bc83);})[_0x8672('0x2a')](function(_0x3b1589){_0x453cad['rows']=_0x3b1589;return _0x453cad;});}})[_0x8672('0x2a')](respondWithFilteredResult(_0x2d299b,_0x57bc83))[_0x8672('0x4a')](handleError(_0x2d299b,null));};exports[_0x8672('0x62')]=function(_0x597a65,_0x474b1e,_0x21f9a8){return db[_0x8672('0x46')]['find']({'where':{'id':_0x597a65[_0x8672('0x4c')]['id']}})[_0x8672('0x2a')](handleEntityNotFound(_0x474b1e,null))['then'](function(_0x31ff41){if(_0x31ff41){return _0x31ff41['removeDispositions'](_0x597a65['query']['ids']);}})[_0x8672('0x2a')](respondWithStatusCode(_0x474b1e,null))['catch'](handleError(_0x474b1e,null));};exports[_0x8672('0x63')]=function(_0x2a3856,_0x1055fc,_0x8d305f){return db[_0x8672('0x46')][_0x8672('0x4f')]({'where':{'id':_0x2a3856[_0x8672('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1055fc,null))[_0x8672('0x2a')](function(_0x2c0ef1){if(_0x2c0ef1){var _0x471b70=[];var _0x1087eb={'success':[],'errors':[]};return db[_0x8672('0x64')][_0x8672('0x5a')]()['then'](function(_0x3eedeb){if(_0x2a3856[_0x8672('0x51')]['tags']&&_[_0x8672('0x65')](_0x2a3856[_0x8672('0x51')]['tags'])){if(_0x2a3856['body']['tags'][_0x8672('0x4d')]){_0x2a3856[_0x8672('0x51')][_0x8672('0x66')]=_0x2a3856[_0x8672('0x51')]['tags'][_0x8672('0x67')](';')+';';}else{_0x2a3856['body']['tags']=null;}}else{_0x2a3856[_0x8672('0x51')][_0x8672('0x66')]=null;}if(_0x2a3856[_0x8672('0x51')]&&_['isArray'](_0x2a3856[_0x8672('0x51')])){for(var _0x4e5f90=0x0;_0x4e5f90<_0x2a3856[_0x8672('0x51')][_0x8672('0x4d')];_0x4e5f90+=0x1){_0x2a3856[_0x8672('0x51')][_0x4e5f90][_0x8672('0x5c')]=_0x2a3856[_0x8672('0x4c')]['id'];_0x471b70['push'](_0x2a3856[_0x8672('0x51')][_0x4e5f90]);}return BPromise[_0x8672('0x68')](_0x471b70,function(_0x52bd73){return db[_0x8672('0x64')][_0x8672('0x50')](_['omit'](_0x52bd73,[_0x8672('0x69'),'id'])||{},{'fields':_[_0x8672('0x39')](_0x3eedeb),'raw':!![]})[_0x8672('0x2a')](function(_0x1d88f9){_0x1087eb[_0x8672('0x6a')][_0x8672('0x6b')](_0x1d88f9['dataValues']);})['catch'](function(_0x4e26b7){_0x1087eb[_0x8672('0x6c')][_0x8672('0x6b')]({'data':_0x52bd73,'error':_0x4e26b7[_0x8672('0x6d')]});});})[_0x8672('0x2a')](function(_0x1ca758){return _0x1087eb;})[_0x8672('0x4a')](function(_0x3056ff){return _0x3056ff;});}else{_0x1055fc[_0x8672('0x1e')](0x190)[_0x8672('0x1f')]({'message':_0x8672('0x6e')});}});}})['then'](respondWithResult(_0x1055fc,null))[_0x8672('0x4a')](handleError(_0x1055fc,null));};exports['getContacts']=function(_0x317ead,_0x2ed5ae,_0x44c9e3){var _0x15fb33;return db['CmList']['find']({'where':{'id':_0x317ead[_0x8672('0x4c')]['id']},'include':[{'model':db[_0x8672('0x6f')],'as':'CustomFields'}]})[_0x8672('0x2a')](handleEntityNotFound(_0x2ed5ae,null))[_0x8672('0x2a')](function(_0x18e5db){if(_0x18e5db){_0x15fb33=_0x18e5db;return db[_0x8672('0x64')][_0x8672('0x33')];}})['then'](function(_0x4c4ed6){if(_0x4c4ed6){var _0x5879fc={};var _0xee946e={};_0xee946e['model']=_[_0x8672('0x70')](_[_0x8672('0x39')](_0x4c4ed6),_['map'](_0x15fb33[_0x8672('0x71')],function(_0x515748){return util[_0x8672('0x72')]('cf_%d',_0x515748['id']);}));_0xee946e[_0x8672('0x38')]=_['keys'](_0x317ead[_0x8672('0x38')]);_0xee946e[_0x8672('0x3a')]=_[_0x8672('0x3b')](_0xee946e[_0x8672('0x37')],_0xee946e[_0x8672('0x38')]);_0x5879fc[_0x8672('0x3c')]=_[_0x8672('0x3b')](_0xee946e[_0x8672('0x37')],qs['fields'](_0x317ead[_0x8672('0x38')]['fields']));_0x5879fc[_0x8672('0x3c')]=_0x5879fc[_0x8672('0x3c')][_0x8672('0x4d')]?_0x5879fc[_0x8672('0x3c')]:_0xee946e[_0x8672('0x37')];if(!_0x317ead[_0x8672('0x38')][_0x8672('0x3e')](_0x8672('0x3f'))){_0x5879fc[_0x8672('0x22')]=qs[_0x8672('0x22')](_0x317ead['query']['limit']);_0x5879fc[_0x8672('0x20')]=qs[_0x8672('0x20')](_0x317ead[_0x8672('0x38')][_0x8672('0x20')]);}_0x5879fc['order']=qs[_0x8672('0x40')](_0x317ead[_0x8672('0x38')][_0x8672('0x40')]);_0x5879fc['where']=qs['filters'](_['pick'](_0x317ead[_0x8672('0x38')],_0xee946e['filters']));_0x5879fc['raw']=!![];if(_0x317ead[_0x8672('0x38')][_0x8672('0x42')]){_0x5879fc[_0x8672('0x41')]=_[_0x8672('0x43')](_0x5879fc['where'],{'$or':_[_0x8672('0x32')](_0x5879fc[_0x8672('0x3c')],function(_0x952d4d){var _0x400e30={};_0x400e30[_0x952d4d]={'$like':'%'+_0x317ead['query'][_0x8672('0x42')]+'%'};return _0x400e30;})});}_0x5879fc=_[_0x8672('0x43')]({},_0x5879fc,_0x317ead[_0x8672('0x45')]);return _0x15fb33['getContacts'](_0x5879fc);}})[_0x8672('0x2a')](respondWithResult(_0x2ed5ae,null))['catch'](handleError(_0x2ed5ae,null));};exports[_0x8672('0x73')]=function(_0x24ff0d,_0x1a9d60,_0x2c1b76){var _0x28d9c3;return db[_0x8672('0x46')][_0x8672('0x4f')]({'where':{'id':_0x24ff0d['params']['id']},'include':[{'model':db[_0x8672('0x6f')],'as':_0x8672('0x71')}]})[_0x8672('0x2a')](handleEntityNotFound(_0x1a9d60,null))[_0x8672('0x2a')](function(_0x54393b){if(_0x54393b){_0x28d9c3=_0x54393b;return db[_0x8672('0x64')][_0x8672('0x33')];}})['then'](function(_0x3bc700){if(_0x3bc700){var _0x45a20e={};var _0x4209d9={};_0x4209d9[_0x8672('0x37')]=_['concat'](_[_0x8672('0x39')](_0x3bc700),_[_0x8672('0x32')](_0x28d9c3[_0x8672('0x71')],function(_0xc03585){return util[_0x8672('0x72')]('cf_%d',_0xc03585['id']);}));_0x4209d9[_0x8672('0x38')]=_['keys'](_0x24ff0d['query']);_0x4209d9[_0x8672('0x3a')]=_['intersection'](_0x4209d9[_0x8672('0x37')],_0x4209d9['query']);_0x45a20e[_0x8672('0x3c')]=_[_0x8672('0x3b')](_0x4209d9[_0x8672('0x37')],qs['fields'](_0x24ff0d['query'][_0x8672('0x3d')]));_0x45a20e[_0x8672('0x3c')]=_0x45a20e[_0x8672('0x3c')][_0x8672('0x4d')]?_0x45a20e[_0x8672('0x3c')]:_0x4209d9[_0x8672('0x37')];if(!_0x24ff0d[_0x8672('0x38')][_0x8672('0x3e')](_0x8672('0x3f'))){_0x45a20e[_0x8672('0x22')]=qs[_0x8672('0x22')](_0x24ff0d[_0x8672('0x38')][_0x8672('0x22')]);_0x45a20e[_0x8672('0x20')]=qs[_0x8672('0x20')](_0x24ff0d['query'][_0x8672('0x20')]);}_0x45a20e[_0x8672('0x60')]=qs['sort'](_0x24ff0d[_0x8672('0x38')][_0x8672('0x40')]);_0x45a20e[_0x8672('0x41')]=qs[_0x8672('0x3a')](_[_0x8672('0x61')](_0x24ff0d[_0x8672('0x38')],_0x4209d9[_0x8672('0x3a')]));_0x45a20e['raw']=!![];if(_0x24ff0d['query']['filter']){_0x45a20e['where']=_[_0x8672('0x43')](_0x45a20e['where'],{'$or':_[_0x8672('0x32')](_0x45a20e[_0x8672('0x3c')],function(_0x169d83){var _0x27cf1d={};_0x27cf1d[_0x169d83]={'$like':'%'+_0x24ff0d[_0x8672('0x38')][_0x8672('0x42')]+'%'};return _0x27cf1d;})});}_0x45a20e=_[_0x8672('0x43')]({},_0x45a20e,_0x24ff0d[_0x8672('0x45')]);return _0x28d9c3[_0x8672('0x74')](_0x45a20e);}})['then'](function(_0x380130){if(!_[_0x8672('0x75')](_0x380130)){var _0x118346=toCsv(_0x380130);var _0x9559fb=Date[_0x8672('0x76')]();fs['writeFileSync'](util[_0x8672('0x72')](_0x8672('0x77'),_0x28d9c3['id'],_0x9559fb),_0x118346);_0x1a9d60['setHeader'](_0x8672('0x78'),_0x8672('0x79')+util['format']('list_%d_%s.csv',_0x28d9c3['id'],_0x9559fb));_0x1a9d60[_0x8672('0x7a')](_0x8672('0x7b'),_0x8672('0x7c'));return _0x1a9d60['download'](util[_0x8672('0x72')]('/tmp/list_%d_%s.csv',_0x28d9c3['id'],_0x9559fb));}else{return _0x1a9d60[_0x8672('0x1c')](0xcc);}})[_0x8672('0x4a')](handleError(_0x1a9d60,null));};exports[_0x8672('0x7d')]=function(_0x31819e,_0x39e6dd,_0x4b3440){var _0x1cf448;delete _0x31819e[_0x8672('0x51')]['id'];return db[_0x8672('0x46')][_0x8672('0x5f')]({'where':{'id':_0x31819e[_0x8672('0x4c')]['id']}})[_0x8672('0x2a')](handleEntityNotFound(_0x39e6dd,null))[_0x8672('0x2a')](function(_0x24d7a3){if(_0x24d7a3){return db[_0x8672('0x7e')][_0x8672('0x7f')](function(_0x476b55){return db['CmCustomField'][_0x8672('0x50')](_0x31819e[_0x8672('0x51')],{'transaction':_0x476b55})[_0x8672('0x2a')](function(_0x4b9649){_0x1cf448=_0x4b9649;return _0x24d7a3[_0x8672('0x80')](_0x4b9649,{'transaction':_0x476b55});})['then'](function(){var _0x34554b={'type':db[_0x8672('0x81')][_0x8672('0x82')],'transaction':_0x476b55};switch(_0x31819e['body'][_0x8672('0x35')]){case _0x8672('0x83'):_0x34554b[_0x8672('0x35')]=db['Sequelize'][_0x8672('0x82')];break;case'number':_0x34554b[_0x8672('0x35')]=db[_0x8672('0x81')][_0x8672('0x84')];break;case _0x8672('0x85'):_0x34554b[_0x8672('0x35')]=db[_0x8672('0x81')][_0x8672('0x86')];_0x34554b[_0x8672('0x87')]=![];break;default:}return db[_0x8672('0x7e')][_0x8672('0x88')][_0x8672('0x89')]('cm_contacts',util['format'](_0x8672('0x8a'),_0x1cf448['id']),_0x34554b);})['then'](function(){return _0x1cf448;});});}})[_0x8672('0x2a')](respondWithResult(_0x39e6dd,null))[_0x8672('0x4a')](handleError(_0x39e6dd,null));};exports['getCustomFields']=function(_0xd73a52,_0x510563,_0x3001e0){var _0x44d665={};var _0x3ecdaa={};var _0x488e7c;var _0x1861c1;return db[_0x8672('0x46')][_0x8672('0x5f')]({'where':{'id':_0xd73a52['params']['id']}})[_0x8672('0x2a')](handleEntityNotFound(_0x510563,null))[_0x8672('0x2a')](function(_0x4ca1b3){if(_0x4ca1b3){_0x488e7c=_0x4ca1b3;_0x3ecdaa[_0x8672('0x37')]=_[_0x8672('0x39')](db['CmCustomField']['rawAttributes']);_0x3ecdaa[_0x8672('0x38')]=_[_0x8672('0x39')](_0xd73a52[_0x8672('0x38')]);_0x3ecdaa['filters']=_[_0x8672('0x3b')](_0x3ecdaa[_0x8672('0x37')],_0x3ecdaa[_0x8672('0x38')]);_0x44d665[_0x8672('0x3c')]=_['intersection'](_0x3ecdaa['model'],qs[_0x8672('0x3d')](_0xd73a52[_0x8672('0x38')][_0x8672('0x3d')]));_0x44d665[_0x8672('0x3c')]=_0x44d665[_0x8672('0x3c')][_0x8672('0x4d')]?_0x44d665[_0x8672('0x3c')]:_0x3ecdaa[_0x8672('0x37')];_0x44d665[_0x8672('0x60')]=qs[_0x8672('0x40')](_0xd73a52[_0x8672('0x38')][_0x8672('0x40')]);_0x44d665['where']=qs[_0x8672('0x3a')](_[_0x8672('0x61')](_0xd73a52[_0x8672('0x38')],_0x3ecdaa[_0x8672('0x3a')]));_0x44d665[_0x8672('0x41')]=_['merge'](_0x44d665[_0x8672('0x41')],{'$or':[{'ListId':_0x4ca1b3['id']},{'ListId':null}]});if(_0xd73a52[_0x8672('0x38')][_0x8672('0x42')]){_0x44d665[_0x8672('0x41')]=_['merge'](_0x44d665[_0x8672('0x41')],{'$or':_[_0x8672('0x32')](_0x44d665[_0x8672('0x3c')],function(_0x3d8301){var _0x1af3e5={};_0x1af3e5[_0x3d8301]={'$like':'%'+_0xd73a52[_0x8672('0x38')][_0x8672('0x42')]+'%'};return _0x1af3e5;})});}_0x44d665=_['merge']({},_0x44d665,_0xd73a52[_0x8672('0x45')]);return db['CmCustomField'][_0x8672('0x8b')](_0x44d665);}})[_0x8672('0x2a')](respondWithResult(_0x510563,null))[_0x8672('0x4a')](handleError(_0x510563,null));};exports[_0x8672('0x8c')]=function(_0x565087,_0x50c777,_0x3e08bc){return db['CmList'][_0x8672('0x4f')]({'where':{'id':_0x565087['params']['id']}})[_0x8672('0x2a')](handleEntityNotFound(_0x50c777,null))[_0x8672('0x2a')](function(_0xdd92a4){if(_0xdd92a4){return _0xdd92a4[_0x8672('0x8c')](_0x565087[_0x8672('0x51')]['ids'],_[_0x8672('0x8d')](_0x565087[_0x8672('0x51')],[_0x8672('0x69'),'id'])||{})[_0x8672('0x8e')](function(_0x561845){for(var _0x5b3842=0x0;_0x5b3842<_0x565087[_0x8672('0x51')]['ids'][_0x8672('0x4d')];_0x5b3842+=0x1){socket[_0x8672('0x8f')](_0x8672('0x90'),{'UserId':Number(_0x565087[_0x8672('0x51')][_0x8672('0x69')][_0x5b3842]),'CmListId':Number(_0x565087[_0x8672('0x4c')]['id'])});}return _0x561845;});}})[_0x8672('0x2a')](respondWithResult(_0x50c777,null))['catch'](handleError(_0x50c777,null));};exports[_0x8672('0x91')]=function(_0x3a2b8a,_0x3a7cc0,_0xd894cd){return db[_0x8672('0x46')][_0x8672('0x4f')]({'where':{'id':_0x3a2b8a['params']['id']}})[_0x8672('0x2a')](handleEntityNotFound(_0x3a7cc0,null))['then'](function(_0x5985a2){if(_0x5985a2){return _0x5985a2['removeAgents'](_0x3a2b8a[_0x8672('0x38')]['ids'])[_0x8672('0x2a')](function(){if(_[_0x8672('0x65')](_0x3a2b8a[_0x8672('0x38')]['ids'])){for(var _0x6432e6=0x0;_0x6432e6<_0x3a2b8a[_0x8672('0x38')][_0x8672('0x69')]['length'];_0x6432e6+=0x1){socket[_0x8672('0x8f')](_0x8672('0x92'),{'UserId':Number(_0x3a2b8a[_0x8672('0x38')][_0x8672('0x69')][_0x6432e6]),'CmListId':Number(_0x3a2b8a[_0x8672('0x4c')]['id'])});}}else{socket[_0x8672('0x8f')](_0x8672('0x92'),{'UserId':Number(_0x3a2b8a[_0x8672('0x38')][_0x8672('0x69')]),'CmListId':Number(_0x3a2b8a[_0x8672('0x4c')]['id'])});}});}})[_0x8672('0x2a')](respondWithStatusCode(_0x3a7cc0,null))[_0x8672('0x4a')](handleError(_0x3a7cc0,null));};exports[_0x8672('0x93')]=function(_0x2d1f08,_0x424cb1,_0xecb559){var _0x2ec0b6={};var _0x552d18={};var _0x10acaa;var _0x2f27f0;return db[_0x8672('0x46')][_0x8672('0x5f')]({'where':{'id':_0x2d1f08['params']['id']}})[_0x8672('0x2a')](handleEntityNotFound(_0x424cb1,null))[_0x8672('0x2a')](function(_0x3c8375){if(_0x3c8375){_0x10acaa=_0x3c8375;_0x552d18[_0x8672('0x37')]=_[_0x8672('0x39')](db[_0x8672('0x94')]['rawAttributes']);_0x552d18[_0x8672('0x38')]=_['keys'](_0x2d1f08[_0x8672('0x38')]);_0x552d18['filters']=_[_0x8672('0x3b')](_0x552d18[_0x8672('0x37')],_0x552d18[_0x8672('0x38')]);_0x2ec0b6[_0x8672('0x3c')]=_[_0x8672('0x3b')](_0x552d18[_0x8672('0x37')],qs['fields'](_0x2d1f08['query']['fields']));_0x2ec0b6[_0x8672('0x3c')]=_0x2ec0b6[_0x8672('0x3c')][_0x8672('0x4d')]?_0x2ec0b6['attributes']:_0x552d18[_0x8672('0x37')];_0x2ec0b6['order']=qs[_0x8672('0x40')](_0x2d1f08[_0x8672('0x38')]['sort']);_0x2ec0b6[_0x8672('0x41')]=qs['filters'](_[_0x8672('0x61')](_0x2d1f08['query'],_0x552d18['filters']));if(_0x2d1f08[_0x8672('0x38')][_0x8672('0x42')]){_0x2ec0b6['where']=_[_0x8672('0x43')](_0x2ec0b6['where'],{'$or':_['map'](_0x2ec0b6[_0x8672('0x3c')],function(_0x531102){var _0x15d657={};_0x15d657[_0x531102]={'$like':'%'+_0x2d1f08[_0x8672('0x38')][_0x8672('0x42')]+'%'};return _0x15d657;})});}_0x2ec0b6=_[_0x8672('0x43')]({},_0x2ec0b6,_0x2d1f08[_0x8672('0x45')]);return _0x10acaa['getAgents'](_0x2ec0b6);}})[_0x8672('0x2a')](function(_0x1e8895){if(_0x1e8895){_0x2f27f0=_0x1e8895[_0x8672('0x4d')];if(!_0x2d1f08[_0x8672('0x38')][_0x8672('0x3e')](_0x8672('0x3f'))){_0x2ec0b6[_0x8672('0x22')]=qs['limit'](_0x2d1f08['query'][_0x8672('0x22')]);_0x2ec0b6[_0x8672('0x20')]=qs[_0x8672('0x20')](_0x2d1f08['query'][_0x8672('0x20')]);}return _0x10acaa[_0x8672('0x93')](_0x2ec0b6);}})[_0x8672('0x2a')](function(_0x358734){if(_0x358734){return _0x358734?{'count':_0x2f27f0,'rows':_0x358734}:null;}})[_0x8672('0x2a')](respondWithResult(_0x424cb1,null))['catch'](handleError(_0x424cb1,null));}; \ No newline at end of file +var _0x983d=['nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ListId','getDispositions','findOne','Disposition','rawAttributes','removeDispositions','ids','addContacts','tags','isArray','join','each','omit','success','push','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','CmContact','concat','cf_%d','getContactsCsv','format','isEmpty','writeFileSync','setHeader','Content-disposition','Content-type','text/csv','sequelize','addCustomFields','Sequelize','TEXT','text','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','error','stack','name','send','index','CmList','fieldName','type','map','keys','query','filters','model','attributes','intersection','hasOwnProperty'];(function(_0x48fa00,_0x1086d6){var _0x19e409=function(_0xe6c2e7){while(--_0xe6c2e7){_0x48fa00['push'](_0x48fa00['shift']());}};_0x19e409(++_0x1086d6);}(_0x983d,0x1d9));var _0xd983=function(_0x4d8d5e,_0xa5c78a){_0x4d8d5e=_0x4d8d5e-0x0;var _0x4aa60f=_0x983d[_0x4d8d5e];return _0x4aa60f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd983('0x0'));var zipdir=require(_0xd983('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd983('0x2'));var moment=require(_0xd983('0x3'));var BPromise=require(_0xd983('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd983('0x5'));var sox=require(_0xd983('0x6'));var csv=require(_0xd983('0x7'));var ejs=require(_0xd983('0x8'));var fs=require('fs');var fs_extra=require(_0xd983('0x9'));var _=require(_0xd983('0xa'));var squel=require(_0xd983('0xb'));var crypto=require(_0xd983('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd983('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd983('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd983('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xd983('0x10'));var config=require(_0xd983('0x11'));var licenseUtil=require(_0xd983('0x12'));var db=require(_0xd983('0x13'))['db'];config['redis']=_[_0xd983('0x14')](config[_0xd983('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xd983('0x16'))(new Redis(config[_0xd983('0x15')]));require('./cmList.socket')[_0xd983('0x17')](socket);function respondWithStatusCode(_0x11035a,_0x1699f6){_0x1699f6=_0x1699f6||0xcc;return function(_0x21dc79){if(_0x21dc79){return _0x11035a[_0xd983('0x18')](_0x1699f6);}return _0x11035a[_0xd983('0x19')](_0x1699f6)['end']();};}function respondWithResult(_0x408ed2,_0x4a613a){_0x4a613a=_0x4a613a||0xc8;return function(_0x1a8933){if(_0x1a8933){return _0x408ed2[_0xd983('0x19')](_0x4a613a)[_0xd983('0x1a')](_0x1a8933);}};}function respondWithFilteredResult(_0x590181,_0x3b99df){return function(_0x3ac3b8){if(_0x3ac3b8){var _0xa3dadf=typeof _0x3b99df[_0xd983('0x1b')]===_0xd983('0x1c')&&typeof _0x3b99df[_0xd983('0x1d')]===_0xd983('0x1c');var _0x45c027=_0x3ac3b8[_0xd983('0x1e')];var _0xd40d43=_0xa3dadf?0x0:_0x3b99df[_0xd983('0x1b')];var _0x262bf1=_0xa3dadf?_0x3ac3b8[_0xd983('0x1e')]:_0x3b99df[_0xd983('0x1b')]+_0x3b99df[_0xd983('0x1d')];var _0x21f69e;if(_0x262bf1>=_0x45c027){_0x262bf1=_0x45c027;_0x21f69e=0xc8;}else{_0x21f69e=0xce;}_0x590181[_0xd983('0x19')](_0x21f69e);return _0x590181[_0xd983('0x1f')](_0xd983('0x20'),_0xd40d43+'-'+_0x262bf1+'/'+_0x45c027)[_0xd983('0x1a')](_0x3ac3b8);}return null;};}function patchUpdates(_0x3069eb){return function(_0x74e2cd){try{jsonpatch[_0xd983('0x21')](_0x74e2cd,_0x3069eb,!![]);}catch(_0x405dbd){return BPromise['reject'](_0x405dbd);}return _0x74e2cd[_0xd983('0x22')]();};}function saveUpdates(_0x20e4d2,_0x2b4a96){return function(_0x281984){if(_0x281984){return _0x281984[_0xd983('0x23')](_0x20e4d2)[_0xd983('0x24')](function(_0xd5faf4){return _0xd5faf4;});}return null;};}function removeEntity(_0x126e19,_0x105188){return function(_0x4b1044){if(_0x4b1044){return _0x4b1044[_0xd983('0x25')]()[_0xd983('0x24')](function(){var _0x3613e0=_0x4b1044[_0xd983('0x26')]({'plain':!![]});var _0x3f6c6e='Lists';return db['UserProfileResource'][_0xd983('0x25')]({'where':{'type':_0x3f6c6e,'resourceId':_0x3613e0['id']}})[_0xd983('0x24')](function(){return _0x4b1044;});})['then'](function(){_0x126e19[_0xd983('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fe23a,_0x1c2ff6){return function(_0x128127){if(!_0x128127){_0x2fe23a[_0xd983('0x18')](0x194);}return _0x128127;};}function handleError(_0x7bcc96,_0x3ae08a){_0x3ae08a=_0x3ae08a||0x1f4;return function(_0x1a518c){logger[_0xd983('0x27')](_0x1a518c[_0xd983('0x28')]);if(_0x1a518c[_0xd983('0x29')]){delete _0x1a518c['name'];}_0x7bcc96[_0xd983('0x19')](_0x3ae08a)[_0xd983('0x2a')](_0x1a518c);};}exports[_0xd983('0x2b')]=function(_0x9337fa,_0x36607a){var _0x115d41={},_0xfd58ae={},_0x1cc5d9={'count':0x0,'rows':[]};var _0x173f3b=_['map'](db[_0xd983('0x2c')]['rawAttributes'],function(_0x2261e5){return{'name':_0x2261e5[_0xd983('0x2d')],'type':_0x2261e5[_0xd983('0x2e')]['key']};});_0xfd58ae['model']=_[_0xd983('0x2f')](_0x173f3b,'name');_0xfd58ae['query']=_[_0xd983('0x30')](_0x9337fa[_0xd983('0x31')]);_0xfd58ae[_0xd983('0x32')]=_['intersection'](_0xfd58ae[_0xd983('0x33')],_0xfd58ae[_0xd983('0x31')]);_0x115d41[_0xd983('0x34')]=_[_0xd983('0x35')](_0xfd58ae[_0xd983('0x33')],qs['fields'](_0x9337fa[_0xd983('0x31')]['fields']));_0x115d41[_0xd983('0x34')]=_0x115d41[_0xd983('0x34')]['length']?_0x115d41[_0xd983('0x34')]:_0xfd58ae['model'];if(!_0x9337fa[_0xd983('0x31')][_0xd983('0x36')](_0xd983('0x37'))){_0x115d41[_0xd983('0x1d')]=qs[_0xd983('0x1d')](_0x9337fa[_0xd983('0x31')][_0xd983('0x1d')]);_0x115d41[_0xd983('0x1b')]=qs['offset'](_0x9337fa['query']['offset']);}_0x115d41[_0xd983('0x38')]=qs[_0xd983('0x39')](_0x9337fa[_0xd983('0x31')][_0xd983('0x39')]);_0x115d41['where']=qs[_0xd983('0x32')](_[_0xd983('0x3a')](_0x9337fa[_0xd983('0x31')],_0xfd58ae[_0xd983('0x32')]),_0x173f3b);if(_0x9337fa['query'][_0xd983('0x3b')]){_0x115d41[_0xd983('0x3c')]=_[_0xd983('0x3d')](_0x115d41[_0xd983('0x3c')],{'$or':_['map'](_0x173f3b,function(_0x4818eb){if(_0x4818eb[_0xd983('0x2e')]!==_0xd983('0x3e')){var _0x72dc62={};_0x72dc62[_0x4818eb[_0xd983('0x29')]]={'$like':'%'+_0x9337fa[_0xd983('0x31')][_0xd983('0x3b')]+'%'};return _0x72dc62;}})});}_0x115d41=_[_0xd983('0x3d')]({},_0x115d41,_0x9337fa[_0xd983('0x3f')]);var _0x70e832={'where':_0x115d41[_0xd983('0x3c')]};return db['CmList']['count'](_0x70e832)[_0xd983('0x24')](function(_0x421953){_0x1cc5d9['count']=_0x421953;if(_0x9337fa[_0xd983('0x31')][_0xd983('0x40')]){_0x115d41[_0xd983('0x41')]=[{'all':!![]}];}return db[_0xd983('0x2c')][_0xd983('0x42')](_0x115d41);})[_0xd983('0x24')](function(_0x4f5755){_0x1cc5d9[_0xd983('0x43')]=_0x4f5755;return _0x1cc5d9;})['then'](respondWithFilteredResult(_0x36607a,_0x115d41))[_0xd983('0x44')](handleError(_0x36607a,null));};exports[_0xd983('0x45')]=function(_0x52cc54,_0x48cd41){var _0x5c3753={'raw':![],'where':{'id':_0x52cc54[_0xd983('0x46')]['id']}},_0x230c71={};_0x230c71[_0xd983('0x33')]=_['keys'](db[_0xd983('0x2c')]['rawAttributes']);_0x230c71[_0xd983('0x31')]=_[_0xd983('0x30')](_0x52cc54[_0xd983('0x31')]);_0x230c71[_0xd983('0x32')]=_[_0xd983('0x35')](_0x230c71[_0xd983('0x33')],_0x230c71['query']);_0x5c3753[_0xd983('0x34')]=_[_0xd983('0x35')](_0x230c71[_0xd983('0x33')],qs['fields'](_0x52cc54['query'][_0xd983('0x47')]));_0x5c3753['attributes']=_0x5c3753[_0xd983('0x34')][_0xd983('0x48')]?_0x5c3753[_0xd983('0x34')]:_0x230c71[_0xd983('0x33')];if(_0x52cc54[_0xd983('0x31')][_0xd983('0x40')]){_0x5c3753['include']=[{'all':!![]}];}_0x5c3753=_[_0xd983('0x3d')]({},_0x5c3753,_0x52cc54[_0xd983('0x3f')]);return db[_0xd983('0x2c')][_0xd983('0x49')](_0x5c3753)['then'](handleEntityNotFound(_0x48cd41,null))['then'](respondWithResult(_0x48cd41,null))[_0xd983('0x44')](handleError(_0x48cd41,null));};exports['create']=function(_0x207645,_0x3764de){return db['CmList'][_0xd983('0x4a')](_0x207645[_0xd983('0x4b')],{})[_0xd983('0x24')](function(_0xee20e){var _0x1060c5=_0x207645[_0xd983('0x4c')][_0xd983('0x26')]({'plain':!![]});if(!_0x1060c5)throw new Error(_0xd983('0x4d'));if(_0x1060c5[_0xd983('0x4e')]==='user'){var _0x35ba3d=_0xee20e[_0xd983('0x26')]({'plain':!![]});var _0x4d32ea='Lists';return db['UserProfileSection'][_0xd983('0x49')]({'where':{'name':_0x4d32ea,'userProfileId':_0x1060c5['userProfileId']},'raw':!![]})['then'](function(_0x1d499d){if(_0x1d499d&&_0x1d499d[_0xd983('0x4f')]===0x0){return db['UserProfileResource'][_0xd983('0x4a')]({'name':_0x35ba3d[_0xd983('0x29')],'resourceId':_0x35ba3d['id'],'type':_0x1d499d[_0xd983('0x29')],'sectionId':_0x1d499d['id']},{})[_0xd983('0x24')](function(){return _0xee20e;});}else{return _0xee20e;}})[_0xd983('0x44')](function(_0x1cac9f){logger['error'](_0xd983('0x50'),_0x1cac9f);throw _0x1cac9f;});}return _0xee20e;})[_0xd983('0x24')](respondWithResult(_0x3764de,0xc9))[_0xd983('0x44')](handleError(_0x3764de,null));};exports[_0xd983('0x23')]=function(_0x48dc9e,_0x47683c){if(_0x48dc9e[_0xd983('0x4b')]['id']){delete _0x48dc9e['body']['id'];}return db[_0xd983('0x2c')][_0xd983('0x49')]({'where':{'id':_0x48dc9e['params']['id']}})[_0xd983('0x24')](handleEntityNotFound(_0x47683c,null))[_0xd983('0x24')](saveUpdates(_0x48dc9e[_0xd983('0x4b')],null))[_0xd983('0x24')](respondWithResult(_0x47683c,null))[_0xd983('0x44')](handleError(_0x47683c,null));};exports[_0xd983('0x25')]=function(_0x4d3eef,_0x12fe7b){return db['CmList'][_0xd983('0x49')]({'where':{'id':_0x4d3eef['params']['id']}})[_0xd983('0x24')](handleEntityNotFound(_0x12fe7b,null))['then'](removeEntity(_0x12fe7b,null))[_0xd983('0x44')](handleError(_0x12fe7b,null));};exports['describe']=function(_0x44424b,_0x2ce077){return db[_0xd983('0x2c')][_0xd983('0x51')]()[_0xd983('0x24')](respondWithResult(_0x2ce077,null))[_0xd983('0x44')](handleError(_0x2ce077,null));};exports['addDisposition']=function(_0xa15887,_0xc4438a,_0x22152c){if(_0xa15887[_0xd983('0x4b')]['id']){delete _0xa15887[_0xd983('0x4b')]['id'];}return db[_0xd983('0x2c')][_0xd983('0x49')]({'where':{'id':_0xa15887[_0xd983('0x46')]['id']}})['then'](handleEntityNotFound(_0xc4438a,null))[_0xd983('0x24')](function(_0x1092ea){if(_0x1092ea){_0xa15887[_0xd983('0x4b')][_0xd983('0x52')]=_0x1092ea['id'];return db['Disposition'][_0xd983('0x4a')](_0xa15887['body']);}})['then'](respondWithResult(_0xc4438a,null))[_0xd983('0x44')](handleError(_0xc4438a,null));};exports[_0xd983('0x53')]=function(_0x45a1ad,_0x3c4f2d,_0x2fa8de){var _0x4fbef6={'raw':![],'where':{}};var _0x40817f={};var _0x567913={'count':0x0,'rows':[]};return db[_0xd983('0x2c')][_0xd983('0x54')]({'where':{'id':_0x45a1ad[_0xd983('0x46')]['id']}})['then'](handleEntityNotFound(_0x3c4f2d,null))[_0xd983('0x24')](function(_0x417310){if(_0x417310){_0x40817f[_0xd983('0x33')]=_[_0xd983('0x30')](db[_0xd983('0x55')][_0xd983('0x56')]);_0x40817f['query']=_[_0xd983('0x30')](_0x45a1ad[_0xd983('0x31')]);_0x40817f[_0xd983('0x32')]=_[_0xd983('0x35')](_0x40817f['model'],_0x40817f[_0xd983('0x31')]);_0x4fbef6[_0xd983('0x34')]=_[_0xd983('0x35')](_0x40817f[_0xd983('0x33')],qs[_0xd983('0x47')](_0x45a1ad[_0xd983('0x31')][_0xd983('0x47')]));_0x4fbef6[_0xd983('0x34')]=_0x4fbef6['attributes'][_0xd983('0x48')]?_0x4fbef6[_0xd983('0x34')]:_0x40817f[_0xd983('0x33')];if(!_0x45a1ad[_0xd983('0x31')][_0xd983('0x36')](_0xd983('0x37'))){_0x4fbef6[_0xd983('0x1d')]=qs[_0xd983('0x1d')](_0x45a1ad[_0xd983('0x31')][_0xd983('0x1d')]);_0x4fbef6[_0xd983('0x1b')]=qs[_0xd983('0x1b')](_0x45a1ad['query']['offset']);}_0x4fbef6[_0xd983('0x38')]=qs[_0xd983('0x39')](_0x45a1ad[_0xd983('0x31')][_0xd983('0x39')]);_0x4fbef6[_0xd983('0x3c')]=qs[_0xd983('0x32')](_[_0xd983('0x3a')](_0x45a1ad[_0xd983('0x31')],_0x40817f[_0xd983('0x32')]));_0x4fbef6[_0xd983('0x3c')]['ListId']=_0x417310['id'];if(_0x45a1ad[_0xd983('0x31')][_0xd983('0x3b')]){_0x4fbef6[_0xd983('0x3c')]=_['merge'](_0x4fbef6[_0xd983('0x3c')],{'$or':_[_0xd983('0x2f')](_0x4fbef6[_0xd983('0x34')],function(_0x27bc23){var _0x5d94bb={};_0x5d94bb[_0x27bc23]={'$like':'%'+_0x45a1ad['query'][_0xd983('0x3b')]+'%'};return _0x5d94bb;})});}_0x4fbef6=_[_0xd983('0x3d')]({},_0x4fbef6,_0x45a1ad[_0xd983('0x3f')]);return db['Disposition'][_0xd983('0x1e')]({'where':_0x4fbef6['where']})[_0xd983('0x24')](function(_0x273da3){_0x567913[_0xd983('0x1e')]=_0x273da3;if(_0x45a1ad[_0xd983('0x31')][_0xd983('0x40')]){_0x4fbef6['include']=[{'all':!![]}];}return db[_0xd983('0x55')][_0xd983('0x42')](_0x4fbef6);})[_0xd983('0x24')](function(_0x37b366){_0x567913['rows']=_0x37b366;return _0x567913;});}})[_0xd983('0x24')](respondWithFilteredResult(_0x3c4f2d,_0x4fbef6))[_0xd983('0x44')](handleError(_0x3c4f2d,null));};exports[_0xd983('0x57')]=function(_0x3890c2,_0xfbf5f7,_0x26769e){return db[_0xd983('0x2c')][_0xd983('0x49')]({'where':{'id':_0x3890c2[_0xd983('0x46')]['id']}})[_0xd983('0x24')](handleEntityNotFound(_0xfbf5f7,null))[_0xd983('0x24')](function(_0x2bc1bc){if(_0x2bc1bc){return _0x2bc1bc[_0xd983('0x57')](_0x3890c2['query'][_0xd983('0x58')]);}})['then'](respondWithStatusCode(_0xfbf5f7,null))[_0xd983('0x44')](handleError(_0xfbf5f7,null));};exports[_0xd983('0x59')]=function(_0x22c994,_0xefe3ce,_0xa0009c){return db[_0xd983('0x2c')][_0xd983('0x49')]({'where':{'id':_0x22c994[_0xd983('0x46')]['id']}})[_0xd983('0x24')](handleEntityNotFound(_0xefe3ce,null))[_0xd983('0x24')](function(_0x1c77fb){if(_0x1c77fb){var _0x57857c=[];var _0x461a5a={'success':[],'errors':[]};return db['CmContact']['describe']()[_0xd983('0x24')](function(_0x126153){if(_0x22c994['body'][_0xd983('0x5a')]&&_[_0xd983('0x5b')](_0x22c994['body'][_0xd983('0x5a')])){if(_0x22c994['body']['tags'][_0xd983('0x48')]){_0x22c994[_0xd983('0x4b')][_0xd983('0x5a')]=_0x22c994[_0xd983('0x4b')]['tags'][_0xd983('0x5c')](';')+';';}else{_0x22c994[_0xd983('0x4b')][_0xd983('0x5a')]=null;}}else{_0x22c994[_0xd983('0x4b')][_0xd983('0x5a')]=null;}if(_0x22c994[_0xd983('0x4b')]&&_[_0xd983('0x5b')](_0x22c994[_0xd983('0x4b')])){for(var _0x4480b0=0x0;_0x4480b0<_0x22c994[_0xd983('0x4b')][_0xd983('0x48')];_0x4480b0+=0x1){_0x22c994[_0xd983('0x4b')][_0x4480b0][_0xd983('0x52')]=_0x22c994[_0xd983('0x46')]['id'];_0x57857c['push'](_0x22c994[_0xd983('0x4b')][_0x4480b0]);}return BPromise[_0xd983('0x5d')](_0x57857c,function(_0x4b517d){return db['CmContact'][_0xd983('0x4a')](_[_0xd983('0x5e')](_0x4b517d,[_0xd983('0x58'),'id'])||{},{'fields':_[_0xd983('0x30')](_0x126153),'raw':!![]})[_0xd983('0x24')](function(_0x415994){_0x461a5a[_0xd983('0x5f')][_0xd983('0x60')](_0x415994['dataValues']);})['catch'](function(_0x206f7b){_0x461a5a['errors']['push']({'data':_0x4b517d,'error':_0x206f7b[_0xd983('0x61')]});});})[_0xd983('0x24')](function(_0x41fe3b){return _0x461a5a;})[_0xd983('0x44')](function(_0x213271){return _0x213271;});}else{_0xefe3ce['status'](0x190)[_0xd983('0x1a')]({'message':_0xd983('0x62')});}});}})[_0xd983('0x24')](respondWithResult(_0xefe3ce,null))[_0xd983('0x44')](handleError(_0xefe3ce,null));};exports[_0xd983('0x63')]=function(_0x262087,_0x517fc7,_0x18bd1c){var _0x65e2e2;return db[_0xd983('0x2c')][_0xd983('0x49')]({'where':{'id':_0x262087[_0xd983('0x46')]['id']},'include':[{'model':db[_0xd983('0x64')],'as':_0xd983('0x65')}]})['then'](handleEntityNotFound(_0x517fc7,null))[_0xd983('0x24')](function(_0x5f494f){if(_0x5f494f){_0x65e2e2=_0x5f494f;return db[_0xd983('0x66')]['rawAttributes'];}})[_0xd983('0x24')](function(_0x42ad65){if(_0x42ad65){var _0x574925={};var _0x4f4821={};_0x4f4821[_0xd983('0x33')]=_[_0xd983('0x67')](_[_0xd983('0x30')](_0x42ad65),_['map'](_0x65e2e2[_0xd983('0x65')],function(_0x4e2616){return util['format'](_0xd983('0x68'),_0x4e2616['id']);}));_0x4f4821[_0xd983('0x31')]=_['keys'](_0x262087['query']);_0x4f4821['filters']=_[_0xd983('0x35')](_0x4f4821[_0xd983('0x33')],_0x4f4821[_0xd983('0x31')]);_0x574925[_0xd983('0x34')]=_[_0xd983('0x35')](_0x4f4821[_0xd983('0x33')],qs[_0xd983('0x47')](_0x262087[_0xd983('0x31')][_0xd983('0x47')]));_0x574925['attributes']=_0x574925['attributes'][_0xd983('0x48')]?_0x574925[_0xd983('0x34')]:_0x4f4821['model'];if(!_0x262087[_0xd983('0x31')][_0xd983('0x36')](_0xd983('0x37'))){_0x574925[_0xd983('0x1d')]=qs[_0xd983('0x1d')](_0x262087[_0xd983('0x31')][_0xd983('0x1d')]);_0x574925[_0xd983('0x1b')]=qs['offset'](_0x262087[_0xd983('0x31')][_0xd983('0x1b')]);}_0x574925[_0xd983('0x38')]=qs[_0xd983('0x39')](_0x262087[_0xd983('0x31')][_0xd983('0x39')]);_0x574925[_0xd983('0x3c')]=qs[_0xd983('0x32')](_[_0xd983('0x3a')](_0x262087[_0xd983('0x31')],_0x4f4821[_0xd983('0x32')]));_0x574925['raw']=!![];if(_0x262087[_0xd983('0x31')][_0xd983('0x3b')]){_0x574925[_0xd983('0x3c')]=_['merge'](_0x574925[_0xd983('0x3c')],{'$or':_[_0xd983('0x2f')](_0x574925[_0xd983('0x34')],function(_0x59cc04){var _0x5a7fb6={};_0x5a7fb6[_0x59cc04]={'$like':'%'+_0x262087[_0xd983('0x31')]['filter']+'%'};return _0x5a7fb6;})});}_0x574925=_[_0xd983('0x3d')]({},_0x574925,_0x262087['options']);return _0x65e2e2[_0xd983('0x63')](_0x574925);}})[_0xd983('0x24')](respondWithResult(_0x517fc7,null))[_0xd983('0x44')](handleError(_0x517fc7,null));};exports[_0xd983('0x69')]=function(_0x3e0462,_0x2d6eea,_0x38fc25){var _0x27ca23;return db[_0xd983('0x2c')][_0xd983('0x49')]({'where':{'id':_0x3e0462[_0xd983('0x46')]['id']},'include':[{'model':db[_0xd983('0x64')],'as':_0xd983('0x65')}]})[_0xd983('0x24')](handleEntityNotFound(_0x2d6eea,null))[_0xd983('0x24')](function(_0x819360){if(_0x819360){_0x27ca23=_0x819360;return db[_0xd983('0x66')][_0xd983('0x56')];}})['then'](function(_0x105693){if(_0x105693){var _0xda77c9={};var _0xb8eaa={};_0xb8eaa[_0xd983('0x33')]=_['concat'](_[_0xd983('0x30')](_0x105693),_[_0xd983('0x2f')](_0x27ca23[_0xd983('0x65')],function(_0x2334ea){return util[_0xd983('0x6a')](_0xd983('0x68'),_0x2334ea['id']);}));_0xb8eaa['query']=_[_0xd983('0x30')](_0x3e0462[_0xd983('0x31')]);_0xb8eaa[_0xd983('0x32')]=_[_0xd983('0x35')](_0xb8eaa[_0xd983('0x33')],_0xb8eaa[_0xd983('0x31')]);_0xda77c9['attributes']=_['intersection'](_0xb8eaa[_0xd983('0x33')],qs[_0xd983('0x47')](_0x3e0462[_0xd983('0x31')][_0xd983('0x47')]));_0xda77c9['attributes']=_0xda77c9[_0xd983('0x34')]['length']?_0xda77c9['attributes']:_0xb8eaa['model'];if(!_0x3e0462[_0xd983('0x31')][_0xd983('0x36')](_0xd983('0x37'))){_0xda77c9['limit']=qs[_0xd983('0x1d')](_0x3e0462[_0xd983('0x31')]['limit']);_0xda77c9[_0xd983('0x1b')]=qs[_0xd983('0x1b')](_0x3e0462[_0xd983('0x31')]['offset']);}_0xda77c9[_0xd983('0x38')]=qs['sort'](_0x3e0462['query'][_0xd983('0x39')]);_0xda77c9[_0xd983('0x3c')]=qs[_0xd983('0x32')](_[_0xd983('0x3a')](_0x3e0462[_0xd983('0x31')],_0xb8eaa[_0xd983('0x32')]));_0xda77c9['raw']=!![];if(_0x3e0462[_0xd983('0x31')]['filter']){_0xda77c9[_0xd983('0x3c')]=_['merge'](_0xda77c9[_0xd983('0x3c')],{'$or':_['map'](_0xda77c9[_0xd983('0x34')],function(_0x67d73f){var _0x7d5b2a={};_0x7d5b2a[_0x67d73f]={'$like':'%'+_0x3e0462[_0xd983('0x31')][_0xd983('0x3b')]+'%'};return _0x7d5b2a;})});}_0xda77c9=_['merge']({},_0xda77c9,_0x3e0462[_0xd983('0x3f')]);return _0x27ca23['getContacts'](_0xda77c9);}})['then'](function(_0x4dfc51){if(!_[_0xd983('0x6b')](_0x4dfc51)){var _0x4feb64=toCsv(_0x4dfc51);var _0x38d3dc=Date['now']();fs[_0xd983('0x6c')](util[_0xd983('0x6a')]('/tmp/list_%d_%s.csv',_0x27ca23['id'],_0x38d3dc),_0x4feb64);_0x2d6eea[_0xd983('0x6d')](_0xd983('0x6e'),'attachment;\x20filename='+util[_0xd983('0x6a')]('list_%d_%s.csv',_0x27ca23['id'],_0x38d3dc));_0x2d6eea[_0xd983('0x6d')](_0xd983('0x6f'),_0xd983('0x70'));return _0x2d6eea['download'](util[_0xd983('0x6a')]('/tmp/list_%d_%s.csv',_0x27ca23['id'],_0x38d3dc));}else{return _0x2d6eea['sendStatus'](0xcc);}})['catch'](handleError(_0x2d6eea,null));};exports['addCustomField']=function(_0x7435aa,_0x48fa29,_0x3d4ecf){var _0x5ee624;delete _0x7435aa[_0xd983('0x4b')]['id'];return db[_0xd983('0x2c')]['findOne']({'where':{'id':_0x7435aa[_0xd983('0x46')]['id']}})[_0xd983('0x24')](handleEntityNotFound(_0x48fa29,null))['then'](function(_0x304a47){if(_0x304a47){return db[_0xd983('0x71')]['transaction'](function(_0x12d07f){return db[_0xd983('0x64')][_0xd983('0x4a')](_0x7435aa[_0xd983('0x4b')],{'transaction':_0x12d07f})[_0xd983('0x24')](function(_0x12cd4e){_0x5ee624=_0x12cd4e;return _0x304a47[_0xd983('0x72')](_0x12cd4e,{'transaction':_0x12d07f});})[_0xd983('0x24')](function(){var _0x40dc65={'type':db[_0xd983('0x73')][_0xd983('0x74')],'transaction':_0x12d07f};switch(_0x7435aa[_0xd983('0x4b')]['type']){case _0xd983('0x75'):_0x40dc65[_0xd983('0x2e')]=db[_0xd983('0x73')][_0xd983('0x74')];break;case'number':_0x40dc65[_0xd983('0x2e')]=db[_0xd983('0x73')][_0xd983('0x76')];break;case'switch':_0x40dc65['type']=db[_0xd983('0x73')][_0xd983('0x77')];_0x40dc65[_0xd983('0x78')]=![];break;default:}return db['sequelize'][_0xd983('0x79')][_0xd983('0x7a')]('cm_contacts',util['format']('cf_%s',_0x5ee624['id']),_0x40dc65);})[_0xd983('0x24')](function(){return _0x5ee624;});});}})[_0xd983('0x24')](respondWithResult(_0x48fa29,null))[_0xd983('0x44')](handleError(_0x48fa29,null));};exports['getCustomFields']=function(_0x41cb1b,_0x9c2b20,_0x5b3dbe){var _0x98fef7={};var _0x3527ce={};var _0x34b5eb;var _0x37aac2;return db[_0xd983('0x2c')][_0xd983('0x54')]({'where':{'id':_0x41cb1b['params']['id']}})[_0xd983('0x24')](handleEntityNotFound(_0x9c2b20,null))['then'](function(_0x3789f0){if(_0x3789f0){_0x34b5eb=_0x3789f0;_0x3527ce[_0xd983('0x33')]=_[_0xd983('0x30')](db[_0xd983('0x64')][_0xd983('0x56')]);_0x3527ce[_0xd983('0x31')]=_['keys'](_0x41cb1b[_0xd983('0x31')]);_0x3527ce[_0xd983('0x32')]=_[_0xd983('0x35')](_0x3527ce[_0xd983('0x33')],_0x3527ce[_0xd983('0x31')]);_0x98fef7['attributes']=_[_0xd983('0x35')](_0x3527ce['model'],qs[_0xd983('0x47')](_0x41cb1b['query'][_0xd983('0x47')]));_0x98fef7[_0xd983('0x34')]=_0x98fef7['attributes']['length']?_0x98fef7[_0xd983('0x34')]:_0x3527ce[_0xd983('0x33')];_0x98fef7[_0xd983('0x38')]=qs[_0xd983('0x39')](_0x41cb1b[_0xd983('0x31')]['sort']);_0x98fef7[_0xd983('0x3c')]=qs[_0xd983('0x32')](_['pick'](_0x41cb1b[_0xd983('0x31')],_0x3527ce['filters']));_0x98fef7[_0xd983('0x3c')]=_['merge'](_0x98fef7[_0xd983('0x3c')],{'$or':[{'ListId':_0x3789f0['id']},{'ListId':null}]});if(_0x41cb1b['query'][_0xd983('0x3b')]){_0x98fef7['where']=_[_0xd983('0x3d')](_0x98fef7[_0xd983('0x3c')],{'$or':_[_0xd983('0x2f')](_0x98fef7[_0xd983('0x34')],function(_0x5f2d3a){var _0x16d1ee={};_0x16d1ee[_0x5f2d3a]={'$like':'%'+_0x41cb1b['query']['filter']+'%'};return _0x16d1ee;})});}_0x98fef7=_[_0xd983('0x3d')]({},_0x98fef7,_0x41cb1b[_0xd983('0x3f')]);return db['CmCustomField'][_0xd983('0x7b')](_0x98fef7);}})['then'](respondWithResult(_0x9c2b20,null))[_0xd983('0x44')](handleError(_0x9c2b20,null));};exports[_0xd983('0x7c')]=function(_0x36a3b6,_0x47d752,_0x15ecfa){return db[_0xd983('0x2c')][_0xd983('0x49')]({'where':{'id':_0x36a3b6[_0xd983('0x46')]['id']}})[_0xd983('0x24')](handleEntityNotFound(_0x47d752,null))[_0xd983('0x24')](function(_0x40de4c){if(_0x40de4c){return _0x40de4c['addAgents'](_0x36a3b6[_0xd983('0x4b')][_0xd983('0x58')],_['omit'](_0x36a3b6[_0xd983('0x4b')],[_0xd983('0x58'),'id'])||{})[_0xd983('0x7d')](function(_0x1e4b4e){for(var _0x47a107=0x0;_0x47a107<_0x36a3b6[_0xd983('0x4b')]['ids'][_0xd983('0x48')];_0x47a107+=0x1){socket[_0xd983('0x7e')](_0xd983('0x7f'),{'UserId':Number(_0x36a3b6[_0xd983('0x4b')][_0xd983('0x58')][_0x47a107]),'CmListId':Number(_0x36a3b6[_0xd983('0x46')]['id'])});}return _0x1e4b4e;});}})[_0xd983('0x24')](respondWithResult(_0x47d752,null))[_0xd983('0x44')](handleError(_0x47d752,null));};exports[_0xd983('0x80')]=function(_0x2bdfa9,_0x25b2d5,_0xe5ce5){return db['CmList'][_0xd983('0x49')]({'where':{'id':_0x2bdfa9[_0xd983('0x46')]['id']}})['then'](handleEntityNotFound(_0x25b2d5,null))[_0xd983('0x24')](function(_0x4f91a5){if(_0x4f91a5){return _0x4f91a5[_0xd983('0x80')](_0x2bdfa9[_0xd983('0x31')][_0xd983('0x58')])[_0xd983('0x24')](function(){if(_[_0xd983('0x5b')](_0x2bdfa9[_0xd983('0x31')][_0xd983('0x58')])){for(var _0x4c9120=0x0;_0x4c9120<_0x2bdfa9[_0xd983('0x31')][_0xd983('0x58')][_0xd983('0x48')];_0x4c9120+=0x1){socket['emit']('userCmList:remove',{'UserId':Number(_0x2bdfa9['query'][_0xd983('0x58')][_0x4c9120]),'CmListId':Number(_0x2bdfa9[_0xd983('0x46')]['id'])});}}else{socket[_0xd983('0x7e')](_0xd983('0x81'),{'UserId':Number(_0x2bdfa9[_0xd983('0x31')][_0xd983('0x58')]),'CmListId':Number(_0x2bdfa9[_0xd983('0x46')]['id'])});}});}})[_0xd983('0x24')](respondWithStatusCode(_0x25b2d5,null))[_0xd983('0x44')](handleError(_0x25b2d5,null));};exports[_0xd983('0x82')]=function(_0x3cff08,_0x40ae59,_0x1aae72){var _0x2a5827={};var _0x5a7367={};var _0x55f4d6;var _0x5bf59f;return db['CmList']['findOne']({'where':{'id':_0x3cff08['params']['id']}})[_0xd983('0x24')](handleEntityNotFound(_0x40ae59,null))['then'](function(_0x5a84e8){if(_0x5a84e8){_0x55f4d6=_0x5a84e8;_0x5a7367[_0xd983('0x33')]=_['keys'](db[_0xd983('0x83')]['rawAttributes']);_0x5a7367[_0xd983('0x31')]=_[_0xd983('0x30')](_0x3cff08[_0xd983('0x31')]);_0x5a7367[_0xd983('0x32')]=_[_0xd983('0x35')](_0x5a7367['model'],_0x5a7367['query']);_0x2a5827[_0xd983('0x34')]=_[_0xd983('0x35')](_0x5a7367[_0xd983('0x33')],qs[_0xd983('0x47')](_0x3cff08[_0xd983('0x31')][_0xd983('0x47')]));_0x2a5827[_0xd983('0x34')]=_0x2a5827['attributes'][_0xd983('0x48')]?_0x2a5827[_0xd983('0x34')]:_0x5a7367['model'];_0x2a5827[_0xd983('0x38')]=qs['sort'](_0x3cff08[_0xd983('0x31')][_0xd983('0x39')]);_0x2a5827[_0xd983('0x3c')]=qs[_0xd983('0x32')](_[_0xd983('0x3a')](_0x3cff08[_0xd983('0x31')],_0x5a7367[_0xd983('0x32')]));if(_0x3cff08['query']['filter']){_0x2a5827['where']=_[_0xd983('0x3d')](_0x2a5827[_0xd983('0x3c')],{'$or':_[_0xd983('0x2f')](_0x2a5827[_0xd983('0x34')],function(_0xe41713){var _0x2a7791={};_0x2a7791[_0xe41713]={'$like':'%'+_0x3cff08[_0xd983('0x31')][_0xd983('0x3b')]+'%'};return _0x2a7791;})});}_0x2a5827=_[_0xd983('0x3d')]({},_0x2a5827,_0x3cff08[_0xd983('0x3f')]);return _0x55f4d6['getAgents'](_0x2a5827);}})[_0xd983('0x24')](function(_0x29f94a){if(_0x29f94a){_0x5bf59f=_0x29f94a[_0xd983('0x48')];if(!_0x3cff08[_0xd983('0x31')][_0xd983('0x36')]('nolimit')){_0x2a5827[_0xd983('0x1d')]=qs[_0xd983('0x1d')](_0x3cff08[_0xd983('0x31')][_0xd983('0x1d')]);_0x2a5827[_0xd983('0x1b')]=qs[_0xd983('0x1b')](_0x3cff08[_0xd983('0x31')][_0xd983('0x1b')]);}return _0x55f4d6[_0xd983('0x82')](_0x2a5827);}})[_0xd983('0x24')](function(_0x330d2d){if(_0x330d2d){return _0x330d2d?{'count':_0x5bf59f,'rows':_0x330d2d}:null;}})[_0xd983('0x24')](respondWithResult(_0x40ae59,null))[_0xd983('0x44')](handleError(_0x40ae59,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index f289101..1ec1bc0 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x41ee16,_0xfa94c3){var _0x1f60de=function(_0x1c8ffc){while(--_0x1c8ffc){_0x41ee16['push'](_0x41ee16['shift']());}};_0x1f60de(++_0xfa94c3);}(_0x55ca,0x126));var _0xa55c=function(_0x4e8286,_0x4eaeb4){_0x4e8286=_0x4e8286-0x0;var _0x44a440=_0x55ca[_0x4e8286];return _0x44a440;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xe14b,0x93));var _0xbe14=function(_0x4f5185,_0x3f5e83){_0x4f5185=_0x4f5185-0x0;var _0x4f70d8=_0xe14b[_0x4f5185];return _0x4f70d8;};'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 cb4ce14..f95dfe0 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 _0x9c44=['request-promise','path','./cmList.attributes','define','CmList','cm_lists','../../config/logger','api','moment','bluebird'];(function(_0x56efc9,_0x281d8b){var _0x5f1125=function(_0x14d95a){while(--_0x14d95a){_0x56efc9['push'](_0x56efc9['shift']());}};_0x5f1125(++_0x281d8b);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6324=['define','cm_lists','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','exports'];(function(_0x5dc3c2,_0x36dc20){var _0x1130a4=function(_0x5143ab){while(--_0x5143ab){_0x5dc3c2['push'](_0x5dc3c2['shift']());}};_0x1130a4(++_0x36dc20);}(_0x6324,0x142));var _0x4632=function(_0x35a9a7,_0x5e8c7f){_0x35a9a7=_0x35a9a7-0x0;var _0x142c13=_0x6324[_0x35a9a7];return _0x142c13;};'use strict';var _=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var logger=require(_0x4632('0x2'))(_0x4632('0x3'));var moment=require('moment');var BPromise=require(_0x4632('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4632('0x5'));var rimraf=require('rimraf');var config=require(_0x4632('0x6'));var attributes=require('./cmList.attributes');module[_0x4632('0x7')]=function(_0x24aba6,_0x1f3077){return _0x24aba6[_0x4632('0x8')]('CmList',attributes,{'tableName':_0x4632('0x9'),'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 64bb0fd..d7eeaa2 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 _0x2d07=['code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./cmList.socket','register','request','then','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xf12750,_0x3e828f){var _0x57667a=function(_0x44fef4){while(--_0x44fef4){_0xf12750['push'](_0xf12750['shift']());}};_0x57667a(++_0x3e828f);}(_0x2d07,0xee));var _0x72d0=function(_0x14cb58,_0x214d62){_0x14cb58=_0x14cb58-0x0;var _0x5f097e=_0x2d07[_0x14cb58];return _0x5f097e;};'use strict';var _=require(_0x72d0('0x0'));var util=require('util');var moment=require(_0x72d0('0x1'));var BPromise=require('bluebird');var rs=require(_0x72d0('0x2'));var fs=require('fs');var Redis=require(_0x72d0('0x3'));var db=require(_0x72d0('0x4'))['db'];var utils=require(_0x72d0('0x5'));var logger=require(_0x72d0('0x6'))('rpc');var config=require(_0x72d0('0x7'));var jayson=require(_0x72d0('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x72d0('0x9')]=_['defaults'](config['redis'],{'host':_0x72d0('0xa'),'port':0x18eb});var socket=require(_0x72d0('0xb'))(new Redis(config['redis']));require(_0x72d0('0xc'))[_0x72d0('0xd')](socket);function respondWithRpcPromise(_0x3f99b9,_0x4d7c73,_0x3877ad){return new BPromise(function(_0x56c838,_0x326a0c){return client[_0x72d0('0xe')](_0x3f99b9,_0x3877ad)[_0x72d0('0xf')](function(_0x4ce42f){logger['info'](_0x72d0('0x10'),_0x4d7c73,_0x72d0('0x11'));logger[_0x72d0('0x12')](_0x72d0('0x13'),_0x4d7c73,_0x72d0('0x11'),JSON[_0x72d0('0x14')](_0x4ce42f));if(_0x4ce42f[_0x72d0('0x15')]){if(_0x4ce42f[_0x72d0('0x15')][_0x72d0('0x16')]===0x1f4){logger['error'](_0x72d0('0x10'),_0x4d7c73,_0x4ce42f[_0x72d0('0x15')][_0x72d0('0x17')]);return _0x326a0c(_0x4ce42f['error']['message']);}logger[_0x72d0('0x15')]('CmList,\x20%s,\x20%s',_0x4d7c73,_0x4ce42f[_0x72d0('0x15')][_0x72d0('0x17')]);return _0x56c838(_0x4ce42f['error']['message']);}else{logger['info'](_0x72d0('0x10'),_0x4d7c73,_0x72d0('0x11'));_0x56c838(_0x4ce42f[_0x72d0('0x18')]['message']);}})[_0x72d0('0x19')](function(_0x354397){logger[_0x72d0('0x15')](_0x72d0('0x10'),_0x4d7c73,_0x354397);_0x326a0c(_0x354397);});});} \ No newline at end of file +var _0x0bca=['CmList,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','debug'];(function(_0x457160,_0x5bbfef){var _0x1763e5=function(_0x4e934a){while(--_0x4e934a){_0x457160['push'](_0x457160['shift']());}};_0x1763e5(++_0x5bbfef);}(_0x0bca,0xf9));var _0xa0bc=function(_0x1475dc,_0x9fb023){_0x1475dc=_0x1475dc-0x0;var _0x19c5a9=_0x0bca[_0x1475dc];return _0x19c5a9;};'use strict';var _=require(_0xa0bc('0x0'));var util=require(_0xa0bc('0x1'));var moment=require(_0xa0bc('0x2'));var BPromise=require(_0xa0bc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa0bc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0bc('0x5'))(_0xa0bc('0x6'));var config=require('../../config/environment');var jayson=require(_0xa0bc('0x7'));var client=jayson[_0xa0bc('0x8')][_0xa0bc('0x9')]({'port':0x232a});config[_0xa0bc('0xa')]=_[_0xa0bc('0xb')](config[_0xa0bc('0xa')],{'host':_0xa0bc('0xc'),'port':0x18eb});var socket=require(_0xa0bc('0xd'))(new Redis(config[_0xa0bc('0xa')]));require(_0xa0bc('0xe'))[_0xa0bc('0xf')](socket);function respondWithRpcPromise(_0x43594e,_0x3e5cd0,_0x507c92){return new BPromise(function(_0x14c293,_0x318281){return client[_0xa0bc('0x10')](_0x43594e,_0x507c92)[_0xa0bc('0x11')](function(_0x3db27f){logger[_0xa0bc('0x12')](_0xa0bc('0x13'),_0x3e5cd0,'request\x20sent');logger[_0xa0bc('0x14')](_0xa0bc('0x15'),_0x3e5cd0,_0xa0bc('0x16'),JSON['stringify'](_0x3db27f));if(_0x3db27f[_0xa0bc('0x17')]){if(_0x3db27f['error'][_0xa0bc('0x18')]===0x1f4){logger['error'](_0xa0bc('0x13'),_0x3e5cd0,_0x3db27f['error'][_0xa0bc('0x19')]);return _0x318281(_0x3db27f['error'][_0xa0bc('0x19')]);}logger[_0xa0bc('0x17')](_0xa0bc('0x13'),_0x3e5cd0,_0x3db27f[_0xa0bc('0x17')][_0xa0bc('0x19')]);return _0x14c293(_0x3db27f[_0xa0bc('0x17')][_0xa0bc('0x19')]);}else{logger[_0xa0bc('0x12')](_0xa0bc('0x13'),_0x3e5cd0,_0xa0bc('0x16'));_0x14c293(_0x3db27f[_0xa0bc('0x1a')][_0xa0bc('0x19')]);}})['catch'](function(_0x3203d6){logger[_0xa0bc('0x17')]('CmList,\x20%s,\x20%s',_0x3e5cd0,_0x3203d6);_0x318281(_0x3203d6);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index f5644ed..149394f 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 _0x7410=['length','cmList:','save','remove','emit','removeListener','register'];(function(_0xcd36a,_0x4d2ba0){var _0x2051e1=function(_0x106b03){while(--_0x106b03){_0xcd36a['push'](_0xcd36a['shift']());}};_0x2051e1(++_0x4d2ba0);}(_0x7410,0x8e));var _0x0741=function(_0x18b2ac,_0x54809a){_0x18b2ac=_0x18b2ac-0x0;var _0x3eb7a2=_0x7410[_0x18b2ac];return _0x3eb7a2;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x0741('0x0'),_0x0741('0x1'),'update'];function createListener(_0x48fadb,_0x2dbc8b){return function(_0x29a152){_0x2dbc8b[_0x0741('0x2')](_0x48fadb,_0x29a152);};}function removeListener(_0x53ea6b,_0x1629d8){return function(){CmListEvents[_0x0741('0x3')](_0x53ea6b,_0x1629d8);};}exports[_0x0741('0x4')]=function(_0x33fcdc){for(var _0x17e8f6=0x0,_0x411591=events[_0x0741('0x5')];_0x17e8f6<_0x411591;_0x17e8f6++){var _0x58b4d4=events[_0x17e8f6];var _0x456484=createListener(_0x0741('0x6')+_0x58b4d4,_0x33fcdc);CmListEvents['on'](_0x58b4d4,_0x456484);}}; \ No newline at end of file +var _0xaeec=['length','cmList:','./cmList.events','save','emit','removeListener','register'];(function(_0xbd60c5,_0x1382db){var _0x4faa3e=function(_0x47293a){while(--_0x47293a){_0xbd60c5['push'](_0xbd60c5['shift']());}};_0x4faa3e(++_0x1382db);}(_0xaeec,0x87));var _0xcaee=function(_0x3854d1,_0x140651){_0x3854d1=_0x3854d1-0x0;var _0x248125=_0xaeec[_0x3854d1];return _0x248125;};'use strict';var CmListEvents=require(_0xcaee('0x0'));var events=[_0xcaee('0x1'),'remove','update'];function createListener(_0x5eb3a5,_0x3d7a58){return function(_0x36601a){_0x3d7a58[_0xcaee('0x2')](_0x5eb3a5,_0x36601a);};}function removeListener(_0x310172,_0x46fca1){return function(){CmListEvents[_0xcaee('0x3')](_0x310172,_0x46fca1);};}exports[_0xcaee('0x4')]=function(_0x1be0d0){for(var _0x3a8a17=0x0,_0x2a1dbe=events[_0xcaee('0x5')];_0x3a8a17<_0x2a1dbe;_0x3a8a17++){var _0x552d20=events[_0x3a8a17];var _0x1963dc=createListener(_0xcaee('0x6')+_0x552d20,_0x1be0d0);CmListEvents['on'](_0x552d20,_0x1963dc);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index b162196..af6b059 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 _0x52e1=['post','addDisposition','addContacts','addCustomField','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','connect-timeout','Router','fs-extra','../../config/environment','./cmList.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents'];(function(_0x302f55,_0x31872f){var _0x55ca94=function(_0x477ac3){while(--_0x477ac3){_0x302f55['push'](_0x302f55['shift']());}};_0x55ca94(++_0x31872f);}(_0x52e1,0x94));var _0x152e=function(_0x295df8,_0x1f9924){_0x295df8=_0x295df8-0x0;var _0x1c4b61=_0x52e1[_0x295df8];return _0x1c4b61;};'use strict';var multer=require(_0x152e('0x0'));var util=require(_0x152e('0x1'));var path=require('path');var timeout=require(_0x152e('0x2'));var express=require('express');var router=express[_0x152e('0x3')]();var fs_extra=require(_0x152e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x152e('0x5'));var controller=require(_0x152e('0x6'));router[_0x152e('0x7')]('/',auth[_0x152e('0x8')](),controller['index']);router[_0x152e('0x7')](_0x152e('0x9'),auth[_0x152e('0x8')](),controller[_0x152e('0xa')]);router[_0x152e('0x7')](_0x152e('0xb'),auth[_0x152e('0x8')](),controller[_0x152e('0xc')]);router[_0x152e('0x7')](_0x152e('0xd'),auth['isAuthenticated'](),controller[_0x152e('0xe')]);router['get'](_0x152e('0xf'),auth[_0x152e('0x8')](),controller[_0x152e('0x10')]);router['get']('/:id/contacts/csv',auth[_0x152e('0x8')](),controller[_0x152e('0x11')]);router['get'](_0x152e('0x12'),auth[_0x152e('0x8')](),controller[_0x152e('0x13')]);router[_0x152e('0x7')](_0x152e('0x14'),auth[_0x152e('0x8')](),controller[_0x152e('0x15')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x152e('0x16')](_0x152e('0xd'),auth[_0x152e('0x8')](),controller[_0x152e('0x17')]);router[_0x152e('0x16')](_0x152e('0xf'),auth['isAuthenticated'](),controller[_0x152e('0x18')]);router[_0x152e('0x16')]('/:id/fields',auth[_0x152e('0x8')](),controller[_0x152e('0x19')]);router[_0x152e('0x16')](_0x152e('0x14'),auth[_0x152e('0x8')](),controller[_0x152e('0x1a')]);router[_0x152e('0x1b')](_0x152e('0xb'),auth['isAuthenticated'](),controller[_0x152e('0x1c')]);router[_0x152e('0x1d')]('/:id',auth[_0x152e('0x8')](),controller[_0x152e('0x1e')]);router[_0x152e('0x1d')](_0x152e('0xd'),auth[_0x152e('0x8')](),controller[_0x152e('0x1f')]);router[_0x152e('0x1d')](_0x152e('0x14'),auth['isAuthenticated'](),controller[_0x152e('0x20')]);module[_0x152e('0x21')]=router; \ No newline at end of file +var _0xa2d4=['./cmList.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','/:id/users','getAgents','post','create','addDisposition','addContacts','addCustomField','addAgents','put','/:id','update','delete','removeDispositions','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x40eec9,_0x817a67){var _0xfee890=function(_0x186640){while(--_0x186640){_0x40eec9['push'](_0x40eec9['shift']());}};_0xfee890(++_0x817a67);}(_0xa2d4,0x110));var _0x4a2d=function(_0x3f4d92,_0x3cf948){_0x3f4d92=_0x3f4d92-0x0;var _0x2c6f2b=_0xa2d4[_0x3f4d92];return _0x2c6f2b;};'use strict';var multer=require(_0x4a2d('0x0'));var util=require(_0x4a2d('0x1'));var path=require('path');var timeout=require(_0x4a2d('0x2'));var express=require(_0x4a2d('0x3'));var router=express[_0x4a2d('0x4')]();var fs_extra=require(_0x4a2d('0x5'));var auth=require(_0x4a2d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4a2d('0x7'));var controller=require(_0x4a2d('0x8'));router[_0x4a2d('0x9')]('/',auth[_0x4a2d('0xa')](),controller[_0x4a2d('0xb')]);router[_0x4a2d('0x9')](_0x4a2d('0xc'),auth[_0x4a2d('0xa')](),controller[_0x4a2d('0xd')]);router['get']('/:id',auth[_0x4a2d('0xa')](),controller[_0x4a2d('0xe')]);router[_0x4a2d('0x9')](_0x4a2d('0xf'),auth[_0x4a2d('0xa')](),controller['getDispositions']);router[_0x4a2d('0x9')](_0x4a2d('0x10'),auth[_0x4a2d('0xa')](),controller[_0x4a2d('0x11')]);router[_0x4a2d('0x9')](_0x4a2d('0x12'),auth[_0x4a2d('0xa')](),controller[_0x4a2d('0x13')]);router[_0x4a2d('0x9')](_0x4a2d('0x14'),auth[_0x4a2d('0xa')](),controller['getCustomFields']);router[_0x4a2d('0x9')](_0x4a2d('0x15'),auth['isAuthenticated'](),controller[_0x4a2d('0x16')]);router[_0x4a2d('0x17')]('/',auth[_0x4a2d('0xa')](),controller[_0x4a2d('0x18')]);router[_0x4a2d('0x17')](_0x4a2d('0xf'),auth[_0x4a2d('0xa')](),controller[_0x4a2d('0x19')]);router['post'](_0x4a2d('0x10'),auth[_0x4a2d('0xa')](),controller[_0x4a2d('0x1a')]);router['post'](_0x4a2d('0x14'),auth[_0x4a2d('0xa')](),controller[_0x4a2d('0x1b')]);router[_0x4a2d('0x17')]('/:id/users',auth[_0x4a2d('0xa')](),controller[_0x4a2d('0x1c')]);router[_0x4a2d('0x1d')](_0x4a2d('0x1e'),auth['isAuthenticated'](),controller[_0x4a2d('0x1f')]);router['delete'](_0x4a2d('0x1e'),auth[_0x4a2d('0xa')](),controller['destroy']);router[_0x4a2d('0x20')](_0x4a2d('0xf'),auth[_0x4a2d('0xa')](),controller[_0x4a2d('0x21')]);router[_0x4a2d('0x20')](_0x4a2d('0x15'),auth[_0x4a2d('0xa')](),controller['removeAgents']);module[_0x4a2d('0x22')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 8d44947..4d6b5c9 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 _0xecf5=['field','STRING','VIRTUAL','getDataValue'];(function(_0x256498,_0x3885dc){var _0x5c07e3=function(_0x4e95c8){while(--_0x4e95c8){_0x256498['push'](_0x256498['shift']());}};_0x5c07e3(++_0x3885dc);}(_0xecf5,0x16e));var _0x5ecf=function(_0x584b2c,_0x6afb92){_0x584b2c=_0x584b2c-0x0;var _0x1a9fdc=_0xecf5[_0x584b2c];return _0x1a9fdc;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5ecf('0x0')],'get':function(_0x5f3c2e){return this[_0x5ecf('0x1')](_0x5ecf('0x2'));}},'field':{'type':Sequelize[_0x5ecf('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x5ecf('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x5ecf('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x7e8a=['field','STRING','sequelize','exports','getDataValue'];(function(_0x46d16d,_0x276ed4){var _0x2dd3a7=function(_0x303fc8){while(--_0x303fc8){_0x46d16d['push'](_0x46d16d['shift']());}};_0x2dd3a7(++_0x276ed4);}(_0x7e8a,0x89));var _0xa7e8=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x7e8a[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require(_0xa7e8('0x0'));module[_0xa7e8('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4514a4){return this[_0xa7e8('0x2')](_0xa7e8('0x3'));}},'field':{'type':Sequelize[_0xa7e8('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index f936765..433869c 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x5f2d03,_0x51a249){var _0x3838ac=function(_0x28a140){while(--_0x28a140){_0x5f2d03['push'](_0x5f2d03['shift']());}};_0x3838ac(++_0x51a249);}(_0x7a54,0x106));var _0x47a5=function(_0x2bfa7e,_0x1d4acb){_0x2bfa7e=_0x2bfa7e-0x0;var _0x2b2717=_0x7a54[_0x2bfa7e];return _0x2b2717;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _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(_0x1977bc,_0x3d0f51){var _0x54ce01=function(_0x497550){while(--_0x497550){_0x1977bc['push'](_0x1977bc['shift']());}};_0x54ce01(++_0x3d0f51);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 94e09af..acc4a9f 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 _0x73de=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','Condition','lodash'];(function(_0x5c2a2b,_0x22c94e){var _0x19921f=function(_0x3fb937){while(--_0x3fb937){_0x5c2a2b['push'](_0x5c2a2b['shift']());}};_0x19921f(++_0x22c94e);}(_0x73de,0xd1));var _0xe73d=function(_0x4b03f2,_0x46b5f9){_0x4b03f2=_0x4b03f2-0x0;var _0x1c97ef=_0x73de[_0x4b03f2];return _0x1c97ef;};'use strict';var _=require(_0xe73d('0x0'));var util=require('util');var logger=require(_0xe73d('0x1'))(_0xe73d('0x2'));var moment=require('moment');var BPromise=require(_0xe73d('0x3'));var rp=require(_0xe73d('0x4'));var fs=require('fs');var path=require(_0xe73d('0x5'));var rimraf=require(_0xe73d('0x6'));var config=require(_0xe73d('0x7'));var attributes=require('./condition.attributes');module[_0xe73d('0x8')]=function(_0x379ad9,_0x4a9fb9){return _0x379ad9['define'](_0xe73d('0x9'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c27=['bluebird','request-promise','rimraf','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','../../config/logger','moment'];(function(_0xb3afd9,_0x4f7ef6){var _0x18dea6=function(_0x4f3a31){while(--_0x4f3a31){_0xb3afd9['push'](_0xb3afd9['shift']());}};_0x18dea6(++_0x4f7ef6);}(_0x7c27,0x98));var _0x77c2=function(_0x55922b,_0x3e3916){_0x55922b=_0x55922b-0x0;var _0x1dba37=_0x7c27[_0x55922b];return _0x1dba37;};'use strict';var _=require(_0x77c2('0x0'));var util=require(_0x77c2('0x1'));var logger=require(_0x77c2('0x2'))('api');var moment=require(_0x77c2('0x3'));var BPromise=require(_0x77c2('0x4'));var rp=require(_0x77c2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77c2('0x6'));var config=require('../../config/environment');var attributes=require(_0x77c2('0x7'));module[_0x77c2('0x8')]=function(_0x36fccc,_0x9717d4){return _0x36fccc[_0x77c2('0x9')](_0x77c2('0xa'),attributes,{'tableName':_0x77c2('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 f8ab19b..8010496 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 _0xb90a=['error','code','Condition,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3082c9,_0x4f0c54){var _0xfc2ec2=function(_0x4f3687){while(--_0x4f3687){_0x3082c9['push'](_0x3082c9['shift']());}};_0xfc2ec2(++_0x4f0c54);}(_0xb90a,0xbd));var _0xab90=function(_0x529028,_0x150db2){_0x529028=_0x529028-0x0;var _0x38c6a5=_0xb90a[_0x529028];return _0x38c6a5;};'use strict';var _=require(_0xab90('0x0'));var util=require(_0xab90('0x1'));var moment=require('moment');var BPromise=require(_0xab90('0x2'));var rs=require(_0xab90('0x3'));var fs=require('fs');var Redis=require(_0xab90('0x4'));var db=require(_0xab90('0x5'))['db'];var utils=require(_0xab90('0x6'));var logger=require(_0xab90('0x7'))(_0xab90('0x8'));var config=require(_0xab90('0x9'));var jayson=require(_0xab90('0xa'));var client=jayson[_0xab90('0xb')][_0xab90('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5ed115,_0x50eaff,_0x182a62){return new BPromise(function(_0x234c75,_0x218608){return client[_0xab90('0xd')](_0x5ed115,_0x182a62)[_0xab90('0xe')](function(_0x26669d){logger['info']('Condition,\x20%s,\x20%s',_0x50eaff,_0xab90('0xf'));logger[_0xab90('0x10')](_0xab90('0x11'),_0x50eaff,'request\x20sent',JSON[_0xab90('0x12')](_0x26669d));if(_0x26669d[_0xab90('0x13')]){if(_0x26669d[_0xab90('0x13')][_0xab90('0x14')]===0x1f4){logger[_0xab90('0x13')](_0xab90('0x15'),_0x50eaff,_0x26669d['error'][_0xab90('0x16')]);return _0x218608(_0x26669d[_0xab90('0x13')][_0xab90('0x16')]);}logger[_0xab90('0x13')](_0xab90('0x15'),_0x50eaff,_0x26669d[_0xab90('0x13')][_0xab90('0x16')]);return _0x234c75(_0x26669d[_0xab90('0x13')][_0xab90('0x16')]);}else{logger[_0xab90('0x17')](_0xab90('0x15'),_0x50eaff,_0xab90('0xf'));_0x234c75(_0x26669d[_0xab90('0x18')][_0xab90('0x16')]);}})[_0xab90('0x19')](function(_0x672ab9){logger['error'](_0xab90('0x15'),_0x50eaff,_0x672ab9);_0x218608(_0x672ab9);});});} \ No newline at end of file +var _0x1099=['client','http','request','then','info','Condition,\x20%s,\x20%s','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1099,0x183));var _0x9109=function(_0x21dcb4,_0x5641de){_0x21dcb4=_0x21dcb4-0x0;var _0x319088=_0x1099[_0x21dcb4];return _0x319088;};'use strict';var _=require('lodash');var util=require(_0x9109('0x0'));var moment=require(_0x9109('0x1'));var BPromise=require(_0x9109('0x2'));var rs=require(_0x9109('0x3'));var fs=require('fs');var Redis=require(_0x9109('0x4'));var db=require(_0x9109('0x5'))['db'];var utils=require(_0x9109('0x6'));var logger=require(_0x9109('0x7'))(_0x9109('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9109('0x9')][_0x9109('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12f967,_0x1c59c3,_0x3e5947){return new BPromise(function(_0x49dcd4,_0x4fde0e){return client[_0x9109('0xb')](_0x12f967,_0x3e5947)[_0x9109('0xc')](function(_0x1052e3){logger[_0x9109('0xd')](_0x9109('0xe'),_0x1c59c3,'request\x20sent');logger[_0x9109('0xf')]('Condition,\x20%s,\x20%s,\x20%s',_0x1c59c3,'request\x20sent',JSON[_0x9109('0x10')](_0x1052e3));if(_0x1052e3[_0x9109('0x11')]){if(_0x1052e3[_0x9109('0x11')][_0x9109('0x12')]===0x1f4){logger[_0x9109('0x11')](_0x9109('0xe'),_0x1c59c3,_0x1052e3[_0x9109('0x11')]['message']);return _0x4fde0e(_0x1052e3[_0x9109('0x11')][_0x9109('0x13')]);}logger[_0x9109('0x11')]('Condition,\x20%s,\x20%s',_0x1c59c3,_0x1052e3[_0x9109('0x11')][_0x9109('0x13')]);return _0x49dcd4(_0x1052e3[_0x9109('0x11')][_0x9109('0x13')]);}else{logger[_0x9109('0xd')](_0x9109('0xe'),_0x1c59c3,'request\x20sent');_0x49dcd4(_0x1052e3[_0x9109('0x14')][_0x9109('0x13')]);}})[_0x9109('0x15')](function(_0x467f1e){logger[_0x9109('0x11')](_0x9109('0xe'),_0x1c59c3,_0x467f1e);_0x4fde0e(_0x467f1e);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 02d1605..4776b4d 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 _0xe701=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe701,0xc3));var _0x1e70=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe701[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x1e70('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1e70('0x1'));var express=require(_0x1e70('0x2'));var router=express[_0x1e70('0x3')]();var fs_extra=require(_0x1e70('0x4'));var auth=require(_0x1e70('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1e70('0x6'));var controller=require(_0x1e70('0x7'));router[_0x1e70('0x8')](_0x1e70('0x9'),auth[_0x1e70('0xa')](),controller[_0x1e70('0xb')]);router[_0x1e70('0xc')]('/:id',auth[_0x1e70('0xa')](),controller[_0x1e70('0xd')]);module[_0x1e70('0xe')]=router; \ No newline at end of file +var _0x7ce7=['/:id','update','delete','isAuthenticated','util','Router','fs-extra','../../components/interaction/service','../../config/environment','put'];(function(_0x566bdf,_0x1f4861){var _0x331215=function(_0x524d0d){while(--_0x524d0d){_0x566bdf['push'](_0x566bdf['shift']());}};_0x331215(++_0x1f4861);}(_0x7ce7,0x180));var _0x77ce=function(_0x1307d5,_0x25b6c8){_0x1307d5=_0x1307d5-0x0;var _0x4d9f1a=_0x7ce7[_0x1307d5];return _0x4d9f1a;};'use strict';var multer=require('multer');var util=require(_0x77ce('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77ce('0x1')]();var fs_extra=require(_0x77ce('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x77ce('0x3'));var config=require(_0x77ce('0x4'));var controller=require('./condition.controller');router[_0x77ce('0x5')](_0x77ce('0x6'),auth['isAuthenticated'](),controller[_0x77ce('0x7')]);router[_0x77ce('0x8')](_0x77ce('0x6'),auth[_0x77ce('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index eac84eb..c9d170c 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['STRING','name'];(function(_0x31b137,_0xa54c07){var _0x35a4f8=function(_0x28e248){while(--_0x28e248){_0x31b137['push'](_0x31b137['shift']());}};_0x35a4f8(++_0xa54c07);}(_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 _0x0713=['STRING','name'];(function(_0x19e89d,_0xa1ecf1){var _0x19433b=function(_0x596fd5){while(--_0x596fd5){_0x19e89d['push'](_0x19e89d['shift']());}};_0x19433b(++_0xa1ecf1);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index e859863..b6a4d4e 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 _0xab48=['VIRTUAL','filter','options','rows','catch','show','fields','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rawAttributes','includeAll','omit','createdAt','updatedAt','userProfileId','iframe','attrUrl','attrs','value','attrPath','clock','attrHourFormat','HH:mm:ss','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','getItems','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','register','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','map','Dashboard','fieldName','type','key','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge'];(function(_0x1946d3,_0x5912d9){var _0x28ce2b=function(_0x3e3b8d){while(--_0x3e3b8d){_0x1946d3['push'](_0x1946d3['shift']());}};_0x28ce2b(++_0x5912d9);}(_0xab48,0x18c));var _0x8ab4=function(_0x9a8878,_0x2ef1b8){_0x9a8878=_0x9a8878-0x0;var _0x5f36a8=_0xab48[_0x9a8878];return _0x5f36a8;};'use strict';var emlformat=require(_0x8ab4('0x0'));var rimraf=require(_0x8ab4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8ab4('0x2'));var rp=require('request-promise');var moment=require(_0x8ab4('0x3'));var BPromise=require(_0x8ab4('0x4'));var Mustache=require('mustache');var util=require(_0x8ab4('0x5'));var path=require(_0x8ab4('0x6'));var sox=require(_0x8ab4('0x7'));var csv=require(_0x8ab4('0x8'));var ejs=require(_0x8ab4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8ab4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8ab4('0xb'));var toCsv=require(_0x8ab4('0x8'));var querystring=require(_0x8ab4('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8ab4('0xd'));var qs=require(_0x8ab4('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8ab4('0xf'));var logger=require(_0x8ab4('0x10'))(_0x8ab4('0x11'));var utils=require(_0x8ab4('0x12'));var config=require(_0x8ab4('0x13'));var licenseUtil=require(_0x8ab4('0x14'));var db=require('../../mysqldb')['db'];config[_0x8ab4('0x15')]=_[_0x8ab4('0x16')](config[_0x8ab4('0x15')],{'host':_0x8ab4('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8ab4('0x15')]));require('./dashboard.socket')[_0x8ab4('0x18')](socket);function respondWithStatusCode(_0x57578d,_0x4a8b75){_0x4a8b75=_0x4a8b75||0xcc;return function(_0x37e1e4){if(_0x37e1e4){return _0x57578d['sendStatus'](_0x4a8b75);}return _0x57578d[_0x8ab4('0x19')](_0x4a8b75)[_0x8ab4('0x1a')]();};}function respondWithResult(_0x3f7371,_0xaf0bf){_0xaf0bf=_0xaf0bf||0xc8;return function(_0xe912e7){if(_0xe912e7){return _0x3f7371['status'](_0xaf0bf)[_0x8ab4('0x1b')](_0xe912e7);}};}function respondWithFilteredResult(_0x2eedf8,_0x4a59cf){return function(_0x5b5b30){if(_0x5b5b30){var _0x3f1e61=typeof _0x4a59cf[_0x8ab4('0x1c')]===_0x8ab4('0x1d')&&typeof _0x4a59cf['limit']==='undefined';var _0x5e5ad4=_0x5b5b30[_0x8ab4('0x1e')];var _0x3bf606=_0x3f1e61?0x0:_0x4a59cf[_0x8ab4('0x1c')];var _0x6fc6ac=_0x3f1e61?_0x5b5b30[_0x8ab4('0x1e')]:_0x4a59cf[_0x8ab4('0x1c')]+_0x4a59cf[_0x8ab4('0x1f')];var _0x5c9fd3;if(_0x6fc6ac>=_0x5e5ad4){_0x6fc6ac=_0x5e5ad4;_0x5c9fd3=0xc8;}else{_0x5c9fd3=0xce;}_0x2eedf8['status'](_0x5c9fd3);return _0x2eedf8[_0x8ab4('0x20')](_0x8ab4('0x21'),_0x3bf606+'-'+_0x6fc6ac+'/'+_0x5e5ad4)[_0x8ab4('0x1b')](_0x5b5b30);}return null;};}function patchUpdates(_0xdd6127){return function(_0x930dec){try{jsonpatch['apply'](_0x930dec,_0xdd6127,!![]);}catch(_0x5c3c6c){return BPromise[_0x8ab4('0x22')](_0x5c3c6c);}return _0x930dec[_0x8ab4('0x23')]();};}function saveUpdates(_0x43f79c,_0x313889){return function(_0x4c5c93){if(_0x4c5c93){return _0x4c5c93[_0x8ab4('0x24')](_0x43f79c)[_0x8ab4('0x25')](function(_0x37843d){return _0x37843d;});}return null;};}function removeEntity(_0x1d7357,_0x1dba63){return function(_0x5cd67e){if(_0x5cd67e){return _0x5cd67e[_0x8ab4('0x26')]()[_0x8ab4('0x25')](function(){var _0x1655e2=_0x5cd67e[_0x8ab4('0x27')]({'plain':!![]});var _0x1a66c6='CustomDashboards';return db[_0x8ab4('0x28')][_0x8ab4('0x26')]({'where':{'type':_0x1a66c6,'resourceId':_0x1655e2['id']}})['then'](function(){return _0x5cd67e;});})[_0x8ab4('0x25')](function(){_0x1d7357[_0x8ab4('0x19')](0xcc)[_0x8ab4('0x1a')]();});}};}function handleEntityNotFound(_0x16c9d8,_0x5346ba){return function(_0x55c8f9){if(!_0x55c8f9){_0x16c9d8[_0x8ab4('0x29')](0x194);}return _0x55c8f9;};}function handleError(_0x1c6d77,_0xe8609){_0xe8609=_0xe8609||0x1f4;return function(_0x1026cb){logger[_0x8ab4('0x2a')](_0x1026cb[_0x8ab4('0x2b')]);if(_0x1026cb['name']){delete _0x1026cb[_0x8ab4('0x2c')];}_0x1c6d77[_0x8ab4('0x19')](_0xe8609)[_0x8ab4('0x2d')](_0x1026cb);};}exports['index']=function(_0x1feb40,_0x3a41e0){var _0x10924c={},_0xa8fb6d={},_0x13184b={'count':0x0,'rows':[]};var _0x48bf98=_[_0x8ab4('0x2e')](db[_0x8ab4('0x2f')]['rawAttributes'],function(_0x7e4852){return{'name':_0x7e4852[_0x8ab4('0x30')],'type':_0x7e4852[_0x8ab4('0x31')][_0x8ab4('0x32')]};});_0xa8fb6d[_0x8ab4('0x33')]=_[_0x8ab4('0x2e')](_0x48bf98,_0x8ab4('0x2c'));_0xa8fb6d[_0x8ab4('0x34')]=_[_0x8ab4('0x35')](_0x1feb40[_0x8ab4('0x34')]);_0xa8fb6d['filters']=_[_0x8ab4('0x36')](_0xa8fb6d[_0x8ab4('0x33')],_0xa8fb6d['query']);_0x10924c['attributes']=_[_0x8ab4('0x36')](_0xa8fb6d[_0x8ab4('0x33')],qs['fields'](_0x1feb40['query']['fields']));_0x10924c[_0x8ab4('0x37')]=_0x10924c[_0x8ab4('0x37')]['length']?_0x10924c[_0x8ab4('0x37')]:_0xa8fb6d['model'];if(!_0x1feb40['query'][_0x8ab4('0x38')](_0x8ab4('0x39'))){_0x10924c[_0x8ab4('0x1f')]=qs[_0x8ab4('0x1f')](_0x1feb40[_0x8ab4('0x34')][_0x8ab4('0x1f')]);_0x10924c[_0x8ab4('0x1c')]=qs[_0x8ab4('0x1c')](_0x1feb40[_0x8ab4('0x34')]['offset']);}_0x10924c[_0x8ab4('0x3a')]=qs[_0x8ab4('0x3b')](_0x1feb40[_0x8ab4('0x34')][_0x8ab4('0x3b')]);_0x10924c[_0x8ab4('0x3c')]=qs[_0x8ab4('0x3d')](_[_0x8ab4('0x3e')](_0x1feb40[_0x8ab4('0x34')],_0xa8fb6d['filters']),_0x48bf98);if(_0x1feb40['query']['filter']){_0x10924c[_0x8ab4('0x3c')]=_[_0x8ab4('0x3f')](_0x10924c['where'],{'$or':_[_0x8ab4('0x2e')](_0x48bf98,function(_0x1a448e){if(_0x1a448e[_0x8ab4('0x31')]!==_0x8ab4('0x40')){var _0x1ac999={};_0x1ac999[_0x1a448e['name']]={'$like':'%'+_0x1feb40['query'][_0x8ab4('0x41')]+'%'};return _0x1ac999;}})});}_0x10924c=_[_0x8ab4('0x3f')]({},_0x10924c,_0x1feb40[_0x8ab4('0x42')]);var _0x1d2f2f={'where':_0x10924c[_0x8ab4('0x3c')]};return db[_0x8ab4('0x2f')]['count'](_0x1d2f2f)[_0x8ab4('0x25')](function(_0x1645a5){_0x13184b[_0x8ab4('0x1e')]=_0x1645a5;if(_0x1feb40[_0x8ab4('0x34')]['includeAll']){_0x10924c['include']=[{'all':!![]}];}return db[_0x8ab4('0x2f')]['findAll'](_0x10924c);})['then'](function(_0x2db5c){_0x13184b[_0x8ab4('0x43')]=_0x2db5c;return _0x13184b;})[_0x8ab4('0x25')](respondWithFilteredResult(_0x3a41e0,_0x10924c))[_0x8ab4('0x44')](handleError(_0x3a41e0,null));};exports[_0x8ab4('0x45')]=function(_0x7052c0,_0xd87688){var _0x2579f0={'raw':![],'where':{'id':_0x7052c0['params']['id']}},_0x34b91d={};_0x34b91d[_0x8ab4('0x33')]=_[_0x8ab4('0x35')](db['Dashboard']['rawAttributes']);_0x34b91d[_0x8ab4('0x34')]=_[_0x8ab4('0x35')](_0x7052c0[_0x8ab4('0x34')]);_0x34b91d[_0x8ab4('0x3d')]=_[_0x8ab4('0x36')](_0x34b91d[_0x8ab4('0x33')],_0x34b91d[_0x8ab4('0x34')]);_0x2579f0['attributes']=_[_0x8ab4('0x36')](_0x34b91d['model'],qs[_0x8ab4('0x46')](_0x7052c0[_0x8ab4('0x34')][_0x8ab4('0x46')]));_0x2579f0[_0x8ab4('0x37')]=_0x2579f0[_0x8ab4('0x37')][_0x8ab4('0x47')]?_0x2579f0['attributes']:_0x34b91d['model'];if(_0x7052c0[_0x8ab4('0x34')]['includeAll']){_0x2579f0[_0x8ab4('0x48')]=[{'all':!![]}];}_0x2579f0=_[_0x8ab4('0x3f')]({},_0x2579f0,_0x7052c0[_0x8ab4('0x42')]);return db['Dashboard'][_0x8ab4('0x49')](_0x2579f0)[_0x8ab4('0x25')](handleEntityNotFound(_0xd87688,null))[_0x8ab4('0x25')](respondWithResult(_0xd87688,null))[_0x8ab4('0x44')](handleError(_0xd87688,null));};exports['create']=function(_0x47261f,_0x3c4bf7){return db[_0x8ab4('0x2f')][_0x8ab4('0x4a')](_0x47261f[_0x8ab4('0x4b')],{})[_0x8ab4('0x25')](function(_0x263349){var _0x4267b8=_0x47261f[_0x8ab4('0x4c')][_0x8ab4('0x27')]({'plain':!![]});if(!_0x4267b8)throw new Error(_0x8ab4('0x4d'));if(_0x4267b8[_0x8ab4('0x4e')]===_0x8ab4('0x4c')){var _0x32ca9f=_0x263349[_0x8ab4('0x27')]({'plain':!![]});var _0x4f2c74=_0x8ab4('0x4f');return db[_0x8ab4('0x50')][_0x8ab4('0x49')]({'where':{'name':_0x4f2c74,'userProfileId':_0x4267b8['userProfileId']},'raw':!![]})[_0x8ab4('0x25')](function(_0x49ca20){if(_0x49ca20&&_0x49ca20['autoAssociation']===0x0){return db['UserProfileResource'][_0x8ab4('0x4a')]({'name':_0x32ca9f[_0x8ab4('0x2c')],'resourceId':_0x32ca9f['id'],'type':_0x49ca20[_0x8ab4('0x2c')],'sectionId':_0x49ca20['id']},{})[_0x8ab4('0x25')](function(){return _0x263349;});}else{return _0x263349;}})[_0x8ab4('0x44')](function(_0x48c9bd){logger['error'](_0x8ab4('0x51'),_0x48c9bd);throw _0x48c9bd;});}return _0x263349;})['then'](respondWithResult(_0x3c4bf7,0xc9))[_0x8ab4('0x44')](handleError(_0x3c4bf7,null));};exports['clone']=function(_0x4a7c9c,_0x2b756f){var _0x2ffce8={'where':{'id':_0x4a7c9c[_0x8ab4('0x52')]['id']}},_0x2ba0e2={};_0x2ba0e2[_0x8ab4('0x33')]=_[_0x8ab4('0x35')](db[_0x8ab4('0x2f')][_0x8ab4('0x53')]);_0x2ffce8[_0x8ab4('0x37')]=_[_0x8ab4('0x36')](_0x2ba0e2[_0x8ab4('0x33')],qs[_0x8ab4('0x46')](_0x4a7c9c[_0x8ab4('0x34')][_0x8ab4('0x46')]));_0x2ffce8[_0x8ab4('0x37')]=_0x2ffce8[_0x8ab4('0x37')][_0x8ab4('0x47')]?_0x2ffce8[_0x8ab4('0x37')]:_0x2ba0e2[_0x8ab4('0x33')];if(_0x4a7c9c[_0x8ab4('0x34')][_0x8ab4('0x54')]){_0x2ffce8['include']=[{'all':!![]}];}_0x2ffce8=_[_0x8ab4('0x3f')]({},_0x2ffce8,_0x4a7c9c['options']);return db[_0x8ab4('0x2f')][_0x8ab4('0x49')](_0x2ffce8)[_0x8ab4('0x25')](handleEntityNotFound(_0x2b756f,null))['then'](function(_0x2ee6bf){if(_0x2ee6bf){var _0x288ec1=_0x2ee6bf[_0x8ab4('0x27')]({'plain':!![]});_0x288ec1=qs[_0x8ab4('0x55')](_0x288ec1,['id',_0x8ab4('0x56'),'updatedAt']);_0x4a7c9c[_0x8ab4('0x4b')]=_[_0x8ab4('0x55')](_0x4a7c9c[_0x8ab4('0x4b')],['id','createdAt',_0x8ab4('0x57')]);return db[_0x8ab4('0x2f')][_0x8ab4('0x4a')](_[_0x8ab4('0x3f')](_0x288ec1,_0x4a7c9c[_0x8ab4('0x4b')]),{'include':_0x4a7c9c[_0x8ab4('0x34')][_0x8ab4('0x54')]?[{'all':!![]}]:undefined})['then'](function(_0x1150bb){var _0x108b0a=_0x4a7c9c['user'][_0x8ab4('0x27')]({'plain':!![]});if(!_0x108b0a)throw new Error(_0x8ab4('0x4d'));if(_0x108b0a[_0x8ab4('0x4e')]===_0x8ab4('0x4c')){var _0xed5964=_0x1150bb['get']({'plain':!![]});var _0x1837d1=_0x8ab4('0x4f');return db['UserProfileSection'][_0x8ab4('0x49')]({'where':{'name':_0x1837d1,'userProfileId':_0x108b0a[_0x8ab4('0x58')]},'raw':!![]})[_0x8ab4('0x25')](function(_0x20cb07){if(_0x20cb07&&_0x20cb07['autoAssociation']===0x0){return db[_0x8ab4('0x28')][_0x8ab4('0x4a')]({'name':_0xed5964[_0x8ab4('0x2c')],'resourceId':_0xed5964['id'],'type':_0x20cb07[_0x8ab4('0x2c')],'sectionId':_0x20cb07['id']},{})['then'](function(){return _0x1150bb;});}else{return _0x1150bb;}})[_0x8ab4('0x44')](function(_0x24d16f){logger[_0x8ab4('0x2a')](_0x8ab4('0x51'),_0x24d16f);throw _0x24d16f;});}return _0x1150bb;});}})[_0x8ab4('0x25')](respondWithResult(_0x2b756f,0xc9))[_0x8ab4('0x44')](handleError(_0x2b756f,null));};exports[_0x8ab4('0x24')]=function(_0x55f10a,_0x87fed9){if(_0x55f10a['body']['id']){delete _0x55f10a[_0x8ab4('0x4b')]['id'];}return db[_0x8ab4('0x2f')][_0x8ab4('0x49')]({'where':{'id':_0x55f10a[_0x8ab4('0x52')]['id']}})[_0x8ab4('0x25')](handleEntityNotFound(_0x87fed9,null))[_0x8ab4('0x25')](saveUpdates(_0x55f10a['body'],null))[_0x8ab4('0x25')](respondWithResult(_0x87fed9,null))['catch'](handleError(_0x87fed9,null));};exports[_0x8ab4('0x26')]=function(_0x281c52,_0x5e8a21){return db[_0x8ab4('0x2f')][_0x8ab4('0x49')]({'where':{'id':_0x281c52['params']['id']}})[_0x8ab4('0x25')](handleEntityNotFound(_0x5e8a21,null))['then'](removeEntity(_0x5e8a21,null))['catch'](handleError(_0x5e8a21,null));};function widgetAttributes(_0x3d5cd6){try{switch(_0x3d5cd6['type']){case _0x8ab4('0x59'):return[{'name':_0x8ab4('0x5a'),'value':_0x3d5cd6[_0x8ab4('0x5a')]||(_0x3d5cd6[_0x8ab4('0x5b')]&&_0x3d5cd6[_0x8ab4('0x5b')][0x0]?_0x3d5cd6[_0x8ab4('0x5b')][0x0][_0x8ab4('0x5c')]:undefined)||'https://'}];case'custom':return[{'name':_0x8ab4('0x5d'),'value':_0x3d5cd6[_0x8ab4('0x5d')]||(_0x3d5cd6[_0x8ab4('0x5b')]&&_0x3d5cd6['attrs'][0x0]?_0x3d5cd6[_0x8ab4('0x5b')][0x0][_0x8ab4('0x5c')]:undefined)||''}];case _0x8ab4('0x5e'):return[{'name':_0x8ab4('0x5f'),'value':_0x3d5cd6[_0x8ab4('0x5f')]||(_0x3d5cd6[_0x8ab4('0x5b')]&&_0x3d5cd6[_0x8ab4('0x5b')][0x0]?_0x3d5cd6[_0x8ab4('0x5b')][0x0][_0x8ab4('0x5c')]:undefined)||_0x8ab4('0x60')},{'name':'attrTimezone','value':_0x3d5cd6['attrTimezone']||(_0x3d5cd6['attrs']&&_0x3d5cd6[_0x8ab4('0x5b')][0x1]?_0x3d5cd6[_0x8ab4('0x5b')][0x1][_0x8ab4('0x5c')]:undefined)||_0x8ab4('0x61')},{'name':_0x8ab4('0x62'),'value':_0x3d5cd6['attrFontSize']||(_0x3d5cd6['attrs']&&_0x3d5cd6[_0x8ab4('0x5b')][0x2]?_0x3d5cd6[_0x8ab4('0x5b')][0x2]['value']:undefined)||0xc}];case _0x8ab4('0x63'):return[{'name':_0x8ab4('0x64'),'value':_0x3d5cd6[_0x8ab4('0x64')]||(_0x3d5cd6['attrs']&&_0x3d5cd6[_0x8ab4('0x5b')][0x0]?_0x3d5cd6['attrs'][0x0]['value']:undefined)||'total'},{'name':_0x8ab4('0x65'),'value':_0x3d5cd6[_0x8ab4('0x65')]||(_0x3d5cd6[_0x8ab4('0x5b')]&&_0x3d5cd6['attrs'][0x1]?_0x3d5cd6[_0x8ab4('0x5b')][0x1][_0x8ab4('0x5c')]:undefined)||[]},{'name':_0x8ab4('0x62'),'value':_0x3d5cd6['attrFontSize']||(_0x3d5cd6[_0x8ab4('0x5b')]&&_0x3d5cd6['attrs'][0x2]?_0x3d5cd6[_0x8ab4('0x5b')][0x2][_0x8ab4('0x5c')]:undefined)||0x14}];case _0x8ab4('0x66'):case _0x8ab4('0x67'):return[{'name':_0x8ab4('0x68'),'value':_0x3d5cd6[_0x8ab4('0x68')]||(_0x3d5cd6['attrs']&&_0x3d5cd6[_0x8ab4('0x5b')][0x0]?_0x3d5cd6[_0x8ab4('0x5b')][0x0][_0x8ab4('0x5c')]:undefined)||_0x8ab4('0x69')},{'name':'attrSerie2','value':_0x3d5cd6[_0x8ab4('0x6a')]||(_0x3d5cd6[_0x8ab4('0x5b')]&&_0x3d5cd6[_0x8ab4('0x5b')][0x1]?_0x3d5cd6[_0x8ab4('0x5b')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x3d5cd6[_0x8ab4('0x6b')]||(_0x3d5cd6['attrs']&&_0x3d5cd6[_0x8ab4('0x5b')][0x2]?_0x3d5cd6[_0x8ab4('0x5b')][0x2][_0x8ab4('0x5c')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x3d5cd6[_0x8ab4('0x65')]||(_0x3d5cd6[_0x8ab4('0x5b')]&&_0x3d5cd6[_0x8ab4('0x5b')][0x3]?_0x3d5cd6[_0x8ab4('0x5b')][0x3][_0x8ab4('0x5c')]:undefined)||[]}];case'web-report':return[{'name':_0x8ab4('0x6c'),'type':_0x3d5cd6['reportType']||(_0x3d5cd6[_0x8ab4('0x5b')]&&_0x3d5cd6[_0x8ab4('0x5b')][0x0]?_0x3d5cd6[_0x8ab4('0x5b')][0x0][_0x8ab4('0x31')]:undefined)||null,'value':_0x3d5cd6[_0x8ab4('0x6c')]||(_0x3d5cd6[_0x8ab4('0x5b')]&&_0x3d5cd6[_0x8ab4('0x5b')][0x0]?_0x3d5cd6[_0x8ab4('0x5b')][0x0]['value']:undefined)||null},{'name':_0x8ab4('0x6d'),'value':_0x3d5cd6[_0x8ab4('0x6d')]||(_0x3d5cd6['attrs']&&_0x3d5cd6['attrs'][0x1]?_0x3d5cd6[_0x8ab4('0x5b')][0x1][_0x8ab4('0x5c')]:undefined)||0x0}];default:return[];}}catch(_0x2a1fab){logger[_0x8ab4('0x2a')](_0x8ab4('0x6e'),JSON[_0x8ab4('0x6f')](_0x2a1fab));return[];}}exports['addItem']=function(_0x50c85a,_0x45a34a,_0x353683){if(_0x50c85a['body']['id']){delete _0x50c85a['body']['id'];}return db['Dashboard'][_0x8ab4('0x49')]({'where':{'id':_0x50c85a[_0x8ab4('0x52')]['id']}})[_0x8ab4('0x25')](handleEntityNotFound(_0x45a34a,null))[_0x8ab4('0x25')](function(_0x29b13a){if(_0x29b13a){_0x50c85a[_0x8ab4('0x4b')][_0x8ab4('0x70')]=_0x29b13a['id'];_0x50c85a[_0x8ab4('0x4b')][_0x8ab4('0x5b')]=widgetAttributes(_0x50c85a['body']);return db[_0x8ab4('0x71')][_0x8ab4('0x4a')](_0x50c85a['body']);}})[_0x8ab4('0x25')](respondWithResult(_0x45a34a,null))[_0x8ab4('0x44')](handleError(_0x45a34a,null));};exports['getItems']=function(_0x3c4733,_0x353638,_0x1f2014){var _0x375246={};var _0xb6d4fb={};var _0x14414a;var _0x5797ca;return db[_0x8ab4('0x2f')]['findOne']({'where':{'id':_0x3c4733[_0x8ab4('0x52')]['id']}})[_0x8ab4('0x25')](handleEntityNotFound(_0x353638,null))[_0x8ab4('0x25')](function(_0x3f99ca){if(_0x3f99ca){_0x14414a=_0x3f99ca;_0xb6d4fb['model']=_[_0x8ab4('0x35')](db[_0x8ab4('0x71')][_0x8ab4('0x53')]);_0xb6d4fb[_0x8ab4('0x34')]=_[_0x8ab4('0x35')](_0x3c4733[_0x8ab4('0x34')]);_0xb6d4fb[_0x8ab4('0x3d')]=_[_0x8ab4('0x36')](_0xb6d4fb[_0x8ab4('0x33')],_0xb6d4fb[_0x8ab4('0x34')]);_0x375246[_0x8ab4('0x37')]=_[_0x8ab4('0x36')](_0xb6d4fb[_0x8ab4('0x33')],qs[_0x8ab4('0x46')](_0x3c4733[_0x8ab4('0x34')][_0x8ab4('0x46')]));_0x375246[_0x8ab4('0x37')]=_0x375246[_0x8ab4('0x37')]['length']?_0x375246['attributes']:_0xb6d4fb['model'];_0x375246[_0x8ab4('0x3a')]=qs['sort'](_0x3c4733[_0x8ab4('0x34')][_0x8ab4('0x3b')]);_0x375246[_0x8ab4('0x3c')]=qs['filters'](_[_0x8ab4('0x3e')](_0x3c4733[_0x8ab4('0x34')],_0xb6d4fb['filters']));if(_0x3c4733[_0x8ab4('0x34')]['filter']){_0x375246['where']=_[_0x8ab4('0x3f')](_0x375246[_0x8ab4('0x3c')],{'$or':_[_0x8ab4('0x2e')](_0x375246[_0x8ab4('0x37')],function(_0x530670){var _0xa3d9e={};_0xa3d9e[_0x530670]={'$like':'%'+_0x3c4733['query'][_0x8ab4('0x41')]+'%'};return _0xa3d9e;})});}_0x375246=_[_0x8ab4('0x3f')]({},_0x375246,_0x3c4733[_0x8ab4('0x42')]);return _0x14414a[_0x8ab4('0x72')](_0x375246);}})['then'](function(_0x24a0a2){if(_0x24a0a2){_0x5797ca=_0x24a0a2[_0x8ab4('0x47')];if(!_0x3c4733['query']['hasOwnProperty'](_0x8ab4('0x39'))){_0x375246[_0x8ab4('0x1f')]=qs[_0x8ab4('0x1f')](_0x3c4733[_0x8ab4('0x34')]['limit']);_0x375246[_0x8ab4('0x1c')]=qs[_0x8ab4('0x1c')](_0x3c4733['query']['offset']);}return _0x14414a[_0x8ab4('0x72')](_0x375246);}})['then'](function(_0xf704fd){if(_0xf704fd){return _0xf704fd?{'count':_0x5797ca,'rows':_0xf704fd}:null;}})[_0x8ab4('0x25')](respondWithResult(_0x353638,null))[_0x8ab4('0x44')](handleError(_0x353638,null));}; \ No newline at end of file +var _0x717f=['moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./dashboard.socket','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','update','destroy','then','get','UserProfileResource','name','send','Dashboard','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','create','user','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','body','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','iframe','attrUrl','attrs','value','https://','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x58ea44,_0x512f53){var _0x31eb1d=function(_0x243848){while(--_0x243848){_0x58ea44['push'](_0x58ea44['shift']());}};_0x31eb1d(++_0x512f53);}(_0x717f,0x72));var _0xf717=function(_0x1135d1,_0x181470){_0x1135d1=_0x1135d1-0x0;var _0x46fd49=_0x717f[_0x1135d1];return _0x46fd49;};'use strict';var emlformat=require(_0xf717('0x0'));var rimraf=require(_0xf717('0x1'));var zipdir=require(_0xf717('0x2'));var jsonpatch=require(_0xf717('0x3'));var rp=require(_0xf717('0x4'));var moment=require(_0xf717('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf717('0x6'));var util=require(_0xf717('0x7'));var path=require(_0xf717('0x8'));var sox=require('sox');var csv=require(_0xf717('0x9'));var ejs=require(_0xf717('0xa'));var fs=require('fs');var fs_extra=require(_0xf717('0xb'));var _=require(_0xf717('0xc'));var squel=require(_0xf717('0xd'));var crypto=require('crypto');var jsforce=require(_0xf717('0xe'));var deskjs=require(_0xf717('0xf'));var toCsv=require(_0xf717('0x9'));var querystring=require('querystring');var Papa=require(_0xf717('0x10'));var Redis=require(_0xf717('0x11'));var authService=require(_0xf717('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf717('0x13'));var logger=require('../../config/logger')(_0xf717('0x14'));var utils=require(_0xf717('0x15'));var config=require(_0xf717('0x16'));var licenseUtil=require(_0xf717('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xf717('0x18')],{'host':_0xf717('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf717('0x1a'))['register'](socket);function respondWithStatusCode(_0x12a8fc,_0x358c18){_0x358c18=_0x358c18||0xcc;return function(_0x43a5e2){if(_0x43a5e2){return _0x12a8fc[_0xf717('0x1b')](_0x358c18);}return _0x12a8fc[_0xf717('0x1c')](_0x358c18)[_0xf717('0x1d')]();};}function respondWithResult(_0x2b39db,_0x4b14bf){_0x4b14bf=_0x4b14bf||0xc8;return function(_0x43ddea){if(_0x43ddea){return _0x2b39db[_0xf717('0x1c')](_0x4b14bf)[_0xf717('0x1e')](_0x43ddea);}};}function respondWithFilteredResult(_0x5d566f,_0x44b8c8){return function(_0x516267){if(_0x516267){var _0xb7c694=typeof _0x44b8c8['offset']==='undefined'&&typeof _0x44b8c8[_0xf717('0x1f')]===_0xf717('0x20');var _0x39d98b=_0x516267[_0xf717('0x21')];var _0x31b698=_0xb7c694?0x0:_0x44b8c8[_0xf717('0x22')];var _0x437766=_0xb7c694?_0x516267[_0xf717('0x21')]:_0x44b8c8[_0xf717('0x22')]+_0x44b8c8[_0xf717('0x1f')];var _0x130340;if(_0x437766>=_0x39d98b){_0x437766=_0x39d98b;_0x130340=0xc8;}else{_0x130340=0xce;}_0x5d566f['status'](_0x130340);return _0x5d566f['set'](_0xf717('0x23'),_0x31b698+'-'+_0x437766+'/'+_0x39d98b)['json'](_0x516267);}return null;};}function patchUpdates(_0x3a9a86){return function(_0x3fb902){try{jsonpatch[_0xf717('0x24')](_0x3fb902,_0x3a9a86,!![]);}catch(_0x2034ef){return BPromise[_0xf717('0x25')](_0x2034ef);}return _0x3fb902['save']();};}function saveUpdates(_0x597a3b,_0x1e73b8){return function(_0x37a8c9){if(_0x37a8c9){return _0x37a8c9[_0xf717('0x26')](_0x597a3b)['then'](function(_0x182d0b){return _0x182d0b;});}return null;};}function removeEntity(_0x178601,_0xa5ee6f){return function(_0x2506b3){if(_0x2506b3){return _0x2506b3[_0xf717('0x27')]()[_0xf717('0x28')](function(){var _0x32d732=_0x2506b3[_0xf717('0x29')]({'plain':!![]});var _0xbe90a1='CustomDashboards';return db[_0xf717('0x2a')]['destroy']({'where':{'type':_0xbe90a1,'resourceId':_0x32d732['id']}})[_0xf717('0x28')](function(){return _0x2506b3;});})[_0xf717('0x28')](function(){_0x178601[_0xf717('0x1c')](0xcc)[_0xf717('0x1d')]();});}};}function handleEntityNotFound(_0x3aae5e,_0x1bedab){return function(_0x5564c5){if(!_0x5564c5){_0x3aae5e['sendStatus'](0x194);}return _0x5564c5;};}function handleError(_0xf06710,_0x466a06){_0x466a06=_0x466a06||0x1f4;return function(_0x469743){logger['error'](_0x469743['stack']);if(_0x469743[_0xf717('0x2b')]){delete _0x469743[_0xf717('0x2b')];}_0xf06710[_0xf717('0x1c')](_0x466a06)[_0xf717('0x2c')](_0x469743);};}exports['index']=function(_0x4fba86,_0x214806){var _0x4690d0={},_0x32bf3d={},_0x5aaba6={'count':0x0,'rows':[]};var _0x2a6ba8=_['map'](db[_0xf717('0x2d')]['rawAttributes'],function(_0x57bd97){return{'name':_0x57bd97['fieldName'],'type':_0x57bd97[_0xf717('0x2e')][_0xf717('0x2f')]};});_0x32bf3d[_0xf717('0x30')]=_['map'](_0x2a6ba8,_0xf717('0x2b'));_0x32bf3d['query']=_[_0xf717('0x31')](_0x4fba86['query']);_0x32bf3d[_0xf717('0x32')]=_[_0xf717('0x33')](_0x32bf3d[_0xf717('0x30')],_0x32bf3d[_0xf717('0x34')]);_0x4690d0[_0xf717('0x35')]=_[_0xf717('0x33')](_0x32bf3d[_0xf717('0x30')],qs['fields'](_0x4fba86[_0xf717('0x34')][_0xf717('0x36')]));_0x4690d0[_0xf717('0x35')]=_0x4690d0[_0xf717('0x35')][_0xf717('0x37')]?_0x4690d0[_0xf717('0x35')]:_0x32bf3d[_0xf717('0x30')];if(!_0x4fba86[_0xf717('0x34')]['hasOwnProperty'](_0xf717('0x38'))){_0x4690d0[_0xf717('0x1f')]=qs['limit'](_0x4fba86[_0xf717('0x34')][_0xf717('0x1f')]);_0x4690d0['offset']=qs['offset'](_0x4fba86[_0xf717('0x34')][_0xf717('0x22')]);}_0x4690d0[_0xf717('0x39')]=qs[_0xf717('0x3a')](_0x4fba86[_0xf717('0x34')][_0xf717('0x3a')]);_0x4690d0['where']=qs[_0xf717('0x32')](_[_0xf717('0x3b')](_0x4fba86[_0xf717('0x34')],_0x32bf3d[_0xf717('0x32')]),_0x2a6ba8);if(_0x4fba86[_0xf717('0x34')][_0xf717('0x3c')]){_0x4690d0[_0xf717('0x3d')]=_[_0xf717('0x3e')](_0x4690d0[_0xf717('0x3d')],{'$or':_[_0xf717('0x3f')](_0x2a6ba8,function(_0x57c0cf){if(_0x57c0cf[_0xf717('0x2e')]!==_0xf717('0x40')){var _0x5e8913={};_0x5e8913[_0x57c0cf[_0xf717('0x2b')]]={'$like':'%'+_0x4fba86[_0xf717('0x34')][_0xf717('0x3c')]+'%'};return _0x5e8913;}})});}_0x4690d0=_[_0xf717('0x3e')]({},_0x4690d0,_0x4fba86[_0xf717('0x41')]);var _0x581023={'where':_0x4690d0[_0xf717('0x3d')]};return db[_0xf717('0x2d')][_0xf717('0x21')](_0x581023)[_0xf717('0x28')](function(_0x38edb8){_0x5aaba6[_0xf717('0x21')]=_0x38edb8;if(_0x4fba86[_0xf717('0x34')]['includeAll']){_0x4690d0['include']=[{'all':!![]}];}return db['Dashboard'][_0xf717('0x42')](_0x4690d0);})['then'](function(_0x5c4174){_0x5aaba6[_0xf717('0x43')]=_0x5c4174;return _0x5aaba6;})[_0xf717('0x28')](respondWithFilteredResult(_0x214806,_0x4690d0))[_0xf717('0x44')](handleError(_0x214806,null));};exports[_0xf717('0x45')]=function(_0x16a68e,_0x50b39a){var _0x16c89f={'raw':![],'where':{'id':_0x16a68e[_0xf717('0x46')]['id']}},_0x519f78={};_0x519f78[_0xf717('0x30')]=_['keys'](db[_0xf717('0x2d')][_0xf717('0x47')]);_0x519f78['query']=_[_0xf717('0x31')](_0x16a68e[_0xf717('0x34')]);_0x519f78[_0xf717('0x32')]=_[_0xf717('0x33')](_0x519f78[_0xf717('0x30')],_0x519f78['query']);_0x16c89f[_0xf717('0x35')]=_[_0xf717('0x33')](_0x519f78[_0xf717('0x30')],qs[_0xf717('0x36')](_0x16a68e[_0xf717('0x34')][_0xf717('0x36')]));_0x16c89f[_0xf717('0x35')]=_0x16c89f[_0xf717('0x35')]['length']?_0x16c89f['attributes']:_0x519f78[_0xf717('0x30')];if(_0x16a68e[_0xf717('0x34')][_0xf717('0x48')]){_0x16c89f[_0xf717('0x49')]=[{'all':!![]}];}_0x16c89f=_[_0xf717('0x3e')]({},_0x16c89f,_0x16a68e[_0xf717('0x41')]);return db[_0xf717('0x2d')][_0xf717('0x4a')](_0x16c89f)[_0xf717('0x28')](handleEntityNotFound(_0x50b39a,null))[_0xf717('0x28')](respondWithResult(_0x50b39a,null))[_0xf717('0x44')](handleError(_0x50b39a,null));};exports[_0xf717('0x4b')]=function(_0x49a161,_0x2a38e5){return db[_0xf717('0x2d')][_0xf717('0x4b')](_0x49a161['body'],{})[_0xf717('0x28')](function(_0x2a4043){var _0x1223a1=_0x49a161[_0xf717('0x4c')][_0xf717('0x29')]({'plain':!![]});if(!_0x1223a1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1223a1['role']===_0xf717('0x4c')){var _0x2d1de5=_0x2a4043[_0xf717('0x29')]({'plain':!![]});var _0x27d9e0=_0xf717('0x4d');return db[_0xf717('0x4e')][_0xf717('0x4a')]({'where':{'name':_0x27d9e0,'userProfileId':_0x1223a1[_0xf717('0x4f')]},'raw':!![]})['then'](function(_0x4b0c0c){if(_0x4b0c0c&&_0x4b0c0c[_0xf717('0x50')]===0x0){return db[_0xf717('0x2a')]['create']({'name':_0x2d1de5[_0xf717('0x2b')],'resourceId':_0x2d1de5['id'],'type':_0x4b0c0c[_0xf717('0x2b')],'sectionId':_0x4b0c0c['id']},{})[_0xf717('0x28')](function(){return _0x2a4043;});}else{return _0x2a4043;}})['catch'](function(_0xc45f34){logger[_0xf717('0x51')](_0xf717('0x52'),_0xc45f34);throw _0xc45f34;});}return _0x2a4043;})[_0xf717('0x28')](respondWithResult(_0x2a38e5,0xc9))[_0xf717('0x44')](handleError(_0x2a38e5,null));};exports['clone']=function(_0x1f5666,_0x579c6a){var _0x68d830={'where':{'id':_0x1f5666[_0xf717('0x46')]['id']}},_0x194216={};_0x194216[_0xf717('0x30')]=_[_0xf717('0x31')](db[_0xf717('0x2d')][_0xf717('0x47')]);_0x68d830[_0xf717('0x35')]=_[_0xf717('0x33')](_0x194216[_0xf717('0x30')],qs[_0xf717('0x36')](_0x1f5666[_0xf717('0x34')][_0xf717('0x36')]));_0x68d830[_0xf717('0x35')]=_0x68d830[_0xf717('0x35')][_0xf717('0x37')]?_0x68d830['attributes']:_0x194216['model'];if(_0x1f5666[_0xf717('0x34')]['includeAll']){_0x68d830[_0xf717('0x49')]=[{'all':!![]}];}_0x68d830=_[_0xf717('0x3e')]({},_0x68d830,_0x1f5666[_0xf717('0x41')]);return db[_0xf717('0x2d')][_0xf717('0x4a')](_0x68d830)['then'](handleEntityNotFound(_0x579c6a,null))[_0xf717('0x28')](function(_0x8a3af0){if(_0x8a3af0){var _0x32b01a=_0x8a3af0['get']({'plain':!![]});_0x32b01a=qs['omit'](_0x32b01a,['id',_0xf717('0x53'),_0xf717('0x54')]);_0x1f5666[_0xf717('0x55')]=_[_0xf717('0x56')](_0x1f5666[_0xf717('0x55')],['id',_0xf717('0x53'),'updatedAt']);return db[_0xf717('0x2d')][_0xf717('0x4b')](_['merge'](_0x32b01a,_0x1f5666['body']),{'include':_0x1f5666['query'][_0xf717('0x48')]?[{'all':!![]}]:undefined})['then'](function(_0x41d34e){var _0x17ed20=_0x1f5666['user']['get']({'plain':!![]});if(!_0x17ed20)throw new Error(_0xf717('0x57'));if(_0x17ed20[_0xf717('0x58')]===_0xf717('0x4c')){var _0x2e7d38=_0x41d34e[_0xf717('0x29')]({'plain':!![]});var _0x5c8de1='CustomDashboards';return db[_0xf717('0x4e')][_0xf717('0x4a')]({'where':{'name':_0x5c8de1,'userProfileId':_0x17ed20[_0xf717('0x4f')]},'raw':!![]})[_0xf717('0x28')](function(_0x53f974){if(_0x53f974&&_0x53f974[_0xf717('0x50')]===0x0){return db['UserProfileResource'][_0xf717('0x4b')]({'name':_0x2e7d38[_0xf717('0x2b')],'resourceId':_0x2e7d38['id'],'type':_0x53f974['name'],'sectionId':_0x53f974['id']},{})['then'](function(){return _0x41d34e;});}else{return _0x41d34e;}})['catch'](function(_0x5e993a){logger[_0xf717('0x51')](_0xf717('0x52'),_0x5e993a);throw _0x5e993a;});}return _0x41d34e;});}})[_0xf717('0x28')](respondWithResult(_0x579c6a,0xc9))[_0xf717('0x44')](handleError(_0x579c6a,null));};exports[_0xf717('0x26')]=function(_0x27f898,_0x39d51c){if(_0x27f898[_0xf717('0x55')]['id']){delete _0x27f898['body']['id'];}return db[_0xf717('0x2d')]['find']({'where':{'id':_0x27f898['params']['id']}})[_0xf717('0x28')](handleEntityNotFound(_0x39d51c,null))['then'](saveUpdates(_0x27f898[_0xf717('0x55')],null))['then'](respondWithResult(_0x39d51c,null))[_0xf717('0x44')](handleError(_0x39d51c,null));};exports[_0xf717('0x27')]=function(_0x1b93c9,_0x5e62b8){return db[_0xf717('0x2d')][_0xf717('0x4a')]({'where':{'id':_0x1b93c9[_0xf717('0x46')]['id']}})['then'](handleEntityNotFound(_0x5e62b8,null))[_0xf717('0x28')](removeEntity(_0x5e62b8,null))[_0xf717('0x44')](handleError(_0x5e62b8,null));};function widgetAttributes(_0x4ef4be){try{switch(_0x4ef4be[_0xf717('0x2e')]){case _0xf717('0x59'):return[{'name':_0xf717('0x5a'),'value':_0x4ef4be[_0xf717('0x5a')]||(_0x4ef4be[_0xf717('0x5b')]&&_0x4ef4be[_0xf717('0x5b')][0x0]?_0x4ef4be[_0xf717('0x5b')][0x0][_0xf717('0x5c')]:undefined)||_0xf717('0x5d')}];case'custom':return[{'name':_0xf717('0x5e'),'value':_0x4ef4be[_0xf717('0x5e')]||(_0x4ef4be[_0xf717('0x5b')]&&_0x4ef4be[_0xf717('0x5b')][0x0]?_0x4ef4be['attrs'][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0xf717('0x5f'),'value':_0x4ef4be[_0xf717('0x5f')]||(_0x4ef4be[_0xf717('0x5b')]&&_0x4ef4be[_0xf717('0x5b')][0x0]?_0x4ef4be[_0xf717('0x5b')][0x0][_0xf717('0x5c')]:undefined)||_0xf717('0x60')},{'name':_0xf717('0x61'),'value':_0x4ef4be[_0xf717('0x61')]||(_0x4ef4be[_0xf717('0x5b')]&&_0x4ef4be[_0xf717('0x5b')][0x1]?_0x4ef4be[_0xf717('0x5b')][0x1][_0xf717('0x5c')]:undefined)||_0xf717('0x62')},{'name':_0xf717('0x63'),'value':_0x4ef4be[_0xf717('0x63')]||(_0x4ef4be['attrs']&&_0x4ef4be[_0xf717('0x5b')][0x2]?_0x4ef4be[_0xf717('0x5b')][0x2][_0xf717('0x5c')]:undefined)||0xc}];case _0xf717('0x64'):return[{'name':_0xf717('0x65'),'value':_0x4ef4be[_0xf717('0x65')]||(_0x4ef4be[_0xf717('0x5b')]&&_0x4ef4be[_0xf717('0x5b')][0x0]?_0x4ef4be['attrs'][0x0][_0xf717('0x5c')]:undefined)||_0xf717('0x66')},{'name':_0xf717('0x67'),'value':_0x4ef4be[_0xf717('0x67')]||(_0x4ef4be[_0xf717('0x5b')]&&_0x4ef4be[_0xf717('0x5b')][0x1]?_0x4ef4be[_0xf717('0x5b')][0x1][_0xf717('0x5c')]:undefined)||[]},{'name':_0xf717('0x63'),'value':_0x4ef4be['attrFontSize']||(_0x4ef4be[_0xf717('0x5b')]&&_0x4ef4be[_0xf717('0x5b')][0x2]?_0x4ef4be[_0xf717('0x5b')][0x2][_0xf717('0x5c')]:undefined)||0x14}];case _0xf717('0x68'):case'pie-chart':return[{'name':_0xf717('0x69'),'value':_0x4ef4be['attrSerie1']||(_0x4ef4be[_0xf717('0x5b')]&&_0x4ef4be[_0xf717('0x5b')][0x0]?_0x4ef4be['attrs'][0x0][_0xf717('0x5c')]:undefined)||_0xf717('0x66')},{'name':_0xf717('0x6a'),'value':_0x4ef4be[_0xf717('0x6a')]||(_0x4ef4be[_0xf717('0x5b')]&&_0x4ef4be[_0xf717('0x5b')][0x1]?_0x4ef4be[_0xf717('0x5b')][0x1]['value']:undefined)||null},{'name':_0xf717('0x6b'),'value':_0x4ef4be['attrSerie3']||(_0x4ef4be[_0xf717('0x5b')]&&_0x4ef4be[_0xf717('0x5b')][0x2]?_0x4ef4be[_0xf717('0x5b')][0x2][_0xf717('0x5c')]:undefined)||null},{'name':_0xf717('0x67'),'value':_0x4ef4be['attrVoiceQueues']||(_0x4ef4be[_0xf717('0x5b')]&&_0x4ef4be[_0xf717('0x5b')][0x3]?_0x4ef4be['attrs'][0x3][_0xf717('0x5c')]:undefined)||[]}];case'web-report':return[{'name':'attrReport','type':_0x4ef4be[_0xf717('0x6c')]||(_0x4ef4be[_0xf717('0x5b')]&&_0x4ef4be[_0xf717('0x5b')][0x0]?_0x4ef4be[_0xf717('0x5b')][0x0][_0xf717('0x2e')]:undefined)||null,'value':_0x4ef4be[_0xf717('0x6d')]||(_0x4ef4be[_0xf717('0x5b')]&&_0x4ef4be[_0xf717('0x5b')][0x0]?_0x4ef4be['attrs'][0x0][_0xf717('0x5c')]:undefined)||null},{'name':_0xf717('0x6e'),'value':_0x4ef4be[_0xf717('0x6e')]||(_0x4ef4be[_0xf717('0x5b')]&&_0x4ef4be[_0xf717('0x5b')][0x1]?_0x4ef4be['attrs'][0x1][_0xf717('0x5c')]:undefined)||0x0}];default:return[];}}catch(_0x534c4d){logger[_0xf717('0x51')](_0xf717('0x6f'),JSON[_0xf717('0x70')](_0x534c4d));return[];}}exports[_0xf717('0x71')]=function(_0x402664,_0x1eede7,_0x5e925b){if(_0x402664['body']['id']){delete _0x402664[_0xf717('0x55')]['id'];}return db['Dashboard'][_0xf717('0x4a')]({'where':{'id':_0x402664['params']['id']}})[_0xf717('0x28')](handleEntityNotFound(_0x1eede7,null))[_0xf717('0x28')](function(_0x2ce599){if(_0x2ce599){_0x402664['body'][_0xf717('0x72')]=_0x2ce599['id'];_0x402664[_0xf717('0x55')][_0xf717('0x5b')]=widgetAttributes(_0x402664[_0xf717('0x55')]);return db[_0xf717('0x73')][_0xf717('0x4b')](_0x402664[_0xf717('0x55')]);}})[_0xf717('0x28')](respondWithResult(_0x1eede7,null))['catch'](handleError(_0x1eede7,null));};exports[_0xf717('0x74')]=function(_0x257d7c,_0x573cab,_0x24ba26){var _0x9a6227={};var _0x423a2c={};var _0x296d2e;var _0x5bc5e4;return db['Dashboard'][_0xf717('0x75')]({'where':{'id':_0x257d7c[_0xf717('0x46')]['id']}})[_0xf717('0x28')](handleEntityNotFound(_0x573cab,null))[_0xf717('0x28')](function(_0x56dcd3){if(_0x56dcd3){_0x296d2e=_0x56dcd3;_0x423a2c[_0xf717('0x30')]=_[_0xf717('0x31')](db[_0xf717('0x73')][_0xf717('0x47')]);_0x423a2c[_0xf717('0x34')]=_[_0xf717('0x31')](_0x257d7c['query']);_0x423a2c[_0xf717('0x32')]=_['intersection'](_0x423a2c[_0xf717('0x30')],_0x423a2c[_0xf717('0x34')]);_0x9a6227[_0xf717('0x35')]=_[_0xf717('0x33')](_0x423a2c[_0xf717('0x30')],qs[_0xf717('0x36')](_0x257d7c[_0xf717('0x34')][_0xf717('0x36')]));_0x9a6227[_0xf717('0x35')]=_0x9a6227[_0xf717('0x35')][_0xf717('0x37')]?_0x9a6227[_0xf717('0x35')]:_0x423a2c[_0xf717('0x30')];_0x9a6227[_0xf717('0x39')]=qs[_0xf717('0x3a')](_0x257d7c['query'][_0xf717('0x3a')]);_0x9a6227[_0xf717('0x3d')]=qs['filters'](_[_0xf717('0x3b')](_0x257d7c[_0xf717('0x34')],_0x423a2c['filters']));if(_0x257d7c[_0xf717('0x34')]['filter']){_0x9a6227[_0xf717('0x3d')]=_[_0xf717('0x3e')](_0x9a6227[_0xf717('0x3d')],{'$or':_[_0xf717('0x3f')](_0x9a6227[_0xf717('0x35')],function(_0x2d5d3d){var _0x900007={};_0x900007[_0x2d5d3d]={'$like':'%'+_0x257d7c['query'][_0xf717('0x3c')]+'%'};return _0x900007;})});}_0x9a6227=_[_0xf717('0x3e')]({},_0x9a6227,_0x257d7c[_0xf717('0x41')]);return _0x296d2e[_0xf717('0x74')](_0x9a6227);}})[_0xf717('0x28')](function(_0x1f4d11){if(_0x1f4d11){_0x5bc5e4=_0x1f4d11[_0xf717('0x37')];if(!_0x257d7c[_0xf717('0x34')][_0xf717('0x76')](_0xf717('0x38'))){_0x9a6227[_0xf717('0x1f')]=qs[_0xf717('0x1f')](_0x257d7c['query'][_0xf717('0x1f')]);_0x9a6227[_0xf717('0x22')]=qs[_0xf717('0x22')](_0x257d7c[_0xf717('0x34')][_0xf717('0x22')]);}return _0x296d2e[_0xf717('0x74')](_0x9a6227);}})[_0xf717('0x28')](function(_0x19fa9b){if(_0x19fa9b){return _0x19fa9b?{'count':_0x5bc5e4,'rows':_0x19fa9b}:null;}})['then'](respondWithResult(_0x573cab,null))[_0xf717('0x44')](handleError(_0x573cab,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 6590697..01083b2 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 _0x6daf=['Dashboard','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x274482,_0x11c45b){var _0x20a5b7=function(_0x574478){while(--_0x574478){_0x274482['push'](_0x274482['shift']());}};_0x20a5b7(++_0x11c45b);}(_0x6daf,0x115));var _0xf6da=function(_0x53ab34,_0x17ac07){_0x53ab34=_0x53ab34-0x0;var _0x4f6d9f=_0x6daf[_0x53ab34];return _0x4f6d9f;};'use strict';var EventEmitter=require(_0xf6da('0x0'));var Dashboard=require(_0xf6da('0x1'))['db'][_0xf6da('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xf6da('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf6da('0x4'),'afterDestroy':'remove'};function emitEvent(_0x133bed){return function(_0x5a78bc,_0xedd08c,_0x6f240e){DashboardEvents['emit'](_0x133bed+':'+_0x5a78bc['id'],_0x5a78bc);DashboardEvents[_0xf6da('0x5')](_0x133bed,_0x5a78bc);_0x6f240e(null);};}for(var e in events){if(events[_0xf6da('0x6')](e)){var event=events[e];Dashboard[_0xf6da('0x7')](e,emitEvent(event));}}module[_0xf6da('0x8')]=DashboardEvents; \ No newline at end of file +var _0xd718=['../../mysqldb','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x3231ce,_0x1ccd99){var _0x5b999d=function(_0x2f9aa0){while(--_0x2f9aa0){_0x3231ce['push'](_0x3231ce['shift']());}};_0x5b999d(++_0x1ccd99);}(_0xd718,0x1dc));var _0x8d71=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xd718[_0x1c8c28];return _0x1f59b4;};'use strict';var EventEmitter=require(_0x8d71('0x0'));var Dashboard=require(_0x8d71('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x8d71('0x2')](0x0);var events={'afterCreate':_0x8d71('0x3'),'afterUpdate':_0x8d71('0x4'),'afterDestroy':_0x8d71('0x5')};function emitEvent(_0x5391aa){return function(_0x518257,_0x55b022,_0x55a27b){DashboardEvents[_0x8d71('0x6')](_0x5391aa+':'+_0x518257['id'],_0x518257);DashboardEvents[_0x8d71('0x6')](_0x5391aa,_0x518257);_0x55a27b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x8d71('0x7')](e,emitEvent(event));}}module[_0x8d71('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 41e54b0..36f668d 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 _0x5000=['moment','bluebird','request-promise','path','rimraf','exports','define','Dashboard','dashboards','lodash','util','api'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x5000,0x1c5));var _0x0500=function(_0x1cbbc6,_0x15b420){_0x1cbbc6=_0x1cbbc6-0x0;var _0x5686a5=_0x5000[_0x1cbbc6];return _0x5686a5;};'use strict';var _=require(_0x0500('0x0'));var util=require(_0x0500('0x1'));var logger=require('../../config/logger')(_0x0500('0x2'));var moment=require(_0x0500('0x3'));var BPromise=require(_0x0500('0x4'));var rp=require(_0x0500('0x5'));var fs=require('fs');var path=require(_0x0500('0x6'));var rimraf=require(_0x0500('0x7'));var config=require('../../config/environment');var attributes=require('./dashboard.attributes');module[_0x0500('0x8')]=function(_0x5991af,_0x772836){return _0x5991af[_0x0500('0x9')](_0x0500('0xa'),attributes,{'tableName':_0x0500('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe3f3=['request-promise','path','rimraf','../../config/environment','Dashboard','dashboards','lodash','util','../../config/logger','api','moment'];(function(_0x124f68,_0x506449){var _0x4118d4=function(_0x2a73a1){while(--_0x2a73a1){_0x124f68['push'](_0x124f68['shift']());}};_0x4118d4(++_0x506449);}(_0xe3f3,0xed));var _0x3e3f=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xe3f3[_0x9c2427];return _0x51984f;};'use strict';var _=require(_0x3e3f('0x0'));var util=require(_0x3e3f('0x1'));var logger=require(_0x3e3f('0x2'))(_0x3e3f('0x3'));var moment=require(_0x3e3f('0x4'));var BPromise=require('bluebird');var rp=require(_0x3e3f('0x5'));var fs=require('fs');var path=require(_0x3e3f('0x6'));var rimraf=require(_0x3e3f('0x7'));var config=require(_0x3e3f('0x8'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x5e6f11,_0x3f3536){return _0x5e6f11['define'](_0x3e3f('0x9'),attributes,{'tableName':_0x3e3f('0xa'),'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 c236aff..70d1b12 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 _0x40a4=['http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0x40a4,0x88));var _0x440a=function(_0x1f55ab,_0x3525ed){_0x1f55ab=_0x1f55ab-0x0;var _0x5e7fda=_0x40a4[_0x1f55ab];return _0x5e7fda;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x440a('0x0'));var BPromise=require('bluebird');var rs=require(_0x440a('0x1'));var fs=require('fs');var Redis=require(_0x440a('0x2'));var db=require(_0x440a('0x3'))['db'];var utils=require(_0x440a('0x4'));var logger=require(_0x440a('0x5'))(_0x440a('0x6'));var config=require('../../config/environment');var jayson=require(_0x440a('0x7'));var client=jayson[_0x440a('0x8')][_0x440a('0x9')]({'port':0x232a});config[_0x440a('0xa')]=_[_0x440a('0xb')](config['redis'],{'host':_0x440a('0xc'),'port':0x18eb});var socket=require(_0x440a('0xd'))(new Redis(config[_0x440a('0xa')]));require(_0x440a('0xe'))[_0x440a('0xf')](socket);function respondWithRpcPromise(_0x427d5d,_0x1be597,_0x55c529){return new BPromise(function(_0x42e5a7,_0x4fdec7){return client[_0x440a('0x10')](_0x427d5d,_0x55c529)[_0x440a('0x11')](function(_0x3b54dc){logger[_0x440a('0x12')](_0x440a('0x13'),_0x1be597,'request\x20sent');logger[_0x440a('0x14')](_0x440a('0x15'),_0x1be597,_0x440a('0x16'),JSON[_0x440a('0x17')](_0x3b54dc));if(_0x3b54dc[_0x440a('0x18')]){if(_0x3b54dc[_0x440a('0x18')][_0x440a('0x19')]===0x1f4){logger['error'](_0x440a('0x13'),_0x1be597,_0x3b54dc[_0x440a('0x18')]['message']);return _0x4fdec7(_0x3b54dc[_0x440a('0x18')][_0x440a('0x1a')]);}logger[_0x440a('0x18')](_0x440a('0x13'),_0x1be597,_0x3b54dc['error'][_0x440a('0x1a')]);return _0x42e5a7(_0x3b54dc[_0x440a('0x18')]['message']);}else{logger[_0x440a('0x12')]('Dashboard,\x20%s,\x20%s',_0x1be597,_0x440a('0x16'));_0x42e5a7(_0x3b54dc[_0x440a('0x1b')][_0x440a('0x1a')]);}})[_0x440a('0x1c')](function(_0x62797a){logger[_0x440a('0x18')](_0x440a('0x13'),_0x1be597,_0x62797a);_0x4fdec7(_0x62797a);});});} \ No newline at end of file +var _0x3871=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./dashboard.socket','register','request','then','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3871,0x1e6));var _0x1387=function(_0x50582c,_0x12bbc1){_0x50582c=_0x50582c-0x0;var _0x41eef9=_0x3871[_0x50582c];return _0x41eef9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1387('0x0'));var BPromise=require(_0x1387('0x1'));var rs=require(_0x1387('0x2'));var fs=require('fs');var Redis=require(_0x1387('0x3'));var db=require(_0x1387('0x4'))['db'];var utils=require(_0x1387('0x5'));var logger=require('../../config/logger')(_0x1387('0x6'));var config=require(_0x1387('0x7'));var jayson=require(_0x1387('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x1387('0x9')]=_[_0x1387('0xa')](config[_0x1387('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x1387('0xb'))(new Redis(config[_0x1387('0x9')]));require(_0x1387('0xc'))[_0x1387('0xd')](socket);function respondWithRpcPromise(_0x228d83,_0x1b57a9,_0x1c11cd){return new BPromise(function(_0x464050,_0x5e90e7){return client[_0x1387('0xe')](_0x228d83,_0x1c11cd)[_0x1387('0xf')](function(_0x344881){logger['info'](_0x1387('0x10'),_0x1b57a9,'request\x20sent');logger[_0x1387('0x11')](_0x1387('0x12'),_0x1b57a9,_0x1387('0x13'),JSON[_0x1387('0x14')](_0x344881));if(_0x344881[_0x1387('0x15')]){if(_0x344881[_0x1387('0x15')][_0x1387('0x16')]===0x1f4){logger[_0x1387('0x15')](_0x1387('0x10'),_0x1b57a9,_0x344881[_0x1387('0x15')][_0x1387('0x17')]);return _0x5e90e7(_0x344881[_0x1387('0x15')]['message']);}logger[_0x1387('0x15')](_0x1387('0x10'),_0x1b57a9,_0x344881[_0x1387('0x15')]['message']);return _0x464050(_0x344881[_0x1387('0x15')][_0x1387('0x17')]);}else{logger[_0x1387('0x18')](_0x1387('0x10'),_0x1b57a9,_0x1387('0x13'));_0x464050(_0x344881[_0x1387('0x19')][_0x1387('0x17')]);}})[_0x1387('0x1a')](function(_0xf3032b){logger[_0x1387('0x15')](_0x1387('0x10'),_0x1b57a9,_0xf3032b);_0x5e90e7(_0xf3032b);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 54d7cf0..bf7efa8 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 _0x46f9=['dashboard:','remove','update','emit','length'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x46f9,0x187));var _0x946f=function(_0x483eb7,_0x326f1d){_0x483eb7=_0x483eb7-0x0;var _0x12f529=_0x46f9[_0x483eb7];return _0x12f529;};'use strict';var DashboardEvents=require('./dashboard.events');var events=['save',_0x946f('0x0'),_0x946f('0x1')];function createListener(_0x20daf9,_0x5d7a58){return function(_0x1d3965){_0x5d7a58[_0x946f('0x2')](_0x20daf9,_0x1d3965);};}function removeListener(_0x5bbf81,_0x570d74){return function(){DashboardEvents['removeListener'](_0x5bbf81,_0x570d74);};}exports['register']=function(_0x5a53e7){for(var _0x71412=0x0,_0x5168ca=events[_0x946f('0x3')];_0x71412<_0x5168ca;_0x71412++){var _0x468aff=events[_0x71412];var _0x3ed62c=createListener(_0x946f('0x4')+_0x468aff,_0x5a53e7);DashboardEvents['on'](_0x468aff,_0x3ed62c);}}; \ No newline at end of file +var _0x89cc=['register','length','dashboard:','./dashboard.events','save','remove','update','emit','removeListener'];(function(_0x27e811,_0x20137c){var _0x1627fa=function(_0x4498ca){while(--_0x4498ca){_0x27e811['push'](_0x27e811['shift']());}};_0x1627fa(++_0x20137c);}(_0x89cc,0x11a));var _0xc89c=function(_0x2a3857,_0x22fb1d){_0x2a3857=_0x2a3857-0x0;var _0x1ac734=_0x89cc[_0x2a3857];return _0x1ac734;};'use strict';var DashboardEvents=require(_0xc89c('0x0'));var events=[_0xc89c('0x1'),_0xc89c('0x2'),_0xc89c('0x3')];function createListener(_0x243d87,_0x4b2d55){return function(_0x464539){_0x4b2d55[_0xc89c('0x4')](_0x243d87,_0x464539);};}function removeListener(_0x33c4f2,_0x2946e0){return function(){DashboardEvents[_0xc89c('0x5')](_0x33c4f2,_0x2946e0);};}exports[_0xc89c('0x6')]=function(_0x5dc812){for(var _0x4bc31d=0x0,_0x170d17=events[_0xc89c('0x7')];_0x4bc31d<_0x170d17;_0x4bc31d++){var _0x4e380e=events[_0x4bc31d];var _0x894d5a=createListener(_0xc89c('0x8')+_0x4e380e,_0x5dc812);DashboardEvents['on'](_0x4e380e,_0x894d5a);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 094d078..64598db 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 _0x40ff=['/:id/items','post','create','/:id/clone','addItem','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show'];(function(_0x373cc1,_0x396cf7){var _0x263da2=function(_0x5af3d3){while(--_0x5af3d3){_0x373cc1['push'](_0x373cc1['shift']());}};_0x263da2(++_0x396cf7);}(_0x40ff,0x1a7));var _0xf40f=function(_0xa0ba6a,_0x4094dd){_0xa0ba6a=_0xa0ba6a-0x0;var _0x4450ed=_0x40ff[_0xa0ba6a];return _0x4450ed;};'use strict';var multer=require(_0xf40f('0x0'));var util=require(_0xf40f('0x1'));var path=require(_0xf40f('0x2'));var timeout=require('connect-timeout');var express=require(_0xf40f('0x3'));var router=express[_0xf40f('0x4')]();var fs_extra=require(_0xf40f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf40f('0x6'));var config=require(_0xf40f('0x7'));var controller=require(_0xf40f('0x8'));router[_0xf40f('0x9')]('/',auth[_0xf40f('0xa')](),controller[_0xf40f('0xb')]);router['get'](_0xf40f('0xc'),auth[_0xf40f('0xa')](),controller[_0xf40f('0xd')]);router['get'](_0xf40f('0xe'),auth[_0xf40f('0xa')](),controller['getItems']);router[_0xf40f('0xf')]('/',auth[_0xf40f('0xa')](),controller[_0xf40f('0x10')]);router[_0xf40f('0xf')](_0xf40f('0x11'),auth[_0xf40f('0xa')](),controller['clone']);router[_0xf40f('0xf')](_0xf40f('0xe'),auth['isAuthenticated'](),controller[_0xf40f('0x12')]);router['put'](_0xf40f('0xc'),auth[_0xf40f('0xa')](),controller['update']);router['delete'](_0xf40f('0xc'),auth[_0xf40f('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb764=['fs-extra','../../components/interaction/service','./dashboard.controller','isAuthenticated','index','get','show','/:id/items','getItems','post','/:id/clone','clone','addItem','put','update','delete','/:id','destroy','exports','util','connect-timeout','express','Router'];(function(_0x3163e3,_0x7dfc4b){var _0x2e3388=function(_0x2e139f){while(--_0x2e139f){_0x3163e3['push'](_0x3163e3['shift']());}};_0x2e3388(++_0x7dfc4b);}(_0xb764,0x1b1));var _0x4b76=function(_0xffdd4,_0x56a340){_0xffdd4=_0xffdd4-0x0;var _0x5f57c3=_0xb764[_0xffdd4];return _0x5f57c3;};'use strict';var multer=require('multer');var util=require(_0x4b76('0x0'));var path=require('path');var timeout=require(_0x4b76('0x1'));var express=require(_0x4b76('0x2'));var router=express[_0x4b76('0x3')]();var fs_extra=require(_0x4b76('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4b76('0x5'));var config=require('../../config/environment');var controller=require(_0x4b76('0x6'));router['get']('/',auth[_0x4b76('0x7')](),controller[_0x4b76('0x8')]);router[_0x4b76('0x9')]('/:id',auth[_0x4b76('0x7')](),controller[_0x4b76('0xa')]);router[_0x4b76('0x9')](_0x4b76('0xb'),auth[_0x4b76('0x7')](),controller[_0x4b76('0xc')]);router[_0x4b76('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x4b76('0xe'),auth[_0x4b76('0x7')](),controller[_0x4b76('0xf')]);router[_0x4b76('0xd')](_0x4b76('0xb'),auth[_0x4b76('0x7')](),controller[_0x4b76('0x10')]);router[_0x4b76('0x11')]('/:id',auth[_0x4b76('0x7')](),controller[_0x4b76('0x12')]);router[_0x4b76('0x13')](_0x4b76('0x14'),auth[_0x4b76('0x7')](),controller[_0x4b76('0x15')]);module[_0x4b76('0x16')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 32d7a10..3ed56fc 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 _0x524e=['exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','lodash'];(function(_0x57ae01,_0x5757ba){var _0x4856ba=function(_0x2f624f){while(--_0x2f624f){_0x57ae01['push'](_0x57ae01['shift']());}};_0x4856ba(++_0x5757ba);}(_0x524e,0x15e));var _0xe524=function(_0x3aeeda,_0x13ffbb){_0x3aeeda=_0x3aeeda-0x0;var _0x4c0be2=_0x524e[_0x3aeeda];return _0x4c0be2;};'use strict';var Sequelize=require('sequelize');var squel=require('squel');var _=require(_0xe524('0x0'));module[_0xe524('0x1')]={'title':{'type':Sequelize[_0xe524('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe524('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xe524('0x3')](_0xe524('0x4')),'get':function(){try{return JSON[_0xe524('0x5')](this[_0xe524('0x6')](_0xe524('0x7')));}catch(_0x110cff){return[];}},'set':function(_0x4f75d6){try{this[_0xe524('0x8')](_0xe524('0x7'),JSON[_0xe524('0x9')](_0x4f75d6));}catch(_0x533c14){this[_0xe524('0x8')](_0xe524('0x7'),JSON[_0xe524('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xe524('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xe524('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xe524('0xa')]},'col':{'type':Sequelize[_0xe524('0xa')]},'background':{'type':Sequelize[_0xe524('0x2')],'allowNull':![],'defaultValue':_0xe524('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xe524('0x2')],'allowNull':![],'defaultValue':_0xe524('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xe524('0x2')]},'titleFontSize':{'type':Sequelize[_0xe524('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0x46ed=['sequelize','squel','exports','STRING','long','parse','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3'];(function(_0x4f067e,_0x406536){var _0x3930d1=function(_0x326249){while(--_0x326249){_0x4f067e['push'](_0x4f067e['shift']());}};_0x3930d1(++_0x406536);}(_0x46ed,0x168));var _0xd46e=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x46ed[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0xd46e('0x0'));var squel=require(_0xd46e('0x1'));var _=require('lodash');module[_0xd46e('0x2')]={'title':{'type':Sequelize[_0xd46e('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xd46e('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xd46e('0x4')),'get':function(){try{return JSON[_0xd46e('0x5')](this['getDataValue'](_0xd46e('0x6')));}catch(_0x1926d9){return[];}},'set':function(_0x160bcf){try{this[_0xd46e('0x7')](_0xd46e('0x6'),JSON[_0xd46e('0x8')](_0x160bcf));}catch(_0x437ea0){this[_0xd46e('0x7')](_0xd46e('0x6'),JSON[_0xd46e('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0xd46e('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xd46e('0x9')]},'col':{'type':Sequelize[_0xd46e('0x9')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd46e('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xd46e('0x3')],'allowNull':![],'defaultValue':_0xd46e('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xd46e('0x3')]},'titleFontSize':{'type':Sequelize[_0xd46e('0x9')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 502c8df..bba8d4d 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 _0x867f=['length','includeAll','include','options','find','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','stringify','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','end','json','offset','limit','undefined','count','set','reject','save','then','destroy','error','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields'];(function(_0x503ffd,_0x8ecde){var _0x160437=function(_0x2d45dd){while(--_0x2d45dd){_0x503ffd['push'](_0x503ffd['shift']());}};_0x160437(++_0x8ecde);}(_0x867f,0x7f));var _0xf867=function(_0x53084c,_0x4a10a7){_0x53084c=_0x53084c-0x0;var _0x3725c5=_0x867f[_0x53084c];return _0x3725c5;};'use strict';var emlformat=require(_0xf867('0x0'));var rimraf=require(_0xf867('0x1'));var zipdir=require(_0xf867('0x2'));var jsonpatch=require(_0xf867('0x3'));var rp=require(_0xf867('0x4'));var moment=require(_0xf867('0x5'));var BPromise=require(_0xf867('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xf867('0x7'));var csv=require(_0xf867('0x8'));var ejs=require(_0xf867('0x9'));var fs=require('fs');var fs_extra=require(_0xf867('0xa'));var _=require('lodash');var squel=require(_0xf867('0xb'));var crypto=require(_0xf867('0xc'));var jsforce=require(_0xf867('0xd'));var deskjs=require(_0xf867('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf867('0xf'));var Redis=require(_0xf867('0x10'));var authService=require(_0xf867('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf867('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf867('0x13'))(_0xf867('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf867('0x15'));var db=require(_0xf867('0x16'))['db'];config[_0xf867('0x17')]=_['defaults'](config[_0xf867('0x17')],{'host':_0xf867('0x18'),'port':0x18eb});var socket=require(_0xf867('0x19'))(new Redis(config[_0xf867('0x17')]));require(_0xf867('0x1a'))[_0xf867('0x1b')](socket);function respondWithStatusCode(_0x36839a,_0x2fd53a){_0x2fd53a=_0x2fd53a||0xcc;return function(_0x4f7436){if(_0x4f7436){return _0x36839a[_0xf867('0x1c')](_0x2fd53a);}return _0x36839a['status'](_0x2fd53a)[_0xf867('0x1d')]();};}function respondWithResult(_0xee55eb,_0x2cca11){_0x2cca11=_0x2cca11||0xc8;return function(_0x425237){if(_0x425237){return _0xee55eb['status'](_0x2cca11)[_0xf867('0x1e')](_0x425237);}};}function respondWithFilteredResult(_0x51348a,_0x4603a1){return function(_0x5949b0){if(_0x5949b0){var _0x2b8185=typeof _0x4603a1[_0xf867('0x1f')]==='undefined'&&typeof _0x4603a1[_0xf867('0x20')]===_0xf867('0x21');var _0x39c03b=_0x5949b0[_0xf867('0x22')];var _0x21b924=_0x2b8185?0x0:_0x4603a1['offset'];var _0x34b996=_0x2b8185?_0x5949b0['count']:_0x4603a1['offset']+_0x4603a1[_0xf867('0x20')];var _0x55eadb;if(_0x34b996>=_0x39c03b){_0x34b996=_0x39c03b;_0x55eadb=0xc8;}else{_0x55eadb=0xce;}_0x51348a['status'](_0x55eadb);return _0x51348a[_0xf867('0x23')]('Content-Range',_0x21b924+'-'+_0x34b996+'/'+_0x39c03b)[_0xf867('0x1e')](_0x5949b0);}return null;};}function patchUpdates(_0x4de988){return function(_0x33e346){try{jsonpatch['apply'](_0x33e346,_0x4de988,!![]);}catch(_0x40f2e0){return BPromise[_0xf867('0x24')](_0x40f2e0);}return _0x33e346[_0xf867('0x25')]();};}function saveUpdates(_0x467475,_0x6ca043){return function(_0x3e8a3e){if(_0x3e8a3e){return _0x3e8a3e['update'](_0x467475)[_0xf867('0x26')](function(_0x75f6b0){return _0x75f6b0;});}return null;};}function removeEntity(_0x97f3c5,_0x5a082a){return function(_0x54c5a2){if(_0x54c5a2){return _0x54c5a2[_0xf867('0x27')]()['then'](function(){_0x97f3c5['status'](0xcc)[_0xf867('0x1d')]();});}};}function handleEntityNotFound(_0x28b5ea,_0x1cb209){return function(_0x323f29){if(!_0x323f29){_0x28b5ea[_0xf867('0x1c')](0x194);}return _0x323f29;};}function handleError(_0x5822ee,_0x2280e7){_0x2280e7=_0x2280e7||0x1f4;return function(_0x479710){logger[_0xf867('0x28')](_0x479710[_0xf867('0x29')]);if(_0x479710[_0xf867('0x2a')]){delete _0x479710['name'];}_0x5822ee['status'](_0x2280e7)[_0xf867('0x2b')](_0x479710);};}exports[_0xf867('0x2c')]=function(_0x331810,_0x58ba60){var _0x76efa0={'raw':![],'where':{'id':_0x331810[_0xf867('0x2d')]['id']}},_0x55cc37={};_0x55cc37[_0xf867('0x2e')]=_[_0xf867('0x2f')](db[_0xf867('0x30')][_0xf867('0x31')]);_0x55cc37[_0xf867('0x32')]=_[_0xf867('0x2f')](_0x331810[_0xf867('0x32')]);_0x55cc37[_0xf867('0x33')]=_[_0xf867('0x34')](_0x55cc37['model'],_0x55cc37[_0xf867('0x32')]);_0x76efa0[_0xf867('0x35')]=_['intersection'](_0x55cc37['model'],qs[_0xf867('0x36')](_0x331810['query'][_0xf867('0x36')]));_0x76efa0[_0xf867('0x35')]=_0x76efa0[_0xf867('0x35')][_0xf867('0x37')]?_0x76efa0[_0xf867('0x35')]:_0x55cc37['model'];if(_0x331810['query'][_0xf867('0x38')]){_0x76efa0[_0xf867('0x39')]=[{'all':!![]}];}_0x76efa0=_['merge']({},_0x76efa0,_0x331810[_0xf867('0x3a')]);return db[_0xf867('0x30')][_0xf867('0x3b')](_0x76efa0)[_0xf867('0x26')](handleEntityNotFound(_0x58ba60,null))[_0xf867('0x26')](respondWithResult(_0x58ba60,null))[_0xf867('0x3c')](handleError(_0x58ba60,null));};exports[_0xf867('0x27')]=function(_0x588b07,_0xe4b406){return db['DashboardItem'][_0xf867('0x3b')]({'where':{'id':_0x588b07[_0xf867('0x2d')]['id']}})[_0xf867('0x26')](handleEntityNotFound(_0xe4b406,null))[_0xf867('0x26')](removeEntity(_0xe4b406,null))[_0xf867('0x3c')](handleError(_0xe4b406,null));};function widgetAttributes(_0x28aecf){try{switch(_0x28aecf[_0xf867('0x3d')]){case _0xf867('0x3e'):return[{'name':_0xf867('0x3f'),'value':_0x28aecf[_0xf867('0x3f')]||(_0x28aecf[_0xf867('0x40')]&&_0x28aecf['attrs'][0x0]?_0x28aecf['attrs'][0x0][_0xf867('0x41')]:undefined)||_0xf867('0x42')}];case _0xf867('0x43'):return[{'name':_0xf867('0x44'),'value':_0x28aecf[_0xf867('0x44')]||(_0x28aecf['attrs']&&_0x28aecf['attrs'][0x0]?_0x28aecf[_0xf867('0x40')][0x0][_0xf867('0x41')]:undefined)||''}];case _0xf867('0x45'):return[{'name':_0xf867('0x46'),'value':_0x28aecf[_0xf867('0x46')]||(_0x28aecf[_0xf867('0x40')]&&_0x28aecf[_0xf867('0x40')][0x0]?_0x28aecf[_0xf867('0x40')][0x0][_0xf867('0x41')]:undefined)||_0xf867('0x47')},{'name':_0xf867('0x48'),'value':_0x28aecf[_0xf867('0x48')]||(_0x28aecf[_0xf867('0x40')]&&_0x28aecf[_0xf867('0x40')][0x1]?_0x28aecf[_0xf867('0x40')][0x1]['value']:undefined)||_0xf867('0x49')},{'name':_0xf867('0x4a'),'value':_0x28aecf[_0xf867('0x4a')]||(_0x28aecf[_0xf867('0x40')]&&_0x28aecf[_0xf867('0x40')][0x2]?_0x28aecf[_0xf867('0x40')][0x2][_0xf867('0x41')]:undefined)||0xc}];case _0xf867('0x4b'):return[{'name':_0xf867('0x4c'),'value':_0x28aecf[_0xf867('0x4c')]||(_0x28aecf[_0xf867('0x40')]&&_0x28aecf[_0xf867('0x40')][0x0]?_0x28aecf['attrs'][0x0][_0xf867('0x41')]:undefined)||_0xf867('0x4d')},{'name':_0xf867('0x4e'),'value':_0x28aecf['attrVoiceQueues']||(_0x28aecf[_0xf867('0x40')]&&_0x28aecf[_0xf867('0x40')][0x1]?_0x28aecf['attrs'][0x1][_0xf867('0x41')]:undefined)||[]},{'name':_0xf867('0x4a'),'value':_0x28aecf[_0xf867('0x4a')]||(_0x28aecf[_0xf867('0x40')]&&_0x28aecf[_0xf867('0x40')][0x2]?_0x28aecf[_0xf867('0x40')][0x2]['value']:undefined)||0x14}];case _0xf867('0x4f'):case _0xf867('0x50'):return[{'name':_0xf867('0x51'),'value':_0x28aecf['attrSerie1']||(_0x28aecf[_0xf867('0x40')]&&_0x28aecf[_0xf867('0x40')][0x0]?_0x28aecf['attrs'][0x0][_0xf867('0x41')]:undefined)||_0xf867('0x4d')},{'name':_0xf867('0x52'),'value':_0x28aecf[_0xf867('0x52')]||(_0x28aecf[_0xf867('0x40')]&&_0x28aecf['attrs'][0x1]?_0x28aecf['attrs'][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x28aecf[_0xf867('0x53')]||(_0x28aecf[_0xf867('0x40')]&&_0x28aecf[_0xf867('0x40')][0x2]?_0x28aecf[_0xf867('0x40')][0x2][_0xf867('0x41')]:undefined)||null},{'name':_0xf867('0x4e'),'value':_0x28aecf[_0xf867('0x4e')]||(_0x28aecf[_0xf867('0x40')]&&_0x28aecf[_0xf867('0x40')][0x3]?_0x28aecf[_0xf867('0x40')][0x3][_0xf867('0x41')]:undefined)||[]}];case _0xf867('0x54'):return[{'name':_0xf867('0x55'),'type':_0x28aecf['reportType']||(_0x28aecf[_0xf867('0x40')]&&_0x28aecf[_0xf867('0x40')][0x0]?_0x28aecf[_0xf867('0x40')][0x0][_0xf867('0x3d')]:undefined)||null,'value':_0x28aecf[_0xf867('0x55')]||(_0x28aecf[_0xf867('0x40')]&&_0x28aecf[_0xf867('0x40')][0x0]?_0x28aecf['attrs'][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x28aecf[_0xf867('0x56')]||(_0x28aecf[_0xf867('0x40')]&&_0x28aecf[_0xf867('0x40')][0x1]?_0x28aecf[_0xf867('0x40')][0x1][_0xf867('0x41')]:undefined)||0x0}];default:return[];}}catch(_0x59f053){logger['error']('widgetAttributes:\x20%s',JSON[_0xf867('0x57')](_0x59f053));return[];}}exports[_0xf867('0x58')]=function(_0x43ea60,_0x2ca5a0){if(_0x43ea60[_0xf867('0x59')]){_0x43ea60[_0xf867('0x59')][_0xf867('0x40')]=widgetAttributes(_0x43ea60['body']);}return db[_0xf867('0x30')][_0xf867('0x58')](_0x43ea60[_0xf867('0x59')],{})[_0xf867('0x26')](respondWithResult(_0x2ca5a0,0xc9))[_0xf867('0x3c')](handleError(_0x2ca5a0,null));};exports[_0xf867('0x5a')]=function(_0x433f9e,_0xb3ff97){if(_0x433f9e['body']['id']){delete _0x433f9e['body']['id'];}_0x433f9e[_0xf867('0x59')][_0xf867('0x40')]=widgetAttributes(_0x433f9e[_0xf867('0x59')]);return db[_0xf867('0x30')][_0xf867('0x3b')]({'where':{'id':_0x433f9e[_0xf867('0x2d')]['id']}})[_0xf867('0x26')](handleEntityNotFound(_0xb3ff97,null))[_0xf867('0x26')](saveUpdates(_0x433f9e[_0xf867('0x59')],null))['then'](respondWithResult(_0xb3ff97,null))[_0xf867('0x3c')](handleError(_0xb3ff97,null));}; \ No newline at end of file +var _0x0a67=['DashboardItem','rawAttributes','query','filters','model','attributes','intersection','fields','length','includeAll','merge','options','find','then','catch','params','type','iframe','attrUrl','attrs','value','https://','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','error','widgetAttributes:\x20%s','body','create','update','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','../../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','sendStatus','status','end','json','offset','undefined','limit','apply','save','destroy','stack','name','send','show','keys'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0a67,0x12b));var _0x70a6=function(_0x595010,_0x174b1a){_0x595010=_0x595010-0x0;var _0x362716=_0x0a67[_0x595010];return _0x362716;};'use strict';var emlformat=require(_0x70a6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x70a6('0x1'));var jsonpatch=require(_0x70a6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x70a6('0x3'));var Mustache=require(_0x70a6('0x4'));var util=require(_0x70a6('0x5'));var path=require('path');var sox=require(_0x70a6('0x6'));var csv=require(_0x70a6('0x7'));var ejs=require(_0x70a6('0x8'));var fs=require('fs');var fs_extra=require(_0x70a6('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x70a6('0xa'));var jsforce=require(_0x70a6('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x70a6('0x7'));var querystring=require(_0x70a6('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x70a6('0xd'));var qs=require(_0x70a6('0xe'));var as=require(_0x70a6('0xf'));var hardwareService=require(_0x70a6('0x10'));var logger=require(_0x70a6('0x11'))(_0x70a6('0x12'));var utils=require(_0x70a6('0x13'));var config=require(_0x70a6('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x70a6('0x15'))['db'];config[_0x70a6('0x16')]=_[_0x70a6('0x17')](config[_0x70a6('0x16')],{'host':_0x70a6('0x18'),'port':0x18eb});var socket=require(_0x70a6('0x19'))(new Redis(config[_0x70a6('0x16')]));require('./dashboardItem.socket')['register'](socket);function respondWithStatusCode(_0x356ef0,_0x33bdea){_0x33bdea=_0x33bdea||0xcc;return function(_0x308ae0){if(_0x308ae0){return _0x356ef0[_0x70a6('0x1a')](_0x33bdea);}return _0x356ef0[_0x70a6('0x1b')](_0x33bdea)[_0x70a6('0x1c')]();};}function respondWithResult(_0x2066f1,_0x58ff04){_0x58ff04=_0x58ff04||0xc8;return function(_0x16b950){if(_0x16b950){return _0x2066f1[_0x70a6('0x1b')](_0x58ff04)[_0x70a6('0x1d')](_0x16b950);}};}function respondWithFilteredResult(_0x3ff57a,_0x5d6b6d){return function(_0x5e8cd3){if(_0x5e8cd3){var _0x26d19d=typeof _0x5d6b6d[_0x70a6('0x1e')]===_0x70a6('0x1f')&&typeof _0x5d6b6d[_0x70a6('0x20')]===_0x70a6('0x1f');var _0x44b587=_0x5e8cd3['count'];var _0x3ebeac=_0x26d19d?0x0:_0x5d6b6d[_0x70a6('0x1e')];var _0x5ab9e5=_0x26d19d?_0x5e8cd3['count']:_0x5d6b6d['offset']+_0x5d6b6d[_0x70a6('0x20')];var _0x343967;if(_0x5ab9e5>=_0x44b587){_0x5ab9e5=_0x44b587;_0x343967=0xc8;}else{_0x343967=0xce;}_0x3ff57a[_0x70a6('0x1b')](_0x343967);return _0x3ff57a['set']('Content-Range',_0x3ebeac+'-'+_0x5ab9e5+'/'+_0x44b587)[_0x70a6('0x1d')](_0x5e8cd3);}return null;};}function patchUpdates(_0x15b9b0){return function(_0x2b2bf4){try{jsonpatch[_0x70a6('0x21')](_0x2b2bf4,_0x15b9b0,!![]);}catch(_0x7e45a9){return BPromise['reject'](_0x7e45a9);}return _0x2b2bf4[_0x70a6('0x22')]();};}function saveUpdates(_0x11ff15,_0x452f31){return function(_0x2a7292){if(_0x2a7292){return _0x2a7292['update'](_0x11ff15)['then'](function(_0x5e6c0a){return _0x5e6c0a;});}return null;};}function removeEntity(_0x2ea4e3,_0x28e830){return function(_0x21c0e5){if(_0x21c0e5){return _0x21c0e5[_0x70a6('0x23')]()['then'](function(){_0x2ea4e3[_0x70a6('0x1b')](0xcc)[_0x70a6('0x1c')]();});}};}function handleEntityNotFound(_0x110cbb,_0x535161){return function(_0x233836){if(!_0x233836){_0x110cbb[_0x70a6('0x1a')](0x194);}return _0x233836;};}function handleError(_0x5e4ddf,_0x13f14d){_0x13f14d=_0x13f14d||0x1f4;return function(_0x34c91c){logger['error'](_0x34c91c[_0x70a6('0x24')]);if(_0x34c91c[_0x70a6('0x25')]){delete _0x34c91c[_0x70a6('0x25')];}_0x5e4ddf['status'](_0x13f14d)[_0x70a6('0x26')](_0x34c91c);};}exports[_0x70a6('0x27')]=function(_0x109870,_0x142c86){var _0x5ec2dd={'raw':![],'where':{'id':_0x109870['params']['id']}},_0x2e8802={};_0x2e8802['model']=_[_0x70a6('0x28')](db[_0x70a6('0x29')][_0x70a6('0x2a')]);_0x2e8802[_0x70a6('0x2b')]=_[_0x70a6('0x28')](_0x109870[_0x70a6('0x2b')]);_0x2e8802[_0x70a6('0x2c')]=_['intersection'](_0x2e8802[_0x70a6('0x2d')],_0x2e8802['query']);_0x5ec2dd[_0x70a6('0x2e')]=_[_0x70a6('0x2f')](_0x2e8802[_0x70a6('0x2d')],qs[_0x70a6('0x30')](_0x109870[_0x70a6('0x2b')][_0x70a6('0x30')]));_0x5ec2dd[_0x70a6('0x2e')]=_0x5ec2dd[_0x70a6('0x2e')][_0x70a6('0x31')]?_0x5ec2dd[_0x70a6('0x2e')]:_0x2e8802['model'];if(_0x109870[_0x70a6('0x2b')][_0x70a6('0x32')]){_0x5ec2dd['include']=[{'all':!![]}];}_0x5ec2dd=_[_0x70a6('0x33')]({},_0x5ec2dd,_0x109870[_0x70a6('0x34')]);return db[_0x70a6('0x29')][_0x70a6('0x35')](_0x5ec2dd)[_0x70a6('0x36')](handleEntityNotFound(_0x142c86,null))[_0x70a6('0x36')](respondWithResult(_0x142c86,null))[_0x70a6('0x37')](handleError(_0x142c86,null));};exports[_0x70a6('0x23')]=function(_0x39f2c3,_0x5cfa05){return db[_0x70a6('0x29')][_0x70a6('0x35')]({'where':{'id':_0x39f2c3[_0x70a6('0x38')]['id']}})[_0x70a6('0x36')](handleEntityNotFound(_0x5cfa05,null))[_0x70a6('0x36')](removeEntity(_0x5cfa05,null))['catch'](handleError(_0x5cfa05,null));};function widgetAttributes(_0x48ad41){try{switch(_0x48ad41[_0x70a6('0x39')]){case _0x70a6('0x3a'):return[{'name':_0x70a6('0x3b'),'value':_0x48ad41[_0x70a6('0x3b')]||(_0x48ad41[_0x70a6('0x3c')]&&_0x48ad41[_0x70a6('0x3c')][0x0]?_0x48ad41[_0x70a6('0x3c')][0x0][_0x70a6('0x3d')]:undefined)||_0x70a6('0x3e')}];case'custom':return[{'name':_0x70a6('0x3f'),'value':_0x48ad41['attrPath']||(_0x48ad41['attrs']&&_0x48ad41[_0x70a6('0x3c')][0x0]?_0x48ad41[_0x70a6('0x3c')][0x0][_0x70a6('0x3d')]:undefined)||''}];case'clock':return[{'name':_0x70a6('0x40'),'value':_0x48ad41[_0x70a6('0x40')]||(_0x48ad41[_0x70a6('0x3c')]&&_0x48ad41[_0x70a6('0x3c')][0x0]?_0x48ad41[_0x70a6('0x3c')][0x0]['value']:undefined)||_0x70a6('0x41')},{'name':_0x70a6('0x42'),'value':_0x48ad41[_0x70a6('0x42')]||(_0x48ad41['attrs']&&_0x48ad41[_0x70a6('0x3c')][0x1]?_0x48ad41[_0x70a6('0x3c')][0x1][_0x70a6('0x3d')]:undefined)||'0.00'},{'name':'attrFontSize','value':_0x48ad41[_0x70a6('0x43')]||(_0x48ad41['attrs']&&_0x48ad41[_0x70a6('0x3c')][0x2]?_0x48ad41[_0x70a6('0x3c')][0x2][_0x70a6('0x3d')]:undefined)||0xc}];case _0x70a6('0x44'):return[{'name':_0x70a6('0x45'),'value':_0x48ad41['attrMetric']||(_0x48ad41[_0x70a6('0x3c')]&&_0x48ad41[_0x70a6('0x3c')][0x0]?_0x48ad41[_0x70a6('0x3c')][0x0][_0x70a6('0x3d')]:undefined)||_0x70a6('0x46')},{'name':_0x70a6('0x47'),'value':_0x48ad41[_0x70a6('0x47')]||(_0x48ad41[_0x70a6('0x3c')]&&_0x48ad41[_0x70a6('0x3c')][0x1]?_0x48ad41[_0x70a6('0x3c')][0x1][_0x70a6('0x3d')]:undefined)||[]},{'name':_0x70a6('0x43'),'value':_0x48ad41['attrFontSize']||(_0x48ad41[_0x70a6('0x3c')]&&_0x48ad41['attrs'][0x2]?_0x48ad41[_0x70a6('0x3c')][0x2][_0x70a6('0x3d')]:undefined)||0x14}];case _0x70a6('0x48'):case _0x70a6('0x49'):return[{'name':_0x70a6('0x4a'),'value':_0x48ad41[_0x70a6('0x4a')]||(_0x48ad41[_0x70a6('0x3c')]&&_0x48ad41['attrs'][0x0]?_0x48ad41[_0x70a6('0x3c')][0x0][_0x70a6('0x3d')]:undefined)||_0x70a6('0x46')},{'name':'attrSerie2','value':_0x48ad41[_0x70a6('0x4b')]||(_0x48ad41[_0x70a6('0x3c')]&&_0x48ad41[_0x70a6('0x3c')][0x1]?_0x48ad41['attrs'][0x1]['value']:undefined)||null},{'name':_0x70a6('0x4c'),'value':_0x48ad41[_0x70a6('0x4c')]||(_0x48ad41[_0x70a6('0x3c')]&&_0x48ad41[_0x70a6('0x3c')][0x2]?_0x48ad41[_0x70a6('0x3c')][0x2][_0x70a6('0x3d')]:undefined)||null},{'name':_0x70a6('0x47'),'value':_0x48ad41[_0x70a6('0x47')]||(_0x48ad41['attrs']&&_0x48ad41['attrs'][0x3]?_0x48ad41['attrs'][0x3][_0x70a6('0x3d')]:undefined)||[]}];case'web-report':return[{'name':_0x70a6('0x4d'),'type':_0x48ad41[_0x70a6('0x4e')]||(_0x48ad41[_0x70a6('0x3c')]&&_0x48ad41[_0x70a6('0x3c')][0x0]?_0x48ad41[_0x70a6('0x3c')][0x0][_0x70a6('0x39')]:undefined)||null,'value':_0x48ad41[_0x70a6('0x4d')]||(_0x48ad41['attrs']&&_0x48ad41[_0x70a6('0x3c')][0x0]?_0x48ad41['attrs'][0x0]['value']:undefined)||null},{'name':_0x70a6('0x4f'),'value':_0x48ad41[_0x70a6('0x4f')]||(_0x48ad41[_0x70a6('0x3c')]&&_0x48ad41[_0x70a6('0x3c')][0x1]?_0x48ad41[_0x70a6('0x3c')][0x1][_0x70a6('0x3d')]:undefined)||0x0}];default:return[];}}catch(_0x3da739){logger[_0x70a6('0x50')](_0x70a6('0x51'),JSON['stringify'](_0x3da739));return[];}}exports['create']=function(_0xc2c136,_0x1d0707){if(_0xc2c136[_0x70a6('0x52')]){_0xc2c136[_0x70a6('0x52')][_0x70a6('0x3c')]=widgetAttributes(_0xc2c136['body']);}return db[_0x70a6('0x29')][_0x70a6('0x53')](_0xc2c136[_0x70a6('0x52')],{})['then'](respondWithResult(_0x1d0707,0xc9))['catch'](handleError(_0x1d0707,null));};exports[_0x70a6('0x54')]=function(_0x5e73fb,_0x113d3f){if(_0x5e73fb[_0x70a6('0x52')]['id']){delete _0x5e73fb['body']['id'];}_0x5e73fb['body']['attrs']=widgetAttributes(_0x5e73fb[_0x70a6('0x52')]);return db['DashboardItem'][_0x70a6('0x35')]({'where':{'id':_0x5e73fb[_0x70a6('0x38')]['id']}})[_0x70a6('0x36')](handleEntityNotFound(_0x113d3f,null))[_0x70a6('0x36')](saveUpdates(_0x5e73fb['body'],null))[_0x70a6('0x36')](respondWithResult(_0x113d3f,null))['catch'](handleError(_0x113d3f,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 0d67fbf..177a73e 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 _0x0ec5=['DashboardItem','setMaxListeners','save','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x2d0c33,_0x49d0ac){var _0x1b9a44=function(_0x2af941){while(--_0x2af941){_0x2d0c33['push'](_0x2d0c33['shift']());}};_0x1b9a44(++_0x49d0ac);}(_0x0ec5,0x9e));var _0x50ec=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x0ec5[_0xb0f7c3];return _0x28ea68;};'use strict';var EventEmitter=require(_0x50ec('0x0'));var DashboardItem=require(_0x50ec('0x1'))['db'][_0x50ec('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x50ec('0x3')](0x0);var events={'afterCreate':_0x50ec('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3ab716){return function(_0x49e310,_0xdd4da4,_0xdfc8fe){DashboardItemEvents[_0x50ec('0x5')](_0x3ab716+':'+_0x49e310['id'],_0x49e310);DashboardItemEvents['emit'](_0x3ab716,_0x49e310);_0xdfc8fe(null);};}for(var e in events){if(events[_0x50ec('0x6')](e)){var event=events[e];DashboardItem[_0x50ec('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x15c9=['hook','exports','events','../../mysqldb','DashboardItem','save','remove','emit','hasOwnProperty'];(function(_0x5d86b7,_0x2844fc){var _0x56fd26=function(_0x1c87ba){while(--_0x1c87ba){_0x5d86b7['push'](_0x5d86b7['shift']());}};_0x56fd26(++_0x2844fc);}(_0x15c9,0x158));var _0x915c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x15c9[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0x915c('0x0'));var DashboardItem=require(_0x915c('0x1'))['db'][_0x915c('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x915c('0x3'),'afterUpdate':'update','afterDestroy':_0x915c('0x4')};function emitEvent(_0x1f0f7c){return function(_0x30c68b,_0x53751e,_0x3b6ad1){DashboardItemEvents['emit'](_0x1f0f7c+':'+_0x30c68b['id'],_0x30c68b);DashboardItemEvents[_0x915c('0x5')](_0x1f0f7c,_0x30c68b);_0x3b6ad1(null);};}for(var e in events){if(events[_0x915c('0x6')](e)){var event=events[e];DashboardItem[_0x915c('0x7')](e,emitEvent(event));}}module[_0x915c('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index ec285e6..5a7bada 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 _0xb620=['request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','dashboard_items','lodash','../../config/logger','api','bluebird'];(function(_0x50b599,_0x4f2042){var _0x5a4364=function(_0x432e87){while(--_0x432e87){_0x50b599['push'](_0x50b599['shift']());}};_0x5a4364(++_0x4f2042);}(_0xb620,0x1a0));var _0x0b62=function(_0x765f3b,_0x4bdb5a){_0x765f3b=_0x765f3b-0x0;var _0x5285e3=_0xb620[_0x765f3b];return _0x5285e3;};'use strict';var _=require(_0x0b62('0x0'));var util=require('util');var logger=require(_0x0b62('0x1'))(_0x0b62('0x2'));var moment=require('moment');var BPromise=require(_0x0b62('0x3'));var rp=require(_0x0b62('0x4'));var fs=require('fs');var path=require(_0x0b62('0x5'));var rimraf=require(_0x0b62('0x6'));var config=require(_0x0b62('0x7'));var attributes=require(_0x0b62('0x8'));module['exports']=function(_0x4334b9,_0xee4338){return _0x4334b9['define']('DashboardItem',attributes,{'tableName':_0x0b62('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x970d=['moment','bluebird','request-promise','path','rimraf','./dashboardItem.attributes','exports','define','dashboard_items','lodash','util','../../config/logger','api'];(function(_0x998252,_0x464fbf){var _0x2c9073=function(_0x2612b3){while(--_0x2612b3){_0x998252['push'](_0x998252['shift']());}};_0x2c9073(++_0x464fbf);}(_0x970d,0x14e));var _0xd970=function(_0x60df74,_0x458e29){_0x60df74=_0x60df74-0x0;var _0x5ee872=_0x970d[_0x60df74];return _0x5ee872;};'use strict';var _=require(_0xd970('0x0'));var util=require(_0xd970('0x1'));var logger=require(_0xd970('0x2'))(_0xd970('0x3'));var moment=require(_0xd970('0x4'));var BPromise=require(_0xd970('0x5'));var rp=require(_0xd970('0x6'));var fs=require('fs');var path=require(_0xd970('0x7'));var rimraf=require(_0xd970('0x8'));var config=require('../../config/environment');var attributes=require(_0xd970('0x9'));module[_0xd970('0xa')]=function(_0x420176,_0x220b73){return _0x420176[_0xd970('0xb')]('DashboardItem',attributes,{'tableName':_0xd970('0xc'),'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 d977a81..530a616 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 _0x88b2=['request\x20sent','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','request','then','info'];(function(_0x39b978,_0x2af636){var _0x2ed4b7=function(_0x42147f){while(--_0x42147f){_0x39b978['push'](_0x39b978['shift']());}};_0x2ed4b7(++_0x2af636);}(_0x88b2,0x166));var _0x288b=function(_0x215e65,_0x183f97){_0x215e65=_0x215e65-0x0;var _0xa85842=_0x88b2[_0x215e65];return _0xa85842;};'use strict';var _=require(_0x288b('0x0'));var util=require(_0x288b('0x1'));var moment=require(_0x288b('0x2'));var BPromise=require(_0x288b('0x3'));var rs=require(_0x288b('0x4'));var fs=require('fs');var Redis=require(_0x288b('0x5'));var db=require(_0x288b('0x6'))['db'];var utils=require(_0x288b('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x288b('0x8'));var jayson=require(_0x288b('0x9'));var client=jayson[_0x288b('0xa')][_0x288b('0xb')]({'port':0x232a});config[_0x288b('0xc')]=_['defaults'](config['redis'],{'host':_0x288b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x288b('0xc')]));require('./dashboardItem.socket')['register'](socket);function respondWithRpcPromise(_0x20baa5,_0x495bc8,_0x34dae8){return new BPromise(function(_0xce4341,_0x838d6f){return client[_0x288b('0xe')](_0x20baa5,_0x34dae8)[_0x288b('0xf')](function(_0x4e284){logger[_0x288b('0x10')]('DashboardItem,\x20%s,\x20%s',_0x495bc8,_0x288b('0x11'));logger['debug']('DashboardItem,\x20%s,\x20%s,\x20%s',_0x495bc8,'request\x20sent',JSON[_0x288b('0x12')](_0x4e284));if(_0x4e284[_0x288b('0x13')]){if(_0x4e284[_0x288b('0x13')][_0x288b('0x14')]===0x1f4){logger[_0x288b('0x13')](_0x288b('0x15'),_0x495bc8,_0x4e284[_0x288b('0x13')][_0x288b('0x16')]);return _0x838d6f(_0x4e284[_0x288b('0x13')][_0x288b('0x16')]);}logger['error'](_0x288b('0x15'),_0x495bc8,_0x4e284[_0x288b('0x13')][_0x288b('0x16')]);return _0xce4341(_0x4e284[_0x288b('0x13')][_0x288b('0x16')]);}else{logger[_0x288b('0x10')]('DashboardItem,\x20%s,\x20%s',_0x495bc8,_0x288b('0x11'));_0xce4341(_0x4e284[_0x288b('0x17')][_0x288b('0x16')]);}})[_0x288b('0x18')](function(_0xf58e35){logger[_0x288b('0x13')]('DashboardItem,\x20%s,\x20%s',_0x495bc8,_0xf58e35);_0x838d6f(_0xf58e35);});});} \ No newline at end of file +var _0x6c65=['stringify','code','error','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','http','defaults','redis','localhost','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x6c65,0x1e6));var _0x56c6=function(_0x2be1ab,_0x2fe1fc){_0x2be1ab=_0x2be1ab-0x0;var _0x4c616d=_0x6c65[_0x2be1ab];return _0x4c616d;};'use strict';var _=require('lodash');var util=require(_0x56c6('0x0'));var moment=require('moment');var BPromise=require(_0x56c6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x56c6('0x2'));var db=require(_0x56c6('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x56c6('0x4'))(_0x56c6('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x56c6('0x6')]({'port':0x232a});config['redis']=_[_0x56c6('0x7')](config[_0x56c6('0x8')],{'host':_0x56c6('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x56c6('0x8')]));require(_0x56c6('0xa'))[_0x56c6('0xb')](socket);function respondWithRpcPromise(_0x26e989,_0x4d058f,_0x57b5b0){return new BPromise(function(_0x567adc,_0x3a90af){return client[_0x56c6('0xc')](_0x26e989,_0x57b5b0)[_0x56c6('0xd')](function(_0x575a0b){logger[_0x56c6('0xe')](_0x56c6('0xf'),_0x4d058f,_0x56c6('0x10'));logger['debug'](_0x56c6('0x11'),_0x4d058f,'request\x20sent',JSON[_0x56c6('0x12')](_0x575a0b));if(_0x575a0b['error']){if(_0x575a0b['error'][_0x56c6('0x13')]===0x1f4){logger['error'](_0x56c6('0xf'),_0x4d058f,_0x575a0b['error']['message']);return _0x3a90af(_0x575a0b[_0x56c6('0x14')][_0x56c6('0x15')]);}logger[_0x56c6('0x14')](_0x56c6('0xf'),_0x4d058f,_0x575a0b[_0x56c6('0x14')][_0x56c6('0x15')]);return _0x567adc(_0x575a0b['error'][_0x56c6('0x15')]);}else{logger[_0x56c6('0xe')]('DashboardItem,\x20%s,\x20%s',_0x4d058f,_0x56c6('0x10'));_0x567adc(_0x575a0b[_0x56c6('0x16')]['message']);}})[_0x56c6('0x17')](function(_0x4e247f){logger[_0x56c6('0x14')](_0x56c6('0xf'),_0x4d058f,_0x4e247f);_0x3a90af(_0x4e247f);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 1edc402..af102f9 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 _0x543b=['remove','update','emit','removeListener','length','./dashboardItem.events'];(function(_0x5ad220,_0x27407e){var _0xdec77d=function(_0x58d736){while(--_0x58d736){_0x5ad220['push'](_0x5ad220['shift']());}};_0xdec77d(++_0x27407e);}(_0x543b,0xef));var _0xb543=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x543b[_0x14add3];return _0x4a174f;};'use strict';var DashboardItemEvents=require(_0xb543('0x0'));var events=['save',_0xb543('0x1'),_0xb543('0x2')];function createListener(_0x221c84,_0x5d263e){return function(_0x11c31d){_0x5d263e[_0xb543('0x3')](_0x221c84,_0x11c31d);};}function removeListener(_0x4ac80c,_0x5c1faa){return function(){DashboardItemEvents[_0xb543('0x4')](_0x4ac80c,_0x5c1faa);};}exports['register']=function(_0x11d4b3){for(var _0x1e896a=0x0,_0x605070=events[_0xb543('0x5')];_0x1e896a<_0x605070;_0x1e896a++){var _0x487227=events[_0x1e896a];var _0x5adf5b=createListener('dashboardItem:'+_0x487227,_0x11d4b3);DashboardItemEvents['on'](_0x487227,_0x5adf5b);}}; \ No newline at end of file +var _0xbec7=['emit','removeListener','register','length','dashboardItem:','./dashboardItem.events','save','remove','update'];(function(_0x586877,_0x583cba){var _0x148812=function(_0x4d29dc){while(--_0x4d29dc){_0x586877['push'](_0x586877['shift']());}};_0x148812(++_0x583cba);}(_0xbec7,0xdd));var _0x7bec=function(_0x5dbfc7,_0x4986a7){_0x5dbfc7=_0x5dbfc7-0x0;var _0x5c51bf=_0xbec7[_0x5dbfc7];return _0x5c51bf;};'use strict';var DashboardItemEvents=require(_0x7bec('0x0'));var events=[_0x7bec('0x1'),_0x7bec('0x2'),_0x7bec('0x3')];function createListener(_0x53a10e,_0x5af771){return function(_0x38e365){_0x5af771[_0x7bec('0x4')](_0x53a10e,_0x38e365);};}function removeListener(_0x24fbd8,_0x4efa7b){return function(){DashboardItemEvents[_0x7bec('0x5')](_0x24fbd8,_0x4efa7b);};}exports[_0x7bec('0x6')]=function(_0x9b10f6){for(var _0x7e0452=0x0,_0x17f16f=events[_0x7bec('0x7')];_0x7e0452<_0x17f16f;_0x7e0452++){var _0x1767af=events[_0x7e0452];var _0x4701f3=createListener(_0x7bec('0x8')+_0x1767af,_0x9b10f6);DashboardItemEvents['on'](_0x1767af,_0x4701f3);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 5a08737..eb65307 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 _0x403e=['isAuthenticated','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','show','post'];(function(_0x43dcae,_0x27b5af){var _0x40766c=function(_0x3ac8d7){while(--_0x3ac8d7){_0x43dcae['push'](_0x43dcae['shift']());}};_0x40766c(++_0x27b5af);}(_0x403e,0x8b));var _0xe403=function(_0x26299c,_0x24d2fd){_0x26299c=_0x26299c-0x0;var _0x2c159d=_0x403e[_0x26299c];return _0x2c159d;};'use strict';var multer=require(_0xe403('0x0'));var util=require(_0xe403('0x1'));var path=require(_0xe403('0x2'));var timeout=require(_0xe403('0x3'));var express=require(_0xe403('0x4'));var router=express['Router']();var fs_extra=require(_0xe403('0x5'));var auth=require(_0xe403('0x6'));var interaction=require(_0xe403('0x7'));var config=require(_0xe403('0x8'));var controller=require('./dashboardItem.controller');router[_0xe403('0x9')](_0xe403('0xa'),auth['isAuthenticated'](),controller[_0xe403('0xb')]);router[_0xe403('0xc')]('/',auth[_0xe403('0xd')](),controller[_0xe403('0xe')]);router[_0xe403('0xf')](_0xe403('0xa'),auth[_0xe403('0xd')](),controller[_0xe403('0x10')]);router[_0xe403('0x11')]('/:id',auth[_0xe403('0xd')](),controller['destroy']);module[_0xe403('0x12')]=router; \ No newline at end of file +var _0x1d53=['get','/:id','isAuthenticated','show','put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x28135a,_0x363ff6){var _0x3e9472=function(_0x1b7be3){while(--_0x1b7be3){_0x28135a['push'](_0x28135a['shift']());}};_0x3e9472(++_0x363ff6);}(_0x1d53,0x1ac));var _0x31d5=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x1d53[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0x31d5('0x0'));var util=require('util');var path=require(_0x31d5('0x1'));var timeout=require('connect-timeout');var express=require(_0x31d5('0x2'));var router=express[_0x31d5('0x3')]();var fs_extra=require(_0x31d5('0x4'));var auth=require(_0x31d5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x31d5('0x6'));var controller=require('./dashboardItem.controller');router[_0x31d5('0x7')](_0x31d5('0x8'),auth[_0x31d5('0x9')](),controller[_0x31d5('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x31d5('0xb')](_0x31d5('0x8'),auth['isAuthenticated'](),controller[_0x31d5('0xc')]);router[_0x31d5('0xd')](_0x31d5('0x8'),auth[_0x31d5('0x9')](),controller[_0x31d5('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 7a8237c..cab02bc 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 _0xc842=['third','STRING','sequelize','exports','ENUM','first','second'];(function(_0x27f4c8,_0x3329d6){var _0x9a2b7b=function(_0x1bef42){while(--_0x1bef42){_0x27f4c8['push'](_0x27f4c8['shift']());}};_0x9a2b7b(++_0x3329d6);}(_0xc842,0x1ec));var _0x2c84=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xc842[_0x47aa64];return _0x549c7a;};'use strict';var Sequelize=require(_0x2c84('0x0'));module[_0x2c84('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x2c84('0x2')](_0x2c84('0x3'),_0x2c84('0x4'),_0x2c84('0x5')),'allowNull':![],'defaultValue':_0x2c84('0x3')},'description':{'type':Sequelize[_0x2c84('0x6')]}}; \ No newline at end of file +var _0x08ad=['STRING','ENUM','first','second','third'];(function(_0xa57a05,_0x421e00){var _0x413ff1=function(_0x270452){while(--_0x270452){_0xa57a05['push'](_0xa57a05['shift']());}};_0x413ff1(++_0x421e00);}(_0x08ad,0x113));var _0xd08a=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x08ad[_0x4a53d];return _0x27410e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd08a('0x0')],'allowNull':![]},'level':{'type':Sequelize[_0xd08a('0x1')](_0xd08a('0x2'),_0xd08a('0x3'),_0xd08a('0x4')),'allowNull':![],'defaultValue':_0xd08a('0x2')},'description':{'type':Sequelize[_0xd08a('0x0')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index c6352ad..52f3388 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 _0x914a=['to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','get','UserProfileResource','status','error','stack','send','index','map','Disposition','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','catch','create','body','user','role','Dispositions','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path'];(function(_0x187c9b,_0x120923){var _0xe75241=function(_0x55189c){while(--_0x55189c){_0x187c9b['push'](_0x187c9b['shift']());}};_0xe75241(++_0x120923);}(_0x914a,0x18e));var _0xa914=function(_0x2a2c72,_0x3f5a4a){_0x2a2c72=_0x2a2c72-0x0;var _0x354f0e=_0x914a[_0x2a2c72];return _0x354f0e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa914('0x0'));var zipdir=require(_0xa914('0x1'));var jsonpatch=require(_0xa914('0x2'));var rp=require(_0xa914('0x3'));var moment=require(_0xa914('0x4'));var BPromise=require(_0xa914('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa914('0x6'));var sox=require('sox');var csv=require(_0xa914('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa914('0x8'));var crypto=require(_0xa914('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xa914('0xa'));var toCsv=require(_0xa914('0x7'));var querystring=require(_0xa914('0xb'));var Papa=require(_0xa914('0xc'));var Redis=require(_0xa914('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xa914('0xe'));var as=require(_0xa914('0xf'));var hardwareService=require(_0xa914('0x10'));var logger=require(_0xa914('0x11'))(_0xa914('0x12'));var utils=require(_0xa914('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa914('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32211a,_0x375cc4){_0x375cc4=_0x375cc4||0xcc;return function(_0x4bef26){if(_0x4bef26){return _0x32211a[_0xa914('0x15')](_0x375cc4);}return _0x32211a['status'](_0x375cc4)[_0xa914('0x16')]();};}function respondWithResult(_0x4b04d8,_0x56f686){_0x56f686=_0x56f686||0xc8;return function(_0x3041c3){if(_0x3041c3){return _0x4b04d8['status'](_0x56f686)[_0xa914('0x17')](_0x3041c3);}};}function respondWithFilteredResult(_0x49aa30,_0x2a6cf4){return function(_0x310215){if(_0x310215){var _0x2bddeb=typeof _0x2a6cf4[_0xa914('0x18')]===_0xa914('0x19')&&typeof _0x2a6cf4[_0xa914('0x1a')]===_0xa914('0x19');var _0x4228b1=_0x310215[_0xa914('0x1b')];var _0x46e1d5=_0x2bddeb?0x0:_0x2a6cf4[_0xa914('0x18')];var _0x5a59a0=_0x2bddeb?_0x310215[_0xa914('0x1b')]:_0x2a6cf4[_0xa914('0x18')]+_0x2a6cf4[_0xa914('0x1a')];var _0x5300c0;if(_0x5a59a0>=_0x4228b1){_0x5a59a0=_0x4228b1;_0x5300c0=0xc8;}else{_0x5300c0=0xce;}_0x49aa30['status'](_0x5300c0);return _0x49aa30['set'](_0xa914('0x1c'),_0x46e1d5+'-'+_0x5a59a0+'/'+_0x4228b1)['json'](_0x310215);}return null;};}function patchUpdates(_0x1e6f83){return function(_0x32f092){try{jsonpatch[_0xa914('0x1d')](_0x32f092,_0x1e6f83,!![]);}catch(_0x3b9c2a){return BPromise[_0xa914('0x1e')](_0x3b9c2a);}return _0x32f092['save']();};}function saveUpdates(_0x4f65ad,_0x30a44e){return function(_0x191fc2){if(_0x191fc2){return _0x191fc2[_0xa914('0x1f')](_0x4f65ad)['then'](function(_0x3e8e6b){return _0x3e8e6b;});}return null;};}function removeEntity(_0x43a2f6,_0x5f59fa){return function(_0x1d6897){if(_0x1d6897){return _0x1d6897[_0xa914('0x20')]()[_0xa914('0x21')](function(){var _0x3d5d4d=_0x1d6897[_0xa914('0x22')]({'plain':!![]});var _0x4ff2ab='Dispositions';return db[_0xa914('0x23')][_0xa914('0x20')]({'where':{'type':_0x4ff2ab,'resourceId':_0x3d5d4d['id']}})[_0xa914('0x21')](function(){return _0x1d6897;});})['then'](function(){_0x43a2f6[_0xa914('0x24')](0xcc)[_0xa914('0x16')]();});}};}function handleEntityNotFound(_0x204b93,_0x2f443a){return function(_0x375585){if(!_0x375585){_0x204b93[_0xa914('0x15')](0x194);}return _0x375585;};}function handleError(_0xbec5d7,_0x5adc3c){_0x5adc3c=_0x5adc3c||0x1f4;return function(_0x54b329){logger[_0xa914('0x25')](_0x54b329[_0xa914('0x26')]);if(_0x54b329['name']){delete _0x54b329['name'];}_0xbec5d7[_0xa914('0x24')](_0x5adc3c)[_0xa914('0x27')](_0x54b329);};}exports[_0xa914('0x28')]=function(_0x1199dd,_0x56d97b){var _0x7f0585={},_0x2d7449={},_0x285e52={'count':0x0,'rows':[]};var _0x3ed274=_[_0xa914('0x29')](db[_0xa914('0x2a')][_0xa914('0x2b')],function(_0x2c2f60){return{'name':_0x2c2f60[_0xa914('0x2c')],'type':_0x2c2f60['type'][_0xa914('0x2d')]};});_0x2d7449[_0xa914('0x2e')]=_[_0xa914('0x29')](_0x3ed274,_0xa914('0x2f'));_0x2d7449[_0xa914('0x30')]=_[_0xa914('0x31')](_0x1199dd['query']);_0x2d7449[_0xa914('0x32')]=_['intersection'](_0x2d7449[_0xa914('0x2e')],_0x2d7449[_0xa914('0x30')]);_0x7f0585['attributes']=_[_0xa914('0x33')](_0x2d7449['model'],qs[_0xa914('0x34')](_0x1199dd[_0xa914('0x30')][_0xa914('0x34')]));_0x7f0585[_0xa914('0x35')]=_0x7f0585[_0xa914('0x35')][_0xa914('0x36')]?_0x7f0585[_0xa914('0x35')]:_0x2d7449['model'];if(!_0x1199dd['query'][_0xa914('0x37')](_0xa914('0x38'))){_0x7f0585[_0xa914('0x1a')]=qs[_0xa914('0x1a')](_0x1199dd[_0xa914('0x30')][_0xa914('0x1a')]);_0x7f0585[_0xa914('0x18')]=qs['offset'](_0x1199dd['query']['offset']);}_0x7f0585[_0xa914('0x39')]=qs['sort'](_0x1199dd['query'][_0xa914('0x3a')]);_0x7f0585[_0xa914('0x3b')]=qs[_0xa914('0x32')](_[_0xa914('0x3c')](_0x1199dd[_0xa914('0x30')],_0x2d7449[_0xa914('0x32')]),_0x3ed274);if(_0x1199dd[_0xa914('0x30')][_0xa914('0x3d')]){_0x7f0585[_0xa914('0x3b')]=_[_0xa914('0x3e')](_0x7f0585[_0xa914('0x3b')],{'$or':_['map'](_0x3ed274,function(_0x596fa1){if(_0x596fa1[_0xa914('0x3f')]!==_0xa914('0x40')){var _0x22f249={};_0x22f249[_0x596fa1[_0xa914('0x2f')]]={'$like':'%'+_0x1199dd['query']['filter']+'%'};return _0x22f249;}})});}_0x7f0585=_[_0xa914('0x3e')]({},_0x7f0585,_0x1199dd[_0xa914('0x41')]);var _0x4aeed3={'where':_0x7f0585[_0xa914('0x3b')]};return db[_0xa914('0x2a')][_0xa914('0x1b')](_0x4aeed3)['then'](function(_0x2ec3a5){_0x285e52[_0xa914('0x1b')]=_0x2ec3a5;if(_0x1199dd[_0xa914('0x30')][_0xa914('0x42')]){_0x7f0585['include']=[{'all':!![]}];}return db[_0xa914('0x2a')][_0xa914('0x43')](_0x7f0585);})[_0xa914('0x21')](function(_0x2f167d){_0x285e52[_0xa914('0x44')]=_0x2f167d;return _0x285e52;})[_0xa914('0x21')](respondWithFilteredResult(_0x56d97b,_0x7f0585))['catch'](handleError(_0x56d97b,null));};exports[_0xa914('0x45')]=function(_0x5c157f,_0x3cca64){var _0x4d3436={'raw':!![],'where':{'id':_0x5c157f[_0xa914('0x46')]['id']}},_0x3318b5={};_0x3318b5['model']=_['keys'](db[_0xa914('0x2a')][_0xa914('0x2b')]);_0x3318b5[_0xa914('0x30')]=_[_0xa914('0x31')](_0x5c157f[_0xa914('0x30')]);_0x3318b5[_0xa914('0x32')]=_[_0xa914('0x33')](_0x3318b5[_0xa914('0x2e')],_0x3318b5[_0xa914('0x30')]);_0x4d3436[_0xa914('0x35')]=_['intersection'](_0x3318b5[_0xa914('0x2e')],qs[_0xa914('0x34')](_0x5c157f[_0xa914('0x30')][_0xa914('0x34')]));_0x4d3436[_0xa914('0x35')]=_0x4d3436['attributes']['length']?_0x4d3436['attributes']:_0x3318b5[_0xa914('0x2e')];if(_0x5c157f[_0xa914('0x30')]['includeAll']){_0x4d3436['include']=[{'all':!![]}];}_0x4d3436=_[_0xa914('0x3e')]({},_0x4d3436,_0x5c157f['options']);return db['Disposition']['find'](_0x4d3436)['then'](handleEntityNotFound(_0x3cca64,null))['then'](respondWithResult(_0x3cca64,null))[_0xa914('0x47')](handleError(_0x3cca64,null));};exports[_0xa914('0x48')]=function(_0x24c595,_0x26c671){return db[_0xa914('0x2a')]['create'](_0x24c595[_0xa914('0x49')],{})[_0xa914('0x21')](function(_0x2fd716){var _0x1731e0=_0x24c595[_0xa914('0x4a')]['get']({'plain':!![]});if(!_0x1731e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1731e0[_0xa914('0x4b')]===_0xa914('0x4a')){var _0x863e25=_0x2fd716[_0xa914('0x22')]({'plain':!![]});var _0x2604ae=_0xa914('0x4c');return db[_0xa914('0x4d')][_0xa914('0x4e')]({'where':{'name':_0x2604ae,'userProfileId':_0x1731e0[_0xa914('0x4f')]},'raw':!![]})[_0xa914('0x21')](function(_0x385367){if(_0x385367&&_0x385367['autoAssociation']===0x0){return db[_0xa914('0x23')][_0xa914('0x48')]({'name':_0x863e25[_0xa914('0x2f')],'resourceId':_0x863e25['id'],'type':_0x385367['name'],'sectionId':_0x385367['id']},{})[_0xa914('0x21')](function(){return _0x2fd716;});}else{return _0x2fd716;}})[_0xa914('0x47')](function(_0x169fc2){logger[_0xa914('0x25')](_0xa914('0x50'),_0x169fc2);throw _0x169fc2;});}return _0x2fd716;})['then'](respondWithResult(_0x26c671,0xc9))[_0xa914('0x47')](handleError(_0x26c671,null));};exports['update']=function(_0x3982c4,_0x4fa1d2){if(_0x3982c4['body']['id']){delete _0x3982c4[_0xa914('0x49')]['id'];}return db[_0xa914('0x2a')][_0xa914('0x4e')]({'where':{'id':_0x3982c4[_0xa914('0x46')]['id']}})[_0xa914('0x21')](handleEntityNotFound(_0x4fa1d2,null))[_0xa914('0x21')](saveUpdates(_0x3982c4[_0xa914('0x49')],null))[_0xa914('0x21')](respondWithResult(_0x4fa1d2,null))[_0xa914('0x47')](handleError(_0x4fa1d2,null));};exports[_0xa914('0x20')]=function(_0x1268e7,_0x4da746){return db[_0xa914('0x2a')][_0xa914('0x4e')]({'where':{'id':_0x1268e7[_0xa914('0x46')]['id']}})[_0xa914('0x21')](handleEntityNotFound(_0x4da746,null))[_0xa914('0x21')](removeEntity(_0x4da746,null))['catch'](handleError(_0x4da746,null));}; \ No newline at end of file +var _0x7e1e=['send','index','map','Disposition','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','findAll','show','params','rawAttributes','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','Dispositions','UserProfileResource','end','error','name'];(function(_0x2ef280,_0x4749ff){var _0x41f008=function(_0x3512db){while(--_0x3512db){_0x2ef280['push'](_0x2ef280['shift']());}};_0x41f008(++_0x4749ff);}(_0x7e1e,0x183));var _0xe7e1=function(_0x7866dd,_0x375721){_0x7866dd=_0x7866dd-0x0;var _0x32f0fe=_0x7e1e[_0x7866dd];return _0x32f0fe;};'use strict';var emlformat=require(_0xe7e1('0x0'));var rimraf=require(_0xe7e1('0x1'));var zipdir=require(_0xe7e1('0x2'));var jsonpatch=require(_0xe7e1('0x3'));var rp=require('request-promise');var moment=require(_0xe7e1('0x4'));var BPromise=require(_0xe7e1('0x5'));var Mustache=require('mustache');var util=require(_0xe7e1('0x6'));var path=require(_0xe7e1('0x7'));var sox=require(_0xe7e1('0x8'));var csv=require(_0xe7e1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe7e1('0xa'));var _=require(_0xe7e1('0xb'));var squel=require(_0xe7e1('0xc'));var crypto=require(_0xe7e1('0xd'));var jsforce=require(_0xe7e1('0xe'));var deskjs=require(_0xe7e1('0xf'));var toCsv=require(_0xe7e1('0x9'));var querystring=require(_0xe7e1('0x10'));var Papa=require(_0xe7e1('0x11'));var Redis=require(_0xe7e1('0x12'));var authService=require(_0xe7e1('0x13'));var qs=require(_0xe7e1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe7e1('0x15'));var logger=require(_0xe7e1('0x16'))(_0xe7e1('0x17'));var utils=require(_0xe7e1('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xe7e1('0x19'));var db=require(_0xe7e1('0x1a'))['db'];function respondWithStatusCode(_0x2b9ffd,_0x192090){_0x192090=_0x192090||0xcc;return function(_0x2be492){if(_0x2be492){return _0x2b9ffd[_0xe7e1('0x1b')](_0x192090);}return _0x2b9ffd[_0xe7e1('0x1c')](_0x192090)['end']();};}function respondWithResult(_0x5ddd53,_0x207d51){_0x207d51=_0x207d51||0xc8;return function(_0x189c17){if(_0x189c17){return _0x5ddd53[_0xe7e1('0x1c')](_0x207d51)['json'](_0x189c17);}};}function respondWithFilteredResult(_0x3219aa,_0x319fb1){return function(_0x2732d4){if(_0x2732d4){var _0x46c1f6=typeof _0x319fb1[_0xe7e1('0x1d')]===_0xe7e1('0x1e')&&typeof _0x319fb1[_0xe7e1('0x1f')]===_0xe7e1('0x1e');var _0x585c21=_0x2732d4[_0xe7e1('0x20')];var _0x655d24=_0x46c1f6?0x0:_0x319fb1[_0xe7e1('0x1d')];var _0x5ad153=_0x46c1f6?_0x2732d4[_0xe7e1('0x20')]:_0x319fb1[_0xe7e1('0x1d')]+_0x319fb1[_0xe7e1('0x1f')];var _0x244022;if(_0x5ad153>=_0x585c21){_0x5ad153=_0x585c21;_0x244022=0xc8;}else{_0x244022=0xce;}_0x3219aa[_0xe7e1('0x1c')](_0x244022);return _0x3219aa[_0xe7e1('0x21')](_0xe7e1('0x22'),_0x655d24+'-'+_0x5ad153+'/'+_0x585c21)[_0xe7e1('0x23')](_0x2732d4);}return null;};}function patchUpdates(_0x2e0a36){return function(_0x2ec709){try{jsonpatch[_0xe7e1('0x24')](_0x2ec709,_0x2e0a36,!![]);}catch(_0x2ab57a){return BPromise[_0xe7e1('0x25')](_0x2ab57a);}return _0x2ec709[_0xe7e1('0x26')]();};}function saveUpdates(_0x95def3,_0x2950ce){return function(_0x5bd4b5){if(_0x5bd4b5){return _0x5bd4b5[_0xe7e1('0x27')](_0x95def3)['then'](function(_0x3b7b21){return _0x3b7b21;});}return null;};}function removeEntity(_0x4f96d9,_0xa21c13){return function(_0x55eee5){if(_0x55eee5){return _0x55eee5[_0xe7e1('0x28')]()[_0xe7e1('0x29')](function(){var _0x4ca642=_0x55eee5[_0xe7e1('0x2a')]({'plain':!![]});var _0x499571=_0xe7e1('0x2b');return db[_0xe7e1('0x2c')][_0xe7e1('0x28')]({'where':{'type':_0x499571,'resourceId':_0x4ca642['id']}})[_0xe7e1('0x29')](function(){return _0x55eee5;});})[_0xe7e1('0x29')](function(){_0x4f96d9[_0xe7e1('0x1c')](0xcc)[_0xe7e1('0x2d')]();});}};}function handleEntityNotFound(_0x962da6,_0x14f268){return function(_0xfe4330){if(!_0xfe4330){_0x962da6[_0xe7e1('0x1b')](0x194);}return _0xfe4330;};}function handleError(_0x16a087,_0x519522){_0x519522=_0x519522||0x1f4;return function(_0x216e70){logger[_0xe7e1('0x2e')](_0x216e70['stack']);if(_0x216e70[_0xe7e1('0x2f')]){delete _0x216e70[_0xe7e1('0x2f')];}_0x16a087[_0xe7e1('0x1c')](_0x519522)[_0xe7e1('0x30')](_0x216e70);};}exports[_0xe7e1('0x31')]=function(_0x5ee515,_0x451d0c){var _0x2a1c3a={},_0x5a2954={},_0x38399b={'count':0x0,'rows':[]};var _0x444daa=_[_0xe7e1('0x32')](db[_0xe7e1('0x33')]['rawAttributes'],function(_0x71029e){return{'name':_0x71029e[_0xe7e1('0x34')],'type':_0x71029e[_0xe7e1('0x35')][_0xe7e1('0x36')]};});_0x5a2954['model']=_['map'](_0x444daa,'name');_0x5a2954[_0xe7e1('0x37')]=_[_0xe7e1('0x38')](_0x5ee515['query']);_0x5a2954['filters']=_[_0xe7e1('0x39')](_0x5a2954[_0xe7e1('0x3a')],_0x5a2954[_0xe7e1('0x37')]);_0x2a1c3a[_0xe7e1('0x3b')]=_[_0xe7e1('0x39')](_0x5a2954[_0xe7e1('0x3a')],qs['fields'](_0x5ee515[_0xe7e1('0x37')][_0xe7e1('0x3c')]));_0x2a1c3a[_0xe7e1('0x3b')]=_0x2a1c3a[_0xe7e1('0x3b')][_0xe7e1('0x3d')]?_0x2a1c3a['attributes']:_0x5a2954[_0xe7e1('0x3a')];if(!_0x5ee515[_0xe7e1('0x37')]['hasOwnProperty'](_0xe7e1('0x3e'))){_0x2a1c3a[_0xe7e1('0x1f')]=qs['limit'](_0x5ee515['query'][_0xe7e1('0x1f')]);_0x2a1c3a['offset']=qs['offset'](_0x5ee515[_0xe7e1('0x37')][_0xe7e1('0x1d')]);}_0x2a1c3a['order']=qs[_0xe7e1('0x3f')](_0x5ee515['query']['sort']);_0x2a1c3a[_0xe7e1('0x40')]=qs[_0xe7e1('0x41')](_[_0xe7e1('0x42')](_0x5ee515[_0xe7e1('0x37')],_0x5a2954['filters']),_0x444daa);if(_0x5ee515['query'][_0xe7e1('0x43')]){_0x2a1c3a[_0xe7e1('0x40')]=_[_0xe7e1('0x44')](_0x2a1c3a[_0xe7e1('0x40')],{'$or':_[_0xe7e1('0x32')](_0x444daa,function(_0x2fcf56){if(_0x2fcf56[_0xe7e1('0x35')]!=='VIRTUAL'){var _0x1bf815={};_0x1bf815[_0x2fcf56[_0xe7e1('0x2f')]]={'$like':'%'+_0x5ee515['query'][_0xe7e1('0x43')]+'%'};return _0x1bf815;}})});}_0x2a1c3a=_['merge']({},_0x2a1c3a,_0x5ee515[_0xe7e1('0x45')]);var _0x59cae8={'where':_0x2a1c3a[_0xe7e1('0x40')]};return db[_0xe7e1('0x33')]['count'](_0x59cae8)[_0xe7e1('0x29')](function(_0x5c9ae2){_0x38399b['count']=_0x5c9ae2;if(_0x5ee515[_0xe7e1('0x37')][_0xe7e1('0x46')]){_0x2a1c3a['include']=[{'all':!![]}];}return db[_0xe7e1('0x33')][_0xe7e1('0x47')](_0x2a1c3a);})[_0xe7e1('0x29')](function(_0x554374){_0x38399b['rows']=_0x554374;return _0x38399b;})[_0xe7e1('0x29')](respondWithFilteredResult(_0x451d0c,_0x2a1c3a))['catch'](handleError(_0x451d0c,null));};exports[_0xe7e1('0x48')]=function(_0x1a2c71,_0x87ba98){var _0x9b329e={'raw':!![],'where':{'id':_0x1a2c71[_0xe7e1('0x49')]['id']}},_0x50ea02={};_0x50ea02[_0xe7e1('0x3a')]=_[_0xe7e1('0x38')](db['Disposition'][_0xe7e1('0x4a')]);_0x50ea02[_0xe7e1('0x37')]=_['keys'](_0x1a2c71['query']);_0x50ea02[_0xe7e1('0x41')]=_['intersection'](_0x50ea02['model'],_0x50ea02[_0xe7e1('0x37')]);_0x9b329e[_0xe7e1('0x3b')]=_[_0xe7e1('0x39')](_0x50ea02[_0xe7e1('0x3a')],qs[_0xe7e1('0x3c')](_0x1a2c71[_0xe7e1('0x37')][_0xe7e1('0x3c')]));_0x9b329e[_0xe7e1('0x3b')]=_0x9b329e[_0xe7e1('0x3b')][_0xe7e1('0x3d')]?_0x9b329e[_0xe7e1('0x3b')]:_0x50ea02['model'];if(_0x1a2c71[_0xe7e1('0x37')][_0xe7e1('0x46')]){_0x9b329e[_0xe7e1('0x4b')]=[{'all':!![]}];}_0x9b329e=_[_0xe7e1('0x44')]({},_0x9b329e,_0x1a2c71[_0xe7e1('0x45')]);return db[_0xe7e1('0x33')][_0xe7e1('0x4c')](_0x9b329e)[_0xe7e1('0x29')](handleEntityNotFound(_0x87ba98,null))[_0xe7e1('0x29')](respondWithResult(_0x87ba98,null))[_0xe7e1('0x4d')](handleError(_0x87ba98,null));};exports[_0xe7e1('0x4e')]=function(_0x2acd9d,_0x3a389a){return db[_0xe7e1('0x33')][_0xe7e1('0x4e')](_0x2acd9d['body'],{})[_0xe7e1('0x29')](function(_0x37e45f){var _0x2f4350=_0x2acd9d[_0xe7e1('0x4f')][_0xe7e1('0x2a')]({'plain':!![]});if(!_0x2f4350)throw new Error(_0xe7e1('0x50'));if(_0x2f4350[_0xe7e1('0x51')]===_0xe7e1('0x4f')){var _0x61f4d1=_0x37e45f[_0xe7e1('0x2a')]({'plain':!![]});var _0x5024a2=_0xe7e1('0x2b');return db[_0xe7e1('0x52')][_0xe7e1('0x4c')]({'where':{'name':_0x5024a2,'userProfileId':_0x2f4350[_0xe7e1('0x53')]},'raw':!![]})[_0xe7e1('0x29')](function(_0x2a6cc9){if(_0x2a6cc9&&_0x2a6cc9[_0xe7e1('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x61f4d1['name'],'resourceId':_0x61f4d1['id'],'type':_0x2a6cc9['name'],'sectionId':_0x2a6cc9['id']},{})[_0xe7e1('0x29')](function(){return _0x37e45f;});}else{return _0x37e45f;}})[_0xe7e1('0x4d')](function(_0x19e87c){logger[_0xe7e1('0x2e')](_0xe7e1('0x55'),_0x19e87c);throw _0x19e87c;});}return _0x37e45f;})[_0xe7e1('0x29')](respondWithResult(_0x3a389a,0xc9))[_0xe7e1('0x4d')](handleError(_0x3a389a,null));};exports[_0xe7e1('0x27')]=function(_0x3dca0c,_0x38530d){if(_0x3dca0c['body']['id']){delete _0x3dca0c['body']['id'];}return db[_0xe7e1('0x33')][_0xe7e1('0x4c')]({'where':{'id':_0x3dca0c[_0xe7e1('0x49')]['id']}})[_0xe7e1('0x29')](handleEntityNotFound(_0x38530d,null))[_0xe7e1('0x29')](saveUpdates(_0x3dca0c[_0xe7e1('0x56')],null))['then'](respondWithResult(_0x38530d,null))[_0xe7e1('0x4d')](handleError(_0x38530d,null));};exports[_0xe7e1('0x28')]=function(_0x30f242,_0x1ab75d){return db['Disposition']['find']({'where':{'id':_0x30f242[_0xe7e1('0x49')]['id']}})['then'](handleEntityNotFound(_0x1ab75d,null))[_0xe7e1('0x29')](removeEntity(_0x1ab75d,null))[_0xe7e1('0x4d')](handleError(_0x1ab75d,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 2d3e657..13b0604 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 _0x392f=['../../config/logger','api','request-promise','rimraf','../../config/environment','exports','Disposition','tools_dispositions','name','ListId','name_chat','ChatWebsiteId','MailAccountId','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','lodash','util'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x392f,0x1f2));var _0xf392=function(_0x1de2bc,_0x5ec2a7){_0x1de2bc=_0x1de2bc-0x0;var _0x29facd=_0x392f[_0x1de2bc];return _0x29facd;};'use strict';var _=require(_0xf392('0x0'));var util=require(_0xf392('0x1'));var logger=require(_0xf392('0x2'))(_0xf392('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf392('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf392('0x5'));var config=require(_0xf392('0x6'));var attributes=require('./disposition.attributes');module[_0xf392('0x7')]=function(_0x4f9f5f,_0x350156){return _0x4f9f5f['define'](_0xf392('0x8'),attributes,{'tableName':_0xf392('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0xf392('0xa'),_0xf392('0xb')]},{'unique':!![],'name':_0xf392('0xc'),'fields':[_0xf392('0xa'),_0xf392('0xd')]},{'unique':!![],'name':'name_mail','fields':[_0xf392('0xa'),_0xf392('0xe')]},{'unique':!![],'name':'name_sms','fields':[_0xf392('0xa'),_0xf392('0xf')]},{'unique':!![],'name':_0xf392('0x10'),'fields':[_0xf392('0xa'),'FaxAccountId']},{'unique':!![],'name':_0xf392('0x11'),'fields':[_0xf392('0xa'),_0xf392('0x12')]},{'unique':!![],'name':_0xf392('0x13'),'fields':[_0xf392('0xa'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x236b=['request-promise','path','rimraf','exports','define','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','moment'];(function(_0x323878,_0x185d97){var _0xda4c45=function(_0x35e3b1){while(--_0x35e3b1){_0x323878['push'](_0x323878['shift']());}};_0xda4c45(++_0x185d97);}(_0x236b,0x11b));var _0xb236=function(_0x49904e,_0x5e4de9){_0x49904e=_0x49904e-0x0;var _0x168604=_0x236b[_0x49904e];return _0x168604;};'use strict';var _=require(_0xb236('0x0'));var util=require(_0xb236('0x1'));var logger=require(_0xb236('0x2'))(_0xb236('0x3'));var moment=require(_0xb236('0x4'));var BPromise=require('bluebird');var rp=require(_0xb236('0x5'));var fs=require('fs');var path=require(_0xb236('0x6'));var rimraf=require(_0xb236('0x7'));var config=require('../../config/environment');var attributes=require('./disposition.attributes');module[_0xb236('0x8')]=function(_0x3e7212,_0xbb2566){return _0x3e7212[_0xb236('0x9')]('Disposition',attributes,{'tableName':_0xb236('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xb236('0xb'),'fields':[_0xb236('0xc'),_0xb236('0xd')]},{'unique':!![],'name':_0xb236('0xe'),'fields':[_0xb236('0xc'),_0xb236('0xf')]},{'unique':!![],'name':_0xb236('0x10'),'fields':[_0xb236('0xc'),_0xb236('0x11')]},{'unique':!![],'name':_0xb236('0x12'),'fields':[_0xb236('0xc'),_0xb236('0x13')]},{'unique':!![],'name':_0xb236('0x14'),'fields':[_0xb236('0xc'),_0xb236('0x15')]},{'unique':!![],'name':'name_openchannel','fields':[_0xb236('0xc'),'OpenchannelAccountId']},{'unique':!![],'name':_0xb236('0x16'),'fields':[_0xb236('0xc'),_0xb236('0x17')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 3a31906..2121690 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(_0x4203dc,_0x2cf919){var _0x449648=function(_0x83dc5){while(--_0x83dc5){_0x4203dc['push'](_0x4203dc['shift']());}};_0x449648(++_0x2cf919);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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(_0xc46270,_0x252249){var _0x318c74=function(_0x54c610){while(--_0x54c610){_0xc46270['push'](_0xc46270['shift']());}};_0x318c74(++_0x252249);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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 851b393..5a0a863 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 _0xaefd=['fs-extra','../../components/auth/service','../../config/environment','./disposition.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x54fc1f,_0x1703c2){var _0x53f699=function(_0x3fad74){while(--_0x3fad74){_0x54fc1f['push'](_0x54fc1f['shift']());}};_0x53f699(++_0x1703c2);}(_0xaefd,0x1c6));var _0xdaef=function(_0x1eb331,_0x491365){_0x1eb331=_0x1eb331-0x0;var _0x225fe2=_0xaefd[_0x1eb331];return _0x225fe2;};'use strict';var multer=require(_0xdaef('0x0'));var util=require(_0xdaef('0x1'));var path=require(_0xdaef('0x2'));var timeout=require(_0xdaef('0x3'));var express=require(_0xdaef('0x4'));var router=express[_0xdaef('0x5')]();var fs_extra=require(_0xdaef('0x6'));var auth=require(_0xdaef('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdaef('0x8'));var controller=require(_0xdaef('0x9'));router[_0xdaef('0xa')]('/',auth[_0xdaef('0xb')](),controller['index']);router[_0xdaef('0xa')](_0xdaef('0xc'),auth[_0xdaef('0xb')](),controller[_0xdaef('0xd')]);router[_0xdaef('0xe')]('/',auth[_0xdaef('0xb')](),controller['create']);router[_0xdaef('0xf')](_0xdaef('0xc'),auth[_0xdaef('0xb')](),controller[_0xdaef('0x10')]);router[_0xdaef('0x11')]('/:id',auth[_0xdaef('0xb')](),controller[_0xdaef('0x12')]);module[_0xdaef('0x13')]=router; \ No newline at end of file +var _0xf04e=['delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','get','index','/:id','isAuthenticated','show','post','create','put'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xf04e,0x8b));var _0xef04=function(_0x213d0d,_0x16f057){_0x213d0d=_0x213d0d-0x0;var _0x5b684d=_0xf04e[_0x213d0d];return _0x5b684d;};'use strict';var multer=require(_0xef04('0x0'));var util=require(_0xef04('0x1'));var path=require(_0xef04('0x2'));var timeout=require('connect-timeout');var express=require(_0xef04('0x3'));var router=express[_0xef04('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xef04('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./disposition.controller');router[_0xef04('0x6')]('/',auth['isAuthenticated'](),controller[_0xef04('0x7')]);router[_0xef04('0x6')](_0xef04('0x8'),auth[_0xef04('0x9')](),controller[_0xef04('0xa')]);router[_0xef04('0xb')]('/',auth['isAuthenticated'](),controller[_0xef04('0xc')]);router[_0xef04('0xd')](_0xef04('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xef04('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xef04('0xf')]);module[_0xef04('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index adbdd3e..d8438de 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 _0x6429=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','2400','4800','7200','9600','14400','12000','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x2c72e6,_0x4488cf){var _0x2c8bc3=function(_0x476acc){while(--_0x476acc){_0x2c72e6['push'](_0x2c72e6['shift']());}};_0x2c8bc3(++_0x4488cf);}(_0x6429,0x16c));var _0x9642=function(_0x28ef4e,_0x202aa3){_0x28ef4e=_0x28ef4e-0x0;var _0x1aa097=_0x6429[_0x28ef4e];return _0x1aa097;};'use strict';var Sequelize=require(_0x9642('0x0'));module[_0x9642('0x1')]={'name':{'type':Sequelize[_0x9642('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9642('0x2')]},'ecm':{'type':Sequelize[_0x9642('0x3')](_0x9642('0x4'),'no'),'defaultValue':_0x9642('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x9642('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x9642('0x3')](_0x9642('0x6'),_0x9642('0x7'),_0x9642('0x8'),_0x9642('0x9'),'12000',_0x9642('0xa')),'defaultValue':_0x9642('0x7')},'maxrate':{'type':Sequelize[_0x9642('0x3')](_0x9642('0x6'),_0x9642('0x7'),_0x9642('0x8'),'9600',_0x9642('0xb'),'14400'),'defaultValue':_0x9642('0xa')},'modem':{'type':Sequelize[_0x9642('0x2')],'defaultValue':_0x9642('0xc')},'gateway':{'type':Sequelize['STRING'],'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[_0x9642('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x9642('0xe'),_0x9642('0xf'),_0x9642('0x10'),_0x9642('0x11')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x9642('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9642('0x12');}},'notificationSound':{'type':Sequelize[_0x9642('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9642('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9642('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9642('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9642('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9642('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x9642('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x9642('0x13')],'defaultValue':![],'comment':_0x9642('0x15'),'set':function(_0x2c39ee){if(!_0x2c39ee)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x9642('0x16')](_0x9642('0x17'),_0x2c39ee);}}}; \ No newline at end of file +var _0xf289=['INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','2400','4800','7200','9600','12000','14400','v17,v27,v29','IAX','DADHI','SIP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x2872c5,_0x362506){var _0x5a3d07=function(_0x225572){while(--_0x225572){_0x2872c5['push'](_0x2872c5['shift']());}};_0x5a3d07(++_0x362506);}(_0xf289,0x10d));var _0x9f28=function(_0x29b603,_0x12b48e){_0x29b603=_0x29b603-0x0;var _0x3b741e=_0xf289[_0x29b603];return _0x3b741e;};'use strict';var Sequelize=require(_0x9f28('0x0'));module[_0x9f28('0x1')]={'name':{'type':Sequelize[_0x9f28('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9f28('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0x9f28('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x9f28('0x2')],'defaultValue':_0x9f28('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x9f28('0x5')},'minrate':{'type':Sequelize[_0x9f28('0x6')](_0x9f28('0x7'),_0x9f28('0x8'),_0x9f28('0x9'),_0x9f28('0xa'),_0x9f28('0xb'),_0x9f28('0xc')),'defaultValue':_0x9f28('0x8')},'maxrate':{'type':Sequelize[_0x9f28('0x6')](_0x9f28('0x7'),'4800',_0x9f28('0x9'),_0x9f28('0xa'),'12000',_0x9f28('0xc')),'defaultValue':_0x9f28('0xc')},'modem':{'type':Sequelize[_0x9f28('0x2')],'defaultValue':_0x9f28('0xd')},'gateway':{'type':Sequelize[_0x9f28('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x9f28('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x9f28('0x6')]('SIP',_0x9f28('0xe'),_0x9f28('0xf'),'KHOMP'),'defaultValue':_0x9f28('0x10')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9f28('0x11');}},'notificationSound':{'type':Sequelize[_0x9f28('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9f28('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9f28('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9f28('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9f28('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9f28('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9f28('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9f28('0x13')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9f28('0x14'),'set':function(_0x27a036){if(!_0x27a036)this[_0x9f28('0x15')](_0x9f28('0x16'),null);this[_0x9f28('0x15')](_0x9f28('0x17'),_0x27a036);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 6452816..ff8c1c4 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 _0x81bb=['stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','include','findAll','rows','show','params','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','length','order','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','CmContact','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','ecm','faxdetect','headerinfo','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','transaction','VoiceExtension','bulkCreate','tech','createdAt','updatedAt','TrunkId','findById','getMessages','FaxMessage','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','from','format','fax','ListId','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','omit','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','User','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent'];(function(_0xbe3a87,_0x58539a){var _0x1603ea=function(_0x3d0434){while(--_0x3d0434){_0xbe3a87['push'](_0xbe3a87['shift']());}};_0x1603ea(++_0x58539a);}(_0x81bb,0x162));var _0xb81b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x81bb[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb81b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb81b('0x1'));var jsonpatch=require(_0xb81b('0x2'));var rp=require(_0xb81b('0x3'));var moment=require(_0xb81b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb81b('0x5'));var sox=require(_0xb81b('0x6'));var csv=require(_0xb81b('0x7'));var ejs=require(_0xb81b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb81b('0x9'));var squel=require(_0xb81b('0xa'));var crypto=require(_0xb81b('0xb'));var jsforce=require(_0xb81b('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb81b('0xd'));var Papa=require(_0xb81b('0xe'));var Redis=require(_0xb81b('0xf'));var authService=require(_0xb81b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb81b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb81b('0x12'))('api');var utils=require(_0xb81b('0x13'));var config=require(_0xb81b('0x14'));var licenseUtil=require(_0xb81b('0x15'));var db=require(_0xb81b('0x16'))['db'];config[_0xb81b('0x17')]=_[_0xb81b('0x18')](config['redis'],{'host':_0xb81b('0x19'),'port':0x18eb});var socket=require(_0xb81b('0x1a'))(new Redis(config[_0xb81b('0x17')]));require(_0xb81b('0x1b'))[_0xb81b('0x1c')](socket);var jayson=require(_0xb81b('0x1d'));var client=jayson[_0xb81b('0x1e')][_0xb81b('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0xb81b('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x9227e5,_0x334a4e,_0x42a3a0,_0x497ec4){return new BPromise(function(_0x1b737f,_0x13b010){var _0x2fedb6=_0x497ec4||client;return _0x2fedb6['request'](_0x9227e5,_0x42a3a0)[_0xb81b('0x20')](function(_0x244074){logger[_0xb81b('0x21')](_0xb81b('0x22'),_0x334a4e,_0xb81b('0x23'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x334a4e,'request\x20sent',JSON[_0xb81b('0x24')](_0x244074));if(_0x244074['error']){if(_0x244074[_0xb81b('0x25')][_0xb81b('0x26')]===0x1f4){logger[_0xb81b('0x25')]('FaxAccount,\x20%s,\x20%s',_0x334a4e,_0x244074[_0xb81b('0x25')][_0xb81b('0x27')]);return _0x13b010(_0x244074[_0xb81b('0x25')][_0xb81b('0x27')]);}logger[_0xb81b('0x25')](_0xb81b('0x22'),_0x334a4e,_0x244074['error'][_0xb81b('0x27')]);return _0x1b737f(_0x244074[_0xb81b('0x25')][_0xb81b('0x27')]);}else{logger[_0xb81b('0x21')](_0xb81b('0x22'),_0x334a4e,_0xb81b('0x23'));_0x1b737f(_0x244074[_0xb81b('0x28')]['message']);}})[_0xb81b('0x29')](function(_0xcbb6f6){logger['error'](_0xb81b('0x22'),_0x334a4e,_0xcbb6f6);_0x13b010(_0xcbb6f6);});});}function respondWithStatusCode(_0x4c077c,_0x2438a3){_0x2438a3=_0x2438a3||0xcc;return function(_0xdb20d5){if(_0xdb20d5){return _0x4c077c[_0xb81b('0x2a')](_0x2438a3);}return _0x4c077c[_0xb81b('0x2b')](_0x2438a3)['end']();};}function respondWithResult(_0x19909d,_0x333727){_0x333727=_0x333727||0xc8;return function(_0x1c458f){if(_0x1c458f){return _0x19909d[_0xb81b('0x2b')](_0x333727)[_0xb81b('0x2c')](_0x1c458f);}};}function respondWithFilteredResult(_0x1e38d6,_0x1b0241){return function(_0x40f879){if(_0x40f879){var _0x41af95=typeof _0x1b0241[_0xb81b('0x2d')]===_0xb81b('0x2e')&&typeof _0x1b0241[_0xb81b('0x2f')]==='undefined';var _0x5c98cc=_0x40f879[_0xb81b('0x30')];var _0x53467d=_0x41af95?0x0:_0x1b0241[_0xb81b('0x2d')];var _0x49e39e=_0x41af95?_0x40f879[_0xb81b('0x30')]:_0x1b0241[_0xb81b('0x2d')]+_0x1b0241[_0xb81b('0x2f')];var _0x4fd045;if(_0x49e39e>=_0x5c98cc){_0x49e39e=_0x5c98cc;_0x4fd045=0xc8;}else{_0x4fd045=0xce;}_0x1e38d6['status'](_0x4fd045);return _0x1e38d6[_0xb81b('0x31')]('Content-Range',_0x53467d+'-'+_0x49e39e+'/'+_0x5c98cc)['json'](_0x40f879);}return null;};}function patchUpdates(_0x23c046){return function(_0x27e5cc){try{jsonpatch[_0xb81b('0x32')](_0x27e5cc,_0x23c046,!![]);}catch(_0xcd3ce9){return BPromise[_0xb81b('0x33')](_0xcd3ce9);}return _0x27e5cc[_0xb81b('0x34')]();};}function saveUpdates(_0x378799,_0x169578){return function(_0x5cf59a){if(_0x5cf59a){return _0x5cf59a[_0xb81b('0x35')](_0x378799)['then'](function(_0x27a008){return _0x27a008;});}return null;};}function removeEntity(_0x3aab44,_0x1cd2c1){return function(_0x3799aa){if(_0x3799aa){return _0x3799aa[_0xb81b('0x36')]()[_0xb81b('0x20')](function(){var _0x35c164=_0x3799aa[_0xb81b('0x37')]({'plain':!![]});var _0x21f95e=_0xb81b('0x38');return db[_0xb81b('0x39')]['destroy']({'where':{'type':_0x21f95e,'resourceId':_0x35c164['id']}})[_0xb81b('0x20')](function(){return _0x3799aa;});})[_0xb81b('0x20')](function(){_0x3aab44[_0xb81b('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44baab,_0x13ab61){return function(_0x529157){if(!_0x529157){_0x44baab[_0xb81b('0x2a')](0x194);}return _0x529157;};}function handleError(_0x49a843,_0x150b03){_0x150b03=_0x150b03||0x1f4;return function(_0x2b5d7e){logger[_0xb81b('0x25')](_0x2b5d7e[_0xb81b('0x3a')]);if(_0x2b5d7e[_0xb81b('0x3b')]){delete _0x2b5d7e[_0xb81b('0x3b')];}_0x49a843[_0xb81b('0x2b')](_0x150b03)[_0xb81b('0x3c')](_0x2b5d7e);};}exports[_0xb81b('0x3d')]=function(_0x3fecdf,_0x2ab171){var _0x179e8a={'include':[{'model':db[_0xb81b('0x3e')],'as':_0xb81b('0x3f')}]},_0x23ec7b={},_0x2f43fc={'count':0x0,'rows':[]};var _0x4dc835=_[_0xb81b('0x40')](db[_0xb81b('0x41')][_0xb81b('0x42')],function(_0x50910e){return{'name':_0x50910e[_0xb81b('0x43')],'type':_0x50910e[_0xb81b('0x44')][_0xb81b('0x45')]};});_0x23ec7b[_0xb81b('0x46')]=_[_0xb81b('0x40')](_0x4dc835,_0xb81b('0x3b'));_0x23ec7b[_0xb81b('0x47')]=_[_0xb81b('0x48')](_0x3fecdf[_0xb81b('0x47')]);_0x23ec7b[_0xb81b('0x49')]=_['intersection'](_0x23ec7b[_0xb81b('0x46')],_0x23ec7b[_0xb81b('0x47')]);_0x179e8a[_0xb81b('0x4a')]=_[_0xb81b('0x4b')](_0x23ec7b[_0xb81b('0x46')],qs['fields'](_0x3fecdf[_0xb81b('0x47')][_0xb81b('0x4c')]));_0x179e8a[_0xb81b('0x4a')]=_0x179e8a[_0xb81b('0x4a')]['length']?_0x179e8a[_0xb81b('0x4a')]:_0x23ec7b[_0xb81b('0x46')];if(!_0x3fecdf['query'][_0xb81b('0x4d')](_0xb81b('0x4e'))){_0x179e8a[_0xb81b('0x2f')]=qs[_0xb81b('0x2f')](_0x3fecdf['query'][_0xb81b('0x2f')]);_0x179e8a[_0xb81b('0x2d')]=qs[_0xb81b('0x2d')](_0x3fecdf[_0xb81b('0x47')][_0xb81b('0x2d')]);}_0x179e8a['order']=qs['sort'](_0x3fecdf[_0xb81b('0x47')][_0xb81b('0x4f')]);_0x179e8a[_0xb81b('0x50')]=qs[_0xb81b('0x49')](_[_0xb81b('0x51')](_0x3fecdf['query'],_0x23ec7b['filters']),_0x4dc835);if(_0x3fecdf['query']['filter']){_0x179e8a[_0xb81b('0x50')]=_[_0xb81b('0x52')](_0x179e8a[_0xb81b('0x50')],{'$or':_[_0xb81b('0x40')](_0x4dc835,function(_0x3359ae){if(_0x3359ae['type']!==_0xb81b('0x53')){var _0xc5eeb5={};_0xc5eeb5[_0x3359ae[_0xb81b('0x3b')]]={'$like':'%'+_0x3fecdf[_0xb81b('0x47')][_0xb81b('0x54')]+'%'};return _0xc5eeb5;}})});}_0x179e8a=_[_0xb81b('0x52')]({},_0x179e8a,_0x3fecdf['options']);var _0x15ec74={'where':_0x179e8a[_0xb81b('0x50')]};return db[_0xb81b('0x41')]['count'](_0x15ec74)['then'](function(_0x3f08a5){_0x2f43fc['count']=_0x3f08a5;if(_0x3fecdf[_0xb81b('0x47')]['includeAll']){_0x179e8a[_0xb81b('0x55')]=[{'all':!![]}];}return db[_0xb81b('0x41')][_0xb81b('0x56')](_0x179e8a);})['then'](function(_0x356008){_0x2f43fc[_0xb81b('0x57')]=_0x356008;return _0x2f43fc;})[_0xb81b('0x20')](respondWithFilteredResult(_0x2ab171,_0x179e8a))['catch'](handleError(_0x2ab171,null));};exports[_0xb81b('0x58')]=function(_0x22bde0,_0x3601fd){var _0x20ba1c={'raw':![],'where':{'id':_0x22bde0[_0xb81b('0x59')]['id']},'include':[{'model':db[_0xb81b('0x3e')],'as':'mandatoryDispositionPause'}]},_0x15b653={};_0x15b653[_0xb81b('0x46')]=_[_0xb81b('0x48')](db[_0xb81b('0x41')][_0xb81b('0x42')]);_0x15b653[_0xb81b('0x47')]=_[_0xb81b('0x48')](_0x22bde0[_0xb81b('0x47')]);_0x15b653[_0xb81b('0x49')]=_['intersection'](_0x15b653[_0xb81b('0x46')],_0x15b653[_0xb81b('0x47')]);_0x20ba1c['attributes']=_[_0xb81b('0x4b')](_0x15b653['model'],qs[_0xb81b('0x4c')](_0x22bde0[_0xb81b('0x47')][_0xb81b('0x4c')]));_0x20ba1c[_0xb81b('0x4a')]=_0x20ba1c[_0xb81b('0x4a')]['length']?_0x20ba1c[_0xb81b('0x4a')]:_0x15b653[_0xb81b('0x46')];if(_0x22bde0[_0xb81b('0x47')][_0xb81b('0x5a')]){_0x20ba1c[_0xb81b('0x55')]=[{'all':!![]}];}_0x20ba1c=_[_0xb81b('0x52')]({},_0x20ba1c,_0x22bde0[_0xb81b('0x5b')]);return db[_0xb81b('0x41')][_0xb81b('0x5c')](_0x20ba1c)[_0xb81b('0x20')](handleEntityNotFound(_0x3601fd,null))[_0xb81b('0x20')](respondWithResult(_0x3601fd,null))[_0xb81b('0x29')](handleError(_0x3601fd,null));};exports[_0xb81b('0x5d')]=function(_0xa722ec,_0x46b203){return db[_0xb81b('0x41')][_0xb81b('0x5d')](_0xa722ec[_0xb81b('0x5e')],{})['then'](function(_0x4a01c3){var _0x5a2981=_0xa722ec['user'][_0xb81b('0x37')]({'plain':!![]});if(!_0x5a2981)throw new Error(_0xb81b('0x5f'));if(_0x5a2981[_0xb81b('0x60')]===_0xb81b('0x61')){var _0x3cba3a=_0x4a01c3[_0xb81b('0x37')]({'plain':!![]});var _0x8ca63e=_0xb81b('0x38');return db[_0xb81b('0x62')]['find']({'where':{'name':_0x8ca63e,'userProfileId':_0x5a2981[_0xb81b('0x63')]},'raw':!![]})['then'](function(_0x36c742){if(_0x36c742&&_0x36c742['autoAssociation']===0x0){return db[_0xb81b('0x39')][_0xb81b('0x5d')]({'name':_0x3cba3a[_0xb81b('0x3b')],'resourceId':_0x3cba3a['id'],'type':_0x36c742[_0xb81b('0x3b')],'sectionId':_0x36c742['id']},{})[_0xb81b('0x20')](function(){return _0x4a01c3;});}else{return _0x4a01c3;}})[_0xb81b('0x29')](function(_0x1cc727){logger[_0xb81b('0x25')](_0xb81b('0x64'),_0x1cc727);throw _0x1cc727;});}return _0x4a01c3;})[_0xb81b('0x20')](respondWithResult(_0x46b203,0xc9))[_0xb81b('0x29')](handleError(_0x46b203,null));};exports['update']=function(_0x34ee60,_0x516190){if(_0x34ee60['body']['id']){delete _0x34ee60[_0xb81b('0x5e')]['id'];}return db[_0xb81b('0x41')][_0xb81b('0x5c')]({'where':{'id':_0x34ee60[_0xb81b('0x59')]['id']},'include':[{'model':db[_0xb81b('0x3e')],'as':'mandatoryDispositionPause'}]})[_0xb81b('0x20')](handleEntityNotFound(_0x516190,null))['then'](saveUpdates(_0x34ee60[_0xb81b('0x5e')],null))[_0xb81b('0x20')](respondWithResult(_0x516190,null))[_0xb81b('0x29')](handleError(_0x516190,null));};exports[_0xb81b('0x36')]=function(_0x5ef8f9,_0x2963a8){return db['FaxAccount'][_0xb81b('0x5c')]({'where':{'id':_0x5ef8f9[_0xb81b('0x59')]['id']}})['then'](handleEntityNotFound(_0x2963a8,null))['then'](removeEntity(_0x2963a8,null))['catch'](handleError(_0x2963a8,null));};exports[_0xb81b('0x65')]=function(_0x2ae4a5,_0x10b2ed){return db['FaxAccount'][_0xb81b('0x65')]()[_0xb81b('0x20')](respondWithResult(_0x10b2ed,null))[_0xb81b('0x29')](handleError(_0x10b2ed,null));};exports[_0xb81b('0x66')]=function(_0x12083c,_0x18b6d0,_0x5a4916){if(_0x12083c[_0xb81b('0x5e')]['id']){delete _0x12083c[_0xb81b('0x5e')]['id'];}return db[_0xb81b('0x41')][_0xb81b('0x5c')]({'where':{'id':_0x12083c[_0xb81b('0x59')]['id']}})[_0xb81b('0x20')](handleEntityNotFound(_0x18b6d0,null))[_0xb81b('0x20')](function(_0x80a87d){if(_0x80a87d){_0x12083c[_0xb81b('0x5e')][_0xb81b('0x67')]=_0x80a87d['id'];return db[_0xb81b('0x68')][_0xb81b('0x5d')](_0x12083c[_0xb81b('0x5e')]);}})[_0xb81b('0x20')](respondWithResult(_0x18b6d0,null))[_0xb81b('0x29')](handleError(_0x18b6d0,null));};exports[_0xb81b('0x69')]=function(_0x48f6f8,_0x27b13a,_0x49ddc3){var _0x132dfa={'raw':![],'where':{}};var _0x510070={};var _0x51f36a={'count':0x0,'rows':[]};return db['FaxAccount'][_0xb81b('0x6a')]({'where':{'id':_0x48f6f8[_0xb81b('0x59')]['id']}})[_0xb81b('0x20')](handleEntityNotFound(_0x27b13a,null))[_0xb81b('0x20')](function(_0x199d5f){if(_0x199d5f){_0x510070[_0xb81b('0x46')]=_[_0xb81b('0x48')](db[_0xb81b('0x68')][_0xb81b('0x42')]);_0x510070['query']=_[_0xb81b('0x48')](_0x48f6f8[_0xb81b('0x47')]);_0x510070['filters']=_[_0xb81b('0x4b')](_0x510070[_0xb81b('0x46')],_0x510070[_0xb81b('0x47')]);_0x132dfa[_0xb81b('0x4a')]=_[_0xb81b('0x4b')](_0x510070[_0xb81b('0x46')],qs[_0xb81b('0x4c')](_0x48f6f8['query'][_0xb81b('0x4c')]));_0x132dfa[_0xb81b('0x4a')]=_0x132dfa['attributes'][_0xb81b('0x6b')]?_0x132dfa['attributes']:_0x510070['model'];if(!_0x48f6f8[_0xb81b('0x47')][_0xb81b('0x4d')](_0xb81b('0x4e'))){_0x132dfa['limit']=qs[_0xb81b('0x2f')](_0x48f6f8[_0xb81b('0x47')][_0xb81b('0x2f')]);_0x132dfa[_0xb81b('0x2d')]=qs['offset'](_0x48f6f8[_0xb81b('0x47')][_0xb81b('0x2d')]);}_0x132dfa[_0xb81b('0x6c')]=qs[_0xb81b('0x4f')](_0x48f6f8['query'][_0xb81b('0x4f')]);_0x132dfa[_0xb81b('0x50')]=qs['filters'](_[_0xb81b('0x51')](_0x48f6f8[_0xb81b('0x47')],_0x510070[_0xb81b('0x49')]));_0x132dfa['where'][_0xb81b('0x67')]=_0x199d5f['id'];if(_0x48f6f8[_0xb81b('0x47')][_0xb81b('0x54')]){_0x132dfa['where']=_[_0xb81b('0x52')](_0x132dfa[_0xb81b('0x50')],{'$or':_[_0xb81b('0x40')](_0x132dfa['attributes'],function(_0x5d3a41){var _0x2fd742={};_0x2fd742[_0x5d3a41]={'$like':'%'+_0x48f6f8[_0xb81b('0x47')][_0xb81b('0x54')]+'%'};return _0x2fd742;})});}_0x132dfa=_[_0xb81b('0x52')]({},_0x132dfa,_0x48f6f8[_0xb81b('0x5b')]);return db['Disposition'][_0xb81b('0x30')]({'where':_0x132dfa[_0xb81b('0x50')]})[_0xb81b('0x20')](function(_0x236720){_0x51f36a[_0xb81b('0x30')]=_0x236720;if(_0x48f6f8[_0xb81b('0x47')]['includeAll']){_0x132dfa[_0xb81b('0x55')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x132dfa);})[_0xb81b('0x20')](function(_0x44a2f4){_0x51f36a[_0xb81b('0x57')]=_0x44a2f4;return _0x51f36a;});}})['then'](respondWithFilteredResult(_0x27b13a,_0x132dfa))[_0xb81b('0x29')](handleError(_0x27b13a,null));};exports['removeDispositions']=function(_0x40b71b,_0x342bbd,_0x38663a){return db[_0xb81b('0x41')]['find']({'where':{'id':_0x40b71b['params']['id']}})[_0xb81b('0x20')](handleEntityNotFound(_0x342bbd,null))['then'](function(_0x3e6442){if(_0x3e6442){return _0x3e6442[_0xb81b('0x6d')](_0x40b71b[_0xb81b('0x47')][_0xb81b('0x6e')]);}})['then'](respondWithStatusCode(_0x342bbd,null))[_0xb81b('0x29')](handleError(_0x342bbd,null));};exports[_0xb81b('0x6f')]=function(_0x73a4dc,_0x2bf904,_0x3623ed){if(_0x73a4dc[_0xb81b('0x5e')]['id']){delete _0x73a4dc[_0xb81b('0x5e')]['id'];}return db[_0xb81b('0x41')]['find']({'where':{'id':_0x73a4dc['params']['id']}})['then'](handleEntityNotFound(_0x2bf904,null))[_0xb81b('0x20')](function(_0x342b77){if(_0x342b77){_0x73a4dc['body'][_0xb81b('0x67')]=_0x342b77['id'];return db['CannedAnswer'][_0xb81b('0x5d')](_0x73a4dc[_0xb81b('0x5e')]);}})[_0xb81b('0x20')](respondWithResult(_0x2bf904,null))[_0xb81b('0x29')](handleError(_0x2bf904,null));};exports[_0xb81b('0x70')]=function(_0x28c30e,_0x5fb163,_0x352e86){var _0x5abed9={'raw':![],'where':{}};var _0x4adb0f={};var _0x5326a4={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x28c30e[_0xb81b('0x59')]['id']}})[_0xb81b('0x20')](handleEntityNotFound(_0x5fb163,null))[_0xb81b('0x20')](function(_0x11e331){if(_0x11e331){_0x4adb0f[_0xb81b('0x46')]=_['keys'](db[_0xb81b('0x71')]['rawAttributes']);_0x4adb0f[_0xb81b('0x47')]=_[_0xb81b('0x48')](_0x28c30e[_0xb81b('0x47')]);_0x4adb0f[_0xb81b('0x49')]=_[_0xb81b('0x4b')](_0x4adb0f['model'],_0x4adb0f[_0xb81b('0x47')]);_0x5abed9[_0xb81b('0x4a')]=_['intersection'](_0x4adb0f[_0xb81b('0x46')],qs[_0xb81b('0x4c')](_0x28c30e['query']['fields']));_0x5abed9[_0xb81b('0x4a')]=_0x5abed9[_0xb81b('0x4a')][_0xb81b('0x6b')]?_0x5abed9[_0xb81b('0x4a')]:_0x4adb0f[_0xb81b('0x46')];if(!_0x28c30e[_0xb81b('0x47')][_0xb81b('0x4d')]('nolimit')){_0x5abed9['limit']=qs[_0xb81b('0x2f')](_0x28c30e[_0xb81b('0x47')][_0xb81b('0x2f')]);_0x5abed9[_0xb81b('0x2d')]=qs[_0xb81b('0x2d')](_0x28c30e[_0xb81b('0x47')][_0xb81b('0x2d')]);}_0x5abed9[_0xb81b('0x6c')]=qs[_0xb81b('0x4f')](_0x28c30e[_0xb81b('0x47')][_0xb81b('0x4f')]);_0x5abed9[_0xb81b('0x50')]=qs[_0xb81b('0x49')](_[_0xb81b('0x51')](_0x28c30e[_0xb81b('0x47')],_0x4adb0f[_0xb81b('0x49')]));_0x5abed9[_0xb81b('0x50')]['FaxAccountId']=_0x11e331['id'];if(_0x28c30e[_0xb81b('0x47')][_0xb81b('0x54')]){_0x5abed9['where']=_[_0xb81b('0x52')](_0x5abed9[_0xb81b('0x50')],{'$or':_[_0xb81b('0x40')](_0x5abed9['attributes'],function(_0x3a2b19){var _0x4a8f66={};_0x4a8f66[_0x3a2b19]={'$like':'%'+_0x28c30e[_0xb81b('0x47')][_0xb81b('0x54')]+'%'};return _0x4a8f66;})});}_0x5abed9=_[_0xb81b('0x52')]({},_0x5abed9,_0x28c30e[_0xb81b('0x5b')]);return db[_0xb81b('0x71')][_0xb81b('0x30')]({'where':_0x5abed9[_0xb81b('0x50')]})['then'](function(_0x5d63c6){_0x5326a4['count']=_0x5d63c6;if(_0x28c30e[_0xb81b('0x47')][_0xb81b('0x5a')]){_0x5abed9[_0xb81b('0x55')]=[{'all':!![]}];}return db[_0xb81b('0x71')][_0xb81b('0x56')](_0x5abed9);})[_0xb81b('0x20')](function(_0x3bce33){_0x5326a4[_0xb81b('0x57')]=_0x3bce33;return _0x5326a4;});}})[_0xb81b('0x20')](respondWithFilteredResult(_0x5fb163,_0x5abed9))[_0xb81b('0x29')](handleError(_0x5fb163,null));};exports[_0xb81b('0x72')]=function(_0x6a1ada,_0x3ae82f,_0xfc3fcb){return db[_0xb81b('0x41')][_0xb81b('0x5c')]({'where':{'id':_0x6a1ada[_0xb81b('0x59')]['id']}})[_0xb81b('0x20')](handleEntityNotFound(_0x3ae82f,null))[_0xb81b('0x20')](function(_0x10792a){if(_0x10792a){return _0x10792a[_0xb81b('0x72')](_0x6a1ada[_0xb81b('0x47')]['ids']);}})[_0xb81b('0x20')](respondWithStatusCode(_0x3ae82f,null))[_0xb81b('0x29')](handleError(_0x3ae82f,null));};exports[_0xb81b('0x73')]=function(_0x774fcc,_0x26b623,_0x4cda3e){return db[_0xb81b('0x74')][_0xb81b('0x5c')]({'where':{'id':_0x774fcc[_0xb81b('0x59')]['id']}})[_0xb81b('0x20')](handleEntityNotFound(_0x26b623,null))[_0xb81b('0x20')](function(_0x28ebcd){if(_0x28ebcd){return _0x28ebcd['addInteraction'](_0x774fcc['body']['ids'],_['omit'](_0x774fcc['body'],[_0xb81b('0x6e'),'id'])||{});}})['then'](respondWithResult(_0x26b623,null))[_0xb81b('0x29')](handleError(_0x26b623,null));};exports['getInteractions']=function(_0x1df251,_0x23013b,_0x3a7c1e){var _0x42881f={'raw':![],'where':{}};var _0x35c487={};var _0x47c910={'count':0x0,'rows':[]};return db[_0xb81b('0x41')][_0xb81b('0x6a')]({'where':{'id':_0x1df251['params']['id']}})['then'](handleEntityNotFound(_0x23013b,null))[_0xb81b('0x20')](function(_0x3217d2){if(_0x3217d2){_0x35c487[_0xb81b('0x46')]=_[_0xb81b('0x48')](db[_0xb81b('0x74')][_0xb81b('0x42')]);_0x35c487[_0xb81b('0x47')]=_['keys'](_0x1df251[_0xb81b('0x47')]);_0x35c487[_0xb81b('0x49')]=_[_0xb81b('0x4b')](_0x35c487['model'],_0x35c487[_0xb81b('0x47')]);_0x42881f['attributes']=_[_0xb81b('0x4b')](_0x35c487[_0xb81b('0x46')],qs['fields'](_0x1df251[_0xb81b('0x47')][_0xb81b('0x4c')]));_0x42881f[_0xb81b('0x4a')]=_0x42881f[_0xb81b('0x4a')]['length']?_0x42881f[_0xb81b('0x4a')]:_0x35c487[_0xb81b('0x46')];if(!_0x1df251[_0xb81b('0x47')][_0xb81b('0x4d')]('nolimit')){_0x42881f[_0xb81b('0x2f')]=qs[_0xb81b('0x2f')](_0x1df251[_0xb81b('0x47')]['limit']);_0x42881f[_0xb81b('0x2d')]=qs['offset'](_0x1df251[_0xb81b('0x47')][_0xb81b('0x2d')]);}_0x42881f[_0xb81b('0x6c')]=qs[_0xb81b('0x4f')](_0x1df251[_0xb81b('0x47')][_0xb81b('0x4f')]);_0x42881f[_0xb81b('0x50')]=qs[_0xb81b('0x49')](_[_0xb81b('0x51')](_0x1df251['query'],_0x35c487[_0xb81b('0x49')]));_0x42881f[_0xb81b('0x50')][_0xb81b('0x67')]=_0x3217d2['id'];if(_0x1df251[_0xb81b('0x47')][_0xb81b('0x54')]){_0x42881f[_0xb81b('0x50')]=_['merge'](_0x42881f[_0xb81b('0x50')],{'$or':_[_0xb81b('0x40')](_0x42881f[_0xb81b('0x4a')],function(_0x2d0cd7){var _0x42a133={};_0x42a133[_0x2d0cd7]={'$like':'%'+_0x1df251[_0xb81b('0x47')][_0xb81b('0x54')]+'%'};return _0x42a133;})});}_0x42881f=_[_0xb81b('0x52')]({},_0x42881f,_0x1df251[_0xb81b('0x5b')]);return db[_0xb81b('0x74')][_0xb81b('0x30')]({'where':_0x42881f[_0xb81b('0x50')]})['then'](function(_0x8924e8){_0x47c910[_0xb81b('0x30')]=_0x8924e8;if(_0x1df251[_0xb81b('0x47')]['includeAll']){_0x42881f[_0xb81b('0x55')]=[{'model':db[_0xb81b('0x75')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xb81b('0x76'),'attributes':[_0xb81b('0x3b'),'fullname',_0xb81b('0x77')],'required':![]},{'model':db[_0xb81b('0x78')],'as':_0xb81b('0x79'),'attributes':['id',_0xb81b('0x3b'),_0xb81b('0x7a')],'where':_0x1df251[_0xb81b('0x47')][_0xb81b('0x7b')]?{'id':_0x1df251[_0xb81b('0x47')]['tag']}:undefined,'required':_0x1df251[_0xb81b('0x47')]['tag']?!![]:![]}];}return db[_0xb81b('0x74')][_0xb81b('0x56')](_0x42881f);})[_0xb81b('0x20')](function(_0x2d5d19){_0x47c910['rows']=_0x2d5d19;return _0x47c910;});}})[_0xb81b('0x20')](respondWithFilteredResult(_0x23013b,_0x42881f))[_0xb81b('0x29')](handleError(_0x23013b,null));};exports[_0xb81b('0x7c')]=function(_0xf472e9,_0x210717){var _0x5e27dd=_0xf472e9[_0xb81b('0x59')]['id'];var _0x22bd5d=_0xf472e9[_0xb81b('0x5e')];var _0xfb654=0xc8;var _0x4f7024=null;return db[_0xb81b('0x7d')]['transaction']({'isolationLevel':db['sequelize']['Transaction'][_0xb81b('0x7e')][_0xb81b('0x7f')]},function(_0xcc113){return db[_0xb81b('0x41')]['findOne']({'where':{'id':_0x5e27dd},'transaction':_0xcc113})[_0xb81b('0x20')](function(_0x502cd8){if(_0x502cd8){return db[_0xb81b('0x80')][_0xb81b('0x36')]({'where':{'FaxAccountId':_0x5e27dd},'transaction':_0xcc113})[_0xb81b('0x20')](function(){var _0x4b5d13=_[_0xb81b('0x40')](_0x22bd5d,function(_0x8bc0ae){_0x8bc0ae[_0xb81b('0x67')]=_0x5e27dd;return _0x8bc0ae;});return db['FaxApplication']['bulkCreate'](_0x4b5d13,{'transaction':_0xcc113});});}else{_0xfb654=0x194;_0x4f7024=[];}});})['then'](function(){if(_0xfb654!==0x194){return db['FaxApplication'][_0xb81b('0x81')]({'where':{'FaxAccountId':_0x5e27dd},'order':_0xb81b('0x82')})[_0xb81b('0x20')](function(_0x37248d){_0x4f7024=_0x37248d;});}})[_0xb81b('0x29')](function(_0xba0210){_0xfb654=0x1f4;logger[_0xb81b('0x25')](_0xba0210[_0xb81b('0x3a')]);if(_0xba0210[_0xb81b('0x3b')]){delete _0xba0210[_0xb81b('0x3b')];}_0x4f7024=_0xba0210;})['finally'](function(){if(_0x4f7024===null){_0x210717[_0xb81b('0x2a')](_0xfb654);}else{if(_0xfb654===0x1f4){_0x210717['status'](_0xfb654)[_0xb81b('0x3c')](_0x4f7024);}else{_0x210717[_0xb81b('0x2b')](_0xfb654)[_0xb81b('0x2c')](_0x4f7024);}}});};exports[_0xb81b('0x83')]=function(_0x2a0cdf,_0x14bfcc,_0x322dff){var _0x5f2933={};var _0x55de42={};var _0x433b5d;var _0x246ef0;return db['FaxAccount'][_0xb81b('0x6a')]({'where':{'id':_0x2a0cdf[_0xb81b('0x59')]['id']}})[_0xb81b('0x20')](handleEntityNotFound(_0x14bfcc,null))[_0xb81b('0x20')](function(_0x45cc62){if(_0x45cc62){_0x433b5d=_0x45cc62;_0x55de42['model']=_[_0xb81b('0x48')](db[_0xb81b('0x80')]['rawAttributes']);_0x55de42['query']=_[_0xb81b('0x48')](_0x2a0cdf[_0xb81b('0x47')]);_0x55de42[_0xb81b('0x49')]=_[_0xb81b('0x4b')](_0x55de42[_0xb81b('0x46')],_0x55de42[_0xb81b('0x47')]);_0x5f2933['attributes']=_[_0xb81b('0x4b')](_0x55de42[_0xb81b('0x46')],qs[_0xb81b('0x4c')](_0x2a0cdf[_0xb81b('0x47')][_0xb81b('0x4c')]));_0x5f2933[_0xb81b('0x4a')]=_0x5f2933[_0xb81b('0x4a')][_0xb81b('0x6b')]?_0x5f2933['attributes']:_0x55de42[_0xb81b('0x46')];_0x5f2933[_0xb81b('0x6c')]=qs[_0xb81b('0x4f')](_0x2a0cdf[_0xb81b('0x47')][_0xb81b('0x4f')]);_0x5f2933[_0xb81b('0x50')]=qs[_0xb81b('0x49')](_[_0xb81b('0x51')](_0x2a0cdf[_0xb81b('0x47')],_0x55de42[_0xb81b('0x49')]));if(_0x2a0cdf[_0xb81b('0x47')][_0xb81b('0x54')]){_0x5f2933[_0xb81b('0x50')]=_['merge'](_0x5f2933[_0xb81b('0x50')],{'$or':_[_0xb81b('0x40')](_0x5f2933[_0xb81b('0x4a')],function(_0xf4ed65){var _0x85e2c8={};_0x85e2c8[_0xf4ed65]={'$like':'%'+_0x2a0cdf[_0xb81b('0x47')][_0xb81b('0x54')]+'%'};return _0x85e2c8;})});}_0x5f2933=_[_0xb81b('0x52')]({},_0x5f2933,_0x2a0cdf['options']);return _0x433b5d[_0xb81b('0x83')](_0x5f2933);}})[_0xb81b('0x20')](function(_0x420a00){if(_0x420a00){_0x246ef0=_0x420a00[_0xb81b('0x6b')];if(!_0x2a0cdf[_0xb81b('0x47')][_0xb81b('0x4d')](_0xb81b('0x4e'))){_0x5f2933['limit']=qs[_0xb81b('0x2f')](_0x2a0cdf[_0xb81b('0x47')][_0xb81b('0x2f')]);_0x5f2933[_0xb81b('0x2d')]=qs[_0xb81b('0x2d')](_0x2a0cdf[_0xb81b('0x47')]['offset']);}return _0x433b5d['getApplications'](_0x5f2933);}})[_0xb81b('0x20')](function(_0x1543a1){if(_0x1543a1){return _0x1543a1?{'count':_0x246ef0,'rows':_0x1543a1}:null;}})[_0xb81b('0x20')](respondWithResult(_0x14bfcc,null))['catch'](handleError(_0x14bfcc,null));};function Extension(_0x35e422,_0x5206b7,_0x5dfd70,_0x104150){this[_0xb81b('0x84')]=_0xb81b('0x85');this[_0xb81b('0x86')]=_0x35e422[_0xb81b('0x87')];this[_0xb81b('0x88')]=_0x104150;this[_0xb81b('0x44')]=_0xb81b('0x89');this[_0xb81b('0x8a')]=_0xb81b('0x8b');this[_0xb81b('0x67')]=_0x35e422['id'];this[_0xb81b('0x82')]=_0x5206b7;this[_0xb81b('0x8c')]=_0x5dfd70;}function createExtensionsReciveFax(_0x4dd1ae){var _0xab5625=0x1;var _0x46f073=[];_0x46f073[_0xb81b('0x8d')](new Extension(_0x4dd1ae,_0xab5625,'','Answer'));_0xab5625+=0x1;_0x46f073['push'](new Extension(_0x4dd1ae,_0xab5625,_0xb81b('0x8e'),'Set'));_0xab5625+=0x1;for(var _0x2caea3 in _0x4dd1ae){if(_0x4dd1ae[_0xb81b('0x4d')](_0x2caea3)&&(_0x2caea3===_0xb81b('0x8f')||_0x2caea3===_0xb81b('0x87')||_0x2caea3==='gateway'||_0x2caea3===_0xb81b('0x90')||_0x2caea3===_0xb81b('0x91')||_0x2caea3==='maxrate'||_0x2caea3==='minrate'||_0x2caea3==='modem'||_0x2caea3==='t38timeout')){_0x46f073[_0xb81b('0x8d')](new Extension(_0x4dd1ae,_0xab5625,_0xb81b('0x92')+_0x2caea3+')='+_0x4dd1ae[_0x2caea3],'Set'));_0xab5625+=0x1;}}_0x46f073[_0xb81b('0x8d')](new Extension(_0x4dd1ae,_0xab5625,'6',_0xb81b('0x93')));_0xab5625+=0x1;_0x46f073[_0xb81b('0x8d')](new Extension(_0x4dd1ae,_0xab5625,_0xb81b('0x94'),_0xb81b('0x95')));_0xab5625=0x0;return _0x46f073;}exports['addAccountApplications']=function(_0x1f4f4a,_0x56431a,_0x18356a){var _0xdd9a77;return db[_0xb81b('0x7d')][_0xb81b('0x96')](function(_0x398a74){return db[_0xb81b('0x41')]['create'](_0x1f4f4a[_0xb81b('0x5e')],{'transaction':_0x398a74})[_0xb81b('0x20')](function(_0x32b3a9){_0xdd9a77=_0x32b3a9[_0xb81b('0x37')]({'plain':!![]});return db[_0xb81b('0x97')][_0xb81b('0x98')](createExtensionsReciveFax(_0xdd9a77),{'transaction':_0x398a74});});})[_0xb81b('0x20')](function(){return _0xdd9a77;})[_0xb81b('0x20')](respondWithResult(_0x56431a,null))[_0xb81b('0x29')](handleError(_0x56431a,null));};exports['updateAccountApplications']=function(_0x2c4253,_0xca4284,_0x3c2b2e){var _0x6a2c73;return db[_0xb81b('0x7d')][_0xb81b('0x96')](function(_0x1b2e41){return db['FaxAccount'][_0xb81b('0x35')](_0x2c4253[_0xb81b('0x5e')],{'where':{'id':_0x2c4253[_0xb81b('0x5e')]['id']},'transaction':_0x1b2e41})[_0xb81b('0x20')](function(_0x2daa34){return db[_0xb81b('0x97')][_0xb81b('0x36')]({'where':{'FaxAccountId':_0x2c4253['body']['id']},'transaction':_0x1b2e41})[_0xb81b('0x20')](function(_0xf46f63){return db[_0xb81b('0x97')][_0xb81b('0x98')](createExtensionsReciveFax(_['omit'](_0x2c4253[_0xb81b('0x5e')],[_0xb81b('0x99'),_0xb81b('0x45'),_0xb81b('0x9a'),_0xb81b('0x9b'),_0xb81b('0x9c'),'ListId'])),{'transaction':_0x1b2e41});});});})['then'](function(){return db[_0xb81b('0x41')][_0xb81b('0x9d')](_0x2c4253[_0xb81b('0x5e')]['id']);})[_0xb81b('0x20')](respondWithResult(_0xca4284,null))[_0xb81b('0x29')](handleError(_0xca4284,null));};exports[_0xb81b('0x9e')]=function(_0x3a7f07,_0x56793f,_0x3fc83f){var _0x5388c8={'raw':!![],'where':{}};var _0x4e3382={};var _0x9d38b0={'count':0x0,'rows':[]};return db['FaxAccount'][_0xb81b('0x6a')]({'where':{'id':_0x3a7f07[_0xb81b('0x59')]['id']}})[_0xb81b('0x20')](handleEntityNotFound(_0x56793f,null))[_0xb81b('0x20')](function(_0x199d1f){if(_0x199d1f){_0x4e3382[_0xb81b('0x46')]=_[_0xb81b('0x48')](db[_0xb81b('0x9f')][_0xb81b('0x42')]);_0x4e3382[_0xb81b('0x47')]=_[_0xb81b('0x48')](_0x3a7f07[_0xb81b('0x47')]);_0x4e3382[_0xb81b('0x49')]=_[_0xb81b('0x4b')](_0x4e3382[_0xb81b('0x46')],_0x4e3382[_0xb81b('0x47')]);_0x5388c8[_0xb81b('0x4a')]=_[_0xb81b('0x4b')](_0x4e3382[_0xb81b('0x46')],qs['fields'](_0x3a7f07[_0xb81b('0x47')][_0xb81b('0x4c')]));_0x5388c8[_0xb81b('0x4a')]=_0x5388c8[_0xb81b('0x4a')]['length']?_0x5388c8[_0xb81b('0x4a')]:_0x4e3382[_0xb81b('0x46')];if(!_0x3a7f07['query'][_0xb81b('0x4d')](_0xb81b('0x4e'))){_0x5388c8[_0xb81b('0x2f')]=qs['limit'](_0x3a7f07[_0xb81b('0x47')][_0xb81b('0x2f')]);_0x5388c8[_0xb81b('0x2d')]=qs[_0xb81b('0x2d')](_0x3a7f07[_0xb81b('0x47')]['offset']);}_0x5388c8[_0xb81b('0x6c')]=qs[_0xb81b('0x4f')](_0x3a7f07[_0xb81b('0x47')][_0xb81b('0x4f')]);_0x5388c8[_0xb81b('0x50')]=qs[_0xb81b('0x49')](_[_0xb81b('0x51')](_0x3a7f07['query'],_0x4e3382[_0xb81b('0x49')]));_0x5388c8[_0xb81b('0x50')][_0xb81b('0x67')]=_0x199d1f['id'];if(_0x3a7f07[_0xb81b('0x47')]['filter']){_0x5388c8[_0xb81b('0x50')]=_['merge'](_0x5388c8[_0xb81b('0x50')],{'$or':_[_0xb81b('0x40')](_0x5388c8[_0xb81b('0x4a')],function(_0x51fdca){var _0xd8608d={};_0xd8608d[_0x51fdca]={'$like':'%'+_0x3a7f07[_0xb81b('0x47')][_0xb81b('0x54')]+'%'};return _0xd8608d;})});}if(_0x3a7f07[_0xb81b('0x47')]['$gte']){var _0x20cdc2=_0x3a7f07[_0xb81b('0x47')]['$gte']['split'](',');var _0x44cdd8={};_0x44cdd8[_0x20cdc2[0x0]]={'$gte':moment(_0x20cdc2[0x1])['format'](_0xb81b('0xa0'))};_0x5388c8['where']=_['merge'](_0x5388c8[_0xb81b('0x50')],_0x44cdd8);}_0x5388c8=_[_0xb81b('0x52')]({},_0x5388c8,_0x3a7f07[_0xb81b('0x5b')]);return db['FaxMessage'][_0xb81b('0x30')]({'where':_0x5388c8[_0xb81b('0x50')]})['then'](function(_0xd24312){_0x9d38b0[_0xb81b('0x30')]=_0xd24312;if(_0x3a7f07['query'][_0xb81b('0x5a')]){_0x5388c8[_0xb81b('0x55')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x5388c8);})[_0xb81b('0x20')](function(_0x14e7d3){_0x9d38b0[_0xb81b('0x57')]=_0x14e7d3;return _0x9d38b0;});}})[_0xb81b('0x20')](respondWithFilteredResult(_0x56793f,_0x5388c8))['catch'](handleError(_0x56793f,null));};exports[_0xb81b('0x3c')]=function(_0x2e220e,_0x1b731f,_0x19a11d){var _0x5e6c0c,_0x35142f={},_0x4e8e80;if(_0x2e220e[_0xb81b('0x5e')]['to']){_0x4e8e80=_0x2e220e[_0xb81b('0x5e')]['to'][0x0];}return db[_0xb81b('0x41')][_0xb81b('0x5c')]({'where':{'id':_0x2e220e[_0xb81b('0x59')]['id']},'include':[{'model':db[_0xb81b('0xa1')],'as':_0xb81b('0xa2'),'include':[{'model':db['CmContact'],'as':_0xb81b('0xa3'),'where':{'fax':_0x4e8e80},'limit':0x1,'order':[[_0xb81b('0x9b'),_0xb81b('0xa4')]]}]}]})[_0xb81b('0x20')](handleEntityNotFound(_0x1b731f,null))[_0xb81b('0x20')](function(_0x48c496){_0x5e6c0c=_0x48c496;if(_0x2e220e[_0xb81b('0x5e')][_0xb81b('0xa5')]&&_0x2e220e[_0xb81b('0x5e')]['attachments']['length']){for(var _0x2c95b9=0x0;_0x2c95b9<_0x2e220e[_0xb81b('0x5e')][_0xb81b('0xa5')]['length'];_0x2c95b9+=0x1){_0x2e220e[_0xb81b('0x5e')][_0xb81b('0xa5')][_0x2c95b9]={'filename':_0x2e220e[_0xb81b('0x5e')][_0xb81b('0xa5')][_0x2c95b9][_0xb81b('0x3b')],'id':_0x2e220e[_0xb81b('0x5e')]['attachments'][_0x2c95b9]['id'],'path':path[_0xb81b('0xa6')](config[_0xb81b('0xa7')],_0xb81b('0xa8'),_0x2e220e[_0xb81b('0x5e')][_0xb81b('0xa5')][_0x2c95b9]['basename'])};}}return respondWithRpcPromise(_0xb81b('0xa9'),'CheckAfterSend',{'FaxAccountId':_[_0xb81b('0xaa')](_0x2e220e[_0xb81b('0x59')]['id'])?undefined:_0x2e220e[_0xb81b('0x59')]['id'],'path':_[_0xb81b('0xaa')](_0x2e220e[_0xb81b('0x5e')]['attachments'][0x0]['path'])?undefined:_0x2e220e[_0xb81b('0x5e')][_0xb81b('0xa5')][0x0][_0xb81b('0x5')],'fax':_[_0xb81b('0xaa')](_0x2e220e[_0xb81b('0x5e')]['to'][0x0])?undefined:_0x2e220e['body']['to'][0x0]},client9002);})[_0xb81b('0x20')](function(){if(_0x5e6c0c){if(_['isNil'](_0x2e220e[_0xb81b('0x5e')]['from'])){_0x2e220e[_0xb81b('0x5e')][_0xb81b('0xab')]=util[_0xb81b('0xac')]('\x22%s\x22\x20<%s>',_0x5e6c0c[_0xb81b('0x3b')],_0x5e6c0c[_0xb81b('0xad')]);}if(_0x5e6c0c[_0xb81b('0xa2')]){if(_0x5e6c0c[_0xb81b('0xa2')]['Contacts'][_0xb81b('0x6b')]){return _0x5e6c0c['List']['Contacts'][0x0];}else{return db['CmContact'][_0xb81b('0x5d')](_[_0xb81b('0x18')](_0x2e220e[_0xb81b('0x5e')],{'firstName':_0x2e220e[_0xb81b('0x5e')]['to'][0x0],'phone':_0x2e220e[_0xb81b('0x5e')]['to'][0x0],'fax':_0x2e220e[_0xb81b('0x5e')]['to'][0x0],'ListId':_0x5e6c0c[_0xb81b('0xae')]}));}}else{throw new Error(_0xb81b('0xaf'));}}else{throw new Error(_0xb81b('0xb0'));}})[_0xb81b('0x20')](function(_0x8cc36a){if(_0x8cc36a){return db[_0xb81b('0x74')][_0xb81b('0x5c')]({'where':{'ContactId':_0x8cc36a['id'],'closed':![],'FaxAccountId':_0x5e6c0c['id']}})[_0xb81b('0x20')](function(_0x34ef01){if(_0x34ef01){return[_0x34ef01,![]];}return db[_0xb81b('0x74')][_0xb81b('0x5d')]({'UserId':_0x2e220e['user']['id'],'ContactId':_0x8cc36a['id'],'FaxAccountId':_0x5e6c0c['id'],'fax':_0x2e220e[_0xb81b('0x5e')]['to'][0x0],'firstMsgDirection':_0xb81b('0xb1'),'Messages':[_['merge'](_0x2e220e[_0xb81b('0x5e')],{'read':![],'body':_0x2e220e[_0xb81b('0x5e')][_0xb81b('0xa5')][0x0][_0xb81b('0xb2')],'FaxAccountId':_0x5e6c0c['id'],'UserId':_0x2e220e[_0xb81b('0x61')]['id'],'ContactId':_0x8cc36a['id'],'AttachmentId':_0x2e220e[_0xb81b('0x5e')][_0xb81b('0xa5')][0x0]['id']})]},{'include':[{'model':db[_0xb81b('0x9f')],'as':_0xb81b('0xb3')}]})['then'](function(_0x33c43b){return[_0x33c43b,!![]];});});}else{throw new Error(_0xb81b('0xb4'));}})[_0xb81b('0xb5')](function(_0x325a6d,_0x18c668){if(_0x18c668){return _0x325a6d;}return db['FaxMessage'][_0xb81b('0x5d')]({'direction':'out','read':![],'body':_0x2e220e[_0xb81b('0x5e')][_0xb81b('0xa5')][0x0][_0xb81b('0xb2')],'FaxAccountId':_0x5e6c0c['id'],'FaxInteractionId':_0x325a6d['id'],'UserId':_0x2e220e[_0xb81b('0x61')]['id'],'ContactId':_0x325a6d[_0xb81b('0xb6')],'AttachmentId':_0x2e220e['body'][_0xb81b('0xa5')][0x0]['id']})[_0xb81b('0x20')](function(_0x1a246f){_0x325a6d[_0xb81b('0xb7')][_0xb81b('0xb3')]=[];_0x325a6d[_0xb81b('0xb7')][_0xb81b('0xb3')][_0xb81b('0x8d')](_0x1a246f[_0xb81b('0xb7')]);return _0x325a6d;});})[_0xb81b('0x20')](function(_0xc215e2){respondWithRpcPromise(_0xb81b('0xb8'),'SendFax',{'FaxAccountId':_['isNil'](_0x2e220e[_0xb81b('0x59')]['id'])?undefined:_0x2e220e['params']['id'],'path':_[_0xb81b('0xaa')](_0x2e220e[_0xb81b('0x5e')][_0xb81b('0xa5')][0x0]['path'])?undefined:_0x2e220e[_0xb81b('0x5e')][_0xb81b('0xa5')][0x0][_0xb81b('0x5')],'fax':_[_0xb81b('0xaa')](_0x2e220e[_0xb81b('0x5e')]['to'][0x0])?undefined:_0x2e220e[_0xb81b('0x5e')]['to'][0x0],'AttachmentId':_0x2e220e[_0xb81b('0x5e')][_0xb81b('0xa5')][0x0]['id']},client9002)[_0xb81b('0x20')](function(_0x1f1207){logger[_0xb81b('0x21')](_0xb81b('0xb9'),_0x1f1207);})['catch'](function(_0xa097c8){logger[_0xb81b('0x21')]('SendFaxRpc,\x20%s',_0xa097c8);});return _0xc215e2;})[_0xb81b('0x20')](respondWithResult(_0x1b731f,null))[_0xb81b('0x29')](handleError(_0x1b731f,null));};exports[_0xb81b('0xba')]=function(_0x404139,_0x2cdbc3,_0x3771b9){return db[_0xb81b('0x41')][_0xb81b('0x5c')]({'where':{'id':_0x404139[_0xb81b('0x59')]['id']}})['then'](handleEntityNotFound(_0x2cdbc3,null))[_0xb81b('0x20')](function(_0x61806){if(_0x61806){return _0x61806[_0xb81b('0xba')](_0x404139[_0xb81b('0x5e')][_0xb81b('0x6e')],_[_0xb81b('0xbb')](_0x404139[_0xb81b('0x5e')],[_0xb81b('0x6e'),'id'])||{})[_0xb81b('0xb5')](function(_0x4152bc){for(var _0x1efed2=0x0;_0x1efed2<_0x404139[_0xb81b('0x5e')][_0xb81b('0x6e')][_0xb81b('0x6b')];_0x1efed2+=0x1){socket[_0xb81b('0xbc')](_0xb81b('0xbd'),{'UserId':Number(_0x404139['body'][_0xb81b('0x6e')][_0x1efed2]),'FaxAccountId':Number(_0x404139[_0xb81b('0x59')]['id'])});}return _0x4152bc;});}})['then'](respondWithResult(_0x2cdbc3,null))[_0xb81b('0x29')](handleError(_0x2cdbc3,null));};exports[_0xb81b('0xbe')]=function(_0x14e18b,_0x5103b6,_0x509498){return db['FaxAccount'][_0xb81b('0x5c')]({'where':{'id':_0x14e18b[_0xb81b('0x59')]['id']}})['then'](handleEntityNotFound(_0x5103b6,null))[_0xb81b('0x20')](function(_0x3f4188){if(_0x3f4188){return _0x3f4188[_0xb81b('0xbe')](_0x14e18b[_0xb81b('0x47')][_0xb81b('0x6e')])['then'](function(){if(_[_0xb81b('0xbf')](_0x14e18b[_0xb81b('0x47')][_0xb81b('0x6e')])){for(var _0x63c4ab=0x0;_0x63c4ab<_0x14e18b[_0xb81b('0x47')]['ids'][_0xb81b('0x6b')];_0x63c4ab+=0x1){socket['emit'](_0xb81b('0xc0'),{'UserId':Number(_0x14e18b['query'][_0xb81b('0x6e')][_0x63c4ab]),'FaxAccountId':Number(_0x14e18b['params']['id'])});}}else{socket[_0xb81b('0xbc')]('userFaxAccount:remove',{'UserId':Number(_0x14e18b[_0xb81b('0x47')][_0xb81b('0x6e')]),'FaxAccountId':Number(_0x14e18b[_0xb81b('0x59')]['id'])});}});}})[_0xb81b('0x20')](respondWithStatusCode(_0x5103b6,null))[_0xb81b('0x29')](handleError(_0x5103b6,null));};exports[_0xb81b('0xc1')]=function(_0x5eb442,_0x3f36a2,_0x71407){var _0x11e637={};var _0x406e1c={};var _0x582e58;var _0x1cac2f;return db[_0xb81b('0x41')][_0xb81b('0x6a')]({'where':{'id':_0x5eb442[_0xb81b('0x59')]['id']}})[_0xb81b('0x20')](handleEntityNotFound(_0x3f36a2,null))[_0xb81b('0x20')](function(_0x541342){if(_0x541342){_0x582e58=_0x541342;_0x406e1c[_0xb81b('0x46')]=_['keys'](db[_0xb81b('0xc2')][_0xb81b('0x42')]);_0x406e1c['query']=_[_0xb81b('0x48')](_0x5eb442[_0xb81b('0x47')]);_0x406e1c[_0xb81b('0x49')]=_[_0xb81b('0x4b')](_0x406e1c['model'],_0x406e1c[_0xb81b('0x47')]);_0x11e637[_0xb81b('0x4a')]=_[_0xb81b('0x4b')](_0x406e1c[_0xb81b('0x46')],qs[_0xb81b('0x4c')](_0x5eb442['query'][_0xb81b('0x4c')]));_0x11e637[_0xb81b('0x4a')]=_0x11e637[_0xb81b('0x4a')][_0xb81b('0x6b')]?_0x11e637[_0xb81b('0x4a')]:_0x406e1c[_0xb81b('0x46')];_0x11e637[_0xb81b('0x6c')]=qs[_0xb81b('0x4f')](_0x5eb442['query'][_0xb81b('0x4f')]);_0x11e637[_0xb81b('0x50')]=qs[_0xb81b('0x49')](_[_0xb81b('0x51')](_0x5eb442[_0xb81b('0x47')],_0x406e1c['filters']));if(_0x5eb442[_0xb81b('0x47')][_0xb81b('0x54')]){_0x11e637[_0xb81b('0x50')]=_[_0xb81b('0x52')](_0x11e637[_0xb81b('0x50')],{'$or':_[_0xb81b('0x40')](_0x11e637[_0xb81b('0x4a')],function(_0x5bb781){var _0x5cae17={};_0x5cae17[_0x5bb781]={'$like':'%'+_0x5eb442[_0xb81b('0x47')][_0xb81b('0x54')]+'%'};return _0x5cae17;})});}_0x11e637=_[_0xb81b('0x52')]({},_0x11e637,_0x5eb442[_0xb81b('0x5b')]);return _0x582e58['getAgents'](_0x11e637);}})[_0xb81b('0x20')](function(_0x2c7ccc){if(_0x2c7ccc){_0x1cac2f=_0x2c7ccc[_0xb81b('0x6b')];if(!_0x5eb442[_0xb81b('0x47')][_0xb81b('0x4d')](_0xb81b('0x4e'))){_0x11e637[_0xb81b('0x2f')]=qs[_0xb81b('0x2f')](_0x5eb442[_0xb81b('0x47')][_0xb81b('0x2f')]);_0x11e637[_0xb81b('0x2d')]=qs[_0xb81b('0x2d')](_0x5eb442[_0xb81b('0x47')]['offset']);}return _0x582e58[_0xb81b('0xc1')](_0x11e637);}})[_0xb81b('0x20')](function(_0x211e87){if(_0x211e87){return _0x211e87?{'count':_0x1cac2f,'rows':_0x211e87}:null;}})[_0xb81b('0x20')](respondWithResult(_0x3f36a2,null))['catch'](handleError(_0x3f36a2,null));}; \ No newline at end of file +var _0x1fc6=['request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','limit','order','sort','where','pick','filter','merge','options','findAll','show','length','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','FaxAccountId','Disposition','getDispositions','nolimit','rows','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','FaxInteraction','omit','getInteractions','CmContact','Contact','User','fullname','internal','Tag','Tags','tag','sequelize','FaxApplication','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','app','description','Fax\x20Extension','appdata','push','ecm','localstationid','gateway','maxrate','modem','t38timeout','FAXOPT(','Set','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','bulkCreate','updateAccountApplications','transaction','findById','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','out','Messages','Contact\x20not\x20found','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','getAgents','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxAccount.socket','jayson/promise','http','client','request','info','FaxAccount,\x20%s,\x20%s'];(function(_0x3848d4,_0x3227bd){var _0x66f1e2=function(_0x36352b){while(--_0x36352b){_0x3848d4['push'](_0x3848d4['shift']());}};_0x66f1e2(++_0x3227bd);}(_0x1fc6,0x150));var _0x61fc=function(_0x33c9f8,_0x5aedbb){_0x33c9f8=_0x33c9f8-0x0;var _0x2d7004=_0x1fc6[_0x33c9f8];return _0x2d7004;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x61fc('0x0'));var jsonpatch=require(_0x61fc('0x1'));var rp=require(_0x61fc('0x2'));var moment=require('moment');var BPromise=require(_0x61fc('0x3'));var Mustache=require(_0x61fc('0x4'));var util=require(_0x61fc('0x5'));var path=require(_0x61fc('0x6'));var sox=require(_0x61fc('0x7'));var csv=require(_0x61fc('0x8'));var ejs=require(_0x61fc('0x9'));var fs=require('fs');var fs_extra=require(_0x61fc('0xa'));var _=require('lodash');var squel=require(_0x61fc('0xb'));var crypto=require(_0x61fc('0xc'));var jsforce=require(_0x61fc('0xd'));var deskjs=require(_0x61fc('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x61fc('0xf'));var Redis=require(_0x61fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x61fc('0x11'));var as=require(_0x61fc('0x12'));var hardwareService=require(_0x61fc('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x61fc('0x14'));var config=require(_0x61fc('0x15'));var licenseUtil=require(_0x61fc('0x16'));var db=require(_0x61fc('0x17'))['db'];config[_0x61fc('0x18')]=_[_0x61fc('0x19')](config[_0x61fc('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x61fc('0x1a'))(new Redis(config[_0x61fc('0x18')]));require(_0x61fc('0x1b'))['register'](socket);var jayson=require(_0x61fc('0x1c'));var client=jayson['client'][_0x61fc('0x1d')]({'port':0x232c});var client9002=jayson[_0x61fc('0x1e')][_0x61fc('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5dbcb0,_0x5ac065,_0x46084a,_0x481281){return new BPromise(function(_0x959bd9,_0x3384ac){var _0xfafcb6=_0x481281||client;return _0xfafcb6[_0x61fc('0x1f')](_0x5dbcb0,_0x46084a)['then'](function(_0xaf8292){logger[_0x61fc('0x20')](_0x61fc('0x21'),_0x5ac065,_0x61fc('0x22'));logger[_0x61fc('0x23')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x5ac065,'request\x20sent',JSON[_0x61fc('0x24')](_0xaf8292));if(_0xaf8292[_0x61fc('0x25')]){if(_0xaf8292[_0x61fc('0x25')][_0x61fc('0x26')]===0x1f4){logger[_0x61fc('0x25')](_0x61fc('0x21'),_0x5ac065,_0xaf8292[_0x61fc('0x25')]['message']);return _0x3384ac(_0xaf8292['error'][_0x61fc('0x27')]);}logger[_0x61fc('0x25')]('FaxAccount,\x20%s,\x20%s',_0x5ac065,_0xaf8292['error'][_0x61fc('0x27')]);return _0x959bd9(_0xaf8292['error'][_0x61fc('0x27')]);}else{logger[_0x61fc('0x20')]('FaxAccount,\x20%s,\x20%s',_0x5ac065,'request\x20sent');_0x959bd9(_0xaf8292[_0x61fc('0x28')]['message']);}})[_0x61fc('0x29')](function(_0x2f9b9c){logger[_0x61fc('0x25')](_0x61fc('0x21'),_0x5ac065,_0x2f9b9c);_0x3384ac(_0x2f9b9c);});});}function respondWithStatusCode(_0x35ec02,_0xffe113){_0xffe113=_0xffe113||0xcc;return function(_0x42b6d8){if(_0x42b6d8){return _0x35ec02[_0x61fc('0x2a')](_0xffe113);}return _0x35ec02['status'](_0xffe113)[_0x61fc('0x2b')]();};}function respondWithResult(_0x3a202d,_0x28092a){_0x28092a=_0x28092a||0xc8;return function(_0x512992){if(_0x512992){return _0x3a202d[_0x61fc('0x2c')](_0x28092a)[_0x61fc('0x2d')](_0x512992);}};}function respondWithFilteredResult(_0x59a17f,_0x4ad7f3){return function(_0x9c957c){if(_0x9c957c){var _0x3a8681=typeof _0x4ad7f3[_0x61fc('0x2e')]===_0x61fc('0x2f')&&typeof _0x4ad7f3['limit']===_0x61fc('0x2f');var _0x170f93=_0x9c957c[_0x61fc('0x30')];var _0x16d9fe=_0x3a8681?0x0:_0x4ad7f3[_0x61fc('0x2e')];var _0x30ec1c=_0x3a8681?_0x9c957c[_0x61fc('0x30')]:_0x4ad7f3[_0x61fc('0x2e')]+_0x4ad7f3['limit'];var _0x360784;if(_0x30ec1c>=_0x170f93){_0x30ec1c=_0x170f93;_0x360784=0xc8;}else{_0x360784=0xce;}_0x59a17f[_0x61fc('0x2c')](_0x360784);return _0x59a17f[_0x61fc('0x31')](_0x61fc('0x32'),_0x16d9fe+'-'+_0x30ec1c+'/'+_0x170f93)[_0x61fc('0x2d')](_0x9c957c);}return null;};}function patchUpdates(_0x560a3a){return function(_0x432685){try{jsonpatch[_0x61fc('0x33')](_0x432685,_0x560a3a,!![]);}catch(_0x214290){return BPromise['reject'](_0x214290);}return _0x432685[_0x61fc('0x34')]();};}function saveUpdates(_0x2bbb17,_0x4a9bd5){return function(_0x56263e){if(_0x56263e){return _0x56263e[_0x61fc('0x35')](_0x2bbb17)[_0x61fc('0x36')](function(_0x129373){return _0x129373;});}return null;};}function removeEntity(_0x2d00ae,_0x23a439){return function(_0x5be8f1){if(_0x5be8f1){return _0x5be8f1[_0x61fc('0x37')]()[_0x61fc('0x36')](function(){var _0x21cc45=_0x5be8f1[_0x61fc('0x38')]({'plain':!![]});var _0x384535=_0x61fc('0x39');return db[_0x61fc('0x3a')][_0x61fc('0x37')]({'where':{'type':_0x384535,'resourceId':_0x21cc45['id']}})['then'](function(){return _0x5be8f1;});})[_0x61fc('0x36')](function(){_0x2d00ae[_0x61fc('0x2c')](0xcc)[_0x61fc('0x2b')]();});}};}function handleEntityNotFound(_0x554543,_0x638442){return function(_0x18c278){if(!_0x18c278){_0x554543[_0x61fc('0x2a')](0x194);}return _0x18c278;};}function handleError(_0x59522f,_0x1d0fd8){_0x1d0fd8=_0x1d0fd8||0x1f4;return function(_0x1b7373){logger['error'](_0x1b7373[_0x61fc('0x3b')]);if(_0x1b7373[_0x61fc('0x3c')]){delete _0x1b7373[_0x61fc('0x3c')];}_0x59522f['status'](_0x1d0fd8)[_0x61fc('0x3d')](_0x1b7373);};}exports['index']=function(_0x3cd376,_0x3f8a7f){var _0x4f2dee={'include':[{'model':db[_0x61fc('0x3e')],'as':_0x61fc('0x3f')}]},_0x111f2f={},_0x5b5edb={'count':0x0,'rows':[]};var _0x32b062=_[_0x61fc('0x40')](db[_0x61fc('0x41')][_0x61fc('0x42')],function(_0x1bb777){return{'name':_0x1bb777[_0x61fc('0x43')],'type':_0x1bb777[_0x61fc('0x44')][_0x61fc('0x45')]};});_0x111f2f['model']=_['map'](_0x32b062,'name');_0x111f2f[_0x61fc('0x46')]=_[_0x61fc('0x47')](_0x3cd376[_0x61fc('0x46')]);_0x111f2f[_0x61fc('0x48')]=_[_0x61fc('0x49')](_0x111f2f[_0x61fc('0x4a')],_0x111f2f[_0x61fc('0x46')]);_0x4f2dee['attributes']=_[_0x61fc('0x49')](_0x111f2f[_0x61fc('0x4a')],qs[_0x61fc('0x4b')](_0x3cd376['query'][_0x61fc('0x4b')]));_0x4f2dee[_0x61fc('0x4c')]=_0x4f2dee['attributes']['length']?_0x4f2dee[_0x61fc('0x4c')]:_0x111f2f[_0x61fc('0x4a')];if(!_0x3cd376['query'][_0x61fc('0x4d')]('nolimit')){_0x4f2dee[_0x61fc('0x4e')]=qs['limit'](_0x3cd376[_0x61fc('0x46')][_0x61fc('0x4e')]);_0x4f2dee[_0x61fc('0x2e')]=qs[_0x61fc('0x2e')](_0x3cd376['query']['offset']);}_0x4f2dee[_0x61fc('0x4f')]=qs['sort'](_0x3cd376[_0x61fc('0x46')][_0x61fc('0x50')]);_0x4f2dee[_0x61fc('0x51')]=qs['filters'](_[_0x61fc('0x52')](_0x3cd376[_0x61fc('0x46')],_0x111f2f[_0x61fc('0x48')]),_0x32b062);if(_0x3cd376[_0x61fc('0x46')][_0x61fc('0x53')]){_0x4f2dee[_0x61fc('0x51')]=_['merge'](_0x4f2dee[_0x61fc('0x51')],{'$or':_[_0x61fc('0x40')](_0x32b062,function(_0x29a3e6){if(_0x29a3e6[_0x61fc('0x44')]!=='VIRTUAL'){var _0x55e34e={};_0x55e34e[_0x29a3e6['name']]={'$like':'%'+_0x3cd376['query'][_0x61fc('0x53')]+'%'};return _0x55e34e;}})});}_0x4f2dee=_[_0x61fc('0x54')]({},_0x4f2dee,_0x3cd376[_0x61fc('0x55')]);var _0x314f40={'where':_0x4f2dee[_0x61fc('0x51')]};return db['FaxAccount'][_0x61fc('0x30')](_0x314f40)['then'](function(_0x260540){_0x5b5edb[_0x61fc('0x30')]=_0x260540;if(_0x3cd376[_0x61fc('0x46')]['includeAll']){_0x4f2dee['include']=[{'all':!![]}];}return db[_0x61fc('0x41')][_0x61fc('0x56')](_0x4f2dee);})[_0x61fc('0x36')](function(_0x2fac4e){_0x5b5edb['rows']=_0x2fac4e;return _0x5b5edb;})['then'](respondWithFilteredResult(_0x3f8a7f,_0x4f2dee))[_0x61fc('0x29')](handleError(_0x3f8a7f,null));};exports[_0x61fc('0x57')]=function(_0x5ba2fe,_0x1eebd5){var _0x5bf75b={'raw':![],'where':{'id':_0x5ba2fe['params']['id']},'include':[{'model':db['Pause'],'as':_0x61fc('0x3f')}]},_0x59fe58={};_0x59fe58[_0x61fc('0x4a')]=_[_0x61fc('0x47')](db[_0x61fc('0x41')][_0x61fc('0x42')]);_0x59fe58[_0x61fc('0x46')]=_[_0x61fc('0x47')](_0x5ba2fe[_0x61fc('0x46')]);_0x59fe58['filters']=_[_0x61fc('0x49')](_0x59fe58[_0x61fc('0x4a')],_0x59fe58['query']);_0x5bf75b[_0x61fc('0x4c')]=_[_0x61fc('0x49')](_0x59fe58[_0x61fc('0x4a')],qs['fields'](_0x5ba2fe[_0x61fc('0x46')][_0x61fc('0x4b')]));_0x5bf75b[_0x61fc('0x4c')]=_0x5bf75b[_0x61fc('0x4c')][_0x61fc('0x58')]?_0x5bf75b['attributes']:_0x59fe58[_0x61fc('0x4a')];if(_0x5ba2fe[_0x61fc('0x46')][_0x61fc('0x59')]){_0x5bf75b[_0x61fc('0x5a')]=[{'all':!![]}];}_0x5bf75b=_[_0x61fc('0x54')]({},_0x5bf75b,_0x5ba2fe[_0x61fc('0x55')]);return db[_0x61fc('0x41')]['find'](_0x5bf75b)['then'](handleEntityNotFound(_0x1eebd5,null))['then'](respondWithResult(_0x1eebd5,null))[_0x61fc('0x29')](handleError(_0x1eebd5,null));};exports['create']=function(_0x3360de,_0xc38c65){return db[_0x61fc('0x41')][_0x61fc('0x5b')](_0x3360de[_0x61fc('0x5c')],{})[_0x61fc('0x36')](function(_0x5416d1){var _0x3c383d=_0x3360de[_0x61fc('0x5d')][_0x61fc('0x38')]({'plain':!![]});if(!_0x3c383d)throw new Error(_0x61fc('0x5e'));if(_0x3c383d[_0x61fc('0x5f')]===_0x61fc('0x5d')){var _0x1594c4=_0x5416d1[_0x61fc('0x38')]({'plain':!![]});var _0x1b02ab='FaxAccounts';return db['UserProfileSection'][_0x61fc('0x60')]({'where':{'name':_0x1b02ab,'userProfileId':_0x3c383d['userProfileId']},'raw':!![]})[_0x61fc('0x36')](function(_0x3a0550){if(_0x3a0550&&_0x3a0550['autoAssociation']===0x0){return db[_0x61fc('0x3a')][_0x61fc('0x5b')]({'name':_0x1594c4[_0x61fc('0x3c')],'resourceId':_0x1594c4['id'],'type':_0x3a0550[_0x61fc('0x3c')],'sectionId':_0x3a0550['id']},{})[_0x61fc('0x36')](function(){return _0x5416d1;});}else{return _0x5416d1;}})[_0x61fc('0x29')](function(_0xf836fe){logger[_0x61fc('0x25')](_0x61fc('0x61'),_0xf836fe);throw _0xf836fe;});}return _0x5416d1;})[_0x61fc('0x36')](respondWithResult(_0xc38c65,0xc9))['catch'](handleError(_0xc38c65,null));};exports[_0x61fc('0x35')]=function(_0x298b22,_0x53fae5){if(_0x298b22[_0x61fc('0x5c')]['id']){delete _0x298b22[_0x61fc('0x5c')]['id'];}return db[_0x61fc('0x41')][_0x61fc('0x60')]({'where':{'id':_0x298b22[_0x61fc('0x62')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x53fae5,null))['then'](saveUpdates(_0x298b22[_0x61fc('0x5c')],null))[_0x61fc('0x36')](respondWithResult(_0x53fae5,null))['catch'](handleError(_0x53fae5,null));};exports['destroy']=function(_0x2be7ef,_0xd5a7da){return db['FaxAccount']['find']({'where':{'id':_0x2be7ef[_0x61fc('0x62')]['id']}})[_0x61fc('0x36')](handleEntityNotFound(_0xd5a7da,null))['then'](removeEntity(_0xd5a7da,null))[_0x61fc('0x29')](handleError(_0xd5a7da,null));};exports[_0x61fc('0x63')]=function(_0x47973d,_0x445f52){return db['FaxAccount'][_0x61fc('0x63')]()[_0x61fc('0x36')](respondWithResult(_0x445f52,null))[_0x61fc('0x29')](handleError(_0x445f52,null));};exports[_0x61fc('0x64')]=function(_0x23a77a,_0x39c28d,_0x386a09){if(_0x23a77a[_0x61fc('0x5c')]['id']){delete _0x23a77a[_0x61fc('0x5c')]['id'];}return db['FaxAccount'][_0x61fc('0x60')]({'where':{'id':_0x23a77a[_0x61fc('0x62')]['id']}})[_0x61fc('0x36')](handleEntityNotFound(_0x39c28d,null))[_0x61fc('0x36')](function(_0xc225a4){if(_0xc225a4){_0x23a77a['body'][_0x61fc('0x65')]=_0xc225a4['id'];return db[_0x61fc('0x66')][_0x61fc('0x5b')](_0x23a77a['body']);}})['then'](respondWithResult(_0x39c28d,null))[_0x61fc('0x29')](handleError(_0x39c28d,null));};exports[_0x61fc('0x67')]=function(_0x200fdf,_0x5de7c8,_0x2d9aac){var _0x34f7e6={'raw':![],'where':{}};var _0xc66741={};var _0x36880f={'count':0x0,'rows':[]};return db[_0x61fc('0x41')]['findOne']({'where':{'id':_0x200fdf[_0x61fc('0x62')]['id']}})['then'](handleEntityNotFound(_0x5de7c8,null))[_0x61fc('0x36')](function(_0x3a4691){if(_0x3a4691){_0xc66741['model']=_['keys'](db[_0x61fc('0x66')][_0x61fc('0x42')]);_0xc66741[_0x61fc('0x46')]=_[_0x61fc('0x47')](_0x200fdf[_0x61fc('0x46')]);_0xc66741[_0x61fc('0x48')]=_[_0x61fc('0x49')](_0xc66741[_0x61fc('0x4a')],_0xc66741['query']);_0x34f7e6[_0x61fc('0x4c')]=_[_0x61fc('0x49')](_0xc66741[_0x61fc('0x4a')],qs[_0x61fc('0x4b')](_0x200fdf[_0x61fc('0x46')][_0x61fc('0x4b')]));_0x34f7e6[_0x61fc('0x4c')]=_0x34f7e6[_0x61fc('0x4c')][_0x61fc('0x58')]?_0x34f7e6[_0x61fc('0x4c')]:_0xc66741[_0x61fc('0x4a')];if(!_0x200fdf[_0x61fc('0x46')]['hasOwnProperty'](_0x61fc('0x68'))){_0x34f7e6[_0x61fc('0x4e')]=qs['limit'](_0x200fdf[_0x61fc('0x46')][_0x61fc('0x4e')]);_0x34f7e6['offset']=qs[_0x61fc('0x2e')](_0x200fdf['query']['offset']);}_0x34f7e6['order']=qs[_0x61fc('0x50')](_0x200fdf[_0x61fc('0x46')][_0x61fc('0x50')]);_0x34f7e6[_0x61fc('0x51')]=qs[_0x61fc('0x48')](_[_0x61fc('0x52')](_0x200fdf[_0x61fc('0x46')],_0xc66741[_0x61fc('0x48')]));_0x34f7e6[_0x61fc('0x51')][_0x61fc('0x65')]=_0x3a4691['id'];if(_0x200fdf[_0x61fc('0x46')][_0x61fc('0x53')]){_0x34f7e6['where']=_[_0x61fc('0x54')](_0x34f7e6[_0x61fc('0x51')],{'$or':_[_0x61fc('0x40')](_0x34f7e6[_0x61fc('0x4c')],function(_0x5edeba){var _0x552f85={};_0x552f85[_0x5edeba]={'$like':'%'+_0x200fdf[_0x61fc('0x46')][_0x61fc('0x53')]+'%'};return _0x552f85;})});}_0x34f7e6=_[_0x61fc('0x54')]({},_0x34f7e6,_0x200fdf[_0x61fc('0x55')]);return db[_0x61fc('0x66')][_0x61fc('0x30')]({'where':_0x34f7e6[_0x61fc('0x51')]})[_0x61fc('0x36')](function(_0x390bd3){_0x36880f[_0x61fc('0x30')]=_0x390bd3;if(_0x200fdf[_0x61fc('0x46')][_0x61fc('0x59')]){_0x34f7e6[_0x61fc('0x5a')]=[{'all':!![]}];}return db[_0x61fc('0x66')][_0x61fc('0x56')](_0x34f7e6);})[_0x61fc('0x36')](function(_0x58a192){_0x36880f[_0x61fc('0x69')]=_0x58a192;return _0x36880f;});}})[_0x61fc('0x36')](respondWithFilteredResult(_0x5de7c8,_0x34f7e6))['catch'](handleError(_0x5de7c8,null));};exports['removeDispositions']=function(_0x379975,_0x4090dd,_0x4347cb){return db[_0x61fc('0x41')]['find']({'where':{'id':_0x379975[_0x61fc('0x62')]['id']}})[_0x61fc('0x36')](handleEntityNotFound(_0x4090dd,null))[_0x61fc('0x36')](function(_0x3dc25f){if(_0x3dc25f){return _0x3dc25f[_0x61fc('0x6a')](_0x379975[_0x61fc('0x46')][_0x61fc('0x6b')]);}})[_0x61fc('0x36')](respondWithStatusCode(_0x4090dd,null))[_0x61fc('0x29')](handleError(_0x4090dd,null));};exports[_0x61fc('0x6c')]=function(_0x55d0c4,_0xa1585b,_0x55b3dd){if(_0x55d0c4[_0x61fc('0x5c')]['id']){delete _0x55d0c4['body']['id'];}return db[_0x61fc('0x41')][_0x61fc('0x60')]({'where':{'id':_0x55d0c4[_0x61fc('0x62')]['id']}})[_0x61fc('0x36')](handleEntityNotFound(_0xa1585b,null))[_0x61fc('0x36')](function(_0x219fca){if(_0x219fca){_0x55d0c4[_0x61fc('0x5c')][_0x61fc('0x65')]=_0x219fca['id'];return db['CannedAnswer'][_0x61fc('0x5b')](_0x55d0c4[_0x61fc('0x5c')]);}})[_0x61fc('0x36')](respondWithResult(_0xa1585b,null))[_0x61fc('0x29')](handleError(_0xa1585b,null));};exports[_0x61fc('0x6d')]=function(_0x38eba0,_0x1db593,_0x2017f5){var _0x2a8429={'raw':![],'where':{}};var _0x5959ab={};var _0x5c9c7c={'count':0x0,'rows':[]};return db[_0x61fc('0x41')][_0x61fc('0x6e')]({'where':{'id':_0x38eba0[_0x61fc('0x62')]['id']}})['then'](handleEntityNotFound(_0x1db593,null))[_0x61fc('0x36')](function(_0x100c49){if(_0x100c49){_0x5959ab[_0x61fc('0x4a')]=_[_0x61fc('0x47')](db[_0x61fc('0x6f')][_0x61fc('0x42')]);_0x5959ab['query']=_[_0x61fc('0x47')](_0x38eba0[_0x61fc('0x46')]);_0x5959ab[_0x61fc('0x48')]=_['intersection'](_0x5959ab[_0x61fc('0x4a')],_0x5959ab[_0x61fc('0x46')]);_0x2a8429[_0x61fc('0x4c')]=_[_0x61fc('0x49')](_0x5959ab[_0x61fc('0x4a')],qs[_0x61fc('0x4b')](_0x38eba0[_0x61fc('0x46')][_0x61fc('0x4b')]));_0x2a8429[_0x61fc('0x4c')]=_0x2a8429[_0x61fc('0x4c')][_0x61fc('0x58')]?_0x2a8429['attributes']:_0x5959ab[_0x61fc('0x4a')];if(!_0x38eba0[_0x61fc('0x46')]['hasOwnProperty']('nolimit')){_0x2a8429[_0x61fc('0x4e')]=qs[_0x61fc('0x4e')](_0x38eba0[_0x61fc('0x46')]['limit']);_0x2a8429[_0x61fc('0x2e')]=qs[_0x61fc('0x2e')](_0x38eba0[_0x61fc('0x46')][_0x61fc('0x2e')]);}_0x2a8429['order']=qs[_0x61fc('0x50')](_0x38eba0['query'][_0x61fc('0x50')]);_0x2a8429[_0x61fc('0x51')]=qs[_0x61fc('0x48')](_['pick'](_0x38eba0[_0x61fc('0x46')],_0x5959ab['filters']));_0x2a8429[_0x61fc('0x51')][_0x61fc('0x65')]=_0x100c49['id'];if(_0x38eba0[_0x61fc('0x46')][_0x61fc('0x53')]){_0x2a8429[_0x61fc('0x51')]=_[_0x61fc('0x54')](_0x2a8429[_0x61fc('0x51')],{'$or':_[_0x61fc('0x40')](_0x2a8429[_0x61fc('0x4c')],function(_0x2eb175){var _0xd388cb={};_0xd388cb[_0x2eb175]={'$like':'%'+_0x38eba0[_0x61fc('0x46')]['filter']+'%'};return _0xd388cb;})});}_0x2a8429=_[_0x61fc('0x54')]({},_0x2a8429,_0x38eba0[_0x61fc('0x55')]);return db[_0x61fc('0x6f')][_0x61fc('0x30')]({'where':_0x2a8429[_0x61fc('0x51')]})[_0x61fc('0x36')](function(_0x3a32c0){_0x5c9c7c[_0x61fc('0x30')]=_0x3a32c0;if(_0x38eba0[_0x61fc('0x46')][_0x61fc('0x59')]){_0x2a8429['include']=[{'all':!![]}];}return db[_0x61fc('0x6f')][_0x61fc('0x56')](_0x2a8429);})[_0x61fc('0x36')](function(_0x7dfd45){_0x5c9c7c[_0x61fc('0x69')]=_0x7dfd45;return _0x5c9c7c;});}})['then'](respondWithFilteredResult(_0x1db593,_0x2a8429))[_0x61fc('0x29')](handleError(_0x1db593,null));};exports[_0x61fc('0x70')]=function(_0x1ae6b2,_0x108ec0,_0x886e59){return db[_0x61fc('0x41')][_0x61fc('0x60')]({'where':{'id':_0x1ae6b2[_0x61fc('0x62')]['id']}})['then'](handleEntityNotFound(_0x108ec0,null))[_0x61fc('0x36')](function(_0x16a429){if(_0x16a429){return _0x16a429[_0x61fc('0x70')](_0x1ae6b2[_0x61fc('0x46')]['ids']);}})[_0x61fc('0x36')](respondWithStatusCode(_0x108ec0,null))[_0x61fc('0x29')](handleError(_0x108ec0,null));};exports['addInteraction']=function(_0x3da594,_0x155f6b,_0x3fe18c){return db[_0x61fc('0x71')][_0x61fc('0x60')]({'where':{'id':_0x3da594[_0x61fc('0x62')]['id']}})['then'](handleEntityNotFound(_0x155f6b,null))[_0x61fc('0x36')](function(_0x11f8e1){if(_0x11f8e1){return _0x11f8e1['addInteraction'](_0x3da594['body']['ids'],_[_0x61fc('0x72')](_0x3da594[_0x61fc('0x5c')],[_0x61fc('0x6b'),'id'])||{});}})[_0x61fc('0x36')](respondWithResult(_0x155f6b,null))['catch'](handleError(_0x155f6b,null));};exports[_0x61fc('0x73')]=function(_0x5ea759,_0x50fcdd,_0x63d5b5){var _0x1552a5={'raw':![],'where':{}};var _0x4cca3e={};var _0x3cea58={'count':0x0,'rows':[]};return db[_0x61fc('0x41')]['findOne']({'where':{'id':_0x5ea759[_0x61fc('0x62')]['id']}})[_0x61fc('0x36')](handleEntityNotFound(_0x50fcdd,null))[_0x61fc('0x36')](function(_0xe8d4a6){if(_0xe8d4a6){_0x4cca3e['model']=_[_0x61fc('0x47')](db['FaxInteraction'][_0x61fc('0x42')]);_0x4cca3e[_0x61fc('0x46')]=_[_0x61fc('0x47')](_0x5ea759[_0x61fc('0x46')]);_0x4cca3e['filters']=_[_0x61fc('0x49')](_0x4cca3e[_0x61fc('0x4a')],_0x4cca3e[_0x61fc('0x46')]);_0x1552a5[_0x61fc('0x4c')]=_[_0x61fc('0x49')](_0x4cca3e['model'],qs[_0x61fc('0x4b')](_0x5ea759[_0x61fc('0x46')][_0x61fc('0x4b')]));_0x1552a5[_0x61fc('0x4c')]=_0x1552a5['attributes'][_0x61fc('0x58')]?_0x1552a5['attributes']:_0x4cca3e[_0x61fc('0x4a')];if(!_0x5ea759['query'][_0x61fc('0x4d')](_0x61fc('0x68'))){_0x1552a5[_0x61fc('0x4e')]=qs[_0x61fc('0x4e')](_0x5ea759[_0x61fc('0x46')][_0x61fc('0x4e')]);_0x1552a5['offset']=qs[_0x61fc('0x2e')](_0x5ea759['query'][_0x61fc('0x2e')]);}_0x1552a5[_0x61fc('0x4f')]=qs[_0x61fc('0x50')](_0x5ea759['query']['sort']);_0x1552a5[_0x61fc('0x51')]=qs[_0x61fc('0x48')](_[_0x61fc('0x52')](_0x5ea759[_0x61fc('0x46')],_0x4cca3e[_0x61fc('0x48')]));_0x1552a5[_0x61fc('0x51')][_0x61fc('0x65')]=_0xe8d4a6['id'];if(_0x5ea759[_0x61fc('0x46')][_0x61fc('0x53')]){_0x1552a5[_0x61fc('0x51')]=_[_0x61fc('0x54')](_0x1552a5['where'],{'$or':_['map'](_0x1552a5['attributes'],function(_0xedfec7){var _0x3c22dd={};_0x3c22dd[_0xedfec7]={'$like':'%'+_0x5ea759['query']['filter']+'%'};return _0x3c22dd;})});}_0x1552a5=_[_0x61fc('0x54')]({},_0x1552a5,_0x5ea759[_0x61fc('0x55')]);return db['FaxInteraction'][_0x61fc('0x30')]({'where':_0x1552a5[_0x61fc('0x51')]})[_0x61fc('0x36')](function(_0x207bbb){_0x3cea58['count']=_0x207bbb;if(_0x5ea759[_0x61fc('0x46')][_0x61fc('0x59')]){_0x1552a5[_0x61fc('0x5a')]=[{'model':db[_0x61fc('0x74')],'as':_0x61fc('0x75'),'required':![]},{'model':db[_0x61fc('0x76')],'as':'Owner','attributes':[_0x61fc('0x3c'),_0x61fc('0x77'),_0x61fc('0x78')],'required':![]},{'model':db[_0x61fc('0x79')],'as':_0x61fc('0x7a'),'attributes':['id','name','color'],'where':_0x5ea759[_0x61fc('0x46')][_0x61fc('0x7b')]?{'id':_0x5ea759[_0x61fc('0x46')][_0x61fc('0x7b')]}:undefined,'required':_0x5ea759[_0x61fc('0x46')]['tag']?!![]:![]}];}return db['FaxInteraction'][_0x61fc('0x56')](_0x1552a5);})[_0x61fc('0x36')](function(_0x35ad63){_0x3cea58['rows']=_0x35ad63;return _0x3cea58;});}})[_0x61fc('0x36')](respondWithFilteredResult(_0x50fcdd,_0x1552a5))['catch'](handleError(_0x50fcdd,null));};exports['addApplications']=function(_0x58ddb4,_0x2f8a7c){var _0x305cf0=_0x58ddb4[_0x61fc('0x62')]['id'];var _0x5ca57b=_0x58ddb4[_0x61fc('0x5c')];var _0x3b2e46=0xc8;var _0x31cff2=null;return db[_0x61fc('0x7c')]['transaction']({'isolationLevel':db[_0x61fc('0x7c')]['Transaction']['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x1538e8){return db[_0x61fc('0x41')][_0x61fc('0x6e')]({'where':{'id':_0x305cf0},'transaction':_0x1538e8})[_0x61fc('0x36')](function(_0x443eab){if(_0x443eab){return db[_0x61fc('0x7d')][_0x61fc('0x37')]({'where':{'FaxAccountId':_0x305cf0},'transaction':_0x1538e8})[_0x61fc('0x36')](function(){var _0x1852db=_[_0x61fc('0x40')](_0x5ca57b,function(_0x2e2951){_0x2e2951['FaxAccountId']=_0x305cf0;return _0x2e2951;});return db['FaxApplication']['bulkCreate'](_0x1852db,{'transaction':_0x1538e8});});}else{_0x3b2e46=0x194;_0x31cff2=[];}});})['then'](function(){if(_0x3b2e46!==0x194){return db[_0x61fc('0x7d')][_0x61fc('0x7e')]({'where':{'FaxAccountId':_0x305cf0},'order':_0x61fc('0x7f')})['then'](function(_0x205e4b){_0x31cff2=_0x205e4b;});}})[_0x61fc('0x29')](function(_0x185401){_0x3b2e46=0x1f4;logger[_0x61fc('0x25')](_0x185401[_0x61fc('0x3b')]);if(_0x185401[_0x61fc('0x3c')]){delete _0x185401['name'];}_0x31cff2=_0x185401;})[_0x61fc('0x80')](function(){if(_0x31cff2===null){_0x2f8a7c['sendStatus'](_0x3b2e46);}else{if(_0x3b2e46===0x1f4){_0x2f8a7c['status'](_0x3b2e46)[_0x61fc('0x3d')](_0x31cff2);}else{_0x2f8a7c[_0x61fc('0x2c')](_0x3b2e46)['json'](_0x31cff2);}}});};exports['getApplications']=function(_0x254f4a,_0x34e37,_0x3aa427){var _0x29ed9f={};var _0x2eb685={};var _0x457b85;var _0x19355c;return db[_0x61fc('0x41')][_0x61fc('0x6e')]({'where':{'id':_0x254f4a['params']['id']}})[_0x61fc('0x36')](handleEntityNotFound(_0x34e37,null))[_0x61fc('0x36')](function(_0x10d8d5){if(_0x10d8d5){_0x457b85=_0x10d8d5;_0x2eb685[_0x61fc('0x4a')]=_[_0x61fc('0x47')](db[_0x61fc('0x7d')]['rawAttributes']);_0x2eb685[_0x61fc('0x46')]=_[_0x61fc('0x47')](_0x254f4a['query']);_0x2eb685['filters']=_[_0x61fc('0x49')](_0x2eb685[_0x61fc('0x4a')],_0x2eb685['query']);_0x29ed9f[_0x61fc('0x4c')]=_[_0x61fc('0x49')](_0x2eb685[_0x61fc('0x4a')],qs[_0x61fc('0x4b')](_0x254f4a['query'][_0x61fc('0x4b')]));_0x29ed9f[_0x61fc('0x4c')]=_0x29ed9f['attributes'][_0x61fc('0x58')]?_0x29ed9f[_0x61fc('0x4c')]:_0x2eb685[_0x61fc('0x4a')];_0x29ed9f[_0x61fc('0x4f')]=qs[_0x61fc('0x50')](_0x254f4a['query']['sort']);_0x29ed9f[_0x61fc('0x51')]=qs['filters'](_[_0x61fc('0x52')](_0x254f4a[_0x61fc('0x46')],_0x2eb685['filters']));if(_0x254f4a[_0x61fc('0x46')][_0x61fc('0x53')]){_0x29ed9f[_0x61fc('0x51')]=_[_0x61fc('0x54')](_0x29ed9f[_0x61fc('0x51')],{'$or':_[_0x61fc('0x40')](_0x29ed9f[_0x61fc('0x4c')],function(_0x997c66){var _0x4287a2={};_0x4287a2[_0x997c66]={'$like':'%'+_0x254f4a[_0x61fc('0x46')][_0x61fc('0x53')]+'%'};return _0x4287a2;})});}_0x29ed9f=_[_0x61fc('0x54')]({},_0x29ed9f,_0x254f4a[_0x61fc('0x55')]);return _0x457b85[_0x61fc('0x81')](_0x29ed9f);}})[_0x61fc('0x36')](function(_0x1494c2){if(_0x1494c2){_0x19355c=_0x1494c2[_0x61fc('0x58')];if(!_0x254f4a[_0x61fc('0x46')][_0x61fc('0x4d')](_0x61fc('0x68'))){_0x29ed9f[_0x61fc('0x4e')]=qs['limit'](_0x254f4a['query'][_0x61fc('0x4e')]);_0x29ed9f[_0x61fc('0x2e')]=qs[_0x61fc('0x2e')](_0x254f4a['query'][_0x61fc('0x2e')]);}return _0x457b85[_0x61fc('0x81')](_0x29ed9f);}})['then'](function(_0x3369d7){if(_0x3369d7){return _0x3369d7?{'count':_0x19355c,'rows':_0x3369d7}:null;}})[_0x61fc('0x36')](respondWithResult(_0x34e37,null))[_0x61fc('0x29')](handleError(_0x34e37,null));};function Extension(_0x4bc0bc,_0x5ed05d,_0x277845,_0x1bfa7d){this[_0x61fc('0x82')]=_0x61fc('0x83');this[_0x61fc('0x84')]=_0x4bc0bc['localstationid'];this[_0x61fc('0x85')]=_0x1bfa7d;this[_0x61fc('0x44')]='system';this[_0x61fc('0x86')]=_0x61fc('0x87');this[_0x61fc('0x65')]=_0x4bc0bc['id'];this['priority']=_0x5ed05d;this[_0x61fc('0x88')]=_0x277845;}function createExtensionsReciveFax(_0x5c5357){var _0x18cf5c=0x1;var _0x377e76=[];_0x377e76[_0x61fc('0x89')](new Extension(_0x5c5357,_0x18cf5c,'','Answer'));_0x18cf5c+=0x1;_0x377e76['push'](new Extension(_0x5c5357,_0x18cf5c,'CDR(type)=inbound-fax','Set'));_0x18cf5c+=0x1;for(var _0xa8b227 in _0x5c5357){if(_0x5c5357[_0x61fc('0x4d')](_0xa8b227)&&(_0xa8b227===_0x61fc('0x8a')||_0xa8b227===_0x61fc('0x8b')||_0xa8b227===_0x61fc('0x8c')||_0xa8b227==='faxdetect'||_0xa8b227==='headerinfo'||_0xa8b227===_0x61fc('0x8d')||_0xa8b227==='minrate'||_0xa8b227===_0x61fc('0x8e')||_0xa8b227===_0x61fc('0x8f'))){_0x377e76['push'](new Extension(_0x5c5357,_0x18cf5c,_0x61fc('0x90')+_0xa8b227+')='+_0x5c5357[_0xa8b227],_0x61fc('0x91')));_0x18cf5c+=0x1;}}_0x377e76[_0x61fc('0x89')](new Extension(_0x5c5357,_0x18cf5c,'6','Wait'));_0x18cf5c+=0x1;_0x377e76[_0x61fc('0x89')](new Extension(_0x5c5357,_0x18cf5c,_0x61fc('0x92'),_0x61fc('0x93')));_0x18cf5c=0x0;return _0x377e76;}exports[_0x61fc('0x94')]=function(_0x399c58,_0x35c8ae,_0x2a482d){var _0x49d51d;return db[_0x61fc('0x7c')]['transaction'](function(_0x471602){return db[_0x61fc('0x41')][_0x61fc('0x5b')](_0x399c58[_0x61fc('0x5c')],{'transaction':_0x471602})[_0x61fc('0x36')](function(_0x56032e){_0x49d51d=_0x56032e[_0x61fc('0x38')]({'plain':!![]});return db[_0x61fc('0x95')][_0x61fc('0x96')](createExtensionsReciveFax(_0x49d51d),{'transaction':_0x471602});});})[_0x61fc('0x36')](function(){return _0x49d51d;})[_0x61fc('0x36')](respondWithResult(_0x35c8ae,null))[_0x61fc('0x29')](handleError(_0x35c8ae,null));};exports[_0x61fc('0x97')]=function(_0x420093,_0x4bed33,_0x638bbf){var _0x3b3878;return db[_0x61fc('0x7c')][_0x61fc('0x98')](function(_0x209a81){return db[_0x61fc('0x41')][_0x61fc('0x35')](_0x420093['body'],{'where':{'id':_0x420093[_0x61fc('0x5c')]['id']},'transaction':_0x209a81})[_0x61fc('0x36')](function(_0x46c60d){return db[_0x61fc('0x95')][_0x61fc('0x37')]({'where':{'FaxAccountId':_0x420093[_0x61fc('0x5c')]['id']},'transaction':_0x209a81})['then'](function(_0x5a02ca){return db[_0x61fc('0x95')][_0x61fc('0x96')](createExtensionsReciveFax(_[_0x61fc('0x72')](_0x420093[_0x61fc('0x5c')],['tech','key','createdAt','updatedAt','TrunkId','ListId'])),{'transaction':_0x209a81});});});})[_0x61fc('0x36')](function(){return db[_0x61fc('0x41')][_0x61fc('0x99')](_0x420093[_0x61fc('0x5c')]['id']);})[_0x61fc('0x36')](respondWithResult(_0x4bed33,null))[_0x61fc('0x29')](handleError(_0x4bed33,null));};exports['getMessages']=function(_0x51fb79,_0x4e681a,_0x591dae){var _0x4f370e={'raw':!![],'where':{}};var _0xc44e41={};var _0x5783a1={'count':0x0,'rows':[]};return db[_0x61fc('0x41')][_0x61fc('0x6e')]({'where':{'id':_0x51fb79['params']['id']}})[_0x61fc('0x36')](handleEntityNotFound(_0x4e681a,null))['then'](function(_0x5b69b4){if(_0x5b69b4){_0xc44e41['model']=_[_0x61fc('0x47')](db[_0x61fc('0x9a')][_0x61fc('0x42')]);_0xc44e41[_0x61fc('0x46')]=_[_0x61fc('0x47')](_0x51fb79[_0x61fc('0x46')]);_0xc44e41[_0x61fc('0x48')]=_[_0x61fc('0x49')](_0xc44e41[_0x61fc('0x4a')],_0xc44e41[_0x61fc('0x46')]);_0x4f370e[_0x61fc('0x4c')]=_[_0x61fc('0x49')](_0xc44e41[_0x61fc('0x4a')],qs[_0x61fc('0x4b')](_0x51fb79[_0x61fc('0x46')][_0x61fc('0x4b')]));_0x4f370e[_0x61fc('0x4c')]=_0x4f370e[_0x61fc('0x4c')][_0x61fc('0x58')]?_0x4f370e[_0x61fc('0x4c')]:_0xc44e41[_0x61fc('0x4a')];if(!_0x51fb79[_0x61fc('0x46')][_0x61fc('0x4d')](_0x61fc('0x68'))){_0x4f370e[_0x61fc('0x4e')]=qs['limit'](_0x51fb79[_0x61fc('0x46')][_0x61fc('0x4e')]);_0x4f370e[_0x61fc('0x2e')]=qs[_0x61fc('0x2e')](_0x51fb79['query'][_0x61fc('0x2e')]);}_0x4f370e[_0x61fc('0x4f')]=qs[_0x61fc('0x50')](_0x51fb79[_0x61fc('0x46')][_0x61fc('0x50')]);_0x4f370e[_0x61fc('0x51')]=qs['filters'](_[_0x61fc('0x52')](_0x51fb79[_0x61fc('0x46')],_0xc44e41['filters']));_0x4f370e[_0x61fc('0x51')][_0x61fc('0x65')]=_0x5b69b4['id'];if(_0x51fb79['query']['filter']){_0x4f370e[_0x61fc('0x51')]=_[_0x61fc('0x54')](_0x4f370e['where'],{'$or':_[_0x61fc('0x40')](_0x4f370e['attributes'],function(_0x49ec8e){var _0x43e4ad={};_0x43e4ad[_0x49ec8e]={'$like':'%'+_0x51fb79[_0x61fc('0x46')][_0x61fc('0x53')]+'%'};return _0x43e4ad;})});}if(_0x51fb79[_0x61fc('0x46')][_0x61fc('0x9b')]){var _0x103074=_0x51fb79[_0x61fc('0x46')][_0x61fc('0x9b')][_0x61fc('0x9c')](',');var _0x42b6c5={};_0x42b6c5[_0x103074[0x0]]={'$gte':moment(_0x103074[0x1])[_0x61fc('0x9d')](_0x61fc('0x9e'))};_0x4f370e['where']=_[_0x61fc('0x54')](_0x4f370e[_0x61fc('0x51')],_0x42b6c5);}_0x4f370e=_[_0x61fc('0x54')]({},_0x4f370e,_0x51fb79[_0x61fc('0x55')]);return db['FaxMessage'][_0x61fc('0x30')]({'where':_0x4f370e['where']})['then'](function(_0xc43ebc){_0x5783a1['count']=_0xc43ebc;if(_0x51fb79[_0x61fc('0x46')][_0x61fc('0x59')]){_0x4f370e['include']=[{'all':!![]}];}return db[_0x61fc('0x9a')]['findAll'](_0x4f370e);})[_0x61fc('0x36')](function(_0x20e400){_0x5783a1[_0x61fc('0x69')]=_0x20e400;return _0x5783a1;});}})[_0x61fc('0x36')](respondWithFilteredResult(_0x4e681a,_0x4f370e))['catch'](handleError(_0x4e681a,null));};exports[_0x61fc('0x3d')]=function(_0x5dbb3a,_0x209d79,_0x34b41f){var _0x118945,_0xefcb58={},_0x4576ef;if(_0x5dbb3a['body']['to']){_0x4576ef=_0x5dbb3a[_0x61fc('0x5c')]['to'][0x0];}return db[_0x61fc('0x41')][_0x61fc('0x60')]({'where':{'id':_0x5dbb3a['params']['id']},'include':[{'model':db[_0x61fc('0x9f')],'as':_0x61fc('0xa0'),'include':[{'model':db[_0x61fc('0x74')],'as':_0x61fc('0xa1'),'where':{'fax':_0x4576ef},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x61fc('0x36')](handleEntityNotFound(_0x209d79,null))['then'](function(_0x3d54a9){_0x118945=_0x3d54a9;if(_0x5dbb3a[_0x61fc('0x5c')][_0x61fc('0xa2')]&&_0x5dbb3a[_0x61fc('0x5c')][_0x61fc('0xa2')][_0x61fc('0x58')]){for(var _0x250b11=0x0;_0x250b11<_0x5dbb3a['body']['attachments']['length'];_0x250b11+=0x1){_0x5dbb3a[_0x61fc('0x5c')]['attachments'][_0x250b11]={'filename':_0x5dbb3a[_0x61fc('0x5c')][_0x61fc('0xa2')][_0x250b11]['name'],'id':_0x5dbb3a[_0x61fc('0x5c')]['attachments'][_0x250b11]['id'],'path':path['join'](config[_0x61fc('0xa3')],_0x61fc('0xa4'),_0x5dbb3a[_0x61fc('0x5c')][_0x61fc('0xa2')][_0x250b11][_0x61fc('0xa5')])};}}return respondWithRpcPromise('CheckAfterSend',_0x61fc('0xa6'),{'FaxAccountId':_['isNil'](_0x5dbb3a[_0x61fc('0x62')]['id'])?undefined:_0x5dbb3a[_0x61fc('0x62')]['id'],'path':_[_0x61fc('0xa7')](_0x5dbb3a[_0x61fc('0x5c')][_0x61fc('0xa2')][0x0][_0x61fc('0x6')])?undefined:_0x5dbb3a[_0x61fc('0x5c')]['attachments'][0x0][_0x61fc('0x6')],'fax':_[_0x61fc('0xa7')](_0x5dbb3a[_0x61fc('0x5c')]['to'][0x0])?undefined:_0x5dbb3a[_0x61fc('0x5c')]['to'][0x0]},client9002);})[_0x61fc('0x36')](function(){if(_0x118945){if(_[_0x61fc('0xa7')](_0x5dbb3a[_0x61fc('0x5c')][_0x61fc('0xa8')])){_0x5dbb3a[_0x61fc('0x5c')][_0x61fc('0xa8')]=util[_0x61fc('0x9d')](_0x61fc('0xa9'),_0x118945[_0x61fc('0x3c')],_0x118945[_0x61fc('0xaa')]);}if(_0x118945[_0x61fc('0xa0')]){if(_0x118945[_0x61fc('0xa0')][_0x61fc('0xa1')][_0x61fc('0x58')]){return _0x118945['List'][_0x61fc('0xa1')][0x0];}else{return db[_0x61fc('0x74')][_0x61fc('0x5b')](_[_0x61fc('0x19')](_0x5dbb3a[_0x61fc('0x5c')],{'firstName':_0x5dbb3a['body']['to'][0x0],'phone':_0x5dbb3a[_0x61fc('0x5c')]['to'][0x0],'fax':_0x5dbb3a['body']['to'][0x0],'ListId':_0x118945['ListId']}));}}else{throw new Error(_0x61fc('0xab'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x61fc('0x36')](function(_0x11d371){if(_0x11d371){return db[_0x61fc('0x71')][_0x61fc('0x60')]({'where':{'ContactId':_0x11d371['id'],'closed':![],'FaxAccountId':_0x118945['id']}})[_0x61fc('0x36')](function(_0x45c69b){if(_0x45c69b){return[_0x45c69b,![]];}return db[_0x61fc('0x71')][_0x61fc('0x5b')]({'UserId':_0x5dbb3a[_0x61fc('0x5d')]['id'],'ContactId':_0x11d371['id'],'FaxAccountId':_0x118945['id'],'fax':_0x5dbb3a[_0x61fc('0x5c')]['to'][0x0],'firstMsgDirection':_0x61fc('0xac'),'Messages':[_['merge'](_0x5dbb3a[_0x61fc('0x5c')],{'read':![],'body':_0x5dbb3a[_0x61fc('0x5c')]['attachments'][0x0]['filename'],'FaxAccountId':_0x118945['id'],'UserId':_0x5dbb3a[_0x61fc('0x5d')]['id'],'ContactId':_0x11d371['id'],'AttachmentId':_0x5dbb3a[_0x61fc('0x5c')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x61fc('0x9a')],'as':_0x61fc('0xad')}]})['then'](function(_0x1cbb10){return[_0x1cbb10,!![]];});});}else{throw new Error(_0x61fc('0xae'));}})['spread'](function(_0x520ec9,_0xdac3c4){if(_0xdac3c4){return _0x520ec9;}return db['FaxMessage'][_0x61fc('0x5b')]({'direction':_0x61fc('0xac'),'read':![],'body':_0x5dbb3a['body'][_0x61fc('0xa2')][0x0]['filename'],'FaxAccountId':_0x118945['id'],'FaxInteractionId':_0x520ec9['id'],'UserId':_0x5dbb3a['user']['id'],'ContactId':_0x520ec9[_0x61fc('0xaf')],'AttachmentId':_0x5dbb3a['body'][_0x61fc('0xa2')][0x0]['id']})[_0x61fc('0x36')](function(_0xaea75){_0x520ec9[_0x61fc('0xb0')][_0x61fc('0xad')]=[];_0x520ec9[_0x61fc('0xb0')][_0x61fc('0xad')][_0x61fc('0x89')](_0xaea75[_0x61fc('0xb0')]);return _0x520ec9;});})['then'](function(_0x71c330){respondWithRpcPromise(_0x61fc('0xb1'),_0x61fc('0xb1'),{'FaxAccountId':_[_0x61fc('0xa7')](_0x5dbb3a[_0x61fc('0x62')]['id'])?undefined:_0x5dbb3a[_0x61fc('0x62')]['id'],'path':_[_0x61fc('0xa7')](_0x5dbb3a[_0x61fc('0x5c')][_0x61fc('0xa2')][0x0][_0x61fc('0x6')])?undefined:_0x5dbb3a[_0x61fc('0x5c')][_0x61fc('0xa2')][0x0][_0x61fc('0x6')],'fax':_[_0x61fc('0xa7')](_0x5dbb3a[_0x61fc('0x5c')]['to'][0x0])?undefined:_0x5dbb3a[_0x61fc('0x5c')]['to'][0x0],'AttachmentId':_0x5dbb3a[_0x61fc('0x5c')]['attachments'][0x0]['id']},client9002)[_0x61fc('0x36')](function(_0x31f827){logger['info'](_0x61fc('0xb2'),_0x31f827);})['catch'](function(_0x51fa93){logger['info'](_0x61fc('0xb2'),_0x51fa93);});return _0x71c330;})[_0x61fc('0x36')](respondWithResult(_0x209d79,null))[_0x61fc('0x29')](handleError(_0x209d79,null));};exports[_0x61fc('0xb3')]=function(_0x425bf1,_0x5bd976,_0x1abb3f){return db[_0x61fc('0x41')][_0x61fc('0x60')]({'where':{'id':_0x425bf1[_0x61fc('0x62')]['id']}})['then'](handleEntityNotFound(_0x5bd976,null))[_0x61fc('0x36')](function(_0x280475){if(_0x280475){return _0x280475[_0x61fc('0xb3')](_0x425bf1[_0x61fc('0x5c')][_0x61fc('0x6b')],_[_0x61fc('0x72')](_0x425bf1[_0x61fc('0x5c')],['ids','id'])||{})['spread'](function(_0x3a1c5e){for(var _0x181479=0x0;_0x181479<_0x425bf1[_0x61fc('0x5c')]['ids'][_0x61fc('0x58')];_0x181479+=0x1){socket['emit'](_0x61fc('0xb4'),{'UserId':Number(_0x425bf1[_0x61fc('0x5c')][_0x61fc('0x6b')][_0x181479]),'FaxAccountId':Number(_0x425bf1[_0x61fc('0x62')]['id'])});}return _0x3a1c5e;});}})[_0x61fc('0x36')](respondWithResult(_0x5bd976,null))[_0x61fc('0x29')](handleError(_0x5bd976,null));};exports['removeAgents']=function(_0x4722c7,_0x565056,_0x1178c9){return db['FaxAccount'][_0x61fc('0x60')]({'where':{'id':_0x4722c7[_0x61fc('0x62')]['id']}})[_0x61fc('0x36')](handleEntityNotFound(_0x565056,null))[_0x61fc('0x36')](function(_0xba53d1){if(_0xba53d1){return _0xba53d1[_0x61fc('0xb5')](_0x4722c7[_0x61fc('0x46')]['ids'])[_0x61fc('0x36')](function(){if(_[_0x61fc('0xb6')](_0x4722c7[_0x61fc('0x46')][_0x61fc('0x6b')])){for(var _0xfeb88f=0x0;_0xfeb88f<_0x4722c7['query']['ids'][_0x61fc('0x58')];_0xfeb88f+=0x1){socket[_0x61fc('0xb7')]('userFaxAccount:remove',{'UserId':Number(_0x4722c7[_0x61fc('0x46')][_0x61fc('0x6b')][_0xfeb88f]),'FaxAccountId':Number(_0x4722c7[_0x61fc('0x62')]['id'])});}}else{socket[_0x61fc('0xb7')]('userFaxAccount:remove',{'UserId':Number(_0x4722c7[_0x61fc('0x46')][_0x61fc('0x6b')]),'FaxAccountId':Number(_0x4722c7[_0x61fc('0x62')]['id'])});}});}})[_0x61fc('0x36')](respondWithStatusCode(_0x565056,null))[_0x61fc('0x29')](handleError(_0x565056,null));};exports['getAgents']=function(_0x212218,_0x3f6e33,_0x22294b){var _0x265ed5={};var _0x57ce37={};var _0x5847eb;var _0x16b360;return db['FaxAccount'][_0x61fc('0x6e')]({'where':{'id':_0x212218['params']['id']}})['then'](handleEntityNotFound(_0x3f6e33,null))['then'](function(_0xd75964){if(_0xd75964){_0x5847eb=_0xd75964;_0x57ce37[_0x61fc('0x4a')]=_[_0x61fc('0x47')](db[_0x61fc('0x76')]['rawAttributes']);_0x57ce37[_0x61fc('0x46')]=_[_0x61fc('0x47')](_0x212218[_0x61fc('0x46')]);_0x57ce37[_0x61fc('0x48')]=_[_0x61fc('0x49')](_0x57ce37[_0x61fc('0x4a')],_0x57ce37[_0x61fc('0x46')]);_0x265ed5['attributes']=_[_0x61fc('0x49')](_0x57ce37['model'],qs['fields'](_0x212218['query'][_0x61fc('0x4b')]));_0x265ed5['attributes']=_0x265ed5[_0x61fc('0x4c')][_0x61fc('0x58')]?_0x265ed5['attributes']:_0x57ce37[_0x61fc('0x4a')];_0x265ed5[_0x61fc('0x4f')]=qs[_0x61fc('0x50')](_0x212218[_0x61fc('0x46')]['sort']);_0x265ed5[_0x61fc('0x51')]=qs['filters'](_[_0x61fc('0x52')](_0x212218[_0x61fc('0x46')],_0x57ce37[_0x61fc('0x48')]));if(_0x212218['query']['filter']){_0x265ed5[_0x61fc('0x51')]=_[_0x61fc('0x54')](_0x265ed5[_0x61fc('0x51')],{'$or':_[_0x61fc('0x40')](_0x265ed5[_0x61fc('0x4c')],function(_0x3b55dd){var _0x26da80={};_0x26da80[_0x3b55dd]={'$like':'%'+_0x212218[_0x61fc('0x46')][_0x61fc('0x53')]+'%'};return _0x26da80;})});}_0x265ed5=_[_0x61fc('0x54')]({},_0x265ed5,_0x212218['options']);return _0x5847eb[_0x61fc('0xb8')](_0x265ed5);}})['then'](function(_0x397cc8){if(_0x397cc8){_0x16b360=_0x397cc8['length'];if(!_0x212218[_0x61fc('0x46')]['hasOwnProperty'](_0x61fc('0x68'))){_0x265ed5[_0x61fc('0x4e')]=qs[_0x61fc('0x4e')](_0x212218[_0x61fc('0x46')]['limit']);_0x265ed5['offset']=qs[_0x61fc('0x2e')](_0x212218['query']['offset']);}return _0x5847eb['getAgents'](_0x265ed5);}})[_0x61fc('0x36')](function(_0x28e02e){if(_0x28e02e){return _0x28e02e?{'count':_0x16b360,'rows':_0x28e02e}:null;}})[_0x61fc('0x36')](respondWithResult(_0x3f6e33,null))[_0x61fc('0x29')](handleError(_0x3f6e33,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index ad91ece..e161c9b 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 _0x4c4c=['save','emit','hasOwnProperty','hook','exports','../../mysqldb','FaxAccount','setMaxListeners'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x4c4c,0xad));var _0xc4c4=function(_0x2f306a,_0x3395ab){_0x2f306a=_0x2f306a-0x0;var _0x1f6fea=_0x4c4c[_0x2f306a];return _0x1f6fea;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xc4c4('0x0'))['db'][_0xc4c4('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xc4c4('0x2')](0x0);var events={'afterCreate':_0xc4c4('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x104746){return function(_0x3abfc6,_0x18980a,_0x4240c7){FaxAccountEvents['emit'](_0x104746+':'+_0x3abfc6['id'],_0x3abfc6);FaxAccountEvents[_0xc4c4('0x4')](_0x104746,_0x3abfc6);_0x4240c7(null);};}for(var e in events){if(events[_0xc4c4('0x5')](e)){var event=events[e];FaxAccount[_0xc4c4('0x6')](e,emitEvent(event));}}module[_0xc4c4('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0x5bf9=['hasOwnProperty','exports','../../mysqldb','FaxAccount','setMaxListeners','update','remove','emit'];(function(_0x46c82b,_0x3c082f){var _0x56fdf1=function(_0x3ed8b5){while(--_0x3ed8b5){_0x46c82b['push'](_0x46c82b['shift']());}};_0x56fdf1(++_0x3c082f);}(_0x5bf9,0xa2));var _0x95bf=function(_0xd773cb,_0x288c5c){_0xd773cb=_0xd773cb-0x0;var _0x7fdfaa=_0x5bf9[_0xd773cb];return _0x7fdfaa;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x95bf('0x0'))['db'][_0x95bf('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x95bf('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x95bf('0x3'),'afterDestroy':_0x95bf('0x4')};function emitEvent(_0x2b4c02){return function(_0x4fc39e,_0x4525bc,_0x2f9bfc){FaxAccountEvents[_0x95bf('0x5')](_0x2b4c02+':'+_0x4fc39e['id'],_0x4fc39e);FaxAccountEvents[_0x95bf('0x5')](_0x2b4c02,_0x4fc39e);_0x2f9bfc(null);};}for(var e in events){if(events[_0x95bf('0x6')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x95bf('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 28ff38a..745cae8 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 _0xd55e=['fax_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount'];(function(_0x2fa393,_0x15d5dd){var _0xd12067=function(_0x208a23){while(--_0x208a23){_0x2fa393['push'](_0x2fa393['shift']());}};_0xd12067(++_0x15d5dd);}(_0xd55e,0xc4));var _0xed55=function(_0x230b97,_0x5e6db3){_0x230b97=_0x230b97-0x0;var _0x156bac=_0xd55e[_0x230b97];return _0x156bac;};'use strict';var _=require(_0xed55('0x0'));var util=require(_0xed55('0x1'));var logger=require(_0xed55('0x2'))(_0xed55('0x3'));var moment=require(_0xed55('0x4'));var BPromise=require(_0xed55('0x5'));var rp=require(_0xed55('0x6'));var fs=require('fs');var path=require(_0xed55('0x7'));var rimraf=require(_0xed55('0x8'));var config=require(_0xed55('0x9'));var attributes=require(_0xed55('0xa'));module[_0xed55('0xb')]=function(_0x532108,_0x564b27){return _0x532108[_0xed55('0xc')](_0xed55('0xd'),attributes,{'tableName':_0xed55('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x56a7=['FaxAccount','fax_accounts','lodash','util','api','moment','bluebird','../../config/environment','define'];(function(_0x1ced25,_0x916de1){var _0xd12f7c=function(_0x2cac5a){while(--_0x2cac5a){_0x1ced25['push'](_0x1ced25['shift']());}};_0xd12f7c(++_0x916de1);}(_0x56a7,0x18e));var _0x756a=function(_0x1d6914,_0x2f6a85){_0x1d6914=_0x1d6914-0x0;var _0x511d10=_0x56a7[_0x1d6914];return _0x511d10;};'use strict';var _=require(_0x756a('0x0'));var util=require(_0x756a('0x1'));var logger=require('../../config/logger')(_0x756a('0x2'));var moment=require(_0x756a('0x3'));var BPromise=require(_0x756a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x756a('0x5'));var attributes=require('./faxAccount.attributes');module['exports']=function(_0x17e10e,_0x3be5dd){return _0x17e10e[_0x756a('0x6')](_0x756a('0x7'),attributes,{'tableName':_0x756a('0x8'),'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 7522e6c..cb428c0 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 _0x4a32=['options','raw','where','attributes','limit','include','map','model','GetFaxAccount','debug','fax','CmContact','describe','Sequelize','ValidationError','difference','keys','createdAt','updatedAt','CompanyId','body','from','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account','List','DESC','FaxApplication','Applications','get','list','applications','orderBy','priority','asc','Contacts','length','ListId','FaxInteraction','create','spread','autoclose','push','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','unshift','name','waitForTheAssignedAgent','Start','startRouting','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x33a98a,_0x4ed7a7){var _0x35ce86=function(_0x2a81ad){while(--_0x2a81ad){_0x33a98a['push'](_0x33a98a['shift']());}};_0x35ce86(++_0x4ed7a7);}(_0x4a32,0x99));var _0x24a3=function(_0x42a90e,_0x3de35d){_0x42a90e=_0x42a90e-0x0;var _0x3d8a76=_0x4a32[_0x42a90e];return _0x3d8a76;};'use strict';var _=require('lodash');var util=require(_0x24a3('0x0'));var moment=require(_0x24a3('0x1'));var BPromise=require(_0x24a3('0x2'));var rs=require(_0x24a3('0x3'));var fs=require('fs');var Redis=require(_0x24a3('0x4'));var db=require(_0x24a3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x24a3('0x6'))(_0x24a3('0x7'));var config=require(_0x24a3('0x8'));var jayson=require(_0x24a3('0x9'));var client=jayson[_0x24a3('0xa')][_0x24a3('0xb')]({'port':0x232c});config[_0x24a3('0xc')]=_[_0x24a3('0xd')](config[_0x24a3('0xc')],{'host':_0x24a3('0xe'),'port':0x18eb});var socket=require(_0x24a3('0xf'))(new Redis(config[_0x24a3('0xc')]));require(_0x24a3('0x10'))[_0x24a3('0x11')](socket);function respondWithRpcPromise(_0x1269b8,_0x3545b6,_0x5b3960){return new BPromise(function(_0x39417b,_0xfe0c0a){return client[_0x24a3('0x12')](_0x1269b8,_0x5b3960)[_0x24a3('0x13')](function(_0xc65499){logger[_0x24a3('0x14')](_0x24a3('0x15'),_0x3545b6,_0x24a3('0x16'));logger['debug'](_0x24a3('0x17'),_0x3545b6,'request\x20sent',JSON['stringify'](_0xc65499));if(_0xc65499['error']){if(_0xc65499[_0x24a3('0x18')][_0x24a3('0x19')]===0x1f4){logger[_0x24a3('0x18')]('FaxAccount,\x20%s,\x20%s',_0x3545b6,_0xc65499[_0x24a3('0x18')]['message']);return _0xfe0c0a(_0xc65499[_0x24a3('0x18')][_0x24a3('0x1a')]);}logger[_0x24a3('0x18')](_0x24a3('0x15'),_0x3545b6,_0xc65499[_0x24a3('0x18')]['message']);return _0x39417b(_0xc65499[_0x24a3('0x18')][_0x24a3('0x1a')]);}else{logger[_0x24a3('0x14')](_0x24a3('0x15'),_0x3545b6,_0x24a3('0x16'));_0x39417b(_0xc65499[_0x24a3('0x1b')][_0x24a3('0x1a')]);}})[_0x24a3('0x1c')](function(_0x5c08e5){logger[_0x24a3('0x18')](_0x24a3('0x15'),_0x3545b6,_0x5c08e5);_0xfe0c0a(_0x5c08e5);});});}exports['GetFaxAccount']=function(_0x11a378){var _0x24358f=this;return new Promise(function(_0x5185e7,_0x5db170){return db['FaxAccount']['findAll']({'raw':_0x11a378[_0x24a3('0x1d')]?_0x11a378[_0x24a3('0x1d')][_0x24a3('0x1e')]===undefined?!![]:![]:!![],'where':_0x11a378['options']?_0x11a378['options'][_0x24a3('0x1f')]||null:null,'attributes':_0x11a378[_0x24a3('0x1d')]?_0x11a378[_0x24a3('0x1d')][_0x24a3('0x20')]||null:null,'limit':_0x11a378['options']?_0x11a378[_0x24a3('0x1d')][_0x24a3('0x21')]||null:null,'include':_0x11a378[_0x24a3('0x1d')]?_0x11a378[_0x24a3('0x1d')][_0x24a3('0x22')]?_[_0x24a3('0x23')](_0x11a378[_0x24a3('0x1d')][_0x24a3('0x22')],function(_0x34cc50){return{'model':db[_0x34cc50[_0x24a3('0x24')]],'as':_0x34cc50['as'],'attributes':_0x34cc50['attributes'],'include':_0x34cc50[_0x24a3('0x22')]?_[_0x24a3('0x23')](_0x34cc50[_0x24a3('0x22')],function(_0x2d333f){return{'model':db[_0x2d333f[_0x24a3('0x24')]],'as':_0x2d333f['as'],'attributes':_0x2d333f[_0x24a3('0x20')],'include':_0x2d333f[_0x24a3('0x22')]?_[_0x24a3('0x23')](_0x2d333f['include'],function(_0x4dd2d6){return{'model':db[_0x4dd2d6[_0x24a3('0x24')]],'as':_0x4dd2d6['as'],'attributes':_0x4dd2d6[_0x24a3('0x20')]};}):[]};}):[]};}):[]:[]})[_0x24a3('0x13')](function(_0x1a366d){logger[_0x24a3('0x14')](_0x24a3('0x25'),_0x11a378);logger[_0x24a3('0x26')](_0x24a3('0x25'),_0x11a378,JSON['stringify'](_0x1a366d));_0x5185e7(_0x1a366d);})['catch'](function(_0x847dcd){logger['error'](_0x24a3('0x25'),_0x847dcd[_0x24a3('0x1a')],_0x11a378);_0x5db170(_0x24358f[_0x24a3('0x18')](0x1f4,_0x847dcd[_0x24a3('0x1a')]));});});};exports['NotifyFaxAccount']=function(_0x5c8e24,_0xfc59d9,_0x38e20b){var _0x5583a6=this;return new Promise(function(_0x5875f7,_0x51c401){var _0x2adc38={'body':_0x5c8e24['body'],'channel':_0x24a3('0x27')};var _0x2ddf9f=[];var _0x4abf11=[];var _0x197427={};return db[_0x24a3('0x28')][_0x24a3('0x29')]()['then'](function(_0x486fe1){if(!_0x486fe1){throw new db[(_0x24a3('0x2a'))][(_0x24a3('0x2b'))]('no\x20available\x20attributes');}_0x2ddf9f=_[_0x24a3('0x2c')](_[_0x24a3('0x2d')](_0x486fe1),[_0x24a3('0x2e'),'updatedAt']);_0x4abf11=_['difference'](_[_0x24a3('0x2d')](_0x486fe1),[_0x24a3('0x2e'),_0x24a3('0x2f'),_0x24a3('0x30'),'ListId']);if(_0x5c8e24[_0x24a3('0x31')]['id']){delete _0x5c8e24[_0x24a3('0x31')]['id'];}if(_['isNil'](_0x5c8e24['body'][_0x24a3('0x32')])){throw new db[(_0x24a3('0x2a'))][(_0x24a3('0x2b'))](_0x24a3('0x33'));}if(_[_0x24a3('0x34')](_0x5c8e24[_0x24a3('0x31')][_0x24a3('0x31')])||_0x5c8e24[_0x24a3('0x31')][_0x24a3('0x31')]===''){throw new db[(_0x24a3('0x2a'))][(_0x24a3('0x2b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x24a3('0x34')](_0x5c8e24[_0x24a3('0x31')][_0x24a3('0x35')])){throw new db[(_0x24a3('0x2a'))][(_0x24a3('0x2b'))](_0x24a3('0x36')+_0x4abf11);}if(!_[_0x24a3('0x37')](_0x4abf11,_0x5c8e24[_0x24a3('0x31')][_0x24a3('0x35')])){throw new db['Sequelize'][(_0x24a3('0x2b'))](_0x24a3('0x38')+_0x4abf11);}_0x197427[_0x5c8e24[_0x24a3('0x31')][_0x24a3('0x35')]]=_0x5c8e24[_0x24a3('0x31')][_0x24a3('0x32')];})['then'](function(){return db[_0x24a3('0x39')][_0x24a3('0x3a')]({'where':{'id':_0x5c8e24[_0x24a3('0x3b')]['id']},'include':[{'model':db['CmList'],'as':_0x24a3('0x3c'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x197427,'limit':0x1,'order':[['updatedAt',_0x24a3('0x3d')]]}]},{'model':db[_0x24a3('0x3e')],'as':_0x24a3('0x3f')}]});})[_0x24a3('0x13')](function(_0x262405){if(_0x262405&&_0x262405[_0x24a3('0x3c')]){var _0x47d70a=_0x262405[_0x24a3('0x40')]({'plain':!![]});_0x2adc38[_0x24a3('0x3b')]=_0x47d70a;_0x2adc38['applications']=_0x47d70a[_0x24a3('0x3f')];_0x2adc38[_0x24a3('0x41')]=_0x47d70a[_0x24a3('0x3c')];_0x2adc38[_0x24a3('0x42')]=_[_0x24a3('0x43')](_0x2adc38[_0x24a3('0x42')],[_0x24a3('0x44')],[_0x24a3('0x45')]);if(_0x2adc38['account'][_0x24a3('0x3f')]){delete _0x2adc38[_0x24a3('0x3b')][_0x24a3('0x3f')];}if(_0x2adc38[_0x24a3('0x3b')]['List']&&_0x2adc38['account'][_0x24a3('0x3c')][_0x24a3('0x46')][_0x24a3('0x47')]){return _0x2adc38[_0x24a3('0x3b')][_0x24a3('0x3c')][_0x24a3('0x46')][0x0];}var _0x588de5=_[_0x24a3('0xd')](_0x5c8e24[_0x24a3('0x31')],{'firstName':_0x5c8e24['body'][_0x24a3('0x32')],'ListId':_0x47d70a[_0x24a3('0x48')]});_0x588de5[_0x5c8e24[_0x24a3('0x31')][_0x24a3('0x35')]]=_0x5c8e24[_0x24a3('0x31')][_0x24a3('0x32')];return db[_0x24a3('0x28')]['create'](_0x588de5,{'fields':_0x2ddf9f,'raw':!![]});}})[_0x24a3('0x13')](function(_0x371ab4){_0x2adc38['contact']=_0x371ab4;if(_0x371ab4){var _0x236147={'ContactId':_0x371ab4['id'],'FaxAccountId':_0x5c8e24[_0x24a3('0x3b')]['id'],'fax':_0x371ab4[_0x24a3('0x27')]};return db['FaxInteraction'][_0x24a3('0x3a')]({'where':{'ContactId':_0x371ab4['id'],'closed':![],'FaxAccountId':_0x5c8e24[_0x24a3('0x3b')]['id']}})[_0x24a3('0x13')](function(_0x209b05){if(_0x209b05){return[_0x209b05,![]];}return db[_0x24a3('0x49')][_0x24a3('0x4a')](_0x236147)[_0x24a3('0x13')](function(_0x4668cf){return[_0x4668cf,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x24a3('0x4b')](function(_0xdc7bd4,_0x2af038){var _0x54d0ab=_0xdc7bd4[_0x24a3('0x40')]({'plain':!![]});if(_0x2af038){if(_0x2adc38[_0x24a3('0x3b')][_0x24a3('0x4c')]){_0x2adc38['applications'][_0x24a3('0x4d')]({'id':0x0,'priority':_0x2adc38[_0x24a3('0x42')][_0x24a3('0x47')]+0x1,'app':'close','appdata':_0x24a3('0x4e'),'interval':_0x24a3('0x4f')});}_0x54d0ab[_0x24a3('0x50')]=!![];}else{_0x54d0ab[_0x24a3('0x50')]=![];}_0x2adc38[_0x24a3('0x51')]=_0x54d0ab;return db[_0x24a3('0x52')][_0x24a3('0x4a')]({'body':_0x5c8e24['body'][_0x24a3('0x31')],'FaxAccountId':_0x5c8e24[_0x24a3('0x3b')]['id'],'FaxInteractionId':_0xdc7bd4['id'],'direction':'in','ContactId':_0xdc7bd4[_0x24a3('0x53')],'AttachmentId':_0x5c8e24[_0x24a3('0x31')][_0x24a3('0x54')]});})['then'](function(_0x3a1492){_0x2adc38[_0x24a3('0x1a')]=_0x3a1492;if(_0x2adc38[_0x24a3('0x51')][_0x24a3('0x55')]){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x2adc38[_0x24a3('0x51')]['UserId']}})[_0x24a3('0x13')](function(_0x49d25f){if(_0x49d25f){_0x2adc38[_0x24a3('0x42')][_0x24a3('0x56')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x49d25f[_0x24a3('0x57')]+','+(_0x2adc38[_0x24a3('0x3b')][_0x24a3('0x58')]||0xa),'interval':_0x24a3('0x4f')});}return respondWithRpcPromise(_0x24a3('0x59'),'startRouting',_0x2adc38);});}return respondWithRpcPromise(_0x24a3('0x59'),_0x24a3('0x5a'),_0x2adc38);})[_0x24a3('0x13')](function(_0x10c896){_0x5875f7(_0x10c896);})['catch'](function(_0x46dcda){_0x51c401(_0x5583a6[_0x24a3('0x18')](0x1f4,_0x46dcda[_0x24a3('0x1a')]));});});}; \ No newline at end of file +var _0xb5d7=['stringify','error','code','message','result','findAll','options','raw','where','attributes','limit','include','map','model','GetFaxAccount','NotifyFaxAccount','body','fax','CmContact','Sequelize','no\x20available\x20attributes','difference','keys','updatedAt','createdAt','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','find','account','CmList','Contacts','FaxApplication','Applications','List','get','applications','list','orderBy','priority','asc','length','ListId','create','FaxInteraction','spread','unmanaged','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','interaction','UserId','User','name','unshift','Start','startRouting','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s'];(function(_0x4b4d43,_0x1590f7){var _0x5706ba=function(_0x11d99b){while(--_0x11d99b){_0x4b4d43['push'](_0x4b4d43['shift']());}};_0x5706ba(++_0x1590f7);}(_0xb5d7,0xf5));var _0x7b5d=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xb5d7[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x7b5d('0x0'));var util=require(_0x7b5d('0x1'));var moment=require('moment');var BPromise=require(_0x7b5d('0x2'));var rs=require(_0x7b5d('0x3'));var fs=require('fs');var Redis=require(_0x7b5d('0x4'));var db=require(_0x7b5d('0x5'))['db'];var utils=require(_0x7b5d('0x6'));var logger=require(_0x7b5d('0x7'))(_0x7b5d('0x8'));var config=require(_0x7b5d('0x9'));var jayson=require(_0x7b5d('0xa'));var client=jayson[_0x7b5d('0xb')][_0x7b5d('0xc')]({'port':0x232c});config['redis']=_[_0x7b5d('0xd')](config[_0x7b5d('0xe')],{'host':_0x7b5d('0xf'),'port':0x18eb});var socket=require(_0x7b5d('0x10'))(new Redis(config[_0x7b5d('0xe')]));require(_0x7b5d('0x11'))[_0x7b5d('0x12')](socket);function respondWithRpcPromise(_0x2d073e,_0x37bc66,_0xddb302){return new BPromise(function(_0x12302d,_0x3a5572){return client['request'](_0x2d073e,_0xddb302)[_0x7b5d('0x13')](function(_0x191dc8){logger[_0x7b5d('0x14')](_0x7b5d('0x15'),_0x37bc66,_0x7b5d('0x16'));logger[_0x7b5d('0x17')](_0x7b5d('0x18'),_0x37bc66,_0x7b5d('0x16'),JSON[_0x7b5d('0x19')](_0x191dc8));if(_0x191dc8[_0x7b5d('0x1a')]){if(_0x191dc8[_0x7b5d('0x1a')][_0x7b5d('0x1b')]===0x1f4){logger[_0x7b5d('0x1a')](_0x7b5d('0x15'),_0x37bc66,_0x191dc8['error'][_0x7b5d('0x1c')]);return _0x3a5572(_0x191dc8['error'][_0x7b5d('0x1c')]);}logger[_0x7b5d('0x1a')]('FaxAccount,\x20%s,\x20%s',_0x37bc66,_0x191dc8['error'][_0x7b5d('0x1c')]);return _0x12302d(_0x191dc8[_0x7b5d('0x1a')]['message']);}else{logger[_0x7b5d('0x14')](_0x7b5d('0x15'),_0x37bc66,_0x7b5d('0x16'));_0x12302d(_0x191dc8[_0x7b5d('0x1d')][_0x7b5d('0x1c')]);}})['catch'](function(_0x164b90){logger[_0x7b5d('0x1a')](_0x7b5d('0x15'),_0x37bc66,_0x164b90);_0x3a5572(_0x164b90);});});}exports['GetFaxAccount']=function(_0x5bdbc8){var _0x55213f=this;return new Promise(function(_0x97305e,_0x5d5a27){return db['FaxAccount'][_0x7b5d('0x1e')]({'raw':_0x5bdbc8[_0x7b5d('0x1f')]?_0x5bdbc8['options'][_0x7b5d('0x20')]===undefined?!![]:![]:!![],'where':_0x5bdbc8['options']?_0x5bdbc8['options'][_0x7b5d('0x21')]||null:null,'attributes':_0x5bdbc8[_0x7b5d('0x1f')]?_0x5bdbc8['options'][_0x7b5d('0x22')]||null:null,'limit':_0x5bdbc8[_0x7b5d('0x1f')]?_0x5bdbc8[_0x7b5d('0x1f')][_0x7b5d('0x23')]||null:null,'include':_0x5bdbc8[_0x7b5d('0x1f')]?_0x5bdbc8[_0x7b5d('0x1f')][_0x7b5d('0x24')]?_[_0x7b5d('0x25')](_0x5bdbc8[_0x7b5d('0x1f')]['include'],function(_0x300306){return{'model':db[_0x300306[_0x7b5d('0x26')]],'as':_0x300306['as'],'attributes':_0x300306[_0x7b5d('0x22')],'include':_0x300306[_0x7b5d('0x24')]?_[_0x7b5d('0x25')](_0x300306[_0x7b5d('0x24')],function(_0x191dcd){return{'model':db[_0x191dcd[_0x7b5d('0x26')]],'as':_0x191dcd['as'],'attributes':_0x191dcd[_0x7b5d('0x22')],'include':_0x191dcd[_0x7b5d('0x24')]?_['map'](_0x191dcd[_0x7b5d('0x24')],function(_0x57cab8){return{'model':db[_0x57cab8[_0x7b5d('0x26')]],'as':_0x57cab8['as'],'attributes':_0x57cab8[_0x7b5d('0x22')]};}):[]};}):[]};}):[]:[]})[_0x7b5d('0x13')](function(_0x5e0459){logger['info'](_0x7b5d('0x27'),_0x5bdbc8);logger['debug'](_0x7b5d('0x27'),_0x5bdbc8,JSON[_0x7b5d('0x19')](_0x5e0459));_0x97305e(_0x5e0459);})['catch'](function(_0x9de730){logger[_0x7b5d('0x1a')](_0x7b5d('0x27'),_0x9de730[_0x7b5d('0x1c')],_0x5bdbc8);_0x5d5a27(_0x55213f[_0x7b5d('0x1a')](0x1f4,_0x9de730[_0x7b5d('0x1c')]));});});};exports[_0x7b5d('0x28')]=function(_0x7fdc5e,_0x5b0b5e,_0x15b35b){var _0x5699a3=this;return new Promise(function(_0x78584b,_0x3be2eb){var _0x1a2b65={'body':_0x7fdc5e[_0x7b5d('0x29')],'channel':_0x7b5d('0x2a')};var _0x3aa3d2=[];var _0xe9fd53=[];var _0x1a13fd={};return db[_0x7b5d('0x2b')]['describe']()['then'](function(_0x129454){if(!_0x129454){throw new db[(_0x7b5d('0x2c'))]['ValidationError'](_0x7b5d('0x2d'));}_0x3aa3d2=_[_0x7b5d('0x2e')](_[_0x7b5d('0x2f')](_0x129454),['createdAt',_0x7b5d('0x30')]);_0xe9fd53=_[_0x7b5d('0x2e')](_[_0x7b5d('0x2f')](_0x129454),[_0x7b5d('0x31'),_0x7b5d('0x30'),'CompanyId','ListId']);if(_0x7fdc5e['body']['id']){delete _0x7fdc5e[_0x7b5d('0x29')]['id'];}if(_[_0x7b5d('0x32')](_0x7fdc5e[_0x7b5d('0x29')][_0x7b5d('0x33')])){throw new db[(_0x7b5d('0x2c'))][(_0x7b5d('0x34'))](_0x7b5d('0x35'));}if(_[_0x7b5d('0x32')](_0x7fdc5e[_0x7b5d('0x29')][_0x7b5d('0x29')])||_0x7fdc5e['body'][_0x7b5d('0x29')]===''){throw new db[(_0x7b5d('0x2c'))][(_0x7b5d('0x34'))](_0x7b5d('0x36'));}if(_[_0x7b5d('0x32')](_0x7fdc5e[_0x7b5d('0x29')]['mapKey'])){throw new db[(_0x7b5d('0x2c'))][(_0x7b5d('0x34'))](_0x7b5d('0x37')+_0xe9fd53);}if(!_[_0x7b5d('0x38')](_0xe9fd53,_0x7fdc5e[_0x7b5d('0x29')][_0x7b5d('0x39')])){throw new db[(_0x7b5d('0x2c'))][(_0x7b5d('0x34'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xe9fd53);}_0x1a13fd[_0x7fdc5e[_0x7b5d('0x29')]['mapKey']]=_0x7fdc5e['body'][_0x7b5d('0x33')];})[_0x7b5d('0x13')](function(){return db['FaxAccount'][_0x7b5d('0x3a')]({'where':{'id':_0x7fdc5e[_0x7b5d('0x3b')]['id']},'include':[{'model':db[_0x7b5d('0x3c')],'as':'List','include':[{'model':db[_0x7b5d('0x2b')],'as':_0x7b5d('0x3d'),'where':_0x1a13fd,'limit':0x1,'order':[[_0x7b5d('0x30'),'DESC']]}]},{'model':db[_0x7b5d('0x3e')],'as':_0x7b5d('0x3f')}]});})[_0x7b5d('0x13')](function(_0x1e9b25){if(_0x1e9b25&&_0x1e9b25[_0x7b5d('0x40')]){var _0x16155f=_0x1e9b25[_0x7b5d('0x41')]({'plain':!![]});_0x1a2b65['account']=_0x16155f;_0x1a2b65[_0x7b5d('0x42')]=_0x16155f[_0x7b5d('0x3f')];_0x1a2b65[_0x7b5d('0x43')]=_0x16155f[_0x7b5d('0x40')];_0x1a2b65[_0x7b5d('0x42')]=_[_0x7b5d('0x44')](_0x1a2b65[_0x7b5d('0x42')],[_0x7b5d('0x45')],[_0x7b5d('0x46')]);if(_0x1a2b65[_0x7b5d('0x3b')]['Applications']){delete _0x1a2b65[_0x7b5d('0x3b')][_0x7b5d('0x3f')];}if(_0x1a2b65[_0x7b5d('0x3b')][_0x7b5d('0x40')]&&_0x1a2b65[_0x7b5d('0x3b')][_0x7b5d('0x40')][_0x7b5d('0x3d')][_0x7b5d('0x47')]){return _0x1a2b65[_0x7b5d('0x3b')][_0x7b5d('0x40')][_0x7b5d('0x3d')][0x0];}var _0x504214=_[_0x7b5d('0xd')](_0x7fdc5e[_0x7b5d('0x29')],{'firstName':_0x7fdc5e[_0x7b5d('0x29')][_0x7b5d('0x33')],'ListId':_0x16155f[_0x7b5d('0x48')]});_0x504214[_0x7fdc5e[_0x7b5d('0x29')][_0x7b5d('0x39')]]=_0x7fdc5e[_0x7b5d('0x29')]['from'];return db['CmContact'][_0x7b5d('0x49')](_0x504214,{'fields':_0x3aa3d2,'raw':!![]});}})[_0x7b5d('0x13')](function(_0x563a31){_0x1a2b65['contact']=_0x563a31;if(_0x563a31){var _0x342680={'ContactId':_0x563a31['id'],'FaxAccountId':_0x7fdc5e[_0x7b5d('0x3b')]['id'],'fax':_0x563a31[_0x7b5d('0x2a')]};return db['FaxInteraction'][_0x7b5d('0x3a')]({'where':{'ContactId':_0x563a31['id'],'closed':![],'FaxAccountId':_0x7fdc5e[_0x7b5d('0x3b')]['id']}})['then'](function(_0x2e1300){if(_0x2e1300){return[_0x2e1300,![]];}return db[_0x7b5d('0x4a')][_0x7b5d('0x49')](_0x342680)['then'](function(_0x197f91){return[_0x197f91,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x7b5d('0x4b')](function(_0xda7705,_0x2699ee){var _0x3807ff=_0xda7705[_0x7b5d('0x41')]({'plain':!![]});if(_0x2699ee){if(_0x1a2b65[_0x7b5d('0x3b')]['autoclose']){_0x1a2b65[_0x7b5d('0x42')]['push']({'id':0x0,'priority':_0x1a2b65[_0x7b5d('0x42')][_0x7b5d('0x47')]+0x1,'app':'close','appdata':_0x7b5d('0x4c'),'interval':_0x7b5d('0x4d')});}_0x3807ff[_0x7b5d('0x4e')]=!![];}else{_0x3807ff[_0x7b5d('0x4e')]=![];}_0x1a2b65['interaction']=_0x3807ff;return db[_0x7b5d('0x4f')][_0x7b5d('0x49')]({'body':_0x7fdc5e[_0x7b5d('0x29')]['body'],'FaxAccountId':_0x7fdc5e[_0x7b5d('0x3b')]['id'],'FaxInteractionId':_0xda7705['id'],'direction':'in','ContactId':_0xda7705[_0x7b5d('0x50')],'AttachmentId':_0x7fdc5e[_0x7b5d('0x29')][_0x7b5d('0x51')]});})[_0x7b5d('0x13')](function(_0x4787a1){_0x1a2b65[_0x7b5d('0x1c')]=_0x4787a1;if(_0x1a2b65[_0x7b5d('0x52')][_0x7b5d('0x53')]){return db[_0x7b5d('0x54')][_0x7b5d('0x3a')]({'attributes':['id',_0x7b5d('0x55')],'where':{'id':_0x1a2b65['interaction'][_0x7b5d('0x53')]}})[_0x7b5d('0x13')](function(_0x55c40c){if(_0x55c40c){_0x1a2b65[_0x7b5d('0x42')][_0x7b5d('0x56')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x55c40c[_0x7b5d('0x55')]+','+(_0x1a2b65[_0x7b5d('0x3b')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x7b5d('0x57'),_0x7b5d('0x58'),_0x1a2b65);});}return respondWithRpcPromise('Start',_0x7b5d('0x58'),_0x1a2b65);})['then'](function(_0xd0de66){_0x78584b(_0xd0de66);})[_0x7b5d('0x59')](function(_0x2de208){_0x3be2eb(_0x5699a3[_0x7b5d('0x1a')](0x1f4,_0x2de208[_0x7b5d('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index d684f23..372495b 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 _0x18ff=['emit','register','faxAccount:','./faxAccount.events','save','update'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x18ff,0xc3));var _0xf18f=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x18ff[_0x6c993a];return _0x27f547;};'use strict';var FaxAccountEvents=require(_0xf18f('0x0'));var events=[_0xf18f('0x1'),'remove',_0xf18f('0x2')];function createListener(_0x24111c,_0x5bdec3){return function(_0x595d96){_0x5bdec3[_0xf18f('0x3')](_0x24111c,_0x595d96);};}function removeListener(_0x471297,_0x510e6b){return function(){FaxAccountEvents['removeListener'](_0x471297,_0x510e6b);};}exports[_0xf18f('0x4')]=function(_0x537b68){for(var _0x208261=0x0,_0x2f8798=events['length'];_0x208261<_0x2f8798;_0x208261++){var _0x452d23=events[_0x208261];var _0x965cfc=createListener(_0xf18f('0x5')+_0x452d23,_0x537b68);FaxAccountEvents['on'](_0x452d23,_0x965cfc);}}; \ No newline at end of file +var _0xe730=['emit','register','length','faxAccount:','./faxAccount.events','save','remove','update'];(function(_0x554344,_0x27f258){var _0x1b642a=function(_0x234071){while(--_0x234071){_0x554344['push'](_0x554344['shift']());}};_0x1b642a(++_0x27f258);}(_0xe730,0x134));var _0x0e73=function(_0x3ddb4e,_0x5d9ecf){_0x3ddb4e=_0x3ddb4e-0x0;var _0x16202e=_0xe730[_0x3ddb4e];return _0x16202e;};'use strict';var FaxAccountEvents=require(_0x0e73('0x0'));var events=[_0x0e73('0x1'),_0x0e73('0x2'),_0x0e73('0x3')];function createListener(_0x4858c7,_0x304dfc){return function(_0x1c73bf){_0x304dfc[_0x0e73('0x4')](_0x4858c7,_0x1c73bf);};}function removeListener(_0x6b0dac,_0x3416b3){return function(){FaxAccountEvents['removeListener'](_0x6b0dac,_0x3416b3);};}exports[_0x0e73('0x5')]=function(_0x2ec686){for(var _0x377eec=0x0,_0x4b236f=events[_0x0e73('0x6')];_0x377eec<_0x4b236f;_0x377eec++){var _0x626d15=events[_0x377eec];var _0x5262a0=createListener(_0x0e73('0x7')+_0x626d15,_0x2ec686);FaxAccountEvents['on'](_0x626d15,_0x5262a0);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 5f1913b..17ad200 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(_0x5e6e15,_0x1cdfcf){var _0x2e8e41=function(_0x3ed20e){while(--_0x3ed20e){_0x5e6e15['push'](_0x5e6e15['shift']());}};_0x2e8e41(++_0x1cdfcf);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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(_0x186bb0,_0x330eb0){var _0x5c9c52=function(_0x5d0bd5){while(--_0x5d0bd5){_0x186bb0['push'](_0x186bb0['shift']());}};_0x5c9c52(++_0x330eb0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 9dbea40..ece629b 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 _0xabd2=['*,*,*,*','exports','STRING','noop','TEXT'];(function(_0x46d0f8,_0x4d9a42){var _0x1becc3=function(_0x4d6978){while(--_0x4d6978){_0x46d0f8['push'](_0x46d0f8['shift']());}};_0x1becc3(++_0x4d9a42);}(_0xabd2,0x1c8));var _0x2abd=function(_0x468661,_0x24adb6){_0x468661=_0x468661-0x0;var _0x2803fb=_0xabd2[_0x468661];return _0x2803fb;};'use strict';var Sequelize=require('sequelize');module[_0x2abd('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x2abd('0x1')],'allowNull':![],'defaultValue':_0x2abd('0x2')},'appdata':{'type':Sequelize[_0x2abd('0x3')]()},'description':{'type':Sequelize[_0x2abd('0x1')]},'interval':{'type':Sequelize[_0x2abd('0x1')],'defaultValue':_0x2abd('0x4')}}; \ No newline at end of file +var _0x8c80=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x5c6819,_0x38bcb4){var _0x486436=function(_0x2b812a){while(--_0x2b812a){_0x5c6819['push'](_0x5c6819['shift']());}};_0x486436(++_0x38bcb4);}(_0x8c80,0xc9));var _0x08c8=function(_0x38af48,_0x400460){_0x38af48=_0x38af48-0x0;var _0x445384=_0x8c80[_0x38af48];return _0x445384;};'use strict';var Sequelize=require('sequelize');module[_0x08c8('0x0')]={'priority':{'type':Sequelize[_0x08c8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x08c8('0x2')],'allowNull':![],'defaultValue':_0x08c8('0x3')},'appdata':{'type':Sequelize[_0x08c8('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x08c8('0x2')],'defaultValue':_0x08c8('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 4fe16d4..db9f259 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 _0x4ded=['update','then','destroy','end','error','name','send','index','rawAttributes','fieldName','map','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','filters','filter','where','type','VIRTUAL','FaxApplication','findAll','rows','catch','show','params','length','includeAll','include','merge','options','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x2c0d22,_0x5997b3){var _0x464fe3=function(_0x1377b9){while(--_0x1377b9){_0x2c0d22['push'](_0x2c0d22['shift']());}};_0x464fe3(++_0x5997b3);}(_0x4ded,0x1a7));var _0xd4de=function(_0x55a3be,_0x5c9b15){_0x55a3be=_0x55a3be-0x0;var _0x10af84=_0x4ded[_0x55a3be];return _0x10af84;};'use strict';var emlformat=require(_0xd4de('0x0'));var rimraf=require(_0xd4de('0x1'));var zipdir=require(_0xd4de('0x2'));var jsonpatch=require(_0xd4de('0x3'));var rp=require(_0xd4de('0x4'));var moment=require(_0xd4de('0x5'));var BPromise=require(_0xd4de('0x6'));var Mustache=require(_0xd4de('0x7'));var util=require(_0xd4de('0x8'));var path=require('path');var sox=require(_0xd4de('0x9'));var csv=require(_0xd4de('0xa'));var ejs=require(_0xd4de('0xb'));var fs=require('fs');var fs_extra=require(_0xd4de('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd4de('0xd'));var jsforce=require(_0xd4de('0xe'));var deskjs=require(_0xd4de('0xf'));var toCsv=require(_0xd4de('0xa'));var querystring=require(_0xd4de('0x10'));var Papa=require(_0xd4de('0x11'));var Redis=require(_0xd4de('0x12'));var authService=require(_0xd4de('0x13'));var qs=require(_0xd4de('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd4de('0x15'));var logger=require(_0xd4de('0x16'))('api');var utils=require(_0xd4de('0x17'));var config=require(_0xd4de('0x18'));var licenseUtil=require(_0xd4de('0x19'));var db=require(_0xd4de('0x1a'))['db'];function respondWithStatusCode(_0x30b090,_0x257db7){_0x257db7=_0x257db7||0xcc;return function(_0x55781c){if(_0x55781c){return _0x30b090[_0xd4de('0x1b')](_0x257db7);}return _0x30b090[_0xd4de('0x1c')](_0x257db7)['end']();};}function respondWithResult(_0xffc313,_0x19fb04){_0x19fb04=_0x19fb04||0xc8;return function(_0x5710bf){if(_0x5710bf){return _0xffc313[_0xd4de('0x1c')](_0x19fb04)[_0xd4de('0x1d')](_0x5710bf);}};}function respondWithFilteredResult(_0x2516a9,_0x3b7301){return function(_0x517597){if(_0x517597){var _0x28a0a8=typeof _0x3b7301[_0xd4de('0x1e')]===_0xd4de('0x1f')&&typeof _0x3b7301[_0xd4de('0x20')]===_0xd4de('0x1f');var _0x232fa3=_0x517597[_0xd4de('0x21')];var _0x581665=_0x28a0a8?0x0:_0x3b7301[_0xd4de('0x1e')];var _0x44367c=_0x28a0a8?_0x517597[_0xd4de('0x21')]:_0x3b7301[_0xd4de('0x1e')]+_0x3b7301[_0xd4de('0x20')];var _0x4cf6df;if(_0x44367c>=_0x232fa3){_0x44367c=_0x232fa3;_0x4cf6df=0xc8;}else{_0x4cf6df=0xce;}_0x2516a9[_0xd4de('0x1c')](_0x4cf6df);return _0x2516a9[_0xd4de('0x22')](_0xd4de('0x23'),_0x581665+'-'+_0x44367c+'/'+_0x232fa3)['json'](_0x517597);}return null;};}function patchUpdates(_0x2c60d2){return function(_0x3f6d53){try{jsonpatch[_0xd4de('0x24')](_0x3f6d53,_0x2c60d2,!![]);}catch(_0x5362d9){return BPromise[_0xd4de('0x25')](_0x5362d9);}return _0x3f6d53[_0xd4de('0x26')]();};}function saveUpdates(_0x4b276b,_0x48af50){return function(_0x19be9b){if(_0x19be9b){return _0x19be9b[_0xd4de('0x27')](_0x4b276b)[_0xd4de('0x28')](function(_0x1d4881){return _0x1d4881;});}return null;};}function removeEntity(_0x28fc39,_0x39376a){return function(_0x45f3b3){if(_0x45f3b3){return _0x45f3b3[_0xd4de('0x29')]()['then'](function(){_0x28fc39[_0xd4de('0x1c')](0xcc)[_0xd4de('0x2a')]();});}};}function handleEntityNotFound(_0x1303ba,_0x32b716){return function(_0x369c51){if(!_0x369c51){_0x1303ba['sendStatus'](0x194);}return _0x369c51;};}function handleError(_0x33766c,_0x4c6eb1){_0x4c6eb1=_0x4c6eb1||0x1f4;return function(_0x4a6c06){logger[_0xd4de('0x2b')](_0x4a6c06['stack']);if(_0x4a6c06[_0xd4de('0x2c')]){delete _0x4a6c06[_0xd4de('0x2c')];}_0x33766c['status'](_0x4c6eb1)[_0xd4de('0x2d')](_0x4a6c06);};}exports[_0xd4de('0x2e')]=function(_0x1743a8,_0x19276e){var _0x18ecfa={},_0x20fbb9={},_0x4714c2={'count':0x0,'rows':[]};var _0x3e0789=_['map'](db['FaxApplication'][_0xd4de('0x2f')],function(_0x523382){return{'name':_0x523382[_0xd4de('0x30')],'type':_0x523382['type']['key']};});_0x20fbb9['model']=_[_0xd4de('0x31')](_0x3e0789,'name');_0x20fbb9['query']=_['keys'](_0x1743a8[_0xd4de('0x32')]);_0x20fbb9['filters']=_[_0xd4de('0x33')](_0x20fbb9[_0xd4de('0x34')],_0x20fbb9[_0xd4de('0x32')]);_0x18ecfa[_0xd4de('0x35')]=_['intersection'](_0x20fbb9[_0xd4de('0x34')],qs[_0xd4de('0x36')](_0x1743a8[_0xd4de('0x32')][_0xd4de('0x36')]));_0x18ecfa[_0xd4de('0x35')]=_0x18ecfa[_0xd4de('0x35')]['length']?_0x18ecfa[_0xd4de('0x35')]:_0x20fbb9['model'];if(!_0x1743a8[_0xd4de('0x32')][_0xd4de('0x37')](_0xd4de('0x38'))){_0x18ecfa[_0xd4de('0x20')]=qs[_0xd4de('0x20')](_0x1743a8[_0xd4de('0x32')][_0xd4de('0x20')]);_0x18ecfa['offset']=qs[_0xd4de('0x1e')](_0x1743a8['query'][_0xd4de('0x1e')]);}_0x18ecfa['order']=qs[_0xd4de('0x39')](_0x1743a8[_0xd4de('0x32')][_0xd4de('0x39')]);_0x18ecfa['where']=qs[_0xd4de('0x3a')](_['pick'](_0x1743a8['query'],_0x20fbb9[_0xd4de('0x3a')]),_0x3e0789);if(_0x1743a8[_0xd4de('0x32')][_0xd4de('0x3b')]){_0x18ecfa[_0xd4de('0x3c')]=_['merge'](_0x18ecfa['where'],{'$or':_[_0xd4de('0x31')](_0x3e0789,function(_0x49ba4b){if(_0x49ba4b[_0xd4de('0x3d')]!==_0xd4de('0x3e')){var _0x3ee761={};_0x3ee761[_0x49ba4b[_0xd4de('0x2c')]]={'$like':'%'+_0x1743a8['query'][_0xd4de('0x3b')]+'%'};return _0x3ee761;}})});}_0x18ecfa=_['merge']({},_0x18ecfa,_0x1743a8['options']);var _0x4c8f40={'where':_0x18ecfa[_0xd4de('0x3c')]};return db[_0xd4de('0x3f')]['count'](_0x4c8f40)[_0xd4de('0x28')](function(_0x25a4e0){_0x4714c2[_0xd4de('0x21')]=_0x25a4e0;if(_0x1743a8[_0xd4de('0x32')]['includeAll']){_0x18ecfa['include']=[{'all':!![]}];}return db[_0xd4de('0x3f')][_0xd4de('0x40')](_0x18ecfa);})[_0xd4de('0x28')](function(_0x2bc072){_0x4714c2[_0xd4de('0x41')]=_0x2bc072;return _0x4714c2;})[_0xd4de('0x28')](respondWithFilteredResult(_0x19276e,_0x18ecfa))[_0xd4de('0x42')](handleError(_0x19276e,null));};exports[_0xd4de('0x43')]=function(_0x28106b,_0x55f2eb){var _0x448c82={'raw':!![],'where':{'id':_0x28106b[_0xd4de('0x44')]['id']}},_0x567905={};_0x567905[_0xd4de('0x34')]=_['keys'](db[_0xd4de('0x3f')][_0xd4de('0x2f')]);_0x567905['query']=_['keys'](_0x28106b[_0xd4de('0x32')]);_0x567905['filters']=_[_0xd4de('0x33')](_0x567905[_0xd4de('0x34')],_0x567905[_0xd4de('0x32')]);_0x448c82['attributes']=_['intersection'](_0x567905[_0xd4de('0x34')],qs[_0xd4de('0x36')](_0x28106b[_0xd4de('0x32')][_0xd4de('0x36')]));_0x448c82[_0xd4de('0x35')]=_0x448c82[_0xd4de('0x35')][_0xd4de('0x45')]?_0x448c82['attributes']:_0x567905[_0xd4de('0x34')];if(_0x28106b['query'][_0xd4de('0x46')]){_0x448c82[_0xd4de('0x47')]=[{'all':!![]}];}_0x448c82=_[_0xd4de('0x48')]({},_0x448c82,_0x28106b[_0xd4de('0x49')]);return db[_0xd4de('0x3f')]['find'](_0x448c82)[_0xd4de('0x28')](handleEntityNotFound(_0x55f2eb,null))[_0xd4de('0x28')](respondWithResult(_0x55f2eb,null))[_0xd4de('0x42')](handleError(_0x55f2eb,null));};exports['create']=function(_0x3d3db7,_0x493cf3){return db['FaxApplication'][_0xd4de('0x4a')](_0x3d3db7[_0xd4de('0x4b')],{})[_0xd4de('0x28')](respondWithResult(_0x493cf3,0xc9))['catch'](handleError(_0x493cf3,null));};exports[_0xd4de('0x27')]=function(_0x2b28ce,_0x3ab797){if(_0x2b28ce[_0xd4de('0x4b')]['id']){delete _0x2b28ce[_0xd4de('0x4b')]['id'];}return db[_0xd4de('0x3f')][_0xd4de('0x4c')]({'where':{'id':_0x2b28ce[_0xd4de('0x44')]['id']}})[_0xd4de('0x28')](handleEntityNotFound(_0x3ab797,null))[_0xd4de('0x28')](saveUpdates(_0x2b28ce[_0xd4de('0x4b')],null))['then'](respondWithResult(_0x3ab797,null))['catch'](handleError(_0x3ab797,null));};exports[_0xd4de('0x29')]=function(_0xb111d4,_0x32fc3d){return db[_0xd4de('0x3f')][_0xd4de('0x4c')]({'where':{'id':_0xb111d4['params']['id']}})[_0xd4de('0x28')](handleEntityNotFound(_0x32fc3d,null))['then'](removeEntity(_0x32fc3d,null))['catch'](handleError(_0x32fc3d,null));}; \ No newline at end of file +var _0x28a3=['merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','catch','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','save','then','destroy','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x28a3,0x13f));var _0x328a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x28a3[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require(_0x328a('0x0'));var rimraf=require(_0x328a('0x1'));var zipdir=require(_0x328a('0x2'));var jsonpatch=require(_0x328a('0x3'));var rp=require(_0x328a('0x4'));var moment=require(_0x328a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x328a('0x6'));var path=require(_0x328a('0x7'));var sox=require('sox');var csv=require(_0x328a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x328a('0x9'));var _=require(_0x328a('0xa'));var squel=require('squel');var crypto=require(_0x328a('0xb'));var jsforce=require(_0x328a('0xc'));var deskjs=require(_0x328a('0xd'));var toCsv=require(_0x328a('0x8'));var querystring=require(_0x328a('0xe'));var Papa=require(_0x328a('0xf'));var Redis=require(_0x328a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x328a('0x11'));var as=require(_0x328a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x328a('0x13'));var utils=require(_0x328a('0x14'));var config=require(_0x328a('0x15'));var licenseUtil=require(_0x328a('0x16'));var db=require(_0x328a('0x17'))['db'];function respondWithStatusCode(_0x3bbfe4,_0x587e93){_0x587e93=_0x587e93||0xcc;return function(_0x51012b){if(_0x51012b){return _0x3bbfe4[_0x328a('0x18')](_0x587e93);}return _0x3bbfe4[_0x328a('0x19')](_0x587e93)[_0x328a('0x1a')]();};}function respondWithResult(_0x3c9e34,_0x1f4134){_0x1f4134=_0x1f4134||0xc8;return function(_0x218574){if(_0x218574){return _0x3c9e34['status'](_0x1f4134)['json'](_0x218574);}};}function respondWithFilteredResult(_0x512a06,_0x4d8694){return function(_0x2fd373){if(_0x2fd373){var _0x29d5ee=typeof _0x4d8694[_0x328a('0x1b')]==='undefined'&&typeof _0x4d8694[_0x328a('0x1c')]===_0x328a('0x1d');var _0x3351d4=_0x2fd373[_0x328a('0x1e')];var _0x2e2fa5=_0x29d5ee?0x0:_0x4d8694[_0x328a('0x1b')];var _0x5be2d5=_0x29d5ee?_0x2fd373[_0x328a('0x1e')]:_0x4d8694[_0x328a('0x1b')]+_0x4d8694[_0x328a('0x1c')];var _0x7c6d81;if(_0x5be2d5>=_0x3351d4){_0x5be2d5=_0x3351d4;_0x7c6d81=0xc8;}else{_0x7c6d81=0xce;}_0x512a06[_0x328a('0x19')](_0x7c6d81);return _0x512a06['set'](_0x328a('0x1f'),_0x2e2fa5+'-'+_0x5be2d5+'/'+_0x3351d4)[_0x328a('0x20')](_0x2fd373);}return null;};}function patchUpdates(_0x312d4d){return function(_0x2d3d46){try{jsonpatch[_0x328a('0x21')](_0x2d3d46,_0x312d4d,!![]);}catch(_0xa416d8){return BPromise['reject'](_0xa416d8);}return _0x2d3d46[_0x328a('0x22')]();};}function saveUpdates(_0xca4193,_0x33c070){return function(_0x1a4e10){if(_0x1a4e10){return _0x1a4e10['update'](_0xca4193)[_0x328a('0x23')](function(_0xc4b09){return _0xc4b09;});}return null;};}function removeEntity(_0x5cb05f,_0x464187){return function(_0x59328f){if(_0x59328f){return _0x59328f[_0x328a('0x24')]()[_0x328a('0x23')](function(){_0x5cb05f[_0x328a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384b5b,_0x51499a){return function(_0x261d54){if(!_0x261d54){_0x384b5b['sendStatus'](0x194);}return _0x261d54;};}function handleError(_0x23898d,_0x52e337){_0x52e337=_0x52e337||0x1f4;return function(_0x2bf343){logger[_0x328a('0x25')](_0x2bf343[_0x328a('0x26')]);if(_0x2bf343[_0x328a('0x27')]){delete _0x2bf343[_0x328a('0x27')];}_0x23898d[_0x328a('0x19')](_0x52e337)[_0x328a('0x28')](_0x2bf343);};}exports[_0x328a('0x29')]=function(_0x31b8cb,_0x10adbb){var _0x4dab6d={},_0x16f14b={},_0x5be4b2={'count':0x0,'rows':[]};var _0x4d1465=_[_0x328a('0x2a')](db[_0x328a('0x2b')][_0x328a('0x2c')],function(_0x2e7c7f){return{'name':_0x2e7c7f[_0x328a('0x2d')],'type':_0x2e7c7f['type']['key']};});_0x16f14b[_0x328a('0x2e')]=_[_0x328a('0x2a')](_0x4d1465,'name');_0x16f14b['query']=_[_0x328a('0x2f')](_0x31b8cb[_0x328a('0x30')]);_0x16f14b[_0x328a('0x31')]=_['intersection'](_0x16f14b[_0x328a('0x2e')],_0x16f14b['query']);_0x4dab6d[_0x328a('0x32')]=_[_0x328a('0x33')](_0x16f14b[_0x328a('0x2e')],qs[_0x328a('0x34')](_0x31b8cb['query']['fields']));_0x4dab6d[_0x328a('0x32')]=_0x4dab6d['attributes'][_0x328a('0x35')]?_0x4dab6d['attributes']:_0x16f14b[_0x328a('0x2e')];if(!_0x31b8cb[_0x328a('0x30')][_0x328a('0x36')](_0x328a('0x37'))){_0x4dab6d[_0x328a('0x1c')]=qs[_0x328a('0x1c')](_0x31b8cb[_0x328a('0x30')][_0x328a('0x1c')]);_0x4dab6d[_0x328a('0x1b')]=qs[_0x328a('0x1b')](_0x31b8cb['query']['offset']);}_0x4dab6d[_0x328a('0x38')]=qs[_0x328a('0x39')](_0x31b8cb[_0x328a('0x30')][_0x328a('0x39')]);_0x4dab6d[_0x328a('0x3a')]=qs[_0x328a('0x31')](_[_0x328a('0x3b')](_0x31b8cb[_0x328a('0x30')],_0x16f14b[_0x328a('0x31')]),_0x4d1465);if(_0x31b8cb[_0x328a('0x30')][_0x328a('0x3c')]){_0x4dab6d[_0x328a('0x3a')]=_[_0x328a('0x3d')](_0x4dab6d[_0x328a('0x3a')],{'$or':_['map'](_0x4d1465,function(_0x166972){if(_0x166972[_0x328a('0x3e')]!==_0x328a('0x3f')){var _0x10781d={};_0x10781d[_0x166972[_0x328a('0x27')]]={'$like':'%'+_0x31b8cb[_0x328a('0x30')][_0x328a('0x3c')]+'%'};return _0x10781d;}})});}_0x4dab6d=_[_0x328a('0x3d')]({},_0x4dab6d,_0x31b8cb[_0x328a('0x40')]);var _0x37ee5a={'where':_0x4dab6d[_0x328a('0x3a')]};return db[_0x328a('0x2b')][_0x328a('0x1e')](_0x37ee5a)[_0x328a('0x23')](function(_0x15ee7f){_0x5be4b2[_0x328a('0x1e')]=_0x15ee7f;if(_0x31b8cb[_0x328a('0x30')][_0x328a('0x41')]){_0x4dab6d[_0x328a('0x42')]=[{'all':!![]}];}return db[_0x328a('0x2b')][_0x328a('0x43')](_0x4dab6d);})[_0x328a('0x23')](function(_0x4d824d){_0x5be4b2[_0x328a('0x44')]=_0x4d824d;return _0x5be4b2;})[_0x328a('0x23')](respondWithFilteredResult(_0x10adbb,_0x4dab6d))['catch'](handleError(_0x10adbb,null));};exports[_0x328a('0x45')]=function(_0x2cc04a,_0x1202a8){var _0x4a9b71={'raw':!![],'where':{'id':_0x2cc04a[_0x328a('0x46')]['id']}},_0x5e3066={};_0x5e3066[_0x328a('0x2e')]=_['keys'](db[_0x328a('0x2b')][_0x328a('0x2c')]);_0x5e3066[_0x328a('0x30')]=_[_0x328a('0x2f')](_0x2cc04a[_0x328a('0x30')]);_0x5e3066['filters']=_[_0x328a('0x33')](_0x5e3066[_0x328a('0x2e')],_0x5e3066[_0x328a('0x30')]);_0x4a9b71[_0x328a('0x32')]=_[_0x328a('0x33')](_0x5e3066[_0x328a('0x2e')],qs[_0x328a('0x34')](_0x2cc04a['query'][_0x328a('0x34')]));_0x4a9b71[_0x328a('0x32')]=_0x4a9b71[_0x328a('0x32')][_0x328a('0x35')]?_0x4a9b71[_0x328a('0x32')]:_0x5e3066[_0x328a('0x2e')];if(_0x2cc04a['query'][_0x328a('0x41')]){_0x4a9b71['include']=[{'all':!![]}];}_0x4a9b71=_[_0x328a('0x3d')]({},_0x4a9b71,_0x2cc04a[_0x328a('0x40')]);return db[_0x328a('0x2b')][_0x328a('0x47')](_0x4a9b71)[_0x328a('0x23')](handleEntityNotFound(_0x1202a8,null))[_0x328a('0x23')](respondWithResult(_0x1202a8,null))['catch'](handleError(_0x1202a8,null));};exports[_0x328a('0x48')]=function(_0x2b7b39,_0x1ed1cc){return db[_0x328a('0x2b')][_0x328a('0x48')](_0x2b7b39[_0x328a('0x49')],{})[_0x328a('0x23')](respondWithResult(_0x1ed1cc,0xc9))[_0x328a('0x4a')](handleError(_0x1ed1cc,null));};exports[_0x328a('0x4b')]=function(_0x5b384a,_0xa959e1){if(_0x5b384a[_0x328a('0x49')]['id']){delete _0x5b384a[_0x328a('0x49')]['id'];}return db[_0x328a('0x2b')][_0x328a('0x47')]({'where':{'id':_0x5b384a[_0x328a('0x46')]['id']}})[_0x328a('0x23')](handleEntityNotFound(_0xa959e1,null))[_0x328a('0x23')](saveUpdates(_0x5b384a[_0x328a('0x49')],null))[_0x328a('0x23')](respondWithResult(_0xa959e1,null))[_0x328a('0x4a')](handleError(_0xa959e1,null));};exports[_0x328a('0x24')]=function(_0x56c151,_0xe604f1){return db['FaxApplication'][_0x328a('0x47')]({'where':{'id':_0x56c151[_0x328a('0x46')]['id']}})[_0x328a('0x23')](handleEntityNotFound(_0xe604f1,null))[_0x328a('0x23')](removeEntity(_0xe604f1,null))[_0x328a('0x4a')](handleError(_0xe604f1,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 4429380..3f7eb3f 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 _0xa101=['moment','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','FaxApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x4e4863,_0x1bb974){var _0x262e47=function(_0xb8ab02){while(--_0xb8ab02){_0x4e4863['push'](_0x4e4863['shift']());}};_0x262e47(++_0x1bb974);}(_0xa101,0x14f));var _0x1a10=function(_0x545bed,_0x221e96){_0x545bed=_0x545bed-0x0;var _0x16c79c=_0xa101[_0x545bed];return _0x16c79c;};'use strict';var _=require(_0x1a10('0x0'));var util=require(_0x1a10('0x1'));var logger=require(_0x1a10('0x2'))('api');var moment=require(_0x1a10('0x3'));var BPromise=require('bluebird');var rp=require(_0x1a10('0x4'));var fs=require('fs');var path=require(_0x1a10('0x5'));var rimraf=require(_0x1a10('0x6'));var config=require(_0x1a10('0x7'));var attributes=require(_0x1a10('0x8'));module[_0x1a10('0x9')]=function(_0x8b8293,_0x254d89){return _0x8b8293['define'](_0x1a10('0xa'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1a10('0xb'),'collate':_0x1a10('0xc')});}; \ No newline at end of file +var _0x700c=['bluebird','path','exports','define','FaxApplication','fax_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x2f99bb,_0x26c580){var _0x1ec7fb=function(_0x55fc5c){while(--_0x55fc5c){_0x2f99bb['push'](_0x2f99bb['shift']());}};_0x1ec7fb(++_0x26c580);}(_0x700c,0xc7));var _0xc700=function(_0x34b62c,_0x443a65){_0x34b62c=_0x34b62c-0x0;var _0xae5a8d=_0x700c[_0x34b62c];return _0xae5a8d;};'use strict';var _=require(_0xc700('0x0'));var util=require(_0xc700('0x1'));var logger=require(_0xc700('0x2'))(_0xc700('0x3'));var moment=require(_0xc700('0x4'));var BPromise=require(_0xc700('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc700('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module[_0xc700('0x7')]=function(_0x47b90e,_0xb19064){return _0x47b90e[_0xc700('0x8')](_0xc700('0x9'),attributes,{'tableName':_0xc700('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc700('0xb')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 6b6663c..8dc1a52 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 _0xaa9d=['../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','stringify','error','FaxApplication,\x20%s,\x20%s','message','catch','UpdateFaxApplication','FaxApplication','update','options','raw','where','lodash','util','moment','bluebird','randomstring','rpc'];(function(_0x26d9c5,_0x57e918){var _0x560d97=function(_0x5473ab){while(--_0x5473ab){_0x26d9c5['push'](_0x26d9c5['shift']());}};_0x560d97(++_0x57e918);}(_0xaa9d,0x1aa));var _0xdaa9=function(_0x3bcc54,_0x253f3e){_0x3bcc54=_0x3bcc54-0x0;var _0x529ae3=_0xaa9d[_0x3bcc54];return _0x529ae3;};'use strict';var _=require(_0xdaa9('0x0'));var util=require(_0xdaa9('0x1'));var moment=require(_0xdaa9('0x2'));var BPromise=require(_0xdaa9('0x3'));var rs=require(_0xdaa9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdaa9('0x5'));var config=require(_0xdaa9('0x6'));var jayson=require(_0xdaa9('0x7'));var client=jayson[_0xdaa9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x548aee,_0x1a77bd,_0x389004){return new BPromise(function(_0x394817,_0x194c11){return client['request'](_0x548aee,_0x389004)[_0xdaa9('0x9')](function(_0x5317f8){logger[_0xdaa9('0xa')]('FaxApplication,\x20%s,\x20%s',_0x1a77bd,_0xdaa9('0xb'));logger[_0xdaa9('0xc')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x1a77bd,_0xdaa9('0xb'),JSON[_0xdaa9('0xd')](_0x5317f8));if(_0x5317f8[_0xdaa9('0xe')]){if(_0x5317f8[_0xdaa9('0xe')]['code']===0x1f4){logger['error'](_0xdaa9('0xf'),_0x1a77bd,_0x5317f8[_0xdaa9('0xe')][_0xdaa9('0x10')]);return _0x194c11(_0x5317f8[_0xdaa9('0xe')][_0xdaa9('0x10')]);}logger[_0xdaa9('0xe')](_0xdaa9('0xf'),_0x1a77bd,_0x5317f8[_0xdaa9('0xe')]['message']);return _0x394817(_0x5317f8['error'][_0xdaa9('0x10')]);}else{logger[_0xdaa9('0xa')](_0xdaa9('0xf'),_0x1a77bd,_0xdaa9('0xb'));_0x394817(_0x5317f8['result']['message']);}})[_0xdaa9('0x11')](function(_0x582447){logger['error']('FaxApplication,\x20%s,\x20%s',_0x1a77bd,_0x582447);_0x194c11(_0x582447);});});}exports[_0xdaa9('0x12')]=function(_0x4f7027){var _0x4a46a7=this;return new Promise(function(_0x271967,_0x59cfba){return db[_0xdaa9('0x13')][_0xdaa9('0x14')](_0x4f7027['body'],{'raw':_0x4f7027['options']?_0x4f7027[_0xdaa9('0x15')][_0xdaa9('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f7027[_0xdaa9('0x15')]?_0x4f7027[_0xdaa9('0x15')][_0xdaa9('0x17')]||null:null,'attributes':_0x4f7027[_0xdaa9('0x15')]?_0x4f7027[_0xdaa9('0x15')]['attributes']||null:null,'limit':_0x4f7027[_0xdaa9('0x15')]?_0x4f7027[_0xdaa9('0x15')]['limit']||null:null})[_0xdaa9('0x9')](function(_0x50281a){logger[_0xdaa9('0xa')](_0xdaa9('0x12'),_0x4f7027);logger[_0xdaa9('0xc')](_0xdaa9('0x12'),_0x4f7027,JSON['stringify'](_0x50281a));_0x271967(_0x50281a);})[_0xdaa9('0x11')](function(_0x412134){logger[_0xdaa9('0xe')](_0xdaa9('0x12'),_0x412134[_0xdaa9('0x10')],_0x4f7027);_0x59cfba(_0x4a46a7[_0xdaa9('0xe')](0x1f4,_0x412134[_0xdaa9('0x10')]));});});}; \ No newline at end of file +var _0x3d46=['FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxApplication','body','options','raw','where','attributes','limit','then','UpdateFaxApplication','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5cd83d,_0x48a557){var _0x3678db=function(_0x129957){while(--_0x129957){_0x5cd83d['push'](_0x5cd83d['shift']());}};_0x3678db(++_0x48a557);}(_0x3d46,0x170));var _0x63d4=function(_0x5b8032,_0x1ba6b4){_0x5b8032=_0x5b8032-0x0;var _0x3a4449=_0x3d46[_0x5b8032];return _0x3a4449;};'use strict';var _=require(_0x63d4('0x0'));var util=require(_0x63d4('0x1'));var moment=require(_0x63d4('0x2'));var BPromise=require(_0x63d4('0x3'));var rs=require(_0x63d4('0x4'));var fs=require('fs');var Redis=require(_0x63d4('0x5'));var db=require(_0x63d4('0x6'))['db'];var utils=require(_0x63d4('0x7'));var logger=require('../../config/logger')(_0x63d4('0x8'));var config=require('../../config/environment');var jayson=require(_0x63d4('0x9'));var client=jayson[_0x63d4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39c7f9,_0x167e0c,_0x168d19){return new BPromise(function(_0x3bc1b0,_0x492059){return client[_0x63d4('0xb')](_0x39c7f9,_0x168d19)['then'](function(_0x5eb571){logger[_0x63d4('0xc')](_0x63d4('0xd'),_0x167e0c,_0x63d4('0xe'));logger[_0x63d4('0xf')](_0x63d4('0x10'),_0x167e0c,'request\x20sent',JSON[_0x63d4('0x11')](_0x5eb571));if(_0x5eb571[_0x63d4('0x12')]){if(_0x5eb571[_0x63d4('0x12')][_0x63d4('0x13')]===0x1f4){logger['error'](_0x63d4('0xd'),_0x167e0c,_0x5eb571[_0x63d4('0x12')]['message']);return _0x492059(_0x5eb571['error'][_0x63d4('0x14')]);}logger[_0x63d4('0x12')](_0x63d4('0xd'),_0x167e0c,_0x5eb571[_0x63d4('0x12')][_0x63d4('0x14')]);return _0x3bc1b0(_0x5eb571[_0x63d4('0x12')][_0x63d4('0x14')]);}else{logger[_0x63d4('0xc')]('FaxApplication,\x20%s,\x20%s',_0x167e0c,'request\x20sent');_0x3bc1b0(_0x5eb571[_0x63d4('0x15')][_0x63d4('0x14')]);}})[_0x63d4('0x16')](function(_0xd8cec2){logger[_0x63d4('0x12')](_0x63d4('0xd'),_0x167e0c,_0xd8cec2);_0x492059(_0xd8cec2);});});}exports['UpdateFaxApplication']=function(_0xdfd0da){var _0x2e64dc=this;return new Promise(function(_0x258999,_0x434e0c){return db[_0x63d4('0x17')]['update'](_0xdfd0da[_0x63d4('0x18')],{'raw':_0xdfd0da[_0x63d4('0x19')]?_0xdfd0da[_0x63d4('0x19')][_0x63d4('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdfd0da[_0x63d4('0x19')]?_0xdfd0da[_0x63d4('0x19')][_0x63d4('0x1b')]||null:null,'attributes':_0xdfd0da[_0x63d4('0x19')]?_0xdfd0da['options'][_0x63d4('0x1c')]||null:null,'limit':_0xdfd0da[_0x63d4('0x19')]?_0xdfd0da['options'][_0x63d4('0x1d')]||null:null})[_0x63d4('0x1e')](function(_0x4d43c1){logger['info'](_0x63d4('0x1f'),_0xdfd0da);logger[_0x63d4('0xf')](_0x63d4('0x1f'),_0xdfd0da,JSON[_0x63d4('0x11')](_0x4d43c1));_0x258999(_0x4d43c1);})[_0x63d4('0x16')](function(_0x278c95){logger['error']('UpdateFaxApplication',_0x278c95[_0x63d4('0x14')],_0xdfd0da);_0x434e0c(_0x2e64dc[_0x63d4('0x12')](0x1f4,_0x278c95['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 4c2ae46..41ac9d4 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 _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x3873bf,_0x1d1a56){var _0x4e66cd=function(_0x2eb0c9){while(--_0x2eb0c9){_0x3873bf['push'](_0x3873bf['shift']());}};_0x4e66cd(++_0x1d1a56);}(_0x2032,0xd9));var _0x2203=function(_0x2b7112,_0x386b30){_0x2b7112=_0x2b7112-0x0;var _0x57f3b7=_0x2032[_0x2b7112];return _0x57f3b7;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2203('0xe')]('/:id',auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router[_0x2203('0x10')]('/:id',auth[_0x2203('0x9')](),controller['destroy']);module[_0x2203('0x11')]=router; \ No newline at end of file +var _0x34b7=['express','Router','fs-extra','../../components/auth/service','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','exports','path','connect-timeout'];(function(_0x30d98c,_0x4687b2){var _0x30f540=function(_0x46be4c){while(--_0x46be4c){_0x30d98c['push'](_0x30d98c['shift']());}};_0x30f540(++_0x4687b2);}(_0x34b7,0x196));var _0x734b=function(_0x475e33,_0x42824a){_0x475e33=_0x475e33-0x0;var _0x318871=_0x34b7[_0x475e33];return _0x318871;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x734b('0x0'));var timeout=require(_0x734b('0x1'));var express=require(_0x734b('0x2'));var router=express[_0x734b('0x3')]();var fs_extra=require(_0x734b('0x4'));var auth=require(_0x734b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x734b('0x6'));router[_0x734b('0x7')]('/',auth[_0x734b('0x8')](),controller[_0x734b('0x9')]);router[_0x734b('0x7')](_0x734b('0xa'),auth['isAuthenticated'](),controller[_0x734b('0xb')]);router[_0x734b('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x734b('0xa'),auth['isAuthenticated'](),controller[_0x734b('0xd')]);router[_0x734b('0xe')](_0x734b('0xa'),auth[_0x734b('0x8')](),controller[_0x734b('0xf')]);module[_0x734b('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 2d1ec2e..b3b5718 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 _0x84c0=['ENUM','sequelize','DATE','STRING'];(function(_0x7f0930,_0x4d3097){var _0x5286ce=function(_0x28823e){while(--_0x28823e){_0x7f0930['push'](_0x7f0930['shift']());}};_0x5286ce(++_0x4d3097);}(_0x84c0,0x121));var _0x084c=function(_0x483bad,_0x4aeb5f){_0x483bad=_0x483bad-0x0;var _0x37c2b8=_0x84c0[_0x483bad];return _0x37c2b8;};'use strict';var Sequelize=require(_0x084c('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x084c('0x1')]},'disposition':{'type':Sequelize[_0x084c('0x2')]},'secondDisposition':{'type':Sequelize[_0x084c('0x2')]},'thirdDisposition':{'type':Sequelize[_0x084c('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x084c('0x1')]},'fax':{'type':Sequelize[_0x084c('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x084c('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x084c('0x1')]},'lastMsgDirection':{'type':Sequelize[_0x084c('0x3')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x4171=['ENUM','out','BOOLEAN','STRING','DATE'];(function(_0x202ee2,_0x3963ba){var _0x29a801=function(_0x84eed7){while(--_0x84eed7){_0x202ee2['push'](_0x202ee2['shift']());}};_0x29a801(++_0x3963ba);}(_0x4171,0xcf));var _0x1417=function(_0x8518ee,_0x441ea8){_0x8518ee=_0x8518ee-0x0;var _0x5c4322=_0x4171[_0x8518ee];return _0x5c4322;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x1417('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x1417('0x1')]},'secondDisposition':{'type':Sequelize[_0x1417('0x1')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x1417('0x1')]},'read1stAt':{'type':Sequelize[_0x1417('0x2')]},'fax':{'type':Sequelize[_0x1417('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x1417('0x3')]('in',_0x1417('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x1417('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 1055d0c..3c223b7 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 _0x906b=['text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','body','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','fields','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','contactName','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','params','options','describe','addMessage','FaxMessage','omit','ids','merge','$gte','format','includeAll','include','rows','addTags','setTags','spread','findAll','faxInteractionTags:save','removeTags','download','join','root','server','files','tmp','transcript-%d-%s.zip','Attachment','Messages','mkdirSync','basename','existsSync','createReadStream','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','Users','fullname','TagIds','split','forEach','push','catch','map','FaxInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','length','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression'];(function(_0x1f4b18,_0x4e777c){var _0xde3957=function(_0x1dcbbc){while(--_0x1dcbbc){_0x1f4b18['push'](_0x1f4b18['shift']());}};_0xde3957(++_0x4e777c);}(_0x906b,0x134));var _0xb906=function(_0x4c05da,_0x414720){_0x4c05da=_0x4c05da-0x0;var _0x1614db=_0x906b[_0x4c05da];return _0x1614db;};'use strict';var emlformat=require(_0xb906('0x0'));var rimraf=require(_0xb906('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb906('0x2'));var rp=require(_0xb906('0x3'));var moment=require(_0xb906('0x4'));var BPromise=require(_0xb906('0x5'));var Mustache=require(_0xb906('0x6'));var util=require(_0xb906('0x7'));var path=require('path');var sox=require(_0xb906('0x8'));var csv=require(_0xb906('0x9'));var ejs=require(_0xb906('0xa'));var fs=require('fs');var fs_extra=require(_0xb906('0xb'));var _=require(_0xb906('0xc'));var squel=require(_0xb906('0xd'));var crypto=require('crypto');var jsforce=require(_0xb906('0xe'));var deskjs=require(_0xb906('0xf'));var toCsv=require(_0xb906('0x9'));var querystring=require('querystring');var Papa=require(_0xb906('0x10'));var Redis=require(_0xb906('0x11'));var authService=require(_0xb906('0x12'));var qs=require(_0xb906('0x13'));var as=require(_0xb906('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb906('0x15'))(_0xb906('0x16'));var utils=require(_0xb906('0x17'));var config=require(_0xb906('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xb906('0x19')]=_[_0xb906('0x1a')](config[_0xb906('0x19')],{'host':_0xb906('0x1b'),'port':0x18eb});var socket=require(_0xb906('0x1c'))(new Redis(config['redis']));require(_0xb906('0x1d'))[_0xb906('0x1e')](socket);function respondWithStatusCode(_0x1af8e4,_0x4e47ef){_0x4e47ef=_0x4e47ef||0xcc;return function(_0x3168e0){if(_0x3168e0){return _0x1af8e4[_0xb906('0x1f')](_0x4e47ef);}return _0x1af8e4[_0xb906('0x20')](_0x4e47ef)[_0xb906('0x21')]();};}function respondWithResult(_0x4254dd,_0x8f62e){_0x8f62e=_0x8f62e||0xc8;return function(_0x1d6ecf){if(_0x1d6ecf){return _0x4254dd[_0xb906('0x20')](_0x8f62e)[_0xb906('0x22')](_0x1d6ecf);}};}function respondWithFilteredResult(_0x406137,_0xd2b373){return function(_0x2863c5){if(_0x2863c5){var _0x5b92c7=typeof _0xd2b373[_0xb906('0x23')]===_0xb906('0x24')&&typeof _0xd2b373[_0xb906('0x25')]===_0xb906('0x24');var _0x15f703=_0x2863c5[_0xb906('0x26')];var _0x3f5afc=_0x5b92c7?0x0:_0xd2b373[_0xb906('0x23')];var _0x2ed2cc=_0x5b92c7?_0x2863c5[_0xb906('0x26')]:_0xd2b373[_0xb906('0x23')]+_0xd2b373['limit'];var _0x3e844c;if(_0x2ed2cc>=_0x15f703){_0x2ed2cc=_0x15f703;_0x3e844c=0xc8;}else{_0x3e844c=0xce;}_0x406137[_0xb906('0x20')](_0x3e844c);return _0x406137[_0xb906('0x27')](_0xb906('0x28'),_0x3f5afc+'-'+_0x2ed2cc+'/'+_0x15f703)[_0xb906('0x22')](_0x2863c5);}return null;};}function patchUpdates(_0x21bdff){return function(_0x4ca7f2){try{jsonpatch[_0xb906('0x29')](_0x4ca7f2,_0x21bdff,!![]);}catch(_0x47ff4b){return BPromise['reject'](_0x47ff4b);}return _0x4ca7f2[_0xb906('0x2a')]();};}function saveUpdates(_0x2264bb,_0x1e9465){return function(_0x2f3e60){if(_0x2f3e60){return _0x2f3e60[_0xb906('0x2b')](_0x2264bb)[_0xb906('0x2c')](function(_0x5e9d43){return _0x5e9d43;});}return null;};}function removeEntity(_0x29e024,_0x1bf09e){return function(_0x216d25){if(_0x216d25){return _0x216d25[_0xb906('0x2d')]()[_0xb906('0x2c')](function(){_0x29e024[_0xb906('0x20')](0xcc)[_0xb906('0x21')]();});}};}function handleEntityNotFound(_0x2ff445,_0x3f7bc2){return function(_0x424f04){if(!_0x424f04){_0x2ff445[_0xb906('0x1f')](0x194);}return _0x424f04;};}function handleError(_0x19438e,_0x3f5ccd){_0x3f5ccd=_0x3f5ccd||0x1f4;return function(_0x360d5f){logger[_0xb906('0x2e')](_0x360d5f[_0xb906('0x2f')]);if(_0x360d5f[_0xb906('0x30')]){delete _0x360d5f[_0xb906('0x30')];}_0x19438e[_0xb906('0x20')](_0x3f5ccd)['send'](_0x360d5f);};}function getInteractionUsers(_0x1844d2,_0x16368b){return new BPromise(function(_0x19a6fa,_0x1bd74b){try{if(_0x16368b[_0x1844d2['id']]){_0x1844d2[_0xb906('0x31')]=_['map'](_0x16368b[_0x1844d2['id']],function(_0x4fd4d){return{'id':_0x4fd4d['id'],'fullname':_0x4fd4d[_0xb906('0x32')]};});}}catch(_0x2245ff){_0x1bd74b(_0x2245ff);}_0x19a6fa(_0x1844d2);});}function getInteractionTags(_0xf5e06,_0x4c23ec){return new BPromise(function(_0x37f1eb,_0x435d44){try{if(_0xf5e06[_0xb906('0x33')]){_0xf5e06['Tags']=[];_0xf5e06[_0xb906('0x33')][_0xb906('0x34')](',')[_0xb906('0x35')](function(_0x40fddb){_0xf5e06['Tags'][_0xb906('0x36')](_0x4c23ec[_0x40fddb]);});}delete _0xf5e06[_0xb906('0x33')];}catch(_0x272641){_0x435d44(_0x272641);}_0x37f1eb(_0xf5e06);});}function updateFaxInteraction(_0x5ba174,_0x46890f,_0x310951){return new BPromise(function(_0x4a8c3e,_0xec741e){return getInteractionUsers(_0x5ba174,_0x310951)[_0xb906('0x2c')](function(_0x5dd179){return getInteractionTags(_0x5dd179,_0x46890f);})['then'](function(_0x3b511b){_0x4a8c3e(_0x3b511b);})[_0xb906('0x37')](function(_0xf25b5b){_0xec741e(_0xf25b5b);});});}exports['index']=function(_0xbf5b51,_0x22c7ff){var _0x480d82={},_0xc1f4={},_0x9103fb={'count':0x0,'rows':[]};var _0x22fd4c=_[_0xb906('0x38')](db[_0xb906('0x39')][_0xb906('0x3a')],function(_0x5df8f4){return{'name':_0x5df8f4[_0xb906('0x3b')],'type':_0x5df8f4[_0xb906('0x3c')][_0xb906('0x3d')]};});_0xc1f4[_0xb906('0x3e')]=_[_0xb906('0x38')](_0x22fd4c,'name');_0xc1f4[_0xb906('0x3f')]=_[_0xb906('0x40')](_0xbf5b51[_0xb906('0x3f')]);_0xc1f4[_0xb906('0x41')]=_[_0xb906('0x42')](_0xc1f4[_0xb906('0x3e')],_0xc1f4['query']);_0x480d82[_0xb906('0x43')]=_['intersection'](_0xc1f4[_0xb906('0x3e')],qs['fields'](_0xbf5b51[_0xb906('0x3f')]['fields']));_0x480d82[_0xb906('0x43')]=_0x480d82[_0xb906('0x43')]['length']?_0x480d82['attributes']:_0xc1f4['model'];if(!_0xbf5b51[_0xb906('0x3f')][_0xb906('0x44')](_0xb906('0x45'))){_0x480d82[_0xb906('0x25')]=qs[_0xb906('0x25')](_0xbf5b51[_0xb906('0x3f')][_0xb906('0x25')]);_0x480d82[_0xb906('0x23')]=qs[_0xb906('0x23')](_0xbf5b51[_0xb906('0x3f')][_0xb906('0x23')]);}_0x480d82[_0xb906('0x46')]=qs[_0xb906('0x47')](_0xbf5b51['query'][_0xb906('0x47')]);_0x480d82[_0xb906('0x48')]=qs[_0xb906('0x41')](_[_0xb906('0x49')](_0xbf5b51['query'],_0xc1f4[_0xb906('0x41')]),_0x22fd4c);var _0x33a5b1=[];var _0x1eec39=squel[_0xb906('0x4a')]()[_0xb906('0x4b')]('id')[_0xb906('0x4b')]('name')[_0xb906('0x4b')](_0xb906('0x4c'))[_0xb906('0x4d')](_0xb906('0x4e'));var _0xa4dbbc=squel[_0xb906('0x4a')]()[_0xb906('0x4b')](_0xb906('0x4f'))[_0xb906('0x4b')](_0xb906('0x50'))[_0xb906('0x4b')]('ui.FaxInteractionId')[_0xb906('0x4d')]('user_has_fax_interactions','ui')[_0xb906('0x51')](_0xb906('0x52'),'u',_0xb906('0x53'));var _0x33125e=squel['select']()[_0xb906('0x4d')](_0xb906('0x54'),'i')[_0xb906('0x51')]('cm_contacts','c',_0xb906('0x55'))[_0xb906('0x51')](_0xb906('0x52'),'o',_0xb906('0x56'))[_0xb906('0x51')](_0xb906('0x57'),'a','a.id\x20=\x20i.FaxAccountId')[_0xb906('0x51')](_0xb906('0x58'),'me',_0xb906('0x59'))[_0xb906('0x51')](_0xb906('0x5a'),'it',_0xb906('0x5b'))[_0xb906('0x51')](_0xb906('0x4e'),'t',_0xb906('0x5c'));var _0x5d7832=squel[_0xb906('0x5d')]();var _0x354e4c=[];var _0x24c188=squel[_0xb906('0x5d')]();var _0x4b71b3;if(_0xbf5b51[_0xb906('0x3f')]['search']){_0x4b71b3=as[_0xb906('0x5e')](_0xbf5b51[_0xb906('0x3f')][_0xb906('0x5f')]);var _0x479731=_0x4b71b3[_0xb906('0x60')];for(var _0x39bddc=0x0;_0x39bddc<_0x4b71b3['conditions'][_0xb906('0x61')];_0x39bddc++){var _0x38e7b3=_0x4b71b3[_0xb906('0x62')][_0x39bddc];var _0x246534='i';var _0x135db5=_[_0xb906('0x63')](_0x22fd4c,[_0xb906('0x30'),_0x38e7b3[_0xb906('0x4b')]]);if(!_0x135db5){switch(_0x38e7b3[_0xb906('0x4b')]){case _0xb906('0x64'):if(_0x38e7b3[_0xb906('0x65')]==0x1){_0x33125e[_0xb906('0x66')]('`'+_0x38e7b3[_0xb906('0x4b')]+_0xb906('0x67'));}else{_0x33125e[_0xb906('0x66')]('`'+_0x38e7b3[_0xb906('0x4b')]+'`\x20>\x200');}break;case _0xb906('0x68'):if(_0x38e7b3[_0xb906('0x69')]===_0xb906('0x6a')){if(_0x38e7b3[_0xb906('0x65')]['split']('\x20')[_0xb906('0x61')]>0x1){_0x5d7832[_0x479731](_0xb906('0x6b'),qs[_0xb906('0x6c')](_0x38e7b3['value']),null);}else{var _0x2afe35='%'+_0x38e7b3[_0xb906('0x65')]+'%';_0x5d7832[_0x479731](_0xb906('0x6d'),_0x2afe35,_0x2afe35,_0x2afe35);}}else{_0x135db5=_[_0xb906('0x63')](_0x22fd4c,[_0xb906('0x30'),_0xb906('0x6e')]);_0x38e7b3[_0xb906('0x4b')]=_0xb906('0x6e');_0x3cc32c=as[_0xb906('0x6f')](_0x246534,_0x135db5['type'],_0x38e7b3);_0x5d7832[_0x479731](_0x3cc32c[_0xb906('0x70')],_0x3cc32c['value'][_0xb906('0x71')],_0x3cc32c[_0xb906('0x65')][_0xb906('0x21')]);}break;case _0xb906('0x72'):var _0xd9571b=_0x38e7b3['value'][_0xb906('0x34')](',')['map'](function(_0x476f96){return Number(_0x476f96);});_0xd9571b[_0xb906('0x35')](function(_0x1a62b2){_0x24c188['or'](_0xb906('0x73'),'%,'+_0x1a62b2+',%');});_0x354e4c=_[_0xb906('0x74')](_0x354e4c,_0xd9571b);break;case _0xb906('0x75'):if(_0x38e7b3[_0xb906('0x69')]===_0xb906('0x6a')){_0x5d7832[_0x479731]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x38e7b3[_0xb906('0x65')]+'%',null);}else{_0x135db5=_[_0xb906('0x63')](_0x22fd4c,['name',_0xb906('0x76')]);_0x38e7b3[_0xb906('0x4b')]=_0xb906('0x76');_0x3cc32c=as['buildExpression'](_0x246534,_0x135db5[_0xb906('0x3c')],_0x38e7b3);_0x5d7832[_0x479731](_0x3cc32c['text'],_0x3cc32c[_0xb906('0x65')][_0xb906('0x71')],_0x3cc32c['value']['end']);}break;case _0xb906('0x77'):_0x3cc32c=as[_0xb906('0x6f')]('me',null,_0x38e7b3);_0x5d7832[_0x479731](_0x3cc32c['text'],_0x3cc32c[_0xb906('0x65')]['start'],_0x3cc32c[_0xb906('0x65')][_0xb906('0x21')]);break;}}else{var _0x3cc32c=as['buildExpression'](_0x246534,_0x135db5[_0xb906('0x3c')],_0x38e7b3);_0x5d7832[_0x479731](_0x3cc32c[_0xb906('0x70')],_0x3cc32c['value'][_0xb906('0x71')],_0x3cc32c['value'][_0xb906('0x21')]);}}}else{var _0x1dec32=_(_0xbf5b51[_0xb906('0x3f')])[_0xb906('0x40')]()[_0xb906('0x38')](function(_0x19888f){return _[_0xb906('0x78')](_0x22fd4c,[_0xb906('0x30'),_0x19888f])?_0x19888f:undefined;})[_0xb906('0x79')]()[_0xb906('0x65')]();if(!_[_0xb906('0x7a')](_0x1dec32)){_0x1dec32[_0xb906('0x35')](function(_0xc5bc73){if(_0xc5bc73===_0xb906('0x7b')){_0x33125e[_0xb906('0x48')](_0xb906('0x7c'),[][_0xb906('0x7d')](_0xbf5b51[_0xb906('0x3f')][_0xc5bc73]));}else if(_0xc5bc73===_0xb906('0x7e')){var _0x678976=JSON[_0xb906('0x7f')](_0xbf5b51[_0xb906('0x3f')][_0xc5bc73])['$gte'];var _0x51f08a=JSON['parse'](_0xbf5b51['query'][_0xc5bc73])['$lte'];_0x33125e[_0xb906('0x48')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x678976,_0x51f08a);}else{if(_0xbf5b51[_0xb906('0x3f')][_0xc5bc73]==='null'){_0x33125e[_0xb906('0x48')]('i.'+_0xc5bc73+_0xb906('0x80'));}else{_0x33125e[_0xb906('0x48')]('i.'+_0xc5bc73+_0xb906('0x81'),_0xbf5b51[_0xb906('0x3f')][_0xc5bc73]);}}});}if(_0xbf5b51[_0xb906('0x3f')][_0xb906('0x82')]){if(_0xbf5b51[_0xb906('0x3f')][_0xb906('0x82')]==0x1){_0x33125e[_0xb906('0x66')](_0xb906('0x83'));}else{_0x33125e[_0xb906('0x66')]('`unreadMessages`\x20>\x200');}}if(_0xbf5b51[_0xb906('0x3f')][_0xb906('0x84')]){_0x354e4c=_[_0xb906('0x85')](_0xbf5b51[_0xb906('0x3f')][_0xb906('0x84')])?_0xbf5b51[_0xb906('0x3f')][_0xb906('0x84')]:new Array(_0xbf5b51[_0xb906('0x3f')][_0xb906('0x84')]);_0x354e4c[_0xb906('0x35')](function(_0x33b000){_0x24c188['or'](_0xb906('0x73'),'%,'+_0x33b000+',%');});}if(_0xbf5b51[_0xb906('0x3f')][_0xb906('0x86')]){var _0x6f8d58=_0xbf5b51[_0xb906('0x3f')]['filter'][_0xb906('0x87')]('\x5c','\x5c\x5c')[_0xb906('0x87')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x6f8d58)){_0x5d7832['or'](_0xb906('0x88'),_0x6f8d58+'%')['or'](_0xb906('0x89'),_0x6f8d58+'%');}_0x5d7832['or'](_0xb906('0x8a'),_0x6f8d58+'%');}}_0x33125e[_0xb906('0x48')](_0x5d7832);_0x33125e[_0xb906('0x8b')](_0xb906('0x8c'));var _0x912193={'type':db['Sequelize'][_0xb906('0x8d')][_0xb906('0x8e')],'raw':!![]};var _0xb42f10=_0x33125e[_0xb906('0x8f')]();_0xb42f10[_0xb906('0x4b')](_0xb906('0x8c'));_0xb42f10['field'](_0xb906('0x90'),'unreadMessages');if(_0x480d82['order']){_0x480d82[_0xb906('0x46')][_0xb906('0x35')](function(_0x4e228d){var _0x439490=_0x4e228d[0x0]==='contactName'?_0x4e228d[0x0]:'i.'+_0x4e228d[0x0];_0x33125e['order'](_0x439490,_0x4e228d[0x1]===_0xb906('0x91')?![]:!![]);});}if(!_['isEmpty'](_0x354e4c)){_0x33125e[_0xb906('0x66')](_0x24c188);_0xb42f10['where']('t.id\x20IN\x20?',_0x354e4c);}BPromise[_0xb906('0x92')]()[_0xb906('0x2c')](function(){if(!_0x4b71b3){if(_0xbf5b51[_0xb906('0x3f')][_0xb906('0x7b')])return;_0xb42f10[_0xb906('0x48')](_0xb906('0x93'));_0x33125e[_0xb906('0x48')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0xbf5b51[_0xb906('0x94')][_0xb906('0x95')]!==_0xb906('0x96'))return;return _0xbf5b51[_0xb906('0x94')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0xb906('0x2c')](function(_0x182b23){if(_['isEmpty'](_0x182b23)){_0xb42f10[_0xb906('0x48')](_0xb906('0x97'));_0x33125e['where']('i.FaxAccountId\x20IS\x20NULL');}else{_0xb42f10[_0xb906('0x48')](_0xb906('0x7c'),_[_0xb906('0x38')](_0x182b23,'id'));_0x33125e[_0xb906('0x48')](_0xb906('0x7c'),_[_0xb906('0x38')](_0x182b23,'id'));}});})['then'](function(){if(_0xbf5b51[_0xb906('0x94')]['role']===_0xb906('0x96')&&!_0x4b71b3&&!_0xbf5b51['query'][_0xb906('0x7b')])return[];return db['sequelize']['query'](_0xb42f10['toString'](),_0x912193);})[_0xb906('0x2c')](function(_0x5adc85){_0x9103fb['count']=_0x5adc85[_0xb906('0x61')];if(_0x9103fb[_0xb906('0x26')]===0x0)return[];return db[_0xb906('0x98')][_0xb906('0x3f')](_0x1eec39[_0xb906('0x99')](),_0x912193)[_0xb906('0x2c')](function(_0x136cdd){_0x33a5b1=_[_0xb906('0x9a')](_0x136cdd,'id');_0x912193=_['merge'](_0x912193,{'model':db[_0xb906('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xbf5b51[_0xb906('0x3f')][_0xb906('0x9b')]){_0x480d82['attributes'][_0xb906('0x35')](function(_0x4f548e){_0x33125e[_0xb906('0x4b')]('i.'+_0x4f548e);});}else{_0x33125e[_0xb906('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xb906('0x64'));_0x33125e['field']('a.key',_0xb906('0x9c'));_0x33125e[_0xb906('0x4b')]('a.mandatoryDisposition',_0xb906('0x9d'));_0x33125e[_0xb906('0x4b')](_0xb906('0x9e'),_0xb906('0x9f'));_0x33125e[_0xb906('0x4b')]('i.*');_0x33125e[_0xb906('0x4b')](_0xb906('0xa0'),_0xb906('0xa1'));_0x33125e[_0xb906('0x4b')]('c.lastName',_0xb906('0xa2'));_0x33125e[_0xb906('0x4b')](_0xb906('0xa3'),_0xb906('0xa4'));_0x33125e[_0xb906('0x4b')](_0xb906('0xa5'),'Contact.phone');_0x33125e[_0xb906('0x4b')](_0xb906('0xa6'),_0xb906('0xa7'));_0x33125e['field']('c.fax',_0xb906('0xa8'));_0x33125e[_0xb906('0x4b')]('o.fullname',_0xb906('0xa9'));_0x33125e['field']('o.internal','Owner.internal');_0x33125e[_0xb906('0x4b')](_0xb906('0xaa'),_0xb906('0x33'));}if(_0x480d82[_0xb906('0x25')])_0x33125e[_0xb906('0x25')](_0x480d82['limit']);if(_0x480d82[_0xb906('0x23')])_0x33125e[_0xb906('0x23')](_0x480d82[_0xb906('0x23')]);return db[_0xb906('0x98')][_0xb906('0x3f')](_0x33125e['toString'](),_0x912193);})[_0xb906('0x2c')](function(_0x546151){if(_0x546151[_0xb906('0x61')]>0x0)_0xa4dbbc['where'](_0xb906('0xab'),_[_0xb906('0x38')](_0x546151,'id'));return db[_0xb906('0x98')][_0xb906('0x3f')](_0xa4dbbc[_0xb906('0x99')](),_0x912193)['then'](function(_0x52d05d){var _0x576f46=_[_0xb906('0xac')](_0x52d05d,_0xb906('0xad'));var _0x484e82=[];_0x546151[_0xb906('0x35')](function(_0x3e5f02){_0x484e82[_0xb906('0x36')](updateFaxInteraction(_0x3e5f02,_0x33a5b1,_0x576f46));});return BPromise[_0xb906('0xae')](_0x484e82);});});})['then'](function(_0x29aa7d){_0x9103fb['rows']=_0x29aa7d;return _0x9103fb;})[_0xb906('0x2c')](respondWithFilteredResult(_0x22c7ff,_0x480d82))['catch'](handleError(_0x22c7ff,null));};exports['show']=function(_0x32f95c,_0x4afb96){var _0x474b4a={'raw':![],'where':{'id':_0x32f95c[_0xb906('0xaf')]['id']}},_0x5e6af3={};_0x5e6af3[_0xb906('0x3e')]=_[_0xb906('0x40')](db['FaxInteraction'][_0xb906('0x3a')]);_0x5e6af3['query']=_[_0xb906('0x40')](_0x32f95c[_0xb906('0x3f')]);_0x5e6af3[_0xb906('0x41')]=_[_0xb906('0x42')](_0x5e6af3[_0xb906('0x3e')],_0x5e6af3['query']);_0x474b4a[_0xb906('0x43')]=_[_0xb906('0x42')](_0x5e6af3[_0xb906('0x3e')],qs[_0xb906('0x9b')](_0x32f95c[_0xb906('0x3f')][_0xb906('0x9b')]));_0x474b4a[_0xb906('0x43')]=_0x474b4a[_0xb906('0x43')]['length']?_0x474b4a[_0xb906('0x43')]:_0x5e6af3[_0xb906('0x3e')];if(_0x32f95c[_0xb906('0x3f')]['includeAll']){_0x474b4a['include']=[{'all':!![]}];}_0x474b4a=_['merge']({},_0x474b4a,_0x32f95c[_0xb906('0xb0')]);return db[_0xb906('0x39')][_0xb906('0x63')](_0x474b4a)[_0xb906('0x2c')](handleEntityNotFound(_0x4afb96,null))['then'](respondWithResult(_0x4afb96,null))[_0xb906('0x37')](handleError(_0x4afb96,null));};exports['create']=function(_0x17f047,_0xec281b){return db[_0xb906('0x39')]['create'](_0x17f047[_0xb906('0x77')],{})[_0xb906('0x2c')](respondWithResult(_0xec281b,0xc9))[_0xb906('0x37')](handleError(_0xec281b,null));};exports[_0xb906('0x2b')]=function(_0x184b7b,_0x17f6e1){if(_0x184b7b['body']['id']){delete _0x184b7b['body']['id'];}return db[_0xb906('0x39')][_0xb906('0x63')]({'where':{'id':_0x184b7b['params']['id']}})[_0xb906('0x2c')](handleEntityNotFound(_0x17f6e1,null))[_0xb906('0x2c')](saveUpdates(_0x184b7b[_0xb906('0x77')],null))['then'](respondWithResult(_0x17f6e1,null))['catch'](handleError(_0x17f6e1,null));};exports['destroy']=function(_0x38692f,_0x1be5b3){return db[_0xb906('0x39')]['find']({'where':{'id':_0x38692f[_0xb906('0xaf')]['id']}})[_0xb906('0x2c')](handleEntityNotFound(_0x1be5b3,null))['then'](removeEntity(_0x1be5b3,null))[_0xb906('0x37')](handleError(_0x1be5b3,null));};exports[_0xb906('0xb1')]=function(_0x14a3c0,_0x3081df){return db[_0xb906('0x39')][_0xb906('0xb1')]()[_0xb906('0x2c')](respondWithResult(_0x3081df,null))[_0xb906('0x37')](handleError(_0x3081df,null));};exports[_0xb906('0xb2')]=function(_0x3dae7d,_0xfea1ca,_0xe6086a){return db[_0xb906('0xb3')][_0xb906('0x63')]({'where':{'id':_0x3dae7d['params']['id']}})['then'](handleEntityNotFound(_0xfea1ca,null))[_0xb906('0x2c')](function(_0x117819){if(_0x117819){return _0x117819[_0xb906('0xb2')](_0x3dae7d[_0xb906('0x77')]['ids'],_[_0xb906('0xb4')](_0x3dae7d[_0xb906('0x77')],[_0xb906('0xb5'),'id'])||{});}})[_0xb906('0x2c')](respondWithResult(_0xfea1ca,null))[_0xb906('0x37')](handleError(_0xfea1ca,null));};exports['getMessages']=function(_0x248d9f,_0x2948a9,_0x402d47){var _0x432fd4={'raw':![],'where':{}};var _0x3d7415={};var _0x2679d0={'count':0x0,'rows':[]};return db[_0xb906('0x39')]['findOne']({'where':{'id':_0x248d9f[_0xb906('0xaf')]['id']}})[_0xb906('0x2c')](handleEntityNotFound(_0x2948a9,null))[_0xb906('0x2c')](function(_0x8f8d73){if(_0x8f8d73){_0x3d7415[_0xb906('0x3e')]=_[_0xb906('0x40')](db[_0xb906('0xb3')][_0xb906('0x3a')]);_0x3d7415[_0xb906('0x3f')]=_[_0xb906('0x40')](_0x248d9f[_0xb906('0x3f')]);_0x3d7415[_0xb906('0x41')]=_['intersection'](_0x3d7415['model'],_0x3d7415[_0xb906('0x3f')]);_0x432fd4[_0xb906('0x43')]=_['intersection'](_0x3d7415['model'],qs[_0xb906('0x9b')](_0x248d9f[_0xb906('0x3f')][_0xb906('0x9b')]));_0x432fd4['attributes']=_0x432fd4[_0xb906('0x43')][_0xb906('0x61')]?_0x432fd4[_0xb906('0x43')]:_0x3d7415[_0xb906('0x3e')];if(!_0x248d9f[_0xb906('0x3f')][_0xb906('0x44')](_0xb906('0x45'))){_0x432fd4['limit']=qs[_0xb906('0x25')](_0x248d9f['query']['limit']);_0x432fd4[_0xb906('0x23')]=qs['offset'](_0x248d9f[_0xb906('0x3f')]['offset']);}_0x432fd4[_0xb906('0x46')]=qs['sort'](_0x248d9f['query'][_0xb906('0x47')]);_0x432fd4[_0xb906('0x48')]=qs['filters'](_[_0xb906('0x49')](_0x248d9f[_0xb906('0x3f')],_0x3d7415['filters']));_0x432fd4['where']['FaxInteractionId']=_0x8f8d73['id'];if(_0x248d9f[_0xb906('0x3f')][_0xb906('0x86')]){_0x432fd4[_0xb906('0x48')]=_[_0xb906('0xb6')](_0x432fd4[_0xb906('0x48')],{'$or':_[_0xb906('0x38')](_0x432fd4[_0xb906('0x43')],function(_0x595dd4){var _0x174c46={};_0x174c46[_0x595dd4]={'$like':'%'+_0x248d9f[_0xb906('0x3f')][_0xb906('0x86')]+'%'};return _0x174c46;})});}if(_0x248d9f[_0xb906('0x3f')][_0xb906('0xb7')]){var _0x21bdf9=_0x248d9f[_0xb906('0x3f')][_0xb906('0xb7')][_0xb906('0x34')](',');var _0x31b19f={};_0x31b19f[_0x21bdf9[0x0]]={'$gte':moment(_0x21bdf9[0x1])[_0xb906('0xb8')]('YYYY-MM-DD\x20HH:mm:ss')};_0x432fd4[_0xb906('0x48')]=_['merge'](_0x432fd4[_0xb906('0x48')],_0x31b19f);}_0x432fd4=_[_0xb906('0xb6')]({},_0x432fd4,_0x248d9f[_0xb906('0xb0')]);return db[_0xb906('0xb3')]['count']({'where':_0x432fd4[_0xb906('0x48')]})['then'](function(_0x2ea2b9){_0x2679d0[_0xb906('0x26')]=_0x2ea2b9;if(_0x248d9f[_0xb906('0x3f')][_0xb906('0xb9')]){_0x432fd4[_0xb906('0xba')]=[{'all':!![]}];}return db[_0xb906('0xb3')]['findAll'](_0x432fd4);})[_0xb906('0x2c')](function(_0x2ce1eb){_0x2679d0[_0xb906('0xbb')]=_0x2ce1eb;return _0x2679d0;});}})['then'](respondWithFilteredResult(_0x2948a9,_0x432fd4))[_0xb906('0x37')](handleError(_0x2948a9,null));};exports[_0xb906('0xbc')]=function(_0x567467,_0x5ed3ad,_0x4b33a7){return db['FaxInteraction']['find']({'where':{'id':_0x567467['params']['id']}})[_0xb906('0x2c')](handleEntityNotFound(_0x5ed3ad,null))[_0xb906('0x2c')](function(_0x4ff30c){if(_0x4ff30c){return _0x4ff30c[_0xb906('0xbd')](_0x567467[_0xb906('0x77')][_0xb906('0xb5')],_[_0xb906('0xb4')](_0x567467[_0xb906('0x77')],[_0xb906('0xb5'),'id'])||{})[_0xb906('0xbe')](function(){return db[_0xb906('0x72')][_0xb906('0xbf')]({'attributes':['id',_0xb906('0x30'),_0xb906('0x4c')],'where':{'id':_0x567467[_0xb906('0x77')][_0xb906('0xb5')]}});})[_0xb906('0x2c')](function(_0x2595bd){socket['emit'](_0xb906('0xc0'),{'id':Number(_0x567467['params']['id']),'tags':_0x2595bd||[]});return{'id':Number(_0x567467['params']['id']),'tags':_0x2595bd||[]};});}})[_0xb906('0x2c')](respondWithResult(_0x5ed3ad,null))[_0xb906('0x37')](handleError(_0x5ed3ad,null));};exports[_0xb906('0xc1')]=function(_0xac0000,_0x342b9d,_0x27ca02){return db[_0xb906('0x39')][_0xb906('0x63')]({'where':{'id':_0xac0000[_0xb906('0xaf')]['id']}})['then'](handleEntityNotFound(_0x342b9d,null))['then'](function(_0x6756a5){if(_0x6756a5){return _0x6756a5['removeTags'](_0xac0000['query'][_0xb906('0xb5')]);}})[_0xb906('0x2c')](respondWithStatusCode(_0x342b9d,null))[_0xb906('0x37')](handleError(_0x342b9d,null));};exports[_0xb906('0xc2')]=function(_0x68a13a,_0x23689a){var _0x2f8561=moment()['unix']()['toString']();var _0x947f0f=path[_0xb906('0xc3')](config[_0xb906('0xc4')],_0xb906('0xc5'),_0xb906('0xc6'),_0xb906('0xc7'));var _0xa97df8=path['join'](config[_0xb906('0xc4')],_0xb906('0xc5'),_0xb906('0xc6'),'attachments');var _0x26e41c=path[_0xb906('0xc3')](_0x947f0f,_0x2f8561);var _0x275660=util[_0xb906('0xb8')](_0xb906('0xc8'),_0x68a13a[_0xb906('0xaf')]['id'],_0x2f8561);var _0x51b66d=path[_0xb906('0xc3')](_0x947f0f,_0x275660);var _0x342925=[];_0x342925[_0xb906('0x36')]({'model':db[_0xb906('0xc9')],'as':_0xb906('0xc9'),'raw':!![]});var _0x6112e8=[{'model':db['FaxMessage'],'as':_0xb906('0xca'),'attributes':['id','body','createdAt'],'include':_0x342925}];return db[_0xb906('0x39')]['find']({'where':{'id':_0x68a13a[_0xb906('0xaf')]['id']},'include':_0x6112e8})[_0xb906('0x2c')](handleEntityNotFound(_0x23689a,null))[_0xb906('0x2c')](function(_0x3b8019){if(_0x3b8019&&_0x3b8019[_0xb906('0xca')]){var _0xf3e769=_0x3b8019['get']({'plain':!![]});fs[_0xb906('0xcb')](_0x26e41c);for(var _0x51261d=0x0;_0x51261d<_0xf3e769['Messages']['length'];_0x51261d++){var _0x18f8a9=_0xf3e769[_0xb906('0xca')][_0x51261d][_0xb906('0xc9')];if(_0x18f8a9){var _0x442168=path['join'](_0xa97df8,_0x18f8a9[_0xb906('0xcc')]);if(fs[_0xb906('0xcd')](_0x442168)){fs[_0xb906('0xce')](_0x442168)['pipe'](fs['createWriteStream'](path[_0xb906('0xc3')](_0x26e41c,_0x18f8a9[_0xb906('0xcc')])));}}}return BPromise[_0xb906('0x92')]()[_0xb906('0x2c')](function(){return new BPromise(function(_0x4f455e,_0x29686d){zipdir(_0x26e41c,{'saveTo':_0x51b66d},function(_0x22b30d,_0x595491){if(_0x22b30d)return _0x29686d(_0x22b30d);return _0x4f455e(_0x595491);});})[_0xb906('0x2c')](function(){return new BPromise(function(_0x5d6fce,_0x359bed){rimraf(_0x26e41c,function(_0x2945fa){if(_0x2945fa)_0x359bed(_0x2945fa);return _0x5d6fce();});});})[_0xb906('0x2c')](function(){return _0x23689a[_0xb906('0xc2')](_0x51b66d,_0x275660,function(_0x3436e6){if(_0x3436e6){console[_0xb906('0xcf')](_0xb906('0xd0'),_0x3436e6);}else{fs[_0xb906('0xd1')](_0x51b66d);}});});});}else{return _0x23689a[_0xb906('0x1f')](0xc8);}})[_0xb906('0x37')](handleError(_0x23689a,null));}; \ No newline at end of file +var _0x6afa=['send','Users','map','fullname','Tags','TagIds','split','push','catch','index','FaxInteraction','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.id','ui.FaxInteractionId','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','left_join','cm_contacts','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','search','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','text','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','start','some','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','rows','show','params','keys','rawAttributes','include','options','create','body','describe','FaxMessage','ids','omit','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','spread','Tag','color','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','format','Attachment','Messages','mkdirSync','existsSync','createReadStream','basename','log','err','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','json','undefined','count','offset','limit','set','apply','reject','update','then','destroy','end','error','stack','name'];(function(_0x500242,_0x4b5bb0){var _0x52ba31=function(_0x3e1398){while(--_0x3e1398){_0x500242['push'](_0x500242['shift']());}};_0x52ba31(++_0x4b5bb0);}(_0x6afa,0xa6));var _0xa6af=function(_0x802bdf,_0x2f2893){_0x802bdf=_0x802bdf-0x0;var _0x28b99f=_0x6afa[_0x802bdf];return _0x28b99f;};'use strict';var emlformat=require(_0xa6af('0x0'));var rimraf=require(_0xa6af('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa6af('0x2'));var rp=require(_0xa6af('0x3'));var moment=require(_0xa6af('0x4'));var BPromise=require(_0xa6af('0x5'));var Mustache=require(_0xa6af('0x6'));var util=require('util');var path=require(_0xa6af('0x7'));var sox=require('sox');var csv=require(_0xa6af('0x8'));var ejs=require(_0xa6af('0x9'));var fs=require('fs');var fs_extra=require(_0xa6af('0xa'));var _=require(_0xa6af('0xb'));var squel=require(_0xa6af('0xc'));var crypto=require(_0xa6af('0xd'));var jsforce=require(_0xa6af('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa6af('0x8'));var querystring=require(_0xa6af('0xf'));var Papa=require(_0xa6af('0x10'));var Redis=require(_0xa6af('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa6af('0x12'));var as=require(_0xa6af('0x13'));var hardwareService=require(_0xa6af('0x14'));var logger=require('../../config/logger')(_0xa6af('0x15'));var utils=require(_0xa6af('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xa6af('0x17')](config['redis'],{'host':_0xa6af('0x18'),'port':0x18eb});var socket=require(_0xa6af('0x19'))(new Redis(config['redis']));require(_0xa6af('0x1a'))[_0xa6af('0x1b')](socket);function respondWithStatusCode(_0x1d11d4,_0x4d34c4){_0x4d34c4=_0x4d34c4||0xcc;return function(_0xfc3f70){if(_0xfc3f70){return _0x1d11d4[_0xa6af('0x1c')](_0x4d34c4);}return _0x1d11d4[_0xa6af('0x1d')](_0x4d34c4)['end']();};}function respondWithResult(_0x34d0df,_0x447f49){_0x447f49=_0x447f49||0xc8;return function(_0x253d9b){if(_0x253d9b){return _0x34d0df[_0xa6af('0x1d')](_0x447f49)[_0xa6af('0x1e')](_0x253d9b);}};}function respondWithFilteredResult(_0x23b90f,_0x3d25c8){return function(_0x58bac9){if(_0x58bac9){var _0x4c81f4=typeof _0x3d25c8['offset']===_0xa6af('0x1f')&&typeof _0x3d25c8['limit']===_0xa6af('0x1f');var _0x8b18d7=_0x58bac9[_0xa6af('0x20')];var _0x57b57a=_0x4c81f4?0x0:_0x3d25c8[_0xa6af('0x21')];var _0x4c20c4=_0x4c81f4?_0x58bac9['count']:_0x3d25c8[_0xa6af('0x21')]+_0x3d25c8[_0xa6af('0x22')];var _0x59abc8;if(_0x4c20c4>=_0x8b18d7){_0x4c20c4=_0x8b18d7;_0x59abc8=0xc8;}else{_0x59abc8=0xce;}_0x23b90f[_0xa6af('0x1d')](_0x59abc8);return _0x23b90f[_0xa6af('0x23')]('Content-Range',_0x57b57a+'-'+_0x4c20c4+'/'+_0x8b18d7)[_0xa6af('0x1e')](_0x58bac9);}return null;};}function patchUpdates(_0x10bc06){return function(_0x5ba9a2){try{jsonpatch[_0xa6af('0x24')](_0x5ba9a2,_0x10bc06,!![]);}catch(_0x1936bf){return BPromise[_0xa6af('0x25')](_0x1936bf);}return _0x5ba9a2['save']();};}function saveUpdates(_0x1759e8,_0x5dd54e){return function(_0xa19cb1){if(_0xa19cb1){return _0xa19cb1[_0xa6af('0x26')](_0x1759e8)[_0xa6af('0x27')](function(_0x1f743f){return _0x1f743f;});}return null;};}function removeEntity(_0x55031f,_0x380dfa){return function(_0x344ee2){if(_0x344ee2){return _0x344ee2[_0xa6af('0x28')]()[_0xa6af('0x27')](function(){_0x55031f[_0xa6af('0x1d')](0xcc)[_0xa6af('0x29')]();});}};}function handleEntityNotFound(_0x62df11,_0x2fca6c){return function(_0x268b34){if(!_0x268b34){_0x62df11[_0xa6af('0x1c')](0x194);}return _0x268b34;};}function handleError(_0x10c81a,_0x280236){_0x280236=_0x280236||0x1f4;return function(_0x10436d){logger[_0xa6af('0x2a')](_0x10436d[_0xa6af('0x2b')]);if(_0x10436d[_0xa6af('0x2c')]){delete _0x10436d[_0xa6af('0x2c')];}_0x10c81a[_0xa6af('0x1d')](_0x280236)[_0xa6af('0x2d')](_0x10436d);};}function getInteractionUsers(_0x9b4c3b,_0x3f6135){return new BPromise(function(_0x388e41,_0x4a87ac){try{if(_0x3f6135[_0x9b4c3b['id']]){_0x9b4c3b[_0xa6af('0x2e')]=_[_0xa6af('0x2f')](_0x3f6135[_0x9b4c3b['id']],function(_0x11726d){return{'id':_0x11726d['id'],'fullname':_0x11726d[_0xa6af('0x30')]};});}}catch(_0x5778f5){_0x4a87ac(_0x5778f5);}_0x388e41(_0x9b4c3b);});}function getInteractionTags(_0x22d45e,_0x193ec7){return new BPromise(function(_0x862259,_0x20d45c){try{if(_0x22d45e['TagIds']){_0x22d45e[_0xa6af('0x31')]=[];_0x22d45e[_0xa6af('0x32')][_0xa6af('0x33')](',')['forEach'](function(_0x40e6eb){_0x22d45e['Tags'][_0xa6af('0x34')](_0x193ec7[_0x40e6eb]);});}delete _0x22d45e[_0xa6af('0x32')];}catch(_0x3ce02d){_0x20d45c(_0x3ce02d);}_0x862259(_0x22d45e);});}function updateFaxInteraction(_0x5962e7,_0xc27487,_0x13d89c){return new BPromise(function(_0x513603,_0x2e68be){return getInteractionUsers(_0x5962e7,_0x13d89c)['then'](function(_0xb314d0){return getInteractionTags(_0xb314d0,_0xc27487);})[_0xa6af('0x27')](function(_0x57b791){_0x513603(_0x57b791);})[_0xa6af('0x35')](function(_0x66b29a){_0x2e68be(_0x66b29a);});});}exports[_0xa6af('0x36')]=function(_0x295124,_0x8f9f8e){var _0x105313={},_0x30a17d={},_0x433256={'count':0x0,'rows':[]};var _0x26d305=_[_0xa6af('0x2f')](db[_0xa6af('0x37')]['rawAttributes'],function(_0x1f31eb){return{'name':_0x1f31eb[_0xa6af('0x38')],'type':_0x1f31eb[_0xa6af('0x39')][_0xa6af('0x3a')]};});_0x30a17d[_0xa6af('0x3b')]=_[_0xa6af('0x2f')](_0x26d305,_0xa6af('0x2c'));_0x30a17d[_0xa6af('0x3c')]=_['keys'](_0x295124['query']);_0x30a17d[_0xa6af('0x3d')]=_[_0xa6af('0x3e')](_0x30a17d[_0xa6af('0x3b')],_0x30a17d[_0xa6af('0x3c')]);_0x105313[_0xa6af('0x3f')]=_[_0xa6af('0x3e')](_0x30a17d[_0xa6af('0x3b')],qs[_0xa6af('0x40')](_0x295124[_0xa6af('0x3c')][_0xa6af('0x40')]));_0x105313[_0xa6af('0x3f')]=_0x105313[_0xa6af('0x3f')]['length']?_0x105313[_0xa6af('0x3f')]:_0x30a17d[_0xa6af('0x3b')];if(!_0x295124[_0xa6af('0x3c')][_0xa6af('0x41')](_0xa6af('0x42'))){_0x105313['limit']=qs[_0xa6af('0x22')](_0x295124[_0xa6af('0x3c')][_0xa6af('0x22')]);_0x105313[_0xa6af('0x21')]=qs[_0xa6af('0x21')](_0x295124[_0xa6af('0x3c')]['offset']);}_0x105313[_0xa6af('0x43')]=qs['sort'](_0x295124[_0xa6af('0x3c')][_0xa6af('0x44')]);_0x105313[_0xa6af('0x45')]=qs[_0xa6af('0x3d')](_[_0xa6af('0x46')](_0x295124[_0xa6af('0x3c')],_0x30a17d[_0xa6af('0x3d')]),_0x26d305);var _0x295496=[];var _0x24b842=squel[_0xa6af('0x47')]()[_0xa6af('0x48')]('id')[_0xa6af('0x48')](_0xa6af('0x2c'))['field']('color')[_0xa6af('0x49')](_0xa6af('0x4a'));var _0x53cc4f=squel['select']()[_0xa6af('0x48')](_0xa6af('0x4b'))[_0xa6af('0x48')]('u.fullname')[_0xa6af('0x48')](_0xa6af('0x4c'))[_0xa6af('0x49')](_0xa6af('0x4d'),'ui')['left_join'](_0xa6af('0x4e'),'u',_0xa6af('0x4f'));var _0x4d7e42=squel[_0xa6af('0x47')]()[_0xa6af('0x49')]('fax_interactions','i')[_0xa6af('0x50')](_0xa6af('0x51'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xa6af('0x50')](_0xa6af('0x4e'),'o',_0xa6af('0x52'))[_0xa6af('0x50')](_0xa6af('0x53'),'a',_0xa6af('0x54'))['left_join'](_0xa6af('0x55'),'me',_0xa6af('0x56'))[_0xa6af('0x50')]('fax_interaction_has_tags','it',_0xa6af('0x57'))[_0xa6af('0x50')](_0xa6af('0x4a'),'t',_0xa6af('0x58'));var _0x416a7b=squel['expr']();var _0x415448=[];var _0xf655d9=squel['expr']();var _0x2e6668;if(_0x295124[_0xa6af('0x3c')][_0xa6af('0x59')]){_0x2e6668=as['parseSearch'](_0x295124['query'][_0xa6af('0x59')]);var _0x2ae81b=_0x2e6668['sqlOperator'];for(var _0x52f30a=0x0;_0x52f30a<_0x2e6668['conditions'][_0xa6af('0x5a')];_0x52f30a++){var _0x249ce9=_0x2e6668['conditions'][_0x52f30a];var _0x5cde39='i';var _0x418091=_[_0xa6af('0x5b')](_0x26d305,[_0xa6af('0x2c'),_0x249ce9[_0xa6af('0x48')]]);if(!_0x418091){switch(_0x249ce9[_0xa6af('0x48')]){case _0xa6af('0x5c'):if(_0x249ce9[_0xa6af('0x5d')]==0x1){_0x4d7e42[_0xa6af('0x5e')]('`'+_0x249ce9[_0xa6af('0x48')]+_0xa6af('0x5f'));}else{_0x4d7e42[_0xa6af('0x5e')]('`'+_0x249ce9[_0xa6af('0x48')]+_0xa6af('0x60'));}break;case _0xa6af('0x61'):if(_0x249ce9['operator']===_0xa6af('0x62')){if(_0x249ce9[_0xa6af('0x5d')]['split']('\x20')[_0xa6af('0x5a')]>0x1){_0x416a7b[_0x2ae81b](_0xa6af('0x63'),qs[_0xa6af('0x64')](_0x249ce9[_0xa6af('0x5d')]),null);}else{var _0x42bcd3='%'+_0x249ce9['value']+'%';_0x416a7b[_0x2ae81b]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x42bcd3,_0x42bcd3,_0x42bcd3);}}else{_0x418091=_['find'](_0x26d305,[_0xa6af('0x2c'),_0xa6af('0x65')]);_0x249ce9['field']='ContactId';_0x47120d=as['buildExpression'](_0x5cde39,_0x418091[_0xa6af('0x39')],_0x249ce9);_0x416a7b[_0x2ae81b](_0x47120d[_0xa6af('0x66')],_0x47120d[_0xa6af('0x5d')]['start'],_0x47120d[_0xa6af('0x5d')][_0xa6af('0x29')]);}break;case'Tag':var _0x2a2409=_0x249ce9['value'][_0xa6af('0x33')](',')[_0xa6af('0x2f')](function(_0xc16a74){return Number(_0xc16a74);});_0x2a2409[_0xa6af('0x67')](function(_0x379236){_0xf655d9['or'](_0xa6af('0x68'),'%,'+_0x379236+',%');});_0x415448=_['union'](_0x415448,_0x2a2409);break;case _0xa6af('0x69'):if(_0x249ce9['operator']==='$substring'){_0x416a7b[_0x2ae81b](_0xa6af('0x6a'),'%'+_0x249ce9[_0xa6af('0x5d')]+'%',null);}else{_0x418091=_[_0xa6af('0x5b')](_0x26d305,['name',_0xa6af('0x6b')]);_0x249ce9[_0xa6af('0x48')]='UserId';_0x47120d=as[_0xa6af('0x6c')](_0x5cde39,_0x418091['type'],_0x249ce9);_0x416a7b[_0x2ae81b](_0x47120d[_0xa6af('0x66')],_0x47120d[_0xa6af('0x5d')][_0xa6af('0x6d')],_0x47120d[_0xa6af('0x5d')]['end']);}break;case'body':_0x47120d=as[_0xa6af('0x6c')]('me',null,_0x249ce9);_0x416a7b[_0x2ae81b](_0x47120d[_0xa6af('0x66')],_0x47120d['value'][_0xa6af('0x6d')],_0x47120d[_0xa6af('0x5d')][_0xa6af('0x29')]);break;}}else{var _0x47120d=as[_0xa6af('0x6c')](_0x5cde39,_0x418091[_0xa6af('0x39')],_0x249ce9);_0x416a7b[_0x2ae81b](_0x47120d['text'],_0x47120d[_0xa6af('0x5d')][_0xa6af('0x6d')],_0x47120d[_0xa6af('0x5d')][_0xa6af('0x29')]);}}}else{var _0x557282=_(_0x295124[_0xa6af('0x3c')])['keys']()[_0xa6af('0x2f')](function(_0x1ac99a){return _[_0xa6af('0x6e')](_0x26d305,[_0xa6af('0x2c'),_0x1ac99a])?_0x1ac99a:undefined;})['compact']()[_0xa6af('0x5d')]();if(!_[_0xa6af('0x6f')](_0x557282)){_0x557282[_0xa6af('0x67')](function(_0xc08ff5){if(_0xc08ff5===_0xa6af('0x70')){_0x4d7e42[_0xa6af('0x45')](_0xa6af('0x71'),[][_0xa6af('0x72')](_0x295124[_0xa6af('0x3c')][_0xc08ff5]));}else if(_0xc08ff5===_0xa6af('0x73')){var _0x31bcd4=JSON[_0xa6af('0x74')](_0x295124['query'][_0xc08ff5])[_0xa6af('0x75')];var _0x183c85=JSON[_0xa6af('0x74')](_0x295124[_0xa6af('0x3c')][_0xc08ff5])[_0xa6af('0x76')];_0x4d7e42[_0xa6af('0x45')](_0xa6af('0x77'),_0x31bcd4,_0x183c85);}else{if(_0x295124['query'][_0xc08ff5]===_0xa6af('0x78')){_0x4d7e42['where']('i.'+_0xc08ff5+_0xa6af('0x79'));}else{_0x4d7e42['where']('i.'+_0xc08ff5+_0xa6af('0x7a'),_0x295124['query'][_0xc08ff5]);}}});}if(_0x295124[_0xa6af('0x3c')][_0xa6af('0x7b')]){if(_0x295124['query'][_0xa6af('0x7b')]==0x1){_0x4d7e42[_0xa6af('0x5e')]('`unreadMessages`\x20=\x200');}else{_0x4d7e42[_0xa6af('0x5e')]('`unreadMessages`\x20>\x200');}}if(_0x295124[_0xa6af('0x3c')][_0xa6af('0x7c')]){_0x415448=_['isArray'](_0x295124['query']['tag'])?_0x295124['query']['tag']:new Array(_0x295124[_0xa6af('0x3c')][_0xa6af('0x7c')]);_0x415448[_0xa6af('0x67')](function(_0xe28855){_0xf655d9['or'](_0xa6af('0x68'),'%,'+_0xe28855+',%');});}if(_0x295124['query'][_0xa6af('0x7d')]){var _0x2fb4ef=_0x295124[_0xa6af('0x3c')][_0xa6af('0x7d')][_0xa6af('0x7e')]('\x5c','\x5c\x5c')[_0xa6af('0x7e')](/'/g,'\x27\x27');if(qs[_0xa6af('0x7f')](_0x2fb4ef)){_0x416a7b['or'](_0xa6af('0x80'),_0x2fb4ef+'%')['or'](_0xa6af('0x81'),_0x2fb4ef+'%');}_0x416a7b['or'](_0xa6af('0x82'),_0x2fb4ef+'%');}}_0x4d7e42[_0xa6af('0x45')](_0x416a7b);_0x4d7e42['group'](_0xa6af('0x83'));var _0x1712b3={'type':db[_0xa6af('0x84')][_0xa6af('0x85')]['SELECT'],'raw':!![]};var _0x5ba409=_0x4d7e42[_0xa6af('0x86')]();_0x5ba409[_0xa6af('0x48')](_0xa6af('0x83'));_0x5ba409[_0xa6af('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa6af('0x5c'));if(_0x105313['order']){_0x105313[_0xa6af('0x43')][_0xa6af('0x67')](function(_0x171de7){var _0x5db2ac=_0x171de7[0x0]===_0xa6af('0x87')?_0x171de7[0x0]:'i.'+_0x171de7[0x0];_0x4d7e42[_0xa6af('0x43')](_0x5db2ac,_0x171de7[0x1]===_0xa6af('0x88')?![]:!![]);});}if(!_[_0xa6af('0x6f')](_0x415448)){_0x4d7e42[_0xa6af('0x5e')](_0xf655d9);_0x5ba409['where'](_0xa6af('0x89'),_0x415448);}BPromise[_0xa6af('0x8a')]()[_0xa6af('0x27')](function(){if(!_0x2e6668){if(_0x295124[_0xa6af('0x3c')][_0xa6af('0x70')])return;_0x5ba409[_0xa6af('0x45')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x4d7e42[_0xa6af('0x45')](_0xa6af('0x8b'));return;}if(_0x295124[_0xa6af('0x8c')][_0xa6af('0x8d')]!=='agent')return;return _0x295124['user'][_0xa6af('0x8e')]({'attributes':['id'],'raw':!![]})['then'](function(_0x47c656){if(_[_0xa6af('0x6f')](_0x47c656)){_0x5ba409[_0xa6af('0x45')]('i.FaxAccountId\x20IS\x20NULL');_0x4d7e42[_0xa6af('0x45')](_0xa6af('0x8f'));}else{_0x5ba409[_0xa6af('0x45')](_0xa6af('0x71'),_[_0xa6af('0x2f')](_0x47c656,'id'));_0x4d7e42['where']('i.FaxAccountId\x20IN\x20?',_['map'](_0x47c656,'id'));}});})[_0xa6af('0x27')](function(){if(_0x295124['user'][_0xa6af('0x8d')]==='agent'&&!_0x2e6668&&!_0x295124[_0xa6af('0x3c')][_0xa6af('0x70')])return[];return db[_0xa6af('0x90')][_0xa6af('0x3c')](_0x5ba409[_0xa6af('0x91')](),_0x1712b3);})[_0xa6af('0x27')](function(_0x528a0d){_0x433256[_0xa6af('0x20')]=_0x528a0d[_0xa6af('0x5a')];if(_0x433256[_0xa6af('0x20')]===0x0)return[];return db[_0xa6af('0x90')][_0xa6af('0x3c')](_0x24b842[_0xa6af('0x91')](),_0x1712b3)[_0xa6af('0x27')](function(_0x3422d3){_0x295496=_[_0xa6af('0x92')](_0x3422d3,'id');_0x1712b3=_[_0xa6af('0x93')](_0x1712b3,{'model':db[_0xa6af('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x295124['query']['fields']){_0x105313['attributes'][_0xa6af('0x67')](function(_0x708abc){_0x4d7e42['field']('i.'+_0x708abc);});}else{_0x4d7e42[_0xa6af('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x4d7e42['field'](_0xa6af('0x94'),_0xa6af('0x95'));_0x4d7e42[_0xa6af('0x48')](_0xa6af('0x96'),'Account.mandatoryDisposition');_0x4d7e42[_0xa6af('0x48')](_0xa6af('0x97'),'contactName');_0x4d7e42[_0xa6af('0x48')](_0xa6af('0x98'));_0x4d7e42['field'](_0xa6af('0x99'),_0xa6af('0x9a'));_0x4d7e42[_0xa6af('0x48')]('c.lastName','Contact.lastName');_0x4d7e42['field'](_0xa6af('0x9b'),_0xa6af('0x9c'));_0x4d7e42[_0xa6af('0x48')](_0xa6af('0x9d'),'Contact.phone');_0x4d7e42[_0xa6af('0x48')](_0xa6af('0x9e'),_0xa6af('0x9f'));_0x4d7e42[_0xa6af('0x48')](_0xa6af('0xa0'),_0xa6af('0xa1'));_0x4d7e42[_0xa6af('0x48')](_0xa6af('0xa2'),_0xa6af('0xa3'));_0x4d7e42['field'](_0xa6af('0xa4'),'Owner.internal');_0x4d7e42[_0xa6af('0x48')](_0xa6af('0xa5'),_0xa6af('0x32'));}if(_0x105313[_0xa6af('0x22')])_0x4d7e42[_0xa6af('0x22')](_0x105313[_0xa6af('0x22')]);if(_0x105313[_0xa6af('0x21')])_0x4d7e42['offset'](_0x105313[_0xa6af('0x21')]);return db[_0xa6af('0x90')][_0xa6af('0x3c')](_0x4d7e42[_0xa6af('0x91')](),_0x1712b3);})['then'](function(_0x2289a4){if(_0x2289a4[_0xa6af('0x5a')]>0x0)_0x53cc4f[_0xa6af('0x45')](_0xa6af('0xa6'),_[_0xa6af('0x2f')](_0x2289a4,'id'));return db['sequelize'][_0xa6af('0x3c')](_0x53cc4f[_0xa6af('0x91')](),_0x1712b3)[_0xa6af('0x27')](function(_0x22591a){var _0x4214a5=_['groupBy'](_0x22591a,_0xa6af('0xa7'));var _0x12664d=[];_0x2289a4['forEach'](function(_0x2f371d){_0x12664d[_0xa6af('0x34')](updateFaxInteraction(_0x2f371d,_0x295496,_0x4214a5));});return BPromise['all'](_0x12664d);});});})[_0xa6af('0x27')](function(_0x1b6c86){_0x433256[_0xa6af('0xa8')]=_0x1b6c86;return _0x433256;})[_0xa6af('0x27')](respondWithFilteredResult(_0x8f9f8e,_0x105313))[_0xa6af('0x35')](handleError(_0x8f9f8e,null));};exports[_0xa6af('0xa9')]=function(_0x1892af,_0x4309d9){var _0x13fecd={'raw':![],'where':{'id':_0x1892af[_0xa6af('0xaa')]['id']}},_0x34bf5d={};_0x34bf5d[_0xa6af('0x3b')]=_[_0xa6af('0xab')](db[_0xa6af('0x37')][_0xa6af('0xac')]);_0x34bf5d['query']=_[_0xa6af('0xab')](_0x1892af[_0xa6af('0x3c')]);_0x34bf5d[_0xa6af('0x3d')]=_[_0xa6af('0x3e')](_0x34bf5d[_0xa6af('0x3b')],_0x34bf5d[_0xa6af('0x3c')]);_0x13fecd[_0xa6af('0x3f')]=_['intersection'](_0x34bf5d[_0xa6af('0x3b')],qs[_0xa6af('0x40')](_0x1892af['query'][_0xa6af('0x40')]));_0x13fecd[_0xa6af('0x3f')]=_0x13fecd[_0xa6af('0x3f')][_0xa6af('0x5a')]?_0x13fecd[_0xa6af('0x3f')]:_0x34bf5d[_0xa6af('0x3b')];if(_0x1892af['query']['includeAll']){_0x13fecd[_0xa6af('0xad')]=[{'all':!![]}];}_0x13fecd=_[_0xa6af('0x93')]({},_0x13fecd,_0x1892af[_0xa6af('0xae')]);return db[_0xa6af('0x37')]['find'](_0x13fecd)['then'](handleEntityNotFound(_0x4309d9,null))['then'](respondWithResult(_0x4309d9,null))[_0xa6af('0x35')](handleError(_0x4309d9,null));};exports[_0xa6af('0xaf')]=function(_0x373045,_0x2d6630){return db['FaxInteraction'][_0xa6af('0xaf')](_0x373045['body'],{})['then'](respondWithResult(_0x2d6630,0xc9))[_0xa6af('0x35')](handleError(_0x2d6630,null));};exports['update']=function(_0x197dd2,_0x38a3a9){if(_0x197dd2[_0xa6af('0xb0')]['id']){delete _0x197dd2[_0xa6af('0xb0')]['id'];}return db[_0xa6af('0x37')][_0xa6af('0x5b')]({'where':{'id':_0x197dd2[_0xa6af('0xaa')]['id']}})['then'](handleEntityNotFound(_0x38a3a9,null))['then'](saveUpdates(_0x197dd2[_0xa6af('0xb0')],null))['then'](respondWithResult(_0x38a3a9,null))['catch'](handleError(_0x38a3a9,null));};exports[_0xa6af('0x28')]=function(_0x437b06,_0x283fed){return db['FaxInteraction']['find']({'where':{'id':_0x437b06[_0xa6af('0xaa')]['id']}})[_0xa6af('0x27')](handleEntityNotFound(_0x283fed,null))['then'](removeEntity(_0x283fed,null))['catch'](handleError(_0x283fed,null));};exports['describe']=function(_0x1b181d,_0xdef564){return db[_0xa6af('0x37')][_0xa6af('0xb1')]()[_0xa6af('0x27')](respondWithResult(_0xdef564,null))[_0xa6af('0x35')](handleError(_0xdef564,null));};exports['addMessage']=function(_0xb4cb31,_0x57ceda,_0x57f9d0){return db[_0xa6af('0xb2')][_0xa6af('0x5b')]({'where':{'id':_0xb4cb31['params']['id']}})[_0xa6af('0x27')](handleEntityNotFound(_0x57ceda,null))[_0xa6af('0x27')](function(_0x1b172b){if(_0x1b172b){return _0x1b172b['addMessage'](_0xb4cb31['body'][_0xa6af('0xb3')],_[_0xa6af('0xb4')](_0xb4cb31[_0xa6af('0xb0')],[_0xa6af('0xb3'),'id'])||{});}})[_0xa6af('0x27')](respondWithResult(_0x57ceda,null))['catch'](handleError(_0x57ceda,null));};exports[_0xa6af('0xb5')]=function(_0x588de3,_0x53c5de,_0x171344){var _0x4670ac={'raw':![],'where':{}};var _0x9958f6={};var _0x176151={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xa6af('0xb6')]({'where':{'id':_0x588de3[_0xa6af('0xaa')]['id']}})[_0xa6af('0x27')](handleEntityNotFound(_0x53c5de,null))[_0xa6af('0x27')](function(_0x2c39de){if(_0x2c39de){_0x9958f6[_0xa6af('0x3b')]=_[_0xa6af('0xab')](db[_0xa6af('0xb2')][_0xa6af('0xac')]);_0x9958f6[_0xa6af('0x3c')]=_['keys'](_0x588de3['query']);_0x9958f6[_0xa6af('0x3d')]=_['intersection'](_0x9958f6[_0xa6af('0x3b')],_0x9958f6[_0xa6af('0x3c')]);_0x4670ac['attributes']=_[_0xa6af('0x3e')](_0x9958f6[_0xa6af('0x3b')],qs[_0xa6af('0x40')](_0x588de3[_0xa6af('0x3c')][_0xa6af('0x40')]));_0x4670ac[_0xa6af('0x3f')]=_0x4670ac[_0xa6af('0x3f')][_0xa6af('0x5a')]?_0x4670ac['attributes']:_0x9958f6[_0xa6af('0x3b')];if(!_0x588de3[_0xa6af('0x3c')][_0xa6af('0x41')](_0xa6af('0x42'))){_0x4670ac[_0xa6af('0x22')]=qs[_0xa6af('0x22')](_0x588de3[_0xa6af('0x3c')]['limit']);_0x4670ac['offset']=qs[_0xa6af('0x21')](_0x588de3[_0xa6af('0x3c')][_0xa6af('0x21')]);}_0x4670ac[_0xa6af('0x43')]=qs[_0xa6af('0x44')](_0x588de3[_0xa6af('0x3c')]['sort']);_0x4670ac[_0xa6af('0x45')]=qs[_0xa6af('0x3d')](_['pick'](_0x588de3[_0xa6af('0x3c')],_0x9958f6[_0xa6af('0x3d')]));_0x4670ac['where'][_0xa6af('0xa7')]=_0x2c39de['id'];if(_0x588de3[_0xa6af('0x3c')][_0xa6af('0x7d')]){_0x4670ac['where']=_[_0xa6af('0x93')](_0x4670ac[_0xa6af('0x45')],{'$or':_[_0xa6af('0x2f')](_0x4670ac[_0xa6af('0x3f')],function(_0x2cfa70){var _0x367468={};_0x367468[_0x2cfa70]={'$like':'%'+_0x588de3['query']['filter']+'%'};return _0x367468;})});}if(_0x588de3[_0xa6af('0x3c')][_0xa6af('0x75')]){var _0x234e36=_0x588de3['query'][_0xa6af('0x75')]['split'](',');var _0x2457b6={};_0x2457b6[_0x234e36[0x0]]={'$gte':moment(_0x234e36[0x1])['format'](_0xa6af('0xb7'))};_0x4670ac[_0xa6af('0x45')]=_[_0xa6af('0x93')](_0x4670ac[_0xa6af('0x45')],_0x2457b6);}_0x4670ac=_['merge']({},_0x4670ac,_0x588de3[_0xa6af('0xae')]);return db[_0xa6af('0xb2')]['count']({'where':_0x4670ac[_0xa6af('0x45')]})[_0xa6af('0x27')](function(_0x1d8754){_0x176151['count']=_0x1d8754;if(_0x588de3[_0xa6af('0x3c')][_0xa6af('0xb8')]){_0x4670ac[_0xa6af('0xad')]=[{'all':!![]}];}return db['FaxMessage'][_0xa6af('0xb9')](_0x4670ac);})['then'](function(_0x1c7bb8){_0x176151[_0xa6af('0xa8')]=_0x1c7bb8;return _0x176151;});}})['then'](respondWithFilteredResult(_0x53c5de,_0x4670ac))[_0xa6af('0x35')](handleError(_0x53c5de,null));};exports[_0xa6af('0xba')]=function(_0x467236,_0x1c7aaf,_0x2b20a8){return db['FaxInteraction'][_0xa6af('0x5b')]({'where':{'id':_0x467236[_0xa6af('0xaa')]['id']}})[_0xa6af('0x27')](handleEntityNotFound(_0x1c7aaf,null))[_0xa6af('0x27')](function(_0x1af13a){if(_0x1af13a){return _0x1af13a[_0xa6af('0xbb')](_0x467236[_0xa6af('0xb0')][_0xa6af('0xb3')],_[_0xa6af('0xb4')](_0x467236[_0xa6af('0xb0')],[_0xa6af('0xb3'),'id'])||{})[_0xa6af('0xbc')](function(){return db[_0xa6af('0xbd')][_0xa6af('0xb9')]({'attributes':['id',_0xa6af('0x2c'),_0xa6af('0xbe')],'where':{'id':_0x467236[_0xa6af('0xb0')][_0xa6af('0xb3')]}});})[_0xa6af('0x27')](function(_0x1dd01e){socket[_0xa6af('0xbf')](_0xa6af('0xc0'),{'id':Number(_0x467236['params']['id']),'tags':_0x1dd01e||[]});return{'id':Number(_0x467236['params']['id']),'tags':_0x1dd01e||[]};});}})[_0xa6af('0x27')](respondWithResult(_0x1c7aaf,null))['catch'](handleError(_0x1c7aaf,null));};exports['removeTags']=function(_0x66a9d3,_0x325372,_0x1fad59){return db[_0xa6af('0x37')][_0xa6af('0x5b')]({'where':{'id':_0x66a9d3[_0xa6af('0xaa')]['id']}})[_0xa6af('0x27')](handleEntityNotFound(_0x325372,null))['then'](function(_0x5742ff){if(_0x5742ff){return _0x5742ff[_0xa6af('0xc1')](_0x66a9d3[_0xa6af('0x3c')][_0xa6af('0xb3')]);}})['then'](respondWithStatusCode(_0x325372,null))[_0xa6af('0x35')](handleError(_0x325372,null));};exports[_0xa6af('0xc2')]=function(_0x51d336,_0x531172){var _0x2c12b8=moment()[_0xa6af('0xc3')]()[_0xa6af('0x91')]();var _0x156274=path[_0xa6af('0xc4')](config[_0xa6af('0xc5')],_0xa6af('0xc6'),_0xa6af('0xc7'),_0xa6af('0xc8'));var _0x3734ae=path[_0xa6af('0xc4')](config[_0xa6af('0xc5')],'server',_0xa6af('0xc7'),_0xa6af('0xc9'));var _0x3a4a05=path[_0xa6af('0xc4')](_0x156274,_0x2c12b8);var _0x259674=util[_0xa6af('0xca')]('transcript-%d-%s.zip',_0x51d336[_0xa6af('0xaa')]['id'],_0x2c12b8);var _0x5cdc76=path[_0xa6af('0xc4')](_0x156274,_0x259674);var _0x117d95=[];_0x117d95[_0xa6af('0x34')]({'model':db[_0xa6af('0xcb')],'as':_0xa6af('0xcb'),'raw':!![]});var _0x298c71=[{'model':db[_0xa6af('0xb2')],'as':_0xa6af('0xcc'),'attributes':['id','body',_0xa6af('0x73')],'include':_0x117d95}];return db[_0xa6af('0x37')][_0xa6af('0x5b')]({'where':{'id':_0x51d336['params']['id']},'include':_0x298c71})['then'](handleEntityNotFound(_0x531172,null))['then'](function(_0x6f9a74){if(_0x6f9a74&&_0x6f9a74[_0xa6af('0xcc')]){var _0x318923=_0x6f9a74['get']({'plain':!![]});fs[_0xa6af('0xcd')](_0x3a4a05);for(var _0x7f6572=0x0;_0x7f6572<_0x318923[_0xa6af('0xcc')][_0xa6af('0x5a')];_0x7f6572++){var _0x56b1f3=_0x318923[_0xa6af('0xcc')][_0x7f6572][_0xa6af('0xcb')];if(_0x56b1f3){var _0x5d2198=path[_0xa6af('0xc4')](_0x3734ae,_0x56b1f3['basename']);if(fs[_0xa6af('0xce')](_0x5d2198)){fs[_0xa6af('0xcf')](_0x5d2198)['pipe'](fs['createWriteStream'](path[_0xa6af('0xc4')](_0x3a4a05,_0x56b1f3[_0xa6af('0xd0')])));}}}return BPromise[_0xa6af('0x8a')]()[_0xa6af('0x27')](function(){return new BPromise(function(_0x53a544,_0x1d696c){zipdir(_0x3a4a05,{'saveTo':_0x5cdc76},function(_0x1ba562,_0xf080fa){if(_0x1ba562)return _0x1d696c(_0x1ba562);return _0x53a544(_0xf080fa);});})[_0xa6af('0x27')](function(){return new BPromise(function(_0x1fa9ec,_0x55981d){rimraf(_0x3a4a05,function(_0xb5a94){if(_0xb5a94)_0x55981d(_0xb5a94);return _0x1fa9ec();});});})[_0xa6af('0x27')](function(){return _0x531172[_0xa6af('0xc2')](_0x5cdc76,_0x259674,function(_0x34b38c){if(_0x34b38c){console[_0xa6af('0xd1')](_0xa6af('0xd2'),_0x34b38c);}else{fs['unlinkSync'](_0x5cdc76);}});});});}else{return _0x531172[_0xa6af('0x1c')](0xc8);}})[_0xa6af('0x35')](handleError(_0x531172,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 96c7d20..34ae7df 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 _0x5f6a=['map','findAll','emit','hasOwnProperty','hook','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x5f6a,0x137));var _0xa5f6=function(_0x354e90,_0x164614){_0x354e90=_0x354e90-0x0;var _0x262a79=_0x5f6a[_0x354e90];return _0x262a79;};'use strict';var EventEmitter=require(_0xa5f6('0x0'));var FaxInteraction=require(_0xa5f6('0x1'))['db'][_0xa5f6('0x2')];var FaxMessage=require(_0xa5f6('0x1'))['db'][_0xa5f6('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xa5f6('0x4')](0x0);var events={'afterCreate':_0xa5f6('0x5'),'afterUpdate':_0xa5f6('0x6'),'afterDestroy':_0xa5f6('0x7')};function emitEvent(_0x11edd3){return function(_0x50d663,_0x19fe55,_0xa24d32){_0x50d663[_0xa5f6('0x8')]({'attributes':['id'],'raw':!![]})[_0xa5f6('0x9')](function(_0x21f535){_0x50d663[_0xa5f6('0xa')](_0xa5f6('0xb'),_0x21f535[_0xa5f6('0xc')](function(_0x28906c){return{'id':_0x28906c['id']};}));return FaxMessage[_0xa5f6('0xd')]({'where':{'FaxInteractionId':_0x50d663['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x20c65c){_0x50d663[_0xa5f6('0xa')]('unreadMessages',_0x20c65c['length']);FaxInteractionEvents['emit'](_0x11edd3+':'+_0x50d663['id'],_0x50d663);FaxInteractionEvents[_0xa5f6('0xe')](_0x11edd3,_0x50d663);_0xa24d32(null);})['catch'](_0xa24d32(null));};}for(var e in events){if(events[_0xa5f6('0xf')](e)){var event=events[e];FaxInteraction[_0xa5f6('0x10')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0x5f70=['FaxMessage','save','update','remove','then','setDataValue','map','findAll','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x48f5b9,_0x174e61){var _0x2161aa=function(_0x555e7b){while(--_0x555e7b){_0x48f5b9['push'](_0x48f5b9['shift']());}};_0x2161aa(++_0x174e61);}(_0x5f70,0x1ed));var _0x05f7=function(_0x20c6cd,_0x5ac47a){_0x20c6cd=_0x20c6cd-0x0;var _0x4c4fd8=_0x5f70[_0x20c6cd];return _0x4c4fd8;};'use strict';var EventEmitter=require(_0x05f7('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0x05f7('0x1'))['db'][_0x05f7('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x05f7('0x3'),'afterUpdate':_0x05f7('0x4'),'afterDestroy':_0x05f7('0x5')};function emitEvent(_0x32efb0){return function(_0x38d48b,_0xb82eae,_0xc125ab){_0x38d48b['getUsers']({'attributes':['id'],'raw':!![]})[_0x05f7('0x6')](function(_0x1b5046){_0x38d48b[_0x05f7('0x7')]('Users',_0x1b5046[_0x05f7('0x8')](function(_0x14400b){return{'id':_0x14400b['id']};}));return FaxMessage[_0x05f7('0x9')]({'where':{'FaxInteractionId':_0x38d48b['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4918f5){_0x38d48b[_0x05f7('0x7')]('unreadMessages',_0x4918f5[_0x05f7('0xa')]);FaxInteractionEvents['emit'](_0x32efb0+':'+_0x38d48b['id'],_0x38d48b);FaxInteractionEvents[_0x05f7('0xb')](_0x32efb0,_0x38d48b);_0xc125ab(null);})[_0x05f7('0xc')](_0xc125ab(null));};}for(var e in events){if(events[_0x05f7('0xd')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x05f7('0xe')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 58a521f..5671aff 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 _0x5919=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','FaxInteraction','fax_interactions','changed'];(function(_0x2fedd3,_0x457b72){var _0x123f2b=function(_0x100404){while(--_0x100404){_0x2fedd3['push'](_0x2fedd3['shift']());}};_0x123f2b(++_0x457b72);}(_0x5919,0x198));var _0x9591=function(_0x168113,_0x462638){_0x168113=_0x168113-0x0;var _0x3e60cf=_0x5919[_0x168113];return _0x3e60cf;};'use strict';var _=require(_0x9591('0x0'));var util=require('util');var logger=require(_0x9591('0x1'))(_0x9591('0x2'));var moment=require(_0x9591('0x3'));var BPromise=require(_0x9591('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9591('0x5'));var rimraf=require(_0x9591('0x6'));var config=require(_0x9591('0x7'));var attributes=require('./faxInteraction.attributes');module[_0x9591('0x8')]=function(_0x2483a3,_0x218340){return _0x2483a3['define'](_0x9591('0x9'),attributes,{'tableName':_0x9591('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x26d1a8,_0x5deaa9,_0x39f609){if(_0x26d1a8[_0x9591('0xb')]('closed')){_0x26d1a8[_0x9591('0xc')]=moment()[_0x9591('0xd')](_0x9591('0xe'));}_0x39f609(null,_0x26d1a8);}}});}; \ No newline at end of file +var _0x635b=['util','../../config/logger','api','moment','bluebird','rimraf','./faxInteraction.attributes','fax_interactions','changed','closed','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5498d4,_0x386162){var _0x12b7f7=function(_0x5d9c16){while(--_0x5d9c16){_0x5498d4['push'](_0x5498d4['shift']());}};_0x12b7f7(++_0x386162);}(_0x635b,0xdc));var _0xb635=function(_0x417b9e,_0x2bdcff){_0x417b9e=_0x417b9e-0x0;var _0x449719=_0x635b[_0x417b9e];return _0x449719;};'use strict';var _=require('lodash');var util=require(_0xb635('0x0'));var logger=require(_0xb635('0x1'))(_0xb635('0x2'));var moment=require(_0xb635('0x3'));var BPromise=require(_0xb635('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb635('0x5'));var config=require('../../config/environment');var attributes=require(_0xb635('0x6'));module['exports']=function(_0x52379a,_0x1b045d){return _0x52379a['define']('FaxInteraction',attributes,{'tableName':_0xb635('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x345153,_0x2313a8,_0x6c87a0){if(_0x345153[_0xb635('0x8')](_0xb635('0x9'))){_0x345153['closedAt']=moment()['format'](_0xb635('0xa'));}_0x6c87a0(null,_0x345153);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 6f08b91..2e85600 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 _0x7ea6=['request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','addTags','ids','omit','AddTags','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','register'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x7ea6,0x1a0));var _0x67ea=function(_0x312d9a,_0x5e894d){_0x312d9a=_0x312d9a-0x0;var _0x6fdfd9=_0x7ea6[_0x312d9a];return _0x6fdfd9;};'use strict';var _=require(_0x67ea('0x0'));var util=require(_0x67ea('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x67ea('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x67ea('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x67ea('0x4'))(_0x67ea('0x5'));var config=require('../../config/environment');var jayson=require(_0x67ea('0x6'));var client=jayson[_0x67ea('0x7')][_0x67ea('0x8')]({'port':0x232a});config['redis']=_[_0x67ea('0x9')](config[_0x67ea('0xa')],{'host':_0x67ea('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxInteraction.socket')[_0x67ea('0xc')](socket);function respondWithRpcPromise(_0x529217,_0x3454eb,_0x7f0547){return new BPromise(function(_0x4323f3,_0x17353c){return client[_0x67ea('0xd')](_0x529217,_0x7f0547)[_0x67ea('0xe')](function(_0x3aad57){logger[_0x67ea('0xf')](_0x67ea('0x10'),_0x3454eb,_0x67ea('0x11'));logger[_0x67ea('0x12')](_0x67ea('0x13'),_0x3454eb,_0x67ea('0x11'),JSON[_0x67ea('0x14')](_0x3aad57));if(_0x3aad57[_0x67ea('0x15')]){if(_0x3aad57[_0x67ea('0x15')][_0x67ea('0x16')]===0x1f4){logger[_0x67ea('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x3454eb,_0x3aad57['error'][_0x67ea('0x17')]);return _0x17353c(_0x3aad57[_0x67ea('0x15')][_0x67ea('0x17')]);}logger[_0x67ea('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x3454eb,_0x3aad57[_0x67ea('0x15')][_0x67ea('0x17')]);return _0x4323f3(_0x3aad57['error'][_0x67ea('0x17')]);}else{logger[_0x67ea('0xf')](_0x67ea('0x10'),_0x3454eb,_0x67ea('0x11'));_0x4323f3(_0x3aad57[_0x67ea('0x18')][_0x67ea('0x17')]);}})[_0x67ea('0x19')](function(_0x330947){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x3454eb,_0x330947);_0x17353c(_0x330947);});});}exports[_0x67ea('0x1a')]=function(_0x5cbf2c){var _0xfc8c38=this;return new Promise(function(_0x9f268e,_0x2f8bc9){return db[_0x67ea('0x1b')][_0x67ea('0x1c')](_0x5cbf2c[_0x67ea('0x1d')],{'raw':_0x5cbf2c[_0x67ea('0x1e')]?_0x5cbf2c[_0x67ea('0x1e')][_0x67ea('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5cbf2c['options']?_0x5cbf2c[_0x67ea('0x1e')][_0x67ea('0x20')]||null:null,'attributes':_0x5cbf2c[_0x67ea('0x1e')]?_0x5cbf2c['options'][_0x67ea('0x21')]||null:null,'limit':_0x5cbf2c['options']?_0x5cbf2c['options'][_0x67ea('0x22')]||null:null})[_0x67ea('0xe')](function(_0x51e261){logger[_0x67ea('0xf')](_0x67ea('0x1a'),_0x5cbf2c);logger[_0x67ea('0x12')](_0x67ea('0x1a'),_0x5cbf2c,JSON['stringify'](_0x51e261));_0x9f268e(_0x51e261);})[_0x67ea('0x19')](function(_0x274d5c){logger[_0x67ea('0x15')](_0x67ea('0x1a'),_0x274d5c[_0x67ea('0x17')],_0x5cbf2c);_0x2f8bc9(_0xfc8c38[_0x67ea('0x15')](0x1f4,_0x274d5c[_0x67ea('0x17')]));});});};exports['AddTagsToFaxInteraction']=function(_0x584882){return new Promise(function(_0x59c5e9,_0x4e6d2f){return db[_0x67ea('0x1b')]['find']({'where':_0x584882[_0x67ea('0x1e')]?_0x584882[_0x67ea('0x1e')][_0x67ea('0x20')]||null:null})['then'](function(_0x5f0ce4){if(_0x5f0ce4){return _0x5f0ce4[_0x67ea('0x23')](_0x584882['body'][_0x67ea('0x24')],_[_0x67ea('0x25')](_0x584882[_0x67ea('0x1d')],[_0x67ea('0x24'),'id'])||{});}})['spread'](function(_0x48ca58){logger['info']('AddTags',_0x584882);logger[_0x67ea('0x12')](_0x67ea('0x26'),_0x584882,JSON[_0x67ea('0x14')](_0x48ca58));_0x59c5e9(_0x48ca58);})['catch'](function(_0x52935f){logger[_0x67ea('0x15')](_0x67ea('0x26'),_0x52935f[_0x67ea('0x17')],_0x584882);_0x4e6d2f(_this[_0x67ea('0x15')](0x1f4,_0x52935f[_0x67ea('0x17')]));});});}; \ No newline at end of file +var _0xc470=['UpdateFaxInteraction','FaxInteraction','body','options','raw','where','limit','AddTagsToFaxInteraction','find','ids','spread','stringify','AddTags','lodash','util','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','redis','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch'];(function(_0x5cc9d5,_0x4edc95){var _0x2a7696=function(_0x2cc3f9){while(--_0x2cc3f9){_0x5cc9d5['push'](_0x5cc9d5['shift']());}};_0x2a7696(++_0x4edc95);}(_0xc470,0x7f));var _0x0c47=function(_0x5c86f8,_0x584d10){_0x5c86f8=_0x5c86f8-0x0;var _0x161119=_0xc470[_0x5c86f8];return _0x161119;};'use strict';var _=require(_0x0c47('0x0'));var util=require(_0x0c47('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c47('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c47('0x3'))(_0x0c47('0x4'));var config=require(_0x0c47('0x5'));var jayson=require(_0x0c47('0x6'));var client=jayson[_0x0c47('0x7')][_0x0c47('0x8')]({'port':0x232a});config['redis']=_[_0x0c47('0x9')](config['redis'],{'host':_0x0c47('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0c47('0xb')]));require(_0x0c47('0xc'))[_0x0c47('0xd')](socket);function respondWithRpcPromise(_0x3db6d4,_0x2d9741,_0x2ae583){return new BPromise(function(_0x28e8b4,_0x258eff){return client[_0x0c47('0xe')](_0x3db6d4,_0x2ae583)[_0x0c47('0xf')](function(_0x30cbbd){logger[_0x0c47('0x10')](_0x0c47('0x11'),_0x2d9741,'request\x20sent');logger[_0x0c47('0x12')](_0x0c47('0x13'),_0x2d9741,_0x0c47('0x14'),JSON['stringify'](_0x30cbbd));if(_0x30cbbd[_0x0c47('0x15')]){if(_0x30cbbd[_0x0c47('0x15')][_0x0c47('0x16')]===0x1f4){logger[_0x0c47('0x15')](_0x0c47('0x11'),_0x2d9741,_0x30cbbd['error']['message']);return _0x258eff(_0x30cbbd[_0x0c47('0x15')][_0x0c47('0x17')]);}logger[_0x0c47('0x15')](_0x0c47('0x11'),_0x2d9741,_0x30cbbd['error'][_0x0c47('0x17')]);return _0x28e8b4(_0x30cbbd[_0x0c47('0x15')]['message']);}else{logger[_0x0c47('0x10')](_0x0c47('0x11'),_0x2d9741,_0x0c47('0x14'));_0x28e8b4(_0x30cbbd['result'][_0x0c47('0x17')]);}})[_0x0c47('0x18')](function(_0x2e5131){logger[_0x0c47('0x15')](_0x0c47('0x11'),_0x2d9741,_0x2e5131);_0x258eff(_0x2e5131);});});}exports[_0x0c47('0x19')]=function(_0xb6a361){var _0x3dba46=this;return new Promise(function(_0x44c866,_0x54eea0){return db[_0x0c47('0x1a')]['update'](_0xb6a361[_0x0c47('0x1b')],{'raw':_0xb6a361['options']?_0xb6a361[_0x0c47('0x1c')][_0x0c47('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb6a361[_0x0c47('0x1c')]?_0xb6a361[_0x0c47('0x1c')][_0x0c47('0x1e')]||null:null,'attributes':_0xb6a361[_0x0c47('0x1c')]?_0xb6a361[_0x0c47('0x1c')]['attributes']||null:null,'limit':_0xb6a361['options']?_0xb6a361[_0x0c47('0x1c')][_0x0c47('0x1f')]||null:null})[_0x0c47('0xf')](function(_0xac2d34){logger[_0x0c47('0x10')](_0x0c47('0x19'),_0xb6a361);logger[_0x0c47('0x12')](_0x0c47('0x19'),_0xb6a361,JSON['stringify'](_0xac2d34));_0x44c866(_0xac2d34);})[_0x0c47('0x18')](function(_0x16aba3){logger[_0x0c47('0x15')](_0x0c47('0x19'),_0x16aba3['message'],_0xb6a361);_0x54eea0(_0x3dba46[_0x0c47('0x15')](0x1f4,_0x16aba3[_0x0c47('0x17')]));});});};exports[_0x0c47('0x20')]=function(_0x127a6a){return new Promise(function(_0x5f0e54,_0x364244){return db[_0x0c47('0x1a')][_0x0c47('0x21')]({'where':_0x127a6a[_0x0c47('0x1c')]?_0x127a6a[_0x0c47('0x1c')][_0x0c47('0x1e')]||null:null})[_0x0c47('0xf')](function(_0x374cf8){if(_0x374cf8){return _0x374cf8['addTags'](_0x127a6a[_0x0c47('0x1b')]['ids'],_['omit'](_0x127a6a[_0x0c47('0x1b')],[_0x0c47('0x22'),'id'])||{});}})[_0x0c47('0x23')](function(_0x7efe59){logger[_0x0c47('0x10')]('AddTags',_0x127a6a);logger[_0x0c47('0x12')]('AddTags',_0x127a6a,JSON[_0x0c47('0x24')](_0x7efe59));_0x5f0e54(_0x7efe59);})[_0x0c47('0x18')](function(_0x50a813){logger[_0x0c47('0x15')](_0x0c47('0x25'),_0x50a813[_0x0c47('0x17')],_0x127a6a);_0x364244(_this[_0x0c47('0x15')](0x1f4,_0x50a813['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index da7f1bf..2b140b8 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 _0x830d=['length','faxInteraction:','./faxInteraction.events','save','remove','update','emit'];(function(_0x22e9fe,_0x3d019f){var _0x47cd19=function(_0x8fd5fc){while(--_0x8fd5fc){_0x22e9fe['push'](_0x22e9fe['shift']());}};_0x47cd19(++_0x3d019f);}(_0x830d,0x11a));var _0xd830=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x830d[_0x20a584];return _0x4b41a8;};'use strict';var FaxInteractionEvents=require(_0xd830('0x0'));var events=[_0xd830('0x1'),_0xd830('0x2'),_0xd830('0x3')];function createListener(_0x1c082a,_0x228e38){return function(_0x96dbac){_0x228e38[_0xd830('0x4')](_0x1c082a,_0x96dbac);};}function removeListener(_0x482e35,_0x47c192){return function(){FaxInteractionEvents['removeListener'](_0x482e35,_0x47c192);};}exports['register']=function(_0x37dd76){for(var _0x4be586=0x0,_0x286dd2=events[_0xd830('0x5')];_0x4be586<_0x286dd2;_0x4be586++){var _0x36edfc=events[_0x4be586];var _0x409be5=createListener(_0xd830('0x6')+_0x36edfc,_0x37dd76);FaxInteractionEvents['on'](_0x36edfc,_0x409be5);}}; \ No newline at end of file +var _0x3ba2=['length','faxInteraction:','save','remove','update','emit','removeListener','register'];(function(_0x40d5a0,_0x4f01db){var _0x1dcda4=function(_0x5049b6){while(--_0x5049b6){_0x40d5a0['push'](_0x40d5a0['shift']());}};_0x1dcda4(++_0x4f01db);}(_0x3ba2,0x192));var _0x23ba=function(_0x1f4d01,_0x51a86c){_0x1f4d01=_0x1f4d01-0x0;var _0xe31fa0=_0x3ba2[_0x1f4d01];return _0xe31fa0;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x23ba('0x0'),_0x23ba('0x1'),_0x23ba('0x2')];function createListener(_0x1468a1,_0x6499ce){return function(_0x3506f9){_0x6499ce[_0x23ba('0x3')](_0x1468a1,_0x3506f9);};}function removeListener(_0x18f00a,_0x553ad8){return function(){FaxInteractionEvents[_0x23ba('0x4')](_0x18f00a,_0x553ad8);};}exports[_0x23ba('0x5')]=function(_0x54c8d0){for(var _0x3e7bde=0x0,_0x11f23e=events[_0x23ba('0x6')];_0x3e7bde<_0x11f23e;_0x3e7bde++){var _0x26ceb9=events[_0x3e7bde];var _0x4a7a57=createListener(_0x23ba('0x7')+_0x26ceb9,_0x54c8d0);FaxInteractionEvents['on'](_0x26ceb9,_0x4a7a57);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 1f2ee4a..df5ec23 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 _0xf849=['create','addMessage','/:id/tags','fax','faxinteraction:addtags','tracked','faxinteraction:update','delete','destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','./faxInteraction.controller','index','isAuthenticated','get','/:id','show','/:id/messages','getMessages','/:id/download','download','post'];(function(_0x3d2438,_0x2e7922){var _0xd18de5=function(_0xe8a130){while(--_0xe8a130){_0x3d2438['push'](_0x3d2438['shift']());}};_0xd18de5(++_0x2e7922);}(_0xf849,0x193));var _0x9f84=function(_0x210977,_0x1216d2){_0x210977=_0x210977-0x0;var _0x248ccb=_0xf849[_0x210977];return _0x248ccb;};'use strict';var multer=require(_0x9f84('0x0'));var util=require(_0x9f84('0x1'));var path=require(_0x9f84('0x2'));var timeout=require('connect-timeout');var express=require(_0x9f84('0x3'));var router=express[_0x9f84('0x4')]();var fs_extra=require(_0x9f84('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9f84('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x9f84('0x7')]);router['get']('/describe',auth[_0x9f84('0x8')](),controller['describe']);router[_0x9f84('0x9')](_0x9f84('0xa'),auth[_0x9f84('0x8')](),controller[_0x9f84('0xb')]);router[_0x9f84('0x9')](_0x9f84('0xc'),auth[_0x9f84('0x8')](),controller[_0x9f84('0xd')]);router[_0x9f84('0x9')](_0x9f84('0xe'),auth[_0x9f84('0x8')](),controller[_0x9f84('0xf')]);router[_0x9f84('0x10')]('/',auth[_0x9f84('0x8')](),controller[_0x9f84('0x11')]);router[_0x9f84('0x10')]('/:id/messages',auth[_0x9f84('0x8')](),controller[_0x9f84('0x12')]);router[_0x9f84('0x10')](_0x9f84('0x13'),auth[_0x9f84('0x8')](),interaction['tracked'](_0x9f84('0x14'),_0x9f84('0x15')),controller['addTags']);router['put'](_0x9f84('0xa'),auth[_0x9f84('0x8')](),interaction[_0x9f84('0x16')](_0x9f84('0x14'),_0x9f84('0x17')),controller['update']);router[_0x9f84('0x18')](_0x9f84('0xa'),auth['isAuthenticated'](),interaction[_0x9f84('0x16')](_0x9f84('0x14'),'faxinteraction:destroy'),controller[_0x9f84('0x19')]);router['delete']('/:id/tags',auth[_0x9f84('0x8')](),controller[_0x9f84('0x1a')]);module[_0x9f84('0x1b')]=router; \ No newline at end of file +var _0xebbd=['destroy','delete','removeTags','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','post','create','/:id/tags','tracked','fax','addTags','put','faxinteraction:update','update'];(function(_0x13778a,_0x208106){var _0x118d66=function(_0x20d415){while(--_0x20d415){_0x13778a['push'](_0x13778a['shift']());}};_0x118d66(++_0x208106);}(_0xebbd,0x196));var _0xdebb=function(_0x4cf9dc,_0x44d771){_0x4cf9dc=_0x4cf9dc-0x0;var _0x26fe05=_0xebbd[_0x4cf9dc];return _0x26fe05;};'use strict';var multer=require('multer');var util=require(_0xdebb('0x0'));var path=require(_0xdebb('0x1'));var timeout=require(_0xdebb('0x2'));var express=require(_0xdebb('0x3'));var router=express[_0xdebb('0x4')]();var fs_extra=require(_0xdebb('0x5'));var auth=require(_0xdebb('0x6'));var interaction=require(_0xdebb('0x7'));var config=require(_0xdebb('0x8'));var controller=require(_0xdebb('0x9'));router[_0xdebb('0xa')]('/',auth[_0xdebb('0xb')](),controller[_0xdebb('0xc')]);router[_0xdebb('0xa')](_0xdebb('0xd'),auth[_0xdebb('0xb')](),controller[_0xdebb('0xe')]);router[_0xdebb('0xa')](_0xdebb('0xf'),auth[_0xdebb('0xb')](),controller[_0xdebb('0x10')]);router['get'](_0xdebb('0x11'),auth[_0xdebb('0xb')](),controller['getMessages']);router[_0xdebb('0xa')](_0xdebb('0x12'),auth[_0xdebb('0xb')](),controller['download']);router[_0xdebb('0x13')]('/',auth['isAuthenticated'](),controller[_0xdebb('0x14')]);router['post'](_0xdebb('0x11'),auth[_0xdebb('0xb')](),controller['addMessage']);router[_0xdebb('0x13')](_0xdebb('0x15'),auth['isAuthenticated'](),interaction[_0xdebb('0x16')](_0xdebb('0x17'),'faxinteraction:addtags'),controller[_0xdebb('0x18')]);router[_0xdebb('0x19')]('/:id',auth[_0xdebb('0xb')](),interaction['tracked'](_0xdebb('0x17'),_0xdebb('0x1a')),controller[_0xdebb('0x1b')]);router['delete']('/:id',auth[_0xdebb('0xb')](),interaction[_0xdebb('0x16')](_0xdebb('0x17'),'faxinteraction:destroy'),controller[_0xdebb('0x1c')]);router[_0xdebb('0x1d')](_0xdebb('0x15'),auth[_0xdebb('0xb')](),controller[_0xdebb('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index cbc8b89..559205a 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 _0x4d9e=['TEXT','sequelize','medium','ENUM','out'];(function(_0x57a944,_0x5b95c8){var _0x8cdd27=function(_0x450068){while(--_0x450068){_0x57a944['push'](_0x57a944['shift']());}};_0x8cdd27(++_0x5b95c8);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x320df3,_0x4fff16){_0x320df3=_0x320df3-0x0;var _0x4762fd=_0x4d9e[_0x320df3];return _0x4762fd;};'use strict';var Sequelize=require(_0xe4d9('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xe4d9('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xe4d9('0x2')]('in','out'),'defaultValue':_0xe4d9('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xe4d9('0x4')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x0eaa=['BOOLEAN','ENUM','out','TEXT','DATE','sequelize','exports'];(function(_0x1a029c,_0x37d8dd){var _0x3daf0b=function(_0x45a0c7){while(--_0x45a0c7){_0x1a029c['push'](_0x1a029c['shift']());}};_0x3daf0b(++_0x37d8dd);}(_0x0eaa,0x1c5));var _0xa0ea=function(_0x41a769,_0x9ced54){_0x41a769=_0x41a769-0x0;var _0x2e4c3e=_0x0eaa[_0x41a769];return _0x2e4c3e;};'use strict';var Sequelize=require(_0xa0ea('0x0'));module[_0xa0ea('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xa0ea('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa0ea('0x3')]('in','out'),'defaultValue':_0xa0ea('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xa0ea('0x5')],'defaultValue':null},'readAt':{'type':Sequelize[_0xa0ea('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 4802e43..008fd8f 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 _0xa7e1=['read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','contact','User','email','manual','interface','format','channel','motionChannel','event','EventManager','acceptmessage','../../config/logger','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','fullname','internal','create','CmContact','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','root','server','files','attachments','Attachment','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options','FaxMessage','includeAll','include','findAll','find','body','params','describe','fax-interactions','accept','fax'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xa7e1,0xc7));var _0x1a7e=function(_0x1af7f3,_0x36885d){_0x1af7f3=_0x1af7f3-0x0;var _0x33667e=_0xa7e1[_0x1af7f3];return _0x33667e;};'use strict';var emlformat=require(_0x1a7e('0x0'));var rimraf=require(_0x1a7e('0x1'));var zipdir=require(_0x1a7e('0x2'));var jsonpatch=require(_0x1a7e('0x3'));var rp=require(_0x1a7e('0x4'));var moment=require('moment');var BPromise=require(_0x1a7e('0x5'));var Mustache=require(_0x1a7e('0x6'));var util=require(_0x1a7e('0x7'));var path=require(_0x1a7e('0x8'));var sox=require(_0x1a7e('0x9'));var csv=require('to-csv');var ejs=require(_0x1a7e('0xa'));var fs=require('fs');var fs_extra=require(_0x1a7e('0xb'));var _=require(_0x1a7e('0xc'));var squel=require(_0x1a7e('0xd'));var crypto=require(_0x1a7e('0xe'));var jsforce=require(_0x1a7e('0xf'));var deskjs=require(_0x1a7e('0x10'));var toCsv=require(_0x1a7e('0x11'));var querystring=require(_0x1a7e('0x12'));var Papa=require(_0x1a7e('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1a7e('0x14'));var hardwareService=require(_0x1a7e('0x15'));var logger=require('../../config/logger')(_0x1a7e('0x16'));var utils=require(_0x1a7e('0x17'));var config=require(_0x1a7e('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x1a7e('0x19')]=_[_0x1a7e('0x1a')](config['redis'],{'host':_0x1a7e('0x1b'),'port':0x18eb});var socket=require(_0x1a7e('0x1c'))(new Redis(config['redis']));require(_0x1a7e('0x1d'))[_0x1a7e('0x1e')](socket);var jayson=require(_0x1a7e('0x1f'));var client=jayson[_0x1a7e('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x1a7e('0x20')][_0x1a7e('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x30b505,_0x253f4b,_0x1025d4,_0x492e2c){return new BPromise(function(_0x1884eb,_0x59a231){var _0x27aabd=_0x492e2c||client;return _0x27aabd[_0x1a7e('0x22')](_0x30b505,_0x1025d4)[_0x1a7e('0x23')](function(_0x13039b){logger[_0x1a7e('0x24')](_0x1a7e('0x25'),_0x253f4b,'request\x20sent');logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x253f4b,'request\x20sent',JSON[_0x1a7e('0x26')](_0x13039b));if(_0x13039b['error']){if(_0x13039b[_0x1a7e('0x27')][_0x1a7e('0x28')]===0x1f4){logger[_0x1a7e('0x27')](_0x1a7e('0x25'),_0x253f4b,_0x13039b[_0x1a7e('0x27')]['message']);return _0x59a231(_0x13039b['error']['message']);}logger[_0x1a7e('0x27')](_0x1a7e('0x25'),_0x253f4b,_0x13039b[_0x1a7e('0x27')][_0x1a7e('0x29')]);return _0x1884eb(_0x13039b[_0x1a7e('0x27')][_0x1a7e('0x29')]);}else{logger[_0x1a7e('0x24')](_0x1a7e('0x25'),_0x253f4b,_0x1a7e('0x2a'));_0x1884eb(_0x13039b[_0x1a7e('0x2b')][_0x1a7e('0x29')]);}})[_0x1a7e('0x2c')](function(_0x5bfa50){logger['error'](_0x1a7e('0x25'),_0x253f4b,_0x5bfa50);_0x59a231(_0x5bfa50);});});}function respondWithStatusCode(_0x40b5d2,_0x501e10){_0x501e10=_0x501e10||0xcc;return function(_0x15571c){if(_0x15571c){return _0x40b5d2[_0x1a7e('0x2d')](_0x501e10);}return _0x40b5d2[_0x1a7e('0x2e')](_0x501e10)[_0x1a7e('0x2f')]();};}function respondWithResult(_0x653ce,_0x3b372c){_0x3b372c=_0x3b372c||0xc8;return function(_0x38d229){if(_0x38d229){return _0x653ce[_0x1a7e('0x2e')](_0x3b372c)[_0x1a7e('0x30')](_0x38d229);}};}function respondWithFilteredResult(_0x37e53b,_0x36fed0){return function(_0x8ba3c7){if(_0x8ba3c7){var _0x20854b=typeof _0x36fed0[_0x1a7e('0x31')]===_0x1a7e('0x32')&&typeof _0x36fed0[_0x1a7e('0x33')]===_0x1a7e('0x32');var _0x2f9ddb=_0x8ba3c7['count'];var _0x3dd91b=_0x20854b?0x0:_0x36fed0[_0x1a7e('0x31')];var _0x4bb578=_0x20854b?_0x8ba3c7[_0x1a7e('0x34')]:_0x36fed0[_0x1a7e('0x31')]+_0x36fed0[_0x1a7e('0x33')];var _0x359908;if(_0x4bb578>=_0x2f9ddb){_0x4bb578=_0x2f9ddb;_0x359908=0xc8;}else{_0x359908=0xce;}_0x37e53b['status'](_0x359908);return _0x37e53b[_0x1a7e('0x35')](_0x1a7e('0x36'),_0x3dd91b+'-'+_0x4bb578+'/'+_0x2f9ddb)[_0x1a7e('0x30')](_0x8ba3c7);}return null;};}function patchUpdates(_0x334e64){return function(_0x3390cf){try{jsonpatch['apply'](_0x3390cf,_0x334e64,!![]);}catch(_0x1c9943){return BPromise[_0x1a7e('0x37')](_0x1c9943);}return _0x3390cf['save']();};}function saveUpdates(_0x15068c,_0x2d0731){return function(_0x3c7b50){if(_0x3c7b50){return _0x3c7b50[_0x1a7e('0x38')](_0x15068c)[_0x1a7e('0x23')](function(_0x2b1c6b){return _0x2b1c6b;});}return null;};}function removeEntity(_0x512161,_0x3290fa){return function(_0x330fed){if(_0x330fed){return _0x330fed[_0x1a7e('0x39')]()[_0x1a7e('0x23')](function(){_0x512161[_0x1a7e('0x2e')](0xcc)[_0x1a7e('0x2f')]();});}};}function handleEntityNotFound(_0x102785,_0x96e4ee){return function(_0x4b37b3){if(!_0x4b37b3){_0x102785[_0x1a7e('0x2d')](0x194);}return _0x4b37b3;};}function handleError(_0x5018e9,_0x7e18ac){_0x7e18ac=_0x7e18ac||0x1f4;return function(_0x442b89){logger['error'](_0x442b89[_0x1a7e('0x3a')]);if(_0x442b89[_0x1a7e('0x3b')]){delete _0x442b89['name'];}_0x5018e9[_0x1a7e('0x2e')](_0x7e18ac)[_0x1a7e('0x3c')](_0x442b89);};}exports['index']=function(_0x4bdd2a,_0x1c6934){var _0x4a856d={},_0x341cb5={},_0xc59128={'count':0x0,'rows':[]};var _0x599ced=_[_0x1a7e('0x3d')](db['FaxMessage'][_0x1a7e('0x3e')],function(_0x16835a){return{'name':_0x16835a[_0x1a7e('0x3f')],'type':_0x16835a[_0x1a7e('0x40')][_0x1a7e('0x41')]};});_0x341cb5[_0x1a7e('0x42')]=_[_0x1a7e('0x3d')](_0x599ced,_0x1a7e('0x3b'));_0x341cb5[_0x1a7e('0x43')]=_[_0x1a7e('0x44')](_0x4bdd2a['query']);_0x341cb5['filters']=_[_0x1a7e('0x45')](_0x341cb5[_0x1a7e('0x42')],_0x341cb5[_0x1a7e('0x43')]);_0x4a856d[_0x1a7e('0x46')]=_['intersection'](_0x341cb5[_0x1a7e('0x42')],qs['fields'](_0x4bdd2a[_0x1a7e('0x43')][_0x1a7e('0x47')]));_0x4a856d['attributes']=_0x4a856d[_0x1a7e('0x46')][_0x1a7e('0x48')]?_0x4a856d[_0x1a7e('0x46')]:_0x341cb5[_0x1a7e('0x42')];if(!_0x4bdd2a[_0x1a7e('0x43')]['hasOwnProperty'](_0x1a7e('0x49'))){_0x4a856d['limit']=qs[_0x1a7e('0x33')](_0x4bdd2a['query'][_0x1a7e('0x33')]);_0x4a856d[_0x1a7e('0x31')]=qs['offset'](_0x4bdd2a[_0x1a7e('0x43')][_0x1a7e('0x31')]);}_0x4a856d['order']=qs[_0x1a7e('0x4a')](_0x4bdd2a[_0x1a7e('0x43')][_0x1a7e('0x4a')]);_0x4a856d[_0x1a7e('0x4b')]=qs[_0x1a7e('0x4c')](_[_0x1a7e('0x4d')](_0x4bdd2a[_0x1a7e('0x43')],_0x341cb5['filters']),_0x599ced);if(_0x4bdd2a[_0x1a7e('0x43')]['filter']){_0x4a856d['where']=_[_0x1a7e('0x4e')](_0x4a856d[_0x1a7e('0x4b')],{'$or':_[_0x1a7e('0x3d')](_0x599ced,function(_0x5a6c34){if(_0x5a6c34[_0x1a7e('0x40')]!==_0x1a7e('0x4f')){var _0x483da2={};_0x483da2[_0x5a6c34[_0x1a7e('0x3b')]]={'$like':'%'+_0x4bdd2a[_0x1a7e('0x43')][_0x1a7e('0x50')]+'%'};return _0x483da2;}})});}_0x4a856d=_[_0x1a7e('0x4e')]({},_0x4a856d,_0x4bdd2a[_0x1a7e('0x51')]);var _0x1329de={'where':_0x4a856d[_0x1a7e('0x4b')]};return db[_0x1a7e('0x52')]['count'](_0x1329de)['then'](function(_0x4a037f){_0xc59128[_0x1a7e('0x34')]=_0x4a037f;if(_0x4bdd2a['query'][_0x1a7e('0x53')]){_0x4a856d[_0x1a7e('0x54')]=[{'all':!![]}];}return db['FaxMessage'][_0x1a7e('0x55')](_0x4a856d);})[_0x1a7e('0x23')](function(_0x29c7f9){_0xc59128['rows']=_0x29c7f9;return _0xc59128;})[_0x1a7e('0x23')](respondWithFilteredResult(_0x1c6934,_0x4a856d))['catch'](handleError(_0x1c6934,null));};exports['show']=function(_0x1e7f52,_0x5ef05b){var _0x2e90d0={'raw':!![],'where':{'id':_0x1e7f52['params']['id']}},_0x572b79={};_0x572b79[_0x1a7e('0x42')]=_['keys'](db['FaxMessage'][_0x1a7e('0x3e')]);_0x572b79[_0x1a7e('0x43')]=_['keys'](_0x1e7f52[_0x1a7e('0x43')]);_0x572b79[_0x1a7e('0x4c')]=_[_0x1a7e('0x45')](_0x572b79[_0x1a7e('0x42')],_0x572b79[_0x1a7e('0x43')]);_0x2e90d0[_0x1a7e('0x46')]=_['intersection'](_0x572b79['model'],qs[_0x1a7e('0x47')](_0x1e7f52['query'][_0x1a7e('0x47')]));_0x2e90d0[_0x1a7e('0x46')]=_0x2e90d0[_0x1a7e('0x46')]['length']?_0x2e90d0['attributes']:_0x572b79['model'];if(_0x1e7f52['query'][_0x1a7e('0x53')]){_0x2e90d0[_0x1a7e('0x54')]=[{'all':!![]}];}_0x2e90d0=_['merge']({},_0x2e90d0,_0x1e7f52[_0x1a7e('0x51')]);return db[_0x1a7e('0x52')][_0x1a7e('0x56')](_0x2e90d0)[_0x1a7e('0x23')](handleEntityNotFound(_0x5ef05b,null))[_0x1a7e('0x23')](respondWithResult(_0x5ef05b,null))['catch'](handleError(_0x5ef05b,null));};exports['update']=function(_0x1422e2,_0x265c82){if(_0x1422e2[_0x1a7e('0x57')]['id']){delete _0x1422e2[_0x1a7e('0x57')]['id'];}return db[_0x1a7e('0x52')]['find']({'where':{'id':_0x1422e2[_0x1a7e('0x58')]['id']}})[_0x1a7e('0x23')](handleEntityNotFound(_0x265c82,null))['then'](saveUpdates(_0x1422e2[_0x1a7e('0x57')],null))[_0x1a7e('0x23')](respondWithResult(_0x265c82,null))[_0x1a7e('0x2c')](handleError(_0x265c82,null));};exports[_0x1a7e('0x39')]=function(_0x10e1d0,_0x12473a){return db[_0x1a7e('0x52')][_0x1a7e('0x56')]({'where':{'id':_0x10e1d0[_0x1a7e('0x58')]['id']}})[_0x1a7e('0x23')](handleEntityNotFound(_0x12473a,null))[_0x1a7e('0x23')](removeEntity(_0x12473a,null))[_0x1a7e('0x2c')](handleError(_0x12473a,null));};exports['describe']=function(_0x2cee7d,_0x455498){return db[_0x1a7e('0x52')][_0x1a7e('0x59')]()[_0x1a7e('0x23')](respondWithResult(_0x455498,null))[_0x1a7e('0x2c')](handleError(_0x455498,null));};var interaction_log=require('../../config/logger')(_0x1a7e('0x5a'));exports[_0x1a7e('0x5b')]=function(_0x22914a,_0x3b97ce,_0x4234ae){var _0x39826a={'agent':{},'channel':_0x1a7e('0x5c')};if(_0x22914a[_0x1a7e('0x57')]['id']){delete _0x22914a['body']['id'];}_0x22914a['body'][_0x1a7e('0x5d')]=!![];_0x22914a['body'][_0x1a7e('0x5e')]=moment()['format'](_0x1a7e('0x5f'));_0x22914a['body'][_0x1a7e('0x60')]=_0x22914a[_0x1a7e('0x57')][_0x1a7e('0x60')]||_0x22914a[_0x1a7e('0x61')]['id'];_0x39826a[_0x1a7e('0x62')]['id']=_0x22914a[_0x1a7e('0x57')]['UserId'];return db[_0x1a7e('0x52')][_0x1a7e('0x56')]({'where':{'id':_0x22914a[_0x1a7e('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3b97ce,null))[_0x1a7e('0x23')](saveUpdates(_0x22914a[_0x1a7e('0x57')],null))['then'](function(_0xea7fe2){if(_0xea7fe2){_0x39826a[_0x1a7e('0x29')]=_0xea7fe2[_0x1a7e('0x63')]({'plain':!![]});return db[_0x1a7e('0x64')]['find']({'where':{'id':_0xea7fe2[_0x1a7e('0x65')]}});}return null;})[_0x1a7e('0x23')](handleEntityNotFound(_0x3b97ce,null))[_0x1a7e('0x23')](function(_0x435c40){if(_0x435c40){return _0x435c40[_0x1a7e('0x38')]({'UserId':_0x22914a[_0x1a7e('0x57')][_0x1a7e('0x60')],'read1stAt':_[_0x1a7e('0x66')](_0x435c40[_0x1a7e('0x67')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x1a7e('0x23')](function(_0x515838){if(_0x515838){_0x39826a[_0x1a7e('0x68')]=_0x515838['get']({'plain':!![]});interaction_log[_0x1a7e('0x24')](_0x1a7e('0x69'),_0x22914a[_0x1a7e('0x61')]['id'],_0x22914a[_0x1a7e('0x61')][_0x1a7e('0x3b')],_0x22914a[_0x1a7e('0x61')][_0x1a7e('0x6a')],_0x39826a[_0x1a7e('0x68')]['id'],_0x22914a['body']?JSON[_0x1a7e('0x26')](_0x22914a[_0x1a7e('0x57')]):_0x1a7e('0x6b'));return respondWithRpcPromise(_0x1a7e('0x6c'),_0x1a7e('0x6d'),_0x39826a);}return null;})[_0x1a7e('0x23')](function(_0x465723){var _0x2e4ad7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x465723['message'][_0x1a7e('0x6e')];return db['sequelize'][_0x1a7e('0x43')](_0x2e4ad7,{'type':db[_0x1a7e('0x6f')][_0x1a7e('0x70')]['SELECT'],'raw':!![]})['then'](function(_0x468465){return _0x468465;});})['then'](function(_0x378262){if(_0x378262){_0x39826a[_0x1a7e('0x29')][_0x1a7e('0x71')]=_0x378262[0x0];if(!_0x22914a[_0x1a7e('0x57')]['UserId'])return;return db[_0x1a7e('0x72')]['find']({'where':{'id':_0x22914a[_0x1a7e('0x57')][_0x1a7e('0x60')],'role':_0x1a7e('0x62')},'attributes':['id','name','fullname',_0x1a7e('0x73'),'internal'],'raw':!![]});}return null;})[_0x1a7e('0x23')](function(_0x29c4cd){if(!_0x29c4cd)return null;_0x39826a[_0x1a7e('0x29')][_0x1a7e('0x62')]=_0x29c4cd;return _0x39826a;})[_0x1a7e('0x23')](function(_0xb24713){if(_0xb24713){if(_0x22914a[_0x1a7e('0x57')][_0x1a7e('0x74')]){_0x39826a[_0x1a7e('0x29')][_0x1a7e('0x75')]=util[_0x1a7e('0x76')]('SIP/%s',_0x22914a[_0x1a7e('0x61')]['name']);_0x39826a['message']['channel']=_0x39826a[_0x1a7e('0x77')];_0x39826a[_0x1a7e('0x29')][_0x1a7e('0x78')]=_0x39826a['channel'];_0x39826a[_0x1a7e('0x29')][_0x1a7e('0x79')]=_0x1a7e('0x5b');return respondWithRpcPromise(_0x1a7e('0x7a'),'EventManager',{'event':_0x1a7e('0x7b'),'message':_0x39826a['message']},client9002)[_0x1a7e('0x23')](function(){return _0x39826a;});}return _0x39826a;}return null;})[_0x1a7e('0x23')](respondWithResult(_0x3b97ce,null))['catch'](handleError(_0x3b97ce,null));};var interaction_log=require(_0x1a7e('0x7c'))('fax-interactions');exports[_0x1a7e('0x37')]=function(_0x165e09,_0x4cd2a8,_0x31d4dc){var _0x4a2548={'agent':{},'channel':_0x1a7e('0x5c')};if(_0x165e09[_0x1a7e('0x57')]['id']){delete _0x165e09[_0x1a7e('0x57')]['id'];}_0x165e09[_0x1a7e('0x57')][_0x1a7e('0x60')]=_0x165e09[_0x1a7e('0x57')][_0x1a7e('0x60')]||_0x165e09[_0x1a7e('0x61')]['id'];_0x4a2548['agent']['id']=_0x165e09['body']['UserId'];return db[_0x1a7e('0x52')][_0x1a7e('0x56')]({'where':{'id':_0x165e09['params']['id'],'UserId':null}})[_0x1a7e('0x23')](handleEntityNotFound(_0x4cd2a8,null))['then'](function(_0x24abef){if(_0x24abef){_0x4a2548[_0x1a7e('0x29')]=_0x24abef['get']({'plain':!![]});return db[_0x1a7e('0x64')]['find']({'where':{'id':_0x24abef['FaxInteractionId']}});}return null;})[_0x1a7e('0x23')](handleEntityNotFound(_0x4cd2a8,null))[_0x1a7e('0x23')](function(_0xbb2ba8){if(_0xbb2ba8){_0x4a2548[_0x1a7e('0x68')]=_0xbb2ba8['get']({'plain':!![]});interaction_log['info'](_0x1a7e('0x7d'),_0x165e09[_0x1a7e('0x61')]['id'],_0x165e09[_0x1a7e('0x61')][_0x1a7e('0x3b')],_0x165e09[_0x1a7e('0x61')]['role'],_0x4a2548['interaction']['id'],_0x165e09[_0x1a7e('0x57')]?JSON[_0x1a7e('0x26')](_0x165e09[_0x1a7e('0x57')]):_0x1a7e('0x6b'));return respondWithRpcPromise(_0x1a7e('0x7e'),_0x1a7e('0x7f'),_0x4a2548);}return null;})['then'](function(_0x29e22a){var _0x2425ac=_0x1a7e('0x80')+_0x29e22a[_0x1a7e('0x29')][_0x1a7e('0x6e')];return db['sequelize']['query'](_0x2425ac,{'type':db[_0x1a7e('0x6f')][_0x1a7e('0x70')][_0x1a7e('0x81')],'raw':!![]})[_0x1a7e('0x23')](function(_0x2bd0d8){return _0x2bd0d8;});})[_0x1a7e('0x23')](function(_0x332df7){if(_0x332df7){_0x4a2548[_0x1a7e('0x29')]['contact']=_0x332df7[0x0];if(!_0x165e09['body'][_0x1a7e('0x60')])return;return db[_0x1a7e('0x72')]['find']({'where':{'id':_0x165e09[_0x1a7e('0x57')]['UserId'],'role':_0x1a7e('0x62')},'attributes':['id',_0x1a7e('0x3b'),_0x1a7e('0x82'),_0x1a7e('0x73'),_0x1a7e('0x83')],'raw':!![]});}return null;})['then'](function(_0x4177be){if(!_0x4177be)return null;_0x4a2548['message']['agent']=_0x4177be;return _0x4a2548;})[_0x1a7e('0x23')](function(_0x3beca7){if(_0x3beca7){_0x3beca7[_0x1a7e('0x29')][_0x1a7e('0x75')]=util[_0x1a7e('0x76')]('SIP/%s',_0x165e09[_0x1a7e('0x61')][_0x1a7e('0x3b')]);_0x3beca7['message'][_0x1a7e('0x77')]=_0x4a2548['channel'];_0x3beca7[_0x1a7e('0x29')][_0x1a7e('0x78')]=_0x4a2548[_0x1a7e('0x77')];_0x3beca7['message'][_0x1a7e('0x79')]=_0x1a7e('0x37');respondWithRpcPromise('EventManager',_0x1a7e('0x7a'),{'event':'rejectmessage','message':_0x3beca7[_0x1a7e('0x29')]},client9002);return _0x4a2548;}return null;})[_0x1a7e('0x23')](respondWithResult(_0x4cd2a8,null))[_0x1a7e('0x2c')](handleError(_0x4cd2a8,null));};exports[_0x1a7e('0x84')]=function(_0x31a486,_0x11a7d6){var _0x19eb4a;return db[_0x1a7e('0x52')][_0x1a7e('0x84')](_0x31a486['body'],{})[_0x1a7e('0x23')](function(_0x2cfb13){_0x19eb4a=_0x2cfb13;return db[_0x1a7e('0x85')][_0x1a7e('0x86')]({'where':{'id':_0x19eb4a[_0x1a7e('0x6e')]}});})[_0x1a7e('0x23')](function(_0x352b1d){if(_[_0x1a7e('0x66')](_0x352b1d)){return;}else{_0x19eb4a['fax']=_0x352b1d['fax'];return db['Attachment'][_0x1a7e('0x86')]({'where':{'id':_0x19eb4a[_0x1a7e('0x87')]}});}})['then'](function(_0x31576c){return respondWithRpcPromise(_0x1a7e('0x88'),'SendFax',{'FaxAccountId':_[_0x1a7e('0x66')](_0x31a486['body'])?undefined:_0x31a486['body'][_0x1a7e('0x89')],'path':_[_0x1a7e('0x66')](_0x31576c)?undefined:util[_0x1a7e('0x76')](_0x1a7e('0x8a'),_0x31576c[_0x1a7e('0x8b')]),'fax':_['isNil'](_0x19eb4a[_0x1a7e('0x5c')])?undefined:_0x19eb4a['fax'],'AttachmentId':_0x19eb4a[_0x1a7e('0x87')]},client9002);})['then'](respondWithResult(_0x11a7d6,0xc9))[_0x1a7e('0x2c')](handleError(_0x11a7d6,null));};exports[_0x1a7e('0x8c')]=function(_0x2e0c4e,_0x51858d){var _0x4ec0ab=path['join'](config[_0x1a7e('0x8d')],_0x1a7e('0x8e'),_0x1a7e('0x8f'),_0x1a7e('0x90'));return db['FaxMessage'][_0x1a7e('0x56')]({'where':{'id':_0x2e0c4e[_0x1a7e('0x58')]['id']},'include':[{'model':db[_0x1a7e('0x91')],'as':_0x1a7e('0x91')}]})[_0x1a7e('0x23')](handleEntityNotFound(_0x51858d,null))[_0x1a7e('0x23')](function(_0x47e2ee){if(_0x47e2ee){return _0x51858d[_0x1a7e('0x8c')](path['join'](_0x4ec0ab,_0x47e2ee[_0x1a7e('0x91')][_0x1a7e('0x8b')]));}})[_0x1a7e('0x2c')](handleError(_0x51858d,null));}; \ No newline at end of file +var _0x2f7f=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','findAll','rows','catch','show','params','includeAll','include','find','body','describe','fax-interactions','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','fullname','internal','manual','SIP/%s','channel','event','accept','EventManager','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','sequelize','SELECT','contact','User','email','interface','rejectmessage','CmContact','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse'];(function(_0x565b00,_0x244a4c){var _0x1e9835=function(_0x5aa21e){while(--_0x5aa21e){_0x565b00['push'](_0x565b00['shift']());}};_0x1e9835(++_0x244a4c);}(_0x2f7f,0x83));var _0xf2f7=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x2f7f[_0x34843e];return _0x598f7f;};'use strict';var emlformat=require(_0xf2f7('0x0'));var rimraf=require(_0xf2f7('0x1'));var zipdir=require(_0xf2f7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf2f7('0x3'));var moment=require(_0xf2f7('0x4'));var BPromise=require(_0xf2f7('0x5'));var Mustache=require('mustache');var util=require(_0xf2f7('0x6'));var path=require(_0xf2f7('0x7'));var sox=require(_0xf2f7('0x8'));var csv=require(_0xf2f7('0x9'));var ejs=require(_0xf2f7('0xa'));var fs=require('fs');var fs_extra=require(_0xf2f7('0xb'));var _=require(_0xf2f7('0xc'));var squel=require(_0xf2f7('0xd'));var crypto=require('crypto');var jsforce=require(_0xf2f7('0xe'));var deskjs=require(_0xf2f7('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf2f7('0x10'));var Redis=require(_0xf2f7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf2f7('0x12'));var as=require(_0xf2f7('0x13'));var hardwareService=require(_0xf2f7('0x14'));var logger=require(_0xf2f7('0x15'))('api');var utils=require(_0xf2f7('0x16'));var config=require(_0xf2f7('0x17'));var licenseUtil=require(_0xf2f7('0x18'));var db=require(_0xf2f7('0x19'))['db'];config[_0xf2f7('0x1a')]=_['defaults'](config[_0xf2f7('0x1a')],{'host':_0xf2f7('0x1b'),'port':0x18eb});var socket=require(_0xf2f7('0x1c'))(new Redis(config['redis']));require(_0xf2f7('0x1d'))[_0xf2f7('0x1e')](socket);var jayson=require(_0xf2f7('0x1f'));var client=jayson[_0xf2f7('0x20')]['http']({'port':0x232c});var client9002=jayson[_0xf2f7('0x20')][_0xf2f7('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x59550c,_0xd58d9a,_0x2e7e9d,_0x2fcdc8){return new BPromise(function(_0x44dd66,_0x5432f5){var _0x5b2fd4=_0x2fcdc8||client;return _0x5b2fd4[_0xf2f7('0x22')](_0x59550c,_0x2e7e9d)['then'](function(_0x285fef){logger[_0xf2f7('0x23')]('FaxMessage,\x20%s,\x20%s',_0xd58d9a,_0xf2f7('0x24'));logger[_0xf2f7('0x25')](_0xf2f7('0x26'),_0xd58d9a,_0xf2f7('0x24'),JSON[_0xf2f7('0x27')](_0x285fef));if(_0x285fef[_0xf2f7('0x28')]){if(_0x285fef['error'][_0xf2f7('0x29')]===0x1f4){logger[_0xf2f7('0x28')](_0xf2f7('0x2a'),_0xd58d9a,_0x285fef[_0xf2f7('0x28')][_0xf2f7('0x2b')]);return _0x5432f5(_0x285fef[_0xf2f7('0x28')][_0xf2f7('0x2b')]);}logger[_0xf2f7('0x28')](_0xf2f7('0x2a'),_0xd58d9a,_0x285fef[_0xf2f7('0x28')]['message']);return _0x44dd66(_0x285fef[_0xf2f7('0x28')][_0xf2f7('0x2b')]);}else{logger['info'](_0xf2f7('0x2a'),_0xd58d9a,_0xf2f7('0x24'));_0x44dd66(_0x285fef[_0xf2f7('0x2c')][_0xf2f7('0x2b')]);}})['catch'](function(_0x200bf2){logger['error'](_0xf2f7('0x2a'),_0xd58d9a,_0x200bf2);_0x5432f5(_0x200bf2);});});}function respondWithStatusCode(_0x27eab3,_0x4f7a00){_0x4f7a00=_0x4f7a00||0xcc;return function(_0x51e2ba){if(_0x51e2ba){return _0x27eab3['sendStatus'](_0x4f7a00);}return _0x27eab3[_0xf2f7('0x2d')](_0x4f7a00)[_0xf2f7('0x2e')]();};}function respondWithResult(_0x518706,_0x1b368f){_0x1b368f=_0x1b368f||0xc8;return function(_0x252153){if(_0x252153){return _0x518706['status'](_0x1b368f)['json'](_0x252153);}};}function respondWithFilteredResult(_0x1b595b,_0xc6c374){return function(_0xa07f10){if(_0xa07f10){var _0x38250a=typeof _0xc6c374[_0xf2f7('0x2f')]==='undefined'&&typeof _0xc6c374[_0xf2f7('0x30')]===_0xf2f7('0x31');var _0x1f3bdf=_0xa07f10['count'];var _0x128b2c=_0x38250a?0x0:_0xc6c374[_0xf2f7('0x2f')];var _0x143094=_0x38250a?_0xa07f10[_0xf2f7('0x32')]:_0xc6c374[_0xf2f7('0x2f')]+_0xc6c374[_0xf2f7('0x30')];var _0x4b9c02;if(_0x143094>=_0x1f3bdf){_0x143094=_0x1f3bdf;_0x4b9c02=0xc8;}else{_0x4b9c02=0xce;}_0x1b595b[_0xf2f7('0x2d')](_0x4b9c02);return _0x1b595b['set'](_0xf2f7('0x33'),_0x128b2c+'-'+_0x143094+'/'+_0x1f3bdf)[_0xf2f7('0x34')](_0xa07f10);}return null;};}function patchUpdates(_0x5f0da8){return function(_0x439273){try{jsonpatch[_0xf2f7('0x35')](_0x439273,_0x5f0da8,!![]);}catch(_0x1e1cdf){return BPromise[_0xf2f7('0x36')](_0x1e1cdf);}return _0x439273[_0xf2f7('0x37')]();};}function saveUpdates(_0x2c6075,_0x32168c){return function(_0x29223a){if(_0x29223a){return _0x29223a[_0xf2f7('0x38')](_0x2c6075)[_0xf2f7('0x39')](function(_0x57e178){return _0x57e178;});}return null;};}function removeEntity(_0x374767,_0xc96bad){return function(_0x4e8157){if(_0x4e8157){return _0x4e8157['destroy']()[_0xf2f7('0x39')](function(){_0x374767[_0xf2f7('0x2d')](0xcc)[_0xf2f7('0x2e')]();});}};}function handleEntityNotFound(_0x3e2131,_0x3bcd87){return function(_0x4f7d98){if(!_0x4f7d98){_0x3e2131[_0xf2f7('0x3a')](0x194);}return _0x4f7d98;};}function handleError(_0x156237,_0x227619){_0x227619=_0x227619||0x1f4;return function(_0xff572e){logger['error'](_0xff572e[_0xf2f7('0x3b')]);if(_0xff572e[_0xf2f7('0x3c')]){delete _0xff572e[_0xf2f7('0x3c')];}_0x156237[_0xf2f7('0x2d')](_0x227619)[_0xf2f7('0x3d')](_0xff572e);};}exports[_0xf2f7('0x3e')]=function(_0x37550b,_0x54630c){var _0x17be6c={},_0x373aae={},_0x595070={'count':0x0,'rows':[]};var _0x2d5328=_[_0xf2f7('0x3f')](db[_0xf2f7('0x40')][_0xf2f7('0x41')],function(_0x3f33e0){return{'name':_0x3f33e0[_0xf2f7('0x42')],'type':_0x3f33e0['type']['key']};});_0x373aae[_0xf2f7('0x43')]=_[_0xf2f7('0x3f')](_0x2d5328,_0xf2f7('0x3c'));_0x373aae['query']=_[_0xf2f7('0x44')](_0x37550b[_0xf2f7('0x45')]);_0x373aae[_0xf2f7('0x46')]=_['intersection'](_0x373aae[_0xf2f7('0x43')],_0x373aae[_0xf2f7('0x45')]);_0x17be6c['attributes']=_[_0xf2f7('0x47')](_0x373aae['model'],qs[_0xf2f7('0x48')](_0x37550b[_0xf2f7('0x45')]['fields']));_0x17be6c[_0xf2f7('0x49')]=_0x17be6c[_0xf2f7('0x49')][_0xf2f7('0x4a')]?_0x17be6c['attributes']:_0x373aae['model'];if(!_0x37550b[_0xf2f7('0x45')][_0xf2f7('0x4b')](_0xf2f7('0x4c'))){_0x17be6c[_0xf2f7('0x30')]=qs[_0xf2f7('0x30')](_0x37550b[_0xf2f7('0x45')][_0xf2f7('0x30')]);_0x17be6c[_0xf2f7('0x2f')]=qs[_0xf2f7('0x2f')](_0x37550b['query']['offset']);}_0x17be6c[_0xf2f7('0x4d')]=qs[_0xf2f7('0x4e')](_0x37550b[_0xf2f7('0x45')]['sort']);_0x17be6c[_0xf2f7('0x4f')]=qs[_0xf2f7('0x46')](_[_0xf2f7('0x50')](_0x37550b[_0xf2f7('0x45')],_0x373aae[_0xf2f7('0x46')]),_0x2d5328);if(_0x37550b[_0xf2f7('0x45')][_0xf2f7('0x51')]){_0x17be6c[_0xf2f7('0x4f')]=_[_0xf2f7('0x52')](_0x17be6c['where'],{'$or':_['map'](_0x2d5328,function(_0x4abbeb){if(_0x4abbeb[_0xf2f7('0x53')]!==_0xf2f7('0x54')){var _0xe813db={};_0xe813db[_0x4abbeb[_0xf2f7('0x3c')]]={'$like':'%'+_0x37550b[_0xf2f7('0x45')][_0xf2f7('0x51')]+'%'};return _0xe813db;}})});}_0x17be6c=_[_0xf2f7('0x52')]({},_0x17be6c,_0x37550b['options']);var _0x43de16={'where':_0x17be6c['where']};return db[_0xf2f7('0x40')][_0xf2f7('0x32')](_0x43de16)[_0xf2f7('0x39')](function(_0x47ee2){_0x595070[_0xf2f7('0x32')]=_0x47ee2;if(_0x37550b['query']['includeAll']){_0x17be6c['include']=[{'all':!![]}];}return db[_0xf2f7('0x40')][_0xf2f7('0x55')](_0x17be6c);})[_0xf2f7('0x39')](function(_0x52f61e){_0x595070[_0xf2f7('0x56')]=_0x52f61e;return _0x595070;})[_0xf2f7('0x39')](respondWithFilteredResult(_0x54630c,_0x17be6c))[_0xf2f7('0x57')](handleError(_0x54630c,null));};exports[_0xf2f7('0x58')]=function(_0xa08157,_0x4a4a71){var _0x51d85e={'raw':!![],'where':{'id':_0xa08157[_0xf2f7('0x59')]['id']}},_0x596a35={};_0x596a35['model']=_['keys'](db[_0xf2f7('0x40')]['rawAttributes']);_0x596a35[_0xf2f7('0x45')]=_[_0xf2f7('0x44')](_0xa08157[_0xf2f7('0x45')]);_0x596a35['filters']=_[_0xf2f7('0x47')](_0x596a35[_0xf2f7('0x43')],_0x596a35[_0xf2f7('0x45')]);_0x51d85e[_0xf2f7('0x49')]=_[_0xf2f7('0x47')](_0x596a35[_0xf2f7('0x43')],qs[_0xf2f7('0x48')](_0xa08157[_0xf2f7('0x45')][_0xf2f7('0x48')]));_0x51d85e[_0xf2f7('0x49')]=_0x51d85e[_0xf2f7('0x49')][_0xf2f7('0x4a')]?_0x51d85e['attributes']:_0x596a35[_0xf2f7('0x43')];if(_0xa08157['query'][_0xf2f7('0x5a')]){_0x51d85e[_0xf2f7('0x5b')]=[{'all':!![]}];}_0x51d85e=_['merge']({},_0x51d85e,_0xa08157['options']);return db[_0xf2f7('0x40')][_0xf2f7('0x5c')](_0x51d85e)[_0xf2f7('0x39')](handleEntityNotFound(_0x4a4a71,null))[_0xf2f7('0x39')](respondWithResult(_0x4a4a71,null))[_0xf2f7('0x57')](handleError(_0x4a4a71,null));};exports['update']=function(_0x1bb7c7,_0x197f2a){if(_0x1bb7c7[_0xf2f7('0x5d')]['id']){delete _0x1bb7c7[_0xf2f7('0x5d')]['id'];}return db[_0xf2f7('0x40')][_0xf2f7('0x5c')]({'where':{'id':_0x1bb7c7[_0xf2f7('0x59')]['id']}})[_0xf2f7('0x39')](handleEntityNotFound(_0x197f2a,null))[_0xf2f7('0x39')](saveUpdates(_0x1bb7c7[_0xf2f7('0x5d')],null))['then'](respondWithResult(_0x197f2a,null))['catch'](handleError(_0x197f2a,null));};exports['destroy']=function(_0x3361f9,_0x52a0e7){return db[_0xf2f7('0x40')][_0xf2f7('0x5c')]({'where':{'id':_0x3361f9[_0xf2f7('0x59')]['id']}})[_0xf2f7('0x39')](handleEntityNotFound(_0x52a0e7,null))[_0xf2f7('0x39')](removeEntity(_0x52a0e7,null))[_0xf2f7('0x57')](handleError(_0x52a0e7,null));};exports[_0xf2f7('0x5e')]=function(_0x2149a1,_0x1385d1){return db[_0xf2f7('0x40')]['describe']()[_0xf2f7('0x39')](respondWithResult(_0x1385d1,null))[_0xf2f7('0x57')](handleError(_0x1385d1,null));};var interaction_log=require(_0xf2f7('0x15'))(_0xf2f7('0x5f'));exports['accept']=function(_0x3079c6,_0x3da799,_0x3f6e7b){var _0x229beb={'agent':{},'channel':_0xf2f7('0x60')};if(_0x3079c6[_0xf2f7('0x5d')]['id']){delete _0x3079c6[_0xf2f7('0x5d')]['id'];}_0x3079c6[_0xf2f7('0x5d')][_0xf2f7('0x61')]=!![];_0x3079c6['body']['readAt']=moment()[_0xf2f7('0x62')](_0xf2f7('0x63'));_0x3079c6[_0xf2f7('0x5d')]['UserId']=_0x3079c6[_0xf2f7('0x5d')][_0xf2f7('0x64')]||_0x3079c6[_0xf2f7('0x65')]['id'];_0x229beb[_0xf2f7('0x66')]['id']=_0x3079c6[_0xf2f7('0x5d')]['UserId'];return db['FaxMessage'][_0xf2f7('0x5c')]({'where':{'id':_0x3079c6[_0xf2f7('0x59')]['id'],'UserId':null}})[_0xf2f7('0x39')](handleEntityNotFound(_0x3da799,null))['then'](saveUpdates(_0x3079c6[_0xf2f7('0x5d')],null))[_0xf2f7('0x39')](function(_0x2e120a){if(_0x2e120a){_0x229beb[_0xf2f7('0x2b')]=_0x2e120a['get']({'plain':!![]});return db[_0xf2f7('0x67')][_0xf2f7('0x5c')]({'where':{'id':_0x2e120a[_0xf2f7('0x68')]}});}return null;})[_0xf2f7('0x39')](handleEntityNotFound(_0x3da799,null))[_0xf2f7('0x39')](function(_0xd57e09){if(_0xd57e09){return _0xd57e09['update']({'UserId':_0x3079c6[_0xf2f7('0x5d')]['UserId'],'read1stAt':_[_0xf2f7('0x69')](_0xd57e09[_0xf2f7('0x6a')])?moment()['format'](_0xf2f7('0x63')):undefined});}return null;})[_0xf2f7('0x39')](function(_0x488305){if(_0x488305){_0x229beb[_0xf2f7('0x6b')]=_0x488305[_0xf2f7('0x6c')]({'plain':!![]});interaction_log['info'](_0xf2f7('0x6d'),_0x3079c6['user']['id'],_0x3079c6[_0xf2f7('0x65')]['name'],_0x3079c6[_0xf2f7('0x65')][_0xf2f7('0x6e')],_0x229beb[_0xf2f7('0x6b')]['id'],_0x3079c6[_0xf2f7('0x5d')]?JSON[_0xf2f7('0x27')](_0x3079c6[_0xf2f7('0x5d')]):_0xf2f7('0x6f'));return respondWithRpcPromise(_0xf2f7('0x70'),_0xf2f7('0x71'),_0x229beb);}return null;})[_0xf2f7('0x39')](function(_0x225bf2){var _0x5f27a5=_0xf2f7('0x72')+_0x225bf2[_0xf2f7('0x2b')][_0xf2f7('0x73')];return db['sequelize']['query'](_0x5f27a5,{'type':db[_0xf2f7('0x74')][_0xf2f7('0x75')]['SELECT'],'raw':!![]})[_0xf2f7('0x39')](function(_0x1a2027){return _0x1a2027;});})[_0xf2f7('0x39')](function(_0x3cdd32){if(_0x3cdd32){_0x229beb[_0xf2f7('0x2b')]['contact']=_0x3cdd32[0x0];if(!_0x3079c6[_0xf2f7('0x5d')]['UserId'])return;return db['User'][_0xf2f7('0x5c')]({'where':{'id':_0x3079c6[_0xf2f7('0x5d')]['UserId'],'role':_0xf2f7('0x66')},'attributes':['id',_0xf2f7('0x3c'),_0xf2f7('0x76'),'email',_0xf2f7('0x77')],'raw':!![]});}return null;})[_0xf2f7('0x39')](function(_0x6e9876){if(!_0x6e9876)return null;_0x229beb[_0xf2f7('0x2b')][_0xf2f7('0x66')]=_0x6e9876;return _0x229beb;})[_0xf2f7('0x39')](function(_0x874298){if(_0x874298){if(_0x3079c6['body'][_0xf2f7('0x78')]){_0x229beb['message']['interface']=util[_0xf2f7('0x62')](_0xf2f7('0x79'),_0x3079c6[_0xf2f7('0x65')][_0xf2f7('0x3c')]);_0x229beb[_0xf2f7('0x2b')][_0xf2f7('0x7a')]=_0x229beb[_0xf2f7('0x7a')];_0x229beb[_0xf2f7('0x2b')]['motionChannel']=_0x229beb[_0xf2f7('0x7a')];_0x229beb['message'][_0xf2f7('0x7b')]=_0xf2f7('0x7c');return respondWithRpcPromise(_0xf2f7('0x7d'),_0xf2f7('0x7d'),{'event':'acceptmessage','message':_0x229beb[_0xf2f7('0x2b')]},client9002)[_0xf2f7('0x39')](function(){return _0x229beb;});}return _0x229beb;}return null;})[_0xf2f7('0x39')](respondWithResult(_0x3da799,null))[_0xf2f7('0x57')](handleError(_0x3da799,null));};var interaction_log=require(_0xf2f7('0x15'))('fax-interactions');exports[_0xf2f7('0x36')]=function(_0x235893,_0xb6bb51,_0x4b9bbc){var _0x37348c={'agent':{},'channel':_0xf2f7('0x60')};if(_0x235893['body']['id']){delete _0x235893['body']['id'];}_0x235893[_0xf2f7('0x5d')][_0xf2f7('0x64')]=_0x235893['body'][_0xf2f7('0x64')]||_0x235893['user']['id'];_0x37348c[_0xf2f7('0x66')]['id']=_0x235893[_0xf2f7('0x5d')]['UserId'];return db['FaxMessage'][_0xf2f7('0x5c')]({'where':{'id':_0x235893[_0xf2f7('0x59')]['id'],'UserId':null}})[_0xf2f7('0x39')](handleEntityNotFound(_0xb6bb51,null))['then'](function(_0x15382e){if(_0x15382e){_0x37348c['message']=_0x15382e[_0xf2f7('0x6c')]({'plain':!![]});return db[_0xf2f7('0x67')][_0xf2f7('0x5c')]({'where':{'id':_0x15382e['FaxInteractionId']}});}return null;})[_0xf2f7('0x39')](handleEntityNotFound(_0xb6bb51,null))['then'](function(_0x2077f3){if(_0x2077f3){_0x37348c[_0xf2f7('0x6b')]=_0x2077f3[_0xf2f7('0x6c')]({'plain':!![]});interaction_log['info'](_0xf2f7('0x7e'),_0x235893[_0xf2f7('0x65')]['id'],_0x235893[_0xf2f7('0x65')][_0xf2f7('0x3c')],_0x235893[_0xf2f7('0x65')]['role'],_0x37348c['interaction']['id'],_0x235893[_0xf2f7('0x5d')]?JSON[_0xf2f7('0x27')](_0x235893['body']):'null');return respondWithRpcPromise(_0xf2f7('0x7f'),'rejectMessage',_0x37348c);}return null;})['then'](function(_0x3cfc0f){var _0x2a2b5c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3cfc0f['message'][_0xf2f7('0x73')];return db[_0xf2f7('0x80')][_0xf2f7('0x45')](_0x2a2b5c,{'type':db[_0xf2f7('0x74')]['QueryTypes'][_0xf2f7('0x81')],'raw':!![]})[_0xf2f7('0x39')](function(_0x40bafa){return _0x40bafa;});})[_0xf2f7('0x39')](function(_0x3b8c46){if(_0x3b8c46){_0x37348c[_0xf2f7('0x2b')][_0xf2f7('0x82')]=_0x3b8c46[0x0];if(!_0x235893[_0xf2f7('0x5d')][_0xf2f7('0x64')])return;return db[_0xf2f7('0x83')]['find']({'where':{'id':_0x235893[_0xf2f7('0x5d')][_0xf2f7('0x64')],'role':_0xf2f7('0x66')},'attributes':['id',_0xf2f7('0x3c'),_0xf2f7('0x76'),_0xf2f7('0x84'),_0xf2f7('0x77')],'raw':!![]});}return null;})['then'](function(_0x14ad69){if(!_0x14ad69)return null;_0x37348c[_0xf2f7('0x2b')]['agent']=_0x14ad69;return _0x37348c;})[_0xf2f7('0x39')](function(_0x276ada){if(_0x276ada){_0x276ada[_0xf2f7('0x2b')][_0xf2f7('0x85')]=util[_0xf2f7('0x62')]('SIP/%s',_0x235893['user'][_0xf2f7('0x3c')]);_0x276ada[_0xf2f7('0x2b')][_0xf2f7('0x7a')]=_0x37348c['channel'];_0x276ada[_0xf2f7('0x2b')]['motionChannel']=_0x37348c['channel'];_0x276ada['message'][_0xf2f7('0x7b')]=_0xf2f7('0x36');respondWithRpcPromise(_0xf2f7('0x7d'),_0xf2f7('0x7d'),{'event':_0xf2f7('0x86'),'message':_0x276ada[_0xf2f7('0x2b')]},client9002);return _0x37348c;}return null;})[_0xf2f7('0x39')](respondWithResult(_0xb6bb51,null))['catch'](handleError(_0xb6bb51,null));};exports['create']=function(_0x2a7b3d,_0x20f031){var _0x4acb7b;return db[_0xf2f7('0x40')]['create'](_0x2a7b3d[_0xf2f7('0x5d')],{})[_0xf2f7('0x39')](function(_0x1312bf){_0x4acb7b=_0x1312bf;return db[_0xf2f7('0x87')]['findOne']({'where':{'id':_0x4acb7b[_0xf2f7('0x73')]}});})[_0xf2f7('0x39')](function(_0x18e56a){if(_[_0xf2f7('0x69')](_0x18e56a)){return;}else{_0x4acb7b[_0xf2f7('0x60')]=_0x18e56a[_0xf2f7('0x60')];return db[_0xf2f7('0x88')]['findOne']({'where':{'id':_0x4acb7b[_0xf2f7('0x89')]}});}})[_0xf2f7('0x39')](function(_0xa3641e){return respondWithRpcPromise(_0xf2f7('0x8a'),_0xf2f7('0x8a'),{'FaxAccountId':_[_0xf2f7('0x69')](_0x2a7b3d[_0xf2f7('0x5d')])?undefined:_0x2a7b3d['body'][_0xf2f7('0x8b')],'path':_[_0xf2f7('0x69')](_0xa3641e)?undefined:util[_0xf2f7('0x62')](_0xf2f7('0x8c'),_0xa3641e[_0xf2f7('0x8d')]),'fax':_[_0xf2f7('0x69')](_0x4acb7b[_0xf2f7('0x60')])?undefined:_0x4acb7b[_0xf2f7('0x60')],'AttachmentId':_0x4acb7b[_0xf2f7('0x89')]},client9002);})['then'](respondWithResult(_0x20f031,0xc9))[_0xf2f7('0x57')](handleError(_0x20f031,null));};exports[_0xf2f7('0x8e')]=function(_0x14c48a,_0xa6387f){var _0x5d7f5a=path[_0xf2f7('0x8f')](config[_0xf2f7('0x90')],_0xf2f7('0x91'),_0xf2f7('0x92'),_0xf2f7('0x93'));return db[_0xf2f7('0x40')][_0xf2f7('0x5c')]({'where':{'id':_0x14c48a['params']['id']},'include':[{'model':db[_0xf2f7('0x88')],'as':_0xf2f7('0x88')}]})['then'](handleEntityNotFound(_0xa6387f,null))[_0xf2f7('0x39')](function(_0x2c6ceb){if(_0x2c6ceb){return _0xa6387f[_0xf2f7('0x8e')](path[_0xf2f7('0x8f')](_0x5d7f5a,_0x2c6ceb[_0xf2f7('0x88')][_0xf2f7('0x8d')]));}})[_0xf2f7('0x57')](handleError(_0xa6387f,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index f3f0054..0e0d2ad 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 _0x0967=['update','remove','emit','hasOwnProperty','hook','exports','events','FaxMessage','setMaxListeners','save'];(function(_0xaa656e,_0x250a02){var _0x2b2d99=function(_0x56d72f){while(--_0x56d72f){_0xaa656e['push'](_0xaa656e['shift']());}};_0x2b2d99(++_0x250a02);}(_0x0967,0x100));var _0x7096=function(_0x56878b,_0x270e8b){_0x56878b=_0x56878b-0x0;var _0x339768=_0x0967[_0x56878b];return _0x339768;};'use strict';var EventEmitter=require(_0x7096('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x7096('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7096('0x2')](0x0);var events={'afterCreate':_0x7096('0x3'),'afterUpdate':_0x7096('0x4'),'afterDestroy':_0x7096('0x5')};function emitEvent(_0xe41170){return function(_0x4106a2,_0x2a50e2,_0x4eba77){FaxMessageEvents[_0x7096('0x6')](_0xe41170+':'+_0x4106a2['id'],_0x4106a2);FaxMessageEvents[_0x7096('0x6')](_0xe41170,_0x4106a2);_0x4eba77(null);};}for(var e in events){if(events[_0x7096('0x7')](e)){var event=events[e];FaxMessage[_0x7096('0x8')](e,emitEvent(event));}}module[_0x7096('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0x2b47=['FaxMessage','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x101e9d,_0x3440d3){var _0x96db1f=function(_0x18da38){while(--_0x18da38){_0x101e9d['push'](_0x101e9d['shift']());}};_0x96db1f(++_0x3440d3);}(_0x2b47,0x177));var _0x72b4=function(_0x33c2db,_0x514929){_0x33c2db=_0x33c2db-0x0;var _0x119a84=_0x2b47[_0x33c2db];return _0x119a84;};'use strict';var EventEmitter=require(_0x72b4('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x72b4('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x72b4('0x2')](0x0);var events={'afterCreate':_0x72b4('0x3'),'afterUpdate':'update','afterDestroy':_0x72b4('0x4')};function emitEvent(_0x299680){return function(_0x2a3f83,_0x302681,_0x160600){FaxMessageEvents[_0x72b4('0x5')](_0x299680+':'+_0x2a3f83['id'],_0x2a3f83);FaxMessageEvents['emit'](_0x299680,_0x2a3f83);_0x160600(null);};}for(var e in events){if(events[_0x72b4('0x6')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x72b4('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 38ea9ec..64c37a6 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 _0x9626=['define','fax_messages','fti_fax_messages','body','FULLTEXT','models','toLowerCase','direction','isNil','FaxInteraction','findOne','FaxInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0xa97754,_0x18f74c){var _0x225608=function(_0x34272c){while(--_0x34272c){_0xa97754['push'](_0xa97754['shift']());}};_0x225608(++_0x18f74c);}(_0x9626,0x7a));var _0x6962=function(_0x43c333,_0x5b09b8){_0x43c333=_0x43c333-0x0;var _0x13a10d=_0x9626[_0x43c333];return _0x13a10d;};'use strict';var _=require(_0x6962('0x0'));var util=require(_0x6962('0x1'));var logger=require(_0x6962('0x2'))(_0x6962('0x3'));var moment=require(_0x6962('0x4'));var BPromise=require(_0x6962('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6962('0x6'));var rimraf=require('rimraf');var config=require(_0x6962('0x7'));var attributes=require('./faxMessage.attributes');module['exports']=function(_0x43d7e5,_0x69571e){return _0x43d7e5[_0x6962('0x8')]('FaxMessage',attributes,{'tableName':_0x6962('0x9'),'paranoid':![],'indexes':[{'name':_0x6962('0xa'),'fields':[_0x6962('0xb')],'type':_0x6962('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x43f4ff,_0x20dafb,_0x10f732){var _0x1a9527=_0x43d7e5[_0x6962('0xd')];var _0xbd2c82=_0x43f4ff['get']({'plain':!![]});if(_0xbd2c82['direction'][_0x6962('0xe')]()==='in'||_0xbd2c82[_0x6962('0xf')][_0x6962('0xe')]()==='out'&&!_0xbd2c82['secret']&&!_[_0x6962('0x10')](_0xbd2c82['UserId'])){_0x1a9527[_0x6962('0x11')][_0x6962('0x12')]({'where':{'id':_0xbd2c82[_0x6962('0x13')]}})[_0x6962('0x14')](function(_0x3cd375){if(_0x3cd375){_0x3cd375['update']({'lastMsgAt':_0xbd2c82[_0x6962('0x15')],'lastMsgDirection':_0xbd2c82[_0x6962('0xf')]['toLowerCase']()});}})[_0x6962('0x16')](function(_0x477693){console[_0x6962('0x17')](_0x477693);});}_0x10f732();}},'charset':_0x6962('0x18'),'collate':_0x6962('0x19')});}; \ No newline at end of file +var _0x7bf7=['bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','define','fax_messages','body','FULLTEXT','models','direction','toLowerCase','secret','UserId','findOne','FaxInteractionId','then','update','catch','utf8mb4','utf8mb4_unicode_ci','api','moment'];(function(_0x27483c,_0xe0aa1f){var _0x59d1d9=function(_0xa0b5c){while(--_0xa0b5c){_0x27483c['push'](_0x27483c['shift']());}};_0x59d1d9(++_0xe0aa1f);}(_0x7bf7,0x8e));var _0x77bf=function(_0x5b3d2c,_0x45b35b){_0x5b3d2c=_0x5b3d2c-0x0;var _0x91c521=_0x7bf7[_0x5b3d2c];return _0x91c521;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x77bf('0x0'));var moment=require(_0x77bf('0x1'));var BPromise=require(_0x77bf('0x2'));var rp=require(_0x77bf('0x3'));var fs=require('fs');var path=require(_0x77bf('0x4'));var rimraf=require(_0x77bf('0x5'));var config=require(_0x77bf('0x6'));var attributes=require(_0x77bf('0x7'));module['exports']=function(_0x189a61,_0x379101){return _0x189a61[_0x77bf('0x8')]('FaxMessage',attributes,{'tableName':_0x77bf('0x9'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x77bf('0xa')],'type':_0x77bf('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3ddb3b,_0x5e2fba,_0x2e4198){var _0x28f614=_0x189a61[_0x77bf('0xc')];var _0x23c2cf=_0x3ddb3b['get']({'plain':!![]});if(_0x23c2cf[_0x77bf('0xd')]['toLowerCase']()==='in'||_0x23c2cf[_0x77bf('0xd')][_0x77bf('0xe')]()==='out'&&!_0x23c2cf[_0x77bf('0xf')]&&!_['isNil'](_0x23c2cf[_0x77bf('0x10')])){_0x28f614['FaxInteraction'][_0x77bf('0x11')]({'where':{'id':_0x23c2cf[_0x77bf('0x12')]}})[_0x77bf('0x13')](function(_0x261044){if(_0x261044){_0x261044[_0x77bf('0x14')]({'lastMsgAt':_0x23c2cf['createdAt'],'lastMsgDirection':_0x23c2cf[_0x77bf('0xd')][_0x77bf('0xe')]()});}})[_0x77bf('0x15')](function(_0x58b2f4){console['error'](_0x58b2f4);});}_0x2e4198();}},'charset':_0x77bf('0x16'),'collate':_0x77bf('0x17')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 1f69a31..34b4e8e 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 _0xe5b3=['FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateFaxMessage','FaxMessage','create','body','options','raw','catch','UpdateFaxMessage','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','then','info'];(function(_0x45c67f,_0x269e16){var _0x4e6271=function(_0x238da8){while(--_0x238da8){_0x45c67f['push'](_0x45c67f['shift']());}};_0x4e6271(++_0x269e16);}(_0xe5b3,0x133));var _0x3e5b=function(_0x86da5d,_0x18d93e){_0x86da5d=_0x86da5d-0x0;var _0x4f6f71=_0xe5b3[_0x86da5d];return _0x4f6f71;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var moment=require(_0x3e5b('0x1'));var BPromise=require(_0x3e5b('0x2'));var rs=require(_0x3e5b('0x3'));var fs=require('fs');var Redis=require(_0x3e5b('0x4'));var db=require(_0x3e5b('0x5'))['db'];var utils=require(_0x3e5b('0x6'));var logger=require(_0x3e5b('0x7'))(_0x3e5b('0x8'));var config=require(_0x3e5b('0x9'));var jayson=require(_0x3e5b('0xa'));var client=jayson['client'][_0x3e5b('0xb')]({'port':0x232a});config[_0x3e5b('0xc')]=_['defaults'](config[_0x3e5b('0xc')],{'host':_0x3e5b('0xd'),'port':0x18eb});var socket=require(_0x3e5b('0xe'))(new Redis(config[_0x3e5b('0xc')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x1fef54,_0x3d3b6e,_0x22fc1a){return new BPromise(function(_0x17dee7,_0xeeaabc){return client['request'](_0x1fef54,_0x22fc1a)[_0x3e5b('0xf')](function(_0x52efbd){logger[_0x3e5b('0x10')](_0x3e5b('0x11'),_0x3d3b6e,_0x3e5b('0x12'));logger[_0x3e5b('0x13')](_0x3e5b('0x14'),_0x3d3b6e,_0x3e5b('0x12'),JSON[_0x3e5b('0x15')](_0x52efbd));if(_0x52efbd['error']){if(_0x52efbd[_0x3e5b('0x16')]['code']===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x3d3b6e,_0x52efbd[_0x3e5b('0x16')][_0x3e5b('0x17')]);return _0xeeaabc(_0x52efbd[_0x3e5b('0x16')]['message']);}logger[_0x3e5b('0x16')]('FaxMessage,\x20%s,\x20%s',_0x3d3b6e,_0x52efbd['error'][_0x3e5b('0x17')]);return _0x17dee7(_0x52efbd[_0x3e5b('0x16')]['message']);}else{logger[_0x3e5b('0x10')](_0x3e5b('0x11'),_0x3d3b6e,'request\x20sent');_0x17dee7(_0x52efbd[_0x3e5b('0x18')][_0x3e5b('0x17')]);}})['catch'](function(_0x4b189d){logger[_0x3e5b('0x16')](_0x3e5b('0x11'),_0x3d3b6e,_0x4b189d);_0xeeaabc(_0x4b189d);});});}exports[_0x3e5b('0x19')]=function(_0xff4aba){var _0x24de5b=this;return new Promise(function(_0x1564b5,_0x447d36){return db[_0x3e5b('0x1a')][_0x3e5b('0x1b')](_0xff4aba[_0x3e5b('0x1c')],{'raw':_0xff4aba[_0x3e5b('0x1d')]?_0xff4aba[_0x3e5b('0x1d')][_0x3e5b('0x1e')]===undefined?!![]:![]:!![]})[_0x3e5b('0xf')](function(_0x5b46d4){logger[_0x3e5b('0x10')](_0x3e5b('0x19'),_0xff4aba);logger[_0x3e5b('0x13')](_0x3e5b('0x19'),_0xff4aba,JSON['stringify'](_0x5b46d4));_0x1564b5(_0x5b46d4);})[_0x3e5b('0x1f')](function(_0x5b33bb){logger[_0x3e5b('0x16')](_0x3e5b('0x19'),_0x5b33bb['message'],_0xff4aba);_0x447d36(_0x24de5b[_0x3e5b('0x16')](0x1f4,_0x5b33bb[_0x3e5b('0x17')]));});});};exports[_0x3e5b('0x20')]=function(_0x3c8965){var _0x3bb749=this;return new Promise(function(_0x26c7f2,_0x160e87){return db[_0x3e5b('0x1a')]['update'](_0x3c8965[_0x3e5b('0x1c')],{'raw':_0x3c8965['options']?_0x3c8965[_0x3e5b('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c8965[_0x3e5b('0x1d')]?_0x3c8965[_0x3e5b('0x1d')][_0x3e5b('0x21')]||null:null,'attributes':_0x3c8965[_0x3e5b('0x1d')]?_0x3c8965[_0x3e5b('0x1d')][_0x3e5b('0x22')]||null:null,'limit':_0x3c8965[_0x3e5b('0x1d')]?_0x3c8965[_0x3e5b('0x1d')][_0x3e5b('0x23')]||null:null})[_0x3e5b('0xf')](function(_0x1e1565){logger['info'](_0x3e5b('0x20'),_0x3c8965);logger[_0x3e5b('0x13')](_0x3e5b('0x20'),_0x3c8965,JSON[_0x3e5b('0x15')](_0x1e1565));_0x26c7f2(_0x1e1565);})[_0x3e5b('0x1f')](function(_0x31e9f9){logger[_0x3e5b('0x16')]('UpdateFaxMessage',_0x31e9f9[_0x3e5b('0x17')],_0x3c8965);_0x160e87(_0x3bb749['error'](0x1f4,_0x31e9f9['message']));});});}; \ No newline at end of file +var _0x9f62=['util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','request','info','request\x20sent','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','CreateFaxMessage','FaxMessage','body','raw','then','debug','catch','UpdateFaxMessage','update','options','where','attributes','limit'];(function(_0x5e3530,_0x5ee861){var _0x34ef59=function(_0x2c737f){while(--_0x2c737f){_0x5e3530['push'](_0x5e3530['shift']());}};_0x34ef59(++_0x5ee861);}(_0x9f62,0x154));var _0x29f6=function(_0x4dde85,_0x153f07){_0x4dde85=_0x4dde85-0x0;var _0x248375=_0x9f62[_0x4dde85];return _0x248375;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var moment=require('moment');var BPromise=require(_0x29f6('0x1'));var rs=require(_0x29f6('0x2'));var fs=require('fs');var Redis=require(_0x29f6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x29f6('0x4'))(_0x29f6('0x5'));var config=require(_0x29f6('0x6'));var jayson=require(_0x29f6('0x7'));var client=jayson['client'][_0x29f6('0x8')]({'port':0x232a});config[_0x29f6('0x9')]=_[_0x29f6('0xa')](config[_0x29f6('0x9')],{'host':_0x29f6('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0xe25841,_0x44db16,_0x4fb455){return new BPromise(function(_0x5a0724,_0x29b3f5){return client[_0x29f6('0xc')](_0xe25841,_0x4fb455)['then'](function(_0x17b69c){logger[_0x29f6('0xd')]('FaxMessage,\x20%s,\x20%s',_0x44db16,'request\x20sent');logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x44db16,_0x29f6('0xe'),JSON[_0x29f6('0xf')](_0x17b69c));if(_0x17b69c[_0x29f6('0x10')]){if(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x11')]===0x1f4){logger[_0x29f6('0x10')](_0x29f6('0x12'),_0x44db16,_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);return _0x29b3f5(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);}logger[_0x29f6('0x10')](_0x29f6('0x12'),_0x44db16,_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);return _0x5a0724(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x44db16,_0x29f6('0xe'));_0x5a0724(_0x17b69c[_0x29f6('0x14')][_0x29f6('0x13')]);}})['catch'](function(_0xcb90){logger[_0x29f6('0x10')]('FaxMessage,\x20%s,\x20%s',_0x44db16,_0xcb90);_0x29b3f5(_0xcb90);});});}exports[_0x29f6('0x15')]=function(_0x3e81af){var _0x42a8fa=this;return new Promise(function(_0x41b9f0,_0xb6e7a9){return db[_0x29f6('0x16')]['create'](_0x3e81af[_0x29f6('0x17')],{'raw':_0x3e81af['options']?_0x3e81af['options'][_0x29f6('0x18')]===undefined?!![]:![]:!![]})[_0x29f6('0x19')](function(_0x39c6b3){logger[_0x29f6('0xd')]('CreateFaxMessage',_0x3e81af);logger[_0x29f6('0x1a')]('CreateFaxMessage',_0x3e81af,JSON[_0x29f6('0xf')](_0x39c6b3));_0x41b9f0(_0x39c6b3);})[_0x29f6('0x1b')](function(_0x4200cc){logger[_0x29f6('0x10')]('CreateFaxMessage',_0x4200cc[_0x29f6('0x13')],_0x3e81af);_0xb6e7a9(_0x42a8fa[_0x29f6('0x10')](0x1f4,_0x4200cc['message']));});});};exports[_0x29f6('0x1c')]=function(_0x45f792){var _0x2519ac=this;return new Promise(function(_0x342038,_0x84ccb7){return db[_0x29f6('0x16')][_0x29f6('0x1d')](_0x45f792['body'],{'raw':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x1f')]||null:null,'attributes':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x20')]||null:null,'limit':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x21')]||null:null})[_0x29f6('0x19')](function(_0x304c28){logger[_0x29f6('0xd')](_0x29f6('0x1c'),_0x45f792);logger[_0x29f6('0x1a')]('UpdateFaxMessage',_0x45f792,JSON['stringify'](_0x304c28));_0x342038(_0x304c28);})[_0x29f6('0x1b')](function(_0x489897){logger[_0x29f6('0x10')](_0x29f6('0x1c'),_0x489897[_0x29f6('0x13')],_0x45f792);_0x84ccb7(_0x2519ac[_0x29f6('0x10')](0x1f4,_0x489897['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 425b957..626a2e8 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 _0x75bf=['./faxMessage.events','remove','emit','removeListener','register','length'];(function(_0x3d3537,_0x24c264){var _0x57927b=function(_0xc73839){while(--_0xc73839){_0x3d3537['push'](_0x3d3537['shift']());}};_0x57927b(++_0x24c264);}(_0x75bf,0x168));var _0xf75b=function(_0xb9c122,_0x42677b){_0xb9c122=_0xb9c122-0x0;var _0x34ef35=_0x75bf[_0xb9c122];return _0x34ef35;};'use strict';var FaxMessageEvents=require(_0xf75b('0x0'));var events=['save',_0xf75b('0x1'),'update'];function createListener(_0x551302,_0x87f935){return function(_0x3774ef){_0x87f935[_0xf75b('0x2')](_0x551302,_0x3774ef);};}function removeListener(_0xc901aa,_0x5d49d9){return function(){FaxMessageEvents[_0xf75b('0x3')](_0xc901aa,_0x5d49d9);};}exports[_0xf75b('0x4')]=function(_0x2bc4a9){for(var _0x27d422=0x0,_0xc5954a=events[_0xf75b('0x5')];_0x27d422<_0xc5954a;_0x27d422++){var _0x1cb2d7=events[_0x27d422];var _0x41e766=createListener('faxMessage:'+_0x1cb2d7,_0x2bc4a9);FaxMessageEvents['on'](_0x1cb2d7,_0x41e766);}}; \ No newline at end of file +var _0x7513=['save','remove','update','emit','length','./faxMessage.events'];(function(_0xeb67d8,_0x14a337){var _0x4138f9=function(_0x3b0407){while(--_0x3b0407){_0xeb67d8['push'](_0xeb67d8['shift']());}};_0x4138f9(++_0x14a337);}(_0x7513,0x1b5));var _0x3751=function(_0x3ab287,_0x5103b8){_0x3ab287=_0x3ab287-0x0;var _0x38a448=_0x7513[_0x3ab287];return _0x38a448;};'use strict';var FaxMessageEvents=require(_0x3751('0x0'));var events=[_0x3751('0x1'),_0x3751('0x2'),_0x3751('0x3')];function createListener(_0x20b8c4,_0x262498){return function(_0x339b6d){_0x262498[_0x3751('0x4')](_0x20b8c4,_0x339b6d);};}function removeListener(_0x1e4dcf,_0x14f376){return function(){FaxMessageEvents['removeListener'](_0x1e4dcf,_0x14f376);};}exports['register']=function(_0x410c78){for(var _0x270e99=0x0,_0x1a39b8=events[_0x3751('0x5')];_0x270e99<_0x1a39b8;_0x270e99++){var _0x2c8657=events[_0x270e99];var _0x1195b5=createListener('faxMessage:'+_0x2c8657,_0x410c78);FaxMessageEvents['on'](_0x2c8657,_0x1195b5);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 505595a..ad8ddb9 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 _0x04b8=['/:id','update','put','/:id/accept','/:id/reject','reject','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','index','/describe','describe','isAuthenticated','show','/:id/download','post','tracked','fax','faxmessage:create','create'];(function(_0xa2cadc,_0x39d0f3){var _0x4722a1=function(_0x4d943f){while(--_0x4d943f){_0xa2cadc['push'](_0xa2cadc['shift']());}};_0x4722a1(++_0x39d0f3);}(_0x04b8,0x159));var _0x804b=function(_0x2b3a40,_0x386ecd){_0x2b3a40=_0x2b3a40-0x0;var _0x2ad588=_0x04b8[_0x2b3a40];return _0x2ad588;};'use strict';var multer=require('multer');var util=require(_0x804b('0x0'));var path=require('path');var timeout=require(_0x804b('0x1'));var express=require(_0x804b('0x2'));var router=express['Router']();var fs_extra=require(_0x804b('0x3'));var auth=require(_0x804b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x804b('0x5'));var controller=require(_0x804b('0x6'));router[_0x804b('0x7')]('/',auth['isAuthenticated'](),controller[_0x804b('0x8')]);router[_0x804b('0x7')](_0x804b('0x9'),auth['isAuthenticated'](),controller[_0x804b('0xa')]);router[_0x804b('0x7')]('/:id',auth[_0x804b('0xb')](),controller[_0x804b('0xc')]);router[_0x804b('0x7')](_0x804b('0xd'),auth[_0x804b('0xb')](),controller['download']);router[_0x804b('0xe')]('/',auth[_0x804b('0xb')](),interaction[_0x804b('0xf')](_0x804b('0x10'),_0x804b('0x11')),controller[_0x804b('0x12')]);router['put'](_0x804b('0x13'),auth['isAuthenticated'](),controller[_0x804b('0x14')]);router[_0x804b('0x15')](_0x804b('0x16'),auth[_0x804b('0xb')](),controller['accept']);router[_0x804b('0x15')](_0x804b('0x17'),auth[_0x804b('0xb')](),controller[_0x804b('0x18')]);router['delete'](_0x804b('0x13'),auth[_0x804b('0xb')](),controller['destroy']);module[_0x804b('0x19')]=router; \ No newline at end of file +var _0xdace=['/describe','describe','/:id','show','download','tracked','fax','create','update','put','/:id/accept','accept','reject','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x442ab3,_0x2ff685){var _0x27a7d4=function(_0x394307){while(--_0x394307){_0x442ab3['push'](_0x442ab3['shift']());}};_0x27a7d4(++_0x2ff685);}(_0xdace,0xc5));var _0xedac=function(_0x2d9535,_0x4bc592){_0x2d9535=_0x2d9535-0x0;var _0xb4e710=_0xdace[_0x2d9535];return _0xb4e710;};'use strict';var multer=require(_0xedac('0x0'));var util=require('util');var path=require(_0xedac('0x1'));var timeout=require(_0xedac('0x2'));var express=require(_0xedac('0x3'));var router=express['Router']();var fs_extra=require(_0xedac('0x4'));var auth=require(_0xedac('0x5'));var interaction=require(_0xedac('0x6'));var config=require(_0xedac('0x7'));var controller=require('./faxMessage.controller');router[_0xedac('0x8')]('/',auth[_0xedac('0x9')](),controller[_0xedac('0xa')]);router['get'](_0xedac('0xb'),auth[_0xedac('0x9')](),controller[_0xedac('0xc')]);router['get'](_0xedac('0xd'),auth[_0xedac('0x9')](),controller[_0xedac('0xe')]);router['get']('/:id/download',auth[_0xedac('0x9')](),controller[_0xedac('0xf')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xedac('0x10')](_0xedac('0x11'),'faxmessage:create'),controller[_0xedac('0x12')]);router['put'](_0xedac('0xd'),auth[_0xedac('0x9')](),controller[_0xedac('0x13')]);router[_0xedac('0x14')](_0xedac('0x15'),auth[_0xedac('0x9')](),controller[_0xedac('0x16')]);router[_0xedac('0x14')]('/:id/reject',auth[_0xedac('0x9')](),controller[_0xedac('0x17')]);router[_0xedac('0x18')](_0xedac('0xd'),auth[_0xedac('0x9')](),controller['destroy']);module[_0xedac('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 2f15223..72e7a1d 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 _0x563a=['STRING','name','ENUM','beepall','roundrobin','INTEGER'];(function(_0x4aae85,_0x1a0e3e){var _0x2f8d92=function(_0x32c245){while(--_0x32c245){_0x4aae85['push'](_0x4aae85['shift']());}};_0x2f8d92(++_0x1a0e3e);}(_0x563a,0xfc));var _0xa563=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x563a[_0xefd519];return _0x4bb882;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa563('0x0')],'unique':_0xa563('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa563('0x0')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa563('0x2')]('rrmemory',_0xa563('0x3'),_0xa563('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xa563('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb199=['rrmemory','beepall','roundrobin','INTEGER','exports','STRING','name','ENUM'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb199,0xdc));var _0x9b19=function(_0x3e9cf4,_0x2a7b9c){_0x3e9cf4=_0x3e9cf4-0x0;var _0x445742=_0xb199[_0x3e9cf4];return _0x445742;};'use strict';var Sequelize=require('sequelize');module[_0x9b19('0x0')]={'name':{'type':Sequelize[_0x9b19('0x1')],'unique':_0x9b19('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9b19('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9b19('0x3')](_0x9b19('0x4'),_0x9b19('0x5'),_0x9b19('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x9b19('0x7')],'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 0f166b7..f49eeff 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 _0x1a67=['field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','FaxQueues','UserProfileResource','end','stack','name','send','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','FaxQueue','rows','catch','show','keys','fields','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','getMembers','findOne','UserFaxQueue','FaxQueueId','User','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','ids','findAll','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','select'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x1a67,0x1d4));var _0x71a6=function(_0x287f6a,_0x3308a0){_0x287f6a=_0x287f6a-0x0;var _0x18e3ad=_0x1a67[_0x287f6a];return _0x18e3ad;};'use strict';var emlformat=require(_0x71a6('0x0'));var rimraf=require(_0x71a6('0x1'));var zipdir=require(_0x71a6('0x2'));var jsonpatch=require(_0x71a6('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x71a6('0x4'));var util=require(_0x71a6('0x5'));var path=require(_0x71a6('0x6'));var sox=require(_0x71a6('0x7'));var csv=require(_0x71a6('0x8'));var ejs=require(_0x71a6('0x9'));var fs=require('fs');var fs_extra=require(_0x71a6('0xa'));var _=require(_0x71a6('0xb'));var squel=require(_0x71a6('0xc'));var crypto=require(_0x71a6('0xd'));var jsforce=require(_0x71a6('0xe'));var deskjs=require(_0x71a6('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71a6('0x10'));var Redis=require(_0x71a6('0x11'));var authService=require(_0x71a6('0x12'));var qs=require(_0x71a6('0x13'));var as=require(_0x71a6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x71a6('0x15'))(_0x71a6('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x71a6('0x17'));var db=require(_0x71a6('0x18'))['db'];config[_0x71a6('0x19')]=_[_0x71a6('0x1a')](config['redis'],{'host':_0x71a6('0x1b'),'port':0x18eb});var socket=require(_0x71a6('0x1c'))(new Redis(config[_0x71a6('0x19')]));require(_0x71a6('0x1d'))[_0x71a6('0x1e')](socket);function respondWithStatusCode(_0x41709e,_0x12d86d){_0x12d86d=_0x12d86d||0xcc;return function(_0x12a1ce){if(_0x12a1ce){return _0x41709e[_0x71a6('0x1f')](_0x12d86d);}return _0x41709e[_0x71a6('0x20')](_0x12d86d)['end']();};}function respondWithResult(_0x22222c,_0x3db133){_0x3db133=_0x3db133||0xc8;return function(_0x5b5785){if(_0x5b5785){return _0x22222c['status'](_0x3db133)[_0x71a6('0x21')](_0x5b5785);}};}function respondWithFilteredResult(_0x1239fe,_0x245633){return function(_0x5ec555){if(_0x5ec555){var _0x10990c=typeof _0x245633[_0x71a6('0x22')]===_0x71a6('0x23')&&typeof _0x245633['limit']==='undefined';var _0x264bc6=_0x5ec555[_0x71a6('0x24')];var _0x14a955=_0x10990c?0x0:_0x245633[_0x71a6('0x22')];var _0x8a1cb9=_0x10990c?_0x5ec555[_0x71a6('0x24')]:_0x245633['offset']+_0x245633[_0x71a6('0x25')];var _0x43ece1;if(_0x8a1cb9>=_0x264bc6){_0x8a1cb9=_0x264bc6;_0x43ece1=0xc8;}else{_0x43ece1=0xce;}_0x1239fe[_0x71a6('0x20')](_0x43ece1);return _0x1239fe[_0x71a6('0x26')](_0x71a6('0x27'),_0x14a955+'-'+_0x8a1cb9+'/'+_0x264bc6)['json'](_0x5ec555);}return null;};}function patchUpdates(_0x352a0b){return function(_0x26510f){try{jsonpatch[_0x71a6('0x28')](_0x26510f,_0x352a0b,!![]);}catch(_0x378467){return BPromise[_0x71a6('0x29')](_0x378467);}return _0x26510f['save']();};}function saveUpdates(_0x4b6746,_0x30816d){return function(_0x217e89){if(_0x217e89){return _0x217e89['update'](_0x4b6746)[_0x71a6('0x2a')](function(_0x2940b4){return _0x2940b4;});}return null;};}function removeEntity(_0xb38bb9,_0x119475){return function(_0x366bb8){if(_0x366bb8){return _0x366bb8[_0x71a6('0x2b')]()[_0x71a6('0x2a')](function(){var _0x3e5191=_0x366bb8['get']({'plain':!![]});var _0x4285be=_0x71a6('0x2c');return db[_0x71a6('0x2d')]['destroy']({'where':{'type':_0x4285be,'resourceId':_0x3e5191['id']}})[_0x71a6('0x2a')](function(){return _0x366bb8;});})[_0x71a6('0x2a')](function(){_0xb38bb9[_0x71a6('0x20')](0xcc)[_0x71a6('0x2e')]();});}};}function handleEntityNotFound(_0x348e4d,_0x50efd4){return function(_0x460a1d){if(!_0x460a1d){_0x348e4d['sendStatus'](0x194);}return _0x460a1d;};}function handleError(_0x3cd07a,_0x4b02df){_0x4b02df=_0x4b02df||0x1f4;return function(_0x4c3072){logger['error'](_0x4c3072[_0x71a6('0x2f')]);if(_0x4c3072[_0x71a6('0x30')]){delete _0x4c3072[_0x71a6('0x30')];}_0x3cd07a[_0x71a6('0x20')](_0x4b02df)[_0x71a6('0x31')](_0x4c3072);};}exports['index']=function(_0x4251f3,_0x24ae3f){var _0x19b0c1={},_0x5307f2={},_0xe5a90f={'count':0x0,'rows':[]};var _0x38703a=_['map'](db['FaxQueue'][_0x71a6('0x32')],function(_0x18b4d9){return{'name':_0x18b4d9[_0x71a6('0x33')],'type':_0x18b4d9[_0x71a6('0x34')][_0x71a6('0x35')]};});_0x5307f2[_0x71a6('0x36')]=_['map'](_0x38703a,_0x71a6('0x30'));_0x5307f2[_0x71a6('0x37')]=_['keys'](_0x4251f3['query']);_0x5307f2[_0x71a6('0x38')]=_['intersection'](_0x5307f2[_0x71a6('0x36')],_0x5307f2[_0x71a6('0x37')]);_0x19b0c1[_0x71a6('0x39')]=_[_0x71a6('0x3a')](_0x5307f2['model'],qs['fields'](_0x4251f3[_0x71a6('0x37')]['fields']));_0x19b0c1[_0x71a6('0x39')]=_0x19b0c1[_0x71a6('0x39')][_0x71a6('0x3b')]?_0x19b0c1[_0x71a6('0x39')]:_0x5307f2[_0x71a6('0x36')];if(!_0x4251f3[_0x71a6('0x37')][_0x71a6('0x3c')](_0x71a6('0x3d'))){_0x19b0c1[_0x71a6('0x25')]=qs[_0x71a6('0x25')](_0x4251f3[_0x71a6('0x37')]['limit']);_0x19b0c1[_0x71a6('0x22')]=qs[_0x71a6('0x22')](_0x4251f3['query'][_0x71a6('0x22')]);}_0x19b0c1[_0x71a6('0x3e')]=qs[_0x71a6('0x3f')](_0x4251f3[_0x71a6('0x37')]['sort']);_0x19b0c1[_0x71a6('0x40')]=qs[_0x71a6('0x38')](_[_0x71a6('0x41')](_0x4251f3[_0x71a6('0x37')],_0x5307f2[_0x71a6('0x38')]),_0x38703a);if(_0x4251f3['query'][_0x71a6('0x42')]){_0x19b0c1['where']=_[_0x71a6('0x43')](_0x19b0c1[_0x71a6('0x40')],{'$or':_[_0x71a6('0x44')](_0x38703a,function(_0x5e7317){if(_0x5e7317[_0x71a6('0x34')]!==_0x71a6('0x45')){var _0x13f487={};_0x13f487[_0x5e7317['name']]={'$like':'%'+_0x4251f3[_0x71a6('0x37')]['filter']+'%'};return _0x13f487;}})});}_0x19b0c1=_[_0x71a6('0x43')]({},_0x19b0c1,_0x4251f3[_0x71a6('0x46')]);var _0x2ce4b9={'where':_0x19b0c1[_0x71a6('0x40')]};return db['FaxQueue'][_0x71a6('0x24')](_0x2ce4b9)['then'](function(_0x1783c7){_0xe5a90f['count']=_0x1783c7;if(_0x4251f3[_0x71a6('0x37')][_0x71a6('0x47')]){_0x19b0c1['include']=[{'all':!![]}];}return db[_0x71a6('0x48')]['findAll'](_0x19b0c1);})[_0x71a6('0x2a')](function(_0x41da28){_0xe5a90f[_0x71a6('0x49')]=_0x41da28;return _0xe5a90f;})[_0x71a6('0x2a')](respondWithFilteredResult(_0x24ae3f,_0x19b0c1))[_0x71a6('0x4a')](handleError(_0x24ae3f,null));};exports[_0x71a6('0x4b')]=function(_0x10d5f9,_0x64c2a7){var _0x3b1809={'raw':!![],'where':{'id':_0x10d5f9['params']['id']}},_0x5e1f13={};_0x5e1f13[_0x71a6('0x36')]=_[_0x71a6('0x4c')](db[_0x71a6('0x48')][_0x71a6('0x32')]);_0x5e1f13[_0x71a6('0x37')]=_['keys'](_0x10d5f9[_0x71a6('0x37')]);_0x5e1f13[_0x71a6('0x38')]=_['intersection'](_0x5e1f13['model'],_0x5e1f13[_0x71a6('0x37')]);_0x3b1809[_0x71a6('0x39')]=_[_0x71a6('0x3a')](_0x5e1f13[_0x71a6('0x36')],qs[_0x71a6('0x4d')](_0x10d5f9['query']['fields']));_0x3b1809[_0x71a6('0x39')]=_0x3b1809['attributes']['length']?_0x3b1809[_0x71a6('0x39')]:_0x5e1f13[_0x71a6('0x36')];if(_0x10d5f9['query'][_0x71a6('0x47')]){_0x3b1809['include']=[{'all':!![]}];}_0x3b1809=_[_0x71a6('0x43')]({},_0x3b1809,_0x10d5f9['options']);return db[_0x71a6('0x48')][_0x71a6('0x4e')](_0x3b1809)[_0x71a6('0x2a')](handleEntityNotFound(_0x64c2a7,null))['then'](respondWithResult(_0x64c2a7,null))[_0x71a6('0x4a')](handleError(_0x64c2a7,null));};exports[_0x71a6('0x4f')]=function(_0x1aeb95,_0x20c969){return db[_0x71a6('0x48')]['create'](_0x1aeb95[_0x71a6('0x50')],{})[_0x71a6('0x2a')](function(_0x45e586){var _0x37eff1=_0x1aeb95[_0x71a6('0x51')][_0x71a6('0x52')]({'plain':!![]});if(!_0x37eff1)throw new Error(_0x71a6('0x53'));if(_0x37eff1[_0x71a6('0x54')]===_0x71a6('0x51')){var _0x23c13f=_0x45e586['get']({'plain':!![]});var _0x2fe520=_0x71a6('0x2c');return db[_0x71a6('0x55')]['find']({'where':{'name':_0x2fe520,'userProfileId':_0x37eff1[_0x71a6('0x56')]},'raw':!![]})[_0x71a6('0x2a')](function(_0x32a3db){if(_0x32a3db&&_0x32a3db[_0x71a6('0x57')]===0x0){return db[_0x71a6('0x2d')][_0x71a6('0x4f')]({'name':_0x23c13f[_0x71a6('0x30')],'resourceId':_0x23c13f['id'],'type':_0x32a3db['name'],'sectionId':_0x32a3db['id']},{})[_0x71a6('0x2a')](function(){return _0x45e586;});}else{return _0x45e586;}})[_0x71a6('0x4a')](function(_0x3c8992){logger['error'](_0x71a6('0x58'),_0x3c8992);throw _0x3c8992;});}return _0x45e586;})[_0x71a6('0x2a')](respondWithResult(_0x20c969,0xc9))['catch'](handleError(_0x20c969,null));};exports[_0x71a6('0x59')]=function(_0x429e21,_0x465277){if(_0x429e21[_0x71a6('0x50')]['id']){delete _0x429e21[_0x71a6('0x50')]['id'];}return db['FaxQueue']['find']({'where':{'id':_0x429e21[_0x71a6('0x5a')]['id']}})[_0x71a6('0x2a')](handleEntityNotFound(_0x465277,null))[_0x71a6('0x2a')](saveUpdates(_0x429e21[_0x71a6('0x50')],null))[_0x71a6('0x2a')](respondWithResult(_0x465277,null))[_0x71a6('0x4a')](handleError(_0x465277,null));};exports[_0x71a6('0x2b')]=function(_0x561be1,_0x170c0f){return db[_0x71a6('0x48')]['find']({'where':{'id':_0x561be1['params']['id']}})['then'](handleEntityNotFound(_0x170c0f,null))[_0x71a6('0x2a')](removeEntity(_0x170c0f,null))[_0x71a6('0x4a')](handleError(_0x170c0f,null));};exports['describe']=function(_0x4c4c85,_0xbe9806){return db[_0x71a6('0x48')]['describe']()[_0x71a6('0x2a')](respondWithResult(_0xbe9806,null))[_0x71a6('0x4a')](handleError(_0xbe9806,null));};exports[_0x71a6('0x5b')]=function(_0x440fd1,_0x51c3b3,_0x51cfc5){var _0x3b54ad={'raw':!![],'where':{}},_0x5ac2de={},_0xe0f952;return db[_0x71a6('0x48')][_0x71a6('0x5c')]({'where':{'id':_0x440fd1[_0x71a6('0x5a')]['id']}})[_0x71a6('0x2a')](handleEntityNotFound(_0x51c3b3,null))[_0x71a6('0x2a')](function(_0x4fccf7){if(_0x4fccf7){_0xe0f952=_0x4fccf7[_0x71a6('0x52')]({'plain':!![]});_0x5ac2de['model']=_[_0x71a6('0x4c')](db[_0x71a6('0x5d')][_0x71a6('0x32')]);_0x5ac2de[_0x71a6('0x37')]=_['keys'](_0x440fd1[_0x71a6('0x37')]);_0x5ac2de[_0x71a6('0x38')]=_[_0x71a6('0x3a')](_0x5ac2de[_0x71a6('0x36')],_0x5ac2de[_0x71a6('0x37')]);_0x3b54ad[_0x71a6('0x39')]=_[_0x71a6('0x3a')](_0x5ac2de['model'],qs[_0x71a6('0x4d')](_0x440fd1['query']['fields']));_0x3b54ad[_0x71a6('0x39')]=_0x3b54ad['attributes'][_0x71a6('0x3b')]?_0x3b54ad[_0x71a6('0x39')]:_0x5ac2de['model'];if(!_0x440fd1[_0x71a6('0x37')][_0x71a6('0x3c')](_0x71a6('0x3d'))){_0x3b54ad[_0x71a6('0x25')]=qs[_0x71a6('0x25')](_0x440fd1['query'][_0x71a6('0x25')]);_0x3b54ad['offset']=qs[_0x71a6('0x22')](_0x440fd1['query'][_0x71a6('0x22')]);}_0x3b54ad['order']=qs[_0x71a6('0x3f')](_0x440fd1[_0x71a6('0x37')][_0x71a6('0x3f')]);_0x3b54ad[_0x71a6('0x40')]=qs['filters'](_[_0x71a6('0x41')](_0x440fd1['query'],_0x5ac2de[_0x71a6('0x38')]));_0x3b54ad['where'][_0x71a6('0x5e')]=_0x4fccf7['id'];if(_0x440fd1[_0x71a6('0x37')][_0x71a6('0x42')]){_0x3b54ad[_0x71a6('0x40')]=_['merge'](_0x3b54ad[_0x71a6('0x40')],{'$or':_['map'](_0x3b54ad[_0x71a6('0x39')],function(_0x4e6d94){var _0x12a83b={};_0x12a83b[_0x4e6d94]={'$like':'%'+_0x440fd1[_0x71a6('0x37')][_0x71a6('0x42')]+'%'};return _0x12a83b;})});}_0x3b54ad=_[_0x71a6('0x43')]({},_0x3b54ad,_0x440fd1[_0x71a6('0x46')]);return db[_0x71a6('0x5d')]['findAll'](_0x3b54ad);}})[_0x71a6('0x2a')](function(_0x4f18b0){if(_0x4f18b0){return db[_0x71a6('0x5f')]['findAndCountAll']({'where':{'id':_[_0x71a6('0x44')](_0x4f18b0,_0x71a6('0x60')),'role':_0x71a6('0x61')},'attributes':['id',_0x71a6('0x30'),_0x71a6('0x62'),_0x71a6('0x63'),_0x71a6('0x64')]});}})['then'](function(_0x260593){if(_0x260593){return{'count':_0x260593[_0x71a6('0x24')],'rows':_[_0x71a6('0x44')](_0x260593['rows'],function(_0x36e2cd){return{'membername':_0x36e2cd[_0x71a6('0x30')],'UserId':_0x36e2cd['id'],'queue_name':_0xe0f952['name'],'FaxQueueId':_0xe0f952['id'],'interface':util[_0x71a6('0x65')](_0x71a6('0x66'),'SIP',_0x36e2cd[_0x71a6('0x30')]),'penalty':0x0,'paused':_0x36e2cd['faxPause'],'createdAt':_0x36e2cd[_0x71a6('0x64')],'updatedAt':_0x36e2cd[_0x71a6('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x71a6('0x2a')](respondWithFilteredResult(_0x51c3b3,_0x3b54ad))['catch'](handleError(_0x51c3b3,null));};exports[_0x71a6('0x67')]=function(_0xafd4b8,_0x404c9c,_0x1d4168){var _0x494b42={};var _0x13e795={};var _0x32af88;var _0x122eff;return db['FaxQueue']['findOne']({'where':{'id':_0xafd4b8[_0x71a6('0x5a')]['id']}})[_0x71a6('0x2a')](handleEntityNotFound(_0x404c9c,null))[_0x71a6('0x2a')](function(_0x551ec3){if(_0x551ec3){_0x32af88=_0x551ec3;_0x13e795[_0x71a6('0x36')]=_['keys'](db[_0x71a6('0x68')]['rawAttributes']);_0x13e795['query']=_[_0x71a6('0x4c')](_0xafd4b8[_0x71a6('0x37')]);_0x13e795[_0x71a6('0x38')]=_[_0x71a6('0x3a')](_0x13e795[_0x71a6('0x36')],_0x13e795['query']);_0x494b42[_0x71a6('0x39')]=_[_0x71a6('0x3a')](_0x13e795['model'],qs[_0x71a6('0x4d')](_0xafd4b8[_0x71a6('0x37')]['fields']));_0x494b42[_0x71a6('0x39')]=_0x494b42[_0x71a6('0x39')][_0x71a6('0x3b')]?_0x494b42[_0x71a6('0x39')]:_0x13e795[_0x71a6('0x36')];_0x494b42[_0x71a6('0x3e')]=qs[_0x71a6('0x3f')](_0xafd4b8[_0x71a6('0x37')]['sort']);_0x494b42[_0x71a6('0x40')]=qs[_0x71a6('0x38')](_['pick'](_0xafd4b8['query'],_0x13e795[_0x71a6('0x38')]));if(_0xafd4b8[_0x71a6('0x37')][_0x71a6('0x42')]){_0x494b42[_0x71a6('0x40')]=_[_0x71a6('0x43')](_0x494b42['where'],{'$or':_[_0x71a6('0x44')](_0x494b42['attributes'],function(_0x3d0acd){var _0x304104={};_0x304104[_0x3d0acd]={'$like':'%'+_0xafd4b8[_0x71a6('0x37')][_0x71a6('0x42')]+'%'};return _0x304104;})});}_0x494b42=_[_0x71a6('0x43')]({},_0x494b42,_0xafd4b8[_0x71a6('0x46')]);return _0x32af88[_0x71a6('0x67')](_0x494b42);}})['then'](function(_0x4674ad){if(_0x4674ad){_0x122eff=_0x4674ad[_0x71a6('0x3b')];if(!_0xafd4b8[_0x71a6('0x37')][_0x71a6('0x3c')](_0x71a6('0x3d'))){_0x494b42['limit']=qs[_0x71a6('0x25')](_0xafd4b8[_0x71a6('0x37')][_0x71a6('0x25')]);_0x494b42[_0x71a6('0x22')]=qs[_0x71a6('0x22')](_0xafd4b8['query'][_0x71a6('0x22')]);}return _0x32af88[_0x71a6('0x67')](_0x494b42);}})['then'](function(_0x2fe6aa){if(_0x2fe6aa){return _0x2fe6aa?{'count':_0x122eff,'rows':_0x2fe6aa}:null;}})['then'](respondWithResult(_0x404c9c,null))[_0x71a6('0x4a')](handleError(_0x404c9c,null));};exports[_0x71a6('0x69')]=function(_0xb1c56c,_0x599f99,_0xcf1d15){var _0x3ed454=_0xb1c56c[_0x71a6('0x50')][_0x71a6('0x6a')];return db['Team'][_0x71a6('0x6b')]({'where':{'id':_0x3ed454},'attributes':['id'],'include':[{'model':db[_0x71a6('0x5f')],'as':_0x71a6('0x6c'),'attributes':['id',_0x71a6('0x30'),_0x71a6('0x6d'),_0x71a6('0x6e'),_0x71a6('0x6f')],'raw':!![]}]})[_0x71a6('0x2a')](function(_0x46b0ba){if(_0x46b0ba){var _0x57b8e7=_[_0x71a6('0x70')](_0x46b0ba,function(_0x2fa39b){var _0xb87f85=_0x2fa39b[_0x71a6('0x52')]({'plain':!![]});return _0xb87f85[_0x71a6('0x6c')];});return db[_0x71a6('0x48')]['find']({'where':{'id':_0xb1c56c[_0x71a6('0x5a')]['id']}})[_0x71a6('0x2a')](function(_0x3aa5bf){return db[_0x71a6('0x71')][_0x71a6('0x72')](function(_0x46cdd1){return _0x3aa5bf['addTeams'](_0x3ed454,{'transaction':_0x46cdd1})['then'](function(){return BPromise[_0x71a6('0x73')](_0x57b8e7,function(_0x3a7883){return db[_0x71a6('0x5d')][_0x71a6('0x74')]({'where':{'UserId':_0x3a7883['id'],'FaxQueueId':_0xb1c56c[_0x71a6('0x5a')]['id']},'transaction':_0x46cdd1});});})[_0x71a6('0x2a')](function(){_0x57b8e7[_0x71a6('0x75')](function(_0xb1270b){socket[_0x71a6('0x76')]('userFaxQueue:save',{'UserId':_0xb1270b['id'],'FaxQueueId':_0x3aa5bf['id']});});});});});}})[_0x71a6('0x2a')](respondWithStatusCode(_0x599f99,null))[_0x71a6('0x4a')](handleError(_0x599f99,null));};exports['removeTeams']=function(_0x584862,_0x514f1d,_0x2b8ed1){return db[_0x71a6('0x68')]['findAll']({'where':{'id':_0x584862[_0x71a6('0x37')][_0x71a6('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x71a6('0x5f')],'as':_0x71a6('0x6c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x514f1d,null))[_0x71a6('0x2a')](function(_0x5add32){var _0x30f432=_['map'](_0x5add32,'id');var _0x47800e=[];var _0x2bfab3=[];var _0x360b0a=squel[_0x71a6('0x77')]();_0x360b0a[_0x71a6('0x78')](_0x71a6('0x79'))[_0x71a6('0x7a')](_0x71a6('0x7b'),'tq')[_0x71a6('0x7c')](_0x71a6('0x7d'),'ut',_0x71a6('0x7e'))[_0x71a6('0x40')](_0x71a6('0x7f'),_0x584862[_0x71a6('0x5a')]['id']);for(var _0x47c50c=0x0;_0x47c50c<_0x5add32[_0x71a6('0x3b')];_0x47c50c+=0x1){let _0x552ef2=_0x5add32[_0x47c50c];for(var _0x340370=0x0;_0x340370<_0x552ef2[_0x71a6('0x6c')]['length'];_0x340370+=0x1){let _0x1659e9=_0x552ef2['Agents'][_0x340370];var _0x45ba0a=_0x360b0a['clone']();_0x45ba0a[_0x71a6('0x40')]('ut.UserId\x20=\x20?',_0x1659e9['id']);_0x2bfab3[_0x71a6('0x80')](db[_0x71a6('0x71')][_0x71a6('0x37')](_0x45ba0a[_0x71a6('0x81')](),{'type':db[_0x71a6('0x71')][_0x71a6('0x82')][_0x71a6('0x83')]})[_0x71a6('0x2a')](function(_0x4ec75b){if(_0x4ec75b[_0x71a6('0x3b')]===0x1){return _0x1659e9['id'];}else{var _0x552895=_['every'](_[_0x71a6('0x44')](_0x4ec75b,_0x71a6('0x84')),function(_0x3512c1){return _[_0x71a6('0x85')](_0x30f432,_0x3512c1);});if(_0x552895){return _0x1659e9['id'];}}}));}}return BPromise[_0x71a6('0x86')](_0x2bfab3)['then'](function(_0x5ada37){_0x47800e=_(_0x47800e)[_0x71a6('0x87')](_0x5ada37)[_0x71a6('0x88')]()[_0x71a6('0x89')]();return db[_0x71a6('0x48')]['find']({'where':{'id':_0x584862[_0x71a6('0x5a')]['id']}})[_0x71a6('0x2a')](function(_0xc9d19c){return db[_0x71a6('0x71')][_0x71a6('0x72')](function(_0x154c06){return _0xc9d19c[_0x71a6('0x8a')](_0x584862['query'][_0x71a6('0x6a')],{'transaction':_0x154c06})[_0x71a6('0x2a')](function(){if(!_[_0x71a6('0x8b')](_0x47800e)){return _0xc9d19c[_0x71a6('0x8c')](_0x47800e,{'transaction':_0x154c06});}})['then'](function(){_0x47800e[_0x71a6('0x75')](function(_0x5262fe){socket['emit'](_0x71a6('0x8d'),{'UserId':_0x5262fe,'FaxQueueId':_0xc9d19c['id']});});});});});});})[_0x71a6('0x2a')](respondWithStatusCode(_0x514f1d,null))[_0x71a6('0x4a')](handleError(_0x514f1d,null));};exports[_0x71a6('0x8e')]=function(_0x24eeb2,_0x46a1fc,_0x3c4209){return db['FaxQueue'][_0x71a6('0x4e')]({'where':{'id':_0x24eeb2[_0x71a6('0x5a')]['id']}})[_0x71a6('0x2a')](handleEntityNotFound(_0x46a1fc,null))[_0x71a6('0x2a')](function(_0x4b1fe8){if(_0x4b1fe8){return _0x4b1fe8[_0x71a6('0x8e')](_0x24eeb2['body']['ids'],_[_0x71a6('0x8f')](_0x24eeb2['body'],[_0x71a6('0x6a'),'id'])||{})[_0x71a6('0x90')](function(_0x3d0918){for(var _0x25c218=0x0;_0x25c218<_0x24eeb2[_0x71a6('0x50')]['ids'][_0x71a6('0x3b')];_0x25c218+=0x1){socket['emit'](_0x71a6('0x91'),{'UserId':Number(_0x24eeb2[_0x71a6('0x50')][_0x71a6('0x6a')][_0x25c218]),'FaxQueueId':Number(_0x24eeb2[_0x71a6('0x5a')]['id'])});}return _0x3d0918;});}})[_0x71a6('0x2a')](respondWithResult(_0x46a1fc,null))['catch'](handleError(_0x46a1fc,null));};exports[_0x71a6('0x8c')]=function(_0x37e365,_0x517631,_0x455015){return db[_0x71a6('0x48')]['find']({'where':{'id':_0x37e365[_0x71a6('0x5a')]['id']}})[_0x71a6('0x2a')](handleEntityNotFound(_0x517631,null))[_0x71a6('0x2a')](function(_0x19b900){if(_0x19b900){return _0x19b900['removeAgents'](_0x37e365['query'][_0x71a6('0x6a')])[_0x71a6('0x2a')](function(){if(_['isArray'](_0x37e365['query']['ids'])){for(var _0x3e90bd=0x0;_0x3e90bd<_0x37e365[_0x71a6('0x37')][_0x71a6('0x6a')]['length'];_0x3e90bd+=0x1){socket[_0x71a6('0x76')](_0x71a6('0x8d'),{'UserId':Number(_0x37e365['query']['ids'][_0x3e90bd]),'FaxQueueId':Number(_0x37e365[_0x71a6('0x5a')]['id'])});}}else{socket[_0x71a6('0x76')](_0x71a6('0x8d'),{'UserId':Number(_0x37e365[_0x71a6('0x37')]['ids']),'FaxQueueId':Number(_0x37e365['params']['id'])});}});}})[_0x71a6('0x2a')](respondWithStatusCode(_0x517631,null))['catch'](handleError(_0x517631,null));};exports['getAgents']=function(_0x31664e,_0x1554db,_0x271c7a){var _0xca8e0a={};var _0x5d3ab7={};var _0x3d4f1c;var _0x99a406;return db[_0x71a6('0x48')][_0x71a6('0x5c')]({'where':{'id':_0x31664e[_0x71a6('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1554db,null))[_0x71a6('0x2a')](function(_0x288bab){if(_0x288bab){_0x3d4f1c=_0x288bab;_0x5d3ab7[_0x71a6('0x36')]=_[_0x71a6('0x4c')](db[_0x71a6('0x5f')]['rawAttributes']);_0x5d3ab7[_0x71a6('0x37')]=_['keys'](_0x31664e['query']);_0x5d3ab7[_0x71a6('0x38')]=_[_0x71a6('0x3a')](_0x5d3ab7[_0x71a6('0x36')],_0x5d3ab7[_0x71a6('0x37')]);_0xca8e0a[_0x71a6('0x39')]=_[_0x71a6('0x3a')](_0x5d3ab7[_0x71a6('0x36')],qs[_0x71a6('0x4d')](_0x31664e[_0x71a6('0x37')][_0x71a6('0x4d')]));_0xca8e0a[_0x71a6('0x39')]=_0xca8e0a[_0x71a6('0x39')][_0x71a6('0x3b')]?_0xca8e0a[_0x71a6('0x39')]:_0x5d3ab7[_0x71a6('0x36')];_0xca8e0a['order']=qs[_0x71a6('0x3f')](_0x31664e[_0x71a6('0x37')][_0x71a6('0x3f')]);_0xca8e0a[_0x71a6('0x40')]=qs['filters'](_[_0x71a6('0x41')](_0x31664e['query'],_0x5d3ab7[_0x71a6('0x38')]));if(_0x31664e[_0x71a6('0x37')]['filter']){_0xca8e0a[_0x71a6('0x40')]=_[_0x71a6('0x43')](_0xca8e0a[_0x71a6('0x40')],{'$or':_[_0x71a6('0x44')](_0xca8e0a[_0x71a6('0x39')],function(_0xfde400){var _0x47635b={};_0x47635b[_0xfde400]={'$like':'%'+_0x31664e[_0x71a6('0x37')][_0x71a6('0x42')]+'%'};return _0x47635b;})});}_0xca8e0a=_['merge']({},_0xca8e0a,_0x31664e['options']);return _0x3d4f1c['getAgents'](_0xca8e0a);}})['then'](function(_0x2a15e5){if(_0x2a15e5){_0x99a406=_0x2a15e5[_0x71a6('0x3b')];if(!_0x31664e['query'][_0x71a6('0x3c')](_0x71a6('0x3d'))){_0xca8e0a['limit']=qs[_0x71a6('0x25')](_0x31664e[_0x71a6('0x37')][_0x71a6('0x25')]);_0xca8e0a[_0x71a6('0x22')]=qs['offset'](_0x31664e[_0x71a6('0x37')][_0x71a6('0x22')]);}return _0x3d4f1c[_0x71a6('0x92')](_0xca8e0a);}})[_0x71a6('0x2a')](function(_0x59c3c7){if(_0x59c3c7){return _0x59c3c7?{'count':_0x99a406,'rows':_0x59c3c7}:null;}})[_0x71a6('0x2a')](respondWithResult(_0x1554db,null))[_0x71a6('0x4a')](handleError(_0x1554db,null));}; \ No newline at end of file +var _0xb307=['squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','then','get','FaxQueues','UserProfileResource','destroy','error','name','index','FaxQueue','fieldName','type','key','model','query','filters','intersection','attributes','length','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','include','findAll','rows','show','params','keys','rawAttributes','fields','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','hasOwnProperty','pick','FaxQueueId','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','%s/%s','SIP','getTeams','ids','Team','User','Agents','online','voicePause','flatMap','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','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','sequelize','QueryTypes','SELECT','includes','all','value','removeTeams','isEmpty','removeAgents','addAgents','omit','spread','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x5caf7e,_0x52e1bc){var _0x5c3435=function(_0xb77e11){while(--_0xb77e11){_0x5caf7e['push'](_0x5caf7e['shift']());}};_0x5c3435(++_0x52e1bc);}(_0xb307,0x10b));var _0x7b30=function(_0x28b254,_0x20c0cd){_0x28b254=_0x28b254-0x0;var _0x1a1f34=_0xb307[_0x28b254];return _0x1a1f34;};'use strict';var emlformat=require(_0x7b30('0x0'));var rimraf=require(_0x7b30('0x1'));var zipdir=require(_0x7b30('0x2'));var jsonpatch=require(_0x7b30('0x3'));var rp=require('request-promise');var moment=require(_0x7b30('0x4'));var BPromise=require(_0x7b30('0x5'));var Mustache=require('mustache');var util=require(_0x7b30('0x6'));var path=require(_0x7b30('0x7'));var sox=require(_0x7b30('0x8'));var csv=require(_0x7b30('0x9'));var ejs=require(_0x7b30('0xa'));var fs=require('fs');var fs_extra=require(_0x7b30('0xb'));var _=require(_0x7b30('0xc'));var squel=require(_0x7b30('0xd'));var crypto=require('crypto');var jsforce=require(_0x7b30('0xe'));var deskjs=require(_0x7b30('0xf'));var toCsv=require(_0x7b30('0x9'));var querystring=require(_0x7b30('0x10'));var Papa=require(_0x7b30('0x11'));var Redis=require(_0x7b30('0x12'));var authService=require(_0x7b30('0x13'));var qs=require(_0x7b30('0x14'));var as=require(_0x7b30('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b30('0x16'))(_0x7b30('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7b30('0x18'));var db=require(_0x7b30('0x19'))['db'];config[_0x7b30('0x1a')]=_['defaults'](config['redis'],{'host':_0x7b30('0x1b'),'port':0x18eb});var socket=require(_0x7b30('0x1c'))(new Redis(config['redis']));require('./faxQueue.socket')['register'](socket);function respondWithStatusCode(_0x2d1d92,_0x211f56){_0x211f56=_0x211f56||0xcc;return function(_0x362bea){if(_0x362bea){return _0x2d1d92['sendStatus'](_0x211f56);}return _0x2d1d92[_0x7b30('0x1d')](_0x211f56)[_0x7b30('0x1e')]();};}function respondWithResult(_0xd4682f,_0x15cbd4){_0x15cbd4=_0x15cbd4||0xc8;return function(_0x34713e){if(_0x34713e){return _0xd4682f[_0x7b30('0x1d')](_0x15cbd4)['json'](_0x34713e);}};}function respondWithFilteredResult(_0x62b48d,_0x380ae5){return function(_0x38bde9){if(_0x38bde9){var _0x274b56=typeof _0x380ae5[_0x7b30('0x1f')]===_0x7b30('0x20')&&typeof _0x380ae5['limit']===_0x7b30('0x20');var _0x38345e=_0x38bde9[_0x7b30('0x21')];var _0xd876a7=_0x274b56?0x0:_0x380ae5[_0x7b30('0x1f')];var _0x5c51d7=_0x274b56?_0x38bde9[_0x7b30('0x21')]:_0x380ae5[_0x7b30('0x1f')]+_0x380ae5[_0x7b30('0x22')];var _0x145dbe;if(_0x5c51d7>=_0x38345e){_0x5c51d7=_0x38345e;_0x145dbe=0xc8;}else{_0x145dbe=0xce;}_0x62b48d[_0x7b30('0x1d')](_0x145dbe);return _0x62b48d[_0x7b30('0x23')]('Content-Range',_0xd876a7+'-'+_0x5c51d7+'/'+_0x38345e)[_0x7b30('0x24')](_0x38bde9);}return null;};}function patchUpdates(_0xbfa4ae){return function(_0xca7522){try{jsonpatch[_0x7b30('0x25')](_0xca7522,_0xbfa4ae,!![]);}catch(_0xb1a2c7){return BPromise[_0x7b30('0x26')](_0xb1a2c7);}return _0xca7522[_0x7b30('0x27')]();};}function saveUpdates(_0x2686b7,_0x169bee){return function(_0x161515){if(_0x161515){return _0x161515[_0x7b30('0x28')](_0x2686b7)['then'](function(_0x534642){return _0x534642;});}return null;};}function removeEntity(_0x52c48f,_0x44faa1){return function(_0xd0e9e7){if(_0xd0e9e7){return _0xd0e9e7['destroy']()[_0x7b30('0x29')](function(){var _0x12f986=_0xd0e9e7[_0x7b30('0x2a')]({'plain':!![]});var _0x462731=_0x7b30('0x2b');return db[_0x7b30('0x2c')][_0x7b30('0x2d')]({'where':{'type':_0x462731,'resourceId':_0x12f986['id']}})['then'](function(){return _0xd0e9e7;});})['then'](function(){_0x52c48f[_0x7b30('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c6414,_0x4cdde4){return function(_0x16d21b){if(!_0x16d21b){_0x2c6414['sendStatus'](0x194);}return _0x16d21b;};}function handleError(_0x4f1b80,_0x27e779){_0x27e779=_0x27e779||0x1f4;return function(_0x3ae277){logger[_0x7b30('0x2e')](_0x3ae277['stack']);if(_0x3ae277[_0x7b30('0x2f')]){delete _0x3ae277[_0x7b30('0x2f')];}_0x4f1b80[_0x7b30('0x1d')](_0x27e779)['send'](_0x3ae277);};}exports[_0x7b30('0x30')]=function(_0x58792f,_0x10f7cd){var _0x141ec4={},_0x19e2f7={},_0x4ccc43={'count':0x0,'rows':[]};var _0x151c82=_['map'](db[_0x7b30('0x31')]['rawAttributes'],function(_0x4bb2ae){return{'name':_0x4bb2ae[_0x7b30('0x32')],'type':_0x4bb2ae[_0x7b30('0x33')][_0x7b30('0x34')]};});_0x19e2f7[_0x7b30('0x35')]=_['map'](_0x151c82,_0x7b30('0x2f'));_0x19e2f7['query']=_['keys'](_0x58792f[_0x7b30('0x36')]);_0x19e2f7[_0x7b30('0x37')]=_[_0x7b30('0x38')](_0x19e2f7['model'],_0x19e2f7[_0x7b30('0x36')]);_0x141ec4[_0x7b30('0x39')]=_[_0x7b30('0x38')](_0x19e2f7['model'],qs['fields'](_0x58792f[_0x7b30('0x36')]['fields']));_0x141ec4[_0x7b30('0x39')]=_0x141ec4[_0x7b30('0x39')][_0x7b30('0x3a')]?_0x141ec4[_0x7b30('0x39')]:_0x19e2f7[_0x7b30('0x35')];if(!_0x58792f[_0x7b30('0x36')]['hasOwnProperty'](_0x7b30('0x3b'))){_0x141ec4[_0x7b30('0x22')]=qs['limit'](_0x58792f[_0x7b30('0x36')]['limit']);_0x141ec4[_0x7b30('0x1f')]=qs[_0x7b30('0x1f')](_0x58792f[_0x7b30('0x36')]['offset']);}_0x141ec4[_0x7b30('0x3c')]=qs[_0x7b30('0x3d')](_0x58792f[_0x7b30('0x36')][_0x7b30('0x3d')]);_0x141ec4[_0x7b30('0x3e')]=qs[_0x7b30('0x37')](_['pick'](_0x58792f[_0x7b30('0x36')],_0x19e2f7['filters']),_0x151c82);if(_0x58792f[_0x7b30('0x36')][_0x7b30('0x3f')]){_0x141ec4[_0x7b30('0x3e')]=_[_0x7b30('0x40')](_0x141ec4[_0x7b30('0x3e')],{'$or':_[_0x7b30('0x41')](_0x151c82,function(_0x451c38){if(_0x451c38[_0x7b30('0x33')]!==_0x7b30('0x42')){var _0x165060={};_0x165060[_0x451c38[_0x7b30('0x2f')]]={'$like':'%'+_0x58792f[_0x7b30('0x36')][_0x7b30('0x3f')]+'%'};return _0x165060;}})});}_0x141ec4=_['merge']({},_0x141ec4,_0x58792f[_0x7b30('0x43')]);var _0x17d149={'where':_0x141ec4[_0x7b30('0x3e')]};return db['FaxQueue'][_0x7b30('0x21')](_0x17d149)['then'](function(_0x59e322){_0x4ccc43[_0x7b30('0x21')]=_0x59e322;if(_0x58792f[_0x7b30('0x36')]['includeAll']){_0x141ec4[_0x7b30('0x44')]=[{'all':!![]}];}return db[_0x7b30('0x31')][_0x7b30('0x45')](_0x141ec4);})['then'](function(_0x4629ab){_0x4ccc43[_0x7b30('0x46')]=_0x4629ab;return _0x4ccc43;})['then'](respondWithFilteredResult(_0x10f7cd,_0x141ec4))['catch'](handleError(_0x10f7cd,null));};exports[_0x7b30('0x47')]=function(_0x3c50be,_0x54382c){var _0x3ae9c3={'raw':!![],'where':{'id':_0x3c50be[_0x7b30('0x48')]['id']}},_0x16d0c3={};_0x16d0c3['model']=_[_0x7b30('0x49')](db[_0x7b30('0x31')][_0x7b30('0x4a')]);_0x16d0c3[_0x7b30('0x36')]=_['keys'](_0x3c50be['query']);_0x16d0c3[_0x7b30('0x37')]=_[_0x7b30('0x38')](_0x16d0c3[_0x7b30('0x35')],_0x16d0c3['query']);_0x3ae9c3['attributes']=_[_0x7b30('0x38')](_0x16d0c3[_0x7b30('0x35')],qs[_0x7b30('0x4b')](_0x3c50be['query'][_0x7b30('0x4b')]));_0x3ae9c3[_0x7b30('0x39')]=_0x3ae9c3[_0x7b30('0x39')][_0x7b30('0x3a')]?_0x3ae9c3[_0x7b30('0x39')]:_0x16d0c3['model'];if(_0x3c50be['query']['includeAll']){_0x3ae9c3[_0x7b30('0x44')]=[{'all':!![]}];}_0x3ae9c3=_[_0x7b30('0x40')]({},_0x3ae9c3,_0x3c50be[_0x7b30('0x43')]);return db[_0x7b30('0x31')][_0x7b30('0x4c')](_0x3ae9c3)[_0x7b30('0x29')](handleEntityNotFound(_0x54382c,null))[_0x7b30('0x29')](respondWithResult(_0x54382c,null))[_0x7b30('0x4d')](handleError(_0x54382c,null));};exports[_0x7b30('0x4e')]=function(_0x36e63b,_0xb42508){return db['FaxQueue'][_0x7b30('0x4e')](_0x36e63b[_0x7b30('0x4f')],{})[_0x7b30('0x29')](function(_0x35c1be){var _0xb004b4=_0x36e63b[_0x7b30('0x50')][_0x7b30('0x2a')]({'plain':!![]});if(!_0xb004b4)throw new Error(_0x7b30('0x51'));if(_0xb004b4['role']===_0x7b30('0x50')){var _0x1ee401=_0x35c1be[_0x7b30('0x2a')]({'plain':!![]});var _0xff6739=_0x7b30('0x2b');return db[_0x7b30('0x52')][_0x7b30('0x4c')]({'where':{'name':_0xff6739,'userProfileId':_0xb004b4[_0x7b30('0x53')]},'raw':!![]})[_0x7b30('0x29')](function(_0x6f487f){if(_0x6f487f&&_0x6f487f[_0x7b30('0x54')]===0x0){return db[_0x7b30('0x2c')][_0x7b30('0x4e')]({'name':_0x1ee401[_0x7b30('0x2f')],'resourceId':_0x1ee401['id'],'type':_0x6f487f[_0x7b30('0x2f')],'sectionId':_0x6f487f['id']},{})[_0x7b30('0x29')](function(){return _0x35c1be;});}else{return _0x35c1be;}})[_0x7b30('0x4d')](function(_0x306ddb){logger[_0x7b30('0x2e')](_0x7b30('0x55'),_0x306ddb);throw _0x306ddb;});}return _0x35c1be;})[_0x7b30('0x29')](respondWithResult(_0xb42508,0xc9))[_0x7b30('0x4d')](handleError(_0xb42508,null));};exports[_0x7b30('0x28')]=function(_0x48c9df,_0x1829cc){if(_0x48c9df[_0x7b30('0x4f')]['id']){delete _0x48c9df[_0x7b30('0x4f')]['id'];}return db['FaxQueue'][_0x7b30('0x4c')]({'where':{'id':_0x48c9df['params']['id']}})['then'](handleEntityNotFound(_0x1829cc,null))[_0x7b30('0x29')](saveUpdates(_0x48c9df[_0x7b30('0x4f')],null))[_0x7b30('0x29')](respondWithResult(_0x1829cc,null))['catch'](handleError(_0x1829cc,null));};exports[_0x7b30('0x2d')]=function(_0x36bf56,_0x881739){return db[_0x7b30('0x31')]['find']({'where':{'id':_0x36bf56['params']['id']}})[_0x7b30('0x29')](handleEntityNotFound(_0x881739,null))[_0x7b30('0x29')](removeEntity(_0x881739,null))[_0x7b30('0x4d')](handleError(_0x881739,null));};exports['describe']=function(_0x5d0d50,_0x4f76ab){return db[_0x7b30('0x31')][_0x7b30('0x56')]()[_0x7b30('0x29')](respondWithResult(_0x4f76ab,null))[_0x7b30('0x4d')](handleError(_0x4f76ab,null));};exports[_0x7b30('0x57')]=function(_0x1c1800,_0xdb2e7,_0x59adf6){var _0x4c8fb7={'raw':!![],'where':{}},_0x4501a7={},_0x5a70d3;return db[_0x7b30('0x31')][_0x7b30('0x58')]({'where':{'id':_0x1c1800[_0x7b30('0x48')]['id']}})['then'](handleEntityNotFound(_0xdb2e7,null))['then'](function(_0x125ed8){if(_0x125ed8){_0x5a70d3=_0x125ed8[_0x7b30('0x2a')]({'plain':!![]});_0x4501a7[_0x7b30('0x35')]=_[_0x7b30('0x49')](db[_0x7b30('0x59')][_0x7b30('0x4a')]);_0x4501a7[_0x7b30('0x36')]=_[_0x7b30('0x49')](_0x1c1800[_0x7b30('0x36')]);_0x4501a7[_0x7b30('0x37')]=_[_0x7b30('0x38')](_0x4501a7[_0x7b30('0x35')],_0x4501a7[_0x7b30('0x36')]);_0x4c8fb7['attributes']=_[_0x7b30('0x38')](_0x4501a7[_0x7b30('0x35')],qs['fields'](_0x1c1800['query'][_0x7b30('0x4b')]));_0x4c8fb7[_0x7b30('0x39')]=_0x4c8fb7[_0x7b30('0x39')]['length']?_0x4c8fb7[_0x7b30('0x39')]:_0x4501a7['model'];if(!_0x1c1800[_0x7b30('0x36')][_0x7b30('0x5a')](_0x7b30('0x3b'))){_0x4c8fb7[_0x7b30('0x22')]=qs['limit'](_0x1c1800[_0x7b30('0x36')]['limit']);_0x4c8fb7[_0x7b30('0x1f')]=qs[_0x7b30('0x1f')](_0x1c1800[_0x7b30('0x36')][_0x7b30('0x1f')]);}_0x4c8fb7[_0x7b30('0x3c')]=qs[_0x7b30('0x3d')](_0x1c1800[_0x7b30('0x36')][_0x7b30('0x3d')]);_0x4c8fb7[_0x7b30('0x3e')]=qs[_0x7b30('0x37')](_[_0x7b30('0x5b')](_0x1c1800[_0x7b30('0x36')],_0x4501a7[_0x7b30('0x37')]));_0x4c8fb7[_0x7b30('0x3e')][_0x7b30('0x5c')]=_0x125ed8['id'];if(_0x1c1800[_0x7b30('0x36')][_0x7b30('0x3f')]){_0x4c8fb7[_0x7b30('0x3e')]=_[_0x7b30('0x40')](_0x4c8fb7[_0x7b30('0x3e')],{'$or':_[_0x7b30('0x41')](_0x4c8fb7[_0x7b30('0x39')],function(_0x35a794){var _0x2df45e={};_0x2df45e[_0x35a794]={'$like':'%'+_0x1c1800[_0x7b30('0x36')][_0x7b30('0x3f')]+'%'};return _0x2df45e;})});}_0x4c8fb7=_[_0x7b30('0x40')]({},_0x4c8fb7,_0x1c1800[_0x7b30('0x43')]);return db[_0x7b30('0x59')][_0x7b30('0x45')](_0x4c8fb7);}})[_0x7b30('0x29')](function(_0x3a87c3){if(_0x3a87c3){return db['User'][_0x7b30('0x5d')]({'where':{'id':_['map'](_0x3a87c3,_0x7b30('0x5e')),'role':_0x7b30('0x5f')},'attributes':['id',_0x7b30('0x2f'),_0x7b30('0x60'),_0x7b30('0x61'),_0x7b30('0x62')]});}})[_0x7b30('0x29')](function(_0x4f3d9e){if(_0x4f3d9e){return{'count':_0x4f3d9e[_0x7b30('0x21')],'rows':_[_0x7b30('0x41')](_0x4f3d9e['rows'],function(_0x58274b){return{'membername':_0x58274b['name'],'UserId':_0x58274b['id'],'queue_name':_0x5a70d3['name'],'FaxQueueId':_0x5a70d3['id'],'interface':util['format'](_0x7b30('0x63'),_0x7b30('0x64'),_0x58274b['name']),'penalty':0x0,'paused':_0x58274b['faxPause'],'createdAt':_0x58274b[_0x7b30('0x62')],'updatedAt':_0x58274b[_0x7b30('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xdb2e7,_0x4c8fb7))[_0x7b30('0x4d')](handleError(_0xdb2e7,null));};exports[_0x7b30('0x65')]=function(_0x113a4c,_0x4f1e6e,_0x568c24){var _0x32a4af={};var _0x2a36e8={};var _0x46f5df;var _0x44fe71;return db[_0x7b30('0x31')][_0x7b30('0x58')]({'where':{'id':_0x113a4c[_0x7b30('0x48')]['id']}})['then'](handleEntityNotFound(_0x4f1e6e,null))[_0x7b30('0x29')](function(_0x4f7ae2){if(_0x4f7ae2){_0x46f5df=_0x4f7ae2;_0x2a36e8['model']=_[_0x7b30('0x49')](db['Team'][_0x7b30('0x4a')]);_0x2a36e8['query']=_['keys'](_0x113a4c['query']);_0x2a36e8[_0x7b30('0x37')]=_[_0x7b30('0x38')](_0x2a36e8[_0x7b30('0x35')],_0x2a36e8[_0x7b30('0x36')]);_0x32a4af['attributes']=_[_0x7b30('0x38')](_0x2a36e8[_0x7b30('0x35')],qs['fields'](_0x113a4c[_0x7b30('0x36')][_0x7b30('0x4b')]));_0x32a4af['attributes']=_0x32a4af[_0x7b30('0x39')]['length']?_0x32a4af[_0x7b30('0x39')]:_0x2a36e8[_0x7b30('0x35')];_0x32a4af[_0x7b30('0x3c')]=qs[_0x7b30('0x3d')](_0x113a4c[_0x7b30('0x36')]['sort']);_0x32a4af[_0x7b30('0x3e')]=qs[_0x7b30('0x37')](_['pick'](_0x113a4c[_0x7b30('0x36')],_0x2a36e8[_0x7b30('0x37')]));if(_0x113a4c[_0x7b30('0x36')][_0x7b30('0x3f')]){_0x32a4af[_0x7b30('0x3e')]=_[_0x7b30('0x40')](_0x32a4af['where'],{'$or':_[_0x7b30('0x41')](_0x32a4af[_0x7b30('0x39')],function(_0x16525d){var _0x19ea9d={};_0x19ea9d[_0x16525d]={'$like':'%'+_0x113a4c[_0x7b30('0x36')][_0x7b30('0x3f')]+'%'};return _0x19ea9d;})});}_0x32a4af=_[_0x7b30('0x40')]({},_0x32a4af,_0x113a4c[_0x7b30('0x43')]);return _0x46f5df['getTeams'](_0x32a4af);}})[_0x7b30('0x29')](function(_0x33e55d){if(_0x33e55d){_0x44fe71=_0x33e55d[_0x7b30('0x3a')];if(!_0x113a4c['query'][_0x7b30('0x5a')](_0x7b30('0x3b'))){_0x32a4af[_0x7b30('0x22')]=qs[_0x7b30('0x22')](_0x113a4c[_0x7b30('0x36')]['limit']);_0x32a4af['offset']=qs[_0x7b30('0x1f')](_0x113a4c['query']['offset']);}return _0x46f5df[_0x7b30('0x65')](_0x32a4af);}})[_0x7b30('0x29')](function(_0x28b1b3){if(_0x28b1b3){return _0x28b1b3?{'count':_0x44fe71,'rows':_0x28b1b3}:null;}})['then'](respondWithResult(_0x4f1e6e,null))[_0x7b30('0x4d')](handleError(_0x4f1e6e,null));};exports['addTeams']=function(_0x5be83c,_0x242fb0,_0x4bcad6){var _0x36d7b0=_0x5be83c[_0x7b30('0x4f')][_0x7b30('0x66')];return db[_0x7b30('0x67')]['findAll']({'where':{'id':_0x36d7b0},'attributes':['id'],'include':[{'model':db[_0x7b30('0x68')],'as':_0x7b30('0x69'),'attributes':['id',_0x7b30('0x2f'),_0x7b30('0x6a'),_0x7b30('0x6b'),'interface'],'raw':!![]}]})[_0x7b30('0x29')](function(_0x57ce04){if(_0x57ce04){var _0x528273=_[_0x7b30('0x6c')](_0x57ce04,function(_0x1a4b2e){var _0x593219=_0x1a4b2e[_0x7b30('0x2a')]({'plain':!![]});return _0x593219['Agents'];});return db[_0x7b30('0x31')]['find']({'where':{'id':_0x5be83c[_0x7b30('0x48')]['id']}})[_0x7b30('0x29')](function(_0x576af3){return db['sequelize'][_0x7b30('0x6d')](function(_0x46ad7a){return _0x576af3['addTeams'](_0x36d7b0,{'transaction':_0x46ad7a})[_0x7b30('0x29')](function(){return BPromise[_0x7b30('0x6e')](_0x528273,function(_0x446f36){return db[_0x7b30('0x59')][_0x7b30('0x6f')]({'where':{'UserId':_0x446f36['id'],'FaxQueueId':_0x5be83c[_0x7b30('0x48')]['id']},'transaction':_0x46ad7a});});})['then'](function(){_0x528273[_0x7b30('0x70')](function(_0x9a9a64){socket[_0x7b30('0x71')](_0x7b30('0x72'),{'UserId':_0x9a9a64['id'],'FaxQueueId':_0x576af3['id']});});});});});}})[_0x7b30('0x29')](respondWithStatusCode(_0x242fb0,null))['catch'](handleError(_0x242fb0,null));};exports['removeTeams']=function(_0x4a425d,_0x113bf7,_0x11a401){return db[_0x7b30('0x67')]['findAll']({'where':{'id':_0x4a425d[_0x7b30('0x36')][_0x7b30('0x66')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x7b30('0x29')](handleEntityNotFound(_0x113bf7,null))['then'](function(_0x17e0f3){var _0x41ec05=_[_0x7b30('0x41')](_0x17e0f3,'id');var _0x4d3e26=[];var _0x15a5aa=[];var _0x442213=squel['select']();_0x442213[_0x7b30('0x73')](_0x7b30('0x74'))[_0x7b30('0x75')](_0x7b30('0x76'),'tq')[_0x7b30('0x77')](_0x7b30('0x78'),'ut',_0x7b30('0x79'))[_0x7b30('0x3e')](_0x7b30('0x7a'),_0x4a425d[_0x7b30('0x48')]['id']);for(var _0x2e6077=0x0;_0x2e6077<_0x17e0f3[_0x7b30('0x3a')];_0x2e6077+=0x1){let _0x425849=_0x17e0f3[_0x2e6077];for(var _0x3a5960=0x0;_0x3a5960<_0x425849['Agents'][_0x7b30('0x3a')];_0x3a5960+=0x1){let _0x22bdc7=_0x425849['Agents'][_0x3a5960];var _0x71049c=_0x442213[_0x7b30('0x7b')]();_0x71049c[_0x7b30('0x3e')](_0x7b30('0x7c'),_0x22bdc7['id']);_0x15a5aa[_0x7b30('0x7d')](db[_0x7b30('0x7e')]['query'](_0x71049c['toString'](),{'type':db['sequelize'][_0x7b30('0x7f')][_0x7b30('0x80')]})['then'](function(_0x572c6e){if(_0x572c6e['length']===0x1){return _0x22bdc7['id'];}else{var _0x5a0ae4=_['every'](_[_0x7b30('0x41')](_0x572c6e,'TeamId'),function(_0x489441){return _[_0x7b30('0x81')](_0x41ec05,_0x489441);});if(_0x5a0ae4){return _0x22bdc7['id'];}}}));}}return BPromise[_0x7b30('0x82')](_0x15a5aa)[_0x7b30('0x29')](function(_0x4b5483){_0x4d3e26=_(_0x4d3e26)['union'](_0x4b5483)['compact']()[_0x7b30('0x83')]();return db['FaxQueue'][_0x7b30('0x4c')]({'where':{'id':_0x4a425d[_0x7b30('0x48')]['id']}})['then'](function(_0x3d32ff){return db[_0x7b30('0x7e')][_0x7b30('0x6d')](function(_0x37ab62){return _0x3d32ff[_0x7b30('0x84')](_0x4a425d['query'][_0x7b30('0x66')],{'transaction':_0x37ab62})[_0x7b30('0x29')](function(){if(!_[_0x7b30('0x85')](_0x4d3e26)){return _0x3d32ff[_0x7b30('0x86')](_0x4d3e26,{'transaction':_0x37ab62});}})[_0x7b30('0x29')](function(){_0x4d3e26[_0x7b30('0x70')](function(_0xd4d525){socket['emit']('userFaxQueue:remove',{'UserId':_0xd4d525,'FaxQueueId':_0x3d32ff['id']});});});});});});})[_0x7b30('0x29')](respondWithStatusCode(_0x113bf7,null))[_0x7b30('0x4d')](handleError(_0x113bf7,null));};exports[_0x7b30('0x87')]=function(_0x663e2d,_0x459698,_0x2ca304){return db[_0x7b30('0x31')][_0x7b30('0x4c')]({'where':{'id':_0x663e2d['params']['id']}})[_0x7b30('0x29')](handleEntityNotFound(_0x459698,null))[_0x7b30('0x29')](function(_0x4ce645){if(_0x4ce645){return _0x4ce645[_0x7b30('0x87')](_0x663e2d[_0x7b30('0x4f')][_0x7b30('0x66')],_[_0x7b30('0x88')](_0x663e2d[_0x7b30('0x4f')],['ids','id'])||{})[_0x7b30('0x89')](function(_0x368030){for(var _0x21467c=0x0;_0x21467c<_0x663e2d[_0x7b30('0x4f')][_0x7b30('0x66')][_0x7b30('0x3a')];_0x21467c+=0x1){socket[_0x7b30('0x71')](_0x7b30('0x72'),{'UserId':Number(_0x663e2d[_0x7b30('0x4f')][_0x7b30('0x66')][_0x21467c]),'FaxQueueId':Number(_0x663e2d[_0x7b30('0x48')]['id'])});}return _0x368030;});}})['then'](respondWithResult(_0x459698,null))[_0x7b30('0x4d')](handleError(_0x459698,null));};exports[_0x7b30('0x86')]=function(_0x519a10,_0x34529e,_0x2d925a){return db[_0x7b30('0x31')]['find']({'where':{'id':_0x519a10[_0x7b30('0x48')]['id']}})[_0x7b30('0x29')](handleEntityNotFound(_0x34529e,null))[_0x7b30('0x29')](function(_0x27235f){if(_0x27235f){return _0x27235f['removeAgents'](_0x519a10['query'][_0x7b30('0x66')])['then'](function(){if(_['isArray'](_0x519a10[_0x7b30('0x36')][_0x7b30('0x66')])){for(var _0x1ddbd0=0x0;_0x1ddbd0<_0x519a10[_0x7b30('0x36')]['ids'][_0x7b30('0x3a')];_0x1ddbd0+=0x1){socket[_0x7b30('0x71')](_0x7b30('0x8a'),{'UserId':Number(_0x519a10[_0x7b30('0x36')][_0x7b30('0x66')][_0x1ddbd0]),'FaxQueueId':Number(_0x519a10[_0x7b30('0x48')]['id'])});}}else{socket[_0x7b30('0x71')](_0x7b30('0x8a'),{'UserId':Number(_0x519a10['query']['ids']),'FaxQueueId':Number(_0x519a10[_0x7b30('0x48')]['id'])});}});}})[_0x7b30('0x29')](respondWithStatusCode(_0x34529e,null))[_0x7b30('0x4d')](handleError(_0x34529e,null));};exports[_0x7b30('0x8b')]=function(_0x20f397,_0x2863bd,_0x1e3de1){var _0x36fbe4={};var _0x4f1f3f={};var _0x53058b;var _0x626ef5;return db[_0x7b30('0x31')]['findOne']({'where':{'id':_0x20f397[_0x7b30('0x48')]['id']}})[_0x7b30('0x29')](handleEntityNotFound(_0x2863bd,null))['then'](function(_0x3a3791){if(_0x3a3791){_0x53058b=_0x3a3791;_0x4f1f3f[_0x7b30('0x35')]=_[_0x7b30('0x49')](db[_0x7b30('0x68')][_0x7b30('0x4a')]);_0x4f1f3f['query']=_[_0x7b30('0x49')](_0x20f397[_0x7b30('0x36')]);_0x4f1f3f['filters']=_[_0x7b30('0x38')](_0x4f1f3f['model'],_0x4f1f3f[_0x7b30('0x36')]);_0x36fbe4[_0x7b30('0x39')]=_['intersection'](_0x4f1f3f['model'],qs[_0x7b30('0x4b')](_0x20f397['query']['fields']));_0x36fbe4['attributes']=_0x36fbe4[_0x7b30('0x39')][_0x7b30('0x3a')]?_0x36fbe4[_0x7b30('0x39')]:_0x4f1f3f[_0x7b30('0x35')];_0x36fbe4[_0x7b30('0x3c')]=qs[_0x7b30('0x3d')](_0x20f397[_0x7b30('0x36')][_0x7b30('0x3d')]);_0x36fbe4[_0x7b30('0x3e')]=qs['filters'](_[_0x7b30('0x5b')](_0x20f397[_0x7b30('0x36')],_0x4f1f3f['filters']));if(_0x20f397[_0x7b30('0x36')][_0x7b30('0x3f')]){_0x36fbe4[_0x7b30('0x3e')]=_[_0x7b30('0x40')](_0x36fbe4['where'],{'$or':_[_0x7b30('0x41')](_0x36fbe4[_0x7b30('0x39')],function(_0x5966c0){var _0x546795={};_0x546795[_0x5966c0]={'$like':'%'+_0x20f397['query'][_0x7b30('0x3f')]+'%'};return _0x546795;})});}_0x36fbe4=_[_0x7b30('0x40')]({},_0x36fbe4,_0x20f397[_0x7b30('0x43')]);return _0x53058b['getAgents'](_0x36fbe4);}})[_0x7b30('0x29')](function(_0x1186ab){if(_0x1186ab){_0x626ef5=_0x1186ab[_0x7b30('0x3a')];if(!_0x20f397[_0x7b30('0x36')][_0x7b30('0x5a')](_0x7b30('0x3b'))){_0x36fbe4[_0x7b30('0x22')]=qs['limit'](_0x20f397[_0x7b30('0x36')][_0x7b30('0x22')]);_0x36fbe4[_0x7b30('0x1f')]=qs[_0x7b30('0x1f')](_0x20f397['query'][_0x7b30('0x1f')]);}return _0x53058b['getAgents'](_0x36fbe4);}})[_0x7b30('0x29')](function(_0x44edb5){if(_0x44edb5){return _0x44edb5?{'count':_0x626ef5,'rows':_0x44edb5}:null;}})[_0x7b30('0x29')](respondWithResult(_0x2863bd,null))[_0x7b30('0x4d')](handleError(_0x2863bd,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index fe6fefe..5728af6 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 _0x04dc=['emit','hasOwnProperty','../../mysqldb','FaxQueue','update','remove'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x04dc,0xa4));var _0xc04d=function(_0x4e85ec,_0x2913b6){_0x4e85ec=_0x4e85ec-0x0;var _0x1c1ab3=_0x04dc[_0x4e85ec];return _0x1c1ab3;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xc04d('0x0'))['db'][_0xc04d('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc04d('0x2'),'afterDestroy':_0xc04d('0x3')};function emitEvent(_0x4f764b){return function(_0xcbb4ce,_0x4abf48,_0x1db436){FaxQueueEvents['emit'](_0x4f764b+':'+_0xcbb4ce['id'],_0xcbb4ce);FaxQueueEvents[_0xc04d('0x4')](_0x4f764b,_0xcbb4ce);_0x1db436(null);};}for(var e in events){if(events[_0xc04d('0x5')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x886f=['hook','exports','events','FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x24bbc9,_0x49c2c2){var _0x176a0b=function(_0x3ea511){while(--_0x3ea511){_0x24bbc9['push'](_0x24bbc9['shift']());}};_0x176a0b(++_0x49c2c2);}(_0x886f,0x1c4));var _0xf886=function(_0x1aeae5,_0x44074d){_0x1aeae5=_0x1aeae5-0x0;var _0x59096d=_0x886f[_0x1aeae5];return _0x59096d;};'use strict';var EventEmitter=require(_0xf886('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0xf886('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xf886('0x2')](0x0);var events={'afterCreate':_0xf886('0x3'),'afterUpdate':_0xf886('0x4'),'afterDestroy':_0xf886('0x5')};function emitEvent(_0x4bbb33){return function(_0x5c8669,_0x1c8e42,_0x8f8a3f){FaxQueueEvents['emit'](_0x4bbb33+':'+_0x5c8669['id'],_0x5c8669);FaxQueueEvents[_0xf886('0x6')](_0x4bbb33,_0x5c8669);_0x8f8a3f(null);};}for(var e in events){if(events[_0xf886('0x7')](e)){var event=events[e];FaxQueue[_0xf886('0x8')](e,emitEvent(event));}}module[_0xf886('0x9')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index cf749b7..7f3fbda 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 _0x9938=['fax_queues','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./faxQueue.attributes','define','FaxQueue'];(function(_0x103f04,_0x2b783f){var _0x2b31da=function(_0xddb033){while(--_0xddb033){_0x103f04['push'](_0x103f04['shift']());}};_0x2b31da(++_0x2b783f);}(_0x9938,0x140));var _0x8993=function(_0x3a4f19,_0x2d47be){_0x3a4f19=_0x3a4f19-0x0;var _0x12e525=_0x9938[_0x3a4f19];return _0x12e525;};'use strict';var _=require('lodash');var util=require(_0x8993('0x0'));var logger=require(_0x8993('0x1'))(_0x8993('0x2'));var moment=require(_0x8993('0x3'));var BPromise=require('bluebird');var rp=require(_0x8993('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8993('0x5'));var config=require(_0x8993('0x6'));var attributes=require(_0x8993('0x7'));module['exports']=function(_0x35ebbf,_0x597dc7){return _0x35ebbf[_0x8993('0x8')](_0x8993('0x9'),attributes,{'tableName':_0x8993('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd4dc=['fax_queues','util','../../config/logger','api','rimraf','exports','FaxQueue'];(function(_0x2ed4e9,_0x5dc89b){var _0x515748=function(_0x5a0c67){while(--_0x5a0c67){_0x2ed4e9['push'](_0x2ed4e9['shift']());}};_0x515748(++_0x5dc89b);}(_0xd4dc,0x1ac));var _0xcd4d=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xd4dc[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require('lodash');var util=require(_0xcd4d('0x0'));var logger=require(_0xcd4d('0x1'))(_0xcd4d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcd4d('0x3'));var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module[_0xcd4d('0x4')]=function(_0x49ba89,_0x297ec4){return _0x49ba89['define'](_0xcd4d('0x5'),attributes,{'tableName':_0xcd4d('0x6'),'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 472b5ea..45f8faf 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 _0xcd40=['localhost','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFaxQueue','FaxQueue','findAll','options','raw','attributes','limit','include','map','model','ShowFaxQueue','where','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','redis','defaults'];(function(_0x4214e2,_0x246901){var _0x53f631=function(_0x233ce3){while(--_0x233ce3){_0x4214e2['push'](_0x4214e2['shift']());}};_0x53f631(++_0x246901);}(_0xcd40,0x1a6));var _0x0cd4=function(_0x2d58bb,_0xa1e76e){_0x2d58bb=_0x2d58bb-0x0;var _0x3515e6=_0xcd40[_0x2d58bb];return _0x3515e6;};'use strict';var _=require('lodash');var util=require(_0x0cd4('0x0'));var moment=require(_0x0cd4('0x1'));var BPromise=require('bluebird');var rs=require(_0x0cd4('0x2'));var fs=require('fs');var Redis=require(_0x0cd4('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0cd4('0x4'));var config=require(_0x0cd4('0x5'));var jayson=require(_0x0cd4('0x6'));var client=jayson['client'][_0x0cd4('0x7')]({'port':0x232a});config[_0x0cd4('0x8')]=_[_0x0cd4('0x9')](config[_0x0cd4('0x8')],{'host':_0x0cd4('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0cd4('0x8')]));require('./faxQueue.socket')[_0x0cd4('0xb')](socket);function respondWithRpcPromise(_0x1c0d3c,_0xed874a,_0x1d6bef){return new BPromise(function(_0x845852,_0x229dfb){return client[_0x0cd4('0xc')](_0x1c0d3c,_0x1d6bef)[_0x0cd4('0xd')](function(_0x68efc1){logger[_0x0cd4('0xe')](_0x0cd4('0xf'),_0xed874a,_0x0cd4('0x10'));logger[_0x0cd4('0x11')](_0x0cd4('0x12'),_0xed874a,_0x0cd4('0x10'),JSON[_0x0cd4('0x13')](_0x68efc1));if(_0x68efc1[_0x0cd4('0x14')]){if(_0x68efc1[_0x0cd4('0x14')][_0x0cd4('0x15')]===0x1f4){logger[_0x0cd4('0x14')](_0x0cd4('0xf'),_0xed874a,_0x68efc1['error'][_0x0cd4('0x16')]);return _0x229dfb(_0x68efc1['error'][_0x0cd4('0x16')]);}logger[_0x0cd4('0x14')](_0x0cd4('0xf'),_0xed874a,_0x68efc1[_0x0cd4('0x14')][_0x0cd4('0x16')]);return _0x845852(_0x68efc1[_0x0cd4('0x14')][_0x0cd4('0x16')]);}else{logger[_0x0cd4('0xe')](_0x0cd4('0xf'),_0xed874a,'request\x20sent');_0x845852(_0x68efc1['result'][_0x0cd4('0x16')]);}})[_0x0cd4('0x17')](function(_0x399b8d){logger['error'](_0x0cd4('0xf'),_0xed874a,_0x399b8d);_0x229dfb(_0x399b8d);});});}exports[_0x0cd4('0x18')]=function(_0x4e622e){var _0x4cdd27=this;return new Promise(function(_0x172f58,_0x4c5eb9){return db[_0x0cd4('0x19')][_0x0cd4('0x1a')]({'raw':_0x4e622e[_0x0cd4('0x1b')]?_0x4e622e[_0x0cd4('0x1b')][_0x0cd4('0x1c')]===undefined?!![]:![]:!![],'where':_0x4e622e[_0x0cd4('0x1b')]?_0x4e622e['options']['where']||null:null,'attributes':_0x4e622e['options']?_0x4e622e[_0x0cd4('0x1b')][_0x0cd4('0x1d')]||null:null,'limit':_0x4e622e[_0x0cd4('0x1b')]?_0x4e622e['options'][_0x0cd4('0x1e')]||null:null,'include':_0x4e622e[_0x0cd4('0x1b')]?_0x4e622e[_0x0cd4('0x1b')][_0x0cd4('0x1f')]?_[_0x0cd4('0x20')](_0x4e622e[_0x0cd4('0x1b')]['include'],function(_0x268a23){return{'model':db[_0x268a23['model']],'as':_0x268a23['as'],'attributes':_0x268a23[_0x0cd4('0x1d')],'include':_0x268a23['include']?_['map'](_0x268a23[_0x0cd4('0x1f')],function(_0x475e8c){return{'model':db[_0x475e8c[_0x0cd4('0x21')]],'as':_0x475e8c['as'],'attributes':_0x475e8c[_0x0cd4('0x1d')],'include':_0x475e8c[_0x0cd4('0x1f')]?_[_0x0cd4('0x20')](_0x475e8c[_0x0cd4('0x1f')],function(_0x637193){return{'model':db[_0x637193[_0x0cd4('0x21')]],'as':_0x637193['as'],'attributes':_0x637193['attributes']};}):[]};}):[]};}):[]:[]})[_0x0cd4('0xd')](function(_0x408a7a){logger[_0x0cd4('0xe')](_0x0cd4('0x18'),_0x4e622e);logger[_0x0cd4('0x11')]('GetFaxQueue',_0x4e622e,JSON[_0x0cd4('0x13')](_0x408a7a));_0x172f58(_0x408a7a);})[_0x0cd4('0x17')](function(_0x31145b){logger[_0x0cd4('0x14')](_0x0cd4('0x18'),_0x31145b[_0x0cd4('0x16')],_0x4e622e);_0x4c5eb9(_0x4cdd27[_0x0cd4('0x14')](0x1f4,_0x31145b[_0x0cd4('0x16')]));});});};exports[_0x0cd4('0x22')]=function(_0xc83afe){var _0x42ed90=this;return new Promise(function(_0x52be92,_0x23461f){return db[_0x0cd4('0x19')]['find']({'raw':_0xc83afe['options']?_0xc83afe[_0x0cd4('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0xc83afe['options']?_0xc83afe[_0x0cd4('0x1b')][_0x0cd4('0x23')]||null:null,'attributes':_0xc83afe[_0x0cd4('0x1b')]?_0xc83afe[_0x0cd4('0x1b')]['attributes']||null:null,'include':_0xc83afe[_0x0cd4('0x1b')]?_0xc83afe[_0x0cd4('0x1b')][_0x0cd4('0x1f')]?_[_0x0cd4('0x20')](_0xc83afe[_0x0cd4('0x1b')][_0x0cd4('0x1f')],function(_0x3d7ffe){return{'model':db[_0x3d7ffe[_0x0cd4('0x21')]],'as':_0x3d7ffe['as'],'attributes':_0x3d7ffe[_0x0cd4('0x1d')],'include':_0x3d7ffe[_0x0cd4('0x1f')]?_[_0x0cd4('0x20')](_0x3d7ffe[_0x0cd4('0x1f')],function(_0xf80092){return{'model':db[_0xf80092[_0x0cd4('0x21')]],'as':_0xf80092['as'],'attributes':_0xf80092[_0x0cd4('0x1d')],'include':_0xf80092['include']?_['map'](_0xf80092[_0x0cd4('0x1f')],function(_0x3ce9f6){return{'model':db[_0x3ce9f6[_0x0cd4('0x21')]],'as':_0x3ce9f6['as'],'attributes':_0x3ce9f6[_0x0cd4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0cd4('0xd')](function(_0x1a8e35){logger[_0x0cd4('0xe')](_0x0cd4('0x22'),_0xc83afe);logger[_0x0cd4('0x11')](_0x0cd4('0x22'),_0xc83afe,JSON['stringify'](_0x1a8e35));_0x52be92(_0x1a8e35);})[_0x0cd4('0x17')](function(_0x5614dc){logger[_0x0cd4('0x14')](_0x0cd4('0x22'),_0x5614dc[_0x0cd4('0x16')],_0xc83afe);_0x23461f(_0x42ed90[_0x0cd4('0x14')](0x1f4,_0x5614dc[_0x0cd4('0x16')]));});});}; \ No newline at end of file +var _0xd5dd=['./faxQueue.socket','request','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetFaxQueue','FaxQueue','findAll','raw','options','where','attributes','limit','map','include','model','then','ShowFaxQueue','find','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter'];(function(_0xf176a6,_0xa6f3ab){var _0x4ee953=function(_0xd9bd2b){while(--_0xd9bd2b){_0xf176a6['push'](_0xf176a6['shift']());}};_0x4ee953(++_0xa6f3ab);}(_0xd5dd,0x8b));var _0xdd5d=function(_0x3d86da,_0x282644){_0x3d86da=_0x3d86da-0x0;var _0xdea050=_0xd5dd[_0x3d86da];return _0xdea050;};'use strict';var _=require(_0xdd5d('0x0'));var util=require('util');var moment=require(_0xdd5d('0x1'));var BPromise=require(_0xdd5d('0x2'));var rs=require(_0xdd5d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdd5d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd5d('0x5'))(_0xdd5d('0x6'));var config=require('../../config/environment');var jayson=require(_0xdd5d('0x7'));var client=jayson['client'][_0xdd5d('0x8')]({'port':0x232a});config[_0xdd5d('0x9')]=_[_0xdd5d('0xa')](config[_0xdd5d('0x9')],{'host':_0xdd5d('0xb'),'port':0x18eb});var socket=require(_0xdd5d('0xc'))(new Redis(config['redis']));require(_0xdd5d('0xd'))['register'](socket);function respondWithRpcPromise(_0x5cbd6f,_0x5a1bda,_0xe451fe){return new BPromise(function(_0x106009,_0x9edf3e){return client[_0xdd5d('0xe')](_0x5cbd6f,_0xe451fe)['then'](function(_0x55cb8f){logger[_0xdd5d('0xf')](_0xdd5d('0x10'),_0x5a1bda,_0xdd5d('0x11'));logger[_0xdd5d('0x12')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x5a1bda,_0xdd5d('0x11'),JSON[_0xdd5d('0x13')](_0x55cb8f));if(_0x55cb8f[_0xdd5d('0x14')]){if(_0x55cb8f[_0xdd5d('0x14')][_0xdd5d('0x15')]===0x1f4){logger[_0xdd5d('0x14')]('FaxQueue,\x20%s,\x20%s',_0x5a1bda,_0x55cb8f[_0xdd5d('0x14')][_0xdd5d('0x16')]);return _0x9edf3e(_0x55cb8f[_0xdd5d('0x14')][_0xdd5d('0x16')]);}logger[_0xdd5d('0x14')](_0xdd5d('0x10'),_0x5a1bda,_0x55cb8f[_0xdd5d('0x14')][_0xdd5d('0x16')]);return _0x106009(_0x55cb8f['error'][_0xdd5d('0x16')]);}else{logger[_0xdd5d('0xf')](_0xdd5d('0x10'),_0x5a1bda,_0xdd5d('0x11'));_0x106009(_0x55cb8f['result'][_0xdd5d('0x16')]);}})[_0xdd5d('0x17')](function(_0x1ae689){logger[_0xdd5d('0x14')](_0xdd5d('0x10'),_0x5a1bda,_0x1ae689);_0x9edf3e(_0x1ae689);});});}exports[_0xdd5d('0x18')]=function(_0x509b71){var _0x57171c=this;return new Promise(function(_0x333d64,_0xcc22d1){return db[_0xdd5d('0x19')][_0xdd5d('0x1a')]({'raw':_0x509b71['options']?_0x509b71['options'][_0xdd5d('0x1b')]===undefined?!![]:![]:!![],'where':_0x509b71[_0xdd5d('0x1c')]?_0x509b71[_0xdd5d('0x1c')][_0xdd5d('0x1d')]||null:null,'attributes':_0x509b71['options']?_0x509b71[_0xdd5d('0x1c')][_0xdd5d('0x1e')]||null:null,'limit':_0x509b71[_0xdd5d('0x1c')]?_0x509b71[_0xdd5d('0x1c')][_0xdd5d('0x1f')]||null:null,'include':_0x509b71[_0xdd5d('0x1c')]?_0x509b71['options']['include']?_[_0xdd5d('0x20')](_0x509b71[_0xdd5d('0x1c')][_0xdd5d('0x21')],function(_0xf94121){return{'model':db[_0xf94121['model']],'as':_0xf94121['as'],'attributes':_0xf94121[_0xdd5d('0x1e')],'include':_0xf94121['include']?_[_0xdd5d('0x20')](_0xf94121['include'],function(_0x54fe52){return{'model':db[_0x54fe52[_0xdd5d('0x22')]],'as':_0x54fe52['as'],'attributes':_0x54fe52[_0xdd5d('0x1e')],'include':_0x54fe52[_0xdd5d('0x21')]?_['map'](_0x54fe52['include'],function(_0x4d115a){return{'model':db[_0x4d115a[_0xdd5d('0x22')]],'as':_0x4d115a['as'],'attributes':_0x4d115a[_0xdd5d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xdd5d('0x23')](function(_0x14e5c9){logger[_0xdd5d('0xf')](_0xdd5d('0x18'),_0x509b71);logger[_0xdd5d('0x12')]('GetFaxQueue',_0x509b71,JSON[_0xdd5d('0x13')](_0x14e5c9));_0x333d64(_0x14e5c9);})[_0xdd5d('0x17')](function(_0x5b559a){logger[_0xdd5d('0x14')](_0xdd5d('0x18'),_0x5b559a[_0xdd5d('0x16')],_0x509b71);_0xcc22d1(_0x57171c[_0xdd5d('0x14')](0x1f4,_0x5b559a['message']));});});};exports[_0xdd5d('0x24')]=function(_0x44eb80){var _0x251339=this;return new Promise(function(_0x15967f,_0x347b2f){return db[_0xdd5d('0x19')][_0xdd5d('0x25')]({'raw':_0x44eb80[_0xdd5d('0x1c')]?_0x44eb80['options']['raw']===undefined?!![]:![]:!![],'where':_0x44eb80['options']?_0x44eb80[_0xdd5d('0x1c')][_0xdd5d('0x1d')]||null:null,'attributes':_0x44eb80[_0xdd5d('0x1c')]?_0x44eb80[_0xdd5d('0x1c')]['attributes']||null:null,'include':_0x44eb80[_0xdd5d('0x1c')]?_0x44eb80[_0xdd5d('0x1c')]['include']?_['map'](_0x44eb80['options']['include'],function(_0x1612a0){return{'model':db[_0x1612a0[_0xdd5d('0x22')]],'as':_0x1612a0['as'],'attributes':_0x1612a0[_0xdd5d('0x1e')],'include':_0x1612a0[_0xdd5d('0x21')]?_[_0xdd5d('0x20')](_0x1612a0[_0xdd5d('0x21')],function(_0x142f89){return{'model':db[_0x142f89[_0xdd5d('0x22')]],'as':_0x142f89['as'],'attributes':_0x142f89['attributes'],'include':_0x142f89[_0xdd5d('0x21')]?_['map'](_0x142f89[_0xdd5d('0x21')],function(_0x1c45f7){return{'model':db[_0x1c45f7[_0xdd5d('0x22')]],'as':_0x1c45f7['as'],'attributes':_0x1c45f7[_0xdd5d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xdd5d('0x23')](function(_0x4b1dda){logger[_0xdd5d('0xf')](_0xdd5d('0x24'),_0x44eb80);logger[_0xdd5d('0x12')](_0xdd5d('0x24'),_0x44eb80,JSON['stringify'](_0x4b1dda));_0x15967f(_0x4b1dda);})[_0xdd5d('0x17')](function(_0x4f8ce9){logger['error'](_0xdd5d('0x24'),_0x4f8ce9[_0xdd5d('0x16')],_0x44eb80);_0x347b2f(_0x251339[_0xdd5d('0x14')](0x1f4,_0x4f8ce9[_0xdd5d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 9458cf7..6ff8eb8 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 _0x6d15=['remove','emit','removeListener','register','length','./faxQueue.events','save'];(function(_0x29ebcc,_0x3d93ae){var _0x38ee44=function(_0x106ab7){while(--_0x106ab7){_0x29ebcc['push'](_0x29ebcc['shift']());}};_0x38ee44(++_0x3d93ae);}(_0x6d15,0x1c5));var _0x56d1=function(_0x3b1c1c,_0x270b7f){_0x3b1c1c=_0x3b1c1c-0x0;var _0x2d37d5=_0x6d15[_0x3b1c1c];return _0x2d37d5;};'use strict';var FaxQueueEvents=require(_0x56d1('0x0'));var events=[_0x56d1('0x1'),_0x56d1('0x2'),'update'];function createListener(_0x861fcd,_0xcb1406){return function(_0x58353c){_0xcb1406[_0x56d1('0x3')](_0x861fcd,_0x58353c);};}function removeListener(_0x210552,_0x72e0a6){return function(){FaxQueueEvents[_0x56d1('0x4')](_0x210552,_0x72e0a6);};}exports[_0x56d1('0x5')]=function(_0x255964){for(var _0x344248=0x0,_0x20f33e=events[_0x56d1('0x6')];_0x344248<_0x20f33e;_0x344248++){var _0x544d61=events[_0x344248];var _0x4d5103=createListener('faxQueue:'+_0x544d61,_0x255964);FaxQueueEvents['on'](_0x544d61,_0x4d5103);}}; \ No newline at end of file +var _0x843b=['./faxQueue.events','save','removeListener','register','faxQueue:'];(function(_0x38edc7,_0x5d0576){var _0x3eb41e=function(_0x2c0917){while(--_0x2c0917){_0x38edc7['push'](_0x38edc7['shift']());}};_0x3eb41e(++_0x5d0576);}(_0x843b,0x91));var _0xb843=function(_0x56adc8,_0x20a3b1){_0x56adc8=_0x56adc8-0x0;var _0x399f1e=_0x843b[_0x56adc8];return _0x399f1e;};'use strict';var FaxQueueEvents=require(_0xb843('0x0'));var events=[_0xb843('0x1'),'remove','update'];function createListener(_0x2d214b,_0x25fb9e){return function(_0x2e36cd){_0x25fb9e['emit'](_0x2d214b,_0x2e36cd);};}function removeListener(_0xa180bd,_0x310c9e){return function(){FaxQueueEvents[_0xb843('0x2')](_0xa180bd,_0x310c9e);};}exports[_0xb843('0x3')]=function(_0x5e781f){for(var _0x1a0c43=0x0,_0x330cfc=events['length'];_0x1a0c43<_0x330cfc;_0x1a0c43++){var _0xf00ead=events[_0x1a0c43];var _0x383f11=createListener(_0xb843('0x4')+_0xf00ead,_0x5e781f);FaxQueueEvents['on'](_0xf00ead,_0x383f11);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index c64ae70..ea17e8f 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 _0x0eeb=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/:id','show','/:id/members','/:id/teams','/:id/users','getAgents','addTeams','addAgents','put','update','delete','destroy','removeAgents','multer','util','path'];(function(_0x427c25,_0x31e6a4){var _0x28521f=function(_0xae80f2){while(--_0xae80f2){_0x427c25['push'](_0x427c25['shift']());}};_0x28521f(++_0x31e6a4);}(_0x0eeb,0xc5));var _0xb0ee=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0eeb[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xb0ee('0x0'));var util=require(_0xb0ee('0x1'));var path=require(_0xb0ee('0x2'));var timeout=require(_0xb0ee('0x3'));var express=require(_0xb0ee('0x4'));var router=express[_0xb0ee('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb0ee('0x6'));var config=require(_0xb0ee('0x7'));var controller=require(_0xb0ee('0x8'));router[_0xb0ee('0x9')]('/',auth[_0xb0ee('0xa')](),controller[_0xb0ee('0xb')]);router[_0xb0ee('0x9')]('/describe',auth[_0xb0ee('0xa')](),controller['describe']);router[_0xb0ee('0x9')](_0xb0ee('0xc'),auth[_0xb0ee('0xa')](),controller[_0xb0ee('0xd')]);router[_0xb0ee('0x9')](_0xb0ee('0xe'),auth['isAuthenticated'](),controller['getMembers']);router[_0xb0ee('0x9')](_0xb0ee('0xf'),auth['isAuthenticated'](),controller['getTeams']);router[_0xb0ee('0x9')](_0xb0ee('0x10'),auth[_0xb0ee('0xa')](),controller[_0xb0ee('0x11')]);router['post']('/',auth[_0xb0ee('0xa')](),controller['create']);router['post']('/:id/teams',auth[_0xb0ee('0xa')](),controller[_0xb0ee('0x12')]);router['post'](_0xb0ee('0x10'),auth[_0xb0ee('0xa')](),controller[_0xb0ee('0x13')]);router[_0xb0ee('0x14')](_0xb0ee('0xc'),auth[_0xb0ee('0xa')](),controller[_0xb0ee('0x15')]);router[_0xb0ee('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xb0ee('0x17')]);router['delete'](_0xb0ee('0xf'),auth[_0xb0ee('0xa')](),controller['removeTeams']);router['delete'](_0xb0ee('0x10'),auth[_0xb0ee('0xa')](),controller[_0xb0ee('0x18')]);module['exports']=router; \ No newline at end of file +var _0x90b1=['addTeams','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create'];(function(_0x131627,_0x642b7a){var _0x10a0b1=function(_0x410d58){while(--_0x410d58){_0x131627['push'](_0x131627['shift']());}};_0x10a0b1(++_0x642b7a);}(_0x90b1,0x1bb));var _0x190b=function(_0x57f91f,_0x21cf17){_0x57f91f=_0x57f91f-0x0;var _0x4deca6=_0x90b1[_0x57f91f];return _0x4deca6;};'use strict';var multer=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var path=require(_0x190b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x190b('0x3')]();var fs_extra=require(_0x190b('0x4'));var auth=require(_0x190b('0x5'));var interaction=require(_0x190b('0x6'));var config=require('../../config/environment');var controller=require('./faxQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x190b('0x7')]);router[_0x190b('0x8')](_0x190b('0x9'),auth[_0x190b('0xa')](),controller[_0x190b('0xb')]);router[_0x190b('0x8')](_0x190b('0xc'),auth['isAuthenticated'](),controller[_0x190b('0xd')]);router[_0x190b('0x8')](_0x190b('0xe'),auth[_0x190b('0xa')](),controller[_0x190b('0xf')]);router[_0x190b('0x8')](_0x190b('0x10'),auth[_0x190b('0xa')](),controller['getTeams']);router[_0x190b('0x8')](_0x190b('0x11'),auth['isAuthenticated'](),controller[_0x190b('0x12')]);router[_0x190b('0x13')]('/',auth[_0x190b('0xa')](),controller[_0x190b('0x14')]);router[_0x190b('0x13')](_0x190b('0x10'),auth[_0x190b('0xa')](),controller[_0x190b('0x15')]);router[_0x190b('0x13')](_0x190b('0x11'),auth[_0x190b('0xa')](),controller[_0x190b('0x16')]);router[_0x190b('0x17')](_0x190b('0xc'),auth[_0x190b('0xa')](),controller[_0x190b('0x18')]);router[_0x190b('0x19')]('/:id',auth[_0x190b('0xa')](),controller['destroy']);router[_0x190b('0x19')](_0x190b('0x10'),auth[_0x190b('0xa')](),controller[_0x190b('0x1a')]);router['delete'](_0x190b('0x11'),auth[_0x190b('0xa')](),controller[_0x190b('0x1b')]);module[_0x190b('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 7ac87e0..29313fa 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 _0xe0bf=['STRING','DATE','sequelize'];(function(_0x45a17a,_0x48e1b7){var _0x3f04cf=function(_0x2c4cb5){while(--_0x2c4cb5){_0x45a17a['push'](_0x45a17a['shift']());}};_0x3f04cf(++_0x48e1b7);}(_0xe0bf,0xa7));var _0xfe0b=function(_0x30f917,_0x5e5b21){_0x30f917=_0x30f917-0x0;var _0x318fb3=_0xe0bf[_0x30f917];return _0x318fb3;};'use strict';var moment=require('moment');var Sequelize=require(_0xfe0b('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xfe0b('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xfe0b('0x1')]},'joinAt':{'type':Sequelize[_0xfe0b('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xfe0b('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xfe0b('0x1')]}}; \ No newline at end of file +var _0xd60b=['sequelize','STRING','DATE'];(function(_0x27650e,_0x278f7a){var _0x28fe08=function(_0x476eee){while(--_0x476eee){_0x27650e['push'](_0x27650e['shift']());}};_0x28fe08(++_0x278f7a);}(_0xd60b,0x198));var _0xbd60=function(_0x23a0b8,_0x5d9f58){_0x23a0b8=_0x23a0b8-0x0;var _0x3490df=_0xd60b[_0x23a0b8];return _0x3490df;};'use strict';var moment=require('moment');var Sequelize=require(_0xbd60('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xbd60('0x1')]},'joinAt':{'type':Sequelize[_0xbd60('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xbd60('0x2')]},'exitAt':{'type':Sequelize[_0xbd60('0x2')]},'reason':{'type':Sequelize[_0xbd60('0x1')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 86596cb..2e2faea 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 _0x949d=['path','sox','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','name','send','index','FaxQueueReport','key','map','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','rows','show','params','keys','rawAttributes','find','catch','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0xdc0397,_0x20d1f1){var _0x553d02=function(_0x364781){while(--_0x364781){_0xdc0397['push'](_0xdc0397['shift']());}};_0x553d02(++_0x20d1f1);}(_0x949d,0x162));var _0xd949=function(_0x58f484,_0x4328cf){_0x58f484=_0x58f484-0x0;var _0x124f9c=_0x949d[_0x58f484];return _0x124f9c;};'use strict';var emlformat=require(_0xd949('0x0'));var rimraf=require(_0xd949('0x1'));var zipdir=require(_0xd949('0x2'));var jsonpatch=require(_0xd949('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd949('0x4'));var Mustache=require(_0xd949('0x5'));var util=require('util');var path=require(_0xd949('0x6'));var sox=require(_0xd949('0x7'));var csv=require('to-csv');var ejs=require(_0xd949('0x8'));var fs=require('fs');var fs_extra=require(_0xd949('0x9'));var _=require(_0xd949('0xa'));var squel=require('squel');var crypto=require(_0xd949('0xb'));var jsforce=require(_0xd949('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd949('0xd'));var Papa=require(_0xd949('0xe'));var Redis=require(_0xd949('0xf'));var authService=require(_0xd949('0x10'));var qs=require(_0xd949('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd949('0x12'))(_0xd949('0x13'));var utils=require(_0xd949('0x14'));var config=require(_0xd949('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd949('0x16'))['db'];function respondWithStatusCode(_0x4e9244,_0xfe1b0f){_0xfe1b0f=_0xfe1b0f||0xcc;return function(_0x182284){if(_0x182284){return _0x4e9244[_0xd949('0x17')](_0xfe1b0f);}return _0x4e9244[_0xd949('0x18')](_0xfe1b0f)[_0xd949('0x19')]();};}function respondWithResult(_0x2a7fe8,_0x4eb028){_0x4eb028=_0x4eb028||0xc8;return function(_0x319286){if(_0x319286){return _0x2a7fe8[_0xd949('0x18')](_0x4eb028)[_0xd949('0x1a')](_0x319286);}};}function respondWithFilteredResult(_0x45870e,_0x50ee4d){return function(_0x16f1ad){if(_0x16f1ad){var _0x1f4fb4=typeof _0x50ee4d[_0xd949('0x1b')]===_0xd949('0x1c')&&typeof _0x50ee4d[_0xd949('0x1d')]===_0xd949('0x1c');var _0x1b50f0=_0x16f1ad['count'];var _0x37614d=_0x1f4fb4?0x0:_0x50ee4d[_0xd949('0x1b')];var _0x5a0790=_0x1f4fb4?_0x16f1ad[_0xd949('0x1e')]:_0x50ee4d[_0xd949('0x1b')]+_0x50ee4d[_0xd949('0x1d')];var _0x2f5ecf;if(_0x5a0790>=_0x1b50f0){_0x5a0790=_0x1b50f0;_0x2f5ecf=0xc8;}else{_0x2f5ecf=0xce;}_0x45870e[_0xd949('0x18')](_0x2f5ecf);return _0x45870e['set'](_0xd949('0x1f'),_0x37614d+'-'+_0x5a0790+'/'+_0x1b50f0)[_0xd949('0x1a')](_0x16f1ad);}return null;};}function patchUpdates(_0x56d8f2){return function(_0x582d8e){try{jsonpatch[_0xd949('0x20')](_0x582d8e,_0x56d8f2,!![]);}catch(_0xb06b83){return BPromise[_0xd949('0x21')](_0xb06b83);}return _0x582d8e[_0xd949('0x22')]();};}function saveUpdates(_0x5e69b3,_0x478f5b){return function(_0x1c0a66){if(_0x1c0a66){return _0x1c0a66[_0xd949('0x23')](_0x5e69b3)[_0xd949('0x24')](function(_0xf0cc12){return _0xf0cc12;});}return null;};}function removeEntity(_0x1bff18,_0x38978f){return function(_0x94a7a8){if(_0x94a7a8){return _0x94a7a8['destroy']()[_0xd949('0x24')](function(){_0x1bff18[_0xd949('0x18')](0xcc)[_0xd949('0x19')]();});}};}function handleEntityNotFound(_0x32701a,_0x58adcc){return function(_0x103921){if(!_0x103921){_0x32701a[_0xd949('0x17')](0x194);}return _0x103921;};}function handleError(_0x1e9abd,_0xfd040a){_0xfd040a=_0xfd040a||0x1f4;return function(_0x31811d){logger['error'](_0x31811d['stack']);if(_0x31811d[_0xd949('0x25')]){delete _0x31811d[_0xd949('0x25')];}_0x1e9abd['status'](_0xfd040a)[_0xd949('0x26')](_0x31811d);};}exports[_0xd949('0x27')]=function(_0x4cf485,_0x56aeab){var _0x298ed2={},_0x263a42={},_0x2db741={'count':0x0,'rows':[]};var _0x27a36c=_['map'](db[_0xd949('0x28')]['rawAttributes'],function(_0x3c729b){return{'name':_0x3c729b['fieldName'],'type':_0x3c729b['type'][_0xd949('0x29')]};});_0x263a42['model']=_[_0xd949('0x2a')](_0x27a36c,_0xd949('0x25'));_0x263a42['query']=_['keys'](_0x4cf485[_0xd949('0x2b')]);_0x263a42[_0xd949('0x2c')]=_['intersection'](_0x263a42[_0xd949('0x2d')],_0x263a42['query']);_0x298ed2[_0xd949('0x2e')]=_[_0xd949('0x2f')](_0x263a42['model'],qs['fields'](_0x4cf485[_0xd949('0x2b')][_0xd949('0x30')]));_0x298ed2[_0xd949('0x2e')]=_0x298ed2[_0xd949('0x2e')][_0xd949('0x31')]?_0x298ed2[_0xd949('0x2e')]:_0x263a42[_0xd949('0x2d')];if(!_0x4cf485[_0xd949('0x2b')][_0xd949('0x32')](_0xd949('0x33'))){_0x298ed2[_0xd949('0x1d')]=qs[_0xd949('0x1d')](_0x4cf485[_0xd949('0x2b')][_0xd949('0x1d')]);_0x298ed2['offset']=qs[_0xd949('0x1b')](_0x4cf485[_0xd949('0x2b')][_0xd949('0x1b')]);}_0x298ed2[_0xd949('0x34')]=qs[_0xd949('0x35')](_0x4cf485['query']['sort']);_0x298ed2[_0xd949('0x36')]=qs[_0xd949('0x2c')](_[_0xd949('0x37')](_0x4cf485[_0xd949('0x2b')],_0x263a42[_0xd949('0x2c')]),_0x27a36c);if(_0x4cf485[_0xd949('0x2b')]['filter']){_0x298ed2['where']=_[_0xd949('0x38')](_0x298ed2['where'],{'$or':_[_0xd949('0x2a')](_0x27a36c,function(_0x319bad){if(_0x319bad[_0xd949('0x39')]!==_0xd949('0x3a')){var _0x64a235={};_0x64a235[_0x319bad[_0xd949('0x25')]]={'$like':'%'+_0x4cf485[_0xd949('0x2b')][_0xd949('0x3b')]+'%'};return _0x64a235;}})});}_0x298ed2=_[_0xd949('0x38')]({},_0x298ed2,_0x4cf485[_0xd949('0x3c')]);var _0x3c5810={'where':_0x298ed2[_0xd949('0x36')]};return db[_0xd949('0x28')][_0xd949('0x1e')](_0x3c5810)[_0xd949('0x24')](function(_0x6efcaa){_0x2db741[_0xd949('0x1e')]=_0x6efcaa;if(_0x4cf485[_0xd949('0x2b')][_0xd949('0x3d')]){_0x298ed2[_0xd949('0x3e')]=[{'all':!![]}];}return db[_0xd949('0x28')]['findAll'](_0x298ed2);})[_0xd949('0x24')](function(_0x1f95f2){_0x2db741[_0xd949('0x3f')]=_0x1f95f2;return _0x2db741;})[_0xd949('0x24')](respondWithFilteredResult(_0x56aeab,_0x298ed2))['catch'](handleError(_0x56aeab,null));};exports[_0xd949('0x40')]=function(_0x495a8a,_0xab7d50){var _0x531d33={'raw':!![],'where':{'id':_0x495a8a[_0xd949('0x41')]['id']}},_0x288170={};_0x288170[_0xd949('0x2d')]=_[_0xd949('0x42')](db[_0xd949('0x28')][_0xd949('0x43')]);_0x288170[_0xd949('0x2b')]=_[_0xd949('0x42')](_0x495a8a['query']);_0x288170[_0xd949('0x2c')]=_[_0xd949('0x2f')](_0x288170[_0xd949('0x2d')],_0x288170['query']);_0x531d33['attributes']=_['intersection'](_0x288170[_0xd949('0x2d')],qs[_0xd949('0x30')](_0x495a8a[_0xd949('0x2b')][_0xd949('0x30')]));_0x531d33[_0xd949('0x2e')]=_0x531d33[_0xd949('0x2e')][_0xd949('0x31')]?_0x531d33[_0xd949('0x2e')]:_0x288170[_0xd949('0x2d')];if(_0x495a8a[_0xd949('0x2b')][_0xd949('0x3d')]){_0x531d33[_0xd949('0x3e')]=[{'all':!![]}];}_0x531d33=_[_0xd949('0x38')]({},_0x531d33,_0x495a8a[_0xd949('0x3c')]);return db[_0xd949('0x28')][_0xd949('0x44')](_0x531d33)[_0xd949('0x24')](handleEntityNotFound(_0xab7d50,null))['then'](respondWithResult(_0xab7d50,null))[_0xd949('0x45')](handleError(_0xab7d50,null));};exports['create']=function(_0x20cde5,_0x491614){return db[_0xd949('0x28')]['create'](_0x20cde5[_0xd949('0x46')],{})['then'](respondWithResult(_0x491614,0xc9))[_0xd949('0x45')](handleError(_0x491614,null));};exports[_0xd949('0x23')]=function(_0x1001db,_0x320541){if(_0x1001db[_0xd949('0x46')]['id']){delete _0x1001db['body']['id'];}return db[_0xd949('0x28')][_0xd949('0x44')]({'where':{'id':_0x1001db[_0xd949('0x41')]['id']}})[_0xd949('0x24')](handleEntityNotFound(_0x320541,null))[_0xd949('0x24')](saveUpdates(_0x1001db[_0xd949('0x46')],null))[_0xd949('0x24')](respondWithResult(_0x320541,null))[_0xd949('0x45')](handleError(_0x320541,null));};exports['destroy']=function(_0x130d8b,_0x220494){return db[_0xd949('0x28')]['find']({'where':{'id':_0x130d8b['params']['id']}})[_0xd949('0x24')](handleEntityNotFound(_0x220494,null))['then'](removeEntity(_0x220494,null))[_0xd949('0x45')](handleError(_0x220494,null));};exports[_0xd949('0x47')]=function(_0x4d06c9,_0x3cc3cc){return db[_0xd949('0x28')]['describe']()[_0xd949('0x24')](respondWithResult(_0x3cc3cc,null))[_0xd949('0x45')](handleError(_0x3cc3cc,null));}; \ No newline at end of file +var _0x32c0=['offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','FaxQueueReport','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','rawAttributes','options','catch','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json'];(function(_0x53ff8d,_0x53b3f8){var _0x36ae29=function(_0x31e1f6){while(--_0x31e1f6){_0x53ff8d['push'](_0x53ff8d['shift']());}};_0x36ae29(++_0x53b3f8);}(_0x32c0,0x1f3));var _0x032c=function(_0x1e65b1,_0x55d6a0){_0x1e65b1=_0x1e65b1-0x0;var _0x35cd26=_0x32c0[_0x1e65b1];return _0x35cd26;};'use strict';var emlformat=require(_0x032c('0x0'));var rimraf=require(_0x032c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x032c('0x2'));var rp=require(_0x032c('0x3'));var moment=require('moment');var BPromise=require(_0x032c('0x4'));var Mustache=require(_0x032c('0x5'));var util=require(_0x032c('0x6'));var path=require(_0x032c('0x7'));var sox=require('sox');var csv=require(_0x032c('0x8'));var ejs=require(_0x032c('0x9'));var fs=require('fs');var fs_extra=require(_0x032c('0xa'));var _=require(_0x032c('0xb'));var squel=require('squel');var crypto=require(_0x032c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x032c('0xd'));var toCsv=require(_0x032c('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x032c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x032c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x032c('0x10'));var logger=require(_0x032c('0x11'))(_0x032c('0x12'));var utils=require(_0x032c('0x13'));var config=require(_0x032c('0x14'));var licenseUtil=require(_0x032c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25af77,_0xc88e78){_0xc88e78=_0xc88e78||0xcc;return function(_0x364605){if(_0x364605){return _0x25af77[_0x032c('0x16')](_0xc88e78);}return _0x25af77['status'](_0xc88e78)[_0x032c('0x17')]();};}function respondWithResult(_0x2650d6,_0x1ec9d8){_0x1ec9d8=_0x1ec9d8||0xc8;return function(_0x216984){if(_0x216984){return _0x2650d6[_0x032c('0x18')](_0x1ec9d8)[_0x032c('0x19')](_0x216984);}};}function respondWithFilteredResult(_0x51266f,_0xb678d5){return function(_0x15ddb8){if(_0x15ddb8){var _0x3ebda8=typeof _0xb678d5[_0x032c('0x1a')]===_0x032c('0x1b')&&typeof _0xb678d5[_0x032c('0x1c')]==='undefined';var _0x1444bb=_0x15ddb8[_0x032c('0x1d')];var _0x4435ad=_0x3ebda8?0x0:_0xb678d5[_0x032c('0x1a')];var _0x2b2693=_0x3ebda8?_0x15ddb8[_0x032c('0x1d')]:_0xb678d5[_0x032c('0x1a')]+_0xb678d5[_0x032c('0x1c')];var _0x3a6f71;if(_0x2b2693>=_0x1444bb){_0x2b2693=_0x1444bb;_0x3a6f71=0xc8;}else{_0x3a6f71=0xce;}_0x51266f[_0x032c('0x18')](_0x3a6f71);return _0x51266f[_0x032c('0x1e')](_0x032c('0x1f'),_0x4435ad+'-'+_0x2b2693+'/'+_0x1444bb)[_0x032c('0x19')](_0x15ddb8);}return null;};}function patchUpdates(_0x515409){return function(_0x8a8f30){try{jsonpatch['apply'](_0x8a8f30,_0x515409,!![]);}catch(_0x5341e6){return BPromise['reject'](_0x5341e6);}return _0x8a8f30['save']();};}function saveUpdates(_0x2a24f7,_0x4c0c4b){return function(_0x2ce758){if(_0x2ce758){return _0x2ce758[_0x032c('0x20')](_0x2a24f7)[_0x032c('0x21')](function(_0x51ad8c){return _0x51ad8c;});}return null;};}function removeEntity(_0x135612,_0x16d40f){return function(_0x28ae24){if(_0x28ae24){return _0x28ae24[_0x032c('0x22')]()[_0x032c('0x21')](function(){_0x135612[_0x032c('0x18')](0xcc)[_0x032c('0x17')]();});}};}function handleEntityNotFound(_0x58894b,_0x16ed08){return function(_0x1a0881){if(!_0x1a0881){_0x58894b[_0x032c('0x16')](0x194);}return _0x1a0881;};}function handleError(_0x56d20d,_0x1350d1){_0x1350d1=_0x1350d1||0x1f4;return function(_0x19ed06){logger[_0x032c('0x23')](_0x19ed06[_0x032c('0x24')]);if(_0x19ed06['name']){delete _0x19ed06[_0x032c('0x25')];}_0x56d20d[_0x032c('0x18')](_0x1350d1)[_0x032c('0x26')](_0x19ed06);};}exports[_0x032c('0x27')]=function(_0x51d679,_0x119d8f){var _0x1de595={},_0x5cdd90={},_0x659bbf={'count':0x0,'rows':[]};var _0x306935=_[_0x032c('0x28')](db[_0x032c('0x29')]['rawAttributes'],function(_0x50a3f8){return{'name':_0x50a3f8[_0x032c('0x2a')],'type':_0x50a3f8['type'][_0x032c('0x2b')]};});_0x5cdd90[_0x032c('0x2c')]=_['map'](_0x306935,_0x032c('0x25'));_0x5cdd90[_0x032c('0x2d')]=_[_0x032c('0x2e')](_0x51d679[_0x032c('0x2d')]);_0x5cdd90['filters']=_[_0x032c('0x2f')](_0x5cdd90[_0x032c('0x2c')],_0x5cdd90['query']);_0x1de595[_0x032c('0x30')]=_[_0x032c('0x2f')](_0x5cdd90[_0x032c('0x2c')],qs[_0x032c('0x31')](_0x51d679[_0x032c('0x2d')]['fields']));_0x1de595[_0x032c('0x30')]=_0x1de595['attributes'][_0x032c('0x32')]?_0x1de595['attributes']:_0x5cdd90[_0x032c('0x2c')];if(!_0x51d679[_0x032c('0x2d')][_0x032c('0x33')](_0x032c('0x34'))){_0x1de595[_0x032c('0x1c')]=qs[_0x032c('0x1c')](_0x51d679['query'][_0x032c('0x1c')]);_0x1de595[_0x032c('0x1a')]=qs['offset'](_0x51d679[_0x032c('0x2d')][_0x032c('0x1a')]);}_0x1de595[_0x032c('0x35')]=qs['sort'](_0x51d679[_0x032c('0x2d')][_0x032c('0x36')]);_0x1de595[_0x032c('0x37')]=qs[_0x032c('0x38')](_[_0x032c('0x39')](_0x51d679[_0x032c('0x2d')],_0x5cdd90[_0x032c('0x38')]),_0x306935);if(_0x51d679['query'][_0x032c('0x3a')]){_0x1de595[_0x032c('0x37')]=_[_0x032c('0x3b')](_0x1de595[_0x032c('0x37')],{'$or':_[_0x032c('0x28')](_0x306935,function(_0xf27830){if(_0xf27830[_0x032c('0x3c')]!==_0x032c('0x3d')){var _0x4bba77={};_0x4bba77[_0xf27830[_0x032c('0x25')]]={'$like':'%'+_0x51d679['query'][_0x032c('0x3a')]+'%'};return _0x4bba77;}})});}_0x1de595=_['merge']({},_0x1de595,_0x51d679['options']);var _0x238291={'where':_0x1de595[_0x032c('0x37')]};return db['FaxQueueReport']['count'](_0x238291)[_0x032c('0x21')](function(_0x4c6c2b){_0x659bbf['count']=_0x4c6c2b;if(_0x51d679[_0x032c('0x2d')][_0x032c('0x3e')]){_0x1de595[_0x032c('0x3f')]=[{'all':!![]}];}return db[_0x032c('0x29')][_0x032c('0x40')](_0x1de595);})[_0x032c('0x21')](function(_0x49b83a){_0x659bbf[_0x032c('0x41')]=_0x49b83a;return _0x659bbf;})['then'](respondWithFilteredResult(_0x119d8f,_0x1de595))['catch'](handleError(_0x119d8f,null));};exports[_0x032c('0x42')]=function(_0x15ebeb,_0x2035d5){var _0x235ad6={'raw':!![],'where':{'id':_0x15ebeb['params']['id']}},_0x47360a={};_0x47360a['model']=_[_0x032c('0x2e')](db['FaxQueueReport'][_0x032c('0x43')]);_0x47360a[_0x032c('0x2d')]=_[_0x032c('0x2e')](_0x15ebeb[_0x032c('0x2d')]);_0x47360a[_0x032c('0x38')]=_[_0x032c('0x2f')](_0x47360a[_0x032c('0x2c')],_0x47360a[_0x032c('0x2d')]);_0x235ad6[_0x032c('0x30')]=_['intersection'](_0x47360a[_0x032c('0x2c')],qs['fields'](_0x15ebeb['query'][_0x032c('0x31')]));_0x235ad6[_0x032c('0x30')]=_0x235ad6[_0x032c('0x30')][_0x032c('0x32')]?_0x235ad6[_0x032c('0x30')]:_0x47360a['model'];if(_0x15ebeb['query']['includeAll']){_0x235ad6[_0x032c('0x3f')]=[{'all':!![]}];}_0x235ad6=_['merge']({},_0x235ad6,_0x15ebeb[_0x032c('0x44')]);return db[_0x032c('0x29')]['find'](_0x235ad6)[_0x032c('0x21')](handleEntityNotFound(_0x2035d5,null))[_0x032c('0x21')](respondWithResult(_0x2035d5,null))[_0x032c('0x45')](handleError(_0x2035d5,null));};exports[_0x032c('0x46')]=function(_0x3a877a,_0x26e988){return db[_0x032c('0x29')][_0x032c('0x46')](_0x3a877a[_0x032c('0x47')],{})['then'](respondWithResult(_0x26e988,0xc9))[_0x032c('0x45')](handleError(_0x26e988,null));};exports['update']=function(_0x367638,_0x13f1a7){if(_0x367638[_0x032c('0x47')]['id']){delete _0x367638[_0x032c('0x47')]['id'];}return db[_0x032c('0x29')][_0x032c('0x48')]({'where':{'id':_0x367638[_0x032c('0x49')]['id']}})[_0x032c('0x21')](handleEntityNotFound(_0x13f1a7,null))[_0x032c('0x21')](saveUpdates(_0x367638['body'],null))[_0x032c('0x21')](respondWithResult(_0x13f1a7,null))['catch'](handleError(_0x13f1a7,null));};exports[_0x032c('0x22')]=function(_0x2f1032,_0x4e8fd6){return db[_0x032c('0x29')][_0x032c('0x48')]({'where':{'id':_0x2f1032['params']['id']}})[_0x032c('0x21')](handleEntityNotFound(_0x4e8fd6,null))[_0x032c('0x21')](removeEntity(_0x4e8fd6,null))[_0x032c('0x45')](handleError(_0x4e8fd6,null));};exports['describe']=function(_0x43efaa,_0xf7d545){return db[_0x032c('0x29')][_0x032c('0x4a')]()[_0x032c('0x21')](respondWithResult(_0xf7d545,null))[_0x032c('0x45')](handleError(_0xf7d545,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 811adde..e67c88a 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 _0x53ec=['path','../../config/environment','./faxQueueReport.attributes','define','FaxQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x18e86e,_0x236d9e){var _0x339526=function(_0x13654f){while(--_0x13654f){_0x18e86e['push'](_0x18e86e['shift']());}};_0x339526(++_0x236d9e);}(_0x53ec,0x192));var _0xc53e=function(_0x413f2a,_0x1006e4){_0x413f2a=_0x413f2a-0x0;var _0x1932ec=_0x53ec[_0x413f2a];return _0x1932ec;};'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':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','define','report_fax_queue','uniqueid','util'];(function(_0x2f2b4c,_0x6ce7c1){var _0x28c769=function(_0x181d42){while(--_0x181d42){_0x2f2b4c['push'](_0x2f2b4c['shift']());}};_0x28c769(++_0x6ce7c1);}(_0x1261,0x144));var _0x1126=function(_0x350343,_0x256f69){_0x350343=_0x350343-0x0;var _0x9afc1c=_0x1261[_0x350343];return _0x9afc1c;};'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')]('FaxQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('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 da2bd3d..171cdb1 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 _0xecf8=['catch','CreateFaxQueueReport','create','options','raw','UpdateFaxQueueReport','FaxQueueReport','body','attributes','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','FaxQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result'];(function(_0x23b534,_0x26a8e8){var _0x25c2b5=function(_0x23490e){while(--_0x23490e){_0x23b534['push'](_0x23b534['shift']());}};_0x25c2b5(++_0x26a8e8);}(_0xecf8,0x1ad));var _0x8ecf=function(_0x35cee8,_0x3d39f9){_0x35cee8=_0x35cee8-0x0;var _0x2f72d0=_0xecf8[_0x35cee8];return _0x2f72d0;};'use strict';var _=require('lodash');var util=require(_0x8ecf('0x0'));var moment=require(_0x8ecf('0x1'));var BPromise=require('bluebird');var rs=require(_0x8ecf('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ecf('0x3'))['db'];var utils=require(_0x8ecf('0x4'));var logger=require(_0x8ecf('0x5'))(_0x8ecf('0x6'));var config=require(_0x8ecf('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xb9b410,_0x256fda,_0x5bd221){return new BPromise(function(_0x3bc8cd,_0x398f9e){return client[_0x8ecf('0x8')](_0xb9b410,_0x5bd221)[_0x8ecf('0x9')](function(_0x137710){logger[_0x8ecf('0xa')](_0x8ecf('0xb'),_0x256fda,'request\x20sent');logger[_0x8ecf('0xc')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x256fda,_0x8ecf('0xd'),JSON[_0x8ecf('0xe')](_0x137710));if(_0x137710[_0x8ecf('0xf')]){if(_0x137710[_0x8ecf('0xf')][_0x8ecf('0x10')]===0x1f4){logger[_0x8ecf('0xf')](_0x8ecf('0xb'),_0x256fda,_0x137710[_0x8ecf('0xf')][_0x8ecf('0x11')]);return _0x398f9e(_0x137710[_0x8ecf('0xf')][_0x8ecf('0x11')]);}logger['error'](_0x8ecf('0xb'),_0x256fda,_0x137710['error'][_0x8ecf('0x11')]);return _0x3bc8cd(_0x137710[_0x8ecf('0xf')][_0x8ecf('0x11')]);}else{logger[_0x8ecf('0xa')]('FaxQueueReport,\x20%s,\x20%s',_0x256fda,_0x8ecf('0xd'));_0x3bc8cd(_0x137710[_0x8ecf('0x12')][_0x8ecf('0x11')]);}})[_0x8ecf('0x13')](function(_0x1fc949){logger[_0x8ecf('0xf')](_0x8ecf('0xb'),_0x256fda,_0x1fc949);_0x398f9e(_0x1fc949);});});}exports[_0x8ecf('0x14')]=function(_0x421f72){var _0x5287d4=this;return new Promise(function(_0x3aa351,_0xcd41cd){return db['FaxQueueReport'][_0x8ecf('0x15')](_0x421f72['body'],{'raw':_0x421f72[_0x8ecf('0x16')]?_0x421f72[_0x8ecf('0x16')][_0x8ecf('0x17')]===undefined?!![]:![]:!![]})[_0x8ecf('0x9')](function(_0x28a2ce){logger[_0x8ecf('0xa')](_0x8ecf('0x14'),_0x421f72);logger[_0x8ecf('0xc')](_0x8ecf('0x14'),_0x421f72,JSON['stringify'](_0x28a2ce));_0x3aa351(_0x28a2ce);})['catch'](function(_0x18d8df){logger[_0x8ecf('0xf')]('CreateFaxQueueReport',_0x18d8df[_0x8ecf('0x11')],_0x421f72);_0xcd41cd(_0x5287d4[_0x8ecf('0xf')](0x1f4,_0x18d8df[_0x8ecf('0x11')]));});});};exports[_0x8ecf('0x18')]=function(_0x58b10c){var _0x1bce38=this;return new Promise(function(_0x1ae90d,_0x3a9dba){return db[_0x8ecf('0x19')]['update'](_0x58b10c[_0x8ecf('0x1a')],{'raw':_0x58b10c['options']?_0x58b10c[_0x8ecf('0x16')][_0x8ecf('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58b10c[_0x8ecf('0x16')]?_0x58b10c[_0x8ecf('0x16')]['where']||null:null,'attributes':_0x58b10c[_0x8ecf('0x16')]?_0x58b10c[_0x8ecf('0x16')][_0x8ecf('0x1b')]||null:null,'limit':_0x58b10c[_0x8ecf('0x16')]?_0x58b10c['options']['limit']||null:null})[_0x8ecf('0x9')](function(_0x45262e){logger[_0x8ecf('0xa')]('UpdateFaxQueueReport',_0x58b10c);logger[_0x8ecf('0xc')]('UpdateFaxQueueReport',_0x58b10c,JSON[_0x8ecf('0xe')](_0x45262e));_0x1ae90d(_0x45262e);})['catch'](function(_0x3def7f){logger[_0x8ecf('0xf')](_0x8ecf('0x18'),_0x3def7f['message'],_0x58b10c);_0x3a9dba(_0x1bce38[_0x8ecf('0xf')](0x1f4,_0x3def7f[_0x8ecf('0x11')]));});});}; \ No newline at end of file +var _0x5381=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','raw','CreateFaxQueueReport','UpdateFaxQueueReport','FaxQueueReport','where','limit','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x32e22c,_0x129c5e){var _0x1a1adc=function(_0x514f8b){while(--_0x514f8b){_0x32e22c['push'](_0x32e22c['shift']());}};_0x1a1adc(++_0x129c5e);}(_0x5381,0x10a));var _0x1538=function(_0x4ded6f,_0x527d83){_0x4ded6f=_0x4ded6f-0x0;var _0x4696ad=_0x5381[_0x4ded6f];return _0x4696ad;};'use strict';var _=require(_0x1538('0x0'));var util=require(_0x1538('0x1'));var moment=require(_0x1538('0x2'));var BPromise=require(_0x1538('0x3'));var rs=require(_0x1538('0x4'));var fs=require('fs');var Redis=require(_0x1538('0x5'));var db=require(_0x1538('0x6'))['db'];var utils=require(_0x1538('0x7'));var logger=require(_0x1538('0x8'))(_0x1538('0x9'));var config=require(_0x1538('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x1538('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x479b14,_0x225f1c,_0x4310f5){return new BPromise(function(_0x189847,_0x3e8269){return client[_0x1538('0xc')](_0x479b14,_0x4310f5)[_0x1538('0xd')](function(_0x206e8d){logger[_0x1538('0xe')](_0x1538('0xf'),_0x225f1c,_0x1538('0x10'));logger[_0x1538('0x11')](_0x1538('0x12'),_0x225f1c,_0x1538('0x10'),JSON[_0x1538('0x13')](_0x206e8d));if(_0x206e8d['error']){if(_0x206e8d[_0x1538('0x14')][_0x1538('0x15')]===0x1f4){logger[_0x1538('0x14')](_0x1538('0xf'),_0x225f1c,_0x206e8d[_0x1538('0x14')]['message']);return _0x3e8269(_0x206e8d[_0x1538('0x14')][_0x1538('0x16')]);}logger[_0x1538('0x14')]('FaxQueueReport,\x20%s,\x20%s',_0x225f1c,_0x206e8d[_0x1538('0x14')][_0x1538('0x16')]);return _0x189847(_0x206e8d['error']['message']);}else{logger[_0x1538('0xe')](_0x1538('0xf'),_0x225f1c,_0x1538('0x10'));_0x189847(_0x206e8d[_0x1538('0x17')]['message']);}})[_0x1538('0x18')](function(_0x516600){logger['error'](_0x1538('0xf'),_0x225f1c,_0x516600);_0x3e8269(_0x516600);});});}exports['CreateFaxQueueReport']=function(_0x285252){var _0x209c23=this;return new Promise(function(_0x3b190d,_0x5b9fd2){return db['FaxQueueReport'][_0x1538('0x19')](_0x285252[_0x1538('0x1a')],{'raw':_0x285252['options']?_0x285252[_0x1538('0x1b')][_0x1538('0x1c')]===undefined?!![]:![]:!![]})[_0x1538('0xd')](function(_0x101d4d){logger['info']('CreateFaxQueueReport',_0x285252);logger[_0x1538('0x11')](_0x1538('0x1d'),_0x285252,JSON['stringify'](_0x101d4d));_0x3b190d(_0x101d4d);})[_0x1538('0x18')](function(_0xdb4b4e){logger['error'](_0x1538('0x1d'),_0xdb4b4e[_0x1538('0x16')],_0x285252);_0x5b9fd2(_0x209c23[_0x1538('0x14')](0x1f4,_0xdb4b4e[_0x1538('0x16')]));});});};exports[_0x1538('0x1e')]=function(_0x3738e0){var _0x2fa767=this;return new Promise(function(_0x105b18,_0x24cd47){return db[_0x1538('0x1f')]['update'](_0x3738e0[_0x1538('0x1a')],{'raw':_0x3738e0[_0x1538('0x1b')]?_0x3738e0['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3738e0['options']?_0x3738e0[_0x1538('0x1b')][_0x1538('0x20')]||null:null,'attributes':_0x3738e0[_0x1538('0x1b')]?_0x3738e0['options']['attributes']||null:null,'limit':_0x3738e0['options']?_0x3738e0['options'][_0x1538('0x21')]||null:null})[_0x1538('0xd')](function(_0x1fbde8){logger[_0x1538('0xe')]('UpdateFaxQueueReport',_0x3738e0);logger[_0x1538('0x11')](_0x1538('0x1e'),_0x3738e0,JSON['stringify'](_0x1fbde8));_0x105b18(_0x1fbde8);})[_0x1538('0x18')](function(_0x2f93a0){logger['error'](_0x1538('0x1e'),_0x2f93a0[_0x1538('0x16')],_0x3738e0);_0x24cd47(_0x2fa767[_0x1538('0x14')](0x1f4,_0x2f93a0['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index d15ad31..cf0091b 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 _0xafcb=['show','post','create','/:id','delete','exports','multer','connect-timeout','express','Router','fs-extra','./faxQueueReport.controller','get','isAuthenticated','index','describe'];(function(_0x1a3e23,_0xce45e){var _0x5ee0d8=function(_0x4b932f){while(--_0x4b932f){_0x1a3e23['push'](_0x1a3e23['shift']());}};_0x5ee0d8(++_0xce45e);}(_0xafcb,0x76));var _0xbafc=function(_0x337dea,_0x59018f){_0x337dea=_0x337dea-0x0;var _0x390cd7=_0xafcb[_0x337dea];return _0x390cd7;};'use strict';var multer=require(_0xbafc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbafc('0x1'));var express=require(_0xbafc('0x2'));var router=express[_0xbafc('0x3')]();var fs_extra=require(_0xbafc('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbafc('0x5'));router[_0xbafc('0x6')]('/',auth[_0xbafc('0x7')](),controller[_0xbafc('0x8')]);router[_0xbafc('0x6')]('/describe',auth[_0xbafc('0x7')](),controller[_0xbafc('0x9')]);router[_0xbafc('0x6')]('/:id',auth[_0xbafc('0x7')](),controller[_0xbafc('0xa')]);router[_0xbafc('0xb')]('/',auth[_0xbafc('0x7')](),controller[_0xbafc('0xc')]);router['put'](_0xbafc('0xd'),auth[_0xbafc('0x7')](),controller['update']);router[_0xbafc('0xe')](_0xbafc('0xd'),auth[_0xbafc('0x7')](),controller['destroy']);module[_0xbafc('0xf')]=router; \ No newline at end of file +var _0xf392=['multer','util','path','connect-timeout','express','Router','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','/:id','post','put','update','delete','destroy','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xf392,0x85));var _0x2f39=function(_0x1d6039,_0x2c1a3b){_0x1d6039=_0x1d6039-0x0;var _0x30668d=_0xf392[_0x1d6039];return _0x30668d;};'use strict';var multer=require(_0x2f39('0x0'));var util=require(_0x2f39('0x1'));var path=require(_0x2f39('0x2'));var timeout=require(_0x2f39('0x3'));var express=require(_0x2f39('0x4'));var router=express[_0x2f39('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2f39('0x6'));var controller=require(_0x2f39('0x7'));router[_0x2f39('0x8')]('/',auth[_0x2f39('0x9')](),controller[_0x2f39('0xa')]);router[_0x2f39('0x8')](_0x2f39('0xb'),auth[_0x2f39('0x9')](),controller['describe']);router[_0x2f39('0x8')](_0x2f39('0xc'),auth[_0x2f39('0x9')](),controller['show']);router[_0x2f39('0xd')]('/',auth[_0x2f39('0x9')](),controller['create']);router[_0x2f39('0xe')](_0x2f39('0xc'),auth[_0x2f39('0x9')](),controller[_0x2f39('0xf')]);router[_0x2f39('0x10')](_0x2f39('0xc'),auth[_0x2f39('0x9')](),controller[_0x2f39('0x11')]);module[_0x2f39('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 9dfff3e..34c119e 100644 --- a/server/api/faxTransferReport/faxTransferReport.attributes.js +++ b/server/api/faxTransferReport/faxTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x220691,_0xcb5063){var _0x268472=function(_0x4b8dcb){while(--_0x4b8dcb){_0x220691['push'](_0x220691['shift']());}};_0x268472(++_0xcb5063);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x383158,_0x415e43){_0x383158=_0x383158-0x0;var _0x507985=_0xf3cd[_0x383158];return _0x507985;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x3bbbea,_0xd04073){var _0x52f608=function(_0x28cd1c){while(--_0x28cd1c){_0x3bbbea['push'](_0x3bbbea['shift']());}};_0x52f608(++_0xd04073);}(_0xedd9,0xfc));var _0x9edd=function(_0x2f114b,_0x222f7a){_0x2f114b=_0x2f114b-0x0;var _0x457f7f=_0xedd9[_0x2f114b];return _0x457f7f;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index b242233..3077063 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 _0x3ee3=['set','Content-Range','reject','save','then','error','stack','name','index','map','rawAttributes','type','key','model','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','FaxTransferReport','findAll','rows','catch','params','keys','includeAll','find','create','body','update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit'];(function(_0x40e58c,_0x2d5b9e){var _0x4ef978=function(_0x4d679f){while(--_0x4d679f){_0x40e58c['push'](_0x40e58c['shift']());}};_0x4ef978(++_0x2d5b9e);}(_0x3ee3,0x74));var _0x33ee=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x3ee3[_0x30ae5e];return _0x1f2e93;};'use strict';var emlformat=require(_0x33ee('0x0'));var rimraf=require(_0x33ee('0x1'));var zipdir=require(_0x33ee('0x2'));var jsonpatch=require(_0x33ee('0x3'));var rp=require(_0x33ee('0x4'));var moment=require(_0x33ee('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x33ee('0x6'));var util=require(_0x33ee('0x7'));var path=require(_0x33ee('0x8'));var sox=require(_0x33ee('0x9'));var csv=require(_0x33ee('0xa'));var ejs=require(_0x33ee('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x33ee('0xc'));var crypto=require(_0x33ee('0xd'));var jsforce=require(_0x33ee('0xe'));var deskjs=require(_0x33ee('0xf'));var toCsv=require(_0x33ee('0xa'));var querystring=require('querystring');var Papa=require(_0x33ee('0x10'));var Redis=require(_0x33ee('0x11'));var authService=require(_0x33ee('0x12'));var qs=require(_0x33ee('0x13'));var as=require(_0x33ee('0x14'));var hardwareService=require(_0x33ee('0x15'));var logger=require('../../config/logger')(_0x33ee('0x16'));var utils=require(_0x33ee('0x17'));var config=require(_0x33ee('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x33ee('0x19'))['db'];function respondWithStatusCode(_0x2d47d1,_0x4cd631){_0x4cd631=_0x4cd631||0xcc;return function(_0xf22393){if(_0xf22393){return _0x2d47d1[_0x33ee('0x1a')](_0x4cd631);}return _0x2d47d1[_0x33ee('0x1b')](_0x4cd631)[_0x33ee('0x1c')]();};}function respondWithResult(_0x101ba3,_0x3fce91){_0x3fce91=_0x3fce91||0xc8;return function(_0x231463){if(_0x231463){return _0x101ba3['status'](_0x3fce91)[_0x33ee('0x1d')](_0x231463);}};}function respondWithFilteredResult(_0x12b83e,_0x3a5497){return function(_0xc46b69){if(_0xc46b69){var _0x2dc64d=typeof _0x3a5497['offset']==='undefined'&&typeof _0x3a5497['limit']===_0x33ee('0x1e');var _0x479be6=_0xc46b69['count'];var _0x43b199=_0x2dc64d?0x0:_0x3a5497[_0x33ee('0x1f')];var _0x34ab53=_0x2dc64d?_0xc46b69[_0x33ee('0x20')]:_0x3a5497[_0x33ee('0x1f')]+_0x3a5497[_0x33ee('0x21')];var _0x53250d;if(_0x34ab53>=_0x479be6){_0x34ab53=_0x479be6;_0x53250d=0xc8;}else{_0x53250d=0xce;}_0x12b83e[_0x33ee('0x1b')](_0x53250d);return _0x12b83e[_0x33ee('0x22')](_0x33ee('0x23'),_0x43b199+'-'+_0x34ab53+'/'+_0x479be6)[_0x33ee('0x1d')](_0xc46b69);}return null;};}function patchUpdates(_0x46b603){return function(_0x17a658){try{jsonpatch['apply'](_0x17a658,_0x46b603,!![]);}catch(_0x2e5125){return BPromise[_0x33ee('0x24')](_0x2e5125);}return _0x17a658[_0x33ee('0x25')]();};}function saveUpdates(_0x505451,_0x54fe57){return function(_0x7c7df1){if(_0x7c7df1){return _0x7c7df1['update'](_0x505451)[_0x33ee('0x26')](function(_0x13699f){return _0x13699f;});}return null;};}function removeEntity(_0x2ecb0d,_0x1a6a3c){return function(_0x195dcb){if(_0x195dcb){return _0x195dcb['destroy']()[_0x33ee('0x26')](function(){_0x2ecb0d[_0x33ee('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x282010,_0x35d8f3){return function(_0x3792d6){if(!_0x3792d6){_0x282010[_0x33ee('0x1a')](0x194);}return _0x3792d6;};}function handleError(_0x1d7677,_0x27edec){_0x27edec=_0x27edec||0x1f4;return function(_0x17fda2){logger[_0x33ee('0x27')](_0x17fda2[_0x33ee('0x28')]);if(_0x17fda2[_0x33ee('0x29')]){delete _0x17fda2[_0x33ee('0x29')];}_0x1d7677[_0x33ee('0x1b')](_0x27edec)['send'](_0x17fda2);};}exports[_0x33ee('0x2a')]=function(_0x513988,_0x1c2552){var _0x3241e2={},_0xccd32c={},_0x9bb7c6={'count':0x0,'rows':[]};var _0x14f358=_[_0x33ee('0x2b')](db['FaxTransferReport'][_0x33ee('0x2c')],function(_0x1898c4){return{'name':_0x1898c4['fieldName'],'type':_0x1898c4[_0x33ee('0x2d')][_0x33ee('0x2e')]};});_0xccd32c[_0x33ee('0x2f')]=_[_0x33ee('0x2b')](_0x14f358,_0x33ee('0x29'));_0xccd32c['query']=_['keys'](_0x513988[_0x33ee('0x30')]);_0xccd32c['filters']=_['intersection'](_0xccd32c[_0x33ee('0x2f')],_0xccd32c[_0x33ee('0x30')]);_0x3241e2[_0x33ee('0x31')]=_[_0x33ee('0x32')](_0xccd32c[_0x33ee('0x2f')],qs[_0x33ee('0x33')](_0x513988[_0x33ee('0x30')]['fields']));_0x3241e2[_0x33ee('0x31')]=_0x3241e2['attributes'][_0x33ee('0x34')]?_0x3241e2[_0x33ee('0x31')]:_0xccd32c[_0x33ee('0x2f')];if(!_0x513988[_0x33ee('0x30')]['hasOwnProperty'](_0x33ee('0x35'))){_0x3241e2[_0x33ee('0x21')]=qs[_0x33ee('0x21')](_0x513988[_0x33ee('0x30')]['limit']);_0x3241e2['offset']=qs[_0x33ee('0x1f')](_0x513988[_0x33ee('0x30')][_0x33ee('0x1f')]);}_0x3241e2[_0x33ee('0x36')]=qs[_0x33ee('0x37')](_0x513988['query'][_0x33ee('0x37')]);_0x3241e2[_0x33ee('0x38')]=qs[_0x33ee('0x39')](_['pick'](_0x513988[_0x33ee('0x30')],_0xccd32c['filters']),_0x14f358);if(_0x513988[_0x33ee('0x30')][_0x33ee('0x3a')]){_0x3241e2['where']=_[_0x33ee('0x3b')](_0x3241e2[_0x33ee('0x38')],{'$or':_[_0x33ee('0x2b')](_0x14f358,function(_0x3d83ad){if(_0x3d83ad[_0x33ee('0x2d')]!==_0x33ee('0x3c')){var _0x1ed9dc={};_0x1ed9dc[_0x3d83ad[_0x33ee('0x29')]]={'$like':'%'+_0x513988[_0x33ee('0x30')]['filter']+'%'};return _0x1ed9dc;}})});}_0x3241e2=_[_0x33ee('0x3b')]({},_0x3241e2,_0x513988[_0x33ee('0x3d')]);var _0x4f0b6b={'where':_0x3241e2[_0x33ee('0x38')]};return db['FaxTransferReport'][_0x33ee('0x20')](_0x4f0b6b)[_0x33ee('0x26')](function(_0x10ceb7){_0x9bb7c6[_0x33ee('0x20')]=_0x10ceb7;if(_0x513988['query']['includeAll']){_0x3241e2[_0x33ee('0x3e')]=[{'all':!![]}];}return db[_0x33ee('0x3f')][_0x33ee('0x40')](_0x3241e2);})[_0x33ee('0x26')](function(_0x23123a){_0x9bb7c6[_0x33ee('0x41')]=_0x23123a;return _0x9bb7c6;})[_0x33ee('0x26')](respondWithFilteredResult(_0x1c2552,_0x3241e2))[_0x33ee('0x42')](handleError(_0x1c2552,null));};exports['show']=function(_0x400f80,_0x400cb8){var _0x4419f2={'raw':!![],'where':{'id':_0x400f80[_0x33ee('0x43')]['id']}},_0x13be51={};_0x13be51[_0x33ee('0x2f')]=_[_0x33ee('0x44')](db[_0x33ee('0x3f')][_0x33ee('0x2c')]);_0x13be51[_0x33ee('0x30')]=_['keys'](_0x400f80['query']);_0x13be51[_0x33ee('0x39')]=_[_0x33ee('0x32')](_0x13be51['model'],_0x13be51['query']);_0x4419f2[_0x33ee('0x31')]=_[_0x33ee('0x32')](_0x13be51[_0x33ee('0x2f')],qs['fields'](_0x400f80[_0x33ee('0x30')][_0x33ee('0x33')]));_0x4419f2[_0x33ee('0x31')]=_0x4419f2['attributes']['length']?_0x4419f2[_0x33ee('0x31')]:_0x13be51[_0x33ee('0x2f')];if(_0x400f80['query'][_0x33ee('0x45')]){_0x4419f2[_0x33ee('0x3e')]=[{'all':!![]}];}_0x4419f2=_[_0x33ee('0x3b')]({},_0x4419f2,_0x400f80[_0x33ee('0x3d')]);return db[_0x33ee('0x3f')][_0x33ee('0x46')](_0x4419f2)['then'](handleEntityNotFound(_0x400cb8,null))[_0x33ee('0x26')](respondWithResult(_0x400cb8,null))[_0x33ee('0x42')](handleError(_0x400cb8,null));};exports[_0x33ee('0x47')]=function(_0x4883a1,_0x1993de){return db[_0x33ee('0x3f')][_0x33ee('0x47')](_0x4883a1[_0x33ee('0x48')],{})[_0x33ee('0x26')](respondWithResult(_0x1993de,0xc9))['catch'](handleError(_0x1993de,null));};exports[_0x33ee('0x49')]=function(_0x60924d,_0x3a805f){if(_0x60924d['body']['id']){delete _0x60924d[_0x33ee('0x48')]['id'];}return db['FaxTransferReport'][_0x33ee('0x46')]({'where':{'id':_0x60924d[_0x33ee('0x43')]['id']}})[_0x33ee('0x26')](handleEntityNotFound(_0x3a805f,null))[_0x33ee('0x26')](saveUpdates(_0x60924d[_0x33ee('0x48')],null))[_0x33ee('0x26')](respondWithResult(_0x3a805f,null))[_0x33ee('0x42')](handleError(_0x3a805f,null));};exports[_0x33ee('0x4a')]=function(_0x4b20f0,_0x2b4389){return db[_0x33ee('0x3f')][_0x33ee('0x46')]({'where':{'id':_0x4b20f0[_0x33ee('0x43')]['id']}})[_0x33ee('0x26')](handleEntityNotFound(_0x2b4389,null))['then'](removeEntity(_0x2b4389,null))[_0x33ee('0x42')](handleError(_0x2b4389,null));};exports['describe']=function(_0x55b579,_0x410f1c){return db[_0x33ee('0x3f')]['describe']()['then'](respondWithResult(_0x410f1c,null))[_0x33ee('0x42')](handleError(_0x410f1c,null));}; \ No newline at end of file +var _0x4665=['Content-Range','apply','reject','then','destroy','error','stack','name','index','map','FaxTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0xe16450,_0x4ca4f8){var _0x406c47=function(_0x4590ae){while(--_0x4590ae){_0xe16450['push'](_0xe16450['shift']());}};_0x406c47(++_0x4ca4f8);}(_0x4665,0x10f));var _0x5466=function(_0x43e5e3,_0x271849){_0x43e5e3=_0x43e5e3-0x0;var _0x4200ff=_0x4665[_0x43e5e3];return _0x4200ff;};'use strict';var emlformat=require(_0x5466('0x0'));var rimraf=require(_0x5466('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5466('0x2'));var rp=require(_0x5466('0x3'));var moment=require(_0x5466('0x4'));var BPromise=require(_0x5466('0x5'));var Mustache=require(_0x5466('0x6'));var util=require('util');var path=require(_0x5466('0x7'));var sox=require(_0x5466('0x8'));var csv=require(_0x5466('0x9'));var ejs=require(_0x5466('0xa'));var fs=require('fs');var fs_extra=require(_0x5466('0xb'));var _=require(_0x5466('0xc'));var squel=require('squel');var crypto=require(_0x5466('0xd'));var jsforce=require(_0x5466('0xe'));var deskjs=require(_0x5466('0xf'));var toCsv=require(_0x5466('0x9'));var querystring=require(_0x5466('0x10'));var Papa=require(_0x5466('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5466('0x12'));var as=require(_0x5466('0x13'));var hardwareService=require(_0x5466('0x14'));var logger=require(_0x5466('0x15'))(_0x5466('0x16'));var utils=require(_0x5466('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5466('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x102cd2,_0x3964a3){_0x3964a3=_0x3964a3||0xcc;return function(_0x4a03de){if(_0x4a03de){return _0x102cd2[_0x5466('0x19')](_0x3964a3);}return _0x102cd2[_0x5466('0x1a')](_0x3964a3)[_0x5466('0x1b')]();};}function respondWithResult(_0x4a6166,_0x4aec01){_0x4aec01=_0x4aec01||0xc8;return function(_0x23de70){if(_0x23de70){return _0x4a6166[_0x5466('0x1a')](_0x4aec01)[_0x5466('0x1c')](_0x23de70);}};}function respondWithFilteredResult(_0x18cafa,_0x2004cb){return function(_0x36e857){if(_0x36e857){var _0x252498=typeof _0x2004cb[_0x5466('0x1d')]===_0x5466('0x1e')&&typeof _0x2004cb[_0x5466('0x1f')]===_0x5466('0x1e');var _0x208523=_0x36e857[_0x5466('0x20')];var _0x236135=_0x252498?0x0:_0x2004cb['offset'];var _0x5f1870=_0x252498?_0x36e857[_0x5466('0x20')]:_0x2004cb[_0x5466('0x1d')]+_0x2004cb[_0x5466('0x1f')];var _0xaac13b;if(_0x5f1870>=_0x208523){_0x5f1870=_0x208523;_0xaac13b=0xc8;}else{_0xaac13b=0xce;}_0x18cafa[_0x5466('0x1a')](_0xaac13b);return _0x18cafa['set'](_0x5466('0x21'),_0x236135+'-'+_0x5f1870+'/'+_0x208523)[_0x5466('0x1c')](_0x36e857);}return null;};}function patchUpdates(_0x5866fb){return function(_0x547d2a){try{jsonpatch[_0x5466('0x22')](_0x547d2a,_0x5866fb,!![]);}catch(_0x37c86c){return BPromise[_0x5466('0x23')](_0x37c86c);}return _0x547d2a['save']();};}function saveUpdates(_0x5e1235,_0xb01dc2){return function(_0x293a02){if(_0x293a02){return _0x293a02['update'](_0x5e1235)[_0x5466('0x24')](function(_0x2a62be){return _0x2a62be;});}return null;};}function removeEntity(_0x474297,_0x50a8d3){return function(_0x31f64c){if(_0x31f64c){return _0x31f64c[_0x5466('0x25')]()[_0x5466('0x24')](function(){_0x474297[_0x5466('0x1a')](0xcc)[_0x5466('0x1b')]();});}};}function handleEntityNotFound(_0x5b0c71,_0x34eb28){return function(_0x175de9){if(!_0x175de9){_0x5b0c71['sendStatus'](0x194);}return _0x175de9;};}function handleError(_0x252798,_0x1cace6){_0x1cace6=_0x1cace6||0x1f4;return function(_0x13fff1){logger[_0x5466('0x26')](_0x13fff1[_0x5466('0x27')]);if(_0x13fff1[_0x5466('0x28')]){delete _0x13fff1[_0x5466('0x28')];}_0x252798[_0x5466('0x1a')](_0x1cace6)['send'](_0x13fff1);};}exports[_0x5466('0x29')]=function(_0x1024fb,_0x3caee9){var _0x43061f={},_0x155045={},_0x421c21={'count':0x0,'rows':[]};var _0x157b49=_[_0x5466('0x2a')](db[_0x5466('0x2b')][_0x5466('0x2c')],function(_0x4fda9c){return{'name':_0x4fda9c[_0x5466('0x2d')],'type':_0x4fda9c[_0x5466('0x2e')]['key']};});_0x155045[_0x5466('0x2f')]=_['map'](_0x157b49,_0x5466('0x28'));_0x155045[_0x5466('0x30')]=_[_0x5466('0x31')](_0x1024fb['query']);_0x155045[_0x5466('0x32')]=_[_0x5466('0x33')](_0x155045['model'],_0x155045[_0x5466('0x30')]);_0x43061f[_0x5466('0x34')]=_[_0x5466('0x33')](_0x155045[_0x5466('0x2f')],qs[_0x5466('0x35')](_0x1024fb[_0x5466('0x30')]['fields']));_0x43061f['attributes']=_0x43061f[_0x5466('0x34')][_0x5466('0x36')]?_0x43061f[_0x5466('0x34')]:_0x155045[_0x5466('0x2f')];if(!_0x1024fb[_0x5466('0x30')][_0x5466('0x37')]('nolimit')){_0x43061f['limit']=qs['limit'](_0x1024fb[_0x5466('0x30')][_0x5466('0x1f')]);_0x43061f[_0x5466('0x1d')]=qs[_0x5466('0x1d')](_0x1024fb[_0x5466('0x30')]['offset']);}_0x43061f[_0x5466('0x38')]=qs[_0x5466('0x39')](_0x1024fb['query']['sort']);_0x43061f['where']=qs[_0x5466('0x32')](_[_0x5466('0x3a')](_0x1024fb[_0x5466('0x30')],_0x155045['filters']),_0x157b49);if(_0x1024fb[_0x5466('0x30')][_0x5466('0x3b')]){_0x43061f[_0x5466('0x3c')]=_['merge'](_0x43061f[_0x5466('0x3c')],{'$or':_[_0x5466('0x2a')](_0x157b49,function(_0x480d77){if(_0x480d77['type']!==_0x5466('0x3d')){var _0x1164c4={};_0x1164c4[_0x480d77[_0x5466('0x28')]]={'$like':'%'+_0x1024fb[_0x5466('0x30')]['filter']+'%'};return _0x1164c4;}})});}_0x43061f=_[_0x5466('0x3e')]({},_0x43061f,_0x1024fb['options']);var _0xc8a723={'where':_0x43061f['where']};return db[_0x5466('0x2b')][_0x5466('0x20')](_0xc8a723)[_0x5466('0x24')](function(_0x19ba1e){_0x421c21[_0x5466('0x20')]=_0x19ba1e;if(_0x1024fb[_0x5466('0x30')][_0x5466('0x3f')]){_0x43061f[_0x5466('0x40')]=[{'all':!![]}];}return db[_0x5466('0x2b')][_0x5466('0x41')](_0x43061f);})['then'](function(_0x244cad){_0x421c21[_0x5466('0x42')]=_0x244cad;return _0x421c21;})[_0x5466('0x24')](respondWithFilteredResult(_0x3caee9,_0x43061f))[_0x5466('0x43')](handleError(_0x3caee9,null));};exports[_0x5466('0x44')]=function(_0x4dc18a,_0x9ff8a1){var _0x4151c1={'raw':!![],'where':{'id':_0x4dc18a[_0x5466('0x45')]['id']}},_0x156c87={};_0x156c87[_0x5466('0x2f')]=_[_0x5466('0x31')](db[_0x5466('0x2b')][_0x5466('0x2c')]);_0x156c87[_0x5466('0x30')]=_[_0x5466('0x31')](_0x4dc18a[_0x5466('0x30')]);_0x156c87[_0x5466('0x32')]=_[_0x5466('0x33')](_0x156c87['model'],_0x156c87[_0x5466('0x30')]);_0x4151c1['attributes']=_['intersection'](_0x156c87[_0x5466('0x2f')],qs['fields'](_0x4dc18a[_0x5466('0x30')][_0x5466('0x35')]));_0x4151c1[_0x5466('0x34')]=_0x4151c1[_0x5466('0x34')][_0x5466('0x36')]?_0x4151c1[_0x5466('0x34')]:_0x156c87[_0x5466('0x2f')];if(_0x4dc18a[_0x5466('0x30')][_0x5466('0x3f')]){_0x4151c1[_0x5466('0x40')]=[{'all':!![]}];}_0x4151c1=_[_0x5466('0x3e')]({},_0x4151c1,_0x4dc18a[_0x5466('0x46')]);return db['FaxTransferReport'][_0x5466('0x47')](_0x4151c1)[_0x5466('0x24')](handleEntityNotFound(_0x9ff8a1,null))[_0x5466('0x24')](respondWithResult(_0x9ff8a1,null))[_0x5466('0x43')](handleError(_0x9ff8a1,null));};exports[_0x5466('0x48')]=function(_0x5ac6d5,_0x2e2403){return db['FaxTransferReport'][_0x5466('0x48')](_0x5ac6d5[_0x5466('0x49')],{})[_0x5466('0x24')](respondWithResult(_0x2e2403,0xc9))['catch'](handleError(_0x2e2403,null));};exports[_0x5466('0x4a')]=function(_0x45579f,_0x4da09b){if(_0x45579f[_0x5466('0x49')]['id']){delete _0x45579f[_0x5466('0x49')]['id'];}return db[_0x5466('0x2b')][_0x5466('0x47')]({'where':{'id':_0x45579f[_0x5466('0x45')]['id']}})[_0x5466('0x24')](handleEntityNotFound(_0x4da09b,null))[_0x5466('0x24')](saveUpdates(_0x45579f[_0x5466('0x49')],null))[_0x5466('0x24')](respondWithResult(_0x4da09b,null))[_0x5466('0x43')](handleError(_0x4da09b,null));};exports[_0x5466('0x25')]=function(_0x48be13,_0x4688f4){return db['FaxTransferReport'][_0x5466('0x47')]({'where':{'id':_0x48be13[_0x5466('0x45')]['id']}})[_0x5466('0x24')](handleEntityNotFound(_0x4688f4,null))[_0x5466('0x24')](removeEntity(_0x4688f4,null))[_0x5466('0x43')](handleError(_0x4688f4,null));};exports['describe']=function(_0x27cab1,_0x38ea84){return db[_0x5466('0x2b')][_0x5466('0x4b')]()['then'](respondWithResult(_0x38ea84,null))[_0x5466('0x43')](handleError(_0x38ea84,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 3b47c77..6da8b22 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 _0x691a=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','exports','FaxTransferReport','report_fax_transfer','uniqueid','lodash'];(function(_0x4d6f2a,_0x285fc0){var _0x2a8db1=function(_0x47dcea){while(--_0x47dcea){_0x4d6f2a['push'](_0x4d6f2a['shift']());}};_0x2a8db1(++_0x285fc0);}(_0x691a,0xfb));var _0xa691=function(_0xa3d51e,_0x57d44c){_0xa3d51e=_0xa3d51e-0x0;var _0x5e0c60=_0x691a[_0xa3d51e];return _0x5e0c60;};'use strict';var _=require(_0xa691('0x0'));var util=require(_0xa691('0x1'));var logger=require(_0xa691('0x2'))(_0xa691('0x3'));var moment=require(_0xa691('0x4'));var BPromise=require('bluebird');var rp=require(_0xa691('0x5'));var fs=require('fs');var path=require(_0xa691('0x6'));var rimraf=require('rimraf');var config=require(_0xa691('0x7'));var attributes=require('./faxTransferReport.attributes');module[_0xa691('0x8')]=function(_0x262caf,_0x1ead77){return _0x262caf['define'](_0xa691('0x9'),attributes,{'tableName':_0xa691('0xa'),'paranoid':![],'indexes':[{'name':_0xa691('0xb'),'fields':[_0xa691('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0f7f=['../../config/logger','moment','request-promise','../../config/environment','define','FaxTransferReport','uniqueid','lodash','util'];(function(_0x54cfaf,_0x59f305){var _0x4e80e3=function(_0x4ee6b7){while(--_0x4ee6b7){_0x54cfaf['push'](_0x54cfaf['shift']());}};_0x4e80e3(++_0x59f305);}(_0x0f7f,0x1e4));var _0xf0f7=function(_0x1e97b8,_0x12871f){_0x1e97b8=_0x1e97b8-0x0;var _0x4ef93e=_0x0f7f[_0x1e97b8];return _0x4ef93e;};'use strict';var _=require(_0xf0f7('0x0'));var util=require(_0xf0f7('0x1'));var logger=require(_0xf0f7('0x2'))('api');var moment=require(_0xf0f7('0x3'));var BPromise=require('bluebird');var rp=require(_0xf0f7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf0f7('0x5'));var attributes=require('./faxTransferReport.attributes');module['exports']=function(_0x438e69,_0x4fa12c){return _0x438e69[_0xf0f7('0x6')](_0xf0f7('0x7'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0xf0f7('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 75dc9e5..56df4d9 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 _0x737c=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xce2d7e,_0x56dac4){var _0x3143d9=function(_0x52633b){while(--_0x52633b){_0xce2d7e['push'](_0xce2d7e['shift']());}};_0x3143d9(++_0x56dac4);}(_0x737c,0x14a));var _0xc737=function(_0x10ace1,_0x30913d){_0x10ace1=_0x10ace1-0x0;var _0x19a4da=_0x737c[_0x10ace1];return _0x19a4da;};'use strict';var _=require(_0xc737('0x0'));var util=require('util');var moment=require(_0xc737('0x1'));var BPromise=require(_0xc737('0x2'));var rs=require(_0xc737('0x3'));var fs=require('fs');var Redis=require(_0xc737('0x4'));var db=require(_0xc737('0x5'))['db'];var utils=require(_0xc737('0x6'));var logger=require(_0xc737('0x7'))(_0xc737('0x8'));var config=require(_0xc737('0x9'));var jayson=require(_0xc737('0xa'));var client=jayson[_0xc737('0xb')][_0xc737('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x200a16,_0x3f0bd4,_0x3e1195){return new BPromise(function(_0x38b36c,_0x56e2f8){return client[_0xc737('0xd')](_0x200a16,_0x3e1195)[_0xc737('0xe')](function(_0x4de2ca){logger[_0xc737('0xf')](_0xc737('0x10'),_0x3f0bd4,'request\x20sent');logger['debug'](_0xc737('0x11'),_0x3f0bd4,_0xc737('0x12'),JSON[_0xc737('0x13')](_0x4de2ca));if(_0x4de2ca[_0xc737('0x14')]){if(_0x4de2ca['error'][_0xc737('0x15')]===0x1f4){logger['error'](_0xc737('0x10'),_0x3f0bd4,_0x4de2ca['error'][_0xc737('0x16')]);return _0x56e2f8(_0x4de2ca['error'][_0xc737('0x16')]);}logger[_0xc737('0x14')](_0xc737('0x10'),_0x3f0bd4,_0x4de2ca[_0xc737('0x14')][_0xc737('0x16')]);return _0x38b36c(_0x4de2ca[_0xc737('0x14')][_0xc737('0x16')]);}else{logger['info'](_0xc737('0x10'),_0x3f0bd4,_0xc737('0x12'));_0x38b36c(_0x4de2ca['result'][_0xc737('0x16')]);}})[_0xc737('0x17')](function(_0x5e5695){logger[_0xc737('0x14')](_0xc737('0x10'),_0x3f0bd4,_0x5e5695);_0x56e2f8(_0x5e5695);});});} \ No newline at end of file +var _0x333a=['FaxTransferReport,\x20%s,\x20%s','message','catch','lodash','util','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','error','code'];(function(_0x4f78ba,_0x2853ed){var _0x6e4207=function(_0x562850){while(--_0x562850){_0x4f78ba['push'](_0x4f78ba['shift']());}};_0x6e4207(++_0x2853ed);}(_0x333a,0xf1));var _0xa333=function(_0x137664,_0x125ba1){_0x137664=_0x137664-0x0;var _0xb31e5c=_0x333a[_0x137664];return _0xb31e5c;};'use strict';var _=require(_0xa333('0x0'));var util=require(_0xa333('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa333('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa333('0x3'))(_0xa333('0x4'));var config=require('../../config/environment');var jayson=require(_0xa333('0x5'));var client=jayson[_0xa333('0x6')][_0xa333('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x204897,_0x4726cf,_0x1cd605){return new BPromise(function(_0x125a47,_0xb9cafe){return client[_0xa333('0x8')](_0x204897,_0x1cd605)['then'](function(_0x48449b){logger[_0xa333('0x9')]('FaxTransferReport,\x20%s,\x20%s',_0x4726cf,_0xa333('0xa'));logger[_0xa333('0xb')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x4726cf,_0xa333('0xa'),JSON['stringify'](_0x48449b));if(_0x48449b[_0xa333('0xc')]){if(_0x48449b[_0xa333('0xc')][_0xa333('0xd')]===0x1f4){logger['error'](_0xa333('0xe'),_0x4726cf,_0x48449b[_0xa333('0xc')]['message']);return _0xb9cafe(_0x48449b['error']['message']);}logger[_0xa333('0xc')](_0xa333('0xe'),_0x4726cf,_0x48449b['error']['message']);return _0x125a47(_0x48449b[_0xa333('0xc')][_0xa333('0xf')]);}else{logger[_0xa333('0x9')](_0xa333('0xe'),_0x4726cf,_0xa333('0xa'));_0x125a47(_0x48449b['result'][_0xa333('0xf')]);}})[_0xa333('0x10')](function(_0x4b9418){logger[_0xa333('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x4726cf,_0x4b9418);_0xb9cafe(_0x4b9418);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 0d8f6a1..8407b99 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 _0xaace=['describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','/describe'];(function(_0x2cdaae,_0x433282){var _0x4f2d59=function(_0xf984ed){while(--_0xf984ed){_0x2cdaae['push'](_0x2cdaae['shift']());}};_0x4f2d59(++_0x433282);}(_0xaace,0xfc));var _0xeaac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaace[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xeaac('0x0'));var util=require(_0xeaac('0x1'));var path=require(_0xeaac('0x2'));var timeout=require('connect-timeout');var express=require(_0xeaac('0x3'));var router=express[_0xeaac('0x4')]();var fs_extra=require(_0xeaac('0x5'));var auth=require(_0xeaac('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xeaac('0x7'));var controller=require(_0xeaac('0x8'));router[_0xeaac('0x9')]('/',auth[_0xeaac('0xa')](),controller['index']);router[_0xeaac('0x9')](_0xeaac('0xb'),auth['isAuthenticated'](),controller[_0xeaac('0xc')]);router[_0xeaac('0x9')](_0xeaac('0xd'),auth[_0xeaac('0xa')](),controller[_0xeaac('0xe')]);router[_0xeaac('0xf')]('/',auth['isAuthenticated'](),controller[_0xeaac('0x10')]);router[_0xeaac('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xeaac('0x12')]);router[_0xeaac('0x13')](_0xeaac('0xd'),auth[_0xeaac('0xa')](),controller[_0xeaac('0x14')]);module[_0xeaac('0x15')]=router; \ No newline at end of file +var _0x263b=['fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x263b,0xcf));var _0xb263=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x263b[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0xb263('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb263('0x1'));var express=require(_0xb263('0x2'));var router=express['Router']();var fs_extra=require(_0xb263('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb263('0x4'));var config=require(_0xb263('0x5'));var controller=require(_0xb263('0x6'));router[_0xb263('0x7')]('/',auth[_0xb263('0x8')](),controller[_0xb263('0x9')]);router[_0xb263('0x7')](_0xb263('0xa'),auth['isAuthenticated'](),controller[_0xb263('0xb')]);router['get'](_0xb263('0xc'),auth[_0xb263('0x8')](),controller[_0xb263('0xd')]);router[_0xb263('0xe')]('/',auth[_0xb263('0x8')](),controller[_0xb263('0xf')]);router[_0xb263('0x10')]('/:id',auth[_0xb263('0x8')](),controller[_0xb263('0x11')]);router[_0xb263('0x12')](_0xb263('0xc'),auth[_0xb263('0x8')](),controller[_0xb263('0x13')]);module[_0xb263('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 2a3cd88..63ab99a 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 _0xfc48=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','put','delete','destroy','exports','multer','util','path'];(function(_0x1824c9,_0x475d83){var _0x3ad7e9=function(_0x346a23){while(--_0x346a23){_0x1824c9['push'](_0x1824c9['shift']());}};_0x3ad7e9(++_0x475d83);}(_0xfc48,0x87));var _0x8fc4=function(_0xdf4a3f,_0x109f19){_0xdf4a3f=_0xdf4a3f-0x0;var _0x92b2aa=_0xfc48[_0xdf4a3f];return _0x92b2aa;};'use strict';var multer=require(_0x8fc4('0x0'));var util=require(_0x8fc4('0x1'));var path=require(_0x8fc4('0x2'));var timeout=require(_0x8fc4('0x3'));var express=require(_0x8fc4('0x4'));var router=express[_0x8fc4('0x5')]();var fs_extra=require(_0x8fc4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8fc4('0x7'));var config=require(_0x8fc4('0x8'));var controller=require(_0x8fc4('0x9'));router['get']('/',auth[_0x8fc4('0xa')](),controller['index']);router[_0x8fc4('0xb')](_0x8fc4('0xc'),auth['isAuthenticated'](),controller[_0x8fc4('0xd')]);router[_0x8fc4('0xb')](_0x8fc4('0xe'),auth[_0x8fc4('0xa')](),controller[_0x8fc4('0xf')]);router[_0x8fc4('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0x8fc4('0x10')]);router[_0x8fc4('0x11')]('/',auth[_0x8fc4('0xa')](),controller[_0x8fc4('0x12')]);router[_0x8fc4('0x11')](_0x8fc4('0xe'),auth[_0x8fc4('0xa')](),controller['addConfiguration']);router[_0x8fc4('0x13')]('/:id',auth[_0x8fc4('0xa')](),controller['update']);router[_0x8fc4('0x14')](_0x8fc4('0xc'),auth[_0x8fc4('0xa')](),controller[_0x8fc4('0x15')]);module[_0x8fc4('0x16')]=router; \ No newline at end of file +var _0x8f70=['fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','path','connect-timeout','express','Router'];(function(_0x1a3efe,_0x2ff877){var _0xf1a735=function(_0xb190a4){while(--_0xb190a4){_0x1a3efe['push'](_0x1a3efe['shift']());}};_0xf1a735(++_0x2ff877);}(_0x8f70,0xce));var _0x08f7=function(_0x33be38,_0x2b1dda){_0x33be38=_0x33be38-0x0;var _0x363543=_0x8f70[_0x33be38];return _0x363543;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x08f7('0x0'));var timeout=require(_0x08f7('0x1'));var express=require(_0x08f7('0x2'));var router=express[_0x08f7('0x3')]();var fs_extra=require(_0x08f7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x08f7('0x5'));var config=require(_0x08f7('0x6'));var controller=require(_0x08f7('0x7'));router[_0x08f7('0x8')]('/',auth[_0x08f7('0x9')](),controller[_0x08f7('0xa')]);router[_0x08f7('0x8')](_0x08f7('0xb'),auth[_0x08f7('0x9')](),controller['show']);router[_0x08f7('0x8')](_0x08f7('0xc'),auth[_0x08f7('0x9')](),controller[_0x08f7('0xd')]);router[_0x08f7('0x8')]('/:id/fields',auth[_0x08f7('0x9')](),controller[_0x08f7('0xe')]);router[_0x08f7('0xf')]('/',auth[_0x08f7('0x9')](),controller[_0x08f7('0x10')]);router[_0x08f7('0xf')](_0x08f7('0xc'),auth[_0x08f7('0x9')](),controller[_0x08f7('0x11')]);router[_0x08f7('0x12')]('/:id',auth[_0x08f7('0x9')](),controller[_0x08f7('0x13')]);router[_0x08f7('0x14')](_0x08f7('0xb'),auth[_0x08f7('0x9')](),controller['destroy']);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 e8ca058..bb7253e 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 _0xb8a4=['sequelize','exports','STRING','ENUM','basic','integrationTab','newTab'];(function(_0x38d636,_0x527384){var _0x1ca112=function(_0x213502){while(--_0x213502){_0x38d636['push'](_0x38d636['shift']());}};_0x1ca112(++_0x527384);}(_0xb8a4,0xc4));var _0x4b8a=function(_0x4f3ee5,_0x38db22){_0x4f3ee5=_0x4f3ee5-0x0;var _0x5280c7=_0xb8a4[_0x4f3ee5];return _0x5280c7;};'use strict';var Sequelize=require(_0x4b8a('0x0'));module[_0x4b8a('0x1')]={'name':{'type':Sequelize[_0x4b8a('0x2')]},'description':{'type':Sequelize[_0x4b8a('0x2')]},'username':{'type':Sequelize[_0x4b8a('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x4b8a('0x3')](_0x4b8a('0x4')),'defaultValue':_0x4b8a('0x4')},'password':{'type':Sequelize[_0x4b8a('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x4b8a('0x2')]},'token':{'type':Sequelize[_0x4b8a('0x2')]},'tokenSecret':{'type':Sequelize[_0x4b8a('0x2')]},'serverUrl':{'type':Sequelize[_0x4b8a('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x4b8a('0x5'),_0x4b8a('0x6')),'defaultValue':_0x4b8a('0x5')}}; \ No newline at end of file +var _0xa732=['STRING','ENUM','basic','integrationTab','newTab','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa732,0x125));var _0x2a73=function(_0x180ba1,_0x57c646){_0x180ba1=_0x180ba1-0x0;var _0x3ce134=_0xa732[_0x180ba1];return _0x3ce134;};'use strict';var Sequelize=require(_0x2a73('0x0'));module['exports']={'name':{'type':Sequelize[_0x2a73('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x2a73('0x1')]},'remoteUri':{'type':Sequelize[_0x2a73('0x1')]},'authType':{'type':Sequelize[_0x2a73('0x2')](_0x2a73('0x3')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x2a73('0x1')]},'consumerKey':{'type':Sequelize[_0x2a73('0x1')]},'consumerSecret':{'type':Sequelize[_0x2a73('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x2a73('0x1')]},'serverUrl':{'type':Sequelize[_0x2a73('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x2a73('0x2')](_0x2a73('0x4'),_0x2a73('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 3893bc9..650fad4 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 _0x836e=['../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','name','index','map','DeskAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','getConfigurations','DeskConfiguration','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions','DeskField','priority','remoteUri','authType','password','token','slice','GET','application/json','basic','headers','Authorization','format','Basic\x20%s','%s:%s','username','toString','base64','concat','entries','active','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x836e,0xc3));var _0xe836=function(_0x48df04,_0x1522b1){_0x48df04=_0x48df04-0x0;var _0x4de5fa=_0x836e[_0x48df04];return _0x4de5fa;};'use strict';var emlformat=require(_0xe836('0x0'));var rimraf=require(_0xe836('0x1'));var zipdir=require(_0xe836('0x2'));var jsonpatch=require(_0xe836('0x3'));var rp=require(_0xe836('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe836('0x5'));var util=require(_0xe836('0x6'));var path=require(_0xe836('0x7'));var sox=require(_0xe836('0x8'));var csv=require(_0xe836('0x9'));var ejs=require(_0xe836('0xa'));var fs=require('fs');var fs_extra=require(_0xe836('0xb'));var _=require(_0xe836('0xc'));var squel=require(_0xe836('0xd'));var crypto=require(_0xe836('0xe'));var jsforce=require(_0xe836('0xf'));var deskjs=require(_0xe836('0x10'));var toCsv=require(_0xe836('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe836('0x11'));var qs=require(_0xe836('0x12'));var as=require(_0xe836('0x13'));var hardwareService=require(_0xe836('0x14'));var logger=require(_0xe836('0x15'))(_0xe836('0x16'));var utils=require(_0xe836('0x17'));var config=require(_0xe836('0x18'));var licenseUtil=require(_0xe836('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0xe836('0x1a'));function respondWithStatusCode(_0x2e044c,_0xea5aaa){_0xea5aaa=_0xea5aaa||0xcc;return function(_0x31b267){if(_0x31b267){return _0x2e044c[_0xe836('0x1b')](_0xea5aaa);}return _0x2e044c[_0xe836('0x1c')](_0xea5aaa)[_0xe836('0x1d')]();};}function respondWithResult(_0x550358,_0x10e306){_0x10e306=_0x10e306||0xc8;return function(_0x572be1){if(_0x572be1){return _0x550358['status'](_0x10e306)[_0xe836('0x1e')](_0x572be1);}};}function respondWithFilteredResult(_0x34f3b6,_0xd878d4){return function(_0x16749e){if(_0x16749e){var _0x5eea3a=typeof _0xd878d4[_0xe836('0x1f')]===_0xe836('0x20')&&typeof _0xd878d4[_0xe836('0x21')]===_0xe836('0x20');var _0x3fdd35=_0x16749e[_0xe836('0x22')];var _0x1b8009=_0x5eea3a?0x0:_0xd878d4[_0xe836('0x1f')];var _0x294dd2=_0x5eea3a?_0x16749e[_0xe836('0x22')]:_0xd878d4['offset']+_0xd878d4[_0xe836('0x21')];var _0xe82959;if(_0x294dd2>=_0x3fdd35){_0x294dd2=_0x3fdd35;_0xe82959=0xc8;}else{_0xe82959=0xce;}_0x34f3b6[_0xe836('0x1c')](_0xe82959);return _0x34f3b6[_0xe836('0x23')](_0xe836('0x24'),_0x1b8009+'-'+_0x294dd2+'/'+_0x3fdd35)[_0xe836('0x1e')](_0x16749e);}return null;};}function patchUpdates(_0x516ff6){return function(_0x471743){try{jsonpatch[_0xe836('0x25')](_0x471743,_0x516ff6,!![]);}catch(_0x52615c){return BPromise[_0xe836('0x26')](_0x52615c);}return _0x471743['save']();};}function saveUpdates(_0x5cdbc6,_0x373f78){return function(_0x57c770){if(_0x57c770){return _0x57c770['update'](_0x5cdbc6)[_0xe836('0x27')](function(_0xfb1510){return _0xfb1510;});}return null;};}function removeEntity(_0x2bffde,_0x107473){return function(_0x3a18a4){if(_0x3a18a4){return _0x3a18a4['destroy']()['then'](function(){_0x2bffde[_0xe836('0x1c')](0xcc)[_0xe836('0x1d')]();});}};}function handleEntityNotFound(_0x2c4a05,_0x35cab){return function(_0x104a6e){if(!_0x104a6e){_0x2c4a05[_0xe836('0x1b')](0x194);}return _0x104a6e;};}function handleError(_0x4becad,_0x3ab26c){_0x3ab26c=_0x3ab26c||0x1f4;return function(_0x188fa6){logger['error'](_0x188fa6['stack']);if(_0x188fa6[_0xe836('0x28')]){delete _0x188fa6[_0xe836('0x28')];}_0x4becad['status'](_0x3ab26c)['send'](_0x188fa6);};}exports[_0xe836('0x29')]=function(_0x522111,_0x166005){var _0x5149cc={},_0x139758={},_0x1a61a1={'count':0x0,'rows':[]};var _0x199cbc=_[_0xe836('0x2a')](db[_0xe836('0x2b')][_0xe836('0x2c')],function(_0x12b607){return{'name':_0x12b607[_0xe836('0x2d')],'type':_0x12b607[_0xe836('0x2e')][_0xe836('0x2f')]};});_0x139758['model']=_['map'](_0x199cbc,'name');_0x139758[_0xe836('0x30')]=_[_0xe836('0x31')](_0x522111[_0xe836('0x30')]);_0x139758[_0xe836('0x32')]=_[_0xe836('0x33')](_0x139758[_0xe836('0x34')],_0x139758[_0xe836('0x30')]);_0x5149cc['attributes']=_[_0xe836('0x33')](_0x139758['model'],qs[_0xe836('0x35')](_0x522111[_0xe836('0x30')][_0xe836('0x35')]));_0x5149cc[_0xe836('0x36')]=_0x5149cc[_0xe836('0x36')][_0xe836('0x37')]?_0x5149cc['attributes']:_0x139758['model'];if(!_0x522111[_0xe836('0x30')][_0xe836('0x38')]('nolimit')){_0x5149cc['limit']=qs[_0xe836('0x21')](_0x522111[_0xe836('0x30')][_0xe836('0x21')]);_0x5149cc[_0xe836('0x1f')]=qs['offset'](_0x522111['query']['offset']);}_0x5149cc[_0xe836('0x39')]=qs[_0xe836('0x3a')](_0x522111['query'][_0xe836('0x3a')]);_0x5149cc[_0xe836('0x3b')]=qs['filters'](_[_0xe836('0x3c')](_0x522111[_0xe836('0x30')],_0x139758[_0xe836('0x32')]),_0x199cbc);if(_0x522111[_0xe836('0x30')]['filter']){_0x5149cc[_0xe836('0x3b')]=_[_0xe836('0x3d')](_0x5149cc[_0xe836('0x3b')],{'$or':_['map'](_0x199cbc,function(_0xd4c5db){if(_0xd4c5db[_0xe836('0x2e')]!==_0xe836('0x3e')){var _0x17c8df={};_0x17c8df[_0xd4c5db[_0xe836('0x28')]]={'$like':'%'+_0x522111['query']['filter']+'%'};return _0x17c8df;}})});}_0x5149cc=_[_0xe836('0x3d')]({},_0x5149cc,_0x522111[_0xe836('0x3f')]);var _0x19f5cc={'where':_0x5149cc[_0xe836('0x3b')]};return db['DeskAccount'][_0xe836('0x22')](_0x19f5cc)[_0xe836('0x27')](function(_0x1fa527){_0x1a61a1[_0xe836('0x22')]=_0x1fa527;if(_0x522111[_0xe836('0x30')][_0xe836('0x40')]){_0x5149cc[_0xe836('0x41')]=[{'all':!![]}];}return db['DeskAccount'][_0xe836('0x42')](_0x5149cc);})['then'](function(_0x4bf935){_0x1a61a1[_0xe836('0x43')]=_0x4bf935;return _0x1a61a1;})['then'](respondWithFilteredResult(_0x166005,_0x5149cc))[_0xe836('0x44')](handleError(_0x166005,null));};exports[_0xe836('0x45')]=function(_0x3c6086,_0x421c40){var _0x45f746={'raw':![],'where':{'id':_0x3c6086['params']['id']}},_0x563b6e={};_0x563b6e['model']=_[_0xe836('0x31')](db['DeskAccount'][_0xe836('0x2c')]);_0x563b6e['query']=_[_0xe836('0x31')](_0x3c6086['query']);_0x563b6e[_0xe836('0x32')]=_[_0xe836('0x33')](_0x563b6e['model'],_0x563b6e[_0xe836('0x30')]);_0x45f746[_0xe836('0x36')]=_[_0xe836('0x33')](_0x563b6e[_0xe836('0x34')],qs[_0xe836('0x35')](_0x3c6086['query'][_0xe836('0x35')]));_0x45f746[_0xe836('0x36')]=_0x45f746[_0xe836('0x36')][_0xe836('0x37')]?_0x45f746[_0xe836('0x36')]:_0x563b6e['model'];if(_0x3c6086[_0xe836('0x30')][_0xe836('0x40')]){_0x45f746[_0xe836('0x41')]=[{'all':!![]}];}_0x45f746=_[_0xe836('0x3d')]({},_0x45f746,_0x3c6086[_0xe836('0x3f')]);return db[_0xe836('0x2b')][_0xe836('0x46')](_0x45f746)[_0xe836('0x27')](handleEntityNotFound(_0x421c40,null))[_0xe836('0x27')](respondWithResult(_0x421c40,null))[_0xe836('0x44')](handleError(_0x421c40,null));};exports[_0xe836('0x47')]=function(_0x3c0492,_0x37fe21){return db[_0xe836('0x2b')][_0xe836('0x47')](_0x3c0492[_0xe836('0x48')],{})['then'](respondWithResult(_0x37fe21,0xc9))[_0xe836('0x44')](handleError(_0x37fe21,null));};exports['update']=function(_0x29403a,_0x6873fe){if(_0x29403a[_0xe836('0x48')]['id']){delete _0x29403a[_0xe836('0x48')]['id'];}return db[_0xe836('0x2b')][_0xe836('0x46')]({'where':{'id':_0x29403a[_0xe836('0x49')]['id']}})['then'](handleEntityNotFound(_0x6873fe,null))[_0xe836('0x27')](saveUpdates(_0x29403a[_0xe836('0x48')],null))['then'](respondWithResult(_0x6873fe,null))[_0xe836('0x44')](handleError(_0x6873fe,null));};exports['destroy']=function(_0x5c7d4f,_0x5d4cac){return db[_0xe836('0x2b')][_0xe836('0x46')]({'where':{'id':_0x5c7d4f['params']['id']}})['then'](handleEntityNotFound(_0x5d4cac,null))[_0xe836('0x27')](removeEntity(_0x5d4cac,null))[_0xe836('0x44')](handleError(_0x5d4cac,null));};exports[_0xe836('0x4a')]=function(_0x13b794,_0x1396bf,_0x365d51){var _0x1152de={};var _0x11f105={};var _0x28e6c0;var _0x1d78ca;return db[_0xe836('0x2b')]['findOne']({'where':{'id':_0x13b794[_0xe836('0x49')]['id']}})[_0xe836('0x27')](handleEntityNotFound(_0x1396bf,null))[_0xe836('0x27')](function(_0x12cd08){if(_0x12cd08){_0x28e6c0=_0x12cd08;_0x11f105['model']=_['keys'](db[_0xe836('0x4b')][_0xe836('0x2c')]);_0x11f105[_0xe836('0x30')]=_['keys'](_0x13b794[_0xe836('0x30')]);_0x11f105[_0xe836('0x32')]=_[_0xe836('0x33')](_0x11f105['model'],_0x11f105[_0xe836('0x30')]);_0x1152de[_0xe836('0x36')]=_['intersection'](_0x11f105[_0xe836('0x34')],qs[_0xe836('0x35')](_0x13b794['query'][_0xe836('0x35')]));_0x1152de[_0xe836('0x36')]=_0x1152de[_0xe836('0x36')][_0xe836('0x37')]?_0x1152de[_0xe836('0x36')]:_0x11f105[_0xe836('0x34')];_0x1152de[_0xe836('0x39')]=qs[_0xe836('0x3a')](_0x13b794[_0xe836('0x30')][_0xe836('0x3a')]);_0x1152de[_0xe836('0x3b')]=qs[_0xe836('0x32')](_[_0xe836('0x3c')](_0x13b794[_0xe836('0x30')],_0x11f105[_0xe836('0x32')]));if(_0x13b794[_0xe836('0x30')]['filter']){_0x1152de[_0xe836('0x3b')]=_[_0xe836('0x3d')](_0x1152de[_0xe836('0x3b')],{'$or':_['map'](_0x1152de['attributes'],function(_0x203529){var _0x499078={};_0x499078[_0x203529]={'$like':'%'+_0x13b794[_0xe836('0x30')]['filter']+'%'};return _0x499078;})});}_0x1152de=_[_0xe836('0x3d')]({},_0x1152de,_0x13b794['options']);return _0x28e6c0['getConfigurations'](_0x1152de);}})[_0xe836('0x27')](function(_0x3edec9){if(_0x3edec9){_0x1d78ca=_0x3edec9['length'];if(!_0x13b794[_0xe836('0x30')][_0xe836('0x38')](_0xe836('0x4c'))){_0x1152de['limit']=qs[_0xe836('0x21')](_0x13b794[_0xe836('0x30')][_0xe836('0x21')]);_0x1152de[_0xe836('0x1f')]=qs[_0xe836('0x1f')](_0x13b794[_0xe836('0x30')][_0xe836('0x1f')]);}return _0x28e6c0[_0xe836('0x4a')](_0x1152de);}})['then'](function(_0x5de901){if(_0x5de901){return _0x5de901?{'count':_0x1d78ca,'rows':_0x5de901}:null;}})[_0xe836('0x27')](respondWithResult(_0x1396bf,null))[_0xe836('0x44')](handleError(_0x1396bf,null));};exports[_0xe836('0x4d')]=function(_0x1fe631,_0x4f3638,_0x3bb4e7){if(_0x1fe631[_0xe836('0x48')]['id']){delete _0x1fe631[_0xe836('0x48')]['id'];}return db[_0xe836('0x2b')]['findOne']({'where':{'id':_0x1fe631[_0xe836('0x49')]['id']}})[_0xe836('0x27')](handleEntityNotFound(_0x4f3638,null))[_0xe836('0x27')](function(_0x9eb44d){if(_0x9eb44d){_0x1fe631['body'][_0xe836('0x4e')]=_0x9eb44d['id'];_0x1fe631[_0xe836('0x48')]['Subjects']=integrations[_0xe836('0x4f')](_0x1fe631['body'][_0xe836('0x50')],_0x1fe631[_0xe836('0x48')][_0xe836('0x2e')]);_0x1fe631[_0xe836('0x48')][_0xe836('0x51')]=integrations['getDescriptions'](_0x1fe631[_0xe836('0x48')][_0xe836('0x50')],_0x1fe631[_0xe836('0x48')][_0xe836('0x2e')]);return db[_0xe836('0x4b')][_0xe836('0x47')](_0x1fe631['body'],{'include':[{'model':db[_0xe836('0x52')],'as':'Subjects'},{'model':db[_0xe836('0x52')],'as':'Descriptions'}]});}return null;})[_0xe836('0x27')](respondWithResult(_0x4f3638,null))[_0xe836('0x44')](handleError(_0x4f3638,null));};exports['getFields']=function(_0x1b4553,_0xa7d984,_0x1f95e9){var _0x4f63a6=[{'name':'priority','label':_0xe836('0x53'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x48466a='';return db['DeskAccount']['findOne']({'where':{'id':_0x1b4553[_0xe836('0x49')]['id']},'attributes':['id',_0xe836('0x54'),_0xe836('0x55'),'username',_0xe836('0x56'),'consumerKey','consumerSecret',_0xe836('0x57'),'tokenSecret']})[_0xe836('0x27')](handleEntityNotFound(_0xa7d984,null))[_0xe836('0x27')](function(_0x3172f0){if(_0x3172f0){_0x48466a=_0x3172f0[_0xe836('0x54')];var _0x145169=_0x48466a[_0xe836('0x58')](-0x1);if(_0x145169==='/'){_0x48466a=_0x48466a['substring'](0x0,_0x48466a['lastIndexOf'](_0x145169));}var _0x8d71ca={'method':_0xe836('0x59'),'uri':util['format']('%s/custom_fields',_0x48466a),'headers':{'Content-Type':'application/json','Accept':_0xe836('0x5a')},'json':!![]};if(_0x3172f0[_0xe836('0x55')]===_0xe836('0x5b')){_0x8d71ca[_0xe836('0x5c')][_0xe836('0x5d')]=util[_0xe836('0x5e')](_0xe836('0x5f'),new Buffer(util[_0xe836('0x5e')](_0xe836('0x60'),_0x3172f0[_0xe836('0x61')],_0x3172f0[_0xe836('0x56')]))[_0xe836('0x62')](_0xe836('0x63')));}return rp(_0x8d71ca)[_0xe836('0x27')](function(_0x2e5506){return _0x4f63a6[_0xe836('0x64')](_['map'](_0x2e5506['_embedded'][_0xe836('0x65')],function(_0x409304){return{'id':_0x409304[_0xe836('0x28')],'name':_0x409304[_0xe836('0x28')],'type':_0x409304[_0xe836('0x2e')],'active':_0x409304[_0xe836('0x66')],'label':_0x409304['label'],'custom':!![]};}));});}})[_0xe836('0x27')](function(_0x215736){return{'count':_0x215736[_0xe836('0x37')],'rows':_0x215736};})[_0xe836('0x27')](respondWithResult(_0xa7d984,null))[_0xe836('0x44')](function(_0x397bbf){var _0x14f7c4=_0x1b4553[_0xe836('0x30')][_0xe836('0x67')]?0x1f4:_0x397bbf[_0xe836('0x68')]||0x1f4;logger[_0xe836('0x69')](_0xe836('0x6a'),_0xe836('0x6b'),_0x14f7c4,JSON['stringify'](_0x397bbf));delete _0x397bbf[_0xe836('0x28')];if(_0x14f7c4===0x191){_0x14f7c4=0x190;}_0xa7d984[_0xe836('0x1c')](_0x14f7c4)['send'](_0x1b4553[_0xe836('0x30')]['test']?{'message':_0xe836('0x6c'),'statusCode':_0x397bbf[_0xe836('0x68')]}:_0x397bbf);});}; \ No newline at end of file +var _0x18c4=['filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','DeskAccount','includeAll','include','rows','show','params','keys','options','catch','create','body','find','findOne','DeskConfiguration','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','priority','consumerKey','consumerSecret','token','tokenSecret','remoteUri','substring','lastIndexOf','GET','format','application/json','authType','basic','Authorization','Basic\x20%s','%s:%s','username','password','toString','base64','concat','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','end','error','name','index','map','rawAttributes','fieldName','key','query'];(function(_0x2792d6,_0x3e2020){var _0x8c1498=function(_0x2fb2f5){while(--_0x2fb2f5){_0x2792d6['push'](_0x2792d6['shift']());}};_0x8c1498(++_0x3e2020);}(_0x18c4,0x1a0));var _0x418c=function(_0x21d36e,_0x5dc096){_0x21d36e=_0x21d36e-0x0;var _0x4cc307=_0x18c4[_0x21d36e];return _0x4cc307;};'use strict';var emlformat=require(_0x418c('0x0'));var rimraf=require(_0x418c('0x1'));var zipdir=require(_0x418c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x418c('0x3'));var moment=require(_0x418c('0x4'));var BPromise=require(_0x418c('0x5'));var Mustache=require(_0x418c('0x6'));var util=require(_0x418c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x418c('0x8'));var ejs=require(_0x418c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x418c('0xa'));var squel=require(_0x418c('0xb'));var crypto=require('crypto');var jsforce=require(_0x418c('0xc'));var deskjs=require(_0x418c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x418c('0xe'));var Papa=require(_0x418c('0xf'));var Redis=require('ioredis');var authService=require(_0x418c('0x10'));var qs=require(_0x418c('0x11'));var as=require(_0x418c('0x12'));var hardwareService=require(_0x418c('0x13'));var logger=require(_0x418c('0x14'))(_0x418c('0x15'));var utils=require(_0x418c('0x16'));var config=require(_0x418c('0x17'));var licenseUtil=require(_0x418c('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x418c('0x19'));function respondWithStatusCode(_0x508afc,_0x559258){_0x559258=_0x559258||0xcc;return function(_0x4c7de4){if(_0x4c7de4){return _0x508afc[_0x418c('0x1a')](_0x559258);}return _0x508afc[_0x418c('0x1b')](_0x559258)['end']();};}function respondWithResult(_0x386339,_0x3c98f4){_0x3c98f4=_0x3c98f4||0xc8;return function(_0x168d12){if(_0x168d12){return _0x386339[_0x418c('0x1b')](_0x3c98f4)['json'](_0x168d12);}};}function respondWithFilteredResult(_0x1d13c3,_0x580ffa){return function(_0x5908ee){if(_0x5908ee){var _0x21ef09=typeof _0x580ffa[_0x418c('0x1c')]===_0x418c('0x1d')&&typeof _0x580ffa[_0x418c('0x1e')]===_0x418c('0x1d');var _0x410bc3=_0x5908ee[_0x418c('0x1f')];var _0x551b68=_0x21ef09?0x0:_0x580ffa[_0x418c('0x1c')];var _0x5e562c=_0x21ef09?_0x5908ee[_0x418c('0x1f')]:_0x580ffa['offset']+_0x580ffa[_0x418c('0x1e')];var _0x109387;if(_0x5e562c>=_0x410bc3){_0x5e562c=_0x410bc3;_0x109387=0xc8;}else{_0x109387=0xce;}_0x1d13c3[_0x418c('0x1b')](_0x109387);return _0x1d13c3['set'](_0x418c('0x20'),_0x551b68+'-'+_0x5e562c+'/'+_0x410bc3)[_0x418c('0x21')](_0x5908ee);}return null;};}function patchUpdates(_0x38fb3e){return function(_0x27603a){try{jsonpatch[_0x418c('0x22')](_0x27603a,_0x38fb3e,!![]);}catch(_0x5f1c3a){return BPromise[_0x418c('0x23')](_0x5f1c3a);}return _0x27603a[_0x418c('0x24')]();};}function saveUpdates(_0x5e6473,_0x456de3){return function(_0x3ac874){if(_0x3ac874){return _0x3ac874[_0x418c('0x25')](_0x5e6473)[_0x418c('0x26')](function(_0x482e92){return _0x482e92;});}return null;};}function removeEntity(_0x3a81fa,_0x183051){return function(_0x205c01){if(_0x205c01){return _0x205c01['destroy']()[_0x418c('0x26')](function(){_0x3a81fa[_0x418c('0x1b')](0xcc)[_0x418c('0x27')]();});}};}function handleEntityNotFound(_0xf09cdd,_0x1d8466){return function(_0x1f7455){if(!_0x1f7455){_0xf09cdd['sendStatus'](0x194);}return _0x1f7455;};}function handleError(_0xee0f8c,_0x5a942d){_0x5a942d=_0x5a942d||0x1f4;return function(_0x59edbd){logger[_0x418c('0x28')](_0x59edbd['stack']);if(_0x59edbd[_0x418c('0x29')]){delete _0x59edbd[_0x418c('0x29')];}_0xee0f8c[_0x418c('0x1b')](_0x5a942d)['send'](_0x59edbd);};}exports[_0x418c('0x2a')]=function(_0x213b10,_0x354826){var _0x47aaf4={},_0x4ff40b={},_0x961aee={'count':0x0,'rows':[]};var _0x33cfbe=_[_0x418c('0x2b')](db['DeskAccount'][_0x418c('0x2c')],function(_0x5ac1f8){return{'name':_0x5ac1f8[_0x418c('0x2d')],'type':_0x5ac1f8['type'][_0x418c('0x2e')]};});_0x4ff40b['model']=_[_0x418c('0x2b')](_0x33cfbe,_0x418c('0x29'));_0x4ff40b['query']=_['keys'](_0x213b10[_0x418c('0x2f')]);_0x4ff40b[_0x418c('0x30')]=_[_0x418c('0x31')](_0x4ff40b[_0x418c('0x32')],_0x4ff40b[_0x418c('0x2f')]);_0x47aaf4[_0x418c('0x33')]=_[_0x418c('0x31')](_0x4ff40b[_0x418c('0x32')],qs[_0x418c('0x34')](_0x213b10[_0x418c('0x2f')][_0x418c('0x34')]));_0x47aaf4[_0x418c('0x33')]=_0x47aaf4[_0x418c('0x33')][_0x418c('0x35')]?_0x47aaf4[_0x418c('0x33')]:_0x4ff40b[_0x418c('0x32')];if(!_0x213b10['query'][_0x418c('0x36')](_0x418c('0x37'))){_0x47aaf4['limit']=qs['limit'](_0x213b10['query'][_0x418c('0x1e')]);_0x47aaf4[_0x418c('0x1c')]=qs[_0x418c('0x1c')](_0x213b10[_0x418c('0x2f')][_0x418c('0x1c')]);}_0x47aaf4[_0x418c('0x38')]=qs[_0x418c('0x39')](_0x213b10[_0x418c('0x2f')][_0x418c('0x39')]);_0x47aaf4[_0x418c('0x3a')]=qs[_0x418c('0x30')](_[_0x418c('0x3b')](_0x213b10[_0x418c('0x2f')],_0x4ff40b[_0x418c('0x30')]),_0x33cfbe);if(_0x213b10[_0x418c('0x2f')][_0x418c('0x3c')]){_0x47aaf4['where']=_['merge'](_0x47aaf4[_0x418c('0x3a')],{'$or':_[_0x418c('0x2b')](_0x33cfbe,function(_0x3b1399){if(_0x3b1399[_0x418c('0x3d')]!==_0x418c('0x3e')){var _0x38db28={};_0x38db28[_0x3b1399[_0x418c('0x29')]]={'$like':'%'+_0x213b10[_0x418c('0x2f')][_0x418c('0x3c')]+'%'};return _0x38db28;}})});}_0x47aaf4=_[_0x418c('0x3f')]({},_0x47aaf4,_0x213b10['options']);var _0x1741f4={'where':_0x47aaf4['where']};return db[_0x418c('0x40')][_0x418c('0x1f')](_0x1741f4)[_0x418c('0x26')](function(_0x454307){_0x961aee[_0x418c('0x1f')]=_0x454307;if(_0x213b10[_0x418c('0x2f')][_0x418c('0x41')]){_0x47aaf4[_0x418c('0x42')]=[{'all':!![]}];}return db[_0x418c('0x40')]['findAll'](_0x47aaf4);})[_0x418c('0x26')](function(_0x233ff7){_0x961aee[_0x418c('0x43')]=_0x233ff7;return _0x961aee;})[_0x418c('0x26')](respondWithFilteredResult(_0x354826,_0x47aaf4))['catch'](handleError(_0x354826,null));};exports[_0x418c('0x44')]=function(_0xb73b5a,_0x270318){var _0x2c21ef={'raw':![],'where':{'id':_0xb73b5a[_0x418c('0x45')]['id']}},_0x4ad3df={};_0x4ad3df[_0x418c('0x32')]=_[_0x418c('0x46')](db[_0x418c('0x40')][_0x418c('0x2c')]);_0x4ad3df[_0x418c('0x2f')]=_['keys'](_0xb73b5a[_0x418c('0x2f')]);_0x4ad3df[_0x418c('0x30')]=_['intersection'](_0x4ad3df[_0x418c('0x32')],_0x4ad3df[_0x418c('0x2f')]);_0x2c21ef[_0x418c('0x33')]=_[_0x418c('0x31')](_0x4ad3df['model'],qs[_0x418c('0x34')](_0xb73b5a[_0x418c('0x2f')][_0x418c('0x34')]));_0x2c21ef[_0x418c('0x33')]=_0x2c21ef[_0x418c('0x33')][_0x418c('0x35')]?_0x2c21ef[_0x418c('0x33')]:_0x4ad3df[_0x418c('0x32')];if(_0xb73b5a[_0x418c('0x2f')][_0x418c('0x41')]){_0x2c21ef[_0x418c('0x42')]=[{'all':!![]}];}_0x2c21ef=_[_0x418c('0x3f')]({},_0x2c21ef,_0xb73b5a[_0x418c('0x47')]);return db[_0x418c('0x40')]['find'](_0x2c21ef)[_0x418c('0x26')](handleEntityNotFound(_0x270318,null))['then'](respondWithResult(_0x270318,null))[_0x418c('0x48')](handleError(_0x270318,null));};exports[_0x418c('0x49')]=function(_0x9771ba,_0x2f3e0e){return db[_0x418c('0x40')][_0x418c('0x49')](_0x9771ba['body'],{})[_0x418c('0x26')](respondWithResult(_0x2f3e0e,0xc9))['catch'](handleError(_0x2f3e0e,null));};exports[_0x418c('0x25')]=function(_0x550a6c,_0x451bfb){if(_0x550a6c['body']['id']){delete _0x550a6c[_0x418c('0x4a')]['id'];}return db[_0x418c('0x40')][_0x418c('0x4b')]({'where':{'id':_0x550a6c[_0x418c('0x45')]['id']}})[_0x418c('0x26')](handleEntityNotFound(_0x451bfb,null))[_0x418c('0x26')](saveUpdates(_0x550a6c[_0x418c('0x4a')],null))[_0x418c('0x26')](respondWithResult(_0x451bfb,null))['catch'](handleError(_0x451bfb,null));};exports['destroy']=function(_0x4ec30f,_0x5e7533){return db[_0x418c('0x40')][_0x418c('0x4b')]({'where':{'id':_0x4ec30f[_0x418c('0x45')]['id']}})[_0x418c('0x26')](handleEntityNotFound(_0x5e7533,null))[_0x418c('0x26')](removeEntity(_0x5e7533,null))[_0x418c('0x48')](handleError(_0x5e7533,null));};exports['getConfigurations']=function(_0x5c1874,_0x50ff56,_0x31f6b6){var _0x1f2308={};var _0x4d8adf={};var _0x3f7c9d;var _0x4fbf8e;return db['DeskAccount'][_0x418c('0x4c')]({'where':{'id':_0x5c1874[_0x418c('0x45')]['id']}})[_0x418c('0x26')](handleEntityNotFound(_0x50ff56,null))[_0x418c('0x26')](function(_0x38499b){if(_0x38499b){_0x3f7c9d=_0x38499b;_0x4d8adf[_0x418c('0x32')]=_['keys'](db[_0x418c('0x4d')]['rawAttributes']);_0x4d8adf[_0x418c('0x2f')]=_[_0x418c('0x46')](_0x5c1874['query']);_0x4d8adf[_0x418c('0x30')]=_[_0x418c('0x31')](_0x4d8adf[_0x418c('0x32')],_0x4d8adf[_0x418c('0x2f')]);_0x1f2308[_0x418c('0x33')]=_[_0x418c('0x31')](_0x4d8adf[_0x418c('0x32')],qs[_0x418c('0x34')](_0x5c1874[_0x418c('0x2f')]['fields']));_0x1f2308[_0x418c('0x33')]=_0x1f2308[_0x418c('0x33')][_0x418c('0x35')]?_0x1f2308['attributes']:_0x4d8adf[_0x418c('0x32')];_0x1f2308[_0x418c('0x38')]=qs[_0x418c('0x39')](_0x5c1874[_0x418c('0x2f')][_0x418c('0x39')]);_0x1f2308[_0x418c('0x3a')]=qs[_0x418c('0x30')](_[_0x418c('0x3b')](_0x5c1874['query'],_0x4d8adf[_0x418c('0x30')]));if(_0x5c1874[_0x418c('0x2f')][_0x418c('0x3c')]){_0x1f2308[_0x418c('0x3a')]=_[_0x418c('0x3f')](_0x1f2308[_0x418c('0x3a')],{'$or':_[_0x418c('0x2b')](_0x1f2308[_0x418c('0x33')],function(_0x1569a7){var _0x407805={};_0x407805[_0x1569a7]={'$like':'%'+_0x5c1874[_0x418c('0x2f')]['filter']+'%'};return _0x407805;})});}_0x1f2308=_[_0x418c('0x3f')]({},_0x1f2308,_0x5c1874[_0x418c('0x47')]);return _0x3f7c9d['getConfigurations'](_0x1f2308);}})['then'](function(_0x365bae){if(_0x365bae){_0x4fbf8e=_0x365bae[_0x418c('0x35')];if(!_0x5c1874['query'][_0x418c('0x36')](_0x418c('0x37'))){_0x1f2308[_0x418c('0x1e')]=qs[_0x418c('0x1e')](_0x5c1874[_0x418c('0x2f')][_0x418c('0x1e')]);_0x1f2308[_0x418c('0x1c')]=qs[_0x418c('0x1c')](_0x5c1874[_0x418c('0x2f')][_0x418c('0x1c')]);}return _0x3f7c9d[_0x418c('0x4e')](_0x1f2308);}})[_0x418c('0x26')](function(_0x4bf9ea){if(_0x4bf9ea){return _0x4bf9ea?{'count':_0x4fbf8e,'rows':_0x4bf9ea}:null;}})[_0x418c('0x26')](respondWithResult(_0x50ff56,null))[_0x418c('0x48')](handleError(_0x50ff56,null));};exports[_0x418c('0x4f')]=function(_0x1895bd,_0xc9bfd0,_0x51c814){if(_0x1895bd[_0x418c('0x4a')]['id']){delete _0x1895bd['body']['id'];}return db[_0x418c('0x40')][_0x418c('0x4c')]({'where':{'id':_0x1895bd[_0x418c('0x45')]['id']}})[_0x418c('0x26')](handleEntityNotFound(_0xc9bfd0,null))[_0x418c('0x26')](function(_0x3f393a){if(_0x3f393a){_0x1895bd['body']['AccountId']=_0x3f393a['id'];_0x1895bd[_0x418c('0x4a')][_0x418c('0x50')]=integrations[_0x418c('0x51')](_0x1895bd['body'][_0x418c('0x52')],_0x1895bd[_0x418c('0x4a')][_0x418c('0x3d')]);_0x1895bd['body'][_0x418c('0x53')]=integrations[_0x418c('0x54')](_0x1895bd[_0x418c('0x4a')][_0x418c('0x52')],_0x1895bd[_0x418c('0x4a')][_0x418c('0x3d')]);return db[_0x418c('0x4d')][_0x418c('0x49')](_0x1895bd[_0x418c('0x4a')],{'include':[{'model':db[_0x418c('0x55')],'as':_0x418c('0x50')},{'model':db['DeskField'],'as':_0x418c('0x53')}]});}return null;})[_0x418c('0x26')](respondWithResult(_0xc9bfd0,null))[_0x418c('0x48')](handleError(_0xc9bfd0,null));};exports['getFields']=function(_0x9f2a46,_0x132535,_0x2a807d){var _0x3de6ab=[{'name':_0x418c('0x56'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x5bea67='';return db[_0x418c('0x40')][_0x418c('0x4c')]({'where':{'id':_0x9f2a46[_0x418c('0x45')]['id']},'attributes':['id','remoteUri','authType','username','password',_0x418c('0x57'),_0x418c('0x58'),_0x418c('0x59'),_0x418c('0x5a')]})[_0x418c('0x26')](handleEntityNotFound(_0x132535,null))['then'](function(_0x435e4c){if(_0x435e4c){_0x5bea67=_0x435e4c[_0x418c('0x5b')];var _0x26d64f=_0x5bea67['slice'](-0x1);if(_0x26d64f==='/'){_0x5bea67=_0x5bea67[_0x418c('0x5c')](0x0,_0x5bea67[_0x418c('0x5d')](_0x26d64f));}var _0x290081={'method':_0x418c('0x5e'),'uri':util[_0x418c('0x5f')]('%s/custom_fields',_0x5bea67),'headers':{'Content-Type':'application/json','Accept':_0x418c('0x60')},'json':!![]};if(_0x435e4c[_0x418c('0x61')]===_0x418c('0x62')){_0x290081['headers'][_0x418c('0x63')]=util[_0x418c('0x5f')](_0x418c('0x64'),new Buffer(util['format'](_0x418c('0x65'),_0x435e4c[_0x418c('0x66')],_0x435e4c[_0x418c('0x67')]))[_0x418c('0x68')](_0x418c('0x69')));}return rp(_0x290081)[_0x418c('0x26')](function(_0x585d16){return _0x3de6ab[_0x418c('0x6a')](_[_0x418c('0x2b')](_0x585d16['_embedded'][_0x418c('0x6b')],function(_0x288d7e){return{'id':_0x288d7e[_0x418c('0x29')],'name':_0x288d7e[_0x418c('0x29')],'type':_0x288d7e[_0x418c('0x3d')],'active':_0x288d7e[_0x418c('0x6c')],'label':_0x288d7e[_0x418c('0x6d')],'custom':!![]};}));});}})['then'](function(_0x4eca57){return{'count':_0x4eca57['length'],'rows':_0x4eca57};})[_0x418c('0x26')](respondWithResult(_0x132535,null))[_0x418c('0x48')](function(_0x3acd2d){var _0x4e66fb=_0x9f2a46['query'][_0x418c('0x6e')]?0x1f4:_0x3acd2d[_0x418c('0x6f')]||0x1f4;logger['error'](_0x418c('0x70'),_0x418c('0x71'),_0x4e66fb,JSON[_0x418c('0x72')](_0x3acd2d));delete _0x3acd2d['name'];if(_0x4e66fb===0x191){_0x4e66fb=0x190;}_0x132535[_0x418c('0x1b')](_0x4e66fb)[_0x418c('0x73')](_0x9f2a46[_0x418c('0x2f')][_0x418c('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x3acd2d['statusCode']}:_0x3acd2d);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index ec6ea14..5c73bbd 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 _0x99d1=['DeskAccount','int_desk_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x99d1,0x195));var _0x199d=function(_0x8944c9,_0x421672){_0x8944c9=_0x8944c9-0x0;var _0x506de1=_0x99d1[_0x8944c9];return _0x506de1;};'use strict';var _=require(_0x199d('0x0'));var util=require(_0x199d('0x1'));var logger=require(_0x199d('0x2'))('api');var moment=require(_0x199d('0x3'));var BPromise=require(_0x199d('0x4'));var rp=require(_0x199d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x199d('0x6'));var config=require(_0x199d('0x7'));var attributes=require(_0x199d('0x8'));var integrations=require(_0x199d('0x9'));module['exports']=function(_0x2b5395,_0x419875){return _0x2b5395[_0x199d('0xa')](_0x199d('0xb'),attributes,{'tableName':_0x199d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc041=['define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x1c964a,_0x1e507d){var _0x282df9=function(_0x13ea03){while(--_0x13ea03){_0x1c964a['push'](_0x1c964a['shift']());}};_0x282df9(++_0x1e507d);}(_0xc041,0x129));var _0x1c04=function(_0x5442a5,_0x4110f1){_0x5442a5=_0x5442a5-0x0;var _0x130af0=_0xc041[_0x5442a5];return _0x130af0;};'use strict';var _=require(_0x1c04('0x0'));var util=require(_0x1c04('0x1'));var logger=require(_0x1c04('0x2'))(_0x1c04('0x3'));var moment=require('moment');var BPromise=require(_0x1c04('0x4'));var rp=require(_0x1c04('0x5'));var fs=require('fs');var path=require(_0x1c04('0x6'));var rimraf=require('rimraf');var config=require(_0x1c04('0x7'));var attributes=require(_0x1c04('0x8'));var integrations=require(_0x1c04('0x9'));module[_0x1c04('0xa')]=function(_0x5dca77,_0x4d2ccf){return _0x5dca77[_0x1c04('0xb')](_0x1c04('0xc'),attributes,{'tableName':_0x1c04('0xd'),'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 745d3f1..6b7b7e4 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 _0x1b2f=['info','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','DeskAccount','findAll','options','raw','where','limit','map','model','include','attributes','debug','GetDeskAccount','ShowDeskAccount','find'];(function(_0x4e7af4,_0x758572){var _0x2548f1=function(_0xa849c){while(--_0xa849c){_0x4e7af4['push'](_0x4e7af4['shift']());}};_0x2548f1(++_0x758572);}(_0x1b2f,0xb0));var _0xf1b2=function(_0x2653cb,_0x3c3426){_0x2653cb=_0x2653cb-0x0;var _0x430809=_0x1b2f[_0x2653cb];return _0x430809;};'use strict';var _=require(_0xf1b2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf1b2('0x1'));var fs=require('fs');var Redis=require(_0xf1b2('0x2'));var db=require(_0xf1b2('0x3'))['db'];var utils=require(_0xf1b2('0x4'));var logger=require(_0xf1b2('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf1b2('0x6'));var client=jayson[_0xf1b2('0x7')][_0xf1b2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x506323,_0x5531c3,_0x4f5f7b){return new BPromise(function(_0x57b30a,_0x5c0040){return client[_0xf1b2('0x9')](_0x506323,_0x4f5f7b)[_0xf1b2('0xa')](function(_0x5e8460){logger['info'](_0xf1b2('0xb'),_0x5531c3,_0xf1b2('0xc'));logger['debug'](_0xf1b2('0xd'),_0x5531c3,_0xf1b2('0xc'),JSON[_0xf1b2('0xe')](_0x5e8460));if(_0x5e8460[_0xf1b2('0xf')]){if(_0x5e8460[_0xf1b2('0xf')][_0xf1b2('0x10')]===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0x5531c3,_0x5e8460[_0xf1b2('0xf')]['message']);return _0x5c0040(_0x5e8460[_0xf1b2('0xf')]['message']);}logger['error'](_0xf1b2('0xb'),_0x5531c3,_0x5e8460[_0xf1b2('0xf')][_0xf1b2('0x11')]);return _0x57b30a(_0x5e8460[_0xf1b2('0xf')][_0xf1b2('0x11')]);}else{logger['info']('DeskAccount,\x20%s,\x20%s',_0x5531c3,_0xf1b2('0xc'));_0x57b30a(_0x5e8460[_0xf1b2('0x12')]['message']);}})[_0xf1b2('0x13')](function(_0x3f1403){logger[_0xf1b2('0xf')](_0xf1b2('0xb'),_0x5531c3,_0x3f1403);_0x5c0040(_0x3f1403);});});}exports['GetDeskAccount']=function(_0x267d78){var _0x3c027b=this;return new Promise(function(_0x256bac,_0x41bfea){return db[_0xf1b2('0x14')][_0xf1b2('0x15')]({'raw':_0x267d78[_0xf1b2('0x16')]?_0x267d78[_0xf1b2('0x16')][_0xf1b2('0x17')]===undefined?!![]:![]:!![],'where':_0x267d78[_0xf1b2('0x16')]?_0x267d78['options'][_0xf1b2('0x18')]||null:null,'attributes':_0x267d78[_0xf1b2('0x16')]?_0x267d78['options']['attributes']||null:null,'limit':_0x267d78['options']?_0x267d78['options'][_0xf1b2('0x19')]||null:null,'include':_0x267d78[_0xf1b2('0x16')]?_0x267d78[_0xf1b2('0x16')]['include']?_[_0xf1b2('0x1a')](_0x267d78[_0xf1b2('0x16')]['include'],function(_0x916c6c){return{'model':db[_0x916c6c[_0xf1b2('0x1b')]],'as':_0x916c6c['as'],'attributes':_0x916c6c['attributes'],'include':_0x916c6c[_0xf1b2('0x1c')]?_[_0xf1b2('0x1a')](_0x916c6c[_0xf1b2('0x1c')],function(_0x51b25b){return{'model':db[_0x51b25b[_0xf1b2('0x1b')]],'as':_0x51b25b['as'],'attributes':_0x51b25b[_0xf1b2('0x1d')],'include':_0x51b25b[_0xf1b2('0x1c')]?_[_0xf1b2('0x1a')](_0x51b25b[_0xf1b2('0x1c')],function(_0xa8963f){return{'model':db[_0xa8963f['model']],'as':_0xa8963f['as'],'attributes':_0xa8963f[_0xf1b2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf1b2('0xa')](function(_0x631954){logger['info']('GetDeskAccount',_0x267d78);logger[_0xf1b2('0x1e')](_0xf1b2('0x1f'),_0x267d78,JSON[_0xf1b2('0xe')](_0x631954));_0x256bac(_0x631954);})[_0xf1b2('0x13')](function(_0x25fe74){logger['error'](_0xf1b2('0x1f'),_0x25fe74[_0xf1b2('0x11')],_0x267d78);_0x41bfea(_0x3c027b[_0xf1b2('0xf')](0x1f4,_0x25fe74['message']));});});};exports[_0xf1b2('0x20')]=function(_0x54a400){var _0x57627c=this;return new Promise(function(_0x108542,_0x32f430){return db['DeskAccount'][_0xf1b2('0x21')]({'raw':_0x54a400[_0xf1b2('0x16')]?_0x54a400['options'][_0xf1b2('0x17')]===undefined?!![]:![]:!![],'where':_0x54a400[_0xf1b2('0x16')]?_0x54a400[_0xf1b2('0x16')][_0xf1b2('0x18')]||null:null,'attributes':_0x54a400[_0xf1b2('0x16')]?_0x54a400[_0xf1b2('0x16')]['attributes']||null:null,'include':_0x54a400['options']?_0x54a400[_0xf1b2('0x16')][_0xf1b2('0x1c')]?_['map'](_0x54a400[_0xf1b2('0x16')][_0xf1b2('0x1c')],function(_0x1d054f){return{'model':db[_0x1d054f[_0xf1b2('0x1b')]],'as':_0x1d054f['as'],'attributes':_0x1d054f[_0xf1b2('0x1d')],'include':_0x1d054f[_0xf1b2('0x1c')]?_[_0xf1b2('0x1a')](_0x1d054f[_0xf1b2('0x1c')],function(_0xd2535d){return{'model':db[_0xd2535d[_0xf1b2('0x1b')]],'as':_0xd2535d['as'],'attributes':_0xd2535d['attributes'],'include':_0xd2535d[_0xf1b2('0x1c')]?_[_0xf1b2('0x1a')](_0xd2535d[_0xf1b2('0x1c')],function(_0x32b61c){return{'model':db[_0x32b61c[_0xf1b2('0x1b')]],'as':_0x32b61c['as'],'attributes':_0x32b61c[_0xf1b2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf1b2('0xa')](function(_0xd4d09b){logger[_0xf1b2('0x22')](_0xf1b2('0x20'),_0x54a400);logger[_0xf1b2('0x1e')]('ShowDeskAccount',_0x54a400,JSON[_0xf1b2('0xe')](_0xd4d09b));_0x108542(_0xd4d09b);})[_0xf1b2('0x13')](function(_0x6bc963){logger[_0xf1b2('0xf')](_0xf1b2('0x20'),_0x6bc963[_0xf1b2('0x11')],_0x54a400);_0x32f430(_0x57627c[_0xf1b2('0xf')](0x1f4,_0x6bc963[_0xf1b2('0x11')]));});});}; \ No newline at end of file +var _0x75a6=['include','attributes','model','debug','ShowDeskAccount','find','raw','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetDeskAccount','DeskAccount','options','where','limit','map'];(function(_0x21b359,_0x4dc80e){var _0x57b8e7=function(_0x135adb){while(--_0x135adb){_0x21b359['push'](_0x21b359['shift']());}};_0x57b8e7(++_0x4dc80e);}(_0x75a6,0xd9));var _0x675a=function(_0x3748c1,_0x8caeb1){_0x3748c1=_0x3748c1-0x0;var _0x1ef943=_0x75a6[_0x3748c1];return _0x1ef943;};'use strict';var _=require('lodash');var util=require(_0x675a('0x0'));var moment=require(_0x675a('0x1'));var BPromise=require('bluebird');var rs=require(_0x675a('0x2'));var fs=require('fs');var Redis=require(_0x675a('0x3'));var db=require(_0x675a('0x4'))['db'];var utils=require(_0x675a('0x5'));var logger=require(_0x675a('0x6'))(_0x675a('0x7'));var config=require('../../config/environment');var jayson=require(_0x675a('0x8'));var client=jayson[_0x675a('0x9')][_0x675a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49fd7e,_0x3c3d00,_0x2e364a){return new BPromise(function(_0x281847,_0x419365){return client[_0x675a('0xb')](_0x49fd7e,_0x2e364a)[_0x675a('0xc')](function(_0x5ea357){logger[_0x675a('0xd')](_0x675a('0xe'),_0x3c3d00,'request\x20sent');logger['debug'](_0x675a('0xf'),_0x3c3d00,_0x675a('0x10'),JSON[_0x675a('0x11')](_0x5ea357));if(_0x5ea357[_0x675a('0x12')]){if(_0x5ea357[_0x675a('0x12')][_0x675a('0x13')]===0x1f4){logger[_0x675a('0x12')](_0x675a('0xe'),_0x3c3d00,_0x5ea357[_0x675a('0x12')][_0x675a('0x14')]);return _0x419365(_0x5ea357['error'][_0x675a('0x14')]);}logger[_0x675a('0x12')](_0x675a('0xe'),_0x3c3d00,_0x5ea357['error'][_0x675a('0x14')]);return _0x281847(_0x5ea357['error'][_0x675a('0x14')]);}else{logger[_0x675a('0xd')]('DeskAccount,\x20%s,\x20%s',_0x3c3d00,_0x675a('0x10'));_0x281847(_0x5ea357['result'][_0x675a('0x14')]);}})[_0x675a('0x15')](function(_0x1e101c){logger[_0x675a('0x12')](_0x675a('0xe'),_0x3c3d00,_0x1e101c);_0x419365(_0x1e101c);});});}exports[_0x675a('0x16')]=function(_0x5952da){var _0x63f76e=this;return new Promise(function(_0x2db656,_0x32c2ce){return db[_0x675a('0x17')]['findAll']({'raw':_0x5952da['options']?_0x5952da['options']['raw']===undefined?!![]:![]:!![],'where':_0x5952da[_0x675a('0x18')]?_0x5952da[_0x675a('0x18')][_0x675a('0x19')]||null:null,'attributes':_0x5952da[_0x675a('0x18')]?_0x5952da[_0x675a('0x18')]['attributes']||null:null,'limit':_0x5952da[_0x675a('0x18')]?_0x5952da[_0x675a('0x18')][_0x675a('0x1a')]||null:null,'include':_0x5952da[_0x675a('0x18')]?_0x5952da['options']['include']?_[_0x675a('0x1b')](_0x5952da[_0x675a('0x18')][_0x675a('0x1c')],function(_0x5d68df){return{'model':db[_0x5d68df['model']],'as':_0x5d68df['as'],'attributes':_0x5d68df[_0x675a('0x1d')],'include':_0x5d68df[_0x675a('0x1c')]?_['map'](_0x5d68df[_0x675a('0x1c')],function(_0x156056){return{'model':db[_0x156056['model']],'as':_0x156056['as'],'attributes':_0x156056['attributes'],'include':_0x156056[_0x675a('0x1c')]?_['map'](_0x156056['include'],function(_0x47c00e){return{'model':db[_0x47c00e[_0x675a('0x1e')]],'as':_0x47c00e['as'],'attributes':_0x47c00e[_0x675a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x675a('0xc')](function(_0x33fb0c){logger['info'](_0x675a('0x16'),_0x5952da);logger[_0x675a('0x1f')](_0x675a('0x16'),_0x5952da,JSON[_0x675a('0x11')](_0x33fb0c));_0x2db656(_0x33fb0c);})[_0x675a('0x15')](function(_0x552aa6){logger[_0x675a('0x12')]('GetDeskAccount',_0x552aa6[_0x675a('0x14')],_0x5952da);_0x32c2ce(_0x63f76e[_0x675a('0x12')](0x1f4,_0x552aa6[_0x675a('0x14')]));});});};exports[_0x675a('0x20')]=function(_0x42b70d){var _0xdc1f3f=this;return new Promise(function(_0x58f3c3,_0x56ebeb){return db[_0x675a('0x17')][_0x675a('0x21')]({'raw':_0x42b70d['options']?_0x42b70d[_0x675a('0x18')][_0x675a('0x22')]===undefined?!![]:![]:!![],'where':_0x42b70d[_0x675a('0x18')]?_0x42b70d[_0x675a('0x18')][_0x675a('0x19')]||null:null,'attributes':_0x42b70d[_0x675a('0x18')]?_0x42b70d[_0x675a('0x18')]['attributes']||null:null,'include':_0x42b70d[_0x675a('0x18')]?_0x42b70d[_0x675a('0x18')]['include']?_['map'](_0x42b70d[_0x675a('0x18')][_0x675a('0x1c')],function(_0x1d926a){return{'model':db[_0x1d926a['model']],'as':_0x1d926a['as'],'attributes':_0x1d926a[_0x675a('0x1d')],'include':_0x1d926a[_0x675a('0x1c')]?_['map'](_0x1d926a[_0x675a('0x1c')],function(_0x5f111f){return{'model':db[_0x5f111f['model']],'as':_0x5f111f['as'],'attributes':_0x5f111f['attributes'],'include':_0x5f111f[_0x675a('0x1c')]?_[_0x675a('0x1b')](_0x5f111f[_0x675a('0x1c')],function(_0x468e2d){return{'model':db[_0x468e2d[_0x675a('0x1e')]],'as':_0x468e2d['as'],'attributes':_0x468e2d[_0x675a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x675a('0xc')](function(_0x40b46b){logger[_0x675a('0xd')](_0x675a('0x20'),_0x42b70d);logger['debug'](_0x675a('0x20'),_0x42b70d,JSON[_0x675a('0x11')](_0x40b46b));_0x58f3c3(_0x40b46b);})[_0x675a('0x15')](function(_0x2f3664){logger[_0x675a('0x12')](_0x675a('0x20'),_0x2f3664[_0x675a('0x14')],_0x42b70d);_0x56ebeb(_0xdc1f3f[_0x675a('0x12')](0x1f4,_0x2f3664[_0x675a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index bd9eb7b..5b87f3d 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(_0x344bfe,_0x1fc4c4){var _0x2ef6d1=function(_0x4d22a0){while(--_0x4d22a0){_0x344bfe['push'](_0x344bfe['shift']());}};_0x2ef6d1(++_0x1fc4c4);}(_0x34e8,0x12c));var _0x834e=function(_0x4c4d2e,_0x34a635){_0x4c4d2e=_0x4c4d2e-0x0;var _0x20d8e0=_0x34e8[_0x4c4d2e];return _0x20d8e0;};'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 _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4ee688,_0x2ed804){var _0x3ad0a5=function(_0x230876){while(--_0x230876){_0x4ee688['push'](_0x4ee688['shift']());}};_0x3ad0a5(++_0x2ed804);}(_0x008c,0x188));var _0xc008=function(_0x5bd044,_0xafd5fa){_0x5bd044=_0x5bd044-0x0;var _0x582fd7=_0x008c[_0x5bd044];return _0x582fd7;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index b46be51..0a2d23b 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 _0x276f=['sequelize','exports','STRING'];(function(_0x56bea7,_0x2cbb7b){var _0x1542f6=function(_0x41b530){while(--_0x41b530){_0x56bea7['push'](_0x56bea7['shift']());}};_0x1542f6(++_0x2cbb7b);}(_0x276f,0x1b3));var _0xf276=function(_0x583a0b,_0x1a0347){_0x583a0b=_0x583a0b-0x0;var _0x294a68=_0x276f[_0x583a0b];return _0x294a68;};'use strict';var Sequelize=require(_0xf276('0x0'));module[_0xf276('0x1')]={'name':{'type':Sequelize[_0xf276('0x2')]},'description':{'type':Sequelize[_0xf276('0x2')]}}; \ No newline at end of file +var _0xccb7=['STRING','sequelize','exports'];(function(_0x5d0e63,_0x183e30){var _0x39c1cf=function(_0x3c0993){while(--_0x3c0993){_0x5d0e63['push'](_0x5d0e63['shift']());}};_0x39c1cf(++_0x183e30);}(_0xccb7,0xfa));var _0x7ccb=function(_0x3dfc9e,_0x3a8f6b){_0x3dfc9e=_0x3dfc9e-0x0;var _0x51e3e1=_0xccb7[_0x3dfc9e];return _0x51e3e1;};'use strict';var Sequelize=require(_0x7ccb('0x0'));module[_0x7ccb('0x1')]={'name':{'type':Sequelize[_0x7ccb('0x2')]},'description':{'type':Sequelize[_0x7ccb('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 463fc64..e218439 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 _0xbc55=['params','findOne','getFields','nolimit','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','DeskConfiguration','findAll','show','options','find','catch','create','body'];(function(_0x2b9199,_0x2e64ab){var _0xba19a7=function(_0x5ee36f){while(--_0x5ee36f){_0x2b9199['push'](_0x2b9199['shift']());}};_0xba19a7(++_0x2e64ab);}(_0xbc55,0xb0));var _0x5bc5=function(_0x530c37,_0x42e08d){_0x530c37=_0x530c37-0x0;var _0x5219ef=_0xbc55[_0x530c37];return _0x5219ef;};'use strict';var emlformat=require(_0x5bc5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5bc5('0x1'));var jsonpatch=require(_0x5bc5('0x2'));var rp=require(_0x5bc5('0x3'));var moment=require('moment');var BPromise=require(_0x5bc5('0x4'));var Mustache=require(_0x5bc5('0x5'));var util=require(_0x5bc5('0x6'));var path=require('path');var sox=require(_0x5bc5('0x7'));var csv=require(_0x5bc5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5bc5('0x9'));var _=require(_0x5bc5('0xa'));var squel=require(_0x5bc5('0xb'));var crypto=require(_0x5bc5('0xc'));var jsforce=require(_0x5bc5('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5bc5('0x8'));var querystring=require(_0x5bc5('0xe'));var Papa=require('papaparse');var Redis=require(_0x5bc5('0xf'));var authService=require(_0x5bc5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5bc5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5bc5('0x12'))(_0x5bc5('0x13'));var utils=require(_0x5bc5('0x14'));var config=require(_0x5bc5('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bc5('0x16'))['db'];function respondWithStatusCode(_0x2b40b8,_0x1c6a49){_0x1c6a49=_0x1c6a49||0xcc;return function(_0x157f0a){if(_0x157f0a){return _0x2b40b8[_0x5bc5('0x17')](_0x1c6a49);}return _0x2b40b8[_0x5bc5('0x18')](_0x1c6a49)['end']();};}function respondWithResult(_0x2d6f45,_0x1158b5){_0x1158b5=_0x1158b5||0xc8;return function(_0xacc339){if(_0xacc339){return _0x2d6f45[_0x5bc5('0x18')](_0x1158b5)['json'](_0xacc339);}};}function respondWithFilteredResult(_0x1c13c2,_0x32de12){return function(_0x1d97bc){if(_0x1d97bc){var _0x426eed=typeof _0x32de12[_0x5bc5('0x19')]===_0x5bc5('0x1a')&&typeof _0x32de12[_0x5bc5('0x1b')]===_0x5bc5('0x1a');var _0x1b61cc=_0x1d97bc[_0x5bc5('0x1c')];var _0x169c42=_0x426eed?0x0:_0x32de12['offset'];var _0x2931bf=_0x426eed?_0x1d97bc[_0x5bc5('0x1c')]:_0x32de12[_0x5bc5('0x19')]+_0x32de12['limit'];var _0x5724cb;if(_0x2931bf>=_0x1b61cc){_0x2931bf=_0x1b61cc;_0x5724cb=0xc8;}else{_0x5724cb=0xce;}_0x1c13c2[_0x5bc5('0x18')](_0x5724cb);return _0x1c13c2[_0x5bc5('0x1d')](_0x5bc5('0x1e'),_0x169c42+'-'+_0x2931bf+'/'+_0x1b61cc)[_0x5bc5('0x1f')](_0x1d97bc);}return null;};}function patchUpdates(_0x5d634b){return function(_0x58e417){try{jsonpatch[_0x5bc5('0x20')](_0x58e417,_0x5d634b,!![]);}catch(_0x970e35){return BPromise[_0x5bc5('0x21')](_0x970e35);}return _0x58e417[_0x5bc5('0x22')]();};}function saveUpdates(_0x29f35e,_0x43faa7){return function(_0x4b7422){if(_0x4b7422){return _0x4b7422[_0x5bc5('0x23')](_0x29f35e)[_0x5bc5('0x24')](function(_0x167d9e){return _0x167d9e;});}return null;};}function removeEntity(_0xef5974,_0x1b36e1){return function(_0x2e03c6){if(_0x2e03c6){return _0x2e03c6[_0x5bc5('0x25')]()[_0x5bc5('0x24')](function(){_0xef5974[_0x5bc5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52dafd,_0x56462c){return function(_0x70c8ba){if(!_0x70c8ba){_0x52dafd[_0x5bc5('0x17')](0x194);}return _0x70c8ba;};}function handleError(_0x52755e,_0x368218){_0x368218=_0x368218||0x1f4;return function(_0x3b9ad7){logger[_0x5bc5('0x26')](_0x3b9ad7['stack']);if(_0x3b9ad7[_0x5bc5('0x27')]){delete _0x3b9ad7[_0x5bc5('0x27')];}_0x52755e['status'](_0x368218)[_0x5bc5('0x28')](_0x3b9ad7);};}exports[_0x5bc5('0x29')]=function(_0x302811,_0x365be1){var _0x137089={},_0x43dc9b={},_0x2f9bc5={'count':0x0,'rows':[]};var _0x2998fe=_[_0x5bc5('0x2a')](db['DeskConfiguration'][_0x5bc5('0x2b')],function(_0x2203ce){return{'name':_0x2203ce[_0x5bc5('0x2c')],'type':_0x2203ce[_0x5bc5('0x2d')][_0x5bc5('0x2e')]};});_0x43dc9b[_0x5bc5('0x2f')]=_[_0x5bc5('0x2a')](_0x2998fe,_0x5bc5('0x27'));_0x43dc9b['query']=_[_0x5bc5('0x30')](_0x302811[_0x5bc5('0x31')]);_0x43dc9b[_0x5bc5('0x32')]=_[_0x5bc5('0x33')](_0x43dc9b[_0x5bc5('0x2f')],_0x43dc9b[_0x5bc5('0x31')]);_0x137089[_0x5bc5('0x34')]=_[_0x5bc5('0x33')](_0x43dc9b['model'],qs[_0x5bc5('0x35')](_0x302811['query'][_0x5bc5('0x35')]));_0x137089[_0x5bc5('0x34')]=_0x137089[_0x5bc5('0x34')][_0x5bc5('0x36')]?_0x137089[_0x5bc5('0x34')]:_0x43dc9b['model'];if(!_0x302811['query'][_0x5bc5('0x37')]('nolimit')){_0x137089[_0x5bc5('0x1b')]=qs[_0x5bc5('0x1b')](_0x302811[_0x5bc5('0x31')][_0x5bc5('0x1b')]);_0x137089['offset']=qs[_0x5bc5('0x19')](_0x302811['query'][_0x5bc5('0x19')]);}_0x137089[_0x5bc5('0x38')]=qs[_0x5bc5('0x39')](_0x302811['query'][_0x5bc5('0x39')]);_0x137089[_0x5bc5('0x3a')]=qs[_0x5bc5('0x32')](_[_0x5bc5('0x3b')](_0x302811[_0x5bc5('0x31')],_0x43dc9b[_0x5bc5('0x32')]),_0x2998fe);if(_0x302811[_0x5bc5('0x31')][_0x5bc5('0x3c')]){_0x137089[_0x5bc5('0x3a')]=_[_0x5bc5('0x3d')](_0x137089[_0x5bc5('0x3a')],{'$or':_[_0x5bc5('0x2a')](_0x2998fe,function(_0x551552){if(_0x551552[_0x5bc5('0x2d')]!==_0x5bc5('0x3e')){var _0x78f832={};_0x78f832[_0x551552['name']]={'$like':'%'+_0x302811['query'][_0x5bc5('0x3c')]+'%'};return _0x78f832;}})});}_0x137089=_[_0x5bc5('0x3d')]({},_0x137089,_0x302811['options']);var _0x448f02={'where':_0x137089[_0x5bc5('0x3a')]};return db['DeskConfiguration'][_0x5bc5('0x1c')](_0x448f02)[_0x5bc5('0x24')](function(_0x25fc39){_0x2f9bc5[_0x5bc5('0x1c')]=_0x25fc39;if(_0x302811['query'][_0x5bc5('0x3f')]){_0x137089[_0x5bc5('0x40')]=[{'all':!![]}];}return db[_0x5bc5('0x41')][_0x5bc5('0x42')](_0x137089);})['then'](function(_0x1b6bd5){_0x2f9bc5['rows']=_0x1b6bd5;return _0x2f9bc5;})['then'](respondWithFilteredResult(_0x365be1,_0x137089))['catch'](handleError(_0x365be1,null));};exports[_0x5bc5('0x43')]=function(_0x448ec6,_0xeece92){var _0x28194a={'raw':![],'where':{'id':_0x448ec6['params']['id']}},_0x62990a={};_0x62990a[_0x5bc5('0x2f')]=_[_0x5bc5('0x30')](db[_0x5bc5('0x41')][_0x5bc5('0x2b')]);_0x62990a[_0x5bc5('0x31')]=_[_0x5bc5('0x30')](_0x448ec6[_0x5bc5('0x31')]);_0x62990a[_0x5bc5('0x32')]=_[_0x5bc5('0x33')](_0x62990a[_0x5bc5('0x2f')],_0x62990a[_0x5bc5('0x31')]);_0x28194a[_0x5bc5('0x34')]=_[_0x5bc5('0x33')](_0x62990a[_0x5bc5('0x2f')],qs[_0x5bc5('0x35')](_0x448ec6[_0x5bc5('0x31')]['fields']));_0x28194a[_0x5bc5('0x34')]=_0x28194a['attributes'][_0x5bc5('0x36')]?_0x28194a['attributes']:_0x62990a[_0x5bc5('0x2f')];if(_0x448ec6[_0x5bc5('0x31')][_0x5bc5('0x3f')]){_0x28194a['include']=[{'all':!![]}];}_0x28194a=_[_0x5bc5('0x3d')]({},_0x28194a,_0x448ec6[_0x5bc5('0x44')]);return db[_0x5bc5('0x41')][_0x5bc5('0x45')](_0x28194a)['then'](handleEntityNotFound(_0xeece92,null))[_0x5bc5('0x24')](respondWithResult(_0xeece92,null))[_0x5bc5('0x46')](handleError(_0xeece92,null));};exports[_0x5bc5('0x47')]=function(_0x146b5d,_0x228758){return db[_0x5bc5('0x41')][_0x5bc5('0x47')](_0x146b5d[_0x5bc5('0x48')],{})['then'](respondWithResult(_0x228758,0xc9))[_0x5bc5('0x46')](handleError(_0x228758,null));};exports[_0x5bc5('0x23')]=function(_0x1ad3b0,_0x200c25){if(_0x1ad3b0[_0x5bc5('0x48')]['id']){delete _0x1ad3b0['body']['id'];}return db[_0x5bc5('0x41')]['find']({'where':{'id':_0x1ad3b0[_0x5bc5('0x49')]['id']}})[_0x5bc5('0x24')](handleEntityNotFound(_0x200c25,null))[_0x5bc5('0x24')](saveUpdates(_0x1ad3b0['body'],null))[_0x5bc5('0x24')](respondWithResult(_0x200c25,null))[_0x5bc5('0x46')](handleError(_0x200c25,null));};exports['destroy']=function(_0x243419,_0x2ac3d4){return db['DeskConfiguration']['find']({'where':{'id':_0x243419[_0x5bc5('0x49')]['id']}})[_0x5bc5('0x24')](handleEntityNotFound(_0x2ac3d4,null))['then'](removeEntity(_0x2ac3d4,null))['catch'](handleError(_0x2ac3d4,null));};exports['getFields']=function(_0x161357,_0x33e092,_0x2659a1){var _0x156667={};var _0x5ba309={};var _0x57d9e7;var _0x24ab77;return db[_0x5bc5('0x41')][_0x5bc5('0x4a')]({'where':{'id':_0x161357[_0x5bc5('0x49')]['id']}})[_0x5bc5('0x24')](handleEntityNotFound(_0x33e092,null))['then'](function(_0x5dcf4a){if(_0x5dcf4a){_0x57d9e7=_0x5dcf4a;_0x5ba309[_0x5bc5('0x2f')]=_[_0x5bc5('0x30')](db['DeskField'][_0x5bc5('0x2b')]);_0x5ba309[_0x5bc5('0x31')]=_[_0x5bc5('0x30')](_0x161357[_0x5bc5('0x31')]);_0x5ba309[_0x5bc5('0x32')]=_[_0x5bc5('0x33')](_0x5ba309[_0x5bc5('0x2f')],_0x5ba309[_0x5bc5('0x31')]);_0x156667[_0x5bc5('0x34')]=_['intersection'](_0x5ba309[_0x5bc5('0x2f')],qs[_0x5bc5('0x35')](_0x161357[_0x5bc5('0x31')]['fields']));_0x156667[_0x5bc5('0x34')]=_0x156667[_0x5bc5('0x34')][_0x5bc5('0x36')]?_0x156667['attributes']:_0x5ba309['model'];_0x156667['order']=qs[_0x5bc5('0x39')](_0x161357[_0x5bc5('0x31')]['sort']);_0x156667[_0x5bc5('0x3a')]=qs[_0x5bc5('0x32')](_['pick'](_0x161357['query'],_0x5ba309[_0x5bc5('0x32')]));if(_0x161357['query'][_0x5bc5('0x3c')]){_0x156667['where']=_[_0x5bc5('0x3d')](_0x156667[_0x5bc5('0x3a')],{'$or':_['map'](_0x156667[_0x5bc5('0x34')],function(_0x1f8c11){var _0x281505={};_0x281505[_0x1f8c11]={'$like':'%'+_0x161357[_0x5bc5('0x31')][_0x5bc5('0x3c')]+'%'};return _0x281505;})});}_0x156667=_[_0x5bc5('0x3d')]({},_0x156667,_0x161357['options']);return _0x57d9e7[_0x5bc5('0x4b')](_0x156667);}})[_0x5bc5('0x24')](function(_0xce02fa){if(_0xce02fa){_0x24ab77=_0xce02fa['length'];if(!_0x161357['query'][_0x5bc5('0x37')](_0x5bc5('0x4c'))){_0x156667[_0x5bc5('0x1b')]=qs['limit'](_0x161357['query'][_0x5bc5('0x1b')]);_0x156667[_0x5bc5('0x19')]=qs[_0x5bc5('0x19')](_0x161357['query'][_0x5bc5('0x19')]);}return _0x57d9e7[_0x5bc5('0x4b')](_0x156667);}})['then'](function(_0x54af24){if(_0x54af24){return _0x54af24?{'count':_0x24ab77,'rows':_0x54af24}:null;}})[_0x5bc5('0x24')](respondWithResult(_0x33e092,null))[_0x5bc5('0x46')](handleError(_0x33e092,null));};exports[_0x5bc5('0x4d')]=function(_0x1d7d4e,_0x7255e0,_0x585a68){var _0x355b87={};var _0x3f4e95={};var _0x2dff7f;var _0xa1f6f5;return db[_0x5bc5('0x41')][_0x5bc5('0x4a')]({'where':{'id':_0x1d7d4e[_0x5bc5('0x49')]['id']}})[_0x5bc5('0x24')](handleEntityNotFound(_0x7255e0,null))['then'](function(_0x2c4009){if(_0x2c4009){_0x2dff7f=_0x2c4009;_0x3f4e95['model']=_[_0x5bc5('0x30')](db['DeskField'][_0x5bc5('0x2b')]);_0x3f4e95[_0x5bc5('0x31')]=_[_0x5bc5('0x30')](_0x1d7d4e[_0x5bc5('0x31')]);_0x3f4e95[_0x5bc5('0x32')]=_['intersection'](_0x3f4e95['model'],_0x3f4e95[_0x5bc5('0x31')]);_0x355b87[_0x5bc5('0x34')]=_[_0x5bc5('0x33')](_0x3f4e95[_0x5bc5('0x2f')],qs[_0x5bc5('0x35')](_0x1d7d4e[_0x5bc5('0x31')]['fields']));_0x355b87['attributes']=_0x355b87[_0x5bc5('0x34')]['length']?_0x355b87[_0x5bc5('0x34')]:_0x3f4e95[_0x5bc5('0x2f')];_0x355b87[_0x5bc5('0x38')]=qs[_0x5bc5('0x39')](_0x1d7d4e[_0x5bc5('0x31')][_0x5bc5('0x39')]);_0x355b87['where']=qs[_0x5bc5('0x32')](_[_0x5bc5('0x3b')](_0x1d7d4e[_0x5bc5('0x31')],_0x3f4e95[_0x5bc5('0x32')]));if(_0x1d7d4e[_0x5bc5('0x31')][_0x5bc5('0x3c')]){_0x355b87[_0x5bc5('0x3a')]=_[_0x5bc5('0x3d')](_0x355b87[_0x5bc5('0x3a')],{'$or':_['map'](_0x355b87['attributes'],function(_0x5cf1f4){var _0x2f775c={};_0x2f775c[_0x5cf1f4]={'$like':'%'+_0x1d7d4e[_0x5bc5('0x31')][_0x5bc5('0x3c')]+'%'};return _0x2f775c;})});}_0x355b87=_[_0x5bc5('0x3d')]({},_0x355b87,_0x1d7d4e['options']);return _0x2dff7f[_0x5bc5('0x4d')](_0x355b87);}})[_0x5bc5('0x24')](function(_0x577900){if(_0x577900){_0xa1f6f5=_0x577900[_0x5bc5('0x36')];if(!_0x1d7d4e[_0x5bc5('0x31')]['hasOwnProperty']('nolimit')){_0x355b87[_0x5bc5('0x1b')]=qs[_0x5bc5('0x1b')](_0x1d7d4e['query'][_0x5bc5('0x1b')]);_0x355b87[_0x5bc5('0x19')]=qs['offset'](_0x1d7d4e['query'][_0x5bc5('0x19')]);}return _0x2dff7f[_0x5bc5('0x4d')](_0x355b87);}})[_0x5bc5('0x24')](function(_0x325858){if(_0x325858){return _0x325858?{'count':_0xa1f6f5,'rows':_0x325858}:null;}})[_0x5bc5('0x24')](respondWithResult(_0x7255e0,null))[_0x5bc5('0x46')](handleError(_0x7255e0,null));};exports[_0x5bc5('0x4e')]=function(_0x5ec9f5,_0x4c3f8e,_0xcc87f8){var _0x262b1a={};var _0x56b855={};var _0x31a2a3;var _0x5783f2;return db[_0x5bc5('0x41')][_0x5bc5('0x4a')]({'where':{'id':_0x5ec9f5[_0x5bc5('0x49')]['id']}})[_0x5bc5('0x24')](handleEntityNotFound(_0x4c3f8e,null))['then'](function(_0x2f0c8d){if(_0x2f0c8d){_0x31a2a3=_0x2f0c8d;_0x56b855['model']=_[_0x5bc5('0x30')](db['DeskField']['rawAttributes']);_0x56b855[_0x5bc5('0x31')]=_['keys'](_0x5ec9f5[_0x5bc5('0x31')]);_0x56b855[_0x5bc5('0x32')]=_['intersection'](_0x56b855[_0x5bc5('0x2f')],_0x56b855[_0x5bc5('0x31')]);_0x262b1a[_0x5bc5('0x34')]=_[_0x5bc5('0x33')](_0x56b855[_0x5bc5('0x2f')],qs[_0x5bc5('0x35')](_0x5ec9f5[_0x5bc5('0x31')][_0x5bc5('0x35')]));_0x262b1a[_0x5bc5('0x34')]=_0x262b1a[_0x5bc5('0x34')][_0x5bc5('0x36')]?_0x262b1a['attributes']:_0x56b855['model'];_0x262b1a[_0x5bc5('0x38')]=qs['sort'](_0x5ec9f5[_0x5bc5('0x31')]['sort']);_0x262b1a[_0x5bc5('0x3a')]=qs[_0x5bc5('0x32')](_[_0x5bc5('0x3b')](_0x5ec9f5[_0x5bc5('0x31')],_0x56b855['filters']));if(_0x5ec9f5[_0x5bc5('0x31')][_0x5bc5('0x3c')]){_0x262b1a[_0x5bc5('0x3a')]=_[_0x5bc5('0x3d')](_0x262b1a[_0x5bc5('0x3a')],{'$or':_['map'](_0x262b1a[_0x5bc5('0x34')],function(_0x2f8586){var _0x4981dc={};_0x4981dc[_0x2f8586]={'$like':'%'+_0x5ec9f5['query'][_0x5bc5('0x3c')]+'%'};return _0x4981dc;})});}_0x262b1a=_[_0x5bc5('0x3d')]({},_0x262b1a,_0x5ec9f5[_0x5bc5('0x44')]);return _0x31a2a3[_0x5bc5('0x4e')](_0x262b1a);}})[_0x5bc5('0x24')](function(_0x3519b5){if(_0x3519b5){_0x5783f2=_0x3519b5[_0x5bc5('0x36')];if(!_0x5ec9f5[_0x5bc5('0x31')][_0x5bc5('0x37')]('nolimit')){_0x262b1a[_0x5bc5('0x1b')]=qs[_0x5bc5('0x1b')](_0x5ec9f5[_0x5bc5('0x31')][_0x5bc5('0x1b')]);_0x262b1a['offset']=qs[_0x5bc5('0x19')](_0x5ec9f5[_0x5bc5('0x31')][_0x5bc5('0x19')]);}return _0x31a2a3[_0x5bc5('0x4e')](_0x262b1a);}})[_0x5bc5('0x24')](function(_0x19d8ed){if(_0x19d8ed){return _0x19d8ed?{'count':_0x5783f2,'rows':_0x19d8ed}:null;}})[_0x5bc5('0x24')](respondWithResult(_0x4c3f8e,null))['catch'](handleError(_0x4c3f8e,null));};exports['getTags']=function(_0x386522,_0x3fa3c7,_0x4e71be){var _0x5ca54c={};var _0x4d10d6={};var _0x48cc05;var _0x36d211;return db['DeskConfiguration'][_0x5bc5('0x4a')]({'where':{'id':_0x386522[_0x5bc5('0x49')]['id']}})['then'](handleEntityNotFound(_0x3fa3c7,null))[_0x5bc5('0x24')](function(_0x1cbe74){if(_0x1cbe74){_0x48cc05=_0x1cbe74;_0x4d10d6[_0x5bc5('0x2f')]=_[_0x5bc5('0x30')](db[_0x5bc5('0x4f')][_0x5bc5('0x2b')]);_0x4d10d6['query']=_[_0x5bc5('0x30')](_0x386522[_0x5bc5('0x31')]);_0x4d10d6[_0x5bc5('0x32')]=_[_0x5bc5('0x33')](_0x4d10d6[_0x5bc5('0x2f')],_0x4d10d6[_0x5bc5('0x31')]);_0x5ca54c[_0x5bc5('0x34')]=_[_0x5bc5('0x33')](_0x4d10d6[_0x5bc5('0x2f')],qs['fields'](_0x386522[_0x5bc5('0x31')][_0x5bc5('0x35')]));_0x5ca54c[_0x5bc5('0x34')]=_0x5ca54c[_0x5bc5('0x34')][_0x5bc5('0x36')]?_0x5ca54c['attributes']:_0x4d10d6['model'];_0x5ca54c[_0x5bc5('0x38')]=qs[_0x5bc5('0x39')](_0x386522[_0x5bc5('0x31')][_0x5bc5('0x39')]);_0x5ca54c[_0x5bc5('0x3a')]=qs[_0x5bc5('0x32')](_[_0x5bc5('0x3b')](_0x386522[_0x5bc5('0x31')],_0x4d10d6[_0x5bc5('0x32')]));if(_0x386522['query']['filter']){_0x5ca54c[_0x5bc5('0x3a')]=_['merge'](_0x5ca54c[_0x5bc5('0x3a')],{'$or':_[_0x5bc5('0x2a')](_0x5ca54c[_0x5bc5('0x34')],function(_0x4d0a78){var _0x196684={};_0x196684[_0x4d0a78]={'$like':'%'+_0x386522['query']['filter']+'%'};return _0x196684;})});}_0x5ca54c=_[_0x5bc5('0x3d')]({},_0x5ca54c,_0x386522[_0x5bc5('0x44')]);return _0x48cc05['getTags'](_0x5ca54c);}})['then'](function(_0x16a841){if(_0x16a841){_0x36d211=_0x16a841[_0x5bc5('0x36')];if(!_0x386522[_0x5bc5('0x31')][_0x5bc5('0x37')]('nolimit')){_0x5ca54c[_0x5bc5('0x1b')]=qs[_0x5bc5('0x1b')](_0x386522['query']['limit']);_0x5ca54c[_0x5bc5('0x19')]=qs['offset'](_0x386522['query']['offset']);}return _0x48cc05[_0x5bc5('0x50')](_0x5ca54c);}})[_0x5bc5('0x24')](function(_0xec3d0){if(_0xec3d0){return _0xec3d0?{'count':_0x36d211,'rows':_0xec3d0}:null;}})[_0x5bc5('0x24')](respondWithResult(_0x3fa3c7,null))['catch'](handleError(_0x3fa3c7,null));};exports['setTags']=function(_0x36843d,_0x8cf391,_0x2f2504){if(_0x36843d['body']['id']){delete _0x36843d[_0x5bc5('0x48')]['id'];}return db[_0x5bc5('0x41')][_0x5bc5('0x4a')]({'where':{'id':_0x36843d[_0x5bc5('0x49')]['id']}})[_0x5bc5('0x24')](handleEntityNotFound(_0x8cf391,null))[_0x5bc5('0x24')](function(_0x17b497){if(_0x17b497){return _0x17b497[_0x5bc5('0x51')](_0x36843d['body'][_0x5bc5('0x52')]||[]);}return null;})['then'](respondWithResult(_0x8cf391,null))[_0x5bc5('0x46')](handleError(_0x8cf391,null));}; \ No newline at end of file +var _0x6db9=['nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','catch','create','body','update','findOne','DeskField','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','then','destroy','error','name','send','index','map','DeskConfiguration','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x3d2a07,_0x4fba18){var _0x30484b=function(_0x33390b){while(--_0x33390b){_0x3d2a07['push'](_0x3d2a07['shift']());}};_0x30484b(++_0x4fba18);}(_0x6db9,0xc3));var _0x96db=function(_0x19a0af,_0x5ecca3){_0x19a0af=_0x19a0af-0x0;var _0x3903bc=_0x6db9[_0x19a0af];return _0x3903bc;};'use strict';var emlformat=require(_0x96db('0x0'));var rimraf=require(_0x96db('0x1'));var zipdir=require(_0x96db('0x2'));var jsonpatch=require(_0x96db('0x3'));var rp=require(_0x96db('0x4'));var moment=require(_0x96db('0x5'));var BPromise=require(_0x96db('0x6'));var Mustache=require(_0x96db('0x7'));var util=require(_0x96db('0x8'));var path=require(_0x96db('0x9'));var sox=require(_0x96db('0xa'));var csv=require('to-csv');var ejs=require(_0x96db('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x96db('0xc'));var squel=require(_0x96db('0xd'));var crypto=require(_0x96db('0xe'));var jsforce=require(_0x96db('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x96db('0x10'));var querystring=require('querystring');var Papa=require(_0x96db('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x96db('0x12'));var as=require(_0x96db('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x96db('0x14'));var utils=require(_0x96db('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x96db('0x16'))['db'];function respondWithStatusCode(_0x1a6eb5,_0x54644f){_0x54644f=_0x54644f||0xcc;return function(_0x261f46){if(_0x261f46){return _0x1a6eb5[_0x96db('0x17')](_0x54644f);}return _0x1a6eb5['status'](_0x54644f)[_0x96db('0x18')]();};}function respondWithResult(_0x5970be,_0x377e3b){_0x377e3b=_0x377e3b||0xc8;return function(_0x44a30a){if(_0x44a30a){return _0x5970be[_0x96db('0x19')](_0x377e3b)[_0x96db('0x1a')](_0x44a30a);}};}function respondWithFilteredResult(_0x3a9135,_0xe6509e){return function(_0x1357b1){if(_0x1357b1){var _0x2dffb2=typeof _0xe6509e[_0x96db('0x1b')]===_0x96db('0x1c')&&typeof _0xe6509e[_0x96db('0x1d')]===_0x96db('0x1c');var _0x4ae31b=_0x1357b1[_0x96db('0x1e')];var _0x560cae=_0x2dffb2?0x0:_0xe6509e['offset'];var _0x53900e=_0x2dffb2?_0x1357b1[_0x96db('0x1e')]:_0xe6509e['offset']+_0xe6509e['limit'];var _0x2dcd28;if(_0x53900e>=_0x4ae31b){_0x53900e=_0x4ae31b;_0x2dcd28=0xc8;}else{_0x2dcd28=0xce;}_0x3a9135[_0x96db('0x19')](_0x2dcd28);return _0x3a9135['set']('Content-Range',_0x560cae+'-'+_0x53900e+'/'+_0x4ae31b)['json'](_0x1357b1);}return null;};}function patchUpdates(_0x144d1){return function(_0x240943){try{jsonpatch[_0x96db('0x1f')](_0x240943,_0x144d1,!![]);}catch(_0x3760cf){return BPromise[_0x96db('0x20')](_0x3760cf);}return _0x240943['save']();};}function saveUpdates(_0x3a01ef,_0x2262d5){return function(_0xb54fc3){if(_0xb54fc3){return _0xb54fc3['update'](_0x3a01ef)[_0x96db('0x21')](function(_0x119cb5){return _0x119cb5;});}return null;};}function removeEntity(_0x660088,_0x2bd2f4){return function(_0xcf47c4){if(_0xcf47c4){return _0xcf47c4[_0x96db('0x22')]()['then'](function(){_0x660088[_0x96db('0x19')](0xcc)[_0x96db('0x18')]();});}};}function handleEntityNotFound(_0x1188eb,_0x5e9692){return function(_0x2a8e47){if(!_0x2a8e47){_0x1188eb[_0x96db('0x17')](0x194);}return _0x2a8e47;};}function handleError(_0x5077ed,_0x1bd6ce){_0x1bd6ce=_0x1bd6ce||0x1f4;return function(_0x1122f1){logger[_0x96db('0x23')](_0x1122f1['stack']);if(_0x1122f1[_0x96db('0x24')]){delete _0x1122f1[_0x96db('0x24')];}_0x5077ed[_0x96db('0x19')](_0x1bd6ce)[_0x96db('0x25')](_0x1122f1);};}exports[_0x96db('0x26')]=function(_0x3cee0f,_0x5f0d1b){var _0x41bf5b={},_0x10bb26={},_0x4cfb79={'count':0x0,'rows':[]};var _0x1ef14c=_[_0x96db('0x27')](db[_0x96db('0x28')]['rawAttributes'],function(_0x281329){return{'name':_0x281329['fieldName'],'type':_0x281329[_0x96db('0x29')][_0x96db('0x2a')]};});_0x10bb26[_0x96db('0x2b')]=_[_0x96db('0x27')](_0x1ef14c,'name');_0x10bb26[_0x96db('0x2c')]=_['keys'](_0x3cee0f[_0x96db('0x2c')]);_0x10bb26[_0x96db('0x2d')]=_[_0x96db('0x2e')](_0x10bb26[_0x96db('0x2b')],_0x10bb26['query']);_0x41bf5b[_0x96db('0x2f')]=_[_0x96db('0x2e')](_0x10bb26['model'],qs[_0x96db('0x30')](_0x3cee0f[_0x96db('0x2c')][_0x96db('0x30')]));_0x41bf5b[_0x96db('0x2f')]=_0x41bf5b[_0x96db('0x2f')][_0x96db('0x31')]?_0x41bf5b['attributes']:_0x10bb26['model'];if(!_0x3cee0f[_0x96db('0x2c')][_0x96db('0x32')](_0x96db('0x33'))){_0x41bf5b[_0x96db('0x1d')]=qs['limit'](_0x3cee0f[_0x96db('0x2c')][_0x96db('0x1d')]);_0x41bf5b[_0x96db('0x1b')]=qs[_0x96db('0x1b')](_0x3cee0f[_0x96db('0x2c')][_0x96db('0x1b')]);}_0x41bf5b[_0x96db('0x34')]=qs['sort'](_0x3cee0f[_0x96db('0x2c')][_0x96db('0x35')]);_0x41bf5b[_0x96db('0x36')]=qs[_0x96db('0x2d')](_[_0x96db('0x37')](_0x3cee0f[_0x96db('0x2c')],_0x10bb26[_0x96db('0x2d')]),_0x1ef14c);if(_0x3cee0f[_0x96db('0x2c')]['filter']){_0x41bf5b[_0x96db('0x36')]=_[_0x96db('0x38')](_0x41bf5b[_0x96db('0x36')],{'$or':_[_0x96db('0x27')](_0x1ef14c,function(_0xbf1a58){if(_0xbf1a58['type']!==_0x96db('0x39')){var _0x26a8df={};_0x26a8df[_0xbf1a58[_0x96db('0x24')]]={'$like':'%'+_0x3cee0f[_0x96db('0x2c')][_0x96db('0x3a')]+'%'};return _0x26a8df;}})});}_0x41bf5b=_['merge']({},_0x41bf5b,_0x3cee0f[_0x96db('0x3b')]);var _0x2faba4={'where':_0x41bf5b[_0x96db('0x36')]};return db[_0x96db('0x28')]['count'](_0x2faba4)[_0x96db('0x21')](function(_0x49097e){_0x4cfb79[_0x96db('0x1e')]=_0x49097e;if(_0x3cee0f[_0x96db('0x2c')][_0x96db('0x3c')]){_0x41bf5b[_0x96db('0x3d')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x96db('0x3e')](_0x41bf5b);})[_0x96db('0x21')](function(_0x445387){_0x4cfb79[_0x96db('0x3f')]=_0x445387;return _0x4cfb79;})['then'](respondWithFilteredResult(_0x5f0d1b,_0x41bf5b))['catch'](handleError(_0x5f0d1b,null));};exports[_0x96db('0x40')]=function(_0x23a638,_0x12e97e){var _0x3a6fc2={'raw':![],'where':{'id':_0x23a638[_0x96db('0x41')]['id']}},_0x3bb0e9={};_0x3bb0e9[_0x96db('0x2b')]=_[_0x96db('0x42')](db[_0x96db('0x28')][_0x96db('0x43')]);_0x3bb0e9[_0x96db('0x2c')]=_[_0x96db('0x42')](_0x23a638[_0x96db('0x2c')]);_0x3bb0e9['filters']=_[_0x96db('0x2e')](_0x3bb0e9[_0x96db('0x2b')],_0x3bb0e9['query']);_0x3a6fc2[_0x96db('0x2f')]=_[_0x96db('0x2e')](_0x3bb0e9['model'],qs['fields'](_0x23a638[_0x96db('0x2c')][_0x96db('0x30')]));_0x3a6fc2[_0x96db('0x2f')]=_0x3a6fc2['attributes'][_0x96db('0x31')]?_0x3a6fc2[_0x96db('0x2f')]:_0x3bb0e9[_0x96db('0x2b')];if(_0x23a638[_0x96db('0x2c')]['includeAll']){_0x3a6fc2[_0x96db('0x3d')]=[{'all':!![]}];}_0x3a6fc2=_[_0x96db('0x38')]({},_0x3a6fc2,_0x23a638[_0x96db('0x3b')]);return db[_0x96db('0x28')][_0x96db('0x44')](_0x3a6fc2)[_0x96db('0x21')](handleEntityNotFound(_0x12e97e,null))['then'](respondWithResult(_0x12e97e,null))[_0x96db('0x45')](handleError(_0x12e97e,null));};exports['create']=function(_0x403e3a,_0xc60c2f){return db['DeskConfiguration'][_0x96db('0x46')](_0x403e3a[_0x96db('0x47')],{})[_0x96db('0x21')](respondWithResult(_0xc60c2f,0xc9))[_0x96db('0x45')](handleError(_0xc60c2f,null));};exports[_0x96db('0x48')]=function(_0x1c705d,_0x13e31b){if(_0x1c705d[_0x96db('0x47')]['id']){delete _0x1c705d[_0x96db('0x47')]['id'];}return db[_0x96db('0x28')][_0x96db('0x44')]({'where':{'id':_0x1c705d['params']['id']}})[_0x96db('0x21')](handleEntityNotFound(_0x13e31b,null))[_0x96db('0x21')](saveUpdates(_0x1c705d[_0x96db('0x47')],null))[_0x96db('0x21')](respondWithResult(_0x13e31b,null))[_0x96db('0x45')](handleError(_0x13e31b,null));};exports[_0x96db('0x22')]=function(_0x3c0171,_0x24b5f3){return db[_0x96db('0x28')]['find']({'where':{'id':_0x3c0171[_0x96db('0x41')]['id']}})['then'](handleEntityNotFound(_0x24b5f3,null))[_0x96db('0x21')](removeEntity(_0x24b5f3,null))['catch'](handleError(_0x24b5f3,null));};exports['getFields']=function(_0x1fdc0d,_0x2e0572,_0x11ca24){var _0xe4112={};var _0x5940f7={};var _0x20af15;var _0x2d0895;return db[_0x96db('0x28')][_0x96db('0x49')]({'where':{'id':_0x1fdc0d[_0x96db('0x41')]['id']}})[_0x96db('0x21')](handleEntityNotFound(_0x2e0572,null))[_0x96db('0x21')](function(_0x3c6244){if(_0x3c6244){_0x20af15=_0x3c6244;_0x5940f7[_0x96db('0x2b')]=_['keys'](db[_0x96db('0x4a')][_0x96db('0x43')]);_0x5940f7[_0x96db('0x2c')]=_['keys'](_0x1fdc0d[_0x96db('0x2c')]);_0x5940f7['filters']=_['intersection'](_0x5940f7[_0x96db('0x2b')],_0x5940f7[_0x96db('0x2c')]);_0xe4112['attributes']=_[_0x96db('0x2e')](_0x5940f7['model'],qs['fields'](_0x1fdc0d[_0x96db('0x2c')][_0x96db('0x30')]));_0xe4112[_0x96db('0x2f')]=_0xe4112[_0x96db('0x2f')][_0x96db('0x31')]?_0xe4112[_0x96db('0x2f')]:_0x5940f7['model'];_0xe4112[_0x96db('0x34')]=qs[_0x96db('0x35')](_0x1fdc0d[_0x96db('0x2c')]['sort']);_0xe4112[_0x96db('0x36')]=qs[_0x96db('0x2d')](_['pick'](_0x1fdc0d[_0x96db('0x2c')],_0x5940f7['filters']));if(_0x1fdc0d[_0x96db('0x2c')][_0x96db('0x3a')]){_0xe4112[_0x96db('0x36')]=_[_0x96db('0x38')](_0xe4112[_0x96db('0x36')],{'$or':_['map'](_0xe4112[_0x96db('0x2f')],function(_0xa68878){var _0x5e391c={};_0x5e391c[_0xa68878]={'$like':'%'+_0x1fdc0d[_0x96db('0x2c')][_0x96db('0x3a')]+'%'};return _0x5e391c;})});}_0xe4112=_[_0x96db('0x38')]({},_0xe4112,_0x1fdc0d[_0x96db('0x3b')]);return _0x20af15[_0x96db('0x4b')](_0xe4112);}})[_0x96db('0x21')](function(_0x355544){if(_0x355544){_0x2d0895=_0x355544['length'];if(!_0x1fdc0d[_0x96db('0x2c')][_0x96db('0x32')](_0x96db('0x33'))){_0xe4112[_0x96db('0x1d')]=qs[_0x96db('0x1d')](_0x1fdc0d[_0x96db('0x2c')][_0x96db('0x1d')]);_0xe4112[_0x96db('0x1b')]=qs['offset'](_0x1fdc0d[_0x96db('0x2c')][_0x96db('0x1b')]);}return _0x20af15[_0x96db('0x4b')](_0xe4112);}})[_0x96db('0x21')](function(_0x471eec){if(_0x471eec){return _0x471eec?{'count':_0x2d0895,'rows':_0x471eec}:null;}})[_0x96db('0x21')](respondWithResult(_0x2e0572,null))['catch'](handleError(_0x2e0572,null));};exports[_0x96db('0x4c')]=function(_0x45210b,_0x52cabb,_0x1ae6a0){var _0x5deeec={};var _0x56e096={};var _0x2a3062;var _0x1070b8;return db[_0x96db('0x28')][_0x96db('0x49')]({'where':{'id':_0x45210b[_0x96db('0x41')]['id']}})[_0x96db('0x21')](handleEntityNotFound(_0x52cabb,null))[_0x96db('0x21')](function(_0x5a3a24){if(_0x5a3a24){_0x2a3062=_0x5a3a24;_0x56e096[_0x96db('0x2b')]=_['keys'](db['DeskField'][_0x96db('0x43')]);_0x56e096['query']=_[_0x96db('0x42')](_0x45210b[_0x96db('0x2c')]);_0x56e096['filters']=_[_0x96db('0x2e')](_0x56e096[_0x96db('0x2b')],_0x56e096[_0x96db('0x2c')]);_0x5deeec[_0x96db('0x2f')]=_[_0x96db('0x2e')](_0x56e096[_0x96db('0x2b')],qs[_0x96db('0x30')](_0x45210b['query']['fields']));_0x5deeec['attributes']=_0x5deeec[_0x96db('0x2f')][_0x96db('0x31')]?_0x5deeec[_0x96db('0x2f')]:_0x56e096['model'];_0x5deeec[_0x96db('0x34')]=qs[_0x96db('0x35')](_0x45210b['query']['sort']);_0x5deeec['where']=qs['filters'](_['pick'](_0x45210b[_0x96db('0x2c')],_0x56e096[_0x96db('0x2d')]));if(_0x45210b[_0x96db('0x2c')][_0x96db('0x3a')]){_0x5deeec['where']=_[_0x96db('0x38')](_0x5deeec['where'],{'$or':_[_0x96db('0x27')](_0x5deeec[_0x96db('0x2f')],function(_0x2063a2){var _0x11665c={};_0x11665c[_0x2063a2]={'$like':'%'+_0x45210b[_0x96db('0x2c')][_0x96db('0x3a')]+'%'};return _0x11665c;})});}_0x5deeec=_['merge']({},_0x5deeec,_0x45210b['options']);return _0x2a3062[_0x96db('0x4c')](_0x5deeec);}})[_0x96db('0x21')](function(_0x422561){if(_0x422561){_0x1070b8=_0x422561[_0x96db('0x31')];if(!_0x45210b['query'][_0x96db('0x32')]('nolimit')){_0x5deeec[_0x96db('0x1d')]=qs['limit'](_0x45210b[_0x96db('0x2c')][_0x96db('0x1d')]);_0x5deeec[_0x96db('0x1b')]=qs['offset'](_0x45210b[_0x96db('0x2c')]['offset']);}return _0x2a3062[_0x96db('0x4c')](_0x5deeec);}})[_0x96db('0x21')](function(_0x4f3e86){if(_0x4f3e86){return _0x4f3e86?{'count':_0x1070b8,'rows':_0x4f3e86}:null;}})[_0x96db('0x21')](respondWithResult(_0x52cabb,null))[_0x96db('0x45')](handleError(_0x52cabb,null));};exports[_0x96db('0x4d')]=function(_0x4f2818,_0x1208be,_0x435a3b){var _0x457312={};var _0x4e4f58={};var _0x1e0b9d;var _0x2928af;return db[_0x96db('0x28')][_0x96db('0x49')]({'where':{'id':_0x4f2818[_0x96db('0x41')]['id']}})[_0x96db('0x21')](handleEntityNotFound(_0x1208be,null))[_0x96db('0x21')](function(_0x40554d){if(_0x40554d){_0x1e0b9d=_0x40554d;_0x4e4f58[_0x96db('0x2b')]=_['keys'](db['DeskField'][_0x96db('0x43')]);_0x4e4f58[_0x96db('0x2c')]=_[_0x96db('0x42')](_0x4f2818['query']);_0x4e4f58[_0x96db('0x2d')]=_['intersection'](_0x4e4f58[_0x96db('0x2b')],_0x4e4f58[_0x96db('0x2c')]);_0x457312['attributes']=_['intersection'](_0x4e4f58[_0x96db('0x2b')],qs[_0x96db('0x30')](_0x4f2818[_0x96db('0x2c')][_0x96db('0x30')]));_0x457312[_0x96db('0x2f')]=_0x457312['attributes'][_0x96db('0x31')]?_0x457312[_0x96db('0x2f')]:_0x4e4f58[_0x96db('0x2b')];_0x457312[_0x96db('0x34')]=qs[_0x96db('0x35')](_0x4f2818[_0x96db('0x2c')][_0x96db('0x35')]);_0x457312[_0x96db('0x36')]=qs[_0x96db('0x2d')](_[_0x96db('0x37')](_0x4f2818[_0x96db('0x2c')],_0x4e4f58[_0x96db('0x2d')]));if(_0x4f2818['query'][_0x96db('0x3a')]){_0x457312[_0x96db('0x36')]=_[_0x96db('0x38')](_0x457312['where'],{'$or':_[_0x96db('0x27')](_0x457312[_0x96db('0x2f')],function(_0x41ac6d){var _0x2508e0={};_0x2508e0[_0x41ac6d]={'$like':'%'+_0x4f2818['query'][_0x96db('0x3a')]+'%'};return _0x2508e0;})});}_0x457312=_[_0x96db('0x38')]({},_0x457312,_0x4f2818[_0x96db('0x3b')]);return _0x1e0b9d[_0x96db('0x4d')](_0x457312);}})[_0x96db('0x21')](function(_0x4b330f){if(_0x4b330f){_0x2928af=_0x4b330f[_0x96db('0x31')];if(!_0x4f2818[_0x96db('0x2c')][_0x96db('0x32')](_0x96db('0x33'))){_0x457312[_0x96db('0x1d')]=qs[_0x96db('0x1d')](_0x4f2818[_0x96db('0x2c')][_0x96db('0x1d')]);_0x457312[_0x96db('0x1b')]=qs[_0x96db('0x1b')](_0x4f2818[_0x96db('0x2c')][_0x96db('0x1b')]);}return _0x1e0b9d[_0x96db('0x4d')](_0x457312);}})['then'](function(_0x21b148){if(_0x21b148){return _0x21b148?{'count':_0x2928af,'rows':_0x21b148}:null;}})['then'](respondWithResult(_0x1208be,null))['catch'](handleError(_0x1208be,null));};exports[_0x96db('0x4e')]=function(_0x1c46bd,_0x3fe3de,_0x2ccbd5){var _0x2e0365={};var _0x2b7e20={};var _0x3039d9;var _0x3f1ad1;return db[_0x96db('0x28')][_0x96db('0x49')]({'where':{'id':_0x1c46bd[_0x96db('0x41')]['id']}})[_0x96db('0x21')](handleEntityNotFound(_0x3fe3de,null))['then'](function(_0x1c21ce){if(_0x1c21ce){_0x3039d9=_0x1c21ce;_0x2b7e20[_0x96db('0x2b')]=_[_0x96db('0x42')](db[_0x96db('0x4f')][_0x96db('0x43')]);_0x2b7e20[_0x96db('0x2c')]=_[_0x96db('0x42')](_0x1c46bd[_0x96db('0x2c')]);_0x2b7e20['filters']=_['intersection'](_0x2b7e20['model'],_0x2b7e20['query']);_0x2e0365[_0x96db('0x2f')]=_[_0x96db('0x2e')](_0x2b7e20[_0x96db('0x2b')],qs[_0x96db('0x30')](_0x1c46bd['query'][_0x96db('0x30')]));_0x2e0365['attributes']=_0x2e0365['attributes'][_0x96db('0x31')]?_0x2e0365[_0x96db('0x2f')]:_0x2b7e20[_0x96db('0x2b')];_0x2e0365[_0x96db('0x34')]=qs[_0x96db('0x35')](_0x1c46bd[_0x96db('0x2c')][_0x96db('0x35')]);_0x2e0365[_0x96db('0x36')]=qs[_0x96db('0x2d')](_[_0x96db('0x37')](_0x1c46bd['query'],_0x2b7e20[_0x96db('0x2d')]));if(_0x1c46bd['query'][_0x96db('0x3a')]){_0x2e0365[_0x96db('0x36')]=_[_0x96db('0x38')](_0x2e0365[_0x96db('0x36')],{'$or':_[_0x96db('0x27')](_0x2e0365[_0x96db('0x2f')],function(_0x329e87){var _0x4b8aeb={};_0x4b8aeb[_0x329e87]={'$like':'%'+_0x1c46bd['query']['filter']+'%'};return _0x4b8aeb;})});}_0x2e0365=_[_0x96db('0x38')]({},_0x2e0365,_0x1c46bd[_0x96db('0x3b')]);return _0x3039d9[_0x96db('0x4e')](_0x2e0365);}})[_0x96db('0x21')](function(_0xf45435){if(_0xf45435){_0x3f1ad1=_0xf45435[_0x96db('0x31')];if(!_0x1c46bd[_0x96db('0x2c')]['hasOwnProperty']('nolimit')){_0x2e0365[_0x96db('0x1d')]=qs[_0x96db('0x1d')](_0x1c46bd[_0x96db('0x2c')]['limit']);_0x2e0365['offset']=qs[_0x96db('0x1b')](_0x1c46bd[_0x96db('0x2c')][_0x96db('0x1b')]);}return _0x3039d9[_0x96db('0x4e')](_0x2e0365);}})[_0x96db('0x21')](function(_0x2b3dab){if(_0x2b3dab){return _0x2b3dab?{'count':_0x3f1ad1,'rows':_0x2b3dab}:null;}})[_0x96db('0x21')](respondWithResult(_0x3fe3de,null))[_0x96db('0x45')](handleError(_0x3fe3de,null));};exports[_0x96db('0x50')]=function(_0x4029d9,_0x2106c0,_0x3bbf5d){if(_0x4029d9[_0x96db('0x47')]['id']){delete _0x4029d9[_0x96db('0x47')]['id'];}return db[_0x96db('0x28')][_0x96db('0x49')]({'where':{'id':_0x4029d9[_0x96db('0x41')]['id']}})['then'](handleEntityNotFound(_0x2106c0,null))[_0x96db('0x21')](function(_0x1621ab){if(_0x1621ab){return _0x1621ab[_0x96db('0x50')](_0x4029d9[_0x96db('0x47')][_0x96db('0x51')]||[]);}return null;})[_0x96db('0x21')](respondWithResult(_0x2106c0,null))['catch'](handleError(_0x2106c0,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 0a99d73..b9510c8 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 _0x55f4=['define','DeskConfiguration','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes'];(function(_0x8a22fd,_0x3f6c4e){var _0x3e12fe=function(_0x23f52e){while(--_0x23f52e){_0x8a22fd['push'](_0x8a22fd['shift']());}};_0x3e12fe(++_0x3f6c4e);}(_0x55f4,0x1f1));var _0x455f=function(_0x34445a,_0x619d62){_0x34445a=_0x34445a-0x0;var _0x4d5a4d=_0x55f4[_0x34445a];return _0x4d5a4d;};'use strict';var _=require(_0x455f('0x0'));var util=require('util');var logger=require(_0x455f('0x1'))(_0x455f('0x2'));var moment=require(_0x455f('0x3'));var BPromise=require('bluebird');var rp=require(_0x455f('0x4'));var fs=require('fs');var path=require(_0x455f('0x5'));var rimraf=require(_0x455f('0x6'));var config=require(_0x455f('0x7'));var attributes=require(_0x455f('0x8'));module['exports']=function(_0x2d785b,_0x1aa8ef){return _0x2d785b[_0x455f('0x9')](_0x455f('0xa'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1069=['bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','DeskConfiguration','int_desk_configurations','util','../../config/logger','api','moment'];(function(_0x353b78,_0x517995){var _0x453fa7=function(_0x5eba6d){while(--_0x5eba6d){_0x353b78['push'](_0x353b78['shift']());}};_0x453fa7(++_0x517995);}(_0x1069,0x1ea));var _0x9106=function(_0x12392a,_0x4388e0){_0x12392a=_0x12392a-0x0;var _0x237822=_0x1069[_0x12392a];return _0x237822;};'use strict';var _=require('lodash');var util=require(_0x9106('0x0'));var logger=require(_0x9106('0x1'))(_0x9106('0x2'));var moment=require(_0x9106('0x3'));var BPromise=require(_0x9106('0x4'));var rp=require(_0x9106('0x5'));var fs=require('fs');var path=require(_0x9106('0x6'));var rimraf=require(_0x9106('0x7'));var config=require(_0x9106('0x8'));var attributes=require(_0x9106('0x9'));module[_0x9106('0xa')]=function(_0x41f221,_0xfb9cf1){return _0x41f221['define'](_0x9106('0xb'),attributes,{'tableName':_0x9106('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 0304f5c..4fe1c65 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 _0xa099=['request','then','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x40e9b4,_0x6d9ae9){var _0x47d783=function(_0x1f4be4){while(--_0x1f4be4){_0x40e9b4['push'](_0x40e9b4['shift']());}};_0x47d783(++_0x6d9ae9);}(_0xa099,0x69));var _0x9a09=function(_0x15683c,_0x163a36){_0x15683c=_0x15683c-0x0;var _0x3f5dc7=_0xa099[_0x15683c];return _0x3f5dc7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x9a09('0x0'));var rs=require(_0x9a09('0x1'));var fs=require('fs');var Redis=require(_0x9a09('0x2'));var db=require(_0x9a09('0x3'))['db'];var utils=require(_0x9a09('0x4'));var logger=require(_0x9a09('0x5'))(_0x9a09('0x6'));var config=require('../../config/environment');var jayson=require(_0x9a09('0x7'));var client=jayson[_0x9a09('0x8')][_0x9a09('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39533e,_0x1241f5,_0x2f4fec){return new BPromise(function(_0x1e8701,_0x1da246){return client[_0x9a09('0xa')](_0x39533e,_0x2f4fec)[_0x9a09('0xb')](function(_0x5af2ba){logger[_0x9a09('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x1241f5,_0x9a09('0xd'));logger[_0x9a09('0xe')](_0x9a09('0xf'),_0x1241f5,_0x9a09('0xd'),JSON[_0x9a09('0x10')](_0x5af2ba));if(_0x5af2ba[_0x9a09('0x11')]){if(_0x5af2ba['error'][_0x9a09('0x12')]===0x1f4){logger[_0x9a09('0x11')](_0x9a09('0x13'),_0x1241f5,_0x5af2ba[_0x9a09('0x11')][_0x9a09('0x14')]);return _0x1da246(_0x5af2ba[_0x9a09('0x11')][_0x9a09('0x14')]);}logger[_0x9a09('0x11')](_0x9a09('0x13'),_0x1241f5,_0x5af2ba[_0x9a09('0x11')][_0x9a09('0x14')]);return _0x1e8701(_0x5af2ba[_0x9a09('0x11')][_0x9a09('0x14')]);}else{logger[_0x9a09('0xc')](_0x9a09('0x13'),_0x1241f5,'request\x20sent');_0x1e8701(_0x5af2ba[_0x9a09('0x15')]['message']);}})[_0x9a09('0x16')](function(_0x4ebdfa){logger[_0x9a09('0x11')](_0x9a09('0x13'),_0x1241f5,_0x4ebdfa);_0x1da246(_0x4ebdfa);});});} \ No newline at end of file +var _0x5d4e=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird'];(function(_0x25e8ab,_0x184b56){var _0x3d8f74=function(_0x35c67c){while(--_0x35c67c){_0x25e8ab['push'](_0x25e8ab['shift']());}};_0x3d8f74(++_0x184b56);}(_0x5d4e,0x138));var _0xe5d4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5d4e[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xe5d4('0x0'));var moment=require(_0xe5d4('0x1'));var BPromise=require(_0xe5d4('0x2'));var rs=require(_0xe5d4('0x3'));var fs=require('fs');var Redis=require(_0xe5d4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe5d4('0x5'));var logger=require(_0xe5d4('0x6'))(_0xe5d4('0x7'));var config=require('../../config/environment');var jayson=require(_0xe5d4('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5ecca3,_0x304a0b,_0x262b90){return new BPromise(function(_0x2d416d,_0x1b332f){return client[_0xe5d4('0x9')](_0x5ecca3,_0x262b90)[_0xe5d4('0xa')](function(_0xf7fa11){logger[_0xe5d4('0xb')](_0xe5d4('0xc'),_0x304a0b,_0xe5d4('0xd'));logger[_0xe5d4('0xe')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x304a0b,'request\x20sent',JSON[_0xe5d4('0xf')](_0xf7fa11));if(_0xf7fa11[_0xe5d4('0x10')]){if(_0xf7fa11[_0xe5d4('0x10')][_0xe5d4('0x11')]===0x1f4){logger[_0xe5d4('0x10')](_0xe5d4('0xc'),_0x304a0b,_0xf7fa11[_0xe5d4('0x10')][_0xe5d4('0x12')]);return _0x1b332f(_0xf7fa11[_0xe5d4('0x10')]['message']);}logger['error'](_0xe5d4('0xc'),_0x304a0b,_0xf7fa11[_0xe5d4('0x10')]['message']);return _0x2d416d(_0xf7fa11[_0xe5d4('0x10')][_0xe5d4('0x12')]);}else{logger[_0xe5d4('0xb')](_0xe5d4('0xc'),_0x304a0b,_0xe5d4('0xd'));_0x2d416d(_0xf7fa11[_0xe5d4('0x13')][_0xe5d4('0x12')]);}})[_0xe5d4('0x14')](function(_0x274b83){logger[_0xe5d4('0x10')](_0xe5d4('0xc'),_0x304a0b,_0x274b83);_0x1b332f(_0x274b83);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 07928c4..e8611da 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 _0xe0f9=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskField.controller','isAuthenticated','index','get','/:id','show','create','put'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xe0f9,0x16c));var _0x9e0f=function(_0x13735f,_0x80419f){_0x13735f=_0x13735f-0x0;var _0x26a881=_0xe0f9[_0x13735f];return _0x26a881;};'use strict';var multer=require(_0x9e0f('0x0'));var util=require(_0x9e0f('0x1'));var path=require(_0x9e0f('0x2'));var timeout=require(_0x9e0f('0x3'));var express=require(_0x9e0f('0x4'));var router=express[_0x9e0f('0x5')]();var fs_extra=require(_0x9e0f('0x6'));var auth=require(_0x9e0f('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9e0f('0x8'));router['get']('/',auth[_0x9e0f('0x9')](),controller[_0x9e0f('0xa')]);router[_0x9e0f('0xb')](_0x9e0f('0xc'),auth[_0x9e0f('0x9')](),controller[_0x9e0f('0xd')]);router['post']('/',auth[_0x9e0f('0x9')](),controller[_0x9e0f('0xe')]);router[_0x9e0f('0xf')](_0x9e0f('0xc'),auth[_0x9e0f('0x9')](),controller[_0x9e0f('0x10')]);router['delete'](_0x9e0f('0xc'),auth[_0x9e0f('0x9')](),controller[_0x9e0f('0x11')]);module[_0x9e0f('0x12')]=router; \ No newline at end of file +var _0x6af5=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','post','create','put','update','destroy','exports','util','path','Router'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x6af5,0x7b));var _0x56af=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0x6af5[_0x45f951];return _0x24756c;};'use strict';var multer=require('multer');var util=require(_0x56af('0x0'));var path=require(_0x56af('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x56af('0x2')]();var fs_extra=require(_0x56af('0x3'));var auth=require(_0x56af('0x4'));var interaction=require(_0x56af('0x5'));var config=require(_0x56af('0x6'));var controller=require(_0x56af('0x7'));router[_0x56af('0x8')]('/',auth[_0x56af('0x9')](),controller[_0x56af('0xa')]);router[_0x56af('0x8')](_0x56af('0xb'),auth[_0x56af('0x9')](),controller['show']);router[_0x56af('0xc')]('/',auth[_0x56af('0x9')](),controller[_0x56af('0xd')]);router[_0x56af('0xe')](_0x56af('0xb'),auth['isAuthenticated'](),controller[_0x56af('0xf')]);router['delete'](_0x56af('0xb'),auth[_0x56af('0x9')](),controller[_0x56af('0x10')]);module[_0x56af('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 6e97b94..aa2b6e1 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 _0x739e=['sequelize','ENUM','customVariable','keyValue','string','STRING','BOOLEAN'];(function(_0x2cc0b6,_0x94b7ae){var _0x43b437=function(_0x177710){while(--_0x177710){_0x2cc0b6['push'](_0x2cc0b6['shift']());}};_0x43b437(++_0x94b7ae);}(_0x739e,0x1b2));var _0xe739=function(_0x5bf374,_0x222be0){_0x5bf374=_0x5bf374-0x0;var _0x443258=_0x739e[_0x5bf374];return _0x443258;};'use strict';var Sequelize=require(_0xe739('0x0'));module['exports']={'type':{'type':Sequelize[_0xe739('0x1')]('string','variable',_0xe739('0x2'),_0xe739('0x3'),'picklist'),'defaultValue':_0xe739('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe739('0x5')]},'keyType':{'type':Sequelize['ENUM']('string','variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe739('0x5')]},'nameField':{'type':Sequelize[_0xe739('0x5')]},'customField':{'type':Sequelize[_0xe739('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe739('0x5')]}}; \ No newline at end of file +var _0x3ee8=['sequelize','exports','ENUM','string','customVariable','STRING','variable','BOOLEAN'];(function(_0x5aef75,_0x39228e){var _0x1bb942=function(_0x33884c){while(--_0x33884c){_0x5aef75['push'](_0x5aef75['shift']());}};_0x1bb942(++_0x39228e);}(_0x3ee8,0x150));var _0x83ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ee8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x83ee('0x0'));module[_0x83ee('0x1')]={'type':{'type':Sequelize[_0x83ee('0x2')](_0x83ee('0x3'),'variable',_0x83ee('0x4'),'keyValue','picklist'),'defaultValue':_0x83ee('0x3')},'content':{'type':Sequelize[_0x83ee('0x5')]},'key':{'type':Sequelize[_0x83ee('0x5')]},'keyType':{'type':Sequelize[_0x83ee('0x2')]('string',_0x83ee('0x6'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x83ee('0x5')]},'nameField':{'type':Sequelize[_0x83ee('0x5')]},'customField':{'type':Sequelize[_0x83ee('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x83ee('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index fd65dfe..cedf0d2 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 _0x33ac=['../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','DeskField','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x21551e,_0x43a045){var _0x4f3cda=function(_0x58b22c){while(--_0x58b22c){_0x21551e['push'](_0x21551e['shift']());}};_0x4f3cda(++_0x43a045);}(_0x33ac,0x1f2));var _0xc33a=function(_0x81f4e2,_0x4ed62f){_0x81f4e2=_0x81f4e2-0x0;var _0x12eb11=_0x33ac[_0x81f4e2];return _0x12eb11;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc33a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc33a('0x1'));var moment=require(_0xc33a('0x2'));var BPromise=require(_0xc33a('0x3'));var Mustache=require(_0xc33a('0x4'));var util=require(_0xc33a('0x5'));var path=require(_0xc33a('0x6'));var sox=require(_0xc33a('0x7'));var csv=require(_0xc33a('0x8'));var ejs=require(_0xc33a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc33a('0xa'));var crypto=require(_0xc33a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc33a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc33a('0xd'));var Papa=require(_0xc33a('0xe'));var Redis=require(_0xc33a('0xf'));var authService=require(_0xc33a('0x10'));var qs=require(_0xc33a('0x11'));var as=require(_0xc33a('0x12'));var hardwareService=require(_0xc33a('0x13'));var logger=require(_0xc33a('0x14'))(_0xc33a('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc33a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51421e,_0x24bc72){_0x24bc72=_0x24bc72||0xcc;return function(_0x287e3b){if(_0x287e3b){return _0x51421e[_0xc33a('0x17')](_0x24bc72);}return _0x51421e[_0xc33a('0x18')](_0x24bc72)[_0xc33a('0x19')]();};}function respondWithResult(_0x154791,_0x57383c){_0x57383c=_0x57383c||0xc8;return function(_0x2737cd){if(_0x2737cd){return _0x154791[_0xc33a('0x18')](_0x57383c)[_0xc33a('0x1a')](_0x2737cd);}};}function respondWithFilteredResult(_0x4c70ae,_0x1a77f7){return function(_0x53f800){if(_0x53f800){var _0x6d5b1=typeof _0x1a77f7[_0xc33a('0x1b')]===_0xc33a('0x1c')&&typeof _0x1a77f7[_0xc33a('0x1d')]===_0xc33a('0x1c');var _0x4fa7d0=_0x53f800['count'];var _0x40d736=_0x6d5b1?0x0:_0x1a77f7[_0xc33a('0x1b')];var _0x148b95=_0x6d5b1?_0x53f800[_0xc33a('0x1e')]:_0x1a77f7[_0xc33a('0x1b')]+_0x1a77f7[_0xc33a('0x1d')];var _0x3ee9cf;if(_0x148b95>=_0x4fa7d0){_0x148b95=_0x4fa7d0;_0x3ee9cf=0xc8;}else{_0x3ee9cf=0xce;}_0x4c70ae[_0xc33a('0x18')](_0x3ee9cf);return _0x4c70ae['set'](_0xc33a('0x1f'),_0x40d736+'-'+_0x148b95+'/'+_0x4fa7d0)[_0xc33a('0x1a')](_0x53f800);}return null;};}function patchUpdates(_0x4142f1){return function(_0x3896da){try{jsonpatch['apply'](_0x3896da,_0x4142f1,!![]);}catch(_0x17d70e){return BPromise[_0xc33a('0x20')](_0x17d70e);}return _0x3896da['save']();};}function saveUpdates(_0x35fd35,_0x2fc9f9){return function(_0x3b7aba){if(_0x3b7aba){return _0x3b7aba[_0xc33a('0x21')](_0x35fd35)[_0xc33a('0x22')](function(_0xd16dc5){return _0xd16dc5;});}return null;};}function removeEntity(_0x30534c,_0x3981cb){return function(_0x1481a0){if(_0x1481a0){return _0x1481a0[_0xc33a('0x23')]()[_0xc33a('0x22')](function(){_0x30534c[_0xc33a('0x18')](0xcc)[_0xc33a('0x19')]();});}};}function handleEntityNotFound(_0x37b32d,_0x29d3d3){return function(_0x3d3c3b){if(!_0x3d3c3b){_0x37b32d[_0xc33a('0x17')](0x194);}return _0x3d3c3b;};}function handleError(_0x708428,_0x375a32){_0x375a32=_0x375a32||0x1f4;return function(_0x4c42d1){logger[_0xc33a('0x24')](_0x4c42d1[_0xc33a('0x25')]);if(_0x4c42d1[_0xc33a('0x26')]){delete _0x4c42d1['name'];}_0x708428[_0xc33a('0x18')](_0x375a32)[_0xc33a('0x27')](_0x4c42d1);};}exports[_0xc33a('0x28')]=function(_0x2a1cc8,_0x2cdd42){var _0x4c676={},_0x4ccc71={},_0x2b489f={'count':0x0,'rows':[]};var _0x1b0338=_[_0xc33a('0x29')](db['DeskField']['rawAttributes'],function(_0x301762){return{'name':_0x301762[_0xc33a('0x2a')],'type':_0x301762[_0xc33a('0x2b')][_0xc33a('0x2c')]};});_0x4ccc71[_0xc33a('0x2d')]=_[_0xc33a('0x29')](_0x1b0338,_0xc33a('0x26'));_0x4ccc71[_0xc33a('0x2e')]=_[_0xc33a('0x2f')](_0x2a1cc8['query']);_0x4ccc71['filters']=_['intersection'](_0x4ccc71[_0xc33a('0x2d')],_0x4ccc71[_0xc33a('0x2e')]);_0x4c676[_0xc33a('0x30')]=_[_0xc33a('0x31')](_0x4ccc71[_0xc33a('0x2d')],qs[_0xc33a('0x32')](_0x2a1cc8['query'][_0xc33a('0x32')]));_0x4c676[_0xc33a('0x30')]=_0x4c676[_0xc33a('0x30')][_0xc33a('0x33')]?_0x4c676[_0xc33a('0x30')]:_0x4ccc71[_0xc33a('0x2d')];if(!_0x2a1cc8[_0xc33a('0x2e')][_0xc33a('0x34')](_0xc33a('0x35'))){_0x4c676[_0xc33a('0x1d')]=qs[_0xc33a('0x1d')](_0x2a1cc8[_0xc33a('0x2e')]['limit']);_0x4c676[_0xc33a('0x1b')]=qs['offset'](_0x2a1cc8['query'][_0xc33a('0x1b')]);}_0x4c676['order']=qs[_0xc33a('0x36')](_0x2a1cc8[_0xc33a('0x2e')][_0xc33a('0x36')]);_0x4c676[_0xc33a('0x37')]=qs[_0xc33a('0x38')](_[_0xc33a('0x39')](_0x2a1cc8['query'],_0x4ccc71[_0xc33a('0x38')]),_0x1b0338);if(_0x2a1cc8['query'][_0xc33a('0x3a')]){_0x4c676[_0xc33a('0x37')]=_[_0xc33a('0x3b')](_0x4c676[_0xc33a('0x37')],{'$or':_[_0xc33a('0x29')](_0x1b0338,function(_0x420638){if(_0x420638[_0xc33a('0x2b')]!==_0xc33a('0x3c')){var _0x4033a3={};_0x4033a3[_0x420638[_0xc33a('0x26')]]={'$like':'%'+_0x2a1cc8['query'][_0xc33a('0x3a')]+'%'};return _0x4033a3;}})});}_0x4c676=_[_0xc33a('0x3b')]({},_0x4c676,_0x2a1cc8[_0xc33a('0x3d')]);var _0x51a455={'where':_0x4c676[_0xc33a('0x37')]};return db[_0xc33a('0x3e')][_0xc33a('0x1e')](_0x51a455)[_0xc33a('0x22')](function(_0x56ff5f){_0x2b489f[_0xc33a('0x1e')]=_0x56ff5f;if(_0x2a1cc8['query']['includeAll']){_0x4c676[_0xc33a('0x3f')]=[{'all':!![]}];}return db[_0xc33a('0x3e')][_0xc33a('0x40')](_0x4c676);})['then'](function(_0x223b41){_0x2b489f[_0xc33a('0x41')]=_0x223b41;return _0x2b489f;})[_0xc33a('0x22')](respondWithFilteredResult(_0x2cdd42,_0x4c676))[_0xc33a('0x42')](handleError(_0x2cdd42,null));};exports[_0xc33a('0x43')]=function(_0x3eb3a8,_0x5a4de2){var _0x4a00f0={'raw':!![],'where':{'id':_0x3eb3a8[_0xc33a('0x44')]['id']}},_0x2bdac1={};_0x2bdac1[_0xc33a('0x2d')]=_[_0xc33a('0x2f')](db[_0xc33a('0x3e')][_0xc33a('0x45')]);_0x2bdac1[_0xc33a('0x2e')]=_[_0xc33a('0x2f')](_0x3eb3a8[_0xc33a('0x2e')]);_0x2bdac1['filters']=_[_0xc33a('0x31')](_0x2bdac1['model'],_0x2bdac1[_0xc33a('0x2e')]);_0x4a00f0[_0xc33a('0x30')]=_[_0xc33a('0x31')](_0x2bdac1[_0xc33a('0x2d')],qs[_0xc33a('0x32')](_0x3eb3a8[_0xc33a('0x2e')]['fields']));_0x4a00f0[_0xc33a('0x30')]=_0x4a00f0[_0xc33a('0x30')][_0xc33a('0x33')]?_0x4a00f0[_0xc33a('0x30')]:_0x2bdac1[_0xc33a('0x2d')];if(_0x3eb3a8[_0xc33a('0x2e')][_0xc33a('0x46')]){_0x4a00f0[_0xc33a('0x3f')]=[{'all':!![]}];}_0x4a00f0=_[_0xc33a('0x3b')]({},_0x4a00f0,_0x3eb3a8[_0xc33a('0x3d')]);return db['DeskField'][_0xc33a('0x47')](_0x4a00f0)[_0xc33a('0x22')](handleEntityNotFound(_0x5a4de2,null))[_0xc33a('0x22')](respondWithResult(_0x5a4de2,null))[_0xc33a('0x42')](handleError(_0x5a4de2,null));};exports[_0xc33a('0x48')]=function(_0x1da1f9,_0xea6fbd){return db[_0xc33a('0x3e')][_0xc33a('0x48')](_0x1da1f9['body'],{})[_0xc33a('0x22')](respondWithResult(_0xea6fbd,0xc9))[_0xc33a('0x42')](handleError(_0xea6fbd,null));};exports['update']=function(_0x1f86a0,_0x6b2859){if(_0x1f86a0[_0xc33a('0x49')]['id']){delete _0x1f86a0[_0xc33a('0x49')]['id'];}return db[_0xc33a('0x3e')][_0xc33a('0x47')]({'where':{'id':_0x1f86a0[_0xc33a('0x44')]['id']}})[_0xc33a('0x22')](handleEntityNotFound(_0x6b2859,null))[_0xc33a('0x22')](saveUpdates(_0x1f86a0[_0xc33a('0x49')],null))[_0xc33a('0x22')](respondWithResult(_0x6b2859,null))['catch'](handleError(_0x6b2859,null));};exports[_0xc33a('0x23')]=function(_0x2deacf,_0x400f52){return db[_0xc33a('0x3e')][_0xc33a('0x47')]({'where':{'id':_0x2deacf['params']['id']}})['then'](handleEntityNotFound(_0x400f52,null))[_0xc33a('0x22')](removeEntity(_0x400f52,null))[_0xc33a('0x42')](handleError(_0x400f52,null));}; \ No newline at end of file +var _0xd0c9=['DeskField','findAll','rows','catch','show','params','includeAll','include','options','find','create','body','destroy','eml-format','rimraf','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','end','error','name','send','rawAttributes','fieldName','type','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter'];(function(_0x54466d,_0x597e7e){var _0x8d8c37=function(_0xd445d3){while(--_0xd445d3){_0x54466d['push'](_0x54466d['shift']());}};_0x8d8c37(++_0x597e7e);}(_0xd0c9,0xe2));var _0x9d0c=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xd0c9[_0x4a53d];return _0x27410e;};'use strict';var emlformat=require(_0x9d0c('0x0'));var rimraf=require(_0x9d0c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9d0c('0x2'));var BPromise=require(_0x9d0c('0x3'));var Mustache=require(_0x9d0c('0x4'));var util=require('util');var path=require(_0x9d0c('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9d0c('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d0c('0x7'));var squel=require(_0x9d0c('0x8'));var crypto=require(_0x9d0c('0x9'));var jsforce=require(_0x9d0c('0xa'));var deskjs=require(_0x9d0c('0xb'));var toCsv=require(_0x9d0c('0xc'));var querystring=require('querystring');var Papa=require(_0x9d0c('0xd'));var Redis=require('ioredis');var authService=require(_0x9d0c('0xe'));var qs=require(_0x9d0c('0xf'));var as=require(_0x9d0c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d0c('0x11'))(_0x9d0c('0x12'));var utils=require(_0x9d0c('0x13'));var config=require(_0x9d0c('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9d0c('0x15'))['db'];function respondWithStatusCode(_0x575341,_0x191b79){_0x191b79=_0x191b79||0xcc;return function(_0x17e43b){if(_0x17e43b){return _0x575341[_0x9d0c('0x16')](_0x191b79);}return _0x575341[_0x9d0c('0x17')](_0x191b79)['end']();};}function respondWithResult(_0x5b1b42,_0x52ff64){_0x52ff64=_0x52ff64||0xc8;return function(_0x2b7885){if(_0x2b7885){return _0x5b1b42['status'](_0x52ff64)[_0x9d0c('0x18')](_0x2b7885);}};}function respondWithFilteredResult(_0x261be7,_0x2b20ca){return function(_0x275bb0){if(_0x275bb0){var _0x40e4e7=typeof _0x2b20ca[_0x9d0c('0x19')]===_0x9d0c('0x1a')&&typeof _0x2b20ca[_0x9d0c('0x1b')]==='undefined';var _0x4514fd=_0x275bb0[_0x9d0c('0x1c')];var _0x599ddb=_0x40e4e7?0x0:_0x2b20ca[_0x9d0c('0x19')];var _0x182dfb=_0x40e4e7?_0x275bb0[_0x9d0c('0x1c')]:_0x2b20ca['offset']+_0x2b20ca['limit'];var _0x11832a;if(_0x182dfb>=_0x4514fd){_0x182dfb=_0x4514fd;_0x11832a=0xc8;}else{_0x11832a=0xce;}_0x261be7[_0x9d0c('0x17')](_0x11832a);return _0x261be7['set'](_0x9d0c('0x1d'),_0x599ddb+'-'+_0x182dfb+'/'+_0x4514fd)[_0x9d0c('0x18')](_0x275bb0);}return null;};}function patchUpdates(_0xf60863){return function(_0x174ce3){try{jsonpatch[_0x9d0c('0x1e')](_0x174ce3,_0xf60863,!![]);}catch(_0x5b53d9){return BPromise[_0x9d0c('0x1f')](_0x5b53d9);}return _0x174ce3['save']();};}function saveUpdates(_0x1ff3f0,_0x17390f){return function(_0x52049b){if(_0x52049b){return _0x52049b[_0x9d0c('0x20')](_0x1ff3f0)[_0x9d0c('0x21')](function(_0x41d0a8){return _0x41d0a8;});}return null;};}function removeEntity(_0x4ab375,_0x2a1a70){return function(_0x280b22){if(_0x280b22){return _0x280b22['destroy']()[_0x9d0c('0x21')](function(){_0x4ab375[_0x9d0c('0x17')](0xcc)[_0x9d0c('0x22')]();});}};}function handleEntityNotFound(_0x35b60f,_0x472f95){return function(_0xb176f9){if(!_0xb176f9){_0x35b60f[_0x9d0c('0x16')](0x194);}return _0xb176f9;};}function handleError(_0x48b65b,_0x46b647){_0x46b647=_0x46b647||0x1f4;return function(_0x1f35a5){logger[_0x9d0c('0x23')](_0x1f35a5['stack']);if(_0x1f35a5[_0x9d0c('0x24')]){delete _0x1f35a5[_0x9d0c('0x24')];}_0x48b65b[_0x9d0c('0x17')](_0x46b647)[_0x9d0c('0x25')](_0x1f35a5);};}exports['index']=function(_0x12d75f,_0x46955f){var _0x1846f0={},_0x2cbbbc={},_0x4ed782={'count':0x0,'rows':[]};var _0x5bf51b=_['map'](db['DeskField'][_0x9d0c('0x26')],function(_0x263482){return{'name':_0x263482[_0x9d0c('0x27')],'type':_0x263482[_0x9d0c('0x28')]['key']};});_0x2cbbbc['model']=_[_0x9d0c('0x29')](_0x5bf51b,_0x9d0c('0x24'));_0x2cbbbc[_0x9d0c('0x2a')]=_[_0x9d0c('0x2b')](_0x12d75f[_0x9d0c('0x2a')]);_0x2cbbbc[_0x9d0c('0x2c')]=_['intersection'](_0x2cbbbc[_0x9d0c('0x2d')],_0x2cbbbc[_0x9d0c('0x2a')]);_0x1846f0[_0x9d0c('0x2e')]=_[_0x9d0c('0x2f')](_0x2cbbbc[_0x9d0c('0x2d')],qs[_0x9d0c('0x30')](_0x12d75f['query']['fields']));_0x1846f0['attributes']=_0x1846f0[_0x9d0c('0x2e')][_0x9d0c('0x31')]?_0x1846f0['attributes']:_0x2cbbbc[_0x9d0c('0x2d')];if(!_0x12d75f['query'][_0x9d0c('0x32')]('nolimit')){_0x1846f0['limit']=qs[_0x9d0c('0x1b')](_0x12d75f['query'][_0x9d0c('0x1b')]);_0x1846f0[_0x9d0c('0x19')]=qs['offset'](_0x12d75f[_0x9d0c('0x2a')][_0x9d0c('0x19')]);}_0x1846f0[_0x9d0c('0x33')]=qs['sort'](_0x12d75f[_0x9d0c('0x2a')][_0x9d0c('0x34')]);_0x1846f0[_0x9d0c('0x35')]=qs[_0x9d0c('0x2c')](_[_0x9d0c('0x36')](_0x12d75f[_0x9d0c('0x2a')],_0x2cbbbc[_0x9d0c('0x2c')]),_0x5bf51b);if(_0x12d75f[_0x9d0c('0x2a')]['filter']){_0x1846f0[_0x9d0c('0x35')]=_[_0x9d0c('0x37')](_0x1846f0['where'],{'$or':_[_0x9d0c('0x29')](_0x5bf51b,function(_0x346462){if(_0x346462[_0x9d0c('0x28')]!==_0x9d0c('0x38')){var _0x4935f2={};_0x4935f2[_0x346462[_0x9d0c('0x24')]]={'$like':'%'+_0x12d75f[_0x9d0c('0x2a')][_0x9d0c('0x39')]+'%'};return _0x4935f2;}})});}_0x1846f0=_[_0x9d0c('0x37')]({},_0x1846f0,_0x12d75f['options']);var _0x528517={'where':_0x1846f0[_0x9d0c('0x35')]};return db[_0x9d0c('0x3a')][_0x9d0c('0x1c')](_0x528517)['then'](function(_0x17a5bc){_0x4ed782[_0x9d0c('0x1c')]=_0x17a5bc;if(_0x12d75f[_0x9d0c('0x2a')]['includeAll']){_0x1846f0['include']=[{'all':!![]}];}return db[_0x9d0c('0x3a')][_0x9d0c('0x3b')](_0x1846f0);})[_0x9d0c('0x21')](function(_0x1a28fc){_0x4ed782[_0x9d0c('0x3c')]=_0x1a28fc;return _0x4ed782;})[_0x9d0c('0x21')](respondWithFilteredResult(_0x46955f,_0x1846f0))[_0x9d0c('0x3d')](handleError(_0x46955f,null));};exports[_0x9d0c('0x3e')]=function(_0x20473b,_0x454e01){var _0x3a88af={'raw':!![],'where':{'id':_0x20473b[_0x9d0c('0x3f')]['id']}},_0x3b2554={};_0x3b2554[_0x9d0c('0x2d')]=_[_0x9d0c('0x2b')](db[_0x9d0c('0x3a')][_0x9d0c('0x26')]);_0x3b2554[_0x9d0c('0x2a')]=_['keys'](_0x20473b[_0x9d0c('0x2a')]);_0x3b2554[_0x9d0c('0x2c')]=_[_0x9d0c('0x2f')](_0x3b2554[_0x9d0c('0x2d')],_0x3b2554[_0x9d0c('0x2a')]);_0x3a88af[_0x9d0c('0x2e')]=_['intersection'](_0x3b2554[_0x9d0c('0x2d')],qs['fields'](_0x20473b[_0x9d0c('0x2a')][_0x9d0c('0x30')]));_0x3a88af['attributes']=_0x3a88af[_0x9d0c('0x2e')][_0x9d0c('0x31')]?_0x3a88af[_0x9d0c('0x2e')]:_0x3b2554[_0x9d0c('0x2d')];if(_0x20473b[_0x9d0c('0x2a')][_0x9d0c('0x40')]){_0x3a88af[_0x9d0c('0x41')]=[{'all':!![]}];}_0x3a88af=_[_0x9d0c('0x37')]({},_0x3a88af,_0x20473b[_0x9d0c('0x42')]);return db[_0x9d0c('0x3a')][_0x9d0c('0x43')](_0x3a88af)[_0x9d0c('0x21')](handleEntityNotFound(_0x454e01,null))[_0x9d0c('0x21')](respondWithResult(_0x454e01,null))[_0x9d0c('0x3d')](handleError(_0x454e01,null));};exports[_0x9d0c('0x44')]=function(_0x575b66,_0x4ea9c6){return db[_0x9d0c('0x3a')][_0x9d0c('0x44')](_0x575b66[_0x9d0c('0x45')],{})[_0x9d0c('0x21')](respondWithResult(_0x4ea9c6,0xc9))['catch'](handleError(_0x4ea9c6,null));};exports[_0x9d0c('0x20')]=function(_0x6b2dcf,_0x38a61d){if(_0x6b2dcf[_0x9d0c('0x45')]['id']){delete _0x6b2dcf['body']['id'];}return db[_0x9d0c('0x3a')][_0x9d0c('0x43')]({'where':{'id':_0x6b2dcf[_0x9d0c('0x3f')]['id']}})[_0x9d0c('0x21')](handleEntityNotFound(_0x38a61d,null))[_0x9d0c('0x21')](saveUpdates(_0x6b2dcf[_0x9d0c('0x45')],null))[_0x9d0c('0x21')](respondWithResult(_0x38a61d,null))[_0x9d0c('0x3d')](handleError(_0x38a61d,null));};exports[_0x9d0c('0x46')]=function(_0xb0c06,_0xbabbd1){return db[_0x9d0c('0x3a')][_0x9d0c('0x43')]({'where':{'id':_0xb0c06[_0x9d0c('0x3f')]['id']}})['then'](handleEntityNotFound(_0xbabbd1,null))['then'](removeEntity(_0xbabbd1,null))['catch'](handleError(_0xbabbd1,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index fd8055a..cf9afae 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 _0xa5ed=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','DeskField','int_desk_fields','desk_unique_index','idField'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa5ed,0x75));var _0xda5e=function(_0x417a86,_0x4b098a){_0x417a86=_0x417a86-0x0;var _0x2b06f2=_0xa5ed[_0x417a86];return _0x2b06f2;};'use strict';var _=require(_0xda5e('0x0'));var util=require(_0xda5e('0x1'));var logger=require(_0xda5e('0x2'))(_0xda5e('0x3'));var moment=require(_0xda5e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xda5e('0x5'));var rimraf=require(_0xda5e('0x6'));var config=require(_0xda5e('0x7'));var attributes=require('./intDeskField.attributes');module[_0xda5e('0x8')]=function(_0x393303,_0x372d87){return _0x393303['define'](_0xda5e('0x9'),attributes,{'tableName':_0xda5e('0xa'),'paranoid':![],'indexes':[{'name':_0xda5e('0xb'),'fields':[_0xda5e('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x473a=['path','rimraf','../../config/environment','./intDeskField.attributes','exports','DeskField','int_desk_fields','desk_unique_index','idField','moment'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x473a,0x149));var _0xa473=function(_0x3e9e9d,_0x2247a0){_0x3e9e9d=_0x3e9e9d-0x0;var _0x505409=_0x473a[_0x3e9e9d];return _0x505409;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xa473('0x0'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa473('0x1'));var rimraf=require(_0xa473('0x2'));var config=require(_0xa473('0x3'));var attributes=require(_0xa473('0x4'));module[_0xa473('0x5')]=function(_0x1efe7f,_0x22ec8d){return _0x1efe7f['define'](_0xa473('0x6'),attributes,{'tableName':_0xa473('0x7'),'paranoid':![],'indexes':[{'name':_0xa473('0x8'),'fields':[_0xa473('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index b48b1c3..56f9497 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 _0x5261=['request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0xf5937e,_0x305dd2){var _0x28d083=function(_0x2a6077){while(--_0x2a6077){_0xf5937e['push'](_0xf5937e['shift']());}};_0x28d083(++_0x305dd2);}(_0x5261,0x72));var _0x1526=function(_0x52ca73,_0x15e056){_0x52ca73=_0x52ca73-0x0;var _0x1bf451=_0x5261[_0x52ca73];return _0x1bf451;};'use strict';var _=require(_0x1526('0x0'));var util=require(_0x1526('0x1'));var moment=require(_0x1526('0x2'));var BPromise=require(_0x1526('0x3'));var rs=require(_0x1526('0x4'));var fs=require('fs');var Redis=require(_0x1526('0x5'));var db=require(_0x1526('0x6'))['db'];var utils=require(_0x1526('0x7'));var logger=require('../../config/logger')(_0x1526('0x8'));var config=require(_0x1526('0x9'));var jayson=require(_0x1526('0xa'));var client=jayson[_0x1526('0xb')][_0x1526('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e50ce,_0x3f66ab,_0x3a67e6){return new BPromise(function(_0x15c40e,_0x2b1313){return client[_0x1526('0xd')](_0x3e50ce,_0x3a67e6)[_0x1526('0xe')](function(_0x14bf03){logger[_0x1526('0xf')]('DeskField,\x20%s,\x20%s',_0x3f66ab,_0x1526('0x10'));logger[_0x1526('0x11')](_0x1526('0x12'),_0x3f66ab,_0x1526('0x10'),JSON[_0x1526('0x13')](_0x14bf03));if(_0x14bf03[_0x1526('0x14')]){if(_0x14bf03[_0x1526('0x14')][_0x1526('0x15')]===0x1f4){logger[_0x1526('0x14')](_0x1526('0x16'),_0x3f66ab,_0x14bf03[_0x1526('0x14')][_0x1526('0x17')]);return _0x2b1313(_0x14bf03[_0x1526('0x14')][_0x1526('0x17')]);}logger[_0x1526('0x14')](_0x1526('0x16'),_0x3f66ab,_0x14bf03['error']['message']);return _0x15c40e(_0x14bf03['error'][_0x1526('0x17')]);}else{logger[_0x1526('0xf')]('DeskField,\x20%s,\x20%s',_0x3f66ab,_0x1526('0x10'));_0x15c40e(_0x14bf03[_0x1526('0x18')]['message']);}})[_0x1526('0x19')](function(_0x105233){logger[_0x1526('0x14')]('DeskField,\x20%s,\x20%s',_0x3f66ab,_0x105233);_0x2b1313(_0x105233);});});} \ No newline at end of file +var _0x38d9=['bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','request','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment'];(function(_0xd50b5f,_0x3bae03){var _0x4a15e9=function(_0x284696){while(--_0x284696){_0xd50b5f['push'](_0xd50b5f['shift']());}};_0x4a15e9(++_0x3bae03);}(_0x38d9,0x1d9));var _0x938d=function(_0x2bc788,_0x5b2fb4){_0x2bc788=_0x2bc788-0x0;var _0x4cd4b2=_0x38d9[_0x2bc788];return _0x4cd4b2;};'use strict';var _=require('lodash');var util=require(_0x938d('0x0'));var moment=require(_0x938d('0x1'));var BPromise=require(_0x938d('0x2'));var rs=require(_0x938d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x938d('0x4'));var logger=require(_0x938d('0x5'))(_0x938d('0x6'));var config=require(_0x938d('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ceb06,_0x4cc9ef,_0x16b262){return new BPromise(function(_0x38b800,_0x5239fd){return client[_0x938d('0x8')](_0x1ceb06,_0x16b262)['then'](function(_0x23484f){logger['info'](_0x938d('0x9'),_0x4cc9ef,_0x938d('0xa'));logger[_0x938d('0xb')](_0x938d('0xc'),_0x4cc9ef,_0x938d('0xa'),JSON['stringify'](_0x23484f));if(_0x23484f[_0x938d('0xd')]){if(_0x23484f[_0x938d('0xd')][_0x938d('0xe')]===0x1f4){logger[_0x938d('0xd')]('DeskField,\x20%s,\x20%s',_0x4cc9ef,_0x23484f[_0x938d('0xd')][_0x938d('0xf')]);return _0x5239fd(_0x23484f[_0x938d('0xd')][_0x938d('0xf')]);}logger[_0x938d('0xd')]('DeskField,\x20%s,\x20%s',_0x4cc9ef,_0x23484f[_0x938d('0xd')]['message']);return _0x38b800(_0x23484f[_0x938d('0xd')][_0x938d('0xf')]);}else{logger[_0x938d('0x10')](_0x938d('0x9'),_0x4cc9ef,'request\x20sent');_0x38b800(_0x23484f[_0x938d('0x11')][_0x938d('0xf')]);}})[_0x938d('0x12')](function(_0x163a5e){logger[_0x938d('0xd')](_0x938d('0x9'),_0x4cc9ef,_0x163a5e);_0x5239fd(_0x163a5e);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index caaf4bc..59b9825 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 _0xfce0=['addConfiguration','put','exports','multer','util','path','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations'];(function(_0x1465b0,_0x368940){var _0x699a32=function(_0x270988){while(--_0x270988){_0x1465b0['push'](_0x1465b0['shift']());}};_0x699a32(++_0x368940);}(_0xfce0,0xcb));var _0x0fce=function(_0x2644f8,_0x40977c){_0x2644f8=_0x2644f8-0x0;var _0x233fea=_0xfce0[_0x2644f8];return _0x233fea;};'use strict';var multer=require(_0x0fce('0x0'));var util=require(_0x0fce('0x1'));var path=require(_0x0fce('0x2'));var timeout=require('connect-timeout');var express=require(_0x0fce('0x3'));var router=express[_0x0fce('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0fce('0x5'));var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router[_0x0fce('0x6')]('/',auth[_0x0fce('0x7')](),controller[_0x0fce('0x8')]);router[_0x0fce('0x6')](_0x0fce('0x9'),auth[_0x0fce('0x7')](),controller[_0x0fce('0xa')]);router[_0x0fce('0x6')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0fce('0xb')]);router[_0x0fce('0x6')](_0x0fce('0xc'),auth[_0x0fce('0x7')](),controller[_0x0fce('0xd')]);router[_0x0fce('0xe')]('/',auth['isAuthenticated'](),controller[_0x0fce('0xf')]);router[_0x0fce('0xe')](_0x0fce('0x10'),auth[_0x0fce('0x7')](),controller[_0x0fce('0x11')]);router[_0x0fce('0x12')]('/:id',auth[_0x0fce('0x7')](),controller['update']);router['delete'](_0x0fce('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x0fce('0x13')]=router; \ No newline at end of file +var _0x7546=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','delete','destroy','multer'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x7546,0x71));var _0x6754=function(_0xc177ee,_0x27205f){_0xc177ee=_0xc177ee-0x0;var _0x100aed=_0x7546[_0xc177ee];return _0x100aed;};'use strict';var multer=require(_0x6754('0x0'));var util=require('util');var path=require(_0x6754('0x1'));var timeout=require('connect-timeout');var express=require(_0x6754('0x2'));var router=express['Router']();var fs_extra=require(_0x6754('0x3'));var auth=require(_0x6754('0x4'));var interaction=require(_0x6754('0x5'));var config=require('../../config/environment');var controller=require(_0x6754('0x6'));router[_0x6754('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6754('0x7')](_0x6754('0x8'),auth[_0x6754('0x9')](),controller['show']);router['get'](_0x6754('0xa'),auth['isAuthenticated'](),controller[_0x6754('0xb')]);router['get']('/:id/fields',auth[_0x6754('0x9')](),controller[_0x6754('0xc')]);router[_0x6754('0xd')]('/',auth[_0x6754('0x9')](),controller[_0x6754('0xe')]);router[_0x6754('0xd')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x6754('0xf')]);router[_0x6754('0x10')]('/:id',auth[_0x6754('0x9')](),controller['update']);router[_0x6754('0x11')](_0x6754('0x8'),auth['isAuthenticated'](),controller[_0x6754('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 66c1678..8d31f9f 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 _0x9aa2=['STRING','sequelize'];(function(_0x5336e8,_0x74419e){var _0x10712f=function(_0x3161df){while(--_0x3161df){_0x5336e8['push'](_0x5336e8['shift']());}};_0x10712f(++_0x74419e);}(_0x9aa2,0x125));var _0x29aa=function(_0x5a3385,_0x22125d){_0x5a3385=_0x5a3385-0x0;var _0x3c31d4=_0x9aa2[_0x5a3385];return _0x3c31d4;};'use strict';var Sequelize=require(_0x29aa('0x0'));module['exports']={'name':{'type':Sequelize[_0x29aa('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x29aa('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x29aa('0x1')]},'clientId':{'type':Sequelize[_0x29aa('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x29aa('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x29aa('0x1')]}}; \ No newline at end of file +var _0x794b=['sequelize','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x794b,0x1c2));var _0xb794=function(_0x402e79,_0x54c19a){_0x402e79=_0x402e79-0x0;var _0x62a5d8=_0x794b[_0x402e79];return _0x62a5d8;};'use strict';var Sequelize=require(_0xb794('0x0'));module[_0xb794('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xb794('0x2')]},'password':{'type':Sequelize[_0xb794('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xb794('0x2')]},'clientSecret':{'type':Sequelize[_0xb794('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 30c6b15..4f00e85 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 _0xe64a=['owneridyominame','parentcaseidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','password','remoteUri','clientId','clientSecret','slice','substring','lastIndexOf','format','POST','https://login.microsoftonline.com/','/oauth2/token','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','includes','LogicalName','forEach','@odata.type','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','stack',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Bearer\x20','Options','UserLocalizedLabel','Label','Value','DisplayName','GET','OptionSet','true','false','EntityDefinitions(','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','error','name','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','Dynamics365Account','includeAll','findAll','rows','show','params','rawAttributes','include','find','catch','create','body','getConfigurations','findOne','Dynamics365Configuration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','incident','Incident','description','customerid','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridtype'];(function(_0xd5872a,_0x424fe3){var _0x4e005e=function(_0x350c95){while(--_0x350c95){_0xd5872a['push'](_0xd5872a['shift']());}};_0x4e005e(++_0x424fe3);}(_0xe64a,0x1e0));var _0xae64=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe64a[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0xae64('0x0'));var rimraf=require(_0xae64('0x1'));var zipdir=require(_0xae64('0x2'));var jsonpatch=require(_0xae64('0x3'));var rp=require(_0xae64('0x4'));var moment=require(_0xae64('0x5'));var BPromise=require(_0xae64('0x6'));var Mustache=require(_0xae64('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xae64('0x8'));var fs=require('fs');var fs_extra=require(_0xae64('0x9'));var _=require(_0xae64('0xa'));var squel=require(_0xae64('0xb'));var crypto=require(_0xae64('0xc'));var jsforce=require(_0xae64('0xd'));var deskjs=require(_0xae64('0xe'));var toCsv=require(_0xae64('0xf'));var querystring=require(_0xae64('0x10'));var Papa=require(_0xae64('0x11'));var Redis=require(_0xae64('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xae64('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xae64('0x14'))(_0xae64('0x15'));var utils=require(_0xae64('0x16'));var config=require(_0xae64('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xae64('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x59b60a,_0x345caf){_0x345caf=_0x345caf||0xcc;return function(_0x15a9bf){if(_0x15a9bf){return _0x59b60a[_0xae64('0x19')](_0x345caf);}return _0x59b60a['status'](_0x345caf)[_0xae64('0x1a')]();};}function respondWithResult(_0x760b31,_0x306804){_0x306804=_0x306804||0xc8;return function(_0x29c8cd){if(_0x29c8cd){return _0x760b31[_0xae64('0x1b')](_0x306804)['json'](_0x29c8cd);}};}function respondWithFilteredResult(_0x2950c5,_0x37bc58){return function(_0x717724){if(_0x717724){var _0x285a48=typeof _0x37bc58[_0xae64('0x1c')]==='undefined'&&typeof _0x37bc58[_0xae64('0x1d')]===_0xae64('0x1e');var _0x9d2460=_0x717724[_0xae64('0x1f')];var _0x2500f1=_0x285a48?0x0:_0x37bc58[_0xae64('0x1c')];var _0x18f5da=_0x285a48?_0x717724[_0xae64('0x1f')]:_0x37bc58['offset']+_0x37bc58[_0xae64('0x1d')];var _0x3528c2;if(_0x18f5da>=_0x9d2460){_0x18f5da=_0x9d2460;_0x3528c2=0xc8;}else{_0x3528c2=0xce;}_0x2950c5[_0xae64('0x1b')](_0x3528c2);return _0x2950c5[_0xae64('0x20')](_0xae64('0x21'),_0x2500f1+'-'+_0x18f5da+'/'+_0x9d2460)[_0xae64('0x22')](_0x717724);}return null;};}function patchUpdates(_0x49bab9){return function(_0x42cb80){try{jsonpatch['apply'](_0x42cb80,_0x49bab9,!![]);}catch(_0x342356){return BPromise[_0xae64('0x23')](_0x342356);}return _0x42cb80[_0xae64('0x24')]();};}function saveUpdates(_0x394afa,_0x4406dc){return function(_0x2b5b23){if(_0x2b5b23){return _0x2b5b23[_0xae64('0x25')](_0x394afa)[_0xae64('0x26')](function(_0x24a35f){return _0x24a35f;});}return null;};}function removeEntity(_0x2e6852,_0x131225){return function(_0x134c0c){if(_0x134c0c){return _0x134c0c[_0xae64('0x27')]()['then'](function(){_0x2e6852['status'](0xcc)[_0xae64('0x1a')]();});}};}function handleEntityNotFound(_0xd5ecaf,_0x22d91a){return function(_0x31f302){if(!_0x31f302){_0xd5ecaf[_0xae64('0x19')](0x194);}return _0x31f302;};}function handleError(_0x518969,_0x562c2d){_0x562c2d=_0x562c2d||0x1f4;return function(_0x3606c7){logger[_0xae64('0x28')](_0x3606c7['stack']);if(_0x3606c7[_0xae64('0x29')]){delete _0x3606c7[_0xae64('0x29')];}_0x518969[_0xae64('0x1b')](_0x562c2d)['send'](_0x3606c7);};}exports[_0xae64('0x2a')]=function(_0x562eb4,_0x55f53d){var _0x5e4b2c={},_0x21777e={},_0x4ea1b3={'count':0x0,'rows':[]};var _0x21fd2e=_['map'](db['Dynamics365Account']['rawAttributes'],function(_0x6f6a00){return{'name':_0x6f6a00[_0xae64('0x2b')],'type':_0x6f6a00[_0xae64('0x2c')][_0xae64('0x2d')]};});_0x21777e[_0xae64('0x2e')]=_[_0xae64('0x2f')](_0x21fd2e,_0xae64('0x29'));_0x21777e[_0xae64('0x30')]=_[_0xae64('0x31')](_0x562eb4['query']);_0x21777e[_0xae64('0x32')]=_[_0xae64('0x33')](_0x21777e[_0xae64('0x2e')],_0x21777e[_0xae64('0x30')]);_0x5e4b2c[_0xae64('0x34')]=_[_0xae64('0x33')](_0x21777e['model'],qs[_0xae64('0x35')](_0x562eb4['query']['fields']));_0x5e4b2c[_0xae64('0x34')]=_0x5e4b2c[_0xae64('0x34')][_0xae64('0x36')]?_0x5e4b2c[_0xae64('0x34')]:_0x21777e[_0xae64('0x2e')];if(!_0x562eb4[_0xae64('0x30')][_0xae64('0x37')]('nolimit')){_0x5e4b2c[_0xae64('0x1d')]=qs[_0xae64('0x1d')](_0x562eb4[_0xae64('0x30')][_0xae64('0x1d')]);_0x5e4b2c[_0xae64('0x1c')]=qs[_0xae64('0x1c')](_0x562eb4['query'][_0xae64('0x1c')]);}_0x5e4b2c[_0xae64('0x38')]=qs[_0xae64('0x39')](_0x562eb4[_0xae64('0x30')]['sort']);_0x5e4b2c[_0xae64('0x3a')]=qs[_0xae64('0x32')](_['pick'](_0x562eb4[_0xae64('0x30')],_0x21777e[_0xae64('0x32')]),_0x21fd2e);if(_0x562eb4['query'][_0xae64('0x3b')]){_0x5e4b2c[_0xae64('0x3a')]=_[_0xae64('0x3c')](_0x5e4b2c[_0xae64('0x3a')],{'$or':_['map'](_0x21fd2e,function(_0x472a1c){if(_0x472a1c[_0xae64('0x2c')]!==_0xae64('0x3d')){var _0x3d9db1={};_0x3d9db1[_0x472a1c[_0xae64('0x29')]]={'$like':'%'+_0x562eb4[_0xae64('0x30')]['filter']+'%'};return _0x3d9db1;}})});}_0x5e4b2c=_[_0xae64('0x3c')]({},_0x5e4b2c,_0x562eb4[_0xae64('0x3e')]);var _0x39843c={'where':_0x5e4b2c['where']};return db[_0xae64('0x3f')][_0xae64('0x1f')](_0x39843c)[_0xae64('0x26')](function(_0x508b36){_0x4ea1b3['count']=_0x508b36;if(_0x562eb4[_0xae64('0x30')][_0xae64('0x40')]){_0x5e4b2c['include']=[{'all':!![]}];}return db[_0xae64('0x3f')][_0xae64('0x41')](_0x5e4b2c);})[_0xae64('0x26')](function(_0x27a3cc){_0x4ea1b3[_0xae64('0x42')]=_0x27a3cc;return _0x4ea1b3;})[_0xae64('0x26')](respondWithFilteredResult(_0x55f53d,_0x5e4b2c))['catch'](handleError(_0x55f53d,null));};exports[_0xae64('0x43')]=function(_0x2f8bd5,_0x209889){var _0x6ad44b={'raw':![],'where':{'id':_0x2f8bd5[_0xae64('0x44')]['id']}},_0x4ea18e={};_0x4ea18e['model']=_['keys'](db['Dynamics365Account'][_0xae64('0x45')]);_0x4ea18e[_0xae64('0x30')]=_[_0xae64('0x31')](_0x2f8bd5[_0xae64('0x30')]);_0x4ea18e['filters']=_[_0xae64('0x33')](_0x4ea18e[_0xae64('0x2e')],_0x4ea18e[_0xae64('0x30')]);_0x6ad44b[_0xae64('0x34')]=_['intersection'](_0x4ea18e[_0xae64('0x2e')],qs[_0xae64('0x35')](_0x2f8bd5['query'][_0xae64('0x35')]));_0x6ad44b[_0xae64('0x34')]=_0x6ad44b[_0xae64('0x34')]['length']?_0x6ad44b[_0xae64('0x34')]:_0x4ea18e[_0xae64('0x2e')];if(_0x2f8bd5[_0xae64('0x30')]['includeAll']){_0x6ad44b[_0xae64('0x46')]=[{'all':!![]}];}_0x6ad44b=_[_0xae64('0x3c')]({},_0x6ad44b,_0x2f8bd5['options']);return db[_0xae64('0x3f')][_0xae64('0x47')](_0x6ad44b)[_0xae64('0x26')](handleEntityNotFound(_0x209889,null))[_0xae64('0x26')](respondWithResult(_0x209889,null))[_0xae64('0x48')](handleError(_0x209889,null));};exports[_0xae64('0x49')]=function(_0x4fe640,_0x3b43aa){return db['Dynamics365Account'][_0xae64('0x49')](_0x4fe640[_0xae64('0x4a')],{})['then'](respondWithResult(_0x3b43aa,0xc9))[_0xae64('0x48')](handleError(_0x3b43aa,null));};exports[_0xae64('0x25')]=function(_0x35f254,_0x459497){if(_0x35f254[_0xae64('0x4a')]['id']){delete _0x35f254[_0xae64('0x4a')]['id'];}return db[_0xae64('0x3f')][_0xae64('0x47')]({'where':{'id':_0x35f254[_0xae64('0x44')]['id']}})[_0xae64('0x26')](handleEntityNotFound(_0x459497,null))[_0xae64('0x26')](saveUpdates(_0x35f254[_0xae64('0x4a')],null))[_0xae64('0x26')](respondWithResult(_0x459497,null))['catch'](handleError(_0x459497,null));};exports['destroy']=function(_0xe00b71,_0x14c1f6){return db[_0xae64('0x3f')]['find']({'where':{'id':_0xe00b71['params']['id']}})[_0xae64('0x26')](handleEntityNotFound(_0x14c1f6,null))[_0xae64('0x26')](removeEntity(_0x14c1f6,null))[_0xae64('0x48')](handleError(_0x14c1f6,null));};exports[_0xae64('0x4b')]=function(_0x403b84,_0x17fb5d,_0x2febbd){var _0x10c42b={};var _0x44390d={};var _0x3100fc;var _0x5d3d1e;return db[_0xae64('0x3f')][_0xae64('0x4c')]({'where':{'id':_0x403b84[_0xae64('0x44')]['id']}})['then'](handleEntityNotFound(_0x17fb5d,null))[_0xae64('0x26')](function(_0x4ad328){if(_0x4ad328){_0x3100fc=_0x4ad328;_0x44390d[_0xae64('0x2e')]=_['keys'](db[_0xae64('0x4d')]['rawAttributes']);_0x44390d[_0xae64('0x30')]=_[_0xae64('0x31')](_0x403b84[_0xae64('0x30')]);_0x44390d['filters']=_[_0xae64('0x33')](_0x44390d['model'],_0x44390d[_0xae64('0x30')]);_0x10c42b[_0xae64('0x34')]=_[_0xae64('0x33')](_0x44390d[_0xae64('0x2e')],qs[_0xae64('0x35')](_0x403b84[_0xae64('0x30')][_0xae64('0x35')]));_0x10c42b[_0xae64('0x34')]=_0x10c42b['attributes'][_0xae64('0x36')]?_0x10c42b['attributes']:_0x44390d[_0xae64('0x2e')];_0x10c42b['order']=qs[_0xae64('0x39')](_0x403b84['query'][_0xae64('0x39')]);_0x10c42b[_0xae64('0x3a')]=qs[_0xae64('0x32')](_[_0xae64('0x4e')](_0x403b84[_0xae64('0x30')],_0x44390d['filters']));if(_0x403b84['query'][_0xae64('0x3b')]){_0x10c42b['where']=_['merge'](_0x10c42b[_0xae64('0x3a')],{'$or':_[_0xae64('0x2f')](_0x10c42b[_0xae64('0x34')],function(_0x3dc790){var _0x5cec14={};_0x5cec14[_0x3dc790]={'$like':'%'+_0x403b84[_0xae64('0x30')][_0xae64('0x3b')]+'%'};return _0x5cec14;})});}_0x10c42b=_[_0xae64('0x3c')]({},_0x10c42b,_0x403b84[_0xae64('0x3e')]);return _0x3100fc['getConfigurations'](_0x10c42b);}})[_0xae64('0x26')](function(_0x58f8f4){if(_0x58f8f4){_0x5d3d1e=_0x58f8f4[_0xae64('0x36')];if(!_0x403b84[_0xae64('0x30')][_0xae64('0x37')]('nolimit')){_0x10c42b[_0xae64('0x1d')]=qs[_0xae64('0x1d')](_0x403b84[_0xae64('0x30')][_0xae64('0x1d')]);_0x10c42b[_0xae64('0x1c')]=qs['offset'](_0x403b84[_0xae64('0x30')][_0xae64('0x1c')]);}return _0x3100fc[_0xae64('0x4b')](_0x10c42b);}})['then'](function(_0x136e45){if(_0x136e45){return _0x136e45?{'count':_0x5d3d1e,'rows':_0x136e45}:null;}})[_0xae64('0x26')](respondWithResult(_0x17fb5d,null))[_0xae64('0x48')](handleError(_0x17fb5d,null));};exports[_0xae64('0x4f')]=function(_0xda2bbb,_0x3f45a2,_0x148f0f){if(_0xda2bbb[_0xae64('0x4a')]['id']){delete _0xda2bbb[_0xae64('0x4a')]['id'];}return db[_0xae64('0x3f')][_0xae64('0x4c')]({'where':{'id':_0xda2bbb['params']['id']}})[_0xae64('0x26')](handleEntityNotFound(_0x3f45a2,null))['then'](function(_0x396f6c){if(_0x396f6c){_0xda2bbb['body'][_0xae64('0x50')]=_0x396f6c['id'];_0xda2bbb[_0xae64('0x4a')][_0xae64('0x51')]=integrations[_0xae64('0x52')](_0xda2bbb['body'][_0xae64('0x53')],_0xda2bbb[_0xae64('0x4a')][_0xae64('0x2c')]);_0xda2bbb[_0xae64('0x4a')][_0xae64('0x54')]=integrations[_0xae64('0x55')](_0xda2bbb[_0xae64('0x4a')]['channel'],_0xda2bbb['body'][_0xae64('0x2c')]);return db[_0xae64('0x4d')][_0xae64('0x49')](_0xda2bbb[_0xae64('0x4a')],{'include':[{'model':db[_0xae64('0x56')],'as':_0xae64('0x51')},{'model':db[_0xae64('0x56')],'as':'Descriptions'}]});}return null;})[_0xae64('0x26')](respondWithResult(_0x3f45a2,null))[_0xae64('0x48')](handleError(_0x3f45a2,null));};exports[_0xae64('0x57')]=function(_0x2e3ff2,_0x5c2356,_0x5141d6){var _0x227fc6=_0x2e3ff2[_0xae64('0x30')]['ticketType'];var _0x45be87=_0x227fc6===_0xae64('0x58')?_0xae64('0x59'):'PhoneCall';var _0x4ad124='';var _0x208195='';var _0x5b0616='';var _0x3857fb='';var _0x257c10='';var _0x43accb='';var _0x1ca8e9='';var _0xa2c4b2='';var _0xda2841=['title',_0xae64('0x5a'),_0xae64('0x5b'),'ownerid',_0xae64('0x5c'),'subject',_0xae64('0x5d'),_0xae64('0x5e'),_0xae64('0x5f'),_0xae64('0x60')];var _0x125e3b=[_0xae64('0x61'),'accountidyominame',_0xae64('0x62'),_0xae64('0x63'),_0xae64('0x64'),_0xae64('0x65'),_0xae64('0x66'),_0xae64('0x67'),_0xae64('0x68'),_0xae64('0x69'),_0xae64('0x6a'),_0xae64('0x6b'),'createdon',_0xae64('0x6c'),_0xae64('0x6d'),_0xae64('0x6e'),'customeridtype',_0xae64('0x6f'),_0xae64('0x70'),_0xae64('0x71'),_0xae64('0x72'),_0xae64('0x73'),_0xae64('0x74'),_0xae64('0x75'),_0xae64('0x76'),_0xae64('0x77'),_0xae64('0x78'),_0xae64('0x79'),'kbarticleidname',_0xae64('0x7a'),_0xae64('0x7b'),_0xae64('0x7c'),'modifiedbyexternalpartyyominame',_0xae64('0x7d'),_0xae64('0x7e'),'modifiedon',_0xae64('0x7f'),'modifiedonbehalfbyyominame','msdyn_incidenttypename',_0xae64('0x80'),_0xae64('0x81'),_0xae64('0x82'),'overriddencreatedon','owneridname',_0xae64('0x83'),_0xae64('0x84'),_0xae64('0x85'),'primarycontactidname',_0xae64('0x86'),_0xae64('0x87'),'productidname',_0xae64('0x88'),_0xae64('0x89'),'resolvebykpiidname','responseby',_0xae64('0x8a'),_0xae64('0x8b'),_0xae64('0x8c'),_0xae64('0x8d'),_0xae64('0x8e'),_0xae64('0x8f'),_0xae64('0x90'),'statuscode',_0xae64('0x91'),_0xae64('0x92'),_0xae64('0x93'),_0xae64('0x94'),_0xae64('0x95'),_0xae64('0x96'),_0xae64('0x97')];var _0x400d2f=_0xda2841[_0xae64('0x98')](_0x125e3b);return db[_0xae64('0x3f')][_0xae64('0x4c')]({'where':{'id':_0x2e3ff2[_0xae64('0x44')]['id']},'attributes':['id','username',_0xae64('0x99'),_0xae64('0x9a'),'tenantId',_0xae64('0x9b'),_0xae64('0x9c')]})[_0xae64('0x26')](handleEntityNotFound(_0x5c2356,null))['then'](function(_0x45ccc2){if(_0x45ccc2){_0xa2c4b2=_0x45ccc2[_0xae64('0x9a')];var _0x1e9001=_0xa2c4b2[_0xae64('0x9d')](-0x1);if(_0x1e9001==='/'){_0xa2c4b2=_0xa2c4b2[_0xae64('0x9e')](0x0,_0xa2c4b2[_0xae64('0x9f')](_0x1e9001));}_0x1ca8e9=util[_0xae64('0xa0')]('%s/api/data/v9.0/',_0xa2c4b2);var _0x4666f1={'method':_0xae64('0xa1'),'uri':_0xae64('0xa2')+_0x45ccc2['tenantId']+_0xae64('0xa3'),'form':{'client_id':_0x45ccc2[_0xae64('0x9b')],'resource':_0xa2c4b2,'username':_0x45ccc2['username'],'password':_0x45ccc2['password'],'grant_type':_0xae64('0x99'),'client_secret':_0x45ccc2['clientSecret']},'json':!![]};return rp(_0x4666f1);}})[_0xae64('0x26')](function(_0x5957c){_0x43accb=_0x5957c[_0xae64('0xa4')];var _0x2e5d4f={'method':'GET','uri':encodeURI(_0x1ca8e9+_0xae64('0xa5')+_0x45be87+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x43accb,'If-None-Match':null,'OData-Version':_0xae64('0xa6')},'json':!![]};return rp(_0x2e5d4f);})[_0xae64('0x26')](function(_0x1b78e6){var _0x2775ff=_0x1b78e6[_0xae64('0xa7')][0x0];var _0x18f8d7=_0x2775ff[_0xae64('0xa8')];var _0x15866f={'method':'GET','uri':_0x1ca8e9+'EntityDefinitions('+_0x18f8d7+_0xae64('0xa9'),'headers':{'Authorization':'Bearer\x20'+_0x43accb,'If-None-Match':null,'OData-Version':_0xae64('0xa6')},'json':!![]};return rp(_0x15866f);})[_0xae64('0x26')](function(_0x173a0b){_0x4ad124=_0x173a0b;_0x208195=_0x4ad124['Attributes'];_0x208195=_[_0xae64('0xaa')](_0x208195,function(_0x5e2186){return!_0x400d2f[_0xae64('0xab')](_0x5e2186[_0xae64('0xac')]);});var _0x417440=[];var _0x37a1ee=[];_0x208195[_0xae64('0xad')](function(_0x14e66d){if(_0x14e66d[_0xae64('0xae')]){var _0x592792=_0x14e66d[_0xae64('0xae')][_0xae64('0x9e')](_0x14e66d['@odata.type']['lastIndexOf']('.')+0x1);if(_0x592792==='PicklistAttributeMetadata'){_0x417440[_0xae64('0xaf')](getSelectList(_0x1ca8e9,_0x227fc6,_0x37a1ee,_0x4ad124[_0xae64('0xa8')],_0x14e66d[_0xae64('0xa8')],_0x43accb));}}});return Promise[_0xae64('0xb0')](_0x417440);})[_0xae64('0x26')](function(_0x24ac37){_0x5b0616=_0x24ac37[0x0];var _0x3e3946=[];var _0x40c5e1=[];_0x208195[_0xae64('0xad')](function(_0x265653){if(!_[_0xae64('0xb1')](_0x265653[_0xae64('0xae')])){var _0x3ae121=_0x265653[_0xae64('0xae')][_0xae64('0x9e')](_0x265653[_0xae64('0xae')][_0xae64('0x9f')]('.')+0x1);if(_0x3ae121===_0xae64('0xb2')){_0x3e3946[_0xae64('0xaf')](getBooleanList(_0x1ca8e9,_0x227fc6,_0x40c5e1,_0x4ad124['MetadataId'],_0x265653[_0xae64('0xa8')],_0x43accb));}}});return Promise[_0xae64('0xb0')](_0x3e3946);})[_0xae64('0x26')](function(_0x3424de){_0x3857fb=_0x3424de[0x0];var _0x74801f=[];var _0x57d869=[];_0x208195[_0xae64('0xad')](function(_0x2c95c0){if(_0x2c95c0[_0xae64('0xae')]){var _0x430773=_0x2c95c0[_0xae64('0xae')][_0xae64('0x9e')](_0x2c95c0[_0xae64('0xae')][_0xae64('0x9f')]('.')+0x1);if(_0x430773===_0xae64('0xb3')||_0x430773===_0xae64('0xb4')||_0x430773===_0xae64('0xb5')||_0x430773===_0xae64('0xb6')||_0x430773===_0xae64('0xb7')||_0x430773===_0xae64('0xb8')||_0x430773==='StatusAttributeMetadata'||_0x430773===_0xae64('0xb9')||_0x430773===_0xae64('0xba')||_0x430773===_0xae64('0xbb')){_0x74801f[_0xae64('0xaf')](getInputList(_0x1ca8e9,_0x227fc6,_0x430773,_0x57d869,_0x4ad124[_0xae64('0xa8')],_0x2c95c0[_0xae64('0xa8')],_0x43accb));}}});return Promise[_0xae64('0xb0')](_0x74801f);})['then'](function(_0x3f7ce8){_0x257c10=_0x3f7ce8[0x0];var _0x3ea390=_0x5b0616[_0xae64('0x98')](_0x3857fb)[_0xae64('0x98')](_0x257c10);var _0x5f51aa={'count':_0x3ea390['length'],'rows':_0x3ea390};return _0x5f51aa;})['then'](respondWithResult(_0x5c2356,null))[_0xae64('0x48')](function(_0x3e0197){var _0x3661da=_0x2e3ff2['query'][_0xae64('0xbc')]?0x1f4:_0x3e0197['statusCode']||0x1f4;logger[_0xae64('0x28')](_0x3e0197[_0xae64('0xbd')]);delete _0x3e0197[_0xae64('0x29')];if(_0x3661da===0x191){_0x3661da=0x190;}_0x5c2356[_0xae64('0x1b')](_0x3661da)['send'](_0x2e3ff2[_0xae64('0x30')][_0xae64('0xbc')]?{'message':'Wrong\x20credentials','statusCode':_0x3e0197['statusCode']}:_0x3e0197);});};function getSelectList(_0x35860d,_0x33be57,_0x4a7918,_0x2e165c,_0x5f3d59,_0x1c9370){var _0x5f320e={'method':'GET','uri':_0x35860d+'EntityDefinitions('+_0x2e165c+_0xae64('0xbe')+_0x5f3d59+_0xae64('0xbf')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0xae64('0xc0')+_0x1c9370,'If-None-Match':null,'OData-Version':_0xae64('0xa6')},'json':!![]};return rp(_0x5f320e)[_0xae64('0x26')](function(_0x1ad09a){var _0x4e2f2d=[];var _0x215d95=_0x1ad09a['OptionSet'][_0xae64('0xc1')];_0x215d95[_0xae64('0xad')](function(_0x181207){_0x4e2f2d[_0xae64('0xaf')]({'name':_0x181207['Label'][_0xae64('0xc2')][_0xae64('0xc3')],'value':String(_0x181207[_0xae64('0xc4')])});});var _0x101929={'id':_0x33be57+'_'+_0x1ad09a['LogicalName'],'name':_0x1ad09a[_0xae64('0xc5')][_0xae64('0xc2')]['Label'],'custom':![],'options':_0x4e2f2d};_0x4a7918[_0xae64('0xaf')](_0x101929);return _0x4a7918;});}function getBooleanList(_0x5a0b4b,_0x4ef6b9,_0x1984c7,_0x44068f,_0x12bfaf,_0x257b20){var _0x4e181a={'method':_0xae64('0xc6'),'uri':_0x5a0b4b+'EntityDefinitions('+_0x44068f+_0xae64('0xbe')+_0x12bfaf+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xae64('0xc0')+_0x257b20,'If-None-Match':null,'OData-Version':_0xae64('0xa6')},'json':!![]};return rp(_0x4e181a)['then'](function(_0x5c994a){var _0x4dff38=[];_0x4dff38[_0xae64('0xaf')]({'name':_0x5c994a[_0xae64('0xc7')]['TrueOption'][_0xae64('0xc3')][_0xae64('0xc2')]['Label'],'value':_0xae64('0xc8')},{'name':_0x5c994a[_0xae64('0xc7')]['FalseOption']['Label']['UserLocalizedLabel'][_0xae64('0xc3')],'value':_0xae64('0xc9')});var _0x9c73f4={'id':_0x4ef6b9+'_'+_0x5c994a[_0xae64('0xac')],'name':_0x5c994a[_0xae64('0xc5')]['UserLocalizedLabel'][_0xae64('0xc3')],'custom':![],'options':_0x4dff38};_0x1984c7['push'](_0x9c73f4);return _0x1984c7;});}function getInputList(_0x519d7d,_0x2b21db,_0x37fe99,_0x5bee5b,_0x1d5084,_0x17e75a,_0x87ea62){var _0x1542cf={'method':_0xae64('0xc6'),'uri':_0x519d7d+_0xae64('0xca')+_0x1d5084+')/Attributes('+_0x17e75a+')/Microsoft.Dynamics.CRM.'+_0x37fe99+_0xae64('0xcb'),'headers':{'Authorization':'Bearer\x20'+_0x87ea62,'If-None-Match':null,'OData-Version':_0xae64('0xa6')},'json':!![]};return rp(_0x1542cf)[_0xae64('0x26')](function(_0x248ee6){var _0x175bdd={'id':_0x2b21db+'_'+_0x248ee6[_0xae64('0xac')],'name':_0x248ee6[_0xae64('0xc5')]['UserLocalizedLabel']?_0x248ee6[_0xae64('0xc5')][_0xae64('0xc2')][_0xae64('0xc3')]:_0x248ee6[_0xae64('0xac')],'custom':![],'options':[]};_0x5bee5b[_0xae64('0xaf')](_0x175bdd);return _0x5bee5b;});} \ No newline at end of file +var _0x25b5=[')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','then','destroy','error','name','send','index','map','Dynamics365Account','fieldName','type','model','query','keys','intersection','attributes','fields','length','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','catch','show','params','rawAttributes','includeAll','include','find','body','update','getConfigurations','findOne','Dynamics365Configuration','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','create','Dynamics365Field','getFields','ticketType','Incident','description','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','influencescore','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','utcconversiontimezonecode','versionnumber','password','tenantId','clientSecret','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','username','access_token','GET','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','PicklistAttributeMetadata','push','all','@odata.type','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','FalseOption','false'];(function(_0x2455b3,_0x2b2c71){var _0x983cd3=function(_0xf12e4e){while(--_0xf12e4e){_0x2455b3['push'](_0x2455b3['shift']());}};_0x983cd3(++_0x2b2c71);}(_0x25b5,0x198));var _0x525b=function(_0x30c647,_0xf59572){_0x30c647=_0x30c647-0x0;var _0x4029a3=_0x25b5[_0x30c647];return _0x4029a3;};'use strict';var emlformat=require(_0x525b('0x0'));var rimraf=require(_0x525b('0x1'));var zipdir=require(_0x525b('0x2'));var jsonpatch=require(_0x525b('0x3'));var rp=require(_0x525b('0x4'));var moment=require('moment');var BPromise=require(_0x525b('0x5'));var Mustache=require(_0x525b('0x6'));var util=require(_0x525b('0x7'));var path=require(_0x525b('0x8'));var sox=require(_0x525b('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x525b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x525b('0xb'));var jsforce=require(_0x525b('0xc'));var deskjs=require(_0x525b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x525b('0xe'));var Papa=require(_0x525b('0xf'));var Redis=require(_0x525b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x525b('0x11'))(_0x525b('0x12'));var utils=require('../../config/utils');var config=require(_0x525b('0x13'));var licenseUtil=require(_0x525b('0x14'));var db=require(_0x525b('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4dd1ca,_0x182ce8){_0x182ce8=_0x182ce8||0xcc;return function(_0x1af427){if(_0x1af427){return _0x4dd1ca[_0x525b('0x16')](_0x182ce8);}return _0x4dd1ca[_0x525b('0x17')](_0x182ce8)[_0x525b('0x18')]();};}function respondWithResult(_0x3897d5,_0x281bf4){_0x281bf4=_0x281bf4||0xc8;return function(_0xc996b4){if(_0xc996b4){return _0x3897d5[_0x525b('0x17')](_0x281bf4)[_0x525b('0x19')](_0xc996b4);}};}function respondWithFilteredResult(_0xe1ace,_0x4d5059){return function(_0x580429){if(_0x580429){var _0x170e3e=typeof _0x4d5059[_0x525b('0x1a')]==='undefined'&&typeof _0x4d5059['limit']===_0x525b('0x1b');var _0x344c4e=_0x580429[_0x525b('0x1c')];var _0x4c4d33=_0x170e3e?0x0:_0x4d5059[_0x525b('0x1a')];var _0x206492=_0x170e3e?_0x580429[_0x525b('0x1c')]:_0x4d5059['offset']+_0x4d5059['limit'];var _0x5f1907;if(_0x206492>=_0x344c4e){_0x206492=_0x344c4e;_0x5f1907=0xc8;}else{_0x5f1907=0xce;}_0xe1ace[_0x525b('0x17')](_0x5f1907);return _0xe1ace[_0x525b('0x1d')](_0x525b('0x1e'),_0x4c4d33+'-'+_0x206492+'/'+_0x344c4e)[_0x525b('0x19')](_0x580429);}return null;};}function patchUpdates(_0x14da20){return function(_0xf7be9a){try{jsonpatch[_0x525b('0x1f')](_0xf7be9a,_0x14da20,!![]);}catch(_0x1635b1){return BPromise[_0x525b('0x20')](_0x1635b1);}return _0xf7be9a['save']();};}function saveUpdates(_0x22b7f3,_0x3357a7){return function(_0x26c6de){if(_0x26c6de){return _0x26c6de['update'](_0x22b7f3)[_0x525b('0x21')](function(_0x29b5dc){return _0x29b5dc;});}return null;};}function removeEntity(_0x40dbc7,_0x4bfd2b){return function(_0x497ca8){if(_0x497ca8){return _0x497ca8[_0x525b('0x22')]()[_0x525b('0x21')](function(){_0x40dbc7[_0x525b('0x17')](0xcc)[_0x525b('0x18')]();});}};}function handleEntityNotFound(_0x466baa,_0x3e250b){return function(_0x3adbeb){if(!_0x3adbeb){_0x466baa[_0x525b('0x16')](0x194);}return _0x3adbeb;};}function handleError(_0x19b964,_0x2fbe49){_0x2fbe49=_0x2fbe49||0x1f4;return function(_0x334bdc){logger[_0x525b('0x23')](_0x334bdc['stack']);if(_0x334bdc['name']){delete _0x334bdc[_0x525b('0x24')];}_0x19b964['status'](_0x2fbe49)[_0x525b('0x25')](_0x334bdc);};}exports[_0x525b('0x26')]=function(_0x126477,_0x480645){var _0x51167a={},_0xbb36d6={},_0x3b2029={'count':0x0,'rows':[]};var _0x3364a3=_[_0x525b('0x27')](db[_0x525b('0x28')]['rawAttributes'],function(_0x2caada){return{'name':_0x2caada[_0x525b('0x29')],'type':_0x2caada[_0x525b('0x2a')]['key']};});_0xbb36d6[_0x525b('0x2b')]=_[_0x525b('0x27')](_0x3364a3,_0x525b('0x24'));_0xbb36d6[_0x525b('0x2c')]=_[_0x525b('0x2d')](_0x126477[_0x525b('0x2c')]);_0xbb36d6['filters']=_[_0x525b('0x2e')](_0xbb36d6[_0x525b('0x2b')],_0xbb36d6[_0x525b('0x2c')]);_0x51167a[_0x525b('0x2f')]=_[_0x525b('0x2e')](_0xbb36d6[_0x525b('0x2b')],qs[_0x525b('0x30')](_0x126477[_0x525b('0x2c')][_0x525b('0x30')]));_0x51167a['attributes']=_0x51167a['attributes'][_0x525b('0x31')]?_0x51167a['attributes']:_0xbb36d6['model'];if(!_0x126477[_0x525b('0x2c')]['hasOwnProperty']('nolimit')){_0x51167a['limit']=qs[_0x525b('0x32')](_0x126477[_0x525b('0x2c')][_0x525b('0x32')]);_0x51167a[_0x525b('0x1a')]=qs['offset'](_0x126477[_0x525b('0x2c')][_0x525b('0x1a')]);}_0x51167a[_0x525b('0x33')]=qs[_0x525b('0x34')](_0x126477[_0x525b('0x2c')][_0x525b('0x34')]);_0x51167a[_0x525b('0x35')]=qs[_0x525b('0x36')](_[_0x525b('0x37')](_0x126477[_0x525b('0x2c')],_0xbb36d6[_0x525b('0x36')]),_0x3364a3);if(_0x126477[_0x525b('0x2c')][_0x525b('0x38')]){_0x51167a[_0x525b('0x35')]=_[_0x525b('0x39')](_0x51167a['where'],{'$or':_['map'](_0x3364a3,function(_0x38904f){if(_0x38904f[_0x525b('0x2a')]!==_0x525b('0x3a')){var _0x2d531b={};_0x2d531b[_0x38904f[_0x525b('0x24')]]={'$like':'%'+_0x126477['query'][_0x525b('0x38')]+'%'};return _0x2d531b;}})});}_0x51167a=_[_0x525b('0x39')]({},_0x51167a,_0x126477[_0x525b('0x3b')]);var _0x263901={'where':_0x51167a[_0x525b('0x35')]};return db[_0x525b('0x28')][_0x525b('0x1c')](_0x263901)[_0x525b('0x21')](function(_0x40d96a){_0x3b2029[_0x525b('0x1c')]=_0x40d96a;if(_0x126477[_0x525b('0x2c')]['includeAll']){_0x51167a['include']=[{'all':!![]}];}return db[_0x525b('0x28')]['findAll'](_0x51167a);})[_0x525b('0x21')](function(_0x492022){_0x3b2029['rows']=_0x492022;return _0x3b2029;})[_0x525b('0x21')](respondWithFilteredResult(_0x480645,_0x51167a))[_0x525b('0x3c')](handleError(_0x480645,null));};exports[_0x525b('0x3d')]=function(_0x1decb0,_0x5e7607){var _0x111d74={'raw':![],'where':{'id':_0x1decb0[_0x525b('0x3e')]['id']}},_0x9f6f78={};_0x9f6f78[_0x525b('0x2b')]=_[_0x525b('0x2d')](db[_0x525b('0x28')][_0x525b('0x3f')]);_0x9f6f78['query']=_[_0x525b('0x2d')](_0x1decb0['query']);_0x9f6f78[_0x525b('0x36')]=_[_0x525b('0x2e')](_0x9f6f78[_0x525b('0x2b')],_0x9f6f78[_0x525b('0x2c')]);_0x111d74['attributes']=_['intersection'](_0x9f6f78[_0x525b('0x2b')],qs[_0x525b('0x30')](_0x1decb0['query'][_0x525b('0x30')]));_0x111d74[_0x525b('0x2f')]=_0x111d74[_0x525b('0x2f')][_0x525b('0x31')]?_0x111d74[_0x525b('0x2f')]:_0x9f6f78[_0x525b('0x2b')];if(_0x1decb0['query'][_0x525b('0x40')]){_0x111d74[_0x525b('0x41')]=[{'all':!![]}];}_0x111d74=_[_0x525b('0x39')]({},_0x111d74,_0x1decb0['options']);return db[_0x525b('0x28')][_0x525b('0x42')](_0x111d74)[_0x525b('0x21')](handleEntityNotFound(_0x5e7607,null))[_0x525b('0x21')](respondWithResult(_0x5e7607,null))['catch'](handleError(_0x5e7607,null));};exports['create']=function(_0x704a87,_0x5bc30a){return db[_0x525b('0x28')]['create'](_0x704a87[_0x525b('0x43')],{})['then'](respondWithResult(_0x5bc30a,0xc9))[_0x525b('0x3c')](handleError(_0x5bc30a,null));};exports[_0x525b('0x44')]=function(_0x159d04,_0x21de91){if(_0x159d04[_0x525b('0x43')]['id']){delete _0x159d04['body']['id'];}return db[_0x525b('0x28')][_0x525b('0x42')]({'where':{'id':_0x159d04['params']['id']}})[_0x525b('0x21')](handleEntityNotFound(_0x21de91,null))[_0x525b('0x21')](saveUpdates(_0x159d04[_0x525b('0x43')],null))[_0x525b('0x21')](respondWithResult(_0x21de91,null))[_0x525b('0x3c')](handleError(_0x21de91,null));};exports[_0x525b('0x22')]=function(_0x3eb8c2,_0x3e87a5){return db[_0x525b('0x28')][_0x525b('0x42')]({'where':{'id':_0x3eb8c2[_0x525b('0x3e')]['id']}})[_0x525b('0x21')](handleEntityNotFound(_0x3e87a5,null))[_0x525b('0x21')](removeEntity(_0x3e87a5,null))[_0x525b('0x3c')](handleError(_0x3e87a5,null));};exports[_0x525b('0x45')]=function(_0x4eecf3,_0x58f5e1,_0x88c271){var _0x1c6d4a={};var _0x58264c={};var _0xb08ba9;var _0x482372;return db[_0x525b('0x28')][_0x525b('0x46')]({'where':{'id':_0x4eecf3[_0x525b('0x3e')]['id']}})[_0x525b('0x21')](handleEntityNotFound(_0x58f5e1,null))['then'](function(_0x1ac3ea){if(_0x1ac3ea){_0xb08ba9=_0x1ac3ea;_0x58264c[_0x525b('0x2b')]=_['keys'](db[_0x525b('0x47')][_0x525b('0x3f')]);_0x58264c['query']=_[_0x525b('0x2d')](_0x4eecf3[_0x525b('0x2c')]);_0x58264c['filters']=_[_0x525b('0x2e')](_0x58264c[_0x525b('0x2b')],_0x58264c[_0x525b('0x2c')]);_0x1c6d4a[_0x525b('0x2f')]=_[_0x525b('0x2e')](_0x58264c[_0x525b('0x2b')],qs[_0x525b('0x30')](_0x4eecf3[_0x525b('0x2c')][_0x525b('0x30')]));_0x1c6d4a[_0x525b('0x2f')]=_0x1c6d4a[_0x525b('0x2f')][_0x525b('0x31')]?_0x1c6d4a[_0x525b('0x2f')]:_0x58264c['model'];_0x1c6d4a[_0x525b('0x33')]=qs[_0x525b('0x34')](_0x4eecf3[_0x525b('0x2c')][_0x525b('0x34')]);_0x1c6d4a['where']=qs[_0x525b('0x36')](_[_0x525b('0x37')](_0x4eecf3[_0x525b('0x2c')],_0x58264c[_0x525b('0x36')]));if(_0x4eecf3[_0x525b('0x2c')][_0x525b('0x38')]){_0x1c6d4a['where']=_[_0x525b('0x39')](_0x1c6d4a[_0x525b('0x35')],{'$or':_[_0x525b('0x27')](_0x1c6d4a[_0x525b('0x2f')],function(_0x50e133){var _0x1953db={};_0x1953db[_0x50e133]={'$like':'%'+_0x4eecf3['query']['filter']+'%'};return _0x1953db;})});}_0x1c6d4a=_['merge']({},_0x1c6d4a,_0x4eecf3['options']);return _0xb08ba9[_0x525b('0x45')](_0x1c6d4a);}})[_0x525b('0x21')](function(_0x35ea54){if(_0x35ea54){_0x482372=_0x35ea54[_0x525b('0x31')];if(!_0x4eecf3['query'][_0x525b('0x48')](_0x525b('0x49'))){_0x1c6d4a[_0x525b('0x32')]=qs[_0x525b('0x32')](_0x4eecf3['query']['limit']);_0x1c6d4a[_0x525b('0x1a')]=qs['offset'](_0x4eecf3[_0x525b('0x2c')]['offset']);}return _0xb08ba9[_0x525b('0x45')](_0x1c6d4a);}})[_0x525b('0x21')](function(_0x49a92f){if(_0x49a92f){return _0x49a92f?{'count':_0x482372,'rows':_0x49a92f}:null;}})[_0x525b('0x21')](respondWithResult(_0x58f5e1,null))[_0x525b('0x3c')](handleError(_0x58f5e1,null));};exports[_0x525b('0x4a')]=function(_0x251fc8,_0x291e18,_0x4a929d){if(_0x251fc8['body']['id']){delete _0x251fc8[_0x525b('0x43')]['id'];}return db[_0x525b('0x28')][_0x525b('0x46')]({'where':{'id':_0x251fc8[_0x525b('0x3e')]['id']}})[_0x525b('0x21')](handleEntityNotFound(_0x291e18,null))[_0x525b('0x21')](function(_0x5cce45){if(_0x5cce45){_0x251fc8[_0x525b('0x43')][_0x525b('0x4b')]=_0x5cce45['id'];_0x251fc8[_0x525b('0x43')][_0x525b('0x4c')]=integrations['getSubjects'](_0x251fc8['body']['channel'],_0x251fc8['body'][_0x525b('0x2a')]);_0x251fc8[_0x525b('0x43')][_0x525b('0x4d')]=integrations[_0x525b('0x4e')](_0x251fc8[_0x525b('0x43')]['channel'],_0x251fc8['body'][_0x525b('0x2a')]);return db[_0x525b('0x47')][_0x525b('0x4f')](_0x251fc8[_0x525b('0x43')],{'include':[{'model':db[_0x525b('0x50')],'as':_0x525b('0x4c')},{'model':db[_0x525b('0x50')],'as':_0x525b('0x4d')}]});}return null;})['then'](respondWithResult(_0x291e18,null))[_0x525b('0x3c')](handleError(_0x291e18,null));};exports[_0x525b('0x51')]=function(_0x67553a,_0x54cff6,_0x5459a1){var _0x4d51cb=_0x67553a[_0x525b('0x2c')][_0x525b('0x52')];var _0x1ef039=_0x4d51cb==='incident'?_0x525b('0x53'):'PhoneCall';var _0x50e5c1='';var _0x14f909='';var _0x1dd756='';var _0x430b00='';var _0x44fc75='';var _0x30281f='';var _0x364686='';var _0x50c496='';var _0x21064c=['title',_0x525b('0x54'),'customerid','ownerid',_0x525b('0x55'),_0x525b('0x56'),_0x525b('0x57'),_0x525b('0x58'),_0x525b('0x59'),'phonecall_activity_parties'];var _0xab9f5=[_0x525b('0x5a'),_0x525b('0x5b'),_0x525b('0x5c'),_0x525b('0x5d'),'contactidname','contactidyominame',_0x525b('0x5e'),_0x525b('0x5f'),_0x525b('0x60'),'createdbyexternalpartyyominame',_0x525b('0x61'),_0x525b('0x62'),_0x525b('0x63'),_0x525b('0x64'),_0x525b('0x65'),_0x525b('0x66'),_0x525b('0x67'),_0x525b('0x68'),_0x525b('0x69'),_0x525b('0x6a'),_0x525b('0x6b'),_0x525b('0x6c'),_0x525b('0x6d'),_0x525b('0x6e'),'firstresponsebykpiidname',_0x525b('0x6f'),_0x525b('0x70'),_0x525b('0x71'),'kbarticleidname','lastonholdtime','masteridname',_0x525b('0x72'),'modifiedbyexternalpartyyominame',_0x525b('0x73'),_0x525b('0x74'),_0x525b('0x75'),_0x525b('0x76'),_0x525b('0x77'),_0x525b('0x78'),_0x525b('0x79'),'numberofchildincidents',_0x525b('0x7a'),_0x525b('0x7b'),_0x525b('0x7c'),_0x525b('0x7d'),_0x525b('0x7e'),_0x525b('0x7f'),'primarycontactidname',_0x525b('0x80'),_0x525b('0x81'),'productidname',_0x525b('0x82'),_0x525b('0x83'),_0x525b('0x84'),_0x525b('0x85'),_0x525b('0x86'),_0x525b('0x87'),_0x525b('0x88'),_0x525b('0x89'),_0x525b('0x8a'),_0x525b('0x8b'),_0x525b('0x8c'),_0x525b('0x8d'),_0x525b('0x8e'),_0x525b('0x8f'),_0x525b('0x90'),'transactioncurrencyidname','traversedpath',_0x525b('0x91'),_0x525b('0x92')];var _0x3d902e=_0x21064c['concat'](_0xab9f5);return db[_0x525b('0x28')][_0x525b('0x46')]({'where':{'id':_0x67553a[_0x525b('0x3e')]['id']},'attributes':['id','username',_0x525b('0x93'),'remoteUri',_0x525b('0x94'),'clientId',_0x525b('0x95')]})[_0x525b('0x21')](handleEntityNotFound(_0x54cff6,null))[_0x525b('0x21')](function(_0x5caf97){if(_0x5caf97){_0x50c496=_0x5caf97['remoteUri'];var _0x1ffae1=_0x50c496['slice'](-0x1);if(_0x1ffae1==='/'){_0x50c496=_0x50c496[_0x525b('0x96')](0x0,_0x50c496[_0x525b('0x97')](_0x1ffae1));}_0x364686=util[_0x525b('0x98')](_0x525b('0x99'),_0x50c496);var _0xe5971a={'method':_0x525b('0x9a'),'uri':_0x525b('0x9b')+_0x5caf97[_0x525b('0x94')]+_0x525b('0x9c'),'form':{'client_id':_0x5caf97['clientId'],'resource':_0x50c496,'username':_0x5caf97[_0x525b('0x9d')],'password':_0x5caf97[_0x525b('0x93')],'grant_type':_0x525b('0x93'),'client_secret':_0x5caf97[_0x525b('0x95')]},'json':!![]};return rp(_0xe5971a);}})['then'](function(_0x1f31f8){_0x30281f=_0x1f31f8[_0x525b('0x9e')];var _0x4ac340={'method':_0x525b('0x9f'),'uri':encodeURI(_0x364686+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x1ef039+'\x27'),'headers':{'Authorization':_0x525b('0xa0')+_0x30281f,'If-None-Match':null,'OData-Version':_0x525b('0xa1')},'json':!![]};return rp(_0x4ac340);})[_0x525b('0x21')](function(_0x233e04){var _0x57a84b=_0x233e04[_0x525b('0xa2')][0x0];var _0x22cb5f=_0x57a84b[_0x525b('0xa3')];var _0x21ec98={'method':_0x525b('0x9f'),'uri':_0x364686+_0x525b('0xa4')+_0x22cb5f+_0x525b('0xa5'),'headers':{'Authorization':_0x525b('0xa0')+_0x30281f,'If-None-Match':null,'OData-Version':_0x525b('0xa1')},'json':!![]};return rp(_0x21ec98);})[_0x525b('0x21')](function(_0x43a52f){_0x50e5c1=_0x43a52f;_0x14f909=_0x50e5c1[_0x525b('0xa6')];_0x14f909=_[_0x525b('0xa7')](_0x14f909,function(_0x3802c6){return!_0x3d902e[_0x525b('0xa8')](_0x3802c6[_0x525b('0xa9')]);});var _0x238423=[];var _0x1b0f3a=[];_0x14f909[_0x525b('0xaa')](function(_0x4e8688){if(_0x4e8688['@odata.type']){var _0x46b32c=_0x4e8688['@odata.type'][_0x525b('0x96')](_0x4e8688['@odata.type'][_0x525b('0x97')]('.')+0x1);if(_0x46b32c===_0x525b('0xab')){_0x238423[_0x525b('0xac')](getSelectList(_0x364686,_0x4d51cb,_0x1b0f3a,_0x50e5c1[_0x525b('0xa3')],_0x4e8688[_0x525b('0xa3')],_0x30281f));}}});return Promise[_0x525b('0xad')](_0x238423);})[_0x525b('0x21')](function(_0x4a092c){_0x1dd756=_0x4a092c[0x0];var _0x39cc15=[];var _0x3d96a2=[];_0x14f909[_0x525b('0xaa')](function(_0x244423){if(!_['isNil'](_0x244423[_0x525b('0xae')])){var _0x2f1bb4=_0x244423[_0x525b('0xae')][_0x525b('0x96')](_0x244423[_0x525b('0xae')][_0x525b('0x97')]('.')+0x1);if(_0x2f1bb4===_0x525b('0xaf')){_0x39cc15[_0x525b('0xac')](getBooleanList(_0x364686,_0x4d51cb,_0x3d96a2,_0x50e5c1[_0x525b('0xa3')],_0x244423[_0x525b('0xa3')],_0x30281f));}}});return Promise[_0x525b('0xad')](_0x39cc15);})['then'](function(_0x4d21f4){_0x430b00=_0x4d21f4[0x0];var _0x33f455=[];var _0x1c6860=[];_0x14f909[_0x525b('0xaa')](function(_0x133916){if(_0x133916[_0x525b('0xae')]){var _0x8e7e37=_0x133916[_0x525b('0xae')]['substring'](_0x133916['@odata.type'][_0x525b('0x97')]('.')+0x1);if(_0x8e7e37===_0x525b('0xb0')||_0x8e7e37===_0x525b('0xb1')||_0x8e7e37===_0x525b('0xb2')||_0x8e7e37===_0x525b('0xb3')||_0x8e7e37===_0x525b('0xb4')||_0x8e7e37===_0x525b('0xb5')||_0x8e7e37===_0x525b('0xb6')||_0x8e7e37==='EntityNameAttributeMetadata'||_0x8e7e37===_0x525b('0xb7')||_0x8e7e37===_0x525b('0xb8')){_0x33f455[_0x525b('0xac')](getInputList(_0x364686,_0x4d51cb,_0x8e7e37,_0x1c6860,_0x50e5c1[_0x525b('0xa3')],_0x133916[_0x525b('0xa3')],_0x30281f));}}});return Promise[_0x525b('0xad')](_0x33f455);})[_0x525b('0x21')](function(_0x295008){_0x44fc75=_0x295008[0x0];var _0xc9b6ce=_0x1dd756[_0x525b('0xb9')](_0x430b00)[_0x525b('0xb9')](_0x44fc75);var _0x399cf1={'count':_0xc9b6ce[_0x525b('0x31')],'rows':_0xc9b6ce};return _0x399cf1;})['then'](respondWithResult(_0x54cff6,null))[_0x525b('0x3c')](function(_0x4237c1){var _0xc869ed=_0x67553a[_0x525b('0x2c')][_0x525b('0xba')]?0x1f4:_0x4237c1[_0x525b('0xbb')]||0x1f4;logger[_0x525b('0x23')](_0x4237c1['stack']);delete _0x4237c1[_0x525b('0x24')];if(_0xc869ed===0x191){_0xc869ed=0x190;}_0x54cff6[_0x525b('0x17')](_0xc869ed)[_0x525b('0x25')](_0x67553a[_0x525b('0x2c')][_0x525b('0xba')]?{'message':'Wrong\x20credentials','statusCode':_0x4237c1[_0x525b('0xbb')]}:_0x4237c1);});};function getSelectList(_0x4111c1,_0x27c4f8,_0x1026cc,_0x3b8983,_0x466a9b,_0x1f8ad9){var _0x92a3fc={'method':_0x525b('0x9f'),'uri':_0x4111c1+_0x525b('0xa4')+_0x3b8983+_0x525b('0xbc')+_0x466a9b+_0x525b('0xbd')+_0x525b('0xbe'),'headers':{'Authorization':'Bearer\x20'+_0x1f8ad9,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x92a3fc)['then'](function(_0x29c9b6){var _0x19853c=[];var _0x16b732=_0x29c9b6[_0x525b('0xbf')][_0x525b('0xc0')];_0x16b732[_0x525b('0xaa')](function(_0x1796a1){_0x19853c[_0x525b('0xac')]({'name':_0x1796a1[_0x525b('0xc1')][_0x525b('0xc2')][_0x525b('0xc1')],'value':String(_0x1796a1[_0x525b('0xc3')])});});var _0x47fe12={'id':_0x27c4f8+'_'+_0x29c9b6[_0x525b('0xa9')],'name':_0x29c9b6[_0x525b('0xc4')][_0x525b('0xc2')]['Label'],'custom':![],'options':_0x19853c};_0x1026cc[_0x525b('0xac')](_0x47fe12);return _0x1026cc;});}function getBooleanList(_0x17d351,_0x2bc0e6,_0x130eae,_0x1d6257,_0x4d3d7e,_0x446d4b){var _0xcd9f55={'method':_0x525b('0x9f'),'uri':_0x17d351+_0x525b('0xa4')+_0x1d6257+_0x525b('0xbc')+_0x4d3d7e+_0x525b('0xc5'),'headers':{'Authorization':_0x525b('0xa0')+_0x446d4b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xcd9f55)['then'](function(_0x2d5148){var _0x30cd46=[];_0x30cd46[_0x525b('0xac')]({'name':_0x2d5148[_0x525b('0xbf')][_0x525b('0xc6')][_0x525b('0xc1')][_0x525b('0xc2')][_0x525b('0xc1')],'value':'true'},{'name':_0x2d5148[_0x525b('0xbf')][_0x525b('0xc7')][_0x525b('0xc1')]['UserLocalizedLabel'][_0x525b('0xc1')],'value':_0x525b('0xc8')});var _0x2863e8={'id':_0x2bc0e6+'_'+_0x2d5148['LogicalName'],'name':_0x2d5148[_0x525b('0xc4')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x30cd46};_0x130eae[_0x525b('0xac')](_0x2863e8);return _0x130eae;});}function getInputList(_0x3d46b5,_0x5af37e,_0x5b5d9e,_0x28ae3a,_0x40dd0d,_0x207f5a,_0x4826a9){var _0xcfaa60={'method':'GET','uri':_0x3d46b5+_0x525b('0xa4')+_0x40dd0d+_0x525b('0xbc')+_0x207f5a+_0x525b('0xc9')+_0x5b5d9e+_0x525b('0xca'),'headers':{'Authorization':_0x525b('0xa0')+_0x4826a9,'If-None-Match':null,'OData-Version':_0x525b('0xa1')},'json':!![]};return rp(_0xcfaa60)[_0x525b('0x21')](function(_0x4572da){var _0x1d969e={'id':_0x5af37e+'_'+_0x4572da[_0x525b('0xa9')],'name':_0x4572da[_0x525b('0xc4')][_0x525b('0xc2')]?_0x4572da[_0x525b('0xc4')]['UserLocalizedLabel'][_0x525b('0xc1')]:_0x4572da[_0x525b('0xa9')],'custom':![],'options':[]};_0x28ae3a[_0x525b('0xac')](_0x1d969e);return _0x28ae3a;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index e5b368e..0a3125d 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 _0xcb91=['rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x44535f,_0x7aeb71){var _0x5702a7=function(_0x25b8af){while(--_0x25b8af){_0x44535f['push'](_0x44535f['shift']());}};_0x5702a7(++_0x7aeb71);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xdefbc3,_0x1ea49a){_0xdefbc3=_0xdefbc3-0x0;var _0x367798=_0xcb91[_0xdefbc3];return _0x367798;};'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 +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x304ba1,_0x1fe502){var _0x1471f1=function(_0x3beb39){while(--_0x3beb39){_0x304ba1['push'](_0x304ba1['shift']());}};_0x1471f1(++_0x1fe502);}(_0xe706,0xa3));var _0x6e70=function(_0x5c6046,_0x25dcd8){_0x5c6046=_0x5c6046-0x0;var _0x4c462d=_0xe706[_0x5c6046];return _0x4c462d;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'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 77d0122..224dd34 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 _0x08ac=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','attributes','limit','map','include','model','where','ShowDynamics365Account','lodash','util'];(function(_0x96b6a,_0x12471d){var _0x3e16f3=function(_0xa1fc4b){while(--_0xa1fc4b){_0x96b6a['push'](_0x96b6a['shift']());}};_0x3e16f3(++_0x12471d);}(_0x08ac,0x195));var _0xc08a=function(_0x65a8b1,_0x16ba57){_0x65a8b1=_0x65a8b1-0x0;var _0x185eb8=_0x08ac[_0x65a8b1];return _0x185eb8;};'use strict';var _=require(_0xc08a('0x0'));var util=require(_0xc08a('0x1'));var moment=require(_0xc08a('0x2'));var BPromise=require(_0xc08a('0x3'));var rs=require(_0xc08a('0x4'));var fs=require('fs');var Redis=require(_0xc08a('0x5'));var db=require(_0xc08a('0x6'))['db'];var utils=require(_0xc08a('0x7'));var logger=require(_0xc08a('0x8'))(_0xc08a('0x9'));var config=require('../../config/environment');var jayson=require(_0xc08a('0xa'));var client=jayson[_0xc08a('0xb')][_0xc08a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x860957,_0x4ef748,_0x10e7bc){return new BPromise(function(_0x1922c9,_0x381c40){return client[_0xc08a('0xd')](_0x860957,_0x10e7bc)[_0xc08a('0xe')](function(_0x5dc86a){logger[_0xc08a('0xf')](_0xc08a('0x10'),_0x4ef748,_0xc08a('0x11'));logger[_0xc08a('0x12')](_0xc08a('0x13'),_0x4ef748,_0xc08a('0x11'),JSON[_0xc08a('0x14')](_0x5dc86a));if(_0x5dc86a['error']){if(_0x5dc86a['error'][_0xc08a('0x15')]===0x1f4){logger[_0xc08a('0x16')]('Dynamics365Account,\x20%s,\x20%s',_0x4ef748,_0x5dc86a[_0xc08a('0x16')]['message']);return _0x381c40(_0x5dc86a[_0xc08a('0x16')][_0xc08a('0x17')]);}logger[_0xc08a('0x16')](_0xc08a('0x10'),_0x4ef748,_0x5dc86a['error'][_0xc08a('0x17')]);return _0x1922c9(_0x5dc86a[_0xc08a('0x16')][_0xc08a('0x17')]);}else{logger[_0xc08a('0xf')](_0xc08a('0x10'),_0x4ef748,_0xc08a('0x11'));_0x1922c9(_0x5dc86a['result'][_0xc08a('0x17')]);}})[_0xc08a('0x18')](function(_0x16f417){logger[_0xc08a('0x16')](_0xc08a('0x10'),_0x4ef748,_0x16f417);_0x381c40(_0x16f417);});});}exports[_0xc08a('0x19')]=function(_0x50ecb3){var _0x5eb9d8=this;return new Promise(function(_0x41bb14,_0x9b5f66){return db[_0xc08a('0x1a')][_0xc08a('0x1b')]({'raw':_0x50ecb3[_0xc08a('0x1c')]?_0x50ecb3['options'][_0xc08a('0x1d')]===undefined?!![]:![]:!![],'where':_0x50ecb3[_0xc08a('0x1c')]?_0x50ecb3[_0xc08a('0x1c')]['where']||null:null,'attributes':_0x50ecb3[_0xc08a('0x1c')]?_0x50ecb3[_0xc08a('0x1c')][_0xc08a('0x1e')]||null:null,'limit':_0x50ecb3[_0xc08a('0x1c')]?_0x50ecb3[_0xc08a('0x1c')][_0xc08a('0x1f')]||null:null,'include':_0x50ecb3[_0xc08a('0x1c')]?_0x50ecb3[_0xc08a('0x1c')]['include']?_[_0xc08a('0x20')](_0x50ecb3[_0xc08a('0x1c')][_0xc08a('0x21')],function(_0x4a9045){return{'model':db[_0x4a9045[_0xc08a('0x22')]],'as':_0x4a9045['as'],'attributes':_0x4a9045[_0xc08a('0x1e')],'include':_0x4a9045[_0xc08a('0x21')]?_['map'](_0x4a9045[_0xc08a('0x21')],function(_0x426ae3){return{'model':db[_0x426ae3['model']],'as':_0x426ae3['as'],'attributes':_0x426ae3[_0xc08a('0x1e')],'include':_0x426ae3[_0xc08a('0x21')]?_[_0xc08a('0x20')](_0x426ae3['include'],function(_0x4df07c){return{'model':db[_0x4df07c['model']],'as':_0x4df07c['as'],'attributes':_0x4df07c[_0xc08a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc08a('0xe')](function(_0x1d945a){logger[_0xc08a('0xf')](_0xc08a('0x19'),_0x50ecb3);logger[_0xc08a('0x12')](_0xc08a('0x19'),_0x50ecb3,JSON[_0xc08a('0x14')](_0x1d945a));_0x41bb14(_0x1d945a);})[_0xc08a('0x18')](function(_0x356dda){logger[_0xc08a('0x16')]('GetDynamics365Account',_0x356dda['message'],_0x50ecb3);_0x9b5f66(_0x5eb9d8[_0xc08a('0x16')](0x1f4,_0x356dda[_0xc08a('0x17')]));});});};exports['ShowDynamics365Account']=function(_0x4cdeb0){var _0x4e4e97=this;return new Promise(function(_0x5efddf,_0x1c0d83){return db[_0xc08a('0x1a')]['find']({'raw':_0x4cdeb0[_0xc08a('0x1c')]?_0x4cdeb0[_0xc08a('0x1c')][_0xc08a('0x1d')]===undefined?!![]:![]:!![],'where':_0x4cdeb0[_0xc08a('0x1c')]?_0x4cdeb0[_0xc08a('0x1c')][_0xc08a('0x23')]||null:null,'attributes':_0x4cdeb0[_0xc08a('0x1c')]?_0x4cdeb0[_0xc08a('0x1c')]['attributes']||null:null,'include':_0x4cdeb0[_0xc08a('0x1c')]?_0x4cdeb0[_0xc08a('0x1c')][_0xc08a('0x21')]?_[_0xc08a('0x20')](_0x4cdeb0[_0xc08a('0x1c')][_0xc08a('0x21')],function(_0x3fd701){return{'model':db[_0x3fd701['model']],'as':_0x3fd701['as'],'attributes':_0x3fd701[_0xc08a('0x1e')],'include':_0x3fd701[_0xc08a('0x21')]?_[_0xc08a('0x20')](_0x3fd701['include'],function(_0x1b4b7f){return{'model':db[_0x1b4b7f['model']],'as':_0x1b4b7f['as'],'attributes':_0x1b4b7f[_0xc08a('0x1e')],'include':_0x1b4b7f['include']?_['map'](_0x1b4b7f[_0xc08a('0x21')],function(_0x36bf00){return{'model':db[_0x36bf00[_0xc08a('0x22')]],'as':_0x36bf00['as'],'attributes':_0x36bf00['attributes']};}):[]};}):[]};}):[]:[]})[_0xc08a('0xe')](function(_0x3526fc){logger[_0xc08a('0xf')](_0xc08a('0x24'),_0x4cdeb0);logger[_0xc08a('0x12')](_0xc08a('0x24'),_0x4cdeb0,JSON[_0xc08a('0x14')](_0x3526fc));_0x5efddf(_0x3526fc);})['catch'](function(_0x49cf76){logger['error']('ShowDynamics365Account',_0x49cf76['message'],_0x4cdeb0);_0x1c0d83(_0x4e4e97['error'](0x1f4,_0x49cf76['message']));});});}; \ No newline at end of file +var _0xa1ab=['rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Account,\x20%s,\x20%s','message','result','GetDynamics365Account','Dynamics365Account','findAll','options','raw','attributes','limit','include','map','model','catch','ShowDynamics365Account','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1ef67e,_0x397551){var _0x5f243a=function(_0x3ade3e){while(--_0x3ade3e){_0x1ef67e['push'](_0x1ef67e['shift']());}};_0x5f243a(++_0x397551);}(_0xa1ab,0x110));var _0xba1a=function(_0x540705,_0x5078d2){_0x540705=_0x540705-0x0;var _0x97722a=_0xa1ab[_0x540705];return _0x97722a;};'use strict';var _=require(_0xba1a('0x0'));var util=require('util');var moment=require(_0xba1a('0x1'));var BPromise=require(_0xba1a('0x2'));var rs=require(_0xba1a('0x3'));var fs=require('fs');var Redis=require(_0xba1a('0x4'));var db=require(_0xba1a('0x5'))['db'];var utils=require(_0xba1a('0x6'));var logger=require(_0xba1a('0x7'))(_0xba1a('0x8'));var config=require(_0xba1a('0x9'));var jayson=require(_0xba1a('0xa'));var client=jayson[_0xba1a('0xb')][_0xba1a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x141725,_0x475b9c,_0x216563){return new BPromise(function(_0x239dc8,_0x440c29){return client['request'](_0x141725,_0x216563)[_0xba1a('0xd')](function(_0x160e9a){logger[_0xba1a('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x475b9c,_0xba1a('0xf'));logger[_0xba1a('0x10')](_0xba1a('0x11'),_0x475b9c,_0xba1a('0xf'),JSON[_0xba1a('0x12')](_0x160e9a));if(_0x160e9a[_0xba1a('0x13')]){if(_0x160e9a[_0xba1a('0x13')]['code']===0x1f4){logger[_0xba1a('0x13')](_0xba1a('0x14'),_0x475b9c,_0x160e9a[_0xba1a('0x13')][_0xba1a('0x15')]);return _0x440c29(_0x160e9a['error'][_0xba1a('0x15')]);}logger[_0xba1a('0x13')]('Dynamics365Account,\x20%s,\x20%s',_0x475b9c,_0x160e9a[_0xba1a('0x13')][_0xba1a('0x15')]);return _0x239dc8(_0x160e9a[_0xba1a('0x13')][_0xba1a('0x15')]);}else{logger['info'](_0xba1a('0x14'),_0x475b9c,_0xba1a('0xf'));_0x239dc8(_0x160e9a[_0xba1a('0x16')][_0xba1a('0x15')]);}})['catch'](function(_0x509043){logger[_0xba1a('0x13')](_0xba1a('0x14'),_0x475b9c,_0x509043);_0x440c29(_0x509043);});});}exports[_0xba1a('0x17')]=function(_0x42a698){var _0x56af1b=this;return new Promise(function(_0x13f448,_0x19ede0){return db[_0xba1a('0x18')][_0xba1a('0x19')]({'raw':_0x42a698[_0xba1a('0x1a')]?_0x42a698[_0xba1a('0x1a')][_0xba1a('0x1b')]===undefined?!![]:![]:!![],'where':_0x42a698[_0xba1a('0x1a')]?_0x42a698[_0xba1a('0x1a')]['where']||null:null,'attributes':_0x42a698[_0xba1a('0x1a')]?_0x42a698['options'][_0xba1a('0x1c')]||null:null,'limit':_0x42a698['options']?_0x42a698[_0xba1a('0x1a')][_0xba1a('0x1d')]||null:null,'include':_0x42a698[_0xba1a('0x1a')]?_0x42a698[_0xba1a('0x1a')][_0xba1a('0x1e')]?_[_0xba1a('0x1f')](_0x42a698[_0xba1a('0x1a')][_0xba1a('0x1e')],function(_0x4c11c7){return{'model':db[_0x4c11c7[_0xba1a('0x20')]],'as':_0x4c11c7['as'],'attributes':_0x4c11c7['attributes'],'include':_0x4c11c7[_0xba1a('0x1e')]?_['map'](_0x4c11c7[_0xba1a('0x1e')],function(_0x43436d){return{'model':db[_0x43436d[_0xba1a('0x20')]],'as':_0x43436d['as'],'attributes':_0x43436d[_0xba1a('0x1c')],'include':_0x43436d[_0xba1a('0x1e')]?_[_0xba1a('0x1f')](_0x43436d[_0xba1a('0x1e')],function(_0x3c9222){return{'model':db[_0x3c9222['model']],'as':_0x3c9222['as'],'attributes':_0x3c9222[_0xba1a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xba1a('0xd')](function(_0x58467d){logger['info']('GetDynamics365Account',_0x42a698);logger['debug'](_0xba1a('0x17'),_0x42a698,JSON['stringify'](_0x58467d));_0x13f448(_0x58467d);})[_0xba1a('0x21')](function(_0x4f4ca8){logger['error']('GetDynamics365Account',_0x4f4ca8['message'],_0x42a698);_0x19ede0(_0x56af1b[_0xba1a('0x13')](0x1f4,_0x4f4ca8['message']));});});};exports[_0xba1a('0x22')]=function(_0x22e1d4){var _0x4fc93a=this;return new Promise(function(_0x587fd9,_0x362feb){return db[_0xba1a('0x18')]['find']({'raw':_0x22e1d4[_0xba1a('0x1a')]?_0x22e1d4['options'][_0xba1a('0x1b')]===undefined?!![]:![]:!![],'where':_0x22e1d4['options']?_0x22e1d4[_0xba1a('0x1a')]['where']||null:null,'attributes':_0x22e1d4[_0xba1a('0x1a')]?_0x22e1d4['options'][_0xba1a('0x1c')]||null:null,'include':_0x22e1d4[_0xba1a('0x1a')]?_0x22e1d4[_0xba1a('0x1a')][_0xba1a('0x1e')]?_[_0xba1a('0x1f')](_0x22e1d4[_0xba1a('0x1a')][_0xba1a('0x1e')],function(_0x268a11){return{'model':db[_0x268a11['model']],'as':_0x268a11['as'],'attributes':_0x268a11[_0xba1a('0x1c')],'include':_0x268a11['include']?_[_0xba1a('0x1f')](_0x268a11[_0xba1a('0x1e')],function(_0x4ae047){return{'model':db[_0x4ae047[_0xba1a('0x20')]],'as':_0x4ae047['as'],'attributes':_0x4ae047[_0xba1a('0x1c')],'include':_0x4ae047[_0xba1a('0x1e')]?_[_0xba1a('0x1f')](_0x4ae047[_0xba1a('0x1e')],function(_0x5be5c9){return{'model':db[_0x5be5c9[_0xba1a('0x20')]],'as':_0x5be5c9['as'],'attributes':_0x5be5c9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e9808){logger[_0xba1a('0xe')]('ShowDynamics365Account',_0x22e1d4);logger[_0xba1a('0x10')](_0xba1a('0x22'),_0x22e1d4,JSON['stringify'](_0x2e9808));_0x587fd9(_0x2e9808);})[_0xba1a('0x21')](function(_0x17ccaf){logger[_0xba1a('0x13')](_0xba1a('0x22'),_0x17ccaf[_0xba1a('0x15')],_0x22e1d4);_0x362feb(_0x4fc93a[_0xba1a('0x13')](0x1f4,_0x17ccaf['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 43c90e1..4548ecf 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 _0xa547=['isAuthenticated','index','get','/:id','/:id/fields','getFields','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller'];(function(_0x4c8e52,_0x3ec27d){var _0x360c05=function(_0x2b5c63){while(--_0x2b5c63){_0x4c8e52['push'](_0x4c8e52['shift']());}};_0x360c05(++_0x3ec27d);}(_0xa547,0xb0));var _0x7a54=function(_0x26134a,_0x475625){_0x26134a=_0x26134a-0x0;var _0x24d0b9=_0xa547[_0x26134a];return _0x24d0b9;};'use strict';var multer=require('multer');var util=require(_0x7a54('0x0'));var path=require('path');var timeout=require(_0x7a54('0x1'));var express=require('express');var router=express[_0x7a54('0x2')]();var fs_extra=require(_0x7a54('0x3'));var auth=require(_0x7a54('0x4'));var interaction=require(_0x7a54('0x5'));var config=require(_0x7a54('0x6'));var controller=require(_0x7a54('0x7'));router['get']('/',auth[_0x7a54('0x8')](),controller[_0x7a54('0x9')]);router[_0x7a54('0xa')](_0x7a54('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x7a54('0xa')](_0x7a54('0xc'),auth[_0x7a54('0x8')](),controller[_0x7a54('0xd')]);router[_0x7a54('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0x7a54('0xa')](_0x7a54('0xe'),auth[_0x7a54('0x8')](),controller[_0x7a54('0xf')]);router[_0x7a54('0x10')]('/',auth[_0x7a54('0x8')](),controller[_0x7a54('0x11')]);router[_0x7a54('0x12')](_0x7a54('0xb'),auth[_0x7a54('0x8')](),controller[_0x7a54('0x13')]);router[_0x7a54('0x14')]('/:id',auth[_0x7a54('0x8')](),controller[_0x7a54('0x15')]);module[_0x7a54('0x16')]=router; \ No newline at end of file +var _0x917d=['show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','/:id','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','get','isAuthenticated','index'];(function(_0x50c189,_0x55d6d5){var _0x222f44=function(_0x364217){while(--_0x364217){_0x50c189['push'](_0x50c189['shift']());}};_0x222f44(++_0x55d6d5);}(_0x917d,0x17c));var _0xd917=function(_0x296384,_0x4d79c4){_0x296384=_0x296384-0x0;var _0x5f2b73=_0x917d[_0x296384];return _0x5f2b73;};'use strict';var multer=require(_0xd917('0x0'));var util=require(_0xd917('0x1'));var path=require('path');var timeout=require(_0xd917('0x2'));var express=require(_0xd917('0x3'));var router=express[_0xd917('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd917('0x5'));var interaction=require(_0xd917('0x6'));var config=require('../../config/environment');var controller=require(_0xd917('0x7'));router[_0xd917('0x8')]('/',auth[_0xd917('0x9')](),controller[_0xd917('0xa')]);router[_0xd917('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xd917('0xb')]);router[_0xd917('0x8')](_0xd917('0xc'),auth[_0xd917('0x9')](),controller[_0xd917('0xd')]);router[_0xd917('0x8')](_0xd917('0xe'),auth[_0xd917('0x9')](),controller[_0xd917('0xf')]);router['get'](_0xd917('0x10'),auth[_0xd917('0x9')](),controller['getDescriptions']);router[_0xd917('0x11')]('/',auth[_0xd917('0x9')](),controller[_0xd917('0x12')]);router[_0xd917('0x13')]('/:id',auth[_0xd917('0x9')](),controller['update']);router[_0xd917('0x14')](_0xd917('0x15'),auth[_0xd917('0x9')](),controller['destroy']);module[_0xd917('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 5dfa9b7..e4f905a 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 _0x2704=['exports','STRING','ENUM','incident'];(function(_0x4e9b6f,_0x3af253){var _0x209c8e=function(_0x382591){while(--_0x382591){_0x4e9b6f['push'](_0x4e9b6f['shift']());}};_0x209c8e(++_0x3af253);}(_0x2704,0x9c));var _0x4270=function(_0x3a4f18,_0x1af741){_0x3a4f18=_0x3a4f18-0x0;var _0x4c20fc=_0x2704[_0x3a4f18];return _0x4c20fc;};'use strict';var Sequelize=require('sequelize');module[_0x4270('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4270('0x1')]},'ticketType':{'type':Sequelize[_0x4270('0x2')](_0x4270('0x3'),'phonecall'),'defaultValue':'incident'}}; \ No newline at end of file +var _0x8e9f=['sequelize','exports','STRING','incident','phonecall'];(function(_0x1a42bc,_0x34a88c){var _0x33fd2b=function(_0x2be72d){while(--_0x2be72d){_0x1a42bc['push'](_0x1a42bc['shift']());}};_0x33fd2b(++_0x34a88c);}(_0x8e9f,0xaa));var _0xf8e9=function(_0x1562a2,_0x2e4655){_0x1562a2=_0x1562a2-0x0;var _0x39a636=_0x8e9f[_0x1562a2];return _0x39a636;};'use strict';var Sequelize=require(_0xf8e9('0x0'));module[_0xf8e9('0x1')]={'name':{'type':Sequelize[_0xf8e9('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0xf8e9('0x3'),_0xf8e9('0x4')),'defaultValue':_0xf8e9('0x3')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 6780497..ac0822e 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 _0x5863=['stack','name','send','index','map','Dynamics365Configuration','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','create','body','destroy','params','getFields','pick','getSubjects','findOne','Dynamics365Field','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error'];(function(_0x556855,_0x1e1c3e){var _0x2c0e99=function(_0x5c10ee){while(--_0x5c10ee){_0x556855['push'](_0x556855['shift']());}};_0x2c0e99(++_0x1e1c3e);}(_0x5863,0x1d4));var _0x3586=function(_0x34bb8d,_0xc6b5ff){_0x34bb8d=_0x34bb8d-0x0;var _0x101c6a=_0x5863[_0x34bb8d];return _0x101c6a;};'use strict';var emlformat=require(_0x3586('0x0'));var rimraf=require(_0x3586('0x1'));var zipdir=require(_0x3586('0x2'));var jsonpatch=require(_0x3586('0x3'));var rp=require(_0x3586('0x4'));var moment=require('moment');var BPromise=require(_0x3586('0x5'));var Mustache=require(_0x3586('0x6'));var util=require(_0x3586('0x7'));var path=require(_0x3586('0x8'));var sox=require('sox');var csv=require(_0x3586('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3586('0xa'));var _=require('lodash');var squel=require(_0x3586('0xb'));var crypto=require(_0x3586('0xc'));var jsforce=require(_0x3586('0xd'));var deskjs=require(_0x3586('0xe'));var toCsv=require(_0x3586('0x9'));var querystring=require(_0x3586('0xf'));var Papa=require(_0x3586('0x10'));var Redis=require(_0x3586('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3586('0x12'));var as=require(_0x3586('0x13'));var hardwareService=require(_0x3586('0x14'));var logger=require(_0x3586('0x15'))(_0x3586('0x16'));var utils=require(_0x3586('0x17'));var config=require(_0x3586('0x18'));var licenseUtil=require(_0x3586('0x19'));var db=require(_0x3586('0x1a'))['db'];function respondWithStatusCode(_0x477453,_0x1529d0){_0x1529d0=_0x1529d0||0xcc;return function(_0x31f9cb){if(_0x31f9cb){return _0x477453['sendStatus'](_0x1529d0);}return _0x477453['status'](_0x1529d0)[_0x3586('0x1b')]();};}function respondWithResult(_0x146589,_0x3d90a4){_0x3d90a4=_0x3d90a4||0xc8;return function(_0x5ec1d9){if(_0x5ec1d9){return _0x146589[_0x3586('0x1c')](_0x3d90a4)['json'](_0x5ec1d9);}};}function respondWithFilteredResult(_0x1c713f,_0x53e9e2){return function(_0x14b266){if(_0x14b266){var _0x806fd6=typeof _0x53e9e2[_0x3586('0x1d')]===_0x3586('0x1e')&&typeof _0x53e9e2[_0x3586('0x1f')]===_0x3586('0x1e');var _0x32204a=_0x14b266[_0x3586('0x20')];var _0x281588=_0x806fd6?0x0:_0x53e9e2[_0x3586('0x1d')];var _0x271b77=_0x806fd6?_0x14b266[_0x3586('0x20')]:_0x53e9e2[_0x3586('0x1d')]+_0x53e9e2[_0x3586('0x1f')];var _0x3c8fac;if(_0x271b77>=_0x32204a){_0x271b77=_0x32204a;_0x3c8fac=0xc8;}else{_0x3c8fac=0xce;}_0x1c713f[_0x3586('0x1c')](_0x3c8fac);return _0x1c713f[_0x3586('0x21')](_0x3586('0x22'),_0x281588+'-'+_0x271b77+'/'+_0x32204a)[_0x3586('0x23')](_0x14b266);}return null;};}function patchUpdates(_0x1b3ddd){return function(_0x531449){try{jsonpatch[_0x3586('0x24')](_0x531449,_0x1b3ddd,!![]);}catch(_0x3bf9e7){return BPromise[_0x3586('0x25')](_0x3bf9e7);}return _0x531449[_0x3586('0x26')]();};}function saveUpdates(_0x4423fc,_0x3ea0a0){return function(_0x3be90d){if(_0x3be90d){return _0x3be90d[_0x3586('0x27')](_0x4423fc)[_0x3586('0x28')](function(_0x3acc92){return _0x3acc92;});}return null;};}function removeEntity(_0x434231,_0x28285c){return function(_0x3f1054){if(_0x3f1054){return _0x3f1054['destroy']()[_0x3586('0x28')](function(){_0x434231[_0x3586('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x194cb7,_0x5bb44e){return function(_0xa05b1b){if(!_0xa05b1b){_0x194cb7['sendStatus'](0x194);}return _0xa05b1b;};}function handleError(_0x198513,_0x114f32){_0x114f32=_0x114f32||0x1f4;return function(_0x5144fd){logger[_0x3586('0x29')](_0x5144fd[_0x3586('0x2a')]);if(_0x5144fd[_0x3586('0x2b')]){delete _0x5144fd[_0x3586('0x2b')];}_0x198513[_0x3586('0x1c')](_0x114f32)[_0x3586('0x2c')](_0x5144fd);};}exports[_0x3586('0x2d')]=function(_0x2734f1,_0x357b2f){var _0x2b0093={},_0x49a729={},_0x4e2229={'count':0x0,'rows':[]};var _0x52dfef=_[_0x3586('0x2e')](db[_0x3586('0x2f')]['rawAttributes'],function(_0x35fde5){return{'name':_0x35fde5[_0x3586('0x30')],'type':_0x35fde5[_0x3586('0x31')][_0x3586('0x32')]};});_0x49a729[_0x3586('0x33')]=_[_0x3586('0x2e')](_0x52dfef,_0x3586('0x2b'));_0x49a729[_0x3586('0x34')]=_[_0x3586('0x35')](_0x2734f1[_0x3586('0x34')]);_0x49a729['filters']=_[_0x3586('0x36')](_0x49a729[_0x3586('0x33')],_0x49a729[_0x3586('0x34')]);_0x2b0093[_0x3586('0x37')]=_['intersection'](_0x49a729[_0x3586('0x33')],qs[_0x3586('0x38')](_0x2734f1[_0x3586('0x34')][_0x3586('0x38')]));_0x2b0093[_0x3586('0x37')]=_0x2b0093['attributes'][_0x3586('0x39')]?_0x2b0093[_0x3586('0x37')]:_0x49a729[_0x3586('0x33')];if(!_0x2734f1['query'][_0x3586('0x3a')](_0x3586('0x3b'))){_0x2b0093[_0x3586('0x1f')]=qs[_0x3586('0x1f')](_0x2734f1[_0x3586('0x34')][_0x3586('0x1f')]);_0x2b0093[_0x3586('0x1d')]=qs[_0x3586('0x1d')](_0x2734f1[_0x3586('0x34')][_0x3586('0x1d')]);}_0x2b0093[_0x3586('0x3c')]=qs[_0x3586('0x3d')](_0x2734f1[_0x3586('0x34')][_0x3586('0x3d')]);_0x2b0093[_0x3586('0x3e')]=qs['filters'](_['pick'](_0x2734f1['query'],_0x49a729[_0x3586('0x3f')]),_0x52dfef);if(_0x2734f1[_0x3586('0x34')][_0x3586('0x40')]){_0x2b0093[_0x3586('0x3e')]=_[_0x3586('0x41')](_0x2b0093[_0x3586('0x3e')],{'$or':_[_0x3586('0x2e')](_0x52dfef,function(_0x17617b){if(_0x17617b['type']!=='VIRTUAL'){var _0x336a6b={};_0x336a6b[_0x17617b['name']]={'$like':'%'+_0x2734f1['query'][_0x3586('0x40')]+'%'};return _0x336a6b;}})});}_0x2b0093=_[_0x3586('0x41')]({},_0x2b0093,_0x2734f1['options']);var _0xbb0a90={'where':_0x2b0093['where']};return db[_0x3586('0x2f')][_0x3586('0x20')](_0xbb0a90)['then'](function(_0x3a2048){_0x4e2229[_0x3586('0x20')]=_0x3a2048;if(_0x2734f1['query'][_0x3586('0x42')]){_0x2b0093[_0x3586('0x43')]=[{'all':!![]}];}return db[_0x3586('0x2f')][_0x3586('0x44')](_0x2b0093);})['then'](function(_0x481666){_0x4e2229[_0x3586('0x45')]=_0x481666;return _0x4e2229;})[_0x3586('0x28')](respondWithFilteredResult(_0x357b2f,_0x2b0093))[_0x3586('0x46')](handleError(_0x357b2f,null));};exports[_0x3586('0x47')]=function(_0xbac3cf,_0x489b5c){var _0xb934f4={'raw':![],'where':{'id':_0xbac3cf['params']['id']}},_0x2d1249={};_0x2d1249[_0x3586('0x33')]=_['keys'](db[_0x3586('0x2f')][_0x3586('0x48')]);_0x2d1249[_0x3586('0x34')]=_['keys'](_0xbac3cf[_0x3586('0x34')]);_0x2d1249[_0x3586('0x3f')]=_[_0x3586('0x36')](_0x2d1249[_0x3586('0x33')],_0x2d1249[_0x3586('0x34')]);_0xb934f4['attributes']=_['intersection'](_0x2d1249['model'],qs[_0x3586('0x38')](_0xbac3cf[_0x3586('0x34')][_0x3586('0x38')]));_0xb934f4[_0x3586('0x37')]=_0xb934f4[_0x3586('0x37')][_0x3586('0x39')]?_0xb934f4[_0x3586('0x37')]:_0x2d1249['model'];if(_0xbac3cf[_0x3586('0x34')]['includeAll']){_0xb934f4[_0x3586('0x43')]=[{'all':!![]}];}_0xb934f4=_['merge']({},_0xb934f4,_0xbac3cf[_0x3586('0x49')]);return db['Dynamics365Configuration'][_0x3586('0x4a')](_0xb934f4)[_0x3586('0x28')](handleEntityNotFound(_0x489b5c,null))[_0x3586('0x28')](respondWithResult(_0x489b5c,null))[_0x3586('0x46')](handleError(_0x489b5c,null));};exports[_0x3586('0x4b')]=function(_0x1338c2,_0x82d29d){return db[_0x3586('0x2f')][_0x3586('0x4b')](_0x1338c2['body'],{})[_0x3586('0x28')](respondWithResult(_0x82d29d,0xc9))['catch'](handleError(_0x82d29d,null));};exports[_0x3586('0x27')]=function(_0x99c996,_0x400667){if(_0x99c996[_0x3586('0x4c')]['id']){delete _0x99c996[_0x3586('0x4c')]['id'];}return db[_0x3586('0x2f')]['find']({'where':{'id':_0x99c996['params']['id']}})[_0x3586('0x28')](handleEntityNotFound(_0x400667,null))['then'](saveUpdates(_0x99c996[_0x3586('0x4c')],null))[_0x3586('0x28')](respondWithResult(_0x400667,null))['catch'](handleError(_0x400667,null));};exports[_0x3586('0x4d')]=function(_0xf62e53,_0xa28c1a){return db[_0x3586('0x2f')]['find']({'where':{'id':_0xf62e53[_0x3586('0x4e')]['id']}})[_0x3586('0x28')](handleEntityNotFound(_0xa28c1a,null))[_0x3586('0x28')](removeEntity(_0xa28c1a,null))['catch'](handleError(_0xa28c1a,null));};exports[_0x3586('0x4f')]=function(_0xe59dd2,_0x1c088a,_0x6d35cd){var _0x5621fe={};var _0x3778b5={};var _0x3731ef;var _0x50c1e8;return db[_0x3586('0x2f')]['findOne']({'where':{'id':_0xe59dd2[_0x3586('0x4e')]['id']}})[_0x3586('0x28')](handleEntityNotFound(_0x1c088a,null))[_0x3586('0x28')](function(_0x551192){if(_0x551192){_0x3731ef=_0x551192;_0x3778b5[_0x3586('0x33')]=_['keys'](db['Dynamics365Field'][_0x3586('0x48')]);_0x3778b5['query']=_['keys'](_0xe59dd2['query']);_0x3778b5[_0x3586('0x3f')]=_[_0x3586('0x36')](_0x3778b5[_0x3586('0x33')],_0x3778b5[_0x3586('0x34')]);_0x5621fe[_0x3586('0x37')]=_[_0x3586('0x36')](_0x3778b5[_0x3586('0x33')],qs[_0x3586('0x38')](_0xe59dd2['query'][_0x3586('0x38')]));_0x5621fe['attributes']=_0x5621fe['attributes'][_0x3586('0x39')]?_0x5621fe['attributes']:_0x3778b5[_0x3586('0x33')];_0x5621fe[_0x3586('0x3c')]=qs['sort'](_0xe59dd2['query'][_0x3586('0x3d')]);_0x5621fe[_0x3586('0x3e')]=qs['filters'](_[_0x3586('0x50')](_0xe59dd2[_0x3586('0x34')],_0x3778b5[_0x3586('0x3f')]));if(_0xe59dd2['query'][_0x3586('0x40')]){_0x5621fe['where']=_[_0x3586('0x41')](_0x5621fe['where'],{'$or':_[_0x3586('0x2e')](_0x5621fe[_0x3586('0x37')],function(_0x317153){var _0x57d80c={};_0x57d80c[_0x317153]={'$like':'%'+_0xe59dd2['query']['filter']+'%'};return _0x57d80c;})});}_0x5621fe=_['merge']({},_0x5621fe,_0xe59dd2[_0x3586('0x49')]);return _0x3731ef['getFields'](_0x5621fe);}})[_0x3586('0x28')](function(_0x303013){if(_0x303013){_0x50c1e8=_0x303013[_0x3586('0x39')];if(!_0xe59dd2['query'][_0x3586('0x3a')]('nolimit')){_0x5621fe[_0x3586('0x1f')]=qs['limit'](_0xe59dd2[_0x3586('0x34')]['limit']);_0x5621fe[_0x3586('0x1d')]=qs['offset'](_0xe59dd2[_0x3586('0x34')]['offset']);}return _0x3731ef[_0x3586('0x4f')](_0x5621fe);}})[_0x3586('0x28')](function(_0x2530b8){if(_0x2530b8){return _0x2530b8?{'count':_0x50c1e8,'rows':_0x2530b8}:null;}})[_0x3586('0x28')](respondWithResult(_0x1c088a,null))[_0x3586('0x46')](handleError(_0x1c088a,null));};exports[_0x3586('0x51')]=function(_0x367024,_0x4b5189,_0x56147d){var _0x37a3f4={};var _0x1d9e7d={};var _0x15233c;var _0x301610;return db['Dynamics365Configuration'][_0x3586('0x52')]({'where':{'id':_0x367024['params']['id']}})['then'](handleEntityNotFound(_0x4b5189,null))['then'](function(_0x24a8f5){if(_0x24a8f5){_0x15233c=_0x24a8f5;_0x1d9e7d[_0x3586('0x33')]=_[_0x3586('0x35')](db[_0x3586('0x53')][_0x3586('0x48')]);_0x1d9e7d['query']=_['keys'](_0x367024[_0x3586('0x34')]);_0x1d9e7d[_0x3586('0x3f')]=_[_0x3586('0x36')](_0x1d9e7d[_0x3586('0x33')],_0x1d9e7d[_0x3586('0x34')]);_0x37a3f4['attributes']=_['intersection'](_0x1d9e7d[_0x3586('0x33')],qs['fields'](_0x367024[_0x3586('0x34')][_0x3586('0x38')]));_0x37a3f4['attributes']=_0x37a3f4[_0x3586('0x37')][_0x3586('0x39')]?_0x37a3f4[_0x3586('0x37')]:_0x1d9e7d[_0x3586('0x33')];_0x37a3f4['order']=qs['sort'](_0x367024[_0x3586('0x34')]['sort']);_0x37a3f4[_0x3586('0x3e')]=qs['filters'](_[_0x3586('0x50')](_0x367024[_0x3586('0x34')],_0x1d9e7d[_0x3586('0x3f')]));if(_0x367024[_0x3586('0x34')][_0x3586('0x40')]){_0x37a3f4[_0x3586('0x3e')]=_[_0x3586('0x41')](_0x37a3f4['where'],{'$or':_['map'](_0x37a3f4[_0x3586('0x37')],function(_0x19b5a5){var _0x3e4bea={};_0x3e4bea[_0x19b5a5]={'$like':'%'+_0x367024[_0x3586('0x34')][_0x3586('0x40')]+'%'};return _0x3e4bea;})});}_0x37a3f4=_[_0x3586('0x41')]({},_0x37a3f4,_0x367024[_0x3586('0x49')]);return _0x15233c[_0x3586('0x51')](_0x37a3f4);}})['then'](function(_0xcbb7ff){if(_0xcbb7ff){_0x301610=_0xcbb7ff[_0x3586('0x39')];if(!_0x367024[_0x3586('0x34')][_0x3586('0x3a')](_0x3586('0x3b'))){_0x37a3f4[_0x3586('0x1f')]=qs['limit'](_0x367024[_0x3586('0x34')][_0x3586('0x1f')]);_0x37a3f4[_0x3586('0x1d')]=qs[_0x3586('0x1d')](_0x367024[_0x3586('0x34')][_0x3586('0x1d')]);}return _0x15233c[_0x3586('0x51')](_0x37a3f4);}})['then'](function(_0x1acb52){if(_0x1acb52){return _0x1acb52?{'count':_0x301610,'rows':_0x1acb52}:null;}})['then'](respondWithResult(_0x4b5189,null))['catch'](handleError(_0x4b5189,null));};exports[_0x3586('0x54')]=function(_0x3f1dbf,_0x611c9f,_0x4aa62c){var _0x295e36={};var _0x2577af={};var _0x59c2f9;var _0x32fae0;return db[_0x3586('0x2f')]['findOne']({'where':{'id':_0x3f1dbf[_0x3586('0x4e')]['id']}})[_0x3586('0x28')](handleEntityNotFound(_0x611c9f,null))[_0x3586('0x28')](function(_0x55e5fa){if(_0x55e5fa){_0x59c2f9=_0x55e5fa;_0x2577af[_0x3586('0x33')]=_[_0x3586('0x35')](db[_0x3586('0x53')][_0x3586('0x48')]);_0x2577af['query']=_['keys'](_0x3f1dbf[_0x3586('0x34')]);_0x2577af[_0x3586('0x3f')]=_['intersection'](_0x2577af[_0x3586('0x33')],_0x2577af[_0x3586('0x34')]);_0x295e36[_0x3586('0x37')]=_[_0x3586('0x36')](_0x2577af[_0x3586('0x33')],qs[_0x3586('0x38')](_0x3f1dbf[_0x3586('0x34')][_0x3586('0x38')]));_0x295e36[_0x3586('0x37')]=_0x295e36[_0x3586('0x37')][_0x3586('0x39')]?_0x295e36[_0x3586('0x37')]:_0x2577af[_0x3586('0x33')];_0x295e36[_0x3586('0x3c')]=qs[_0x3586('0x3d')](_0x3f1dbf[_0x3586('0x34')]['sort']);_0x295e36[_0x3586('0x3e')]=qs['filters'](_[_0x3586('0x50')](_0x3f1dbf[_0x3586('0x34')],_0x2577af[_0x3586('0x3f')]));if(_0x3f1dbf[_0x3586('0x34')][_0x3586('0x40')]){_0x295e36[_0x3586('0x3e')]=_[_0x3586('0x41')](_0x295e36[_0x3586('0x3e')],{'$or':_[_0x3586('0x2e')](_0x295e36[_0x3586('0x37')],function(_0x275693){var _0x2a6bc2={};_0x2a6bc2[_0x275693]={'$like':'%'+_0x3f1dbf[_0x3586('0x34')][_0x3586('0x40')]+'%'};return _0x2a6bc2;})});}_0x295e36=_[_0x3586('0x41')]({},_0x295e36,_0x3f1dbf[_0x3586('0x49')]);return _0x59c2f9[_0x3586('0x54')](_0x295e36);}})[_0x3586('0x28')](function(_0xb84b1b){if(_0xb84b1b){_0x32fae0=_0xb84b1b[_0x3586('0x39')];if(!_0x3f1dbf[_0x3586('0x34')][_0x3586('0x3a')]('nolimit')){_0x295e36[_0x3586('0x1f')]=qs[_0x3586('0x1f')](_0x3f1dbf[_0x3586('0x34')][_0x3586('0x1f')]);_0x295e36['offset']=qs[_0x3586('0x1d')](_0x3f1dbf['query'][_0x3586('0x1d')]);}return _0x59c2f9[_0x3586('0x54')](_0x295e36);}})[_0x3586('0x28')](function(_0x3cadb5){if(_0x3cadb5){return _0x3cadb5?{'count':_0x32fae0,'rows':_0x3cadb5}:null;}})[_0x3586('0x28')](respondWithResult(_0x611c9f,null))['catch'](handleError(_0x611c9f,null));}; \ No newline at end of file +var _0x8dcb=['limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','end','stack','name','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','getFields','findOne','length','nolimit','getSubjects','Dynamics365Field','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset'];(function(_0x328391,_0x4cd50c){var _0x57e02c=function(_0xaa1356){while(--_0xaa1356){_0x328391['push'](_0x328391['shift']());}};_0x57e02c(++_0x4cd50c);}(_0x8dcb,0x12c));var _0xb8dc=function(_0x6bb1ac,_0x53d84d){_0x6bb1ac=_0x6bb1ac-0x0;var _0xc35c19=_0x8dcb[_0x6bb1ac];return _0xc35c19;};'use strict';var emlformat=require(_0xb8dc('0x0'));var rimraf=require(_0xb8dc('0x1'));var zipdir=require(_0xb8dc('0x2'));var jsonpatch=require(_0xb8dc('0x3'));var rp=require(_0xb8dc('0x4'));var moment=require(_0xb8dc('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb8dc('0x6'));var util=require(_0xb8dc('0x7'));var path=require(_0xb8dc('0x8'));var sox=require(_0xb8dc('0x9'));var csv=require(_0xb8dc('0xa'));var ejs=require(_0xb8dc('0xb'));var fs=require('fs');var fs_extra=require(_0xb8dc('0xc'));var _=require('lodash');var squel=require(_0xb8dc('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb8dc('0xe'));var toCsv=require(_0xb8dc('0xa'));var querystring=require(_0xb8dc('0xf'));var Papa=require(_0xb8dc('0x10'));var Redis=require(_0xb8dc('0x11'));var authService=require(_0xb8dc('0x12'));var qs=require(_0xb8dc('0x13'));var as=require(_0xb8dc('0x14'));var hardwareService=require(_0xb8dc('0x15'));var logger=require(_0xb8dc('0x16'))(_0xb8dc('0x17'));var utils=require(_0xb8dc('0x18'));var config=require(_0xb8dc('0x19'));var licenseUtil=require(_0xb8dc('0x1a'));var db=require(_0xb8dc('0x1b'))['db'];function respondWithStatusCode(_0x598bc8,_0xf622a9){_0xf622a9=_0xf622a9||0xcc;return function(_0x187265){if(_0x187265){return _0x598bc8[_0xb8dc('0x1c')](_0xf622a9);}return _0x598bc8[_0xb8dc('0x1d')](_0xf622a9)['end']();};}function respondWithResult(_0xf56da3,_0x423598){_0x423598=_0x423598||0xc8;return function(_0x3479ff){if(_0x3479ff){return _0xf56da3[_0xb8dc('0x1d')](_0x423598)[_0xb8dc('0x1e')](_0x3479ff);}};}function respondWithFilteredResult(_0x4fe3cf,_0x49adf2){return function(_0xbc5489){if(_0xbc5489){var _0x2c41b9=typeof _0x49adf2[_0xb8dc('0x1f')]==='undefined'&&typeof _0x49adf2[_0xb8dc('0x20')]===_0xb8dc('0x21');var _0x5fa5e2=_0xbc5489[_0xb8dc('0x22')];var _0x3b2a18=_0x2c41b9?0x0:_0x49adf2[_0xb8dc('0x1f')];var _0x1f2880=_0x2c41b9?_0xbc5489['count']:_0x49adf2[_0xb8dc('0x1f')]+_0x49adf2[_0xb8dc('0x20')];var _0xe8171a;if(_0x1f2880>=_0x5fa5e2){_0x1f2880=_0x5fa5e2;_0xe8171a=0xc8;}else{_0xe8171a=0xce;}_0x4fe3cf[_0xb8dc('0x1d')](_0xe8171a);return _0x4fe3cf[_0xb8dc('0x23')](_0xb8dc('0x24'),_0x3b2a18+'-'+_0x1f2880+'/'+_0x5fa5e2)[_0xb8dc('0x1e')](_0xbc5489);}return null;};}function patchUpdates(_0x13c5b6){return function(_0xb48542){try{jsonpatch[_0xb8dc('0x25')](_0xb48542,_0x13c5b6,!![]);}catch(_0x400dc5){return BPromise['reject'](_0x400dc5);}return _0xb48542[_0xb8dc('0x26')]();};}function saveUpdates(_0xfa7416,_0x2e729f){return function(_0x5175bd){if(_0x5175bd){return _0x5175bd[_0xb8dc('0x27')](_0xfa7416)[_0xb8dc('0x28')](function(_0x185071){return _0x185071;});}return null;};}function removeEntity(_0x1b1beb,_0x10b9be){return function(_0x1a8497){if(_0x1a8497){return _0x1a8497[_0xb8dc('0x29')]()['then'](function(){_0x1b1beb[_0xb8dc('0x1d')](0xcc)[_0xb8dc('0x2a')]();});}};}function handleEntityNotFound(_0x330a6d,_0x12e085){return function(_0x36c125){if(!_0x36c125){_0x330a6d[_0xb8dc('0x1c')](0x194);}return _0x36c125;};}function handleError(_0x521ae7,_0x41cae2){_0x41cae2=_0x41cae2||0x1f4;return function(_0x604769){logger['error'](_0x604769[_0xb8dc('0x2b')]);if(_0x604769[_0xb8dc('0x2c')]){delete _0x604769[_0xb8dc('0x2c')];}_0x521ae7[_0xb8dc('0x1d')](_0x41cae2)['send'](_0x604769);};}exports[_0xb8dc('0x2d')]=function(_0x1886c4,_0x40a7d2){var _0x24caf6={},_0x2decae={},_0x5aad3f={'count':0x0,'rows':[]};var _0x18d981=_[_0xb8dc('0x2e')](db[_0xb8dc('0x2f')][_0xb8dc('0x30')],function(_0x2a001d){return{'name':_0x2a001d[_0xb8dc('0x31')],'type':_0x2a001d[_0xb8dc('0x32')]['key']};});_0x2decae[_0xb8dc('0x33')]=_[_0xb8dc('0x2e')](_0x18d981,_0xb8dc('0x2c'));_0x2decae['query']=_['keys'](_0x1886c4[_0xb8dc('0x34')]);_0x2decae['filters']=_[_0xb8dc('0x35')](_0x2decae[_0xb8dc('0x33')],_0x2decae[_0xb8dc('0x34')]);_0x24caf6[_0xb8dc('0x36')]=_[_0xb8dc('0x35')](_0x2decae['model'],qs[_0xb8dc('0x37')](_0x1886c4[_0xb8dc('0x34')][_0xb8dc('0x37')]));_0x24caf6[_0xb8dc('0x36')]=_0x24caf6[_0xb8dc('0x36')]['length']?_0x24caf6[_0xb8dc('0x36')]:_0x2decae[_0xb8dc('0x33')];if(!_0x1886c4['query'][_0xb8dc('0x38')]('nolimit')){_0x24caf6[_0xb8dc('0x20')]=qs[_0xb8dc('0x20')](_0x1886c4['query']['limit']);_0x24caf6[_0xb8dc('0x1f')]=qs['offset'](_0x1886c4[_0xb8dc('0x34')]['offset']);}_0x24caf6[_0xb8dc('0x39')]=qs[_0xb8dc('0x3a')](_0x1886c4[_0xb8dc('0x34')]['sort']);_0x24caf6[_0xb8dc('0x3b')]=qs[_0xb8dc('0x3c')](_[_0xb8dc('0x3d')](_0x1886c4[_0xb8dc('0x34')],_0x2decae[_0xb8dc('0x3c')]),_0x18d981);if(_0x1886c4[_0xb8dc('0x34')]['filter']){_0x24caf6[_0xb8dc('0x3b')]=_['merge'](_0x24caf6[_0xb8dc('0x3b')],{'$or':_[_0xb8dc('0x2e')](_0x18d981,function(_0x3ffea6){if(_0x3ffea6['type']!=='VIRTUAL'){var _0x2ee508={};_0x2ee508[_0x3ffea6[_0xb8dc('0x2c')]]={'$like':'%'+_0x1886c4[_0xb8dc('0x34')][_0xb8dc('0x3e')]+'%'};return _0x2ee508;}})});}_0x24caf6=_[_0xb8dc('0x3f')]({},_0x24caf6,_0x1886c4[_0xb8dc('0x40')]);var _0x5810a7={'where':_0x24caf6[_0xb8dc('0x3b')]};return db['Dynamics365Configuration'][_0xb8dc('0x22')](_0x5810a7)[_0xb8dc('0x28')](function(_0x502adb){_0x5aad3f['count']=_0x502adb;if(_0x1886c4[_0xb8dc('0x34')][_0xb8dc('0x41')]){_0x24caf6[_0xb8dc('0x42')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xb8dc('0x43')](_0x24caf6);})[_0xb8dc('0x28')](function(_0xb99abd){_0x5aad3f[_0xb8dc('0x44')]=_0xb99abd;return _0x5aad3f;})[_0xb8dc('0x28')](respondWithFilteredResult(_0x40a7d2,_0x24caf6))['catch'](handleError(_0x40a7d2,null));};exports[_0xb8dc('0x45')]=function(_0x2af7a2,_0xbf402e){var _0x28105e={'raw':![],'where':{'id':_0x2af7a2[_0xb8dc('0x46')]['id']}},_0x3b0f1d={};_0x3b0f1d['model']=_[_0xb8dc('0x47')](db[_0xb8dc('0x2f')][_0xb8dc('0x30')]);_0x3b0f1d[_0xb8dc('0x34')]=_[_0xb8dc('0x47')](_0x2af7a2[_0xb8dc('0x34')]);_0x3b0f1d[_0xb8dc('0x3c')]=_[_0xb8dc('0x35')](_0x3b0f1d[_0xb8dc('0x33')],_0x3b0f1d[_0xb8dc('0x34')]);_0x28105e[_0xb8dc('0x36')]=_[_0xb8dc('0x35')](_0x3b0f1d[_0xb8dc('0x33')],qs[_0xb8dc('0x37')](_0x2af7a2[_0xb8dc('0x34')][_0xb8dc('0x37')]));_0x28105e[_0xb8dc('0x36')]=_0x28105e[_0xb8dc('0x36')]['length']?_0x28105e['attributes']:_0x3b0f1d[_0xb8dc('0x33')];if(_0x2af7a2[_0xb8dc('0x34')][_0xb8dc('0x41')]){_0x28105e['include']=[{'all':!![]}];}_0x28105e=_[_0xb8dc('0x3f')]({},_0x28105e,_0x2af7a2['options']);return db['Dynamics365Configuration'][_0xb8dc('0x48')](_0x28105e)[_0xb8dc('0x28')](handleEntityNotFound(_0xbf402e,null))[_0xb8dc('0x28')](respondWithResult(_0xbf402e,null))[_0xb8dc('0x49')](handleError(_0xbf402e,null));};exports[_0xb8dc('0x4a')]=function(_0x2e9c98,_0x556c83){return db[_0xb8dc('0x2f')][_0xb8dc('0x4a')](_0x2e9c98[_0xb8dc('0x4b')],{})[_0xb8dc('0x28')](respondWithResult(_0x556c83,0xc9))[_0xb8dc('0x49')](handleError(_0x556c83,null));};exports[_0xb8dc('0x27')]=function(_0x56b094,_0x2fa54c){if(_0x56b094[_0xb8dc('0x4b')]['id']){delete _0x56b094['body']['id'];}return db[_0xb8dc('0x2f')][_0xb8dc('0x48')]({'where':{'id':_0x56b094[_0xb8dc('0x46')]['id']}})['then'](handleEntityNotFound(_0x2fa54c,null))[_0xb8dc('0x28')](saveUpdates(_0x56b094[_0xb8dc('0x4b')],null))[_0xb8dc('0x28')](respondWithResult(_0x2fa54c,null))[_0xb8dc('0x49')](handleError(_0x2fa54c,null));};exports['destroy']=function(_0x4e9fa6,_0x22e0a9){return db['Dynamics365Configuration'][_0xb8dc('0x48')]({'where':{'id':_0x4e9fa6[_0xb8dc('0x46')]['id']}})['then'](handleEntityNotFound(_0x22e0a9,null))[_0xb8dc('0x28')](removeEntity(_0x22e0a9,null))[_0xb8dc('0x49')](handleError(_0x22e0a9,null));};exports[_0xb8dc('0x4c')]=function(_0x2c043b,_0x407958,_0x26babb){var _0x5cdb35={};var _0x9b86b3={};var _0xd714dc;var _0x159740;return db[_0xb8dc('0x2f')][_0xb8dc('0x4d')]({'where':{'id':_0x2c043b['params']['id']}})[_0xb8dc('0x28')](handleEntityNotFound(_0x407958,null))[_0xb8dc('0x28')](function(_0x1c8ab0){if(_0x1c8ab0){_0xd714dc=_0x1c8ab0;_0x9b86b3[_0xb8dc('0x33')]=_[_0xb8dc('0x47')](db['Dynamics365Field'][_0xb8dc('0x30')]);_0x9b86b3[_0xb8dc('0x34')]=_[_0xb8dc('0x47')](_0x2c043b[_0xb8dc('0x34')]);_0x9b86b3[_0xb8dc('0x3c')]=_['intersection'](_0x9b86b3[_0xb8dc('0x33')],_0x9b86b3['query']);_0x5cdb35['attributes']=_[_0xb8dc('0x35')](_0x9b86b3[_0xb8dc('0x33')],qs[_0xb8dc('0x37')](_0x2c043b[_0xb8dc('0x34')]['fields']));_0x5cdb35[_0xb8dc('0x36')]=_0x5cdb35['attributes'][_0xb8dc('0x4e')]?_0x5cdb35[_0xb8dc('0x36')]:_0x9b86b3[_0xb8dc('0x33')];_0x5cdb35[_0xb8dc('0x39')]=qs[_0xb8dc('0x3a')](_0x2c043b[_0xb8dc('0x34')]['sort']);_0x5cdb35[_0xb8dc('0x3b')]=qs['filters'](_[_0xb8dc('0x3d')](_0x2c043b[_0xb8dc('0x34')],_0x9b86b3['filters']));if(_0x2c043b['query']['filter']){_0x5cdb35[_0xb8dc('0x3b')]=_['merge'](_0x5cdb35[_0xb8dc('0x3b')],{'$or':_[_0xb8dc('0x2e')](_0x5cdb35[_0xb8dc('0x36')],function(_0x918f37){var _0x5efc65={};_0x5efc65[_0x918f37]={'$like':'%'+_0x2c043b['query'][_0xb8dc('0x3e')]+'%'};return _0x5efc65;})});}_0x5cdb35=_[_0xb8dc('0x3f')]({},_0x5cdb35,_0x2c043b[_0xb8dc('0x40')]);return _0xd714dc[_0xb8dc('0x4c')](_0x5cdb35);}})['then'](function(_0x33af07){if(_0x33af07){_0x159740=_0x33af07['length'];if(!_0x2c043b[_0xb8dc('0x34')][_0xb8dc('0x38')](_0xb8dc('0x4f'))){_0x5cdb35[_0xb8dc('0x20')]=qs[_0xb8dc('0x20')](_0x2c043b[_0xb8dc('0x34')][_0xb8dc('0x20')]);_0x5cdb35[_0xb8dc('0x1f')]=qs[_0xb8dc('0x1f')](_0x2c043b[_0xb8dc('0x34')]['offset']);}return _0xd714dc[_0xb8dc('0x4c')](_0x5cdb35);}})['then'](function(_0x429273){if(_0x429273){return _0x429273?{'count':_0x159740,'rows':_0x429273}:null;}})[_0xb8dc('0x28')](respondWithResult(_0x407958,null))[_0xb8dc('0x49')](handleError(_0x407958,null));};exports[_0xb8dc('0x50')]=function(_0x1961f3,_0x2718f7,_0x4d7ef0){var _0xb408ad={};var _0x623986={};var _0x2a2e4d;var _0x58be37;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x1961f3[_0xb8dc('0x46')]['id']}})[_0xb8dc('0x28')](handleEntityNotFound(_0x2718f7,null))[_0xb8dc('0x28')](function(_0x382392){if(_0x382392){_0x2a2e4d=_0x382392;_0x623986[_0xb8dc('0x33')]=_[_0xb8dc('0x47')](db[_0xb8dc('0x51')]['rawAttributes']);_0x623986[_0xb8dc('0x34')]=_[_0xb8dc('0x47')](_0x1961f3[_0xb8dc('0x34')]);_0x623986['filters']=_[_0xb8dc('0x35')](_0x623986['model'],_0x623986[_0xb8dc('0x34')]);_0xb408ad[_0xb8dc('0x36')]=_[_0xb8dc('0x35')](_0x623986['model'],qs[_0xb8dc('0x37')](_0x1961f3[_0xb8dc('0x34')]['fields']));_0xb408ad['attributes']=_0xb408ad['attributes'][_0xb8dc('0x4e')]?_0xb408ad[_0xb8dc('0x36')]:_0x623986[_0xb8dc('0x33')];_0xb408ad[_0xb8dc('0x39')]=qs[_0xb8dc('0x3a')](_0x1961f3[_0xb8dc('0x34')][_0xb8dc('0x3a')]);_0xb408ad['where']=qs[_0xb8dc('0x3c')](_[_0xb8dc('0x3d')](_0x1961f3[_0xb8dc('0x34')],_0x623986[_0xb8dc('0x3c')]));if(_0x1961f3['query'][_0xb8dc('0x3e')]){_0xb408ad[_0xb8dc('0x3b')]=_['merge'](_0xb408ad[_0xb8dc('0x3b')],{'$or':_[_0xb8dc('0x2e')](_0xb408ad[_0xb8dc('0x36')],function(_0xfa0d62){var _0x747981={};_0x747981[_0xfa0d62]={'$like':'%'+_0x1961f3['query'][_0xb8dc('0x3e')]+'%'};return _0x747981;})});}_0xb408ad=_[_0xb8dc('0x3f')]({},_0xb408ad,_0x1961f3['options']);return _0x2a2e4d[_0xb8dc('0x50')](_0xb408ad);}})[_0xb8dc('0x28')](function(_0x6961c2){if(_0x6961c2){_0x58be37=_0x6961c2[_0xb8dc('0x4e')];if(!_0x1961f3[_0xb8dc('0x34')][_0xb8dc('0x38')](_0xb8dc('0x4f'))){_0xb408ad[_0xb8dc('0x20')]=qs[_0xb8dc('0x20')](_0x1961f3[_0xb8dc('0x34')]['limit']);_0xb408ad['offset']=qs[_0xb8dc('0x1f')](_0x1961f3[_0xb8dc('0x34')][_0xb8dc('0x1f')]);}return _0x2a2e4d[_0xb8dc('0x50')](_0xb408ad);}})[_0xb8dc('0x28')](function(_0x34178a){if(_0x34178a){return _0x34178a?{'count':_0x58be37,'rows':_0x34178a}:null;}})[_0xb8dc('0x28')](respondWithResult(_0x2718f7,null))[_0xb8dc('0x49')](handleError(_0x2718f7,null));};exports[_0xb8dc('0x52')]=function(_0x2208fa,_0x1d1169,_0x70c819){var _0x19949f={};var _0x48896e={};var _0x108ae5;var _0x2b6868;return db[_0xb8dc('0x2f')][_0xb8dc('0x4d')]({'where':{'id':_0x2208fa[_0xb8dc('0x46')]['id']}})[_0xb8dc('0x28')](handleEntityNotFound(_0x1d1169,null))[_0xb8dc('0x28')](function(_0x54e81c){if(_0x54e81c){_0x108ae5=_0x54e81c;_0x48896e[_0xb8dc('0x33')]=_[_0xb8dc('0x47')](db[_0xb8dc('0x51')]['rawAttributes']);_0x48896e[_0xb8dc('0x34')]=_[_0xb8dc('0x47')](_0x2208fa[_0xb8dc('0x34')]);_0x48896e[_0xb8dc('0x3c')]=_[_0xb8dc('0x35')](_0x48896e[_0xb8dc('0x33')],_0x48896e[_0xb8dc('0x34')]);_0x19949f[_0xb8dc('0x36')]=_['intersection'](_0x48896e[_0xb8dc('0x33')],qs[_0xb8dc('0x37')](_0x2208fa[_0xb8dc('0x34')][_0xb8dc('0x37')]));_0x19949f[_0xb8dc('0x36')]=_0x19949f['attributes'][_0xb8dc('0x4e')]?_0x19949f['attributes']:_0x48896e[_0xb8dc('0x33')];_0x19949f[_0xb8dc('0x39')]=qs['sort'](_0x2208fa[_0xb8dc('0x34')][_0xb8dc('0x3a')]);_0x19949f[_0xb8dc('0x3b')]=qs['filters'](_[_0xb8dc('0x3d')](_0x2208fa[_0xb8dc('0x34')],_0x48896e[_0xb8dc('0x3c')]));if(_0x2208fa['query'][_0xb8dc('0x3e')]){_0x19949f[_0xb8dc('0x3b')]=_[_0xb8dc('0x3f')](_0x19949f[_0xb8dc('0x3b')],{'$or':_['map'](_0x19949f[_0xb8dc('0x36')],function(_0x2d8f5c){var _0x4ab02c={};_0x4ab02c[_0x2d8f5c]={'$like':'%'+_0x2208fa[_0xb8dc('0x34')]['filter']+'%'};return _0x4ab02c;})});}_0x19949f=_[_0xb8dc('0x3f')]({},_0x19949f,_0x2208fa[_0xb8dc('0x40')]);return _0x108ae5['getDescriptions'](_0x19949f);}})['then'](function(_0x585684){if(_0x585684){_0x2b6868=_0x585684[_0xb8dc('0x4e')];if(!_0x2208fa[_0xb8dc('0x34')][_0xb8dc('0x38')](_0xb8dc('0x4f'))){_0x19949f[_0xb8dc('0x20')]=qs[_0xb8dc('0x20')](_0x2208fa[_0xb8dc('0x34')]['limit']);_0x19949f[_0xb8dc('0x1f')]=qs[_0xb8dc('0x1f')](_0x2208fa[_0xb8dc('0x34')][_0xb8dc('0x1f')]);}return _0x108ae5[_0xb8dc('0x52')](_0x19949f);}})['then'](function(_0x23c5d6){if(_0x23c5d6){return _0x23c5d6?{'count':_0x2b6868,'rows':_0x23c5d6}:null;}})['then'](respondWithResult(_0x1d1169,null))[_0xb8dc('0x49')](handleError(_0x1d1169,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index e55c852..7867cfa 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 _0xb821=['rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util','../../config/logger','bluebird'];(function(_0x3ee92f,_0x3d8f79){var _0x32f48c=function(_0x3d73f7){while(--_0x3d73f7){_0x3ee92f['push'](_0x3ee92f['shift']());}};_0x32f48c(++_0x3d8f79);}(_0xb821,0xa7));var _0x1b82=function(_0x5099cc,_0x17933e){_0x5099cc=_0x5099cc-0x0;var _0x29e1d4=_0xb821[_0x5099cc];return _0x29e1d4;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var logger=require(_0x1b82('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1b82('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1b82('0x3'));var config=require(_0x1b82('0x4'));var attributes=require(_0x1b82('0x5'));module[_0x1b82('0x6')]=function(_0x597ca7,_0x3e27c4){return _0x597ca7[_0x1b82('0x7')](_0x1b82('0x8'),attributes,{'tableName':_0x1b82('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a19=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x9a19,0x114));var _0x99a1=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x9a19[_0xd09668];return _0x68726;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var logger=require(_0x99a1('0x2'))('api');var moment=require(_0x99a1('0x3'));var BPromise=require(_0x99a1('0x4'));var rp=require(_0x99a1('0x5'));var fs=require('fs');var path=require(_0x99a1('0x6'));var rimraf=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var attributes=require(_0x99a1('0x9'));module[_0x99a1('0xa')]=function(_0x3eff4a,_0xff0240){return _0x3eff4a[_0x99a1('0xb')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 3444d03..fd7b215 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 _0xf133=['request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http'];(function(_0xd091df,_0x846582){var _0xe84de1=function(_0x22625e){while(--_0x22625e){_0xd091df['push'](_0xd091df['shift']());}};_0xe84de1(++_0x846582);}(_0xf133,0xde));var _0x3f13=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xf133[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0x3f13('0x0'));var util=require(_0x3f13('0x1'));var moment=require('moment');var BPromise=require(_0x3f13('0x2'));var rs=require(_0x3f13('0x3'));var fs=require('fs');var Redis=require(_0x3f13('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3f13('0x5'));var logger=require(_0x3f13('0x6'))(_0x3f13('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3f13('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b4036,_0x1f6800,_0x1ab24d){return new BPromise(function(_0x2e7a6e,_0x4cb688){return client[_0x3f13('0x9')](_0x5b4036,_0x1ab24d)[_0x3f13('0xa')](function(_0x1ab3bf){logger[_0x3f13('0xb')](_0x3f13('0xc'),_0x1f6800,_0x3f13('0xd'));logger[_0x3f13('0xe')](_0x3f13('0xf'),_0x1f6800,_0x3f13('0xd'),JSON[_0x3f13('0x10')](_0x1ab3bf));if(_0x1ab3bf[_0x3f13('0x11')]){if(_0x1ab3bf[_0x3f13('0x11')]['code']===0x1f4){logger[_0x3f13('0x11')](_0x3f13('0xc'),_0x1f6800,_0x1ab3bf[_0x3f13('0x11')][_0x3f13('0x12')]);return _0x4cb688(_0x1ab3bf['error']['message']);}logger[_0x3f13('0x11')](_0x3f13('0xc'),_0x1f6800,_0x1ab3bf[_0x3f13('0x11')][_0x3f13('0x12')]);return _0x2e7a6e(_0x1ab3bf['error']['message']);}else{logger[_0x3f13('0xb')](_0x3f13('0xc'),_0x1f6800,_0x3f13('0xd'));_0x2e7a6e(_0x1ab3bf[_0x3f13('0x13')][_0x3f13('0x12')]);}})[_0x3f13('0x14')](function(_0x267eee){logger[_0x3f13('0x11')](_0x3f13('0xc'),_0x1f6800,_0x267eee);_0x4cb688(_0x267eee);});});} \ No newline at end of file +var _0x4d85=['moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util'];(function(_0x3b2244,_0x54873f){var _0x2dcc14=function(_0x53d73f){while(--_0x53d73f){_0x3b2244['push'](_0x3b2244['shift']());}};_0x2dcc14(++_0x54873f);}(_0x4d85,0x12e));var _0x54d8=function(_0x41d505,_0x4bb480){_0x41d505=_0x41d505-0x0;var _0x45e857=_0x4d85[_0x41d505];return _0x45e857;};'use strict';var _=require(_0x54d8('0x0'));var util=require(_0x54d8('0x1'));var moment=require(_0x54d8('0x2'));var BPromise=require(_0x54d8('0x3'));var rs=require(_0x54d8('0x4'));var fs=require('fs');var Redis=require(_0x54d8('0x5'));var db=require(_0x54d8('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x54d8('0x7'));var config=require(_0x54d8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x54d8('0x9')][_0x54d8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf122ca,_0x2ef417,_0x518b6d){return new BPromise(function(_0xd93e8b,_0x4fac01){return client['request'](_0xf122ca,_0x518b6d)['then'](function(_0x1c25b0){logger[_0x54d8('0xb')](_0x54d8('0xc'),_0x2ef417,_0x54d8('0xd'));logger['debug'](_0x54d8('0xe'),_0x2ef417,_0x54d8('0xd'),JSON[_0x54d8('0xf')](_0x1c25b0));if(_0x1c25b0[_0x54d8('0x10')]){if(_0x1c25b0[_0x54d8('0x10')][_0x54d8('0x11')]===0x1f4){logger[_0x54d8('0x10')](_0x54d8('0xc'),_0x2ef417,_0x1c25b0[_0x54d8('0x10')][_0x54d8('0x12')]);return _0x4fac01(_0x1c25b0[_0x54d8('0x10')][_0x54d8('0x12')]);}logger[_0x54d8('0x10')](_0x54d8('0xc'),_0x2ef417,_0x1c25b0['error'][_0x54d8('0x12')]);return _0xd93e8b(_0x1c25b0[_0x54d8('0x10')][_0x54d8('0x12')]);}else{logger[_0x54d8('0xb')](_0x54d8('0xc'),_0x2ef417,_0x54d8('0xd'));_0xd93e8b(_0x1c25b0['result'][_0x54d8('0x12')]);}})['catch'](function(_0x16cf18){logger['error'](_0x54d8('0xc'),_0x2ef417,_0x16cf18);_0x4fac01(_0x16cf18);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 4c0afd5..8591a20 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 _0xc869=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','/:id','post','create','put','destroy','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x145f2e,_0x579aae){var _0x56d433=function(_0x260dc8){while(--_0x260dc8){_0x145f2e['push'](_0x145f2e['shift']());}};_0x56d433(++_0x579aae);}(_0xc869,0x192));var _0x9c86=function(_0x3d12d2,_0x39d83a){_0x3d12d2=_0x3d12d2-0x0;var _0x26e06f=_0xc869[_0x3d12d2];return _0x26e06f;};'use strict';var multer=require(_0x9c86('0x0'));var util=require('util');var path=require(_0x9c86('0x1'));var timeout=require(_0x9c86('0x2'));var express=require(_0x9c86('0x3'));var router=express[_0x9c86('0x4')]();var fs_extra=require(_0x9c86('0x5'));var auth=require(_0x9c86('0x6'));var interaction=require(_0x9c86('0x7'));var config=require(_0x9c86('0x8'));var controller=require(_0x9c86('0x9'));router[_0x9c86('0xa')]('/',auth[_0x9c86('0xb')](),controller['index']);router[_0x9c86('0xa')](_0x9c86('0xc'),auth[_0x9c86('0xb')](),controller['show']);router[_0x9c86('0xd')]('/',auth[_0x9c86('0xb')](),controller[_0x9c86('0xe')]);router[_0x9c86('0xf')](_0x9c86('0xc'),auth[_0x9c86('0xb')](),controller['update']);router['delete']('/:id',auth[_0x9c86('0xb')](),controller[_0x9c86('0x10')]);module['exports']=router; \ No newline at end of file +var _0x6e8f=['../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x401c21,_0x2e16d5){var _0x1a320e=function(_0x48065e){while(--_0x48065e){_0x401c21['push'](_0x401c21['shift']());}};_0x1a320e(++_0x2e16d5);}(_0x6e8f,0x13d));var _0xf6e8=function(_0x2bfab4,_0xa044e4){_0x2bfab4=_0x2bfab4-0x0;var _0x26b2f3=_0x6e8f[_0x2bfab4];return _0x26b2f3;};'use strict';var multer=require(_0xf6e8('0x0'));var util=require(_0xf6e8('0x1'));var path=require(_0xf6e8('0x2'));var timeout=require(_0xf6e8('0x3'));var express=require('express');var router=express[_0xf6e8('0x4')]();var fs_extra=require(_0xf6e8('0x5'));var auth=require(_0xf6e8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf6e8('0x7'));var controller=require(_0xf6e8('0x8'));router[_0xf6e8('0x9')]('/',auth[_0xf6e8('0xa')](),controller[_0xf6e8('0xb')]);router[_0xf6e8('0x9')](_0xf6e8('0xc'),auth[_0xf6e8('0xa')](),controller[_0xf6e8('0xd')]);router[_0xf6e8('0xe')]('/',auth[_0xf6e8('0xa')](),controller[_0xf6e8('0xf')]);router[_0xf6e8('0x10')](_0xf6e8('0xc'),auth[_0xf6e8('0xa')](),controller['update']);router['delete'](_0xf6e8('0xc'),auth[_0xf6e8('0xa')](),controller[_0xf6e8('0x11')]);module[_0xf6e8('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index f50e460..d885ce2 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 _0x38bc=['sequelize','exports','ENUM','string','variable','STRING','customVariable'];(function(_0x6173fc,_0x32aadf){var _0x965fbe=function(_0x50d5b3){while(--_0x50d5b3){_0x6173fc['push'](_0x6173fc['shift']());}};_0x965fbe(++_0x32aadf);}(_0x38bc,0x9a));var _0xc38b=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x38bc[_0x2261ce];return _0x524640;};'use strict';var Sequelize=require(_0xc38b('0x0'));module[_0xc38b('0x1')]={'type':{'type':Sequelize[_0xc38b('0x2')](_0xc38b('0x3'),_0xc38b('0x4'),'customVariable','keyValue','picklist'),'defaultValue':_0xc38b('0x3')},'content':{'type':Sequelize[_0xc38b('0x5')]},'key':{'type':Sequelize[_0xc38b('0x5')]},'keyType':{'type':Sequelize[_0xc38b('0x2')](_0xc38b('0x3'),_0xc38b('0x4'),_0xc38b('0x6'))},'keyContent':{'type':Sequelize[_0xc38b('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xc38b('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc38b('0x5')]}}; \ No newline at end of file +var _0x378f=['STRING','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x39c469,_0x38c16f){var _0x1405d5=function(_0x3e3508){while(--_0x3e3508){_0x39c469['push'](_0x39c469['shift']());}};_0x1405d5(++_0x38c16f);}(_0x378f,0x1cf));var _0xf378=function(_0x4ae6de,_0x41c995){_0x4ae6de=_0x4ae6de-0x0;var _0x180782=_0x378f[_0x4ae6de];return _0x180782;};'use strict';var Sequelize=require('sequelize');module[_0xf378('0x0')]={'type':{'type':Sequelize[_0xf378('0x1')](_0xf378('0x2'),_0xf378('0x3'),_0xf378('0x4'),'keyValue',_0xf378('0x5')),'defaultValue':_0xf378('0x2')},'content':{'type':Sequelize[_0xf378('0x6')]},'key':{'type':Sequelize[_0xf378('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xf378('0x2'),_0xf378('0x3'),_0xf378('0x4'))},'keyContent':{'type':Sequelize[_0xf378('0x6')]},'idField':{'type':Sequelize[_0xf378('0x6')]},'nameField':{'type':Sequelize[_0xf378('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf378('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 9061bc5..9d4f812 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 _0x5bb5=['mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x2fa876,_0x5b27f4){var _0x1d5c8c=function(_0x459dd6){while(--_0x459dd6){_0x2fa876['push'](_0x2fa876['shift']());}};_0x1d5c8c(++_0x5b27f4);}(_0x5bb5,0x1ce));var _0x55bb=function(_0x2b5606,_0x412aad){_0x2b5606=_0x2b5606-0x0;var _0x12a38c=_0x5bb5[_0x2b5606];return _0x12a38c;};'use strict';var emlformat=require(_0x55bb('0x0'));var rimraf=require(_0x55bb('0x1'));var zipdir=require(_0x55bb('0x2'));var jsonpatch=require(_0x55bb('0x3'));var rp=require('request-promise');var moment=require(_0x55bb('0x4'));var BPromise=require(_0x55bb('0x5'));var Mustache=require(_0x55bb('0x6'));var util=require(_0x55bb('0x7'));var path=require(_0x55bb('0x8'));var sox=require(_0x55bb('0x9'));var csv=require('to-csv');var ejs=require(_0x55bb('0xa'));var fs=require('fs');var fs_extra=require(_0x55bb('0xb'));var _=require(_0x55bb('0xc'));var squel=require(_0x55bb('0xd'));var crypto=require('crypto');var jsforce=require(_0x55bb('0xe'));var deskjs=require(_0x55bb('0xf'));var toCsv=require(_0x55bb('0x10'));var querystring=require(_0x55bb('0x11'));var Papa=require(_0x55bb('0x12'));var Redis=require(_0x55bb('0x13'));var authService=require(_0x55bb('0x14'));var qs=require(_0x55bb('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x55bb('0x16'))(_0x55bb('0x17'));var utils=require(_0x55bb('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x55bb('0x19'));var db=require(_0x55bb('0x1a'))['db'];function respondWithStatusCode(_0x20d60d,_0x4bf230){_0x4bf230=_0x4bf230||0xcc;return function(_0x36f1dd){if(_0x36f1dd){return _0x20d60d[_0x55bb('0x1b')](_0x4bf230);}return _0x20d60d[_0x55bb('0x1c')](_0x4bf230)[_0x55bb('0x1d')]();};}function respondWithResult(_0x37a2dc,_0x226221){_0x226221=_0x226221||0xc8;return function(_0x56a62a){if(_0x56a62a){return _0x37a2dc[_0x55bb('0x1c')](_0x226221)[_0x55bb('0x1e')](_0x56a62a);}};}function respondWithFilteredResult(_0x10f7f1,_0x33a6ba){return function(_0x48b2bd){if(_0x48b2bd){var _0x9d8bd8=typeof _0x33a6ba[_0x55bb('0x1f')]===_0x55bb('0x20')&&typeof _0x33a6ba[_0x55bb('0x21')]===_0x55bb('0x20');var _0x55a31d=_0x48b2bd[_0x55bb('0x22')];var _0x1ad623=_0x9d8bd8?0x0:_0x33a6ba['offset'];var _0x208960=_0x9d8bd8?_0x48b2bd[_0x55bb('0x22')]:_0x33a6ba[_0x55bb('0x1f')]+_0x33a6ba['limit'];var _0x3ae019;if(_0x208960>=_0x55a31d){_0x208960=_0x55a31d;_0x3ae019=0xc8;}else{_0x3ae019=0xce;}_0x10f7f1[_0x55bb('0x1c')](_0x3ae019);return _0x10f7f1[_0x55bb('0x23')](_0x55bb('0x24'),_0x1ad623+'-'+_0x208960+'/'+_0x55a31d)[_0x55bb('0x1e')](_0x48b2bd);}return null;};}function patchUpdates(_0x191ce3){return function(_0x3f2713){try{jsonpatch['apply'](_0x3f2713,_0x191ce3,!![]);}catch(_0x2ec442){return BPromise['reject'](_0x2ec442);}return _0x3f2713[_0x55bb('0x25')]();};}function saveUpdates(_0x481e10,_0x37e885){return function(_0x2660c8){if(_0x2660c8){return _0x2660c8[_0x55bb('0x26')](_0x481e10)['then'](function(_0x24ceab){return _0x24ceab;});}return null;};}function removeEntity(_0x45b9ec,_0x392b04){return function(_0x5d3391){if(_0x5d3391){return _0x5d3391[_0x55bb('0x27')]()[_0x55bb('0x28')](function(){_0x45b9ec[_0x55bb('0x1c')](0xcc)[_0x55bb('0x1d')]();});}};}function handleEntityNotFound(_0x4f0c2a,_0x4d331d){return function(_0x4dfab1){if(!_0x4dfab1){_0x4f0c2a[_0x55bb('0x1b')](0x194);}return _0x4dfab1;};}function handleError(_0x45d625,_0x56c3cd){_0x56c3cd=_0x56c3cd||0x1f4;return function(_0x32023d){logger['error'](_0x32023d['stack']);if(_0x32023d[_0x55bb('0x29')]){delete _0x32023d[_0x55bb('0x29')];}_0x45d625[_0x55bb('0x1c')](_0x56c3cd)[_0x55bb('0x2a')](_0x32023d);};}exports[_0x55bb('0x2b')]=function(_0x538a64,_0x38d820){var _0x56948f={},_0x316591={},_0x425e00={'count':0x0,'rows':[]};var _0x1316ae=_[_0x55bb('0x2c')](db[_0x55bb('0x2d')][_0x55bb('0x2e')],function(_0x5b5cc0){return{'name':_0x5b5cc0[_0x55bb('0x2f')],'type':_0x5b5cc0[_0x55bb('0x30')][_0x55bb('0x31')]};});_0x316591['model']=_[_0x55bb('0x2c')](_0x1316ae,'name');_0x316591['query']=_[_0x55bb('0x32')](_0x538a64['query']);_0x316591[_0x55bb('0x33')]=_[_0x55bb('0x34')](_0x316591[_0x55bb('0x35')],_0x316591[_0x55bb('0x36')]);_0x56948f['attributes']=_[_0x55bb('0x34')](_0x316591['model'],qs[_0x55bb('0x37')](_0x538a64[_0x55bb('0x36')][_0x55bb('0x37')]));_0x56948f[_0x55bb('0x38')]=_0x56948f[_0x55bb('0x38')][_0x55bb('0x39')]?_0x56948f[_0x55bb('0x38')]:_0x316591[_0x55bb('0x35')];if(!_0x538a64[_0x55bb('0x36')][_0x55bb('0x3a')](_0x55bb('0x3b'))){_0x56948f[_0x55bb('0x21')]=qs['limit'](_0x538a64[_0x55bb('0x36')][_0x55bb('0x21')]);_0x56948f[_0x55bb('0x1f')]=qs[_0x55bb('0x1f')](_0x538a64[_0x55bb('0x36')][_0x55bb('0x1f')]);}_0x56948f[_0x55bb('0x3c')]=qs[_0x55bb('0x3d')](_0x538a64[_0x55bb('0x36')][_0x55bb('0x3d')]);_0x56948f[_0x55bb('0x3e')]=qs[_0x55bb('0x33')](_[_0x55bb('0x3f')](_0x538a64[_0x55bb('0x36')],_0x316591[_0x55bb('0x33')]),_0x1316ae);if(_0x538a64[_0x55bb('0x36')][_0x55bb('0x40')]){_0x56948f[_0x55bb('0x3e')]=_[_0x55bb('0x41')](_0x56948f[_0x55bb('0x3e')],{'$or':_[_0x55bb('0x2c')](_0x1316ae,function(_0x197309){if(_0x197309[_0x55bb('0x30')]!==_0x55bb('0x42')){var _0x1b563c={};_0x1b563c[_0x197309[_0x55bb('0x29')]]={'$like':'%'+_0x538a64['query'][_0x55bb('0x40')]+'%'};return _0x1b563c;}})});}_0x56948f=_[_0x55bb('0x41')]({},_0x56948f,_0x538a64[_0x55bb('0x43')]);var _0x3c465f={'where':_0x56948f[_0x55bb('0x3e')]};return db[_0x55bb('0x2d')][_0x55bb('0x22')](_0x3c465f)['then'](function(_0x49f247){_0x425e00[_0x55bb('0x22')]=_0x49f247;if(_0x538a64[_0x55bb('0x36')]['includeAll']){_0x56948f[_0x55bb('0x44')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x55bb('0x45')](_0x56948f);})[_0x55bb('0x28')](function(_0x4fac4d){_0x425e00[_0x55bb('0x46')]=_0x4fac4d;return _0x425e00;})[_0x55bb('0x28')](respondWithFilteredResult(_0x38d820,_0x56948f))['catch'](handleError(_0x38d820,null));};exports[_0x55bb('0x47')]=function(_0x17ff06,_0x425112){var _0x2a7dc4={'raw':!![],'where':{'id':_0x17ff06[_0x55bb('0x48')]['id']}},_0x1b40e4={};_0x1b40e4[_0x55bb('0x35')]=_['keys'](db[_0x55bb('0x2d')]['rawAttributes']);_0x1b40e4['query']=_[_0x55bb('0x32')](_0x17ff06[_0x55bb('0x36')]);_0x1b40e4[_0x55bb('0x33')]=_[_0x55bb('0x34')](_0x1b40e4[_0x55bb('0x35')],_0x1b40e4[_0x55bb('0x36')]);_0x2a7dc4[_0x55bb('0x38')]=_[_0x55bb('0x34')](_0x1b40e4[_0x55bb('0x35')],qs[_0x55bb('0x37')](_0x17ff06[_0x55bb('0x36')][_0x55bb('0x37')]));_0x2a7dc4[_0x55bb('0x38')]=_0x2a7dc4[_0x55bb('0x38')][_0x55bb('0x39')]?_0x2a7dc4[_0x55bb('0x38')]:_0x1b40e4[_0x55bb('0x35')];if(_0x17ff06[_0x55bb('0x36')][_0x55bb('0x49')]){_0x2a7dc4[_0x55bb('0x44')]=[{'all':!![]}];}_0x2a7dc4=_[_0x55bb('0x41')]({},_0x2a7dc4,_0x17ff06[_0x55bb('0x43')]);return db['Dynamics365Field']['find'](_0x2a7dc4)['then'](handleEntityNotFound(_0x425112,null))[_0x55bb('0x28')](respondWithResult(_0x425112,null))[_0x55bb('0x4a')](handleError(_0x425112,null));};exports['create']=function(_0x202dca,_0x4aac20){return db[_0x55bb('0x2d')][_0x55bb('0x4b')](_0x202dca['body'],{})[_0x55bb('0x28')](respondWithResult(_0x4aac20,0xc9))['catch'](handleError(_0x4aac20,null));};exports[_0x55bb('0x26')]=function(_0x444d3e,_0x3db83c){if(_0x444d3e[_0x55bb('0x4c')]['id']){delete _0x444d3e[_0x55bb('0x4c')]['id'];}return db['Dynamics365Field'][_0x55bb('0x4d')]({'where':{'id':_0x444d3e[_0x55bb('0x48')]['id']}})[_0x55bb('0x28')](handleEntityNotFound(_0x3db83c,null))[_0x55bb('0x28')](saveUpdates(_0x444d3e['body'],null))[_0x55bb('0x28')](respondWithResult(_0x3db83c,null))['catch'](handleError(_0x3db83c,null));};exports[_0x55bb('0x27')]=function(_0x20490d,_0x2a3bea){return db['Dynamics365Field'][_0x55bb('0x4d')]({'where':{'id':_0x20490d[_0x55bb('0x48')]['id']}})[_0x55bb('0x28')](handleEntityNotFound(_0x2a3bea,null))[_0x55bb('0x28')](removeEntity(_0x2a3bea,null))[_0x55bb('0x4a')](handleError(_0x2a3bea,null));}; \ No newline at end of file +var _0x91f0=['show','params','keys','attributes','length','find','create','body','destroy','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','index','Dynamics365Field','rawAttributes','fieldName','type','key','model','map','filters','intersection','query','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch'];(function(_0x33dcf7,_0x3d5390){var _0x542d4e=function(_0x281250){while(--_0x281250){_0x33dcf7['push'](_0x33dcf7['shift']());}};_0x542d4e(++_0x3d5390);}(_0x91f0,0x131));var _0x091f=function(_0x339f57,_0x372158){_0x339f57=_0x339f57-0x0;var _0x5a54ae=_0x91f0[_0x339f57];return _0x5a54ae;};'use strict';var emlformat=require(_0x091f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x091f('0x1'));var rp=require(_0x091f('0x2'));var moment=require(_0x091f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x091f('0x4'));var util=require(_0x091f('0x5'));var path=require(_0x091f('0x6'));var sox=require(_0x091f('0x7'));var csv=require('to-csv');var ejs=require(_0x091f('0x8'));var fs=require('fs');var fs_extra=require(_0x091f('0x9'));var _=require(_0x091f('0xa'));var squel=require(_0x091f('0xb'));var crypto=require(_0x091f('0xc'));var jsforce=require(_0x091f('0xd'));var deskjs=require(_0x091f('0xe'));var toCsv=require(_0x091f('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x091f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x091f('0x11'));var as=require(_0x091f('0x12'));var hardwareService=require(_0x091f('0x13'));var logger=require(_0x091f('0x14'))(_0x091f('0x15'));var utils=require('../../config/utils');var config=require(_0x091f('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d4c16,_0x1bc533){_0x1bc533=_0x1bc533||0xcc;return function(_0x95de90){if(_0x95de90){return _0x5d4c16['sendStatus'](_0x1bc533);}return _0x5d4c16[_0x091f('0x17')](_0x1bc533)[_0x091f('0x18')]();};}function respondWithResult(_0x27ddeb,_0x6e7b03){_0x6e7b03=_0x6e7b03||0xc8;return function(_0x3687a6){if(_0x3687a6){return _0x27ddeb[_0x091f('0x17')](_0x6e7b03)['json'](_0x3687a6);}};}function respondWithFilteredResult(_0x3c4141,_0x2fbc6a){return function(_0x4a3fb4){if(_0x4a3fb4){var _0x1d654=typeof _0x2fbc6a['offset']===_0x091f('0x19')&&typeof _0x2fbc6a[_0x091f('0x1a')]===_0x091f('0x19');var _0x32c091=_0x4a3fb4[_0x091f('0x1b')];var _0x60c2ae=_0x1d654?0x0:_0x2fbc6a[_0x091f('0x1c')];var _0x584aee=_0x1d654?_0x4a3fb4[_0x091f('0x1b')]:_0x2fbc6a['offset']+_0x2fbc6a[_0x091f('0x1a')];var _0x49d76b;if(_0x584aee>=_0x32c091){_0x584aee=_0x32c091;_0x49d76b=0xc8;}else{_0x49d76b=0xce;}_0x3c4141[_0x091f('0x17')](_0x49d76b);return _0x3c4141[_0x091f('0x1d')](_0x091f('0x1e'),_0x60c2ae+'-'+_0x584aee+'/'+_0x32c091)['json'](_0x4a3fb4);}return null;};}function patchUpdates(_0x5eb8d7){return function(_0xe94049){try{jsonpatch[_0x091f('0x1f')](_0xe94049,_0x5eb8d7,!![]);}catch(_0x2cb8e2){return BPromise[_0x091f('0x20')](_0x2cb8e2);}return _0xe94049['save']();};}function saveUpdates(_0x2af04a,_0x19204a){return function(_0x194cc8){if(_0x194cc8){return _0x194cc8[_0x091f('0x21')](_0x2af04a)[_0x091f('0x22')](function(_0x49fed8){return _0x49fed8;});}return null;};}function removeEntity(_0x1bbc36,_0x592331){return function(_0x536fcd){if(_0x536fcd){return _0x536fcd['destroy']()[_0x091f('0x22')](function(){_0x1bbc36[_0x091f('0x17')](0xcc)[_0x091f('0x18')]();});}};}function handleEntityNotFound(_0x52aa0f,_0x41b312){return function(_0x41f0f3){if(!_0x41f0f3){_0x52aa0f[_0x091f('0x23')](0x194);}return _0x41f0f3;};}function handleError(_0x337db8,_0x449731){_0x449731=_0x449731||0x1f4;return function(_0x284aec){logger[_0x091f('0x24')](_0x284aec[_0x091f('0x25')]);if(_0x284aec[_0x091f('0x26')]){delete _0x284aec[_0x091f('0x26')];}_0x337db8[_0x091f('0x17')](_0x449731)[_0x091f('0x27')](_0x284aec);};}exports[_0x091f('0x28')]=function(_0x54320e,_0x14ddb8){var _0xc61567={},_0x19968c={},_0x29bf48={'count':0x0,'rows':[]};var _0x4edfe4=_['map'](db[_0x091f('0x29')][_0x091f('0x2a')],function(_0x4078d1){return{'name':_0x4078d1[_0x091f('0x2b')],'type':_0x4078d1[_0x091f('0x2c')][_0x091f('0x2d')]};});_0x19968c[_0x091f('0x2e')]=_[_0x091f('0x2f')](_0x4edfe4,_0x091f('0x26'));_0x19968c['query']=_['keys'](_0x54320e['query']);_0x19968c[_0x091f('0x30')]=_[_0x091f('0x31')](_0x19968c[_0x091f('0x2e')],_0x19968c[_0x091f('0x32')]);_0xc61567['attributes']=_['intersection'](_0x19968c[_0x091f('0x2e')],qs[_0x091f('0x33')](_0x54320e[_0x091f('0x32')]['fields']));_0xc61567['attributes']=_0xc61567['attributes']['length']?_0xc61567['attributes']:_0x19968c[_0x091f('0x2e')];if(!_0x54320e[_0x091f('0x32')]['hasOwnProperty'](_0x091f('0x34'))){_0xc61567[_0x091f('0x1a')]=qs[_0x091f('0x1a')](_0x54320e['query']['limit']);_0xc61567[_0x091f('0x1c')]=qs[_0x091f('0x1c')](_0x54320e[_0x091f('0x32')][_0x091f('0x1c')]);}_0xc61567[_0x091f('0x35')]=qs[_0x091f('0x36')](_0x54320e[_0x091f('0x32')][_0x091f('0x36')]);_0xc61567[_0x091f('0x37')]=qs[_0x091f('0x30')](_[_0x091f('0x38')](_0x54320e[_0x091f('0x32')],_0x19968c[_0x091f('0x30')]),_0x4edfe4);if(_0x54320e[_0x091f('0x32')][_0x091f('0x39')]){_0xc61567[_0x091f('0x37')]=_[_0x091f('0x3a')](_0xc61567[_0x091f('0x37')],{'$or':_[_0x091f('0x2f')](_0x4edfe4,function(_0x54dc7c){if(_0x54dc7c[_0x091f('0x2c')]!==_0x091f('0x3b')){var _0x3097fb={};_0x3097fb[_0x54dc7c[_0x091f('0x26')]]={'$like':'%'+_0x54320e[_0x091f('0x32')]['filter']+'%'};return _0x3097fb;}})});}_0xc61567=_[_0x091f('0x3a')]({},_0xc61567,_0x54320e[_0x091f('0x3c')]);var _0x51919e={'where':_0xc61567[_0x091f('0x37')]};return db[_0x091f('0x29')][_0x091f('0x1b')](_0x51919e)[_0x091f('0x22')](function(_0x1c3d58){_0x29bf48[_0x091f('0x1b')]=_0x1c3d58;if(_0x54320e['query'][_0x091f('0x3d')]){_0xc61567['include']=[{'all':!![]}];}return db[_0x091f('0x29')][_0x091f('0x3e')](_0xc61567);})[_0x091f('0x22')](function(_0x21ac42){_0x29bf48[_0x091f('0x3f')]=_0x21ac42;return _0x29bf48;})['then'](respondWithFilteredResult(_0x14ddb8,_0xc61567))[_0x091f('0x40')](handleError(_0x14ddb8,null));};exports[_0x091f('0x41')]=function(_0x14c34b,_0x323359){var _0x23aaf8={'raw':!![],'where':{'id':_0x14c34b[_0x091f('0x42')]['id']}},_0x1f79d0={};_0x1f79d0[_0x091f('0x2e')]=_[_0x091f('0x43')](db[_0x091f('0x29')][_0x091f('0x2a')]);_0x1f79d0[_0x091f('0x32')]=_[_0x091f('0x43')](_0x14c34b[_0x091f('0x32')]);_0x1f79d0[_0x091f('0x30')]=_[_0x091f('0x31')](_0x1f79d0[_0x091f('0x2e')],_0x1f79d0[_0x091f('0x32')]);_0x23aaf8[_0x091f('0x44')]=_[_0x091f('0x31')](_0x1f79d0[_0x091f('0x2e')],qs[_0x091f('0x33')](_0x14c34b[_0x091f('0x32')][_0x091f('0x33')]));_0x23aaf8['attributes']=_0x23aaf8[_0x091f('0x44')][_0x091f('0x45')]?_0x23aaf8[_0x091f('0x44')]:_0x1f79d0['model'];if(_0x14c34b[_0x091f('0x32')][_0x091f('0x3d')]){_0x23aaf8['include']=[{'all':!![]}];}_0x23aaf8=_[_0x091f('0x3a')]({},_0x23aaf8,_0x14c34b[_0x091f('0x3c')]);return db[_0x091f('0x29')][_0x091f('0x46')](_0x23aaf8)[_0x091f('0x22')](handleEntityNotFound(_0x323359,null))[_0x091f('0x22')](respondWithResult(_0x323359,null))['catch'](handleError(_0x323359,null));};exports[_0x091f('0x47')]=function(_0x5985ca,_0x5c8606){return db[_0x091f('0x29')][_0x091f('0x47')](_0x5985ca['body'],{})['then'](respondWithResult(_0x5c8606,0xc9))[_0x091f('0x40')](handleError(_0x5c8606,null));};exports['update']=function(_0x5f3f17,_0xc31775){if(_0x5f3f17[_0x091f('0x48')]['id']){delete _0x5f3f17[_0x091f('0x48')]['id'];}return db[_0x091f('0x29')][_0x091f('0x46')]({'where':{'id':_0x5f3f17['params']['id']}})['then'](handleEntityNotFound(_0xc31775,null))[_0x091f('0x22')](saveUpdates(_0x5f3f17[_0x091f('0x48')],null))[_0x091f('0x22')](respondWithResult(_0xc31775,null))[_0x091f('0x40')](handleError(_0xc31775,null));};exports[_0x091f('0x49')]=function(_0x351671,_0x3cb3ac){return db[_0x091f('0x29')][_0x091f('0x46')]({'where':{'id':_0x351671[_0x091f('0x42')]['id']}})['then'](handleEntityNotFound(_0x3cb3ac,null))['then'](removeEntity(_0x3cb3ac,null))[_0x091f('0x40')](handleError(_0x3cb3ac,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 9701a6e..1c18c4e 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 _0xb817=['path','rimraf','../../config/environment','exports','define','dynamics365_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird'];(function(_0x156110,_0xfed2fd){var _0x49e51b=function(_0x21f6ab){while(--_0x21f6ab){_0x156110['push'](_0x156110['shift']());}};_0x49e51b(++_0xfed2fd);}(_0xb817,0x8a));var _0x7b81=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb817[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7b81('0x0'));var util=require('util');var logger=require(_0x7b81('0x1'))(_0x7b81('0x2'));var moment=require(_0x7b81('0x3'));var BPromise=require(_0x7b81('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7b81('0x5'));var rimraf=require(_0x7b81('0x6'));var config=require(_0x7b81('0x7'));var attributes=require('./intDynamics365Field.attributes');module[_0x7b81('0x8')]=function(_0x1c4f06,_0x3a6aaf){return _0x1c4f06[_0x7b81('0x9')]('Dynamics365Field',attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x7b81('0xa'),'fields':[_0x7b81('0xb'),_0x7b81('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7c14=['lodash','util','../../config/logger','request-promise','path','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId'];(function(_0x2309db,_0x2ac192){var _0x28fcb2=function(_0x562ce0){while(--_0x562ce0){_0x2309db['push'](_0x2309db['shift']());}};_0x28fcb2(++_0x2ac192);}(_0x7c14,0xea));var _0x47c1=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x7c14[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x47c1('0x0'));var util=require(_0x47c1('0x1'));var logger=require(_0x47c1('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x47c1('0x3'));var fs=require('fs');var path=require(_0x47c1('0x4'));var rimraf=require('rimraf');var config=require(_0x47c1('0x5'));var attributes=require(_0x47c1('0x6'));module[_0x47c1('0x7')]=function(_0x537fc1,_0x5aa2f6){return _0x537fc1['define'](_0x47c1('0x8'),attributes,{'tableName':_0x47c1('0x9'),'paranoid':![],'indexes':[{'name':_0x47c1('0xa'),'fields':[_0x47c1('0xb'),_0x47c1('0xc')],'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 189171a..46fb8a1 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 _0x4985=['randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','bluebird'];(function(_0x5abb9c,_0x32f2eb){var _0x33916e=function(_0x1f45ef){while(--_0x1f45ef){_0x5abb9c['push'](_0x5abb9c['shift']());}};_0x33916e(++_0x32f2eb);}(_0x4985,0x142));var _0x5498=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x4985[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x5498('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5498('0x1'));var rs=require(_0x5498('0x2'));var fs=require('fs');var Redis=require(_0x5498('0x3'));var db=require(_0x5498('0x4'))['db'];var utils=require(_0x5498('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x5498('0x6'));var client=jayson['client'][_0x5498('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4f9068,_0x204a04,_0x1e3dfc){return new BPromise(function(_0x3bb2db,_0xa54ca0){return client['request'](_0x4f9068,_0x1e3dfc)['then'](function(_0x52d926){logger[_0x5498('0x8')](_0x5498('0x9'),_0x204a04,_0x5498('0xa'));logger[_0x5498('0xb')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x204a04,_0x5498('0xa'),JSON[_0x5498('0xc')](_0x52d926));if(_0x52d926[_0x5498('0xd')]){if(_0x52d926[_0x5498('0xd')][_0x5498('0xe')]===0x1f4){logger[_0x5498('0xd')](_0x5498('0x9'),_0x204a04,_0x52d926[_0x5498('0xd')][_0x5498('0xf')]);return _0xa54ca0(_0x52d926[_0x5498('0xd')]['message']);}logger[_0x5498('0xd')](_0x5498('0x9'),_0x204a04,_0x52d926[_0x5498('0xd')]['message']);return _0x3bb2db(_0x52d926['error'][_0x5498('0xf')]);}else{logger[_0x5498('0x8')](_0x5498('0x9'),_0x204a04,_0x5498('0xa'));_0x3bb2db(_0x52d926[_0x5498('0x10')][_0x5498('0xf')]);}})[_0x5498('0x11')](function(_0xfc93ee){logger[_0x5498('0xd')](_0x5498('0x9'),_0x204a04,_0xfc93ee);_0xa54ca0(_0xfc93ee);});});} \ No newline at end of file +var _0x660b=['code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x415ba5,_0x54bcc0){var _0x30423e=function(_0x2fbea7){while(--_0x2fbea7){_0x415ba5['push'](_0x415ba5['shift']());}};_0x30423e(++_0x54bcc0);}(_0x660b,0xab));var _0xb660=function(_0x51462a,_0x1e978e){_0x51462a=_0x51462a-0x0;var _0x302a5e=_0x660b[_0x51462a];return _0x302a5e;};'use strict';var _=require(_0xb660('0x0'));var util=require(_0xb660('0x1'));var moment=require(_0xb660('0x2'));var BPromise=require(_0xb660('0x3'));var rs=require(_0xb660('0x4'));var fs=require('fs');var Redis=require(_0xb660('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb660('0x6'));var config=require(_0xb660('0x7'));var jayson=require(_0xb660('0x8'));var client=jayson[_0xb660('0x9')][_0xb660('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f40ad,_0x25898b,_0x5b39bc){return new BPromise(function(_0x4ffd4b,_0x5ad882){return client[_0xb660('0xb')](_0x3f40ad,_0x5b39bc)['then'](function(_0x2a9b5d){logger[_0xb660('0xc')](_0xb660('0xd'),_0x25898b,_0xb660('0xe'));logger[_0xb660('0xf')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x25898b,_0xb660('0xe'),JSON[_0xb660('0x10')](_0x2a9b5d));if(_0x2a9b5d[_0xb660('0x11')]){if(_0x2a9b5d[_0xb660('0x11')][_0xb660('0x12')]===0x1f4){logger['error'](_0xb660('0xd'),_0x25898b,_0x2a9b5d[_0xb660('0x11')][_0xb660('0x13')]);return _0x5ad882(_0x2a9b5d['error'][_0xb660('0x13')]);}logger[_0xb660('0x11')](_0xb660('0xd'),_0x25898b,_0x2a9b5d[_0xb660('0x11')][_0xb660('0x13')]);return _0x4ffd4b(_0x2a9b5d[_0xb660('0x11')][_0xb660('0x13')]);}else{logger[_0xb660('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x25898b,'request\x20sent');_0x4ffd4b(_0x2a9b5d['result'][_0xb660('0x13')]);}})[_0xb660('0x14')](function(_0x191837){logger['error'](_0xb660('0xd'),_0x25898b,_0x191837);_0x5ad882(_0x191837);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index ab1a991..2fbcbb1 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 _0x4525=['/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','create','addConfiguration','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get'];(function(_0x390c42,_0x10e1ae){var _0x43894c=function(_0x510bd0){while(--_0x510bd0){_0x390c42['push'](_0x390c42['shift']());}};_0x43894c(++_0x10e1ae);}(_0x4525,0x145));var _0x5452=function(_0x17a77f,_0x4a1499){_0x17a77f=_0x17a77f-0x0;var _0x28362e=_0x4525[_0x17a77f];return _0x28362e;};'use strict';var multer=require(_0x5452('0x0'));var util=require('util');var path=require(_0x5452('0x1'));var timeout=require(_0x5452('0x2'));var express=require(_0x5452('0x3'));var router=express[_0x5452('0x4')]();var fs_extra=require(_0x5452('0x5'));var auth=require(_0x5452('0x6'));var interaction=require(_0x5452('0x7'));var config=require(_0x5452('0x8'));var controller=require(_0x5452('0x9'));router[_0x5452('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5452('0xa')](_0x5452('0xb'),auth['isAuthenticated'](),controller[_0x5452('0xc')]);router[_0x5452('0xa')](_0x5452('0xd'),auth[_0x5452('0xe')](),controller[_0x5452('0xf')]);router[_0x5452('0xa')](_0x5452('0x10'),auth[_0x5452('0xe')](),controller[_0x5452('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5452('0x12')]);router['post']('/:id/configurations',auth[_0x5452('0xe')](),controller[_0x5452('0x13')]);router[_0x5452('0x14')]('/:id',auth[_0x5452('0xe')](),controller[_0x5452('0x15')]);router[_0x5452('0x16')]('/:id',auth[_0x5452('0xe')](),controller[_0x5452('0x17')]);module['exports']=router; \ No newline at end of file +var _0xbe2a=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x6aef36,_0x501c76){var _0x29132a=function(_0x31b92a){while(--_0x31b92a){_0x6aef36['push'](_0x6aef36['shift']());}};_0x29132a(++_0x501c76);}(_0xbe2a,0x164));var _0xabe2=function(_0x31cf9d,_0x15832d){_0x31cf9d=_0x31cf9d-0x0;var _0x1162e8=_0xbe2a[_0x31cf9d];return _0x1162e8;};'use strict';var multer=require(_0xabe2('0x0'));var util=require(_0xabe2('0x1'));var path=require(_0xabe2('0x2'));var timeout=require(_0xabe2('0x3'));var express=require(_0xabe2('0x4'));var router=express[_0xabe2('0x5')]();var fs_extra=require(_0xabe2('0x6'));var auth=require(_0xabe2('0x7'));var interaction=require(_0xabe2('0x8'));var config=require(_0xabe2('0x9'));var controller=require('./intFreshdeskAccount.controller');router[_0xabe2('0xa')]('/',auth['isAuthenticated'](),controller[_0xabe2('0xb')]);router[_0xabe2('0xa')](_0xabe2('0xc'),auth[_0xabe2('0xd')](),controller['show']);router['get']('/:id/configurations',auth[_0xabe2('0xd')](),controller[_0xabe2('0xe')]);router[_0xabe2('0xa')](_0xabe2('0xf'),auth['isAuthenticated'](),controller[_0xabe2('0x10')]);router[_0xabe2('0x11')]('/',auth['isAuthenticated'](),controller[_0xabe2('0x12')]);router[_0xabe2('0x11')]('/:id/configurations',auth[_0xabe2('0xd')](),controller[_0xabe2('0x13')]);router[_0xabe2('0x14')](_0xabe2('0xc'),auth[_0xabe2('0xd')](),controller['update']);router[_0xabe2('0x15')](_0xabe2('0xc'),auth[_0xabe2('0xd')](),controller[_0xabe2('0x16')]);module[_0xabe2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 43fda6f..996cca5 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 _0x8e3f=['STRING','username','remoteUri','sequelize','exports'];(function(_0x1b3f9a,_0x49848d){var _0x5f5aaf=function(_0x302613){while(--_0x302613){_0x1b3f9a['push'](_0x1b3f9a['shift']());}};_0x5f5aaf(++_0x49848d);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8e3f[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xf8e3('0x0'));module[_0xf8e3('0x1')]={'name':{'type':Sequelize[_0xf8e3('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf8e3('0x2')],'unique':_0xf8e3('0x3')},'apiKey':{'type':Sequelize[_0xf8e3('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xf8e3('0x4')},'serverUrl':{'type':Sequelize[_0xf8e3('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x7096=['exports','STRING','username','remoteUri'];(function(_0x2e9a07,_0x5ce478){var _0x22e52d=function(_0x3071bb){while(--_0x3071bb){_0x2e9a07['push'](_0x2e9a07['shift']());}};_0x22e52d(++_0x5ce478);}(_0x7096,0x10c));var _0x6709=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7096[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require('sequelize');module[_0x6709('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6709('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x6709('0x2')},'apiKey':{'type':Sequelize[_0x6709('0x1')]},'remoteUri':{'type':Sequelize[_0x6709('0x1')],'unique':_0x6709('0x3')},'serverUrl':{'type':Sequelize[_0x6709('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 64762d5..7e5e6d2 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 _0x2c1b=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','params','length','options','create','body','find','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','api/v2/ticket_fields','%s:X','toString','requester','subject','description','priority','group','source','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','count','limit','Content-Range','save','update','then','destroy','error','stack','name','index','map','FreshdeskAccount','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes'];(function(_0x82140,_0x3a9d87){var _0x2b15a6=function(_0x2b565e){while(--_0x2b565e){_0x82140['push'](_0x82140['shift']());}};_0x2b15a6(++_0x3a9d87);}(_0x2c1b,0xb0));var _0xb2c1=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x2c1b[_0xda464c];return _0x19e222;};'use strict';var emlformat=require(_0xb2c1('0x0'));var rimraf=require(_0xb2c1('0x1'));var zipdir=require(_0xb2c1('0x2'));var jsonpatch=require(_0xb2c1('0x3'));var rp=require(_0xb2c1('0x4'));var moment=require(_0xb2c1('0x5'));var BPromise=require(_0xb2c1('0x6'));var Mustache=require('mustache');var util=require(_0xb2c1('0x7'));var path=require(_0xb2c1('0x8'));var sox=require(_0xb2c1('0x9'));var csv=require(_0xb2c1('0xa'));var ejs=require(_0xb2c1('0xb'));var fs=require('fs');var fs_extra=require(_0xb2c1('0xc'));var _=require(_0xb2c1('0xd'));var squel=require(_0xb2c1('0xe'));var crypto=require(_0xb2c1('0xf'));var jsforce=require(_0xb2c1('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb2c1('0x11'));var Papa=require(_0xb2c1('0x12'));var Redis=require(_0xb2c1('0x13'));var authService=require(_0xb2c1('0x14'));var qs=require(_0xb2c1('0x15'));var as=require(_0xb2c1('0x16'));var hardwareService=require(_0xb2c1('0x17'));var logger=require(_0xb2c1('0x18'))('api');var utils=require(_0xb2c1('0x19'));var config=require(_0xb2c1('0x1a'));var licenseUtil=require(_0xb2c1('0x1b'));var db=require(_0xb2c1('0x1c'))['db'];var integrations=require(_0xb2c1('0x1d'));function respondWithStatusCode(_0x4cc09b,_0x404159){_0x404159=_0x404159||0xcc;return function(_0x2089b8){if(_0x2089b8){return _0x4cc09b[_0xb2c1('0x1e')](_0x404159);}return _0x4cc09b['status'](_0x404159)[_0xb2c1('0x1f')]();};}function respondWithResult(_0x4470e5,_0x22a2b3){_0x22a2b3=_0x22a2b3||0xc8;return function(_0x3aa5a0){if(_0x3aa5a0){return _0x4470e5[_0xb2c1('0x20')](_0x22a2b3)[_0xb2c1('0x21')](_0x3aa5a0);}};}function respondWithFilteredResult(_0x2b4d8f,_0x46d620){return function(_0x1e26f3){if(_0x1e26f3){var _0x57f436=typeof _0x46d620[_0xb2c1('0x22')]==='undefined'&&typeof _0x46d620['limit']==='undefined';var _0x54ada3=_0x1e26f3['count'];var _0x2253df=_0x57f436?0x0:_0x46d620[_0xb2c1('0x22')];var _0x3b0d33=_0x57f436?_0x1e26f3[_0xb2c1('0x23')]:_0x46d620[_0xb2c1('0x22')]+_0x46d620[_0xb2c1('0x24')];var _0x466675;if(_0x3b0d33>=_0x54ada3){_0x3b0d33=_0x54ada3;_0x466675=0xc8;}else{_0x466675=0xce;}_0x2b4d8f[_0xb2c1('0x20')](_0x466675);return _0x2b4d8f['set'](_0xb2c1('0x25'),_0x2253df+'-'+_0x3b0d33+'/'+_0x54ada3)[_0xb2c1('0x21')](_0x1e26f3);}return null;};}function patchUpdates(_0x2af0fa){return function(_0xc63278){try{jsonpatch['apply'](_0xc63278,_0x2af0fa,!![]);}catch(_0x2c8540){return BPromise['reject'](_0x2c8540);}return _0xc63278[_0xb2c1('0x26')]();};}function saveUpdates(_0x31ae39,_0x2f6c51){return function(_0xdb75b5){if(_0xdb75b5){return _0xdb75b5[_0xb2c1('0x27')](_0x31ae39)[_0xb2c1('0x28')](function(_0x4af0bd){return _0x4af0bd;});}return null;};}function removeEntity(_0xc3f671,_0x40dac3){return function(_0x11b9b2){if(_0x11b9b2){return _0x11b9b2[_0xb2c1('0x29')]()[_0xb2c1('0x28')](function(){_0xc3f671['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e8853,_0x4b69e6){return function(_0x403339){if(!_0x403339){_0x1e8853['sendStatus'](0x194);}return _0x403339;};}function handleError(_0x3c85c3,_0xe4bcba){_0xe4bcba=_0xe4bcba||0x1f4;return function(_0x11ba1c){logger[_0xb2c1('0x2a')](_0x11ba1c[_0xb2c1('0x2b')]);if(_0x11ba1c[_0xb2c1('0x2c')]){delete _0x11ba1c[_0xb2c1('0x2c')];}_0x3c85c3['status'](_0xe4bcba)['send'](_0x11ba1c);};}exports[_0xb2c1('0x2d')]=function(_0x56f382,_0x2ca910){var _0x39c7cc={},_0x5da5e4={},_0x125bc0={'count':0x0,'rows':[]};var _0x3cc864=_[_0xb2c1('0x2e')](db[_0xb2c1('0x2f')][_0xb2c1('0x30')],function(_0x1feb6a){return{'name':_0x1feb6a['fieldName'],'type':_0x1feb6a[_0xb2c1('0x31')][_0xb2c1('0x32')]};});_0x5da5e4[_0xb2c1('0x33')]=_[_0xb2c1('0x2e')](_0x3cc864,_0xb2c1('0x2c'));_0x5da5e4[_0xb2c1('0x34')]=_[_0xb2c1('0x35')](_0x56f382[_0xb2c1('0x34')]);_0x5da5e4[_0xb2c1('0x36')]=_[_0xb2c1('0x37')](_0x5da5e4[_0xb2c1('0x33')],_0x5da5e4[_0xb2c1('0x34')]);_0x39c7cc['attributes']=_[_0xb2c1('0x37')](_0x5da5e4[_0xb2c1('0x33')],qs[_0xb2c1('0x38')](_0x56f382['query'][_0xb2c1('0x38')]));_0x39c7cc[_0xb2c1('0x39')]=_0x39c7cc[_0xb2c1('0x39')]['length']?_0x39c7cc[_0xb2c1('0x39')]:_0x5da5e4[_0xb2c1('0x33')];if(!_0x56f382[_0xb2c1('0x34')][_0xb2c1('0x3a')](_0xb2c1('0x3b'))){_0x39c7cc['limit']=qs[_0xb2c1('0x24')](_0x56f382[_0xb2c1('0x34')]['limit']);_0x39c7cc[_0xb2c1('0x22')]=qs[_0xb2c1('0x22')](_0x56f382['query'][_0xb2c1('0x22')]);}_0x39c7cc[_0xb2c1('0x3c')]=qs[_0xb2c1('0x3d')](_0x56f382[_0xb2c1('0x34')]['sort']);_0x39c7cc[_0xb2c1('0x3e')]=qs[_0xb2c1('0x36')](_[_0xb2c1('0x3f')](_0x56f382[_0xb2c1('0x34')],_0x5da5e4['filters']),_0x3cc864);if(_0x56f382[_0xb2c1('0x34')][_0xb2c1('0x40')]){_0x39c7cc[_0xb2c1('0x3e')]=_[_0xb2c1('0x41')](_0x39c7cc[_0xb2c1('0x3e')],{'$or':_['map'](_0x3cc864,function(_0x4096d9){if(_0x4096d9['type']!==_0xb2c1('0x42')){var _0x30df12={};_0x30df12[_0x4096d9[_0xb2c1('0x2c')]]={'$like':'%'+_0x56f382[_0xb2c1('0x34')][_0xb2c1('0x40')]+'%'};return _0x30df12;}})});}_0x39c7cc=_[_0xb2c1('0x41')]({},_0x39c7cc,_0x56f382['options']);var _0x36a3a6={'where':_0x39c7cc['where']};return db[_0xb2c1('0x2f')][_0xb2c1('0x23')](_0x36a3a6)[_0xb2c1('0x28')](function(_0x364a82){_0x125bc0[_0xb2c1('0x23')]=_0x364a82;if(_0x56f382[_0xb2c1('0x34')][_0xb2c1('0x43')]){_0x39c7cc[_0xb2c1('0x44')]=[{'all':!![]}];}return db[_0xb2c1('0x2f')][_0xb2c1('0x45')](_0x39c7cc);})[_0xb2c1('0x28')](function(_0x36ed8e){_0x125bc0['rows']=_0x36ed8e;return _0x125bc0;})[_0xb2c1('0x28')](respondWithFilteredResult(_0x2ca910,_0x39c7cc))[_0xb2c1('0x46')](handleError(_0x2ca910,null));};exports['show']=function(_0x2e2cf1,_0x14c76b){var _0x2e546e={'raw':![],'where':{'id':_0x2e2cf1[_0xb2c1('0x47')]['id']}},_0x303ed6={};_0x303ed6['model']=_['keys'](db[_0xb2c1('0x2f')][_0xb2c1('0x30')]);_0x303ed6[_0xb2c1('0x34')]=_['keys'](_0x2e2cf1[_0xb2c1('0x34')]);_0x303ed6['filters']=_[_0xb2c1('0x37')](_0x303ed6[_0xb2c1('0x33')],_0x303ed6['query']);_0x2e546e[_0xb2c1('0x39')]=_['intersection'](_0x303ed6['model'],qs[_0xb2c1('0x38')](_0x2e2cf1[_0xb2c1('0x34')][_0xb2c1('0x38')]));_0x2e546e[_0xb2c1('0x39')]=_0x2e546e[_0xb2c1('0x39')][_0xb2c1('0x48')]?_0x2e546e[_0xb2c1('0x39')]:_0x303ed6[_0xb2c1('0x33')];if(_0x2e2cf1[_0xb2c1('0x34')][_0xb2c1('0x43')]){_0x2e546e['include']=[{'all':!![]}];}_0x2e546e=_[_0xb2c1('0x41')]({},_0x2e546e,_0x2e2cf1[_0xb2c1('0x49')]);return db[_0xb2c1('0x2f')]['find'](_0x2e546e)[_0xb2c1('0x28')](handleEntityNotFound(_0x14c76b,null))['then'](respondWithResult(_0x14c76b,null))[_0xb2c1('0x46')](handleError(_0x14c76b,null));};exports['create']=function(_0x2c4ab2,_0x41d2b4){return db[_0xb2c1('0x2f')][_0xb2c1('0x4a')](_0x2c4ab2[_0xb2c1('0x4b')],{})[_0xb2c1('0x28')](respondWithResult(_0x41d2b4,0xc9))['catch'](handleError(_0x41d2b4,null));};exports[_0xb2c1('0x27')]=function(_0xf730c3,_0x4d997d){if(_0xf730c3[_0xb2c1('0x4b')]['id']){delete _0xf730c3['body']['id'];}return db['FreshdeskAccount'][_0xb2c1('0x4c')]({'where':{'id':_0xf730c3[_0xb2c1('0x47')]['id']}})[_0xb2c1('0x28')](handleEntityNotFound(_0x4d997d,null))[_0xb2c1('0x28')](saveUpdates(_0xf730c3[_0xb2c1('0x4b')],null))['then'](respondWithResult(_0x4d997d,null))[_0xb2c1('0x46')](handleError(_0x4d997d,null));};exports['destroy']=function(_0x608db8,_0x2d4c27){return db[_0xb2c1('0x2f')][_0xb2c1('0x4c')]({'where':{'id':_0x608db8[_0xb2c1('0x47')]['id']}})['then'](handleEntityNotFound(_0x2d4c27,null))['then'](removeEntity(_0x2d4c27,null))[_0xb2c1('0x46')](handleError(_0x2d4c27,null));};exports['getConfigurations']=function(_0x40fc0b,_0x52ec95,_0x31f891){var _0x31c796={};var _0x26232e={};var _0x134d2d;var _0x99ec3d;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x40fc0b[_0xb2c1('0x47')]['id']}})[_0xb2c1('0x28')](handleEntityNotFound(_0x52ec95,null))[_0xb2c1('0x28')](function(_0x5e81e0){if(_0x5e81e0){_0x134d2d=_0x5e81e0;_0x26232e['model']=_[_0xb2c1('0x35')](db[_0xb2c1('0x4d')][_0xb2c1('0x30')]);_0x26232e[_0xb2c1('0x34')]=_[_0xb2c1('0x35')](_0x40fc0b['query']);_0x26232e[_0xb2c1('0x36')]=_['intersection'](_0x26232e['model'],_0x26232e[_0xb2c1('0x34')]);_0x31c796[_0xb2c1('0x39')]=_['intersection'](_0x26232e[_0xb2c1('0x33')],qs[_0xb2c1('0x38')](_0x40fc0b[_0xb2c1('0x34')]['fields']));_0x31c796[_0xb2c1('0x39')]=_0x31c796['attributes'][_0xb2c1('0x48')]?_0x31c796[_0xb2c1('0x39')]:_0x26232e[_0xb2c1('0x33')];_0x31c796[_0xb2c1('0x3c')]=qs[_0xb2c1('0x3d')](_0x40fc0b[_0xb2c1('0x34')][_0xb2c1('0x3d')]);_0x31c796[_0xb2c1('0x3e')]=qs[_0xb2c1('0x36')](_['pick'](_0x40fc0b[_0xb2c1('0x34')],_0x26232e[_0xb2c1('0x36')]));if(_0x40fc0b['query'][_0xb2c1('0x40')]){_0x31c796[_0xb2c1('0x3e')]=_['merge'](_0x31c796['where'],{'$or':_[_0xb2c1('0x2e')](_0x31c796[_0xb2c1('0x39')],function(_0x51f991){var _0x129f99={};_0x129f99[_0x51f991]={'$like':'%'+_0x40fc0b[_0xb2c1('0x34')][_0xb2c1('0x40')]+'%'};return _0x129f99;})});}_0x31c796=_['merge']({},_0x31c796,_0x40fc0b[_0xb2c1('0x49')]);return _0x134d2d['getConfigurations'](_0x31c796);}})[_0xb2c1('0x28')](function(_0x379a2d){if(_0x379a2d){_0x99ec3d=_0x379a2d[_0xb2c1('0x48')];if(!_0x40fc0b[_0xb2c1('0x34')][_0xb2c1('0x3a')](_0xb2c1('0x3b'))){_0x31c796[_0xb2c1('0x24')]=qs[_0xb2c1('0x24')](_0x40fc0b[_0xb2c1('0x34')]['limit']);_0x31c796[_0xb2c1('0x22')]=qs[_0xb2c1('0x22')](_0x40fc0b['query']['offset']);}return _0x134d2d['getConfigurations'](_0x31c796);}})[_0xb2c1('0x28')](function(_0x4130e2){if(_0x4130e2){return _0x4130e2?{'count':_0x99ec3d,'rows':_0x4130e2}:null;}})[_0xb2c1('0x28')](respondWithResult(_0x52ec95,null))[_0xb2c1('0x46')](handleError(_0x52ec95,null));};exports[_0xb2c1('0x4e')]=function(_0x3c092d,_0x258ad6,_0x2ad9db){if(_0x3c092d[_0xb2c1('0x4b')]['id']){delete _0x3c092d[_0xb2c1('0x4b')]['id'];}return db[_0xb2c1('0x2f')]['findOne']({'where':{'id':_0x3c092d[_0xb2c1('0x47')]['id']}})[_0xb2c1('0x28')](handleEntityNotFound(_0x258ad6,null))[_0xb2c1('0x28')](function(_0x47c57d){if(_0x47c57d){_0x3c092d[_0xb2c1('0x4b')][_0xb2c1('0x4f')]=_0x47c57d['id'];_0x3c092d['body'][_0xb2c1('0x50')]=integrations[_0xb2c1('0x51')](_0x3c092d[_0xb2c1('0x4b')][_0xb2c1('0x52')],_0x3c092d[_0xb2c1('0x4b')][_0xb2c1('0x31')]);_0x3c092d[_0xb2c1('0x4b')][_0xb2c1('0x53')]=integrations['getDescriptions'](_0x3c092d[_0xb2c1('0x4b')][_0xb2c1('0x52')],_0x3c092d[_0xb2c1('0x4b')][_0xb2c1('0x31')]);return db[_0xb2c1('0x4d')][_0xb2c1('0x4a')](_0x3c092d[_0xb2c1('0x4b')],{'include':[{'model':db[_0xb2c1('0x54')],'as':_0xb2c1('0x50')},{'model':db['FreshdeskField'],'as':_0xb2c1('0x53')}]});}return null;})[_0xb2c1('0x28')](respondWithResult(_0x258ad6,null))[_0xb2c1('0x46')](handleError(_0x258ad6,null));};exports[_0xb2c1('0x55')]=function(_0x4054d8,_0xed3912,_0x3af932){var _0x346429='';return db[_0xb2c1('0x2f')]['findOne']({'where':{'id':_0x4054d8[_0xb2c1('0x47')]['id']},'attributes':['id',_0xb2c1('0x56'),_0xb2c1('0x57')]})['then'](handleEntityNotFound(_0xed3912,null))['then'](function(_0x311c2d){if(_0x311c2d){_0x346429=_0x311c2d[_0xb2c1('0x56')];var _0xde80ce=_0x346429[_0xb2c1('0x58')](-0x1);if(_0xde80ce==='/'){_0x346429=_0x346429[_0xb2c1('0x59')](0x0,_0x346429[_0xb2c1('0x5a')](_0xde80ce));}return rp({'method':_0xb2c1('0x5b'),'uri':util[_0xb2c1('0x5c')]('%s/%s',_0x346429,_0xb2c1('0x5d')),'headers':{'Authorization':util[_0xb2c1('0x5c')]('Basic\x20%s',new Buffer(util['format'](_0xb2c1('0x5e'),_0x311c2d[_0xb2c1('0x57')]))[_0xb2c1('0x5f')]('base64'))},'json':!![]});}})[_0xb2c1('0x28')](function(_0x24d38f){if(_0x24d38f){var _0x523059=[_0xb2c1('0x60'),_0xb2c1('0x61'),'agent',_0xb2c1('0x62'),'status',_0xb2c1('0x63'),_0xb2c1('0x64'),_0xb2c1('0x65'),_0xb2c1('0x66'),_0xb2c1('0x64'),_0xb2c1('0x67')];_[_0xb2c1('0x68')](_0x24d38f,function(_0x162bca){return _0x523059[_0xb2c1('0x69')](_0x162bca[_0xb2c1('0x2c')])||!_0x162bca[_0xb2c1('0x6a')]&&_0x162bca[_0xb2c1('0x31')]!==_0xb2c1('0x6b')&&_0x162bca[_0xb2c1('0x31')]!==_0xb2c1('0x6c');});return{'count':_0x24d38f[_0xb2c1('0x48')],'rows':_[_0xb2c1('0x2e')](_0x24d38f,function(_0x1f21a0){return{'id':_0x1f21a0[_0xb2c1('0x2c')],'name':_0x1f21a0[_0xb2c1('0x6d')],'custom':!_0x1f21a0[_0xb2c1('0x6a')],'options':_0x1f21a0[_0xb2c1('0x6e')]?_[_0xb2c1('0x2e')](_0x1f21a0[_0xb2c1('0x6e')],function(_0x1aace6){return{'name':_[_0xb2c1('0x6f')](_0x1aace6),'value':_0x1aace6};}):[]};})};}})['then'](respondWithResult(_0xed3912,null))[_0xb2c1('0x46')](function(_0x1a8821){var _0x1f1dc1=_0x4054d8[_0xb2c1('0x34')][_0xb2c1('0x70')]?0x1f4:_0x1a8821[_0xb2c1('0x71')]||0x1f4;logger['error'](_0xb2c1('0x72'),_0xb2c1('0x55'),_0x1f1dc1,JSON[_0xb2c1('0x73')](_0x1a8821));delete _0x1a8821[_0xb2c1('0x2c')];if(_0x1f1dc1===0x191){_0x1f1dc1=0x190;}_0xed3912[_0xb2c1('0x20')](_0x1f1dc1)[_0xb2c1('0x74')](_0x4054d8[_0xb2c1('0x34')][_0xb2c1('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x1a8821[_0xb2c1('0x71')]}:_0x1a8821);});}; \ No newline at end of file +var _0x1be1=['send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','filter','merge','where','VIRTUAL','options','FreshdeskAccount','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','update','getConfigurations','findOne','FreshdeskConfiguration','pick','length','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','remoteUri','apiKey','slice','substring','api/v2/ticket_fields','format','Basic\x20%s','%s:X','toString','base64','subject','agent','description','group','source','ticket_type','company','remove','includes','default','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','limit','status','set','json','apply','reject','save','then','destroy','error','stack','name'];(function(_0x3d3715,_0x27e2ba){var _0x343802=function(_0x38dd89){while(--_0x38dd89){_0x3d3715['push'](_0x3d3715['shift']());}};_0x343802(++_0x27e2ba);}(_0x1be1,0x192));var _0x11be=function(_0x1c9a8d,_0x44f9eb){_0x1c9a8d=_0x1c9a8d-0x0;var _0x4bd1d7=_0x1be1[_0x1c9a8d];return _0x4bd1d7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x11be('0x0'));var jsonpatch=require(_0x11be('0x1'));var rp=require('request-promise');var moment=require(_0x11be('0x2'));var BPromise=require(_0x11be('0x3'));var Mustache=require(_0x11be('0x4'));var util=require(_0x11be('0x5'));var path=require('path');var sox=require(_0x11be('0x6'));var csv=require(_0x11be('0x7'));var ejs=require(_0x11be('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x11be('0x9'));var squel=require('squel');var crypto=require(_0x11be('0xa'));var jsforce=require(_0x11be('0xb'));var deskjs=require(_0x11be('0xc'));var toCsv=require(_0x11be('0x7'));var querystring=require(_0x11be('0xd'));var Papa=require('papaparse');var Redis=require(_0x11be('0xe'));var authService=require(_0x11be('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x11be('0x10'));var hardwareService=require(_0x11be('0x11'));var logger=require(_0x11be('0x12'))(_0x11be('0x13'));var utils=require('../../config/utils');var config=require(_0x11be('0x14'));var licenseUtil=require(_0x11be('0x15'));var db=require(_0x11be('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3ff31f,_0x2dad05){_0x2dad05=_0x2dad05||0xcc;return function(_0x4ce3ae){if(_0x4ce3ae){return _0x3ff31f[_0x11be('0x17')](_0x2dad05);}return _0x3ff31f['status'](_0x2dad05)['end']();};}function respondWithResult(_0x569842,_0x4b6e7e){_0x4b6e7e=_0x4b6e7e||0xc8;return function(_0x4e4efd){if(_0x4e4efd){return _0x569842['status'](_0x4b6e7e)['json'](_0x4e4efd);}};}function respondWithFilteredResult(_0x2280e2,_0x52bbef){return function(_0x31047c){if(_0x31047c){var _0x241eec=typeof _0x52bbef[_0x11be('0x18')]===_0x11be('0x19')&&typeof _0x52bbef['limit']===_0x11be('0x19');var _0x403d7a=_0x31047c['count'];var _0x299f45=_0x241eec?0x0:_0x52bbef[_0x11be('0x18')];var _0x23aa5f=_0x241eec?_0x31047c['count']:_0x52bbef['offset']+_0x52bbef[_0x11be('0x1a')];var _0x976e51;if(_0x23aa5f>=_0x403d7a){_0x23aa5f=_0x403d7a;_0x976e51=0xc8;}else{_0x976e51=0xce;}_0x2280e2[_0x11be('0x1b')](_0x976e51);return _0x2280e2[_0x11be('0x1c')]('Content-Range',_0x299f45+'-'+_0x23aa5f+'/'+_0x403d7a)[_0x11be('0x1d')](_0x31047c);}return null;};}function patchUpdates(_0x45136f){return function(_0x1c6dd4){try{jsonpatch[_0x11be('0x1e')](_0x1c6dd4,_0x45136f,!![]);}catch(_0x7c554a){return BPromise[_0x11be('0x1f')](_0x7c554a);}return _0x1c6dd4[_0x11be('0x20')]();};}function saveUpdates(_0x17678d,_0x3aea14){return function(_0x2782ae){if(_0x2782ae){return _0x2782ae['update'](_0x17678d)[_0x11be('0x21')](function(_0x46b7c2){return _0x46b7c2;});}return null;};}function removeEntity(_0x2fe43c,_0x5d1690){return function(_0x4b329b){if(_0x4b329b){return _0x4b329b[_0x11be('0x22')]()[_0x11be('0x21')](function(){_0x2fe43c[_0x11be('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x106167,_0x518e2b){return function(_0x46111f){if(!_0x46111f){_0x106167['sendStatus'](0x194);}return _0x46111f;};}function handleError(_0x28310d,_0xb11f3d){_0xb11f3d=_0xb11f3d||0x1f4;return function(_0x5002d7){logger[_0x11be('0x23')](_0x5002d7[_0x11be('0x24')]);if(_0x5002d7[_0x11be('0x25')]){delete _0x5002d7[_0x11be('0x25')];}_0x28310d[_0x11be('0x1b')](_0xb11f3d)[_0x11be('0x26')](_0x5002d7);};}exports[_0x11be('0x27')]=function(_0x2cf9aa,_0x43ab30){var _0x5966c5={},_0x32c796={},_0x4e899f={'count':0x0,'rows':[]};var _0x182f6b=_[_0x11be('0x28')](db['FreshdeskAccount']['rawAttributes'],function(_0x49fd5c){return{'name':_0x49fd5c[_0x11be('0x29')],'type':_0x49fd5c[_0x11be('0x2a')][_0x11be('0x2b')]};});_0x32c796[_0x11be('0x2c')]=_[_0x11be('0x28')](_0x182f6b,_0x11be('0x25'));_0x32c796[_0x11be('0x2d')]=_[_0x11be('0x2e')](_0x2cf9aa['query']);_0x32c796[_0x11be('0x2f')]=_[_0x11be('0x30')](_0x32c796[_0x11be('0x2c')],_0x32c796[_0x11be('0x2d')]);_0x5966c5[_0x11be('0x31')]=_[_0x11be('0x30')](_0x32c796['model'],qs[_0x11be('0x32')](_0x2cf9aa[_0x11be('0x2d')][_0x11be('0x32')]));_0x5966c5[_0x11be('0x31')]=_0x5966c5[_0x11be('0x31')]['length']?_0x5966c5[_0x11be('0x31')]:_0x32c796[_0x11be('0x2c')];if(!_0x2cf9aa[_0x11be('0x2d')]['hasOwnProperty'](_0x11be('0x33'))){_0x5966c5['limit']=qs['limit'](_0x2cf9aa['query']['limit']);_0x5966c5[_0x11be('0x18')]=qs[_0x11be('0x18')](_0x2cf9aa[_0x11be('0x2d')]['offset']);}_0x5966c5[_0x11be('0x34')]=qs[_0x11be('0x35')](_0x2cf9aa['query'][_0x11be('0x35')]);_0x5966c5['where']=qs[_0x11be('0x2f')](_['pick'](_0x2cf9aa[_0x11be('0x2d')],_0x32c796[_0x11be('0x2f')]),_0x182f6b);if(_0x2cf9aa[_0x11be('0x2d')][_0x11be('0x36')]){_0x5966c5['where']=_[_0x11be('0x37')](_0x5966c5[_0x11be('0x38')],{'$or':_[_0x11be('0x28')](_0x182f6b,function(_0x18d402){if(_0x18d402['type']!==_0x11be('0x39')){var _0x361877={};_0x361877[_0x18d402[_0x11be('0x25')]]={'$like':'%'+_0x2cf9aa[_0x11be('0x2d')][_0x11be('0x36')]+'%'};return _0x361877;}})});}_0x5966c5=_[_0x11be('0x37')]({},_0x5966c5,_0x2cf9aa[_0x11be('0x3a')]);var _0x5ee47c={'where':_0x5966c5[_0x11be('0x38')]};return db[_0x11be('0x3b')]['count'](_0x5ee47c)[_0x11be('0x21')](function(_0x28df0f){_0x4e899f['count']=_0x28df0f;if(_0x2cf9aa[_0x11be('0x2d')]['includeAll']){_0x5966c5[_0x11be('0x3c')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x11be('0x3d')](_0x5966c5);})[_0x11be('0x21')](function(_0x5db494){_0x4e899f[_0x11be('0x3e')]=_0x5db494;return _0x4e899f;})['then'](respondWithFilteredResult(_0x43ab30,_0x5966c5))[_0x11be('0x3f')](handleError(_0x43ab30,null));};exports[_0x11be('0x40')]=function(_0x2deae3,_0x383604){var _0x2b847a={'raw':![],'where':{'id':_0x2deae3[_0x11be('0x41')]['id']}},_0x182c28={};_0x182c28['model']=_[_0x11be('0x2e')](db[_0x11be('0x3b')][_0x11be('0x42')]);_0x182c28[_0x11be('0x2d')]=_['keys'](_0x2deae3['query']);_0x182c28['filters']=_[_0x11be('0x30')](_0x182c28['model'],_0x182c28[_0x11be('0x2d')]);_0x2b847a['attributes']=_[_0x11be('0x30')](_0x182c28[_0x11be('0x2c')],qs[_0x11be('0x32')](_0x2deae3[_0x11be('0x2d')][_0x11be('0x32')]));_0x2b847a[_0x11be('0x31')]=_0x2b847a[_0x11be('0x31')]['length']?_0x2b847a[_0x11be('0x31')]:_0x182c28['model'];if(_0x2deae3[_0x11be('0x2d')][_0x11be('0x43')]){_0x2b847a[_0x11be('0x3c')]=[{'all':!![]}];}_0x2b847a=_['merge']({},_0x2b847a,_0x2deae3['options']);return db['FreshdeskAccount'][_0x11be('0x44')](_0x2b847a)[_0x11be('0x21')](handleEntityNotFound(_0x383604,null))['then'](respondWithResult(_0x383604,null))['catch'](handleError(_0x383604,null));};exports['create']=function(_0x44e2e8,_0x1dfece){return db[_0x11be('0x3b')][_0x11be('0x45')](_0x44e2e8[_0x11be('0x46')],{})[_0x11be('0x21')](respondWithResult(_0x1dfece,0xc9))[_0x11be('0x3f')](handleError(_0x1dfece,null));};exports[_0x11be('0x47')]=function(_0x2ce110,_0x205582){if(_0x2ce110[_0x11be('0x46')]['id']){delete _0x2ce110['body']['id'];}return db[_0x11be('0x3b')][_0x11be('0x44')]({'where':{'id':_0x2ce110['params']['id']}})['then'](handleEntityNotFound(_0x205582,null))['then'](saveUpdates(_0x2ce110[_0x11be('0x46')],null))['then'](respondWithResult(_0x205582,null))[_0x11be('0x3f')](handleError(_0x205582,null));};exports[_0x11be('0x22')]=function(_0x2716dc,_0x1fb48d){return db[_0x11be('0x3b')][_0x11be('0x44')]({'where':{'id':_0x2716dc[_0x11be('0x41')]['id']}})[_0x11be('0x21')](handleEntityNotFound(_0x1fb48d,null))[_0x11be('0x21')](removeEntity(_0x1fb48d,null))['catch'](handleError(_0x1fb48d,null));};exports[_0x11be('0x48')]=function(_0x4ad866,_0x1737ef,_0x2e74f0){var _0x5a776a={};var _0x46f15b={};var _0x1164a4;var _0x4c0e37;return db[_0x11be('0x3b')][_0x11be('0x49')]({'where':{'id':_0x4ad866['params']['id']}})['then'](handleEntityNotFound(_0x1737ef,null))[_0x11be('0x21')](function(_0x2886ac){if(_0x2886ac){_0x1164a4=_0x2886ac;_0x46f15b['model']=_['keys'](db[_0x11be('0x4a')][_0x11be('0x42')]);_0x46f15b[_0x11be('0x2d')]=_['keys'](_0x4ad866['query']);_0x46f15b['filters']=_[_0x11be('0x30')](_0x46f15b[_0x11be('0x2c')],_0x46f15b[_0x11be('0x2d')]);_0x5a776a['attributes']=_['intersection'](_0x46f15b[_0x11be('0x2c')],qs[_0x11be('0x32')](_0x4ad866[_0x11be('0x2d')][_0x11be('0x32')]));_0x5a776a['attributes']=_0x5a776a[_0x11be('0x31')]['length']?_0x5a776a['attributes']:_0x46f15b['model'];_0x5a776a['order']=qs[_0x11be('0x35')](_0x4ad866[_0x11be('0x2d')][_0x11be('0x35')]);_0x5a776a[_0x11be('0x38')]=qs[_0x11be('0x2f')](_[_0x11be('0x4b')](_0x4ad866[_0x11be('0x2d')],_0x46f15b['filters']));if(_0x4ad866['query'][_0x11be('0x36')]){_0x5a776a[_0x11be('0x38')]=_[_0x11be('0x37')](_0x5a776a[_0x11be('0x38')],{'$or':_[_0x11be('0x28')](_0x5a776a[_0x11be('0x31')],function(_0xb56259){var _0x3816ab={};_0x3816ab[_0xb56259]={'$like':'%'+_0x4ad866[_0x11be('0x2d')]['filter']+'%'};return _0x3816ab;})});}_0x5a776a=_[_0x11be('0x37')]({},_0x5a776a,_0x4ad866[_0x11be('0x3a')]);return _0x1164a4[_0x11be('0x48')](_0x5a776a);}})['then'](function(_0x3b3cf9){if(_0x3b3cf9){_0x4c0e37=_0x3b3cf9[_0x11be('0x4c')];if(!_0x4ad866['query']['hasOwnProperty'](_0x11be('0x33'))){_0x5a776a[_0x11be('0x1a')]=qs[_0x11be('0x1a')](_0x4ad866[_0x11be('0x2d')]['limit']);_0x5a776a[_0x11be('0x18')]=qs[_0x11be('0x18')](_0x4ad866[_0x11be('0x2d')][_0x11be('0x18')]);}return _0x1164a4[_0x11be('0x48')](_0x5a776a);}})[_0x11be('0x21')](function(_0x44c88d){if(_0x44c88d){return _0x44c88d?{'count':_0x4c0e37,'rows':_0x44c88d}:null;}})[_0x11be('0x21')](respondWithResult(_0x1737ef,null))[_0x11be('0x3f')](handleError(_0x1737ef,null));};exports['addConfiguration']=function(_0x558a57,_0x9237ea,_0x138156){if(_0x558a57['body']['id']){delete _0x558a57[_0x11be('0x46')]['id'];}return db[_0x11be('0x3b')][_0x11be('0x49')]({'where':{'id':_0x558a57[_0x11be('0x41')]['id']}})[_0x11be('0x21')](handleEntityNotFound(_0x9237ea,null))[_0x11be('0x21')](function(_0x308599){if(_0x308599){_0x558a57['body']['AccountId']=_0x308599['id'];_0x558a57[_0x11be('0x46')][_0x11be('0x4d')]=integrations[_0x11be('0x4e')](_0x558a57['body'][_0x11be('0x4f')],_0x558a57[_0x11be('0x46')][_0x11be('0x2a')]);_0x558a57[_0x11be('0x46')][_0x11be('0x50')]=integrations[_0x11be('0x51')](_0x558a57[_0x11be('0x46')][_0x11be('0x4f')],_0x558a57[_0x11be('0x46')][_0x11be('0x2a')]);return db[_0x11be('0x4a')][_0x11be('0x45')](_0x558a57[_0x11be('0x46')],{'include':[{'model':db[_0x11be('0x52')],'as':_0x11be('0x4d')},{'model':db[_0x11be('0x52')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x9237ea,null))[_0x11be('0x3f')](handleError(_0x9237ea,null));};exports['getFields']=function(_0x1c92cd,_0xbe1daf,_0x422e33){var _0x2f895f='';return db[_0x11be('0x3b')][_0x11be('0x49')]({'where':{'id':_0x1c92cd[_0x11be('0x41')]['id']},'attributes':['id',_0x11be('0x53'),_0x11be('0x54')]})['then'](handleEntityNotFound(_0xbe1daf,null))[_0x11be('0x21')](function(_0x3b34f0){if(_0x3b34f0){_0x2f895f=_0x3b34f0[_0x11be('0x53')];var _0x534ac7=_0x2f895f[_0x11be('0x55')](-0x1);if(_0x534ac7==='/'){_0x2f895f=_0x2f895f[_0x11be('0x56')](0x0,_0x2f895f['lastIndexOf'](_0x534ac7));}return rp({'method':'GET','uri':util['format']('%s/%s',_0x2f895f,_0x11be('0x57')),'headers':{'Authorization':util[_0x11be('0x58')](_0x11be('0x59'),new Buffer(util[_0x11be('0x58')](_0x11be('0x5a'),_0x3b34f0['apiKey']))[_0x11be('0x5b')](_0x11be('0x5c')))},'json':!![]});}})[_0x11be('0x21')](function(_0x363d6e){if(_0x363d6e){var _0x1a3d16=['requester',_0x11be('0x5d'),_0x11be('0x5e'),_0x11be('0x5f'),_0x11be('0x1b'),'priority',_0x11be('0x60'),_0x11be('0x61'),_0x11be('0x62'),_0x11be('0x60'),_0x11be('0x63')];_[_0x11be('0x64')](_0x363d6e,function(_0x4f6d8d){return _0x1a3d16[_0x11be('0x65')](_0x4f6d8d[_0x11be('0x25')])||!_0x4f6d8d[_0x11be('0x66')]&&_0x4f6d8d[_0x11be('0x2a')]!=='custom_text'&&_0x4f6d8d[_0x11be('0x2a')]!=='custom_dropdown';});return{'count':_0x363d6e[_0x11be('0x4c')],'rows':_[_0x11be('0x28')](_0x363d6e,function(_0x181ddb){return{'id':_0x181ddb[_0x11be('0x25')],'name':_0x181ddb['label'],'custom':!_0x181ddb[_0x11be('0x66')],'options':_0x181ddb[_0x11be('0x67')]?_['map'](_0x181ddb[_0x11be('0x67')],function(_0x219eb){return{'name':_[_0x11be('0x68')](_0x219eb),'value':_0x219eb};}):[]};})};}})[_0x11be('0x21')](respondWithResult(_0xbe1daf,null))['catch'](function(_0x1f1223){var _0x2ab4ce=_0x1c92cd[_0x11be('0x2d')][_0x11be('0x69')]?0x1f4:_0x1f1223[_0x11be('0x6a')]||0x1f4;logger[_0x11be('0x23')](_0x11be('0x6b'),_0x11be('0x6c'),_0x2ab4ce,JSON['stringify'](_0x1f1223));delete _0x1f1223[_0x11be('0x25')];if(_0x2ab4ce===0x191){_0x2ab4ce=0x190;}_0xbe1daf['status'](_0x2ab4ce)['send'](_0x1c92cd[_0x11be('0x2d')][_0x11be('0x69')]?{'message':_0x11be('0x6d'),'statusCode':_0x1f1223[_0x11be('0x6a')]}:_0x1f1223);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 043b15d..94a9d13 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 _0xa138=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','FreshdeskAccount','int_freshdesk_accounts','lodash','util','api','moment'];(function(_0x35be73,_0x30153a){var _0x3c809a=function(_0x369c6d){while(--_0x369c6d){_0x35be73['push'](_0x35be73['shift']());}};_0x3c809a(++_0x30153a);}(_0xa138,0x18f));var _0x8a13=function(_0x3f24cc,_0x48bfd7){_0x3f24cc=_0x3f24cc-0x0;var _0x13680a=_0xa138[_0x3f24cc];return _0x13680a;};'use strict';var _=require(_0x8a13('0x0'));var util=require(_0x8a13('0x1'));var logger=require('../../config/logger')(_0x8a13('0x2'));var moment=require(_0x8a13('0x3'));var BPromise=require(_0x8a13('0x4'));var rp=require(_0x8a13('0x5'));var fs=require('fs');var path=require(_0x8a13('0x6'));var rimraf=require(_0x8a13('0x7'));var config=require(_0x8a13('0x8'));var attributes=require(_0x8a13('0x9'));var integrations=require(_0x8a13('0xa'));module['exports']=function(_0x2b8b95,_0x3baec3){return _0x2b8b95['define'](_0x8a13('0xb'),attributes,{'tableName':_0x8a13('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd37a=['bluebird','path','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','util','../../config/logger','api','moment'];(function(_0x3f52d9,_0x1d748c){var _0x21e01f=function(_0x22e584){while(--_0x22e584){_0x3f52d9['push'](_0x3f52d9['shift']());}};_0x21e01f(++_0x1d748c);}(_0xd37a,0x98));var _0xad37=function(_0x449278,_0x23c0f6){_0x449278=_0x449278-0x0;var _0x55de44=_0xd37a[_0x449278];return _0x55de44;};'use strict';var _=require('lodash');var util=require(_0xad37('0x0'));var logger=require(_0xad37('0x1'))(_0xad37('0x2'));var moment=require(_0xad37('0x3'));var BPromise=require(_0xad37('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xad37('0x5'));var rimraf=require(_0xad37('0x6'));var config=require('../../config/environment');var attributes=require(_0xad37('0x7'));var integrations=require(_0xad37('0x8'));module[_0xad37('0x9')]=function(_0x449ace,_0x682d20){return _0x449ace[_0xad37('0xa')](_0xad37('0xb'),attributes,{'tableName':_0xad37('0xc'),'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 583c67b..c12c0c8 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 _0xce1b=['options','raw','where','attributes','limit','include','map','model','ShowFreshdeskAccount','find','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','catch','GetFreshdeskAccount','FreshdeskAccount','findAll'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xce1b,0x73));var _0xbce1=function(_0x51c5a8,_0x216544){_0x51c5a8=_0x51c5a8-0x0;var _0x1b1740=_0xce1b[_0x51c5a8];return _0x1b1740;};'use strict';var _=require(_0xbce1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbce1('0x1'));var rs=require(_0xbce1('0x2'));var fs=require('fs');var Redis=require(_0xbce1('0x3'));var db=require(_0xbce1('0x4'))['db'];var utils=require(_0xbce1('0x5'));var logger=require(_0xbce1('0x6'))(_0xbce1('0x7'));var config=require(_0xbce1('0x8'));var jayson=require(_0xbce1('0x9'));var client=jayson[_0xbce1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32ea4b,_0x442ccc,_0x280ebe){return new BPromise(function(_0x5d5ba6,_0x1ede5a){return client['request'](_0x32ea4b,_0x280ebe)[_0xbce1('0xb')](function(_0x357c09){logger[_0xbce1('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x442ccc,_0xbce1('0xd'));logger[_0xbce1('0xe')](_0xbce1('0xf'),_0x442ccc,_0xbce1('0xd'),JSON[_0xbce1('0x10')](_0x357c09));if(_0x357c09[_0xbce1('0x11')]){if(_0x357c09['error'][_0xbce1('0x12')]===0x1f4){logger[_0xbce1('0x11')](_0xbce1('0x13'),_0x442ccc,_0x357c09[_0xbce1('0x11')][_0xbce1('0x14')]);return _0x1ede5a(_0x357c09[_0xbce1('0x11')][_0xbce1('0x14')]);}logger[_0xbce1('0x11')](_0xbce1('0x13'),_0x442ccc,_0x357c09[_0xbce1('0x11')]['message']);return _0x5d5ba6(_0x357c09['error'][_0xbce1('0x14')]);}else{logger[_0xbce1('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x442ccc,_0xbce1('0xd'));_0x5d5ba6(_0x357c09['result']['message']);}})[_0xbce1('0x15')](function(_0x4962e7){logger[_0xbce1('0x11')](_0xbce1('0x13'),_0x442ccc,_0x4962e7);_0x1ede5a(_0x4962e7);});});}exports[_0xbce1('0x16')]=function(_0x534f67){var _0x469a5d=this;return new Promise(function(_0x82562a,_0x2bd715){return db[_0xbce1('0x17')][_0xbce1('0x18')]({'raw':_0x534f67['options']?_0x534f67[_0xbce1('0x19')][_0xbce1('0x1a')]===undefined?!![]:![]:!![],'where':_0x534f67[_0xbce1('0x19')]?_0x534f67[_0xbce1('0x19')][_0xbce1('0x1b')]||null:null,'attributes':_0x534f67[_0xbce1('0x19')]?_0x534f67['options'][_0xbce1('0x1c')]||null:null,'limit':_0x534f67[_0xbce1('0x19')]?_0x534f67[_0xbce1('0x19')][_0xbce1('0x1d')]||null:null,'include':_0x534f67['options']?_0x534f67['options'][_0xbce1('0x1e')]?_[_0xbce1('0x1f')](_0x534f67['options'][_0xbce1('0x1e')],function(_0x16537a){return{'model':db[_0x16537a[_0xbce1('0x20')]],'as':_0x16537a['as'],'attributes':_0x16537a[_0xbce1('0x1c')],'include':_0x16537a['include']?_[_0xbce1('0x1f')](_0x16537a['include'],function(_0x2b1ea7){return{'model':db[_0x2b1ea7[_0xbce1('0x20')]],'as':_0x2b1ea7['as'],'attributes':_0x2b1ea7['attributes'],'include':_0x2b1ea7[_0xbce1('0x1e')]?_[_0xbce1('0x1f')](_0x2b1ea7[_0xbce1('0x1e')],function(_0xb5a1e7){return{'model':db[_0xb5a1e7['model']],'as':_0xb5a1e7['as'],'attributes':_0xb5a1e7[_0xbce1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbce1('0xb')](function(_0x10808b){logger[_0xbce1('0xc')](_0xbce1('0x16'),_0x534f67);logger['debug'](_0xbce1('0x16'),_0x534f67,JSON[_0xbce1('0x10')](_0x10808b));_0x82562a(_0x10808b);})[_0xbce1('0x15')](function(_0xf1f6d9){logger[_0xbce1('0x11')](_0xbce1('0x16'),_0xf1f6d9[_0xbce1('0x14')],_0x534f67);_0x2bd715(_0x469a5d[_0xbce1('0x11')](0x1f4,_0xf1f6d9['message']));});});};exports[_0xbce1('0x21')]=function(_0x302735){var _0x449f5f=this;return new Promise(function(_0x5e6732,_0x36594b){return db[_0xbce1('0x17')][_0xbce1('0x22')]({'raw':_0x302735[_0xbce1('0x19')]?_0x302735[_0xbce1('0x19')][_0xbce1('0x1a')]===undefined?!![]:![]:!![],'where':_0x302735[_0xbce1('0x19')]?_0x302735[_0xbce1('0x19')]['where']||null:null,'attributes':_0x302735[_0xbce1('0x19')]?_0x302735['options'][_0xbce1('0x1c')]||null:null,'include':_0x302735[_0xbce1('0x19')]?_0x302735[_0xbce1('0x19')]['include']?_[_0xbce1('0x1f')](_0x302735['options'][_0xbce1('0x1e')],function(_0x38cddf){return{'model':db[_0x38cddf[_0xbce1('0x20')]],'as':_0x38cddf['as'],'attributes':_0x38cddf[_0xbce1('0x1c')],'include':_0x38cddf[_0xbce1('0x1e')]?_[_0xbce1('0x1f')](_0x38cddf[_0xbce1('0x1e')],function(_0x133d53){return{'model':db[_0x133d53['model']],'as':_0x133d53['as'],'attributes':_0x133d53['attributes'],'include':_0x133d53[_0xbce1('0x1e')]?_[_0xbce1('0x1f')](_0x133d53[_0xbce1('0x1e')],function(_0x47c4ad){return{'model':db[_0x47c4ad[_0xbce1('0x20')]],'as':_0x47c4ad['as'],'attributes':_0x47c4ad[_0xbce1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbce1('0xb')](function(_0x3e3db6){logger[_0xbce1('0xc')](_0xbce1('0x21'),_0x302735);logger[_0xbce1('0xe')]('ShowFreshdeskAccount',_0x302735,JSON[_0xbce1('0x10')](_0x3e3db6));_0x5e6732(_0x3e3db6);})[_0xbce1('0x15')](function(_0x1f7927){logger[_0xbce1('0x11')]('ShowFreshdeskAccount',_0x1f7927['message'],_0x302735);_0x36594b(_0x449f5f[_0xbce1('0x11')](0x1f4,_0x1f7927[_0xbce1('0x14')]));});});}; \ No newline at end of file +var _0x70f3=['message','catch','FreshdeskAccount','findAll','raw','options','attributes','limit','map','include','model','GetFreshdeskAccount','ShowFreshdeskAccount','find','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x25b24a,_0x1c0163){var _0x224e68=function(_0x1fc9d2){while(--_0x1fc9d2){_0x25b24a['push'](_0x25b24a['shift']());}};_0x224e68(++_0x1c0163);}(_0x70f3,0x1d5));var _0x370f=function(_0x49ed67,_0x5d5d06){_0x49ed67=_0x49ed67-0x0;var _0x2f0e59=_0x70f3[_0x49ed67];return _0x2f0e59;};'use strict';var _=require('lodash');var util=require(_0x370f('0x0'));var moment=require(_0x370f('0x1'));var BPromise=require(_0x370f('0x2'));var rs=require(_0x370f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x370f('0x4'))['db'];var utils=require(_0x370f('0x5'));var logger=require(_0x370f('0x6'))('rpc');var config=require(_0x370f('0x7'));var jayson=require(_0x370f('0x8'));var client=jayson[_0x370f('0x9')][_0x370f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7e0ad9,_0x2b9185,_0x5d72e7){return new BPromise(function(_0x4d98c4,_0x357926){return client[_0x370f('0xb')](_0x7e0ad9,_0x5d72e7)[_0x370f('0xc')](function(_0x531f7e){logger[_0x370f('0xd')](_0x370f('0xe'),_0x2b9185,_0x370f('0xf'));logger[_0x370f('0x10')](_0x370f('0x11'),_0x2b9185,_0x370f('0xf'),JSON[_0x370f('0x12')](_0x531f7e));if(_0x531f7e[_0x370f('0x13')]){if(_0x531f7e[_0x370f('0x13')][_0x370f('0x14')]===0x1f4){logger[_0x370f('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x2b9185,_0x531f7e['error'][_0x370f('0x15')]);return _0x357926(_0x531f7e['error']['message']);}logger[_0x370f('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x2b9185,_0x531f7e[_0x370f('0x13')][_0x370f('0x15')]);return _0x4d98c4(_0x531f7e[_0x370f('0x13')]['message']);}else{logger[_0x370f('0xd')](_0x370f('0xe'),_0x2b9185,_0x370f('0xf'));_0x4d98c4(_0x531f7e['result']['message']);}})[_0x370f('0x16')](function(_0x2e0859){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x2b9185,_0x2e0859);_0x357926(_0x2e0859);});});}exports['GetFreshdeskAccount']=function(_0x314461){var _0x599464=this;return new Promise(function(_0x422a00,_0x52369d){return db[_0x370f('0x17')][_0x370f('0x18')]({'raw':_0x314461['options']?_0x314461['options'][_0x370f('0x19')]===undefined?!![]:![]:!![],'where':_0x314461[_0x370f('0x1a')]?_0x314461['options']['where']||null:null,'attributes':_0x314461[_0x370f('0x1a')]?_0x314461[_0x370f('0x1a')][_0x370f('0x1b')]||null:null,'limit':_0x314461[_0x370f('0x1a')]?_0x314461[_0x370f('0x1a')][_0x370f('0x1c')]||null:null,'include':_0x314461[_0x370f('0x1a')]?_0x314461['options']['include']?_[_0x370f('0x1d')](_0x314461[_0x370f('0x1a')][_0x370f('0x1e')],function(_0x43adb3){return{'model':db[_0x43adb3[_0x370f('0x1f')]],'as':_0x43adb3['as'],'attributes':_0x43adb3['attributes'],'include':_0x43adb3[_0x370f('0x1e')]?_[_0x370f('0x1d')](_0x43adb3[_0x370f('0x1e')],function(_0x315549){return{'model':db[_0x315549[_0x370f('0x1f')]],'as':_0x315549['as'],'attributes':_0x315549[_0x370f('0x1b')],'include':_0x315549['include']?_[_0x370f('0x1d')](_0x315549[_0x370f('0x1e')],function(_0x589e14){return{'model':db[_0x589e14[_0x370f('0x1f')]],'as':_0x589e14['as'],'attributes':_0x589e14[_0x370f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x370f('0xc')](function(_0x2b20c2){logger[_0x370f('0xd')](_0x370f('0x20'),_0x314461);logger[_0x370f('0x10')](_0x370f('0x20'),_0x314461,JSON[_0x370f('0x12')](_0x2b20c2));_0x422a00(_0x2b20c2);})['catch'](function(_0x171eb5){logger[_0x370f('0x13')]('GetFreshdeskAccount',_0x171eb5[_0x370f('0x15')],_0x314461);_0x52369d(_0x599464[_0x370f('0x13')](0x1f4,_0x171eb5[_0x370f('0x15')]));});});};exports[_0x370f('0x21')]=function(_0x4c9b0f){var _0x42d125=this;return new Promise(function(_0x3578c3,_0x27638b){return db[_0x370f('0x17')][_0x370f('0x22')]({'raw':_0x4c9b0f[_0x370f('0x1a')]?_0x4c9b0f[_0x370f('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4c9b0f[_0x370f('0x1a')]?_0x4c9b0f[_0x370f('0x1a')]['where']||null:null,'attributes':_0x4c9b0f[_0x370f('0x1a')]?_0x4c9b0f[_0x370f('0x1a')][_0x370f('0x1b')]||null:null,'include':_0x4c9b0f[_0x370f('0x1a')]?_0x4c9b0f[_0x370f('0x1a')][_0x370f('0x1e')]?_[_0x370f('0x1d')](_0x4c9b0f['options']['include'],function(_0x4ae07b){return{'model':db[_0x4ae07b[_0x370f('0x1f')]],'as':_0x4ae07b['as'],'attributes':_0x4ae07b[_0x370f('0x1b')],'include':_0x4ae07b['include']?_[_0x370f('0x1d')](_0x4ae07b[_0x370f('0x1e')],function(_0x1c6f0e){return{'model':db[_0x1c6f0e[_0x370f('0x1f')]],'as':_0x1c6f0e['as'],'attributes':_0x1c6f0e[_0x370f('0x1b')],'include':_0x1c6f0e[_0x370f('0x1e')]?_[_0x370f('0x1d')](_0x1c6f0e[_0x370f('0x1e')],function(_0x3772d0){return{'model':db[_0x3772d0[_0x370f('0x1f')]],'as':_0x3772d0['as'],'attributes':_0x3772d0[_0x370f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x370f('0xc')](function(_0x4fe3ed){logger['info'](_0x370f('0x21'),_0x4c9b0f);logger[_0x370f('0x10')]('ShowFreshdeskAccount',_0x4c9b0f,JSON[_0x370f('0x12')](_0x4fe3ed));_0x3578c3(_0x4fe3ed);})[_0x370f('0x16')](function(_0x23d900){logger[_0x370f('0x13')](_0x370f('0x21'),_0x23d900['message'],_0x4c9b0f);_0x27638b(_0x42d125[_0x370f('0x13')](0x1f4,_0x23d900[_0x370f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 99bbf7d..b1a5774 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 _0x1e47=['index','/:id','show','/:id/fields','getFields','/:id/subjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','./intFreshdeskConfiguration.controller','get','isAuthenticated'];(function(_0x45bc9d,_0x10e9c6){var _0x3cec77=function(_0x491118){while(--_0x491118){_0x45bc9d['push'](_0x45bc9d['shift']());}};_0x3cec77(++_0x10e9c6);}(_0x1e47,0xcf));var _0x71e4=function(_0x2c3024,_0x56147f){_0x2c3024=_0x2c3024-0x0;var _0x4b0bcd=_0x1e47[_0x2c3024];return _0x4b0bcd;};'use strict';var multer=require(_0x71e4('0x0'));var util=require(_0x71e4('0x1'));var path=require('path');var timeout=require(_0x71e4('0x2'));var express=require(_0x71e4('0x3'));var router=express[_0x71e4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x71e4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x71e4('0x6'));router[_0x71e4('0x7')]('/',auth[_0x71e4('0x8')](),controller[_0x71e4('0x9')]);router[_0x71e4('0x7')](_0x71e4('0xa'),auth['isAuthenticated'](),controller[_0x71e4('0xb')]);router[_0x71e4('0x7')](_0x71e4('0xc'),auth[_0x71e4('0x8')](),controller[_0x71e4('0xd')]);router[_0x71e4('0x7')](_0x71e4('0xe'),auth[_0x71e4('0x8')](),controller['getSubjects']);router[_0x71e4('0x7')]('/:id/descriptions',auth[_0x71e4('0x8')](),controller[_0x71e4('0xf')]);router['get'](_0x71e4('0x10'),auth[_0x71e4('0x8')](),controller[_0x71e4('0x11')]);router[_0x71e4('0x12')]('/',auth[_0x71e4('0x8')](),controller[_0x71e4('0x13')]);router['post'](_0x71e4('0x10'),auth[_0x71e4('0x8')](),controller[_0x71e4('0x14')]);router[_0x71e4('0x15')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x71e4('0x16')](_0x71e4('0xa'),auth[_0x71e4('0x8')](),controller['destroy']);module[_0x71e4('0x17')]=router; \ No newline at end of file +var _0x4ad3=['path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','delete','destroy','exports','util'];(function(_0x4e0a40,_0x2ae544){var _0x46bba9=function(_0x27e3c1){while(--_0x27e3c1){_0x4e0a40['push'](_0x4e0a40['shift']());}};_0x46bba9(++_0x2ae544);}(_0x4ad3,0xc7));var _0x34ad=function(_0xecc551,_0x471cac){_0xecc551=_0xecc551-0x0;var _0x344658=_0x4ad3[_0xecc551];return _0x344658;};'use strict';var multer=require('multer');var util=require(_0x34ad('0x0'));var path=require(_0x34ad('0x1'));var timeout=require(_0x34ad('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x34ad('0x3'));var interaction=require(_0x34ad('0x4'));var config=require(_0x34ad('0x5'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x34ad('0x6')]('/',auth[_0x34ad('0x7')](),controller[_0x34ad('0x8')]);router[_0x34ad('0x6')](_0x34ad('0x9'),auth[_0x34ad('0x7')](),controller[_0x34ad('0xa')]);router[_0x34ad('0x6')](_0x34ad('0xb'),auth['isAuthenticated'](),controller[_0x34ad('0xc')]);router['get']('/:id/subjects',auth[_0x34ad('0x7')](),controller[_0x34ad('0xd')]);router[_0x34ad('0x6')](_0x34ad('0xe'),auth[_0x34ad('0x7')](),controller[_0x34ad('0xf')]);router[_0x34ad('0x6')](_0x34ad('0x10'),auth['isAuthenticated'](),controller[_0x34ad('0x11')]);router[_0x34ad('0x12')]('/',auth['isAuthenticated'](),controller[_0x34ad('0x13')]);router['post']('/:id/tags',auth['isAuthenticated'](),controller[_0x34ad('0x14')]);router[_0x34ad('0x15')](_0x34ad('0x9'),auth[_0x34ad('0x7')](),controller['update']);router[_0x34ad('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x34ad('0x17')]);module[_0x34ad('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 6e5bb3a..0fb0d32 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 _0x4ba1=['exports','STRING','sequelize'];(function(_0x34530a,_0x14725d){var _0x4a144f=function(_0x186151){while(--_0x186151){_0x34530a['push'](_0x34530a['shift']());}};_0x4a144f(++_0x14725d);}(_0x4ba1,0x1b5));var _0x14ba=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x4ba1[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x14ba('0x0'));module[_0x14ba('0x1')]={'name':{'type':Sequelize[_0x14ba('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xeafa=['exports','STRING','sequelize'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xeafa,0xbf));var _0xaeaf=function(_0xdf0941,_0xd5b302){_0xdf0941=_0xdf0941-0x0;var _0x3b20f9=_0xeafa[_0xdf0941];return _0x3b20f9;};'use strict';var Sequelize=require(_0xaeaf('0x0'));module[_0xaeaf('0x1')]={'name':{'type':Sequelize[_0xaeaf('0x2')]},'description':{'type':Sequelize[_0xaeaf('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index e45f31f..a1c8654 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 _0x9ad7=['to-csv','ejs','fs-extra','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','fields','attributes','length','model','hasOwnProperty','sort','pick','filter','merge','VIRTUAL','options','where','FreshdeskConfiguration','includeAll','include','findAll','catch','show','params','keys','create','body','find','getFields','findOne','FreshdeskField','getSubjects','nolimit','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox'];(function(_0x5ad45e,_0x38bef2){var _0x10efea=function(_0xaa3675){while(--_0xaa3675){_0x5ad45e['push'](_0x5ad45e['shift']());}};_0x10efea(++_0x38bef2);}(_0x9ad7,0x14e));var _0x79ad=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x9ad7[_0x1abb09];return _0xea1c07;};'use strict';var emlformat=require(_0x79ad('0x0'));var rimraf=require(_0x79ad('0x1'));var zipdir=require(_0x79ad('0x2'));var jsonpatch=require(_0x79ad('0x3'));var rp=require(_0x79ad('0x4'));var moment=require('moment');var BPromise=require(_0x79ad('0x5'));var Mustache=require(_0x79ad('0x6'));var util=require(_0x79ad('0x7'));var path=require(_0x79ad('0x8'));var sox=require(_0x79ad('0x9'));var csv=require(_0x79ad('0xa'));var ejs=require(_0x79ad('0xb'));var fs=require('fs');var fs_extra=require(_0x79ad('0xc'));var _=require(_0x79ad('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x79ad('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x79ad('0xa'));var querystring=require(_0x79ad('0xf'));var Papa=require('papaparse');var Redis=require(_0x79ad('0x10'));var authService=require(_0x79ad('0x11'));var qs=require(_0x79ad('0x12'));var as=require(_0x79ad('0x13'));var hardwareService=require(_0x79ad('0x14'));var logger=require(_0x79ad('0x15'))(_0x79ad('0x16'));var utils=require(_0x79ad('0x17'));var config=require(_0x79ad('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x79ad('0x19'))['db'];function respondWithStatusCode(_0x381748,_0x46e6eb){_0x46e6eb=_0x46e6eb||0xcc;return function(_0xbe1a52){if(_0xbe1a52){return _0x381748[_0x79ad('0x1a')](_0x46e6eb);}return _0x381748[_0x79ad('0x1b')](_0x46e6eb)[_0x79ad('0x1c')]();};}function respondWithResult(_0xbbe4a2,_0x1a46de){_0x1a46de=_0x1a46de||0xc8;return function(_0x3e2d1a){if(_0x3e2d1a){return _0xbbe4a2[_0x79ad('0x1b')](_0x1a46de)['json'](_0x3e2d1a);}};}function respondWithFilteredResult(_0x33e647,_0x599bc9){return function(_0x409013){if(_0x409013){var _0x58739f=typeof _0x599bc9[_0x79ad('0x1d')]===_0x79ad('0x1e')&&typeof _0x599bc9[_0x79ad('0x1f')]===_0x79ad('0x1e');var _0xa02ac0=_0x409013['count'];var _0x337927=_0x58739f?0x0:_0x599bc9['offset'];var _0x15f1ab=_0x58739f?_0x409013[_0x79ad('0x20')]:_0x599bc9['offset']+_0x599bc9[_0x79ad('0x1f')];var _0x1dc2d0;if(_0x15f1ab>=_0xa02ac0){_0x15f1ab=_0xa02ac0;_0x1dc2d0=0xc8;}else{_0x1dc2d0=0xce;}_0x33e647['status'](_0x1dc2d0);return _0x33e647['set'](_0x79ad('0x21'),_0x337927+'-'+_0x15f1ab+'/'+_0xa02ac0)[_0x79ad('0x22')](_0x409013);}return null;};}function patchUpdates(_0x26ee15){return function(_0x41c395){try{jsonpatch[_0x79ad('0x23')](_0x41c395,_0x26ee15,!![]);}catch(_0x401f79){return BPromise[_0x79ad('0x24')](_0x401f79);}return _0x41c395[_0x79ad('0x25')]();};}function saveUpdates(_0x5bb930,_0x514cd8){return function(_0x553cb9){if(_0x553cb9){return _0x553cb9[_0x79ad('0x26')](_0x5bb930)[_0x79ad('0x27')](function(_0x322815){return _0x322815;});}return null;};}function removeEntity(_0x295b4d,_0x4c183c){return function(_0x238732){if(_0x238732){return _0x238732[_0x79ad('0x28')]()[_0x79ad('0x27')](function(){_0x295b4d[_0x79ad('0x1b')](0xcc)[_0x79ad('0x1c')]();});}};}function handleEntityNotFound(_0x36b006,_0x66891a){return function(_0xf5deb3){if(!_0xf5deb3){_0x36b006[_0x79ad('0x1a')](0x194);}return _0xf5deb3;};}function handleError(_0x1b7abb,_0x4b5db2){_0x4b5db2=_0x4b5db2||0x1f4;return function(_0x1bcef8){logger['error'](_0x1bcef8[_0x79ad('0x29')]);if(_0x1bcef8[_0x79ad('0x2a')]){delete _0x1bcef8[_0x79ad('0x2a')];}_0x1b7abb[_0x79ad('0x1b')](_0x4b5db2)[_0x79ad('0x2b')](_0x1bcef8);};}exports[_0x79ad('0x2c')]=function(_0x4c875d,_0x49e66c){var _0x16a615={},_0x5ee960={},_0x1e015e={'count':0x0,'rows':[]};var _0xe6fbc0=_[_0x79ad('0x2d')](db['FreshdeskConfiguration'][_0x79ad('0x2e')],function(_0x320888){return{'name':_0x320888[_0x79ad('0x2f')],'type':_0x320888[_0x79ad('0x30')][_0x79ad('0x31')]};});_0x5ee960['model']=_[_0x79ad('0x2d')](_0xe6fbc0,'name');_0x5ee960['query']=_['keys'](_0x4c875d[_0x79ad('0x32')]);_0x5ee960[_0x79ad('0x33')]=_['intersection'](_0x5ee960['model'],_0x5ee960[_0x79ad('0x32')]);_0x16a615['attributes']=_[_0x79ad('0x34')](_0x5ee960['model'],qs[_0x79ad('0x35')](_0x4c875d[_0x79ad('0x32')][_0x79ad('0x35')]));_0x16a615[_0x79ad('0x36')]=_0x16a615[_0x79ad('0x36')][_0x79ad('0x37')]?_0x16a615[_0x79ad('0x36')]:_0x5ee960[_0x79ad('0x38')];if(!_0x4c875d[_0x79ad('0x32')][_0x79ad('0x39')]('nolimit')){_0x16a615[_0x79ad('0x1f')]=qs[_0x79ad('0x1f')](_0x4c875d[_0x79ad('0x32')][_0x79ad('0x1f')]);_0x16a615[_0x79ad('0x1d')]=qs[_0x79ad('0x1d')](_0x4c875d[_0x79ad('0x32')]['offset']);}_0x16a615['order']=qs[_0x79ad('0x3a')](_0x4c875d[_0x79ad('0x32')]['sort']);_0x16a615['where']=qs[_0x79ad('0x33')](_[_0x79ad('0x3b')](_0x4c875d[_0x79ad('0x32')],_0x5ee960[_0x79ad('0x33')]),_0xe6fbc0);if(_0x4c875d[_0x79ad('0x32')][_0x79ad('0x3c')]){_0x16a615['where']=_[_0x79ad('0x3d')](_0x16a615['where'],{'$or':_[_0x79ad('0x2d')](_0xe6fbc0,function(_0x40ebe7){if(_0x40ebe7['type']!==_0x79ad('0x3e')){var _0x5936d4={};_0x5936d4[_0x40ebe7[_0x79ad('0x2a')]]={'$like':'%'+_0x4c875d[_0x79ad('0x32')]['filter']+'%'};return _0x5936d4;}})});}_0x16a615=_['merge']({},_0x16a615,_0x4c875d[_0x79ad('0x3f')]);var _0x2de67f={'where':_0x16a615[_0x79ad('0x40')]};return db[_0x79ad('0x41')][_0x79ad('0x20')](_0x2de67f)['then'](function(_0x15426d){_0x1e015e[_0x79ad('0x20')]=_0x15426d;if(_0x4c875d[_0x79ad('0x32')][_0x79ad('0x42')]){_0x16a615[_0x79ad('0x43')]=[{'all':!![]}];}return db[_0x79ad('0x41')][_0x79ad('0x44')](_0x16a615);})[_0x79ad('0x27')](function(_0x3b4032){_0x1e015e['rows']=_0x3b4032;return _0x1e015e;})[_0x79ad('0x27')](respondWithFilteredResult(_0x49e66c,_0x16a615))[_0x79ad('0x45')](handleError(_0x49e66c,null));};exports[_0x79ad('0x46')]=function(_0x3f9be5,_0x2a0e66){var _0x134100={'raw':![],'where':{'id':_0x3f9be5[_0x79ad('0x47')]['id']}},_0x498772={};_0x498772[_0x79ad('0x38')]=_[_0x79ad('0x48')](db[_0x79ad('0x41')][_0x79ad('0x2e')]);_0x498772[_0x79ad('0x32')]=_[_0x79ad('0x48')](_0x3f9be5['query']);_0x498772[_0x79ad('0x33')]=_[_0x79ad('0x34')](_0x498772[_0x79ad('0x38')],_0x498772['query']);_0x134100[_0x79ad('0x36')]=_[_0x79ad('0x34')](_0x498772[_0x79ad('0x38')],qs[_0x79ad('0x35')](_0x3f9be5[_0x79ad('0x32')][_0x79ad('0x35')]));_0x134100[_0x79ad('0x36')]=_0x134100[_0x79ad('0x36')]['length']?_0x134100[_0x79ad('0x36')]:_0x498772['model'];if(_0x3f9be5[_0x79ad('0x32')][_0x79ad('0x42')]){_0x134100[_0x79ad('0x43')]=[{'all':!![]}];}_0x134100=_['merge']({},_0x134100,_0x3f9be5['options']);return db[_0x79ad('0x41')]['find'](_0x134100)[_0x79ad('0x27')](handleEntityNotFound(_0x2a0e66,null))[_0x79ad('0x27')](respondWithResult(_0x2a0e66,null))[_0x79ad('0x45')](handleError(_0x2a0e66,null));};exports[_0x79ad('0x49')]=function(_0x4d6f9d,_0x39073f){return db[_0x79ad('0x41')]['create'](_0x4d6f9d[_0x79ad('0x4a')],{})[_0x79ad('0x27')](respondWithResult(_0x39073f,0xc9))[_0x79ad('0x45')](handleError(_0x39073f,null));};exports[_0x79ad('0x26')]=function(_0x563484,_0x56704b){if(_0x563484[_0x79ad('0x4a')]['id']){delete _0x563484['body']['id'];}return db['FreshdeskConfiguration'][_0x79ad('0x4b')]({'where':{'id':_0x563484[_0x79ad('0x47')]['id']}})['then'](handleEntityNotFound(_0x56704b,null))[_0x79ad('0x27')](saveUpdates(_0x563484[_0x79ad('0x4a')],null))[_0x79ad('0x27')](respondWithResult(_0x56704b,null))[_0x79ad('0x45')](handleError(_0x56704b,null));};exports['destroy']=function(_0xc31822,_0x150132){return db['FreshdeskConfiguration'][_0x79ad('0x4b')]({'where':{'id':_0xc31822[_0x79ad('0x47')]['id']}})['then'](handleEntityNotFound(_0x150132,null))[_0x79ad('0x27')](removeEntity(_0x150132,null))[_0x79ad('0x45')](handleError(_0x150132,null));};exports[_0x79ad('0x4c')]=function(_0x53f0f1,_0x123927,_0x376bc2){var _0x45304b={};var _0x2bd5bb={};var _0x50025c;var _0x16da28;return db[_0x79ad('0x41')][_0x79ad('0x4d')]({'where':{'id':_0x53f0f1['params']['id']}})[_0x79ad('0x27')](handleEntityNotFound(_0x123927,null))[_0x79ad('0x27')](function(_0x2019c3){if(_0x2019c3){_0x50025c=_0x2019c3;_0x2bd5bb[_0x79ad('0x38')]=_[_0x79ad('0x48')](db[_0x79ad('0x4e')][_0x79ad('0x2e')]);_0x2bd5bb['query']=_['keys'](_0x53f0f1['query']);_0x2bd5bb['filters']=_[_0x79ad('0x34')](_0x2bd5bb['model'],_0x2bd5bb[_0x79ad('0x32')]);_0x45304b[_0x79ad('0x36')]=_[_0x79ad('0x34')](_0x2bd5bb[_0x79ad('0x38')],qs[_0x79ad('0x35')](_0x53f0f1[_0x79ad('0x32')][_0x79ad('0x35')]));_0x45304b['attributes']=_0x45304b['attributes'][_0x79ad('0x37')]?_0x45304b[_0x79ad('0x36')]:_0x2bd5bb['model'];_0x45304b['order']=qs[_0x79ad('0x3a')](_0x53f0f1[_0x79ad('0x32')]['sort']);_0x45304b[_0x79ad('0x40')]=qs['filters'](_[_0x79ad('0x3b')](_0x53f0f1[_0x79ad('0x32')],_0x2bd5bb[_0x79ad('0x33')]));if(_0x53f0f1['query'][_0x79ad('0x3c')]){_0x45304b[_0x79ad('0x40')]=_[_0x79ad('0x3d')](_0x45304b[_0x79ad('0x40')],{'$or':_[_0x79ad('0x2d')](_0x45304b['attributes'],function(_0x113cb6){var _0x4a95df={};_0x4a95df[_0x113cb6]={'$like':'%'+_0x53f0f1['query'][_0x79ad('0x3c')]+'%'};return _0x4a95df;})});}_0x45304b=_[_0x79ad('0x3d')]({},_0x45304b,_0x53f0f1[_0x79ad('0x3f')]);return _0x50025c[_0x79ad('0x4c')](_0x45304b);}})[_0x79ad('0x27')](function(_0x5f4991){if(_0x5f4991){_0x16da28=_0x5f4991[_0x79ad('0x37')];if(!_0x53f0f1['query'][_0x79ad('0x39')]('nolimit')){_0x45304b[_0x79ad('0x1f')]=qs['limit'](_0x53f0f1[_0x79ad('0x32')][_0x79ad('0x1f')]);_0x45304b[_0x79ad('0x1d')]=qs[_0x79ad('0x1d')](_0x53f0f1['query']['offset']);}return _0x50025c[_0x79ad('0x4c')](_0x45304b);}})[_0x79ad('0x27')](function(_0x3e4761){if(_0x3e4761){return _0x3e4761?{'count':_0x16da28,'rows':_0x3e4761}:null;}})['then'](respondWithResult(_0x123927,null))['catch'](handleError(_0x123927,null));};exports[_0x79ad('0x4f')]=function(_0x53f24b,_0x72cd02,_0x52fe64){var _0x1511ad={};var _0x23c445={};var _0x2482f8;var _0x2d5e7c;return db[_0x79ad('0x41')]['findOne']({'where':{'id':_0x53f24b[_0x79ad('0x47')]['id']}})[_0x79ad('0x27')](handleEntityNotFound(_0x72cd02,null))['then'](function(_0x301475){if(_0x301475){_0x2482f8=_0x301475;_0x23c445['model']=_[_0x79ad('0x48')](db['FreshdeskField']['rawAttributes']);_0x23c445[_0x79ad('0x32')]=_[_0x79ad('0x48')](_0x53f24b['query']);_0x23c445[_0x79ad('0x33')]=_['intersection'](_0x23c445['model'],_0x23c445[_0x79ad('0x32')]);_0x1511ad[_0x79ad('0x36')]=_[_0x79ad('0x34')](_0x23c445[_0x79ad('0x38')],qs['fields'](_0x53f24b[_0x79ad('0x32')][_0x79ad('0x35')]));_0x1511ad[_0x79ad('0x36')]=_0x1511ad[_0x79ad('0x36')][_0x79ad('0x37')]?_0x1511ad[_0x79ad('0x36')]:_0x23c445['model'];_0x1511ad['order']=qs['sort'](_0x53f24b[_0x79ad('0x32')][_0x79ad('0x3a')]);_0x1511ad[_0x79ad('0x40')]=qs[_0x79ad('0x33')](_['pick'](_0x53f24b[_0x79ad('0x32')],_0x23c445[_0x79ad('0x33')]));if(_0x53f24b['query'][_0x79ad('0x3c')]){_0x1511ad[_0x79ad('0x40')]=_[_0x79ad('0x3d')](_0x1511ad['where'],{'$or':_[_0x79ad('0x2d')](_0x1511ad[_0x79ad('0x36')],function(_0x14816b){var _0x4c5ee2={};_0x4c5ee2[_0x14816b]={'$like':'%'+_0x53f24b[_0x79ad('0x32')][_0x79ad('0x3c')]+'%'};return _0x4c5ee2;})});}_0x1511ad=_[_0x79ad('0x3d')]({},_0x1511ad,_0x53f24b[_0x79ad('0x3f')]);return _0x2482f8[_0x79ad('0x4f')](_0x1511ad);}})[_0x79ad('0x27')](function(_0x16311d){if(_0x16311d){_0x2d5e7c=_0x16311d[_0x79ad('0x37')];if(!_0x53f24b[_0x79ad('0x32')][_0x79ad('0x39')](_0x79ad('0x50'))){_0x1511ad[_0x79ad('0x1f')]=qs[_0x79ad('0x1f')](_0x53f24b['query'][_0x79ad('0x1f')]);_0x1511ad[_0x79ad('0x1d')]=qs['offset'](_0x53f24b[_0x79ad('0x32')][_0x79ad('0x1d')]);}return _0x2482f8[_0x79ad('0x4f')](_0x1511ad);}})[_0x79ad('0x27')](function(_0x219fd0){if(_0x219fd0){return _0x219fd0?{'count':_0x2d5e7c,'rows':_0x219fd0}:null;}})[_0x79ad('0x27')](respondWithResult(_0x72cd02,null))[_0x79ad('0x45')](handleError(_0x72cd02,null));};exports[_0x79ad('0x51')]=function(_0x44ae2d,_0x2a832d,_0x190bef){var _0x525c30={};var _0x1d397a={};var _0x17176a;var _0x1e985e;return db[_0x79ad('0x41')][_0x79ad('0x4d')]({'where':{'id':_0x44ae2d['params']['id']}})[_0x79ad('0x27')](handleEntityNotFound(_0x2a832d,null))[_0x79ad('0x27')](function(_0x57e66c){if(_0x57e66c){_0x17176a=_0x57e66c;_0x1d397a[_0x79ad('0x38')]=_[_0x79ad('0x48')](db[_0x79ad('0x4e')]['rawAttributes']);_0x1d397a[_0x79ad('0x32')]=_[_0x79ad('0x48')](_0x44ae2d['query']);_0x1d397a['filters']=_[_0x79ad('0x34')](_0x1d397a['model'],_0x1d397a[_0x79ad('0x32')]);_0x525c30['attributes']=_[_0x79ad('0x34')](_0x1d397a[_0x79ad('0x38')],qs[_0x79ad('0x35')](_0x44ae2d[_0x79ad('0x32')][_0x79ad('0x35')]));_0x525c30['attributes']=_0x525c30[_0x79ad('0x36')][_0x79ad('0x37')]?_0x525c30['attributes']:_0x1d397a['model'];_0x525c30['order']=qs[_0x79ad('0x3a')](_0x44ae2d['query'][_0x79ad('0x3a')]);_0x525c30[_0x79ad('0x40')]=qs['filters'](_[_0x79ad('0x3b')](_0x44ae2d[_0x79ad('0x32')],_0x1d397a[_0x79ad('0x33')]));if(_0x44ae2d[_0x79ad('0x32')][_0x79ad('0x3c')]){_0x525c30[_0x79ad('0x40')]=_[_0x79ad('0x3d')](_0x525c30[_0x79ad('0x40')],{'$or':_[_0x79ad('0x2d')](_0x525c30[_0x79ad('0x36')],function(_0x2c3610){var _0x3ffaef={};_0x3ffaef[_0x2c3610]={'$like':'%'+_0x44ae2d['query']['filter']+'%'};return _0x3ffaef;})});}_0x525c30=_[_0x79ad('0x3d')]({},_0x525c30,_0x44ae2d['options']);return _0x17176a[_0x79ad('0x51')](_0x525c30);}})[_0x79ad('0x27')](function(_0x1c9f62){if(_0x1c9f62){_0x1e985e=_0x1c9f62['length'];if(!_0x44ae2d[_0x79ad('0x32')]['hasOwnProperty'](_0x79ad('0x50'))){_0x525c30[_0x79ad('0x1f')]=qs['limit'](_0x44ae2d[_0x79ad('0x32')][_0x79ad('0x1f')]);_0x525c30[_0x79ad('0x1d')]=qs[_0x79ad('0x1d')](_0x44ae2d['query'][_0x79ad('0x1d')]);}return _0x17176a[_0x79ad('0x51')](_0x525c30);}})[_0x79ad('0x27')](function(_0x50e3c7){if(_0x50e3c7){return _0x50e3c7?{'count':_0x1e985e,'rows':_0x50e3c7}:null;}})[_0x79ad('0x27')](respondWithResult(_0x2a832d,null))[_0x79ad('0x45')](handleError(_0x2a832d,null));};exports[_0x79ad('0x52')]=function(_0x9d4eb0,_0x1fdc14,_0x333b40){var _0x2045c7={};var _0x44a5b0={};var _0x23233e;var _0x165f35;return db['FreshdeskConfiguration'][_0x79ad('0x4d')]({'where':{'id':_0x9d4eb0[_0x79ad('0x47')]['id']}})[_0x79ad('0x27')](handleEntityNotFound(_0x1fdc14,null))['then'](function(_0x349d62){if(_0x349d62){_0x23233e=_0x349d62;_0x44a5b0[_0x79ad('0x38')]=_[_0x79ad('0x48')](db[_0x79ad('0x53')][_0x79ad('0x2e')]);_0x44a5b0[_0x79ad('0x32')]=_[_0x79ad('0x48')](_0x9d4eb0[_0x79ad('0x32')]);_0x44a5b0[_0x79ad('0x33')]=_['intersection'](_0x44a5b0[_0x79ad('0x38')],_0x44a5b0['query']);_0x2045c7['attributes']=_['intersection'](_0x44a5b0['model'],qs[_0x79ad('0x35')](_0x9d4eb0['query'][_0x79ad('0x35')]));_0x2045c7[_0x79ad('0x36')]=_0x2045c7[_0x79ad('0x36')]['length']?_0x2045c7[_0x79ad('0x36')]:_0x44a5b0['model'];_0x2045c7['order']=qs[_0x79ad('0x3a')](_0x9d4eb0[_0x79ad('0x32')][_0x79ad('0x3a')]);_0x2045c7[_0x79ad('0x40')]=qs['filters'](_[_0x79ad('0x3b')](_0x9d4eb0[_0x79ad('0x32')],_0x44a5b0[_0x79ad('0x33')]));if(_0x9d4eb0[_0x79ad('0x32')][_0x79ad('0x3c')]){_0x2045c7[_0x79ad('0x40')]=_['merge'](_0x2045c7['where'],{'$or':_[_0x79ad('0x2d')](_0x2045c7[_0x79ad('0x36')],function(_0x7913b3){var _0x5e9948={};_0x5e9948[_0x7913b3]={'$like':'%'+_0x9d4eb0[_0x79ad('0x32')][_0x79ad('0x3c')]+'%'};return _0x5e9948;})});}_0x2045c7=_[_0x79ad('0x3d')]({},_0x2045c7,_0x9d4eb0[_0x79ad('0x3f')]);return _0x23233e[_0x79ad('0x52')](_0x2045c7);}})[_0x79ad('0x27')](function(_0x315f35){if(_0x315f35){_0x165f35=_0x315f35['length'];if(!_0x9d4eb0[_0x79ad('0x32')][_0x79ad('0x39')]('nolimit')){_0x2045c7[_0x79ad('0x1f')]=qs[_0x79ad('0x1f')](_0x9d4eb0[_0x79ad('0x32')][_0x79ad('0x1f')]);_0x2045c7[_0x79ad('0x1d')]=qs[_0x79ad('0x1d')](_0x9d4eb0[_0x79ad('0x32')][_0x79ad('0x1d')]);}return _0x23233e[_0x79ad('0x52')](_0x2045c7);}})['then'](function(_0x199571){if(_0x199571){return _0x199571?{'count':_0x165f35,'rows':_0x199571}:null;}})[_0x79ad('0x27')](respondWithResult(_0x1fdc14,null))['catch'](handleError(_0x1fdc14,null));};exports[_0x79ad('0x54')]=function(_0x3fb266,_0xd713ef,_0x21725f){if(_0x3fb266[_0x79ad('0x4a')]['id']){delete _0x3fb266['body']['id'];}return db['FreshdeskConfiguration'][_0x79ad('0x4d')]({'where':{'id':_0x3fb266[_0x79ad('0x47')]['id']}})[_0x79ad('0x27')](handleEntityNotFound(_0xd713ef,null))['then'](function(_0x2ba43a){if(_0x2ba43a){return _0x2ba43a[_0x79ad('0x54')](_0x3fb266[_0x79ad('0x4a')][_0x79ad('0x55')]||[]);}return null;})[_0x79ad('0x27')](respondWithResult(_0xd713ef,null))[_0x79ad('0x45')](handleError(_0xd713ef,null));}; \ No newline at end of file +var _0xaae5=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','count','set','Content-Range','apply','update','then','destroy','name','send','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','FreshdeskConfiguration','includeAll','include','findAll','rows','catch','show','find','create','body','params','getFields','findOne','order','hasOwnProperty','getSubjects','FreshdeskField','getTags','setTags','eml-format','rimraf','zip-dir','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xaae5,0x171));var _0x5aae=function(_0x3df25f,_0x488b61){_0x3df25f=_0x3df25f-0x0;var _0x47ca1e=_0xaae5[_0x3df25f];return _0x47ca1e;};'use strict';var emlformat=require(_0x5aae('0x0'));var rimraf=require(_0x5aae('0x1'));var zipdir=require(_0x5aae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5aae('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5aae('0x4'));var util=require(_0x5aae('0x5'));var path=require('path');var sox=require(_0x5aae('0x6'));var csv=require(_0x5aae('0x7'));var ejs=require(_0x5aae('0x8'));var fs=require('fs');var fs_extra=require(_0x5aae('0x9'));var _=require(_0x5aae('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5aae('0xb'));var toCsv=require(_0x5aae('0x7'));var querystring=require(_0x5aae('0xc'));var Papa=require(_0x5aae('0xd'));var Redis=require(_0x5aae('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5aae('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5aae('0x10'))(_0x5aae('0x11'));var utils=require(_0x5aae('0x12'));var config=require(_0x5aae('0x13'));var licenseUtil=require(_0x5aae('0x14'));var db=require(_0x5aae('0x15'))['db'];function respondWithStatusCode(_0x110ed2,_0x384c6d){_0x384c6d=_0x384c6d||0xcc;return function(_0xeab810){if(_0xeab810){return _0x110ed2['sendStatus'](_0x384c6d);}return _0x110ed2['status'](_0x384c6d)[_0x5aae('0x16')]();};}function respondWithResult(_0xf86e8c,_0x2aa4f9){_0x2aa4f9=_0x2aa4f9||0xc8;return function(_0x3bcd5f){if(_0x3bcd5f){return _0xf86e8c[_0x5aae('0x17')](_0x2aa4f9)[_0x5aae('0x18')](_0x3bcd5f);}};}function respondWithFilteredResult(_0x1b17e2,_0x3c1149){return function(_0x10328a){if(_0x10328a){var _0x2075bc=typeof _0x3c1149[_0x5aae('0x19')]==='undefined'&&typeof _0x3c1149[_0x5aae('0x1a')]==='undefined';var _0x2c0dac=_0x10328a['count'];var _0x50947d=_0x2075bc?0x0:_0x3c1149[_0x5aae('0x19')];var _0x1ccda6=_0x2075bc?_0x10328a[_0x5aae('0x1b')]:_0x3c1149[_0x5aae('0x19')]+_0x3c1149[_0x5aae('0x1a')];var _0x4f4ec9;if(_0x1ccda6>=_0x2c0dac){_0x1ccda6=_0x2c0dac;_0x4f4ec9=0xc8;}else{_0x4f4ec9=0xce;}_0x1b17e2[_0x5aae('0x17')](_0x4f4ec9);return _0x1b17e2[_0x5aae('0x1c')](_0x5aae('0x1d'),_0x50947d+'-'+_0x1ccda6+'/'+_0x2c0dac)[_0x5aae('0x18')](_0x10328a);}return null;};}function patchUpdates(_0x38a67f){return function(_0x11a0f7){try{jsonpatch[_0x5aae('0x1e')](_0x11a0f7,_0x38a67f,!![]);}catch(_0x432bfc){return BPromise['reject'](_0x432bfc);}return _0x11a0f7['save']();};}function saveUpdates(_0x507ef4,_0x501613){return function(_0x3a323a){if(_0x3a323a){return _0x3a323a[_0x5aae('0x1f')](_0x507ef4)[_0x5aae('0x20')](function(_0xef9145){return _0xef9145;});}return null;};}function removeEntity(_0x5863ec,_0x42536c){return function(_0x2d2f41){if(_0x2d2f41){return _0x2d2f41[_0x5aae('0x21')]()[_0x5aae('0x20')](function(){_0x5863ec[_0x5aae('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32adb5,_0x880666){return function(_0xfce1eb){if(!_0xfce1eb){_0x32adb5['sendStatus'](0x194);}return _0xfce1eb;};}function handleError(_0x33c08e,_0x175a2e){_0x175a2e=_0x175a2e||0x1f4;return function(_0x2987c8){logger['error'](_0x2987c8['stack']);if(_0x2987c8[_0x5aae('0x22')]){delete _0x2987c8['name'];}_0x33c08e[_0x5aae('0x17')](_0x175a2e)[_0x5aae('0x23')](_0x2987c8);};}exports[_0x5aae('0x24')]=function(_0x21e45f,_0x38a8a2){var _0x3f0aa2={},_0x546bae={},_0x32f7de={'count':0x0,'rows':[]};var _0x329d58=_[_0x5aae('0x25')](db['FreshdeskConfiguration'][_0x5aae('0x26')],function(_0x44491c){return{'name':_0x44491c['fieldName'],'type':_0x44491c[_0x5aae('0x27')][_0x5aae('0x28')]};});_0x546bae[_0x5aae('0x29')]=_[_0x5aae('0x25')](_0x329d58,_0x5aae('0x22'));_0x546bae['query']=_[_0x5aae('0x2a')](_0x21e45f[_0x5aae('0x2b')]);_0x546bae[_0x5aae('0x2c')]=_[_0x5aae('0x2d')](_0x546bae['model'],_0x546bae[_0x5aae('0x2b')]);_0x3f0aa2[_0x5aae('0x2e')]=_[_0x5aae('0x2d')](_0x546bae[_0x5aae('0x29')],qs[_0x5aae('0x2f')](_0x21e45f[_0x5aae('0x2b')]['fields']));_0x3f0aa2[_0x5aae('0x2e')]=_0x3f0aa2[_0x5aae('0x2e')][_0x5aae('0x30')]?_0x3f0aa2['attributes']:_0x546bae[_0x5aae('0x29')];if(!_0x21e45f['query']['hasOwnProperty'](_0x5aae('0x31'))){_0x3f0aa2[_0x5aae('0x1a')]=qs[_0x5aae('0x1a')](_0x21e45f['query'][_0x5aae('0x1a')]);_0x3f0aa2[_0x5aae('0x19')]=qs[_0x5aae('0x19')](_0x21e45f[_0x5aae('0x2b')]['offset']);}_0x3f0aa2['order']=qs[_0x5aae('0x32')](_0x21e45f[_0x5aae('0x2b')]['sort']);_0x3f0aa2[_0x5aae('0x33')]=qs['filters'](_[_0x5aae('0x34')](_0x21e45f[_0x5aae('0x2b')],_0x546bae['filters']),_0x329d58);if(_0x21e45f[_0x5aae('0x2b')]['filter']){_0x3f0aa2[_0x5aae('0x33')]=_[_0x5aae('0x35')](_0x3f0aa2['where'],{'$or':_[_0x5aae('0x25')](_0x329d58,function(_0x160db6){if(_0x160db6[_0x5aae('0x27')]!==_0x5aae('0x36')){var _0x30d15f={};_0x30d15f[_0x160db6[_0x5aae('0x22')]]={'$like':'%'+_0x21e45f[_0x5aae('0x2b')][_0x5aae('0x37')]+'%'};return _0x30d15f;}})});}_0x3f0aa2=_[_0x5aae('0x35')]({},_0x3f0aa2,_0x21e45f[_0x5aae('0x38')]);var _0x54a847={'where':_0x3f0aa2[_0x5aae('0x33')]};return db[_0x5aae('0x39')][_0x5aae('0x1b')](_0x54a847)['then'](function(_0x597b32){_0x32f7de[_0x5aae('0x1b')]=_0x597b32;if(_0x21e45f[_0x5aae('0x2b')][_0x5aae('0x3a')]){_0x3f0aa2[_0x5aae('0x3b')]=[{'all':!![]}];}return db[_0x5aae('0x39')][_0x5aae('0x3c')](_0x3f0aa2);})[_0x5aae('0x20')](function(_0x214529){_0x32f7de[_0x5aae('0x3d')]=_0x214529;return _0x32f7de;})[_0x5aae('0x20')](respondWithFilteredResult(_0x38a8a2,_0x3f0aa2))[_0x5aae('0x3e')](handleError(_0x38a8a2,null));};exports[_0x5aae('0x3f')]=function(_0x44f6b7,_0x2b39f7){var _0x35569c={'raw':![],'where':{'id':_0x44f6b7['params']['id']}},_0x39737c={};_0x39737c[_0x5aae('0x29')]=_[_0x5aae('0x2a')](db[_0x5aae('0x39')]['rawAttributes']);_0x39737c[_0x5aae('0x2b')]=_[_0x5aae('0x2a')](_0x44f6b7[_0x5aae('0x2b')]);_0x39737c['filters']=_[_0x5aae('0x2d')](_0x39737c['model'],_0x39737c[_0x5aae('0x2b')]);_0x35569c[_0x5aae('0x2e')]=_['intersection'](_0x39737c[_0x5aae('0x29')],qs[_0x5aae('0x2f')](_0x44f6b7[_0x5aae('0x2b')][_0x5aae('0x2f')]));_0x35569c[_0x5aae('0x2e')]=_0x35569c[_0x5aae('0x2e')][_0x5aae('0x30')]?_0x35569c[_0x5aae('0x2e')]:_0x39737c[_0x5aae('0x29')];if(_0x44f6b7[_0x5aae('0x2b')]['includeAll']){_0x35569c[_0x5aae('0x3b')]=[{'all':!![]}];}_0x35569c=_[_0x5aae('0x35')]({},_0x35569c,_0x44f6b7[_0x5aae('0x38')]);return db[_0x5aae('0x39')][_0x5aae('0x40')](_0x35569c)[_0x5aae('0x20')](handleEntityNotFound(_0x2b39f7,null))['then'](respondWithResult(_0x2b39f7,null))[_0x5aae('0x3e')](handleError(_0x2b39f7,null));};exports[_0x5aae('0x41')]=function(_0x4971fa,_0xe6a75){return db[_0x5aae('0x39')][_0x5aae('0x41')](_0x4971fa[_0x5aae('0x42')],{})['then'](respondWithResult(_0xe6a75,0xc9))[_0x5aae('0x3e')](handleError(_0xe6a75,null));};exports['update']=function(_0x1f80b7,_0x59b43e){if(_0x1f80b7[_0x5aae('0x42')]['id']){delete _0x1f80b7[_0x5aae('0x42')]['id'];}return db[_0x5aae('0x39')][_0x5aae('0x40')]({'where':{'id':_0x1f80b7['params']['id']}})['then'](handleEntityNotFound(_0x59b43e,null))['then'](saveUpdates(_0x1f80b7[_0x5aae('0x42')],null))[_0x5aae('0x20')](respondWithResult(_0x59b43e,null))[_0x5aae('0x3e')](handleError(_0x59b43e,null));};exports['destroy']=function(_0xcf6a76,_0x26e87f){return db[_0x5aae('0x39')][_0x5aae('0x40')]({'where':{'id':_0xcf6a76[_0x5aae('0x43')]['id']}})[_0x5aae('0x20')](handleEntityNotFound(_0x26e87f,null))['then'](removeEntity(_0x26e87f,null))[_0x5aae('0x3e')](handleError(_0x26e87f,null));};exports[_0x5aae('0x44')]=function(_0x562715,_0x47d70a,_0x3b02dc){var _0x2c830f={};var _0x1f34a4={};var _0x5cecfa;var _0x3d0e31;return db['FreshdeskConfiguration'][_0x5aae('0x45')]({'where':{'id':_0x562715['params']['id']}})[_0x5aae('0x20')](handleEntityNotFound(_0x47d70a,null))[_0x5aae('0x20')](function(_0x46abfe){if(_0x46abfe){_0x5cecfa=_0x46abfe;_0x1f34a4[_0x5aae('0x29')]=_['keys'](db['FreshdeskField']['rawAttributes']);_0x1f34a4[_0x5aae('0x2b')]=_[_0x5aae('0x2a')](_0x562715[_0x5aae('0x2b')]);_0x1f34a4['filters']=_['intersection'](_0x1f34a4[_0x5aae('0x29')],_0x1f34a4[_0x5aae('0x2b')]);_0x2c830f[_0x5aae('0x2e')]=_[_0x5aae('0x2d')](_0x1f34a4[_0x5aae('0x29')],qs[_0x5aae('0x2f')](_0x562715[_0x5aae('0x2b')][_0x5aae('0x2f')]));_0x2c830f[_0x5aae('0x2e')]=_0x2c830f[_0x5aae('0x2e')][_0x5aae('0x30')]?_0x2c830f[_0x5aae('0x2e')]:_0x1f34a4[_0x5aae('0x29')];_0x2c830f[_0x5aae('0x46')]=qs[_0x5aae('0x32')](_0x562715[_0x5aae('0x2b')][_0x5aae('0x32')]);_0x2c830f[_0x5aae('0x33')]=qs[_0x5aae('0x2c')](_[_0x5aae('0x34')](_0x562715[_0x5aae('0x2b')],_0x1f34a4['filters']));if(_0x562715[_0x5aae('0x2b')][_0x5aae('0x37')]){_0x2c830f[_0x5aae('0x33')]=_[_0x5aae('0x35')](_0x2c830f[_0x5aae('0x33')],{'$or':_[_0x5aae('0x25')](_0x2c830f['attributes'],function(_0x32e2a5){var _0x4ee265={};_0x4ee265[_0x32e2a5]={'$like':'%'+_0x562715[_0x5aae('0x2b')][_0x5aae('0x37')]+'%'};return _0x4ee265;})});}_0x2c830f=_[_0x5aae('0x35')]({},_0x2c830f,_0x562715[_0x5aae('0x38')]);return _0x5cecfa[_0x5aae('0x44')](_0x2c830f);}})['then'](function(_0xda7f8e){if(_0xda7f8e){_0x3d0e31=_0xda7f8e['length'];if(!_0x562715[_0x5aae('0x2b')][_0x5aae('0x47')](_0x5aae('0x31'))){_0x2c830f[_0x5aae('0x1a')]=qs[_0x5aae('0x1a')](_0x562715[_0x5aae('0x2b')][_0x5aae('0x1a')]);_0x2c830f[_0x5aae('0x19')]=qs[_0x5aae('0x19')](_0x562715['query'][_0x5aae('0x19')]);}return _0x5cecfa[_0x5aae('0x44')](_0x2c830f);}})['then'](function(_0x12134b){if(_0x12134b){return _0x12134b?{'count':_0x3d0e31,'rows':_0x12134b}:null;}})[_0x5aae('0x20')](respondWithResult(_0x47d70a,null))[_0x5aae('0x3e')](handleError(_0x47d70a,null));};exports[_0x5aae('0x48')]=function(_0x640193,_0x276953,_0x3c0f60){var _0x58da2a={};var _0x16209a={};var _0x1023c4;var _0x10625f;return db[_0x5aae('0x39')][_0x5aae('0x45')]({'where':{'id':_0x640193[_0x5aae('0x43')]['id']}})[_0x5aae('0x20')](handleEntityNotFound(_0x276953,null))[_0x5aae('0x20')](function(_0xc50e9){if(_0xc50e9){_0x1023c4=_0xc50e9;_0x16209a['model']=_['keys'](db['FreshdeskField'][_0x5aae('0x26')]);_0x16209a[_0x5aae('0x2b')]=_[_0x5aae('0x2a')](_0x640193['query']);_0x16209a['filters']=_['intersection'](_0x16209a[_0x5aae('0x29')],_0x16209a[_0x5aae('0x2b')]);_0x58da2a[_0x5aae('0x2e')]=_[_0x5aae('0x2d')](_0x16209a[_0x5aae('0x29')],qs[_0x5aae('0x2f')](_0x640193[_0x5aae('0x2b')][_0x5aae('0x2f')]));_0x58da2a[_0x5aae('0x2e')]=_0x58da2a[_0x5aae('0x2e')][_0x5aae('0x30')]?_0x58da2a[_0x5aae('0x2e')]:_0x16209a[_0x5aae('0x29')];_0x58da2a['order']=qs[_0x5aae('0x32')](_0x640193['query'][_0x5aae('0x32')]);_0x58da2a[_0x5aae('0x33')]=qs['filters'](_['pick'](_0x640193['query'],_0x16209a['filters']));if(_0x640193[_0x5aae('0x2b')]['filter']){_0x58da2a['where']=_[_0x5aae('0x35')](_0x58da2a[_0x5aae('0x33')],{'$or':_[_0x5aae('0x25')](_0x58da2a[_0x5aae('0x2e')],function(_0x2d9edd){var _0x59d3ce={};_0x59d3ce[_0x2d9edd]={'$like':'%'+_0x640193['query']['filter']+'%'};return _0x59d3ce;})});}_0x58da2a=_[_0x5aae('0x35')]({},_0x58da2a,_0x640193[_0x5aae('0x38')]);return _0x1023c4[_0x5aae('0x48')](_0x58da2a);}})[_0x5aae('0x20')](function(_0x5d44c6){if(_0x5d44c6){_0x10625f=_0x5d44c6[_0x5aae('0x30')];if(!_0x640193[_0x5aae('0x2b')]['hasOwnProperty'](_0x5aae('0x31'))){_0x58da2a['limit']=qs['limit'](_0x640193[_0x5aae('0x2b')][_0x5aae('0x1a')]);_0x58da2a['offset']=qs[_0x5aae('0x19')](_0x640193[_0x5aae('0x2b')][_0x5aae('0x19')]);}return _0x1023c4[_0x5aae('0x48')](_0x58da2a);}})[_0x5aae('0x20')](function(_0x3d366c){if(_0x3d366c){return _0x3d366c?{'count':_0x10625f,'rows':_0x3d366c}:null;}})[_0x5aae('0x20')](respondWithResult(_0x276953,null))['catch'](handleError(_0x276953,null));};exports['getDescriptions']=function(_0x4f233a,_0x303378,_0x4a41a8){var _0x538472={};var _0x4cbfc7={};var _0x2a6d4a;var _0xafe6e3;return db['FreshdeskConfiguration'][_0x5aae('0x45')]({'where':{'id':_0x4f233a[_0x5aae('0x43')]['id']}})[_0x5aae('0x20')](handleEntityNotFound(_0x303378,null))[_0x5aae('0x20')](function(_0x3e725f){if(_0x3e725f){_0x2a6d4a=_0x3e725f;_0x4cbfc7[_0x5aae('0x29')]=_[_0x5aae('0x2a')](db[_0x5aae('0x49')][_0x5aae('0x26')]);_0x4cbfc7[_0x5aae('0x2b')]=_[_0x5aae('0x2a')](_0x4f233a[_0x5aae('0x2b')]);_0x4cbfc7['filters']=_[_0x5aae('0x2d')](_0x4cbfc7['model'],_0x4cbfc7[_0x5aae('0x2b')]);_0x538472[_0x5aae('0x2e')]=_[_0x5aae('0x2d')](_0x4cbfc7[_0x5aae('0x29')],qs[_0x5aae('0x2f')](_0x4f233a['query'][_0x5aae('0x2f')]));_0x538472[_0x5aae('0x2e')]=_0x538472[_0x5aae('0x2e')][_0x5aae('0x30')]?_0x538472[_0x5aae('0x2e')]:_0x4cbfc7['model'];_0x538472[_0x5aae('0x46')]=qs[_0x5aae('0x32')](_0x4f233a[_0x5aae('0x2b')][_0x5aae('0x32')]);_0x538472[_0x5aae('0x33')]=qs['filters'](_[_0x5aae('0x34')](_0x4f233a[_0x5aae('0x2b')],_0x4cbfc7[_0x5aae('0x2c')]));if(_0x4f233a[_0x5aae('0x2b')][_0x5aae('0x37')]){_0x538472[_0x5aae('0x33')]=_[_0x5aae('0x35')](_0x538472[_0x5aae('0x33')],{'$or':_[_0x5aae('0x25')](_0x538472[_0x5aae('0x2e')],function(_0x33facb){var _0x4dbce1={};_0x4dbce1[_0x33facb]={'$like':'%'+_0x4f233a[_0x5aae('0x2b')][_0x5aae('0x37')]+'%'};return _0x4dbce1;})});}_0x538472=_['merge']({},_0x538472,_0x4f233a[_0x5aae('0x38')]);return _0x2a6d4a['getDescriptions'](_0x538472);}})['then'](function(_0x9dfcc9){if(_0x9dfcc9){_0xafe6e3=_0x9dfcc9[_0x5aae('0x30')];if(!_0x4f233a[_0x5aae('0x2b')][_0x5aae('0x47')](_0x5aae('0x31'))){_0x538472[_0x5aae('0x1a')]=qs['limit'](_0x4f233a[_0x5aae('0x2b')]['limit']);_0x538472[_0x5aae('0x19')]=qs[_0x5aae('0x19')](_0x4f233a[_0x5aae('0x2b')][_0x5aae('0x19')]);}return _0x2a6d4a['getDescriptions'](_0x538472);}})[_0x5aae('0x20')](function(_0x505421){if(_0x505421){return _0x505421?{'count':_0xafe6e3,'rows':_0x505421}:null;}})[_0x5aae('0x20')](respondWithResult(_0x303378,null))[_0x5aae('0x3e')](handleError(_0x303378,null));};exports[_0x5aae('0x4a')]=function(_0x128a68,_0x2fa36b,_0x2986a3){var _0x248c8c={};var _0x3ae700={};var _0x267243;var _0x29c431;return db['FreshdeskConfiguration'][_0x5aae('0x45')]({'where':{'id':_0x128a68[_0x5aae('0x43')]['id']}})['then'](handleEntityNotFound(_0x2fa36b,null))[_0x5aae('0x20')](function(_0x4648de){if(_0x4648de){_0x267243=_0x4648de;_0x3ae700[_0x5aae('0x29')]=_['keys'](db['Tag'][_0x5aae('0x26')]);_0x3ae700[_0x5aae('0x2b')]=_[_0x5aae('0x2a')](_0x128a68[_0x5aae('0x2b')]);_0x3ae700['filters']=_[_0x5aae('0x2d')](_0x3ae700['model'],_0x3ae700[_0x5aae('0x2b')]);_0x248c8c[_0x5aae('0x2e')]=_[_0x5aae('0x2d')](_0x3ae700['model'],qs[_0x5aae('0x2f')](_0x128a68[_0x5aae('0x2b')][_0x5aae('0x2f')]));_0x248c8c[_0x5aae('0x2e')]=_0x248c8c['attributes']['length']?_0x248c8c[_0x5aae('0x2e')]:_0x3ae700[_0x5aae('0x29')];_0x248c8c[_0x5aae('0x46')]=qs[_0x5aae('0x32')](_0x128a68[_0x5aae('0x2b')][_0x5aae('0x32')]);_0x248c8c[_0x5aae('0x33')]=qs['filters'](_[_0x5aae('0x34')](_0x128a68[_0x5aae('0x2b')],_0x3ae700[_0x5aae('0x2c')]));if(_0x128a68['query'][_0x5aae('0x37')]){_0x248c8c['where']=_[_0x5aae('0x35')](_0x248c8c['where'],{'$or':_['map'](_0x248c8c[_0x5aae('0x2e')],function(_0x35d8ae){var _0x22076b={};_0x22076b[_0x35d8ae]={'$like':'%'+_0x128a68['query']['filter']+'%'};return _0x22076b;})});}_0x248c8c=_[_0x5aae('0x35')]({},_0x248c8c,_0x128a68[_0x5aae('0x38')]);return _0x267243[_0x5aae('0x4a')](_0x248c8c);}})[_0x5aae('0x20')](function(_0x4b03de){if(_0x4b03de){_0x29c431=_0x4b03de[_0x5aae('0x30')];if(!_0x128a68['query']['hasOwnProperty'](_0x5aae('0x31'))){_0x248c8c[_0x5aae('0x1a')]=qs[_0x5aae('0x1a')](_0x128a68[_0x5aae('0x2b')][_0x5aae('0x1a')]);_0x248c8c[_0x5aae('0x19')]=qs[_0x5aae('0x19')](_0x128a68['query']['offset']);}return _0x267243[_0x5aae('0x4a')](_0x248c8c);}})[_0x5aae('0x20')](function(_0x4049e2){if(_0x4049e2){return _0x4049e2?{'count':_0x29c431,'rows':_0x4049e2}:null;}})[_0x5aae('0x20')](respondWithResult(_0x2fa36b,null))['catch'](handleError(_0x2fa36b,null));};exports[_0x5aae('0x4b')]=function(_0x2a183b,_0x29a8bf,_0x5f5bf7){if(_0x2a183b[_0x5aae('0x42')]['id']){delete _0x2a183b[_0x5aae('0x42')]['id'];}return db[_0x5aae('0x39')][_0x5aae('0x45')]({'where':{'id':_0x2a183b[_0x5aae('0x43')]['id']}})[_0x5aae('0x20')](handleEntityNotFound(_0x29a8bf,null))[_0x5aae('0x20')](function(_0x40c1af){if(_0x40c1af){return _0x40c1af[_0x5aae('0x4b')](_0x2a183b[_0x5aae('0x42')]['ids']||[]);}return null;})['then'](respondWithResult(_0x29a8bf,null))[_0x5aae('0x3e')](handleError(_0x29a8bf,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 6c721c5..7df55fe 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 _0x20e9=['lodash','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','int_freshdesk_configurations'];(function(_0x1d8238,_0x257618){var _0x2fbe18=function(_0x68a417){while(--_0x68a417){_0x1d8238['push'](_0x1d8238['shift']());}};_0x2fbe18(++_0x257618);}(_0x20e9,0xc0));var _0x920e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x20e9[_0x934425];return _0x31d596;};'use strict';var _=require(_0x920e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x920e('0x1'));var BPromise=require('bluebird');var rp=require(_0x920e('0x2'));var fs=require('fs');var path=require(_0x920e('0x3'));var rimraf=require(_0x920e('0x4'));var config=require(_0x920e('0x5'));var attributes=require(_0x920e('0x6'));module['exports']=function(_0x4ced0a,_0x12e602){return _0x4ced0a['define']('FreshdeskConfiguration',attributes,{'tableName':_0x920e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d2e=['define','int_freshdesk_configurations','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports'];(function(_0xd5349d,_0x526fa0){var _0x29d8c8=function(_0x239a0e){while(--_0x239a0e){_0xd5349d['push'](_0xd5349d['shift']());}};_0x29d8c8(++_0x526fa0);}(_0x7d2e,0x9e));var _0xe7d2=function(_0x4d0d2d,_0x4b4ca1){_0x4d0d2d=_0x4d0d2d-0x0;var _0x1e1a80=_0x7d2e[_0x4d0d2d];return _0x1e1a80;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7d2('0x0'))(_0xe7d2('0x1'));var moment=require(_0xe7d2('0x2'));var BPromise=require(_0xe7d2('0x3'));var rp=require(_0xe7d2('0x4'));var fs=require('fs');var path=require(_0xe7d2('0x5'));var rimraf=require(_0xe7d2('0x6'));var config=require(_0xe7d2('0x7'));var attributes=require(_0xe7d2('0x8'));module[_0xe7d2('0x9')]=function(_0x2b6358,_0x1b09bd){return _0x2b6358[_0xe7d2('0xa')]('FreshdeskConfiguration',attributes,{'tableName':_0xe7d2('0xb'),'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 d8c2aba..f7a624c 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 _0x03ba=['moment','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x03ba,0x142));var _0xa03b=function(_0x5f57a0,_0x120cf0){_0x5f57a0=_0x5f57a0-0x0;var _0x42e92=_0x03ba[_0x5f57a0];return _0x42e92;};'use strict';var _=require('lodash');var util=require(_0xa03b('0x0'));var moment=require(_0xa03b('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(_0xa03b('0x2'));var logger=require(_0xa03b('0x3'))('rpc');var config=require(_0xa03b('0x4'));var jayson=require(_0xa03b('0x5'));var client=jayson[_0xa03b('0x6')][_0xa03b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x36599b,_0x4114bc,_0x5a15da){return new BPromise(function(_0x28d169,_0x4f0d37){return client[_0xa03b('0x8')](_0x36599b,_0x5a15da)[_0xa03b('0x9')](function(_0x3e87a4){logger[_0xa03b('0xa')](_0xa03b('0xb'),_0x4114bc,_0xa03b('0xc'));logger['debug'](_0xa03b('0xd'),_0x4114bc,_0xa03b('0xc'),JSON[_0xa03b('0xe')](_0x3e87a4));if(_0x3e87a4[_0xa03b('0xf')]){if(_0x3e87a4['error'][_0xa03b('0x10')]===0x1f4){logger[_0xa03b('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4114bc,_0x3e87a4[_0xa03b('0xf')][_0xa03b('0x11')]);return _0x4f0d37(_0x3e87a4['error'][_0xa03b('0x11')]);}logger[_0xa03b('0xf')](_0xa03b('0xb'),_0x4114bc,_0x3e87a4['error'][_0xa03b('0x11')]);return _0x28d169(_0x3e87a4[_0xa03b('0xf')][_0xa03b('0x11')]);}else{logger[_0xa03b('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4114bc,_0xa03b('0xc'));_0x28d169(_0x3e87a4[_0xa03b('0x12')]['message']);}})['catch'](function(_0x1fa053){logger['error'](_0xa03b('0xb'),_0x4114bc,_0x1fa053);_0x4f0d37(_0x1fa053);});});} \ No newline at end of file +var _0x98ec=['code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2e3ffe,_0x49510e){var _0x57cbcd=function(_0x5c1177){while(--_0x5c1177){_0x2e3ffe['push'](_0x2e3ffe['shift']());}};_0x57cbcd(++_0x49510e);}(_0x98ec,0x76));var _0xc98e=function(_0x525c0e,_0x2da864){_0x525c0e=_0x525c0e-0x0;var _0x48985a=_0x98ec[_0x525c0e];return _0x48985a;};'use strict';var _=require(_0xc98e('0x0'));var util=require(_0xc98e('0x1'));var moment=require(_0xc98e('0x2'));var BPromise=require('bluebird');var rs=require(_0xc98e('0x3'));var fs=require('fs');var Redis=require(_0xc98e('0x4'));var db=require(_0xc98e('0x5'))['db'];var utils=require(_0xc98e('0x6'));var logger=require(_0xc98e('0x7'))(_0xc98e('0x8'));var config=require(_0xc98e('0x9'));var jayson=require(_0xc98e('0xa'));var client=jayson[_0xc98e('0xb')][_0xc98e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1795b9,_0x26dade,_0x3416d4){return new BPromise(function(_0x3a1419,_0x28e576){return client[_0xc98e('0xd')](_0x1795b9,_0x3416d4)['then'](function(_0x2d1eaa){logger[_0xc98e('0xe')](_0xc98e('0xf'),_0x26dade,'request\x20sent');logger['debug'](_0xc98e('0x10'),_0x26dade,_0xc98e('0x11'),JSON[_0xc98e('0x12')](_0x2d1eaa));if(_0x2d1eaa[_0xc98e('0x13')]){if(_0x2d1eaa[_0xc98e('0x13')][_0xc98e('0x14')]===0x1f4){logger[_0xc98e('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x26dade,_0x2d1eaa['error'][_0xc98e('0x15')]);return _0x28e576(_0x2d1eaa[_0xc98e('0x13')][_0xc98e('0x15')]);}logger[_0xc98e('0x13')](_0xc98e('0xf'),_0x26dade,_0x2d1eaa[_0xc98e('0x13')][_0xc98e('0x15')]);return _0x3a1419(_0x2d1eaa['error']['message']);}else{logger[_0xc98e('0xe')](_0xc98e('0xf'),_0x26dade,_0xc98e('0x11'));_0x3a1419(_0x2d1eaa[_0xc98e('0x16')][_0xc98e('0x15')]);}})['catch'](function(_0x57263c){logger['error'](_0xc98e('0xf'),_0x26dade,_0x57263c);_0x28e576(_0x57263c);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 78df635..2087332 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 _0x7591=['create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x2a4b7d,_0x4824ff){var _0x368497=function(_0x342b35){while(--_0x342b35){_0x2a4b7d['push'](_0x2a4b7d['shift']());}};_0x368497(++_0x4824ff);}(_0x7591,0xcb));var _0x1759=function(_0x14b0df,_0x4ee9cb){_0x14b0df=_0x14b0df-0x0;var _0x1e8a5f=_0x7591[_0x14b0df];return _0x1e8a5f;};'use strict';var multer=require(_0x1759('0x0'));var util=require(_0x1759('0x1'));var path=require('path');var timeout=require(_0x1759('0x2'));var express=require(_0x1759('0x3'));var router=express[_0x1759('0x4')]();var fs_extra=require(_0x1759('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1759('0x6'));var config=require(_0x1759('0x7'));var controller=require(_0x1759('0x8'));router[_0x1759('0x9')]('/',auth[_0x1759('0xa')](),controller[_0x1759('0xb')]);router[_0x1759('0x9')](_0x1759('0xc'),auth[_0x1759('0xa')](),controller['show']);router['post']('/',auth[_0x1759('0xa')](),controller[_0x1759('0xd')]);router[_0x1759('0xe')]('/:id',auth[_0x1759('0xa')](),controller[_0x1759('0xf')]);router['delete'](_0x1759('0xc'),auth[_0x1759('0xa')](),controller[_0x1759('0x10')]);module[_0x1759('0x11')]=router; \ No newline at end of file +var _0x2e98=['../../config/environment','get','isAuthenticated','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x2e98,0x184));var _0x82e9=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x2e98[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0x82e9('0x0'));var util=require(_0x82e9('0x1'));var path=require(_0x82e9('0x2'));var timeout=require(_0x82e9('0x3'));var express=require(_0x82e9('0x4'));var router=express[_0x82e9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x82e9('0x6'));var interaction=require(_0x82e9('0x7'));var config=require(_0x82e9('0x8'));var controller=require('./intFreshdeskField.controller');router[_0x82e9('0x9')]('/',auth[_0x82e9('0xa')](),controller['index']);router[_0x82e9('0x9')](_0x82e9('0xb'),auth[_0x82e9('0xa')](),controller[_0x82e9('0xc')]);router['post']('/',auth[_0x82e9('0xa')](),controller['create']);router[_0x82e9('0xd')](_0x82e9('0xb'),auth[_0x82e9('0xa')](),controller[_0x82e9('0xe')]);router[_0x82e9('0xf')](_0x82e9('0xb'),auth[_0x82e9('0xa')](),controller[_0x82e9('0x10')]);module[_0x82e9('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index d7f5f79..4b3e78f 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 _0xc0ac=['keyValue','string','STRING','BOOLEAN','sequelize','ENUM','variable','customVariable'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc0ac,0x164));var _0xcc0a=function(_0x2608c9,_0x4c52d8){_0x2608c9=_0x2608c9-0x0;var _0x62f5b1=_0xc0ac[_0x2608c9];return _0x62f5b1;};'use strict';var Sequelize=require(_0xcc0a('0x0'));module['exports']={'type':{'type':Sequelize[_0xcc0a('0x1')]('string',_0xcc0a('0x2'),_0xcc0a('0x3'),_0xcc0a('0x4'),'picklist'),'defaultValue':_0xcc0a('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xcc0a('0x6')]},'keyType':{'type':Sequelize[_0xcc0a('0x1')](_0xcc0a('0x5'),'variable',_0xcc0a('0x3'))},'keyContent':{'type':Sequelize[_0xcc0a('0x6')]},'idField':{'type':Sequelize[_0xcc0a('0x6')]},'nameField':{'type':Sequelize[_0xcc0a('0x6')]},'customField':{'type':Sequelize[_0xcc0a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd340=['string','STRING','variable','BOOLEAN','sequelize','exports','ENUM','customVariable','picklist'];(function(_0x503ffd,_0x8ecde){var _0x160437=function(_0x2d45dd){while(--_0x2d45dd){_0x503ffd['push'](_0x503ffd['shift']());}};_0x160437(++_0x8ecde);}(_0xd340,0x1cf));var _0x0d34=function(_0x3dd7e6,_0xdb9eda){_0x3dd7e6=_0x3dd7e6-0x0;var _0x485ba=_0xd340[_0x3dd7e6];return _0x485ba;};'use strict';var Sequelize=require(_0x0d34('0x0'));module[_0x0d34('0x1')]={'type':{'type':Sequelize[_0x0d34('0x2')]('string','variable',_0x0d34('0x3'),'keyValue',_0x0d34('0x4')),'defaultValue':_0x0d34('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x0d34('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x0d34('0x5'),_0x0d34('0x7'),_0x0d34('0x3'))},'keyContent':{'type':Sequelize[_0x0d34('0x6')]},'idField':{'type':Sequelize[_0x0d34('0x6')]},'nameField':{'type':Sequelize[_0x0d34('0x6')]},'customField':{'type':Sequelize[_0x0d34('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0d34('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index e57bb9a..4253fd4 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 _0x91a7=['filter','merge','where','VIRTUAL','options','findAll','rows','catch','rawAttributes','includeAll','include','find','create','body','params','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskField','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort'];(function(_0xa201ee,_0x37da32){var _0x3e104d=function(_0x4cd637){while(--_0x4cd637){_0xa201ee['push'](_0xa201ee['shift']());}};_0x3e104d(++_0x37da32);}(_0x91a7,0xe7));var _0x791a=function(_0x14dccc,_0x506ae6){_0x14dccc=_0x14dccc-0x0;var _0x3dd5e7=_0x91a7[_0x14dccc];return _0x3dd5e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x791a('0x0'));var zipdir=require(_0x791a('0x1'));var jsonpatch=require(_0x791a('0x2'));var rp=require('request-promise');var moment=require(_0x791a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x791a('0x4'));var util=require('util');var path=require('path');var sox=require(_0x791a('0x5'));var csv=require(_0x791a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x791a('0x7'));var _=require('lodash');var squel=require(_0x791a('0x8'));var crypto=require(_0x791a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x791a('0xa'));var toCsv=require(_0x791a('0x6'));var querystring=require(_0x791a('0xb'));var Papa=require(_0x791a('0xc'));var Redis=require(_0x791a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x791a('0xe'));var as=require(_0x791a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x791a('0x10'))(_0x791a('0x11'));var utils=require(_0x791a('0x12'));var config=require(_0x791a('0x13'));var licenseUtil=require(_0x791a('0x14'));var db=require(_0x791a('0x15'))['db'];function respondWithStatusCode(_0x53dc41,_0x5daecd){_0x5daecd=_0x5daecd||0xcc;return function(_0xc92016){if(_0xc92016){return _0x53dc41[_0x791a('0x16')](_0x5daecd);}return _0x53dc41['status'](_0x5daecd)[_0x791a('0x17')]();};}function respondWithResult(_0x3a2ec6,_0x5d5b11){_0x5d5b11=_0x5d5b11||0xc8;return function(_0x2887f0){if(_0x2887f0){return _0x3a2ec6[_0x791a('0x18')](_0x5d5b11)[_0x791a('0x19')](_0x2887f0);}};}function respondWithFilteredResult(_0x5cdf2,_0x55e845){return function(_0x2ce2e0){if(_0x2ce2e0){var _0x575d11=typeof _0x55e845[_0x791a('0x1a')]===_0x791a('0x1b')&&typeof _0x55e845['limit']===_0x791a('0x1b');var _0x5bea2e=_0x2ce2e0[_0x791a('0x1c')];var _0x52941d=_0x575d11?0x0:_0x55e845['offset'];var _0x588d00=_0x575d11?_0x2ce2e0[_0x791a('0x1c')]:_0x55e845['offset']+_0x55e845['limit'];var _0x39c60b;if(_0x588d00>=_0x5bea2e){_0x588d00=_0x5bea2e;_0x39c60b=0xc8;}else{_0x39c60b=0xce;}_0x5cdf2[_0x791a('0x18')](_0x39c60b);return _0x5cdf2[_0x791a('0x1d')](_0x791a('0x1e'),_0x52941d+'-'+_0x588d00+'/'+_0x5bea2e)['json'](_0x2ce2e0);}return null;};}function patchUpdates(_0x189c0d){return function(_0xcb5e66){try{jsonpatch[_0x791a('0x1f')](_0xcb5e66,_0x189c0d,!![]);}catch(_0x280f1e){return BPromise['reject'](_0x280f1e);}return _0xcb5e66[_0x791a('0x20')]();};}function saveUpdates(_0x2054c6,_0x25bae5){return function(_0x9e17b5){if(_0x9e17b5){return _0x9e17b5[_0x791a('0x21')](_0x2054c6)[_0x791a('0x22')](function(_0x2241a0){return _0x2241a0;});}return null;};}function removeEntity(_0x45a67d,_0x323c6a){return function(_0xe8e452){if(_0xe8e452){return _0xe8e452[_0x791a('0x23')]()['then'](function(){_0x45a67d[_0x791a('0x18')](0xcc)[_0x791a('0x17')]();});}};}function handleEntityNotFound(_0x380329,_0x2966b8){return function(_0x4d748a){if(!_0x4d748a){_0x380329[_0x791a('0x16')](0x194);}return _0x4d748a;};}function handleError(_0x2db3f7,_0x51dcca){_0x51dcca=_0x51dcca||0x1f4;return function(_0xdfa84f){logger[_0x791a('0x24')](_0xdfa84f[_0x791a('0x25')]);if(_0xdfa84f['name']){delete _0xdfa84f[_0x791a('0x26')];}_0x2db3f7[_0x791a('0x18')](_0x51dcca)[_0x791a('0x27')](_0xdfa84f);};}exports[_0x791a('0x28')]=function(_0x4f423,_0x1a9c6b){var _0x628816={},_0x889534={},_0x58bbc0={'count':0x0,'rows':[]};var _0xbc3436=_[_0x791a('0x29')](db[_0x791a('0x2a')]['rawAttributes'],function(_0x1cdda9){return{'name':_0x1cdda9['fieldName'],'type':_0x1cdda9[_0x791a('0x2b')][_0x791a('0x2c')]};});_0x889534[_0x791a('0x2d')]=_[_0x791a('0x29')](_0xbc3436,_0x791a('0x26'));_0x889534[_0x791a('0x2e')]=_[_0x791a('0x2f')](_0x4f423['query']);_0x889534[_0x791a('0x30')]=_[_0x791a('0x31')](_0x889534[_0x791a('0x2d')],_0x889534[_0x791a('0x2e')]);_0x628816[_0x791a('0x32')]=_['intersection'](_0x889534[_0x791a('0x2d')],qs[_0x791a('0x33')](_0x4f423[_0x791a('0x2e')][_0x791a('0x33')]));_0x628816[_0x791a('0x32')]=_0x628816['attributes'][_0x791a('0x34')]?_0x628816[_0x791a('0x32')]:_0x889534[_0x791a('0x2d')];if(!_0x4f423[_0x791a('0x2e')][_0x791a('0x35')]('nolimit')){_0x628816[_0x791a('0x36')]=qs['limit'](_0x4f423[_0x791a('0x2e')]['limit']);_0x628816['offset']=qs[_0x791a('0x1a')](_0x4f423[_0x791a('0x2e')][_0x791a('0x1a')]);}_0x628816[_0x791a('0x37')]=qs[_0x791a('0x38')](_0x4f423[_0x791a('0x2e')][_0x791a('0x38')]);_0x628816['where']=qs[_0x791a('0x30')](_['pick'](_0x4f423[_0x791a('0x2e')],_0x889534['filters']),_0xbc3436);if(_0x4f423[_0x791a('0x2e')][_0x791a('0x39')]){_0x628816['where']=_[_0x791a('0x3a')](_0x628816[_0x791a('0x3b')],{'$or':_['map'](_0xbc3436,function(_0x45fbfa){if(_0x45fbfa[_0x791a('0x2b')]!==_0x791a('0x3c')){var _0x23db7d={};_0x23db7d[_0x45fbfa[_0x791a('0x26')]]={'$like':'%'+_0x4f423[_0x791a('0x2e')][_0x791a('0x39')]+'%'};return _0x23db7d;}})});}_0x628816=_[_0x791a('0x3a')]({},_0x628816,_0x4f423[_0x791a('0x3d')]);var _0xeafbb5={'where':_0x628816['where']};return db[_0x791a('0x2a')][_0x791a('0x1c')](_0xeafbb5)[_0x791a('0x22')](function(_0x4efbf6){_0x58bbc0[_0x791a('0x1c')]=_0x4efbf6;if(_0x4f423['query']['includeAll']){_0x628816['include']=[{'all':!![]}];}return db[_0x791a('0x2a')][_0x791a('0x3e')](_0x628816);})['then'](function(_0x415c44){_0x58bbc0[_0x791a('0x3f')]=_0x415c44;return _0x58bbc0;})[_0x791a('0x22')](respondWithFilteredResult(_0x1a9c6b,_0x628816))[_0x791a('0x40')](handleError(_0x1a9c6b,null));};exports['show']=function(_0x483336,_0x57b9ba){var _0x2f0395={'raw':!![],'where':{'id':_0x483336['params']['id']}},_0x216dd3={};_0x216dd3[_0x791a('0x2d')]=_[_0x791a('0x2f')](db[_0x791a('0x2a')][_0x791a('0x41')]);_0x216dd3['query']=_[_0x791a('0x2f')](_0x483336['query']);_0x216dd3[_0x791a('0x30')]=_[_0x791a('0x31')](_0x216dd3[_0x791a('0x2d')],_0x216dd3[_0x791a('0x2e')]);_0x2f0395[_0x791a('0x32')]=_['intersection'](_0x216dd3[_0x791a('0x2d')],qs[_0x791a('0x33')](_0x483336[_0x791a('0x2e')][_0x791a('0x33')]));_0x2f0395[_0x791a('0x32')]=_0x2f0395['attributes'][_0x791a('0x34')]?_0x2f0395[_0x791a('0x32')]:_0x216dd3['model'];if(_0x483336['query'][_0x791a('0x42')]){_0x2f0395[_0x791a('0x43')]=[{'all':!![]}];}_0x2f0395=_[_0x791a('0x3a')]({},_0x2f0395,_0x483336['options']);return db['FreshdeskField'][_0x791a('0x44')](_0x2f0395)[_0x791a('0x22')](handleEntityNotFound(_0x57b9ba,null))['then'](respondWithResult(_0x57b9ba,null))[_0x791a('0x40')](handleError(_0x57b9ba,null));};exports[_0x791a('0x45')]=function(_0x3eac77,_0x549980){return db['FreshdeskField'][_0x791a('0x45')](_0x3eac77[_0x791a('0x46')],{})[_0x791a('0x22')](respondWithResult(_0x549980,0xc9))[_0x791a('0x40')](handleError(_0x549980,null));};exports['update']=function(_0x2d7c7d,_0x9f768a){if(_0x2d7c7d[_0x791a('0x46')]['id']){delete _0x2d7c7d[_0x791a('0x46')]['id'];}return db['FreshdeskField'][_0x791a('0x44')]({'where':{'id':_0x2d7c7d[_0x791a('0x47')]['id']}})[_0x791a('0x22')](handleEntityNotFound(_0x9f768a,null))[_0x791a('0x22')](saveUpdates(_0x2d7c7d[_0x791a('0x46')],null))[_0x791a('0x22')](respondWithResult(_0x9f768a,null))[_0x791a('0x40')](handleError(_0x9f768a,null));};exports['destroy']=function(_0xdcb1b,_0x1fd826){return db['FreshdeskField'][_0x791a('0x44')]({'where':{'id':_0xdcb1b[_0x791a('0x47')]['id']}})['then'](handleEntityNotFound(_0x1fd826,null))[_0x791a('0x22')](removeEntity(_0x1fd826,null))[_0x791a('0x40')](handleError(_0x1fd826,null));}; \ No newline at end of file +var _0xe605=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','FreshdeskField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','fields','find','create','body','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x3ce364,_0x15099c){var _0x4b8ca2=function(_0x324db2){while(--_0x324db2){_0x3ce364['push'](_0x3ce364['shift']());}};_0x4b8ca2(++_0x15099c);}(_0xe605,0x92));var _0x5e60=function(_0x2dad1b,_0xdb8cea){_0x2dad1b=_0x2dad1b-0x0;var _0x12e4c2=_0xe605[_0x2dad1b];return _0x12e4c2;};'use strict';var emlformat=require(_0x5e60('0x0'));var rimraf=require(_0x5e60('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5e60('0x2'));var rp=require(_0x5e60('0x3'));var moment=require(_0x5e60('0x4'));var BPromise=require(_0x5e60('0x5'));var Mustache=require(_0x5e60('0x6'));var util=require(_0x5e60('0x7'));var path=require(_0x5e60('0x8'));var sox=require(_0x5e60('0x9'));var csv=require(_0x5e60('0xa'));var ejs=require(_0x5e60('0xb'));var fs=require('fs');var fs_extra=require(_0x5e60('0xc'));var _=require(_0x5e60('0xd'));var squel=require('squel');var crypto=require(_0x5e60('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5e60('0xf'));var Papa=require(_0x5e60('0x10'));var Redis=require(_0x5e60('0x11'));var authService=require(_0x5e60('0x12'));var qs=require(_0x5e60('0x13'));var as=require(_0x5e60('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e60('0x15'))('api');var utils=require(_0x5e60('0x16'));var config=require(_0x5e60('0x17'));var licenseUtil=require(_0x5e60('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x371df7,_0x178782){_0x178782=_0x178782||0xcc;return function(_0x1f4e14){if(_0x1f4e14){return _0x371df7[_0x5e60('0x19')](_0x178782);}return _0x371df7[_0x5e60('0x1a')](_0x178782)[_0x5e60('0x1b')]();};}function respondWithResult(_0x4fd10e,_0x209adb){_0x209adb=_0x209adb||0xc8;return function(_0x45304f){if(_0x45304f){return _0x4fd10e[_0x5e60('0x1a')](_0x209adb)[_0x5e60('0x1c')](_0x45304f);}};}function respondWithFilteredResult(_0x5b028f,_0x20af5f){return function(_0x529ffe){if(_0x529ffe){var _0x1ffd77=typeof _0x20af5f[_0x5e60('0x1d')]==='undefined'&&typeof _0x20af5f[_0x5e60('0x1e')]===_0x5e60('0x1f');var _0xaa7d05=_0x529ffe[_0x5e60('0x20')];var _0x5c485d=_0x1ffd77?0x0:_0x20af5f[_0x5e60('0x1d')];var _0x22d718=_0x1ffd77?_0x529ffe['count']:_0x20af5f[_0x5e60('0x1d')]+_0x20af5f[_0x5e60('0x1e')];var _0x17c630;if(_0x22d718>=_0xaa7d05){_0x22d718=_0xaa7d05;_0x17c630=0xc8;}else{_0x17c630=0xce;}_0x5b028f[_0x5e60('0x1a')](_0x17c630);return _0x5b028f[_0x5e60('0x21')](_0x5e60('0x22'),_0x5c485d+'-'+_0x22d718+'/'+_0xaa7d05)[_0x5e60('0x1c')](_0x529ffe);}return null;};}function patchUpdates(_0x524c93){return function(_0x3282e4){try{jsonpatch[_0x5e60('0x23')](_0x3282e4,_0x524c93,!![]);}catch(_0x228f13){return BPromise['reject'](_0x228f13);}return _0x3282e4[_0x5e60('0x24')]();};}function saveUpdates(_0x5d77dd,_0x376069){return function(_0x1a44e5){if(_0x1a44e5){return _0x1a44e5[_0x5e60('0x25')](_0x5d77dd)[_0x5e60('0x26')](function(_0x34e98d){return _0x34e98d;});}return null;};}function removeEntity(_0x2a499e,_0x2636f1){return function(_0x5d2c03){if(_0x5d2c03){return _0x5d2c03[_0x5e60('0x27')]()[_0x5e60('0x26')](function(){_0x2a499e[_0x5e60('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45cb62,_0x56e3a5){return function(_0x2d8aac){if(!_0x2d8aac){_0x45cb62[_0x5e60('0x19')](0x194);}return _0x2d8aac;};}function handleError(_0x4a0dbc,_0x3bedea){_0x3bedea=_0x3bedea||0x1f4;return function(_0x5712f7){logger[_0x5e60('0x28')](_0x5712f7[_0x5e60('0x29')]);if(_0x5712f7['name']){delete _0x5712f7[_0x5e60('0x2a')];}_0x4a0dbc[_0x5e60('0x1a')](_0x3bedea)['send'](_0x5712f7);};}exports[_0x5e60('0x2b')]=function(_0xac9c7a,_0x52c97c){var _0x5431a8={},_0x52f668={},_0xf25956={'count':0x0,'rows':[]};var _0x235cc7=_[_0x5e60('0x2c')](db[_0x5e60('0x2d')][_0x5e60('0x2e')],function(_0x558197){return{'name':_0x558197[_0x5e60('0x2f')],'type':_0x558197[_0x5e60('0x30')]['key']};});_0x52f668[_0x5e60('0x31')]=_['map'](_0x235cc7,'name');_0x52f668[_0x5e60('0x32')]=_[_0x5e60('0x33')](_0xac9c7a[_0x5e60('0x32')]);_0x52f668[_0x5e60('0x34')]=_[_0x5e60('0x35')](_0x52f668[_0x5e60('0x31')],_0x52f668[_0x5e60('0x32')]);_0x5431a8[_0x5e60('0x36')]=_[_0x5e60('0x35')](_0x52f668[_0x5e60('0x31')],qs['fields'](_0xac9c7a[_0x5e60('0x32')]['fields']));_0x5431a8['attributes']=_0x5431a8[_0x5e60('0x36')][_0x5e60('0x37')]?_0x5431a8['attributes']:_0x52f668[_0x5e60('0x31')];if(!_0xac9c7a['query'][_0x5e60('0x38')](_0x5e60('0x39'))){_0x5431a8[_0x5e60('0x1e')]=qs[_0x5e60('0x1e')](_0xac9c7a[_0x5e60('0x32')][_0x5e60('0x1e')]);_0x5431a8[_0x5e60('0x1d')]=qs[_0x5e60('0x1d')](_0xac9c7a['query'][_0x5e60('0x1d')]);}_0x5431a8[_0x5e60('0x3a')]=qs[_0x5e60('0x3b')](_0xac9c7a[_0x5e60('0x32')][_0x5e60('0x3b')]);_0x5431a8[_0x5e60('0x3c')]=qs[_0x5e60('0x34')](_['pick'](_0xac9c7a[_0x5e60('0x32')],_0x52f668[_0x5e60('0x34')]),_0x235cc7);if(_0xac9c7a['query']['filter']){_0x5431a8[_0x5e60('0x3c')]=_[_0x5e60('0x3d')](_0x5431a8[_0x5e60('0x3c')],{'$or':_[_0x5e60('0x2c')](_0x235cc7,function(_0x31b900){if(_0x31b900['type']!==_0x5e60('0x3e')){var _0x413bf0={};_0x413bf0[_0x31b900[_0x5e60('0x2a')]]={'$like':'%'+_0xac9c7a[_0x5e60('0x32')][_0x5e60('0x3f')]+'%'};return _0x413bf0;}})});}_0x5431a8=_[_0x5e60('0x3d')]({},_0x5431a8,_0xac9c7a[_0x5e60('0x40')]);var _0x54022a={'where':_0x5431a8[_0x5e60('0x3c')]};return db[_0x5e60('0x2d')]['count'](_0x54022a)['then'](function(_0x47a6df){_0xf25956[_0x5e60('0x20')]=_0x47a6df;if(_0xac9c7a[_0x5e60('0x32')][_0x5e60('0x41')]){_0x5431a8[_0x5e60('0x42')]=[{'all':!![]}];}return db['FreshdeskField'][_0x5e60('0x43')](_0x5431a8);})[_0x5e60('0x26')](function(_0x4b6192){_0xf25956['rows']=_0x4b6192;return _0xf25956;})[_0x5e60('0x26')](respondWithFilteredResult(_0x52c97c,_0x5431a8))[_0x5e60('0x44')](handleError(_0x52c97c,null));};exports[_0x5e60('0x45')]=function(_0x38ff1d,_0x39ab09){var _0x3899ae={'raw':!![],'where':{'id':_0x38ff1d[_0x5e60('0x46')]['id']}},_0x2522d2={};_0x2522d2[_0x5e60('0x31')]=_['keys'](db[_0x5e60('0x2d')][_0x5e60('0x2e')]);_0x2522d2['query']=_[_0x5e60('0x33')](_0x38ff1d[_0x5e60('0x32')]);_0x2522d2[_0x5e60('0x34')]=_[_0x5e60('0x35')](_0x2522d2[_0x5e60('0x31')],_0x2522d2['query']);_0x3899ae[_0x5e60('0x36')]=_[_0x5e60('0x35')](_0x2522d2[_0x5e60('0x31')],qs[_0x5e60('0x47')](_0x38ff1d['query']['fields']));_0x3899ae['attributes']=_0x3899ae[_0x5e60('0x36')][_0x5e60('0x37')]?_0x3899ae[_0x5e60('0x36')]:_0x2522d2[_0x5e60('0x31')];if(_0x38ff1d[_0x5e60('0x32')][_0x5e60('0x41')]){_0x3899ae['include']=[{'all':!![]}];}_0x3899ae=_[_0x5e60('0x3d')]({},_0x3899ae,_0x38ff1d[_0x5e60('0x40')]);return db[_0x5e60('0x2d')][_0x5e60('0x48')](_0x3899ae)[_0x5e60('0x26')](handleEntityNotFound(_0x39ab09,null))[_0x5e60('0x26')](respondWithResult(_0x39ab09,null))[_0x5e60('0x44')](handleError(_0x39ab09,null));};exports['create']=function(_0x24c757,_0x3ed45d){return db[_0x5e60('0x2d')][_0x5e60('0x49')](_0x24c757[_0x5e60('0x4a')],{})[_0x5e60('0x26')](respondWithResult(_0x3ed45d,0xc9))[_0x5e60('0x44')](handleError(_0x3ed45d,null));};exports[_0x5e60('0x25')]=function(_0x1518bd,_0x350d6d){if(_0x1518bd[_0x5e60('0x4a')]['id']){delete _0x1518bd[_0x5e60('0x4a')]['id'];}return db[_0x5e60('0x2d')][_0x5e60('0x48')]({'where':{'id':_0x1518bd[_0x5e60('0x46')]['id']}})[_0x5e60('0x26')](handleEntityNotFound(_0x350d6d,null))[_0x5e60('0x26')](saveUpdates(_0x1518bd[_0x5e60('0x4a')],null))['then'](respondWithResult(_0x350d6d,null))['catch'](handleError(_0x350d6d,null));};exports[_0x5e60('0x27')]=function(_0x4d3588,_0x3525d){return db[_0x5e60('0x2d')][_0x5e60('0x48')]({'where':{'id':_0x4d3588[_0x5e60('0x46')]['id']}})[_0x5e60('0x26')](handleEntityNotFound(_0x3525d,null))[_0x5e60('0x26')](removeEntity(_0x3525d,null))['catch'](handleError(_0x3525d,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index f9943bf..ecf3327 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 _0xe16b=['bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','idField','FieldId','util','../../config/logger','api','moment'];(function(_0x24453c,_0x1a7751){var _0x29e233=function(_0x12682d){while(--_0x12682d){_0x24453c['push'](_0x24453c['shift']());}};_0x29e233(++_0x1a7751);}(_0xe16b,0x155));var _0xbe16=function(_0x343729,_0x15555f){_0x343729=_0x343729-0x0;var _0x35365a=_0xe16b[_0x343729];return _0x35365a;};'use strict';var _=require('lodash');var util=require(_0xbe16('0x0'));var logger=require(_0xbe16('0x1'))(_0xbe16('0x2'));var moment=require(_0xbe16('0x3'));var BPromise=require(_0xbe16('0x4'));var rp=require(_0xbe16('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbe16('0x6'));var config=require(_0xbe16('0x7'));var attributes=require(_0xbe16('0x8'));module[_0xbe16('0x9')]=function(_0x1b6cf4,_0x555e1e){return _0x1b6cf4[_0xbe16('0xa')](_0xbe16('0xb'),attributes,{'tableName':_0xbe16('0xc'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xbe16('0xd'),_0xbe16('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdd5f=['lodash','../../config/logger','moment','bluebird','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField'];(function(_0x2f46ce,_0x52ba06){var _0x423481=function(_0x571105){while(--_0x571105){_0x2f46ce['push'](_0x2f46ce['shift']());}};_0x423481(++_0x52ba06);}(_0xdd5f,0x195));var _0xfdd5=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xdd5f[_0x24f31b];return _0x488401;};'use strict';var _=require(_0xfdd5('0x0'));var util=require('util');var logger=require(_0xfdd5('0x1'))('api');var moment=require(_0xfdd5('0x2'));var BPromise=require(_0xfdd5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfdd5('0x4'));var attributes=require(_0xfdd5('0x5'));module[_0xfdd5('0x6')]=function(_0x102410,_0x305ab3){return _0x102410[_0xfdd5('0x7')](_0xfdd5('0x8'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField','FieldId'],'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 86c9430..e6d64df 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 _0x1a09=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x13b07a,_0x49cfc3){var _0xdcbe0=function(_0x45dee2){while(--_0x45dee2){_0x13b07a['push'](_0x13b07a['shift']());}};_0xdcbe0(++_0x49cfc3);}(_0x1a09,0xdb));var _0x91a0=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x1a09[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x91a0('0x0'));var util=require(_0x91a0('0x1'));var moment=require('moment');var BPromise=require(_0x91a0('0x2'));var rs=require(_0x91a0('0x3'));var fs=require('fs');var Redis=require(_0x91a0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91a0('0x5'));var logger=require(_0x91a0('0x6'))(_0x91a0('0x7'));var config=require(_0x91a0('0x8'));var jayson=require(_0x91a0('0x9'));var client=jayson[_0x91a0('0xa')][_0x91a0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a86a3,_0x210944,_0x15a8b0){return new BPromise(function(_0x56605e,_0x1bb51d){return client[_0x91a0('0xc')](_0x3a86a3,_0x15a8b0)[_0x91a0('0xd')](function(_0x1e9c8c){logger[_0x91a0('0xe')](_0x91a0('0xf'),_0x210944,'request\x20sent');logger[_0x91a0('0x10')](_0x91a0('0x11'),_0x210944,_0x91a0('0x12'),JSON[_0x91a0('0x13')](_0x1e9c8c));if(_0x1e9c8c['error']){if(_0x1e9c8c[_0x91a0('0x14')]['code']===0x1f4){logger[_0x91a0('0x14')]('FreshdeskField,\x20%s,\x20%s',_0x210944,_0x1e9c8c[_0x91a0('0x14')][_0x91a0('0x15')]);return _0x1bb51d(_0x1e9c8c[_0x91a0('0x14')][_0x91a0('0x15')]);}logger[_0x91a0('0x14')](_0x91a0('0xf'),_0x210944,_0x1e9c8c['error'][_0x91a0('0x15')]);return _0x56605e(_0x1e9c8c[_0x91a0('0x14')][_0x91a0('0x15')]);}else{logger['info']('FreshdeskField,\x20%s,\x20%s',_0x210944,_0x91a0('0x12'));_0x56605e(_0x1e9c8c[_0x91a0('0x16')][_0x91a0('0x15')]);}})[_0x91a0('0x17')](function(_0x34338f){logger[_0x91a0('0x14')](_0x91a0('0xf'),_0x210944,_0x34338f);_0x1bb51d(_0x34338f);});});} \ No newline at end of file +var _0x8e3c=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3f5bc0,_0x18a04c){var _0x2d33be=function(_0x19e4b3){while(--_0x19e4b3){_0x3f5bc0['push'](_0x3f5bc0['shift']());}};_0x2d33be(++_0x18a04c);}(_0x8e3c,0x1ac));var _0xc8e3=function(_0x3c00e9,_0x1f46cc){_0x3c00e9=_0x3c00e9-0x0;var _0x7b1d40=_0x8e3c[_0x3c00e9];return _0x7b1d40;};'use strict';var _=require(_0xc8e3('0x0'));var util=require(_0xc8e3('0x1'));var moment=require(_0xc8e3('0x2'));var BPromise=require(_0xc8e3('0x3'));var rs=require(_0xc8e3('0x4'));var fs=require('fs');var Redis=require(_0xc8e3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc8e3('0x6'));var logger=require(_0xc8e3('0x7'))('rpc');var config=require(_0xc8e3('0x8'));var jayson=require(_0xc8e3('0x9'));var client=jayson[_0xc8e3('0xa')][_0xc8e3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5034d4,_0x6c849d,_0x482c84){return new BPromise(function(_0x2d8d2c,_0x152cf9){return client[_0xc8e3('0xc')](_0x5034d4,_0x482c84)[_0xc8e3('0xd')](function(_0x1b62a4){logger[_0xc8e3('0xe')](_0xc8e3('0xf'),_0x6c849d,_0xc8e3('0x10'));logger[_0xc8e3('0x11')](_0xc8e3('0x12'),_0x6c849d,_0xc8e3('0x10'),JSON[_0xc8e3('0x13')](_0x1b62a4));if(_0x1b62a4[_0xc8e3('0x14')]){if(_0x1b62a4[_0xc8e3('0x14')]['code']===0x1f4){logger[_0xc8e3('0x14')](_0xc8e3('0xf'),_0x6c849d,_0x1b62a4[_0xc8e3('0x14')][_0xc8e3('0x15')]);return _0x152cf9(_0x1b62a4[_0xc8e3('0x14')][_0xc8e3('0x15')]);}logger['error']('FreshdeskField,\x20%s,\x20%s',_0x6c849d,_0x1b62a4[_0xc8e3('0x14')][_0xc8e3('0x15')]);return _0x2d8d2c(_0x1b62a4[_0xc8e3('0x14')][_0xc8e3('0x15')]);}else{logger[_0xc8e3('0xe')](_0xc8e3('0xf'),_0x6c849d,'request\x20sent');_0x2d8d2c(_0x1b62a4[_0xc8e3('0x16')][_0xc8e3('0x15')]);}})[_0xc8e3('0x17')](function(_0x55c175){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x6c849d,_0x55c175);_0x152cf9(_0x55c175);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index dbd6689..b4b8398 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 _0xbee3=['isAuthenticated','/:id','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x47ccf4,_0x455a25){var _0x100b83=function(_0x4f8d8c){while(--_0x4f8d8c){_0x47ccf4['push'](_0x47ccf4['shift']());}};_0x100b83(++_0x455a25);}(_0xbee3,0xd5));var _0x3bee=function(_0x1d1724,_0xf2e965){_0x1d1724=_0x1d1724-0x0;var _0x38897f=_0xbee3[_0x1d1724];return _0x38897f;};'use strict';var multer=require('multer');var util=require(_0x3bee('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3bee('0x1'));var router=express[_0x3bee('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x3bee('0x3'));var interaction=require(_0x3bee('0x4'));var config=require(_0x3bee('0x5'));var controller=require('./intFreshsalesAccount.controller');router[_0x3bee('0x6')]('/',auth[_0x3bee('0x7')](),controller['index']);router[_0x3bee('0x6')](_0x3bee('0x8'),auth[_0x3bee('0x7')](),controller[_0x3bee('0x9')]);router[_0x3bee('0x6')](_0x3bee('0xa'),auth[_0x3bee('0x7')](),controller['getConfigurations']);router[_0x3bee('0x6')](_0x3bee('0xb'),auth[_0x3bee('0x7')](),controller[_0x3bee('0xc')]);router[_0x3bee('0xd')]('/',auth[_0x3bee('0x7')](),controller['create']);router[_0x3bee('0xd')]('/:id/configurations',auth[_0x3bee('0x7')](),controller[_0x3bee('0xe')]);router[_0x3bee('0xf')](_0x3bee('0x8'),auth[_0x3bee('0x7')](),controller[_0x3bee('0x10')]);router[_0x3bee('0x11')]('/:id',auth[_0x3bee('0x7')](),controller[_0x3bee('0x12')]);module[_0x3bee('0x13')]=router; \ No newline at end of file +var _0x1be1=['getFields','post','create','addConfiguration','/:id','delete','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesAccount.controller','get','isAuthenticated','show','/:id/configurations','/:id/fields'];(function(_0x19fbfb,_0xe8c39b){var _0x5e6f51=function(_0x4dfe23){while(--_0x4dfe23){_0x19fbfb['push'](_0x19fbfb['shift']());}};_0x5e6f51(++_0xe8c39b);}(_0x1be1,0x192));var _0x11be=function(_0x1067ef,_0x117979){_0x1067ef=_0x1067ef-0x0;var _0xf327e6=_0x1be1[_0x1067ef];return _0xf327e6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x11be('0x0'));var timeout=require(_0x11be('0x1'));var express=require('express');var router=express[_0x11be('0x2')]();var fs_extra=require(_0x11be('0x3'));var auth=require(_0x11be('0x4'));var interaction=require(_0x11be('0x5'));var config=require('../../config/environment');var controller=require(_0x11be('0x6'));router[_0x11be('0x7')]('/',auth[_0x11be('0x8')](),controller['index']);router[_0x11be('0x7')]('/:id',auth[_0x11be('0x8')](),controller[_0x11be('0x9')]);router[_0x11be('0x7')](_0x11be('0xa'),auth[_0x11be('0x8')](),controller['getConfigurations']);router[_0x11be('0x7')](_0x11be('0xb'),auth['isAuthenticated'](),controller[_0x11be('0xc')]);router[_0x11be('0xd')]('/',auth[_0x11be('0x8')](),controller[_0x11be('0xe')]);router['post'](_0x11be('0xa'),auth[_0x11be('0x8')](),controller[_0x11be('0xf')]);router['put'](_0x11be('0x10'),auth[_0x11be('0x8')](),controller['update']);router[_0x11be('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 8b0670c..4b6fcea 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 _0xc2c7=['exports','STRING','username','remoteUri'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xc2c7,0x134));var _0x7c2c=function(_0x118d75,_0x4f627){_0x118d75=_0x118d75-0x0;var _0x178c06=_0xc2c7[_0x118d75];return _0x178c06;};'use strict';var Sequelize=require('sequelize');module[_0x7c2c('0x0')]={'name':{'type':Sequelize[_0x7c2c('0x1')]},'description':{'type':Sequelize[_0x7c2c('0x1')]},'username':{'type':Sequelize[_0x7c2c('0x1')],'unique':_0x7c2c('0x2')},'apiKey':{'type':Sequelize[_0x7c2c('0x1')]},'remoteUri':{'type':Sequelize[_0x7c2c('0x1')],'unique':_0x7c2c('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x3de3=['username','remoteUri','sequelize','STRING'];(function(_0x2a56ad,_0x2b94bf){var _0x425175=function(_0x342f20){while(--_0x342f20){_0x2a56ad['push'](_0x2a56ad['shift']());}};_0x425175(++_0x2b94bf);}(_0x3de3,0x1ce));var _0x33de=function(_0x4793c7,_0x4fc0e0){_0x4793c7=_0x4793c7-0x0;var _0x131489=_0x3de3[_0x4793c7];return _0x131489;};'use strict';var Sequelize=require(_0x33de('0x0'));module['exports']={'name':{'type':Sequelize[_0x33de('0x1')]},'description':{'type':Sequelize[_0x33de('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x33de('0x2')},'apiKey':{'type':Sequelize[_0x33de('0x1')]},'remoteUri':{'type':Sequelize[_0x33de('0x1')],'unique':_0x33de('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 6f6a67e..d78a406 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 _0x32d2=['addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','nolimit','sort','where','pick','filter','options','FreshsalesAccount','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','getConfigurations','findOne','FreshsalesConfiguration','order','merge','hasOwnProperty'];(function(_0x3250a5,_0xb2e5bf){var _0x4f510e=function(_0xc5d6f5){while(--_0xc5d6f5){_0x3250a5['push'](_0x3250a5['shift']());}};_0x4f510e(++_0xb2e5bf);}(_0x32d2,0x1bb));var _0x232d=function(_0x41fd66,_0x1c67ab){_0x41fd66=_0x41fd66-0x0;var _0x2cb2aa=_0x32d2[_0x41fd66];return _0x2cb2aa;};'use strict';var emlformat=require(_0x232d('0x0'));var rimraf=require(_0x232d('0x1'));var zipdir=require(_0x232d('0x2'));var jsonpatch=require(_0x232d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x232d('0x4'));var Mustache=require(_0x232d('0x5'));var util=require(_0x232d('0x6'));var path=require(_0x232d('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x232d('0x8'));var fs=require('fs');var fs_extra=require(_0x232d('0x9'));var _=require(_0x232d('0xa'));var squel=require(_0x232d('0xb'));var crypto=require(_0x232d('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x232d('0xd'));var querystring=require(_0x232d('0xe'));var Papa=require('papaparse');var Redis=require(_0x232d('0xf'));var authService=require(_0x232d('0x10'));var qs=require(_0x232d('0x11'));var as=require(_0x232d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x232d('0x13'))(_0x232d('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x232d('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x83b720,_0x41314c){_0x41314c=_0x41314c||0xcc;return function(_0x514902){if(_0x514902){return _0x83b720[_0x232d('0x16')](_0x41314c);}return _0x83b720[_0x232d('0x17')](_0x41314c)[_0x232d('0x18')]();};}function respondWithResult(_0x4b89fd,_0x802f9a){_0x802f9a=_0x802f9a||0xc8;return function(_0x5cf699){if(_0x5cf699){return _0x4b89fd[_0x232d('0x17')](_0x802f9a)[_0x232d('0x19')](_0x5cf699);}};}function respondWithFilteredResult(_0x4b9e8e,_0x524eb2){return function(_0x67910b){if(_0x67910b){var _0x36d3e8=typeof _0x524eb2['offset']===_0x232d('0x1a')&&typeof _0x524eb2[_0x232d('0x1b')]==='undefined';var _0x49ea91=_0x67910b[_0x232d('0x1c')];var _0x15ea48=_0x36d3e8?0x0:_0x524eb2[_0x232d('0x1d')];var _0x141778=_0x36d3e8?_0x67910b['count']:_0x524eb2[_0x232d('0x1d')]+_0x524eb2[_0x232d('0x1b')];var _0x543be9;if(_0x141778>=_0x49ea91){_0x141778=_0x49ea91;_0x543be9=0xc8;}else{_0x543be9=0xce;}_0x4b9e8e[_0x232d('0x17')](_0x543be9);return _0x4b9e8e['set'](_0x232d('0x1e'),_0x15ea48+'-'+_0x141778+'/'+_0x49ea91)[_0x232d('0x19')](_0x67910b);}return null;};}function patchUpdates(_0x512118){return function(_0x56a2c7){try{jsonpatch[_0x232d('0x1f')](_0x56a2c7,_0x512118,!![]);}catch(_0x12a8c8){return BPromise[_0x232d('0x20')](_0x12a8c8);}return _0x56a2c7[_0x232d('0x21')]();};}function saveUpdates(_0x22d35f,_0x1258be){return function(_0x12bbae){if(_0x12bbae){return _0x12bbae[_0x232d('0x22')](_0x22d35f)[_0x232d('0x23')](function(_0x1fa7aa){return _0x1fa7aa;});}return null;};}function removeEntity(_0x47bfbd,_0x4b6ec7){return function(_0x5ecfda){if(_0x5ecfda){return _0x5ecfda[_0x232d('0x24')]()['then'](function(){_0x47bfbd['status'](0xcc)[_0x232d('0x18')]();});}};}function handleEntityNotFound(_0x574634,_0x4da91d){return function(_0x2c4b92){if(!_0x2c4b92){_0x574634['sendStatus'](0x194);}return _0x2c4b92;};}function handleError(_0x42f58b,_0x124730){_0x124730=_0x124730||0x1f4;return function(_0x3e00f7){logger[_0x232d('0x25')](_0x3e00f7[_0x232d('0x26')]);if(_0x3e00f7[_0x232d('0x27')]){delete _0x3e00f7[_0x232d('0x27')];}_0x42f58b['status'](_0x124730)['send'](_0x3e00f7);};}exports[_0x232d('0x28')]=function(_0x42ed21,_0x32f481){var _0x33e731={},_0x5c990f={},_0x40f3a5={'count':0x0,'rows':[]};var _0x51334d=_[_0x232d('0x29')](db['FreshsalesAccount'][_0x232d('0x2a')],function(_0x2bcebe){return{'name':_0x2bcebe[_0x232d('0x2b')],'type':_0x2bcebe[_0x232d('0x2c')][_0x232d('0x2d')]};});_0x5c990f['model']=_[_0x232d('0x29')](_0x51334d,_0x232d('0x27'));_0x5c990f[_0x232d('0x2e')]=_[_0x232d('0x2f')](_0x42ed21[_0x232d('0x2e')]);_0x5c990f[_0x232d('0x30')]=_['intersection'](_0x5c990f[_0x232d('0x31')],_0x5c990f[_0x232d('0x2e')]);_0x33e731[_0x232d('0x32')]=_[_0x232d('0x33')](_0x5c990f[_0x232d('0x31')],qs['fields'](_0x42ed21[_0x232d('0x2e')][_0x232d('0x34')]));_0x33e731[_0x232d('0x32')]=_0x33e731['attributes']['length']?_0x33e731[_0x232d('0x32')]:_0x5c990f[_0x232d('0x31')];if(!_0x42ed21[_0x232d('0x2e')]['hasOwnProperty'](_0x232d('0x35'))){_0x33e731[_0x232d('0x1b')]=qs[_0x232d('0x1b')](_0x42ed21[_0x232d('0x2e')][_0x232d('0x1b')]);_0x33e731['offset']=qs[_0x232d('0x1d')](_0x42ed21[_0x232d('0x2e')][_0x232d('0x1d')]);}_0x33e731['order']=qs[_0x232d('0x36')](_0x42ed21[_0x232d('0x2e')][_0x232d('0x36')]);_0x33e731[_0x232d('0x37')]=qs['filters'](_[_0x232d('0x38')](_0x42ed21[_0x232d('0x2e')],_0x5c990f[_0x232d('0x30')]),_0x51334d);if(_0x42ed21['query'][_0x232d('0x39')]){_0x33e731[_0x232d('0x37')]=_['merge'](_0x33e731[_0x232d('0x37')],{'$or':_[_0x232d('0x29')](_0x51334d,function(_0x1219c5){if(_0x1219c5[_0x232d('0x2c')]!=='VIRTUAL'){var _0x488bc4={};_0x488bc4[_0x1219c5[_0x232d('0x27')]]={'$like':'%'+_0x42ed21[_0x232d('0x2e')][_0x232d('0x39')]+'%'};return _0x488bc4;}})});}_0x33e731=_['merge']({},_0x33e731,_0x42ed21[_0x232d('0x3a')]);var _0x59921e={'where':_0x33e731[_0x232d('0x37')]};return db[_0x232d('0x3b')]['count'](_0x59921e)[_0x232d('0x23')](function(_0x3dad05){_0x40f3a5['count']=_0x3dad05;if(_0x42ed21[_0x232d('0x2e')][_0x232d('0x3c')]){_0x33e731[_0x232d('0x3d')]=[{'all':!![]}];}return db[_0x232d('0x3b')][_0x232d('0x3e')](_0x33e731);})[_0x232d('0x23')](function(_0x9121d3){_0x40f3a5[_0x232d('0x3f')]=_0x9121d3;return _0x40f3a5;})[_0x232d('0x23')](respondWithFilteredResult(_0x32f481,_0x33e731))['catch'](handleError(_0x32f481,null));};exports[_0x232d('0x40')]=function(_0x509df9,_0x3df46c){var _0xdd7048={'raw':![],'where':{'id':_0x509df9[_0x232d('0x41')]['id']}},_0x1678c0={};_0x1678c0[_0x232d('0x31')]=_[_0x232d('0x2f')](db[_0x232d('0x3b')][_0x232d('0x2a')]);_0x1678c0[_0x232d('0x2e')]=_[_0x232d('0x2f')](_0x509df9['query']);_0x1678c0['filters']=_[_0x232d('0x33')](_0x1678c0['model'],_0x1678c0[_0x232d('0x2e')]);_0xdd7048[_0x232d('0x32')]=_[_0x232d('0x33')](_0x1678c0['model'],qs[_0x232d('0x34')](_0x509df9[_0x232d('0x2e')][_0x232d('0x34')]));_0xdd7048['attributes']=_0xdd7048[_0x232d('0x32')][_0x232d('0x42')]?_0xdd7048[_0x232d('0x32')]:_0x1678c0[_0x232d('0x31')];if(_0x509df9[_0x232d('0x2e')][_0x232d('0x3c')]){_0xdd7048['include']=[{'all':!![]}];}_0xdd7048=_['merge']({},_0xdd7048,_0x509df9[_0x232d('0x3a')]);return db[_0x232d('0x3b')][_0x232d('0x43')](_0xdd7048)[_0x232d('0x23')](handleEntityNotFound(_0x3df46c,null))[_0x232d('0x23')](respondWithResult(_0x3df46c,null))[_0x232d('0x44')](handleError(_0x3df46c,null));};exports[_0x232d('0x45')]=function(_0x28795e,_0x2595ea){return db['FreshsalesAccount'][_0x232d('0x45')](_0x28795e['body'],{})[_0x232d('0x23')](respondWithResult(_0x2595ea,0xc9))[_0x232d('0x44')](handleError(_0x2595ea,null));};exports[_0x232d('0x22')]=function(_0x3c6606,_0x1f77ed){if(_0x3c6606[_0x232d('0x46')]['id']){delete _0x3c6606[_0x232d('0x46')]['id'];}return db[_0x232d('0x3b')][_0x232d('0x43')]({'where':{'id':_0x3c6606['params']['id']}})[_0x232d('0x23')](handleEntityNotFound(_0x1f77ed,null))[_0x232d('0x23')](saveUpdates(_0x3c6606[_0x232d('0x46')],null))['then'](respondWithResult(_0x1f77ed,null))[_0x232d('0x44')](handleError(_0x1f77ed,null));};exports[_0x232d('0x24')]=function(_0x3e9960,_0x49094e){return db[_0x232d('0x3b')][_0x232d('0x43')]({'where':{'id':_0x3e9960[_0x232d('0x41')]['id']}})[_0x232d('0x23')](handleEntityNotFound(_0x49094e,null))[_0x232d('0x23')](removeEntity(_0x49094e,null))['catch'](handleError(_0x49094e,null));};exports[_0x232d('0x47')]=function(_0x4f2ffb,_0x367ac5,_0x3430f1){var _0xc217fd={};var _0x4a7cf2={};var _0x3aef99;var _0x2001ff;return db[_0x232d('0x3b')][_0x232d('0x48')]({'where':{'id':_0x4f2ffb['params']['id']}})['then'](handleEntityNotFound(_0x367ac5,null))['then'](function(_0x126798){if(_0x126798){_0x3aef99=_0x126798;_0x4a7cf2[_0x232d('0x31')]=_[_0x232d('0x2f')](db[_0x232d('0x49')][_0x232d('0x2a')]);_0x4a7cf2['query']=_['keys'](_0x4f2ffb[_0x232d('0x2e')]);_0x4a7cf2[_0x232d('0x30')]=_['intersection'](_0x4a7cf2[_0x232d('0x31')],_0x4a7cf2[_0x232d('0x2e')]);_0xc217fd[_0x232d('0x32')]=_[_0x232d('0x33')](_0x4a7cf2['model'],qs['fields'](_0x4f2ffb['query'][_0x232d('0x34')]));_0xc217fd[_0x232d('0x32')]=_0xc217fd[_0x232d('0x32')]['length']?_0xc217fd['attributes']:_0x4a7cf2['model'];_0xc217fd[_0x232d('0x4a')]=qs[_0x232d('0x36')](_0x4f2ffb[_0x232d('0x2e')][_0x232d('0x36')]);_0xc217fd['where']=qs[_0x232d('0x30')](_[_0x232d('0x38')](_0x4f2ffb[_0x232d('0x2e')],_0x4a7cf2['filters']));if(_0x4f2ffb['query'][_0x232d('0x39')]){_0xc217fd[_0x232d('0x37')]=_[_0x232d('0x4b')](_0xc217fd[_0x232d('0x37')],{'$or':_[_0x232d('0x29')](_0xc217fd['attributes'],function(_0x43aff6){var _0x5701c7={};_0x5701c7[_0x43aff6]={'$like':'%'+_0x4f2ffb[_0x232d('0x2e')][_0x232d('0x39')]+'%'};return _0x5701c7;})});}_0xc217fd=_['merge']({},_0xc217fd,_0x4f2ffb[_0x232d('0x3a')]);return _0x3aef99[_0x232d('0x47')](_0xc217fd);}})[_0x232d('0x23')](function(_0x85a1c3){if(_0x85a1c3){_0x2001ff=_0x85a1c3[_0x232d('0x42')];if(!_0x4f2ffb[_0x232d('0x2e')][_0x232d('0x4c')](_0x232d('0x35'))){_0xc217fd['limit']=qs['limit'](_0x4f2ffb[_0x232d('0x2e')][_0x232d('0x1b')]);_0xc217fd[_0x232d('0x1d')]=qs[_0x232d('0x1d')](_0x4f2ffb[_0x232d('0x2e')][_0x232d('0x1d')]);}return _0x3aef99[_0x232d('0x47')](_0xc217fd);}})[_0x232d('0x23')](function(_0x1e201f){if(_0x1e201f){return _0x1e201f?{'count':_0x2001ff,'rows':_0x1e201f}:null;}})[_0x232d('0x23')](respondWithResult(_0x367ac5,null))[_0x232d('0x44')](handleError(_0x367ac5,null));};exports[_0x232d('0x4d')]=function(_0x2c85ae,_0x56aa47,_0x1f7397){if(_0x2c85ae[_0x232d('0x46')]['id']){delete _0x2c85ae[_0x232d('0x46')]['id'];}return db['FreshsalesAccount']['findOne']({'where':{'id':_0x2c85ae[_0x232d('0x41')]['id']}})[_0x232d('0x23')](handleEntityNotFound(_0x56aa47,null))[_0x232d('0x23')](function(_0x5d8cd5){if(_0x5d8cd5){_0x2c85ae[_0x232d('0x46')][_0x232d('0x4e')]=_0x5d8cd5['id'];_0x2c85ae[_0x232d('0x46')][_0x232d('0x4f')]=integrations[_0x232d('0x50')](_0x2c85ae[_0x232d('0x46')][_0x232d('0x51')],_0x2c85ae['body'][_0x232d('0x2c')]);_0x2c85ae[_0x232d('0x46')][_0x232d('0x52')]=integrations['getDescriptions'](_0x2c85ae[_0x232d('0x46')][_0x232d('0x51')],_0x2c85ae[_0x232d('0x46')][_0x232d('0x2c')]);return db[_0x232d('0x49')]['create'](_0x2c85ae[_0x232d('0x46')],{'include':[{'model':db[_0x232d('0x53')],'as':_0x232d('0x4f')},{'model':db[_0x232d('0x53')],'as':_0x232d('0x52')}]});}return null;})[_0x232d('0x23')](respondWithResult(_0x56aa47,null))[_0x232d('0x44')](handleError(_0x56aa47,null));};exports[_0x232d('0x54')]=function(_0x3f73ed,_0x3a8520,_0x5b7125){var _0x423eeb='';var _0x21417d='';return db[_0x232d('0x3b')][_0x232d('0x48')]({'where':{'id':_0x3f73ed[_0x232d('0x41')]['id']},'attributes':['id',_0x232d('0x55'),_0x232d('0x56'),_0x232d('0x57')]})[_0x232d('0x23')](handleEntityNotFound(_0x3a8520,null))[_0x232d('0x23')](function(_0x3a9f89){if(_0x3a9f89){_0x21417d=_0x3a9f89[_0x232d('0x55')];_0x423eeb=_0x3a9f89['remoteUri'];var _0x3e7eb1=_0x3a9f89[_0x232d('0x56')][_0x232d('0x58')](-0x1);if(_0x3e7eb1==='/'){_0x423eeb=_0x423eeb[_0x232d('0x59')](0x0,_0x423eeb[_0x232d('0x5a')](_0x3e7eb1));}return rp({'method':_0x232d('0x5b'),'uri':util[_0x232d('0x5c')](_0x232d('0x5d'),_0x423eeb,_0x232d('0x5e')),'headers':{'Authorization':_0x232d('0x5f')+_0x3a9f89[_0x232d('0x57')]},'json':!![]});}})[_0x232d('0x23')](function(_0x41c33b){if(_0x41c33b){var _0x318d88=_0x41c33b[_0x232d('0x60')];var _0x5439cf=![];var _0x37d238=null;for(_0x37d238=0x0;_0x37d238<_0x318d88[_0x232d('0x42')];_0x37d238++){if(_0x318d88[_0x37d238]['email']===_0x21417d){_0x5439cf=!![];}}if(_0x5439cf){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x232d('0x61')});}}})['then'](respondWithResult(_0x3a8520,null))[_0x232d('0x44')](function(_0x22f7f0){var _0xfa06b4=_0x3f73ed[_0x232d('0x2e')][_0x232d('0x62')]?0x1f4:_0x22f7f0[_0x232d('0x63')]||0x1f4;logger[_0x232d('0x25')](_0x232d('0x64'),_0x232d('0x54'),_0xfa06b4,JSON[_0x232d('0x65')](_0x22f7f0));delete _0x22f7f0[_0x232d('0x27')];if(_0xfa06b4===0x191){_0xfa06b4=0x190;}_0x3a8520[_0x232d('0x17')](_0xfa06b4)[_0x232d('0x66')](_0x3f73ed[_0x232d('0x2e')][_0x232d('0x62')]?{'message':_0x232d('0x67'),'statusCode':_0x22f7f0[_0x232d('0x63')]}:_0x22f7f0);});}; \ No newline at end of file +var _0x6001=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','hasOwnProperty','sort','pick','filter','where','merge','FreshsalesAccount','includeAll','include','findAll','rows','params','intersection','length','options','find','catch','create','body','findOne','order','getConfigurations','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','substring','lastIndexOf','GET','format','/api/selector/owners','Token\x20token=','apiKey','users','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x1d536b,_0x494e1a){var _0x4913d8=function(_0x120b5b){while(--_0x120b5b){_0x1d536b['push'](_0x1d536b['shift']());}};_0x4913d8(++_0x494e1a);}(_0x6001,0x129));var _0x1600=function(_0xb42da0,_0x5e98b4){_0xb42da0=_0xb42da0-0x0;var _0x4036c7=_0x6001[_0xb42da0];return _0x4036c7;};'use strict';var emlformat=require(_0x1600('0x0'));var rimraf=require(_0x1600('0x1'));var zipdir=require(_0x1600('0x2'));var jsonpatch=require(_0x1600('0x3'));var rp=require(_0x1600('0x4'));var moment=require(_0x1600('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1600('0x6'));var util=require(_0x1600('0x7'));var path=require('path');var sox=require(_0x1600('0x8'));var csv=require(_0x1600('0x9'));var ejs=require(_0x1600('0xa'));var fs=require('fs');var fs_extra=require(_0x1600('0xb'));var _=require(_0x1600('0xc'));var squel=require(_0x1600('0xd'));var crypto=require(_0x1600('0xe'));var jsforce=require(_0x1600('0xf'));var deskjs=require(_0x1600('0x10'));var toCsv=require(_0x1600('0x9'));var querystring=require('querystring');var Papa=require(_0x1600('0x11'));var Redis=require(_0x1600('0x12'));var authService=require(_0x1600('0x13'));var qs=require(_0x1600('0x14'));var as=require(_0x1600('0x15'));var hardwareService=require(_0x1600('0x16'));var logger=require(_0x1600('0x17'))(_0x1600('0x18'));var utils=require(_0x1600('0x19'));var config=require(_0x1600('0x1a'));var licenseUtil=require(_0x1600('0x1b'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x12a92c,_0x5d79e4){_0x5d79e4=_0x5d79e4||0xcc;return function(_0x534de1){if(_0x534de1){return _0x12a92c[_0x1600('0x1c')](_0x5d79e4);}return _0x12a92c['status'](_0x5d79e4)[_0x1600('0x1d')]();};}function respondWithResult(_0x35daff,_0x5af78b){_0x5af78b=_0x5af78b||0xc8;return function(_0x2f1cd8){if(_0x2f1cd8){return _0x35daff[_0x1600('0x1e')](_0x5af78b)[_0x1600('0x1f')](_0x2f1cd8);}};}function respondWithFilteredResult(_0x386cb0,_0x117b42){return function(_0x4b5468){if(_0x4b5468){var _0x3c98b9=typeof _0x117b42[_0x1600('0x20')]===_0x1600('0x21')&&typeof _0x117b42[_0x1600('0x22')]===_0x1600('0x21');var _0x5a8b33=_0x4b5468[_0x1600('0x23')];var _0x4aecc3=_0x3c98b9?0x0:_0x117b42[_0x1600('0x20')];var _0x4d04ec=_0x3c98b9?_0x4b5468[_0x1600('0x23')]:_0x117b42[_0x1600('0x20')]+_0x117b42[_0x1600('0x22')];var _0x257aff;if(_0x4d04ec>=_0x5a8b33){_0x4d04ec=_0x5a8b33;_0x257aff=0xc8;}else{_0x257aff=0xce;}_0x386cb0[_0x1600('0x1e')](_0x257aff);return _0x386cb0[_0x1600('0x24')]('Content-Range',_0x4aecc3+'-'+_0x4d04ec+'/'+_0x5a8b33)['json'](_0x4b5468);}return null;};}function patchUpdates(_0x5262e6){return function(_0x1f3abf){try{jsonpatch[_0x1600('0x25')](_0x1f3abf,_0x5262e6,!![]);}catch(_0x59e0b7){return BPromise[_0x1600('0x26')](_0x59e0b7);}return _0x1f3abf[_0x1600('0x27')]();};}function saveUpdates(_0x3d835f,_0x58ed9a){return function(_0x2d61f8){if(_0x2d61f8){return _0x2d61f8[_0x1600('0x28')](_0x3d835f)[_0x1600('0x29')](function(_0xb958d7){return _0xb958d7;});}return null;};}function removeEntity(_0x1c97d8,_0xc471b4){return function(_0x5e417b){if(_0x5e417b){return _0x5e417b[_0x1600('0x2a')]()['then'](function(){_0x1c97d8['status'](0xcc)[_0x1600('0x1d')]();});}};}function handleEntityNotFound(_0x3e1374,_0x88d548){return function(_0xfbf9f){if(!_0xfbf9f){_0x3e1374[_0x1600('0x1c')](0x194);}return _0xfbf9f;};}function handleError(_0x320013,_0x46cc63){_0x46cc63=_0x46cc63||0x1f4;return function(_0x22e07a){logger[_0x1600('0x2b')](_0x22e07a[_0x1600('0x2c')]);if(_0x22e07a[_0x1600('0x2d')]){delete _0x22e07a[_0x1600('0x2d')];}_0x320013[_0x1600('0x1e')](_0x46cc63)['send'](_0x22e07a);};}exports[_0x1600('0x2e')]=function(_0x1c4f0d,_0x367c05){var _0x32249e={},_0x134244={},_0x119810={'count':0x0,'rows':[]};var _0x2ce417=_[_0x1600('0x2f')](db['FreshsalesAccount'][_0x1600('0x30')],function(_0x4a9143){return{'name':_0x4a9143[_0x1600('0x31')],'type':_0x4a9143[_0x1600('0x32')][_0x1600('0x33')]};});_0x134244['model']=_['map'](_0x2ce417,_0x1600('0x2d'));_0x134244[_0x1600('0x34')]=_[_0x1600('0x35')](_0x1c4f0d[_0x1600('0x34')]);_0x134244[_0x1600('0x36')]=_['intersection'](_0x134244[_0x1600('0x37')],_0x134244[_0x1600('0x34')]);_0x32249e[_0x1600('0x38')]=_['intersection'](_0x134244['model'],qs[_0x1600('0x39')](_0x1c4f0d[_0x1600('0x34')][_0x1600('0x39')]));_0x32249e[_0x1600('0x38')]=_0x32249e['attributes']['length']?_0x32249e['attributes']:_0x134244[_0x1600('0x37')];if(!_0x1c4f0d[_0x1600('0x34')][_0x1600('0x3a')]('nolimit')){_0x32249e[_0x1600('0x22')]=qs['limit'](_0x1c4f0d[_0x1600('0x34')][_0x1600('0x22')]);_0x32249e[_0x1600('0x20')]=qs['offset'](_0x1c4f0d[_0x1600('0x34')]['offset']);}_0x32249e['order']=qs[_0x1600('0x3b')](_0x1c4f0d[_0x1600('0x34')]['sort']);_0x32249e['where']=qs[_0x1600('0x36')](_[_0x1600('0x3c')](_0x1c4f0d['query'],_0x134244[_0x1600('0x36')]),_0x2ce417);if(_0x1c4f0d[_0x1600('0x34')][_0x1600('0x3d')]){_0x32249e[_0x1600('0x3e')]=_[_0x1600('0x3f')](_0x32249e[_0x1600('0x3e')],{'$or':_[_0x1600('0x2f')](_0x2ce417,function(_0x25a251){if(_0x25a251['type']!=='VIRTUAL'){var _0x3c1e9f={};_0x3c1e9f[_0x25a251[_0x1600('0x2d')]]={'$like':'%'+_0x1c4f0d['query'][_0x1600('0x3d')]+'%'};return _0x3c1e9f;}})});}_0x32249e=_['merge']({},_0x32249e,_0x1c4f0d['options']);var _0x40377a={'where':_0x32249e[_0x1600('0x3e')]};return db[_0x1600('0x40')][_0x1600('0x23')](_0x40377a)['then'](function(_0x21fa1c){_0x119810[_0x1600('0x23')]=_0x21fa1c;if(_0x1c4f0d['query'][_0x1600('0x41')]){_0x32249e[_0x1600('0x42')]=[{'all':!![]}];}return db[_0x1600('0x40')][_0x1600('0x43')](_0x32249e);})[_0x1600('0x29')](function(_0x56f0d5){_0x119810[_0x1600('0x44')]=_0x56f0d5;return _0x119810;})[_0x1600('0x29')](respondWithFilteredResult(_0x367c05,_0x32249e))['catch'](handleError(_0x367c05,null));};exports['show']=function(_0xbd775b,_0x2fd33a){var _0x220d0d={'raw':![],'where':{'id':_0xbd775b[_0x1600('0x45')]['id']}},_0x59ee59={};_0x59ee59[_0x1600('0x37')]=_[_0x1600('0x35')](db[_0x1600('0x40')]['rawAttributes']);_0x59ee59[_0x1600('0x34')]=_[_0x1600('0x35')](_0xbd775b[_0x1600('0x34')]);_0x59ee59['filters']=_['intersection'](_0x59ee59['model'],_0x59ee59[_0x1600('0x34')]);_0x220d0d['attributes']=_[_0x1600('0x46')](_0x59ee59[_0x1600('0x37')],qs['fields'](_0xbd775b[_0x1600('0x34')][_0x1600('0x39')]));_0x220d0d['attributes']=_0x220d0d[_0x1600('0x38')][_0x1600('0x47')]?_0x220d0d[_0x1600('0x38')]:_0x59ee59[_0x1600('0x37')];if(_0xbd775b[_0x1600('0x34')][_0x1600('0x41')]){_0x220d0d[_0x1600('0x42')]=[{'all':!![]}];}_0x220d0d=_[_0x1600('0x3f')]({},_0x220d0d,_0xbd775b[_0x1600('0x48')]);return db['FreshsalesAccount'][_0x1600('0x49')](_0x220d0d)[_0x1600('0x29')](handleEntityNotFound(_0x2fd33a,null))[_0x1600('0x29')](respondWithResult(_0x2fd33a,null))[_0x1600('0x4a')](handleError(_0x2fd33a,null));};exports[_0x1600('0x4b')]=function(_0x179350,_0x475ba2){return db['FreshsalesAccount']['create'](_0x179350['body'],{})[_0x1600('0x29')](respondWithResult(_0x475ba2,0xc9))[_0x1600('0x4a')](handleError(_0x475ba2,null));};exports[_0x1600('0x28')]=function(_0x2eb766,_0x3af949){if(_0x2eb766['body']['id']){delete _0x2eb766['body']['id'];}return db[_0x1600('0x40')][_0x1600('0x49')]({'where':{'id':_0x2eb766[_0x1600('0x45')]['id']}})[_0x1600('0x29')](handleEntityNotFound(_0x3af949,null))['then'](saveUpdates(_0x2eb766[_0x1600('0x4c')],null))[_0x1600('0x29')](respondWithResult(_0x3af949,null))[_0x1600('0x4a')](handleError(_0x3af949,null));};exports[_0x1600('0x2a')]=function(_0x363873,_0x54958c){return db['FreshsalesAccount'][_0x1600('0x49')]({'where':{'id':_0x363873[_0x1600('0x45')]['id']}})[_0x1600('0x29')](handleEntityNotFound(_0x54958c,null))['then'](removeEntity(_0x54958c,null))[_0x1600('0x4a')](handleError(_0x54958c,null));};exports['getConfigurations']=function(_0x50ef91,_0x2967fd,_0x5ce783){var _0x230c97={};var _0x5b87bb={};var _0x53fdce;var _0x222cdb;return db[_0x1600('0x40')][_0x1600('0x4d')]({'where':{'id':_0x50ef91[_0x1600('0x45')]['id']}})[_0x1600('0x29')](handleEntityNotFound(_0x2967fd,null))[_0x1600('0x29')](function(_0x2f9602){if(_0x2f9602){_0x53fdce=_0x2f9602;_0x5b87bb[_0x1600('0x37')]=_['keys'](db['FreshsalesConfiguration'][_0x1600('0x30')]);_0x5b87bb[_0x1600('0x34')]=_['keys'](_0x50ef91[_0x1600('0x34')]);_0x5b87bb['filters']=_[_0x1600('0x46')](_0x5b87bb['model'],_0x5b87bb[_0x1600('0x34')]);_0x230c97['attributes']=_[_0x1600('0x46')](_0x5b87bb[_0x1600('0x37')],qs['fields'](_0x50ef91['query'][_0x1600('0x39')]));_0x230c97[_0x1600('0x38')]=_0x230c97[_0x1600('0x38')][_0x1600('0x47')]?_0x230c97['attributes']:_0x5b87bb[_0x1600('0x37')];_0x230c97[_0x1600('0x4e')]=qs[_0x1600('0x3b')](_0x50ef91[_0x1600('0x34')][_0x1600('0x3b')]);_0x230c97[_0x1600('0x3e')]=qs[_0x1600('0x36')](_['pick'](_0x50ef91[_0x1600('0x34')],_0x5b87bb[_0x1600('0x36')]));if(_0x50ef91[_0x1600('0x34')][_0x1600('0x3d')]){_0x230c97['where']=_[_0x1600('0x3f')](_0x230c97[_0x1600('0x3e')],{'$or':_[_0x1600('0x2f')](_0x230c97['attributes'],function(_0x1071e8){var _0x23f74f={};_0x23f74f[_0x1071e8]={'$like':'%'+_0x50ef91[_0x1600('0x34')][_0x1600('0x3d')]+'%'};return _0x23f74f;})});}_0x230c97=_[_0x1600('0x3f')]({},_0x230c97,_0x50ef91[_0x1600('0x48')]);return _0x53fdce[_0x1600('0x4f')](_0x230c97);}})[_0x1600('0x29')](function(_0x4e5ced){if(_0x4e5ced){_0x222cdb=_0x4e5ced['length'];if(!_0x50ef91[_0x1600('0x34')][_0x1600('0x3a')](_0x1600('0x50'))){_0x230c97['limit']=qs[_0x1600('0x22')](_0x50ef91[_0x1600('0x34')][_0x1600('0x22')]);_0x230c97['offset']=qs[_0x1600('0x20')](_0x50ef91[_0x1600('0x34')][_0x1600('0x20')]);}return _0x53fdce[_0x1600('0x4f')](_0x230c97);}})[_0x1600('0x29')](function(_0x2a2964){if(_0x2a2964){return _0x2a2964?{'count':_0x222cdb,'rows':_0x2a2964}:null;}})['then'](respondWithResult(_0x2967fd,null))[_0x1600('0x4a')](handleError(_0x2967fd,null));};exports[_0x1600('0x51')]=function(_0x6c98a3,_0x57b3d6,_0x3751c5){if(_0x6c98a3[_0x1600('0x4c')]['id']){delete _0x6c98a3[_0x1600('0x4c')]['id'];}return db[_0x1600('0x40')][_0x1600('0x4d')]({'where':{'id':_0x6c98a3[_0x1600('0x45')]['id']}})[_0x1600('0x29')](handleEntityNotFound(_0x57b3d6,null))[_0x1600('0x29')](function(_0x3d4a97){if(_0x3d4a97){_0x6c98a3[_0x1600('0x4c')]['AccountId']=_0x3d4a97['id'];_0x6c98a3[_0x1600('0x4c')][_0x1600('0x52')]=integrations[_0x1600('0x53')](_0x6c98a3[_0x1600('0x4c')][_0x1600('0x54')],_0x6c98a3['body'][_0x1600('0x32')]);_0x6c98a3[_0x1600('0x4c')][_0x1600('0x55')]=integrations[_0x1600('0x56')](_0x6c98a3[_0x1600('0x4c')]['channel'],_0x6c98a3['body'][_0x1600('0x32')]);return db['FreshsalesConfiguration'][_0x1600('0x4b')](_0x6c98a3[_0x1600('0x4c')],{'include':[{'model':db[_0x1600('0x57')],'as':_0x1600('0x52')},{'model':db[_0x1600('0x57')],'as':_0x1600('0x55')}]});}return null;})[_0x1600('0x29')](respondWithResult(_0x57b3d6,null))[_0x1600('0x4a')](handleError(_0x57b3d6,null));};exports[_0x1600('0x58')]=function(_0xbe5ec4,_0x4fd966,_0x4d56c1){var _0x3c5d21='';var _0x4b243b='';return db['FreshsalesAccount'][_0x1600('0x4d')]({'where':{'id':_0xbe5ec4[_0x1600('0x45')]['id']},'attributes':['id',_0x1600('0x59'),_0x1600('0x5a'),'apiKey']})[_0x1600('0x29')](handleEntityNotFound(_0x4fd966,null))[_0x1600('0x29')](function(_0x306eb0){if(_0x306eb0){_0x4b243b=_0x306eb0[_0x1600('0x59')];_0x3c5d21=_0x306eb0[_0x1600('0x5a')];var _0x468b11=_0x306eb0[_0x1600('0x5a')]['slice'](-0x1);if(_0x468b11==='/'){_0x3c5d21=_0x3c5d21[_0x1600('0x5b')](0x0,_0x3c5d21[_0x1600('0x5c')](_0x468b11));}return rp({'method':_0x1600('0x5d'),'uri':util[_0x1600('0x5e')]('%s%s',_0x3c5d21,_0x1600('0x5f')),'headers':{'Authorization':_0x1600('0x60')+_0x306eb0[_0x1600('0x61')]},'json':!![]});}})['then'](function(_0x107dc7){if(_0x107dc7){var _0x1c3149=_0x107dc7[_0x1600('0x62')];var _0x5c47a0=![];var _0x12d2cc=null;for(_0x12d2cc=0x0;_0x12d2cc<_0x1c3149[_0x1600('0x47')];_0x12d2cc++){if(_0x1c3149[_0x12d2cc]['email']===_0x4b243b){_0x5c47a0=!![];}}if(_0x5c47a0){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x1600('0x63')});}}})[_0x1600('0x29')](respondWithResult(_0x4fd966,null))[_0x1600('0x4a')](function(_0x547881){var _0xcc0bc2=_0xbe5ec4[_0x1600('0x34')][_0x1600('0x64')]?0x1f4:_0x547881[_0x1600('0x65')]||0x1f4;logger[_0x1600('0x2b')](_0x1600('0x66'),_0x1600('0x58'),_0xcc0bc2,JSON[_0x1600('0x67')](_0x547881));delete _0x547881['name'];if(_0xcc0bc2===0x191){_0xcc0bc2=0x190;}_0x4fd966[_0x1600('0x1e')](_0xcc0bc2)[_0x1600('0x68')](_0xbe5ec4[_0x1600('0x34')][_0x1600('0x64')]?{'message':_0x1600('0x69'),'statusCode':_0x547881[_0x1600('0x65')]}:_0x547881);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 472642b..1f52f4d 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 _0x5496=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intFreshsalesAccount.attributes','FreshsalesAccount','int_freshsales_accounts','lodash'];(function(_0x3d4876,_0x366386){var _0x58ca9d=function(_0x5bd045){while(--_0x5bd045){_0x3d4876['push'](_0x3d4876['shift']());}};_0x58ca9d(++_0x366386);}(_0x5496,0x175));var _0x6549=function(_0x7310e,_0x33e0a9){_0x7310e=_0x7310e-0x0;var _0x16b86a=_0x5496[_0x7310e];return _0x16b86a;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var logger=require(_0x6549('0x2'))(_0x6549('0x3'));var moment=require(_0x6549('0x4'));var BPromise=require('bluebird');var rp=require(_0x6549('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var attributes=require(_0x6549('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x43cb17,_0x1d8cea){return _0x43cb17['define'](_0x6549('0x9'),attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x430c=['define','FreshsalesAccount','int_freshsales_accounts','lodash','api','moment','bluebird','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x49870a,_0x1da621){var _0x227723=function(_0x466fa7){while(--_0x466fa7){_0x49870a['push'](_0x49870a['shift']());}};_0x227723(++_0x1da621);}(_0x430c,0x1a1));var _0xc430=function(_0x5b8b97,_0x6b4dfa){_0x5b8b97=_0x5b8b97-0x0;var _0x1fdf84=_0x430c[_0x5b8b97];return _0x1fdf84;};'use strict';var _=require(_0xc430('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc430('0x1'));var moment=require(_0xc430('0x2'));var BPromise=require(_0xc430('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc430('0x4'));var integrations=require(_0xc430('0x5'));module['exports']=function(_0x42aa9c,_0x4de44f){return _0x42aa9c[_0xc430('0x6')](_0xc430('0x7'),attributes,{'tableName':_0xc430('0x8'),'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 4c6c20e..1dbe1f4 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 _0xb44a=['moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','debug','stringify','error','code','message','info','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','attributes','limit','include','map','model','ShowFreshsalesAccount','find','where'];(function(_0x165790,_0x2ca8f7){var _0x10a0bc=function(_0x3268bd){while(--_0x3268bd){_0x165790['push'](_0x165790['shift']());}};_0x10a0bc(++_0x2ca8f7);}(_0xb44a,0x1c2));var _0xab44=function(_0x3eee78,_0x5acc63){_0x3eee78=_0x3eee78-0x0;var _0x53a5e5=_0xb44a[_0x3eee78];return _0x53a5e5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab44('0x0'));var BPromise=require('bluebird');var rs=require(_0xab44('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xab44('0x2'));var logger=require('../../config/logger')(_0xab44('0x3'));var config=require(_0xab44('0x4'));var jayson=require(_0xab44('0x5'));var client=jayson[_0xab44('0x6')][_0xab44('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3303b1,_0x3ead8d,_0x495825){return new BPromise(function(_0x137a8c,_0x133a6d){return client[_0xab44('0x8')](_0x3303b1,_0x495825)[_0xab44('0x9')](function(_0xa14367){logger['info'](_0xab44('0xa'),_0x3ead8d,'request\x20sent');logger[_0xab44('0xb')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x3ead8d,'request\x20sent',JSON[_0xab44('0xc')](_0xa14367));if(_0xa14367[_0xab44('0xd')]){if(_0xa14367[_0xab44('0xd')][_0xab44('0xe')]===0x1f4){logger[_0xab44('0xd')](_0xab44('0xa'),_0x3ead8d,_0xa14367['error']['message']);return _0x133a6d(_0xa14367[_0xab44('0xd')]['message']);}logger[_0xab44('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0x3ead8d,_0xa14367[_0xab44('0xd')][_0xab44('0xf')]);return _0x137a8c(_0xa14367[_0xab44('0xd')][_0xab44('0xf')]);}else{logger[_0xab44('0x10')](_0xab44('0xa'),_0x3ead8d,'request\x20sent');_0x137a8c(_0xa14367['result'][_0xab44('0xf')]);}})[_0xab44('0x11')](function(_0x14fe36){logger[_0xab44('0xd')](_0xab44('0xa'),_0x3ead8d,_0x14fe36);_0x133a6d(_0x14fe36);});});}exports[_0xab44('0x12')]=function(_0x354b09){var _0x44fa43=this;return new Promise(function(_0x310b15,_0xc4b3dc){return db[_0xab44('0x13')]['findAll']({'raw':_0x354b09[_0xab44('0x14')]?_0x354b09[_0xab44('0x14')][_0xab44('0x15')]===undefined?!![]:![]:!![],'where':_0x354b09[_0xab44('0x14')]?_0x354b09[_0xab44('0x14')]['where']||null:null,'attributes':_0x354b09[_0xab44('0x14')]?_0x354b09['options'][_0xab44('0x16')]||null:null,'limit':_0x354b09[_0xab44('0x14')]?_0x354b09[_0xab44('0x14')][_0xab44('0x17')]||null:null,'include':_0x354b09['options']?_0x354b09[_0xab44('0x14')][_0xab44('0x18')]?_[_0xab44('0x19')](_0x354b09[_0xab44('0x14')][_0xab44('0x18')],function(_0x402950){return{'model':db[_0x402950[_0xab44('0x1a')]],'as':_0x402950['as'],'attributes':_0x402950['attributes'],'include':_0x402950['include']?_[_0xab44('0x19')](_0x402950['include'],function(_0x2439f3){return{'model':db[_0x2439f3['model']],'as':_0x2439f3['as'],'attributes':_0x2439f3[_0xab44('0x16')],'include':_0x2439f3['include']?_['map'](_0x2439f3[_0xab44('0x18')],function(_0x25287b){return{'model':db[_0x25287b[_0xab44('0x1a')]],'as':_0x25287b['as'],'attributes':_0x25287b[_0xab44('0x16')]};}):[]};}):[]};}):[]:[]})[_0xab44('0x9')](function(_0x4e820c){logger[_0xab44('0x10')](_0xab44('0x12'),_0x354b09);logger['debug'](_0xab44('0x12'),_0x354b09,JSON[_0xab44('0xc')](_0x4e820c));_0x310b15(_0x4e820c);})[_0xab44('0x11')](function(_0x1cd486){logger[_0xab44('0xd')](_0xab44('0x12'),_0x1cd486['message'],_0x354b09);_0xc4b3dc(_0x44fa43[_0xab44('0xd')](0x1f4,_0x1cd486[_0xab44('0xf')]));});});};exports[_0xab44('0x1b')]=function(_0x47e1be){var _0x54cac8=this;return new Promise(function(_0x106d3a,_0x5082e4){return db['FreshsalesAccount'][_0xab44('0x1c')]({'raw':_0x47e1be[_0xab44('0x14')]?_0x47e1be[_0xab44('0x14')][_0xab44('0x15')]===undefined?!![]:![]:!![],'where':_0x47e1be[_0xab44('0x14')]?_0x47e1be[_0xab44('0x14')][_0xab44('0x1d')]||null:null,'attributes':_0x47e1be[_0xab44('0x14')]?_0x47e1be[_0xab44('0x14')][_0xab44('0x16')]||null:null,'include':_0x47e1be[_0xab44('0x14')]?_0x47e1be[_0xab44('0x14')][_0xab44('0x18')]?_[_0xab44('0x19')](_0x47e1be['options']['include'],function(_0x27e318){return{'model':db[_0x27e318[_0xab44('0x1a')]],'as':_0x27e318['as'],'attributes':_0x27e318['attributes'],'include':_0x27e318[_0xab44('0x18')]?_[_0xab44('0x19')](_0x27e318[_0xab44('0x18')],function(_0x1e0be7){return{'model':db[_0x1e0be7[_0xab44('0x1a')]],'as':_0x1e0be7['as'],'attributes':_0x1e0be7[_0xab44('0x16')],'include':_0x1e0be7[_0xab44('0x18')]?_[_0xab44('0x19')](_0x1e0be7[_0xab44('0x18')],function(_0xe26f9f){return{'model':db[_0xe26f9f[_0xab44('0x1a')]],'as':_0xe26f9f['as'],'attributes':_0xe26f9f[_0xab44('0x16')]};}):[]};}):[]};}):[]:[]})[_0xab44('0x9')](function(_0x532aad){logger[_0xab44('0x10')](_0xab44('0x1b'),_0x47e1be);logger[_0xab44('0xb')](_0xab44('0x1b'),_0x47e1be,JSON['stringify'](_0x532aad));_0x106d3a(_0x532aad);})[_0xab44('0x11')](function(_0x31b599){logger[_0xab44('0xd')](_0xab44('0x1b'),_0x31b599['message'],_0x47e1be);_0x5082e4(_0x54cac8[_0xab44('0xd')](0x1f4,_0x31b599[_0xab44('0xf')]));});});}; \ No newline at end of file +var _0x81c6=['debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','limit','include','map','model','attributes','ShowFreshsalesAccount','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','FreshsalesAccount,\x20%s,\x20%s'];(function(_0x1628b3,_0x5f1805){var _0x4bad95=function(_0x1afa12){while(--_0x1afa12){_0x1628b3['push'](_0x1628b3['shift']());}};_0x4bad95(++_0x5f1805);}(_0x81c6,0x1d5));var _0x681c=function(_0x5a56cc,_0x29650c){_0x5a56cc=_0x5a56cc-0x0;var _0x589caa=_0x81c6[_0x5a56cc];return _0x589caa;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x681c('0x1'));var db=require(_0x681c('0x2'))['db'];var utils=require(_0x681c('0x3'));var logger=require('../../config/logger')(_0x681c('0x4'));var config=require(_0x681c('0x5'));var jayson=require(_0x681c('0x6'));var client=jayson[_0x681c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45331,_0xdc57a5,_0x5624d7){return new BPromise(function(_0x5b5f22,_0x1750e2){return client[_0x681c('0x8')](_0x45331,_0x5624d7)[_0x681c('0x9')](function(_0x5de78e){logger['info'](_0x681c('0xa'),_0xdc57a5,'request\x20sent');logger[_0x681c('0xb')](_0x681c('0xc'),_0xdc57a5,_0x681c('0xd'),JSON[_0x681c('0xe')](_0x5de78e));if(_0x5de78e['error']){if(_0x5de78e['error'][_0x681c('0xf')]===0x1f4){logger[_0x681c('0x10')](_0x681c('0xa'),_0xdc57a5,_0x5de78e['error'][_0x681c('0x11')]);return _0x1750e2(_0x5de78e['error'][_0x681c('0x11')]);}logger['error'](_0x681c('0xa'),_0xdc57a5,_0x5de78e[_0x681c('0x10')][_0x681c('0x11')]);return _0x5b5f22(_0x5de78e[_0x681c('0x10')][_0x681c('0x11')]);}else{logger[_0x681c('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0xdc57a5,_0x681c('0xd'));_0x5b5f22(_0x5de78e[_0x681c('0x13')][_0x681c('0x11')]);}})[_0x681c('0x14')](function(_0x2fce11){logger[_0x681c('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0xdc57a5,_0x2fce11);_0x1750e2(_0x2fce11);});});}exports[_0x681c('0x15')]=function(_0x42f506){var _0x4a9192=this;return new Promise(function(_0x42304f,_0x5b03fd){return db[_0x681c('0x16')][_0x681c('0x17')]({'raw':_0x42f506['options']?_0x42f506[_0x681c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x42f506[_0x681c('0x18')]?_0x42f506[_0x681c('0x18')][_0x681c('0x19')]||null:null,'attributes':_0x42f506[_0x681c('0x18')]?_0x42f506[_0x681c('0x18')]['attributes']||null:null,'limit':_0x42f506['options']?_0x42f506['options'][_0x681c('0x1a')]||null:null,'include':_0x42f506[_0x681c('0x18')]?_0x42f506[_0x681c('0x18')][_0x681c('0x1b')]?_[_0x681c('0x1c')](_0x42f506[_0x681c('0x18')][_0x681c('0x1b')],function(_0x3d0297){return{'model':db[_0x3d0297[_0x681c('0x1d')]],'as':_0x3d0297['as'],'attributes':_0x3d0297[_0x681c('0x1e')],'include':_0x3d0297[_0x681c('0x1b')]?_[_0x681c('0x1c')](_0x3d0297[_0x681c('0x1b')],function(_0x218410){return{'model':db[_0x218410[_0x681c('0x1d')]],'as':_0x218410['as'],'attributes':_0x218410[_0x681c('0x1e')],'include':_0x218410['include']?_[_0x681c('0x1c')](_0x218410['include'],function(_0x5f8d64){return{'model':db[_0x5f8d64['model']],'as':_0x5f8d64['as'],'attributes':_0x5f8d64['attributes']};}):[]};}):[]};}):[]:[]})[_0x681c('0x9')](function(_0x17ea7c){logger[_0x681c('0x12')](_0x681c('0x15'),_0x42f506);logger['debug'](_0x681c('0x15'),_0x42f506,JSON[_0x681c('0xe')](_0x17ea7c));_0x42304f(_0x17ea7c);})[_0x681c('0x14')](function(_0x936fce){logger[_0x681c('0x10')](_0x681c('0x15'),_0x936fce[_0x681c('0x11')],_0x42f506);_0x5b03fd(_0x4a9192['error'](0x1f4,_0x936fce[_0x681c('0x11')]));});});};exports[_0x681c('0x1f')]=function(_0x2e783d){var _0x4af6aa=this;return new Promise(function(_0x385b14,_0x2179cd){return db[_0x681c('0x16')]['find']({'raw':_0x2e783d[_0x681c('0x18')]?_0x2e783d['options']['raw']===undefined?!![]:![]:!![],'where':_0x2e783d[_0x681c('0x18')]?_0x2e783d[_0x681c('0x18')][_0x681c('0x19')]||null:null,'attributes':_0x2e783d['options']?_0x2e783d[_0x681c('0x18')]['attributes']||null:null,'include':_0x2e783d[_0x681c('0x18')]?_0x2e783d['options']['include']?_['map'](_0x2e783d[_0x681c('0x18')][_0x681c('0x1b')],function(_0x5a349a){return{'model':db[_0x5a349a[_0x681c('0x1d')]],'as':_0x5a349a['as'],'attributes':_0x5a349a['attributes'],'include':_0x5a349a['include']?_[_0x681c('0x1c')](_0x5a349a['include'],function(_0x35991d){return{'model':db[_0x35991d[_0x681c('0x1d')]],'as':_0x35991d['as'],'attributes':_0x35991d[_0x681c('0x1e')],'include':_0x35991d['include']?_['map'](_0x35991d[_0x681c('0x1b')],function(_0x4545ff){return{'model':db[_0x4545ff['model']],'as':_0x4545ff['as'],'attributes':_0x4545ff[_0x681c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x681c('0x9')](function(_0x302dab){logger['info'](_0x681c('0x1f'),_0x2e783d);logger[_0x681c('0xb')]('ShowFreshsalesAccount',_0x2e783d,JSON[_0x681c('0xe')](_0x302dab));_0x385b14(_0x302dab);})[_0x681c('0x14')](function(_0x83953c){logger[_0x681c('0x10')](_0x681c('0x1f'),_0x83953c['message'],_0x2e783d);_0x2179cd(_0x4af6aa['error'](0x1f4,_0x83953c[_0x681c('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 7bfee53..453f9ca 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 _0x5e45=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','delete','destroy','exports','multer','util','path'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5e45,0xcc));var _0x55e4=function(_0x50c53a,_0x3f558b){_0x50c53a=_0x50c53a-0x0;var _0x19e011=_0x5e45[_0x50c53a];return _0x19e011;};'use strict';var multer=require(_0x55e4('0x0'));var util=require(_0x55e4('0x1'));var path=require(_0x55e4('0x2'));var timeout=require(_0x55e4('0x3'));var express=require(_0x55e4('0x4'));var router=express[_0x55e4('0x5')]();var fs_extra=require(_0x55e4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x55e4('0x7'));var config=require(_0x55e4('0x8'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x55e4('0x9')]('/',auth['isAuthenticated'](),controller[_0x55e4('0xa')]);router['get'](_0x55e4('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x55e4('0x9')]('/:id/subjects',auth[_0x55e4('0xc')](),controller['getSubjects']);router[_0x55e4('0x9')](_0x55e4('0xd'),auth[_0x55e4('0xc')](),controller[_0x55e4('0xe')]);router[_0x55e4('0x9')](_0x55e4('0xf'),auth[_0x55e4('0xc')](),controller[_0x55e4('0x10')]);router[_0x55e4('0x11')]('/',auth[_0x55e4('0xc')](),controller[_0x55e4('0x12')]);router[_0x55e4('0x13')](_0x55e4('0xb'),auth[_0x55e4('0xc')](),controller['update']);router[_0x55e4('0x14')](_0x55e4('0xb'),auth['isAuthenticated'](),controller[_0x55e4('0x15')]);module[_0x55e4('0x16')]=router; \ No newline at end of file +var _0xa851=['getSubjects','/:id/descriptions','/:id/fields','getFields','create','put','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x2c17ee,_0x1a29cc){var _0x8bf208=function(_0x405312){while(--_0x405312){_0x2c17ee['push'](_0x2c17ee['shift']());}};_0x8bf208(++_0x1a29cc);}(_0xa851,0x10d));var _0x1a85=function(_0x36b444,_0x505b35){_0x36b444=_0x36b444-0x0;var _0x786323=_0xa851[_0x36b444];return _0x786323;};'use strict';var multer=require(_0x1a85('0x0'));var util=require('util');var path=require(_0x1a85('0x1'));var timeout=require('connect-timeout');var express=require(_0x1a85('0x2'));var router=express[_0x1a85('0x3')]();var fs_extra=require(_0x1a85('0x4'));var auth=require(_0x1a85('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1a85('0x6'));router[_0x1a85('0x7')]('/',auth[_0x1a85('0x8')](),controller[_0x1a85('0x9')]);router[_0x1a85('0x7')](_0x1a85('0xa'),auth[_0x1a85('0x8')](),controller['show']);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0x1a85('0xb')]);router[_0x1a85('0x7')](_0x1a85('0xc'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x1a85('0x7')](_0x1a85('0xd'),auth['isAuthenticated'](),controller[_0x1a85('0xe')]);router['post']('/',auth[_0x1a85('0x8')](),controller[_0x1a85('0xf')]);router[_0x1a85('0x10')]('/:id',auth[_0x1a85('0x8')](),controller['update']);router[_0x1a85('0x11')](_0x1a85('0xa'),auth[_0x1a85('0x8')](),controller[_0x1a85('0x12')]);module[_0x1a85('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 0cef290..2db8ce8 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 _0x3f0d=['exports','STRING','sequelize'];(function(_0x1e081a,_0x482d6b){var _0x428209=function(_0x524b53){while(--_0x524b53){_0x1e081a['push'](_0x1e081a['shift']());}};_0x428209(++_0x482d6b);}(_0x3f0d,0xce));var _0xd3f0=function(_0x56bb91,_0x50c7ca){_0x56bb91=_0x56bb91-0x0;var _0x2b6ad2=_0x3f0d[_0x56bb91];return _0x2b6ad2;};'use strict';var Sequelize=require(_0xd3f0('0x0'));module[_0xd3f0('0x1')]={'name':{'type':Sequelize[_0xd3f0('0x2')]},'description':{'type':Sequelize[_0xd3f0('0x2')]}}; \ No newline at end of file +var _0x5538=['exports','STRING'];(function(_0x492535,_0x46524a){var _0x256620=function(_0x3015f8){while(--_0x3015f8){_0x492535['push'](_0x492535['shift']());}};_0x256620(++_0x46524a);}(_0x5538,0x12e));var _0x8553=function(_0x1a0daa,_0x2a4634){_0x1a0daa=_0x1a0daa-0x0;var _0x1dbe15=_0x5538[_0x1a0daa];return _0x1dbe15;};'use strict';var Sequelize=require('sequelize');module[_0x8553('0x0')]={'name':{'type':Sequelize[_0x8553('0x1')]},'description':{'type':Sequelize[_0x8553('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 1103dcd..df6b3fd 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 _0xbcd9=['findAll','show','keys','rawAttributes','length','include','options','find','create','catch','update','body','params','FreshsalesField','filter','getSubjects','getDescriptions','findOne','getFields','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','desk.js','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','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','sendStatus','name','send','index','FreshsalesConfiguration','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xbcd9,0x1f3));var _0x9bcd=function(_0x537a6d,_0x409fb0){_0x537a6d=_0x537a6d-0x0;var _0x425ed8=_0xbcd9[_0x537a6d];return _0x425ed8;};'use strict';var emlformat=require(_0x9bcd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9bcd('0x1'));var jsonpatch=require(_0x9bcd('0x2'));var rp=require(_0x9bcd('0x3'));var moment=require(_0x9bcd('0x4'));var BPromise=require(_0x9bcd('0x5'));var Mustache=require(_0x9bcd('0x6'));var util=require(_0x9bcd('0x7'));var path=require('path');var sox=require(_0x9bcd('0x8'));var csv=require('to-csv');var ejs=require(_0x9bcd('0x9'));var fs=require('fs');var fs_extra=require(_0x9bcd('0xa'));var _=require(_0x9bcd('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9bcd('0xc'));var toCsv=require(_0x9bcd('0xd'));var querystring=require(_0x9bcd('0xe'));var Papa=require(_0x9bcd('0xf'));var Redis=require(_0x9bcd('0x10'));var authService=require(_0x9bcd('0x11'));var qs=require(_0x9bcd('0x12'));var as=require(_0x9bcd('0x13'));var hardwareService=require(_0x9bcd('0x14'));var logger=require('../../config/logger')(_0x9bcd('0x15'));var utils=require(_0x9bcd('0x16'));var config=require(_0x9bcd('0x17'));var licenseUtil=require(_0x9bcd('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ad007,_0x576ec8){_0x576ec8=_0x576ec8||0xcc;return function(_0x5b88db){if(_0x5b88db){return _0x4ad007['sendStatus'](_0x576ec8);}return _0x4ad007[_0x9bcd('0x19')](_0x576ec8)[_0x9bcd('0x1a')]();};}function respondWithResult(_0x21798c,_0xe9ea9a){_0xe9ea9a=_0xe9ea9a||0xc8;return function(_0x18db66){if(_0x18db66){return _0x21798c['status'](_0xe9ea9a)[_0x9bcd('0x1b')](_0x18db66);}};}function respondWithFilteredResult(_0x1923d8,_0x5aca86){return function(_0x1442ef){if(_0x1442ef){var _0x4ecd04=typeof _0x5aca86[_0x9bcd('0x1c')]===_0x9bcd('0x1d')&&typeof _0x5aca86[_0x9bcd('0x1e')]===_0x9bcd('0x1d');var _0x155ae8=_0x1442ef[_0x9bcd('0x1f')];var _0x1a51c5=_0x4ecd04?0x0:_0x5aca86['offset'];var _0x189ef6=_0x4ecd04?_0x1442ef['count']:_0x5aca86[_0x9bcd('0x1c')]+_0x5aca86[_0x9bcd('0x1e')];var _0x20e2dd;if(_0x189ef6>=_0x155ae8){_0x189ef6=_0x155ae8;_0x20e2dd=0xc8;}else{_0x20e2dd=0xce;}_0x1923d8['status'](_0x20e2dd);return _0x1923d8[_0x9bcd('0x20')]('Content-Range',_0x1a51c5+'-'+_0x189ef6+'/'+_0x155ae8)[_0x9bcd('0x1b')](_0x1442ef);}return null;};}function patchUpdates(_0x18435a){return function(_0x4512fe){try{jsonpatch[_0x9bcd('0x21')](_0x4512fe,_0x18435a,!![]);}catch(_0x2d45a2){return BPromise[_0x9bcd('0x22')](_0x2d45a2);}return _0x4512fe[_0x9bcd('0x23')]();};}function saveUpdates(_0x13e859,_0x2d6923){return function(_0x5383f4){if(_0x5383f4){return _0x5383f4['update'](_0x13e859)[_0x9bcd('0x24')](function(_0x9cde83){return _0x9cde83;});}return null;};}function removeEntity(_0x239134,_0x41d807){return function(_0x218f4f){if(_0x218f4f){return _0x218f4f[_0x9bcd('0x25')]()['then'](function(){_0x239134[_0x9bcd('0x19')](0xcc)[_0x9bcd('0x1a')]();});}};}function handleEntityNotFound(_0x15d19d,_0x3f7d14){return function(_0x43128f){if(!_0x43128f){_0x15d19d[_0x9bcd('0x26')](0x194);}return _0x43128f;};}function handleError(_0x22b049,_0x19eff0){_0x19eff0=_0x19eff0||0x1f4;return function(_0xd1228f){logger['error'](_0xd1228f['stack']);if(_0xd1228f[_0x9bcd('0x27')]){delete _0xd1228f[_0x9bcd('0x27')];}_0x22b049[_0x9bcd('0x19')](_0x19eff0)[_0x9bcd('0x28')](_0xd1228f);};}exports[_0x9bcd('0x29')]=function(_0x168eaf,_0x515bd2){var _0x3b370b={},_0x52c3ff={},_0x4d0b46={'count':0x0,'rows':[]};var _0x312cfc=_['map'](db[_0x9bcd('0x2a')]['rawAttributes'],function(_0x2d89f9){return{'name':_0x2d89f9['fieldName'],'type':_0x2d89f9[_0x9bcd('0x2b')][_0x9bcd('0x2c')]};});_0x52c3ff[_0x9bcd('0x2d')]=_[_0x9bcd('0x2e')](_0x312cfc,'name');_0x52c3ff[_0x9bcd('0x2f')]=_['keys'](_0x168eaf[_0x9bcd('0x2f')]);_0x52c3ff[_0x9bcd('0x30')]=_[_0x9bcd('0x31')](_0x52c3ff[_0x9bcd('0x2d')],_0x52c3ff[_0x9bcd('0x2f')]);_0x3b370b[_0x9bcd('0x32')]=_['intersection'](_0x52c3ff[_0x9bcd('0x2d')],qs['fields'](_0x168eaf[_0x9bcd('0x2f')][_0x9bcd('0x33')]));_0x3b370b['attributes']=_0x3b370b[_0x9bcd('0x32')]['length']?_0x3b370b[_0x9bcd('0x32')]:_0x52c3ff['model'];if(!_0x168eaf['query'][_0x9bcd('0x34')](_0x9bcd('0x35'))){_0x3b370b[_0x9bcd('0x1e')]=qs['limit'](_0x168eaf[_0x9bcd('0x2f')][_0x9bcd('0x1e')]);_0x3b370b['offset']=qs[_0x9bcd('0x1c')](_0x168eaf[_0x9bcd('0x2f')][_0x9bcd('0x1c')]);}_0x3b370b[_0x9bcd('0x36')]=qs['sort'](_0x168eaf[_0x9bcd('0x2f')][_0x9bcd('0x37')]);_0x3b370b[_0x9bcd('0x38')]=qs[_0x9bcd('0x30')](_[_0x9bcd('0x39')](_0x168eaf['query'],_0x52c3ff[_0x9bcd('0x30')]),_0x312cfc);if(_0x168eaf[_0x9bcd('0x2f')]['filter']){_0x3b370b[_0x9bcd('0x38')]=_[_0x9bcd('0x3a')](_0x3b370b[_0x9bcd('0x38')],{'$or':_[_0x9bcd('0x2e')](_0x312cfc,function(_0x17dcc7){if(_0x17dcc7[_0x9bcd('0x2b')]!==_0x9bcd('0x3b')){var _0x32d2ca={};_0x32d2ca[_0x17dcc7[_0x9bcd('0x27')]]={'$like':'%'+_0x168eaf[_0x9bcd('0x2f')]['filter']+'%'};return _0x32d2ca;}})});}_0x3b370b=_[_0x9bcd('0x3a')]({},_0x3b370b,_0x168eaf['options']);var _0x14ee0c={'where':_0x3b370b[_0x9bcd('0x38')]};return db[_0x9bcd('0x2a')]['count'](_0x14ee0c)['then'](function(_0x4f4ccf){_0x4d0b46['count']=_0x4f4ccf;if(_0x168eaf[_0x9bcd('0x2f')][_0x9bcd('0x3c')]){_0x3b370b['include']=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x9bcd('0x3d')](_0x3b370b);})['then'](function(_0x1913e5){_0x4d0b46['rows']=_0x1913e5;return _0x4d0b46;})[_0x9bcd('0x24')](respondWithFilteredResult(_0x515bd2,_0x3b370b))['catch'](handleError(_0x515bd2,null));};exports[_0x9bcd('0x3e')]=function(_0x34bdde,_0x69ee41){var _0x4d6c43={'raw':![],'where':{'id':_0x34bdde['params']['id']}},_0x556713={};_0x556713[_0x9bcd('0x2d')]=_[_0x9bcd('0x3f')](db[_0x9bcd('0x2a')][_0x9bcd('0x40')]);_0x556713['query']=_[_0x9bcd('0x3f')](_0x34bdde[_0x9bcd('0x2f')]);_0x556713[_0x9bcd('0x30')]=_[_0x9bcd('0x31')](_0x556713[_0x9bcd('0x2d')],_0x556713[_0x9bcd('0x2f')]);_0x4d6c43[_0x9bcd('0x32')]=_[_0x9bcd('0x31')](_0x556713[_0x9bcd('0x2d')],qs[_0x9bcd('0x33')](_0x34bdde[_0x9bcd('0x2f')][_0x9bcd('0x33')]));_0x4d6c43[_0x9bcd('0x32')]=_0x4d6c43[_0x9bcd('0x32')][_0x9bcd('0x41')]?_0x4d6c43[_0x9bcd('0x32')]:_0x556713[_0x9bcd('0x2d')];if(_0x34bdde[_0x9bcd('0x2f')][_0x9bcd('0x3c')]){_0x4d6c43[_0x9bcd('0x42')]=[{'all':!![]}];}_0x4d6c43=_['merge']({},_0x4d6c43,_0x34bdde[_0x9bcd('0x43')]);return db[_0x9bcd('0x2a')][_0x9bcd('0x44')](_0x4d6c43)[_0x9bcd('0x24')](handleEntityNotFound(_0x69ee41,null))[_0x9bcd('0x24')](respondWithResult(_0x69ee41,null))['catch'](handleError(_0x69ee41,null));};exports[_0x9bcd('0x45')]=function(_0x90611f,_0x19ace3){return db['FreshsalesConfiguration']['create'](_0x90611f['body'],{})[_0x9bcd('0x24')](respondWithResult(_0x19ace3,0xc9))[_0x9bcd('0x46')](handleError(_0x19ace3,null));};exports[_0x9bcd('0x47')]=function(_0x34d19e,_0x2967b4){if(_0x34d19e['body']['id']){delete _0x34d19e[_0x9bcd('0x48')]['id'];}return db['FreshsalesConfiguration'][_0x9bcd('0x44')]({'where':{'id':_0x34d19e[_0x9bcd('0x49')]['id']}})[_0x9bcd('0x24')](handleEntityNotFound(_0x2967b4,null))['then'](saveUpdates(_0x34d19e[_0x9bcd('0x48')],null))[_0x9bcd('0x24')](respondWithResult(_0x2967b4,null))[_0x9bcd('0x46')](handleError(_0x2967b4,null));};exports['destroy']=function(_0x5be7b8,_0x5adb2f){return db[_0x9bcd('0x2a')][_0x9bcd('0x44')]({'where':{'id':_0x5be7b8[_0x9bcd('0x49')]['id']}})[_0x9bcd('0x24')](handleEntityNotFound(_0x5adb2f,null))[_0x9bcd('0x24')](removeEntity(_0x5adb2f,null))['catch'](handleError(_0x5adb2f,null));};exports['getSubjects']=function(_0x27609b,_0x1b7ae4,_0xaa9d30){var _0x128d3d={};var _0x31a733={};var _0x38185f;var _0x39f2d8;return db[_0x9bcd('0x2a')]['findOne']({'where':{'id':_0x27609b['params']['id']}})[_0x9bcd('0x24')](handleEntityNotFound(_0x1b7ae4,null))[_0x9bcd('0x24')](function(_0x27b5fe){if(_0x27b5fe){_0x38185f=_0x27b5fe;_0x31a733['model']=_[_0x9bcd('0x3f')](db[_0x9bcd('0x4a')][_0x9bcd('0x40')]);_0x31a733[_0x9bcd('0x2f')]=_[_0x9bcd('0x3f')](_0x27609b[_0x9bcd('0x2f')]);_0x31a733['filters']=_[_0x9bcd('0x31')](_0x31a733['model'],_0x31a733[_0x9bcd('0x2f')]);_0x128d3d[_0x9bcd('0x32')]=_['intersection'](_0x31a733[_0x9bcd('0x2d')],qs[_0x9bcd('0x33')](_0x27609b[_0x9bcd('0x2f')][_0x9bcd('0x33')]));_0x128d3d[_0x9bcd('0x32')]=_0x128d3d[_0x9bcd('0x32')]['length']?_0x128d3d[_0x9bcd('0x32')]:_0x31a733[_0x9bcd('0x2d')];_0x128d3d[_0x9bcd('0x36')]=qs[_0x9bcd('0x37')](_0x27609b[_0x9bcd('0x2f')][_0x9bcd('0x37')]);_0x128d3d[_0x9bcd('0x38')]=qs[_0x9bcd('0x30')](_['pick'](_0x27609b[_0x9bcd('0x2f')],_0x31a733[_0x9bcd('0x30')]));if(_0x27609b[_0x9bcd('0x2f')]['filter']){_0x128d3d['where']=_[_0x9bcd('0x3a')](_0x128d3d[_0x9bcd('0x38')],{'$or':_[_0x9bcd('0x2e')](_0x128d3d[_0x9bcd('0x32')],function(_0x36734f){var _0x2bdbba={};_0x2bdbba[_0x36734f]={'$like':'%'+_0x27609b[_0x9bcd('0x2f')][_0x9bcd('0x4b')]+'%'};return _0x2bdbba;})});}_0x128d3d=_[_0x9bcd('0x3a')]({},_0x128d3d,_0x27609b[_0x9bcd('0x43')]);return _0x38185f['getSubjects'](_0x128d3d);}})[_0x9bcd('0x24')](function(_0x4281fd){if(_0x4281fd){_0x39f2d8=_0x4281fd['length'];if(!_0x27609b[_0x9bcd('0x2f')]['hasOwnProperty'](_0x9bcd('0x35'))){_0x128d3d[_0x9bcd('0x1e')]=qs[_0x9bcd('0x1e')](_0x27609b[_0x9bcd('0x2f')][_0x9bcd('0x1e')]);_0x128d3d[_0x9bcd('0x1c')]=qs[_0x9bcd('0x1c')](_0x27609b[_0x9bcd('0x2f')][_0x9bcd('0x1c')]);}return _0x38185f[_0x9bcd('0x4c')](_0x128d3d);}})[_0x9bcd('0x24')](function(_0x86c500){if(_0x86c500){return _0x86c500?{'count':_0x39f2d8,'rows':_0x86c500}:null;}})[_0x9bcd('0x24')](respondWithResult(_0x1b7ae4,null))[_0x9bcd('0x46')](handleError(_0x1b7ae4,null));};exports[_0x9bcd('0x4d')]=function(_0x3aa134,_0x683cd2,_0x575950){var _0xa96ec8={};var _0x3170ab={};var _0x5d147e;var _0xee1f9a;return db[_0x9bcd('0x2a')][_0x9bcd('0x4e')]({'where':{'id':_0x3aa134[_0x9bcd('0x49')]['id']}})[_0x9bcd('0x24')](handleEntityNotFound(_0x683cd2,null))[_0x9bcd('0x24')](function(_0x54efa9){if(_0x54efa9){_0x5d147e=_0x54efa9;_0x3170ab[_0x9bcd('0x2d')]=_['keys'](db[_0x9bcd('0x4a')][_0x9bcd('0x40')]);_0x3170ab[_0x9bcd('0x2f')]=_[_0x9bcd('0x3f')](_0x3aa134['query']);_0x3170ab[_0x9bcd('0x30')]=_[_0x9bcd('0x31')](_0x3170ab[_0x9bcd('0x2d')],_0x3170ab[_0x9bcd('0x2f')]);_0xa96ec8[_0x9bcd('0x32')]=_['intersection'](_0x3170ab[_0x9bcd('0x2d')],qs[_0x9bcd('0x33')](_0x3aa134[_0x9bcd('0x2f')][_0x9bcd('0x33')]));_0xa96ec8['attributes']=_0xa96ec8[_0x9bcd('0x32')][_0x9bcd('0x41')]?_0xa96ec8[_0x9bcd('0x32')]:_0x3170ab['model'];_0xa96ec8[_0x9bcd('0x36')]=qs[_0x9bcd('0x37')](_0x3aa134[_0x9bcd('0x2f')][_0x9bcd('0x37')]);_0xa96ec8[_0x9bcd('0x38')]=qs[_0x9bcd('0x30')](_[_0x9bcd('0x39')](_0x3aa134[_0x9bcd('0x2f')],_0x3170ab[_0x9bcd('0x30')]));if(_0x3aa134[_0x9bcd('0x2f')][_0x9bcd('0x4b')]){_0xa96ec8[_0x9bcd('0x38')]=_[_0x9bcd('0x3a')](_0xa96ec8[_0x9bcd('0x38')],{'$or':_[_0x9bcd('0x2e')](_0xa96ec8[_0x9bcd('0x32')],function(_0x3b478d){var _0x5be72f={};_0x5be72f[_0x3b478d]={'$like':'%'+_0x3aa134['query'][_0x9bcd('0x4b')]+'%'};return _0x5be72f;})});}_0xa96ec8=_[_0x9bcd('0x3a')]({},_0xa96ec8,_0x3aa134[_0x9bcd('0x43')]);return _0x5d147e[_0x9bcd('0x4d')](_0xa96ec8);}})[_0x9bcd('0x24')](function(_0x3c676a){if(_0x3c676a){_0xee1f9a=_0x3c676a['length'];if(!_0x3aa134[_0x9bcd('0x2f')]['hasOwnProperty'](_0x9bcd('0x35'))){_0xa96ec8[_0x9bcd('0x1e')]=qs[_0x9bcd('0x1e')](_0x3aa134['query'][_0x9bcd('0x1e')]);_0xa96ec8[_0x9bcd('0x1c')]=qs[_0x9bcd('0x1c')](_0x3aa134['query']['offset']);}return _0x5d147e['getDescriptions'](_0xa96ec8);}})[_0x9bcd('0x24')](function(_0x29460c){if(_0x29460c){return _0x29460c?{'count':_0xee1f9a,'rows':_0x29460c}:null;}})[_0x9bcd('0x24')](respondWithResult(_0x683cd2,null))[_0x9bcd('0x46')](handleError(_0x683cd2,null));};exports[_0x9bcd('0x4f')]=function(_0xfb2782,_0x400835,_0x2aab7d){var _0x3af6cd={};var _0x58cd30={};var _0x26d080;var _0x57f01a;return db[_0x9bcd('0x2a')]['findOne']({'where':{'id':_0xfb2782['params']['id']}})['then'](handleEntityNotFound(_0x400835,null))[_0x9bcd('0x24')](function(_0x127573){if(_0x127573){_0x26d080=_0x127573;_0x58cd30['model']=_['keys'](db[_0x9bcd('0x4a')]['rawAttributes']);_0x58cd30[_0x9bcd('0x2f')]=_[_0x9bcd('0x3f')](_0xfb2782[_0x9bcd('0x2f')]);_0x58cd30[_0x9bcd('0x30')]=_[_0x9bcd('0x31')](_0x58cd30['model'],_0x58cd30[_0x9bcd('0x2f')]);_0x3af6cd[_0x9bcd('0x32')]=_[_0x9bcd('0x31')](_0x58cd30[_0x9bcd('0x2d')],qs[_0x9bcd('0x33')](_0xfb2782[_0x9bcd('0x2f')][_0x9bcd('0x33')]));_0x3af6cd[_0x9bcd('0x32')]=_0x3af6cd[_0x9bcd('0x32')]['length']?_0x3af6cd['attributes']:_0x58cd30[_0x9bcd('0x2d')];_0x3af6cd[_0x9bcd('0x36')]=qs[_0x9bcd('0x37')](_0xfb2782['query'][_0x9bcd('0x37')]);_0x3af6cd['where']=qs[_0x9bcd('0x30')](_[_0x9bcd('0x39')](_0xfb2782[_0x9bcd('0x2f')],_0x58cd30[_0x9bcd('0x30')]));if(_0xfb2782[_0x9bcd('0x2f')][_0x9bcd('0x4b')]){_0x3af6cd[_0x9bcd('0x38')]=_[_0x9bcd('0x3a')](_0x3af6cd[_0x9bcd('0x38')],{'$or':_[_0x9bcd('0x2e')](_0x3af6cd[_0x9bcd('0x32')],function(_0x3b8a29){var _0x2865fb={};_0x2865fb[_0x3b8a29]={'$like':'%'+_0xfb2782[_0x9bcd('0x2f')]['filter']+'%'};return _0x2865fb;})});}_0x3af6cd=_[_0x9bcd('0x3a')]({},_0x3af6cd,_0xfb2782['options']);return _0x26d080[_0x9bcd('0x4f')](_0x3af6cd);}})['then'](function(_0x1983f1){if(_0x1983f1){_0x57f01a=_0x1983f1[_0x9bcd('0x41')];if(!_0xfb2782['query'][_0x9bcd('0x34')](_0x9bcd('0x35'))){_0x3af6cd[_0x9bcd('0x1e')]=qs[_0x9bcd('0x1e')](_0xfb2782[_0x9bcd('0x2f')][_0x9bcd('0x1e')]);_0x3af6cd['offset']=qs[_0x9bcd('0x1c')](_0xfb2782[_0x9bcd('0x2f')][_0x9bcd('0x1c')]);}return _0x26d080[_0x9bcd('0x4f')](_0x3af6cd);}})[_0x9bcd('0x24')](function(_0x1cac13){if(_0x1cac13){return _0x1cac13?{'count':_0x57f01a,'rows':_0x1cac13}:null;}})[_0x9bcd('0x24')](respondWithResult(_0x400835,null))[_0x9bcd('0x46')](handleError(_0x400835,null));}; \ No newline at end of file +var _0x7a28=['limit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','catch','show','create','body','find','destroy','params','getSubjects','findOne','FreshsalesField','filter','length','getDescriptions','getFields','eml-format','rimraf','zip-dir','request-promise','moment','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x496dd5,_0x2e06ba){var _0x58fd39=function(_0x2da6ef){while(--_0x2da6ef){_0x496dd5['push'](_0x496dd5['shift']());}};_0x58fd39(++_0x2e06ba);}(_0x7a28,0x6a));var _0x87a2=function(_0x37c136,_0x1ff97f){_0x37c136=_0x37c136-0x0;var _0x22b1ab=_0x7a28[_0x37c136];return _0x22b1ab;};'use strict';var emlformat=require(_0x87a2('0x0'));var rimraf=require(_0x87a2('0x1'));var zipdir=require(_0x87a2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x87a2('0x3'));var moment=require(_0x87a2('0x4'));var BPromise=require(_0x87a2('0x5'));var Mustache=require('mustache');var util=require(_0x87a2('0x6'));var path=require(_0x87a2('0x7'));var sox=require(_0x87a2('0x8'));var csv=require(_0x87a2('0x9'));var ejs=require(_0x87a2('0xa'));var fs=require('fs');var fs_extra=require(_0x87a2('0xb'));var _=require(_0x87a2('0xc'));var squel=require(_0x87a2('0xd'));var crypto=require(_0x87a2('0xe'));var jsforce=require(_0x87a2('0xf'));var deskjs=require(_0x87a2('0x10'));var toCsv=require(_0x87a2('0x9'));var querystring=require(_0x87a2('0x11'));var Papa=require(_0x87a2('0x12'));var Redis=require(_0x87a2('0x13'));var authService=require(_0x87a2('0x14'));var qs=require(_0x87a2('0x15'));var as=require(_0x87a2('0x16'));var hardwareService=require(_0x87a2('0x17'));var logger=require(_0x87a2('0x18'))(_0x87a2('0x19'));var utils=require(_0x87a2('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x87a2('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44ac87,_0x473941){_0x473941=_0x473941||0xcc;return function(_0x38ab91){if(_0x38ab91){return _0x44ac87[_0x87a2('0x1c')](_0x473941);}return _0x44ac87[_0x87a2('0x1d')](_0x473941)[_0x87a2('0x1e')]();};}function respondWithResult(_0x523676,_0x3abae6){_0x3abae6=_0x3abae6||0xc8;return function(_0x18f1cf){if(_0x18f1cf){return _0x523676[_0x87a2('0x1d')](_0x3abae6)[_0x87a2('0x1f')](_0x18f1cf);}};}function respondWithFilteredResult(_0x5cf9dc,_0x52d504){return function(_0xa120f2){if(_0xa120f2){var _0x5a21d4=typeof _0x52d504['offset']==='undefined'&&typeof _0x52d504['limit']==='undefined';var _0x2c376a=_0xa120f2[_0x87a2('0x20')];var _0x199355=_0x5a21d4?0x0:_0x52d504['offset'];var _0x49a176=_0x5a21d4?_0xa120f2[_0x87a2('0x20')]:_0x52d504[_0x87a2('0x21')]+_0x52d504['limit'];var _0x2d74e2;if(_0x49a176>=_0x2c376a){_0x49a176=_0x2c376a;_0x2d74e2=0xc8;}else{_0x2d74e2=0xce;}_0x5cf9dc[_0x87a2('0x1d')](_0x2d74e2);return _0x5cf9dc[_0x87a2('0x22')](_0x87a2('0x23'),_0x199355+'-'+_0x49a176+'/'+_0x2c376a)[_0x87a2('0x1f')](_0xa120f2);}return null;};}function patchUpdates(_0x8e1e86){return function(_0x451b83){try{jsonpatch[_0x87a2('0x24')](_0x451b83,_0x8e1e86,!![]);}catch(_0x5ebbe0){return BPromise[_0x87a2('0x25')](_0x5ebbe0);}return _0x451b83[_0x87a2('0x26')]();};}function saveUpdates(_0x5241f2,_0x4f97cd){return function(_0x18e592){if(_0x18e592){return _0x18e592[_0x87a2('0x27')](_0x5241f2)[_0x87a2('0x28')](function(_0x10c839){return _0x10c839;});}return null;};}function removeEntity(_0x580ce4,_0x4d920f){return function(_0x2d61a4){if(_0x2d61a4){return _0x2d61a4['destroy']()[_0x87a2('0x28')](function(){_0x580ce4[_0x87a2('0x1d')](0xcc)[_0x87a2('0x1e')]();});}};}function handleEntityNotFound(_0x2ae58d,_0x3f07e8){return function(_0x533d00){if(!_0x533d00){_0x2ae58d[_0x87a2('0x1c')](0x194);}return _0x533d00;};}function handleError(_0xc4b0d0,_0xf78e0b){_0xf78e0b=_0xf78e0b||0x1f4;return function(_0x3e3152){logger[_0x87a2('0x29')](_0x3e3152[_0x87a2('0x2a')]);if(_0x3e3152['name']){delete _0x3e3152[_0x87a2('0x2b')];}_0xc4b0d0[_0x87a2('0x1d')](_0xf78e0b)[_0x87a2('0x2c')](_0x3e3152);};}exports[_0x87a2('0x2d')]=function(_0x3a9f68,_0x34dd68){var _0x5ad743={},_0x58507c={},_0x44c6e4={'count':0x0,'rows':[]};var _0x229555=_[_0x87a2('0x2e')](db[_0x87a2('0x2f')][_0x87a2('0x30')],function(_0x5df0ae){return{'name':_0x5df0ae['fieldName'],'type':_0x5df0ae[_0x87a2('0x31')][_0x87a2('0x32')]};});_0x58507c[_0x87a2('0x33')]=_[_0x87a2('0x2e')](_0x229555,_0x87a2('0x2b'));_0x58507c[_0x87a2('0x34')]=_[_0x87a2('0x35')](_0x3a9f68[_0x87a2('0x34')]);_0x58507c[_0x87a2('0x36')]=_[_0x87a2('0x37')](_0x58507c['model'],_0x58507c[_0x87a2('0x34')]);_0x5ad743[_0x87a2('0x38')]=_[_0x87a2('0x37')](_0x58507c[_0x87a2('0x33')],qs[_0x87a2('0x39')](_0x3a9f68[_0x87a2('0x34')][_0x87a2('0x39')]));_0x5ad743['attributes']=_0x5ad743[_0x87a2('0x38')]['length']?_0x5ad743[_0x87a2('0x38')]:_0x58507c[_0x87a2('0x33')];if(!_0x3a9f68[_0x87a2('0x34')][_0x87a2('0x3a')](_0x87a2('0x3b'))){_0x5ad743[_0x87a2('0x3c')]=qs[_0x87a2('0x3c')](_0x3a9f68['query'][_0x87a2('0x3c')]);_0x5ad743['offset']=qs[_0x87a2('0x21')](_0x3a9f68[_0x87a2('0x34')][_0x87a2('0x21')]);}_0x5ad743[_0x87a2('0x3d')]=qs[_0x87a2('0x3e')](_0x3a9f68[_0x87a2('0x34')]['sort']);_0x5ad743[_0x87a2('0x3f')]=qs[_0x87a2('0x36')](_[_0x87a2('0x40')](_0x3a9f68['query'],_0x58507c['filters']),_0x229555);if(_0x3a9f68[_0x87a2('0x34')]['filter']){_0x5ad743[_0x87a2('0x3f')]=_[_0x87a2('0x41')](_0x5ad743['where'],{'$or':_[_0x87a2('0x2e')](_0x229555,function(_0x84a147){if(_0x84a147[_0x87a2('0x31')]!==_0x87a2('0x42')){var _0x39cc9f={};_0x39cc9f[_0x84a147[_0x87a2('0x2b')]]={'$like':'%'+_0x3a9f68[_0x87a2('0x34')]['filter']+'%'};return _0x39cc9f;}})});}_0x5ad743=_[_0x87a2('0x41')]({},_0x5ad743,_0x3a9f68[_0x87a2('0x43')]);var _0xa5dc09={'where':_0x5ad743[_0x87a2('0x3f')]};return db['FreshsalesConfiguration'][_0x87a2('0x20')](_0xa5dc09)[_0x87a2('0x28')](function(_0x4c028a){_0x44c6e4[_0x87a2('0x20')]=_0x4c028a;if(_0x3a9f68['query'][_0x87a2('0x44')]){_0x5ad743['include']=[{'all':!![]}];}return db[_0x87a2('0x2f')]['findAll'](_0x5ad743);})[_0x87a2('0x28')](function(_0x33e431){_0x44c6e4['rows']=_0x33e431;return _0x44c6e4;})['then'](respondWithFilteredResult(_0x34dd68,_0x5ad743))[_0x87a2('0x45')](handleError(_0x34dd68,null));};exports[_0x87a2('0x46')]=function(_0x23baae,_0x2983b4){var _0xc8e13a={'raw':![],'where':{'id':_0x23baae['params']['id']}},_0x37398a={};_0x37398a[_0x87a2('0x33')]=_[_0x87a2('0x35')](db[_0x87a2('0x2f')][_0x87a2('0x30')]);_0x37398a[_0x87a2('0x34')]=_[_0x87a2('0x35')](_0x23baae[_0x87a2('0x34')]);_0x37398a[_0x87a2('0x36')]=_[_0x87a2('0x37')](_0x37398a[_0x87a2('0x33')],_0x37398a['query']);_0xc8e13a[_0x87a2('0x38')]=_[_0x87a2('0x37')](_0x37398a['model'],qs[_0x87a2('0x39')](_0x23baae[_0x87a2('0x34')][_0x87a2('0x39')]));_0xc8e13a[_0x87a2('0x38')]=_0xc8e13a[_0x87a2('0x38')]['length']?_0xc8e13a[_0x87a2('0x38')]:_0x37398a['model'];if(_0x23baae['query'][_0x87a2('0x44')]){_0xc8e13a['include']=[{'all':!![]}];}_0xc8e13a=_[_0x87a2('0x41')]({},_0xc8e13a,_0x23baae['options']);return db[_0x87a2('0x2f')]['find'](_0xc8e13a)[_0x87a2('0x28')](handleEntityNotFound(_0x2983b4,null))[_0x87a2('0x28')](respondWithResult(_0x2983b4,null))[_0x87a2('0x45')](handleError(_0x2983b4,null));};exports[_0x87a2('0x47')]=function(_0xcdd926,_0x4bf8af){return db[_0x87a2('0x2f')][_0x87a2('0x47')](_0xcdd926['body'],{})[_0x87a2('0x28')](respondWithResult(_0x4bf8af,0xc9))['catch'](handleError(_0x4bf8af,null));};exports[_0x87a2('0x27')]=function(_0x3b8fa5,_0x7cddd3){if(_0x3b8fa5[_0x87a2('0x48')]['id']){delete _0x3b8fa5['body']['id'];}return db[_0x87a2('0x2f')][_0x87a2('0x49')]({'where':{'id':_0x3b8fa5['params']['id']}})['then'](handleEntityNotFound(_0x7cddd3,null))[_0x87a2('0x28')](saveUpdates(_0x3b8fa5[_0x87a2('0x48')],null))[_0x87a2('0x28')](respondWithResult(_0x7cddd3,null))[_0x87a2('0x45')](handleError(_0x7cddd3,null));};exports[_0x87a2('0x4a')]=function(_0x32e671,_0x448ce0){return db[_0x87a2('0x2f')][_0x87a2('0x49')]({'where':{'id':_0x32e671[_0x87a2('0x4b')]['id']}})[_0x87a2('0x28')](handleEntityNotFound(_0x448ce0,null))[_0x87a2('0x28')](removeEntity(_0x448ce0,null))[_0x87a2('0x45')](handleError(_0x448ce0,null));};exports[_0x87a2('0x4c')]=function(_0xed56ed,_0x2f3740,_0x43fa3b){var _0x4bc26b={};var _0x25bfa0={};var _0x57c709;var _0x748026;return db['FreshsalesConfiguration'][_0x87a2('0x4d')]({'where':{'id':_0xed56ed[_0x87a2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2f3740,null))[_0x87a2('0x28')](function(_0x133c4f){if(_0x133c4f){_0x57c709=_0x133c4f;_0x25bfa0[_0x87a2('0x33')]=_[_0x87a2('0x35')](db[_0x87a2('0x4e')][_0x87a2('0x30')]);_0x25bfa0[_0x87a2('0x34')]=_[_0x87a2('0x35')](_0xed56ed['query']);_0x25bfa0[_0x87a2('0x36')]=_[_0x87a2('0x37')](_0x25bfa0[_0x87a2('0x33')],_0x25bfa0['query']);_0x4bc26b['attributes']=_[_0x87a2('0x37')](_0x25bfa0['model'],qs['fields'](_0xed56ed[_0x87a2('0x34')][_0x87a2('0x39')]));_0x4bc26b[_0x87a2('0x38')]=_0x4bc26b[_0x87a2('0x38')]['length']?_0x4bc26b[_0x87a2('0x38')]:_0x25bfa0[_0x87a2('0x33')];_0x4bc26b[_0x87a2('0x3d')]=qs[_0x87a2('0x3e')](_0xed56ed['query'][_0x87a2('0x3e')]);_0x4bc26b[_0x87a2('0x3f')]=qs[_0x87a2('0x36')](_[_0x87a2('0x40')](_0xed56ed[_0x87a2('0x34')],_0x25bfa0[_0x87a2('0x36')]));if(_0xed56ed['query']['filter']){_0x4bc26b['where']=_[_0x87a2('0x41')](_0x4bc26b[_0x87a2('0x3f')],{'$or':_[_0x87a2('0x2e')](_0x4bc26b[_0x87a2('0x38')],function(_0x4c7480){var _0x347548={};_0x347548[_0x4c7480]={'$like':'%'+_0xed56ed[_0x87a2('0x34')][_0x87a2('0x4f')]+'%'};return _0x347548;})});}_0x4bc26b=_[_0x87a2('0x41')]({},_0x4bc26b,_0xed56ed['options']);return _0x57c709[_0x87a2('0x4c')](_0x4bc26b);}})[_0x87a2('0x28')](function(_0x5b017c){if(_0x5b017c){_0x748026=_0x5b017c['length'];if(!_0xed56ed[_0x87a2('0x34')][_0x87a2('0x3a')](_0x87a2('0x3b'))){_0x4bc26b[_0x87a2('0x3c')]=qs['limit'](_0xed56ed['query'][_0x87a2('0x3c')]);_0x4bc26b['offset']=qs[_0x87a2('0x21')](_0xed56ed[_0x87a2('0x34')]['offset']);}return _0x57c709[_0x87a2('0x4c')](_0x4bc26b);}})[_0x87a2('0x28')](function(_0x31a4b4){if(_0x31a4b4){return _0x31a4b4?{'count':_0x748026,'rows':_0x31a4b4}:null;}})[_0x87a2('0x28')](respondWithResult(_0x2f3740,null))[_0x87a2('0x45')](handleError(_0x2f3740,null));};exports['getDescriptions']=function(_0x38f56b,_0x4c0bca,_0x1eb686){var _0x41e7b0={};var _0x7f4e51={};var _0x9c4ac9;var _0x8b176e;return db['FreshsalesConfiguration'][_0x87a2('0x4d')]({'where':{'id':_0x38f56b[_0x87a2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4c0bca,null))[_0x87a2('0x28')](function(_0x8c29fb){if(_0x8c29fb){_0x9c4ac9=_0x8c29fb;_0x7f4e51[_0x87a2('0x33')]=_[_0x87a2('0x35')](db['FreshsalesField'][_0x87a2('0x30')]);_0x7f4e51[_0x87a2('0x34')]=_[_0x87a2('0x35')](_0x38f56b[_0x87a2('0x34')]);_0x7f4e51['filters']=_[_0x87a2('0x37')](_0x7f4e51[_0x87a2('0x33')],_0x7f4e51['query']);_0x41e7b0[_0x87a2('0x38')]=_[_0x87a2('0x37')](_0x7f4e51[_0x87a2('0x33')],qs[_0x87a2('0x39')](_0x38f56b[_0x87a2('0x34')][_0x87a2('0x39')]));_0x41e7b0['attributes']=_0x41e7b0[_0x87a2('0x38')][_0x87a2('0x50')]?_0x41e7b0[_0x87a2('0x38')]:_0x7f4e51[_0x87a2('0x33')];_0x41e7b0[_0x87a2('0x3d')]=qs['sort'](_0x38f56b[_0x87a2('0x34')][_0x87a2('0x3e')]);_0x41e7b0[_0x87a2('0x3f')]=qs[_0x87a2('0x36')](_[_0x87a2('0x40')](_0x38f56b[_0x87a2('0x34')],_0x7f4e51[_0x87a2('0x36')]));if(_0x38f56b[_0x87a2('0x34')][_0x87a2('0x4f')]){_0x41e7b0[_0x87a2('0x3f')]=_[_0x87a2('0x41')](_0x41e7b0[_0x87a2('0x3f')],{'$or':_['map'](_0x41e7b0[_0x87a2('0x38')],function(_0x3f8a45){var _0x300df1={};_0x300df1[_0x3f8a45]={'$like':'%'+_0x38f56b[_0x87a2('0x34')]['filter']+'%'};return _0x300df1;})});}_0x41e7b0=_[_0x87a2('0x41')]({},_0x41e7b0,_0x38f56b[_0x87a2('0x43')]);return _0x9c4ac9[_0x87a2('0x51')](_0x41e7b0);}})[_0x87a2('0x28')](function(_0x5ef582){if(_0x5ef582){_0x8b176e=_0x5ef582[_0x87a2('0x50')];if(!_0x38f56b[_0x87a2('0x34')]['hasOwnProperty']('nolimit')){_0x41e7b0['limit']=qs[_0x87a2('0x3c')](_0x38f56b[_0x87a2('0x34')][_0x87a2('0x3c')]);_0x41e7b0[_0x87a2('0x21')]=qs['offset'](_0x38f56b[_0x87a2('0x34')][_0x87a2('0x21')]);}return _0x9c4ac9['getDescriptions'](_0x41e7b0);}})[_0x87a2('0x28')](function(_0x2dad7d){if(_0x2dad7d){return _0x2dad7d?{'count':_0x8b176e,'rows':_0x2dad7d}:null;}})['then'](respondWithResult(_0x4c0bca,null))['catch'](handleError(_0x4c0bca,null));};exports[_0x87a2('0x52')]=function(_0x44c611,_0x5a49ab,_0x166154){var _0x122c68={};var _0x28a264={};var _0x26f5fe;var _0x12b324;return db['FreshsalesConfiguration'][_0x87a2('0x4d')]({'where':{'id':_0x44c611['params']['id']}})[_0x87a2('0x28')](handleEntityNotFound(_0x5a49ab,null))[_0x87a2('0x28')](function(_0xdd2e5f){if(_0xdd2e5f){_0x26f5fe=_0xdd2e5f;_0x28a264[_0x87a2('0x33')]=_['keys'](db[_0x87a2('0x4e')][_0x87a2('0x30')]);_0x28a264['query']=_['keys'](_0x44c611[_0x87a2('0x34')]);_0x28a264[_0x87a2('0x36')]=_[_0x87a2('0x37')](_0x28a264[_0x87a2('0x33')],_0x28a264[_0x87a2('0x34')]);_0x122c68[_0x87a2('0x38')]=_[_0x87a2('0x37')](_0x28a264['model'],qs['fields'](_0x44c611[_0x87a2('0x34')][_0x87a2('0x39')]));_0x122c68['attributes']=_0x122c68[_0x87a2('0x38')][_0x87a2('0x50')]?_0x122c68['attributes']:_0x28a264['model'];_0x122c68[_0x87a2('0x3d')]=qs[_0x87a2('0x3e')](_0x44c611[_0x87a2('0x34')]['sort']);_0x122c68[_0x87a2('0x3f')]=qs[_0x87a2('0x36')](_['pick'](_0x44c611[_0x87a2('0x34')],_0x28a264[_0x87a2('0x36')]));if(_0x44c611[_0x87a2('0x34')][_0x87a2('0x4f')]){_0x122c68[_0x87a2('0x3f')]=_['merge'](_0x122c68[_0x87a2('0x3f')],{'$or':_[_0x87a2('0x2e')](_0x122c68['attributes'],function(_0x1921ed){var _0x2e0191={};_0x2e0191[_0x1921ed]={'$like':'%'+_0x44c611[_0x87a2('0x34')]['filter']+'%'};return _0x2e0191;})});}_0x122c68=_[_0x87a2('0x41')]({},_0x122c68,_0x44c611[_0x87a2('0x43')]);return _0x26f5fe[_0x87a2('0x52')](_0x122c68);}})[_0x87a2('0x28')](function(_0x578c0b){if(_0x578c0b){_0x12b324=_0x578c0b[_0x87a2('0x50')];if(!_0x44c611[_0x87a2('0x34')][_0x87a2('0x3a')](_0x87a2('0x3b'))){_0x122c68[_0x87a2('0x3c')]=qs[_0x87a2('0x3c')](_0x44c611[_0x87a2('0x34')][_0x87a2('0x3c')]);_0x122c68[_0x87a2('0x21')]=qs['offset'](_0x44c611[_0x87a2('0x34')][_0x87a2('0x21')]);}return _0x26f5fe[_0x87a2('0x52')](_0x122c68);}})[_0x87a2('0x28')](function(_0x5868e6){if(_0x5868e6){return _0x5868e6?{'count':_0x12b324,'rows':_0x5868e6}:null;}})[_0x87a2('0x28')](respondWithResult(_0x5a49ab,null))[_0x87a2('0x45')](handleError(_0x5a49ab,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 5751b66..b347716 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 _0x7c03=['request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','moment','bluebird'];(function(_0x51e591,_0x47d880){var _0xa7deca=function(_0x4f930f){while(--_0x4f930f){_0x51e591['push'](_0x51e591['shift']());}};_0xa7deca(++_0x47d880);}(_0x7c03,0x1c9));var _0x37c0=function(_0x54dfa6,_0x84d146){_0x54dfa6=_0x54dfa6-0x0;var _0x7bf335=_0x7c03[_0x54dfa6];return _0x7bf335;};'use strict';var _=require(_0x37c0('0x0'));var util=require(_0x37c0('0x1'));var logger=require(_0x37c0('0x2'))('api');var moment=require(_0x37c0('0x3'));var BPromise=require(_0x37c0('0x4'));var rp=require(_0x37c0('0x5'));var fs=require('fs');var path=require(_0x37c0('0x6'));var rimraf=require('rimraf');var config=require(_0x37c0('0x7'));var attributes=require(_0x37c0('0x8'));module['exports']=function(_0x1be2f3,_0xed2143){return _0x1be2f3['define'](_0x37c0('0x9'),attributes,{'tableName':_0x37c0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe62e=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','int_freshsales_configurations','lodash'];(function(_0x3b3cc6,_0x1a6e24){var _0x1161e4=function(_0x19cc52){while(--_0x19cc52){_0x3b3cc6['push'](_0x3b3cc6['shift']());}};_0x1161e4(++_0x1a6e24);}(_0xe62e,0x103));var _0xee62=function(_0x48cc2c,_0x419254){_0x48cc2c=_0x48cc2c-0x0;var _0xfe1120=_0xe62e[_0x48cc2c];return _0xfe1120;};'use strict';var _=require(_0xee62('0x0'));var util=require(_0xee62('0x1'));var logger=require(_0xee62('0x2'))(_0xee62('0x3'));var moment=require(_0xee62('0x4'));var BPromise=require(_0xee62('0x5'));var rp=require(_0xee62('0x6'));var fs=require('fs');var path=require(_0xee62('0x7'));var rimraf=require('rimraf');var config=require(_0xee62('0x8'));var attributes=require(_0xee62('0x9'));module[_0xee62('0xa')]=function(_0x212fd2,_0x4b2245){return _0x212fd2[_0xee62('0xb')]('FreshsalesConfiguration',attributes,{'tableName':_0xee62('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index f44d853..46bef13 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 _0x6aec=['jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x49bd2d,_0x1b2908){var _0x308e0e=function(_0x13f0c8){while(--_0x13f0c8){_0x49bd2d['push'](_0x49bd2d['shift']());}};_0x308e0e(++_0x1b2908);}(_0x6aec,0x66));var _0xc6ae=function(_0x46127c,_0x222586){_0x46127c=_0x46127c-0x0;var _0x37ddf5=_0x6aec[_0x46127c];return _0x37ddf5;};'use strict';var _=require(_0xc6ae('0x0'));var util=require(_0xc6ae('0x1'));var moment=require(_0xc6ae('0x2'));var BPromise=require(_0xc6ae('0x3'));var rs=require(_0xc6ae('0x4'));var fs=require('fs');var Redis=require(_0xc6ae('0x5'));var db=require(_0xc6ae('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc6ae('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc6ae('0x8'));var client=jayson[_0xc6ae('0x9')][_0xc6ae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e2e94,_0x328b70,_0x2a99d0){return new BPromise(function(_0x5da3e8,_0x5bf0d4){return client[_0xc6ae('0xb')](_0x1e2e94,_0x2a99d0)[_0xc6ae('0xc')](function(_0x838ef1){logger[_0xc6ae('0xd')](_0xc6ae('0xe'),_0x328b70,_0xc6ae('0xf'));logger[_0xc6ae('0x10')](_0xc6ae('0x11'),_0x328b70,'request\x20sent',JSON['stringify'](_0x838ef1));if(_0x838ef1[_0xc6ae('0x12')]){if(_0x838ef1[_0xc6ae('0x12')][_0xc6ae('0x13')]===0x1f4){logger[_0xc6ae('0x12')](_0xc6ae('0xe'),_0x328b70,_0x838ef1[_0xc6ae('0x12')][_0xc6ae('0x14')]);return _0x5bf0d4(_0x838ef1[_0xc6ae('0x12')]['message']);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x328b70,_0x838ef1['error'][_0xc6ae('0x14')]);return _0x5da3e8(_0x838ef1['error'][_0xc6ae('0x14')]);}else{logger['info'](_0xc6ae('0xe'),_0x328b70,'request\x20sent');_0x5da3e8(_0x838ef1[_0xc6ae('0x15')][_0xc6ae('0x14')]);}})['catch'](function(_0x4a5696){logger[_0xc6ae('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x328b70,_0x4a5696);_0x5bf0d4(_0x4a5696);});});} \ No newline at end of file +var _0x0f10=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x4025df,_0x5bdc3a){var _0x3caeca=function(_0x394f34){while(--_0x394f34){_0x4025df['push'](_0x4025df['shift']());}};_0x3caeca(++_0x5bdc3a);}(_0x0f10,0x1b7));var _0x00f1=function(_0xc8dfa9,_0x996a2b){_0xc8dfa9=_0xc8dfa9-0x0;var _0x5f5c3c=_0x0f10[_0xc8dfa9];return _0x5f5c3c;};'use strict';var _=require(_0x00f1('0x0'));var util=require('util');var moment=require(_0x00f1('0x1'));var BPromise=require(_0x00f1('0x2'));var rs=require(_0x00f1('0x3'));var fs=require('fs');var Redis=require(_0x00f1('0x4'));var db=require(_0x00f1('0x5'))['db'];var utils=require(_0x00f1('0x6'));var logger=require(_0x00f1('0x7'))(_0x00f1('0x8'));var config=require(_0x00f1('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x00f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ca3e6,_0x405280,_0x531771){return new BPromise(function(_0x3c5959,_0x482d1c){return client[_0x00f1('0xb')](_0x1ca3e6,_0x531771)['then'](function(_0x2184c2){logger[_0x00f1('0xc')](_0x00f1('0xd'),_0x405280,'request\x20sent');logger['debug'](_0x00f1('0xe'),_0x405280,_0x00f1('0xf'),JSON[_0x00f1('0x10')](_0x2184c2));if(_0x2184c2[_0x00f1('0x11')]){if(_0x2184c2[_0x00f1('0x11')][_0x00f1('0x12')]===0x1f4){logger['error'](_0x00f1('0xd'),_0x405280,_0x2184c2[_0x00f1('0x11')]['message']);return _0x482d1c(_0x2184c2[_0x00f1('0x11')][_0x00f1('0x13')]);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x405280,_0x2184c2[_0x00f1('0x11')][_0x00f1('0x13')]);return _0x3c5959(_0x2184c2['error'][_0x00f1('0x13')]);}else{logger[_0x00f1('0xc')](_0x00f1('0xd'),_0x405280,_0x00f1('0xf'));_0x3c5959(_0x2184c2[_0x00f1('0x14')][_0x00f1('0x13')]);}})[_0x00f1('0x15')](function(_0x50e931){logger[_0x00f1('0x11')](_0x00f1('0xd'),_0x405280,_0x50e931);_0x482d1c(_0x50e931);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 2f7d589..96934c6 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 _0x885e=['show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intFreshsalesField.controller','get','isAuthenticated','index','/:id'];(function(_0x56e23a,_0x21de37){var _0x5dcf21=function(_0x353f43){while(--_0x353f43){_0x56e23a['push'](_0x56e23a['shift']());}};_0x5dcf21(++_0x21de37);}(_0x885e,0xe4));var _0xe885=function(_0x516718,_0x1a145f){_0x516718=_0x516718-0x0;var _0x29fab9=_0x885e[_0x516718];return _0x29fab9;};'use strict';var multer=require(_0xe885('0x0'));var util=require(_0xe885('0x1'));var path=require('path');var timeout=require(_0xe885('0x2'));var express=require(_0xe885('0x3'));var router=express[_0xe885('0x4')]();var fs_extra=require(_0xe885('0x5'));var auth=require(_0xe885('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe885('0x7'));router[_0xe885('0x8')]('/',auth[_0xe885('0x9')](),controller[_0xe885('0xa')]);router['get'](_0xe885('0xb'),auth['isAuthenticated'](),controller[_0xe885('0xc')]);router[_0xe885('0xd')]('/',auth[_0xe885('0x9')](),controller[_0xe885('0xe')]);router[_0xe885('0xf')](_0xe885('0xb'),auth['isAuthenticated'](),controller[_0xe885('0x10')]);router[_0xe885('0x11')](_0xe885('0xb'),auth[_0xe885('0x9')](),controller[_0xe885('0x12')]);module[_0xe885('0x13')]=router; \ No newline at end of file +var _0x8278=['../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1da7a5,_0x1a5546){var _0x11c3c1=function(_0x563999){while(--_0x563999){_0x1da7a5['push'](_0x1da7a5['shift']());}};_0x11c3c1(++_0x1a5546);}(_0x8278,0x1ae));var _0x8827=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8278[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8827('0x0'));var util=require(_0x8827('0x1'));var path=require(_0x8827('0x2'));var timeout=require(_0x8827('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8827('0x4'));var auth=require(_0x8827('0x5'));var interaction=require(_0x8827('0x6'));var config=require(_0x8827('0x7'));var controller=require('./intFreshsalesField.controller');router[_0x8827('0x8')]('/',auth[_0x8827('0x9')](),controller[_0x8827('0xa')]);router[_0x8827('0x8')](_0x8827('0xb'),auth[_0x8827('0x9')](),controller[_0x8827('0xc')]);router[_0x8827('0xd')]('/',auth[_0x8827('0x9')](),controller[_0x8827('0xe')]);router[_0x8827('0xf')](_0x8827('0xb'),auth[_0x8827('0x9')](),controller['update']);router[_0x8827('0x10')](_0x8827('0xb'),auth['isAuthenticated'](),controller[_0x8827('0x11')]);module[_0x8827('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 847e3ca..71fb721 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 _0x77a5=['keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x22fb99,_0x1f4ee6){var _0x2158ce=function(_0x1ad442){while(--_0x1ad442){_0x22fb99['push'](_0x22fb99['shift']());}};_0x2158ce(++_0x1f4ee6);}(_0x77a5,0x68));var _0x577a=function(_0x1a96d6,_0x2ace51){_0x1a96d6=_0x1a96d6-0x0;var _0x505671=_0x77a5[_0x1a96d6];return _0x505671;};'use strict';var Sequelize=require(_0x577a('0x0'));module[_0x577a('0x1')]={'type':{'type':Sequelize[_0x577a('0x2')](_0x577a('0x3'),_0x577a('0x4'),_0x577a('0x5'),_0x577a('0x6'),_0x577a('0x7')),'defaultValue':_0x577a('0x3')},'content':{'type':Sequelize[_0x577a('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x577a('0x2')]('string',_0x577a('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x577a('0x8')]},'idField':{'type':Sequelize[_0x577a('0x8')]},'nameField':{'type':Sequelize[_0x577a('0x8')]},'customField':{'type':Sequelize[_0x577a('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd873=['ENUM','string','customVariable','picklist','STRING','BOOLEAN','sequelize'];(function(_0x4d088d,_0x2ca253){var _0x59e4b5=function(_0x38e8fb){while(--_0x38e8fb){_0x4d088d['push'](_0x4d088d['shift']());}};_0x59e4b5(++_0x2ca253);}(_0xd873,0x117));var _0x3d87=function(_0x18643b,_0x5f4aad){_0x18643b=_0x18643b-0x0;var _0x4a3e47=_0xd873[_0x18643b];return _0x4a3e47;};'use strict';var Sequelize=require(_0x3d87('0x0'));module['exports']={'type':{'type':Sequelize[_0x3d87('0x1')](_0x3d87('0x2'),'variable',_0x3d87('0x3'),'keyValue',_0x3d87('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3d87('0x5')]},'key':{'type':Sequelize[_0x3d87('0x5')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x3d87('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3d87('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3d87('0x6')],'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 98c67a6..5577db8 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 _0x976c=['VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','error','stack','name','send','index','map','FreshsalesField','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters'];(function(_0x4aead1,_0x1e971d){var _0x8b8df7=function(_0x456efa){while(--_0x456efa){_0x4aead1['push'](_0x4aead1['shift']());}};_0x8b8df7(++_0x1e971d);}(_0x976c,0x12f));var _0xc976=function(_0xcacd08,_0x502b3e){_0xcacd08=_0xcacd08-0x0;var _0x3acd2a=_0x976c[_0xcacd08];return _0x3acd2a;};'use strict';var emlformat=require(_0xc976('0x0'));var rimraf=require(_0xc976('0x1'));var zipdir=require(_0xc976('0x2'));var jsonpatch=require(_0xc976('0x3'));var rp=require(_0xc976('0x4'));var moment=require(_0xc976('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc976('0x6'));var sox=require(_0xc976('0x7'));var csv=require('to-csv');var ejs=require(_0xc976('0x8'));var fs=require('fs');var fs_extra=require(_0xc976('0x9'));var _=require(_0xc976('0xa'));var squel=require(_0xc976('0xb'));var crypto=require('crypto');var jsforce=require(_0xc976('0xc'));var deskjs=require(_0xc976('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc976('0xe'));var Papa=require(_0xc976('0xf'));var Redis=require(_0xc976('0x10'));var authService=require(_0xc976('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc976('0x12'));var logger=require(_0xc976('0x13'))(_0xc976('0x14'));var utils=require('../../config/utils');var config=require(_0xc976('0x15'));var licenseUtil=require(_0xc976('0x16'));var db=require(_0xc976('0x17'))['db'];function respondWithStatusCode(_0x40f21a,_0x1c03a2){_0x1c03a2=_0x1c03a2||0xcc;return function(_0x5a78a7){if(_0x5a78a7){return _0x40f21a['sendStatus'](_0x1c03a2);}return _0x40f21a[_0xc976('0x18')](_0x1c03a2)[_0xc976('0x19')]();};}function respondWithResult(_0x4964d5,_0x3baa4c){_0x3baa4c=_0x3baa4c||0xc8;return function(_0x198eb8){if(_0x198eb8){return _0x4964d5[_0xc976('0x18')](_0x3baa4c)[_0xc976('0x1a')](_0x198eb8);}};}function respondWithFilteredResult(_0x275c81,_0x1925da){return function(_0x3b9a00){if(_0x3b9a00){var _0x5e936f=typeof _0x1925da[_0xc976('0x1b')]===_0xc976('0x1c')&&typeof _0x1925da[_0xc976('0x1d')]===_0xc976('0x1c');var _0x4f47cb=_0x3b9a00[_0xc976('0x1e')];var _0x2dcb31=_0x5e936f?0x0:_0x1925da['offset'];var _0x1a79bd=_0x5e936f?_0x3b9a00[_0xc976('0x1e')]:_0x1925da['offset']+_0x1925da['limit'];var _0x58eaaa;if(_0x1a79bd>=_0x4f47cb){_0x1a79bd=_0x4f47cb;_0x58eaaa=0xc8;}else{_0x58eaaa=0xce;}_0x275c81['status'](_0x58eaaa);return _0x275c81[_0xc976('0x1f')]('Content-Range',_0x2dcb31+'-'+_0x1a79bd+'/'+_0x4f47cb)[_0xc976('0x1a')](_0x3b9a00);}return null;};}function patchUpdates(_0x2c9a46){return function(_0x273e2c){try{jsonpatch[_0xc976('0x20')](_0x273e2c,_0x2c9a46,!![]);}catch(_0x1ff340){return BPromise[_0xc976('0x21')](_0x1ff340);}return _0x273e2c['save']();};}function saveUpdates(_0x14d86d,_0x1eed82){return function(_0x25a9b3){if(_0x25a9b3){return _0x25a9b3[_0xc976('0x22')](_0x14d86d)[_0xc976('0x23')](function(_0x45fa87){return _0x45fa87;});}return null;};}function removeEntity(_0x46ff1c,_0x2f398a){return function(_0xc232c0){if(_0xc232c0){return _0xc232c0['destroy']()['then'](function(){_0x46ff1c['status'](0xcc)[_0xc976('0x19')]();});}};}function handleEntityNotFound(_0x3bec05,_0x59c827){return function(_0x4ec8a6){if(!_0x4ec8a6){_0x3bec05['sendStatus'](0x194);}return _0x4ec8a6;};}function handleError(_0x455495,_0x6eae3b){_0x6eae3b=_0x6eae3b||0x1f4;return function(_0xf4b336){logger[_0xc976('0x24')](_0xf4b336[_0xc976('0x25')]);if(_0xf4b336[_0xc976('0x26')]){delete _0xf4b336[_0xc976('0x26')];}_0x455495[_0xc976('0x18')](_0x6eae3b)[_0xc976('0x27')](_0xf4b336);};}exports[_0xc976('0x28')]=function(_0x4e2190,_0x4ebde7){var _0xe084dd={},_0x388131={},_0x5483cf={'count':0x0,'rows':[]};var _0x28c4d0=_[_0xc976('0x29')](db[_0xc976('0x2a')]['rawAttributes'],function(_0x2eb3dd){return{'name':_0x2eb3dd[_0xc976('0x2b')],'type':_0x2eb3dd[_0xc976('0x2c')][_0xc976('0x2d')]};});_0x388131[_0xc976('0x2e')]=_['map'](_0x28c4d0,'name');_0x388131[_0xc976('0x2f')]=_[_0xc976('0x30')](_0x4e2190[_0xc976('0x2f')]);_0x388131['filters']=_[_0xc976('0x31')](_0x388131[_0xc976('0x2e')],_0x388131[_0xc976('0x2f')]);_0xe084dd[_0xc976('0x32')]=_[_0xc976('0x31')](_0x388131[_0xc976('0x2e')],qs[_0xc976('0x33')](_0x4e2190[_0xc976('0x2f')][_0xc976('0x33')]));_0xe084dd[_0xc976('0x32')]=_0xe084dd[_0xc976('0x32')][_0xc976('0x34')]?_0xe084dd[_0xc976('0x32')]:_0x388131[_0xc976('0x2e')];if(!_0x4e2190[_0xc976('0x2f')]['hasOwnProperty'](_0xc976('0x35'))){_0xe084dd[_0xc976('0x1d')]=qs[_0xc976('0x1d')](_0x4e2190[_0xc976('0x2f')][_0xc976('0x1d')]);_0xe084dd['offset']=qs[_0xc976('0x1b')](_0x4e2190[_0xc976('0x2f')][_0xc976('0x1b')]);}_0xe084dd['order']=qs['sort'](_0x4e2190[_0xc976('0x2f')][_0xc976('0x36')]);_0xe084dd[_0xc976('0x37')]=qs[_0xc976('0x38')](_['pick'](_0x4e2190[_0xc976('0x2f')],_0x388131[_0xc976('0x38')]),_0x28c4d0);if(_0x4e2190[_0xc976('0x2f')]['filter']){_0xe084dd['where']=_['merge'](_0xe084dd[_0xc976('0x37')],{'$or':_[_0xc976('0x29')](_0x28c4d0,function(_0x1705b8){if(_0x1705b8[_0xc976('0x2c')]!==_0xc976('0x39')){var _0x40ecee={};_0x40ecee[_0x1705b8[_0xc976('0x26')]]={'$like':'%'+_0x4e2190[_0xc976('0x2f')][_0xc976('0x3a')]+'%'};return _0x40ecee;}})});}_0xe084dd=_[_0xc976('0x3b')]({},_0xe084dd,_0x4e2190[_0xc976('0x3c')]);var _0x318eb5={'where':_0xe084dd[_0xc976('0x37')]};return db[_0xc976('0x2a')]['count'](_0x318eb5)[_0xc976('0x23')](function(_0x22d814){_0x5483cf[_0xc976('0x1e')]=_0x22d814;if(_0x4e2190[_0xc976('0x2f')][_0xc976('0x3d')]){_0xe084dd[_0xc976('0x3e')]=[{'all':!![]}];}return db[_0xc976('0x2a')][_0xc976('0x3f')](_0xe084dd);})[_0xc976('0x23')](function(_0x97aef){_0x5483cf[_0xc976('0x40')]=_0x97aef;return _0x5483cf;})[_0xc976('0x23')](respondWithFilteredResult(_0x4ebde7,_0xe084dd))[_0xc976('0x41')](handleError(_0x4ebde7,null));};exports['show']=function(_0x83bc0c,_0x34a7c7){var _0x595031={'raw':!![],'where':{'id':_0x83bc0c[_0xc976('0x42')]['id']}},_0x3d1610={};_0x3d1610[_0xc976('0x2e')]=_['keys'](db[_0xc976('0x2a')][_0xc976('0x43')]);_0x3d1610[_0xc976('0x2f')]=_[_0xc976('0x30')](_0x83bc0c[_0xc976('0x2f')]);_0x3d1610[_0xc976('0x38')]=_[_0xc976('0x31')](_0x3d1610[_0xc976('0x2e')],_0x3d1610[_0xc976('0x2f')]);_0x595031[_0xc976('0x32')]=_[_0xc976('0x31')](_0x3d1610[_0xc976('0x2e')],qs[_0xc976('0x33')](_0x83bc0c[_0xc976('0x2f')][_0xc976('0x33')]));_0x595031[_0xc976('0x32')]=_0x595031[_0xc976('0x32')][_0xc976('0x34')]?_0x595031['attributes']:_0x3d1610[_0xc976('0x2e')];if(_0x83bc0c['query']['includeAll']){_0x595031['include']=[{'all':!![]}];}_0x595031=_[_0xc976('0x3b')]({},_0x595031,_0x83bc0c[_0xc976('0x3c')]);return db[_0xc976('0x2a')]['find'](_0x595031)[_0xc976('0x23')](handleEntityNotFound(_0x34a7c7,null))[_0xc976('0x23')](respondWithResult(_0x34a7c7,null))['catch'](handleError(_0x34a7c7,null));};exports[_0xc976('0x44')]=function(_0x4e4eb0,_0x3d6a91){return db[_0xc976('0x2a')]['create'](_0x4e4eb0[_0xc976('0x45')],{})[_0xc976('0x23')](respondWithResult(_0x3d6a91,0xc9))[_0xc976('0x41')](handleError(_0x3d6a91,null));};exports[_0xc976('0x22')]=function(_0x2ef401,_0x3e20ab){if(_0x2ef401[_0xc976('0x45')]['id']){delete _0x2ef401['body']['id'];}return db[_0xc976('0x2a')][_0xc976('0x46')]({'where':{'id':_0x2ef401['params']['id']}})[_0xc976('0x23')](handleEntityNotFound(_0x3e20ab,null))[_0xc976('0x23')](saveUpdates(_0x2ef401[_0xc976('0x45')],null))[_0xc976('0x23')](respondWithResult(_0x3e20ab,null))[_0xc976('0x41')](handleError(_0x3e20ab,null));};exports[_0xc976('0x47')]=function(_0x5f2fda,_0x39dae4){return db[_0xc976('0x2a')][_0xc976('0x46')]({'where':{'id':_0x5f2fda[_0xc976('0x42')]['id']}})['then'](handleEntityNotFound(_0x39dae4,null))['then'](removeEntity(_0x39dae4,null))[_0xc976('0x41')](handleError(_0x39dae4,null));}; \ No newline at end of file +var _0xc33e=['status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','sendStatus','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','rimraf','zip-dir','bluebird','mustache','util','path','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0xc33e,0x19a));var _0xec33=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc33e[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec33('0x0'));var zipdir=require(_0xec33('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xec33('0x2'));var Mustache=require(_0xec33('0x3'));var util=require(_0xec33('0x4'));var path=require(_0xec33('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec33('0x6'));var _=require('lodash');var squel=require(_0xec33('0x7'));var crypto=require(_0xec33('0x8'));var jsforce=require(_0xec33('0x9'));var deskjs=require(_0xec33('0xa'));var toCsv=require(_0xec33('0xb'));var querystring=require(_0xec33('0xc'));var Papa=require(_0xec33('0xd'));var Redis=require('ioredis');var authService=require(_0xec33('0xe'));var qs=require(_0xec33('0xf'));var as=require(_0xec33('0x10'));var hardwareService=require(_0xec33('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xec33('0x12'));var config=require(_0xec33('0x13'));var licenseUtil=require(_0xec33('0x14'));var db=require(_0xec33('0x15'))['db'];function respondWithStatusCode(_0x51a852,_0x18d0fc){_0x18d0fc=_0x18d0fc||0xcc;return function(_0x485551){if(_0x485551){return _0x51a852['sendStatus'](_0x18d0fc);}return _0x51a852[_0xec33('0x16')](_0x18d0fc)[_0xec33('0x17')]();};}function respondWithResult(_0x1b062d,_0x45435d){_0x45435d=_0x45435d||0xc8;return function(_0x5c5406){if(_0x5c5406){return _0x1b062d['status'](_0x45435d)[_0xec33('0x18')](_0x5c5406);}};}function respondWithFilteredResult(_0x515b22,_0x520757){return function(_0x4568bd){if(_0x4568bd){var _0x326d43=typeof _0x520757[_0xec33('0x19')]==='undefined'&&typeof _0x520757[_0xec33('0x1a')]===_0xec33('0x1b');var _0x350669=_0x4568bd[_0xec33('0x1c')];var _0x23e299=_0x326d43?0x0:_0x520757[_0xec33('0x19')];var _0x4b6b1e=_0x326d43?_0x4568bd[_0xec33('0x1c')]:_0x520757[_0xec33('0x19')]+_0x520757['limit'];var _0x14816d;if(_0x4b6b1e>=_0x350669){_0x4b6b1e=_0x350669;_0x14816d=0xc8;}else{_0x14816d=0xce;}_0x515b22['status'](_0x14816d);return _0x515b22[_0xec33('0x1d')]('Content-Range',_0x23e299+'-'+_0x4b6b1e+'/'+_0x350669)[_0xec33('0x18')](_0x4568bd);}return null;};}function patchUpdates(_0x23e4b8){return function(_0xbee21){try{jsonpatch[_0xec33('0x1e')](_0xbee21,_0x23e4b8,!![]);}catch(_0x2db2c){return BPromise[_0xec33('0x1f')](_0x2db2c);}return _0xbee21['save']();};}function saveUpdates(_0x3e55db,_0x32e7a7){return function(_0xd0d1a){if(_0xd0d1a){return _0xd0d1a[_0xec33('0x20')](_0x3e55db)[_0xec33('0x21')](function(_0x51d125){return _0x51d125;});}return null;};}function removeEntity(_0x1f3163,_0x58d19e){return function(_0x52bd2e){if(_0x52bd2e){return _0x52bd2e[_0xec33('0x22')]()['then'](function(){_0x1f3163[_0xec33('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3438bd,_0x34f043){return function(_0x1b5c6b){if(!_0x1b5c6b){_0x3438bd[_0xec33('0x23')](0x194);}return _0x1b5c6b;};}function handleError(_0x351c56,_0x2fd08b){_0x2fd08b=_0x2fd08b||0x1f4;return function(_0x468ffe){logger['error'](_0x468ffe[_0xec33('0x24')]);if(_0x468ffe[_0xec33('0x25')]){delete _0x468ffe[_0xec33('0x25')];}_0x351c56[_0xec33('0x16')](_0x2fd08b)[_0xec33('0x26')](_0x468ffe);};}exports[_0xec33('0x27')]=function(_0x4f7e0f,_0x1fd867){var _0xa904b2={},_0x5761ca={},_0x565d67={'count':0x0,'rows':[]};var _0x3e8012=_[_0xec33('0x28')](db[_0xec33('0x29')][_0xec33('0x2a')],function(_0x1f8e96){return{'name':_0x1f8e96[_0xec33('0x2b')],'type':_0x1f8e96['type'][_0xec33('0x2c')]};});_0x5761ca[_0xec33('0x2d')]=_['map'](_0x3e8012,'name');_0x5761ca[_0xec33('0x2e')]=_[_0xec33('0x2f')](_0x4f7e0f[_0xec33('0x2e')]);_0x5761ca[_0xec33('0x30')]=_['intersection'](_0x5761ca[_0xec33('0x2d')],_0x5761ca[_0xec33('0x2e')]);_0xa904b2[_0xec33('0x31')]=_[_0xec33('0x32')](_0x5761ca['model'],qs[_0xec33('0x33')](_0x4f7e0f['query']['fields']));_0xa904b2[_0xec33('0x31')]=_0xa904b2[_0xec33('0x31')][_0xec33('0x34')]?_0xa904b2[_0xec33('0x31')]:_0x5761ca[_0xec33('0x2d')];if(!_0x4f7e0f['query'][_0xec33('0x35')]('nolimit')){_0xa904b2[_0xec33('0x1a')]=qs[_0xec33('0x1a')](_0x4f7e0f[_0xec33('0x2e')]['limit']);_0xa904b2[_0xec33('0x19')]=qs['offset'](_0x4f7e0f['query'][_0xec33('0x19')]);}_0xa904b2[_0xec33('0x36')]=qs[_0xec33('0x37')](_0x4f7e0f[_0xec33('0x2e')][_0xec33('0x37')]);_0xa904b2['where']=qs['filters'](_[_0xec33('0x38')](_0x4f7e0f[_0xec33('0x2e')],_0x5761ca[_0xec33('0x30')]),_0x3e8012);if(_0x4f7e0f[_0xec33('0x2e')]['filter']){_0xa904b2[_0xec33('0x39')]=_[_0xec33('0x3a')](_0xa904b2[_0xec33('0x39')],{'$or':_['map'](_0x3e8012,function(_0x46ee01){if(_0x46ee01[_0xec33('0x3b')]!==_0xec33('0x3c')){var _0x2fbc16={};_0x2fbc16[_0x46ee01[_0xec33('0x25')]]={'$like':'%'+_0x4f7e0f[_0xec33('0x2e')][_0xec33('0x3d')]+'%'};return _0x2fbc16;}})});}_0xa904b2=_[_0xec33('0x3a')]({},_0xa904b2,_0x4f7e0f[_0xec33('0x3e')]);var _0xeece6e={'where':_0xa904b2[_0xec33('0x39')]};return db[_0xec33('0x29')][_0xec33('0x1c')](_0xeece6e)[_0xec33('0x21')](function(_0x516fbf){_0x565d67['count']=_0x516fbf;if(_0x4f7e0f[_0xec33('0x2e')][_0xec33('0x3f')]){_0xa904b2[_0xec33('0x40')]=[{'all':!![]}];}return db[_0xec33('0x29')][_0xec33('0x41')](_0xa904b2);})[_0xec33('0x21')](function(_0x55d602){_0x565d67[_0xec33('0x42')]=_0x55d602;return _0x565d67;})[_0xec33('0x21')](respondWithFilteredResult(_0x1fd867,_0xa904b2))[_0xec33('0x43')](handleError(_0x1fd867,null));};exports['show']=function(_0x118df2,_0x57df01){var _0x233fa2={'raw':!![],'where':{'id':_0x118df2[_0xec33('0x44')]['id']}},_0x5050ca={};_0x5050ca[_0xec33('0x2d')]=_[_0xec33('0x2f')](db[_0xec33('0x29')]['rawAttributes']);_0x5050ca[_0xec33('0x2e')]=_['keys'](_0x118df2[_0xec33('0x2e')]);_0x5050ca[_0xec33('0x30')]=_['intersection'](_0x5050ca['model'],_0x5050ca[_0xec33('0x2e')]);_0x233fa2[_0xec33('0x31')]=_['intersection'](_0x5050ca[_0xec33('0x2d')],qs['fields'](_0x118df2[_0xec33('0x2e')][_0xec33('0x33')]));_0x233fa2[_0xec33('0x31')]=_0x233fa2[_0xec33('0x31')]['length']?_0x233fa2[_0xec33('0x31')]:_0x5050ca[_0xec33('0x2d')];if(_0x118df2[_0xec33('0x2e')][_0xec33('0x3f')]){_0x233fa2['include']=[{'all':!![]}];}_0x233fa2=_[_0xec33('0x3a')]({},_0x233fa2,_0x118df2['options']);return db[_0xec33('0x29')][_0xec33('0x45')](_0x233fa2)[_0xec33('0x21')](handleEntityNotFound(_0x57df01,null))[_0xec33('0x21')](respondWithResult(_0x57df01,null))[_0xec33('0x43')](handleError(_0x57df01,null));};exports[_0xec33('0x46')]=function(_0x514536,_0x25b99c){return db[_0xec33('0x29')]['create'](_0x514536[_0xec33('0x47')],{})['then'](respondWithResult(_0x25b99c,0xc9))[_0xec33('0x43')](handleError(_0x25b99c,null));};exports[_0xec33('0x20')]=function(_0x4f90df,_0x590ec1){if(_0x4f90df['body']['id']){delete _0x4f90df['body']['id'];}return db[_0xec33('0x29')][_0xec33('0x45')]({'where':{'id':_0x4f90df['params']['id']}})['then'](handleEntityNotFound(_0x590ec1,null))[_0xec33('0x21')](saveUpdates(_0x4f90df['body'],null))['then'](respondWithResult(_0x590ec1,null))['catch'](handleError(_0x590ec1,null));};exports[_0xec33('0x22')]=function(_0x505643,_0x4a95ab){return db[_0xec33('0x29')][_0xec33('0x45')]({'where':{'id':_0x505643[_0xec33('0x44')]['id']}})['then'](handleEntityNotFound(_0x4a95ab,null))[_0xec33('0x21')](removeEntity(_0x4a95ab,null))['catch'](handleError(_0x4a95ab,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 58350e3..7755afd 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 _0x8b35=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','define','freshsales_unique_index','idField','FieldId'];(function(_0x164760,_0x5874b0){var _0x8b91b2=function(_0x40d20a){while(--_0x40d20a){_0x164760['push'](_0x164760['shift']());}};_0x8b91b2(++_0x5874b0);}(_0x8b35,0x17a));var _0x58b3=function(_0x39a5c6,_0x2fc06c){_0x39a5c6=_0x39a5c6-0x0;var _0x5a62bb=_0x8b35[_0x39a5c6];return _0x5a62bb;};'use strict';var _=require(_0x58b3('0x0'));var util=require(_0x58b3('0x1'));var logger=require(_0x58b3('0x2'))(_0x58b3('0x3'));var moment=require(_0x58b3('0x4'));var BPromise=require('bluebird');var rp=require(_0x58b3('0x5'));var fs=require('fs');var path=require(_0x58b3('0x6'));var rimraf=require(_0x58b3('0x7'));var config=require(_0x58b3('0x8'));var attributes=require(_0x58b3('0x9'));module['exports']=function(_0x40ada0,_0x5ef00a){return _0x40ada0[_0x58b3('0xa')]('FreshsalesField',attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x58b3('0xb'),'fields':[_0x58b3('0xc'),_0x58b3('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x30fc=['request-promise','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','api','moment','bluebird'];(function(_0x287a47,_0x2f731c){var _0x3fb726=function(_0xbedc33){while(--_0xbedc33){_0x287a47['push'](_0x287a47['shift']());}};_0x3fb726(++_0x2f731c);}(_0x30fc,0x64));var _0xc30f=function(_0x3eaea7,_0x9968ff){_0x3eaea7=_0x3eaea7-0x0;var _0xd7cd35=_0x30fc[_0x3eaea7];return _0xd7cd35;};'use strict';var _=require(_0xc30f('0x0'));var util=require(_0xc30f('0x1'));var logger=require('../../config/logger')(_0xc30f('0x2'));var moment=require(_0xc30f('0x3'));var BPromise=require(_0xc30f('0x4'));var rp=require(_0xc30f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc30f('0x6'));var config=require(_0xc30f('0x7'));var attributes=require(_0xc30f('0x8'));module[_0xc30f('0x9')]=function(_0x2948cb,_0x293391){return _0x2948cb['define'](_0xc30f('0xa'),attributes,{'tableName':_0xc30f('0xb'),'paranoid':![],'indexes':[{'name':_0xc30f('0xc'),'fields':[_0xc30f('0xd'),_0xc30f('0xe')],'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 b83c63c..477a67d 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 _0x5496=['../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2639e0,_0x455d95){var _0x485611=function(_0x28ce94){while(--_0x28ce94){_0x2639e0['push'](_0x2639e0['shift']());}};_0x485611(++_0x455d95);}(_0x5496,0x175));var _0x6549=function(_0x3fb499,_0x1374a7){_0x3fb499=_0x3fb499-0x0;var _0x41fdd9=_0x5496[_0x3fb499];return _0x41fdd9;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var moment=require(_0x6549('0x2'));var BPromise=require(_0x6549('0x3'));var rs=require(_0x6549('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6549('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6549('0x6'))(_0x6549('0x7'));var config=require(_0x6549('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6549('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d8cea,_0x4fcffd,_0x1ca8fc){return new BPromise(function(_0x3442c3,_0x1ef2a6){return client['request'](_0x1d8cea,_0x1ca8fc)[_0x6549('0xa')](function(_0x35d008){logger[_0x6549('0xb')](_0x6549('0xc'),_0x4fcffd,_0x6549('0xd'));logger[_0x6549('0xe')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x4fcffd,'request\x20sent',JSON[_0x6549('0xf')](_0x35d008));if(_0x35d008[_0x6549('0x10')]){if(_0x35d008[_0x6549('0x10')][_0x6549('0x11')]===0x1f4){logger[_0x6549('0x10')]('FreshsalesField,\x20%s,\x20%s',_0x4fcffd,_0x35d008['error'][_0x6549('0x12')]);return _0x1ef2a6(_0x35d008[_0x6549('0x10')]['message']);}logger[_0x6549('0x10')](_0x6549('0xc'),_0x4fcffd,_0x35d008[_0x6549('0x10')][_0x6549('0x12')]);return _0x3442c3(_0x35d008[_0x6549('0x10')][_0x6549('0x12')]);}else{logger['info']('FreshsalesField,\x20%s,\x20%s',_0x4fcffd,_0x6549('0xd'));_0x3442c3(_0x35d008[_0x6549('0x13')]['message']);}})[_0x6549('0x14')](function(_0x67acc0){logger[_0x6549('0x10')](_0x6549('0xc'),_0x4fcffd,_0x67acc0);_0x1ef2a6(_0x67acc0);});});} \ No newline at end of file +var _0xdbf5=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesField,\x20%s,\x20%s','debug','stringify','code','error','message','request\x20sent','result','catch'];(function(_0x4d9892,_0x16b42c){var _0x17eecf=function(_0x4c1ba7){while(--_0x4c1ba7){_0x4d9892['push'](_0x4d9892['shift']());}};_0x17eecf(++_0x16b42c);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x3a9959,_0x6bd0a5){_0x3a9959=_0x3a9959-0x0;var _0x10e253=_0xdbf5[_0x3a9959];return _0x10e253;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5dbf('0x1'));var fs=require('fs');var Redis=require(_0x5dbf('0x2'));var db=require(_0x5dbf('0x3'))['db'];var utils=require(_0x5dbf('0x4'));var logger=require(_0x5dbf('0x5'))(_0x5dbf('0x6'));var config=require(_0x5dbf('0x7'));var jayson=require(_0x5dbf('0x8'));var client=jayson[_0x5dbf('0x9')][_0x5dbf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x209b7d,_0x88128e,_0x93e657){return new BPromise(function(_0x52b039,_0x134810){return client['request'](_0x209b7d,_0x93e657)[_0x5dbf('0xb')](function(_0x3bec50){logger[_0x5dbf('0xc')](_0x5dbf('0xd'),_0x88128e,'request\x20sent');logger[_0x5dbf('0xe')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x88128e,'request\x20sent',JSON[_0x5dbf('0xf')](_0x3bec50));if(_0x3bec50['error']){if(_0x3bec50['error'][_0x5dbf('0x10')]===0x1f4){logger['error'](_0x5dbf('0xd'),_0x88128e,_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);return _0x134810(_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);}logger['error']('FreshsalesField,\x20%s,\x20%s',_0x88128e,_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);return _0x52b039(_0x3bec50['error'][_0x5dbf('0x12')]);}else{logger[_0x5dbf('0xc')](_0x5dbf('0xd'),_0x88128e,_0x5dbf('0x13'));_0x52b039(_0x3bec50[_0x5dbf('0x14')][_0x5dbf('0x12')]);}})[_0x5dbf('0x15')](function(_0x50ef1d){logger['error'](_0x5dbf('0xd'),_0x88128e,_0x50ef1d);_0x134810(_0x50ef1d);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 402aec3..a37b3ac 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x1d6fce,_0x4671c9){var _0x556c10=function(_0x99cae0){while(--_0x99cae0){_0x1d6fce['push'](_0x1d6fce['shift']());}};_0x556c10(++_0x4671c9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2964b2,_0x5a4ebd){var _0x2cc2e6=function(_0x171d2e){while(--_0x171d2e){_0x2964b2['push'](_0x2964b2['shift']());}};_0x2cc2e6(++_0x5a4ebd);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 532fe80..30b93b9 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 _0x28a6=['integrationTab','newTab','exports','STRING'];(function(_0x4a18b1,_0x40136a){var _0x1cd922=function(_0x35822f){while(--_0x35822f){_0x4a18b1['push'](_0x4a18b1['shift']());}};_0x1cd922(++_0x40136a);}(_0x28a6,0x166));var _0x628a=function(_0x1b1365,_0x205568){_0x1b1365=_0x1b1365-0x0;var _0x5edfd8=_0x28a6[_0x1b1365];return _0x5edfd8;};'use strict';var Sequelize=require('sequelize');module[_0x628a('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x628a('0x1')],'unique':'username'},'remoteUri':{'type':Sequelize[_0x628a('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x628a('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x628a('0x2'),_0x628a('0x3')),'defaultValue':_0x628a('0x2')}}; \ No newline at end of file +var _0x4b38=['STRING','username','integrationTab','sequelize'];(function(_0x404deb,_0x700f79){var _0x41b21e=function(_0x52eb51){while(--_0x52eb51){_0x404deb['push'](_0x404deb['shift']());}};_0x41b21e(++_0x700f79);}(_0x4b38,0x157));var _0x84b3=function(_0x451217,_0x10df03){_0x451217=_0x451217-0x0;var _0x1c7c5f=_0x4b38[_0x451217];return _0x1c7c5f;};'use strict';var Sequelize=require(_0x84b3('0x0'));module['exports']={'name':{'type':Sequelize[_0x84b3('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x84b3('0x1')],'unique':_0x84b3('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x84b3('0x1')]},'clientId':{'type':Sequelize[_0x84b3('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x84b3('0x1')]},'serverUrl':{'type':Sequelize[_0x84b3('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x84b3('0x3'),'newTab'),'defaultValue':_0x84b3('0x3')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 513d423..021c0e4 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 _0x92c4=['statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','sendStatus','stack','name','send','index','rawAttributes','map','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','SalesforceAccount','findAll','rows','catch','show','find','create','body','params','findOne','SalesforceConfiguration','order','filter','options','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','channel','type','SalesforceField','Descriptions','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','Connection','login','isNil','ticketType','sobject','describe','ActivityDate','IsReminderSet','IsRecurrence','Description','string','int','picklist','boolean','email','textarea','phone','remove','includes','length','label','custom','true','False','false'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x92c4,0x178));var _0x492c=function(_0xb76f09,_0x53d8fe){_0xb76f09=_0xb76f09-0x0;var _0x35421e=_0x92c4[_0xb76f09];return _0x35421e;};'use strict';var emlformat=require(_0x492c('0x0'));var rimraf=require(_0x492c('0x1'));var zipdir=require(_0x492c('0x2'));var jsonpatch=require(_0x492c('0x3'));var rp=require(_0x492c('0x4'));var moment=require(_0x492c('0x5'));var BPromise=require(_0x492c('0x6'));var Mustache=require(_0x492c('0x7'));var util=require(_0x492c('0x8'));var path=require(_0x492c('0x9'));var sox=require(_0x492c('0xa'));var csv=require(_0x492c('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x492c('0xc'));var _=require('lodash');var squel=require(_0x492c('0xd'));var crypto=require(_0x492c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x492c('0xf'));var toCsv=require(_0x492c('0xb'));var querystring=require(_0x492c('0x10'));var Papa=require(_0x492c('0x11'));var Redis=require(_0x492c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x492c('0x13'));var as=require(_0x492c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x492c('0x15'));var licenseUtil=require(_0x492c('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x492c('0x17'));function respondWithStatusCode(_0x227cbd,_0x22775c){_0x22775c=_0x22775c||0xcc;return function(_0x3fea8d){if(_0x3fea8d){return _0x227cbd['sendStatus'](_0x22775c);}return _0x227cbd[_0x492c('0x18')](_0x22775c)[_0x492c('0x19')]();};}function respondWithResult(_0x24c591,_0x370dab){_0x370dab=_0x370dab||0xc8;return function(_0x40f775){if(_0x40f775){return _0x24c591[_0x492c('0x18')](_0x370dab)[_0x492c('0x1a')](_0x40f775);}};}function respondWithFilteredResult(_0x244a77,_0x5be8a0){return function(_0x36bccd){if(_0x36bccd){var _0x30ed02=typeof _0x5be8a0[_0x492c('0x1b')]===_0x492c('0x1c')&&typeof _0x5be8a0['limit']===_0x492c('0x1c');var _0x388080=_0x36bccd[_0x492c('0x1d')];var _0x38b3f=_0x30ed02?0x0:_0x5be8a0[_0x492c('0x1b')];var _0x3a3035=_0x30ed02?_0x36bccd[_0x492c('0x1d')]:_0x5be8a0['offset']+_0x5be8a0[_0x492c('0x1e')];var _0x2308bb;if(_0x3a3035>=_0x388080){_0x3a3035=_0x388080;_0x2308bb=0xc8;}else{_0x2308bb=0xce;}_0x244a77[_0x492c('0x18')](_0x2308bb);return _0x244a77['set'](_0x492c('0x1f'),_0x38b3f+'-'+_0x3a3035+'/'+_0x388080)[_0x492c('0x1a')](_0x36bccd);}return null;};}function patchUpdates(_0xab32f5){return function(_0x57e60a){try{jsonpatch[_0x492c('0x20')](_0x57e60a,_0xab32f5,!![]);}catch(_0x371125){return BPromise['reject'](_0x371125);}return _0x57e60a[_0x492c('0x21')]();};}function saveUpdates(_0xfd206a,_0x2e79e7){return function(_0x2527a3){if(_0x2527a3){return _0x2527a3[_0x492c('0x22')](_0xfd206a)[_0x492c('0x23')](function(_0x554b5a){return _0x554b5a;});}return null;};}function removeEntity(_0x1cdffb,_0x58b254){return function(_0x393ad7){if(_0x393ad7){return _0x393ad7[_0x492c('0x24')]()[_0x492c('0x23')](function(){_0x1cdffb[_0x492c('0x18')](0xcc)[_0x492c('0x19')]();});}};}function handleEntityNotFound(_0x5c7b0e,_0x289654){return function(_0x5e8460){if(!_0x5e8460){_0x5c7b0e[_0x492c('0x25')](0x194);}return _0x5e8460;};}function handleError(_0x59dd41,_0x1ce5b5){_0x1ce5b5=_0x1ce5b5||0x1f4;return function(_0x1fb567){logger['error'](_0x1fb567[_0x492c('0x26')]);if(_0x1fb567[_0x492c('0x27')]){delete _0x1fb567[_0x492c('0x27')];}_0x59dd41[_0x492c('0x18')](_0x1ce5b5)[_0x492c('0x28')](_0x1fb567);};}exports[_0x492c('0x29')]=function(_0x382ed8,_0x286f2e){var _0x579f5d={},_0x1d3374={},_0x377467={'count':0x0,'rows':[]};var _0x15bd71=_['map'](db['SalesforceAccount'][_0x492c('0x2a')],function(_0x268cab){return{'name':_0x268cab['fieldName'],'type':_0x268cab['type']['key']};});_0x1d3374['model']=_[_0x492c('0x2b')](_0x15bd71,'name');_0x1d3374[_0x492c('0x2c')]=_[_0x492c('0x2d')](_0x382ed8[_0x492c('0x2c')]);_0x1d3374[_0x492c('0x2e')]=_['intersection'](_0x1d3374[_0x492c('0x2f')],_0x1d3374[_0x492c('0x2c')]);_0x579f5d[_0x492c('0x30')]=_[_0x492c('0x31')](_0x1d3374[_0x492c('0x2f')],qs[_0x492c('0x32')](_0x382ed8['query'][_0x492c('0x32')]));_0x579f5d[_0x492c('0x30')]=_0x579f5d[_0x492c('0x30')]['length']?_0x579f5d[_0x492c('0x30')]:_0x1d3374[_0x492c('0x2f')];if(!_0x382ed8[_0x492c('0x2c')][_0x492c('0x33')](_0x492c('0x34'))){_0x579f5d[_0x492c('0x1e')]=qs[_0x492c('0x1e')](_0x382ed8['query'][_0x492c('0x1e')]);_0x579f5d['offset']=qs['offset'](_0x382ed8[_0x492c('0x2c')][_0x492c('0x1b')]);}_0x579f5d['order']=qs['sort'](_0x382ed8['query'][_0x492c('0x35')]);_0x579f5d[_0x492c('0x36')]=qs[_0x492c('0x2e')](_[_0x492c('0x37')](_0x382ed8[_0x492c('0x2c')],_0x1d3374['filters']),_0x15bd71);if(_0x382ed8[_0x492c('0x2c')]['filter']){_0x579f5d[_0x492c('0x36')]=_[_0x492c('0x38')](_0x579f5d['where'],{'$or':_[_0x492c('0x2b')](_0x15bd71,function(_0x2b4ff0){if(_0x2b4ff0['type']!==_0x492c('0x39')){var _0x513b56={};_0x513b56[_0x2b4ff0[_0x492c('0x27')]]={'$like':'%'+_0x382ed8[_0x492c('0x2c')]['filter']+'%'};return _0x513b56;}})});}_0x579f5d=_['merge']({},_0x579f5d,_0x382ed8['options']);var _0x5451e0={'where':_0x579f5d['where']};return db[_0x492c('0x3a')][_0x492c('0x1d')](_0x5451e0)['then'](function(_0x4202c7){_0x377467[_0x492c('0x1d')]=_0x4202c7;if(_0x382ed8[_0x492c('0x2c')]['includeAll']){_0x579f5d['include']=[{'all':!![]}];}return db[_0x492c('0x3a')][_0x492c('0x3b')](_0x579f5d);})['then'](function(_0x464ac6){_0x377467[_0x492c('0x3c')]=_0x464ac6;return _0x377467;})['then'](respondWithFilteredResult(_0x286f2e,_0x579f5d))[_0x492c('0x3d')](handleError(_0x286f2e,null));};exports[_0x492c('0x3e')]=function(_0x23b7d3,_0x9cec5c){var _0x4630d7={'raw':![],'where':{'id':_0x23b7d3['params']['id']}},_0x3c64ad={};_0x3c64ad[_0x492c('0x2f')]=_[_0x492c('0x2d')](db['SalesforceAccount'][_0x492c('0x2a')]);_0x3c64ad[_0x492c('0x2c')]=_['keys'](_0x23b7d3[_0x492c('0x2c')]);_0x3c64ad['filters']=_[_0x492c('0x31')](_0x3c64ad['model'],_0x3c64ad[_0x492c('0x2c')]);_0x4630d7[_0x492c('0x30')]=_[_0x492c('0x31')](_0x3c64ad[_0x492c('0x2f')],qs[_0x492c('0x32')](_0x23b7d3[_0x492c('0x2c')][_0x492c('0x32')]));_0x4630d7['attributes']=_0x4630d7['attributes']['length']?_0x4630d7[_0x492c('0x30')]:_0x3c64ad[_0x492c('0x2f')];if(_0x23b7d3[_0x492c('0x2c')]['includeAll']){_0x4630d7['include']=[{'all':!![]}];}_0x4630d7=_[_0x492c('0x38')]({},_0x4630d7,_0x23b7d3['options']);return db['SalesforceAccount'][_0x492c('0x3f')](_0x4630d7)['then'](handleEntityNotFound(_0x9cec5c,null))[_0x492c('0x23')](respondWithResult(_0x9cec5c,null))[_0x492c('0x3d')](handleError(_0x9cec5c,null));};exports[_0x492c('0x40')]=function(_0x4e1d3d,_0x5312a4){return db[_0x492c('0x3a')]['create'](_0x4e1d3d[_0x492c('0x41')],{})[_0x492c('0x23')](respondWithResult(_0x5312a4,0xc9))[_0x492c('0x3d')](handleError(_0x5312a4,null));};exports['update']=function(_0x175b29,_0x219e96){if(_0x175b29[_0x492c('0x41')]['id']){delete _0x175b29[_0x492c('0x41')]['id'];}return db['SalesforceAccount'][_0x492c('0x3f')]({'where':{'id':_0x175b29[_0x492c('0x42')]['id']}})[_0x492c('0x23')](handleEntityNotFound(_0x219e96,null))[_0x492c('0x23')](saveUpdates(_0x175b29[_0x492c('0x41')],null))[_0x492c('0x23')](respondWithResult(_0x219e96,null))[_0x492c('0x3d')](handleError(_0x219e96,null));};exports[_0x492c('0x24')]=function(_0x37f798,_0x2b682a){return db[_0x492c('0x3a')][_0x492c('0x3f')]({'where':{'id':_0x37f798[_0x492c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2b682a,null))[_0x492c('0x23')](removeEntity(_0x2b682a,null))[_0x492c('0x3d')](handleError(_0x2b682a,null));};exports['getConfigurations']=function(_0xd7ce0f,_0x582cae,_0x203238){var _0x15bce7={};var _0x279f90={};var _0x86e096;var _0x3e7b7e;return db[_0x492c('0x3a')][_0x492c('0x43')]({'where':{'id':_0xd7ce0f[_0x492c('0x42')]['id']}})['then'](handleEntityNotFound(_0x582cae,null))[_0x492c('0x23')](function(_0x2efe54){if(_0x2efe54){_0x86e096=_0x2efe54;_0x279f90['model']=_['keys'](db[_0x492c('0x44')][_0x492c('0x2a')]);_0x279f90[_0x492c('0x2c')]=_[_0x492c('0x2d')](_0xd7ce0f['query']);_0x279f90[_0x492c('0x2e')]=_['intersection'](_0x279f90['model'],_0x279f90['query']);_0x15bce7[_0x492c('0x30')]=_[_0x492c('0x31')](_0x279f90['model'],qs[_0x492c('0x32')](_0xd7ce0f['query'][_0x492c('0x32')]));_0x15bce7[_0x492c('0x30')]=_0x15bce7[_0x492c('0x30')]['length']?_0x15bce7['attributes']:_0x279f90[_0x492c('0x2f')];_0x15bce7[_0x492c('0x45')]=qs[_0x492c('0x35')](_0xd7ce0f[_0x492c('0x2c')][_0x492c('0x35')]);_0x15bce7[_0x492c('0x36')]=qs['filters'](_[_0x492c('0x37')](_0xd7ce0f[_0x492c('0x2c')],_0x279f90['filters']));if(_0xd7ce0f[_0x492c('0x2c')]['filter']){_0x15bce7[_0x492c('0x36')]=_['merge'](_0x15bce7[_0x492c('0x36')],{'$or':_[_0x492c('0x2b')](_0x15bce7['attributes'],function(_0x46faea){var _0x434076={};_0x434076[_0x46faea]={'$like':'%'+_0xd7ce0f[_0x492c('0x2c')][_0x492c('0x46')]+'%'};return _0x434076;})});}_0x15bce7=_[_0x492c('0x38')]({},_0x15bce7,_0xd7ce0f[_0x492c('0x47')]);return _0x86e096[_0x492c('0x48')](_0x15bce7);}})['then'](function(_0x51b7b6){if(_0x51b7b6){_0x3e7b7e=_0x51b7b6['length'];if(!_0xd7ce0f[_0x492c('0x2c')][_0x492c('0x33')](_0x492c('0x34'))){_0x15bce7[_0x492c('0x1e')]=qs['limit'](_0xd7ce0f[_0x492c('0x2c')][_0x492c('0x1e')]);_0x15bce7[_0x492c('0x1b')]=qs[_0x492c('0x1b')](_0xd7ce0f['query'][_0x492c('0x1b')]);}return _0x86e096[_0x492c('0x48')](_0x15bce7);}})[_0x492c('0x23')](function(_0x639c91){if(_0x639c91){return _0x639c91?{'count':_0x3e7b7e,'rows':_0x639c91}:null;}})[_0x492c('0x23')](respondWithResult(_0x582cae,null))['catch'](handleError(_0x582cae,null));};exports[_0x492c('0x49')]=function(_0x491375,_0x193a2d,_0x33807c){if(_0x491375[_0x492c('0x41')]['id']){delete _0x491375['body']['id'];}return db[_0x492c('0x3a')][_0x492c('0x43')]({'where':{'id':_0x491375['params']['id']}})[_0x492c('0x23')](handleEntityNotFound(_0x193a2d,null))['then'](function(_0x30649f){if(_0x30649f){_0x491375['body'][_0x492c('0x4a')]=_0x30649f['id'];_0x491375[_0x492c('0x41')][_0x492c('0x4b')]=integrations[_0x492c('0x4c')](_0x491375[_0x492c('0x41')]['channel'],_0x491375[_0x492c('0x41')]['type']);_0x491375[_0x492c('0x41')]['Descriptions']=integrations[_0x492c('0x4d')](_0x491375['body'][_0x492c('0x4e')],_0x491375[_0x492c('0x41')][_0x492c('0x4f')]);return db[_0x492c('0x44')][_0x492c('0x40')](_0x491375[_0x492c('0x41')],{'include':[{'model':db[_0x492c('0x50')],'as':'Subjects'},{'model':db[_0x492c('0x50')],'as':_0x492c('0x51')}]});}return null;})['then'](respondWithResult(_0x193a2d,null))['catch'](handleError(_0x193a2d,null));};exports['getFields']=function(_0x1ae5ce,_0x507b72,_0x1ac81e){var _0x443d78;var _0x3093a4='';var _0x507cee=_0x492c('0x52');return db['SalesforceAccount']['findOne']({'where':{'id':_0x1ae5ce[_0x492c('0x42')]['id']},'attributes':['id',_0x492c('0x53'),_0x492c('0x54'),_0x492c('0x55'),_0x492c('0x56'),_0x492c('0x57'),_0x492c('0x58')]})[_0x492c('0x23')](handleEntityNotFound(_0x507b72,null))['then'](function(_0x11e6a4){if(_0x11e6a4){_0x3093a4=_0x11e6a4[_0x492c('0x53')];var _0x13ae46=_0x3093a4[_0x492c('0x59')](-0x1);if(_0x13ae46==='/'){_0x3093a4=_0x3093a4[_0x492c('0x5a')](0x0,_0x3093a4['lastIndexOf'](_0x13ae46));}_0x443d78=new jsforce[(_0x492c('0x5b'))]({'oauth2':{'loginUrl':_0x3093a4,'clientId':_0x11e6a4[_0x492c('0x54')],'clientSecret':_0x11e6a4['clientSecret']}});return _0x443d78[_0x492c('0x5c')](_0x11e6a4[_0x492c('0x56')],_0x11e6a4[_0x492c('0x57')]['concat'](_0x11e6a4[_0x492c('0x58')]));}})['then'](function(_0x100b0e){if(_0x100b0e){if(!_[_0x492c('0x5d')](_0x1ae5ce[_0x492c('0x2c')][_0x492c('0x5e')])){_0x507cee=_0x1ae5ce[_0x492c('0x2c')]['ticketType'];}return _0x443d78[_0x492c('0x5f')](_0x507cee)[_0x492c('0x60')]();}})[_0x492c('0x23')](function(_0x54a0fb){var _0x23199c=['OwnerId',_0x492c('0x61'),_0x492c('0x62'),_0x492c('0x63'),'Subject',_0x492c('0x64')];var _0x5b5945=[_0x492c('0x65'),_0x492c('0x66'),_0x492c('0x67'),_0x492c('0x68'),_0x492c('0x69'),_0x492c('0x6a'),_0x492c('0x6b')];if(_0x54a0fb){_[_0x492c('0x6c')](_0x54a0fb[_0x492c('0x32')],function(_0x2d71aa){return _0x23199c[_0x492c('0x6d')](_0x2d71aa['name'])||!_0x5b5945['includes'](_0x2d71aa[_0x492c('0x4f')]);});return{'count':_0x54a0fb[_0x492c('0x32')][_0x492c('0x6e')],'rows':_[_0x492c('0x2b')](_0x54a0fb[_0x492c('0x32')],function(_0x90cdf1){return{'id':_0x90cdf1[_0x492c('0x27')],'name':_0x90cdf1[_0x492c('0x6f')],'custom':_0x90cdf1[_0x492c('0x70')],'options':_0x90cdf1['picklistValues'][_0x492c('0x6e')]>0x0?_[_0x492c('0x2b')](_0x90cdf1['picklistValues'],function(_0x43673f){return{'name':_0x43673f[_0x492c('0x6f')],'value':_0x43673f['value']};}):_0x90cdf1[_0x492c('0x4f')]==_0x492c('0x68')?[{'name':'True','value':_0x492c('0x71')},{'name':_0x492c('0x72'),'value':_0x492c('0x73')}]:[]};})};}})[_0x492c('0x23')](respondWithResult(_0x507b72,null))[_0x492c('0x3d')](function(_0x349f1c){var _0x53fa17=_0x1ae5ce[_0x492c('0x2c')]['test']?0x1f4:_0x349f1c[_0x492c('0x74')]||0x1f4;logger[_0x492c('0x75')](_0x492c('0x76'),_0x492c('0x77'),_0x53fa17,JSON[_0x492c('0x78')](_0x349f1c));delete _0x349f1c[_0x492c('0x27')];if(_0x53fa17===0x191){_0x53fa17=0x190;}_0x507b72['status'](_0x53fa17)[_0x492c('0x28')](_0x1ae5ce[_0x492c('0x2c')][_0x492c('0x79')]?{'message':_0x492c('0x7a'),'statusCode':_0x349f1c[_0x492c('0x74')]}:_0x349f1c);});}; \ No newline at end of file +var _0x45e0=['../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','VIRTUAL','filter','options','SalesforceAccount','include','rows','catch','params','includeAll','merge','find','create','body','destroy','getConfigurations','findOne','SalesforceConfiguration','rawAttributes','sort','addConfiguration','Subjects','channel','Descriptions','SalesforceField','getFields','Task','remoteUri','clientId','password','securityToken','substring','lastIndexOf','Connection','clientSecret','login','username','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','email','includes','custom','picklistValues','label','boolean','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x7f4118,_0x3331c2){var _0x34e9af=function(_0x54fe58){while(--_0x54fe58){_0x7f4118['push'](_0x7f4118['shift']());}};_0x34e9af(++_0x3331c2);}(_0x45e0,0x66));var _0x045e=function(_0x4f3da8,_0xfc5e41){_0x4f3da8=_0x4f3da8-0x0;var _0x45e590=_0x45e0[_0x4f3da8];return _0x45e590;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x045e('0x0'));var zipdir=require(_0x045e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x045e('0x2'));var moment=require(_0x045e('0x3'));var BPromise=require(_0x045e('0x4'));var Mustache=require(_0x045e('0x5'));var util=require(_0x045e('0x6'));var path=require(_0x045e('0x7'));var sox=require('sox');var csv=require(_0x045e('0x8'));var ejs=require(_0x045e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x045e('0xa'));var squel=require('squel');var crypto=require(_0x045e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x045e('0xc'));var toCsv=require(_0x045e('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x045e('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x045e('0xe'));var hardwareService=require(_0x045e('0xf'));var logger=require(_0x045e('0x10'))(_0x045e('0x11'));var utils=require(_0x045e('0x12'));var config=require(_0x045e('0x13'));var licenseUtil=require(_0x045e('0x14'));var db=require(_0x045e('0x15'))['db'];var integrations=require(_0x045e('0x16'));function respondWithStatusCode(_0x4b3ba5,_0x289402){_0x289402=_0x289402||0xcc;return function(_0x183da2){if(_0x183da2){return _0x4b3ba5[_0x045e('0x17')](_0x289402);}return _0x4b3ba5[_0x045e('0x18')](_0x289402)[_0x045e('0x19')]();};}function respondWithResult(_0x45659f,_0x184d32){_0x184d32=_0x184d32||0xc8;return function(_0xd7ef08){if(_0xd7ef08){return _0x45659f[_0x045e('0x18')](_0x184d32)[_0x045e('0x1a')](_0xd7ef08);}};}function respondWithFilteredResult(_0x364a84,_0x1fee23){return function(_0x464566){if(_0x464566){var _0x4e83e4=typeof _0x1fee23[_0x045e('0x1b')]===_0x045e('0x1c')&&typeof _0x1fee23[_0x045e('0x1d')]===_0x045e('0x1c');var _0x1da512=_0x464566[_0x045e('0x1e')];var _0x261b0a=_0x4e83e4?0x0:_0x1fee23['offset'];var _0xd0b2fc=_0x4e83e4?_0x464566['count']:_0x1fee23[_0x045e('0x1b')]+_0x1fee23['limit'];var _0xbc0367;if(_0xd0b2fc>=_0x1da512){_0xd0b2fc=_0x1da512;_0xbc0367=0xc8;}else{_0xbc0367=0xce;}_0x364a84[_0x045e('0x18')](_0xbc0367);return _0x364a84[_0x045e('0x1f')](_0x045e('0x20'),_0x261b0a+'-'+_0xd0b2fc+'/'+_0x1da512)[_0x045e('0x1a')](_0x464566);}return null;};}function patchUpdates(_0x46f81f){return function(_0x3871fb){try{jsonpatch[_0x045e('0x21')](_0x3871fb,_0x46f81f,!![]);}catch(_0x17ee3f){return BPromise[_0x045e('0x22')](_0x17ee3f);}return _0x3871fb[_0x045e('0x23')]();};}function saveUpdates(_0xfbb673,_0x410554){return function(_0x3ff3da){if(_0x3ff3da){return _0x3ff3da[_0x045e('0x24')](_0xfbb673)['then'](function(_0x435344){return _0x435344;});}return null;};}function removeEntity(_0x3cd017,_0x38ce62){return function(_0x3296ca){if(_0x3296ca){return _0x3296ca['destroy']()[_0x045e('0x25')](function(){_0x3cd017['status'](0xcc)[_0x045e('0x19')]();});}};}function handleEntityNotFound(_0x5d9286,_0x74510){return function(_0x33248b){if(!_0x33248b){_0x5d9286['sendStatus'](0x194);}return _0x33248b;};}function handleError(_0x38993c,_0x14931f){_0x14931f=_0x14931f||0x1f4;return function(_0x3c528f){logger[_0x045e('0x26')](_0x3c528f[_0x045e('0x27')]);if(_0x3c528f[_0x045e('0x28')]){delete _0x3c528f[_0x045e('0x28')];}_0x38993c[_0x045e('0x18')](_0x14931f)[_0x045e('0x29')](_0x3c528f);};}exports['index']=function(_0x26527c,_0x1df786){var _0x19a2f6={},_0x1e4bcd={},_0x58e2ad={'count':0x0,'rows':[]};var _0x2d59b8=_[_0x045e('0x2a')](db['SalesforceAccount']['rawAttributes'],function(_0x1d8bb5){return{'name':_0x1d8bb5['fieldName'],'type':_0x1d8bb5[_0x045e('0x2b')][_0x045e('0x2c')]};});_0x1e4bcd[_0x045e('0x2d')]=_[_0x045e('0x2a')](_0x2d59b8,'name');_0x1e4bcd[_0x045e('0x2e')]=_[_0x045e('0x2f')](_0x26527c['query']);_0x1e4bcd['filters']=_[_0x045e('0x30')](_0x1e4bcd[_0x045e('0x2d')],_0x1e4bcd['query']);_0x19a2f6[_0x045e('0x31')]=_[_0x045e('0x30')](_0x1e4bcd['model'],qs['fields'](_0x26527c[_0x045e('0x2e')][_0x045e('0x32')]));_0x19a2f6[_0x045e('0x31')]=_0x19a2f6[_0x045e('0x31')][_0x045e('0x33')]?_0x19a2f6[_0x045e('0x31')]:_0x1e4bcd[_0x045e('0x2d')];if(!_0x26527c[_0x045e('0x2e')][_0x045e('0x34')](_0x045e('0x35'))){_0x19a2f6[_0x045e('0x1d')]=qs[_0x045e('0x1d')](_0x26527c[_0x045e('0x2e')]['limit']);_0x19a2f6['offset']=qs[_0x045e('0x1b')](_0x26527c[_0x045e('0x2e')][_0x045e('0x1b')]);}_0x19a2f6[_0x045e('0x36')]=qs['sort'](_0x26527c[_0x045e('0x2e')]['sort']);_0x19a2f6[_0x045e('0x37')]=qs[_0x045e('0x38')](_[_0x045e('0x39')](_0x26527c['query'],_0x1e4bcd[_0x045e('0x38')]),_0x2d59b8);if(_0x26527c[_0x045e('0x2e')]['filter']){_0x19a2f6[_0x045e('0x37')]=_['merge'](_0x19a2f6[_0x045e('0x37')],{'$or':_['map'](_0x2d59b8,function(_0x34cbf3){if(_0x34cbf3['type']!==_0x045e('0x3a')){var _0xaec887={};_0xaec887[_0x34cbf3[_0x045e('0x28')]]={'$like':'%'+_0x26527c[_0x045e('0x2e')][_0x045e('0x3b')]+'%'};return _0xaec887;}})});}_0x19a2f6=_['merge']({},_0x19a2f6,_0x26527c[_0x045e('0x3c')]);var _0x129a4f={'where':_0x19a2f6[_0x045e('0x37')]};return db[_0x045e('0x3d')][_0x045e('0x1e')](_0x129a4f)[_0x045e('0x25')](function(_0x1e8172){_0x58e2ad[_0x045e('0x1e')]=_0x1e8172;if(_0x26527c[_0x045e('0x2e')]['includeAll']){_0x19a2f6[_0x045e('0x3e')]=[{'all':!![]}];}return db[_0x045e('0x3d')]['findAll'](_0x19a2f6);})[_0x045e('0x25')](function(_0x19b4e0){_0x58e2ad[_0x045e('0x3f')]=_0x19b4e0;return _0x58e2ad;})[_0x045e('0x25')](respondWithFilteredResult(_0x1df786,_0x19a2f6))[_0x045e('0x40')](handleError(_0x1df786,null));};exports['show']=function(_0x34cc6f,_0x4e2a8e){var _0x2169f5={'raw':![],'where':{'id':_0x34cc6f[_0x045e('0x41')]['id']}},_0xdfdb62={};_0xdfdb62[_0x045e('0x2d')]=_[_0x045e('0x2f')](db[_0x045e('0x3d')]['rawAttributes']);_0xdfdb62['query']=_[_0x045e('0x2f')](_0x34cc6f[_0x045e('0x2e')]);_0xdfdb62[_0x045e('0x38')]=_[_0x045e('0x30')](_0xdfdb62[_0x045e('0x2d')],_0xdfdb62[_0x045e('0x2e')]);_0x2169f5[_0x045e('0x31')]=_[_0x045e('0x30')](_0xdfdb62[_0x045e('0x2d')],qs[_0x045e('0x32')](_0x34cc6f[_0x045e('0x2e')][_0x045e('0x32')]));_0x2169f5[_0x045e('0x31')]=_0x2169f5[_0x045e('0x31')][_0x045e('0x33')]?_0x2169f5['attributes']:_0xdfdb62[_0x045e('0x2d')];if(_0x34cc6f[_0x045e('0x2e')][_0x045e('0x42')]){_0x2169f5[_0x045e('0x3e')]=[{'all':!![]}];}_0x2169f5=_[_0x045e('0x43')]({},_0x2169f5,_0x34cc6f[_0x045e('0x3c')]);return db[_0x045e('0x3d')][_0x045e('0x44')](_0x2169f5)[_0x045e('0x25')](handleEntityNotFound(_0x4e2a8e,null))['then'](respondWithResult(_0x4e2a8e,null))[_0x045e('0x40')](handleError(_0x4e2a8e,null));};exports[_0x045e('0x45')]=function(_0x17da22,_0xb62582){return db['SalesforceAccount'][_0x045e('0x45')](_0x17da22[_0x045e('0x46')],{})[_0x045e('0x25')](respondWithResult(_0xb62582,0xc9))[_0x045e('0x40')](handleError(_0xb62582,null));};exports[_0x045e('0x24')]=function(_0x44ce0f,_0xe8cb10){if(_0x44ce0f['body']['id']){delete _0x44ce0f['body']['id'];}return db['SalesforceAccount'][_0x045e('0x44')]({'where':{'id':_0x44ce0f['params']['id']}})[_0x045e('0x25')](handleEntityNotFound(_0xe8cb10,null))[_0x045e('0x25')](saveUpdates(_0x44ce0f[_0x045e('0x46')],null))[_0x045e('0x25')](respondWithResult(_0xe8cb10,null))['catch'](handleError(_0xe8cb10,null));};exports[_0x045e('0x47')]=function(_0x5719c5,_0x1ff8bc){return db['SalesforceAccount']['find']({'where':{'id':_0x5719c5['params']['id']}})[_0x045e('0x25')](handleEntityNotFound(_0x1ff8bc,null))[_0x045e('0x25')](removeEntity(_0x1ff8bc,null))[_0x045e('0x40')](handleError(_0x1ff8bc,null));};exports[_0x045e('0x48')]=function(_0x2faed3,_0x459aa1,_0x1beaaa){var _0x1fd9a1={};var _0x386abf={};var _0x2fa9f1;var _0x2c3941;return db[_0x045e('0x3d')][_0x045e('0x49')]({'where':{'id':_0x2faed3[_0x045e('0x41')]['id']}})['then'](handleEntityNotFound(_0x459aa1,null))[_0x045e('0x25')](function(_0xc75a98){if(_0xc75a98){_0x2fa9f1=_0xc75a98;_0x386abf[_0x045e('0x2d')]=_[_0x045e('0x2f')](db[_0x045e('0x4a')][_0x045e('0x4b')]);_0x386abf[_0x045e('0x2e')]=_[_0x045e('0x2f')](_0x2faed3[_0x045e('0x2e')]);_0x386abf[_0x045e('0x38')]=_[_0x045e('0x30')](_0x386abf[_0x045e('0x2d')],_0x386abf['query']);_0x1fd9a1['attributes']=_[_0x045e('0x30')](_0x386abf[_0x045e('0x2d')],qs['fields'](_0x2faed3[_0x045e('0x2e')][_0x045e('0x32')]));_0x1fd9a1[_0x045e('0x31')]=_0x1fd9a1['attributes'][_0x045e('0x33')]?_0x1fd9a1[_0x045e('0x31')]:_0x386abf[_0x045e('0x2d')];_0x1fd9a1['order']=qs[_0x045e('0x4c')](_0x2faed3[_0x045e('0x2e')][_0x045e('0x4c')]);_0x1fd9a1[_0x045e('0x37')]=qs[_0x045e('0x38')](_[_0x045e('0x39')](_0x2faed3[_0x045e('0x2e')],_0x386abf[_0x045e('0x38')]));if(_0x2faed3['query']['filter']){_0x1fd9a1[_0x045e('0x37')]=_['merge'](_0x1fd9a1[_0x045e('0x37')],{'$or':_[_0x045e('0x2a')](_0x1fd9a1['attributes'],function(_0x5d7ac7){var _0x2111b0={};_0x2111b0[_0x5d7ac7]={'$like':'%'+_0x2faed3[_0x045e('0x2e')][_0x045e('0x3b')]+'%'};return _0x2111b0;})});}_0x1fd9a1=_[_0x045e('0x43')]({},_0x1fd9a1,_0x2faed3['options']);return _0x2fa9f1[_0x045e('0x48')](_0x1fd9a1);}})[_0x045e('0x25')](function(_0x28a861){if(_0x28a861){_0x2c3941=_0x28a861[_0x045e('0x33')];if(!_0x2faed3[_0x045e('0x2e')][_0x045e('0x34')]('nolimit')){_0x1fd9a1['limit']=qs['limit'](_0x2faed3[_0x045e('0x2e')]['limit']);_0x1fd9a1['offset']=qs[_0x045e('0x1b')](_0x2faed3[_0x045e('0x2e')]['offset']);}return _0x2fa9f1['getConfigurations'](_0x1fd9a1);}})['then'](function(_0x3576b2){if(_0x3576b2){return _0x3576b2?{'count':_0x2c3941,'rows':_0x3576b2}:null;}})[_0x045e('0x25')](respondWithResult(_0x459aa1,null))[_0x045e('0x40')](handleError(_0x459aa1,null));};exports[_0x045e('0x4d')]=function(_0xaa2ade,_0x3514eb,_0x3caf71){if(_0xaa2ade[_0x045e('0x46')]['id']){delete _0xaa2ade[_0x045e('0x46')]['id'];}return db['SalesforceAccount'][_0x045e('0x49')]({'where':{'id':_0xaa2ade[_0x045e('0x41')]['id']}})[_0x045e('0x25')](handleEntityNotFound(_0x3514eb,null))[_0x045e('0x25')](function(_0x5a7279){if(_0x5a7279){_0xaa2ade[_0x045e('0x46')]['AccountId']=_0x5a7279['id'];_0xaa2ade[_0x045e('0x46')][_0x045e('0x4e')]=integrations['getSubjects'](_0xaa2ade[_0x045e('0x46')][_0x045e('0x4f')],_0xaa2ade['body'][_0x045e('0x2b')]);_0xaa2ade[_0x045e('0x46')][_0x045e('0x50')]=integrations['getDescriptions'](_0xaa2ade[_0x045e('0x46')][_0x045e('0x4f')],_0xaa2ade[_0x045e('0x46')][_0x045e('0x2b')]);return db[_0x045e('0x4a')]['create'](_0xaa2ade[_0x045e('0x46')],{'include':[{'model':db[_0x045e('0x51')],'as':_0x045e('0x4e')},{'model':db[_0x045e('0x51')],'as':_0x045e('0x50')}]});}return null;})[_0x045e('0x25')](respondWithResult(_0x3514eb,null))[_0x045e('0x40')](handleError(_0x3514eb,null));};exports[_0x045e('0x52')]=function(_0x35d469,_0x958e51,_0x323353){var _0x435c10;var _0x44314b='';var _0x1b91b0=_0x045e('0x53');return db[_0x045e('0x3d')][_0x045e('0x49')]({'where':{'id':_0x35d469[_0x045e('0x41')]['id']},'attributes':['id',_0x045e('0x54'),_0x045e('0x55'),'clientSecret','username',_0x045e('0x56'),_0x045e('0x57')]})[_0x045e('0x25')](handleEntityNotFound(_0x958e51,null))[_0x045e('0x25')](function(_0x2a6e3f){if(_0x2a6e3f){_0x44314b=_0x2a6e3f[_0x045e('0x54')];var _0x9dfcfa=_0x44314b['slice'](-0x1);if(_0x9dfcfa==='/'){_0x44314b=_0x44314b[_0x045e('0x58')](0x0,_0x44314b[_0x045e('0x59')](_0x9dfcfa));}_0x435c10=new jsforce[(_0x045e('0x5a'))]({'oauth2':{'loginUrl':_0x44314b,'clientId':_0x2a6e3f['clientId'],'clientSecret':_0x2a6e3f[_0x045e('0x5b')]}});return _0x435c10[_0x045e('0x5c')](_0x2a6e3f[_0x045e('0x5d')],_0x2a6e3f[_0x045e('0x56')][_0x045e('0x5e')](_0x2a6e3f[_0x045e('0x57')]));}})['then'](function(_0x5087df){if(_0x5087df){if(!_[_0x045e('0x5f')](_0x35d469['query'][_0x045e('0x60')])){_0x1b91b0=_0x35d469[_0x045e('0x2e')][_0x045e('0x60')];}return _0x435c10[_0x045e('0x61')](_0x1b91b0)[_0x045e('0x62')]();}})[_0x045e('0x25')](function(_0x1375e5){var _0x1366bd=[_0x045e('0x63'),_0x045e('0x64'),_0x045e('0x65'),_0x045e('0x66'),_0x045e('0x67'),_0x045e('0x68')];var _0x20b2aa=[_0x045e('0x69'),_0x045e('0x6a'),_0x045e('0x6b'),'boolean',_0x045e('0x6c'),'textarea','phone'];if(_0x1375e5){_['remove'](_0x1375e5[_0x045e('0x32')],function(_0x59c38a){return _0x1366bd[_0x045e('0x6d')](_0x59c38a['name'])||!_0x20b2aa[_0x045e('0x6d')](_0x59c38a['type']);});return{'count':_0x1375e5[_0x045e('0x32')][_0x045e('0x33')],'rows':_[_0x045e('0x2a')](_0x1375e5[_0x045e('0x32')],function(_0x5810ea){return{'id':_0x5810ea[_0x045e('0x28')],'name':_0x5810ea['label'],'custom':_0x5810ea[_0x045e('0x6e')],'options':_0x5810ea[_0x045e('0x6f')][_0x045e('0x33')]>0x0?_[_0x045e('0x2a')](_0x5810ea[_0x045e('0x6f')],function(_0x1e9311){return{'name':_0x1e9311[_0x045e('0x70')],'value':_0x1e9311['value']};}):_0x5810ea['type']==_0x045e('0x71')?[{'name':'True','value':_0x045e('0x72')},{'name':_0x045e('0x73'),'value':_0x045e('0x74')}]:[]};})};}})[_0x045e('0x25')](respondWithResult(_0x958e51,null))[_0x045e('0x40')](function(_0x2ffdeb){var _0x53380b=_0x35d469[_0x045e('0x2e')][_0x045e('0x75')]?0x1f4:_0x2ffdeb[_0x045e('0x76')]||0x1f4;logger[_0x045e('0x26')](_0x045e('0x77'),_0x045e('0x52'),_0x53380b,JSON[_0x045e('0x78')](_0x2ffdeb));delete _0x2ffdeb['name'];if(_0x53380b===0x191){_0x53380b=0x190;}_0x958e51['status'](_0x53380b)['send'](_0x35d469[_0x045e('0x2e')]['test']?{'message':_0x045e('0x79'),'statusCode':_0x2ffdeb[_0x045e('0x76')]}:_0x2ffdeb);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index ccde032..3ab5841 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 _0x6d5e=['moment','bluebird','request-promise','path','../../config/environment','./intSalesforceAccount.attributes','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','api'];(function(_0x1bb87a,_0x19ba21){var _0xd5df38=function(_0x51561a){while(--_0x51561a){_0x1bb87a['push'](_0x1bb87a['shift']());}};_0xd5df38(++_0x19ba21);}(_0x6d5e,0xf4));var _0xe6d5=function(_0x192237,_0x11f8d6){_0x192237=_0x192237-0x0;var _0x49f33d=_0x6d5e[_0x192237];return _0x49f33d;};'use strict';var _=require(_0xe6d5('0x0'));var util=require(_0xe6d5('0x1'));var logger=require('../../config/logger')(_0xe6d5('0x2'));var moment=require(_0xe6d5('0x3'));var BPromise=require(_0xe6d5('0x4'));var rp=require(_0xe6d5('0x5'));var fs=require('fs');var path=require(_0xe6d5('0x6'));var rimraf=require('rimraf');var config=require(_0xe6d5('0x7'));var attributes=require(_0xe6d5('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xe6d5('0x9')]=function(_0x47c67b,_0xed32d0){return _0x47c67b[_0xe6d5('0xa')](_0xe6d5('0xb'),attributes,{'tableName':_0xe6d5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd3ed=['exports','int_salesforce_accounts','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration'];(function(_0x5ae8f7,_0x330d91){var _0x54c636=function(_0x173188){while(--_0x173188){_0x5ae8f7['push'](_0x5ae8f7['shift']());}};_0x54c636(++_0x330d91);}(_0xd3ed,0xf4));var _0xdd3e=function(_0x1cde8b,_0x17f30f){_0x1cde8b=_0x1cde8b-0x0;var _0x3f87a8=_0xd3ed[_0x1cde8b];return _0x3f87a8;};'use strict';var _=require('lodash');var util=require(_0xdd3e('0x0'));var logger=require(_0xdd3e('0x1'))(_0xdd3e('0x2'));var moment=require(_0xdd3e('0x3'));var BPromise=require(_0xdd3e('0x4'));var rp=require(_0xdd3e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdd3e('0x6'));var config=require('../../config/environment');var attributes=require(_0xdd3e('0x7'));var integrations=require(_0xdd3e('0x8'));module[_0xdd3e('0x9')]=function(_0x502137,_0x258d42){return _0x502137['define']('SalesforceAccount',attributes,{'tableName':_0xdd3e('0xa'),'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 23b3043..68f1dbd 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 _0xb5ba=['raw','ShowSalesforceAccount','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','GetSalesforceAccount','SalesforceAccount','findAll','options','where','attributes','limit','map','include','model','catch'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb5ba,0xe9));var _0xab5b=function(_0x25a0b9,_0x86e28f){_0x25a0b9=_0x25a0b9-0x0;var _0x30b9ab=_0xb5ba[_0x25a0b9];return _0x30b9ab;};'use strict';var _=require(_0xab5b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xab5b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xab5b('0x2'));var db=require(_0xab5b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xab5b('0x4'))(_0xab5b('0x5'));var config=require(_0xab5b('0x6'));var jayson=require(_0xab5b('0x7'));var client=jayson['client'][_0xab5b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x21667d,_0x523332,_0x19afcb){return new BPromise(function(_0x590d2c,_0x4cbc59){return client[_0xab5b('0x9')](_0x21667d,_0x19afcb)[_0xab5b('0xa')](function(_0x29d702){logger[_0xab5b('0xb')](_0xab5b('0xc'),_0x523332,'request\x20sent');logger[_0xab5b('0xd')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x523332,_0xab5b('0xe'),JSON[_0xab5b('0xf')](_0x29d702));if(_0x29d702[_0xab5b('0x10')]){if(_0x29d702[_0xab5b('0x10')][_0xab5b('0x11')]===0x1f4){logger[_0xab5b('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x523332,_0x29d702[_0xab5b('0x10')][_0xab5b('0x12')]);return _0x4cbc59(_0x29d702[_0xab5b('0x10')][_0xab5b('0x12')]);}logger[_0xab5b('0x10')](_0xab5b('0xc'),_0x523332,_0x29d702['error']['message']);return _0x590d2c(_0x29d702['error'][_0xab5b('0x12')]);}else{logger['info'](_0xab5b('0xc'),_0x523332,_0xab5b('0xe'));_0x590d2c(_0x29d702[_0xab5b('0x13')][_0xab5b('0x12')]);}})['catch'](function(_0x5e6f57){logger['error'](_0xab5b('0xc'),_0x523332,_0x5e6f57);_0x4cbc59(_0x5e6f57);});});}exports[_0xab5b('0x14')]=function(_0x570724){var _0x5e8540=this;return new Promise(function(_0x439c7d,_0x1a2204){return db[_0xab5b('0x15')][_0xab5b('0x16')]({'raw':_0x570724[_0xab5b('0x17')]?_0x570724[_0xab5b('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x570724['options']?_0x570724['options'][_0xab5b('0x18')]||null:null,'attributes':_0x570724[_0xab5b('0x17')]?_0x570724[_0xab5b('0x17')][_0xab5b('0x19')]||null:null,'limit':_0x570724[_0xab5b('0x17')]?_0x570724[_0xab5b('0x17')][_0xab5b('0x1a')]||null:null,'include':_0x570724[_0xab5b('0x17')]?_0x570724[_0xab5b('0x17')]['include']?_[_0xab5b('0x1b')](_0x570724[_0xab5b('0x17')][_0xab5b('0x1c')],function(_0xa55773){return{'model':db[_0xa55773[_0xab5b('0x1d')]],'as':_0xa55773['as'],'attributes':_0xa55773[_0xab5b('0x19')],'include':_0xa55773[_0xab5b('0x1c')]?_[_0xab5b('0x1b')](_0xa55773[_0xab5b('0x1c')],function(_0x3f5e67){return{'model':db[_0x3f5e67['model']],'as':_0x3f5e67['as'],'attributes':_0x3f5e67['attributes'],'include':_0x3f5e67[_0xab5b('0x1c')]?_['map'](_0x3f5e67['include'],function(_0x524c82){return{'model':db[_0x524c82[_0xab5b('0x1d')]],'as':_0x524c82['as'],'attributes':_0x524c82[_0xab5b('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x562703){logger[_0xab5b('0xb')]('GetSalesforceAccount',_0x570724);logger[_0xab5b('0xd')](_0xab5b('0x14'),_0x570724,JSON['stringify'](_0x562703));_0x439c7d(_0x562703);})[_0xab5b('0x1e')](function(_0x4b4c89){logger['error']('GetSalesforceAccount',_0x4b4c89[_0xab5b('0x12')],_0x570724);_0x1a2204(_0x5e8540[_0xab5b('0x10')](0x1f4,_0x4b4c89['message']));});});};exports['ShowSalesforceAccount']=function(_0x2f8f9a){var _0xdedb22=this;return new Promise(function(_0x310dff,_0x456543){return db['SalesforceAccount']['find']({'raw':_0x2f8f9a[_0xab5b('0x17')]?_0x2f8f9a['options'][_0xab5b('0x1f')]===undefined?!![]:![]:!![],'where':_0x2f8f9a[_0xab5b('0x17')]?_0x2f8f9a[_0xab5b('0x17')][_0xab5b('0x18')]||null:null,'attributes':_0x2f8f9a[_0xab5b('0x17')]?_0x2f8f9a[_0xab5b('0x17')][_0xab5b('0x19')]||null:null,'include':_0x2f8f9a['options']?_0x2f8f9a[_0xab5b('0x17')]['include']?_[_0xab5b('0x1b')](_0x2f8f9a[_0xab5b('0x17')][_0xab5b('0x1c')],function(_0x40eec3){return{'model':db[_0x40eec3['model']],'as':_0x40eec3['as'],'attributes':_0x40eec3[_0xab5b('0x19')],'include':_0x40eec3[_0xab5b('0x1c')]?_[_0xab5b('0x1b')](_0x40eec3['include'],function(_0x2c6fd8){return{'model':db[_0x2c6fd8[_0xab5b('0x1d')]],'as':_0x2c6fd8['as'],'attributes':_0x2c6fd8[_0xab5b('0x19')],'include':_0x2c6fd8[_0xab5b('0x1c')]?_[_0xab5b('0x1b')](_0x2c6fd8['include'],function(_0x106edf){return{'model':db[_0x106edf['model']],'as':_0x106edf['as'],'attributes':_0x106edf['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x524afa){logger['info'](_0xab5b('0x20'),_0x2f8f9a);logger[_0xab5b('0xd')]('ShowSalesforceAccount',_0x2f8f9a,JSON['stringify'](_0x524afa));_0x310dff(_0x524afa);})['catch'](function(_0xacd779){logger[_0xab5b('0x10')](_0xab5b('0x20'),_0xacd779[_0xab5b('0x12')],_0x2f8f9a);_0x456543(_0xdedb22[_0xab5b('0x10')](0x1f4,_0xacd779[_0xab5b('0x12')]));});});}; \ No newline at end of file +var _0xed19=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetSalesforceAccount','SalesforceAccount','options','raw','where','attributes','limit','include','map','model','debug','stringify','find','ShowSalesforceAccount','lodash','util','bluebird'];(function(_0x3da047,_0x4a932f){var _0x2f5afe=function(_0x208af3){while(--_0x208af3){_0x3da047['push'](_0x3da047['shift']());}};_0x2f5afe(++_0x4a932f);}(_0xed19,0x17e));var _0x9ed1=function(_0x200b29,_0x5aac6f){_0x200b29=_0x200b29-0x0;var _0x470267=_0xed19[_0x200b29];return _0x470267;};'use strict';var _=require(_0x9ed1('0x0'));var util=require(_0x9ed1('0x1'));var moment=require('moment');var BPromise=require(_0x9ed1('0x2'));var rs=require(_0x9ed1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ed1('0x4'))['db'];var utils=require(_0x9ed1('0x5'));var logger=require('../../config/logger')(_0x9ed1('0x6'));var config=require(_0x9ed1('0x7'));var jayson=require(_0x9ed1('0x8'));var client=jayson[_0x9ed1('0x9')][_0x9ed1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7488f6,_0x3a45c3,_0xbadc14){return new BPromise(function(_0x5e205f,_0x2b3aee){return client[_0x9ed1('0xb')](_0x7488f6,_0xbadc14)[_0x9ed1('0xc')](function(_0x337df3){logger[_0x9ed1('0xd')](_0x9ed1('0xe'),_0x3a45c3,_0x9ed1('0xf'));logger['debug'](_0x9ed1('0x10'),_0x3a45c3,_0x9ed1('0xf'),JSON['stringify'](_0x337df3));if(_0x337df3[_0x9ed1('0x11')]){if(_0x337df3[_0x9ed1('0x11')]['code']===0x1f4){logger[_0x9ed1('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x3a45c3,_0x337df3[_0x9ed1('0x11')]['message']);return _0x2b3aee(_0x337df3[_0x9ed1('0x11')][_0x9ed1('0x12')]);}logger[_0x9ed1('0x11')](_0x9ed1('0xe'),_0x3a45c3,_0x337df3[_0x9ed1('0x11')][_0x9ed1('0x12')]);return _0x5e205f(_0x337df3['error']['message']);}else{logger['info'](_0x9ed1('0xe'),_0x3a45c3,_0x9ed1('0xf'));_0x5e205f(_0x337df3[_0x9ed1('0x13')][_0x9ed1('0x12')]);}})[_0x9ed1('0x14')](function(_0x1ec73f){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x3a45c3,_0x1ec73f);_0x2b3aee(_0x1ec73f);});});}exports[_0x9ed1('0x15')]=function(_0x511035){var _0x59fd3f=this;return new Promise(function(_0x1d6d26,_0xc0718e){return db[_0x9ed1('0x16')]['findAll']({'raw':_0x511035[_0x9ed1('0x17')]?_0x511035['options'][_0x9ed1('0x18')]===undefined?!![]:![]:!![],'where':_0x511035[_0x9ed1('0x17')]?_0x511035[_0x9ed1('0x17')][_0x9ed1('0x19')]||null:null,'attributes':_0x511035[_0x9ed1('0x17')]?_0x511035[_0x9ed1('0x17')][_0x9ed1('0x1a')]||null:null,'limit':_0x511035['options']?_0x511035[_0x9ed1('0x17')][_0x9ed1('0x1b')]||null:null,'include':_0x511035[_0x9ed1('0x17')]?_0x511035[_0x9ed1('0x17')][_0x9ed1('0x1c')]?_[_0x9ed1('0x1d')](_0x511035['options']['include'],function(_0x4d96e6){return{'model':db[_0x4d96e6[_0x9ed1('0x1e')]],'as':_0x4d96e6['as'],'attributes':_0x4d96e6[_0x9ed1('0x1a')],'include':_0x4d96e6[_0x9ed1('0x1c')]?_['map'](_0x4d96e6['include'],function(_0x3daf52){return{'model':db[_0x3daf52[_0x9ed1('0x1e')]],'as':_0x3daf52['as'],'attributes':_0x3daf52[_0x9ed1('0x1a')],'include':_0x3daf52[_0x9ed1('0x1c')]?_[_0x9ed1('0x1d')](_0x3daf52[_0x9ed1('0x1c')],function(_0x21293d){return{'model':db[_0x21293d[_0x9ed1('0x1e')]],'as':_0x21293d['as'],'attributes':_0x21293d[_0x9ed1('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9ed1('0xc')](function(_0x1af490){logger[_0x9ed1('0xd')](_0x9ed1('0x15'),_0x511035);logger[_0x9ed1('0x1f')](_0x9ed1('0x15'),_0x511035,JSON[_0x9ed1('0x20')](_0x1af490));_0x1d6d26(_0x1af490);})['catch'](function(_0xbf6e74){logger[_0x9ed1('0x11')]('GetSalesforceAccount',_0xbf6e74[_0x9ed1('0x12')],_0x511035);_0xc0718e(_0x59fd3f[_0x9ed1('0x11')](0x1f4,_0xbf6e74[_0x9ed1('0x12')]));});});};exports['ShowSalesforceAccount']=function(_0x2b7fb3){var _0x586801=this;return new Promise(function(_0x431aa8,_0x38b5a2){return db[_0x9ed1('0x16')][_0x9ed1('0x21')]({'raw':_0x2b7fb3[_0x9ed1('0x17')]?_0x2b7fb3[_0x9ed1('0x17')][_0x9ed1('0x18')]===undefined?!![]:![]:!![],'where':_0x2b7fb3['options']?_0x2b7fb3['options'][_0x9ed1('0x19')]||null:null,'attributes':_0x2b7fb3[_0x9ed1('0x17')]?_0x2b7fb3['options']['attributes']||null:null,'include':_0x2b7fb3[_0x9ed1('0x17')]?_0x2b7fb3[_0x9ed1('0x17')][_0x9ed1('0x1c')]?_['map'](_0x2b7fb3[_0x9ed1('0x17')][_0x9ed1('0x1c')],function(_0x5d45ce){return{'model':db[_0x5d45ce[_0x9ed1('0x1e')]],'as':_0x5d45ce['as'],'attributes':_0x5d45ce['attributes'],'include':_0x5d45ce[_0x9ed1('0x1c')]?_[_0x9ed1('0x1d')](_0x5d45ce[_0x9ed1('0x1c')],function(_0x47b2a9){return{'model':db[_0x47b2a9['model']],'as':_0x47b2a9['as'],'attributes':_0x47b2a9['attributes'],'include':_0x47b2a9['include']?_[_0x9ed1('0x1d')](_0x47b2a9['include'],function(_0x319cbf){return{'model':db[_0x319cbf[_0x9ed1('0x1e')]],'as':_0x319cbf['as'],'attributes':_0x319cbf[_0x9ed1('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ec813){logger[_0x9ed1('0xd')](_0x9ed1('0x22'),_0x2b7fb3);logger['debug']('ShowSalesforceAccount',_0x2b7fb3,JSON[_0x9ed1('0x20')](_0x1ec813));_0x431aa8(_0x1ec813);})[_0x9ed1('0x14')](function(_0x597ed8){logger['error'](_0x9ed1('0x22'),_0x597ed8[_0x9ed1('0x12')],_0x2b7fb3);_0x38b5a2(_0x586801['error'](0x1f4,_0x597ed8[_0x9ed1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index de07dc0..d187c18 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 _0x7a54=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects'];(function(_0x1f733f,_0x170a2e){var _0x43d608=function(_0x3620e2){while(--_0x3620e2){_0x1f733f['push'](_0x1f733f['shift']());}};_0x43d608(++_0x170a2e);}(_0x7a54,0x106));var _0x47a5=function(_0x420b2a,_0x271d58){_0x420b2a=_0x420b2a-0x0;var _0x40e1cf=_0x7a54[_0x420b2a];return _0x40e1cf;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router; \ No newline at end of file +var _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x58965a,_0x2e71db){var _0x254efc=function(_0xf14fb4){while(--_0xf14fb4){_0x58965a['push'](_0x58965a['shift']());}};_0x254efc(++_0x2e71db);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2a99ea,_0x1bfb13){_0x2a99ea=_0x2a99ea-0x0;var _0x5887ae=_0x0b0e[_0x2a99ea];return _0x5887ae;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index b0f5c74..5663b52 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 _0xbd10=['account_contact_lead','account','nothing','lead','sequelize','exports','STRING','ENUM','Task','Case','contact_lead','contact'];(function(_0x31bab3,_0x44554f){var _0x4fd382=function(_0x42b336){while(--_0x42b336){_0x31bab3['push'](_0x31bab3['shift']());}};_0x4fd382(++_0x44554f);}(_0xbd10,0x148));var _0x0bd1=function(_0x40fff0,_0x5d1bc7){_0x40fff0=_0x40fff0-0x0;var _0x3625f4=_0xbd10[_0x40fff0];return _0x3625f4;};'use strict';var Sequelize=require(_0x0bd1('0x0'));module[_0x0bd1('0x1')]={'name':{'type':Sequelize[_0x0bd1('0x2')]},'description':{'type':Sequelize[_0x0bd1('0x2')]},'ticketType':{'type':Sequelize[_0x0bd1('0x3')](_0x0bd1('0x4'),_0x0bd1('0x5')),'defaultValue':_0x0bd1('0x4')},'moduleSearch':{'type':Sequelize[_0x0bd1('0x3')](_0x0bd1('0x6'),_0x0bd1('0x7'),'lead',_0x0bd1('0x8'),_0x0bd1('0x9')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x0bd1('0x3')](_0x0bd1('0xa'),_0x0bd1('0x7'),'lead',_0x0bd1('0x9')),'defaultValue':_0x0bd1('0xb')},'leadId':{'type':Sequelize[_0x0bd1('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x0bd1('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x0bd1('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8481=['contact_lead','lead','nothing','contact','account','sequelize','STRING','ENUM','Task','Case'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x8481,0x1c7));var _0x1848=function(_0x4099ee,_0x38495a){_0x4099ee=_0x4099ee-0x0;var _0x1b7bfc=_0x8481[_0x4099ee];return _0x1b7bfc;};'use strict';var Sequelize=require(_0x1848('0x0'));module['exports']={'name':{'type':Sequelize[_0x1848('0x1')]},'description':{'type':Sequelize[_0x1848('0x1')]},'ticketType':{'type':Sequelize[_0x1848('0x2')](_0x1848('0x3'),_0x1848('0x4')),'defaultValue':_0x1848('0x3')},'moduleSearch':{'type':Sequelize[_0x1848('0x2')](_0x1848('0x5'),'contact',_0x1848('0x6'),'account_contact_lead','account'),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize['ENUM'](_0x1848('0x7'),_0x1848('0x8'),_0x1848('0x6'),_0x1848('0x9')),'defaultValue':_0x1848('0x6')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x1848('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x1848('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x1848('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index fa2f456..bbcce88 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 _0x3ec3=['params','includeAll','find','create','body','getFields','findOne','length','nolimit','getSubjects','getDescriptions','SalesforceField','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','key','model','query','keys','intersection','attributes','fields','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch'];(function(_0x25f7ca,_0x1d28e1){var _0x55b431=function(_0x3f2609){while(--_0x3f2609){_0x25f7ca['push'](_0x25f7ca['shift']());}};_0x55b431(++_0x1d28e1);}(_0x3ec3,0x148));var _0x33ec=function(_0x52ec51,_0x2f1bb7){_0x52ec51=_0x52ec51-0x0;var _0x386802=_0x3ec3[_0x52ec51];return _0x386802;};'use strict';var emlformat=require(_0x33ec('0x0'));var rimraf=require(_0x33ec('0x1'));var zipdir=require(_0x33ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x33ec('0x3'));var moment=require('moment');var BPromise=require(_0x33ec('0x4'));var Mustache=require(_0x33ec('0x5'));var util=require(_0x33ec('0x6'));var path=require(_0x33ec('0x7'));var sox=require(_0x33ec('0x8'));var csv=require(_0x33ec('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x33ec('0xa'));var _=require(_0x33ec('0xb'));var squel=require(_0x33ec('0xc'));var crypto=require(_0x33ec('0xd'));var jsforce=require(_0x33ec('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x33ec('0xf'));var Papa=require('papaparse');var Redis=require(_0x33ec('0x10'));var authService=require(_0x33ec('0x11'));var qs=require(_0x33ec('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x33ec('0x13'));var logger=require(_0x33ec('0x14'))(_0x33ec('0x15'));var utils=require(_0x33ec('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x33ec('0x17'));var db=require(_0x33ec('0x18'))['db'];function respondWithStatusCode(_0x43adc8,_0xf21113){_0xf21113=_0xf21113||0xcc;return function(_0x1f5e91){if(_0x1f5e91){return _0x43adc8[_0x33ec('0x19')](_0xf21113);}return _0x43adc8[_0x33ec('0x1a')](_0xf21113)['end']();};}function respondWithResult(_0x2bd38a,_0x24236e){_0x24236e=_0x24236e||0xc8;return function(_0x3e05c6){if(_0x3e05c6){return _0x2bd38a[_0x33ec('0x1a')](_0x24236e)[_0x33ec('0x1b')](_0x3e05c6);}};}function respondWithFilteredResult(_0x297949,_0x5423a2){return function(_0x54164f){if(_0x54164f){var _0x491b7e=typeof _0x5423a2[_0x33ec('0x1c')]===_0x33ec('0x1d')&&typeof _0x5423a2['limit']===_0x33ec('0x1d');var _0x1e6727=_0x54164f[_0x33ec('0x1e')];var _0x49da31=_0x491b7e?0x0:_0x5423a2[_0x33ec('0x1c')];var _0x3f240a=_0x491b7e?_0x54164f[_0x33ec('0x1e')]:_0x5423a2['offset']+_0x5423a2['limit'];var _0x2ba932;if(_0x3f240a>=_0x1e6727){_0x3f240a=_0x1e6727;_0x2ba932=0xc8;}else{_0x2ba932=0xce;}_0x297949['status'](_0x2ba932);return _0x297949['set'](_0x33ec('0x1f'),_0x49da31+'-'+_0x3f240a+'/'+_0x1e6727)[_0x33ec('0x1b')](_0x54164f);}return null;};}function patchUpdates(_0x55359a){return function(_0x281f5a){try{jsonpatch['apply'](_0x281f5a,_0x55359a,!![]);}catch(_0x51b82d){return BPromise[_0x33ec('0x20')](_0x51b82d);}return _0x281f5a[_0x33ec('0x21')]();};}function saveUpdates(_0x1340f6,_0x34a5d6){return function(_0x22f887){if(_0x22f887){return _0x22f887[_0x33ec('0x22')](_0x1340f6)[_0x33ec('0x23')](function(_0x2e4b6c){return _0x2e4b6c;});}return null;};}function removeEntity(_0x1692d2,_0x23ba33){return function(_0x1be733){if(_0x1be733){return _0x1be733[_0x33ec('0x24')]()['then'](function(){_0x1692d2[_0x33ec('0x1a')](0xcc)[_0x33ec('0x25')]();});}};}function handleEntityNotFound(_0x2ef8d8,_0x51e05a){return function(_0x2a0457){if(!_0x2a0457){_0x2ef8d8['sendStatus'](0x194);}return _0x2a0457;};}function handleError(_0x5c1a50,_0x48ff7c){_0x48ff7c=_0x48ff7c||0x1f4;return function(_0x5a0b72){logger[_0x33ec('0x26')](_0x5a0b72[_0x33ec('0x27')]);if(_0x5a0b72[_0x33ec('0x28')]){delete _0x5a0b72[_0x33ec('0x28')];}_0x5c1a50[_0x33ec('0x1a')](_0x48ff7c)[_0x33ec('0x29')](_0x5a0b72);};}exports[_0x33ec('0x2a')]=function(_0x149583,_0x107e72){var _0x66f9ac={},_0x4dff2a={},_0xa3ca6a={'count':0x0,'rows':[]};var _0x519def=_[_0x33ec('0x2b')](db[_0x33ec('0x2c')][_0x33ec('0x2d')],function(_0xf1d8a9){return{'name':_0xf1d8a9['fieldName'],'type':_0xf1d8a9['type'][_0x33ec('0x2e')]};});_0x4dff2a[_0x33ec('0x2f')]=_[_0x33ec('0x2b')](_0x519def,'name');_0x4dff2a[_0x33ec('0x30')]=_[_0x33ec('0x31')](_0x149583['query']);_0x4dff2a['filters']=_[_0x33ec('0x32')](_0x4dff2a[_0x33ec('0x2f')],_0x4dff2a[_0x33ec('0x30')]);_0x66f9ac[_0x33ec('0x33')]=_[_0x33ec('0x32')](_0x4dff2a[_0x33ec('0x2f')],qs[_0x33ec('0x34')](_0x149583[_0x33ec('0x30')][_0x33ec('0x34')]));_0x66f9ac[_0x33ec('0x33')]=_0x66f9ac[_0x33ec('0x33')]['length']?_0x66f9ac['attributes']:_0x4dff2a[_0x33ec('0x2f')];if(!_0x149583[_0x33ec('0x30')]['hasOwnProperty']('nolimit')){_0x66f9ac[_0x33ec('0x35')]=qs[_0x33ec('0x35')](_0x149583[_0x33ec('0x30')][_0x33ec('0x35')]);_0x66f9ac[_0x33ec('0x1c')]=qs['offset'](_0x149583[_0x33ec('0x30')][_0x33ec('0x1c')]);}_0x66f9ac[_0x33ec('0x36')]=qs[_0x33ec('0x37')](_0x149583[_0x33ec('0x30')][_0x33ec('0x37')]);_0x66f9ac[_0x33ec('0x38')]=qs[_0x33ec('0x39')](_[_0x33ec('0x3a')](_0x149583[_0x33ec('0x30')],_0x4dff2a[_0x33ec('0x39')]),_0x519def);if(_0x149583[_0x33ec('0x30')][_0x33ec('0x3b')]){_0x66f9ac[_0x33ec('0x38')]=_[_0x33ec('0x3c')](_0x66f9ac[_0x33ec('0x38')],{'$or':_['map'](_0x519def,function(_0x37ad59){if(_0x37ad59['type']!==_0x33ec('0x3d')){var _0xe732b6={};_0xe732b6[_0x37ad59[_0x33ec('0x28')]]={'$like':'%'+_0x149583[_0x33ec('0x30')][_0x33ec('0x3b')]+'%'};return _0xe732b6;}})});}_0x66f9ac=_['merge']({},_0x66f9ac,_0x149583[_0x33ec('0x3e')]);var _0x1a72a0={'where':_0x66f9ac[_0x33ec('0x38')]};return db['SalesforceConfiguration'][_0x33ec('0x1e')](_0x1a72a0)[_0x33ec('0x23')](function(_0x9f0814){_0xa3ca6a[_0x33ec('0x1e')]=_0x9f0814;if(_0x149583[_0x33ec('0x30')]['includeAll']){_0x66f9ac[_0x33ec('0x3f')]=[{'all':!![]}];}return db[_0x33ec('0x2c')][_0x33ec('0x40')](_0x66f9ac);})[_0x33ec('0x23')](function(_0x53ffa2){_0xa3ca6a[_0x33ec('0x41')]=_0x53ffa2;return _0xa3ca6a;})['then'](respondWithFilteredResult(_0x107e72,_0x66f9ac))[_0x33ec('0x42')](handleError(_0x107e72,null));};exports['show']=function(_0x511063,_0x59876a){var _0x2ac057={'raw':![],'where':{'id':_0x511063[_0x33ec('0x43')]['id']}},_0x3fe893={};_0x3fe893[_0x33ec('0x2f')]=_['keys'](db[_0x33ec('0x2c')][_0x33ec('0x2d')]);_0x3fe893[_0x33ec('0x30')]=_[_0x33ec('0x31')](_0x511063[_0x33ec('0x30')]);_0x3fe893[_0x33ec('0x39')]=_[_0x33ec('0x32')](_0x3fe893[_0x33ec('0x2f')],_0x3fe893[_0x33ec('0x30')]);_0x2ac057['attributes']=_[_0x33ec('0x32')](_0x3fe893[_0x33ec('0x2f')],qs[_0x33ec('0x34')](_0x511063[_0x33ec('0x30')][_0x33ec('0x34')]));_0x2ac057[_0x33ec('0x33')]=_0x2ac057[_0x33ec('0x33')]['length']?_0x2ac057[_0x33ec('0x33')]:_0x3fe893[_0x33ec('0x2f')];if(_0x511063['query'][_0x33ec('0x44')]){_0x2ac057[_0x33ec('0x3f')]=[{'all':!![]}];}_0x2ac057=_[_0x33ec('0x3c')]({},_0x2ac057,_0x511063['options']);return db[_0x33ec('0x2c')][_0x33ec('0x45')](_0x2ac057)[_0x33ec('0x23')](handleEntityNotFound(_0x59876a,null))[_0x33ec('0x23')](respondWithResult(_0x59876a,null))[_0x33ec('0x42')](handleError(_0x59876a,null));};exports['create']=function(_0x375e81,_0x5d22fe){return db[_0x33ec('0x2c')][_0x33ec('0x46')](_0x375e81[_0x33ec('0x47')],{})[_0x33ec('0x23')](respondWithResult(_0x5d22fe,0xc9))['catch'](handleError(_0x5d22fe,null));};exports[_0x33ec('0x22')]=function(_0x4b8f6e,_0x407a16){if(_0x4b8f6e[_0x33ec('0x47')]['id']){delete _0x4b8f6e[_0x33ec('0x47')]['id'];}return db[_0x33ec('0x2c')]['find']({'where':{'id':_0x4b8f6e[_0x33ec('0x43')]['id']}})[_0x33ec('0x23')](handleEntityNotFound(_0x407a16,null))['then'](saveUpdates(_0x4b8f6e[_0x33ec('0x47')],null))[_0x33ec('0x23')](respondWithResult(_0x407a16,null))[_0x33ec('0x42')](handleError(_0x407a16,null));};exports['destroy']=function(_0x4c63b2,_0x489253){return db[_0x33ec('0x2c')]['find']({'where':{'id':_0x4c63b2['params']['id']}})[_0x33ec('0x23')](handleEntityNotFound(_0x489253,null))[_0x33ec('0x23')](removeEntity(_0x489253,null))[_0x33ec('0x42')](handleError(_0x489253,null));};exports[_0x33ec('0x48')]=function(_0x1f6383,_0x90c5fd,_0x2d988c){var _0x21502a={};var _0x436258={};var _0x50bf75;var _0x15675f;return db['SalesforceConfiguration'][_0x33ec('0x49')]({'where':{'id':_0x1f6383['params']['id']}})[_0x33ec('0x23')](handleEntityNotFound(_0x90c5fd,null))['then'](function(_0x29404b){if(_0x29404b){_0x50bf75=_0x29404b;_0x436258[_0x33ec('0x2f')]=_[_0x33ec('0x31')](db['SalesforceField'][_0x33ec('0x2d')]);_0x436258[_0x33ec('0x30')]=_[_0x33ec('0x31')](_0x1f6383[_0x33ec('0x30')]);_0x436258['filters']=_[_0x33ec('0x32')](_0x436258[_0x33ec('0x2f')],_0x436258[_0x33ec('0x30')]);_0x21502a['attributes']=_[_0x33ec('0x32')](_0x436258[_0x33ec('0x2f')],qs[_0x33ec('0x34')](_0x1f6383[_0x33ec('0x30')][_0x33ec('0x34')]));_0x21502a[_0x33ec('0x33')]=_0x21502a[_0x33ec('0x33')]['length']?_0x21502a[_0x33ec('0x33')]:_0x436258[_0x33ec('0x2f')];_0x21502a[_0x33ec('0x36')]=qs['sort'](_0x1f6383[_0x33ec('0x30')][_0x33ec('0x37')]);_0x21502a['where']=qs[_0x33ec('0x39')](_['pick'](_0x1f6383[_0x33ec('0x30')],_0x436258[_0x33ec('0x39')]));if(_0x1f6383['query'][_0x33ec('0x3b')]){_0x21502a[_0x33ec('0x38')]=_[_0x33ec('0x3c')](_0x21502a[_0x33ec('0x38')],{'$or':_[_0x33ec('0x2b')](_0x21502a[_0x33ec('0x33')],function(_0xdee0b1){var _0x39c656={};_0x39c656[_0xdee0b1]={'$like':'%'+_0x1f6383[_0x33ec('0x30')][_0x33ec('0x3b')]+'%'};return _0x39c656;})});}_0x21502a=_['merge']({},_0x21502a,_0x1f6383[_0x33ec('0x3e')]);return _0x50bf75[_0x33ec('0x48')](_0x21502a);}})[_0x33ec('0x23')](function(_0x27ed8c){if(_0x27ed8c){_0x15675f=_0x27ed8c[_0x33ec('0x4a')];if(!_0x1f6383['query']['hasOwnProperty'](_0x33ec('0x4b'))){_0x21502a[_0x33ec('0x35')]=qs[_0x33ec('0x35')](_0x1f6383[_0x33ec('0x30')][_0x33ec('0x35')]);_0x21502a[_0x33ec('0x1c')]=qs[_0x33ec('0x1c')](_0x1f6383[_0x33ec('0x30')]['offset']);}return _0x50bf75[_0x33ec('0x48')](_0x21502a);}})[_0x33ec('0x23')](function(_0x270f64){if(_0x270f64){return _0x270f64?{'count':_0x15675f,'rows':_0x270f64}:null;}})[_0x33ec('0x23')](respondWithResult(_0x90c5fd,null))[_0x33ec('0x42')](handleError(_0x90c5fd,null));};exports[_0x33ec('0x4c')]=function(_0x6f11c,_0x59fcf8,_0x333215){var _0x283730={};var _0x220b67={};var _0x2ffcdf;var _0x91d0e4;return db[_0x33ec('0x2c')][_0x33ec('0x49')]({'where':{'id':_0x6f11c[_0x33ec('0x43')]['id']}})[_0x33ec('0x23')](handleEntityNotFound(_0x59fcf8,null))['then'](function(_0x189e9f){if(_0x189e9f){_0x2ffcdf=_0x189e9f;_0x220b67[_0x33ec('0x2f')]=_[_0x33ec('0x31')](db['SalesforceField'][_0x33ec('0x2d')]);_0x220b67[_0x33ec('0x30')]=_['keys'](_0x6f11c[_0x33ec('0x30')]);_0x220b67['filters']=_[_0x33ec('0x32')](_0x220b67[_0x33ec('0x2f')],_0x220b67[_0x33ec('0x30')]);_0x283730['attributes']=_[_0x33ec('0x32')](_0x220b67[_0x33ec('0x2f')],qs[_0x33ec('0x34')](_0x6f11c['query'][_0x33ec('0x34')]));_0x283730['attributes']=_0x283730[_0x33ec('0x33')][_0x33ec('0x4a')]?_0x283730[_0x33ec('0x33')]:_0x220b67[_0x33ec('0x2f')];_0x283730['order']=qs[_0x33ec('0x37')](_0x6f11c['query'][_0x33ec('0x37')]);_0x283730[_0x33ec('0x38')]=qs[_0x33ec('0x39')](_[_0x33ec('0x3a')](_0x6f11c['query'],_0x220b67[_0x33ec('0x39')]));if(_0x6f11c[_0x33ec('0x30')][_0x33ec('0x3b')]){_0x283730[_0x33ec('0x38')]=_[_0x33ec('0x3c')](_0x283730[_0x33ec('0x38')],{'$or':_[_0x33ec('0x2b')](_0x283730[_0x33ec('0x33')],function(_0xd1e8d1){var _0x3cb548={};_0x3cb548[_0xd1e8d1]={'$like':'%'+_0x6f11c[_0x33ec('0x30')][_0x33ec('0x3b')]+'%'};return _0x3cb548;})});}_0x283730=_[_0x33ec('0x3c')]({},_0x283730,_0x6f11c['options']);return _0x2ffcdf['getSubjects'](_0x283730);}})[_0x33ec('0x23')](function(_0x5c6f00){if(_0x5c6f00){_0x91d0e4=_0x5c6f00[_0x33ec('0x4a')];if(!_0x6f11c[_0x33ec('0x30')]['hasOwnProperty'](_0x33ec('0x4b'))){_0x283730[_0x33ec('0x35')]=qs[_0x33ec('0x35')](_0x6f11c[_0x33ec('0x30')][_0x33ec('0x35')]);_0x283730[_0x33ec('0x1c')]=qs[_0x33ec('0x1c')](_0x6f11c[_0x33ec('0x30')][_0x33ec('0x1c')]);}return _0x2ffcdf[_0x33ec('0x4c')](_0x283730);}})[_0x33ec('0x23')](function(_0x680c15){if(_0x680c15){return _0x680c15?{'count':_0x91d0e4,'rows':_0x680c15}:null;}})['then'](respondWithResult(_0x59fcf8,null))['catch'](handleError(_0x59fcf8,null));};exports[_0x33ec('0x4d')]=function(_0x2bb200,_0x37a21a,_0x5e8c19){var _0x9fc5eb={};var _0x3cbe6a={};var _0x13c61e;var _0x403537;return db[_0x33ec('0x2c')]['findOne']({'where':{'id':_0x2bb200[_0x33ec('0x43')]['id']}})[_0x33ec('0x23')](handleEntityNotFound(_0x37a21a,null))['then'](function(_0x3c344f){if(_0x3c344f){_0x13c61e=_0x3c344f;_0x3cbe6a[_0x33ec('0x2f')]=_['keys'](db[_0x33ec('0x4e')][_0x33ec('0x2d')]);_0x3cbe6a[_0x33ec('0x30')]=_[_0x33ec('0x31')](_0x2bb200[_0x33ec('0x30')]);_0x3cbe6a[_0x33ec('0x39')]=_[_0x33ec('0x32')](_0x3cbe6a['model'],_0x3cbe6a['query']);_0x9fc5eb[_0x33ec('0x33')]=_[_0x33ec('0x32')](_0x3cbe6a[_0x33ec('0x2f')],qs[_0x33ec('0x34')](_0x2bb200[_0x33ec('0x30')][_0x33ec('0x34')]));_0x9fc5eb[_0x33ec('0x33')]=_0x9fc5eb[_0x33ec('0x33')][_0x33ec('0x4a')]?_0x9fc5eb[_0x33ec('0x33')]:_0x3cbe6a[_0x33ec('0x2f')];_0x9fc5eb[_0x33ec('0x36')]=qs[_0x33ec('0x37')](_0x2bb200[_0x33ec('0x30')][_0x33ec('0x37')]);_0x9fc5eb[_0x33ec('0x38')]=qs[_0x33ec('0x39')](_[_0x33ec('0x3a')](_0x2bb200['query'],_0x3cbe6a[_0x33ec('0x39')]));if(_0x2bb200['query'][_0x33ec('0x3b')]){_0x9fc5eb[_0x33ec('0x38')]=_[_0x33ec('0x3c')](_0x9fc5eb['where'],{'$or':_[_0x33ec('0x2b')](_0x9fc5eb[_0x33ec('0x33')],function(_0x17703c){var _0x21053b={};_0x21053b[_0x17703c]={'$like':'%'+_0x2bb200[_0x33ec('0x30')]['filter']+'%'};return _0x21053b;})});}_0x9fc5eb=_[_0x33ec('0x3c')]({},_0x9fc5eb,_0x2bb200[_0x33ec('0x3e')]);return _0x13c61e[_0x33ec('0x4d')](_0x9fc5eb);}})['then'](function(_0x128fb4){if(_0x128fb4){_0x403537=_0x128fb4[_0x33ec('0x4a')];if(!_0x2bb200['query']['hasOwnProperty']('nolimit')){_0x9fc5eb[_0x33ec('0x35')]=qs[_0x33ec('0x35')](_0x2bb200[_0x33ec('0x30')]['limit']);_0x9fc5eb[_0x33ec('0x1c')]=qs[_0x33ec('0x1c')](_0x2bb200[_0x33ec('0x30')]['offset']);}return _0x13c61e[_0x33ec('0x4d')](_0x9fc5eb);}})['then'](function(_0x3700f4){if(_0x3700f4){return _0x3700f4?{'count':_0x403537,'rows':_0x3700f4}:null;}})['then'](respondWithResult(_0x37a21a,null))[_0x33ec('0x42')](handleError(_0x37a21a,null));}; \ No newline at end of file +var _0x11a6=['../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','show','length','catch','create','body','find','getFields','findOne','params','SalesforceField','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x189c9e,_0x1c3b55){var _0x3f38ca=function(_0x4c05ec){while(--_0x4c05ec){_0x189c9e['push'](_0x189c9e['shift']());}};_0x3f38ca(++_0x1c3b55);}(_0x11a6,0x1c7));var _0x611a=function(_0x203b1c,_0xc80d95){_0x203b1c=_0x203b1c-0x0;var _0x33ff02=_0x11a6[_0x203b1c];return _0x33ff02;};'use strict';var emlformat=require(_0x611a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x611a('0x1'));var rp=require(_0x611a('0x2'));var moment=require(_0x611a('0x3'));var BPromise=require(_0x611a('0x4'));var Mustache=require(_0x611a('0x5'));var util=require(_0x611a('0x6'));var path=require(_0x611a('0x7'));var sox=require(_0x611a('0x8'));var csv=require('to-csv');var ejs=require(_0x611a('0x9'));var fs=require('fs');var fs_extra=require(_0x611a('0xa'));var _=require(_0x611a('0xb'));var squel=require(_0x611a('0xc'));var crypto=require('crypto');var jsforce=require(_0x611a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x611a('0xe'));var querystring=require(_0x611a('0xf'));var Papa=require('papaparse');var Redis=require(_0x611a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x611a('0x11'));var as=require(_0x611a('0x12'));var hardwareService=require(_0x611a('0x13'));var logger=require(_0x611a('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x611a('0x15'));var db=require(_0x611a('0x16'))['db'];function respondWithStatusCode(_0x5dc3fb,_0x26f2ca){_0x26f2ca=_0x26f2ca||0xcc;return function(_0x49baa6){if(_0x49baa6){return _0x5dc3fb[_0x611a('0x17')](_0x26f2ca);}return _0x5dc3fb[_0x611a('0x18')](_0x26f2ca)[_0x611a('0x19')]();};}function respondWithResult(_0x24c27f,_0x597364){_0x597364=_0x597364||0xc8;return function(_0xe262b2){if(_0xe262b2){return _0x24c27f[_0x611a('0x18')](_0x597364)[_0x611a('0x1a')](_0xe262b2);}};}function respondWithFilteredResult(_0x4cd920,_0xd76c08){return function(_0x938ee7){if(_0x938ee7){var _0x5ccca5=typeof _0xd76c08[_0x611a('0x1b')]==='undefined'&&typeof _0xd76c08['limit']==='undefined';var _0x549f81=_0x938ee7['count'];var _0x3d4815=_0x5ccca5?0x0:_0xd76c08[_0x611a('0x1b')];var _0x38622d=_0x5ccca5?_0x938ee7[_0x611a('0x1c')]:_0xd76c08['offset']+_0xd76c08['limit'];var _0x59669c;if(_0x38622d>=_0x549f81){_0x38622d=_0x549f81;_0x59669c=0xc8;}else{_0x59669c=0xce;}_0x4cd920['status'](_0x59669c);return _0x4cd920['set'](_0x611a('0x1d'),_0x3d4815+'-'+_0x38622d+'/'+_0x549f81)['json'](_0x938ee7);}return null;};}function patchUpdates(_0x3c113e){return function(_0x3b368a){try{jsonpatch[_0x611a('0x1e')](_0x3b368a,_0x3c113e,!![]);}catch(_0x187daf){return BPromise[_0x611a('0x1f')](_0x187daf);}return _0x3b368a[_0x611a('0x20')]();};}function saveUpdates(_0x4c4f21,_0x18241f){return function(_0x18c0eb){if(_0x18c0eb){return _0x18c0eb[_0x611a('0x21')](_0x4c4f21)[_0x611a('0x22')](function(_0x57e564){return _0x57e564;});}return null;};}function removeEntity(_0x3120e6,_0x2571fb){return function(_0x114a54){if(_0x114a54){return _0x114a54[_0x611a('0x23')]()[_0x611a('0x22')](function(){_0x3120e6[_0x611a('0x18')](0xcc)[_0x611a('0x19')]();});}};}function handleEntityNotFound(_0x5076c2,_0x191bdc){return function(_0x5b5b91){if(!_0x5b5b91){_0x5076c2[_0x611a('0x17')](0x194);}return _0x5b5b91;};}function handleError(_0xdabfa2,_0x41c45a){_0x41c45a=_0x41c45a||0x1f4;return function(_0x27782b){logger[_0x611a('0x24')](_0x27782b[_0x611a('0x25')]);if(_0x27782b[_0x611a('0x26')]){delete _0x27782b[_0x611a('0x26')];}_0xdabfa2[_0x611a('0x18')](_0x41c45a)[_0x611a('0x27')](_0x27782b);};}exports[_0x611a('0x28')]=function(_0xa77b31,_0x3e0c15){var _0x2cca64={},_0x37f915={},_0x221cac={'count':0x0,'rows':[]};var _0x13aaf3=_[_0x611a('0x29')](db[_0x611a('0x2a')][_0x611a('0x2b')],function(_0x57ac11){return{'name':_0x57ac11['fieldName'],'type':_0x57ac11[_0x611a('0x2c')][_0x611a('0x2d')]};});_0x37f915[_0x611a('0x2e')]=_[_0x611a('0x29')](_0x13aaf3,_0x611a('0x26'));_0x37f915[_0x611a('0x2f')]=_[_0x611a('0x30')](_0xa77b31[_0x611a('0x2f')]);_0x37f915[_0x611a('0x31')]=_['intersection'](_0x37f915[_0x611a('0x2e')],_0x37f915[_0x611a('0x2f')]);_0x2cca64['attributes']=_[_0x611a('0x32')](_0x37f915[_0x611a('0x2e')],qs[_0x611a('0x33')](_0xa77b31['query'][_0x611a('0x33')]));_0x2cca64[_0x611a('0x34')]=_0x2cca64[_0x611a('0x34')]['length']?_0x2cca64[_0x611a('0x34')]:_0x37f915[_0x611a('0x2e')];if(!_0xa77b31[_0x611a('0x2f')][_0x611a('0x35')](_0x611a('0x36'))){_0x2cca64['limit']=qs[_0x611a('0x37')](_0xa77b31[_0x611a('0x2f')][_0x611a('0x37')]);_0x2cca64[_0x611a('0x1b')]=qs['offset'](_0xa77b31['query'][_0x611a('0x1b')]);}_0x2cca64[_0x611a('0x38')]=qs[_0x611a('0x39')](_0xa77b31[_0x611a('0x2f')][_0x611a('0x39')]);_0x2cca64['where']=qs[_0x611a('0x31')](_[_0x611a('0x3a')](_0xa77b31['query'],_0x37f915[_0x611a('0x31')]),_0x13aaf3);if(_0xa77b31[_0x611a('0x2f')][_0x611a('0x3b')]){_0x2cca64[_0x611a('0x3c')]=_[_0x611a('0x3d')](_0x2cca64['where'],{'$or':_[_0x611a('0x29')](_0x13aaf3,function(_0x21e75c){if(_0x21e75c[_0x611a('0x2c')]!==_0x611a('0x3e')){var _0x2c66d4={};_0x2c66d4[_0x21e75c[_0x611a('0x26')]]={'$like':'%'+_0xa77b31['query'][_0x611a('0x3b')]+'%'};return _0x2c66d4;}})});}_0x2cca64=_[_0x611a('0x3d')]({},_0x2cca64,_0xa77b31[_0x611a('0x3f')]);var _0x1dd741={'where':_0x2cca64['where']};return db[_0x611a('0x2a')][_0x611a('0x1c')](_0x1dd741)[_0x611a('0x22')](function(_0xfdebd2){_0x221cac[_0x611a('0x1c')]=_0xfdebd2;if(_0xa77b31[_0x611a('0x2f')][_0x611a('0x40')]){_0x2cca64[_0x611a('0x41')]=[{'all':!![]}];}return db[_0x611a('0x2a')]['findAll'](_0x2cca64);})['then'](function(_0x689b89){_0x221cac[_0x611a('0x42')]=_0x689b89;return _0x221cac;})[_0x611a('0x22')](respondWithFilteredResult(_0x3e0c15,_0x2cca64))['catch'](handleError(_0x3e0c15,null));};exports[_0x611a('0x43')]=function(_0x5e5fca,_0x2ac9cf){var _0x49ed1e={'raw':![],'where':{'id':_0x5e5fca['params']['id']}},_0x1b88d9={};_0x1b88d9[_0x611a('0x2e')]=_[_0x611a('0x30')](db[_0x611a('0x2a')][_0x611a('0x2b')]);_0x1b88d9[_0x611a('0x2f')]=_[_0x611a('0x30')](_0x5e5fca[_0x611a('0x2f')]);_0x1b88d9['filters']=_[_0x611a('0x32')](_0x1b88d9[_0x611a('0x2e')],_0x1b88d9[_0x611a('0x2f')]);_0x49ed1e['attributes']=_[_0x611a('0x32')](_0x1b88d9[_0x611a('0x2e')],qs['fields'](_0x5e5fca['query'][_0x611a('0x33')]));_0x49ed1e[_0x611a('0x34')]=_0x49ed1e[_0x611a('0x34')][_0x611a('0x44')]?_0x49ed1e[_0x611a('0x34')]:_0x1b88d9[_0x611a('0x2e')];if(_0x5e5fca[_0x611a('0x2f')][_0x611a('0x40')]){_0x49ed1e[_0x611a('0x41')]=[{'all':!![]}];}_0x49ed1e=_[_0x611a('0x3d')]({},_0x49ed1e,_0x5e5fca['options']);return db['SalesforceConfiguration']['find'](_0x49ed1e)[_0x611a('0x22')](handleEntityNotFound(_0x2ac9cf,null))[_0x611a('0x22')](respondWithResult(_0x2ac9cf,null))[_0x611a('0x45')](handleError(_0x2ac9cf,null));};exports[_0x611a('0x46')]=function(_0x3473df,_0x365d9e){return db[_0x611a('0x2a')][_0x611a('0x46')](_0x3473df[_0x611a('0x47')],{})[_0x611a('0x22')](respondWithResult(_0x365d9e,0xc9))[_0x611a('0x45')](handleError(_0x365d9e,null));};exports[_0x611a('0x21')]=function(_0x5d30ba,_0x33e646){if(_0x5d30ba['body']['id']){delete _0x5d30ba['body']['id'];}return db[_0x611a('0x2a')]['find']({'where':{'id':_0x5d30ba['params']['id']}})['then'](handleEntityNotFound(_0x33e646,null))['then'](saveUpdates(_0x5d30ba[_0x611a('0x47')],null))[_0x611a('0x22')](respondWithResult(_0x33e646,null))[_0x611a('0x45')](handleError(_0x33e646,null));};exports[_0x611a('0x23')]=function(_0xbed85c,_0x5e8142){return db[_0x611a('0x2a')][_0x611a('0x48')]({'where':{'id':_0xbed85c['params']['id']}})['then'](handleEntityNotFound(_0x5e8142,null))[_0x611a('0x22')](removeEntity(_0x5e8142,null))[_0x611a('0x45')](handleError(_0x5e8142,null));};exports[_0x611a('0x49')]=function(_0xf6514d,_0x107cee,_0x56a1a8){var _0x6947bf={};var _0x291094={};var _0x3a08d5;var _0x32a0bf;return db[_0x611a('0x2a')][_0x611a('0x4a')]({'where':{'id':_0xf6514d[_0x611a('0x4b')]['id']}})[_0x611a('0x22')](handleEntityNotFound(_0x107cee,null))['then'](function(_0x356fbe){if(_0x356fbe){_0x3a08d5=_0x356fbe;_0x291094['model']=_['keys'](db[_0x611a('0x4c')]['rawAttributes']);_0x291094[_0x611a('0x2f')]=_['keys'](_0xf6514d[_0x611a('0x2f')]);_0x291094[_0x611a('0x31')]=_['intersection'](_0x291094[_0x611a('0x2e')],_0x291094[_0x611a('0x2f')]);_0x6947bf[_0x611a('0x34')]=_[_0x611a('0x32')](_0x291094[_0x611a('0x2e')],qs['fields'](_0xf6514d['query'][_0x611a('0x33')]));_0x6947bf[_0x611a('0x34')]=_0x6947bf[_0x611a('0x34')][_0x611a('0x44')]?_0x6947bf['attributes']:_0x291094['model'];_0x6947bf['order']=qs[_0x611a('0x39')](_0xf6514d['query']['sort']);_0x6947bf[_0x611a('0x3c')]=qs[_0x611a('0x31')](_[_0x611a('0x3a')](_0xf6514d[_0x611a('0x2f')],_0x291094[_0x611a('0x31')]));if(_0xf6514d[_0x611a('0x2f')][_0x611a('0x3b')]){_0x6947bf[_0x611a('0x3c')]=_[_0x611a('0x3d')](_0x6947bf[_0x611a('0x3c')],{'$or':_[_0x611a('0x29')](_0x6947bf[_0x611a('0x34')],function(_0x1bb902){var _0xfedc15={};_0xfedc15[_0x1bb902]={'$like':'%'+_0xf6514d[_0x611a('0x2f')]['filter']+'%'};return _0xfedc15;})});}_0x6947bf=_['merge']({},_0x6947bf,_0xf6514d[_0x611a('0x3f')]);return _0x3a08d5['getFields'](_0x6947bf);}})['then'](function(_0x277d53){if(_0x277d53){_0x32a0bf=_0x277d53[_0x611a('0x44')];if(!_0xf6514d[_0x611a('0x2f')]['hasOwnProperty'](_0x611a('0x36'))){_0x6947bf[_0x611a('0x37')]=qs[_0x611a('0x37')](_0xf6514d['query'][_0x611a('0x37')]);_0x6947bf['offset']=qs[_0x611a('0x1b')](_0xf6514d[_0x611a('0x2f')]['offset']);}return _0x3a08d5[_0x611a('0x49')](_0x6947bf);}})[_0x611a('0x22')](function(_0x15a584){if(_0x15a584){return _0x15a584?{'count':_0x32a0bf,'rows':_0x15a584}:null;}})['then'](respondWithResult(_0x107cee,null))[_0x611a('0x45')](handleError(_0x107cee,null));};exports[_0x611a('0x4d')]=function(_0x3e95f3,_0x3a60b6,_0x225c3a){var _0x3f9679={};var _0x58edc9={};var _0xe31665;var _0x592c0d;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x3e95f3[_0x611a('0x4b')]['id']}})[_0x611a('0x22')](handleEntityNotFound(_0x3a60b6,null))['then'](function(_0x162095){if(_0x162095){_0xe31665=_0x162095;_0x58edc9[_0x611a('0x2e')]=_[_0x611a('0x30')](db[_0x611a('0x4c')][_0x611a('0x2b')]);_0x58edc9[_0x611a('0x2f')]=_[_0x611a('0x30')](_0x3e95f3[_0x611a('0x2f')]);_0x58edc9['filters']=_['intersection'](_0x58edc9[_0x611a('0x2e')],_0x58edc9[_0x611a('0x2f')]);_0x3f9679['attributes']=_[_0x611a('0x32')](_0x58edc9[_0x611a('0x2e')],qs[_0x611a('0x33')](_0x3e95f3['query'][_0x611a('0x33')]));_0x3f9679['attributes']=_0x3f9679[_0x611a('0x34')][_0x611a('0x44')]?_0x3f9679[_0x611a('0x34')]:_0x58edc9['model'];_0x3f9679['order']=qs['sort'](_0x3e95f3[_0x611a('0x2f')][_0x611a('0x39')]);_0x3f9679[_0x611a('0x3c')]=qs[_0x611a('0x31')](_[_0x611a('0x3a')](_0x3e95f3[_0x611a('0x2f')],_0x58edc9[_0x611a('0x31')]));if(_0x3e95f3[_0x611a('0x2f')]['filter']){_0x3f9679[_0x611a('0x3c')]=_[_0x611a('0x3d')](_0x3f9679[_0x611a('0x3c')],{'$or':_[_0x611a('0x29')](_0x3f9679['attributes'],function(_0x35e20b){var _0x193665={};_0x193665[_0x35e20b]={'$like':'%'+_0x3e95f3[_0x611a('0x2f')][_0x611a('0x3b')]+'%'};return _0x193665;})});}_0x3f9679=_[_0x611a('0x3d')]({},_0x3f9679,_0x3e95f3[_0x611a('0x3f')]);return _0xe31665[_0x611a('0x4d')](_0x3f9679);}})[_0x611a('0x22')](function(_0x693906){if(_0x693906){_0x592c0d=_0x693906[_0x611a('0x44')];if(!_0x3e95f3[_0x611a('0x2f')][_0x611a('0x35')](_0x611a('0x36'))){_0x3f9679['limit']=qs[_0x611a('0x37')](_0x3e95f3[_0x611a('0x2f')]['limit']);_0x3f9679['offset']=qs[_0x611a('0x1b')](_0x3e95f3[_0x611a('0x2f')][_0x611a('0x1b')]);}return _0xe31665[_0x611a('0x4d')](_0x3f9679);}})[_0x611a('0x22')](function(_0x4b5619){if(_0x4b5619){return _0x4b5619?{'count':_0x592c0d,'rows':_0x4b5619}:null;}})[_0x611a('0x22')](respondWithResult(_0x3a60b6,null))[_0x611a('0x45')](handleError(_0x3a60b6,null));};exports['getDescriptions']=function(_0x2bfb7e,_0x36cbf4,_0x30ea41){var _0x61c35a={};var _0x33b03c={};var _0x5020bb;var _0xab27d1;return db['SalesforceConfiguration'][_0x611a('0x4a')]({'where':{'id':_0x2bfb7e[_0x611a('0x4b')]['id']}})[_0x611a('0x22')](handleEntityNotFound(_0x36cbf4,null))[_0x611a('0x22')](function(_0xb668cc){if(_0xb668cc){_0x5020bb=_0xb668cc;_0x33b03c[_0x611a('0x2e')]=_[_0x611a('0x30')](db[_0x611a('0x4c')][_0x611a('0x2b')]);_0x33b03c[_0x611a('0x2f')]=_[_0x611a('0x30')](_0x2bfb7e[_0x611a('0x2f')]);_0x33b03c[_0x611a('0x31')]=_[_0x611a('0x32')](_0x33b03c['model'],_0x33b03c[_0x611a('0x2f')]);_0x61c35a['attributes']=_[_0x611a('0x32')](_0x33b03c[_0x611a('0x2e')],qs[_0x611a('0x33')](_0x2bfb7e[_0x611a('0x2f')][_0x611a('0x33')]));_0x61c35a['attributes']=_0x61c35a[_0x611a('0x34')]['length']?_0x61c35a[_0x611a('0x34')]:_0x33b03c[_0x611a('0x2e')];_0x61c35a[_0x611a('0x38')]=qs[_0x611a('0x39')](_0x2bfb7e[_0x611a('0x2f')]['sort']);_0x61c35a[_0x611a('0x3c')]=qs[_0x611a('0x31')](_[_0x611a('0x3a')](_0x2bfb7e[_0x611a('0x2f')],_0x33b03c[_0x611a('0x31')]));if(_0x2bfb7e['query'][_0x611a('0x3b')]){_0x61c35a[_0x611a('0x3c')]=_[_0x611a('0x3d')](_0x61c35a[_0x611a('0x3c')],{'$or':_[_0x611a('0x29')](_0x61c35a[_0x611a('0x34')],function(_0x1797be){var _0x54d215={};_0x54d215[_0x1797be]={'$like':'%'+_0x2bfb7e[_0x611a('0x2f')][_0x611a('0x3b')]+'%'};return _0x54d215;})});}_0x61c35a=_[_0x611a('0x3d')]({},_0x61c35a,_0x2bfb7e['options']);return _0x5020bb[_0x611a('0x4e')](_0x61c35a);}})[_0x611a('0x22')](function(_0x4ad863){if(_0x4ad863){_0xab27d1=_0x4ad863[_0x611a('0x44')];if(!_0x2bfb7e[_0x611a('0x2f')][_0x611a('0x35')]('nolimit')){_0x61c35a[_0x611a('0x37')]=qs[_0x611a('0x37')](_0x2bfb7e[_0x611a('0x2f')][_0x611a('0x37')]);_0x61c35a['offset']=qs[_0x611a('0x1b')](_0x2bfb7e['query'][_0x611a('0x1b')]);}return _0x5020bb['getDescriptions'](_0x61c35a);}})[_0x611a('0x22')](function(_0x27a8a6){if(_0x27a8a6){return _0x27a8a6?{'count':_0xab27d1,'rows':_0x27a8a6}:null;}})['then'](respondWithResult(_0x36cbf4,null))[_0x611a('0x45')](handleError(_0x36cbf4,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index d4e3bc6..9b46b25 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 _0x59c5=['define','SalesforceConfiguration','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x59c5,0x178));var _0x559c=function(_0x21b1de,_0x4196bd){_0x21b1de=_0x21b1de-0x0;var _0x1e32b0=_0x59c5[_0x21b1de];return _0x1e32b0;};'use strict';var _=require(_0x559c('0x0'));var util=require('util');var logger=require(_0x559c('0x1'))(_0x559c('0x2'));var moment=require('moment');var BPromise=require(_0x559c('0x3'));var rp=require(_0x559c('0x4'));var fs=require('fs');var path=require(_0x559c('0x5'));var rimraf=require(_0x559c('0x6'));var config=require(_0x559c('0x7'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x559c('0x8')]=function(_0x530a77,_0x2bfb78){return _0x530a77[_0x559c('0x9')](_0x559c('0xa'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x23f1=['bluebird','request-promise','rimraf','../../config/environment','exports','SalesforceConfiguration','lodash','util','../../config/logger','api','moment'];(function(_0x5d00cb,_0xded7c9){var _0xb3815f=function(_0x14f9b6){while(--_0x14f9b6){_0x5d00cb['push'](_0x5d00cb['shift']());}};_0xb3815f(++_0xded7c9);}(_0x23f1,0x17c));var _0x123f=function(_0x21beb0,_0x70a429){_0x21beb0=_0x21beb0-0x0;var _0x186750=_0x23f1[_0x21beb0];return _0x186750;};'use strict';var _=require(_0x123f('0x0'));var util=require(_0x123f('0x1'));var logger=require(_0x123f('0x2'))(_0x123f('0x3'));var moment=require(_0x123f('0x4'));var BPromise=require(_0x123f('0x5'));var rp=require(_0x123f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x123f('0x7'));var config=require(_0x123f('0x8'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x123f('0x9')]=function(_0x49a7ef,_0x3eb2bf){return _0x49a7ef['define'](_0x123f('0xa'),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 2fc2557..4653766 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 _0xc058=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','moment'];(function(_0x545d28,_0xac2b42){var _0x301702=function(_0x5b43d0){while(--_0x5b43d0){_0x545d28['push'](_0x545d28['shift']());}};_0x301702(++_0xac2b42);}(_0xc058,0xdb));var _0x8c05=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xc058[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8c05('0x0'));var BPromise=require(_0x8c05('0x1'));var rs=require(_0x8c05('0x2'));var fs=require('fs');var Redis=require(_0x8c05('0x3'));var db=require(_0x8c05('0x4'))['db'];var utils=require(_0x8c05('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x8c05('0x6'));var jayson=require(_0x8c05('0x7'));var client=jayson[_0x8c05('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f069f,_0x593ebd,_0x112afa){return new BPromise(function(_0x10c4ae,_0x5dbe53){return client[_0x8c05('0x9')](_0x2f069f,_0x112afa)[_0x8c05('0xa')](function(_0x210d33){logger[_0x8c05('0xb')](_0x8c05('0xc'),_0x593ebd,'request\x20sent');logger['debug'](_0x8c05('0xd'),_0x593ebd,_0x8c05('0xe'),JSON[_0x8c05('0xf')](_0x210d33));if(_0x210d33['error']){if(_0x210d33['error'][_0x8c05('0x10')]===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x593ebd,_0x210d33[_0x8c05('0x11')][_0x8c05('0x12')]);return _0x5dbe53(_0x210d33['error']['message']);}logger[_0x8c05('0x11')](_0x8c05('0xc'),_0x593ebd,_0x210d33[_0x8c05('0x11')][_0x8c05('0x12')]);return _0x10c4ae(_0x210d33[_0x8c05('0x11')][_0x8c05('0x12')]);}else{logger[_0x8c05('0xb')](_0x8c05('0xc'),_0x593ebd,_0x8c05('0xe'));_0x10c4ae(_0x210d33['result']['message']);}})[_0x8c05('0x13')](function(_0x2ee86e){logger[_0x8c05('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x593ebd,_0x2ee86e);_0x5dbe53(_0x2ee86e);});});} \ No newline at end of file +var _0xa5d5=['../../config/logger','rpc','../../config/environment','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa5d5,0xb8));var _0x5a5d=function(_0x50d18f,_0x37ca49){_0x50d18f=_0x50d18f-0x0;var _0x1578bb=_0xa5d5[_0x50d18f];return _0x1578bb;};'use strict';var _=require(_0x5a5d('0x0'));var util=require(_0x5a5d('0x1'));var moment=require(_0x5a5d('0x2'));var BPromise=require(_0x5a5d('0x3'));var rs=require(_0x5a5d('0x4'));var fs=require('fs');var Redis=require(_0x5a5d('0x5'));var db=require(_0x5a5d('0x6'))['db'];var utils=require(_0x5a5d('0x7'));var logger=require(_0x5a5d('0x8'))(_0x5a5d('0x9'));var config=require(_0x5a5d('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x5a5d('0xb')][_0x5a5d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e5940,_0x447cfb,_0x578f64){return new BPromise(function(_0x71aad9,_0x2f41e6){return client[_0x5a5d('0xd')](_0x3e5940,_0x578f64)['then'](function(_0x3f890c){logger[_0x5a5d('0xe')](_0x5a5d('0xf'),_0x447cfb,_0x5a5d('0x10'));logger[_0x5a5d('0x11')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x447cfb,_0x5a5d('0x10'),JSON[_0x5a5d('0x12')](_0x3f890c));if(_0x3f890c['error']){if(_0x3f890c[_0x5a5d('0x13')][_0x5a5d('0x14')]===0x1f4){logger[_0x5a5d('0x13')](_0x5a5d('0xf'),_0x447cfb,_0x3f890c[_0x5a5d('0x13')][_0x5a5d('0x15')]);return _0x2f41e6(_0x3f890c[_0x5a5d('0x13')][_0x5a5d('0x15')]);}logger[_0x5a5d('0x13')](_0x5a5d('0xf'),_0x447cfb,_0x3f890c[_0x5a5d('0x13')][_0x5a5d('0x15')]);return _0x71aad9(_0x3f890c[_0x5a5d('0x13')][_0x5a5d('0x15')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x447cfb,'request\x20sent');_0x71aad9(_0x3f890c[_0x5a5d('0x16')][_0x5a5d('0x15')]);}})[_0x5a5d('0x17')](function(_0x481633){logger[_0x5a5d('0x13')](_0x5a5d('0xf'),_0x447cfb,_0x481633);_0x2f41e6(_0x481633);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index a3a41fa..4c9b1ab 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 _0x4e2b=['/:id','post','create','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index'];(function(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0x4e2b,0xb2));var _0xb4e2=function(_0x51f806,_0x25aa40){_0x51f806=_0x51f806-0x0;var _0x5cdc9b=_0x4e2b[_0x51f806];return _0x5cdc9b;};'use strict';var multer=require(_0xb4e2('0x0'));var util=require(_0xb4e2('0x1'));var path=require(_0xb4e2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb4e2('0x3')]();var fs_extra=require(_0xb4e2('0x4'));var auth=require(_0xb4e2('0x5'));var interaction=require(_0xb4e2('0x6'));var config=require(_0xb4e2('0x7'));var controller=require(_0xb4e2('0x8'));router[_0xb4e2('0x9')]('/',auth[_0xb4e2('0xa')](),controller[_0xb4e2('0xb')]);router['get'](_0xb4e2('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xb4e2('0xd')]('/',auth[_0xb4e2('0xa')](),controller[_0xb4e2('0xe')]);router['put'](_0xb4e2('0xc'),auth[_0xb4e2('0xa')](),controller[_0xb4e2('0xf')]);router[_0xb4e2('0x10')](_0xb4e2('0xc'),auth['isAuthenticated'](),controller[_0xb4e2('0x11')]);module[_0xb4e2('0x12')]=router; \ No newline at end of file +var _0x5e8f=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','update','destroy'];(function(_0x266af2,_0x45974e){var _0x4f67d6=function(_0x531181){while(--_0x531181){_0x266af2['push'](_0x266af2['shift']());}};_0x4f67d6(++_0x45974e);}(_0x5e8f,0xc9));var _0xf5e8=function(_0x152fe3,_0x12b0c8){_0x152fe3=_0x152fe3-0x0;var _0xc5bb39=_0x5e8f[_0x152fe3];return _0xc5bb39;};'use strict';var multer=require(_0xf5e8('0x0'));var util=require(_0xf5e8('0x1'));var path=require(_0xf5e8('0x2'));var timeout=require(_0xf5e8('0x3'));var express=require(_0xf5e8('0x4'));var router=express[_0xf5e8('0x5')]();var fs_extra=require(_0xf5e8('0x6'));var auth=require(_0xf5e8('0x7'));var interaction=require(_0xf5e8('0x8'));var config=require(_0xf5e8('0x9'));var controller=require(_0xf5e8('0xa'));router[_0xf5e8('0xb')]('/',auth[_0xf5e8('0xc')](),controller[_0xf5e8('0xd')]);router[_0xf5e8('0xb')](_0xf5e8('0xe'),auth[_0xf5e8('0xc')](),controller[_0xf5e8('0xf')]);router[_0xf5e8('0x10')]('/',auth[_0xf5e8('0xc')](),controller['create']);router['put'](_0xf5e8('0xe'),auth['isAuthenticated'](),controller[_0xf5e8('0x11')]);router['delete'](_0xf5e8('0xe'),auth[_0xf5e8('0xc')](),controller[_0xf5e8('0x12')]);module[_0xf5e8('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 3bd84bb..5850511 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 _0x6a02=['exports','ENUM','string','variable','customVariable','keyValue','STRING','sequelize'];(function(_0x2167d6,_0x3fc309){var _0x46dcb9=function(_0x37e1ca){while(--_0x37e1ca){_0x2167d6['push'](_0x2167d6['shift']());}};_0x46dcb9(++_0x3fc309);}(_0x6a02,0xcf));var _0x26a0=function(_0x47e20a,_0x231ec3){_0x47e20a=_0x47e20a-0x0;var _0x96ef84=_0x6a02[_0x47e20a];return _0x96ef84;};'use strict';var Sequelize=require(_0x26a0('0x0'));module[_0x26a0('0x1')]={'type':{'type':Sequelize[_0x26a0('0x2')](_0x26a0('0x3'),_0x26a0('0x4'),_0x26a0('0x5'),_0x26a0('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x26a0('0x7')]},'keyType':{'type':Sequelize[_0x26a0('0x2')](_0x26a0('0x3'),_0x26a0('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x26a0('0x7')]},'variableName':{'type':Sequelize[_0x26a0('0x7')]}}; \ No newline at end of file +var _0x3e6e=['keyValue','picklist','string','STRING','ENUM','exports','variable','customVariable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e6e,0x1e5));var _0xe3e6=function(_0x432085,_0x2de5f9){_0x432085=_0x432085-0x0;var _0x2c4e95=_0x3e6e[_0x432085];return _0x2c4e95;};'use strict';var Sequelize=require('sequelize');module[_0xe3e6('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0xe3e6('0x1'),_0xe3e6('0x2'),_0xe3e6('0x3'),_0xe3e6('0x4')),'defaultValue':_0xe3e6('0x5')},'content':{'type':Sequelize[_0xe3e6('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xe3e6('0x7')]('string',_0xe3e6('0x1'),_0xe3e6('0x2'))},'keyContent':{'type':Sequelize[_0xe3e6('0x6')]},'idField':{'type':Sequelize[_0xe3e6('0x6')]},'variableName':{'type':Sequelize[_0xe3e6('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 14bcf6e..04dac38 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 _0x4d83=['bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','error','stack','name','send','index','SalesforceField','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','create','body','find','params','destroy','eml-format','fast-json-patch','request-promise','moment'];(function(_0x257a28,_0x2cd00d){var _0x13bccc=function(_0x32c46f){while(--_0x32c46f){_0x257a28['push'](_0x257a28['shift']());}};_0x13bccc(++_0x2cd00d);}(_0x4d83,0x173));var _0x34d8=function(_0x3fb07b,_0x2920ca){_0x3fb07b=_0x3fb07b-0x0;var _0x15cdb4=_0x4d83[_0x3fb07b];return _0x15cdb4;};'use strict';var emlformat=require(_0x34d8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x34d8('0x1'));var rp=require(_0x34d8('0x2'));var moment=require(_0x34d8('0x3'));var BPromise=require(_0x34d8('0x4'));var Mustache=require(_0x34d8('0x5'));var util=require('util');var path=require(_0x34d8('0x6'));var sox=require(_0x34d8('0x7'));var csv=require(_0x34d8('0x8'));var ejs=require(_0x34d8('0x9'));var fs=require('fs');var fs_extra=require(_0x34d8('0xa'));var _=require(_0x34d8('0xb'));var squel=require(_0x34d8('0xc'));var crypto=require(_0x34d8('0xd'));var jsforce=require(_0x34d8('0xe'));var deskjs=require(_0x34d8('0xf'));var toCsv=require(_0x34d8('0x8'));var querystring=require(_0x34d8('0x10'));var Papa=require(_0x34d8('0x11'));var Redis=require(_0x34d8('0x12'));var authService=require(_0x34d8('0x13'));var qs=require(_0x34d8('0x14'));var as=require(_0x34d8('0x15'));var hardwareService=require(_0x34d8('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x34d8('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x34d8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a6a96,_0x26a236){_0x26a236=_0x26a236||0xcc;return function(_0x598bf1){if(_0x598bf1){return _0x2a6a96[_0x34d8('0x19')](_0x26a236);}return _0x2a6a96[_0x34d8('0x1a')](_0x26a236)[_0x34d8('0x1b')]();};}function respondWithResult(_0x55d265,_0x15648b){_0x15648b=_0x15648b||0xc8;return function(_0x1c5df3){if(_0x1c5df3){return _0x55d265[_0x34d8('0x1a')](_0x15648b)[_0x34d8('0x1c')](_0x1c5df3);}};}function respondWithFilteredResult(_0x1a4c60,_0x3118ca){return function(_0x2aa696){if(_0x2aa696){var _0x109618=typeof _0x3118ca[_0x34d8('0x1d')]===_0x34d8('0x1e')&&typeof _0x3118ca[_0x34d8('0x1f')]===_0x34d8('0x1e');var _0x46cd5b=_0x2aa696[_0x34d8('0x20')];var _0x590490=_0x109618?0x0:_0x3118ca[_0x34d8('0x1d')];var _0x10420e=_0x109618?_0x2aa696[_0x34d8('0x20')]:_0x3118ca[_0x34d8('0x1d')]+_0x3118ca[_0x34d8('0x1f')];var _0x46ab72;if(_0x10420e>=_0x46cd5b){_0x10420e=_0x46cd5b;_0x46ab72=0xc8;}else{_0x46ab72=0xce;}_0x1a4c60[_0x34d8('0x1a')](_0x46ab72);return _0x1a4c60['set']('Content-Range',_0x590490+'-'+_0x10420e+'/'+_0x46cd5b)['json'](_0x2aa696);}return null;};}function patchUpdates(_0x2eaf19){return function(_0x1a2873){try{jsonpatch[_0x34d8('0x21')](_0x1a2873,_0x2eaf19,!![]);}catch(_0x4b819f){return BPromise[_0x34d8('0x22')](_0x4b819f);}return _0x1a2873['save']();};}function saveUpdates(_0x1cbfe3,_0x3adab3){return function(_0x15890f){if(_0x15890f){return _0x15890f[_0x34d8('0x23')](_0x1cbfe3)[_0x34d8('0x24')](function(_0x1f211e){return _0x1f211e;});}return null;};}function removeEntity(_0x4744dd,_0x3e0d1f){return function(_0xcbd707){if(_0xcbd707){return _0xcbd707['destroy']()[_0x34d8('0x24')](function(){_0x4744dd[_0x34d8('0x1a')](0xcc)[_0x34d8('0x1b')]();});}};}function handleEntityNotFound(_0x2527a2,_0x55d17a){return function(_0x3d1db5){if(!_0x3d1db5){_0x2527a2[_0x34d8('0x19')](0x194);}return _0x3d1db5;};}function handleError(_0x1d0aaf,_0xc24b70){_0xc24b70=_0xc24b70||0x1f4;return function(_0x4b08b2){logger[_0x34d8('0x25')](_0x4b08b2[_0x34d8('0x26')]);if(_0x4b08b2['name']){delete _0x4b08b2[_0x34d8('0x27')];}_0x1d0aaf[_0x34d8('0x1a')](_0xc24b70)[_0x34d8('0x28')](_0x4b08b2);};}exports[_0x34d8('0x29')]=function(_0xb8b8a5,_0x32a0cb){var _0x46578c={},_0xcf63a0={},_0x111269={'count':0x0,'rows':[]};var _0x259eb0=_['map'](db[_0x34d8('0x2a')][_0x34d8('0x2b')],function(_0x4a9f23){return{'name':_0x4a9f23[_0x34d8('0x2c')],'type':_0x4a9f23[_0x34d8('0x2d')][_0x34d8('0x2e')]};});_0xcf63a0[_0x34d8('0x2f')]=_[_0x34d8('0x30')](_0x259eb0,_0x34d8('0x27'));_0xcf63a0['query']=_[_0x34d8('0x31')](_0xb8b8a5[_0x34d8('0x32')]);_0xcf63a0[_0x34d8('0x33')]=_[_0x34d8('0x34')](_0xcf63a0[_0x34d8('0x2f')],_0xcf63a0[_0x34d8('0x32')]);_0x46578c[_0x34d8('0x35')]=_[_0x34d8('0x34')](_0xcf63a0[_0x34d8('0x2f')],qs['fields'](_0xb8b8a5[_0x34d8('0x32')][_0x34d8('0x36')]));_0x46578c[_0x34d8('0x35')]=_0x46578c['attributes'][_0x34d8('0x37')]?_0x46578c[_0x34d8('0x35')]:_0xcf63a0[_0x34d8('0x2f')];if(!_0xb8b8a5['query'][_0x34d8('0x38')](_0x34d8('0x39'))){_0x46578c[_0x34d8('0x1f')]=qs[_0x34d8('0x1f')](_0xb8b8a5['query'][_0x34d8('0x1f')]);_0x46578c['offset']=qs[_0x34d8('0x1d')](_0xb8b8a5[_0x34d8('0x32')][_0x34d8('0x1d')]);}_0x46578c['order']=qs[_0x34d8('0x3a')](_0xb8b8a5[_0x34d8('0x32')][_0x34d8('0x3a')]);_0x46578c[_0x34d8('0x3b')]=qs['filters'](_[_0x34d8('0x3c')](_0xb8b8a5[_0x34d8('0x32')],_0xcf63a0['filters']),_0x259eb0);if(_0xb8b8a5[_0x34d8('0x32')][_0x34d8('0x3d')]){_0x46578c[_0x34d8('0x3b')]=_[_0x34d8('0x3e')](_0x46578c['where'],{'$or':_['map'](_0x259eb0,function(_0x2af825){if(_0x2af825[_0x34d8('0x2d')]!==_0x34d8('0x3f')){var _0x1a2d83={};_0x1a2d83[_0x2af825[_0x34d8('0x27')]]={'$like':'%'+_0xb8b8a5[_0x34d8('0x32')][_0x34d8('0x3d')]+'%'};return _0x1a2d83;}})});}_0x46578c=_[_0x34d8('0x3e')]({},_0x46578c,_0xb8b8a5[_0x34d8('0x40')]);var _0x746ebc={'where':_0x46578c['where']};return db['SalesforceField'][_0x34d8('0x20')](_0x746ebc)['then'](function(_0x1e5984){_0x111269[_0x34d8('0x20')]=_0x1e5984;if(_0xb8b8a5['query'][_0x34d8('0x41')]){_0x46578c[_0x34d8('0x42')]=[{'all':!![]}];}return db[_0x34d8('0x2a')]['findAll'](_0x46578c);})[_0x34d8('0x24')](function(_0x29a353){_0x111269[_0x34d8('0x43')]=_0x29a353;return _0x111269;})[_0x34d8('0x24')](respondWithFilteredResult(_0x32a0cb,_0x46578c))[_0x34d8('0x44')](handleError(_0x32a0cb,null));};exports[_0x34d8('0x45')]=function(_0xbf34ed,_0x10d77e){var _0x21d299={'raw':!![],'where':{'id':_0xbf34ed['params']['id']}},_0x13591b={};_0x13591b[_0x34d8('0x2f')]=_[_0x34d8('0x31')](db[_0x34d8('0x2a')][_0x34d8('0x2b')]);_0x13591b[_0x34d8('0x32')]=_[_0x34d8('0x31')](_0xbf34ed[_0x34d8('0x32')]);_0x13591b[_0x34d8('0x33')]=_[_0x34d8('0x34')](_0x13591b[_0x34d8('0x2f')],_0x13591b[_0x34d8('0x32')]);_0x21d299[_0x34d8('0x35')]=_[_0x34d8('0x34')](_0x13591b[_0x34d8('0x2f')],qs[_0x34d8('0x36')](_0xbf34ed['query']['fields']));_0x21d299['attributes']=_0x21d299['attributes'][_0x34d8('0x37')]?_0x21d299[_0x34d8('0x35')]:_0x13591b[_0x34d8('0x2f')];if(_0xbf34ed[_0x34d8('0x32')][_0x34d8('0x41')]){_0x21d299[_0x34d8('0x42')]=[{'all':!![]}];}_0x21d299=_['merge']({},_0x21d299,_0xbf34ed['options']);return db[_0x34d8('0x2a')]['find'](_0x21d299)[_0x34d8('0x24')](handleEntityNotFound(_0x10d77e,null))[_0x34d8('0x24')](respondWithResult(_0x10d77e,null))[_0x34d8('0x44')](handleError(_0x10d77e,null));};exports[_0x34d8('0x46')]=function(_0x5451a1,_0x3708be){return db[_0x34d8('0x2a')]['create'](_0x5451a1['body'],{})['then'](respondWithResult(_0x3708be,0xc9))[_0x34d8('0x44')](handleError(_0x3708be,null));};exports['update']=function(_0x31d6d1,_0x297a7f){if(_0x31d6d1[_0x34d8('0x47')]['id']){delete _0x31d6d1[_0x34d8('0x47')]['id'];}return db['SalesforceField'][_0x34d8('0x48')]({'where':{'id':_0x31d6d1[_0x34d8('0x49')]['id']}})['then'](handleEntityNotFound(_0x297a7f,null))[_0x34d8('0x24')](saveUpdates(_0x31d6d1[_0x34d8('0x47')],null))[_0x34d8('0x24')](respondWithResult(_0x297a7f,null))[_0x34d8('0x44')](handleError(_0x297a7f,null));};exports[_0x34d8('0x4a')]=function(_0x4857e6,_0x3208eb){return db[_0x34d8('0x2a')][_0x34d8('0x48')]({'where':{'id':_0x4857e6[_0x34d8('0x49')]['id']}})[_0x34d8('0x24')](handleEntityNotFound(_0x3208eb,null))['then'](removeEntity(_0x3208eb,null))['catch'](handleError(_0x3208eb,null));}; \ No newline at end of file +var _0x4864=['model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','end','error','name','send','index','SalesforceField','rawAttributes','fieldName','key','query','keys','filters','intersection'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x4864,0xad));var _0x4486=function(_0x14a3cf,_0xae014f){_0x14a3cf=_0x14a3cf-0x0;var _0x5bcffb=_0x4864[_0x14a3cf];return _0x5bcffb;};'use strict';var emlformat=require(_0x4486('0x0'));var rimraf=require(_0x4486('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4486('0x2'));var rp=require(_0x4486('0x3'));var moment=require(_0x4486('0x4'));var BPromise=require(_0x4486('0x5'));var Mustache=require(_0x4486('0x6'));var util=require('util');var path=require(_0x4486('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4486('0x8'));var fs=require('fs');var fs_extra=require(_0x4486('0x9'));var _=require(_0x4486('0xa'));var squel=require('squel');var crypto=require(_0x4486('0xb'));var jsforce=require(_0x4486('0xc'));var deskjs=require(_0x4486('0xd'));var toCsv=require(_0x4486('0xe'));var querystring=require(_0x4486('0xf'));var Papa=require(_0x4486('0x10'));var Redis=require(_0x4486('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4486('0x12'));var logger=require(_0x4486('0x13'))(_0x4486('0x14'));var utils=require(_0x4486('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4486('0x16'));var db=require(_0x4486('0x17'))['db'];function respondWithStatusCode(_0x973ae,_0x46b81f){_0x46b81f=_0x46b81f||0xcc;return function(_0x42540f){if(_0x42540f){return _0x973ae[_0x4486('0x18')](_0x46b81f);}return _0x973ae['status'](_0x46b81f)['end']();};}function respondWithResult(_0x3852fc,_0x298467){_0x298467=_0x298467||0xc8;return function(_0x3d0367){if(_0x3d0367){return _0x3852fc[_0x4486('0x19')](_0x298467)[_0x4486('0x1a')](_0x3d0367);}};}function respondWithFilteredResult(_0x5e8546,_0x5d0691){return function(_0x1e7938){if(_0x1e7938){var _0x298526=typeof _0x5d0691[_0x4486('0x1b')]===_0x4486('0x1c')&&typeof _0x5d0691[_0x4486('0x1d')]===_0x4486('0x1c');var _0x3ce985=_0x1e7938[_0x4486('0x1e')];var _0x741cf7=_0x298526?0x0:_0x5d0691[_0x4486('0x1b')];var _0x53f629=_0x298526?_0x1e7938[_0x4486('0x1e')]:_0x5d0691['offset']+_0x5d0691['limit'];var _0x296502;if(_0x53f629>=_0x3ce985){_0x53f629=_0x3ce985;_0x296502=0xc8;}else{_0x296502=0xce;}_0x5e8546[_0x4486('0x19')](_0x296502);return _0x5e8546['set'](_0x4486('0x1f'),_0x741cf7+'-'+_0x53f629+'/'+_0x3ce985)[_0x4486('0x1a')](_0x1e7938);}return null;};}function patchUpdates(_0x34d543){return function(_0x10ed65){try{jsonpatch['apply'](_0x10ed65,_0x34d543,!![]);}catch(_0x46e0d0){return BPromise[_0x4486('0x20')](_0x46e0d0);}return _0x10ed65['save']();};}function saveUpdates(_0x13f7ac,_0xe2c290){return function(_0x583101){if(_0x583101){return _0x583101[_0x4486('0x21')](_0x13f7ac)[_0x4486('0x22')](function(_0x25698c){return _0x25698c;});}return null;};}function removeEntity(_0x53d9e3,_0x4c4576){return function(_0x5eb52e){if(_0x5eb52e){return _0x5eb52e[_0x4486('0x23')]()[_0x4486('0x22')](function(){_0x53d9e3['status'](0xcc)[_0x4486('0x24')]();});}};}function handleEntityNotFound(_0xfbedd5,_0x5d0eca){return function(_0x3b08e4){if(!_0x3b08e4){_0xfbedd5[_0x4486('0x18')](0x194);}return _0x3b08e4;};}function handleError(_0x3ac20c,_0x49b741){_0x49b741=_0x49b741||0x1f4;return function(_0x2f656f){logger[_0x4486('0x25')](_0x2f656f['stack']);if(_0x2f656f[_0x4486('0x26')]){delete _0x2f656f[_0x4486('0x26')];}_0x3ac20c[_0x4486('0x19')](_0x49b741)[_0x4486('0x27')](_0x2f656f);};}exports[_0x4486('0x28')]=function(_0x4ab5e1,_0xcb9595){var _0x3e490d={},_0x3073db={},_0x468006={'count':0x0,'rows':[]};var _0x56c71d=_['map'](db[_0x4486('0x29')][_0x4486('0x2a')],function(_0x5f4041){return{'name':_0x5f4041[_0x4486('0x2b')],'type':_0x5f4041['type'][_0x4486('0x2c')]};});_0x3073db['model']=_['map'](_0x56c71d,_0x4486('0x26'));_0x3073db[_0x4486('0x2d')]=_[_0x4486('0x2e')](_0x4ab5e1[_0x4486('0x2d')]);_0x3073db[_0x4486('0x2f')]=_[_0x4486('0x30')](_0x3073db[_0x4486('0x31')],_0x3073db[_0x4486('0x2d')]);_0x3e490d[_0x4486('0x32')]=_['intersection'](_0x3073db['model'],qs[_0x4486('0x33')](_0x4ab5e1[_0x4486('0x2d')][_0x4486('0x33')]));_0x3e490d[_0x4486('0x32')]=_0x3e490d['attributes']['length']?_0x3e490d['attributes']:_0x3073db['model'];if(!_0x4ab5e1[_0x4486('0x2d')][_0x4486('0x34')]('nolimit')){_0x3e490d[_0x4486('0x1d')]=qs[_0x4486('0x1d')](_0x4ab5e1['query']['limit']);_0x3e490d[_0x4486('0x1b')]=qs[_0x4486('0x1b')](_0x4ab5e1[_0x4486('0x2d')][_0x4486('0x1b')]);}_0x3e490d[_0x4486('0x35')]=qs[_0x4486('0x36')](_0x4ab5e1[_0x4486('0x2d')][_0x4486('0x36')]);_0x3e490d[_0x4486('0x37')]=qs[_0x4486('0x2f')](_[_0x4486('0x38')](_0x4ab5e1[_0x4486('0x2d')],_0x3073db[_0x4486('0x2f')]),_0x56c71d);if(_0x4ab5e1[_0x4486('0x2d')][_0x4486('0x39')]){_0x3e490d[_0x4486('0x37')]=_[_0x4486('0x3a')](_0x3e490d['where'],{'$or':_[_0x4486('0x3b')](_0x56c71d,function(_0x2b0d5d){if(_0x2b0d5d[_0x4486('0x3c')]!==_0x4486('0x3d')){var _0xb5cc={};_0xb5cc[_0x2b0d5d['name']]={'$like':'%'+_0x4ab5e1[_0x4486('0x2d')]['filter']+'%'};return _0xb5cc;}})});}_0x3e490d=_[_0x4486('0x3a')]({},_0x3e490d,_0x4ab5e1[_0x4486('0x3e')]);var _0x7d7f6d={'where':_0x3e490d[_0x4486('0x37')]};return db[_0x4486('0x29')][_0x4486('0x1e')](_0x7d7f6d)[_0x4486('0x22')](function(_0x2162ec){_0x468006['count']=_0x2162ec;if(_0x4ab5e1[_0x4486('0x2d')][_0x4486('0x3f')]){_0x3e490d[_0x4486('0x40')]=[{'all':!![]}];}return db[_0x4486('0x29')][_0x4486('0x41')](_0x3e490d);})['then'](function(_0x2af370){_0x468006[_0x4486('0x42')]=_0x2af370;return _0x468006;})['then'](respondWithFilteredResult(_0xcb9595,_0x3e490d))['catch'](handleError(_0xcb9595,null));};exports[_0x4486('0x43')]=function(_0x3766f8,_0x196765){var _0x549e27={'raw':!![],'where':{'id':_0x3766f8[_0x4486('0x44')]['id']}},_0x5146fa={};_0x5146fa['model']=_[_0x4486('0x2e')](db[_0x4486('0x29')][_0x4486('0x2a')]);_0x5146fa[_0x4486('0x2d')]=_['keys'](_0x3766f8[_0x4486('0x2d')]);_0x5146fa[_0x4486('0x2f')]=_[_0x4486('0x30')](_0x5146fa[_0x4486('0x31')],_0x5146fa[_0x4486('0x2d')]);_0x549e27['attributes']=_[_0x4486('0x30')](_0x5146fa[_0x4486('0x31')],qs[_0x4486('0x33')](_0x3766f8[_0x4486('0x2d')][_0x4486('0x33')]));_0x549e27[_0x4486('0x32')]=_0x549e27[_0x4486('0x32')][_0x4486('0x45')]?_0x549e27[_0x4486('0x32')]:_0x5146fa[_0x4486('0x31')];if(_0x3766f8['query'][_0x4486('0x3f')]){_0x549e27[_0x4486('0x40')]=[{'all':!![]}];}_0x549e27=_[_0x4486('0x3a')]({},_0x549e27,_0x3766f8['options']);return db[_0x4486('0x29')][_0x4486('0x46')](_0x549e27)[_0x4486('0x22')](handleEntityNotFound(_0x196765,null))['then'](respondWithResult(_0x196765,null))[_0x4486('0x47')](handleError(_0x196765,null));};exports[_0x4486('0x48')]=function(_0x485c36,_0x48b239){return db[_0x4486('0x29')][_0x4486('0x48')](_0x485c36[_0x4486('0x49')],{})[_0x4486('0x22')](respondWithResult(_0x48b239,0xc9))[_0x4486('0x47')](handleError(_0x48b239,null));};exports[_0x4486('0x21')]=function(_0x5d9ef8,_0x98951c){if(_0x5d9ef8['body']['id']){delete _0x5d9ef8[_0x4486('0x49')]['id'];}return db['SalesforceField']['find']({'where':{'id':_0x5d9ef8[_0x4486('0x44')]['id']}})[_0x4486('0x22')](handleEntityNotFound(_0x98951c,null))[_0x4486('0x22')](saveUpdates(_0x5d9ef8['body'],null))[_0x4486('0x22')](respondWithResult(_0x98951c,null))[_0x4486('0x47')](handleError(_0x98951c,null));};exports[_0x4486('0x23')]=function(_0x72e7a6,_0x1fd531){return db[_0x4486('0x29')][_0x4486('0x46')]({'where':{'id':_0x72e7a6[_0x4486('0x44')]['id']}})[_0x4486('0x22')](handleEntityNotFound(_0x1fd531,null))[_0x4486('0x22')](removeEntity(_0x1fd531,null))[_0x4486('0x47')](handleError(_0x1fd531,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index e981dc9..ef88b25 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 _0xa3c7=['exports','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2fe629,_0x3f7eac){var _0x12afd4=function(_0x55bb78){while(--_0x55bb78){_0x2fe629['push'](_0x2fe629['shift']());}};_0x12afd4(++_0x3f7eac);}(_0xa3c7,0x171));var _0x7a3c=function(_0x384e63,_0x3cdb06){_0x384e63=_0x384e63-0x0;var _0x163527=_0xa3c7[_0x384e63];return _0x163527;};'use strict';var _=require(_0x7a3c('0x0'));var util=require(_0x7a3c('0x1'));var logger=require(_0x7a3c('0x2'))('api');var moment=require(_0x7a3c('0x3'));var BPromise=require(_0x7a3c('0x4'));var rp=require(_0x7a3c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7a3c('0x6'));var config=require(_0x7a3c('0x7'));var attributes=require('./intSalesforceField.attributes');module[_0x7a3c('0x8')]=function(_0x4c188b,_0x2043ba){return _0x4c188b['define']('SalesforceField',attributes,{'tableName':_0x7a3c('0x9'),'paranoid':![],'indexes':[{'name':_0x7a3c('0xa'),'fields':[_0x7a3c('0xb'),_0x7a3c('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcfa2=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','salesforce_unique_index','FieldId','util','api'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xcfa2,0x1da));var _0x2cfa=function(_0x1bc9b5,_0x35828b){_0x1bc9b5=_0x1bc9b5-0x0;var _0x428267=_0xcfa2[_0x1bc9b5];return _0x428267;};'use strict';var _=require('lodash');var util=require(_0x2cfa('0x0'));var logger=require('../../config/logger')(_0x2cfa('0x1'));var moment=require(_0x2cfa('0x2'));var BPromise=require(_0x2cfa('0x3'));var rp=require(_0x2cfa('0x4'));var fs=require('fs');var path=require(_0x2cfa('0x5'));var rimraf=require(_0x2cfa('0x6'));var config=require(_0x2cfa('0x7'));var attributes=require(_0x2cfa('0x8'));module[_0x2cfa('0x9')]=function(_0x34f487,_0x25e473){return _0x34f487[_0x2cfa('0xa')](_0x2cfa('0xb'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x2cfa('0xc'),'fields':['idField',_0x2cfa('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index b632201..66b4842 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 _0xd817=['catch','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','SalesforceField,\x20%s,\x20%s','message'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd817,0x151));var _0x7d81=function(_0x5027b1,_0x1409a5){_0x5027b1=_0x5027b1-0x0;var _0x4a46cf=_0xd817[_0x5027b1];return _0x4a46cf;};'use strict';var _=require(_0x7d81('0x0'));var util=require(_0x7d81('0x1'));var moment=require('moment');var BPromise=require(_0x7d81('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d81('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7d81('0x4'))(_0x7d81('0x5'));var config=require(_0x7d81('0x6'));var jayson=require(_0x7d81('0x7'));var client=jayson[_0x7d81('0x8')][_0x7d81('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5192a5,_0x13e0d6,_0x42e5fe){return new BPromise(function(_0x5f2462,_0x1f8b1a){return client[_0x7d81('0xa')](_0x5192a5,_0x42e5fe)[_0x7d81('0xb')](function(_0x1032c0){logger[_0x7d81('0xc')]('SalesforceField,\x20%s,\x20%s',_0x13e0d6,_0x7d81('0xd'));logger[_0x7d81('0xe')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x13e0d6,_0x7d81('0xd'),JSON[_0x7d81('0xf')](_0x1032c0));if(_0x1032c0[_0x7d81('0x10')]){if(_0x1032c0['error'][_0x7d81('0x11')]===0x1f4){logger[_0x7d81('0x10')](_0x7d81('0x12'),_0x13e0d6,_0x1032c0[_0x7d81('0x10')][_0x7d81('0x13')]);return _0x1f8b1a(_0x1032c0['error'][_0x7d81('0x13')]);}logger[_0x7d81('0x10')]('SalesforceField,\x20%s,\x20%s',_0x13e0d6,_0x1032c0[_0x7d81('0x10')][_0x7d81('0x13')]);return _0x5f2462(_0x1032c0[_0x7d81('0x10')][_0x7d81('0x13')]);}else{logger[_0x7d81('0xc')](_0x7d81('0x12'),_0x13e0d6,'request\x20sent');_0x5f2462(_0x1032c0['result'][_0x7d81('0x13')]);}})[_0x7d81('0x14')](function(_0x5ca5a8){logger[_0x7d81('0x10')](_0x7d81('0x12'),_0x13e0d6,_0x5ca5a8);_0x1f8b1a(_0x5ca5a8);});});} \ No newline at end of file +var _0x0766=['../../config/logger','rpc','../../config/environment','http','request','then','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','message','SalesforceField,\x20%s,\x20%s','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4c023b,_0x3c05ef){var _0x15ae18=function(_0xcf8744){while(--_0xcf8744){_0x4c023b['push'](_0x4c023b['shift']());}};_0x15ae18(++_0x3c05ef);}(_0x0766,0x71));var _0x6076=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0766[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x6076('0x0'));var moment=require(_0x6076('0x1'));var BPromise=require(_0x6076('0x2'));var rs=require(_0x6076('0x3'));var fs=require('fs');var Redis=require(_0x6076('0x4'));var db=require(_0x6076('0x5'))['db'];var utils=require(_0x6076('0x6'));var logger=require(_0x6076('0x7'))(_0x6076('0x8'));var config=require(_0x6076('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6076('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37c155,_0x1233f2,_0x73a11d){return new BPromise(function(_0x1978af,_0x2f7669){return client[_0x6076('0xb')](_0x37c155,_0x73a11d)[_0x6076('0xc')](function(_0x43c9fb){logger['info']('SalesforceField,\x20%s,\x20%s',_0x1233f2,_0x6076('0xd'));logger[_0x6076('0xe')](_0x6076('0xf'),_0x1233f2,_0x6076('0xd'),JSON['stringify'](_0x43c9fb));if(_0x43c9fb[_0x6076('0x10')]){if(_0x43c9fb[_0x6076('0x10')]['code']===0x1f4){logger[_0x6076('0x10')]('SalesforceField,\x20%s,\x20%s',_0x1233f2,_0x43c9fb[_0x6076('0x10')][_0x6076('0x11')]);return _0x2f7669(_0x43c9fb[_0x6076('0x10')][_0x6076('0x11')]);}logger[_0x6076('0x10')](_0x6076('0x12'),_0x1233f2,_0x43c9fb[_0x6076('0x10')][_0x6076('0x11')]);return _0x1978af(_0x43c9fb[_0x6076('0x10')][_0x6076('0x11')]);}else{logger['info'](_0x6076('0x12'),_0x1233f2,_0x6076('0xd'));_0x1978af(_0x43c9fb[_0x6076('0x13')][_0x6076('0x11')]);}})['catch'](function(_0x1d0c49){logger[_0x6076('0x10')](_0x6076('0x12'),_0x1233f2,_0x1d0c49);_0x2f7669(_0x1d0c49);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index ec16648..9c5de87 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 _0x89f7=['destroy','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','addConfiguration','put','delete'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x89f7,0x105));var _0x789f=function(_0x10791d,_0x2562b6){_0x10791d=_0x10791d-0x0;var _0x1b4f9c=_0x89f7[_0x10791d];return _0x1b4f9c;};'use strict';var multer=require(_0x789f('0x0'));var util=require(_0x789f('0x1'));var path=require(_0x789f('0x2'));var timeout=require('connect-timeout');var express=require(_0x789f('0x3'));var router=express['Router']();var fs_extra=require(_0x789f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x789f('0x5'));var config=require(_0x789f('0x6'));var controller=require(_0x789f('0x7'));router[_0x789f('0x8')]('/',auth['isAuthenticated'](),controller[_0x789f('0x9')]);router[_0x789f('0x8')](_0x789f('0xa'),auth[_0x789f('0xb')](),controller['show']);router['get'](_0x789f('0xc'),auth[_0x789f('0xb')](),controller[_0x789f('0xd')]);router['get'](_0x789f('0xe'),auth[_0x789f('0xb')](),controller[_0x789f('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x789f('0xc'),auth[_0x789f('0xb')](),controller[_0x789f('0x10')]);router[_0x789f('0x11')](_0x789f('0xa'),auth[_0x789f('0xb')](),controller['update']);router[_0x789f('0x12')](_0x789f('0xa'),auth[_0x789f('0xb')](),controller[_0x789f('0x13')]);module['exports']=router; \ No newline at end of file +var _0xac72=['getConfigurations','/:id/fields','getFields','post','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations'];(function(_0x1d05c2,_0x1a6c2d){var _0x4766f5=function(_0xa0df0){while(--_0xa0df0){_0x1d05c2['push'](_0x1d05c2['shift']());}};_0x4766f5(++_0x1a6c2d);}(_0xac72,0x1eb));var _0x2ac7=function(_0x212a5c,_0xb12305){_0x212a5c=_0x212a5c-0x0;var _0x26b619=_0xac72[_0x212a5c];return _0x26b619;};'use strict';var multer=require(_0x2ac7('0x0'));var util=require(_0x2ac7('0x1'));var path=require(_0x2ac7('0x2'));var timeout=require('connect-timeout');var express=require(_0x2ac7('0x3'));var router=express[_0x2ac7('0x4')]();var fs_extra=require(_0x2ac7('0x5'));var auth=require(_0x2ac7('0x6'));var interaction=require(_0x2ac7('0x7'));var config=require(_0x2ac7('0x8'));var controller=require(_0x2ac7('0x9'));router[_0x2ac7('0xa')]('/',auth[_0x2ac7('0xb')](),controller[_0x2ac7('0xc')]);router[_0x2ac7('0xa')](_0x2ac7('0xd'),auth[_0x2ac7('0xb')](),controller['show']);router[_0x2ac7('0xa')](_0x2ac7('0xe'),auth['isAuthenticated'](),controller[_0x2ac7('0xf')]);router[_0x2ac7('0xa')](_0x2ac7('0x10'),auth[_0x2ac7('0xb')](),controller[_0x2ac7('0x11')]);router[_0x2ac7('0x12')]('/',auth[_0x2ac7('0xb')](),controller['create']);router[_0x2ac7('0x12')]('/:id/configurations',auth[_0x2ac7('0xb')](),controller['addConfiguration']);router[_0x2ac7('0x13')](_0x2ac7('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x2ac7('0x14')](_0x2ac7('0xd'),auth[_0x2ac7('0xb')](),controller[_0x2ac7('0x15')]);module[_0x2ac7('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 96b8dfd..a593858 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 _0x2fae=['STRING','username','remoteUri','sequelize'];(function(_0x2d05cf,_0x58750d){var _0x36421a=function(_0x45e48c){while(--_0x45e48c){_0x2d05cf['push'](_0x2d05cf['shift']());}};_0x36421a(++_0x58750d);}(_0x2fae,0x19f));var _0xe2fa=function(_0x31afba,_0x20da5a){_0x31afba=_0x31afba-0x0;var _0x2fe648=_0x2fae[_0x31afba];return _0x2fe648;};'use strict';var Sequelize=require(_0xe2fa('0x0'));module['exports']={'name':{'type':Sequelize[_0xe2fa('0x1')]},'description':{'type':Sequelize[_0xe2fa('0x1')]},'username':{'type':Sequelize[_0xe2fa('0x1')],'unique':_0xe2fa('0x2')},'password':{'type':Sequelize[_0xe2fa('0x1')]},'email':{'type':Sequelize[_0xe2fa('0x1')]},'remoteUri':{'type':Sequelize[_0xe2fa('0x1')],'unique':_0xe2fa('0x3')},'serverUrl':{'type':Sequelize[_0xe2fa('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x0c5f=['sequelize','exports','STRING','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c5f,0x8c));var _0xf0c5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0c5f[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xf0c5('0x0'));module[_0xf0c5('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf0c5('0x2')],'unique':_0xf0c5('0x3')},'password':{'type':Sequelize[_0xf0c5('0x2')]},'email':{'type':Sequelize[_0xf0c5('0x2')]},'remoteUri':{'type':Sequelize[_0xf0c5('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xf0c5('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 e73e709..5e7c950 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 _0x49fb=['comments_and_work_notes','sys_tags','upon_approval','location','password','email','remoteUri','serverUrl','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','GET','result','log','assign','remove','includes','forEach','internalType','label','push','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','all','concat','ServiceNow\x20error:\x20','test','boolean','True','true','False','false','inactive','value','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','ServicenowAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','Subjects','Descriptions','getDescriptions','channel','ServicenowField','getFields','made_sla','knowledge','subcategory','close_code','notify','incident_state','severity','category','caused_by','watch_list','upon_reject','child_incidents','hold_reason','approval_history','number','resolved_by','opened_by','sys_created_on','state','sys_created_by','calendar_stc','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','rfc','time_worked','opened_at','group_list','work_end','reopened_time','resolved_at','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','calendar_duration','close_notes','closed_by','follow_up','sys_id','contact_type','urgency','reassignment_count','activity_due','comments'];(function(_0x400be1,_0x56afa2){var _0x7bf9a6=function(_0x5d318b){while(--_0x5d318b){_0x400be1['push'](_0x400be1['shift']());}};_0x7bf9a6(++_0x56afa2);}(_0x49fb,0xd7));var _0xb49f=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x49fb[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require(_0xb49f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb49f('0x1'));var rp=require('request-promise');var moment=require(_0xb49f('0x2'));var BPromise=require(_0xb49f('0x3'));var Mustache=require(_0xb49f('0x4'));var util=require('util');var path=require(_0xb49f('0x5'));var sox=require(_0xb49f('0x6'));var csv=require(_0xb49f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb49f('0x8'));var squel=require(_0xb49f('0x9'));var crypto=require(_0xb49f('0xa'));var jsforce=require(_0xb49f('0xb'));var deskjs=require(_0xb49f('0xc'));var toCsv=require(_0xb49f('0x7'));var querystring=require(_0xb49f('0xd'));var Papa=require(_0xb49f('0xe'));var Redis=require(_0xb49f('0xf'));var authService=require(_0xb49f('0x10'));var qs=require(_0xb49f('0x11'));var as=require(_0xb49f('0x12'));var hardwareService=require(_0xb49f('0x13'));var logger=require(_0xb49f('0x14'))(_0xb49f('0x15'));var utils=require(_0xb49f('0x16'));var config=require(_0xb49f('0x17'));var licenseUtil=require(_0xb49f('0x18'));var db=require(_0xb49f('0x19'))['db'];var integrations=require(_0xb49f('0x1a'));function respondWithStatusCode(_0x5566a3,_0x278baf){_0x278baf=_0x278baf||0xcc;return function(_0x2145c4){if(_0x2145c4){return _0x5566a3[_0xb49f('0x1b')](_0x278baf);}return _0x5566a3['status'](_0x278baf)[_0xb49f('0x1c')]();};}function respondWithResult(_0x566115,_0x26cf44){_0x26cf44=_0x26cf44||0xc8;return function(_0x579d1a){if(_0x579d1a){return _0x566115[_0xb49f('0x1d')](_0x26cf44)[_0xb49f('0x1e')](_0x579d1a);}};}function respondWithFilteredResult(_0x4d6c81,_0x149548){return function(_0x3f9632){if(_0x3f9632){var _0x4ccfd1=typeof _0x149548[_0xb49f('0x1f')]===_0xb49f('0x20')&&typeof _0x149548[_0xb49f('0x21')]===_0xb49f('0x20');var _0x6cde79=_0x3f9632['count'];var _0x318390=_0x4ccfd1?0x0:_0x149548['offset'];var _0xe95cf7=_0x4ccfd1?_0x3f9632[_0xb49f('0x22')]:_0x149548['offset']+_0x149548[_0xb49f('0x21')];var _0x13241d;if(_0xe95cf7>=_0x6cde79){_0xe95cf7=_0x6cde79;_0x13241d=0xc8;}else{_0x13241d=0xce;}_0x4d6c81[_0xb49f('0x1d')](_0x13241d);return _0x4d6c81[_0xb49f('0x23')]('Content-Range',_0x318390+'-'+_0xe95cf7+'/'+_0x6cde79)[_0xb49f('0x1e')](_0x3f9632);}return null;};}function patchUpdates(_0x1f1bd0){return function(_0x16e509){try{jsonpatch[_0xb49f('0x24')](_0x16e509,_0x1f1bd0,!![]);}catch(_0x12ec60){return BPromise[_0xb49f('0x25')](_0x12ec60);}return _0x16e509['save']();};}function saveUpdates(_0x2fbc54,_0x395306){return function(_0xdd74ab){if(_0xdd74ab){return _0xdd74ab[_0xb49f('0x26')](_0x2fbc54)[_0xb49f('0x27')](function(_0x3c692a){return _0x3c692a;});}return null;};}function removeEntity(_0x241fa5,_0xf6dbb0){return function(_0x2fa50b){if(_0x2fa50b){return _0x2fa50b[_0xb49f('0x28')]()['then'](function(){_0x241fa5[_0xb49f('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a20d0,_0x98a9c){return function(_0x12dfe1){if(!_0x12dfe1){_0x2a20d0[_0xb49f('0x1b')](0x194);}return _0x12dfe1;};}function handleError(_0x5be76f,_0x5db3bd){_0x5db3bd=_0x5db3bd||0x1f4;return function(_0x169d1e){logger[_0xb49f('0x29')](_0x169d1e[_0xb49f('0x2a')]);if(_0x169d1e[_0xb49f('0x2b')]){delete _0x169d1e[_0xb49f('0x2b')];}_0x5be76f[_0xb49f('0x1d')](_0x5db3bd)[_0xb49f('0x2c')](_0x169d1e);};}exports[_0xb49f('0x2d')]=function(_0x1a2128,_0x568393){var _0x212f21={},_0x43bd62={},_0x56da47={'count':0x0,'rows':[]};var _0x3f7f76=_[_0xb49f('0x2e')](db[_0xb49f('0x2f')]['rawAttributes'],function(_0x4e6254){return{'name':_0x4e6254[_0xb49f('0x30')],'type':_0x4e6254[_0xb49f('0x31')][_0xb49f('0x32')]};});_0x43bd62[_0xb49f('0x33')]=_[_0xb49f('0x2e')](_0x3f7f76,_0xb49f('0x2b'));_0x43bd62[_0xb49f('0x34')]=_[_0xb49f('0x35')](_0x1a2128[_0xb49f('0x34')]);_0x43bd62[_0xb49f('0x36')]=_[_0xb49f('0x37')](_0x43bd62[_0xb49f('0x33')],_0x43bd62[_0xb49f('0x34')]);_0x212f21[_0xb49f('0x38')]=_['intersection'](_0x43bd62['model'],qs['fields'](_0x1a2128['query'][_0xb49f('0x39')]));_0x212f21[_0xb49f('0x38')]=_0x212f21[_0xb49f('0x38')][_0xb49f('0x3a')]?_0x212f21[_0xb49f('0x38')]:_0x43bd62[_0xb49f('0x33')];if(!_0x1a2128['query'][_0xb49f('0x3b')](_0xb49f('0x3c'))){_0x212f21[_0xb49f('0x21')]=qs['limit'](_0x1a2128[_0xb49f('0x34')][_0xb49f('0x21')]);_0x212f21[_0xb49f('0x1f')]=qs[_0xb49f('0x1f')](_0x1a2128[_0xb49f('0x34')][_0xb49f('0x1f')]);}_0x212f21[_0xb49f('0x3d')]=qs['sort'](_0x1a2128[_0xb49f('0x34')][_0xb49f('0x3e')]);_0x212f21['where']=qs['filters'](_[_0xb49f('0x3f')](_0x1a2128[_0xb49f('0x34')],_0x43bd62[_0xb49f('0x36')]),_0x3f7f76);if(_0x1a2128[_0xb49f('0x34')][_0xb49f('0x40')]){_0x212f21[_0xb49f('0x41')]=_[_0xb49f('0x42')](_0x212f21[_0xb49f('0x41')],{'$or':_[_0xb49f('0x2e')](_0x3f7f76,function(_0x49c59d){if(_0x49c59d['type']!==_0xb49f('0x43')){var _0x599f12={};_0x599f12[_0x49c59d[_0xb49f('0x2b')]]={'$like':'%'+_0x1a2128[_0xb49f('0x34')]['filter']+'%'};return _0x599f12;}})});}_0x212f21=_[_0xb49f('0x42')]({},_0x212f21,_0x1a2128[_0xb49f('0x44')]);var _0x591348={'where':_0x212f21[_0xb49f('0x41')]};return db['ServicenowAccount'][_0xb49f('0x22')](_0x591348)['then'](function(_0x6eaa34){_0x56da47[_0xb49f('0x22')]=_0x6eaa34;if(_0x1a2128[_0xb49f('0x34')][_0xb49f('0x45')]){_0x212f21[_0xb49f('0x46')]=[{'all':!![]}];}return db[_0xb49f('0x2f')][_0xb49f('0x47')](_0x212f21);})[_0xb49f('0x27')](function(_0x257577){_0x56da47[_0xb49f('0x48')]=_0x257577;return _0x56da47;})[_0xb49f('0x27')](respondWithFilteredResult(_0x568393,_0x212f21))[_0xb49f('0x49')](handleError(_0x568393,null));};exports[_0xb49f('0x4a')]=function(_0x26a70f,_0x167471){var _0x56072d={'raw':![],'where':{'id':_0x26a70f[_0xb49f('0x4b')]['id']}},_0x116111={};_0x116111['model']=_['keys'](db[_0xb49f('0x2f')][_0xb49f('0x4c')]);_0x116111[_0xb49f('0x34')]=_[_0xb49f('0x35')](_0x26a70f[_0xb49f('0x34')]);_0x116111['filters']=_[_0xb49f('0x37')](_0x116111[_0xb49f('0x33')],_0x116111['query']);_0x56072d['attributes']=_['intersection'](_0x116111['model'],qs[_0xb49f('0x39')](_0x26a70f['query'][_0xb49f('0x39')]));_0x56072d[_0xb49f('0x38')]=_0x56072d[_0xb49f('0x38')][_0xb49f('0x3a')]?_0x56072d[_0xb49f('0x38')]:_0x116111['model'];if(_0x26a70f[_0xb49f('0x34')][_0xb49f('0x45')]){_0x56072d['include']=[{'all':!![]}];}_0x56072d=_[_0xb49f('0x42')]({},_0x56072d,_0x26a70f[_0xb49f('0x44')]);return db[_0xb49f('0x2f')][_0xb49f('0x4d')](_0x56072d)[_0xb49f('0x27')](handleEntityNotFound(_0x167471,null))['then'](respondWithResult(_0x167471,null))[_0xb49f('0x49')](handleError(_0x167471,null));};exports[_0xb49f('0x4e')]=function(_0x1f5670,_0x259456){return db[_0xb49f('0x2f')][_0xb49f('0x4e')](_0x1f5670['body'],{})[_0xb49f('0x27')](respondWithResult(_0x259456,0xc9))[_0xb49f('0x49')](handleError(_0x259456,null));};exports[_0xb49f('0x26')]=function(_0x5c480c,_0x398423){if(_0x5c480c[_0xb49f('0x4f')]['id']){delete _0x5c480c[_0xb49f('0x4f')]['id'];}return db[_0xb49f('0x2f')][_0xb49f('0x4d')]({'where':{'id':_0x5c480c['params']['id']}})[_0xb49f('0x27')](handleEntityNotFound(_0x398423,null))[_0xb49f('0x27')](saveUpdates(_0x5c480c['body'],null))[_0xb49f('0x27')](respondWithResult(_0x398423,null))['catch'](handleError(_0x398423,null));};exports[_0xb49f('0x28')]=function(_0x4facae,_0x1c7368){return db[_0xb49f('0x2f')][_0xb49f('0x4d')]({'where':{'id':_0x4facae[_0xb49f('0x4b')]['id']}})[_0xb49f('0x27')](handleEntityNotFound(_0x1c7368,null))['then'](removeEntity(_0x1c7368,null))[_0xb49f('0x49')](handleError(_0x1c7368,null));};exports[_0xb49f('0x50')]=function(_0x2832f2,_0x2f45b9,_0x3886ef){var _0x2dd959={};var _0x1514dc={};var _0x490fc6;var _0x19e20c;return db[_0xb49f('0x2f')][_0xb49f('0x51')]({'where':{'id':_0x2832f2['params']['id']}})[_0xb49f('0x27')](handleEntityNotFound(_0x2f45b9,null))[_0xb49f('0x27')](function(_0x42d5d8){if(_0x42d5d8){_0x490fc6=_0x42d5d8;_0x1514dc['model']=_['keys'](db[_0xb49f('0x52')][_0xb49f('0x4c')]);_0x1514dc[_0xb49f('0x34')]=_['keys'](_0x2832f2[_0xb49f('0x34')]);_0x1514dc[_0xb49f('0x36')]=_[_0xb49f('0x37')](_0x1514dc[_0xb49f('0x33')],_0x1514dc[_0xb49f('0x34')]);_0x2dd959[_0xb49f('0x38')]=_[_0xb49f('0x37')](_0x1514dc[_0xb49f('0x33')],qs[_0xb49f('0x39')](_0x2832f2['query'][_0xb49f('0x39')]));_0x2dd959[_0xb49f('0x38')]=_0x2dd959[_0xb49f('0x38')][_0xb49f('0x3a')]?_0x2dd959[_0xb49f('0x38')]:_0x1514dc[_0xb49f('0x33')];_0x2dd959[_0xb49f('0x3d')]=qs[_0xb49f('0x3e')](_0x2832f2[_0xb49f('0x34')]['sort']);_0x2dd959[_0xb49f('0x41')]=qs['filters'](_[_0xb49f('0x3f')](_0x2832f2[_0xb49f('0x34')],_0x1514dc[_0xb49f('0x36')]));if(_0x2832f2[_0xb49f('0x34')][_0xb49f('0x40')]){_0x2dd959[_0xb49f('0x41')]=_[_0xb49f('0x42')](_0x2dd959[_0xb49f('0x41')],{'$or':_[_0xb49f('0x2e')](_0x2dd959[_0xb49f('0x38')],function(_0x277901){var _0x10a45d={};_0x10a45d[_0x277901]={'$like':'%'+_0x2832f2['query']['filter']+'%'};return _0x10a45d;})});}_0x2dd959=_[_0xb49f('0x42')]({},_0x2dd959,_0x2832f2[_0xb49f('0x44')]);return _0x490fc6[_0xb49f('0x50')](_0x2dd959);}})['then'](function(_0x4135c8){if(_0x4135c8){_0x19e20c=_0x4135c8[_0xb49f('0x3a')];if(!_0x2832f2['query'][_0xb49f('0x3b')](_0xb49f('0x3c'))){_0x2dd959[_0xb49f('0x21')]=qs[_0xb49f('0x21')](_0x2832f2[_0xb49f('0x34')]['limit']);_0x2dd959[_0xb49f('0x1f')]=qs[_0xb49f('0x1f')](_0x2832f2['query'][_0xb49f('0x1f')]);}return _0x490fc6['getConfigurations'](_0x2dd959);}})['then'](function(_0x573883){if(_0x573883){return _0x573883?{'count':_0x19e20c,'rows':_0x573883}:null;}})[_0xb49f('0x27')](respondWithResult(_0x2f45b9,null))[_0xb49f('0x49')](handleError(_0x2f45b9,null));};exports[_0xb49f('0x53')]=function(_0xb30bb4,_0x2070c,_0xcd845a){if(_0xb30bb4[_0xb49f('0x4f')]['id']){delete _0xb30bb4[_0xb49f('0x4f')]['id'];}return db[_0xb49f('0x2f')][_0xb49f('0x51')]({'where':{'id':_0xb30bb4[_0xb49f('0x4b')]['id']}})[_0xb49f('0x27')](handleEntityNotFound(_0x2070c,null))[_0xb49f('0x27')](function(_0x5a5e59){if(_0x5a5e59){_0xb30bb4['body']['AccountId']=_0x5a5e59['id'];_0xb30bb4[_0xb49f('0x4f')][_0xb49f('0x54')]=integrations['getSubjects'](_0xb30bb4['body']['channel'],_0xb30bb4['body'][_0xb49f('0x31')]);_0xb30bb4[_0xb49f('0x4f')][_0xb49f('0x55')]=integrations[_0xb49f('0x56')](_0xb30bb4['body'][_0xb49f('0x57')],_0xb30bb4[_0xb49f('0x4f')][_0xb49f('0x31')]);return db[_0xb49f('0x52')][_0xb49f('0x4e')](_0xb30bb4[_0xb49f('0x4f')],{'include':[{'model':db[_0xb49f('0x58')],'as':'Subjects'},{'model':db[_0xb49f('0x58')],'as':_0xb49f('0x55')}]});}return null;})[_0xb49f('0x27')](respondWithResult(_0x2070c,null))['catch'](handleError(_0x2070c,null));};exports[_0xb49f('0x59')]=function(_0x572484,_0x1b6804,_0x41a1e4){var _0x251978=[_0xb49f('0x5a'),'hold_reason',_0xb49f('0x5b'),_0xb49f('0x5c'),_0xb49f('0x5d'),_0xb49f('0x5e'),_0xb49f('0x5f'),_0xb49f('0x60'),_0xb49f('0x61')];var _0x3faf3f=['parent',_0xb49f('0x5a'),_0xb49f('0x62'),_0xb49f('0x63'),_0xb49f('0x64'),'sys_updated_on',_0xb49f('0x65'),_0xb49f('0x66'),_0xb49f('0x67'),_0xb49f('0x68'),_0xb49f('0x69'),'sys_updated_by',_0xb49f('0x6a'),'user_input',_0xb49f('0x6b'),'sys_domain',_0xb49f('0x6c'),_0xb49f('0x6d'),_0xb49f('0x5b'),_0xb49f('0x3d'),_0xb49f('0x6e'),'closed_at',_0xb49f('0x6f'),_0xb49f('0x70'),_0xb49f('0x71'),_0xb49f('0x72'),_0xb49f('0x73'),_0xb49f('0x74'),_0xb49f('0x75'),'sys_domain_path',_0xb49f('0x76'),_0xb49f('0x77'),'expected_start',_0xb49f('0x78'),'business_duration',_0xb49f('0x79'),_0xb49f('0x7a'),_0xb49f('0x7b'),_0xb49f('0x7c'),'caller_id','approval_set','subcategory',_0xb49f('0x7d'),_0xb49f('0x7e'),'close_code',_0xb49f('0x7f'),_0xb49f('0x80'),_0xb49f('0x81'),_0xb49f('0x82'),_0xb49f('0x83'),_0xb49f('0x84'),'description',_0xb49f('0x85'),_0xb49f('0x5e'),'sys_class_name',_0xb49f('0x86'),_0xb49f('0x87'),_0xb49f('0x88'),'parent_incident',_0xb49f('0x89'),_0xb49f('0x8a'),'reopened_by',_0xb49f('0x5f'),_0xb49f('0x8b'),'problem_id','company',_0xb49f('0x8c'),_0xb49f('0x8d'),'assigned_to',_0xb49f('0x60'),_0xb49f('0x8e'),'sla_due','approval',_0xb49f('0x8f'),'due_date','sys_mod_count','reopen_count',_0xb49f('0x90'),'escalation',_0xb49f('0x91'),'correlation_id',_0xb49f('0x92'),_0xb49f('0x61')];var _0x7f8932='';var _0x3d3809='';var _0x4a99da=[];var _0x280d84='';var _0x135d1a='';var _0x26b606=[];var _0x21378e='';var _0x317bea='';var _0x3cd5e2={};var _0x32ba39='';return db[_0xb49f('0x2f')]['findOne']({'where':{'id':_0x572484[_0xb49f('0x4b')]['id']},'attributes':['id','username',_0xb49f('0x93'),_0xb49f('0x94'),_0xb49f('0x95'),_0xb49f('0x96')]})[_0xb49f('0x27')](handleEntityNotFound(_0x1b6804,null))[_0xb49f('0x27')](function(_0x1f7fb4){if(_0x1f7fb4){_0x32ba39=_0x1f7fb4['remoteUri'];var _0x4e8e49=_0x32ba39['slice'](-0x1);if(_0x4e8e49==='/'){_0x32ba39=_0x32ba39[_0xb49f('0x97')](0x0,_0x32ba39['lastIndexOf'](_0x4e8e49));}_0x317bea=util[_0xb49f('0x98')](_0xb49f('0x99'),_0x32ba39);_0x21378e=util[_0xb49f('0x98')](_0xb49f('0x9a'),_0x32ba39);_0x3cd5e2={'user':_0x1f7fb4[_0xb49f('0x9b')],'pass':_0x1f7fb4[_0xb49f('0x93')]};var _0x452325={'method':_0xb49f('0x9c'),'uri':_0x317bea+'incident?sysparm_display_value=all','auth':_0x3cd5e2,'json':!![]};return rp(_0x452325);}})[_0xb49f('0x27')](function(_0x934807){if(_0x934807[_0xb49f('0x9d')][_0xb49f('0x3a')]>0x0){_0x7f8932=_0x934807[_0xb49f('0x9d')];}console[_0xb49f('0x9e')]('incident\x20table\x20objects',_0x7f8932);_0x26b606=[];_0x3d3809=Object[_0xb49f('0x9f')]([],_0x7f8932);_[_0xb49f('0xa0')](_0x3d3809,function(_0x28f48b){return!_0x251978[_0xb49f('0xa1')](_0x28f48b[_0xb49f('0x2b')]);});_0x3d3809[_0xb49f('0xa2')](function(_0x311d6c){var _0x993003=createFieldObject(_0x21378e,_0x3cd5e2,_0x311d6c[_0xb49f('0xa3')],_0x311d6c[_0xb49f('0x2b')],_0x311d6c[_0xb49f('0xa4')],![]);_0x26b606[_0xb49f('0xa5')](_0x993003);});return Promise['all'](_0x26b606);})[_0xb49f('0x27')](function(_0x34478e){_0x4a99da=_0x34478e;_0x280d84=Object['assign']([],_0x7f8932);console[_0xb49f('0x9e')](_0xb49f('0xa6'),_0x7f8932);_[_0xb49f('0xa0')](_0x280d84,function(_0x328b26){return _0x3faf3f[_0xb49f('0xa1')](_0x328b26[_0xb49f('0x2b')]);});console['log'](_0xb49f('0xa7'),_0x280d84);_0x26b606=[];_0x280d84[_0xb49f('0xa2')](function(_0x33e666){var _0x25b6cb=createFieldObject(_0x21378e,_0x3cd5e2,_0x33e666[_0xb49f('0xa3')],_0x33e666[_0xb49f('0x2b')],_0x33e666[_0xb49f('0xa4')],!![]);_0x26b606[_0xb49f('0xa5')](_0x25b6cb);});return Promise[_0xb49f('0xa8')](_0x26b606);})[_0xb49f('0x27')](function(_0x97e17e){_0x135d1a=_0x97e17e;var _0x2cc1b4=_0x4a99da[_0xb49f('0xa9')](_0x135d1a);return{'count':_0x2cc1b4[_0xb49f('0x3a')],'rows':_0x2cc1b4};})['then'](respondWithResult(_0x1b6804,null))[_0xb49f('0x49')](function(_0x41b1e2){console[_0xb49f('0x9e')](_0xb49f('0xaa')+_0x41b1e2);var _0x185380=_0x572484[_0xb49f('0x34')][_0xb49f('0xab')]?0x1f4:_0x41b1e2['statusCode']||0x1f4;logger[_0xb49f('0x29')](_0x41b1e2[_0xb49f('0x2a')]);delete _0x41b1e2[_0xb49f('0x2b')];if(_0x185380===0x191){_0x185380=0x190;}_0x1b6804['status'](_0x185380)[_0xb49f('0x2c')](_0x572484[_0xb49f('0x34')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x41b1e2['statusCode']}:_0x41b1e2);});};function createFieldObject(_0x1de1fb,_0x45e1b6,_0x1dae9c,_0xdd28f3,_0x2a1084,_0x18cd61){return new Promise(function(_0x2ba3ff,_0x22cd95){var _0x10e61e={'id':_0xdd28f3,'name':_0x2a1084,'custom':_0x18cd61};if(_0x1dae9c===_0xb49f('0xac')){_0x10e61e['options']=[{'name':_0xb49f('0xad'),'value':_0xb49f('0xae')},{'name':_0xb49f('0xaf'),'value':_0xb49f('0xb0')}];_0x2ba3ff(_0x10e61e);}else{var _0x3643af={'method':_0xb49f('0x9c'),'uri':_0x1de1fb+'sys_choice?sysparm_query=name=incident^element='+_0xdd28f3,'auth':_0x45e1b6,'json':!![]};return rp(_0x3643af)['then'](function(_0x1d97a8){var _0x265026=[];if(_0x1d97a8['result']['length']>0x0){_0x1d97a8['result']['forEach'](function(_0x3a431b){if(_0x3a431b[_0xb49f('0xb1')]===_0xb49f('0xb0')){var _0x421010={'name':_0x3a431b[_0xb49f('0xa4')],'value':_0x3a431b[_0xb49f('0xb2')]};_0x265026[_0xb49f('0xa5')](_0x421010);}});}_0x10e61e[_0xb49f('0x44')]=_0x265026;if(_0x10e61e[_0xb49f('0x44')][_0xb49f('0x3a')]>0x0){_0x2ba3ff(_0x10e61e);}else{if(_0x18cd61==![]){_0x2ba3ff();}else{_0x2ba3ff(_0x10e61e);}}});}});} \ No newline at end of file +var _0x6ce7=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','then','destroy','error','name','send','index','map','ServicenowAccount','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','findOne','ServicenowConfiguration','hasOwnProperty','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','category','parent','caused_by','upon_reject','sys_updated_on','number','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','cmdb_ci','delivery_plan','active','work_notes_list','priority','sys_domain_path','rfc','time_worked','expected_start','business_duration','work_end','reopened_time','approval_set','short_description','delivery_task','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','urgency','problem_id','reassignment_count','activity_due','severity','comments','sla_due','approval','reopen_count','sys_tags','upon_approval','correlation_id','location','password','email','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','stack','Wrong\x20credentials','statusCode','True','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse'];(function(_0x108904,_0x52c660){var _0x52df85=function(_0x2cc877){while(--_0x2cc877){_0x108904['push'](_0x108904['shift']());}};_0x52df85(++_0x52c660);}(_0x6ce7,0xa3));var _0x76ce=function(_0x40d9c3,_0x41a34c){_0x40d9c3=_0x40d9c3-0x0;var _0x462a5e=_0x6ce7[_0x40d9c3];return _0x462a5e;};'use strict';var emlformat=require(_0x76ce('0x0'));var rimraf=require(_0x76ce('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x76ce('0x2'));var rp=require(_0x76ce('0x3'));var moment=require(_0x76ce('0x4'));var BPromise=require(_0x76ce('0x5'));var Mustache=require('mustache');var util=require(_0x76ce('0x6'));var path=require('path');var sox=require(_0x76ce('0x7'));var csv=require('to-csv');var ejs=require(_0x76ce('0x8'));var fs=require('fs');var fs_extra=require(_0x76ce('0x9'));var _=require(_0x76ce('0xa'));var squel=require(_0x76ce('0xb'));var crypto=require(_0x76ce('0xc'));var jsforce=require(_0x76ce('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x76ce('0xe'));var querystring=require('querystring');var Papa=require(_0x76ce('0xf'));var Redis=require(_0x76ce('0x10'));var authService=require(_0x76ce('0x11'));var qs=require(_0x76ce('0x12'));var as=require(_0x76ce('0x13'));var hardwareService=require(_0x76ce('0x14'));var logger=require(_0x76ce('0x15'))(_0x76ce('0x16'));var utils=require(_0x76ce('0x17'));var config=require(_0x76ce('0x18'));var licenseUtil=require(_0x76ce('0x19'));var db=require(_0x76ce('0x1a'))['db'];var integrations=require(_0x76ce('0x1b'));function respondWithStatusCode(_0x55d996,_0x508726){_0x508726=_0x508726||0xcc;return function(_0x25a69a){if(_0x25a69a){return _0x55d996[_0x76ce('0x1c')](_0x508726);}return _0x55d996[_0x76ce('0x1d')](_0x508726)[_0x76ce('0x1e')]();};}function respondWithResult(_0x575540,_0x4138ec){_0x4138ec=_0x4138ec||0xc8;return function(_0x51a987){if(_0x51a987){return _0x575540[_0x76ce('0x1d')](_0x4138ec)[_0x76ce('0x1f')](_0x51a987);}};}function respondWithFilteredResult(_0x23b96,_0x45dd31){return function(_0x14a914){if(_0x14a914){var _0x14b939=typeof _0x45dd31[_0x76ce('0x20')]===_0x76ce('0x21')&&typeof _0x45dd31[_0x76ce('0x22')]===_0x76ce('0x21');var _0x8e8c96=_0x14a914['count'];var _0x1ace37=_0x14b939?0x0:_0x45dd31['offset'];var _0x503656=_0x14b939?_0x14a914[_0x76ce('0x23')]:_0x45dd31[_0x76ce('0x20')]+_0x45dd31[_0x76ce('0x22')];var _0x28d68b;if(_0x503656>=_0x8e8c96){_0x503656=_0x8e8c96;_0x28d68b=0xc8;}else{_0x28d68b=0xce;}_0x23b96[_0x76ce('0x1d')](_0x28d68b);return _0x23b96['set'](_0x76ce('0x24'),_0x1ace37+'-'+_0x503656+'/'+_0x8e8c96)['json'](_0x14a914);}return null;};}function patchUpdates(_0x3cac5c){return function(_0x5cd458){try{jsonpatch[_0x76ce('0x25')](_0x5cd458,_0x3cac5c,!![]);}catch(_0x163174){return BPromise['reject'](_0x163174);}return _0x5cd458['save']();};}function saveUpdates(_0x4014c6,_0x51334c){return function(_0x30f039){if(_0x30f039){return _0x30f039[_0x76ce('0x26')](_0x4014c6)[_0x76ce('0x27')](function(_0x12fc4f){return _0x12fc4f;});}return null;};}function removeEntity(_0x218e14,_0x4011d2){return function(_0x5df807){if(_0x5df807){return _0x5df807[_0x76ce('0x28')]()[_0x76ce('0x27')](function(){_0x218e14[_0x76ce('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe50787,_0x2af9f0){return function(_0x771c25){if(!_0x771c25){_0xe50787['sendStatus'](0x194);}return _0x771c25;};}function handleError(_0x1e4745,_0x13ec3f){_0x13ec3f=_0x13ec3f||0x1f4;return function(_0x151516){logger[_0x76ce('0x29')](_0x151516['stack']);if(_0x151516[_0x76ce('0x2a')]){delete _0x151516[_0x76ce('0x2a')];}_0x1e4745[_0x76ce('0x1d')](_0x13ec3f)[_0x76ce('0x2b')](_0x151516);};}exports[_0x76ce('0x2c')]=function(_0x5b436e,_0x3ff95c){var _0x3bcc4f={},_0x1ccab3={},_0x13b8d9={'count':0x0,'rows':[]};var _0xcd282a=_[_0x76ce('0x2d')](db[_0x76ce('0x2e')][_0x76ce('0x2f')],function(_0x12c7ee){return{'name':_0x12c7ee['fieldName'],'type':_0x12c7ee['type'][_0x76ce('0x30')]};});_0x1ccab3[_0x76ce('0x31')]=_['map'](_0xcd282a,_0x76ce('0x2a'));_0x1ccab3[_0x76ce('0x32')]=_[_0x76ce('0x33')](_0x5b436e[_0x76ce('0x32')]);_0x1ccab3[_0x76ce('0x34')]=_['intersection'](_0x1ccab3[_0x76ce('0x31')],_0x1ccab3[_0x76ce('0x32')]);_0x3bcc4f['attributes']=_[_0x76ce('0x35')](_0x1ccab3[_0x76ce('0x31')],qs['fields'](_0x5b436e[_0x76ce('0x32')][_0x76ce('0x36')]));_0x3bcc4f['attributes']=_0x3bcc4f[_0x76ce('0x37')]['length']?_0x3bcc4f[_0x76ce('0x37')]:_0x1ccab3[_0x76ce('0x31')];if(!_0x5b436e[_0x76ce('0x32')]['hasOwnProperty'](_0x76ce('0x38'))){_0x3bcc4f['limit']=qs[_0x76ce('0x22')](_0x5b436e[_0x76ce('0x32')]['limit']);_0x3bcc4f['offset']=qs[_0x76ce('0x20')](_0x5b436e['query'][_0x76ce('0x20')]);}_0x3bcc4f[_0x76ce('0x39')]=qs['sort'](_0x5b436e[_0x76ce('0x32')][_0x76ce('0x3a')]);_0x3bcc4f['where']=qs['filters'](_['pick'](_0x5b436e['query'],_0x1ccab3[_0x76ce('0x34')]),_0xcd282a);if(_0x5b436e['query'][_0x76ce('0x3b')]){_0x3bcc4f[_0x76ce('0x3c')]=_['merge'](_0x3bcc4f[_0x76ce('0x3c')],{'$or':_[_0x76ce('0x2d')](_0xcd282a,function(_0x3746bf){if(_0x3746bf[_0x76ce('0x3d')]!==_0x76ce('0x3e')){var _0x130ab1={};_0x130ab1[_0x3746bf[_0x76ce('0x2a')]]={'$like':'%'+_0x5b436e['query'][_0x76ce('0x3b')]+'%'};return _0x130ab1;}})});}_0x3bcc4f=_[_0x76ce('0x3f')]({},_0x3bcc4f,_0x5b436e[_0x76ce('0x40')]);var _0x363d2f={'where':_0x3bcc4f[_0x76ce('0x3c')]};return db[_0x76ce('0x2e')][_0x76ce('0x23')](_0x363d2f)[_0x76ce('0x27')](function(_0x1cda22){_0x13b8d9[_0x76ce('0x23')]=_0x1cda22;if(_0x5b436e[_0x76ce('0x32')][_0x76ce('0x41')]){_0x3bcc4f[_0x76ce('0x42')]=[{'all':!![]}];}return db[_0x76ce('0x2e')][_0x76ce('0x43')](_0x3bcc4f);})[_0x76ce('0x27')](function(_0x1939f5){_0x13b8d9[_0x76ce('0x44')]=_0x1939f5;return _0x13b8d9;})['then'](respondWithFilteredResult(_0x3ff95c,_0x3bcc4f))[_0x76ce('0x45')](handleError(_0x3ff95c,null));};exports[_0x76ce('0x46')]=function(_0x1a2702,_0x9f93bb){var _0x36db3d={'raw':![],'where':{'id':_0x1a2702[_0x76ce('0x47')]['id']}},_0x4c81a3={};_0x4c81a3['model']=_[_0x76ce('0x33')](db[_0x76ce('0x2e')][_0x76ce('0x2f')]);_0x4c81a3['query']=_[_0x76ce('0x33')](_0x1a2702[_0x76ce('0x32')]);_0x4c81a3[_0x76ce('0x34')]=_[_0x76ce('0x35')](_0x4c81a3[_0x76ce('0x31')],_0x4c81a3[_0x76ce('0x32')]);_0x36db3d[_0x76ce('0x37')]=_[_0x76ce('0x35')](_0x4c81a3['model'],qs[_0x76ce('0x36')](_0x1a2702[_0x76ce('0x32')][_0x76ce('0x36')]));_0x36db3d[_0x76ce('0x37')]=_0x36db3d[_0x76ce('0x37')][_0x76ce('0x48')]?_0x36db3d[_0x76ce('0x37')]:_0x4c81a3[_0x76ce('0x31')];if(_0x1a2702[_0x76ce('0x32')][_0x76ce('0x41')]){_0x36db3d[_0x76ce('0x42')]=[{'all':!![]}];}_0x36db3d=_[_0x76ce('0x3f')]({},_0x36db3d,_0x1a2702['options']);return db[_0x76ce('0x2e')]['find'](_0x36db3d)[_0x76ce('0x27')](handleEntityNotFound(_0x9f93bb,null))[_0x76ce('0x27')](respondWithResult(_0x9f93bb,null))[_0x76ce('0x45')](handleError(_0x9f93bb,null));};exports[_0x76ce('0x49')]=function(_0x3fe5d8,_0x2cff86){return db[_0x76ce('0x2e')][_0x76ce('0x49')](_0x3fe5d8[_0x76ce('0x4a')],{})[_0x76ce('0x27')](respondWithResult(_0x2cff86,0xc9))['catch'](handleError(_0x2cff86,null));};exports[_0x76ce('0x26')]=function(_0x3bf875,_0x15af1d){if(_0x3bf875['body']['id']){delete _0x3bf875[_0x76ce('0x4a')]['id'];}return db[_0x76ce('0x2e')]['find']({'where':{'id':_0x3bf875[_0x76ce('0x47')]['id']}})[_0x76ce('0x27')](handleEntityNotFound(_0x15af1d,null))[_0x76ce('0x27')](saveUpdates(_0x3bf875[_0x76ce('0x4a')],null))['then'](respondWithResult(_0x15af1d,null))['catch'](handleError(_0x15af1d,null));};exports[_0x76ce('0x28')]=function(_0x4082a4,_0x1d388a){return db[_0x76ce('0x2e')]['find']({'where':{'id':_0x4082a4[_0x76ce('0x47')]['id']}})[_0x76ce('0x27')](handleEntityNotFound(_0x1d388a,null))['then'](removeEntity(_0x1d388a,null))['catch'](handleError(_0x1d388a,null));};exports['getConfigurations']=function(_0x43abbb,_0x1bb029,_0x4c92d7){var _0x4430e4={};var _0x2a7858={};var _0x20c0cb;var _0x275987;return db[_0x76ce('0x2e')][_0x76ce('0x4b')]({'where':{'id':_0x43abbb[_0x76ce('0x47')]['id']}})[_0x76ce('0x27')](handleEntityNotFound(_0x1bb029,null))[_0x76ce('0x27')](function(_0x3a533b){if(_0x3a533b){_0x20c0cb=_0x3a533b;_0x2a7858[_0x76ce('0x31')]=_[_0x76ce('0x33')](db[_0x76ce('0x4c')]['rawAttributes']);_0x2a7858['query']=_[_0x76ce('0x33')](_0x43abbb[_0x76ce('0x32')]);_0x2a7858[_0x76ce('0x34')]=_[_0x76ce('0x35')](_0x2a7858[_0x76ce('0x31')],_0x2a7858['query']);_0x4430e4[_0x76ce('0x37')]=_['intersection'](_0x2a7858['model'],qs[_0x76ce('0x36')](_0x43abbb[_0x76ce('0x32')]['fields']));_0x4430e4[_0x76ce('0x37')]=_0x4430e4['attributes'][_0x76ce('0x48')]?_0x4430e4[_0x76ce('0x37')]:_0x2a7858[_0x76ce('0x31')];_0x4430e4['order']=qs[_0x76ce('0x3a')](_0x43abbb[_0x76ce('0x32')][_0x76ce('0x3a')]);_0x4430e4[_0x76ce('0x3c')]=qs[_0x76ce('0x34')](_['pick'](_0x43abbb[_0x76ce('0x32')],_0x2a7858[_0x76ce('0x34')]));if(_0x43abbb[_0x76ce('0x32')][_0x76ce('0x3b')]){_0x4430e4[_0x76ce('0x3c')]=_[_0x76ce('0x3f')](_0x4430e4[_0x76ce('0x3c')],{'$or':_[_0x76ce('0x2d')](_0x4430e4['attributes'],function(_0x417a61){var _0x2982d4={};_0x2982d4[_0x417a61]={'$like':'%'+_0x43abbb[_0x76ce('0x32')][_0x76ce('0x3b')]+'%'};return _0x2982d4;})});}_0x4430e4=_[_0x76ce('0x3f')]({},_0x4430e4,_0x43abbb['options']);return _0x20c0cb['getConfigurations'](_0x4430e4);}})[_0x76ce('0x27')](function(_0x1e7683){if(_0x1e7683){_0x275987=_0x1e7683[_0x76ce('0x48')];if(!_0x43abbb[_0x76ce('0x32')][_0x76ce('0x4d')](_0x76ce('0x38'))){_0x4430e4[_0x76ce('0x22')]=qs[_0x76ce('0x22')](_0x43abbb[_0x76ce('0x32')][_0x76ce('0x22')]);_0x4430e4[_0x76ce('0x20')]=qs[_0x76ce('0x20')](_0x43abbb[_0x76ce('0x32')]['offset']);}return _0x20c0cb['getConfigurations'](_0x4430e4);}})[_0x76ce('0x27')](function(_0x1b962b){if(_0x1b962b){return _0x1b962b?{'count':_0x275987,'rows':_0x1b962b}:null;}})[_0x76ce('0x27')](respondWithResult(_0x1bb029,null))[_0x76ce('0x45')](handleError(_0x1bb029,null));};exports['addConfiguration']=function(_0x20997a,_0x408d88,_0x3151e2){if(_0x20997a[_0x76ce('0x4a')]['id']){delete _0x20997a[_0x76ce('0x4a')]['id'];}return db['ServicenowAccount'][_0x76ce('0x4b')]({'where':{'id':_0x20997a[_0x76ce('0x47')]['id']}})[_0x76ce('0x27')](handleEntityNotFound(_0x408d88,null))[_0x76ce('0x27')](function(_0x119453){if(_0x119453){_0x20997a['body'][_0x76ce('0x4e')]=_0x119453['id'];_0x20997a[_0x76ce('0x4a')][_0x76ce('0x4f')]=integrations[_0x76ce('0x50')](_0x20997a[_0x76ce('0x4a')]['channel'],_0x20997a[_0x76ce('0x4a')]['type']);_0x20997a[_0x76ce('0x4a')][_0x76ce('0x51')]=integrations[_0x76ce('0x52')](_0x20997a['body']['channel'],_0x20997a['body'][_0x76ce('0x3d')]);return db[_0x76ce('0x4c')][_0x76ce('0x49')](_0x20997a[_0x76ce('0x4a')],{'include':[{'model':db['ServicenowField'],'as':'Subjects'},{'model':db[_0x76ce('0x53')],'as':_0x76ce('0x51')}]});}return null;})[_0x76ce('0x27')](respondWithResult(_0x408d88,null))['catch'](handleError(_0x408d88,null));};exports[_0x76ce('0x54')]=function(_0xc75c36,_0x45cb26,_0x2d760d){var _0x436091=[_0x76ce('0x55'),_0x76ce('0x56'),_0x76ce('0x57'),_0x76ce('0x58'),_0x76ce('0x59'),_0x76ce('0x5a'),_0x76ce('0x5b'),'severity',_0x76ce('0x5c')];var _0x4cce3e=[_0x76ce('0x5d'),_0x76ce('0x55'),_0x76ce('0x5e'),'watch_list',_0x76ce('0x5f'),_0x76ce('0x60'),'child_incidents',_0x76ce('0x56'),'approval_history',_0x76ce('0x61'),'resolved_by',_0x76ce('0x62'),_0x76ce('0x63'),_0x76ce('0x64'),_0x76ce('0x65'),_0x76ce('0x66'),_0x76ce('0x67'),_0x76ce('0x68'),_0x76ce('0x57'),_0x76ce('0x39'),'calendar_stc','closed_at',_0x76ce('0x69'),_0x76ce('0x6a'),'impact',_0x76ce('0x6b'),_0x76ce('0x6c'),'business_service',_0x76ce('0x6d'),_0x76ce('0x6e'),_0x76ce('0x6f'),_0x76ce('0x70'),_0x76ce('0x71'),'opened_at',_0x76ce('0x72'),'group_list',_0x76ce('0x73'),_0x76ce('0x74'),'resolved_at','caller_id',_0x76ce('0x75'),_0x76ce('0x58'),'work_notes',_0x76ce('0x76'),'close_code','correlation_display',_0x76ce('0x77'),'work_start','assignment_group',_0x76ce('0x78'),_0x76ce('0x79'),_0x76ce('0x7a'),_0x76ce('0x7b'),_0x76ce('0x5a'),_0x76ce('0x7c'),_0x76ce('0x7d'),_0x76ce('0x7e'),_0x76ce('0x7f'),_0x76ce('0x80'),_0x76ce('0x81'),'contact_type',_0x76ce('0x82'),'incident_state',_0x76ce('0x83'),_0x76ce('0x84'),'company',_0x76ce('0x85'),_0x76ce('0x86'),'assigned_to',_0x76ce('0x87'),_0x76ce('0x88'),_0x76ce('0x89'),_0x76ce('0x8a'),'comments_and_work_notes','due_date','sys_mod_count',_0x76ce('0x8b'),_0x76ce('0x8c'),'escalation',_0x76ce('0x8d'),_0x76ce('0x8e'),_0x76ce('0x8f'),_0x76ce('0x5c')];var _0x27205b='';var _0x5f01dd='';var _0x30effc=[];var _0x21861c='';var _0x246cbb='';var _0x2d41c4=[];var _0x38b8ed='';var _0x319c19='';var _0x49d4f0={};var _0x3eac8a='';return db[_0x76ce('0x2e')][_0x76ce('0x4b')]({'where':{'id':_0xc75c36[_0x76ce('0x47')]['id']},'attributes':['id','username',_0x76ce('0x90'),_0x76ce('0x91'),_0x76ce('0x92'),_0x76ce('0x93')]})[_0x76ce('0x27')](handleEntityNotFound(_0x45cb26,null))['then'](function(_0x526cf1){if(_0x526cf1){_0x3eac8a=_0x526cf1[_0x76ce('0x92')];var _0x5bdc52=_0x3eac8a[_0x76ce('0x94')](-0x1);if(_0x5bdc52==='/'){_0x3eac8a=_0x3eac8a['substring'](0x0,_0x3eac8a[_0x76ce('0x95')](_0x5bdc52));}_0x319c19=util[_0x76ce('0x96')](_0x76ce('0x97'),_0x3eac8a);_0x38b8ed=util[_0x76ce('0x96')](_0x76ce('0x98'),_0x3eac8a);_0x49d4f0={'user':_0x526cf1['username'],'pass':_0x526cf1[_0x76ce('0x90')]};var _0x271144={'method':'GET','uri':_0x319c19+_0x76ce('0x99'),'auth':_0x49d4f0,'json':!![]};return rp(_0x271144);}})[_0x76ce('0x27')](function(_0x2a8e1f){if(_0x2a8e1f[_0x76ce('0x9a')][_0x76ce('0x48')]>0x0){_0x27205b=_0x2a8e1f[_0x76ce('0x9a')];}console[_0x76ce('0x9b')](_0x76ce('0x9c'),_0x27205b);_0x2d41c4=[];_0x5f01dd=Object[_0x76ce('0x9d')]([],_0x27205b);_[_0x76ce('0x9e')](_0x5f01dd,function(_0x4a3005){return!_0x436091[_0x76ce('0x9f')](_0x4a3005[_0x76ce('0x2a')]);});_0x5f01dd[_0x76ce('0xa0')](function(_0x563b29){var _0x2c710d=createFieldObject(_0x38b8ed,_0x49d4f0,_0x563b29[_0x76ce('0xa1')],_0x563b29[_0x76ce('0x2a')],_0x563b29[_0x76ce('0xa2')],![]);_0x2d41c4[_0x76ce('0xa3')](_0x2c710d);});return Promise['all'](_0x2d41c4);})[_0x76ce('0x27')](function(_0x3892f3){_0x30effc=_0x3892f3;_0x21861c=Object[_0x76ce('0x9d')]([],_0x27205b);console[_0x76ce('0x9b')]('TCL:\x20_object',_0x27205b);_[_0x76ce('0x9e')](_0x21861c,function(_0x33e432){return _0x4cce3e['includes'](_0x33e432[_0x76ce('0x2a')]);});console[_0x76ce('0x9b')](_0x76ce('0xa4'),_0x21861c);_0x2d41c4=[];_0x21861c[_0x76ce('0xa0')](function(_0x504459){var _0x29dc65=createFieldObject(_0x38b8ed,_0x49d4f0,_0x504459[_0x76ce('0xa1')],_0x504459['name'],_0x504459[_0x76ce('0xa2')],!![]);_0x2d41c4[_0x76ce('0xa3')](_0x29dc65);});return Promise['all'](_0x2d41c4);})[_0x76ce('0x27')](function(_0x18f856){_0x246cbb=_0x18f856;var _0x31f738=_0x30effc[_0x76ce('0xa5')](_0x246cbb);return{'count':_0x31f738[_0x76ce('0x48')],'rows':_0x31f738};})['then'](respondWithResult(_0x45cb26,null))[_0x76ce('0x45')](function(_0x1130fe){console['log'](_0x76ce('0xa6')+_0x1130fe);var _0x41284a=_0xc75c36['query'][_0x76ce('0xa7')]?0x1f4:_0x1130fe['statusCode']||0x1f4;logger['error'](_0x1130fe[_0x76ce('0xa8')]);delete _0x1130fe['name'];if(_0x41284a===0x191){_0x41284a=0x190;}_0x45cb26[_0x76ce('0x1d')](_0x41284a)[_0x76ce('0x2b')](_0xc75c36['query'][_0x76ce('0xa7')]?{'message':_0x76ce('0xa9'),'statusCode':_0x1130fe[_0x76ce('0xaa')]}:_0x1130fe);});};function createFieldObject(_0x288f0a,_0x542000,_0x254638,_0x381f3c,_0x43657f,_0x23d171){return new Promise(function(_0x39c12f,_0x14bcaa){var _0x4b4d3b={'id':_0x381f3c,'name':_0x43657f,'custom':_0x23d171};if(_0x254638==='boolean'){_0x4b4d3b['options']=[{'name':_0x76ce('0xab'),'value':_0x76ce('0xac')},{'name':_0x76ce('0xad'),'value':_0x76ce('0xae')}];_0x39c12f(_0x4b4d3b);}else{var _0x427d93={'method':_0x76ce('0xaf'),'uri':_0x288f0a+_0x76ce('0xb0')+_0x381f3c,'auth':_0x542000,'json':!![]};return rp(_0x427d93)['then'](function(_0x1a11f0){var _0x2e52fd=[];if(_0x1a11f0[_0x76ce('0x9a')][_0x76ce('0x48')]>0x0){_0x1a11f0['result'][_0x76ce('0xa0')](function(_0x6ac938){if(_0x6ac938[_0x76ce('0xb1')]==='false'){var _0x127ad2={'name':_0x6ac938[_0x76ce('0xa2')],'value':_0x6ac938[_0x76ce('0xb2')]};_0x2e52fd[_0x76ce('0xa3')](_0x127ad2);}});}_0x4b4d3b[_0x76ce('0x40')]=_0x2e52fd;if(_0x4b4d3b[_0x76ce('0x40')][_0x76ce('0x48')]>0x0){_0x39c12f(_0x4b4d3b);}else{if(_0x23d171==![]){_0x39c12f();}else{_0x39c12f(_0x4b4d3b);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 804cc6f..b81f6b1 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 _0xf494=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','int_servicenow_accounts','lodash'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0xf494,0x1c6));var _0x4f49=function(_0x1f088a,_0x3a6aff){_0x1f088a=_0x1f088a-0x0;var _0x5e839d=_0xf494[_0x1f088a];return _0x5e839d;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));var integrations=require(_0x4f49('0xa'));module[_0x4f49('0xb')]=function(_0x413530,_0x42b0e8){return _0x413530['define']('ServicenowAccount',attributes,{'tableName':_0x4f49('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4819=['request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','exports','define','ServicenowAccount','int_servicenow_accounts','util','../../config/logger','api','moment','bluebird'];(function(_0xa1bfdc,_0x512b8c){var _0x2f0b16=function(_0x2b2e9a){while(--_0x2b2e9a){_0xa1bfdc['push'](_0xa1bfdc['shift']());}};_0x2f0b16(++_0x512b8c);}(_0x4819,0xcd));var _0x9481=function(_0x25bd2a,_0xc8fe7a){_0x25bd2a=_0x25bd2a-0x0;var _0xb6b479=_0x4819[_0x25bd2a];return _0xb6b479;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x9481('0xa')]=function(_0x5def07,_0x54cc78){return _0x5def07[_0x9481('0xb')](_0x9481('0xc'),attributes,{'tableName':_0x9481('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 d0c6948..6f45df8 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 _0xc138=['include','map','model','ShowServicenowAccount','find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit'];(function(_0xa78b9f,_0x1ba4f0){var _0x2cf63a=function(_0x1cbb59){while(--_0x1cbb59){_0xa78b9f['push'](_0xa78b9f['shift']());}};_0x2cf63a(++_0x1ba4f0);}(_0xc138,0x85));var _0x8c13=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc138[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x8c13('0x0'));var util=require(_0x8c13('0x1'));var moment=require('moment');var BPromise=require(_0x8c13('0x2'));var rs=require(_0x8c13('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c13('0x4'))['db'];var utils=require(_0x8c13('0x5'));var logger=require('../../config/logger')(_0x8c13('0x6'));var config=require(_0x8c13('0x7'));var jayson=require(_0x8c13('0x8'));var client=jayson[_0x8c13('0x9')][_0x8c13('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x594f6b,_0x4b95a2,_0x592946){return new BPromise(function(_0x568ff8,_0x386efd){return client['request'](_0x594f6b,_0x592946)['then'](function(_0x384ee){logger[_0x8c13('0xb')](_0x8c13('0xc'),_0x4b95a2,_0x8c13('0xd'));logger['debug'](_0x8c13('0xe'),_0x4b95a2,_0x8c13('0xd'),JSON['stringify'](_0x384ee));if(_0x384ee[_0x8c13('0xf')]){if(_0x384ee[_0x8c13('0xf')][_0x8c13('0x10')]===0x1f4){logger[_0x8c13('0xf')](_0x8c13('0xc'),_0x4b95a2,_0x384ee[_0x8c13('0xf')][_0x8c13('0x11')]);return _0x386efd(_0x384ee[_0x8c13('0xf')]['message']);}logger[_0x8c13('0xf')](_0x8c13('0xc'),_0x4b95a2,_0x384ee[_0x8c13('0xf')]['message']);return _0x568ff8(_0x384ee[_0x8c13('0xf')][_0x8c13('0x11')]);}else{logger[_0x8c13('0xb')](_0x8c13('0xc'),_0x4b95a2,_0x8c13('0xd'));_0x568ff8(_0x384ee['result'][_0x8c13('0x11')]);}})[_0x8c13('0x12')](function(_0x19da75){logger[_0x8c13('0xf')](_0x8c13('0xc'),_0x4b95a2,_0x19da75);_0x386efd(_0x19da75);});});}exports[_0x8c13('0x13')]=function(_0x51a713){var _0x155f93=this;return new Promise(function(_0x37ec99,_0x2e1d27){return db[_0x8c13('0x14')][_0x8c13('0x15')]({'raw':_0x51a713[_0x8c13('0x16')]?_0x51a713[_0x8c13('0x16')][_0x8c13('0x17')]===undefined?!![]:![]:!![],'where':_0x51a713[_0x8c13('0x16')]?_0x51a713[_0x8c13('0x16')][_0x8c13('0x18')]||null:null,'attributes':_0x51a713[_0x8c13('0x16')]?_0x51a713[_0x8c13('0x16')][_0x8c13('0x19')]||null:null,'limit':_0x51a713[_0x8c13('0x16')]?_0x51a713['options'][_0x8c13('0x1a')]||null:null,'include':_0x51a713[_0x8c13('0x16')]?_0x51a713['options'][_0x8c13('0x1b')]?_[_0x8c13('0x1c')](_0x51a713[_0x8c13('0x16')][_0x8c13('0x1b')],function(_0x465843){return{'model':db[_0x465843[_0x8c13('0x1d')]],'as':_0x465843['as'],'attributes':_0x465843[_0x8c13('0x19')],'include':_0x465843['include']?_[_0x8c13('0x1c')](_0x465843[_0x8c13('0x1b')],function(_0x365313){return{'model':db[_0x365313[_0x8c13('0x1d')]],'as':_0x365313['as'],'attributes':_0x365313['attributes'],'include':_0x365313[_0x8c13('0x1b')]?_[_0x8c13('0x1c')](_0x365313['include'],function(_0x3a7574){return{'model':db[_0x3a7574['model']],'as':_0x3a7574['as'],'attributes':_0x3a7574[_0x8c13('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b3220){logger[_0x8c13('0xb')](_0x8c13('0x13'),_0x51a713);logger['debug'](_0x8c13('0x13'),_0x51a713,JSON['stringify'](_0x2b3220));_0x37ec99(_0x2b3220);})[_0x8c13('0x12')](function(_0x30e96b){logger[_0x8c13('0xf')](_0x8c13('0x13'),_0x30e96b['message'],_0x51a713);_0x2e1d27(_0x155f93[_0x8c13('0xf')](0x1f4,_0x30e96b[_0x8c13('0x11')]));});});};exports[_0x8c13('0x1e')]=function(_0x15c0e6){var _0x3fc2b4=this;return new Promise(function(_0x8a9077,_0x8772e0){return db[_0x8c13('0x14')][_0x8c13('0x1f')]({'raw':_0x15c0e6[_0x8c13('0x16')]?_0x15c0e6[_0x8c13('0x16')][_0x8c13('0x17')]===undefined?!![]:![]:!![],'where':_0x15c0e6['options']?_0x15c0e6['options'][_0x8c13('0x18')]||null:null,'attributes':_0x15c0e6[_0x8c13('0x16')]?_0x15c0e6[_0x8c13('0x16')][_0x8c13('0x19')]||null:null,'include':_0x15c0e6[_0x8c13('0x16')]?_0x15c0e6[_0x8c13('0x16')][_0x8c13('0x1b')]?_[_0x8c13('0x1c')](_0x15c0e6[_0x8c13('0x16')]['include'],function(_0x2f9f55){return{'model':db[_0x2f9f55['model']],'as':_0x2f9f55['as'],'attributes':_0x2f9f55[_0x8c13('0x19')],'include':_0x2f9f55['include']?_['map'](_0x2f9f55[_0x8c13('0x1b')],function(_0x115874){return{'model':db[_0x115874[_0x8c13('0x1d')]],'as':_0x115874['as'],'attributes':_0x115874[_0x8c13('0x19')],'include':_0x115874[_0x8c13('0x1b')]?_[_0x8c13('0x1c')](_0x115874[_0x8c13('0x1b')],function(_0x22101d){return{'model':db[_0x22101d[_0x8c13('0x1d')]],'as':_0x22101d['as'],'attributes':_0x22101d[_0x8c13('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x40ff27){logger[_0x8c13('0xb')](_0x8c13('0x1e'),_0x15c0e6);logger['debug'](_0x8c13('0x1e'),_0x15c0e6,JSON['stringify'](_0x40ff27));_0x8a9077(_0x40ff27);})['catch'](function(_0x517c07){logger[_0x8c13('0xf')](_0x8c13('0x1e'),_0x517c07[_0x8c13('0x11')],_0x15c0e6);_0x8772e0(_0x3fc2b4[_0x8c13('0xf')](0x1f4,_0x517c07[_0x8c13('0x11')]));});});}; \ No newline at end of file +var _0xd3a4=['ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ServicenowAccount','findAll','options','where','attributes','limit','include','map','model','GetServicenowAccount','stringify','find','ShowServicenowAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x397767,_0xe95633){var _0x401997=function(_0x3a67d5){while(--_0x3a67d5){_0x397767['push'](_0x397767['shift']());}};_0x401997(++_0xe95633);}(_0xd3a4,0xab));var _0x4d3a=function(_0x2c45a5,_0x5ef843){_0x2c45a5=_0x2c45a5-0x0;var _0x291748=_0xd3a4[_0x2c45a5];return _0x291748;};'use strict';var _=require(_0x4d3a('0x0'));var util=require(_0x4d3a('0x1'));var moment=require(_0x4d3a('0x2'));var BPromise=require(_0x4d3a('0x3'));var rs=require(_0x4d3a('0x4'));var fs=require('fs');var Redis=require(_0x4d3a('0x5'));var db=require(_0x4d3a('0x6'))['db'];var utils=require(_0x4d3a('0x7'));var logger=require(_0x4d3a('0x8'))(_0x4d3a('0x9'));var config=require(_0x4d3a('0xa'));var jayson=require(_0x4d3a('0xb'));var client=jayson[_0x4d3a('0xc')][_0x4d3a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x21c0fd,_0x154339,_0x465b18){return new BPromise(function(_0x3f0e06,_0x360411){return client[_0x4d3a('0xe')](_0x21c0fd,_0x465b18)['then'](function(_0x4f7891){logger[_0x4d3a('0xf')](_0x4d3a('0x10'),_0x154339,_0x4d3a('0x11'));logger[_0x4d3a('0x12')](_0x4d3a('0x13'),_0x154339,'request\x20sent',JSON['stringify'](_0x4f7891));if(_0x4f7891[_0x4d3a('0x14')]){if(_0x4f7891[_0x4d3a('0x14')][_0x4d3a('0x15')]===0x1f4){logger[_0x4d3a('0x14')]('ServicenowAccount,\x20%s,\x20%s',_0x154339,_0x4f7891[_0x4d3a('0x14')][_0x4d3a('0x16')]);return _0x360411(_0x4f7891[_0x4d3a('0x14')]['message']);}logger[_0x4d3a('0x14')]('ServicenowAccount,\x20%s,\x20%s',_0x154339,_0x4f7891[_0x4d3a('0x14')][_0x4d3a('0x16')]);return _0x3f0e06(_0x4f7891[_0x4d3a('0x14')][_0x4d3a('0x16')]);}else{logger['info'](_0x4d3a('0x10'),_0x154339,'request\x20sent');_0x3f0e06(_0x4f7891[_0x4d3a('0x17')][_0x4d3a('0x16')]);}})[_0x4d3a('0x18')](function(_0x180af0){logger['error'](_0x4d3a('0x10'),_0x154339,_0x180af0);_0x360411(_0x180af0);});});}exports['GetServicenowAccount']=function(_0x2b599d){var _0x52eab5=this;return new Promise(function(_0x24c4b6,_0x4ffcbd){return db[_0x4d3a('0x19')][_0x4d3a('0x1a')]({'raw':_0x2b599d[_0x4d3a('0x1b')]?_0x2b599d[_0x4d3a('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2b599d[_0x4d3a('0x1b')]?_0x2b599d[_0x4d3a('0x1b')][_0x4d3a('0x1c')]||null:null,'attributes':_0x2b599d[_0x4d3a('0x1b')]?_0x2b599d[_0x4d3a('0x1b')][_0x4d3a('0x1d')]||null:null,'limit':_0x2b599d['options']?_0x2b599d[_0x4d3a('0x1b')][_0x4d3a('0x1e')]||null:null,'include':_0x2b599d['options']?_0x2b599d[_0x4d3a('0x1b')][_0x4d3a('0x1f')]?_[_0x4d3a('0x20')](_0x2b599d[_0x4d3a('0x1b')][_0x4d3a('0x1f')],function(_0x4cef6a){return{'model':db[_0x4cef6a[_0x4d3a('0x21')]],'as':_0x4cef6a['as'],'attributes':_0x4cef6a[_0x4d3a('0x1d')],'include':_0x4cef6a[_0x4d3a('0x1f')]?_['map'](_0x4cef6a[_0x4d3a('0x1f')],function(_0x3f736d){return{'model':db[_0x3f736d[_0x4d3a('0x21')]],'as':_0x3f736d['as'],'attributes':_0x3f736d['attributes'],'include':_0x3f736d[_0x4d3a('0x1f')]?_[_0x4d3a('0x20')](_0x3f736d[_0x4d3a('0x1f')],function(_0x5454fa){return{'model':db[_0x5454fa[_0x4d3a('0x21')]],'as':_0x5454fa['as'],'attributes':_0x5454fa[_0x4d3a('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4174e8){logger[_0x4d3a('0xf')](_0x4d3a('0x22'),_0x2b599d);logger[_0x4d3a('0x12')](_0x4d3a('0x22'),_0x2b599d,JSON[_0x4d3a('0x23')](_0x4174e8));_0x24c4b6(_0x4174e8);})[_0x4d3a('0x18')](function(_0x153b55){logger[_0x4d3a('0x14')](_0x4d3a('0x22'),_0x153b55[_0x4d3a('0x16')],_0x2b599d);_0x4ffcbd(_0x52eab5[_0x4d3a('0x14')](0x1f4,_0x153b55['message']));});});};exports['ShowServicenowAccount']=function(_0x24c359){var _0x546576=this;return new Promise(function(_0x502a31,_0x5630df){return db[_0x4d3a('0x19')][_0x4d3a('0x24')]({'raw':_0x24c359['options']?_0x24c359[_0x4d3a('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x24c359[_0x4d3a('0x1b')]?_0x24c359[_0x4d3a('0x1b')][_0x4d3a('0x1c')]||null:null,'attributes':_0x24c359[_0x4d3a('0x1b')]?_0x24c359['options'][_0x4d3a('0x1d')]||null:null,'include':_0x24c359[_0x4d3a('0x1b')]?_0x24c359[_0x4d3a('0x1b')]['include']?_[_0x4d3a('0x20')](_0x24c359[_0x4d3a('0x1b')][_0x4d3a('0x1f')],function(_0x3e8c61){return{'model':db[_0x3e8c61[_0x4d3a('0x21')]],'as':_0x3e8c61['as'],'attributes':_0x3e8c61['attributes'],'include':_0x3e8c61[_0x4d3a('0x1f')]?_['map'](_0x3e8c61[_0x4d3a('0x1f')],function(_0x42dd44){return{'model':db[_0x42dd44['model']],'as':_0x42dd44['as'],'attributes':_0x42dd44[_0x4d3a('0x1d')],'include':_0x42dd44[_0x4d3a('0x1f')]?_['map'](_0x42dd44[_0x4d3a('0x1f')],function(_0x1c6ea6){return{'model':db[_0x1c6ea6['model']],'as':_0x1c6ea6['as'],'attributes':_0x1c6ea6[_0x4d3a('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x141ff1){logger['info'](_0x4d3a('0x25'),_0x24c359);logger[_0x4d3a('0x12')]('ShowServicenowAccount',_0x24c359,JSON[_0x4d3a('0x23')](_0x141ff1));_0x502a31(_0x141ff1);})[_0x4d3a('0x18')](function(_0x54e440){logger['error'](_0x4d3a('0x25'),_0x54e440['message'],_0x24c359);_0x5630df(_0x546576[_0x4d3a('0x14')](0x1f4,_0x54e440[_0x4d3a('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index ebbf828..e6d4d12 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 _0x1833=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','path'];(function(_0x40172c,_0x171245){var _0x5770ce=function(_0x3398a1){while(--_0x3398a1){_0x40172c['push'](_0x40172c['shift']());}};_0x5770ce(++_0x171245);}(_0x1833,0xd7));var _0x3183=function(_0x2f938f,_0x923379){_0x2f938f=_0x2f938f-0x0;var _0x360c98=_0x1833[_0x2f938f];return _0x360c98;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3183('0x0'));var timeout=require(_0x3183('0x1'));var express=require(_0x3183('0x2'));var router=express[_0x3183('0x3')]();var fs_extra=require(_0x3183('0x4'));var auth=require(_0x3183('0x5'));var interaction=require(_0x3183('0x6'));var config=require(_0x3183('0x7'));var controller=require('./intServicenowConfiguration.controller');router['get']('/',auth[_0x3183('0x8')](),controller[_0x3183('0x9')]);router[_0x3183('0xa')](_0x3183('0xb'),auth[_0x3183('0x8')](),controller[_0x3183('0xc')]);router[_0x3183('0xa')](_0x3183('0xd'),auth[_0x3183('0x8')](),controller[_0x3183('0xe')]);router['get'](_0x3183('0xf'),auth['isAuthenticated'](),controller[_0x3183('0x10')]);router['get'](_0x3183('0x11'),auth[_0x3183('0x8')](),controller[_0x3183('0x12')]);router[_0x3183('0x13')]('/',auth['isAuthenticated'](),controller[_0x3183('0x14')]);router[_0x3183('0x15')](_0x3183('0xb'),auth[_0x3183('0x8')](),controller[_0x3183('0x16')]);router[_0x3183('0x17')](_0x3183('0xb'),auth[_0x3183('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0435=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','/:id','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x49ad79,_0x48ee93){var _0xa4e38a=function(_0x4925c7){while(--_0x4925c7){_0x49ad79['push'](_0x49ad79['shift']());}};_0xa4e38a(++_0x48ee93);}(_0x0435,0xf8));var _0x5043=function(_0x1a0600,_0x41feef){_0x1a0600=_0x1a0600-0x0;var _0x734670=_0x0435[_0x1a0600];return _0x734670;};'use strict';var multer=require(_0x5043('0x0'));var util=require(_0x5043('0x1'));var path=require('path');var timeout=require(_0x5043('0x2'));var express=require(_0x5043('0x3'));var router=express[_0x5043('0x4')]();var fs_extra=require(_0x5043('0x5'));var auth=require(_0x5043('0x6'));var interaction=require(_0x5043('0x7'));var config=require('../../config/environment');var controller=require(_0x5043('0x8'));router[_0x5043('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5043('0x9')](_0x5043('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x5043('0x9')](_0x5043('0xb'),auth[_0x5043('0xc')](),controller[_0x5043('0xd')]);router[_0x5043('0x9')](_0x5043('0xe'),auth['isAuthenticated'](),controller[_0x5043('0xf')]);router[_0x5043('0x9')]('/:id/descriptions',auth[_0x5043('0xc')](),controller['getDescriptions']);router['post']('/',auth[_0x5043('0xc')](),controller['create']);router[_0x5043('0x10')](_0x5043('0xa'),auth[_0x5043('0xc')](),controller[_0x5043('0x11')]);router[_0x5043('0x12')](_0x5043('0xa'),auth[_0x5043('0xc')](),controller[_0x5043('0x13')]);module[_0x5043('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index a8cf737..024dcd2 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 _0xfd44=['STRING','sequelize','exports'];(function(_0x4b1fd8,_0x167551){var _0x1c595a=function(_0x364a97){while(--_0x364a97){_0x4b1fd8['push'](_0x4b1fd8['shift']());}};_0x1c595a(++_0x167551);}(_0xfd44,0x1ea));var _0x4fd4=function(_0x3c6f75,_0x5775e0){_0x3c6f75=_0x3c6f75-0x0;var _0x396881=_0xfd44[_0x3c6f75];return _0x396881;};'use strict';var Sequelize=require(_0x4fd4('0x0'));module[_0x4fd4('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4fd4('0x2')]}}; \ No newline at end of file +var _0xd5fe=['STRING','sequelize','exports'];(function(_0x1fce89,_0x2a243d){var _0x5c00d0=function(_0x3f59e0){while(--_0x3f59e0){_0x1fce89['push'](_0x1fce89['shift']());}};_0x5c00d0(++_0x2a243d);}(_0xd5fe,0x1ae));var _0xed5f=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0xd5fe[_0x494d1f];return _0x457b6e;};'use strict';var Sequelize=require(_0xed5f('0x0'));module[_0xed5f('0x1')]={'name':{'type':Sequelize[_0xed5f('0x2')]},'description':{'type':Sequelize[_0xed5f('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index ffbd50e..bcdaa8b 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 _0x5b85=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','stack','name','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','options','ServicenowConfiguration','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','getFields','findOne','ServicenowField','sort','hasOwnProperty','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js'];(function(_0x187499,_0x5e416a){var _0x2965fe=function(_0xc6645e){while(--_0xc6645e){_0x187499['push'](_0x187499['shift']());}};_0x2965fe(++_0x5e416a);}(_0x5b85,0x90));var _0x55b8=function(_0x45ecf8,_0x5ba41e){_0x45ecf8=_0x45ecf8-0x0;var _0x203b4b=_0x5b85[_0x45ecf8];return _0x203b4b;};'use strict';var emlformat=require(_0x55b8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x55b8('0x1'));var jsonpatch=require(_0x55b8('0x2'));var rp=require('request-promise');var moment=require(_0x55b8('0x3'));var BPromise=require(_0x55b8('0x4'));var Mustache=require(_0x55b8('0x5'));var util=require('util');var path=require(_0x55b8('0x6'));var sox=require(_0x55b8('0x7'));var csv=require(_0x55b8('0x8'));var ejs=require(_0x55b8('0x9'));var fs=require('fs');var fs_extra=require(_0x55b8('0xa'));var _=require('lodash');var squel=require(_0x55b8('0xb'));var crypto=require(_0x55b8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x55b8('0xd'));var toCsv=require(_0x55b8('0x8'));var querystring=require(_0x55b8('0xe'));var Papa=require('papaparse');var Redis=require(_0x55b8('0xf'));var authService=require(_0x55b8('0x10'));var qs=require(_0x55b8('0x11'));var as=require(_0x55b8('0x12'));var hardwareService=require(_0x55b8('0x13'));var logger=require(_0x55b8('0x14'))(_0x55b8('0x15'));var utils=require(_0x55b8('0x16'));var config=require(_0x55b8('0x17'));var licenseUtil=require(_0x55b8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41ad90,_0x36fd79){_0x36fd79=_0x36fd79||0xcc;return function(_0x2cbd91){if(_0x2cbd91){return _0x41ad90[_0x55b8('0x19')](_0x36fd79);}return _0x41ad90[_0x55b8('0x1a')](_0x36fd79)[_0x55b8('0x1b')]();};}function respondWithResult(_0x5a10fd,_0x25a900){_0x25a900=_0x25a900||0xc8;return function(_0x370a45){if(_0x370a45){return _0x5a10fd[_0x55b8('0x1a')](_0x25a900)[_0x55b8('0x1c')](_0x370a45);}};}function respondWithFilteredResult(_0x21952e,_0x2ba8d7){return function(_0x508948){if(_0x508948){var _0x26b31f=typeof _0x2ba8d7[_0x55b8('0x1d')]===_0x55b8('0x1e')&&typeof _0x2ba8d7[_0x55b8('0x1f')]===_0x55b8('0x1e');var _0x50173a=_0x508948[_0x55b8('0x20')];var _0x14e1f5=_0x26b31f?0x0:_0x2ba8d7['offset'];var _0x37a05d=_0x26b31f?_0x508948['count']:_0x2ba8d7[_0x55b8('0x1d')]+_0x2ba8d7[_0x55b8('0x1f')];var _0x4007f8;if(_0x37a05d>=_0x50173a){_0x37a05d=_0x50173a;_0x4007f8=0xc8;}else{_0x4007f8=0xce;}_0x21952e[_0x55b8('0x1a')](_0x4007f8);return _0x21952e['set']('Content-Range',_0x14e1f5+'-'+_0x37a05d+'/'+_0x50173a)[_0x55b8('0x1c')](_0x508948);}return null;};}function patchUpdates(_0x974cbd){return function(_0x1ae993){try{jsonpatch[_0x55b8('0x21')](_0x1ae993,_0x974cbd,!![]);}catch(_0x4684f3){return BPromise[_0x55b8('0x22')](_0x4684f3);}return _0x1ae993[_0x55b8('0x23')]();};}function saveUpdates(_0x181b55,_0x2c8852){return function(_0x24a1f4){if(_0x24a1f4){return _0x24a1f4[_0x55b8('0x24')](_0x181b55)[_0x55b8('0x25')](function(_0x28a806){return _0x28a806;});}return null;};}function removeEntity(_0x3226bb,_0x5784f0){return function(_0x5b9f2f){if(_0x5b9f2f){return _0x5b9f2f['destroy']()[_0x55b8('0x25')](function(){_0x3226bb[_0x55b8('0x1a')](0xcc)[_0x55b8('0x1b')]();});}};}function handleEntityNotFound(_0x490a27,_0x83f44e){return function(_0x349257){if(!_0x349257){_0x490a27[_0x55b8('0x19')](0x194);}return _0x349257;};}function handleError(_0x439fef,_0x4cd4cb){_0x4cd4cb=_0x4cd4cb||0x1f4;return function(_0x1b116e){logger['error'](_0x1b116e[_0x55b8('0x26')]);if(_0x1b116e[_0x55b8('0x27')]){delete _0x1b116e[_0x55b8('0x27')];}_0x439fef[_0x55b8('0x1a')](_0x4cd4cb)['send'](_0x1b116e);};}exports['index']=function(_0xaaa784,_0x2523b2){var _0x18337f={},_0x39de39={},_0x4c61f3={'count':0x0,'rows':[]};var _0x307738=_[_0x55b8('0x28')](db['ServicenowConfiguration'][_0x55b8('0x29')],function(_0x1f838f){return{'name':_0x1f838f[_0x55b8('0x2a')],'type':_0x1f838f[_0x55b8('0x2b')][_0x55b8('0x2c')]};});_0x39de39[_0x55b8('0x2d')]=_[_0x55b8('0x28')](_0x307738,_0x55b8('0x27'));_0x39de39[_0x55b8('0x2e')]=_['keys'](_0xaaa784['query']);_0x39de39[_0x55b8('0x2f')]=_['intersection'](_0x39de39[_0x55b8('0x2d')],_0x39de39[_0x55b8('0x2e')]);_0x18337f[_0x55b8('0x30')]=_[_0x55b8('0x31')](_0x39de39[_0x55b8('0x2d')],qs[_0x55b8('0x32')](_0xaaa784[_0x55b8('0x2e')][_0x55b8('0x32')]));_0x18337f['attributes']=_0x18337f[_0x55b8('0x30')][_0x55b8('0x33')]?_0x18337f[_0x55b8('0x30')]:_0x39de39['model'];if(!_0xaaa784[_0x55b8('0x2e')]['hasOwnProperty'](_0x55b8('0x34'))){_0x18337f[_0x55b8('0x1f')]=qs[_0x55b8('0x1f')](_0xaaa784[_0x55b8('0x2e')][_0x55b8('0x1f')]);_0x18337f[_0x55b8('0x1d')]=qs['offset'](_0xaaa784[_0x55b8('0x2e')]['offset']);}_0x18337f[_0x55b8('0x35')]=qs['sort'](_0xaaa784[_0x55b8('0x2e')]['sort']);_0x18337f[_0x55b8('0x36')]=qs['filters'](_[_0x55b8('0x37')](_0xaaa784[_0x55b8('0x2e')],_0x39de39[_0x55b8('0x2f')]),_0x307738);if(_0xaaa784['query'][_0x55b8('0x38')]){_0x18337f[_0x55b8('0x36')]=_[_0x55b8('0x39')](_0x18337f[_0x55b8('0x36')],{'$or':_[_0x55b8('0x28')](_0x307738,function(_0x2d330d){if(_0x2d330d[_0x55b8('0x2b')]!==_0x55b8('0x3a')){var _0x4426eb={};_0x4426eb[_0x2d330d[_0x55b8('0x27')]]={'$like':'%'+_0xaaa784['query']['filter']+'%'};return _0x4426eb;}})});}_0x18337f=_[_0x55b8('0x39')]({},_0x18337f,_0xaaa784[_0x55b8('0x3b')]);var _0x2f25de={'where':_0x18337f[_0x55b8('0x36')]};return db[_0x55b8('0x3c')][_0x55b8('0x20')](_0x2f25de)['then'](function(_0x5dfb1c){_0x4c61f3['count']=_0x5dfb1c;if(_0xaaa784[_0x55b8('0x2e')][_0x55b8('0x3d')]){_0x18337f['include']=[{'all':!![]}];}return db[_0x55b8('0x3c')][_0x55b8('0x3e')](_0x18337f);})[_0x55b8('0x25')](function(_0x50d678){_0x4c61f3[_0x55b8('0x3f')]=_0x50d678;return _0x4c61f3;})['then'](respondWithFilteredResult(_0x2523b2,_0x18337f))[_0x55b8('0x40')](handleError(_0x2523b2,null));};exports[_0x55b8('0x41')]=function(_0x4acea4,_0x50f081){var _0x38f107={'raw':![],'where':{'id':_0x4acea4[_0x55b8('0x42')]['id']}},_0xcfc422={};_0xcfc422[_0x55b8('0x2d')]=_['keys'](db[_0x55b8('0x3c')][_0x55b8('0x29')]);_0xcfc422['query']=_[_0x55b8('0x43')](_0x4acea4[_0x55b8('0x2e')]);_0xcfc422[_0x55b8('0x2f')]=_['intersection'](_0xcfc422[_0x55b8('0x2d')],_0xcfc422[_0x55b8('0x2e')]);_0x38f107[_0x55b8('0x30')]=_['intersection'](_0xcfc422[_0x55b8('0x2d')],qs[_0x55b8('0x32')](_0x4acea4[_0x55b8('0x2e')][_0x55b8('0x32')]));_0x38f107[_0x55b8('0x30')]=_0x38f107[_0x55b8('0x30')][_0x55b8('0x33')]?_0x38f107[_0x55b8('0x30')]:_0xcfc422[_0x55b8('0x2d')];if(_0x4acea4[_0x55b8('0x2e')][_0x55b8('0x3d')]){_0x38f107[_0x55b8('0x44')]=[{'all':!![]}];}_0x38f107=_[_0x55b8('0x39')]({},_0x38f107,_0x4acea4[_0x55b8('0x3b')]);return db['ServicenowConfiguration'][_0x55b8('0x45')](_0x38f107)[_0x55b8('0x25')](handleEntityNotFound(_0x50f081,null))['then'](respondWithResult(_0x50f081,null))[_0x55b8('0x40')](handleError(_0x50f081,null));};exports['create']=function(_0x8ed06,_0x5f3539){return db['ServicenowConfiguration'][_0x55b8('0x46')](_0x8ed06[_0x55b8('0x47')],{})['then'](respondWithResult(_0x5f3539,0xc9))[_0x55b8('0x40')](handleError(_0x5f3539,null));};exports[_0x55b8('0x24')]=function(_0x10082e,_0x2a16e4){if(_0x10082e['body']['id']){delete _0x10082e[_0x55b8('0x47')]['id'];}return db[_0x55b8('0x3c')][_0x55b8('0x45')]({'where':{'id':_0x10082e[_0x55b8('0x42')]['id']}})[_0x55b8('0x25')](handleEntityNotFound(_0x2a16e4,null))[_0x55b8('0x25')](saveUpdates(_0x10082e[_0x55b8('0x47')],null))['then'](respondWithResult(_0x2a16e4,null))[_0x55b8('0x40')](handleError(_0x2a16e4,null));};exports['destroy']=function(_0x282c4c,_0x499772){return db[_0x55b8('0x3c')][_0x55b8('0x45')]({'where':{'id':_0x282c4c[_0x55b8('0x42')]['id']}})[_0x55b8('0x25')](handleEntityNotFound(_0x499772,null))['then'](removeEntity(_0x499772,null))['catch'](handleError(_0x499772,null));};exports[_0x55b8('0x48')]=function(_0x403700,_0x190dd8,_0x507dd2){var _0x2f2a55={};var _0x114474={};var _0x368f49;var _0x26e60a;return db['ServicenowConfiguration'][_0x55b8('0x49')]({'where':{'id':_0x403700[_0x55b8('0x42')]['id']}})[_0x55b8('0x25')](handleEntityNotFound(_0x190dd8,null))[_0x55b8('0x25')](function(_0x596f2c){if(_0x596f2c){_0x368f49=_0x596f2c;_0x114474[_0x55b8('0x2d')]=_[_0x55b8('0x43')](db[_0x55b8('0x4a')][_0x55b8('0x29')]);_0x114474[_0x55b8('0x2e')]=_['keys'](_0x403700[_0x55b8('0x2e')]);_0x114474[_0x55b8('0x2f')]=_[_0x55b8('0x31')](_0x114474[_0x55b8('0x2d')],_0x114474[_0x55b8('0x2e')]);_0x2f2a55[_0x55b8('0x30')]=_[_0x55b8('0x31')](_0x114474[_0x55b8('0x2d')],qs[_0x55b8('0x32')](_0x403700[_0x55b8('0x2e')][_0x55b8('0x32')]));_0x2f2a55[_0x55b8('0x30')]=_0x2f2a55[_0x55b8('0x30')][_0x55b8('0x33')]?_0x2f2a55[_0x55b8('0x30')]:_0x114474['model'];_0x2f2a55[_0x55b8('0x35')]=qs[_0x55b8('0x4b')](_0x403700['query'][_0x55b8('0x4b')]);_0x2f2a55[_0x55b8('0x36')]=qs[_0x55b8('0x2f')](_[_0x55b8('0x37')](_0x403700[_0x55b8('0x2e')],_0x114474[_0x55b8('0x2f')]));if(_0x403700[_0x55b8('0x2e')][_0x55b8('0x38')]){_0x2f2a55['where']=_['merge'](_0x2f2a55[_0x55b8('0x36')],{'$or':_[_0x55b8('0x28')](_0x2f2a55[_0x55b8('0x30')],function(_0x154945){var _0x40d744={};_0x40d744[_0x154945]={'$like':'%'+_0x403700[_0x55b8('0x2e')][_0x55b8('0x38')]+'%'};return _0x40d744;})});}_0x2f2a55=_[_0x55b8('0x39')]({},_0x2f2a55,_0x403700[_0x55b8('0x3b')]);return _0x368f49[_0x55b8('0x48')](_0x2f2a55);}})['then'](function(_0x3004bd){if(_0x3004bd){_0x26e60a=_0x3004bd[_0x55b8('0x33')];if(!_0x403700[_0x55b8('0x2e')][_0x55b8('0x4c')](_0x55b8('0x34'))){_0x2f2a55['limit']=qs[_0x55b8('0x1f')](_0x403700['query'][_0x55b8('0x1f')]);_0x2f2a55[_0x55b8('0x1d')]=qs['offset'](_0x403700[_0x55b8('0x2e')][_0x55b8('0x1d')]);}return _0x368f49[_0x55b8('0x48')](_0x2f2a55);}})['then'](function(_0x54a4cb){if(_0x54a4cb){return _0x54a4cb?{'count':_0x26e60a,'rows':_0x54a4cb}:null;}})[_0x55b8('0x25')](respondWithResult(_0x190dd8,null))['catch'](handleError(_0x190dd8,null));};exports[_0x55b8('0x4d')]=function(_0x487581,_0x5388b5,_0x21e04d){var _0x567f0b={};var _0x5ee5ad={};var _0x541526;var _0x4cc7ad;return db['ServicenowConfiguration'][_0x55b8('0x49')]({'where':{'id':_0x487581[_0x55b8('0x42')]['id']}})[_0x55b8('0x25')](handleEntityNotFound(_0x5388b5,null))[_0x55b8('0x25')](function(_0xd30cc2){if(_0xd30cc2){_0x541526=_0xd30cc2;_0x5ee5ad[_0x55b8('0x2d')]=_[_0x55b8('0x43')](db['ServicenowField'][_0x55b8('0x29')]);_0x5ee5ad[_0x55b8('0x2e')]=_['keys'](_0x487581[_0x55b8('0x2e')]);_0x5ee5ad['filters']=_[_0x55b8('0x31')](_0x5ee5ad['model'],_0x5ee5ad[_0x55b8('0x2e')]);_0x567f0b[_0x55b8('0x30')]=_[_0x55b8('0x31')](_0x5ee5ad[_0x55b8('0x2d')],qs[_0x55b8('0x32')](_0x487581[_0x55b8('0x2e')][_0x55b8('0x32')]));_0x567f0b[_0x55b8('0x30')]=_0x567f0b['attributes'][_0x55b8('0x33')]?_0x567f0b[_0x55b8('0x30')]:_0x5ee5ad['model'];_0x567f0b[_0x55b8('0x35')]=qs[_0x55b8('0x4b')](_0x487581['query'][_0x55b8('0x4b')]);_0x567f0b[_0x55b8('0x36')]=qs[_0x55b8('0x2f')](_[_0x55b8('0x37')](_0x487581['query'],_0x5ee5ad[_0x55b8('0x2f')]));if(_0x487581[_0x55b8('0x2e')][_0x55b8('0x38')]){_0x567f0b[_0x55b8('0x36')]=_[_0x55b8('0x39')](_0x567f0b['where'],{'$or':_[_0x55b8('0x28')](_0x567f0b['attributes'],function(_0x47f0b9){var _0x4e79b9={};_0x4e79b9[_0x47f0b9]={'$like':'%'+_0x487581['query'][_0x55b8('0x38')]+'%'};return _0x4e79b9;})});}_0x567f0b=_[_0x55b8('0x39')]({},_0x567f0b,_0x487581[_0x55b8('0x3b')]);return _0x541526[_0x55b8('0x4d')](_0x567f0b);}})[_0x55b8('0x25')](function(_0x15b62){if(_0x15b62){_0x4cc7ad=_0x15b62['length'];if(!_0x487581[_0x55b8('0x2e')][_0x55b8('0x4c')](_0x55b8('0x34'))){_0x567f0b[_0x55b8('0x1f')]=qs[_0x55b8('0x1f')](_0x487581[_0x55b8('0x2e')][_0x55b8('0x1f')]);_0x567f0b['offset']=qs[_0x55b8('0x1d')](_0x487581[_0x55b8('0x2e')][_0x55b8('0x1d')]);}return _0x541526[_0x55b8('0x4d')](_0x567f0b);}})[_0x55b8('0x25')](function(_0x17f32a){if(_0x17f32a){return _0x17f32a?{'count':_0x4cc7ad,'rows':_0x17f32a}:null;}})['then'](respondWithResult(_0x5388b5,null))[_0x55b8('0x40')](handleError(_0x5388b5,null));};exports[_0x55b8('0x4e')]=function(_0x30c877,_0x13b44d,_0xd5bc9d){var _0x1b82e2={};var _0x3ff910={};var _0x542d6c;var _0x57ef85;return db[_0x55b8('0x3c')][_0x55b8('0x49')]({'where':{'id':_0x30c877[_0x55b8('0x42')]['id']}})[_0x55b8('0x25')](handleEntityNotFound(_0x13b44d,null))[_0x55b8('0x25')](function(_0x423fb4){if(_0x423fb4){_0x542d6c=_0x423fb4;_0x3ff910[_0x55b8('0x2d')]=_[_0x55b8('0x43')](db[_0x55b8('0x4a')][_0x55b8('0x29')]);_0x3ff910['query']=_[_0x55b8('0x43')](_0x30c877['query']);_0x3ff910[_0x55b8('0x2f')]=_[_0x55b8('0x31')](_0x3ff910['model'],_0x3ff910[_0x55b8('0x2e')]);_0x1b82e2['attributes']=_['intersection'](_0x3ff910[_0x55b8('0x2d')],qs[_0x55b8('0x32')](_0x30c877['query']['fields']));_0x1b82e2['attributes']=_0x1b82e2[_0x55b8('0x30')][_0x55b8('0x33')]?_0x1b82e2[_0x55b8('0x30')]:_0x3ff910[_0x55b8('0x2d')];_0x1b82e2['order']=qs['sort'](_0x30c877[_0x55b8('0x2e')][_0x55b8('0x4b')]);_0x1b82e2['where']=qs['filters'](_[_0x55b8('0x37')](_0x30c877['query'],_0x3ff910[_0x55b8('0x2f')]));if(_0x30c877[_0x55b8('0x2e')][_0x55b8('0x38')]){_0x1b82e2[_0x55b8('0x36')]=_[_0x55b8('0x39')](_0x1b82e2[_0x55b8('0x36')],{'$or':_[_0x55b8('0x28')](_0x1b82e2['attributes'],function(_0xb66bc6){var _0x1a0e9c={};_0x1a0e9c[_0xb66bc6]={'$like':'%'+_0x30c877[_0x55b8('0x2e')][_0x55b8('0x38')]+'%'};return _0x1a0e9c;})});}_0x1b82e2=_[_0x55b8('0x39')]({},_0x1b82e2,_0x30c877[_0x55b8('0x3b')]);return _0x542d6c[_0x55b8('0x4e')](_0x1b82e2);}})[_0x55b8('0x25')](function(_0x58ae9e){if(_0x58ae9e){_0x57ef85=_0x58ae9e[_0x55b8('0x33')];if(!_0x30c877[_0x55b8('0x2e')]['hasOwnProperty'](_0x55b8('0x34'))){_0x1b82e2[_0x55b8('0x1f')]=qs[_0x55b8('0x1f')](_0x30c877[_0x55b8('0x2e')][_0x55b8('0x1f')]);_0x1b82e2['offset']=qs['offset'](_0x30c877[_0x55b8('0x2e')][_0x55b8('0x1d')]);}return _0x542d6c[_0x55b8('0x4e')](_0x1b82e2);}})[_0x55b8('0x25')](function(_0x533494){if(_0x533494){return _0x533494?{'count':_0x57ef85,'rows':_0x533494}:null;}})[_0x55b8('0x25')](respondWithResult(_0x13b44d,null))['catch'](handleError(_0x13b44d,null));}; \ No newline at end of file +var _0xc8ec=['Content-Range','json','apply','reject','save','update','then','error','stack','name','send','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','create','body','destroy','ServicenowField','length','pick','getFields','getSubjects','findOne','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set'];(function(_0x3d0975,_0x198b9f){var _0x33b959=function(_0x411871){while(--_0x411871){_0x3d0975['push'](_0x3d0975['shift']());}};_0x33b959(++_0x198b9f);}(_0xc8ec,0xcd));var _0xcc8e=function(_0x4d1651,_0x3e1949){_0x4d1651=_0x4d1651-0x0;var _0x5686e7=_0xc8ec[_0x4d1651];return _0x5686e7;};'use strict';var emlformat=require(_0xcc8e('0x0'));var rimraf=require(_0xcc8e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcc8e('0x2'));var rp=require(_0xcc8e('0x3'));var moment=require(_0xcc8e('0x4'));var BPromise=require(_0xcc8e('0x5'));var Mustache=require(_0xcc8e('0x6'));var util=require('util');var path=require('path');var sox=require(_0xcc8e('0x7'));var csv=require(_0xcc8e('0x8'));var ejs=require(_0xcc8e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcc8e('0xa'));var squel=require(_0xcc8e('0xb'));var crypto=require(_0xcc8e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcc8e('0x8'));var querystring=require(_0xcc8e('0xd'));var Papa=require(_0xcc8e('0xe'));var Redis=require(_0xcc8e('0xf'));var authService=require(_0xcc8e('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc8e('0x11'))(_0xcc8e('0x12'));var utils=require(_0xcc8e('0x13'));var config=require(_0xcc8e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xcc8e('0x15'))['db'];function respondWithStatusCode(_0x452ac3,_0x3fd537){_0x3fd537=_0x3fd537||0xcc;return function(_0x1a1b38){if(_0x1a1b38){return _0x452ac3[_0xcc8e('0x16')](_0x3fd537);}return _0x452ac3[_0xcc8e('0x17')](_0x3fd537)['end']();};}function respondWithResult(_0x363e2e,_0x11c743){_0x11c743=_0x11c743||0xc8;return function(_0x435ed6){if(_0x435ed6){return _0x363e2e['status'](_0x11c743)['json'](_0x435ed6);}};}function respondWithFilteredResult(_0x4944dc,_0x34d9a4){return function(_0x330e02){if(_0x330e02){var _0x48f2b3=typeof _0x34d9a4['offset']===_0xcc8e('0x18')&&typeof _0x34d9a4[_0xcc8e('0x19')]==='undefined';var _0x2240da=_0x330e02[_0xcc8e('0x1a')];var _0x23447d=_0x48f2b3?0x0:_0x34d9a4['offset'];var _0x5654a7=_0x48f2b3?_0x330e02['count']:_0x34d9a4[_0xcc8e('0x1b')]+_0x34d9a4['limit'];var _0x1d1ec1;if(_0x5654a7>=_0x2240da){_0x5654a7=_0x2240da;_0x1d1ec1=0xc8;}else{_0x1d1ec1=0xce;}_0x4944dc[_0xcc8e('0x17')](_0x1d1ec1);return _0x4944dc[_0xcc8e('0x1c')](_0xcc8e('0x1d'),_0x23447d+'-'+_0x5654a7+'/'+_0x2240da)[_0xcc8e('0x1e')](_0x330e02);}return null;};}function patchUpdates(_0x223d66){return function(_0x49f713){try{jsonpatch[_0xcc8e('0x1f')](_0x49f713,_0x223d66,!![]);}catch(_0x4c4f2a){return BPromise[_0xcc8e('0x20')](_0x4c4f2a);}return _0x49f713[_0xcc8e('0x21')]();};}function saveUpdates(_0x5542b7,_0x4bd772){return function(_0xf32c92){if(_0xf32c92){return _0xf32c92[_0xcc8e('0x22')](_0x5542b7)[_0xcc8e('0x23')](function(_0x1e36fa){return _0x1e36fa;});}return null;};}function removeEntity(_0x2c525d,_0x1377b5){return function(_0x4208d9){if(_0x4208d9){return _0x4208d9['destroy']()[_0xcc8e('0x23')](function(){_0x2c525d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x248938,_0xb8a446){return function(_0x547ec7){if(!_0x547ec7){_0x248938[_0xcc8e('0x16')](0x194);}return _0x547ec7;};}function handleError(_0x31acc8,_0x375d59){_0x375d59=_0x375d59||0x1f4;return function(_0x49b433){logger[_0xcc8e('0x24')](_0x49b433[_0xcc8e('0x25')]);if(_0x49b433[_0xcc8e('0x26')]){delete _0x49b433[_0xcc8e('0x26')];}_0x31acc8[_0xcc8e('0x17')](_0x375d59)[_0xcc8e('0x27')](_0x49b433);};}exports['index']=function(_0x386546,_0x43b946){var _0x541494={},_0x5bd7ce={},_0x51670a={'count':0x0,'rows':[]};var _0x523b29=_[_0xcc8e('0x28')](db[_0xcc8e('0x29')][_0xcc8e('0x2a')],function(_0x3425a1){return{'name':_0x3425a1[_0xcc8e('0x2b')],'type':_0x3425a1[_0xcc8e('0x2c')][_0xcc8e('0x2d')]};});_0x5bd7ce[_0xcc8e('0x2e')]=_[_0xcc8e('0x28')](_0x523b29,'name');_0x5bd7ce[_0xcc8e('0x2f')]=_['keys'](_0x386546[_0xcc8e('0x2f')]);_0x5bd7ce[_0xcc8e('0x30')]=_[_0xcc8e('0x31')](_0x5bd7ce[_0xcc8e('0x2e')],_0x5bd7ce[_0xcc8e('0x2f')]);_0x541494[_0xcc8e('0x32')]=_[_0xcc8e('0x31')](_0x5bd7ce[_0xcc8e('0x2e')],qs[_0xcc8e('0x33')](_0x386546[_0xcc8e('0x2f')][_0xcc8e('0x33')]));_0x541494[_0xcc8e('0x32')]=_0x541494[_0xcc8e('0x32')]['length']?_0x541494[_0xcc8e('0x32')]:_0x5bd7ce[_0xcc8e('0x2e')];if(!_0x386546[_0xcc8e('0x2f')][_0xcc8e('0x34')](_0xcc8e('0x35'))){_0x541494[_0xcc8e('0x19')]=qs['limit'](_0x386546[_0xcc8e('0x2f')]['limit']);_0x541494['offset']=qs[_0xcc8e('0x1b')](_0x386546[_0xcc8e('0x2f')][_0xcc8e('0x1b')]);}_0x541494[_0xcc8e('0x36')]=qs[_0xcc8e('0x37')](_0x386546[_0xcc8e('0x2f')][_0xcc8e('0x37')]);_0x541494[_0xcc8e('0x38')]=qs[_0xcc8e('0x30')](_['pick'](_0x386546[_0xcc8e('0x2f')],_0x5bd7ce[_0xcc8e('0x30')]),_0x523b29);if(_0x386546[_0xcc8e('0x2f')][_0xcc8e('0x39')]){_0x541494[_0xcc8e('0x38')]=_[_0xcc8e('0x3a')](_0x541494['where'],{'$or':_[_0xcc8e('0x28')](_0x523b29,function(_0x591d9c){if(_0x591d9c[_0xcc8e('0x2c')]!==_0xcc8e('0x3b')){var _0xc64701={};_0xc64701[_0x591d9c[_0xcc8e('0x26')]]={'$like':'%'+_0x386546[_0xcc8e('0x2f')][_0xcc8e('0x39')]+'%'};return _0xc64701;}})});}_0x541494=_[_0xcc8e('0x3a')]({},_0x541494,_0x386546[_0xcc8e('0x3c')]);var _0x523388={'where':_0x541494[_0xcc8e('0x38')]};return db[_0xcc8e('0x29')][_0xcc8e('0x1a')](_0x523388)[_0xcc8e('0x23')](function(_0x28ccf6){_0x51670a['count']=_0x28ccf6;if(_0x386546[_0xcc8e('0x2f')][_0xcc8e('0x3d')]){_0x541494[_0xcc8e('0x3e')]=[{'all':!![]}];}return db[_0xcc8e('0x29')][_0xcc8e('0x3f')](_0x541494);})[_0xcc8e('0x23')](function(_0x5b9c46){_0x51670a[_0xcc8e('0x40')]=_0x5b9c46;return _0x51670a;})[_0xcc8e('0x23')](respondWithFilteredResult(_0x43b946,_0x541494))[_0xcc8e('0x41')](handleError(_0x43b946,null));};exports['show']=function(_0x2c21fd,_0x1e6793){var _0x2ac8f5={'raw':![],'where':{'id':_0x2c21fd[_0xcc8e('0x42')]['id']}},_0x337ac6={};_0x337ac6[_0xcc8e('0x2e')]=_[_0xcc8e('0x43')](db[_0xcc8e('0x29')][_0xcc8e('0x2a')]);_0x337ac6[_0xcc8e('0x2f')]=_[_0xcc8e('0x43')](_0x2c21fd[_0xcc8e('0x2f')]);_0x337ac6[_0xcc8e('0x30')]=_['intersection'](_0x337ac6[_0xcc8e('0x2e')],_0x337ac6[_0xcc8e('0x2f')]);_0x2ac8f5[_0xcc8e('0x32')]=_[_0xcc8e('0x31')](_0x337ac6[_0xcc8e('0x2e')],qs[_0xcc8e('0x33')](_0x2c21fd[_0xcc8e('0x2f')][_0xcc8e('0x33')]));_0x2ac8f5[_0xcc8e('0x32')]=_0x2ac8f5['attributes']['length']?_0x2ac8f5['attributes']:_0x337ac6[_0xcc8e('0x2e')];if(_0x2c21fd[_0xcc8e('0x2f')][_0xcc8e('0x3d')]){_0x2ac8f5[_0xcc8e('0x3e')]=[{'all':!![]}];}_0x2ac8f5=_[_0xcc8e('0x3a')]({},_0x2ac8f5,_0x2c21fd['options']);return db['ServicenowConfiguration']['find'](_0x2ac8f5)['then'](handleEntityNotFound(_0x1e6793,null))['then'](respondWithResult(_0x1e6793,null))['catch'](handleError(_0x1e6793,null));};exports[_0xcc8e('0x44')]=function(_0x38c7c9,_0x3de678){return db[_0xcc8e('0x29')][_0xcc8e('0x44')](_0x38c7c9[_0xcc8e('0x45')],{})[_0xcc8e('0x23')](respondWithResult(_0x3de678,0xc9))[_0xcc8e('0x41')](handleError(_0x3de678,null));};exports['update']=function(_0x249319,_0x2d3276){if(_0x249319[_0xcc8e('0x45')]['id']){delete _0x249319[_0xcc8e('0x45')]['id'];}return db[_0xcc8e('0x29')]['find']({'where':{'id':_0x249319[_0xcc8e('0x42')]['id']}})['then'](handleEntityNotFound(_0x2d3276,null))['then'](saveUpdates(_0x249319['body'],null))[_0xcc8e('0x23')](respondWithResult(_0x2d3276,null))[_0xcc8e('0x41')](handleError(_0x2d3276,null));};exports[_0xcc8e('0x46')]=function(_0x52c468,_0x53645d){return db[_0xcc8e('0x29')]['find']({'where':{'id':_0x52c468[_0xcc8e('0x42')]['id']}})['then'](handleEntityNotFound(_0x53645d,null))[_0xcc8e('0x23')](removeEntity(_0x53645d,null))[_0xcc8e('0x41')](handleError(_0x53645d,null));};exports['getFields']=function(_0x11c16c,_0x1f700a,_0x5b8bd3){var _0x81332={};var _0x2f2689={};var _0x27e138;var _0x24e8ea;return db[_0xcc8e('0x29')]['findOne']({'where':{'id':_0x11c16c[_0xcc8e('0x42')]['id']}})[_0xcc8e('0x23')](handleEntityNotFound(_0x1f700a,null))[_0xcc8e('0x23')](function(_0x26cd0e){if(_0x26cd0e){_0x27e138=_0x26cd0e;_0x2f2689[_0xcc8e('0x2e')]=_['keys'](db[_0xcc8e('0x47')]['rawAttributes']);_0x2f2689[_0xcc8e('0x2f')]=_[_0xcc8e('0x43')](_0x11c16c['query']);_0x2f2689[_0xcc8e('0x30')]=_[_0xcc8e('0x31')](_0x2f2689[_0xcc8e('0x2e')],_0x2f2689[_0xcc8e('0x2f')]);_0x81332[_0xcc8e('0x32')]=_[_0xcc8e('0x31')](_0x2f2689['model'],qs['fields'](_0x11c16c[_0xcc8e('0x2f')][_0xcc8e('0x33')]));_0x81332[_0xcc8e('0x32')]=_0x81332['attributes'][_0xcc8e('0x48')]?_0x81332[_0xcc8e('0x32')]:_0x2f2689[_0xcc8e('0x2e')];_0x81332[_0xcc8e('0x36')]=qs[_0xcc8e('0x37')](_0x11c16c[_0xcc8e('0x2f')]['sort']);_0x81332['where']=qs[_0xcc8e('0x30')](_[_0xcc8e('0x49')](_0x11c16c[_0xcc8e('0x2f')],_0x2f2689[_0xcc8e('0x30')]));if(_0x11c16c[_0xcc8e('0x2f')][_0xcc8e('0x39')]){_0x81332[_0xcc8e('0x38')]=_['merge'](_0x81332[_0xcc8e('0x38')],{'$or':_[_0xcc8e('0x28')](_0x81332[_0xcc8e('0x32')],function(_0xc71d52){var _0x254a3b={};_0x254a3b[_0xc71d52]={'$like':'%'+_0x11c16c[_0xcc8e('0x2f')]['filter']+'%'};return _0x254a3b;})});}_0x81332=_[_0xcc8e('0x3a')]({},_0x81332,_0x11c16c[_0xcc8e('0x3c')]);return _0x27e138[_0xcc8e('0x4a')](_0x81332);}})[_0xcc8e('0x23')](function(_0x42de93){if(_0x42de93){_0x24e8ea=_0x42de93[_0xcc8e('0x48')];if(!_0x11c16c[_0xcc8e('0x2f')]['hasOwnProperty']('nolimit')){_0x81332['limit']=qs['limit'](_0x11c16c[_0xcc8e('0x2f')][_0xcc8e('0x19')]);_0x81332['offset']=qs[_0xcc8e('0x1b')](_0x11c16c[_0xcc8e('0x2f')][_0xcc8e('0x1b')]);}return _0x27e138['getFields'](_0x81332);}})['then'](function(_0xc0d30b){if(_0xc0d30b){return _0xc0d30b?{'count':_0x24e8ea,'rows':_0xc0d30b}:null;}})[_0xcc8e('0x23')](respondWithResult(_0x1f700a,null))[_0xcc8e('0x41')](handleError(_0x1f700a,null));};exports[_0xcc8e('0x4b')]=function(_0x7a88fc,_0x1789cc,_0x36e76c){var _0x237676={};var _0x385e36={};var _0x40dc92;var _0xbf5ce1;return db[_0xcc8e('0x29')][_0xcc8e('0x4c')]({'where':{'id':_0x7a88fc['params']['id']}})[_0xcc8e('0x23')](handleEntityNotFound(_0x1789cc,null))['then'](function(_0x3ec005){if(_0x3ec005){_0x40dc92=_0x3ec005;_0x385e36[_0xcc8e('0x2e')]=_['keys'](db[_0xcc8e('0x47')][_0xcc8e('0x2a')]);_0x385e36[_0xcc8e('0x2f')]=_[_0xcc8e('0x43')](_0x7a88fc[_0xcc8e('0x2f')]);_0x385e36[_0xcc8e('0x30')]=_[_0xcc8e('0x31')](_0x385e36[_0xcc8e('0x2e')],_0x385e36[_0xcc8e('0x2f')]);_0x237676[_0xcc8e('0x32')]=_['intersection'](_0x385e36[_0xcc8e('0x2e')],qs[_0xcc8e('0x33')](_0x7a88fc[_0xcc8e('0x2f')][_0xcc8e('0x33')]));_0x237676[_0xcc8e('0x32')]=_0x237676[_0xcc8e('0x32')][_0xcc8e('0x48')]?_0x237676[_0xcc8e('0x32')]:_0x385e36[_0xcc8e('0x2e')];_0x237676[_0xcc8e('0x36')]=qs[_0xcc8e('0x37')](_0x7a88fc[_0xcc8e('0x2f')][_0xcc8e('0x37')]);_0x237676[_0xcc8e('0x38')]=qs[_0xcc8e('0x30')](_[_0xcc8e('0x49')](_0x7a88fc[_0xcc8e('0x2f')],_0x385e36[_0xcc8e('0x30')]));if(_0x7a88fc[_0xcc8e('0x2f')][_0xcc8e('0x39')]){_0x237676[_0xcc8e('0x38')]=_[_0xcc8e('0x3a')](_0x237676[_0xcc8e('0x38')],{'$or':_[_0xcc8e('0x28')](_0x237676[_0xcc8e('0x32')],function(_0x4912a4){var _0x263fb2={};_0x263fb2[_0x4912a4]={'$like':'%'+_0x7a88fc[_0xcc8e('0x2f')][_0xcc8e('0x39')]+'%'};return _0x263fb2;})});}_0x237676=_['merge']({},_0x237676,_0x7a88fc[_0xcc8e('0x3c')]);return _0x40dc92[_0xcc8e('0x4b')](_0x237676);}})[_0xcc8e('0x23')](function(_0x300c5f){if(_0x300c5f){_0xbf5ce1=_0x300c5f['length'];if(!_0x7a88fc[_0xcc8e('0x2f')][_0xcc8e('0x34')](_0xcc8e('0x35'))){_0x237676[_0xcc8e('0x19')]=qs[_0xcc8e('0x19')](_0x7a88fc[_0xcc8e('0x2f')]['limit']);_0x237676[_0xcc8e('0x1b')]=qs[_0xcc8e('0x1b')](_0x7a88fc[_0xcc8e('0x2f')][_0xcc8e('0x1b')]);}return _0x40dc92[_0xcc8e('0x4b')](_0x237676);}})[_0xcc8e('0x23')](function(_0x5c87da){if(_0x5c87da){return _0x5c87da?{'count':_0xbf5ce1,'rows':_0x5c87da}:null;}})[_0xcc8e('0x23')](respondWithResult(_0x1789cc,null))[_0xcc8e('0x41')](handleError(_0x1789cc,null));};exports[_0xcc8e('0x4d')]=function(_0x60ca9b,_0x321c82,_0x196307){var _0x3e9944={};var _0x32529e={};var _0x482c24;var _0x68353d;return db['ServicenowConfiguration'][_0xcc8e('0x4c')]({'where':{'id':_0x60ca9b[_0xcc8e('0x42')]['id']}})[_0xcc8e('0x23')](handleEntityNotFound(_0x321c82,null))[_0xcc8e('0x23')](function(_0x4a3385){if(_0x4a3385){_0x482c24=_0x4a3385;_0x32529e['model']=_[_0xcc8e('0x43')](db[_0xcc8e('0x47')][_0xcc8e('0x2a')]);_0x32529e['query']=_[_0xcc8e('0x43')](_0x60ca9b['query']);_0x32529e[_0xcc8e('0x30')]=_[_0xcc8e('0x31')](_0x32529e[_0xcc8e('0x2e')],_0x32529e[_0xcc8e('0x2f')]);_0x3e9944['attributes']=_[_0xcc8e('0x31')](_0x32529e[_0xcc8e('0x2e')],qs[_0xcc8e('0x33')](_0x60ca9b['query'][_0xcc8e('0x33')]));_0x3e9944[_0xcc8e('0x32')]=_0x3e9944['attributes'][_0xcc8e('0x48')]?_0x3e9944[_0xcc8e('0x32')]:_0x32529e['model'];_0x3e9944[_0xcc8e('0x36')]=qs[_0xcc8e('0x37')](_0x60ca9b[_0xcc8e('0x2f')]['sort']);_0x3e9944[_0xcc8e('0x38')]=qs[_0xcc8e('0x30')](_[_0xcc8e('0x49')](_0x60ca9b[_0xcc8e('0x2f')],_0x32529e['filters']));if(_0x60ca9b['query'][_0xcc8e('0x39')]){_0x3e9944[_0xcc8e('0x38')]=_[_0xcc8e('0x3a')](_0x3e9944[_0xcc8e('0x38')],{'$or':_[_0xcc8e('0x28')](_0x3e9944[_0xcc8e('0x32')],function(_0xf14f69){var _0x4d8216={};_0x4d8216[_0xf14f69]={'$like':'%'+_0x60ca9b[_0xcc8e('0x2f')][_0xcc8e('0x39')]+'%'};return _0x4d8216;})});}_0x3e9944=_[_0xcc8e('0x3a')]({},_0x3e9944,_0x60ca9b['options']);return _0x482c24['getDescriptions'](_0x3e9944);}})['then'](function(_0x29e701){if(_0x29e701){_0x68353d=_0x29e701[_0xcc8e('0x48')];if(!_0x60ca9b[_0xcc8e('0x2f')][_0xcc8e('0x34')]('nolimit')){_0x3e9944[_0xcc8e('0x19')]=qs[_0xcc8e('0x19')](_0x60ca9b[_0xcc8e('0x2f')][_0xcc8e('0x19')]);_0x3e9944[_0xcc8e('0x1b')]=qs[_0xcc8e('0x1b')](_0x60ca9b['query'][_0xcc8e('0x1b')]);}return _0x482c24['getDescriptions'](_0x3e9944);}})['then'](function(_0xfd613c){if(_0xfd613c){return _0xfd613c?{'count':_0x68353d,'rows':_0xfd613c}:null;}})['then'](respondWithResult(_0x321c82,null))[_0xcc8e('0x41')](handleError(_0x321c82,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index ded5005..ac5e47f 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 _0x2f56=['int_servicenow_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x61707c,_0x156b57){var _0x2b512a=function(_0x1c999b){while(--_0x1c999b){_0x61707c['push'](_0x61707c['shift']());}};_0x2b512a(++_0x156b57);}(_0x2f56,0xb5));var _0x62f5=function(_0xb17f4,_0x32bb1b){_0xb17f4=_0xb17f4-0x0;var _0x309828=_0x2f56[_0xb17f4];return _0x309828;};'use strict';var _=require(_0x62f5('0x0'));var util=require(_0x62f5('0x1'));var logger=require(_0x62f5('0x2'))(_0x62f5('0x3'));var moment=require('moment');var BPromise=require(_0x62f5('0x4'));var rp=require(_0x62f5('0x5'));var fs=require('fs');var path=require(_0x62f5('0x6'));var rimraf=require(_0x62f5('0x7'));var config=require(_0x62f5('0x8'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x62f5('0x9')]=function(_0x3c6ce8,_0x15fc7e){return _0x3c6ce8[_0x62f5('0xa')]('ServicenowConfiguration',attributes,{'tableName':_0x62f5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb627=['../../config/environment','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','int_servicenow_configurations','lodash','api','bluebird','request-promise','path','rimraf'];(function(_0x3fd9f8,_0x96e3dd){var _0x48fefb=function(_0x5588ef){while(--_0x5588ef){_0x3fd9f8['push'](_0x3fd9f8['shift']());}};_0x48fefb(++_0x96e3dd);}(_0xb627,0x144));var _0x7b62=function(_0x1e354e,_0x449b42){_0x1e354e=_0x1e354e-0x0;var _0x2c503e=_0xb627[_0x1e354e];return _0x2c503e;};'use strict';var _=require(_0x7b62('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7b62('0x1'));var moment=require('moment');var BPromise=require(_0x7b62('0x2'));var rp=require(_0x7b62('0x3'));var fs=require('fs');var path=require(_0x7b62('0x4'));var rimraf=require(_0x7b62('0x5'));var config=require(_0x7b62('0x6'));var attributes=require(_0x7b62('0x7'));module[_0x7b62('0x8')]=function(_0x4ad3e8,_0x71aec9){return _0x4ad3e8['define'](_0x7b62('0x9'),attributes,{'tableName':_0x7b62('0xa'),'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 bf4782d..2fb8fcf 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 _0xc161=['error','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x5ae993,_0x51bced){var _0x460a1f=function(_0x408e5d){while(--_0x408e5d){_0x5ae993['push'](_0x5ae993['shift']());}};_0x460a1f(++_0x51bced);}(_0xc161,0x6f));var _0x1c16=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0xc161[_0xbeb808];return _0x5d6909;};'use strict';var _=require(_0x1c16('0x0'));var util=require(_0x1c16('0x1'));var moment=require(_0x1c16('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c16('0x3'));var db=require(_0x1c16('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c16('0x5'))(_0x1c16('0x6'));var config=require('../../config/environment');var jayson=require(_0x1c16('0x7'));var client=jayson[_0x1c16('0x8')][_0x1c16('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28e891,_0x612081,_0x6b00be){return new BPromise(function(_0x5bb77a,_0x4d9291){return client[_0x1c16('0xa')](_0x28e891,_0x6b00be)['then'](function(_0x48797b){logger[_0x1c16('0xb')](_0x1c16('0xc'),_0x612081,'request\x20sent');logger[_0x1c16('0xd')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x612081,_0x1c16('0xe'),JSON['stringify'](_0x48797b));if(_0x48797b[_0x1c16('0xf')]){if(_0x48797b[_0x1c16('0xf')]['code']===0x1f4){logger[_0x1c16('0xf')](_0x1c16('0xc'),_0x612081,_0x48797b[_0x1c16('0xf')][_0x1c16('0x10')]);return _0x4d9291(_0x48797b[_0x1c16('0xf')]['message']);}logger[_0x1c16('0xf')](_0x1c16('0xc'),_0x612081,_0x48797b[_0x1c16('0xf')][_0x1c16('0x10')]);return _0x5bb77a(_0x48797b[_0x1c16('0xf')][_0x1c16('0x10')]);}else{logger[_0x1c16('0xb')]('ServicenowConfiguration,\x20%s,\x20%s',_0x612081,_0x1c16('0xe'));_0x5bb77a(_0x48797b['result'][_0x1c16('0x10')]);}})[_0x1c16('0x11')](function(_0x19cf21){logger[_0x1c16('0xf')](_0x1c16('0xc'),_0x612081,_0x19cf21);_0x4d9291(_0x19cf21);});});} \ No newline at end of file +var _0x9cfb=['bluebird','../../mysqldb','rpc','../../config/environment','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','message','error','result','lodash','util'];(function(_0xbe1e0c,_0x4cd64a){var _0x1c41e0=function(_0xb77e10){while(--_0xb77e10){_0xbe1e0c['push'](_0xbe1e0c['shift']());}};_0x1c41e0(++_0x4cd64a);}(_0x9cfb,0xa8));var _0xb9cf=function(_0x57f0cf,_0x578f76){_0x57f0cf=_0x57f0cf-0x0;var _0x593afb=_0x9cfb[_0x57f0cf];return _0x593afb;};'use strict';var _=require(_0xb9cf('0x0'));var util=require(_0xb9cf('0x1'));var moment=require('moment');var BPromise=require(_0xb9cf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb9cf('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb9cf('0x4'));var config=require(_0xb9cf('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x464e9c,_0x357269,_0x13c7b0){return new BPromise(function(_0xe4cb8c,_0x45e40e){return client[_0xb9cf('0x6')](_0x464e9c,_0x13c7b0)['then'](function(_0x13ee95){logger[_0xb9cf('0x7')](_0xb9cf('0x8'),_0x357269,_0xb9cf('0x9'));logger[_0xb9cf('0xa')](_0xb9cf('0xb'),_0x357269,_0xb9cf('0x9'),JSON[_0xb9cf('0xc')](_0x13ee95));if(_0x13ee95['error']){if(_0x13ee95['error'][_0xb9cf('0xd')]===0x1f4){logger['error'](_0xb9cf('0x8'),_0x357269,_0x13ee95['error'][_0xb9cf('0xe')]);return _0x45e40e(_0x13ee95[_0xb9cf('0xf')][_0xb9cf('0xe')]);}logger[_0xb9cf('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x357269,_0x13ee95[_0xb9cf('0xf')][_0xb9cf('0xe')]);return _0xe4cb8c(_0x13ee95['error'][_0xb9cf('0xe')]);}else{logger[_0xb9cf('0x7')](_0xb9cf('0x8'),_0x357269,_0xb9cf('0x9'));_0xe4cb8c(_0x13ee95[_0xb9cf('0x10')]['message']);}})['catch'](function(_0x3f1da1){logger[_0xb9cf('0xf')](_0xb9cf('0x8'),_0x357269,_0x3f1da1);_0x45e40e(_0x3f1da1);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index e4360e0..25d50fc 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 _0xce33=['get','/:id','isAuthenticated','show','create','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','index'];(function(_0x44cb92,_0x59afa3){var _0x56b9e6=function(_0x2841e0){while(--_0x2841e0){_0x44cb92['push'](_0x44cb92['shift']());}};_0x56b9e6(++_0x59afa3);}(_0xce33,0xe0));var _0x3ce3=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xce33[_0x45f951];return _0x24756c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3ce3('0x0'));var timeout=require(_0x3ce3('0x1'));var express=require(_0x3ce3('0x2'));var router=express[_0x3ce3('0x3')]();var fs_extra=require(_0x3ce3('0x4'));var auth=require(_0x3ce3('0x5'));var interaction=require(_0x3ce3('0x6'));var config=require(_0x3ce3('0x7'));var controller=require(_0x3ce3('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x3ce3('0x9')]);router[_0x3ce3('0xa')](_0x3ce3('0xb'),auth[_0x3ce3('0xc')](),controller[_0x3ce3('0xd')]);router['post']('/',auth[_0x3ce3('0xc')](),controller[_0x3ce3('0xe')]);router['put'](_0x3ce3('0xb'),auth[_0x3ce3('0xc')](),controller['update']);router[_0x3ce3('0xf')](_0x3ce3('0xb'),auth[_0x3ce3('0xc')](),controller[_0x3ce3('0x10')]);module[_0x3ce3('0x11')]=router; \ No newline at end of file +var _0x3c96=['multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','get','isAuthenticated','index','show','create','put','update','/:id'];(function(_0x337f04,_0x1a48a9){var _0xe2c4a0=function(_0x394583){while(--_0x394583){_0x337f04['push'](_0x337f04['shift']());}};_0xe2c4a0(++_0x1a48a9);}(_0x3c96,0x69));var _0x63c9=function(_0x4d8a1b,_0xa2e081){_0x4d8a1b=_0x4d8a1b-0x0;var _0x362245=_0x3c96[_0x4d8a1b];return _0x362245;};'use strict';var multer=require(_0x63c9('0x0'));var util=require('util');var path=require(_0x63c9('0x1'));var timeout=require(_0x63c9('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x63c9('0x3'));var auth=require(_0x63c9('0x4'));var interaction=require(_0x63c9('0x5'));var config=require('../../config/environment');var controller=require(_0x63c9('0x6'));router[_0x63c9('0x7')]('/',auth[_0x63c9('0x8')](),controller[_0x63c9('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x63c9('0xa')]);router['post']('/',auth[_0x63c9('0x8')](),controller[_0x63c9('0xb')]);router[_0x63c9('0xc')]('/:id',auth[_0x63c9('0x8')](),controller[_0x63c9('0xd')]);router['delete'](_0x63c9('0xe'),auth[_0x63c9('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 530bd8a..ad411f5 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 _0x569a=['STRING','BOOLEAN','ENUM','picklist','string','variable'];(function(_0x43c732,_0x2befdb){var _0x5dfee3=function(_0x4f9ff0){while(--_0x4f9ff0){_0x43c732['push'](_0x43c732['shift']());}};_0x5dfee3(++_0x2befdb);}(_0x569a,0xb0));var _0xa569=function(_0x2fd0f0,_0x4b634e){_0x2fd0f0=_0x2fd0f0-0x0;var _0x57f71a=_0x569a[_0x2fd0f0];return _0x57f71a;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xa569('0x0')]('string','variable','customVariable','keyValue',_0xa569('0x1')),'defaultValue':_0xa569('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa569('0x0')](_0xa569('0x2'),_0xa569('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xa569('0x4')]},'idField':{'type':Sequelize[_0xa569('0x4')]},'nameField':{'type':Sequelize[_0xa569('0x4')]},'customField':{'type':Sequelize[_0xa569('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x12aa=['variable','customVariable','STRING','BOOLEAN','sequelize','ENUM','string'];(function(_0x3526a5,_0x56825d){var _0x44f869=function(_0x5dd195){while(--_0x5dd195){_0x3526a5['push'](_0x3526a5['shift']());}};_0x44f869(++_0x56825d);}(_0x12aa,0xb3));var _0xa12a=function(_0x208373,_0x46a1c0){_0x208373=_0x208373-0x0;var _0x56e276=_0x12aa[_0x208373];return _0x56e276;};'use strict';var Sequelize=require(_0xa12a('0x0'));module['exports']={'type':{'type':Sequelize[_0xa12a('0x1')](_0xa12a('0x2'),_0xa12a('0x3'),_0xa12a('0x4'),'keyValue','picklist'),'defaultValue':_0xa12a('0x2')},'content':{'type':Sequelize[_0xa12a('0x5')]},'key':{'type':Sequelize[_0xa12a('0x5')]},'keyType':{'type':Sequelize[_0xa12a('0x1')](_0xa12a('0x2'),_0xa12a('0x3'),_0xa12a('0x4'))},'keyContent':{'type':Sequelize[_0xa12a('0x5')]},'idField':{'type':Sequelize[_0xa12a('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xa12a('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa12a('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 0c1d23f..5291cfb 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 _0xaa76=['count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','ServicenowField','include','rows','catch','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x15c0b9,_0x41a56e){var _0xa179bd=function(_0x4e2cba){while(--_0x4e2cba){_0x15c0b9['push'](_0x15c0b9['shift']());}};_0xa179bd(++_0x41a56e);}(_0xaa76,0x6f));var _0x6aa7=function(_0x132fc0,_0x411127){_0x132fc0=_0x132fc0-0x0;var _0x3b86a4=_0xaa76[_0x132fc0];return _0x3b86a4;};'use strict';var emlformat=require(_0x6aa7('0x0'));var rimraf=require(_0x6aa7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6aa7('0x2'));var rp=require(_0x6aa7('0x3'));var moment=require(_0x6aa7('0x4'));var BPromise=require(_0x6aa7('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6aa7('0x6'));var csv=require(_0x6aa7('0x7'));var ejs=require(_0x6aa7('0x8'));var fs=require('fs');var fs_extra=require(_0x6aa7('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6aa7('0xa'));var jsforce=require(_0x6aa7('0xb'));var deskjs=require(_0x6aa7('0xc'));var toCsv=require(_0x6aa7('0x7'));var querystring=require(_0x6aa7('0xd'));var Papa=require(_0x6aa7('0xe'));var Redis=require(_0x6aa7('0xf'));var authService=require(_0x6aa7('0x10'));var qs=require(_0x6aa7('0x11'));var as=require(_0x6aa7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6aa7('0x13'));var utils=require('../../config/utils');var config=require(_0x6aa7('0x14'));var licenseUtil=require(_0x6aa7('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1fed92,_0x452ede){_0x452ede=_0x452ede||0xcc;return function(_0x34ad2c){if(_0x34ad2c){return _0x1fed92[_0x6aa7('0x16')](_0x452ede);}return _0x1fed92[_0x6aa7('0x17')](_0x452ede)[_0x6aa7('0x18')]();};}function respondWithResult(_0x3b61b9,_0x352f37){_0x352f37=_0x352f37||0xc8;return function(_0x516b32){if(_0x516b32){return _0x3b61b9[_0x6aa7('0x17')](_0x352f37)[_0x6aa7('0x19')](_0x516b32);}};}function respondWithFilteredResult(_0x1c83af,_0x1ecafa){return function(_0x350540){if(_0x350540){var _0x309456=typeof _0x1ecafa[_0x6aa7('0x1a')]===_0x6aa7('0x1b')&&typeof _0x1ecafa[_0x6aa7('0x1c')]===_0x6aa7('0x1b');var _0x2e624c=_0x350540[_0x6aa7('0x1d')];var _0x4982=_0x309456?0x0:_0x1ecafa['offset'];var _0x759faf=_0x309456?_0x350540[_0x6aa7('0x1d')]:_0x1ecafa[_0x6aa7('0x1a')]+_0x1ecafa[_0x6aa7('0x1c')];var _0x1d8399;if(_0x759faf>=_0x2e624c){_0x759faf=_0x2e624c;_0x1d8399=0xc8;}else{_0x1d8399=0xce;}_0x1c83af[_0x6aa7('0x17')](_0x1d8399);return _0x1c83af[_0x6aa7('0x1e')](_0x6aa7('0x1f'),_0x4982+'-'+_0x759faf+'/'+_0x2e624c)[_0x6aa7('0x19')](_0x350540);}return null;};}function patchUpdates(_0x491d31){return function(_0x4a787a){try{jsonpatch[_0x6aa7('0x20')](_0x4a787a,_0x491d31,!![]);}catch(_0x2812ae){return BPromise['reject'](_0x2812ae);}return _0x4a787a[_0x6aa7('0x21')]();};}function saveUpdates(_0xb94c13,_0x37e1ea){return function(_0xc159d8){if(_0xc159d8){return _0xc159d8[_0x6aa7('0x22')](_0xb94c13)[_0x6aa7('0x23')](function(_0x224614){return _0x224614;});}return null;};}function removeEntity(_0x35601e,_0x14120b){return function(_0x261c79){if(_0x261c79){return _0x261c79[_0x6aa7('0x24')]()['then'](function(){_0x35601e[_0x6aa7('0x17')](0xcc)[_0x6aa7('0x18')]();});}};}function handleEntityNotFound(_0x22e22f,_0x5265eb){return function(_0x55a7cb){if(!_0x55a7cb){_0x22e22f[_0x6aa7('0x16')](0x194);}return _0x55a7cb;};}function handleError(_0x284049,_0x98ee6){_0x98ee6=_0x98ee6||0x1f4;return function(_0x439e54){logger['error'](_0x439e54[_0x6aa7('0x25')]);if(_0x439e54[_0x6aa7('0x26')]){delete _0x439e54['name'];}_0x284049[_0x6aa7('0x17')](_0x98ee6)[_0x6aa7('0x27')](_0x439e54);};}exports[_0x6aa7('0x28')]=function(_0x59c831,_0x476894){var _0x52353c={},_0x11016a={},_0x4b49a7={'count':0x0,'rows':[]};var _0x52f9cd=_['map'](db['ServicenowField'][_0x6aa7('0x29')],function(_0x4f9a65){return{'name':_0x4f9a65[_0x6aa7('0x2a')],'type':_0x4f9a65[_0x6aa7('0x2b')][_0x6aa7('0x2c')]};});_0x11016a[_0x6aa7('0x2d')]=_[_0x6aa7('0x2e')](_0x52f9cd,_0x6aa7('0x26'));_0x11016a[_0x6aa7('0x2f')]=_[_0x6aa7('0x30')](_0x59c831[_0x6aa7('0x2f')]);_0x11016a['filters']=_[_0x6aa7('0x31')](_0x11016a['model'],_0x11016a[_0x6aa7('0x2f')]);_0x52353c[_0x6aa7('0x32')]=_['intersection'](_0x11016a['model'],qs[_0x6aa7('0x33')](_0x59c831['query'][_0x6aa7('0x33')]));_0x52353c['attributes']=_0x52353c[_0x6aa7('0x32')][_0x6aa7('0x34')]?_0x52353c['attributes']:_0x11016a[_0x6aa7('0x2d')];if(!_0x59c831[_0x6aa7('0x2f')][_0x6aa7('0x35')](_0x6aa7('0x36'))){_0x52353c[_0x6aa7('0x1c')]=qs['limit'](_0x59c831[_0x6aa7('0x2f')]['limit']);_0x52353c[_0x6aa7('0x1a')]=qs[_0x6aa7('0x1a')](_0x59c831[_0x6aa7('0x2f')][_0x6aa7('0x1a')]);}_0x52353c[_0x6aa7('0x37')]=qs[_0x6aa7('0x38')](_0x59c831[_0x6aa7('0x2f')]['sort']);_0x52353c[_0x6aa7('0x39')]=qs[_0x6aa7('0x3a')](_['pick'](_0x59c831[_0x6aa7('0x2f')],_0x11016a[_0x6aa7('0x3a')]),_0x52f9cd);if(_0x59c831[_0x6aa7('0x2f')][_0x6aa7('0x3b')]){_0x52353c[_0x6aa7('0x39')]=_[_0x6aa7('0x3c')](_0x52353c[_0x6aa7('0x39')],{'$or':_[_0x6aa7('0x2e')](_0x52f9cd,function(_0x359081){if(_0x359081[_0x6aa7('0x2b')]!=='VIRTUAL'){var _0x3c1fe0={};_0x3c1fe0[_0x359081[_0x6aa7('0x26')]]={'$like':'%'+_0x59c831['query']['filter']+'%'};return _0x3c1fe0;}})});}_0x52353c=_['merge']({},_0x52353c,_0x59c831[_0x6aa7('0x3d')]);var _0x22fb1b={'where':_0x52353c[_0x6aa7('0x39')]};return db[_0x6aa7('0x3e')][_0x6aa7('0x1d')](_0x22fb1b)[_0x6aa7('0x23')](function(_0x168a05){_0x4b49a7[_0x6aa7('0x1d')]=_0x168a05;if(_0x59c831[_0x6aa7('0x2f')]['includeAll']){_0x52353c[_0x6aa7('0x3f')]=[{'all':!![]}];}return db[_0x6aa7('0x3e')]['findAll'](_0x52353c);})[_0x6aa7('0x23')](function(_0x5ae1e7){_0x4b49a7[_0x6aa7('0x40')]=_0x5ae1e7;return _0x4b49a7;})['then'](respondWithFilteredResult(_0x476894,_0x52353c))[_0x6aa7('0x41')](handleError(_0x476894,null));};exports['show']=function(_0x2a074a,_0xb3e8f1){var _0x2c8b={'raw':!![],'where':{'id':_0x2a074a['params']['id']}},_0x2cea3f={};_0x2cea3f[_0x6aa7('0x2d')]=_['keys'](db['ServicenowField'][_0x6aa7('0x29')]);_0x2cea3f[_0x6aa7('0x2f')]=_[_0x6aa7('0x30')](_0x2a074a[_0x6aa7('0x2f')]);_0x2cea3f[_0x6aa7('0x3a')]=_[_0x6aa7('0x31')](_0x2cea3f[_0x6aa7('0x2d')],_0x2cea3f['query']);_0x2c8b[_0x6aa7('0x32')]=_[_0x6aa7('0x31')](_0x2cea3f[_0x6aa7('0x2d')],qs[_0x6aa7('0x33')](_0x2a074a['query']['fields']));_0x2c8b[_0x6aa7('0x32')]=_0x2c8b[_0x6aa7('0x32')][_0x6aa7('0x34')]?_0x2c8b[_0x6aa7('0x32')]:_0x2cea3f[_0x6aa7('0x2d')];if(_0x2a074a[_0x6aa7('0x2f')]['includeAll']){_0x2c8b[_0x6aa7('0x3f')]=[{'all':!![]}];}_0x2c8b=_['merge']({},_0x2c8b,_0x2a074a[_0x6aa7('0x3d')]);return db['ServicenowField'][_0x6aa7('0x42')](_0x2c8b)['then'](handleEntityNotFound(_0xb3e8f1,null))[_0x6aa7('0x23')](respondWithResult(_0xb3e8f1,null))[_0x6aa7('0x41')](handleError(_0xb3e8f1,null));};exports['create']=function(_0x1388ea,_0x1670a7){return db['ServicenowField'][_0x6aa7('0x43')](_0x1388ea['body'],{})[_0x6aa7('0x23')](respondWithResult(_0x1670a7,0xc9))[_0x6aa7('0x41')](handleError(_0x1670a7,null));};exports[_0x6aa7('0x22')]=function(_0x1837ef,_0x1d6028){if(_0x1837ef[_0x6aa7('0x44')]['id']){delete _0x1837ef[_0x6aa7('0x44')]['id'];}return db[_0x6aa7('0x3e')][_0x6aa7('0x42')]({'where':{'id':_0x1837ef[_0x6aa7('0x45')]['id']}})[_0x6aa7('0x23')](handleEntityNotFound(_0x1d6028,null))[_0x6aa7('0x23')](saveUpdates(_0x1837ef['body'],null))[_0x6aa7('0x23')](respondWithResult(_0x1d6028,null))[_0x6aa7('0x41')](handleError(_0x1d6028,null));};exports[_0x6aa7('0x24')]=function(_0x597ac8,_0x266f9b){return db[_0x6aa7('0x3e')][_0x6aa7('0x42')]({'where':{'id':_0x597ac8[_0x6aa7('0x45')]['id']}})['then'](handleEntityNotFound(_0x266f9b,null))[_0x6aa7('0x23')](removeEntity(_0x266f9b,null))[_0x6aa7('0x41')](handleError(_0x266f9b,null));}; \ No newline at end of file +var _0x948a=['rows','catch','show','params','keys','rawAttributes','includeAll','include','find','create','body','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','undefined','limit','offset','count','status','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','ServicenowField','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','options','findAll'];(function(_0x437edb,_0x5ea790){var _0x3ea54a=function(_0x3584fe){while(--_0x3584fe){_0x437edb['push'](_0x437edb['shift']());}};_0x3ea54a(++_0x5ea790);}(_0x948a,0x1d3));var _0xa948=function(_0x1dd3ba,_0x264100){_0x1dd3ba=_0x1dd3ba-0x0;var _0x3acc9d=_0x948a[_0x1dd3ba];return _0x3acc9d;};'use strict';var emlformat=require(_0xa948('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa948('0x1'));var rp=require(_0xa948('0x2'));var moment=require('moment');var BPromise=require(_0xa948('0x3'));var Mustache=require(_0xa948('0x4'));var util=require(_0xa948('0x5'));var path=require(_0xa948('0x6'));var sox=require(_0xa948('0x7'));var csv=require(_0xa948('0x8'));var ejs=require(_0xa948('0x9'));var fs=require('fs');var fs_extra=require(_0xa948('0xa'));var _=require(_0xa948('0xb'));var squel=require('squel');var crypto=require(_0xa948('0xc'));var jsforce=require(_0xa948('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa948('0x8'));var querystring=require(_0xa948('0xe'));var Papa=require('papaparse');var Redis=require(_0xa948('0xf'));var authService=require(_0xa948('0x10'));var qs=require(_0xa948('0x11'));var as=require(_0xa948('0x12'));var hardwareService=require(_0xa948('0x13'));var logger=require('../../config/logger')(_0xa948('0x14'));var utils=require(_0xa948('0x15'));var config=require(_0xa948('0x16'));var licenseUtil=require(_0xa948('0x17'));var db=require(_0xa948('0x18'))['db'];function respondWithStatusCode(_0x1a4b70,_0x3f4c40){_0x3f4c40=_0x3f4c40||0xcc;return function(_0x236864){if(_0x236864){return _0x1a4b70[_0xa948('0x19')](_0x3f4c40);}return _0x1a4b70['status'](_0x3f4c40)['end']();};}function respondWithResult(_0x339904,_0x2e5ba7){_0x2e5ba7=_0x2e5ba7||0xc8;return function(_0x5d1924){if(_0x5d1924){return _0x339904['status'](_0x2e5ba7)[_0xa948('0x1a')](_0x5d1924);}};}function respondWithFilteredResult(_0x46cdc8,_0x110702){return function(_0x1c56c3){if(_0x1c56c3){var _0x38ed9b=typeof _0x110702['offset']===_0xa948('0x1b')&&typeof _0x110702[_0xa948('0x1c')]===_0xa948('0x1b');var _0x4f29ca=_0x1c56c3['count'];var _0x5ef0fb=_0x38ed9b?0x0:_0x110702[_0xa948('0x1d')];var _0x2ddb37=_0x38ed9b?_0x1c56c3[_0xa948('0x1e')]:_0x110702[_0xa948('0x1d')]+_0x110702[_0xa948('0x1c')];var _0x1ab9bb;if(_0x2ddb37>=_0x4f29ca){_0x2ddb37=_0x4f29ca;_0x1ab9bb=0xc8;}else{_0x1ab9bb=0xce;}_0x46cdc8[_0xa948('0x1f')](_0x1ab9bb);return _0x46cdc8[_0xa948('0x20')]('Content-Range',_0x5ef0fb+'-'+_0x2ddb37+'/'+_0x4f29ca)[_0xa948('0x1a')](_0x1c56c3);}return null;};}function patchUpdates(_0x410912){return function(_0x47a9d9){try{jsonpatch[_0xa948('0x21')](_0x47a9d9,_0x410912,!![]);}catch(_0x207b17){return BPromise[_0xa948('0x22')](_0x207b17);}return _0x47a9d9[_0xa948('0x23')]();};}function saveUpdates(_0x506a4f,_0x5987b1){return function(_0x1dbeab){if(_0x1dbeab){return _0x1dbeab[_0xa948('0x24')](_0x506a4f)[_0xa948('0x25')](function(_0x1ed598){return _0x1ed598;});}return null;};}function removeEntity(_0x3dc193,_0x5854dc){return function(_0x33c7c5){if(_0x33c7c5){return _0x33c7c5[_0xa948('0x26')]()[_0xa948('0x25')](function(){_0x3dc193[_0xa948('0x1f')](0xcc)[_0xa948('0x27')]();});}};}function handleEntityNotFound(_0x4a0738,_0x2b5d74){return function(_0x8b3514){if(!_0x8b3514){_0x4a0738['sendStatus'](0x194);}return _0x8b3514;};}function handleError(_0xc1b43d,_0x3c638d){_0x3c638d=_0x3c638d||0x1f4;return function(_0x279407){logger[_0xa948('0x28')](_0x279407[_0xa948('0x29')]);if(_0x279407[_0xa948('0x2a')]){delete _0x279407[_0xa948('0x2a')];}_0xc1b43d[_0xa948('0x1f')](_0x3c638d)[_0xa948('0x2b')](_0x279407);};}exports['index']=function(_0x435c2a,_0x1db32c){var _0x5707f2={},_0x273771={},_0x51deec={'count':0x0,'rows':[]};var _0x34315b=_[_0xa948('0x2c')](db[_0xa948('0x2d')]['rawAttributes'],function(_0x39226e){return{'name':_0x39226e['fieldName'],'type':_0x39226e[_0xa948('0x2e')][_0xa948('0x2f')]};});_0x273771[_0xa948('0x30')]=_[_0xa948('0x2c')](_0x34315b,_0xa948('0x2a'));_0x273771['query']=_['keys'](_0x435c2a[_0xa948('0x31')]);_0x273771['filters']=_[_0xa948('0x32')](_0x273771['model'],_0x273771['query']);_0x5707f2[_0xa948('0x33')]=_[_0xa948('0x32')](_0x273771[_0xa948('0x30')],qs[_0xa948('0x34')](_0x435c2a[_0xa948('0x31')]['fields']));_0x5707f2['attributes']=_0x5707f2[_0xa948('0x33')][_0xa948('0x35')]?_0x5707f2['attributes']:_0x273771[_0xa948('0x30')];if(!_0x435c2a[_0xa948('0x31')][_0xa948('0x36')](_0xa948('0x37'))){_0x5707f2[_0xa948('0x1c')]=qs['limit'](_0x435c2a[_0xa948('0x31')]['limit']);_0x5707f2[_0xa948('0x1d')]=qs['offset'](_0x435c2a[_0xa948('0x31')][_0xa948('0x1d')]);}_0x5707f2[_0xa948('0x38')]=qs['sort'](_0x435c2a[_0xa948('0x31')][_0xa948('0x39')]);_0x5707f2[_0xa948('0x3a')]=qs['filters'](_[_0xa948('0x3b')](_0x435c2a[_0xa948('0x31')],_0x273771[_0xa948('0x3c')]),_0x34315b);if(_0x435c2a['query']['filter']){_0x5707f2['where']=_[_0xa948('0x3d')](_0x5707f2[_0xa948('0x3a')],{'$or':_['map'](_0x34315b,function(_0x5811ff){if(_0x5811ff[_0xa948('0x2e')]!==_0xa948('0x3e')){var _0x373379={};_0x373379[_0x5811ff[_0xa948('0x2a')]]={'$like':'%'+_0x435c2a['query']['filter']+'%'};return _0x373379;}})});}_0x5707f2=_[_0xa948('0x3d')]({},_0x5707f2,_0x435c2a[_0xa948('0x3f')]);var _0x11e356={'where':_0x5707f2[_0xa948('0x3a')]};return db['ServicenowField']['count'](_0x11e356)[_0xa948('0x25')](function(_0x15d457){_0x51deec[_0xa948('0x1e')]=_0x15d457;if(_0x435c2a['query']['includeAll']){_0x5707f2['include']=[{'all':!![]}];}return db[_0xa948('0x2d')][_0xa948('0x40')](_0x5707f2);})[_0xa948('0x25')](function(_0x1171da){_0x51deec[_0xa948('0x41')]=_0x1171da;return _0x51deec;})[_0xa948('0x25')](respondWithFilteredResult(_0x1db32c,_0x5707f2))[_0xa948('0x42')](handleError(_0x1db32c,null));};exports[_0xa948('0x43')]=function(_0x350919,_0x5357f4){var _0x2cbaf0={'raw':!![],'where':{'id':_0x350919[_0xa948('0x44')]['id']}},_0x288c0b={};_0x288c0b[_0xa948('0x30')]=_[_0xa948('0x45')](db['ServicenowField'][_0xa948('0x46')]);_0x288c0b[_0xa948('0x31')]=_[_0xa948('0x45')](_0x350919[_0xa948('0x31')]);_0x288c0b[_0xa948('0x3c')]=_[_0xa948('0x32')](_0x288c0b[_0xa948('0x30')],_0x288c0b[_0xa948('0x31')]);_0x2cbaf0[_0xa948('0x33')]=_['intersection'](_0x288c0b[_0xa948('0x30')],qs[_0xa948('0x34')](_0x350919['query'][_0xa948('0x34')]));_0x2cbaf0[_0xa948('0x33')]=_0x2cbaf0['attributes'][_0xa948('0x35')]?_0x2cbaf0[_0xa948('0x33')]:_0x288c0b[_0xa948('0x30')];if(_0x350919[_0xa948('0x31')][_0xa948('0x47')]){_0x2cbaf0[_0xa948('0x48')]=[{'all':!![]}];}_0x2cbaf0=_[_0xa948('0x3d')]({},_0x2cbaf0,_0x350919[_0xa948('0x3f')]);return db['ServicenowField'][_0xa948('0x49')](_0x2cbaf0)['then'](handleEntityNotFound(_0x5357f4,null))[_0xa948('0x25')](respondWithResult(_0x5357f4,null))['catch'](handleError(_0x5357f4,null));};exports[_0xa948('0x4a')]=function(_0x203eb8,_0x122973){return db[_0xa948('0x2d')][_0xa948('0x4a')](_0x203eb8[_0xa948('0x4b')],{})[_0xa948('0x25')](respondWithResult(_0x122973,0xc9))['catch'](handleError(_0x122973,null));};exports[_0xa948('0x24')]=function(_0x7d56ac,_0x477710){if(_0x7d56ac[_0xa948('0x4b')]['id']){delete _0x7d56ac[_0xa948('0x4b')]['id'];}return db[_0xa948('0x2d')][_0xa948('0x49')]({'where':{'id':_0x7d56ac['params']['id']}})[_0xa948('0x25')](handleEntityNotFound(_0x477710,null))[_0xa948('0x25')](saveUpdates(_0x7d56ac[_0xa948('0x4b')],null))[_0xa948('0x25')](respondWithResult(_0x477710,null))[_0xa948('0x42')](handleError(_0x477710,null));};exports[_0xa948('0x26')]=function(_0x3669ed,_0x2498c1){return db[_0xa948('0x2d')]['find']({'where':{'id':_0x3669ed[_0xa948('0x44')]['id']}})[_0xa948('0x25')](handleEntityNotFound(_0x2498c1,null))[_0xa948('0x25')](removeEntity(_0x2498c1,null))[_0xa948('0x42')](handleError(_0x2498c1,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index b56f9c7..1528c8b 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 _0x81e1=['FieldId','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','define','servicenow_unique_index'];(function(_0x3dacd2,_0xe8b02b){var _0x4b8212=function(_0xb2acb1){while(--_0xb2acb1){_0x3dacd2['push'](_0x3dacd2['shift']());}};_0x4b8212(++_0xe8b02b);}(_0x81e1,0x123));var _0x181e=function(_0x512fb5,_0x58d7bd){_0x512fb5=_0x512fb5-0x0;var _0x54650f=_0x81e1[_0x512fb5];return _0x54650f;};'use strict';var _=require(_0x181e('0x0'));var util=require(_0x181e('0x1'));var logger=require(_0x181e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x181e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x181e('0x4'));var rimraf=require(_0x181e('0x5'));var config=require(_0x181e('0x6'));var attributes=require('./intServicenowField.attributes');module['exports']=function(_0x54c7ae,_0x577c2e){return _0x54c7ae[_0x181e('0x7')]('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x181e('0x8'),'fields':['idField',_0x181e('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7d18=['servicenow_unique_index','idField','FieldId','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intServicenowField.attributes','exports','ServicenowField'];(function(_0x57d390,_0x37883d){var _0x415227=function(_0xf7f285){while(--_0xf7f285){_0x57d390['push'](_0x57d390['shift']());}};_0x415227(++_0x37883d);}(_0x7d18,0x1ca));var _0x87d1=function(_0x576266,_0x4002b0){_0x576266=_0x576266-0x0;var _0x18234f=_0x7d18[_0x576266];return _0x18234f;};'use strict';var _=require('lodash');var util=require(_0x87d1('0x0'));var logger=require(_0x87d1('0x1'))(_0x87d1('0x2'));var moment=require('moment');var BPromise=require(_0x87d1('0x3'));var rp=require(_0x87d1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x87d1('0x5'));var config=require(_0x87d1('0x6'));var attributes=require(_0x87d1('0x7'));module[_0x87d1('0x8')]=function(_0x50aca8,_0x4d2ae7){return _0x50aca8['define'](_0x87d1('0x9'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x87d1('0xa'),'fields':[_0x87d1('0xb'),_0x87d1('0xc')],'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 cc1052e..e3727b0 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x32e20d,_0x224515){var _0x3bd843=function(_0x29af74){while(--_0x29af74){_0x32e20d['push'](_0x32e20d['shift']());}};_0x3bd843(++_0x224515);}(_0xe706,0xa3));var _0x6e70=function(_0x2a9202,_0x5e68cb){_0x2a9202=_0x2a9202-0x0;var _0x316625=_0xe706[_0x2a9202];return _0x316625;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0xbaf0=['client','http','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x172660,_0x260d9b){var _0x83204f=function(_0x4d6c80){while(--_0x4d6c80){_0x172660['push'](_0x172660['shift']());}};_0x83204f(++_0x260d9b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 04ba93f..2c0dbc7 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(_0x35b88f,_0x2fc337){var _0x13247a=function(_0x277f46){while(--_0x277f46){_0x35b88f['push'](_0x35b88f['shift']());}};_0x13247a(++_0x2fc337);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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(_0x18a655,_0x723832){var _0x382018=function(_0x4ddb81){while(--_0x4ddb81){_0x18a655['push'](_0x18a655['shift']());}};_0x382018(++_0x723832);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 7209f75..deabb08 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(_0x5c3492,_0x5239a0){var _0x54ce7b=function(_0x458273){while(--_0x458273){_0x5c3492['push'](_0x5c3492['shift']());}};_0x54ce7b(++_0x5239a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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(_0x5aacf3,_0x4e56ab){var _0x5cb65d=function(_0x459cbf){while(--_0x459cbf){_0x5aacf3['push'](_0x5aacf3['shift']());}};_0x5cb65d(++_0x4e56ab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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 b7c296f..d5deba0 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 _0x20e7=['mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','count','limit','set','reject','save','update','then','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','SugarcrmAccount','includeAll','include','findAll','show','find','catch','create','body','params','destroy','findOne','pick','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','SugarcrmConfiguration','getFields','assigned_user_id','created_by','description','date_start','duration_hours','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','get_module_fields','stringify','Calls','values','includes','label','endsWith','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird'];(function(_0xd92244,_0x44e3db){var _0x3133d1=function(_0x28f606){while(--_0x28f606){_0xd92244['push'](_0xd92244['shift']());}};_0x3133d1(++_0x44e3db);}(_0x20e7,0x178));var _0x720e=function(_0x5a07a7,_0x5d4f19){_0x5a07a7=_0x5a07a7-0x0;var _0x5970ad=_0x20e7[_0x5a07a7];return _0x5970ad;};'use strict';var emlformat=require(_0x720e('0x0'));var rimraf=require(_0x720e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x720e('0x2'));var rp=require(_0x720e('0x3'));var moment=require('moment');var BPromise=require(_0x720e('0x4'));var Mustache=require(_0x720e('0x5'));var util=require(_0x720e('0x6'));var path=require(_0x720e('0x7'));var sox=require(_0x720e('0x8'));var csv=require('to-csv');var ejs=require(_0x720e('0x9'));var fs=require('fs');var fs_extra=require(_0x720e('0xa'));var _=require(_0x720e('0xb'));var squel=require(_0x720e('0xc'));var crypto=require(_0x720e('0xd'));var jsforce=require(_0x720e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x720e('0xf'));var querystring=require(_0x720e('0x10'));var Papa=require(_0x720e('0x11'));var Redis=require(_0x720e('0x12'));var authService=require(_0x720e('0x13'));var qs=require(_0x720e('0x14'));var as=require(_0x720e('0x15'));var hardwareService=require(_0x720e('0x16'));var logger=require(_0x720e('0x17'))(_0x720e('0x18'));var utils=require(_0x720e('0x19'));var config=require(_0x720e('0x1a'));var licenseUtil=require(_0x720e('0x1b'));var db=require(_0x720e('0x1c'))['db'];var integrations=require(_0x720e('0x1d'));function respondWithStatusCode(_0x59420f,_0x8c9be3){_0x8c9be3=_0x8c9be3||0xcc;return function(_0xdc6284){if(_0xdc6284){return _0x59420f['sendStatus'](_0x8c9be3);}return _0x59420f[_0x720e('0x1e')](_0x8c9be3)['end']();};}function respondWithResult(_0x3257a5,_0x39199c){_0x39199c=_0x39199c||0xc8;return function(_0x27612d){if(_0x27612d){return _0x3257a5[_0x720e('0x1e')](_0x39199c)[_0x720e('0x1f')](_0x27612d);}};}function respondWithFilteredResult(_0x1ea31b,_0x120f72){return function(_0x577a6c){if(_0x577a6c){var _0x47d7dc=typeof _0x120f72[_0x720e('0x20')]==='undefined'&&typeof _0x120f72['limit']===_0x720e('0x21');var _0x5bf422=_0x577a6c[_0x720e('0x22')];var _0x17537a=_0x47d7dc?0x0:_0x120f72['offset'];var _0x279f5f=_0x47d7dc?_0x577a6c[_0x720e('0x22')]:_0x120f72[_0x720e('0x20')]+_0x120f72[_0x720e('0x23')];var _0x32bd7d;if(_0x279f5f>=_0x5bf422){_0x279f5f=_0x5bf422;_0x32bd7d=0xc8;}else{_0x32bd7d=0xce;}_0x1ea31b[_0x720e('0x1e')](_0x32bd7d);return _0x1ea31b[_0x720e('0x24')]('Content-Range',_0x17537a+'-'+_0x279f5f+'/'+_0x5bf422)[_0x720e('0x1f')](_0x577a6c);}return null;};}function patchUpdates(_0x4d7389){return function(_0x1752e8){try{jsonpatch['apply'](_0x1752e8,_0x4d7389,!![]);}catch(_0x11e5ad){return BPromise[_0x720e('0x25')](_0x11e5ad);}return _0x1752e8[_0x720e('0x26')]();};}function saveUpdates(_0x21b5e2,_0x36faf8){return function(_0x5c8b10){if(_0x5c8b10){return _0x5c8b10[_0x720e('0x27')](_0x21b5e2)[_0x720e('0x28')](function(_0x2c4ee8){return _0x2c4ee8;});}return null;};}function removeEntity(_0x5de4e5,_0x4ab53d){return function(_0x373cc4){if(_0x373cc4){return _0x373cc4['destroy']()[_0x720e('0x28')](function(){_0x5de4e5['status'](0xcc)[_0x720e('0x29')]();});}};}function handleEntityNotFound(_0x36879f,_0x179d43){return function(_0x21d9d8){if(!_0x21d9d8){_0x36879f[_0x720e('0x2a')](0x194);}return _0x21d9d8;};}function handleError(_0x2c57fe,_0x47622b){_0x47622b=_0x47622b||0x1f4;return function(_0x48eb5a){logger[_0x720e('0x2b')](_0x48eb5a[_0x720e('0x2c')]);if(_0x48eb5a[_0x720e('0x2d')]){delete _0x48eb5a[_0x720e('0x2d')];}_0x2c57fe['status'](_0x47622b)[_0x720e('0x2e')](_0x48eb5a);};}exports[_0x720e('0x2f')]=function(_0x3eb85c,_0x437b4d){var _0x35fad1={},_0x4a385f={},_0x2a0971={'count':0x0,'rows':[]};var _0x5c354b=_[_0x720e('0x30')](db['SugarcrmAccount'][_0x720e('0x31')],function(_0x43bb86){return{'name':_0x43bb86[_0x720e('0x32')],'type':_0x43bb86[_0x720e('0x33')][_0x720e('0x34')]};});_0x4a385f[_0x720e('0x35')]=_[_0x720e('0x30')](_0x5c354b,'name');_0x4a385f[_0x720e('0x36')]=_[_0x720e('0x37')](_0x3eb85c[_0x720e('0x36')]);_0x4a385f[_0x720e('0x38')]=_[_0x720e('0x39')](_0x4a385f['model'],_0x4a385f['query']);_0x35fad1[_0x720e('0x3a')]=_[_0x720e('0x39')](_0x4a385f[_0x720e('0x35')],qs[_0x720e('0x3b')](_0x3eb85c[_0x720e('0x36')][_0x720e('0x3b')]));_0x35fad1[_0x720e('0x3a')]=_0x35fad1[_0x720e('0x3a')][_0x720e('0x3c')]?_0x35fad1['attributes']:_0x4a385f[_0x720e('0x35')];if(!_0x3eb85c[_0x720e('0x36')][_0x720e('0x3d')](_0x720e('0x3e'))){_0x35fad1[_0x720e('0x23')]=qs[_0x720e('0x23')](_0x3eb85c[_0x720e('0x36')][_0x720e('0x23')]);_0x35fad1[_0x720e('0x20')]=qs[_0x720e('0x20')](_0x3eb85c[_0x720e('0x36')][_0x720e('0x20')]);}_0x35fad1[_0x720e('0x3f')]=qs[_0x720e('0x40')](_0x3eb85c[_0x720e('0x36')][_0x720e('0x40')]);_0x35fad1[_0x720e('0x41')]=qs[_0x720e('0x38')](_['pick'](_0x3eb85c['query'],_0x4a385f[_0x720e('0x38')]),_0x5c354b);if(_0x3eb85c['query'][_0x720e('0x42')]){_0x35fad1[_0x720e('0x41')]=_['merge'](_0x35fad1[_0x720e('0x41')],{'$or':_[_0x720e('0x30')](_0x5c354b,function(_0x1544f4){if(_0x1544f4[_0x720e('0x33')]!==_0x720e('0x43')){var _0x3805ab={};_0x3805ab[_0x1544f4['name']]={'$like':'%'+_0x3eb85c[_0x720e('0x36')][_0x720e('0x42')]+'%'};return _0x3805ab;}})});}_0x35fad1=_[_0x720e('0x44')]({},_0x35fad1,_0x3eb85c[_0x720e('0x45')]);var _0x1d2026={'where':_0x35fad1[_0x720e('0x41')]};return db[_0x720e('0x46')]['count'](_0x1d2026)['then'](function(_0x3a7318){_0x2a0971['count']=_0x3a7318;if(_0x3eb85c[_0x720e('0x36')][_0x720e('0x47')]){_0x35fad1[_0x720e('0x48')]=[{'all':!![]}];}return db[_0x720e('0x46')][_0x720e('0x49')](_0x35fad1);})[_0x720e('0x28')](function(_0x224734){_0x2a0971['rows']=_0x224734;return _0x2a0971;})[_0x720e('0x28')](respondWithFilteredResult(_0x437b4d,_0x35fad1))['catch'](handleError(_0x437b4d,null));};exports[_0x720e('0x4a')]=function(_0x2632d,_0x12df20){var _0x36df1d={'raw':![],'where':{'id':_0x2632d['params']['id']}},_0x5d5a9d={};_0x5d5a9d[_0x720e('0x35')]=_[_0x720e('0x37')](db[_0x720e('0x46')][_0x720e('0x31')]);_0x5d5a9d[_0x720e('0x36')]=_['keys'](_0x2632d[_0x720e('0x36')]);_0x5d5a9d['filters']=_['intersection'](_0x5d5a9d[_0x720e('0x35')],_0x5d5a9d[_0x720e('0x36')]);_0x36df1d[_0x720e('0x3a')]=_[_0x720e('0x39')](_0x5d5a9d[_0x720e('0x35')],qs[_0x720e('0x3b')](_0x2632d[_0x720e('0x36')][_0x720e('0x3b')]));_0x36df1d[_0x720e('0x3a')]=_0x36df1d[_0x720e('0x3a')][_0x720e('0x3c')]?_0x36df1d[_0x720e('0x3a')]:_0x5d5a9d['model'];if(_0x2632d[_0x720e('0x36')][_0x720e('0x47')]){_0x36df1d[_0x720e('0x48')]=[{'all':!![]}];}_0x36df1d=_[_0x720e('0x44')]({},_0x36df1d,_0x2632d['options']);return db[_0x720e('0x46')][_0x720e('0x4b')](_0x36df1d)[_0x720e('0x28')](handleEntityNotFound(_0x12df20,null))[_0x720e('0x28')](respondWithResult(_0x12df20,null))[_0x720e('0x4c')](handleError(_0x12df20,null));};exports[_0x720e('0x4d')]=function(_0x163a1d,_0x4f2ff8){return db['SugarcrmAccount'][_0x720e('0x4d')](_0x163a1d[_0x720e('0x4e')],{})['then'](respondWithResult(_0x4f2ff8,0xc9))['catch'](handleError(_0x4f2ff8,null));};exports[_0x720e('0x27')]=function(_0x23bd59,_0x65212f){if(_0x23bd59[_0x720e('0x4e')]['id']){delete _0x23bd59[_0x720e('0x4e')]['id'];}return db[_0x720e('0x46')]['find']({'where':{'id':_0x23bd59[_0x720e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x65212f,null))[_0x720e('0x28')](saveUpdates(_0x23bd59[_0x720e('0x4e')],null))[_0x720e('0x28')](respondWithResult(_0x65212f,null))[_0x720e('0x4c')](handleError(_0x65212f,null));};exports[_0x720e('0x50')]=function(_0x252c9e,_0x1a106c){return db['SugarcrmAccount'][_0x720e('0x4b')]({'where':{'id':_0x252c9e[_0x720e('0x4f')]['id']}})[_0x720e('0x28')](handleEntityNotFound(_0x1a106c,null))['then'](removeEntity(_0x1a106c,null))[_0x720e('0x4c')](handleError(_0x1a106c,null));};exports['getConfigurations']=function(_0x32d276,_0x21c4b0,_0x566ae2){var _0x3075dc={};var _0x5e27cc={};var _0x54b785;var _0x4914c1;return db['SugarcrmAccount'][_0x720e('0x51')]({'where':{'id':_0x32d276[_0x720e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x21c4b0,null))['then'](function(_0x10ddab){if(_0x10ddab){_0x54b785=_0x10ddab;_0x5e27cc[_0x720e('0x35')]=_['keys'](db['SugarcrmConfiguration'][_0x720e('0x31')]);_0x5e27cc[_0x720e('0x36')]=_[_0x720e('0x37')](_0x32d276[_0x720e('0x36')]);_0x5e27cc['filters']=_[_0x720e('0x39')](_0x5e27cc[_0x720e('0x35')],_0x5e27cc['query']);_0x3075dc[_0x720e('0x3a')]=_[_0x720e('0x39')](_0x5e27cc[_0x720e('0x35')],qs[_0x720e('0x3b')](_0x32d276[_0x720e('0x36')]['fields']));_0x3075dc[_0x720e('0x3a')]=_0x3075dc[_0x720e('0x3a')][_0x720e('0x3c')]?_0x3075dc[_0x720e('0x3a')]:_0x5e27cc[_0x720e('0x35')];_0x3075dc['order']=qs[_0x720e('0x40')](_0x32d276[_0x720e('0x36')][_0x720e('0x40')]);_0x3075dc[_0x720e('0x41')]=qs[_0x720e('0x38')](_[_0x720e('0x52')](_0x32d276['query'],_0x5e27cc[_0x720e('0x38')]));if(_0x32d276[_0x720e('0x36')][_0x720e('0x42')]){_0x3075dc[_0x720e('0x41')]=_['merge'](_0x3075dc[_0x720e('0x41')],{'$or':_[_0x720e('0x30')](_0x3075dc[_0x720e('0x3a')],function(_0x30f27a){var _0x26f402={};_0x26f402[_0x30f27a]={'$like':'%'+_0x32d276[_0x720e('0x36')][_0x720e('0x42')]+'%'};return _0x26f402;})});}_0x3075dc=_[_0x720e('0x44')]({},_0x3075dc,_0x32d276['options']);return _0x54b785['getConfigurations'](_0x3075dc);}})[_0x720e('0x28')](function(_0x5dba2b){if(_0x5dba2b){_0x4914c1=_0x5dba2b[_0x720e('0x3c')];if(!_0x32d276[_0x720e('0x36')][_0x720e('0x3d')](_0x720e('0x3e'))){_0x3075dc['limit']=qs[_0x720e('0x23')](_0x32d276[_0x720e('0x36')][_0x720e('0x23')]);_0x3075dc['offset']=qs[_0x720e('0x20')](_0x32d276[_0x720e('0x36')][_0x720e('0x20')]);}return _0x54b785[_0x720e('0x53')](_0x3075dc);}})['then'](function(_0xb4f3ee){if(_0xb4f3ee){return _0xb4f3ee?{'count':_0x4914c1,'rows':_0xb4f3ee}:null;}})['then'](respondWithResult(_0x21c4b0,null))['catch'](handleError(_0x21c4b0,null));};exports[_0x720e('0x54')]=function(_0x187d1b,_0x35e8ab,_0x2b45e9){if(_0x187d1b['body']['id']){delete _0x187d1b[_0x720e('0x4e')]['id'];}return db[_0x720e('0x46')][_0x720e('0x51')]({'where':{'id':_0x187d1b['params']['id']}})[_0x720e('0x28')](handleEntityNotFound(_0x35e8ab,null))[_0x720e('0x28')](function(_0x4914d9){if(_0x4914d9){_0x187d1b[_0x720e('0x4e')]['AccountId']=_0x4914d9['id'];_0x187d1b['body'][_0x720e('0x55')]=integrations[_0x720e('0x56')](_0x187d1b['body'][_0x720e('0x57')],_0x187d1b[_0x720e('0x4e')][_0x720e('0x33')]);_0x187d1b['body'][_0x720e('0x58')]=integrations['getDescriptions'](_0x187d1b[_0x720e('0x4e')][_0x720e('0x57')],_0x187d1b['body'][_0x720e('0x33')]);return db[_0x720e('0x59')][_0x720e('0x4d')](_0x187d1b[_0x720e('0x4e')],{'include':[{'model':db['SugarcrmField'],'as':_0x720e('0x55')},{'model':db['SugarcrmField'],'as':_0x720e('0x58')}]});}return null;})[_0x720e('0x28')](respondWithResult(_0x35e8ab,null))['catch'](handleError(_0x35e8ab,null));};exports[_0x720e('0x5a')]=function(_0x52b801,_0x123e60,_0xcce36a){var _0x108363='';var _0x48b946=['id',_0x720e('0x2d'),_0x720e('0x5b'),_0x720e('0x5c'),_0x720e('0x5d'),_0x720e('0x5e'),_0x720e('0x5f'),'duration_minutes',_0x720e('0x60'),_0x720e('0x61'),_0x720e('0x62'),_0x720e('0x63')];return db[_0x720e('0x46')][_0x720e('0x51')]({'where':{'id':_0x52b801[_0x720e('0x4f')]['id']},'attributes':['id',_0x720e('0x64'),_0x720e('0x65'),_0x720e('0x66')]})['then'](handleEntityNotFound(_0x123e60,null))[_0x720e('0x28')](function(_0x13a598){if(_0x13a598){_0x108363=_0x13a598[_0x720e('0x66')];var _0x4237c7=_0x108363[_0x720e('0x67')](-0x1);if(_0x4237c7==='/'){_0x108363=_0x108363[_0x720e('0x68')](0x0,_0x108363[_0x720e('0x69')](_0x4237c7));}return rp({'method':_0x720e('0x6a'),'uri':util['format'](_0x720e('0x6b'),_0x108363,_0x720e('0x6c')),'json':!![],'form':{'method':_0x720e('0x6d'),'input_type':_0x720e('0x6e'),'response_type':_0x720e('0x6e'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x13a598[_0x720e('0x64')],'password':_0x13a598[_0x720e('0x65')],'encryption':_0x720e('0x6f')},'application':_0x720e('0x70')})}});}})[_0x720e('0x28')](function(_0x548933){if(_0x548933&&_0x548933['name']!==_0x720e('0x71')&&_0x548933[_0x720e('0x2d')]!==_0x720e('0x72')){return rp({'method':_0x720e('0x6a'),'uri':util[_0x720e('0x73')]('%s%s',_0x108363,_0x720e('0x6c')),'json':!![],'form':{'method':_0x720e('0x74'),'input_type':_0x720e('0x6e'),'response_type':'JSON','rest_data':JSON[_0x720e('0x75')]({'session':_0x548933['id'],'module_name':_0x720e('0x76')})}})[_0x720e('0x28')](function(_0x3a369a){if(_0x3a369a){var _0xf27b8d=_[_0x720e('0x77')](_0x3a369a['module_fields']);_['remove'](_0xf27b8d,function(_0x3f7679){return _0x48b946[_0x720e('0x78')](_0x3f7679[_0x720e('0x2d')]);});return{'count':_0xf27b8d[_0x720e('0x3c')],'rows':_['map'](_0xf27b8d,function(_0x56accd){return{'id':_0x56accd['name'],'name':_0x56accd[_0x720e('0x79')],'custom':_[_0x720e('0x7a')](_0x56accd['name'],'_c')?!![]:![],'options':_0x56accd[_0x720e('0x45')]?_[_0x720e('0x30')](_[_0x720e('0x77')](_0x56accd[_0x720e('0x45')]),function(_0x4fd653){return{'name':_0x4fd653['value'],'value':_0x4fd653[_0x720e('0x2d')]};}):[]};})};}})[_0x720e('0x28')](respondWithResult(_0x123e60,null))[_0x720e('0x4c')](function(_0x139dd6){var _0x2fb770=_0x52b801[_0x720e('0x36')][_0x720e('0x7b')]?0x1f4:_0x139dd6[_0x720e('0x7c')]||0x1f4;logger['error'](_0x720e('0x7d'),_0x720e('0x5a'),_0x2fb770,JSON['stringify'](_0x139dd6));delete _0x139dd6['name'];if(_0x2fb770===0x191){_0x2fb770=0x190;}_0x123e60[_0x720e('0x1e')](_0x2fb770)[_0x720e('0x2e')](_0x52b801['query'][_0x720e('0x7b')]?{'message':_0x720e('0x7e'),'statusCode':_0x139dd6[_0x720e('0x7c')]}:_0x139dd6);});}else{var _0x153872=0x1f4;_0x123e60[_0x720e('0x1e')](_0x153872)[_0x720e('0x2e')]({'message':_0x720e('0x7e'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x4703=['offset','set','Content-Range','update','then','destroy','error','stack','name','send','map','SugarcrmAccount','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','include','rows','catch','show','params','options','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','/service/v4_1/rest.php','get_module_fields','remove','includes','label','endsWith','values','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count'];(function(_0x518f34,_0x18b5c3){var _0x5c046f=function(_0x1badcf){while(--_0x1badcf){_0x518f34['push'](_0x518f34['shift']());}};_0x5c046f(++_0x18b5c3);}(_0x4703,0xd2));var _0x3470=function(_0xbf7dce,_0x337a98){_0xbf7dce=_0xbf7dce-0x0;var _0x46f0a7=_0x4703[_0xbf7dce];return _0x46f0a7;};'use strict';var emlformat=require(_0x3470('0x0'));var rimraf=require(_0x3470('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3470('0x2'));var rp=require(_0x3470('0x3'));var moment=require(_0x3470('0x4'));var BPromise=require(_0x3470('0x5'));var Mustache=require(_0x3470('0x6'));var util=require(_0x3470('0x7'));var path=require('path');var sox=require(_0x3470('0x8'));var csv=require(_0x3470('0x9'));var ejs=require(_0x3470('0xa'));var fs=require('fs');var fs_extra=require(_0x3470('0xb'));var _=require('lodash');var squel=require(_0x3470('0xc'));var crypto=require(_0x3470('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3470('0xe'));var toCsv=require(_0x3470('0x9'));var querystring=require(_0x3470('0xf'));var Papa=require(_0x3470('0x10'));var Redis=require(_0x3470('0x11'));var authService=require(_0x3470('0x12'));var qs=require(_0x3470('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3470('0x14'))(_0x3470('0x15'));var utils=require(_0x3470('0x16'));var config=require(_0x3470('0x17'));var licenseUtil=require(_0x3470('0x18'));var db=require(_0x3470('0x19'))['db'];var integrations=require(_0x3470('0x1a'));function respondWithStatusCode(_0x494ef3,_0x1f6c6){_0x1f6c6=_0x1f6c6||0xcc;return function(_0x27d35a){if(_0x27d35a){return _0x494ef3[_0x3470('0x1b')](_0x1f6c6);}return _0x494ef3[_0x3470('0x1c')](_0x1f6c6)[_0x3470('0x1d')]();};}function respondWithResult(_0x3d27ab,_0x36bfd1){_0x36bfd1=_0x36bfd1||0xc8;return function(_0x2a669d){if(_0x2a669d){return _0x3d27ab['status'](_0x36bfd1)[_0x3470('0x1e')](_0x2a669d);}};}function respondWithFilteredResult(_0x55a242,_0x2eb181){return function(_0x19114d){if(_0x19114d){var _0x4282c0=typeof _0x2eb181['offset']===_0x3470('0x1f')&&typeof _0x2eb181[_0x3470('0x20')]==='undefined';var _0x4b0ad2=_0x19114d[_0x3470('0x21')];var _0x1f0cdf=_0x4282c0?0x0:_0x2eb181[_0x3470('0x22')];var _0x2e61c8=_0x4282c0?_0x19114d[_0x3470('0x21')]:_0x2eb181[_0x3470('0x22')]+_0x2eb181[_0x3470('0x20')];var _0x1c32cc;if(_0x2e61c8>=_0x4b0ad2){_0x2e61c8=_0x4b0ad2;_0x1c32cc=0xc8;}else{_0x1c32cc=0xce;}_0x55a242[_0x3470('0x1c')](_0x1c32cc);return _0x55a242[_0x3470('0x23')](_0x3470('0x24'),_0x1f0cdf+'-'+_0x2e61c8+'/'+_0x4b0ad2)[_0x3470('0x1e')](_0x19114d);}return null;};}function patchUpdates(_0x64874){return function(_0x2d65af){try{jsonpatch['apply'](_0x2d65af,_0x64874,!![]);}catch(_0xa44dde){return BPromise['reject'](_0xa44dde);}return _0x2d65af['save']();};}function saveUpdates(_0x384280,_0x6c5cee){return function(_0x103665){if(_0x103665){return _0x103665[_0x3470('0x25')](_0x384280)[_0x3470('0x26')](function(_0x5804ea){return _0x5804ea;});}return null;};}function removeEntity(_0x2b4f7e,_0x233808){return function(_0xa12fa6){if(_0xa12fa6){return _0xa12fa6[_0x3470('0x27')]()[_0x3470('0x26')](function(){_0x2b4f7e[_0x3470('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49e4b1,_0xad3da3){return function(_0x14eeb1){if(!_0x14eeb1){_0x49e4b1[_0x3470('0x1b')](0x194);}return _0x14eeb1;};}function handleError(_0xfab0ca,_0x2c4253){_0x2c4253=_0x2c4253||0x1f4;return function(_0x52f87b){logger[_0x3470('0x28')](_0x52f87b[_0x3470('0x29')]);if(_0x52f87b['name']){delete _0x52f87b[_0x3470('0x2a')];}_0xfab0ca[_0x3470('0x1c')](_0x2c4253)[_0x3470('0x2b')](_0x52f87b);};}exports['index']=function(_0x1ae626,_0x4e0a02){var _0x3814d1={},_0x2fdfcf={},_0x124f43={'count':0x0,'rows':[]};var _0x491284=_[_0x3470('0x2c')](db[_0x3470('0x2d')][_0x3470('0x2e')],function(_0x10cd69){return{'name':_0x10cd69['fieldName'],'type':_0x10cd69[_0x3470('0x2f')][_0x3470('0x30')]};});_0x2fdfcf['model']=_[_0x3470('0x2c')](_0x491284,_0x3470('0x2a'));_0x2fdfcf[_0x3470('0x31')]=_[_0x3470('0x32')](_0x1ae626[_0x3470('0x31')]);_0x2fdfcf['filters']=_[_0x3470('0x33')](_0x2fdfcf[_0x3470('0x34')],_0x2fdfcf['query']);_0x3814d1[_0x3470('0x35')]=_[_0x3470('0x33')](_0x2fdfcf['model'],qs[_0x3470('0x36')](_0x1ae626[_0x3470('0x31')][_0x3470('0x36')]));_0x3814d1['attributes']=_0x3814d1[_0x3470('0x35')][_0x3470('0x37')]?_0x3814d1['attributes']:_0x2fdfcf[_0x3470('0x34')];if(!_0x1ae626[_0x3470('0x31')][_0x3470('0x38')](_0x3470('0x39'))){_0x3814d1[_0x3470('0x20')]=qs[_0x3470('0x20')](_0x1ae626['query'][_0x3470('0x20')]);_0x3814d1[_0x3470('0x22')]=qs[_0x3470('0x22')](_0x1ae626['query']['offset']);}_0x3814d1[_0x3470('0x3a')]=qs[_0x3470('0x3b')](_0x1ae626[_0x3470('0x31')]['sort']);_0x3814d1[_0x3470('0x3c')]=qs[_0x3470('0x3d')](_[_0x3470('0x3e')](_0x1ae626[_0x3470('0x31')],_0x2fdfcf[_0x3470('0x3d')]),_0x491284);if(_0x1ae626[_0x3470('0x31')][_0x3470('0x3f')]){_0x3814d1[_0x3470('0x3c')]=_['merge'](_0x3814d1[_0x3470('0x3c')],{'$or':_[_0x3470('0x2c')](_0x491284,function(_0x2d1f6a){if(_0x2d1f6a[_0x3470('0x2f')]!==_0x3470('0x40')){var _0x1acc3b={};_0x1acc3b[_0x2d1f6a[_0x3470('0x2a')]]={'$like':'%'+_0x1ae626['query']['filter']+'%'};return _0x1acc3b;}})});}_0x3814d1=_[_0x3470('0x41')]({},_0x3814d1,_0x1ae626['options']);var _0x56091c={'where':_0x3814d1[_0x3470('0x3c')]};return db[_0x3470('0x2d')]['count'](_0x56091c)[_0x3470('0x26')](function(_0x3bf716){_0x124f43['count']=_0x3bf716;if(_0x1ae626[_0x3470('0x31')]['includeAll']){_0x3814d1[_0x3470('0x42')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x3814d1);})[_0x3470('0x26')](function(_0x158604){_0x124f43[_0x3470('0x43')]=_0x158604;return _0x124f43;})[_0x3470('0x26')](respondWithFilteredResult(_0x4e0a02,_0x3814d1))[_0x3470('0x44')](handleError(_0x4e0a02,null));};exports[_0x3470('0x45')]=function(_0xdedccf,_0x551a23){var _0x8057eb={'raw':![],'where':{'id':_0xdedccf[_0x3470('0x46')]['id']}},_0x1f5ecd={};_0x1f5ecd[_0x3470('0x34')]=_[_0x3470('0x32')](db['SugarcrmAccount'][_0x3470('0x2e')]);_0x1f5ecd['query']=_['keys'](_0xdedccf[_0x3470('0x31')]);_0x1f5ecd[_0x3470('0x3d')]=_['intersection'](_0x1f5ecd[_0x3470('0x34')],_0x1f5ecd['query']);_0x8057eb[_0x3470('0x35')]=_[_0x3470('0x33')](_0x1f5ecd['model'],qs[_0x3470('0x36')](_0xdedccf[_0x3470('0x31')][_0x3470('0x36')]));_0x8057eb[_0x3470('0x35')]=_0x8057eb[_0x3470('0x35')][_0x3470('0x37')]?_0x8057eb[_0x3470('0x35')]:_0x1f5ecd[_0x3470('0x34')];if(_0xdedccf['query']['includeAll']){_0x8057eb[_0x3470('0x42')]=[{'all':!![]}];}_0x8057eb=_[_0x3470('0x41')]({},_0x8057eb,_0xdedccf[_0x3470('0x47')]);return db[_0x3470('0x2d')][_0x3470('0x48')](_0x8057eb)[_0x3470('0x26')](handleEntityNotFound(_0x551a23,null))['then'](respondWithResult(_0x551a23,null))[_0x3470('0x44')](handleError(_0x551a23,null));};exports[_0x3470('0x49')]=function(_0x4a004d,_0x1a5ece){return db[_0x3470('0x2d')][_0x3470('0x49')](_0x4a004d['body'],{})[_0x3470('0x26')](respondWithResult(_0x1a5ece,0xc9))[_0x3470('0x44')](handleError(_0x1a5ece,null));};exports[_0x3470('0x25')]=function(_0xcd65a9,_0x510bdc){if(_0xcd65a9['body']['id']){delete _0xcd65a9['body']['id'];}return db[_0x3470('0x2d')][_0x3470('0x48')]({'where':{'id':_0xcd65a9[_0x3470('0x46')]['id']}})[_0x3470('0x26')](handleEntityNotFound(_0x510bdc,null))[_0x3470('0x26')](saveUpdates(_0xcd65a9[_0x3470('0x4a')],null))['then'](respondWithResult(_0x510bdc,null))[_0x3470('0x44')](handleError(_0x510bdc,null));};exports[_0x3470('0x27')]=function(_0x5ce137,_0x306e9e){return db['SugarcrmAccount'][_0x3470('0x48')]({'where':{'id':_0x5ce137[_0x3470('0x46')]['id']}})[_0x3470('0x26')](handleEntityNotFound(_0x306e9e,null))['then'](removeEntity(_0x306e9e,null))[_0x3470('0x44')](handleError(_0x306e9e,null));};exports[_0x3470('0x4b')]=function(_0x5ade67,_0x218247,_0x24a4b2){var _0x110fd3={};var _0x4199c1={};var _0x3f0c59;var _0x143874;return db[_0x3470('0x2d')][_0x3470('0x4c')]({'where':{'id':_0x5ade67[_0x3470('0x46')]['id']}})[_0x3470('0x26')](handleEntityNotFound(_0x218247,null))[_0x3470('0x26')](function(_0xda5950){if(_0xda5950){_0x3f0c59=_0xda5950;_0x4199c1[_0x3470('0x34')]=_[_0x3470('0x32')](db[_0x3470('0x4d')][_0x3470('0x2e')]);_0x4199c1[_0x3470('0x31')]=_[_0x3470('0x32')](_0x5ade67[_0x3470('0x31')]);_0x4199c1[_0x3470('0x3d')]=_[_0x3470('0x33')](_0x4199c1[_0x3470('0x34')],_0x4199c1[_0x3470('0x31')]);_0x110fd3['attributes']=_[_0x3470('0x33')](_0x4199c1[_0x3470('0x34')],qs[_0x3470('0x36')](_0x5ade67[_0x3470('0x31')][_0x3470('0x36')]));_0x110fd3[_0x3470('0x35')]=_0x110fd3[_0x3470('0x35')][_0x3470('0x37')]?_0x110fd3[_0x3470('0x35')]:_0x4199c1[_0x3470('0x34')];_0x110fd3[_0x3470('0x3a')]=qs[_0x3470('0x3b')](_0x5ade67['query'][_0x3470('0x3b')]);_0x110fd3[_0x3470('0x3c')]=qs[_0x3470('0x3d')](_[_0x3470('0x3e')](_0x5ade67['query'],_0x4199c1[_0x3470('0x3d')]));if(_0x5ade67['query']['filter']){_0x110fd3[_0x3470('0x3c')]=_['merge'](_0x110fd3[_0x3470('0x3c')],{'$or':_[_0x3470('0x2c')](_0x110fd3['attributes'],function(_0x3a4f83){var _0x49fb24={};_0x49fb24[_0x3a4f83]={'$like':'%'+_0x5ade67[_0x3470('0x31')][_0x3470('0x3f')]+'%'};return _0x49fb24;})});}_0x110fd3=_[_0x3470('0x41')]({},_0x110fd3,_0x5ade67[_0x3470('0x47')]);return _0x3f0c59[_0x3470('0x4b')](_0x110fd3);}})[_0x3470('0x26')](function(_0x2fa2bc){if(_0x2fa2bc){_0x143874=_0x2fa2bc[_0x3470('0x37')];if(!_0x5ade67[_0x3470('0x31')][_0x3470('0x38')](_0x3470('0x39'))){_0x110fd3['limit']=qs[_0x3470('0x20')](_0x5ade67[_0x3470('0x31')][_0x3470('0x20')]);_0x110fd3['offset']=qs[_0x3470('0x22')](_0x5ade67[_0x3470('0x31')]['offset']);}return _0x3f0c59[_0x3470('0x4b')](_0x110fd3);}})[_0x3470('0x26')](function(_0x2c21e0){if(_0x2c21e0){return _0x2c21e0?{'count':_0x143874,'rows':_0x2c21e0}:null;}})[_0x3470('0x26')](respondWithResult(_0x218247,null))['catch'](handleError(_0x218247,null));};exports[_0x3470('0x4e')]=function(_0x7af05f,_0x28f309,_0x2267a7){if(_0x7af05f[_0x3470('0x4a')]['id']){delete _0x7af05f[_0x3470('0x4a')]['id'];}return db[_0x3470('0x2d')][_0x3470('0x4c')]({'where':{'id':_0x7af05f[_0x3470('0x46')]['id']}})[_0x3470('0x26')](handleEntityNotFound(_0x28f309,null))[_0x3470('0x26')](function(_0x123f19){if(_0x123f19){_0x7af05f[_0x3470('0x4a')][_0x3470('0x4f')]=_0x123f19['id'];_0x7af05f[_0x3470('0x4a')][_0x3470('0x50')]=integrations[_0x3470('0x51')](_0x7af05f[_0x3470('0x4a')][_0x3470('0x52')],_0x7af05f[_0x3470('0x4a')][_0x3470('0x2f')]);_0x7af05f[_0x3470('0x4a')][_0x3470('0x53')]=integrations[_0x3470('0x54')](_0x7af05f['body'][_0x3470('0x52')],_0x7af05f[_0x3470('0x4a')][_0x3470('0x2f')]);return db[_0x3470('0x4d')][_0x3470('0x49')](_0x7af05f['body'],{'include':[{'model':db[_0x3470('0x55')],'as':'Subjects'},{'model':db[_0x3470('0x55')],'as':_0x3470('0x53')}]});}return null;})[_0x3470('0x26')](respondWithResult(_0x28f309,null))['catch'](handleError(_0x28f309,null));};exports[_0x3470('0x56')]=function(_0x195a56,_0xee9e38,_0x5de2d6){var _0xfb89ab='';var _0x21bf76=['id',_0x3470('0x2a'),_0x3470('0x57'),_0x3470('0x58'),_0x3470('0x59'),'date_start','duration_hours',_0x3470('0x5a'),_0x3470('0x5b'),_0x3470('0x5c'),_0x3470('0x5d'),_0x3470('0x5e')];return db[_0x3470('0x2d')][_0x3470('0x4c')]({'where':{'id':_0x195a56[_0x3470('0x46')]['id']},'attributes':['id',_0x3470('0x5f'),_0x3470('0x60'),_0x3470('0x61')]})[_0x3470('0x26')](handleEntityNotFound(_0xee9e38,null))['then'](function(_0xd2de06){if(_0xd2de06){_0xfb89ab=_0xd2de06[_0x3470('0x61')];var _0x54330f=_0xfb89ab[_0x3470('0x62')](-0x1);if(_0x54330f==='/'){_0xfb89ab=_0xfb89ab[_0x3470('0x63')](0x0,_0xfb89ab[_0x3470('0x64')](_0x54330f));}return rp({'method':_0x3470('0x65'),'uri':util[_0x3470('0x66')](_0x3470('0x67'),_0xfb89ab,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'login','input_type':_0x3470('0x68'),'response_type':_0x3470('0x68'),'rest_data':JSON[_0x3470('0x69')]({'user_auth':{'user_name':_0xd2de06[_0x3470('0x5f')],'password':_0xd2de06[_0x3470('0x60')],'encryption':_0x3470('0x6a')},'application':_0x3470('0x6b')})}});}})[_0x3470('0x26')](function(_0x494946){if(_0x494946&&_0x494946['name']!==_0x3470('0x6c')&&_0x494946[_0x3470('0x2a')]!==_0x3470('0x6d')){return rp({'method':_0x3470('0x65'),'uri':util[_0x3470('0x66')](_0x3470('0x67'),_0xfb89ab,_0x3470('0x6e')),'json':!![],'form':{'method':_0x3470('0x6f'),'input_type':_0x3470('0x68'),'response_type':_0x3470('0x68'),'rest_data':JSON[_0x3470('0x69')]({'session':_0x494946['id'],'module_name':'Calls'})}})[_0x3470('0x26')](function(_0x23e83f){if(_0x23e83f){var _0x14d4ca=_['values'](_0x23e83f['module_fields']);_[_0x3470('0x70')](_0x14d4ca,function(_0x13aace){return _0x21bf76[_0x3470('0x71')](_0x13aace[_0x3470('0x2a')]);});return{'count':_0x14d4ca[_0x3470('0x37')],'rows':_[_0x3470('0x2c')](_0x14d4ca,function(_0x2adff9){return{'id':_0x2adff9[_0x3470('0x2a')],'name':_0x2adff9[_0x3470('0x72')],'custom':_[_0x3470('0x73')](_0x2adff9[_0x3470('0x2a')],'_c')?!![]:![],'options':_0x2adff9[_0x3470('0x47')]?_[_0x3470('0x2c')](_[_0x3470('0x74')](_0x2adff9[_0x3470('0x47')]),function(_0x166914){return{'name':_0x166914[_0x3470('0x75')],'value':_0x166914[_0x3470('0x2a')]};}):[]};})};}})[_0x3470('0x26')](respondWithResult(_0xee9e38,null))[_0x3470('0x44')](function(_0x3109bb){var _0x2f7bfb=_0x195a56[_0x3470('0x31')][_0x3470('0x76')]?0x1f4:_0x3109bb[_0x3470('0x77')]||0x1f4;logger['error'](_0x3470('0x78'),'getFields',_0x2f7bfb,JSON[_0x3470('0x69')](_0x3109bb));delete _0x3109bb[_0x3470('0x2a')];if(_0x2f7bfb===0x191){_0x2f7bfb=0x190;}_0xee9e38[_0x3470('0x1c')](_0x2f7bfb)[_0x3470('0x2b')](_0x195a56['query']['test']?{'message':_0x3470('0x79'),'statusCode':_0x3109bb[_0x3470('0x77')]}:_0x3109bb);});}else{var _0x1967af=0x1f4;_0xee9e38[_0x3470('0x1c')](_0x1967af)['send']({'message':_0x3470('0x79'),'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 eb8da23..ea02a3b 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 _0x2980=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','int_sugarcrm_accounts','lodash'];(function(_0x398d85,_0x2465d7){var _0x33c2bb=function(_0x4aa229){while(--_0x4aa229){_0x398d85['push'](_0x398d85['shift']());}};_0x33c2bb(++_0x2465d7);}(_0x2980,0x192));var _0x0298=function(_0x2a1182,_0xee0959){_0x2a1182=_0x2a1182-0x0;var _0x4e38d5=_0x2980[_0x2a1182];return _0x4e38d5;};'use strict';var _=require(_0x0298('0x0'));var util=require(_0x0298('0x1'));var logger=require(_0x0298('0x2'))(_0x0298('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0298('0x4'));var fs=require('fs');var path=require(_0x0298('0x5'));var rimraf=require(_0x0298('0x6'));var config=require(_0x0298('0x7'));var attributes=require(_0x0298('0x8'));var integrations=require(_0x0298('0x9'));module[_0x0298('0xa')]=function(_0x50d735,_0x7eda03){return _0x50d735[_0x0298('0xb')]('SugarcrmAccount',attributes,{'tableName':_0x0298('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc77=['request-promise','path','rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','api','bluebird'];(function(_0x5483bd,_0x5936e3){var _0x2dcfbf=function(_0x1f77fe){while(--_0x1f77fe){_0x5483bd['push'](_0x5483bd['shift']());}};_0x2dcfbf(++_0x5936e3);}(_0xbc77,0x15d));var _0x7bc7=function(_0x4d180c,_0x45c68e){_0x4d180c=_0x4d180c-0x0;var _0x49b57e=_0xbc77[_0x4d180c];return _0x49b57e;};'use strict';var _=require(_0x7bc7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7bc7('0x1'));var moment=require('moment');var BPromise=require(_0x7bc7('0x2'));var rp=require(_0x7bc7('0x3'));var fs=require('fs');var path=require(_0x7bc7('0x4'));var rimraf=require(_0x7bc7('0x5'));var config=require('../../config/environment');var attributes=require(_0x7bc7('0x6'));var integrations=require(_0x7bc7('0x7'));module['exports']=function(_0x4b5e0e,_0x2ed951){return _0x4b5e0e[_0x7bc7('0x8')](_0x7bc7('0x9'),attributes,{'tableName':_0x7bc7('0xa'),'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 1efc3b0..3b977b8 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 _0xc5de=['rpc','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','info','ShowSugarcrmAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x15b697,_0x3466e7){var _0xf9cee1=function(_0x11bf8a){while(--_0x11bf8a){_0x15b697['push'](_0x15b697['shift']());}};_0xf9cee1(++_0x3466e7);}(_0xc5de,0x9e));var _0xec5d=function(_0x1b8bda,_0x43ad31){_0x1b8bda=_0x1b8bda-0x0;var _0x1f7050=_0xc5de[_0x1b8bda];return _0x1f7050;};'use strict';var _=require(_0xec5d('0x0'));var util=require('util');var moment=require(_0xec5d('0x1'));var BPromise=require(_0xec5d('0x2'));var rs=require(_0xec5d('0x3'));var fs=require('fs');var Redis=require(_0xec5d('0x4'));var db=require(_0xec5d('0x5'))['db'];var utils=require(_0xec5d('0x6'));var logger=require('../../config/logger')(_0xec5d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xb43519,_0x21fd90,_0x5da859){return new BPromise(function(_0x13b184,_0x1950f7){return client[_0xec5d('0x8')](_0xb43519,_0x5da859)[_0xec5d('0x9')](function(_0x20a06a){logger['info'](_0xec5d('0xa'),_0x21fd90,_0xec5d('0xb'));logger[_0xec5d('0xc')](_0xec5d('0xd'),_0x21fd90,_0xec5d('0xb'),JSON[_0xec5d('0xe')](_0x20a06a));if(_0x20a06a[_0xec5d('0xf')]){if(_0x20a06a[_0xec5d('0xf')][_0xec5d('0x10')]===0x1f4){logger[_0xec5d('0xf')](_0xec5d('0xa'),_0x21fd90,_0x20a06a[_0xec5d('0xf')][_0xec5d('0x11')]);return _0x1950f7(_0x20a06a[_0xec5d('0xf')][_0xec5d('0x11')]);}logger[_0xec5d('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x21fd90,_0x20a06a[_0xec5d('0xf')]['message']);return _0x13b184(_0x20a06a[_0xec5d('0xf')]['message']);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x21fd90,_0xec5d('0xb'));_0x13b184(_0x20a06a['result'][_0xec5d('0x11')]);}})[_0xec5d('0x12')](function(_0x535c15){logger[_0xec5d('0xf')](_0xec5d('0xa'),_0x21fd90,_0x535c15);_0x1950f7(_0x535c15);});});}exports[_0xec5d('0x13')]=function(_0x4180ec){var _0x4310e3=this;return new Promise(function(_0x2d2009,_0x4ef966){return db[_0xec5d('0x14')][_0xec5d('0x15')]({'raw':_0x4180ec[_0xec5d('0x16')]?_0x4180ec[_0xec5d('0x16')][_0xec5d('0x17')]===undefined?!![]:![]:!![],'where':_0x4180ec[_0xec5d('0x16')]?_0x4180ec['options'][_0xec5d('0x18')]||null:null,'attributes':_0x4180ec[_0xec5d('0x16')]?_0x4180ec[_0xec5d('0x16')][_0xec5d('0x19')]||null:null,'limit':_0x4180ec['options']?_0x4180ec[_0xec5d('0x16')][_0xec5d('0x1a')]||null:null,'include':_0x4180ec['options']?_0x4180ec[_0xec5d('0x16')][_0xec5d('0x1b')]?_[_0xec5d('0x1c')](_0x4180ec[_0xec5d('0x16')][_0xec5d('0x1b')],function(_0x4c192c){return{'model':db[_0x4c192c[_0xec5d('0x1d')]],'as':_0x4c192c['as'],'attributes':_0x4c192c['attributes'],'include':_0x4c192c[_0xec5d('0x1b')]?_[_0xec5d('0x1c')](_0x4c192c['include'],function(_0xc923a3){return{'model':db[_0xc923a3[_0xec5d('0x1d')]],'as':_0xc923a3['as'],'attributes':_0xc923a3[_0xec5d('0x19')],'include':_0xc923a3['include']?_[_0xec5d('0x1c')](_0xc923a3[_0xec5d('0x1b')],function(_0x11980b){return{'model':db[_0x11980b[_0xec5d('0x1d')]],'as':_0x11980b['as'],'attributes':_0x11980b['attributes']};}):[]};}):[]};}):[]:[]})[_0xec5d('0x9')](function(_0x3e3977){logger[_0xec5d('0x1e')](_0xec5d('0x13'),_0x4180ec);logger[_0xec5d('0xc')]('GetSugarcrmAccount',_0x4180ec,JSON['stringify'](_0x3e3977));_0x2d2009(_0x3e3977);})['catch'](function(_0x54654d){logger[_0xec5d('0xf')](_0xec5d('0x13'),_0x54654d[_0xec5d('0x11')],_0x4180ec);_0x4ef966(_0x4310e3[_0xec5d('0xf')](0x1f4,_0x54654d[_0xec5d('0x11')]));});});};exports[_0xec5d('0x1f')]=function(_0x977cea){var _0x5f45a1=this;return new Promise(function(_0x1d7b81,_0x594566){return db['SugarcrmAccount'][_0xec5d('0x20')]({'raw':_0x977cea[_0xec5d('0x16')]?_0x977cea[_0xec5d('0x16')][_0xec5d('0x17')]===undefined?!![]:![]:!![],'where':_0x977cea[_0xec5d('0x16')]?_0x977cea[_0xec5d('0x16')][_0xec5d('0x18')]||null:null,'attributes':_0x977cea[_0xec5d('0x16')]?_0x977cea[_0xec5d('0x16')][_0xec5d('0x19')]||null:null,'include':_0x977cea['options']?_0x977cea[_0xec5d('0x16')][_0xec5d('0x1b')]?_[_0xec5d('0x1c')](_0x977cea['options'][_0xec5d('0x1b')],function(_0x3af520){return{'model':db[_0x3af520[_0xec5d('0x1d')]],'as':_0x3af520['as'],'attributes':_0x3af520['attributes'],'include':_0x3af520[_0xec5d('0x1b')]?_['map'](_0x3af520[_0xec5d('0x1b')],function(_0x936b2e){return{'model':db[_0x936b2e[_0xec5d('0x1d')]],'as':_0x936b2e['as'],'attributes':_0x936b2e[_0xec5d('0x19')],'include':_0x936b2e['include']?_['map'](_0x936b2e['include'],function(_0x3fbb0c){return{'model':db[_0x3fbb0c['model']],'as':_0x3fbb0c['as'],'attributes':_0x3fbb0c[_0xec5d('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x26a016){logger[_0xec5d('0x1e')]('ShowSugarcrmAccount',_0x977cea);logger[_0xec5d('0xc')](_0xec5d('0x1f'),_0x977cea,JSON[_0xec5d('0xe')](_0x26a016));_0x1d7b81(_0x26a016);})[_0xec5d('0x12')](function(_0x2d7089){logger[_0xec5d('0xf')](_0xec5d('0x1f'),_0x2d7089['message'],_0x977cea);_0x594566(_0x5f45a1[_0xec5d('0xf')](0x1f4,_0x2d7089['message']));});});}; \ No newline at end of file +var _0xa2e7=['info','request\x20sent','debug','error','code','SugarcrmAccount,\x20%s,\x20%s','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','map','include','model','stringify','ShowSugarcrmAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x20c591,_0x4c7894){var _0x4a1fe4=function(_0x1bddaa){while(--_0x1bddaa){_0x20c591['push'](_0x20c591['shift']());}};_0x4a1fe4(++_0x4c7894);}(_0xa2e7,0x1d2));var _0x7a2e=function(_0x63155e,_0x451662){_0x63155e=_0x63155e-0x0;var _0x4f38a3=_0xa2e7[_0x63155e];return _0x4f38a3;};'use strict';var _=require(_0x7a2e('0x0'));var util=require(_0x7a2e('0x1'));var moment=require(_0x7a2e('0x2'));var BPromise=require('bluebird');var rs=require(_0x7a2e('0x3'));var fs=require('fs');var Redis=require(_0x7a2e('0x4'));var db=require(_0x7a2e('0x5'))['db'];var utils=require(_0x7a2e('0x6'));var logger=require(_0x7a2e('0x7'))(_0x7a2e('0x8'));var config=require(_0x7a2e('0x9'));var jayson=require(_0x7a2e('0xa'));var client=jayson[_0x7a2e('0xb')][_0x7a2e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5efd64,_0x37aae7,_0x35eadf){return new BPromise(function(_0x4d273a,_0x199159){return client[_0x7a2e('0xd')](_0x5efd64,_0x35eadf)[_0x7a2e('0xe')](function(_0x1c1ed5){logger[_0x7a2e('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x37aae7,_0x7a2e('0x10'));logger[_0x7a2e('0x11')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x37aae7,_0x7a2e('0x10'),JSON['stringify'](_0x1c1ed5));if(_0x1c1ed5[_0x7a2e('0x12')]){if(_0x1c1ed5['error'][_0x7a2e('0x13')]===0x1f4){logger[_0x7a2e('0x12')](_0x7a2e('0x14'),_0x37aae7,_0x1c1ed5[_0x7a2e('0x12')]['message']);return _0x199159(_0x1c1ed5['error'][_0x7a2e('0x15')]);}logger[_0x7a2e('0x12')](_0x7a2e('0x14'),_0x37aae7,_0x1c1ed5[_0x7a2e('0x12')][_0x7a2e('0x15')]);return _0x4d273a(_0x1c1ed5[_0x7a2e('0x12')][_0x7a2e('0x15')]);}else{logger[_0x7a2e('0xf')](_0x7a2e('0x14'),_0x37aae7,_0x7a2e('0x10'));_0x4d273a(_0x1c1ed5[_0x7a2e('0x16')]['message']);}})[_0x7a2e('0x17')](function(_0x4ef334){logger[_0x7a2e('0x12')](_0x7a2e('0x14'),_0x37aae7,_0x4ef334);_0x199159(_0x4ef334);});});}exports[_0x7a2e('0x18')]=function(_0x11b2e7){var _0x5d2724=this;return new Promise(function(_0x2dfd0e,_0x4df2c6){return db[_0x7a2e('0x19')][_0x7a2e('0x1a')]({'raw':_0x11b2e7[_0x7a2e('0x1b')]?_0x11b2e7[_0x7a2e('0x1b')][_0x7a2e('0x1c')]===undefined?!![]:![]:!![],'where':_0x11b2e7[_0x7a2e('0x1b')]?_0x11b2e7[_0x7a2e('0x1b')][_0x7a2e('0x1d')]||null:null,'attributes':_0x11b2e7[_0x7a2e('0x1b')]?_0x11b2e7[_0x7a2e('0x1b')][_0x7a2e('0x1e')]||null:null,'limit':_0x11b2e7[_0x7a2e('0x1b')]?_0x11b2e7[_0x7a2e('0x1b')][_0x7a2e('0x1f')]||null:null,'include':_0x11b2e7['options']?_0x11b2e7[_0x7a2e('0x1b')]['include']?_[_0x7a2e('0x20')](_0x11b2e7['options'][_0x7a2e('0x21')],function(_0x2aba03){return{'model':db[_0x2aba03[_0x7a2e('0x22')]],'as':_0x2aba03['as'],'attributes':_0x2aba03[_0x7a2e('0x1e')],'include':_0x2aba03[_0x7a2e('0x21')]?_[_0x7a2e('0x20')](_0x2aba03['include'],function(_0x3e44d1){return{'model':db[_0x3e44d1[_0x7a2e('0x22')]],'as':_0x3e44d1['as'],'attributes':_0x3e44d1[_0x7a2e('0x1e')],'include':_0x3e44d1[_0x7a2e('0x21')]?_[_0x7a2e('0x20')](_0x3e44d1['include'],function(_0x5f4961){return{'model':db[_0x5f4961[_0x7a2e('0x22')]],'as':_0x5f4961['as'],'attributes':_0x5f4961[_0x7a2e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7a2e('0xe')](function(_0x330c3d){logger['info'](_0x7a2e('0x18'),_0x11b2e7);logger[_0x7a2e('0x11')](_0x7a2e('0x18'),_0x11b2e7,JSON[_0x7a2e('0x23')](_0x330c3d));_0x2dfd0e(_0x330c3d);})['catch'](function(_0x1f75ac){logger['error'](_0x7a2e('0x18'),_0x1f75ac[_0x7a2e('0x15')],_0x11b2e7);_0x4df2c6(_0x5d2724[_0x7a2e('0x12')](0x1f4,_0x1f75ac[_0x7a2e('0x15')]));});});};exports[_0x7a2e('0x24')]=function(_0xc23dac){var _0x3711d9=this;return new Promise(function(_0x161ed6,_0x23e765){return db[_0x7a2e('0x19')]['find']({'raw':_0xc23dac[_0x7a2e('0x1b')]?_0xc23dac[_0x7a2e('0x1b')][_0x7a2e('0x1c')]===undefined?!![]:![]:!![],'where':_0xc23dac[_0x7a2e('0x1b')]?_0xc23dac['options'][_0x7a2e('0x1d')]||null:null,'attributes':_0xc23dac[_0x7a2e('0x1b')]?_0xc23dac['options'][_0x7a2e('0x1e')]||null:null,'include':_0xc23dac[_0x7a2e('0x1b')]?_0xc23dac['options'][_0x7a2e('0x21')]?_['map'](_0xc23dac[_0x7a2e('0x1b')][_0x7a2e('0x21')],function(_0x2e0cac){return{'model':db[_0x2e0cac['model']],'as':_0x2e0cac['as'],'attributes':_0x2e0cac[_0x7a2e('0x1e')],'include':_0x2e0cac[_0x7a2e('0x21')]?_['map'](_0x2e0cac['include'],function(_0x3f2ef8){return{'model':db[_0x3f2ef8[_0x7a2e('0x22')]],'as':_0x3f2ef8['as'],'attributes':_0x3f2ef8[_0x7a2e('0x1e')],'include':_0x3f2ef8['include']?_[_0x7a2e('0x20')](_0x3f2ef8[_0x7a2e('0x21')],function(_0x2ff1b7){return{'model':db[_0x2ff1b7[_0x7a2e('0x22')]],'as':_0x2ff1b7['as'],'attributes':_0x2ff1b7[_0x7a2e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7a2e('0xe')](function(_0x414dcd){logger[_0x7a2e('0xf')](_0x7a2e('0x24'),_0xc23dac);logger[_0x7a2e('0x11')](_0x7a2e('0x24'),_0xc23dac,JSON[_0x7a2e('0x23')](_0x414dcd));_0x161ed6(_0x414dcd);})[_0x7a2e('0x17')](function(_0x39b82b){logger['error'](_0x7a2e('0x24'),_0x39b82b[_0x7a2e('0x15')],_0xc23dac);_0x23e765(_0x3711d9[_0x7a2e('0x12')](0x1f4,_0x39b82b[_0x7a2e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index deb098e..53ae91c 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 _0x4597=['index','/:id','show','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','isAuthenticated'];(function(_0x516293,_0x3632b2){var _0x35857e=function(_0x24abbb){while(--_0x24abbb){_0x516293['push'](_0x516293['shift']());}};_0x35857e(++_0x3632b2);}(_0x4597,0x13c));var _0x7459=function(_0x345f5e,_0x1d08fd){_0x345f5e=_0x345f5e-0x0;var _0x3365e8=_0x4597[_0x345f5e];return _0x3365e8;};'use strict';var multer=require('multer');var util=require(_0x7459('0x0'));var path=require(_0x7459('0x1'));var timeout=require(_0x7459('0x2'));var express=require(_0x7459('0x3'));var router=express[_0x7459('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7459('0x5'));var interaction=require(_0x7459('0x6'));var config=require('../../config/environment');var controller=require(_0x7459('0x7'));router['get']('/',auth[_0x7459('0x8')](),controller[_0x7459('0x9')]);router['get'](_0x7459('0xa'),auth['isAuthenticated'](),controller[_0x7459('0xb')]);router[_0x7459('0xc')](_0x7459('0xd'),auth['isAuthenticated'](),controller[_0x7459('0xe')]);router[_0x7459('0xc')](_0x7459('0xf'),auth[_0x7459('0x8')](),controller[_0x7459('0x10')]);router[_0x7459('0xc')](_0x7459('0x11'),auth[_0x7459('0x8')](),controller[_0x7459('0x12')]);router[_0x7459('0x13')]('/',auth[_0x7459('0x8')](),controller[_0x7459('0x14')]);router[_0x7459('0x15')](_0x7459('0xa'),auth['isAuthenticated'](),controller[_0x7459('0x16')]);router[_0x7459('0x17')](_0x7459('0xa'),auth[_0x7459('0x8')](),controller['destroy']);module[_0x7459('0x18')]=router; \ No newline at end of file +var _0x1cbd=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x384bbe,_0x1fb31d){var _0x49e066=function(_0x552b87){while(--_0x552b87){_0x384bbe['push'](_0x384bbe['shift']());}};_0x49e066(++_0x1fb31d);}(_0x1cbd,0x19c));var _0xd1cb=function(_0x270adf,_0x1daaa3){_0x270adf=_0x270adf-0x0;var _0x29eda9=_0x1cbd[_0x270adf];return _0x29eda9;};'use strict';var multer=require(_0xd1cb('0x0'));var util=require('util');var path=require(_0xd1cb('0x1'));var timeout=require(_0xd1cb('0x2'));var express=require(_0xd1cb('0x3'));var router=express[_0xd1cb('0x4')]();var fs_extra=require(_0xd1cb('0x5'));var auth=require(_0xd1cb('0x6'));var interaction=require(_0xd1cb('0x7'));var config=require('../../config/environment');var controller=require(_0xd1cb('0x8'));router[_0xd1cb('0x9')]('/',auth[_0xd1cb('0xa')](),controller[_0xd1cb('0xb')]);router[_0xd1cb('0x9')](_0xd1cb('0xc'),auth['isAuthenticated'](),controller[_0xd1cb('0xd')]);router[_0xd1cb('0x9')](_0xd1cb('0xe'),auth['isAuthenticated'](),controller[_0xd1cb('0xf')]);router[_0xd1cb('0x9')](_0xd1cb('0x10'),auth['isAuthenticated'](),controller[_0xd1cb('0x11')]);router[_0xd1cb('0x9')](_0xd1cb('0x12'),auth[_0xd1cb('0xa')](),controller[_0xd1cb('0x13')]);router[_0xd1cb('0x14')]('/',auth['isAuthenticated'](),controller[_0xd1cb('0x15')]);router[_0xd1cb('0x16')](_0xd1cb('0xc'),auth[_0xd1cb('0xa')](),controller[_0xd1cb('0x17')]);router['delete']('/:id',auth[_0xd1cb('0xa')](),controller[_0xd1cb('0x18')]);module[_0xd1cb('0x19')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 0a56790..8c344b4 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 _0xc727=['sequelize','STRING'];(function(_0x4d6c17,_0xbbf1b){var _0x29fe97=function(_0x527f7e){while(--_0x527f7e){_0x4d6c17['push'](_0x4d6c17['shift']());}};_0x29fe97(++_0xbbf1b);}(_0xc727,0x18e));var _0x7c72=function(_0x10e4d0,_0x587d71){_0x10e4d0=_0x10e4d0-0x0;var _0x4e4e20=_0xc727[_0x10e4d0];return _0x4e4e20;};'use strict';var Sequelize=require(_0x7c72('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7c72('0x1')]}}; \ No newline at end of file +var _0x59b9=['sequelize','exports','STRING'];(function(_0x734a07,_0x2c9a39){var _0x15b45a=function(_0x5de61b){while(--_0x5de61b){_0x734a07['push'](_0x734a07['shift']());}};_0x15b45a(++_0x2c9a39);}(_0x59b9,0x1e9));var _0x959b=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x59b9[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require(_0x959b('0x0'));module[_0x959b('0x1')]={'name':{'type':Sequelize[_0x959b('0x2')]},'description':{'type':Sequelize[_0x959b('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 792528b..fc2cfa1 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 _0x6fb5=['findAll','catch','show','params','keys','fields','options','find','create','body','getFields','findOne','getSubjects','SugarcrmField','length','hasOwnProperty','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','name','index','map','SugarcrmConfiguration','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','nolimit','order','sort','where','pick','type','filter','merge','includeAll','include'];(function(_0x2f42b9,_0x424040){var _0x56c3c7=function(_0x3e2a1f){while(--_0x3e2a1f){_0x2f42b9['push'](_0x2f42b9['shift']());}};_0x56c3c7(++_0x424040);}(_0x6fb5,0x1a1));var _0x56fb=function(_0x337b79,_0x6054da){_0x337b79=_0x337b79-0x0;var _0x35e7b5=_0x6fb5[_0x337b79];return _0x35e7b5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x56fb('0x0'));var zipdir=require(_0x56fb('0x1'));var jsonpatch=require(_0x56fb('0x2'));var rp=require(_0x56fb('0x3'));var moment=require(_0x56fb('0x4'));var BPromise=require(_0x56fb('0x5'));var Mustache=require(_0x56fb('0x6'));var util=require(_0x56fb('0x7'));var path=require(_0x56fb('0x8'));var sox=require(_0x56fb('0x9'));var csv=require(_0x56fb('0xa'));var ejs=require(_0x56fb('0xb'));var fs=require('fs');var fs_extra=require(_0x56fb('0xc'));var _=require(_0x56fb('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x56fb('0xe'));var toCsv=require(_0x56fb('0xa'));var querystring=require('querystring');var Papa=require(_0x56fb('0xf'));var Redis=require(_0x56fb('0x10'));var authService=require(_0x56fb('0x11'));var qs=require(_0x56fb('0x12'));var as=require(_0x56fb('0x13'));var hardwareService=require(_0x56fb('0x14'));var logger=require(_0x56fb('0x15'))('api');var utils=require(_0x56fb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x56fb('0x17'));var db=require(_0x56fb('0x18'))['db'];function respondWithStatusCode(_0x3ddc84,_0x338c9c){_0x338c9c=_0x338c9c||0xcc;return function(_0x4cc94d){if(_0x4cc94d){return _0x3ddc84[_0x56fb('0x19')](_0x338c9c);}return _0x3ddc84[_0x56fb('0x1a')](_0x338c9c)['end']();};}function respondWithResult(_0x2b6ea6,_0x4bfd52){_0x4bfd52=_0x4bfd52||0xc8;return function(_0x2f855b){if(_0x2f855b){return _0x2b6ea6[_0x56fb('0x1a')](_0x4bfd52)[_0x56fb('0x1b')](_0x2f855b);}};}function respondWithFilteredResult(_0x1150d2,_0x5308ec){return function(_0x565618){if(_0x565618){var _0x232da1=typeof _0x5308ec[_0x56fb('0x1c')]===_0x56fb('0x1d')&&typeof _0x5308ec['limit']===_0x56fb('0x1d');var _0x414e59=_0x565618['count'];var _0x119824=_0x232da1?0x0:_0x5308ec[_0x56fb('0x1c')];var _0x5cfda6=_0x232da1?_0x565618[_0x56fb('0x1e')]:_0x5308ec['offset']+_0x5308ec[_0x56fb('0x1f')];var _0x2fe234;if(_0x5cfda6>=_0x414e59){_0x5cfda6=_0x414e59;_0x2fe234=0xc8;}else{_0x2fe234=0xce;}_0x1150d2[_0x56fb('0x1a')](_0x2fe234);return _0x1150d2[_0x56fb('0x20')](_0x56fb('0x21'),_0x119824+'-'+_0x5cfda6+'/'+_0x414e59)[_0x56fb('0x1b')](_0x565618);}return null;};}function patchUpdates(_0xec4510){return function(_0x863d09){try{jsonpatch[_0x56fb('0x22')](_0x863d09,_0xec4510,!![]);}catch(_0x2bfc77){return BPromise[_0x56fb('0x23')](_0x2bfc77);}return _0x863d09[_0x56fb('0x24')]();};}function saveUpdates(_0x243463,_0x470754){return function(_0x248993){if(_0x248993){return _0x248993[_0x56fb('0x25')](_0x243463)['then'](function(_0x17b4de){return _0x17b4de;});}return null;};}function removeEntity(_0x1e308e,_0x5d6cc8){return function(_0x1bdb57){if(_0x1bdb57){return _0x1bdb57[_0x56fb('0x26')]()[_0x56fb('0x27')](function(){_0x1e308e[_0x56fb('0x1a')](0xcc)[_0x56fb('0x28')]();});}};}function handleEntityNotFound(_0x33cc3d,_0x467c87){return function(_0x5921ba){if(!_0x5921ba){_0x33cc3d[_0x56fb('0x19')](0x194);}return _0x5921ba;};}function handleError(_0x55430b,_0x32cf91){_0x32cf91=_0x32cf91||0x1f4;return function(_0x57007d){logger['error'](_0x57007d['stack']);if(_0x57007d['name']){delete _0x57007d[_0x56fb('0x29')];}_0x55430b['status'](_0x32cf91)['send'](_0x57007d);};}exports[_0x56fb('0x2a')]=function(_0x22031e,_0x44d65c){var _0x4dcd45={},_0xf6226d={},_0x53d01c={'count':0x0,'rows':[]};var _0xcfd281=_[_0x56fb('0x2b')](db[_0x56fb('0x2c')][_0x56fb('0x2d')],function(_0xc4fedd){return{'name':_0xc4fedd[_0x56fb('0x2e')],'type':_0xc4fedd['type'][_0x56fb('0x2f')]};});_0xf6226d['model']=_[_0x56fb('0x2b')](_0xcfd281,_0x56fb('0x29'));_0xf6226d['query']=_['keys'](_0x22031e[_0x56fb('0x30')]);_0xf6226d[_0x56fb('0x31')]=_[_0x56fb('0x32')](_0xf6226d[_0x56fb('0x33')],_0xf6226d[_0x56fb('0x30')]);_0x4dcd45[_0x56fb('0x34')]=_[_0x56fb('0x32')](_0xf6226d['model'],qs['fields'](_0x22031e[_0x56fb('0x30')]['fields']));_0x4dcd45[_0x56fb('0x34')]=_0x4dcd45['attributes']['length']?_0x4dcd45[_0x56fb('0x34')]:_0xf6226d['model'];if(!_0x22031e[_0x56fb('0x30')]['hasOwnProperty'](_0x56fb('0x35'))){_0x4dcd45[_0x56fb('0x1f')]=qs[_0x56fb('0x1f')](_0x22031e[_0x56fb('0x30')]['limit']);_0x4dcd45[_0x56fb('0x1c')]=qs[_0x56fb('0x1c')](_0x22031e[_0x56fb('0x30')][_0x56fb('0x1c')]);}_0x4dcd45[_0x56fb('0x36')]=qs[_0x56fb('0x37')](_0x22031e[_0x56fb('0x30')][_0x56fb('0x37')]);_0x4dcd45[_0x56fb('0x38')]=qs[_0x56fb('0x31')](_[_0x56fb('0x39')](_0x22031e[_0x56fb('0x30')],_0xf6226d[_0x56fb('0x31')]),_0xcfd281);if(_0x22031e[_0x56fb('0x30')]['filter']){_0x4dcd45[_0x56fb('0x38')]=_['merge'](_0x4dcd45['where'],{'$or':_[_0x56fb('0x2b')](_0xcfd281,function(_0x541d30){if(_0x541d30[_0x56fb('0x3a')]!=='VIRTUAL'){var _0x47f5ba={};_0x47f5ba[_0x541d30[_0x56fb('0x29')]]={'$like':'%'+_0x22031e['query'][_0x56fb('0x3b')]+'%'};return _0x47f5ba;}})});}_0x4dcd45=_[_0x56fb('0x3c')]({},_0x4dcd45,_0x22031e['options']);var _0x3a8978={'where':_0x4dcd45[_0x56fb('0x38')]};return db[_0x56fb('0x2c')][_0x56fb('0x1e')](_0x3a8978)['then'](function(_0xc2eb9a){_0x53d01c['count']=_0xc2eb9a;if(_0x22031e['query'][_0x56fb('0x3d')]){_0x4dcd45[_0x56fb('0x3e')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x56fb('0x3f')](_0x4dcd45);})[_0x56fb('0x27')](function(_0x633a9f){_0x53d01c['rows']=_0x633a9f;return _0x53d01c;})[_0x56fb('0x27')](respondWithFilteredResult(_0x44d65c,_0x4dcd45))[_0x56fb('0x40')](handleError(_0x44d65c,null));};exports[_0x56fb('0x41')]=function(_0x188367,_0x4889b1){var _0x42b62a={'raw':![],'where':{'id':_0x188367[_0x56fb('0x42')]['id']}},_0x1d8417={};_0x1d8417['model']=_[_0x56fb('0x43')](db['SugarcrmConfiguration'][_0x56fb('0x2d')]);_0x1d8417[_0x56fb('0x30')]=_[_0x56fb('0x43')](_0x188367[_0x56fb('0x30')]);_0x1d8417['filters']=_[_0x56fb('0x32')](_0x1d8417[_0x56fb('0x33')],_0x1d8417['query']);_0x42b62a[_0x56fb('0x34')]=_[_0x56fb('0x32')](_0x1d8417[_0x56fb('0x33')],qs[_0x56fb('0x44')](_0x188367[_0x56fb('0x30')]['fields']));_0x42b62a[_0x56fb('0x34')]=_0x42b62a[_0x56fb('0x34')]['length']?_0x42b62a['attributes']:_0x1d8417['model'];if(_0x188367[_0x56fb('0x30')][_0x56fb('0x3d')]){_0x42b62a['include']=[{'all':!![]}];}_0x42b62a=_[_0x56fb('0x3c')]({},_0x42b62a,_0x188367[_0x56fb('0x45')]);return db[_0x56fb('0x2c')][_0x56fb('0x46')](_0x42b62a)[_0x56fb('0x27')](handleEntityNotFound(_0x4889b1,null))[_0x56fb('0x27')](respondWithResult(_0x4889b1,null))[_0x56fb('0x40')](handleError(_0x4889b1,null));};exports[_0x56fb('0x47')]=function(_0x5c5b96,_0x3b52f9){return db['SugarcrmConfiguration'][_0x56fb('0x47')](_0x5c5b96[_0x56fb('0x48')],{})[_0x56fb('0x27')](respondWithResult(_0x3b52f9,0xc9))[_0x56fb('0x40')](handleError(_0x3b52f9,null));};exports[_0x56fb('0x25')]=function(_0x599255,_0x167899){if(_0x599255[_0x56fb('0x48')]['id']){delete _0x599255[_0x56fb('0x48')]['id'];}return db[_0x56fb('0x2c')][_0x56fb('0x46')]({'where':{'id':_0x599255['params']['id']}})[_0x56fb('0x27')](handleEntityNotFound(_0x167899,null))[_0x56fb('0x27')](saveUpdates(_0x599255[_0x56fb('0x48')],null))[_0x56fb('0x27')](respondWithResult(_0x167899,null))[_0x56fb('0x40')](handleError(_0x167899,null));};exports['destroy']=function(_0x25e234,_0x355888){return db[_0x56fb('0x2c')]['find']({'where':{'id':_0x25e234[_0x56fb('0x42')]['id']}})[_0x56fb('0x27')](handleEntityNotFound(_0x355888,null))[_0x56fb('0x27')](removeEntity(_0x355888,null))[_0x56fb('0x40')](handleError(_0x355888,null));};exports[_0x56fb('0x49')]=function(_0x3f2b36,_0x67f17a,_0x5ff09e){var _0x342daf={};var _0x243c6d={};var _0x377cdb;var _0x208ba7;return db['SugarcrmConfiguration'][_0x56fb('0x4a')]({'where':{'id':_0x3f2b36[_0x56fb('0x42')]['id']}})[_0x56fb('0x27')](handleEntityNotFound(_0x67f17a,null))[_0x56fb('0x27')](function(_0x9a5d6a){if(_0x9a5d6a){_0x377cdb=_0x9a5d6a;_0x243c6d['model']=_[_0x56fb('0x43')](db['SugarcrmField']['rawAttributes']);_0x243c6d[_0x56fb('0x30')]=_[_0x56fb('0x43')](_0x3f2b36[_0x56fb('0x30')]);_0x243c6d[_0x56fb('0x31')]=_[_0x56fb('0x32')](_0x243c6d['model'],_0x243c6d[_0x56fb('0x30')]);_0x342daf[_0x56fb('0x34')]=_['intersection'](_0x243c6d['model'],qs[_0x56fb('0x44')](_0x3f2b36[_0x56fb('0x30')][_0x56fb('0x44')]));_0x342daf[_0x56fb('0x34')]=_0x342daf[_0x56fb('0x34')]['length']?_0x342daf[_0x56fb('0x34')]:_0x243c6d['model'];_0x342daf[_0x56fb('0x36')]=qs[_0x56fb('0x37')](_0x3f2b36['query'][_0x56fb('0x37')]);_0x342daf[_0x56fb('0x38')]=qs[_0x56fb('0x31')](_[_0x56fb('0x39')](_0x3f2b36['query'],_0x243c6d[_0x56fb('0x31')]));if(_0x3f2b36[_0x56fb('0x30')]['filter']){_0x342daf['where']=_['merge'](_0x342daf[_0x56fb('0x38')],{'$or':_[_0x56fb('0x2b')](_0x342daf[_0x56fb('0x34')],function(_0x4b45c8){var _0x1ca0c6={};_0x1ca0c6[_0x4b45c8]={'$like':'%'+_0x3f2b36[_0x56fb('0x30')][_0x56fb('0x3b')]+'%'};return _0x1ca0c6;})});}_0x342daf=_[_0x56fb('0x3c')]({},_0x342daf,_0x3f2b36[_0x56fb('0x45')]);return _0x377cdb[_0x56fb('0x49')](_0x342daf);}})['then'](function(_0x387d6e){if(_0x387d6e){_0x208ba7=_0x387d6e['length'];if(!_0x3f2b36[_0x56fb('0x30')]['hasOwnProperty']('nolimit')){_0x342daf[_0x56fb('0x1f')]=qs['limit'](_0x3f2b36[_0x56fb('0x30')][_0x56fb('0x1f')]);_0x342daf['offset']=qs[_0x56fb('0x1c')](_0x3f2b36[_0x56fb('0x30')][_0x56fb('0x1c')]);}return _0x377cdb['getFields'](_0x342daf);}})[_0x56fb('0x27')](function(_0x21a745){if(_0x21a745){return _0x21a745?{'count':_0x208ba7,'rows':_0x21a745}:null;}})[_0x56fb('0x27')](respondWithResult(_0x67f17a,null))['catch'](handleError(_0x67f17a,null));};exports[_0x56fb('0x4b')]=function(_0x41bf66,_0x192f02,_0x5633d9){var _0x1f8754={};var _0x4f744f={};var _0x4751d5;var _0x138bb9;return db[_0x56fb('0x2c')][_0x56fb('0x4a')]({'where':{'id':_0x41bf66[_0x56fb('0x42')]['id']}})[_0x56fb('0x27')](handleEntityNotFound(_0x192f02,null))[_0x56fb('0x27')](function(_0x237b3a){if(_0x237b3a){_0x4751d5=_0x237b3a;_0x4f744f['model']=_[_0x56fb('0x43')](db[_0x56fb('0x4c')]['rawAttributes']);_0x4f744f[_0x56fb('0x30')]=_[_0x56fb('0x43')](_0x41bf66[_0x56fb('0x30')]);_0x4f744f[_0x56fb('0x31')]=_['intersection'](_0x4f744f[_0x56fb('0x33')],_0x4f744f[_0x56fb('0x30')]);_0x1f8754[_0x56fb('0x34')]=_[_0x56fb('0x32')](_0x4f744f['model'],qs[_0x56fb('0x44')](_0x41bf66[_0x56fb('0x30')][_0x56fb('0x44')]));_0x1f8754[_0x56fb('0x34')]=_0x1f8754[_0x56fb('0x34')][_0x56fb('0x4d')]?_0x1f8754[_0x56fb('0x34')]:_0x4f744f[_0x56fb('0x33')];_0x1f8754[_0x56fb('0x36')]=qs[_0x56fb('0x37')](_0x41bf66['query']['sort']);_0x1f8754[_0x56fb('0x38')]=qs['filters'](_[_0x56fb('0x39')](_0x41bf66['query'],_0x4f744f[_0x56fb('0x31')]));if(_0x41bf66['query'][_0x56fb('0x3b')]){_0x1f8754[_0x56fb('0x38')]=_[_0x56fb('0x3c')](_0x1f8754['where'],{'$or':_[_0x56fb('0x2b')](_0x1f8754['attributes'],function(_0x366744){var _0x170f08={};_0x170f08[_0x366744]={'$like':'%'+_0x41bf66['query'][_0x56fb('0x3b')]+'%'};return _0x170f08;})});}_0x1f8754=_[_0x56fb('0x3c')]({},_0x1f8754,_0x41bf66[_0x56fb('0x45')]);return _0x4751d5['getSubjects'](_0x1f8754);}})[_0x56fb('0x27')](function(_0x43c887){if(_0x43c887){_0x138bb9=_0x43c887[_0x56fb('0x4d')];if(!_0x41bf66[_0x56fb('0x30')][_0x56fb('0x4e')]('nolimit')){_0x1f8754[_0x56fb('0x1f')]=qs['limit'](_0x41bf66[_0x56fb('0x30')][_0x56fb('0x1f')]);_0x1f8754[_0x56fb('0x1c')]=qs['offset'](_0x41bf66['query'][_0x56fb('0x1c')]);}return _0x4751d5[_0x56fb('0x4b')](_0x1f8754);}})[_0x56fb('0x27')](function(_0x9bd235){if(_0x9bd235){return _0x9bd235?{'count':_0x138bb9,'rows':_0x9bd235}:null;}})[_0x56fb('0x27')](respondWithResult(_0x192f02,null))[_0x56fb('0x40')](handleError(_0x192f02,null));};exports[_0x56fb('0x4f')]=function(_0x125b04,_0x2f1d01,_0x4a65e1){var _0x28dff3={};var _0x275c67={};var _0x316764;var _0x40462c;return db[_0x56fb('0x2c')][_0x56fb('0x4a')]({'where':{'id':_0x125b04[_0x56fb('0x42')]['id']}})['then'](handleEntityNotFound(_0x2f1d01,null))[_0x56fb('0x27')](function(_0xf53d19){if(_0xf53d19){_0x316764=_0xf53d19;_0x275c67[_0x56fb('0x33')]=_[_0x56fb('0x43')](db['SugarcrmField'][_0x56fb('0x2d')]);_0x275c67[_0x56fb('0x30')]=_[_0x56fb('0x43')](_0x125b04[_0x56fb('0x30')]);_0x275c67[_0x56fb('0x31')]=_[_0x56fb('0x32')](_0x275c67['model'],_0x275c67[_0x56fb('0x30')]);_0x28dff3[_0x56fb('0x34')]=_[_0x56fb('0x32')](_0x275c67['model'],qs[_0x56fb('0x44')](_0x125b04[_0x56fb('0x30')]['fields']));_0x28dff3[_0x56fb('0x34')]=_0x28dff3[_0x56fb('0x34')][_0x56fb('0x4d')]?_0x28dff3[_0x56fb('0x34')]:_0x275c67['model'];_0x28dff3[_0x56fb('0x36')]=qs['sort'](_0x125b04['query']['sort']);_0x28dff3[_0x56fb('0x38')]=qs['filters'](_[_0x56fb('0x39')](_0x125b04[_0x56fb('0x30')],_0x275c67['filters']));if(_0x125b04[_0x56fb('0x30')]['filter']){_0x28dff3[_0x56fb('0x38')]=_[_0x56fb('0x3c')](_0x28dff3[_0x56fb('0x38')],{'$or':_[_0x56fb('0x2b')](_0x28dff3[_0x56fb('0x34')],function(_0x5b39fa){var _0xf98086={};_0xf98086[_0x5b39fa]={'$like':'%'+_0x125b04[_0x56fb('0x30')][_0x56fb('0x3b')]+'%'};return _0xf98086;})});}_0x28dff3=_['merge']({},_0x28dff3,_0x125b04['options']);return _0x316764['getDescriptions'](_0x28dff3);}})[_0x56fb('0x27')](function(_0x109e5c){if(_0x109e5c){_0x40462c=_0x109e5c[_0x56fb('0x4d')];if(!_0x125b04[_0x56fb('0x30')][_0x56fb('0x4e')](_0x56fb('0x35'))){_0x28dff3['limit']=qs['limit'](_0x125b04[_0x56fb('0x30')][_0x56fb('0x1f')]);_0x28dff3[_0x56fb('0x1c')]=qs['offset'](_0x125b04[_0x56fb('0x30')][_0x56fb('0x1c')]);}return _0x316764[_0x56fb('0x4f')](_0x28dff3);}})[_0x56fb('0x27')](function(_0x12d6f7){if(_0x12d6f7){return _0x12d6f7?{'count':_0x40462c,'rows':_0x12d6f7}:null;}})[_0x56fb('0x27')](respondWithResult(_0x2f1d01,null))[_0x56fb('0x40')](handleError(_0x2f1d01,null));}; \ No newline at end of file +var _0xa9b9=['../../mysqldb','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','error','stack','name','index','SugarcrmConfiguration','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','getFields','findOne','SugarcrmField','hasOwnProperty','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0xa8ff2f,_0x43e207){var _0x1c27af=function(_0x1d1551){while(--_0x1d1551){_0xa8ff2f['push'](_0xa8ff2f['shift']());}};_0x1c27af(++_0x43e207);}(_0xa9b9,0x86));var _0x9a9b=function(_0x8806f5,_0x259bc6){_0x8806f5=_0x8806f5-0x0;var _0x39a9a8=_0xa9b9[_0x8806f5];return _0x39a9a8;};'use strict';var emlformat=require(_0x9a9b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a9b('0x1'));var jsonpatch=require(_0x9a9b('0x2'));var rp=require(_0x9a9b('0x3'));var moment=require(_0x9a9b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x9a9b('0x5'));var sox=require(_0x9a9b('0x6'));var csv=require(_0x9a9b('0x7'));var ejs=require(_0x9a9b('0x8'));var fs=require('fs');var fs_extra=require(_0x9a9b('0x9'));var _=require(_0x9a9b('0xa'));var squel=require(_0x9a9b('0xb'));var crypto=require(_0x9a9b('0xc'));var jsforce=require(_0x9a9b('0xd'));var deskjs=require(_0x9a9b('0xe'));var toCsv=require(_0x9a9b('0x7'));var querystring=require(_0x9a9b('0xf'));var Papa=require(_0x9a9b('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9a9b('0x11'));var as=require(_0x9a9b('0x12'));var hardwareService=require(_0x9a9b('0x13'));var logger=require(_0x9a9b('0x14'))('api');var utils=require(_0x9a9b('0x15'));var config=require(_0x9a9b('0x16'));var licenseUtil=require(_0x9a9b('0x17'));var db=require(_0x9a9b('0x18'))['db'];function respondWithStatusCode(_0x26c9a5,_0x265a0c){_0x265a0c=_0x265a0c||0xcc;return function(_0x5454f4){if(_0x5454f4){return _0x26c9a5['sendStatus'](_0x265a0c);}return _0x26c9a5[_0x9a9b('0x19')](_0x265a0c)[_0x9a9b('0x1a')]();};}function respondWithResult(_0x23ef71,_0x36d75e){_0x36d75e=_0x36d75e||0xc8;return function(_0x2aa269){if(_0x2aa269){return _0x23ef71['status'](_0x36d75e)[_0x9a9b('0x1b')](_0x2aa269);}};}function respondWithFilteredResult(_0x19339b,_0x4ca9ca){return function(_0x1f05eb){if(_0x1f05eb){var _0x23abc5=typeof _0x4ca9ca[_0x9a9b('0x1c')]==='undefined'&&typeof _0x4ca9ca['limit']===_0x9a9b('0x1d');var _0x4adff8=_0x1f05eb[_0x9a9b('0x1e')];var _0x117030=_0x23abc5?0x0:_0x4ca9ca[_0x9a9b('0x1c')];var _0x1d2009=_0x23abc5?_0x1f05eb[_0x9a9b('0x1e')]:_0x4ca9ca['offset']+_0x4ca9ca[_0x9a9b('0x1f')];var _0x50b714;if(_0x1d2009>=_0x4adff8){_0x1d2009=_0x4adff8;_0x50b714=0xc8;}else{_0x50b714=0xce;}_0x19339b[_0x9a9b('0x19')](_0x50b714);return _0x19339b['set']('Content-Range',_0x117030+'-'+_0x1d2009+'/'+_0x4adff8)[_0x9a9b('0x1b')](_0x1f05eb);}return null;};}function patchUpdates(_0x4e4832){return function(_0x35b24c){try{jsonpatch[_0x9a9b('0x20')](_0x35b24c,_0x4e4832,!![]);}catch(_0x57e449){return BPromise[_0x9a9b('0x21')](_0x57e449);}return _0x35b24c[_0x9a9b('0x22')]();};}function saveUpdates(_0xab0fd8,_0xdab4c8){return function(_0x25e4d0){if(_0x25e4d0){return _0x25e4d0[_0x9a9b('0x23')](_0xab0fd8)[_0x9a9b('0x24')](function(_0x3ce07b){return _0x3ce07b;});}return null;};}function removeEntity(_0x363ca1,_0x425f5e){return function(_0x5149ff){if(_0x5149ff){return _0x5149ff[_0x9a9b('0x25')]()[_0x9a9b('0x24')](function(){_0x363ca1[_0x9a9b('0x19')](0xcc)[_0x9a9b('0x1a')]();});}};}function handleEntityNotFound(_0x244a96,_0x20b245){return function(_0x3b47d1){if(!_0x3b47d1){_0x244a96['sendStatus'](0x194);}return _0x3b47d1;};}function handleError(_0x48b76b,_0x222943){_0x222943=_0x222943||0x1f4;return function(_0x3a883c){logger[_0x9a9b('0x26')](_0x3a883c[_0x9a9b('0x27')]);if(_0x3a883c[_0x9a9b('0x28')]){delete _0x3a883c[_0x9a9b('0x28')];}_0x48b76b[_0x9a9b('0x19')](_0x222943)['send'](_0x3a883c);};}exports[_0x9a9b('0x29')]=function(_0x1a7857,_0x1398b5){var _0x69bd6a={},_0x4cc640={},_0xaa640e={'count':0x0,'rows':[]};var _0x1479bf=_['map'](db[_0x9a9b('0x2a')]['rawAttributes'],function(_0xecd1b4){return{'name':_0xecd1b4[_0x9a9b('0x2b')],'type':_0xecd1b4['type'][_0x9a9b('0x2c')]};});_0x4cc640[_0x9a9b('0x2d')]=_[_0x9a9b('0x2e')](_0x1479bf,'name');_0x4cc640[_0x9a9b('0x2f')]=_['keys'](_0x1a7857['query']);_0x4cc640[_0x9a9b('0x30')]=_[_0x9a9b('0x31')](_0x4cc640[_0x9a9b('0x2d')],_0x4cc640['query']);_0x69bd6a[_0x9a9b('0x32')]=_['intersection'](_0x4cc640[_0x9a9b('0x2d')],qs['fields'](_0x1a7857[_0x9a9b('0x2f')][_0x9a9b('0x33')]));_0x69bd6a[_0x9a9b('0x32')]=_0x69bd6a[_0x9a9b('0x32')][_0x9a9b('0x34')]?_0x69bd6a[_0x9a9b('0x32')]:_0x4cc640[_0x9a9b('0x2d')];if(!_0x1a7857[_0x9a9b('0x2f')]['hasOwnProperty'](_0x9a9b('0x35'))){_0x69bd6a['limit']=qs[_0x9a9b('0x1f')](_0x1a7857['query'][_0x9a9b('0x1f')]);_0x69bd6a['offset']=qs[_0x9a9b('0x1c')](_0x1a7857[_0x9a9b('0x2f')][_0x9a9b('0x1c')]);}_0x69bd6a[_0x9a9b('0x36')]=qs[_0x9a9b('0x37')](_0x1a7857[_0x9a9b('0x2f')][_0x9a9b('0x37')]);_0x69bd6a[_0x9a9b('0x38')]=qs[_0x9a9b('0x30')](_[_0x9a9b('0x39')](_0x1a7857[_0x9a9b('0x2f')],_0x4cc640['filters']),_0x1479bf);if(_0x1a7857['query'][_0x9a9b('0x3a')]){_0x69bd6a[_0x9a9b('0x38')]=_[_0x9a9b('0x3b')](_0x69bd6a[_0x9a9b('0x38')],{'$or':_[_0x9a9b('0x2e')](_0x1479bf,function(_0x381067){if(_0x381067['type']!==_0x9a9b('0x3c')){var _0x3e3569={};_0x3e3569[_0x381067[_0x9a9b('0x28')]]={'$like':'%'+_0x1a7857[_0x9a9b('0x2f')]['filter']+'%'};return _0x3e3569;}})});}_0x69bd6a=_[_0x9a9b('0x3b')]({},_0x69bd6a,_0x1a7857['options']);var _0x8c6a38={'where':_0x69bd6a[_0x9a9b('0x38')]};return db[_0x9a9b('0x2a')]['count'](_0x8c6a38)[_0x9a9b('0x24')](function(_0x3a790a){_0xaa640e[_0x9a9b('0x1e')]=_0x3a790a;if(_0x1a7857[_0x9a9b('0x2f')][_0x9a9b('0x3d')]){_0x69bd6a[_0x9a9b('0x3e')]=[{'all':!![]}];}return db[_0x9a9b('0x2a')][_0x9a9b('0x3f')](_0x69bd6a);})[_0x9a9b('0x24')](function(_0x18c405){_0xaa640e[_0x9a9b('0x40')]=_0x18c405;return _0xaa640e;})[_0x9a9b('0x24')](respondWithFilteredResult(_0x1398b5,_0x69bd6a))[_0x9a9b('0x41')](handleError(_0x1398b5,null));};exports[_0x9a9b('0x42')]=function(_0x1fe477,_0x4894ce){var _0xb3796c={'raw':![],'where':{'id':_0x1fe477[_0x9a9b('0x43')]['id']}},_0x407d4d={};_0x407d4d['model']=_[_0x9a9b('0x44')](db['SugarcrmConfiguration'][_0x9a9b('0x45')]);_0x407d4d['query']=_[_0x9a9b('0x44')](_0x1fe477[_0x9a9b('0x2f')]);_0x407d4d[_0x9a9b('0x30')]=_[_0x9a9b('0x31')](_0x407d4d[_0x9a9b('0x2d')],_0x407d4d['query']);_0xb3796c[_0x9a9b('0x32')]=_[_0x9a9b('0x31')](_0x407d4d[_0x9a9b('0x2d')],qs[_0x9a9b('0x33')](_0x1fe477[_0x9a9b('0x2f')][_0x9a9b('0x33')]));_0xb3796c['attributes']=_0xb3796c[_0x9a9b('0x32')]['length']?_0xb3796c['attributes']:_0x407d4d[_0x9a9b('0x2d')];if(_0x1fe477[_0x9a9b('0x2f')][_0x9a9b('0x3d')]){_0xb3796c[_0x9a9b('0x3e')]=[{'all':!![]}];}_0xb3796c=_[_0x9a9b('0x3b')]({},_0xb3796c,_0x1fe477['options']);return db[_0x9a9b('0x2a')][_0x9a9b('0x46')](_0xb3796c)[_0x9a9b('0x24')](handleEntityNotFound(_0x4894ce,null))[_0x9a9b('0x24')](respondWithResult(_0x4894ce,null))[_0x9a9b('0x41')](handleError(_0x4894ce,null));};exports[_0x9a9b('0x47')]=function(_0x12364d,_0x3a4f4c){return db[_0x9a9b('0x2a')][_0x9a9b('0x47')](_0x12364d[_0x9a9b('0x48')],{})['then'](respondWithResult(_0x3a4f4c,0xc9))[_0x9a9b('0x41')](handleError(_0x3a4f4c,null));};exports[_0x9a9b('0x23')]=function(_0x5bf9b3,_0x58c477){if(_0x5bf9b3['body']['id']){delete _0x5bf9b3['body']['id'];}return db['SugarcrmConfiguration'][_0x9a9b('0x46')]({'where':{'id':_0x5bf9b3[_0x9a9b('0x43')]['id']}})[_0x9a9b('0x24')](handleEntityNotFound(_0x58c477,null))[_0x9a9b('0x24')](saveUpdates(_0x5bf9b3[_0x9a9b('0x48')],null))['then'](respondWithResult(_0x58c477,null))[_0x9a9b('0x41')](handleError(_0x58c477,null));};exports[_0x9a9b('0x25')]=function(_0x1c1884,_0x42ebe3){return db['SugarcrmConfiguration'][_0x9a9b('0x46')]({'where':{'id':_0x1c1884[_0x9a9b('0x43')]['id']}})[_0x9a9b('0x24')](handleEntityNotFound(_0x42ebe3,null))[_0x9a9b('0x24')](removeEntity(_0x42ebe3,null))[_0x9a9b('0x41')](handleError(_0x42ebe3,null));};exports[_0x9a9b('0x49')]=function(_0x46cf60,_0x154251,_0xd1446b){var _0x346ef9={};var _0x2a358b={};var _0x312410;var _0x409313;return db[_0x9a9b('0x2a')][_0x9a9b('0x4a')]({'where':{'id':_0x46cf60[_0x9a9b('0x43')]['id']}})[_0x9a9b('0x24')](handleEntityNotFound(_0x154251,null))[_0x9a9b('0x24')](function(_0x582e12){if(_0x582e12){_0x312410=_0x582e12;_0x2a358b[_0x9a9b('0x2d')]=_['keys'](db[_0x9a9b('0x4b')][_0x9a9b('0x45')]);_0x2a358b['query']=_[_0x9a9b('0x44')](_0x46cf60[_0x9a9b('0x2f')]);_0x2a358b[_0x9a9b('0x30')]=_[_0x9a9b('0x31')](_0x2a358b[_0x9a9b('0x2d')],_0x2a358b[_0x9a9b('0x2f')]);_0x346ef9['attributes']=_[_0x9a9b('0x31')](_0x2a358b[_0x9a9b('0x2d')],qs[_0x9a9b('0x33')](_0x46cf60[_0x9a9b('0x2f')][_0x9a9b('0x33')]));_0x346ef9[_0x9a9b('0x32')]=_0x346ef9[_0x9a9b('0x32')][_0x9a9b('0x34')]?_0x346ef9[_0x9a9b('0x32')]:_0x2a358b['model'];_0x346ef9[_0x9a9b('0x36')]=qs['sort'](_0x46cf60[_0x9a9b('0x2f')]['sort']);_0x346ef9[_0x9a9b('0x38')]=qs['filters'](_[_0x9a9b('0x39')](_0x46cf60[_0x9a9b('0x2f')],_0x2a358b[_0x9a9b('0x30')]));if(_0x46cf60[_0x9a9b('0x2f')][_0x9a9b('0x3a')]){_0x346ef9[_0x9a9b('0x38')]=_['merge'](_0x346ef9[_0x9a9b('0x38')],{'$or':_[_0x9a9b('0x2e')](_0x346ef9[_0x9a9b('0x32')],function(_0xabeb38){var _0x902023={};_0x902023[_0xabeb38]={'$like':'%'+_0x46cf60[_0x9a9b('0x2f')][_0x9a9b('0x3a')]+'%'};return _0x902023;})});}_0x346ef9=_[_0x9a9b('0x3b')]({},_0x346ef9,_0x46cf60['options']);return _0x312410[_0x9a9b('0x49')](_0x346ef9);}})[_0x9a9b('0x24')](function(_0x487427){if(_0x487427){_0x409313=_0x487427[_0x9a9b('0x34')];if(!_0x46cf60[_0x9a9b('0x2f')][_0x9a9b('0x4c')]('nolimit')){_0x346ef9[_0x9a9b('0x1f')]=qs[_0x9a9b('0x1f')](_0x46cf60['query'][_0x9a9b('0x1f')]);_0x346ef9[_0x9a9b('0x1c')]=qs[_0x9a9b('0x1c')](_0x46cf60[_0x9a9b('0x2f')][_0x9a9b('0x1c')]);}return _0x312410[_0x9a9b('0x49')](_0x346ef9);}})[_0x9a9b('0x24')](function(_0x198e2d){if(_0x198e2d){return _0x198e2d?{'count':_0x409313,'rows':_0x198e2d}:null;}})[_0x9a9b('0x24')](respondWithResult(_0x154251,null))[_0x9a9b('0x41')](handleError(_0x154251,null));};exports[_0x9a9b('0x4d')]=function(_0x449011,_0x14245c,_0x44e942){var _0x44f47e={};var _0x35bb9c={};var _0x4bab06;var _0x1b7dd2;return db[_0x9a9b('0x2a')][_0x9a9b('0x4a')]({'where':{'id':_0x449011[_0x9a9b('0x43')]['id']}})[_0x9a9b('0x24')](handleEntityNotFound(_0x14245c,null))['then'](function(_0x5f2767){if(_0x5f2767){_0x4bab06=_0x5f2767;_0x35bb9c[_0x9a9b('0x2d')]=_[_0x9a9b('0x44')](db[_0x9a9b('0x4b')][_0x9a9b('0x45')]);_0x35bb9c[_0x9a9b('0x2f')]=_[_0x9a9b('0x44')](_0x449011[_0x9a9b('0x2f')]);_0x35bb9c[_0x9a9b('0x30')]=_['intersection'](_0x35bb9c['model'],_0x35bb9c[_0x9a9b('0x2f')]);_0x44f47e[_0x9a9b('0x32')]=_[_0x9a9b('0x31')](_0x35bb9c['model'],qs[_0x9a9b('0x33')](_0x449011[_0x9a9b('0x2f')][_0x9a9b('0x33')]));_0x44f47e[_0x9a9b('0x32')]=_0x44f47e[_0x9a9b('0x32')]['length']?_0x44f47e[_0x9a9b('0x32')]:_0x35bb9c['model'];_0x44f47e[_0x9a9b('0x36')]=qs['sort'](_0x449011[_0x9a9b('0x2f')]['sort']);_0x44f47e[_0x9a9b('0x38')]=qs['filters'](_[_0x9a9b('0x39')](_0x449011['query'],_0x35bb9c[_0x9a9b('0x30')]));if(_0x449011['query'][_0x9a9b('0x3a')]){_0x44f47e[_0x9a9b('0x38')]=_['merge'](_0x44f47e[_0x9a9b('0x38')],{'$or':_[_0x9a9b('0x2e')](_0x44f47e['attributes'],function(_0x210fa6){var _0x252b7c={};_0x252b7c[_0x210fa6]={'$like':'%'+_0x449011[_0x9a9b('0x2f')]['filter']+'%'};return _0x252b7c;})});}_0x44f47e=_[_0x9a9b('0x3b')]({},_0x44f47e,_0x449011['options']);return _0x4bab06[_0x9a9b('0x4d')](_0x44f47e);}})[_0x9a9b('0x24')](function(_0x5f1381){if(_0x5f1381){_0x1b7dd2=_0x5f1381[_0x9a9b('0x34')];if(!_0x449011[_0x9a9b('0x2f')][_0x9a9b('0x4c')]('nolimit')){_0x44f47e['limit']=qs[_0x9a9b('0x1f')](_0x449011['query']['limit']);_0x44f47e[_0x9a9b('0x1c')]=qs[_0x9a9b('0x1c')](_0x449011['query'][_0x9a9b('0x1c')]);}return _0x4bab06[_0x9a9b('0x4d')](_0x44f47e);}})['then'](function(_0x408197){if(_0x408197){return _0x408197?{'count':_0x1b7dd2,'rows':_0x408197}:null;}})[_0x9a9b('0x24')](respondWithResult(_0x14245c,null))[_0x9a9b('0x41')](handleError(_0x14245c,null));};exports[_0x9a9b('0x4e')]=function(_0x282f31,_0x39e72a,_0x306102){var _0x2a9f00={};var _0x2a1722={};var _0x2f9543;var _0xad3ee0;return db[_0x9a9b('0x2a')][_0x9a9b('0x4a')]({'where':{'id':_0x282f31['params']['id']}})['then'](handleEntityNotFound(_0x39e72a,null))['then'](function(_0x33807b){if(_0x33807b){_0x2f9543=_0x33807b;_0x2a1722[_0x9a9b('0x2d')]=_[_0x9a9b('0x44')](db['SugarcrmField'][_0x9a9b('0x45')]);_0x2a1722[_0x9a9b('0x2f')]=_[_0x9a9b('0x44')](_0x282f31[_0x9a9b('0x2f')]);_0x2a1722[_0x9a9b('0x30')]=_[_0x9a9b('0x31')](_0x2a1722['model'],_0x2a1722[_0x9a9b('0x2f')]);_0x2a9f00[_0x9a9b('0x32')]=_[_0x9a9b('0x31')](_0x2a1722[_0x9a9b('0x2d')],qs['fields'](_0x282f31[_0x9a9b('0x2f')][_0x9a9b('0x33')]));_0x2a9f00['attributes']=_0x2a9f00[_0x9a9b('0x32')][_0x9a9b('0x34')]?_0x2a9f00['attributes']:_0x2a1722[_0x9a9b('0x2d')];_0x2a9f00[_0x9a9b('0x36')]=qs[_0x9a9b('0x37')](_0x282f31['query']['sort']);_0x2a9f00[_0x9a9b('0x38')]=qs['filters'](_['pick'](_0x282f31[_0x9a9b('0x2f')],_0x2a1722[_0x9a9b('0x30')]));if(_0x282f31[_0x9a9b('0x2f')][_0x9a9b('0x3a')]){_0x2a9f00[_0x9a9b('0x38')]=_[_0x9a9b('0x3b')](_0x2a9f00[_0x9a9b('0x38')],{'$or':_[_0x9a9b('0x2e')](_0x2a9f00['attributes'],function(_0x58f20e){var _0x2e14e1={};_0x2e14e1[_0x58f20e]={'$like':'%'+_0x282f31['query'][_0x9a9b('0x3a')]+'%'};return _0x2e14e1;})});}_0x2a9f00=_['merge']({},_0x2a9f00,_0x282f31['options']);return _0x2f9543[_0x9a9b('0x4e')](_0x2a9f00);}})[_0x9a9b('0x24')](function(_0x2372b1){if(_0x2372b1){_0xad3ee0=_0x2372b1['length'];if(!_0x282f31['query'][_0x9a9b('0x4c')](_0x9a9b('0x35'))){_0x2a9f00[_0x9a9b('0x1f')]=qs[_0x9a9b('0x1f')](_0x282f31[_0x9a9b('0x2f')]['limit']);_0x2a9f00[_0x9a9b('0x1c')]=qs[_0x9a9b('0x1c')](_0x282f31[_0x9a9b('0x2f')][_0x9a9b('0x1c')]);}return _0x2f9543['getDescriptions'](_0x2a9f00);}})[_0x9a9b('0x24')](function(_0x27aebd){if(_0x27aebd){return _0x27aebd?{'count':_0xad3ee0,'rows':_0x27aebd}:null;}})[_0x9a9b('0x24')](respondWithResult(_0x39e72a,null))['catch'](handleError(_0x39e72a,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index fde77bd..50787fc 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 _0xe52f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define','int_sugarcrm_configurations','lodash'];(function(_0x308830,_0x2112a8){var _0x148e27=function(_0x4f1578){while(--_0x4f1578){_0x308830['push'](_0x308830['shift']());}};_0x148e27(++_0x2112a8);}(_0xe52f,0xb3));var _0xfe52=function(_0x2a79a5,_0x580594){_0x2a79a5=_0x2a79a5-0x0;var _0x1902eb=_0xe52f[_0x2a79a5];return _0x1902eb;};'use strict';var _=require(_0xfe52('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xfe52('0x1'));var BPromise=require(_0xfe52('0x2'));var rp=require(_0xfe52('0x3'));var fs=require('fs');var path=require(_0xfe52('0x4'));var rimraf=require(_0xfe52('0x5'));var config=require(_0xfe52('0x6'));var attributes=require(_0xfe52('0x7'));module['exports']=function(_0x13ca9e,_0x25888e){return _0x13ca9e[_0xfe52('0x8')]('SugarcrmConfiguration',attributes,{'tableName':_0xfe52('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf963=['exports','define','int_sugarcrm_configurations','../../config/logger','bluebird','path','rimraf'];(function(_0x48d388,_0x5e792a){var _0x8f96c6=function(_0x29af3d){while(--_0x29af3d){_0x48d388['push'](_0x48d388['shift']());}};_0x8f96c6(++_0x5e792a);}(_0xf963,0x145));var _0x3f96=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xf963[_0x160c73];return _0xd9302;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3f96('0x0'))('api');var moment=require('moment');var BPromise=require(_0x3f96('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f96('0x2'));var rimraf=require(_0x3f96('0x3'));var config=require('../../config/environment');var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x3f96('0x4')]=function(_0x28241c,_0x325c70){return _0x28241c[_0x3f96('0x5')]('SugarcrmConfiguration',attributes,{'tableName':_0x3f96('0x6'),'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 f1ff93a..89a6c2d 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 _0xdb3e=['message','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x15d12d,_0x4c0d27){var _0x190551=function(_0x50200a){while(--_0x50200a){_0x15d12d['push'](_0x15d12d['shift']());}};_0x190551(++_0x4c0d27);}(_0xdb3e,0x1e7));var _0xedb3=function(_0x5549cc,_0x401a1b){_0x5549cc=_0x5549cc-0x0;var _0x4936dd=_0xdb3e[_0x5549cc];return _0x4936dd;};'use strict';var _=require(_0xedb3('0x0'));var util=require(_0xedb3('0x1'));var moment=require(_0xedb3('0x2'));var BPromise=require(_0xedb3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedb3('0x4'))['db'];var utils=require(_0xedb3('0x5'));var logger=require(_0xedb3('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xedb3('0x7'));var client=jayson['client'][_0xedb3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x359fcf,_0x33adab,_0x274931){return new BPromise(function(_0x33431e,_0x2f055f){return client['request'](_0x359fcf,_0x274931)[_0xedb3('0x9')](function(_0x1f0f72){logger[_0xedb3('0xa')](_0xedb3('0xb'),_0x33adab,_0xedb3('0xc'));logger[_0xedb3('0xd')](_0xedb3('0xe'),_0x33adab,_0xedb3('0xc'),JSON[_0xedb3('0xf')](_0x1f0f72));if(_0x1f0f72[_0xedb3('0x10')]){if(_0x1f0f72[_0xedb3('0x10')]['code']===0x1f4){logger[_0xedb3('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x33adab,_0x1f0f72[_0xedb3('0x10')][_0xedb3('0x11')]);return _0x2f055f(_0x1f0f72[_0xedb3('0x10')]['message']);}logger['error'](_0xedb3('0xb'),_0x33adab,_0x1f0f72[_0xedb3('0x10')]['message']);return _0x33431e(_0x1f0f72['error']['message']);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x33adab,_0xedb3('0xc'));_0x33431e(_0x1f0f72['result'][_0xedb3('0x11')]);}})['catch'](function(_0x234ca9){logger['error'](_0xedb3('0xb'),_0x33adab,_0x234ca9);_0x2f055f(_0x234ca9);});});} \ No newline at end of file +var _0x9c01=['SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\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','request','then','info'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x9c01,0x189));var _0x19c0=function(_0x158562,_0x16c21e){_0x158562=_0x158562-0x0;var _0x5eb16d=_0x9c01[_0x158562];return _0x5eb16d;};'use strict';var _=require(_0x19c0('0x0'));var util=require(_0x19c0('0x1'));var moment=require(_0x19c0('0x2'));var BPromise=require('bluebird');var rs=require(_0x19c0('0x3'));var fs=require('fs');var Redis=require(_0x19c0('0x4'));var db=require(_0x19c0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x19c0('0x6'))(_0x19c0('0x7'));var config=require(_0x19c0('0x8'));var jayson=require(_0x19c0('0x9'));var client=jayson[_0x19c0('0xa')][_0x19c0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x134b49,_0xab293a,_0x3a43cb){return new BPromise(function(_0x56ea03,_0x25ef14){return client[_0x19c0('0xc')](_0x134b49,_0x3a43cb)[_0x19c0('0xd')](function(_0x1dd392){logger[_0x19c0('0xe')](_0x19c0('0xf'),_0xab293a,'request\x20sent');logger['debug'](_0x19c0('0x10'),_0xab293a,_0x19c0('0x11'),JSON[_0x19c0('0x12')](_0x1dd392));if(_0x1dd392[_0x19c0('0x13')]){if(_0x1dd392[_0x19c0('0x13')][_0x19c0('0x14')]===0x1f4){logger[_0x19c0('0x13')](_0x19c0('0xf'),_0xab293a,_0x1dd392[_0x19c0('0x13')]['message']);return _0x25ef14(_0x1dd392[_0x19c0('0x13')][_0x19c0('0x15')]);}logger[_0x19c0('0x13')](_0x19c0('0xf'),_0xab293a,_0x1dd392['error'][_0x19c0('0x15')]);return _0x56ea03(_0x1dd392[_0x19c0('0x13')][_0x19c0('0x15')]);}else{logger[_0x19c0('0xe')](_0x19c0('0xf'),_0xab293a,_0x19c0('0x11'));_0x56ea03(_0x1dd392[_0x19c0('0x16')]['message']);}})[_0x19c0('0x17')](function(_0x235df1){logger['error'](_0x19c0('0xf'),_0xab293a,_0x235df1);_0x25ef14(_0x235df1);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index b7f9cc8..2610c0e 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 _0xc160=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','show','post','create','put','/:id','update','exports'];(function(_0x4e4cd3,_0x18c04b){var _0x39f1ef=function(_0x57e97b){while(--_0x57e97b){_0x4e4cd3['push'](_0x4e4cd3['shift']());}};_0x39f1ef(++_0x18c04b);}(_0xc160,0x72));var _0x0c16=function(_0x16629d,_0x492375){_0x16629d=_0x16629d-0x0;var _0x56ccee=_0xc160[_0x16629d];return _0x56ccee;};'use strict';var multer=require(_0x0c16('0x0'));var util=require(_0x0c16('0x1'));var path=require(_0x0c16('0x2'));var timeout=require(_0x0c16('0x3'));var express=require(_0x0c16('0x4'));var router=express[_0x0c16('0x5')]();var fs_extra=require(_0x0c16('0x6'));var auth=require(_0x0c16('0x7'));var interaction=require(_0x0c16('0x8'));var config=require(_0x0c16('0x9'));var controller=require('./intSugarcrmField.controller');router['get']('/',auth[_0x0c16('0xa')](),controller[_0x0c16('0xb')]);router['get']('/:id',auth[_0x0c16('0xa')](),controller[_0x0c16('0xc')]);router[_0x0c16('0xd')]('/',auth[_0x0c16('0xa')](),controller[_0x0c16('0xe')]);router[_0x0c16('0xf')](_0x0c16('0x10'),auth[_0x0c16('0xa')](),controller[_0x0c16('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x0c16('0x12')]=router; \ No newline at end of file +var _0x9afa=['/:id','post','isAuthenticated','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intSugarcrmField.controller'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x9afa,0x115));var _0xa9af=function(_0x208526,_0x167c47){_0x208526=_0x208526-0x0;var _0x4e630b=_0x9afa[_0x208526];return _0x4e630b;};'use strict';var multer=require('multer');var util=require(_0xa9af('0x0'));var path=require(_0xa9af('0x1'));var timeout=require(_0xa9af('0x2'));var express=require(_0xa9af('0x3'));var router=express[_0xa9af('0x4')]();var fs_extra=require(_0xa9af('0x5'));var auth=require(_0xa9af('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa9af('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa9af('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xa9af('0x9')]('/',auth[_0xa9af('0xa')](),controller['create']);router[_0xa9af('0xb')](_0xa9af('0x8'),auth[_0xa9af('0xa')](),controller[_0xa9af('0xc')]);router['delete']('/:id',auth[_0xa9af('0xa')](),controller[_0xa9af('0xd')]);module[_0xa9af('0xe')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index cced986..ca4f172 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 _0xcf1d=['customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports','variable'];(function(_0x318ce0,_0x2a00f2){var _0xc43780=function(_0xfe0029){while(--_0xfe0029){_0x318ce0['push'](_0x318ce0['shift']());}};_0xc43780(++_0x2a00f2);}(_0xcf1d,0x1b6));var _0xdcf1=function(_0x46e34a,_0x17f24e){_0x46e34a=_0x46e34a-0x0;var _0x342522=_0xcf1d[_0x46e34a];return _0x342522;};'use strict';var Sequelize=require(_0xdcf1('0x0'));module[_0xdcf1('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xdcf1('0x2'),_0xdcf1('0x3'),_0xdcf1('0x4'),_0xdcf1('0x5')),'defaultValue':_0xdcf1('0x6')},'content':{'type':Sequelize[_0xdcf1('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xdcf1('0x6'),_0xdcf1('0x2'),_0xdcf1('0x3'))},'keyContent':{'type':Sequelize[_0xdcf1('0x7')]},'idField':{'type':Sequelize[_0xdcf1('0x7')]},'nameField':{'type':Sequelize[_0xdcf1('0x7')]},'customField':{'type':Sequelize[_0xdcf1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdcf1('0x7')]}}; \ No newline at end of file +var _0x8c49=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x141535,_0x2318c8){var _0x1b5cfa=function(_0x136337){while(--_0x136337){_0x141535['push'](_0x141535['shift']());}};_0x1b5cfa(++_0x2318c8);}(_0x8c49,0x137));var _0x98c4=function(_0xa4f636,_0xaca1b6){_0xa4f636=_0xa4f636-0x0;var _0x37e02a=_0x8c49[_0xa4f636];return _0x37e02a;};'use strict';var Sequelize=require(_0x98c4('0x0'));module[_0x98c4('0x1')]={'type':{'type':Sequelize[_0x98c4('0x2')](_0x98c4('0x3'),_0x98c4('0x4'),_0x98c4('0x5'),_0x98c4('0x6'),_0x98c4('0x7')),'defaultValue':_0x98c4('0x3')},'content':{'type':Sequelize[_0x98c4('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x98c4('0x2')](_0x98c4('0x3'),_0x98c4('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x98c4('0x8')]},'idField':{'type':Sequelize[_0x98c4('0x8')]},'nameField':{'type':Sequelize[_0x98c4('0x8')]},'customField':{'type':Sequelize[_0x98c4('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x98c4('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index bbdc3fd..6134772 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 _0x42a6=['keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','include','findAll','catch','show','params','length','includeAll','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','map','SugarcrmField','rawAttributes','fieldName','type','key','model'];(function(_0x464f07,_0x5087d1){var _0x32c289=function(_0x2b1609){while(--_0x2b1609){_0x464f07['push'](_0x464f07['shift']());}};_0x32c289(++_0x5087d1);}(_0x42a6,0xac));var _0x642a=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x42a6[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require(_0x642a('0x0'));var rimraf=require(_0x642a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x642a('0x2'));var rp=require(_0x642a('0x3'));var moment=require(_0x642a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x642a('0x5'));var util=require('util');var path=require(_0x642a('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x642a('0x7'));var fs=require('fs');var fs_extra=require(_0x642a('0x8'));var _=require(_0x642a('0x9'));var squel=require('squel');var crypto=require(_0x642a('0xa'));var jsforce=require(_0x642a('0xb'));var deskjs=require(_0x642a('0xc'));var toCsv=require(_0x642a('0xd'));var querystring=require(_0x642a('0xe'));var Papa=require(_0x642a('0xf'));var Redis=require(_0x642a('0x10'));var authService=require(_0x642a('0x11'));var qs=require(_0x642a('0x12'));var as=require(_0x642a('0x13'));var hardwareService=require(_0x642a('0x14'));var logger=require('../../config/logger')(_0x642a('0x15'));var utils=require('../../config/utils');var config=require(_0x642a('0x16'));var licenseUtil=require(_0x642a('0x17'));var db=require(_0x642a('0x18'))['db'];function respondWithStatusCode(_0x1b744d,_0x499ab9){_0x499ab9=_0x499ab9||0xcc;return function(_0x4cc2c8){if(_0x4cc2c8){return _0x1b744d[_0x642a('0x19')](_0x499ab9);}return _0x1b744d[_0x642a('0x1a')](_0x499ab9)[_0x642a('0x1b')]();};}function respondWithResult(_0x36e306,_0x252b5d){_0x252b5d=_0x252b5d||0xc8;return function(_0x143de4){if(_0x143de4){return _0x36e306[_0x642a('0x1a')](_0x252b5d)[_0x642a('0x1c')](_0x143de4);}};}function respondWithFilteredResult(_0x4c6487,_0x31ebcc){return function(_0x2c6c04){if(_0x2c6c04){var _0xc850b9=typeof _0x31ebcc[_0x642a('0x1d')]===_0x642a('0x1e')&&typeof _0x31ebcc[_0x642a('0x1f')]==='undefined';var _0x13ea77=_0x2c6c04[_0x642a('0x20')];var _0x4b1204=_0xc850b9?0x0:_0x31ebcc[_0x642a('0x1d')];var _0xcbda9=_0xc850b9?_0x2c6c04[_0x642a('0x20')]:_0x31ebcc[_0x642a('0x1d')]+_0x31ebcc[_0x642a('0x1f')];var _0x31e565;if(_0xcbda9>=_0x13ea77){_0xcbda9=_0x13ea77;_0x31e565=0xc8;}else{_0x31e565=0xce;}_0x4c6487[_0x642a('0x1a')](_0x31e565);return _0x4c6487[_0x642a('0x21')](_0x642a('0x22'),_0x4b1204+'-'+_0xcbda9+'/'+_0x13ea77)['json'](_0x2c6c04);}return null;};}function patchUpdates(_0x5389e5){return function(_0x5c4d96){try{jsonpatch['apply'](_0x5c4d96,_0x5389e5,!![]);}catch(_0x3523e6){return BPromise[_0x642a('0x23')](_0x3523e6);}return _0x5c4d96[_0x642a('0x24')]();};}function saveUpdates(_0x1477c4,_0x431fd8){return function(_0xf61e2a){if(_0xf61e2a){return _0xf61e2a[_0x642a('0x25')](_0x1477c4)['then'](function(_0x5ebdc7){return _0x5ebdc7;});}return null;};}function removeEntity(_0x4b3f4b,_0xf4ce83){return function(_0x3fa6cd){if(_0x3fa6cd){return _0x3fa6cd[_0x642a('0x26')]()[_0x642a('0x27')](function(){_0x4b3f4b[_0x642a('0x1a')](0xcc)[_0x642a('0x1b')]();});}};}function handleEntityNotFound(_0x424e0c,_0x629cdf){return function(_0x2c64c5){if(!_0x2c64c5){_0x424e0c[_0x642a('0x19')](0x194);}return _0x2c64c5;};}function handleError(_0x2838da,_0x4ba6b4){_0x4ba6b4=_0x4ba6b4||0x1f4;return function(_0x55f9e7){logger[_0x642a('0x28')](_0x55f9e7[_0x642a('0x29')]);if(_0x55f9e7[_0x642a('0x2a')]){delete _0x55f9e7[_0x642a('0x2a')];}_0x2838da[_0x642a('0x1a')](_0x4ba6b4)['send'](_0x55f9e7);};}exports['index']=function(_0x3bf69a,_0xf2ac17){var _0x3f9a71={},_0x16b44c={},_0x1da9c8={'count':0x0,'rows':[]};var _0x3e42e0=_[_0x642a('0x2b')](db[_0x642a('0x2c')][_0x642a('0x2d')],function(_0x294781){return{'name':_0x294781[_0x642a('0x2e')],'type':_0x294781[_0x642a('0x2f')][_0x642a('0x30')]};});_0x16b44c[_0x642a('0x31')]=_[_0x642a('0x2b')](_0x3e42e0,_0x642a('0x2a'));_0x16b44c['query']=_[_0x642a('0x32')](_0x3bf69a[_0x642a('0x33')]);_0x16b44c[_0x642a('0x34')]=_['intersection'](_0x16b44c['model'],_0x16b44c[_0x642a('0x33')]);_0x3f9a71[_0x642a('0x35')]=_[_0x642a('0x36')](_0x16b44c['model'],qs[_0x642a('0x37')](_0x3bf69a[_0x642a('0x33')][_0x642a('0x37')]));_0x3f9a71[_0x642a('0x35')]=_0x3f9a71[_0x642a('0x35')]['length']?_0x3f9a71[_0x642a('0x35')]:_0x16b44c[_0x642a('0x31')];if(!_0x3bf69a[_0x642a('0x33')][_0x642a('0x38')](_0x642a('0x39'))){_0x3f9a71['limit']=qs[_0x642a('0x1f')](_0x3bf69a[_0x642a('0x33')][_0x642a('0x1f')]);_0x3f9a71[_0x642a('0x1d')]=qs[_0x642a('0x1d')](_0x3bf69a['query']['offset']);}_0x3f9a71[_0x642a('0x3a')]=qs['sort'](_0x3bf69a[_0x642a('0x33')][_0x642a('0x3b')]);_0x3f9a71[_0x642a('0x3c')]=qs[_0x642a('0x34')](_['pick'](_0x3bf69a['query'],_0x16b44c['filters']),_0x3e42e0);if(_0x3bf69a[_0x642a('0x33')][_0x642a('0x3d')]){_0x3f9a71[_0x642a('0x3c')]=_['merge'](_0x3f9a71[_0x642a('0x3c')],{'$or':_[_0x642a('0x2b')](_0x3e42e0,function(_0x520d08){if(_0x520d08[_0x642a('0x2f')]!==_0x642a('0x3e')){var _0x5f24df={};_0x5f24df[_0x520d08[_0x642a('0x2a')]]={'$like':'%'+_0x3bf69a[_0x642a('0x33')]['filter']+'%'};return _0x5f24df;}})});}_0x3f9a71=_['merge']({},_0x3f9a71,_0x3bf69a[_0x642a('0x3f')]);var _0x17f26b={'where':_0x3f9a71['where']};return db[_0x642a('0x2c')][_0x642a('0x20')](_0x17f26b)[_0x642a('0x27')](function(_0x259def){_0x1da9c8[_0x642a('0x20')]=_0x259def;if(_0x3bf69a[_0x642a('0x33')]['includeAll']){_0x3f9a71[_0x642a('0x40')]=[{'all':!![]}];}return db['SugarcrmField'][_0x642a('0x41')](_0x3f9a71);})[_0x642a('0x27')](function(_0x1317a7){_0x1da9c8['rows']=_0x1317a7;return _0x1da9c8;})['then'](respondWithFilteredResult(_0xf2ac17,_0x3f9a71))[_0x642a('0x42')](handleError(_0xf2ac17,null));};exports[_0x642a('0x43')]=function(_0x2b8066,_0x5d9dfc){var _0x43998a={'raw':!![],'where':{'id':_0x2b8066[_0x642a('0x44')]['id']}},_0x4f8f5f={};_0x4f8f5f[_0x642a('0x31')]=_[_0x642a('0x32')](db[_0x642a('0x2c')][_0x642a('0x2d')]);_0x4f8f5f[_0x642a('0x33')]=_['keys'](_0x2b8066[_0x642a('0x33')]);_0x4f8f5f[_0x642a('0x34')]=_['intersection'](_0x4f8f5f['model'],_0x4f8f5f[_0x642a('0x33')]);_0x43998a['attributes']=_[_0x642a('0x36')](_0x4f8f5f['model'],qs['fields'](_0x2b8066[_0x642a('0x33')][_0x642a('0x37')]));_0x43998a[_0x642a('0x35')]=_0x43998a[_0x642a('0x35')][_0x642a('0x45')]?_0x43998a[_0x642a('0x35')]:_0x4f8f5f[_0x642a('0x31')];if(_0x2b8066[_0x642a('0x33')][_0x642a('0x46')]){_0x43998a['include']=[{'all':!![]}];}_0x43998a=_['merge']({},_0x43998a,_0x2b8066[_0x642a('0x3f')]);return db['SugarcrmField'][_0x642a('0x47')](_0x43998a)['then'](handleEntityNotFound(_0x5d9dfc,null))[_0x642a('0x27')](respondWithResult(_0x5d9dfc,null))[_0x642a('0x42')](handleError(_0x5d9dfc,null));};exports[_0x642a('0x48')]=function(_0x1f52ab,_0x249dcd){return db[_0x642a('0x2c')][_0x642a('0x48')](_0x1f52ab[_0x642a('0x49')],{})[_0x642a('0x27')](respondWithResult(_0x249dcd,0xc9))[_0x642a('0x42')](handleError(_0x249dcd,null));};exports[_0x642a('0x25')]=function(_0x3ca21c,_0x1e3dea){if(_0x3ca21c[_0x642a('0x49')]['id']){delete _0x3ca21c[_0x642a('0x49')]['id'];}return db[_0x642a('0x2c')][_0x642a('0x47')]({'where':{'id':_0x3ca21c[_0x642a('0x44')]['id']}})[_0x642a('0x27')](handleEntityNotFound(_0x1e3dea,null))[_0x642a('0x27')](saveUpdates(_0x3ca21c['body'],null))[_0x642a('0x27')](respondWithResult(_0x1e3dea,null))[_0x642a('0x42')](handleError(_0x1e3dea,null));};exports[_0x642a('0x26')]=function(_0x22f521,_0x19a137){return db[_0x642a('0x2c')][_0x642a('0x47')]({'where':{'id':_0x22f521[_0x642a('0x44')]['id']}})[_0x642a('0x27')](handleEntityNotFound(_0x19a137,null))['then'](removeEntity(_0x19a137,null))['catch'](handleError(_0x19a137,null));}; \ No newline at end of file +var _0xc7d0=['include','find','catch','create','body','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','count','status','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','keys'];(function(_0x4c6fcf,_0xf9397b){var _0x18c02f=function(_0x522b38){while(--_0x522b38){_0x4c6fcf['push'](_0x4c6fcf['shift']());}};_0x18c02f(++_0xf9397b);}(_0xc7d0,0x141));var _0x0c7d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc7d0[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0x0c7d('0x0'));var rimraf=require(_0x0c7d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0c7d('0x2'));var moment=require(_0x0c7d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0c7d('0x4'));var util=require(_0x0c7d('0x5'));var path=require(_0x0c7d('0x6'));var sox=require(_0x0c7d('0x7'));var csv=require(_0x0c7d('0x8'));var ejs=require(_0x0c7d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0c7d('0xa'));var squel=require(_0x0c7d('0xb'));var crypto=require(_0x0c7d('0xc'));var jsforce=require(_0x0c7d('0xd'));var deskjs=require(_0x0c7d('0xe'));var toCsv=require(_0x0c7d('0x8'));var querystring=require(_0x0c7d('0xf'));var Papa=require(_0x0c7d('0x10'));var Redis=require('ioredis');var authService=require(_0x0c7d('0x11'));var qs=require(_0x0c7d('0x12'));var as=require(_0x0c7d('0x13'));var hardwareService=require(_0x0c7d('0x14'));var logger=require(_0x0c7d('0x15'))(_0x0c7d('0x16'));var utils=require(_0x0c7d('0x17'));var config=require(_0x0c7d('0x18'));var licenseUtil=require(_0x0c7d('0x19'));var db=require(_0x0c7d('0x1a'))['db'];function respondWithStatusCode(_0x56a589,_0x2245d1){_0x2245d1=_0x2245d1||0xcc;return function(_0x55e232){if(_0x55e232){return _0x56a589[_0x0c7d('0x1b')](_0x2245d1);}return _0x56a589['status'](_0x2245d1)[_0x0c7d('0x1c')]();};}function respondWithResult(_0x36237d,_0x1d52b8){_0x1d52b8=_0x1d52b8||0xc8;return function(_0x41f46f){if(_0x41f46f){return _0x36237d['status'](_0x1d52b8)[_0x0c7d('0x1d')](_0x41f46f);}};}function respondWithFilteredResult(_0x1f09c7,_0x4eb5e1){return function(_0x1f5274){if(_0x1f5274){var _0x2fbdc0=typeof _0x4eb5e1[_0x0c7d('0x1e')]==='undefined'&&typeof _0x4eb5e1[_0x0c7d('0x1f')]==='undefined';var _0x224108=_0x1f5274[_0x0c7d('0x20')];var _0x5498f5=_0x2fbdc0?0x0:_0x4eb5e1['offset'];var _0x2e88f7=_0x2fbdc0?_0x1f5274[_0x0c7d('0x20')]:_0x4eb5e1['offset']+_0x4eb5e1[_0x0c7d('0x1f')];var _0x3caee;if(_0x2e88f7>=_0x224108){_0x2e88f7=_0x224108;_0x3caee=0xc8;}else{_0x3caee=0xce;}_0x1f09c7[_0x0c7d('0x21')](_0x3caee);return _0x1f09c7[_0x0c7d('0x22')](_0x0c7d('0x23'),_0x5498f5+'-'+_0x2e88f7+'/'+_0x224108)[_0x0c7d('0x1d')](_0x1f5274);}return null;};}function patchUpdates(_0x134b82){return function(_0x44a5bf){try{jsonpatch[_0x0c7d('0x24')](_0x44a5bf,_0x134b82,!![]);}catch(_0x486e50){return BPromise[_0x0c7d('0x25')](_0x486e50);}return _0x44a5bf['save']();};}function saveUpdates(_0x5132e3,_0x30d6d7){return function(_0x5c0906){if(_0x5c0906){return _0x5c0906[_0x0c7d('0x26')](_0x5132e3)['then'](function(_0x6b5b7c){return _0x6b5b7c;});}return null;};}function removeEntity(_0x1ffdb4,_0x2c8d55){return function(_0x3d6b42){if(_0x3d6b42){return _0x3d6b42[_0x0c7d('0x27')]()[_0x0c7d('0x28')](function(){_0x1ffdb4[_0x0c7d('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ce02c,_0x10e87f){return function(_0x38f32e){if(!_0x38f32e){_0x1ce02c['sendStatus'](0x194);}return _0x38f32e;};}function handleError(_0x3896ce,_0x36eb4b){_0x36eb4b=_0x36eb4b||0x1f4;return function(_0x525ef5){logger[_0x0c7d('0x29')](_0x525ef5[_0x0c7d('0x2a')]);if(_0x525ef5[_0x0c7d('0x2b')]){delete _0x525ef5[_0x0c7d('0x2b')];}_0x3896ce[_0x0c7d('0x21')](_0x36eb4b)[_0x0c7d('0x2c')](_0x525ef5);};}exports[_0x0c7d('0x2d')]=function(_0x39cca8,_0x4f20d8){var _0x4cc564={},_0x17a244={},_0x443fcb={'count':0x0,'rows':[]};var _0x158945=_[_0x0c7d('0x2e')](db[_0x0c7d('0x2f')][_0x0c7d('0x30')],function(_0x3ee263){return{'name':_0x3ee263[_0x0c7d('0x31')],'type':_0x3ee263[_0x0c7d('0x32')][_0x0c7d('0x33')]};});_0x17a244[_0x0c7d('0x34')]=_[_0x0c7d('0x2e')](_0x158945,_0x0c7d('0x2b'));_0x17a244[_0x0c7d('0x35')]=_['keys'](_0x39cca8[_0x0c7d('0x35')]);_0x17a244[_0x0c7d('0x36')]=_[_0x0c7d('0x37')](_0x17a244['model'],_0x17a244[_0x0c7d('0x35')]);_0x4cc564[_0x0c7d('0x38')]=_[_0x0c7d('0x37')](_0x17a244[_0x0c7d('0x34')],qs[_0x0c7d('0x39')](_0x39cca8[_0x0c7d('0x35')][_0x0c7d('0x39')]));_0x4cc564[_0x0c7d('0x38')]=_0x4cc564['attributes'][_0x0c7d('0x3a')]?_0x4cc564['attributes']:_0x17a244[_0x0c7d('0x34')];if(!_0x39cca8[_0x0c7d('0x35')][_0x0c7d('0x3b')](_0x0c7d('0x3c'))){_0x4cc564[_0x0c7d('0x1f')]=qs[_0x0c7d('0x1f')](_0x39cca8['query'][_0x0c7d('0x1f')]);_0x4cc564[_0x0c7d('0x1e')]=qs[_0x0c7d('0x1e')](_0x39cca8['query'][_0x0c7d('0x1e')]);}_0x4cc564['order']=qs[_0x0c7d('0x3d')](_0x39cca8[_0x0c7d('0x35')][_0x0c7d('0x3d')]);_0x4cc564[_0x0c7d('0x3e')]=qs[_0x0c7d('0x36')](_[_0x0c7d('0x3f')](_0x39cca8['query'],_0x17a244['filters']),_0x158945);if(_0x39cca8[_0x0c7d('0x35')]['filter']){_0x4cc564['where']=_[_0x0c7d('0x40')](_0x4cc564[_0x0c7d('0x3e')],{'$or':_[_0x0c7d('0x2e')](_0x158945,function(_0x3752b5){if(_0x3752b5['type']!==_0x0c7d('0x41')){var _0x308159={};_0x308159[_0x3752b5['name']]={'$like':'%'+_0x39cca8[_0x0c7d('0x35')][_0x0c7d('0x42')]+'%'};return _0x308159;}})});}_0x4cc564=_[_0x0c7d('0x40')]({},_0x4cc564,_0x39cca8[_0x0c7d('0x43')]);var _0x5caaf4={'where':_0x4cc564['where']};return db[_0x0c7d('0x2f')]['count'](_0x5caaf4)[_0x0c7d('0x28')](function(_0x60252e){_0x443fcb[_0x0c7d('0x20')]=_0x60252e;if(_0x39cca8['query'][_0x0c7d('0x44')]){_0x4cc564['include']=[{'all':!![]}];}return db[_0x0c7d('0x2f')][_0x0c7d('0x45')](_0x4cc564);})[_0x0c7d('0x28')](function(_0x493f89){_0x443fcb[_0x0c7d('0x46')]=_0x493f89;return _0x443fcb;})[_0x0c7d('0x28')](respondWithFilteredResult(_0x4f20d8,_0x4cc564))['catch'](handleError(_0x4f20d8,null));};exports[_0x0c7d('0x47')]=function(_0x550827,_0xd5763){var _0x2a45e4={'raw':!![],'where':{'id':_0x550827[_0x0c7d('0x48')]['id']}},_0x118418={};_0x118418[_0x0c7d('0x34')]=_['keys'](db['SugarcrmField'][_0x0c7d('0x30')]);_0x118418[_0x0c7d('0x35')]=_[_0x0c7d('0x49')](_0x550827[_0x0c7d('0x35')]);_0x118418[_0x0c7d('0x36')]=_[_0x0c7d('0x37')](_0x118418[_0x0c7d('0x34')],_0x118418[_0x0c7d('0x35')]);_0x2a45e4[_0x0c7d('0x38')]=_[_0x0c7d('0x37')](_0x118418[_0x0c7d('0x34')],qs[_0x0c7d('0x39')](_0x550827[_0x0c7d('0x35')][_0x0c7d('0x39')]));_0x2a45e4[_0x0c7d('0x38')]=_0x2a45e4[_0x0c7d('0x38')]['length']?_0x2a45e4[_0x0c7d('0x38')]:_0x118418[_0x0c7d('0x34')];if(_0x550827[_0x0c7d('0x35')][_0x0c7d('0x44')]){_0x2a45e4[_0x0c7d('0x4a')]=[{'all':!![]}];}_0x2a45e4=_[_0x0c7d('0x40')]({},_0x2a45e4,_0x550827['options']);return db[_0x0c7d('0x2f')][_0x0c7d('0x4b')](_0x2a45e4)['then'](handleEntityNotFound(_0xd5763,null))[_0x0c7d('0x28')](respondWithResult(_0xd5763,null))[_0x0c7d('0x4c')](handleError(_0xd5763,null));};exports[_0x0c7d('0x4d')]=function(_0x5b88f2,_0x289c73){return db[_0x0c7d('0x2f')][_0x0c7d('0x4d')](_0x5b88f2[_0x0c7d('0x4e')],{})[_0x0c7d('0x28')](respondWithResult(_0x289c73,0xc9))['catch'](handleError(_0x289c73,null));};exports['update']=function(_0x2d05cb,_0x2b025f){if(_0x2d05cb[_0x0c7d('0x4e')]['id']){delete _0x2d05cb['body']['id'];}return db[_0x0c7d('0x2f')]['find']({'where':{'id':_0x2d05cb['params']['id']}})[_0x0c7d('0x28')](handleEntityNotFound(_0x2b025f,null))['then'](saveUpdates(_0x2d05cb[_0x0c7d('0x4e')],null))[_0x0c7d('0x28')](respondWithResult(_0x2b025f,null))[_0x0c7d('0x4c')](handleError(_0x2b025f,null));};exports[_0x0c7d('0x27')]=function(_0x31b6ad,_0x3896d7){return db['SugarcrmField'][_0x0c7d('0x4b')]({'where':{'id':_0x31b6ad[_0x0c7d('0x48')]['id']}})[_0x0c7d('0x28')](handleEntityNotFound(_0x3896d7,null))['then'](removeEntity(_0x3896d7,null))[_0x0c7d('0x4c')](handleError(_0x3896d7,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 4a1cf4a..fe5efff 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 _0xa43e=['idField','FieldId','../../config/logger','request-promise','../../config/environment','exports','SugarcrmField','sugarcrm_unique_index'];(function(_0x1e48c6,_0x133760){var _0x77c4c7=function(_0x3fef5e){while(--_0x3fef5e){_0x1e48c6['push'](_0x1e48c6['shift']());}};_0x77c4c7(++_0x133760);}(_0xa43e,0xd2));var _0xea43=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xa43e[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xea43('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xea43('0x1'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xea43('0x2'));var attributes=require('./intSugarcrmField.attributes');module[_0xea43('0x3')]=function(_0x2267c0,_0x3783d8){return _0x2267c0['define'](_0xea43('0x4'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xea43('0x5'),'fields':[_0xea43('0x6'),_0xea43('0x7')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9c00=['rimraf','../../config/environment','./intSugarcrmField.attributes','exports','SugarcrmField','int_sugarcrm_fields','idField','FieldId','lodash','util','moment'];(function(_0x215dc8,_0x52c245){var _0x583ea3=function(_0x32350d){while(--_0x32350d){_0x215dc8['push'](_0x215dc8['shift']());}};_0x583ea3(++_0x52c245);}(_0x9c00,0x1ec));var _0x09c0=function(_0x1fa873,_0x1319ab){_0x1fa873=_0x1fa873-0x0;var _0x599fbc=_0x9c00[_0x1fa873];return _0x599fbc;};'use strict';var _=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x09c0('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x09c0('0x3'));var config=require(_0x09c0('0x4'));var attributes=require(_0x09c0('0x5'));module[_0x09c0('0x6')]=function(_0x3292cb,_0x1925e7){return _0x3292cb['define'](_0x09c0('0x7'),attributes,{'tableName':_0x09c0('0x8'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x09c0('0x9'),_0x09c0('0xa')],'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 2d0507a..7ad7ed5 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 _0x9b47=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch'];(function(_0x205301,_0x8ea42){var _0x40a2ba=function(_0x1e77a3){while(--_0x1e77a3){_0x205301['push'](_0x205301['shift']());}};_0x40a2ba(++_0x8ea42);}(_0x9b47,0x113));var _0x79b4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9b47[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x79b4('0x0'));var util=require(_0x79b4('0x1'));var moment=require('moment');var BPromise=require(_0x79b4('0x2'));var rs=require(_0x79b4('0x3'));var fs=require('fs');var Redis=require(_0x79b4('0x4'));var db=require(_0x79b4('0x5'))['db'];var utils=require(_0x79b4('0x6'));var logger=require(_0x79b4('0x7'))('rpc');var config=require(_0x79b4('0x8'));var jayson=require(_0x79b4('0x9'));var client=jayson[_0x79b4('0xa')][_0x79b4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bedc9,_0x3db390,_0x3e7a64){return new BPromise(function(_0x1fd384,_0x126dfe){return client[_0x79b4('0xc')](_0x3bedc9,_0x3e7a64)[_0x79b4('0xd')](function(_0x88d06b){logger[_0x79b4('0xe')](_0x79b4('0xf'),_0x3db390,_0x79b4('0x10'));logger[_0x79b4('0x11')](_0x79b4('0x12'),_0x3db390,_0x79b4('0x10'),JSON[_0x79b4('0x13')](_0x88d06b));if(_0x88d06b['error']){if(_0x88d06b['error'][_0x79b4('0x14')]===0x1f4){logger[_0x79b4('0x15')](_0x79b4('0xf'),_0x3db390,_0x88d06b[_0x79b4('0x15')][_0x79b4('0x16')]);return _0x126dfe(_0x88d06b['error']['message']);}logger[_0x79b4('0x15')](_0x79b4('0xf'),_0x3db390,_0x88d06b[_0x79b4('0x15')][_0x79b4('0x16')]);return _0x1fd384(_0x88d06b[_0x79b4('0x15')][_0x79b4('0x16')]);}else{logger[_0x79b4('0xe')](_0x79b4('0xf'),_0x3db390,_0x79b4('0x10'));_0x1fd384(_0x88d06b[_0x79b4('0x17')]['message']);}})[_0x79b4('0x18')](function(_0x51a482){logger['error'](_0x79b4('0xf'),_0x3db390,_0x51a482);_0x126dfe(_0x51a482);});});} \ No newline at end of file +var _0x1061=['client','http','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0x1061,0xc5));var _0x1106=function(_0x2cb84b,_0x1eadd4){_0x2cb84b=_0x2cb84b-0x0;var _0x1ec477=_0x1061[_0x2cb84b];return _0x1ec477;};'use strict';var _=require(_0x1106('0x0'));var util=require(_0x1106('0x1'));var moment=require('moment');var BPromise=require(_0x1106('0x2'));var rs=require(_0x1106('0x3'));var fs=require('fs');var Redis=require(_0x1106('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1106('0x5'));var logger=require(_0x1106('0x6'))(_0x1106('0x7'));var config=require(_0x1106('0x8'));var jayson=require(_0x1106('0x9'));var client=jayson[_0x1106('0xa')][_0x1106('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f2156,_0x11938d,_0x158ad2){return new BPromise(function(_0x56d6f8,_0x2414ae){return client[_0x1106('0xc')](_0x4f2156,_0x158ad2)['then'](function(_0x219b3f){logger[_0x1106('0xd')](_0x1106('0xe'),_0x11938d,_0x1106('0xf'));logger[_0x1106('0x10')](_0x1106('0x11'),_0x11938d,_0x1106('0xf'),JSON[_0x1106('0x12')](_0x219b3f));if(_0x219b3f[_0x1106('0x13')]){if(_0x219b3f[_0x1106('0x13')]['code']===0x1f4){logger[_0x1106('0x13')](_0x1106('0xe'),_0x11938d,_0x219b3f[_0x1106('0x13')]['message']);return _0x2414ae(_0x219b3f['error'][_0x1106('0x14')]);}logger[_0x1106('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x11938d,_0x219b3f[_0x1106('0x13')][_0x1106('0x14')]);return _0x56d6f8(_0x219b3f['error']['message']);}else{logger['info']('SugarcrmField,\x20%s,\x20%s',_0x11938d,_0x1106('0xf'));_0x56d6f8(_0x219b3f[_0x1106('0x15')][_0x1106('0x14')]);}})[_0x1106('0x16')](function(_0x5ebf87){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x11938d,_0x5ebf87);_0x2414ae(_0x5ebf87);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index db2f571..978a20e 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 _0x2263=['Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x204b76,_0x1409fa){var _0x6c47cc=function(_0x344e28){while(--_0x344e28){_0x204b76['push'](_0x204b76['shift']());}};_0x6c47cc(++_0x1409fa);}(_0x2263,0x6e));var _0x3226=function(_0x12833b,_0x26c1d2){_0x12833b=_0x12833b-0x0;var _0x3acad3=_0x2263[_0x12833b];return _0x3acad3;};'use strict';var multer=require(_0x3226('0x0'));var util=require(_0x3226('0x1'));var path=require(_0x3226('0x2'));var timeout=require(_0x3226('0x3'));var express=require(_0x3226('0x4'));var router=express[_0x3226('0x5')]();var fs_extra=require(_0x3226('0x6'));var auth=require(_0x3226('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3226('0x8'));var controller=require(_0x3226('0x9'));router[_0x3226('0xa')]('/',auth[_0x3226('0xb')](),controller[_0x3226('0xc')]);router['get'](_0x3226('0xd'),auth[_0x3226('0xb')](),controller['show']);router['get'](_0x3226('0xe'),auth[_0x3226('0xb')](),controller['getConfigurations']);router[_0x3226('0xa')](_0x3226('0xf'),auth[_0x3226('0xb')](),controller[_0x3226('0x10')]);router[_0x3226('0x11')]('/',auth[_0x3226('0xb')](),controller[_0x3226('0x12')]);router['post'](_0x3226('0xe'),auth[_0x3226('0xb')](),controller[_0x3226('0x13')]);router[_0x3226('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x3226('0xb')](),controller[_0x3226('0x15')]);module[_0x3226('0x16')]=router; \ No newline at end of file +var _0x5c58=['Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','get','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','/:id','update','delete','destroy','util','path'];(function(_0x3f1585,_0x3af590){var _0x2e1951=function(_0xb5cc20){while(--_0xb5cc20){_0x3f1585['push'](_0x3f1585['shift']());}};_0x2e1951(++_0x3af590);}(_0x5c58,0x154));var _0x85c5=function(_0x5d0e32,_0x324f39){_0x5d0e32=_0x5d0e32-0x0;var _0x3e015c=_0x5c58[_0x5d0e32];return _0x3e015c;};'use strict';var multer=require('multer');var util=require(_0x85c5('0x0'));var path=require(_0x85c5('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85c5('0x2')]();var fs_extra=require(_0x85c5('0x3'));var auth=require(_0x85c5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x85c5('0x5'));var controller=require('./intVtigerAccount.controller');router['get']('/',auth[_0x85c5('0x6')](),controller['index']);router[_0x85c5('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x85c5('0x7')](_0x85c5('0x8'),auth['isAuthenticated'](),controller[_0x85c5('0x9')]);router['get'](_0x85c5('0xa'),auth[_0x85c5('0x6')](),controller[_0x85c5('0xb')]);router[_0x85c5('0xc')]('/',auth['isAuthenticated'](),controller[_0x85c5('0xd')]);router[_0x85c5('0xc')](_0x85c5('0x8'),auth[_0x85c5('0x6')](),controller[_0x85c5('0xe')]);router['put'](_0x85c5('0xf'),auth[_0x85c5('0x6')](),controller[_0x85c5('0x10')]);router[_0x85c5('0x11')](_0x85c5('0xf'),auth['isAuthenticated'](),controller[_0x85c5('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index bd8738e..331321e 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 _0xf329=['STRING','HelpDesk','sequelize','exports'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xf329,0x76));var _0x9f32=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf329[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9f32('0x0'));module[_0x9f32('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x9f32('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x9f32('0x2')],'allowNull':![],'defaultValue':_0x9f32('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x9f32('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x9f32('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa407=['sequelize','STRING','HelpDesk'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa407,0x1aa));var _0x7a40=function(_0x27e32e,_0x545899){_0x27e32e=_0x27e32e-0x0;var _0x3fbac7=_0xa407[_0x27e32e];return _0x3fbac7;};'use strict';var Sequelize=require(_0x7a40('0x0'));module['exports']={'name':{'type':Sequelize[_0x7a40('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7a40('0x1')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7a40('0x2')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x7a40('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x7a40('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 64ce267..0913f00 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 _0x931c=['../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','send','index','VtigerAccount','fieldName','type','key','model','map','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','update','body','getConfigurations','findOne','merge','addConfiguration','Subjects','channel','getDescriptions','VtigerConfiguration','VtigerField','md5','getFields','username','description','moduleName','remoteUri','accessKey','slice','substring','format','%s/webservice.php','GET','getchallenge','success','result','token','describe','sessionName','autogenerated','reference','owner','includes','remove','editable','false','startsWith','picklist','picklistValues','label','value','log','vTiger\x20error:\x20','test','statusCode','stringify','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x4a372d,_0x3bd91f){var _0x546ac0=function(_0x1311f5){while(--_0x1311f5){_0x4a372d['push'](_0x4a372d['shift']());}};_0x546ac0(++_0x3bd91f);}(_0x931c,0x1ca));var _0xc931=function(_0x5bf456,_0xfe33b7){_0x5bf456=_0x5bf456-0x0;var _0x297750=_0x931c[_0x5bf456];return _0x297750;};'use strict';var emlformat=require(_0xc931('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc931('0x1'));var jsonpatch=require(_0xc931('0x2'));var rp=require(_0xc931('0x3'));var moment=require(_0xc931('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc931('0x5'));var util=require('util');var path=require(_0xc931('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc931('0x7'));var fs=require('fs');var fs_extra=require(_0xc931('0x8'));var _=require(_0xc931('0x9'));var squel=require(_0xc931('0xa'));var crypto=require(_0xc931('0xb'));var jsforce=require(_0xc931('0xc'));var deskjs=require(_0xc931('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc931('0xe'));var Papa=require(_0xc931('0xf'));var Redis=require(_0xc931('0x10'));var authService=require(_0xc931('0x11'));var qs=require(_0xc931('0x12'));var as=require(_0xc931('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc931('0x14'))(_0xc931('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc931('0x16'))['db'];var integrations=require(_0xc931('0x17'));function respondWithStatusCode(_0x5c184b,_0x2955bc){_0x2955bc=_0x2955bc||0xcc;return function(_0x162d7b){if(_0x162d7b){return _0x5c184b[_0xc931('0x18')](_0x2955bc);}return _0x5c184b[_0xc931('0x19')](_0x2955bc)[_0xc931('0x1a')]();};}function respondWithResult(_0x4b94be,_0x80960e){_0x80960e=_0x80960e||0xc8;return function(_0x5e003d){if(_0x5e003d){return _0x4b94be[_0xc931('0x19')](_0x80960e)[_0xc931('0x1b')](_0x5e003d);}};}function respondWithFilteredResult(_0x55a9f5,_0x2f5a08){return function(_0x4d79a1){if(_0x4d79a1){var _0xc5e2a0=typeof _0x2f5a08[_0xc931('0x1c')]===_0xc931('0x1d')&&typeof _0x2f5a08[_0xc931('0x1e')]===_0xc931('0x1d');var _0x315960=_0x4d79a1[_0xc931('0x1f')];var _0x15350e=_0xc5e2a0?0x0:_0x2f5a08[_0xc931('0x1c')];var _0x2663c8=_0xc5e2a0?_0x4d79a1[_0xc931('0x1f')]:_0x2f5a08['offset']+_0x2f5a08[_0xc931('0x1e')];var _0xe2d730;if(_0x2663c8>=_0x315960){_0x2663c8=_0x315960;_0xe2d730=0xc8;}else{_0xe2d730=0xce;}_0x55a9f5['status'](_0xe2d730);return _0x55a9f5[_0xc931('0x20')](_0xc931('0x21'),_0x15350e+'-'+_0x2663c8+'/'+_0x315960)[_0xc931('0x1b')](_0x4d79a1);}return null;};}function patchUpdates(_0xbc275b){return function(_0x4760a2){try{jsonpatch[_0xc931('0x22')](_0x4760a2,_0xbc275b,!![]);}catch(_0x188683){return BPromise[_0xc931('0x23')](_0x188683);}return _0x4760a2['save']();};}function saveUpdates(_0x5b1cfb,_0x1ab491){return function(_0x5d8d69){if(_0x5d8d69){return _0x5d8d69['update'](_0x5b1cfb)[_0xc931('0x24')](function(_0x3b3125){return _0x3b3125;});}return null;};}function removeEntity(_0x511594,_0x5791a0){return function(_0x15cd81){if(_0x15cd81){return _0x15cd81[_0xc931('0x25')]()[_0xc931('0x24')](function(){_0x511594[_0xc931('0x19')](0xcc)[_0xc931('0x1a')]();});}};}function handleEntityNotFound(_0x2926cf,_0x1f82a9){return function(_0x32259d){if(!_0x32259d){_0x2926cf[_0xc931('0x18')](0x194);}return _0x32259d;};}function handleError(_0x157a3d,_0x5a0423){_0x5a0423=_0x5a0423||0x1f4;return function(_0x3f356b){logger[_0xc931('0x26')](_0x3f356b[_0xc931('0x27')]);if(_0x3f356b['name']){delete _0x3f356b['name'];}_0x157a3d[_0xc931('0x19')](_0x5a0423)[_0xc931('0x28')](_0x3f356b);};}exports[_0xc931('0x29')]=function(_0x2468cf,_0x176a1a){var _0xd3ce03={},_0x1f2aba={},_0x3305fa={'count':0x0,'rows':[]};var _0x215ebb=_['map'](db[_0xc931('0x2a')]['rawAttributes'],function(_0x18c202){return{'name':_0x18c202[_0xc931('0x2b')],'type':_0x18c202[_0xc931('0x2c')][_0xc931('0x2d')]};});_0x1f2aba[_0xc931('0x2e')]=_[_0xc931('0x2f')](_0x215ebb,_0xc931('0x30'));_0x1f2aba[_0xc931('0x31')]=_[_0xc931('0x32')](_0x2468cf[_0xc931('0x31')]);_0x1f2aba[_0xc931('0x33')]=_[_0xc931('0x34')](_0x1f2aba[_0xc931('0x2e')],_0x1f2aba['query']);_0xd3ce03['attributes']=_[_0xc931('0x34')](_0x1f2aba[_0xc931('0x2e')],qs[_0xc931('0x35')](_0x2468cf[_0xc931('0x31')][_0xc931('0x35')]));_0xd3ce03[_0xc931('0x36')]=_0xd3ce03[_0xc931('0x36')][_0xc931('0x37')]?_0xd3ce03[_0xc931('0x36')]:_0x1f2aba['model'];if(!_0x2468cf[_0xc931('0x31')][_0xc931('0x38')](_0xc931('0x39'))){_0xd3ce03[_0xc931('0x1e')]=qs[_0xc931('0x1e')](_0x2468cf['query'][_0xc931('0x1e')]);_0xd3ce03[_0xc931('0x1c')]=qs[_0xc931('0x1c')](_0x2468cf['query'][_0xc931('0x1c')]);}_0xd3ce03[_0xc931('0x3a')]=qs[_0xc931('0x3b')](_0x2468cf[_0xc931('0x31')]['sort']);_0xd3ce03['where']=qs[_0xc931('0x33')](_[_0xc931('0x3c')](_0x2468cf['query'],_0x1f2aba[_0xc931('0x33')]),_0x215ebb);if(_0x2468cf['query'][_0xc931('0x3d')]){_0xd3ce03['where']=_['merge'](_0xd3ce03[_0xc931('0x3e')],{'$or':_['map'](_0x215ebb,function(_0x2af41c){if(_0x2af41c[_0xc931('0x2c')]!==_0xc931('0x3f')){var _0x34ee54={};_0x34ee54[_0x2af41c[_0xc931('0x30')]]={'$like':'%'+_0x2468cf[_0xc931('0x31')][_0xc931('0x3d')]+'%'};return _0x34ee54;}})});}_0xd3ce03=_['merge']({},_0xd3ce03,_0x2468cf[_0xc931('0x40')]);var _0x15b77d={'where':_0xd3ce03[_0xc931('0x3e')]};return db[_0xc931('0x2a')][_0xc931('0x1f')](_0x15b77d)['then'](function(_0x4af982){_0x3305fa[_0xc931('0x1f')]=_0x4af982;if(_0x2468cf[_0xc931('0x31')]['includeAll']){_0xd3ce03[_0xc931('0x41')]=[{'all':!![]}];}return db[_0xc931('0x2a')][_0xc931('0x42')](_0xd3ce03);})[_0xc931('0x24')](function(_0x3ea708){_0x3305fa[_0xc931('0x43')]=_0x3ea708;return _0x3305fa;})[_0xc931('0x24')](respondWithFilteredResult(_0x176a1a,_0xd3ce03))[_0xc931('0x44')](handleError(_0x176a1a,null));};exports[_0xc931('0x45')]=function(_0x202138,_0x1c758a){var _0x3e48dd={'raw':![],'where':{'id':_0x202138[_0xc931('0x46')]['id']}},_0x2dbdc9={};_0x2dbdc9[_0xc931('0x2e')]=_[_0xc931('0x32')](db['VtigerAccount'][_0xc931('0x47')]);_0x2dbdc9[_0xc931('0x31')]=_['keys'](_0x202138[_0xc931('0x31')]);_0x2dbdc9['filters']=_['intersection'](_0x2dbdc9[_0xc931('0x2e')],_0x2dbdc9[_0xc931('0x31')]);_0x3e48dd[_0xc931('0x36')]=_[_0xc931('0x34')](_0x2dbdc9['model'],qs['fields'](_0x202138[_0xc931('0x31')][_0xc931('0x35')]));_0x3e48dd[_0xc931('0x36')]=_0x3e48dd['attributes'][_0xc931('0x37')]?_0x3e48dd[_0xc931('0x36')]:_0x2dbdc9[_0xc931('0x2e')];if(_0x202138['query'][_0xc931('0x48')]){_0x3e48dd['include']=[{'all':!![]}];}_0x3e48dd=_['merge']({},_0x3e48dd,_0x202138[_0xc931('0x40')]);return db['VtigerAccount']['find'](_0x3e48dd)[_0xc931('0x24')](handleEntityNotFound(_0x1c758a,null))['then'](respondWithResult(_0x1c758a,null))['catch'](handleError(_0x1c758a,null));};exports[_0xc931('0x49')]=function(_0xed4005,_0x4a355f){return db['VtigerAccount'][_0xc931('0x49')](_0xed4005['body'],{})[_0xc931('0x24')](respondWithResult(_0x4a355f,0xc9))[_0xc931('0x44')](handleError(_0x4a355f,null));};exports[_0xc931('0x4a')]=function(_0x5980ab,_0x22d760){if(_0x5980ab[_0xc931('0x4b')]['id']){delete _0x5980ab[_0xc931('0x4b')]['id'];}return db['VtigerAccount']['find']({'where':{'id':_0x5980ab[_0xc931('0x46')]['id']}})[_0xc931('0x24')](handleEntityNotFound(_0x22d760,null))[_0xc931('0x24')](saveUpdates(_0x5980ab[_0xc931('0x4b')],null))[_0xc931('0x24')](respondWithResult(_0x22d760,null))[_0xc931('0x44')](handleError(_0x22d760,null));};exports['destroy']=function(_0x2bfc44,_0x28317c){return db['VtigerAccount']['find']({'where':{'id':_0x2bfc44[_0xc931('0x46')]['id']}})[_0xc931('0x24')](handleEntityNotFound(_0x28317c,null))['then'](removeEntity(_0x28317c,null))[_0xc931('0x44')](handleError(_0x28317c,null));};exports[_0xc931('0x4c')]=function(_0x1ca17f,_0x414f83,_0x3c1cb4){var _0x5b50b6={};var _0x43f25f={};var _0x5e4d80;var _0x2b533a;return db[_0xc931('0x2a')][_0xc931('0x4d')]({'where':{'id':_0x1ca17f['params']['id']}})['then'](handleEntityNotFound(_0x414f83,null))[_0xc931('0x24')](function(_0x140de0){if(_0x140de0){_0x5e4d80=_0x140de0;_0x43f25f[_0xc931('0x2e')]=_['keys'](db['VtigerConfiguration'][_0xc931('0x47')]);_0x43f25f[_0xc931('0x31')]=_[_0xc931('0x32')](_0x1ca17f[_0xc931('0x31')]);_0x43f25f['filters']=_['intersection'](_0x43f25f[_0xc931('0x2e')],_0x43f25f[_0xc931('0x31')]);_0x5b50b6[_0xc931('0x36')]=_[_0xc931('0x34')](_0x43f25f[_0xc931('0x2e')],qs[_0xc931('0x35')](_0x1ca17f['query']['fields']));_0x5b50b6['attributes']=_0x5b50b6[_0xc931('0x36')][_0xc931('0x37')]?_0x5b50b6[_0xc931('0x36')]:_0x43f25f[_0xc931('0x2e')];_0x5b50b6[_0xc931('0x3a')]=qs[_0xc931('0x3b')](_0x1ca17f[_0xc931('0x31')][_0xc931('0x3b')]);_0x5b50b6['where']=qs[_0xc931('0x33')](_[_0xc931('0x3c')](_0x1ca17f[_0xc931('0x31')],_0x43f25f['filters']));if(_0x1ca17f['query'][_0xc931('0x3d')]){_0x5b50b6[_0xc931('0x3e')]=_[_0xc931('0x4e')](_0x5b50b6[_0xc931('0x3e')],{'$or':_[_0xc931('0x2f')](_0x5b50b6[_0xc931('0x36')],function(_0x432821){var _0x20107c={};_0x20107c[_0x432821]={'$like':'%'+_0x1ca17f[_0xc931('0x31')][_0xc931('0x3d')]+'%'};return _0x20107c;})});}_0x5b50b6=_['merge']({},_0x5b50b6,_0x1ca17f[_0xc931('0x40')]);return _0x5e4d80[_0xc931('0x4c')](_0x5b50b6);}})['then'](function(_0x15fc76){if(_0x15fc76){_0x2b533a=_0x15fc76['length'];if(!_0x1ca17f['query'][_0xc931('0x38')]('nolimit')){_0x5b50b6[_0xc931('0x1e')]=qs['limit'](_0x1ca17f[_0xc931('0x31')][_0xc931('0x1e')]);_0x5b50b6[_0xc931('0x1c')]=qs['offset'](_0x1ca17f[_0xc931('0x31')]['offset']);}return _0x5e4d80[_0xc931('0x4c')](_0x5b50b6);}})['then'](function(_0x2cbea4){if(_0x2cbea4){return _0x2cbea4?{'count':_0x2b533a,'rows':_0x2cbea4}:null;}})[_0xc931('0x24')](respondWithResult(_0x414f83,null))[_0xc931('0x44')](handleError(_0x414f83,null));};exports[_0xc931('0x4f')]=function(_0x3e0410,_0x2b3b78,_0x3f63a7){if(_0x3e0410[_0xc931('0x4b')]['id']){delete _0x3e0410[_0xc931('0x4b')]['id'];}return db['VtigerAccount'][_0xc931('0x4d')]({'where':{'id':_0x3e0410['params']['id']}})[_0xc931('0x24')](handleEntityNotFound(_0x2b3b78,null))[_0xc931('0x24')](function(_0x2726a8){if(_0x2726a8){_0x3e0410['body']['AccountId']=_0x2726a8['id'];_0x3e0410[_0xc931('0x4b')][_0xc931('0x50')]=integrations['getSubjects'](_0x3e0410['body'][_0xc931('0x51')],_0x3e0410['body'][_0xc931('0x2c')]);_0x3e0410[_0xc931('0x4b')]['Descriptions']=integrations[_0xc931('0x52')](_0x3e0410[_0xc931('0x4b')]['channel'],_0x3e0410['body']['type']);return db[_0xc931('0x53')][_0xc931('0x49')](_0x3e0410[_0xc931('0x4b')],{'include':[{'model':db['VtigerField'],'as':_0xc931('0x50')},{'model':db[_0xc931('0x54')],'as':'Descriptions'}]});}return null;})[_0xc931('0x24')](respondWithResult(_0x2b3b78,null))['catch'](handleError(_0x2b3b78,null));};var md5=require(_0xc931('0x55'));exports[_0xc931('0x56')]=function(_0x2cc00b,_0x45b0e0,_0x34945e){var _0x245ca3=null;var _0x25e582=null;var _0x23c66b=null;var _0x3b76f0=null;var _0x30c223='';return db[_0xc931('0x2a')][_0xc931('0x4d')]({'where':{'id':_0x2cc00b['params']['id']},'attributes':['id',_0xc931('0x30'),_0xc931('0x57'),_0xc931('0x58'),_0xc931('0x59'),_0xc931('0x5a'),'serverUrl',_0xc931('0x5b')]})[_0xc931('0x24')](handleEntityNotFound(_0x45b0e0,null))[_0xc931('0x24')](function(_0x5b8795){if(_0x5b8795){_0x245ca3=_0x5b8795[_0xc931('0x57')];_0x25e582=_0x5b8795['accessKey'];_0x23c66b=_0x5b8795[_0xc931('0x59')];_0x30c223=_0x5b8795[_0xc931('0x5a')];var _0x327795=_0x30c223[_0xc931('0x5c')](-0x1);if(_0x327795==='/'){_0x30c223=_0x30c223[_0xc931('0x5d')](0x0,_0x30c223['lastIndexOf'](_0x327795));}_0x3b76f0=util[_0xc931('0x5e')](_0xc931('0x5f'),_0x30c223);var _0x3a61aa={'method':_0xc931('0x60'),'uri':_0x3b76f0,'qs':{'operation':_0xc931('0x61'),'username':_0x5b8795['username']},'json':!![]};return rp(_0x3a61aa);}})[_0xc931('0x24')](function(_0x1e2957){if(_0x1e2957[_0xc931('0x62')]){var _0x598647={'method':'POST','uri':_0x3b76f0,'form':{'operation':'login','username':_0x245ca3,'accessKey':md5(_0x1e2957[_0xc931('0x63')][_0xc931('0x64')]+_0x25e582)},'json':!![]};return rp(_0x598647);}})[_0xc931('0x24')](function(_0x4e8d83){if(_0x4e8d83[_0xc931('0x62')]){var _0x39aa18={'method':_0xc931('0x60'),'uri':_0x3b76f0,'qs':{'operation':_0xc931('0x65'),'username':_0x245ca3,'sessionName':_0x4e8d83['result'][_0xc931('0x66')],'elementType':_0x23c66b},'json':!![]};return rp(_0x39aa18);}})[_0xc931('0x24')](function(_0x41e942){if(_0x41e942[_0xc931('0x62')]){var _0x562f3a=[_0xc931('0x67'),_0xc931('0x68'),_0xc931('0x69')];_['remove'](_0x41e942[_0xc931('0x63')]['fields'],function(_0x18bda8){return _0x562f3a[_0xc931('0x6a')](_0x18bda8[_0xc931('0x2c')][_0xc931('0x30')]);});_[_0xc931('0x6b')](_0x41e942[_0xc931('0x63')][_0xc931('0x35')],function(_0x38a604){return _0x38a604[_0xc931('0x6c')]===_0xc931('0x6d');});return{'count':_0x41e942[_0xc931('0x63')][_0xc931('0x35')][_0xc931('0x37')],'rows':_[_0xc931('0x2f')](_0x41e942[_0xc931('0x63')][_0xc931('0x35')],function(_0x1aa1e6){return{'id':_0x1aa1e6[_0xc931('0x30')],'name':_0x1aa1e6['label'],'custom':_[_0xc931('0x6e')](_0x1aa1e6[_0xc931('0x30')],'cf_')?!![]:![],'options':_0x1aa1e6[_0xc931('0x2c')]['name']===_0xc931('0x6f')&&_0x1aa1e6['type'][_0xc931('0x70')][_0xc931('0x37')]>0x0?_[_0xc931('0x2f')](_0x1aa1e6[_0xc931('0x2c')]['picklistValues'],function(_0x2fd196){return{'name':_0x2fd196[_0xc931('0x71')],'value':_0x2fd196[_0xc931('0x72')]};}):[]};})};}})['then'](respondWithResult(_0x45b0e0,null))[_0xc931('0x44')](function(_0x413d36){console[_0xc931('0x73')](_0xc931('0x74')+_0x413d36);var _0x47ac13=_0x2cc00b[_0xc931('0x31')][_0xc931('0x75')]?0x1f4:_0x413d36[_0xc931('0x76')]||0x1f4;logger[_0xc931('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0xc931('0x56'),_0x47ac13,JSON[_0xc931('0x77')](_0x413d36));delete _0x413d36[_0xc931('0x30')];if(_0x47ac13===0x191){_0x47ac13=0x190;}_0x45b0e0[_0xc931('0x19')](_0x47ac13)[_0xc931('0x28')](_0x2cc00b[_0xc931('0x31')][_0xc931('0x75')]?{'message':'Wrong\x20credentials','statusCode':_0x413d36[_0xc931('0x76')]}:_0x413d36);});}; \ No newline at end of file +var _0xe37c=['type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','show','params','create','body','catch','find','getConfigurations','findOne','VtigerConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','%s/webservice.php','GET','getchallenge','success','POST','login','result','sessionName','autogenerated','reference','owner','remove','includes','editable','label','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','VtigerAccount','rawAttributes'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xe37c,0x144));var _0xce37=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0xe37c[_0x1a7846];return _0x48049;};'use strict';var emlformat=require(_0xce37('0x0'));var rimraf=require(_0xce37('0x1'));var zipdir=require(_0xce37('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xce37('0x3'));var moment=require('moment');var BPromise=require(_0xce37('0x4'));var Mustache=require(_0xce37('0x5'));var util=require(_0xce37('0x6'));var path=require(_0xce37('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xce37('0x8'));var _=require(_0xce37('0x9'));var squel=require(_0xce37('0xa'));var crypto=require(_0xce37('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xce37('0xc'));var toCsv=require(_0xce37('0xd'));var querystring=require(_0xce37('0xe'));var Papa=require(_0xce37('0xf'));var Redis=require(_0xce37('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xce37('0x11'));var as=require(_0xce37('0x12'));var hardwareService=require(_0xce37('0x13'));var logger=require(_0xce37('0x14'))(_0xce37('0x15'));var utils=require(_0xce37('0x16'));var config=require(_0xce37('0x17'));var licenseUtil=require(_0xce37('0x18'));var db=require(_0xce37('0x19'))['db'];var integrations=require(_0xce37('0x1a'));function respondWithStatusCode(_0x2f6428,_0x27f292){_0x27f292=_0x27f292||0xcc;return function(_0x1e9120){if(_0x1e9120){return _0x2f6428['sendStatus'](_0x27f292);}return _0x2f6428[_0xce37('0x1b')](_0x27f292)['end']();};}function respondWithResult(_0x8988d9,_0x3e2b0b){_0x3e2b0b=_0x3e2b0b||0xc8;return function(_0x357a44){if(_0x357a44){return _0x8988d9[_0xce37('0x1b')](_0x3e2b0b)[_0xce37('0x1c')](_0x357a44);}};}function respondWithFilteredResult(_0x290f54,_0x43fa55){return function(_0x205d5a){if(_0x205d5a){var _0x749be=typeof _0x43fa55[_0xce37('0x1d')]===_0xce37('0x1e')&&typeof _0x43fa55[_0xce37('0x1f')]===_0xce37('0x1e');var _0x45c883=_0x205d5a['count'];var _0x310c41=_0x749be?0x0:_0x43fa55['offset'];var _0x1ac870=_0x749be?_0x205d5a['count']:_0x43fa55['offset']+_0x43fa55['limit'];var _0x3009ac;if(_0x1ac870>=_0x45c883){_0x1ac870=_0x45c883;_0x3009ac=0xc8;}else{_0x3009ac=0xce;}_0x290f54[_0xce37('0x1b')](_0x3009ac);return _0x290f54['set'](_0xce37('0x20'),_0x310c41+'-'+_0x1ac870+'/'+_0x45c883)[_0xce37('0x1c')](_0x205d5a);}return null;};}function patchUpdates(_0x543281){return function(_0x199791){try{jsonpatch[_0xce37('0x21')](_0x199791,_0x543281,!![]);}catch(_0x57e685){return BPromise[_0xce37('0x22')](_0x57e685);}return _0x199791['save']();};}function saveUpdates(_0x5acca2,_0x515dae){return function(_0x182b39){if(_0x182b39){return _0x182b39[_0xce37('0x23')](_0x5acca2)[_0xce37('0x24')](function(_0x310bd8){return _0x310bd8;});}return null;};}function removeEntity(_0x20d88d,_0x1bd1a3){return function(_0x28d1ba){if(_0x28d1ba){return _0x28d1ba[_0xce37('0x25')]()['then'](function(){_0x20d88d['status'](0xcc)[_0xce37('0x26')]();});}};}function handleEntityNotFound(_0x3f519c,_0x446dab){return function(_0x2ab9e2){if(!_0x2ab9e2){_0x3f519c[_0xce37('0x27')](0x194);}return _0x2ab9e2;};}function handleError(_0x2a695c,_0x3294b4){_0x3294b4=_0x3294b4||0x1f4;return function(_0x43e037){logger[_0xce37('0x28')](_0x43e037[_0xce37('0x29')]);if(_0x43e037['name']){delete _0x43e037[_0xce37('0x2a')];}_0x2a695c['status'](_0x3294b4)[_0xce37('0x2b')](_0x43e037);};}exports[_0xce37('0x2c')]=function(_0xef7e01,_0x9cbf93){var _0x25478a={},_0x1a0898={},_0x5dc2ea={'count':0x0,'rows':[]};var _0x2b1dc8=_[_0xce37('0x2d')](db[_0xce37('0x2e')][_0xce37('0x2f')],function(_0x29d6a8){return{'name':_0x29d6a8['fieldName'],'type':_0x29d6a8[_0xce37('0x30')][_0xce37('0x31')]};});_0x1a0898['model']=_['map'](_0x2b1dc8,'name');_0x1a0898[_0xce37('0x32')]=_[_0xce37('0x33')](_0xef7e01[_0xce37('0x32')]);_0x1a0898[_0xce37('0x34')]=_[_0xce37('0x35')](_0x1a0898[_0xce37('0x36')],_0x1a0898['query']);_0x25478a['attributes']=_[_0xce37('0x35')](_0x1a0898['model'],qs[_0xce37('0x37')](_0xef7e01[_0xce37('0x32')][_0xce37('0x37')]));_0x25478a[_0xce37('0x38')]=_0x25478a[_0xce37('0x38')][_0xce37('0x39')]?_0x25478a[_0xce37('0x38')]:_0x1a0898['model'];if(!_0xef7e01['query'][_0xce37('0x3a')](_0xce37('0x3b'))){_0x25478a[_0xce37('0x1f')]=qs[_0xce37('0x1f')](_0xef7e01['query'][_0xce37('0x1f')]);_0x25478a[_0xce37('0x1d')]=qs['offset'](_0xef7e01[_0xce37('0x32')]['offset']);}_0x25478a[_0xce37('0x3c')]=qs[_0xce37('0x3d')](_0xef7e01[_0xce37('0x32')][_0xce37('0x3d')]);_0x25478a[_0xce37('0x3e')]=qs[_0xce37('0x34')](_[_0xce37('0x3f')](_0xef7e01[_0xce37('0x32')],_0x1a0898[_0xce37('0x34')]),_0x2b1dc8);if(_0xef7e01[_0xce37('0x32')][_0xce37('0x40')]){_0x25478a['where']=_[_0xce37('0x41')](_0x25478a[_0xce37('0x3e')],{'$or':_['map'](_0x2b1dc8,function(_0x17084d){if(_0x17084d[_0xce37('0x30')]!==_0xce37('0x42')){var _0x10565c={};_0x10565c[_0x17084d[_0xce37('0x2a')]]={'$like':'%'+_0xef7e01[_0xce37('0x32')][_0xce37('0x40')]+'%'};return _0x10565c;}})});}_0x25478a=_[_0xce37('0x41')]({},_0x25478a,_0xef7e01[_0xce37('0x43')]);var _0x20f846={'where':_0x25478a['where']};return db[_0xce37('0x2e')][_0xce37('0x44')](_0x20f846)['then'](function(_0x4b879d){_0x5dc2ea[_0xce37('0x44')]=_0x4b879d;if(_0xef7e01['query'][_0xce37('0x45')]){_0x25478a[_0xce37('0x46')]=[{'all':!![]}];}return db['VtigerAccount']['findAll'](_0x25478a);})['then'](function(_0x5b37ff){_0x5dc2ea[_0xce37('0x47')]=_0x5b37ff;return _0x5dc2ea;})[_0xce37('0x24')](respondWithFilteredResult(_0x9cbf93,_0x25478a))['catch'](handleError(_0x9cbf93,null));};exports[_0xce37('0x48')]=function(_0x2c53a2,_0xa93359){var _0x118bb8={'raw':![],'where':{'id':_0x2c53a2[_0xce37('0x49')]['id']}},_0x1576c8={};_0x1576c8[_0xce37('0x36')]=_[_0xce37('0x33')](db[_0xce37('0x2e')][_0xce37('0x2f')]);_0x1576c8[_0xce37('0x32')]=_[_0xce37('0x33')](_0x2c53a2[_0xce37('0x32')]);_0x1576c8[_0xce37('0x34')]=_[_0xce37('0x35')](_0x1576c8[_0xce37('0x36')],_0x1576c8[_0xce37('0x32')]);_0x118bb8[_0xce37('0x38')]=_[_0xce37('0x35')](_0x1576c8[_0xce37('0x36')],qs[_0xce37('0x37')](_0x2c53a2[_0xce37('0x32')][_0xce37('0x37')]));_0x118bb8['attributes']=_0x118bb8[_0xce37('0x38')]['length']?_0x118bb8[_0xce37('0x38')]:_0x1576c8[_0xce37('0x36')];if(_0x2c53a2[_0xce37('0x32')][_0xce37('0x45')]){_0x118bb8['include']=[{'all':!![]}];}_0x118bb8=_['merge']({},_0x118bb8,_0x2c53a2[_0xce37('0x43')]);return db[_0xce37('0x2e')]['find'](_0x118bb8)[_0xce37('0x24')](handleEntityNotFound(_0xa93359,null))[_0xce37('0x24')](respondWithResult(_0xa93359,null))['catch'](handleError(_0xa93359,null));};exports[_0xce37('0x4a')]=function(_0x2ef19f,_0x799bb3){return db[_0xce37('0x2e')][_0xce37('0x4a')](_0x2ef19f[_0xce37('0x4b')],{})[_0xce37('0x24')](respondWithResult(_0x799bb3,0xc9))[_0xce37('0x4c')](handleError(_0x799bb3,null));};exports['update']=function(_0x465289,_0x5a2efb){if(_0x465289[_0xce37('0x4b')]['id']){delete _0x465289[_0xce37('0x4b')]['id'];}return db[_0xce37('0x2e')]['find']({'where':{'id':_0x465289[_0xce37('0x49')]['id']}})['then'](handleEntityNotFound(_0x5a2efb,null))[_0xce37('0x24')](saveUpdates(_0x465289[_0xce37('0x4b')],null))[_0xce37('0x24')](respondWithResult(_0x5a2efb,null))[_0xce37('0x4c')](handleError(_0x5a2efb,null));};exports[_0xce37('0x25')]=function(_0x165f5b,_0x13b178){return db['VtigerAccount'][_0xce37('0x4d')]({'where':{'id':_0x165f5b['params']['id']}})[_0xce37('0x24')](handleEntityNotFound(_0x13b178,null))[_0xce37('0x24')](removeEntity(_0x13b178,null))[_0xce37('0x4c')](handleError(_0x13b178,null));};exports[_0xce37('0x4e')]=function(_0x499e61,_0x3f5627,_0x1f9bb2){var _0x16b612={};var _0x2ebecf={};var _0x15313f;var _0x594d2e;return db[_0xce37('0x2e')][_0xce37('0x4f')]({'where':{'id':_0x499e61[_0xce37('0x49')]['id']}})[_0xce37('0x24')](handleEntityNotFound(_0x3f5627,null))[_0xce37('0x24')](function(_0x340af2){if(_0x340af2){_0x15313f=_0x340af2;_0x2ebecf[_0xce37('0x36')]=_['keys'](db[_0xce37('0x50')][_0xce37('0x2f')]);_0x2ebecf[_0xce37('0x32')]=_[_0xce37('0x33')](_0x499e61[_0xce37('0x32')]);_0x2ebecf['filters']=_['intersection'](_0x2ebecf[_0xce37('0x36')],_0x2ebecf[_0xce37('0x32')]);_0x16b612['attributes']=_[_0xce37('0x35')](_0x2ebecf[_0xce37('0x36')],qs[_0xce37('0x37')](_0x499e61[_0xce37('0x32')][_0xce37('0x37')]));_0x16b612[_0xce37('0x38')]=_0x16b612[_0xce37('0x38')][_0xce37('0x39')]?_0x16b612[_0xce37('0x38')]:_0x2ebecf[_0xce37('0x36')];_0x16b612[_0xce37('0x3c')]=qs['sort'](_0x499e61['query'][_0xce37('0x3d')]);_0x16b612[_0xce37('0x3e')]=qs[_0xce37('0x34')](_[_0xce37('0x3f')](_0x499e61['query'],_0x2ebecf['filters']));if(_0x499e61[_0xce37('0x32')]['filter']){_0x16b612[_0xce37('0x3e')]=_[_0xce37('0x41')](_0x16b612[_0xce37('0x3e')],{'$or':_[_0xce37('0x2d')](_0x16b612[_0xce37('0x38')],function(_0xc082d6){var _0x1edf56={};_0x1edf56[_0xc082d6]={'$like':'%'+_0x499e61[_0xce37('0x32')][_0xce37('0x40')]+'%'};return _0x1edf56;})});}_0x16b612=_[_0xce37('0x41')]({},_0x16b612,_0x499e61[_0xce37('0x43')]);return _0x15313f[_0xce37('0x4e')](_0x16b612);}})['then'](function(_0x11cc84){if(_0x11cc84){_0x594d2e=_0x11cc84[_0xce37('0x39')];if(!_0x499e61['query'][_0xce37('0x3a')](_0xce37('0x3b'))){_0x16b612[_0xce37('0x1f')]=qs[_0xce37('0x1f')](_0x499e61[_0xce37('0x32')][_0xce37('0x1f')]);_0x16b612['offset']=qs[_0xce37('0x1d')](_0x499e61[_0xce37('0x32')][_0xce37('0x1d')]);}return _0x15313f[_0xce37('0x4e')](_0x16b612);}})[_0xce37('0x24')](function(_0x4d4294){if(_0x4d4294){return _0x4d4294?{'count':_0x594d2e,'rows':_0x4d4294}:null;}})['then'](respondWithResult(_0x3f5627,null))[_0xce37('0x4c')](handleError(_0x3f5627,null));};exports['addConfiguration']=function(_0x42e068,_0x519739,_0x289b92){if(_0x42e068[_0xce37('0x4b')]['id']){delete _0x42e068[_0xce37('0x4b')]['id'];}return db['VtigerAccount'][_0xce37('0x4f')]({'where':{'id':_0x42e068[_0xce37('0x49')]['id']}})[_0xce37('0x24')](handleEntityNotFound(_0x519739,null))[_0xce37('0x24')](function(_0x1944d3){if(_0x1944d3){_0x42e068[_0xce37('0x4b')][_0xce37('0x51')]=_0x1944d3['id'];_0x42e068[_0xce37('0x4b')][_0xce37('0x52')]=integrations[_0xce37('0x53')](_0x42e068['body'][_0xce37('0x54')],_0x42e068['body'][_0xce37('0x30')]);_0x42e068[_0xce37('0x4b')][_0xce37('0x55')]=integrations[_0xce37('0x56')](_0x42e068[_0xce37('0x4b')][_0xce37('0x54')],_0x42e068[_0xce37('0x4b')]['type']);return db[_0xce37('0x50')][_0xce37('0x4a')](_0x42e068[_0xce37('0x4b')],{'include':[{'model':db[_0xce37('0x57')],'as':_0xce37('0x52')},{'model':db[_0xce37('0x57')],'as':'Descriptions'}]});}return null;})[_0xce37('0x24')](respondWithResult(_0x519739,null))['catch'](handleError(_0x519739,null));};var md5=require(_0xce37('0x58'));exports[_0xce37('0x59')]=function(_0x2a47e9,_0x30d64b,_0x1d00d8){var _0xf4bd31=null;var _0x208b65=null;var _0x10a87e=null;var _0x4b4cd0=null;var _0x7bdb2b='';return db[_0xce37('0x2e')][_0xce37('0x4f')]({'where':{'id':_0x2a47e9[_0xce37('0x49')]['id']},'attributes':['id',_0xce37('0x2a'),_0xce37('0x5a'),'description',_0xce37('0x5b'),_0xce37('0x5c'),_0xce37('0x5d'),_0xce37('0x5e')]})['then'](handleEntityNotFound(_0x30d64b,null))[_0xce37('0x24')](function(_0x4c5376){if(_0x4c5376){_0xf4bd31=_0x4c5376[_0xce37('0x5a')];_0x208b65=_0x4c5376[_0xce37('0x5e')];_0x10a87e=_0x4c5376['moduleName'];_0x7bdb2b=_0x4c5376[_0xce37('0x5c')];var _0x544ebf=_0x7bdb2b[_0xce37('0x5f')](-0x1);if(_0x544ebf==='/'){_0x7bdb2b=_0x7bdb2b[_0xce37('0x60')](0x0,_0x7bdb2b[_0xce37('0x61')](_0x544ebf));}_0x4b4cd0=util['format'](_0xce37('0x62'),_0x7bdb2b);var _0x17eb62={'method':_0xce37('0x63'),'uri':_0x4b4cd0,'qs':{'operation':_0xce37('0x64'),'username':_0x4c5376[_0xce37('0x5a')]},'json':!![]};return rp(_0x17eb62);}})[_0xce37('0x24')](function(_0xf279f5){if(_0xf279f5[_0xce37('0x65')]){var _0x165ed0={'method':_0xce37('0x66'),'uri':_0x4b4cd0,'form':{'operation':_0xce37('0x67'),'username':_0xf4bd31,'accessKey':md5(_0xf279f5[_0xce37('0x68')]['token']+_0x208b65)},'json':!![]};return rp(_0x165ed0);}})[_0xce37('0x24')](function(_0x5845e3){if(_0x5845e3['success']){var _0x475056={'method':_0xce37('0x63'),'uri':_0x4b4cd0,'qs':{'operation':'describe','username':_0xf4bd31,'sessionName':_0x5845e3[_0xce37('0x68')][_0xce37('0x69')],'elementType':_0x10a87e},'json':!![]};return rp(_0x475056);}})['then'](function(_0xe81e31){if(_0xe81e31[_0xce37('0x65')]){var _0x40987c=[_0xce37('0x6a'),_0xce37('0x6b'),_0xce37('0x6c')];_[_0xce37('0x6d')](_0xe81e31[_0xce37('0x68')][_0xce37('0x37')],function(_0x38b2ff){return _0x40987c[_0xce37('0x6e')](_0x38b2ff[_0xce37('0x30')][_0xce37('0x2a')]);});_['remove'](_0xe81e31[_0xce37('0x68')][_0xce37('0x37')],function(_0xce7c21){return _0xce7c21[_0xce37('0x6f')]==='false';});return{'count':_0xe81e31[_0xce37('0x68')]['fields'][_0xce37('0x39')],'rows':_['map'](_0xe81e31[_0xce37('0x68')]['fields'],function(_0x231475){return{'id':_0x231475['name'],'name':_0x231475[_0xce37('0x70')],'custom':_['startsWith'](_0x231475[_0xce37('0x2a')],_0xce37('0x71'))?!![]:![],'options':_0x231475[_0xce37('0x30')][_0xce37('0x2a')]===_0xce37('0x72')&&_0x231475['type'][_0xce37('0x73')][_0xce37('0x39')]>0x0?_[_0xce37('0x2d')](_0x231475[_0xce37('0x30')][_0xce37('0x73')],function(_0x1ff1b8){return{'name':_0x1ff1b8['label'],'value':_0x1ff1b8[_0xce37('0x74')]};}):[]};})};}})[_0xce37('0x24')](respondWithResult(_0x30d64b,null))[_0xce37('0x4c')](function(_0xc7363){console[_0xce37('0x75')](_0xce37('0x76')+_0xc7363);var _0x58f828=_0x2a47e9[_0xce37('0x32')][_0xce37('0x77')]?0x1f4:_0xc7363[_0xce37('0x78')]||0x1f4;logger[_0xce37('0x28')](_0xce37('0x79'),_0xce37('0x59'),_0x58f828,JSON[_0xce37('0x7a')](_0xc7363));delete _0xc7363[_0xce37('0x2a')];if(_0x58f828===0x191){_0x58f828=0x190;}_0x30d64b[_0xce37('0x1b')](_0x58f828)[_0xce37('0x2b')](_0x2a47e9[_0xce37('0x32')][_0xce37('0x77')]?{'message':_0xce37('0x7b'),'statusCode':_0xc7363[_0xce37('0x78')]}:_0xc7363);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index a70f988..0a389a7 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 _0x86e7=['define','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x86e7,0xc5));var _0x786e=function(_0x946518,_0x22816f){_0x946518=_0x946518-0x0;var _0x909b69=_0x86e7[_0x946518];return _0x909b69;};'use strict';var _=require(_0x786e('0x0'));var util=require(_0x786e('0x1'));var logger=require(_0x786e('0x2'))(_0x786e('0x3'));var moment=require(_0x786e('0x4'));var BPromise=require('bluebird');var rp=require(_0x786e('0x5'));var fs=require('fs');var path=require(_0x786e('0x6'));var rimraf=require('rimraf');var config=require(_0x786e('0x7'));var attributes=require(_0x786e('0x8'));var integrations=require(_0x786e('0x9'));module[_0x786e('0xa')]=function(_0x3ff47a,_0x38b429){return _0x3ff47a[_0x786e('0xb')]('VtigerAccount',attributes,{'tableName':_0x786e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d76=['request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','int_vtiger_accounts','lodash','util','moment','bluebird'];(function(_0x2504a3,_0x582e61){var _0x3214a1=function(_0x142537){while(--_0x142537){_0x2504a3['push'](_0x2504a3['shift']());}};_0x3214a1(++_0x582e61);}(_0x1d76,0x1c4));var _0x61d7=function(_0x24243c,_0x162c2c){_0x24243c=_0x24243c-0x0;var _0x49120a=_0x1d76[_0x24243c];return _0x49120a;};'use strict';var _=require(_0x61d7('0x0'));var util=require(_0x61d7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x61d7('0x2'));var BPromise=require(_0x61d7('0x3'));var rp=require(_0x61d7('0x4'));var fs=require('fs');var path=require(_0x61d7('0x5'));var rimraf=require(_0x61d7('0x6'));var config=require(_0x61d7('0x7'));var attributes=require(_0x61d7('0x8'));var integrations=require(_0x61d7('0x9'));module[_0x61d7('0xa')]=function(_0x2a3426,_0x4e5cc8){return _0x2a3426['define']('VtigerAccount',attributes,{'tableName':_0x61d7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 757b8be..a96683e 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 _0x1d2d=['error','code','message','result','catch','VtigerAccount','findAll','raw','where','options','attributes','limit','map','include','model','GetVtigerAccount','ShowVtigerAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x57b5d5,_0x25b4ee){var _0x24e2b5=function(_0xdf9111){while(--_0xdf9111){_0x57b5d5['push'](_0x57b5d5['shift']());}};_0x24e2b5(++_0x25b4ee);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x2f68a4,_0x1f5545){_0x2f68a4=_0x2f68a4-0x0;var _0x5a3bd0=_0x1d2d[_0x2f68a4];return _0x5a3bd0;};'use strict';var _=require(_0xd1d2('0x0'));var util=require(_0xd1d2('0x1'));var moment=require(_0xd1d2('0x2'));var BPromise=require(_0xd1d2('0x3'));var rs=require(_0xd1d2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd1d2('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd1d2('0x6'));var config=require(_0xd1d2('0x7'));var jayson=require(_0xd1d2('0x8'));var client=jayson[_0xd1d2('0x9')][_0xd1d2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x353dbd,_0x55be7a,_0x1eaf41){return new BPromise(function(_0x21bc28,_0x35735f){return client[_0xd1d2('0xb')](_0x353dbd,_0x1eaf41)[_0xd1d2('0xc')](function(_0x59e484){logger[_0xd1d2('0xd')](_0xd1d2('0xe'),_0x55be7a,_0xd1d2('0xf'));logger[_0xd1d2('0x10')](_0xd1d2('0x11'),_0x55be7a,_0xd1d2('0xf'),JSON[_0xd1d2('0x12')](_0x59e484));if(_0x59e484['error']){if(_0x59e484[_0xd1d2('0x13')][_0xd1d2('0x14')]===0x1f4){logger[_0xd1d2('0x13')](_0xd1d2('0xe'),_0x55be7a,_0x59e484[_0xd1d2('0x13')][_0xd1d2('0x15')]);return _0x35735f(_0x59e484[_0xd1d2('0x13')][_0xd1d2('0x15')]);}logger[_0xd1d2('0x13')](_0xd1d2('0xe'),_0x55be7a,_0x59e484['error'][_0xd1d2('0x15')]);return _0x21bc28(_0x59e484[_0xd1d2('0x13')][_0xd1d2('0x15')]);}else{logger['info'](_0xd1d2('0xe'),_0x55be7a,_0xd1d2('0xf'));_0x21bc28(_0x59e484[_0xd1d2('0x16')][_0xd1d2('0x15')]);}})[_0xd1d2('0x17')](function(_0x2723b3){logger[_0xd1d2('0x13')]('VtigerAccount,\x20%s,\x20%s',_0x55be7a,_0x2723b3);_0x35735f(_0x2723b3);});});}exports['GetVtigerAccount']=function(_0x3be186){var _0x55320b=this;return new Promise(function(_0x247b3a,_0x42565b){return db[_0xd1d2('0x18')][_0xd1d2('0x19')]({'raw':_0x3be186['options']?_0x3be186['options'][_0xd1d2('0x1a')]===undefined?!![]:![]:!![],'where':_0x3be186['options']?_0x3be186['options'][_0xd1d2('0x1b')]||null:null,'attributes':_0x3be186[_0xd1d2('0x1c')]?_0x3be186[_0xd1d2('0x1c')][_0xd1d2('0x1d')]||null:null,'limit':_0x3be186['options']?_0x3be186[_0xd1d2('0x1c')][_0xd1d2('0x1e')]||null:null,'include':_0x3be186[_0xd1d2('0x1c')]?_0x3be186['options']['include']?_[_0xd1d2('0x1f')](_0x3be186[_0xd1d2('0x1c')][_0xd1d2('0x20')],function(_0x2f92ee){return{'model':db[_0x2f92ee[_0xd1d2('0x21')]],'as':_0x2f92ee['as'],'attributes':_0x2f92ee[_0xd1d2('0x1d')],'include':_0x2f92ee[_0xd1d2('0x20')]?_['map'](_0x2f92ee[_0xd1d2('0x20')],function(_0x42da6d){return{'model':db[_0x42da6d[_0xd1d2('0x21')]],'as':_0x42da6d['as'],'attributes':_0x42da6d[_0xd1d2('0x1d')],'include':_0x42da6d[_0xd1d2('0x20')]?_[_0xd1d2('0x1f')](_0x42da6d[_0xd1d2('0x20')],function(_0x34faf7){return{'model':db[_0x34faf7[_0xd1d2('0x21')]],'as':_0x34faf7['as'],'attributes':_0x34faf7[_0xd1d2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd1d2('0xc')](function(_0x4e1bc2){logger['info'](_0xd1d2('0x22'),_0x3be186);logger[_0xd1d2('0x10')](_0xd1d2('0x22'),_0x3be186,JSON[_0xd1d2('0x12')](_0x4e1bc2));_0x247b3a(_0x4e1bc2);})[_0xd1d2('0x17')](function(_0x48ade1){logger[_0xd1d2('0x13')](_0xd1d2('0x22'),_0x48ade1[_0xd1d2('0x15')],_0x3be186);_0x42565b(_0x55320b['error'](0x1f4,_0x48ade1[_0xd1d2('0x15')]));});});};exports[_0xd1d2('0x23')]=function(_0xbd855a){var _0x56557d=this;return new Promise(function(_0x419db7,_0x18528f){return db[_0xd1d2('0x18')][_0xd1d2('0x24')]({'raw':_0xbd855a[_0xd1d2('0x1c')]?_0xbd855a[_0xd1d2('0x1c')][_0xd1d2('0x1a')]===undefined?!![]:![]:!![],'where':_0xbd855a[_0xd1d2('0x1c')]?_0xbd855a[_0xd1d2('0x1c')][_0xd1d2('0x1b')]||null:null,'attributes':_0xbd855a[_0xd1d2('0x1c')]?_0xbd855a[_0xd1d2('0x1c')][_0xd1d2('0x1d')]||null:null,'include':_0xbd855a[_0xd1d2('0x1c')]?_0xbd855a[_0xd1d2('0x1c')][_0xd1d2('0x20')]?_[_0xd1d2('0x1f')](_0xbd855a[_0xd1d2('0x1c')]['include'],function(_0x1541ff){return{'model':db[_0x1541ff[_0xd1d2('0x21')]],'as':_0x1541ff['as'],'attributes':_0x1541ff[_0xd1d2('0x1d')],'include':_0x1541ff['include']?_[_0xd1d2('0x1f')](_0x1541ff['include'],function(_0x57a7fb){return{'model':db[_0x57a7fb[_0xd1d2('0x21')]],'as':_0x57a7fb['as'],'attributes':_0x57a7fb[_0xd1d2('0x1d')],'include':_0x57a7fb[_0xd1d2('0x20')]?_[_0xd1d2('0x1f')](_0x57a7fb[_0xd1d2('0x20')],function(_0x2d2d12){return{'model':db[_0x2d2d12['model']],'as':_0x2d2d12['as'],'attributes':_0x2d2d12[_0xd1d2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd1d2('0xc')](function(_0x5bdf40){logger[_0xd1d2('0xd')](_0xd1d2('0x23'),_0xbd855a);logger[_0xd1d2('0x10')](_0xd1d2('0x23'),_0xbd855a,JSON['stringify'](_0x5bdf40));_0x419db7(_0x5bdf40);})['catch'](function(_0x2fd2c5){logger['error']('ShowVtigerAccount',_0x2fd2c5['message'],_0xbd855a);_0x18528f(_0x56557d[_0xd1d2('0x13')](0x1f4,_0x2fd2c5['message']));});});}; \ No newline at end of file +var _0xa478=['info','request\x20sent','debug','error','code','message','VtigerAccount,\x20%s,\x20%s','result','catch','GetVtigerAccount','findAll','options','raw','where','attributes','include','map','model','VtigerAccount','find','ShowVtigerAccount','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x335c74,_0x550e56){var _0x1a45cc=function(_0x59e4a2){while(--_0x59e4a2){_0x335c74['push'](_0x335c74['shift']());}};_0x1a45cc(++_0x550e56);}(_0xa478,0x136));var _0x8a47=function(_0x1af8d3,_0x544d86){_0x1af8d3=_0x1af8d3-0x0;var _0x3a50c5=_0xa478[_0x1af8d3];return _0x3a50c5;};'use strict';var _=require(_0x8a47('0x0'));var util=require(_0x8a47('0x1'));var moment=require(_0x8a47('0x2'));var BPromise=require(_0x8a47('0x3'));var rs=require(_0x8a47('0x4'));var fs=require('fs');var Redis=require(_0x8a47('0x5'));var db=require(_0x8a47('0x6'))['db'];var utils=require(_0x8a47('0x7'));var logger=require(_0x8a47('0x8'))(_0x8a47('0x9'));var config=require(_0x8a47('0xa'));var jayson=require(_0x8a47('0xb'));var client=jayson['client'][_0x8a47('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d62a6,_0x3de815,_0x3cb340){return new BPromise(function(_0x56884b,_0x384886){return client['request'](_0x2d62a6,_0x3cb340)[_0x8a47('0xd')](function(_0x369fc9){logger[_0x8a47('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x3de815,_0x8a47('0xf'));logger[_0x8a47('0x10')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x3de815,_0x8a47('0xf'),JSON['stringify'](_0x369fc9));if(_0x369fc9[_0x8a47('0x11')]){if(_0x369fc9[_0x8a47('0x11')][_0x8a47('0x12')]===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x3de815,_0x369fc9['error'][_0x8a47('0x13')]);return _0x384886(_0x369fc9[_0x8a47('0x11')]['message']);}logger[_0x8a47('0x11')](_0x8a47('0x14'),_0x3de815,_0x369fc9[_0x8a47('0x11')][_0x8a47('0x13')]);return _0x56884b(_0x369fc9[_0x8a47('0x11')][_0x8a47('0x13')]);}else{logger[_0x8a47('0xe')](_0x8a47('0x14'),_0x3de815,_0x8a47('0xf'));_0x56884b(_0x369fc9[_0x8a47('0x15')][_0x8a47('0x13')]);}})[_0x8a47('0x16')](function(_0x2917d9){logger['error'](_0x8a47('0x14'),_0x3de815,_0x2917d9);_0x384886(_0x2917d9);});});}exports[_0x8a47('0x17')]=function(_0x3f9093){var _0x5f5884=this;return new Promise(function(_0x341089,_0x5c62eb){return db['VtigerAccount'][_0x8a47('0x18')]({'raw':_0x3f9093[_0x8a47('0x19')]?_0x3f9093[_0x8a47('0x19')][_0x8a47('0x1a')]===undefined?!![]:![]:!![],'where':_0x3f9093[_0x8a47('0x19')]?_0x3f9093[_0x8a47('0x19')][_0x8a47('0x1b')]||null:null,'attributes':_0x3f9093[_0x8a47('0x19')]?_0x3f9093[_0x8a47('0x19')][_0x8a47('0x1c')]||null:null,'limit':_0x3f9093['options']?_0x3f9093[_0x8a47('0x19')]['limit']||null:null,'include':_0x3f9093[_0x8a47('0x19')]?_0x3f9093[_0x8a47('0x19')][_0x8a47('0x1d')]?_[_0x8a47('0x1e')](_0x3f9093['options'][_0x8a47('0x1d')],function(_0x5ae186){return{'model':db[_0x5ae186['model']],'as':_0x5ae186['as'],'attributes':_0x5ae186['attributes'],'include':_0x5ae186['include']?_[_0x8a47('0x1e')](_0x5ae186[_0x8a47('0x1d')],function(_0x5bed3e){return{'model':db[_0x5bed3e[_0x8a47('0x1f')]],'as':_0x5bed3e['as'],'attributes':_0x5bed3e[_0x8a47('0x1c')],'include':_0x5bed3e[_0x8a47('0x1d')]?_[_0x8a47('0x1e')](_0x5bed3e[_0x8a47('0x1d')],function(_0xd06be6){return{'model':db[_0xd06be6[_0x8a47('0x1f')]],'as':_0xd06be6['as'],'attributes':_0xd06be6['attributes']};}):[]};}):[]};}):[]:[]})[_0x8a47('0xd')](function(_0x4a10c3){logger[_0x8a47('0xe')](_0x8a47('0x17'),_0x3f9093);logger['debug'](_0x8a47('0x17'),_0x3f9093,JSON['stringify'](_0x4a10c3));_0x341089(_0x4a10c3);})['catch'](function(_0x12470a){logger[_0x8a47('0x11')](_0x8a47('0x17'),_0x12470a[_0x8a47('0x13')],_0x3f9093);_0x5c62eb(_0x5f5884[_0x8a47('0x11')](0x1f4,_0x12470a[_0x8a47('0x13')]));});});};exports['ShowVtigerAccount']=function(_0x353576){var _0x4d78b5=this;return new Promise(function(_0x549913,_0x448459){return db[_0x8a47('0x20')][_0x8a47('0x21')]({'raw':_0x353576[_0x8a47('0x19')]?_0x353576[_0x8a47('0x19')][_0x8a47('0x1a')]===undefined?!![]:![]:!![],'where':_0x353576[_0x8a47('0x19')]?_0x353576[_0x8a47('0x19')][_0x8a47('0x1b')]||null:null,'attributes':_0x353576[_0x8a47('0x19')]?_0x353576['options'][_0x8a47('0x1c')]||null:null,'include':_0x353576[_0x8a47('0x19')]?_0x353576[_0x8a47('0x19')]['include']?_[_0x8a47('0x1e')](_0x353576[_0x8a47('0x19')]['include'],function(_0xa1a852){return{'model':db[_0xa1a852[_0x8a47('0x1f')]],'as':_0xa1a852['as'],'attributes':_0xa1a852[_0x8a47('0x1c')],'include':_0xa1a852[_0x8a47('0x1d')]?_['map'](_0xa1a852['include'],function(_0x145908){return{'model':db[_0x145908[_0x8a47('0x1f')]],'as':_0x145908['as'],'attributes':_0x145908[_0x8a47('0x1c')],'include':_0x145908[_0x8a47('0x1d')]?_[_0x8a47('0x1e')](_0x145908[_0x8a47('0x1d')],function(_0x1819ef){return{'model':db[_0x1819ef['model']],'as':_0x1819ef['as'],'attributes':_0x1819ef['attributes']};}):[]};}):[]};}):[]:[]})[_0x8a47('0xd')](function(_0x3636af){logger[_0x8a47('0xe')](_0x8a47('0x22'),_0x353576);logger[_0x8a47('0x10')](_0x8a47('0x22'),_0x353576,JSON[_0x8a47('0x23')](_0x3636af));_0x549913(_0x3636af);})[_0x8a47('0x16')](function(_0xe178f1){logger[_0x8a47('0x11')](_0x8a47('0x22'),_0xe178f1['message'],_0x353576);_0x448459(_0x4d78b5[_0x8a47('0x11')](0x1f4,_0xe178f1['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 08469da..bc29d6d 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 _0xee26=['isAuthenticated','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','post','put','/:id','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get'];(function(_0x46a61e,_0x1f3890){var _0x4b9881=function(_0x14aba3){while(--_0x14aba3){_0x46a61e['push'](_0x46a61e['shift']());}};_0x4b9881(++_0x1f3890);}(_0xee26,0x15b));var _0x6ee2=function(_0x108328,_0x2558b5){_0x108328=_0x108328-0x0;var _0x185f02=_0xee26[_0x108328];return _0x185f02;};'use strict';var multer=require('multer');var util=require(_0x6ee2('0x0'));var path=require(_0x6ee2('0x1'));var timeout=require(_0x6ee2('0x2'));var express=require(_0x6ee2('0x3'));var router=express[_0x6ee2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6ee2('0x5'));var interaction=require(_0x6ee2('0x6'));var config=require(_0x6ee2('0x7'));var controller=require(_0x6ee2('0x8'));router[_0x6ee2('0x9')]('/',auth[_0x6ee2('0xa')](),controller['index']);router[_0x6ee2('0x9')]('/:id',auth[_0x6ee2('0xa')](),controller[_0x6ee2('0xb')]);router[_0x6ee2('0x9')](_0x6ee2('0xc'),auth[_0x6ee2('0xa')](),controller['getFields']);router[_0x6ee2('0x9')]('/:id/subjects',auth[_0x6ee2('0xa')](),controller[_0x6ee2('0xd')]);router['get'](_0x6ee2('0xe'),auth['isAuthenticated'](),controller[_0x6ee2('0xf')]);router[_0x6ee2('0x10')]('/',auth[_0x6ee2('0xa')](),controller['create']);router[_0x6ee2('0x11')](_0x6ee2('0x12'),auth[_0x6ee2('0xa')](),controller['update']);router[_0x6ee2('0x13')]('/:id',auth[_0x6ee2('0xa')](),controller['destroy']);module[_0x6ee2('0x14')]=router; \ No newline at end of file +var _0x1a13=['isAuthenticated','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','delete','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','index','/:id'];(function(_0xf9eda,_0x2cb072){var _0x1f5c7=function(_0x5cd03f){while(--_0x5cd03f){_0xf9eda['push'](_0xf9eda['shift']());}};_0x1f5c7(++_0x2cb072);}(_0x1a13,0x15a));var _0x31a1=function(_0x3fda57,_0x4f97f4){_0x3fda57=_0x3fda57-0x0;var _0x442f59=_0x1a13[_0x3fda57];return _0x442f59;};'use strict';var multer=require(_0x31a1('0x0'));var util=require(_0x31a1('0x1'));var path=require(_0x31a1('0x2'));var timeout=require('connect-timeout');var express=require(_0x31a1('0x3'));var router=express['Router']();var fs_extra=require(_0x31a1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x31a1('0x5'));var config=require(_0x31a1('0x6'));var controller=require(_0x31a1('0x7'));router[_0x31a1('0x8')]('/',auth['isAuthenticated'](),controller[_0x31a1('0x9')]);router['get'](_0x31a1('0xa'),auth[_0x31a1('0xb')](),controller[_0x31a1('0xc')]);router[_0x31a1('0x8')]('/:id/fields',auth[_0x31a1('0xb')](),controller['getFields']);router['get'](_0x31a1('0xd'),auth[_0x31a1('0xb')](),controller[_0x31a1('0xe')]);router[_0x31a1('0x8')](_0x31a1('0xf'),auth[_0x31a1('0xb')](),controller[_0x31a1('0x10')]);router[_0x31a1('0x11')]('/',auth[_0x31a1('0xb')](),controller['create']);router[_0x31a1('0x12')](_0x31a1('0xa'),auth[_0x31a1('0xb')](),controller['update']);router[_0x31a1('0x13')]('/:id',auth[_0x31a1('0xb')](),controller['destroy']);module[_0x31a1('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 4472227..1bb7a31 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 _0xaeaf=['STRING','exports'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xaeaf,0x7b));var _0xfaea=function(_0x3a8b7c,_0x3e5db2){_0x3a8b7c=_0x3a8b7c-0x0;var _0x40eb80=_0xaeaf[_0x3a8b7c];return _0x40eb80;};'use strict';var Sequelize=require('sequelize');module[_0xfaea('0x0')]={'name':{'type':Sequelize[_0xfaea('0x1')]},'description':{'type':Sequelize[_0xfaea('0x1')]}}; \ No newline at end of file +var _0xf674=['sequelize'];(function(_0x1c6089,_0x3816e2){var _0x4d97c1=function(_0x3e631b){while(--_0x3e631b){_0x1c6089['push'](_0x1c6089['shift']());}};_0x4d97c1(++_0x3816e2);}(_0xf674,0x109));var _0x4f67=function(_0x5c59e9,_0x253541){_0x5c59e9=_0x5c59e9-0x0;var _0x56b0b3=_0xf674[_0x5c59e9];return _0x56b0b3;};'use strict';var Sequelize=require(_0x4f67('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'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 4079195..6057b83 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 _0x7b78=['lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','save','then','destroy','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7b78,0x185));var _0x87b7=function(_0x2a165e,_0x2aa70f){_0x2a165e=_0x2a165e-0x0;var _0x91d9d=_0x7b78[_0x2a165e];return _0x91d9d;};'use strict';var emlformat=require(_0x87b7('0x0'));var rimraf=require(_0x87b7('0x1'));var zipdir=require(_0x87b7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x87b7('0x3'));var moment=require('moment');var BPromise=require(_0x87b7('0x4'));var Mustache=require('mustache');var util=require(_0x87b7('0x5'));var path=require(_0x87b7('0x6'));var sox=require(_0x87b7('0x7'));var csv=require(_0x87b7('0x8'));var ejs=require(_0x87b7('0x9'));var fs=require('fs');var fs_extra=require(_0x87b7('0xa'));var _=require(_0x87b7('0xb'));var squel=require('squel');var crypto=require(_0x87b7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x87b7('0xd'));var toCsv=require('to-csv');var querystring=require(_0x87b7('0xe'));var Papa=require(_0x87b7('0xf'));var Redis=require(_0x87b7('0x10'));var authService=require(_0x87b7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x87b7('0x12'));var hardwareService=require(_0x87b7('0x13'));var logger=require(_0x87b7('0x14'))(_0x87b7('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x87b7('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52d71b,_0x224c4e){_0x224c4e=_0x224c4e||0xcc;return function(_0x20e174){if(_0x20e174){return _0x52d71b[_0x87b7('0x17')](_0x224c4e);}return _0x52d71b[_0x87b7('0x18')](_0x224c4e)[_0x87b7('0x19')]();};}function respondWithResult(_0x35a49f,_0x1ca92b){_0x1ca92b=_0x1ca92b||0xc8;return function(_0x4cd9a0){if(_0x4cd9a0){return _0x35a49f['status'](_0x1ca92b)[_0x87b7('0x1a')](_0x4cd9a0);}};}function respondWithFilteredResult(_0x145d67,_0x2ffb19){return function(_0x51d7ec){if(_0x51d7ec){var _0x25a337=typeof _0x2ffb19['offset']==='undefined'&&typeof _0x2ffb19[_0x87b7('0x1b')]===_0x87b7('0x1c');var _0x4f1740=_0x51d7ec[_0x87b7('0x1d')];var _0x346d6d=_0x25a337?0x0:_0x2ffb19['offset'];var _0x16e41b=_0x25a337?_0x51d7ec['count']:_0x2ffb19[_0x87b7('0x1e')]+_0x2ffb19[_0x87b7('0x1b')];var _0xb73820;if(_0x16e41b>=_0x4f1740){_0x16e41b=_0x4f1740;_0xb73820=0xc8;}else{_0xb73820=0xce;}_0x145d67[_0x87b7('0x18')](_0xb73820);return _0x145d67[_0x87b7('0x1f')]('Content-Range',_0x346d6d+'-'+_0x16e41b+'/'+_0x4f1740)['json'](_0x51d7ec);}return null;};}function patchUpdates(_0x305c14){return function(_0x5a5076){try{jsonpatch[_0x87b7('0x20')](_0x5a5076,_0x305c14,!![]);}catch(_0x4dd773){return BPromise['reject'](_0x4dd773);}return _0x5a5076[_0x87b7('0x21')]();};}function saveUpdates(_0x1d7297,_0x2f8087){return function(_0x3328c1){if(_0x3328c1){return _0x3328c1['update'](_0x1d7297)[_0x87b7('0x22')](function(_0xf005dd){return _0xf005dd;});}return null;};}function removeEntity(_0x219939,_0x47c4ad){return function(_0xce3693){if(_0xce3693){return _0xce3693[_0x87b7('0x23')]()[_0x87b7('0x22')](function(){_0x219939[_0x87b7('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x253650,_0x291cfc){return function(_0xf1f5ad){if(!_0xf1f5ad){_0x253650[_0x87b7('0x17')](0x194);}return _0xf1f5ad;};}function handleError(_0x22e3d0,_0x15cc36){_0x15cc36=_0x15cc36||0x1f4;return function(_0x2fd2e5){logger[_0x87b7('0x24')](_0x2fd2e5[_0x87b7('0x25')]);if(_0x2fd2e5['name']){delete _0x2fd2e5[_0x87b7('0x26')];}_0x22e3d0['status'](_0x15cc36)[_0x87b7('0x27')](_0x2fd2e5);};}exports[_0x87b7('0x28')]=function(_0x522539,_0x3c7dcb){var _0x581893={},_0x2488c9={},_0x5c1377={'count':0x0,'rows':[]};var _0x38aca3=_[_0x87b7('0x29')](db[_0x87b7('0x2a')][_0x87b7('0x2b')],function(_0xe30e70){return{'name':_0xe30e70['fieldName'],'type':_0xe30e70['type'][_0x87b7('0x2c')]};});_0x2488c9['model']=_[_0x87b7('0x29')](_0x38aca3,_0x87b7('0x26'));_0x2488c9[_0x87b7('0x2d')]=_[_0x87b7('0x2e')](_0x522539[_0x87b7('0x2d')]);_0x2488c9[_0x87b7('0x2f')]=_[_0x87b7('0x30')](_0x2488c9['model'],_0x2488c9[_0x87b7('0x2d')]);_0x581893[_0x87b7('0x31')]=_[_0x87b7('0x30')](_0x2488c9[_0x87b7('0x32')],qs[_0x87b7('0x33')](_0x522539[_0x87b7('0x2d')][_0x87b7('0x33')]));_0x581893[_0x87b7('0x31')]=_0x581893[_0x87b7('0x31')][_0x87b7('0x34')]?_0x581893['attributes']:_0x2488c9[_0x87b7('0x32')];if(!_0x522539[_0x87b7('0x2d')][_0x87b7('0x35')](_0x87b7('0x36'))){_0x581893[_0x87b7('0x1b')]=qs[_0x87b7('0x1b')](_0x522539[_0x87b7('0x2d')]['limit']);_0x581893['offset']=qs[_0x87b7('0x1e')](_0x522539['query']['offset']);}_0x581893[_0x87b7('0x37')]=qs[_0x87b7('0x38')](_0x522539[_0x87b7('0x2d')]['sort']);_0x581893[_0x87b7('0x39')]=qs[_0x87b7('0x2f')](_[_0x87b7('0x3a')](_0x522539[_0x87b7('0x2d')],_0x2488c9[_0x87b7('0x2f')]),_0x38aca3);if(_0x522539[_0x87b7('0x2d')][_0x87b7('0x3b')]){_0x581893[_0x87b7('0x39')]=_[_0x87b7('0x3c')](_0x581893[_0x87b7('0x39')],{'$or':_[_0x87b7('0x29')](_0x38aca3,function(_0x2fac2f){if(_0x2fac2f[_0x87b7('0x3d')]!==_0x87b7('0x3e')){var _0x4e1a7d={};_0x4e1a7d[_0x2fac2f[_0x87b7('0x26')]]={'$like':'%'+_0x522539[_0x87b7('0x2d')][_0x87b7('0x3b')]+'%'};return _0x4e1a7d;}})});}_0x581893=_['merge']({},_0x581893,_0x522539[_0x87b7('0x3f')]);var _0x2cd985={'where':_0x581893[_0x87b7('0x39')]};return db['VtigerConfiguration'][_0x87b7('0x1d')](_0x2cd985)[_0x87b7('0x22')](function(_0xe5ec7c){_0x5c1377[_0x87b7('0x1d')]=_0xe5ec7c;if(_0x522539[_0x87b7('0x2d')][_0x87b7('0x40')]){_0x581893[_0x87b7('0x41')]=[{'all':!![]}];}return db[_0x87b7('0x2a')][_0x87b7('0x42')](_0x581893);})[_0x87b7('0x22')](function(_0x58f1df){_0x5c1377[_0x87b7('0x43')]=_0x58f1df;return _0x5c1377;})[_0x87b7('0x22')](respondWithFilteredResult(_0x3c7dcb,_0x581893))[_0x87b7('0x44')](handleError(_0x3c7dcb,null));};exports[_0x87b7('0x45')]=function(_0x8bc651,_0x2bdd96){var _0x2b266c={'raw':![],'where':{'id':_0x8bc651[_0x87b7('0x46')]['id']}},_0x11be76={};_0x11be76['model']=_['keys'](db[_0x87b7('0x2a')][_0x87b7('0x2b')]);_0x11be76[_0x87b7('0x2d')]=_[_0x87b7('0x2e')](_0x8bc651[_0x87b7('0x2d')]);_0x11be76[_0x87b7('0x2f')]=_[_0x87b7('0x30')](_0x11be76[_0x87b7('0x32')],_0x11be76[_0x87b7('0x2d')]);_0x2b266c[_0x87b7('0x31')]=_[_0x87b7('0x30')](_0x11be76[_0x87b7('0x32')],qs[_0x87b7('0x33')](_0x8bc651['query'][_0x87b7('0x33')]));_0x2b266c['attributes']=_0x2b266c[_0x87b7('0x31')][_0x87b7('0x34')]?_0x2b266c['attributes']:_0x11be76['model'];if(_0x8bc651['query'][_0x87b7('0x40')]){_0x2b266c[_0x87b7('0x41')]=[{'all':!![]}];}_0x2b266c=_[_0x87b7('0x3c')]({},_0x2b266c,_0x8bc651[_0x87b7('0x3f')]);return db[_0x87b7('0x2a')][_0x87b7('0x47')](_0x2b266c)[_0x87b7('0x22')](handleEntityNotFound(_0x2bdd96,null))['then'](respondWithResult(_0x2bdd96,null))[_0x87b7('0x44')](handleError(_0x2bdd96,null));};exports[_0x87b7('0x48')]=function(_0x559676,_0x497caf){return db[_0x87b7('0x2a')][_0x87b7('0x48')](_0x559676[_0x87b7('0x49')],{})[_0x87b7('0x22')](respondWithResult(_0x497caf,0xc9))[_0x87b7('0x44')](handleError(_0x497caf,null));};exports[_0x87b7('0x4a')]=function(_0x24a8be,_0x5eea06){if(_0x24a8be[_0x87b7('0x49')]['id']){delete _0x24a8be[_0x87b7('0x49')]['id'];}return db[_0x87b7('0x2a')]['find']({'where':{'id':_0x24a8be['params']['id']}})['then'](handleEntityNotFound(_0x5eea06,null))[_0x87b7('0x22')](saveUpdates(_0x24a8be[_0x87b7('0x49')],null))[_0x87b7('0x22')](respondWithResult(_0x5eea06,null))[_0x87b7('0x44')](handleError(_0x5eea06,null));};exports[_0x87b7('0x23')]=function(_0x2da645,_0x892c36){return db['VtigerConfiguration'][_0x87b7('0x47')]({'where':{'id':_0x2da645[_0x87b7('0x46')]['id']}})[_0x87b7('0x22')](handleEntityNotFound(_0x892c36,null))[_0x87b7('0x22')](removeEntity(_0x892c36,null))['catch'](handleError(_0x892c36,null));};exports[_0x87b7('0x4b')]=function(_0x5ba164,_0x34240b,_0x488fc9){var _0x1a9703={};var _0x12f3bd={};var _0x158aab;var _0x3f2271;return db[_0x87b7('0x2a')][_0x87b7('0x4c')]({'where':{'id':_0x5ba164[_0x87b7('0x46')]['id']}})['then'](handleEntityNotFound(_0x34240b,null))[_0x87b7('0x22')](function(_0x2d0165){if(_0x2d0165){_0x158aab=_0x2d0165;_0x12f3bd[_0x87b7('0x32')]=_[_0x87b7('0x2e')](db[_0x87b7('0x4d')][_0x87b7('0x2b')]);_0x12f3bd['query']=_['keys'](_0x5ba164[_0x87b7('0x2d')]);_0x12f3bd[_0x87b7('0x2f')]=_['intersection'](_0x12f3bd[_0x87b7('0x32')],_0x12f3bd['query']);_0x1a9703[_0x87b7('0x31')]=_['intersection'](_0x12f3bd['model'],qs['fields'](_0x5ba164[_0x87b7('0x2d')][_0x87b7('0x33')]));_0x1a9703['attributes']=_0x1a9703[_0x87b7('0x31')][_0x87b7('0x34')]?_0x1a9703[_0x87b7('0x31')]:_0x12f3bd[_0x87b7('0x32')];_0x1a9703[_0x87b7('0x37')]=qs['sort'](_0x5ba164[_0x87b7('0x2d')]['sort']);_0x1a9703['where']=qs[_0x87b7('0x2f')](_[_0x87b7('0x3a')](_0x5ba164[_0x87b7('0x2d')],_0x12f3bd['filters']));if(_0x5ba164[_0x87b7('0x2d')]['filter']){_0x1a9703[_0x87b7('0x39')]=_[_0x87b7('0x3c')](_0x1a9703[_0x87b7('0x39')],{'$or':_[_0x87b7('0x29')](_0x1a9703['attributes'],function(_0x45d557){var _0xd308a4={};_0xd308a4[_0x45d557]={'$like':'%'+_0x5ba164[_0x87b7('0x2d')][_0x87b7('0x3b')]+'%'};return _0xd308a4;})});}_0x1a9703=_[_0x87b7('0x3c')]({},_0x1a9703,_0x5ba164[_0x87b7('0x3f')]);return _0x158aab[_0x87b7('0x4b')](_0x1a9703);}})['then'](function(_0x533bec){if(_0x533bec){_0x3f2271=_0x533bec[_0x87b7('0x34')];if(!_0x5ba164[_0x87b7('0x2d')][_0x87b7('0x35')](_0x87b7('0x36'))){_0x1a9703['limit']=qs[_0x87b7('0x1b')](_0x5ba164[_0x87b7('0x2d')][_0x87b7('0x1b')]);_0x1a9703[_0x87b7('0x1e')]=qs[_0x87b7('0x1e')](_0x5ba164[_0x87b7('0x2d')][_0x87b7('0x1e')]);}return _0x158aab[_0x87b7('0x4b')](_0x1a9703);}})[_0x87b7('0x22')](function(_0x41115c){if(_0x41115c){return _0x41115c?{'count':_0x3f2271,'rows':_0x41115c}:null;}})[_0x87b7('0x22')](respondWithResult(_0x34240b,null))['catch'](handleError(_0x34240b,null));};exports[_0x87b7('0x4e')]=function(_0x110d18,_0x274e78,_0x562099){var _0x1b7dcd={};var _0x56ad35={};var _0x1d9a5;var _0x2efb6c;return db[_0x87b7('0x2a')][_0x87b7('0x4c')]({'where':{'id':_0x110d18['params']['id']}})[_0x87b7('0x22')](handleEntityNotFound(_0x274e78,null))['then'](function(_0x123057){if(_0x123057){_0x1d9a5=_0x123057;_0x56ad35[_0x87b7('0x32')]=_[_0x87b7('0x2e')](db[_0x87b7('0x4d')][_0x87b7('0x2b')]);_0x56ad35[_0x87b7('0x2d')]=_[_0x87b7('0x2e')](_0x110d18[_0x87b7('0x2d')]);_0x56ad35[_0x87b7('0x2f')]=_['intersection'](_0x56ad35[_0x87b7('0x32')],_0x56ad35['query']);_0x1b7dcd['attributes']=_[_0x87b7('0x30')](_0x56ad35['model'],qs[_0x87b7('0x33')](_0x110d18[_0x87b7('0x2d')][_0x87b7('0x33')]));_0x1b7dcd[_0x87b7('0x31')]=_0x1b7dcd['attributes'][_0x87b7('0x34')]?_0x1b7dcd['attributes']:_0x56ad35[_0x87b7('0x32')];_0x1b7dcd['order']=qs[_0x87b7('0x38')](_0x110d18[_0x87b7('0x2d')][_0x87b7('0x38')]);_0x1b7dcd[_0x87b7('0x39')]=qs[_0x87b7('0x2f')](_[_0x87b7('0x3a')](_0x110d18[_0x87b7('0x2d')],_0x56ad35[_0x87b7('0x2f')]));if(_0x110d18['query']['filter']){_0x1b7dcd[_0x87b7('0x39')]=_[_0x87b7('0x3c')](_0x1b7dcd[_0x87b7('0x39')],{'$or':_[_0x87b7('0x29')](_0x1b7dcd[_0x87b7('0x31')],function(_0x481dbe){var _0x350c89={};_0x350c89[_0x481dbe]={'$like':'%'+_0x110d18['query'][_0x87b7('0x3b')]+'%'};return _0x350c89;})});}_0x1b7dcd=_[_0x87b7('0x3c')]({},_0x1b7dcd,_0x110d18[_0x87b7('0x3f')]);return _0x1d9a5[_0x87b7('0x4e')](_0x1b7dcd);}})[_0x87b7('0x22')](function(_0x393b65){if(_0x393b65){_0x2efb6c=_0x393b65[_0x87b7('0x34')];if(!_0x110d18[_0x87b7('0x2d')]['hasOwnProperty'](_0x87b7('0x36'))){_0x1b7dcd[_0x87b7('0x1b')]=qs[_0x87b7('0x1b')](_0x110d18[_0x87b7('0x2d')]['limit']);_0x1b7dcd['offset']=qs['offset'](_0x110d18[_0x87b7('0x2d')]['offset']);}return _0x1d9a5[_0x87b7('0x4e')](_0x1b7dcd);}})[_0x87b7('0x22')](function(_0x329db3){if(_0x329db3){return _0x329db3?{'count':_0x2efb6c,'rows':_0x329db3}:null;}})['then'](respondWithResult(_0x274e78,null))[_0x87b7('0x44')](handleError(_0x274e78,null));};exports[_0x87b7('0x4f')]=function(_0x5b0a31,_0x381b29,_0x2ddf0a){var _0x10be8a={};var _0x31f2f5={};var _0x44ab64;var _0x3c237b;return db[_0x87b7('0x2a')][_0x87b7('0x4c')]({'where':{'id':_0x5b0a31[_0x87b7('0x46')]['id']}})[_0x87b7('0x22')](handleEntityNotFound(_0x381b29,null))['then'](function(_0x2b4e17){if(_0x2b4e17){_0x44ab64=_0x2b4e17;_0x31f2f5[_0x87b7('0x32')]=_[_0x87b7('0x2e')](db['VtigerField'][_0x87b7('0x2b')]);_0x31f2f5['query']=_[_0x87b7('0x2e')](_0x5b0a31['query']);_0x31f2f5[_0x87b7('0x2f')]=_[_0x87b7('0x30')](_0x31f2f5['model'],_0x31f2f5[_0x87b7('0x2d')]);_0x10be8a[_0x87b7('0x31')]=_[_0x87b7('0x30')](_0x31f2f5[_0x87b7('0x32')],qs['fields'](_0x5b0a31['query'][_0x87b7('0x33')]));_0x10be8a['attributes']=_0x10be8a[_0x87b7('0x31')][_0x87b7('0x34')]?_0x10be8a[_0x87b7('0x31')]:_0x31f2f5[_0x87b7('0x32')];_0x10be8a['order']=qs[_0x87b7('0x38')](_0x5b0a31[_0x87b7('0x2d')][_0x87b7('0x38')]);_0x10be8a[_0x87b7('0x39')]=qs[_0x87b7('0x2f')](_['pick'](_0x5b0a31[_0x87b7('0x2d')],_0x31f2f5[_0x87b7('0x2f')]));if(_0x5b0a31[_0x87b7('0x2d')]['filter']){_0x10be8a[_0x87b7('0x39')]=_[_0x87b7('0x3c')](_0x10be8a[_0x87b7('0x39')],{'$or':_['map'](_0x10be8a[_0x87b7('0x31')],function(_0x28189d){var _0x4a35ab={};_0x4a35ab[_0x28189d]={'$like':'%'+_0x5b0a31[_0x87b7('0x2d')][_0x87b7('0x3b')]+'%'};return _0x4a35ab;})});}_0x10be8a=_[_0x87b7('0x3c')]({},_0x10be8a,_0x5b0a31['options']);return _0x44ab64[_0x87b7('0x4f')](_0x10be8a);}})[_0x87b7('0x22')](function(_0x2c051a){if(_0x2c051a){_0x3c237b=_0x2c051a[_0x87b7('0x34')];if(!_0x5b0a31[_0x87b7('0x2d')]['hasOwnProperty'](_0x87b7('0x36'))){_0x10be8a[_0x87b7('0x1b')]=qs[_0x87b7('0x1b')](_0x5b0a31[_0x87b7('0x2d')][_0x87b7('0x1b')]);_0x10be8a[_0x87b7('0x1e')]=qs[_0x87b7('0x1e')](_0x5b0a31[_0x87b7('0x2d')]['offset']);}return _0x44ab64[_0x87b7('0x4f')](_0x10be8a);}})[_0x87b7('0x22')](function(_0x33edbd){if(_0x33edbd){return _0x33edbd?{'count':_0x3c237b,'rows':_0x33edbd}:null;}})[_0x87b7('0x22')](respondWithResult(_0x381b29,null))[_0x87b7('0x44')](handleError(_0x381b29,null));}; \ No newline at end of file +var _0xf81b=['zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','ioredis','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','sendStatus','stack','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','where','pick','merge','VIRTUAL','name','filter','options','findAll','rows','catch','params','includeAll','include','find','create','body','getFields','findOne','VtigerField','sort','hasOwnProperty','nolimit','getSubjects','order','getDescriptions','eml-format','rimraf'];(function(_0x1755e2,_0x397e1b){var _0x2eed31=function(_0x1c84b1){while(--_0x1c84b1){_0x1755e2['push'](_0x1755e2['shift']());}};_0x2eed31(++_0x397e1b);}(_0xf81b,0x1cc));var _0xbf81=function(_0x1f0a9a,_0x39dbeb){_0x1f0a9a=_0x1f0a9a-0x0;var _0x30ba19=_0xf81b[_0x1f0a9a];return _0x30ba19;};'use strict';var emlformat=require(_0xbf81('0x0'));var rimraf=require(_0xbf81('0x1'));var zipdir=require(_0xbf81('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbf81('0x3'));var moment=require('moment');var BPromise=require(_0xbf81('0x4'));var Mustache=require(_0xbf81('0x5'));var util=require(_0xbf81('0x6'));var path=require(_0xbf81('0x7'));var sox=require(_0xbf81('0x8'));var csv=require(_0xbf81('0x9'));var ejs=require(_0xbf81('0xa'));var fs=require('fs');var fs_extra=require(_0xbf81('0xb'));var _=require('lodash');var squel=require(_0xbf81('0xc'));var crypto=require(_0xbf81('0xd'));var jsforce=require(_0xbf81('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbf81('0xf'));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(_0xbf81('0x10'))('api');var utils=require(_0xbf81('0x11'));var config=require(_0xbf81('0x12'));var licenseUtil=require(_0xbf81('0x13'));var db=require(_0xbf81('0x14'))['db'];function respondWithStatusCode(_0x103655,_0x32fe6c){_0x32fe6c=_0x32fe6c||0xcc;return function(_0x394222){if(_0x394222){return _0x103655['sendStatus'](_0x32fe6c);}return _0x103655[_0xbf81('0x15')](_0x32fe6c)[_0xbf81('0x16')]();};}function respondWithResult(_0x33c7f4,_0x5836b7){_0x5836b7=_0x5836b7||0xc8;return function(_0x2dd19e){if(_0x2dd19e){return _0x33c7f4[_0xbf81('0x15')](_0x5836b7)[_0xbf81('0x17')](_0x2dd19e);}};}function respondWithFilteredResult(_0x23dd94,_0x41c56a){return function(_0x5461c2){if(_0x5461c2){var _0x1e78d1=typeof _0x41c56a[_0xbf81('0x18')]===_0xbf81('0x19')&&typeof _0x41c56a[_0xbf81('0x1a')]===_0xbf81('0x19');var _0x1021d5=_0x5461c2[_0xbf81('0x1b')];var _0x2b95f1=_0x1e78d1?0x0:_0x41c56a[_0xbf81('0x18')];var _0x5d6872=_0x1e78d1?_0x5461c2[_0xbf81('0x1b')]:_0x41c56a[_0xbf81('0x18')]+_0x41c56a[_0xbf81('0x1a')];var _0x4a6f7c;if(_0x5d6872>=_0x1021d5){_0x5d6872=_0x1021d5;_0x4a6f7c=0xc8;}else{_0x4a6f7c=0xce;}_0x23dd94['status'](_0x4a6f7c);return _0x23dd94[_0xbf81('0x1c')]('Content-Range',_0x2b95f1+'-'+_0x5d6872+'/'+_0x1021d5)[_0xbf81('0x17')](_0x5461c2);}return null;};}function patchUpdates(_0x10e17e){return function(_0x55a973){try{jsonpatch[_0xbf81('0x1d')](_0x55a973,_0x10e17e,!![]);}catch(_0x3770c6){return BPromise[_0xbf81('0x1e')](_0x3770c6);}return _0x55a973['save']();};}function saveUpdates(_0x314efa,_0x96eecf){return function(_0x2c3618){if(_0x2c3618){return _0x2c3618[_0xbf81('0x1f')](_0x314efa)[_0xbf81('0x20')](function(_0xc51c36){return _0xc51c36;});}return null;};}function removeEntity(_0x1fd2e1,_0x20abc0){return function(_0x27ab40){if(_0x27ab40){return _0x27ab40[_0xbf81('0x21')]()[_0xbf81('0x20')](function(){_0x1fd2e1[_0xbf81('0x15')](0xcc)[_0xbf81('0x16')]();});}};}function handleEntityNotFound(_0x57078c,_0x1d070e){return function(_0x46d650){if(!_0x46d650){_0x57078c[_0xbf81('0x22')](0x194);}return _0x46d650;};}function handleError(_0x2f637c,_0x38f6fb){_0x38f6fb=_0x38f6fb||0x1f4;return function(_0x4f7e61){logger['error'](_0x4f7e61[_0xbf81('0x23')]);if(_0x4f7e61['name']){delete _0x4f7e61['name'];}_0x2f637c[_0xbf81('0x15')](_0x38f6fb)[_0xbf81('0x24')](_0x4f7e61);};}exports[_0xbf81('0x25')]=function(_0x5d58f7,_0x188025){var _0x31a788={},_0x501a72={},_0x183258={'count':0x0,'rows':[]};var _0x4ec0ce=_[_0xbf81('0x26')](db[_0xbf81('0x27')][_0xbf81('0x28')],function(_0x5f5304){return{'name':_0x5f5304[_0xbf81('0x29')],'type':_0x5f5304[_0xbf81('0x2a')][_0xbf81('0x2b')]};});_0x501a72[_0xbf81('0x2c')]=_[_0xbf81('0x26')](_0x4ec0ce,'name');_0x501a72[_0xbf81('0x2d')]=_[_0xbf81('0x2e')](_0x5d58f7[_0xbf81('0x2d')]);_0x501a72[_0xbf81('0x2f')]=_['intersection'](_0x501a72['model'],_0x501a72[_0xbf81('0x2d')]);_0x31a788['attributes']=_[_0xbf81('0x30')](_0x501a72[_0xbf81('0x2c')],qs[_0xbf81('0x31')](_0x5d58f7[_0xbf81('0x2d')]['fields']));_0x31a788[_0xbf81('0x32')]=_0x31a788[_0xbf81('0x32')][_0xbf81('0x33')]?_0x31a788[_0xbf81('0x32')]:_0x501a72[_0xbf81('0x2c')];if(!_0x5d58f7[_0xbf81('0x2d')]['hasOwnProperty']('nolimit')){_0x31a788[_0xbf81('0x1a')]=qs[_0xbf81('0x1a')](_0x5d58f7[_0xbf81('0x2d')][_0xbf81('0x1a')]);_0x31a788['offset']=qs[_0xbf81('0x18')](_0x5d58f7[_0xbf81('0x2d')][_0xbf81('0x18')]);}_0x31a788['order']=qs['sort'](_0x5d58f7[_0xbf81('0x2d')]['sort']);_0x31a788[_0xbf81('0x34')]=qs['filters'](_[_0xbf81('0x35')](_0x5d58f7['query'],_0x501a72[_0xbf81('0x2f')]),_0x4ec0ce);if(_0x5d58f7[_0xbf81('0x2d')]['filter']){_0x31a788[_0xbf81('0x34')]=_[_0xbf81('0x36')](_0x31a788['where'],{'$or':_['map'](_0x4ec0ce,function(_0x368ef1){if(_0x368ef1[_0xbf81('0x2a')]!==_0xbf81('0x37')){var _0x17ed3f={};_0x17ed3f[_0x368ef1[_0xbf81('0x38')]]={'$like':'%'+_0x5d58f7['query'][_0xbf81('0x39')]+'%'};return _0x17ed3f;}})});}_0x31a788=_['merge']({},_0x31a788,_0x5d58f7[_0xbf81('0x3a')]);var _0x94e44a={'where':_0x31a788['where']};return db[_0xbf81('0x27')][_0xbf81('0x1b')](_0x94e44a)[_0xbf81('0x20')](function(_0x64804e){_0x183258['count']=_0x64804e;if(_0x5d58f7[_0xbf81('0x2d')]['includeAll']){_0x31a788['include']=[{'all':!![]}];}return db[_0xbf81('0x27')][_0xbf81('0x3b')](_0x31a788);})[_0xbf81('0x20')](function(_0x34d56f){_0x183258[_0xbf81('0x3c')]=_0x34d56f;return _0x183258;})['then'](respondWithFilteredResult(_0x188025,_0x31a788))[_0xbf81('0x3d')](handleError(_0x188025,null));};exports['show']=function(_0x4a318f,_0x5d5169){var _0xfbeca7={'raw':![],'where':{'id':_0x4a318f[_0xbf81('0x3e')]['id']}},_0x94ad44={};_0x94ad44[_0xbf81('0x2c')]=_['keys'](db[_0xbf81('0x27')][_0xbf81('0x28')]);_0x94ad44['query']=_['keys'](_0x4a318f['query']);_0x94ad44[_0xbf81('0x2f')]=_[_0xbf81('0x30')](_0x94ad44[_0xbf81('0x2c')],_0x94ad44[_0xbf81('0x2d')]);_0xfbeca7[_0xbf81('0x32')]=_[_0xbf81('0x30')](_0x94ad44[_0xbf81('0x2c')],qs[_0xbf81('0x31')](_0x4a318f[_0xbf81('0x2d')][_0xbf81('0x31')]));_0xfbeca7[_0xbf81('0x32')]=_0xfbeca7[_0xbf81('0x32')][_0xbf81('0x33')]?_0xfbeca7[_0xbf81('0x32')]:_0x94ad44[_0xbf81('0x2c')];if(_0x4a318f['query'][_0xbf81('0x3f')]){_0xfbeca7[_0xbf81('0x40')]=[{'all':!![]}];}_0xfbeca7=_[_0xbf81('0x36')]({},_0xfbeca7,_0x4a318f[_0xbf81('0x3a')]);return db[_0xbf81('0x27')][_0xbf81('0x41')](_0xfbeca7)[_0xbf81('0x20')](handleEntityNotFound(_0x5d5169,null))['then'](respondWithResult(_0x5d5169,null))[_0xbf81('0x3d')](handleError(_0x5d5169,null));};exports[_0xbf81('0x42')]=function(_0x478853,_0x291be6){return db['VtigerConfiguration'][_0xbf81('0x42')](_0x478853[_0xbf81('0x43')],{})['then'](respondWithResult(_0x291be6,0xc9))[_0xbf81('0x3d')](handleError(_0x291be6,null));};exports[_0xbf81('0x1f')]=function(_0x5bc432,_0x1bf577){if(_0x5bc432[_0xbf81('0x43')]['id']){delete _0x5bc432['body']['id'];}return db[_0xbf81('0x27')][_0xbf81('0x41')]({'where':{'id':_0x5bc432[_0xbf81('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1bf577,null))['then'](saveUpdates(_0x5bc432[_0xbf81('0x43')],null))[_0xbf81('0x20')](respondWithResult(_0x1bf577,null))[_0xbf81('0x3d')](handleError(_0x1bf577,null));};exports['destroy']=function(_0x50a843,_0x5978f3){return db[_0xbf81('0x27')]['find']({'where':{'id':_0x50a843[_0xbf81('0x3e')]['id']}})[_0xbf81('0x20')](handleEntityNotFound(_0x5978f3,null))[_0xbf81('0x20')](removeEntity(_0x5978f3,null))['catch'](handleError(_0x5978f3,null));};exports[_0xbf81('0x44')]=function(_0x433dca,_0x5957fb,_0xa1334e){var _0x8af1b3={};var _0x1dcdc2={};var _0x376e4d;var _0x10b3cd;return db[_0xbf81('0x27')][_0xbf81('0x45')]({'where':{'id':_0x433dca['params']['id']}})['then'](handleEntityNotFound(_0x5957fb,null))['then'](function(_0x327daf){if(_0x327daf){_0x376e4d=_0x327daf;_0x1dcdc2[_0xbf81('0x2c')]=_[_0xbf81('0x2e')](db[_0xbf81('0x46')][_0xbf81('0x28')]);_0x1dcdc2[_0xbf81('0x2d')]=_[_0xbf81('0x2e')](_0x433dca[_0xbf81('0x2d')]);_0x1dcdc2[_0xbf81('0x2f')]=_[_0xbf81('0x30')](_0x1dcdc2['model'],_0x1dcdc2[_0xbf81('0x2d')]);_0x8af1b3[_0xbf81('0x32')]=_['intersection'](_0x1dcdc2['model'],qs[_0xbf81('0x31')](_0x433dca['query']['fields']));_0x8af1b3[_0xbf81('0x32')]=_0x8af1b3['attributes']['length']?_0x8af1b3[_0xbf81('0x32')]:_0x1dcdc2['model'];_0x8af1b3['order']=qs[_0xbf81('0x47')](_0x433dca[_0xbf81('0x2d')]['sort']);_0x8af1b3[_0xbf81('0x34')]=qs['filters'](_['pick'](_0x433dca[_0xbf81('0x2d')],_0x1dcdc2[_0xbf81('0x2f')]));if(_0x433dca[_0xbf81('0x2d')][_0xbf81('0x39')]){_0x8af1b3[_0xbf81('0x34')]=_[_0xbf81('0x36')](_0x8af1b3[_0xbf81('0x34')],{'$or':_[_0xbf81('0x26')](_0x8af1b3['attributes'],function(_0x9c2c9d){var _0x3dc7d8={};_0x3dc7d8[_0x9c2c9d]={'$like':'%'+_0x433dca[_0xbf81('0x2d')][_0xbf81('0x39')]+'%'};return _0x3dc7d8;})});}_0x8af1b3=_[_0xbf81('0x36')]({},_0x8af1b3,_0x433dca[_0xbf81('0x3a')]);return _0x376e4d[_0xbf81('0x44')](_0x8af1b3);}})[_0xbf81('0x20')](function(_0x42fc9d){if(_0x42fc9d){_0x10b3cd=_0x42fc9d['length'];if(!_0x433dca[_0xbf81('0x2d')][_0xbf81('0x48')](_0xbf81('0x49'))){_0x8af1b3[_0xbf81('0x1a')]=qs[_0xbf81('0x1a')](_0x433dca[_0xbf81('0x2d')]['limit']);_0x8af1b3['offset']=qs[_0xbf81('0x18')](_0x433dca[_0xbf81('0x2d')][_0xbf81('0x18')]);}return _0x376e4d['getFields'](_0x8af1b3);}})['then'](function(_0x2d42ca){if(_0x2d42ca){return _0x2d42ca?{'count':_0x10b3cd,'rows':_0x2d42ca}:null;}})[_0xbf81('0x20')](respondWithResult(_0x5957fb,null))[_0xbf81('0x3d')](handleError(_0x5957fb,null));};exports[_0xbf81('0x4a')]=function(_0x5f1657,_0x4e81a1,_0xa15df6){var _0x123b16={};var _0x15259c={};var _0x43f4f5;var _0x50ce97;return db['VtigerConfiguration'][_0xbf81('0x45')]({'where':{'id':_0x5f1657[_0xbf81('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4e81a1,null))['then'](function(_0x2a40e0){if(_0x2a40e0){_0x43f4f5=_0x2a40e0;_0x15259c['model']=_[_0xbf81('0x2e')](db[_0xbf81('0x46')][_0xbf81('0x28')]);_0x15259c[_0xbf81('0x2d')]=_[_0xbf81('0x2e')](_0x5f1657[_0xbf81('0x2d')]);_0x15259c[_0xbf81('0x2f')]=_[_0xbf81('0x30')](_0x15259c['model'],_0x15259c[_0xbf81('0x2d')]);_0x123b16[_0xbf81('0x32')]=_[_0xbf81('0x30')](_0x15259c[_0xbf81('0x2c')],qs[_0xbf81('0x31')](_0x5f1657[_0xbf81('0x2d')][_0xbf81('0x31')]));_0x123b16[_0xbf81('0x32')]=_0x123b16['attributes'][_0xbf81('0x33')]?_0x123b16['attributes']:_0x15259c[_0xbf81('0x2c')];_0x123b16[_0xbf81('0x4b')]=qs[_0xbf81('0x47')](_0x5f1657[_0xbf81('0x2d')][_0xbf81('0x47')]);_0x123b16[_0xbf81('0x34')]=qs[_0xbf81('0x2f')](_[_0xbf81('0x35')](_0x5f1657[_0xbf81('0x2d')],_0x15259c['filters']));if(_0x5f1657[_0xbf81('0x2d')][_0xbf81('0x39')]){_0x123b16[_0xbf81('0x34')]=_[_0xbf81('0x36')](_0x123b16[_0xbf81('0x34')],{'$or':_[_0xbf81('0x26')](_0x123b16[_0xbf81('0x32')],function(_0x5b8beb){var _0x525446={};_0x525446[_0x5b8beb]={'$like':'%'+_0x5f1657[_0xbf81('0x2d')][_0xbf81('0x39')]+'%'};return _0x525446;})});}_0x123b16=_[_0xbf81('0x36')]({},_0x123b16,_0x5f1657['options']);return _0x43f4f5['getSubjects'](_0x123b16);}})[_0xbf81('0x20')](function(_0x33f0fb){if(_0x33f0fb){_0x50ce97=_0x33f0fb[_0xbf81('0x33')];if(!_0x5f1657[_0xbf81('0x2d')][_0xbf81('0x48')](_0xbf81('0x49'))){_0x123b16[_0xbf81('0x1a')]=qs[_0xbf81('0x1a')](_0x5f1657[_0xbf81('0x2d')][_0xbf81('0x1a')]);_0x123b16['offset']=qs[_0xbf81('0x18')](_0x5f1657['query'][_0xbf81('0x18')]);}return _0x43f4f5['getSubjects'](_0x123b16);}})['then'](function(_0x445339){if(_0x445339){return _0x445339?{'count':_0x50ce97,'rows':_0x445339}:null;}})[_0xbf81('0x20')](respondWithResult(_0x4e81a1,null))[_0xbf81('0x3d')](handleError(_0x4e81a1,null));};exports[_0xbf81('0x4c')]=function(_0x42fadb,_0x3a3768,_0x5d5202){var _0x494ac7={};var _0xabd852={};var _0x118d88;var _0x5eb36d;return db[_0xbf81('0x27')][_0xbf81('0x45')]({'where':{'id':_0x42fadb[_0xbf81('0x3e')]['id']}})[_0xbf81('0x20')](handleEntityNotFound(_0x3a3768,null))[_0xbf81('0x20')](function(_0xafd356){if(_0xafd356){_0x118d88=_0xafd356;_0xabd852[_0xbf81('0x2c')]=_[_0xbf81('0x2e')](db[_0xbf81('0x46')][_0xbf81('0x28')]);_0xabd852[_0xbf81('0x2d')]=_[_0xbf81('0x2e')](_0x42fadb['query']);_0xabd852[_0xbf81('0x2f')]=_[_0xbf81('0x30')](_0xabd852[_0xbf81('0x2c')],_0xabd852[_0xbf81('0x2d')]);_0x494ac7[_0xbf81('0x32')]=_[_0xbf81('0x30')](_0xabd852[_0xbf81('0x2c')],qs[_0xbf81('0x31')](_0x42fadb[_0xbf81('0x2d')][_0xbf81('0x31')]));_0x494ac7[_0xbf81('0x32')]=_0x494ac7[_0xbf81('0x32')][_0xbf81('0x33')]?_0x494ac7[_0xbf81('0x32')]:_0xabd852[_0xbf81('0x2c')];_0x494ac7['order']=qs[_0xbf81('0x47')](_0x42fadb[_0xbf81('0x2d')][_0xbf81('0x47')]);_0x494ac7[_0xbf81('0x34')]=qs[_0xbf81('0x2f')](_[_0xbf81('0x35')](_0x42fadb[_0xbf81('0x2d')],_0xabd852[_0xbf81('0x2f')]));if(_0x42fadb['query'][_0xbf81('0x39')]){_0x494ac7[_0xbf81('0x34')]=_[_0xbf81('0x36')](_0x494ac7[_0xbf81('0x34')],{'$or':_['map'](_0x494ac7['attributes'],function(_0x14286c){var _0x5f178e={};_0x5f178e[_0x14286c]={'$like':'%'+_0x42fadb[_0xbf81('0x2d')][_0xbf81('0x39')]+'%'};return _0x5f178e;})});}_0x494ac7=_[_0xbf81('0x36')]({},_0x494ac7,_0x42fadb[_0xbf81('0x3a')]);return _0x118d88[_0xbf81('0x4c')](_0x494ac7);}})[_0xbf81('0x20')](function(_0x5af980){if(_0x5af980){_0x5eb36d=_0x5af980[_0xbf81('0x33')];if(!_0x42fadb[_0xbf81('0x2d')][_0xbf81('0x48')](_0xbf81('0x49'))){_0x494ac7[_0xbf81('0x1a')]=qs['limit'](_0x42fadb['query'][_0xbf81('0x1a')]);_0x494ac7[_0xbf81('0x18')]=qs[_0xbf81('0x18')](_0x42fadb[_0xbf81('0x2d')][_0xbf81('0x18')]);}return _0x118d88[_0xbf81('0x4c')](_0x494ac7);}})[_0xbf81('0x20')](function(_0x19fdce){if(_0x19fdce){return _0x19fdce?{'count':_0x5eb36d,'rows':_0x19fdce}:null;}})[_0xbf81('0x20')](respondWithResult(_0x3a3768,null))['catch'](handleError(_0x3a3768,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index c096ce3..03fe906 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 _0x7c9a=['request-promise','path','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','int_vtiger_configurations','lodash','../../config/logger','api','moment','bluebird'];(function(_0x519d77,_0x4e758e){var _0x56e79d=function(_0x10744e){while(--_0x10744e){_0x519d77['push'](_0x519d77['shift']());}};_0x56e79d(++_0x4e758e);}(_0x7c9a,0x1be));var _0xa7c9=function(_0x2c71bc,_0x5a03a5){_0x2c71bc=_0x2c71bc-0x0;var _0x4d97a5=_0x7c9a[_0x2c71bc];return _0x4d97a5;};'use strict';var _=require(_0xa7c9('0x0'));var util=require('util');var logger=require(_0xa7c9('0x1'))(_0xa7c9('0x2'));var moment=require(_0xa7c9('0x3'));var BPromise=require(_0xa7c9('0x4'));var rp=require(_0xa7c9('0x5'));var fs=require('fs');var path=require(_0xa7c9('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa7c9('0x7'));module[_0xa7c9('0x8')]=function(_0x1f9742,_0x3f0188){return _0x1f9742['define'](_0xa7c9('0x9'),attributes,{'tableName':_0xa7c9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x57f5=['VtigerConfiguration','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x529c1a,_0x204539){var _0x1186f6=function(_0x503801){while(--_0x503801){_0x529c1a['push'](_0x529c1a['shift']());}};_0x1186f6(++_0x204539);}(_0x57f5,0x181));var _0x557f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x57f5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x557f('0x0'));var util=require(_0x557f('0x1'));var logger=require(_0x557f('0x2'))(_0x557f('0x3'));var moment=require('moment');var BPromise=require(_0x557f('0x4'));var rp=require(_0x557f('0x5'));var fs=require('fs');var path=require(_0x557f('0x6'));var rimraf=require(_0x557f('0x7'));var config=require(_0x557f('0x8'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x557f('0x9')]=function(_0x8e37be,_0x165340){return _0x8e37be[_0x557f('0xa')](_0x557f('0xb'),attributes,{'tableName':'int_vtiger_configurations','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 1cc6da8..0005770 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 _0xd854=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3b87bf,_0x5a9b18){var _0x35f1ed=function(_0x473542){while(--_0x473542){_0x3b87bf['push'](_0x3b87bf['shift']());}};_0x35f1ed(++_0x5a9b18);}(_0xd854,0x10b));var _0x4d85=function(_0x81ea81,_0x494517){_0x81ea81=_0x81ea81-0x0;var _0x11c73b=_0xd854[_0x81ea81];return _0x11c73b;};'use strict';var _=require(_0x4d85('0x0'));var util=require(_0x4d85('0x1'));var moment=require(_0x4d85('0x2'));var BPromise=require(_0x4d85('0x3'));var rs=require(_0x4d85('0x4'));var fs=require('fs');var Redis=require(_0x4d85('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4d85('0x6'));var logger=require(_0x4d85('0x7'))(_0x4d85('0x8'));var config=require('../../config/environment');var jayson=require(_0x4d85('0x9'));var client=jayson[_0x4d85('0xa')][_0x4d85('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58908b,_0x4bf9a2,_0x5d7288){return new BPromise(function(_0x5aba5c,_0x3bafeb){return client['request'](_0x58908b,_0x5d7288)['then'](function(_0x20e813){logger['info'](_0x4d85('0xc'),_0x4bf9a2,_0x4d85('0xd'));logger[_0x4d85('0xe')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x4bf9a2,_0x4d85('0xd'),JSON['stringify'](_0x20e813));if(_0x20e813[_0x4d85('0xf')]){if(_0x20e813[_0x4d85('0xf')][_0x4d85('0x10')]===0x1f4){logger[_0x4d85('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x4bf9a2,_0x20e813[_0x4d85('0xf')][_0x4d85('0x11')]);return _0x3bafeb(_0x20e813[_0x4d85('0xf')][_0x4d85('0x11')]);}logger[_0x4d85('0xf')](_0x4d85('0xc'),_0x4bf9a2,_0x20e813['error']['message']);return _0x5aba5c(_0x20e813[_0x4d85('0xf')][_0x4d85('0x11')]);}else{logger[_0x4d85('0x12')](_0x4d85('0xc'),_0x4bf9a2,_0x4d85('0xd'));_0x5aba5c(_0x20e813[_0x4d85('0x13')][_0x4d85('0x11')]);}})[_0x4d85('0x14')](function(_0x27da66){logger[_0x4d85('0xf')](_0x4d85('0xc'),_0x4bf9a2,_0x27da66);_0x3bafeb(_0x27da66);});});} \ No newline at end of file +var _0x5fad=['request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0xa398c6,_0x1328b6){var _0x1597bc=function(_0x2d7c70){while(--_0x2d7c70){_0xa398c6['push'](_0xa398c6['shift']());}};_0x1597bc(++_0x1328b6);}(_0x5fad,0x11a));var _0xd5fa=function(_0x5e9ae0,_0x16b4bb){_0x5e9ae0=_0x5e9ae0-0x0;var _0x204d50=_0x5fad[_0x5e9ae0];return _0x204d50;};'use strict';var _=require(_0xd5fa('0x0'));var util=require(_0xd5fa('0x1'));var moment=require(_0xd5fa('0x2'));var BPromise=require(_0xd5fa('0x3'));var rs=require(_0xd5fa('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd5fa('0x5'))['db'];var utils=require(_0xd5fa('0x6'));var logger=require(_0xd5fa('0x7'))(_0xd5fa('0x8'));var config=require(_0xd5fa('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd5fa('0xa')][_0xd5fa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x565422,_0x145a24,_0x1c93d5){return new BPromise(function(_0x3281b2,_0x132dfc){return client[_0xd5fa('0xc')](_0x565422,_0x1c93d5)['then'](function(_0x1c85a8){logger[_0xd5fa('0xd')](_0xd5fa('0xe'),_0x145a24,_0xd5fa('0xf'));logger[_0xd5fa('0x10')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x145a24,_0xd5fa('0xf'),JSON['stringify'](_0x1c85a8));if(_0x1c85a8[_0xd5fa('0x11')]){if(_0x1c85a8[_0xd5fa('0x11')][_0xd5fa('0x12')]===0x1f4){logger['error'](_0xd5fa('0xe'),_0x145a24,_0x1c85a8[_0xd5fa('0x11')][_0xd5fa('0x13')]);return _0x132dfc(_0x1c85a8[_0xd5fa('0x11')]['message']);}logger[_0xd5fa('0x11')](_0xd5fa('0xe'),_0x145a24,_0x1c85a8[_0xd5fa('0x11')][_0xd5fa('0x13')]);return _0x3281b2(_0x1c85a8[_0xd5fa('0x11')][_0xd5fa('0x13')]);}else{logger[_0xd5fa('0xd')](_0xd5fa('0xe'),_0x145a24,_0xd5fa('0xf'));_0x3281b2(_0x1c85a8[_0xd5fa('0x14')][_0xd5fa('0x13')]);}})['catch'](function(_0x2e89bc){logger[_0xd5fa('0x11')](_0xd5fa('0xe'),_0x145a24,_0x2e89bc);_0x132dfc(_0x2e89bc);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index ef40b06..8e2f47e 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 _0x879b=['../../config/environment','get','isAuthenticated','index','show','post','create','/:id','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x24ddad,_0x11f1b2){var _0x5171c3=function(_0x287bd7){while(--_0x287bd7){_0x24ddad['push'](_0x24ddad['shift']());}};_0x5171c3(++_0x11f1b2);}(_0x879b,0xae));var _0xb879=function(_0x30ce9b,_0x2225c6){_0x30ce9b=_0x30ce9b-0x0;var _0x2dbab0=_0x879b[_0x30ce9b];return _0x2dbab0;};'use strict';var multer=require(_0xb879('0x0'));var util=require(_0xb879('0x1'));var path=require('path');var timeout=require(_0xb879('0x2'));var express=require('express');var router=express[_0xb879('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb879('0x4'));var interaction=require(_0xb879('0x5'));var config=require(_0xb879('0x6'));var controller=require('./intVtigerField.controller');router[_0xb879('0x7')]('/',auth[_0xb879('0x8')](),controller[_0xb879('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb879('0xa')]);router[_0xb879('0xb')]('/',auth[_0xb879('0x8')](),controller[_0xb879('0xc')]);router['put']('/:id',auth[_0xb879('0x8')](),controller['update']);router['delete'](_0xb879('0xd'),auth['isAuthenticated'](),controller[_0xb879('0xe')]);module['exports']=router; \ No newline at end of file +var _0x1473=['isAuthenticated','index','/:id','show','post','create','put','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x1473,0x14b));var _0x3147=function(_0x54064a,_0x28ec22){_0x54064a=_0x54064a-0x0;var _0xccdaea=_0x1473[_0x54064a];return _0xccdaea;};'use strict';var multer=require('multer');var util=require(_0x3147('0x0'));var path=require(_0x3147('0x1'));var timeout=require(_0x3147('0x2'));var express=require('express');var router=express[_0x3147('0x3')]();var fs_extra=require(_0x3147('0x4'));var auth=require(_0x3147('0x5'));var interaction=require(_0x3147('0x6'));var config=require('../../config/environment');var controller=require(_0x3147('0x7'));router[_0x3147('0x8')]('/',auth[_0x3147('0x9')](),controller[_0x3147('0xa')]);router[_0x3147('0x8')](_0x3147('0xb'),auth[_0x3147('0x9')](),controller[_0x3147('0xc')]);router[_0x3147('0xd')]('/',auth[_0x3147('0x9')](),controller[_0x3147('0xe')]);router[_0x3147('0xf')](_0x3147('0xb'),auth[_0x3147('0x9')](),controller['update']);router['delete'](_0x3147('0xb'),auth[_0x3147('0x9')](),controller[_0x3147('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 52fe68a..28fb51e 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 _0x8025=['picklist','STRING','customVariable','BOOLEAN','exports','ENUM','string','variable','keyValue'];(function(_0x275d85,_0x5a883e){var _0x3cd754=function(_0x209dee){while(--_0x209dee){_0x275d85['push'](_0x275d85['shift']());}};_0x3cd754(++_0x5a883e);}(_0x8025,0x1bd));var _0x5802=function(_0x55dc56,_0xd0fee9){_0x55dc56=_0x55dc56-0x0;var _0x5942cf=_0x8025[_0x55dc56];return _0x5942cf;};'use strict';var Sequelize=require('sequelize');module[_0x5802('0x0')]={'type':{'type':Sequelize[_0x5802('0x1')](_0x5802('0x2'),_0x5802('0x3'),'customVariable',_0x5802('0x4'),_0x5802('0x5')),'defaultValue':_0x5802('0x2')},'content':{'type':Sequelize[_0x5802('0x6')]},'key':{'type':Sequelize[_0x5802('0x6')]},'keyType':{'type':Sequelize[_0x5802('0x1')](_0x5802('0x2'),_0x5802('0x3'),_0x5802('0x7'))},'keyContent':{'type':Sequelize[_0x5802('0x6')]},'idField':{'type':Sequelize[_0x5802('0x6')]},'nameField':{'type':Sequelize[_0x5802('0x6')]},'customField':{'type':Sequelize[_0x5802('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5802('0x6')]}}; \ No newline at end of file +var _0x8275=['keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x27b2c7,_0x3c39e2){var _0x3ae168=function(_0x183ad8){while(--_0x183ad8){_0x27b2c7['push'](_0x27b2c7['shift']());}};_0x3ae168(++_0x3c39e2);}(_0x8275,0x176));var _0x5827=function(_0x2a5864,_0x2b9396){_0x2a5864=_0x2a5864-0x0;var _0x490ab6=_0x8275[_0x2a5864];return _0x490ab6;};'use strict';var Sequelize=require(_0x5827('0x0'));module[_0x5827('0x1')]={'type':{'type':Sequelize[_0x5827('0x2')](_0x5827('0x3'),_0x5827('0x4'),_0x5827('0x5'),_0x5827('0x6'),_0x5827('0x7')),'defaultValue':_0x5827('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x5827('0x8')]},'keyType':{'type':Sequelize[_0x5827('0x2')](_0x5827('0x3'),_0x5827('0x4'),_0x5827('0x5'))},'keyContent':{'type':Sequelize[_0x5827('0x8')]},'idField':{'type':Sequelize[_0x5827('0x8')]},'nameField':{'type':Sequelize[_0x5827('0x8')]},'customField':{'type':Sequelize[_0x5827('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5827('0x8')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index d8c65f0..3244481 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 _0x57b1=['offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','map','VtigerField','type','key','query','keys','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','filters','find','create','body','catch','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x57b1,0xc6));var _0x157b=function(_0x1fa433,_0x2e3532){_0x1fa433=_0x1fa433-0x0;var _0x2a6f98=_0x57b1[_0x1fa433];return _0x2a6f98;};'use strict';var emlformat=require(_0x157b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x157b('0x1'));var jsonpatch=require(_0x157b('0x2'));var rp=require(_0x157b('0x3'));var moment=require('moment');var BPromise=require(_0x157b('0x4'));var Mustache=require(_0x157b('0x5'));var util=require(_0x157b('0x6'));var path=require(_0x157b('0x7'));var sox=require('sox');var csv=require(_0x157b('0x8'));var ejs=require(_0x157b('0x9'));var fs=require('fs');var fs_extra=require(_0x157b('0xa'));var _=require('lodash');var squel=require(_0x157b('0xb'));var crypto=require(_0x157b('0xc'));var jsforce=require(_0x157b('0xd'));var deskjs=require(_0x157b('0xe'));var toCsv=require(_0x157b('0x8'));var querystring=require(_0x157b('0xf'));var Papa=require(_0x157b('0x10'));var Redis=require(_0x157b('0x11'));var authService=require(_0x157b('0x12'));var qs=require(_0x157b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x157b('0x14'));var logger=require(_0x157b('0x15'))(_0x157b('0x16'));var utils=require(_0x157b('0x17'));var config=require(_0x157b('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x157b('0x19'))['db'];function respondWithStatusCode(_0x4e410e,_0x2a0520){_0x2a0520=_0x2a0520||0xcc;return function(_0x3390cb){if(_0x3390cb){return _0x4e410e[_0x157b('0x1a')](_0x2a0520);}return _0x4e410e[_0x157b('0x1b')](_0x2a0520)[_0x157b('0x1c')]();};}function respondWithResult(_0x2f1c58,_0xca65a9){_0xca65a9=_0xca65a9||0xc8;return function(_0x4a8618){if(_0x4a8618){return _0x2f1c58[_0x157b('0x1b')](_0xca65a9)[_0x157b('0x1d')](_0x4a8618);}};}function respondWithFilteredResult(_0x3b3013,_0x496a72){return function(_0x69cc4b){if(_0x69cc4b){var _0x48ec6d=typeof _0x496a72[_0x157b('0x1e')]==='undefined'&&typeof _0x496a72[_0x157b('0x1f')]===_0x157b('0x20');var _0x45b347=_0x69cc4b['count'];var _0xc00ef0=_0x48ec6d?0x0:_0x496a72[_0x157b('0x1e')];var _0x25e8de=_0x48ec6d?_0x69cc4b[_0x157b('0x21')]:_0x496a72[_0x157b('0x1e')]+_0x496a72[_0x157b('0x1f')];var _0x5a7ed7;if(_0x25e8de>=_0x45b347){_0x25e8de=_0x45b347;_0x5a7ed7=0xc8;}else{_0x5a7ed7=0xce;}_0x3b3013[_0x157b('0x1b')](_0x5a7ed7);return _0x3b3013[_0x157b('0x22')](_0x157b('0x23'),_0xc00ef0+'-'+_0x25e8de+'/'+_0x45b347)['json'](_0x69cc4b);}return null;};}function patchUpdates(_0x49662c){return function(_0xbd4830){try{jsonpatch['apply'](_0xbd4830,_0x49662c,!![]);}catch(_0x421c44){return BPromise[_0x157b('0x24')](_0x421c44);}return _0xbd4830[_0x157b('0x25')]();};}function saveUpdates(_0x5f18a7,_0xd0b1e5){return function(_0x120313){if(_0x120313){return _0x120313[_0x157b('0x26')](_0x5f18a7)[_0x157b('0x27')](function(_0x2a4a9f){return _0x2a4a9f;});}return null;};}function removeEntity(_0x5d13c4,_0x302917){return function(_0x3ab9af){if(_0x3ab9af){return _0x3ab9af[_0x157b('0x28')]()['then'](function(){_0x5d13c4['status'](0xcc)[_0x157b('0x1c')]();});}};}function handleEntityNotFound(_0x471e7d,_0x1a11a7){return function(_0xd2b4d1){if(!_0xd2b4d1){_0x471e7d['sendStatus'](0x194);}return _0xd2b4d1;};}function handleError(_0x18c0e3,_0x2ba30a){_0x2ba30a=_0x2ba30a||0x1f4;return function(_0x3fccf1){logger['error'](_0x3fccf1[_0x157b('0x29')]);if(_0x3fccf1[_0x157b('0x2a')]){delete _0x3fccf1[_0x157b('0x2a')];}_0x18c0e3['status'](_0x2ba30a)[_0x157b('0x2b')](_0x3fccf1);};}exports['index']=function(_0xbb9adb,_0x196257){var _0x1499d2={},_0x452c61={},_0x2767dc={'count':0x0,'rows':[]};var _0xd58111=_[_0x157b('0x2c')](db[_0x157b('0x2d')]['rawAttributes'],function(_0x253874){return{'name':_0x253874['fieldName'],'type':_0x253874[_0x157b('0x2e')][_0x157b('0x2f')]};});_0x452c61['model']=_[_0x157b('0x2c')](_0xd58111,_0x157b('0x2a'));_0x452c61[_0x157b('0x30')]=_[_0x157b('0x31')](_0xbb9adb[_0x157b('0x30')]);_0x452c61['filters']=_[_0x157b('0x32')](_0x452c61['model'],_0x452c61['query']);_0x1499d2['attributes']=_[_0x157b('0x32')](_0x452c61['model'],qs[_0x157b('0x33')](_0xbb9adb[_0x157b('0x30')][_0x157b('0x33')]));_0x1499d2['attributes']=_0x1499d2[_0x157b('0x34')][_0x157b('0x35')]?_0x1499d2[_0x157b('0x34')]:_0x452c61[_0x157b('0x36')];if(!_0xbb9adb['query'][_0x157b('0x37')](_0x157b('0x38'))){_0x1499d2[_0x157b('0x1f')]=qs[_0x157b('0x1f')](_0xbb9adb[_0x157b('0x30')]['limit']);_0x1499d2[_0x157b('0x1e')]=qs[_0x157b('0x1e')](_0xbb9adb['query'][_0x157b('0x1e')]);}_0x1499d2['order']=qs[_0x157b('0x39')](_0xbb9adb[_0x157b('0x30')]['sort']);_0x1499d2[_0x157b('0x3a')]=qs['filters'](_[_0x157b('0x3b')](_0xbb9adb['query'],_0x452c61['filters']),_0xd58111);if(_0xbb9adb['query'][_0x157b('0x3c')]){_0x1499d2[_0x157b('0x3a')]=_[_0x157b('0x3d')](_0x1499d2['where'],{'$or':_[_0x157b('0x2c')](_0xd58111,function(_0xd2413e){if(_0xd2413e[_0x157b('0x2e')]!==_0x157b('0x3e')){var _0xfb7d3b={};_0xfb7d3b[_0xd2413e[_0x157b('0x2a')]]={'$like':'%'+_0xbb9adb['query'][_0x157b('0x3c')]+'%'};return _0xfb7d3b;}})});}_0x1499d2=_[_0x157b('0x3d')]({},_0x1499d2,_0xbb9adb[_0x157b('0x3f')]);var _0x54bdf3={'where':_0x1499d2[_0x157b('0x3a')]};return db[_0x157b('0x2d')][_0x157b('0x21')](_0x54bdf3)[_0x157b('0x27')](function(_0x77d068){_0x2767dc[_0x157b('0x21')]=_0x77d068;if(_0xbb9adb[_0x157b('0x30')][_0x157b('0x40')]){_0x1499d2[_0x157b('0x41')]=[{'all':!![]}];}return db[_0x157b('0x2d')][_0x157b('0x42')](_0x1499d2);})[_0x157b('0x27')](function(_0x56a98e){_0x2767dc[_0x157b('0x43')]=_0x56a98e;return _0x2767dc;})[_0x157b('0x27')](respondWithFilteredResult(_0x196257,_0x1499d2))['catch'](handleError(_0x196257,null));};exports[_0x157b('0x44')]=function(_0x3b3165,_0x5a46e2){var _0x3060fe={'raw':!![],'where':{'id':_0x3b3165[_0x157b('0x45')]['id']}},_0x508210={};_0x508210['model']=_[_0x157b('0x31')](db[_0x157b('0x2d')][_0x157b('0x46')]);_0x508210['query']=_[_0x157b('0x31')](_0x3b3165[_0x157b('0x30')]);_0x508210[_0x157b('0x47')]=_[_0x157b('0x32')](_0x508210[_0x157b('0x36')],_0x508210[_0x157b('0x30')]);_0x3060fe[_0x157b('0x34')]=_[_0x157b('0x32')](_0x508210[_0x157b('0x36')],qs[_0x157b('0x33')](_0x3b3165['query'][_0x157b('0x33')]));_0x3060fe[_0x157b('0x34')]=_0x3060fe[_0x157b('0x34')][_0x157b('0x35')]?_0x3060fe[_0x157b('0x34')]:_0x508210[_0x157b('0x36')];if(_0x3b3165['query'][_0x157b('0x40')]){_0x3060fe[_0x157b('0x41')]=[{'all':!![]}];}_0x3060fe=_[_0x157b('0x3d')]({},_0x3060fe,_0x3b3165[_0x157b('0x3f')]);return db[_0x157b('0x2d')][_0x157b('0x48')](_0x3060fe)[_0x157b('0x27')](handleEntityNotFound(_0x5a46e2,null))['then'](respondWithResult(_0x5a46e2,null))['catch'](handleError(_0x5a46e2,null));};exports[_0x157b('0x49')]=function(_0x12f991,_0x5ef105){return db[_0x157b('0x2d')][_0x157b('0x49')](_0x12f991[_0x157b('0x4a')],{})[_0x157b('0x27')](respondWithResult(_0x5ef105,0xc9))['catch'](handleError(_0x5ef105,null));};exports[_0x157b('0x26')]=function(_0x3129d3,_0x479e10){if(_0x3129d3['body']['id']){delete _0x3129d3[_0x157b('0x4a')]['id'];}return db['VtigerField'][_0x157b('0x48')]({'where':{'id':_0x3129d3['params']['id']}})[_0x157b('0x27')](handleEntityNotFound(_0x479e10,null))[_0x157b('0x27')](saveUpdates(_0x3129d3[_0x157b('0x4a')],null))[_0x157b('0x27')](respondWithResult(_0x479e10,null))[_0x157b('0x4b')](handleError(_0x479e10,null));};exports['destroy']=function(_0x3d125d,_0x3bad82){return db[_0x157b('0x2d')][_0x157b('0x48')]({'where':{'id':_0x3d125d[_0x157b('0x45')]['id']}})[_0x157b('0x27')](handleEntityNotFound(_0x3bad82,null))[_0x157b('0x27')](removeEntity(_0x3bad82,null))['catch'](handleError(_0x3bad82,null));}; \ No newline at end of file +var _0xbf7e=['rows','catch','show','params','create','body','find','eml-format','rimraf','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','jsforce','papaparse','../../components/auth/service','../../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','error','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','VtigerField','include','findAll'];(function(_0x4a26a1,_0xa25d81){var _0x30d475=function(_0x5bba0e){while(--_0x5bba0e){_0x4a26a1['push'](_0x4a26a1['shift']());}};_0x30d475(++_0xa25d81);}(_0xbf7e,0x11f));var _0xebf7=function(_0xffb623,_0x3ecb92){_0xffb623=_0xffb623-0x0;var _0x3adda6=_0xbf7e[_0xffb623];return _0x3adda6;};'use strict';var emlformat=require(_0xebf7('0x0'));var rimraf=require(_0xebf7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xebf7('0x2'));var Mustache=require(_0xebf7('0x3'));var util=require(_0xebf7('0x4'));var path=require('path');var sox=require(_0xebf7('0x5'));var csv=require(_0xebf7('0x6'));var ejs=require(_0xebf7('0x7'));var fs=require('fs');var fs_extra=require(_0xebf7('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xebf7('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xebf7('0x6'));var querystring=require('querystring');var Papa=require(_0xebf7('0xa'));var Redis=require('ioredis');var authService=require(_0xebf7('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0xebf7('0xc'));var hardwareService=require(_0xebf7('0xd'));var logger=require(_0xebf7('0xe'))(_0xebf7('0xf'));var utils=require(_0xebf7('0x10'));var config=require(_0xebf7('0x11'));var licenseUtil=require(_0xebf7('0x12'));var db=require(_0xebf7('0x13'))['db'];function respondWithStatusCode(_0x282009,_0x215d80){_0x215d80=_0x215d80||0xcc;return function(_0x873424){if(_0x873424){return _0x282009[_0xebf7('0x14')](_0x215d80);}return _0x282009['status'](_0x215d80)[_0xebf7('0x15')]();};}function respondWithResult(_0xeafd76,_0x499ad3){_0x499ad3=_0x499ad3||0xc8;return function(_0x10ef72){if(_0x10ef72){return _0xeafd76[_0xebf7('0x16')](_0x499ad3)[_0xebf7('0x17')](_0x10ef72);}};}function respondWithFilteredResult(_0x4f5107,_0x29f8e9){return function(_0x19490b){if(_0x19490b){var _0xc36f4=typeof _0x29f8e9[_0xebf7('0x18')]===_0xebf7('0x19')&&typeof _0x29f8e9[_0xebf7('0x1a')]===_0xebf7('0x19');var _0x540d5a=_0x19490b[_0xebf7('0x1b')];var _0x49243c=_0xc36f4?0x0:_0x29f8e9['offset'];var _0x516c17=_0xc36f4?_0x19490b['count']:_0x29f8e9[_0xebf7('0x18')]+_0x29f8e9[_0xebf7('0x1a')];var _0x499d71;if(_0x516c17>=_0x540d5a){_0x516c17=_0x540d5a;_0x499d71=0xc8;}else{_0x499d71=0xce;}_0x4f5107['status'](_0x499d71);return _0x4f5107['set'](_0xebf7('0x1c'),_0x49243c+'-'+_0x516c17+'/'+_0x540d5a)[_0xebf7('0x17')](_0x19490b);}return null;};}function patchUpdates(_0x5a346f){return function(_0x28917b){try{jsonpatch[_0xebf7('0x1d')](_0x28917b,_0x5a346f,!![]);}catch(_0x5875ef){return BPromise[_0xebf7('0x1e')](_0x5875ef);}return _0x28917b[_0xebf7('0x1f')]();};}function saveUpdates(_0x1e5efa,_0x3aae66){return function(_0x494d5f){if(_0x494d5f){return _0x494d5f[_0xebf7('0x20')](_0x1e5efa)[_0xebf7('0x21')](function(_0x20af2c){return _0x20af2c;});}return null;};}function removeEntity(_0x1ee747,_0x114dbd){return function(_0x5e74c3){if(_0x5e74c3){return _0x5e74c3[_0xebf7('0x22')]()[_0xebf7('0x21')](function(){_0x1ee747[_0xebf7('0x16')](0xcc)[_0xebf7('0x15')]();});}};}function handleEntityNotFound(_0xa3e7a3,_0x24dd2c){return function(_0x401d18){if(!_0x401d18){_0xa3e7a3['sendStatus'](0x194);}return _0x401d18;};}function handleError(_0x7b42af,_0x6a73d8){_0x6a73d8=_0x6a73d8||0x1f4;return function(_0x5d834d){logger[_0xebf7('0x23')](_0x5d834d['stack']);if(_0x5d834d[_0xebf7('0x24')]){delete _0x5d834d['name'];}_0x7b42af[_0xebf7('0x16')](_0x6a73d8)[_0xebf7('0x25')](_0x5d834d);};}exports[_0xebf7('0x26')]=function(_0x54ff9a,_0x1ffbb9){var _0x3769c0={},_0x432d42={},_0x91db1b={'count':0x0,'rows':[]};var _0x36728d=_['map'](db['VtigerField'][_0xebf7('0x27')],function(_0x31185c){return{'name':_0x31185c[_0xebf7('0x28')],'type':_0x31185c[_0xebf7('0x29')][_0xebf7('0x2a')]};});_0x432d42['model']=_[_0xebf7('0x2b')](_0x36728d,'name');_0x432d42[_0xebf7('0x2c')]=_[_0xebf7('0x2d')](_0x54ff9a[_0xebf7('0x2c')]);_0x432d42[_0xebf7('0x2e')]=_[_0xebf7('0x2f')](_0x432d42['model'],_0x432d42[_0xebf7('0x2c')]);_0x3769c0[_0xebf7('0x30')]=_[_0xebf7('0x2f')](_0x432d42['model'],qs[_0xebf7('0x31')](_0x54ff9a[_0xebf7('0x2c')][_0xebf7('0x31')]));_0x3769c0[_0xebf7('0x30')]=_0x3769c0[_0xebf7('0x30')][_0xebf7('0x32')]?_0x3769c0[_0xebf7('0x30')]:_0x432d42[_0xebf7('0x33')];if(!_0x54ff9a[_0xebf7('0x2c')][_0xebf7('0x34')](_0xebf7('0x35'))){_0x3769c0[_0xebf7('0x1a')]=qs[_0xebf7('0x1a')](_0x54ff9a[_0xebf7('0x2c')]['limit']);_0x3769c0[_0xebf7('0x18')]=qs[_0xebf7('0x18')](_0x54ff9a['query']['offset']);}_0x3769c0[_0xebf7('0x36')]=qs[_0xebf7('0x37')](_0x54ff9a['query'][_0xebf7('0x37')]);_0x3769c0[_0xebf7('0x38')]=qs['filters'](_['pick'](_0x54ff9a[_0xebf7('0x2c')],_0x432d42['filters']),_0x36728d);if(_0x54ff9a[_0xebf7('0x2c')][_0xebf7('0x39')]){_0x3769c0['where']=_[_0xebf7('0x3a')](_0x3769c0[_0xebf7('0x38')],{'$or':_[_0xebf7('0x2b')](_0x36728d,function(_0x546a69){if(_0x546a69[_0xebf7('0x29')]!==_0xebf7('0x3b')){var _0x4c5ccc={};_0x4c5ccc[_0x546a69[_0xebf7('0x24')]]={'$like':'%'+_0x54ff9a[_0xebf7('0x2c')][_0xebf7('0x39')]+'%'};return _0x4c5ccc;}})});}_0x3769c0=_['merge']({},_0x3769c0,_0x54ff9a['options']);var _0x4ddefc={'where':_0x3769c0[_0xebf7('0x38')]};return db[_0xebf7('0x3c')]['count'](_0x4ddefc)[_0xebf7('0x21')](function(_0x439aab){_0x91db1b['count']=_0x439aab;if(_0x54ff9a[_0xebf7('0x2c')]['includeAll']){_0x3769c0[_0xebf7('0x3d')]=[{'all':!![]}];}return db['VtigerField'][_0xebf7('0x3e')](_0x3769c0);})[_0xebf7('0x21')](function(_0x3becae){_0x91db1b[_0xebf7('0x3f')]=_0x3becae;return _0x91db1b;})[_0xebf7('0x21')](respondWithFilteredResult(_0x1ffbb9,_0x3769c0))[_0xebf7('0x40')](handleError(_0x1ffbb9,null));};exports[_0xebf7('0x41')]=function(_0x171f28,_0x2e9f4c){var _0x565932={'raw':!![],'where':{'id':_0x171f28[_0xebf7('0x42')]['id']}},_0x4fba90={};_0x4fba90[_0xebf7('0x33')]=_[_0xebf7('0x2d')](db[_0xebf7('0x3c')][_0xebf7('0x27')]);_0x4fba90[_0xebf7('0x2c')]=_[_0xebf7('0x2d')](_0x171f28['query']);_0x4fba90['filters']=_[_0xebf7('0x2f')](_0x4fba90[_0xebf7('0x33')],_0x4fba90[_0xebf7('0x2c')]);_0x565932[_0xebf7('0x30')]=_['intersection'](_0x4fba90[_0xebf7('0x33')],qs[_0xebf7('0x31')](_0x171f28[_0xebf7('0x2c')]['fields']));_0x565932[_0xebf7('0x30')]=_0x565932[_0xebf7('0x30')]['length']?_0x565932['attributes']:_0x4fba90[_0xebf7('0x33')];if(_0x171f28[_0xebf7('0x2c')]['includeAll']){_0x565932['include']=[{'all':!![]}];}_0x565932=_[_0xebf7('0x3a')]({},_0x565932,_0x171f28['options']);return db[_0xebf7('0x3c')]['find'](_0x565932)[_0xebf7('0x21')](handleEntityNotFound(_0x2e9f4c,null))[_0xebf7('0x21')](respondWithResult(_0x2e9f4c,null))[_0xebf7('0x40')](handleError(_0x2e9f4c,null));};exports[_0xebf7('0x43')]=function(_0x289994,_0x4603d5){return db['VtigerField']['create'](_0x289994[_0xebf7('0x44')],{})[_0xebf7('0x21')](respondWithResult(_0x4603d5,0xc9))[_0xebf7('0x40')](handleError(_0x4603d5,null));};exports[_0xebf7('0x20')]=function(_0x99998e,_0xdfc1d9){if(_0x99998e[_0xebf7('0x44')]['id']){delete _0x99998e[_0xebf7('0x44')]['id'];}return db['VtigerField']['find']({'where':{'id':_0x99998e['params']['id']}})[_0xebf7('0x21')](handleEntityNotFound(_0xdfc1d9,null))[_0xebf7('0x21')](saveUpdates(_0x99998e['body'],null))['then'](respondWithResult(_0xdfc1d9,null))['catch'](handleError(_0xdfc1d9,null));};exports[_0xebf7('0x22')]=function(_0x478404,_0x48895e){return db[_0xebf7('0x3c')][_0xebf7('0x45')]({'where':{'id':_0x478404[_0xebf7('0x42')]['id']}})[_0xebf7('0x21')](handleEntityNotFound(_0x48895e,null))[_0xebf7('0x21')](removeEntity(_0x48895e,null))[_0xebf7('0x40')](handleError(_0x48895e,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index f7c78de..60054c5 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 _0x888f=['bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x888f,0xc5));var _0xf888=function(_0xcf21b1,_0x1c7c87){_0xcf21b1=_0xcf21b1-0x0;var _0x1952a0=_0x888f[_0xcf21b1];return _0x1952a0;};'use strict';var _=require('lodash');var util=require(_0xf888('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xf888('0x1'));var rp=require(_0xf888('0x2'));var fs=require('fs');var path=require(_0xf888('0x3'));var rimraf=require(_0xf888('0x4'));var config=require(_0xf888('0x5'));var attributes=require(_0xf888('0x6'));module[_0xf888('0x7')]=function(_0x4f0f61,_0x430823){return _0x4f0f61[_0xf888('0x8')](_0xf888('0x9'),attributes,{'tableName':_0xf888('0xa'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2684=['bluebird','request-promise','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','int_vtiger_fields','util','../../config/logger','api'];(function(_0x503f4d,_0x476e97){var _0x4ce6d1=function(_0x17b5fc){while(--_0x17b5fc){_0x503f4d['push'](_0x503f4d['shift']());}};_0x4ce6d1(++_0x476e97);}(_0x2684,0xe4));var _0x4268=function(_0xe6b9cd,_0x419eca){_0xe6b9cd=_0xe6b9cd-0x0;var _0x318628=_0x2684[_0xe6b9cd];return _0x318628;};'use strict';var _=require('lodash');var util=require(_0x4268('0x0'));var logger=require(_0x4268('0x1'))(_0x4268('0x2'));var moment=require('moment');var BPromise=require(_0x4268('0x3'));var rp=require(_0x4268('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4268('0x5'));var config=require(_0x4268('0x6'));var attributes=require(_0x4268('0x7'));module[_0x4268('0x8')]=function(_0x1bb1fb,_0x54faf5){return _0x1bb1fb[_0x4268('0x9')]('VtigerField',attributes,{'tableName':_0x4268('0xa'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 4722c1b..d96437b 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 _0x61ea=['VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1344d6,_0x2181e6){var _0xf45b24=function(_0x2d90c1){while(--_0x2d90c1){_0x1344d6['push'](_0x1344d6['shift']());}};_0xf45b24(++_0x2181e6);}(_0x61ea,0x1d5));var _0xa61e=function(_0x2f9695,_0x4f18a0){_0x2f9695=_0x2f9695-0x0;var _0x5e22aa=_0x61ea[_0x2f9695];return _0x5e22aa;};'use strict';var _=require(_0xa61e('0x0'));var util=require(_0xa61e('0x1'));var moment=require(_0xa61e('0x2'));var BPromise=require(_0xa61e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa61e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa61e('0x5'))('rpc');var config=require(_0xa61e('0x6'));var jayson=require(_0xa61e('0x7'));var client=jayson[_0xa61e('0x8')][_0xa61e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x300494,_0x1776c0,_0x6b0d76){return new BPromise(function(_0x178086,_0x1b5d56){return client['request'](_0x300494,_0x6b0d76)['then'](function(_0x54d595){logger[_0xa61e('0xa')](_0xa61e('0xb'),_0x1776c0,_0xa61e('0xc'));logger[_0xa61e('0xd')](_0xa61e('0xe'),_0x1776c0,_0xa61e('0xc'),JSON[_0xa61e('0xf')](_0x54d595));if(_0x54d595['error']){if(_0x54d595[_0xa61e('0x10')][_0xa61e('0x11')]===0x1f4){logger[_0xa61e('0x10')]('VtigerField,\x20%s,\x20%s',_0x1776c0,_0x54d595[_0xa61e('0x10')]['message']);return _0x1b5d56(_0x54d595['error'][_0xa61e('0x12')]);}logger[_0xa61e('0x10')](_0xa61e('0xb'),_0x1776c0,_0x54d595[_0xa61e('0x10')][_0xa61e('0x12')]);return _0x178086(_0x54d595['error'][_0xa61e('0x12')]);}else{logger[_0xa61e('0xa')]('VtigerField,\x20%s,\x20%s',_0x1776c0,_0xa61e('0xc'));_0x178086(_0x54d595[_0xa61e('0x13')][_0xa61e('0x12')]);}})[_0xa61e('0x14')](function(_0x2c13d7){logger[_0xa61e('0x10')](_0xa61e('0xb'),_0x1776c0,_0x2c13d7);_0x1b5d56(_0x2c13d7);});});} \ No newline at end of file +var _0x92df=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x34d346,_0x4c6502){var _0x122d76=function(_0x22a5fd){while(--_0x22a5fd){_0x34d346['push'](_0x34d346['shift']());}};_0x122d76(++_0x4c6502);}(_0x92df,0x106));var _0xf92d=function(_0x3b2853,_0x3464f6){_0x3b2853=_0x3b2853-0x0;var _0x3f3a72=_0x92df[_0x3b2853];return _0x3f3a72;};'use strict';var _=require(_0xf92d('0x0'));var util=require(_0xf92d('0x1'));var moment=require(_0xf92d('0x2'));var BPromise=require(_0xf92d('0x3'));var rs=require(_0xf92d('0x4'));var fs=require('fs');var Redis=require(_0xf92d('0x5'));var db=require(_0xf92d('0x6'))['db'];var utils=require(_0xf92d('0x7'));var logger=require(_0xf92d('0x8'))(_0xf92d('0x9'));var config=require('../../config/environment');var jayson=require(_0xf92d('0xa'));var client=jayson[_0xf92d('0xb')][_0xf92d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x140c97,_0x3b12c4,_0x2c9c3b){return new BPromise(function(_0x367d95,_0x4ce8c2){return client['request'](_0x140c97,_0x2c9c3b)['then'](function(_0x430755){logger[_0xf92d('0xd')](_0xf92d('0xe'),_0x3b12c4,_0xf92d('0xf'));logger[_0xf92d('0x10')](_0xf92d('0x11'),_0x3b12c4,'request\x20sent',JSON[_0xf92d('0x12')](_0x430755));if(_0x430755[_0xf92d('0x13')]){if(_0x430755['error'][_0xf92d('0x14')]===0x1f4){logger[_0xf92d('0x13')](_0xf92d('0xe'),_0x3b12c4,_0x430755[_0xf92d('0x13')]['message']);return _0x4ce8c2(_0x430755['error'][_0xf92d('0x15')]);}logger[_0xf92d('0x13')](_0xf92d('0xe'),_0x3b12c4,_0x430755['error'][_0xf92d('0x15')]);return _0x367d95(_0x430755[_0xf92d('0x13')][_0xf92d('0x15')]);}else{logger[_0xf92d('0xd')](_0xf92d('0xe'),_0x3b12c4,'request\x20sent');_0x367d95(_0x430755[_0xf92d('0x16')][_0xf92d('0x15')]);}})[_0xf92d('0x17')](function(_0x2a81db){logger[_0xf92d('0x13')](_0xf92d('0xe'),_0x3b12c4,_0x2a81db);_0x4ce8c2(_0x2a81db);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 44ebcf5..0dad246 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 _0xc3c2=['show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','get','isAuthenticated','/:id'];(function(_0x591a90,_0x5525b0){var _0x551587=function(_0xd6ad8e){while(--_0xd6ad8e){_0x591a90['push'](_0x591a90['shift']());}};_0x551587(++_0x5525b0);}(_0xc3c2,0x1bc));var _0x2c3c=function(_0x193f9d,_0x588b80){_0x193f9d=_0x193f9d-0x0;var _0x185c48=_0xc3c2[_0x193f9d];return _0x185c48;};'use strict';var multer=require(_0x2c3c('0x0'));var util=require(_0x2c3c('0x1'));var path=require('path');var timeout=require(_0x2c3c('0x2'));var express=require(_0x2c3c('0x3'));var router=express[_0x2c3c('0x4')]();var fs_extra=require(_0x2c3c('0x5'));var auth=require(_0x2c3c('0x6'));var interaction=require(_0x2c3c('0x7'));var config=require('../../config/environment');var controller=require(_0x2c3c('0x8'));router[_0x2c3c('0x9')]('/',auth[_0x2c3c('0xa')](),controller['index']);router[_0x2c3c('0x9')](_0x2c3c('0xb'),auth[_0x2c3c('0xa')](),controller[_0x2c3c('0xc')]);router['get'](_0x2c3c('0xd'),auth[_0x2c3c('0xa')](),controller[_0x2c3c('0xe')]);router[_0x2c3c('0x9')](_0x2c3c('0xf'),auth['isAuthenticated'](),controller[_0x2c3c('0x10')]);router[_0x2c3c('0x11')]('/',auth[_0x2c3c('0xa')](),controller[_0x2c3c('0x12')]);router[_0x2c3c('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x2c3c('0x13')]);router['put']('/:id',auth[_0x2c3c('0xa')](),controller[_0x2c3c('0x14')]);router[_0x2c3c('0x15')](_0x2c3c('0xb'),auth[_0x2c3c('0xa')](),controller[_0x2c3c('0x16')]);module[_0x2c3c('0x17')]=router; \ No newline at end of file +var _0xbabc=['get','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x17ffe5,_0x3a9ff6){var _0x933f79=function(_0xb22de5){while(--_0xb22de5){_0x17ffe5['push'](_0x17ffe5['shift']());}};_0x933f79(++_0x3a9ff6);}(_0xbabc,0x1da));var _0xcbab=function(_0x27654d,_0x3fe2e4){_0x27654d=_0x27654d-0x0;var _0x128d1d=_0xbabc[_0x27654d];return _0x128d1d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcbab('0x0'));var timeout=require(_0xcbab('0x1'));var express=require('express');var router=express[_0xcbab('0x2')]();var fs_extra=require(_0xcbab('0x3'));var auth=require(_0xcbab('0x4'));var interaction=require(_0xcbab('0x5'));var config=require(_0xcbab('0x6'));var controller=require('./intZendeskAccount.controller');router['get']('/',auth[_0xcbab('0x7')](),controller[_0xcbab('0x8')]);router[_0xcbab('0x9')](_0xcbab('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0xcbab('0xb'),auth[_0xcbab('0x7')](),controller[_0xcbab('0xc')]);router[_0xcbab('0x9')](_0xcbab('0xd'),auth[_0xcbab('0x7')](),controller[_0xcbab('0xe')]);router[_0xcbab('0xf')]('/',auth[_0xcbab('0x7')](),controller[_0xcbab('0x10')]);router[_0xcbab('0xf')]('/:id/configurations',auth[_0xcbab('0x7')](),controller[_0xcbab('0x11')]);router['put']('/:id',auth[_0xcbab('0x7')](),controller['update']);router[_0xcbab('0x12')](_0xcbab('0xa'),auth[_0xcbab('0x7')](),controller[_0xcbab('0x13')]);module[_0xcbab('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index b18fcc6..6681e97 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 _0x975b=['username','remoteUri','ENUM','password','token','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x2bc550,_0x26720d){var _0x46e3ec=function(_0x553288){while(--_0x553288){_0x2bc550['push'](_0x2bc550['shift']());}};_0x46e3ec(++_0x26720d);}(_0x975b,0x1c9));var _0xb975=function(_0x44bd9e,_0xe3c284){_0x44bd9e=_0x44bd9e-0x0;var _0x263284=_0x975b[_0x44bd9e];return _0x263284;};'use strict';var Sequelize=require(_0xb975('0x0'));module[_0xb975('0x1')]={'name':{'type':Sequelize[_0xb975('0x2')]},'description':{'type':Sequelize[_0xb975('0x2')]},'username':{'type':Sequelize[_0xb975('0x2')],'unique':_0xb975('0x3')},'password':{'type':Sequelize[_0xb975('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xb975('0x2')],'unique':_0xb975('0x4')},'authType':{'type':Sequelize[_0xb975('0x5')](_0xb975('0x6'),_0xb975('0x7')),'defaultValue':_0xb975('0x6')},'serverUrl':{'type':Sequelize[_0xb975('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xb975('0x8'),_0xb975('0x9')),'defaultValue':_0xb975('0x8')}}; \ No newline at end of file +var _0x41ec=['integrationTab','exports','STRING','remoteUri','ENUM','password','token'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x41ec,0x143));var _0xc41e=function(_0x5c8d16,_0x52f604){_0x5c8d16=_0x5c8d16-0x0;var _0x3f51c7=_0x41ec[_0x5c8d16];return _0x3f51c7;};'use strict';var Sequelize=require('sequelize');module[_0xc41e('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc41e('0x1')]},'username':{'type':Sequelize[_0xc41e('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xc41e('0x1')]},'token':{'type':Sequelize[_0xc41e('0x1')]},'remoteUri':{'type':Sequelize[_0xc41e('0x1')],'unique':_0xc41e('0x2')},'authType':{'type':Sequelize[_0xc41e('0x3')](_0xc41e('0x4'),_0xc41e('0x5')),'defaultValue':_0xc41e('0x4')},'serverUrl':{'type':Sequelize[_0xc41e('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xc41e('0x3')](_0xc41e('0x6'),'newTab'),'defaultValue':_0xc41e('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 7b377f6..42fc071 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 _0x1d2d=['position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','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/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','update','then','destroy','error','stack','send','index','ZendeskAccount','rawAttributes','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','order','sort','where','merge','filter','options','findAll','catch','includeAll','find','create','body','params','getConfigurations','ZendeskConfiguration','hasOwnProperty','findOne','AccountId','Subjects','getSubjects','channel','ZendeskField','Descriptions','username','token','substring','lastIndexOf','GET','format','%s/%s','authType','password','headers','Basic\x20%s','%s:%s','toString','%s/token:%s','base64','Sequelize','subject','description','group','assignee','ticket_fields','includes'];(function(_0xdcbfc3,_0x406f89){var _0x4d86c7=function(_0x66cd8f){while(--_0x66cd8f){_0xdcbfc3['push'](_0xdcbfc3['shift']());}};_0x4d86c7(++_0x406f89);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x50d61f,_0x156538){_0x50d61f=_0x50d61f-0x0;var _0x52f88b=_0x1d2d[_0x50d61f];return _0x52f88b;};'use strict';var emlformat=require(_0xd1d2('0x0'));var rimraf=require(_0xd1d2('0x1'));var zipdir=require(_0xd1d2('0x2'));var jsonpatch=require(_0xd1d2('0x3'));var rp=require(_0xd1d2('0x4'));var moment=require('moment');var BPromise=require(_0xd1d2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd1d2('0x6'));var sox=require(_0xd1d2('0x7'));var csv=require(_0xd1d2('0x8'));var ejs=require(_0xd1d2('0x9'));var fs=require('fs');var fs_extra=require(_0xd1d2('0xa'));var _=require(_0xd1d2('0xb'));var squel=require('squel');var crypto=require(_0xd1d2('0xc'));var jsforce=require(_0xd1d2('0xd'));var deskjs=require(_0xd1d2('0xe'));var toCsv=require(_0xd1d2('0x8'));var querystring=require(_0xd1d2('0xf'));var Papa=require(_0xd1d2('0x10'));var Redis=require(_0xd1d2('0x11'));var authService=require(_0xd1d2('0x12'));var qs=require(_0xd1d2('0x13'));var as=require(_0xd1d2('0x14'));var hardwareService=require(_0xd1d2('0x15'));var logger=require(_0xd1d2('0x16'))(_0xd1d2('0x17'));var utils=require('../../config/utils');var config=require(_0xd1d2('0x18'));var licenseUtil=require(_0xd1d2('0x19'));var db=require(_0xd1d2('0x1a'))['db'];var integrations=require(_0xd1d2('0x1b'));function respondWithStatusCode(_0x129d8f,_0xc3ee82){_0xc3ee82=_0xc3ee82||0xcc;return function(_0x2df8a5){if(_0x2df8a5){return _0x129d8f[_0xd1d2('0x1c')](_0xc3ee82);}return _0x129d8f[_0xd1d2('0x1d')](_0xc3ee82)[_0xd1d2('0x1e')]();};}function respondWithResult(_0x4cf702,_0x2e7fec){_0x2e7fec=_0x2e7fec||0xc8;return function(_0x3c0296){if(_0x3c0296){return _0x4cf702[_0xd1d2('0x1d')](_0x2e7fec)['json'](_0x3c0296);}};}function respondWithFilteredResult(_0x35381b,_0xc36ce){return function(_0x208425){if(_0x208425){var _0x2f4cf9=typeof _0xc36ce[_0xd1d2('0x1f')]===_0xd1d2('0x20')&&typeof _0xc36ce[_0xd1d2('0x21')]==='undefined';var _0x539d5a=_0x208425[_0xd1d2('0x22')];var _0x55320b=_0x2f4cf9?0x0:_0xc36ce[_0xd1d2('0x1f')];var _0x42565b=_0x2f4cf9?_0x208425[_0xd1d2('0x22')]:_0xc36ce[_0xd1d2('0x1f')]+_0xc36ce['limit'];var _0x4f1201;if(_0x42565b>=_0x539d5a){_0x42565b=_0x539d5a;_0x4f1201=0xc8;}else{_0x4f1201=0xce;}_0x35381b[_0xd1d2('0x1d')](_0x4f1201);return _0x35381b['set']('Content-Range',_0x55320b+'-'+_0x42565b+'/'+_0x539d5a)[_0xd1d2('0x23')](_0x208425);}return null;};}function patchUpdates(_0x27e26b){return function(_0x3414ce){try{jsonpatch[_0xd1d2('0x24')](_0x3414ce,_0x27e26b,!![]);}catch(_0x596cd8){return BPromise[_0xd1d2('0x25')](_0x596cd8);}return _0x3414ce[_0xd1d2('0x26')]();};}function saveUpdates(_0x24b8db,_0x4eb082){return function(_0x59e72c){if(_0x59e72c){return _0x59e72c[_0xd1d2('0x27')](_0x24b8db)[_0xd1d2('0x28')](function(_0x19d535){return _0x19d535;});}return null;};}function removeEntity(_0x2f92ee,_0x3f229c){return function(_0x33a171){if(_0x33a171){return _0x33a171[_0xd1d2('0x29')]()['then'](function(){_0x2f92ee[_0xd1d2('0x1d')](0xcc)[_0xd1d2('0x1e')]();});}};}function handleEntityNotFound(_0x41330f,_0x2e1709){return function(_0x5d3ee1){if(!_0x5d3ee1){_0x41330f[_0xd1d2('0x1c')](0x194);}return _0x5d3ee1;};}function handleError(_0x28b8be,_0x34faf7){_0x34faf7=_0x34faf7||0x1f4;return function(_0xe6ef3c){logger[_0xd1d2('0x2a')](_0xe6ef3c[_0xd1d2('0x2b')]);if(_0xe6ef3c['name']){delete _0xe6ef3c['name'];}_0x28b8be[_0xd1d2('0x1d')](_0x34faf7)[_0xd1d2('0x2c')](_0xe6ef3c);};}exports[_0xd1d2('0x2d')]=function(_0x2b4c1f,_0xc815ea){var _0x48ade1={},_0x39d694={},_0x41171c={'count':0x0,'rows':[]};var _0x383947=_['map'](db[_0xd1d2('0x2e')][_0xd1d2('0x2f')],function(_0xbd855a){return{'name':_0xbd855a['fieldName'],'type':_0xbd855a[_0xd1d2('0x30')][_0xd1d2('0x31')]};});_0x39d694[_0xd1d2('0x32')]=_[_0xd1d2('0x33')](_0x383947,_0xd1d2('0x34'));_0x39d694[_0xd1d2('0x35')]=_[_0xd1d2('0x36')](_0x2b4c1f[_0xd1d2('0x35')]);_0x39d694[_0xd1d2('0x37')]=_[_0xd1d2('0x38')](_0x39d694[_0xd1d2('0x32')],_0x39d694[_0xd1d2('0x35')]);_0x48ade1[_0xd1d2('0x39')]=_[_0xd1d2('0x38')](_0x39d694[_0xd1d2('0x32')],qs[_0xd1d2('0x3a')](_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x3a')]));_0x48ade1['attributes']=_0x48ade1[_0xd1d2('0x39')][_0xd1d2('0x3b')]?_0x48ade1[_0xd1d2('0x39')]:_0x39d694['model'];if(!_0x2b4c1f[_0xd1d2('0x35')]['hasOwnProperty']('nolimit')){_0x48ade1[_0xd1d2('0x21')]=qs[_0xd1d2('0x21')](_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x21')]);_0x48ade1[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0x2b4c1f['query'][_0xd1d2('0x1f')]);}_0x48ade1[_0xd1d2('0x3c')]=qs['sort'](_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x3d')]);_0x48ade1[_0xd1d2('0x3e')]=qs[_0xd1d2('0x37')](_['pick'](_0x2b4c1f['query'],_0x39d694[_0xd1d2('0x37')]),_0x383947);if(_0x2b4c1f['query']['filter']){_0x48ade1['where']=_[_0xd1d2('0x3f')](_0x48ade1['where'],{'$or':_[_0xd1d2('0x33')](_0x383947,function(_0x4e7640){if(_0x4e7640['type']!=='VIRTUAL'){var _0x2dabfa={};_0x2dabfa[_0x4e7640[_0xd1d2('0x34')]]={'$like':'%'+_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x40')]+'%'};return _0x2dabfa;}})});}_0x48ade1=_[_0xd1d2('0x3f')]({},_0x48ade1,_0x2b4c1f[_0xd1d2('0x41')]);var _0x178f8b={'where':_0x48ade1[_0xd1d2('0x3e')]};return db[_0xd1d2('0x2e')][_0xd1d2('0x22')](_0x178f8b)[_0xd1d2('0x28')](function(_0x1fb5b5){_0x41171c[_0xd1d2('0x22')]=_0x1fb5b5;if(_0x2b4c1f[_0xd1d2('0x35')]['includeAll']){_0x48ade1['include']=[{'all':!![]}];}return db[_0xd1d2('0x2e')][_0xd1d2('0x42')](_0x48ade1);})[_0xd1d2('0x28')](function(_0x4d0fd9){_0x41171c['rows']=_0x4d0fd9;return _0x41171c;})[_0xd1d2('0x28')](respondWithFilteredResult(_0xc815ea,_0x48ade1))[_0xd1d2('0x43')](handleError(_0xc815ea,null));};exports['show']=function(_0x2fe92a,_0x4c5d49){var _0x5a3790={'raw':![],'where':{'id':_0x2fe92a['params']['id']}},_0x21eb24={};_0x21eb24['model']=_[_0xd1d2('0x36')](db[_0xd1d2('0x2e')][_0xd1d2('0x2f')]);_0x21eb24['query']=_[_0xd1d2('0x36')](_0x2fe92a[_0xd1d2('0x35')]);_0x21eb24[_0xd1d2('0x37')]=_[_0xd1d2('0x38')](_0x21eb24['model'],_0x21eb24[_0xd1d2('0x35')]);_0x5a3790[_0xd1d2('0x39')]=_['intersection'](_0x21eb24[_0xd1d2('0x32')],qs['fields'](_0x2fe92a[_0xd1d2('0x35')][_0xd1d2('0x3a')]));_0x5a3790[_0xd1d2('0x39')]=_0x5a3790[_0xd1d2('0x39')][_0xd1d2('0x3b')]?_0x5a3790['attributes']:_0x21eb24['model'];if(_0x2fe92a[_0xd1d2('0x35')][_0xd1d2('0x44')]){_0x5a3790['include']=[{'all':!![]}];}_0x5a3790=_[_0xd1d2('0x3f')]({},_0x5a3790,_0x2fe92a[_0xd1d2('0x41')]);return db[_0xd1d2('0x2e')][_0xd1d2('0x45')](_0x5a3790)[_0xd1d2('0x28')](handleEntityNotFound(_0x4c5d49,null))[_0xd1d2('0x28')](respondWithResult(_0x4c5d49,null))[_0xd1d2('0x43')](handleError(_0x4c5d49,null));};exports['create']=function(_0xed9e9,_0xc10c10){return db['ZendeskAccount'][_0xd1d2('0x46')](_0xed9e9[_0xd1d2('0x47')],{})['then'](respondWithResult(_0xc10c10,0xc9))['catch'](handleError(_0xc10c10,null));};exports[_0xd1d2('0x27')]=function(_0x182ea8,_0x4cb376){if(_0x182ea8[_0xd1d2('0x47')]['id']){delete _0x182ea8[_0xd1d2('0x47')]['id'];}return db[_0xd1d2('0x2e')][_0xd1d2('0x45')]({'where':{'id':_0x182ea8[_0xd1d2('0x48')]['id']}})['then'](handleEntityNotFound(_0x4cb376,null))['then'](saveUpdates(_0x182ea8[_0xd1d2('0x47')],null))['then'](respondWithResult(_0x4cb376,null))[_0xd1d2('0x43')](handleError(_0x4cb376,null));};exports[_0xd1d2('0x29')]=function(_0x4f4cb9,_0x389fcb){return db[_0xd1d2('0x2e')]['find']({'where':{'id':_0x4f4cb9['params']['id']}})[_0xd1d2('0x28')](handleEntityNotFound(_0x389fcb,null))[_0xd1d2('0x28')](removeEntity(_0x389fcb,null))[_0xd1d2('0x43')](handleError(_0x389fcb,null));};exports[_0xd1d2('0x49')]=function(_0xa013ce,_0x34a793,_0x1f6150){var _0x3411c8={};var _0x33e332={};var _0x5e15cb;var _0x1958f3;return db['ZendeskAccount']['findOne']({'where':{'id':_0xa013ce[_0xd1d2('0x48')]['id']}})[_0xd1d2('0x28')](handleEntityNotFound(_0x34a793,null))[_0xd1d2('0x28')](function(_0x47417f){if(_0x47417f){_0x5e15cb=_0x47417f;_0x33e332[_0xd1d2('0x32')]=_[_0xd1d2('0x36')](db[_0xd1d2('0x4a')][_0xd1d2('0x2f')]);_0x33e332[_0xd1d2('0x35')]=_[_0xd1d2('0x36')](_0xa013ce[_0xd1d2('0x35')]);_0x33e332[_0xd1d2('0x37')]=_[_0xd1d2('0x38')](_0x33e332['model'],_0x33e332['query']);_0x3411c8[_0xd1d2('0x39')]=_[_0xd1d2('0x38')](_0x33e332[_0xd1d2('0x32')],qs[_0xd1d2('0x3a')](_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x3a')]));_0x3411c8[_0xd1d2('0x39')]=_0x3411c8[_0xd1d2('0x39')][_0xd1d2('0x3b')]?_0x3411c8[_0xd1d2('0x39')]:_0x33e332[_0xd1d2('0x32')];_0x3411c8['order']=qs['sort'](_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x3d')]);_0x3411c8[_0xd1d2('0x3e')]=qs[_0xd1d2('0x37')](_['pick'](_0xa013ce[_0xd1d2('0x35')],_0x33e332[_0xd1d2('0x37')]));if(_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x40')]){_0x3411c8[_0xd1d2('0x3e')]=_[_0xd1d2('0x3f')](_0x3411c8[_0xd1d2('0x3e')],{'$or':_['map'](_0x3411c8[_0xd1d2('0x39')],function(_0x24d92c){var _0x1d8788={};_0x1d8788[_0x24d92c]={'$like':'%'+_0xa013ce['query']['filter']+'%'};return _0x1d8788;})});}_0x3411c8=_[_0xd1d2('0x3f')]({},_0x3411c8,_0xa013ce[_0xd1d2('0x41')]);return _0x5e15cb[_0xd1d2('0x49')](_0x3411c8);}})[_0xd1d2('0x28')](function(_0x598e6c){if(_0x598e6c){_0x1958f3=_0x598e6c[_0xd1d2('0x3b')];if(!_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x4b')]('nolimit')){_0x3411c8[_0xd1d2('0x21')]=qs[_0xd1d2('0x21')](_0xa013ce['query'][_0xd1d2('0x21')]);_0x3411c8[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0xa013ce[_0xd1d2('0x35')]['offset']);}return _0x5e15cb[_0xd1d2('0x49')](_0x3411c8);}})[_0xd1d2('0x28')](function(_0xd82d10){if(_0xd82d10){return _0xd82d10?{'count':_0x1958f3,'rows':_0xd82d10}:null;}})[_0xd1d2('0x28')](respondWithResult(_0x34a793,null))[_0xd1d2('0x43')](handleError(_0x34a793,null));};exports['addConfiguration']=function(_0x47aa13,_0x500465,_0x541676){if(_0x47aa13['body']['id']){delete _0x47aa13[_0xd1d2('0x47')]['id'];}return db[_0xd1d2('0x2e')][_0xd1d2('0x4c')]({'where':{'id':_0x47aa13['params']['id']}})[_0xd1d2('0x28')](handleEntityNotFound(_0x500465,null))[_0xd1d2('0x28')](function(_0x22d617){if(_0x22d617){_0x47aa13['body'][_0xd1d2('0x4d')]=_0x22d617['id'];_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x4e')]=integrations[_0xd1d2('0x4f')](_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x50')],_0x47aa13['body'][_0xd1d2('0x30')]);_0x47aa13[_0xd1d2('0x47')]['Descriptions']=integrations['getDescriptions'](_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x50')],_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x30')]);return db['ZendeskConfiguration'][_0xd1d2('0x46')](_0x47aa13[_0xd1d2('0x47')],{'include':[{'model':db[_0xd1d2('0x51')],'as':_0xd1d2('0x4e')},{'model':db['ZendeskField'],'as':_0xd1d2('0x52')}]});}return null;})[_0xd1d2('0x28')](respondWithResult(_0x500465,null))[_0xd1d2('0x43')](handleError(_0x500465,null));};exports['getFields']=function(_0x46ff4d,_0x1ae9af,_0x4c35cb){var _0x2175ab='';return db[_0xd1d2('0x2e')][_0xd1d2('0x4c')]({'where':{'id':_0x46ff4d[_0xd1d2('0x48')]['id']},'attributes':['id',_0xd1d2('0x53'),'password',_0xd1d2('0x54'),'authType','remoteUri']})['then'](handleEntityNotFound(_0x1ae9af,null))['then'](function(_0x89ec63){if(_0x89ec63){_0x2175ab=_0x89ec63['remoteUri'];var _0x37591f=_0x2175ab['slice'](-0x1);if(_0x37591f==='/'){_0x2175ab=_0x2175ab[_0xd1d2('0x55')](0x0,_0x2175ab[_0xd1d2('0x56')](_0x37591f));}var _0x16cc6c={'method':_0xd1d2('0x57'),'uri':util[_0xd1d2('0x58')](_0xd1d2('0x59'),_0x2175ab,'ticket_fields'),'json':!![]};switch(_0x89ec63[_0xd1d2('0x5a')]){case _0xd1d2('0x5b'):_0x16cc6c[_0xd1d2('0x5c')]={'Authorization':util[_0xd1d2('0x58')](_0xd1d2('0x5d'),new Buffer(util[_0xd1d2('0x58')](_0xd1d2('0x5e'),_0x89ec63[_0xd1d2('0x53')],_0x89ec63[_0xd1d2('0x5b')]))[_0xd1d2('0x5f')]('base64'))};break;case _0xd1d2('0x54'):_0x16cc6c[_0xd1d2('0x5c')]={'Authorization':util[_0xd1d2('0x58')](_0xd1d2('0x5d'),new Buffer(util['format'](_0xd1d2('0x60'),_0x89ec63[_0xd1d2('0x53')],_0x89ec63[_0xd1d2('0x54')]))['toString'](_0xd1d2('0x61')))};break;default:throw new db[(_0xd1d2('0x62'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0x16cc6c);}})[_0xd1d2('0x28')](function(_0x268d6d){if(_0x268d6d){var _0x3fbd87=[_0xd1d2('0x63'),_0xd1d2('0x64'),_0xd1d2('0x65'),_0xd1d2('0x66')];_['remove'](_0x268d6d[_0xd1d2('0x67')],function(_0x9a98d4){return _0x3fbd87[_0xd1d2('0x68')](_0x9a98d4[_0xd1d2('0x30')]);});return{'count':_0x268d6d[_0xd1d2('0x67')][_0xd1d2('0x3b')],'rows':_[_0xd1d2('0x33')](_0x268d6d[_0xd1d2('0x67')],function(_0x44409e){return{'id':_0x44409e['id'],'name':_0x44409e[_0xd1d2('0x69')]>0x7?_0x44409e[_0xd1d2('0x6a')]:_0x44409e[_0xd1d2('0x30')],'custom':_0x44409e[_0xd1d2('0x69')]>0x7?!![]:![],'options':_0x44409e[_0xd1d2('0x6b')]?_0x44409e['system_field_options']:_0x44409e[_0xd1d2('0x6c')]?_0x44409e[_0xd1d2('0x6c')]:[]};})};}})[_0xd1d2('0x28')](respondWithResult(_0x1ae9af,null))[_0xd1d2('0x43')](function(_0x20a3f0){var _0x32c294=_0x46ff4d[_0xd1d2('0x35')][_0xd1d2('0x6d')]?0x1f4:_0x20a3f0[_0xd1d2('0x6e')]||0x1f4;logger[_0xd1d2('0x2a')](_0xd1d2('0x6f'),_0xd1d2('0x70'),_0x32c294,JSON[_0xd1d2('0x71')](_0x20a3f0));delete _0x20a3f0['name'];if(_0x32c294===0x191){_0x32c294=0x190;}_0x1ae9af[_0xd1d2('0x1d')](_0x32c294)[_0xd1d2('0x2c')](_0x46ff4d[_0xd1d2('0x35')][_0xd1d2('0x6d')]?{'message':_0xd1d2('0x72'),'statusCode':_0x20a3f0[_0xd1d2('0x6e')]}:_0x20a3f0);});}; \ No newline at end of file +var _0x5eb8=['sort','where','filter','merge','type','options','includeAll','findAll','catch','show','params','keys','length','include','find','create','body','update','getConfigurations','findOne','ZendeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','format','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','remove','includes','title','position','system_field_options','custom_field_options','send','Wrong\x20credentials','statusCode','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','then','sendStatus','error','stack','name','map','ZendeskAccount','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0x553150,_0x589ff3){var _0x18193d=function(_0x3a5ae6){while(--_0x3a5ae6){_0x553150['push'](_0x553150['shift']());}};_0x18193d(++_0x589ff3);}(_0x5eb8,0xb0));var _0x85eb=function(_0xa30766,_0x6f613e){_0xa30766=_0xa30766-0x0;var _0x24e780=_0x5eb8[_0xa30766];return _0x24e780;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x85eb('0x0'));var jsonpatch=require(_0x85eb('0x1'));var rp=require(_0x85eb('0x2'));var moment=require(_0x85eb('0x3'));var BPromise=require(_0x85eb('0x4'));var Mustache=require(_0x85eb('0x5'));var util=require(_0x85eb('0x6'));var path=require(_0x85eb('0x7'));var sox=require(_0x85eb('0x8'));var csv=require(_0x85eb('0x9'));var ejs=require(_0x85eb('0xa'));var fs=require('fs');var fs_extra=require(_0x85eb('0xb'));var _=require('lodash');var squel=require(_0x85eb('0xc'));var crypto=require(_0x85eb('0xd'));var jsforce=require(_0x85eb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85eb('0x9'));var querystring=require('querystring');var Papa=require(_0x85eb('0xf'));var Redis=require(_0x85eb('0x10'));var authService=require(_0x85eb('0x11'));var qs=require(_0x85eb('0x12'));var as=require(_0x85eb('0x13'));var hardwareService=require(_0x85eb('0x14'));var logger=require(_0x85eb('0x15'))('api');var utils=require(_0x85eb('0x16'));var config=require(_0x85eb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x85eb('0x18'))['db'];var integrations=require(_0x85eb('0x19'));function respondWithStatusCode(_0x2f42ba,_0x259f72){_0x259f72=_0x259f72||0xcc;return function(_0x4db167){if(_0x4db167){return _0x2f42ba['sendStatus'](_0x259f72);}return _0x2f42ba[_0x85eb('0x1a')](_0x259f72)['end']();};}function respondWithResult(_0x18ca53,_0x23a82a){_0x23a82a=_0x23a82a||0xc8;return function(_0x600a7f){if(_0x600a7f){return _0x18ca53[_0x85eb('0x1a')](_0x23a82a)[_0x85eb('0x1b')](_0x600a7f);}};}function respondWithFilteredResult(_0x49efdf,_0x2e5c0a){return function(_0x59237b){if(_0x59237b){var _0x17140b=typeof _0x2e5c0a[_0x85eb('0x1c')]===_0x85eb('0x1d')&&typeof _0x2e5c0a[_0x85eb('0x1e')]==='undefined';var _0x5c5cbb=_0x59237b['count'];var _0xe198ca=_0x17140b?0x0:_0x2e5c0a[_0x85eb('0x1c')];var _0x10cf2f=_0x17140b?_0x59237b[_0x85eb('0x1f')]:_0x2e5c0a[_0x85eb('0x1c')]+_0x2e5c0a[_0x85eb('0x1e')];var _0x5acd3d;if(_0x10cf2f>=_0x5c5cbb){_0x10cf2f=_0x5c5cbb;_0x5acd3d=0xc8;}else{_0x5acd3d=0xce;}_0x49efdf[_0x85eb('0x1a')](_0x5acd3d);return _0x49efdf[_0x85eb('0x20')](_0x85eb('0x21'),_0xe198ca+'-'+_0x10cf2f+'/'+_0x5c5cbb)['json'](_0x59237b);}return null;};}function patchUpdates(_0x4b4b38){return function(_0x48bd86){try{jsonpatch['apply'](_0x48bd86,_0x4b4b38,!![]);}catch(_0x244667){return BPromise[_0x85eb('0x22')](_0x244667);}return _0x48bd86[_0x85eb('0x23')]();};}function saveUpdates(_0x255ca7,_0x465c74){return function(_0x3fc6da){if(_0x3fc6da){return _0x3fc6da['update'](_0x255ca7)['then'](function(_0x5b48d9){return _0x5b48d9;});}return null;};}function removeEntity(_0x298e84,_0x1426c8){return function(_0x3f7a4d){if(_0x3f7a4d){return _0x3f7a4d[_0x85eb('0x24')]()[_0x85eb('0x25')](function(){_0x298e84[_0x85eb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39d3fe,_0x3453cd){return function(_0x4709ad){if(!_0x4709ad){_0x39d3fe[_0x85eb('0x26')](0x194);}return _0x4709ad;};}function handleError(_0x3e2326,_0x57a03c){_0x57a03c=_0x57a03c||0x1f4;return function(_0x2e5aa3){logger[_0x85eb('0x27')](_0x2e5aa3[_0x85eb('0x28')]);if(_0x2e5aa3[_0x85eb('0x29')]){delete _0x2e5aa3[_0x85eb('0x29')];}_0x3e2326[_0x85eb('0x1a')](_0x57a03c)['send'](_0x2e5aa3);};}exports['index']=function(_0x37515c,_0x585f2a){var _0xa9b14f={},_0x5255eb={},_0x4229e9={'count':0x0,'rows':[]};var _0x3570f7=_[_0x85eb('0x2a')](db[_0x85eb('0x2b')][_0x85eb('0x2c')],function(_0xf4ac13){return{'name':_0xf4ac13[_0x85eb('0x2d')],'type':_0xf4ac13['type'][_0x85eb('0x2e')]};});_0x5255eb[_0x85eb('0x2f')]=_['map'](_0x3570f7,_0x85eb('0x29'));_0x5255eb['query']=_['keys'](_0x37515c[_0x85eb('0x30')]);_0x5255eb[_0x85eb('0x31')]=_[_0x85eb('0x32')](_0x5255eb[_0x85eb('0x2f')],_0x5255eb[_0x85eb('0x30')]);_0xa9b14f[_0x85eb('0x33')]=_[_0x85eb('0x32')](_0x5255eb[_0x85eb('0x2f')],qs[_0x85eb('0x34')](_0x37515c[_0x85eb('0x30')]['fields']));_0xa9b14f[_0x85eb('0x33')]=_0xa9b14f[_0x85eb('0x33')]['length']?_0xa9b14f['attributes']:_0x5255eb[_0x85eb('0x2f')];if(!_0x37515c[_0x85eb('0x30')][_0x85eb('0x35')](_0x85eb('0x36'))){_0xa9b14f[_0x85eb('0x1e')]=qs[_0x85eb('0x1e')](_0x37515c[_0x85eb('0x30')][_0x85eb('0x1e')]);_0xa9b14f[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x37515c[_0x85eb('0x30')][_0x85eb('0x1c')]);}_0xa9b14f[_0x85eb('0x37')]=qs[_0x85eb('0x38')](_0x37515c['query'][_0x85eb('0x38')]);_0xa9b14f[_0x85eb('0x39')]=qs['filters'](_['pick'](_0x37515c[_0x85eb('0x30')],_0x5255eb[_0x85eb('0x31')]),_0x3570f7);if(_0x37515c['query'][_0x85eb('0x3a')]){_0xa9b14f['where']=_[_0x85eb('0x3b')](_0xa9b14f['where'],{'$or':_[_0x85eb('0x2a')](_0x3570f7,function(_0x5ce7e4){if(_0x5ce7e4[_0x85eb('0x3c')]!=='VIRTUAL'){var _0x38ab0f={};_0x38ab0f[_0x5ce7e4[_0x85eb('0x29')]]={'$like':'%'+_0x37515c['query'][_0x85eb('0x3a')]+'%'};return _0x38ab0f;}})});}_0xa9b14f=_['merge']({},_0xa9b14f,_0x37515c[_0x85eb('0x3d')]);var _0x331260={'where':_0xa9b14f['where']};return db[_0x85eb('0x2b')]['count'](_0x331260)['then'](function(_0x1b8a71){_0x4229e9['count']=_0x1b8a71;if(_0x37515c[_0x85eb('0x30')][_0x85eb('0x3e')]){_0xa9b14f['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0x85eb('0x3f')](_0xa9b14f);})[_0x85eb('0x25')](function(_0x48160e){_0x4229e9['rows']=_0x48160e;return _0x4229e9;})[_0x85eb('0x25')](respondWithFilteredResult(_0x585f2a,_0xa9b14f))[_0x85eb('0x40')](handleError(_0x585f2a,null));};exports[_0x85eb('0x41')]=function(_0x202681,_0x3be961){var _0x5b7411={'raw':![],'where':{'id':_0x202681[_0x85eb('0x42')]['id']}},_0x5ccf8a={};_0x5ccf8a[_0x85eb('0x2f')]=_[_0x85eb('0x43')](db[_0x85eb('0x2b')][_0x85eb('0x2c')]);_0x5ccf8a[_0x85eb('0x30')]=_[_0x85eb('0x43')](_0x202681[_0x85eb('0x30')]);_0x5ccf8a['filters']=_[_0x85eb('0x32')](_0x5ccf8a[_0x85eb('0x2f')],_0x5ccf8a['query']);_0x5b7411[_0x85eb('0x33')]=_[_0x85eb('0x32')](_0x5ccf8a[_0x85eb('0x2f')],qs[_0x85eb('0x34')](_0x202681[_0x85eb('0x30')][_0x85eb('0x34')]));_0x5b7411['attributes']=_0x5b7411[_0x85eb('0x33')][_0x85eb('0x44')]?_0x5b7411[_0x85eb('0x33')]:_0x5ccf8a[_0x85eb('0x2f')];if(_0x202681[_0x85eb('0x30')][_0x85eb('0x3e')]){_0x5b7411[_0x85eb('0x45')]=[{'all':!![]}];}_0x5b7411=_[_0x85eb('0x3b')]({},_0x5b7411,_0x202681['options']);return db[_0x85eb('0x2b')][_0x85eb('0x46')](_0x5b7411)[_0x85eb('0x25')](handleEntityNotFound(_0x3be961,null))[_0x85eb('0x25')](respondWithResult(_0x3be961,null))[_0x85eb('0x40')](handleError(_0x3be961,null));};exports[_0x85eb('0x47')]=function(_0x3c387a,_0x77fdc4){return db[_0x85eb('0x2b')][_0x85eb('0x47')](_0x3c387a[_0x85eb('0x48')],{})[_0x85eb('0x25')](respondWithResult(_0x77fdc4,0xc9))['catch'](handleError(_0x77fdc4,null));};exports[_0x85eb('0x49')]=function(_0x2c951b,_0x22d9d6){if(_0x2c951b['body']['id']){delete _0x2c951b[_0x85eb('0x48')]['id'];}return db[_0x85eb('0x2b')][_0x85eb('0x46')]({'where':{'id':_0x2c951b[_0x85eb('0x42')]['id']}})[_0x85eb('0x25')](handleEntityNotFound(_0x22d9d6,null))['then'](saveUpdates(_0x2c951b[_0x85eb('0x48')],null))[_0x85eb('0x25')](respondWithResult(_0x22d9d6,null))[_0x85eb('0x40')](handleError(_0x22d9d6,null));};exports['destroy']=function(_0xc5cb43,_0x4550fd){return db[_0x85eb('0x2b')]['find']({'where':{'id':_0xc5cb43['params']['id']}})[_0x85eb('0x25')](handleEntityNotFound(_0x4550fd,null))['then'](removeEntity(_0x4550fd,null))['catch'](handleError(_0x4550fd,null));};exports[_0x85eb('0x4a')]=function(_0x593723,_0x39316d,_0xfb0ac){var _0x4e3d96={};var _0x4abe5e={};var _0x27ce2a;var _0x249511;return db[_0x85eb('0x2b')][_0x85eb('0x4b')]({'where':{'id':_0x593723[_0x85eb('0x42')]['id']}})['then'](handleEntityNotFound(_0x39316d,null))[_0x85eb('0x25')](function(_0x30062e){if(_0x30062e){_0x27ce2a=_0x30062e;_0x4abe5e[_0x85eb('0x2f')]=_[_0x85eb('0x43')](db[_0x85eb('0x4c')]['rawAttributes']);_0x4abe5e[_0x85eb('0x30')]=_['keys'](_0x593723[_0x85eb('0x30')]);_0x4abe5e[_0x85eb('0x31')]=_['intersection'](_0x4abe5e[_0x85eb('0x2f')],_0x4abe5e[_0x85eb('0x30')]);_0x4e3d96[_0x85eb('0x33')]=_[_0x85eb('0x32')](_0x4abe5e[_0x85eb('0x2f')],qs[_0x85eb('0x34')](_0x593723['query'][_0x85eb('0x34')]));_0x4e3d96['attributes']=_0x4e3d96[_0x85eb('0x33')][_0x85eb('0x44')]?_0x4e3d96['attributes']:_0x4abe5e[_0x85eb('0x2f')];_0x4e3d96[_0x85eb('0x37')]=qs['sort'](_0x593723[_0x85eb('0x30')]['sort']);_0x4e3d96[_0x85eb('0x39')]=qs[_0x85eb('0x31')](_[_0x85eb('0x4d')](_0x593723[_0x85eb('0x30')],_0x4abe5e[_0x85eb('0x31')]));if(_0x593723[_0x85eb('0x30')]['filter']){_0x4e3d96[_0x85eb('0x39')]=_[_0x85eb('0x3b')](_0x4e3d96[_0x85eb('0x39')],{'$or':_[_0x85eb('0x2a')](_0x4e3d96[_0x85eb('0x33')],function(_0x1529dd){var _0x2024df={};_0x2024df[_0x1529dd]={'$like':'%'+_0x593723[_0x85eb('0x30')][_0x85eb('0x3a')]+'%'};return _0x2024df;})});}_0x4e3d96=_[_0x85eb('0x3b')]({},_0x4e3d96,_0x593723[_0x85eb('0x3d')]);return _0x27ce2a['getConfigurations'](_0x4e3d96);}})[_0x85eb('0x25')](function(_0x21b873){if(_0x21b873){_0x249511=_0x21b873[_0x85eb('0x44')];if(!_0x593723[_0x85eb('0x30')][_0x85eb('0x35')](_0x85eb('0x36'))){_0x4e3d96['limit']=qs[_0x85eb('0x1e')](_0x593723['query'][_0x85eb('0x1e')]);_0x4e3d96[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x593723[_0x85eb('0x30')][_0x85eb('0x1c')]);}return _0x27ce2a['getConfigurations'](_0x4e3d96);}})[_0x85eb('0x25')](function(_0x143d65){if(_0x143d65){return _0x143d65?{'count':_0x249511,'rows':_0x143d65}:null;}})[_0x85eb('0x25')](respondWithResult(_0x39316d,null))[_0x85eb('0x40')](handleError(_0x39316d,null));};exports[_0x85eb('0x4e')]=function(_0x14cab8,_0x23fcf9,_0x5de716){if(_0x14cab8['body']['id']){delete _0x14cab8[_0x85eb('0x48')]['id'];}return db['ZendeskAccount'][_0x85eb('0x4b')]({'where':{'id':_0x14cab8[_0x85eb('0x42')]['id']}})[_0x85eb('0x25')](handleEntityNotFound(_0x23fcf9,null))[_0x85eb('0x25')](function(_0x259ee3){if(_0x259ee3){_0x14cab8['body'][_0x85eb('0x4f')]=_0x259ee3['id'];_0x14cab8[_0x85eb('0x48')][_0x85eb('0x50')]=integrations[_0x85eb('0x51')](_0x14cab8[_0x85eb('0x48')][_0x85eb('0x52')],_0x14cab8['body']['type']);_0x14cab8[_0x85eb('0x48')]['Descriptions']=integrations[_0x85eb('0x53')](_0x14cab8[_0x85eb('0x48')][_0x85eb('0x52')],_0x14cab8[_0x85eb('0x48')][_0x85eb('0x3c')]);return db[_0x85eb('0x4c')]['create'](_0x14cab8[_0x85eb('0x48')],{'include':[{'model':db[_0x85eb('0x54')],'as':_0x85eb('0x50')},{'model':db[_0x85eb('0x54')],'as':'Descriptions'}]});}return null;})[_0x85eb('0x25')](respondWithResult(_0x23fcf9,null))[_0x85eb('0x40')](handleError(_0x23fcf9,null));};exports[_0x85eb('0x55')]=function(_0x14bf0e,_0x5037c7,_0x459317){var _0x2e6734='';return db[_0x85eb('0x2b')][_0x85eb('0x4b')]({'where':{'id':_0x14bf0e[_0x85eb('0x42')]['id']},'attributes':['id',_0x85eb('0x56'),_0x85eb('0x57'),_0x85eb('0x58'),_0x85eb('0x59'),_0x85eb('0x5a')]})[_0x85eb('0x25')](handleEntityNotFound(_0x5037c7,null))[_0x85eb('0x25')](function(_0x1d9d3a){if(_0x1d9d3a){_0x2e6734=_0x1d9d3a[_0x85eb('0x5a')];var _0x2f2464=_0x2e6734[_0x85eb('0x5b')](-0x1);if(_0x2f2464==='/'){_0x2e6734=_0x2e6734[_0x85eb('0x5c')](0x0,_0x2e6734[_0x85eb('0x5d')](_0x2f2464));}var _0x106caa={'method':'GET','uri':util[_0x85eb('0x5e')]('%s/%s',_0x2e6734,_0x85eb('0x5f')),'json':!![]};switch(_0x1d9d3a[_0x85eb('0x59')]){case _0x85eb('0x57'):_0x106caa[_0x85eb('0x60')]={'Authorization':util[_0x85eb('0x5e')](_0x85eb('0x61'),new Buffer(util[_0x85eb('0x5e')](_0x85eb('0x62'),_0x1d9d3a[_0x85eb('0x56')],_0x1d9d3a['password']))[_0x85eb('0x63')](_0x85eb('0x64')))};break;case _0x85eb('0x58'):_0x106caa[_0x85eb('0x60')]={'Authorization':util[_0x85eb('0x5e')]('Basic\x20%s',new Buffer(util[_0x85eb('0x5e')]('%s/token:%s',_0x1d9d3a[_0x85eb('0x56')],_0x1d9d3a[_0x85eb('0x58')]))[_0x85eb('0x63')]('base64'))};break;default:throw new db[(_0x85eb('0x65'))][(_0x85eb('0x66'))](_0x85eb('0x67'));}return rp(_0x106caa);}})['then'](function(_0x588c72){if(_0x588c72){var _0x45a1ef=[_0x85eb('0x68'),_0x85eb('0x69'),_0x85eb('0x6a'),'assignee'];_[_0x85eb('0x6b')](_0x588c72['ticket_fields'],function(_0x11a3bd){return _0x45a1ef[_0x85eb('0x6c')](_0x11a3bd[_0x85eb('0x3c')]);});return{'count':_0x588c72[_0x85eb('0x5f')][_0x85eb('0x44')],'rows':_[_0x85eb('0x2a')](_0x588c72['ticket_fields'],function(_0x9a80a1){return{'id':_0x9a80a1['id'],'name':_0x9a80a1['position']>0x7?_0x9a80a1[_0x85eb('0x6d')]:_0x9a80a1[_0x85eb('0x3c')],'custom':_0x9a80a1[_0x85eb('0x6e')]>0x7?!![]:![],'options':_0x9a80a1[_0x85eb('0x6f')]?_0x9a80a1[_0x85eb('0x6f')]:_0x9a80a1[_0x85eb('0x70')]?_0x9a80a1[_0x85eb('0x70')]:[]};})};}})[_0x85eb('0x25')](respondWithResult(_0x5037c7,null))[_0x85eb('0x40')](function(_0x543146){var _0x3358c8=_0x14bf0e[_0x85eb('0x30')]['test']?0x1f4:_0x543146['statusCode']||0x1f4;logger[_0x85eb('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0x85eb('0x55'),_0x3358c8,JSON['stringify'](_0x543146));delete _0x543146[_0x85eb('0x29')];if(_0x3358c8===0x191){_0x3358c8=0x190;}_0x5037c7['status'](_0x3358c8)[_0x85eb('0x71')](_0x14bf0e[_0x85eb('0x30')]['test']?{'message':_0x85eb('0x72'),'statusCode':_0x543146[_0x85eb('0x73')]}:_0x543146);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 8a3439a..4e33f87 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 _0x7a96=['exports','define','int_zendesk_accounts','util','api','moment','bluebird','request-promise','path','./intZendeskAccount.attributes','../../components/integrations/configuration'];(function(_0x2d4f73,_0x507dcd){var _0x5c05c3=function(_0x1e8c00){while(--_0x1e8c00){_0x2d4f73['push'](_0x2d4f73['shift']());}};_0x5c05c3(++_0x507dcd);}(_0x7a96,0xb3));var _0x67a9=function(_0x596f3f,_0x53c5bf){_0x596f3f=_0x596f3f-0x0;var _0x2c1225=_0x7a96[_0x596f3f];return _0x2c1225;};'use strict';var _=require('lodash');var util=require(_0x67a9('0x0'));var logger=require('../../config/logger')(_0x67a9('0x1'));var moment=require(_0x67a9('0x2'));var BPromise=require(_0x67a9('0x3'));var rp=require(_0x67a9('0x4'));var fs=require('fs');var path=require(_0x67a9('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x67a9('0x6'));var integrations=require(_0x67a9('0x7'));module[_0x67a9('0x8')]=function(_0x360c65,_0x5d3620){return _0x360c65[_0x67a9('0x9')]('ZendeskAccount',attributes,{'tableName':_0x67a9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6953=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ZendeskAccount','int_zendesk_accounts'];(function(_0x738f0a,_0x5c7fcc){var _0x49ba90=function(_0x18067d){while(--_0x18067d){_0x738f0a['push'](_0x738f0a['shift']());}};_0x49ba90(++_0x5c7fcc);}(_0x6953,0xc0));var _0x3695=function(_0x1e747e,_0x1b82bd){_0x1e747e=_0x1e747e-0x0;var _0x3f9ebb=_0x6953[_0x1e747e];return _0x3f9ebb;};'use strict';var _=require(_0x3695('0x0'));var util=require(_0x3695('0x1'));var logger=require('../../config/logger')(_0x3695('0x2'));var moment=require(_0x3695('0x3'));var BPromise=require(_0x3695('0x4'));var rp=require(_0x3695('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3695('0x6'));var config=require(_0x3695('0x7'));var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x3695('0x8')]=function(_0x2067e4,_0x46f12f){return _0x2067e4[_0x3695('0x9')](_0x3695('0xa'),attributes,{'tableName':_0x3695('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index cc6b225..7e9174c 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 _0x31a2=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','include','map','model','ShowZendeskAccount','find','lodash','util','moment','bluebird'];(function(_0xdc0c40,_0x18a854){var _0x12e045=function(_0x5dba33){while(--_0x5dba33){_0xdc0c40['push'](_0xdc0c40['shift']());}};_0x12e045(++_0x18a854);}(_0x31a2,0xda));var _0x231a=function(_0x328dc7,_0x35d8ea){_0x328dc7=_0x328dc7-0x0;var _0x4009c1=_0x31a2[_0x328dc7];return _0x4009c1;};'use strict';var _=require(_0x231a('0x0'));var util=require(_0x231a('0x1'));var moment=require(_0x231a('0x2'));var BPromise=require(_0x231a('0x3'));var rs=require(_0x231a('0x4'));var fs=require('fs');var Redis=require(_0x231a('0x5'));var db=require(_0x231a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x231a('0x7'))(_0x231a('0x8'));var config=require(_0x231a('0x9'));var jayson=require(_0x231a('0xa'));var client=jayson[_0x231a('0xb')][_0x231a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4966bf,_0x3993a1,_0x3a792c){return new BPromise(function(_0x20e891,_0x1b1e68){return client['request'](_0x4966bf,_0x3a792c)[_0x231a('0xd')](function(_0x369523){logger[_0x231a('0xe')](_0x231a('0xf'),_0x3993a1,_0x231a('0x10'));logger[_0x231a('0x11')](_0x231a('0x12'),_0x3993a1,'request\x20sent',JSON[_0x231a('0x13')](_0x369523));if(_0x369523[_0x231a('0x14')]){if(_0x369523[_0x231a('0x14')][_0x231a('0x15')]===0x1f4){logger[_0x231a('0x14')](_0x231a('0xf'),_0x3993a1,_0x369523['error'][_0x231a('0x16')]);return _0x1b1e68(_0x369523[_0x231a('0x14')]['message']);}logger[_0x231a('0x14')](_0x231a('0xf'),_0x3993a1,_0x369523['error']['message']);return _0x20e891(_0x369523[_0x231a('0x14')]['message']);}else{logger[_0x231a('0xe')](_0x231a('0xf'),_0x3993a1,_0x231a('0x10'));_0x20e891(_0x369523[_0x231a('0x17')]['message']);}})[_0x231a('0x18')](function(_0x1e9d75){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x3993a1,_0x1e9d75);_0x1b1e68(_0x1e9d75);});});}exports[_0x231a('0x19')]=function(_0x15f7f1){var _0x1a684f=this;return new Promise(function(_0x4ff332,_0x176df6){return db[_0x231a('0x1a')][_0x231a('0x1b')]({'raw':_0x15f7f1[_0x231a('0x1c')]?_0x15f7f1[_0x231a('0x1c')][_0x231a('0x1d')]===undefined?!![]:![]:!![],'where':_0x15f7f1[_0x231a('0x1c')]?_0x15f7f1['options'][_0x231a('0x1e')]||null:null,'attributes':_0x15f7f1[_0x231a('0x1c')]?_0x15f7f1[_0x231a('0x1c')][_0x231a('0x1f')]||null:null,'limit':_0x15f7f1[_0x231a('0x1c')]?_0x15f7f1[_0x231a('0x1c')]['limit']||null:null,'include':_0x15f7f1[_0x231a('0x1c')]?_0x15f7f1[_0x231a('0x1c')][_0x231a('0x20')]?_[_0x231a('0x21')](_0x15f7f1['options'][_0x231a('0x20')],function(_0x5030f4){return{'model':db[_0x5030f4[_0x231a('0x22')]],'as':_0x5030f4['as'],'attributes':_0x5030f4[_0x231a('0x1f')],'include':_0x5030f4[_0x231a('0x20')]?_['map'](_0x5030f4[_0x231a('0x20')],function(_0x579034){return{'model':db[_0x579034[_0x231a('0x22')]],'as':_0x579034['as'],'attributes':_0x579034['attributes'],'include':_0x579034[_0x231a('0x20')]?_['map'](_0x579034[_0x231a('0x20')],function(_0x364653){return{'model':db[_0x364653[_0x231a('0x22')]],'as':_0x364653['as'],'attributes':_0x364653[_0x231a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x231a('0xd')](function(_0x47ee89){logger[_0x231a('0xe')](_0x231a('0x19'),_0x15f7f1);logger['debug'](_0x231a('0x19'),_0x15f7f1,JSON[_0x231a('0x13')](_0x47ee89));_0x4ff332(_0x47ee89);})[_0x231a('0x18')](function(_0x581919){logger[_0x231a('0x14')]('GetZendeskAccount',_0x581919[_0x231a('0x16')],_0x15f7f1);_0x176df6(_0x1a684f[_0x231a('0x14')](0x1f4,_0x581919[_0x231a('0x16')]));});});};exports[_0x231a('0x23')]=function(_0x28f1bb){var _0xa609b4=this;return new Promise(function(_0x3e2e1a,_0x3035d5){return db[_0x231a('0x1a')][_0x231a('0x24')]({'raw':_0x28f1bb[_0x231a('0x1c')]?_0x28f1bb[_0x231a('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x28f1bb[_0x231a('0x1c')]?_0x28f1bb[_0x231a('0x1c')][_0x231a('0x1e')]||null:null,'attributes':_0x28f1bb[_0x231a('0x1c')]?_0x28f1bb[_0x231a('0x1c')][_0x231a('0x1f')]||null:null,'include':_0x28f1bb[_0x231a('0x1c')]?_0x28f1bb[_0x231a('0x1c')]['include']?_[_0x231a('0x21')](_0x28f1bb[_0x231a('0x1c')][_0x231a('0x20')],function(_0x3016f0){return{'model':db[_0x3016f0['model']],'as':_0x3016f0['as'],'attributes':_0x3016f0[_0x231a('0x1f')],'include':_0x3016f0[_0x231a('0x20')]?_[_0x231a('0x21')](_0x3016f0['include'],function(_0x3cf458){return{'model':db[_0x3cf458[_0x231a('0x22')]],'as':_0x3cf458['as'],'attributes':_0x3cf458[_0x231a('0x1f')],'include':_0x3cf458['include']?_['map'](_0x3cf458[_0x231a('0x20')],function(_0x217d4a){return{'model':db[_0x217d4a['model']],'as':_0x217d4a['as'],'attributes':_0x217d4a[_0x231a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x231a('0xd')](function(_0x214568){logger[_0x231a('0xe')](_0x231a('0x23'),_0x28f1bb);logger[_0x231a('0x11')](_0x231a('0x23'),_0x28f1bb,JSON[_0x231a('0x13')](_0x214568));_0x3e2e1a(_0x214568);})[_0x231a('0x18')](function(_0x1eef43){logger[_0x231a('0x14')]('ShowZendeskAccount',_0x1eef43['message'],_0x28f1bb);_0x3035d5(_0xa609b4[_0x231a('0x14')](0x1f4,_0x1eef43['message']));});});}; \ No newline at end of file +var _0x278a=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','ZendeskAccount,\x20%s,\x20%s','result','catch','ZendeskAccount','raw','options','attributes','limit','include','map','model','info','GetZendeskAccount','stringify','ShowZendeskAccount','find','where'];(function(_0x281684,_0x1eae63){var _0x513920=function(_0x3f80e8){while(--_0x3f80e8){_0x281684['push'](_0x281684['shift']());}};_0x513920(++_0x1eae63);}(_0x278a,0xde));var _0xa278=function(_0x10e0fb,_0x3dfc66){_0x10e0fb=_0x10e0fb-0x0;var _0x23da9d=_0x278a[_0x10e0fb];return _0x23da9d;};'use strict';var _=require(_0xa278('0x0'));var util=require(_0xa278('0x1'));var moment=require(_0xa278('0x2'));var BPromise=require('bluebird');var rs=require(_0xa278('0x3'));var fs=require('fs');var Redis=require(_0xa278('0x4'));var db=require(_0xa278('0x5'))['db'];var utils=require(_0xa278('0x6'));var logger=require(_0xa278('0x7'))(_0xa278('0x8'));var config=require(_0xa278('0x9'));var jayson=require(_0xa278('0xa'));var client=jayson[_0xa278('0xb')][_0xa278('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1f3226,_0x35efd5,_0x2237c8){return new BPromise(function(_0x128443,_0x1b64d5){return client['request'](_0x1f3226,_0x2237c8)[_0xa278('0xd')](function(_0x514fe6){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x35efd5,_0xa278('0xe'));logger[_0xa278('0xf')](_0xa278('0x10'),_0x35efd5,_0xa278('0xe'),JSON['stringify'](_0x514fe6));if(_0x514fe6[_0xa278('0x11')]){if(_0x514fe6[_0xa278('0x11')][_0xa278('0x12')]===0x1f4){logger[_0xa278('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x35efd5,_0x514fe6[_0xa278('0x11')][_0xa278('0x13')]);return _0x1b64d5(_0x514fe6['error'][_0xa278('0x13')]);}logger['error'](_0xa278('0x14'),_0x35efd5,_0x514fe6[_0xa278('0x11')][_0xa278('0x13')]);return _0x128443(_0x514fe6[_0xa278('0x11')][_0xa278('0x13')]);}else{logger['info'](_0xa278('0x14'),_0x35efd5,_0xa278('0xe'));_0x128443(_0x514fe6[_0xa278('0x15')]['message']);}})[_0xa278('0x16')](function(_0x593bb2){logger[_0xa278('0x11')](_0xa278('0x14'),_0x35efd5,_0x593bb2);_0x1b64d5(_0x593bb2);});});}exports['GetZendeskAccount']=function(_0x7858a3){var _0x1de98f=this;return new Promise(function(_0x278b61,_0x1c4b81){return db[_0xa278('0x17')]['findAll']({'raw':_0x7858a3['options']?_0x7858a3['options'][_0xa278('0x18')]===undefined?!![]:![]:!![],'where':_0x7858a3[_0xa278('0x19')]?_0x7858a3[_0xa278('0x19')]['where']||null:null,'attributes':_0x7858a3[_0xa278('0x19')]?_0x7858a3['options'][_0xa278('0x1a')]||null:null,'limit':_0x7858a3[_0xa278('0x19')]?_0x7858a3[_0xa278('0x19')][_0xa278('0x1b')]||null:null,'include':_0x7858a3[_0xa278('0x19')]?_0x7858a3['options'][_0xa278('0x1c')]?_[_0xa278('0x1d')](_0x7858a3[_0xa278('0x19')][_0xa278('0x1c')],function(_0xdb7604){return{'model':db[_0xdb7604[_0xa278('0x1e')]],'as':_0xdb7604['as'],'attributes':_0xdb7604[_0xa278('0x1a')],'include':_0xdb7604['include']?_['map'](_0xdb7604['include'],function(_0x528bd8){return{'model':db[_0x528bd8['model']],'as':_0x528bd8['as'],'attributes':_0x528bd8[_0xa278('0x1a')],'include':_0x528bd8[_0xa278('0x1c')]?_[_0xa278('0x1d')](_0x528bd8[_0xa278('0x1c')],function(_0x745cfd){return{'model':db[_0x745cfd[_0xa278('0x1e')]],'as':_0x745cfd['as'],'attributes':_0x745cfd[_0xa278('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa278('0xd')](function(_0x3bc6c8){logger[_0xa278('0x1f')](_0xa278('0x20'),_0x7858a3);logger[_0xa278('0xf')](_0xa278('0x20'),_0x7858a3,JSON[_0xa278('0x21')](_0x3bc6c8));_0x278b61(_0x3bc6c8);})[_0xa278('0x16')](function(_0x4ac57a){logger['error'](_0xa278('0x20'),_0x4ac57a[_0xa278('0x13')],_0x7858a3);_0x1c4b81(_0x1de98f[_0xa278('0x11')](0x1f4,_0x4ac57a[_0xa278('0x13')]));});});};exports[_0xa278('0x22')]=function(_0x5c1e70){var _0x1ed21b=this;return new Promise(function(_0x10cb36,_0x21e54f){return db[_0xa278('0x17')][_0xa278('0x23')]({'raw':_0x5c1e70[_0xa278('0x19')]?_0x5c1e70[_0xa278('0x19')][_0xa278('0x18')]===undefined?!![]:![]:!![],'where':_0x5c1e70['options']?_0x5c1e70[_0xa278('0x19')][_0xa278('0x24')]||null:null,'attributes':_0x5c1e70[_0xa278('0x19')]?_0x5c1e70[_0xa278('0x19')]['attributes']||null:null,'include':_0x5c1e70[_0xa278('0x19')]?_0x5c1e70['options'][_0xa278('0x1c')]?_[_0xa278('0x1d')](_0x5c1e70[_0xa278('0x19')][_0xa278('0x1c')],function(_0x1d26d8){return{'model':db[_0x1d26d8[_0xa278('0x1e')]],'as':_0x1d26d8['as'],'attributes':_0x1d26d8[_0xa278('0x1a')],'include':_0x1d26d8[_0xa278('0x1c')]?_[_0xa278('0x1d')](_0x1d26d8[_0xa278('0x1c')],function(_0x3a55f0){return{'model':db[_0x3a55f0['model']],'as':_0x3a55f0['as'],'attributes':_0x3a55f0[_0xa278('0x1a')],'include':_0x3a55f0[_0xa278('0x1c')]?_[_0xa278('0x1d')](_0x3a55f0[_0xa278('0x1c')],function(_0xe3a54a){return{'model':db[_0xe3a54a[_0xa278('0x1e')]],'as':_0xe3a54a['as'],'attributes':_0xe3a54a[_0xa278('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa278('0xd')](function(_0x3a7374){logger[_0xa278('0x1f')](_0xa278('0x22'),_0x5c1e70);logger['debug'](_0xa278('0x22'),_0x5c1e70,JSON[_0xa278('0x21')](_0x3a7374));_0x10cb36(_0x3a7374);})[_0xa278('0x16')](function(_0x1e2694){logger['error']('ShowZendeskAccount',_0x1e2694[_0xa278('0x13')],_0x5c1e70);_0x21e54f(_0x1ed21b[_0xa278('0x11')](0x1f4,_0x1e2694[_0xa278('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index c692d63..f0e4fdc 100644 --- a/server/api/intZendeskConfiguration/index.js +++ b/server/api/intZendeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4eb=['put','update','delete','/:id','destroy','exports','multer','Router','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','create','post','setTags'];(function(_0x5e142b,_0x3bd49e){var _0x185ba9=function(_0x5736b1){while(--_0x5736b1){_0x5e142b['push'](_0x5e142b['shift']());}};_0x185ba9(++_0x3bd49e);}(_0xf4eb,0xec));var _0xbf4e=function(_0x159536,_0x28c61a){_0x159536=_0x159536-0x0;var _0x4e4656=_0xf4eb[_0x159536];return _0x4e4656;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/:id',auth[_0xbf4e('0x6')](),controller['show']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0x5')](_0xbf4e('0xa'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router['get']('/:id/descriptions',auth[_0xbf4e('0x6')](),controller['getDescriptions']);router[_0xbf4e('0x5')](_0xbf4e('0xc'),auth['isAuthenticated'](),controller[_0xbf4e('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbf4e('0xe')]);router[_0xbf4e('0xf')](_0xbf4e('0xc'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x10')]);router[_0xbf4e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0x12')]);router[_0xbf4e('0x13')](_0xbf4e('0x14'),auth['isAuthenticated'](),controller[_0xbf4e('0x15')]);module[_0xbf4e('0x16')]=router; \ No newline at end of file +var _0xa571=['util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','put','update','exports','multer'];(function(_0x51a128,_0x5bb978){var _0xa7f169=function(_0x5a3ec1){while(--_0x5a3ec1){_0x51a128['push'](_0x51a128['shift']());}};_0xa7f169(++_0x5bb978);}(_0xa571,0x107));var _0x1a57=function(_0x130ae7,_0x1a25cd){_0x130ae7=_0x130ae7-0x0;var _0x4f598b=_0xa571[_0x130ae7];return _0x4f598b;};'use strict';var multer=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var path=require(_0x1a57('0x2'));var timeout=require(_0x1a57('0x3'));var express=require('express');var router=express[_0x1a57('0x4')]();var fs_extra=require(_0x1a57('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a57('0x6'));var controller=require('./intZendeskConfiguration.controller');router[_0x1a57('0x7')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0x9')]);router[_0x1a57('0x7')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller['show']);router[_0x1a57('0x7')](_0x1a57('0xb'),auth[_0x1a57('0x8')](),controller['getFields']);router[_0x1a57('0x7')](_0x1a57('0xc'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xd')]);router[_0x1a57('0x7')](_0x1a57('0xe'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xf')]);router['get']('/:id/tags',auth[_0x1a57('0x8')](),controller[_0x1a57('0x10')]);router[_0x1a57('0x11')]('/',auth['isAuthenticated'](),controller[_0x1a57('0x12')]);router[_0x1a57('0x11')]('/:id/tags',auth[_0x1a57('0x8')](),controller['setTags']);router[_0x1a57('0x13')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller[_0x1a57('0x14')]);router['delete'](_0x1a57('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x1a57('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 62c12cc..d0d4867 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 _0xe685=['STRING','sequelize','exports'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0xe685,0xac));var _0x5e68=function(_0x59dfdc,_0x3c2d02){_0x59dfdc=_0x59dfdc-0x0;var _0x563881=_0xe685[_0x59dfdc];return _0x563881;};'use strict';var Sequelize=require(_0x5e68('0x0'));module[_0x5e68('0x1')]={'name':{'type':Sequelize[_0x5e68('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0ab1=['sequelize','STRING'];(function(_0x5de214,_0x107e9d){var _0x4df627=function(_0x4199e1){while(--_0x4199e1){_0x5de214['push'](_0x5de214['shift']());}};_0x4df627(++_0x107e9d);}(_0x0ab1,0x88));var _0x10ab=function(_0x450223,_0x599cfa){_0x450223=_0x450223-0x0;var _0x21d00f=_0x0ab1[_0x450223];return _0x21d00f;};'use strict';var Sequelize=require(_0x10ab('0x0'));module['exports']={'name':{'type':Sequelize[_0x10ab('0x1')]},'description':{'type':Sequelize[_0x10ab('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index b56485c..ed53aeb 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 _0x3c48=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','params','getFields','ZendeskField','getSubjects','findOne','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','json','offset','undefined','limit','count','status','Content-Range','reject','save','update','destroy','sendStatus','error','stack','name','send','index','ZendeskConfiguration','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length'];(function(_0x71c0b0,_0x3dc50a){var _0x315ccd=function(_0x1c9bb9){while(--_0x1c9bb9){_0x71c0b0['push'](_0x71c0b0['shift']());}};_0x315ccd(++_0x3dc50a);}(_0x3c48,0x11c));var _0x83c4=function(_0x5d0868,_0x378533){_0x5d0868=_0x5d0868-0x0;var _0x5f5811=_0x3c48[_0x5d0868];return _0x5f5811;};'use strict';var emlformat=require(_0x83c4('0x0'));var rimraf=require(_0x83c4('0x1'));var zipdir=require(_0x83c4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x83c4('0x3'));var moment=require(_0x83c4('0x4'));var BPromise=require(_0x83c4('0x5'));var Mustache=require(_0x83c4('0x6'));var util=require(_0x83c4('0x7'));var path=require(_0x83c4('0x8'));var sox=require(_0x83c4('0x9'));var csv=require(_0x83c4('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x83c4('0xb'));var _=require('lodash');var squel=require(_0x83c4('0xc'));var crypto=require(_0x83c4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x83c4('0xe'));var toCsv=require(_0x83c4('0xa'));var querystring=require(_0x83c4('0xf'));var Papa=require(_0x83c4('0x10'));var Redis=require(_0x83c4('0x11'));var authService=require(_0x83c4('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x83c4('0x13'));var hardwareService=require(_0x83c4('0x14'));var logger=require('../../config/logger')(_0x83c4('0x15'));var utils=require(_0x83c4('0x16'));var config=require(_0x83c4('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x83c4('0x18'))['db'];function respondWithStatusCode(_0x9fb4dc,_0x4e6ff8){_0x4e6ff8=_0x4e6ff8||0xcc;return function(_0x55d2c8){if(_0x55d2c8){return _0x9fb4dc['sendStatus'](_0x4e6ff8);}return _0x9fb4dc['status'](_0x4e6ff8)[_0x83c4('0x19')]();};}function respondWithResult(_0x323fdc,_0x2188b6){_0x2188b6=_0x2188b6||0xc8;return function(_0x3dd6fe){if(_0x3dd6fe){return _0x323fdc['status'](_0x2188b6)[_0x83c4('0x1a')](_0x3dd6fe);}};}function respondWithFilteredResult(_0x39d3b6,_0x5dd547){return function(_0x45ad87){if(_0x45ad87){var _0x37198f=typeof _0x5dd547[_0x83c4('0x1b')]===_0x83c4('0x1c')&&typeof _0x5dd547[_0x83c4('0x1d')]===_0x83c4('0x1c');var _0x1b489e=_0x45ad87['count'];var _0x3c864b=_0x37198f?0x0:_0x5dd547['offset'];var _0x254204=_0x37198f?_0x45ad87[_0x83c4('0x1e')]:_0x5dd547[_0x83c4('0x1b')]+_0x5dd547['limit'];var _0x21924b;if(_0x254204>=_0x1b489e){_0x254204=_0x1b489e;_0x21924b=0xc8;}else{_0x21924b=0xce;}_0x39d3b6[_0x83c4('0x1f')](_0x21924b);return _0x39d3b6['set'](_0x83c4('0x20'),_0x3c864b+'-'+_0x254204+'/'+_0x1b489e)[_0x83c4('0x1a')](_0x45ad87);}return null;};}function patchUpdates(_0xf1901c){return function(_0x1e0b37){try{jsonpatch['apply'](_0x1e0b37,_0xf1901c,!![]);}catch(_0x3633b1){return BPromise[_0x83c4('0x21')](_0x3633b1);}return _0x1e0b37[_0x83c4('0x22')]();};}function saveUpdates(_0x24dc17,_0x45cf4c){return function(_0xdbb930){if(_0xdbb930){return _0xdbb930[_0x83c4('0x23')](_0x24dc17)['then'](function(_0x1300cd){return _0x1300cd;});}return null;};}function removeEntity(_0x2f95bc,_0x3f9c07){return function(_0x1c57be){if(_0x1c57be){return _0x1c57be[_0x83c4('0x24')]()['then'](function(){_0x2f95bc[_0x83c4('0x1f')](0xcc)[_0x83c4('0x19')]();});}};}function handleEntityNotFound(_0x2ef22e,_0x3c4786){return function(_0x38f0b4){if(!_0x38f0b4){_0x2ef22e[_0x83c4('0x25')](0x194);}return _0x38f0b4;};}function handleError(_0x1224a2,_0xc902b){_0xc902b=_0xc902b||0x1f4;return function(_0x3d0a87){logger[_0x83c4('0x26')](_0x3d0a87[_0x83c4('0x27')]);if(_0x3d0a87[_0x83c4('0x28')]){delete _0x3d0a87[_0x83c4('0x28')];}_0x1224a2[_0x83c4('0x1f')](_0xc902b)[_0x83c4('0x29')](_0x3d0a87);};}exports[_0x83c4('0x2a')]=function(_0x397739,_0x3d84ba){var _0x2520ea={},_0x3b46b9={},_0x1f035a={'count':0x0,'rows':[]};var _0x2b365c=_['map'](db[_0x83c4('0x2b')]['rawAttributes'],function(_0x49703f){return{'name':_0x49703f[_0x83c4('0x2c')],'type':_0x49703f[_0x83c4('0x2d')][_0x83c4('0x2e')]};});_0x3b46b9[_0x83c4('0x2f')]=_[_0x83c4('0x30')](_0x2b365c,_0x83c4('0x28'));_0x3b46b9[_0x83c4('0x31')]=_[_0x83c4('0x32')](_0x397739[_0x83c4('0x31')]);_0x3b46b9[_0x83c4('0x33')]=_['intersection'](_0x3b46b9[_0x83c4('0x2f')],_0x3b46b9[_0x83c4('0x31')]);_0x2520ea[_0x83c4('0x34')]=_[_0x83c4('0x35')](_0x3b46b9[_0x83c4('0x2f')],qs[_0x83c4('0x36')](_0x397739[_0x83c4('0x31')][_0x83c4('0x36')]));_0x2520ea[_0x83c4('0x34')]=_0x2520ea[_0x83c4('0x34')][_0x83c4('0x37')]?_0x2520ea[_0x83c4('0x34')]:_0x3b46b9['model'];if(!_0x397739[_0x83c4('0x31')][_0x83c4('0x38')](_0x83c4('0x39'))){_0x2520ea[_0x83c4('0x1d')]=qs[_0x83c4('0x1d')](_0x397739['query']['limit']);_0x2520ea[_0x83c4('0x1b')]=qs[_0x83c4('0x1b')](_0x397739[_0x83c4('0x31')][_0x83c4('0x1b')]);}_0x2520ea[_0x83c4('0x3a')]=qs[_0x83c4('0x3b')](_0x397739[_0x83c4('0x31')][_0x83c4('0x3b')]);_0x2520ea[_0x83c4('0x3c')]=qs['filters'](_[_0x83c4('0x3d')](_0x397739[_0x83c4('0x31')],_0x3b46b9[_0x83c4('0x33')]),_0x2b365c);if(_0x397739['query'][_0x83c4('0x3e')]){_0x2520ea['where']=_[_0x83c4('0x3f')](_0x2520ea['where'],{'$or':_[_0x83c4('0x30')](_0x2b365c,function(_0x37f362){if(_0x37f362[_0x83c4('0x2d')]!==_0x83c4('0x40')){var _0x5f3584={};_0x5f3584[_0x37f362[_0x83c4('0x28')]]={'$like':'%'+_0x397739[_0x83c4('0x31')]['filter']+'%'};return _0x5f3584;}})});}_0x2520ea=_[_0x83c4('0x3f')]({},_0x2520ea,_0x397739[_0x83c4('0x41')]);var _0x529ba9={'where':_0x2520ea['where']};return db['ZendeskConfiguration']['count'](_0x529ba9)[_0x83c4('0x42')](function(_0x628e0d){_0x1f035a[_0x83c4('0x1e')]=_0x628e0d;if(_0x397739['query'][_0x83c4('0x43')]){_0x2520ea[_0x83c4('0x44')]=[{'all':!![]}];}return db[_0x83c4('0x2b')][_0x83c4('0x45')](_0x2520ea);})[_0x83c4('0x42')](function(_0x5d2e3d){_0x1f035a['rows']=_0x5d2e3d;return _0x1f035a;})[_0x83c4('0x42')](respondWithFilteredResult(_0x3d84ba,_0x2520ea))[_0x83c4('0x46')](handleError(_0x3d84ba,null));};exports[_0x83c4('0x47')]=function(_0x55b9b7,_0x42e4bf){var _0x4397c8={'raw':![],'where':{'id':_0x55b9b7['params']['id']}},_0x19d841={};_0x19d841['model']=_['keys'](db[_0x83c4('0x2b')][_0x83c4('0x48')]);_0x19d841[_0x83c4('0x31')]=_[_0x83c4('0x32')](_0x55b9b7[_0x83c4('0x31')]);_0x19d841['filters']=_['intersection'](_0x19d841[_0x83c4('0x2f')],_0x19d841['query']);_0x4397c8['attributes']=_[_0x83c4('0x35')](_0x19d841[_0x83c4('0x2f')],qs['fields'](_0x55b9b7[_0x83c4('0x31')][_0x83c4('0x36')]));_0x4397c8[_0x83c4('0x34')]=_0x4397c8[_0x83c4('0x34')]['length']?_0x4397c8[_0x83c4('0x34')]:_0x19d841['model'];if(_0x55b9b7['query'][_0x83c4('0x43')]){_0x4397c8['include']=[{'all':!![]}];}_0x4397c8=_[_0x83c4('0x3f')]({},_0x4397c8,_0x55b9b7[_0x83c4('0x41')]);return db['ZendeskConfiguration'][_0x83c4('0x49')](_0x4397c8)[_0x83c4('0x42')](handleEntityNotFound(_0x42e4bf,null))[_0x83c4('0x42')](respondWithResult(_0x42e4bf,null))[_0x83c4('0x46')](handleError(_0x42e4bf,null));};exports[_0x83c4('0x4a')]=function(_0x5c37b3,_0x11998c){return db[_0x83c4('0x2b')]['create'](_0x5c37b3[_0x83c4('0x4b')],{})['then'](respondWithResult(_0x11998c,0xc9))[_0x83c4('0x46')](handleError(_0x11998c,null));};exports[_0x83c4('0x23')]=function(_0x521fc2,_0x41c14b){if(_0x521fc2[_0x83c4('0x4b')]['id']){delete _0x521fc2['body']['id'];}return db[_0x83c4('0x2b')]['find']({'where':{'id':_0x521fc2['params']['id']}})[_0x83c4('0x42')](handleEntityNotFound(_0x41c14b,null))['then'](saveUpdates(_0x521fc2[_0x83c4('0x4b')],null))['then'](respondWithResult(_0x41c14b,null))[_0x83c4('0x46')](handleError(_0x41c14b,null));};exports[_0x83c4('0x24')]=function(_0x31880f,_0x3dad77){return db[_0x83c4('0x2b')][_0x83c4('0x49')]({'where':{'id':_0x31880f[_0x83c4('0x4c')]['id']}})[_0x83c4('0x42')](handleEntityNotFound(_0x3dad77,null))['then'](removeEntity(_0x3dad77,null))[_0x83c4('0x46')](handleError(_0x3dad77,null));};exports[_0x83c4('0x4d')]=function(_0x3570c7,_0x27e5bb,_0x178e8e){var _0xb8c792={};var _0x2ba7ab={};var _0x617411;var _0x3d1349;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x3570c7[_0x83c4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x27e5bb,null))[_0x83c4('0x42')](function(_0x1fbaa5){if(_0x1fbaa5){_0x617411=_0x1fbaa5;_0x2ba7ab[_0x83c4('0x2f')]=_[_0x83c4('0x32')](db[_0x83c4('0x4e')][_0x83c4('0x48')]);_0x2ba7ab[_0x83c4('0x31')]=_[_0x83c4('0x32')](_0x3570c7['query']);_0x2ba7ab[_0x83c4('0x33')]=_[_0x83c4('0x35')](_0x2ba7ab[_0x83c4('0x2f')],_0x2ba7ab[_0x83c4('0x31')]);_0xb8c792[_0x83c4('0x34')]=_['intersection'](_0x2ba7ab[_0x83c4('0x2f')],qs[_0x83c4('0x36')](_0x3570c7[_0x83c4('0x31')]['fields']));_0xb8c792[_0x83c4('0x34')]=_0xb8c792[_0x83c4('0x34')]['length']?_0xb8c792[_0x83c4('0x34')]:_0x2ba7ab[_0x83c4('0x2f')];_0xb8c792[_0x83c4('0x3a')]=qs[_0x83c4('0x3b')](_0x3570c7[_0x83c4('0x31')][_0x83c4('0x3b')]);_0xb8c792[_0x83c4('0x3c')]=qs['filters'](_['pick'](_0x3570c7[_0x83c4('0x31')],_0x2ba7ab['filters']));if(_0x3570c7['query'][_0x83c4('0x3e')]){_0xb8c792[_0x83c4('0x3c')]=_[_0x83c4('0x3f')](_0xb8c792[_0x83c4('0x3c')],{'$or':_[_0x83c4('0x30')](_0xb8c792[_0x83c4('0x34')],function(_0x1a3b8d){var _0x5adca4={};_0x5adca4[_0x1a3b8d]={'$like':'%'+_0x3570c7[_0x83c4('0x31')]['filter']+'%'};return _0x5adca4;})});}_0xb8c792=_[_0x83c4('0x3f')]({},_0xb8c792,_0x3570c7['options']);return _0x617411[_0x83c4('0x4d')](_0xb8c792);}})[_0x83c4('0x42')](function(_0x3759fa){if(_0x3759fa){_0x3d1349=_0x3759fa[_0x83c4('0x37')];if(!_0x3570c7['query']['hasOwnProperty']('nolimit')){_0xb8c792[_0x83c4('0x1d')]=qs[_0x83c4('0x1d')](_0x3570c7[_0x83c4('0x31')][_0x83c4('0x1d')]);_0xb8c792[_0x83c4('0x1b')]=qs[_0x83c4('0x1b')](_0x3570c7['query'][_0x83c4('0x1b')]);}return _0x617411['getFields'](_0xb8c792);}})['then'](function(_0x27143f){if(_0x27143f){return _0x27143f?{'count':_0x3d1349,'rows':_0x27143f}:null;}})[_0x83c4('0x42')](respondWithResult(_0x27e5bb,null))[_0x83c4('0x46')](handleError(_0x27e5bb,null));};exports[_0x83c4('0x4f')]=function(_0x481a83,_0x1aefa7,_0x308faa){var _0x1bc96f={};var _0x56f996={};var _0x51b6c2;var _0x2f7fa9;return db[_0x83c4('0x2b')][_0x83c4('0x50')]({'where':{'id':_0x481a83[_0x83c4('0x4c')]['id']}})[_0x83c4('0x42')](handleEntityNotFound(_0x1aefa7,null))['then'](function(_0x3509be){if(_0x3509be){_0x51b6c2=_0x3509be;_0x56f996[_0x83c4('0x2f')]=_[_0x83c4('0x32')](db[_0x83c4('0x4e')]['rawAttributes']);_0x56f996[_0x83c4('0x31')]=_[_0x83c4('0x32')](_0x481a83['query']);_0x56f996['filters']=_[_0x83c4('0x35')](_0x56f996[_0x83c4('0x2f')],_0x56f996['query']);_0x1bc96f[_0x83c4('0x34')]=_['intersection'](_0x56f996[_0x83c4('0x2f')],qs[_0x83c4('0x36')](_0x481a83[_0x83c4('0x31')][_0x83c4('0x36')]));_0x1bc96f['attributes']=_0x1bc96f[_0x83c4('0x34')]['length']?_0x1bc96f['attributes']:_0x56f996[_0x83c4('0x2f')];_0x1bc96f[_0x83c4('0x3a')]=qs['sort'](_0x481a83[_0x83c4('0x31')]['sort']);_0x1bc96f['where']=qs[_0x83c4('0x33')](_['pick'](_0x481a83['query'],_0x56f996[_0x83c4('0x33')]));if(_0x481a83['query'][_0x83c4('0x3e')]){_0x1bc96f[_0x83c4('0x3c')]=_[_0x83c4('0x3f')](_0x1bc96f[_0x83c4('0x3c')],{'$or':_[_0x83c4('0x30')](_0x1bc96f[_0x83c4('0x34')],function(_0x39beb0){var _0xd7c11={};_0xd7c11[_0x39beb0]={'$like':'%'+_0x481a83[_0x83c4('0x31')][_0x83c4('0x3e')]+'%'};return _0xd7c11;})});}_0x1bc96f=_[_0x83c4('0x3f')]({},_0x1bc96f,_0x481a83[_0x83c4('0x41')]);return _0x51b6c2[_0x83c4('0x4f')](_0x1bc96f);}})[_0x83c4('0x42')](function(_0x39f96a){if(_0x39f96a){_0x2f7fa9=_0x39f96a[_0x83c4('0x37')];if(!_0x481a83[_0x83c4('0x31')]['hasOwnProperty'](_0x83c4('0x39'))){_0x1bc96f[_0x83c4('0x1d')]=qs['limit'](_0x481a83[_0x83c4('0x31')]['limit']);_0x1bc96f[_0x83c4('0x1b')]=qs[_0x83c4('0x1b')](_0x481a83[_0x83c4('0x31')][_0x83c4('0x1b')]);}return _0x51b6c2['getSubjects'](_0x1bc96f);}})['then'](function(_0x21be03){if(_0x21be03){return _0x21be03?{'count':_0x2f7fa9,'rows':_0x21be03}:null;}})[_0x83c4('0x42')](respondWithResult(_0x1aefa7,null))[_0x83c4('0x46')](handleError(_0x1aefa7,null));};exports[_0x83c4('0x51')]=function(_0x4c1c53,_0x546225,_0x298cd1){var _0x3ec9f1={};var _0x3be9b1={};var _0x3e2a45;var _0x2369ae;return db['ZendeskConfiguration'][_0x83c4('0x50')]({'where':{'id':_0x4c1c53[_0x83c4('0x4c')]['id']}})[_0x83c4('0x42')](handleEntityNotFound(_0x546225,null))[_0x83c4('0x42')](function(_0x217fb1){if(_0x217fb1){_0x3e2a45=_0x217fb1;_0x3be9b1[_0x83c4('0x2f')]=_[_0x83c4('0x32')](db[_0x83c4('0x4e')][_0x83c4('0x48')]);_0x3be9b1[_0x83c4('0x31')]=_[_0x83c4('0x32')](_0x4c1c53[_0x83c4('0x31')]);_0x3be9b1[_0x83c4('0x33')]=_[_0x83c4('0x35')](_0x3be9b1[_0x83c4('0x2f')],_0x3be9b1['query']);_0x3ec9f1[_0x83c4('0x34')]=_[_0x83c4('0x35')](_0x3be9b1[_0x83c4('0x2f')],qs['fields'](_0x4c1c53['query'][_0x83c4('0x36')]));_0x3ec9f1[_0x83c4('0x34')]=_0x3ec9f1['attributes']['length']?_0x3ec9f1['attributes']:_0x3be9b1[_0x83c4('0x2f')];_0x3ec9f1['order']=qs[_0x83c4('0x3b')](_0x4c1c53[_0x83c4('0x31')][_0x83c4('0x3b')]);_0x3ec9f1[_0x83c4('0x3c')]=qs[_0x83c4('0x33')](_[_0x83c4('0x3d')](_0x4c1c53[_0x83c4('0x31')],_0x3be9b1['filters']));if(_0x4c1c53[_0x83c4('0x31')][_0x83c4('0x3e')]){_0x3ec9f1[_0x83c4('0x3c')]=_['merge'](_0x3ec9f1['where'],{'$or':_[_0x83c4('0x30')](_0x3ec9f1[_0x83c4('0x34')],function(_0x58c35d){var _0x58c622={};_0x58c622[_0x58c35d]={'$like':'%'+_0x4c1c53['query'][_0x83c4('0x3e')]+'%'};return _0x58c622;})});}_0x3ec9f1=_['merge']({},_0x3ec9f1,_0x4c1c53['options']);return _0x3e2a45['getDescriptions'](_0x3ec9f1);}})[_0x83c4('0x42')](function(_0x3fd267){if(_0x3fd267){_0x2369ae=_0x3fd267[_0x83c4('0x37')];if(!_0x4c1c53[_0x83c4('0x31')]['hasOwnProperty']('nolimit')){_0x3ec9f1[_0x83c4('0x1d')]=qs[_0x83c4('0x1d')](_0x4c1c53[_0x83c4('0x31')][_0x83c4('0x1d')]);_0x3ec9f1[_0x83c4('0x1b')]=qs[_0x83c4('0x1b')](_0x4c1c53[_0x83c4('0x31')][_0x83c4('0x1b')]);}return _0x3e2a45[_0x83c4('0x51')](_0x3ec9f1);}})[_0x83c4('0x42')](function(_0x2b19c7){if(_0x2b19c7){return _0x2b19c7?{'count':_0x2369ae,'rows':_0x2b19c7}:null;}})[_0x83c4('0x42')](respondWithResult(_0x546225,null))[_0x83c4('0x46')](handleError(_0x546225,null));};exports[_0x83c4('0x52')]=function(_0xe67ff7,_0x5c0732,_0x363c28){var _0x1cfddf={};var _0x3c76d0={};var _0x389c1c;var _0x4ca318;return db[_0x83c4('0x2b')][_0x83c4('0x50')]({'where':{'id':_0xe67ff7['params']['id']}})[_0x83c4('0x42')](handleEntityNotFound(_0x5c0732,null))['then'](function(_0x527273){if(_0x527273){_0x389c1c=_0x527273;_0x3c76d0[_0x83c4('0x2f')]=_['keys'](db['Tag'][_0x83c4('0x48')]);_0x3c76d0['query']=_[_0x83c4('0x32')](_0xe67ff7['query']);_0x3c76d0[_0x83c4('0x33')]=_[_0x83c4('0x35')](_0x3c76d0[_0x83c4('0x2f')],_0x3c76d0[_0x83c4('0x31')]);_0x1cfddf[_0x83c4('0x34')]=_[_0x83c4('0x35')](_0x3c76d0[_0x83c4('0x2f')],qs[_0x83c4('0x36')](_0xe67ff7[_0x83c4('0x31')][_0x83c4('0x36')]));_0x1cfddf[_0x83c4('0x34')]=_0x1cfddf[_0x83c4('0x34')][_0x83c4('0x37')]?_0x1cfddf[_0x83c4('0x34')]:_0x3c76d0[_0x83c4('0x2f')];_0x1cfddf[_0x83c4('0x3a')]=qs[_0x83c4('0x3b')](_0xe67ff7['query']['sort']);_0x1cfddf[_0x83c4('0x3c')]=qs[_0x83c4('0x33')](_[_0x83c4('0x3d')](_0xe67ff7[_0x83c4('0x31')],_0x3c76d0['filters']));if(_0xe67ff7[_0x83c4('0x31')]['filter']){_0x1cfddf[_0x83c4('0x3c')]=_[_0x83c4('0x3f')](_0x1cfddf[_0x83c4('0x3c')],{'$or':_['map'](_0x1cfddf[_0x83c4('0x34')],function(_0xd1d228){var _0x1d3ec2={};_0x1d3ec2[_0xd1d228]={'$like':'%'+_0xe67ff7[_0x83c4('0x31')][_0x83c4('0x3e')]+'%'};return _0x1d3ec2;})});}_0x1cfddf=_[_0x83c4('0x3f')]({},_0x1cfddf,_0xe67ff7[_0x83c4('0x41')]);return _0x389c1c[_0x83c4('0x52')](_0x1cfddf);}})['then'](function(_0x189cb0){if(_0x189cb0){_0x4ca318=_0x189cb0[_0x83c4('0x37')];if(!_0xe67ff7[_0x83c4('0x31')][_0x83c4('0x38')]('nolimit')){_0x1cfddf[_0x83c4('0x1d')]=qs[_0x83c4('0x1d')](_0xe67ff7[_0x83c4('0x31')][_0x83c4('0x1d')]);_0x1cfddf[_0x83c4('0x1b')]=qs[_0x83c4('0x1b')](_0xe67ff7[_0x83c4('0x31')]['offset']);}return _0x389c1c[_0x83c4('0x52')](_0x1cfddf);}})[_0x83c4('0x42')](function(_0x377bd1){if(_0x377bd1){return _0x377bd1?{'count':_0x4ca318,'rows':_0x377bd1}:null;}})['then'](respondWithResult(_0x5c0732,null))[_0x83c4('0x46')](handleError(_0x5c0732,null));};exports[_0x83c4('0x53')]=function(_0x12413c,_0x25cd58,_0x45178a){if(_0x12413c[_0x83c4('0x4b')]['id']){delete _0x12413c['body']['id'];}return db[_0x83c4('0x2b')][_0x83c4('0x50')]({'where':{'id':_0x12413c[_0x83c4('0x4c')]['id']}})[_0x83c4('0x42')](handleEntityNotFound(_0x25cd58,null))['then'](function(_0x24259c){if(_0x24259c){return _0x24259c[_0x83c4('0x53')](_0x12413c[_0x83c4('0x4b')][_0x83c4('0x54')]||[]);}return null;})[_0x83c4('0x42')](respondWithResult(_0x25cd58,null))['catch'](handleError(_0x25cd58,null));}; \ No newline at end of file +var _0x3499=['ioredis','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','ZendeskConfiguration','findAll','rows','catch','show','params','options','create','body','find','getFields','findOne','ZendeskField','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','querystring'];(function(_0x15d5b3,_0x42f627){var _0x7502c6=function(_0x4d2582){while(--_0x4d2582){_0x15d5b3['push'](_0x15d5b3['shift']());}};_0x7502c6(++_0x42f627);}(_0x3499,0xe6));var _0x9349=function(_0xa4f636,_0xaca1b6){_0xa4f636=_0xa4f636-0x0;var _0x37e02a=_0x3499[_0xa4f636];return _0x37e02a;};'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(_0x9349('0x0'));var moment=require(_0x9349('0x1'));var BPromise=require(_0x9349('0x2'));var Mustache=require(_0x9349('0x3'));var util=require(_0x9349('0x4'));var path=require(_0x9349('0x5'));var sox=require(_0x9349('0x6'));var csv=require('to-csv');var ejs=require(_0x9349('0x7'));var fs=require('fs');var fs_extra=require(_0x9349('0x8'));var _=require('lodash');var squel=require(_0x9349('0x9'));var crypto=require(_0x9349('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x9349('0xb'));var toCsv=require('to-csv');var querystring=require(_0x9349('0xc'));var Papa=require('papaparse');var Redis=require(_0x9349('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x9349('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9349('0xf'));var utils=require('../../config/utils');var config=require(_0x9349('0x10'));var licenseUtil=require(_0x9349('0x11'));var db=require(_0x9349('0x12'))['db'];function respondWithStatusCode(_0x74ec23,_0x477d99){_0x477d99=_0x477d99||0xcc;return function(_0xca52dd){if(_0xca52dd){return _0x74ec23[_0x9349('0x13')](_0x477d99);}return _0x74ec23[_0x9349('0x14')](_0x477d99)['end']();};}function respondWithResult(_0x11f506,_0x1ea233){_0x1ea233=_0x1ea233||0xc8;return function(_0x2026c3){if(_0x2026c3){return _0x11f506[_0x9349('0x14')](_0x1ea233)[_0x9349('0x15')](_0x2026c3);}};}function respondWithFilteredResult(_0x10eef2,_0xf0ad1d){return function(_0x4de87e){if(_0x4de87e){var _0x3520f8=typeof _0xf0ad1d['offset']===_0x9349('0x16')&&typeof _0xf0ad1d[_0x9349('0x17')]==='undefined';var _0x2d842a=_0x4de87e[_0x9349('0x18')];var _0x24cb4a=_0x3520f8?0x0:_0xf0ad1d[_0x9349('0x19')];var _0x4f9b63=_0x3520f8?_0x4de87e[_0x9349('0x18')]:_0xf0ad1d[_0x9349('0x19')]+_0xf0ad1d['limit'];var _0x2e2964;if(_0x4f9b63>=_0x2d842a){_0x4f9b63=_0x2d842a;_0x2e2964=0xc8;}else{_0x2e2964=0xce;}_0x10eef2[_0x9349('0x14')](_0x2e2964);return _0x10eef2[_0x9349('0x1a')](_0x9349('0x1b'),_0x24cb4a+'-'+_0x4f9b63+'/'+_0x2d842a)['json'](_0x4de87e);}return null;};}function patchUpdates(_0x56c3b7){return function(_0x12d512){try{jsonpatch[_0x9349('0x1c')](_0x12d512,_0x56c3b7,!![]);}catch(_0x586067){return BPromise[_0x9349('0x1d')](_0x586067);}return _0x12d512[_0x9349('0x1e')]();};}function saveUpdates(_0x41b7ee,_0x5d5ad7){return function(_0x469ddd){if(_0x469ddd){return _0x469ddd[_0x9349('0x1f')](_0x41b7ee)[_0x9349('0x20')](function(_0x247bda){return _0x247bda;});}return null;};}function removeEntity(_0x4ee297,_0x8de1a8){return function(_0x2f46c4){if(_0x2f46c4){return _0x2f46c4[_0x9349('0x21')]()[_0x9349('0x20')](function(){_0x4ee297[_0x9349('0x14')](0xcc)[_0x9349('0x22')]();});}};}function handleEntityNotFound(_0x31551b,_0x43c1c1){return function(_0x5cb2ba){if(!_0x5cb2ba){_0x31551b[_0x9349('0x13')](0x194);}return _0x5cb2ba;};}function handleError(_0x20ca08,_0x2969b1){_0x2969b1=_0x2969b1||0x1f4;return function(_0x1ff7a8){logger['error'](_0x1ff7a8['stack']);if(_0x1ff7a8[_0x9349('0x23')]){delete _0x1ff7a8[_0x9349('0x23')];}_0x20ca08[_0x9349('0x14')](_0x2969b1)[_0x9349('0x24')](_0x1ff7a8);};}exports[_0x9349('0x25')]=function(_0x5aeaf1,_0x3548c1){var _0x380a94={},_0x23c631={},_0x430d7f={'count':0x0,'rows':[]};var _0x567b10=_[_0x9349('0x26')](db['ZendeskConfiguration'][_0x9349('0x27')],function(_0x541147){return{'name':_0x541147[_0x9349('0x28')],'type':_0x541147[_0x9349('0x29')][_0x9349('0x2a')]};});_0x23c631[_0x9349('0x2b')]=_['map'](_0x567b10,_0x9349('0x23'));_0x23c631[_0x9349('0x2c')]=_[_0x9349('0x2d')](_0x5aeaf1[_0x9349('0x2c')]);_0x23c631[_0x9349('0x2e')]=_[_0x9349('0x2f')](_0x23c631[_0x9349('0x2b')],_0x23c631['query']);_0x380a94['attributes']=_[_0x9349('0x2f')](_0x23c631[_0x9349('0x2b')],qs[_0x9349('0x30')](_0x5aeaf1[_0x9349('0x2c')][_0x9349('0x30')]));_0x380a94['attributes']=_0x380a94[_0x9349('0x31')][_0x9349('0x32')]?_0x380a94['attributes']:_0x23c631[_0x9349('0x2b')];if(!_0x5aeaf1[_0x9349('0x2c')][_0x9349('0x33')]('nolimit')){_0x380a94[_0x9349('0x17')]=qs[_0x9349('0x17')](_0x5aeaf1['query']['limit']);_0x380a94['offset']=qs[_0x9349('0x19')](_0x5aeaf1[_0x9349('0x2c')][_0x9349('0x19')]);}_0x380a94[_0x9349('0x34')]=qs[_0x9349('0x35')](_0x5aeaf1[_0x9349('0x2c')][_0x9349('0x35')]);_0x380a94[_0x9349('0x36')]=qs['filters'](_[_0x9349('0x37')](_0x5aeaf1[_0x9349('0x2c')],_0x23c631[_0x9349('0x2e')]),_0x567b10);if(_0x5aeaf1[_0x9349('0x2c')][_0x9349('0x38')]){_0x380a94[_0x9349('0x36')]=_[_0x9349('0x39')](_0x380a94[_0x9349('0x36')],{'$or':_[_0x9349('0x26')](_0x567b10,function(_0x4e51a4){if(_0x4e51a4[_0x9349('0x29')]!==_0x9349('0x3a')){var _0x2ca4f5={};_0x2ca4f5[_0x4e51a4[_0x9349('0x23')]]={'$like':'%'+_0x5aeaf1[_0x9349('0x2c')][_0x9349('0x38')]+'%'};return _0x2ca4f5;}})});}_0x380a94=_[_0x9349('0x39')]({},_0x380a94,_0x5aeaf1['options']);var _0x2d0873={'where':_0x380a94[_0x9349('0x36')]};return db['ZendeskConfiguration'][_0x9349('0x18')](_0x2d0873)[_0x9349('0x20')](function(_0x262672){_0x430d7f[_0x9349('0x18')]=_0x262672;if(_0x5aeaf1[_0x9349('0x2c')][_0x9349('0x3b')]){_0x380a94[_0x9349('0x3c')]=[{'all':!![]}];}return db[_0x9349('0x3d')][_0x9349('0x3e')](_0x380a94);})[_0x9349('0x20')](function(_0x3f625d){_0x430d7f[_0x9349('0x3f')]=_0x3f625d;return _0x430d7f;})[_0x9349('0x20')](respondWithFilteredResult(_0x3548c1,_0x380a94))[_0x9349('0x40')](handleError(_0x3548c1,null));};exports[_0x9349('0x41')]=function(_0x412f91,_0x4dd9ab){var _0x1f96c2={'raw':![],'where':{'id':_0x412f91[_0x9349('0x42')]['id']}},_0x41732b={};_0x41732b[_0x9349('0x2b')]=_[_0x9349('0x2d')](db[_0x9349('0x3d')][_0x9349('0x27')]);_0x41732b[_0x9349('0x2c')]=_[_0x9349('0x2d')](_0x412f91[_0x9349('0x2c')]);_0x41732b['filters']=_[_0x9349('0x2f')](_0x41732b['model'],_0x41732b['query']);_0x1f96c2[_0x9349('0x31')]=_[_0x9349('0x2f')](_0x41732b['model'],qs[_0x9349('0x30')](_0x412f91[_0x9349('0x2c')][_0x9349('0x30')]));_0x1f96c2[_0x9349('0x31')]=_0x1f96c2[_0x9349('0x31')]['length']?_0x1f96c2[_0x9349('0x31')]:_0x41732b['model'];if(_0x412f91['query']['includeAll']){_0x1f96c2[_0x9349('0x3c')]=[{'all':!![]}];}_0x1f96c2=_['merge']({},_0x1f96c2,_0x412f91[_0x9349('0x43')]);return db[_0x9349('0x3d')]['find'](_0x1f96c2)['then'](handleEntityNotFound(_0x4dd9ab,null))[_0x9349('0x20')](respondWithResult(_0x4dd9ab,null))[_0x9349('0x40')](handleError(_0x4dd9ab,null));};exports['create']=function(_0x3c8b24,_0x172bc2){return db['ZendeskConfiguration'][_0x9349('0x44')](_0x3c8b24['body'],{})['then'](respondWithResult(_0x172bc2,0xc9))['catch'](handleError(_0x172bc2,null));};exports[_0x9349('0x1f')]=function(_0x42a2c3,_0x5b9ad2){if(_0x42a2c3[_0x9349('0x45')]['id']){delete _0x42a2c3[_0x9349('0x45')]['id'];}return db[_0x9349('0x3d')][_0x9349('0x46')]({'where':{'id':_0x42a2c3[_0x9349('0x42')]['id']}})[_0x9349('0x20')](handleEntityNotFound(_0x5b9ad2,null))[_0x9349('0x20')](saveUpdates(_0x42a2c3[_0x9349('0x45')],null))[_0x9349('0x20')](respondWithResult(_0x5b9ad2,null))[_0x9349('0x40')](handleError(_0x5b9ad2,null));};exports[_0x9349('0x21')]=function(_0x3c5f6e,_0x434ac3){return db['ZendeskConfiguration'][_0x9349('0x46')]({'where':{'id':_0x3c5f6e['params']['id']}})['then'](handleEntityNotFound(_0x434ac3,null))[_0x9349('0x20')](removeEntity(_0x434ac3,null))[_0x9349('0x40')](handleError(_0x434ac3,null));};exports[_0x9349('0x47')]=function(_0x1b0c11,_0x53ad8e,_0x1f13aa){var _0x2a2e42={};var _0x3061c2={};var _0x4c1750;var _0x3fbe76;return db[_0x9349('0x3d')][_0x9349('0x48')]({'where':{'id':_0x1b0c11[_0x9349('0x42')]['id']}})[_0x9349('0x20')](handleEntityNotFound(_0x53ad8e,null))['then'](function(_0x19a225){if(_0x19a225){_0x4c1750=_0x19a225;_0x3061c2['model']=_[_0x9349('0x2d')](db[_0x9349('0x49')][_0x9349('0x27')]);_0x3061c2[_0x9349('0x2c')]=_[_0x9349('0x2d')](_0x1b0c11[_0x9349('0x2c')]);_0x3061c2['filters']=_[_0x9349('0x2f')](_0x3061c2[_0x9349('0x2b')],_0x3061c2[_0x9349('0x2c')]);_0x2a2e42[_0x9349('0x31')]=_[_0x9349('0x2f')](_0x3061c2[_0x9349('0x2b')],qs[_0x9349('0x30')](_0x1b0c11[_0x9349('0x2c')][_0x9349('0x30')]));_0x2a2e42['attributes']=_0x2a2e42[_0x9349('0x31')][_0x9349('0x32')]?_0x2a2e42[_0x9349('0x31')]:_0x3061c2[_0x9349('0x2b')];_0x2a2e42[_0x9349('0x34')]=qs[_0x9349('0x35')](_0x1b0c11[_0x9349('0x2c')]['sort']);_0x2a2e42[_0x9349('0x36')]=qs[_0x9349('0x2e')](_[_0x9349('0x37')](_0x1b0c11[_0x9349('0x2c')],_0x3061c2[_0x9349('0x2e')]));if(_0x1b0c11['query']['filter']){_0x2a2e42[_0x9349('0x36')]=_[_0x9349('0x39')](_0x2a2e42[_0x9349('0x36')],{'$or':_['map'](_0x2a2e42['attributes'],function(_0x41f523){var _0x126c78={};_0x126c78[_0x41f523]={'$like':'%'+_0x1b0c11[_0x9349('0x2c')][_0x9349('0x38')]+'%'};return _0x126c78;})});}_0x2a2e42=_[_0x9349('0x39')]({},_0x2a2e42,_0x1b0c11[_0x9349('0x43')]);return _0x4c1750['getFields'](_0x2a2e42);}})[_0x9349('0x20')](function(_0x5a02dc){if(_0x5a02dc){_0x3fbe76=_0x5a02dc['length'];if(!_0x1b0c11['query']['hasOwnProperty'](_0x9349('0x4a'))){_0x2a2e42[_0x9349('0x17')]=qs[_0x9349('0x17')](_0x1b0c11[_0x9349('0x2c')][_0x9349('0x17')]);_0x2a2e42[_0x9349('0x19')]=qs[_0x9349('0x19')](_0x1b0c11[_0x9349('0x2c')][_0x9349('0x19')]);}return _0x4c1750['getFields'](_0x2a2e42);}})[_0x9349('0x20')](function(_0x4e364d){if(_0x4e364d){return _0x4e364d?{'count':_0x3fbe76,'rows':_0x4e364d}:null;}})[_0x9349('0x20')](respondWithResult(_0x53ad8e,null))['catch'](handleError(_0x53ad8e,null));};exports[_0x9349('0x4b')]=function(_0x4f592c,_0x3c3dde,_0x2ee597){var _0x2602b7={};var _0x3fbb8c={};var _0x320a92;var _0x8474df;return db['ZendeskConfiguration'][_0x9349('0x48')]({'where':{'id':_0x4f592c[_0x9349('0x42')]['id']}})[_0x9349('0x20')](handleEntityNotFound(_0x3c3dde,null))[_0x9349('0x20')](function(_0x5aa3cf){if(_0x5aa3cf){_0x320a92=_0x5aa3cf;_0x3fbb8c[_0x9349('0x2b')]=_[_0x9349('0x2d')](db[_0x9349('0x49')]['rawAttributes']);_0x3fbb8c[_0x9349('0x2c')]=_[_0x9349('0x2d')](_0x4f592c[_0x9349('0x2c')]);_0x3fbb8c[_0x9349('0x2e')]=_['intersection'](_0x3fbb8c[_0x9349('0x2b')],_0x3fbb8c[_0x9349('0x2c')]);_0x2602b7[_0x9349('0x31')]=_['intersection'](_0x3fbb8c[_0x9349('0x2b')],qs[_0x9349('0x30')](_0x4f592c['query'][_0x9349('0x30')]));_0x2602b7['attributes']=_0x2602b7[_0x9349('0x31')]['length']?_0x2602b7[_0x9349('0x31')]:_0x3fbb8c['model'];_0x2602b7[_0x9349('0x34')]=qs[_0x9349('0x35')](_0x4f592c[_0x9349('0x2c')][_0x9349('0x35')]);_0x2602b7[_0x9349('0x36')]=qs[_0x9349('0x2e')](_['pick'](_0x4f592c['query'],_0x3fbb8c[_0x9349('0x2e')]));if(_0x4f592c['query'][_0x9349('0x38')]){_0x2602b7[_0x9349('0x36')]=_['merge'](_0x2602b7[_0x9349('0x36')],{'$or':_[_0x9349('0x26')](_0x2602b7[_0x9349('0x31')],function(_0x122edf){var _0x559580={};_0x559580[_0x122edf]={'$like':'%'+_0x4f592c[_0x9349('0x2c')][_0x9349('0x38')]+'%'};return _0x559580;})});}_0x2602b7=_[_0x9349('0x39')]({},_0x2602b7,_0x4f592c['options']);return _0x320a92[_0x9349('0x4b')](_0x2602b7);}})[_0x9349('0x20')](function(_0x383c89){if(_0x383c89){_0x8474df=_0x383c89[_0x9349('0x32')];if(!_0x4f592c[_0x9349('0x2c')][_0x9349('0x33')]('nolimit')){_0x2602b7[_0x9349('0x17')]=qs['limit'](_0x4f592c[_0x9349('0x2c')]['limit']);_0x2602b7[_0x9349('0x19')]=qs[_0x9349('0x19')](_0x4f592c['query'][_0x9349('0x19')]);}return _0x320a92[_0x9349('0x4b')](_0x2602b7);}})[_0x9349('0x20')](function(_0x3c0454){if(_0x3c0454){return _0x3c0454?{'count':_0x8474df,'rows':_0x3c0454}:null;}})[_0x9349('0x20')](respondWithResult(_0x3c3dde,null))['catch'](handleError(_0x3c3dde,null));};exports[_0x9349('0x4c')]=function(_0x28ba99,_0x36bb6e,_0xf404ed){var _0x5999cb={};var _0x23fc60={};var _0x54dede;var _0x22792c;return db['ZendeskConfiguration'][_0x9349('0x48')]({'where':{'id':_0x28ba99[_0x9349('0x42')]['id']}})[_0x9349('0x20')](handleEntityNotFound(_0x36bb6e,null))['then'](function(_0x5ed8f3){if(_0x5ed8f3){_0x54dede=_0x5ed8f3;_0x23fc60[_0x9349('0x2b')]=_[_0x9349('0x2d')](db['ZendeskField'][_0x9349('0x27')]);_0x23fc60[_0x9349('0x2c')]=_[_0x9349('0x2d')](_0x28ba99[_0x9349('0x2c')]);_0x23fc60['filters']=_[_0x9349('0x2f')](_0x23fc60['model'],_0x23fc60['query']);_0x5999cb['attributes']=_['intersection'](_0x23fc60[_0x9349('0x2b')],qs[_0x9349('0x30')](_0x28ba99[_0x9349('0x2c')][_0x9349('0x30')]));_0x5999cb['attributes']=_0x5999cb[_0x9349('0x31')][_0x9349('0x32')]?_0x5999cb[_0x9349('0x31')]:_0x23fc60[_0x9349('0x2b')];_0x5999cb[_0x9349('0x34')]=qs['sort'](_0x28ba99['query'][_0x9349('0x35')]);_0x5999cb[_0x9349('0x36')]=qs['filters'](_['pick'](_0x28ba99[_0x9349('0x2c')],_0x23fc60['filters']));if(_0x28ba99[_0x9349('0x2c')][_0x9349('0x38')]){_0x5999cb[_0x9349('0x36')]=_['merge'](_0x5999cb[_0x9349('0x36')],{'$or':_[_0x9349('0x26')](_0x5999cb['attributes'],function(_0x2829cb){var _0x1938dd={};_0x1938dd[_0x2829cb]={'$like':'%'+_0x28ba99[_0x9349('0x2c')][_0x9349('0x38')]+'%'};return _0x1938dd;})});}_0x5999cb=_[_0x9349('0x39')]({},_0x5999cb,_0x28ba99[_0x9349('0x43')]);return _0x54dede[_0x9349('0x4c')](_0x5999cb);}})[_0x9349('0x20')](function(_0x426dbb){if(_0x426dbb){_0x22792c=_0x426dbb[_0x9349('0x32')];if(!_0x28ba99[_0x9349('0x2c')][_0x9349('0x33')]('nolimit')){_0x5999cb['limit']=qs[_0x9349('0x17')](_0x28ba99[_0x9349('0x2c')][_0x9349('0x17')]);_0x5999cb[_0x9349('0x19')]=qs[_0x9349('0x19')](_0x28ba99[_0x9349('0x2c')][_0x9349('0x19')]);}return _0x54dede['getDescriptions'](_0x5999cb);}})[_0x9349('0x20')](function(_0x1ed7f0){if(_0x1ed7f0){return _0x1ed7f0?{'count':_0x22792c,'rows':_0x1ed7f0}:null;}})[_0x9349('0x20')](respondWithResult(_0x36bb6e,null))[_0x9349('0x40')](handleError(_0x36bb6e,null));};exports[_0x9349('0x4d')]=function(_0x5085ca,_0x3ef630,_0x3b20eb){var _0x1539ad={};var _0x483b5f={};var _0x2e321e;var _0x5a720e;return db[_0x9349('0x3d')]['findOne']({'where':{'id':_0x5085ca[_0x9349('0x42')]['id']}})[_0x9349('0x20')](handleEntityNotFound(_0x3ef630,null))['then'](function(_0x56c734){if(_0x56c734){_0x2e321e=_0x56c734;_0x483b5f[_0x9349('0x2b')]=_['keys'](db[_0x9349('0x4e')][_0x9349('0x27')]);_0x483b5f[_0x9349('0x2c')]=_[_0x9349('0x2d')](_0x5085ca[_0x9349('0x2c')]);_0x483b5f[_0x9349('0x2e')]=_[_0x9349('0x2f')](_0x483b5f['model'],_0x483b5f[_0x9349('0x2c')]);_0x1539ad[_0x9349('0x31')]=_['intersection'](_0x483b5f['model'],qs[_0x9349('0x30')](_0x5085ca[_0x9349('0x2c')][_0x9349('0x30')]));_0x1539ad[_0x9349('0x31')]=_0x1539ad[_0x9349('0x31')][_0x9349('0x32')]?_0x1539ad[_0x9349('0x31')]:_0x483b5f[_0x9349('0x2b')];_0x1539ad[_0x9349('0x34')]=qs[_0x9349('0x35')](_0x5085ca['query'][_0x9349('0x35')]);_0x1539ad[_0x9349('0x36')]=qs[_0x9349('0x2e')](_[_0x9349('0x37')](_0x5085ca[_0x9349('0x2c')],_0x483b5f[_0x9349('0x2e')]));if(_0x5085ca[_0x9349('0x2c')][_0x9349('0x38')]){_0x1539ad[_0x9349('0x36')]=_[_0x9349('0x39')](_0x1539ad['where'],{'$or':_[_0x9349('0x26')](_0x1539ad[_0x9349('0x31')],function(_0x7a16cc){var _0x11e30c={};_0x11e30c[_0x7a16cc]={'$like':'%'+_0x5085ca['query'][_0x9349('0x38')]+'%'};return _0x11e30c;})});}_0x1539ad=_[_0x9349('0x39')]({},_0x1539ad,_0x5085ca['options']);return _0x2e321e[_0x9349('0x4d')](_0x1539ad);}})[_0x9349('0x20')](function(_0x3e97cc){if(_0x3e97cc){_0x5a720e=_0x3e97cc['length'];if(!_0x5085ca[_0x9349('0x2c')][_0x9349('0x33')](_0x9349('0x4a'))){_0x1539ad[_0x9349('0x17')]=qs[_0x9349('0x17')](_0x5085ca[_0x9349('0x2c')][_0x9349('0x17')]);_0x1539ad[_0x9349('0x19')]=qs['offset'](_0x5085ca[_0x9349('0x2c')][_0x9349('0x19')]);}return _0x2e321e[_0x9349('0x4d')](_0x1539ad);}})['then'](function(_0x35d91f){if(_0x35d91f){return _0x35d91f?{'count':_0x5a720e,'rows':_0x35d91f}:null;}})[_0x9349('0x20')](respondWithResult(_0x3ef630,null))[_0x9349('0x40')](handleError(_0x3ef630,null));};exports[_0x9349('0x4f')]=function(_0x321697,_0x177652,_0x3c4d3c){if(_0x321697[_0x9349('0x45')]['id']){delete _0x321697[_0x9349('0x45')]['id'];}return db[_0x9349('0x3d')][_0x9349('0x48')]({'where':{'id':_0x321697[_0x9349('0x42')]['id']}})[_0x9349('0x20')](handleEntityNotFound(_0x177652,null))[_0x9349('0x20')](function(_0x34e9d8){if(_0x34e9d8){return _0x34e9d8[_0x9349('0x4f')](_0x321697[_0x9349('0x45')][_0x9349('0x50')]||[]);}return null;})[_0x9349('0x20')](respondWithResult(_0x177652,null))['catch'](handleError(_0x177652,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index b6d563b..b3c0efc 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 _0xea28=['../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3b712d,_0x10e9e0){var _0x36a04b=function(_0x4dad8c){while(--_0x4dad8c){_0x3b712d['push'](_0x3b712d['shift']());}};_0x36a04b(++_0x10e9e0);}(_0xea28,0x13a));var _0x8ea2=function(_0x2f5530,_0x1036fd){_0x2f5530=_0x2f5530-0x0;var _0x583385=_0xea28[_0x2f5530];return _0x583385;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var logger=require(_0x8ea2('0x2'))(_0x8ea2('0x3'));var moment=require(_0x8ea2('0x4'));var BPromise=require(_0x8ea2('0x5'));var rp=require(_0x8ea2('0x6'));var fs=require('fs');var path=require(_0x8ea2('0x7'));var rimraf=require('rimraf');var config=require(_0x8ea2('0x8'));var attributes=require(_0x8ea2('0x9'));module[_0x8ea2('0xa')]=function(_0x513a0d,_0x29b82b){return _0x513a0d[_0x8ea2('0xb')](_0x8ea2('0xc'),attributes,{'tableName':_0x8ea2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d25=['api','moment','bluebird','request-promise','path','define','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger'];(function(_0x29352f,_0x458a13){var _0x217e89=function(_0x54ec85){while(--_0x54ec85){_0x29352f['push'](_0x29352f['shift']());}};_0x217e89(++_0x458a13);}(_0x7d25,0x8a));var _0x57d2=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x7d25[_0x3070dc];return _0x431489;};'use strict';var _=require('lodash');var util=require(_0x57d2('0x0'));var logger=require(_0x57d2('0x1'))(_0x57d2('0x2'));var moment=require(_0x57d2('0x3'));var BPromise=require(_0x57d2('0x4'));var rp=require(_0x57d2('0x5'));var fs=require('fs');var path=require(_0x57d2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0x3c5511,_0x49cc5f){return _0x3c5511[_0x57d2('0x7')](_0x57d2('0x8'),attributes,{'tableName':_0x57d2('0x9'),'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 e61ad6a..c8c6ead 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 _0xa6ed=['jayson/promise','client','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x506216,_0x27efd8){var _0x346bee=function(_0x3d613b){while(--_0x3d613b){_0x506216['push'](_0x506216['shift']());}};_0x346bee(++_0x27efd8);}(_0xa6ed,0x12f));var _0xda6e=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xa6ed[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xda6e('0x0'));var util=require(_0xda6e('0x1'));var moment=require('moment');var BPromise=require(_0xda6e('0x2'));var rs=require(_0xda6e('0x3'));var fs=require('fs');var Redis=require(_0xda6e('0x4'));var db=require(_0xda6e('0x5'))['db'];var utils=require(_0xda6e('0x6'));var logger=require(_0xda6e('0x7'))('rpc');var config=require(_0xda6e('0x8'));var jayson=require(_0xda6e('0x9'));var client=jayson[_0xda6e('0xa')][_0xda6e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x90b962,_0xcc181f,_0x24d70a){return new BPromise(function(_0x29f96a,_0xe2941f){return client[_0xda6e('0xc')](_0x90b962,_0x24d70a)[_0xda6e('0xd')](function(_0x40e8ec){logger['info'](_0xda6e('0xe'),_0xcc181f,_0xda6e('0xf'));logger[_0xda6e('0x10')](_0xda6e('0x11'),_0xcc181f,_0xda6e('0xf'),JSON[_0xda6e('0x12')](_0x40e8ec));if(_0x40e8ec[_0xda6e('0x13')]){if(_0x40e8ec[_0xda6e('0x13')][_0xda6e('0x14')]===0x1f4){logger[_0xda6e('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0xcc181f,_0x40e8ec[_0xda6e('0x13')]['message']);return _0xe2941f(_0x40e8ec[_0xda6e('0x13')]['message']);}logger['error'](_0xda6e('0xe'),_0xcc181f,_0x40e8ec['error'][_0xda6e('0x15')]);return _0x29f96a(_0x40e8ec[_0xda6e('0x13')][_0xda6e('0x15')]);}else{logger[_0xda6e('0x16')]('ZendeskConfiguration,\x20%s,\x20%s',_0xcc181f,_0xda6e('0xf'));_0x29f96a(_0x40e8ec['result'][_0xda6e('0x15')]);}})[_0xda6e('0x17')](function(_0x546ba7){logger[_0xda6e('0x13')](_0xda6e('0xe'),_0xcc181f,_0x546ba7);_0xe2941f(_0x546ba7);});});} \ No newline at end of file +var _0x4b43=['../../config/utils','rpc','../../config/environment','client','then','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x4b43,0x13b));var _0x34b4=function(_0x187364,_0x44a6fc){_0x187364=_0x187364-0x0;var _0x88bd8b=_0x4b43[_0x187364];return _0x88bd8b;};'use strict';var _=require('lodash');var util=require(_0x34b4('0x0'));var moment=require(_0x34b4('0x1'));var BPromise=require(_0x34b4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34b4('0x3'));var db=require(_0x34b4('0x4'))['db'];var utils=require(_0x34b4('0x5'));var logger=require('../../config/logger')(_0x34b4('0x6'));var config=require(_0x34b4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x34b4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4882b3,_0x2cb493,_0x5b54cc){return new BPromise(function(_0x5750b6,_0x348955){return client['request'](_0x4882b3,_0x5b54cc)[_0x34b4('0x9')](function(_0xff8961){logger[_0x34b4('0xa')](_0x34b4('0xb'),_0x2cb493,'request\x20sent');logger[_0x34b4('0xc')](_0x34b4('0xd'),_0x2cb493,'request\x20sent',JSON[_0x34b4('0xe')](_0xff8961));if(_0xff8961[_0x34b4('0xf')]){if(_0xff8961[_0x34b4('0xf')]['code']===0x1f4){logger[_0x34b4('0xf')](_0x34b4('0xb'),_0x2cb493,_0xff8961['error']['message']);return _0x348955(_0xff8961[_0x34b4('0xf')][_0x34b4('0x10')]);}logger['error'](_0x34b4('0xb'),_0x2cb493,_0xff8961['error'][_0x34b4('0x10')]);return _0x5750b6(_0xff8961[_0x34b4('0xf')][_0x34b4('0x10')]);}else{logger[_0x34b4('0xa')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2cb493,_0x34b4('0x11'));_0x5750b6(_0xff8961[_0x34b4('0x12')]['message']);}})[_0x34b4('0x13')](function(_0x160ad9){logger[_0x34b4('0xf')](_0x34b4('0xb'),_0x2cb493,_0x160ad9);_0x348955(_0x160ad9);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index c38fd6b..a115eb3 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 _0xe72a=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','/:id','show','post','create'];(function(_0x23bd35,_0x18378e){var _0x36fd42=function(_0x1ccd48){while(--_0x1ccd48){_0x23bd35['push'](_0x23bd35['shift']());}};_0x36fd42(++_0x18378e);}(_0xe72a,0xc1));var _0xae72=function(_0xf290f,_0x3c9e5c){_0xf290f=_0xf290f-0x0;var _0x429c79=_0xe72a[_0xf290f];return _0x429c79;};'use strict';var multer=require(_0xae72('0x0'));var util=require(_0xae72('0x1'));var path=require('path');var timeout=require(_0xae72('0x2'));var express=require(_0xae72('0x3'));var router=express[_0xae72('0x4')]();var fs_extra=require(_0xae72('0x5'));var auth=require(_0xae72('0x6'));var interaction=require(_0xae72('0x7'));var config=require(_0xae72('0x8'));var controller=require(_0xae72('0x9'));router[_0xae72('0xa')]('/',auth[_0xae72('0xb')](),controller['index']);router[_0xae72('0xa')](_0xae72('0xc'),auth[_0xae72('0xb')](),controller[_0xae72('0xd')]);router[_0xae72('0xe')]('/',auth['isAuthenticated'](),controller[_0xae72('0xf')]);router['put']('/:id',auth[_0xae72('0xb')](),controller['update']);router[_0xae72('0x10')](_0xae72('0xc'),auth[_0xae72('0xb')](),controller[_0xae72('0x11')]);module[_0xae72('0x12')]=router; \ No newline at end of file +var _0xd972=['exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./intZendeskField.controller','get','index','isAuthenticated','show','post','create','/:id','delete'];(function(_0x5a06d9,_0xf62efa){var _0x5c1012=function(_0x45df53){while(--_0x45df53){_0x5a06d9['push'](_0x5a06d9['shift']());}};_0x5c1012(++_0xf62efa);}(_0xd972,0x1ee));var _0x2d97=function(_0x1add0a,_0xe035ff){_0x1add0a=_0x1add0a-0x0;var _0x4041ef=_0xd972[_0x1add0a];return _0x4041ef;};'use strict';var multer=require(_0x2d97('0x0'));var util=require(_0x2d97('0x1'));var path=require(_0x2d97('0x2'));var timeout=require(_0x2d97('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2d97('0x4'));var auth=require(_0x2d97('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2d97('0x6'));var controller=require(_0x2d97('0x7'));router[_0x2d97('0x8')]('/',auth['isAuthenticated'](),controller[_0x2d97('0x9')]);router[_0x2d97('0x8')]('/:id',auth[_0x2d97('0xa')](),controller[_0x2d97('0xb')]);router[_0x2d97('0xc')]('/',auth['isAuthenticated'](),controller[_0x2d97('0xd')]);router['put'](_0x2d97('0xe'),auth[_0x2d97('0xa')](),controller['update']);router[_0x2d97('0xf')](_0x2d97('0xe'),auth[_0x2d97('0xa')](),controller['destroy']);module[_0x2d97('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index f96839c..99051cf 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 _0xe264=['BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue','STRING','customVariable'];(function(_0x4fe934,_0x1e0f72){var _0x55e9b1=function(_0x2ecee6){while(--_0x2ecee6){_0x4fe934['push'](_0x4fe934['shift']());}};_0x55e9b1(++_0x1e0f72);}(_0xe264,0x169));var _0x4e26=function(_0x4c98b9,_0x1ad11b){_0x4c98b9=_0x4c98b9-0x0;var _0x3a257a=_0xe264[_0x4c98b9];return _0x3a257a;};'use strict';var Sequelize=require(_0x4e26('0x0'));module[_0x4e26('0x1')]={'type':{'type':Sequelize[_0x4e26('0x2')](_0x4e26('0x3'),_0x4e26('0x4'),'customVariable',_0x4e26('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x4e26('0x6')]},'key':{'type':Sequelize[_0x4e26('0x6')]},'keyType':{'type':Sequelize[_0x4e26('0x2')](_0x4e26('0x3'),_0x4e26('0x4'),_0x4e26('0x7'))},'keyContent':{'type':Sequelize[_0x4e26('0x6')]},'idField':{'type':Sequelize[_0x4e26('0x6')]},'nameField':{'type':Sequelize[_0x4e26('0x6')]},'customField':{'type':Sequelize[_0x4e26('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0555=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0xcd6010,_0x3cfc81){var _0xe3a132=function(_0x4bcf06){while(--_0x4bcf06){_0xcd6010['push'](_0xcd6010['shift']());}};_0xe3a132(++_0x3cfc81);}(_0x0555,0x6f));var _0x5055=function(_0x28addc,_0x4030dc){_0x28addc=_0x28addc-0x0;var _0x5ac85c=_0x0555[_0x28addc];return _0x5ac85c;};'use strict';var Sequelize=require(_0x5055('0x0'));module[_0x5055('0x1')]={'type':{'type':Sequelize[_0x5055('0x2')](_0x5055('0x3'),_0x5055('0x4'),_0x5055('0x5'),'keyValue',_0x5055('0x6')),'defaultValue':_0x5055('0x3')},'content':{'type':Sequelize[_0x5055('0x7')]},'key':{'type':Sequelize[_0x5055('0x7')]},'keyType':{'type':Sequelize[_0x5055('0x2')](_0x5055('0x3'),_0x5055('0x4'),_0x5055('0x5'))},'keyContent':{'type':Sequelize[_0x5055('0x7')]},'idField':{'type':Sequelize[_0x5055('0x7')]},'nameField':{'type':Sequelize[_0x5055('0x7')]},'customField':{'type':Sequelize[_0x5055('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5055('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index c680c41..0786e55 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 _0xd24a=['bluebird','path','sox','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/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','map','ZendeskField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x9cfe,_0x4c32f0){var _0xd3ced8=function(_0x220d3d){while(--_0x220d3d){_0x9cfe['push'](_0x9cfe['shift']());}};_0xd3ced8(++_0x4c32f0);}(_0xd24a,0x185));var _0xad24=function(_0x1f4dd7,_0x1b4378){_0x1f4dd7=_0x1f4dd7-0x0;var _0x3f3ba0=_0xd24a[_0x1f4dd7];return _0x3f3ba0;};'use strict';var emlformat=require(_0xad24('0x0'));var rimraf=require(_0xad24('0x1'));var zipdir=require(_0xad24('0x2'));var jsonpatch=require(_0xad24('0x3'));var rp=require(_0xad24('0x4'));var moment=require(_0xad24('0x5'));var BPromise=require(_0xad24('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xad24('0x7'));var sox=require(_0xad24('0x8'));var csv=require('to-csv');var ejs=require(_0xad24('0x9'));var fs=require('fs');var fs_extra=require(_0xad24('0xa'));var _=require(_0xad24('0xb'));var squel=require(_0xad24('0xc'));var crypto=require(_0xad24('0xd'));var jsforce=require(_0xad24('0xe'));var deskjs=require(_0xad24('0xf'));var toCsv=require('to-csv');var querystring=require(_0xad24('0x10'));var Papa=require(_0xad24('0x11'));var Redis=require(_0xad24('0x12'));var authService=require(_0xad24('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xad24('0x14'));var hardwareService=require(_0xad24('0x15'));var logger=require(_0xad24('0x16'))(_0xad24('0x17'));var utils=require(_0xad24('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xad24('0x19'));var db=require(_0xad24('0x1a'))['db'];function respondWithStatusCode(_0x273533,_0xc3b8c7){_0xc3b8c7=_0xc3b8c7||0xcc;return function(_0x2dc038){if(_0x2dc038){return _0x273533[_0xad24('0x1b')](_0xc3b8c7);}return _0x273533[_0xad24('0x1c')](_0xc3b8c7)[_0xad24('0x1d')]();};}function respondWithResult(_0x3fdcd6,_0x5426f3){_0x5426f3=_0x5426f3||0xc8;return function(_0x4e5731){if(_0x4e5731){return _0x3fdcd6[_0xad24('0x1c')](_0x5426f3)[_0xad24('0x1e')](_0x4e5731);}};}function respondWithFilteredResult(_0x3110f3,_0x2ef616){return function(_0xa327fb){if(_0xa327fb){var _0x2a80b1=typeof _0x2ef616[_0xad24('0x1f')]==='undefined'&&typeof _0x2ef616[_0xad24('0x20')]===_0xad24('0x21');var _0x35e156=_0xa327fb[_0xad24('0x22')];var _0x219f0a=_0x2a80b1?0x0:_0x2ef616[_0xad24('0x1f')];var _0x375aa4=_0x2a80b1?_0xa327fb['count']:_0x2ef616[_0xad24('0x1f')]+_0x2ef616['limit'];var _0x3d3785;if(_0x375aa4>=_0x35e156){_0x375aa4=_0x35e156;_0x3d3785=0xc8;}else{_0x3d3785=0xce;}_0x3110f3['status'](_0x3d3785);return _0x3110f3[_0xad24('0x23')](_0xad24('0x24'),_0x219f0a+'-'+_0x375aa4+'/'+_0x35e156)[_0xad24('0x1e')](_0xa327fb);}return null;};}function patchUpdates(_0x4640b6){return function(_0x26dd4b){try{jsonpatch[_0xad24('0x25')](_0x26dd4b,_0x4640b6,!![]);}catch(_0x13b6e2){return BPromise[_0xad24('0x26')](_0x13b6e2);}return _0x26dd4b[_0xad24('0x27')]();};}function saveUpdates(_0x1f6a46,_0x450b37){return function(_0x39e633){if(_0x39e633){return _0x39e633[_0xad24('0x28')](_0x1f6a46)[_0xad24('0x29')](function(_0x13e2c8){return _0x13e2c8;});}return null;};}function removeEntity(_0x3d3bac,_0x267718){return function(_0x4cd43d){if(_0x4cd43d){return _0x4cd43d[_0xad24('0x2a')]()['then'](function(){_0x3d3bac[_0xad24('0x1c')](0xcc)[_0xad24('0x1d')]();});}};}function handleEntityNotFound(_0x2bedf3,_0x4714d1){return function(_0x5bafb0){if(!_0x5bafb0){_0x2bedf3['sendStatus'](0x194);}return _0x5bafb0;};}function handleError(_0x73b65a,_0xe51915){_0xe51915=_0xe51915||0x1f4;return function(_0x35901f){logger['error'](_0x35901f['stack']);if(_0x35901f['name']){delete _0x35901f[_0xad24('0x2b')];}_0x73b65a['status'](_0xe51915)[_0xad24('0x2c')](_0x35901f);};}exports['index']=function(_0x1ad3bf,_0x141486){var _0x1b1d27={},_0xa9560a={},_0x1f4c82={'count':0x0,'rows':[]};var _0x3a84dd=_[_0xad24('0x2d')](db[_0xad24('0x2e')][_0xad24('0x2f')],function(_0x3daa73){return{'name':_0x3daa73[_0xad24('0x30')],'type':_0x3daa73[_0xad24('0x31')][_0xad24('0x32')]};});_0xa9560a[_0xad24('0x33')]=_[_0xad24('0x2d')](_0x3a84dd,_0xad24('0x2b'));_0xa9560a['query']=_[_0xad24('0x34')](_0x1ad3bf[_0xad24('0x35')]);_0xa9560a[_0xad24('0x36')]=_[_0xad24('0x37')](_0xa9560a[_0xad24('0x33')],_0xa9560a[_0xad24('0x35')]);_0x1b1d27[_0xad24('0x38')]=_[_0xad24('0x37')](_0xa9560a['model'],qs['fields'](_0x1ad3bf[_0xad24('0x35')]['fields']));_0x1b1d27[_0xad24('0x38')]=_0x1b1d27[_0xad24('0x38')][_0xad24('0x39')]?_0x1b1d27[_0xad24('0x38')]:_0xa9560a[_0xad24('0x33')];if(!_0x1ad3bf[_0xad24('0x35')][_0xad24('0x3a')](_0xad24('0x3b'))){_0x1b1d27['limit']=qs['limit'](_0x1ad3bf[_0xad24('0x35')][_0xad24('0x20')]);_0x1b1d27[_0xad24('0x1f')]=qs[_0xad24('0x1f')](_0x1ad3bf[_0xad24('0x35')][_0xad24('0x1f')]);}_0x1b1d27[_0xad24('0x3c')]=qs[_0xad24('0x3d')](_0x1ad3bf['query'][_0xad24('0x3d')]);_0x1b1d27[_0xad24('0x3e')]=qs[_0xad24('0x36')](_[_0xad24('0x3f')](_0x1ad3bf[_0xad24('0x35')],_0xa9560a[_0xad24('0x36')]),_0x3a84dd);if(_0x1ad3bf[_0xad24('0x35')][_0xad24('0x40')]){_0x1b1d27[_0xad24('0x3e')]=_['merge'](_0x1b1d27[_0xad24('0x3e')],{'$or':_[_0xad24('0x2d')](_0x3a84dd,function(_0x58c180){if(_0x58c180[_0xad24('0x31')]!==_0xad24('0x41')){var _0x2f2953={};_0x2f2953[_0x58c180[_0xad24('0x2b')]]={'$like':'%'+_0x1ad3bf[_0xad24('0x35')][_0xad24('0x40')]+'%'};return _0x2f2953;}})});}_0x1b1d27=_[_0xad24('0x42')]({},_0x1b1d27,_0x1ad3bf[_0xad24('0x43')]);var _0x5ded76={'where':_0x1b1d27[_0xad24('0x3e')]};return db['ZendeskField'][_0xad24('0x22')](_0x5ded76)[_0xad24('0x29')](function(_0x344b52){_0x1f4c82['count']=_0x344b52;if(_0x1ad3bf['query'][_0xad24('0x44')]){_0x1b1d27[_0xad24('0x45')]=[{'all':!![]}];}return db[_0xad24('0x2e')][_0xad24('0x46')](_0x1b1d27);})[_0xad24('0x29')](function(_0x26d612){_0x1f4c82[_0xad24('0x47')]=_0x26d612;return _0x1f4c82;})['then'](respondWithFilteredResult(_0x141486,_0x1b1d27))[_0xad24('0x48')](handleError(_0x141486,null));};exports[_0xad24('0x49')]=function(_0x642018,_0x557a05){var _0x3903f1={'raw':!![],'where':{'id':_0x642018[_0xad24('0x4a')]['id']}},_0x2646f9={};_0x2646f9[_0xad24('0x33')]=_[_0xad24('0x34')](db[_0xad24('0x2e')]['rawAttributes']);_0x2646f9[_0xad24('0x35')]=_[_0xad24('0x34')](_0x642018[_0xad24('0x35')]);_0x2646f9['filters']=_[_0xad24('0x37')](_0x2646f9[_0xad24('0x33')],_0x2646f9['query']);_0x3903f1[_0xad24('0x38')]=_[_0xad24('0x37')](_0x2646f9['model'],qs[_0xad24('0x4b')](_0x642018[_0xad24('0x35')][_0xad24('0x4b')]));_0x3903f1[_0xad24('0x38')]=_0x3903f1[_0xad24('0x38')][_0xad24('0x39')]?_0x3903f1[_0xad24('0x38')]:_0x2646f9['model'];if(_0x642018[_0xad24('0x35')][_0xad24('0x44')]){_0x3903f1['include']=[{'all':!![]}];}_0x3903f1=_[_0xad24('0x42')]({},_0x3903f1,_0x642018['options']);return db[_0xad24('0x2e')][_0xad24('0x4c')](_0x3903f1)[_0xad24('0x29')](handleEntityNotFound(_0x557a05,null))[_0xad24('0x29')](respondWithResult(_0x557a05,null))[_0xad24('0x48')](handleError(_0x557a05,null));};exports[_0xad24('0x4d')]=function(_0x5e453b,_0x5b6159){return db['ZendeskField'][_0xad24('0x4d')](_0x5e453b[_0xad24('0x4e')],{})[_0xad24('0x29')](respondWithResult(_0x5b6159,0xc9))[_0xad24('0x48')](handleError(_0x5b6159,null));};exports[_0xad24('0x28')]=function(_0x3af57b,_0x2ba889){if(_0x3af57b['body']['id']){delete _0x3af57b['body']['id'];}return db[_0xad24('0x2e')][_0xad24('0x4c')]({'where':{'id':_0x3af57b[_0xad24('0x4a')]['id']}})[_0xad24('0x29')](handleEntityNotFound(_0x2ba889,null))['then'](saveUpdates(_0x3af57b[_0xad24('0x4e')],null))[_0xad24('0x29')](respondWithResult(_0x2ba889,null))[_0xad24('0x48')](handleError(_0x2ba889,null));};exports['destroy']=function(_0xcc9c29,_0x5d6e60){return db[_0xad24('0x2e')][_0xad24('0x4c')]({'where':{'id':_0xcc9c29[_0xad24('0x4a')]['id']}})[_0xad24('0x29')](handleEntityNotFound(_0x5d6e60,null))['then'](removeEntity(_0x5d6e60,null))['catch'](handleError(_0x5d6e60,null));}; \ No newline at end of file +var _0x1db5=['model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','limit','count','apply','reject','update','then','destroy','error','stack','name','send','index','ZendeskField','rawAttributes','fieldName','type','key','map','query','filters','intersection'];(function(_0x4cbe70,_0x2e83fc){var _0x1076b2=function(_0x1908b0){while(--_0x1908b0){_0x4cbe70['push'](_0x4cbe70['shift']());}};_0x1076b2(++_0x2e83fc);}(_0x1db5,0x1c0));var _0x51db=function(_0x3e6c7c,_0x1c0e57){_0x3e6c7c=_0x3e6c7c-0x0;var _0x3d3464=_0x1db5[_0x3e6c7c];return _0x3d3464;};'use strict';var emlformat=require(_0x51db('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x51db('0x1'));var jsonpatch=require(_0x51db('0x2'));var rp=require(_0x51db('0x3'));var moment=require('moment');var BPromise=require(_0x51db('0x4'));var Mustache=require('mustache');var util=require(_0x51db('0x5'));var path=require(_0x51db('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x51db('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x51db('0x8'));var squel=require(_0x51db('0x9'));var crypto=require('crypto');var jsforce=require(_0x51db('0xa'));var deskjs=require(_0x51db('0xb'));var toCsv=require(_0x51db('0xc'));var querystring=require(_0x51db('0xd'));var Papa=require(_0x51db('0xe'));var Redis=require(_0x51db('0xf'));var authService=require(_0x51db('0x10'));var qs=require(_0x51db('0x11'));var as=require(_0x51db('0x12'));var hardwareService=require(_0x51db('0x13'));var logger=require(_0x51db('0x14'))(_0x51db('0x15'));var utils=require('../../config/utils');var config=require(_0x51db('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x51db('0x17'))['db'];function respondWithStatusCode(_0x2ce3d,_0x3e39ba){_0x3e39ba=_0x3e39ba||0xcc;return function(_0x368cb4){if(_0x368cb4){return _0x2ce3d['sendStatus'](_0x3e39ba);}return _0x2ce3d[_0x51db('0x18')](_0x3e39ba)[_0x51db('0x19')]();};}function respondWithResult(_0x3723ff,_0x53591c){_0x53591c=_0x53591c||0xc8;return function(_0x1bc2ce){if(_0x1bc2ce){return _0x3723ff[_0x51db('0x18')](_0x53591c)[_0x51db('0x1a')](_0x1bc2ce);}};}function respondWithFilteredResult(_0x26505f,_0x46b264){return function(_0x18f64d){if(_0x18f64d){var _0x499346=typeof _0x46b264[_0x51db('0x1b')]==='undefined'&&typeof _0x46b264[_0x51db('0x1c')]==='undefined';var _0x521835=_0x18f64d['count'];var _0x19d4bc=_0x499346?0x0:_0x46b264[_0x51db('0x1b')];var _0x2e7fa6=_0x499346?_0x18f64d[_0x51db('0x1d')]:_0x46b264['offset']+_0x46b264[_0x51db('0x1c')];var _0x266df7;if(_0x2e7fa6>=_0x521835){_0x2e7fa6=_0x521835;_0x266df7=0xc8;}else{_0x266df7=0xce;}_0x26505f[_0x51db('0x18')](_0x266df7);return _0x26505f['set']('Content-Range',_0x19d4bc+'-'+_0x2e7fa6+'/'+_0x521835)['json'](_0x18f64d);}return null;};}function patchUpdates(_0x3c0766){return function(_0x46dbe6){try{jsonpatch[_0x51db('0x1e')](_0x46dbe6,_0x3c0766,!![]);}catch(_0x24adc6){return BPromise[_0x51db('0x1f')](_0x24adc6);}return _0x46dbe6['save']();};}function saveUpdates(_0x129ab3,_0x4390fa){return function(_0x5c857a){if(_0x5c857a){return _0x5c857a[_0x51db('0x20')](_0x129ab3)[_0x51db('0x21')](function(_0x155a29){return _0x155a29;});}return null;};}function removeEntity(_0x59f50b,_0x305933){return function(_0x6aa56a){if(_0x6aa56a){return _0x6aa56a[_0x51db('0x22')]()['then'](function(){_0x59f50b[_0x51db('0x18')](0xcc)[_0x51db('0x19')]();});}};}function handleEntityNotFound(_0x4ceac4,_0x26c27d){return function(_0x46d2bb){if(!_0x46d2bb){_0x4ceac4['sendStatus'](0x194);}return _0x46d2bb;};}function handleError(_0x324e25,_0x12bd2f){_0x12bd2f=_0x12bd2f||0x1f4;return function(_0x17eabb){logger[_0x51db('0x23')](_0x17eabb[_0x51db('0x24')]);if(_0x17eabb[_0x51db('0x25')]){delete _0x17eabb[_0x51db('0x25')];}_0x324e25['status'](_0x12bd2f)[_0x51db('0x26')](_0x17eabb);};}exports[_0x51db('0x27')]=function(_0x445762,_0x5d4821){var _0x1850ce={},_0x227cca={},_0x4b414a={'count':0x0,'rows':[]};var _0x5d9ca4=_['map'](db[_0x51db('0x28')][_0x51db('0x29')],function(_0x3311f5){return{'name':_0x3311f5[_0x51db('0x2a')],'type':_0x3311f5[_0x51db('0x2b')][_0x51db('0x2c')]};});_0x227cca['model']=_[_0x51db('0x2d')](_0x5d9ca4,_0x51db('0x25'));_0x227cca['query']=_['keys'](_0x445762[_0x51db('0x2e')]);_0x227cca[_0x51db('0x2f')]=_[_0x51db('0x30')](_0x227cca[_0x51db('0x31')],_0x227cca[_0x51db('0x2e')]);_0x1850ce[_0x51db('0x32')]=_['intersection'](_0x227cca[_0x51db('0x31')],qs[_0x51db('0x33')](_0x445762[_0x51db('0x2e')]['fields']));_0x1850ce[_0x51db('0x32')]=_0x1850ce[_0x51db('0x32')][_0x51db('0x34')]?_0x1850ce[_0x51db('0x32')]:_0x227cca[_0x51db('0x31')];if(!_0x445762['query'][_0x51db('0x35')](_0x51db('0x36'))){_0x1850ce[_0x51db('0x1c')]=qs['limit'](_0x445762[_0x51db('0x2e')][_0x51db('0x1c')]);_0x1850ce[_0x51db('0x1b')]=qs[_0x51db('0x1b')](_0x445762[_0x51db('0x2e')][_0x51db('0x1b')]);}_0x1850ce['order']=qs[_0x51db('0x37')](_0x445762[_0x51db('0x2e')][_0x51db('0x37')]);_0x1850ce[_0x51db('0x38')]=qs[_0x51db('0x2f')](_['pick'](_0x445762[_0x51db('0x2e')],_0x227cca[_0x51db('0x2f')]),_0x5d9ca4);if(_0x445762[_0x51db('0x2e')]['filter']){_0x1850ce[_0x51db('0x38')]=_[_0x51db('0x39')](_0x1850ce[_0x51db('0x38')],{'$or':_[_0x51db('0x2d')](_0x5d9ca4,function(_0x2ff316){if(_0x2ff316[_0x51db('0x2b')]!==_0x51db('0x3a')){var _0x57b604={};_0x57b604[_0x2ff316[_0x51db('0x25')]]={'$like':'%'+_0x445762[_0x51db('0x2e')][_0x51db('0x3b')]+'%'};return _0x57b604;}})});}_0x1850ce=_[_0x51db('0x39')]({},_0x1850ce,_0x445762[_0x51db('0x3c')]);var _0x80e15a={'where':_0x1850ce[_0x51db('0x38')]};return db[_0x51db('0x28')]['count'](_0x80e15a)[_0x51db('0x21')](function(_0x238a57){_0x4b414a[_0x51db('0x1d')]=_0x238a57;if(_0x445762['query']['includeAll']){_0x1850ce[_0x51db('0x3d')]=[{'all':!![]}];}return db[_0x51db('0x28')][_0x51db('0x3e')](_0x1850ce);})['then'](function(_0x202e14){_0x4b414a[_0x51db('0x3f')]=_0x202e14;return _0x4b414a;})[_0x51db('0x21')](respondWithFilteredResult(_0x5d4821,_0x1850ce))[_0x51db('0x40')](handleError(_0x5d4821,null));};exports[_0x51db('0x41')]=function(_0x58e4e7,_0x3f9e3d){var _0x463ed0={'raw':!![],'where':{'id':_0x58e4e7[_0x51db('0x42')]['id']}},_0x153be1={};_0x153be1['model']=_[_0x51db('0x43')](db['ZendeskField'][_0x51db('0x29')]);_0x153be1[_0x51db('0x2e')]=_['keys'](_0x58e4e7[_0x51db('0x2e')]);_0x153be1['filters']=_[_0x51db('0x30')](_0x153be1[_0x51db('0x31')],_0x153be1[_0x51db('0x2e')]);_0x463ed0[_0x51db('0x32')]=_[_0x51db('0x30')](_0x153be1[_0x51db('0x31')],qs[_0x51db('0x33')](_0x58e4e7[_0x51db('0x2e')][_0x51db('0x33')]));_0x463ed0['attributes']=_0x463ed0['attributes'][_0x51db('0x34')]?_0x463ed0[_0x51db('0x32')]:_0x153be1[_0x51db('0x31')];if(_0x58e4e7[_0x51db('0x2e')]['includeAll']){_0x463ed0['include']=[{'all':!![]}];}_0x463ed0=_[_0x51db('0x39')]({},_0x463ed0,_0x58e4e7['options']);return db[_0x51db('0x28')][_0x51db('0x44')](_0x463ed0)[_0x51db('0x21')](handleEntityNotFound(_0x3f9e3d,null))[_0x51db('0x21')](respondWithResult(_0x3f9e3d,null))[_0x51db('0x40')](handleError(_0x3f9e3d,null));};exports['create']=function(_0x2d7101,_0x36a212){return db['ZendeskField'][_0x51db('0x45')](_0x2d7101[_0x51db('0x46')],{})['then'](respondWithResult(_0x36a212,0xc9))[_0x51db('0x40')](handleError(_0x36a212,null));};exports['update']=function(_0x3c179e,_0x478c8f){if(_0x3c179e['body']['id']){delete _0x3c179e[_0x51db('0x46')]['id'];}return db['ZendeskField'][_0x51db('0x44')]({'where':{'id':_0x3c179e[_0x51db('0x42')]['id']}})[_0x51db('0x21')](handleEntityNotFound(_0x478c8f,null))[_0x51db('0x21')](saveUpdates(_0x3c179e[_0x51db('0x46')],null))[_0x51db('0x21')](respondWithResult(_0x478c8f,null))[_0x51db('0x40')](handleError(_0x478c8f,null));};exports[_0x51db('0x22')]=function(_0x1799d7,_0x49c77a){return db['ZendeskField'][_0x51db('0x44')]({'where':{'id':_0x1799d7[_0x51db('0x42')]['id']}})[_0x51db('0x21')](handleEntityNotFound(_0x49c77a,null))[_0x51db('0x21')](removeEntity(_0x49c77a,null))[_0x51db('0x40')](handleError(_0x49c77a,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 00ee163..7b347ac 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 _0x6a9e=['./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','lodash','util','api','bluebird','../../config/environment'];(function(_0x26a782,_0x2f1f25){var _0x1d3604=function(_0x44ad8f){while(--_0x44ad8f){_0x26a782['push'](_0x26a782['shift']());}};_0x1d3604(++_0x2f1f25);}(_0x6a9e,0x19f));var _0xe6a9=function(_0xb8fc12,_0x46cb46){_0xb8fc12=_0xb8fc12-0x0;var _0x2a1f3f=_0x6a9e[_0xb8fc12];return _0x2a1f3f;};'use strict';var _=require(_0xe6a9('0x0'));var util=require(_0xe6a9('0x1'));var logger=require('../../config/logger')(_0xe6a9('0x2'));var moment=require('moment');var BPromise=require(_0xe6a9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe6a9('0x4'));var attributes=require(_0xe6a9('0x5'));module[_0xe6a9('0x6')]=function(_0x1badef,_0x5591c5){return _0x1badef[_0xe6a9('0x7')](_0xe6a9('0x8'),attributes,{'tableName':_0xe6a9('0x9'),'paranoid':![],'indexes':[{'name':_0xe6a9('0xa'),'fields':[_0xe6a9('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdb92=['path','rimraf','../../config/environment','exports','ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x481c7d,_0x4394d6){var _0x43abde=function(_0x388616){while(--_0x388616){_0x481c7d['push'](_0x481c7d['shift']());}};_0x43abde(++_0x4394d6);}(_0xdb92,0x19d));var _0x2db9=function(_0x58cb87,_0x4d7cd9){_0x58cb87=_0x58cb87-0x0;var _0xfcc448=_0xdb92[_0x58cb87];return _0xfcc448;};'use strict';var _=require(_0x2db9('0x0'));var util=require(_0x2db9('0x1'));var logger=require(_0x2db9('0x2'))(_0x2db9('0x3'));var moment=require(_0x2db9('0x4'));var BPromise=require(_0x2db9('0x5'));var rp=require(_0x2db9('0x6'));var fs=require('fs');var path=require(_0x2db9('0x7'));var rimraf=require(_0x2db9('0x8'));var config=require(_0x2db9('0x9'));var attributes=require('./intZendeskField.attributes');module[_0x2db9('0xa')]=function(_0x76c3a9,_0x1c536f){return _0x76c3a9['define'](_0x2db9('0xb'),attributes,{'tableName':_0x2db9('0xc'),'paranoid':![],'indexes':[{'name':_0x2db9('0xd'),'fields':['idField',_0x2db9('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 4bd5aac..b47f480 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 _0x6f00=['info','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','ZendeskField,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x9227e5,_0x3c1962){var _0x438620=function(_0x49382c){while(--_0x49382c){_0x9227e5['push'](_0x9227e5['shift']());}};_0x438620(++_0x3c1962);}(_0x6f00,0xc2));var _0x06f0=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x6f00[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x06f0('0x0'));var util=require('util');var moment=require(_0x06f0('0x1'));var BPromise=require(_0x06f0('0x2'));var rs=require(_0x06f0('0x3'));var fs=require('fs');var Redis=require(_0x06f0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x06f0('0x5'));var logger=require(_0x06f0('0x6'))(_0x06f0('0x7'));var config=require(_0x06f0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x06f0('0x9')][_0x06f0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2df622,_0x52a6ab,_0x5c3dab){return new BPromise(function(_0x3bc61d,_0x27d9bf){return client[_0x06f0('0xb')](_0x2df622,_0x5c3dab)[_0x06f0('0xc')](function(_0x2e595b){logger[_0x06f0('0xd')]('ZendeskField,\x20%s,\x20%s',_0x52a6ab,'request\x20sent');logger[_0x06f0('0xe')](_0x06f0('0xf'),_0x52a6ab,_0x06f0('0x10'),JSON['stringify'](_0x2e595b));if(_0x2e595b[_0x06f0('0x11')]){if(_0x2e595b[_0x06f0('0x11')][_0x06f0('0x12')]===0x1f4){logger[_0x06f0('0x11')]('ZendeskField,\x20%s,\x20%s',_0x52a6ab,_0x2e595b[_0x06f0('0x11')][_0x06f0('0x13')]);return _0x27d9bf(_0x2e595b[_0x06f0('0x11')][_0x06f0('0x13')]);}logger['error'](_0x06f0('0x14'),_0x52a6ab,_0x2e595b[_0x06f0('0x11')][_0x06f0('0x13')]);return _0x3bc61d(_0x2e595b[_0x06f0('0x11')][_0x06f0('0x13')]);}else{logger[_0x06f0('0xd')]('ZendeskField,\x20%s,\x20%s',_0x52a6ab,_0x06f0('0x10'));_0x3bc61d(_0x2e595b[_0x06f0('0x15')][_0x06f0('0x13')]);}})[_0x06f0('0x16')](function(_0x47045b){logger[_0x06f0('0x11')](_0x06f0('0x14'),_0x52a6ab,_0x47045b);_0x27d9bf(_0x47045b);});});} \ No newline at end of file +var _0x35e1=['ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x35e1,0xf0));var _0x135e=function(_0x19a7d3,_0x487155){_0x19a7d3=_0x19a7d3-0x0;var _0x569a8e=_0x35e1[_0x19a7d3];return _0x569a8e;};'use strict';var _=require(_0x135e('0x0'));var util=require(_0x135e('0x1'));var moment=require(_0x135e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x135e('0x3'))['db'];var utils=require(_0x135e('0x4'));var logger=require(_0x135e('0x5'))('rpc');var config=require(_0x135e('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4535f1,_0x2579bf,_0x4549ef){return new BPromise(function(_0x5b2c67,_0x134817){return client['request'](_0x4535f1,_0x4549ef)[_0x135e('0x7')](function(_0x4002b9){logger[_0x135e('0x8')](_0x135e('0x9'),_0x2579bf,_0x135e('0xa'));logger[_0x135e('0xb')](_0x135e('0xc'),_0x2579bf,_0x135e('0xa'),JSON[_0x135e('0xd')](_0x4002b9));if(_0x4002b9[_0x135e('0xe')]){if(_0x4002b9[_0x135e('0xe')][_0x135e('0xf')]===0x1f4){logger[_0x135e('0xe')](_0x135e('0x9'),_0x2579bf,_0x4002b9[_0x135e('0xe')][_0x135e('0x10')]);return _0x134817(_0x4002b9[_0x135e('0xe')][_0x135e('0x10')]);}logger[_0x135e('0xe')](_0x135e('0x9'),_0x2579bf,_0x4002b9[_0x135e('0xe')]['message']);return _0x5b2c67(_0x4002b9['error'][_0x135e('0x10')]);}else{logger[_0x135e('0x8')]('ZendeskField,\x20%s,\x20%s',_0x2579bf,'request\x20sent');_0x5b2c67(_0x4002b9['result']['message']);}})[_0x135e('0x11')](function(_0x4ed9bb){logger[_0x135e('0xe')](_0x135e('0x9'),_0x2579bf,_0x4ed9bb);_0x134817(_0x4ed9bb);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index bf60d5e..f505421 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 _0x5537=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','exports','multer','util'];(function(_0x15e453,_0x9c3f09){var _0x1cf32e=function(_0x370765){while(--_0x370765){_0x15e453['push'](_0x15e453['shift']());}};_0x1cf32e(++_0x9c3f09);}(_0x5537,0xb6));var _0x7553=function(_0x14d6d7,_0x4b5937){_0x14d6d7=_0x14d6d7-0x0;var _0x31bbc5=_0x5537[_0x14d6d7];return _0x31bbc5;};'use strict';var multer=require(_0x7553('0x0'));var util=require(_0x7553('0x1'));var path=require(_0x7553('0x2'));var timeout=require('connect-timeout');var express=require(_0x7553('0x3'));var router=express[_0x7553('0x4')]();var fs_extra=require(_0x7553('0x5'));var auth=require(_0x7553('0x6'));var interaction=require(_0x7553('0x7'));var config=require(_0x7553('0x8'));var controller=require('./intZohoAccount.controller');router[_0x7553('0x9')]('/',auth[_0x7553('0xa')](),controller[_0x7553('0xb')]);router[_0x7553('0x9')](_0x7553('0xc'),auth[_0x7553('0xa')](),controller[_0x7553('0xd')]);router[_0x7553('0x9')]('/:id/configurations',auth[_0x7553('0xa')](),controller[_0x7553('0xe')]);router[_0x7553('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x7553('0xf')]);router[_0x7553('0x10')]('/',auth[_0x7553('0xa')](),controller[_0x7553('0x11')]);router[_0x7553('0x10')]('/:id/configurations',auth[_0x7553('0xa')](),controller[_0x7553('0x12')]);router[_0x7553('0x13')](_0x7553('0xc'),auth[_0x7553('0xa')](),controller[_0x7553('0x14')]);router[_0x7553('0x15')](_0x7553('0xc'),auth[_0x7553('0xa')](),controller['destroy']);module[_0x7553('0x16')]=router; \ No newline at end of file +var _0x36b9=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','getConfigurations','/:id/fields','getFields','post','put','update','delete','multer','util','path'];(function(_0x4fb584,_0x250ea7){var _0x16c087=function(_0x25626b){while(--_0x25626b){_0x4fb584['push'](_0x4fb584['shift']());}};_0x16c087(++_0x250ea7);}(_0x36b9,0xba));var _0x936b=function(_0x4253a9,_0x17583a){_0x4253a9=_0x4253a9-0x0;var _0x1e7ed8=_0x36b9[_0x4253a9];return _0x1e7ed8;};'use strict';var multer=require(_0x936b('0x0'));var util=require(_0x936b('0x1'));var path=require(_0x936b('0x2'));var timeout=require(_0x936b('0x3'));var express=require(_0x936b('0x4'));var router=express[_0x936b('0x5')]();var fs_extra=require(_0x936b('0x6'));var auth=require(_0x936b('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x936b('0x8'));var controller=require(_0x936b('0x9'));router[_0x936b('0xa')]('/',auth[_0x936b('0xb')](),controller[_0x936b('0xc')]);router[_0x936b('0xa')](_0x936b('0xd'),auth[_0x936b('0xb')](),controller['show']);router[_0x936b('0xa')]('/:id/configurations',auth[_0x936b('0xb')](),controller[_0x936b('0xe')]);router['get'](_0x936b('0xf'),auth[_0x936b('0xb')](),controller[_0x936b('0x10')]);router['post']('/',auth[_0x936b('0xb')](),controller['create']);router[_0x936b('0x11')]('/:id/configurations',auth[_0x936b('0xb')](),controller['addConfiguration']);router[_0x936b('0x12')](_0x936b('0xd'),auth['isAuthenticated'](),controller[_0x936b('0x13')]);router[_0x936b('0x14')](_0x936b('0xd'),auth[_0x936b('0xb')](),controller['destroy']);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 1ab51fe..65638da 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 _0x54ef=['STRING','sequelize','exports'];(function(_0x21c81e,_0x5de28f){var _0x16a6d7=function(_0x91beeb){while(--_0x91beeb){_0x21c81e['push'](_0x21c81e['shift']());}};_0x16a6d7(++_0x5de28f);}(_0x54ef,0x112));var _0xf54e=function(_0xff9cbf,_0xb5d4da){_0xff9cbf=_0xff9cbf-0x0;var _0x4be086=_0x54ef[_0xff9cbf];return _0x4be086;};'use strict';var Sequelize=require(_0xf54e('0x0'));module[_0xf54e('0x1')]={'name':{'type':Sequelize[_0xf54e('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xf54e('0x2')]},'zone':{'type':Sequelize[_0xf54e('0x2')]},'clientId':{'type':Sequelize[_0xf54e('0x2')]},'clientSecret':{'type':Sequelize[_0xf54e('0x2')]},'serverUrl':{'type':Sequelize[_0xf54e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xf54e('0x2')]},'refreshToken':{'type':Sequelize[_0xf54e('0x2')]}}; \ No newline at end of file +var _0x41bb=['exports','STRING','sequelize'];(function(_0x4cf0b7,_0x560029){var _0x545f10=function(_0x993533){while(--_0x993533){_0x4cf0b7['push'](_0x4cf0b7['shift']());}};_0x545f10(++_0x560029);}(_0x41bb,0xc5));var _0xb41b=function(_0x36bc48,_0x5afab7){_0x36bc48=_0x36bc48-0x0;var _0x42938b=_0x41bb[_0x36bc48];return _0x42938b;};'use strict';var Sequelize=require(_0xb41b('0x0'));module[_0xb41b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb41b('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xb41b('0x2')]},'clientId':{'type':Sequelize[_0xb41b('0x2')]},'clientSecret':{'type':Sequelize[_0xb41b('0x2')]},'serverUrl':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xb41b('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 138d8a6..c553413 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 _0x3e1a=['Zoho-oauthtoken\x20','response','error','Owner','Subject','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','includes','api_name','system_mandatory','push','custom_field','data_type','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','apply','save','update','then','destroy','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','merge','VIRTUAL','filter','options','where','ZohoAccount','includeAll','include','findAll','catch','length','create','body','find','params','getConfigurations','findOne','ZohoConfiguration','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','ZohoField','Subjects','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','serverUrl','code','host','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls'];(function(_0x348eaf,_0x1d72a2){var _0x1eba1a=function(_0x5d21be){while(--_0x5d21be){_0x348eaf['push'](_0x348eaf['shift']());}};_0x1eba1a(++_0x1d72a2);}(_0x3e1a,0x11e));var _0xa3e1=function(_0x588b5a,_0xde21db){_0x588b5a=_0x588b5a-0x0;var _0x5b1694=_0x3e1a[_0x588b5a];return _0x5b1694;};'use strict';var emlformat=require(_0xa3e1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa3e1('0x1'));var rp=require(_0xa3e1('0x2'));var moment=require(_0xa3e1('0x3'));var BPromise=require(_0xa3e1('0x4'));var Mustache=require(_0xa3e1('0x5'));var util=require(_0xa3e1('0x6'));var path=require('path');var sox=require(_0xa3e1('0x7'));var csv=require(_0xa3e1('0x8'));var ejs=require(_0xa3e1('0x9'));var fs=require('fs');var fs_extra=require(_0xa3e1('0xa'));var _=require(_0xa3e1('0xb'));var squel=require(_0xa3e1('0xc'));var crypto=require(_0xa3e1('0xd'));var jsforce=require(_0xa3e1('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa3e1('0x8'));var querystring=require(_0xa3e1('0xf'));var Papa=require(_0xa3e1('0x10'));var Redis=require(_0xa3e1('0x11'));var authService=require(_0xa3e1('0x12'));var qs=require(_0xa3e1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa3e1('0x14'));var logger=require(_0xa3e1('0x15'))(_0xa3e1('0x16'));var utils=require(_0xa3e1('0x17'));var config=require(_0xa3e1('0x18'));var licenseUtil=require(_0xa3e1('0x19'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x316898,_0x7e0736){_0x7e0736=_0x7e0736||0xcc;return function(_0x448b9d){if(_0x448b9d){return _0x316898[_0xa3e1('0x1a')](_0x7e0736);}return _0x316898[_0xa3e1('0x1b')](_0x7e0736)[_0xa3e1('0x1c')]();};}function respondWithResult(_0xe3fc9e,_0x19d61c){_0x19d61c=_0x19d61c||0xc8;return function(_0xa9918c){if(_0xa9918c){return _0xe3fc9e[_0xa3e1('0x1b')](_0x19d61c)[_0xa3e1('0x1d')](_0xa9918c);}};}function respondWithFilteredResult(_0xd7543d,_0xc30550){return function(_0x56647a){if(_0x56647a){var _0x3e94bc=typeof _0xc30550[_0xa3e1('0x1e')]==='undefined'&&typeof _0xc30550['limit']===_0xa3e1('0x1f');var _0x1863d4=_0x56647a[_0xa3e1('0x20')];var _0x5adee6=_0x3e94bc?0x0:_0xc30550[_0xa3e1('0x1e')];var _0x354945=_0x3e94bc?_0x56647a['count']:_0xc30550[_0xa3e1('0x1e')]+_0xc30550['limit'];var _0xdcf847;if(_0x354945>=_0x1863d4){_0x354945=_0x1863d4;_0xdcf847=0xc8;}else{_0xdcf847=0xce;}_0xd7543d[_0xa3e1('0x1b')](_0xdcf847);return _0xd7543d[_0xa3e1('0x21')]('Content-Range',_0x5adee6+'-'+_0x354945+'/'+_0x1863d4)['json'](_0x56647a);}return null;};}function patchUpdates(_0x2b29b6){return function(_0x1da09c){try{jsonpatch[_0xa3e1('0x22')](_0x1da09c,_0x2b29b6,!![]);}catch(_0x2ce839){return BPromise['reject'](_0x2ce839);}return _0x1da09c[_0xa3e1('0x23')]();};}function saveUpdates(_0x584d94,_0x553601){return function(_0x112b3a){if(_0x112b3a){return _0x112b3a[_0xa3e1('0x24')](_0x584d94)[_0xa3e1('0x25')](function(_0x357dc1){return _0x357dc1;});}return null;};}function removeEntity(_0x7021f3,_0x2cf953){return function(_0x38f37d){if(_0x38f37d){return _0x38f37d[_0xa3e1('0x26')]()[_0xa3e1('0x25')](function(){_0x7021f3[_0xa3e1('0x1b')](0xcc)[_0xa3e1('0x1c')]();});}};}function handleEntityNotFound(_0x56ef02,_0x27b69a){return function(_0x4900af){if(!_0x4900af){_0x56ef02[_0xa3e1('0x1a')](0x194);}return _0x4900af;};}function handleError(_0x58fbcb,_0xb6f49d){_0xb6f49d=_0xb6f49d||0x1f4;return function(_0x38b313){logger['error'](_0x38b313['stack']);if(_0x38b313[_0xa3e1('0x27')]){delete _0x38b313['name'];}_0x58fbcb[_0xa3e1('0x1b')](_0xb6f49d)[_0xa3e1('0x28')](_0x38b313);};}exports[_0xa3e1('0x29')]=function(_0x379149,_0x31c9bd){var _0x3f7894={},_0xd78975={},_0x95260={'count':0x0,'rows':[]};var _0x4ce683=_[_0xa3e1('0x2a')](db['ZohoAccount'][_0xa3e1('0x2b')],function(_0x1b6c16){return{'name':_0x1b6c16[_0xa3e1('0x2c')],'type':_0x1b6c16[_0xa3e1('0x2d')][_0xa3e1('0x2e')]};});_0xd78975[_0xa3e1('0x2f')]=_[_0xa3e1('0x2a')](_0x4ce683,_0xa3e1('0x27'));_0xd78975[_0xa3e1('0x30')]=_[_0xa3e1('0x31')](_0x379149['query']);_0xd78975[_0xa3e1('0x32')]=_[_0xa3e1('0x33')](_0xd78975['model'],_0xd78975[_0xa3e1('0x30')]);_0x3f7894[_0xa3e1('0x34')]=_['intersection'](_0xd78975['model'],qs[_0xa3e1('0x35')](_0x379149['query'][_0xa3e1('0x35')]));_0x3f7894[_0xa3e1('0x34')]=_0x3f7894[_0xa3e1('0x34')]['length']?_0x3f7894[_0xa3e1('0x34')]:_0xd78975[_0xa3e1('0x2f')];if(!_0x379149[_0xa3e1('0x30')][_0xa3e1('0x36')](_0xa3e1('0x37'))){_0x3f7894[_0xa3e1('0x38')]=qs['limit'](_0x379149[_0xa3e1('0x30')][_0xa3e1('0x38')]);_0x3f7894[_0xa3e1('0x1e')]=qs[_0xa3e1('0x1e')](_0x379149[_0xa3e1('0x30')]['offset']);}_0x3f7894[_0xa3e1('0x39')]=qs[_0xa3e1('0x3a')](_0x379149[_0xa3e1('0x30')][_0xa3e1('0x3a')]);_0x3f7894['where']=qs[_0xa3e1('0x32')](_[_0xa3e1('0x3b')](_0x379149[_0xa3e1('0x30')],_0xd78975['filters']),_0x4ce683);if(_0x379149['query']['filter']){_0x3f7894['where']=_[_0xa3e1('0x3c')](_0x3f7894['where'],{'$or':_[_0xa3e1('0x2a')](_0x4ce683,function(_0x3a2698){if(_0x3a2698[_0xa3e1('0x2d')]!==_0xa3e1('0x3d')){var _0x4fa0c6={};_0x4fa0c6[_0x3a2698['name']]={'$like':'%'+_0x379149[_0xa3e1('0x30')][_0xa3e1('0x3e')]+'%'};return _0x4fa0c6;}})});}_0x3f7894=_[_0xa3e1('0x3c')]({},_0x3f7894,_0x379149[_0xa3e1('0x3f')]);var _0x484498={'where':_0x3f7894[_0xa3e1('0x40')]};return db[_0xa3e1('0x41')][_0xa3e1('0x20')](_0x484498)[_0xa3e1('0x25')](function(_0x5594cb){_0x95260[_0xa3e1('0x20')]=_0x5594cb;if(_0x379149[_0xa3e1('0x30')][_0xa3e1('0x42')]){_0x3f7894[_0xa3e1('0x43')]=[{'all':!![]}];}return db[_0xa3e1('0x41')][_0xa3e1('0x44')](_0x3f7894);})[_0xa3e1('0x25')](function(_0xebe248){_0x95260['rows']=_0xebe248;return _0x95260;})[_0xa3e1('0x25')](respondWithFilteredResult(_0x31c9bd,_0x3f7894))[_0xa3e1('0x45')](handleError(_0x31c9bd,null));};exports['show']=function(_0x1fb76c,_0x32f733){var _0x321229={'raw':![],'where':{'id':_0x1fb76c['params']['id']}},_0x44e651={};_0x44e651[_0xa3e1('0x2f')]=_['keys'](db['ZohoAccount'][_0xa3e1('0x2b')]);_0x44e651[_0xa3e1('0x30')]=_[_0xa3e1('0x31')](_0x1fb76c[_0xa3e1('0x30')]);_0x44e651[_0xa3e1('0x32')]=_[_0xa3e1('0x33')](_0x44e651[_0xa3e1('0x2f')],_0x44e651['query']);_0x321229[_0xa3e1('0x34')]=_[_0xa3e1('0x33')](_0x44e651[_0xa3e1('0x2f')],qs[_0xa3e1('0x35')](_0x1fb76c[_0xa3e1('0x30')][_0xa3e1('0x35')]));_0x321229[_0xa3e1('0x34')]=_0x321229[_0xa3e1('0x34')][_0xa3e1('0x46')]?_0x321229[_0xa3e1('0x34')]:_0x44e651[_0xa3e1('0x2f')];if(_0x1fb76c[_0xa3e1('0x30')]['includeAll']){_0x321229['include']=[{'all':!![]}];}_0x321229=_[_0xa3e1('0x3c')]({},_0x321229,_0x1fb76c[_0xa3e1('0x3f')]);return db[_0xa3e1('0x41')]['find'](_0x321229)['then'](handleEntityNotFound(_0x32f733,null))[_0xa3e1('0x25')](respondWithResult(_0x32f733,null))[_0xa3e1('0x45')](handleError(_0x32f733,null));};exports[_0xa3e1('0x47')]=function(_0xf3c3f3,_0x330a42){return db[_0xa3e1('0x41')][_0xa3e1('0x47')](_0xf3c3f3['body'],{})[_0xa3e1('0x25')](respondWithResult(_0x330a42,0xc9))[_0xa3e1('0x45')](handleError(_0x330a42,null));};exports[_0xa3e1('0x24')]=function(_0x2d5748,_0x2882b7){if(_0x2d5748['body']['id']){delete _0x2d5748[_0xa3e1('0x48')]['id'];}return db[_0xa3e1('0x41')][_0xa3e1('0x49')]({'where':{'id':_0x2d5748[_0xa3e1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2882b7,null))[_0xa3e1('0x25')](saveUpdates(_0x2d5748[_0xa3e1('0x48')],null))[_0xa3e1('0x25')](respondWithResult(_0x2882b7,null))['catch'](handleError(_0x2882b7,null));};exports['destroy']=function(_0x22e729,_0x28aa4c){return db[_0xa3e1('0x41')][_0xa3e1('0x49')]({'where':{'id':_0x22e729['params']['id']}})['then'](handleEntityNotFound(_0x28aa4c,null))['then'](removeEntity(_0x28aa4c,null))[_0xa3e1('0x45')](handleError(_0x28aa4c,null));};exports[_0xa3e1('0x4b')]=function(_0x11ba44,_0x5d999f,_0x462bc9){var _0x4d83bf={};var _0x5e8092={};var _0x4e5a0f;var _0x2b277d;return db[_0xa3e1('0x41')][_0xa3e1('0x4c')]({'where':{'id':_0x11ba44[_0xa3e1('0x4a')]['id']}})[_0xa3e1('0x25')](handleEntityNotFound(_0x5d999f,null))[_0xa3e1('0x25')](function(_0x53f781){if(_0x53f781){_0x4e5a0f=_0x53f781;_0x5e8092[_0xa3e1('0x2f')]=_['keys'](db[_0xa3e1('0x4d')][_0xa3e1('0x2b')]);_0x5e8092[_0xa3e1('0x30')]=_['keys'](_0x11ba44[_0xa3e1('0x30')]);_0x5e8092[_0xa3e1('0x32')]=_['intersection'](_0x5e8092['model'],_0x5e8092[_0xa3e1('0x30')]);_0x4d83bf[_0xa3e1('0x34')]=_['intersection'](_0x5e8092[_0xa3e1('0x2f')],qs[_0xa3e1('0x35')](_0x11ba44[_0xa3e1('0x30')][_0xa3e1('0x35')]));_0x4d83bf[_0xa3e1('0x34')]=_0x4d83bf[_0xa3e1('0x34')][_0xa3e1('0x46')]?_0x4d83bf[_0xa3e1('0x34')]:_0x5e8092['model'];_0x4d83bf[_0xa3e1('0x39')]=qs['sort'](_0x11ba44[_0xa3e1('0x30')][_0xa3e1('0x3a')]);_0x4d83bf[_0xa3e1('0x40')]=qs['filters'](_[_0xa3e1('0x3b')](_0x11ba44[_0xa3e1('0x30')],_0x5e8092[_0xa3e1('0x32')]));if(_0x11ba44[_0xa3e1('0x30')][_0xa3e1('0x3e')]){_0x4d83bf[_0xa3e1('0x40')]=_[_0xa3e1('0x3c')](_0x4d83bf[_0xa3e1('0x40')],{'$or':_[_0xa3e1('0x2a')](_0x4d83bf['attributes'],function(_0x23f07f){var _0x1480df={};_0x1480df[_0x23f07f]={'$like':'%'+_0x11ba44['query'][_0xa3e1('0x3e')]+'%'};return _0x1480df;})});}_0x4d83bf=_[_0xa3e1('0x3c')]({},_0x4d83bf,_0x11ba44[_0xa3e1('0x3f')]);return _0x4e5a0f[_0xa3e1('0x4b')](_0x4d83bf);}})[_0xa3e1('0x25')](function(_0x13b874){if(_0x13b874){_0x2b277d=_0x13b874['length'];if(!_0x11ba44[_0xa3e1('0x30')][_0xa3e1('0x36')](_0xa3e1('0x37'))){_0x4d83bf[_0xa3e1('0x38')]=qs[_0xa3e1('0x38')](_0x11ba44[_0xa3e1('0x30')][_0xa3e1('0x38')]);_0x4d83bf[_0xa3e1('0x1e')]=qs[_0xa3e1('0x1e')](_0x11ba44[_0xa3e1('0x30')][_0xa3e1('0x1e')]);}return _0x4e5a0f[_0xa3e1('0x4b')](_0x4d83bf);}})['then'](function(_0x2e38aa){if(_0x2e38aa){return _0x2e38aa?{'count':_0x2b277d,'rows':_0x2e38aa}:null;}})[_0xa3e1('0x25')](respondWithResult(_0x5d999f,null))[_0xa3e1('0x45')](handleError(_0x5d999f,null));};exports[_0xa3e1('0x4e')]=function(_0x3f19c9,_0x46d11b,_0x5559ed){if(_0x3f19c9['body']['id']){delete _0x3f19c9[_0xa3e1('0x48')]['id'];}return db[_0xa3e1('0x41')]['findOne']({'where':{'id':_0x3f19c9['params']['id']}})[_0xa3e1('0x25')](handleEntityNotFound(_0x46d11b,null))['then'](function(_0x2ff2c1){if(_0x2ff2c1){_0x3f19c9[_0xa3e1('0x48')][_0xa3e1('0x4f')]=_0x2ff2c1['id'];_0x3f19c9[_0xa3e1('0x48')]['Subjects']=integrations[_0xa3e1('0x50')](_0x3f19c9[_0xa3e1('0x48')]['channel'],_0x3f19c9[_0xa3e1('0x48')][_0xa3e1('0x2d')]);_0x3f19c9[_0xa3e1('0x48')][_0xa3e1('0x51')]=integrations[_0xa3e1('0x52')](_0x3f19c9[_0xa3e1('0x48')][_0xa3e1('0x53')],_0x3f19c9[_0xa3e1('0x48')][_0xa3e1('0x2d')]);return db[_0xa3e1('0x4d')]['create'](_0x3f19c9['body'],{'include':[{'model':db[_0xa3e1('0x54')],'as':_0xa3e1('0x55')},{'model':db[_0xa3e1('0x54')],'as':_0xa3e1('0x51')}]});}return null;})[_0xa3e1('0x25')](respondWithResult(_0x46d11b,null))[_0xa3e1('0x45')](handleError(_0x46d11b,null));};function getAccessToken(_0x513b4b){return new Promise(function(_0x199d1c,_0x571560){var _0x4ad99f;switch(_0x513b4b[_0xa3e1('0x56')]){case'US':_0x4ad99f=_0xa3e1('0x57');break;case'AU':_0x4ad99f=_0xa3e1('0x58');break;case'EU':_0x4ad99f='https://accounts.zoho.eu';break;case'IN':_0x4ad99f=_0xa3e1('0x59');break;case'CN':_0x4ad99f=_0xa3e1('0x5a');break;default:_0x4ad99f=_0xa3e1('0x5b');break;}var _0xc61995={'method':_0xa3e1('0x5c'),'uri':_0x4ad99f+_0xa3e1('0x5d'),'qs':{'refresh_token':_0x513b4b[_0xa3e1('0x5e')],'client_id':_0x513b4b[_0xa3e1('0x5f')],'client_secret':_0x513b4b[_0xa3e1('0x60')],'grant_type':_0xa3e1('0x61')},'json':!![]};return rp(_0xc61995)[_0xa3e1('0x25')](function(_0x1c2338){if(_0x1c2338[_0xa3e1('0x62')]){_0x199d1c(_0x1c2338['access_token']);}else{_0x571560('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0x3c90b8){_0x571560(_0x3c90b8);});});}exports['getFields']=function(_0x10f83f,_0x1484c,_0x106cde){var _0x3adb5e,_0x2e3b02,_0x3c3107,_0x16a79a,_0x5dfb33;return db['ZohoAccount'][_0xa3e1('0x4c')]({'where':{'id':_0x10f83f[_0xa3e1('0x4a')]['id']},'attributes':['id','host',_0xa3e1('0x56'),_0xa3e1('0x5f'),'clientSecret',_0xa3e1('0x63'),_0xa3e1('0x64'),_0xa3e1('0x5e')]})['then'](handleEntityNotFound(_0x1484c,null))['then'](function(_0x4155d0){_0x5dfb33=_0x4155d0;_0x3adb5e=_0x5dfb33[_0xa3e1('0x65')];_0x2e3b02=_0x3adb5e==='zoho.eu'?'eu':_0xa3e1('0x66');_0x3c3107=_0x5dfb33['serverUrl'];var _0x3510bf=_0x3c3107[_0xa3e1('0x67')](-0x1);if(_0x3510bf==='/'||_0x3510bf==='\x5c'||_0x3510bf===':'){_0x3c3107=_0x3c3107[_0xa3e1('0x68')](0x0,_0x3c3107[_0xa3e1('0x69')](_0x3510bf));}if(!_0x5dfb33['refreshToken']){throw new Error(_0xa3e1('0x6a'));}return getAccessToken(_0x5dfb33);})[_0xa3e1('0x25')](function(_0x6f1459){if(_0x6f1459){return rp({'method':'GET','uri':util[_0xa3e1('0x6b')](_0xa3e1('0x6c'),_0x2e3b02),'qs':{'module':_0xa3e1('0x6d')},'headers':{'Authorization':_0xa3e1('0x6e')+_0x6f1459},'json':!![]});}})[_0xa3e1('0x25')](function(_0x138e52){if(_0x138e52){if(_0x138e52[_0xa3e1('0x6f')]&&_0x138e52[_0xa3e1('0x6f')]['error']){throw new Error(_0x138e52[_0xa3e1('0x6f')][_0xa3e1('0x70')]['message']);}var _0x4d5743=[];var _0x444010=[];var _0x165a27=[_0xa3e1('0x71'),_0xa3e1('0x72'),_0xa3e1('0x73'),_0xa3e1('0x74'),'Call_Duration',_0xa3e1('0x75'),_0xa3e1('0x76'),_0xa3e1('0x77')];_0x444010=_['remove'](_0x138e52[_0xa3e1('0x35')],function(_0x32aa78){return _0x165a27[_0xa3e1('0x78')](_0x32aa78[_0xa3e1('0x79')]);});for(var _0x4baeef=0x0;_0x4baeef<_0x444010['length'];_0x4baeef++){if(_0x444010[_0x4baeef][_0xa3e1('0x7a')]===![]){_0x4d5743[_0xa3e1('0x7b')]({'id':_0x444010[_0x4baeef]['id'],'name':_0x444010[_0x4baeef]['display_label'],'custom':_0x444010[_0x4baeef][_0xa3e1('0x7c')],'options':_0x444010[_0x4baeef][_0xa3e1('0x7d')]==='picklist'&&_0x444010[_0x4baeef][_0xa3e1('0x7e')][_0xa3e1('0x46')]>-0x1?_['map'](_0x444010[_0x4baeef][_0xa3e1('0x7e')],function(_0x5314bd){return{'name':_0x5314bd,'value':_0x5314bd};}):[]});}}return{'count':_0x4d5743[_0xa3e1('0x46')],'rows':_0x4d5743};}else{return{'count':0x0,'rows':[]};}})[_0xa3e1('0x25')](respondWithResult(_0x1484c,null))[_0xa3e1('0x45')](function(_0x1b70d8){var _0x5b1e69=_0x10f83f[_0xa3e1('0x30')][_0xa3e1('0x7f')]?0x1f4:_0x1b70d8[_0xa3e1('0x80')]||0x1f4;logger[_0xa3e1('0x70')](_0xa3e1('0x81'),_0xa3e1('0x82'),_0x5b1e69,JSON['stringify'](_0x1b70d8));delete _0x1b70d8['name'];if(_0x5b1e69===0x191){_0x5b1e69=0x190;}_0x1484c[_0xa3e1('0x1b')](_0x5b1e69)[_0xa3e1('0x28')](_0x10f83f['query'][_0xa3e1('0x7f')]?{'message':_0xa3e1('0x83'),'statusCode':_0x1b70d8[_0xa3e1('0x80')]}:_0x1b70d8);});}; \ No newline at end of file +var _0xc463=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','find','create','body','update','params','getConfigurations','ZohoConfiguration','pick','AccountId','Subjects','getSubjects','channel','Descriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','code','com','serverUrl','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Subject','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','push','custom_field','picklist','pick_list_values','test','getFields','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','apply','reject','destroy','then','error','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','model','keys','query','filters'];(function(_0x57fd0d,_0x2630ea){var _0x4b57f6=function(_0x5d314c){while(--_0x5d314c){_0x57fd0d['push'](_0x57fd0d['shift']());}};_0x4b57f6(++_0x2630ea);}(_0xc463,0x13a));var _0x3c46=function(_0x210b93,_0x133e6d){_0x210b93=_0x210b93-0x0;var _0x2b020f=_0xc463[_0x210b93];return _0x2b020f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3c46('0x0'));var zipdir=require(_0x3c46('0x1'));var jsonpatch=require(_0x3c46('0x2'));var rp=require(_0x3c46('0x3'));var moment=require('moment');var BPromise=require(_0x3c46('0x4'));var Mustache=require(_0x3c46('0x5'));var util=require('util');var path=require(_0x3c46('0x6'));var sox=require(_0x3c46('0x7'));var csv=require(_0x3c46('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3c46('0x9'));var squel=require(_0x3c46('0xa'));var crypto=require(_0x3c46('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3c46('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3c46('0xd'));var Redis=require(_0x3c46('0xe'));var authService=require(_0x3c46('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3c46('0x10'));var hardwareService=require(_0x3c46('0x11'));var logger=require(_0x3c46('0x12'))(_0x3c46('0x13'));var utils=require(_0x3c46('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3c46('0x15'));var db=require(_0x3c46('0x16'))['db'];var integrations=require(_0x3c46('0x17'));function respondWithStatusCode(_0xc6a3ef,_0x1b57ec){_0x1b57ec=_0x1b57ec||0xcc;return function(_0x46dd31){if(_0x46dd31){return _0xc6a3ef[_0x3c46('0x18')](_0x1b57ec);}return _0xc6a3ef['status'](_0x1b57ec)[_0x3c46('0x19')]();};}function respondWithResult(_0x1c622f,_0x2cf56d){_0x2cf56d=_0x2cf56d||0xc8;return function(_0x248c7b){if(_0x248c7b){return _0x1c622f['status'](_0x2cf56d)[_0x3c46('0x1a')](_0x248c7b);}};}function respondWithFilteredResult(_0x4c4779,_0x259830){return function(_0x5a606c){if(_0x5a606c){var _0x1d2ecf=typeof _0x259830['offset']===_0x3c46('0x1b')&&typeof _0x259830[_0x3c46('0x1c')]===_0x3c46('0x1b');var _0x78e068=_0x5a606c[_0x3c46('0x1d')];var _0x2d124b=_0x1d2ecf?0x0:_0x259830[_0x3c46('0x1e')];var _0x3294a8=_0x1d2ecf?_0x5a606c[_0x3c46('0x1d')]:_0x259830[_0x3c46('0x1e')]+_0x259830[_0x3c46('0x1c')];var _0x2fd62f;if(_0x3294a8>=_0x78e068){_0x3294a8=_0x78e068;_0x2fd62f=0xc8;}else{_0x2fd62f=0xce;}_0x4c4779[_0x3c46('0x1f')](_0x2fd62f);return _0x4c4779[_0x3c46('0x20')](_0x3c46('0x21'),_0x2d124b+'-'+_0x3294a8+'/'+_0x78e068)[_0x3c46('0x1a')](_0x5a606c);}return null;};}function patchUpdates(_0x25d3a1){return function(_0x46d6e1){try{jsonpatch[_0x3c46('0x22')](_0x46d6e1,_0x25d3a1,!![]);}catch(_0x2df07f){return BPromise[_0x3c46('0x23')](_0x2df07f);}return _0x46d6e1['save']();};}function saveUpdates(_0x250b4a,_0x252ecc){return function(_0x57863d){if(_0x57863d){return _0x57863d['update'](_0x250b4a)['then'](function(_0x170122){return _0x170122;});}return null;};}function removeEntity(_0x21f8bf,_0xd264c2){return function(_0x28efa1){if(_0x28efa1){return _0x28efa1[_0x3c46('0x24')]()[_0x3c46('0x25')](function(){_0x21f8bf[_0x3c46('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x121d16,_0x833d52){return function(_0xe8a512){if(!_0xe8a512){_0x121d16[_0x3c46('0x18')](0x194);}return _0xe8a512;};}function handleError(_0x3b953c,_0x2f180b){_0x2f180b=_0x2f180b||0x1f4;return function(_0x243177){logger[_0x3c46('0x26')](_0x243177[_0x3c46('0x27')]);if(_0x243177['name']){delete _0x243177[_0x3c46('0x28')];}_0x3b953c[_0x3c46('0x1f')](_0x2f180b)[_0x3c46('0x29')](_0x243177);};}exports[_0x3c46('0x2a')]=function(_0x72a11e,_0x44a564){var _0x5a5434={},_0x598a66={},_0x599e8d={'count':0x0,'rows':[]};var _0x2ae9b7=_[_0x3c46('0x2b')](db[_0x3c46('0x2c')][_0x3c46('0x2d')],function(_0x184c96){return{'name':_0x184c96[_0x3c46('0x2e')],'type':_0x184c96[_0x3c46('0x2f')]['key']};});_0x598a66[_0x3c46('0x30')]=_[_0x3c46('0x2b')](_0x2ae9b7,_0x3c46('0x28'));_0x598a66['query']=_[_0x3c46('0x31')](_0x72a11e[_0x3c46('0x32')]);_0x598a66[_0x3c46('0x33')]=_['intersection'](_0x598a66[_0x3c46('0x30')],_0x598a66['query']);_0x5a5434['attributes']=_[_0x3c46('0x34')](_0x598a66['model'],qs[_0x3c46('0x35')](_0x72a11e['query']['fields']));_0x5a5434[_0x3c46('0x36')]=_0x5a5434['attributes'][_0x3c46('0x37')]?_0x5a5434[_0x3c46('0x36')]:_0x598a66['model'];if(!_0x72a11e[_0x3c46('0x32')][_0x3c46('0x38')](_0x3c46('0x39'))){_0x5a5434[_0x3c46('0x1c')]=qs[_0x3c46('0x1c')](_0x72a11e[_0x3c46('0x32')][_0x3c46('0x1c')]);_0x5a5434[_0x3c46('0x1e')]=qs[_0x3c46('0x1e')](_0x72a11e[_0x3c46('0x32')][_0x3c46('0x1e')]);}_0x5a5434[_0x3c46('0x3a')]=qs[_0x3c46('0x3b')](_0x72a11e[_0x3c46('0x32')][_0x3c46('0x3b')]);_0x5a5434[_0x3c46('0x3c')]=qs[_0x3c46('0x33')](_['pick'](_0x72a11e[_0x3c46('0x32')],_0x598a66['filters']),_0x2ae9b7);if(_0x72a11e[_0x3c46('0x32')][_0x3c46('0x3d')]){_0x5a5434[_0x3c46('0x3c')]=_['merge'](_0x5a5434['where'],{'$or':_[_0x3c46('0x2b')](_0x2ae9b7,function(_0x4d7f4b){if(_0x4d7f4b['type']!==_0x3c46('0x3e')){var _0x19d78b={};_0x19d78b[_0x4d7f4b['name']]={'$like':'%'+_0x72a11e[_0x3c46('0x32')]['filter']+'%'};return _0x19d78b;}})});}_0x5a5434=_[_0x3c46('0x3f')]({},_0x5a5434,_0x72a11e[_0x3c46('0x40')]);var _0x8f10ea={'where':_0x5a5434[_0x3c46('0x3c')]};return db['ZohoAccount'][_0x3c46('0x1d')](_0x8f10ea)[_0x3c46('0x25')](function(_0xf5cace){_0x599e8d['count']=_0xf5cace;if(_0x72a11e[_0x3c46('0x32')][_0x3c46('0x41')]){_0x5a5434['include']=[{'all':!![]}];}return db['ZohoAccount'][_0x3c46('0x42')](_0x5a5434);})[_0x3c46('0x25')](function(_0x208595){_0x599e8d[_0x3c46('0x43')]=_0x208595;return _0x599e8d;})[_0x3c46('0x25')](respondWithFilteredResult(_0x44a564,_0x5a5434))[_0x3c46('0x44')](handleError(_0x44a564,null));};exports[_0x3c46('0x45')]=function(_0x3c6557,_0x500f21){var _0x3b6c74={'raw':![],'where':{'id':_0x3c6557['params']['id']}},_0x51c660={};_0x51c660['model']=_[_0x3c46('0x31')](db[_0x3c46('0x2c')][_0x3c46('0x2d')]);_0x51c660[_0x3c46('0x32')]=_['keys'](_0x3c6557[_0x3c46('0x32')]);_0x51c660[_0x3c46('0x33')]=_[_0x3c46('0x34')](_0x51c660[_0x3c46('0x30')],_0x51c660[_0x3c46('0x32')]);_0x3b6c74[_0x3c46('0x36')]=_['intersection'](_0x51c660[_0x3c46('0x30')],qs['fields'](_0x3c6557[_0x3c46('0x32')][_0x3c46('0x35')]));_0x3b6c74[_0x3c46('0x36')]=_0x3b6c74[_0x3c46('0x36')][_0x3c46('0x37')]?_0x3b6c74[_0x3c46('0x36')]:_0x51c660[_0x3c46('0x30')];if(_0x3c6557[_0x3c46('0x32')]['includeAll']){_0x3b6c74['include']=[{'all':!![]}];}_0x3b6c74=_[_0x3c46('0x3f')]({},_0x3b6c74,_0x3c6557[_0x3c46('0x40')]);return db['ZohoAccount'][_0x3c46('0x46')](_0x3b6c74)[_0x3c46('0x25')](handleEntityNotFound(_0x500f21,null))[_0x3c46('0x25')](respondWithResult(_0x500f21,null))['catch'](handleError(_0x500f21,null));};exports[_0x3c46('0x47')]=function(_0x396cc5,_0x50ac92){return db[_0x3c46('0x2c')][_0x3c46('0x47')](_0x396cc5[_0x3c46('0x48')],{})[_0x3c46('0x25')](respondWithResult(_0x50ac92,0xc9))[_0x3c46('0x44')](handleError(_0x50ac92,null));};exports[_0x3c46('0x49')]=function(_0x5aac98,_0x252ae5){if(_0x5aac98['body']['id']){delete _0x5aac98['body']['id'];}return db[_0x3c46('0x2c')]['find']({'where':{'id':_0x5aac98[_0x3c46('0x4a')]['id']}})[_0x3c46('0x25')](handleEntityNotFound(_0x252ae5,null))['then'](saveUpdates(_0x5aac98[_0x3c46('0x48')],null))[_0x3c46('0x25')](respondWithResult(_0x252ae5,null))['catch'](handleError(_0x252ae5,null));};exports[_0x3c46('0x24')]=function(_0x26bc60,_0x5bc4da){return db[_0x3c46('0x2c')][_0x3c46('0x46')]({'where':{'id':_0x26bc60[_0x3c46('0x4a')]['id']}})[_0x3c46('0x25')](handleEntityNotFound(_0x5bc4da,null))[_0x3c46('0x25')](removeEntity(_0x5bc4da,null))['catch'](handleError(_0x5bc4da,null));};exports[_0x3c46('0x4b')]=function(_0x3cfa4c,_0x2fdfd1,_0x1156b8){var _0x547606={};var _0x129310={};var _0x3176b6;var _0x24dde0;return db[_0x3c46('0x2c')]['findOne']({'where':{'id':_0x3cfa4c['params']['id']}})[_0x3c46('0x25')](handleEntityNotFound(_0x2fdfd1,null))[_0x3c46('0x25')](function(_0x3b22f0){if(_0x3b22f0){_0x3176b6=_0x3b22f0;_0x129310[_0x3c46('0x30')]=_[_0x3c46('0x31')](db[_0x3c46('0x4c')][_0x3c46('0x2d')]);_0x129310['query']=_[_0x3c46('0x31')](_0x3cfa4c['query']);_0x129310['filters']=_[_0x3c46('0x34')](_0x129310['model'],_0x129310[_0x3c46('0x32')]);_0x547606[_0x3c46('0x36')]=_[_0x3c46('0x34')](_0x129310['model'],qs[_0x3c46('0x35')](_0x3cfa4c[_0x3c46('0x32')][_0x3c46('0x35')]));_0x547606[_0x3c46('0x36')]=_0x547606[_0x3c46('0x36')][_0x3c46('0x37')]?_0x547606[_0x3c46('0x36')]:_0x129310[_0x3c46('0x30')];_0x547606['order']=qs[_0x3c46('0x3b')](_0x3cfa4c[_0x3c46('0x32')]['sort']);_0x547606[_0x3c46('0x3c')]=qs[_0x3c46('0x33')](_[_0x3c46('0x4d')](_0x3cfa4c['query'],_0x129310[_0x3c46('0x33')]));if(_0x3cfa4c['query'][_0x3c46('0x3d')]){_0x547606['where']=_[_0x3c46('0x3f')](_0x547606['where'],{'$or':_[_0x3c46('0x2b')](_0x547606['attributes'],function(_0x3d052b){var _0x2e444e={};_0x2e444e[_0x3d052b]={'$like':'%'+_0x3cfa4c[_0x3c46('0x32')][_0x3c46('0x3d')]+'%'};return _0x2e444e;})});}_0x547606=_['merge']({},_0x547606,_0x3cfa4c[_0x3c46('0x40')]);return _0x3176b6[_0x3c46('0x4b')](_0x547606);}})[_0x3c46('0x25')](function(_0x2fb47b){if(_0x2fb47b){_0x24dde0=_0x2fb47b[_0x3c46('0x37')];if(!_0x3cfa4c[_0x3c46('0x32')][_0x3c46('0x38')](_0x3c46('0x39'))){_0x547606[_0x3c46('0x1c')]=qs[_0x3c46('0x1c')](_0x3cfa4c[_0x3c46('0x32')][_0x3c46('0x1c')]);_0x547606[_0x3c46('0x1e')]=qs['offset'](_0x3cfa4c[_0x3c46('0x32')][_0x3c46('0x1e')]);}return _0x3176b6['getConfigurations'](_0x547606);}})[_0x3c46('0x25')](function(_0x22b230){if(_0x22b230){return _0x22b230?{'count':_0x24dde0,'rows':_0x22b230}:null;}})[_0x3c46('0x25')](respondWithResult(_0x2fdfd1,null))[_0x3c46('0x44')](handleError(_0x2fdfd1,null));};exports['addConfiguration']=function(_0x1d1fe3,_0x546e19,_0x5c2d9e){if(_0x1d1fe3[_0x3c46('0x48')]['id']){delete _0x1d1fe3[_0x3c46('0x48')]['id'];}return db[_0x3c46('0x2c')]['findOne']({'where':{'id':_0x1d1fe3['params']['id']}})[_0x3c46('0x25')](handleEntityNotFound(_0x546e19,null))[_0x3c46('0x25')](function(_0x35da8e){if(_0x35da8e){_0x1d1fe3[_0x3c46('0x48')][_0x3c46('0x4e')]=_0x35da8e['id'];_0x1d1fe3[_0x3c46('0x48')][_0x3c46('0x4f')]=integrations[_0x3c46('0x50')](_0x1d1fe3[_0x3c46('0x48')][_0x3c46('0x51')],_0x1d1fe3[_0x3c46('0x48')][_0x3c46('0x2f')]);_0x1d1fe3[_0x3c46('0x48')][_0x3c46('0x52')]=integrations['getDescriptions'](_0x1d1fe3['body'][_0x3c46('0x51')],_0x1d1fe3['body']['type']);return db[_0x3c46('0x4c')][_0x3c46('0x47')](_0x1d1fe3[_0x3c46('0x48')],{'include':[{'model':db[_0x3c46('0x53')],'as':'Subjects'},{'model':db[_0x3c46('0x53')],'as':_0x3c46('0x52')}]});}return null;})['then'](respondWithResult(_0x546e19,null))['catch'](handleError(_0x546e19,null));};function getAccessToken(_0x3dec50){return new Promise(function(_0x4edcce,_0x4ebb76){var _0x25888e;switch(_0x3dec50['zone']){case'US':_0x25888e=_0x3c46('0x54');break;case'AU':_0x25888e='https://accounts.zoho.com.au';break;case'EU':_0x25888e=_0x3c46('0x55');break;case'IN':_0x25888e='https://accounts.zoho.in';break;case'CN':_0x25888e=_0x3c46('0x56');break;default:_0x25888e=_0x3c46('0x55');break;}var _0x44a48a={'method':_0x3c46('0x57'),'uri':_0x25888e+_0x3c46('0x58'),'qs':{'refresh_token':_0x3dec50[_0x3c46('0x59')],'client_id':_0x3dec50[_0x3c46('0x5a')],'client_secret':_0x3dec50[_0x3c46('0x5b')],'grant_type':_0x3c46('0x5c')},'json':!![]};return rp(_0x44a48a)['then'](function(_0x279324){if(_0x279324[_0x3c46('0x5d')]){_0x4edcce(_0x279324[_0x3c46('0x5d')]);}else{_0x4ebb76(_0x3c46('0x5e'));}})[_0x3c46('0x44')](function(_0x24e71b){_0x4ebb76(_0x24e71b);});});}exports['getFields']=function(_0x8517cd,_0x15adf0,_0x57f897){var _0x3bbce9,_0x41e222,_0x57c9b9,_0x43a3d,_0x3f0705;return db[_0x3c46('0x2c')]['findOne']({'where':{'id':_0x8517cd[_0x3c46('0x4a')]['id']},'attributes':['id',_0x3c46('0x5f'),'zone',_0x3c46('0x5a'),'clientSecret','serverUrl',_0x3c46('0x60'),_0x3c46('0x59')]})[_0x3c46('0x25')](handleEntityNotFound(_0x15adf0,null))[_0x3c46('0x25')](function(_0x41f165){_0x3f0705=_0x41f165;_0x3bbce9=_0x3f0705[_0x3c46('0x5f')];_0x41e222=_0x3bbce9==='zoho.eu'?'eu':_0x3c46('0x61');_0x57c9b9=_0x3f0705[_0x3c46('0x62')];var _0xebc166=_0x57c9b9[_0x3c46('0x63')](-0x1);if(_0xebc166==='/'||_0xebc166==='\x5c'||_0xebc166===':'){_0x57c9b9=_0x57c9b9[_0x3c46('0x64')](0x0,_0x57c9b9['lastIndexOf'](_0xebc166));}if(!_0x3f0705[_0x3c46('0x59')]){throw new Error(_0x3c46('0x65'));}return getAccessToken(_0x3f0705);})[_0x3c46('0x25')](function(_0x32c0e8){if(_0x32c0e8){return rp({'method':'GET','uri':util[_0x3c46('0x66')](_0x3c46('0x67'),_0x41e222),'qs':{'module':_0x3c46('0x68')},'headers':{'Authorization':_0x3c46('0x69')+_0x32c0e8},'json':!![]});}})[_0x3c46('0x25')](function(_0x59d775){if(_0x59d775){if(_0x59d775[_0x3c46('0x6a')]&&_0x59d775[_0x3c46('0x6a')][_0x3c46('0x26')]){throw new Error(_0x59d775[_0x3c46('0x6a')]['error']['message']);}var _0x3195f2=[];var _0x407d73=[];var _0x4dc4a7=['Owner',_0x3c46('0x6b'),'Description',_0x3c46('0x6c'),_0x3c46('0x6d'),_0x3c46('0x6e'),_0x3c46('0x6f'),_0x3c46('0x70')];_0x407d73=_[_0x3c46('0x71')](_0x59d775[_0x3c46('0x35')],function(_0x51ae69){return _0x4dc4a7['includes'](_0x51ae69['api_name']);});for(var _0x9e5ff3=0x0;_0x9e5ff3<_0x407d73[_0x3c46('0x37')];_0x9e5ff3++){if(_0x407d73[_0x9e5ff3]['system_mandatory']===![]){_0x3195f2[_0x3c46('0x72')]({'id':_0x407d73[_0x9e5ff3]['id'],'name':_0x407d73[_0x9e5ff3]['display_label'],'custom':_0x407d73[_0x9e5ff3][_0x3c46('0x73')],'options':_0x407d73[_0x9e5ff3]['data_type']===_0x3c46('0x74')&&_0x407d73[_0x9e5ff3][_0x3c46('0x75')][_0x3c46('0x37')]>-0x1?_[_0x3c46('0x2b')](_0x407d73[_0x9e5ff3][_0x3c46('0x75')],function(_0x2055f2){return{'name':_0x2055f2,'value':_0x2055f2};}):[]});}}return{'count':_0x3195f2['length'],'rows':_0x3195f2};}else{return{'count':0x0,'rows':[]};}})[_0x3c46('0x25')](respondWithResult(_0x15adf0,null))['catch'](function(_0x312d1b){var _0x346fbc=_0x8517cd['query'][_0x3c46('0x76')]?0x1f4:_0x312d1b['statusCode']||0x1f4;logger[_0x3c46('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0x3c46('0x77'),_0x346fbc,JSON[_0x3c46('0x78')](_0x312d1b));delete _0x312d1b[_0x3c46('0x28')];if(_0x346fbc===0x191){_0x346fbc=0x190;}_0x15adf0[_0x3c46('0x1f')](_0x346fbc)[_0x3c46('0x29')](_0x8517cd[_0x3c46('0x32')][_0x3c46('0x76')]?{'message':_0x3c46('0x79'),'statusCode':_0x312d1b['statusCode']}:_0x312d1b);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 5afe47c..28ebf21 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 _0x049c=['catch','clientSecret','substring','authorization_code','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','zone','changed','serverUrl','clientId','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','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x049c,0x7f));var _0xc049=function(_0x29c7f8,_0x42fa11){_0x29c7f8=_0x29c7f8-0x0;var _0x2fd645=_0x049c[_0x29c7f8];return _0x2fd645;};'use strict';var _=require(_0xc049('0x0'));var util=require(_0xc049('0x1'));var logger=require('../../config/logger')(_0xc049('0x2'));var moment=require('moment');var BPromise=require(_0xc049('0x3'));var rp=require(_0xc049('0x4'));var fs=require('fs');var path=require(_0xc049('0x5'));var rimraf=require(_0xc049('0x6'));var config=require(_0xc049('0x7'));var attributes=require(_0xc049('0x8'));var integrations=require(_0xc049('0x9'));module['exports']=function(_0x69a69,_0xffa094){return _0x69a69[_0xc049('0xa')](_0xc049('0xb'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x226e5b,_0x8aac04,_0x366b3e){if(_0x226e5b['changed'](_0xc049('0xc'))||_0x226e5b[_0xc049('0xd')](_0xc049('0xe'))||_0x226e5b['changed'](_0xc049('0xf'))||_0x226e5b[_0xc049('0xd')]('clientSecret')||_0x226e5b[_0xc049('0xd')](_0xc049('0x10'))||_0x226e5b[_0xc049('0xd')](_0xc049('0x11'))){var _0x3983b5,_0x3795c5;_0x3983b5=_0x226e5b[_0xc049('0xe')];var _0x3cbbb2=_0x3983b5[_0xc049('0x12')](-0x1);if(_0x3cbbb2==='/'||_0x3cbbb2==='\x5c'||_0x3cbbb2===':'){_0x3983b5=_0x3983b5['substring'](0x0,_0x3983b5[_0xc049('0x13')](_0x3cbbb2));}switch(_0x226e5b[_0xc049('0xc')]){case'US':_0x3795c5=_0xc049('0x14');break;case'AU':_0x3795c5=_0xc049('0x15');break;case'IN':_0x3795c5=_0xc049('0x16');break;case'CN':_0x3795c5=_0xc049('0x17');break;default:_0x3795c5=_0xc049('0x18');break;}var _0x43a134={'method':_0xc049('0x19'),'uri':_0x3795c5+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x226e5b['clientId'],'client_secret':_0x226e5b['clientSecret'],'redirect_uri':_0x226e5b[_0xc049('0xe')],'code':_0x226e5b['code']},'headers':{'Content-Type':_0xc049('0x1a')}};return rp(_0x43a134)[_0xc049('0x1b')](function(_0x3c7f74){var _0x16316d=JSON[_0xc049('0x1c')](_0x3c7f74);if(_0x16316d[_0xc049('0x1d')]){_0x226e5b[_0xc049('0x1e')]=_0x16316d['refresh_token'];logger['info'](util['format'](_0xc049('0x1f'),_0x226e5b[_0xc049('0x20')],_0x226e5b['id']));}else{logger[_0xc049('0x21')](util[_0xc049('0x22')](_0xc049('0x23'),_0x226e5b[_0xc049('0x20')],_0x226e5b['id']),util[_0xc049('0x24')](_0x16316d,{'showHidden':![],'depth':null}));}return _0x366b3e(null,_0x8aac04);})[_0xc049('0x25')](function(_0x2bc18d){logger[_0xc049('0x21')](util[_0xc049('0x22')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x226e5b[_0xc049('0x20')],_0x226e5b['id']),util[_0xc049('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x366b3e(_0x2bc18d);});}else{return _0x366b3e(null,_0x8aac04);}},'beforeUpdate':function(_0x4c1ea4,_0x5ac419,_0x113a12){if(_0x4c1ea4[_0xc049('0xd')](_0xc049('0xc'))||_0x4c1ea4[_0xc049('0xd')](_0xc049('0xe'))||_0x4c1ea4[_0xc049('0xd')](_0xc049('0xf'))||_0x4c1ea4[_0xc049('0xd')](_0xc049('0x26'))||_0x4c1ea4[_0xc049('0xd')](_0xc049('0x10'))||_0x4c1ea4['changed'](_0xc049('0x11'))){var _0x53787c,_0x308b7f;_0x53787c=_0x4c1ea4[_0xc049('0xe')];var _0x4b2772=_0x53787c[_0xc049('0x12')](-0x1);if(_0x4b2772==='/'||_0x4b2772==='\x5c'||_0x4b2772===':'){_0x53787c=_0x53787c[_0xc049('0x27')](0x0,_0x53787c[_0xc049('0x13')](_0x4b2772));}switch(_0x4c1ea4[_0xc049('0xc')]){case'US':_0x308b7f='https://accounts.zoho.com';break;case'AU':_0x308b7f=_0xc049('0x15');break;case'IN':_0x308b7f=_0xc049('0x16');break;case'CN':_0x308b7f=_0xc049('0x17');break;default:_0x308b7f=_0xc049('0x18');break;}var _0x3887f4={'method':_0xc049('0x19'),'uri':_0x308b7f+'/oauth/v2/token','form':{'grant_type':_0xc049('0x28'),'client_id':_0x4c1ea4[_0xc049('0xf')],'client_secret':_0x4c1ea4['clientSecret'],'redirect_uri':_0x4c1ea4[_0xc049('0xe')],'code':_0x4c1ea4[_0xc049('0x10')]},'headers':{'Content-Type':_0xc049('0x1a')}};return rp(_0x3887f4)[_0xc049('0x1b')](function(_0x3b4a93){var _0x33c9b0=JSON[_0xc049('0x1c')](_0x3b4a93);if(_0x33c9b0[_0xc049('0x1d')]){_0x4c1ea4['refreshToken']=_0x33c9b0[_0xc049('0x1d')];logger['info'](util[_0xc049('0x22')](_0xc049('0x1f'),_0x4c1ea4[_0xc049('0x20')],_0x4c1ea4['id']));}else{logger[_0xc049('0x21')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4c1ea4[_0xc049('0x20')],_0x4c1ea4['id']),util[_0xc049('0x24')](_0x33c9b0,{'showHidden':![],'depth':null}));}return _0x113a12(null,_0x5ac419);})['catch'](function(_0x2f237e){logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4c1ea4[_0xc049('0x20')],_0x4c1ea4['id']),util[_0xc049('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x113a12(_0x2f237e);});}else{return _0x113a12(null,_0x5ac419);}}}});}; \ No newline at end of file +var _0x9fda=['https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','authorization_code','application/x-www-form-urlencoded','then','refresh_token','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','substring','https://accounts.zoho.com.au','https://accounts.zoho.eu','/oauth/v2/token','parse','refreshToken','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intZohoAccount.attributes','exports','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','host','slice','lastIndexOf'];(function(_0x2eb5bc,_0x4634c6){var _0x51c7b1=function(_0x1af430){while(--_0x1af430){_0x2eb5bc['push'](_0x2eb5bc['shift']());}};_0x51c7b1(++_0x4634c6);}(_0x9fda,0x135));var _0xa9fd=function(_0x3d015c,_0x2865dc){_0x3d015c=_0x3d015c-0x0;var _0x2fa8ef=_0x9fda[_0x3d015c];return _0x2fa8ef;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa9fd('0x0'))(_0xa9fd('0x1'));var moment=require(_0xa9fd('0x2'));var BPromise=require(_0xa9fd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa9fd('0x4'));var config=require(_0xa9fd('0x5'));var attributes=require(_0xa9fd('0x6'));var integrations=require('../../components/integrations/configuration');module[_0xa9fd('0x7')]=function(_0x169e7f,_0x382db8){return _0x169e7f['define'](_0xa9fd('0x8'),attributes,{'tableName':_0xa9fd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x6961,_0x5db7b2,_0x1d38d5){if(_0x6961[_0xa9fd('0xa')](_0xa9fd('0xb'))||_0x6961[_0xa9fd('0xa')](_0xa9fd('0xc'))||_0x6961[_0xa9fd('0xa')](_0xa9fd('0xd'))||_0x6961[_0xa9fd('0xa')](_0xa9fd('0xe'))||_0x6961[_0xa9fd('0xa')](_0xa9fd('0xf'))||_0x6961[_0xa9fd('0xa')](_0xa9fd('0x10'))){var _0x22f01f,_0x89c6b9;_0x22f01f=_0x6961[_0xa9fd('0xc')];var _0x34d1d1=_0x22f01f[_0xa9fd('0x11')](-0x1);if(_0x34d1d1==='/'||_0x34d1d1==='\x5c'||_0x34d1d1===':'){_0x22f01f=_0x22f01f['substring'](0x0,_0x22f01f[_0xa9fd('0x12')](_0x34d1d1));}switch(_0x6961[_0xa9fd('0xb')]){case'US':_0x89c6b9=_0xa9fd('0x13');break;case'AU':_0x89c6b9='https://accounts.zoho.com.au';break;case'IN':_0x89c6b9=_0xa9fd('0x14');break;case'CN':_0x89c6b9=_0xa9fd('0x15');break;default:_0x89c6b9='https://accounts.zoho.eu';break;}var _0x29b716={'method':_0xa9fd('0x16'),'uri':_0x89c6b9+'/oauth/v2/token','form':{'grant_type':_0xa9fd('0x17'),'client_id':_0x6961[_0xa9fd('0xd')],'client_secret':_0x6961[_0xa9fd('0xe')],'redirect_uri':_0x6961[_0xa9fd('0xc')],'code':_0x6961[_0xa9fd('0xf')]},'headers':{'Content-Type':_0xa9fd('0x18')}};return rp(_0x29b716)[_0xa9fd('0x19')](function(_0x154888){var _0xd886b8=JSON['parse'](_0x154888);if(_0xd886b8[_0xa9fd('0x1a')]){_0x6961['refreshToken']=_0xd886b8['refresh_token'];logger[_0xa9fd('0x1b')](util[_0xa9fd('0x1c')](_0xa9fd('0x1d'),_0x6961[_0xa9fd('0x1e')],_0x6961['id']));}else{logger[_0xa9fd('0x1f')](util[_0xa9fd('0x1c')](_0xa9fd('0x20'),_0x6961['name'],_0x6961['id']),util[_0xa9fd('0x21')](_0xd886b8,{'showHidden':![],'depth':null}));}return _0x1d38d5(null,_0x5db7b2);})[_0xa9fd('0x22')](function(_0x2fc055){logger[_0xa9fd('0x1f')](util[_0xa9fd('0x1c')](_0xa9fd('0x20'),_0x6961[_0xa9fd('0x1e')],_0x6961['id']),util[_0xa9fd('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x1d38d5(_0x2fc055);});}else{return _0x1d38d5(null,_0x5db7b2);}},'beforeUpdate':function(_0x1ef8e6,_0x5b21b4,_0x5cb550){if(_0x1ef8e6[_0xa9fd('0xa')](_0xa9fd('0xb'))||_0x1ef8e6[_0xa9fd('0xa')](_0xa9fd('0xc'))||_0x1ef8e6[_0xa9fd('0xa')](_0xa9fd('0xd'))||_0x1ef8e6[_0xa9fd('0xa')](_0xa9fd('0xe'))||_0x1ef8e6[_0xa9fd('0xa')](_0xa9fd('0xf'))||_0x1ef8e6['changed'](_0xa9fd('0x10'))){var _0x40af80,_0xe8dc0b;_0x40af80=_0x1ef8e6[_0xa9fd('0xc')];var _0x567d3c=_0x40af80[_0xa9fd('0x11')](-0x1);if(_0x567d3c==='/'||_0x567d3c==='\x5c'||_0x567d3c===':'){_0x40af80=_0x40af80[_0xa9fd('0x23')](0x0,_0x40af80[_0xa9fd('0x12')](_0x567d3c));}switch(_0x1ef8e6['zone']){case'US':_0xe8dc0b=_0xa9fd('0x13');break;case'AU':_0xe8dc0b=_0xa9fd('0x24');break;case'IN':_0xe8dc0b=_0xa9fd('0x14');break;case'CN':_0xe8dc0b=_0xa9fd('0x15');break;default:_0xe8dc0b=_0xa9fd('0x25');break;}var _0x580dba={'method':_0xa9fd('0x16'),'uri':_0xe8dc0b+_0xa9fd('0x26'),'form':{'grant_type':_0xa9fd('0x17'),'client_id':_0x1ef8e6[_0xa9fd('0xd')],'client_secret':_0x1ef8e6[_0xa9fd('0xe')],'redirect_uri':_0x1ef8e6[_0xa9fd('0xc')],'code':_0x1ef8e6['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x580dba)[_0xa9fd('0x19')](function(_0x26a221){var _0x1053df=JSON[_0xa9fd('0x27')](_0x26a221);if(_0x1053df['refresh_token']){_0x1ef8e6[_0xa9fd('0x28')]=_0x1053df[_0xa9fd('0x1a')];logger[_0xa9fd('0x1b')](util['format'](_0xa9fd('0x1d'),_0x1ef8e6[_0xa9fd('0x1e')],_0x1ef8e6['id']));}else{logger[_0xa9fd('0x1f')](util[_0xa9fd('0x1c')](_0xa9fd('0x20'),_0x1ef8e6[_0xa9fd('0x1e')],_0x1ef8e6['id']),util[_0xa9fd('0x21')](_0x1053df,{'showHidden':![],'depth':null}));}return _0x5cb550(null,_0x5b21b4);})[_0xa9fd('0x22')](function(_0x5a21b3){logger[_0xa9fd('0x1f')](util[_0xa9fd('0x1c')](_0xa9fd('0x20'),_0x1ef8e6[_0xa9fd('0x1e')],_0x1ef8e6['id']),util[_0xa9fd('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x5cb550(_0x5a21b3);});}else{return _0x5cb550(null,_0x5b21b4);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 92032dd..97d372c 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 _0x9ab8=['info','lodash','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','catch','GetZohoAccount','findAll','options','attributes','limit','include','map','model','debug','ShowZohoAccount','ZohoAccount','where'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x9ab8,0x81));var _0x89ab=function(_0x502723,_0x84d1c4){_0x502723=_0x502723-0x0;var _0x2d02b9=_0x9ab8[_0x502723];return _0x2d02b9;};'use strict';var _=require(_0x89ab('0x0'));var util=require(_0x89ab('0x1'));var moment=require(_0x89ab('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x89ab('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x89ab('0x4'));var logger=require(_0x89ab('0x5'))('rpc');var config=require(_0x89ab('0x6'));var jayson=require(_0x89ab('0x7'));var client=jayson[_0x89ab('0x8')][_0x89ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29a984,_0x3ecaa0,_0x366c32){return new BPromise(function(_0x5fd99f,_0x42da87){return client[_0x89ab('0xa')](_0x29a984,_0x366c32)[_0x89ab('0xb')](function(_0x36dc63){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x3ecaa0,'request\x20sent');logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x3ecaa0,_0x89ab('0xc'),JSON[_0x89ab('0xd')](_0x36dc63));if(_0x36dc63[_0x89ab('0xe')]){if(_0x36dc63[_0x89ab('0xe')][_0x89ab('0xf')]===0x1f4){logger[_0x89ab('0xe')](_0x89ab('0x10'),_0x3ecaa0,_0x36dc63['error'][_0x89ab('0x11')]);return _0x42da87(_0x36dc63[_0x89ab('0xe')][_0x89ab('0x11')]);}logger[_0x89ab('0xe')](_0x89ab('0x10'),_0x3ecaa0,_0x36dc63['error'][_0x89ab('0x11')]);return _0x5fd99f(_0x36dc63[_0x89ab('0xe')]['message']);}else{logger['info']('ZohoAccount,\x20%s,\x20%s',_0x3ecaa0,'request\x20sent');_0x5fd99f(_0x36dc63['result']['message']);}})[_0x89ab('0x12')](function(_0x1ce918){logger[_0x89ab('0xe')](_0x89ab('0x10'),_0x3ecaa0,_0x1ce918);_0x42da87(_0x1ce918);});});}exports[_0x89ab('0x13')]=function(_0x141b86){var _0x3f12ab=this;return new Promise(function(_0x2af38f,_0x24d68f){return db['ZohoAccount'][_0x89ab('0x14')]({'raw':_0x141b86[_0x89ab('0x15')]?_0x141b86['options']['raw']===undefined?!![]:![]:!![],'where':_0x141b86[_0x89ab('0x15')]?_0x141b86[_0x89ab('0x15')]['where']||null:null,'attributes':_0x141b86[_0x89ab('0x15')]?_0x141b86[_0x89ab('0x15')][_0x89ab('0x16')]||null:null,'limit':_0x141b86[_0x89ab('0x15')]?_0x141b86[_0x89ab('0x15')][_0x89ab('0x17')]||null:null,'include':_0x141b86[_0x89ab('0x15')]?_0x141b86[_0x89ab('0x15')][_0x89ab('0x18')]?_[_0x89ab('0x19')](_0x141b86[_0x89ab('0x15')][_0x89ab('0x18')],function(_0x257aec){return{'model':db[_0x257aec[_0x89ab('0x1a')]],'as':_0x257aec['as'],'attributes':_0x257aec[_0x89ab('0x16')],'include':_0x257aec[_0x89ab('0x18')]?_['map'](_0x257aec[_0x89ab('0x18')],function(_0x548430){return{'model':db[_0x548430[_0x89ab('0x1a')]],'as':_0x548430['as'],'attributes':_0x548430['attributes'],'include':_0x548430['include']?_[_0x89ab('0x19')](_0x548430['include'],function(_0x5c2c79){return{'model':db[_0x5c2c79[_0x89ab('0x1a')]],'as':_0x5c2c79['as'],'attributes':_0x5c2c79[_0x89ab('0x16')]};}):[]};}):[]};}):[]:[]})[_0x89ab('0xb')](function(_0x2f88d1){logger['info'](_0x89ab('0x13'),_0x141b86);logger[_0x89ab('0x1b')](_0x89ab('0x13'),_0x141b86,JSON[_0x89ab('0xd')](_0x2f88d1));_0x2af38f(_0x2f88d1);})['catch'](function(_0x407018){logger[_0x89ab('0xe')](_0x89ab('0x13'),_0x407018[_0x89ab('0x11')],_0x141b86);_0x24d68f(_0x3f12ab[_0x89ab('0xe')](0x1f4,_0x407018[_0x89ab('0x11')]));});});};exports[_0x89ab('0x1c')]=function(_0x34550c){var _0x2103b7=this;return new Promise(function(_0x13e9da,_0x1cd3f1){return db[_0x89ab('0x1d')]['find']({'raw':_0x34550c[_0x89ab('0x15')]?_0x34550c[_0x89ab('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x34550c[_0x89ab('0x15')]?_0x34550c['options'][_0x89ab('0x1e')]||null:null,'attributes':_0x34550c['options']?_0x34550c[_0x89ab('0x15')][_0x89ab('0x16')]||null:null,'include':_0x34550c[_0x89ab('0x15')]?_0x34550c[_0x89ab('0x15')]['include']?_[_0x89ab('0x19')](_0x34550c[_0x89ab('0x15')]['include'],function(_0x3f4a38){return{'model':db[_0x3f4a38[_0x89ab('0x1a')]],'as':_0x3f4a38['as'],'attributes':_0x3f4a38['attributes'],'include':_0x3f4a38[_0x89ab('0x18')]?_[_0x89ab('0x19')](_0x3f4a38[_0x89ab('0x18')],function(_0x25f5b9){return{'model':db[_0x25f5b9['model']],'as':_0x25f5b9['as'],'attributes':_0x25f5b9['attributes'],'include':_0x25f5b9[_0x89ab('0x18')]?_[_0x89ab('0x19')](_0x25f5b9[_0x89ab('0x18')],function(_0x5a94c6){return{'model':db[_0x5a94c6[_0x89ab('0x1a')]],'as':_0x5a94c6['as'],'attributes':_0x5a94c6['attributes']};}):[]};}):[]};}):[]:[]})[_0x89ab('0xb')](function(_0xfe089d){logger[_0x89ab('0x1f')]('ShowZohoAccount',_0x34550c);logger[_0x89ab('0x1b')](_0x89ab('0x1c'),_0x34550c,JSON[_0x89ab('0xd')](_0xfe089d));_0x13e9da(_0xfe089d);})[_0x89ab('0x12')](function(_0x553b78){logger[_0x89ab('0xe')](_0x89ab('0x1c'),_0x553b78[_0x89ab('0x11')],_0x34550c);_0x1cd3f1(_0x2103b7['error'](0x1f4,_0x553b78['message']));});});}; \ No newline at end of file +var _0x3e94=['stringify','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','attributes','map','include','model','find','ShowZohoAccount'];(function(_0x3b5b94,_0x1b1d80){var _0x507e9e=function(_0x2375e3){while(--_0x2375e3){_0x3b5b94['push'](_0x3b5b94['shift']());}};_0x507e9e(++_0x1b1d80);}(_0x3e94,0x67));var _0x43e9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3e94[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x43e9('0x0'));var util=require(_0x43e9('0x1'));var moment=require('moment');var BPromise=require(_0x43e9('0x2'));var rs=require(_0x43e9('0x3'));var fs=require('fs');var Redis=require(_0x43e9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x43e9('0x5'));var logger=require(_0x43e9('0x6'))(_0x43e9('0x7'));var config=require('../../config/environment');var jayson=require(_0x43e9('0x8'));var client=jayson['client'][_0x43e9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b35f1,_0x1183a0,_0x2989fe){return new BPromise(function(_0x287aaf,_0x510ee7){return client[_0x43e9('0xa')](_0x4b35f1,_0x2989fe)[_0x43e9('0xb')](function(_0x43d6e8){logger[_0x43e9('0xc')](_0x43e9('0xd'),_0x1183a0,_0x43e9('0xe'));logger[_0x43e9('0xf')](_0x43e9('0x10'),_0x1183a0,_0x43e9('0xe'),JSON['stringify'](_0x43d6e8));if(_0x43d6e8[_0x43e9('0x11')]){if(_0x43d6e8[_0x43e9('0x11')][_0x43e9('0x12')]===0x1f4){logger['error'](_0x43e9('0xd'),_0x1183a0,_0x43d6e8[_0x43e9('0x11')][_0x43e9('0x13')]);return _0x510ee7(_0x43d6e8[_0x43e9('0x11')][_0x43e9('0x13')]);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x1183a0,_0x43d6e8[_0x43e9('0x11')]['message']);return _0x287aaf(_0x43d6e8[_0x43e9('0x11')][_0x43e9('0x13')]);}else{logger[_0x43e9('0xc')](_0x43e9('0xd'),_0x1183a0,_0x43e9('0xe'));_0x287aaf(_0x43d6e8[_0x43e9('0x14')][_0x43e9('0x13')]);}})[_0x43e9('0x15')](function(_0x3f7164){logger[_0x43e9('0x11')](_0x43e9('0xd'),_0x1183a0,_0x3f7164);_0x510ee7(_0x3f7164);});});}exports[_0x43e9('0x16')]=function(_0x310476){var _0x31614e=this;return new Promise(function(_0x527d97,_0x4e9fef){return db[_0x43e9('0x17')][_0x43e9('0x18')]({'raw':_0x310476[_0x43e9('0x19')]?_0x310476[_0x43e9('0x19')][_0x43e9('0x1a')]===undefined?!![]:![]:!![],'where':_0x310476['options']?_0x310476[_0x43e9('0x19')]['where']||null:null,'attributes':_0x310476[_0x43e9('0x19')]?_0x310476[_0x43e9('0x19')][_0x43e9('0x1b')]||null:null,'limit':_0x310476[_0x43e9('0x19')]?_0x310476[_0x43e9('0x19')]['limit']||null:null,'include':_0x310476[_0x43e9('0x19')]?_0x310476[_0x43e9('0x19')]['include']?_[_0x43e9('0x1c')](_0x310476[_0x43e9('0x19')][_0x43e9('0x1d')],function(_0x6e609b){return{'model':db[_0x6e609b['model']],'as':_0x6e609b['as'],'attributes':_0x6e609b[_0x43e9('0x1b')],'include':_0x6e609b['include']?_[_0x43e9('0x1c')](_0x6e609b['include'],function(_0x486539){return{'model':db[_0x486539['model']],'as':_0x486539['as'],'attributes':_0x486539['attributes'],'include':_0x486539[_0x43e9('0x1d')]?_['map'](_0x486539[_0x43e9('0x1d')],function(_0xf0dbbf){return{'model':db[_0xf0dbbf[_0x43e9('0x1e')]],'as':_0xf0dbbf['as'],'attributes':_0xf0dbbf['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xf64426){logger['info']('GetZohoAccount',_0x310476);logger[_0x43e9('0xf')]('GetZohoAccount',_0x310476,JSON['stringify'](_0xf64426));_0x527d97(_0xf64426);})['catch'](function(_0x197c88){logger[_0x43e9('0x11')]('GetZohoAccount',_0x197c88[_0x43e9('0x13')],_0x310476);_0x4e9fef(_0x31614e['error'](0x1f4,_0x197c88[_0x43e9('0x13')]));});});};exports['ShowZohoAccount']=function(_0x24dfff){var _0x580bd0=this;return new Promise(function(_0x4cd81b,_0x128b56){return db[_0x43e9('0x17')][_0x43e9('0x1f')]({'raw':_0x24dfff[_0x43e9('0x19')]?_0x24dfff[_0x43e9('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x24dfff[_0x43e9('0x19')]?_0x24dfff['options']['where']||null:null,'attributes':_0x24dfff[_0x43e9('0x19')]?_0x24dfff[_0x43e9('0x19')][_0x43e9('0x1b')]||null:null,'include':_0x24dfff[_0x43e9('0x19')]?_0x24dfff['options'][_0x43e9('0x1d')]?_[_0x43e9('0x1c')](_0x24dfff[_0x43e9('0x19')][_0x43e9('0x1d')],function(_0x55ea93){return{'model':db[_0x55ea93[_0x43e9('0x1e')]],'as':_0x55ea93['as'],'attributes':_0x55ea93[_0x43e9('0x1b')],'include':_0x55ea93[_0x43e9('0x1d')]?_[_0x43e9('0x1c')](_0x55ea93[_0x43e9('0x1d')],function(_0x3599e5){return{'model':db[_0x3599e5[_0x43e9('0x1e')]],'as':_0x3599e5['as'],'attributes':_0x3599e5['attributes'],'include':_0x3599e5[_0x43e9('0x1d')]?_[_0x43e9('0x1c')](_0x3599e5[_0x43e9('0x1d')],function(_0x42b436){return{'model':db[_0x42b436[_0x43e9('0x1e')]],'as':_0x42b436['as'],'attributes':_0x42b436['attributes']};}):[]};}):[]};}):[]:[]})[_0x43e9('0xb')](function(_0x238998){logger[_0x43e9('0xc')]('ShowZohoAccount',_0x24dfff);logger[_0x43e9('0xf')](_0x43e9('0x20'),_0x24dfff,JSON[_0x43e9('0x21')](_0x238998));_0x4cd81b(_0x238998);})[_0x43e9('0x15')](function(_0x133fc7){logger['error'](_0x43e9('0x20'),_0x133fc7[_0x43e9('0x13')],_0x24dfff);_0x128b56(_0x580bd0[_0x43e9('0x11')](0x1f4,_0x133fc7[_0x43e9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 1b3191d..43bd887 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 _0x2163=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete'];(function(_0x2409cc,_0x3aa849){var _0x3fd56e=function(_0x8e9980){while(--_0x8e9980){_0x2409cc['push'](_0x2409cc['shift']());}};_0x3fd56e(++_0x3aa849);}(_0x2163,0x1c3));var _0x3216=function(_0x558227,_0x421e36){_0x558227=_0x558227-0x0;var _0x2b66c6=_0x2163[_0x558227];return _0x2b66c6;};'use strict';var multer=require(_0x3216('0x0'));var util=require(_0x3216('0x1'));var path=require(_0x3216('0x2'));var timeout=require(_0x3216('0x3'));var express=require(_0x3216('0x4'));var router=express[_0x3216('0x5')]();var fs_extra=require(_0x3216('0x6'));var auth=require(_0x3216('0x7'));var interaction=require(_0x3216('0x8'));var config=require(_0x3216('0x9'));var controller=require('./intZohoConfiguration.controller');router[_0x3216('0xa')]('/',auth[_0x3216('0xb')](),controller['index']);router[_0x3216('0xa')](_0x3216('0xc'),auth[_0x3216('0xb')](),controller[_0x3216('0xd')]);router['get'](_0x3216('0xe'),auth[_0x3216('0xb')](),controller[_0x3216('0xf')]);router[_0x3216('0xa')]('/:id/subjects',auth[_0x3216('0xb')](),controller[_0x3216('0x10')]);router[_0x3216('0xa')](_0x3216('0x11'),auth[_0x3216('0xb')](),controller[_0x3216('0x12')]);router[_0x3216('0x13')]('/',auth[_0x3216('0xb')](),controller[_0x3216('0x14')]);router[_0x3216('0x15')]('/:id',auth[_0x3216('0xb')](),controller[_0x3216('0x16')]);router[_0x3216('0x17')](_0x3216('0xc'),auth[_0x3216('0xb')](),controller['destroy']);module[_0x3216('0x18')]=router; \ No newline at end of file +var _0x7fe3=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','/:id/descriptions','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x7fe3,0x153));var _0x37fe=function(_0x3205f7,_0x2bcfc6){_0x3205f7=_0x3205f7-0x0;var _0x19a463=_0x7fe3[_0x3205f7];return _0x19a463;};'use strict';var multer=require(_0x37fe('0x0'));var util=require('util');var path=require(_0x37fe('0x1'));var timeout=require(_0x37fe('0x2'));var express=require(_0x37fe('0x3'));var router=express[_0x37fe('0x4')]();var fs_extra=require(_0x37fe('0x5'));var auth=require(_0x37fe('0x6'));var interaction=require(_0x37fe('0x7'));var config=require(_0x37fe('0x8'));var controller=require(_0x37fe('0x9'));router[_0x37fe('0xa')]('/',auth[_0x37fe('0xb')](),controller[_0x37fe('0xc')]);router[_0x37fe('0xa')](_0x37fe('0xd'),auth[_0x37fe('0xb')](),controller['show']);router['get'](_0x37fe('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0x37fe('0xa')](_0x37fe('0xf'),auth[_0x37fe('0xb')](),controller['getSubjects']);router[_0x37fe('0xa')](_0x37fe('0x10'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x37fe('0x11')]('/',auth['isAuthenticated'](),controller[_0x37fe('0x12')]);router[_0x37fe('0x13')](_0x37fe('0xd'),auth['isAuthenticated'](),controller[_0x37fe('0x14')]);router[_0x37fe('0x15')](_0x37fe('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x37fe('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 47ef732..604dcd9 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 _0x0207=['nothing','ENUM','contact_lead','STRING','exports','lead','contact'];(function(_0x59659d,_0xb17019){var _0x2adbb5=function(_0x22ea94){while(--_0x22ea94){_0x59659d['push'](_0x59659d['shift']());}};_0x2adbb5(++_0xb17019);}(_0x0207,0x162));var _0x7020=function(_0x4e806d,_0x4cc01d){_0x4e806d=_0x4e806d-0x0;var _0x20821f=_0x0207[_0x4e806d];return _0x20821f;};'use strict';var Sequelize=require('sequelize');module[_0x7020('0x0')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize['ENUM'](_0x7020('0x1'),_0x7020('0x2'),_0x7020('0x3')),'defaultValue':_0x7020('0x1')},'moduleSearch':{'type':Sequelize[_0x7020('0x4')](_0x7020('0x5'),_0x7020('0x2'),'lead'),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x7020('0x6')]}}; \ No newline at end of file +var _0xfeb8=['lead','contact','nothing','contact_lead','ENUM'];(function(_0x2b8d02,_0x60cec6){var _0x1c0eaf=function(_0x44d3b7){while(--_0x44d3b7){_0x2b8d02['push'](_0x2b8d02['shift']());}};_0x1c0eaf(++_0x60cec6);}(_0xfeb8,0x167));var _0x8feb=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfeb8[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x8feb('0x0')](_0x8feb('0x1'),_0x8feb('0x2'),_0x8feb('0x3')),'defaultValue':_0x8feb('0x1')},'moduleSearch':{'type':Sequelize['ENUM'](_0x8feb('0x4'),'contact','lead'),'defaultValue':'contact_lead'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index a38c27b..c006e60 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 _0x23b3=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','sendStatus','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','show','params','keys','find','catch','create','body','destroy','getFields','findOne','order','hasOwnProperty','getSubjects','ZohoField','nolimit','getDescriptions','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x2e93d2,_0x4547ca){var _0x4d6ba2=function(_0x585449){while(--_0x585449){_0x2e93d2['push'](_0x2e93d2['shift']());}};_0x4d6ba2(++_0x4547ca);}(_0x23b3,0x13b));var _0x323b=function(_0x19ccea,_0x5056b2){_0x19ccea=_0x19ccea-0x0;var _0x149dd4=_0x23b3[_0x19ccea];return _0x149dd4;};'use strict';var emlformat=require(_0x323b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x323b('0x1'));var rp=require(_0x323b('0x2'));var moment=require(_0x323b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x323b('0x4'));var util=require(_0x323b('0x5'));var path=require(_0x323b('0x6'));var sox=require(_0x323b('0x7'));var csv=require(_0x323b('0x8'));var ejs=require(_0x323b('0x9'));var fs=require('fs');var fs_extra=require(_0x323b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x323b('0xb'));var jsforce=require(_0x323b('0xc'));var deskjs=require(_0x323b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x323b('0xe'));var Papa=require(_0x323b('0xf'));var Redis=require(_0x323b('0x10'));var authService=require(_0x323b('0x11'));var qs=require(_0x323b('0x12'));var as=require(_0x323b('0x13'));var hardwareService=require(_0x323b('0x14'));var logger=require(_0x323b('0x15'))(_0x323b('0x16'));var utils=require(_0x323b('0x17'));var config=require(_0x323b('0x18'));var licenseUtil=require(_0x323b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x466db3,_0x85ac0e){_0x85ac0e=_0x85ac0e||0xcc;return function(_0x13542b){if(_0x13542b){return _0x466db3['sendStatus'](_0x85ac0e);}return _0x466db3[_0x323b('0x1a')](_0x85ac0e)[_0x323b('0x1b')]();};}function respondWithResult(_0x1d5dd1,_0x1c7d52){_0x1c7d52=_0x1c7d52||0xc8;return function(_0x325a72){if(_0x325a72){return _0x1d5dd1[_0x323b('0x1a')](_0x1c7d52)[_0x323b('0x1c')](_0x325a72);}};}function respondWithFilteredResult(_0x26f245,_0x169fac){return function(_0x54dbd4){if(_0x54dbd4){var _0x483fa4=typeof _0x169fac[_0x323b('0x1d')]===_0x323b('0x1e')&&typeof _0x169fac[_0x323b('0x1f')]===_0x323b('0x1e');var _0x37ab62=_0x54dbd4[_0x323b('0x20')];var _0xa89585=_0x483fa4?0x0:_0x169fac[_0x323b('0x1d')];var _0x19647d=_0x483fa4?_0x54dbd4[_0x323b('0x20')]:_0x169fac[_0x323b('0x1d')]+_0x169fac[_0x323b('0x1f')];var _0x300d1a;if(_0x19647d>=_0x37ab62){_0x19647d=_0x37ab62;_0x300d1a=0xc8;}else{_0x300d1a=0xce;}_0x26f245[_0x323b('0x1a')](_0x300d1a);return _0x26f245[_0x323b('0x21')]('Content-Range',_0xa89585+'-'+_0x19647d+'/'+_0x37ab62)[_0x323b('0x1c')](_0x54dbd4);}return null;};}function patchUpdates(_0x327a7a){return function(_0x29a5d1){try{jsonpatch['apply'](_0x29a5d1,_0x327a7a,!![]);}catch(_0xb38024){return BPromise[_0x323b('0x22')](_0xb38024);}return _0x29a5d1[_0x323b('0x23')]();};}function saveUpdates(_0x320404,_0x46728d){return function(_0x578534){if(_0x578534){return _0x578534[_0x323b('0x24')](_0x320404)['then'](function(_0x47918b){return _0x47918b;});}return null;};}function removeEntity(_0x524a80,_0x5090b9){return function(_0x47bb0b){if(_0x47bb0b){return _0x47bb0b['destroy']()[_0x323b('0x25')](function(){_0x524a80[_0x323b('0x1a')](0xcc)[_0x323b('0x1b')]();});}};}function handleEntityNotFound(_0x58ea6f,_0xe34cf3){return function(_0x175c93){if(!_0x175c93){_0x58ea6f[_0x323b('0x26')](0x194);}return _0x175c93;};}function handleError(_0x48a089,_0x2e1189){_0x2e1189=_0x2e1189||0x1f4;return function(_0x32256d){logger[_0x323b('0x27')](_0x32256d[_0x323b('0x28')]);if(_0x32256d[_0x323b('0x29')]){delete _0x32256d['name'];}_0x48a089[_0x323b('0x1a')](_0x2e1189)[_0x323b('0x2a')](_0x32256d);};}exports[_0x323b('0x2b')]=function(_0x59d58a,_0x2bd419){var _0x24147c={},_0xe197ea={},_0x221d43={'count':0x0,'rows':[]};var _0x1f761a=_[_0x323b('0x2c')](db[_0x323b('0x2d')][_0x323b('0x2e')],function(_0x1f8535){return{'name':_0x1f8535[_0x323b('0x2f')],'type':_0x1f8535[_0x323b('0x30')][_0x323b('0x31')]};});_0xe197ea[_0x323b('0x32')]=_[_0x323b('0x2c')](_0x1f761a,_0x323b('0x29'));_0xe197ea[_0x323b('0x33')]=_['keys'](_0x59d58a[_0x323b('0x33')]);_0xe197ea[_0x323b('0x34')]=_[_0x323b('0x35')](_0xe197ea[_0x323b('0x32')],_0xe197ea[_0x323b('0x33')]);_0x24147c[_0x323b('0x36')]=_[_0x323b('0x35')](_0xe197ea[_0x323b('0x32')],qs['fields'](_0x59d58a[_0x323b('0x33')][_0x323b('0x37')]));_0x24147c[_0x323b('0x36')]=_0x24147c[_0x323b('0x36')][_0x323b('0x38')]?_0x24147c[_0x323b('0x36')]:_0xe197ea['model'];if(!_0x59d58a[_0x323b('0x33')]['hasOwnProperty']('nolimit')){_0x24147c[_0x323b('0x1f')]=qs['limit'](_0x59d58a[_0x323b('0x33')][_0x323b('0x1f')]);_0x24147c[_0x323b('0x1d')]=qs[_0x323b('0x1d')](_0x59d58a[_0x323b('0x33')]['offset']);}_0x24147c['order']=qs[_0x323b('0x39')](_0x59d58a[_0x323b('0x33')][_0x323b('0x39')]);_0x24147c[_0x323b('0x3a')]=qs['filters'](_[_0x323b('0x3b')](_0x59d58a[_0x323b('0x33')],_0xe197ea['filters']),_0x1f761a);if(_0x59d58a[_0x323b('0x33')][_0x323b('0x3c')]){_0x24147c[_0x323b('0x3a')]=_['merge'](_0x24147c[_0x323b('0x3a')],{'$or':_[_0x323b('0x2c')](_0x1f761a,function(_0x1c025a){if(_0x1c025a[_0x323b('0x30')]!==_0x323b('0x3d')){var _0x4602ea={};_0x4602ea[_0x1c025a[_0x323b('0x29')]]={'$like':'%'+_0x59d58a['query'][_0x323b('0x3c')]+'%'};return _0x4602ea;}})});}_0x24147c=_[_0x323b('0x3e')]({},_0x24147c,_0x59d58a[_0x323b('0x3f')]);var _0x172d49={'where':_0x24147c['where']};return db[_0x323b('0x2d')][_0x323b('0x20')](_0x172d49)[_0x323b('0x25')](function(_0x328b18){_0x221d43['count']=_0x328b18;if(_0x59d58a[_0x323b('0x33')][_0x323b('0x40')]){_0x24147c[_0x323b('0x41')]=[{'all':!![]}];}return db[_0x323b('0x2d')]['findAll'](_0x24147c);})[_0x323b('0x25')](function(_0x64a455){_0x221d43[_0x323b('0x42')]=_0x64a455;return _0x221d43;})[_0x323b('0x25')](respondWithFilteredResult(_0x2bd419,_0x24147c))['catch'](handleError(_0x2bd419,null));};exports[_0x323b('0x43')]=function(_0xea4162,_0x5c2f20){var _0x39b53c={'raw':![],'where':{'id':_0xea4162[_0x323b('0x44')]['id']}},_0x35e771={};_0x35e771['model']=_['keys'](db[_0x323b('0x2d')][_0x323b('0x2e')]);_0x35e771[_0x323b('0x33')]=_[_0x323b('0x45')](_0xea4162[_0x323b('0x33')]);_0x35e771['filters']=_['intersection'](_0x35e771['model'],_0x35e771[_0x323b('0x33')]);_0x39b53c['attributes']=_[_0x323b('0x35')](_0x35e771[_0x323b('0x32')],qs[_0x323b('0x37')](_0xea4162[_0x323b('0x33')]['fields']));_0x39b53c['attributes']=_0x39b53c[_0x323b('0x36')]['length']?_0x39b53c[_0x323b('0x36')]:_0x35e771['model'];if(_0xea4162['query'][_0x323b('0x40')]){_0x39b53c[_0x323b('0x41')]=[{'all':!![]}];}_0x39b53c=_[_0x323b('0x3e')]({},_0x39b53c,_0xea4162['options']);return db['ZohoConfiguration'][_0x323b('0x46')](_0x39b53c)[_0x323b('0x25')](handleEntityNotFound(_0x5c2f20,null))[_0x323b('0x25')](respondWithResult(_0x5c2f20,null))[_0x323b('0x47')](handleError(_0x5c2f20,null));};exports[_0x323b('0x48')]=function(_0x536078,_0x5725b){return db[_0x323b('0x2d')][_0x323b('0x48')](_0x536078[_0x323b('0x49')],{})[_0x323b('0x25')](respondWithResult(_0x5725b,0xc9))[_0x323b('0x47')](handleError(_0x5725b,null));};exports[_0x323b('0x24')]=function(_0x239e92,_0x27000d){if(_0x239e92[_0x323b('0x49')]['id']){delete _0x239e92['body']['id'];}return db[_0x323b('0x2d')][_0x323b('0x46')]({'where':{'id':_0x239e92[_0x323b('0x44')]['id']}})['then'](handleEntityNotFound(_0x27000d,null))[_0x323b('0x25')](saveUpdates(_0x239e92[_0x323b('0x49')],null))[_0x323b('0x25')](respondWithResult(_0x27000d,null))[_0x323b('0x47')](handleError(_0x27000d,null));};exports[_0x323b('0x4a')]=function(_0x5f4d0c,_0x3d4816){return db['ZohoConfiguration']['find']({'where':{'id':_0x5f4d0c[_0x323b('0x44')]['id']}})[_0x323b('0x25')](handleEntityNotFound(_0x3d4816,null))[_0x323b('0x25')](removeEntity(_0x3d4816,null))[_0x323b('0x47')](handleError(_0x3d4816,null));};exports[_0x323b('0x4b')]=function(_0x2b2b54,_0x2a374a,_0x4891cf){var _0x3e76ef={};var _0x21b834={};var _0x8a34f;var _0x247022;return db[_0x323b('0x2d')][_0x323b('0x4c')]({'where':{'id':_0x2b2b54[_0x323b('0x44')]['id']}})[_0x323b('0x25')](handleEntityNotFound(_0x2a374a,null))[_0x323b('0x25')](function(_0x232b22){if(_0x232b22){_0x8a34f=_0x232b22;_0x21b834['model']=_[_0x323b('0x45')](db['ZohoField'][_0x323b('0x2e')]);_0x21b834[_0x323b('0x33')]=_[_0x323b('0x45')](_0x2b2b54['query']);_0x21b834[_0x323b('0x34')]=_['intersection'](_0x21b834['model'],_0x21b834['query']);_0x3e76ef[_0x323b('0x36')]=_[_0x323b('0x35')](_0x21b834[_0x323b('0x32')],qs['fields'](_0x2b2b54[_0x323b('0x33')][_0x323b('0x37')]));_0x3e76ef[_0x323b('0x36')]=_0x3e76ef['attributes'][_0x323b('0x38')]?_0x3e76ef['attributes']:_0x21b834[_0x323b('0x32')];_0x3e76ef[_0x323b('0x4d')]=qs[_0x323b('0x39')](_0x2b2b54[_0x323b('0x33')][_0x323b('0x39')]);_0x3e76ef[_0x323b('0x3a')]=qs[_0x323b('0x34')](_[_0x323b('0x3b')](_0x2b2b54[_0x323b('0x33')],_0x21b834['filters']));if(_0x2b2b54['query'][_0x323b('0x3c')]){_0x3e76ef[_0x323b('0x3a')]=_[_0x323b('0x3e')](_0x3e76ef['where'],{'$or':_[_0x323b('0x2c')](_0x3e76ef[_0x323b('0x36')],function(_0xe2f286){var _0x324e04={};_0x324e04[_0xe2f286]={'$like':'%'+_0x2b2b54[_0x323b('0x33')]['filter']+'%'};return _0x324e04;})});}_0x3e76ef=_[_0x323b('0x3e')]({},_0x3e76ef,_0x2b2b54[_0x323b('0x3f')]);return _0x8a34f[_0x323b('0x4b')](_0x3e76ef);}})[_0x323b('0x25')](function(_0x3aa37d){if(_0x3aa37d){_0x247022=_0x3aa37d[_0x323b('0x38')];if(!_0x2b2b54[_0x323b('0x33')][_0x323b('0x4e')]('nolimit')){_0x3e76ef['limit']=qs[_0x323b('0x1f')](_0x2b2b54[_0x323b('0x33')][_0x323b('0x1f')]);_0x3e76ef[_0x323b('0x1d')]=qs[_0x323b('0x1d')](_0x2b2b54['query'][_0x323b('0x1d')]);}return _0x8a34f[_0x323b('0x4b')](_0x3e76ef);}})[_0x323b('0x25')](function(_0x36a5f4){if(_0x36a5f4){return _0x36a5f4?{'count':_0x247022,'rows':_0x36a5f4}:null;}})[_0x323b('0x25')](respondWithResult(_0x2a374a,null))[_0x323b('0x47')](handleError(_0x2a374a,null));};exports[_0x323b('0x4f')]=function(_0x1548be,_0x2c7b85,_0x4fcd6b){var _0x2d309b={};var _0xee7231={};var _0x229142;var _0x4a8603;return db[_0x323b('0x2d')][_0x323b('0x4c')]({'where':{'id':_0x1548be[_0x323b('0x44')]['id']}})[_0x323b('0x25')](handleEntityNotFound(_0x2c7b85,null))[_0x323b('0x25')](function(_0x5ef533){if(_0x5ef533){_0x229142=_0x5ef533;_0xee7231[_0x323b('0x32')]=_[_0x323b('0x45')](db[_0x323b('0x50')][_0x323b('0x2e')]);_0xee7231['query']=_[_0x323b('0x45')](_0x1548be[_0x323b('0x33')]);_0xee7231[_0x323b('0x34')]=_['intersection'](_0xee7231[_0x323b('0x32')],_0xee7231['query']);_0x2d309b[_0x323b('0x36')]=_['intersection'](_0xee7231[_0x323b('0x32')],qs['fields'](_0x1548be[_0x323b('0x33')]['fields']));_0x2d309b[_0x323b('0x36')]=_0x2d309b[_0x323b('0x36')]['length']?_0x2d309b[_0x323b('0x36')]:_0xee7231['model'];_0x2d309b[_0x323b('0x4d')]=qs[_0x323b('0x39')](_0x1548be[_0x323b('0x33')][_0x323b('0x39')]);_0x2d309b[_0x323b('0x3a')]=qs[_0x323b('0x34')](_[_0x323b('0x3b')](_0x1548be[_0x323b('0x33')],_0xee7231[_0x323b('0x34')]));if(_0x1548be[_0x323b('0x33')][_0x323b('0x3c')]){_0x2d309b['where']=_[_0x323b('0x3e')](_0x2d309b[_0x323b('0x3a')],{'$or':_['map'](_0x2d309b[_0x323b('0x36')],function(_0x3a40aa){var _0x39f4f8={};_0x39f4f8[_0x3a40aa]={'$like':'%'+_0x1548be[_0x323b('0x33')][_0x323b('0x3c')]+'%'};return _0x39f4f8;})});}_0x2d309b=_[_0x323b('0x3e')]({},_0x2d309b,_0x1548be[_0x323b('0x3f')]);return _0x229142[_0x323b('0x4f')](_0x2d309b);}})['then'](function(_0x19fde9){if(_0x19fde9){_0x4a8603=_0x19fde9[_0x323b('0x38')];if(!_0x1548be[_0x323b('0x33')]['hasOwnProperty'](_0x323b('0x51'))){_0x2d309b[_0x323b('0x1f')]=qs[_0x323b('0x1f')](_0x1548be[_0x323b('0x33')][_0x323b('0x1f')]);_0x2d309b[_0x323b('0x1d')]=qs['offset'](_0x1548be[_0x323b('0x33')][_0x323b('0x1d')]);}return _0x229142[_0x323b('0x4f')](_0x2d309b);}})[_0x323b('0x25')](function(_0x2ebbc6){if(_0x2ebbc6){return _0x2ebbc6?{'count':_0x4a8603,'rows':_0x2ebbc6}:null;}})[_0x323b('0x25')](respondWithResult(_0x2c7b85,null))['catch'](handleError(_0x2c7b85,null));};exports['getDescriptions']=function(_0x56a8d9,_0x38e6d7,_0x279e99){var _0x59ad7a={};var _0x5ea8ad={};var _0x54d039;var _0x3f9df7;return db['ZohoConfiguration'][_0x323b('0x4c')]({'where':{'id':_0x56a8d9[_0x323b('0x44')]['id']}})[_0x323b('0x25')](handleEntityNotFound(_0x38e6d7,null))['then'](function(_0x6b861c){if(_0x6b861c){_0x54d039=_0x6b861c;_0x5ea8ad['model']=_[_0x323b('0x45')](db[_0x323b('0x50')][_0x323b('0x2e')]);_0x5ea8ad[_0x323b('0x33')]=_[_0x323b('0x45')](_0x56a8d9[_0x323b('0x33')]);_0x5ea8ad[_0x323b('0x34')]=_[_0x323b('0x35')](_0x5ea8ad[_0x323b('0x32')],_0x5ea8ad['query']);_0x59ad7a[_0x323b('0x36')]=_[_0x323b('0x35')](_0x5ea8ad[_0x323b('0x32')],qs['fields'](_0x56a8d9[_0x323b('0x33')][_0x323b('0x37')]));_0x59ad7a[_0x323b('0x36')]=_0x59ad7a[_0x323b('0x36')][_0x323b('0x38')]?_0x59ad7a[_0x323b('0x36')]:_0x5ea8ad[_0x323b('0x32')];_0x59ad7a[_0x323b('0x4d')]=qs[_0x323b('0x39')](_0x56a8d9[_0x323b('0x33')][_0x323b('0x39')]);_0x59ad7a['where']=qs[_0x323b('0x34')](_[_0x323b('0x3b')](_0x56a8d9['query'],_0x5ea8ad[_0x323b('0x34')]));if(_0x56a8d9[_0x323b('0x33')][_0x323b('0x3c')]){_0x59ad7a[_0x323b('0x3a')]=_['merge'](_0x59ad7a[_0x323b('0x3a')],{'$or':_[_0x323b('0x2c')](_0x59ad7a['attributes'],function(_0x44e74b){var _0x1d26f8={};_0x1d26f8[_0x44e74b]={'$like':'%'+_0x56a8d9[_0x323b('0x33')][_0x323b('0x3c')]+'%'};return _0x1d26f8;})});}_0x59ad7a=_[_0x323b('0x3e')]({},_0x59ad7a,_0x56a8d9[_0x323b('0x3f')]);return _0x54d039[_0x323b('0x52')](_0x59ad7a);}})[_0x323b('0x25')](function(_0x2ff95a){if(_0x2ff95a){_0x3f9df7=_0x2ff95a[_0x323b('0x38')];if(!_0x56a8d9[_0x323b('0x33')][_0x323b('0x4e')](_0x323b('0x51'))){_0x59ad7a[_0x323b('0x1f')]=qs['limit'](_0x56a8d9[_0x323b('0x33')][_0x323b('0x1f')]);_0x59ad7a['offset']=qs['offset'](_0x56a8d9[_0x323b('0x33')][_0x323b('0x1d')]);}return _0x54d039[_0x323b('0x52')](_0x59ad7a);}})[_0x323b('0x25')](function(_0x5ac082){if(_0x5ac082){return _0x5ac082?{'count':_0x3f9df7,'rows':_0x5ac082}:null;}})['then'](respondWithResult(_0x38e6d7,null))[_0x323b('0x47')](handleError(_0x38e6d7,null));}; \ No newline at end of file +var _0xb567=['body','getFields','findOne','ZohoField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','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','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','ZohoConfiguration','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create'];(function(_0x401b8e,_0x334bb2){var _0x533f3e=function(_0x59ed14){while(--_0x59ed14){_0x401b8e['push'](_0x401b8e['shift']());}};_0x533f3e(++_0x334bb2);}(_0xb567,0x1f2));var _0x7b56=function(_0x5d98bf,_0xecf85e){_0x5d98bf=_0x5d98bf-0x0;var _0x4a5637=_0xb567[_0x5d98bf];return _0x4a5637;};'use strict';var emlformat=require(_0x7b56('0x0'));var rimraf=require(_0x7b56('0x1'));var zipdir=require(_0x7b56('0x2'));var jsonpatch=require(_0x7b56('0x3'));var rp=require('request-promise');var moment=require(_0x7b56('0x4'));var BPromise=require(_0x7b56('0x5'));var Mustache=require(_0x7b56('0x6'));var util=require('util');var path=require(_0x7b56('0x7'));var sox=require('sox');var csv=require(_0x7b56('0x8'));var ejs=require(_0x7b56('0x9'));var fs=require('fs');var fs_extra=require(_0x7b56('0xa'));var _=require(_0x7b56('0xb'));var squel=require(_0x7b56('0xc'));var crypto=require(_0x7b56('0xd'));var jsforce=require(_0x7b56('0xe'));var deskjs=require(_0x7b56('0xf'));var toCsv=require(_0x7b56('0x8'));var querystring=require(_0x7b56('0x10'));var Papa=require('papaparse');var Redis=require(_0x7b56('0x11'));var authService=require(_0x7b56('0x12'));var qs=require(_0x7b56('0x13'));var as=require(_0x7b56('0x14'));var hardwareService=require(_0x7b56('0x15'));var logger=require(_0x7b56('0x16'))(_0x7b56('0x17'));var utils=require('../../config/utils');var config=require(_0x7b56('0x18'));var licenseUtil=require(_0x7b56('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ce986,_0x1eede4){_0x1eede4=_0x1eede4||0xcc;return function(_0x5865f5){if(_0x5865f5){return _0x5ce986[_0x7b56('0x1a')](_0x1eede4);}return _0x5ce986[_0x7b56('0x1b')](_0x1eede4)[_0x7b56('0x1c')]();};}function respondWithResult(_0x2d335f,_0x3edefe){_0x3edefe=_0x3edefe||0xc8;return function(_0x4eb4b5){if(_0x4eb4b5){return _0x2d335f[_0x7b56('0x1b')](_0x3edefe)['json'](_0x4eb4b5);}};}function respondWithFilteredResult(_0x461a33,_0x320fd3){return function(_0x1eda0a){if(_0x1eda0a){var _0x34ac2f=typeof _0x320fd3[_0x7b56('0x1d')]===_0x7b56('0x1e')&&typeof _0x320fd3[_0x7b56('0x1f')]==='undefined';var _0x5bfc1d=_0x1eda0a[_0x7b56('0x20')];var _0x335c71=_0x34ac2f?0x0:_0x320fd3['offset'];var _0x10171f=_0x34ac2f?_0x1eda0a[_0x7b56('0x20')]:_0x320fd3[_0x7b56('0x1d')]+_0x320fd3[_0x7b56('0x1f')];var _0x2a8253;if(_0x10171f>=_0x5bfc1d){_0x10171f=_0x5bfc1d;_0x2a8253=0xc8;}else{_0x2a8253=0xce;}_0x461a33[_0x7b56('0x1b')](_0x2a8253);return _0x461a33[_0x7b56('0x21')](_0x7b56('0x22'),_0x335c71+'-'+_0x10171f+'/'+_0x5bfc1d)[_0x7b56('0x23')](_0x1eda0a);}return null;};}function patchUpdates(_0x3e2398){return function(_0x42bb32){try{jsonpatch[_0x7b56('0x24')](_0x42bb32,_0x3e2398,!![]);}catch(_0x15a6d4){return BPromise[_0x7b56('0x25')](_0x15a6d4);}return _0x42bb32['save']();};}function saveUpdates(_0x9f22fd,_0x160d72){return function(_0x127a8f){if(_0x127a8f){return _0x127a8f[_0x7b56('0x26')](_0x9f22fd)[_0x7b56('0x27')](function(_0x491914){return _0x491914;});}return null;};}function removeEntity(_0x4ea042,_0x2c88e6){return function(_0xdb57c){if(_0xdb57c){return _0xdb57c[_0x7b56('0x28')]()['then'](function(){_0x4ea042[_0x7b56('0x1b')](0xcc)[_0x7b56('0x1c')]();});}};}function handleEntityNotFound(_0x461179,_0x502e3c){return function(_0x43ae47){if(!_0x43ae47){_0x461179[_0x7b56('0x1a')](0x194);}return _0x43ae47;};}function handleError(_0x47aa52,_0x4ab585){_0x4ab585=_0x4ab585||0x1f4;return function(_0x4d22e5){logger[_0x7b56('0x29')](_0x4d22e5[_0x7b56('0x2a')]);if(_0x4d22e5[_0x7b56('0x2b')]){delete _0x4d22e5[_0x7b56('0x2b')];}_0x47aa52[_0x7b56('0x1b')](_0x4ab585)['send'](_0x4d22e5);};}exports['index']=function(_0x4e19cc,_0x20d0f5){var _0x9b5b11={},_0x1bbbd1={},_0x5645d8={'count':0x0,'rows':[]};var _0x32619d=_['map'](db[_0x7b56('0x2c')][_0x7b56('0x2d')],function(_0x279071){return{'name':_0x279071['fieldName'],'type':_0x279071[_0x7b56('0x2e')][_0x7b56('0x2f')]};});_0x1bbbd1[_0x7b56('0x30')]=_[_0x7b56('0x31')](_0x32619d,_0x7b56('0x2b'));_0x1bbbd1['query']=_[_0x7b56('0x32')](_0x4e19cc[_0x7b56('0x33')]);_0x1bbbd1[_0x7b56('0x34')]=_[_0x7b56('0x35')](_0x1bbbd1[_0x7b56('0x30')],_0x1bbbd1[_0x7b56('0x33')]);_0x9b5b11[_0x7b56('0x36')]=_[_0x7b56('0x35')](_0x1bbbd1[_0x7b56('0x30')],qs[_0x7b56('0x37')](_0x4e19cc[_0x7b56('0x33')][_0x7b56('0x37')]));_0x9b5b11[_0x7b56('0x36')]=_0x9b5b11['attributes'][_0x7b56('0x38')]?_0x9b5b11[_0x7b56('0x36')]:_0x1bbbd1[_0x7b56('0x30')];if(!_0x4e19cc[_0x7b56('0x33')][_0x7b56('0x39')](_0x7b56('0x3a'))){_0x9b5b11['limit']=qs[_0x7b56('0x1f')](_0x4e19cc[_0x7b56('0x33')][_0x7b56('0x1f')]);_0x9b5b11[_0x7b56('0x1d')]=qs[_0x7b56('0x1d')](_0x4e19cc[_0x7b56('0x33')][_0x7b56('0x1d')]);}_0x9b5b11[_0x7b56('0x3b')]=qs[_0x7b56('0x3c')](_0x4e19cc['query'][_0x7b56('0x3c')]);_0x9b5b11['where']=qs['filters'](_[_0x7b56('0x3d')](_0x4e19cc[_0x7b56('0x33')],_0x1bbbd1[_0x7b56('0x34')]),_0x32619d);if(_0x4e19cc[_0x7b56('0x33')][_0x7b56('0x3e')]){_0x9b5b11[_0x7b56('0x3f')]=_[_0x7b56('0x40')](_0x9b5b11[_0x7b56('0x3f')],{'$or':_[_0x7b56('0x31')](_0x32619d,function(_0x154be0){if(_0x154be0[_0x7b56('0x2e')]!==_0x7b56('0x41')){var _0x283713={};_0x283713[_0x154be0['name']]={'$like':'%'+_0x4e19cc[_0x7b56('0x33')][_0x7b56('0x3e')]+'%'};return _0x283713;}})});}_0x9b5b11=_[_0x7b56('0x40')]({},_0x9b5b11,_0x4e19cc[_0x7b56('0x42')]);var _0x51210c={'where':_0x9b5b11[_0x7b56('0x3f')]};return db[_0x7b56('0x2c')]['count'](_0x51210c)[_0x7b56('0x27')](function(_0x55c018){_0x5645d8[_0x7b56('0x20')]=_0x55c018;if(_0x4e19cc[_0x7b56('0x33')][_0x7b56('0x43')]){_0x9b5b11[_0x7b56('0x44')]=[{'all':!![]}];}return db[_0x7b56('0x2c')][_0x7b56('0x45')](_0x9b5b11);})[_0x7b56('0x27')](function(_0x2ae80a){_0x5645d8[_0x7b56('0x46')]=_0x2ae80a;return _0x5645d8;})[_0x7b56('0x27')](respondWithFilteredResult(_0x20d0f5,_0x9b5b11))[_0x7b56('0x47')](handleError(_0x20d0f5,null));};exports[_0x7b56('0x48')]=function(_0x12d3b9,_0x12c166){var _0x32302e={'raw':![],'where':{'id':_0x12d3b9[_0x7b56('0x49')]['id']}},_0x570b89={};_0x570b89[_0x7b56('0x30')]=_[_0x7b56('0x32')](db[_0x7b56('0x2c')][_0x7b56('0x2d')]);_0x570b89[_0x7b56('0x33')]=_[_0x7b56('0x32')](_0x12d3b9[_0x7b56('0x33')]);_0x570b89['filters']=_['intersection'](_0x570b89[_0x7b56('0x30')],_0x570b89[_0x7b56('0x33')]);_0x32302e[_0x7b56('0x36')]=_[_0x7b56('0x35')](_0x570b89[_0x7b56('0x30')],qs[_0x7b56('0x37')](_0x12d3b9[_0x7b56('0x33')]['fields']));_0x32302e['attributes']=_0x32302e[_0x7b56('0x36')][_0x7b56('0x38')]?_0x32302e[_0x7b56('0x36')]:_0x570b89[_0x7b56('0x30')];if(_0x12d3b9[_0x7b56('0x33')][_0x7b56('0x43')]){_0x32302e[_0x7b56('0x44')]=[{'all':!![]}];}_0x32302e=_[_0x7b56('0x40')]({},_0x32302e,_0x12d3b9[_0x7b56('0x42')]);return db['ZohoConfiguration'][_0x7b56('0x4a')](_0x32302e)['then'](handleEntityNotFound(_0x12c166,null))[_0x7b56('0x27')](respondWithResult(_0x12c166,null))[_0x7b56('0x47')](handleError(_0x12c166,null));};exports[_0x7b56('0x4b')]=function(_0x2da1aa,_0x147523){return db['ZohoConfiguration'][_0x7b56('0x4b')](_0x2da1aa[_0x7b56('0x4c')],{})[_0x7b56('0x27')](respondWithResult(_0x147523,0xc9))['catch'](handleError(_0x147523,null));};exports['update']=function(_0x2c82ec,_0x3d5690){if(_0x2c82ec[_0x7b56('0x4c')]['id']){delete _0x2c82ec['body']['id'];}return db[_0x7b56('0x2c')][_0x7b56('0x4a')]({'where':{'id':_0x2c82ec[_0x7b56('0x49')]['id']}})[_0x7b56('0x27')](handleEntityNotFound(_0x3d5690,null))[_0x7b56('0x27')](saveUpdates(_0x2c82ec['body'],null))['then'](respondWithResult(_0x3d5690,null))[_0x7b56('0x47')](handleError(_0x3d5690,null));};exports[_0x7b56('0x28')]=function(_0x26647d,_0x129f07){return db['ZohoConfiguration'][_0x7b56('0x4a')]({'where':{'id':_0x26647d[_0x7b56('0x49')]['id']}})[_0x7b56('0x27')](handleEntityNotFound(_0x129f07,null))[_0x7b56('0x27')](removeEntity(_0x129f07,null))[_0x7b56('0x47')](handleError(_0x129f07,null));};exports[_0x7b56('0x4d')]=function(_0x51498b,_0x39266c,_0x55f98a){var _0x530789={};var _0x1e7452={};var _0x167437;var _0x50a49d;return db[_0x7b56('0x2c')][_0x7b56('0x4e')]({'where':{'id':_0x51498b[_0x7b56('0x49')]['id']}})[_0x7b56('0x27')](handleEntityNotFound(_0x39266c,null))['then'](function(_0x39c0ed){if(_0x39c0ed){_0x167437=_0x39c0ed;_0x1e7452[_0x7b56('0x30')]=_[_0x7b56('0x32')](db[_0x7b56('0x4f')][_0x7b56('0x2d')]);_0x1e7452['query']=_[_0x7b56('0x32')](_0x51498b[_0x7b56('0x33')]);_0x1e7452[_0x7b56('0x34')]=_['intersection'](_0x1e7452[_0x7b56('0x30')],_0x1e7452[_0x7b56('0x33')]);_0x530789[_0x7b56('0x36')]=_[_0x7b56('0x35')](_0x1e7452['model'],qs['fields'](_0x51498b['query'][_0x7b56('0x37')]));_0x530789['attributes']=_0x530789['attributes'][_0x7b56('0x38')]?_0x530789[_0x7b56('0x36')]:_0x1e7452[_0x7b56('0x30')];_0x530789[_0x7b56('0x3b')]=qs['sort'](_0x51498b[_0x7b56('0x33')]['sort']);_0x530789[_0x7b56('0x3f')]=qs['filters'](_['pick'](_0x51498b['query'],_0x1e7452[_0x7b56('0x34')]));if(_0x51498b[_0x7b56('0x33')][_0x7b56('0x3e')]){_0x530789['where']=_[_0x7b56('0x40')](_0x530789['where'],{'$or':_['map'](_0x530789['attributes'],function(_0x32e72d){var _0x3679ef={};_0x3679ef[_0x32e72d]={'$like':'%'+_0x51498b['query']['filter']+'%'};return _0x3679ef;})});}_0x530789=_[_0x7b56('0x40')]({},_0x530789,_0x51498b[_0x7b56('0x42')]);return _0x167437[_0x7b56('0x4d')](_0x530789);}})[_0x7b56('0x27')](function(_0x418c51){if(_0x418c51){_0x50a49d=_0x418c51[_0x7b56('0x38')];if(!_0x51498b['query'][_0x7b56('0x39')](_0x7b56('0x3a'))){_0x530789[_0x7b56('0x1f')]=qs[_0x7b56('0x1f')](_0x51498b[_0x7b56('0x33')][_0x7b56('0x1f')]);_0x530789[_0x7b56('0x1d')]=qs[_0x7b56('0x1d')](_0x51498b['query'][_0x7b56('0x1d')]);}return _0x167437[_0x7b56('0x4d')](_0x530789);}})[_0x7b56('0x27')](function(_0x59219e){if(_0x59219e){return _0x59219e?{'count':_0x50a49d,'rows':_0x59219e}:null;}})['then'](respondWithResult(_0x39266c,null))[_0x7b56('0x47')](handleError(_0x39266c,null));};exports['getSubjects']=function(_0x311252,_0x374f1d,_0x2660b0){var _0xd6c266={};var _0x2942e7={};var _0x53fdbe;var _0x24fd12;return db[_0x7b56('0x2c')][_0x7b56('0x4e')]({'where':{'id':_0x311252['params']['id']}})[_0x7b56('0x27')](handleEntityNotFound(_0x374f1d,null))[_0x7b56('0x27')](function(_0x4b93ea){if(_0x4b93ea){_0x53fdbe=_0x4b93ea;_0x2942e7[_0x7b56('0x30')]=_[_0x7b56('0x32')](db[_0x7b56('0x4f')]['rawAttributes']);_0x2942e7[_0x7b56('0x33')]=_[_0x7b56('0x32')](_0x311252['query']);_0x2942e7[_0x7b56('0x34')]=_[_0x7b56('0x35')](_0x2942e7[_0x7b56('0x30')],_0x2942e7[_0x7b56('0x33')]);_0xd6c266[_0x7b56('0x36')]=_[_0x7b56('0x35')](_0x2942e7[_0x7b56('0x30')],qs[_0x7b56('0x37')](_0x311252[_0x7b56('0x33')][_0x7b56('0x37')]));_0xd6c266[_0x7b56('0x36')]=_0xd6c266[_0x7b56('0x36')][_0x7b56('0x38')]?_0xd6c266[_0x7b56('0x36')]:_0x2942e7[_0x7b56('0x30')];_0xd6c266['order']=qs[_0x7b56('0x3c')](_0x311252['query'][_0x7b56('0x3c')]);_0xd6c266[_0x7b56('0x3f')]=qs[_0x7b56('0x34')](_[_0x7b56('0x3d')](_0x311252[_0x7b56('0x33')],_0x2942e7[_0x7b56('0x34')]));if(_0x311252[_0x7b56('0x33')]['filter']){_0xd6c266[_0x7b56('0x3f')]=_[_0x7b56('0x40')](_0xd6c266[_0x7b56('0x3f')],{'$or':_['map'](_0xd6c266[_0x7b56('0x36')],function(_0xa368d6){var _0x1d159b={};_0x1d159b[_0xa368d6]={'$like':'%'+_0x311252[_0x7b56('0x33')][_0x7b56('0x3e')]+'%'};return _0x1d159b;})});}_0xd6c266=_[_0x7b56('0x40')]({},_0xd6c266,_0x311252[_0x7b56('0x42')]);return _0x53fdbe[_0x7b56('0x50')](_0xd6c266);}})[_0x7b56('0x27')](function(_0xe3e6c4){if(_0xe3e6c4){_0x24fd12=_0xe3e6c4[_0x7b56('0x38')];if(!_0x311252[_0x7b56('0x33')][_0x7b56('0x39')](_0x7b56('0x3a'))){_0xd6c266['limit']=qs[_0x7b56('0x1f')](_0x311252['query'][_0x7b56('0x1f')]);_0xd6c266[_0x7b56('0x1d')]=qs[_0x7b56('0x1d')](_0x311252[_0x7b56('0x33')][_0x7b56('0x1d')]);}return _0x53fdbe['getSubjects'](_0xd6c266);}})[_0x7b56('0x27')](function(_0x57bbc6){if(_0x57bbc6){return _0x57bbc6?{'count':_0x24fd12,'rows':_0x57bbc6}:null;}})[_0x7b56('0x27')](respondWithResult(_0x374f1d,null))['catch'](handleError(_0x374f1d,null));};exports[_0x7b56('0x51')]=function(_0x19649b,_0x2cfb2f,_0x14186b){var _0x26bb53={};var _0x54dc62={};var _0x2c780f;var _0x3a980f;return db[_0x7b56('0x2c')][_0x7b56('0x4e')]({'where':{'id':_0x19649b[_0x7b56('0x49')]['id']}})[_0x7b56('0x27')](handleEntityNotFound(_0x2cfb2f,null))[_0x7b56('0x27')](function(_0x5492e2){if(_0x5492e2){_0x2c780f=_0x5492e2;_0x54dc62[_0x7b56('0x30')]=_[_0x7b56('0x32')](db[_0x7b56('0x4f')][_0x7b56('0x2d')]);_0x54dc62[_0x7b56('0x33')]=_[_0x7b56('0x32')](_0x19649b[_0x7b56('0x33')]);_0x54dc62[_0x7b56('0x34')]=_[_0x7b56('0x35')](_0x54dc62[_0x7b56('0x30')],_0x54dc62[_0x7b56('0x33')]);_0x26bb53[_0x7b56('0x36')]=_['intersection'](_0x54dc62['model'],qs['fields'](_0x19649b[_0x7b56('0x33')][_0x7b56('0x37')]));_0x26bb53[_0x7b56('0x36')]=_0x26bb53[_0x7b56('0x36')]['length']?_0x26bb53['attributes']:_0x54dc62[_0x7b56('0x30')];_0x26bb53[_0x7b56('0x3b')]=qs[_0x7b56('0x3c')](_0x19649b[_0x7b56('0x33')]['sort']);_0x26bb53[_0x7b56('0x3f')]=qs[_0x7b56('0x34')](_[_0x7b56('0x3d')](_0x19649b[_0x7b56('0x33')],_0x54dc62[_0x7b56('0x34')]));if(_0x19649b[_0x7b56('0x33')][_0x7b56('0x3e')]){_0x26bb53[_0x7b56('0x3f')]=_['merge'](_0x26bb53[_0x7b56('0x3f')],{'$or':_['map'](_0x26bb53[_0x7b56('0x36')],function(_0x453534){var _0x2374d6={};_0x2374d6[_0x453534]={'$like':'%'+_0x19649b[_0x7b56('0x33')]['filter']+'%'};return _0x2374d6;})});}_0x26bb53=_[_0x7b56('0x40')]({},_0x26bb53,_0x19649b[_0x7b56('0x42')]);return _0x2c780f[_0x7b56('0x51')](_0x26bb53);}})[_0x7b56('0x27')](function(_0x15fc57){if(_0x15fc57){_0x3a980f=_0x15fc57[_0x7b56('0x38')];if(!_0x19649b[_0x7b56('0x33')][_0x7b56('0x39')](_0x7b56('0x3a'))){_0x26bb53[_0x7b56('0x1f')]=qs[_0x7b56('0x1f')](_0x19649b[_0x7b56('0x33')][_0x7b56('0x1f')]);_0x26bb53[_0x7b56('0x1d')]=qs[_0x7b56('0x1d')](_0x19649b['query']['offset']);}return _0x2c780f[_0x7b56('0x51')](_0x26bb53);}})[_0x7b56('0x27')](function(_0x2fdfd8){if(_0x2fdfd8){return _0x2fdfd8?{'count':_0x3a980f,'rows':_0x2fdfd8}:null;}})[_0x7b56('0x27')](respondWithResult(_0x2cfb2f,null))[_0x7b56('0x47')](handleError(_0x2cfb2f,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 3553299..9744e86 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 _0xf393=['define','ZohoConfiguration','lodash','../../config/logger','api','bluebird','path','../../config/environment','./intZohoConfiguration.attributes','exports'];(function(_0x3fc97b,_0x20ca29){var _0x3a0c82=function(_0x1c15ec){while(--_0x1c15ec){_0x3fc97b['push'](_0x3fc97b['shift']());}};_0x3a0c82(++_0x20ca29);}(_0xf393,0x1e2));var _0x3f39=function(_0x3ceabc,_0x439c75){_0x3ceabc=_0x3ceabc-0x0;var _0x1410b4=_0xf393[_0x3ceabc];return _0x1410b4;};'use strict';var _=require(_0x3f39('0x0'));var util=require('util');var logger=require(_0x3f39('0x1'))(_0x3f39('0x2'));var moment=require('moment');var BPromise=require(_0x3f39('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f39('0x4'));var rimraf=require('rimraf');var config=require(_0x3f39('0x5'));var attributes=require(_0x3f39('0x6'));module[_0x3f39('0x7')]=function(_0x4ed85f,_0x27088d){return _0x4ed85f[_0x3f39('0x8')](_0x3f39('0x9'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1077=['../../config/environment','exports','ZohoConfiguration','int_zoho_configurations','lodash','api','moment','bluebird','path','rimraf'];(function(_0x541737,_0x423e2c){var _0x1b3276=function(_0x5bfbdf){while(--_0x5bfbdf){_0x541737['push'](_0x541737['shift']());}};_0x1b3276(++_0x423e2c);}(_0x1077,0x176));var _0x7107=function(_0x28a7ee,_0x1c6dd3){_0x28a7ee=_0x28a7ee-0x0;var _0x9314a6=_0x1077[_0x28a7ee];return _0x9314a6;};'use strict';var _=require(_0x7107('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7107('0x1'));var moment=require(_0x7107('0x2'));var BPromise=require(_0x7107('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7107('0x4'));var rimraf=require(_0x7107('0x5'));var config=require(_0x7107('0x6'));var attributes=require('./intZohoConfiguration.attributes');module[_0x7107('0x7')]=function(_0x2fee11,_0x57391b){return _0x2fee11['define'](_0x7107('0x8'),attributes,{'tableName':_0x7107('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index c7d99eb..a582831 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 _0xa390=['client','http','request','then','ZohoConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','../../config/utils','rpc','../../config/environment'];(function(_0x332874,_0x48c54f){var _0x12bce7=function(_0x2286b6){while(--_0x2286b6){_0x332874['push'](_0x332874['shift']());}};_0x12bce7(++_0x48c54f);}(_0xa390,0x149));var _0x0a39=function(_0x21de7f,_0x3058cd){_0x21de7f=_0x21de7f-0x0;var _0x3ebe7a=_0xa390[_0x21de7f];return _0x3ebe7a;};'use strict';var _=require(_0x0a39('0x0'));var util=require(_0x0a39('0x1'));var moment=require(_0x0a39('0x2'));var BPromise=require('bluebird');var rs=require(_0x0a39('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0a39('0x4'));var logger=require('../../config/logger')(_0x0a39('0x5'));var config=require(_0x0a39('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0a39('0x7')][_0x0a39('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1fdd43,_0x5b0643,_0x2ca90d){return new BPromise(function(_0x4dc74c,_0x2ea8ab){return client[_0x0a39('0x9')](_0x1fdd43,_0x2ca90d)[_0x0a39('0xa')](function(_0x32a95d){logger['info'](_0x0a39('0xb'),_0x5b0643,'request\x20sent');logger[_0x0a39('0xc')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x5b0643,_0x0a39('0xd'),JSON[_0x0a39('0xe')](_0x32a95d));if(_0x32a95d[_0x0a39('0xf')]){if(_0x32a95d[_0x0a39('0xf')][_0x0a39('0x10')]===0x1f4){logger[_0x0a39('0xf')](_0x0a39('0xb'),_0x5b0643,_0x32a95d[_0x0a39('0xf')]['message']);return _0x2ea8ab(_0x32a95d[_0x0a39('0xf')][_0x0a39('0x11')]);}logger['error'](_0x0a39('0xb'),_0x5b0643,_0x32a95d['error'][_0x0a39('0x11')]);return _0x4dc74c(_0x32a95d[_0x0a39('0xf')][_0x0a39('0x11')]);}else{logger[_0x0a39('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x5b0643,_0x0a39('0xd'));_0x4dc74c(_0x32a95d[_0x0a39('0x13')][_0x0a39('0x11')]);}})[_0x0a39('0x14')](function(_0xe4bd2f){logger[_0x0a39('0xf')](_0x0a39('0xb'),_0x5b0643,_0xe4bd2f);_0x2ea8ab(_0xe4bd2f);});});} \ No newline at end of file +var _0x0c6d=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x5151eb,_0x1f5041){var _0x1cce82=function(_0x323c34){while(--_0x323c34){_0x5151eb['push'](_0x5151eb['shift']());}};_0x1cce82(++_0x1f5041);}(_0x0c6d,0x1f3));var _0xd0c6=function(_0x3cc5f5,_0x16da68){_0x3cc5f5=_0x3cc5f5-0x0;var _0x2a3932=_0x0c6d[_0x3cc5f5];return _0x2a3932;};'use strict';var _=require(_0xd0c6('0x0'));var util=require(_0xd0c6('0x1'));var moment=require(_0xd0c6('0x2'));var BPromise=require(_0xd0c6('0x3'));var rs=require(_0xd0c6('0x4'));var fs=require('fs');var Redis=require(_0xd0c6('0x5'));var db=require(_0xd0c6('0x6'))['db'];var utils=require(_0xd0c6('0x7'));var logger=require(_0xd0c6('0x8'))('rpc');var config=require(_0xd0c6('0x9'));var jayson=require(_0xd0c6('0xa'));var client=jayson[_0xd0c6('0xb')][_0xd0c6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x331fc7,_0xc8f066,_0x5be322){return new BPromise(function(_0x6babfb,_0x4ed95c){return client[_0xd0c6('0xd')](_0x331fc7,_0x5be322)[_0xd0c6('0xe')](function(_0x598bcd){logger[_0xd0c6('0xf')](_0xd0c6('0x10'),_0xc8f066,_0xd0c6('0x11'));logger[_0xd0c6('0x12')](_0xd0c6('0x13'),_0xc8f066,'request\x20sent',JSON['stringify'](_0x598bcd));if(_0x598bcd[_0xd0c6('0x14')]){if(_0x598bcd[_0xd0c6('0x14')][_0xd0c6('0x15')]===0x1f4){logger[_0xd0c6('0x14')](_0xd0c6('0x10'),_0xc8f066,_0x598bcd['error']['message']);return _0x4ed95c(_0x598bcd['error']['message']);}logger[_0xd0c6('0x14')](_0xd0c6('0x10'),_0xc8f066,_0x598bcd[_0xd0c6('0x14')][_0xd0c6('0x16')]);return _0x6babfb(_0x598bcd[_0xd0c6('0x14')][_0xd0c6('0x16')]);}else{logger[_0xd0c6('0xf')](_0xd0c6('0x10'),_0xc8f066,_0xd0c6('0x11'));_0x6babfb(_0x598bcd[_0xd0c6('0x17')][_0xd0c6('0x16')]);}})[_0xd0c6('0x18')](function(_0xdd542d){logger[_0xd0c6('0x14')](_0xd0c6('0x10'),_0xc8f066,_0xdd542d);_0x4ed95c(_0xdd542d);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index d63e222..80f34eb 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 _0xb92f=['fs-extra','../../components/auth/service','./intZohoField.controller','get','index','isAuthenticated','post','create','/:id','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0xb7c25f,_0x517318){var _0x350089=function(_0x54eadb){while(--_0x54eadb){_0xb7c25f['push'](_0xb7c25f['shift']());}};_0x350089(++_0x517318);}(_0xb92f,0x13d));var _0xfb92=function(_0x496cf6,_0x26385f){_0x496cf6=_0x496cf6-0x0;var _0x44135d=_0xb92f[_0x496cf6];return _0x44135d;};'use strict';var multer=require(_0xfb92('0x0'));var util=require(_0xfb92('0x1'));var path=require(_0xfb92('0x2'));var timeout=require(_0xfb92('0x3'));var express=require(_0xfb92('0x4'));var router=express[_0xfb92('0x5')]();var fs_extra=require(_0xfb92('0x6'));var auth=require(_0xfb92('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfb92('0x8'));router[_0xfb92('0x9')]('/',auth['isAuthenticated'](),controller[_0xfb92('0xa')]);router[_0xfb92('0x9')]('/:id',auth[_0xfb92('0xb')](),controller['show']);router[_0xfb92('0xc')]('/',auth[_0xfb92('0xb')](),controller[_0xfb92('0xd')]);router['put'](_0xfb92('0xe'),auth[_0xfb92('0xb')](),controller['update']);router[_0xfb92('0xf')](_0xfb92('0xe'),auth[_0xfb92('0xb')](),controller[_0xfb92('0x10')]);module['exports']=router; \ No newline at end of file +var _0x7e20=['post','put','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x3f7d29,_0x3a99c7){var _0x29047e=function(_0x58a3be){while(--_0x58a3be){_0x3f7d29['push'](_0x3f7d29['shift']());}};_0x29047e(++_0x3a99c7);}(_0x7e20,0x1ec));var _0x07e2=function(_0x242de2,_0x5e5933){_0x242de2=_0x242de2-0x0;var _0x2d0eee=_0x7e20[_0x242de2];return _0x2d0eee;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x07e2('0x0'));var timeout=require('connect-timeout');var express=require(_0x07e2('0x1'));var router=express[_0x07e2('0x2')]();var fs_extra=require(_0x07e2('0x3'));var auth=require(_0x07e2('0x4'));var interaction=require(_0x07e2('0x5'));var config=require(_0x07e2('0x6'));var controller=require('./intZohoField.controller');router[_0x07e2('0x7')]('/',auth[_0x07e2('0x8')](),controller[_0x07e2('0x9')]);router[_0x07e2('0x7')](_0x07e2('0xa'),auth[_0x07e2('0x8')](),controller[_0x07e2('0xb')]);router[_0x07e2('0xc')]('/',auth[_0x07e2('0x8')](),controller['create']);router[_0x07e2('0xd')](_0x07e2('0xa'),auth[_0x07e2('0x8')](),controller[_0x07e2('0xe')]);router[_0x07e2('0xf')](_0x07e2('0xa'),auth[_0x07e2('0x8')](),controller[_0x07e2('0x10')]);module[_0x07e2('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 1da1711..2f7b868 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 _0xe871=['STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist','string'];(function(_0x492bfc,_0x57e49a){var _0x44af9b=function(_0xc27587){while(--_0xc27587){_0x492bfc['push'](_0x492bfc['shift']());}};_0x44af9b(++_0x57e49a);}(_0xe871,0xde));var _0x1e87=function(_0x5d1ab7,_0x3a53d8){_0x5d1ab7=_0x5d1ab7-0x0;var _0x3d972f=_0xe871[_0x5d1ab7];return _0x3d972f;};'use strict';var Sequelize=require(_0x1e87('0x0'));module[_0x1e87('0x1')]={'type':{'type':Sequelize[_0x1e87('0x2')]('string',_0x1e87('0x3'),_0x1e87('0x4'),_0x1e87('0x5'),_0x1e87('0x6')),'defaultValue':_0x1e87('0x7')},'content':{'type':Sequelize[_0x1e87('0x8')]},'key':{'type':Sequelize[_0x1e87('0x8')]},'keyType':{'type':Sequelize[_0x1e87('0x2')]('string',_0x1e87('0x3'),_0x1e87('0x4'))},'keyContent':{'type':Sequelize[_0x1e87('0x8')]},'idField':{'type':Sequelize[_0x1e87('0x8')]},'nameField':{'type':Sequelize[_0x1e87('0x8')]},'customField':{'type':Sequelize[_0x1e87('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1e87('0x8')]}}; \ No newline at end of file +var _0x9903=['ENUM','string','variable','keyValue','picklist','STRING','customVariable','exports'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x9903,0xf7));var _0x3990=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9903[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x3990('0x0')]={'type':{'type':Sequelize[_0x3990('0x1')](_0x3990('0x2'),_0x3990('0x3'),'customVariable',_0x3990('0x4'),_0x3990('0x5')),'defaultValue':_0x3990('0x2')},'content':{'type':Sequelize[_0x3990('0x6')]},'key':{'type':Sequelize[_0x3990('0x6')]},'keyType':{'type':Sequelize[_0x3990('0x1')](_0x3990('0x2'),_0x3990('0x3'),_0x3990('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3990('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3990('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 8519cd5..ef66817 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 _0xa875=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','ZohoField','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','json','offset','limit','count','status','set','Content-Range','reject','save','then','destroy','stack','name','index','map','type','query','keys','filters','intersection','model'];(function(_0x37eecc,_0x1c0e75){var _0x4709d2=function(_0x4c83a4){while(--_0x4c83a4){_0x37eecc['push'](_0x37eecc['shift']());}};_0x4709d2(++_0x1c0e75);}(_0xa875,0x176));var _0x5a87=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xa875[_0x6cf19c];return _0xce14f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5a87('0x0'));var zipdir=require(_0x5a87('0x1'));var jsonpatch=require(_0x5a87('0x2'));var rp=require(_0x5a87('0x3'));var moment=require(_0x5a87('0x4'));var BPromise=require(_0x5a87('0x5'));var Mustache=require(_0x5a87('0x6'));var util=require(_0x5a87('0x7'));var path=require('path');var sox=require(_0x5a87('0x8'));var csv=require(_0x5a87('0x9'));var ejs=require(_0x5a87('0xa'));var fs=require('fs');var fs_extra=require(_0x5a87('0xb'));var _=require('lodash');var squel=require(_0x5a87('0xc'));var crypto=require('crypto');var jsforce=require(_0x5a87('0xd'));var deskjs=require(_0x5a87('0xe'));var toCsv=require(_0x5a87('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5a87('0xf'));var authService=require(_0x5a87('0x10'));var qs=require(_0x5a87('0x11'));var as=require(_0x5a87('0x12'));var hardwareService=require(_0x5a87('0x13'));var logger=require('../../config/logger')(_0x5a87('0x14'));var utils=require(_0x5a87('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5a87('0x16'))['db'];function respondWithStatusCode(_0x336eb9,_0x7cbdbc){_0x7cbdbc=_0x7cbdbc||0xcc;return function(_0x549d9f){if(_0x549d9f){return _0x336eb9[_0x5a87('0x17')](_0x7cbdbc);}return _0x336eb9['status'](_0x7cbdbc)[_0x5a87('0x18')]();};}function respondWithResult(_0x185c4a,_0x4f34a5){_0x4f34a5=_0x4f34a5||0xc8;return function(_0x213005){if(_0x213005){return _0x185c4a['status'](_0x4f34a5)[_0x5a87('0x19')](_0x213005);}};}function respondWithFilteredResult(_0x1d1b66,_0x1b2cf3){return function(_0x3f0ff3){if(_0x3f0ff3){var _0x31f8f9=typeof _0x1b2cf3[_0x5a87('0x1a')]==='undefined'&&typeof _0x1b2cf3[_0x5a87('0x1b')]==='undefined';var _0x181667=_0x3f0ff3[_0x5a87('0x1c')];var _0x1c1b92=_0x31f8f9?0x0:_0x1b2cf3[_0x5a87('0x1a')];var _0x166038=_0x31f8f9?_0x3f0ff3[_0x5a87('0x1c')]:_0x1b2cf3[_0x5a87('0x1a')]+_0x1b2cf3[_0x5a87('0x1b')];var _0x32be01;if(_0x166038>=_0x181667){_0x166038=_0x181667;_0x32be01=0xc8;}else{_0x32be01=0xce;}_0x1d1b66[_0x5a87('0x1d')](_0x32be01);return _0x1d1b66[_0x5a87('0x1e')](_0x5a87('0x1f'),_0x1c1b92+'-'+_0x166038+'/'+_0x181667)[_0x5a87('0x19')](_0x3f0ff3);}return null;};}function patchUpdates(_0x297e8c){return function(_0x2aab30){try{jsonpatch['apply'](_0x2aab30,_0x297e8c,!![]);}catch(_0x3e05d3){return BPromise[_0x5a87('0x20')](_0x3e05d3);}return _0x2aab30[_0x5a87('0x21')]();};}function saveUpdates(_0x7d29c8,_0x1020d4){return function(_0x4cdb57){if(_0x4cdb57){return _0x4cdb57['update'](_0x7d29c8)[_0x5a87('0x22')](function(_0xa5a2c2){return _0xa5a2c2;});}return null;};}function removeEntity(_0x148214,_0x46891b){return function(_0x1f0b42){if(_0x1f0b42){return _0x1f0b42[_0x5a87('0x23')]()[_0x5a87('0x22')](function(){_0x148214[_0x5a87('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b2e18,_0x36f255){return function(_0x39ef3f){if(!_0x39ef3f){_0x4b2e18[_0x5a87('0x17')](0x194);}return _0x39ef3f;};}function handleError(_0x112280,_0x58ee72){_0x58ee72=_0x58ee72||0x1f4;return function(_0xe75508){logger['error'](_0xe75508[_0x5a87('0x24')]);if(_0xe75508[_0x5a87('0x25')]){delete _0xe75508['name'];}_0x112280['status'](_0x58ee72)['send'](_0xe75508);};}exports[_0x5a87('0x26')]=function(_0x1ff9a9,_0x1bdd52){var _0x3486ee={},_0x31ef5d={},_0x3b66f9={'count':0x0,'rows':[]};var _0x213ad0=_[_0x5a87('0x27')](db['ZohoField']['rawAttributes'],function(_0x12fb87){return{'name':_0x12fb87['fieldName'],'type':_0x12fb87[_0x5a87('0x28')]['key']};});_0x31ef5d['model']=_['map'](_0x213ad0,_0x5a87('0x25'));_0x31ef5d[_0x5a87('0x29')]=_[_0x5a87('0x2a')](_0x1ff9a9[_0x5a87('0x29')]);_0x31ef5d[_0x5a87('0x2b')]=_[_0x5a87('0x2c')](_0x31ef5d[_0x5a87('0x2d')],_0x31ef5d['query']);_0x3486ee[_0x5a87('0x2e')]=_[_0x5a87('0x2c')](_0x31ef5d['model'],qs['fields'](_0x1ff9a9[_0x5a87('0x29')][_0x5a87('0x2f')]));_0x3486ee[_0x5a87('0x2e')]=_0x3486ee[_0x5a87('0x2e')][_0x5a87('0x30')]?_0x3486ee[_0x5a87('0x2e')]:_0x31ef5d['model'];if(!_0x1ff9a9['query'][_0x5a87('0x31')](_0x5a87('0x32'))){_0x3486ee[_0x5a87('0x1b')]=qs['limit'](_0x1ff9a9[_0x5a87('0x29')][_0x5a87('0x1b')]);_0x3486ee[_0x5a87('0x1a')]=qs[_0x5a87('0x1a')](_0x1ff9a9[_0x5a87('0x29')]['offset']);}_0x3486ee[_0x5a87('0x33')]=qs[_0x5a87('0x34')](_0x1ff9a9['query'][_0x5a87('0x34')]);_0x3486ee[_0x5a87('0x35')]=qs[_0x5a87('0x2b')](_['pick'](_0x1ff9a9[_0x5a87('0x29')],_0x31ef5d[_0x5a87('0x2b')]),_0x213ad0);if(_0x1ff9a9['query'][_0x5a87('0x36')]){_0x3486ee['where']=_[_0x5a87('0x37')](_0x3486ee['where'],{'$or':_[_0x5a87('0x27')](_0x213ad0,function(_0x2d7377){if(_0x2d7377[_0x5a87('0x28')]!==_0x5a87('0x38')){var _0x1d976d={};_0x1d976d[_0x2d7377[_0x5a87('0x25')]]={'$like':'%'+_0x1ff9a9['query'][_0x5a87('0x36')]+'%'};return _0x1d976d;}})});}_0x3486ee=_[_0x5a87('0x37')]({},_0x3486ee,_0x1ff9a9['options']);var _0x3f0c08={'where':_0x3486ee[_0x5a87('0x35')]};return db[_0x5a87('0x39')][_0x5a87('0x1c')](_0x3f0c08)['then'](function(_0x2af04b){_0x3b66f9[_0x5a87('0x1c')]=_0x2af04b;if(_0x1ff9a9['query'][_0x5a87('0x3a')]){_0x3486ee[_0x5a87('0x3b')]=[{'all':!![]}];}return db[_0x5a87('0x39')][_0x5a87('0x3c')](_0x3486ee);})[_0x5a87('0x22')](function(_0x5d6bd9){_0x3b66f9[_0x5a87('0x3d')]=_0x5d6bd9;return _0x3b66f9;})[_0x5a87('0x22')](respondWithFilteredResult(_0x1bdd52,_0x3486ee))[_0x5a87('0x3e')](handleError(_0x1bdd52,null));};exports['show']=function(_0x24a0e1,_0x2f908b){var _0x2d7e44={'raw':!![],'where':{'id':_0x24a0e1[_0x5a87('0x3f')]['id']}},_0x112119={};_0x112119[_0x5a87('0x2d')]=_[_0x5a87('0x2a')](db[_0x5a87('0x39')][_0x5a87('0x40')]);_0x112119[_0x5a87('0x29')]=_['keys'](_0x24a0e1[_0x5a87('0x29')]);_0x112119['filters']=_[_0x5a87('0x2c')](_0x112119[_0x5a87('0x2d')],_0x112119[_0x5a87('0x29')]);_0x2d7e44['attributes']=_['intersection'](_0x112119[_0x5a87('0x2d')],qs[_0x5a87('0x2f')](_0x24a0e1[_0x5a87('0x29')][_0x5a87('0x2f')]));_0x2d7e44[_0x5a87('0x2e')]=_0x2d7e44['attributes'][_0x5a87('0x30')]?_0x2d7e44[_0x5a87('0x2e')]:_0x112119['model'];if(_0x24a0e1['query']['includeAll']){_0x2d7e44['include']=[{'all':!![]}];}_0x2d7e44=_['merge']({},_0x2d7e44,_0x24a0e1[_0x5a87('0x41')]);return db['ZohoField'][_0x5a87('0x42')](_0x2d7e44)[_0x5a87('0x22')](handleEntityNotFound(_0x2f908b,null))[_0x5a87('0x22')](respondWithResult(_0x2f908b,null))[_0x5a87('0x3e')](handleError(_0x2f908b,null));};exports[_0x5a87('0x43')]=function(_0x558f4e,_0x51e2b7){return db[_0x5a87('0x39')][_0x5a87('0x43')](_0x558f4e[_0x5a87('0x44')],{})['then'](respondWithResult(_0x51e2b7,0xc9))[_0x5a87('0x3e')](handleError(_0x51e2b7,null));};exports[_0x5a87('0x45')]=function(_0x20b918,_0x194127){if(_0x20b918[_0x5a87('0x44')]['id']){delete _0x20b918[_0x5a87('0x44')]['id'];}return db[_0x5a87('0x39')][_0x5a87('0x42')]({'where':{'id':_0x20b918[_0x5a87('0x3f')]['id']}})[_0x5a87('0x22')](handleEntityNotFound(_0x194127,null))[_0x5a87('0x22')](saveUpdates(_0x20b918['body'],null))[_0x5a87('0x22')](respondWithResult(_0x194127,null))[_0x5a87('0x3e')](handleError(_0x194127,null));};exports['destroy']=function(_0x3514af,_0x5374a2){return db['ZohoField']['find']({'where':{'id':_0x3514af[_0x5a87('0x3f')]['id']}})[_0x5a87('0x22')](handleEntityNotFound(_0x5374a2,null))[_0x5a87('0x22')](removeEntity(_0x5374a2,null))[_0x5a87('0x3e')](handleError(_0x5374a2,null));}; \ No newline at end of file +var _0x1403=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','save','update','destroy','then','error','stack','name','send','map','ZohoField','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','catch','show','params','options','find','create','body','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra'];(function(_0x497d39,_0x2fef30){var _0x4a9d8f=function(_0x98eaa4){while(--_0x98eaa4){_0x497d39['push'](_0x497d39['shift']());}};_0x4a9d8f(++_0x2fef30);}(_0x1403,0xcb));var _0x3140=function(_0x24682f,_0x30b2d0){_0x24682f=_0x24682f-0x0;var _0x413f07=_0x1403[_0x24682f];return _0x413f07;};'use strict';var emlformat=require(_0x3140('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3140('0x1'));var jsonpatch=require(_0x3140('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3140('0x3'));var Mustache=require(_0x3140('0x4'));var util=require(_0x3140('0x5'));var path=require(_0x3140('0x6'));var sox=require('sox');var csv=require(_0x3140('0x7'));var ejs=require(_0x3140('0x8'));var fs=require('fs');var fs_extra=require(_0x3140('0x9'));var _=require(_0x3140('0xa'));var squel=require(_0x3140('0xb'));var crypto=require(_0x3140('0xc'));var jsforce=require(_0x3140('0xd'));var deskjs=require(_0x3140('0xe'));var toCsv=require(_0x3140('0x7'));var querystring=require(_0x3140('0xf'));var Papa=require(_0x3140('0x10'));var Redis=require('ioredis');var authService=require(_0x3140('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3140('0x12'));var logger=require(_0x3140('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x3140('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x3140('0x15'))['db'];function respondWithStatusCode(_0x14394e,_0x54d976){_0x54d976=_0x54d976||0xcc;return function(_0x3ebcad){if(_0x3ebcad){return _0x14394e[_0x3140('0x16')](_0x54d976);}return _0x14394e['status'](_0x54d976)[_0x3140('0x17')]();};}function respondWithResult(_0x53c5bc,_0x1ae863){_0x1ae863=_0x1ae863||0xc8;return function(_0x8d0a42){if(_0x8d0a42){return _0x53c5bc[_0x3140('0x18')](_0x1ae863)[_0x3140('0x19')](_0x8d0a42);}};}function respondWithFilteredResult(_0x2c568,_0x4d595f){return function(_0x5ce508){if(_0x5ce508){var _0x3b2f07=typeof _0x4d595f[_0x3140('0x1a')]===_0x3140('0x1b')&&typeof _0x4d595f['limit']==='undefined';var _0xad1f72=_0x5ce508[_0x3140('0x1c')];var _0x207a74=_0x3b2f07?0x0:_0x4d595f[_0x3140('0x1a')];var _0x2af2bd=_0x3b2f07?_0x5ce508['count']:_0x4d595f[_0x3140('0x1a')]+_0x4d595f[_0x3140('0x1d')];var _0x40435e;if(_0x2af2bd>=_0xad1f72){_0x2af2bd=_0xad1f72;_0x40435e=0xc8;}else{_0x40435e=0xce;}_0x2c568['status'](_0x40435e);return _0x2c568[_0x3140('0x1e')](_0x3140('0x1f'),_0x207a74+'-'+_0x2af2bd+'/'+_0xad1f72)['json'](_0x5ce508);}return null;};}function patchUpdates(_0x125a5d){return function(_0x5491f0){try{jsonpatch['apply'](_0x5491f0,_0x125a5d,!![]);}catch(_0x40053e){return BPromise['reject'](_0x40053e);}return _0x5491f0[_0x3140('0x20')]();};}function saveUpdates(_0x3992cf,_0xa57576){return function(_0x50ce69){if(_0x50ce69){return _0x50ce69[_0x3140('0x21')](_0x3992cf)['then'](function(_0x267de1){return _0x267de1;});}return null;};}function removeEntity(_0xc8f5f4,_0x1f0012){return function(_0x4ad039){if(_0x4ad039){return _0x4ad039[_0x3140('0x22')]()[_0x3140('0x23')](function(){_0xc8f5f4[_0x3140('0x18')](0xcc)[_0x3140('0x17')]();});}};}function handleEntityNotFound(_0x26cb32,_0xedaa59){return function(_0x5a8673){if(!_0x5a8673){_0x26cb32[_0x3140('0x16')](0x194);}return _0x5a8673;};}function handleError(_0x97a50b,_0x2443d8){_0x2443d8=_0x2443d8||0x1f4;return function(_0x6de314){logger[_0x3140('0x24')](_0x6de314[_0x3140('0x25')]);if(_0x6de314[_0x3140('0x26')]){delete _0x6de314[_0x3140('0x26')];}_0x97a50b[_0x3140('0x18')](_0x2443d8)[_0x3140('0x27')](_0x6de314);};}exports['index']=function(_0x4f8c40,_0x4d1e95){var _0x363724={},_0x75f177={},_0x16c23c={'count':0x0,'rows':[]};var _0x2aef83=_[_0x3140('0x28')](db[_0x3140('0x29')][_0x3140('0x2a')],function(_0xfe8187){return{'name':_0xfe8187[_0x3140('0x2b')],'type':_0xfe8187[_0x3140('0x2c')][_0x3140('0x2d')]};});_0x75f177['model']=_[_0x3140('0x28')](_0x2aef83,_0x3140('0x26'));_0x75f177['query']=_[_0x3140('0x2e')](_0x4f8c40[_0x3140('0x2f')]);_0x75f177[_0x3140('0x30')]=_[_0x3140('0x31')](_0x75f177['model'],_0x75f177['query']);_0x363724[_0x3140('0x32')]=_[_0x3140('0x31')](_0x75f177[_0x3140('0x33')],qs['fields'](_0x4f8c40[_0x3140('0x2f')][_0x3140('0x34')]));_0x363724[_0x3140('0x32')]=_0x363724['attributes']['length']?_0x363724['attributes']:_0x75f177['model'];if(!_0x4f8c40['query'][_0x3140('0x35')](_0x3140('0x36'))){_0x363724[_0x3140('0x1d')]=qs[_0x3140('0x1d')](_0x4f8c40[_0x3140('0x2f')][_0x3140('0x1d')]);_0x363724[_0x3140('0x1a')]=qs[_0x3140('0x1a')](_0x4f8c40[_0x3140('0x2f')][_0x3140('0x1a')]);}_0x363724[_0x3140('0x37')]=qs[_0x3140('0x38')](_0x4f8c40['query'][_0x3140('0x38')]);_0x363724[_0x3140('0x39')]=qs[_0x3140('0x30')](_[_0x3140('0x3a')](_0x4f8c40['query'],_0x75f177['filters']),_0x2aef83);if(_0x4f8c40[_0x3140('0x2f')][_0x3140('0x3b')]){_0x363724[_0x3140('0x39')]=_[_0x3140('0x3c')](_0x363724[_0x3140('0x39')],{'$or':_[_0x3140('0x28')](_0x2aef83,function(_0x4b0eab){if(_0x4b0eab[_0x3140('0x2c')]!=='VIRTUAL'){var _0xde24b3={};_0xde24b3[_0x4b0eab[_0x3140('0x26')]]={'$like':'%'+_0x4f8c40[_0x3140('0x2f')][_0x3140('0x3b')]+'%'};return _0xde24b3;}})});}_0x363724=_[_0x3140('0x3c')]({},_0x363724,_0x4f8c40['options']);var _0x30d5c1={'where':_0x363724['where']};return db['ZohoField']['count'](_0x30d5c1)[_0x3140('0x23')](function(_0x4b0f0b){_0x16c23c[_0x3140('0x1c')]=_0x4b0f0b;if(_0x4f8c40[_0x3140('0x2f')][_0x3140('0x3d')]){_0x363724[_0x3140('0x3e')]=[{'all':!![]}];}return db[_0x3140('0x29')][_0x3140('0x3f')](_0x363724);})['then'](function(_0x75e37c){_0x16c23c['rows']=_0x75e37c;return _0x16c23c;})[_0x3140('0x23')](respondWithFilteredResult(_0x4d1e95,_0x363724))[_0x3140('0x40')](handleError(_0x4d1e95,null));};exports[_0x3140('0x41')]=function(_0x2019b4,_0x33fb39){var _0x13cfe8={'raw':!![],'where':{'id':_0x2019b4[_0x3140('0x42')]['id']}},_0x4cd778={};_0x4cd778[_0x3140('0x33')]=_[_0x3140('0x2e')](db[_0x3140('0x29')][_0x3140('0x2a')]);_0x4cd778[_0x3140('0x2f')]=_['keys'](_0x2019b4[_0x3140('0x2f')]);_0x4cd778[_0x3140('0x30')]=_[_0x3140('0x31')](_0x4cd778[_0x3140('0x33')],_0x4cd778[_0x3140('0x2f')]);_0x13cfe8[_0x3140('0x32')]=_[_0x3140('0x31')](_0x4cd778[_0x3140('0x33')],qs[_0x3140('0x34')](_0x2019b4['query'][_0x3140('0x34')]));_0x13cfe8['attributes']=_0x13cfe8[_0x3140('0x32')]['length']?_0x13cfe8[_0x3140('0x32')]:_0x4cd778[_0x3140('0x33')];if(_0x2019b4[_0x3140('0x2f')][_0x3140('0x3d')]){_0x13cfe8[_0x3140('0x3e')]=[{'all':!![]}];}_0x13cfe8=_[_0x3140('0x3c')]({},_0x13cfe8,_0x2019b4[_0x3140('0x43')]);return db[_0x3140('0x29')][_0x3140('0x44')](_0x13cfe8)[_0x3140('0x23')](handleEntityNotFound(_0x33fb39,null))[_0x3140('0x23')](respondWithResult(_0x33fb39,null))[_0x3140('0x40')](handleError(_0x33fb39,null));};exports[_0x3140('0x45')]=function(_0x1a14a5,_0x577d2e){return db[_0x3140('0x29')][_0x3140('0x45')](_0x1a14a5['body'],{})[_0x3140('0x23')](respondWithResult(_0x577d2e,0xc9))['catch'](handleError(_0x577d2e,null));};exports[_0x3140('0x21')]=function(_0x471ae4,_0x39a01d){if(_0x471ae4['body']['id']){delete _0x471ae4[_0x3140('0x46')]['id'];}return db['ZohoField'][_0x3140('0x44')]({'where':{'id':_0x471ae4[_0x3140('0x42')]['id']}})[_0x3140('0x23')](handleEntityNotFound(_0x39a01d,null))[_0x3140('0x23')](saveUpdates(_0x471ae4[_0x3140('0x46')],null))['then'](respondWithResult(_0x39a01d,null))[_0x3140('0x40')](handleError(_0x39a01d,null));};exports[_0x3140('0x22')]=function(_0x136785,_0x373c80){return db[_0x3140('0x29')][_0x3140('0x44')]({'where':{'id':_0x136785[_0x3140('0x42')]['id']}})[_0x3140('0x23')](handleEntityNotFound(_0x373c80,null))[_0x3140('0x23')](removeEntity(_0x373c80,null))[_0x3140('0x40')](handleError(_0x373c80,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 3f4f6e6..52ff722 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 _0x25e7=['ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1c586b,_0x21f924){var _0x81f627=function(_0x37e936){while(--_0x37e936){_0x1c586b['push'](_0x1c586b['shift']());}};_0x81f627(++_0x21f924);}(_0x25e7,0x1d6));var _0x725e=function(_0x54e631,_0x3b8396){_0x54e631=_0x54e631-0x0;var _0x3c6b6a=_0x25e7[_0x54e631];return _0x3c6b6a;};'use strict';var _=require(_0x725e('0x0'));var util=require(_0x725e('0x1'));var logger=require(_0x725e('0x2'))(_0x725e('0x3'));var moment=require(_0x725e('0x4'));var BPromise=require(_0x725e('0x5'));var rp=require(_0x725e('0x6'));var fs=require('fs');var path=require(_0x725e('0x7'));var rimraf=require(_0x725e('0x8'));var config=require(_0x725e('0x9'));var attributes=require('./intZohoField.attributes');module['exports']=function(_0x2497a5,_0x480945){return _0x2497a5['define'](_0x725e('0xa'),attributes,{'tableName':_0x725e('0xb'),'paranoid':![],'indexes':[{'name':_0x725e('0xc'),'fields':[_0x725e('0xd'),_0x725e('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2a07=['api','moment','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x57fbc8,_0x5f1746){var _0xfcf1de=function(_0x368e6e){while(--_0x368e6e){_0x57fbc8['push'](_0x57fbc8['shift']());}};_0xfcf1de(++_0x5f1746);}(_0x2a07,0x74));var _0x72a0=function(_0x2c0312,_0x2be972){_0x2c0312=_0x2c0312-0x0;var _0x46222d=_0x2a07[_0x2c0312];return _0x46222d;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var logger=require(_0x72a0('0x2'))(_0x72a0('0x3'));var moment=require(_0x72a0('0x4'));var BPromise=require('bluebird');var rp=require(_0x72a0('0x5'));var fs=require('fs');var path=require(_0x72a0('0x6'));var rimraf=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var attributes=require(_0x72a0('0x9'));module[_0x72a0('0xa')]=function(_0x3ccf6d,_0x20dab9){return _0x3ccf6d[_0x72a0('0xb')](_0x72a0('0xc'),attributes,{'tableName':_0x72a0('0xd'),'paranoid':![],'indexes':[{'name':_0x72a0('0xe'),'fields':[_0x72a0('0xf'),_0x72a0('0x10')],'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 109af07..819a567 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 _0x7704=['../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7704,0x18c));var _0x4770=function(_0x5edb59,_0x47ce88){_0x5edb59=_0x5edb59-0x0;var _0x1aeac2=_0x7704[_0x5edb59];return _0x1aeac2;};'use strict';var _=require(_0x4770('0x0'));var util=require('util');var moment=require(_0x4770('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4770('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4770('0x3'));var logger=require('../../config/logger')(_0x4770('0x4'));var config=require(_0x4770('0x5'));var jayson=require(_0x4770('0x6'));var client=jayson[_0x4770('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x153d59,_0x5cb4ff,_0x37b72e){return new BPromise(function(_0x2dc6c7,_0x253ee){return client[_0x4770('0x8')](_0x153d59,_0x37b72e)[_0x4770('0x9')](function(_0x54e8b0){logger[_0x4770('0xa')](_0x4770('0xb'),_0x5cb4ff,_0x4770('0xc'));logger[_0x4770('0xd')](_0x4770('0xe'),_0x5cb4ff,_0x4770('0xc'),JSON[_0x4770('0xf')](_0x54e8b0));if(_0x54e8b0[_0x4770('0x10')]){if(_0x54e8b0[_0x4770('0x10')][_0x4770('0x11')]===0x1f4){logger[_0x4770('0x10')](_0x4770('0xb'),_0x5cb4ff,_0x54e8b0[_0x4770('0x10')]['message']);return _0x253ee(_0x54e8b0['error']['message']);}logger['error'](_0x4770('0xb'),_0x5cb4ff,_0x54e8b0[_0x4770('0x10')]['message']);return _0x2dc6c7(_0x54e8b0[_0x4770('0x10')][_0x4770('0x12')]);}else{logger[_0x4770('0xa')](_0x4770('0xb'),_0x5cb4ff,'request\x20sent');_0x2dc6c7(_0x54e8b0['result']['message']);}})['catch'](function(_0x2af29f){logger['error'](_0x4770('0xb'),_0x5cb4ff,_0x2af29f);_0x253ee(_0x2af29f);});});} \ No newline at end of file +var _0xcc76=['error','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcc76,0xea));var _0x6cc7=function(_0x4764b8,_0xec22f5){_0x4764b8=_0x4764b8-0x0;var _0x2f8329=_0xcc76[_0x4764b8];return _0x2f8329;};'use strict';var _=require(_0x6cc7('0x0'));var util=require(_0x6cc7('0x1'));var moment=require('moment');var BPromise=require(_0x6cc7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6cc7('0x3'));var db=require(_0x6cc7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6cc7('0x5'))(_0x6cc7('0x6'));var config=require(_0x6cc7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6cc7('0x8')][_0x6cc7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14c305,_0x48f61a,_0x28a642){return new BPromise(function(_0x409360,_0x44dc86){return client[_0x6cc7('0xa')](_0x14c305,_0x28a642)[_0x6cc7('0xb')](function(_0x407f58){logger[_0x6cc7('0xc')](_0x6cc7('0xd'),_0x48f61a,_0x6cc7('0xe'));logger[_0x6cc7('0xf')](_0x6cc7('0x10'),_0x48f61a,'request\x20sent',JSON[_0x6cc7('0x11')](_0x407f58));if(_0x407f58['error']){if(_0x407f58[_0x6cc7('0x12')]['code']===0x1f4){logger['error'](_0x6cc7('0xd'),_0x48f61a,_0x407f58[_0x6cc7('0x12')][_0x6cc7('0x13')]);return _0x44dc86(_0x407f58['error'][_0x6cc7('0x13')]);}logger[_0x6cc7('0x12')](_0x6cc7('0xd'),_0x48f61a,_0x407f58[_0x6cc7('0x12')]['message']);return _0x409360(_0x407f58['error'][_0x6cc7('0x13')]);}else{logger['info'](_0x6cc7('0xd'),_0x48f61a,_0x6cc7('0xe'));_0x409360(_0x407f58[_0x6cc7('0x14')][_0x6cc7('0x13')]);}})['catch'](function(_0x41f153){logger['error'](_0x6cc7('0xd'),_0x48f61a,_0x41f153);_0x44dc86(_0x41f153);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index f39d7d5..b4839d3 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(_0x3de6ef,_0xd63e08){var _0x55c1ee=function(_0x35c4ea){while(--_0x35c4ea){_0x3de6ef['push'](_0x3de6ef['shift']());}};_0x55c1ee(++_0xd63e08);}(_0xe706,0xa3));var _0x6e70=function(_0x34ae7d,_0x359c6f){_0x34ae7d=_0x34ae7d-0x0;var _0x5d4f3d=_0xe706[_0x34ae7d];return _0x5d4f3d;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2de4e6,_0x2dbab4){var _0x156984=function(_0x3c17c4){while(--_0x3c17c4){_0x2de4e6['push'](_0x2de4e6['shift']());}};_0x156984(++_0x2dbab4);}(_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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 21af7d6..13f9fed 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 _0x0fea=['app.js','BOOLEAN','sequelize','exports','STRING','unique_name_and_version'];(function(_0x32639a,_0x3babb6){var _0x8e3fad=function(_0xe4f502){while(--_0xe4f502){_0x32639a['push'](_0x32639a['shift']());}};_0x8e3fad(++_0x3babb6);}(_0x0fea,0x80));var _0xa0fe=function(_0x2453d0,_0x1b2017){_0x2453d0=_0x2453d0-0x0;var _0x521fc8=_0x0fea[_0x2453d0];return _0x521fc8;};'use strict';var Sequelize=require(_0xa0fe('0x0'));module[_0xa0fe('0x1')]={'name':{'type':Sequelize[_0xa0fe('0x2')],'allowNull':![],'unique':_0xa0fe('0x3')},'version':{'type':Sequelize[_0xa0fe('0x2')],'allowNull':![],'unique':_0xa0fe('0x3')},'main':{'type':Sequelize[_0xa0fe('0x2')],'defaultValue':_0xa0fe('0x4')},'filename':{'type':Sequelize[_0xa0fe('0x2')]},'path':{'type':Sequelize[_0xa0fe('0x2')]},'type':{'type':Sequelize[_0xa0fe('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xa0fe('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xa0fe('0x2')]},'logo':{'type':Sequelize[_0xa0fe('0x2')]},'state':{'type':Sequelize[_0xa0fe('0x2')],'unique':'state'},'description':{'type':Sequelize[_0xa0fe('0x2')]},'title':{'type':Sequelize[_0xa0fe('0x2')]},'remoteUri':{'type':Sequelize[_0xa0fe('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0xf87a=['sequelize','exports','STRING','app.js','INTEGER','BOOLEAN','state'];(function(_0x4c0644,_0x413ff3){var _0x1a6fec=function(_0x570e8){while(--_0x570e8){_0x4c0644['push'](_0x4c0644['shift']());}};_0x1a6fec(++_0x413ff3);}(_0xf87a,0x103));var _0xaf87=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xf87a[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0xaf87('0x0'));module[_0xaf87('0x1')]={'name':{'type':Sequelize[_0xaf87('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xaf87('0x2')],'defaultValue':_0xaf87('0x3')},'filename':{'type':Sequelize[_0xaf87('0x2')]},'path':{'type':Sequelize[_0xaf87('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0xaf87('0x4')]},'active':{'type':Sequelize[_0xaf87('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xaf87('0x2')]},'logo':{'type':Sequelize[_0xaf87('0x2')]},'state':{'type':Sequelize[_0xaf87('0x2')],'unique':_0xaf87('0x6')},'description':{'type':Sequelize[_0xaf87('0x2')]},'title':{'type':Sequelize[_0xaf87('0x2')]},'remoteUri':{'type':Sequelize[_0xaf87('0x2')]},'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 7c4098e..43b6956 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 _0x9582=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','offset','count','set','json','reject','save','update','then','destroy','error','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format'];(function(_0x34232c,_0x18e61d){var _0x4d4f4e=function(_0x1aeb3d){while(--_0x1aeb3d){_0x34232c['push'](_0x34232c['shift']());}};_0x4d4f4e(++_0x18e61d);}(_0x9582,0x95));var _0x2958=function(_0x3a2b91,_0x4e2d1e){_0x3a2b91=_0x3a2b91-0x0;var _0x169f33=_0x9582[_0x3a2b91];return _0x169f33;};'use strict';var emlformat=require(_0x2958('0x0'));var rimraf=require(_0x2958('0x1'));var zipdir=require(_0x2958('0x2'));var jsonpatch=require(_0x2958('0x3'));var rp=require(_0x2958('0x4'));var moment=require(_0x2958('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2958('0x6'));var util=require(_0x2958('0x7'));var path=require(_0x2958('0x8'));var sox=require(_0x2958('0x9'));var csv=require(_0x2958('0xa'));var ejs=require(_0x2958('0xb'));var fs=require('fs');var fs_extra=require(_0x2958('0xc'));var _=require(_0x2958('0xd'));var squel=require(_0x2958('0xe'));var crypto=require(_0x2958('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2958('0xa'));var querystring=require('querystring');var Papa=require(_0x2958('0x10'));var Redis=require('ioredis');var authService=require(_0x2958('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2958('0x12'));var hardwareService=require(_0x2958('0x13'));var logger=require(_0x2958('0x14'))(_0x2958('0x15'));var utils=require(_0x2958('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2958('0x17'));var db=require(_0x2958('0x18'))['db'];function respondWithStatusCode(_0x33a13a,_0x20e06a){_0x20e06a=_0x20e06a||0xcc;return function(_0x47067d){if(_0x47067d){return _0x33a13a[_0x2958('0x19')](_0x20e06a);}return _0x33a13a[_0x2958('0x1a')](_0x20e06a)[_0x2958('0x1b')]();};}function respondWithResult(_0x5bd520,_0x42e976){_0x42e976=_0x42e976||0xc8;return function(_0x2e12d4){if(_0x2e12d4){return _0x5bd520['status'](_0x42e976)['json'](_0x2e12d4);}};}function respondWithFilteredResult(_0x21ed6c,_0x38e724){return function(_0x5f06b1){if(_0x5f06b1){var _0x3bef50=typeof _0x38e724['offset']==='undefined'&&typeof _0x38e724[_0x2958('0x1c')]===_0x2958('0x1d');var _0x55e261=_0x5f06b1['count'];var _0x28a92c=_0x3bef50?0x0:_0x38e724[_0x2958('0x1e')];var _0x310d07=_0x3bef50?_0x5f06b1[_0x2958('0x1f')]:_0x38e724[_0x2958('0x1e')]+_0x38e724['limit'];var _0x19a614;if(_0x310d07>=_0x55e261){_0x310d07=_0x55e261;_0x19a614=0xc8;}else{_0x19a614=0xce;}_0x21ed6c[_0x2958('0x1a')](_0x19a614);return _0x21ed6c[_0x2958('0x20')]('Content-Range',_0x28a92c+'-'+_0x310d07+'/'+_0x55e261)[_0x2958('0x21')](_0x5f06b1);}return null;};}function patchUpdates(_0x53b100){return function(_0x1da684){try{jsonpatch['apply'](_0x1da684,_0x53b100,!![]);}catch(_0x5eaf36){return BPromise[_0x2958('0x22')](_0x5eaf36);}return _0x1da684[_0x2958('0x23')]();};}function saveUpdates(_0x2a02a4,_0x26c5a5){return function(_0x2202f8){if(_0x2202f8){return _0x2202f8[_0x2958('0x24')](_0x2a02a4)[_0x2958('0x25')](function(_0x2b9818){return _0x2b9818;});}return null;};}function removeEntity(_0x330763,_0x2aa514){return function(_0xaf5547){if(_0xaf5547){return _0xaf5547[_0x2958('0x26')]()[_0x2958('0x25')](function(){_0x330763[_0x2958('0x1a')](0xcc)[_0x2958('0x1b')]();});}};}function handleEntityNotFound(_0x4f811a,_0x574df5){return function(_0x3c1155){if(!_0x3c1155){_0x4f811a[_0x2958('0x19')](0x194);}return _0x3c1155;};}function handleError(_0x28c1f5,_0x43cf73){_0x43cf73=_0x43cf73||0x1f4;return function(_0x52bd32){logger[_0x2958('0x27')](_0x52bd32['stack']);if(_0x52bd32[_0x2958('0x28')]){delete _0x52bd32[_0x2958('0x28')];}_0x28c1f5[_0x2958('0x1a')](_0x43cf73)[_0x2958('0x29')](_0x52bd32);};}exports[_0x2958('0x2a')]=function(_0x36e2a5,_0x153958){var _0x5d1dfc={},_0x21b919={},_0x5053d0={'count':0x0,'rows':[]};var _0x48650d=_[_0x2958('0x2b')](db[_0x2958('0x2c')][_0x2958('0x2d')],function(_0x34e56e){return{'name':_0x34e56e[_0x2958('0x2e')],'type':_0x34e56e[_0x2958('0x2f')][_0x2958('0x30')]};});_0x21b919[_0x2958('0x31')]=_['map'](_0x48650d,_0x2958('0x28'));_0x21b919[_0x2958('0x32')]=_['keys'](_0x36e2a5[_0x2958('0x32')]);_0x21b919['filters']=_[_0x2958('0x33')](_0x21b919['model'],_0x21b919[_0x2958('0x32')]);_0x5d1dfc['attributes']=_[_0x2958('0x33')](_0x21b919[_0x2958('0x31')],qs[_0x2958('0x34')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x34')]));_0x5d1dfc[_0x2958('0x35')]=_0x5d1dfc[_0x2958('0x35')][_0x2958('0x36')]?_0x5d1dfc[_0x2958('0x35')]:_0x21b919['model'];if(!_0x36e2a5[_0x2958('0x32')]['hasOwnProperty'](_0x2958('0x37'))){_0x5d1dfc['limit']=qs[_0x2958('0x1c')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x1c')]);_0x5d1dfc[_0x2958('0x1e')]=qs[_0x2958('0x1e')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x1e')]);}_0x5d1dfc[_0x2958('0x38')]=qs[_0x2958('0x39')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x39')]);_0x5d1dfc[_0x2958('0x3a')]=qs[_0x2958('0x3b')](_['pick'](_0x36e2a5[_0x2958('0x32')],_0x21b919[_0x2958('0x3b')]),_0x48650d);if(_0x36e2a5[_0x2958('0x32')][_0x2958('0x3c')]){_0x5d1dfc['where']=_[_0x2958('0x3d')](_0x5d1dfc[_0x2958('0x3a')],{'$or':_[_0x2958('0x2b')](_0x48650d,function(_0x3f7e27){if(_0x3f7e27[_0x2958('0x2f')]!==_0x2958('0x3e')){var _0x1ed89b={};_0x1ed89b[_0x3f7e27[_0x2958('0x28')]]={'$like':'%'+_0x36e2a5[_0x2958('0x32')][_0x2958('0x3c')]+'%'};return _0x1ed89b;}})});}_0x5d1dfc=_[_0x2958('0x3d')]({},_0x5d1dfc,_0x36e2a5[_0x2958('0x3f')]);var _0x319243={'where':_0x5d1dfc['where']};return db[_0x2958('0x2c')][_0x2958('0x1f')](_0x319243)['then'](function(_0x4fe061){_0x5053d0[_0x2958('0x1f')]=_0x4fe061;if(_0x36e2a5[_0x2958('0x32')][_0x2958('0x40')]){_0x5d1dfc[_0x2958('0x41')]=[{'all':!![]}];}return db[_0x2958('0x2c')][_0x2958('0x42')](_0x5d1dfc);})[_0x2958('0x25')](function(_0x13be6d){_0x5053d0[_0x2958('0x43')]=_0x13be6d;return _0x5053d0;})[_0x2958('0x25')](respondWithFilteredResult(_0x153958,_0x5d1dfc))[_0x2958('0x44')](handleError(_0x153958,null));};exports[_0x2958('0x45')]=function(_0xe33c56,_0x5a58ea){var _0x645b66={'raw':![],'where':{'id':_0xe33c56[_0x2958('0x46')]['id']}},_0x112256={};_0x112256[_0x2958('0x31')]=_['keys'](db[_0x2958('0x2c')]['rawAttributes']);_0x112256['query']=_[_0x2958('0x47')](_0xe33c56[_0x2958('0x32')]);_0x112256[_0x2958('0x3b')]=_[_0x2958('0x33')](_0x112256[_0x2958('0x31')],_0x112256[_0x2958('0x32')]);_0x645b66['attributes']=_[_0x2958('0x33')](_0x112256['model'],qs['fields'](_0xe33c56[_0x2958('0x32')]['fields']));_0x645b66[_0x2958('0x35')]=_0x645b66[_0x2958('0x35')][_0x2958('0x36')]?_0x645b66[_0x2958('0x35')]:_0x112256[_0x2958('0x31')];if(_0xe33c56[_0x2958('0x32')][_0x2958('0x40')]){_0x645b66[_0x2958('0x41')]=[{'all':!![]}];}_0x645b66=_['merge']({},_0x645b66,_0xe33c56[_0x2958('0x3f')]);return db[_0x2958('0x2c')][_0x2958('0x48')](_0x645b66)[_0x2958('0x25')](handleEntityNotFound(_0x5a58ea,null))['then'](respondWithResult(_0x5a58ea,null))[_0x2958('0x44')](handleError(_0x5a58ea,null));};exports[_0x2958('0x49')]=function(_0x4a51b1,_0x1b6829){return db[_0x2958('0x2c')][_0x2958('0x49')](_0x4a51b1[_0x2958('0x4a')],{})[_0x2958('0x25')](respondWithResult(_0x1b6829,0xc9))[_0x2958('0x44')](handleError(_0x1b6829,null));};exports['update']=function(_0x1fff2a,_0x38b551){if(_0x1fff2a[_0x2958('0x4a')]['id']){delete _0x1fff2a[_0x2958('0x4a')]['id'];}return db[_0x2958('0x2c')][_0x2958('0x48')]({'where':{'id':_0x1fff2a[_0x2958('0x46')]['id']}})[_0x2958('0x25')](handleEntityNotFound(_0x38b551,null))[_0x2958('0x25')](saveUpdates(_0x1fff2a[_0x2958('0x4a')],null))[_0x2958('0x25')](respondWithResult(_0x38b551,null))[_0x2958('0x44')](handleError(_0x38b551,null));};exports[_0x2958('0x26')]=function(_0x3f7bc1,_0x1bb780){return db[_0x2958('0x2c')][_0x2958('0x48')]({'where':{'id':_0x3f7bc1['params']['id']}})[_0x2958('0x25')](handleEntityNotFound(_0x1bb780,null))['then'](removeEntity(_0x1bb780,null))[_0x2958('0x44')](handleError(_0x1bb780,null));}; \ No newline at end of file +var _0xba34=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','Integration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x5047b2,_0x23ff64){var _0x57d700=function(_0x51cb89){while(--_0x51cb89){_0x5047b2['push'](_0x5047b2['shift']());}};_0x57d700(++_0x23ff64);}(_0xba34,0x119));var _0x4ba3=function(_0x21314a,_0x2c1272){_0x21314a=_0x21314a-0x0;var _0x1c85cc=_0xba34[_0x21314a];return _0x1c85cc;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1073d4,_0x52f55c){_0x52f55c=_0x52f55c||0xcc;return function(_0x256f02){if(_0x256f02){return _0x1073d4[_0x4ba3('0x19')](_0x52f55c);}return _0x1073d4[_0x4ba3('0x1a')](_0x52f55c)[_0x4ba3('0x1b')]();};}function respondWithResult(_0x2bc796,_0x3d2ace){_0x3d2ace=_0x3d2ace||0xc8;return function(_0x3a74f7){if(_0x3a74f7){return _0x2bc796[_0x4ba3('0x1a')](_0x3d2ace)[_0x4ba3('0x1c')](_0x3a74f7);}};}function respondWithFilteredResult(_0x401366,_0x36638b){return function(_0x301359){if(_0x301359){var _0x29a9d1=typeof _0x36638b[_0x4ba3('0x1d')]===_0x4ba3('0x1e')&&typeof _0x36638b[_0x4ba3('0x1f')]==='undefined';var _0x382fd0=_0x301359[_0x4ba3('0x20')];var _0x5ff7ce=_0x29a9d1?0x0:_0x36638b[_0x4ba3('0x1d')];var _0x556290=_0x29a9d1?_0x301359[_0x4ba3('0x20')]:_0x36638b[_0x4ba3('0x1d')]+_0x36638b[_0x4ba3('0x1f')];var _0x1e2ce5;if(_0x556290>=_0x382fd0){_0x556290=_0x382fd0;_0x1e2ce5=0xc8;}else{_0x1e2ce5=0xce;}_0x401366[_0x4ba3('0x1a')](_0x1e2ce5);return _0x401366[_0x4ba3('0x21')]('Content-Range',_0x5ff7ce+'-'+_0x556290+'/'+_0x382fd0)['json'](_0x301359);}return null;};}function patchUpdates(_0x2278b0){return function(_0x579d9f){try{jsonpatch[_0x4ba3('0x22')](_0x579d9f,_0x2278b0,!![]);}catch(_0x163967){return BPromise[_0x4ba3('0x23')](_0x163967);}return _0x579d9f[_0x4ba3('0x24')]();};}function saveUpdates(_0x46f1f5,_0x278a23){return function(_0x4a0823){if(_0x4a0823){return _0x4a0823[_0x4ba3('0x25')](_0x46f1f5)[_0x4ba3('0x26')](function(_0x5c28f9){return _0x5c28f9;});}return null;};}function removeEntity(_0x28bb3d,_0x4ffe39){return function(_0x1ae4de){if(_0x1ae4de){return _0x1ae4de[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){_0x28bb3d[_0x4ba3('0x1a')](0xcc)[_0x4ba3('0x1b')]();});}};}function handleEntityNotFound(_0xe29a49,_0x159596){return function(_0xe1f7d2){if(!_0xe1f7d2){_0xe29a49[_0x4ba3('0x19')](0x194);}return _0xe1f7d2;};}function handleError(_0x2e67a0,_0x50c729){_0x50c729=_0x50c729||0x1f4;return function(_0x252f37){logger[_0x4ba3('0x28')](_0x252f37[_0x4ba3('0x29')]);if(_0x252f37['name']){delete _0x252f37[_0x4ba3('0x2a')];}_0x2e67a0[_0x4ba3('0x1a')](_0x50c729)[_0x4ba3('0x2b')](_0x252f37);};}exports['index']=function(_0x10cae6,_0x843276){var _0x34ecb4={},_0x22394d={},_0x4a339e={'count':0x0,'rows':[]};var _0x590108=_[_0x4ba3('0x2c')](db[_0x4ba3('0x2d')][_0x4ba3('0x2e')],function(_0x19f039){return{'name':_0x19f039[_0x4ba3('0x2f')],'type':_0x19f039[_0x4ba3('0x30')]['key']};});_0x22394d[_0x4ba3('0x31')]=_[_0x4ba3('0x2c')](_0x590108,_0x4ba3('0x2a'));_0x22394d[_0x4ba3('0x32')]=_[_0x4ba3('0x33')](_0x10cae6[_0x4ba3('0x32')]);_0x22394d[_0x4ba3('0x34')]=_[_0x4ba3('0x35')](_0x22394d[_0x4ba3('0x31')],_0x22394d[_0x4ba3('0x32')]);_0x34ecb4['attributes']=_['intersection'](_0x22394d['model'],qs[_0x4ba3('0x36')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x36')]));_0x34ecb4[_0x4ba3('0x37')]=_0x34ecb4[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x34ecb4[_0x4ba3('0x37')]:_0x22394d[_0x4ba3('0x31')];if(!_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x39')](_0x4ba3('0x3a'))){_0x34ecb4[_0x4ba3('0x1f')]=qs['limit'](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x1f')]);_0x34ecb4[_0x4ba3('0x1d')]=qs['offset'](_0x10cae6[_0x4ba3('0x32')]['offset']);}_0x34ecb4[_0x4ba3('0x3b')]=qs[_0x4ba3('0x3c')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x3c')]);_0x34ecb4[_0x4ba3('0x3d')]=qs[_0x4ba3('0x34')](_['pick'](_0x10cae6[_0x4ba3('0x32')],_0x22394d[_0x4ba3('0x34')]),_0x590108);if(_0x10cae6[_0x4ba3('0x32')]['filter']){_0x34ecb4[_0x4ba3('0x3d')]=_[_0x4ba3('0x3e')](_0x34ecb4['where'],{'$or':_[_0x4ba3('0x2c')](_0x590108,function(_0x503777){if(_0x503777['type']!==_0x4ba3('0x3f')){var _0x1acc74={};_0x1acc74[_0x503777[_0x4ba3('0x2a')]]={'$like':'%'+_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x40')]+'%'};return _0x1acc74;}})});}_0x34ecb4=_['merge']({},_0x34ecb4,_0x10cae6[_0x4ba3('0x41')]);var _0x10e4b5={'where':_0x34ecb4[_0x4ba3('0x3d')]};return db[_0x4ba3('0x2d')][_0x4ba3('0x20')](_0x10e4b5)[_0x4ba3('0x26')](function(_0x349af4){_0x4a339e[_0x4ba3('0x20')]=_0x349af4;if(_0x10cae6['query'][_0x4ba3('0x42')]){_0x34ecb4[_0x4ba3('0x43')]=[{'all':!![]}];}return db[_0x4ba3('0x2d')][_0x4ba3('0x44')](_0x34ecb4);})[_0x4ba3('0x26')](function(_0x25b2c9){_0x4a339e[_0x4ba3('0x45')]=_0x25b2c9;return _0x4a339e;})[_0x4ba3('0x26')](respondWithFilteredResult(_0x843276,_0x34ecb4))[_0x4ba3('0x46')](handleError(_0x843276,null));};exports[_0x4ba3('0x47')]=function(_0x3b9a0a,_0x1c58d2){var _0x1d031b={'raw':![],'where':{'id':_0x3b9a0a['params']['id']}},_0x28b649={};_0x28b649['model']=_['keys'](db['Integration']['rawAttributes']);_0x28b649[_0x4ba3('0x32')]=_['keys'](_0x3b9a0a[_0x4ba3('0x32')]);_0x28b649['filters']=_[_0x4ba3('0x35')](_0x28b649[_0x4ba3('0x31')],_0x28b649[_0x4ba3('0x32')]);_0x1d031b[_0x4ba3('0x37')]=_[_0x4ba3('0x35')](_0x28b649['model'],qs[_0x4ba3('0x36')](_0x3b9a0a['query'][_0x4ba3('0x36')]));_0x1d031b['attributes']=_0x1d031b[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x1d031b[_0x4ba3('0x37')]:_0x28b649[_0x4ba3('0x31')];if(_0x3b9a0a[_0x4ba3('0x32')][_0x4ba3('0x42')]){_0x1d031b[_0x4ba3('0x43')]=[{'all':!![]}];}_0x1d031b=_['merge']({},_0x1d031b,_0x3b9a0a[_0x4ba3('0x41')]);return db[_0x4ba3('0x2d')][_0x4ba3('0x48')](_0x1d031b)[_0x4ba3('0x26')](handleEntityNotFound(_0x1c58d2,null))[_0x4ba3('0x26')](respondWithResult(_0x1c58d2,null))['catch'](handleError(_0x1c58d2,null));};exports['create']=function(_0xa4bbb2,_0x1fe115){return db[_0x4ba3('0x2d')]['create'](_0xa4bbb2[_0x4ba3('0x49')],{})[_0x4ba3('0x26')](respondWithResult(_0x1fe115,0xc9))[_0x4ba3('0x46')](handleError(_0x1fe115,null));};exports['update']=function(_0x47f588,_0x34dc04){if(_0x47f588['body']['id']){delete _0x47f588[_0x4ba3('0x49')]['id'];}return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x47f588[_0x4ba3('0x4a')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x34dc04,null))[_0x4ba3('0x26')](saveUpdates(_0x47f588['body'],null))[_0x4ba3('0x26')](respondWithResult(_0x34dc04,null))[_0x4ba3('0x46')](handleError(_0x34dc04,null));};exports['destroy']=function(_0x325475,_0x12ae6f){return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x325475[_0x4ba3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12ae6f,null))[_0x4ba3('0x26')](removeEntity(_0x12ae6f,null))[_0x4ba3('0x46')](handleError(_0x12ae6f,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index c3cb6b8..da9138b 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 _0x102a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','lodash','util','../../config/logger','api'];(function(_0x27aca8,_0x1771b6){var _0x29db6d=function(_0xebf125){while(--_0xebf125){_0x27aca8['push'](_0x27aca8['shift']());}};_0x29db6d(++_0x1771b6);}(_0x102a,0x88));var _0xa102=function(_0x2e6fe1,_0x4fc5aa){_0x2e6fe1=_0x2e6fe1-0x0;var _0x5c0a35=_0x102a[_0x2e6fe1];return _0x5c0a35;};'use strict';var _=require(_0xa102('0x0'));var util=require(_0xa102('0x1'));var logger=require(_0xa102('0x2'))(_0xa102('0x3'));var moment=require(_0xa102('0x4'));var BPromise=require(_0xa102('0x5'));var rp=require(_0xa102('0x6'));var fs=require('fs');var path=require(_0xa102('0x7'));var rimraf=require(_0xa102('0x8'));var config=require(_0xa102('0x9'));var attributes=require(_0xa102('0xa'));module[_0xa102('0xb')]=function(_0x2d8b2b,_0x2048dc){return _0x2d8b2b[_0xa102('0xc')](_0xa102('0xd'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed3e=['path','rimraf','../../config/environment','exports','define','Integration','integrations','util','../../config/logger','api','request-promise'];(function(_0x22f62c,_0x52d699){var _0x3bb6a1=function(_0x46301a){while(--_0x46301a){_0x22f62c['push'](_0x22f62c['shift']());}};_0x3bb6a1(++_0x52d699);}(_0xed3e,0x13b));var _0xeed3=function(_0x190743,_0x1a52eb){_0x190743=_0x190743-0x0;var _0xfda428=_0xed3e[_0x190743];return _0xfda428;};'use strict';var _=require('lodash');var util=require(_0xeed3('0x0'));var logger=require(_0xeed3('0x1'))(_0xeed3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xeed3('0x3'));var fs=require('fs');var path=require(_0xeed3('0x4'));var rimraf=require(_0xeed3('0x5'));var config=require(_0xeed3('0x6'));var attributes=require('./integration.attributes');module[_0xeed3('0x7')]=function(_0x4cd243,_0x598644){return _0x4cd243[_0xeed3('0x8')](_0xeed3('0x9'),attributes,{'tableName':_0xeed3('0xa'),'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 2ec4802..8e7e8f6 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 _0x2542=['info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x4073b7,_0xf4cf37){var _0x37503a=function(_0x49564b){while(--_0x49564b){_0x4073b7['push'](_0x4073b7['shift']());}};_0x37503a(++_0xf4cf37);}(_0x2542,0x169));var _0x2254=function(_0x50cdae,_0x44f529){_0x50cdae=_0x50cdae-0x0;var _0x36f686=_0x2542[_0x50cdae];return _0x36f686;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});} \ No newline at end of file +var _0xda2d=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','moment'];(function(_0x4d692a,_0x5c1506){var _0x9ef565=function(_0x2e17c8){while(--_0x2e17c8){_0x4d692a['push'](_0x4d692a['shift']());}};_0x9ef565(++_0x5c1506);}(_0xda2d,0x102));var _0xdda2=function(_0x432917,_0x34faac){_0x432917=_0x432917-0x0;var _0x1b89de=_0xda2d[_0x432917];return _0x1b89de;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf38e58,_0x2f55dc,_0x436676){return new BPromise(function(_0x2e2523,_0x341c7b){return client['request'](_0xf38e58,_0x436676)[_0xdda2('0xa')](function(_0x22c6e5){logger['info'](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));logger[_0xdda2('0xd')](_0xdda2('0xe'),_0x2f55dc,_0xdda2('0xc'),JSON[_0xdda2('0xf')](_0x22c6e5));if(_0x22c6e5[_0xdda2('0x10')]){if(_0x22c6e5[_0xdda2('0x10')]['code']===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x2f55dc,_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);return _0x341c7b(_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);}logger[_0xdda2('0x10')](_0xdda2('0xb'),_0x2f55dc,_0x22c6e5[_0xdda2('0x10')]['message']);return _0x2e2523(_0x22c6e5[_0xdda2('0x10')]['message']);}else{logger[_0xdda2('0x12')](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));_0x2e2523(_0x22c6e5[_0xdda2('0x13')][_0xdda2('0x11')]);}})['catch'](function(_0x55d674){logger[_0xdda2('0x10')]('Integration,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index f7ed7c7..36012b0 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 _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x229d55,_0x228309){var _0x9c7b5d=function(_0x3db612){while(--_0x3db612){_0x229d55['push'](_0x229d55['shift']());}};_0x9c7b5d(++_0x228309);}(_0x4975,0x86));var _0x5497=function(_0x88ca39,_0x4c9008){_0x88ca39=_0x88ca39-0x0;var _0x51a757=_0x4975[_0x88ca39];return _0x51a757;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xf'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file +var _0xc6ac=['./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x423d34,_0x365b72){var _0x50006e=function(_0x4b898e){while(--_0x4b898e){_0x423d34['push'](_0x423d34['shift']());}};_0x50006e(++_0x365b72);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x3d83fd,_0x14e1b3){_0x3d83fd=_0x3d83fd-0x0;var _0x2e2d25=_0xc6ac[_0x3d83fd];return _0x2e2d25;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var fs_extra=require(_0xcc6a('0x6'));var auth=require(_0xcc6a('0x7'));var interaction=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var controller=require(_0xcc6a('0xa'));router[_0xcc6a('0xb')]('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xd')]);router['get'](_0xcc6a('0xe'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xf')]);router['get'](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x11')]);router[_0xcc6a('0x12')]('/',auth[_0xcc6a('0xc')](),controller['create']);router[_0xcc6a('0x13')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller['update']);router[_0xcc6a('0x14')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 5a73815..db134b4 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 _0x8ce9=['FAILED','sequelize','exports','STRING','DATE','BOOLEAN','INTEGER','TEXT','ENUM','SENT','SENDING'];(function(_0x2cd932,_0x36d17c){var _0x46e0ba=function(_0xfc01fd){while(--_0xfc01fd){_0x2cd932['push'](_0x2cd932['shift']());}};_0x46e0ba(++_0x36d17c);}(_0x8ce9,0x156));var _0x98ce=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8ce9[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x98ce('0x0'));module[_0x98ce('0x1')]={'integration':{'type':Sequelize[_0x98ce('0x2')]},'eventChannel':{'type':Sequelize[_0x98ce('0x2')]},'exitStatus':{'type':Sequelize[_0x98ce('0x2')]},'ticketId':{'type':Sequelize[_0x98ce('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x98ce('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x98ce('0x2')]},'membername':{'type':Sequelize[_0x98ce('0x2')]},'agentcalledAt':{'type':Sequelize[_0x98ce('0x3')]},'agentconnectAt':{'type':Sequelize[_0x98ce('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x98ce('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x98ce('0x3')]},'talktime':{'type':Sequelize[_0x98ce('0x5')]},'agentacw':{'type':Sequelize[_0x98ce('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x98ce('0x5')]},'reason':{'type':Sequelize[_0x98ce('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x98ce('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x98ce('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x98ce('0x3')]},'lastevent':{'type':Sequelize[_0x98ce('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x98ce('0x5')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x98ce('0x2')]},'context':{'type':Sequelize[_0x98ce('0x2')]},'exten':{'type':Sequelize[_0x98ce('0x2')]},'priority':{'type':Sequelize[_0x98ce('0x2')]},'destchannel':{'type':Sequelize[_0x98ce('0x2')]},'destchannelstate':{'type':Sequelize[_0x98ce('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x98ce('0x2')]},'destcalleridnum':{'type':Sequelize[_0x98ce('0x2')]},'destcalleridname':{'type':Sequelize[_0x98ce('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x98ce('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x98ce('0x2')]},'destlanguage':{'type':Sequelize[_0x98ce('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x98ce('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x98ce('0x2')]},'subject':{'type':Sequelize[_0x98ce('0x2')]},'from':{'type':Sequelize[_0x98ce('0x2')]},'to':{'type':Sequelize[_0x98ce('0x2')]},'cc':{'type':Sequelize[_0x98ce('0x2')]},'attachment':{'type':Sequelize[_0x98ce('0x6')]},'html':{'type':Sequelize[_0x98ce('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x98ce('0x7')](_0x98ce('0x8'),_0x98ce('0x9'),'RECEIVED',_0x98ce('0xa'))},'url':{'type':Sequelize[_0x98ce('0x2')]},'app':{'type':Sequelize[_0x98ce('0x2')]},'appdata':{'type':Sequelize[_0x98ce('0x2')]},'projectId':{'type':Sequelize[_0x98ce('0x5')]}}; \ No newline at end of file +var _0xf096=['exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','sequelize'];(function(_0x114984,_0x5c9593){var _0x44822b=function(_0x10af37){while(--_0x10af37){_0x114984['push'](_0x114984['shift']());}};_0x44822b(++_0x5c9593);}(_0xf096,0x83));var _0x6f09=function(_0x4ea712,_0x22010c){_0x4ea712=_0x4ea712-0x0;var _0x458a09=_0xf096[_0x4ea712];return _0x458a09;};'use strict';var Sequelize=require(_0x6f09('0x0'));module[_0x6f09('0x1')]={'integration':{'type':Sequelize[_0x6f09('0x2')]},'eventChannel':{'type':Sequelize[_0x6f09('0x2')]},'exitStatus':{'type':Sequelize[_0x6f09('0x2')]},'ticketId':{'type':Sequelize[_0x6f09('0x2')]},'integrationId':{'type':Sequelize[_0x6f09('0x3')]},'contacts':{'type':Sequelize[_0x6f09('0x2')]},'uniqueid':{'type':Sequelize[_0x6f09('0x2')]},'calleridnum':{'type':Sequelize[_0x6f09('0x2')]},'calleridname':{'type':Sequelize[_0x6f09('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x6f09('0x2')]},'agentcalledAt':{'type':Sequelize[_0x6f09('0x4')]},'agentconnectAt':{'type':Sequelize[_0x6f09('0x4')]},'holdtime':{'type':Sequelize[_0x6f09('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x6f09('0x3')]},'agentacw':{'type':Sequelize[_0x6f09('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x6f09('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x6f09('0x4')]},'agentdump':{'type':Sequelize[_0x6f09('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x6f09('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x6f09('0x2')]},'channelstate':{'type':Sequelize[_0x6f09('0x3')]},'channelstatedesc':{'type':Sequelize[_0x6f09('0x2')]},'connectedlinenum':{'type':Sequelize[_0x6f09('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x6f09('0x2')]},'accountcode':{'type':Sequelize[_0x6f09('0x2')]},'context':{'type':Sequelize[_0x6f09('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x6f09('0x2')]},'destchannelstate':{'type':Sequelize[_0x6f09('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x6f09('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x6f09('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x6f09('0x2')]},'destlanguage':{'type':Sequelize[_0x6f09('0x2')]},'destaccountcode':{'type':Sequelize[_0x6f09('0x2')]},'destcontext':{'type':Sequelize[_0x6f09('0x2')]},'destexten':{'type':Sequelize[_0x6f09('0x2')]},'destpriority':{'type':Sequelize[_0x6f09('0x2')]},'destuniqueid':{'type':Sequelize[_0x6f09('0x2')]},'messageId':{'type':Sequelize[_0x6f09('0x2')]},'inReplyTo':{'type':Sequelize[_0x6f09('0x2')]},'subject':{'type':Sequelize[_0x6f09('0x2')]},'from':{'type':Sequelize[_0x6f09('0x2')]},'to':{'type':Sequelize[_0x6f09('0x2')]},'cc':{'type':Sequelize[_0x6f09('0x2')]},'attachment':{'type':Sequelize[_0x6f09('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x6f09('0x6')]},'status':{'type':Sequelize[_0x6f09('0x7')](_0x6f09('0x8'),_0x6f09('0x9'),_0x6f09('0xa'),'FAILED')},'url':{'type':Sequelize[_0x6f09('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x6f09('0x2')]},'projectId':{'type':Sequelize[_0x6f09('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index d5aab41..e4dc2a0 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 _0xf2fc=['status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','IntegrationReport','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','create','body','find','catch','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0xf84870,_0x4dc38f){var _0x4541a4=function(_0x3ff5d5){while(--_0x3ff5d5){_0xf84870['push'](_0xf84870['shift']());}};_0x4541a4(++_0x4dc38f);}(_0xf2fc,0x81));var _0xcf2f=function(_0x50e360,_0x1e65f4){_0x50e360=_0x50e360-0x0;var _0x330b18=_0xf2fc[_0x50e360];return _0x330b18;};'use strict';var emlformat=require(_0xcf2f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcf2f('0x1'));var jsonpatch=require(_0xcf2f('0x2'));var rp=require(_0xcf2f('0x3'));var moment=require(_0xcf2f('0x4'));var BPromise=require(_0xcf2f('0x5'));var Mustache=require(_0xcf2f('0x6'));var util=require(_0xcf2f('0x7'));var path=require(_0xcf2f('0x8'));var sox=require(_0xcf2f('0x9'));var csv=require('to-csv');var ejs=require(_0xcf2f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcf2f('0xb'));var squel=require(_0xcf2f('0xc'));var crypto=require(_0xcf2f('0xd'));var jsforce=require(_0xcf2f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcf2f('0xf'));var querystring=require(_0xcf2f('0x10'));var Papa=require(_0xcf2f('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcf2f('0x12'));var as=require(_0xcf2f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcf2f('0x14'))(_0xcf2f('0x15'));var utils=require(_0xcf2f('0x16'));var config=require(_0xcf2f('0x17'));var licenseUtil=require(_0xcf2f('0x18'));var db=require(_0xcf2f('0x19'))['db'];function respondWithStatusCode(_0x55c384,_0x2236e2){_0x2236e2=_0x2236e2||0xcc;return function(_0x3c7126){if(_0x3c7126){return _0x55c384[_0xcf2f('0x1a')](_0x2236e2);}return _0x55c384[_0xcf2f('0x1b')](_0x2236e2)['end']();};}function respondWithResult(_0x4dc597,_0x405860){_0x405860=_0x405860||0xc8;return function(_0x51337a){if(_0x51337a){return _0x4dc597['status'](_0x405860)['json'](_0x51337a);}};}function respondWithFilteredResult(_0x11aca6,_0x372c5e){return function(_0x1ef045){if(_0x1ef045){var _0x5af10a=typeof _0x372c5e[_0xcf2f('0x1c')]===_0xcf2f('0x1d')&&typeof _0x372c5e[_0xcf2f('0x1e')]==='undefined';var _0xb83c61=_0x1ef045[_0xcf2f('0x1f')];var _0x54fae7=_0x5af10a?0x0:_0x372c5e[_0xcf2f('0x1c')];var _0x3f8b0c=_0x5af10a?_0x1ef045[_0xcf2f('0x1f')]:_0x372c5e[_0xcf2f('0x1c')]+_0x372c5e[_0xcf2f('0x1e')];var _0x3597e5;if(_0x3f8b0c>=_0xb83c61){_0x3f8b0c=_0xb83c61;_0x3597e5=0xc8;}else{_0x3597e5=0xce;}_0x11aca6[_0xcf2f('0x1b')](_0x3597e5);return _0x11aca6[_0xcf2f('0x20')](_0xcf2f('0x21'),_0x54fae7+'-'+_0x3f8b0c+'/'+_0xb83c61)[_0xcf2f('0x22')](_0x1ef045);}return null;};}function patchUpdates(_0x2bea34){return function(_0xafa66c){try{jsonpatch[_0xcf2f('0x23')](_0xafa66c,_0x2bea34,!![]);}catch(_0x2a10f6){return BPromise[_0xcf2f('0x24')](_0x2a10f6);}return _0xafa66c[_0xcf2f('0x25')]();};}function saveUpdates(_0x216d4a,_0x47f7a4){return function(_0x2bf17c){if(_0x2bf17c){return _0x2bf17c[_0xcf2f('0x26')](_0x216d4a)[_0xcf2f('0x27')](function(_0x2dc531){return _0x2dc531;});}return null;};}function removeEntity(_0x55b3e9,_0x1180a7){return function(_0x234f8a){if(_0x234f8a){return _0x234f8a[_0xcf2f('0x28')]()[_0xcf2f('0x27')](function(){_0x55b3e9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a14e3,_0xaccd18){return function(_0x505775){if(!_0x505775){_0x5a14e3[_0xcf2f('0x1a')](0x194);}return _0x505775;};}function handleError(_0x3750b6,_0x382468){_0x382468=_0x382468||0x1f4;return function(_0x534036){logger['error'](_0x534036[_0xcf2f('0x29')]);if(_0x534036[_0xcf2f('0x2a')]){delete _0x534036[_0xcf2f('0x2a')];}_0x3750b6[_0xcf2f('0x1b')](_0x382468)[_0xcf2f('0x2b')](_0x534036);};}exports[_0xcf2f('0x2c')]=function(_0x4b8688,_0xbf5b20){var _0x2bc5a6={},_0x3ff43b={},_0x214031={'count':0x0,'rows':[]};var _0x11147b=_[_0xcf2f('0x2d')](db[_0xcf2f('0x2e')]['rawAttributes'],function(_0x4a1c7c){return{'name':_0x4a1c7c['fieldName'],'type':_0x4a1c7c[_0xcf2f('0x2f')]['key']};});_0x3ff43b['model']=_[_0xcf2f('0x2d')](_0x11147b,_0xcf2f('0x2a'));_0x3ff43b[_0xcf2f('0x30')]=_[_0xcf2f('0x31')](_0x4b8688[_0xcf2f('0x30')]);_0x3ff43b[_0xcf2f('0x32')]=_[_0xcf2f('0x33')](_0x3ff43b[_0xcf2f('0x34')],_0x3ff43b[_0xcf2f('0x30')]);_0x2bc5a6['attributes']=_[_0xcf2f('0x33')](_0x3ff43b[_0xcf2f('0x34')],qs[_0xcf2f('0x35')](_0x4b8688['query'][_0xcf2f('0x35')]));_0x2bc5a6[_0xcf2f('0x36')]=_0x2bc5a6[_0xcf2f('0x36')][_0xcf2f('0x37')]?_0x2bc5a6[_0xcf2f('0x36')]:_0x3ff43b[_0xcf2f('0x34')];if(!_0x4b8688[_0xcf2f('0x30')][_0xcf2f('0x38')](_0xcf2f('0x39'))){_0x2bc5a6[_0xcf2f('0x1e')]=qs[_0xcf2f('0x1e')](_0x4b8688[_0xcf2f('0x30')][_0xcf2f('0x1e')]);_0x2bc5a6[_0xcf2f('0x1c')]=qs[_0xcf2f('0x1c')](_0x4b8688['query'][_0xcf2f('0x1c')]);}_0x2bc5a6[_0xcf2f('0x3a')]=qs[_0xcf2f('0x3b')](_0x4b8688['query'][_0xcf2f('0x3b')]);_0x2bc5a6[_0xcf2f('0x3c')]=qs['filters'](_[_0xcf2f('0x3d')](_0x4b8688[_0xcf2f('0x30')],_0x3ff43b[_0xcf2f('0x32')]),_0x11147b);if(_0x4b8688[_0xcf2f('0x30')]['filter']){_0x2bc5a6[_0xcf2f('0x3c')]=_['merge'](_0x2bc5a6[_0xcf2f('0x3c')],{'$or':_['map'](_0x11147b,function(_0x48b576){if(_0x48b576[_0xcf2f('0x2f')]!==_0xcf2f('0x3e')){var _0x4ef75d={};_0x4ef75d[_0x48b576[_0xcf2f('0x2a')]]={'$like':'%'+_0x4b8688['query'][_0xcf2f('0x3f')]+'%'};return _0x4ef75d;}})});}_0x2bc5a6=_[_0xcf2f('0x40')]({},_0x2bc5a6,_0x4b8688[_0xcf2f('0x41')]);var _0x103395={'where':_0x2bc5a6[_0xcf2f('0x3c')]};return db[_0xcf2f('0x2e')][_0xcf2f('0x1f')](_0x103395)[_0xcf2f('0x27')](function(_0x12804b){_0x214031[_0xcf2f('0x1f')]=_0x12804b;if(_0x4b8688[_0xcf2f('0x30')][_0xcf2f('0x42')]){_0x2bc5a6[_0xcf2f('0x43')]=[{'all':!![]}];}return db[_0xcf2f('0x2e')][_0xcf2f('0x44')](_0x2bc5a6);})[_0xcf2f('0x27')](function(_0x490d6d){_0x214031[_0xcf2f('0x45')]=_0x490d6d;return _0x214031;})[_0xcf2f('0x27')](respondWithFilteredResult(_0xbf5b20,_0x2bc5a6))['catch'](handleError(_0xbf5b20,null));};exports[_0xcf2f('0x46')]=function(_0x890011,_0x2b0734){var _0x2f5943={'raw':![],'where':{'id':_0x890011[_0xcf2f('0x47')]['id']}},_0x6cdd4c={};_0x6cdd4c[_0xcf2f('0x34')]=_[_0xcf2f('0x31')](db['IntegrationReport'][_0xcf2f('0x48')]);_0x6cdd4c['query']=_['keys'](_0x890011['query']);_0x6cdd4c[_0xcf2f('0x32')]=_[_0xcf2f('0x33')](_0x6cdd4c[_0xcf2f('0x34')],_0x6cdd4c[_0xcf2f('0x30')]);_0x2f5943['attributes']=_[_0xcf2f('0x33')](_0x6cdd4c[_0xcf2f('0x34')],qs[_0xcf2f('0x35')](_0x890011[_0xcf2f('0x30')][_0xcf2f('0x35')]));_0x2f5943['attributes']=_0x2f5943[_0xcf2f('0x36')][_0xcf2f('0x37')]?_0x2f5943[_0xcf2f('0x36')]:_0x6cdd4c['model'];if(_0x890011[_0xcf2f('0x30')][_0xcf2f('0x42')]){_0x2f5943['include']=[{'all':!![]}];}_0x2f5943=_[_0xcf2f('0x40')]({},_0x2f5943,_0x890011[_0xcf2f('0x41')]);return db[_0xcf2f('0x2e')]['find'](_0x2f5943)[_0xcf2f('0x27')](handleEntityNotFound(_0x2b0734,null))[_0xcf2f('0x27')](respondWithResult(_0x2b0734,null))['catch'](handleError(_0x2b0734,null));};exports['create']=function(_0x8607e4,_0x4436af){return db[_0xcf2f('0x2e')][_0xcf2f('0x49')](_0x8607e4[_0xcf2f('0x4a')],{})['then'](respondWithResult(_0x4436af,0xc9))['catch'](handleError(_0x4436af,null));};exports[_0xcf2f('0x26')]=function(_0x33ce63,_0x813777){if(_0x33ce63[_0xcf2f('0x4a')]['id']){delete _0x33ce63[_0xcf2f('0x4a')]['id'];}return db[_0xcf2f('0x2e')][_0xcf2f('0x4b')]({'where':{'id':_0x33ce63[_0xcf2f('0x47')]['id']}})[_0xcf2f('0x27')](handleEntityNotFound(_0x813777,null))[_0xcf2f('0x27')](saveUpdates(_0x33ce63[_0xcf2f('0x4a')],null))['then'](respondWithResult(_0x813777,null))[_0xcf2f('0x4c')](handleError(_0x813777,null));};exports[_0xcf2f('0x28')]=function(_0x2b1737,_0x141199){return db['IntegrationReport'][_0xcf2f('0x4b')]({'where':{'id':_0x2b1737[_0xcf2f('0x47')]['id']}})[_0xcf2f('0x27')](handleEntityNotFound(_0x141199,null))['then'](removeEntity(_0x141199,null))[_0xcf2f('0x4c')](handleError(_0x141199,null));};exports['describe']=function(_0x522a9b,_0x28e4b7){return db[_0xcf2f('0x2e')][_0xcf2f('0x4d')]()[_0xcf2f('0x27')](respondWithResult(_0x28e4b7,null))[_0xcf2f('0x4c')](handleError(_0x28e4b7,null));}; \ No newline at end of file +var _0x2e14=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','end','stack','name','send','index','IntegrationReport','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x422311,_0x54125c){var _0x356858=function(_0x283a0f){while(--_0x283a0f){_0x422311['push'](_0x422311['shift']());}};_0x356858(++_0x54125c);}(_0x2e14,0x80));var _0x42e1=function(_0x34f701,_0x37e407){_0x34f701=_0x34f701-0x0;var _0x3e2429=_0x2e14[_0x34f701];return _0x3e2429;};'use strict';var emlformat=require(_0x42e1('0x0'));var rimraf=require(_0x42e1('0x1'));var zipdir=require(_0x42e1('0x2'));var jsonpatch=require(_0x42e1('0x3'));var rp=require(_0x42e1('0x4'));var moment=require('moment');var BPromise=require(_0x42e1('0x5'));var Mustache=require(_0x42e1('0x6'));var util=require(_0x42e1('0x7'));var path=require(_0x42e1('0x8'));var sox=require(_0x42e1('0x9'));var csv=require('to-csv');var ejs=require(_0x42e1('0xa'));var fs=require('fs');var fs_extra=require(_0x42e1('0xb'));var _=require('lodash');var squel=require(_0x42e1('0xc'));var crypto=require(_0x42e1('0xd'));var jsforce=require(_0x42e1('0xe'));var deskjs=require(_0x42e1('0xf'));var toCsv=require(_0x42e1('0x10'));var querystring=require('querystring');var Papa=require(_0x42e1('0x11'));var Redis=require('ioredis');var authService=require(_0x42e1('0x12'));var qs=require(_0x42e1('0x13'));var as=require(_0x42e1('0x14'));var hardwareService=require(_0x42e1('0x15'));var logger=require(_0x42e1('0x16'))(_0x42e1('0x17'));var utils=require(_0x42e1('0x18'));var config=require(_0x42e1('0x19'));var licenseUtil=require(_0x42e1('0x1a'));var db=require(_0x42e1('0x1b'))['db'];function respondWithStatusCode(_0x556810,_0x19a3fe){_0x19a3fe=_0x19a3fe||0xcc;return function(_0x4faddd){if(_0x4faddd){return _0x556810[_0x42e1('0x1c')](_0x19a3fe);}return _0x556810[_0x42e1('0x1d')](_0x19a3fe)['end']();};}function respondWithResult(_0x1adc69,_0x1c73d2){_0x1c73d2=_0x1c73d2||0xc8;return function(_0x360c4a){if(_0x360c4a){return _0x1adc69[_0x42e1('0x1d')](_0x1c73d2)['json'](_0x360c4a);}};}function respondWithFilteredResult(_0x590a6e,_0x439a9a){return function(_0x25bb6e){if(_0x25bb6e){var _0x342d16=typeof _0x439a9a[_0x42e1('0x1e')]===_0x42e1('0x1f')&&typeof _0x439a9a[_0x42e1('0x20')]===_0x42e1('0x1f');var _0x57296c=_0x25bb6e[_0x42e1('0x21')];var _0x13a503=_0x342d16?0x0:_0x439a9a[_0x42e1('0x1e')];var _0x3210a0=_0x342d16?_0x25bb6e['count']:_0x439a9a[_0x42e1('0x1e')]+_0x439a9a['limit'];var _0x5f1e45;if(_0x3210a0>=_0x57296c){_0x3210a0=_0x57296c;_0x5f1e45=0xc8;}else{_0x5f1e45=0xce;}_0x590a6e[_0x42e1('0x1d')](_0x5f1e45);return _0x590a6e[_0x42e1('0x22')]('Content-Range',_0x13a503+'-'+_0x3210a0+'/'+_0x57296c)[_0x42e1('0x23')](_0x25bb6e);}return null;};}function patchUpdates(_0x596be3){return function(_0x2e002e){try{jsonpatch[_0x42e1('0x24')](_0x2e002e,_0x596be3,!![]);}catch(_0x285305){return BPromise[_0x42e1('0x25')](_0x285305);}return _0x2e002e[_0x42e1('0x26')]();};}function saveUpdates(_0x60d2e4,_0x5774ce){return function(_0x240c0f){if(_0x240c0f){return _0x240c0f[_0x42e1('0x27')](_0x60d2e4)[_0x42e1('0x28')](function(_0x3ee459){return _0x3ee459;});}return null;};}function removeEntity(_0x404698,_0x282c22){return function(_0x2f088b){if(_0x2f088b){return _0x2f088b['destroy']()[_0x42e1('0x28')](function(){_0x404698[_0x42e1('0x1d')](0xcc)[_0x42e1('0x29')]();});}};}function handleEntityNotFound(_0x211807,_0x4e5332){return function(_0x134533){if(!_0x134533){_0x211807[_0x42e1('0x1c')](0x194);}return _0x134533;};}function handleError(_0x251013,_0x4cd4db){_0x4cd4db=_0x4cd4db||0x1f4;return function(_0x3ba2fb){logger['error'](_0x3ba2fb[_0x42e1('0x2a')]);if(_0x3ba2fb[_0x42e1('0x2b')]){delete _0x3ba2fb[_0x42e1('0x2b')];}_0x251013[_0x42e1('0x1d')](_0x4cd4db)[_0x42e1('0x2c')](_0x3ba2fb);};}exports[_0x42e1('0x2d')]=function(_0x5b66e0,_0x156eec){var _0x290086={},_0x5c75e0={},_0x4dca60={'count':0x0,'rows':[]};var _0x3e2ba7=_['map'](db[_0x42e1('0x2e')][_0x42e1('0x2f')],function(_0x1ecdb0){return{'name':_0x1ecdb0[_0x42e1('0x30')],'type':_0x1ecdb0[_0x42e1('0x31')]['key']};});_0x5c75e0[_0x42e1('0x32')]=_[_0x42e1('0x33')](_0x3e2ba7,_0x42e1('0x2b'));_0x5c75e0[_0x42e1('0x34')]=_[_0x42e1('0x35')](_0x5b66e0[_0x42e1('0x34')]);_0x5c75e0['filters']=_[_0x42e1('0x36')](_0x5c75e0[_0x42e1('0x32')],_0x5c75e0[_0x42e1('0x34')]);_0x290086[_0x42e1('0x37')]=_[_0x42e1('0x36')](_0x5c75e0['model'],qs[_0x42e1('0x38')](_0x5b66e0[_0x42e1('0x34')][_0x42e1('0x38')]));_0x290086[_0x42e1('0x37')]=_0x290086[_0x42e1('0x37')][_0x42e1('0x39')]?_0x290086[_0x42e1('0x37')]:_0x5c75e0[_0x42e1('0x32')];if(!_0x5b66e0[_0x42e1('0x34')][_0x42e1('0x3a')]('nolimit')){_0x290086['limit']=qs[_0x42e1('0x20')](_0x5b66e0[_0x42e1('0x34')][_0x42e1('0x20')]);_0x290086[_0x42e1('0x1e')]=qs[_0x42e1('0x1e')](_0x5b66e0['query'][_0x42e1('0x1e')]);}_0x290086['order']=qs[_0x42e1('0x3b')](_0x5b66e0[_0x42e1('0x34')][_0x42e1('0x3b')]);_0x290086[_0x42e1('0x3c')]=qs[_0x42e1('0x3d')](_[_0x42e1('0x3e')](_0x5b66e0[_0x42e1('0x34')],_0x5c75e0[_0x42e1('0x3d')]),_0x3e2ba7);if(_0x5b66e0[_0x42e1('0x34')][_0x42e1('0x3f')]){_0x290086['where']=_[_0x42e1('0x40')](_0x290086[_0x42e1('0x3c')],{'$or':_[_0x42e1('0x33')](_0x3e2ba7,function(_0x19ee25){if(_0x19ee25[_0x42e1('0x31')]!==_0x42e1('0x41')){var _0x565d6c={};_0x565d6c[_0x19ee25[_0x42e1('0x2b')]]={'$like':'%'+_0x5b66e0[_0x42e1('0x34')][_0x42e1('0x3f')]+'%'};return _0x565d6c;}})});}_0x290086=_[_0x42e1('0x40')]({},_0x290086,_0x5b66e0['options']);var _0x3d5ebb={'where':_0x290086[_0x42e1('0x3c')]};return db['IntegrationReport'][_0x42e1('0x21')](_0x3d5ebb)['then'](function(_0x1365b5){_0x4dca60[_0x42e1('0x21')]=_0x1365b5;if(_0x5b66e0[_0x42e1('0x34')][_0x42e1('0x42')]){_0x290086[_0x42e1('0x43')]=[{'all':!![]}];}return db[_0x42e1('0x2e')]['findAll'](_0x290086);})[_0x42e1('0x28')](function(_0x3acd82){_0x4dca60[_0x42e1('0x44')]=_0x3acd82;return _0x4dca60;})[_0x42e1('0x28')](respondWithFilteredResult(_0x156eec,_0x290086))[_0x42e1('0x45')](handleError(_0x156eec,null));};exports['show']=function(_0x340219,_0x411f3b){var _0x1acd0c={'raw':![],'where':{'id':_0x340219['params']['id']}},_0x135bd8={};_0x135bd8[_0x42e1('0x32')]=_[_0x42e1('0x35')](db['IntegrationReport']['rawAttributes']);_0x135bd8['query']=_[_0x42e1('0x35')](_0x340219[_0x42e1('0x34')]);_0x135bd8[_0x42e1('0x3d')]=_[_0x42e1('0x36')](_0x135bd8['model'],_0x135bd8[_0x42e1('0x34')]);_0x1acd0c[_0x42e1('0x37')]=_[_0x42e1('0x36')](_0x135bd8['model'],qs[_0x42e1('0x38')](_0x340219[_0x42e1('0x34')][_0x42e1('0x38')]));_0x1acd0c[_0x42e1('0x37')]=_0x1acd0c['attributes'][_0x42e1('0x39')]?_0x1acd0c[_0x42e1('0x37')]:_0x135bd8[_0x42e1('0x32')];if(_0x340219['query'][_0x42e1('0x42')]){_0x1acd0c['include']=[{'all':!![]}];}_0x1acd0c=_[_0x42e1('0x40')]({},_0x1acd0c,_0x340219['options']);return db['IntegrationReport'][_0x42e1('0x46')](_0x1acd0c)[_0x42e1('0x28')](handleEntityNotFound(_0x411f3b,null))['then'](respondWithResult(_0x411f3b,null))[_0x42e1('0x45')](handleError(_0x411f3b,null));};exports[_0x42e1('0x47')]=function(_0x5f585e,_0x1f5717){return db[_0x42e1('0x2e')][_0x42e1('0x47')](_0x5f585e[_0x42e1('0x48')],{})[_0x42e1('0x28')](respondWithResult(_0x1f5717,0xc9))[_0x42e1('0x45')](handleError(_0x1f5717,null));};exports['update']=function(_0x18bfb3,_0x202ba1){if(_0x18bfb3['body']['id']){delete _0x18bfb3[_0x42e1('0x48')]['id'];}return db['IntegrationReport'][_0x42e1('0x46')]({'where':{'id':_0x18bfb3[_0x42e1('0x49')]['id']}})[_0x42e1('0x28')](handleEntityNotFound(_0x202ba1,null))[_0x42e1('0x28')](saveUpdates(_0x18bfb3[_0x42e1('0x48')],null))[_0x42e1('0x28')](respondWithResult(_0x202ba1,null))[_0x42e1('0x45')](handleError(_0x202ba1,null));};exports[_0x42e1('0x4a')]=function(_0x47a23c,_0xc411a4){return db[_0x42e1('0x2e')][_0x42e1('0x46')]({'where':{'id':_0x47a23c[_0x42e1('0x49')]['id']}})[_0x42e1('0x28')](handleEntityNotFound(_0xc411a4,null))[_0x42e1('0x28')](removeEntity(_0xc411a4,null))[_0x42e1('0x45')](handleError(_0xc411a4,null));};exports[_0x42e1('0x4b')]=function(_0x7a63f5,_0x2bb13a){return db[_0x42e1('0x2e')][_0x42e1('0x4b')]()[_0x42e1('0x28')](respondWithResult(_0x2bb13a,null))['catch'](handleError(_0x2bb13a,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index e3cd5bf..6de69eb 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 _0x71a6=['lodash','util','api','bluebird','rimraf','../../config/environment','./integrationReport.attributes','exports','define','report_integration'];(function(_0x5e3cef,_0x3c57f5){var _0x34c370=function(_0x4bc3e4){while(--_0x4bc3e4){_0x5e3cef['push'](_0x5e3cef['shift']());}};_0x34c370(++_0x3c57f5);}(_0x71a6,0x6e));var _0x671a=function(_0x280c4b,_0xfe785d){_0x280c4b=_0x280c4b-0x0;var _0x2a5e90=_0x71a6[_0x280c4b];return _0x2a5e90;};'use strict';var _=require(_0x671a('0x0'));var util=require(_0x671a('0x1'));var logger=require('../../config/logger')(_0x671a('0x2'));var moment=require('moment');var BPromise=require(_0x671a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x671a('0x4'));var config=require(_0x671a('0x5'));var attributes=require(_0x671a('0x6'));module[_0x671a('0x7')]=function(_0x36089a,_0x4f7570){return _0x36089a[_0x671a('0x8')]('IntegrationReport',attributes,{'tableName':_0x671a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34a3=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','report_integration','lodash'];(function(_0x4a724f,_0x5b001a){var _0x35adab=function(_0x56298f){while(--_0x56298f){_0x4a724f['push'](_0x4a724f['shift']());}};_0x35adab(++_0x5b001a);}(_0x34a3,0xdf));var _0x334a=function(_0x3d0293,_0x3d3c80){_0x3d0293=_0x3d0293-0x0;var _0x5aa8d3=_0x34a3[_0x3d0293];return _0x5aa8d3;};'use strict';var _=require(_0x334a('0x0'));var util=require(_0x334a('0x1'));var logger=require(_0x334a('0x2'))(_0x334a('0x3'));var moment=require(_0x334a('0x4'));var BPromise=require(_0x334a('0x5'));var rp=require(_0x334a('0x6'));var fs=require('fs');var path=require(_0x334a('0x7'));var rimraf=require(_0x334a('0x8'));var config=require(_0x334a('0x9'));var attributes=require(_0x334a('0xa'));module[_0x334a('0xb')]=function(_0x4e2ee4,_0x3f6bdd){return _0x4e2ee4[_0x334a('0xc')]('IntegrationReport',attributes,{'tableName':_0x334a('0xd'),'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 cf3de0f..ae80293 100644 --- a/server/api/integrationReport/integrationReport.rpc.js +++ b/server/api/integrationReport/integrationReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x31f0=['../../config/environment','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0xe502ca,_0x1cc7cc){var _0x514270=function(_0x320cc9){while(--_0x320cc9){_0xe502ca['push'](_0xe502ca['shift']());}};_0x514270(++_0x1cc7cc);}(_0x31f0,0xb7));var _0x031f=function(_0x428b9f,_0x55d1ec){_0x428b9f=_0x428b9f-0x0;var _0x4added=_0x31f0[_0x428b9f];return _0x4added;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var moment=require(_0x031f('0x1'));var BPromise=require('bluebird');var rs=require(_0x031f('0x2'));var fs=require('fs');var Redis=require(_0x031f('0x3'));var db=require(_0x031f('0x4'))['db'];var utils=require(_0x031f('0x5'));var logger=require('../../config/logger')(_0x031f('0x6'));var config=require(_0x031f('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3dc98e,_0x487e65,_0x365f59){return new BPromise(function(_0x4300b4,_0x2569b6){return client[_0x031f('0x8')](_0x3dc98e,_0x365f59)['then'](function(_0x2e5624){logger[_0x031f('0x9')](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));logger[_0x031f('0xc')](_0x031f('0xd'),_0x487e65,_0x031f('0xb'),JSON[_0x031f('0xe')](_0x2e5624));if(_0x2e5624['error']){if(_0x2e5624[_0x031f('0xf')][_0x031f('0x10')]===0x1f4){logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x2569b6(_0x2e5624[_0x031f('0xf')]['message']);}logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x4300b4(_0x2e5624[_0x031f('0xf')]['message']);}else{logger['info'](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));_0x4300b4(_0x2e5624[_0x031f('0x12')][_0x031f('0x11')]);}})['catch'](function(_0x1dc4a7){logger[_0x031f('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x487e65,_0x1dc4a7);_0x2569b6(_0x1dc4a7);});});} \ No newline at end of file +var _0x187d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0xb91532,_0x24a317){var _0x5e6fc3=function(_0x419ead){while(--_0x419ead){_0xb91532['push'](_0xb91532['shift']());}};_0x5e6fc3(++_0x24a317);}(_0x187d,0x93));var _0xd187=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x187d[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var moment=require(_0xd187('0x1'));var BPromise=require(_0xd187('0x2'));var rs=require(_0xd187('0x3'));var fs=require('fs');var Redis=require(_0xd187('0x4'));var db=require(_0xd187('0x5'))['db'];var utils=require(_0xd187('0x6'));var logger=require('../../config/logger')(_0xd187('0x7'));var config=require(_0xd187('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd187('0x9')][_0xd187('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x444a60,_0x1d3fe4,_0x28ce2f){return new BPromise(function(_0x2d6992,_0x358c45){return client[_0xd187('0xb')](_0x444a60,_0x28ce2f)['then'](function(_0x342539){logger[_0xd187('0xc')](_0xd187('0xd'),_0x1d3fe4,_0xd187('0xe'));logger[_0xd187('0xf')](_0xd187('0x10'),_0x1d3fe4,'request\x20sent',JSON[_0xd187('0x11')](_0x342539));if(_0x342539[_0xd187('0x12')]){if(_0x342539[_0xd187('0x12')]['code']===0x1f4){logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539[_0xd187('0x12')]['message']);return _0x358c45(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539['error'][_0xd187('0x13')]);return _0x2d6992(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}else{logger[_0xd187('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x1d3fe4,_0xd187('0xe'));_0x2d6992(_0x342539['result']['message']);}})[_0xd187('0x14')](function(_0x5a4986){logger['error'](_0xd187('0xd'),_0x1d3fe4,_0x5a4986);_0x358c45(_0x5a4986);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 1d51a78..c741cda 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 _0x1c88=['addInterval','/:id/sub_intervals/create_many','put','update','destroy','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','post'];(function(_0xe326f9,_0x1ba5e0){var _0x260bb3=function(_0x2d8023){while(--_0x2d8023){_0xe326f9['push'](_0xe326f9['shift']());}};_0x260bb3(++_0x1ba5e0);}(_0x1c88,0x1a9));var _0x81c8=function(_0x482815,_0x3601b1){_0x482815=_0x482815-0x0;var _0x272d11=_0x1c88[_0x482815];return _0x272d11;};'use strict';var multer=require(_0x81c8('0x0'));var util=require('util');var path=require(_0x81c8('0x1'));var timeout=require(_0x81c8('0x2'));var express=require(_0x81c8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x81c8('0x4'));var interaction=require(_0x81c8('0x5'));var config=require(_0x81c8('0x6'));var controller=require(_0x81c8('0x7'));router[_0x81c8('0x8')]('/',auth[_0x81c8('0x9')](),controller[_0x81c8('0xa')]);router[_0x81c8('0x8')](_0x81c8('0xb'),auth[_0x81c8('0x9')](),controller[_0x81c8('0xc')]);router[_0x81c8('0x8')](_0x81c8('0xd'),auth['isAuthenticated'](),controller[_0x81c8('0xe')]);router[_0x81c8('0xf')]('/',auth[_0x81c8('0x9')](),controller['create']);router['post'](_0x81c8('0xd'),auth[_0x81c8('0x9')](),controller[_0x81c8('0x10')]);router['post'](_0x81c8('0x11'),auth[_0x81c8('0x9')](),controller['addIntervals']);router[_0x81c8('0x12')](_0x81c8('0xb'),auth[_0x81c8('0x9')](),controller[_0x81c8('0x13')]);router['delete'](_0x81c8('0xb'),auth[_0x81c8('0x9')](),controller[_0x81c8('0x14')]);module['exports']=router; \ No newline at end of file +var _0x7d9a=['../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','create','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x7d9a,0x1be));var _0xa7d9=function(_0x5ca841,_0x519f10){_0x5ca841=_0x5ca841-0x0;var _0x530c76=_0x7d9a[_0x5ca841];return _0x530c76;};'use strict';var multer=require(_0xa7d9('0x0'));var util=require(_0xa7d9('0x1'));var path=require('path');var timeout=require(_0xa7d9('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa7d9('0x3'));var auth=require(_0xa7d9('0x4'));var interaction=require(_0xa7d9('0x5'));var config=require(_0xa7d9('0x6'));var controller=require(_0xa7d9('0x7'));router[_0xa7d9('0x8')]('/',auth[_0xa7d9('0x9')](),controller[_0xa7d9('0xa')]);router[_0xa7d9('0x8')](_0xa7d9('0xb'),auth[_0xa7d9('0x9')](),controller[_0xa7d9('0xc')]);router[_0xa7d9('0x8')](_0xa7d9('0xd'),auth[_0xa7d9('0x9')](),controller[_0xa7d9('0xe')]);router['post']('/',auth[_0xa7d9('0x9')](),controller[_0xa7d9('0xf')]);router[_0xa7d9('0x10')](_0xa7d9('0xd'),auth[_0xa7d9('0x9')](),controller[_0xa7d9('0x11')]);router[_0xa7d9('0x10')](_0xa7d9('0x12'),auth[_0xa7d9('0x9')](),controller[_0xa7d9('0x13')]);router[_0xa7d9('0x14')](_0xa7d9('0xb'),auth[_0xa7d9('0x9')](),controller[_0xa7d9('0x15')]);router[_0xa7d9('0x16')](_0xa7d9('0xb'),auth[_0xa7d9('0x9')](),controller[_0xa7d9('0x17')]);module[_0xa7d9('0x18')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 08d3d24..f51e981 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 _0x825b=['sequelize','STRING'];(function(_0x4a6b9c,_0x53ac0f){var _0x1d9441=function(_0x30e3b2){while(--_0x30e3b2){_0x4a6b9c['push'](_0x4a6b9c['shift']());}};_0x1d9441(++_0x53ac0f);}(_0x825b,0x74));var _0xb825=function(_0x59bcb1,_0x5a4b6c){_0x59bcb1=_0x59bcb1-0x0;var _0x4a737f=_0x825b[_0x59bcb1];return _0x4a737f;};'use strict';var Sequelize=require(_0xb825('0x0'));module['exports']={'name':{'type':Sequelize[_0xb825('0x1')]},'description':{'type':Sequelize[_0xb825('0x1')]},'interval':{'type':Sequelize[_0xb825('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xefe1=['exports','STRING','sequelize'];(function(_0x447846,_0x421b70){var _0x12e7f9=function(_0x3217b1){while(--_0x3217b1){_0x447846['push'](_0x447846['shift']());}};_0x12e7f9(++_0x421b70);}(_0xefe1,0xd1));var _0x1efe=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xefe1[_0xaa0309];return _0x5de7ce;};'use strict';var Sequelize=require(_0x1efe('0x0'));module[_0x1efe('0x1')]={'name':{'type':Sequelize[_0x1efe('0x2')]},'description':{'type':Sequelize[_0x1efe('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 43c2f0c..6ab9ea5 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 _0xdb5d=['getIntervals','addIntervals','findOne','bulkCreate','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/extensions/rewrite','status','offset','undefined','limit','count','Content-Range','json','reject','save','then','destroy','get','Intervals','UserProfileResource','error','stack','name','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','Interval','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addInterval','IntervalId'];(function(_0x1f0a42,_0x1f8989){var _0x2255c4=function(_0x452613){while(--_0x452613){_0x1f0a42['push'](_0x1f0a42['shift']());}};_0x2255c4(++_0x1f8989);}(_0xdb5d,0xb2));var _0xddb5=function(_0x521ba7,_0x256357){_0x521ba7=_0x521ba7-0x0;var _0x5633b8=_0xdb5d[_0x521ba7];return _0x5633b8;};'use strict';var emlformat=require(_0xddb5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xddb5('0x1'));var jsonpatch=require(_0xddb5('0x2'));var rp=require('request-promise');var moment=require(_0xddb5('0x3'));var BPromise=require(_0xddb5('0x4'));var Mustache=require('mustache');var util=require(_0xddb5('0x5'));var path=require('path');var sox=require(_0xddb5('0x6'));var csv=require(_0xddb5('0x7'));var ejs=require(_0xddb5('0x8'));var fs=require('fs');var fs_extra=require(_0xddb5('0x9'));var _=require('lodash');var squel=require(_0xddb5('0xa'));var crypto=require(_0xddb5('0xb'));var jsforce=require(_0xddb5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xddb5('0x7'));var querystring=require(_0xddb5('0xd'));var Papa=require(_0xddb5('0xe'));var Redis=require('ioredis');var authService=require(_0xddb5('0xf'));var qs=require(_0xddb5('0x10'));var as=require(_0xddb5('0x11'));var hardwareService=require(_0xddb5('0x12'));var logger=require(_0xddb5('0x13'))(_0xddb5('0x14'));var utils=require(_0xddb5('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xddb5('0x16'))['db'];var extensions=require(_0xddb5('0x17'));function respondWithStatusCode(_0x4b13fc,_0x12b81c){_0x12b81c=_0x12b81c||0xcc;return function(_0x1e3ac0){if(_0x1e3ac0){return _0x4b13fc['sendStatus'](_0x12b81c);}return _0x4b13fc[_0xddb5('0x18')](_0x12b81c)['end']();};}function respondWithResult(_0x88b67c,_0x295762){_0x295762=_0x295762||0xc8;return function(_0xd7df75){if(_0xd7df75){return _0x88b67c['status'](_0x295762)['json'](_0xd7df75);}};}function respondWithFilteredResult(_0x40e65c,_0x2d3fee){return function(_0x158483){if(_0x158483){var _0x27aa32=typeof _0x2d3fee[_0xddb5('0x19')]===_0xddb5('0x1a')&&typeof _0x2d3fee[_0xddb5('0x1b')]===_0xddb5('0x1a');var _0x4a7199=_0x158483[_0xddb5('0x1c')];var _0x5c2c58=_0x27aa32?0x0:_0x2d3fee[_0xddb5('0x19')];var _0x545be2=_0x27aa32?_0x158483[_0xddb5('0x1c')]:_0x2d3fee[_0xddb5('0x19')]+_0x2d3fee[_0xddb5('0x1b')];var _0x1d24a9;if(_0x545be2>=_0x4a7199){_0x545be2=_0x4a7199;_0x1d24a9=0xc8;}else{_0x1d24a9=0xce;}_0x40e65c[_0xddb5('0x18')](_0x1d24a9);return _0x40e65c['set'](_0xddb5('0x1d'),_0x5c2c58+'-'+_0x545be2+'/'+_0x4a7199)[_0xddb5('0x1e')](_0x158483);}return null;};}function patchUpdates(_0x39cf3e){return function(_0x5aa1a8){try{jsonpatch['apply'](_0x5aa1a8,_0x39cf3e,!![]);}catch(_0xe61fac){return BPromise[_0xddb5('0x1f')](_0xe61fac);}return _0x5aa1a8[_0xddb5('0x20')]();};}function saveUpdates(_0x2f24d9,_0x6592e2){return function(_0x1250c5){if(_0x1250c5){return _0x1250c5['update'](_0x2f24d9)[_0xddb5('0x21')](function(_0x420b7a){return _0x420b7a;});}return null;};}function removeEntity(_0x31703e,_0x541d1c){return function(_0x28d077){if(_0x28d077){return _0x28d077[_0xddb5('0x22')]()[_0xddb5('0x21')](function(){var _0x520b33=_0x28d077[_0xddb5('0x23')]({'plain':!![]});var _0x28cb3c=_0xddb5('0x24');return db[_0xddb5('0x25')][_0xddb5('0x22')]({'where':{'type':_0x28cb3c,'resourceId':_0x520b33['id']}})[_0xddb5('0x21')](function(){return _0x28d077;});})[_0xddb5('0x21')](function(){_0x31703e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2a98,_0x15c214){return function(_0x46c402){if(!_0x46c402){_0x5e2a98['sendStatus'](0x194);}return _0x46c402;};}function handleError(_0x578998,_0x20a047){_0x20a047=_0x20a047||0x1f4;return function(_0x2b0106){logger[_0xddb5('0x26')](_0x2b0106[_0xddb5('0x27')]);if(_0x2b0106[_0xddb5('0x28')]){delete _0x2b0106['name'];}_0x578998[_0xddb5('0x18')](_0x20a047)['send'](_0x2b0106);};}exports[_0xddb5('0x29')]=function(_0x9152c8,_0x1d93cc){var _0x34aa02={},_0xc21549={},_0x51449e={'count':0x0,'rows':[]};var _0x2c3e44=_[_0xddb5('0x2a')](db['Interval'][_0xddb5('0x2b')],function(_0x1281d5){return{'name':_0x1281d5['fieldName'],'type':_0x1281d5[_0xddb5('0x2c')][_0xddb5('0x2d')]};});_0xc21549['model']=_[_0xddb5('0x2a')](_0x2c3e44,_0xddb5('0x28'));_0xc21549[_0xddb5('0x2e')]=_[_0xddb5('0x2f')](_0x9152c8['query']);_0xc21549[_0xddb5('0x30')]=_[_0xddb5('0x31')](_0xc21549[_0xddb5('0x32')],_0xc21549['query']);_0x34aa02[_0xddb5('0x33')]=_[_0xddb5('0x31')](_0xc21549['model'],qs[_0xddb5('0x34')](_0x9152c8[_0xddb5('0x2e')][_0xddb5('0x34')]));_0x34aa02[_0xddb5('0x33')]=_0x34aa02[_0xddb5('0x33')][_0xddb5('0x35')]?_0x34aa02[_0xddb5('0x33')]:_0xc21549[_0xddb5('0x32')];if(!_0x9152c8[_0xddb5('0x2e')][_0xddb5('0x36')](_0xddb5('0x37'))){_0x34aa02[_0xddb5('0x1b')]=qs['limit'](_0x9152c8[_0xddb5('0x2e')][_0xddb5('0x1b')]);_0x34aa02['offset']=qs[_0xddb5('0x19')](_0x9152c8['query'][_0xddb5('0x19')]);}_0x34aa02[_0xddb5('0x38')]=qs['sort'](_0x9152c8[_0xddb5('0x2e')][_0xddb5('0x39')]);_0x34aa02['where']=qs['filters'](_[_0xddb5('0x3a')](_0x9152c8[_0xddb5('0x2e')],_0xc21549[_0xddb5('0x30')]),_0x2c3e44);if(_0x9152c8[_0xddb5('0x2e')][_0xddb5('0x3b')]){_0x34aa02[_0xddb5('0x3c')]=_['merge'](_0x34aa02[_0xddb5('0x3c')],{'$or':_[_0xddb5('0x2a')](_0x2c3e44,function(_0x42e4ea){if(_0x42e4ea['type']!==_0xddb5('0x3d')){var _0x4b0c29={};_0x4b0c29[_0x42e4ea[_0xddb5('0x28')]]={'$like':'%'+_0x9152c8['query'][_0xddb5('0x3b')]+'%'};return _0x4b0c29;}})});}_0x34aa02=_[_0xddb5('0x3e')]({},_0x34aa02,_0x9152c8[_0xddb5('0x3f')]);var _0x2198c6={'where':_0x34aa02[_0xddb5('0x3c')]};return db[_0xddb5('0x40')][_0xddb5('0x1c')](_0x2198c6)[_0xddb5('0x21')](function(_0x30abf2){_0x51449e[_0xddb5('0x1c')]=_0x30abf2;if(_0x9152c8[_0xddb5('0x2e')]['includeAll']){_0x34aa02['include']=[{'all':!![]}];}return db[_0xddb5('0x40')][_0xddb5('0x41')](_0x34aa02);})[_0xddb5('0x21')](function(_0x7061cb){_0x51449e[_0xddb5('0x42')]=_0x7061cb;return _0x51449e;})['then'](respondWithFilteredResult(_0x1d93cc,_0x34aa02))[_0xddb5('0x43')](handleError(_0x1d93cc,null));};exports[_0xddb5('0x44')]=function(_0x58a918,_0x4b94dd){var _0x440343={'raw':!![],'where':{'id':_0x58a918[_0xddb5('0x45')]['id']}},_0x5d4f45={};_0x5d4f45[_0xddb5('0x32')]=_[_0xddb5('0x2f')](db[_0xddb5('0x40')][_0xddb5('0x2b')]);_0x5d4f45[_0xddb5('0x2e')]=_[_0xddb5('0x2f')](_0x58a918[_0xddb5('0x2e')]);_0x5d4f45[_0xddb5('0x30')]=_[_0xddb5('0x31')](_0x5d4f45[_0xddb5('0x32')],_0x5d4f45['query']);_0x440343[_0xddb5('0x33')]=_[_0xddb5('0x31')](_0x5d4f45[_0xddb5('0x32')],qs[_0xddb5('0x34')](_0x58a918[_0xddb5('0x2e')][_0xddb5('0x34')]));_0x440343['attributes']=_0x440343[_0xddb5('0x33')][_0xddb5('0x35')]?_0x440343[_0xddb5('0x33')]:_0x5d4f45[_0xddb5('0x32')];if(_0x58a918[_0xddb5('0x2e')]['includeAll']){_0x440343[_0xddb5('0x46')]=[{'all':!![]}];}_0x440343=_[_0xddb5('0x3e')]({},_0x440343,_0x58a918['options']);return db[_0xddb5('0x40')][_0xddb5('0x47')](_0x440343)['then'](handleEntityNotFound(_0x4b94dd,null))[_0xddb5('0x21')](respondWithResult(_0x4b94dd,null))[_0xddb5('0x43')](handleError(_0x4b94dd,null));};exports['create']=function(_0x26bb60,_0x492445){return db[_0xddb5('0x40')][_0xddb5('0x48')](_0x26bb60[_0xddb5('0x49')],{})[_0xddb5('0x21')](function(_0x317648){var _0x4d012c=_0x26bb60[_0xddb5('0x4a')][_0xddb5('0x23')]({'plain':!![]});if(!_0x4d012c)throw new Error(_0xddb5('0x4b'));if(_0x4d012c[_0xddb5('0x4c')]===_0xddb5('0x4a')){var _0x44605e=_0x317648[_0xddb5('0x23')]({'plain':!![]});var _0x36abbd=_0xddb5('0x24');return db[_0xddb5('0x4d')]['find']({'where':{'name':_0x36abbd,'userProfileId':_0x4d012c[_0xddb5('0x4e')]},'raw':!![]})['then'](function(_0x344d50){if(_0x344d50&&_0x344d50['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x44605e['name'],'resourceId':_0x44605e['id'],'type':_0x344d50['name'],'sectionId':_0x344d50['id']},{})['then'](function(){return _0x317648;});}else{return _0x317648;}})[_0xddb5('0x43')](function(_0x4ea473){logger[_0xddb5('0x26')](_0xddb5('0x4f'),_0x4ea473);throw _0x4ea473;});}return _0x317648;})['then'](respondWithResult(_0x492445,0xc9))[_0xddb5('0x43')](handleError(_0x492445,null));};exports[_0xddb5('0x50')]=function(_0x1c07ac,_0x3f57b5){if(_0x1c07ac['body']['id']){delete _0x1c07ac[_0xddb5('0x49')]['id'];}return db['Interval']['find']({'where':{'id':_0x1c07ac[_0xddb5('0x45')]['id']}})[_0xddb5('0x21')](handleEntityNotFound(_0x3f57b5,null))[_0xddb5('0x21')](saveUpdates(_0x1c07ac['body'],null))['then'](respondWithResult(_0x3f57b5,null))[_0xddb5('0x43')](handleError(_0x3f57b5,null));};exports[_0xddb5('0x22')]=function(_0x2a168e,_0xdb7b59){return db['Interval'][_0xddb5('0x47')]({'where':{'id':_0x2a168e[_0xddb5('0x45')]['id']}})[_0xddb5('0x21')](handleEntityNotFound(_0xdb7b59,null))[_0xddb5('0x21')](removeEntity(_0xdb7b59,null))[_0xddb5('0x43')](handleError(_0xdb7b59,null));};exports[_0xddb5('0x51')]=function(_0x358a73,_0x21c07a,_0x47c9d2){if(_0x358a73[_0xddb5('0x49')]['id']){delete _0x358a73['body']['id'];}return db['Interval'][_0xddb5('0x47')]({'where':{'id':_0x358a73[_0xddb5('0x45')]['id']}})[_0xddb5('0x21')](handleEntityNotFound(_0x21c07a,null))[_0xddb5('0x21')](function(_0x1b73eb){if(_0x1b73eb){_0x358a73[_0xddb5('0x49')][_0xddb5('0x52')]=_0x1b73eb['id'];return db[_0xddb5('0x40')]['create'](_0x358a73['body']);}})[_0xddb5('0x21')](respondWithResult(_0x21c07a,null))[_0xddb5('0x43')](handleError(_0x21c07a,null));};exports[_0xddb5('0x53')]=function(_0x373191,_0x4a8673,_0x2cc920){var _0x40d7da={};var _0x19840d={};var _0x203dc5;var _0x16c0d2;return db[_0xddb5('0x40')]['findOne']({'where':{'id':_0x373191['params']['id']}})[_0xddb5('0x21')](handleEntityNotFound(_0x4a8673,null))[_0xddb5('0x21')](function(_0x43a4d0){if(_0x43a4d0){_0x203dc5=_0x43a4d0;_0x19840d[_0xddb5('0x32')]=_[_0xddb5('0x2f')](db['Interval']['rawAttributes']);_0x19840d[_0xddb5('0x2e')]=_['keys'](_0x373191[_0xddb5('0x2e')]);_0x19840d[_0xddb5('0x30')]=_[_0xddb5('0x31')](_0x19840d[_0xddb5('0x32')],_0x19840d[_0xddb5('0x2e')]);_0x40d7da[_0xddb5('0x33')]=_[_0xddb5('0x31')](_0x19840d['model'],qs['fields'](_0x373191['query'][_0xddb5('0x34')]));_0x40d7da[_0xddb5('0x33')]=_0x40d7da[_0xddb5('0x33')][_0xddb5('0x35')]?_0x40d7da['attributes']:_0x19840d['model'];_0x40d7da[_0xddb5('0x38')]=qs[_0xddb5('0x39')](_0x373191[_0xddb5('0x2e')][_0xddb5('0x39')]);_0x40d7da[_0xddb5('0x3c')]=qs[_0xddb5('0x30')](_['pick'](_0x373191['query'],_0x19840d[_0xddb5('0x30')]));if(_0x373191[_0xddb5('0x2e')][_0xddb5('0x3b')]){_0x40d7da[_0xddb5('0x3c')]=_[_0xddb5('0x3e')](_0x40d7da[_0xddb5('0x3c')],{'$or':_[_0xddb5('0x2a')](_0x40d7da[_0xddb5('0x33')],function(_0x23083c){var _0x23545b={};_0x23545b[_0x23083c]={'$like':'%'+_0x373191[_0xddb5('0x2e')][_0xddb5('0x3b')]+'%'};return _0x23545b;})});}_0x40d7da=_[_0xddb5('0x3e')]({},_0x40d7da,_0x373191[_0xddb5('0x3f')]);return _0x203dc5['getIntervals'](_0x40d7da);}})['then'](function(_0x1398fd){if(_0x1398fd){_0x16c0d2=_0x1398fd[_0xddb5('0x35')];if(!_0x373191[_0xddb5('0x2e')]['hasOwnProperty']('nolimit')){_0x40d7da[_0xddb5('0x1b')]=qs[_0xddb5('0x1b')](_0x373191[_0xddb5('0x2e')][_0xddb5('0x1b')]);_0x40d7da[_0xddb5('0x19')]=qs[_0xddb5('0x19')](_0x373191[_0xddb5('0x2e')][_0xddb5('0x19')]);}return _0x203dc5[_0xddb5('0x53')](_0x40d7da);}})[_0xddb5('0x21')](function(_0x481092){if(_0x481092){return _0x481092?{'count':_0x16c0d2,'rows':_0x481092}:null;}})[_0xddb5('0x21')](respondWithResult(_0x4a8673,null))['catch'](handleError(_0x4a8673,null));};exports[_0xddb5('0x54')]=function(_0x559a62,_0x25d768,_0xef3dca){return db[_0xddb5('0x40')][_0xddb5('0x55')]({'where':{'id':_0x559a62['params']['id']}})[_0xddb5('0x21')](handleEntityNotFound(_0x25d768,null))[_0xddb5('0x21')](function(_0x43efa1){if(_0x43efa1){return db['sequelize']['transaction'](function(_0x2786bd){return db[_0xddb5('0x40')][_0xddb5('0x22')]({'where':{'IntervalId':_0x559a62['params']['id']},'transaction':_0x2786bd})['then'](function(_0x25f17a){var _0x14a57c=_[_0xddb5('0x2a')](_0x559a62[_0xddb5('0x49')],function(_0x5791ae){delete _0x5791ae['id'];_0x5791ae[_0xddb5('0x52')]=_0x559a62[_0xddb5('0x45')]['id'];return _0x5791ae;});return db[_0xddb5('0x40')][_0xddb5('0x56')](_0x14a57c,{'transaction':_0x2786bd});});})[_0xddb5('0x21')](function(){return db[_0xddb5('0x40')][_0xddb5('0x41')]({'where':{'IntervalId':_0x559a62[_0xddb5('0x45')]['id']}});});}})[_0xddb5('0x21')](respondWithResult(_0x25d768,null))[_0xddb5('0x43')](handleError(_0x25d768,null));}; \ No newline at end of file +var _0x75b8=['../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','name','send','index','map','Interval','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','role','user','Intervals','UserProfileSection','userProfileId','autoAssociation','IntervalId','findOne','sort','getIntervals','addIntervals','sequelize','transaction','bulkCreate','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x43d0dd,_0x1bd3d2){var _0x233879=function(_0x4461ef){while(--_0x4461ef){_0x43d0dd['push'](_0x43d0dd['shift']());}};_0x233879(++_0x1bd3d2);}(_0x75b8,0x158));var _0x875b=function(_0x1ccb95,_0x1b3be8){_0x1ccb95=_0x1ccb95-0x0;var _0x1a9725=_0x75b8[_0x1ccb95];return _0x1a9725;};'use strict';var emlformat=require(_0x875b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x875b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x875b('0x2'));var moment=require(_0x875b('0x3'));var BPromise=require(_0x875b('0x4'));var Mustache=require(_0x875b('0x5'));var util=require(_0x875b('0x6'));var path=require(_0x875b('0x7'));var sox=require(_0x875b('0x8'));var csv=require(_0x875b('0x9'));var ejs=require(_0x875b('0xa'));var fs=require('fs');var fs_extra=require(_0x875b('0xb'));var _=require(_0x875b('0xc'));var squel=require(_0x875b('0xd'));var crypto=require(_0x875b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x875b('0xf'));var toCsv=require(_0x875b('0x9'));var querystring=require('querystring');var Papa=require(_0x875b('0x10'));var Redis=require(_0x875b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x875b('0x12'));var as=require(_0x875b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x875b('0x14'))('api');var utils=require(_0x875b('0x15'));var config=require(_0x875b('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x383bcc,_0x54b9e9){_0x54b9e9=_0x54b9e9||0xcc;return function(_0x3f122a){if(_0x3f122a){return _0x383bcc[_0x875b('0x17')](_0x54b9e9);}return _0x383bcc[_0x875b('0x18')](_0x54b9e9)[_0x875b('0x19')]();};}function respondWithResult(_0x4fc51e,_0x43ecfa){_0x43ecfa=_0x43ecfa||0xc8;return function(_0x2d5c57){if(_0x2d5c57){return _0x4fc51e[_0x875b('0x18')](_0x43ecfa)[_0x875b('0x1a')](_0x2d5c57);}};}function respondWithFilteredResult(_0x3a693d,_0x781eab){return function(_0x1915e1){if(_0x1915e1){var _0x9f676a=typeof _0x781eab[_0x875b('0x1b')]==='undefined'&&typeof _0x781eab[_0x875b('0x1c')]===_0x875b('0x1d');var _0x1a0382=_0x1915e1['count'];var _0x27b588=_0x9f676a?0x0:_0x781eab[_0x875b('0x1b')];var _0x5dcf78=_0x9f676a?_0x1915e1[_0x875b('0x1e')]:_0x781eab['offset']+_0x781eab['limit'];var _0x1fb069;if(_0x5dcf78>=_0x1a0382){_0x5dcf78=_0x1a0382;_0x1fb069=0xc8;}else{_0x1fb069=0xce;}_0x3a693d[_0x875b('0x18')](_0x1fb069);return _0x3a693d[_0x875b('0x1f')](_0x875b('0x20'),_0x27b588+'-'+_0x5dcf78+'/'+_0x1a0382)[_0x875b('0x1a')](_0x1915e1);}return null;};}function patchUpdates(_0x4b354f){return function(_0x1c5e73){try{jsonpatch[_0x875b('0x21')](_0x1c5e73,_0x4b354f,!![]);}catch(_0x593f97){return BPromise['reject'](_0x593f97);}return _0x1c5e73[_0x875b('0x22')]();};}function saveUpdates(_0x455cd5,_0x1b9a1c){return function(_0x360a63){if(_0x360a63){return _0x360a63[_0x875b('0x23')](_0x455cd5)[_0x875b('0x24')](function(_0x74d840){return _0x74d840;});}return null;};}function removeEntity(_0x465ccd,_0x56b0f1){return function(_0x3d68a8){if(_0x3d68a8){return _0x3d68a8[_0x875b('0x25')]()[_0x875b('0x24')](function(){var _0xce8b73=_0x3d68a8[_0x875b('0x26')]({'plain':!![]});var _0x5aee99='Intervals';return db[_0x875b('0x27')][_0x875b('0x25')]({'where':{'type':_0x5aee99,'resourceId':_0xce8b73['id']}})[_0x875b('0x24')](function(){return _0x3d68a8;});})[_0x875b('0x24')](function(){_0x465ccd[_0x875b('0x18')](0xcc)[_0x875b('0x19')]();});}};}function handleEntityNotFound(_0x264d01,_0x2b2289){return function(_0x1494f6){if(!_0x1494f6){_0x264d01[_0x875b('0x17')](0x194);}return _0x1494f6;};}function handleError(_0x2fb98f,_0x45a1e4){_0x45a1e4=_0x45a1e4||0x1f4;return function(_0x8b66d8){logger[_0x875b('0x28')](_0x8b66d8['stack']);if(_0x8b66d8[_0x875b('0x29')]){delete _0x8b66d8[_0x875b('0x29')];}_0x2fb98f[_0x875b('0x18')](_0x45a1e4)[_0x875b('0x2a')](_0x8b66d8);};}exports[_0x875b('0x2b')]=function(_0x43f2d3,_0x1876f8){var _0x18545a={},_0x54a1e5={},_0x31a758={'count':0x0,'rows':[]};var _0x5840f5=_[_0x875b('0x2c')](db[_0x875b('0x2d')][_0x875b('0x2e')],function(_0xa1daa6){return{'name':_0xa1daa6[_0x875b('0x2f')],'type':_0xa1daa6[_0x875b('0x30')][_0x875b('0x31')]};});_0x54a1e5['model']=_[_0x875b('0x2c')](_0x5840f5,'name');_0x54a1e5[_0x875b('0x32')]=_[_0x875b('0x33')](_0x43f2d3[_0x875b('0x32')]);_0x54a1e5[_0x875b('0x34')]=_[_0x875b('0x35')](_0x54a1e5[_0x875b('0x36')],_0x54a1e5[_0x875b('0x32')]);_0x18545a[_0x875b('0x37')]=_['intersection'](_0x54a1e5[_0x875b('0x36')],qs[_0x875b('0x38')](_0x43f2d3['query'][_0x875b('0x38')]));_0x18545a[_0x875b('0x37')]=_0x18545a[_0x875b('0x37')]['length']?_0x18545a[_0x875b('0x37')]:_0x54a1e5[_0x875b('0x36')];if(!_0x43f2d3[_0x875b('0x32')][_0x875b('0x39')](_0x875b('0x3a'))){_0x18545a[_0x875b('0x1c')]=qs[_0x875b('0x1c')](_0x43f2d3[_0x875b('0x32')][_0x875b('0x1c')]);_0x18545a[_0x875b('0x1b')]=qs[_0x875b('0x1b')](_0x43f2d3[_0x875b('0x32')][_0x875b('0x1b')]);}_0x18545a[_0x875b('0x3b')]=qs['sort'](_0x43f2d3[_0x875b('0x32')]['sort']);_0x18545a[_0x875b('0x3c')]=qs[_0x875b('0x34')](_[_0x875b('0x3d')](_0x43f2d3['query'],_0x54a1e5[_0x875b('0x34')]),_0x5840f5);if(_0x43f2d3[_0x875b('0x32')][_0x875b('0x3e')]){_0x18545a[_0x875b('0x3c')]=_[_0x875b('0x3f')](_0x18545a['where'],{'$or':_[_0x875b('0x2c')](_0x5840f5,function(_0x204831){if(_0x204831[_0x875b('0x30')]!==_0x875b('0x40')){var _0x356415={};_0x356415[_0x204831[_0x875b('0x29')]]={'$like':'%'+_0x43f2d3[_0x875b('0x32')][_0x875b('0x3e')]+'%'};return _0x356415;}})});}_0x18545a=_['merge']({},_0x18545a,_0x43f2d3[_0x875b('0x41')]);var _0x28a721={'where':_0x18545a['where']};return db[_0x875b('0x2d')][_0x875b('0x1e')](_0x28a721)['then'](function(_0x1d6ed8){_0x31a758[_0x875b('0x1e')]=_0x1d6ed8;if(_0x43f2d3[_0x875b('0x32')][_0x875b('0x42')]){_0x18545a['include']=[{'all':!![]}];}return db[_0x875b('0x2d')][_0x875b('0x43')](_0x18545a);})[_0x875b('0x24')](function(_0x1d85c0){_0x31a758[_0x875b('0x44')]=_0x1d85c0;return _0x31a758;})[_0x875b('0x24')](respondWithFilteredResult(_0x1876f8,_0x18545a))[_0x875b('0x45')](handleError(_0x1876f8,null));};exports[_0x875b('0x46')]=function(_0x36a9ca,_0x7aaf13){var _0x3aab8d={'raw':!![],'where':{'id':_0x36a9ca[_0x875b('0x47')]['id']}},_0x142e14={};_0x142e14[_0x875b('0x36')]=_[_0x875b('0x33')](db[_0x875b('0x2d')][_0x875b('0x2e')]);_0x142e14[_0x875b('0x32')]=_['keys'](_0x36a9ca[_0x875b('0x32')]);_0x142e14[_0x875b('0x34')]=_[_0x875b('0x35')](_0x142e14['model'],_0x142e14[_0x875b('0x32')]);_0x3aab8d[_0x875b('0x37')]=_[_0x875b('0x35')](_0x142e14[_0x875b('0x36')],qs[_0x875b('0x38')](_0x36a9ca[_0x875b('0x32')][_0x875b('0x38')]));_0x3aab8d[_0x875b('0x37')]=_0x3aab8d[_0x875b('0x37')][_0x875b('0x48')]?_0x3aab8d['attributes']:_0x142e14['model'];if(_0x36a9ca[_0x875b('0x32')][_0x875b('0x42')]){_0x3aab8d[_0x875b('0x49')]=[{'all':!![]}];}_0x3aab8d=_[_0x875b('0x3f')]({},_0x3aab8d,_0x36a9ca['options']);return db[_0x875b('0x2d')][_0x875b('0x4a')](_0x3aab8d)[_0x875b('0x24')](handleEntityNotFound(_0x7aaf13,null))['then'](respondWithResult(_0x7aaf13,null))[_0x875b('0x45')](handleError(_0x7aaf13,null));};exports['create']=function(_0x5a900a,_0x50ead8){return db[_0x875b('0x2d')][_0x875b('0x4b')](_0x5a900a[_0x875b('0x4c')],{})[_0x875b('0x24')](function(_0x772a2b){var _0x50d6c5=_0x5a900a['user'][_0x875b('0x26')]({'plain':!![]});if(!_0x50d6c5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x50d6c5[_0x875b('0x4d')]===_0x875b('0x4e')){var _0x2bcfd5=_0x772a2b['get']({'plain':!![]});var _0xb59799=_0x875b('0x4f');return db[_0x875b('0x50')][_0x875b('0x4a')]({'where':{'name':_0xb59799,'userProfileId':_0x50d6c5[_0x875b('0x51')]},'raw':!![]})[_0x875b('0x24')](function(_0x340487){if(_0x340487&&_0x340487[_0x875b('0x52')]===0x0){return db[_0x875b('0x27')][_0x875b('0x4b')]({'name':_0x2bcfd5[_0x875b('0x29')],'resourceId':_0x2bcfd5['id'],'type':_0x340487['name'],'sectionId':_0x340487['id']},{})[_0x875b('0x24')](function(){return _0x772a2b;});}else{return _0x772a2b;}})['catch'](function(_0x2f9a4e){logger[_0x875b('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f9a4e);throw _0x2f9a4e;});}return _0x772a2b;})[_0x875b('0x24')](respondWithResult(_0x50ead8,0xc9))[_0x875b('0x45')](handleError(_0x50ead8,null));};exports[_0x875b('0x23')]=function(_0x814eb0,_0x4135b1){if(_0x814eb0[_0x875b('0x4c')]['id']){delete _0x814eb0['body']['id'];}return db[_0x875b('0x2d')][_0x875b('0x4a')]({'where':{'id':_0x814eb0[_0x875b('0x47')]['id']}})[_0x875b('0x24')](handleEntityNotFound(_0x4135b1,null))[_0x875b('0x24')](saveUpdates(_0x814eb0['body'],null))['then'](respondWithResult(_0x4135b1,null))[_0x875b('0x45')](handleError(_0x4135b1,null));};exports[_0x875b('0x25')]=function(_0x50bb8f,_0x19b629){return db[_0x875b('0x2d')][_0x875b('0x4a')]({'where':{'id':_0x50bb8f['params']['id']}})[_0x875b('0x24')](handleEntityNotFound(_0x19b629,null))[_0x875b('0x24')](removeEntity(_0x19b629,null))[_0x875b('0x45')](handleError(_0x19b629,null));};exports['addInterval']=function(_0x15872f,_0x1a5b0c,_0x2a08d1){if(_0x15872f[_0x875b('0x4c')]['id']){delete _0x15872f[_0x875b('0x4c')]['id'];}return db['Interval'][_0x875b('0x4a')]({'where':{'id':_0x15872f[_0x875b('0x47')]['id']}})[_0x875b('0x24')](handleEntityNotFound(_0x1a5b0c,null))[_0x875b('0x24')](function(_0x42bcd7){if(_0x42bcd7){_0x15872f[_0x875b('0x4c')][_0x875b('0x53')]=_0x42bcd7['id'];return db[_0x875b('0x2d')][_0x875b('0x4b')](_0x15872f[_0x875b('0x4c')]);}})[_0x875b('0x24')](respondWithResult(_0x1a5b0c,null))['catch'](handleError(_0x1a5b0c,null));};exports['getIntervals']=function(_0x44ae59,_0x338d91,_0x57aace){var _0x51e03e={};var _0x423868={};var _0x2c8714;var _0x55a78c;return db[_0x875b('0x2d')][_0x875b('0x54')]({'where':{'id':_0x44ae59[_0x875b('0x47')]['id']}})['then'](handleEntityNotFound(_0x338d91,null))[_0x875b('0x24')](function(_0xef9106){if(_0xef9106){_0x2c8714=_0xef9106;_0x423868[_0x875b('0x36')]=_[_0x875b('0x33')](db[_0x875b('0x2d')][_0x875b('0x2e')]);_0x423868[_0x875b('0x32')]=_[_0x875b('0x33')](_0x44ae59[_0x875b('0x32')]);_0x423868[_0x875b('0x34')]=_[_0x875b('0x35')](_0x423868[_0x875b('0x36')],_0x423868[_0x875b('0x32')]);_0x51e03e['attributes']=_[_0x875b('0x35')](_0x423868[_0x875b('0x36')],qs[_0x875b('0x38')](_0x44ae59['query']['fields']));_0x51e03e[_0x875b('0x37')]=_0x51e03e[_0x875b('0x37')][_0x875b('0x48')]?_0x51e03e['attributes']:_0x423868['model'];_0x51e03e[_0x875b('0x3b')]=qs[_0x875b('0x55')](_0x44ae59[_0x875b('0x32')]['sort']);_0x51e03e['where']=qs['filters'](_['pick'](_0x44ae59[_0x875b('0x32')],_0x423868[_0x875b('0x34')]));if(_0x44ae59[_0x875b('0x32')]['filter']){_0x51e03e[_0x875b('0x3c')]=_[_0x875b('0x3f')](_0x51e03e[_0x875b('0x3c')],{'$or':_[_0x875b('0x2c')](_0x51e03e[_0x875b('0x37')],function(_0x317f5b){var _0x4ed5a4={};_0x4ed5a4[_0x317f5b]={'$like':'%'+_0x44ae59['query'][_0x875b('0x3e')]+'%'};return _0x4ed5a4;})});}_0x51e03e=_['merge']({},_0x51e03e,_0x44ae59[_0x875b('0x41')]);return _0x2c8714[_0x875b('0x56')](_0x51e03e);}})['then'](function(_0x2a8835){if(_0x2a8835){_0x55a78c=_0x2a8835['length'];if(!_0x44ae59[_0x875b('0x32')][_0x875b('0x39')](_0x875b('0x3a'))){_0x51e03e[_0x875b('0x1c')]=qs[_0x875b('0x1c')](_0x44ae59[_0x875b('0x32')][_0x875b('0x1c')]);_0x51e03e[_0x875b('0x1b')]=qs[_0x875b('0x1b')](_0x44ae59['query'][_0x875b('0x1b')]);}return _0x2c8714['getIntervals'](_0x51e03e);}})[_0x875b('0x24')](function(_0x282bf2){if(_0x282bf2){return _0x282bf2?{'count':_0x55a78c,'rows':_0x282bf2}:null;}})[_0x875b('0x24')](respondWithResult(_0x338d91,null))[_0x875b('0x45')](handleError(_0x338d91,null));};exports[_0x875b('0x57')]=function(_0x2c6fd8,_0x135d12,_0x415f0d){return db[_0x875b('0x2d')][_0x875b('0x54')]({'where':{'id':_0x2c6fd8[_0x875b('0x47')]['id']}})[_0x875b('0x24')](handleEntityNotFound(_0x135d12,null))['then'](function(_0x3229b7){if(_0x3229b7){return db[_0x875b('0x58')][_0x875b('0x59')](function(_0x256e3c){return db['Interval'][_0x875b('0x25')]({'where':{'IntervalId':_0x2c6fd8[_0x875b('0x47')]['id']},'transaction':_0x256e3c})['then'](function(_0xb683d5){var _0x166014=_[_0x875b('0x2c')](_0x2c6fd8[_0x875b('0x4c')],function(_0x58f9f9){delete _0x58f9f9['id'];_0x58f9f9[_0x875b('0x53')]=_0x2c6fd8[_0x875b('0x47')]['id'];return _0x58f9f9;});return db[_0x875b('0x2d')][_0x875b('0x5a')](_0x166014,{'transaction':_0x256e3c});});})['then'](function(){return db[_0x875b('0x2d')][_0x875b('0x43')]({'where':{'IntervalId':_0x2c6fd8['params']['id']}});});}})[_0x875b('0x24')](respondWithResult(_0x135d12,null))[_0x875b('0x45')](handleError(_0x135d12,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index ee21909..fd076ef 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 _0x3245=['Interval','rewrite','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./interval.attributes'];(function(_0x38841c,_0x1af0bf){var _0x500610=function(_0x225955){while(--_0x225955){_0x38841c['push'](_0x38841c['shift']());}};_0x500610(++_0x1af0bf);}(_0x3245,0x14c));var _0x5324=function(_0x60b4b5,_0x4b9f3c){_0x60b4b5=_0x60b4b5-0x0;var _0x5ce041=_0x3245[_0x60b4b5];return _0x5ce041;};'use strict';var _=require(_0x5324('0x0'));var util=require(_0x5324('0x1'));var logger=require(_0x5324('0x2'))('api');var moment=require(_0x5324('0x3'));var BPromise=require('bluebird');var rp=require(_0x5324('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5324('0x5'));var config=require(_0x5324('0x6'));var attributes=require(_0x5324('0x7'));var extensions=require('../../components/extensions/rewrite');module['exports']=function(_0x5a8d46,_0x1c846b){return _0x5a8d46['define'](_0x5324('0x8'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5b8b09,_0x288300){extensions[_0x5324('0x9')](_0x5a8d46,_0x5b8b09);},'afterBulkCreate':function(_0x5df632,_0x78943b,_0x4e034d){_0x4e034d();extensions[_0x5324('0x9')](_0x5a8d46,_0x5df632[0x0]);},'afterUpdate':function(_0x3a3f53,_0x47e873){extensions[_0x5324('0x9')](_0x5a8d46,_0x3a3f53);},'afterDestroy':function(_0x1c638f,_0x247d09){extensions[_0x5324('0x9')](_0x5a8d46,_0x1c638f);}}});}; \ No newline at end of file +var _0xb565=['rewrite','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','exports','define','tools_intervals'];(function(_0x5bf3fe,_0x2f2ad0){var _0x586637=function(_0x57e785){while(--_0x57e785){_0x5bf3fe['push'](_0x5bf3fe['shift']());}};_0x586637(++_0x2f2ad0);}(_0xb565,0x1ef));var _0x5b56=function(_0x3b0d98,_0x346f06){_0x3b0d98=_0x3b0d98-0x0;var _0x296885=_0xb565[_0x3b0d98];return _0x296885;};'use strict';var _=require(_0x5b56('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5b56('0x1'));var moment=require(_0x5b56('0x2'));var BPromise=require(_0x5b56('0x3'));var rp=require(_0x5b56('0x4'));var fs=require('fs');var path=require(_0x5b56('0x5'));var rimraf=require(_0x5b56('0x6'));var config=require(_0x5b56('0x7'));var attributes=require(_0x5b56('0x8'));var extensions=require('../../components/extensions/rewrite');module[_0x5b56('0x9')]=function(_0x2debac,_0x7cdc0d){return _0x2debac[_0x5b56('0xa')]('Interval',attributes,{'tableName':_0x5b56('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3507d4,_0x181ff1){extensions['rewrite'](_0x2debac,_0x3507d4);},'afterBulkCreate':function(_0x5793f1,_0x425849,_0x2d12ef){_0x2d12ef();extensions['rewrite'](_0x2debac,_0x5793f1[0x0]);},'afterUpdate':function(_0x416cb5,_0x3a4ba8){extensions[_0x5b56('0xc')](_0x2debac,_0x416cb5);},'afterDestroy':function(_0x12fcb1,_0x534bab){extensions[_0x5b56('0xc')](_0x2debac,_0x12fcb1);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 76d77eb..ebed9bf 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(_0x213518,_0x51e022){var _0x1baf75=function(_0x5c8444){while(--_0x5c8444){_0x213518['push'](_0x213518['shift']());}};_0x1baf75(++_0x51e022);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x7a3247,_0x15cb12){var _0x1bfde5=function(_0x62bbef){while(--_0x62bbef){_0x7a3247['push'](_0x7a3247['shift']());}};_0x1bfde5(++_0x15cb12);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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 b10897e..a43da1f 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 _0xb10b=['./jira.controller','post','send','exports','express','../../components/auth/service'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xb10b,0x12a));var _0xbb10=function(_0x53915d,_0x1daa70){_0x53915d=_0x53915d-0x0;var _0x11e040=_0xb10b[_0x53915d];return _0x11e040;};'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 +var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x380331,_0x1ae325){var _0x5da18d=function(_0x2bc21d){while(--_0x2bc21d){_0x380331['push'](_0x380331['shift']());}};_0x5da18d(++_0x1ae325);}(_0xdb28,0x106));var _0x8db2=function(_0x1195fd,_0x1e8901){_0x1195fd=_0x1195fd-0x0;var _0x142238=_0xdb28[_0x1195fd];return _0x142238;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index aa3eb2c..676c91f 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 _0x6527=['customfield_11503','name','customfield_11504','reason','customfield_10102','/rest/api/2/issue','POST','application/json','request','setEncoding','utf8','end','status','statusCode','json','parse','error','api.jira','write','openIssue','send','body','x-forwarded-for','connection','socket','remoteAddress','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','MOTGUI','summary','Report','\x20from\x20','stringify','Bug','fields','customfield_11500','email','customfield_11501','customfield_11502','newToken'];(function(_0x217f48,_0x17ab7b){var _0x148271=function(_0x50d7de){while(--_0x50d7de){_0x217f48['push'](_0x217f48['shift']());}};_0x148271(++_0x17ab7b);}(_0x6527,0xca));var _0x7652=function(_0x2c9620,_0x1e704e){_0x2c9620=_0x2c9620-0x0;var _0x5d0103=_0x6527[_0x2c9620];return _0x5d0103;};'use strict';var BPromise=require(_0x7652('0x0'));var https=require(_0x7652('0x1'));var logger=require(_0x7652('0x2'))(_0x7652('0x3'));var USERNAME=_0x7652('0x4');var PASSWORD=_0x7652('0x5');function openIssue(_0x45878c,_0x438f82){var _0x4f73c1={'fields':{'project':{'key':_0x45878c['key']||_0x7652('0x6')},'summary':(_0x45878c[_0x7652('0x7')]||_0x7652('0x8'))+_0x7652('0x9')+_0x45878c['ip'],'description':_0x45878c['description']||JSON[_0x7652('0xa')](_0x45878c),'issuetype':{'name':_0x45878c['issuetype']||_0x7652('0xb')}}};_0x4f73c1[_0x7652('0xc')][_0x7652('0xd')]=_0x45878c[_0x7652('0xe')];_0x4f73c1[_0x7652('0xc')][_0x7652('0xf')]=_0x45878c['oldToken'];_0x4f73c1['fields'][_0x7652('0x10')]=_0x45878c[_0x7652('0x11')];_0x4f73c1['fields'][_0x7652('0x12')]=_0x45878c[_0x7652('0x13')];_0x4f73c1[_0x7652('0xc')][_0x7652('0x14')]=_0x45878c[_0x7652('0x15')];_0x4f73c1['fields'][_0x7652('0x16')]=_0x45878c['ip'];var _0x36b24f={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x7652('0x17'),'method':_0x7652('0x18'),'timeout':0x4e20,'headers':{'Content-Type':_0x7652('0x19'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString']('base64')}};var _0x18a348=JSON[_0x7652('0xa')](_0x4f73c1);var _0x59af75=https[_0x7652('0x1a')](_0x36b24f,function(_0x56d5f8){_0x56d5f8[_0x7652('0x1b')](_0x7652('0x1c'));var _0x3e1eb3='';_0x56d5f8['on']('data',function(_0xb48665){_0x3e1eb3+=_0xb48665;});_0x56d5f8['on'](_0x7652('0x1d'),function(){if(_0x438f82){return _0x438f82[_0x7652('0x1e')](_0x56d5f8[_0x7652('0x1f')])[_0x7652('0x20')](JSON[_0x7652('0x21')](_0x3e1eb3));}});});_0x59af75['on'](_0x7652('0x22'),function(_0xb298d3){if(_0x438f82){return _0x438f82[_0x7652('0x1e')](0x1f4)[_0x7652('0x20')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x7652('0x23')}]});}});_0x59af75[_0x7652('0x24')](_0x18a348);_0x59af75[_0x7652('0x1d')]();}exports[_0x7652('0x25')]=openIssue;exports[_0x7652('0x26')]=function(_0x1c1ae2,_0x1e9c73){_0x1c1ae2[_0x7652('0x27')]['ip']=_0x1c1ae2['headers'][_0x7652('0x28')]||_0x1c1ae2[_0x7652('0x29')]['remoteAddress']||_0x1c1ae2[_0x7652('0x2a')][_0x7652('0x2b')]||_0x1c1ae2['connection'][_0x7652('0x2a')][_0x7652('0x2b')];return openIssue(_0x1c1ae2[_0x7652('0x27')],_0x1e9c73);}; \ No newline at end of file +var _0x6cb4=['email','customfield_11501','customfield_11502','customfield_11503','name','reason','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','base64','utf8','end','error','json','api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection','socket','remoteAddress','bluebird','https','support','3eAmWpBVP0','key','summary','Report','\x20from\x20','description','stringify','fields'];(function(_0x1d3059,_0x3278ce){var _0x567aab=function(_0x44a82d){while(--_0x44a82d){_0x1d3059['push'](_0x1d3059['shift']());}};_0x567aab(++_0x3278ce);}(_0x6cb4,0xd3));var _0x46cb=function(_0xebf33a,_0x3163ac){_0xebf33a=_0xebf33a-0x0;var _0x43b985=_0x6cb4[_0xebf33a];return _0x43b985;};'use strict';var BPromise=require(_0x46cb('0x0'));var https=require(_0x46cb('0x1'));var logger=require('../../config/logger')('api');var USERNAME=_0x46cb('0x2');var PASSWORD=_0x46cb('0x3');function openIssue(_0xc05394,_0x589ca9){var _0x30f242={'fields':{'project':{'key':_0xc05394[_0x46cb('0x4')]||'MOTGUI'},'summary':(_0xc05394[_0x46cb('0x5')]||_0x46cb('0x6'))+_0x46cb('0x7')+_0xc05394['ip'],'description':_0xc05394[_0x46cb('0x8')]||JSON[_0x46cb('0x9')](_0xc05394),'issuetype':{'name':_0xc05394['issuetype']||'Bug'}}};_0x30f242[_0x46cb('0xa')]['customfield_11500']=_0xc05394[_0x46cb('0xb')];_0x30f242[_0x46cb('0xa')][_0x46cb('0xc')]=_0xc05394['oldToken'];_0x30f242['fields'][_0x46cb('0xd')]=_0xc05394['newToken'];_0x30f242[_0x46cb('0xa')][_0x46cb('0xe')]=_0xc05394[_0x46cb('0xf')];_0x30f242[_0x46cb('0xa')]['customfield_11504']=_0xc05394[_0x46cb('0x10')];_0x30f242[_0x46cb('0xa')]['customfield_10102']=_0xc05394['ip'];var _0x148e28={'host':_0x46cb('0x11'),'port':0x1bb,'path':_0x46cb('0x12'),'method':_0x46cb('0x13'),'timeout':0x4e20,'headers':{'Content-Type':_0x46cb('0x14'),'Authorization':_0x46cb('0x15')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x46cb('0x16'))}};var _0x30da8d=JSON[_0x46cb('0x9')](_0x30f242);var _0x407b09=https['request'](_0x148e28,function(_0x59540e){_0x59540e['setEncoding'](_0x46cb('0x17'));var _0x156fad='';_0x59540e['on']('data',function(_0x21345f){_0x156fad+=_0x21345f;});_0x59540e['on'](_0x46cb('0x18'),function(){if(_0x589ca9){return _0x589ca9['status'](_0x59540e['statusCode'])['json'](JSON['parse'](_0x156fad));}});});_0x407b09['on'](_0x46cb('0x19'),function(_0x28cb48){if(_0x589ca9){return _0x589ca9['status'](0x1f4)[_0x46cb('0x1a')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x46cb('0x1b')}]});}});_0x407b09[_0x46cb('0x1c')](_0x30da8d);_0x407b09['end']();}exports[_0x46cb('0x1d')]=openIssue;exports[_0x46cb('0x1e')]=function(_0x45a349,_0x23a20c){_0x45a349[_0x46cb('0x1f')]['ip']=_0x45a349[_0x46cb('0x20')][_0x46cb('0x21')]||_0x45a349[_0x46cb('0x22')]['remoteAddress']||_0x45a349[_0x46cb('0x23')][_0x46cb('0x24')]||_0x45a349['connection'][_0x46cb('0x23')][_0x46cb('0x24')];return openIssue(_0x45a349['body'],_0x23a20c);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 3d7dfd0..76c9b69 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 _0xa75b=['isAuthenticated','index','/describe','show','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get'];(function(_0x2722aa,_0x4f03cc){var _0x8f74af=function(_0x2271c6){while(--_0x2271c6){_0x2722aa['push'](_0x2722aa['shift']());}};_0x8f74af(++_0x4f03cc);}(_0xa75b,0x170));var _0xba75=function(_0x5f0256,_0x24e9b6){_0x5f0256=_0x5f0256-0x0;var _0x5e81e1=_0xa75b[_0x5f0256];return _0x5e81e1;};'use strict';var multer=require(_0xba75('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xba75('0x1'));var express=require(_0xba75('0x2'));var router=express[_0xba75('0x3')]();var fs_extra=require(_0xba75('0x4'));var auth=require(_0xba75('0x5'));var interaction=require(_0xba75('0x6'));var config=require(_0xba75('0x7'));var controller=require(_0xba75('0x8'));router[_0xba75('0x9')]('/',auth[_0xba75('0xa')](),controller[_0xba75('0xb')]);router[_0xba75('0x9')](_0xba75('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xba75('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xba75('0xd')]);router['post']('/',auth[_0xba75('0xa')](),controller[_0xba75('0xe')]);router[_0xba75('0xf')](_0xba75('0x10'),auth[_0xba75('0xa')](),controller[_0xba75('0x11')]);router[_0xba75('0x12')](_0xba75('0x10'),auth[_0xba75('0xa')](),controller[_0xba75('0x13')]);module[_0xba75('0x14')]=router; \ No newline at end of file +var _0xd2ea=['./jscriptyAnswerReport.controller','get','isAuthenticated','/describe','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x128977,_0x33b053){var _0x4a761d=function(_0x5b94a3){while(--_0x5b94a3){_0x128977['push'](_0x128977['shift']());}};_0x4a761d(++_0x33b053);}(_0xd2ea,0x15f));var _0xad2e=function(_0x7dcad0,_0x417cb2){_0x7dcad0=_0x7dcad0-0x0;var _0x40dc00=_0xd2ea[_0x7dcad0];return _0x40dc00;};'use strict';var multer=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var path=require(_0xad2e('0x2'));var timeout=require(_0xad2e('0x3'));var express=require(_0xad2e('0x4'));var router=express['Router']();var fs_extra=require(_0xad2e('0x5'));var auth=require(_0xad2e('0x6'));var interaction=require(_0xad2e('0x7'));var config=require(_0xad2e('0x8'));var controller=require(_0xad2e('0x9'));router[_0xad2e('0xa')]('/',auth[_0xad2e('0xb')](),controller['index']);router[_0xad2e('0xa')](_0xad2e('0xc'),auth[_0xad2e('0xb')](),controller['describe']);router[_0xad2e('0xa')](_0xad2e('0xd'),auth['isAuthenticated'](),controller[_0xad2e('0xe')]);router['post']('/',auth[_0xad2e('0xb')](),controller[_0xad2e('0xf')]);router[_0xad2e('0x10')](_0xad2e('0xd'),auth['isAuthenticated'](),controller[_0xad2e('0x11')]);router['delete'](_0xad2e('0xd'),auth[_0xad2e('0xb')](),controller[_0xad2e('0x12')]);module[_0xad2e('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index cbab51f..044f1a3 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(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x7a54,0x106));var _0x47a5=function(_0x3d4924,_0x5a7f6d){_0x3d4924=_0x3d4924-0x0;var _0x55cfd0=_0x7a54[_0x3d4924];return _0x55cfd0;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x9eca02,_0x49f194){_0x9eca02=_0x9eca02-0x0;var _0x170efe=_0x7a54[_0x9eca02];return _0x170efe;};'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 3cd992b..525d958 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 _0x22da=['sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','end','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x22da,0x80));var _0xa22d=function(_0x1976ff,_0x2422f6){_0x1976ff=_0x1976ff-0x0;var _0x38465=_0x22da[_0x1976ff];return _0x38465;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa22d('0x0'));var jsonpatch=require(_0xa22d('0x1'));var rp=require(_0xa22d('0x2'));var moment=require(_0xa22d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa22d('0x4'));var util=require(_0xa22d('0x5'));var path=require(_0xa22d('0x6'));var sox=require(_0xa22d('0x7'));var csv=require('to-csv');var ejs=require(_0xa22d('0x8'));var fs=require('fs');var fs_extra=require(_0xa22d('0x9'));var _=require('lodash');var squel=require(_0xa22d('0xa'));var crypto=require(_0xa22d('0xb'));var jsforce=require(_0xa22d('0xc'));var deskjs=require(_0xa22d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa22d('0xe'));var Redis=require(_0xa22d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa22d('0x10'));var as=require(_0xa22d('0x11'));var hardwareService=require(_0xa22d('0x12'));var logger=require(_0xa22d('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xa22d('0x14'));var licenseUtil=require(_0xa22d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x184309,_0x515d6c){_0x515d6c=_0x515d6c||0xcc;return function(_0x983182){if(_0x983182){return _0x184309[_0xa22d('0x16')](_0x515d6c);}return _0x184309[_0xa22d('0x17')](_0x515d6c)['end']();};}function respondWithResult(_0x174a3f,_0x20d7f3){_0x20d7f3=_0x20d7f3||0xc8;return function(_0xc0d11d){if(_0xc0d11d){return _0x174a3f[_0xa22d('0x17')](_0x20d7f3)[_0xa22d('0x18')](_0xc0d11d);}};}function respondWithFilteredResult(_0x4dfa44,_0x132b1d){return function(_0x1b8627){if(_0x1b8627){var _0x2af5c6=typeof _0x132b1d[_0xa22d('0x19')]===_0xa22d('0x1a')&&typeof _0x132b1d[_0xa22d('0x1b')]===_0xa22d('0x1a');var _0x5e56a6=_0x1b8627[_0xa22d('0x1c')];var _0x3d78b9=_0x2af5c6?0x0:_0x132b1d[_0xa22d('0x19')];var _0x1ed22e=_0x2af5c6?_0x1b8627[_0xa22d('0x1c')]:_0x132b1d[_0xa22d('0x19')]+_0x132b1d[_0xa22d('0x1b')];var _0x184604;if(_0x1ed22e>=_0x5e56a6){_0x1ed22e=_0x5e56a6;_0x184604=0xc8;}else{_0x184604=0xce;}_0x4dfa44['status'](_0x184604);return _0x4dfa44[_0xa22d('0x1d')](_0xa22d('0x1e'),_0x3d78b9+'-'+_0x1ed22e+'/'+_0x5e56a6)[_0xa22d('0x18')](_0x1b8627);}return null;};}function patchUpdates(_0x4ed606){return function(_0x4c0aed){try{jsonpatch['apply'](_0x4c0aed,_0x4ed606,!![]);}catch(_0x2cd394){return BPromise[_0xa22d('0x1f')](_0x2cd394);}return _0x4c0aed[_0xa22d('0x20')]();};}function saveUpdates(_0x5071e1,_0x389675){return function(_0x45f528){if(_0x45f528){return _0x45f528[_0xa22d('0x21')](_0x5071e1)['then'](function(_0xdb2773){return _0xdb2773;});}return null;};}function removeEntity(_0x1088ea,_0x502219){return function(_0x24701d){if(_0x24701d){return _0x24701d[_0xa22d('0x22')]()[_0xa22d('0x23')](function(){_0x1088ea[_0xa22d('0x17')](0xcc)[_0xa22d('0x24')]();});}};}function handleEntityNotFound(_0x1c83e8,_0x55f1ce){return function(_0x58aa49){if(!_0x58aa49){_0x1c83e8['sendStatus'](0x194);}return _0x58aa49;};}function handleError(_0x70bfb8,_0x2e4b26){_0x2e4b26=_0x2e4b26||0x1f4;return function(_0x2fe9e0){logger[_0xa22d('0x25')](_0x2fe9e0[_0xa22d('0x26')]);if(_0x2fe9e0[_0xa22d('0x27')]){delete _0x2fe9e0[_0xa22d('0x27')];}_0x70bfb8[_0xa22d('0x17')](_0x2e4b26)[_0xa22d('0x28')](_0x2fe9e0);};}exports[_0xa22d('0x29')]=function(_0x594ac5,_0x5ba48b){var _0xf687b9={},_0x4d460f={},_0x550dd7={'count':0x0,'rows':[]};var _0x1d7b33=_[_0xa22d('0x2a')](db[_0xa22d('0x2b')][_0xa22d('0x2c')],function(_0x1614f4){return{'name':_0x1614f4[_0xa22d('0x2d')],'type':_0x1614f4[_0xa22d('0x2e')][_0xa22d('0x2f')]};});_0x4d460f['model']=_[_0xa22d('0x2a')](_0x1d7b33,_0xa22d('0x27'));_0x4d460f[_0xa22d('0x30')]=_[_0xa22d('0x31')](_0x594ac5[_0xa22d('0x30')]);_0x4d460f[_0xa22d('0x32')]=_[_0xa22d('0x33')](_0x4d460f[_0xa22d('0x34')],_0x4d460f[_0xa22d('0x30')]);_0xf687b9[_0xa22d('0x35')]=_['intersection'](_0x4d460f[_0xa22d('0x34')],qs[_0xa22d('0x36')](_0x594ac5[_0xa22d('0x30')][_0xa22d('0x36')]));_0xf687b9[_0xa22d('0x35')]=_0xf687b9[_0xa22d('0x35')]['length']?_0xf687b9[_0xa22d('0x35')]:_0x4d460f[_0xa22d('0x34')];if(!_0x594ac5['query'][_0xa22d('0x37')]('nolimit')){_0xf687b9[_0xa22d('0x1b')]=qs[_0xa22d('0x1b')](_0x594ac5['query'][_0xa22d('0x1b')]);_0xf687b9['offset']=qs[_0xa22d('0x19')](_0x594ac5[_0xa22d('0x30')][_0xa22d('0x19')]);}_0xf687b9[_0xa22d('0x38')]=qs[_0xa22d('0x39')](_0x594ac5[_0xa22d('0x30')][_0xa22d('0x39')]);_0xf687b9[_0xa22d('0x3a')]=qs['filters'](_[_0xa22d('0x3b')](_0x594ac5[_0xa22d('0x30')],_0x4d460f['filters']),_0x1d7b33);if(_0x594ac5[_0xa22d('0x30')][_0xa22d('0x3c')]){_0xf687b9['where']=_['merge'](_0xf687b9[_0xa22d('0x3a')],{'$or':_[_0xa22d('0x2a')](_0x1d7b33,function(_0x109944){if(_0x109944[_0xa22d('0x2e')]!==_0xa22d('0x3d')){var _0x180c37={};_0x180c37[_0x109944[_0xa22d('0x27')]]={'$like':'%'+_0x594ac5[_0xa22d('0x30')][_0xa22d('0x3c')]+'%'};return _0x180c37;}})});}_0xf687b9=_[_0xa22d('0x3e')]({},_0xf687b9,_0x594ac5['options']);var _0x36287a={'where':_0xf687b9[_0xa22d('0x3a')]};return db[_0xa22d('0x2b')][_0xa22d('0x1c')](_0x36287a)['then'](function(_0x11e608){_0x550dd7['count']=_0x11e608;if(_0x594ac5[_0xa22d('0x30')][_0xa22d('0x3f')]){_0xf687b9[_0xa22d('0x40')]=[{'all':!![]}];}return db[_0xa22d('0x2b')][_0xa22d('0x41')](_0xf687b9);})[_0xa22d('0x23')](function(_0x55034d){_0x550dd7[_0xa22d('0x42')]=_0x55034d;return _0x550dd7;})[_0xa22d('0x23')](respondWithFilteredResult(_0x5ba48b,_0xf687b9))['catch'](handleError(_0x5ba48b,null));};exports[_0xa22d('0x43')]=function(_0x2e44c3,_0x5404d1){var _0x42a36b={'raw':!![],'where':{'id':_0x2e44c3[_0xa22d('0x44')]['id']}},_0x4aebbe={};_0x4aebbe[_0xa22d('0x34')]=_[_0xa22d('0x31')](db['JscriptyAnswerReport'][_0xa22d('0x2c')]);_0x4aebbe[_0xa22d('0x30')]=_['keys'](_0x2e44c3[_0xa22d('0x30')]);_0x4aebbe[_0xa22d('0x32')]=_[_0xa22d('0x33')](_0x4aebbe[_0xa22d('0x34')],_0x4aebbe[_0xa22d('0x30')]);_0x42a36b[_0xa22d('0x35')]=_[_0xa22d('0x33')](_0x4aebbe[_0xa22d('0x34')],qs['fields'](_0x2e44c3['query'][_0xa22d('0x36')]));_0x42a36b['attributes']=_0x42a36b[_0xa22d('0x35')]['length']?_0x42a36b[_0xa22d('0x35')]:_0x4aebbe['model'];if(_0x2e44c3[_0xa22d('0x30')][_0xa22d('0x3f')]){_0x42a36b[_0xa22d('0x40')]=[{'all':!![]}];}_0x42a36b=_[_0xa22d('0x3e')]({},_0x42a36b,_0x2e44c3[_0xa22d('0x45')]);return db[_0xa22d('0x2b')][_0xa22d('0x46')](_0x42a36b)[_0xa22d('0x23')](handleEntityNotFound(_0x5404d1,null))[_0xa22d('0x23')](respondWithResult(_0x5404d1,null))[_0xa22d('0x47')](handleError(_0x5404d1,null));};exports['create']=function(_0x5f488e,_0x132be8){return db['JscriptyAnswerReport'][_0xa22d('0x48')](_0x5f488e['body'],{})[_0xa22d('0x23')](respondWithResult(_0x132be8,0xc9))[_0xa22d('0x47')](handleError(_0x132be8,null));};exports['update']=function(_0x4a1d04,_0x37e2b2){if(_0x4a1d04['body']['id']){delete _0x4a1d04[_0xa22d('0x49')]['id'];}return db['JscriptyAnswerReport'][_0xa22d('0x46')]({'where':{'id':_0x4a1d04[_0xa22d('0x44')]['id']}})[_0xa22d('0x23')](handleEntityNotFound(_0x37e2b2,null))[_0xa22d('0x23')](saveUpdates(_0x4a1d04[_0xa22d('0x49')],null))[_0xa22d('0x23')](respondWithResult(_0x37e2b2,null))[_0xa22d('0x47')](handleError(_0x37e2b2,null));};exports[_0xa22d('0x22')]=function(_0x45672b,_0x5e5847){return db[_0xa22d('0x2b')][_0xa22d('0x46')]({'where':{'id':_0x45672b[_0xa22d('0x44')]['id']}})[_0xa22d('0x23')](handleEntityNotFound(_0x5e5847,null))[_0xa22d('0x23')](removeEntity(_0x5e5847,null))[_0xa22d('0x47')](handleError(_0x5e5847,null));};exports[_0xa22d('0x4a')]=function(_0x432d39,_0x134e7a){return db[_0xa22d('0x2b')]['describe']()[_0xa22d('0x23')](respondWithResult(_0x134e7a,null))[_0xa22d('0x47')](handleError(_0x134e7a,null));}; \ No newline at end of file +var _0x72a2=['json','undefined','count','offset','limit','status','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','fs-extra','lodash','squel','crypto','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end'];(function(_0x4b7e4d,_0x82d2ab){var _0x38d6af=function(_0x227432){while(--_0x227432){_0x4b7e4d['push'](_0x4b7e4d['shift']());}};_0x38d6af(++_0x82d2ab);}(_0x72a2,0x161));var _0x272a=function(_0x3ff814,_0x3a77ef){_0x3ff814=_0x3ff814-0x0;var _0x33f802=_0x72a2[_0x3ff814];return _0x33f802;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x272a('0x0'));var zipdir=require(_0x272a('0x1'));var jsonpatch=require(_0x272a('0x2'));var rp=require(_0x272a('0x3'));var moment=require(_0x272a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x272a('0x5'));var util=require('util');var path=require(_0x272a('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x272a('0x7'));var _=require(_0x272a('0x8'));var squel=require(_0x272a('0x9'));var crypto=require(_0x272a('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x272a('0xb'));var querystring=require('querystring');var Papa=require(_0x272a('0xc'));var Redis=require('ioredis');var authService=require(_0x272a('0xd'));var qs=require(_0x272a('0xe'));var as=require(_0x272a('0xf'));var hardwareService=require(_0x272a('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x272a('0x11'));var config=require(_0x272a('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x272a('0x13'))['db'];function respondWithStatusCode(_0x7cb1fe,_0x37ee7e){_0x37ee7e=_0x37ee7e||0xcc;return function(_0xa82788){if(_0xa82788){return _0x7cb1fe[_0x272a('0x14')](_0x37ee7e);}return _0x7cb1fe['status'](_0x37ee7e)[_0x272a('0x15')]();};}function respondWithResult(_0x2143a4,_0x43fce6){_0x43fce6=_0x43fce6||0xc8;return function(_0x167a72){if(_0x167a72){return _0x2143a4['status'](_0x43fce6)[_0x272a('0x16')](_0x167a72);}};}function respondWithFilteredResult(_0x9414d6,_0x5b615a){return function(_0x4e3661){if(_0x4e3661){var _0x4cfb67=typeof _0x5b615a['offset']==='undefined'&&typeof _0x5b615a['limit']===_0x272a('0x17');var _0x48bf3d=_0x4e3661[_0x272a('0x18')];var _0x327f68=_0x4cfb67?0x0:_0x5b615a[_0x272a('0x19')];var _0x3325b2=_0x4cfb67?_0x4e3661['count']:_0x5b615a[_0x272a('0x19')]+_0x5b615a[_0x272a('0x1a')];var _0x2675be;if(_0x3325b2>=_0x48bf3d){_0x3325b2=_0x48bf3d;_0x2675be=0xc8;}else{_0x2675be=0xce;}_0x9414d6[_0x272a('0x1b')](_0x2675be);return _0x9414d6[_0x272a('0x1c')](_0x272a('0x1d'),_0x327f68+'-'+_0x3325b2+'/'+_0x48bf3d)[_0x272a('0x16')](_0x4e3661);}return null;};}function patchUpdates(_0x5cc0d6){return function(_0x393e68){try{jsonpatch[_0x272a('0x1e')](_0x393e68,_0x5cc0d6,!![]);}catch(_0x12c1c3){return BPromise[_0x272a('0x1f')](_0x12c1c3);}return _0x393e68[_0x272a('0x20')]();};}function saveUpdates(_0x297562,_0x4ac0bb){return function(_0x1bfe85){if(_0x1bfe85){return _0x1bfe85['update'](_0x297562)[_0x272a('0x21')](function(_0x504868){return _0x504868;});}return null;};}function removeEntity(_0x3ec1c3,_0x5a7003){return function(_0x13081e){if(_0x13081e){return _0x13081e[_0x272a('0x22')]()[_0x272a('0x21')](function(){_0x3ec1c3[_0x272a('0x1b')](0xcc)[_0x272a('0x15')]();});}};}function handleEntityNotFound(_0x4554b1,_0x15d35c){return function(_0x8138e2){if(!_0x8138e2){_0x4554b1[_0x272a('0x14')](0x194);}return _0x8138e2;};}function handleError(_0x4d1293,_0xc743bc){_0xc743bc=_0xc743bc||0x1f4;return function(_0x6312d4){logger[_0x272a('0x23')](_0x6312d4[_0x272a('0x24')]);if(_0x6312d4[_0x272a('0x25')]){delete _0x6312d4['name'];}_0x4d1293['status'](_0xc743bc)[_0x272a('0x26')](_0x6312d4);};}exports[_0x272a('0x27')]=function(_0x654dc6,_0x1bce15){var _0x62a99c={},_0x73707b={},_0x10d03c={'count':0x0,'rows':[]};var _0x142f1=_[_0x272a('0x28')](db[_0x272a('0x29')][_0x272a('0x2a')],function(_0x5104f3){return{'name':_0x5104f3['fieldName'],'type':_0x5104f3['type'][_0x272a('0x2b')]};});_0x73707b['model']=_[_0x272a('0x28')](_0x142f1,_0x272a('0x25'));_0x73707b['query']=_[_0x272a('0x2c')](_0x654dc6[_0x272a('0x2d')]);_0x73707b[_0x272a('0x2e')]=_[_0x272a('0x2f')](_0x73707b[_0x272a('0x30')],_0x73707b[_0x272a('0x2d')]);_0x62a99c[_0x272a('0x31')]=_[_0x272a('0x2f')](_0x73707b['model'],qs[_0x272a('0x32')](_0x654dc6[_0x272a('0x2d')][_0x272a('0x32')]));_0x62a99c['attributes']=_0x62a99c[_0x272a('0x31')]['length']?_0x62a99c['attributes']:_0x73707b[_0x272a('0x30')];if(!_0x654dc6['query'][_0x272a('0x33')](_0x272a('0x34'))){_0x62a99c[_0x272a('0x1a')]=qs[_0x272a('0x1a')](_0x654dc6[_0x272a('0x2d')][_0x272a('0x1a')]);_0x62a99c['offset']=qs[_0x272a('0x19')](_0x654dc6[_0x272a('0x2d')][_0x272a('0x19')]);}_0x62a99c[_0x272a('0x35')]=qs[_0x272a('0x36')](_0x654dc6[_0x272a('0x2d')][_0x272a('0x36')]);_0x62a99c['where']=qs[_0x272a('0x2e')](_[_0x272a('0x37')](_0x654dc6[_0x272a('0x2d')],_0x73707b[_0x272a('0x2e')]),_0x142f1);if(_0x654dc6[_0x272a('0x2d')][_0x272a('0x38')]){_0x62a99c['where']=_['merge'](_0x62a99c[_0x272a('0x39')],{'$or':_[_0x272a('0x28')](_0x142f1,function(_0x20e5b6){if(_0x20e5b6[_0x272a('0x3a')]!==_0x272a('0x3b')){var _0xf9b46={};_0xf9b46[_0x20e5b6[_0x272a('0x25')]]={'$like':'%'+_0x654dc6[_0x272a('0x2d')][_0x272a('0x38')]+'%'};return _0xf9b46;}})});}_0x62a99c=_[_0x272a('0x3c')]({},_0x62a99c,_0x654dc6[_0x272a('0x3d')]);var _0x46227e={'where':_0x62a99c[_0x272a('0x39')]};return db[_0x272a('0x29')][_0x272a('0x18')](_0x46227e)['then'](function(_0x33abdd){_0x10d03c[_0x272a('0x18')]=_0x33abdd;if(_0x654dc6['query'][_0x272a('0x3e')]){_0x62a99c[_0x272a('0x3f')]=[{'all':!![]}];}return db[_0x272a('0x29')][_0x272a('0x40')](_0x62a99c);})[_0x272a('0x21')](function(_0x357712){_0x10d03c[_0x272a('0x41')]=_0x357712;return _0x10d03c;})['then'](respondWithFilteredResult(_0x1bce15,_0x62a99c))[_0x272a('0x42')](handleError(_0x1bce15,null));};exports[_0x272a('0x43')]=function(_0x5a7a12,_0x48c7b0){var _0x35be0e={'raw':!![],'where':{'id':_0x5a7a12[_0x272a('0x44')]['id']}},_0x47fcbd={};_0x47fcbd[_0x272a('0x30')]=_[_0x272a('0x2c')](db[_0x272a('0x29')][_0x272a('0x2a')]);_0x47fcbd[_0x272a('0x2d')]=_['keys'](_0x5a7a12[_0x272a('0x2d')]);_0x47fcbd[_0x272a('0x2e')]=_['intersection'](_0x47fcbd[_0x272a('0x30')],_0x47fcbd[_0x272a('0x2d')]);_0x35be0e['attributes']=_[_0x272a('0x2f')](_0x47fcbd[_0x272a('0x30')],qs[_0x272a('0x32')](_0x5a7a12[_0x272a('0x2d')][_0x272a('0x32')]));_0x35be0e[_0x272a('0x31')]=_0x35be0e['attributes'][_0x272a('0x45')]?_0x35be0e[_0x272a('0x31')]:_0x47fcbd[_0x272a('0x30')];if(_0x5a7a12['query'][_0x272a('0x3e')]){_0x35be0e[_0x272a('0x3f')]=[{'all':!![]}];}_0x35be0e=_['merge']({},_0x35be0e,_0x5a7a12[_0x272a('0x3d')]);return db[_0x272a('0x29')][_0x272a('0x46')](_0x35be0e)[_0x272a('0x21')](handleEntityNotFound(_0x48c7b0,null))[_0x272a('0x21')](respondWithResult(_0x48c7b0,null))[_0x272a('0x42')](handleError(_0x48c7b0,null));};exports[_0x272a('0x47')]=function(_0x4d2f43,_0x53a627){return db['JscriptyAnswerReport']['create'](_0x4d2f43[_0x272a('0x48')],{})[_0x272a('0x21')](respondWithResult(_0x53a627,0xc9))[_0x272a('0x42')](handleError(_0x53a627,null));};exports[_0x272a('0x49')]=function(_0x4bb335,_0x96d803){if(_0x4bb335[_0x272a('0x48')]['id']){delete _0x4bb335['body']['id'];}return db[_0x272a('0x29')][_0x272a('0x46')]({'where':{'id':_0x4bb335[_0x272a('0x44')]['id']}})[_0x272a('0x21')](handleEntityNotFound(_0x96d803,null))[_0x272a('0x21')](saveUpdates(_0x4bb335[_0x272a('0x48')],null))[_0x272a('0x21')](respondWithResult(_0x96d803,null))[_0x272a('0x42')](handleError(_0x96d803,null));};exports[_0x272a('0x22')]=function(_0x961994,_0x313723){return db['JscriptyAnswerReport']['find']({'where':{'id':_0x961994[_0x272a('0x44')]['id']}})['then'](handleEntityNotFound(_0x313723,null))[_0x272a('0x21')](removeEntity(_0x313723,null))[_0x272a('0x42')](handleError(_0x313723,null));};exports[_0x272a('0x4a')]=function(_0xc9e362,_0x40c86c){return db['JscriptyAnswerReport']['describe']()[_0x272a('0x21')](respondWithResult(_0x40c86c,null))['catch'](handleError(_0x40c86c,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index c531c82..666d289 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 _0xc877=['rimraf','../../config/environment','define','JscriptyAnswerReport','report_jscripty_answers','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x182ab6,_0x1c453d){var _0x1abe74=function(_0x2f2219){while(--_0x2f2219){_0x182ab6['push'](_0x182ab6['shift']());}};_0x1abe74(++_0x1c453d);}(_0xc877,0x1de));var _0x7c87=function(_0x334f9a,_0x542f01){_0x334f9a=_0x334f9a-0x0;var _0x2b219d=_0xc877[_0x334f9a];return _0x2b219d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7c87('0x0'))(_0x7c87('0x1'));var moment=require(_0x7c87('0x2'));var BPromise=require(_0x7c87('0x3'));var rp=require(_0x7c87('0x4'));var fs=require('fs');var path=require(_0x7c87('0x5'));var rimraf=require(_0x7c87('0x6'));var config=require(_0x7c87('0x7'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x49f133,_0x7aef59){return _0x49f133[_0x7c87('0x8')](_0x7c87('0x9'),attributes,{'tableName':_0x7c87('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa57e=['request-promise','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport','report_jscripty_answers','lodash','api','moment','bluebird'];(function(_0x1f8f48,_0x53b717){var _0x4396f4=function(_0x745781){while(--_0x745781){_0x1f8f48['push'](_0x1f8f48['shift']());}};_0x4396f4(++_0x53b717);}(_0xa57e,0x1bf));var _0xea57=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa57e[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xea57('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xea57('0x1'));var moment=require(_0xea57('0x2'));var BPromise=require(_0xea57('0x3'));var rp=require(_0xea57('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xea57('0x5'));var config=require(_0xea57('0x6'));var attributes=require(_0xea57('0x7'));module['exports']=function(_0x5cd5ec,_0x5726d7){return _0x5cd5ec[_0xea57('0x8')](_0xea57('0x9'),attributes,{'tableName':_0xea57('0xa'),'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 574c255..d2b06a5 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 _0x3ccc=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','JscriptyAnswerReport,\x20%s,\x20%s','message','result','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x32492c,_0x1dba5a){var _0x36b5c2=function(_0xe33bd3){while(--_0xe33bd3){_0x32492c['push'](_0x32492c['shift']());}};_0x36b5c2(++_0x1dba5a);}(_0x3ccc,0x69));var _0xc3cc=function(_0x405541,_0x2945cc){_0x405541=_0x405541-0x0;var _0x194a1e=_0x3ccc[_0x405541];return _0x194a1e;};'use strict';var _=require('lodash');var util=require(_0xc3cc('0x0'));var moment=require('moment');var BPromise=require(_0xc3cc('0x1'));var rs=require(_0xc3cc('0x2'));var fs=require('fs');var Redis=require(_0xc3cc('0x3'));var db=require(_0xc3cc('0x4'))['db'];var utils=require(_0xc3cc('0x5'));var logger=require(_0xc3cc('0x6'))(_0xc3cc('0x7'));var config=require('../../config/environment');var jayson=require(_0xc3cc('0x8'));var client=jayson[_0xc3cc('0x9')][_0xc3cc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57260d,_0x365bc8,_0x35b242){return new BPromise(function(_0x628a20,_0x38bd94){return client[_0xc3cc('0xb')](_0x57260d,_0x35b242)[_0xc3cc('0xc')](function(_0x2196e6){logger[_0xc3cc('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x365bc8,_0xc3cc('0xe'));logger[_0xc3cc('0xf')](_0xc3cc('0x10'),_0x365bc8,'request\x20sent',JSON[_0xc3cc('0x11')](_0x2196e6));if(_0x2196e6[_0xc3cc('0x12')]){if(_0x2196e6[_0xc3cc('0x12')]['code']===0x1f4){logger['error'](_0xc3cc('0x13'),_0x365bc8,_0x2196e6['error'][_0xc3cc('0x14')]);return _0x38bd94(_0x2196e6[_0xc3cc('0x12')][_0xc3cc('0x14')]);}logger[_0xc3cc('0x12')](_0xc3cc('0x13'),_0x365bc8,_0x2196e6[_0xc3cc('0x12')][_0xc3cc('0x14')]);return _0x628a20(_0x2196e6[_0xc3cc('0x12')]['message']);}else{logger[_0xc3cc('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x365bc8,_0xc3cc('0xe'));_0x628a20(_0x2196e6[_0xc3cc('0x15')][_0xc3cc('0x14')]);}})['catch'](function(_0x56c644){logger['error'](_0xc3cc('0x13'),_0x365bc8,_0x56c644);_0x38bd94(_0x56c644);});});} \ No newline at end of file +var _0x689f=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x1a214f,_0x536977){var _0xc90977=function(_0x5db535){while(--_0x5db535){_0x1a214f['push'](_0x1a214f['shift']());}};_0xc90977(++_0x536977);}(_0x689f,0x14a));var _0xf689=function(_0x403230,_0x100c91){_0x403230=_0x403230-0x0;var _0x246eb3=_0x689f[_0x403230];return _0x246eb3;};'use strict';var _=require(_0xf689('0x0'));var util=require(_0xf689('0x1'));var moment=require('moment');var BPromise=require(_0xf689('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf689('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf689('0x4'));var logger=require(_0xf689('0x5'))(_0xf689('0x6'));var config=require(_0xf689('0x7'));var jayson=require(_0xf689('0x8'));var client=jayson[_0xf689('0x9')][_0xf689('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41b85c,_0x5e5eba,_0x30b308){return new BPromise(function(_0x1448f8,_0x566975){return client[_0xf689('0xb')](_0x41b85c,_0x30b308)[_0xf689('0xc')](function(_0x1f7c02){logger[_0xf689('0xd')](_0xf689('0xe'),_0x5e5eba,_0xf689('0xf'));logger[_0xf689('0x10')](_0xf689('0x11'),_0x5e5eba,_0xf689('0xf'),JSON[_0xf689('0x12')](_0x1f7c02));if(_0x1f7c02[_0xf689('0x13')]){if(_0x1f7c02[_0xf689('0x13')][_0xf689('0x14')]===0x1f4){logger[_0xf689('0x13')](_0xf689('0xe'),_0x5e5eba,_0x1f7c02[_0xf689('0x13')]['message']);return _0x566975(_0x1f7c02[_0xf689('0x13')]['message']);}logger[_0xf689('0x13')](_0xf689('0xe'),_0x5e5eba,_0x1f7c02[_0xf689('0x13')][_0xf689('0x15')]);return _0x1448f8(_0x1f7c02[_0xf689('0x13')][_0xf689('0x15')]);}else{logger[_0xf689('0xd')](_0xf689('0xe'),_0x5e5eba,'request\x20sent');_0x1448f8(_0x1f7c02[_0xf689('0x16')]['message']);}})[_0xf689('0x17')](function(_0x474e7){logger['error'](_0xf689('0xe'),_0x5e5eba,_0x474e7);_0x566975(_0x474e7);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 210a0d4..df9b1b7 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 _0x88b6=['30s','getSummary','post','/:id/clone','clone','put','update','delete','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./jscriptyProject.controller','get','/:id','/:id/sessions','isAuthenticated','getSessions','/:id/answers','getAnswers','/:id/summary'];(function(_0xfeccd6,_0x2a5806){var _0x16a1f2=function(_0x671efc){while(--_0x671efc){_0xfeccd6['push'](_0xfeccd6['shift']());}};_0x16a1f2(++_0x2a5806);}(_0x88b6,0x105));var _0x688b=function(_0x117ac8,_0x414fd9){_0x117ac8=_0x117ac8-0x0;var _0x51bfbd=_0x88b6[_0x117ac8];return _0x51bfbd;};'use strict';var multer=require(_0x688b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x688b('0x1'));var express=require(_0x688b('0x2'));var router=express[_0x688b('0x3')]();var fs_extra=require(_0x688b('0x4'));var auth=require(_0x688b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x688b('0x6'));router[_0x688b('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x688b('0x7')](_0x688b('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x688b('0x7')](_0x688b('0x9'),auth[_0x688b('0xa')](),controller[_0x688b('0xb')]);router['get'](_0x688b('0xc'),auth[_0x688b('0xa')](),controller[_0x688b('0xd')]);router[_0x688b('0x7')](_0x688b('0xe'),auth[_0x688b('0xa')](),timeout(_0x688b('0xf')),controller[_0x688b('0x10')]);router[_0x688b('0x11')]('/',auth[_0x688b('0xa')](),controller['create']);router[_0x688b('0x11')](_0x688b('0x12'),auth[_0x688b('0xa')](),controller[_0x688b('0x13')]);router[_0x688b('0x14')](_0x688b('0x8'),auth['isAuthenticated'](),controller[_0x688b('0x15')]);router[_0x688b('0x16')](_0x688b('0x8'),auth[_0x688b('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x24d6=['update','delete','/:id','destroy','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','index','isAuthenticated','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','/:id/clone','clone','put'];(function(_0x5aa0c7,_0x59fc48){var _0x2fe4bc=function(_0x5b1bff){while(--_0x5b1bff){_0x5aa0c7['push'](_0x5aa0c7['shift']());}};_0x2fe4bc(++_0x59fc48);}(_0x24d6,0xa7));var _0x624d=function(_0x16938f,_0x35e57f){_0x16938f=_0x16938f-0x0;var _0x5c66e9=_0x24d6[_0x16938f];return _0x5c66e9;};'use strict';var multer=require(_0x624d('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x624d('0x1'));var router=express[_0x624d('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x624d('0x3'));var interaction=require(_0x624d('0x4'));var config=require(_0x624d('0x5'));var controller=require(_0x624d('0x6'));router[_0x624d('0x7')]('/',auth['isAuthenticated'](),controller[_0x624d('0x8')]);router['get']('/:id',auth[_0x624d('0x9')](),controller[_0x624d('0xa')]);router[_0x624d('0x7')](_0x624d('0xb'),auth['isAuthenticated'](),controller[_0x624d('0xc')]);router[_0x624d('0x7')](_0x624d('0xd'),auth['isAuthenticated'](),controller[_0x624d('0xe')]);router[_0x624d('0x7')](_0x624d('0xf'),auth[_0x624d('0x9')](),timeout(_0x624d('0x10')),controller[_0x624d('0x11')]);router[_0x624d('0x12')]('/',auth[_0x624d('0x9')](),controller['create']);router['post'](_0x624d('0x13'),auth[_0x624d('0x9')](),controller[_0x624d('0x14')]);router[_0x624d('0x15')]('/:id',auth[_0x624d('0x9')](),controller[_0x624d('0x16')]);router[_0x624d('0x17')](_0x624d('0x18'),auth[_0x624d('0x9')](),controller[_0x624d('0x19')]);module[_0x624d('0x1a')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 365fb63..16b9471 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 _0x3af7=['format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','stringify','isString','formData'];(function(_0x3e8f3b,_0x33c90d){var _0x577742=function(_0x358477){while(--_0x358477){_0x3e8f3b['push'](_0x3e8f3b['shift']());}};_0x577742(++_0x33c90d);}(_0x3af7,0x1d0));var _0x73af=function(_0x4e9991,_0x531912){_0x4e9991=_0x4e9991-0x0;var _0x68fec1=_0x3af7[_0x4e9991];return _0x68fec1;};'use strict';var Sequelize=require(_0x73af('0x0'));var _=require('lodash');var util=require(_0x73af('0x1'));module[_0x73af('0x2')]={'name':{'type':Sequelize[_0x73af('0x3')],'unique':_0x73af('0x4')},'description':{'type':Sequelize[_0x73af('0x3')]},'formData':{'type':Sequelize[_0x73af('0x5')](_0x73af('0x6')),'set':function(_0x2df057){if(_[_0x73af('0x7')](_0x2df057)){this[_0x73af('0x8')]('formData',JSON[_0x73af('0x9')](_0x2df057));}else if(_[_0x73af('0xa')](_0x2df057)){this[_0x73af('0x8')]('formData',_0x2df057);}else{this[_0x73af('0x8')](_0x73af('0xb'),util[_0x73af('0xc')](_0x73af('0xd'),this['getDataValue'](_0x73af('0x4'))||'',this[_0x73af('0xe')](_0x73af('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x73af('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x73af('0x10')],'defaultValue':![]}}; \ No newline at end of file +var _0x20ec=['isObjectLike','formData','isString','setDataValue','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','name','STRING','long'];(function(_0xd6bb26,_0x63ff2){var _0x122866=function(_0x4e0feb){while(--_0x4e0feb){_0xd6bb26['push'](_0xd6bb26['shift']());}};_0x122866(++_0x63ff2);}(_0x20ec,0x18f));var _0xc20e=function(_0x4c89cd,_0x2c57e2){_0x4c89cd=_0x4c89cd-0x0;var _0x1090d2=_0x20ec[_0x4c89cd];return _0x1090d2;};'use strict';var Sequelize=require(_0xc20e('0x0'));var _=require(_0xc20e('0x1'));var util=require(_0xc20e('0x2'));module[_0xc20e('0x3')]={'name':{'type':Sequelize['STRING'],'unique':_0xc20e('0x4')},'description':{'type':Sequelize[_0xc20e('0x5')]},'formData':{'type':Sequelize['TEXT'](_0xc20e('0x6')),'set':function(_0x29cd0d){if(_[_0xc20e('0x7')](_0x29cd0d)){this['setDataValue'](_0xc20e('0x8'),JSON['stringify'](_0x29cd0d));}else if(_[_0xc20e('0x9')](_0x29cd0d)){this['setDataValue'](_0xc20e('0x8'),_0x29cd0d);}else{this[_0xc20e('0xa')](_0xc20e('0x8'),util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this['getDataValue'](_0xc20e('0x4'))||'',this[_0xc20e('0xb')](_0xc20e('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xc20e('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index d19fa54..7e377e3 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 _0x9972=['options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','update','JscriptySessionReport','rawAttributes','sort','getAnswers','findOne','JscriptyAnswerReport','ProjectId','number','toString','indexOf','replace','getSummary','starttime','parse','startTime','JscriptyQuestionReport','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','format','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','/tmp/Jscripty_Project_%d_Summary_%s.csv','sendStatus','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','destroy','then','get','Projects','UserProfileResource','error','name','send','index','JscriptyProject','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL'];(function(_0x74c392,_0x29cc28){var _0x306791=function(_0x677d58){while(--_0x677d58){_0x74c392['push'](_0x74c392['shift']());}};_0x306791(++_0x29cc28);}(_0x9972,0xaa));var _0x2997=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9972[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x2997('0x0'));var rimraf=require(_0x2997('0x1'));var zipdir=require(_0x2997('0x2'));var jsonpatch=require(_0x2997('0x3'));var rp=require('request-promise');var moment=require(_0x2997('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2997('0x5'));var util=require('util');var path=require(_0x2997('0x6'));var sox=require(_0x2997('0x7'));var csv=require('to-csv');var ejs=require(_0x2997('0x8'));var fs=require('fs');var fs_extra=require(_0x2997('0x9'));var _=require(_0x2997('0xa'));var squel=require('squel');var crypto=require(_0x2997('0xb'));var jsforce=require(_0x2997('0xc'));var deskjs=require(_0x2997('0xd'));var toCsv=require(_0x2997('0xe'));var querystring=require(_0x2997('0xf'));var Papa=require(_0x2997('0x10'));var Redis=require('ioredis');var authService=require(_0x2997('0x11'));var qs=require(_0x2997('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2997('0x13'));var logger=require('../../config/logger')(_0x2997('0x14'));var utils=require('../../config/utils');var config=require(_0x2997('0x15'));var licenseUtil=require(_0x2997('0x16'));var db=require(_0x2997('0x17'))['db'];function respondWithStatusCode(_0x5974bf,_0x238fe6){_0x238fe6=_0x238fe6||0xcc;return function(_0xf4db54){if(_0xf4db54){return _0x5974bf['sendStatus'](_0x238fe6);}return _0x5974bf[_0x2997('0x18')](_0x238fe6)[_0x2997('0x19')]();};}function respondWithResult(_0x467cf6,_0x2b0806){_0x2b0806=_0x2b0806||0xc8;return function(_0x2c07d8){if(_0x2c07d8){return _0x467cf6[_0x2997('0x18')](_0x2b0806)[_0x2997('0x1a')](_0x2c07d8);}};}function respondWithFilteredResult(_0x51e834,_0x1dfdd8){return function(_0x11f5df){if(_0x11f5df){var _0xd3251c=typeof _0x1dfdd8['offset']===_0x2997('0x1b')&&typeof _0x1dfdd8[_0x2997('0x1c')]===_0x2997('0x1b');var _0x42c3e4=_0x11f5df[_0x2997('0x1d')];var _0x488d5b=_0xd3251c?0x0:_0x1dfdd8[_0x2997('0x1e')];var _0x5b74bc=_0xd3251c?_0x11f5df[_0x2997('0x1d')]:_0x1dfdd8[_0x2997('0x1e')]+_0x1dfdd8['limit'];var _0x37ef20;if(_0x5b74bc>=_0x42c3e4){_0x5b74bc=_0x42c3e4;_0x37ef20=0xc8;}else{_0x37ef20=0xce;}_0x51e834[_0x2997('0x18')](_0x37ef20);return _0x51e834[_0x2997('0x1f')](_0x2997('0x20'),_0x488d5b+'-'+_0x5b74bc+'/'+_0x42c3e4)['json'](_0x11f5df);}return null;};}function patchUpdates(_0x1f89f2){return function(_0x9efd0d){try{jsonpatch[_0x2997('0x21')](_0x9efd0d,_0x1f89f2,!![]);}catch(_0x6d321){return BPromise['reject'](_0x6d321);}return _0x9efd0d['save']();};}function saveUpdates(_0x22fc8c,_0x46e68e){return function(_0x2453ba){if(_0x2453ba){return _0x2453ba['update'](_0x22fc8c)['then'](function(_0x3c2f23){return _0x3c2f23;});}return null;};}function removeEntity(_0x694729,_0x2205cd){return function(_0x40afdb){if(_0x40afdb){return _0x40afdb[_0x2997('0x22')]()[_0x2997('0x23')](function(){var _0x1e52c1=_0x40afdb[_0x2997('0x24')]({'plain':!![]});var _0x2510b2=_0x2997('0x25');return db[_0x2997('0x26')]['destroy']({'where':{'type':_0x2510b2,'resourceId':_0x1e52c1['id']}})[_0x2997('0x23')](function(){return _0x40afdb;});})['then'](function(){_0x694729[_0x2997('0x18')](0xcc)[_0x2997('0x19')]();});}};}function handleEntityNotFound(_0x228726,_0x1da661){return function(_0x33f9f7){if(!_0x33f9f7){_0x228726['sendStatus'](0x194);}return _0x33f9f7;};}function handleError(_0x6639be,_0x5677b5){_0x5677b5=_0x5677b5||0x1f4;return function(_0x24b27a){logger[_0x2997('0x27')](_0x24b27a['stack']);if(_0x24b27a['name']){delete _0x24b27a[_0x2997('0x28')];}_0x6639be[_0x2997('0x18')](_0x5677b5)[_0x2997('0x29')](_0x24b27a);};}exports[_0x2997('0x2a')]=function(_0x5bd487,_0x609519){var _0x4a89cf={},_0x94c9af={},_0x53caf3={'count':0x0,'rows':[]};var _0x4ec7c9=_['map'](db[_0x2997('0x2b')]['rawAttributes'],function(_0x1a9fac){return{'name':_0x1a9fac[_0x2997('0x2c')],'type':_0x1a9fac['type']['key']};});_0x94c9af[_0x2997('0x2d')]=_[_0x2997('0x2e')](_0x4ec7c9,_0x2997('0x28'));_0x94c9af[_0x2997('0x2f')]=_[_0x2997('0x30')](_0x5bd487[_0x2997('0x2f')]);_0x94c9af[_0x2997('0x31')]=_[_0x2997('0x32')](_0x94c9af[_0x2997('0x2d')],_0x94c9af[_0x2997('0x2f')]);_0x4a89cf[_0x2997('0x33')]=_['intersection'](_0x94c9af['model'],qs['fields'](_0x5bd487[_0x2997('0x2f')][_0x2997('0x34')]));_0x4a89cf[_0x2997('0x33')]=_0x4a89cf[_0x2997('0x33')][_0x2997('0x35')]?_0x4a89cf[_0x2997('0x33')]:_0x94c9af[_0x2997('0x2d')];if(!_0x5bd487[_0x2997('0x2f')][_0x2997('0x36')](_0x2997('0x37'))){_0x4a89cf['limit']=qs['limit'](_0x5bd487[_0x2997('0x2f')][_0x2997('0x1c')]);_0x4a89cf[_0x2997('0x1e')]=qs[_0x2997('0x1e')](_0x5bd487['query'][_0x2997('0x1e')]);}_0x4a89cf[_0x2997('0x38')]=qs['sort'](_0x5bd487[_0x2997('0x2f')]['sort']);_0x4a89cf[_0x2997('0x39')]=qs[_0x2997('0x31')](_[_0x2997('0x3a')](_0x5bd487['query'],_0x94c9af[_0x2997('0x31')]),_0x4ec7c9);if(_0x5bd487[_0x2997('0x2f')][_0x2997('0x3b')]){_0x4a89cf[_0x2997('0x39')]=_[_0x2997('0x3c')](_0x4a89cf['where'],{'$or':_['map'](_0x4ec7c9,function(_0x281327){if(_0x281327['type']!==_0x2997('0x3d')){var _0x41e11e={};_0x41e11e[_0x281327[_0x2997('0x28')]]={'$like':'%'+_0x5bd487['query']['filter']+'%'};return _0x41e11e;}})});}_0x4a89cf=_['merge']({},_0x4a89cf,_0x5bd487[_0x2997('0x3e')]);var _0x3d64d8={'where':_0x4a89cf[_0x2997('0x39')]};return db[_0x2997('0x2b')][_0x2997('0x1d')](_0x3d64d8)[_0x2997('0x23')](function(_0x132829){_0x53caf3['count']=_0x132829;if(_0x5bd487[_0x2997('0x2f')][_0x2997('0x3f')]){_0x4a89cf[_0x2997('0x40')]=[{'all':!![]}];}return db['JscriptyProject'][_0x2997('0x41')](_0x4a89cf);})[_0x2997('0x23')](function(_0x45d100){_0x53caf3[_0x2997('0x42')]=_0x45d100;return _0x53caf3;})[_0x2997('0x23')](respondWithFilteredResult(_0x609519,_0x4a89cf))[_0x2997('0x43')](handleError(_0x609519,null));};exports[_0x2997('0x44')]=function(_0x2a5c77,_0x115990){var _0x53c63a={'raw':![],'where':{'id':_0x2a5c77[_0x2997('0x45')]['id']}},_0x424dca={};_0x424dca[_0x2997('0x2d')]=_[_0x2997('0x30')](db['JscriptyProject']['rawAttributes']);_0x424dca[_0x2997('0x2f')]=_[_0x2997('0x30')](_0x2a5c77[_0x2997('0x2f')]);_0x424dca['filters']=_[_0x2997('0x32')](_0x424dca[_0x2997('0x2d')],_0x424dca['query']);_0x53c63a[_0x2997('0x33')]=_['intersection'](_0x424dca['model'],qs[_0x2997('0x34')](_0x2a5c77[_0x2997('0x2f')]['fields']));_0x53c63a[_0x2997('0x33')]=_0x53c63a['attributes']['length']?_0x53c63a[_0x2997('0x33')]:_0x424dca[_0x2997('0x2d')];if(_0x2a5c77[_0x2997('0x2f')][_0x2997('0x3f')]){_0x53c63a[_0x2997('0x40')]=[{'all':!![]}];}_0x53c63a=_[_0x2997('0x3c')]({},_0x53c63a,_0x2a5c77[_0x2997('0x3e')]);return db[_0x2997('0x2b')][_0x2997('0x46')](_0x53c63a)['then'](handleEntityNotFound(_0x115990,null))['then'](respondWithResult(_0x115990,null))['catch'](handleError(_0x115990,null));};exports[_0x2997('0x47')]=function(_0x1445cf,_0xdf8862){return db[_0x2997('0x2b')][_0x2997('0x47')](_0x1445cf[_0x2997('0x48')],{})['then'](function(_0x55729b){var _0xac5028=_0x1445cf[_0x2997('0x49')]['get']({'plain':!![]});if(!_0xac5028)throw new Error(_0x2997('0x4a'));if(_0xac5028[_0x2997('0x4b')]==='user'){var _0x4bcc61=_0x55729b[_0x2997('0x24')]({'plain':!![]});var _0x36d61c=_0x2997('0x25');return db[_0x2997('0x4c')][_0x2997('0x46')]({'where':{'name':_0x36d61c,'userProfileId':_0xac5028['userProfileId']},'raw':!![]})[_0x2997('0x23')](function(_0x1abc70){if(_0x1abc70&&_0x1abc70[_0x2997('0x4d')]===0x0){return db[_0x2997('0x26')][_0x2997('0x47')]({'name':_0x4bcc61[_0x2997('0x28')],'resourceId':_0x4bcc61['id'],'type':_0x1abc70[_0x2997('0x28')],'sectionId':_0x1abc70['id']},{})[_0x2997('0x23')](function(){return _0x55729b;});}else{return _0x55729b;}})[_0x2997('0x43')](function(_0x3364b6){logger['error'](_0x2997('0x4e'),_0x3364b6);throw _0x3364b6;});}return _0x55729b;})['then'](respondWithResult(_0xdf8862,0xc9))[_0x2997('0x43')](handleError(_0xdf8862,null));};exports[_0x2997('0x4f')]=function(_0x311beb,_0x5e0c12){var _0x3fbe23={'where':{'id':_0x311beb[_0x2997('0x45')]['id']}},_0xee41d8={};_0xee41d8[_0x2997('0x2d')]=_[_0x2997('0x30')](db[_0x2997('0x2b')]['rawAttributes']);_0x3fbe23[_0x2997('0x33')]=_['intersection'](_0xee41d8[_0x2997('0x2d')],qs[_0x2997('0x34')](_0x311beb['query'][_0x2997('0x34')]));_0x3fbe23['attributes']=_0x3fbe23['attributes'][_0x2997('0x35')]?_0x3fbe23['attributes']:_0xee41d8[_0x2997('0x2d')];if(_0x311beb['query'][_0x2997('0x3f')]){_0x3fbe23[_0x2997('0x40')]=[{'all':!![]}];}_0x3fbe23=_[_0x2997('0x3c')]({},_0x3fbe23,_0x311beb[_0x2997('0x3e')]);return db[_0x2997('0x2b')]['find'](_0x3fbe23)[_0x2997('0x23')](handleEntityNotFound(_0x5e0c12,null))[_0x2997('0x23')](function(_0x807492){if(_0x807492){var _0x45e415=_0x807492[_0x2997('0x24')]({'plain':!![]});_0x45e415=qs[_0x2997('0x50')](_0x45e415,['id',_0x2997('0x51'),_0x2997('0x52')]);_0x311beb['body']=_['omit'](_0x311beb[_0x2997('0x48')],['id',_0x2997('0x51'),_0x2997('0x52')]);return db[_0x2997('0x2b')][_0x2997('0x47')](_[_0x2997('0x3c')](_0x45e415,_0x311beb[_0x2997('0x48')]),{'include':_0x311beb[_0x2997('0x2f')][_0x2997('0x3f')]?[{'all':!![]}]:undefined})[_0x2997('0x23')](function(_0x305f7e){var _0x2376c0=_0x311beb[_0x2997('0x49')][_0x2997('0x24')]({'plain':!![]});if(!_0x2376c0)throw new Error(_0x2997('0x4a'));if(_0x2376c0[_0x2997('0x4b')]===_0x2997('0x49')){var _0x4f403e=_0x305f7e['get']({'plain':!![]});var _0x227526=_0x2997('0x25');return db[_0x2997('0x4c')]['find']({'where':{'name':_0x227526,'userProfileId':_0x2376c0['userProfileId']},'raw':!![]})[_0x2997('0x23')](function(_0x3d2bef){if(_0x3d2bef&&_0x3d2bef[_0x2997('0x4d')]===0x0){return db[_0x2997('0x26')][_0x2997('0x47')]({'name':_0x4f403e[_0x2997('0x28')],'resourceId':_0x4f403e['id'],'type':_0x3d2bef[_0x2997('0x28')],'sectionId':_0x3d2bef['id']},{})[_0x2997('0x23')](function(){return _0x305f7e;});}else{return _0x305f7e;}})[_0x2997('0x43')](function(_0x261f5e){logger[_0x2997('0x27')](_0x2997('0x4e'),_0x261f5e);throw _0x261f5e;});}return _0x305f7e;});}})[_0x2997('0x23')](respondWithResult(_0x5e0c12,0xc9))[_0x2997('0x43')](handleError(_0x5e0c12,null));};exports[_0x2997('0x53')]=function(_0xfd4f1b,_0xd7776c){if(_0xfd4f1b['body']['id']){delete _0xfd4f1b[_0x2997('0x48')]['id'];}return db[_0x2997('0x2b')][_0x2997('0x46')]({'where':{'id':_0xfd4f1b[_0x2997('0x45')]['id']}})[_0x2997('0x23')](handleEntityNotFound(_0xd7776c,null))[_0x2997('0x23')](saveUpdates(_0xfd4f1b[_0x2997('0x48')],null))[_0x2997('0x23')](respondWithResult(_0xd7776c,null))[_0x2997('0x43')](handleError(_0xd7776c,null));};exports['destroy']=function(_0x2df6bc,_0x28bf83){return db['JscriptyProject'][_0x2997('0x46')]({'where':{'id':_0x2df6bc[_0x2997('0x45')]['id']}})['then'](handleEntityNotFound(_0x28bf83,null))[_0x2997('0x23')](removeEntity(_0x28bf83,null))[_0x2997('0x43')](handleError(_0x28bf83,null));};exports['getSessions']=function(_0x351c4e,_0x39eae2,_0x29adef){var _0x4d6d2d={'raw':!![],'where':{}};var _0x25c5c9={};var _0x455d45={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x351c4e[_0x2997('0x45')]['id']}})[_0x2997('0x23')](handleEntityNotFound(_0x39eae2,null))['then'](function(_0xb8ddd4){if(_0xb8ddd4){_0x25c5c9[_0x2997('0x2d')]=_[_0x2997('0x30')](db[_0x2997('0x54')][_0x2997('0x55')]);_0x25c5c9['query']=_['keys'](_0x351c4e[_0x2997('0x2f')]);_0x25c5c9[_0x2997('0x31')]=_[_0x2997('0x32')](_0x25c5c9[_0x2997('0x2d')],_0x25c5c9[_0x2997('0x2f')]);_0x4d6d2d[_0x2997('0x33')]=_['intersection'](_0x25c5c9[_0x2997('0x2d')],qs['fields'](_0x351c4e[_0x2997('0x2f')][_0x2997('0x34')]));_0x4d6d2d['attributes']=_0x4d6d2d['attributes']['length']?_0x4d6d2d[_0x2997('0x33')]:_0x25c5c9[_0x2997('0x2d')];if(!_0x351c4e[_0x2997('0x2f')][_0x2997('0x36')]('nolimit')){_0x4d6d2d[_0x2997('0x1c')]=qs[_0x2997('0x1c')](_0x351c4e[_0x2997('0x2f')]['limit']);_0x4d6d2d['offset']=qs[_0x2997('0x1e')](_0x351c4e['query'][_0x2997('0x1e')]);}_0x4d6d2d['order']=qs[_0x2997('0x56')](_0x351c4e[_0x2997('0x2f')][_0x2997('0x56')]);_0x4d6d2d[_0x2997('0x39')]=qs[_0x2997('0x31')](_[_0x2997('0x3a')](_0x351c4e[_0x2997('0x2f')],_0x25c5c9[_0x2997('0x31')]));_0x4d6d2d[_0x2997('0x39')]['ProjectId']=_0xb8ddd4['id'];if(_0x351c4e[_0x2997('0x2f')][_0x2997('0x3b')]){_0x4d6d2d[_0x2997('0x39')]=_[_0x2997('0x3c')](_0x4d6d2d[_0x2997('0x39')],{'$or':_[_0x2997('0x2e')](_0x4d6d2d[_0x2997('0x33')],function(_0x471f22){var _0xbbac28={};_0xbbac28[_0x471f22]={'$like':'%'+_0x351c4e[_0x2997('0x2f')][_0x2997('0x3b')]+'%'};return _0xbbac28;})});}_0x4d6d2d=_[_0x2997('0x3c')]({},_0x4d6d2d,_0x351c4e[_0x2997('0x3e')]);return db['JscriptySessionReport']['count']({'where':_0x4d6d2d[_0x2997('0x39')]})[_0x2997('0x23')](function(_0x163ec9){_0x455d45[_0x2997('0x1d')]=_0x163ec9;if(_0x351c4e['query'][_0x2997('0x3f')]){_0x4d6d2d['include']=[{'all':!![]}];}return db[_0x2997('0x54')][_0x2997('0x41')](_0x4d6d2d);})[_0x2997('0x23')](function(_0x64cffd){_0x455d45[_0x2997('0x42')]=_0x64cffd;return _0x455d45;});}})[_0x2997('0x23')](respondWithFilteredResult(_0x39eae2,_0x4d6d2d))[_0x2997('0x43')](handleError(_0x39eae2,null));};exports[_0x2997('0x57')]=function(_0x37e1ee,_0x36a8c6,_0x2e49b6){var _0x54a976={'raw':!![],'where':{}};var _0x5a6e8f={};var _0x26bc07={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x2997('0x58')]({'where':{'id':_0x37e1ee[_0x2997('0x45')]['id']}})['then'](handleEntityNotFound(_0x36a8c6,null))[_0x2997('0x23')](function(_0xdeee83){if(_0xdeee83){_0x5a6e8f[_0x2997('0x2d')]=_[_0x2997('0x30')](db[_0x2997('0x59')][_0x2997('0x55')]);_0x5a6e8f[_0x2997('0x2f')]=_['keys'](_0x37e1ee[_0x2997('0x2f')]);_0x5a6e8f[_0x2997('0x31')]=_['intersection'](_0x5a6e8f[_0x2997('0x2d')],_0x5a6e8f[_0x2997('0x2f')]);_0x54a976[_0x2997('0x33')]=_[_0x2997('0x32')](_0x5a6e8f[_0x2997('0x2d')],qs[_0x2997('0x34')](_0x37e1ee['query'][_0x2997('0x34')]));_0x54a976[_0x2997('0x33')]=_0x54a976[_0x2997('0x33')][_0x2997('0x35')]?_0x54a976[_0x2997('0x33')]:_0x5a6e8f['model'];if(!_0x37e1ee[_0x2997('0x2f')][_0x2997('0x36')](_0x2997('0x37'))){_0x54a976[_0x2997('0x1c')]=qs[_0x2997('0x1c')](_0x37e1ee[_0x2997('0x2f')][_0x2997('0x1c')]);_0x54a976['offset']=qs[_0x2997('0x1e')](_0x37e1ee[_0x2997('0x2f')][_0x2997('0x1e')]);}_0x54a976[_0x2997('0x38')]=qs[_0x2997('0x56')](_0x37e1ee[_0x2997('0x2f')]['sort']);_0x54a976[_0x2997('0x39')]=qs['filters'](_['pick'](_0x37e1ee[_0x2997('0x2f')],_0x5a6e8f['filters']));_0x54a976['where'][_0x2997('0x5a')]=_0xdeee83['id'];if(_0x37e1ee[_0x2997('0x2f')]['filter']){_0x54a976[_0x2997('0x39')]=_[_0x2997('0x3c')](_0x54a976[_0x2997('0x39')],{'$or':_[_0x2997('0x2e')](_0x54a976[_0x2997('0x33')],function(_0x4b02eb){var _0xe0471f={};_0xe0471f[_0x4b02eb]={'$like':'%'+_0x37e1ee[_0x2997('0x2f')][_0x2997('0x3b')]+'%'};return _0xe0471f;})});}_0x54a976=_['merge']({},_0x54a976,_0x37e1ee[_0x2997('0x3e')]);return db[_0x2997('0x59')]['count']({'where':_0x54a976[_0x2997('0x39')]})[_0x2997('0x23')](function(_0xfa812b){_0x26bc07['count']=_0xfa812b;if(_0x37e1ee[_0x2997('0x2f')][_0x2997('0x3f')]){_0x54a976[_0x2997('0x40')]=[{'all':!![]}];}return db[_0x2997('0x59')][_0x2997('0x41')](_0x54a976);})[_0x2997('0x23')](function(_0x222e72){_0x26bc07[_0x2997('0x42')]=_0x222e72;return _0x26bc07;});}})[_0x2997('0x23')](respondWithFilteredResult(_0x36a8c6,_0x54a976))[_0x2997('0x43')](handleError(_0x36a8c6,null));};function char(_0x36864d){return _0x2997('0x5b')===typeof _0x36864d?String['fromCharCode']['apply'](null,arguments):_0x36864d;}function needsEncapsulation(_0x4e8667){return!!_0x4e8667&&(_0x4e8667[_0x2997('0x5c')]()[_0x2997('0x5d')](char(0xd))>=0x0||_0x4e8667['toString']()[_0x2997('0x5d')](char(0xa))>=0x0||_0x4e8667['toString']()[_0x2997('0x5d')](char(0x2c))>=0x0||_0x4e8667['toString']()[_0x2997('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x2f715f){var _0x1cdea1=char(0x22),_0x7a0f27='\x5c'+char(0x22),_0x277be5=_0x2f715f[_0x2997('0x5c')]()[_0x2997('0x5e')](new RegExp(_0x1cdea1,'g'),_0x7a0f27);return _0x1cdea1+_0x277be5+_0x1cdea1;}exports[_0x2997('0x5f')]=function(_0x1b7853,_0x9bfb69,_0x260d1a){var _0x4c4aad,_0x4b1f37;var _0x2b15a9={'where':{'ProjectId':_0x1b7853[_0x2997('0x45')]['id']}};if(_0x1b7853[_0x2997('0x2f')]['startTime']){_0x2b15a9[_0x2997('0x39')][_0x2997('0x60')]=JSON[_0x2997('0x61')](_0x1b7853['query'][_0x2997('0x62')]);}return db[_0x2997('0x54')][_0x2997('0x41')](_0x2b15a9)[_0x2997('0x23')](handleEntityNotFound(_0x9bfb69,null))[_0x2997('0x23')](function(_0x68ac6b){if(_0x68ac6b){_0x4c4aad=_0x68ac6b;return db[_0x2997('0x63')]['findAll']({'where':{'SessionId':{'$in':_[_0x2997('0x2e')](_0x4c4aad,'id')},'ProjectId':_0x1b7853[_0x2997('0x45')]['id']},'order':'-createdAt'});}})[_0x2997('0x23')](handleEntityNotFound(_0x9bfb69,null))[_0x2997('0x23')](function(_0x1f6d13){if(_0x1f6d13){_0x4b1f37=_0x1f6d13;var _0x246793={};for(var _0x41879f=0x0,_0x43f948=_0x4b1f37[_0x2997('0x35')];_0x41879f<_0x43f948;_0x41879f++){if(!_0x246793[_0x2997('0x36')](_0x4b1f37[_0x41879f][_0x2997('0x64')])){_0x246793[_0x4b1f37[_0x41879f][_0x2997('0x64')]]=needsEncapsulation(_0x4b1f37[_0x41879f][_0x2997('0x65')])?encapsulate(_0x4b1f37[_0x41879f][_0x2997('0x65')]):_0x4b1f37[_0x41879f][_0x2997('0x65')];}}var _0x4c021b=[],_0x32424f={};for(var _0x36fe13=0x0,_0x3fc287=_0x4c4aad[_0x2997('0x35')];_0x36fe13<_0x3fc287;_0x36fe13++){_0x32424f={'ProjectId':_0x1b7853[_0x2997('0x45')]['id'],'SessionId':_0x4c4aad[_0x36fe13]['id'],'StartTime':moment(_0x4c4aad[_0x36fe13]['starttime'])['format'](_0x2997('0x66'))};for(var _0x21970d=0x0,_0x44fb76=_0x4b1f37[_0x2997('0x35')];_0x21970d<_0x44fb76;_0x21970d++){if(_0x4b1f37[_0x21970d][_0x2997('0x67')]==_0x4c4aad[_0x36fe13]['id']&&_0x246793[_0x2997('0x36')](_0x4b1f37[_0x21970d][_0x2997('0x64')])){_0x32424f[_0x246793[_0x4b1f37[_0x21970d][_0x2997('0x64')]]]=_0x4b1f37[_0x21970d][_0x2997('0x68')];}}for(var _0x42fc35 in _0x246793){if(!_0x32424f['hasOwnProperty'](_0x246793[_0x42fc35])){_0x32424f[_0x246793[_0x42fc35]]=null;}}_0x4c021b[_0x2997('0x69')](_0x32424f);}return _0x4c021b;}})[_0x2997('0x23')](function(_0x5cd888){if(!_['isEmpty'](_0x5cd888)){var _0x32f43e=toCsv(_0x5cd888);var _0x5cdfef=Date[_0x2997('0x6a')]();fs[_0x2997('0x6b')](util[_0x2997('0x6c')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x1b7853[_0x2997('0x45')]['id'],_0x5cdfef),_0x32f43e);_0x9bfb69[_0x2997('0x6d')](_0x2997('0x6e'),_0x2997('0x6f')+util[_0x2997('0x6c')](_0x2997('0x70'),_0x1b7853['params']['id'],_0x5cdfef));_0x9bfb69[_0x2997('0x6d')]('Content-type',_0x2997('0x71'));return _0x9bfb69['download'](util['format'](_0x2997('0x72'),_0x1b7853[_0x2997('0x45')]['id'],_0x5cdfef));}else{return _0x9bfb69[_0x2997('0x73')](0xcc);}})['catch'](handleError(_0x9bfb69,null));}; \ No newline at end of file +var _0xc5c0=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','Projects','UserProfileResource','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','limit','sort','where','filters','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','get','omit','createdAt','updatedAt','userProfileId','getSessions','order','pick','ProjectId','JscriptySessionReport','getAnswers','findOne','JscriptyAnswerReport','number','toString','indexOf','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','format','Content-type','text/csv','download','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x253b0a,_0xd0f0bc){var _0x1fc145=function(_0x4e4254){while(--_0x4e4254){_0x253b0a['push'](_0x253b0a['shift']());}};_0x1fc145(++_0xd0f0bc);}(_0xc5c0,0x6c));var _0x0c5c=function(_0x4bac4e,_0x4d7dd5){_0x4bac4e=_0x4bac4e-0x0;var _0x2e9c38=_0xc5c0[_0x4bac4e];return _0x2e9c38;};'use strict';var emlformat=require(_0x0c5c('0x0'));var rimraf=require(_0x0c5c('0x1'));var zipdir=require(_0x0c5c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0c5c('0x3'));var BPromise=require(_0x0c5c('0x4'));var Mustache=require('mustache');var util=require(_0x0c5c('0x5'));var path=require(_0x0c5c('0x6'));var sox=require(_0x0c5c('0x7'));var csv=require(_0x0c5c('0x8'));var ejs=require(_0x0c5c('0x9'));var fs=require('fs');var fs_extra=require(_0x0c5c('0xa'));var _=require(_0x0c5c('0xb'));var squel=require('squel');var crypto=require(_0x0c5c('0xc'));var jsforce=require(_0x0c5c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0c5c('0x8'));var querystring=require(_0x0c5c('0xe'));var Papa=require(_0x0c5c('0xf'));var Redis=require(_0x0c5c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0c5c('0x11'));var as=require(_0x0c5c('0x12'));var hardwareService=require(_0x0c5c('0x13'));var logger=require(_0x0c5c('0x14'))(_0x0c5c('0x15'));var utils=require('../../config/utils');var config=require(_0x0c5c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c5c('0x17'))['db'];function respondWithStatusCode(_0x2a6faa,_0x1dcb7a){_0x1dcb7a=_0x1dcb7a||0xcc;return function(_0x2f9a2f){if(_0x2f9a2f){return _0x2a6faa[_0x0c5c('0x18')](_0x1dcb7a);}return _0x2a6faa[_0x0c5c('0x19')](_0x1dcb7a)[_0x0c5c('0x1a')]();};}function respondWithResult(_0x35a896,_0x30f123){_0x30f123=_0x30f123||0xc8;return function(_0x35e7e3){if(_0x35e7e3){return _0x35a896['status'](_0x30f123)[_0x0c5c('0x1b')](_0x35e7e3);}};}function respondWithFilteredResult(_0x5edd7f,_0x56b0c7){return function(_0x375e9d){if(_0x375e9d){var _0x189c00=typeof _0x56b0c7['offset']===_0x0c5c('0x1c')&&typeof _0x56b0c7['limit']===_0x0c5c('0x1c');var _0x3cef4c=_0x375e9d[_0x0c5c('0x1d')];var _0x5b8105=_0x189c00?0x0:_0x56b0c7[_0x0c5c('0x1e')];var _0x38cd95=_0x189c00?_0x375e9d[_0x0c5c('0x1d')]:_0x56b0c7[_0x0c5c('0x1e')]+_0x56b0c7['limit'];var _0x273a5a;if(_0x38cd95>=_0x3cef4c){_0x38cd95=_0x3cef4c;_0x273a5a=0xc8;}else{_0x273a5a=0xce;}_0x5edd7f[_0x0c5c('0x19')](_0x273a5a);return _0x5edd7f[_0x0c5c('0x1f')](_0x0c5c('0x20'),_0x5b8105+'-'+_0x38cd95+'/'+_0x3cef4c)[_0x0c5c('0x1b')](_0x375e9d);}return null;};}function patchUpdates(_0x17af12){return function(_0x616c62){try{jsonpatch[_0x0c5c('0x21')](_0x616c62,_0x17af12,!![]);}catch(_0x480efe){return BPromise[_0x0c5c('0x22')](_0x480efe);}return _0x616c62[_0x0c5c('0x23')]();};}function saveUpdates(_0xeb244e,_0x2cd15f){return function(_0xe0534d){if(_0xe0534d){return _0xe0534d[_0x0c5c('0x24')](_0xeb244e)['then'](function(_0xb1ea94){return _0xb1ea94;});}return null;};}function removeEntity(_0x4f5c8a,_0x12bc50){return function(_0x4356fa){if(_0x4356fa){return _0x4356fa[_0x0c5c('0x25')]()[_0x0c5c('0x26')](function(){var _0xce6d9c=_0x4356fa['get']({'plain':!![]});var _0x19f49e=_0x0c5c('0x27');return db[_0x0c5c('0x28')][_0x0c5c('0x25')]({'where':{'type':_0x19f49e,'resourceId':_0xce6d9c['id']}})[_0x0c5c('0x26')](function(){return _0x4356fa;});})[_0x0c5c('0x26')](function(){_0x4f5c8a[_0x0c5c('0x19')](0xcc)[_0x0c5c('0x1a')]();});}};}function handleEntityNotFound(_0x2f3b67,_0x307e59){return function(_0x302663){if(!_0x302663){_0x2f3b67[_0x0c5c('0x18')](0x194);}return _0x302663;};}function handleError(_0x4d9741,_0x5ab64a){_0x5ab64a=_0x5ab64a||0x1f4;return function(_0xf56822){logger[_0x0c5c('0x29')](_0xf56822[_0x0c5c('0x2a')]);if(_0xf56822[_0x0c5c('0x2b')]){delete _0xf56822[_0x0c5c('0x2b')];}_0x4d9741[_0x0c5c('0x19')](_0x5ab64a)[_0x0c5c('0x2c')](_0xf56822);};}exports[_0x0c5c('0x2d')]=function(_0x2ef471,_0x1b88c1){var _0xe1130e={},_0x43e2a2={},_0xd94d41={'count':0x0,'rows':[]};var _0x280983=_[_0x0c5c('0x2e')](db[_0x0c5c('0x2f')][_0x0c5c('0x30')],function(_0x20b336){return{'name':_0x20b336[_0x0c5c('0x31')],'type':_0x20b336['type'][_0x0c5c('0x32')]};});_0x43e2a2[_0x0c5c('0x33')]=_[_0x0c5c('0x2e')](_0x280983,'name');_0x43e2a2[_0x0c5c('0x34')]=_[_0x0c5c('0x35')](_0x2ef471[_0x0c5c('0x34')]);_0x43e2a2['filters']=_[_0x0c5c('0x36')](_0x43e2a2['model'],_0x43e2a2[_0x0c5c('0x34')]);_0xe1130e['attributes']=_[_0x0c5c('0x36')](_0x43e2a2[_0x0c5c('0x33')],qs[_0x0c5c('0x37')](_0x2ef471[_0x0c5c('0x34')]['fields']));_0xe1130e[_0x0c5c('0x38')]=_0xe1130e['attributes']['length']?_0xe1130e[_0x0c5c('0x38')]:_0x43e2a2[_0x0c5c('0x33')];if(!_0x2ef471[_0x0c5c('0x34')][_0x0c5c('0x39')](_0x0c5c('0x3a'))){_0xe1130e[_0x0c5c('0x3b')]=qs[_0x0c5c('0x3b')](_0x2ef471['query'][_0x0c5c('0x3b')]);_0xe1130e[_0x0c5c('0x1e')]=qs[_0x0c5c('0x1e')](_0x2ef471[_0x0c5c('0x34')]['offset']);}_0xe1130e['order']=qs[_0x0c5c('0x3c')](_0x2ef471['query'][_0x0c5c('0x3c')]);_0xe1130e[_0x0c5c('0x3d')]=qs[_0x0c5c('0x3e')](_['pick'](_0x2ef471[_0x0c5c('0x34')],_0x43e2a2[_0x0c5c('0x3e')]),_0x280983);if(_0x2ef471[_0x0c5c('0x34')][_0x0c5c('0x3f')]){_0xe1130e[_0x0c5c('0x3d')]=_[_0x0c5c('0x40')](_0xe1130e['where'],{'$or':_[_0x0c5c('0x2e')](_0x280983,function(_0x48a037){if(_0x48a037[_0x0c5c('0x41')]!=='VIRTUAL'){var _0x56e7ee={};_0x56e7ee[_0x48a037[_0x0c5c('0x2b')]]={'$like':'%'+_0x2ef471[_0x0c5c('0x34')][_0x0c5c('0x3f')]+'%'};return _0x56e7ee;}})});}_0xe1130e=_[_0x0c5c('0x40')]({},_0xe1130e,_0x2ef471[_0x0c5c('0x42')]);var _0xb6953d={'where':_0xe1130e[_0x0c5c('0x3d')]};return db[_0x0c5c('0x2f')][_0x0c5c('0x1d')](_0xb6953d)[_0x0c5c('0x26')](function(_0x17f971){_0xd94d41[_0x0c5c('0x1d')]=_0x17f971;if(_0x2ef471[_0x0c5c('0x34')][_0x0c5c('0x43')]){_0xe1130e[_0x0c5c('0x44')]=[{'all':!![]}];}return db['JscriptyProject'][_0x0c5c('0x45')](_0xe1130e);})['then'](function(_0x570364){_0xd94d41[_0x0c5c('0x46')]=_0x570364;return _0xd94d41;})[_0x0c5c('0x26')](respondWithFilteredResult(_0x1b88c1,_0xe1130e))[_0x0c5c('0x47')](handleError(_0x1b88c1,null));};exports[_0x0c5c('0x48')]=function(_0x4d0710,_0x2367ec){var _0x2a0315={'raw':![],'where':{'id':_0x4d0710['params']['id']}},_0x9abdc0={};_0x9abdc0['model']=_[_0x0c5c('0x35')](db['JscriptyProject']['rawAttributes']);_0x9abdc0[_0x0c5c('0x34')]=_[_0x0c5c('0x35')](_0x4d0710[_0x0c5c('0x34')]);_0x9abdc0[_0x0c5c('0x3e')]=_[_0x0c5c('0x36')](_0x9abdc0[_0x0c5c('0x33')],_0x9abdc0[_0x0c5c('0x34')]);_0x2a0315[_0x0c5c('0x38')]=_[_0x0c5c('0x36')](_0x9abdc0[_0x0c5c('0x33')],qs[_0x0c5c('0x37')](_0x4d0710[_0x0c5c('0x34')][_0x0c5c('0x37')]));_0x2a0315['attributes']=_0x2a0315[_0x0c5c('0x38')][_0x0c5c('0x49')]?_0x2a0315['attributes']:_0x9abdc0[_0x0c5c('0x33')];if(_0x4d0710[_0x0c5c('0x34')][_0x0c5c('0x43')]){_0x2a0315['include']=[{'all':!![]}];}_0x2a0315=_[_0x0c5c('0x40')]({},_0x2a0315,_0x4d0710['options']);return db[_0x0c5c('0x2f')][_0x0c5c('0x4a')](_0x2a0315)[_0x0c5c('0x26')](handleEntityNotFound(_0x2367ec,null))[_0x0c5c('0x26')](respondWithResult(_0x2367ec,null))[_0x0c5c('0x47')](handleError(_0x2367ec,null));};exports[_0x0c5c('0x4b')]=function(_0x1c7235,_0x5688db){return db[_0x0c5c('0x2f')][_0x0c5c('0x4b')](_0x1c7235[_0x0c5c('0x4c')],{})['then'](function(_0x3ae194){var _0x5280df=_0x1c7235[_0x0c5c('0x4d')]['get']({'plain':!![]});if(!_0x5280df)throw new Error(_0x0c5c('0x4e'));if(_0x5280df[_0x0c5c('0x4f')]===_0x0c5c('0x4d')){var _0x291564=_0x3ae194['get']({'plain':!![]});var _0x4409f8='Projects';return db[_0x0c5c('0x50')][_0x0c5c('0x4a')]({'where':{'name':_0x4409f8,'userProfileId':_0x5280df['userProfileId']},'raw':!![]})[_0x0c5c('0x26')](function(_0x48ef7f){if(_0x48ef7f&&_0x48ef7f[_0x0c5c('0x51')]===0x0){return db['UserProfileResource'][_0x0c5c('0x4b')]({'name':_0x291564[_0x0c5c('0x2b')],'resourceId':_0x291564['id'],'type':_0x48ef7f['name'],'sectionId':_0x48ef7f['id']},{})[_0x0c5c('0x26')](function(){return _0x3ae194;});}else{return _0x3ae194;}})[_0x0c5c('0x47')](function(_0x4f85a1){logger[_0x0c5c('0x29')](_0x0c5c('0x52'),_0x4f85a1);throw _0x4f85a1;});}return _0x3ae194;})[_0x0c5c('0x26')](respondWithResult(_0x5688db,0xc9))[_0x0c5c('0x47')](handleError(_0x5688db,null));};exports[_0x0c5c('0x53')]=function(_0x291180,_0x110550){var _0x5a17d1={'where':{'id':_0x291180[_0x0c5c('0x54')]['id']}},_0xbf4af1={};_0xbf4af1[_0x0c5c('0x33')]=_['keys'](db[_0x0c5c('0x2f')][_0x0c5c('0x30')]);_0x5a17d1['attributes']=_[_0x0c5c('0x36')](_0xbf4af1[_0x0c5c('0x33')],qs[_0x0c5c('0x37')](_0x291180[_0x0c5c('0x34')]['fields']));_0x5a17d1[_0x0c5c('0x38')]=_0x5a17d1[_0x0c5c('0x38')][_0x0c5c('0x49')]?_0x5a17d1[_0x0c5c('0x38')]:_0xbf4af1[_0x0c5c('0x33')];if(_0x291180[_0x0c5c('0x34')]['includeAll']){_0x5a17d1[_0x0c5c('0x44')]=[{'all':!![]}];}_0x5a17d1=_[_0x0c5c('0x40')]({},_0x5a17d1,_0x291180[_0x0c5c('0x42')]);return db[_0x0c5c('0x2f')][_0x0c5c('0x4a')](_0x5a17d1)[_0x0c5c('0x26')](handleEntityNotFound(_0x110550,null))[_0x0c5c('0x26')](function(_0x1ae121){if(_0x1ae121){var _0x36ad9c=_0x1ae121[_0x0c5c('0x55')]({'plain':!![]});_0x36ad9c=qs[_0x0c5c('0x56')](_0x36ad9c,['id',_0x0c5c('0x57'),'updatedAt']);_0x291180[_0x0c5c('0x4c')]=_[_0x0c5c('0x56')](_0x291180[_0x0c5c('0x4c')],['id',_0x0c5c('0x57'),_0x0c5c('0x58')]);return db[_0x0c5c('0x2f')][_0x0c5c('0x4b')](_[_0x0c5c('0x40')](_0x36ad9c,_0x291180[_0x0c5c('0x4c')]),{'include':_0x291180[_0x0c5c('0x34')][_0x0c5c('0x43')]?[{'all':!![]}]:undefined})['then'](function(_0x3ddb11){var _0x51f1f4=_0x291180['user'][_0x0c5c('0x55')]({'plain':!![]});if(!_0x51f1f4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x51f1f4[_0x0c5c('0x4f')]===_0x0c5c('0x4d')){var _0x3d023f=_0x3ddb11[_0x0c5c('0x55')]({'plain':!![]});var _0x3b64b2=_0x0c5c('0x27');return db['UserProfileSection'][_0x0c5c('0x4a')]({'where':{'name':_0x3b64b2,'userProfileId':_0x51f1f4[_0x0c5c('0x59')]},'raw':!![]})[_0x0c5c('0x26')](function(_0x1b5853){if(_0x1b5853&&_0x1b5853[_0x0c5c('0x51')]===0x0){return db[_0x0c5c('0x28')][_0x0c5c('0x4b')]({'name':_0x3d023f['name'],'resourceId':_0x3d023f['id'],'type':_0x1b5853['name'],'sectionId':_0x1b5853['id']},{})[_0x0c5c('0x26')](function(){return _0x3ddb11;});}else{return _0x3ddb11;}})[_0x0c5c('0x47')](function(_0x6b3b0a){logger[_0x0c5c('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x6b3b0a);throw _0x6b3b0a;});}return _0x3ddb11;});}})[_0x0c5c('0x26')](respondWithResult(_0x110550,0xc9))[_0x0c5c('0x47')](handleError(_0x110550,null));};exports['update']=function(_0x2b9df5,_0x2aa341){if(_0x2b9df5['body']['id']){delete _0x2b9df5[_0x0c5c('0x4c')]['id'];}return db[_0x0c5c('0x2f')]['find']({'where':{'id':_0x2b9df5[_0x0c5c('0x54')]['id']}})[_0x0c5c('0x26')](handleEntityNotFound(_0x2aa341,null))['then'](saveUpdates(_0x2b9df5[_0x0c5c('0x4c')],null))['then'](respondWithResult(_0x2aa341,null))['catch'](handleError(_0x2aa341,null));};exports[_0x0c5c('0x25')]=function(_0x3d1517,_0xe6cbb3){return db['JscriptyProject'][_0x0c5c('0x4a')]({'where':{'id':_0x3d1517[_0x0c5c('0x54')]['id']}})[_0x0c5c('0x26')](handleEntityNotFound(_0xe6cbb3,null))[_0x0c5c('0x26')](removeEntity(_0xe6cbb3,null))['catch'](handleError(_0xe6cbb3,null));};exports[_0x0c5c('0x5a')]=function(_0x219402,_0x1d7451,_0x4e9227){var _0x676abe={'raw':!![],'where':{}};var _0x4497dd={};var _0x1ff4b8={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x219402[_0x0c5c('0x54')]['id']}})[_0x0c5c('0x26')](handleEntityNotFound(_0x1d7451,null))[_0x0c5c('0x26')](function(_0x269eef){if(_0x269eef){_0x4497dd['model']=_[_0x0c5c('0x35')](db['JscriptySessionReport'][_0x0c5c('0x30')]);_0x4497dd['query']=_[_0x0c5c('0x35')](_0x219402[_0x0c5c('0x34')]);_0x4497dd[_0x0c5c('0x3e')]=_[_0x0c5c('0x36')](_0x4497dd[_0x0c5c('0x33')],_0x4497dd['query']);_0x676abe[_0x0c5c('0x38')]=_['intersection'](_0x4497dd[_0x0c5c('0x33')],qs['fields'](_0x219402[_0x0c5c('0x34')][_0x0c5c('0x37')]));_0x676abe[_0x0c5c('0x38')]=_0x676abe['attributes']['length']?_0x676abe[_0x0c5c('0x38')]:_0x4497dd[_0x0c5c('0x33')];if(!_0x219402[_0x0c5c('0x34')][_0x0c5c('0x39')](_0x0c5c('0x3a'))){_0x676abe[_0x0c5c('0x3b')]=qs[_0x0c5c('0x3b')](_0x219402['query'][_0x0c5c('0x3b')]);_0x676abe[_0x0c5c('0x1e')]=qs['offset'](_0x219402['query'][_0x0c5c('0x1e')]);}_0x676abe[_0x0c5c('0x5b')]=qs[_0x0c5c('0x3c')](_0x219402[_0x0c5c('0x34')][_0x0c5c('0x3c')]);_0x676abe['where']=qs[_0x0c5c('0x3e')](_[_0x0c5c('0x5c')](_0x219402['query'],_0x4497dd['filters']));_0x676abe[_0x0c5c('0x3d')][_0x0c5c('0x5d')]=_0x269eef['id'];if(_0x219402[_0x0c5c('0x34')]['filter']){_0x676abe[_0x0c5c('0x3d')]=_[_0x0c5c('0x40')](_0x676abe['where'],{'$or':_[_0x0c5c('0x2e')](_0x676abe[_0x0c5c('0x38')],function(_0x4432e6){var _0x2b9c37={};_0x2b9c37[_0x4432e6]={'$like':'%'+_0x219402[_0x0c5c('0x34')]['filter']+'%'};return _0x2b9c37;})});}_0x676abe=_[_0x0c5c('0x40')]({},_0x676abe,_0x219402[_0x0c5c('0x42')]);return db[_0x0c5c('0x5e')][_0x0c5c('0x1d')]({'where':_0x676abe[_0x0c5c('0x3d')]})[_0x0c5c('0x26')](function(_0x1951ca){_0x1ff4b8[_0x0c5c('0x1d')]=_0x1951ca;if(_0x219402['query'][_0x0c5c('0x43')]){_0x676abe[_0x0c5c('0x44')]=[{'all':!![]}];}return db[_0x0c5c('0x5e')]['findAll'](_0x676abe);})['then'](function(_0x2dc141){_0x1ff4b8[_0x0c5c('0x46')]=_0x2dc141;return _0x1ff4b8;});}})[_0x0c5c('0x26')](respondWithFilteredResult(_0x1d7451,_0x676abe))[_0x0c5c('0x47')](handleError(_0x1d7451,null));};exports[_0x0c5c('0x5f')]=function(_0xfd85bf,_0x1d46ae,_0x1ac228){var _0x3dc869={'raw':!![],'where':{}};var _0x105e15={};var _0x22ccb3={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x0c5c('0x60')]({'where':{'id':_0xfd85bf[_0x0c5c('0x54')]['id']}})['then'](handleEntityNotFound(_0x1d46ae,null))[_0x0c5c('0x26')](function(_0x1f01db){if(_0x1f01db){_0x105e15[_0x0c5c('0x33')]=_[_0x0c5c('0x35')](db[_0x0c5c('0x61')][_0x0c5c('0x30')]);_0x105e15['query']=_['keys'](_0xfd85bf[_0x0c5c('0x34')]);_0x105e15[_0x0c5c('0x3e')]=_['intersection'](_0x105e15[_0x0c5c('0x33')],_0x105e15['query']);_0x3dc869[_0x0c5c('0x38')]=_['intersection'](_0x105e15['model'],qs['fields'](_0xfd85bf[_0x0c5c('0x34')][_0x0c5c('0x37')]));_0x3dc869['attributes']=_0x3dc869[_0x0c5c('0x38')][_0x0c5c('0x49')]?_0x3dc869[_0x0c5c('0x38')]:_0x105e15[_0x0c5c('0x33')];if(!_0xfd85bf['query'][_0x0c5c('0x39')](_0x0c5c('0x3a'))){_0x3dc869['limit']=qs[_0x0c5c('0x3b')](_0xfd85bf[_0x0c5c('0x34')][_0x0c5c('0x3b')]);_0x3dc869[_0x0c5c('0x1e')]=qs[_0x0c5c('0x1e')](_0xfd85bf['query'][_0x0c5c('0x1e')]);}_0x3dc869['order']=qs[_0x0c5c('0x3c')](_0xfd85bf[_0x0c5c('0x34')][_0x0c5c('0x3c')]);_0x3dc869[_0x0c5c('0x3d')]=qs[_0x0c5c('0x3e')](_['pick'](_0xfd85bf['query'],_0x105e15['filters']));_0x3dc869[_0x0c5c('0x3d')][_0x0c5c('0x5d')]=_0x1f01db['id'];if(_0xfd85bf[_0x0c5c('0x34')][_0x0c5c('0x3f')]){_0x3dc869['where']=_[_0x0c5c('0x40')](_0x3dc869[_0x0c5c('0x3d')],{'$or':_[_0x0c5c('0x2e')](_0x3dc869['attributes'],function(_0x495c90){var _0x513634={};_0x513634[_0x495c90]={'$like':'%'+_0xfd85bf[_0x0c5c('0x34')][_0x0c5c('0x3f')]+'%'};return _0x513634;})});}_0x3dc869=_[_0x0c5c('0x40')]({},_0x3dc869,_0xfd85bf[_0x0c5c('0x42')]);return db['JscriptyAnswerReport'][_0x0c5c('0x1d')]({'where':_0x3dc869[_0x0c5c('0x3d')]})['then'](function(_0x40df0c){_0x22ccb3[_0x0c5c('0x1d')]=_0x40df0c;if(_0xfd85bf[_0x0c5c('0x34')]['includeAll']){_0x3dc869[_0x0c5c('0x44')]=[{'all':!![]}];}return db[_0x0c5c('0x61')][_0x0c5c('0x45')](_0x3dc869);})[_0x0c5c('0x26')](function(_0x2892cc){_0x22ccb3[_0x0c5c('0x46')]=_0x2892cc;return _0x22ccb3;});}})['then'](respondWithFilteredResult(_0x1d46ae,_0x3dc869))['catch'](handleError(_0x1d46ae,null));};function char(_0x5c078c){return _0x0c5c('0x62')===typeof _0x5c078c?String['fromCharCode']['apply'](null,arguments):_0x5c078c;}function needsEncapsulation(_0x142c80){return!!_0x142c80&&(_0x142c80['toString']()['indexOf'](char(0xd))>=0x0||_0x142c80[_0x0c5c('0x63')]()[_0x0c5c('0x64')](char(0xa))>=0x0||_0x142c80[_0x0c5c('0x63')]()[_0x0c5c('0x64')](char(0x2c))>=0x0||_0x142c80[_0x0c5c('0x63')]()[_0x0c5c('0x64')](char(0x22))>=0x0);}function encapsulate(_0x3570b3){var _0x59ccff=char(0x22),_0x30c16f='\x5c'+char(0x22),_0x12218d=_0x3570b3[_0x0c5c('0x63')]()['replace'](new RegExp(_0x59ccff,'g'),_0x30c16f);return _0x59ccff+_0x12218d+_0x59ccff;}exports[_0x0c5c('0x65')]=function(_0x45ae99,_0x41ab23,_0x3295ed){var _0x2abb10,_0x47d2af;var _0x1ddcc4={'where':{'ProjectId':_0x45ae99['params']['id']}};if(_0x45ae99[_0x0c5c('0x34')][_0x0c5c('0x66')]){_0x1ddcc4['where'][_0x0c5c('0x67')]=JSON[_0x0c5c('0x68')](_0x45ae99['query']['startTime']);}return db[_0x0c5c('0x5e')]['findAll'](_0x1ddcc4)[_0x0c5c('0x26')](handleEntityNotFound(_0x41ab23,null))[_0x0c5c('0x26')](function(_0x27ffd9){if(_0x27ffd9){_0x2abb10=_0x27ffd9;return db[_0x0c5c('0x69')][_0x0c5c('0x45')]({'where':{'SessionId':{'$in':_['map'](_0x2abb10,'id')},'ProjectId':_0x45ae99['params']['id']},'order':_0x0c5c('0x6a')});}})['then'](handleEntityNotFound(_0x41ab23,null))[_0x0c5c('0x26')](function(_0x25f680){if(_0x25f680){_0x47d2af=_0x25f680;var _0x3c3201={};for(var _0x2ddd87=0x0,_0x5969a8=_0x47d2af[_0x0c5c('0x49')];_0x2ddd87<_0x5969a8;_0x2ddd87++){if(!_0x3c3201[_0x0c5c('0x39')](_0x47d2af[_0x2ddd87][_0x0c5c('0x6b')])){_0x3c3201[_0x47d2af[_0x2ddd87][_0x0c5c('0x6b')]]=needsEncapsulation(_0x47d2af[_0x2ddd87][_0x0c5c('0x6c')])?encapsulate(_0x47d2af[_0x2ddd87][_0x0c5c('0x6c')]):_0x47d2af[_0x2ddd87][_0x0c5c('0x6c')];}}var _0x34a90d=[],_0x335ea2={};for(var _0x571291=0x0,_0xd295dc=_0x2abb10[_0x0c5c('0x49')];_0x571291<_0xd295dc;_0x571291++){_0x335ea2={'ProjectId':_0x45ae99[_0x0c5c('0x54')]['id'],'SessionId':_0x2abb10[_0x571291]['id'],'StartTime':moment(_0x2abb10[_0x571291][_0x0c5c('0x67')])['format'](_0x0c5c('0x6d'))};for(var _0x419456=0x0,_0x1d5abf=_0x47d2af[_0x0c5c('0x49')];_0x419456<_0x1d5abf;_0x419456++){if(_0x47d2af[_0x419456][_0x0c5c('0x6e')]==_0x2abb10[_0x571291]['id']&&_0x3c3201[_0x0c5c('0x39')](_0x47d2af[_0x419456][_0x0c5c('0x6b')])){_0x335ea2[_0x3c3201[_0x47d2af[_0x419456][_0x0c5c('0x6b')]]]=_0x47d2af[_0x419456][_0x0c5c('0x6f')];}}for(var _0x246e74 in _0x3c3201){if(!_0x335ea2[_0x0c5c('0x39')](_0x3c3201[_0x246e74])){_0x335ea2[_0x3c3201[_0x246e74]]=null;}}_0x34a90d[_0x0c5c('0x70')](_0x335ea2);}return _0x34a90d;}})[_0x0c5c('0x26')](function(_0x44675f){if(!_[_0x0c5c('0x71')](_0x44675f)){var _0x20246b=toCsv(_0x44675f);var _0x3ff9bc=Date['now']();fs['writeFileSync'](util['format'](_0x0c5c('0x72'),_0x45ae99['params']['id'],_0x3ff9bc),_0x20246b);_0x41ab23[_0x0c5c('0x73')](_0x0c5c('0x74'),_0x0c5c('0x75')+util[_0x0c5c('0x76')]('Jscripty_Project_%d_Summary_%s.csv',_0x45ae99[_0x0c5c('0x54')]['id'],_0x3ff9bc));_0x41ab23[_0x0c5c('0x73')](_0x0c5c('0x77'),_0x0c5c('0x78'));return _0x41ab23[_0x0c5c('0x79')](util[_0x0c5c('0x76')](_0x0c5c('0x72'),_0x45ae99[_0x0c5c('0x54')]['id'],_0x3ff9bc));}else{return _0x41ab23[_0x0c5c('0x18')](0xcc);}})[_0x0c5c('0x47')](handleError(_0x41ab23,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index dfa8ad6..7aa7930 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 _0x5b5a=['exports','define','jscripty_projects','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5b5a,0xc3));var _0xa5b5=function(_0x3bc3b4,_0x5acff4){_0x3bc3b4=_0x3bc3b4-0x0;var _0x4c546b=_0x5b5a[_0x3bc3b4];return _0x4c546b;};'use strict';var _=require('lodash');var util=require(_0xa5b5('0x0'));var logger=require(_0xa5b5('0x1'))('api');var moment=require(_0xa5b5('0x2'));var BPromise=require(_0xa5b5('0x3'));var rp=require(_0xa5b5('0x4'));var fs=require('fs');var path=require(_0xa5b5('0x5'));var rimraf=require(_0xa5b5('0x6'));var config=require(_0xa5b5('0x7'));var attributes=require(_0xa5b5('0x8'));module[_0xa5b5('0x9')]=function(_0x509b78,_0x33678e){return _0x509b78[_0xa5b5('0xa')]('JscriptyProject',attributes,{'tableName':_0xa5b5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2caf=['rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','api','bluebird','request-promise','path'];(function(_0x38f142,_0x6392b6){var _0x4965c4=function(_0x1bf344){while(--_0x1bf344){_0x38f142['push'](_0x38f142['shift']());}};_0x4965c4(++_0x6392b6);}(_0x2caf,0x6a));var _0xf2ca=function(_0x238a72,_0x4bb866){_0x238a72=_0x238a72-0x0;var _0x10166e=_0x2caf[_0x238a72];return _0x10166e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf2ca('0x0'));var moment=require('moment');var BPromise=require(_0xf2ca('0x1'));var rp=require(_0xf2ca('0x2'));var fs=require('fs');var path=require(_0xf2ca('0x3'));var rimraf=require(_0xf2ca('0x4'));var config=require(_0xf2ca('0x5'));var attributes=require(_0xf2ca('0x6'));module[_0xf2ca('0x7')]=function(_0x51372a,_0x8ce770){return _0x51372a[_0xf2ca('0x8')](_0xf2ca('0x9'),attributes,{'tableName':'jscripty_projects','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 d14a893..ac67641 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 _0xbdb7=['request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','JscriptyProject,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x48694f,_0x44690e){_0x48694f=_0x48694f-0x0;var _0x28aeb0=_0xbdb7[_0x48694f];return _0x28aeb0;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});} \ No newline at end of file +var _0xa9e0=['http','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5b5426,_0x35499e){var _0x34274e=function(_0x33f6c5){while(--_0x33f6c5){_0x5b5426['push'](_0x5b5426['shift']());}};_0x34274e(++_0x35499e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index d06e7e2..4f701c1 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 _0x1c11=['put','update','delete','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create'];(function(_0x59217d,_0x4546b0){var _0x3b72c6=function(_0x8c16a7){while(--_0x8c16a7){_0x59217d['push'](_0x59217d['shift']());}};_0x3b72c6(++_0x4546b0);}(_0x1c11,0x6a));var _0x11c1=function(_0x240560,_0x58f6d8){_0x240560=_0x240560-0x0;var _0x2aaa9a=_0x1c11[_0x240560];return _0x2aaa9a;};'use strict';var multer=require(_0x11c1('0x0'));var util=require(_0x11c1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x11c1('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x11c1('0x3'));var interaction=require(_0x11c1('0x4'));var config=require(_0x11c1('0x5'));var controller=require('./jscriptyQuestionReport.controller');router['get']('/',auth[_0x11c1('0x6')](),controller[_0x11c1('0x7')]);router[_0x11c1('0x8')]('/describe',auth[_0x11c1('0x6')](),controller['describe']);router[_0x11c1('0x8')](_0x11c1('0x9'),auth['isAuthenticated'](),controller[_0x11c1('0xa')]);router[_0x11c1('0xb')]('/',auth[_0x11c1('0x6')](),controller[_0x11c1('0xc')]);router[_0x11c1('0xd')](_0x11c1('0x9'),auth[_0x11c1('0x6')](),controller[_0x11c1('0xe')]);router[_0x11c1('0xf')](_0x11c1('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x11c1('0x10')]=router; \ No newline at end of file +var _0x2c00=['destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete'];(function(_0x377a6e,_0x59b99d){var _0x37f751=function(_0x2ed25c){while(--_0x2ed25c){_0x377a6e['push'](_0x377a6e['shift']());}};_0x37f751(++_0x59b99d);}(_0x2c00,0xa2));var _0x02c0=function(_0x36f47c,_0x38ef4d){_0x36f47c=_0x36f47c-0x0;var _0x296c55=_0x2c00[_0x36f47c];return _0x296c55;};'use strict';var multer=require(_0x02c0('0x0'));var util=require(_0x02c0('0x1'));var path=require(_0x02c0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x02c0('0x3'));var auth=require(_0x02c0('0x4'));var interaction=require(_0x02c0('0x5'));var config=require(_0x02c0('0x6'));var controller=require('./jscriptyQuestionReport.controller');router[_0x02c0('0x7')]('/',auth[_0x02c0('0x8')](),controller['index']);router[_0x02c0('0x7')](_0x02c0('0x9'),auth[_0x02c0('0x8')](),controller[_0x02c0('0xa')]);router[_0x02c0('0x7')](_0x02c0('0xb'),auth['isAuthenticated'](),controller[_0x02c0('0xc')]);router[_0x02c0('0xd')]('/',auth[_0x02c0('0x8')](),controller[_0x02c0('0xe')]);router[_0x02c0('0xf')](_0x02c0('0xb'),auth['isAuthenticated'](),controller[_0x02c0('0x10')]);router[_0x02c0('0x11')](_0x02c0('0xb'),auth[_0x02c0('0x8')](),controller[_0x02c0('0x12')]);module[_0x02c0('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index b00e8fc..68d8701 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(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x7a54,0x106));var _0x47a5=function(_0x5dd5b8,_0x1ccf85){_0x5dd5b8=_0x5dd5b8-0x0;var _0x16aef1=_0x7a54[_0x5dd5b8];return _0x16aef1;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x7a54,0x106));var _0x47a5=function(_0x4f197f,_0x201042){_0x4f197f=_0x4f197f-0x0;var _0x17f222=_0x7a54[_0x4f197f];return _0x17f222;};'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 5b305b2..231b655 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 _0xfe51=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','JscriptyQuestionReport','rawAttributes','model','map','keys','query','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','type','VIRTUAL','merge','options','catch','show','params','intersection','includeAll','create','body','find','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','sox'];(function(_0x45e58a,_0x279a39){var _0x1635ba=function(_0x3c10b8){while(--_0x3c10b8){_0x45e58a['push'](_0x45e58a['shift']());}};_0x1635ba(++_0x279a39);}(_0xfe51,0x90));var _0x1fe5=function(_0x5c803d,_0x2a26d0){_0x5c803d=_0x5c803d-0x0;var _0x373d00=_0xfe51[_0x5c803d];return _0x373d00;};'use strict';var emlformat=require(_0x1fe5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1fe5('0x1'));var jsonpatch=require(_0x1fe5('0x2'));var rp=require('request-promise');var moment=require(_0x1fe5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1fe5('0x4'));var util=require('util');var path=require('path');var sox=require(_0x1fe5('0x5'));var csv=require(_0x1fe5('0x6'));var ejs=require(_0x1fe5('0x7'));var fs=require('fs');var fs_extra=require(_0x1fe5('0x8'));var _=require(_0x1fe5('0x9'));var squel=require(_0x1fe5('0xa'));var crypto=require(_0x1fe5('0xb'));var jsforce=require(_0x1fe5('0xc'));var deskjs=require(_0x1fe5('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1fe5('0xe'));var Papa=require(_0x1fe5('0xf'));var Redis=require(_0x1fe5('0x10'));var authService=require(_0x1fe5('0x11'));var qs=require(_0x1fe5('0x12'));var as=require(_0x1fe5('0x13'));var hardwareService=require(_0x1fe5('0x14'));var logger=require(_0x1fe5('0x15'))('api');var utils=require(_0x1fe5('0x16'));var config=require(_0x1fe5('0x17'));var licenseUtil=require(_0x1fe5('0x18'));var db=require(_0x1fe5('0x19'))['db'];function respondWithStatusCode(_0x243b15,_0x5f3799){_0x5f3799=_0x5f3799||0xcc;return function(_0x446909){if(_0x446909){return _0x243b15[_0x1fe5('0x1a')](_0x5f3799);}return _0x243b15[_0x1fe5('0x1b')](_0x5f3799)[_0x1fe5('0x1c')]();};}function respondWithResult(_0x2cacfb,_0x4fc5ca){_0x4fc5ca=_0x4fc5ca||0xc8;return function(_0x4ee901){if(_0x4ee901){return _0x2cacfb[_0x1fe5('0x1b')](_0x4fc5ca)[_0x1fe5('0x1d')](_0x4ee901);}};}function respondWithFilteredResult(_0x195776,_0x2c23eb){return function(_0x402664){if(_0x402664){var _0x2b5974=typeof _0x2c23eb['offset']===_0x1fe5('0x1e')&&typeof _0x2c23eb[_0x1fe5('0x1f')]===_0x1fe5('0x1e');var _0x29f399=_0x402664[_0x1fe5('0x20')];var _0x4e1c84=_0x2b5974?0x0:_0x2c23eb[_0x1fe5('0x21')];var _0x2b9313=_0x2b5974?_0x402664['count']:_0x2c23eb[_0x1fe5('0x21')]+_0x2c23eb['limit'];var _0xf7f161;if(_0x2b9313>=_0x29f399){_0x2b9313=_0x29f399;_0xf7f161=0xc8;}else{_0xf7f161=0xce;}_0x195776[_0x1fe5('0x1b')](_0xf7f161);return _0x195776[_0x1fe5('0x22')]('Content-Range',_0x4e1c84+'-'+_0x2b9313+'/'+_0x29f399)[_0x1fe5('0x1d')](_0x402664);}return null;};}function patchUpdates(_0x4dfab0){return function(_0x5b9f9e){try{jsonpatch[_0x1fe5('0x23')](_0x5b9f9e,_0x4dfab0,!![]);}catch(_0x2c1d70){return BPromise[_0x1fe5('0x24')](_0x2c1d70);}return _0x5b9f9e[_0x1fe5('0x25')]();};}function saveUpdates(_0x29fac2,_0x16520c){return function(_0x423986){if(_0x423986){return _0x423986[_0x1fe5('0x26')](_0x29fac2)[_0x1fe5('0x27')](function(_0x5b965d){return _0x5b965d;});}return null;};}function removeEntity(_0x4dad62,_0x564e12){return function(_0x300f28){if(_0x300f28){return _0x300f28[_0x1fe5('0x28')]()['then'](function(){_0x4dad62['status'](0xcc)[_0x1fe5('0x1c')]();});}};}function handleEntityNotFound(_0x2eab86,_0x4bd3ff){return function(_0x32f870){if(!_0x32f870){_0x2eab86['sendStatus'](0x194);}return _0x32f870;};}function handleError(_0x51c82b,_0x594a4b){_0x594a4b=_0x594a4b||0x1f4;return function(_0x426cbb){logger[_0x1fe5('0x29')](_0x426cbb[_0x1fe5('0x2a')]);if(_0x426cbb[_0x1fe5('0x2b')]){delete _0x426cbb[_0x1fe5('0x2b')];}_0x51c82b[_0x1fe5('0x1b')](_0x594a4b)[_0x1fe5('0x2c')](_0x426cbb);};}exports[_0x1fe5('0x2d')]=function(_0x1eb153,_0x4289bc){var _0x500d53={},_0x587a1d={},_0x191b92={'count':0x0,'rows':[]};var _0x2af0f1=_['map'](db[_0x1fe5('0x2e')][_0x1fe5('0x2f')],function(_0x53ca59){return{'name':_0x53ca59['fieldName'],'type':_0x53ca59['type']['key']};});_0x587a1d[_0x1fe5('0x30')]=_[_0x1fe5('0x31')](_0x2af0f1,'name');_0x587a1d['query']=_[_0x1fe5('0x32')](_0x1eb153[_0x1fe5('0x33')]);_0x587a1d['filters']=_['intersection'](_0x587a1d[_0x1fe5('0x30')],_0x587a1d[_0x1fe5('0x33')]);_0x500d53[_0x1fe5('0x34')]=_['intersection'](_0x587a1d[_0x1fe5('0x30')],qs[_0x1fe5('0x35')](_0x1eb153[_0x1fe5('0x33')]['fields']));_0x500d53[_0x1fe5('0x34')]=_0x500d53[_0x1fe5('0x34')][_0x1fe5('0x36')]?_0x500d53[_0x1fe5('0x34')]:_0x587a1d['model'];if(!_0x1eb153['query'][_0x1fe5('0x37')](_0x1fe5('0x38'))){_0x500d53['limit']=qs[_0x1fe5('0x1f')](_0x1eb153[_0x1fe5('0x33')][_0x1fe5('0x1f')]);_0x500d53[_0x1fe5('0x21')]=qs[_0x1fe5('0x21')](_0x1eb153[_0x1fe5('0x33')][_0x1fe5('0x21')]);}_0x500d53[_0x1fe5('0x39')]=qs['sort'](_0x1eb153[_0x1fe5('0x33')]['sort']);_0x500d53[_0x1fe5('0x3a')]=qs[_0x1fe5('0x3b')](_[_0x1fe5('0x3c')](_0x1eb153['query'],_0x587a1d[_0x1fe5('0x3b')]),_0x2af0f1);if(_0x1eb153['query'][_0x1fe5('0x3d')]){_0x500d53[_0x1fe5('0x3a')]=_['merge'](_0x500d53[_0x1fe5('0x3a')],{'$or':_[_0x1fe5('0x31')](_0x2af0f1,function(_0x19899e){if(_0x19899e[_0x1fe5('0x3e')]!==_0x1fe5('0x3f')){var _0x48c0be={};_0x48c0be[_0x19899e[_0x1fe5('0x2b')]]={'$like':'%'+_0x1eb153[_0x1fe5('0x33')][_0x1fe5('0x3d')]+'%'};return _0x48c0be;}})});}_0x500d53=_[_0x1fe5('0x40')]({},_0x500d53,_0x1eb153[_0x1fe5('0x41')]);var _0x3828d3={'where':_0x500d53[_0x1fe5('0x3a')]};return db[_0x1fe5('0x2e')]['count'](_0x3828d3)[_0x1fe5('0x27')](function(_0x5dbaf6){_0x191b92[_0x1fe5('0x20')]=_0x5dbaf6;if(_0x1eb153[_0x1fe5('0x33')]['includeAll']){_0x500d53['include']=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x500d53);})[_0x1fe5('0x27')](function(_0x2bca79){_0x191b92['rows']=_0x2bca79;return _0x191b92;})[_0x1fe5('0x27')](respondWithFilteredResult(_0x4289bc,_0x500d53))[_0x1fe5('0x42')](handleError(_0x4289bc,null));};exports[_0x1fe5('0x43')]=function(_0x42c2a1,_0x1fff42){var _0x52374a={'raw':!![],'where':{'id':_0x42c2a1[_0x1fe5('0x44')]['id']}},_0x240757={};_0x240757[_0x1fe5('0x30')]=_[_0x1fe5('0x32')](db[_0x1fe5('0x2e')][_0x1fe5('0x2f')]);_0x240757[_0x1fe5('0x33')]=_[_0x1fe5('0x32')](_0x42c2a1[_0x1fe5('0x33')]);_0x240757[_0x1fe5('0x3b')]=_['intersection'](_0x240757[_0x1fe5('0x30')],_0x240757['query']);_0x52374a['attributes']=_[_0x1fe5('0x45')](_0x240757[_0x1fe5('0x30')],qs['fields'](_0x42c2a1[_0x1fe5('0x33')][_0x1fe5('0x35')]));_0x52374a[_0x1fe5('0x34')]=_0x52374a[_0x1fe5('0x34')][_0x1fe5('0x36')]?_0x52374a['attributes']:_0x240757[_0x1fe5('0x30')];if(_0x42c2a1[_0x1fe5('0x33')][_0x1fe5('0x46')]){_0x52374a['include']=[{'all':!![]}];}_0x52374a=_['merge']({},_0x52374a,_0x42c2a1[_0x1fe5('0x41')]);return db[_0x1fe5('0x2e')]['find'](_0x52374a)['then'](handleEntityNotFound(_0x1fff42,null))['then'](respondWithResult(_0x1fff42,null))[_0x1fe5('0x42')](handleError(_0x1fff42,null));};exports[_0x1fe5('0x47')]=function(_0x1d1d97,_0x1228f4){return db['JscriptyQuestionReport'][_0x1fe5('0x47')](_0x1d1d97['body'],{})[_0x1fe5('0x27')](respondWithResult(_0x1228f4,0xc9))[_0x1fe5('0x42')](handleError(_0x1228f4,null));};exports[_0x1fe5('0x26')]=function(_0x41909f,_0x557d14){if(_0x41909f[_0x1fe5('0x48')]['id']){delete _0x41909f[_0x1fe5('0x48')]['id'];}return db['JscriptyQuestionReport'][_0x1fe5('0x49')]({'where':{'id':_0x41909f[_0x1fe5('0x44')]['id']}})['then'](handleEntityNotFound(_0x557d14,null))[_0x1fe5('0x27')](saveUpdates(_0x41909f[_0x1fe5('0x48')],null))['then'](respondWithResult(_0x557d14,null))[_0x1fe5('0x42')](handleError(_0x557d14,null));};exports['destroy']=function(_0x36fdde,_0x4b0ab9){return db[_0x1fe5('0x2e')][_0x1fe5('0x49')]({'where':{'id':_0x36fdde[_0x1fe5('0x44')]['id']}})[_0x1fe5('0x27')](handleEntityNotFound(_0x4b0ab9,null))[_0x1fe5('0x27')](removeEntity(_0x4b0ab9,null))['catch'](handleError(_0x4b0ab9,null));};exports[_0x1fe5('0x4a')]=function(_0x54f31d,_0x5218c9){return db['JscriptyQuestionReport'][_0x1fe5('0x4a')]()[_0x1fe5('0x27')](respondWithResult(_0x5218c9,null))[_0x1fe5('0x42')](handleError(_0x5218c9,null));}; \ No newline at end of file +var _0xf5bf=['fieldName','type','key','model','query','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','intersection','find','create','body','update','describe','eml-format','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','JscriptyQuestionReport','rawAttributes'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xf5bf,0xaf));var _0xff5b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf5bf[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xff5b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xff5b('0x1'));var BPromise=require(_0xff5b('0x2'));var Mustache=require(_0xff5b('0x3'));var util=require(_0xff5b('0x4'));var path=require('path');var sox=require(_0xff5b('0x5'));var csv=require(_0xff5b('0x6'));var ejs=require(_0xff5b('0x7'));var fs=require('fs');var fs_extra=require(_0xff5b('0x8'));var _=require('lodash');var squel=require(_0xff5b('0x9'));var crypto=require(_0xff5b('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xff5b('0xb'));var Redis=require(_0xff5b('0xc'));var authService=require(_0xff5b('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xff5b('0xe'));var hardwareService=require(_0xff5b('0xf'));var logger=require('../../config/logger')(_0xff5b('0x10'));var utils=require(_0xff5b('0x11'));var config=require(_0xff5b('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xff5b('0x13'))['db'];function respondWithStatusCode(_0x16f959,_0x39e1e4){_0x39e1e4=_0x39e1e4||0xcc;return function(_0x536ab7){if(_0x536ab7){return _0x16f959['sendStatus'](_0x39e1e4);}return _0x16f959[_0xff5b('0x14')](_0x39e1e4)[_0xff5b('0x15')]();};}function respondWithResult(_0x3be648,_0x4871e1){_0x4871e1=_0x4871e1||0xc8;return function(_0x2e59f1){if(_0x2e59f1){return _0x3be648[_0xff5b('0x14')](_0x4871e1)[_0xff5b('0x16')](_0x2e59f1);}};}function respondWithFilteredResult(_0x2dc0b3,_0x82da90){return function(_0x5e478b){if(_0x5e478b){var _0x4e30e3=typeof _0x82da90[_0xff5b('0x17')]===_0xff5b('0x18')&&typeof _0x82da90[_0xff5b('0x19')]===_0xff5b('0x18');var _0x110842=_0x5e478b[_0xff5b('0x1a')];var _0x364d42=_0x4e30e3?0x0:_0x82da90[_0xff5b('0x17')];var _0x5a1785=_0x4e30e3?_0x5e478b[_0xff5b('0x1a')]:_0x82da90[_0xff5b('0x17')]+_0x82da90[_0xff5b('0x19')];var _0x4185d9;if(_0x5a1785>=_0x110842){_0x5a1785=_0x110842;_0x4185d9=0xc8;}else{_0x4185d9=0xce;}_0x2dc0b3[_0xff5b('0x14')](_0x4185d9);return _0x2dc0b3[_0xff5b('0x1b')](_0xff5b('0x1c'),_0x364d42+'-'+_0x5a1785+'/'+_0x110842)[_0xff5b('0x16')](_0x5e478b);}return null;};}function patchUpdates(_0x4d7a11){return function(_0x2d9592){try{jsonpatch[_0xff5b('0x1d')](_0x2d9592,_0x4d7a11,!![]);}catch(_0x428a8b){return BPromise[_0xff5b('0x1e')](_0x428a8b);}return _0x2d9592[_0xff5b('0x1f')]();};}function saveUpdates(_0x59ff7d,_0x580445){return function(_0xa7709d){if(_0xa7709d){return _0xa7709d['update'](_0x59ff7d)[_0xff5b('0x20')](function(_0x4b303a){return _0x4b303a;});}return null;};}function removeEntity(_0x4d51cc,_0x145eac){return function(_0x5bd5ed){if(_0x5bd5ed){return _0x5bd5ed[_0xff5b('0x21')]()[_0xff5b('0x20')](function(){_0x4d51cc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x133405,_0x3eaaea){return function(_0x4c46af){if(!_0x4c46af){_0x133405['sendStatus'](0x194);}return _0x4c46af;};}function handleError(_0x26b9ea,_0x4c7b85){_0x4c7b85=_0x4c7b85||0x1f4;return function(_0x2deb64){logger[_0xff5b('0x22')](_0x2deb64[_0xff5b('0x23')]);if(_0x2deb64[_0xff5b('0x24')]){delete _0x2deb64[_0xff5b('0x24')];}_0x26b9ea['status'](_0x4c7b85)['send'](_0x2deb64);};}exports[_0xff5b('0x25')]=function(_0x2b2f05,_0xbbe741){var _0x13dbec={},_0x45d1a4={},_0x391ee3={'count':0x0,'rows':[]};var _0x31ca08=_[_0xff5b('0x26')](db[_0xff5b('0x27')][_0xff5b('0x28')],function(_0x50a9ce){return{'name':_0x50a9ce[_0xff5b('0x29')],'type':_0x50a9ce[_0xff5b('0x2a')][_0xff5b('0x2b')]};});_0x45d1a4[_0xff5b('0x2c')]=_['map'](_0x31ca08,'name');_0x45d1a4['query']=_['keys'](_0x2b2f05[_0xff5b('0x2d')]);_0x45d1a4['filters']=_['intersection'](_0x45d1a4[_0xff5b('0x2c')],_0x45d1a4[_0xff5b('0x2d')]);_0x13dbec[_0xff5b('0x2e')]=_['intersection'](_0x45d1a4['model'],qs[_0xff5b('0x2f')](_0x2b2f05['query']['fields']));_0x13dbec[_0xff5b('0x2e')]=_0x13dbec[_0xff5b('0x2e')][_0xff5b('0x30')]?_0x13dbec[_0xff5b('0x2e')]:_0x45d1a4[_0xff5b('0x2c')];if(!_0x2b2f05[_0xff5b('0x2d')]['hasOwnProperty'](_0xff5b('0x31'))){_0x13dbec[_0xff5b('0x19')]=qs[_0xff5b('0x19')](_0x2b2f05['query'][_0xff5b('0x19')]);_0x13dbec['offset']=qs['offset'](_0x2b2f05[_0xff5b('0x2d')][_0xff5b('0x17')]);}_0x13dbec[_0xff5b('0x32')]=qs[_0xff5b('0x33')](_0x2b2f05['query']['sort']);_0x13dbec['where']=qs[_0xff5b('0x34')](_[_0xff5b('0x35')](_0x2b2f05[_0xff5b('0x2d')],_0x45d1a4[_0xff5b('0x34')]),_0x31ca08);if(_0x2b2f05[_0xff5b('0x2d')][_0xff5b('0x36')]){_0x13dbec[_0xff5b('0x37')]=_[_0xff5b('0x38')](_0x13dbec['where'],{'$or':_[_0xff5b('0x26')](_0x31ca08,function(_0x3f09d4){if(_0x3f09d4[_0xff5b('0x2a')]!==_0xff5b('0x39')){var _0x5749af={};_0x5749af[_0x3f09d4[_0xff5b('0x24')]]={'$like':'%'+_0x2b2f05['query'][_0xff5b('0x36')]+'%'};return _0x5749af;}})});}_0x13dbec=_[_0xff5b('0x38')]({},_0x13dbec,_0x2b2f05[_0xff5b('0x3a')]);var _0x3975c1={'where':_0x13dbec[_0xff5b('0x37')]};return db[_0xff5b('0x27')][_0xff5b('0x1a')](_0x3975c1)['then'](function(_0x431bf1){_0x391ee3[_0xff5b('0x1a')]=_0x431bf1;if(_0x2b2f05['query'][_0xff5b('0x3b')]){_0x13dbec[_0xff5b('0x3c')]=[{'all':!![]}];}return db[_0xff5b('0x27')][_0xff5b('0x3d')](_0x13dbec);})[_0xff5b('0x20')](function(_0x112275){_0x391ee3[_0xff5b('0x3e')]=_0x112275;return _0x391ee3;})[_0xff5b('0x20')](respondWithFilteredResult(_0xbbe741,_0x13dbec))[_0xff5b('0x3f')](handleError(_0xbbe741,null));};exports[_0xff5b('0x40')]=function(_0x59ea16,_0x39cb3f){var _0x2bece7={'raw':!![],'where':{'id':_0x59ea16['params']['id']}},_0x40153f={};_0x40153f[_0xff5b('0x2c')]=_[_0xff5b('0x41')](db[_0xff5b('0x27')][_0xff5b('0x28')]);_0x40153f['query']=_['keys'](_0x59ea16[_0xff5b('0x2d')]);_0x40153f[_0xff5b('0x34')]=_[_0xff5b('0x42')](_0x40153f[_0xff5b('0x2c')],_0x40153f[_0xff5b('0x2d')]);_0x2bece7[_0xff5b('0x2e')]=_[_0xff5b('0x42')](_0x40153f[_0xff5b('0x2c')],qs['fields'](_0x59ea16['query'][_0xff5b('0x2f')]));_0x2bece7['attributes']=_0x2bece7[_0xff5b('0x2e')][_0xff5b('0x30')]?_0x2bece7['attributes']:_0x40153f[_0xff5b('0x2c')];if(_0x59ea16['query'][_0xff5b('0x3b')]){_0x2bece7[_0xff5b('0x3c')]=[{'all':!![]}];}_0x2bece7=_['merge']({},_0x2bece7,_0x59ea16[_0xff5b('0x3a')]);return db[_0xff5b('0x27')][_0xff5b('0x43')](_0x2bece7)['then'](handleEntityNotFound(_0x39cb3f,null))['then'](respondWithResult(_0x39cb3f,null))[_0xff5b('0x3f')](handleError(_0x39cb3f,null));};exports[_0xff5b('0x44')]=function(_0x13a53d,_0x306cbb){return db['JscriptyQuestionReport'][_0xff5b('0x44')](_0x13a53d[_0xff5b('0x45')],{})[_0xff5b('0x20')](respondWithResult(_0x306cbb,0xc9))[_0xff5b('0x3f')](handleError(_0x306cbb,null));};exports[_0xff5b('0x46')]=function(_0x474e21,_0x46875f){if(_0x474e21['body']['id']){delete _0x474e21['body']['id'];}return db[_0xff5b('0x27')][_0xff5b('0x43')]({'where':{'id':_0x474e21['params']['id']}})['then'](handleEntityNotFound(_0x46875f,null))[_0xff5b('0x20')](saveUpdates(_0x474e21[_0xff5b('0x45')],null))[_0xff5b('0x20')](respondWithResult(_0x46875f,null))[_0xff5b('0x3f')](handleError(_0x46875f,null));};exports[_0xff5b('0x21')]=function(_0x2a6c7f,_0x34c43b){return db[_0xff5b('0x27')][_0xff5b('0x43')]({'where':{'id':_0x2a6c7f['params']['id']}})['then'](handleEntityNotFound(_0x34c43b,null))[_0xff5b('0x20')](removeEntity(_0x34c43b,null))[_0xff5b('0x3f')](handleError(_0x34c43b,null));};exports[_0xff5b('0x47')]=function(_0xf9af6e,_0x2f9a7e){return db[_0xff5b('0x27')]['describe']()[_0xff5b('0x20')](respondWithResult(_0x2f9a7e,null))[_0xff5b('0x3f')](handleError(_0x2f9a7e,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 4d325ad..59f91fc 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 _0xccf2=['bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','lodash','../../config/logger','api','moment'];(function(_0x3b2816,_0x4b158c){var _0x4019fe=function(_0x2d8acb){while(--_0x2d8acb){_0x3b2816['push'](_0x3b2816['shift']());}};_0x4019fe(++_0x4b158c);}(_0xccf2,0x164));var _0x2ccf=function(_0x36ffa6,_0x4da9a5){_0x36ffa6=_0x36ffa6-0x0;var _0xb75312=_0xccf2[_0x36ffa6];return _0xb75312;};'use strict';var _=require(_0x2ccf('0x0'));var util=require('util');var logger=require(_0x2ccf('0x1'))(_0x2ccf('0x2'));var moment=require(_0x2ccf('0x3'));var BPromise=require(_0x2ccf('0x4'));var rp=require(_0x2ccf('0x5'));var fs=require('fs');var path=require(_0x2ccf('0x6'));var rimraf=require(_0x2ccf('0x7'));var config=require(_0x2ccf('0x8'));var attributes=require(_0x2ccf('0x9'));module[_0x2ccf('0xa')]=function(_0x123989,_0x1baf52){return _0x123989[_0x2ccf('0xb')]('JscriptyQuestionReport',attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x38c5=['../../config/environment','exports','define','report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x532b6f,_0x362086){var _0x5b9986=function(_0x371001){while(--_0x371001){_0x532b6f['push'](_0x532b6f['shift']());}};_0x5b9986(++_0x362086);}(_0x38c5,0x86));var _0x538c=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x38c5[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x538c('0x0'));var util=require(_0x538c('0x1'));var logger=require(_0x538c('0x2'))(_0x538c('0x3'));var moment=require(_0x538c('0x4'));var BPromise=require(_0x538c('0x5'));var rp=require(_0x538c('0x6'));var fs=require('fs');var path=require(_0x538c('0x7'));var rimraf=require(_0x538c('0x8'));var config=require(_0x538c('0x9'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x538c('0xa')]=function(_0x362b73,_0x1463c8){return _0x362b73[_0x538c('0xb')]('JscriptyQuestionReport',attributes,{'tableName':_0x538c('0xc'),'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 87447f2..7ed7423 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 _0xf447=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','message','info','result','lodash','util','moment','randomstring'];(function(_0x2ac139,_0x1bcbfe){var _0xf7ab77=function(_0x48a797){while(--_0x48a797){_0x2ac139['push'](_0x2ac139['shift']());}};_0xf7ab77(++_0x1bcbfe);}(_0xf447,0x18b));var _0x7f44=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xf447[_0x29d94e];return _0x106237;};'use strict';var _=require(_0x7f44('0x0'));var util=require(_0x7f44('0x1'));var moment=require(_0x7f44('0x2'));var BPromise=require('bluebird');var rs=require(_0x7f44('0x3'));var fs=require('fs');var Redis=require(_0x7f44('0x4'));var db=require(_0x7f44('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f44('0x6'))(_0x7f44('0x7'));var config=require(_0x7f44('0x8'));var jayson=require(_0x7f44('0x9'));var client=jayson[_0x7f44('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59acfb,_0x159a68,_0xd9e6e){return new BPromise(function(_0x4b9282,_0x35d80a){return client[_0x7f44('0xb')](_0x59acfb,_0xd9e6e)[_0x7f44('0xc')](function(_0x4dd6ba){logger['info'](_0x7f44('0xd'),_0x159a68,_0x7f44('0xe'));logger[_0x7f44('0xf')](_0x7f44('0x10'),_0x159a68,'request\x20sent',JSON['stringify'](_0x4dd6ba));if(_0x4dd6ba[_0x7f44('0x11')]){if(_0x4dd6ba[_0x7f44('0x11')]['code']===0x1f4){logger[_0x7f44('0x11')](_0x7f44('0xd'),_0x159a68,_0x4dd6ba[_0x7f44('0x11')][_0x7f44('0x12')]);return _0x35d80a(_0x4dd6ba[_0x7f44('0x11')][_0x7f44('0x12')]);}logger[_0x7f44('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x159a68,_0x4dd6ba[_0x7f44('0x11')][_0x7f44('0x12')]);return _0x4b9282(_0x4dd6ba[_0x7f44('0x11')]['message']);}else{logger[_0x7f44('0x13')](_0x7f44('0xd'),_0x159a68,_0x7f44('0xe'));_0x4b9282(_0x4dd6ba[_0x7f44('0x14')][_0x7f44('0x12')]);}})['catch'](function(_0xe50273){logger['error'](_0x7f44('0xd'),_0x159a68,_0xe50273);_0x35d80a(_0xe50273);});});} \ No newline at end of file +var _0xf1b9=['jayson/promise','http','request','then','info','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x446e2c,_0x57f9ba){var _0x727b86=function(_0x495411){while(--_0x495411){_0x446e2c['push'](_0x446e2c['shift']());}};_0x727b86(++_0x57f9ba);}(_0xf1b9,0x116));var _0x9f1b=function(_0x1ce079,_0x1db391){_0x1ce079=_0x1ce079-0x0;var _0x67ae62=_0xf1b9[_0x1ce079];return _0x67ae62;};'use strict';var _=require(_0x9f1b('0x0'));var util=require('util');var moment=require(_0x9f1b('0x1'));var BPromise=require(_0x9f1b('0x2'));var rs=require(_0x9f1b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f1b('0x4'))['db'];var utils=require(_0x9f1b('0x5'));var logger=require('../../config/logger')(_0x9f1b('0x6'));var config=require(_0x9f1b('0x7'));var jayson=require(_0x9f1b('0x8'));var client=jayson['client'][_0x9f1b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x463e4b,_0x5548be,_0x544d05){return new BPromise(function(_0x2fdde0,_0x2cd850){return client[_0x9f1b('0xa')](_0x463e4b,_0x544d05)[_0x9f1b('0xb')](function(_0x392cbe){logger[_0x9f1b('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5548be,_0x9f1b('0xd'));logger['debug'](_0x9f1b('0xe'),_0x5548be,_0x9f1b('0xd'),JSON[_0x9f1b('0xf')](_0x392cbe));if(_0x392cbe[_0x9f1b('0x10')]){if(_0x392cbe[_0x9f1b('0x10')][_0x9f1b('0x11')]===0x1f4){logger[_0x9f1b('0x10')](_0x9f1b('0x12'),_0x5548be,_0x392cbe['error']['message']);return _0x2cd850(_0x392cbe[_0x9f1b('0x10')][_0x9f1b('0x13')]);}logger[_0x9f1b('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5548be,_0x392cbe[_0x9f1b('0x10')][_0x9f1b('0x13')]);return _0x2fdde0(_0x392cbe[_0x9f1b('0x10')][_0x9f1b('0x13')]);}else{logger[_0x9f1b('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5548be,_0x9f1b('0xd'));_0x2fdde0(_0x392cbe[_0x9f1b('0x14')][_0x9f1b('0x13')]);}})[_0x9f1b('0x15')](function(_0x309387){logger[_0x9f1b('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5548be,_0x309387);_0x2cd850(_0x309387);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index ff59c05..d87ddff 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 _0x58ca=['index','/describe','describe','/:id','show','/:id/questions','getQuestions','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','./jscriptySessionReport.controller','get','isAuthenticated'];(function(_0x8e605d,_0x58c70b){var _0x4fdc9a=function(_0xf5a19a){while(--_0xf5a19a){_0x8e605d['push'](_0x8e605d['shift']());}};_0x4fdc9a(++_0x58c70b);}(_0x58ca,0xb4));var _0xa58c=function(_0x598214,_0x3493bd){_0x598214=_0x598214-0x0;var _0x5c571e=_0x58ca[_0x598214];return _0x5c571e;};'use strict';var multer=require(_0xa58c('0x0'));var util=require(_0xa58c('0x1'));var path=require('path');var timeout=require(_0xa58c('0x2'));var express=require(_0xa58c('0x3'));var router=express[_0xa58c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa58c('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa58c('0x6'));router[_0xa58c('0x7')]('/',auth[_0xa58c('0x8')](),controller[_0xa58c('0x9')]);router[_0xa58c('0x7')](_0xa58c('0xa'),auth[_0xa58c('0x8')](),controller[_0xa58c('0xb')]);router[_0xa58c('0x7')](_0xa58c('0xc'),auth[_0xa58c('0x8')](),controller[_0xa58c('0xd')]);router['get'](_0xa58c('0xe'),auth[_0xa58c('0x8')](),controller[_0xa58c('0xf')]);router['post']('/',auth[_0xa58c('0x8')](),controller[_0xa58c('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xa58c('0x11')]);router[_0xa58c('0x12')](_0xa58c('0xc'),auth[_0xa58c('0x8')](),controller[_0xa58c('0x13')]);module[_0xa58c('0x14')]=router; \ No newline at end of file +var _0x335c=['show','getQuestions','post','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','describe'];(function(_0x31ea60,_0x153b80){var _0x1fc01c=function(_0xc94423){while(--_0xc94423){_0x31ea60['push'](_0x31ea60['shift']());}};_0x1fc01c(++_0x153b80);}(_0x335c,0xd7));var _0xc335=function(_0x30e153,_0x29152d){_0x30e153=_0x30e153-0x0;var _0x5be042=_0x335c[_0x30e153];return _0x5be042;};'use strict';var multer=require(_0xc335('0x0'));var util=require(_0xc335('0x1'));var path=require(_0xc335('0x2'));var timeout=require(_0xc335('0x3'));var express=require(_0xc335('0x4'));var router=express[_0xc335('0x5')]();var fs_extra=require(_0xc335('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc335('0x7'));var config=require(_0xc335('0x8'));var controller=require(_0xc335('0x9'));router[_0xc335('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc335('0xa')]('/describe',auth[_0xc335('0xb')](),controller[_0xc335('0xc')]);router[_0xc335('0xa')]('/:id',auth[_0xc335('0xb')](),controller[_0xc335('0xd')]);router['get']('/:id/questions',auth[_0xc335('0xb')](),controller[_0xc335('0xe')]);router[_0xc335('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xc335('0x10'),auth[_0xc335('0xb')](),controller['update']);router[_0xc335('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xc335('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 5cceb54..49a3d5e 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 _0x8f0a=['DATE','STRING','BOOLEAN','moment','sequelize','exports','setDataValue','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x37e307,_0x378e6c){var _0x44a38c=function(_0x278dce){while(--_0x278dce){_0x37e307['push'](_0x37e307['shift']());}};_0x44a38c(++_0x378e6c);}(_0x8f0a,0x157));var _0xa8f0=function(_0x2bf5bd,_0x120787){_0x2bf5bd=_0x2bf5bd-0x0;var _0xc810c0=_0x8f0a[_0x2bf5bd];return _0xc810c0;};'use strict';var moment=require(_0xa8f0('0x0'));var Sequelize=require(_0xa8f0('0x1'));module[_0xa8f0('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x46dedb){this[_0xa8f0('0x3')](_0xa8f0('0x4'),_0x46dedb);this[_0xa8f0('0x3')](_0xa8f0('0x5'),moment()['format'](_0xa8f0('0x6')));}},'endtime':{'type':Sequelize[_0xa8f0('0x7')]},'membername':{'type':Sequelize[_0xa8f0('0x8')]},'projectname':{'type':Sequelize[_0xa8f0('0x8')]},'queue':{'type':Sequelize[_0xa8f0('0x8')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xa8f0('0x8')]},'calleridnum':{'type':Sequelize[_0xa8f0('0x8')]},'completed':{'type':Sequelize[_0xa8f0('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0xea52=['format','YYYY-MM-DD\x20HH:mm:ss','STRING','sequelize','exports','DATE','setDataValue','starttime'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xea52,0x103));var _0x2ea5=function(_0x7cdaf1,_0x40e620){_0x7cdaf1=_0x7cdaf1-0x0;var _0xf58e9a=_0xea52[_0x7cdaf1];return _0xf58e9a;};'use strict';var moment=require('moment');var Sequelize=require(_0x2ea5('0x0'));module[_0x2ea5('0x1')]={'starttime':{'type':Sequelize[_0x2ea5('0x2')],'set':function(_0x3131ed){this[_0x2ea5('0x3')](_0x2ea5('0x4'),_0x3131ed);this[_0x2ea5('0x3')]('endtime',moment()[_0x2ea5('0x5')](_0x2ea5('0x6')));}},'endtime':{'type':Sequelize[_0x2ea5('0x2')]},'membername':{'type':Sequelize[_0x2ea5('0x7')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x2ea5('0x7')]},'uniqueid':{'type':Sequelize[_0x2ea5('0x7')]},'calleridname':{'type':Sequelize[_0x2ea5('0x7')]},'calleridnum':{'type':Sequelize[_0x2ea5('0x7')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index c45ef91..d4e9ee6 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 _0xb6e4=['rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','Content-Range','save','update','then','destroy','error','stack','name','send','index','JscriptySessionReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','length','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','nolimit','SessionId','includeAll'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb6e4,0x186));var _0x4b6e=function(_0x5a9472,_0x5629cf){_0x5a9472=_0x5a9472-0x0;var _0x19407b=_0xb6e4[_0x5a9472];return _0x19407b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4b6e('0x0'));var zipdir=require(_0x4b6e('0x1'));var jsonpatch=require(_0x4b6e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4b6e('0x3'));var Mustache=require(_0x4b6e('0x4'));var util=require(_0x4b6e('0x5'));var path=require(_0x4b6e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b6e('0x7'));var _=require(_0x4b6e('0x8'));var squel=require(_0x4b6e('0x9'));var crypto=require(_0x4b6e('0xa'));var jsforce=require(_0x4b6e('0xb'));var deskjs=require(_0x4b6e('0xc'));var toCsv=require(_0x4b6e('0xd'));var querystring=require(_0x4b6e('0xe'));var Papa=require(_0x4b6e('0xf'));var Redis=require(_0x4b6e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4b6e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4b6e('0x12'));var logger=require(_0x4b6e('0x13'))(_0x4b6e('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4b6e('0x15'));var db=require(_0x4b6e('0x16'))['db'];function respondWithStatusCode(_0xf350ef,_0x3c80ee){_0x3c80ee=_0x3c80ee||0xcc;return function(_0x44652e){if(_0x44652e){return _0xf350ef[_0x4b6e('0x17')](_0x3c80ee);}return _0xf350ef[_0x4b6e('0x18')](_0x3c80ee)[_0x4b6e('0x19')]();};}function respondWithResult(_0x4dc05a,_0xb169be){_0xb169be=_0xb169be||0xc8;return function(_0x3a0510){if(_0x3a0510){return _0x4dc05a[_0x4b6e('0x18')](_0xb169be)['json'](_0x3a0510);}};}function respondWithFilteredResult(_0x5d55fb,_0x309314){return function(_0x30e2ea){if(_0x30e2ea){var _0x2e6584=typeof _0x309314['offset']===_0x4b6e('0x1a')&&typeof _0x309314[_0x4b6e('0x1b')]===_0x4b6e('0x1a');var _0x4810f5=_0x30e2ea['count'];var _0x4d521b=_0x2e6584?0x0:_0x309314[_0x4b6e('0x1c')];var _0x581d9c=_0x2e6584?_0x30e2ea[_0x4b6e('0x1d')]:_0x309314[_0x4b6e('0x1c')]+_0x309314['limit'];var _0x17bafe;if(_0x581d9c>=_0x4810f5){_0x581d9c=_0x4810f5;_0x17bafe=0xc8;}else{_0x17bafe=0xce;}_0x5d55fb['status'](_0x17bafe);return _0x5d55fb['set'](_0x4b6e('0x1e'),_0x4d521b+'-'+_0x581d9c+'/'+_0x4810f5)['json'](_0x30e2ea);}return null;};}function patchUpdates(_0x2dd52a){return function(_0x37271d){try{jsonpatch['apply'](_0x37271d,_0x2dd52a,!![]);}catch(_0x347eee){return BPromise['reject'](_0x347eee);}return _0x37271d[_0x4b6e('0x1f')]();};}function saveUpdates(_0x4c11c0,_0x4c570e){return function(_0x16f627){if(_0x16f627){return _0x16f627[_0x4b6e('0x20')](_0x4c11c0)[_0x4b6e('0x21')](function(_0x13455d){return _0x13455d;});}return null;};}function removeEntity(_0x10afab,_0x62ded0){return function(_0x4d42f6){if(_0x4d42f6){return _0x4d42f6[_0x4b6e('0x22')]()['then'](function(){_0x10afab[_0x4b6e('0x18')](0xcc)[_0x4b6e('0x19')]();});}};}function handleEntityNotFound(_0x44f976,_0x4bd489){return function(_0x2344dc){if(!_0x2344dc){_0x44f976[_0x4b6e('0x17')](0x194);}return _0x2344dc;};}function handleError(_0x2e151a,_0x57fc55){_0x57fc55=_0x57fc55||0x1f4;return function(_0x5ad8d7){logger[_0x4b6e('0x23')](_0x5ad8d7[_0x4b6e('0x24')]);if(_0x5ad8d7[_0x4b6e('0x25')]){delete _0x5ad8d7['name'];}_0x2e151a[_0x4b6e('0x18')](_0x57fc55)[_0x4b6e('0x26')](_0x5ad8d7);};}exports[_0x4b6e('0x27')]=function(_0x3a3d1f,_0x19e1f4){var _0x4de63f={},_0x479f03={},_0x5444aa={'count':0x0,'rows':[]};var _0x1ff790=_['map'](db[_0x4b6e('0x28')][_0x4b6e('0x29')],function(_0x40131e){return{'name':_0x40131e[_0x4b6e('0x2a')],'type':_0x40131e[_0x4b6e('0x2b')][_0x4b6e('0x2c')]};});_0x479f03[_0x4b6e('0x2d')]=_[_0x4b6e('0x2e')](_0x1ff790,_0x4b6e('0x25'));_0x479f03[_0x4b6e('0x2f')]=_[_0x4b6e('0x30')](_0x3a3d1f[_0x4b6e('0x2f')]);_0x479f03[_0x4b6e('0x31')]=_['intersection'](_0x479f03['model'],_0x479f03[_0x4b6e('0x2f')]);_0x4de63f[_0x4b6e('0x32')]=_[_0x4b6e('0x33')](_0x479f03[_0x4b6e('0x2d')],qs[_0x4b6e('0x34')](_0x3a3d1f[_0x4b6e('0x2f')][_0x4b6e('0x34')]));_0x4de63f[_0x4b6e('0x32')]=_0x4de63f[_0x4b6e('0x32')]['length']?_0x4de63f[_0x4b6e('0x32')]:_0x479f03['model'];if(!_0x3a3d1f[_0x4b6e('0x2f')][_0x4b6e('0x35')]('nolimit')){_0x4de63f[_0x4b6e('0x1b')]=qs['limit'](_0x3a3d1f[_0x4b6e('0x2f')][_0x4b6e('0x1b')]);_0x4de63f['offset']=qs[_0x4b6e('0x1c')](_0x3a3d1f['query'][_0x4b6e('0x1c')]);}_0x4de63f[_0x4b6e('0x36')]=qs[_0x4b6e('0x37')](_0x3a3d1f[_0x4b6e('0x2f')][_0x4b6e('0x37')]);_0x4de63f[_0x4b6e('0x38')]=qs[_0x4b6e('0x31')](_[_0x4b6e('0x39')](_0x3a3d1f[_0x4b6e('0x2f')],_0x479f03[_0x4b6e('0x31')]),_0x1ff790);if(_0x3a3d1f[_0x4b6e('0x2f')][_0x4b6e('0x3a')]){_0x4de63f['where']=_[_0x4b6e('0x3b')](_0x4de63f[_0x4b6e('0x38')],{'$or':_[_0x4b6e('0x2e')](_0x1ff790,function(_0x504829){if(_0x504829[_0x4b6e('0x2b')]!=='VIRTUAL'){var _0x1617be={};_0x1617be[_0x504829[_0x4b6e('0x25')]]={'$like':'%'+_0x3a3d1f[_0x4b6e('0x2f')]['filter']+'%'};return _0x1617be;}})});}_0x4de63f=_[_0x4b6e('0x3b')]({},_0x4de63f,_0x3a3d1f[_0x4b6e('0x3c')]);var _0x16926d={'where':_0x4de63f[_0x4b6e('0x38')]};return db['JscriptySessionReport']['count'](_0x16926d)[_0x4b6e('0x21')](function(_0x3ea676){_0x5444aa[_0x4b6e('0x1d')]=_0x3ea676;if(_0x3a3d1f[_0x4b6e('0x2f')]['includeAll']){_0x4de63f[_0x4b6e('0x3d')]=[{'all':!![]}];}return db[_0x4b6e('0x28')][_0x4b6e('0x3e')](_0x4de63f);})[_0x4b6e('0x21')](function(_0x35e27d){_0x5444aa[_0x4b6e('0x3f')]=_0x35e27d;return _0x5444aa;})[_0x4b6e('0x21')](respondWithFilteredResult(_0x19e1f4,_0x4de63f))[_0x4b6e('0x40')](handleError(_0x19e1f4,null));};exports[_0x4b6e('0x41')]=function(_0xa6085a,_0x5265b3){var _0x16d060={'raw':!![],'where':{'id':_0xa6085a[_0x4b6e('0x42')]['id']}},_0x5453b8={};_0x5453b8[_0x4b6e('0x2d')]=_[_0x4b6e('0x30')](db['JscriptySessionReport']['rawAttributes']);_0x5453b8[_0x4b6e('0x2f')]=_[_0x4b6e('0x30')](_0xa6085a[_0x4b6e('0x2f')]);_0x5453b8[_0x4b6e('0x31')]=_[_0x4b6e('0x33')](_0x5453b8[_0x4b6e('0x2d')],_0x5453b8[_0x4b6e('0x2f')]);_0x16d060[_0x4b6e('0x32')]=_[_0x4b6e('0x33')](_0x5453b8[_0x4b6e('0x2d')],qs[_0x4b6e('0x34')](_0xa6085a['query'][_0x4b6e('0x34')]));_0x16d060[_0x4b6e('0x32')]=_0x16d060['attributes'][_0x4b6e('0x43')]?_0x16d060[_0x4b6e('0x32')]:_0x5453b8[_0x4b6e('0x2d')];if(_0xa6085a[_0x4b6e('0x2f')]['includeAll']){_0x16d060['include']=[{'all':!![]}];}_0x16d060=_['merge']({},_0x16d060,_0xa6085a['options']);return db[_0x4b6e('0x28')][_0x4b6e('0x44')](_0x16d060)['then'](handleEntityNotFound(_0x5265b3,null))[_0x4b6e('0x21')](respondWithResult(_0x5265b3,null))[_0x4b6e('0x40')](handleError(_0x5265b3,null));};exports[_0x4b6e('0x45')]=function(_0x524810,_0x43226e){return db[_0x4b6e('0x28')][_0x4b6e('0x45')](_0x524810[_0x4b6e('0x46')],{})[_0x4b6e('0x21')](respondWithResult(_0x43226e,0xc9))[_0x4b6e('0x40')](handleError(_0x43226e,null));};exports['update']=function(_0x2b6b4c,_0x59c88f){if(_0x2b6b4c[_0x4b6e('0x46')]['id']){delete _0x2b6b4c[_0x4b6e('0x46')]['id'];}return db[_0x4b6e('0x28')][_0x4b6e('0x44')]({'where':{'id':_0x2b6b4c[_0x4b6e('0x42')]['id']}})[_0x4b6e('0x21')](handleEntityNotFound(_0x59c88f,null))[_0x4b6e('0x21')](saveUpdates(_0x2b6b4c[_0x4b6e('0x46')],null))[_0x4b6e('0x21')](respondWithResult(_0x59c88f,null))['catch'](handleError(_0x59c88f,null));};exports[_0x4b6e('0x22')]=function(_0x2b3937,_0x289419){return db['JscriptySessionReport'][_0x4b6e('0x44')]({'where':{'id':_0x2b3937[_0x4b6e('0x42')]['id']}})['then'](handleEntityNotFound(_0x289419,null))[_0x4b6e('0x21')](removeEntity(_0x289419,null))[_0x4b6e('0x40')](handleError(_0x289419,null));};exports[_0x4b6e('0x47')]=function(_0x47e865,_0x5dd62f){return db[_0x4b6e('0x28')][_0x4b6e('0x47')]()['then'](respondWithResult(_0x5dd62f,null))[_0x4b6e('0x40')](handleError(_0x5dd62f,null));};exports[_0x4b6e('0x48')]=function(_0x2da207,_0x243bfd,_0x1d1847){var _0x343b25={'raw':!![],'where':{}};var _0x5607f4={};var _0x228fdf={'count':0x0,'rows':[]};return db[_0x4b6e('0x28')][_0x4b6e('0x49')]({'where':{'id':_0x2da207['params']['id']}})[_0x4b6e('0x21')](handleEntityNotFound(_0x243bfd,null))['then'](function(_0xf60c6c){if(_0xf60c6c){_0x5607f4[_0x4b6e('0x2d')]=_[_0x4b6e('0x30')](db[_0x4b6e('0x4a')]['rawAttributes']);_0x5607f4['query']=_[_0x4b6e('0x30')](_0x2da207['query']);_0x5607f4[_0x4b6e('0x31')]=_[_0x4b6e('0x33')](_0x5607f4[_0x4b6e('0x2d')],_0x5607f4[_0x4b6e('0x2f')]);_0x343b25[_0x4b6e('0x32')]=_[_0x4b6e('0x33')](_0x5607f4['model'],qs[_0x4b6e('0x34')](_0x2da207[_0x4b6e('0x2f')]['fields']));_0x343b25[_0x4b6e('0x32')]=_0x343b25[_0x4b6e('0x32')][_0x4b6e('0x43')]?_0x343b25[_0x4b6e('0x32')]:_0x5607f4[_0x4b6e('0x2d')];if(!_0x2da207[_0x4b6e('0x2f')][_0x4b6e('0x35')](_0x4b6e('0x4b'))){_0x343b25[_0x4b6e('0x1b')]=qs[_0x4b6e('0x1b')](_0x2da207[_0x4b6e('0x2f')][_0x4b6e('0x1b')]);_0x343b25[_0x4b6e('0x1c')]=qs[_0x4b6e('0x1c')](_0x2da207[_0x4b6e('0x2f')]['offset']);}_0x343b25[_0x4b6e('0x36')]=qs[_0x4b6e('0x37')](_0x2da207[_0x4b6e('0x2f')][_0x4b6e('0x37')]);_0x343b25[_0x4b6e('0x38')]=qs[_0x4b6e('0x31')](_[_0x4b6e('0x39')](_0x2da207[_0x4b6e('0x2f')],_0x5607f4[_0x4b6e('0x31')]));_0x343b25[_0x4b6e('0x38')][_0x4b6e('0x4c')]=_0xf60c6c['id'];if(_0x2da207[_0x4b6e('0x2f')][_0x4b6e('0x3a')]){_0x343b25[_0x4b6e('0x38')]=_[_0x4b6e('0x3b')](_0x343b25[_0x4b6e('0x38')],{'$or':_[_0x4b6e('0x2e')](_0x343b25[_0x4b6e('0x32')],function(_0x1fdd4d){var _0x58e914={};_0x58e914[_0x1fdd4d]={'$like':'%'+_0x2da207[_0x4b6e('0x2f')][_0x4b6e('0x3a')]+'%'};return _0x58e914;})});}_0x343b25=_[_0x4b6e('0x3b')]({},_0x343b25,_0x2da207[_0x4b6e('0x3c')]);return db['JscriptyQuestionReport'][_0x4b6e('0x1d')]({'where':_0x343b25[_0x4b6e('0x38')]})[_0x4b6e('0x21')](function(_0x1c0371){_0x228fdf['count']=_0x1c0371;if(_0x2da207['query'][_0x4b6e('0x4d')]){_0x343b25[_0x4b6e('0x3d')]=[{'all':!![]}];}return db[_0x4b6e('0x4a')][_0x4b6e('0x3e')](_0x343b25);})['then'](function(_0xcd9ed5){_0x228fdf[_0x4b6e('0x3f')]=_0xcd9ed5;return _0x228fdf;});}})[_0x4b6e('0x21')](respondWithFilteredResult(_0x243bfd,_0x343b25))[_0x4b6e('0x40')](handleError(_0x243bfd,null));}; \ No newline at end of file +var _0xa51e=['then','error','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','keys','create','body','find','destroy','params','describe','getQuestions','JscriptyQuestionReport','hasOwnProperty','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','offset','count','set','Content-Range','apply','save','update'];(function(_0x86c6cb,_0x30bb53){var _0x1b1592=function(_0x19e1c9){while(--_0x19e1c9){_0x86c6cb['push'](_0x86c6cb['shift']());}};_0x1b1592(++_0x30bb53);}(_0xa51e,0x77));var _0xea51=function(_0x332005,_0x24edf1){_0x332005=_0x332005-0x0;var _0x4393e1=_0xa51e[_0x332005];return _0x4393e1;};'use strict';var emlformat=require(_0xea51('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea51('0x1'));var jsonpatch=require(_0xea51('0x2'));var rp=require(_0xea51('0x3'));var moment=require(_0xea51('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xea51('0x5'));var util=require(_0xea51('0x6'));var path=require(_0xea51('0x7'));var sox=require(_0xea51('0x8'));var csv=require(_0xea51('0x9'));var ejs=require(_0xea51('0xa'));var fs=require('fs');var fs_extra=require(_0xea51('0xb'));var _=require('lodash');var squel=require(_0xea51('0xc'));var crypto=require(_0xea51('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xea51('0xe'));var toCsv=require(_0xea51('0x9'));var querystring=require(_0xea51('0xf'));var Papa=require('papaparse');var Redis=require(_0xea51('0x10'));var authService=require(_0xea51('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xea51('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea51('0x13'))(_0xea51('0x14'));var utils=require(_0xea51('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xea51('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x198b64,_0x5d236b){_0x5d236b=_0x5d236b||0xcc;return function(_0x237d96){if(_0x237d96){return _0x198b64[_0xea51('0x17')](_0x5d236b);}return _0x198b64[_0xea51('0x18')](_0x5d236b)[_0xea51('0x19')]();};}function respondWithResult(_0x11b2db,_0x5376a8){_0x5376a8=_0x5376a8||0xc8;return function(_0x11c766){if(_0x11c766){return _0x11b2db[_0xea51('0x18')](_0x5376a8)[_0xea51('0x1a')](_0x11c766);}};}function respondWithFilteredResult(_0x1becdc,_0xfd470e){return function(_0xfd58f9){if(_0xfd58f9){var _0x3c3254=typeof _0xfd470e['offset']===_0xea51('0x1b')&&typeof _0xfd470e['limit']===_0xea51('0x1b');var _0x76bfb9=_0xfd58f9['count'];var _0x3ff644=_0x3c3254?0x0:_0xfd470e[_0xea51('0x1c')];var _0x198ba6=_0x3c3254?_0xfd58f9[_0xea51('0x1d')]:_0xfd470e[_0xea51('0x1c')]+_0xfd470e['limit'];var _0x55fcbf;if(_0x198ba6>=_0x76bfb9){_0x198ba6=_0x76bfb9;_0x55fcbf=0xc8;}else{_0x55fcbf=0xce;}_0x1becdc[_0xea51('0x18')](_0x55fcbf);return _0x1becdc[_0xea51('0x1e')](_0xea51('0x1f'),_0x3ff644+'-'+_0x198ba6+'/'+_0x76bfb9)['json'](_0xfd58f9);}return null;};}function patchUpdates(_0x4f0f09){return function(_0x5ce84d){try{jsonpatch[_0xea51('0x20')](_0x5ce84d,_0x4f0f09,!![]);}catch(_0x9ade24){return BPromise['reject'](_0x9ade24);}return _0x5ce84d[_0xea51('0x21')]();};}function saveUpdates(_0x3c0d50,_0x91df94){return function(_0x3731e4){if(_0x3731e4){return _0x3731e4[_0xea51('0x22')](_0x3c0d50)[_0xea51('0x23')](function(_0x42e80e){return _0x42e80e;});}return null;};}function removeEntity(_0x1302ca,_0x1efe63){return function(_0x5b8daf){if(_0x5b8daf){return _0x5b8daf['destroy']()[_0xea51('0x23')](function(){_0x1302ca['status'](0xcc)[_0xea51('0x19')]();});}};}function handleEntityNotFound(_0x1d01cf,_0xeba601){return function(_0x339c9a){if(!_0x339c9a){_0x1d01cf[_0xea51('0x17')](0x194);}return _0x339c9a;};}function handleError(_0x24f8cc,_0x51b222){_0x51b222=_0x51b222||0x1f4;return function(_0x4d41ee){logger[_0xea51('0x24')](_0x4d41ee['stack']);if(_0x4d41ee[_0xea51('0x25')]){delete _0x4d41ee[_0xea51('0x25')];}_0x24f8cc[_0xea51('0x18')](_0x51b222)[_0xea51('0x26')](_0x4d41ee);};}exports[_0xea51('0x27')]=function(_0x38e8cd,_0x29573f){var _0xcd4160={},_0x28a192={},_0x43ba18={'count':0x0,'rows':[]};var _0x120453=_[_0xea51('0x28')](db[_0xea51('0x29')][_0xea51('0x2a')],function(_0x2d5730){return{'name':_0x2d5730[_0xea51('0x2b')],'type':_0x2d5730[_0xea51('0x2c')][_0xea51('0x2d')]};});_0x28a192[_0xea51('0x2e')]=_['map'](_0x120453,_0xea51('0x25'));_0x28a192[_0xea51('0x2f')]=_['keys'](_0x38e8cd[_0xea51('0x2f')]);_0x28a192[_0xea51('0x30')]=_[_0xea51('0x31')](_0x28a192['model'],_0x28a192['query']);_0xcd4160['attributes']=_[_0xea51('0x31')](_0x28a192[_0xea51('0x2e')],qs[_0xea51('0x32')](_0x38e8cd[_0xea51('0x2f')][_0xea51('0x32')]));_0xcd4160[_0xea51('0x33')]=_0xcd4160[_0xea51('0x33')][_0xea51('0x34')]?_0xcd4160[_0xea51('0x33')]:_0x28a192[_0xea51('0x2e')];if(!_0x38e8cd[_0xea51('0x2f')]['hasOwnProperty'](_0xea51('0x35'))){_0xcd4160[_0xea51('0x36')]=qs[_0xea51('0x36')](_0x38e8cd[_0xea51('0x2f')][_0xea51('0x36')]);_0xcd4160[_0xea51('0x1c')]=qs[_0xea51('0x1c')](_0x38e8cd[_0xea51('0x2f')]['offset']);}_0xcd4160[_0xea51('0x37')]=qs[_0xea51('0x38')](_0x38e8cd['query'][_0xea51('0x38')]);_0xcd4160[_0xea51('0x39')]=qs[_0xea51('0x30')](_[_0xea51('0x3a')](_0x38e8cd['query'],_0x28a192[_0xea51('0x30')]),_0x120453);if(_0x38e8cd['query'][_0xea51('0x3b')]){_0xcd4160[_0xea51('0x39')]=_['merge'](_0xcd4160[_0xea51('0x39')],{'$or':_[_0xea51('0x28')](_0x120453,function(_0xc9e66a){if(_0xc9e66a[_0xea51('0x2c')]!=='VIRTUAL'){var _0x7f7661={};_0x7f7661[_0xc9e66a[_0xea51('0x25')]]={'$like':'%'+_0x38e8cd[_0xea51('0x2f')][_0xea51('0x3b')]+'%'};return _0x7f7661;}})});}_0xcd4160=_[_0xea51('0x3c')]({},_0xcd4160,_0x38e8cd[_0xea51('0x3d')]);var _0x31fcc5={'where':_0xcd4160[_0xea51('0x39')]};return db[_0xea51('0x29')][_0xea51('0x1d')](_0x31fcc5)['then'](function(_0x25c2a8){_0x43ba18[_0xea51('0x1d')]=_0x25c2a8;if(_0x38e8cd[_0xea51('0x2f')][_0xea51('0x3e')]){_0xcd4160[_0xea51('0x3f')]=[{'all':!![]}];}return db[_0xea51('0x29')][_0xea51('0x40')](_0xcd4160);})['then'](function(_0x2edbe1){_0x43ba18['rows']=_0x2edbe1;return _0x43ba18;})['then'](respondWithFilteredResult(_0x29573f,_0xcd4160))[_0xea51('0x41')](handleError(_0x29573f,null));};exports[_0xea51('0x42')]=function(_0x3156dc,_0x462873){var _0x28d66b={'raw':!![],'where':{'id':_0x3156dc['params']['id']}},_0x7996ea={};_0x7996ea[_0xea51('0x2e')]=_['keys'](db[_0xea51('0x29')]['rawAttributes']);_0x7996ea['query']=_[_0xea51('0x43')](_0x3156dc['query']);_0x7996ea[_0xea51('0x30')]=_['intersection'](_0x7996ea[_0xea51('0x2e')],_0x7996ea[_0xea51('0x2f')]);_0x28d66b[_0xea51('0x33')]=_[_0xea51('0x31')](_0x7996ea['model'],qs[_0xea51('0x32')](_0x3156dc[_0xea51('0x2f')][_0xea51('0x32')]));_0x28d66b[_0xea51('0x33')]=_0x28d66b[_0xea51('0x33')][_0xea51('0x34')]?_0x28d66b[_0xea51('0x33')]:_0x7996ea['model'];if(_0x3156dc[_0xea51('0x2f')][_0xea51('0x3e')]){_0x28d66b[_0xea51('0x3f')]=[{'all':!![]}];}_0x28d66b=_[_0xea51('0x3c')]({},_0x28d66b,_0x3156dc[_0xea51('0x3d')]);return db['JscriptySessionReport']['find'](_0x28d66b)[_0xea51('0x23')](handleEntityNotFound(_0x462873,null))['then'](respondWithResult(_0x462873,null))[_0xea51('0x41')](handleError(_0x462873,null));};exports[_0xea51('0x44')]=function(_0x2e25da,_0x2b2b70){return db['JscriptySessionReport'][_0xea51('0x44')](_0x2e25da[_0xea51('0x45')],{})[_0xea51('0x23')](respondWithResult(_0x2b2b70,0xc9))[_0xea51('0x41')](handleError(_0x2b2b70,null));};exports[_0xea51('0x22')]=function(_0x5241aa,_0xf5b5a){if(_0x5241aa[_0xea51('0x45')]['id']){delete _0x5241aa['body']['id'];}return db[_0xea51('0x29')][_0xea51('0x46')]({'where':{'id':_0x5241aa['params']['id']}})['then'](handleEntityNotFound(_0xf5b5a,null))[_0xea51('0x23')](saveUpdates(_0x5241aa[_0xea51('0x45')],null))[_0xea51('0x23')](respondWithResult(_0xf5b5a,null))[_0xea51('0x41')](handleError(_0xf5b5a,null));};exports[_0xea51('0x47')]=function(_0x1ef05d,_0x3a3c15){return db['JscriptySessionReport']['find']({'where':{'id':_0x1ef05d[_0xea51('0x48')]['id']}})[_0xea51('0x23')](handleEntityNotFound(_0x3a3c15,null))[_0xea51('0x23')](removeEntity(_0x3a3c15,null))[_0xea51('0x41')](handleError(_0x3a3c15,null));};exports[_0xea51('0x49')]=function(_0x51fa7d,_0x4f76f9){return db[_0xea51('0x29')][_0xea51('0x49')]()['then'](respondWithResult(_0x4f76f9,null))[_0xea51('0x41')](handleError(_0x4f76f9,null));};exports[_0xea51('0x4a')]=function(_0x418b42,_0x5398a2,_0xe58883){var _0x3e91c0={'raw':!![],'where':{}};var _0x4cc65b={};var _0x1f3dcd={'count':0x0,'rows':[]};return db[_0xea51('0x29')]['findOne']({'where':{'id':_0x418b42[_0xea51('0x48')]['id']}})[_0xea51('0x23')](handleEntityNotFound(_0x5398a2,null))[_0xea51('0x23')](function(_0x492336){if(_0x492336){_0x4cc65b['model']=_[_0xea51('0x43')](db[_0xea51('0x4b')][_0xea51('0x2a')]);_0x4cc65b[_0xea51('0x2f')]=_[_0xea51('0x43')](_0x418b42[_0xea51('0x2f')]);_0x4cc65b[_0xea51('0x30')]=_[_0xea51('0x31')](_0x4cc65b[_0xea51('0x2e')],_0x4cc65b[_0xea51('0x2f')]);_0x3e91c0['attributes']=_[_0xea51('0x31')](_0x4cc65b[_0xea51('0x2e')],qs[_0xea51('0x32')](_0x418b42[_0xea51('0x2f')][_0xea51('0x32')]));_0x3e91c0['attributes']=_0x3e91c0[_0xea51('0x33')][_0xea51('0x34')]?_0x3e91c0['attributes']:_0x4cc65b[_0xea51('0x2e')];if(!_0x418b42[_0xea51('0x2f')][_0xea51('0x4c')]('nolimit')){_0x3e91c0[_0xea51('0x36')]=qs[_0xea51('0x36')](_0x418b42[_0xea51('0x2f')][_0xea51('0x36')]);_0x3e91c0[_0xea51('0x1c')]=qs[_0xea51('0x1c')](_0x418b42[_0xea51('0x2f')][_0xea51('0x1c')]);}_0x3e91c0[_0xea51('0x37')]=qs['sort'](_0x418b42[_0xea51('0x2f')][_0xea51('0x38')]);_0x3e91c0['where']=qs[_0xea51('0x30')](_['pick'](_0x418b42[_0xea51('0x2f')],_0x4cc65b[_0xea51('0x30')]));_0x3e91c0[_0xea51('0x39')]['SessionId']=_0x492336['id'];if(_0x418b42[_0xea51('0x2f')][_0xea51('0x3b')]){_0x3e91c0[_0xea51('0x39')]=_['merge'](_0x3e91c0['where'],{'$or':_[_0xea51('0x28')](_0x3e91c0[_0xea51('0x33')],function(_0x27c061){var _0x972e55={};_0x972e55[_0x27c061]={'$like':'%'+_0x418b42[_0xea51('0x2f')][_0xea51('0x3b')]+'%'};return _0x972e55;})});}_0x3e91c0=_[_0xea51('0x3c')]({},_0x3e91c0,_0x418b42[_0xea51('0x3d')]);return db[_0xea51('0x4b')]['count']({'where':_0x3e91c0[_0xea51('0x39')]})[_0xea51('0x23')](function(_0x28f37b){_0x1f3dcd[_0xea51('0x1d')]=_0x28f37b;if(_0x418b42[_0xea51('0x2f')]['includeAll']){_0x3e91c0[_0xea51('0x3f')]=[{'all':!![]}];}return db[_0xea51('0x4b')][_0xea51('0x40')](_0x3e91c0);})['then'](function(_0x45a24d){_0x1f3dcd['rows']=_0x45a24d;return _0x1f3dcd;});}})[_0xea51('0x23')](respondWithFilteredResult(_0x5398a2,_0x3e91c0))[_0xea51('0x41')](handleError(_0x5398a2,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 500fade..1248664 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 _0x723e=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','define','JscriptySessionReport','report_jscripty_sessions'];(function(_0x2f57b2,_0xa8e91a){var _0x5ace77=function(_0x59c00a){while(--_0x59c00a){_0x2f57b2['push'](_0x2f57b2['shift']());}};_0x5ace77(++_0xa8e91a);}(_0x723e,0x179));var _0xe723=function(_0x404a11,_0x268dc0){_0x404a11=_0x404a11-0x0;var _0x435823=_0x723e[_0x404a11];return _0x435823;};'use strict';var _=require('lodash');var util=require(_0xe723('0x0'));var logger=require(_0xe723('0x1'))(_0xe723('0x2'));var moment=require(_0xe723('0x3'));var BPromise=require(_0xe723('0x4'));var rp=require(_0xe723('0x5'));var fs=require('fs');var path=require(_0xe723('0x6'));var rimraf=require(_0xe723('0x7'));var config=require(_0xe723('0x8'));var attributes=require(_0xe723('0x9'));module['exports']=function(_0x32d689,_0x20c13b){return _0x32d689[_0xe723('0xa')](_0xe723('0xb'),attributes,{'tableName':_0xe723('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f9d=['define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes'];(function(_0x171945,_0xd87274){var _0x2d73e6=function(_0xb1bdc9){while(--_0xb1bdc9){_0x171945['push'](_0x171945['shift']());}};_0x2d73e6(++_0xd87274);}(_0x8f9d,0x93));var _0xd8f9=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8f9d[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xd8f9('0x0'));var util=require('util');var logger=require(_0xd8f9('0x1'))('api');var moment=require(_0xd8f9('0x2'));var BPromise=require(_0xd8f9('0x3'));var rp=require(_0xd8f9('0x4'));var fs=require('fs');var path=require(_0xd8f9('0x5'));var rimraf=require(_0xd8f9('0x6'));var config=require(_0xd8f9('0x7'));var attributes=require(_0xd8f9('0x8'));module['exports']=function(_0x1c37be,_0x24dd1e){return _0x1c37be[_0xd8f9('0x9')](_0xd8f9('0xa'),attributes,{'tableName':_0xd8f9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 6c7d15c..5917340 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 _0x1261=['then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x2ae697,_0x16eac1){var _0x2f3321=function(_0xa9d5f0){while(--_0xa9d5f0){_0x2ae697['push'](_0x2ae697['shift']());}};_0x2f3321(++_0x16eac1);}(_0x1261,0x144));var _0x1126=function(_0x3f8f5c,_0x461c6e){_0x3f8f5c=_0x3f8f5c-0x0;var _0x51f351=_0x1261[_0x3f8f5c];return _0x51f351;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0x25e7=['JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info'];(function(_0x970084,_0x4e5473){var _0x411cce=function(_0x26bced){while(--_0x26bced){_0x970084['push'](_0x970084['shift']());}};_0x411cce(++_0x4e5473);}(_0x25e7,0x1d6));var _0x725e=function(_0x2f16e5,_0x2e75e0){_0x2f16e5=_0x2f16e5-0x0;var _0x5d082a=_0x25e7[_0x2f16e5];return _0x5d082a;};'use strict';var _=require(_0x725e('0x0'));var util=require(_0x725e('0x1'));var moment=require(_0x725e('0x2'));var BPromise=require(_0x725e('0x3'));var rs=require(_0x725e('0x4'));var fs=require('fs');var Redis=require(_0x725e('0x5'));var db=require(_0x725e('0x6'))['db'];var utils=require(_0x725e('0x7'));var logger=require(_0x725e('0x8'))(_0x725e('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x725e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x481316,_0x111a50,_0x192c27){return new BPromise(function(_0x216b33,_0x67de0c){return client[_0x725e('0xb')](_0x481316,_0x192c27)[_0x725e('0xc')](function(_0x39858a){logger[_0x725e('0xd')](_0x725e('0xe'),_0x111a50,_0x725e('0xf'));logger[_0x725e('0x10')](_0x725e('0x11'),_0x111a50,'request\x20sent',JSON['stringify'](_0x39858a));if(_0x39858a[_0x725e('0x12')]){if(_0x39858a[_0x725e('0x12')]['code']===0x1f4){logger['error'](_0x725e('0xe'),_0x111a50,_0x39858a[_0x725e('0x12')]['message']);return _0x67de0c(_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);}logger[_0x725e('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x111a50,_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);return _0x216b33(_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);}else{logger[_0x725e('0xd')](_0x725e('0xe'),_0x111a50,'request\x20sent');_0x216b33(_0x39858a[_0x725e('0x14')][_0x725e('0x13')]);}})[_0x725e('0x15')](function(_0x54ac0f){logger[_0x725e('0x12')](_0x725e('0xe'),_0x111a50,_0x54ac0f);_0x67de0c(_0x54ac0f);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index fbedbfb..17bca7b 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 _0x14ee=['/:id','isAuthenticated','update','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller'];(function(_0x24ee7b,_0x427a05){var _0x15b841=function(_0x12c115){while(--_0x12c115){_0x24ee7b['push'](_0x24ee7b['shift']());}};_0x15b841(++_0x427a05);}(_0x14ee,0x115));var _0xe14e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x14ee[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xe14e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe14e('0x1'));var express=require(_0xe14e('0x2'));var router=express[_0xe14e('0x3')]();var fs_extra=require(_0xe14e('0x4'));var auth=require(_0xe14e('0x5'));var interaction=require(_0xe14e('0x6'));var config=require(_0xe14e('0x7'));var controller=require(_0xe14e('0x8'));router['get']('/',controller['index']);router['put'](_0xe14e('0x9'),auth[_0xe14e('0xa')](),controller[_0xe14e('0xb')]);module[_0xe14e('0xc')]=router; \ No newline at end of file +var _0x9622=['express','Router','fs-extra','get','index','put','/:id','isAuthenticated','update','multer','util','path'];(function(_0x4bfaa7,_0x1033b0){var _0x282f8f=function(_0x4cf762){while(--_0x4cf762){_0x4bfaa7['push'](_0x4bfaa7['shift']());}};_0x282f8f(++_0x1033b0);}(_0x9622,0x8d));var _0x2962=function(_0x4d821c,_0x22bd0e){_0x4d821c=_0x4d821c-0x0;var _0x15dd5b=_0x9622[_0x4d821c];return _0x15dd5b;};'use strict';var multer=require(_0x2962('0x0'));var util=require(_0x2962('0x1'));var path=require(_0x2962('0x2'));var timeout=require('connect-timeout');var express=require(_0x2962('0x3'));var router=express[_0x2962('0x4')]();var fs_extra=require(_0x2962('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./license.controller');router[_0x2962('0x6')]('/',controller[_0x2962('0x7')]);router[_0x2962('0x8')](_0x2962('0x9'),auth[_0x2962('0xa')](),controller[_0x2962('0xb')]);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 a9fc829..0ec9854 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 _0x7220=['exports','TEXT','STRING','INTEGER','sequelize'];(function(_0x277b9c,_0x4e766d){var _0x5525cb=function(_0x16c274){while(--_0x16c274){_0x277b9c['push'](_0x277b9c['shift']());}};_0x5525cb(++_0x4e766d);}(_0x7220,0xa4));var _0x0722=function(_0x7470ac,_0x2da945){_0x7470ac=_0x7470ac-0x0;var _0x9184e4=_0x7220[_0x7470ac];return _0x9184e4;};'use strict';var Sequelize=require(_0x0722('0x0'));module[_0x0722('0x1')]={'license':{'type':Sequelize[_0x0722('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x0722('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x0722('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd610=['exports','STRING','sequelize'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xd610,0xa4));var _0x0d61=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xd610[_0x47e7cb];return _0x2a8874;};'use strict';var Sequelize=require(_0x0d61('0x0'));module[_0x0d61('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x0d61('0x2')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index ae09c0b..ea78634 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 _0x0295=['demo','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','../../config/license/util','model','keys','rawAttributes','query','filters','intersection','attributes','fields','merge','options','catch','body','License','find','checkLicense','key'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x0295,0x1f0));var _0x5029=function(_0x5823a7,_0x3cc2d7){_0x5823a7=_0x5823a7-0x0;var _0x4f1d86=_0x0295[_0x5823a7];return _0x4f1d86;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}var utilLicense=require(_0x5029('0x25'));exports['index']=function(_0x32da06,_0x251f99){var _0xe5313e={'raw':!![],'where':{'id':0x1}},_0x4b6f92={};_0x4b6f92[_0x5029('0x26')]=_[_0x5029('0x27')](db['License'][_0x5029('0x28')]);_0x4b6f92[_0x5029('0x29')]=_[_0x5029('0x27')](_0x32da06[_0x5029('0x29')]);_0x4b6f92[_0x5029('0x2a')]=_[_0x5029('0x2b')](_0x4b6f92[_0x5029('0x26')],_0x4b6f92[_0x5029('0x29')]);_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2b')](_0x4b6f92[_0x5029('0x26')],qs[_0x5029('0x2d')](_0x32da06['query'][_0x5029('0x2d')]));_0xe5313e['attributes']=_0xe5313e[_0x5029('0x2c')]['length']?_0xe5313e['attributes']:_0x4b6f92[_0x5029('0x26')];_0xe5313e=_[_0x5029('0x2e')]({},_0xe5313e,_0x32da06[_0x5029('0x2f')]);return utilLicense['getLicense'](_0xe5313e)[_0x5029('0x20')](respondWithResult(_0x251f99,null))[_0x5029('0x30')](handleError(_0x251f99,null));};exports[_0x5029('0x1f')]=function(_0x29c59a,_0x1bb896){if(_0x29c59a[_0x5029('0x31')]['id']){delete _0x29c59a[_0x5029('0x31')]['id'];}return db[_0x5029('0x32')][_0x5029('0x33')]({'where':{'id':_0x29c59a['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x1bb896,null))[_0x5029('0x20')](function(_0xc110e8){var _0x1b3817=_0xc110e8['get']({'plain':!![]});return utilLicense[_0x5029('0x34')](_0x1b3817,_0x29c59a[_0x5029('0x31')][_0x5029('0x35')]);})['then'](function(_0x4904cc){if(!_0x4904cc[_0x5029('0x36')]){return saveUpdates(_0x29c59a[_0x5029('0x31')],null);}return _0x4904cc;})['then'](respondWithResult(_0x1bb896,null))['catch'](handleError(_0x1bb896,null));}; \ No newline at end of file +var _0xf494=['fields','length','merge','options','getLicense','body','License','find','params','get','key','demo','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','../../config/license/util','index','model','rawAttributes','query','keys','filters','intersection','attributes'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0xf494,0x1c6));var _0x4f49=function(_0x415d6c,_0x5ab977){_0x415d6c=_0x415d6c-0x0;var _0x265dc9=_0xf494[_0x415d6c];return _0x265dc9;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];function respondWithStatusCode(_0x12527d,_0x4bf89f){_0x4bf89f=_0x4bf89f||0xcc;return function(_0x1e1c37){if(_0x1e1c37){return _0x12527d[_0x4f49('0x19')](_0x4bf89f);}return _0x12527d[_0x4f49('0x1a')](_0x4bf89f)[_0x4f49('0x1b')]();};}function respondWithResult(_0x1a0f1e,_0x2f0131){_0x2f0131=_0x2f0131||0xc8;return function(_0xfdb477){if(_0xfdb477){return _0x1a0f1e['status'](_0x2f0131)[_0x4f49('0x1c')](_0xfdb477);}};}function respondWithFilteredResult(_0x1f2d0d,_0x415e83){return function(_0x5878f4){if(_0x5878f4){var _0x5bdfaf=typeof _0x415e83[_0x4f49('0x1d')]===_0x4f49('0x1e')&&typeof _0x415e83[_0x4f49('0x1f')]==='undefined';var _0x1dccfd=_0x5878f4[_0x4f49('0x20')];var _0x4e85df=_0x5bdfaf?0x0:_0x415e83['offset'];var _0x5bb23b=_0x5bdfaf?_0x5878f4['count']:_0x415e83['offset']+_0x415e83[_0x4f49('0x1f')];var _0x1834f4;if(_0x5bb23b>=_0x1dccfd){_0x5bb23b=_0x1dccfd;_0x1834f4=0xc8;}else{_0x1834f4=0xce;}_0x1f2d0d[_0x4f49('0x1a')](_0x1834f4);return _0x1f2d0d[_0x4f49('0x21')]('Content-Range',_0x4e85df+'-'+_0x5bb23b+'/'+_0x1dccfd)[_0x4f49('0x1c')](_0x5878f4);}return null;};}function patchUpdates(_0x2aed27){return function(_0x197a49){try{jsonpatch[_0x4f49('0x22')](_0x197a49,_0x2aed27,!![]);}catch(_0xea82f8){return BPromise['reject'](_0xea82f8);}return _0x197a49[_0x4f49('0x23')]();};}function saveUpdates(_0x357446,_0x3ae590){return function(_0x53b57d){if(_0x53b57d){return _0x53b57d[_0x4f49('0x24')](_0x357446)[_0x4f49('0x25')](function(_0x32ca7b){return _0x32ca7b;});}return null;};}function removeEntity(_0x43c458,_0x9d30aa){return function(_0x36187b){if(_0x36187b){return _0x36187b['destroy']()['then'](function(){_0x43c458[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x4fedbb,_0x408552){return function(_0x2c1519){if(!_0x2c1519){_0x4fedbb[_0x4f49('0x19')](0x194);}return _0x2c1519;};}function handleError(_0x525950,_0xc54070){_0xc54070=_0xc54070||0x1f4;return function(_0x2eed1c){logger[_0x4f49('0x26')](_0x2eed1c[_0x4f49('0x27')]);if(_0x2eed1c[_0x4f49('0x28')]){delete _0x2eed1c[_0x4f49('0x28')];}_0x525950['status'](_0xc54070)['send'](_0x2eed1c);};}var utilLicense=require(_0x4f49('0x29'));exports[_0x4f49('0x2a')]=function(_0x605c91,_0x560050){var _0x3cbfbd={'raw':!![],'where':{'id':0x1}},_0x206203={};_0x206203[_0x4f49('0x2b')]=_['keys'](db['License'][_0x4f49('0x2c')]);_0x206203[_0x4f49('0x2d')]=_[_0x4f49('0x2e')](_0x605c91['query']);_0x206203[_0x4f49('0x2f')]=_[_0x4f49('0x30')](_0x206203[_0x4f49('0x2b')],_0x206203[_0x4f49('0x2d')]);_0x3cbfbd[_0x4f49('0x31')]=_[_0x4f49('0x30')](_0x206203[_0x4f49('0x2b')],qs[_0x4f49('0x32')](_0x605c91[_0x4f49('0x2d')][_0x4f49('0x32')]));_0x3cbfbd[_0x4f49('0x31')]=_0x3cbfbd[_0x4f49('0x31')][_0x4f49('0x33')]?_0x3cbfbd[_0x4f49('0x31')]:_0x206203[_0x4f49('0x2b')];_0x3cbfbd=_[_0x4f49('0x34')]({},_0x3cbfbd,_0x605c91[_0x4f49('0x35')]);return utilLicense[_0x4f49('0x36')](_0x3cbfbd)[_0x4f49('0x25')](respondWithResult(_0x560050,null))['catch'](handleError(_0x560050,null));};exports[_0x4f49('0x24')]=function(_0x46b7ba,_0x24f568){if(_0x46b7ba[_0x4f49('0x37')]['id']){delete _0x46b7ba[_0x4f49('0x37')]['id'];}return db[_0x4f49('0x38')][_0x4f49('0x39')]({'where':{'id':_0x46b7ba[_0x4f49('0x3a')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0x24f568,null))[_0x4f49('0x25')](function(_0x44e6a0){var _0x343365=_0x44e6a0[_0x4f49('0x3b')]({'plain':!![]});return utilLicense['checkLicense'](_0x343365,_0x46b7ba[_0x4f49('0x37')][_0x4f49('0x3c')]);})[_0x4f49('0x25')](function(_0x26014f){if(!_0x26014f[_0x4f49('0x3d')]){return saveUpdates(_0x46b7ba[_0x4f49('0x37')],null);}return _0x26014f;})[_0x4f49('0x25')](respondWithResult(_0x24f568,null))[_0x4f49('0x3e')](handleError(_0x24f568,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index b1ea8e2..a6d911a 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 _0xdf82=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','define','License','license','util','../../config/logger','api'];(function(_0x3b89bf,_0x554162){var _0x11dbc4=function(_0x2d56d9){while(--_0x2d56d9){_0x3b89bf['push'](_0x3b89bf['shift']());}};_0x11dbc4(++_0x554162);}(_0xdf82,0xe7));var _0x2df8=function(_0x4cf727,_0x31b770){_0x4cf727=_0x4cf727-0x0;var _0x5b2ebd=_0xdf82[_0x4cf727];return _0x5b2ebd;};'use strict';var _=require('lodash');var util=require(_0x2df8('0x0'));var logger=require(_0x2df8('0x1'))(_0x2df8('0x2'));var moment=require(_0x2df8('0x3'));var BPromise=require(_0x2df8('0x4'));var rp=require(_0x2df8('0x5'));var fs=require('fs');var path=require(_0x2df8('0x6'));var rimraf=require(_0x2df8('0x7'));var config=require(_0x2df8('0x8'));var attributes=require(_0x2df8('0x9'));module['exports']=function(_0x1683a8,_0x3926c4){return _0x1683a8[_0x2df8('0xa')](_0x2df8('0xb'),attributes,{'tableName':_0x2df8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0cd6=['exports','define','license','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./license.attributes'];(function(_0xe24e5d,_0x5e1be4){var _0x3a2da5=function(_0x2841e8){while(--_0x2841e8){_0xe24e5d['push'](_0xe24e5d['shift']());}};_0x3a2da5(++_0x5e1be4);}(_0x0cd6,0xf3));var _0x60cd=function(_0x1e381c,_0x47b5b9){_0x1e381c=_0x1e381c-0x0;var _0x9b5ea9=_0x0cd6[_0x1e381c];return _0x9b5ea9;};'use strict';var _=require(_0x60cd('0x0'));var util=require('util');var logger=require(_0x60cd('0x1'))(_0x60cd('0x2'));var moment=require(_0x60cd('0x3'));var BPromise=require(_0x60cd('0x4'));var rp=require(_0x60cd('0x5'));var fs=require('fs');var path=require(_0x60cd('0x6'));var rimraf=require('rimraf');var config=require(_0x60cd('0x7'));var attributes=require(_0x60cd('0x8'));module[_0x60cd('0x9')]=function(_0x183830,_0x2ee689){return _0x183830[_0x60cd('0xa')]('License',attributes,{'tableName':_0x60cd('0xb'),'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 40aa702..d7bae06 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 _0x9d8a=['code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error'];(function(_0x51fbde,_0x477f31){var _0x42162e=function(_0x58df54){while(--_0x58df54){_0x51fbde['push'](_0x51fbde['shift']());}};_0x42162e(++_0x477f31);}(_0x9d8a,0x1d0));var _0xa9d8=function(_0x11fb47,_0x50fbf8){_0x11fb47=_0x11fb47-0x0;var _0xa0d270=_0x9d8a[_0x11fb47];return _0xa0d270;};'use strict';var _=require(_0xa9d8('0x0'));var util=require(_0xa9d8('0x1'));var moment=require(_0xa9d8('0x2'));var BPromise=require(_0xa9d8('0x3'));var rs=require(_0xa9d8('0x4'));var fs=require('fs');var Redis=require(_0xa9d8('0x5'));var db=require(_0xa9d8('0x6'))['db'];var utils=require(_0xa9d8('0x7'));var logger=require(_0xa9d8('0x8'))(_0xa9d8('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa9d8('0xa')][_0xa9d8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x358ab4,_0x4e3001,_0x4f4ddd){return new BPromise(function(_0x5e8ef0,_0x3fb294){return client[_0xa9d8('0xc')](_0x358ab4,_0x4f4ddd)[_0xa9d8('0xd')](function(_0x2f9d61){logger['info'](_0xa9d8('0xe'),_0x4e3001,_0xa9d8('0xf'));logger[_0xa9d8('0x10')](_0xa9d8('0x11'),_0x4e3001,_0xa9d8('0xf'),JSON['stringify'](_0x2f9d61));if(_0x2f9d61[_0xa9d8('0x12')]){if(_0x2f9d61['error'][_0xa9d8('0x13')]===0x1f4){logger[_0xa9d8('0x12')](_0xa9d8('0xe'),_0x4e3001,_0x2f9d61[_0xa9d8('0x12')]['message']);return _0x3fb294(_0x2f9d61[_0xa9d8('0x12')][_0xa9d8('0x14')]);}logger[_0xa9d8('0x12')](_0xa9d8('0xe'),_0x4e3001,_0x2f9d61[_0xa9d8('0x12')][_0xa9d8('0x14')]);return _0x5e8ef0(_0x2f9d61[_0xa9d8('0x12')][_0xa9d8('0x14')]);}else{logger[_0xa9d8('0x15')](_0xa9d8('0xe'),_0x4e3001,_0xa9d8('0xf'));_0x5e8ef0(_0x2f9d61['result'][_0xa9d8('0x14')]);}})[_0xa9d8('0x16')](function(_0x39730a){logger[_0xa9d8('0x12')](_0xa9d8('0xe'),_0x4e3001,_0x39730a);_0x3fb294(_0x39730a);});});} \ No newline at end of file +var _0xdf7b=['message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x41ee16,_0xfa94c3){var _0x1f60de=function(_0x1c8ffc){while(--_0x1c8ffc){_0x41ee16['push'](_0x41ee16['shift']());}};_0x1f60de(++_0xfa94c3);}(_0xdf7b,0x152));var _0xbdf7=function(_0x20025e,_0x44c8e1){_0x20025e=_0x20025e-0x0;var _0x4a5ac4=_0xdf7b[_0x20025e];return _0x4a5ac4;};'use strict';var _=require('lodash');var util=require(_0xbdf7('0x0'));var moment=require(_0xbdf7('0x1'));var BPromise=require(_0xbdf7('0x2'));var rs=require(_0xbdf7('0x3'));var fs=require('fs');var Redis=require(_0xbdf7('0x4'));var db=require(_0xbdf7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbdf7('0x6'));var config=require(_0xbdf7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbdf7('0x8')][_0xbdf7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42f6d0,_0x271848,_0xa337cc){return new BPromise(function(_0x9eb26e,_0x437fb5){return client['request'](_0x42f6d0,_0xa337cc)[_0xbdf7('0xa')](function(_0x142d6b){logger[_0xbdf7('0xb')](_0xbdf7('0xc'),_0x271848,_0xbdf7('0xd'));logger[_0xbdf7('0xe')](_0xbdf7('0xf'),_0x271848,_0xbdf7('0xd'),JSON[_0xbdf7('0x10')](_0x142d6b));if(_0x142d6b[_0xbdf7('0x11')]){if(_0x142d6b[_0xbdf7('0x11')][_0xbdf7('0x12')]===0x1f4){logger[_0xbdf7('0x11')]('License,\x20%s,\x20%s',_0x271848,_0x142d6b['error']['message']);return _0x437fb5(_0x142d6b[_0xbdf7('0x11')][_0xbdf7('0x13')]);}logger[_0xbdf7('0x11')](_0xbdf7('0xc'),_0x271848,_0x142d6b['error']['message']);return _0x9eb26e(_0x142d6b[_0xbdf7('0x11')][_0xbdf7('0x13')]);}else{logger['info'](_0xbdf7('0xc'),_0x271848,_0xbdf7('0xd'));_0x9eb26e(_0x142d6b[_0xbdf7('0x14')]['message']);}})['catch'](function(_0x5e7f9c){logger[_0xbdf7('0x11')](_0xbdf7('0xc'),_0x271848,_0x5e7f9c);_0x437fb5(_0x5e7f9c);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 396ec18..120f96a 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 _0xda27=['Router','fs-extra','../../components/interaction/service','./mailAccount.controller','get','isAuthenticated','index','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','/:id/verify','/:id/users','getAgents','addDisposition','post','addAnswer','create','addImap','addSmtp','addInteraction','/:id/send','send','/:id','delete','removeDispositions','removeAnswers','removeImap','exports','multer','path','connect-timeout','express'];(function(_0x4da2f7,_0x2aa7e8){var _0x11c3fa=function(_0x102fc3){while(--_0x102fc3){_0x4da2f7['push'](_0x4da2f7['shift']());}};_0x11c3fa(++_0x2aa7e8);}(_0xda27,0x17f));var _0x7da2=function(_0x39b4c3,_0x183aa1){_0x39b4c3=_0x39b4c3-0x0;var _0x23a256=_0xda27[_0x39b4c3];return _0x23a256;};'use strict';var multer=require(_0x7da2('0x0'));var util=require('util');var path=require(_0x7da2('0x1'));var timeout=require(_0x7da2('0x2'));var express=require(_0x7da2('0x3'));var router=express[_0x7da2('0x4')]();var fs_extra=require(_0x7da2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7da2('0x6'));var config=require('../../config/environment');var controller=require(_0x7da2('0x7'));router[_0x7da2('0x8')]('/',auth[_0x7da2('0x9')](),controller[_0x7da2('0xa')]);router[_0x7da2('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x7da2('0xb')]);router[_0x7da2('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x7da2('0xc')]);router[_0x7da2('0x8')](_0x7da2('0xd'),auth[_0x7da2('0x9')](),controller[_0x7da2('0xe')]);router[_0x7da2('0x8')](_0x7da2('0xf'),auth[_0x7da2('0x9')](),controller[_0x7da2('0x10')]);router[_0x7da2('0x8')](_0x7da2('0x11'),auth[_0x7da2('0x9')](),controller[_0x7da2('0x12')]);router[_0x7da2('0x8')](_0x7da2('0x13'),auth[_0x7da2('0x9')](),controller['getSmtp']);router[_0x7da2('0x8')](_0x7da2('0x14'),auth[_0x7da2('0x9')](),controller[_0x7da2('0x15')]);router[_0x7da2('0x8')](_0x7da2('0x16'),auth[_0x7da2('0x9')](),controller[_0x7da2('0x17')]);router[_0x7da2('0x8')]('/:id/messages',auth[_0x7da2('0x9')](),controller[_0x7da2('0x18')]);router['get'](_0x7da2('0x19'),auth[_0x7da2('0x9')](),controller['verifySmtp']);router['get'](_0x7da2('0x1a'),auth[_0x7da2('0x9')](),controller[_0x7da2('0x1b')]);router['post'](_0x7da2('0xd'),auth[_0x7da2('0x9')](),controller[_0x7da2('0x1c')]);router[_0x7da2('0x1d')](_0x7da2('0xf'),auth[_0x7da2('0x9')](),controller[_0x7da2('0x1e')]);router['post']('/',auth[_0x7da2('0x9')](),controller[_0x7da2('0x1f')]);router[_0x7da2('0x1d')](_0x7da2('0x11'),auth[_0x7da2('0x9')](),controller[_0x7da2('0x20')]);router[_0x7da2('0x1d')](_0x7da2('0x13'),auth[_0x7da2('0x9')](),controller[_0x7da2('0x21')]);router[_0x7da2('0x1d')]('/:id/interactions',auth[_0x7da2('0x9')](),controller[_0x7da2('0x22')]);router[_0x7da2('0x1d')](_0x7da2('0x16'),auth[_0x7da2('0x9')](),controller['addApplications']);router[_0x7da2('0x1d')](_0x7da2('0x23'),auth[_0x7da2('0x9')](),controller[_0x7da2('0x24')]);router[_0x7da2('0x1d')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x7da2('0x25'),auth[_0x7da2('0x9')](),controller['update']);router[_0x7da2('0x26')]('/:id/dispositions',auth[_0x7da2('0x9')](),controller[_0x7da2('0x27')]);router[_0x7da2('0x26')](_0x7da2('0xf'),auth[_0x7da2('0x9')](),controller[_0x7da2('0x28')]);router[_0x7da2('0x26')](_0x7da2('0x11'),auth['isAuthenticated'](),controller[_0x7da2('0x29')]);router[_0x7da2('0x26')]('/:id/out_servers',auth[_0x7da2('0x9')](),controller['removeSmtp']);router[_0x7da2('0x26')](_0x7da2('0x25'),auth[_0x7da2('0x9')](),controller['destroy']);router[_0x7da2('0x26')](_0x7da2('0x1a'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x7da2('0x2a')]=router; \ No newline at end of file +var _0xb557=['getAgents','/:id/dispositions','addDisposition','addAnswer','post','create','addImap','addSmtp','addInteraction','/:id/send','send','put','update','delete','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','./mailAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','verifySmtp'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xb557,0x1f4));var _0x7b55=function(_0x4edab3,_0x425b15){_0x4edab3=_0x4edab3-0x0;var _0x526e76=_0xb557[_0x4edab3];return _0x526e76;};'use strict';var multer=require(_0x7b55('0x0'));var util=require(_0x7b55('0x1'));var path=require(_0x7b55('0x2'));var timeout=require(_0x7b55('0x3'));var express=require('express');var router=express[_0x7b55('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7b55('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7b55('0x6'));router['get']('/',auth[_0x7b55('0x7')](),controller[_0x7b55('0x8')]);router[_0x7b55('0x9')](_0x7b55('0xa'),auth[_0x7b55('0x7')](),controller[_0x7b55('0xb')]);router[_0x7b55('0x9')](_0x7b55('0xc'),auth[_0x7b55('0x7')](),controller[_0x7b55('0xd')]);router[_0x7b55('0x9')]('/:id/dispositions',auth[_0x7b55('0x7')](),controller[_0x7b55('0xe')]);router[_0x7b55('0x9')](_0x7b55('0xf'),auth[_0x7b55('0x7')](),controller[_0x7b55('0x10')]);router['get'](_0x7b55('0x11'),auth['isAuthenticated'](),controller[_0x7b55('0x12')]);router[_0x7b55('0x9')](_0x7b55('0x13'),auth[_0x7b55('0x7')](),controller[_0x7b55('0x14')]);router[_0x7b55('0x9')](_0x7b55('0x15'),auth[_0x7b55('0x7')](),controller[_0x7b55('0x16')]);router[_0x7b55('0x9')](_0x7b55('0x17'),auth['isAuthenticated'](),controller[_0x7b55('0x18')]);router[_0x7b55('0x9')](_0x7b55('0x19'),auth[_0x7b55('0x7')](),controller[_0x7b55('0x1a')]);router[_0x7b55('0x9')]('/:id/verify',auth[_0x7b55('0x7')](),controller[_0x7b55('0x1b')]);router[_0x7b55('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0x7b55('0x1c')]);router['post'](_0x7b55('0x1d'),auth['isAuthenticated'](),controller[_0x7b55('0x1e')]);router['post'](_0x7b55('0xf'),auth[_0x7b55('0x7')](),controller[_0x7b55('0x1f')]);router[_0x7b55('0x20')]('/',auth[_0x7b55('0x7')](),controller[_0x7b55('0x21')]);router[_0x7b55('0x20')](_0x7b55('0x11'),auth[_0x7b55('0x7')](),controller[_0x7b55('0x22')]);router[_0x7b55('0x20')](_0x7b55('0x13'),auth[_0x7b55('0x7')](),controller[_0x7b55('0x23')]);router[_0x7b55('0x20')](_0x7b55('0x15'),auth[_0x7b55('0x7')](),controller[_0x7b55('0x24')]);router[_0x7b55('0x20')]('/:id/applications',auth[_0x7b55('0x7')](),controller['addApplications']);router[_0x7b55('0x20')](_0x7b55('0x25'),auth['isAuthenticated'](),controller[_0x7b55('0x26')]);router[_0x7b55('0x20')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x7b55('0x27')](_0x7b55('0xc'),auth[_0x7b55('0x7')](),controller[_0x7b55('0x28')]);router[_0x7b55('0x29')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0x7b55('0xf'),auth['isAuthenticated'](),controller[_0x7b55('0x2a')]);router['delete'](_0x7b55('0x11'),auth[_0x7b55('0x7')](),controller[_0x7b55('0x2b')]);router[_0x7b55('0x29')]('/:id/out_servers',auth[_0x7b55('0x7')](),controller[_0x7b55('0x2c')]);router['delete'](_0x7b55('0xc'),auth[_0x7b55('0x7')](),controller[_0x7b55('0x2d')]);router['delete']('/:id/users',auth[_0x7b55('0x7')](),controller[_0x7b55('0x2e')]);module[_0x7b55('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 b0b45d8..d43ffe0 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 _0x3b75=['UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','exports','STRING','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER'];(function(_0x4c689e,_0x1a783e){var _0x500bc7=function(_0x16b3ab){while(--_0x16b3ab){_0x4c689e['push'](_0x4c689e['shift']());}};_0x500bc7(++_0x1a783e);}(_0x3b75,0x144));var _0x53b7=function(_0x3203a1,_0x46c498){_0x3203a1=_0x3203a1-0x0;var _0x24215e=_0x3b75[_0x3203a1];return _0x24215e;};'use strict';var Sequelize=require(_0x53b7('0x0'));module[_0x53b7('0x1')]={'description':{'type':Sequelize[_0x53b7('0x2')]},'name':{'type':Sequelize[_0x53b7('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x53b7('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x53b7('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x53b7('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x53b7('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x53b7('0x2')],'allowNull':![],'defaultValue':_0x53b7('0x4')},'fontSize':{'type':Sequelize[_0x53b7('0x5')](0x2)[_0x53b7('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x53b7('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x53b7('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x53b7('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x53b7('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x53b7('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x53b7('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x53b7('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x53b7('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x53b7('0x3')],'defaultValue':![],'comment':_0x53b7('0x8'),'set':function(_0x7c80ef){if(!_0x7c80ef)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x53b7('0x9')]('mandatoryDisposition',_0x7c80ef);}}}; \ No newline at end of file +var _0x7a08=['sequelize','exports','BOOLEAN','STRING','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition'];(function(_0xbe41ba,_0x384563){var _0x2c2085=function(_0x146ee7){while(--_0x146ee7){_0xbe41ba['push'](_0xbe41ba['shift']());}};_0x2c2085(++_0x384563);}(_0x7a08,0x11e));var _0x87a0=function(_0x2cd1fb,_0x291f55){_0x2cd1fb=_0x2cd1fb-0x0;var _0x48fd2b=_0x7a08[_0x2cd1fb];return _0x48fd2b;};'use strict';var Sequelize=require(_0x87a0('0x0'));module[_0x87a0('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x87a0('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x87a0('0x3')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x87a0('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x87a0('0x3')],'allowNull':![]},'template':{'type':Sequelize[_0x87a0('0x4')]},'markAsUnread':{'type':Sequelize[_0x87a0('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x87a0('0x3')],'allowNull':![],'defaultValue':_0x87a0('0x5')},'fontSize':{'type':Sequelize[_0x87a0('0x6')](0x2)[_0x87a0('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x87a0('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x87a0('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x87a0('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x87a0('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x87a0('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x87a0('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x87a0('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x87a0('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x87a0('0x2')],'defaultValue':![],'comment':_0x87a0('0x9'),'set':function(_0x34ba3a){if(!_0x34ba3a)this['setDataValue'](_0x87a0('0xa'),null);this[_0x87a0('0xb')](_0x87a0('0xc'),_0x34ba3a);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index f80eec6..2187e50 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 _0x2ad5=['send','index','MailServerIn','Imap','MailServerOut','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','params','Smtp','Pause','length','find','body','describe','MailAccountId','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','addAnswer','create','getAnswers','CannedAnswer','pick','rows','removeAnswers','ids','email','ListId','isNil','active','description','cservice','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','addImap','removeImap','setImap','getSmtp','addSmtp','addInteraction','MailInteraction','getInteractions','CmContact','Contact','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','finally','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','updatedAt','DESC','from','attachments','root','server/files/attachments','secure','auth','SendMail','sendMail','List\x20not\x20found','Contacts','defaults','messageId','subject','out','Interaction','Messages','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','User','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','juice','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./mailAccount.socket','register','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','end','offset','limit','undefined','count','status','set','json','reject','save','update','destroy','MailAccounts','UserProfileResource','stack','name'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x2ad5,0x8b));var _0x52ad=function(_0x1d1e3b,_0x5c75f8){_0x1d1e3b=_0x1d1e3b-0x0;var _0x3c760a=_0x2ad5[_0x1d1e3b];return _0x3c760a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x52ad('0x0'));var zipdir=require(_0x52ad('0x1'));var jsonpatch=require(_0x52ad('0x2'));var rp=require(_0x52ad('0x3'));var moment=require(_0x52ad('0x4'));var BPromise=require(_0x52ad('0x5'));var Mustache=require(_0x52ad('0x6'));var util=require('util');var path=require(_0x52ad('0x7'));var sox=require(_0x52ad('0x8'));var csv=require(_0x52ad('0x9'));var ejs=require(_0x52ad('0xa'));var fs=require('fs');var fs_extra=require(_0x52ad('0xb'));var _=require('lodash');var squel=require(_0x52ad('0xc'));var crypto=require(_0x52ad('0xd'));var jsforce=require(_0x52ad('0xe'));var deskjs=require(_0x52ad('0xf'));var toCsv=require(_0x52ad('0x9'));var querystring=require('querystring');var Papa=require(_0x52ad('0x10'));var htmlToText=require('html-to-text');var juice=require(_0x52ad('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x52ad('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x52ad('0x13'));var logger=require(_0x52ad('0x14'))(_0x52ad('0x15'));var utils=require(_0x52ad('0x16'));var config=require(_0x52ad('0x17'));var licenseUtil=require(_0x52ad('0x18'));var db=require(_0x52ad('0x19'))['db'];config[_0x52ad('0x1a')]=_['defaults'](config[_0x52ad('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x52ad('0x1b'))(new Redis(config['redis']));require(_0x52ad('0x1c'))[_0x52ad('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x52ad('0x1e')]({'port':0x232b});function respondWithRpcPromise(_0x33ac97,_0x343190,_0xfa048f,_0x4b90fb){return new BPromise(function(_0x5a4e8d,_0x2748f8){var _0x111fa6=_0x4b90fb||client;return _0x111fa6[_0x52ad('0x1f')](_0x33ac97,_0xfa048f)[_0x52ad('0x20')](function(_0x44a220){logger[_0x52ad('0x21')](_0x52ad('0x22'),_0x343190,_0x52ad('0x23'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x343190,'request\x20sent',JSON['stringify'](_0x44a220));if(_0x44a220['error']){if(_0x44a220['error']['code']===0x1f4){logger['error'](_0x52ad('0x22'),_0x343190,_0x44a220[_0x52ad('0x24')]['message']);return _0x2748f8(_0x44a220[_0x52ad('0x24')][_0x52ad('0x25')]);}logger[_0x52ad('0x24')]('MailAccount,\x20%s,\x20%s',_0x343190,_0x44a220[_0x52ad('0x24')][_0x52ad('0x25')]);return _0x5a4e8d(_0x44a220[_0x52ad('0x24')][_0x52ad('0x25')]);}else{logger[_0x52ad('0x21')](_0x52ad('0x22'),_0x343190,_0x52ad('0x23'));_0x5a4e8d(_0x44a220[_0x52ad('0x26')][_0x52ad('0x25')]);}})[_0x52ad('0x27')](function(_0x41c8c7){logger[_0x52ad('0x24')](_0x52ad('0x22'),_0x343190,_0x41c8c7);_0x2748f8(_0x41c8c7);});});}function respondWithStatusCode(_0x477ea3,_0x33298f){_0x33298f=_0x33298f||0xcc;return function(_0x3ad678){if(_0x3ad678){return _0x477ea3[_0x52ad('0x28')](_0x33298f);}return _0x477ea3['status'](_0x33298f)[_0x52ad('0x29')]();};}function respondWithResult(_0x475de9,_0x8e252){_0x8e252=_0x8e252||0xc8;return function(_0x4687c4){if(_0x4687c4){return _0x475de9['status'](_0x8e252)['json'](_0x4687c4);}};}function respondWithFilteredResult(_0x228843,_0x39f13c){return function(_0x169c62){if(_0x169c62){var _0x5c0d1e=typeof _0x39f13c[_0x52ad('0x2a')]==='undefined'&&typeof _0x39f13c[_0x52ad('0x2b')]===_0x52ad('0x2c');var _0x34e90f=_0x169c62['count'];var _0x108622=_0x5c0d1e?0x0:_0x39f13c[_0x52ad('0x2a')];var _0x1f3902=_0x5c0d1e?_0x169c62[_0x52ad('0x2d')]:_0x39f13c[_0x52ad('0x2a')]+_0x39f13c[_0x52ad('0x2b')];var _0x512c64;if(_0x1f3902>=_0x34e90f){_0x1f3902=_0x34e90f;_0x512c64=0xc8;}else{_0x512c64=0xce;}_0x228843[_0x52ad('0x2e')](_0x512c64);return _0x228843[_0x52ad('0x2f')]('Content-Range',_0x108622+'-'+_0x1f3902+'/'+_0x34e90f)[_0x52ad('0x30')](_0x169c62);}return null;};}function patchUpdates(_0x1acf8f){return function(_0x204f11){try{jsonpatch['apply'](_0x204f11,_0x1acf8f,!![]);}catch(_0xa209e1){return BPromise[_0x52ad('0x31')](_0xa209e1);}return _0x204f11[_0x52ad('0x32')]();};}function saveUpdates(_0x562c54,_0x474f77){return function(_0xc026e1){if(_0xc026e1){return _0xc026e1[_0x52ad('0x33')](_0x562c54)[_0x52ad('0x20')](function(_0x9facc7){return _0x9facc7;});}return null;};}function removeEntity(_0x2c9b72,_0x4d1c16){return function(_0x3b8efa){if(_0x3b8efa){return _0x3b8efa[_0x52ad('0x34')]()[_0x52ad('0x20')](function(){var _0x5946eb=_0x3b8efa['get']({'plain':!![]});var _0x25f0b5=_0x52ad('0x35');return db[_0x52ad('0x36')]['destroy']({'where':{'type':_0x25f0b5,'resourceId':_0x5946eb['id']}})[_0x52ad('0x20')](function(){return _0x3b8efa;});})[_0x52ad('0x20')](function(){_0x2c9b72['status'](0xcc)[_0x52ad('0x29')]();});}};}function handleEntityNotFound(_0x46720f,_0x23b6b7){return function(_0x31c347){if(!_0x31c347){_0x46720f[_0x52ad('0x28')](0x194);}return _0x31c347;};}function handleError(_0x2ce759,_0x26a048){_0x26a048=_0x26a048||0x1f4;return function(_0x11f778){logger['error'](_0x11f778[_0x52ad('0x37')]);if(_0x11f778[_0x52ad('0x38')]){delete _0x11f778[_0x52ad('0x38')];}_0x2ce759[_0x52ad('0x2e')](_0x26a048)[_0x52ad('0x39')](_0x11f778);};}exports[_0x52ad('0x3a')]=function(_0x44827a,_0x175ad9){var _0x252256={'include':[{'model':db[_0x52ad('0x3b')],'as':_0x52ad('0x3c')},{'model':db[_0x52ad('0x3d')],'as':'Smtp'},{'model':db['Pause'],'as':_0x52ad('0x3e')}]},_0x5cac34={},_0x52b4f9={'count':0x0,'rows':[]};var _0x1866a5=_[_0x52ad('0x3f')](db[_0x52ad('0x40')][_0x52ad('0x41')],function(_0x11f6cd){return{'name':_0x11f6cd[_0x52ad('0x42')],'type':_0x11f6cd[_0x52ad('0x43')][_0x52ad('0x44')]};});_0x5cac34[_0x52ad('0x45')]=_[_0x52ad('0x3f')](_0x1866a5,_0x52ad('0x38'));_0x5cac34[_0x52ad('0x46')]=_[_0x52ad('0x47')](_0x44827a[_0x52ad('0x46')]);_0x5cac34['filters']=_['intersection'](_0x5cac34[_0x52ad('0x45')],_0x5cac34[_0x52ad('0x46')]);_0x252256[_0x52ad('0x48')]=_[_0x52ad('0x49')](_0x5cac34[_0x52ad('0x45')],qs[_0x52ad('0x4a')](_0x44827a[_0x52ad('0x46')][_0x52ad('0x4a')]));_0x252256[_0x52ad('0x48')]=_0x252256[_0x52ad('0x48')]['length']?_0x252256[_0x52ad('0x48')]:_0x5cac34[_0x52ad('0x45')];if(!_0x44827a[_0x52ad('0x46')]['hasOwnProperty'](_0x52ad('0x4b'))){_0x252256[_0x52ad('0x2b')]=qs[_0x52ad('0x2b')](_0x44827a[_0x52ad('0x46')][_0x52ad('0x2b')]);_0x252256[_0x52ad('0x2a')]=qs[_0x52ad('0x2a')](_0x44827a[_0x52ad('0x46')]['offset']);}_0x252256[_0x52ad('0x4c')]=qs['sort'](_0x44827a['query'][_0x52ad('0x4d')]);_0x252256[_0x52ad('0x4e')]=qs[_0x52ad('0x4f')](_['pick'](_0x44827a['query'],_0x5cac34['filters']),_0x1866a5);if(_0x44827a[_0x52ad('0x46')]['filter']){_0x252256[_0x52ad('0x4e')]=_[_0x52ad('0x50')](_0x252256['where'],{'$or':_[_0x52ad('0x3f')](_0x1866a5,function(_0x7b7e8e){if(_0x7b7e8e['type']!==_0x52ad('0x51')){var _0xd67e4e={};_0xd67e4e[_0x7b7e8e[_0x52ad('0x38')]]={'$like':'%'+_0x44827a[_0x52ad('0x46')][_0x52ad('0x52')]+'%'};return _0xd67e4e;}})});}_0x252256=_[_0x52ad('0x50')]({},_0x252256,_0x44827a[_0x52ad('0x53')]);var _0x43305f={'where':_0x252256[_0x52ad('0x4e')]};return db[_0x52ad('0x40')][_0x52ad('0x2d')](_0x43305f)[_0x52ad('0x20')](function(_0x196623){_0x52b4f9[_0x52ad('0x2d')]=_0x196623;if(_0x44827a[_0x52ad('0x46')][_0x52ad('0x54')]){_0x252256[_0x52ad('0x55')]=[{'all':!![]}];}return db[_0x52ad('0x40')][_0x52ad('0x56')](_0x252256);})[_0x52ad('0x20')](function(_0x29428a){_0x52b4f9['rows']=_0x29428a;return _0x52b4f9;})[_0x52ad('0x20')](respondWithFilteredResult(_0x175ad9,_0x252256))[_0x52ad('0x27')](handleError(_0x175ad9,null));};exports['show']=function(_0x9c66ab,_0x2d9b37){var _0x3d259b={'raw':![],'where':{'id':_0x9c66ab[_0x52ad('0x57')]['id']},'include':[{'model':db[_0x52ad('0x3b')],'as':_0x52ad('0x3c')},{'model':db[_0x52ad('0x3d')],'as':_0x52ad('0x58')},{'model':db[_0x52ad('0x59')],'as':_0x52ad('0x3e')}]},_0x3c3058={};_0x3c3058[_0x52ad('0x45')]=_[_0x52ad('0x47')](db['MailAccount'][_0x52ad('0x41')]);_0x3c3058['query']=_[_0x52ad('0x47')](_0x9c66ab[_0x52ad('0x46')]);_0x3c3058[_0x52ad('0x4f')]=_[_0x52ad('0x49')](_0x3c3058['model'],_0x3c3058['query']);_0x3d259b[_0x52ad('0x48')]=_[_0x52ad('0x49')](_0x3c3058[_0x52ad('0x45')],qs[_0x52ad('0x4a')](_0x9c66ab[_0x52ad('0x46')][_0x52ad('0x4a')]));_0x3d259b[_0x52ad('0x48')]=_0x3d259b['attributes'][_0x52ad('0x5a')]?_0x3d259b['attributes']:_0x3c3058[_0x52ad('0x45')];if(_0x9c66ab[_0x52ad('0x46')][_0x52ad('0x54')]){_0x3d259b['include']=[{'all':!![]}];}_0x3d259b=_[_0x52ad('0x50')]({},_0x3d259b,_0x9c66ab[_0x52ad('0x53')]);return db[_0x52ad('0x40')][_0x52ad('0x5b')](_0x3d259b)[_0x52ad('0x20')](handleEntityNotFound(_0x2d9b37,null))['then'](respondWithResult(_0x2d9b37,null))[_0x52ad('0x27')](handleError(_0x2d9b37,null));};exports['update']=function(_0x205599,_0xcc7a6a){if(_0x205599['body']['id']){delete _0x205599[_0x52ad('0x5c')]['id'];}return db[_0x52ad('0x40')][_0x52ad('0x5b')]({'where':{'id':_0x205599[_0x52ad('0x57')]['id']},'include':[{'model':db[_0x52ad('0x3b')],'as':_0x52ad('0x3c')},{'model':db['MailServerOut'],'as':_0x52ad('0x58')},{'model':db[_0x52ad('0x59')],'as':_0x52ad('0x3e')}]})[_0x52ad('0x20')](handleEntityNotFound(_0xcc7a6a,null))[_0x52ad('0x20')](saveUpdates(_0x205599['body'],null))[_0x52ad('0x20')](function(_0x4b5766){if(_0x4b5766&&_0x205599[_0x52ad('0x5c')]['Imap']){return db[_0x52ad('0x3b')][_0x52ad('0x33')](_0x205599[_0x52ad('0x5c')][_0x52ad('0x3c')],{'where':{'MailAccountId':_0x4b5766['id']}})[_0x52ad('0x20')](function(){return _0x4b5766;});}return _0x4b5766;})[_0x52ad('0x20')](function(_0x341014){if(_0x341014&&_0x205599[_0x52ad('0x5c')][_0x52ad('0x58')]){return db[_0x52ad('0x3d')]['update'](_0x205599[_0x52ad('0x5c')][_0x52ad('0x58')],{'where':{'MailAccountId':_0x341014['id']}})['then'](function(){return _0x341014;});}return _0x341014;})[_0x52ad('0x20')](respondWithResult(_0xcc7a6a,null))['catch'](handleError(_0xcc7a6a,null));};exports['describe']=function(_0x51b3f3,_0x20a5f0){return db[_0x52ad('0x40')][_0x52ad('0x5d')]()[_0x52ad('0x20')](respondWithResult(_0x20a5f0,null))[_0x52ad('0x27')](handleError(_0x20a5f0,null));};exports['addDisposition']=function(_0x5d0239,_0x310cee,_0x1d278f){if(_0x5d0239[_0x52ad('0x5c')]['id']){delete _0x5d0239[_0x52ad('0x5c')]['id'];}return db['MailAccount'][_0x52ad('0x5b')]({'where':{'id':_0x5d0239[_0x52ad('0x57')]['id']}})[_0x52ad('0x20')](handleEntityNotFound(_0x310cee,null))[_0x52ad('0x20')](function(_0x409e6e){if(_0x409e6e){_0x5d0239[_0x52ad('0x5c')][_0x52ad('0x5e')]=_0x409e6e['id'];return db[_0x52ad('0x5f')]['create'](_0x5d0239[_0x52ad('0x5c')]);}})[_0x52ad('0x20')](respondWithResult(_0x310cee,null))[_0x52ad('0x27')](handleError(_0x310cee,null));};exports[_0x52ad('0x60')]=function(_0x14786b,_0x20f31a,_0x86ced2){var _0x3201f5={'raw':![],'where':{}};var _0x24a722={};var _0x3c0ac5={'count':0x0,'rows':[]};return db['MailAccount'][_0x52ad('0x61')]({'where':{'id':_0x14786b['params']['id']}})[_0x52ad('0x20')](handleEntityNotFound(_0x20f31a,null))[_0x52ad('0x20')](function(_0x4966c8){if(_0x4966c8){_0x24a722['model']=_[_0x52ad('0x47')](db[_0x52ad('0x5f')][_0x52ad('0x41')]);_0x24a722['query']=_['keys'](_0x14786b[_0x52ad('0x46')]);_0x24a722['filters']=_[_0x52ad('0x49')](_0x24a722[_0x52ad('0x45')],_0x24a722[_0x52ad('0x46')]);_0x3201f5[_0x52ad('0x48')]=_[_0x52ad('0x49')](_0x24a722[_0x52ad('0x45')],qs[_0x52ad('0x4a')](_0x14786b[_0x52ad('0x46')]['fields']));_0x3201f5[_0x52ad('0x48')]=_0x3201f5[_0x52ad('0x48')][_0x52ad('0x5a')]?_0x3201f5[_0x52ad('0x48')]:_0x24a722[_0x52ad('0x45')];if(!_0x14786b[_0x52ad('0x46')][_0x52ad('0x62')](_0x52ad('0x4b'))){_0x3201f5['limit']=qs[_0x52ad('0x2b')](_0x14786b[_0x52ad('0x46')][_0x52ad('0x2b')]);_0x3201f5[_0x52ad('0x2a')]=qs[_0x52ad('0x2a')](_0x14786b['query']['offset']);}_0x3201f5[_0x52ad('0x4c')]=qs[_0x52ad('0x4d')](_0x14786b[_0x52ad('0x46')][_0x52ad('0x4d')]);_0x3201f5[_0x52ad('0x4e')]=qs[_0x52ad('0x4f')](_['pick'](_0x14786b[_0x52ad('0x46')],_0x24a722[_0x52ad('0x4f')]));_0x3201f5[_0x52ad('0x4e')][_0x52ad('0x5e')]=_0x4966c8['id'];if(_0x14786b[_0x52ad('0x46')]['filter']){_0x3201f5['where']=_[_0x52ad('0x50')](_0x3201f5[_0x52ad('0x4e')],{'$or':_['map'](_0x3201f5[_0x52ad('0x48')],function(_0x1ba122){var _0x197ce1={};_0x197ce1[_0x1ba122]={'$like':'%'+_0x14786b[_0x52ad('0x46')][_0x52ad('0x52')]+'%'};return _0x197ce1;})});}_0x3201f5=_[_0x52ad('0x50')]({},_0x3201f5,_0x14786b[_0x52ad('0x53')]);return db['Disposition']['count']({'where':_0x3201f5[_0x52ad('0x4e')]})[_0x52ad('0x20')](function(_0x586031){_0x3c0ac5['count']=_0x586031;if(_0x14786b[_0x52ad('0x46')][_0x52ad('0x54')]){_0x3201f5[_0x52ad('0x55')]=[{'all':!![]}];}return db[_0x52ad('0x5f')][_0x52ad('0x56')](_0x3201f5);})[_0x52ad('0x20')](function(_0x24c914){_0x3c0ac5['rows']=_0x24c914;return _0x3c0ac5;});}})['then'](respondWithFilteredResult(_0x20f31a,_0x3201f5))['catch'](handleError(_0x20f31a,null));};exports[_0x52ad('0x63')]=function(_0x37bb71,_0x640554,_0x51f8a9){return db['MailAccount'][_0x52ad('0x5b')]({'where':{'id':_0x37bb71[_0x52ad('0x57')]['id']}})[_0x52ad('0x20')](handleEntityNotFound(_0x640554,null))[_0x52ad('0x20')](function(_0x346e28){if(_0x346e28){return _0x346e28[_0x52ad('0x63')](_0x37bb71[_0x52ad('0x46')]['ids']);}})[_0x52ad('0x20')](respondWithStatusCode(_0x640554,null))['catch'](handleError(_0x640554,null));};exports[_0x52ad('0x64')]=function(_0x4721ff,_0x57c048,_0x312ca7){if(_0x4721ff['body']['id']){delete _0x4721ff[_0x52ad('0x5c')]['id'];}return db[_0x52ad('0x40')]['find']({'where':{'id':_0x4721ff['params']['id']}})['then'](handleEntityNotFound(_0x57c048,null))[_0x52ad('0x20')](function(_0x5c2eed){if(_0x5c2eed){_0x4721ff[_0x52ad('0x5c')][_0x52ad('0x5e')]=_0x5c2eed['id'];return db['CannedAnswer'][_0x52ad('0x65')](_0x4721ff[_0x52ad('0x5c')]);}})[_0x52ad('0x20')](respondWithResult(_0x57c048,null))[_0x52ad('0x27')](handleError(_0x57c048,null));};exports[_0x52ad('0x66')]=function(_0x186c85,_0x5571db,_0x37a40a){var _0x523d8e={'raw':![],'where':{}};var _0x3355aa={};var _0x5b2cfd={'count':0x0,'rows':[]};return db[_0x52ad('0x40')][_0x52ad('0x61')]({'where':{'id':_0x186c85['params']['id']}})[_0x52ad('0x20')](handleEntityNotFound(_0x5571db,null))['then'](function(_0x52033c){if(_0x52033c){_0x3355aa[_0x52ad('0x45')]=_['keys'](db[_0x52ad('0x67')][_0x52ad('0x41')]);_0x3355aa[_0x52ad('0x46')]=_[_0x52ad('0x47')](_0x186c85[_0x52ad('0x46')]);_0x3355aa[_0x52ad('0x4f')]=_['intersection'](_0x3355aa['model'],_0x3355aa[_0x52ad('0x46')]);_0x523d8e[_0x52ad('0x48')]=_['intersection'](_0x3355aa[_0x52ad('0x45')],qs[_0x52ad('0x4a')](_0x186c85[_0x52ad('0x46')]['fields']));_0x523d8e[_0x52ad('0x48')]=_0x523d8e[_0x52ad('0x48')][_0x52ad('0x5a')]?_0x523d8e[_0x52ad('0x48')]:_0x3355aa[_0x52ad('0x45')];if(!_0x186c85[_0x52ad('0x46')][_0x52ad('0x62')](_0x52ad('0x4b'))){_0x523d8e[_0x52ad('0x2b')]=qs[_0x52ad('0x2b')](_0x186c85[_0x52ad('0x46')]['limit']);_0x523d8e[_0x52ad('0x2a')]=qs['offset'](_0x186c85[_0x52ad('0x46')][_0x52ad('0x2a')]);}_0x523d8e['order']=qs['sort'](_0x186c85[_0x52ad('0x46')][_0x52ad('0x4d')]);_0x523d8e[_0x52ad('0x4e')]=qs[_0x52ad('0x4f')](_[_0x52ad('0x68')](_0x186c85[_0x52ad('0x46')],_0x3355aa[_0x52ad('0x4f')]));_0x523d8e[_0x52ad('0x4e')][_0x52ad('0x5e')]=_0x52033c['id'];if(_0x186c85[_0x52ad('0x46')]['filter']){_0x523d8e[_0x52ad('0x4e')]=_[_0x52ad('0x50')](_0x523d8e[_0x52ad('0x4e')],{'$or':_[_0x52ad('0x3f')](_0x523d8e['attributes'],function(_0x7392b){var _0x4af308={};_0x4af308[_0x7392b]={'$like':'%'+_0x186c85[_0x52ad('0x46')]['filter']+'%'};return _0x4af308;})});}_0x523d8e=_[_0x52ad('0x50')]({},_0x523d8e,_0x186c85['options']);return db[_0x52ad('0x67')]['count']({'where':_0x523d8e[_0x52ad('0x4e')]})['then'](function(_0x8a2ca5){_0x5b2cfd[_0x52ad('0x2d')]=_0x8a2ca5;if(_0x186c85[_0x52ad('0x46')][_0x52ad('0x54')]){_0x523d8e[_0x52ad('0x55')]=[{'all':!![]}];}return db[_0x52ad('0x67')][_0x52ad('0x56')](_0x523d8e);})[_0x52ad('0x20')](function(_0x8b49b){_0x5b2cfd[_0x52ad('0x69')]=_0x8b49b;return _0x5b2cfd;});}})[_0x52ad('0x20')](respondWithFilteredResult(_0x5571db,_0x523d8e))['catch'](handleError(_0x5571db,null));};exports['removeAnswers']=function(_0x326040,_0x2e14f3,_0x25464b){return db[_0x52ad('0x40')]['find']({'where':{'id':_0x326040['params']['id']}})[_0x52ad('0x20')](handleEntityNotFound(_0x2e14f3,null))[_0x52ad('0x20')](function(_0x53ea13){if(_0x53ea13){return _0x53ea13[_0x52ad('0x6a')](_0x326040[_0x52ad('0x46')][_0x52ad('0x6b')]);}})[_0x52ad('0x20')](respondWithStatusCode(_0x2e14f3,null))[_0x52ad('0x27')](handleError(_0x2e14f3,null));};exports[_0x52ad('0x65')]=function(_0x44ad1b,_0x5d0906){var _0x1187c0={'name':_0x44ad1b['body'][_0x52ad('0x38')],'key':_0x44ad1b[_0x52ad('0x5c')][_0x52ad('0x44')],'email':_0x44ad1b[_0x52ad('0x5c')][_0x52ad('0x6c')],'ListId':_0x44ad1b[_0x52ad('0x5c')][_0x52ad('0x6d')],'active':!_[_0x52ad('0x6e')](_0x44ad1b['body'][_0x52ad('0x6f')])?_0x44ad1b['body'][_0x52ad('0x6f')]:!![],'description':_0x44ad1b[_0x52ad('0x5c')][_0x52ad('0x70')]||null,'Imap':{},'Smtp':{}};if(_[_0x52ad('0x6e')](_0x44ad1b['body'][_0x52ad('0x71')])){if(_0x44ad1b[_0x52ad('0x5c')][_0x52ad('0x72')]){_0x1187c0[_0x52ad('0x3c')][_0x52ad('0x73')]=_0x1187c0[_0x52ad('0x58')][_0x52ad('0x73')]=_0x44ad1b[_0x52ad('0x5c')][_0x52ad('0x74')];_0x1187c0[_0x52ad('0x3c')][_0x52ad('0x75')]=_0x1187c0[_0x52ad('0x58')][_0x52ad('0x76')]=_0x44ad1b[_0x52ad('0x5c')][_0x52ad('0x77')];}else{_0x1187c0[_0x52ad('0x3c')][_0x52ad('0x78')]=_0x1187c0['Smtp'][_0x52ad('0x78')]=![];}_0x1187c0[_0x52ad('0x3c')][_0x52ad('0x79')]=_0x44ad1b[_0x52ad('0x5c')][_0x52ad('0x3c')]['host'];_0x1187c0[_0x52ad('0x3c')][_0x52ad('0x7a')]=_0x44ad1b[_0x52ad('0x5c')][_0x52ad('0x3c')][_0x52ad('0x7a')];_0x1187c0[_0x52ad('0x58')][_0x52ad('0x79')]=_0x44ad1b[_0x52ad('0x5c')]['Smtp'][_0x52ad('0x79')];_0x1187c0['Smtp'][_0x52ad('0x7a')]=_0x44ad1b[_0x52ad('0x5c')]['Smtp'][_0x52ad('0x7a')];}else{_0x1187c0['Imap'][_0x52ad('0x7b')]=_0x1187c0[_0x52ad('0x58')][_0x52ad('0x7b')]=_0x44ad1b[_0x52ad('0x5c')][_0x52ad('0x71')];_0x1187c0[_0x52ad('0x3c')][_0x52ad('0x73')]=_0x1187c0[_0x52ad('0x58')][_0x52ad('0x73')]=_0x44ad1b[_0x52ad('0x5c')]['cuser'];_0x1187c0[_0x52ad('0x3c')][_0x52ad('0x75')]=_0x1187c0['Smtp']['pass']=_0x44ad1b[_0x52ad('0x5c')][_0x52ad('0x77')];}return db[_0x52ad('0x40')][_0x52ad('0x65')](_0x1187c0,{'include':[{'model':db[_0x52ad('0x3d')],'as':_0x52ad('0x58')},{'model':db[_0x52ad('0x3b')],'as':_0x52ad('0x3c')}]})['then'](function(_0xe24788){var _0x50c44a=_0x44ad1b[_0x52ad('0x73')][_0x52ad('0x7c')]({'plain':!![]});if(!_0x50c44a)throw new Error(_0x52ad('0x7d'));if(_0x50c44a['role']===_0x52ad('0x73')){var _0x52f80b=_0xe24788[_0x52ad('0x7c')]({'plain':!![]});return db[_0x52ad('0x7e')]['find']({'where':{'name':'MailAccounts','userProfileId':_0x50c44a[_0x52ad('0x7f')]},'raw':!![]})[_0x52ad('0x20')](function(_0x3d3504){if(_0x3d3504&&_0x3d3504[_0x52ad('0x80')]===0x0){return db['UserProfileResource'][_0x52ad('0x65')]({'name':_0x52f80b['name'],'resourceId':_0x52f80b['id'],'type':_0x3d3504[_0x52ad('0x38')],'sectionId':_0x3d3504['id']},{})[_0x52ad('0x20')](function(){return _0xe24788;});}else{return _0xe24788;}})[_0x52ad('0x27')](function(_0x4638de){logger[_0x52ad('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4638de);throw _0x4638de;});}return _0xe24788;})[_0x52ad('0x20')](respondWithResult(_0x5d0906,0xc9))[_0x52ad('0x27')](handleError(_0x5d0906,null));};exports['getImap']=function(_0x2a3218,_0x2340c4,_0x338691){return db[_0x52ad('0x40')]['findOne']({'where':{'id':_0x2a3218['params']['id']}})[_0x52ad('0x20')](handleEntityNotFound(_0x2340c4,null))[_0x52ad('0x20')](function(_0x214af6){if(_0x214af6){return _0x214af6['getImap']();}return null;})[_0x52ad('0x20')](respondWithResult(_0x2340c4,null))[_0x52ad('0x27')](handleError(_0x2340c4,null));};exports[_0x52ad('0x81')]=function(_0x394120,_0x2b1e51,_0x56633c){if(_0x394120['body']['id']){delete _0x394120[_0x52ad('0x5c')]['id'];}return db[_0x52ad('0x40')][_0x52ad('0x5b')]({'where':{'id':_0x394120[_0x52ad('0x57')]['id']}})[_0x52ad('0x20')](handleEntityNotFound(_0x2b1e51,null))[_0x52ad('0x20')](function(_0x3edcb8){if(_0x3edcb8){_0x394120[_0x52ad('0x5c')][_0x52ad('0x5e')]=_0x3edcb8['id'];return db[_0x52ad('0x3b')][_0x52ad('0x65')](_0x394120[_0x52ad('0x5c')]);}})[_0x52ad('0x20')](respondWithResult(_0x2b1e51,null))[_0x52ad('0x27')](handleError(_0x2b1e51,null));};exports[_0x52ad('0x82')]=function(_0x10992c,_0x4334f2,_0x14b82e){return db['MailAccount'][_0x52ad('0x61')]({'where':{'id':_0x10992c[_0x52ad('0x57')]['id']}})[_0x52ad('0x20')](handleEntityNotFound(_0x4334f2,null))['then'](function(_0x41cbc2){if(_0x41cbc2){return _0x41cbc2[_0x52ad('0x83')](null);}return null;})['then'](respondWithStatusCode(_0x4334f2,null))[_0x52ad('0x27')](handleError(_0x4334f2,null));};exports[_0x52ad('0x84')]=function(_0x4059f6,_0x25458a,_0x49ce31){return db['MailAccount']['findOne']({'where':{'id':_0x4059f6[_0x52ad('0x57')]['id']}})['then'](handleEntityNotFound(_0x25458a,null))[_0x52ad('0x20')](function(_0x3b776d){if(_0x3b776d){return _0x3b776d[_0x52ad('0x84')]();}return null;})[_0x52ad('0x20')](respondWithResult(_0x25458a,null))[_0x52ad('0x27')](handleError(_0x25458a,null));};exports[_0x52ad('0x85')]=function(_0x38fbd2,_0x4ed99a,_0x4e5193){if(_0x38fbd2[_0x52ad('0x5c')]['id']){delete _0x38fbd2[_0x52ad('0x5c')]['id'];}return db['MailAccount'][_0x52ad('0x5b')]({'where':{'id':_0x38fbd2['params']['id']}})[_0x52ad('0x20')](handleEntityNotFound(_0x4ed99a,null))[_0x52ad('0x20')](function(_0x30bd45){if(_0x30bd45){_0x38fbd2[_0x52ad('0x5c')][_0x52ad('0x5e')]=_0x30bd45['id'];return db[_0x52ad('0x3d')][_0x52ad('0x65')](_0x38fbd2[_0x52ad('0x5c')]);}})[_0x52ad('0x20')](respondWithResult(_0x4ed99a,null))[_0x52ad('0x27')](handleError(_0x4ed99a,null));};exports['removeSmtp']=function(_0x53d33e,_0x57c2f8,_0x3e3924){return db['MailAccount']['findOne']({'where':{'id':_0x53d33e[_0x52ad('0x57')]['id']}})[_0x52ad('0x20')](handleEntityNotFound(_0x57c2f8,null))['then'](function(_0x4ddca0){if(_0x4ddca0){return _0x4ddca0['setSmtp'](null);}return null;})[_0x52ad('0x20')](respondWithStatusCode(_0x57c2f8,null))[_0x52ad('0x27')](handleError(_0x57c2f8,null));};exports[_0x52ad('0x86')]=function(_0x1e0b9c,_0x22d17a,_0x326408){return db[_0x52ad('0x87')][_0x52ad('0x5b')]({'where':{'id':_0x1e0b9c[_0x52ad('0x57')]['id']}})['then'](handleEntityNotFound(_0x22d17a,null))['then'](function(_0x5b2e87){if(_0x5b2e87){return _0x5b2e87[_0x52ad('0x86')](_0x1e0b9c[_0x52ad('0x5c')][_0x52ad('0x6b')],_['omit'](_0x1e0b9c[_0x52ad('0x5c')],[_0x52ad('0x6b'),'id'])||{});}})['then'](respondWithResult(_0x22d17a,null))[_0x52ad('0x27')](handleError(_0x22d17a,null));};exports[_0x52ad('0x88')]=function(_0x3bcc9c,_0x4e2b55,_0x1f508d){var _0xb94267={'raw':![],'where':{}};var _0x477b26={};var _0x594714={'count':0x0,'rows':[]};return db['MailAccount'][_0x52ad('0x61')]({'where':{'id':_0x3bcc9c[_0x52ad('0x57')]['id']}})[_0x52ad('0x20')](handleEntityNotFound(_0x4e2b55,null))[_0x52ad('0x20')](function(_0x5f1ec3){if(_0x5f1ec3){_0x477b26[_0x52ad('0x45')]=_[_0x52ad('0x47')](db[_0x52ad('0x87')][_0x52ad('0x41')]);_0x477b26[_0x52ad('0x46')]=_[_0x52ad('0x47')](_0x3bcc9c[_0x52ad('0x46')]);_0x477b26[_0x52ad('0x4f')]=_[_0x52ad('0x49')](_0x477b26[_0x52ad('0x45')],_0x477b26[_0x52ad('0x46')]);_0xb94267[_0x52ad('0x48')]=_[_0x52ad('0x49')](_0x477b26['model'],qs[_0x52ad('0x4a')](_0x3bcc9c[_0x52ad('0x46')][_0x52ad('0x4a')]));_0xb94267[_0x52ad('0x48')]=_0xb94267[_0x52ad('0x48')][_0x52ad('0x5a')]?_0xb94267['attributes']:_0x477b26['model'];if(!_0x3bcc9c['query'][_0x52ad('0x62')](_0x52ad('0x4b'))){_0xb94267[_0x52ad('0x2b')]=qs[_0x52ad('0x2b')](_0x3bcc9c[_0x52ad('0x46')]['limit']);_0xb94267['offset']=qs[_0x52ad('0x2a')](_0x3bcc9c[_0x52ad('0x46')][_0x52ad('0x2a')]);}_0xb94267['order']=qs[_0x52ad('0x4d')](_0x3bcc9c['query'][_0x52ad('0x4d')]);_0xb94267[_0x52ad('0x4e')]=qs[_0x52ad('0x4f')](_[_0x52ad('0x68')](_0x3bcc9c[_0x52ad('0x46')],_0x477b26['filters']));_0xb94267[_0x52ad('0x4e')]['MailAccountId']=_0x5f1ec3['id'];if(_0x3bcc9c[_0x52ad('0x46')][_0x52ad('0x52')]){_0xb94267[_0x52ad('0x4e')]=_[_0x52ad('0x50')](_0xb94267[_0x52ad('0x4e')],{'$or':_['map'](_0xb94267[_0x52ad('0x48')],function(_0x4a96a4){var _0x16e012={};_0x16e012[_0x4a96a4]={'$like':'%'+_0x3bcc9c[_0x52ad('0x46')]['filter']+'%'};return _0x16e012;})});}_0xb94267=_[_0x52ad('0x50')]({},_0xb94267,_0x3bcc9c[_0x52ad('0x53')]);return db[_0x52ad('0x87')][_0x52ad('0x2d')]({'where':_0xb94267[_0x52ad('0x4e')]})[_0x52ad('0x20')](function(_0x664bc7){_0x594714['count']=_0x664bc7;if(_0x3bcc9c[_0x52ad('0x46')]['includeAll']){_0xb94267[_0x52ad('0x55')]=[{'model':db[_0x52ad('0x89')],'as':_0x52ad('0x8a'),'required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0x52ad('0x8b'),_0x52ad('0x8c')],'required':![]},{'model':db[_0x52ad('0x8d')],'as':_0x52ad('0x8e'),'attributes':['id','name',_0x52ad('0x8f')],'where':_0x3bcc9c['query'][_0x52ad('0x90')]?{'id':_0x3bcc9c[_0x52ad('0x46')]['tag']}:undefined,'required':_0x3bcc9c[_0x52ad('0x46')][_0x52ad('0x90')]?!![]:![]}];}return db['MailInteraction'][_0x52ad('0x56')](_0xb94267);})[_0x52ad('0x20')](function(_0x6293){_0x594714[_0x52ad('0x69')]=_0x6293;return _0x594714;});}})[_0x52ad('0x20')](respondWithFilteredResult(_0x4e2b55,_0xb94267))[_0x52ad('0x27')](handleError(_0x4e2b55,null));};exports[_0x52ad('0x91')]=function addApplications(_0x515581,_0x3f07d1){var _0x4331f6=_0x515581[_0x52ad('0x57')]['id'];var _0x39283e=_0x515581[_0x52ad('0x5c')];var _0x10ea37=0xc8;var _0x4a8ff6=null;return db[_0x52ad('0x92')][_0x52ad('0x93')]({'isolationLevel':db[_0x52ad('0x92')][_0x52ad('0x94')][_0x52ad('0x95')][_0x52ad('0x96')]},function(_0x3bb4c3){return db[_0x52ad('0x40')][_0x52ad('0x61')]({'where':{'id':_0x4331f6},'transaction':_0x3bb4c3})[_0x52ad('0x20')](function(_0x254a06){if(_0x254a06){return db[_0x52ad('0x97')][_0x52ad('0x34')]({'where':{'MailAccountId':_0x4331f6},'transaction':_0x3bb4c3})[_0x52ad('0x20')](function(){var _0x3037da=_['map'](_0x39283e,function(_0x44adf2){_0x44adf2[_0x52ad('0x5e')]=_0x4331f6;return _0x44adf2;});return db[_0x52ad('0x97')][_0x52ad('0x98')](_0x3037da,{'transaction':_0x3bb4c3});});}else{_0x10ea37=0x194;_0x4a8ff6=[];}});})[_0x52ad('0x20')](function(){if(_0x10ea37!==0x194){return db[_0x52ad('0x97')][_0x52ad('0x99')]({'where':{'MailAccountId':_0x4331f6},'order':'priority'})[_0x52ad('0x20')](function(_0x589ee6){_0x4a8ff6=_0x589ee6;});}})[_0x52ad('0x27')](function(_0x4df84b){_0x10ea37=0x1f4;logger[_0x52ad('0x24')](_0x4df84b['stack']);if(_0x4df84b[_0x52ad('0x38')]){delete _0x4df84b['name'];}_0x4a8ff6=_0x4df84b;})[_0x52ad('0x9a')](function(){if(_0x4a8ff6===null){_0x3f07d1['sendStatus'](_0x10ea37);}else{if(_0x10ea37===0x1f4){_0x3f07d1[_0x52ad('0x2e')](_0x10ea37)[_0x52ad('0x39')](_0x4a8ff6);}else{_0x3f07d1[_0x52ad('0x2e')](_0x10ea37)[_0x52ad('0x30')](_0x4a8ff6);}}});};exports[_0x52ad('0x9b')]=function(_0x11282c,_0x1050bb,_0x3de08a){var _0x7aa4ee={};var _0x2c80ac={};var _0x5ea35a;var _0x378a7e;return db['MailAccount'][_0x52ad('0x61')]({'where':{'id':_0x11282c[_0x52ad('0x57')]['id']}})[_0x52ad('0x20')](handleEntityNotFound(_0x1050bb,null))[_0x52ad('0x20')](function(_0x2a8e0a){if(_0x2a8e0a){_0x5ea35a=_0x2a8e0a;_0x2c80ac[_0x52ad('0x45')]=_[_0x52ad('0x47')](db[_0x52ad('0x97')][_0x52ad('0x41')]);_0x2c80ac[_0x52ad('0x46')]=_[_0x52ad('0x47')](_0x11282c[_0x52ad('0x46')]);_0x2c80ac[_0x52ad('0x4f')]=_['intersection'](_0x2c80ac[_0x52ad('0x45')],_0x2c80ac[_0x52ad('0x46')]);_0x7aa4ee[_0x52ad('0x48')]=_[_0x52ad('0x49')](_0x2c80ac[_0x52ad('0x45')],qs[_0x52ad('0x4a')](_0x11282c['query']['fields']));_0x7aa4ee['attributes']=_0x7aa4ee[_0x52ad('0x48')][_0x52ad('0x5a')]?_0x7aa4ee[_0x52ad('0x48')]:_0x2c80ac[_0x52ad('0x45')];_0x7aa4ee[_0x52ad('0x4c')]=qs[_0x52ad('0x4d')](_0x11282c[_0x52ad('0x46')][_0x52ad('0x4d')]);_0x7aa4ee['where']=qs[_0x52ad('0x4f')](_[_0x52ad('0x68')](_0x11282c['query'],_0x2c80ac[_0x52ad('0x4f')]));if(_0x11282c[_0x52ad('0x46')]['filter']){_0x7aa4ee[_0x52ad('0x4e')]=_[_0x52ad('0x50')](_0x7aa4ee[_0x52ad('0x4e')],{'$or':_[_0x52ad('0x3f')](_0x7aa4ee[_0x52ad('0x48')],function(_0x3442da){var _0x2e995b={};_0x2e995b[_0x3442da]={'$like':'%'+_0x11282c[_0x52ad('0x46')][_0x52ad('0x52')]+'%'};return _0x2e995b;})});}_0x7aa4ee=_['merge']({},_0x7aa4ee,_0x11282c[_0x52ad('0x53')]);return _0x5ea35a[_0x52ad('0x9b')](_0x7aa4ee);}})['then'](function(_0x4cea50){if(_0x4cea50){_0x378a7e=_0x4cea50[_0x52ad('0x5a')];if(!_0x11282c[_0x52ad('0x46')]['hasOwnProperty']('nolimit')){_0x7aa4ee[_0x52ad('0x2b')]=qs[_0x52ad('0x2b')](_0x11282c[_0x52ad('0x46')][_0x52ad('0x2b')]);_0x7aa4ee[_0x52ad('0x2a')]=qs[_0x52ad('0x2a')](_0x11282c[_0x52ad('0x46')][_0x52ad('0x2a')]);}return _0x5ea35a[_0x52ad('0x9b')](_0x7aa4ee);}})[_0x52ad('0x20')](function(_0x53e81c){if(_0x53e81c){return _0x53e81c?{'count':_0x378a7e,'rows':_0x53e81c}:null;}})[_0x52ad('0x20')](respondWithResult(_0x1050bb,null))[_0x52ad('0x27')](handleError(_0x1050bb,null));};exports[_0x52ad('0x9c')]=function(_0x2865cb,_0x3884e1,_0x2b3578){var _0x2d2410={'raw':!![],'where':{}};var _0x5dbe6a={};var _0x11e125={'count':0x0,'rows':[]};return db[_0x52ad('0x40')][_0x52ad('0x61')]({'where':{'id':_0x2865cb[_0x52ad('0x57')]['id']}})[_0x52ad('0x20')](handleEntityNotFound(_0x3884e1,null))['then'](function(_0x1efd7e){if(_0x1efd7e){_0x5dbe6a[_0x52ad('0x45')]=_[_0x52ad('0x47')](db[_0x52ad('0x9d')]['rawAttributes']);_0x5dbe6a[_0x52ad('0x46')]=_[_0x52ad('0x47')](_0x2865cb[_0x52ad('0x46')]);_0x5dbe6a[_0x52ad('0x4f')]=_[_0x52ad('0x49')](_0x5dbe6a[_0x52ad('0x45')],_0x5dbe6a['query']);_0x2d2410[_0x52ad('0x48')]=_[_0x52ad('0x49')](_0x5dbe6a[_0x52ad('0x45')],qs[_0x52ad('0x4a')](_0x2865cb['query'][_0x52ad('0x4a')]));_0x2d2410[_0x52ad('0x48')]=_0x2d2410[_0x52ad('0x48')]['length']?_0x2d2410['attributes']:_0x5dbe6a['model'];if(!_0x2865cb[_0x52ad('0x46')][_0x52ad('0x62')]('nolimit')){_0x2d2410[_0x52ad('0x2b')]=qs[_0x52ad('0x2b')](_0x2865cb['query']['limit']);_0x2d2410[_0x52ad('0x2a')]=qs[_0x52ad('0x2a')](_0x2865cb['query']['offset']);}_0x2d2410[_0x52ad('0x4c')]=qs[_0x52ad('0x4d')](_0x2865cb['query'][_0x52ad('0x4d')]);_0x2d2410[_0x52ad('0x4e')]=qs[_0x52ad('0x4f')](_[_0x52ad('0x68')](_0x2865cb[_0x52ad('0x46')],_0x5dbe6a[_0x52ad('0x4f')]));_0x2d2410[_0x52ad('0x4e')][_0x52ad('0x5e')]=_0x1efd7e['id'];if(_0x2865cb[_0x52ad('0x46')]['filter']){_0x2d2410[_0x52ad('0x4e')]=_[_0x52ad('0x50')](_0x2d2410[_0x52ad('0x4e')],{'$or':_[_0x52ad('0x3f')](_0x2d2410[_0x52ad('0x48')],function(_0x20bfc2){var _0x642133={};_0x642133[_0x20bfc2]={'$like':'%'+_0x2865cb[_0x52ad('0x46')][_0x52ad('0x52')]+'%'};return _0x642133;})});}if(_0x2865cb[_0x52ad('0x46')][_0x52ad('0x9e')]){var _0x2ad781=_0x2865cb[_0x52ad('0x46')][_0x52ad('0x9e')][_0x52ad('0x9f')](',');var _0xdd477f={};_0xdd477f[_0x2ad781[0x0]]={'$gte':moment(_0x2ad781[0x1])[_0x52ad('0xa0')](_0x52ad('0xa1'))};_0x2d2410[_0x52ad('0x4e')]=_[_0x52ad('0x50')](_0x2d2410[_0x52ad('0x4e')],_0xdd477f);}_0x2d2410=_['merge']({},_0x2d2410,_0x2865cb[_0x52ad('0x53')]);return db[_0x52ad('0x9d')][_0x52ad('0x2d')]({'where':_0x2d2410[_0x52ad('0x4e')]})[_0x52ad('0x20')](function(_0x35f3b8){_0x11e125[_0x52ad('0x2d')]=_0x35f3b8;if(_0x2865cb[_0x52ad('0x46')][_0x52ad('0x54')]){_0x2d2410[_0x52ad('0x55')]=[{'all':!![]}];}return db[_0x52ad('0x9d')][_0x52ad('0x56')](_0x2d2410);})[_0x52ad('0x20')](function(_0x16ed31){if(_0x2865cb['query'][_0x52ad('0xa2')]===_0x52ad('0xa3')){for(var _0x2c0d09=0x0;_0x2c0d09<_0x16ed31[_0x52ad('0x5a')];_0x2c0d09++){_0x16ed31[_0x2c0d09][_0x52ad('0x5c')]=juice(_0x16ed31[_0x2c0d09]['body']);}}_0x11e125['rows']=_0x16ed31;return _0x11e125;});}})[_0x52ad('0x20')](respondWithFilteredResult(_0x3884e1,_0x2d2410))[_0x52ad('0x27')](handleError(_0x3884e1,null));};exports[_0x52ad('0x39')]=function(_0x50eb97,_0x5f4b90,_0x403c67){var _0x6bad13,_0x2f1acd={},_0xb49834;if(_0x50eb97['body']['to']){_0xb49834=_0x50eb97['body']['to'][_0x52ad('0x9f')](',')[0x0];}return db[_0x52ad('0x40')][_0x52ad('0x5b')]({'where':{'id':_0x50eb97[_0x52ad('0x57')]['id']},'include':[{'model':db[_0x52ad('0xa4')],'as':_0x52ad('0xa5'),'include':[{'model':db[_0x52ad('0x89')],'as':'Contacts','where':{'email':_0xb49834},'limit':0x1,'order':[[_0x52ad('0xa6'),_0x52ad('0xa7')]]}]},{'model':db[_0x52ad('0x3d')],'as':_0x52ad('0x58'),'raw':!![]}]})[_0x52ad('0x20')](handleEntityNotFound(_0x5f4b90,null))['then'](function(_0x464cc4){if(_0x464cc4){_0x6bad13=_0x464cc4;if(_0x464cc4['Smtp']){if(_[_0x52ad('0x6e')](_0x50eb97[_0x52ad('0x5c')][_0x52ad('0xa8')])){_0x50eb97[_0x52ad('0x5c')][_0x52ad('0xa8')]=util[_0x52ad('0xa0')]('%s\x20<%s>',_0x464cc4['name'],_0x464cc4[_0x52ad('0x6c')]||_0x464cc4['Smtp'][_0x52ad('0x73')]);}if(_0x50eb97[_0x52ad('0x5c')][_0x52ad('0xa9')]&&_0x50eb97['body'][_0x52ad('0xa9')][_0x52ad('0x5a')]){for(var _0x142648=0x0;_0x142648<_0x50eb97[_0x52ad('0x5c')][_0x52ad('0xa9')][_0x52ad('0x5a')];_0x142648+=0x1){_0x50eb97[_0x52ad('0x5c')][_0x52ad('0xa9')][_0x142648]={'filename':_0x50eb97['body'][_0x52ad('0xa9')][_0x142648]['name'],'path':path['join'](config[_0x52ad('0xaa')],_0x52ad('0xab'),_0x50eb97[_0x52ad('0x5c')]['attachments'][_0x142648]['basename'])};}}var _0x321cf4={'tls':{'rejectUnauthorized':![]}};if(_[_0x52ad('0x6e')](_0x464cc4[_0x52ad('0x58')][_0x52ad('0x7b')])){if(_0x464cc4[_0x52ad('0x58')]['authentication']){_0x321cf4['auth']={'user':_0x464cc4[_0x52ad('0x58')][_0x52ad('0x73')],'pass':_0x464cc4['Smtp'][_0x52ad('0x76')]};}_0x321cf4['host']=_0x464cc4[_0x52ad('0x58')][_0x52ad('0x79')];_0x321cf4[_0x52ad('0x7a')]=_0x464cc4[_0x52ad('0x58')][_0x52ad('0x7a')];_0x321cf4['secure']=_0x464cc4[_0x52ad('0x58')][_0x52ad('0xac')];}else{_0x321cf4['service']=_0x464cc4[_0x52ad('0x58')][_0x52ad('0x7b')];_0x321cf4[_0x52ad('0xad')]={'user':_0x464cc4[_0x52ad('0x58')][_0x52ad('0x73')],'pass':_0x464cc4[_0x52ad('0x58')][_0x52ad('0x76')]};}return respondWithRpcPromise(_0x52ad('0xae'),_0x52ad('0xaf'),{'account':_0x321cf4,'message':_0x50eb97[_0x52ad('0x5c')]});}else{throw new Error(_0x52ad('0xb0'));}}})['then'](function(_0x292ab8){if(_0x292ab8){_0x2f1acd=_0x292ab8;if(_0x6bad13[_0x52ad('0xa5')]){if(_0x6bad13[_0x52ad('0xa5')][_0x52ad('0xb1')][_0x52ad('0x5a')]){return _0x6bad13[_0x52ad('0xa5')][_0x52ad('0xb1')][0x0];}else{return db[_0x52ad('0x89')][_0x52ad('0x65')](_[_0x52ad('0xb2')](_0x50eb97[_0x52ad('0x5c')],{'firstName':_0x50eb97[_0x52ad('0x5c')]['to'],'email':_0x50eb97[_0x52ad('0x5c')]['to'],'phone':_0x50eb97['body']['to'],'ListId':_0x6bad13[_0x52ad('0x6d')]}));}}else{throw new Error(_0x52ad('0xb0'));}}})['then'](function(_0x50ae2e){if(_0x50ae2e){var _0xfb97f4={'UserId':_0x50eb97[_0x52ad('0x73')]['id'],'ContactId':_0x50ae2e['id'],'MailAccountId':_0x6bad13['id'],'inReplyTo':_0x2f1acd[_0x52ad('0xb3')],'to':_0x50eb97[_0x52ad('0x5c')][_0x52ad('0xa8')],'cc':_0x50eb97['body']['cc'],'subject':_0x50eb97['body'][_0x52ad('0xb4')],'attach':_0x50eb97[_0x52ad('0x5c')]['attach'],'firstMsgDirection':_0x52ad('0xb5'),'lastMsgAt':moment()[_0x52ad('0xa0')](_0x52ad('0xa1')),'lastMsgDirection':_0x52ad('0xb5'),'Messages':[_[_0x52ad('0x50')](_0x50eb97[_0x52ad('0x5c')],{'messageId':_0x2f1acd[_0x52ad('0xb3')],'sentAt':moment()[_0x52ad('0xa0')](_0x52ad('0xa1')),'read':!![],'MailAccountId':_0x6bad13['id'],'UserId':_0x50eb97['user']['id'],'ContactId':_0x50ae2e['id']})]};if(_0x50eb97[_0x52ad('0x5c')]['Interaction']){_0xfb97f4=_[_0x52ad('0x50')](_0xfb97f4,_0x50eb97[_0x52ad('0x5c')][_0x52ad('0xb6')]);}return db[_0x52ad('0x87')][_0x52ad('0x65')](_0xfb97f4,{'include':[{'model':db['MailMessage'],'as':_0x52ad('0xb7')}]});}})[_0x52ad('0x20')](respondWithResult(_0x5f4b90,null))[_0x52ad('0x27')](handleError(_0x5f4b90,null));};exports['verifySmtp']=function(_0xd1cb53,_0x494179,_0x39606){return db['MailAccount'][_0x52ad('0x5b')]({'where':{'id':_0xd1cb53['params']['id']},'include':[{'model':db[_0x52ad('0x3d')],'as':'Smtp','raw':!![]}]})[_0x52ad('0x20')](handleEntityNotFound(_0x494179,null))['then'](function(_0x15d636){if(_0x15d636&&_0x15d636[_0x52ad('0x58')]){var _0x1572d2={'id':_0x15d636['id'],'tls':{'rejectUnauthorized':![]}};if(_0x15d636['Smtp'][_0x52ad('0x7b')]){_0x1572d2[_0x52ad('0x7b')]=_0x15d636[_0x52ad('0x58')][_0x52ad('0x7b')];}else{_0x1572d2['host']=_0x15d636[_0x52ad('0x58')][_0x52ad('0x79')];_0x1572d2[_0x52ad('0x7a')]=_0x15d636[_0x52ad('0x58')][_0x52ad('0x7a')];_0x1572d2['secure']=_0x15d636[_0x52ad('0x58')][_0x52ad('0xac')];}if(_0x15d636[_0x52ad('0x58')]['authentication']){_0x1572d2[_0x52ad('0xad')]={'user':_0x15d636[_0x52ad('0x58')]['user'],'pass':_0x15d636[_0x52ad('0x58')][_0x52ad('0x76')]};}return respondWithRpcPromise(_0x52ad('0xb8'),'verifySmtp',{'account':_0x1572d2});}})[_0x52ad('0x20')](respondWithResult(_0x494179,null))[_0x52ad('0x27')](handleError(_0x494179,null));};exports[_0x52ad('0x34')]=function(_0x3f9999,_0x3edcf6){return db[_0x52ad('0x40')][_0x52ad('0x5b')]({'where':{'id':_0x3f9999[_0x52ad('0x57')]['id']}})[_0x52ad('0x20')](handleEntityNotFound(_0x3edcf6,null))[_0x52ad('0x20')](function(_0xebef0c){if(_0xebef0c&&_0xebef0c['service']){throw new db[(_0x52ad('0xb9'))][(_0x52ad('0xba'))](_0x52ad('0xbb'));}return _0xebef0c;})['then'](removeEntity(_0x3edcf6,null))[_0x52ad('0x27')](handleError(_0x3edcf6,null));};exports['addAgents']=function(_0x8cd73f,_0x1cc51d,_0x2def14){return db[_0x52ad('0x40')]['find']({'where':{'id':_0x8cd73f['params']['id']}})[_0x52ad('0x20')](handleEntityNotFound(_0x1cc51d,null))[_0x52ad('0x20')](function(_0x20952f){if(_0x20952f){return _0x20952f[_0x52ad('0xbc')](_0x8cd73f[_0x52ad('0x5c')][_0x52ad('0x6b')],_['omit'](_0x8cd73f[_0x52ad('0x5c')],['ids','id'])||{})['spread'](function(_0xf495d6){for(var _0x8d8f79=0x0;_0x8d8f79<_0x8cd73f['body'][_0x52ad('0x6b')][_0x52ad('0x5a')];_0x8d8f79+=0x1){socket['emit'](_0x52ad('0xbd'),{'UserId':Number(_0x8cd73f[_0x52ad('0x5c')][_0x52ad('0x6b')][_0x8d8f79]),'MailAccountId':Number(_0x8cd73f[_0x52ad('0x57')]['id'])});}return _0xf495d6;});}})[_0x52ad('0x20')](respondWithResult(_0x1cc51d,null))['catch'](handleError(_0x1cc51d,null));};exports[_0x52ad('0xbe')]=function(_0xce153c,_0xbab368,_0x252a15){return db['MailAccount'][_0x52ad('0x5b')]({'where':{'id':_0xce153c[_0x52ad('0x57')]['id']}})[_0x52ad('0x20')](handleEntityNotFound(_0xbab368,null))['then'](function(_0x517a67){if(_0x517a67){return _0x517a67[_0x52ad('0xbe')](_0xce153c['query'][_0x52ad('0x6b')])[_0x52ad('0x20')](function(){if(_[_0x52ad('0xbf')](_0xce153c[_0x52ad('0x46')][_0x52ad('0x6b')])){for(var _0x57253d=0x0;_0x57253d<_0xce153c[_0x52ad('0x46')]['ids'][_0x52ad('0x5a')];_0x57253d+=0x1){socket[_0x52ad('0xc0')]('userMailAccount:remove',{'UserId':Number(_0xce153c['query'][_0x52ad('0x6b')][_0x57253d]),'MailAccountId':Number(_0xce153c['params']['id'])});}}else{socket[_0x52ad('0xc0')](_0x52ad('0xc1'),{'UserId':Number(_0xce153c[_0x52ad('0x46')]['ids']),'MailAccountId':Number(_0xce153c[_0x52ad('0x57')]['id'])});}});}})[_0x52ad('0x20')](respondWithStatusCode(_0xbab368,null))[_0x52ad('0x27')](handleError(_0xbab368,null));};exports['getAgents']=function(_0x5e7480,_0x776863,_0x354292){var _0x7b9835={};var _0x3231ea={};var _0x9ffcd;var _0x1ff4f1;return db[_0x52ad('0x40')][_0x52ad('0x61')]({'where':{'id':_0x5e7480[_0x52ad('0x57')]['id']}})[_0x52ad('0x20')](handleEntityNotFound(_0x776863,null))[_0x52ad('0x20')](function(_0x484031){if(_0x484031){_0x9ffcd=_0x484031;_0x3231ea[_0x52ad('0x45')]=_[_0x52ad('0x47')](db[_0x52ad('0xc2')]['rawAttributes']);_0x3231ea[_0x52ad('0x46')]=_[_0x52ad('0x47')](_0x5e7480[_0x52ad('0x46')]);_0x3231ea[_0x52ad('0x4f')]=_[_0x52ad('0x49')](_0x3231ea[_0x52ad('0x45')],_0x3231ea[_0x52ad('0x46')]);_0x7b9835[_0x52ad('0x48')]=_[_0x52ad('0x49')](_0x3231ea[_0x52ad('0x45')],qs['fields'](_0x5e7480[_0x52ad('0x46')][_0x52ad('0x4a')]));_0x7b9835[_0x52ad('0x48')]=_0x7b9835[_0x52ad('0x48')][_0x52ad('0x5a')]?_0x7b9835[_0x52ad('0x48')]:_0x3231ea[_0x52ad('0x45')];_0x7b9835['order']=qs['sort'](_0x5e7480[_0x52ad('0x46')][_0x52ad('0x4d')]);_0x7b9835['where']=qs[_0x52ad('0x4f')](_[_0x52ad('0x68')](_0x5e7480[_0x52ad('0x46')],_0x3231ea[_0x52ad('0x4f')]));if(_0x5e7480[_0x52ad('0x46')][_0x52ad('0x52')]){_0x7b9835[_0x52ad('0x4e')]=_['merge'](_0x7b9835[_0x52ad('0x4e')],{'$or':_[_0x52ad('0x3f')](_0x7b9835[_0x52ad('0x48')],function(_0x1620c0){var _0x34b8c6={};_0x34b8c6[_0x1620c0]={'$like':'%'+_0x5e7480['query'][_0x52ad('0x52')]+'%'};return _0x34b8c6;})});}_0x7b9835=_[_0x52ad('0x50')]({},_0x7b9835,_0x5e7480['options']);return _0x9ffcd[_0x52ad('0xc3')](_0x7b9835);}})['then'](function(_0x2f92c7){if(_0x2f92c7){_0x1ff4f1=_0x2f92c7[_0x52ad('0x5a')];if(!_0x5e7480[_0x52ad('0x46')][_0x52ad('0x62')](_0x52ad('0x4b'))){_0x7b9835['limit']=qs['limit'](_0x5e7480[_0x52ad('0x46')][_0x52ad('0x2b')]);_0x7b9835[_0x52ad('0x2a')]=qs[_0x52ad('0x2a')](_0x5e7480[_0x52ad('0x46')][_0x52ad('0x2a')]);}return _0x9ffcd['getAgents'](_0x7b9835);}})[_0x52ad('0x20')](function(_0x2bdd8e){if(_0x2bdd8e){return _0x2bdd8e?{'count':_0x1ff4f1,'rows':_0x2bdd8e}:null;}})['then'](respondWithResult(_0x776863,null))[_0x52ad('0x27')](handleError(_0x776863,null));}; \ No newline at end of file +var _0xdbae=['MailAccounts','userProfileId','autoAssociation','UserProfileResource','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','color','tag','addApplications','sequelize','transaction','Transaction','MailApplication','bulkCreate','findAndCountAll','finally','getApplications','getMessages','MailMessage','YYYY-MM-DD\x20HH:mm:ss','inlineCss','send','split','CmList','Contacts','updatedAt','DESC','isNil','from','format','%s\x20<%s>','email','attachments','join','root','server/files/attachments','basename','secure','auth','SendMail','sendMail','List\x20not\x20found','List','messageId','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','end','json','offset','count','limit','set','apply','reject','save','update','destroy','get','stack','name','MailServerIn','Imap','MailServerOut','Smtp','mandatoryDispositionPause','map','MailAccount','fieldName','type','key','keys','filters','intersection','model','fields','attributes','length','query','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','rawAttributes','find','body','params','Pause','describe','addDisposition','Disposition','create','getDispositions','findOne','MailAccountId','rows','ids','addAnswer','CannedAnswer','getAnswers','findAll','removeAnswers','ListId','active','cauthentication','user','password','cpassword','authentication','host','port','service','cservice','cuser','pass','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x1855a7,_0x59c2c4){var _0x539b88=function(_0x224d79){while(--_0x224d79){_0x1855a7['push'](_0x1855a7['shift']());}};_0x539b88(++_0x59c2c4);}(_0xdbae,0x116));var _0xedba=function(_0x243f6b,_0x4e8056){_0x243f6b=_0x243f6b-0x0;var _0x366901=_0xdbae[_0x243f6b];return _0x366901;};'use strict';var emlformat=require(_0xedba('0x0'));var rimraf=require(_0xedba('0x1'));var zipdir=require(_0xedba('0x2'));var jsonpatch=require(_0xedba('0x3'));var rp=require(_0xedba('0x4'));var moment=require(_0xedba('0x5'));var BPromise=require(_0xedba('0x6'));var Mustache=require(_0xedba('0x7'));var util=require(_0xedba('0x8'));var path=require(_0xedba('0x9'));var sox=require(_0xedba('0xa'));var csv=require(_0xedba('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xedba('0xc'));var _=require(_0xedba('0xd'));var squel=require(_0xedba('0xe'));var crypto=require(_0xedba('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xedba('0xb'));var querystring=require('querystring');var Papa=require(_0xedba('0x10'));var htmlToText=require(_0xedba('0x11'));var juice=require('juice');var Redis=require(_0xedba('0x12'));var authService=require(_0xedba('0x13'));var qs=require(_0xedba('0x14'));var as=require(_0xedba('0x15'));var hardwareService=require(_0xedba('0x16'));var logger=require(_0xedba('0x17'))(_0xedba('0x18'));var utils=require('../../config/utils');var config=require(_0xedba('0x19'));var licenseUtil=require(_0xedba('0x1a'));var db=require(_0xedba('0x1b'))['db'];config[_0xedba('0x1c')]=_[_0xedba('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xedba('0x1e'))(new Redis(config[_0xedba('0x1c')]));require(_0xedba('0x1f'))[_0xedba('0x20')](socket);var jayson=require(_0xedba('0x21'));var client=jayson[_0xedba('0x22')][_0xedba('0x23')]({'port':0x232b});function respondWithRpcPromise(_0x29131b,_0x17c462,_0x3a6694,_0x561b2d){return new BPromise(function(_0xb858f,_0x38be81){var _0x1081d0=_0x561b2d||client;return _0x1081d0[_0xedba('0x24')](_0x29131b,_0x3a6694)['then'](function(_0x552d48){logger[_0xedba('0x25')](_0xedba('0x26'),_0x17c462,_0xedba('0x27'));logger[_0xedba('0x28')](_0xedba('0x29'),_0x17c462,_0xedba('0x27'),JSON[_0xedba('0x2a')](_0x552d48));if(_0x552d48['error']){if(_0x552d48['error'][_0xedba('0x2b')]===0x1f4){logger[_0xedba('0x2c')](_0xedba('0x26'),_0x17c462,_0x552d48[_0xedba('0x2c')][_0xedba('0x2d')]);return _0x38be81(_0x552d48['error'][_0xedba('0x2d')]);}logger[_0xedba('0x2c')]('MailAccount,\x20%s,\x20%s',_0x17c462,_0x552d48[_0xedba('0x2c')][_0xedba('0x2d')]);return _0xb858f(_0x552d48[_0xedba('0x2c')][_0xedba('0x2d')]);}else{logger[_0xedba('0x25')]('MailAccount,\x20%s,\x20%s',_0x17c462,_0xedba('0x27'));_0xb858f(_0x552d48[_0xedba('0x2e')][_0xedba('0x2d')]);}})[_0xedba('0x2f')](function(_0x4c9ca1){logger[_0xedba('0x2c')]('MailAccount,\x20%s,\x20%s',_0x17c462,_0x4c9ca1);_0x38be81(_0x4c9ca1);});});}function respondWithStatusCode(_0xa0c8e7,_0x52c0e7){_0x52c0e7=_0x52c0e7||0xcc;return function(_0x27e9c1){if(_0x27e9c1){return _0xa0c8e7[_0xedba('0x30')](_0x52c0e7);}return _0xa0c8e7[_0xedba('0x31')](_0x52c0e7)[_0xedba('0x32')]();};}function respondWithResult(_0x32e1fe,_0x10dc89){_0x10dc89=_0x10dc89||0xc8;return function(_0x433716){if(_0x433716){return _0x32e1fe[_0xedba('0x31')](_0x10dc89)[_0xedba('0x33')](_0x433716);}};}function respondWithFilteredResult(_0x3c03fa,_0x385ee1){return function(_0x1808b1){if(_0x1808b1){var _0x3bbc60=typeof _0x385ee1[_0xedba('0x34')]==='undefined'&&typeof _0x385ee1['limit']==='undefined';var _0x4dcb09=_0x1808b1[_0xedba('0x35')];var _0x5023e5=_0x3bbc60?0x0:_0x385ee1[_0xedba('0x34')];var _0x10c761=_0x3bbc60?_0x1808b1['count']:_0x385ee1[_0xedba('0x34')]+_0x385ee1[_0xedba('0x36')];var _0x418be5;if(_0x10c761>=_0x4dcb09){_0x10c761=_0x4dcb09;_0x418be5=0xc8;}else{_0x418be5=0xce;}_0x3c03fa[_0xedba('0x31')](_0x418be5);return _0x3c03fa[_0xedba('0x37')]('Content-Range',_0x5023e5+'-'+_0x10c761+'/'+_0x4dcb09)[_0xedba('0x33')](_0x1808b1);}return null;};}function patchUpdates(_0x248081){return function(_0x381bc8){try{jsonpatch[_0xedba('0x38')](_0x381bc8,_0x248081,!![]);}catch(_0x22f68d){return BPromise[_0xedba('0x39')](_0x22f68d);}return _0x381bc8[_0xedba('0x3a')]();};}function saveUpdates(_0x5d1086,_0xfe1cab){return function(_0x5219d3){if(_0x5219d3){return _0x5219d3[_0xedba('0x3b')](_0x5d1086)['then'](function(_0x3e1735){return _0x3e1735;});}return null;};}function removeEntity(_0x4f43f2,_0x102232){return function(_0x33fb97){if(_0x33fb97){return _0x33fb97[_0xedba('0x3c')]()['then'](function(){var _0x4d0f67=_0x33fb97[_0xedba('0x3d')]({'plain':!![]});var _0x25248f='MailAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x25248f,'resourceId':_0x4d0f67['id']}})['then'](function(){return _0x33fb97;});})['then'](function(){_0x4f43f2[_0xedba('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x424faf,_0x2a6a3b){return function(_0x4a0086){if(!_0x4a0086){_0x424faf[_0xedba('0x30')](0x194);}return _0x4a0086;};}function handleError(_0x5f2450,_0x466f17){_0x466f17=_0x466f17||0x1f4;return function(_0x2f1a65){logger[_0xedba('0x2c')](_0x2f1a65[_0xedba('0x3e')]);if(_0x2f1a65[_0xedba('0x3f')]){delete _0x2f1a65['name'];}_0x5f2450[_0xedba('0x31')](_0x466f17)['send'](_0x2f1a65);};}exports['index']=function(_0x35409e,_0x7c8931){var _0x3a9651={'include':[{'model':db[_0xedba('0x40')],'as':_0xedba('0x41')},{'model':db[_0xedba('0x42')],'as':_0xedba('0x43')},{'model':db['Pause'],'as':_0xedba('0x44')}]},_0x9acf3a={},_0x5b449a={'count':0x0,'rows':[]};var _0x15126=_[_0xedba('0x45')](db[_0xedba('0x46')]['rawAttributes'],function(_0x4eeae4){return{'name':_0x4eeae4[_0xedba('0x47')],'type':_0x4eeae4[_0xedba('0x48')][_0xedba('0x49')]};});_0x9acf3a['model']=_['map'](_0x15126,_0xedba('0x3f'));_0x9acf3a['query']=_[_0xedba('0x4a')](_0x35409e['query']);_0x9acf3a[_0xedba('0x4b')]=_[_0xedba('0x4c')](_0x9acf3a[_0xedba('0x4d')],_0x9acf3a['query']);_0x3a9651['attributes']=_['intersection'](_0x9acf3a['model'],qs[_0xedba('0x4e')](_0x35409e['query'][_0xedba('0x4e')]));_0x3a9651[_0xedba('0x4f')]=_0x3a9651['attributes'][_0xedba('0x50')]?_0x3a9651['attributes']:_0x9acf3a['model'];if(!_0x35409e[_0xedba('0x51')][_0xedba('0x52')](_0xedba('0x53'))){_0x3a9651[_0xedba('0x36')]=qs[_0xedba('0x36')](_0x35409e[_0xedba('0x51')]['limit']);_0x3a9651['offset']=qs['offset'](_0x35409e[_0xedba('0x51')][_0xedba('0x34')]);}_0x3a9651[_0xedba('0x54')]=qs[_0xedba('0x55')](_0x35409e[_0xedba('0x51')]['sort']);_0x3a9651[_0xedba('0x56')]=qs[_0xedba('0x4b')](_[_0xedba('0x57')](_0x35409e['query'],_0x9acf3a['filters']),_0x15126);if(_0x35409e[_0xedba('0x51')][_0xedba('0x58')]){_0x3a9651[_0xedba('0x56')]=_[_0xedba('0x59')](_0x3a9651['where'],{'$or':_[_0xedba('0x45')](_0x15126,function(_0x35f592){if(_0x35f592[_0xedba('0x48')]!==_0xedba('0x5a')){var _0x331b93={};_0x331b93[_0x35f592[_0xedba('0x3f')]]={'$like':'%'+_0x35409e[_0xedba('0x51')][_0xedba('0x58')]+'%'};return _0x331b93;}})});}_0x3a9651=_[_0xedba('0x59')]({},_0x3a9651,_0x35409e[_0xedba('0x5b')]);var _0x12f334={'where':_0x3a9651[_0xedba('0x56')]};return db[_0xedba('0x46')][_0xedba('0x35')](_0x12f334)[_0xedba('0x5c')](function(_0x5002d8){_0x5b449a[_0xedba('0x35')]=_0x5002d8;if(_0x35409e[_0xedba('0x51')][_0xedba('0x5d')]){_0x3a9651[_0xedba('0x5e')]=[{'all':!![]}];}return db[_0xedba('0x46')]['findAll'](_0x3a9651);})[_0xedba('0x5c')](function(_0xc90d57){_0x5b449a['rows']=_0xc90d57;return _0x5b449a;})['then'](respondWithFilteredResult(_0x7c8931,_0x3a9651))[_0xedba('0x2f')](handleError(_0x7c8931,null));};exports['show']=function(_0x4785a0,_0x635c7f){var _0x348aaf={'raw':![],'where':{'id':_0x4785a0['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0xedba('0x41')},{'model':db['MailServerOut'],'as':_0xedba('0x43')},{'model':db['Pause'],'as':_0xedba('0x44')}]},_0x46db0f={};_0x46db0f['model']=_[_0xedba('0x4a')](db[_0xedba('0x46')][_0xedba('0x5f')]);_0x46db0f['query']=_['keys'](_0x4785a0[_0xedba('0x51')]);_0x46db0f[_0xedba('0x4b')]=_[_0xedba('0x4c')](_0x46db0f[_0xedba('0x4d')],_0x46db0f[_0xedba('0x51')]);_0x348aaf[_0xedba('0x4f')]=_[_0xedba('0x4c')](_0x46db0f[_0xedba('0x4d')],qs['fields'](_0x4785a0['query'][_0xedba('0x4e')]));_0x348aaf[_0xedba('0x4f')]=_0x348aaf[_0xedba('0x4f')][_0xedba('0x50')]?_0x348aaf['attributes']:_0x46db0f[_0xedba('0x4d')];if(_0x4785a0[_0xedba('0x51')][_0xedba('0x5d')]){_0x348aaf['include']=[{'all':!![]}];}_0x348aaf=_[_0xedba('0x59')]({},_0x348aaf,_0x4785a0[_0xedba('0x5b')]);return db[_0xedba('0x46')][_0xedba('0x60')](_0x348aaf)[_0xedba('0x5c')](handleEntityNotFound(_0x635c7f,null))['then'](respondWithResult(_0x635c7f,null))['catch'](handleError(_0x635c7f,null));};exports[_0xedba('0x3b')]=function(_0xa01b8,_0x5dbda2){if(_0xa01b8[_0xedba('0x61')]['id']){delete _0xa01b8[_0xedba('0x61')]['id'];}return db['MailAccount'][_0xedba('0x60')]({'where':{'id':_0xa01b8[_0xedba('0x62')]['id']},'include':[{'model':db[_0xedba('0x40')],'as':_0xedba('0x41')},{'model':db[_0xedba('0x42')],'as':_0xedba('0x43')},{'model':db[_0xedba('0x63')],'as':_0xedba('0x44')}]})['then'](handleEntityNotFound(_0x5dbda2,null))[_0xedba('0x5c')](saveUpdates(_0xa01b8['body'],null))[_0xedba('0x5c')](function(_0x425bc2){if(_0x425bc2&&_0xa01b8[_0xedba('0x61')]['Imap']){return db['MailServerIn'][_0xedba('0x3b')](_0xa01b8['body'][_0xedba('0x41')],{'where':{'MailAccountId':_0x425bc2['id']}})[_0xedba('0x5c')](function(){return _0x425bc2;});}return _0x425bc2;})[_0xedba('0x5c')](function(_0x20b98b){if(_0x20b98b&&_0xa01b8['body'][_0xedba('0x43')]){return db[_0xedba('0x42')][_0xedba('0x3b')](_0xa01b8[_0xedba('0x61')][_0xedba('0x43')],{'where':{'MailAccountId':_0x20b98b['id']}})['then'](function(){return _0x20b98b;});}return _0x20b98b;})['then'](respondWithResult(_0x5dbda2,null))['catch'](handleError(_0x5dbda2,null));};exports[_0xedba('0x64')]=function(_0xb9e52e,_0xc4b869){return db[_0xedba('0x46')][_0xedba('0x64')]()['then'](respondWithResult(_0xc4b869,null))[_0xedba('0x2f')](handleError(_0xc4b869,null));};exports[_0xedba('0x65')]=function(_0x13de22,_0x1484e2,_0x285d6c){if(_0x13de22[_0xedba('0x61')]['id']){delete _0x13de22[_0xedba('0x61')]['id'];}return db[_0xedba('0x46')]['find']({'where':{'id':_0x13de22['params']['id']}})[_0xedba('0x5c')](handleEntityNotFound(_0x1484e2,null))[_0xedba('0x5c')](function(_0x238b6e){if(_0x238b6e){_0x13de22[_0xedba('0x61')]['MailAccountId']=_0x238b6e['id'];return db[_0xedba('0x66')][_0xedba('0x67')](_0x13de22[_0xedba('0x61')]);}})[_0xedba('0x5c')](respondWithResult(_0x1484e2,null))[_0xedba('0x2f')](handleError(_0x1484e2,null));};exports[_0xedba('0x68')]=function(_0x98dc68,_0x2312b9,_0xc498fd){var _0x5c708c={'raw':![],'where':{}};var _0x45cd88={};var _0x420f1a={'count':0x0,'rows':[]};return db[_0xedba('0x46')][_0xedba('0x69')]({'where':{'id':_0x98dc68['params']['id']}})[_0xedba('0x5c')](handleEntityNotFound(_0x2312b9,null))[_0xedba('0x5c')](function(_0x4fcea6){if(_0x4fcea6){_0x45cd88[_0xedba('0x4d')]=_[_0xedba('0x4a')](db[_0xedba('0x66')]['rawAttributes']);_0x45cd88[_0xedba('0x51')]=_[_0xedba('0x4a')](_0x98dc68[_0xedba('0x51')]);_0x45cd88[_0xedba('0x4b')]=_[_0xedba('0x4c')](_0x45cd88['model'],_0x45cd88[_0xedba('0x51')]);_0x5c708c[_0xedba('0x4f')]=_['intersection'](_0x45cd88['model'],qs[_0xedba('0x4e')](_0x98dc68[_0xedba('0x51')][_0xedba('0x4e')]));_0x5c708c['attributes']=_0x5c708c['attributes'][_0xedba('0x50')]?_0x5c708c['attributes']:_0x45cd88[_0xedba('0x4d')];if(!_0x98dc68[_0xedba('0x51')][_0xedba('0x52')](_0xedba('0x53'))){_0x5c708c[_0xedba('0x36')]=qs[_0xedba('0x36')](_0x98dc68['query']['limit']);_0x5c708c[_0xedba('0x34')]=qs[_0xedba('0x34')](_0x98dc68[_0xedba('0x51')][_0xedba('0x34')]);}_0x5c708c[_0xedba('0x54')]=qs[_0xedba('0x55')](_0x98dc68[_0xedba('0x51')][_0xedba('0x55')]);_0x5c708c[_0xedba('0x56')]=qs[_0xedba('0x4b')](_[_0xedba('0x57')](_0x98dc68[_0xedba('0x51')],_0x45cd88[_0xedba('0x4b')]));_0x5c708c[_0xedba('0x56')][_0xedba('0x6a')]=_0x4fcea6['id'];if(_0x98dc68[_0xedba('0x51')]['filter']){_0x5c708c[_0xedba('0x56')]=_[_0xedba('0x59')](_0x5c708c[_0xedba('0x56')],{'$or':_['map'](_0x5c708c[_0xedba('0x4f')],function(_0x1da1f3){var _0x4187e1={};_0x4187e1[_0x1da1f3]={'$like':'%'+_0x98dc68[_0xedba('0x51')][_0xedba('0x58')]+'%'};return _0x4187e1;})});}_0x5c708c=_[_0xedba('0x59')]({},_0x5c708c,_0x98dc68[_0xedba('0x5b')]);return db['Disposition'][_0xedba('0x35')]({'where':_0x5c708c[_0xedba('0x56')]})[_0xedba('0x5c')](function(_0x54f89d){_0x420f1a[_0xedba('0x35')]=_0x54f89d;if(_0x98dc68[_0xedba('0x51')]['includeAll']){_0x5c708c[_0xedba('0x5e')]=[{'all':!![]}];}return db[_0xedba('0x66')]['findAll'](_0x5c708c);})[_0xedba('0x5c')](function(_0x48d98d){_0x420f1a[_0xedba('0x6b')]=_0x48d98d;return _0x420f1a;});}})[_0xedba('0x5c')](respondWithFilteredResult(_0x2312b9,_0x5c708c))['catch'](handleError(_0x2312b9,null));};exports['removeDispositions']=function(_0x15645,_0x25a8bd,_0x11665a){return db[_0xedba('0x46')]['find']({'where':{'id':_0x15645['params']['id']}})['then'](handleEntityNotFound(_0x25a8bd,null))[_0xedba('0x5c')](function(_0x5eb4d3){if(_0x5eb4d3){return _0x5eb4d3['removeDispositions'](_0x15645[_0xedba('0x51')][_0xedba('0x6c')]);}})[_0xedba('0x5c')](respondWithStatusCode(_0x25a8bd,null))[_0xedba('0x2f')](handleError(_0x25a8bd,null));};exports[_0xedba('0x6d')]=function(_0x285469,_0x420cec,_0x334103){if(_0x285469[_0xedba('0x61')]['id']){delete _0x285469[_0xedba('0x61')]['id'];}return db[_0xedba('0x46')][_0xedba('0x60')]({'where':{'id':_0x285469[_0xedba('0x62')]['id']}})[_0xedba('0x5c')](handleEntityNotFound(_0x420cec,null))[_0xedba('0x5c')](function(_0x168d9a){if(_0x168d9a){_0x285469[_0xedba('0x61')][_0xedba('0x6a')]=_0x168d9a['id'];return db[_0xedba('0x6e')][_0xedba('0x67')](_0x285469['body']);}})[_0xedba('0x5c')](respondWithResult(_0x420cec,null))[_0xedba('0x2f')](handleError(_0x420cec,null));};exports[_0xedba('0x6f')]=function(_0x6de5a6,_0x2331e7,_0x34e9da){var _0xe9c1f0={'raw':![],'where':{}};var _0x599aba={};var _0x421557={'count':0x0,'rows':[]};return db[_0xedba('0x46')][_0xedba('0x69')]({'where':{'id':_0x6de5a6[_0xedba('0x62')]['id']}})[_0xedba('0x5c')](handleEntityNotFound(_0x2331e7,null))['then'](function(_0xaf00c5){if(_0xaf00c5){_0x599aba['model']=_[_0xedba('0x4a')](db[_0xedba('0x6e')][_0xedba('0x5f')]);_0x599aba[_0xedba('0x51')]=_[_0xedba('0x4a')](_0x6de5a6[_0xedba('0x51')]);_0x599aba['filters']=_[_0xedba('0x4c')](_0x599aba['model'],_0x599aba['query']);_0xe9c1f0[_0xedba('0x4f')]=_['intersection'](_0x599aba['model'],qs[_0xedba('0x4e')](_0x6de5a6[_0xedba('0x51')][_0xedba('0x4e')]));_0xe9c1f0['attributes']=_0xe9c1f0[_0xedba('0x4f')][_0xedba('0x50')]?_0xe9c1f0[_0xedba('0x4f')]:_0x599aba[_0xedba('0x4d')];if(!_0x6de5a6['query'][_0xedba('0x52')](_0xedba('0x53'))){_0xe9c1f0[_0xedba('0x36')]=qs[_0xedba('0x36')](_0x6de5a6[_0xedba('0x51')]['limit']);_0xe9c1f0[_0xedba('0x34')]=qs['offset'](_0x6de5a6['query'][_0xedba('0x34')]);}_0xe9c1f0['order']=qs[_0xedba('0x55')](_0x6de5a6['query'][_0xedba('0x55')]);_0xe9c1f0[_0xedba('0x56')]=qs[_0xedba('0x4b')](_[_0xedba('0x57')](_0x6de5a6['query'],_0x599aba[_0xedba('0x4b')]));_0xe9c1f0[_0xedba('0x56')]['MailAccountId']=_0xaf00c5['id'];if(_0x6de5a6[_0xedba('0x51')][_0xedba('0x58')]){_0xe9c1f0['where']=_[_0xedba('0x59')](_0xe9c1f0[_0xedba('0x56')],{'$or':_[_0xedba('0x45')](_0xe9c1f0['attributes'],function(_0x3ba0e3){var _0x31c596={};_0x31c596[_0x3ba0e3]={'$like':'%'+_0x6de5a6['query'][_0xedba('0x58')]+'%'};return _0x31c596;})});}_0xe9c1f0=_[_0xedba('0x59')]({},_0xe9c1f0,_0x6de5a6['options']);return db[_0xedba('0x6e')]['count']({'where':_0xe9c1f0[_0xedba('0x56')]})[_0xedba('0x5c')](function(_0x458bd2){_0x421557['count']=_0x458bd2;if(_0x6de5a6[_0xedba('0x51')][_0xedba('0x5d')]){_0xe9c1f0['include']=[{'all':!![]}];}return db[_0xedba('0x6e')][_0xedba('0x70')](_0xe9c1f0);})[_0xedba('0x5c')](function(_0x401f00){_0x421557['rows']=_0x401f00;return _0x421557;});}})[_0xedba('0x5c')](respondWithFilteredResult(_0x2331e7,_0xe9c1f0))[_0xedba('0x2f')](handleError(_0x2331e7,null));};exports[_0xedba('0x71')]=function(_0x318ce1,_0xd95a6,_0x2b41c0){return db[_0xedba('0x46')][_0xedba('0x60')]({'where':{'id':_0x318ce1['params']['id']}})[_0xedba('0x5c')](handleEntityNotFound(_0xd95a6,null))[_0xedba('0x5c')](function(_0x3c568c){if(_0x3c568c){return _0x3c568c[_0xedba('0x71')](_0x318ce1['query'][_0xedba('0x6c')]);}})[_0xedba('0x5c')](respondWithStatusCode(_0xd95a6,null))['catch'](handleError(_0xd95a6,null));};exports['create']=function(_0x3b7af,_0x26a7bd){var _0x110fcd={'name':_0x3b7af[_0xedba('0x61')][_0xedba('0x3f')],'key':_0x3b7af[_0xedba('0x61')]['key'],'email':_0x3b7af[_0xedba('0x61')]['email'],'ListId':_0x3b7af[_0xedba('0x61')][_0xedba('0x72')],'active':!_['isNil'](_0x3b7af[_0xedba('0x61')][_0xedba('0x73')])?_0x3b7af[_0xedba('0x61')][_0xedba('0x73')]:!![],'description':_0x3b7af['body']['description']||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x3b7af[_0xedba('0x61')]['cservice'])){if(_0x3b7af['body'][_0xedba('0x74')]){_0x110fcd[_0xedba('0x41')][_0xedba('0x75')]=_0x110fcd[_0xedba('0x43')][_0xedba('0x75')]=_0x3b7af[_0xedba('0x61')]['cuser'];_0x110fcd[_0xedba('0x41')][_0xedba('0x76')]=_0x110fcd[_0xedba('0x43')]['pass']=_0x3b7af[_0xedba('0x61')][_0xedba('0x77')];}else{_0x110fcd[_0xedba('0x41')]['authentication']=_0x110fcd[_0xedba('0x43')][_0xedba('0x78')]=![];}_0x110fcd[_0xedba('0x41')]['host']=_0x3b7af[_0xedba('0x61')][_0xedba('0x41')][_0xedba('0x79')];_0x110fcd[_0xedba('0x41')][_0xedba('0x7a')]=_0x3b7af['body']['Imap'][_0xedba('0x7a')];_0x110fcd[_0xedba('0x43')][_0xedba('0x79')]=_0x3b7af['body'][_0xedba('0x43')][_0xedba('0x79')];_0x110fcd[_0xedba('0x43')][_0xedba('0x7a')]=_0x3b7af[_0xedba('0x61')]['Smtp'][_0xedba('0x7a')];}else{_0x110fcd[_0xedba('0x41')][_0xedba('0x7b')]=_0x110fcd[_0xedba('0x43')][_0xedba('0x7b')]=_0x3b7af[_0xedba('0x61')][_0xedba('0x7c')];_0x110fcd['Imap']['user']=_0x110fcd[_0xedba('0x43')]['user']=_0x3b7af['body'][_0xedba('0x7d')];_0x110fcd[_0xedba('0x41')][_0xedba('0x76')]=_0x110fcd[_0xedba('0x43')][_0xedba('0x7e')]=_0x3b7af[_0xedba('0x61')][_0xedba('0x77')];}return db[_0xedba('0x46')]['create'](_0x110fcd,{'include':[{'model':db[_0xedba('0x42')],'as':_0xedba('0x43')},{'model':db['MailServerIn'],'as':'Imap'}]})[_0xedba('0x5c')](function(_0x3590cc){var _0x36530d=_0x3b7af[_0xedba('0x75')][_0xedba('0x3d')]({'plain':!![]});if(!_0x36530d)throw new Error(_0xedba('0x7f'));if(_0x36530d['role']==='user'){var _0x52e7a6=_0x3590cc['get']({'plain':!![]});return db['UserProfileSection'][_0xedba('0x60')]({'where':{'name':_0xedba('0x80'),'userProfileId':_0x36530d[_0xedba('0x81')]},'raw':!![]})['then'](function(_0x4ab2e8){if(_0x4ab2e8&&_0x4ab2e8[_0xedba('0x82')]===0x0){return db[_0xedba('0x83')][_0xedba('0x67')]({'name':_0x52e7a6[_0xedba('0x3f')],'resourceId':_0x52e7a6['id'],'type':_0x4ab2e8[_0xedba('0x3f')],'sectionId':_0x4ab2e8['id']},{})[_0xedba('0x5c')](function(){return _0x3590cc;});}else{return _0x3590cc;}})['catch'](function(_0x3f5e7a){logger[_0xedba('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f5e7a);throw _0x3f5e7a;});}return _0x3590cc;})[_0xedba('0x5c')](respondWithResult(_0x26a7bd,0xc9))[_0xedba('0x2f')](handleError(_0x26a7bd,null));};exports[_0xedba('0x84')]=function(_0x28d2dc,_0xcd3de5,_0x53a256){return db[_0xedba('0x46')][_0xedba('0x69')]({'where':{'id':_0x28d2dc[_0xedba('0x62')]['id']}})[_0xedba('0x5c')](handleEntityNotFound(_0xcd3de5,null))[_0xedba('0x5c')](function(_0x1f785f){if(_0x1f785f){return _0x1f785f[_0xedba('0x84')]();}return null;})[_0xedba('0x5c')](respondWithResult(_0xcd3de5,null))[_0xedba('0x2f')](handleError(_0xcd3de5,null));};exports[_0xedba('0x85')]=function(_0x9cb23,_0x4f9808,_0x2011f2){if(_0x9cb23[_0xedba('0x61')]['id']){delete _0x9cb23['body']['id'];}return db[_0xedba('0x46')]['find']({'where':{'id':_0x9cb23[_0xedba('0x62')]['id']}})[_0xedba('0x5c')](handleEntityNotFound(_0x4f9808,null))[_0xedba('0x5c')](function(_0x8fe7ef){if(_0x8fe7ef){_0x9cb23[_0xedba('0x61')][_0xedba('0x6a')]=_0x8fe7ef['id'];return db[_0xedba('0x40')]['create'](_0x9cb23[_0xedba('0x61')]);}})[_0xedba('0x5c')](respondWithResult(_0x4f9808,null))[_0xedba('0x2f')](handleError(_0x4f9808,null));};exports[_0xedba('0x86')]=function(_0x558f04,_0x54a4c7,_0x2e5bd2){return db['MailAccount'][_0xedba('0x69')]({'where':{'id':_0x558f04[_0xedba('0x62')]['id']}})[_0xedba('0x5c')](handleEntityNotFound(_0x54a4c7,null))[_0xedba('0x5c')](function(_0x1c0da){if(_0x1c0da){return _0x1c0da[_0xedba('0x87')](null);}return null;})[_0xedba('0x5c')](respondWithStatusCode(_0x54a4c7,null))[_0xedba('0x2f')](handleError(_0x54a4c7,null));};exports[_0xedba('0x88')]=function(_0x44ebf1,_0x284949,_0x550b9d){return db[_0xedba('0x46')][_0xedba('0x69')]({'where':{'id':_0x44ebf1['params']['id']}})[_0xedba('0x5c')](handleEntityNotFound(_0x284949,null))['then'](function(_0x3635f1){if(_0x3635f1){return _0x3635f1[_0xedba('0x88')]();}return null;})[_0xedba('0x5c')](respondWithResult(_0x284949,null))[_0xedba('0x2f')](handleError(_0x284949,null));};exports[_0xedba('0x89')]=function(_0x1c995b,_0x15852d,_0x155ba5){if(_0x1c995b['body']['id']){delete _0x1c995b[_0xedba('0x61')]['id'];}return db['MailAccount'][_0xedba('0x60')]({'where':{'id':_0x1c995b['params']['id']}})[_0xedba('0x5c')](handleEntityNotFound(_0x15852d,null))[_0xedba('0x5c')](function(_0xfe3655){if(_0xfe3655){_0x1c995b['body'][_0xedba('0x6a')]=_0xfe3655['id'];return db[_0xedba('0x42')][_0xedba('0x67')](_0x1c995b[_0xedba('0x61')]);}})[_0xedba('0x5c')](respondWithResult(_0x15852d,null))['catch'](handleError(_0x15852d,null));};exports[_0xedba('0x8a')]=function(_0x157193,_0x2738d3,_0x246f13){return db[_0xedba('0x46')]['findOne']({'where':{'id':_0x157193[_0xedba('0x62')]['id']}})[_0xedba('0x5c')](handleEntityNotFound(_0x2738d3,null))[_0xedba('0x5c')](function(_0x2522fa){if(_0x2522fa){return _0x2522fa[_0xedba('0x8b')](null);}return null;})[_0xedba('0x5c')](respondWithStatusCode(_0x2738d3,null))['catch'](handleError(_0x2738d3,null));};exports['addInteraction']=function(_0x5a0e9c,_0x4e6922,_0x1676a6){return db[_0xedba('0x8c')][_0xedba('0x60')]({'where':{'id':_0x5a0e9c[_0xedba('0x62')]['id']}})[_0xedba('0x5c')](handleEntityNotFound(_0x4e6922,null))[_0xedba('0x5c')](function(_0x111c88){if(_0x111c88){return _0x111c88[_0xedba('0x8d')](_0x5a0e9c[_0xedba('0x61')][_0xedba('0x6c')],_[_0xedba('0x8e')](_0x5a0e9c[_0xedba('0x61')],[_0xedba('0x6c'),'id'])||{});}})[_0xedba('0x5c')](respondWithResult(_0x4e6922,null))['catch'](handleError(_0x4e6922,null));};exports[_0xedba('0x8f')]=function(_0x573703,_0x31555a,_0x3fbf6d){var _0x23fb02={'raw':![],'where':{}};var _0x15679e={};var _0x49943d={'count':0x0,'rows':[]};return db[_0xedba('0x46')][_0xedba('0x69')]({'where':{'id':_0x573703['params']['id']}})[_0xedba('0x5c')](handleEntityNotFound(_0x31555a,null))[_0xedba('0x5c')](function(_0x42033e){if(_0x42033e){_0x15679e[_0xedba('0x4d')]=_['keys'](db[_0xedba('0x8c')][_0xedba('0x5f')]);_0x15679e[_0xedba('0x51')]=_['keys'](_0x573703[_0xedba('0x51')]);_0x15679e[_0xedba('0x4b')]=_[_0xedba('0x4c')](_0x15679e[_0xedba('0x4d')],_0x15679e[_0xedba('0x51')]);_0x23fb02[_0xedba('0x4f')]=_[_0xedba('0x4c')](_0x15679e['model'],qs[_0xedba('0x4e')](_0x573703[_0xedba('0x51')][_0xedba('0x4e')]));_0x23fb02['attributes']=_0x23fb02[_0xedba('0x4f')][_0xedba('0x50')]?_0x23fb02['attributes']:_0x15679e[_0xedba('0x4d')];if(!_0x573703[_0xedba('0x51')][_0xedba('0x52')](_0xedba('0x53'))){_0x23fb02[_0xedba('0x36')]=qs[_0xedba('0x36')](_0x573703[_0xedba('0x51')][_0xedba('0x36')]);_0x23fb02[_0xedba('0x34')]=qs[_0xedba('0x34')](_0x573703[_0xedba('0x51')][_0xedba('0x34')]);}_0x23fb02[_0xedba('0x54')]=qs[_0xedba('0x55')](_0x573703['query']['sort']);_0x23fb02[_0xedba('0x56')]=qs[_0xedba('0x4b')](_['pick'](_0x573703[_0xedba('0x51')],_0x15679e['filters']));_0x23fb02['where'][_0xedba('0x6a')]=_0x42033e['id'];if(_0x573703[_0xedba('0x51')]['filter']){_0x23fb02[_0xedba('0x56')]=_[_0xedba('0x59')](_0x23fb02[_0xedba('0x56')],{'$or':_[_0xedba('0x45')](_0x23fb02[_0xedba('0x4f')],function(_0x1c6899){var _0x19488f={};_0x19488f[_0x1c6899]={'$like':'%'+_0x573703['query'][_0xedba('0x58')]+'%'};return _0x19488f;})});}_0x23fb02=_['merge']({},_0x23fb02,_0x573703[_0xedba('0x5b')]);return db['MailInteraction']['count']({'where':_0x23fb02[_0xedba('0x56')]})[_0xedba('0x5c')](function(_0xaeea06){_0x49943d[_0xedba('0x35')]=_0xaeea06;if(_0x573703[_0xedba('0x51')][_0xedba('0x5d')]){_0x23fb02[_0xedba('0x5e')]=[{'model':db[_0xedba('0x90')],'as':_0xedba('0x91'),'required':![]},{'model':db[_0xedba('0x92')],'as':_0xedba('0x93'),'attributes':[_0xedba('0x3f'),_0xedba('0x94'),_0xedba('0x95')],'required':![]},{'model':db[_0xedba('0x96')],'as':'Tags','attributes':['id',_0xedba('0x3f'),_0xedba('0x97')],'where':_0x573703[_0xedba('0x51')][_0xedba('0x98')]?{'id':_0x573703[_0xedba('0x51')]['tag']}:undefined,'required':_0x573703[_0xedba('0x51')][_0xedba('0x98')]?!![]:![]}];}return db[_0xedba('0x8c')][_0xedba('0x70')](_0x23fb02);})[_0xedba('0x5c')](function(_0x5bbc70){_0x49943d['rows']=_0x5bbc70;return _0x49943d;});}})[_0xedba('0x5c')](respondWithFilteredResult(_0x31555a,_0x23fb02))[_0xedba('0x2f')](handleError(_0x31555a,null));};exports[_0xedba('0x99')]=function addApplications(_0x473c79,_0x115877){var _0x472254=_0x473c79[_0xedba('0x62')]['id'];var _0x5aba79=_0x473c79[_0xedba('0x61')];var _0x308f43=0xc8;var _0x16ae69=null;return db[_0xedba('0x9a')][_0xedba('0x9b')]({'isolationLevel':db['sequelize'][_0xedba('0x9c')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x403d42){return db[_0xedba('0x46')][_0xedba('0x69')]({'where':{'id':_0x472254},'transaction':_0x403d42})['then'](function(_0x243256){if(_0x243256){return db[_0xedba('0x9d')]['destroy']({'where':{'MailAccountId':_0x472254},'transaction':_0x403d42})[_0xedba('0x5c')](function(){var _0x414b0d=_[_0xedba('0x45')](_0x5aba79,function(_0x5a812b){_0x5a812b[_0xedba('0x6a')]=_0x472254;return _0x5a812b;});return db[_0xedba('0x9d')][_0xedba('0x9e')](_0x414b0d,{'transaction':_0x403d42});});}else{_0x308f43=0x194;_0x16ae69=[];}});})[_0xedba('0x5c')](function(){if(_0x308f43!==0x194){return db[_0xedba('0x9d')][_0xedba('0x9f')]({'where':{'MailAccountId':_0x472254},'order':'priority'})['then'](function(_0x1e09de){_0x16ae69=_0x1e09de;});}})[_0xedba('0x2f')](function(_0x45803e){_0x308f43=0x1f4;logger[_0xedba('0x2c')](_0x45803e[_0xedba('0x3e')]);if(_0x45803e[_0xedba('0x3f')]){delete _0x45803e[_0xedba('0x3f')];}_0x16ae69=_0x45803e;})[_0xedba('0xa0')](function(){if(_0x16ae69===null){_0x115877[_0xedba('0x30')](_0x308f43);}else{if(_0x308f43===0x1f4){_0x115877[_0xedba('0x31')](_0x308f43)['send'](_0x16ae69);}else{_0x115877[_0xedba('0x31')](_0x308f43)[_0xedba('0x33')](_0x16ae69);}}});};exports[_0xedba('0xa1')]=function(_0x3843c1,_0x426a80,_0x18ed31){var _0x27b0d0={};var _0x1308b2={};var _0x284963;var _0x131d9b;return db[_0xedba('0x46')]['findOne']({'where':{'id':_0x3843c1[_0xedba('0x62')]['id']}})[_0xedba('0x5c')](handleEntityNotFound(_0x426a80,null))[_0xedba('0x5c')](function(_0x43f511){if(_0x43f511){_0x284963=_0x43f511;_0x1308b2[_0xedba('0x4d')]=_[_0xedba('0x4a')](db[_0xedba('0x9d')][_0xedba('0x5f')]);_0x1308b2['query']=_[_0xedba('0x4a')](_0x3843c1[_0xedba('0x51')]);_0x1308b2[_0xedba('0x4b')]=_[_0xedba('0x4c')](_0x1308b2['model'],_0x1308b2[_0xedba('0x51')]);_0x27b0d0[_0xedba('0x4f')]=_[_0xedba('0x4c')](_0x1308b2[_0xedba('0x4d')],qs[_0xedba('0x4e')](_0x3843c1[_0xedba('0x51')]['fields']));_0x27b0d0['attributes']=_0x27b0d0[_0xedba('0x4f')]['length']?_0x27b0d0[_0xedba('0x4f')]:_0x1308b2[_0xedba('0x4d')];_0x27b0d0[_0xedba('0x54')]=qs[_0xedba('0x55')](_0x3843c1[_0xedba('0x51')][_0xedba('0x55')]);_0x27b0d0[_0xedba('0x56')]=qs[_0xedba('0x4b')](_[_0xedba('0x57')](_0x3843c1['query'],_0x1308b2[_0xedba('0x4b')]));if(_0x3843c1[_0xedba('0x51')][_0xedba('0x58')]){_0x27b0d0[_0xedba('0x56')]=_['merge'](_0x27b0d0['where'],{'$or':_[_0xedba('0x45')](_0x27b0d0[_0xedba('0x4f')],function(_0x42f1e7){var _0x4c03c3={};_0x4c03c3[_0x42f1e7]={'$like':'%'+_0x3843c1['query'][_0xedba('0x58')]+'%'};return _0x4c03c3;})});}_0x27b0d0=_[_0xedba('0x59')]({},_0x27b0d0,_0x3843c1[_0xedba('0x5b')]);return _0x284963['getApplications'](_0x27b0d0);}})['then'](function(_0x48762a){if(_0x48762a){_0x131d9b=_0x48762a[_0xedba('0x50')];if(!_0x3843c1[_0xedba('0x51')][_0xedba('0x52')](_0xedba('0x53'))){_0x27b0d0[_0xedba('0x36')]=qs['limit'](_0x3843c1[_0xedba('0x51')][_0xedba('0x36')]);_0x27b0d0[_0xedba('0x34')]=qs['offset'](_0x3843c1[_0xedba('0x51')]['offset']);}return _0x284963[_0xedba('0xa1')](_0x27b0d0);}})[_0xedba('0x5c')](function(_0x5b08d7){if(_0x5b08d7){return _0x5b08d7?{'count':_0x131d9b,'rows':_0x5b08d7}:null;}})['then'](respondWithResult(_0x426a80,null))[_0xedba('0x2f')](handleError(_0x426a80,null));};exports[_0xedba('0xa2')]=function(_0x3063af,_0x3e09fc,_0xd497ac){var _0x3a878e={'raw':!![],'where':{}};var _0x34e6be={};var _0x376578={'count':0x0,'rows':[]};return db[_0xedba('0x46')][_0xedba('0x69')]({'where':{'id':_0x3063af[_0xedba('0x62')]['id']}})['then'](handleEntityNotFound(_0x3e09fc,null))[_0xedba('0x5c')](function(_0x5c135a){if(_0x5c135a){_0x34e6be[_0xedba('0x4d')]=_[_0xedba('0x4a')](db[_0xedba('0xa3')][_0xedba('0x5f')]);_0x34e6be[_0xedba('0x51')]=_[_0xedba('0x4a')](_0x3063af['query']);_0x34e6be[_0xedba('0x4b')]=_[_0xedba('0x4c')](_0x34e6be[_0xedba('0x4d')],_0x34e6be[_0xedba('0x51')]);_0x3a878e[_0xedba('0x4f')]=_[_0xedba('0x4c')](_0x34e6be['model'],qs['fields'](_0x3063af[_0xedba('0x51')][_0xedba('0x4e')]));_0x3a878e[_0xedba('0x4f')]=_0x3a878e[_0xedba('0x4f')][_0xedba('0x50')]?_0x3a878e[_0xedba('0x4f')]:_0x34e6be[_0xedba('0x4d')];if(!_0x3063af[_0xedba('0x51')][_0xedba('0x52')](_0xedba('0x53'))){_0x3a878e[_0xedba('0x36')]=qs['limit'](_0x3063af[_0xedba('0x51')]['limit']);_0x3a878e[_0xedba('0x34')]=qs[_0xedba('0x34')](_0x3063af[_0xedba('0x51')][_0xedba('0x34')]);}_0x3a878e[_0xedba('0x54')]=qs[_0xedba('0x55')](_0x3063af['query'][_0xedba('0x55')]);_0x3a878e[_0xedba('0x56')]=qs['filters'](_[_0xedba('0x57')](_0x3063af[_0xedba('0x51')],_0x34e6be[_0xedba('0x4b')]));_0x3a878e[_0xedba('0x56')]['MailAccountId']=_0x5c135a['id'];if(_0x3063af['query'][_0xedba('0x58')]){_0x3a878e[_0xedba('0x56')]=_[_0xedba('0x59')](_0x3a878e['where'],{'$or':_[_0xedba('0x45')](_0x3a878e[_0xedba('0x4f')],function(_0x170153){var _0x58a033={};_0x58a033[_0x170153]={'$like':'%'+_0x3063af['query'][_0xedba('0x58')]+'%'};return _0x58a033;})});}if(_0x3063af[_0xedba('0x51')]['$gte']){var _0x1383b8=_0x3063af[_0xedba('0x51')]['$gte']['split'](',');var _0x85f3fa={};_0x85f3fa[_0x1383b8[0x0]]={'$gte':moment(_0x1383b8[0x1])['format'](_0xedba('0xa4'))};_0x3a878e[_0xedba('0x56')]=_[_0xedba('0x59')](_0x3a878e[_0xedba('0x56')],_0x85f3fa);}_0x3a878e=_[_0xedba('0x59')]({},_0x3a878e,_0x3063af[_0xedba('0x5b')]);return db[_0xedba('0xa3')]['count']({'where':_0x3a878e[_0xedba('0x56')]})[_0xedba('0x5c')](function(_0x5ab791){_0x376578[_0xedba('0x35')]=_0x5ab791;if(_0x3063af['query'][_0xedba('0x5d')]){_0x3a878e[_0xedba('0x5e')]=[{'all':!![]}];}return db['MailMessage'][_0xedba('0x70')](_0x3a878e);})['then'](function(_0x337d63){if(_0x3063af[_0xedba('0x51')][_0xedba('0xa5')]==='true'){for(var _0x56fb59=0x0;_0x56fb59<_0x337d63[_0xedba('0x50')];_0x56fb59++){_0x337d63[_0x56fb59][_0xedba('0x61')]=juice(_0x337d63[_0x56fb59][_0xedba('0x61')]);}}_0x376578[_0xedba('0x6b')]=_0x337d63;return _0x376578;});}})[_0xedba('0x5c')](respondWithFilteredResult(_0x3e09fc,_0x3a878e))[_0xedba('0x2f')](handleError(_0x3e09fc,null));};exports[_0xedba('0xa6')]=function(_0x134bd9,_0x1b5d3b,_0x4d6a44){var _0x362104,_0x5088dd={},_0x4b5168;if(_0x134bd9[_0xedba('0x61')]['to']){_0x4b5168=_0x134bd9[_0xedba('0x61')]['to'][_0xedba('0xa7')](',')[0x0];}return db[_0xedba('0x46')]['find']({'where':{'id':_0x134bd9[_0xedba('0x62')]['id']},'include':[{'model':db[_0xedba('0xa8')],'as':'List','include':[{'model':db[_0xedba('0x90')],'as':_0xedba('0xa9'),'where':{'email':_0x4b5168},'limit':0x1,'order':[[_0xedba('0xaa'),_0xedba('0xab')]]}]},{'model':db['MailServerOut'],'as':_0xedba('0x43'),'raw':!![]}]})[_0xedba('0x5c')](handleEntityNotFound(_0x1b5d3b,null))[_0xedba('0x5c')](function(_0x4f9c6c){if(_0x4f9c6c){_0x362104=_0x4f9c6c;if(_0x4f9c6c[_0xedba('0x43')]){if(_[_0xedba('0xac')](_0x134bd9[_0xedba('0x61')][_0xedba('0xad')])){_0x134bd9[_0xedba('0x61')]['from']=util[_0xedba('0xae')](_0xedba('0xaf'),_0x4f9c6c['name'],_0x4f9c6c[_0xedba('0xb0')]||_0x4f9c6c[_0xedba('0x43')][_0xedba('0x75')]);}if(_0x134bd9['body'][_0xedba('0xb1')]&&_0x134bd9[_0xedba('0x61')][_0xedba('0xb1')][_0xedba('0x50')]){for(var _0x29865f=0x0;_0x29865f<_0x134bd9[_0xedba('0x61')][_0xedba('0xb1')]['length'];_0x29865f+=0x1){_0x134bd9['body']['attachments'][_0x29865f]={'filename':_0x134bd9['body'][_0xedba('0xb1')][_0x29865f][_0xedba('0x3f')],'path':path[_0xedba('0xb2')](config[_0xedba('0xb3')],_0xedba('0xb4'),_0x134bd9[_0xedba('0x61')][_0xedba('0xb1')][_0x29865f][_0xedba('0xb5')])};}}var _0x575d24={'tls':{'rejectUnauthorized':![]}};if(_[_0xedba('0xac')](_0x4f9c6c[_0xedba('0x43')][_0xedba('0x7b')])){if(_0x4f9c6c[_0xedba('0x43')][_0xedba('0x78')]){_0x575d24['auth']={'user':_0x4f9c6c[_0xedba('0x43')][_0xedba('0x75')],'pass':_0x4f9c6c[_0xedba('0x43')][_0xedba('0x7e')]};}_0x575d24[_0xedba('0x79')]=_0x4f9c6c[_0xedba('0x43')][_0xedba('0x79')];_0x575d24[_0xedba('0x7a')]=_0x4f9c6c[_0xedba('0x43')]['port'];_0x575d24[_0xedba('0xb6')]=_0x4f9c6c[_0xedba('0x43')][_0xedba('0xb6')];}else{_0x575d24['service']=_0x4f9c6c[_0xedba('0x43')]['service'];_0x575d24[_0xedba('0xb7')]={'user':_0x4f9c6c[_0xedba('0x43')][_0xedba('0x75')],'pass':_0x4f9c6c[_0xedba('0x43')][_0xedba('0x7e')]};}return respondWithRpcPromise(_0xedba('0xb8'),_0xedba('0xb9'),{'account':_0x575d24,'message':_0x134bd9[_0xedba('0x61')]});}else{throw new Error(_0xedba('0xba'));}}})[_0xedba('0x5c')](function(_0x266327){if(_0x266327){_0x5088dd=_0x266327;if(_0x362104[_0xedba('0xbb')]){if(_0x362104[_0xedba('0xbb')]['Contacts'][_0xedba('0x50')]){return _0x362104[_0xedba('0xbb')][_0xedba('0xa9')][0x0];}else{return db[_0xedba('0x90')][_0xedba('0x67')](_['defaults'](_0x134bd9[_0xedba('0x61')],{'firstName':_0x134bd9[_0xedba('0x61')]['to'],'email':_0x134bd9[_0xedba('0x61')]['to'],'phone':_0x134bd9[_0xedba('0x61')]['to'],'ListId':_0x362104['ListId']}));}}else{throw new Error(_0xedba('0xba'));}}})[_0xedba('0x5c')](function(_0x462376){if(_0x462376){var _0x22e613={'UserId':_0x134bd9[_0xedba('0x75')]['id'],'ContactId':_0x462376['id'],'MailAccountId':_0x362104['id'],'inReplyTo':_0x5088dd[_0xedba('0xbc')],'to':_0x134bd9['body'][_0xedba('0xad')],'cc':_0x134bd9[_0xedba('0x61')]['cc'],'subject':_0x134bd9[_0xedba('0x61')]['subject'],'attach':_0x134bd9[_0xedba('0x61')]['attach'],'firstMsgDirection':_0xedba('0xbd'),'lastMsgAt':moment()[_0xedba('0xae')](_0xedba('0xa4')),'lastMsgDirection':_0xedba('0xbd'),'Messages':[_[_0xedba('0x59')](_0x134bd9['body'],{'messageId':_0x5088dd[_0xedba('0xbc')],'sentAt':moment()['format'](_0xedba('0xa4')),'read':!![],'MailAccountId':_0x362104['id'],'UserId':_0x134bd9['user']['id'],'ContactId':_0x462376['id']})]};if(_0x134bd9[_0xedba('0x61')][_0xedba('0xbe')]){_0x22e613=_[_0xedba('0x59')](_0x22e613,_0x134bd9[_0xedba('0x61')][_0xedba('0xbe')]);}return db[_0xedba('0x8c')][_0xedba('0x67')](_0x22e613,{'include':[{'model':db['MailMessage'],'as':_0xedba('0xbf')}]});}})[_0xedba('0x5c')](respondWithResult(_0x1b5d3b,null))[_0xedba('0x2f')](handleError(_0x1b5d3b,null));};exports[_0xedba('0xc0')]=function(_0x1d89f4,_0x264f1d,_0x8036db){return db['MailAccount'][_0xedba('0x60')]({'where':{'id':_0x1d89f4[_0xedba('0x62')]['id']},'include':[{'model':db[_0xedba('0x42')],'as':_0xedba('0x43'),'raw':!![]}]})[_0xedba('0x5c')](handleEntityNotFound(_0x264f1d,null))[_0xedba('0x5c')](function(_0x2380bf){if(_0x2380bf&&_0x2380bf['Smtp']){var _0x4bc031={'id':_0x2380bf['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2380bf[_0xedba('0x43')]['service']){_0x4bc031[_0xedba('0x7b')]=_0x2380bf[_0xedba('0x43')][_0xedba('0x7b')];}else{_0x4bc031[_0xedba('0x79')]=_0x2380bf[_0xedba('0x43')][_0xedba('0x79')];_0x4bc031[_0xedba('0x7a')]=_0x2380bf[_0xedba('0x43')][_0xedba('0x7a')];_0x4bc031[_0xedba('0xb6')]=_0x2380bf[_0xedba('0x43')][_0xedba('0xb6')];}if(_0x2380bf[_0xedba('0x43')][_0xedba('0x78')]){_0x4bc031[_0xedba('0xb7')]={'user':_0x2380bf[_0xedba('0x43')][_0xedba('0x75')],'pass':_0x2380bf[_0xedba('0x43')][_0xedba('0x7e')]};}return respondWithRpcPromise(_0xedba('0xc1'),_0xedba('0xc0'),{'account':_0x4bc031});}})['then'](respondWithResult(_0x264f1d,null))[_0xedba('0x2f')](handleError(_0x264f1d,null));};exports[_0xedba('0x3c')]=function(_0xc14975,_0x42d2e6){return db[_0xedba('0x46')]['find']({'where':{'id':_0xc14975[_0xedba('0x62')]['id']}})['then'](handleEntityNotFound(_0x42d2e6,null))['then'](function(_0x140a9b){if(_0x140a9b&&_0x140a9b[_0xedba('0x7b')]){throw new db[(_0xedba('0xc2'))]['ValidationError'](_0xedba('0xc3'));}return _0x140a9b;})['then'](removeEntity(_0x42d2e6,null))['catch'](handleError(_0x42d2e6,null));};exports[_0xedba('0xc4')]=function(_0x203456,_0x19eae9,_0x397fa4){return db['MailAccount'][_0xedba('0x60')]({'where':{'id':_0x203456[_0xedba('0x62')]['id']}})[_0xedba('0x5c')](handleEntityNotFound(_0x19eae9,null))['then'](function(_0x27fece){if(_0x27fece){return _0x27fece['addAgents'](_0x203456['body'][_0xedba('0x6c')],_[_0xedba('0x8e')](_0x203456['body'],[_0xedba('0x6c'),'id'])||{})['spread'](function(_0x1ba6af){for(var _0x186936=0x0;_0x186936<_0x203456['body'][_0xedba('0x6c')][_0xedba('0x50')];_0x186936+=0x1){socket['emit'](_0xedba('0xc5'),{'UserId':Number(_0x203456['body'][_0xedba('0x6c')][_0x186936]),'MailAccountId':Number(_0x203456[_0xedba('0x62')]['id'])});}return _0x1ba6af;});}})['then'](respondWithResult(_0x19eae9,null))[_0xedba('0x2f')](handleError(_0x19eae9,null));};exports[_0xedba('0xc6')]=function(_0x1d976b,_0x455eac,_0x96d309){return db[_0xedba('0x46')][_0xedba('0x60')]({'where':{'id':_0x1d976b['params']['id']}})[_0xedba('0x5c')](handleEntityNotFound(_0x455eac,null))[_0xedba('0x5c')](function(_0x24a75b){if(_0x24a75b){return _0x24a75b[_0xedba('0xc6')](_0x1d976b[_0xedba('0x51')][_0xedba('0x6c')])['then'](function(){if(_[_0xedba('0xc7')](_0x1d976b[_0xedba('0x51')][_0xedba('0x6c')])){for(var _0x465b2c=0x0;_0x465b2c<_0x1d976b[_0xedba('0x51')][_0xedba('0x6c')]['length'];_0x465b2c+=0x1){socket[_0xedba('0xc8')](_0xedba('0xc9'),{'UserId':Number(_0x1d976b[_0xedba('0x51')]['ids'][_0x465b2c]),'MailAccountId':Number(_0x1d976b[_0xedba('0x62')]['id'])});}}else{socket[_0xedba('0xc8')](_0xedba('0xc9'),{'UserId':Number(_0x1d976b[_0xedba('0x51')][_0xedba('0x6c')]),'MailAccountId':Number(_0x1d976b[_0xedba('0x62')]['id'])});}});}})[_0xedba('0x5c')](respondWithStatusCode(_0x455eac,null))[_0xedba('0x2f')](handleError(_0x455eac,null));};exports[_0xedba('0xca')]=function(_0x1e34a1,_0x3a94cc,_0x44f8b0){var _0x19c955={};var _0x2558f0={};var _0x571239;var _0x1da1ed;return db[_0xedba('0x46')][_0xedba('0x69')]({'where':{'id':_0x1e34a1['params']['id']}})[_0xedba('0x5c')](handleEntityNotFound(_0x3a94cc,null))[_0xedba('0x5c')](function(_0x1c8160){if(_0x1c8160){_0x571239=_0x1c8160;_0x2558f0[_0xedba('0x4d')]=_[_0xedba('0x4a')](db[_0xedba('0x92')][_0xedba('0x5f')]);_0x2558f0['query']=_[_0xedba('0x4a')](_0x1e34a1[_0xedba('0x51')]);_0x2558f0[_0xedba('0x4b')]=_['intersection'](_0x2558f0[_0xedba('0x4d')],_0x2558f0[_0xedba('0x51')]);_0x19c955[_0xedba('0x4f')]=_[_0xedba('0x4c')](_0x2558f0[_0xedba('0x4d')],qs[_0xedba('0x4e')](_0x1e34a1[_0xedba('0x51')]['fields']));_0x19c955[_0xedba('0x4f')]=_0x19c955['attributes'][_0xedba('0x50')]?_0x19c955[_0xedba('0x4f')]:_0x2558f0['model'];_0x19c955['order']=qs['sort'](_0x1e34a1[_0xedba('0x51')]['sort']);_0x19c955[_0xedba('0x56')]=qs['filters'](_[_0xedba('0x57')](_0x1e34a1[_0xedba('0x51')],_0x2558f0['filters']));if(_0x1e34a1['query'][_0xedba('0x58')]){_0x19c955[_0xedba('0x56')]=_[_0xedba('0x59')](_0x19c955[_0xedba('0x56')],{'$or':_[_0xedba('0x45')](_0x19c955[_0xedba('0x4f')],function(_0x1a9e14){var _0x318ec9={};_0x318ec9[_0x1a9e14]={'$like':'%'+_0x1e34a1[_0xedba('0x51')]['filter']+'%'};return _0x318ec9;})});}_0x19c955=_[_0xedba('0x59')]({},_0x19c955,_0x1e34a1['options']);return _0x571239['getAgents'](_0x19c955);}})[_0xedba('0x5c')](function(_0x59d48c){if(_0x59d48c){_0x1da1ed=_0x59d48c[_0xedba('0x50')];if(!_0x1e34a1[_0xedba('0x51')][_0xedba('0x52')](_0xedba('0x53'))){_0x19c955[_0xedba('0x36')]=qs['limit'](_0x1e34a1[_0xedba('0x51')]['limit']);_0x19c955[_0xedba('0x34')]=qs['offset'](_0x1e34a1[_0xedba('0x51')][_0xedba('0x34')]);}return _0x571239[_0xedba('0xca')](_0x19c955);}})['then'](function(_0x1b9037){if(_0x1b9037){return _0x1b9037?{'count':_0x1da1ed,'rows':_0x1b9037}:null;}})[_0xedba('0x5c')](respondWithResult(_0x3a94cc,null))[_0xedba('0x2f')](handleError(_0x3a94cc,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index aefbc8e..38509a0 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 _0xe528=['../../mysqldb','MailAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xe528,0x167));var _0x8e52=function(_0x1a9431,_0x1a9ed5){_0x1a9431=_0x1a9431-0x0;var _0x13f290=_0xe528[_0x1a9431];return _0x13f290;};'use strict';var EventEmitter=require(_0x8e52('0x0'));var MailAccount=require(_0x8e52('0x1'))['db'][_0x8e52('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x8e52('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8e52('0x4'),'afterDestroy':_0x8e52('0x5')};function emitEvent(_0x4dfac1){return function(_0x23b7e4,_0x3321b5,_0x1856dd){MailAccountEvents[_0x8e52('0x6')](_0x4dfac1+':'+_0x23b7e4['id'],_0x23b7e4);MailAccountEvents[_0x8e52('0x6')](_0x4dfac1,_0x23b7e4);_0x1856dd(null);};}for(var e in events){if(events[_0x8e52('0x7')](e)){var event=events[e];MailAccount[_0x8e52('0x8')](e,emitEvent(event));}}module[_0x8e52('0x9')]=MailAccountEvents; \ No newline at end of file +var _0xf1d6=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','save'];(function(_0x567b18,_0x478751){var _0x4a2e90=function(_0x2658dc){while(--_0x2658dc){_0x567b18['push'](_0x567b18['shift']());}};_0x4a2e90(++_0x478751);}(_0xf1d6,0x195));var _0x6f1d=function(_0x378161,_0x6177a5){_0x378161=_0x378161-0x0;var _0x4b07b1=_0xf1d6[_0x378161];return _0x4b07b1;};'use strict';var EventEmitter=require(_0x6f1d('0x0'));var MailAccount=require(_0x6f1d('0x1'))['db'][_0x6f1d('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x6f1d('0x3')](0x0);var events={'afterCreate':_0x6f1d('0x4'),'afterUpdate':'update','afterDestroy':_0x6f1d('0x5')};function emitEvent(_0x354ba7){return function(_0x291a97,_0x5464d4,_0x503295){MailAccountEvents['emit'](_0x354ba7+':'+_0x291a97['id'],_0x291a97);MailAccountEvents[_0x6f1d('0x6')](_0x354ba7,_0x291a97);_0x503295(null);};}for(var e in events){if(events[_0x6f1d('0x7')](e)){var event=events[e];MailAccount[_0x6f1d('0x8')](e,emitEvent(event));}}module[_0x6f1d('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index b32db3b..954f792 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 _0xc1b7=['request-promise','path','../../config/environment','./mailAccount.attributes','define','mail_accounts','lodash','../../config/logger','api','moment','bluebird'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xc1b7,0x1ea));var _0x7c1b=function(_0x1e197d,_0x2e551d){_0x1e197d=_0x1e197d-0x0;var _0x4ca88e=_0xc1b7[_0x1e197d];return _0x4ca88e;};'use strict';var _=require(_0x7c1b('0x0'));var util=require('util');var logger=require(_0x7c1b('0x1'))(_0x7c1b('0x2'));var moment=require(_0x7c1b('0x3'));var BPromise=require(_0x7c1b('0x4'));var rp=require(_0x7c1b('0x5'));var fs=require('fs');var path=require(_0x7c1b('0x6'));var rimraf=require('rimraf');var config=require(_0x7c1b('0x7'));var attributes=require(_0x7c1b('0x8'));module['exports']=function(_0x48b3fd,_0x1f97a3){return _0x48b3fd[_0x7c1b('0x9')]('MailAccount',attributes,{'tableName':_0x7c1b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x063b=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./mailAccount.attributes','define','mail_accounts'];(function(_0x23d1fd,_0x1fd001){var _0x59ced3=function(_0x483219){while(--_0x483219){_0x23d1fd['push'](_0x23d1fd['shift']());}};_0x59ced3(++_0x1fd001);}(_0x063b,0x129));var _0xb063=function(_0x53f9fa,_0xeb4822){_0x53f9fa=_0x53f9fa-0x0;var _0x2c3187=_0x063b[_0x53f9fa];return _0x2c3187;};'use strict';var _=require(_0xb063('0x0'));var util=require(_0xb063('0x1'));var logger=require(_0xb063('0x2'))(_0xb063('0x3'));var moment=require(_0xb063('0x4'));var BPromise=require(_0xb063('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb063('0x6'));var config=require(_0xb063('0x7'));var attributes=require(_0xb063('0x8'));module['exports']=function(_0x2999e0,_0x1981f3){return _0x2999e0[_0xb063('0x9')]('MailAccount',attributes,{'tableName':_0xb063('0xa'),'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 8cbe972..d0c5f16 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 _0x71f6=['update','format','interaction','get','created','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./mailAccount.socket','request','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','MailAccount,\x20%s,\x20%s','catch','GetMailAccount','options','raw','where','attributes','limit','include','map','model','ShowMailAccount','MailAccount','then','body','mail','difference','CmContact','rawAttributes','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','MailApplication','Applications','MailServerOut','Smtp','omit','applications','list','orderBy','priority','asc','push','close','autoclose','*,*,*,*','create','List\x20not\x20found','messageId','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread'];(function(_0x254076,_0x5e7b8d){var _0x21a93e=function(_0x26aa78){while(--_0x26aa78){_0x254076['push'](_0x254076['shift']());}};_0x21a93e(++_0x5e7b8d);}(_0x71f6,0x7d));var _0x671f=function(_0x336f8d,_0x32124f){_0x336f8d=_0x336f8d-0x0;var _0x14b66a=_0x71f6[_0x336f8d];return _0x14b66a;};'use strict';var _=require(_0x671f('0x0'));var util=require(_0x671f('0x1'));var moment=require(_0x671f('0x2'));var BPromise=require(_0x671f('0x3'));var rs=require(_0x671f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x671f('0x5'))(_0x671f('0x6'));var config=require(_0x671f('0x7'));var jayson=require(_0x671f('0x8'));var client=jayson[_0x671f('0x9')]['http']({'port':0x232c});config[_0x671f('0xa')]=_[_0x671f('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x671f('0xc'))(new Redis(config[_0x671f('0xa')]));require(_0x671f('0xd'))['register'](socket);function respondWithRpcPromise(_0x119dea,_0x4ee568,_0x35584c){return new BPromise(function(_0x7b1bf6,_0x4674e3){return client[_0x671f('0xe')](_0x119dea,_0x35584c)['then'](function(_0x2db6c2){logger[_0x671f('0xf')]('MailAccount,\x20%s,\x20%s',_0x4ee568,_0x671f('0x10'));logger[_0x671f('0x11')](_0x671f('0x12'),_0x4ee568,_0x671f('0x10'),JSON[_0x671f('0x13')](_0x2db6c2));if(_0x2db6c2[_0x671f('0x14')]){if(_0x2db6c2[_0x671f('0x14')]['code']===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x4ee568,_0x2db6c2[_0x671f('0x14')]['message']);return _0x4674e3(_0x2db6c2['error'][_0x671f('0x15')]);}logger['error'](_0x671f('0x16'),_0x4ee568,_0x2db6c2[_0x671f('0x14')][_0x671f('0x15')]);return _0x7b1bf6(_0x2db6c2[_0x671f('0x14')][_0x671f('0x15')]);}else{logger[_0x671f('0xf')](_0x671f('0x16'),_0x4ee568,'request\x20sent');_0x7b1bf6(_0x2db6c2['result'][_0x671f('0x15')]);}})[_0x671f('0x17')](function(_0x5eab08){logger[_0x671f('0x14')](_0x671f('0x16'),_0x4ee568,_0x5eab08);_0x4674e3(_0x5eab08);});});}exports[_0x671f('0x18')]=function(_0x502f0e){var _0x38ef9b=this;return new Promise(function(_0x564114,_0x5d961c){return db['MailAccount']['findAll']({'raw':_0x502f0e['options']?_0x502f0e[_0x671f('0x19')][_0x671f('0x1a')]===undefined?!![]:![]:!![],'where':_0x502f0e['options']?_0x502f0e[_0x671f('0x19')][_0x671f('0x1b')]||null:null,'attributes':_0x502f0e[_0x671f('0x19')]?_0x502f0e[_0x671f('0x19')][_0x671f('0x1c')]||null:null,'limit':_0x502f0e['options']?_0x502f0e[_0x671f('0x19')][_0x671f('0x1d')]||null:null,'include':_0x502f0e['options']?_0x502f0e[_0x671f('0x19')][_0x671f('0x1e')]?_[_0x671f('0x1f')](_0x502f0e['options'][_0x671f('0x1e')],function(_0x1dbef0){return{'model':db[_0x1dbef0[_0x671f('0x20')]],'as':_0x1dbef0['as'],'attributes':_0x1dbef0[_0x671f('0x1c')],'include':_0x1dbef0[_0x671f('0x1e')]?_[_0x671f('0x1f')](_0x1dbef0['include'],function(_0x7f3e46){return{'model':db[_0x7f3e46['model']],'as':_0x7f3e46['as'],'attributes':_0x7f3e46[_0x671f('0x1c')],'include':_0x7f3e46[_0x671f('0x1e')]?_[_0x671f('0x1f')](_0x7f3e46[_0x671f('0x1e')],function(_0x175255){return{'model':db[_0x175255['model']],'as':_0x175255['as'],'attributes':_0x175255[_0x671f('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d061a){logger['info'](_0x671f('0x18'),_0x502f0e);logger['debug']('GetMailAccount',_0x502f0e,JSON['stringify'](_0x4d061a));_0x564114(_0x4d061a);})['catch'](function(_0x5ea294){logger[_0x671f('0x14')](_0x671f('0x18'),_0x5ea294[_0x671f('0x15')],_0x502f0e);_0x5d961c(_0x38ef9b['error'](0x1f4,_0x5ea294[_0x671f('0x15')]));});});};exports[_0x671f('0x21')]=function(_0x3aeef2){var _0x1223b3=this;return new Promise(function(_0x4a771a,_0x16fe1f){return db[_0x671f('0x22')]['find']({'raw':_0x3aeef2['options']?_0x3aeef2[_0x671f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3aeef2[_0x671f('0x19')]?_0x3aeef2[_0x671f('0x19')]['where']||null:null,'attributes':_0x3aeef2[_0x671f('0x19')]?_0x3aeef2[_0x671f('0x19')][_0x671f('0x1c')]||null:null,'include':_0x3aeef2['options']?_0x3aeef2[_0x671f('0x19')][_0x671f('0x1e')]?_[_0x671f('0x1f')](_0x3aeef2['options'][_0x671f('0x1e')],function(_0x16bea0){return{'model':db[_0x16bea0[_0x671f('0x20')]],'as':_0x16bea0['as'],'attributes':_0x16bea0[_0x671f('0x1c')],'include':_0x16bea0[_0x671f('0x1e')]?_[_0x671f('0x1f')](_0x16bea0[_0x671f('0x1e')],function(_0x130b46){return{'model':db[_0x130b46[_0x671f('0x20')]],'as':_0x130b46['as'],'attributes':_0x130b46[_0x671f('0x1c')],'include':_0x130b46[_0x671f('0x1e')]?_['map'](_0x130b46['include'],function(_0x4630cc){return{'model':db[_0x4630cc['model']],'as':_0x4630cc['as'],'attributes':_0x4630cc['attributes']};}):[]};}):[]};}):[]:[]})[_0x671f('0x23')](function(_0x138e19){logger[_0x671f('0xf')](_0x671f('0x21'),_0x3aeef2);logger[_0x671f('0x11')](_0x671f('0x21'),_0x3aeef2,JSON[_0x671f('0x13')](_0x138e19));_0x4a771a(_0x138e19);})[_0x671f('0x17')](function(_0x2c4941){logger[_0x671f('0x14')](_0x671f('0x21'),_0x2c4941[_0x671f('0x15')],_0x3aeef2);_0x16fe1f(_0x1223b3[_0x671f('0x14')](0x1f4,_0x2c4941[_0x671f('0x15')]));});});};exports['NotifyMailAccount']=function(_0x4aed23){var _0x2ea9f6=this;return new Promise(function(_0x4fae39,_0x145809){var _0x56ab22={'body':_0x4aed23[_0x671f('0x24')],'channel':_0x671f('0x25')};var _0x18e5a9=_[_0x671f('0x26')](_['keys'](db[_0x671f('0x27')][_0x671f('0x28')]),[_0x671f('0x29'),_0x671f('0x2a'),'CompanyId',_0x671f('0x2b')]);var _0x3dbc7a=![];if(_0x4aed23[_0x671f('0x24')]['id']){delete _0x4aed23['body']['id'];}if(_[_0x671f('0x2c')](_0x4aed23[_0x671f('0x24')][_0x671f('0x2d')])){return _0x145809(_0x2ea9f6[_0x671f('0x14')](0x1f4,_0x671f('0x2e')));}if(_[_0x671f('0x2c')](_0x4aed23['body'][_0x671f('0x24')])||_0x4aed23[_0x671f('0x24')]['body']===''){return _0x145809(_0x2ea9f6['error'](0x1f4,_0x671f('0x2f')));}if(_[_0x671f('0x2c')](_0x4aed23[_0x671f('0x24')][_0x671f('0x30')])){return _0x145809(_0x2ea9f6[_0x671f('0x14')](0x1f4,_0x671f('0x31')+_0x18e5a9));}if(!_[_0x671f('0x32')](_0x18e5a9,_0x4aed23[_0x671f('0x24')][_0x671f('0x30')])){return _0x145809(_0x2ea9f6[_0x671f('0x14')](0x1f4,_0x671f('0x33')+_0x18e5a9));}var _0x1de717={};_0x1de717[_0x4aed23['body'][_0x671f('0x30')]]=_0x4aed23[_0x671f('0x24')][_0x671f('0x2d')];return db[_0x671f('0x22')][_0x671f('0x34')]({'where':{'id':_0x4aed23[_0x671f('0x35')]['id']},'include':[{'model':db[_0x671f('0x36')],'as':_0x671f('0x37'),'include':[{'model':db['CmContact'],'as':_0x671f('0x38'),'where':_0x1de717,'limit':0x1,'order':[[_0x671f('0x2a'),'DESC']]}]},{'model':db[_0x671f('0x39')],'as':_0x671f('0x3a')},{'model':db[_0x671f('0x3b')],'as':_0x671f('0x3c')}]})[_0x671f('0x23')](function(_0x7bebdb){if(_0x7bebdb&&_0x7bebdb['List']){var _0x3cf9d2=_0x7bebdb['get']({'plain':!![]});_0x56ab22[_0x671f('0x35')]=_[_0x671f('0x3d')](_0x3cf9d2,[_0x671f('0x3a'),_0x671f('0x37')]);_0x56ab22[_0x671f('0x3e')]=_0x3cf9d2[_0x671f('0x3a')];_0x56ab22[_0x671f('0x3f')]=_0x3cf9d2['List'];_0x56ab22[_0x671f('0x3e')]=_[_0x671f('0x40')](_0x56ab22['applications'],[_0x671f('0x41')],[_0x671f('0x42')]);if(_0x56ab22[_0x671f('0x35')]&&_0x56ab22['account']['autoclose']){_0x56ab22['applications'][_0x671f('0x43')]({'id':0x0,'priority':_0x56ab22[_0x671f('0x3e')]['length']+0x1,'app':_0x671f('0x44'),'appdata':_0x671f('0x45'),'interval':_0x671f('0x46')});}if(_0x56ab22[_0x671f('0x35')][_0x671f('0x3a')]){delete _0x56ab22[_0x671f('0x35')][_0x671f('0x3a')];}if(_0x56ab22[_0x671f('0x35')][_0x671f('0x37')]){delete _0x56ab22[_0x671f('0x35')][_0x671f('0x37')];}if(_0x3cf9d2['List']['Contacts']['length']){return _0x3cf9d2[_0x671f('0x37')][_0x671f('0x38')][0x0];}var _0x3ba681=_[_0x671f('0xb')](_0x4aed23[_0x671f('0x24')],{'firstName':_0x4aed23[_0x671f('0x24')][_0x671f('0x2d')],'ListId':_0x3cf9d2[_0x671f('0x2b')]});_0x3ba681[_0x4aed23[_0x671f('0x24')][_0x671f('0x30')]]=_0x4aed23['body'][_0x671f('0x2d')];return db[_0x671f('0x27')][_0x671f('0x47')](_0x3ba681);}else{throw new Error(_0x671f('0x48'));}})[_0x671f('0x23')](function(_0x4b857e){_0x56ab22['contact']=_0x4b857e;if(_0x4b857e){if(!_0x4aed23[_0x671f('0x24')]['message']['messageId']){_0x4aed23[_0x671f('0x24')][_0x671f('0x15')][_0x671f('0x49')]=rs['generate']()+'\x20'+_0x4aed23['body'][_0x671f('0x15')][_0x671f('0x2d')];}var _0x53a787={'ContactId':_0x4b857e['id'],'MailAccountId':_0x4aed23[_0x671f('0x35')]['id'],'inReplyTo':_0x4aed23['body'][_0x671f('0x15')][_0x671f('0x49')],'to':_0x4aed23['body'][_0x671f('0x15')][_0x671f('0x2d')],'cc':_0x4aed23['body'][_0x671f('0x15')]['cc'],'subject':_0x4aed23[_0x671f('0x24')][_0x671f('0x15')][_0x671f('0x4a')],'attach':_0x4aed23[_0x671f('0x24')][_0x671f('0x15')][_0x671f('0x4b')],'lastMsgAt':moment()['format'](_0x671f('0x4c')),'lastMsgDirection':'in'};return db[_0x671f('0x4d')][_0x671f('0x34')]({'where':{'closed':![],'MailAccountId':_0x4aed23[_0x671f('0x35')]['id']},'include':[{'model':db[_0x671f('0x4e')],'as':_0x671f('0x4f'),'attributes':['messageId'],'where':{'messageId':_0x4aed23[_0x671f('0x24')][_0x671f('0x15')][_0x671f('0x50')]}}]})[_0x671f('0x23')](function(_0x4c8fbd){if(_0x4c8fbd){return[_0x4c8fbd,![]];}return db['MailInteraction'][_0x671f('0x47')](_0x53a787)['then'](function(_0x3e72d0){return[_0x3e72d0,!![]];});});}else{throw new Error(_0x671f('0x51'));}})[_0x671f('0x52')](function(_0x514509,_0x1470f8){if(_0x514509){_0x3dbc7a=_0x1470f8;if(!_0x1470f8){return _0x514509[_0x671f('0x53')]({'inReplyTo':_0x4aed23['body']['message']['messageId'],'to':_0x4aed23[_0x671f('0x24')][_0x671f('0x15')][_0x671f('0x2d')],'cc':_0x4aed23[_0x671f('0x24')][_0x671f('0x15')]['cc'],'subject':_0x4aed23['body'][_0x671f('0x15')]['subject'],'attach':_0x514509['attach']?_0x514509[_0x671f('0x4b')]:_0x4aed23[_0x671f('0x24')]['message'][_0x671f('0x4b')],'substatus':null,'substatusAt':moment()[_0x671f('0x54')](_0x671f('0x4c')),'lastMsgAt':moment()[_0x671f('0x54')](_0x671f('0x4c')),'lastMsgDirection':'in'});}else{return _0x514509;}}})[_0x671f('0x23')](function(_0x2e6cd9){_0x56ab22[_0x671f('0x55')]=_0x2e6cd9[_0x671f('0x56')]({'plain':!![]});_0x56ab22[_0x671f('0x55')][_0x671f('0x57')]=_0x3dbc7a;return db[_0x671f('0x4e')][_0x671f('0x47')]({'body':_0x4aed23[_0x671f('0x24')]['body'],'MailAccountId':_0x4aed23[_0x671f('0x35')]['id'],'MailInteractionId':_0x2e6cd9['id'],'direction':'in','ContactId':_0x56ab22['contact']['id'],'messageId':_0x4aed23[_0x671f('0x24')][_0x671f('0x15')][_0x671f('0x49')],'from':_0x4aed23[_0x671f('0x24')][_0x671f('0x15')][_0x671f('0x2d')],'to':_0x4aed23[_0x671f('0x24')][_0x671f('0x15')]['to'],'cc':_0x4aed23[_0x671f('0x24')][_0x671f('0x15')]['cc'],'subject':_0x4aed23[_0x671f('0x24')][_0x671f('0x15')]['subject'],'attach':_0x4aed23[_0x671f('0x24')][_0x671f('0x15')][_0x671f('0x4b')],'Attachments':_0x4aed23[_0x671f('0x24')][_0x671f('0x15')]['attachments'],'originTo':_0x4aed23[_0x671f('0x24')][_0x671f('0x15')][_0x671f('0x58')],'originCc':_0x4aed23[_0x671f('0x24')][_0x671f('0x15')][_0x671f('0x59')],'bcc':_0x4aed23['body'][_0x671f('0x15')][_0x671f('0x5a')],'ChatWebsiteId':_0x4aed23['body']['message'][_0x671f('0x5b')]||null,'originChannel':_0x4aed23['body'][_0x671f('0x15')][_0x671f('0x5c')]||_0x671f('0x5d'),'ChatOfflineMessageId':_0x4aed23[_0x671f('0x24')]['message'][_0x671f('0x5e')]||null},{'include':[{'model':db[_0x671f('0x5f')],'as':_0x671f('0x60')}]});})[_0x671f('0x23')](function(_0x53ed6a){_0x56ab22[_0x671f('0x15')]=_0x53ed6a;if(_0x56ab22[_0x671f('0x55')][_0x671f('0x61')]){return db[_0x671f('0x62')][_0x671f('0x34')]({'attributes':['id',_0x671f('0x63')],'where':{'id':_0x56ab22[_0x671f('0x55')][_0x671f('0x61')]}})[_0x671f('0x23')](function(_0x618abe){if(_0x618abe){_0x56ab22[_0x671f('0x3e')]['unshift']({'id':0x0,'priority':0x0,'app':_0x671f('0x64'),'appdata':_0x618abe[_0x671f('0x63')]+','+(_0x56ab22[_0x671f('0x35')][_0x671f('0x65')]||0xa),'interval':_0x671f('0x46')});}return respondWithRpcPromise(_0x671f('0x66'),_0x671f('0x67'),_0x56ab22);});}return respondWithRpcPromise(_0x671f('0x66'),_0x671f('0x67'),_0x56ab22);})[_0x671f('0x23')](function(_0x31c9fe){_0x4fae39(_0x31c9fe);})[_0x671f('0x17')](function(_0x313f8f){_0x145809(_0x2ea9f6[_0x671f('0x14')](0x1f4,_0x313f8f[_0x671f('0x15')]));});});}; \ No newline at end of file +var _0x28e5=['GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowMailAccount','find','NotifyMailAccount','body','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','ListId','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','CmList','List','Contacts','updatedAt','MailApplication','Applications','get','omit','applications','list','priority','autoclose','length','close','*,*,*,*','List\x20not\x20found','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','create','Contact\x20not\x20found','spread','update','interaction','contact','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','Attachment','Attachments','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','socket.io-emitter','register','then','info','MailAccount,\x20%s,\x20%s','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch'];(function(_0x1d0389,_0x5f0773){var _0x215c03=function(_0x5a6d78){while(--_0x5a6d78){_0x1d0389['push'](_0x1d0389['shift']());}};_0x215c03(++_0x5f0773);}(_0x28e5,0xb2));var _0x528e=function(_0x2a247d,_0x36c689){_0x2a247d=_0x2a247d-0x0;var _0x1c0fd9=_0x28e5[_0x2a247d];return _0x1c0fd9;};'use strict';var _=require(_0x528e('0x0'));var util=require(_0x528e('0x1'));var moment=require(_0x528e('0x2'));var BPromise=require(_0x528e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x528e('0x4'))['db'];var utils=require(_0x528e('0x5'));var logger=require(_0x528e('0x6'))(_0x528e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x528e('0x8')]({'port':0x232c});config[_0x528e('0x9')]=_[_0x528e('0xa')](config[_0x528e('0x9')],{'host':_0x528e('0xb'),'port':0x18eb});var socket=require(_0x528e('0xc'))(new Redis(config[_0x528e('0x9')]));require('./mailAccount.socket')[_0x528e('0xd')](socket);function respondWithRpcPromise(_0x35f136,_0x6ac2b3,_0x3bb762){return new BPromise(function(_0x293fbd,_0x295d14){return client['request'](_0x35f136,_0x3bb762)[_0x528e('0xe')](function(_0x3b1320){logger[_0x528e('0xf')](_0x528e('0x10'),_0x6ac2b3,'request\x20sent');logger['debug'](_0x528e('0x11'),_0x6ac2b3,'request\x20sent',JSON[_0x528e('0x12')](_0x3b1320));if(_0x3b1320[_0x528e('0x13')]){if(_0x3b1320[_0x528e('0x13')][_0x528e('0x14')]===0x1f4){logger[_0x528e('0x13')]('MailAccount,\x20%s,\x20%s',_0x6ac2b3,_0x3b1320[_0x528e('0x13')][_0x528e('0x15')]);return _0x295d14(_0x3b1320[_0x528e('0x13')][_0x528e('0x15')]);}logger[_0x528e('0x13')](_0x528e('0x10'),_0x6ac2b3,_0x3b1320[_0x528e('0x13')][_0x528e('0x15')]);return _0x293fbd(_0x3b1320[_0x528e('0x13')][_0x528e('0x15')]);}else{logger['info'](_0x528e('0x10'),_0x6ac2b3,_0x528e('0x16'));_0x293fbd(_0x3b1320['result'][_0x528e('0x15')]);}})[_0x528e('0x17')](function(_0x22e302){logger[_0x528e('0x13')]('MailAccount,\x20%s,\x20%s',_0x6ac2b3,_0x22e302);_0x295d14(_0x22e302);});});}exports[_0x528e('0x18')]=function(_0x54d58){var _0x1212ee=this;return new Promise(function(_0x2252e2,_0x13b5a3){return db[_0x528e('0x19')][_0x528e('0x1a')]({'raw':_0x54d58[_0x528e('0x1b')]?_0x54d58['options'][_0x528e('0x1c')]===undefined?!![]:![]:!![],'where':_0x54d58['options']?_0x54d58['options'][_0x528e('0x1d')]||null:null,'attributes':_0x54d58[_0x528e('0x1b')]?_0x54d58['options'][_0x528e('0x1e')]||null:null,'limit':_0x54d58[_0x528e('0x1b')]?_0x54d58['options'][_0x528e('0x1f')]||null:null,'include':_0x54d58[_0x528e('0x1b')]?_0x54d58[_0x528e('0x1b')][_0x528e('0x20')]?_[_0x528e('0x21')](_0x54d58[_0x528e('0x1b')]['include'],function(_0x3af6c4){return{'model':db[_0x3af6c4[_0x528e('0x22')]],'as':_0x3af6c4['as'],'attributes':_0x3af6c4[_0x528e('0x1e')],'include':_0x3af6c4[_0x528e('0x20')]?_['map'](_0x3af6c4[_0x528e('0x20')],function(_0x4f6a3a){return{'model':db[_0x4f6a3a[_0x528e('0x22')]],'as':_0x4f6a3a['as'],'attributes':_0x4f6a3a[_0x528e('0x1e')],'include':_0x4f6a3a[_0x528e('0x20')]?_[_0x528e('0x21')](_0x4f6a3a['include'],function(_0x3a0faa){return{'model':db[_0x3a0faa[_0x528e('0x22')]],'as':_0x3a0faa['as'],'attributes':_0x3a0faa[_0x528e('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3fafc5){logger['info'](_0x528e('0x18'),_0x54d58);logger[_0x528e('0x23')](_0x528e('0x18'),_0x54d58,JSON[_0x528e('0x12')](_0x3fafc5));_0x2252e2(_0x3fafc5);})[_0x528e('0x17')](function(_0x25bec3){logger[_0x528e('0x13')](_0x528e('0x18'),_0x25bec3[_0x528e('0x15')],_0x54d58);_0x13b5a3(_0x1212ee[_0x528e('0x13')](0x1f4,_0x25bec3[_0x528e('0x15')]));});});};exports[_0x528e('0x24')]=function(_0x3d6da4){var _0x37b6c2=this;return new Promise(function(_0x4ac028,_0x473c44){return db[_0x528e('0x19')][_0x528e('0x25')]({'raw':_0x3d6da4[_0x528e('0x1b')]?_0x3d6da4[_0x528e('0x1b')][_0x528e('0x1c')]===undefined?!![]:![]:!![],'where':_0x3d6da4[_0x528e('0x1b')]?_0x3d6da4[_0x528e('0x1b')][_0x528e('0x1d')]||null:null,'attributes':_0x3d6da4[_0x528e('0x1b')]?_0x3d6da4['options']['attributes']||null:null,'include':_0x3d6da4[_0x528e('0x1b')]?_0x3d6da4[_0x528e('0x1b')][_0x528e('0x20')]?_[_0x528e('0x21')](_0x3d6da4[_0x528e('0x1b')][_0x528e('0x20')],function(_0x54d3cb){return{'model':db[_0x54d3cb['model']],'as':_0x54d3cb['as'],'attributes':_0x54d3cb[_0x528e('0x1e')],'include':_0x54d3cb['include']?_[_0x528e('0x21')](_0x54d3cb[_0x528e('0x20')],function(_0x72640b){return{'model':db[_0x72640b['model']],'as':_0x72640b['as'],'attributes':_0x72640b['attributes'],'include':_0x72640b[_0x528e('0x20')]?_[_0x528e('0x21')](_0x72640b[_0x528e('0x20')],function(_0x5b957c){return{'model':db[_0x5b957c[_0x528e('0x22')]],'as':_0x5b957c['as'],'attributes':_0x5b957c['attributes']};}):[]};}):[]};}):[]:[]})[_0x528e('0xe')](function(_0x1a0262){logger[_0x528e('0xf')](_0x528e('0x24'),_0x3d6da4);logger[_0x528e('0x23')](_0x528e('0x24'),_0x3d6da4,JSON[_0x528e('0x12')](_0x1a0262));_0x4ac028(_0x1a0262);})[_0x528e('0x17')](function(_0x2f1237){logger[_0x528e('0x13')]('ShowMailAccount',_0x2f1237[_0x528e('0x15')],_0x3d6da4);_0x473c44(_0x37b6c2[_0x528e('0x13')](0x1f4,_0x2f1237['message']));});});};exports[_0x528e('0x26')]=function(_0x19ae18){var _0x205557=this;return new Promise(function(_0x469d5d,_0x12a527){var _0x13f995={'body':_0x19ae18[_0x528e('0x27')],'channel':'mail'};var _0x30c9ae=_[_0x528e('0x28')](_[_0x528e('0x29')](db[_0x528e('0x2a')][_0x528e('0x2b')]),[_0x528e('0x2c'),'updatedAt',_0x528e('0x2d'),_0x528e('0x2e')]);var _0x15d63d=![];if(_0x19ae18[_0x528e('0x27')]['id']){delete _0x19ae18[_0x528e('0x27')]['id'];}if(_['isNil'](_0x19ae18['body']['from'])){return _0x12a527(_0x205557[_0x528e('0x13')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x528e('0x2f')](_0x19ae18[_0x528e('0x27')][_0x528e('0x27')])||_0x19ae18[_0x528e('0x27')][_0x528e('0x27')]===''){return _0x12a527(_0x205557['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x528e('0x2f')](_0x19ae18[_0x528e('0x27')][_0x528e('0x30')])){return _0x12a527(_0x205557['error'](0x1f4,_0x528e('0x31')+_0x30c9ae));}if(!_[_0x528e('0x32')](_0x30c9ae,_0x19ae18[_0x528e('0x27')]['mapKey'])){return _0x12a527(_0x205557['error'](0x1f4,_0x528e('0x33')+_0x30c9ae));}var _0x2321bb={};_0x2321bb[_0x19ae18[_0x528e('0x27')][_0x528e('0x30')]]=_0x19ae18[_0x528e('0x27')][_0x528e('0x34')];return db[_0x528e('0x19')][_0x528e('0x25')]({'where':{'id':_0x19ae18[_0x528e('0x35')]['id']},'include':[{'model':db[_0x528e('0x36')],'as':_0x528e('0x37'),'include':[{'model':db[_0x528e('0x2a')],'as':_0x528e('0x38'),'where':_0x2321bb,'limit':0x1,'order':[[_0x528e('0x39'),'DESC']]}]},{'model':db[_0x528e('0x3a')],'as':_0x528e('0x3b')},{'model':db['MailServerOut'],'as':'Smtp'}]})[_0x528e('0xe')](function(_0xe982b4){if(_0xe982b4&&_0xe982b4[_0x528e('0x37')]){var _0x58cea1=_0xe982b4[_0x528e('0x3c')]({'plain':!![]});_0x13f995[_0x528e('0x35')]=_[_0x528e('0x3d')](_0x58cea1,[_0x528e('0x3b'),_0x528e('0x37')]);_0x13f995[_0x528e('0x3e')]=_0x58cea1[_0x528e('0x3b')];_0x13f995[_0x528e('0x3f')]=_0x58cea1[_0x528e('0x37')];_0x13f995['applications']=_['orderBy'](_0x13f995[_0x528e('0x3e')],[_0x528e('0x40')],['asc']);if(_0x13f995['account']&&_0x13f995[_0x528e('0x35')][_0x528e('0x41')]){_0x13f995['applications']['push']({'id':0x0,'priority':_0x13f995[_0x528e('0x3e')][_0x528e('0x42')]+0x1,'app':_0x528e('0x43'),'appdata':_0x528e('0x41'),'interval':_0x528e('0x44')});}if(_0x13f995[_0x528e('0x35')]['Applications']){delete _0x13f995[_0x528e('0x35')]['Applications'];}if(_0x13f995[_0x528e('0x35')][_0x528e('0x37')]){delete _0x13f995['account']['List'];}if(_0x58cea1[_0x528e('0x37')][_0x528e('0x38')]['length']){return _0x58cea1[_0x528e('0x37')][_0x528e('0x38')][0x0];}var _0x1b776b=_[_0x528e('0xa')](_0x19ae18['body'],{'firstName':_0x19ae18[_0x528e('0x27')][_0x528e('0x34')],'ListId':_0x58cea1['ListId']});_0x1b776b[_0x19ae18[_0x528e('0x27')]['mapKey']]=_0x19ae18[_0x528e('0x27')][_0x528e('0x34')];return db['CmContact']['create'](_0x1b776b);}else{throw new Error(_0x528e('0x45'));}})['then'](function(_0x948e32){_0x13f995['contact']=_0x948e32;if(_0x948e32){if(!_0x19ae18[_0x528e('0x27')][_0x528e('0x15')][_0x528e('0x46')]){_0x19ae18['body']['message']['messageId']=rs[_0x528e('0x47')]()+'\x20'+_0x19ae18[_0x528e('0x27')][_0x528e('0x15')][_0x528e('0x34')];}var _0x5f448f={'ContactId':_0x948e32['id'],'MailAccountId':_0x19ae18[_0x528e('0x35')]['id'],'inReplyTo':_0x19ae18[_0x528e('0x27')]['message'][_0x528e('0x46')],'to':_0x19ae18[_0x528e('0x27')][_0x528e('0x15')][_0x528e('0x34')],'cc':_0x19ae18[_0x528e('0x27')]['message']['cc'],'subject':_0x19ae18[_0x528e('0x27')]['message'][_0x528e('0x48')],'attach':_0x19ae18[_0x528e('0x27')][_0x528e('0x15')][_0x528e('0x49')],'lastMsgAt':moment()[_0x528e('0x4a')](_0x528e('0x4b')),'lastMsgDirection':'in'};return db[_0x528e('0x4c')][_0x528e('0x25')]({'where':{'closed':![],'MailAccountId':_0x19ae18[_0x528e('0x35')]['id']},'include':[{'model':db[_0x528e('0x4d')],'as':_0x528e('0x4e'),'attributes':[_0x528e('0x46')],'where':{'messageId':_0x19ae18[_0x528e('0x27')][_0x528e('0x15')][_0x528e('0x4f')]}}]})[_0x528e('0xe')](function(_0x5dbae3){if(_0x5dbae3){return[_0x5dbae3,![]];}return db[_0x528e('0x4c')][_0x528e('0x50')](_0x5f448f)[_0x528e('0xe')](function(_0x2ce9ed){return[_0x2ce9ed,!![]];});});}else{throw new Error(_0x528e('0x51'));}})[_0x528e('0x52')](function(_0x572af6,_0x56742b){if(_0x572af6){_0x15d63d=_0x56742b;if(!_0x56742b){return _0x572af6[_0x528e('0x53')]({'inReplyTo':_0x19ae18['body']['message'][_0x528e('0x46')],'to':_0x19ae18[_0x528e('0x27')]['message'][_0x528e('0x34')],'cc':_0x19ae18[_0x528e('0x27')][_0x528e('0x15')]['cc'],'subject':_0x19ae18[_0x528e('0x27')][_0x528e('0x15')][_0x528e('0x48')],'attach':_0x572af6[_0x528e('0x49')]?_0x572af6[_0x528e('0x49')]:_0x19ae18[_0x528e('0x27')][_0x528e('0x15')][_0x528e('0x49')],'substatus':null,'substatusAt':moment()[_0x528e('0x4a')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x528e('0x4a')](_0x528e('0x4b')),'lastMsgDirection':'in'});}else{return _0x572af6;}}})[_0x528e('0xe')](function(_0x15e71a){_0x13f995[_0x528e('0x54')]=_0x15e71a[_0x528e('0x3c')]({'plain':!![]});_0x13f995[_0x528e('0x54')]['created']=_0x15d63d;return db[_0x528e('0x4d')][_0x528e('0x50')]({'body':_0x19ae18[_0x528e('0x27')]['body'],'MailAccountId':_0x19ae18[_0x528e('0x35')]['id'],'MailInteractionId':_0x15e71a['id'],'direction':'in','ContactId':_0x13f995[_0x528e('0x55')]['id'],'messageId':_0x19ae18[_0x528e('0x27')][_0x528e('0x15')]['messageId'],'from':_0x19ae18[_0x528e('0x27')][_0x528e('0x15')][_0x528e('0x34')],'to':_0x19ae18['body']['message']['to'],'cc':_0x19ae18[_0x528e('0x27')][_0x528e('0x15')]['cc'],'subject':_0x19ae18[_0x528e('0x27')][_0x528e('0x15')][_0x528e('0x48')],'attach':_0x19ae18[_0x528e('0x27')]['message']['attach'],'Attachments':_0x19ae18[_0x528e('0x27')][_0x528e('0x15')]['attachments'],'originTo':_0x19ae18[_0x528e('0x27')][_0x528e('0x15')][_0x528e('0x56')],'originCc':_0x19ae18[_0x528e('0x27')][_0x528e('0x15')][_0x528e('0x57')],'bcc':_0x19ae18[_0x528e('0x27')]['message'][_0x528e('0x58')],'ChatWebsiteId':_0x19ae18['body'][_0x528e('0x15')][_0x528e('0x59')]||null,'originChannel':_0x19ae18[_0x528e('0x27')][_0x528e('0x15')][_0x528e('0x5a')]||_0x528e('0x5b'),'ChatOfflineMessageId':_0x19ae18[_0x528e('0x27')][_0x528e('0x15')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x528e('0x5c')],'as':_0x528e('0x5d')}]});})['then'](function(_0x159583){_0x13f995[_0x528e('0x15')]=_0x159583;if(_0x13f995['interaction'][_0x528e('0x5e')]){return db[_0x528e('0x5f')][_0x528e('0x25')]({'attributes':['id',_0x528e('0x60')],'where':{'id':_0x13f995[_0x528e('0x54')][_0x528e('0x5e')]}})[_0x528e('0xe')](function(_0x4375ac){if(_0x4375ac){_0x13f995['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x528e('0x61'),'appdata':_0x4375ac[_0x528e('0x60')]+','+(_0x13f995[_0x528e('0x35')][_0x528e('0x62')]||0xa),'interval':_0x528e('0x44')});}return respondWithRpcPromise(_0x528e('0x63'),_0x528e('0x64'),_0x13f995);});}return respondWithRpcPromise(_0x528e('0x63'),'startRouting',_0x13f995);})[_0x528e('0xe')](function(_0x3df4b2){_0x469d5d(_0x3df4b2);})[_0x528e('0x17')](function(_0x3b8ce7){_0x12a527(_0x205557[_0x528e('0x13')](0x1f4,_0x3b8ce7['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 1f13530..cf6bc4c 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 _0x3aee=['emit','register','length','mailAccount:','./mailAccount.events','save','update'];(function(_0x348990,_0x6d8494){var _0x4f4ef6=function(_0x49a6a0){while(--_0x49a6a0){_0x348990['push'](_0x348990['shift']());}};_0x4f4ef6(++_0x6d8494);}(_0x3aee,0x131));var _0xe3ae=function(_0x114b7c,_0xc4b93b){_0x114b7c=_0x114b7c-0x0;var _0x47185f=_0x3aee[_0x114b7c];return _0x47185f;};'use strict';var MailAccountEvents=require(_0xe3ae('0x0'));var events=[_0xe3ae('0x1'),'remove',_0xe3ae('0x2')];function createListener(_0x2d16b7,_0x328af4){return function(_0x1fa174){_0x328af4[_0xe3ae('0x3')](_0x2d16b7,_0x1fa174);};}function removeListener(_0xec17e5,_0x5f256e){return function(){MailAccountEvents['removeListener'](_0xec17e5,_0x5f256e);};}exports[_0xe3ae('0x4')]=function(_0x238269){for(var _0x20af09=0x0,_0x482b17=events[_0xe3ae('0x5')];_0x20af09<_0x482b17;_0x20af09++){var _0x3729e5=events[_0x20af09];var _0x5e241f=createListener(_0xe3ae('0x6')+_0x3729e5,_0x238269);MailAccountEvents['on'](_0x3729e5,_0x5e241f);}}; \ No newline at end of file +var _0x237d=['save','remove','update','emit','removeListener','./mailAccount.events'];(function(_0x1cfd93,_0x2e5014){var _0x361d75=function(_0x42a20f){while(--_0x42a20f){_0x1cfd93['push'](_0x1cfd93['shift']());}};_0x361d75(++_0x2e5014);}(_0x237d,0x1d9));var _0xd237=function(_0x250f7c,_0xadc77b){_0x250f7c=_0x250f7c-0x0;var _0x395f32=_0x237d[_0x250f7c];return _0x395f32;};'use strict';var MailAccountEvents=require(_0xd237('0x0'));var events=[_0xd237('0x1'),_0xd237('0x2'),_0xd237('0x3')];function createListener(_0x4d5e1c,_0x173f47){return function(_0x12d819){_0x173f47[_0xd237('0x4')](_0x4d5e1c,_0x12d819);};}function removeListener(_0x16967d,_0x1de407){return function(){MailAccountEvents[_0xd237('0x5')](_0x16967d,_0x1de407);};}exports['register']=function(_0x1dfaa5){for(var _0x37e6c0=0x0,_0x5ca6e7=events['length'];_0x37e6c0<_0x5ca6e7;_0x37e6c0++){var _0x5390d7=events[_0x37e6c0];var _0x1df838=createListener('mailAccount:'+_0x5390d7,_0x1dfaa5);MailAccountEvents['on'](_0x5390d7,_0x1df838);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index ed3c5a4..5a0a88b 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 _0x85ff=['Router','fs-extra','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','show','isAuthenticated','delete','destroy','multer','util','express'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x85ff,0xeb));var _0xf85f=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x85ff[_0x565c49];return _0x20ca34;};'use strict';var multer=require(_0xf85f('0x0'));var util=require(_0xf85f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf85f('0x2'));var router=express[_0xf85f('0x3')]();var fs_extra=require(_0xf85f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf85f('0x5'));var config=require(_0xf85f('0x6'));var controller=require(_0xf85f('0x7'));router[_0xf85f('0x8')](_0xf85f('0x9'),auth['isAuthenticated'](),controller[_0xf85f('0xa')]);router['put'](_0xf85f('0x9'),auth[_0xf85f('0xb')](),controller['update']);router[_0xf85f('0xc')](_0xf85f('0x9'),auth[_0xf85f('0xb')](),controller[_0xf85f('0xd')]);module['exports']=router; \ No newline at end of file +var _0x553a=['update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','put','/:id'];(function(_0x41df38,_0x141346){var _0x422d41=function(_0xf91270){while(--_0xf91270){_0x41df38['push'](_0x41df38['shift']());}};_0x422d41(++_0x141346);}(_0x553a,0x84));var _0xa553=function(_0x169a8a,_0x3526b1){_0x169a8a=_0x169a8a-0x0;var _0x2e8502=_0x553a[_0x169a8a];return _0x2e8502;};'use strict';var multer=require(_0xa553('0x0'));var util=require(_0xa553('0x1'));var path=require(_0xa553('0x2'));var timeout=require('connect-timeout');var express=require(_0xa553('0x3'));var router=express[_0xa553('0x4')]();var fs_extra=require(_0xa553('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa553('0x6'));var config=require(_0xa553('0x7'));var controller=require('./mailApplication.controller');router[_0xa553('0x8')]('/:id',auth[_0xa553('0x9')](),controller['show']);router[_0xa553('0xa')](_0xa553('0xb'),auth['isAuthenticated'](),controller[_0xa553('0xc')]);router[_0xa553('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xa553('0xe')]);module[_0xa553('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 3034528..da31ee8 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 _0x97a6=['STRING','*,*,*,*','INTEGER'];(function(_0x225b34,_0x148ce7){var _0x22950d=function(_0xeddb06){while(--_0xeddb06){_0x225b34['push'](_0x225b34['shift']());}};_0x22950d(++_0x148ce7);}(_0x97a6,0x8f));var _0x697a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x97a6[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x697a('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x697a('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x697a('0x1')],'defaultValue':_0x697a('0x2')}}; \ No newline at end of file +var _0xf31f=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x3c6b7d,_0x5f0d90){var _0x1d3ed2=function(_0x1a8f35){while(--_0x1a8f35){_0x3c6b7d['push'](_0x3c6b7d['shift']());}};_0x1d3ed2(++_0x5f0d90);}(_0xf31f,0x95));var _0xff31=function(_0x128c6f,_0x54a780){_0x128c6f=_0x128c6f-0x0;var _0xe8e4b0=_0xf31f[_0x128c6f];return _0xe8e4b0;};'use strict';var Sequelize=require(_0xff31('0x0'));module[_0xff31('0x1')]={'priority':{'type':Sequelize[_0xff31('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xff31('0x3')],'allowNull':![],'defaultValue':_0xff31('0x4')},'appdata':{'type':Sequelize[_0xff31('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xff31('0x3')],'defaultValue':_0xff31('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index ea8c53e..b7210c0 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 _0xe706=['limit','count','offset','set','Content-Range','json','apply','save','update','then','end','name','send','show','params','model','keys','MailApplication','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','body','catch','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined'];(function(_0x547fe3,_0x5bbc1a){var _0x5391b7=function(_0x2b0612){while(--_0x2b0612){_0x547fe3['push'](_0x547fe3['shift']());}};_0x5391b7(++_0x5bbc1a);}(_0xe706,0xa3));var _0x6e70=function(_0xda9b6,_0x54ea66){_0xda9b6=_0xda9b6-0x0;var _0x14f93c=_0xe706[_0xda9b6];return _0x14f93c;};'use strict';var emlformat=require(_0x6e70('0x0'));var rimraf=require(_0x6e70('0x1'));var zipdir=require(_0x6e70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e70('0x3'));var moment=require(_0x6e70('0x4'));var BPromise=require(_0x6e70('0x5'));var Mustache=require(_0x6e70('0x6'));var util=require(_0x6e70('0x7'));var path=require(_0x6e70('0x8'));var sox=require(_0x6e70('0x9'));var csv=require(_0x6e70('0xa'));var ejs=require(_0x6e70('0xb'));var fs=require('fs');var fs_extra=require(_0x6e70('0xc'));var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xa'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var licenseUtil=require(_0x6e70('0x1b'));var db=require(_0x6e70('0x1c'))['db'];function respondWithStatusCode(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xcc;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x1d')](_0x3b38f3);}return _0x27dd9b[_0x6e70('0x1e')](_0x3b38f3)['end']();};}function respondWithResult(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0xc8;return function(_0x257e81){if(_0x257e81){return _0x52737e['status'](_0x48bc72)['json'](_0x257e81);}};}function respondWithFilteredResult(_0x304716,_0x22c50c){return function(_0x5d9263){if(_0x5d9263){var _0x24f3ac=typeof _0x22c50c['offset']===_0x6e70('0x1f')&&typeof _0x22c50c[_0x6e70('0x20')]==='undefined';var _0x49029f=_0x5d9263[_0x6e70('0x21')];var _0x5ea7a5=_0x24f3ac?0x0:_0x22c50c[_0x6e70('0x22')];var _0x173afe=_0x24f3ac?_0x5d9263['count']:_0x22c50c['offset']+_0x22c50c[_0x6e70('0x20')];var _0x208e21;if(_0x173afe>=_0x49029f){_0x173afe=_0x49029f;_0x208e21=0xc8;}else{_0x208e21=0xce;}_0x304716[_0x6e70('0x1e')](_0x208e21);return _0x304716[_0x6e70('0x23')](_0x6e70('0x24'),_0x5ea7a5+'-'+_0x173afe+'/'+_0x49029f)[_0x6e70('0x25')](_0x5d9263);}return null;};}function patchUpdates(_0x1b2453){return function(_0x44a49f){try{jsonpatch[_0x6e70('0x26')](_0x44a49f,_0x1b2453,!![]);}catch(_0xb29a2a){return BPromise['reject'](_0xb29a2a);}return _0x44a49f[_0x6e70('0x27')]();};}function saveUpdates(_0x344b65,_0x27b294){return function(_0x502b2d){if(_0x502b2d){return _0x502b2d[_0x6e70('0x28')](_0x344b65)[_0x6e70('0x29')](function(_0x3337a6){return _0x3337a6;});}return null;};}function removeEntity(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(_0x538b9c){return _0x538b9c['destroy']()['then'](function(){_0x50da2c[_0x6e70('0x1e')](0xcc)[_0x6e70('0x2a')]();});}};}function handleEntityNotFound(_0x51d292,_0x3ecdf1){return function(_0x1196ed){if(!_0x1196ed){_0x51d292['sendStatus'](0x194);}return _0x1196ed;};}function handleError(_0x338ad6,_0x67fb43){_0x67fb43=_0x67fb43||0x1f4;return function(_0x2bb231){logger['error'](_0x2bb231['stack']);if(_0x2bb231[_0x6e70('0x2b')]){delete _0x2bb231[_0x6e70('0x2b')];}_0x338ad6[_0x6e70('0x1e')](_0x67fb43)[_0x6e70('0x2c')](_0x2bb231);};}exports[_0x6e70('0x2d')]=function(_0x5d772a,_0x1952ea){var _0x406f29={'raw':!![],'where':{'id':_0x5d772a[_0x6e70('0x2e')]['id']}},_0xecf336={};_0xecf336[_0x6e70('0x2f')]=_[_0x6e70('0x30')](db[_0x6e70('0x31')][_0x6e70('0x32')]);_0xecf336[_0x6e70('0x33')]=_[_0x6e70('0x30')](_0x5d772a['query']);_0xecf336[_0x6e70('0x34')]=_['intersection'](_0xecf336[_0x6e70('0x2f')],_0xecf336['query']);_0x406f29[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0xecf336[_0x6e70('0x2f')],qs['fields'](_0x5d772a[_0x6e70('0x33')][_0x6e70('0x37')]));_0x406f29['attributes']=_0x406f29[_0x6e70('0x35')][_0x6e70('0x38')]?_0x406f29['attributes']:_0xecf336[_0x6e70('0x2f')];if(_0x5d772a[_0x6e70('0x33')][_0x6e70('0x39')]){_0x406f29[_0x6e70('0x3a')]=[{'all':!![]}];}_0x406f29=_[_0x6e70('0x3b')]({},_0x406f29,_0x5d772a[_0x6e70('0x3c')]);return db[_0x6e70('0x31')][_0x6e70('0x3d')](_0x406f29)[_0x6e70('0x29')](handleEntityNotFound(_0x1952ea,null))[_0x6e70('0x29')](respondWithResult(_0x1952ea,null))['catch'](handleError(_0x1952ea,null));};exports[_0x6e70('0x28')]=function(_0x4795a0,_0x23cd1a){if(_0x4795a0[_0x6e70('0x3e')]['id']){delete _0x4795a0[_0x6e70('0x3e')]['id'];}return db[_0x6e70('0x31')][_0x6e70('0x3d')]({'where':{'id':_0x4795a0[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x23cd1a,null))[_0x6e70('0x29')](saveUpdates(_0x4795a0[_0x6e70('0x3e')],null))[_0x6e70('0x29')](respondWithResult(_0x23cd1a,null))[_0x6e70('0x3f')](handleError(_0x23cd1a,null));};exports[_0x6e70('0x40')]=function(_0x5594d3,_0x501b53){return db['MailApplication']['find']({'where':{'id':_0x5594d3[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x501b53,null))[_0x6e70('0x29')](removeEntity(_0x501b53,null))[_0x6e70('0x3f')](handleError(_0x501b53,null));}; \ No newline at end of file +var _0x9bde=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','name','send','show','model','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','params','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x566bdf,_0x1f4861){var _0x331215=function(_0x524d0d){while(--_0x524d0d){_0x566bdf['push'](_0x566bdf['shift']());}};_0x331215(++_0x1f4861);}(_0x9bde,0xe1));var _0xe9bd=function(_0x1fcd0a,_0x3cc29f){_0x1fcd0a=_0x1fcd0a-0x0;var _0x5930e8=_0x9bde[_0x1fcd0a];return _0x5930e8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9bd('0x1'));var rp=require('request-promise');var moment=require(_0xe9bd('0x2'));var BPromise=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var util=require(_0xe9bd('0x5'));var path=require(_0xe9bd('0x6'));var sox=require(_0xe9bd('0x7'));var csv=require(_0xe9bd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9bd('0x9'));var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0x8'));var querystring=require(_0xe9bd('0xf'));var Papa=require(_0xe9bd('0x10'));var Redis=require(_0xe9bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x12'));var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))('api');var utils=require(_0xe9bd('0x15'));var config=require(_0xe9bd('0x16'));var licenseUtil=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];function respondWithStatusCode(_0x5e022a,_0x2c1d98){_0x2c1d98=_0x2c1d98||0xcc;return function(_0x4ac319){if(_0x4ac319){return _0x5e022a[_0xe9bd('0x19')](_0x2c1d98);}return _0x5e022a[_0xe9bd('0x1a')](_0x2c1d98)[_0xe9bd('0x1b')]();};}function respondWithResult(_0x51109f,_0x47ba5e){_0x47ba5e=_0x47ba5e||0xc8;return function(_0x46a95e){if(_0x46a95e){return _0x51109f[_0xe9bd('0x1a')](_0x47ba5e)[_0xe9bd('0x1c')](_0x46a95e);}};}function respondWithFilteredResult(_0x46a59b,_0x3360bd){return function(_0x389e7b){if(_0x389e7b){var _0x45a9f2=typeof _0x3360bd['offset']===_0xe9bd('0x1d')&&typeof _0x3360bd[_0xe9bd('0x1e')]===_0xe9bd('0x1d');var _0x494b27=_0x389e7b[_0xe9bd('0x1f')];var _0x3bae08=_0x45a9f2?0x0:_0x3360bd[_0xe9bd('0x20')];var _0x330733=_0x45a9f2?_0x389e7b['count']:_0x3360bd[_0xe9bd('0x20')]+_0x3360bd['limit'];var _0xc6b661;if(_0x330733>=_0x494b27){_0x330733=_0x494b27;_0xc6b661=0xc8;}else{_0xc6b661=0xce;}_0x46a59b['status'](_0xc6b661);return _0x46a59b[_0xe9bd('0x21')](_0xe9bd('0x22'),_0x3bae08+'-'+_0x330733+'/'+_0x494b27)[_0xe9bd('0x1c')](_0x389e7b);}return null;};}function patchUpdates(_0x3dda13){return function(_0x1acb82){try{jsonpatch[_0xe9bd('0x23')](_0x1acb82,_0x3dda13,!![]);}catch(_0x6593ce){return BPromise['reject'](_0x6593ce);}return _0x1acb82[_0xe9bd('0x24')]();};}function saveUpdates(_0x28cd17,_0x4ecaf5){return function(_0x37aec1){if(_0x37aec1){return _0x37aec1['update'](_0x28cd17)[_0xe9bd('0x25')](function(_0x1b9cc9){return _0x1b9cc9;});}return null;};}function removeEntity(_0x36f8c0,_0xf02209){return function(_0x5bc4bf){if(_0x5bc4bf){return _0x5bc4bf[_0xe9bd('0x26')]()[_0xe9bd('0x25')](function(){_0x36f8c0[_0xe9bd('0x1a')](0xcc)[_0xe9bd('0x1b')]();});}};}function handleEntityNotFound(_0x2641be,_0xb52d45){return function(_0x399f3c){if(!_0x399f3c){_0x2641be[_0xe9bd('0x19')](0x194);}return _0x399f3c;};}function handleError(_0x1ae889,_0x5987af){_0x5987af=_0x5987af||0x1f4;return function(_0x3c211a){logger[_0xe9bd('0x27')](_0x3c211a['stack']);if(_0x3c211a[_0xe9bd('0x28')]){delete _0x3c211a[_0xe9bd('0x28')];}_0x1ae889[_0xe9bd('0x1a')](_0x5987af)[_0xe9bd('0x29')](_0x3c211a);};}exports[_0xe9bd('0x2a')]=function(_0x183601,_0x519f48){var _0x5b7f1d={'raw':!![],'where':{'id':_0x183601['params']['id']}},_0x1de54c={};_0x1de54c[_0xe9bd('0x2b')]=_[_0xe9bd('0x2c')](db[_0xe9bd('0x2d')][_0xe9bd('0x2e')]);_0x1de54c[_0xe9bd('0x2f')]=_['keys'](_0x183601['query']);_0x1de54c[_0xe9bd('0x30')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],_0x1de54c[_0xe9bd('0x2f')]);_0x5b7f1d[_0xe9bd('0x32')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],qs[_0xe9bd('0x33')](_0x183601[_0xe9bd('0x2f')]['fields']));_0x5b7f1d[_0xe9bd('0x32')]=_0x5b7f1d[_0xe9bd('0x32')][_0xe9bd('0x34')]?_0x5b7f1d['attributes']:_0x1de54c['model'];if(_0x183601[_0xe9bd('0x2f')][_0xe9bd('0x35')]){_0x5b7f1d[_0xe9bd('0x36')]=[{'all':!![]}];}_0x5b7f1d=_[_0xe9bd('0x37')]({},_0x5b7f1d,_0x183601[_0xe9bd('0x38')]);return db[_0xe9bd('0x2d')][_0xe9bd('0x39')](_0x5b7f1d)[_0xe9bd('0x25')](handleEntityNotFound(_0x519f48,null))[_0xe9bd('0x25')](respondWithResult(_0x519f48,null))[_0xe9bd('0x3a')](handleError(_0x519f48,null));};exports[_0xe9bd('0x3b')]=function(_0x549dd1,_0x2ad46e){if(_0x549dd1[_0xe9bd('0x3c')]['id']){delete _0x549dd1[_0xe9bd('0x3c')]['id'];}return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x549dd1[_0xe9bd('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2ad46e,null))[_0xe9bd('0x25')](saveUpdates(_0x549dd1[_0xe9bd('0x3c')],null))['then'](respondWithResult(_0x2ad46e,null))[_0xe9bd('0x3a')](handleError(_0x2ad46e,null));};exports[_0xe9bd('0x26')]=function(_0x4c7d47,_0x4b1da0){return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x4c7d47['params']['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x4b1da0,null))[_0xe9bd('0x25')](removeEntity(_0x4b1da0,null))[_0xe9bd('0x3a')](handleError(_0x4b1da0,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 2868bf1..8d8957a 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 _0xf42b=['path','rimraf','./mailApplication.attributes','exports','define','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x35a2f2,_0x647933){var _0x80a3ff=function(_0x3ce9d6){while(--_0x3ce9d6){_0x35a2f2['push'](_0x35a2f2['shift']());}};_0x80a3ff(++_0x647933);}(_0xf42b,0x1cf));var _0xbf42=function(_0x1914f0,_0x1ef933){_0x1914f0=_0x1914f0-0x0;var _0x2c670d=_0xf42b[_0x1914f0];return _0x2c670d;};'use strict';var _=require(_0xbf42('0x0'));var util=require(_0xbf42('0x1'));var logger=require('../../config/logger')(_0xbf42('0x2'));var moment=require(_0xbf42('0x3'));var BPromise=require(_0xbf42('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf42('0x5'));var rimraf=require(_0xbf42('0x6'));var config=require('../../config/environment');var attributes=require(_0xbf42('0x7'));module[_0xbf42('0x8')]=function(_0x3f3640,_0xb0a933){return _0x3f3640[_0xbf42('0x9')]('MailApplication',attributes,{'tableName':_0xbf42('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbf42('0xb'),'collate':_0xbf42('0xc')});}; \ No newline at end of file +var _0xe467=['exports','mail_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x2c6ad9,_0x184f4d){var _0x39a6e1=function(_0x4bde9f){while(--_0x4bde9f){_0x2c6ad9['push'](_0x2c6ad9['shift']());}};_0x39a6e1(++_0x184f4d);}(_0xe467,0x68));var _0x7e46=function(_0x210200,_0x150b2e){_0x210200=_0x210200-0x0;var _0x52e0e5=_0xe467[_0x210200];return _0x52e0e5;};'use strict';var _=require('lodash');var util=require(_0x7e46('0x0'));var logger=require(_0x7e46('0x1'))('api');var moment=require(_0x7e46('0x2'));var BPromise=require(_0x7e46('0x3'));var rp=require(_0x7e46('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7e46('0x5'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0x7e46('0x6')]=function(_0x4d3767,_0x4c10a0){return _0x4d3767['define']('MailApplication',attributes,{'tableName':_0x7e46('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7e46('0x8'),'collate':_0x7e46('0x9')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index b1490c6..3f075a7 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 _0x311a=['http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','message','result','catch','update','options','raw','where','attributes','limit','UpdateMailApplication','stringify','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x387b44,_0x3ad1ba){var _0x55ff2d=function(_0x1f276d){while(--_0x1f276d){_0x387b44['push'](_0x387b44['shift']());}};_0x55ff2d(++_0x3ad1ba);}(_0x311a,0xfc));var _0xa311=function(_0x72d40f,_0xca7a66){_0x72d40f=_0x72d40f-0x0;var _0x2cb409=_0x311a[_0x72d40f];return _0x2cb409;};'use strict';var _=require(_0xa311('0x0'));var util=require(_0xa311('0x1'));var moment=require(_0xa311('0x2'));var BPromise=require(_0xa311('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa311('0x4'))['db'];var utils=require(_0xa311('0x5'));var logger=require(_0xa311('0x6'))(_0xa311('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa311('0x8')][_0xa311('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x370c2c,_0x4261a2,_0x210ab4){return new BPromise(function(_0x45a471,_0x137136){return client[_0xa311('0xa')](_0x370c2c,_0x210ab4)[_0xa311('0xb')](function(_0x1652c2){logger[_0xa311('0xc')](_0xa311('0xd'),_0x4261a2,_0xa311('0xe'));logger[_0xa311('0xf')](_0xa311('0x10'),_0x4261a2,'request\x20sent',JSON['stringify'](_0x1652c2));if(_0x1652c2[_0xa311('0x11')]){if(_0x1652c2[_0xa311('0x11')]['code']===0x1f4){logger[_0xa311('0x11')](_0xa311('0xd'),_0x4261a2,_0x1652c2[_0xa311('0x11')][_0xa311('0x12')]);return _0x137136(_0x1652c2[_0xa311('0x11')]['message']);}logger[_0xa311('0x11')]('MailApplication,\x20%s,\x20%s',_0x4261a2,_0x1652c2['error'][_0xa311('0x12')]);return _0x45a471(_0x1652c2[_0xa311('0x11')][_0xa311('0x12')]);}else{logger[_0xa311('0xc')](_0xa311('0xd'),_0x4261a2,'request\x20sent');_0x45a471(_0x1652c2[_0xa311('0x13')]['message']);}})[_0xa311('0x14')](function(_0x5a1a1a){logger[_0xa311('0x11')](_0xa311('0xd'),_0x4261a2,_0x5a1a1a);_0x137136(_0x5a1a1a);});});}exports['UpdateMailApplication']=function(_0x14f01b){var _0x4d9e07=this;return new Promise(function(_0x12ca6b,_0x4dac46){return db['MailApplication'][_0xa311('0x15')](_0x14f01b['body'],{'raw':_0x14f01b[_0xa311('0x16')]?_0x14f01b[_0xa311('0x16')][_0xa311('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14f01b[_0xa311('0x16')]?_0x14f01b[_0xa311('0x16')][_0xa311('0x18')]||null:null,'attributes':_0x14f01b[_0xa311('0x16')]?_0x14f01b['options'][_0xa311('0x19')]||null:null,'limit':_0x14f01b[_0xa311('0x16')]?_0x14f01b[_0xa311('0x16')][_0xa311('0x1a')]||null:null})['then'](function(_0x4bef1e){logger[_0xa311('0xc')]('UpdateMailApplication',_0x14f01b);logger[_0xa311('0xf')](_0xa311('0x1b'),_0x14f01b,JSON[_0xa311('0x1c')](_0x4bef1e));_0x12ca6b(_0x4bef1e);})[_0xa311('0x14')](function(_0x116e3f){logger[_0xa311('0x11')](_0xa311('0x1b'),_0x116e3f[_0xa311('0x12')],_0x14f01b);_0x4dac46(_0x4d9e07[_0xa311('0x11')](0x1f4,_0x116e3f[_0xa311('0x12')]));});});}; \ No newline at end of file +var _0x1b1d=['MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','MailApplication,\x20%s,\x20%s','message','result','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','limit','then','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','request\x20sent'];(function(_0x5585f5,_0x167771){var _0x3439c9=function(_0x207c3f){while(--_0x207c3f){_0x5585f5['push'](_0x5585f5['shift']());}};_0x3439c9(++_0x167771);}(_0x1b1d,0x16d));var _0xd1b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1b1d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd1b1('0x0'));var util=require(_0xd1b1('0x1'));var moment=require('moment');var BPromise=require(_0xd1b1('0x2'));var rs=require(_0xd1b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd1b1('0x4'))['db'];var utils=require(_0xd1b1('0x5'));var logger=require(_0xd1b1('0x6'))(_0xd1b1('0x7'));var config=require(_0xd1b1('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd1b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x187a82,_0x21ed78,_0xa957d4){return new BPromise(function(_0x17181e,_0x38d450){return client['request'](_0x187a82,_0xa957d4)['then'](function(_0xafed2){logger[_0xd1b1('0xa')]('MailApplication,\x20%s,\x20%s',_0x21ed78,_0xd1b1('0xb'));logger['debug'](_0xd1b1('0xc'),_0x21ed78,'request\x20sent',JSON[_0xd1b1('0xd')](_0xafed2));if(_0xafed2[_0xd1b1('0xe')]){if(_0xafed2['error']['code']===0x1f4){logger[_0xd1b1('0xe')](_0xd1b1('0xf'),_0x21ed78,_0xafed2[_0xd1b1('0xe')][_0xd1b1('0x10')]);return _0x38d450(_0xafed2[_0xd1b1('0xe')][_0xd1b1('0x10')]);}logger[_0xd1b1('0xe')]('MailApplication,\x20%s,\x20%s',_0x21ed78,_0xafed2['error'][_0xd1b1('0x10')]);return _0x17181e(_0xafed2[_0xd1b1('0xe')][_0xd1b1('0x10')]);}else{logger[_0xd1b1('0xa')](_0xd1b1('0xf'),_0x21ed78,'request\x20sent');_0x17181e(_0xafed2[_0xd1b1('0x11')][_0xd1b1('0x10')]);}})['catch'](function(_0x1c5a7b){logger[_0xd1b1('0xe')](_0xd1b1('0xf'),_0x21ed78,_0x1c5a7b);_0x38d450(_0x1c5a7b);});});}exports[_0xd1b1('0x12')]=function(_0x3fb4ad){var _0x440d0a=this;return new Promise(function(_0x2af5f1,_0x10f7dc){return db[_0xd1b1('0x13')][_0xd1b1('0x14')](_0x3fb4ad[_0xd1b1('0x15')],{'raw':_0x3fb4ad[_0xd1b1('0x16')]?_0x3fb4ad[_0xd1b1('0x16')][_0xd1b1('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fb4ad[_0xd1b1('0x16')]?_0x3fb4ad[_0xd1b1('0x16')][_0xd1b1('0x18')]||null:null,'attributes':_0x3fb4ad[_0xd1b1('0x16')]?_0x3fb4ad[_0xd1b1('0x16')][_0xd1b1('0x19')]||null:null,'limit':_0x3fb4ad['options']?_0x3fb4ad[_0xd1b1('0x16')][_0xd1b1('0x1a')]||null:null})[_0xd1b1('0x1b')](function(_0x28d483){logger[_0xd1b1('0xa')](_0xd1b1('0x12'),_0x3fb4ad);logger['debug'](_0xd1b1('0x12'),_0x3fb4ad,JSON['stringify'](_0x28d483));_0x2af5f1(_0x28d483);})[_0xd1b1('0x1c')](function(_0x3e4779){logger[_0xd1b1('0xe')](_0xd1b1('0x12'),_0x3e4779['message'],_0x3fb4ad);_0x10f7dc(_0x440d0a[_0xd1b1('0xe')](0x1f4,_0x3e4779[_0xd1b1('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 1e43738..38f8641 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 _0xb636=['exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','/describe','show','get','getMessages','/:id/download','download','create','post','/:id/tags','tracked','mailinteraction:addtags','addTags','put','/:id','mail','mailinteraction:destroy','delete','removeTags'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xb636,0x11f));var _0x6b63=function(_0x5bbcd6,_0x2e58b9){_0x5bbcd6=_0x5bbcd6-0x0;var _0x26a1b8=_0xb636[_0x5bbcd6];return _0x26a1b8;};'use strict';var express=require(_0x6b63('0x0'));var router=express[_0x6b63('0x1')]();var auth=require(_0x6b63('0x2'));var interaction=require(_0x6b63('0x3'));var controller=require(_0x6b63('0x4'));router['get']('/',auth[_0x6b63('0x5')](),controller[_0x6b63('0x6')]);router['get'](_0x6b63('0x7'),auth[_0x6b63('0x5')](),controller['describe']);router['get']('/:id',auth[_0x6b63('0x5')](),controller[_0x6b63('0x8')]);router[_0x6b63('0x9')]('/:id/messages',auth[_0x6b63('0x5')](),controller[_0x6b63('0xa')]);router[_0x6b63('0x9')](_0x6b63('0xb'),auth[_0x6b63('0x5')](),controller[_0x6b63('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6b63('0xd')]);router[_0x6b63('0xe')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0x6b63('0xe')](_0x6b63('0xf'),auth[_0x6b63('0x5')](),interaction[_0x6b63('0x10')]('mail',_0x6b63('0x11')),controller[_0x6b63('0x12')]);router[_0x6b63('0x13')](_0x6b63('0x14'),auth[_0x6b63('0x5')](),interaction[_0x6b63('0x10')](_0x6b63('0x15'),'mailinteraction:update'),controller['update']);router['delete']('/:id',auth[_0x6b63('0x5')](),interaction[_0x6b63('0x10')](_0x6b63('0x15'),_0x6b63('0x16')),controller['destroy']);router[_0x6b63('0x17')]('/:id/tags',auth[_0x6b63('0x5')](),controller[_0x6b63('0x18')]);module[_0x6b63('0x19')]=router; \ No newline at end of file +var _0xdd42=['/:id/download','download','create','addMessage','post','mailinteraction:addtags','put','/:id','tracked','mail','mailinteraction:update','update','delete','destroy','/:id/tags','exports','express','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','describe','show','/:id/messages','getMessages'];(function(_0x5c2b52,_0x4fa1bd){var _0x2819b0=function(_0x59ffca){while(--_0x59ffca){_0x5c2b52['push'](_0x5c2b52['shift']());}};_0x2819b0(++_0x4fa1bd);}(_0xdd42,0x139));var _0x2dd4=function(_0x3279e4,_0x5181a2){_0x3279e4=_0x3279e4-0x0;var _0x4849ed=_0xdd42[_0x3279e4];return _0x4849ed;};'use strict';var express=require(_0x2dd4('0x0'));var router=express['Router']();var auth=require(_0x2dd4('0x1'));var interaction=require(_0x2dd4('0x2'));var controller=require(_0x2dd4('0x3'));router[_0x2dd4('0x4')]('/',auth[_0x2dd4('0x5')](),controller[_0x2dd4('0x6')]);router['get']('/describe',auth[_0x2dd4('0x5')](),controller[_0x2dd4('0x7')]);router[_0x2dd4('0x4')]('/:id',auth[_0x2dd4('0x5')](),controller[_0x2dd4('0x8')]);router['get'](_0x2dd4('0x9'),auth['isAuthenticated'](),controller[_0x2dd4('0xa')]);router[_0x2dd4('0x4')](_0x2dd4('0xb'),auth[_0x2dd4('0x5')](),controller[_0x2dd4('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2dd4('0xd')]);router['post'](_0x2dd4('0x9'),auth[_0x2dd4('0x5')](),controller[_0x2dd4('0xe')]);router[_0x2dd4('0xf')]('/:id/tags',auth[_0x2dd4('0x5')](),interaction['tracked']('mail',_0x2dd4('0x10')),controller['addTags']);router[_0x2dd4('0x11')](_0x2dd4('0x12'),auth['isAuthenticated'](),interaction[_0x2dd4('0x13')](_0x2dd4('0x14'),_0x2dd4('0x15')),controller[_0x2dd4('0x16')]);router[_0x2dd4('0x17')](_0x2dd4('0x12'),auth[_0x2dd4('0x5')](),interaction[_0x2dd4('0x13')](_0x2dd4('0x14'),'mailinteraction:destroy'),controller[_0x2dd4('0x18')]);router[_0x2dd4('0x17')](_0x2dd4('0x19'),auth[_0x2dd4('0x5')](),controller['removeTags']);module[_0x2dd4('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index b0e7cf9..2ec2160 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 _0x04a7=['BOOLEAN','ENUM','out','iconv','exports','DATE','STRING','long'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x04a7,0xa3));var _0x704a=function(_0x46f3f8,_0x12c74b){_0x46f3f8=_0x46f3f8-0x0;var _0xbc57cd=_0x04a7[_0x46f3f8];return _0xbc57cd;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x704a('0x0'));module[_0x704a('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x704a('0x2')]},'disposition':{'type':Sequelize[_0x704a('0x3')]},'secondDisposition':{'type':Sequelize[_0x704a('0x3')]},'thirdDisposition':{'type':Sequelize[_0x704a('0x3')]},'note':{'type':Sequelize[_0x704a('0x3')]},'inReplyTo':{'type':Sequelize[_0x704a('0x3')](0x1fe)},'to':{'type':Sequelize[_0x704a('0x3')]},'cc':{'type':Sequelize['TEXT'](_0x704a('0x4'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x704a('0x5')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x704a('0x2')]},'substatus':{'type':Sequelize[_0x704a('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x704a('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x704a('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x704a('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x704a('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0xa1cc=['long','DATE','out','sequelize','iconv','exports','BOOLEAN','STRING','TEXT'];(function(_0xad61ea,_0x31b34a){var _0x3e56f7=function(_0x2887b8){while(--_0x2887b8){_0xad61ea['push'](_0xad61ea['shift']());}};_0x3e56f7(++_0x31b34a);}(_0xa1cc,0x93));var _0xca1c=function(_0x56fc02,_0x5b0ffe){_0x56fc02=_0x56fc02-0x0;var _0x4b295e=_0xa1cc[_0x56fc02];return _0x4b295e;};'use strict';var Sequelize=require(_0xca1c('0x0'));var iconv=require(_0xca1c('0x1'));module[_0xca1c('0x2')]={'closed':{'type':Sequelize[_0xca1c('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xca1c('0x4')]},'thirdDisposition':{'type':Sequelize[_0xca1c('0x4')]},'note':{'type':Sequelize[_0xca1c('0x4')]},'inReplyTo':{'type':Sequelize[_0xca1c('0x4')](0x1fe)},'to':{'type':Sequelize[_0xca1c('0x4')]},'cc':{'type':Sequelize[_0xca1c('0x5')](_0xca1c('0x6'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0xca1c('0x7')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xca1c('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xca1c('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 68daf2d..d34e67e 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 _0x7e96=['color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','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','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','search','sqlOperator','length','find','unreadMessages','value','having','`\x20=\x200','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','type','start','Tag','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','text','some','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','i.id\x20LIKE\x20?','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','QueryTypes','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','isEmpty','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','MailAccountId','sequelize','toString','merge','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.closed','i.closedAt','i.attach','i.lastMsgDirection','i.subject','i.disposition','i.thirdDisposition','i.substatus','i.ContactId','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.MailInteractionId\x20IN\x20?','groupBy','Setting','enableEmailPreview','rows','params','rawAttributes','includeAll','include','options','create','body','describe','addMessage','ids','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','true','addTags','setTags','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','Attachment','Messages','bcc','get','mkdirSync','subject','decode','Bcc','Attachments','basename','existsSync','readFileSync','unlinkSync','eml-format','rimraf','moment','bluebird','util','path','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','end','error','stack','Users','map','fullname','TagIds','Tags','split','forEach','push','MailMessage','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','index','MailInteraction','fieldName','key','name','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field'];(function(_0x3b77ee,_0x4d2502){var _0x42a67c=function(_0x5f20ea){while(--_0x5f20ea){_0x3b77ee['push'](_0x3b77ee['shift']());}};_0x42a67c(++_0x4d2502);}(_0x7e96,0x179));var _0x67e9=function(_0x3273fe,_0x11b399){_0x3273fe=_0x3273fe-0x0;var _0x21e02b=_0x7e96[_0x3273fe];return _0x21e02b;};'use strict';var emlformat=require(_0x67e9('0x0'));var rimraf=require(_0x67e9('0x1'));var zipdir=require('zip-dir');var moment=require(_0x67e9('0x2'));var BPromise=require(_0x67e9('0x3'));var util=require(_0x67e9('0x4'));var path=require(_0x67e9('0x5'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var juice=require('juice');var Redis=require(_0x67e9('0x6'));var qs=require(_0x67e9('0x7'));var as=require(_0x67e9('0x8'));var logger=require(_0x67e9('0x9'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var htmlEntities=require('html-entities');config[_0x67e9('0xa')]=_[_0x67e9('0xb')](config[_0x67e9('0xa')],{'host':_0x67e9('0xc'),'port':0x18eb});var socket=require(_0x67e9('0xd'))(new Redis(config[_0x67e9('0xa')]));require(_0x67e9('0xe'))[_0x67e9('0xf')](socket);function respondWithStatusCode(_0x4f9e44,_0x578b5b){_0x578b5b=_0x578b5b||0xcc;return function(_0x2b4c1d){if(_0x2b4c1d){return _0x4f9e44[_0x67e9('0x10')](_0x578b5b);}return _0x4f9e44[_0x67e9('0x11')](_0x578b5b)['end']();};}function respondWithResult(_0x4b7d64,_0x1097ca){_0x1097ca=_0x1097ca||0xc8;return function(_0x29386b){if(_0x29386b){return _0x4b7d64[_0x67e9('0x11')](_0x1097ca)[_0x67e9('0x12')](_0x29386b);}};}function respondWithFilteredResult(_0x249f0b,_0x44b080){return function(_0xf4b9dc){if(_0xf4b9dc){var _0x366a80=typeof _0x44b080['offset']===_0x67e9('0x13')&&typeof _0x44b080[_0x67e9('0x14')]===_0x67e9('0x13');var _0x489bcb=_0xf4b9dc[_0x67e9('0x15')];var _0x53bc9c=_0x366a80?0x0:_0x44b080[_0x67e9('0x16')];var _0x3de7d8=_0x366a80?_0xf4b9dc[_0x67e9('0x15')]:_0x44b080['offset']+_0x44b080[_0x67e9('0x14')];var _0x5dd3ea;if(_0x3de7d8>=_0x489bcb){_0x3de7d8=_0x489bcb;_0x5dd3ea=0xc8;}else{_0x5dd3ea=0xce;}_0x249f0b[_0x67e9('0x11')](_0x5dd3ea);return _0x249f0b[_0x67e9('0x17')](_0x67e9('0x18'),_0x53bc9c+'-'+_0x3de7d8+'/'+_0x489bcb)[_0x67e9('0x12')](_0xf4b9dc);}return null;};}function saveUpdates(_0x4fa5a9){return function(_0x989586){if(_0x989586){return _0x989586[_0x67e9('0x19')](_0x4fa5a9)[_0x67e9('0x1a')](function(_0x5ea0bc){return _0x5ea0bc;});}return null;};}function removeEntity(_0x384f90){return function(_0x4b26d8){if(_0x4b26d8){return _0x4b26d8[_0x67e9('0x1b')]()['then'](function(){_0x384f90['status'](0xcc)[_0x67e9('0x1c')]();});}};}function handleEntityNotFound(_0x40582c){return function(_0x731e4f){if(!_0x731e4f){_0x40582c[_0x67e9('0x10')](0x194);}return _0x731e4f;};}function handleError(_0x29fbbe,_0x335555){_0x335555=_0x335555||0x1f4;return function(_0x318c3d){logger[_0x67e9('0x1d')](_0x318c3d[_0x67e9('0x1e')]);if(_0x318c3d['name']){delete _0x318c3d['name'];}_0x29fbbe['status'](_0x335555)['send'](_0x318c3d);};}function getInteractionUsers(_0x2000bf,_0x41b51d){return new BPromise(function(_0x40afbf,_0x4eb72a){try{if(_0x41b51d[_0x2000bf['id']]){_0x2000bf[_0x67e9('0x1f')]=_[_0x67e9('0x20')](_0x41b51d[_0x2000bf['id']],function(_0x3e9c0c){return{'id':_0x3e9c0c['id'],'fullname':_0x3e9c0c[_0x67e9('0x21')]};});}}catch(_0x1be666){_0x4eb72a(_0x1be666);}_0x40afbf(_0x2000bf);});}function getInteractionTags(_0x18a875,_0x635598){return new BPromise(function(_0x28b2d4,_0x4079ef){try{if(_0x18a875[_0x67e9('0x22')]){_0x18a875[_0x67e9('0x23')]=[];_0x18a875[_0x67e9('0x22')][_0x67e9('0x24')](',')[_0x67e9('0x25')](function(_0x32316d){_0x18a875['Tags'][_0x67e9('0x26')](_0x635598[_0x32316d]);});}delete _0x18a875[_0x67e9('0x22')];}catch(_0x10bdde){_0x4079ef(_0x10bdde);}_0x28b2d4(_0x18a875);});}function getLastMessageText(_0x38584a){return new BPromise(function(_0x5c4a23,_0x519bdf){return db[_0x67e9('0x27')][_0x67e9('0x28')]({'where':{'$and':[{'MailInteractionId':_0x38584a['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x67e9('0x29')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x67e9('0x2a')],'order':_0x67e9('0x2b'),'raw':!![]})[_0x67e9('0x1a')](function(_0x5b75df){if(_0x5b75df&&_0x5b75df[_0x67e9('0x2a')]){_0x38584a[_0x67e9('0x2c')]=_[_0x67e9('0x2d')](_0x5b75df[_0x67e9('0x2a')]);}_0x5c4a23(_0x38584a);})[_0x67e9('0x2e')](function(_0x1a300b){_0x519bdf(_0x1a300b);});});}function updateMailInteraction(_0x1ee544,_0x4fd44c,_0x53cde9,_0x37502c){return new BPromise(function(_0x1ba166,_0x4d4ddd){return getInteractionUsers(_0x1ee544,_0x53cde9)[_0x67e9('0x1a')](function(_0x3de92d){return getInteractionTags(_0x3de92d,_0x4fd44c);})[_0x67e9('0x1a')](function(_0x1f26d3){if(_0x37502c){_0x1ba166(getLastMessageText(_0x1f26d3));}else{_0x1ba166(_0x1f26d3);}})[_0x67e9('0x2e')](function(_0x15b178){_0x4d4ddd(_0x15b178);});});}exports[_0x67e9('0x2f')]=function(_0x15b632,_0x20e71d){var _0x279d43={},_0x4fed0d={},_0x51ae82={'count':0x0,'rows':[]};var _0x1d635c=_[_0x67e9('0x20')](db[_0x67e9('0x30')]['rawAttributes'],function(_0x1bd763){return{'name':_0x1bd763[_0x67e9('0x31')],'type':_0x1bd763['type'][_0x67e9('0x32')]};});_0x4fed0d['model']=_[_0x67e9('0x20')](_0x1d635c,_0x67e9('0x33'));_0x4fed0d[_0x67e9('0x34')]=_[_0x67e9('0x35')](_0x15b632['query']);_0x4fed0d[_0x67e9('0x36')]=_[_0x67e9('0x37')](_0x4fed0d['model'],_0x4fed0d['query']);_0x279d43[_0x67e9('0x38')]=_[_0x67e9('0x37')](_0x4fed0d[_0x67e9('0x39')],qs[_0x67e9('0x3a')](_0x15b632[_0x67e9('0x34')][_0x67e9('0x3a')]));_0x279d43['attributes']=_0x279d43[_0x67e9('0x38')]['length']?_0x279d43[_0x67e9('0x38')]:_0x4fed0d[_0x67e9('0x39')];if(!_0x15b632[_0x67e9('0x34')][_0x67e9('0x3b')](_0x67e9('0x3c'))){_0x279d43['limit']=qs[_0x67e9('0x14')](_0x15b632[_0x67e9('0x34')][_0x67e9('0x14')]);_0x279d43['offset']=qs[_0x67e9('0x16')](_0x15b632[_0x67e9('0x34')][_0x67e9('0x16')]);}_0x279d43[_0x67e9('0x3d')]=qs['sort'](_0x15b632[_0x67e9('0x34')][_0x67e9('0x3e')]);_0x279d43[_0x67e9('0x3f')]=qs[_0x67e9('0x36')](_[_0x67e9('0x40')](_0x15b632[_0x67e9('0x34')],_0x4fed0d[_0x67e9('0x36')]),_0x1d635c);var _0x1e489f=[];var _0x2e8b54=squel[_0x67e9('0x41')]()[_0x67e9('0x42')]('id')[_0x67e9('0x42')](_0x67e9('0x33'))['field'](_0x67e9('0x43'))[_0x67e9('0x44')](_0x67e9('0x45'));var _0x405600=squel[_0x67e9('0x41')]()[_0x67e9('0x42')](_0x67e9('0x46'))[_0x67e9('0x42')](_0x67e9('0x47'))['field'](_0x67e9('0x48'))[_0x67e9('0x44')]('user_has_mail_interactions','ui')[_0x67e9('0x49')](_0x67e9('0x4a'),'u','u.id\x20=\x20ui.UserId');var _0x584662=squel[_0x67e9('0x41')]()[_0x67e9('0x44')](_0x67e9('0x4b'),'i')[_0x67e9('0x49')](_0x67e9('0x4c'),'c',_0x67e9('0x4d'))['left_join'](_0x67e9('0x4a'),'o',_0x67e9('0x4e'))[_0x67e9('0x49')](_0x67e9('0x4f'),'a',_0x67e9('0x50'))[_0x67e9('0x49')](_0x67e9('0x51'),'me',_0x67e9('0x52'))[_0x67e9('0x49')]('mail_interaction_has_tags','it',_0x67e9('0x53'))[_0x67e9('0x49')](_0x67e9('0x45'),'t',_0x67e9('0x54'));var _0xe3e2ab=squel['expr']();var _0xee9e90=[];var _0xe82aad=squel['expr']();var _0x2d1039;if(_0x15b632['query'][_0x67e9('0x55')]){_0x2d1039=as['parseSearch'](_0x15b632['query'][_0x67e9('0x55')]);var _0x16b564=_0x2d1039[_0x67e9('0x56')];for(var _0x47324a=0x0;_0x47324a<_0x2d1039['conditions'][_0x67e9('0x57')];_0x47324a++){var _0x25f29f=_0x2d1039['conditions'][_0x47324a];var _0x48710b='i';var _0x4592f2=_[_0x67e9('0x58')](_0x1d635c,[_0x67e9('0x33'),_0x25f29f[_0x67e9('0x42')]]);if(!_0x4592f2){switch(_0x25f29f[_0x67e9('0x42')]){case _0x67e9('0x59'):if(_0x25f29f[_0x67e9('0x5a')]==0x1){_0x584662[_0x67e9('0x5b')]('`'+_0x25f29f[_0x67e9('0x42')]+_0x67e9('0x5c'));}else{_0x584662[_0x67e9('0x5b')]('`'+_0x25f29f[_0x67e9('0x42')]+'`\x20>\x200');}break;case'Contact':if(_0x25f29f[_0x67e9('0x5d')]===_0x67e9('0x5e')){if(_0x25f29f[_0x67e9('0x5a')][_0x67e9('0x24')]('\x20')[_0x67e9('0x57')]>0x1){_0xe3e2ab[_0x16b564]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x67e9('0x5f')](_0x25f29f[_0x67e9('0x5a')]),null);}else{var _0x2b0546='%'+_0x25f29f[_0x67e9('0x5a')]+'%';_0xe3e2ab[_0x16b564](_0x67e9('0x60'),_0x2b0546,_0x2b0546,_0x2b0546);}}else{_0x4592f2=_[_0x67e9('0x58')](_0x1d635c,['name','ContactId']);_0x25f29f[_0x67e9('0x42')]='ContactId';_0xbc582e=as['buildExpression'](_0x48710b,_0x4592f2[_0x67e9('0x61')],_0x25f29f);_0xe3e2ab[_0x16b564](_0xbc582e['text'],_0xbc582e[_0x67e9('0x5a')][_0x67e9('0x62')],_0xbc582e[_0x67e9('0x5a')]['end']);}break;case _0x67e9('0x63'):var _0x3f039f=_0x25f29f[_0x67e9('0x5a')]['split'](',')[_0x67e9('0x20')](function(_0x463689){return Number(_0x463689);});_0x3f039f['forEach'](function(_0x4277eb){_0xe82aad['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4277eb+',%');});_0xee9e90=_[_0x67e9('0x64')](_0xee9e90,_0x3f039f);break;case'User':if(_0x25f29f[_0x67e9('0x5d')]===_0x67e9('0x5e')){_0xe3e2ab[_0x16b564](_0x67e9('0x65'),'%'+_0x25f29f['value']+'%',null);}else{_0x4592f2=_['find'](_0x1d635c,[_0x67e9('0x33'),_0x67e9('0x66')]);_0x25f29f[_0x67e9('0x42')]=_0x67e9('0x66');_0xbc582e=as[_0x67e9('0x67')](_0x48710b,_0x4592f2[_0x67e9('0x61')],_0x25f29f);_0xe3e2ab[_0x16b564](_0xbc582e[_0x67e9('0x68')],_0xbc582e[_0x67e9('0x5a')][_0x67e9('0x62')],_0xbc582e[_0x67e9('0x5a')]['end']);}break;case _0x67e9('0x2a'):_0xbc582e=as['buildExpression']('me',null,_0x25f29f);_0xe3e2ab[_0x16b564](_0xbc582e[_0x67e9('0x68')],_0xbc582e[_0x67e9('0x5a')][_0x67e9('0x62')],_0xbc582e['value'][_0x67e9('0x1c')]);break;}}else{var _0xbc582e=as[_0x67e9('0x67')](_0x48710b,_0x4592f2[_0x67e9('0x61')],_0x25f29f);_0xe3e2ab[_0x16b564](_0xbc582e[_0x67e9('0x68')],_0xbc582e[_0x67e9('0x5a')][_0x67e9('0x62')],_0xbc582e[_0x67e9('0x5a')]['end']);}}}else{var _0x220dbd=_(_0x15b632[_0x67e9('0x34')])[_0x67e9('0x35')]()[_0x67e9('0x20')](function(_0x2d169b){return _[_0x67e9('0x69')](_0x1d635c,[_0x67e9('0x33'),_0x2d169b])?_0x2d169b:undefined;})['compact']()[_0x67e9('0x5a')]();if(!_['isEmpty'](_0x220dbd)){_0x220dbd[_0x67e9('0x25')](function(_0x4cfaa0){if(_0x4cfaa0==='MailAccountId'){_0x584662[_0x67e9('0x3f')](_0x67e9('0x6a'),[][_0x67e9('0x6b')](_0x15b632[_0x67e9('0x34')][_0x4cfaa0]));}else if(_0x4cfaa0===_0x67e9('0x6c')){var _0x2fc05b=JSON[_0x67e9('0x6d')](_0x15b632[_0x67e9('0x34')][_0x4cfaa0])[_0x67e9('0x6e')];var _0x450276=JSON['parse'](_0x15b632[_0x67e9('0x34')][_0x4cfaa0])[_0x67e9('0x6f')];_0x584662[_0x67e9('0x3f')](_0x67e9('0x70'),_0x2fc05b,_0x450276);}else{if(_0x15b632['query'][_0x4cfaa0]===_0x67e9('0x71')){_0x584662[_0x67e9('0x3f')]('i.'+_0x4cfaa0+_0x67e9('0x72'));}else{_0x584662[_0x67e9('0x3f')]('i.'+_0x4cfaa0+_0x67e9('0x73'),_0x15b632[_0x67e9('0x34')][_0x4cfaa0]);}}});}if(_0x15b632[_0x67e9('0x34')][_0x67e9('0x74')]){if(_0x15b632[_0x67e9('0x34')][_0x67e9('0x74')]==0x1){_0x584662[_0x67e9('0x5b')]('`unreadMessages`\x20=\x200');}else{_0x584662['having'](_0x67e9('0x75'));}}if(_0x15b632[_0x67e9('0x34')][_0x67e9('0x76')]){_0xee9e90=_[_0x67e9('0x77')](_0x15b632[_0x67e9('0x34')][_0x67e9('0x76')])?_0x15b632['query']['tag']:new Array(_0x15b632[_0x67e9('0x34')][_0x67e9('0x76')]);_0xee9e90[_0x67e9('0x25')](function(_0x3e2436){_0xe82aad['or'](_0x67e9('0x78'),'%,'+_0x3e2436+',%');});}if(_0x15b632['query'][_0x67e9('0x79')]){var _0x11d51c=_0x15b632[_0x67e9('0x34')][_0x67e9('0x79')][_0x67e9('0x7a')]('\x5c','\x5c\x5c')[_0x67e9('0x7a')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x11d51c)){_0xe3e2ab['or'](_0x67e9('0x7b'),_0x11d51c+'%');}else if(qs[_0x67e9('0x7c')](_0x11d51c)){_0xe3e2ab['or'](_0x67e9('0x7d'),_0x11d51c+'%');}else{_0xe3e2ab['or'](_0x67e9('0x7e'),qs['getFullTextValue'](_0x11d51c))['or'](_0x67e9('0x7f'),qs[_0x67e9('0x5f')](_0x11d51c));}}}_0x584662[_0x67e9('0x3f')](_0xe3e2ab);_0x584662[_0x67e9('0x80')]('i.id');var _0xc062a3={'type':db['Sequelize'][_0x67e9('0x81')]['SELECT'],'raw':!![]};var _0x3daf24=_0x584662[_0x67e9('0x82')]();_0x3daf24[_0x67e9('0x42')](_0x67e9('0x83'));_0x3daf24[_0x67e9('0x42')](_0x67e9('0x84'),_0x67e9('0x59'));if(_0x279d43[_0x67e9('0x3d')]){_0x279d43[_0x67e9('0x3d')][_0x67e9('0x25')](function(_0x36cb41){var _0x4debde=_0x36cb41[0x0]===_0x67e9('0x85')?_0x36cb41[0x0]:'i.'+_0x36cb41[0x0];_0x584662['order'](_0x4debde,_0x36cb41[0x1]==='DESC'?![]:!![]);});}if(!_[_0x67e9('0x86')](_0xee9e90)){_0x584662['having'](_0xe82aad);_0x3daf24[_0x67e9('0x3f')](_0x67e9('0x87'),_0xee9e90);}BPromise[_0x67e9('0x88')]()[_0x67e9('0x1a')](function(){if(!_0x2d1039){if(_0x15b632[_0x67e9('0x34')]['MailAccountId'])return;_0x3daf24['where'](_0x67e9('0x89'));_0x584662['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x15b632[_0x67e9('0x8a')][_0x67e9('0x8b')]!==_0x67e9('0x8c'))return;return _0x15b632['user'][_0x67e9('0x8d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1171f5){if(_[_0x67e9('0x86')](_0x1171f5)){_0x3daf24[_0x67e9('0x3f')](_0x67e9('0x8e'));_0x584662[_0x67e9('0x3f')](_0x67e9('0x8e'));}else{_0x3daf24[_0x67e9('0x3f')](_0x67e9('0x6a'),_['map'](_0x1171f5,'id'));_0x584662[_0x67e9('0x3f')](_0x67e9('0x6a'),_[_0x67e9('0x20')](_0x1171f5,'id'));}});})['then'](function(){if(_0x15b632['user'][_0x67e9('0x8b')]===_0x67e9('0x8c')&&!_0x2d1039&&!_0x15b632['query'][_0x67e9('0x8f')])return[];return db[_0x67e9('0x90')][_0x67e9('0x34')](_0x3daf24['toString'](),_0xc062a3);})[_0x67e9('0x1a')](function(_0x240124){_0x51ae82[_0x67e9('0x15')]=_0x240124[_0x67e9('0x57')];if(_0x51ae82[_0x67e9('0x15')]===0x0)return[];return db[_0x67e9('0x90')][_0x67e9('0x34')](_0x2e8b54[_0x67e9('0x91')](),_0xc062a3)[_0x67e9('0x1a')](function(_0x573ef1){_0x1e489f=_['keyBy'](_0x573ef1,'id');_0xc062a3=_[_0x67e9('0x92')](_0xc062a3,{'model':db[_0x67e9('0x30')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x15b632['query'][_0x67e9('0x3a')]){_0x279d43[_0x67e9('0x38')][_0x67e9('0x25')](function(_0x2fabd6){_0x584662['field']('i.'+_0x2fabd6);});}else{_0x584662[_0x67e9('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x67e9('0x59'));_0x584662[_0x67e9('0x42')](_0x67e9('0x93'),_0x67e9('0x94'));_0x584662['field'](_0x67e9('0x95'),_0x67e9('0x96'));_0x584662[_0x67e9('0x42')](_0x67e9('0x97'),_0x67e9('0x85'));_0x584662[_0x67e9('0x42')](_0x67e9('0x83'));_0x584662['field']('i.createdAt');_0x584662[_0x67e9('0x42')]('i.updatedAt');_0x584662[_0x67e9('0x42')](_0x67e9('0x98'));_0x584662[_0x67e9('0x42')](_0x67e9('0x99'));_0x584662['field'](_0x67e9('0x9a'));_0x584662['field']('i.lastMsgAt');_0x584662[_0x67e9('0x42')](_0x67e9('0x9b'));_0x584662[_0x67e9('0x42')](_0x67e9('0x9c'));_0x584662[_0x67e9('0x42')](_0x67e9('0x9d'));_0x584662[_0x67e9('0x42')]('i.secondDisposition');_0x584662[_0x67e9('0x42')](_0x67e9('0x9e'));_0x584662[_0x67e9('0x42')](_0x67e9('0x9f'));_0x584662[_0x67e9('0x42')]('i.to');_0x584662['field'](_0x67e9('0xa0'));_0x584662[_0x67e9('0x42')]('i.MailAccountId');_0x584662[_0x67e9('0x42')]('i.UserId');_0x584662[_0x67e9('0x42')]('c.firstName',_0x67e9('0xa1'));_0x584662[_0x67e9('0x42')](_0x67e9('0xa2'),_0x67e9('0xa3'));_0x584662[_0x67e9('0x42')]('c.email',_0x67e9('0xa4'));_0x584662[_0x67e9('0x42')](_0x67e9('0xa5'),_0x67e9('0xa6'));_0x584662[_0x67e9('0x42')](_0x67e9('0xa7'),_0x67e9('0xa8'));_0x584662[_0x67e9('0x42')](_0x67e9('0xa9'),_0x67e9('0xaa'));_0x584662[_0x67e9('0x42')](_0x67e9('0xab'),_0x67e9('0xac'));_0x584662['field'](_0x67e9('0xad'),'Owner.internal');_0x584662[_0x67e9('0x42')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x67e9('0x22'));}if(_0x279d43[_0x67e9('0x14')])_0x584662['limit'](_0x279d43[_0x67e9('0x14')]);if(_0x279d43[_0x67e9('0x16')])_0x584662[_0x67e9('0x16')](_0x279d43[_0x67e9('0x16')]);return db[_0x67e9('0x90')][_0x67e9('0x34')](_0x584662[_0x67e9('0x91')](),_0xc062a3);})[_0x67e9('0x1a')](function(_0x1c8ef6){if(_0x1c8ef6[_0x67e9('0x57')]>0x0)_0x405600[_0x67e9('0x3f')](_0x67e9('0xae'),_[_0x67e9('0x20')](_0x1c8ef6,'id'));return db[_0x67e9('0x90')][_0x67e9('0x34')](_0x405600[_0x67e9('0x91')](),_0xc062a3)[_0x67e9('0x1a')](function(_0x5d1212){var _0x21392e=_[_0x67e9('0xaf')](_0x5d1212,'MailInteractionId');var _0x2409c4=[];return db[_0x67e9('0xb0')][_0x67e9('0x28')]({'attributes':[_0x67e9('0xb1')],'raw':!![]})['then'](function(_0x25ab9e){var _0x4ac764=_0x25ab9e[_0x67e9('0xb1')];_0x1c8ef6[_0x67e9('0x25')](function(_0x504920){_0x2409c4[_0x67e9('0x26')](updateMailInteraction(_0x504920,_0x1e489f,_0x21392e,_0x4ac764));});return BPromise['all'](_0x2409c4);});});});})['then'](function(_0x38f80f){_0x51ae82[_0x67e9('0xb2')]=_0x38f80f;return _0x51ae82;})[_0x67e9('0x1a')](respondWithFilteredResult(_0x20e71d,_0x279d43))[_0x67e9('0x2e')](handleError(_0x20e71d,null));};exports['show']=function(_0x318a17,_0x282877){var _0x2b1a7a={'raw':![],'where':{'id':_0x318a17[_0x67e9('0xb3')]['id']}},_0x14673b={};_0x14673b['model']=_['keys'](db[_0x67e9('0x30')][_0x67e9('0xb4')]);_0x14673b[_0x67e9('0x34')]=_[_0x67e9('0x35')](_0x318a17[_0x67e9('0x34')]);_0x14673b[_0x67e9('0x36')]=_[_0x67e9('0x37')](_0x14673b[_0x67e9('0x39')],_0x14673b[_0x67e9('0x34')]);_0x2b1a7a[_0x67e9('0x38')]=_[_0x67e9('0x37')](_0x14673b[_0x67e9('0x39')],qs[_0x67e9('0x3a')](_0x318a17[_0x67e9('0x34')]['fields']));_0x2b1a7a[_0x67e9('0x38')]=_0x2b1a7a[_0x67e9('0x38')]['length']?_0x2b1a7a[_0x67e9('0x38')]:_0x14673b[_0x67e9('0x39')];if(_0x318a17[_0x67e9('0x34')][_0x67e9('0xb5')]){_0x2b1a7a[_0x67e9('0xb6')]=[{'all':!![]}];}_0x2b1a7a=_[_0x67e9('0x92')]({},_0x2b1a7a,_0x318a17[_0x67e9('0xb7')]);return db[_0x67e9('0x30')]['find'](_0x2b1a7a)[_0x67e9('0x1a')](handleEntityNotFound(_0x282877,null))['then'](respondWithResult(_0x282877,null))['catch'](handleError(_0x282877,null));};exports[_0x67e9('0xb8')]=function(_0x2b1412,_0x4fb24a){return db['MailInteraction']['create'](_0x2b1412[_0x67e9('0xb9')],{})[_0x67e9('0x1a')](respondWithResult(_0x4fb24a,0xc9))[_0x67e9('0x2e')](handleError(_0x4fb24a,null));};exports[_0x67e9('0x19')]=function(_0x8e42a0,_0x36cc6a){if(_0x8e42a0[_0x67e9('0xb9')]['id']){delete _0x8e42a0['body']['id'];}return db[_0x67e9('0x30')][_0x67e9('0x58')]({'where':{'id':_0x8e42a0[_0x67e9('0xb3')]['id']}})['then'](handleEntityNotFound(_0x36cc6a,null))[_0x67e9('0x1a')](saveUpdates(_0x8e42a0[_0x67e9('0xb9')],null))[_0x67e9('0x1a')](respondWithResult(_0x36cc6a,null))[_0x67e9('0x2e')](handleError(_0x36cc6a,null));};exports[_0x67e9('0x1b')]=function(_0x341dde,_0x57e76e){return db['MailInteraction'][_0x67e9('0x58')]({'where':{'id':_0x341dde['params']['id']}})[_0x67e9('0x1a')](handleEntityNotFound(_0x57e76e,null))[_0x67e9('0x1a')](removeEntity(_0x57e76e,null))[_0x67e9('0x2e')](handleError(_0x57e76e,null));};exports[_0x67e9('0xba')]=function(_0x48fbfe,_0x125990){return db['MailInteraction'][_0x67e9('0xba')]()[_0x67e9('0x1a')](respondWithResult(_0x125990,null))[_0x67e9('0x2e')](handleError(_0x125990,null));};exports[_0x67e9('0xbb')]=function(_0x2a64b5,_0x1e6226){return db[_0x67e9('0x27')]['find']({'where':{'id':_0x2a64b5[_0x67e9('0xb3')]['id']}})[_0x67e9('0x1a')](handleEntityNotFound(_0x1e6226,null))[_0x67e9('0x1a')](function(_0x3b8416){if(_0x3b8416){return _0x3b8416[_0x67e9('0xbb')](_0x2a64b5[_0x67e9('0xb9')][_0x67e9('0xbc')],_['omit'](_0x2a64b5[_0x67e9('0xb9')],[_0x67e9('0xbc'),'id'])||{});}})[_0x67e9('0x1a')](respondWithResult(_0x1e6226,null))[_0x67e9('0x2e')](handleError(_0x1e6226,null));};exports['getMessages']=function(_0x4a5178,_0xf2c47f){var _0x34efa6={'raw':![],'where':{}};var _0x2f3709={};var _0x514305={'count':0x0,'rows':[]};return db[_0x67e9('0x30')][_0x67e9('0x28')]({'where':{'id':_0x4a5178[_0x67e9('0xb3')]['id']}})['then'](handleEntityNotFound(_0xf2c47f,null))[_0x67e9('0x1a')](function(_0x3c72fb){if(_0x3c72fb){_0x2f3709[_0x67e9('0x39')]=_[_0x67e9('0x35')](db[_0x67e9('0x27')][_0x67e9('0xb4')]);_0x2f3709[_0x67e9('0x34')]=_[_0x67e9('0x35')](_0x4a5178[_0x67e9('0x34')]);_0x2f3709[_0x67e9('0x36')]=_[_0x67e9('0x37')](_0x2f3709[_0x67e9('0x39')],_0x2f3709['query']);_0x34efa6[_0x67e9('0x38')]=_[_0x67e9('0x37')](_0x2f3709[_0x67e9('0x39')],qs[_0x67e9('0x3a')](_0x4a5178[_0x67e9('0x34')][_0x67e9('0x3a')]));_0x34efa6[_0x67e9('0x38')]=_0x34efa6[_0x67e9('0x38')][_0x67e9('0x57')]?_0x34efa6['attributes']:_0x2f3709[_0x67e9('0x39')];if(!_0x4a5178[_0x67e9('0x34')][_0x67e9('0x3b')](_0x67e9('0x3c'))){_0x34efa6[_0x67e9('0x14')]=qs[_0x67e9('0x14')](_0x4a5178['query'][_0x67e9('0x14')]);_0x34efa6['offset']=qs[_0x67e9('0x16')](_0x4a5178['query'][_0x67e9('0x16')]);}_0x34efa6[_0x67e9('0x3d')]=qs[_0x67e9('0x3e')](_0x4a5178[_0x67e9('0x34')][_0x67e9('0x3e')]);_0x34efa6[_0x67e9('0x3f')]=qs['filters'](_['pick'](_0x4a5178[_0x67e9('0x34')],_0x2f3709[_0x67e9('0x36')]));_0x34efa6['where'][_0x67e9('0xbd')]=_0x3c72fb['id'];if(_0x4a5178[_0x67e9('0x34')][_0x67e9('0x79')]){_0x34efa6[_0x67e9('0x3f')]=_['merge'](_0x34efa6['where'],{'$or':_[_0x67e9('0x20')](_0x34efa6['attributes'],function(_0xecc303){var _0x4b9432={};_0x4b9432[_0xecc303]={'$like':'%'+_0x4a5178[_0x67e9('0x34')][_0x67e9('0x79')]+'%'};return _0x4b9432;})});}if(_0x4a5178[_0x67e9('0x34')][_0x67e9('0x6e')]){var _0x13aaf1=_0x4a5178[_0x67e9('0x34')][_0x67e9('0x6e')][_0x67e9('0x24')](',');var _0x595858={};_0x595858[_0x13aaf1[0x0]]={'$gte':moment(_0x13aaf1[0x1])[_0x67e9('0xbe')](_0x67e9('0xbf'))};_0x34efa6[_0x67e9('0x3f')]=_[_0x67e9('0x92')](_0x34efa6[_0x67e9('0x3f')],_0x595858);}_0x34efa6=_[_0x67e9('0x92')]({},_0x34efa6,_0x4a5178[_0x67e9('0xb7')]);return db[_0x67e9('0x27')][_0x67e9('0x15')]({'where':_0x34efa6[_0x67e9('0x3f')]})['then'](function(_0x532091){_0x514305[_0x67e9('0x15')]=_0x532091;if(_0x4a5178['query'][_0x67e9('0xb5')]){_0x34efa6['include']=[{'all':!![]}];}return db['MailMessage'][_0x67e9('0xc0')](_0x34efa6);})['then'](function(_0x1b4e4b){if(_0x4a5178[_0x67e9('0x34')]['inlineCss']===_0x67e9('0xc1')){for(var _0x442b42=0x0;_0x442b42<_0x1b4e4b[_0x67e9('0x57')];_0x442b42++){_0x1b4e4b[_0x442b42][_0x67e9('0xb9')]=juice(_0x1b4e4b[_0x442b42][_0x67e9('0xb9')]);}}_0x514305['rows']=_0x1b4e4b;return _0x514305;});}})[_0x67e9('0x1a')](respondWithFilteredResult(_0xf2c47f,_0x34efa6))[_0x67e9('0x2e')](handleError(_0xf2c47f,null));};exports[_0x67e9('0xc2')]=function(_0x5980cf,_0x497e6c){return db[_0x67e9('0x30')][_0x67e9('0x58')]({'where':{'id':_0x5980cf[_0x67e9('0xb3')]['id']}})[_0x67e9('0x1a')](handleEntityNotFound(_0x497e6c,null))['then'](function(_0xcd3ce1){if(_0xcd3ce1){return _0xcd3ce1[_0x67e9('0xc3')](_0x5980cf['body'][_0x67e9('0xbc')],_['omit'](_0x5980cf['body'],[_0x67e9('0xbc'),'id'])||{})[_0x67e9('0xc4')](function(){return db[_0x67e9('0x63')]['findAll']({'attributes':['id','name',_0x67e9('0x43')],'where':{'id':_0x5980cf[_0x67e9('0xb9')][_0x67e9('0xbc')]}});})[_0x67e9('0x1a')](function(_0x5eac46){socket[_0x67e9('0xc5')](_0x67e9('0xc6'),{'id':Number(_0x5980cf[_0x67e9('0xb3')]['id']),'tags':_0x5eac46||[]});return{'id':Number(_0x5980cf[_0x67e9('0xb3')]['id']),'tags':_0x5eac46||[]};});}})['then'](respondWithResult(_0x497e6c,null))[_0x67e9('0x2e')](handleError(_0x497e6c,null));};exports[_0x67e9('0xc7')]=function(_0x577940,_0x7a8817){return db[_0x67e9('0x30')]['find']({'where':{'id':_0x577940[_0x67e9('0xb3')]['id']}})[_0x67e9('0x1a')](handleEntityNotFound(_0x7a8817,null))[_0x67e9('0x1a')](function(_0x515bf0){if(_0x515bf0){return _0x515bf0['removeTags'](_0x577940[_0x67e9('0x34')]['ids']);}})['then'](respondWithStatusCode(_0x7a8817,null))[_0x67e9('0x2e')](handleError(_0x7a8817,null));};exports[_0x67e9('0xc8')]=function(_0x2cf684,_0x437bf5){var _0x4b49ca=moment()[_0x67e9('0xc9')]()[_0x67e9('0x91')]();var _0x3cd74e=path[_0x67e9('0xca')](config[_0x67e9('0xcb')],_0x67e9('0xcc'),'files',_0x67e9('0xcd'));var _0x128741=path[_0x67e9('0xca')](config[_0x67e9('0xcb')],_0x67e9('0xcc'),_0x67e9('0xce'),_0x67e9('0xcf'));var _0x1f63a2=path[_0x67e9('0xca')](_0x3cd74e,_0x4b49ca);var _0x251e57=util[_0x67e9('0xbe')](_0x67e9('0xd0'),_0x2cf684['params']['id'],_0x4b49ca);var _0x4eec06=path['join'](_0x3cd74e,_0x251e57);var _0x13f4f3=[];if(_0x2cf684[_0x67e9('0x34')]['attachments']){_0x13f4f3[_0x67e9('0x26')]({'model':db[_0x67e9('0xd1')],'as':'Attachments','raw':!![]});}var _0x4cb546=[{'model':db[_0x67e9('0x27')],'as':_0x67e9('0xd2'),'attributes':['id',_0x67e9('0xb9'),_0x67e9('0x44'),'to','cc',_0x67e9('0xd3'),'subject',_0x67e9('0x6c')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x13f4f3}];return db[_0x67e9('0x30')][_0x67e9('0x58')]({'where':{'id':_0x2cf684['params']['id']},'include':_0x4cb546})['then'](handleEntityNotFound(_0x437bf5,null))[_0x67e9('0x1a')](function(_0x6fe850){if(_0x6fe850&&_0x6fe850[_0x67e9('0xd2')]){var _0x392c1b=_0x6fe850[_0x67e9('0xd4')]({'plain':!![]});fs[_0x67e9('0xd5')](_0x1f63a2);return BPromise['each'](_0x392c1b[_0x67e9('0xd2')],function(_0xec5a38,_0x7b007f){var _0x1e2aad={'from':_0xec5a38[_0x67e9('0x44')],'to':_0xec5a38['to'],'subject':_0xec5a38[_0x67e9('0xd6')],'html':htmlEntities[_0x67e9('0xd7')](_0xec5a38[_0x67e9('0xb9')]),'headers':{'Date':moment(_0xec5a38[_0x67e9('0x6c')])[_0x67e9('0xbe')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0xec5a38['cc']){_0x1e2aad['headers']['Cc']=_0xec5a38['cc'];}if(_0xec5a38['bcc']){_0x1e2aad['headers'][_0x67e9('0xd8')]=_0xec5a38[_0x67e9('0xd3')];}return new BPromise(function(_0x2bcb43,_0x5d973e){if(_0xec5a38[_0x67e9('0xd9')]){for(var _0x4f00af=0x0;_0x4f00af<_0xec5a38[_0x67e9('0xd9')]['length'];_0x4f00af++){var _0x2dc04c=_0xec5a38[_0x67e9('0xd9')][_0x4f00af];var _0xc8beec=path[_0x67e9('0xca')](_0x128741,_0x2dc04c[_0x67e9('0xda')]);if(fs[_0x67e9('0xdb')](_0xc8beec)){_0x1e2aad[_0x67e9('0xcf')][_0x67e9('0x26')]({'name':_0x2dc04c[_0x67e9('0x33')],'contentType':_0x2dc04c[_0x67e9('0x61')],'data':fs[_0x67e9('0xdc')](_0xc8beec)});}}}emlformat['build'](_0x1e2aad,function(_0x2d9ee6,_0x1f1447){if(_0x2d9ee6)return _0x5d973e(_0x2d9ee6);fs['writeFileSync'](path[_0x67e9('0xca')](_0x1f63a2,util['format']('message%d.eml',_0x7b007f)),_0x1f1447);return _0x2bcb43(_0x1f1447);});});})[_0x67e9('0x1a')](function(){return new BPromise(function(_0x3c5418,_0x4508e2){zipdir(_0x1f63a2,{'saveTo':_0x4eec06},function(_0x4c9ba2,_0x2c14f6){if(_0x4c9ba2)return _0x4508e2(_0x4c9ba2);return _0x3c5418(_0x2c14f6);});})[_0x67e9('0x1a')](function(){return new BPromise(function(_0x1664f6,_0x22d7c6){rimraf(_0x1f63a2,function(_0x2f243f){if(_0x2f243f)_0x22d7c6(_0x2f243f);return _0x1664f6();});});})['then'](function(){return _0x437bf5[_0x67e9('0xc8')](_0x4eec06,_0x251e57,function(_0x59749e){if(!_0x59749e)fs[_0x67e9('0xdd')](_0x4eec06);});});});}else{return _0x437bf5[_0x67e9('0x10')](0xc8);}})[_0x67e9('0x2e')](handleError(_0x437bf5,null));}; \ No newline at end of file +var _0xad05=['CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','replace','isNumeric','i.id\x20LIKE\x20?','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','Sequelize','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','sequelize','toString','merge','MailInteraction','Account.key','a.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','all','rows','show','params','rawAttributes','includeAll','include','options','create','body','describe','addMessage','omit','ids','filter','YYYY-MM-DD\x20HH:mm:ss','inlineCss','addTags','setTags','findAll','emit','mailInteractionTags:save','removeTags','download','unix','join','server','files','tmp','format','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','get','each','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','moment','path','lodash','squel','juice','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','html-entities','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','update','destroy','then','end','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','MailMessage','findOne','out','-id','plainBody','lastMsgText','catch','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag'];(function(_0x5e4424,_0xf1d263){var _0xc88ea9=function(_0x18444c){while(--_0x18444c){_0x5e4424['push'](_0x5e4424['shift']());}};_0xc88ea9(++_0xf1d263);}(_0xad05,0x85));var _0x5ad0=function(_0x470e67,_0x4a596d){_0x470e67=_0x470e67-0x0;var _0x28bbde=_0xad05[_0x470e67];return _0x28bbde;};'use strict';var emlformat=require(_0x5ad0('0x0'));var rimraf=require(_0x5ad0('0x1'));var zipdir=require('zip-dir');var moment=require(_0x5ad0('0x2'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x5ad0('0x3'));var fs=require('fs');var _=require(_0x5ad0('0x4'));var squel=require(_0x5ad0('0x5'));var juice=require(_0x5ad0('0x6'));var Redis=require('ioredis');var qs=require(_0x5ad0('0x7'));var as=require(_0x5ad0('0x8'));var logger=require('../../config/logger')(_0x5ad0('0x9'));var config=require(_0x5ad0('0xa'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x5ad0('0xb'));config[_0x5ad0('0xc')]=_[_0x5ad0('0xd')](config[_0x5ad0('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x5ad0('0xe'))(new Redis(config[_0x5ad0('0xc')]));require(_0x5ad0('0xf'))[_0x5ad0('0x10')](socket);function respondWithStatusCode(_0x2cb62c,_0x1f8989){_0x1f8989=_0x1f8989||0xcc;return function(_0x27a52d){if(_0x27a52d){return _0x2cb62c[_0x5ad0('0x11')](_0x1f8989);}return _0x2cb62c['status'](_0x1f8989)['end']();};}function respondWithResult(_0x1ff00b,_0x444b1a){_0x444b1a=_0x444b1a||0xc8;return function(_0x19fd11){if(_0x19fd11){return _0x1ff00b[_0x5ad0('0x12')](_0x444b1a)[_0x5ad0('0x13')](_0x19fd11);}};}function respondWithFilteredResult(_0x75bdc6,_0x37e9f5){return function(_0xb8bdd5){if(_0xb8bdd5){var _0x5e6d91=typeof _0x37e9f5[_0x5ad0('0x14')]===_0x5ad0('0x15')&&typeof _0x37e9f5[_0x5ad0('0x16')]===_0x5ad0('0x15');var _0x5b92db=_0xb8bdd5[_0x5ad0('0x17')];var _0x52010b=_0x5e6d91?0x0:_0x37e9f5[_0x5ad0('0x14')];var _0x18de7c=_0x5e6d91?_0xb8bdd5[_0x5ad0('0x17')]:_0x37e9f5[_0x5ad0('0x14')]+_0x37e9f5[_0x5ad0('0x16')];var _0x5f54f1;if(_0x18de7c>=_0x5b92db){_0x18de7c=_0x5b92db;_0x5f54f1=0xc8;}else{_0x5f54f1=0xce;}_0x75bdc6[_0x5ad0('0x12')](_0x5f54f1);return _0x75bdc6[_0x5ad0('0x18')]('Content-Range',_0x52010b+'-'+_0x18de7c+'/'+_0x5b92db)[_0x5ad0('0x13')](_0xb8bdd5);}return null;};}function saveUpdates(_0x149b59){return function(_0x4c1862){if(_0x4c1862){return _0x4c1862[_0x5ad0('0x19')](_0x149b59)['then'](function(_0x44f0a1){return _0x44f0a1;});}return null;};}function removeEntity(_0xcce92b){return function(_0x5c098a){if(_0x5c098a){return _0x5c098a[_0x5ad0('0x1a')]()[_0x5ad0('0x1b')](function(){_0xcce92b[_0x5ad0('0x12')](0xcc)[_0x5ad0('0x1c')]();});}};}function handleEntityNotFound(_0x31333c){return function(_0x10f77b){if(!_0x10f77b){_0x31333c['sendStatus'](0x194);}return _0x10f77b;};}function handleError(_0x385bfe,_0x459eba){_0x459eba=_0x459eba||0x1f4;return function(_0x13cadf){logger[_0x5ad0('0x1d')](_0x13cadf[_0x5ad0('0x1e')]);if(_0x13cadf[_0x5ad0('0x1f')]){delete _0x13cadf[_0x5ad0('0x1f')];}_0x385bfe[_0x5ad0('0x12')](_0x459eba)[_0x5ad0('0x20')](_0x13cadf);};}function getInteractionUsers(_0x2af707,_0x3754a3){return new BPromise(function(_0x317fe9,_0x333b2c){try{if(_0x3754a3[_0x2af707['id']]){_0x2af707[_0x5ad0('0x21')]=_[_0x5ad0('0x22')](_0x3754a3[_0x2af707['id']],function(_0x42a53a){return{'id':_0x42a53a['id'],'fullname':_0x42a53a[_0x5ad0('0x23')]};});}}catch(_0x40c3f1){_0x333b2c(_0x40c3f1);}_0x317fe9(_0x2af707);});}function getInteractionTags(_0x5032e0,_0x1c482d){return new BPromise(function(_0x4129be,_0x4c3e4e){try{if(_0x5032e0[_0x5ad0('0x24')]){_0x5032e0[_0x5ad0('0x25')]=[];_0x5032e0[_0x5ad0('0x24')][_0x5ad0('0x26')](',')[_0x5ad0('0x27')](function(_0x888b96){_0x5032e0['Tags'][_0x5ad0('0x28')](_0x1c482d[_0x888b96]);});}delete _0x5032e0[_0x5ad0('0x24')];}catch(_0x1a486e){_0x4c3e4e(_0x1a486e);}_0x4129be(_0x5032e0);});}function getLastMessageText(_0x170bf7){return new BPromise(function(_0x17cc66,_0x4e0284){return db[_0x5ad0('0x29')][_0x5ad0('0x2a')]({'where':{'$and':[{'MailInteractionId':_0x170bf7['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x5ad0('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x5ad0('0x2c'),'raw':!![]})[_0x5ad0('0x1b')](function(_0x2be531){if(_0x2be531&&_0x2be531[_0x5ad0('0x2d')]){_0x170bf7[_0x5ad0('0x2e')]=_['trimStart'](_0x2be531[_0x5ad0('0x2d')]);}_0x17cc66(_0x170bf7);})[_0x5ad0('0x2f')](function(_0x3cffa9){_0x4e0284(_0x3cffa9);});});}function updateMailInteraction(_0x506831,_0x5346e4,_0x7702c1,_0x269871){return new BPromise(function(_0xbcedad,_0xffdd6e){return getInteractionUsers(_0x506831,_0x7702c1)[_0x5ad0('0x1b')](function(_0x444f75){return getInteractionTags(_0x444f75,_0x5346e4);})['then'](function(_0x3933d1){if(_0x269871){_0xbcedad(getLastMessageText(_0x3933d1));}else{_0xbcedad(_0x3933d1);}})[_0x5ad0('0x2f')](function(_0x20e6be){_0xffdd6e(_0x20e6be);});});}exports['index']=function(_0x2e61cc,_0xd13ad9){var _0x948f87={},_0x26dc1d={},_0x245e04={'count':0x0,'rows':[]};var _0x7f72=_['map'](db['MailInteraction']['rawAttributes'],function(_0x4466b8){return{'name':_0x4466b8[_0x5ad0('0x30')],'type':_0x4466b8[_0x5ad0('0x31')][_0x5ad0('0x32')]};});_0x26dc1d[_0x5ad0('0x33')]=_['map'](_0x7f72,'name');_0x26dc1d[_0x5ad0('0x34')]=_[_0x5ad0('0x35')](_0x2e61cc['query']);_0x26dc1d[_0x5ad0('0x36')]=_['intersection'](_0x26dc1d['model'],_0x26dc1d[_0x5ad0('0x34')]);_0x948f87[_0x5ad0('0x37')]=_[_0x5ad0('0x38')](_0x26dc1d['model'],qs[_0x5ad0('0x39')](_0x2e61cc[_0x5ad0('0x34')][_0x5ad0('0x39')]));_0x948f87[_0x5ad0('0x37')]=_0x948f87[_0x5ad0('0x37')][_0x5ad0('0x3a')]?_0x948f87['attributes']:_0x26dc1d['model'];if(!_0x2e61cc[_0x5ad0('0x34')][_0x5ad0('0x3b')](_0x5ad0('0x3c'))){_0x948f87['limit']=qs['limit'](_0x2e61cc['query'][_0x5ad0('0x16')]);_0x948f87[_0x5ad0('0x14')]=qs['offset'](_0x2e61cc[_0x5ad0('0x34')]['offset']);}_0x948f87[_0x5ad0('0x3d')]=qs[_0x5ad0('0x3e')](_0x2e61cc[_0x5ad0('0x34')]['sort']);_0x948f87[_0x5ad0('0x3f')]=qs[_0x5ad0('0x36')](_[_0x5ad0('0x40')](_0x2e61cc[_0x5ad0('0x34')],_0x26dc1d['filters']),_0x7f72);var _0x176e99=[];var _0x378d2f=squel[_0x5ad0('0x41')]()[_0x5ad0('0x42')]('id')[_0x5ad0('0x42')](_0x5ad0('0x1f'))[_0x5ad0('0x42')](_0x5ad0('0x43'))[_0x5ad0('0x44')](_0x5ad0('0x45'));var _0x23862f=squel[_0x5ad0('0x41')]()['field'](_0x5ad0('0x46'))[_0x5ad0('0x42')](_0x5ad0('0x47'))[_0x5ad0('0x42')](_0x5ad0('0x48'))[_0x5ad0('0x44')](_0x5ad0('0x49'),'ui')[_0x5ad0('0x4a')](_0x5ad0('0x4b'),'u','u.id\x20=\x20ui.UserId');var _0x362e0f=squel[_0x5ad0('0x41')]()[_0x5ad0('0x44')]('mail_interactions','i')[_0x5ad0('0x4a')](_0x5ad0('0x4c'),'c',_0x5ad0('0x4d'))['left_join'](_0x5ad0('0x4b'),'o',_0x5ad0('0x4e'))[_0x5ad0('0x4a')](_0x5ad0('0x4f'),'a','a.id\x20=\x20i.MailAccountId')['left_join'](_0x5ad0('0x50'),'me',_0x5ad0('0x51'))[_0x5ad0('0x4a')]('mail_interaction_has_tags','it',_0x5ad0('0x52'))[_0x5ad0('0x4a')]('tools_tags','t',_0x5ad0('0x53'));var _0x2f9e38=squel[_0x5ad0('0x54')]();var _0x530e4b=[];var _0xe84171=squel[_0x5ad0('0x54')]();var _0x1eea2f;if(_0x2e61cc['query'][_0x5ad0('0x55')]){_0x1eea2f=as[_0x5ad0('0x56')](_0x2e61cc[_0x5ad0('0x34')]['search']);var _0x48b35f=_0x1eea2f[_0x5ad0('0x57')];for(var _0x4c7de1=0x0;_0x4c7de1<_0x1eea2f[_0x5ad0('0x58')][_0x5ad0('0x3a')];_0x4c7de1++){var _0x10d236=_0x1eea2f[_0x5ad0('0x58')][_0x4c7de1];var _0x11f0ec='i';var _0x189809=_[_0x5ad0('0x59')](_0x7f72,[_0x5ad0('0x1f'),_0x10d236[_0x5ad0('0x42')]]);if(!_0x189809){switch(_0x10d236[_0x5ad0('0x42')]){case _0x5ad0('0x5a'):if(_0x10d236[_0x5ad0('0x5b')]==0x1){_0x362e0f['having']('`'+_0x10d236[_0x5ad0('0x42')]+_0x5ad0('0x5c'));}else{_0x362e0f[_0x5ad0('0x5d')]('`'+_0x10d236['field']+_0x5ad0('0x5e'));}break;case _0x5ad0('0x5f'):if(_0x10d236[_0x5ad0('0x60')]==='$substring'){if(_0x10d236['value'][_0x5ad0('0x26')]('\x20')[_0x5ad0('0x3a')]>0x1){_0x2f9e38[_0x48b35f](_0x5ad0('0x61'),qs[_0x5ad0('0x62')](_0x10d236[_0x5ad0('0x5b')]),null);}else{var _0x2654ea='%'+_0x10d236[_0x5ad0('0x5b')]+'%';_0x2f9e38[_0x48b35f](_0x5ad0('0x63'),_0x2654ea,_0x2654ea,_0x2654ea);}}else{_0x189809=_['find'](_0x7f72,[_0x5ad0('0x1f'),_0x5ad0('0x64')]);_0x10d236[_0x5ad0('0x42')]=_0x5ad0('0x64');_0x1dcdc1=as[_0x5ad0('0x65')](_0x11f0ec,_0x189809['type'],_0x10d236);_0x2f9e38[_0x48b35f](_0x1dcdc1[_0x5ad0('0x66')],_0x1dcdc1['value'][_0x5ad0('0x67')],_0x1dcdc1['value'][_0x5ad0('0x1c')]);}break;case _0x5ad0('0x68'):var _0x1cfc64=_0x10d236[_0x5ad0('0x5b')]['split'](',')[_0x5ad0('0x22')](function(_0x16091d){return Number(_0x16091d);});_0x1cfc64[_0x5ad0('0x27')](function(_0x440fa9){_0xe84171['or'](_0x5ad0('0x69'),'%,'+_0x440fa9+',%');});_0x530e4b=_[_0x5ad0('0x6a')](_0x530e4b,_0x1cfc64);break;case _0x5ad0('0x6b'):if(_0x10d236[_0x5ad0('0x60')]==='$substring'){_0x2f9e38[_0x48b35f](_0x5ad0('0x6c'),'%'+_0x10d236[_0x5ad0('0x5b')]+'%',null);}else{_0x189809=_[_0x5ad0('0x59')](_0x7f72,['name',_0x5ad0('0x6d')]);_0x10d236['field']='UserId';_0x1dcdc1=as[_0x5ad0('0x65')](_0x11f0ec,_0x189809[_0x5ad0('0x31')],_0x10d236);_0x2f9e38[_0x48b35f](_0x1dcdc1[_0x5ad0('0x66')],_0x1dcdc1[_0x5ad0('0x5b')][_0x5ad0('0x67')],_0x1dcdc1[_0x5ad0('0x5b')][_0x5ad0('0x1c')]);}break;case _0x5ad0('0x2d'):_0x1dcdc1=as[_0x5ad0('0x65')]('me',null,_0x10d236);_0x2f9e38[_0x48b35f](_0x1dcdc1[_0x5ad0('0x66')],_0x1dcdc1[_0x5ad0('0x5b')][_0x5ad0('0x67')],_0x1dcdc1['value']['end']);break;}}else{var _0x1dcdc1=as['buildExpression'](_0x11f0ec,_0x189809[_0x5ad0('0x31')],_0x10d236);_0x2f9e38[_0x48b35f](_0x1dcdc1['text'],_0x1dcdc1[_0x5ad0('0x5b')][_0x5ad0('0x67')],_0x1dcdc1[_0x5ad0('0x5b')][_0x5ad0('0x1c')]);}}}else{var _0x217816=_(_0x2e61cc[_0x5ad0('0x34')])[_0x5ad0('0x35')]()[_0x5ad0('0x22')](function(_0x1e823f){return _[_0x5ad0('0x6e')](_0x7f72,[_0x5ad0('0x1f'),_0x1e823f])?_0x1e823f:undefined;})[_0x5ad0('0x6f')]()[_0x5ad0('0x5b')]();if(!_[_0x5ad0('0x70')](_0x217816)){_0x217816[_0x5ad0('0x27')](function(_0xbb463d){if(_0xbb463d==='MailAccountId'){_0x362e0f[_0x5ad0('0x3f')]('i.MailAccountId\x20IN\x20?',[][_0x5ad0('0x71')](_0x2e61cc[_0x5ad0('0x34')][_0xbb463d]));}else if(_0xbb463d===_0x5ad0('0x72')){var _0x578b1a=JSON[_0x5ad0('0x73')](_0x2e61cc['query'][_0xbb463d])[_0x5ad0('0x74')];var _0x3d8722=JSON[_0x5ad0('0x73')](_0x2e61cc[_0x5ad0('0x34')][_0xbb463d])[_0x5ad0('0x75')];_0x362e0f[_0x5ad0('0x3f')](_0x5ad0('0x76'),_0x578b1a,_0x3d8722);}else{if(_0x2e61cc[_0x5ad0('0x34')][_0xbb463d]===_0x5ad0('0x77')){_0x362e0f[_0x5ad0('0x3f')]('i.'+_0xbb463d+'\x20IS\x20NULL');}else{_0x362e0f[_0x5ad0('0x3f')]('i.'+_0xbb463d+_0x5ad0('0x78'),_0x2e61cc[_0x5ad0('0x34')][_0xbb463d]);}}});}if(_0x2e61cc['query'][_0x5ad0('0x79')]){if(_0x2e61cc[_0x5ad0('0x34')]['read']==0x1){_0x362e0f['having'](_0x5ad0('0x7a'));}else{_0x362e0f['having'](_0x5ad0('0x7b'));}}if(_0x2e61cc['query'][_0x5ad0('0x7c')]){_0x530e4b=_['isArray'](_0x2e61cc[_0x5ad0('0x34')]['tag'])?_0x2e61cc[_0x5ad0('0x34')][_0x5ad0('0x7c')]:new Array(_0x2e61cc[_0x5ad0('0x34')][_0x5ad0('0x7c')]);_0x530e4b[_0x5ad0('0x27')](function(_0xde26dc){_0xe84171['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xde26dc+',%');});}if(_0x2e61cc[_0x5ad0('0x34')]['filter']){var _0x3a67f3=_0x2e61cc[_0x5ad0('0x34')]['filter'][_0x5ad0('0x7d')]('\x5c','\x5c\x5c')[_0x5ad0('0x7d')](/'/g,'\x27\x27');if(qs[_0x5ad0('0x7e')](_0x3a67f3)){_0x2f9e38['or'](_0x5ad0('0x7f'),_0x3a67f3+'%');}else if(qs[_0x5ad0('0x80')](_0x3a67f3)){_0x2f9e38['or'](_0x5ad0('0x81'),_0x3a67f3+'%');}else{_0x2f9e38['or'](_0x5ad0('0x82'),qs[_0x5ad0('0x62')](_0x3a67f3))['or'](_0x5ad0('0x83'),qs[_0x5ad0('0x62')](_0x3a67f3));}}}_0x362e0f[_0x5ad0('0x3f')](_0x2f9e38);_0x362e0f[_0x5ad0('0x84')]('i.id');var _0x31cbea={'type':db[_0x5ad0('0x85')]['QueryTypes'][_0x5ad0('0x86')],'raw':!![]};var _0x112fcc=_0x362e0f[_0x5ad0('0x87')]();_0x112fcc[_0x5ad0('0x42')](_0x5ad0('0x88'));_0x112fcc[_0x5ad0('0x42')](_0x5ad0('0x89'),_0x5ad0('0x5a'));if(_0x948f87[_0x5ad0('0x3d')]){_0x948f87[_0x5ad0('0x3d')][_0x5ad0('0x27')](function(_0x450567){var _0x41e878=_0x450567[0x0]===_0x5ad0('0x8a')?_0x450567[0x0]:'i.'+_0x450567[0x0];_0x362e0f['order'](_0x41e878,_0x450567[0x1]===_0x5ad0('0x8b')?![]:!![]);});}if(!_[_0x5ad0('0x70')](_0x530e4b)){_0x362e0f[_0x5ad0('0x5d')](_0xe84171);_0x112fcc['where'](_0x5ad0('0x8c'),_0x530e4b);}BPromise['resolve']()[_0x5ad0('0x1b')](function(){if(!_0x1eea2f){if(_0x2e61cc[_0x5ad0('0x34')][_0x5ad0('0x8d')])return;_0x112fcc[_0x5ad0('0x3f')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x362e0f[_0x5ad0('0x3f')](_0x5ad0('0x8e'));return;}if(_0x2e61cc[_0x5ad0('0x8f')][_0x5ad0('0x90')]!==_0x5ad0('0x91'))return;return _0x2e61cc[_0x5ad0('0x8f')][_0x5ad0('0x92')]({'attributes':['id'],'raw':!![]})['then'](function(_0x25169e){if(_[_0x5ad0('0x70')](_0x25169e)){_0x112fcc[_0x5ad0('0x3f')](_0x5ad0('0x93'));_0x362e0f[_0x5ad0('0x3f')]('i.MailAccountId\x20IS\x20NULL');}else{_0x112fcc['where']('i.MailAccountId\x20IN\x20?',_[_0x5ad0('0x22')](_0x25169e,'id'));_0x362e0f['where'](_0x5ad0('0x94'),_[_0x5ad0('0x22')](_0x25169e,'id'));}});})['then'](function(){if(_0x2e61cc[_0x5ad0('0x8f')][_0x5ad0('0x90')]==='agent'&&!_0x1eea2f&&!_0x2e61cc[_0x5ad0('0x34')]['MailAccountId'])return[];return db[_0x5ad0('0x95')]['query'](_0x112fcc[_0x5ad0('0x96')](),_0x31cbea);})[_0x5ad0('0x1b')](function(_0x4b4f1f){_0x245e04['count']=_0x4b4f1f['length'];if(_0x245e04[_0x5ad0('0x17')]===0x0)return[];return db[_0x5ad0('0x95')]['query'](_0x378d2f[_0x5ad0('0x96')](),_0x31cbea)[_0x5ad0('0x1b')](function(_0x23c206){_0x176e99=_['keyBy'](_0x23c206,'id');_0x31cbea=_[_0x5ad0('0x97')](_0x31cbea,{'model':db[_0x5ad0('0x98')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2e61cc[_0x5ad0('0x34')][_0x5ad0('0x39')]){_0x948f87['attributes'][_0x5ad0('0x27')](function(_0x225c46){_0x362e0f[_0x5ad0('0x42')]('i.'+_0x225c46);});}else{_0x362e0f[_0x5ad0('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x5ad0('0x5a'));_0x362e0f['field']('a.key',_0x5ad0('0x99'));_0x362e0f['field'](_0x5ad0('0x9a'),'Account.mandatoryDisposition');_0x362e0f[_0x5ad0('0x42')]('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');_0x362e0f[_0x5ad0('0x42')](_0x5ad0('0x88'));_0x362e0f[_0x5ad0('0x42')](_0x5ad0('0x9b'));_0x362e0f[_0x5ad0('0x42')](_0x5ad0('0x9c'));_0x362e0f[_0x5ad0('0x42')](_0x5ad0('0x9d'));_0x362e0f[_0x5ad0('0x42')](_0x5ad0('0x9e'));_0x362e0f[_0x5ad0('0x42')](_0x5ad0('0x9f'));_0x362e0f[_0x5ad0('0x42')](_0x5ad0('0xa0'));_0x362e0f[_0x5ad0('0x42')](_0x5ad0('0xa1'));_0x362e0f[_0x5ad0('0x42')]('i.subject');_0x362e0f[_0x5ad0('0x42')](_0x5ad0('0xa2'));_0x362e0f[_0x5ad0('0x42')](_0x5ad0('0xa3'));_0x362e0f[_0x5ad0('0x42')](_0x5ad0('0xa4'));_0x362e0f[_0x5ad0('0x42')](_0x5ad0('0xa5'));_0x362e0f['field'](_0x5ad0('0xa6'));_0x362e0f['field'](_0x5ad0('0xa7'));_0x362e0f[_0x5ad0('0x42')](_0x5ad0('0xa8'));_0x362e0f[_0x5ad0('0x42')](_0x5ad0('0xa9'));_0x362e0f[_0x5ad0('0x42')](_0x5ad0('0xaa'),_0x5ad0('0xab'));_0x362e0f[_0x5ad0('0x42')](_0x5ad0('0xac'),_0x5ad0('0xad'));_0x362e0f['field'](_0x5ad0('0xae'),_0x5ad0('0xaf'));_0x362e0f[_0x5ad0('0x42')](_0x5ad0('0xb0'),_0x5ad0('0xb1'));_0x362e0f[_0x5ad0('0x42')]('c.mobile',_0x5ad0('0xb2'));_0x362e0f[_0x5ad0('0x42')](_0x5ad0('0xb3'),_0x5ad0('0xb4'));_0x362e0f[_0x5ad0('0x42')](_0x5ad0('0xb5'),_0x5ad0('0xb6'));_0x362e0f['field'](_0x5ad0('0xb7'),'Owner.internal');_0x362e0f[_0x5ad0('0x42')](_0x5ad0('0xb8'),_0x5ad0('0x24'));}if(_0x948f87[_0x5ad0('0x16')])_0x362e0f[_0x5ad0('0x16')](_0x948f87[_0x5ad0('0x16')]);if(_0x948f87['offset'])_0x362e0f['offset'](_0x948f87[_0x5ad0('0x14')]);return db[_0x5ad0('0x95')][_0x5ad0('0x34')](_0x362e0f[_0x5ad0('0x96')](),_0x31cbea);})[_0x5ad0('0x1b')](function(_0x2a7cb1){if(_0x2a7cb1[_0x5ad0('0x3a')]>0x0)_0x23862f['where'](_0x5ad0('0xb9'),_['map'](_0x2a7cb1,'id'));return db[_0x5ad0('0x95')][_0x5ad0('0x34')](_0x23862f['toString'](),_0x31cbea)['then'](function(_0x1bb1bb){var _0x56a428=_[_0x5ad0('0xba')](_0x1bb1bb,_0x5ad0('0xbb'));var _0x2c0868=[];return db[_0x5ad0('0xbc')][_0x5ad0('0x2a')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0x5ad0('0x1b')](function(_0xfcb010){var _0x5b7093=_0xfcb010[_0x5ad0('0xbd')];_0x2a7cb1[_0x5ad0('0x27')](function(_0x203624){_0x2c0868['push'](updateMailInteraction(_0x203624,_0x176e99,_0x56a428,_0x5b7093));});return BPromise[_0x5ad0('0xbe')](_0x2c0868);});});});})[_0x5ad0('0x1b')](function(_0x5af334){_0x245e04[_0x5ad0('0xbf')]=_0x5af334;return _0x245e04;})['then'](respondWithFilteredResult(_0xd13ad9,_0x948f87))[_0x5ad0('0x2f')](handleError(_0xd13ad9,null));};exports[_0x5ad0('0xc0')]=function(_0x2940ed,_0x2efb7d){var _0x428029={'raw':![],'where':{'id':_0x2940ed[_0x5ad0('0xc1')]['id']}},_0xac8a31={};_0xac8a31['model']=_[_0x5ad0('0x35')](db[_0x5ad0('0x98')][_0x5ad0('0xc2')]);_0xac8a31[_0x5ad0('0x34')]=_[_0x5ad0('0x35')](_0x2940ed[_0x5ad0('0x34')]);_0xac8a31[_0x5ad0('0x36')]=_[_0x5ad0('0x38')](_0xac8a31[_0x5ad0('0x33')],_0xac8a31['query']);_0x428029['attributes']=_[_0x5ad0('0x38')](_0xac8a31['model'],qs['fields'](_0x2940ed[_0x5ad0('0x34')][_0x5ad0('0x39')]));_0x428029[_0x5ad0('0x37')]=_0x428029['attributes'][_0x5ad0('0x3a')]?_0x428029[_0x5ad0('0x37')]:_0xac8a31[_0x5ad0('0x33')];if(_0x2940ed[_0x5ad0('0x34')][_0x5ad0('0xc3')]){_0x428029[_0x5ad0('0xc4')]=[{'all':!![]}];}_0x428029=_[_0x5ad0('0x97')]({},_0x428029,_0x2940ed[_0x5ad0('0xc5')]);return db['MailInteraction']['find'](_0x428029)[_0x5ad0('0x1b')](handleEntityNotFound(_0x2efb7d,null))[_0x5ad0('0x1b')](respondWithResult(_0x2efb7d,null))[_0x5ad0('0x2f')](handleError(_0x2efb7d,null));};exports['create']=function(_0xf81da0,_0x1c0446){return db[_0x5ad0('0x98')][_0x5ad0('0xc6')](_0xf81da0['body'],{})[_0x5ad0('0x1b')](respondWithResult(_0x1c0446,0xc9))[_0x5ad0('0x2f')](handleError(_0x1c0446,null));};exports['update']=function(_0x343bff,_0x2d23f7){if(_0x343bff['body']['id']){delete _0x343bff[_0x5ad0('0xc7')]['id'];}return db['MailInteraction']['find']({'where':{'id':_0x343bff[_0x5ad0('0xc1')]['id']}})[_0x5ad0('0x1b')](handleEntityNotFound(_0x2d23f7,null))[_0x5ad0('0x1b')](saveUpdates(_0x343bff['body'],null))['then'](respondWithResult(_0x2d23f7,null))[_0x5ad0('0x2f')](handleError(_0x2d23f7,null));};exports['destroy']=function(_0x2ca65f,_0x1adc8b){return db['MailInteraction']['find']({'where':{'id':_0x2ca65f[_0x5ad0('0xc1')]['id']}})[_0x5ad0('0x1b')](handleEntityNotFound(_0x1adc8b,null))[_0x5ad0('0x1b')](removeEntity(_0x1adc8b,null))[_0x5ad0('0x2f')](handleError(_0x1adc8b,null));};exports[_0x5ad0('0xc8')]=function(_0x15e247,_0x21b7ef){return db[_0x5ad0('0x98')][_0x5ad0('0xc8')]()['then'](respondWithResult(_0x21b7ef,null))[_0x5ad0('0x2f')](handleError(_0x21b7ef,null));};exports[_0x5ad0('0xc9')]=function(_0x11d3bd,_0x100825){return db[_0x5ad0('0x29')]['find']({'where':{'id':_0x11d3bd[_0x5ad0('0xc1')]['id']}})[_0x5ad0('0x1b')](handleEntityNotFound(_0x100825,null))[_0x5ad0('0x1b')](function(_0x414bd4){if(_0x414bd4){return _0x414bd4['addMessage'](_0x11d3bd[_0x5ad0('0xc7')]['ids'],_[_0x5ad0('0xca')](_0x11d3bd[_0x5ad0('0xc7')],[_0x5ad0('0xcb'),'id'])||{});}})[_0x5ad0('0x1b')](respondWithResult(_0x100825,null))[_0x5ad0('0x2f')](handleError(_0x100825,null));};exports['getMessages']=function(_0x27ef73,_0x4c6914){var _0x2fb853={'raw':![],'where':{}};var _0xe960e={};var _0x3bee36={'count':0x0,'rows':[]};return db['MailInteraction'][_0x5ad0('0x2a')]({'where':{'id':_0x27ef73[_0x5ad0('0xc1')]['id']}})[_0x5ad0('0x1b')](handleEntityNotFound(_0x4c6914,null))['then'](function(_0x10ad3e){if(_0x10ad3e){_0xe960e[_0x5ad0('0x33')]=_[_0x5ad0('0x35')](db[_0x5ad0('0x29')][_0x5ad0('0xc2')]);_0xe960e[_0x5ad0('0x34')]=_[_0x5ad0('0x35')](_0x27ef73[_0x5ad0('0x34')]);_0xe960e[_0x5ad0('0x36')]=_['intersection'](_0xe960e[_0x5ad0('0x33')],_0xe960e['query']);_0x2fb853[_0x5ad0('0x37')]=_[_0x5ad0('0x38')](_0xe960e['model'],qs['fields'](_0x27ef73[_0x5ad0('0x34')][_0x5ad0('0x39')]));_0x2fb853['attributes']=_0x2fb853['attributes'][_0x5ad0('0x3a')]?_0x2fb853[_0x5ad0('0x37')]:_0xe960e['model'];if(!_0x27ef73[_0x5ad0('0x34')][_0x5ad0('0x3b')]('nolimit')){_0x2fb853['limit']=qs[_0x5ad0('0x16')](_0x27ef73[_0x5ad0('0x34')][_0x5ad0('0x16')]);_0x2fb853['offset']=qs[_0x5ad0('0x14')](_0x27ef73['query']['offset']);}_0x2fb853[_0x5ad0('0x3d')]=qs[_0x5ad0('0x3e')](_0x27ef73[_0x5ad0('0x34')][_0x5ad0('0x3e')]);_0x2fb853[_0x5ad0('0x3f')]=qs[_0x5ad0('0x36')](_[_0x5ad0('0x40')](_0x27ef73[_0x5ad0('0x34')],_0xe960e[_0x5ad0('0x36')]));_0x2fb853[_0x5ad0('0x3f')][_0x5ad0('0xbb')]=_0x10ad3e['id'];if(_0x27ef73[_0x5ad0('0x34')][_0x5ad0('0xcc')]){_0x2fb853['where']=_['merge'](_0x2fb853[_0x5ad0('0x3f')],{'$or':_['map'](_0x2fb853[_0x5ad0('0x37')],function(_0x5ededc){var _0x1a9545={};_0x1a9545[_0x5ededc]={'$like':'%'+_0x27ef73[_0x5ad0('0x34')][_0x5ad0('0xcc')]+'%'};return _0x1a9545;})});}if(_0x27ef73['query']['$gte']){var _0x6ee082=_0x27ef73['query'][_0x5ad0('0x74')][_0x5ad0('0x26')](',');var _0x5c040f={};_0x5c040f[_0x6ee082[0x0]]={'$gte':moment(_0x6ee082[0x1])['format'](_0x5ad0('0xcd'))};_0x2fb853[_0x5ad0('0x3f')]=_['merge'](_0x2fb853[_0x5ad0('0x3f')],_0x5c040f);}_0x2fb853=_[_0x5ad0('0x97')]({},_0x2fb853,_0x27ef73[_0x5ad0('0xc5')]);return db[_0x5ad0('0x29')][_0x5ad0('0x17')]({'where':_0x2fb853[_0x5ad0('0x3f')]})[_0x5ad0('0x1b')](function(_0x37c907){_0x3bee36[_0x5ad0('0x17')]=_0x37c907;if(_0x27ef73['query']['includeAll']){_0x2fb853[_0x5ad0('0xc4')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x2fb853);})[_0x5ad0('0x1b')](function(_0x2cf008){if(_0x27ef73[_0x5ad0('0x34')][_0x5ad0('0xce')]==='true'){for(var _0x2e3b81=0x0;_0x2e3b81<_0x2cf008[_0x5ad0('0x3a')];_0x2e3b81++){_0x2cf008[_0x2e3b81]['body']=juice(_0x2cf008[_0x2e3b81][_0x5ad0('0xc7')]);}}_0x3bee36['rows']=_0x2cf008;return _0x3bee36;});}})[_0x5ad0('0x1b')](respondWithFilteredResult(_0x4c6914,_0x2fb853))[_0x5ad0('0x2f')](handleError(_0x4c6914,null));};exports[_0x5ad0('0xcf')]=function(_0x48ff83,_0x55ac50){return db[_0x5ad0('0x98')]['find']({'where':{'id':_0x48ff83['params']['id']}})[_0x5ad0('0x1b')](handleEntityNotFound(_0x55ac50,null))[_0x5ad0('0x1b')](function(_0x59ea25){if(_0x59ea25){return _0x59ea25[_0x5ad0('0xd0')](_0x48ff83[_0x5ad0('0xc7')]['ids'],_[_0x5ad0('0xca')](_0x48ff83[_0x5ad0('0xc7')],[_0x5ad0('0xcb'),'id'])||{})['spread'](function(){return db[_0x5ad0('0x68')][_0x5ad0('0xd1')]({'attributes':['id',_0x5ad0('0x1f'),_0x5ad0('0x43')],'where':{'id':_0x48ff83['body'][_0x5ad0('0xcb')]}});})[_0x5ad0('0x1b')](function(_0xd7f3ea){socket[_0x5ad0('0xd2')](_0x5ad0('0xd3'),{'id':Number(_0x48ff83[_0x5ad0('0xc1')]['id']),'tags':_0xd7f3ea||[]});return{'id':Number(_0x48ff83['params']['id']),'tags':_0xd7f3ea||[]};});}})[_0x5ad0('0x1b')](respondWithResult(_0x55ac50,null))['catch'](handleError(_0x55ac50,null));};exports['removeTags']=function(_0x703216,_0x395eca){return db['MailInteraction']['find']({'where':{'id':_0x703216[_0x5ad0('0xc1')]['id']}})[_0x5ad0('0x1b')](handleEntityNotFound(_0x395eca,null))[_0x5ad0('0x1b')](function(_0x8c1c78){if(_0x8c1c78){return _0x8c1c78[_0x5ad0('0xd4')](_0x703216[_0x5ad0('0x34')][_0x5ad0('0xcb')]);}})[_0x5ad0('0x1b')](respondWithStatusCode(_0x395eca,null))['catch'](handleError(_0x395eca,null));};exports[_0x5ad0('0xd5')]=function(_0x264a11,_0x1262b5){var _0x3360ea=moment()[_0x5ad0('0xd6')]()[_0x5ad0('0x96')]();var _0x10ab90=path[_0x5ad0('0xd7')](config['root'],_0x5ad0('0xd8'),_0x5ad0('0xd9'),_0x5ad0('0xda'));var _0x5a9f31=path[_0x5ad0('0xd7')](config['root'],_0x5ad0('0xd8'),_0x5ad0('0xd9'),'attachments');var _0x3ef7c4=path[_0x5ad0('0xd7')](_0x10ab90,_0x3360ea);var _0x217ba1=util[_0x5ad0('0xdb')](_0x5ad0('0xdc'),_0x264a11[_0x5ad0('0xc1')]['id'],_0x3360ea);var _0x52c7df=path[_0x5ad0('0xd7')](_0x10ab90,_0x217ba1);var _0x3137aa=[];if(_0x264a11['query']['attachments']){_0x3137aa['push']({'model':db[_0x5ad0('0xdd')],'as':_0x5ad0('0xde'),'raw':!![]});}var _0x5c21dd=[{'model':db[_0x5ad0('0x29')],'as':_0x5ad0('0xdf'),'attributes':['id','body',_0x5ad0('0x44'),'to','cc',_0x5ad0('0xe0'),'subject',_0x5ad0('0x72')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x3137aa}];return db[_0x5ad0('0x98')][_0x5ad0('0x59')]({'where':{'id':_0x264a11[_0x5ad0('0xc1')]['id']},'include':_0x5c21dd})[_0x5ad0('0x1b')](handleEntityNotFound(_0x1262b5,null))['then'](function(_0x3ad9a6){if(_0x3ad9a6&&_0x3ad9a6[_0x5ad0('0xdf')]){var _0x470d3c=_0x3ad9a6[_0x5ad0('0xe1')]({'plain':!![]});fs['mkdirSync'](_0x3ef7c4);return BPromise[_0x5ad0('0xe2')](_0x470d3c[_0x5ad0('0xdf')],function(_0x54118d,_0x46592c){var _0x27cecc={'from':_0x54118d[_0x5ad0('0x44')],'to':_0x54118d['to'],'subject':_0x54118d[_0x5ad0('0xe3')],'html':htmlEntities[_0x5ad0('0xe4')](_0x54118d[_0x5ad0('0xc7')]),'headers':{'Date':moment(_0x54118d[_0x5ad0('0x72')])['format'](_0x5ad0('0xe5'))},'attachments':[]};if(_0x54118d['cc']){_0x27cecc[_0x5ad0('0xe6')]['Cc']=_0x54118d['cc'];}if(_0x54118d[_0x5ad0('0xe0')]){_0x27cecc['headers'][_0x5ad0('0xe7')]=_0x54118d[_0x5ad0('0xe0')];}return new BPromise(function(_0x306b65,_0x9d858c){if(_0x54118d['Attachments']){for(var _0x2c51a5=0x0;_0x2c51a5<_0x54118d[_0x5ad0('0xde')][_0x5ad0('0x3a')];_0x2c51a5++){var _0x2c8f32=_0x54118d[_0x5ad0('0xde')][_0x2c51a5];var _0x156063=path[_0x5ad0('0xd7')](_0x5a9f31,_0x2c8f32[_0x5ad0('0xe8')]);if(fs[_0x5ad0('0xe9')](_0x156063)){_0x27cecc['attachments'][_0x5ad0('0x28')]({'name':_0x2c8f32[_0x5ad0('0x1f')],'contentType':_0x2c8f32[_0x5ad0('0x31')],'data':fs['readFileSync'](_0x156063)});}}}emlformat[_0x5ad0('0xea')](_0x27cecc,function(_0x13bb6f,_0x1a0195){if(_0x13bb6f)return _0x9d858c(_0x13bb6f);fs[_0x5ad0('0xeb')](path['join'](_0x3ef7c4,util['format'](_0x5ad0('0xec'),_0x46592c)),_0x1a0195);return _0x306b65(_0x1a0195);});});})[_0x5ad0('0x1b')](function(){return new BPromise(function(_0x36791c,_0x51c13b){zipdir(_0x3ef7c4,{'saveTo':_0x52c7df},function(_0x1b4f8a,_0x21e6ca){if(_0x1b4f8a)return _0x51c13b(_0x1b4f8a);return _0x36791c(_0x21e6ca);});})[_0x5ad0('0x1b')](function(){return new BPromise(function(_0x58ab6a,_0x2ea441){rimraf(_0x3ef7c4,function(_0x4553a8){if(_0x4553a8)_0x2ea441(_0x4553a8);return _0x58ab6a();});});})[_0x5ad0('0x1b')](function(){return _0x1262b5[_0x5ad0('0xd5')](_0x52c7df,_0x217ba1,function(_0x53a06c){if(!_0x53a06c)fs[_0x5ad0('0xed')](_0x52c7df);});});});}else{return _0x1262b5[_0x5ad0('0x11')](0xc8);}})[_0x5ad0('0x2f')](handleError(_0x1262b5,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index ef38f1d..f768fa3 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 _0x6408=['setMaxListeners','save','update','remove','then','Users','findAll','setDataValue','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','MailInteraction','MailMessage'];(function(_0x400eb6,_0x75423a){var _0x27d855=function(_0x4aa412){while(--_0x4aa412){_0x400eb6['push'](_0x400eb6['shift']());}};_0x27d855(++_0x75423a);}(_0x6408,0x194));var _0x8640=function(_0x57ecc5,_0x121ca9){_0x57ecc5=_0x57ecc5-0x0;var _0x2a564d=_0x6408[_0x57ecc5];return _0x2a564d;};'use strict';var EventEmitter=require(_0x8640('0x0'));var MailInteraction=require(_0x8640('0x1'))['db'][_0x8640('0x2')];var MailMessage=require(_0x8640('0x1'))['db'][_0x8640('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x8640('0x4')](0x0);var events={'afterCreate':_0x8640('0x5'),'afterUpdate':_0x8640('0x6'),'afterDestroy':_0x8640('0x7')};function emitEvent(_0x270724){return function(_0x4b1815,_0x1ba041,_0xfa32a8){_0x4b1815['getUsers']({'attributes':['id'],'raw':!![]})[_0x8640('0x8')](function(_0x44d634){_0x4b1815['setDataValue'](_0x8640('0x9'),_0x44d634['map'](function(_0x4ec567){return{'id':_0x4ec567['id']};}));return MailMessage[_0x8640('0xa')]({'where':{'MailInteractionId':_0x4b1815['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x236a83){_0x4b1815[_0x8640('0xb')]('unreadMessages',_0x236a83[_0x8640('0xc')]);MailInteractionEvents[_0x8640('0xd')](_0x270724+':'+_0x4b1815['id'],_0x4b1815);MailInteractionEvents[_0x8640('0xd')](_0x270724,_0x4b1815);_0xfa32a8(null);})[_0x8640('0xe')](_0xfa32a8(null));};}for(var e in events){if(events[_0x8640('0xf')](e)){var event=events[e];MailInteraction[_0x8640('0x10')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0x7a5a=['hook','events','../../mysqldb','MailMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x1d4ff6,_0x43a375){var _0x4a76db=function(_0x544e03){while(--_0x544e03){_0x1d4ff6['push'](_0x1d4ff6['shift']());}};_0x4a76db(++_0x43a375);}(_0x7a5a,0xc7));var _0xa7a5=function(_0x1203a4,_0x529665){_0x1203a4=_0x1203a4-0x0;var _0x82d25a=_0x7a5a[_0x1203a4];return _0x82d25a;};'use strict';var EventEmitter=require(_0xa7a5('0x0'));var MailInteraction=require(_0xa7a5('0x1'))['db']['MailInteraction'];var MailMessage=require(_0xa7a5('0x1'))['db'][_0xa7a5('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xa7a5('0x3')](0x0);var events={'afterCreate':_0xa7a5('0x4'),'afterUpdate':'update','afterDestroy':_0xa7a5('0x5')};function emitEvent(_0x352472){return function(_0xa9a4be,_0x30e3e6,_0x109245){_0xa9a4be[_0xa7a5('0x6')]({'attributes':['id'],'raw':!![]})[_0xa7a5('0x7')](function(_0x5ec6e2){_0xa9a4be[_0xa7a5('0x8')](_0xa7a5('0x9'),_0x5ec6e2[_0xa7a5('0xa')](function(_0x265655){return{'id':_0x265655['id']};}));return MailMessage[_0xa7a5('0xb')]({'where':{'MailInteractionId':_0xa9a4be['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x30a9b8){_0xa9a4be[_0xa7a5('0x8')](_0xa7a5('0xc'),_0x30a9b8[_0xa7a5('0xd')]);MailInteractionEvents['emit'](_0x352472+':'+_0xa9a4be['id'],_0xa9a4be);MailInteractionEvents[_0xa7a5('0xe')](_0x352472,_0xa9a4be);_0x109245(null);})[_0xa7a5('0xf')](_0x109245(null));};}for(var e in events){if(events[_0xa7a5('0x10')](e)){var event=events[e];MailInteraction[_0xa7a5('0x11')](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 2fa2037..fd768d7 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 _0xa991=['changed','models','get','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa991,0x17d));var _0x1a99=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xa991[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0x1a99('0x0'));var util=require(_0x1a99('0x1'));var logger=require(_0x1a99('0x2'))(_0x1a99('0x3'));var moment=require('moment');var BPromise=require(_0x1a99('0x4'));var rp=require(_0x1a99('0x5'));var fs=require('fs');var path=require(_0x1a99('0x6'));var rimraf=require(_0x1a99('0x7'));var config=require(_0x1a99('0x8'));var attributes=require(_0x1a99('0x9'));module[_0x1a99('0xa')]=function(_0x3d1624,_0x470dc0){return _0x3d1624[_0x1a99('0xb')]('MailInteraction',attributes,{'tableName':_0x1a99('0xc'),'paranoid':![],'indexes':[{'name':_0x1a99('0xd'),'fields':[_0x1a99('0xe'),'to'],'type':_0x1a99('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x68f69c,_0x223d23,_0x5677a9){if(_0x68f69c[_0x1a99('0x10')]){_0x68f69c[_0x1a99('0x11')]=moment()[_0x1a99('0x12')](_0x1a99('0x13'));}if(_0x68f69c[_0x1a99('0x14')]){_0x68f69c[_0x1a99('0x15')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x5677a9(null,_0x223d23);},'beforeUpdate':function(_0x1aac01,_0x41c2d3,_0x24ec21){if(_0x1aac01['changed'](_0x1a99('0x10'))){_0x1aac01[_0x1a99('0x11')]=_0x1aac01[_0x1a99('0x10')]?moment()[_0x1a99('0x12')](_0x1a99('0x13')):null;}if(_0x1aac01[_0x1a99('0x16')](_0x1a99('0x14'))){_0x1aac01[_0x1a99('0x15')]=moment()['format'](_0x1a99('0x13'));_0x1aac01[_0x1a99('0x10')]=null;_0x1aac01[_0x1a99('0x11')]=null;}_0x24ec21(null,_0x1aac01);},'afterUpdate':function(_0x4e25bc,_0x1d6451,_0x43ea6d){var _0x1beb57=_0x3d1624[_0x1a99('0x17')];var _0xe11dc7=_0x4e25bc[_0x1a99('0x18')]({'plain':!![]});if(_0xe11dc7[_0x1a99('0x14')]){return _0x1beb57[_0x1a99('0x19')][_0x1a99('0x1a')]({'read':!![]},{'where':{'MailInteractionId':_0xe11dc7['id']}})[_0x1a99('0x1b')](function(){_0x43ea6d();})[_0x1a99('0x1c')](function(_0x52b42b){_0x43ea6d(_0x52b42b);});}else{_0x43ea6d();}}},'charset':_0x1a99('0x1d'),'collate':_0x1a99('0x1e')});}; \ No newline at end of file +var _0x69e0=['utf8mb4','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','closed','closedAt','models','get','MailMessage','update','catch'];(function(_0x132aed,_0x40b4b3){var _0x8da83b=function(_0x538ead){while(--_0x538ead){_0x132aed['push'](_0x132aed['shift']());}};_0x8da83b(++_0x40b4b3);}(_0x69e0,0xd9));var _0x069e=function(_0x2e8ce2,_0x2a4f72){_0x2e8ce2=_0x2e8ce2-0x0;var _0x44c870=_0x69e0[_0x2e8ce2];return _0x44c870;};'use strict';var _=require(_0x069e('0x0'));var util=require(_0x069e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x069e('0x2'));var BPromise=require(_0x069e('0x3'));var rp=require(_0x069e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x069e('0x5'));var config=require(_0x069e('0x6'));var attributes=require('./mailInteraction.attributes');module[_0x069e('0x7')]=function(_0x2fa064,_0x19ec7d){return _0x2fa064[_0x069e('0x8')](_0x069e('0x9'),attributes,{'tableName':_0x069e('0xa'),'paranoid':![],'indexes':[{'name':_0x069e('0xb'),'fields':[_0x069e('0xc'),'to'],'type':_0x069e('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x516380,_0xabe593,_0x237625){if(_0x516380[_0x069e('0xe')]){_0x516380[_0x069e('0xf')]=moment()[_0x069e('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x516380['closed']){_0x516380['closedAt']=moment()['format'](_0x069e('0x11'));}_0x237625(null,_0xabe593);},'beforeUpdate':function(_0xae72d5,_0x580bff,_0x115f4c){if(_0xae72d5[_0x069e('0x12')](_0x069e('0xe'))){_0xae72d5[_0x069e('0xf')]=_0xae72d5['substatus']?moment()[_0x069e('0x10')](_0x069e('0x11')):null;}if(_0xae72d5[_0x069e('0x12')](_0x069e('0x13'))){_0xae72d5[_0x069e('0x14')]=moment()[_0x069e('0x10')](_0x069e('0x11'));_0xae72d5['substatus']=null;_0xae72d5['substatusAt']=null;}_0x115f4c(null,_0xae72d5);},'afterUpdate':function(_0x4b0e96,_0x30d541,_0xa87181){var _0xf496f2=_0x2fa064[_0x069e('0x15')];var _0x24a941=_0x4b0e96[_0x069e('0x16')]({'plain':!![]});if(_0x24a941['closed']){return _0xf496f2[_0x069e('0x17')][_0x069e('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x24a941['id']}})['then'](function(){_0xa87181();})[_0x069e('0x19')](function(_0x1a5f7c){_0xa87181(_0x1a5f7c);});}else{_0xa87181();}}},'charset':_0x069e('0x1a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 695fd1d..5e6e393 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 _0x0f7b=['ids','AddTags','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','MailInteraction','update','body','options','raw','where','UpdateMailInteraction','find','addTags','omit'];(function(_0xf7b612,_0x1b1f82){var _0x291cd7=function(_0x353add){while(--_0x353add){_0xf7b612['push'](_0xf7b612['shift']());}};_0x291cd7(++_0x1b1f82);}(_0x0f7b,0x113));var _0xb0f7=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x0f7b[_0x9c2427];return _0x51984f;};'use strict';var _=require(_0xb0f7('0x0'));var util=require(_0xb0f7('0x1'));var moment=require(_0xb0f7('0x2'));var BPromise=require('bluebird');var rs=require(_0xb0f7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb0f7('0x4'));var logger=require(_0xb0f7('0x5'))(_0xb0f7('0x6'));var config=require(_0xb0f7('0x7'));var jayson=require(_0xb0f7('0x8'));var client=jayson[_0xb0f7('0x9')][_0xb0f7('0xa')]({'port':0x232a});config[_0xb0f7('0xb')]=_['defaults'](config['redis'],{'host':_0xb0f7('0xc'),'port':0x18eb});var socket=require(_0xb0f7('0xd'))(new Redis(config['redis']));require('./mailInteraction.socket')[_0xb0f7('0xe')](socket);function respondWithRpcPromise(_0x5a7ea7,_0x33bc3f,_0x2e50c0){return new BPromise(function(_0x2d883e,_0xa039e4){return client[_0xb0f7('0xf')](_0x5a7ea7,_0x2e50c0)[_0xb0f7('0x10')](function(_0xa31645){logger[_0xb0f7('0x11')](_0xb0f7('0x12'),_0x33bc3f,_0xb0f7('0x13'));logger[_0xb0f7('0x14')](_0xb0f7('0x15'),_0x33bc3f,_0xb0f7('0x13'),JSON[_0xb0f7('0x16')](_0xa31645));if(_0xa31645[_0xb0f7('0x17')]){if(_0xa31645[_0xb0f7('0x17')][_0xb0f7('0x18')]===0x1f4){logger['error'](_0xb0f7('0x12'),_0x33bc3f,_0xa31645[_0xb0f7('0x17')][_0xb0f7('0x19')]);return _0xa039e4(_0xa31645['error'][_0xb0f7('0x19')]);}logger['error'](_0xb0f7('0x12'),_0x33bc3f,_0xa31645['error'][_0xb0f7('0x19')]);return _0x2d883e(_0xa31645[_0xb0f7('0x17')][_0xb0f7('0x19')]);}else{logger['info'](_0xb0f7('0x12'),_0x33bc3f,_0xb0f7('0x13'));_0x2d883e(_0xa31645['result']['message']);}})[_0xb0f7('0x1a')](function(_0x137c6a){logger['error'](_0xb0f7('0x12'),_0x33bc3f,_0x137c6a);_0xa039e4(_0x137c6a);});});}exports['UpdateMailInteraction']=function(_0x889e0e){var _0x413bc9=this;return new Promise(function(_0x10de1f,_0x5c1f7f){return db[_0xb0f7('0x1b')][_0xb0f7('0x1c')](_0x889e0e[_0xb0f7('0x1d')],{'raw':_0x889e0e[_0xb0f7('0x1e')]?_0x889e0e['options'][_0xb0f7('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x889e0e[_0xb0f7('0x1e')]?_0x889e0e['options'][_0xb0f7('0x20')]||null:null,'attributes':_0x889e0e[_0xb0f7('0x1e')]?_0x889e0e[_0xb0f7('0x1e')]['attributes']||null:null,'limit':_0x889e0e[_0xb0f7('0x1e')]?_0x889e0e[_0xb0f7('0x1e')]['limit']||null:null})[_0xb0f7('0x10')](function(_0x5d2476){logger[_0xb0f7('0x11')]('UpdateMailInteraction',_0x889e0e);logger[_0xb0f7('0x14')](_0xb0f7('0x21'),_0x889e0e,JSON['stringify'](_0x5d2476));_0x10de1f(_0x5d2476);})[_0xb0f7('0x1a')](function(_0x490169){logger[_0xb0f7('0x17')](_0xb0f7('0x21'),_0x490169['message'],_0x889e0e);_0x5c1f7f(_0x413bc9[_0xb0f7('0x17')](0x1f4,_0x490169[_0xb0f7('0x19')]));});});};exports['AddTagsToMailInteraction']=function(_0x5a65e6){return new Promise(function(_0xcb1729,_0x4c5362){return db[_0xb0f7('0x1b')][_0xb0f7('0x22')]({'where':_0x5a65e6[_0xb0f7('0x1e')]?_0x5a65e6[_0xb0f7('0x1e')][_0xb0f7('0x20')]||null:null})[_0xb0f7('0x10')](function(_0x547665){if(_0x547665){return _0x547665[_0xb0f7('0x23')](_0x5a65e6[_0xb0f7('0x1d')]['ids'],_[_0xb0f7('0x24')](_0x5a65e6[_0xb0f7('0x1d')],[_0xb0f7('0x25'),'id'])||{});}})['spread'](function(_0x38a75e){logger[_0xb0f7('0x11')](_0xb0f7('0x26'),_0x5a65e6);logger[_0xb0f7('0x14')](_0xb0f7('0x26'),_0x5a65e6,JSON['stringify'](_0x38a75e));_0xcb1729(_0x38a75e);})['catch'](function(_0x484be5){logger[_0xb0f7('0x17')](_0xb0f7('0x26'),_0x484be5['message'],_0x5a65e6);_0x4c5362(_this['error'](0x1f4,_0x484be5[_0xb0f7('0x19')]));});});}; \ No newline at end of file +var _0x7a5f=['AddTags','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','request','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateMailInteraction','MailInteraction','update','options','raw','attributes','limit','then','debug','AddTagsToMailInteraction','where','addTags','body','ids','omit'];(function(_0x43f489,_0x2b4fea){var _0x4134b4=function(_0x4365f6){while(--_0x4365f6){_0x43f489['push'](_0x43f489['shift']());}};_0x4134b4(++_0x2b4fea);}(_0x7a5f,0x17b));var _0xf7a5=function(_0x5a27e8,_0x492a2f){_0x5a27e8=_0x5a27e8-0x0;var _0x4e38f7=_0x7a5f[_0x5a27e8];return _0x4e38f7;};'use strict';var _=require(_0xf7a5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf7a5('0x1'));var fs=require('fs');var Redis=require(_0xf7a5('0x2'));var db=require(_0xf7a5('0x3'))['db'];var utils=require(_0xf7a5('0x4'));var logger=require(_0xf7a5('0x5'))(_0xf7a5('0x6'));var config=require(_0xf7a5('0x7'));var jayson=require(_0xf7a5('0x8'));var client=jayson['client'][_0xf7a5('0x9')]({'port':0x232a});config[_0xf7a5('0xa')]=_[_0xf7a5('0xb')](config[_0xf7a5('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xf7a5('0xc'))(new Redis(config['redis']));require(_0xf7a5('0xd'))[_0xf7a5('0xe')](socket);function respondWithRpcPromise(_0x1ef820,_0x8e74d3,_0x17dfbc){return new BPromise(function(_0x28c721,_0x5bf086){return client[_0xf7a5('0xf')](_0x1ef820,_0x17dfbc)['then'](function(_0x54302e){logger['info'](_0xf7a5('0x10'),_0x8e74d3,_0xf7a5('0x11'));logger['debug'](_0xf7a5('0x12'),_0x8e74d3,'request\x20sent',JSON[_0xf7a5('0x13')](_0x54302e));if(_0x54302e[_0xf7a5('0x14')]){if(_0x54302e[_0xf7a5('0x14')][_0xf7a5('0x15')]===0x1f4){logger['error'](_0xf7a5('0x10'),_0x8e74d3,_0x54302e['error'][_0xf7a5('0x16')]);return _0x5bf086(_0x54302e['error'][_0xf7a5('0x16')]);}logger[_0xf7a5('0x14')](_0xf7a5('0x10'),_0x8e74d3,_0x54302e[_0xf7a5('0x14')][_0xf7a5('0x16')]);return _0x28c721(_0x54302e[_0xf7a5('0x14')][_0xf7a5('0x16')]);}else{logger[_0xf7a5('0x17')](_0xf7a5('0x10'),_0x8e74d3,'request\x20sent');_0x28c721(_0x54302e[_0xf7a5('0x18')][_0xf7a5('0x16')]);}})[_0xf7a5('0x19')](function(_0x50c145){logger['error'](_0xf7a5('0x10'),_0x8e74d3,_0x50c145);_0x5bf086(_0x50c145);});});}exports[_0xf7a5('0x1a')]=function(_0x36381d){var _0x54b080=this;return new Promise(function(_0x2f8c8e,_0x265d87){return db[_0xf7a5('0x1b')][_0xf7a5('0x1c')](_0x36381d['body'],{'raw':_0x36381d[_0xf7a5('0x1d')]?_0x36381d[_0xf7a5('0x1d')][_0xf7a5('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36381d[_0xf7a5('0x1d')]?_0x36381d[_0xf7a5('0x1d')]['where']||null:null,'attributes':_0x36381d[_0xf7a5('0x1d')]?_0x36381d[_0xf7a5('0x1d')][_0xf7a5('0x1f')]||null:null,'limit':_0x36381d[_0xf7a5('0x1d')]?_0x36381d[_0xf7a5('0x1d')][_0xf7a5('0x20')]||null:null})[_0xf7a5('0x21')](function(_0x4e84b9){logger[_0xf7a5('0x17')]('UpdateMailInteraction',_0x36381d);logger[_0xf7a5('0x22')](_0xf7a5('0x1a'),_0x36381d,JSON[_0xf7a5('0x13')](_0x4e84b9));_0x2f8c8e(_0x4e84b9);})[_0xf7a5('0x19')](function(_0x2fc290){logger['error'](_0xf7a5('0x1a'),_0x2fc290[_0xf7a5('0x16')],_0x36381d);_0x265d87(_0x54b080[_0xf7a5('0x14')](0x1f4,_0x2fc290['message']));});});};exports[_0xf7a5('0x23')]=function(_0x4c0c9c){return new Promise(function(_0x169685,_0x1f90b0){return db['MailInteraction']['find']({'where':_0x4c0c9c[_0xf7a5('0x1d')]?_0x4c0c9c[_0xf7a5('0x1d')][_0xf7a5('0x24')]||null:null})[_0xf7a5('0x21')](function(_0x684eff){if(_0x684eff){return _0x684eff[_0xf7a5('0x25')](_0x4c0c9c[_0xf7a5('0x26')][_0xf7a5('0x27')],_[_0xf7a5('0x28')](_0x4c0c9c[_0xf7a5('0x26')],[_0xf7a5('0x27'),'id'])||{});}})['spread'](function(_0x23dd3e){logger[_0xf7a5('0x17')](_0xf7a5('0x29'),_0x4c0c9c);logger['debug'](_0xf7a5('0x29'),_0x4c0c9c,JSON[_0xf7a5('0x13')](_0x23dd3e));_0x169685(_0x23dd3e);})[_0xf7a5('0x19')](function(_0x1f2a4b){logger[_0xf7a5('0x14')](_0xf7a5('0x29'),_0x1f2a4b[_0xf7a5('0x16')],_0x4c0c9c);_0x1f90b0(_this['error'](0x1f4,_0x1f2a4b[_0xf7a5('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index a85d189..4409c33 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 _0x8941=['length','mailInteraction:','./mailInteraction.events','remove','emit','removeListener'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x8941,0x128));var _0x1894=function(_0x10fd2d,_0x1f823f){_0x10fd2d=_0x10fd2d-0x0;var _0x3aaa52=_0x8941[_0x10fd2d];return _0x3aaa52;};'use strict';var MailInteractionEvents=require(_0x1894('0x0'));var events=['save',_0x1894('0x1'),'update'];function createListener(_0x2ce8da,_0x3e6ba6){return function(_0x47af9f){_0x3e6ba6[_0x1894('0x2')](_0x2ce8da,_0x47af9f);};}function removeListener(_0x1984e9,_0x2d9527){return function(){MailInteractionEvents[_0x1894('0x3')](_0x1984e9,_0x2d9527);};}exports['register']=function(_0x3dac2a){for(var _0x305257=0x0,_0x552dc9=events[_0x1894('0x4')];_0x305257<_0x552dc9;_0x305257++){var _0x180a7d=events[_0x305257];var _0x19236c=createListener(_0x1894('0x5')+_0x180a7d,_0x3dac2a);MailInteractionEvents['on'](_0x180a7d,_0x19236c);}}; \ No newline at end of file +var _0x6527=['emit','removeListener','length','mailInteraction:','./mailInteraction.events','remove','update'];(function(_0x440235,_0x5c4204){var _0x425eb6=function(_0x340a10){while(--_0x340a10){_0x440235['push'](_0x440235['shift']());}};_0x425eb6(++_0x5c4204);}(_0x6527,0xa5));var _0x7652=function(_0x5d801a,_0x379056){_0x5d801a=_0x5d801a-0x0;var _0x1e1fe7=_0x6527[_0x5d801a];return _0x1e1fe7;};'use strict';var MailInteractionEvents=require(_0x7652('0x0'));var events=['save',_0x7652('0x1'),_0x7652('0x2')];function createListener(_0x26ab3a,_0x520bba){return function(_0x29e183){_0x520bba[_0x7652('0x3')](_0x26ab3a,_0x29e183);};}function removeListener(_0x2ae147,_0x3ecaae){return function(){MailInteractionEvents[_0x7652('0x4')](_0x2ae147,_0x3ecaae);};}exports['register']=function(_0x3a72b6){for(var _0x24ce29=0x0,_0x28bf48=events[_0x7652('0x5')];_0x24ce29<_0x28bf48;_0x24ce29++){var _0x5995f8=events[_0x24ce29];var _0x3ed84e=createListener(_0x7652('0x6')+_0x5995f8,_0x3a72b6);MailInteractionEvents['on'](_0x5995f8,_0x3ed84e);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index f78f1d3..f05e490 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 _0x153f=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','index','describe','/:id','show','/:id/download','download','tracked','mail','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer'];(function(_0xe8129c,_0x2fb03c){var _0x709fc5=function(_0xb8e0c6){while(--_0xb8e0c6){_0xe8129c['push'](_0xe8129c['shift']());}};_0x709fc5(++_0x2fb03c);}(_0x153f,0x15b));var _0xf153=function(_0x1ed7ae,_0x3bf67d){_0x1ed7ae=_0x1ed7ae-0x0;var _0x54a7ba=_0x153f[_0x1ed7ae];return _0x54a7ba;};'use strict';var multer=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var path=require(_0xf153('0x2'));var timeout=require(_0xf153('0x3'));var express=require(_0xf153('0x4'));var router=express[_0xf153('0x5')]();var fs_extra=require(_0xf153('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf153('0x7'));var config=require('../../config/environment');var controller=require(_0xf153('0x8'));router[_0xf153('0x9')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0xb')]);router[_0xf153('0x9')]('/describe',auth[_0xf153('0xa')](),controller[_0xf153('0xc')]);router[_0xf153('0x9')](_0xf153('0xd'),auth[_0xf153('0xa')](),controller[_0xf153('0xe')]);router[_0xf153('0x9')](_0xf153('0xf'),auth[_0xf153('0xa')](),controller[_0xf153('0x10')]);router['post']('/',auth[_0xf153('0xa')](),interaction[_0xf153('0x11')](_0xf153('0x12'),'mailmessage:create'),controller[_0xf153('0x13')]);router[_0xf153('0x14')](_0xf153('0xd'),auth[_0xf153('0xa')](),controller[_0xf153('0x15')]);router[_0xf153('0x14')](_0xf153('0x16'),auth[_0xf153('0xa')](),controller[_0xf153('0x17')]);router['put'](_0xf153('0x18'),auth[_0xf153('0xa')](),controller[_0xf153('0x19')]);router[_0xf153('0x1a')](_0xf153('0xd'),auth[_0xf153('0xa')](),controller[_0xf153('0x1b')]);module[_0xf153('0x1c')]=router; \ No newline at end of file +var _0x927e=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','mail','mailmessage:create','put','update','/:id/accept','accept','reject','destroy','multer','util','express','Router','fs-extra'];(function(_0x3efe87,_0x35ad48){var _0x56a4cc=function(_0x47869e){while(--_0x47869e){_0x3efe87['push'](_0x3efe87['shift']());}};_0x56a4cc(++_0x35ad48);}(_0x927e,0x1ab));var _0xe927=function(_0x31d707,_0x733c2b){_0x31d707=_0x31d707-0x0;var _0x3ff20d=_0x927e[_0x31d707];return _0x3ff20d;};'use strict';var multer=require(_0xe927('0x0'));var util=require(_0xe927('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe927('0x2'));var router=express[_0xe927('0x3')]();var fs_extra=require(_0xe927('0x4'));var auth=require(_0xe927('0x5'));var interaction=require(_0xe927('0x6'));var config=require(_0xe927('0x7'));var controller=require(_0xe927('0x8'));router[_0xe927('0x9')]('/',auth[_0xe927('0xa')](),controller[_0xe927('0xb')]);router[_0xe927('0x9')](_0xe927('0xc'),auth[_0xe927('0xa')](),controller[_0xe927('0xd')]);router['get'](_0xe927('0xe'),auth[_0xe927('0xa')](),controller[_0xe927('0xf')]);router[_0xe927('0x9')](_0xe927('0x10'),auth[_0xe927('0xa')](),controller[_0xe927('0x11')]);router[_0xe927('0x12')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xe927('0x13'),_0xe927('0x14')),controller['create']);router[_0xe927('0x15')](_0xe927('0xe'),auth['isAuthenticated'](),controller[_0xe927('0x16')]);router[_0xe927('0x15')](_0xe927('0x17'),auth[_0xe927('0xa')](),controller[_0xe927('0x18')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0xe927('0x19')]);router['delete'](_0xe927('0xe'),auth[_0xe927('0xa')](),controller[_0xe927('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 41104d0..726f955 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 _0xff9f=['out','STRING','DATE','Email','Chat','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM'];(function(_0x39e53f,_0x4b1f03){var _0x330e4a=function(_0x1edca5){while(--_0x1edca5){_0x39e53f['push'](_0x39e53f['shift']());}};_0x330e4a(++_0x4b1f03);}(_0xff9f,0x130));var _0xfff9=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xff9f[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0xfff9('0x0'));var _=require(_0xfff9('0x1'));module[_0xfff9('0x2')]={'body':{'type':Sequelize[_0xfff9('0x3')](_0xfff9('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0xfff9('0x5'))},'read':{'type':Sequelize[_0xfff9('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfff9('0x7')]('in',_0xfff9('0x8')),'defaultValue':_0xfff9('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0xfff9('0x9')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xfff9('0x3')](_0xfff9('0x4'))},'cc':{'type':Sequelize[_0xfff9('0x3')](_0xfff9('0x4'))},'bcc':{'type':Sequelize[_0xfff9('0x3')]('long')},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0xfff9('0xa')]},'originTo':{'type':Sequelize[_0xfff9('0x3')](_0xfff9('0x4'))},'originCc':{'type':Sequelize[_0xfff9('0x3')]('long')},'originChannel':{'type':Sequelize[_0xfff9('0x7')](_0xfff9('0xb'),_0xfff9('0xc')),'defaultValue':_0xfff9('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0x1ed4=['TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Chat','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1ed4,0x76));var _0x41ed=function(_0x14f5b5,_0x17be06){_0x14f5b5=_0x14f5b5-0x0;var _0x275512=_0x1ed4[_0x14f5b5];return _0x275512;};'use strict';var Sequelize=require(_0x41ed('0x0'));var _=require('lodash');module[_0x41ed('0x1')]={'body':{'type':Sequelize[_0x41ed('0x2')](_0x41ed('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x41ed('0x2')](_0x41ed('0x4'))},'read':{'type':Sequelize[_0x41ed('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x41ed('0x6')]('in',_0x41ed('0x7')),'defaultValue':_0x41ed('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x41ed('0x8')](0x1fe)},'from':{'type':Sequelize[_0x41ed('0x8')]},'to':{'type':Sequelize[_0x41ed('0x2')]('long')},'cc':{'type':Sequelize[_0x41ed('0x2')](_0x41ed('0x3'))},'bcc':{'type':Sequelize[_0x41ed('0x2')](_0x41ed('0x3'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x41ed('0x9')]},'attach':{'type':Sequelize[_0x41ed('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x41ed('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x41ed('0x9')]},'originTo':{'type':Sequelize[_0x41ed('0x2')]('long')},'originCc':{'type':Sequelize[_0x41ed('0x2')]('long')},'originChannel':{'type':Sequelize['ENUM']('Email',_0x41ed('0xb')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index c779305..f487ee6 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 _0x126a=['destroy','describe','direction','out','secret','MailAccount','findOne','MailAccountId','CmList','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','host','port','secure','auth','user','pass','service','attachments','join','root','server/files/attachments','basename','List','CmContact','create','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail','read','readAt','UserId','agent','get','MailInteraction','MailInteractionId','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','fromString','EventManager','acceptmessage','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','Sequelize','reject','download','unix','toString','server','files','message-%s.eml','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','build','writeFileSync','eml-format','moment','bluebird','util','path','lodash','html-to-text','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','offset','undefined','limit','count','set','Content-Range','json','then','status','end','sendStatus','stack','name','send','index','map','MailMessage','fieldName','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','type','VIRTUAL','includeAll','findAll','rows','show','params','rawAttributes','include','find','update','body'];(function(_0x3c1a88,_0x2fd1a5){var _0x36fd2b=function(_0x11b46b){while(--_0x11b46b){_0x3c1a88['push'](_0x3c1a88['shift']());}};_0x36fd2b(++_0x2fd1a5);}(_0x126a,0x1b5));var _0xa126=function(_0x4c232b,_0x208976){_0x4c232b=_0x4c232b-0x0;var _0x359dba=_0x126a[_0x4c232b];return _0x359dba;};'use strict';var emlformat=require(_0xa126('0x0'));var moment=require(_0xa126('0x1'));var BPromise=require(_0xa126('0x2'));var util=require(_0xa126('0x3'));var path=require(_0xa126('0x4'));var fs=require('fs');var _=require(_0xa126('0x5'));var Redis=require('ioredis');var htmlToText=require(_0xa126('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0xa126('0x7'))(_0xa126('0x8'));var interaction_log=require(_0xa126('0x7'))(_0xa126('0x9'));var config=require(_0xa126('0xa'));var db=require(_0xa126('0xb'))['db'];config[_0xa126('0xc')]=_[_0xa126('0xd')](config[_0xa126('0xc')],{'host':_0xa126('0xe'),'port':0x18eb});var socket=require(_0xa126('0xf'))(new Redis(config[_0xa126('0xc')]));var htmlEntities=require(_0xa126('0x10'));require(_0xa126('0x11'))[_0xa126('0x12')](socket);var jayson=require(_0xa126('0x13'));var client=jayson[_0xa126('0x14')][_0xa126('0x15')]({'port':0x232c});var client9003=jayson[_0xa126('0x14')]['http']({'port':0x232b});var client9002=jayson[_0xa126('0x14')][_0xa126('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x23824c,_0x2fdac7,_0x152c8d,_0x2b649d){return new BPromise(function(_0x3bd940,_0x576699){var _0x180554=_0x2b649d||client;return _0x180554[_0xa126('0x16')](_0x23824c,_0x152c8d)['then'](function(_0x56c207){logger[_0xa126('0x17')](_0xa126('0x18'),_0x2fdac7,_0xa126('0x19'));logger[_0xa126('0x1a')](_0xa126('0x1b'),_0x2fdac7,_0xa126('0x19'),JSON[_0xa126('0x1c')](_0x56c207));if(_0x56c207[_0xa126('0x1d')]){if(_0x56c207[_0xa126('0x1d')][_0xa126('0x1e')]===0x1f4){logger[_0xa126('0x1d')](_0xa126('0x18'),_0x2fdac7,_0x56c207[_0xa126('0x1d')][_0xa126('0x1f')]);return _0x576699(_0x56c207['error'][_0xa126('0x1f')]);}logger[_0xa126('0x1d')](_0xa126('0x18'),_0x2fdac7,_0x56c207[_0xa126('0x1d')][_0xa126('0x1f')]);return _0x3bd940(_0x56c207[_0xa126('0x1d')]['message']);}else{logger['info'](_0xa126('0x18'),_0x2fdac7,'request\x20sent');_0x3bd940(_0x56c207[_0xa126('0x20')][_0xa126('0x1f')]);}})[_0xa126('0x21')](function(_0x5c02c0){logger[_0xa126('0x1d')](_0xa126('0x18'),_0x2fdac7,_0x5c02c0);_0x576699(_0x5c02c0);});});}function respondWithResult(_0x2ce27d,_0x40e7b2){_0x40e7b2=_0x40e7b2||0xc8;return function(_0x247290){if(_0x247290){return _0x2ce27d['status'](_0x40e7b2)['json'](_0x247290);}};}function respondWithFilteredResult(_0x2a8141,_0x2ae409){return function(_0xde04b2){if(_0xde04b2){var _0x3596dd=typeof _0x2ae409[_0xa126('0x22')]===_0xa126('0x23')&&typeof _0x2ae409[_0xa126('0x24')]===_0xa126('0x23');var _0x47a061=_0xde04b2[_0xa126('0x25')];var _0x5f17b9=_0x3596dd?0x0:_0x2ae409['offset'];var _0x21cddc=_0x3596dd?_0xde04b2['count']:_0x2ae409[_0xa126('0x22')]+_0x2ae409[_0xa126('0x24')];var _0x546ce1;if(_0x21cddc>=_0x47a061){_0x21cddc=_0x47a061;_0x546ce1=0xc8;}else{_0x546ce1=0xce;}_0x2a8141['status'](_0x546ce1);return _0x2a8141[_0xa126('0x26')](_0xa126('0x27'),_0x5f17b9+'-'+_0x21cddc+'/'+_0x47a061)[_0xa126('0x28')](_0xde04b2);}return null;};}function saveUpdates(_0xccb896){return function(_0x1fda67){if(_0x1fda67){return _0x1fda67['update'](_0xccb896)['then'](function(_0x22abe7){return _0x22abe7;});}return null;};}function removeEntity(_0x3a5714){return function(_0x17c577){if(_0x17c577){return _0x17c577['destroy']()[_0xa126('0x29')](function(){_0x3a5714[_0xa126('0x2a')](0xcc)[_0xa126('0x2b')]();});}};}function handleEntityNotFound(_0x54eb3e){return function(_0x1624a4){if(!_0x1624a4){_0x54eb3e[_0xa126('0x2c')](0x194);}return _0x1624a4;};}function handleError(_0x3f1788,_0x223f90){_0x223f90=_0x223f90||0x1f4;return function(_0x2291f3){logger[_0xa126('0x1d')](_0x2291f3[_0xa126('0x2d')]);if(_0x2291f3[_0xa126('0x2e')]){delete _0x2291f3[_0xa126('0x2e')];}_0x3f1788['status'](_0x223f90)[_0xa126('0x2f')](_0x2291f3);};}exports[_0xa126('0x30')]=function(_0x547cee,_0x33bf5c){var _0x41e5e8={},_0x33bd14={},_0xf76c3b={'count':0x0,'rows':[]};var _0x2c7fbf=_[_0xa126('0x31')](db[_0xa126('0x32')]['rawAttributes'],function(_0x5ab44b){return{'name':_0x5ab44b[_0xa126('0x33')],'type':_0x5ab44b['type'][_0xa126('0x34')]};});_0x33bd14['model']=_[_0xa126('0x31')](_0x2c7fbf,_0xa126('0x2e'));_0x33bd14[_0xa126('0x35')]=_[_0xa126('0x36')](_0x547cee[_0xa126('0x35')]);_0x33bd14[_0xa126('0x37')]=_['intersection'](_0x33bd14['model'],_0x33bd14['query']);_0x41e5e8[_0xa126('0x38')]=_[_0xa126('0x39')](_0x33bd14[_0xa126('0x3a')],qs[_0xa126('0x3b')](_0x547cee[_0xa126('0x35')][_0xa126('0x3b')]));_0x41e5e8[_0xa126('0x38')]=_0x41e5e8[_0xa126('0x38')][_0xa126('0x3c')]?_0x41e5e8[_0xa126('0x38')]:_0x33bd14[_0xa126('0x3a')];if(!_0x547cee[_0xa126('0x35')][_0xa126('0x3d')](_0xa126('0x3e'))){_0x41e5e8[_0xa126('0x24')]=qs[_0xa126('0x24')](_0x547cee['query'][_0xa126('0x24')]);_0x41e5e8[_0xa126('0x22')]=qs[_0xa126('0x22')](_0x547cee['query'][_0xa126('0x22')]);}_0x41e5e8['order']=qs[_0xa126('0x3f')](_0x547cee[_0xa126('0x35')][_0xa126('0x3f')]);_0x41e5e8['where']=qs[_0xa126('0x37')](_['pick'](_0x547cee[_0xa126('0x35')],_0x33bd14[_0xa126('0x37')]),_0x2c7fbf);if(_0x547cee[_0xa126('0x35')][_0xa126('0x40')]){_0x41e5e8[_0xa126('0x41')]=_[_0xa126('0x42')](_0x41e5e8[_0xa126('0x41')],{'$or':_[_0xa126('0x31')](_0x2c7fbf,function(_0x35a23a){if(_0x35a23a[_0xa126('0x43')]!==_0xa126('0x44')){var _0x2c67ef={};_0x2c67ef[_0x35a23a['name']]={'$like':'%'+_0x547cee[_0xa126('0x35')]['filter']+'%'};return _0x2c67ef;}})});}_0x41e5e8=_['merge']({},_0x41e5e8,_0x547cee['options']);var _0x40b4c0={'where':_0x41e5e8['where']};return db[_0xa126('0x32')][_0xa126('0x25')](_0x40b4c0)[_0xa126('0x29')](function(_0x476ca5){_0xf76c3b[_0xa126('0x25')]=_0x476ca5;if(_0x547cee['query'][_0xa126('0x45')]){_0x41e5e8['include']=[{'all':!![]}];}return db['MailMessage'][_0xa126('0x46')](_0x41e5e8);})['then'](function(_0x55bd72){_0xf76c3b[_0xa126('0x47')]=_0x55bd72;return _0xf76c3b;})[_0xa126('0x29')](respondWithFilteredResult(_0x33bf5c,_0x41e5e8))[_0xa126('0x21')](handleError(_0x33bf5c,null));};exports[_0xa126('0x48')]=function(_0x506549,_0xc84073){var _0x1c99b0={'raw':!![],'where':{'id':_0x506549[_0xa126('0x49')]['id']}},_0x4bce5a={};_0x4bce5a[_0xa126('0x3a')]=_[_0xa126('0x36')](db[_0xa126('0x32')][_0xa126('0x4a')]);_0x4bce5a[_0xa126('0x35')]=_[_0xa126('0x36')](_0x506549['query']);_0x4bce5a[_0xa126('0x37')]=_['intersection'](_0x4bce5a[_0xa126('0x3a')],_0x4bce5a[_0xa126('0x35')]);_0x1c99b0[_0xa126('0x38')]=_[_0xa126('0x39')](_0x4bce5a['model'],qs['fields'](_0x506549[_0xa126('0x35')][_0xa126('0x3b')]));_0x1c99b0['attributes']=_0x1c99b0[_0xa126('0x38')][_0xa126('0x3c')]?_0x1c99b0['attributes']:_0x4bce5a['model'];if(_0x506549[_0xa126('0x35')][_0xa126('0x45')]){_0x1c99b0[_0xa126('0x4b')]=[{'all':!![]}];}_0x1c99b0=_['merge']({},_0x1c99b0,_0x506549['options']);return db[_0xa126('0x32')][_0xa126('0x4c')](_0x1c99b0)[_0xa126('0x29')](handleEntityNotFound(_0xc84073,null))[_0xa126('0x29')](respondWithResult(_0xc84073,null))[_0xa126('0x21')](handleError(_0xc84073,null));};exports[_0xa126('0x4d')]=function(_0x469de2,_0x428e65){if(_0x469de2['body']['id']){delete _0x469de2[_0xa126('0x4e')]['id'];}return db[_0xa126('0x32')][_0xa126('0x4c')]({'where':{'id':_0x469de2['params']['id']}})[_0xa126('0x29')](handleEntityNotFound(_0x428e65,null))[_0xa126('0x29')](saveUpdates(_0x469de2['body'],null))['then'](respondWithResult(_0x428e65,null))[_0xa126('0x21')](handleError(_0x428e65,null));};exports[_0xa126('0x4f')]=function(_0x12e555,_0x21063b){return db['MailMessage']['find']({'where':{'id':_0x12e555[_0xa126('0x49')]['id']}})[_0xa126('0x29')](handleEntityNotFound(_0x21063b,null))[_0xa126('0x29')](removeEntity(_0x21063b,null))[_0xa126('0x21')](handleError(_0x21063b,null));};exports[_0xa126('0x50')]=function(_0x4f3aa1,_0x46ab13){return db['MailMessage']['describe']()[_0xa126('0x29')](respondWithResult(_0x46ab13,null))[_0xa126('0x21')](handleError(_0x46ab13,null));};exports['create']=function(_0x573803,_0x54714f){return db[_0xa126('0x32')]['create'](_0x573803[_0xa126('0x4e')])[_0xa126('0x29')](function(_0x257283){if(_0x257283){if(_0x257283[_0xa126('0x51')]===_0xa126('0x52')&&!_0x257283[_0xa126('0x53')]){var _0x1258a4,_0x2271e4,_0x1313e3;if(_0x573803[_0xa126('0x4e')]['to']){_0x2271e4=_0x573803[_0xa126('0x4e')]['to']['split'](',')[0x0];}return db[_0xa126('0x54')][_0xa126('0x55')]({'where':{'id':_0x257283[_0xa126('0x56')]},'include':[{'model':db[_0xa126('0x57')],'as':'List','include':[{'model':db['CmContact'],'as':_0xa126('0x58'),'where':{'email':_0x2271e4},'limit':0x1,'order':[[_0xa126('0x59'),_0xa126('0x5a')]]}]},{'model':db[_0xa126('0x5b')],'as':'Smtp','raw':!![]}]})[_0xa126('0x29')](function(_0x48663a){_0x1258a4=_0x48663a;if(_0x1258a4&&_0x1258a4[_0xa126('0x5c')]){var _0x13c08e={'tls':{'rejectUnauthorized':![]}};if(_[_0xa126('0x5d')](_0x1258a4[_0xa126('0x5c')]['service'])){_0x13c08e[_0xa126('0x5e')]=_0x1258a4[_0xa126('0x5c')][_0xa126('0x5e')];_0x13c08e['port']=_0x1258a4[_0xa126('0x5c')][_0xa126('0x5f')];_0x13c08e[_0xa126('0x60')]=_0x1258a4[_0xa126('0x5c')]['secure'];if(_0x1258a4[_0xa126('0x5c')]['authentication']){_0x13c08e[_0xa126('0x61')]={'user':_0x1258a4[_0xa126('0x5c')][_0xa126('0x62')],'pass':_0x1258a4[_0xa126('0x5c')][_0xa126('0x63')]};}}else{_0x13c08e[_0xa126('0x64')]=_0x1258a4[_0xa126('0x5c')]['service'];_0x13c08e[_0xa126('0x61')]={'user':_0x1258a4[_0xa126('0x5c')]['user'],'pass':_0x1258a4['Smtp'][_0xa126('0x63')]};_0x13c08e[_0xa126('0x60')]=_0x1258a4[_0xa126('0x5c')][_0xa126('0x60')];}if(_0x573803[_0xa126('0x4e')][_0xa126('0x65')]&&_0x573803[_0xa126('0x4e')][_0xa126('0x65')][_0xa126('0x3c')]){for(var _0x4e75d8=0x0;_0x4e75d8<_0x573803[_0xa126('0x4e')][_0xa126('0x65')]['length'];_0x4e75d8+=0x1){_0x573803[_0xa126('0x4e')][_0xa126('0x65')][_0x4e75d8]={'filename':_0x573803[_0xa126('0x4e')][_0xa126('0x65')][_0x4e75d8][_0xa126('0x2e')],'path':path[_0xa126('0x66')](config[_0xa126('0x67')],_0xa126('0x68'),_0x573803['body'][_0xa126('0x65')][_0x4e75d8][_0xa126('0x69')])};}}_0x1313e3={'account':_0x13c08e,'message':_0x573803['body']};return;}})[_0xa126('0x29')](function(){if(_0x1258a4[_0xa126('0x6a')]){if(_0x1258a4[_0xa126('0x6a')][_0xa126('0x58')][_0xa126('0x3c')]){return _0x1258a4['List'][_0xa126('0x58')][0x0];}else{return db[_0xa126('0x6b')][_0xa126('0x6c')](_['defaults'](_0x573803['body'],{'firstName':_0x573803[_0xa126('0x4e')]['to'],'email':_0x573803[_0xa126('0x4e')]['to'],'phone':_0x573803['body']['to'],'ListId':_0x1258a4[_0xa126('0x6d')]}));}}else{throw new Error(_0xa126('0x6e'));}})['then'](function(){if(_0x1313e3){return respondWithRpcPromise(_0xa126('0x6f'),_0xa126('0x70'),_0x1313e3,client9003)[_0xa126('0x29')](function(_0x338138){return _0x257283[_0xa126('0x4d')]({'read':!![],'messageId':_0x338138[_0xa126('0x71')],'sentAt':moment()[_0xa126('0x72')](_0xa126('0x73'))});})[_0xa126('0x21')](function(_0x4c7eca){logger[_0xa126('0x1d')]('%s',JSON[_0xa126('0x1c')](_0x4c7eca));return _0x257283;});}return _0x257283;});}return _0x257283;}})[_0xa126('0x29')](respondWithResult(_0x54714f,0xc9))[_0xa126('0x21')](handleError(_0x54714f,null));};exports['accept']=function(_0x28cef3,_0x48863a){var _0x52063a={'agent':{},'channel':_0xa126('0x74')};if(_0x28cef3['body']['id']){delete _0x28cef3[_0xa126('0x4e')]['id'];}_0x28cef3[_0xa126('0x4e')][_0xa126('0x75')]=!![];_0x28cef3['body'][_0xa126('0x76')]=moment()[_0xa126('0x72')](_0xa126('0x73'));_0x28cef3[_0xa126('0x4e')]['UserId']=_0x28cef3[_0xa126('0x4e')][_0xa126('0x77')]||_0x28cef3[_0xa126('0x62')]['id'];_0x52063a[_0xa126('0x78')]['id']=_0x28cef3[_0xa126('0x4e')][_0xa126('0x77')];return db[_0xa126('0x32')]['find']({'where':{'id':_0x28cef3[_0xa126('0x49')]['id'],'UserId':null}})[_0xa126('0x29')](handleEntityNotFound(_0x48863a,null))[_0xa126('0x29')](saveUpdates(_0x28cef3[_0xa126('0x4e')],null))['then'](function(_0x5391f8){if(_0x5391f8){_0x52063a[_0xa126('0x1f')]=_0x5391f8[_0xa126('0x79')]({'plain':!![]});return db[_0xa126('0x7a')][_0xa126('0x4c')]({'where':{'id':_0x5391f8[_0xa126('0x7b')]}});}return null;})[_0xa126('0x29')](handleEntityNotFound(_0x48863a,null))[_0xa126('0x29')](function(_0x27bd49){if(_0x27bd49){return _0x27bd49[_0xa126('0x4d')]({'UserId':_0x28cef3[_0xa126('0x4e')][_0xa126('0x77')],'read1stAt':_[_0xa126('0x5d')](_0x27bd49[_0xa126('0x7c')])?moment()[_0xa126('0x72')](_0xa126('0x73')):undefined});}return null;})[_0xa126('0x29')](function(_0x485a8c){if(_0x485a8c){_0x52063a[_0xa126('0x7d')]=_0x485a8c[_0xa126('0x79')]({'plain':!![]});interaction_log[_0xa126('0x17')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x28cef3[_0xa126('0x62')]['id'],_0x28cef3[_0xa126('0x62')][_0xa126('0x2e')],_0x28cef3[_0xa126('0x62')][_0xa126('0x7e')],_0x52063a['interaction']['id'],_0x28cef3[_0xa126('0x4e')]?JSON[_0xa126('0x1c')](_0x28cef3[_0xa126('0x4e')]):_0xa126('0x7f'));return respondWithRpcPromise(_0xa126('0x80'),_0xa126('0x81'),_0x52063a);}return null;})[_0xa126('0x29')](function(_0x4141d9){var _0x4abf12=_0xa126('0x82')+_0x4141d9[_0xa126('0x1f')]['ContactId'];return db[_0xa126('0x83')][_0xa126('0x35')](_0x4abf12,{'type':db['Sequelize'][_0xa126('0x84')][_0xa126('0x85')],'raw':!![]})[_0xa126('0x29')](function(_0xcdfa2b){return _0xcdfa2b;});})['then'](function(_0x9de2ea){if(_0x9de2ea){_0x52063a['message'][_0xa126('0x86')]=_0x9de2ea[0x0];if(!_0x28cef3[_0xa126('0x4e')][_0xa126('0x77')])return;return db[_0xa126('0x87')][_0xa126('0x4c')]({'where':{'id':_0x28cef3[_0xa126('0x4e')]['UserId'],'role':'agent'},'attributes':['id',_0xa126('0x2e'),_0xa126('0x88'),_0xa126('0x89'),_0xa126('0x8a')],'raw':!![]});}return null;})['then'](function(_0x1d91a1){if(!_0x1d91a1)return null;_0x52063a[_0xa126('0x1f')]['agent']=_0x1d91a1;return _0x52063a;})[_0xa126('0x29')](function(_0x5d0b4d){if(_0x5d0b4d){if(_0x28cef3[_0xa126('0x4e')][_0xa126('0x8b')]){_0x52063a[_0xa126('0x1f')][_0xa126('0x8c')]=util[_0xa126('0x72')](_0xa126('0x8d'),_0x28cef3['user']['name']);_0x52063a[_0xa126('0x1f')][_0xa126('0x8e')]=_0x52063a[_0xa126('0x8e')];_0x52063a[_0xa126('0x1f')][_0xa126('0x8f')]=_0x52063a['channel'];_0x52063a[_0xa126('0x1f')][_0xa126('0x90')]=_0xa126('0x91');_0x52063a[_0xa126('0x1f')][_0xa126('0x4e')]=htmlToText[_0xa126('0x92')](_0x52063a['message']['body']);return respondWithRpcPromise(_0xa126('0x93'),_0xa126('0x93'),{'event':_0xa126('0x94'),'message':_0x52063a[_0xa126('0x1f')]},client9002)[_0xa126('0x29')](function(){return _0x52063a;});}return _0x52063a;}return null;})[_0xa126('0x29')](respondWithResult(_0x48863a,null))['catch'](handleError(_0x48863a,null));};exports['reject']=function(_0x331348,_0x4ec63a){var _0x396960={'agent':{},'channel':_0xa126('0x74')};if(_0x331348['body']['id']){delete _0x331348[_0xa126('0x4e')]['id'];}_0x331348[_0xa126('0x4e')]['UserId']=_0x331348[_0xa126('0x4e')]['UserId']||_0x331348[_0xa126('0x62')]['id'];_0x396960[_0xa126('0x78')]['id']=_0x331348[_0xa126('0x4e')][_0xa126('0x77')];return db[_0xa126('0x32')][_0xa126('0x4c')]({'where':{'id':_0x331348[_0xa126('0x49')]['id'],'UserId':null}})[_0xa126('0x29')](handleEntityNotFound(_0x4ec63a,null))[_0xa126('0x29')](function(_0x4bc34d){if(_0x4bc34d){_0x396960[_0xa126('0x1f')]=_0x4bc34d[_0xa126('0x79')]({'plain':!![]});return db[_0xa126('0x7a')][_0xa126('0x4c')]({'where':{'id':_0x4bc34d[_0xa126('0x7b')]}});}return null;})[_0xa126('0x29')](handleEntityNotFound(_0x4ec63a,null))[_0xa126('0x29')](function(_0x513945){if(_0x513945){_0x396960['interaction']=_0x513945[_0xa126('0x79')]({'plain':!![]});interaction_log[_0xa126('0x17')](_0xa126('0x95'),_0x331348[_0xa126('0x62')]['id'],_0x331348[_0xa126('0x62')][_0xa126('0x2e')],_0x331348['user'][_0xa126('0x7e')],_0x396960[_0xa126('0x7d')]['id'],_0x331348[_0xa126('0x4e')]?JSON['stringify'](_0x331348[_0xa126('0x4e')]):_0xa126('0x7f'));return respondWithRpcPromise(_0xa126('0x96'),_0xa126('0x97'),_0x396960);}return null;})['then'](function(_0x52bc84){var _0x5045e6='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x52bc84[_0xa126('0x1f')][_0xa126('0x98')];return db['sequelize']['query'](_0x5045e6,{'type':db[_0xa126('0x99')][_0xa126('0x84')][_0xa126('0x85')],'raw':!![]})[_0xa126('0x29')](function(_0x3a99ec){return _0x3a99ec;});})[_0xa126('0x29')](function(_0x280d66){if(_0x280d66){_0x396960['message']['contact']=_0x280d66[0x0];if(!_0x331348['body'][_0xa126('0x77')])return;return db[_0xa126('0x87')][_0xa126('0x4c')]({'where':{'id':_0x331348[_0xa126('0x4e')]['UserId'],'role':_0xa126('0x78')},'attributes':['id',_0xa126('0x2e'),_0xa126('0x88'),_0xa126('0x89'),_0xa126('0x8a')],'raw':!![]});}return null;})[_0xa126('0x29')](function(_0x1be665){if(!_0x1be665)return null;_0x396960[_0xa126('0x1f')][_0xa126('0x78')]=_0x1be665;return _0x396960;})[_0xa126('0x29')](function(_0x5472be){if(_0x5472be){_0x5472be[_0xa126('0x1f')][_0xa126('0x8c')]=util[_0xa126('0x72')](_0xa126('0x8d'),_0x331348['user'][_0xa126('0x2e')]);_0x5472be['message'][_0xa126('0x8e')]=_0x396960['channel'];_0x5472be[_0xa126('0x1f')]['motionChannel']=_0x396960[_0xa126('0x8e')];_0x5472be[_0xa126('0x1f')]['event']=_0xa126('0x9a');_0x5472be['message']['body']=htmlToText[_0xa126('0x92')](_0x396960['message'][_0xa126('0x4e')]);respondWithRpcPromise(_0xa126('0x93'),_0xa126('0x93'),{'event':'rejectmessage','message':_0x5472be[_0xa126('0x1f')]},client9002);return _0x396960;}return null;})[_0xa126('0x29')](respondWithResult(_0x4ec63a,null))['catch'](handleError(_0x4ec63a,null));};exports[_0xa126('0x9b')]=function(_0xd53339,_0x205b1f){var _0x24adf7=moment()[_0xa126('0x9c')]()[_0xa126('0x9d')]();var _0x524ead=path[_0xa126('0x66')](config[_0xa126('0x67')],_0xa126('0x9e'),_0xa126('0x9f'),'tmp');var _0x33a0b1=path[_0xa126('0x66')](config[_0xa126('0x67')],_0xa126('0x9e'),'files',_0xa126('0x65'));var _0x1a9eff=util['format'](_0xa126('0xa0'),_0x24adf7);return db['MailMessage'][_0xa126('0x4c')]({'where':{'id':_0xd53339[_0xa126('0x49')]['id']},'attributes':['id','body','from','to','cc',_0xa126('0xa1'),_0xa126('0xa2'),_0xa126('0xa3')],'include':_0xd53339[_0xa126('0x35')][_0xa126('0x65')]?[{'model':db[_0xa126('0xa4')],'as':_0xa126('0xa5')}]:undefined})[_0xa126('0x29')](handleEntityNotFound(_0x205b1f,null))['then'](function(_0x1599bf){if(_0x1599bf){var _0x5c69f3=_0x1599bf;var _0x445670={'from':_0x5c69f3['from'],'to':_0x5c69f3['to'],'subject':_0x5c69f3[_0xa126('0xa2')],'html':htmlEntities[_0xa126('0xa6')](_0x5c69f3[_0xa126('0x4e')]),'headers':{'Date':moment(_0x5c69f3[_0xa126('0xa3')])[_0xa126('0x72')](_0xa126('0xa7'))},'attachments':[]};if(_0x1599bf['cc']){_0x445670['headers']['Cc']=_0x1599bf['cc'];}if(_0x1599bf[_0xa126('0xa1')]){_0x445670[_0xa126('0xa8')]['Bcc']=_0x1599bf[_0xa126('0xa1')];}return new BPromise(function(_0x56d3fa,_0x20b257){if(_0x1599bf[_0xa126('0xa5')]){for(var _0x2ddd6e=0x0;_0x2ddd6e<_0x1599bf[_0xa126('0xa5')]['length'];_0x2ddd6e++){var _0x5ad2cd=_0x1599bf['Attachments'][_0x2ddd6e];var _0x1b8079=path[_0xa126('0x66')](_0x33a0b1,_0x5ad2cd[_0xa126('0x69')]);if(fs[_0xa126('0xa9')](_0x1b8079)){_0x445670['attachments']['push']({'name':_0x5ad2cd[_0xa126('0x2e')],'contentType':_0x5ad2cd[_0xa126('0x43')],'data':fs['readFileSync'](_0x1b8079)});}}}emlformat[_0xa126('0xaa')](_0x445670,function(_0x216b1f,_0x157a21){if(_0x216b1f)return _0x20b257(_0x216b1f);fs[_0xa126('0xab')](path[_0xa126('0x66')](_0x524ead,_0x1a9eff),_0x157a21);return _0x56d3fa(_0x157a21);});});}})[_0xa126('0x29')](function(_0x1d9fd3){if(_0x1d9fd3){return _0x205b1f[_0xa126('0x9b')](path[_0xa126('0x66')](_0x524ead,_0x1a9eff),_0x1a9eff,function(_0x36a80c){if(!_0x36a80c)fs['unlinkSync'](path[_0xa126('0x66')](_0x524ead,_0x1a9eff));});}})['catch'](handleError(_0x205b1f,null));}; \ No newline at end of file +var _0xbe9e=['attributes','length','sort','where','pick','merge','VIRTUAL','filter','options','MailMessage','includeAll','include','findAll','rows','params','intersection','catch','body','find','destroy','describe','create','direction','secret','split','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','SendMail','sendMail','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail','readAt','format','UserId','agent','get','MailInteraction','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','email','internal','manual','interface','channel','event','fromString','EventManager','acceptmessage','reject','MailInteractionId','null','rejectMessage','contact','fullname','SIP/%s','motionChannel','rejectmessage','download','unix','server','files','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','moment','bluebird','path','lodash','ioredis','html-to-text','api','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','html-entities','jayson/promise','client','http','request','info','request\x20sent','debug','error','code','MailMessage,\x20%s,\x20%s','message','result','status','json','undefined','count','offset','limit','set','Content-Range','update','then','sendStatus','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','fields'];(function(_0x3a5ee7,_0x4f77c4){var _0x52304d=function(_0x365267){while(--_0x365267){_0x3a5ee7['push'](_0x3a5ee7['shift']());}};_0x52304d(++_0x4f77c4);}(_0xbe9e,0x6e));var _0xebe9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbe9e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var moment=require(_0xebe9('0x0'));var BPromise=require(_0xebe9('0x1'));var util=require('util');var path=require(_0xebe9('0x2'));var fs=require('fs');var _=require(_0xebe9('0x3'));var Redis=require(_0xebe9('0x4'));var htmlToText=require(_0xebe9('0x5'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xebe9('0x6'));var interaction_log=require(_0xebe9('0x7'))(_0xebe9('0x8'));var config=require(_0xebe9('0x9'));var db=require(_0xebe9('0xa'))['db'];config[_0xebe9('0xb')]=_[_0xebe9('0xc')](config[_0xebe9('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xebe9('0xd'))(new Redis(config[_0xebe9('0xb')]));var htmlEntities=require(_0xebe9('0xe'));require('./mailMessage.socket')['register'](socket);var jayson=require(_0xebe9('0xf'));var client=jayson[_0xebe9('0x10')][_0xebe9('0x11')]({'port':0x232c});var client9003=jayson[_0xebe9('0x10')][_0xebe9('0x11')]({'port':0x232b});var client9002=jayson[_0xebe9('0x10')][_0xebe9('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x2b9dc6,_0x544ac8,_0x5e580d,_0x4bd6c4){return new BPromise(function(_0x50c906,_0x5dd728){var _0xcb397=_0x4bd6c4||client;return _0xcb397[_0xebe9('0x12')](_0x2b9dc6,_0x5e580d)['then'](function(_0x13a3b3){logger[_0xebe9('0x13')]('MailMessage,\x20%s,\x20%s',_0x544ac8,_0xebe9('0x14'));logger[_0xebe9('0x15')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x544ac8,'request\x20sent',JSON['stringify'](_0x13a3b3));if(_0x13a3b3[_0xebe9('0x16')]){if(_0x13a3b3[_0xebe9('0x16')][_0xebe9('0x17')]===0x1f4){logger[_0xebe9('0x16')](_0xebe9('0x18'),_0x544ac8,_0x13a3b3[_0xebe9('0x16')]['message']);return _0x5dd728(_0x13a3b3[_0xebe9('0x16')][_0xebe9('0x19')]);}logger[_0xebe9('0x16')](_0xebe9('0x18'),_0x544ac8,_0x13a3b3[_0xebe9('0x16')][_0xebe9('0x19')]);return _0x50c906(_0x13a3b3['error'][_0xebe9('0x19')]);}else{logger[_0xebe9('0x13')](_0xebe9('0x18'),_0x544ac8,_0xebe9('0x14'));_0x50c906(_0x13a3b3[_0xebe9('0x1a')]['message']);}})['catch'](function(_0x47ec8d){logger[_0xebe9('0x16')](_0xebe9('0x18'),_0x544ac8,_0x47ec8d);_0x5dd728(_0x47ec8d);});});}function respondWithResult(_0x4bdc7f,_0x1c25ac){_0x1c25ac=_0x1c25ac||0xc8;return function(_0x51b357){if(_0x51b357){return _0x4bdc7f[_0xebe9('0x1b')](_0x1c25ac)[_0xebe9('0x1c')](_0x51b357);}};}function respondWithFilteredResult(_0x5b7f54,_0x5d40d6){return function(_0x15fb8a){if(_0x15fb8a){var _0x32f94d=typeof _0x5d40d6['offset']===_0xebe9('0x1d')&&typeof _0x5d40d6['limit']===_0xebe9('0x1d');var _0x3613d6=_0x15fb8a[_0xebe9('0x1e')];var _0x1480bb=_0x32f94d?0x0:_0x5d40d6[_0xebe9('0x1f')];var _0x21f996=_0x32f94d?_0x15fb8a[_0xebe9('0x1e')]:_0x5d40d6['offset']+_0x5d40d6[_0xebe9('0x20')];var _0x174c74;if(_0x21f996>=_0x3613d6){_0x21f996=_0x3613d6;_0x174c74=0xc8;}else{_0x174c74=0xce;}_0x5b7f54[_0xebe9('0x1b')](_0x174c74);return _0x5b7f54[_0xebe9('0x21')](_0xebe9('0x22'),_0x1480bb+'-'+_0x21f996+'/'+_0x3613d6)[_0xebe9('0x1c')](_0x15fb8a);}return null;};}function saveUpdates(_0x4a83b2){return function(_0x279740){if(_0x279740){return _0x279740[_0xebe9('0x23')](_0x4a83b2)[_0xebe9('0x24')](function(_0x30facc){return _0x30facc;});}return null;};}function removeEntity(_0x35c8aa){return function(_0x23b0fc){if(_0x23b0fc){return _0x23b0fc['destroy']()['then'](function(){_0x35c8aa[_0xebe9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cd034){return function(_0xb416ab){if(!_0xb416ab){_0x5cd034[_0xebe9('0x25')](0x194);}return _0xb416ab;};}function handleError(_0x20978c,_0x5122d6){_0x5122d6=_0x5122d6||0x1f4;return function(_0xeda029){logger['error'](_0xeda029['stack']);if(_0xeda029[_0xebe9('0x26')]){delete _0xeda029['name'];}_0x20978c[_0xebe9('0x1b')](_0x5122d6)[_0xebe9('0x27')](_0xeda029);};}exports[_0xebe9('0x28')]=function(_0x397b50,_0x10bf8f){var _0x4ee306={},_0x3481ea={},_0x5a70b8={'count':0x0,'rows':[]};var _0x1c8c1a=_[_0xebe9('0x29')](db['MailMessage'][_0xebe9('0x2a')],function(_0x5f2eb9){return{'name':_0x5f2eb9[_0xebe9('0x2b')],'type':_0x5f2eb9[_0xebe9('0x2c')][_0xebe9('0x2d')]};});_0x3481ea[_0xebe9('0x2e')]=_['map'](_0x1c8c1a,'name');_0x3481ea[_0xebe9('0x2f')]=_[_0xebe9('0x30')](_0x397b50[_0xebe9('0x2f')]);_0x3481ea[_0xebe9('0x31')]=_['intersection'](_0x3481ea[_0xebe9('0x2e')],_0x3481ea[_0xebe9('0x2f')]);_0x4ee306['attributes']=_['intersection'](_0x3481ea['model'],qs['fields'](_0x397b50[_0xebe9('0x2f')][_0xebe9('0x32')]));_0x4ee306[_0xebe9('0x33')]=_0x4ee306[_0xebe9('0x33')][_0xebe9('0x34')]?_0x4ee306['attributes']:_0x3481ea['model'];if(!_0x397b50[_0xebe9('0x2f')]['hasOwnProperty']('nolimit')){_0x4ee306[_0xebe9('0x20')]=qs[_0xebe9('0x20')](_0x397b50[_0xebe9('0x2f')]['limit']);_0x4ee306['offset']=qs[_0xebe9('0x1f')](_0x397b50[_0xebe9('0x2f')][_0xebe9('0x1f')]);}_0x4ee306['order']=qs[_0xebe9('0x35')](_0x397b50['query'][_0xebe9('0x35')]);_0x4ee306[_0xebe9('0x36')]=qs['filters'](_[_0xebe9('0x37')](_0x397b50[_0xebe9('0x2f')],_0x3481ea[_0xebe9('0x31')]),_0x1c8c1a);if(_0x397b50[_0xebe9('0x2f')]['filter']){_0x4ee306[_0xebe9('0x36')]=_[_0xebe9('0x38')](_0x4ee306[_0xebe9('0x36')],{'$or':_[_0xebe9('0x29')](_0x1c8c1a,function(_0x3610e8){if(_0x3610e8['type']!==_0xebe9('0x39')){var _0x408729={};_0x408729[_0x3610e8[_0xebe9('0x26')]]={'$like':'%'+_0x397b50[_0xebe9('0x2f')][_0xebe9('0x3a')]+'%'};return _0x408729;}})});}_0x4ee306=_[_0xebe9('0x38')]({},_0x4ee306,_0x397b50[_0xebe9('0x3b')]);var _0x4cd824={'where':_0x4ee306[_0xebe9('0x36')]};return db[_0xebe9('0x3c')][_0xebe9('0x1e')](_0x4cd824)[_0xebe9('0x24')](function(_0x469bad){_0x5a70b8[_0xebe9('0x1e')]=_0x469bad;if(_0x397b50[_0xebe9('0x2f')][_0xebe9('0x3d')]){_0x4ee306[_0xebe9('0x3e')]=[{'all':!![]}];}return db['MailMessage'][_0xebe9('0x3f')](_0x4ee306);})[_0xebe9('0x24')](function(_0x16304b){_0x5a70b8[_0xebe9('0x40')]=_0x16304b;return _0x5a70b8;})[_0xebe9('0x24')](respondWithFilteredResult(_0x10bf8f,_0x4ee306))['catch'](handleError(_0x10bf8f,null));};exports['show']=function(_0x49ca2e,_0x6ee2cc){var _0x5dddc5={'raw':!![],'where':{'id':_0x49ca2e[_0xebe9('0x41')]['id']}},_0x18ade7={};_0x18ade7[_0xebe9('0x2e')]=_[_0xebe9('0x30')](db[_0xebe9('0x3c')]['rawAttributes']);_0x18ade7[_0xebe9('0x2f')]=_['keys'](_0x49ca2e[_0xebe9('0x2f')]);_0x18ade7[_0xebe9('0x31')]=_[_0xebe9('0x42')](_0x18ade7[_0xebe9('0x2e')],_0x18ade7['query']);_0x5dddc5[_0xebe9('0x33')]=_[_0xebe9('0x42')](_0x18ade7['model'],qs['fields'](_0x49ca2e[_0xebe9('0x2f')][_0xebe9('0x32')]));_0x5dddc5[_0xebe9('0x33')]=_0x5dddc5[_0xebe9('0x33')][_0xebe9('0x34')]?_0x5dddc5['attributes']:_0x18ade7[_0xebe9('0x2e')];if(_0x49ca2e['query'][_0xebe9('0x3d')]){_0x5dddc5[_0xebe9('0x3e')]=[{'all':!![]}];}_0x5dddc5=_[_0xebe9('0x38')]({},_0x5dddc5,_0x49ca2e[_0xebe9('0x3b')]);return db['MailMessage']['find'](_0x5dddc5)[_0xebe9('0x24')](handleEntityNotFound(_0x6ee2cc,null))[_0xebe9('0x24')](respondWithResult(_0x6ee2cc,null))[_0xebe9('0x43')](handleError(_0x6ee2cc,null));};exports[_0xebe9('0x23')]=function(_0x5b7bde,_0xacde52){if(_0x5b7bde['body']['id']){delete _0x5b7bde[_0xebe9('0x44')]['id'];}return db[_0xebe9('0x3c')][_0xebe9('0x45')]({'where':{'id':_0x5b7bde['params']['id']}})[_0xebe9('0x24')](handleEntityNotFound(_0xacde52,null))['then'](saveUpdates(_0x5b7bde[_0xebe9('0x44')],null))[_0xebe9('0x24')](respondWithResult(_0xacde52,null))['catch'](handleError(_0xacde52,null));};exports[_0xebe9('0x46')]=function(_0x5f5d66,_0x112a63){return db[_0xebe9('0x3c')][_0xebe9('0x45')]({'where':{'id':_0x5f5d66[_0xebe9('0x41')]['id']}})[_0xebe9('0x24')](handleEntityNotFound(_0x112a63,null))['then'](removeEntity(_0x112a63,null))[_0xebe9('0x43')](handleError(_0x112a63,null));};exports[_0xebe9('0x47')]=function(_0x652815,_0x263aeb){return db[_0xebe9('0x3c')][_0xebe9('0x47')]()[_0xebe9('0x24')](respondWithResult(_0x263aeb,null))['catch'](handleError(_0x263aeb,null));};exports['create']=function(_0x33ebd5,_0x59590a){return db['MailMessage'][_0xebe9('0x48')](_0x33ebd5[_0xebe9('0x44')])[_0xebe9('0x24')](function(_0x61f9b1){if(_0x61f9b1){if(_0x61f9b1[_0xebe9('0x49')]==='out'&&!_0x61f9b1[_0xebe9('0x4a')]){var _0x470b27,_0x52f85d,_0x2a3d42;if(_0x33ebd5[_0xebe9('0x44')]['to']){_0x52f85d=_0x33ebd5[_0xebe9('0x44')]['to'][_0xebe9('0x4b')](',')[0x0];}return db['MailAccount'][_0xebe9('0x4c')]({'where':{'id':_0x61f9b1[_0xebe9('0x4d')]},'include':[{'model':db[_0xebe9('0x4e')],'as':_0xebe9('0x4f'),'include':[{'model':db[_0xebe9('0x50')],'as':_0xebe9('0x51'),'where':{'email':_0x52f85d},'limit':0x1,'order':[[_0xebe9('0x52'),_0xebe9('0x53')]]}]},{'model':db['MailServerOut'],'as':_0xebe9('0x54'),'raw':!![]}]})[_0xebe9('0x24')](function(_0x1ab744){_0x470b27=_0x1ab744;if(_0x470b27&&_0x470b27[_0xebe9('0x54')]){var _0x4709d3={'tls':{'rejectUnauthorized':![]}};if(_[_0xebe9('0x55')](_0x470b27[_0xebe9('0x54')][_0xebe9('0x56')])){_0x4709d3[_0xebe9('0x57')]=_0x470b27[_0xebe9('0x54')][_0xebe9('0x57')];_0x4709d3[_0xebe9('0x58')]=_0x470b27[_0xebe9('0x54')]['port'];_0x4709d3[_0xebe9('0x59')]=_0x470b27['Smtp'][_0xebe9('0x59')];if(_0x470b27[_0xebe9('0x54')][_0xebe9('0x5a')]){_0x4709d3[_0xebe9('0x5b')]={'user':_0x470b27[_0xebe9('0x54')][_0xebe9('0x5c')],'pass':_0x470b27[_0xebe9('0x54')][_0xebe9('0x5d')]};}}else{_0x4709d3[_0xebe9('0x56')]=_0x470b27[_0xebe9('0x54')][_0xebe9('0x56')];_0x4709d3[_0xebe9('0x5b')]={'user':_0x470b27[_0xebe9('0x54')][_0xebe9('0x5c')],'pass':_0x470b27['Smtp'][_0xebe9('0x5d')]};_0x4709d3[_0xebe9('0x59')]=_0x470b27[_0xebe9('0x54')][_0xebe9('0x59')];}if(_0x33ebd5[_0xebe9('0x44')][_0xebe9('0x5e')]&&_0x33ebd5[_0xebe9('0x44')][_0xebe9('0x5e')][_0xebe9('0x34')]){for(var _0x3dca1f=0x0;_0x3dca1f<_0x33ebd5[_0xebe9('0x44')][_0xebe9('0x5e')]['length'];_0x3dca1f+=0x1){_0x33ebd5['body'][_0xebe9('0x5e')][_0x3dca1f]={'filename':_0x33ebd5[_0xebe9('0x44')][_0xebe9('0x5e')][_0x3dca1f][_0xebe9('0x26')],'path':path[_0xebe9('0x5f')](config[_0xebe9('0x60')],_0xebe9('0x61'),_0x33ebd5[_0xebe9('0x44')]['attachments'][_0x3dca1f]['basename'])};}}_0x2a3d42={'account':_0x4709d3,'message':_0x33ebd5[_0xebe9('0x44')]};return;}})['then'](function(){if(_0x470b27[_0xebe9('0x4f')]){if(_0x470b27[_0xebe9('0x4f')]['Contacts'][_0xebe9('0x34')]){return _0x470b27['List'][_0xebe9('0x51')][0x0];}else{return db[_0xebe9('0x50')][_0xebe9('0x48')](_[_0xebe9('0xc')](_0x33ebd5['body'],{'firstName':_0x33ebd5['body']['to'],'email':_0x33ebd5[_0xebe9('0x44')]['to'],'phone':_0x33ebd5[_0xebe9('0x44')]['to'],'ListId':_0x470b27['ListId']}));}}else{throw new Error('List\x20not\x20found');}})[_0xebe9('0x24')](function(){if(_0x2a3d42){return respondWithRpcPromise(_0xebe9('0x62'),_0xebe9('0x63'),_0x2a3d42,client9003)[_0xebe9('0x24')](function(_0x21186d){return _0x61f9b1[_0xebe9('0x23')]({'read':!![],'messageId':_0x21186d['messageId'],'sentAt':moment()['format'](_0xebe9('0x64'))});})[_0xebe9('0x43')](function(_0x566740){logger[_0xebe9('0x16')]('%s',JSON[_0xebe9('0x65')](_0x566740));return _0x61f9b1;});}return _0x61f9b1;});}return _0x61f9b1;}})[_0xebe9('0x24')](respondWithResult(_0x59590a,0xc9))[_0xebe9('0x43')](handleError(_0x59590a,null));};exports[_0xebe9('0x66')]=function(_0x805ae0,_0x1fda69){var _0x50d7a5={'agent':{},'channel':_0xebe9('0x67')};if(_0x805ae0[_0xebe9('0x44')]['id']){delete _0x805ae0[_0xebe9('0x44')]['id'];}_0x805ae0[_0xebe9('0x44')]['read']=!![];_0x805ae0[_0xebe9('0x44')][_0xebe9('0x68')]=moment()[_0xebe9('0x69')](_0xebe9('0x64'));_0x805ae0[_0xebe9('0x44')][_0xebe9('0x6a')]=_0x805ae0[_0xebe9('0x44')][_0xebe9('0x6a')]||_0x805ae0['user']['id'];_0x50d7a5[_0xebe9('0x6b')]['id']=_0x805ae0[_0xebe9('0x44')]['UserId'];return db[_0xebe9('0x3c')][_0xebe9('0x45')]({'where':{'id':_0x805ae0[_0xebe9('0x41')]['id'],'UserId':null}})[_0xebe9('0x24')](handleEntityNotFound(_0x1fda69,null))[_0xebe9('0x24')](saveUpdates(_0x805ae0[_0xebe9('0x44')],null))[_0xebe9('0x24')](function(_0x695d3){if(_0x695d3){_0x50d7a5[_0xebe9('0x19')]=_0x695d3[_0xebe9('0x6c')]({'plain':!![]});return db[_0xebe9('0x6d')]['find']({'where':{'id':_0x695d3['MailInteractionId']}});}return null;})[_0xebe9('0x24')](handleEntityNotFound(_0x1fda69,null))[_0xebe9('0x24')](function(_0xb6e30c){if(_0xb6e30c){return _0xb6e30c[_0xebe9('0x23')]({'UserId':_0x805ae0[_0xebe9('0x44')][_0xebe9('0x6a')],'read1stAt':_[_0xebe9('0x55')](_0xb6e30c[_0xebe9('0x6e')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xebe9('0x24')](function(_0x2f5627){if(_0x2f5627){_0x50d7a5[_0xebe9('0x6f')]=_0x2f5627[_0xebe9('0x6c')]({'plain':!![]});interaction_log[_0xebe9('0x13')](_0xebe9('0x70'),_0x805ae0[_0xebe9('0x5c')]['id'],_0x805ae0['user']['name'],_0x805ae0[_0xebe9('0x5c')][_0xebe9('0x71')],_0x50d7a5[_0xebe9('0x6f')]['id'],_0x805ae0[_0xebe9('0x44')]?JSON[_0xebe9('0x65')](_0x805ae0[_0xebe9('0x44')]):'null');return respondWithRpcPromise('AcceptMessage',_0xebe9('0x72'),_0x50d7a5);}return null;})['then'](function(_0x23ada8){var _0x3af7f6=_0xebe9('0x73')+_0x23ada8[_0xebe9('0x19')][_0xebe9('0x74')];return db[_0xebe9('0x75')][_0xebe9('0x2f')](_0x3af7f6,{'type':db[_0xebe9('0x76')][_0xebe9('0x77')][_0xebe9('0x78')],'raw':!![]})['then'](function(_0x58ef0a){return _0x58ef0a;});})['then'](function(_0x4aba94){if(_0x4aba94){_0x50d7a5[_0xebe9('0x19')]['contact']=_0x4aba94[0x0];if(!_0x805ae0[_0xebe9('0x44')][_0xebe9('0x6a')])return;return db[_0xebe9('0x79')][_0xebe9('0x45')]({'where':{'id':_0x805ae0[_0xebe9('0x44')]['UserId'],'role':'agent'},'attributes':['id',_0xebe9('0x26'),'fullname',_0xebe9('0x7a'),_0xebe9('0x7b')],'raw':!![]});}return null;})[_0xebe9('0x24')](function(_0x3b7876){if(!_0x3b7876)return null;_0x50d7a5[_0xebe9('0x19')][_0xebe9('0x6b')]=_0x3b7876;return _0x50d7a5;})[_0xebe9('0x24')](function(_0x493d26){if(_0x493d26){if(_0x805ae0[_0xebe9('0x44')][_0xebe9('0x7c')]){_0x50d7a5['message'][_0xebe9('0x7d')]=util[_0xebe9('0x69')]('SIP/%s',_0x805ae0[_0xebe9('0x5c')][_0xebe9('0x26')]);_0x50d7a5[_0xebe9('0x19')][_0xebe9('0x7e')]=_0x50d7a5['channel'];_0x50d7a5['message']['motionChannel']=_0x50d7a5['channel'];_0x50d7a5[_0xebe9('0x19')][_0xebe9('0x7f')]='accept';_0x50d7a5['message'][_0xebe9('0x44')]=htmlToText[_0xebe9('0x80')](_0x50d7a5[_0xebe9('0x19')][_0xebe9('0x44')]);return respondWithRpcPromise(_0xebe9('0x81'),'EventManager',{'event':_0xebe9('0x82'),'message':_0x50d7a5[_0xebe9('0x19')]},client9002)[_0xebe9('0x24')](function(){return _0x50d7a5;});}return _0x50d7a5;}return null;})['then'](respondWithResult(_0x1fda69,null))['catch'](handleError(_0x1fda69,null));};exports[_0xebe9('0x83')]=function(_0x4c7bb0,_0x4c01fb){var _0x23ada1={'agent':{},'channel':_0xebe9('0x67')};if(_0x4c7bb0[_0xebe9('0x44')]['id']){delete _0x4c7bb0[_0xebe9('0x44')]['id'];}_0x4c7bb0[_0xebe9('0x44')][_0xebe9('0x6a')]=_0x4c7bb0[_0xebe9('0x44')][_0xebe9('0x6a')]||_0x4c7bb0[_0xebe9('0x5c')]['id'];_0x23ada1[_0xebe9('0x6b')]['id']=_0x4c7bb0['body']['UserId'];return db[_0xebe9('0x3c')]['find']({'where':{'id':_0x4c7bb0[_0xebe9('0x41')]['id'],'UserId':null}})[_0xebe9('0x24')](handleEntityNotFound(_0x4c01fb,null))[_0xebe9('0x24')](function(_0x336431){if(_0x336431){_0x23ada1[_0xebe9('0x19')]=_0x336431['get']({'plain':!![]});return db[_0xebe9('0x6d')][_0xebe9('0x45')]({'where':{'id':_0x336431[_0xebe9('0x84')]}});}return null;})[_0xebe9('0x24')](handleEntityNotFound(_0x4c01fb,null))[_0xebe9('0x24')](function(_0x1a2f2b){if(_0x1a2f2b){_0x23ada1['interaction']=_0x1a2f2b[_0xebe9('0x6c')]({'plain':!![]});interaction_log[_0xebe9('0x13')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4c7bb0['user']['id'],_0x4c7bb0[_0xebe9('0x5c')][_0xebe9('0x26')],_0x4c7bb0[_0xebe9('0x5c')][_0xebe9('0x71')],_0x23ada1[_0xebe9('0x6f')]['id'],_0x4c7bb0[_0xebe9('0x44')]?JSON['stringify'](_0x4c7bb0['body']):_0xebe9('0x85'));return respondWithRpcPromise('RejectMessage',_0xebe9('0x86'),_0x23ada1);}return null;})[_0xebe9('0x24')](function(_0x17ed3b){var _0x2ee47e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x17ed3b[_0xebe9('0x19')][_0xebe9('0x74')];return db['sequelize'][_0xebe9('0x2f')](_0x2ee47e,{'type':db[_0xebe9('0x76')]['QueryTypes']['SELECT'],'raw':!![]})[_0xebe9('0x24')](function(_0x16026a){return _0x16026a;});})[_0xebe9('0x24')](function(_0x24df08){if(_0x24df08){_0x23ada1['message'][_0xebe9('0x87')]=_0x24df08[0x0];if(!_0x4c7bb0[_0xebe9('0x44')][_0xebe9('0x6a')])return;return db[_0xebe9('0x79')][_0xebe9('0x45')]({'where':{'id':_0x4c7bb0[_0xebe9('0x44')][_0xebe9('0x6a')],'role':_0xebe9('0x6b')},'attributes':['id','name',_0xebe9('0x88'),'email',_0xebe9('0x7b')],'raw':!![]});}return null;})[_0xebe9('0x24')](function(_0x9696e5){if(!_0x9696e5)return null;_0x23ada1[_0xebe9('0x19')][_0xebe9('0x6b')]=_0x9696e5;return _0x23ada1;})['then'](function(_0x46273f){if(_0x46273f){_0x46273f[_0xebe9('0x19')][_0xebe9('0x7d')]=util['format'](_0xebe9('0x89'),_0x4c7bb0[_0xebe9('0x5c')]['name']);_0x46273f['message']['channel']=_0x23ada1[_0xebe9('0x7e')];_0x46273f[_0xebe9('0x19')][_0xebe9('0x8a')]=_0x23ada1[_0xebe9('0x7e')];_0x46273f['message']['event']=_0xebe9('0x83');_0x46273f[_0xebe9('0x19')][_0xebe9('0x44')]=htmlToText[_0xebe9('0x80')](_0x23ada1[_0xebe9('0x19')][_0xebe9('0x44')]);respondWithRpcPromise('EventManager',_0xebe9('0x81'),{'event':_0xebe9('0x8b'),'message':_0x46273f['message']},client9002);return _0x23ada1;}return null;})['then'](respondWithResult(_0x4c01fb,null))['catch'](handleError(_0x4c01fb,null));};exports[_0xebe9('0x8c')]=function(_0x5bf07a,_0xe5d764){var _0x3e277c=moment()[_0xebe9('0x8d')]()['toString']();var _0x1eab6d=path[_0xebe9('0x5f')](config[_0xebe9('0x60')],_0xebe9('0x8e'),_0xebe9('0x8f'),'tmp');var _0x5e4da7=path[_0xebe9('0x5f')](config['root'],_0xebe9('0x8e'),_0xebe9('0x8f'),_0xebe9('0x5e'));var _0x3bb2fc=util[_0xebe9('0x69')](_0xebe9('0x90'),_0x3e277c);return db[_0xebe9('0x3c')][_0xebe9('0x45')]({'where':{'id':_0x5bf07a[_0xebe9('0x41')]['id']},'attributes':['id',_0xebe9('0x44'),_0xebe9('0x91'),'to','cc',_0xebe9('0x92'),_0xebe9('0x93'),_0xebe9('0x94')],'include':_0x5bf07a['query']['attachments']?[{'model':db[_0xebe9('0x95')],'as':_0xebe9('0x96')}]:undefined})['then'](handleEntityNotFound(_0xe5d764,null))['then'](function(_0x3b25af){if(_0x3b25af){var _0x7ff6b=_0x3b25af;var _0x50712d={'from':_0x7ff6b[_0xebe9('0x91')],'to':_0x7ff6b['to'],'subject':_0x7ff6b[_0xebe9('0x93')],'html':htmlEntities[_0xebe9('0x97')](_0x7ff6b[_0xebe9('0x44')]),'headers':{'Date':moment(_0x7ff6b[_0xebe9('0x94')])['format'](_0xebe9('0x98'))},'attachments':[]};if(_0x3b25af['cc']){_0x50712d[_0xebe9('0x99')]['Cc']=_0x3b25af['cc'];}if(_0x3b25af[_0xebe9('0x92')]){_0x50712d[_0xebe9('0x99')][_0xebe9('0x9a')]=_0x3b25af['bcc'];}return new BPromise(function(_0xff89db,_0x1cc7ba){if(_0x3b25af[_0xebe9('0x96')]){for(var _0x5829e0=0x0;_0x5829e0<_0x3b25af[_0xebe9('0x96')]['length'];_0x5829e0++){var _0x1e4632=_0x3b25af[_0xebe9('0x96')][_0x5829e0];var _0x19ee2b=path['join'](_0x5e4da7,_0x1e4632['basename']);if(fs[_0xebe9('0x9b')](_0x19ee2b)){_0x50712d[_0xebe9('0x5e')][_0xebe9('0x9c')]({'name':_0x1e4632[_0xebe9('0x26')],'contentType':_0x1e4632[_0xebe9('0x2c')],'data':fs[_0xebe9('0x9d')](_0x19ee2b)});}}}emlformat[_0xebe9('0x9e')](_0x50712d,function(_0x26a47b,_0x13ed0d){if(_0x26a47b)return _0x1cc7ba(_0x26a47b);fs[_0xebe9('0x9f')](path['join'](_0x1eab6d,_0x3bb2fc),_0x13ed0d);return _0xff89db(_0x13ed0d);});});}})['then'](function(_0x137763){if(_0x137763){return _0xe5d764[_0xebe9('0x8c')](path[_0xebe9('0x5f')](_0x1eab6d,_0x3bb2fc),_0x3bb2fc,function(_0x47c4b3){if(!_0x47c4b3)fs[_0xebe9('0xa0')](path[_0xebe9('0x5f')](_0x1eab6d,_0x3bb2fc));});}})[_0xebe9('0x43')](handleError(_0xe5d764,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index ca7608b..91a23e7 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 _0x52f1=['hook','events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x52f1,0x171));var _0x152f=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x52f1[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require(_0x152f('0x0'));var MailMessage=require(_0x152f('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x152f('0x2')](0x0);var events={'afterCreate':_0x152f('0x3'),'afterUpdate':_0x152f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5020e9){return function(_0x1739e2,_0x4e784f,_0x37a4b6){MailMessageEvents[_0x152f('0x5')](_0x5020e9+':'+_0x1739e2['id'],_0x1739e2);MailMessageEvents[_0x152f('0x5')](_0x5020e9,_0x1739e2);_0x37a4b6(null);};}for(var e in events){if(events[_0x152f('0x6')](e)){var event=events[e];MailMessage[_0x152f('0x7')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0x6be1=['../../mysqldb','MailMessage','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x56c036,_0x5b11bd){var _0x21d6ce=function(_0x37d00d){while(--_0x37d00d){_0x56c036['push'](_0x56c036['shift']());}};_0x21d6ce(++_0x5b11bd);}(_0x6be1,0xcf));var _0x16be=function(_0x3649b6,_0x1da019){_0x3649b6=_0x3649b6-0x0;var _0xc9bba9=_0x6be1[_0x3649b6];return _0xc9bba9;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x16be('0x0'))['db'][_0x16be('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x16be('0x2')](0x0);var events={'afterCreate':_0x16be('0x3'),'afterUpdate':_0x16be('0x4'),'afterDestroy':_0x16be('0x5')};function emitEvent(_0x4279a0){return function(_0x2b20cb,_0x265a1a,_0x411b7b){MailMessageEvents[_0x16be('0x6')](_0x4279a0+':'+_0x2b20cb['id'],_0x2b20cb);MailMessageEvents[_0x16be('0x6')](_0x4279a0,_0x2b20cb);_0x411b7b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x16be('0x7')](e,emitEvent(event));}}module[_0x16be('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 6637834..8247362 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 _0x5735=['isNil','UserId','findOne','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','./mailMessage.attributes','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','body','fromString','models','get','direction','toLowerCase','out','secret'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x5735,0xfb));var _0x5573=function(_0x55bf2a,_0x4d41e6){_0x55bf2a=_0x55bf2a-0x0;var _0x2d3b1e=_0x5735[_0x55bf2a];return _0x2d3b1e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5573('0x0'))(_0x5573('0x1'));var moment=require('moment');var BPromise=require(_0x5573('0x2'));var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5573('0x3'));module['exports']=function(_0x201dbd,_0x31a0f5){return _0x201dbd[_0x5573('0x4')](_0x5573('0x5'),attributes,{'tableName':_0x5573('0x6'),'paranoid':![],'indexes':[{'name':_0x5573('0x7'),'fields':[_0x5573('0x7')]},{'name':_0x5573('0x8'),'fields':[_0x5573('0x9'),_0x5573('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3e7ec6,_0x16494f,_0x575a2a){if(_0x3e7ec6[_0x5573('0xb')]){_0x3e7ec6[_0x5573('0x9')]=htmlToText[_0x5573('0xc')](_0x3e7ec6[_0x5573('0xb')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x575a2a(null,_0x16494f);},'afterCreate':function(_0x841655,_0x4db873,_0xa0fbc5){var _0x37bc74=_0x201dbd[_0x5573('0xd')];var _0x21a7e1=_0x841655[_0x5573('0xe')]({'plain':!![]});if(_0x21a7e1[_0x5573('0xf')][_0x5573('0x10')]()==='in'||_0x21a7e1[_0x5573('0xf')][_0x5573('0x10')]()===_0x5573('0x11')&&!_0x21a7e1[_0x5573('0x12')]&&!_[_0x5573('0x13')](_0x21a7e1[_0x5573('0x14')])){_0x37bc74['MailInteraction'][_0x5573('0x15')]({'where':{'id':_0x21a7e1[_0x5573('0x16')]}})[_0x5573('0x17')](function(_0x6a1b09){if(_0x6a1b09){_0x6a1b09[_0x5573('0x18')]({'lastMsgAt':_0x21a7e1[_0x5573('0x19')],'lastMsgDirection':_0x21a7e1[_0x5573('0xf')][_0x5573('0x10')]()});}})[_0x5573('0x1a')](function(_0x28aaba){console[_0x5573('0x1b')](_0x28aaba);});}_0xa0fbc5();}},'charset':_0x5573('0x1c'),'collate':_0x5573('0x1d')});}; \ No newline at end of file +var _0x6d6d=['../../config/logger','api','moment','request-promise','html-to-text','path','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','secret','isNil','MailInteraction','MailInteractionId','then','update','createdAt','catch','utf8mb4','util'];(function(_0x5f052b,_0x36addf){var _0x334e80=function(_0x5893a2){while(--_0x5893a2){_0x5f052b['push'](_0x5f052b['shift']());}};_0x334e80(++_0x36addf);}(_0x6d6d,0x149));var _0xd6d6=function(_0x1448c9,_0xba302c){_0x1448c9=_0x1448c9-0x0;var _0x1e3aec=_0x6d6d[_0x1448c9];return _0x1e3aec;};'use strict';var _=require('lodash');var util=require(_0xd6d6('0x0'));var logger=require(_0xd6d6('0x1'))(_0xd6d6('0x2'));var moment=require(_0xd6d6('0x3'));var BPromise=require('bluebird');var rp=require(_0xd6d6('0x4'));var htmlToText=require(_0xd6d6('0x5'));var fs=require('fs');var path=require(_0xd6d6('0x6'));var rimraf=require('rimraf');var config=require(_0xd6d6('0x7'));var attributes=require(_0xd6d6('0x8'));module[_0xd6d6('0x9')]=function(_0x64088c,_0x135d4a){return _0x64088c[_0xd6d6('0xa')](_0xd6d6('0xb'),attributes,{'tableName':_0xd6d6('0xc'),'paranoid':![],'indexes':[{'name':_0xd6d6('0xd'),'fields':[_0xd6d6('0xd')]},{'name':_0xd6d6('0xe'),'fields':['plainBody',_0xd6d6('0xf')],'type':_0xd6d6('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x12c0eb,_0x2f98e1,_0x216d74){if(_0x12c0eb[_0xd6d6('0x11')]){_0x12c0eb['plainBody']=htmlToText[_0xd6d6('0x12')](_0x12c0eb[_0xd6d6('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x216d74(null,_0x2f98e1);},'afterCreate':function(_0xadfba0,_0x5e5b3d,_0x5e49d9){var _0x247350=_0x64088c[_0xd6d6('0x13')];var _0x41bcce=_0xadfba0[_0xd6d6('0x14')]({'plain':!![]});if(_0x41bcce[_0xd6d6('0x15')]['toLowerCase']()==='in'||_0x41bcce[_0xd6d6('0x15')][_0xd6d6('0x16')]()===_0xd6d6('0x17')&&!_0x41bcce[_0xd6d6('0x18')]&&!_[_0xd6d6('0x19')](_0x41bcce['UserId'])){_0x247350[_0xd6d6('0x1a')]['findOne']({'where':{'id':_0x41bcce[_0xd6d6('0x1b')]}})[_0xd6d6('0x1c')](function(_0x5887e8){if(_0x5887e8){_0x5887e8[_0xd6d6('0x1d')]({'lastMsgAt':_0x41bcce[_0xd6d6('0x1e')],'lastMsgDirection':_0x41bcce['direction'][_0xd6d6('0x16')]()});}})[_0xd6d6('0x1f')](function(_0x505994){console['error'](_0x505994);});}_0x5e49d9();}},'charset':_0xd6d6('0x20'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index d2c15be..0da5507 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(_0x373eab,_0x53165e){var _0x2ca5c3=function(_0x5bf8d2){while(--_0x5bf8d2){_0x373eab['push'](_0x373eab['shift']());}};_0x2ca5c3(++_0x53165e);}(_0x80ed,0x11c));var _0xd80e=function(_0x26f548,_0x133769){_0x26f548=_0x26f548-0x0;var _0x3a7165=_0x80ed[_0x26f548];return _0x3a7165;};'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 _0x36ee=['catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateMailMessage','MailMessage','create','body','options','debug'];(function(_0x27b938,_0x4a7743){var _0x27788d=function(_0x353764){while(--_0x353764){_0x27b938['push'](_0x27b938['shift']());}};_0x27788d(++_0x4a7743);}(_0x36ee,0xe8));var _0xe36e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x36ee[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe36e('0x0'));var BPromise=require('bluebird');var rs=require(_0xe36e('0x1'));var fs=require('fs');var Redis=require(_0xe36e('0x2'));var db=require(_0xe36e('0x3'))['db'];var utils=require(_0xe36e('0x4'));var logger=require(_0xe36e('0x5'))(_0xe36e('0x6'));var config=require(_0xe36e('0x7'));var jayson=require(_0xe36e('0x8'));var client=jayson[_0xe36e('0x9')][_0xe36e('0xa')]({'port':0x232a});config[_0xe36e('0xb')]=_[_0xe36e('0xc')](config['redis'],{'host':_0xe36e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe36e('0xb')]));require(_0xe36e('0xe'))[_0xe36e('0xf')](socket);function respondWithRpcPromise(_0x47ce3a,_0xf119e4,_0x48981b){return new BPromise(function(_0x2e968d,_0x2133cf){return client[_0xe36e('0x10')](_0x47ce3a,_0x48981b)[_0xe36e('0x11')](function(_0xce0110){logger[_0xe36e('0x12')](_0xe36e('0x13'),_0xf119e4,_0xe36e('0x14'));logger['debug'](_0xe36e('0x15'),_0xf119e4,_0xe36e('0x14'),JSON[_0xe36e('0x16')](_0xce0110));if(_0xce0110[_0xe36e('0x17')]){if(_0xce0110['error'][_0xe36e('0x18')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0xf119e4,_0xce0110[_0xe36e('0x17')][_0xe36e('0x19')]);return _0x2133cf(_0xce0110[_0xe36e('0x17')][_0xe36e('0x19')]);}logger[_0xe36e('0x17')](_0xe36e('0x13'),_0xf119e4,_0xce0110[_0xe36e('0x17')][_0xe36e('0x19')]);return _0x2e968d(_0xce0110[_0xe36e('0x17')][_0xe36e('0x19')]);}else{logger['info'](_0xe36e('0x13'),_0xf119e4,_0xe36e('0x14'));_0x2e968d(_0xce0110['result'][_0xe36e('0x19')]);}})['catch'](function(_0x471400){logger[_0xe36e('0x17')]('MailMessage,\x20%s,\x20%s',_0xf119e4,_0x471400);_0x2133cf(_0x471400);});});}exports[_0xe36e('0x1a')]=function(_0x6aa186){var _0x21efe7=this;return new Promise(function(_0x597331,_0x21e95e){return db[_0xe36e('0x1b')][_0xe36e('0x1c')](_0x6aa186[_0xe36e('0x1d')],{'raw':_0x6aa186[_0xe36e('0x1e')]?_0x6aa186[_0xe36e('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0xe36e('0x11')](function(_0x4f214a){logger[_0xe36e('0x12')](_0xe36e('0x1a'),_0x6aa186);logger[_0xe36e('0x1f')]('CreateMailMessage',_0x6aa186,JSON['stringify'](_0x4f214a));_0x597331(_0x4f214a);})[_0xe36e('0x20')](function(_0x10818d){logger[_0xe36e('0x17')](_0xe36e('0x1a'),_0x10818d[_0xe36e('0x19')],_0x6aa186);_0x21e95e(_0x21efe7[_0xe36e('0x17')](0x1f4,_0x10818d[_0xe36e('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 6a29c31..da911c0 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 _0xb592=['mailMessage:','./mailMessage.events','update','emit','removeListener','register','length'];(function(_0x42e7db,_0x2a96cf){var _0x22a940=function(_0x24f8d3){while(--_0x24f8d3){_0x42e7db['push'](_0x42e7db['shift']());}};_0x22a940(++_0x2a96cf);}(_0xb592,0x10b));var _0x2b59=function(_0x34109c,_0x40e4b8){_0x34109c=_0x34109c-0x0;var _0x540d2d=_0xb592[_0x34109c];return _0x540d2d;};'use strict';var MailMessageEvents=require(_0x2b59('0x0'));var events=['save','remove',_0x2b59('0x1')];function createListener(_0x5b86c1,_0x2a6396){return function(_0x4d0861){_0x2a6396[_0x2b59('0x2')](_0x5b86c1,_0x4d0861);};}function removeListener(_0x3b2158,_0x528701){return function(){MailMessageEvents[_0x2b59('0x3')](_0x3b2158,_0x528701);};}exports[_0x2b59('0x4')]=function(_0xd3b426){for(var _0x49f899=0x0,_0x5551a1=events[_0x2b59('0x5')];_0x49f899<_0x5551a1;_0x49f899++){var _0x53cde7=events[_0x49f899];var _0x36d058=createListener(_0x2b59('0x6')+_0x53cde7,_0xd3b426);MailMessageEvents['on'](_0x53cde7,_0x36d058);}}; \ No newline at end of file +var _0x7762=['mailMessage:','./mailMessage.events','save','remove','register','length'];(function(_0x4c80ef,_0xeb8bfd){var _0x5e6822=function(_0x1c12f0){while(--_0x1c12f0){_0x4c80ef['push'](_0x4c80ef['shift']());}};_0x5e6822(++_0xeb8bfd);}(_0x7762,0x17b));var _0x2776=function(_0x259fb3,_0x369881){_0x259fb3=_0x259fb3-0x0;var _0x4906cb=_0x7762[_0x259fb3];return _0x4906cb;};'use strict';var MailMessageEvents=require(_0x2776('0x0'));var events=[_0x2776('0x1'),_0x2776('0x2'),'update'];function createListener(_0x4266c6,_0x41dfda){return function(_0x30f3a1){_0x41dfda['emit'](_0x4266c6,_0x30f3a1);};}function removeListener(_0x43366b,_0x122cd9){return function(){MailMessageEvents['removeListener'](_0x43366b,_0x122cd9);};}exports[_0x2776('0x3')]=function(_0x489e72){for(var _0x4eefcf=0x0,_0x51fb08=events[_0x2776('0x4')];_0x4eefcf<_0x51fb08;_0x4eefcf++){var _0x110f10=events[_0x4eefcf];var _0x5364ad=createListener(_0x2776('0x5')+_0x110f10,_0x489e72);MailMessageEvents['on'](_0x110f10,_0x5364ad);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 105499b..1094cd5 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 _0xbdaf=['get','index','/describe','describe','isAuthenticated','show','/:id/members','getMembers','/:id/teams','post','create','addTeams','/:id/users','put','/:id','update','delete','destroy','removeTeams','removeAgents','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x41f0d0,_0x4af78c){var _0x8a8d2d=function(_0x40e467){while(--_0x40e467){_0x41f0d0['push'](_0x41f0d0['shift']());}};_0x8a8d2d(++_0x4af78c);}(_0xbdaf,0x18e));var _0xfbda=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0xbdaf[_0x45bf86];return _0x1f02b7;};'use strict';var multer=require('multer');var util=require(_0xfbda('0x0'));var path=require(_0xfbda('0x1'));var timeout=require(_0xfbda('0x2'));var express=require(_0xfbda('0x3'));var router=express['Router']();var fs_extra=require(_0xfbda('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfbda('0x5'));var config=require(_0xfbda('0x6'));var controller=require('./mailQueue.controller');router[_0xfbda('0x7')]('/',auth['isAuthenticated'](),controller[_0xfbda('0x8')]);router[_0xfbda('0x7')](_0xfbda('0x9'),auth['isAuthenticated'](),controller[_0xfbda('0xa')]);router[_0xfbda('0x7')]('/:id',auth[_0xfbda('0xb')](),controller[_0xfbda('0xc')]);router[_0xfbda('0x7')](_0xfbda('0xd'),auth[_0xfbda('0xb')](),controller[_0xfbda('0xe')]);router[_0xfbda('0x7')](_0xfbda('0xf'),auth[_0xfbda('0xb')](),controller['getTeams']);router[_0xfbda('0x7')]('/:id/users',auth[_0xfbda('0xb')](),controller['getAgents']);router[_0xfbda('0x10')]('/',auth['isAuthenticated'](),controller[_0xfbda('0x11')]);router['post']('/:id/teams',auth[_0xfbda('0xb')](),controller[_0xfbda('0x12')]);router[_0xfbda('0x10')](_0xfbda('0x13'),auth[_0xfbda('0xb')](),controller['addAgents']);router[_0xfbda('0x14')](_0xfbda('0x15'),auth['isAuthenticated'](),controller[_0xfbda('0x16')]);router[_0xfbda('0x17')](_0xfbda('0x15'),auth['isAuthenticated'](),controller[_0xfbda('0x18')]);router[_0xfbda('0x17')](_0xfbda('0xf'),auth['isAuthenticated'](),controller[_0xfbda('0x19')]);router['delete'](_0xfbda('0x13'),auth['isAuthenticated'](),controller[_0xfbda('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x8ab0=['update','delete','removeTeams','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','put'];(function(_0xa30766,_0x6f613e){var _0x24e780=function(_0x3d58fb){while(--_0x3d58fb){_0xa30766['push'](_0xa30766['shift']());}};_0x24e780(++_0x6f613e);}(_0x8ab0,0xdc));var _0x08ab=function(_0x412195,_0x4b32e3){_0x412195=_0x412195-0x0;var _0x47eccf=_0x8ab0[_0x412195];return _0x47eccf;};'use strict';var multer=require(_0x08ab('0x0'));var util=require('util');var path=require(_0x08ab('0x1'));var timeout=require(_0x08ab('0x2'));var express=require(_0x08ab('0x3'));var router=express['Router']();var fs_extra=require(_0x08ab('0x4'));var auth=require(_0x08ab('0x5'));var interaction=require(_0x08ab('0x6'));var config=require('../../config/environment');var controller=require(_0x08ab('0x7'));router[_0x08ab('0x8')]('/',auth[_0x08ab('0x9')](),controller[_0x08ab('0xa')]);router[_0x08ab('0x8')](_0x08ab('0xb'),auth['isAuthenticated'](),controller[_0x08ab('0xc')]);router['get'](_0x08ab('0xd'),auth['isAuthenticated'](),controller[_0x08ab('0xe')]);router['get']('/:id/members',auth[_0x08ab('0x9')](),controller[_0x08ab('0xf')]);router['get'](_0x08ab('0x10'),auth[_0x08ab('0x9')](),controller[_0x08ab('0x11')]);router['get'](_0x08ab('0x12'),auth[_0x08ab('0x9')](),controller[_0x08ab('0x13')]);router['post']('/',auth[_0x08ab('0x9')](),controller['create']);router[_0x08ab('0x14')]('/:id/teams',auth[_0x08ab('0x9')](),controller[_0x08ab('0x15')]);router[_0x08ab('0x14')](_0x08ab('0x12'),auth['isAuthenticated'](),controller['addAgents']);router[_0x08ab('0x16')](_0x08ab('0xd'),auth[_0x08ab('0x9')](),controller[_0x08ab('0x17')]);router[_0x08ab('0x18')](_0x08ab('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x08ab('0x18')](_0x08ab('0x10'),auth[_0x08ab('0x9')](),controller[_0x08ab('0x19')]);router[_0x08ab('0x18')]('/:id/users',auth[_0x08ab('0x9')](),controller['removeAgents']);module[_0x08ab('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 8ced974..6aac742 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 _0xdf1a=['roundrobin','sequelize','exports','STRING','name','INTEGER','rrmemory','beepall'];(function(_0x57a53b,_0x11494e){var _0x29e81c=function(_0x24c522){while(--_0x24c522){_0x57a53b['push'](_0x57a53b['shift']());}};_0x29e81c(++_0x11494e);}(_0xdf1a,0x169));var _0xadf1=function(_0x1bc762,_0x523eb3){_0x1bc762=_0x1bc762-0x0;var _0x40f70c=_0xdf1a[_0x1bc762];return _0x40f70c;};'use strict';var Sequelize=require(_0xadf1('0x0'));module[_0xadf1('0x1')]={'name':{'type':Sequelize[_0xadf1('0x2')],'unique':_0xadf1('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xadf1('0x2')]},'timeout':{'type':Sequelize[_0xadf1('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xadf1('0x5'),_0xadf1('0x6'),_0xadf1('0x7'))}}; \ No newline at end of file +var _0x1bba=['INTEGER','ENUM','roundrobin','sequelize','STRING','name'];(function(_0x3680b3,_0x107ab8){var _0x2d65cc=function(_0x30aeac){while(--_0x30aeac){_0x3680b3['push'](_0x3680b3['shift']());}};_0x2d65cc(++_0x107ab8);}(_0x1bba,0x105));var _0xa1bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1bba[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa1bb('0x0'));module['exports']={'name':{'type':Sequelize[_0xa1bb('0x1')],'unique':_0xa1bb('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xa1bb('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa1bb('0x4')]('rrmemory','beepall',_0xa1bb('0x5'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index d40e68f..b372907 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 _0x688a=['every','TeamId','includes','all','union','compact','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','socket.io-emitter','./mailQueue.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','MailQueues','UserProfileResource','end','sendStatus','error','index','fieldName','type','key','map','query','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','name','options','MailQueue','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','MailQueueId','User','UserId','agent','mailPause','updatedAt','createdAt','format','SIP','getTeams','Team','nolimit','ids','online','Agents','sequelize','transaction','addTeams','each','UserMailQueue','forEach','emit','userMailQueue:save','removeTeams','field','tq.TeamId','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT'];(function(_0x246f0c,_0x39f734){var _0x30fe50=function(_0x9a975c){while(--_0x9a975c){_0x246f0c['push'](_0x246f0c['shift']());}};_0x30fe50(++_0x39f734);}(_0x688a,0x124));var _0xa688=function(_0x290aff,_0x56dd51){_0x290aff=_0x290aff-0x0;var _0x36be4e=_0x688a[_0x290aff];return _0x36be4e;};'use strict';var emlformat=require(_0xa688('0x0'));var rimraf=require(_0xa688('0x1'));var zipdir=require(_0xa688('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa688('0x3'));var moment=require('moment');var BPromise=require(_0xa688('0x4'));var Mustache=require(_0xa688('0x5'));var util=require('util');var path=require(_0xa688('0x6'));var sox=require(_0xa688('0x7'));var csv=require(_0xa688('0x8'));var ejs=require(_0xa688('0x9'));var fs=require('fs');var fs_extra=require(_0xa688('0xa'));var _=require(_0xa688('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa688('0xc'));var deskjs=require(_0xa688('0xd'));var toCsv=require(_0xa688('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa688('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa688('0xf'));var hardwareService=require(_0xa688('0x10'));var logger=require(_0xa688('0x11'))(_0xa688('0x12'));var utils=require(_0xa688('0x13'));var config=require(_0xa688('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xa688('0x15')](config[_0xa688('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xa688('0x17'))(new Redis(config['redis']));require(_0xa688('0x18'))[_0xa688('0x19')](socket);function respondWithStatusCode(_0x506fca,_0x5b3caf){_0x5b3caf=_0x5b3caf||0xcc;return function(_0x2d4871){if(_0x2d4871){return _0x506fca['sendStatus'](_0x5b3caf);}return _0x506fca[_0xa688('0x1a')](_0x5b3caf)['end']();};}function respondWithResult(_0xe776d6,_0x1e7ad3){_0x1e7ad3=_0x1e7ad3||0xc8;return function(_0x41082d){if(_0x41082d){return _0xe776d6[_0xa688('0x1a')](_0x1e7ad3)[_0xa688('0x1b')](_0x41082d);}};}function respondWithFilteredResult(_0x10fc2d,_0x5715cb){return function(_0x59e392){if(_0x59e392){var _0x14ca3c=typeof _0x5715cb[_0xa688('0x1c')]==='undefined'&&typeof _0x5715cb['limit']===_0xa688('0x1d');var _0x2085bf=_0x59e392['count'];var _0x37e9af=_0x14ca3c?0x0:_0x5715cb['offset'];var _0x5c6925=_0x14ca3c?_0x59e392[_0xa688('0x1e')]:_0x5715cb[_0xa688('0x1c')]+_0x5715cb[_0xa688('0x1f')];var _0x27f12e;if(_0x5c6925>=_0x2085bf){_0x5c6925=_0x2085bf;_0x27f12e=0xc8;}else{_0x27f12e=0xce;}_0x10fc2d[_0xa688('0x1a')](_0x27f12e);return _0x10fc2d[_0xa688('0x20')](_0xa688('0x21'),_0x37e9af+'-'+_0x5c6925+'/'+_0x2085bf)[_0xa688('0x1b')](_0x59e392);}return null;};}function patchUpdates(_0x2a9f67){return function(_0x1a7bf2){try{jsonpatch[_0xa688('0x22')](_0x1a7bf2,_0x2a9f67,!![]);}catch(_0x301560){return BPromise[_0xa688('0x23')](_0x301560);}return _0x1a7bf2[_0xa688('0x24')]();};}function saveUpdates(_0x48cb17,_0x442672){return function(_0x32a682){if(_0x32a682){return _0x32a682['update'](_0x48cb17)[_0xa688('0x25')](function(_0x1e3106){return _0x1e3106;});}return null;};}function removeEntity(_0x53eec6,_0x2898cb){return function(_0x3b09c9){if(_0x3b09c9){return _0x3b09c9[_0xa688('0x26')]()[_0xa688('0x25')](function(){var _0x153a86=_0x3b09c9[_0xa688('0x27')]({'plain':!![]});var _0x337779=_0xa688('0x28');return db[_0xa688('0x29')][_0xa688('0x26')]({'where':{'type':_0x337779,'resourceId':_0x153a86['id']}})[_0xa688('0x25')](function(){return _0x3b09c9;});})[_0xa688('0x25')](function(){_0x53eec6[_0xa688('0x1a')](0xcc)[_0xa688('0x2a')]();});}};}function handleEntityNotFound(_0x1d4cfa,_0x5d1657){return function(_0x217a35){if(!_0x217a35){_0x1d4cfa[_0xa688('0x2b')](0x194);}return _0x217a35;};}function handleError(_0x1a8d72,_0x1f9d59){_0x1f9d59=_0x1f9d59||0x1f4;return function(_0x3d52fc){logger[_0xa688('0x2c')](_0x3d52fc['stack']);if(_0x3d52fc['name']){delete _0x3d52fc['name'];}_0x1a8d72[_0xa688('0x1a')](_0x1f9d59)['send'](_0x3d52fc);};}exports[_0xa688('0x2d')]=function(_0xf4841c,_0x6b3179){var _0x29e83c={},_0x40bf1f={},_0x197854={'count':0x0,'rows':[]};var _0x357d21=_['map'](db['MailQueue']['rawAttributes'],function(_0x58d820){return{'name':_0x58d820[_0xa688('0x2e')],'type':_0x58d820[_0xa688('0x2f')][_0xa688('0x30')]};});_0x40bf1f['model']=_[_0xa688('0x31')](_0x357d21,'name');_0x40bf1f['query']=_['keys'](_0xf4841c[_0xa688('0x32')]);_0x40bf1f[_0xa688('0x33')]=_[_0xa688('0x34')](_0x40bf1f['model'],_0x40bf1f['query']);_0x29e83c[_0xa688('0x35')]=_[_0xa688('0x34')](_0x40bf1f[_0xa688('0x36')],qs[_0xa688('0x37')](_0xf4841c[_0xa688('0x32')]['fields']));_0x29e83c['attributes']=_0x29e83c[_0xa688('0x35')]['length']?_0x29e83c[_0xa688('0x35')]:_0x40bf1f[_0xa688('0x36')];if(!_0xf4841c[_0xa688('0x32')][_0xa688('0x38')]('nolimit')){_0x29e83c[_0xa688('0x1f')]=qs['limit'](_0xf4841c['query'][_0xa688('0x1f')]);_0x29e83c['offset']=qs[_0xa688('0x1c')](_0xf4841c['query'][_0xa688('0x1c')]);}_0x29e83c[_0xa688('0x39')]=qs[_0xa688('0x3a')](_0xf4841c['query'][_0xa688('0x3a')]);_0x29e83c[_0xa688('0x3b')]=qs[_0xa688('0x33')](_[_0xa688('0x3c')](_0xf4841c[_0xa688('0x32')],_0x40bf1f[_0xa688('0x33')]),_0x357d21);if(_0xf4841c[_0xa688('0x32')][_0xa688('0x3d')]){_0x29e83c[_0xa688('0x3b')]=_[_0xa688('0x3e')](_0x29e83c[_0xa688('0x3b')],{'$or':_['map'](_0x357d21,function(_0x31ac39){if(_0x31ac39['type']!==_0xa688('0x3f')){var _0x394d70={};_0x394d70[_0x31ac39[_0xa688('0x40')]]={'$like':'%'+_0xf4841c[_0xa688('0x32')]['filter']+'%'};return _0x394d70;}})});}_0x29e83c=_[_0xa688('0x3e')]({},_0x29e83c,_0xf4841c[_0xa688('0x41')]);var _0x4b3bbd={'where':_0x29e83c[_0xa688('0x3b')]};return db[_0xa688('0x42')][_0xa688('0x1e')](_0x4b3bbd)[_0xa688('0x25')](function(_0x3205d4){_0x197854[_0xa688('0x1e')]=_0x3205d4;if(_0xf4841c[_0xa688('0x32')][_0xa688('0x43')]){_0x29e83c[_0xa688('0x44')]=[{'all':!![]}];}return db['MailQueue'][_0xa688('0x45')](_0x29e83c);})[_0xa688('0x25')](function(_0x4475b5){_0x197854[_0xa688('0x46')]=_0x4475b5;return _0x197854;})[_0xa688('0x25')](respondWithFilteredResult(_0x6b3179,_0x29e83c))[_0xa688('0x47')](handleError(_0x6b3179,null));};exports[_0xa688('0x48')]=function(_0x328799,_0x52e48f){var _0x25b2eb={'raw':!![],'where':{'id':_0x328799[_0xa688('0x49')]['id']}},_0x23f07d={};_0x23f07d[_0xa688('0x36')]=_['keys'](db[_0xa688('0x42')][_0xa688('0x4a')]);_0x23f07d['query']=_[_0xa688('0x4b')](_0x328799[_0xa688('0x32')]);_0x23f07d[_0xa688('0x33')]=_[_0xa688('0x34')](_0x23f07d[_0xa688('0x36')],_0x23f07d[_0xa688('0x32')]);_0x25b2eb['attributes']=_[_0xa688('0x34')](_0x23f07d[_0xa688('0x36')],qs[_0xa688('0x37')](_0x328799[_0xa688('0x32')][_0xa688('0x37')]));_0x25b2eb['attributes']=_0x25b2eb[_0xa688('0x35')][_0xa688('0x4c')]?_0x25b2eb[_0xa688('0x35')]:_0x23f07d[_0xa688('0x36')];if(_0x328799[_0xa688('0x32')][_0xa688('0x43')]){_0x25b2eb['include']=[{'all':!![]}];}_0x25b2eb=_[_0xa688('0x3e')]({},_0x25b2eb,_0x328799[_0xa688('0x41')]);return db[_0xa688('0x42')][_0xa688('0x4d')](_0x25b2eb)[_0xa688('0x25')](handleEntityNotFound(_0x52e48f,null))[_0xa688('0x25')](respondWithResult(_0x52e48f,null))[_0xa688('0x47')](handleError(_0x52e48f,null));};exports['create']=function(_0x1e1d1d,_0x1e8758){return db[_0xa688('0x42')][_0xa688('0x4e')](_0x1e1d1d['body'],{})[_0xa688('0x25')](function(_0x44a090){var _0x416bfd=_0x1e1d1d[_0xa688('0x4f')][_0xa688('0x27')]({'plain':!![]});if(!_0x416bfd)throw new Error(_0xa688('0x50'));if(_0x416bfd['role']===_0xa688('0x4f')){var _0x57861d=_0x44a090[_0xa688('0x27')]({'plain':!![]});var _0x58753e='MailQueues';return db[_0xa688('0x51')][_0xa688('0x4d')]({'where':{'name':_0x58753e,'userProfileId':_0x416bfd[_0xa688('0x52')]},'raw':!![]})['then'](function(_0x4381a4){if(_0x4381a4&&_0x4381a4['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x57861d['name'],'resourceId':_0x57861d['id'],'type':_0x4381a4['name'],'sectionId':_0x4381a4['id']},{})[_0xa688('0x25')](function(){return _0x44a090;});}else{return _0x44a090;}})[_0xa688('0x47')](function(_0x1f118b){logger['error'](_0xa688('0x53'),_0x1f118b);throw _0x1f118b;});}return _0x44a090;})['then'](respondWithResult(_0x1e8758,0xc9))[_0xa688('0x47')](handleError(_0x1e8758,null));};exports[_0xa688('0x54')]=function(_0x3adf43,_0x38defa){if(_0x3adf43[_0xa688('0x55')]['id']){delete _0x3adf43[_0xa688('0x55')]['id'];}return db[_0xa688('0x42')][_0xa688('0x4d')]({'where':{'id':_0x3adf43[_0xa688('0x49')]['id']}})[_0xa688('0x25')](handleEntityNotFound(_0x38defa,null))['then'](saveUpdates(_0x3adf43['body'],null))['then'](respondWithResult(_0x38defa,null))[_0xa688('0x47')](handleError(_0x38defa,null));};exports[_0xa688('0x26')]=function(_0x340b68,_0xc7dcb5){return db[_0xa688('0x42')][_0xa688('0x4d')]({'where':{'id':_0x340b68[_0xa688('0x49')]['id']}})[_0xa688('0x25')](handleEntityNotFound(_0xc7dcb5,null))[_0xa688('0x25')](removeEntity(_0xc7dcb5,null))[_0xa688('0x47')](handleError(_0xc7dcb5,null));};exports[_0xa688('0x56')]=function(_0x3a8b47,_0x3377ac){return db[_0xa688('0x42')][_0xa688('0x56')]()['then'](respondWithResult(_0x3377ac,null))['catch'](handleError(_0x3377ac,null));};exports[_0xa688('0x57')]=function(_0x4b1e22,_0x5290fd,_0x10bd5f){var _0xe3bb0c={'raw':!![],'where':{}},_0x4f190f={},_0x40ceb7;return db['MailQueue'][_0xa688('0x58')]({'where':{'id':_0x4b1e22['params']['id']}})[_0xa688('0x25')](handleEntityNotFound(_0x5290fd,null))['then'](function(_0x218b5e){if(_0x218b5e){_0x40ceb7=_0x218b5e[_0xa688('0x27')]({'plain':!![]});_0x4f190f[_0xa688('0x36')]=_[_0xa688('0x4b')](db['UserMailQueue'][_0xa688('0x4a')]);_0x4f190f[_0xa688('0x32')]=_[_0xa688('0x4b')](_0x4b1e22[_0xa688('0x32')]);_0x4f190f['filters']=_[_0xa688('0x34')](_0x4f190f[_0xa688('0x36')],_0x4f190f['query']);_0xe3bb0c['attributes']=_[_0xa688('0x34')](_0x4f190f[_0xa688('0x36')],qs[_0xa688('0x37')](_0x4b1e22[_0xa688('0x32')][_0xa688('0x37')]));_0xe3bb0c[_0xa688('0x35')]=_0xe3bb0c[_0xa688('0x35')][_0xa688('0x4c')]?_0xe3bb0c['attributes']:_0x4f190f[_0xa688('0x36')];if(!_0x4b1e22[_0xa688('0x32')][_0xa688('0x38')]('nolimit')){_0xe3bb0c[_0xa688('0x1f')]=qs[_0xa688('0x1f')](_0x4b1e22[_0xa688('0x32')][_0xa688('0x1f')]);_0xe3bb0c[_0xa688('0x1c')]=qs[_0xa688('0x1c')](_0x4b1e22['query'][_0xa688('0x1c')]);}_0xe3bb0c['order']=qs[_0xa688('0x3a')](_0x4b1e22[_0xa688('0x32')][_0xa688('0x3a')]);_0xe3bb0c[_0xa688('0x3b')]=qs['filters'](_[_0xa688('0x3c')](_0x4b1e22[_0xa688('0x32')],_0x4f190f[_0xa688('0x33')]));_0xe3bb0c['where'][_0xa688('0x59')]=_0x218b5e['id'];if(_0x4b1e22['query'][_0xa688('0x3d')]){_0xe3bb0c[_0xa688('0x3b')]=_[_0xa688('0x3e')](_0xe3bb0c['where'],{'$or':_[_0xa688('0x31')](_0xe3bb0c[_0xa688('0x35')],function(_0x40eac9){var _0x413a2a={};_0x413a2a[_0x40eac9]={'$like':'%'+_0x4b1e22[_0xa688('0x32')][_0xa688('0x3d')]+'%'};return _0x413a2a;})});}_0xe3bb0c=_[_0xa688('0x3e')]({},_0xe3bb0c,_0x4b1e22['options']);return db['UserMailQueue']['findAll'](_0xe3bb0c);}})[_0xa688('0x25')](function(_0x4f07ef){if(_0x4f07ef){return db[_0xa688('0x5a')]['findAndCountAll']({'where':{'id':_[_0xa688('0x31')](_0x4f07ef,_0xa688('0x5b')),'role':_0xa688('0x5c')},'attributes':['id',_0xa688('0x40'),_0xa688('0x5d'),_0xa688('0x5e'),_0xa688('0x5f')]});}})[_0xa688('0x25')](function(_0x3f465d){if(_0x3f465d){return{'count':_0x3f465d['count'],'rows':_[_0xa688('0x31')](_0x3f465d[_0xa688('0x46')],function(_0x4957f6){return{'membername':_0x4957f6['name'],'UserId':_0x4957f6['id'],'queue_name':_0x40ceb7[_0xa688('0x40')],'MailQueueId':_0x40ceb7['id'],'interface':util[_0xa688('0x60')]('%s/%s',_0xa688('0x61'),_0x4957f6[_0xa688('0x40')]),'penalty':0x0,'paused':_0x4957f6[_0xa688('0x5d')],'createdAt':_0x4957f6['createdAt'],'updatedAt':_0x4957f6['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xa688('0x25')](respondWithFilteredResult(_0x5290fd,_0xe3bb0c))[_0xa688('0x47')](handleError(_0x5290fd,null));};exports[_0xa688('0x62')]=function(_0x34551c,_0x1d35ec,_0x3056d9){var _0x276fbd={};var _0x4dfac9={};var _0x50dc18;var _0x252967;return db['MailQueue'][_0xa688('0x58')]({'where':{'id':_0x34551c['params']['id']}})[_0xa688('0x25')](handleEntityNotFound(_0x1d35ec,null))[_0xa688('0x25')](function(_0x15f63f){if(_0x15f63f){_0x50dc18=_0x15f63f;_0x4dfac9['model']=_[_0xa688('0x4b')](db[_0xa688('0x63')][_0xa688('0x4a')]);_0x4dfac9[_0xa688('0x32')]=_[_0xa688('0x4b')](_0x34551c['query']);_0x4dfac9[_0xa688('0x33')]=_[_0xa688('0x34')](_0x4dfac9[_0xa688('0x36')],_0x4dfac9[_0xa688('0x32')]);_0x276fbd['attributes']=_[_0xa688('0x34')](_0x4dfac9[_0xa688('0x36')],qs[_0xa688('0x37')](_0x34551c[_0xa688('0x32')][_0xa688('0x37')]));_0x276fbd[_0xa688('0x35')]=_0x276fbd[_0xa688('0x35')][_0xa688('0x4c')]?_0x276fbd[_0xa688('0x35')]:_0x4dfac9[_0xa688('0x36')];_0x276fbd[_0xa688('0x39')]=qs[_0xa688('0x3a')](_0x34551c['query'][_0xa688('0x3a')]);_0x276fbd[_0xa688('0x3b')]=qs[_0xa688('0x33')](_[_0xa688('0x3c')](_0x34551c[_0xa688('0x32')],_0x4dfac9['filters']));if(_0x34551c[_0xa688('0x32')][_0xa688('0x3d')]){_0x276fbd[_0xa688('0x3b')]=_[_0xa688('0x3e')](_0x276fbd[_0xa688('0x3b')],{'$or':_['map'](_0x276fbd[_0xa688('0x35')],function(_0x54e1a0){var _0x5441e0={};_0x5441e0[_0x54e1a0]={'$like':'%'+_0x34551c[_0xa688('0x32')][_0xa688('0x3d')]+'%'};return _0x5441e0;})});}_0x276fbd=_[_0xa688('0x3e')]({},_0x276fbd,_0x34551c[_0xa688('0x41')]);return _0x50dc18[_0xa688('0x62')](_0x276fbd);}})[_0xa688('0x25')](function(_0x507779){if(_0x507779){_0x252967=_0x507779[_0xa688('0x4c')];if(!_0x34551c[_0xa688('0x32')][_0xa688('0x38')](_0xa688('0x64'))){_0x276fbd['limit']=qs[_0xa688('0x1f')](_0x34551c['query'][_0xa688('0x1f')]);_0x276fbd[_0xa688('0x1c')]=qs[_0xa688('0x1c')](_0x34551c[_0xa688('0x32')][_0xa688('0x1c')]);}return _0x50dc18[_0xa688('0x62')](_0x276fbd);}})[_0xa688('0x25')](function(_0x49f557){if(_0x49f557){return _0x49f557?{'count':_0x252967,'rows':_0x49f557}:null;}})[_0xa688('0x25')](respondWithResult(_0x1d35ec,null))[_0xa688('0x47')](handleError(_0x1d35ec,null));};exports['addTeams']=function(_0x4d3261,_0x1b518a,_0x414d94){var _0x56d383=_0x4d3261[_0xa688('0x55')][_0xa688('0x65')];return db['Team'][_0xa688('0x45')]({'where':{'id':_0x56d383},'attributes':['id'],'include':[{'model':db[_0xa688('0x5a')],'as':'Agents','attributes':['id','name',_0xa688('0x66'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0xdea928){if(_0xdea928){var _0x2acf68=_['flatMap'](_0xdea928,function(_0x41e60f){var _0xdba1c7=_0x41e60f[_0xa688('0x27')]({'plain':!![]});return _0xdba1c7[_0xa688('0x67')];});return db[_0xa688('0x42')]['find']({'where':{'id':_0x4d3261[_0xa688('0x49')]['id']}})[_0xa688('0x25')](function(_0x1ed269){return db[_0xa688('0x68')][_0xa688('0x69')](function(_0x416a0f){return _0x1ed269[_0xa688('0x6a')](_0x56d383,{'transaction':_0x416a0f})[_0xa688('0x25')](function(){return BPromise[_0xa688('0x6b')](_0x2acf68,function(_0x44e5da){return db[_0xa688('0x6c')]['findOrCreate']({'where':{'UserId':_0x44e5da['id'],'MailQueueId':_0x4d3261['params']['id']},'transaction':_0x416a0f});});})[_0xa688('0x25')](function(){_0x2acf68[_0xa688('0x6d')](function(_0x1e14e8){socket[_0xa688('0x6e')](_0xa688('0x6f'),{'UserId':_0x1e14e8['id'],'MailQueueId':_0x1ed269['id']});});});});});}})[_0xa688('0x25')](respondWithStatusCode(_0x1b518a,null))['catch'](handleError(_0x1b518a,null));};exports[_0xa688('0x70')]=function(_0x3aa7d8,_0x3d721e,_0xd33b10){return db['Team'][_0xa688('0x45')]({'where':{'id':_0x3aa7d8[_0xa688('0x32')][_0xa688('0x65')]},'attributes':['id'],'include':[{'model':db[_0xa688('0x5a')],'as':_0xa688('0x67'),'attributes':['id'],'raw':!![]}]})[_0xa688('0x25')](handleEntityNotFound(_0x3d721e,null))[_0xa688('0x25')](function(_0x21f46f){var _0x1b456d=_[_0xa688('0x31')](_0x21f46f,'id');var _0xeba893=[];var _0x23a5ce=[];var _0x1096f7=squel['select']();_0x1096f7[_0xa688('0x71')](_0xa688('0x72'))['from'](_0xa688('0x73'),'tq')[_0xa688('0x74')](_0xa688('0x75'),'ut',_0xa688('0x76'))[_0xa688('0x3b')]('MailQueueId\x20=\x20?',_0x3aa7d8[_0xa688('0x49')]['id']);for(var _0x77d3ef=0x0;_0x77d3ef<_0x21f46f[_0xa688('0x4c')];_0x77d3ef+=0x1){let _0x1e8dbb=_0x21f46f[_0x77d3ef];for(var _0x3f037d=0x0;_0x3f037d<_0x1e8dbb[_0xa688('0x67')][_0xa688('0x4c')];_0x3f037d+=0x1){let _0x42951b=_0x1e8dbb[_0xa688('0x67')][_0x3f037d];var _0x2819b8=_0x1096f7[_0xa688('0x77')]();_0x2819b8[_0xa688('0x3b')](_0xa688('0x78'),_0x42951b['id']);_0x23a5ce[_0xa688('0x79')](db[_0xa688('0x68')][_0xa688('0x32')](_0x2819b8[_0xa688('0x7a')](),{'type':db[_0xa688('0x68')][_0xa688('0x7b')][_0xa688('0x7c')]})[_0xa688('0x25')](function(_0x38cf64){if(_0x38cf64['length']===0x1){return _0x42951b['id'];}else{var _0x14b1be=_[_0xa688('0x7d')](_[_0xa688('0x31')](_0x38cf64,_0xa688('0x7e')),function(_0x4d83cd){return _[_0xa688('0x7f')](_0x1b456d,_0x4d83cd);});if(_0x14b1be){return _0x42951b['id'];}}}));}}return BPromise[_0xa688('0x80')](_0x23a5ce)[_0xa688('0x25')](function(_0x42aa1a){_0xeba893=_(_0xeba893)[_0xa688('0x81')](_0x42aa1a)[_0xa688('0x82')]()['value']();return db['MailQueue'][_0xa688('0x4d')]({'where':{'id':_0x3aa7d8[_0xa688('0x49')]['id']}})[_0xa688('0x25')](function(_0x1d6d3c){return db[_0xa688('0x68')][_0xa688('0x69')](function(_0x2b0bcf){return _0x1d6d3c['removeTeams'](_0x3aa7d8[_0xa688('0x32')][_0xa688('0x65')],{'transaction':_0x2b0bcf})[_0xa688('0x25')](function(){if(!_[_0xa688('0x83')](_0xeba893)){return _0x1d6d3c[_0xa688('0x84')](_0xeba893,{'transaction':_0x2b0bcf});}})[_0xa688('0x25')](function(){_0xeba893[_0xa688('0x6d')](function(_0x5a9df2){socket[_0xa688('0x6e')](_0xa688('0x85'),{'UserId':_0x5a9df2,'MailQueueId':_0x1d6d3c['id']});});});});});});})[_0xa688('0x25')](respondWithStatusCode(_0x3d721e,null))[_0xa688('0x47')](handleError(_0x3d721e,null));};exports[_0xa688('0x86')]=function(_0x5ecf64,_0x45b390,_0x4d717d){return db[_0xa688('0x42')]['find']({'where':{'id':_0x5ecf64[_0xa688('0x49')]['id']}})[_0xa688('0x25')](handleEntityNotFound(_0x45b390,null))[_0xa688('0x25')](function(_0x28cdef){if(_0x28cdef){return _0x28cdef[_0xa688('0x86')](_0x5ecf64[_0xa688('0x55')][_0xa688('0x65')],_[_0xa688('0x87')](_0x5ecf64['body'],[_0xa688('0x65'),'id'])||{})[_0xa688('0x88')](function(_0x1e40a0){for(var _0x1a6196=0x0;_0x1a6196<_0x5ecf64[_0xa688('0x55')][_0xa688('0x65')][_0xa688('0x4c')];_0x1a6196+=0x1){socket[_0xa688('0x6e')]('userMailQueue:save',{'UserId':Number(_0x5ecf64['body'][_0xa688('0x65')][_0x1a6196]),'MailQueueId':Number(_0x5ecf64['params']['id'])});}return _0x1e40a0;});}})[_0xa688('0x25')](respondWithResult(_0x45b390,null))[_0xa688('0x47')](handleError(_0x45b390,null));};exports[_0xa688('0x84')]=function(_0x4d206a,_0x2c91a0,_0xc709ec){return db[_0xa688('0x42')][_0xa688('0x4d')]({'where':{'id':_0x4d206a['params']['id']}})[_0xa688('0x25')](handleEntityNotFound(_0x2c91a0,null))['then'](function(_0x3f8028){if(_0x3f8028){return _0x3f8028[_0xa688('0x84')](_0x4d206a[_0xa688('0x32')][_0xa688('0x65')])[_0xa688('0x25')](function(){if(_[_0xa688('0x89')](_0x4d206a[_0xa688('0x32')][_0xa688('0x65')])){for(var _0x24d771=0x0;_0x24d771<_0x4d206a[_0xa688('0x32')][_0xa688('0x65')][_0xa688('0x4c')];_0x24d771+=0x1){socket['emit'](_0xa688('0x85'),{'UserId':Number(_0x4d206a[_0xa688('0x32')][_0xa688('0x65')][_0x24d771]),'MailQueueId':Number(_0x4d206a[_0xa688('0x49')]['id'])});}}else{socket[_0xa688('0x6e')](_0xa688('0x85'),{'UserId':Number(_0x4d206a[_0xa688('0x32')][_0xa688('0x65')]),'MailQueueId':Number(_0x4d206a['params']['id'])});}});}})[_0xa688('0x25')](respondWithStatusCode(_0x2c91a0,null))[_0xa688('0x47')](handleError(_0x2c91a0,null));};exports[_0xa688('0x8a')]=function(_0x1441fa,_0x2f8b75,_0x30ebaa){var _0x4385d3={};var _0x233408={};var _0x5965b8;var _0x1db1ec;return db['MailQueue'][_0xa688('0x58')]({'where':{'id':_0x1441fa[_0xa688('0x49')]['id']}})['then'](handleEntityNotFound(_0x2f8b75,null))[_0xa688('0x25')](function(_0x23fdfc){if(_0x23fdfc){_0x5965b8=_0x23fdfc;_0x233408[_0xa688('0x36')]=_[_0xa688('0x4b')](db['User'][_0xa688('0x4a')]);_0x233408[_0xa688('0x32')]=_[_0xa688('0x4b')](_0x1441fa[_0xa688('0x32')]);_0x233408['filters']=_[_0xa688('0x34')](_0x233408[_0xa688('0x36')],_0x233408['query']);_0x4385d3[_0xa688('0x35')]=_[_0xa688('0x34')](_0x233408[_0xa688('0x36')],qs[_0xa688('0x37')](_0x1441fa['query']['fields']));_0x4385d3['attributes']=_0x4385d3[_0xa688('0x35')][_0xa688('0x4c')]?_0x4385d3[_0xa688('0x35')]:_0x233408[_0xa688('0x36')];_0x4385d3[_0xa688('0x39')]=qs['sort'](_0x1441fa['query'][_0xa688('0x3a')]);_0x4385d3[_0xa688('0x3b')]=qs['filters'](_[_0xa688('0x3c')](_0x1441fa[_0xa688('0x32')],_0x233408[_0xa688('0x33')]));if(_0x1441fa[_0xa688('0x32')][_0xa688('0x3d')]){_0x4385d3[_0xa688('0x3b')]=_['merge'](_0x4385d3['where'],{'$or':_['map'](_0x4385d3[_0xa688('0x35')],function(_0x1d6473){var _0x1f58b9={};_0x1f58b9[_0x1d6473]={'$like':'%'+_0x1441fa[_0xa688('0x32')][_0xa688('0x3d')]+'%'};return _0x1f58b9;})});}_0x4385d3=_[_0xa688('0x3e')]({},_0x4385d3,_0x1441fa[_0xa688('0x41')]);return _0x5965b8[_0xa688('0x8a')](_0x4385d3);}})[_0xa688('0x25')](function(_0x1c9dc6){if(_0x1c9dc6){_0x1db1ec=_0x1c9dc6[_0xa688('0x4c')];if(!_0x1441fa[_0xa688('0x32')][_0xa688('0x38')](_0xa688('0x64'))){_0x4385d3[_0xa688('0x1f')]=qs['limit'](_0x1441fa[_0xa688('0x32')][_0xa688('0x1f')]);_0x4385d3['offset']=qs[_0xa688('0x1c')](_0x1441fa[_0xa688('0x32')][_0xa688('0x1c')]);}return _0x5965b8[_0xa688('0x8a')](_0x4385d3);}})[_0xa688('0x25')](function(_0x628ced){if(_0x628ced){return _0x628ced?{'count':_0x1db1ec,'rows':_0x628ced}:null;}})[_0xa688('0x25')](respondWithResult(_0x2f8b75,null))[_0xa688('0x47')](handleError(_0x2f8b75,null));}; \ No newline at end of file +var _0x0c08=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','length','findAndCountAll','UserId','agent','updatedAt','rows','format','%s/%s','mailPause','createdAt','getTeams','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','transaction','each','emit','userMailQueue:save','select','tq.TeamId','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','includes','compact','removeTeams','isEmpty','forEach','userMailQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','localhost','socket.io-emitter','redis','./mailQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','reject','update','then','destroy','get','error','stack','send','index','MailQueue','rawAttributes','fieldName','type','key','model','map','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','keys','includeAll','create'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x0c08,0x1e6));var _0x80c0=function(_0xac56ce,_0xb73e4){_0xac56ce=_0xac56ce-0x0;var _0x5105e1=_0x0c08[_0xac56ce];return _0x5105e1;};'use strict';var emlformat=require(_0x80c0('0x0'));var rimraf=require(_0x80c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x80c0('0x2'));var rp=require(_0x80c0('0x3'));var moment=require(_0x80c0('0x4'));var BPromise=require(_0x80c0('0x5'));var Mustache=require(_0x80c0('0x6'));var util=require('util');var path=require(_0x80c0('0x7'));var sox=require('sox');var csv=require(_0x80c0('0x8'));var ejs=require(_0x80c0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x80c0('0xa'));var squel=require(_0x80c0('0xb'));var crypto=require(_0x80c0('0xc'));var jsforce=require(_0x80c0('0xd'));var deskjs=require(_0x80c0('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x80c0('0xf'));var Redis=require(_0x80c0('0x10'));var authService=require(_0x80c0('0x11'));var qs=require(_0x80c0('0x12'));var as=require(_0x80c0('0x13'));var hardwareService=require(_0x80c0('0x14'));var logger=require('../../config/logger')(_0x80c0('0x15'));var utils=require(_0x80c0('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x80c0('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x80c0('0x18'),'port':0x18eb});var socket=require(_0x80c0('0x19'))(new Redis(config[_0x80c0('0x1a')]));require(_0x80c0('0x1b'))[_0x80c0('0x1c')](socket);function respondWithStatusCode(_0xbc152a,_0xea1ec0){_0xea1ec0=_0xea1ec0||0xcc;return function(_0x14eb32){if(_0x14eb32){return _0xbc152a[_0x80c0('0x1d')](_0xea1ec0);}return _0xbc152a[_0x80c0('0x1e')](_0xea1ec0)[_0x80c0('0x1f')]();};}function respondWithResult(_0x169701,_0x4d3341){_0x4d3341=_0x4d3341||0xc8;return function(_0x4e5394){if(_0x4e5394){return _0x169701[_0x80c0('0x1e')](_0x4d3341)[_0x80c0('0x20')](_0x4e5394);}};}function respondWithFilteredResult(_0x204eb6,_0x4f9325){return function(_0x230e77){if(_0x230e77){var _0x254475=typeof _0x4f9325['offset']===_0x80c0('0x21')&&typeof _0x4f9325[_0x80c0('0x22')]==='undefined';var _0x5163bf=_0x230e77[_0x80c0('0x23')];var _0x19ac32=_0x254475?0x0:_0x4f9325[_0x80c0('0x24')];var _0x5cee69=_0x254475?_0x230e77[_0x80c0('0x23')]:_0x4f9325[_0x80c0('0x24')]+_0x4f9325['limit'];var _0x20f480;if(_0x5cee69>=_0x5163bf){_0x5cee69=_0x5163bf;_0x20f480=0xc8;}else{_0x20f480=0xce;}_0x204eb6[_0x80c0('0x1e')](_0x20f480);return _0x204eb6['set'](_0x80c0('0x25'),_0x19ac32+'-'+_0x5cee69+'/'+_0x5163bf)[_0x80c0('0x20')](_0x230e77);}return null;};}function patchUpdates(_0x4879f3){return function(_0x3aabcf){try{jsonpatch['apply'](_0x3aabcf,_0x4879f3,!![]);}catch(_0x147cee){return BPromise[_0x80c0('0x26')](_0x147cee);}return _0x3aabcf['save']();};}function saveUpdates(_0x58bd36,_0x555513){return function(_0x5389f7){if(_0x5389f7){return _0x5389f7[_0x80c0('0x27')](_0x58bd36)[_0x80c0('0x28')](function(_0x588660){return _0x588660;});}return null;};}function removeEntity(_0x2e7c0b,_0x4851aa){return function(_0x2a742a){if(_0x2a742a){return _0x2a742a[_0x80c0('0x29')]()[_0x80c0('0x28')](function(){var _0x2e63ed=_0x2a742a[_0x80c0('0x2a')]({'plain':!![]});var _0x482929='MailQueues';return db['UserProfileResource'][_0x80c0('0x29')]({'where':{'type':_0x482929,'resourceId':_0x2e63ed['id']}})[_0x80c0('0x28')](function(){return _0x2a742a;});})[_0x80c0('0x28')](function(){_0x2e7c0b[_0x80c0('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12a780,_0x581adc){return function(_0x531c46){if(!_0x531c46){_0x12a780[_0x80c0('0x1d')](0x194);}return _0x531c46;};}function handleError(_0x545f6b,_0x4eeb94){_0x4eeb94=_0x4eeb94||0x1f4;return function(_0x2a5f90){logger[_0x80c0('0x2b')](_0x2a5f90[_0x80c0('0x2c')]);if(_0x2a5f90['name']){delete _0x2a5f90['name'];}_0x545f6b[_0x80c0('0x1e')](_0x4eeb94)[_0x80c0('0x2d')](_0x2a5f90);};}exports[_0x80c0('0x2e')]=function(_0x343c12,_0x4cea18){var _0x593b42={},_0x36decd={},_0x330bf2={'count':0x0,'rows':[]};var _0x323458=_['map'](db[_0x80c0('0x2f')][_0x80c0('0x30')],function(_0x42e29c){return{'name':_0x42e29c[_0x80c0('0x31')],'type':_0x42e29c[_0x80c0('0x32')][_0x80c0('0x33')]};});_0x36decd[_0x80c0('0x34')]=_[_0x80c0('0x35')](_0x323458,_0x80c0('0x36'));_0x36decd[_0x80c0('0x37')]=_['keys'](_0x343c12['query']);_0x36decd[_0x80c0('0x38')]=_[_0x80c0('0x39')](_0x36decd[_0x80c0('0x34')],_0x36decd['query']);_0x593b42[_0x80c0('0x3a')]=_['intersection'](_0x36decd[_0x80c0('0x34')],qs[_0x80c0('0x3b')](_0x343c12[_0x80c0('0x37')]['fields']));_0x593b42['attributes']=_0x593b42[_0x80c0('0x3a')]['length']?_0x593b42[_0x80c0('0x3a')]:_0x36decd['model'];if(!_0x343c12[_0x80c0('0x37')][_0x80c0('0x3c')](_0x80c0('0x3d'))){_0x593b42[_0x80c0('0x22')]=qs[_0x80c0('0x22')](_0x343c12[_0x80c0('0x37')][_0x80c0('0x22')]);_0x593b42[_0x80c0('0x24')]=qs['offset'](_0x343c12['query'][_0x80c0('0x24')]);}_0x593b42[_0x80c0('0x3e')]=qs[_0x80c0('0x3f')](_0x343c12[_0x80c0('0x37')][_0x80c0('0x3f')]);_0x593b42[_0x80c0('0x40')]=qs['filters'](_[_0x80c0('0x41')](_0x343c12['query'],_0x36decd[_0x80c0('0x38')]),_0x323458);if(_0x343c12[_0x80c0('0x37')][_0x80c0('0x42')]){_0x593b42[_0x80c0('0x40')]=_[_0x80c0('0x43')](_0x593b42['where'],{'$or':_[_0x80c0('0x35')](_0x323458,function(_0x133d5e){if(_0x133d5e[_0x80c0('0x32')]!==_0x80c0('0x44')){var _0x270aca={};_0x270aca[_0x133d5e['name']]={'$like':'%'+_0x343c12['query'][_0x80c0('0x42')]+'%'};return _0x270aca;}})});}_0x593b42=_[_0x80c0('0x43')]({},_0x593b42,_0x343c12[_0x80c0('0x45')]);var _0x597a14={'where':_0x593b42[_0x80c0('0x40')]};return db[_0x80c0('0x2f')][_0x80c0('0x23')](_0x597a14)['then'](function(_0x195110){_0x330bf2[_0x80c0('0x23')]=_0x195110;if(_0x343c12['query']['includeAll']){_0x593b42[_0x80c0('0x46')]=[{'all':!![]}];}return db[_0x80c0('0x2f')][_0x80c0('0x47')](_0x593b42);})[_0x80c0('0x28')](function(_0x36eadb){_0x330bf2['rows']=_0x36eadb;return _0x330bf2;})['then'](respondWithFilteredResult(_0x4cea18,_0x593b42))[_0x80c0('0x48')](handleError(_0x4cea18,null));};exports[_0x80c0('0x49')]=function(_0x105218,_0x130e76){var _0x4f6677={'raw':!![],'where':{'id':_0x105218[_0x80c0('0x4a')]['id']}},_0x5aa0f2={};_0x5aa0f2['model']=_[_0x80c0('0x4b')](db[_0x80c0('0x2f')][_0x80c0('0x30')]);_0x5aa0f2[_0x80c0('0x37')]=_['keys'](_0x105218[_0x80c0('0x37')]);_0x5aa0f2[_0x80c0('0x38')]=_['intersection'](_0x5aa0f2['model'],_0x5aa0f2['query']);_0x4f6677[_0x80c0('0x3a')]=_[_0x80c0('0x39')](_0x5aa0f2[_0x80c0('0x34')],qs['fields'](_0x105218[_0x80c0('0x37')]['fields']));_0x4f6677[_0x80c0('0x3a')]=_0x4f6677[_0x80c0('0x3a')]['length']?_0x4f6677['attributes']:_0x5aa0f2[_0x80c0('0x34')];if(_0x105218['query'][_0x80c0('0x4c')]){_0x4f6677['include']=[{'all':!![]}];}_0x4f6677=_[_0x80c0('0x43')]({},_0x4f6677,_0x105218[_0x80c0('0x45')]);return db[_0x80c0('0x2f')]['find'](_0x4f6677)[_0x80c0('0x28')](handleEntityNotFound(_0x130e76,null))[_0x80c0('0x28')](respondWithResult(_0x130e76,null))[_0x80c0('0x48')](handleError(_0x130e76,null));};exports[_0x80c0('0x4d')]=function(_0x33c738,_0x2c0603){return db[_0x80c0('0x2f')][_0x80c0('0x4d')](_0x33c738[_0x80c0('0x4e')],{})[_0x80c0('0x28')](function(_0x44af76){var _0x1478b5=_0x33c738[_0x80c0('0x4f')][_0x80c0('0x2a')]({'plain':!![]});if(!_0x1478b5)throw new Error(_0x80c0('0x50'));if(_0x1478b5[_0x80c0('0x51')]===_0x80c0('0x4f')){var _0x51dcd7=_0x44af76[_0x80c0('0x2a')]({'plain':!![]});var _0x189fa0=_0x80c0('0x52');return db['UserProfileSection'][_0x80c0('0x53')]({'where':{'name':_0x189fa0,'userProfileId':_0x1478b5[_0x80c0('0x54')]},'raw':!![]})[_0x80c0('0x28')](function(_0x38b8af){if(_0x38b8af&&_0x38b8af[_0x80c0('0x55')]===0x0){return db[_0x80c0('0x56')]['create']({'name':_0x51dcd7[_0x80c0('0x36')],'resourceId':_0x51dcd7['id'],'type':_0x38b8af[_0x80c0('0x36')],'sectionId':_0x38b8af['id']},{})[_0x80c0('0x28')](function(){return _0x44af76;});}else{return _0x44af76;}})[_0x80c0('0x48')](function(_0xaa14af){logger[_0x80c0('0x2b')](_0x80c0('0x57'),_0xaa14af);throw _0xaa14af;});}return _0x44af76;})[_0x80c0('0x28')](respondWithResult(_0x2c0603,0xc9))[_0x80c0('0x48')](handleError(_0x2c0603,null));};exports[_0x80c0('0x27')]=function(_0xad0cbe,_0x4781f5){if(_0xad0cbe[_0x80c0('0x4e')]['id']){delete _0xad0cbe[_0x80c0('0x4e')]['id'];}return db[_0x80c0('0x2f')][_0x80c0('0x53')]({'where':{'id':_0xad0cbe['params']['id']}})[_0x80c0('0x28')](handleEntityNotFound(_0x4781f5,null))[_0x80c0('0x28')](saveUpdates(_0xad0cbe[_0x80c0('0x4e')],null))[_0x80c0('0x28')](respondWithResult(_0x4781f5,null))['catch'](handleError(_0x4781f5,null));};exports[_0x80c0('0x29')]=function(_0x581759,_0x571b0d){return db[_0x80c0('0x2f')][_0x80c0('0x53')]({'where':{'id':_0x581759[_0x80c0('0x4a')]['id']}})[_0x80c0('0x28')](handleEntityNotFound(_0x571b0d,null))['then'](removeEntity(_0x571b0d,null))[_0x80c0('0x48')](handleError(_0x571b0d,null));};exports[_0x80c0('0x58')]=function(_0x511272,_0x3ba5d9){return db[_0x80c0('0x2f')][_0x80c0('0x58')]()[_0x80c0('0x28')](respondWithResult(_0x3ba5d9,null))['catch'](handleError(_0x3ba5d9,null));};exports[_0x80c0('0x59')]=function(_0x5a7467,_0x482ce3,_0x1defd1){var _0xf5812={'raw':!![],'where':{}},_0x46e6c2={},_0xb2c114;return db['MailQueue'][_0x80c0('0x5a')]({'where':{'id':_0x5a7467[_0x80c0('0x4a')]['id']}})[_0x80c0('0x28')](handleEntityNotFound(_0x482ce3,null))['then'](function(_0x43c88c){if(_0x43c88c){_0xb2c114=_0x43c88c[_0x80c0('0x2a')]({'plain':!![]});_0x46e6c2['model']=_[_0x80c0('0x4b')](db[_0x80c0('0x5b')]['rawAttributes']);_0x46e6c2[_0x80c0('0x37')]=_['keys'](_0x5a7467[_0x80c0('0x37')]);_0x46e6c2['filters']=_[_0x80c0('0x39')](_0x46e6c2[_0x80c0('0x34')],_0x46e6c2[_0x80c0('0x37')]);_0xf5812[_0x80c0('0x3a')]=_['intersection'](_0x46e6c2[_0x80c0('0x34')],qs[_0x80c0('0x3b')](_0x5a7467[_0x80c0('0x37')][_0x80c0('0x3b')]));_0xf5812[_0x80c0('0x3a')]=_0xf5812['attributes'][_0x80c0('0x5c')]?_0xf5812['attributes']:_0x46e6c2[_0x80c0('0x34')];if(!_0x5a7467[_0x80c0('0x37')]['hasOwnProperty'](_0x80c0('0x3d'))){_0xf5812[_0x80c0('0x22')]=qs['limit'](_0x5a7467[_0x80c0('0x37')][_0x80c0('0x22')]);_0xf5812[_0x80c0('0x24')]=qs[_0x80c0('0x24')](_0x5a7467[_0x80c0('0x37')][_0x80c0('0x24')]);}_0xf5812[_0x80c0('0x3e')]=qs[_0x80c0('0x3f')](_0x5a7467[_0x80c0('0x37')][_0x80c0('0x3f')]);_0xf5812['where']=qs[_0x80c0('0x38')](_[_0x80c0('0x41')](_0x5a7467[_0x80c0('0x37')],_0x46e6c2[_0x80c0('0x38')]));_0xf5812['where']['MailQueueId']=_0x43c88c['id'];if(_0x5a7467[_0x80c0('0x37')][_0x80c0('0x42')]){_0xf5812['where']=_['merge'](_0xf5812[_0x80c0('0x40')],{'$or':_[_0x80c0('0x35')](_0xf5812[_0x80c0('0x3a')],function(_0x58a76c){var _0x48fadb={};_0x48fadb[_0x58a76c]={'$like':'%'+_0x5a7467[_0x80c0('0x37')]['filter']+'%'};return _0x48fadb;})});}_0xf5812=_[_0x80c0('0x43')]({},_0xf5812,_0x5a7467[_0x80c0('0x45')]);return db[_0x80c0('0x5b')][_0x80c0('0x47')](_0xf5812);}})[_0x80c0('0x28')](function(_0x2658cc){if(_0x2658cc){return db['User'][_0x80c0('0x5d')]({'where':{'id':_[_0x80c0('0x35')](_0x2658cc,_0x80c0('0x5e')),'role':_0x80c0('0x5f')},'attributes':['id',_0x80c0('0x36'),'mailPause',_0x80c0('0x60'),'createdAt']});}})[_0x80c0('0x28')](function(_0x552e4e){if(_0x552e4e){return{'count':_0x552e4e['count'],'rows':_['map'](_0x552e4e[_0x80c0('0x61')],function(_0x1793cb){return{'membername':_0x1793cb[_0x80c0('0x36')],'UserId':_0x1793cb['id'],'queue_name':_0xb2c114[_0x80c0('0x36')],'MailQueueId':_0xb2c114['id'],'interface':util[_0x80c0('0x62')](_0x80c0('0x63'),'SIP',_0x1793cb[_0x80c0('0x36')]),'penalty':0x0,'paused':_0x1793cb[_0x80c0('0x64')],'createdAt':_0x1793cb[_0x80c0('0x65')],'updatedAt':_0x1793cb[_0x80c0('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x80c0('0x28')](respondWithFilteredResult(_0x482ce3,_0xf5812))[_0x80c0('0x48')](handleError(_0x482ce3,null));};exports[_0x80c0('0x66')]=function(_0x5b7d11,_0x5a02c1,_0x538567){var _0x1a8573={};var _0x26189e={};var _0x54ca8c;var _0x5a5744;return db['MailQueue'][_0x80c0('0x5a')]({'where':{'id':_0x5b7d11[_0x80c0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5a02c1,null))['then'](function(_0x12cf4c){if(_0x12cf4c){_0x54ca8c=_0x12cf4c;_0x26189e[_0x80c0('0x34')]=_[_0x80c0('0x4b')](db['Team'][_0x80c0('0x30')]);_0x26189e[_0x80c0('0x37')]=_[_0x80c0('0x4b')](_0x5b7d11[_0x80c0('0x37')]);_0x26189e['filters']=_[_0x80c0('0x39')](_0x26189e[_0x80c0('0x34')],_0x26189e['query']);_0x1a8573[_0x80c0('0x3a')]=_[_0x80c0('0x39')](_0x26189e['model'],qs['fields'](_0x5b7d11[_0x80c0('0x37')][_0x80c0('0x3b')]));_0x1a8573[_0x80c0('0x3a')]=_0x1a8573[_0x80c0('0x3a')][_0x80c0('0x5c')]?_0x1a8573[_0x80c0('0x3a')]:_0x26189e['model'];_0x1a8573['order']=qs['sort'](_0x5b7d11[_0x80c0('0x37')][_0x80c0('0x3f')]);_0x1a8573['where']=qs['filters'](_[_0x80c0('0x41')](_0x5b7d11[_0x80c0('0x37')],_0x26189e[_0x80c0('0x38')]));if(_0x5b7d11[_0x80c0('0x37')][_0x80c0('0x42')]){_0x1a8573[_0x80c0('0x40')]=_[_0x80c0('0x43')](_0x1a8573[_0x80c0('0x40')],{'$or':_['map'](_0x1a8573[_0x80c0('0x3a')],function(_0x119398){var _0x3f1dc8={};_0x3f1dc8[_0x119398]={'$like':'%'+_0x5b7d11[_0x80c0('0x37')][_0x80c0('0x42')]+'%'};return _0x3f1dc8;})});}_0x1a8573=_[_0x80c0('0x43')]({},_0x1a8573,_0x5b7d11[_0x80c0('0x45')]);return _0x54ca8c[_0x80c0('0x66')](_0x1a8573);}})[_0x80c0('0x28')](function(_0x445d0d){if(_0x445d0d){_0x5a5744=_0x445d0d[_0x80c0('0x5c')];if(!_0x5b7d11[_0x80c0('0x37')][_0x80c0('0x3c')](_0x80c0('0x3d'))){_0x1a8573['limit']=qs[_0x80c0('0x22')](_0x5b7d11[_0x80c0('0x37')][_0x80c0('0x22')]);_0x1a8573[_0x80c0('0x24')]=qs['offset'](_0x5b7d11[_0x80c0('0x37')][_0x80c0('0x24')]);}return _0x54ca8c[_0x80c0('0x66')](_0x1a8573);}})[_0x80c0('0x28')](function(_0x1b9d15){if(_0x1b9d15){return _0x1b9d15?{'count':_0x5a5744,'rows':_0x1b9d15}:null;}})['then'](respondWithResult(_0x5a02c1,null))['catch'](handleError(_0x5a02c1,null));};exports[_0x80c0('0x67')]=function(_0x4af49d,_0x203570,_0x533896){var _0x4fcf38=_0x4af49d['body'][_0x80c0('0x68')];return db['Team'][_0x80c0('0x47')]({'where':{'id':_0x4fcf38},'attributes':['id'],'include':[{'model':db[_0x80c0('0x69')],'as':_0x80c0('0x6a'),'attributes':['id',_0x80c0('0x36'),_0x80c0('0x6b'),_0x80c0('0x6c'),_0x80c0('0x6d')],'raw':!![]}]})[_0x80c0('0x28')](function(_0x14b2b0){if(_0x14b2b0){var _0x1fd4ac=_[_0x80c0('0x6e')](_0x14b2b0,function(_0x7b3aa7){var _0x56e14c=_0x7b3aa7[_0x80c0('0x2a')]({'plain':!![]});return _0x56e14c[_0x80c0('0x6a')];});return db[_0x80c0('0x2f')][_0x80c0('0x53')]({'where':{'id':_0x4af49d['params']['id']}})[_0x80c0('0x28')](function(_0x3d42d0){return db['sequelize'][_0x80c0('0x6f')](function(_0x6aea6a){return _0x3d42d0[_0x80c0('0x67')](_0x4fcf38,{'transaction':_0x6aea6a})[_0x80c0('0x28')](function(){return BPromise[_0x80c0('0x70')](_0x1fd4ac,function(_0x3906d6){return db['UserMailQueue']['findOrCreate']({'where':{'UserId':_0x3906d6['id'],'MailQueueId':_0x4af49d['params']['id']},'transaction':_0x6aea6a});});})[_0x80c0('0x28')](function(){_0x1fd4ac['forEach'](function(_0x47946c){socket[_0x80c0('0x71')](_0x80c0('0x72'),{'UserId':_0x47946c['id'],'MailQueueId':_0x3d42d0['id']});});});});});}})[_0x80c0('0x28')](respondWithStatusCode(_0x203570,null))[_0x80c0('0x48')](handleError(_0x203570,null));};exports['removeTeams']=function(_0x4f64be,_0x3444f0,_0x4d9bfb){return db['Team'][_0x80c0('0x47')]({'where':{'id':_0x4f64be[_0x80c0('0x37')][_0x80c0('0x68')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x80c0('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x80c0('0x28')](handleEntityNotFound(_0x3444f0,null))[_0x80c0('0x28')](function(_0x5423d8){var _0x9f3bf4=_[_0x80c0('0x35')](_0x5423d8,'id');var _0x135b80=[];var _0x786d70=[];var _0x37f0e5=squel[_0x80c0('0x73')]();_0x37f0e5['field'](_0x80c0('0x74'))[_0x80c0('0x75')](_0x80c0('0x76'),'tq')['join'](_0x80c0('0x77'),'ut',_0x80c0('0x78'))[_0x80c0('0x40')](_0x80c0('0x79'),_0x4f64be[_0x80c0('0x4a')]['id']);for(var _0x255ac1=0x0;_0x255ac1<_0x5423d8['length'];_0x255ac1+=0x1){let _0x3409b6=_0x5423d8[_0x255ac1];for(var _0x273195=0x0;_0x273195<_0x3409b6[_0x80c0('0x6a')]['length'];_0x273195+=0x1){let _0x2dc69d=_0x3409b6['Agents'][_0x273195];var _0x1e8eac=_0x37f0e5['clone']();_0x1e8eac[_0x80c0('0x40')](_0x80c0('0x7a'),_0x2dc69d['id']);_0x786d70[_0x80c0('0x7b')](db[_0x80c0('0x7c')][_0x80c0('0x37')](_0x1e8eac[_0x80c0('0x7d')](),{'type':db['sequelize'][_0x80c0('0x7e')][_0x80c0('0x7f')]})['then'](function(_0x26faf8){if(_0x26faf8[_0x80c0('0x5c')]===0x1){return _0x2dc69d['id'];}else{var _0x1b4515=_[_0x80c0('0x80')](_['map'](_0x26faf8,'TeamId'),function(_0x3cd328){return _[_0x80c0('0x81')](_0x9f3bf4,_0x3cd328);});if(_0x1b4515){return _0x2dc69d['id'];}}}));}}return BPromise['all'](_0x786d70)[_0x80c0('0x28')](function(_0x3089b2){_0x135b80=_(_0x135b80)['union'](_0x3089b2)[_0x80c0('0x82')]()['value']();return db[_0x80c0('0x2f')][_0x80c0('0x53')]({'where':{'id':_0x4f64be[_0x80c0('0x4a')]['id']}})[_0x80c0('0x28')](function(_0x51796b){return db[_0x80c0('0x7c')][_0x80c0('0x6f')](function(_0x330c3a){return _0x51796b[_0x80c0('0x83')](_0x4f64be[_0x80c0('0x37')][_0x80c0('0x68')],{'transaction':_0x330c3a})[_0x80c0('0x28')](function(){if(!_[_0x80c0('0x84')](_0x135b80)){return _0x51796b['removeAgents'](_0x135b80,{'transaction':_0x330c3a});}})['then'](function(){_0x135b80[_0x80c0('0x85')](function(_0x19ded1){socket[_0x80c0('0x71')](_0x80c0('0x86'),{'UserId':_0x19ded1,'MailQueueId':_0x51796b['id']});});});});});});})[_0x80c0('0x28')](respondWithStatusCode(_0x3444f0,null))[_0x80c0('0x48')](handleError(_0x3444f0,null));};exports[_0x80c0('0x87')]=function(_0xa5f631,_0x549ef6,_0x3fabaf){return db['MailQueue']['find']({'where':{'id':_0xa5f631[_0x80c0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x549ef6,null))[_0x80c0('0x28')](function(_0x1d03cc){if(_0x1d03cc){return _0x1d03cc[_0x80c0('0x87')](_0xa5f631[_0x80c0('0x4e')][_0x80c0('0x68')],_[_0x80c0('0x88')](_0xa5f631[_0x80c0('0x4e')],['ids','id'])||{})[_0x80c0('0x89')](function(_0x297bbe){for(var _0x306e7a=0x0;_0x306e7a<_0xa5f631[_0x80c0('0x4e')][_0x80c0('0x68')]['length'];_0x306e7a+=0x1){socket[_0x80c0('0x71')](_0x80c0('0x72'),{'UserId':Number(_0xa5f631[_0x80c0('0x4e')][_0x80c0('0x68')][_0x306e7a]),'MailQueueId':Number(_0xa5f631[_0x80c0('0x4a')]['id'])});}return _0x297bbe;});}})[_0x80c0('0x28')](respondWithResult(_0x549ef6,null))[_0x80c0('0x48')](handleError(_0x549ef6,null));};exports[_0x80c0('0x8a')]=function(_0x237163,_0x21109d,_0x29056a){return db[_0x80c0('0x2f')][_0x80c0('0x53')]({'where':{'id':_0x237163['params']['id']}})[_0x80c0('0x28')](handleEntityNotFound(_0x21109d,null))[_0x80c0('0x28')](function(_0x774ad){if(_0x774ad){return _0x774ad[_0x80c0('0x8a')](_0x237163[_0x80c0('0x37')][_0x80c0('0x68')])['then'](function(){if(_[_0x80c0('0x8b')](_0x237163[_0x80c0('0x37')]['ids'])){for(var _0x1ba344=0x0;_0x1ba344<_0x237163['query'][_0x80c0('0x68')]['length'];_0x1ba344+=0x1){socket['emit'](_0x80c0('0x86'),{'UserId':Number(_0x237163[_0x80c0('0x37')]['ids'][_0x1ba344]),'MailQueueId':Number(_0x237163[_0x80c0('0x4a')]['id'])});}}else{socket[_0x80c0('0x71')]('userMailQueue:remove',{'UserId':Number(_0x237163[_0x80c0('0x37')]['ids']),'MailQueueId':Number(_0x237163['params']['id'])});}});}})['then'](respondWithStatusCode(_0x21109d,null))[_0x80c0('0x48')](handleError(_0x21109d,null));};exports[_0x80c0('0x8c')]=function(_0x47b6fe,_0xb823f3,_0x54c2e1){var _0xc105df={};var _0x59d94f={};var _0x48a1fb;var _0x4f1231;return db['MailQueue'][_0x80c0('0x5a')]({'where':{'id':_0x47b6fe[_0x80c0('0x4a')]['id']}})[_0x80c0('0x28')](handleEntityNotFound(_0xb823f3,null))[_0x80c0('0x28')](function(_0x127dbb){if(_0x127dbb){_0x48a1fb=_0x127dbb;_0x59d94f['model']=_[_0x80c0('0x4b')](db['User']['rawAttributes']);_0x59d94f[_0x80c0('0x37')]=_['keys'](_0x47b6fe['query']);_0x59d94f[_0x80c0('0x38')]=_[_0x80c0('0x39')](_0x59d94f['model'],_0x59d94f[_0x80c0('0x37')]);_0xc105df[_0x80c0('0x3a')]=_['intersection'](_0x59d94f['model'],qs[_0x80c0('0x3b')](_0x47b6fe[_0x80c0('0x37')]['fields']));_0xc105df[_0x80c0('0x3a')]=_0xc105df[_0x80c0('0x3a')][_0x80c0('0x5c')]?_0xc105df['attributes']:_0x59d94f[_0x80c0('0x34')];_0xc105df[_0x80c0('0x3e')]=qs['sort'](_0x47b6fe['query'][_0x80c0('0x3f')]);_0xc105df[_0x80c0('0x40')]=qs[_0x80c0('0x38')](_['pick'](_0x47b6fe['query'],_0x59d94f[_0x80c0('0x38')]));if(_0x47b6fe[_0x80c0('0x37')][_0x80c0('0x42')]){_0xc105df[_0x80c0('0x40')]=_[_0x80c0('0x43')](_0xc105df[_0x80c0('0x40')],{'$or':_['map'](_0xc105df[_0x80c0('0x3a')],function(_0x3afec9){var _0xd5c549={};_0xd5c549[_0x3afec9]={'$like':'%'+_0x47b6fe['query'][_0x80c0('0x42')]+'%'};return _0xd5c549;})});}_0xc105df=_[_0x80c0('0x43')]({},_0xc105df,_0x47b6fe[_0x80c0('0x45')]);return _0x48a1fb[_0x80c0('0x8c')](_0xc105df);}})[_0x80c0('0x28')](function(_0xe78d34){if(_0xe78d34){_0x4f1231=_0xe78d34['length'];if(!_0x47b6fe['query'][_0x80c0('0x3c')](_0x80c0('0x3d'))){_0xc105df[_0x80c0('0x22')]=qs[_0x80c0('0x22')](_0x47b6fe[_0x80c0('0x37')][_0x80c0('0x22')]);_0xc105df[_0x80c0('0x24')]=qs[_0x80c0('0x24')](_0x47b6fe[_0x80c0('0x37')][_0x80c0('0x24')]);}return _0x48a1fb[_0x80c0('0x8c')](_0xc105df);}})['then'](function(_0xb15c93){if(_0xb15c93){return _0xb15c93?{'count':_0x4f1231,'rows':_0xb15c93}:null;}})[_0x80c0('0x28')](respondWithResult(_0xb823f3,null))[_0x80c0('0x48')](handleError(_0xb823f3,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index ea78479..ba637b5 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 _0x10b1=['MailQueue','setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x1443ee,_0x5c64c8){var _0x3783cf=function(_0x2c7b49){while(--_0x2c7b49){_0x1443ee['push'](_0x1443ee['shift']());}};_0x3783cf(++_0x5c64c8);}(_0x10b1,0x1b7));var _0x110b=function(_0x20f356,_0x2c1aed){_0x20f356=_0x20f356-0x0;var _0x38f523=_0x10b1[_0x20f356];return _0x38f523;};'use strict';var EventEmitter=require(_0x110b('0x0'));var MailQueue=require(_0x110b('0x1'))['db'][_0x110b('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x110b('0x3')](0x0);var events={'afterCreate':_0x110b('0x4'),'afterUpdate':_0x110b('0x5'),'afterDestroy':_0x110b('0x6')};function emitEvent(_0x77ca82){return function(_0x349bb4,_0x13eb5f,_0x502b5b){MailQueueEvents[_0x110b('0x7')](_0x77ca82+':'+_0x349bb4['id'],_0x349bb4);MailQueueEvents[_0x110b('0x7')](_0x77ca82,_0x349bb4);_0x502b5b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x110b('0x8')]=MailQueueEvents; \ No newline at end of file +var _0x622d=['MailQueue','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x5d88c0,_0x5d7d83){var _0x1b40f0=function(_0x3fde10){while(--_0x3fde10){_0x5d88c0['push'](_0x5d88c0['shift']());}};_0x1b40f0(++_0x5d7d83);}(_0x622d,0x7f));var _0xd622=function(_0x2c60a8,_0x242506){_0x2c60a8=_0x2c60a8-0x0;var _0x54fc19=_0x622d[_0x2c60a8];return _0x54fc19;};'use strict';var EventEmitter=require(_0xd622('0x0'));var MailQueue=require('../../mysqldb')['db'][_0xd622('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd622('0x2'),'afterUpdate':_0xd622('0x3'),'afterDestroy':_0xd622('0x4')};function emitEvent(_0x1bf882){return function(_0x120c61,_0x131205,_0x3ea284){MailQueueEvents['emit'](_0x1bf882+':'+_0x120c61['id'],_0x120c61);MailQueueEvents[_0xd622('0x5')](_0x1bf882,_0x120c61);_0x3ea284(null);};}for(var e in events){if(events[_0xd622('0x6')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xd622('0x7')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index a8b1c56..7932b8f 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 _0xf09a=['lodash','util','../../config/logger','api','bluebird','./mailQueue.attributes','exports','MailQueue','mail_queues'];(function(_0x2d5ba3,_0xd11eaa){var _0x5ec4f4=function(_0x3e1809){while(--_0x3e1809){_0x2d5ba3['push'](_0x2d5ba3['shift']());}};_0x5ec4f4(++_0xd11eaa);}(_0xf09a,0x1cb));var _0xaf09=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xf09a[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0xaf09('0x0'));var util=require(_0xaf09('0x1'));var logger=require(_0xaf09('0x2'))(_0xaf09('0x3'));var moment=require('moment');var BPromise=require(_0xaf09('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(_0xaf09('0x5'));module[_0xaf09('0x6')]=function(_0x8a30a9,_0x4902b1){return _0x8a30a9['define'](_0xaf09('0x7'),attributes,{'tableName':_0xaf09('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5834=['define','MailQueue','mail_queues','util','../../config/logger','moment','path','rimraf','exports'];(function(_0x3bb7e1,_0x1cf4c8){var _0x3f4ea7=function(_0x3ff367){while(--_0x3ff367){_0x3bb7e1['push'](_0x3bb7e1['shift']());}};_0x3f4ea7(++_0x1cf4c8);}(_0x5834,0x123));var _0x4583=function(_0x2cde0a,_0x1f9695){_0x2cde0a=_0x2cde0a-0x0;var _0x260610=_0x5834[_0x2cde0a];return _0x260610;};'use strict';var _=require('lodash');var util=require(_0x4583('0x0'));var logger=require(_0x4583('0x1'))('api');var moment=require(_0x4583('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4583('0x3'));var rimraf=require(_0x4583('0x4'));var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module[_0x4583('0x5')]=function(_0x218c2c,_0x3472d4){return _0x218c2c[_0x4583('0x6')](_0x4583('0x7'),attributes,{'tableName':_0x4583('0x8'),'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 9278aad..ac18d6f 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 _0x2116=['then','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','options','where','limit','include','map','model','attributes','GetMailQueue','stringify','ShowMailQueue','MailQueue','find','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request'];(function(_0x29f8da,_0x32eecb){var _0x25e144=function(_0x8f9719){while(--_0x8f9719){_0x29f8da['push'](_0x29f8da['shift']());}};_0x25e144(++_0x32eecb);}(_0x2116,0x67));var _0x6211=function(_0x17f2ba,_0x1ff00f){_0x17f2ba=_0x17f2ba-0x0;var _0x463b6a=_0x2116[_0x17f2ba];return _0x463b6a;};'use strict';var _=require('lodash');var util=require(_0x6211('0x0'));var moment=require('moment');var BPromise=require(_0x6211('0x1'));var rs=require(_0x6211('0x2'));var fs=require('fs');var Redis=require(_0x6211('0x3'));var db=require(_0x6211('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6211('0x5'))(_0x6211('0x6'));var config=require(_0x6211('0x7'));var jayson=require(_0x6211('0x8'));var client=jayson['client'][_0x6211('0x9')]({'port':0x232a});config['redis']=_[_0x6211('0xa')](config[_0x6211('0xb')],{'host':_0x6211('0xc'),'port':0x18eb});var socket=require(_0x6211('0xd'))(new Redis(config[_0x6211('0xb')]));require(_0x6211('0xe'))[_0x6211('0xf')](socket);function respondWithRpcPromise(_0x5eb8a5,_0x135182,_0x6a523d){return new BPromise(function(_0x245e56,_0x1e0634){return client[_0x6211('0x10')](_0x5eb8a5,_0x6a523d)[_0x6211('0x11')](function(_0x1b0938){logger['info'](_0x6211('0x12'),_0x135182,'request\x20sent');logger[_0x6211('0x13')](_0x6211('0x14'),_0x135182,_0x6211('0x15'),JSON['stringify'](_0x1b0938));if(_0x1b0938[_0x6211('0x16')]){if(_0x1b0938[_0x6211('0x16')][_0x6211('0x17')]===0x1f4){logger['error']('MailQueue,\x20%s,\x20%s',_0x135182,_0x1b0938[_0x6211('0x16')][_0x6211('0x18')]);return _0x1e0634(_0x1b0938[_0x6211('0x16')][_0x6211('0x18')]);}logger[_0x6211('0x16')](_0x6211('0x12'),_0x135182,_0x1b0938[_0x6211('0x16')][_0x6211('0x18')]);return _0x245e56(_0x1b0938['error'][_0x6211('0x18')]);}else{logger[_0x6211('0x19')](_0x6211('0x12'),_0x135182,_0x6211('0x15'));_0x245e56(_0x1b0938[_0x6211('0x1a')][_0x6211('0x18')]);}})[_0x6211('0x1b')](function(_0x54538b){logger[_0x6211('0x16')](_0x6211('0x12'),_0x135182,_0x54538b);_0x1e0634(_0x54538b);});});}exports['GetMailQueue']=function(_0x246b20){var _0x43532c=this;return new Promise(function(_0x20ed3c,_0x30d6a5){return db['MailQueue']['findAll']({'raw':_0x246b20[_0x6211('0x1c')]?_0x246b20[_0x6211('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x246b20['options']?_0x246b20[_0x6211('0x1c')][_0x6211('0x1d')]||null:null,'attributes':_0x246b20[_0x6211('0x1c')]?_0x246b20[_0x6211('0x1c')]['attributes']||null:null,'limit':_0x246b20[_0x6211('0x1c')]?_0x246b20[_0x6211('0x1c')][_0x6211('0x1e')]||null:null,'include':_0x246b20['options']?_0x246b20[_0x6211('0x1c')][_0x6211('0x1f')]?_[_0x6211('0x20')](_0x246b20['options']['include'],function(_0x4ebae9){return{'model':db[_0x4ebae9['model']],'as':_0x4ebae9['as'],'attributes':_0x4ebae9['attributes'],'include':_0x4ebae9[_0x6211('0x1f')]?_[_0x6211('0x20')](_0x4ebae9[_0x6211('0x1f')],function(_0x2d6265){return{'model':db[_0x2d6265[_0x6211('0x21')]],'as':_0x2d6265['as'],'attributes':_0x2d6265[_0x6211('0x22')],'include':_0x2d6265[_0x6211('0x1f')]?_[_0x6211('0x20')](_0x2d6265[_0x6211('0x1f')],function(_0x19a369){return{'model':db[_0x19a369[_0x6211('0x21')]],'as':_0x19a369['as'],'attributes':_0x19a369[_0x6211('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6211('0x11')](function(_0x26a8cc){logger[_0x6211('0x19')](_0x6211('0x23'),_0x246b20);logger[_0x6211('0x13')]('GetMailQueue',_0x246b20,JSON[_0x6211('0x24')](_0x26a8cc));_0x20ed3c(_0x26a8cc);})[_0x6211('0x1b')](function(_0x18553c){logger['error']('GetMailQueue',_0x18553c[_0x6211('0x18')],_0x246b20);_0x30d6a5(_0x43532c['error'](0x1f4,_0x18553c[_0x6211('0x18')]));});});};exports[_0x6211('0x25')]=function(_0x396037){var _0x4d942f=this;return new Promise(function(_0x1b8ab2,_0x453dbb){return db[_0x6211('0x26')][_0x6211('0x27')]({'raw':_0x396037[_0x6211('0x1c')]?_0x396037['options']['raw']===undefined?!![]:![]:!![],'where':_0x396037[_0x6211('0x1c')]?_0x396037['options']['where']||null:null,'attributes':_0x396037['options']?_0x396037[_0x6211('0x1c')][_0x6211('0x22')]||null:null,'include':_0x396037[_0x6211('0x1c')]?_0x396037['options'][_0x6211('0x1f')]?_['map'](_0x396037[_0x6211('0x1c')][_0x6211('0x1f')],function(_0x3c12e7){return{'model':db[_0x3c12e7['model']],'as':_0x3c12e7['as'],'attributes':_0x3c12e7[_0x6211('0x22')],'include':_0x3c12e7[_0x6211('0x1f')]?_[_0x6211('0x20')](_0x3c12e7[_0x6211('0x1f')],function(_0x1d41f2){return{'model':db[_0x1d41f2[_0x6211('0x21')]],'as':_0x1d41f2['as'],'attributes':_0x1d41f2[_0x6211('0x22')],'include':_0x1d41f2[_0x6211('0x1f')]?_['map'](_0x1d41f2[_0x6211('0x1f')],function(_0x32e27e){return{'model':db[_0x32e27e[_0x6211('0x21')]],'as':_0x32e27e['as'],'attributes':_0x32e27e[_0x6211('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6211('0x11')](function(_0x4831da){logger[_0x6211('0x19')](_0x6211('0x25'),_0x396037);logger[_0x6211('0x13')](_0x6211('0x25'),_0x396037,JSON['stringify'](_0x4831da));_0x1b8ab2(_0x4831da);})[_0x6211('0x1b')](function(_0x40fdeb){logger[_0x6211('0x16')](_0x6211('0x25'),_0x40fdeb[_0x6211('0x18')],_0x396037);_0x453dbb(_0x4d942f[_0x6211('0x16')](0x1f4,_0x40fdeb[_0x6211('0x18')]));});});}; \ No newline at end of file +var _0x14c3=['info','result','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowMailQueue','find','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','MailQueue,\x20%s,\x20%s','message'];(function(_0x6b82cd,_0x1fec2b){var _0x32e197=function(_0x34f485){while(--_0x34f485){_0x6b82cd['push'](_0x6b82cd['shift']());}};_0x32e197(++_0x1fec2b);}(_0x14c3,0x65));var _0x314c=function(_0x109fde,_0xa74ace){_0x109fde=_0x109fde-0x0;var _0x3bf187=_0x14c3[_0x109fde];return _0x3bf187;};'use strict';var _=require(_0x314c('0x0'));var util=require(_0x314c('0x1'));var moment=require(_0x314c('0x2'));var BPromise=require('bluebird');var rs=require(_0x314c('0x3'));var fs=require('fs');var Redis=require(_0x314c('0x4'));var db=require(_0x314c('0x5'))['db'];var utils=require(_0x314c('0x6'));var logger=require(_0x314c('0x7'))(_0x314c('0x8'));var config=require(_0x314c('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x314c('0xa')]({'port':0x232a});config[_0x314c('0xb')]=_[_0x314c('0xc')](config[_0x314c('0xb')],{'host':_0x314c('0xd'),'port':0x18eb});var socket=require(_0x314c('0xe'))(new Redis(config['redis']));require(_0x314c('0xf'))[_0x314c('0x10')](socket);function respondWithRpcPromise(_0x3f461d,_0x269211,_0x3110fa){return new BPromise(function(_0x1c74d3,_0x4b8b6c){return client[_0x314c('0x11')](_0x3f461d,_0x3110fa)[_0x314c('0x12')](function(_0x54fe0b){logger['info']('MailQueue,\x20%s,\x20%s',_0x269211,_0x314c('0x13'));logger[_0x314c('0x14')](_0x314c('0x15'),_0x269211,_0x314c('0x13'),JSON['stringify'](_0x54fe0b));if(_0x54fe0b[_0x314c('0x16')]){if(_0x54fe0b[_0x314c('0x16')]['code']===0x1f4){logger[_0x314c('0x16')](_0x314c('0x17'),_0x269211,_0x54fe0b[_0x314c('0x16')][_0x314c('0x18')]);return _0x4b8b6c(_0x54fe0b[_0x314c('0x16')][_0x314c('0x18')]);}logger[_0x314c('0x16')]('MailQueue,\x20%s,\x20%s',_0x269211,_0x54fe0b['error'][_0x314c('0x18')]);return _0x1c74d3(_0x54fe0b[_0x314c('0x16')][_0x314c('0x18')]);}else{logger[_0x314c('0x19')]('MailQueue,\x20%s,\x20%s',_0x269211,'request\x20sent');_0x1c74d3(_0x54fe0b[_0x314c('0x1a')][_0x314c('0x18')]);}})['catch'](function(_0x2caf87){logger[_0x314c('0x16')](_0x314c('0x17'),_0x269211,_0x2caf87);_0x4b8b6c(_0x2caf87);});});}exports[_0x314c('0x1b')]=function(_0x3233a9){var _0x3c6a69=this;return new Promise(function(_0x4bb46a,_0x3e7f9e){return db[_0x314c('0x1c')][_0x314c('0x1d')]({'raw':_0x3233a9[_0x314c('0x1e')]?_0x3233a9[_0x314c('0x1e')][_0x314c('0x1f')]===undefined?!![]:![]:!![],'where':_0x3233a9[_0x314c('0x1e')]?_0x3233a9[_0x314c('0x1e')][_0x314c('0x20')]||null:null,'attributes':_0x3233a9[_0x314c('0x1e')]?_0x3233a9[_0x314c('0x1e')][_0x314c('0x21')]||null:null,'limit':_0x3233a9[_0x314c('0x1e')]?_0x3233a9[_0x314c('0x1e')][_0x314c('0x22')]||null:null,'include':_0x3233a9[_0x314c('0x1e')]?_0x3233a9[_0x314c('0x1e')][_0x314c('0x23')]?_['map'](_0x3233a9['options'][_0x314c('0x23')],function(_0x48f999){return{'model':db[_0x48f999['model']],'as':_0x48f999['as'],'attributes':_0x48f999[_0x314c('0x21')],'include':_0x48f999[_0x314c('0x23')]?_[_0x314c('0x24')](_0x48f999[_0x314c('0x23')],function(_0x482cd2){return{'model':db[_0x482cd2['model']],'as':_0x482cd2['as'],'attributes':_0x482cd2[_0x314c('0x21')],'include':_0x482cd2[_0x314c('0x23')]?_[_0x314c('0x24')](_0x482cd2[_0x314c('0x23')],function(_0x214f34){return{'model':db[_0x214f34[_0x314c('0x25')]],'as':_0x214f34['as'],'attributes':_0x214f34[_0x314c('0x21')]};}):[]};}):[]};}):[]:[]})[_0x314c('0x12')](function(_0x5db9ff){logger[_0x314c('0x19')]('GetMailQueue',_0x3233a9);logger['debug']('GetMailQueue',_0x3233a9,JSON[_0x314c('0x26')](_0x5db9ff));_0x4bb46a(_0x5db9ff);})['catch'](function(_0x5daff4){logger[_0x314c('0x16')]('GetMailQueue',_0x5daff4[_0x314c('0x18')],_0x3233a9);_0x3e7f9e(_0x3c6a69[_0x314c('0x16')](0x1f4,_0x5daff4[_0x314c('0x18')]));});});};exports[_0x314c('0x27')]=function(_0x3a7824){var _0x1a9c62=this;return new Promise(function(_0x2fdd8a,_0x48059d){return db[_0x314c('0x1c')][_0x314c('0x28')]({'raw':_0x3a7824[_0x314c('0x1e')]?_0x3a7824[_0x314c('0x1e')][_0x314c('0x1f')]===undefined?!![]:![]:!![],'where':_0x3a7824[_0x314c('0x1e')]?_0x3a7824['options'][_0x314c('0x20')]||null:null,'attributes':_0x3a7824[_0x314c('0x1e')]?_0x3a7824[_0x314c('0x1e')][_0x314c('0x21')]||null:null,'include':_0x3a7824[_0x314c('0x1e')]?_0x3a7824[_0x314c('0x1e')][_0x314c('0x23')]?_['map'](_0x3a7824[_0x314c('0x1e')][_0x314c('0x23')],function(_0x2c4805){return{'model':db[_0x2c4805[_0x314c('0x25')]],'as':_0x2c4805['as'],'attributes':_0x2c4805['attributes'],'include':_0x2c4805[_0x314c('0x23')]?_['map'](_0x2c4805[_0x314c('0x23')],function(_0x516e94){return{'model':db[_0x516e94[_0x314c('0x25')]],'as':_0x516e94['as'],'attributes':_0x516e94[_0x314c('0x21')],'include':_0x516e94[_0x314c('0x23')]?_[_0x314c('0x24')](_0x516e94[_0x314c('0x23')],function(_0x755e3b){return{'model':db[_0x755e3b[_0x314c('0x25')]],'as':_0x755e3b['as'],'attributes':_0x755e3b['attributes']};}):[]};}):[]};}):[]:[]})[_0x314c('0x12')](function(_0x27591e){logger[_0x314c('0x19')](_0x314c('0x27'),_0x3a7824);logger[_0x314c('0x14')](_0x314c('0x27'),_0x3a7824,JSON[_0x314c('0x26')](_0x27591e));_0x2fdd8a(_0x27591e);})[_0x314c('0x29')](function(_0xe4851b){logger[_0x314c('0x16')](_0x314c('0x27'),_0xe4851b[_0x314c('0x18')],_0x3a7824);_0x48059d(_0x1a9c62[_0x314c('0x16')](0x1f4,_0xe4851b[_0x314c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index ab16eba..e44e114 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 _0xbe96=['./mailQueue.events','remove','removeListener','register','length'];(function(_0x50acf3,_0xe2c988){var _0x20248f=function(_0x25a742){while(--_0x25a742){_0x50acf3['push'](_0x50acf3['shift']());}};_0x20248f(++_0xe2c988);}(_0xbe96,0x19a));var _0x6be9=function(_0x2fc6fe,_0x58df4f){_0x2fc6fe=_0x2fc6fe-0x0;var _0x19f14a=_0xbe96[_0x2fc6fe];return _0x19f14a;};'use strict';var MailQueueEvents=require(_0x6be9('0x0'));var events=['save',_0x6be9('0x1'),'update'];function createListener(_0x3e6242,_0x3dcbdc){return function(_0xd68fb8){_0x3dcbdc['emit'](_0x3e6242,_0xd68fb8);};}function removeListener(_0x20a008,_0x5660cd){return function(){MailQueueEvents[_0x6be9('0x2')](_0x20a008,_0x5660cd);};}exports[_0x6be9('0x3')]=function(_0x14bd9a){for(var _0x4bfa77=0x0,_0x51e597=events[_0x6be9('0x4')];_0x4bfa77<_0x51e597;_0x4bfa77++){var _0x1f2bf3=events[_0x4bfa77];var _0x39c9ba=createListener('mailQueue:'+_0x1f2bf3,_0x14bd9a);MailQueueEvents['on'](_0x1f2bf3,_0x39c9ba);}}; \ No newline at end of file +var _0x50ab=['register','length','mailQueue:','remove','update','emit','removeListener'];(function(_0x445d20,_0x39643f){var _0x26e5f2=function(_0x1f1e53){while(--_0x1f1e53){_0x445d20['push'](_0x445d20['shift']());}};_0x26e5f2(++_0x39643f);}(_0x50ab,0x130));var _0xb50a=function(_0x48511f,_0x3aa048){_0x48511f=_0x48511f-0x0;var _0x2f2488=_0x50ab[_0x48511f];return _0x2f2488;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=['save',_0xb50a('0x0'),_0xb50a('0x1')];function createListener(_0x297a66,_0x1ecd1e){return function(_0x177952){_0x1ecd1e[_0xb50a('0x2')](_0x297a66,_0x177952);};}function removeListener(_0x5aa772,_0x478a3e){return function(){MailQueueEvents[_0xb50a('0x3')](_0x5aa772,_0x478a3e);};}exports[_0xb50a('0x4')]=function(_0x5b170c){for(var _0x51932a=0x0,_0x5c6637=events[_0xb50a('0x5')];_0x51932a<_0x5c6637;_0x51932a++){var _0x4179a6=events[_0x51932a];var _0x2a5696=createListener(_0xb50a('0x6')+_0x4179a6,_0x5b170c);MailQueueEvents['on'](_0x4179a6,_0x2a5696);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index a68df17..20d967b 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 _0x2666=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','/:id','show'];(function(_0xba90da,_0xaf9853){var _0x3a3a8a=function(_0x4ddea1){while(--_0x4ddea1){_0xba90da['push'](_0xba90da['shift']());}};_0x3a3a8a(++_0xaf9853);}(_0x2666,0x8d));var _0x6266=function(_0x42809b,_0x3f34af){_0x42809b=_0x42809b-0x0;var _0x3e1c01=_0x2666[_0x42809b];return _0x3e1c01;};'use strict';var multer=require(_0x6266('0x0'));var util=require(_0x6266('0x1'));var path=require(_0x6266('0x2'));var timeout=require(_0x6266('0x3'));var express=require(_0x6266('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6266('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6266('0x6'));var controller=require('./mailQueueReport.controller');router[_0x6266('0x7')]('/',auth[_0x6266('0x8')](),controller['index']);router[_0x6266('0x7')](_0x6266('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x6266('0xa'),auth[_0x6266('0x8')](),controller[_0x6266('0xb')]);router['post']('/',auth[_0x6266('0x8')](),controller['create']);router[_0x6266('0xc')](_0x6266('0xa'),auth['isAuthenticated'](),controller[_0x6266('0xd')]);router[_0x6266('0xe')]('/:id',auth[_0x6266('0x8')](),controller[_0x6266('0xf')]);module[_0x6266('0x10')]=router; \ No newline at end of file +var _0x4ebb=['post','create','put','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','index','isAuthenticated','/:id'];(function(_0x41a61e,_0xefa409){var _0x530384=function(_0x121746){while(--_0x121746){_0x41a61e['push'](_0x41a61e['shift']());}};_0x530384(++_0xefa409);}(_0x4ebb,0x83));var _0xb4eb=function(_0x3e7bf3,_0x3b45ba){_0x3e7bf3=_0x3e7bf3-0x0;var _0x595e24=_0x4ebb[_0x3e7bf3];return _0x595e24;};'use strict';var multer=require(_0xb4eb('0x0'));var util=require(_0xb4eb('0x1'));var path=require(_0xb4eb('0x2'));var timeout=require('connect-timeout');var express=require(_0xb4eb('0x3'));var router=express[_0xb4eb('0x4')]();var fs_extra=require(_0xb4eb('0x5'));var auth=require(_0xb4eb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb4eb('0x7'));var controller=require(_0xb4eb('0x8'));router[_0xb4eb('0x9')]('/',auth['isAuthenticated'](),controller[_0xb4eb('0xa')]);router[_0xb4eb('0x9')]('/describe',auth[_0xb4eb('0xb')](),controller['describe']);router['get'](_0xb4eb('0xc'),auth[_0xb4eb('0xb')](),controller['show']);router[_0xb4eb('0xd')]('/',auth[_0xb4eb('0xb')](),controller[_0xb4eb('0xe')]);router[_0xb4eb('0xf')](_0xb4eb('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xb4eb('0x10')](_0xb4eb('0xc'),auth[_0xb4eb('0xb')](),controller['destroy']);module[_0xb4eb('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 84049b8..98d1a03 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 _0x01a5=['sequelize','exports','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x01a5,0x1a8));var _0x501a=function(_0x382981,_0x5d0463){_0x382981=_0x382981-0x0;var _0xf32bfe=_0x01a5[_0x382981];return _0xf32bfe;};'use strict';var moment=require('moment');var Sequelize=require(_0x501a('0x0'));module[_0x501a('0x1')]={'uniqueid':{'type':Sequelize[_0x501a('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x501a('0x2')]},'joinAt':{'type':Sequelize[_0x501a('0x3')]},'leaveAt':{'type':Sequelize[_0x501a('0x3')]},'acceptAt':{'type':Sequelize[_0x501a('0x3')]},'exitAt':{'type':Sequelize[_0x501a('0x3')]},'reason':{'type':Sequelize[_0x501a('0x2')]}}; \ No newline at end of file +var _0xda62=['DATE','exports','STRING'];(function(_0x405741,_0xdcfc6d){var _0x13fbed=function(_0x3c3564){while(--_0x3c3564){_0x405741['push'](_0x405741['shift']());}};_0x13fbed(++_0xdcfc6d);}(_0xda62,0x1ba));var _0x2da6=function(_0x3dff8c,_0x2dcb69){_0x3dff8c=_0x3dff8c-0x0;var _0x2a9615=_0xda62[_0x3dff8c];return _0x2a9615;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x2da6('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x2da6('0x1')]},'joinAt':{'type':Sequelize[_0x2da6('0x2')]},'leaveAt':{'type':Sequelize[_0x2da6('0x2')]},'acceptAt':{'type':Sequelize[_0x2da6('0x2')]},'exitAt':{'type':Sequelize[_0x2da6('0x2')]},'reason':{'type':Sequelize[_0x2da6('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 96add5e..316cd8d 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 _0xd117=['filter','merge','VIRTUAL','count','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','MailQueueReport','fieldName','type','map','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x412cd7,_0x27bfc7){var _0x19f640=function(_0x5f1db9){while(--_0x5f1db9){_0x412cd7['push'](_0x412cd7['shift']());}};_0x19f640(++_0x27bfc7);}(_0xd117,0x182));var _0x7d11=function(_0x1a27f3,_0x1c082d){_0x1a27f3=_0x1a27f3-0x0;var _0x3ce222=_0xd117[_0x1a27f3];return _0x3ce222;};'use strict';var emlformat=require(_0x7d11('0x0'));var rimraf=require(_0x7d11('0x1'));var zipdir=require(_0x7d11('0x2'));var jsonpatch=require(_0x7d11('0x3'));var rp=require(_0x7d11('0x4'));var moment=require(_0x7d11('0x5'));var BPromise=require(_0x7d11('0x6'));var Mustache=require(_0x7d11('0x7'));var util=require(_0x7d11('0x8'));var path=require(_0x7d11('0x9'));var sox=require(_0x7d11('0xa'));var csv=require(_0x7d11('0xb'));var ejs=require(_0x7d11('0xc'));var fs=require('fs');var fs_extra=require(_0x7d11('0xd'));var _=require(_0x7d11('0xe'));var squel=require(_0x7d11('0xf'));var crypto=require('crypto');var jsforce=require(_0x7d11('0x10'));var deskjs=require(_0x7d11('0x11'));var toCsv=require(_0x7d11('0xb'));var querystring=require('querystring');var Papa=require(_0x7d11('0x12'));var Redis=require(_0x7d11('0x13'));var authService=require(_0x7d11('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7d11('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7d11('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7d11('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4767d5,_0x471f46){_0x471f46=_0x471f46||0xcc;return function(_0x5ee572){if(_0x5ee572){return _0x4767d5[_0x7d11('0x18')](_0x471f46);}return _0x4767d5[_0x7d11('0x19')](_0x471f46)['end']();};}function respondWithResult(_0x324de5,_0x16949d){_0x16949d=_0x16949d||0xc8;return function(_0x20a2df){if(_0x20a2df){return _0x324de5[_0x7d11('0x19')](_0x16949d)[_0x7d11('0x1a')](_0x20a2df);}};}function respondWithFilteredResult(_0xeae744,_0x2a269e){return function(_0xb1669e){if(_0xb1669e){var _0x4aa795=typeof _0x2a269e[_0x7d11('0x1b')]===_0x7d11('0x1c')&&typeof _0x2a269e[_0x7d11('0x1d')]===_0x7d11('0x1c');var _0x45f916=_0xb1669e['count'];var _0x456cb9=_0x4aa795?0x0:_0x2a269e[_0x7d11('0x1b')];var _0x4d1306=_0x4aa795?_0xb1669e['count']:_0x2a269e[_0x7d11('0x1b')]+_0x2a269e['limit'];var _0x1f9990;if(_0x4d1306>=_0x45f916){_0x4d1306=_0x45f916;_0x1f9990=0xc8;}else{_0x1f9990=0xce;}_0xeae744['status'](_0x1f9990);return _0xeae744[_0x7d11('0x1e')](_0x7d11('0x1f'),_0x456cb9+'-'+_0x4d1306+'/'+_0x45f916)[_0x7d11('0x1a')](_0xb1669e);}return null;};}function patchUpdates(_0x46f662){return function(_0x30df70){try{jsonpatch[_0x7d11('0x20')](_0x30df70,_0x46f662,!![]);}catch(_0x4297f8){return BPromise[_0x7d11('0x21')](_0x4297f8);}return _0x30df70['save']();};}function saveUpdates(_0x441917,_0x4a34f4){return function(_0x58455b){if(_0x58455b){return _0x58455b['update'](_0x441917)[_0x7d11('0x22')](function(_0x3545dc){return _0x3545dc;});}return null;};}function removeEntity(_0x44476c,_0x1a7853){return function(_0x355d14){if(_0x355d14){return _0x355d14[_0x7d11('0x23')]()[_0x7d11('0x22')](function(){_0x44476c[_0x7d11('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36c2b4,_0x577ca9){return function(_0x4bfa76){if(!_0x4bfa76){_0x36c2b4['sendStatus'](0x194);}return _0x4bfa76;};}function handleError(_0x3ba092,_0x59cdba){_0x59cdba=_0x59cdba||0x1f4;return function(_0x180e1e){logger[_0x7d11('0x24')](_0x180e1e[_0x7d11('0x25')]);if(_0x180e1e['name']){delete _0x180e1e[_0x7d11('0x26')];}_0x3ba092[_0x7d11('0x19')](_0x59cdba)[_0x7d11('0x27')](_0x180e1e);};}exports['index']=function(_0x601650,_0x35a789){var _0x18c049={},_0x38f1be={},_0x4c7d6a={'count':0x0,'rows':[]};var _0x1a7745=_['map'](db[_0x7d11('0x28')]['rawAttributes'],function(_0x31866d){return{'name':_0x31866d[_0x7d11('0x29')],'type':_0x31866d[_0x7d11('0x2a')]['key']};});_0x38f1be['model']=_[_0x7d11('0x2b')](_0x1a7745,_0x7d11('0x26'));_0x38f1be['query']=_[_0x7d11('0x2c')](_0x601650[_0x7d11('0x2d')]);_0x38f1be[_0x7d11('0x2e')]=_['intersection'](_0x38f1be[_0x7d11('0x2f')],_0x38f1be['query']);_0x18c049['attributes']=_[_0x7d11('0x30')](_0x38f1be['model'],qs[_0x7d11('0x31')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x31')]));_0x18c049[_0x7d11('0x32')]=_0x18c049['attributes'][_0x7d11('0x33')]?_0x18c049[_0x7d11('0x32')]:_0x38f1be['model'];if(!_0x601650['query'][_0x7d11('0x34')](_0x7d11('0x35'))){_0x18c049['limit']=qs[_0x7d11('0x1d')](_0x601650['query']['limit']);_0x18c049[_0x7d11('0x1b')]=qs['offset'](_0x601650['query'][_0x7d11('0x1b')]);}_0x18c049[_0x7d11('0x36')]=qs[_0x7d11('0x37')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x37')]);_0x18c049[_0x7d11('0x38')]=qs[_0x7d11('0x2e')](_[_0x7d11('0x39')](_0x601650[_0x7d11('0x2d')],_0x38f1be[_0x7d11('0x2e')]),_0x1a7745);if(_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]){_0x18c049['where']=_[_0x7d11('0x3b')](_0x18c049['where'],{'$or':_[_0x7d11('0x2b')](_0x1a7745,function(_0x111e26){if(_0x111e26[_0x7d11('0x2a')]!==_0x7d11('0x3c')){var _0x4f8fd2={};_0x4f8fd2[_0x111e26[_0x7d11('0x26')]]={'$like':'%'+_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]+'%'};return _0x4f8fd2;}})});}_0x18c049=_[_0x7d11('0x3b')]({},_0x18c049,_0x601650['options']);var _0x22730e={'where':_0x18c049['where']};return db[_0x7d11('0x28')]['count'](_0x22730e)[_0x7d11('0x22')](function(_0x622725){_0x4c7d6a[_0x7d11('0x3d')]=_0x622725;if(_0x601650[_0x7d11('0x2d')]['includeAll']){_0x18c049['include']=[{'all':!![]}];}return db[_0x7d11('0x28')][_0x7d11('0x3e')](_0x18c049);})['then'](function(_0x1caef9){_0x4c7d6a[_0x7d11('0x3f')]=_0x1caef9;return _0x4c7d6a;})[_0x7d11('0x22')](respondWithFilteredResult(_0x35a789,_0x18c049))[_0x7d11('0x40')](handleError(_0x35a789,null));};exports[_0x7d11('0x41')]=function(_0x2e1647,_0x47e968){var _0x25b73b={'raw':!![],'where':{'id':_0x2e1647[_0x7d11('0x42')]['id']}},_0x5cf6a6={};_0x5cf6a6[_0x7d11('0x2f')]=_[_0x7d11('0x2c')](db[_0x7d11('0x28')][_0x7d11('0x43')]);_0x5cf6a6[_0x7d11('0x2d')]=_['keys'](_0x2e1647['query']);_0x5cf6a6['filters']=_[_0x7d11('0x30')](_0x5cf6a6[_0x7d11('0x2f')],_0x5cf6a6[_0x7d11('0x2d')]);_0x25b73b[_0x7d11('0x32')]=_[_0x7d11('0x30')](_0x5cf6a6['model'],qs[_0x7d11('0x31')](_0x2e1647[_0x7d11('0x2d')]['fields']));_0x25b73b[_0x7d11('0x32')]=_0x25b73b[_0x7d11('0x32')][_0x7d11('0x33')]?_0x25b73b['attributes']:_0x5cf6a6[_0x7d11('0x2f')];if(_0x2e1647[_0x7d11('0x2d')][_0x7d11('0x44')]){_0x25b73b['include']=[{'all':!![]}];}_0x25b73b=_[_0x7d11('0x3b')]({},_0x25b73b,_0x2e1647['options']);return db[_0x7d11('0x28')][_0x7d11('0x45')](_0x25b73b)[_0x7d11('0x22')](handleEntityNotFound(_0x47e968,null))[_0x7d11('0x22')](respondWithResult(_0x47e968,null))[_0x7d11('0x40')](handleError(_0x47e968,null));};exports[_0x7d11('0x46')]=function(_0x161213,_0x193631){return db[_0x7d11('0x28')]['create'](_0x161213['body'],{})['then'](respondWithResult(_0x193631,0xc9))[_0x7d11('0x40')](handleError(_0x193631,null));};exports[_0x7d11('0x47')]=function(_0x20297a,_0x18ae0e){if(_0x20297a[_0x7d11('0x48')]['id']){delete _0x20297a[_0x7d11('0x48')]['id'];}return db[_0x7d11('0x28')][_0x7d11('0x45')]({'where':{'id':_0x20297a[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x18ae0e,null))[_0x7d11('0x22')](saveUpdates(_0x20297a[_0x7d11('0x48')],null))['then'](respondWithResult(_0x18ae0e,null))[_0x7d11('0x40')](handleError(_0x18ae0e,null));};exports[_0x7d11('0x23')]=function(_0x29207f,_0x553a03){return db['MailQueueReport'][_0x7d11('0x45')]({'where':{'id':_0x29207f[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x553a03,null))['then'](removeEntity(_0x553a03,null))['catch'](handleError(_0x553a03,null));};exports[_0x7d11('0x49')]=function(_0x36af2b,_0x5e6234){return db[_0x7d11('0x28')][_0x7d11('0x49')]()[_0x7d11('0x22')](respondWithResult(_0x5e6234,null))[_0x7d11('0x40')](handleError(_0x5e6234,null));}; \ No newline at end of file +var _0xd117=['filter','merge','VIRTUAL','count','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','MailQueueReport','fieldName','type','map','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x31a566,_0x4ff898){var _0x4c811d=function(_0x25300e){while(--_0x25300e){_0x31a566['push'](_0x31a566['shift']());}};_0x4c811d(++_0x4ff898);}(_0xd117,0x182));var _0x7d11=function(_0x2a40b3,_0xe1c253){_0x2a40b3=_0x2a40b3-0x0;var _0x4ac6cb=_0xd117[_0x2a40b3];return _0x4ac6cb;};'use strict';var emlformat=require(_0x7d11('0x0'));var rimraf=require(_0x7d11('0x1'));var zipdir=require(_0x7d11('0x2'));var jsonpatch=require(_0x7d11('0x3'));var rp=require(_0x7d11('0x4'));var moment=require(_0x7d11('0x5'));var BPromise=require(_0x7d11('0x6'));var Mustache=require(_0x7d11('0x7'));var util=require(_0x7d11('0x8'));var path=require(_0x7d11('0x9'));var sox=require(_0x7d11('0xa'));var csv=require(_0x7d11('0xb'));var ejs=require(_0x7d11('0xc'));var fs=require('fs');var fs_extra=require(_0x7d11('0xd'));var _=require(_0x7d11('0xe'));var squel=require(_0x7d11('0xf'));var crypto=require('crypto');var jsforce=require(_0x7d11('0x10'));var deskjs=require(_0x7d11('0x11'));var toCsv=require(_0x7d11('0xb'));var querystring=require('querystring');var Papa=require(_0x7d11('0x12'));var Redis=require(_0x7d11('0x13'));var authService=require(_0x7d11('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7d11('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7d11('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7d11('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4767d5,_0x471f46){_0x471f46=_0x471f46||0xcc;return function(_0x5ee572){if(_0x5ee572){return _0x4767d5[_0x7d11('0x18')](_0x471f46);}return _0x4767d5[_0x7d11('0x19')](_0x471f46)['end']();};}function respondWithResult(_0x324de5,_0x16949d){_0x16949d=_0x16949d||0xc8;return function(_0x20a2df){if(_0x20a2df){return _0x324de5[_0x7d11('0x19')](_0x16949d)[_0x7d11('0x1a')](_0x20a2df);}};}function respondWithFilteredResult(_0xeae744,_0x2a269e){return function(_0xb1669e){if(_0xb1669e){var _0x4aa795=typeof _0x2a269e[_0x7d11('0x1b')]===_0x7d11('0x1c')&&typeof _0x2a269e[_0x7d11('0x1d')]===_0x7d11('0x1c');var _0x45f916=_0xb1669e['count'];var _0x456cb9=_0x4aa795?0x0:_0x2a269e[_0x7d11('0x1b')];var _0x4d1306=_0x4aa795?_0xb1669e['count']:_0x2a269e[_0x7d11('0x1b')]+_0x2a269e['limit'];var _0x1f9990;if(_0x4d1306>=_0x45f916){_0x4d1306=_0x45f916;_0x1f9990=0xc8;}else{_0x1f9990=0xce;}_0xeae744['status'](_0x1f9990);return _0xeae744[_0x7d11('0x1e')](_0x7d11('0x1f'),_0x456cb9+'-'+_0x4d1306+'/'+_0x45f916)[_0x7d11('0x1a')](_0xb1669e);}return null;};}function patchUpdates(_0x46f662){return function(_0x30df70){try{jsonpatch[_0x7d11('0x20')](_0x30df70,_0x46f662,!![]);}catch(_0x4297f8){return BPromise[_0x7d11('0x21')](_0x4297f8);}return _0x30df70['save']();};}function saveUpdates(_0x441917,_0x4a34f4){return function(_0x58455b){if(_0x58455b){return _0x58455b['update'](_0x441917)[_0x7d11('0x22')](function(_0x3545dc){return _0x3545dc;});}return null;};}function removeEntity(_0x44476c,_0x1a7853){return function(_0x355d14){if(_0x355d14){return _0x355d14[_0x7d11('0x23')]()[_0x7d11('0x22')](function(){_0x44476c[_0x7d11('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36c2b4,_0x577ca9){return function(_0x4bfa76){if(!_0x4bfa76){_0x36c2b4['sendStatus'](0x194);}return _0x4bfa76;};}function handleError(_0x3ba092,_0x59cdba){_0x59cdba=_0x59cdba||0x1f4;return function(_0x180e1e){logger[_0x7d11('0x24')](_0x180e1e[_0x7d11('0x25')]);if(_0x180e1e['name']){delete _0x180e1e[_0x7d11('0x26')];}_0x3ba092[_0x7d11('0x19')](_0x59cdba)[_0x7d11('0x27')](_0x180e1e);};}exports['index']=function(_0x601650,_0x35a789){var _0x18c049={},_0x38f1be={},_0x4c7d6a={'count':0x0,'rows':[]};var _0x1a7745=_['map'](db[_0x7d11('0x28')]['rawAttributes'],function(_0x31866d){return{'name':_0x31866d[_0x7d11('0x29')],'type':_0x31866d[_0x7d11('0x2a')]['key']};});_0x38f1be['model']=_[_0x7d11('0x2b')](_0x1a7745,_0x7d11('0x26'));_0x38f1be['query']=_[_0x7d11('0x2c')](_0x601650[_0x7d11('0x2d')]);_0x38f1be[_0x7d11('0x2e')]=_['intersection'](_0x38f1be[_0x7d11('0x2f')],_0x38f1be['query']);_0x18c049['attributes']=_[_0x7d11('0x30')](_0x38f1be['model'],qs[_0x7d11('0x31')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x31')]));_0x18c049[_0x7d11('0x32')]=_0x18c049['attributes'][_0x7d11('0x33')]?_0x18c049[_0x7d11('0x32')]:_0x38f1be['model'];if(!_0x601650['query'][_0x7d11('0x34')](_0x7d11('0x35'))){_0x18c049['limit']=qs[_0x7d11('0x1d')](_0x601650['query']['limit']);_0x18c049[_0x7d11('0x1b')]=qs['offset'](_0x601650['query'][_0x7d11('0x1b')]);}_0x18c049[_0x7d11('0x36')]=qs[_0x7d11('0x37')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x37')]);_0x18c049[_0x7d11('0x38')]=qs[_0x7d11('0x2e')](_[_0x7d11('0x39')](_0x601650[_0x7d11('0x2d')],_0x38f1be[_0x7d11('0x2e')]),_0x1a7745);if(_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]){_0x18c049['where']=_[_0x7d11('0x3b')](_0x18c049['where'],{'$or':_[_0x7d11('0x2b')](_0x1a7745,function(_0x111e26){if(_0x111e26[_0x7d11('0x2a')]!==_0x7d11('0x3c')){var _0x4f8fd2={};_0x4f8fd2[_0x111e26[_0x7d11('0x26')]]={'$like':'%'+_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]+'%'};return _0x4f8fd2;}})});}_0x18c049=_[_0x7d11('0x3b')]({},_0x18c049,_0x601650['options']);var _0x22730e={'where':_0x18c049['where']};return db[_0x7d11('0x28')]['count'](_0x22730e)[_0x7d11('0x22')](function(_0x622725){_0x4c7d6a[_0x7d11('0x3d')]=_0x622725;if(_0x601650[_0x7d11('0x2d')]['includeAll']){_0x18c049['include']=[{'all':!![]}];}return db[_0x7d11('0x28')][_0x7d11('0x3e')](_0x18c049);})['then'](function(_0x1caef9){_0x4c7d6a[_0x7d11('0x3f')]=_0x1caef9;return _0x4c7d6a;})[_0x7d11('0x22')](respondWithFilteredResult(_0x35a789,_0x18c049))[_0x7d11('0x40')](handleError(_0x35a789,null));};exports[_0x7d11('0x41')]=function(_0x2e1647,_0x47e968){var _0x25b73b={'raw':!![],'where':{'id':_0x2e1647[_0x7d11('0x42')]['id']}},_0x5cf6a6={};_0x5cf6a6[_0x7d11('0x2f')]=_[_0x7d11('0x2c')](db[_0x7d11('0x28')][_0x7d11('0x43')]);_0x5cf6a6[_0x7d11('0x2d')]=_['keys'](_0x2e1647['query']);_0x5cf6a6['filters']=_[_0x7d11('0x30')](_0x5cf6a6[_0x7d11('0x2f')],_0x5cf6a6[_0x7d11('0x2d')]);_0x25b73b[_0x7d11('0x32')]=_[_0x7d11('0x30')](_0x5cf6a6['model'],qs[_0x7d11('0x31')](_0x2e1647[_0x7d11('0x2d')]['fields']));_0x25b73b[_0x7d11('0x32')]=_0x25b73b[_0x7d11('0x32')][_0x7d11('0x33')]?_0x25b73b['attributes']:_0x5cf6a6[_0x7d11('0x2f')];if(_0x2e1647[_0x7d11('0x2d')][_0x7d11('0x44')]){_0x25b73b['include']=[{'all':!![]}];}_0x25b73b=_[_0x7d11('0x3b')]({},_0x25b73b,_0x2e1647['options']);return db[_0x7d11('0x28')][_0x7d11('0x45')](_0x25b73b)[_0x7d11('0x22')](handleEntityNotFound(_0x47e968,null))[_0x7d11('0x22')](respondWithResult(_0x47e968,null))[_0x7d11('0x40')](handleError(_0x47e968,null));};exports[_0x7d11('0x46')]=function(_0x161213,_0x193631){return db[_0x7d11('0x28')]['create'](_0x161213['body'],{})['then'](respondWithResult(_0x193631,0xc9))[_0x7d11('0x40')](handleError(_0x193631,null));};exports[_0x7d11('0x47')]=function(_0x20297a,_0x18ae0e){if(_0x20297a[_0x7d11('0x48')]['id']){delete _0x20297a[_0x7d11('0x48')]['id'];}return db[_0x7d11('0x28')][_0x7d11('0x45')]({'where':{'id':_0x20297a[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x18ae0e,null))[_0x7d11('0x22')](saveUpdates(_0x20297a[_0x7d11('0x48')],null))['then'](respondWithResult(_0x18ae0e,null))[_0x7d11('0x40')](handleError(_0x18ae0e,null));};exports[_0x7d11('0x23')]=function(_0x29207f,_0x553a03){return db['MailQueueReport'][_0x7d11('0x45')]({'where':{'id':_0x29207f[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x553a03,null))['then'](removeEntity(_0x553a03,null))['catch'](handleError(_0x553a03,null));};exports[_0x7d11('0x49')]=function(_0x36af2b,_0x5e6234){return db[_0x7d11('0x28')][_0x7d11('0x49')]()[_0x7d11('0x22')](respondWithResult(_0x5e6234,null))[_0x7d11('0x40')](handleError(_0x5e6234,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 64db856..77d220c 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 _0x651e=['define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports'];(function(_0x47eb8f,_0x1fab1f){var _0x570a9e=function(_0x13441d){while(--_0x13441d){_0x47eb8f['push'](_0x47eb8f['shift']());}};_0x570a9e(++_0x1fab1f);}(_0x651e,0xf4));var _0xe651=function(_0xdf31bb,_0x2a35fb){_0xdf31bb=_0xdf31bb-0x0;var _0xf77c29=_0x651e[_0xdf31bb];return _0xf77c29;};'use strict';var _=require(_0xe651('0x0'));var util=require(_0xe651('0x1'));var logger=require(_0xe651('0x2'))(_0xe651('0x3'));var moment=require(_0xe651('0x4'));var BPromise=require(_0xe651('0x5'));var rp=require(_0xe651('0x6'));var fs=require('fs');var path=require(_0xe651('0x7'));var rimraf=require(_0xe651('0x8'));var config=require(_0xe651('0x9'));var attributes=require(_0xe651('0xa'));module[_0xe651('0xb')]=function(_0x2d8619,_0x14c2a8){return _0x2d8619[_0xe651('0xc')](_0xe651('0xd'),attributes,{'tableName':_0xe651('0xe'),'paranoid':![],'indexes':[{'name':_0xe651('0xf'),'fields':[_0xe651('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x59c7=['path','./mailQueueReport.attributes','exports','define','MailQueueReport','uniqueid','lodash','api','moment','request-promise'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x59c7,0x1b4));var _0x759c=function(_0x24fc56,_0x1bce4f){_0x24fc56=_0x24fc56-0x0;var _0x2679c3=_0x59c7[_0x24fc56];return _0x2679c3;};'use strict';var _=require(_0x759c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x759c('0x1'));var moment=require(_0x759c('0x2'));var BPromise=require('bluebird');var rp=require(_0x759c('0x3'));var fs=require('fs');var path=require(_0x759c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x759c('0x5'));module[_0x759c('0x6')]=function(_0x2500a3,_0x309f70){return _0x2500a3[_0x759c('0x7')](_0x759c('0x8'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x759c('0x9'),'fields':[_0x759c('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index b00d373..5737f58 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 _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x456616,_0x10aa87){var _0x5e216b=function(_0x59f069){while(--_0x59f069){_0x456616['push'](_0x456616['shift']());}};_0x5e216b(++_0x10aa87);}(_0x1261,0x144));var _0x1126=function(_0x34c027,_0x123688){_0x34c027=_0x34c027-0x0;var _0x47bff0=_0x1261[_0x34c027];return _0x47bff0;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ No newline at end of file +var _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x248dc8,_0x10c027){var _0x15aaee=function(_0xa53979){while(--_0xa53979){_0x248dc8['push'](_0x248dc8['shift']());}};_0x15aaee(++_0x10c027);}(_0xdb28,0x106));var _0x8db2=function(_0x5a075b,_0x54f24d){_0x5a075b=_0x5a075b-0x0;var _0x884867=_0xdb28[_0x5a075b];return _0x884867;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 80c3445..3a1987b 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(_0x210e34,_0x5c5679){var _0xbb6d33=function(_0xd5dc05){while(--_0xd5dc05){_0x210e34['push'](_0x210e34['shift']());}};_0xbb6d33(++_0x5c5679);}(_0x70e0,0x17b));var _0x070e=function(_0x43d9a6,_0x5a55c7){_0x43d9a6=_0x43d9a6-0x0;var _0x1cab40=_0x70e0[_0x43d9a6];return _0x1cab40;};'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(_0x393ea2,_0x2e6de6){var _0x245eb2=function(_0x2be3f4){while(--_0x2be3f4){_0x393ea2['push'](_0x393ea2['shift']());}};_0x245eb2(++_0x2e6de6);}(_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 db804df..aed1950 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 _0xc901=['INBOX','INTEGER','sequelize','STRING','BOOLEAN'];(function(_0x4ee192,_0x36efe9){var _0x34269f=function(_0x58bfc9){while(--_0x58bfc9){_0x4ee192['push'](_0x4ee192['shift']());}};_0x34269f(++_0x36efe9);}(_0xc901,0x142));var _0x1c90=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc901[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x1c90('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x1c90('0x1')]},'password':{'type':Sequelize[_0x1c90('0x1')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x1c90('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x1c90('0x1')],'defaultValue':_0x1c90('0x3')},'connTimeout':{'type':Sequelize[_0x1c90('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x1c90('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x1c90('0x1')]}}; \ No newline at end of file +var _0xbf6e=['INBOX','STRING','BOOLEAN','INTEGER'];(function(_0x2eed41,_0x3865cb){var _0x55ec7=function(_0x17bac9){while(--_0x17bac9){_0x2eed41['push'](_0x2eed41['shift']());}};_0x55ec7(++_0x3865cb);}(_0xbf6e,0x149));var _0xebf6=function(_0x500edf,_0x1e8af7){_0x500edf=_0x500edf-0x0;var _0x5181e0=_0xbf6e[_0x500edf];return _0x5181e0;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0xebf6('0x0')]},'host':{'type':Sequelize[_0xebf6('0x0')]},'authentication':{'type':Sequelize[_0xebf6('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0xebf6('0x0')]},'password':{'type':Sequelize[_0xebf6('0x0')]},'port':{'type':Sequelize[_0xebf6('0x2')]},'tls':{'type':Sequelize[_0xebf6('0x1')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xebf6('0x3')},'connTimeout':{'type':Sequelize[_0xebf6('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xebf6('0x2')],'defaultValue':0x5},'service':{'type':Sequelize[_0xebf6('0x0')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 4fb68da..cc27ad2 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 _0x8367=['bluebird','request-promise','path','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','util','../../config/logger','api'];(function(_0x3c2ce9,_0x2afb63){var _0x5ba222=function(_0x41aedc){while(--_0x41aedc){_0x3c2ce9['push'](_0x3c2ce9['shift']());}};_0x5ba222(++_0x2afb63);}(_0x8367,0x17d));var _0x7836=function(_0x2136d5,_0x4b0479){_0x2136d5=_0x2136d5-0x0;var _0x3bee2e=_0x8367[_0x2136d5];return _0x3bee2e;};'use strict';var _=require('lodash');var util=require(_0x7836('0x0'));var logger=require(_0x7836('0x1'))(_0x7836('0x2'));var moment=require('moment');var BPromise=require(_0x7836('0x3'));var rp=require(_0x7836('0x4'));var fs=require('fs');var path=require(_0x7836('0x5'));var rimraf=require('rimraf');var config=require(_0x7836('0x6'));var attributes=require(_0x7836('0x7'));module[_0x7836('0x8')]=function(_0x407fc9,_0x1bad57){return _0x407fc9[_0x7836('0x9')](_0x7836('0xa'),attributes,{'tableName':_0x7836('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ed9=['util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash'];(function(_0x52a9eb,_0x13bcb7){var _0x570b7f=function(_0x10998d){while(--_0x10998d){_0x52a9eb['push'](_0x52a9eb['shift']());}};_0x570b7f(++_0x13bcb7);}(_0x2ed9,0xa7));var _0x92ed=function(_0x159fd1,_0x73b713){_0x159fd1=_0x159fd1-0x0;var _0x5c85b1=_0x2ed9[_0x159fd1];return _0x5c85b1;};'use strict';var _=require(_0x92ed('0x0'));var util=require(_0x92ed('0x1'));var logger=require(_0x92ed('0x2'))('api');var moment=require(_0x92ed('0x3'));var BPromise=require('bluebird');var rp=require(_0x92ed('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x92ed('0x5'));var config=require(_0x92ed('0x6'));var attributes=require(_0x92ed('0x7'));module[_0x92ed('0x8')]=function(_0x52ab7d,_0x23a5eb){return _0x52ab7d[_0x92ed('0x9')](_0x92ed('0xa'),attributes,{'tableName':_0x92ed('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 65d4c5c..07b4cc1 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 _0x35fc=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error','code','MailServerIn,\x20%s,\x20%s','message','info','catch','findAll','options','where','attributes','include','map','model','GetMailServerIn','stringify','lodash'];(function(_0x519401,_0x3c39ab){var _0x11e911=function(_0x499072){while(--_0x499072){_0x519401['push'](_0x519401['shift']());}};_0x11e911(++_0x3c39ab);}(_0x35fc,0x7f));var _0xc35f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x35fc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc35f('0x0'));var util=require(_0xc35f('0x1'));var moment=require('moment');var BPromise=require(_0xc35f('0x2'));var rs=require(_0xc35f('0x3'));var fs=require('fs');var Redis=require(_0xc35f('0x4'));var db=require(_0xc35f('0x5'))['db'];var utils=require(_0xc35f('0x6'));var logger=require(_0xc35f('0x7'))(_0xc35f('0x8'));var config=require(_0xc35f('0x9'));var jayson=require(_0xc35f('0xa'));var client=jayson[_0xc35f('0xb')][_0xc35f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5764b6,_0x56d4db,_0x17a26d){return new BPromise(function(_0xe2cee9,_0x417cb9){return client[_0xc35f('0xd')](_0x5764b6,_0x17a26d)[_0xc35f('0xe')](function(_0x4ddc48){logger['info']('MailServerIn,\x20%s,\x20%s',_0x56d4db,_0xc35f('0xf'));logger[_0xc35f('0x10')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x56d4db,_0xc35f('0xf'),JSON['stringify'](_0x4ddc48));if(_0x4ddc48['error']){if(_0x4ddc48[_0xc35f('0x11')][_0xc35f('0x12')]===0x1f4){logger[_0xc35f('0x11')](_0xc35f('0x13'),_0x56d4db,_0x4ddc48[_0xc35f('0x11')][_0xc35f('0x14')]);return _0x417cb9(_0x4ddc48['error'][_0xc35f('0x14')]);}logger[_0xc35f('0x11')](_0xc35f('0x13'),_0x56d4db,_0x4ddc48[_0xc35f('0x11')]['message']);return _0xe2cee9(_0x4ddc48['error']['message']);}else{logger[_0xc35f('0x15')]('MailServerIn,\x20%s,\x20%s',_0x56d4db,_0xc35f('0xf'));_0xe2cee9(_0x4ddc48['result'][_0xc35f('0x14')]);}})[_0xc35f('0x16')](function(_0x4153be){logger[_0xc35f('0x11')]('MailServerIn,\x20%s,\x20%s',_0x56d4db,_0x4153be);_0x417cb9(_0x4153be);});});}exports['GetMailServerIn']=function(_0x452907){var _0x4148c3=this;return new Promise(function(_0x16e9d7,_0x48550b){return db['MailServerIn'][_0xc35f('0x17')]({'raw':_0x452907[_0xc35f('0x18')]?_0x452907[_0xc35f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x452907[_0xc35f('0x18')]?_0x452907[_0xc35f('0x18')][_0xc35f('0x19')]||null:null,'attributes':_0x452907[_0xc35f('0x18')]?_0x452907[_0xc35f('0x18')][_0xc35f('0x1a')]||null:null,'limit':_0x452907['options']?_0x452907[_0xc35f('0x18')]['limit']||null:null,'include':_0x452907['options']?_0x452907['options'][_0xc35f('0x1b')]?_[_0xc35f('0x1c')](_0x452907[_0xc35f('0x18')][_0xc35f('0x1b')],function(_0x25c634){return{'model':db[_0x25c634['model']],'as':_0x25c634['as'],'attributes':_0x25c634['attributes'],'include':_0x25c634[_0xc35f('0x1b')]?_[_0xc35f('0x1c')](_0x25c634[_0xc35f('0x1b')],function(_0x452fe5){return{'model':db[_0x452fe5['model']],'as':_0x452fe5['as'],'attributes':_0x452fe5['attributes'],'include':_0x452fe5[_0xc35f('0x1b')]?_[_0xc35f('0x1c')](_0x452fe5[_0xc35f('0x1b')],function(_0x327c73){return{'model':db[_0x327c73[_0xc35f('0x1d')]],'as':_0x327c73['as'],'attributes':_0x327c73[_0xc35f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc35f('0xe')](function(_0x2f16ef){logger['info']('GetMailServerIn',_0x452907);logger[_0xc35f('0x10')](_0xc35f('0x1e'),_0x452907,JSON[_0xc35f('0x1f')](_0x2f16ef));_0x16e9d7(_0x2f16ef);})[_0xc35f('0x16')](function(_0x467d31){logger['error']('GetMailServerIn',_0x467d31['message'],_0x452907);_0x48550b(_0x4148c3[_0xc35f('0x11')](0x1f4,_0x467d31['message']));});});}; \ No newline at end of file +var _0x5ed3=['then','info','MailServerIn,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','map','model','include','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x5ed3,0x9e));var _0x35ed=function(_0x37770a,_0x1e78b5){_0x37770a=_0x37770a-0x0;var _0x38424e=_0x5ed3[_0x37770a];return _0x38424e;};'use strict';var _=require(_0x35ed('0x0'));var util=require(_0x35ed('0x1'));var moment=require(_0x35ed('0x2'));var BPromise=require(_0x35ed('0x3'));var rs=require(_0x35ed('0x4'));var fs=require('fs');var Redis=require(_0x35ed('0x5'));var db=require(_0x35ed('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x35ed('0x7'))(_0x35ed('0x8'));var config=require(_0x35ed('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x35ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fce34,_0x2dcaa5,_0x4e95bf){return new BPromise(function(_0x314b27,_0x869cd3){return client[_0x35ed('0xb')](_0x1fce34,_0x4e95bf)[_0x35ed('0xc')](function(_0x146b6f){logger[_0x35ed('0xd')](_0x35ed('0xe'),_0x2dcaa5,'request\x20sent');logger[_0x35ed('0xf')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x2dcaa5,_0x35ed('0x10'),JSON[_0x35ed('0x11')](_0x146b6f));if(_0x146b6f['error']){if(_0x146b6f[_0x35ed('0x12')][_0x35ed('0x13')]===0x1f4){logger[_0x35ed('0x12')](_0x35ed('0xe'),_0x2dcaa5,_0x146b6f['error'][_0x35ed('0x14')]);return _0x869cd3(_0x146b6f[_0x35ed('0x12')]['message']);}logger[_0x35ed('0x12')](_0x35ed('0xe'),_0x2dcaa5,_0x146b6f[_0x35ed('0x12')]['message']);return _0x314b27(_0x146b6f[_0x35ed('0x12')][_0x35ed('0x14')]);}else{logger[_0x35ed('0xd')]('MailServerIn,\x20%s,\x20%s',_0x2dcaa5,_0x35ed('0x10'));_0x314b27(_0x146b6f[_0x35ed('0x15')]['message']);}})[_0x35ed('0x16')](function(_0x3ee110){logger[_0x35ed('0x12')]('MailServerIn,\x20%s,\x20%s',_0x2dcaa5,_0x3ee110);_0x869cd3(_0x3ee110);});});}exports[_0x35ed('0x17')]=function(_0x32859b){var _0x115a47=this;return new Promise(function(_0x2d8c07,_0x5036d5){return db[_0x35ed('0x18')][_0x35ed('0x19')]({'raw':_0x32859b[_0x35ed('0x1a')]?_0x32859b[_0x35ed('0x1a')][_0x35ed('0x1b')]===undefined?!![]:![]:!![],'where':_0x32859b[_0x35ed('0x1a')]?_0x32859b[_0x35ed('0x1a')][_0x35ed('0x1c')]||null:null,'attributes':_0x32859b['options']?_0x32859b[_0x35ed('0x1a')][_0x35ed('0x1d')]||null:null,'limit':_0x32859b[_0x35ed('0x1a')]?_0x32859b[_0x35ed('0x1a')][_0x35ed('0x1e')]||null:null,'include':_0x32859b[_0x35ed('0x1a')]?_0x32859b[_0x35ed('0x1a')]['include']?_[_0x35ed('0x1f')](_0x32859b[_0x35ed('0x1a')]['include'],function(_0x61c667){return{'model':db[_0x61c667[_0x35ed('0x20')]],'as':_0x61c667['as'],'attributes':_0x61c667['attributes'],'include':_0x61c667[_0x35ed('0x21')]?_[_0x35ed('0x1f')](_0x61c667[_0x35ed('0x21')],function(_0x2852b8){return{'model':db[_0x2852b8[_0x35ed('0x20')]],'as':_0x2852b8['as'],'attributes':_0x2852b8['attributes'],'include':_0x2852b8[_0x35ed('0x21')]?_['map'](_0x2852b8[_0x35ed('0x21')],function(_0x287ce7){return{'model':db[_0x287ce7['model']],'as':_0x287ce7['as'],'attributes':_0x287ce7[_0x35ed('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x366614){logger[_0x35ed('0xd')]('GetMailServerIn',_0x32859b);logger[_0x35ed('0xf')](_0x35ed('0x17'),_0x32859b,JSON[_0x35ed('0x11')](_0x366614));_0x2d8c07(_0x366614);})[_0x35ed('0x16')](function(_0x18a042){logger[_0x35ed('0x12')](_0x35ed('0x17'),_0x18a042['message'],_0x32859b);_0x5036d5(_0x115a47['error'](0x1f4,_0x18a042[_0x35ed('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 008f364..40da2d2 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(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x7a54,0x106));var _0x47a5=function(_0x3b2045,_0x3d27ed){_0x3b2045=_0x3b2045-0x0;var _0x21fc05=_0x7a54[_0x3b2045];return _0x21fc05;};'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 _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 98b814a..33ad79b 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 _0x0b00=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x0b00,0x1d5));var _0x00b0=function(_0x1b2048,_0x516ef7){_0x1b2048=_0x1b2048-0x0;var _0x33c515=_0x0b00[_0x1b2048];return _0x33c515;};'use strict';var Sequelize=require(_0x00b0('0x0'));module[_0x00b0('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x00b0('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x00b0('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x00b0('0x2')]},'authentication':{'type':Sequelize[_0x00b0('0x4')],'defaultValue':!![]}}; \ No newline at end of file +var _0xe0bf=['STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x2f4cc9,_0x2f96e3){var _0x42fdb4=function(_0x370cd9){while(--_0x370cd9){_0x2f4cc9['push'](_0x2f4cc9['shift']());}};_0x42fdb4(++_0x2f96e3);}(_0xe0bf,0x123));var _0xfe0b=function(_0x1f64f9,_0x5e6313){_0x1f64f9=_0x1f64f9-0x0;var _0x5b61af=_0xe0bf[_0x1f64f9];return _0x5b61af;};'use strict';var Sequelize=require(_0xfe0b('0x0'));module['exports']={'description':{'type':Sequelize[_0xfe0b('0x1')]},'host':{'type':Sequelize[_0xfe0b('0x1')]},'user':{'type':Sequelize[_0xfe0b('0x1')]},'pass':{'type':Sequelize[_0xfe0b('0x1')]},'port':{'type':Sequelize[_0xfe0b('0x2')]},'secure':{'type':Sequelize[_0xfe0b('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xfe0b('0x1')]},'authentication':{'type':Sequelize[_0xfe0b('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 df63695..f3b0647 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 _0xe233=['mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','name','send','map','MailServerOut','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','catch','params','length','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird'];(function(_0x1e6ca5,_0x640283){var _0x542dca=function(_0x25f9e9){while(--_0x25f9e9){_0x1e6ca5['push'](_0x1e6ca5['shift']());}};_0x542dca(++_0x640283);}(_0xe233,0x163));var _0x3e23=function(_0x5b5c39,_0x35af0f){_0x5b5c39=_0x5b5c39-0x0;var _0x22a196=_0xe233[_0x5b5c39];return _0x22a196;};'use strict';var emlformat=require(_0x3e23('0x0'));var rimraf=require(_0x3e23('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e23('0x2'));var rp=require(_0x3e23('0x3'));var moment=require('moment');var BPromise=require(_0x3e23('0x4'));var Mustache=require(_0x3e23('0x5'));var util=require(_0x3e23('0x6'));var path=require(_0x3e23('0x7'));var sox=require(_0x3e23('0x8'));var csv=require(_0x3e23('0x9'));var ejs=require(_0x3e23('0xa'));var fs=require('fs');var fs_extra=require(_0x3e23('0xb'));var _=require('lodash');var squel=require(_0x3e23('0xc'));var crypto=require(_0x3e23('0xd'));var jsforce=require(_0x3e23('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3e23('0x9'));var querystring=require(_0x3e23('0xf'));var Papa=require(_0x3e23('0x10'));var Redis=require(_0x3e23('0x11'));var authService=require(_0x3e23('0x12'));var qs=require(_0x3e23('0x13'));var as=require(_0x3e23('0x14'));var hardwareService=require(_0x3e23('0x15'));var logger=require(_0x3e23('0x16'))(_0x3e23('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3e23('0x18'));var db=require(_0x3e23('0x19'))['db'];function respondWithStatusCode(_0x45a365,_0x193e97){_0x193e97=_0x193e97||0xcc;return function(_0x3bb7fe){if(_0x3bb7fe){return _0x45a365[_0x3e23('0x1a')](_0x193e97);}return _0x45a365[_0x3e23('0x1b')](_0x193e97)[_0x3e23('0x1c')]();};}function respondWithResult(_0x57284d,_0x32326e){_0x32326e=_0x32326e||0xc8;return function(_0x1b2c8e){if(_0x1b2c8e){return _0x57284d[_0x3e23('0x1b')](_0x32326e)[_0x3e23('0x1d')](_0x1b2c8e);}};}function respondWithFilteredResult(_0x5a94e4,_0x28a7d7){return function(_0x2fd70f){if(_0x2fd70f){var _0x579cc3=typeof _0x28a7d7[_0x3e23('0x1e')]===_0x3e23('0x1f')&&typeof _0x28a7d7[_0x3e23('0x20')]===_0x3e23('0x1f');var _0x36fe4f=_0x2fd70f[_0x3e23('0x21')];var _0x28f0cb=_0x579cc3?0x0:_0x28a7d7['offset'];var _0x58e23a=_0x579cc3?_0x2fd70f[_0x3e23('0x21')]:_0x28a7d7['offset']+_0x28a7d7[_0x3e23('0x20')];var _0x141558;if(_0x58e23a>=_0x36fe4f){_0x58e23a=_0x36fe4f;_0x141558=0xc8;}else{_0x141558=0xce;}_0x5a94e4[_0x3e23('0x1b')](_0x141558);return _0x5a94e4[_0x3e23('0x22')](_0x3e23('0x23'),_0x28f0cb+'-'+_0x58e23a+'/'+_0x36fe4f)[_0x3e23('0x1d')](_0x2fd70f);}return null;};}function patchUpdates(_0x280747){return function(_0x502312){try{jsonpatch['apply'](_0x502312,_0x280747,!![]);}catch(_0x2b8c03){return BPromise[_0x3e23('0x24')](_0x2b8c03);}return _0x502312[_0x3e23('0x25')]();};}function saveUpdates(_0xf213d4,_0x531c79){return function(_0x2f5c57){if(_0x2f5c57){return _0x2f5c57[_0x3e23('0x26')](_0xf213d4)[_0x3e23('0x27')](function(_0x509456){return _0x509456;});}return null;};}function removeEntity(_0x31624e,_0x4495c3){return function(_0x372836){if(_0x372836){return _0x372836[_0x3e23('0x28')]()[_0x3e23('0x27')](function(){_0x31624e['status'](0xcc)[_0x3e23('0x1c')]();});}};}function handleEntityNotFound(_0x3a51f3,_0x490b0c){return function(_0x15d23c){if(!_0x15d23c){_0x3a51f3[_0x3e23('0x1a')](0x194);}return _0x15d23c;};}function handleError(_0x465c92,_0x3ae6a4){_0x3ae6a4=_0x3ae6a4||0x1f4;return function(_0x536e48){logger['error'](_0x536e48['stack']);if(_0x536e48[_0x3e23('0x29')]){delete _0x536e48['name'];}_0x465c92[_0x3e23('0x1b')](_0x3ae6a4)[_0x3e23('0x2a')](_0x536e48);};}exports['index']=function(_0x15d785,_0x5336c8){var _0x42d20b={},_0x11ebe3={},_0x56bfaa={'count':0x0,'rows':[]};var _0x265761=_[_0x3e23('0x2b')](db[_0x3e23('0x2c')][_0x3e23('0x2d')],function(_0x5251ca){return{'name':_0x5251ca[_0x3e23('0x2e')],'type':_0x5251ca[_0x3e23('0x2f')][_0x3e23('0x30')]};});_0x11ebe3[_0x3e23('0x31')]=_['map'](_0x265761,_0x3e23('0x29'));_0x11ebe3['query']=_[_0x3e23('0x32')](_0x15d785[_0x3e23('0x33')]);_0x11ebe3[_0x3e23('0x34')]=_[_0x3e23('0x35')](_0x11ebe3['model'],_0x11ebe3[_0x3e23('0x33')]);_0x42d20b[_0x3e23('0x36')]=_[_0x3e23('0x35')](_0x11ebe3[_0x3e23('0x31')],qs['fields'](_0x15d785['query'][_0x3e23('0x37')]));_0x42d20b['attributes']=_0x42d20b[_0x3e23('0x36')]['length']?_0x42d20b['attributes']:_0x11ebe3[_0x3e23('0x31')];if(!_0x15d785['query'][_0x3e23('0x38')](_0x3e23('0x39'))){_0x42d20b['limit']=qs[_0x3e23('0x20')](_0x15d785[_0x3e23('0x33')][_0x3e23('0x20')]);_0x42d20b[_0x3e23('0x1e')]=qs['offset'](_0x15d785[_0x3e23('0x33')][_0x3e23('0x1e')]);}_0x42d20b['order']=qs[_0x3e23('0x3a')](_0x15d785[_0x3e23('0x33')][_0x3e23('0x3a')]);_0x42d20b[_0x3e23('0x3b')]=qs[_0x3e23('0x34')](_['pick'](_0x15d785['query'],_0x11ebe3[_0x3e23('0x34')]),_0x265761);if(_0x15d785[_0x3e23('0x33')][_0x3e23('0x3c')]){_0x42d20b[_0x3e23('0x3b')]=_[_0x3e23('0x3d')](_0x42d20b[_0x3e23('0x3b')],{'$or':_[_0x3e23('0x2b')](_0x265761,function(_0x1684ff){if(_0x1684ff['type']!==_0x3e23('0x3e')){var _0x47fd55={};_0x47fd55[_0x1684ff[_0x3e23('0x29')]]={'$like':'%'+_0x15d785[_0x3e23('0x33')][_0x3e23('0x3c')]+'%'};return _0x47fd55;}})});}_0x42d20b=_['merge']({},_0x42d20b,_0x15d785[_0x3e23('0x3f')]);var _0x16ccea={'where':_0x42d20b['where']};return db['MailServerOut'][_0x3e23('0x21')](_0x16ccea)[_0x3e23('0x27')](function(_0x775383){_0x56bfaa[_0x3e23('0x21')]=_0x775383;if(_0x15d785[_0x3e23('0x33')][_0x3e23('0x40')]){_0x42d20b[_0x3e23('0x41')]=[{'all':!![]}];}return db[_0x3e23('0x2c')]['findAll'](_0x42d20b);})[_0x3e23('0x27')](function(_0x5505e1){_0x56bfaa['rows']=_0x5505e1;return _0x56bfaa;})[_0x3e23('0x27')](respondWithFilteredResult(_0x5336c8,_0x42d20b))[_0x3e23('0x42')](handleError(_0x5336c8,null));};exports['show']=function(_0x13233a,_0x35982b){var _0x24246b={'raw':!![],'where':{'id':_0x13233a[_0x3e23('0x43')]['id']}},_0x48e56a={};_0x48e56a[_0x3e23('0x31')]=_[_0x3e23('0x32')](db[_0x3e23('0x2c')][_0x3e23('0x2d')]);_0x48e56a[_0x3e23('0x33')]=_[_0x3e23('0x32')](_0x13233a[_0x3e23('0x33')]);_0x48e56a[_0x3e23('0x34')]=_['intersection'](_0x48e56a[_0x3e23('0x31')],_0x48e56a['query']);_0x24246b['attributes']=_[_0x3e23('0x35')](_0x48e56a[_0x3e23('0x31')],qs[_0x3e23('0x37')](_0x13233a[_0x3e23('0x33')][_0x3e23('0x37')]));_0x24246b[_0x3e23('0x36')]=_0x24246b[_0x3e23('0x36')][_0x3e23('0x44')]?_0x24246b[_0x3e23('0x36')]:_0x48e56a[_0x3e23('0x31')];if(_0x13233a[_0x3e23('0x33')]['includeAll']){_0x24246b[_0x3e23('0x41')]=[{'all':!![]}];}_0x24246b=_[_0x3e23('0x3d')]({},_0x24246b,_0x13233a['options']);return db['MailServerOut'][_0x3e23('0x45')](_0x24246b)[_0x3e23('0x27')](handleEntityNotFound(_0x35982b,null))[_0x3e23('0x27')](respondWithResult(_0x35982b,null))[_0x3e23('0x42')](handleError(_0x35982b,null));};exports[_0x3e23('0x46')]=function(_0x1a1faf,_0x3ae67e){return db[_0x3e23('0x2c')][_0x3e23('0x46')](_0x1a1faf[_0x3e23('0x47')],{})['then'](respondWithResult(_0x3ae67e,0xc9))[_0x3e23('0x42')](handleError(_0x3ae67e,null));};exports[_0x3e23('0x26')]=function(_0x1f0b4e,_0x1139e0){if(_0x1f0b4e['body']['id']){delete _0x1f0b4e['body']['id'];}return db[_0x3e23('0x2c')][_0x3e23('0x45')]({'where':{'id':_0x1f0b4e[_0x3e23('0x43')]['id']}})['then'](handleEntityNotFound(_0x1139e0,null))['then'](saveUpdates(_0x1f0b4e[_0x3e23('0x47')],null))['then'](respondWithResult(_0x1139e0,null))[_0x3e23('0x42')](handleError(_0x1139e0,null));};exports[_0x3e23('0x28')]=function(_0x14e571,_0x4c52fa){return db[_0x3e23('0x2c')][_0x3e23('0x45')]({'where':{'id':_0x14e571[_0x3e23('0x43')]['id']}})['then'](handleEntityNotFound(_0x4c52fa,null))['then'](removeEntity(_0x4c52fa,null))[_0x3e23('0x42')](handleError(_0x4c52fa,null));}; \ No newline at end of file +var _0xec35=['map','MailServerOut','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show','includeAll','include','find','create','body','update','destroy','params','rimraf','fast-json-patch','request-promise','moment','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','save','then','error','stack','name','send','index'];(function(_0x583976,_0x3b2a75){var _0x512d84=function(_0x3a5aa6){while(--_0x3a5aa6){_0x583976['push'](_0x583976['shift']());}};_0x512d84(++_0x3b2a75);}(_0xec35,0x1bf));var _0x5ec3=function(_0x5d65a7,_0x55dde5){_0x5d65a7=_0x5d65a7-0x0;var _0x7bcce3=_0xec35[_0x5d65a7];return _0x7bcce3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5ec3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5ec3('0x1'));var rp=require(_0x5ec3('0x2'));var moment=require(_0x5ec3('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x5ec3('0x4'));var sox=require(_0x5ec3('0x5'));var csv=require(_0x5ec3('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5ec3('0x7'));var crypto=require(_0x5ec3('0x8'));var jsforce=require(_0x5ec3('0x9'));var deskjs=require(_0x5ec3('0xa'));var toCsv=require(_0x5ec3('0x6'));var querystring=require(_0x5ec3('0xb'));var Papa=require('papaparse');var Redis=require(_0x5ec3('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x5ec3('0xd'));var as=require(_0x5ec3('0xe'));var hardwareService=require(_0x5ec3('0xf'));var logger=require(_0x5ec3('0x10'))('api');var utils=require(_0x5ec3('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x5ec3('0x12'));var db=require(_0x5ec3('0x13'))['db'];function respondWithStatusCode(_0x3127b8,_0x5e28b9){_0x5e28b9=_0x5e28b9||0xcc;return function(_0x6b2aa){if(_0x6b2aa){return _0x3127b8[_0x5ec3('0x14')](_0x5e28b9);}return _0x3127b8['status'](_0x5e28b9)[_0x5ec3('0x15')]();};}function respondWithResult(_0x87eb51,_0x55b07d){_0x55b07d=_0x55b07d||0xc8;return function(_0x598543){if(_0x598543){return _0x87eb51[_0x5ec3('0x16')](_0x55b07d)['json'](_0x598543);}};}function respondWithFilteredResult(_0x49a224,_0x55495d){return function(_0x428406){if(_0x428406){var _0x1e8cb2=typeof _0x55495d[_0x5ec3('0x17')]===_0x5ec3('0x18')&&typeof _0x55495d[_0x5ec3('0x19')]===_0x5ec3('0x18');var _0x324384=_0x428406['count'];var _0x5af96f=_0x1e8cb2?0x0:_0x55495d[_0x5ec3('0x17')];var _0x573316=_0x1e8cb2?_0x428406[_0x5ec3('0x1a')]:_0x55495d[_0x5ec3('0x17')]+_0x55495d[_0x5ec3('0x19')];var _0x406a0b;if(_0x573316>=_0x324384){_0x573316=_0x324384;_0x406a0b=0xc8;}else{_0x406a0b=0xce;}_0x49a224[_0x5ec3('0x16')](_0x406a0b);return _0x49a224[_0x5ec3('0x1b')](_0x5ec3('0x1c'),_0x5af96f+'-'+_0x573316+'/'+_0x324384)['json'](_0x428406);}return null;};}function patchUpdates(_0x1e69ce){return function(_0x27f702){try{jsonpatch['apply'](_0x27f702,_0x1e69ce,!![]);}catch(_0x3bcc93){return BPromise['reject'](_0x3bcc93);}return _0x27f702[_0x5ec3('0x1d')]();};}function saveUpdates(_0x233682,_0x20b4fa){return function(_0x34aba3){if(_0x34aba3){return _0x34aba3['update'](_0x233682)[_0x5ec3('0x1e')](function(_0x438798){return _0x438798;});}return null;};}function removeEntity(_0x4802ec,_0xe62525){return function(_0x29d86a){if(_0x29d86a){return _0x29d86a['destroy']()[_0x5ec3('0x1e')](function(){_0x4802ec[_0x5ec3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2126ad,_0x55d0e1){return function(_0x4967d3){if(!_0x4967d3){_0x2126ad['sendStatus'](0x194);}return _0x4967d3;};}function handleError(_0x3118f6,_0x231e42){_0x231e42=_0x231e42||0x1f4;return function(_0x30a98e){logger[_0x5ec3('0x1f')](_0x30a98e[_0x5ec3('0x20')]);if(_0x30a98e[_0x5ec3('0x21')]){delete _0x30a98e[_0x5ec3('0x21')];}_0x3118f6['status'](_0x231e42)[_0x5ec3('0x22')](_0x30a98e);};}exports[_0x5ec3('0x23')]=function(_0x208bfc,_0x1803ca){var _0xa92563={},_0x880269={},_0x54ae8e={'count':0x0,'rows':[]};var _0x5d0321=_[_0x5ec3('0x24')](db[_0x5ec3('0x25')][_0x5ec3('0x26')],function(_0x4b7787){return{'name':_0x4b7787[_0x5ec3('0x27')],'type':_0x4b7787['type']['key']};});_0x880269[_0x5ec3('0x28')]=_[_0x5ec3('0x24')](_0x5d0321,_0x5ec3('0x21'));_0x880269[_0x5ec3('0x29')]=_[_0x5ec3('0x2a')](_0x208bfc['query']);_0x880269[_0x5ec3('0x2b')]=_['intersection'](_0x880269[_0x5ec3('0x28')],_0x880269[_0x5ec3('0x29')]);_0xa92563['attributes']=_[_0x5ec3('0x2c')](_0x880269[_0x5ec3('0x28')],qs[_0x5ec3('0x2d')](_0x208bfc['query']['fields']));_0xa92563[_0x5ec3('0x2e')]=_0xa92563[_0x5ec3('0x2e')][_0x5ec3('0x2f')]?_0xa92563[_0x5ec3('0x2e')]:_0x880269['model'];if(!_0x208bfc['query'][_0x5ec3('0x30')](_0x5ec3('0x31'))){_0xa92563[_0x5ec3('0x19')]=qs[_0x5ec3('0x19')](_0x208bfc['query'][_0x5ec3('0x19')]);_0xa92563[_0x5ec3('0x17')]=qs['offset'](_0x208bfc[_0x5ec3('0x29')]['offset']);}_0xa92563['order']=qs[_0x5ec3('0x32')](_0x208bfc['query'][_0x5ec3('0x32')]);_0xa92563[_0x5ec3('0x33')]=qs['filters'](_['pick'](_0x208bfc['query'],_0x880269['filters']),_0x5d0321);if(_0x208bfc[_0x5ec3('0x29')][_0x5ec3('0x34')]){_0xa92563[_0x5ec3('0x33')]=_[_0x5ec3('0x35')](_0xa92563[_0x5ec3('0x33')],{'$or':_[_0x5ec3('0x24')](_0x5d0321,function(_0xd12f5b){if(_0xd12f5b[_0x5ec3('0x36')]!==_0x5ec3('0x37')){var _0x8a1f4={};_0x8a1f4[_0xd12f5b[_0x5ec3('0x21')]]={'$like':'%'+_0x208bfc[_0x5ec3('0x29')][_0x5ec3('0x34')]+'%'};return _0x8a1f4;}})});}_0xa92563=_[_0x5ec3('0x35')]({},_0xa92563,_0x208bfc[_0x5ec3('0x38')]);var _0xa40a73={'where':_0xa92563[_0x5ec3('0x33')]};return db['MailServerOut'][_0x5ec3('0x1a')](_0xa40a73)[_0x5ec3('0x1e')](function(_0x465504){_0x54ae8e[_0x5ec3('0x1a')]=_0x465504;if(_0x208bfc[_0x5ec3('0x29')]['includeAll']){_0xa92563['include']=[{'all':!![]}];}return db['MailServerOut'][_0x5ec3('0x39')](_0xa92563);})[_0x5ec3('0x1e')](function(_0x15acb6){_0x54ae8e[_0x5ec3('0x3a')]=_0x15acb6;return _0x54ae8e;})[_0x5ec3('0x1e')](respondWithFilteredResult(_0x1803ca,_0xa92563))[_0x5ec3('0x3b')](handleError(_0x1803ca,null));};exports[_0x5ec3('0x3c')]=function(_0x2b16a3,_0x280317){var _0x3f0104={'raw':!![],'where':{'id':_0x2b16a3['params']['id']}},_0x19a491={};_0x19a491[_0x5ec3('0x28')]=_[_0x5ec3('0x2a')](db[_0x5ec3('0x25')][_0x5ec3('0x26')]);_0x19a491[_0x5ec3('0x29')]=_[_0x5ec3('0x2a')](_0x2b16a3['query']);_0x19a491[_0x5ec3('0x2b')]=_[_0x5ec3('0x2c')](_0x19a491[_0x5ec3('0x28')],_0x19a491[_0x5ec3('0x29')]);_0x3f0104[_0x5ec3('0x2e')]=_[_0x5ec3('0x2c')](_0x19a491[_0x5ec3('0x28')],qs[_0x5ec3('0x2d')](_0x2b16a3[_0x5ec3('0x29')]['fields']));_0x3f0104[_0x5ec3('0x2e')]=_0x3f0104[_0x5ec3('0x2e')][_0x5ec3('0x2f')]?_0x3f0104[_0x5ec3('0x2e')]:_0x19a491[_0x5ec3('0x28')];if(_0x2b16a3[_0x5ec3('0x29')][_0x5ec3('0x3d')]){_0x3f0104[_0x5ec3('0x3e')]=[{'all':!![]}];}_0x3f0104=_[_0x5ec3('0x35')]({},_0x3f0104,_0x2b16a3[_0x5ec3('0x38')]);return db[_0x5ec3('0x25')][_0x5ec3('0x3f')](_0x3f0104)['then'](handleEntityNotFound(_0x280317,null))['then'](respondWithResult(_0x280317,null))[_0x5ec3('0x3b')](handleError(_0x280317,null));};exports[_0x5ec3('0x40')]=function(_0x2f3322,_0xda1b58){return db[_0x5ec3('0x25')][_0x5ec3('0x40')](_0x2f3322[_0x5ec3('0x41')],{})['then'](respondWithResult(_0xda1b58,0xc9))[_0x5ec3('0x3b')](handleError(_0xda1b58,null));};exports[_0x5ec3('0x42')]=function(_0x5a0e21,_0x39ceaf){if(_0x5a0e21[_0x5ec3('0x41')]['id']){delete _0x5a0e21[_0x5ec3('0x41')]['id'];}return db[_0x5ec3('0x25')][_0x5ec3('0x3f')]({'where':{'id':_0x5a0e21['params']['id']}})[_0x5ec3('0x1e')](handleEntityNotFound(_0x39ceaf,null))[_0x5ec3('0x1e')](saveUpdates(_0x5a0e21[_0x5ec3('0x41')],null))[_0x5ec3('0x1e')](respondWithResult(_0x39ceaf,null))[_0x5ec3('0x3b')](handleError(_0x39ceaf,null));};exports[_0x5ec3('0x43')]=function(_0x562d41,_0x1c4376){return db[_0x5ec3('0x25')][_0x5ec3('0x3f')]({'where':{'id':_0x562d41[_0x5ec3('0x44')]['id']}})[_0x5ec3('0x1e')](handleEntityNotFound(_0x1c4376,null))['then'](removeEntity(_0x1c4376,null))['catch'](handleError(_0x1c4376,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 873c5bc..1419415 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 _0x4e2d=['../../config/environment','./mailServerOut.attributes','define','MailServerOut','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2998db,_0x3424f1){var _0x115fea=function(_0x3b493c){while(--_0x3b493c){_0x2998db['push'](_0x2998db['shift']());}};_0x115fea(++_0x3424f1);}(_0x4e2d,0x190));var _0xd4e2=function(_0x5e9330,_0x3a9fe0){_0x5e9330=_0x5e9330-0x0;var _0x3ca99d=_0x4e2d[_0x5e9330];return _0x3ca99d;};'use strict';var _=require(_0xd4e2('0x0'));var util=require(_0xd4e2('0x1'));var logger=require(_0xd4e2('0x2'))(_0xd4e2('0x3'));var moment=require(_0xd4e2('0x4'));var BPromise=require(_0xd4e2('0x5'));var rp=require(_0xd4e2('0x6'));var fs=require('fs');var path=require(_0xd4e2('0x7'));var rimraf=require('rimraf');var config=require(_0xd4e2('0x8'));var attributes=require(_0xd4e2('0x9'));module['exports']=function(_0x56b458,_0x5445d3){return _0x56b458[_0xd4e2('0xa')](_0xd4e2('0xb'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x43ae=['MailServerOut','mail_servers_out','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x43ae,0x160));var _0xe43a=function(_0x5d841c,_0x4091af){_0x5d841c=_0x5d841c-0x0;var _0x5b7d21=_0x43ae[_0x5d841c];return _0x5b7d21;};'use strict';var _=require(_0xe43a('0x0'));var util=require('util');var logger=require(_0xe43a('0x1'))(_0xe43a('0x2'));var moment=require(_0xe43a('0x3'));var BPromise=require(_0xe43a('0x4'));var rp=require(_0xe43a('0x5'));var fs=require('fs');var path=require(_0xe43a('0x6'));var rimraf=require(_0xe43a('0x7'));var config=require(_0xe43a('0x8'));var attributes=require(_0xe43a('0x9'));module[_0xe43a('0xa')]=function(_0x27ce99,_0x1078b8){return _0x27ce99[_0xe43a('0xb')](_0xe43a('0xc'),attributes,{'tableName':_0xe43a('0xd'),'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 81529c0..dfaea1b 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0xe2a247,_0x109308){var _0xd1ce59=function(_0x4f16e6){while(--_0x4f16e6){_0xe2a247['push'](_0xe2a247['shift']());}};_0xd1ce59(++_0x109308);}(_0x2ef3,0xba));var _0x32ef=function(_0x19c30b,_0xef1cd){_0x19c30b=_0x19c30b-0x0;var _0x2a1eb3=_0x2ef3[_0x19c30b];return _0x2a1eb3;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x26d0bd,_0x157094){var _0x262d34=function(_0x5bd52d){while(--_0x5bd52d){_0x26d0bd['push'](_0x26d0bd['shift']());}};_0x262d34(++_0x157094);}(_0xdb28,0x106));var _0x8db2=function(_0x312503,_0x37d4cf){_0x312503=_0x312503-0x0;var _0x52fa14=_0xdb28[_0x312503];return _0x52fa14;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index c4a9168..48603ee 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 _0x4bb7=['show','post','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','get','/describe','/:id'];(function(_0x2bc0b4,_0x189455){var _0x3446d4=function(_0x11ca2b){while(--_0x11ca2b){_0x2bc0b4['push'](_0x2bc0b4['shift']());}};_0x3446d4(++_0x189455);}(_0x4bb7,0xba));var _0x74bb=function(_0x28a1fc,_0x272b62){_0x28a1fc=_0x28a1fc-0x0;var _0x28c277=_0x4bb7[_0x28a1fc];return _0x28c277;};'use strict';var multer=require(_0x74bb('0x0'));var util=require(_0x74bb('0x1'));var path=require(_0x74bb('0x2'));var timeout=require('connect-timeout');var express=require(_0x74bb('0x3'));var router=express[_0x74bb('0x4')]();var fs_extra=require(_0x74bb('0x5'));var auth=require(_0x74bb('0x6'));var interaction=require(_0x74bb('0x7'));var config=require(_0x74bb('0x8'));var controller=require(_0x74bb('0x9'));router['get']('/',auth[_0x74bb('0xa')](),controller['index']);router[_0x74bb('0xb')](_0x74bb('0xc'),auth[_0x74bb('0xa')](),controller['describe']);router[_0x74bb('0xb')](_0x74bb('0xd'),auth[_0x74bb('0xa')](),controller[_0x74bb('0xe')]);router[_0x74bb('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x74bb('0x10')](_0x74bb('0xd'),auth['isAuthenticated'](),controller[_0x74bb('0x11')]);router[_0x74bb('0x12')]('/:id',auth[_0x74bb('0xa')](),controller['destroy']);module[_0x74bb('0x13')]=router; \ No newline at end of file +var _0x24f3=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x4d18c2,_0x9b85d0){var _0x1cadf9=function(_0xbb421c){while(--_0xbb421c){_0x4d18c2['push'](_0x4d18c2['shift']());}};_0x1cadf9(++_0x9b85d0);}(_0x24f3,0x1df));var _0x324f=function(_0xf82c9b,_0x41af95){_0xf82c9b=_0xf82c9b-0x0;var _0x29019d=_0x24f3[_0xf82c9b];return _0x29019d;};'use strict';var multer=require(_0x324f('0x0'));var util=require(_0x324f('0x1'));var path=require(_0x324f('0x2'));var timeout=require('connect-timeout');var express=require(_0x324f('0x3'));var router=express[_0x324f('0x4')]();var fs_extra=require(_0x324f('0x5'));var auth=require(_0x324f('0x6'));var interaction=require(_0x324f('0x7'));var config=require(_0x324f('0x8'));var controller=require(_0x324f('0x9'));router[_0x324f('0xa')]('/',auth[_0x324f('0xb')](),controller[_0x324f('0xc')]);router[_0x324f('0xa')](_0x324f('0xd'),auth['isAuthenticated'](),controller[_0x324f('0xe')]);router[_0x324f('0xa')](_0x324f('0xf'),auth[_0x324f('0xb')](),controller[_0x324f('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x324f('0x11')]);router[_0x324f('0x12')]('/:id',auth[_0x324f('0xb')](),controller[_0x324f('0x13')]);router[_0x324f('0x14')](_0x324f('0xf'),auth[_0x324f('0xb')](),controller[_0x324f('0x15')]);module[_0x324f('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 5493977..a9dd987 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(_0x55218e,_0x2970e8){var _0x5e43b7=function(_0x28b9b2){while(--_0x28b9b2){_0x55218e['push'](_0x55218e['shift']());}};_0x5e43b7(++_0x2970e8);}(_0xbff5,0x1bc));var _0x5bff=function(_0x3a4825,_0x3fa957){_0x3a4825=_0x3a4825-0x0;var _0x37c875=_0xbff5[_0x3a4825];return _0x37c875;};'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 _0x15ef=['exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x15ef,0x80));var _0xf15e=function(_0x18fd54,_0x4e7612){_0x18fd54=_0x18fd54-0x0;var _0x3d5c8d=_0x15ef[_0x18fd54];return _0x3d5c8d;};'use strict';var Sequelize=require('sequelize');module[_0xf15e('0x0')]={'name':{'type':Sequelize[_0xf15e('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf15e('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 234dd6e..1f3a0c8 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 _0xbab3=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','find','create','body','destroy','describe'];(function(_0x5c92a4,_0x819c46){var _0x2007e7=function(_0x4235f6){while(--_0x4235f6){_0x5c92a4['push'](_0x5c92a4['shift']());}};_0x2007e7(++_0x819c46);}(_0xbab3,0x13c));var _0x3bab=function(_0x606704,_0x4a08f8){_0x606704=_0x606704-0x0;var _0x11a29d=_0xbab3[_0x606704];return _0x11a29d;};'use strict';var emlformat=require(_0x3bab('0x0'));var rimraf=require(_0x3bab('0x1'));var zipdir=require(_0x3bab('0x2'));var jsonpatch=require(_0x3bab('0x3'));var rp=require(_0x3bab('0x4'));var moment=require(_0x3bab('0x5'));var BPromise=require(_0x3bab('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3bab('0x7'));var sox=require(_0x3bab('0x8'));var csv=require(_0x3bab('0x9'));var ejs=require(_0x3bab('0xa'));var fs=require('fs');var fs_extra=require(_0x3bab('0xb'));var _=require(_0x3bab('0xc'));var squel=require(_0x3bab('0xd'));var crypto=require(_0x3bab('0xe'));var jsforce=require(_0x3bab('0xf'));var deskjs=require(_0x3bab('0x10'));var toCsv=require('to-csv');var querystring=require(_0x3bab('0x11'));var Papa=require(_0x3bab('0x12'));var Redis=require(_0x3bab('0x13'));var authService=require(_0x3bab('0x14'));var qs=require(_0x3bab('0x15'));var as=require(_0x3bab('0x16'));var hardwareService=require(_0x3bab('0x17'));var logger=require(_0x3bab('0x18'))('api');var utils=require(_0x3bab('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x3bab('0x1a'));var db=require(_0x3bab('0x1b'))['db'];function respondWithStatusCode(_0x1afb26,_0x2cfe2f){_0x2cfe2f=_0x2cfe2f||0xcc;return function(_0x423ff0){if(_0x423ff0){return _0x1afb26[_0x3bab('0x1c')](_0x2cfe2f);}return _0x1afb26[_0x3bab('0x1d')](_0x2cfe2f)[_0x3bab('0x1e')]();};}function respondWithResult(_0x20c3cc,_0x57f6d9){_0x57f6d9=_0x57f6d9||0xc8;return function(_0x506d21){if(_0x506d21){return _0x20c3cc[_0x3bab('0x1d')](_0x57f6d9)[_0x3bab('0x1f')](_0x506d21);}};}function respondWithFilteredResult(_0x4bb666,_0x248383){return function(_0x4f09bb){if(_0x4f09bb){var _0x2f3483=typeof _0x248383[_0x3bab('0x20')]==='undefined'&&typeof _0x248383['limit']==='undefined';var _0x8d7e99=_0x4f09bb[_0x3bab('0x21')];var _0x35e050=_0x2f3483?0x0:_0x248383[_0x3bab('0x20')];var _0x1e4ac3=_0x2f3483?_0x4f09bb['count']:_0x248383[_0x3bab('0x20')]+_0x248383[_0x3bab('0x22')];var _0x5bc474;if(_0x1e4ac3>=_0x8d7e99){_0x1e4ac3=_0x8d7e99;_0x5bc474=0xc8;}else{_0x5bc474=0xce;}_0x4bb666['status'](_0x5bc474);return _0x4bb666['set'](_0x3bab('0x23'),_0x35e050+'-'+_0x1e4ac3+'/'+_0x8d7e99)[_0x3bab('0x1f')](_0x4f09bb);}return null;};}function patchUpdates(_0x514788){return function(_0x58568a){try{jsonpatch[_0x3bab('0x24')](_0x58568a,_0x514788,!![]);}catch(_0x5398b0){return BPromise[_0x3bab('0x25')](_0x5398b0);}return _0x58568a['save']();};}function saveUpdates(_0x5c0091,_0x4dc3fc){return function(_0x3e29f8){if(_0x3e29f8){return _0x3e29f8[_0x3bab('0x26')](_0x5c0091)[_0x3bab('0x27')](function(_0x4480a8){return _0x4480a8;});}return null;};}function removeEntity(_0x3fe97b,_0x27243c){return function(_0x2ad241){if(_0x2ad241){return _0x2ad241['destroy']()[_0x3bab('0x27')](function(){_0x3fe97b['status'](0xcc)[_0x3bab('0x1e')]();});}};}function handleEntityNotFound(_0x290ca8,_0x13e1fc){return function(_0x25543a){if(!_0x25543a){_0x290ca8['sendStatus'](0x194);}return _0x25543a;};}function handleError(_0x497897,_0x3ed846){_0x3ed846=_0x3ed846||0x1f4;return function(_0x48479f){logger[_0x3bab('0x28')](_0x48479f[_0x3bab('0x29')]);if(_0x48479f[_0x3bab('0x2a')]){delete _0x48479f[_0x3bab('0x2a')];}_0x497897[_0x3bab('0x1d')](_0x3ed846)[_0x3bab('0x2b')](_0x48479f);};}exports[_0x3bab('0x2c')]=function(_0x552f3c,_0x1cbd14){var _0x294cea={},_0x533c97={},_0x5da820={'count':0x0,'rows':[]};var _0x5e69af=_[_0x3bab('0x2d')](db[_0x3bab('0x2e')][_0x3bab('0x2f')],function(_0x505593){return{'name':_0x505593[_0x3bab('0x30')],'type':_0x505593[_0x3bab('0x31')]['key']};});_0x533c97[_0x3bab('0x32')]=_[_0x3bab('0x2d')](_0x5e69af,_0x3bab('0x2a'));_0x533c97['query']=_[_0x3bab('0x33')](_0x552f3c[_0x3bab('0x34')]);_0x533c97[_0x3bab('0x35')]=_[_0x3bab('0x36')](_0x533c97['model'],_0x533c97[_0x3bab('0x34')]);_0x294cea['attributes']=_[_0x3bab('0x36')](_0x533c97[_0x3bab('0x32')],qs[_0x3bab('0x37')](_0x552f3c[_0x3bab('0x34')]['fields']));_0x294cea[_0x3bab('0x38')]=_0x294cea['attributes'][_0x3bab('0x39')]?_0x294cea['attributes']:_0x533c97[_0x3bab('0x32')];if(!_0x552f3c[_0x3bab('0x34')][_0x3bab('0x3a')](_0x3bab('0x3b'))){_0x294cea[_0x3bab('0x22')]=qs[_0x3bab('0x22')](_0x552f3c[_0x3bab('0x34')]['limit']);_0x294cea['offset']=qs[_0x3bab('0x20')](_0x552f3c[_0x3bab('0x34')]['offset']);}_0x294cea[_0x3bab('0x3c')]=qs[_0x3bab('0x3d')](_0x552f3c['query'][_0x3bab('0x3d')]);_0x294cea[_0x3bab('0x3e')]=qs[_0x3bab('0x35')](_[_0x3bab('0x3f')](_0x552f3c['query'],_0x533c97['filters']),_0x5e69af);if(_0x552f3c[_0x3bab('0x34')][_0x3bab('0x40')]){_0x294cea[_0x3bab('0x3e')]=_[_0x3bab('0x41')](_0x294cea[_0x3bab('0x3e')],{'$or':_['map'](_0x5e69af,function(_0x17a1ec){if(_0x17a1ec['type']!==_0x3bab('0x42')){var _0x27a399={};_0x27a399[_0x17a1ec[_0x3bab('0x2a')]]={'$like':'%'+_0x552f3c[_0x3bab('0x34')][_0x3bab('0x40')]+'%'};return _0x27a399;}})});}_0x294cea=_['merge']({},_0x294cea,_0x552f3c['options']);var _0x52a665={'where':_0x294cea[_0x3bab('0x3e')]};return db[_0x3bab('0x2e')][_0x3bab('0x21')](_0x52a665)['then'](function(_0x3a1f5b){_0x5da820['count']=_0x3a1f5b;if(_0x552f3c[_0x3bab('0x34')][_0x3bab('0x43')]){_0x294cea[_0x3bab('0x44')]=[{'all':!![]}];}return db[_0x3bab('0x2e')][_0x3bab('0x45')](_0x294cea);})[_0x3bab('0x27')](function(_0x3ae24f){_0x5da820[_0x3bab('0x46')]=_0x3ae24f;return _0x5da820;})[_0x3bab('0x27')](respondWithFilteredResult(_0x1cbd14,_0x294cea))[_0x3bab('0x47')](handleError(_0x1cbd14,null));};exports['show']=function(_0x17ac09,_0x95bd3a){var _0x4458e0={'raw':!![],'where':{'id':_0x17ac09[_0x3bab('0x48')]['id']}},_0x57f09e={};_0x57f09e[_0x3bab('0x32')]=_[_0x3bab('0x33')](db['MailSubstatus'][_0x3bab('0x2f')]);_0x57f09e[_0x3bab('0x34')]=_['keys'](_0x17ac09[_0x3bab('0x34')]);_0x57f09e['filters']=_['intersection'](_0x57f09e[_0x3bab('0x32')],_0x57f09e[_0x3bab('0x34')]);_0x4458e0[_0x3bab('0x38')]=_[_0x3bab('0x36')](_0x57f09e[_0x3bab('0x32')],qs['fields'](_0x17ac09['query']['fields']));_0x4458e0[_0x3bab('0x38')]=_0x4458e0[_0x3bab('0x38')][_0x3bab('0x39')]?_0x4458e0[_0x3bab('0x38')]:_0x57f09e[_0x3bab('0x32')];if(_0x17ac09[_0x3bab('0x34')][_0x3bab('0x43')]){_0x4458e0[_0x3bab('0x44')]=[{'all':!![]}];}_0x4458e0=_[_0x3bab('0x41')]({},_0x4458e0,_0x17ac09[_0x3bab('0x49')]);return db['MailSubstatus'][_0x3bab('0x4a')](_0x4458e0)[_0x3bab('0x27')](handleEntityNotFound(_0x95bd3a,null))['then'](respondWithResult(_0x95bd3a,null))[_0x3bab('0x47')](handleError(_0x95bd3a,null));};exports[_0x3bab('0x4b')]=function(_0x58386e,_0x1b53dd){return db[_0x3bab('0x2e')][_0x3bab('0x4b')](_0x58386e[_0x3bab('0x4c')],{})['then'](respondWithResult(_0x1b53dd,0xc9))[_0x3bab('0x47')](handleError(_0x1b53dd,null));};exports['update']=function(_0x29879d,_0x155f7f){if(_0x29879d['body']['id']){delete _0x29879d[_0x3bab('0x4c')]['id'];}return db[_0x3bab('0x2e')][_0x3bab('0x4a')]({'where':{'id':_0x29879d[_0x3bab('0x48')]['id']}})['then'](handleEntityNotFound(_0x155f7f,null))[_0x3bab('0x27')](saveUpdates(_0x29879d[_0x3bab('0x4c')],null))['then'](respondWithResult(_0x155f7f,null))['catch'](handleError(_0x155f7f,null));};exports[_0x3bab('0x4d')]=function(_0x23264f,_0x1a91ff){return db[_0x3bab('0x2e')]['find']({'where':{'id':_0x23264f['params']['id']}})[_0x3bab('0x27')](handleEntityNotFound(_0x1a91ff,null))[_0x3bab('0x27')](removeEntity(_0x1a91ff,null))[_0x3bab('0x47')](handleError(_0x1a91ff,null));};exports[_0x3bab('0x4e')]=function(_0x13075d,_0x1c7231){return db[_0x3bab('0x2e')]['describe']()['then'](respondWithResult(_0x1c7231,null))['catch'](handleError(_0x1c7231,null));}; \ No newline at end of file +var _0x3964=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','destroy','end','error','stack','name','send','index','map','MailSubstatus','rawAttributes','type','key','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','include','findAll','rows','show','params','length','includeAll','options','find','catch','create','body','describe','eml-format','rimraf','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x358913,_0x52ed94){var _0x41c913=function(_0x588f21){while(--_0x588f21){_0x358913['push'](_0x358913['shift']());}};_0x41c913(++_0x52ed94);}(_0x3964,0x11d));var _0x4396=function(_0x1c245f,_0x193a0f){_0x1c245f=_0x1c245f-0x0;var _0x5acade=_0x3964[_0x1c245f];return _0x5acade;};'use strict';var emlformat=require(_0x4396('0x0'));var rimraf=require(_0x4396('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4396('0x2'));var Mustache=require(_0x4396('0x3'));var util=require(_0x4396('0x4'));var path=require(_0x4396('0x5'));var sox=require('sox');var csv=require(_0x4396('0x6'));var ejs=require(_0x4396('0x7'));var fs=require('fs');var fs_extra=require(_0x4396('0x8'));var _=require(_0x4396('0x9'));var squel=require(_0x4396('0xa'));var crypto=require(_0x4396('0xb'));var jsforce=require(_0x4396('0xc'));var deskjs=require(_0x4396('0xd'));var toCsv=require(_0x4396('0x6'));var querystring=require(_0x4396('0xe'));var Papa=require(_0x4396('0xf'));var Redis=require(_0x4396('0x10'));var authService=require(_0x4396('0x11'));var qs=require(_0x4396('0x12'));var as=require(_0x4396('0x13'));var hardwareService=require(_0x4396('0x14'));var logger=require('../../config/logger')(_0x4396('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4396('0x16'));var db=require(_0x4396('0x17'))['db'];function respondWithStatusCode(_0x5ba5df,_0x42c100){_0x42c100=_0x42c100||0xcc;return function(_0x413a87){if(_0x413a87){return _0x5ba5df[_0x4396('0x18')](_0x42c100);}return _0x5ba5df['status'](_0x42c100)['end']();};}function respondWithResult(_0x2d859d,_0x403a47){_0x403a47=_0x403a47||0xc8;return function(_0x2d9e73){if(_0x2d9e73){return _0x2d859d[_0x4396('0x19')](_0x403a47)['json'](_0x2d9e73);}};}function respondWithFilteredResult(_0x4e1ac4,_0x50cfd5){return function(_0x169f27){if(_0x169f27){var _0x9a34ea=typeof _0x50cfd5[_0x4396('0x1a')]===_0x4396('0x1b')&&typeof _0x50cfd5[_0x4396('0x1c')]===_0x4396('0x1b');var _0x3bf2f1=_0x169f27['count'];var _0xfcbf1d=_0x9a34ea?0x0:_0x50cfd5[_0x4396('0x1a')];var _0x3cd60d=_0x9a34ea?_0x169f27[_0x4396('0x1d')]:_0x50cfd5[_0x4396('0x1a')]+_0x50cfd5[_0x4396('0x1c')];var _0x5ad7d8;if(_0x3cd60d>=_0x3bf2f1){_0x3cd60d=_0x3bf2f1;_0x5ad7d8=0xc8;}else{_0x5ad7d8=0xce;}_0x4e1ac4[_0x4396('0x19')](_0x5ad7d8);return _0x4e1ac4[_0x4396('0x1e')](_0x4396('0x1f'),_0xfcbf1d+'-'+_0x3cd60d+'/'+_0x3bf2f1)[_0x4396('0x20')](_0x169f27);}return null;};}function patchUpdates(_0x5dc6eb){return function(_0x1029bb){try{jsonpatch[_0x4396('0x21')](_0x1029bb,_0x5dc6eb,!![]);}catch(_0x4c4fb2){return BPromise[_0x4396('0x22')](_0x4c4fb2);}return _0x1029bb['save']();};}function saveUpdates(_0x2062c3,_0x2bb701){return function(_0x14fa14){if(_0x14fa14){return _0x14fa14['update'](_0x2062c3)[_0x4396('0x23')](function(_0x390887){return _0x390887;});}return null;};}function removeEntity(_0x20fbba,_0x3d8a33){return function(_0x6e775f){if(_0x6e775f){return _0x6e775f[_0x4396('0x24')]()[_0x4396('0x23')](function(){_0x20fbba[_0x4396('0x19')](0xcc)[_0x4396('0x25')]();});}};}function handleEntityNotFound(_0x282b87,_0x2d13b0){return function(_0x16fb0e){if(!_0x16fb0e){_0x282b87[_0x4396('0x18')](0x194);}return _0x16fb0e;};}function handleError(_0x3bb426,_0x5b1443){_0x5b1443=_0x5b1443||0x1f4;return function(_0xb40551){logger[_0x4396('0x26')](_0xb40551[_0x4396('0x27')]);if(_0xb40551[_0x4396('0x28')]){delete _0xb40551[_0x4396('0x28')];}_0x3bb426[_0x4396('0x19')](_0x5b1443)[_0x4396('0x29')](_0xb40551);};}exports[_0x4396('0x2a')]=function(_0x56b107,_0x566fce){var _0x56f3e6={},_0x3909e8={},_0x5e76b6={'count':0x0,'rows':[]};var _0xba9ef=_[_0x4396('0x2b')](db[_0x4396('0x2c')][_0x4396('0x2d')],function(_0x28cfa7){return{'name':_0x28cfa7['fieldName'],'type':_0x28cfa7[_0x4396('0x2e')][_0x4396('0x2f')]};});_0x3909e8['model']=_['map'](_0xba9ef,_0x4396('0x28'));_0x3909e8['query']=_[_0x4396('0x30')](_0x56b107[_0x4396('0x31')]);_0x3909e8[_0x4396('0x32')]=_[_0x4396('0x33')](_0x3909e8[_0x4396('0x34')],_0x3909e8[_0x4396('0x31')]);_0x56f3e6['attributes']=_[_0x4396('0x33')](_0x3909e8[_0x4396('0x34')],qs[_0x4396('0x35')](_0x56b107[_0x4396('0x31')][_0x4396('0x35')]));_0x56f3e6[_0x4396('0x36')]=_0x56f3e6[_0x4396('0x36')]['length']?_0x56f3e6['attributes']:_0x3909e8[_0x4396('0x34')];if(!_0x56b107['query'][_0x4396('0x37')]('nolimit')){_0x56f3e6['limit']=qs['limit'](_0x56b107[_0x4396('0x31')][_0x4396('0x1c')]);_0x56f3e6[_0x4396('0x1a')]=qs[_0x4396('0x1a')](_0x56b107[_0x4396('0x31')]['offset']);}_0x56f3e6[_0x4396('0x38')]=qs[_0x4396('0x39')](_0x56b107['query'][_0x4396('0x39')]);_0x56f3e6[_0x4396('0x3a')]=qs[_0x4396('0x32')](_[_0x4396('0x3b')](_0x56b107['query'],_0x3909e8[_0x4396('0x32')]),_0xba9ef);if(_0x56b107[_0x4396('0x31')]['filter']){_0x56f3e6[_0x4396('0x3a')]=_['merge'](_0x56f3e6[_0x4396('0x3a')],{'$or':_['map'](_0xba9ef,function(_0x1bef0c){if(_0x1bef0c['type']!==_0x4396('0x3c')){var _0x5d0c1f={};_0x5d0c1f[_0x1bef0c[_0x4396('0x28')]]={'$like':'%'+_0x56b107[_0x4396('0x31')][_0x4396('0x3d')]+'%'};return _0x5d0c1f;}})});}_0x56f3e6=_[_0x4396('0x3e')]({},_0x56f3e6,_0x56b107['options']);var _0x24dfce={'where':_0x56f3e6[_0x4396('0x3a')]};return db[_0x4396('0x2c')][_0x4396('0x1d')](_0x24dfce)[_0x4396('0x23')](function(_0x52de42){_0x5e76b6[_0x4396('0x1d')]=_0x52de42;if(_0x56b107['query']['includeAll']){_0x56f3e6[_0x4396('0x3f')]=[{'all':!![]}];}return db[_0x4396('0x2c')][_0x4396('0x40')](_0x56f3e6);})['then'](function(_0x58c2a5){_0x5e76b6[_0x4396('0x41')]=_0x58c2a5;return _0x5e76b6;})['then'](respondWithFilteredResult(_0x566fce,_0x56f3e6))['catch'](handleError(_0x566fce,null));};exports[_0x4396('0x42')]=function(_0x3451ea,_0x15ebd2){var _0x5e05b9={'raw':!![],'where':{'id':_0x3451ea[_0x4396('0x43')]['id']}},_0xf85e38={};_0xf85e38[_0x4396('0x34')]=_[_0x4396('0x30')](db[_0x4396('0x2c')][_0x4396('0x2d')]);_0xf85e38[_0x4396('0x31')]=_['keys'](_0x3451ea[_0x4396('0x31')]);_0xf85e38[_0x4396('0x32')]=_[_0x4396('0x33')](_0xf85e38['model'],_0xf85e38[_0x4396('0x31')]);_0x5e05b9[_0x4396('0x36')]=_[_0x4396('0x33')](_0xf85e38[_0x4396('0x34')],qs[_0x4396('0x35')](_0x3451ea[_0x4396('0x31')][_0x4396('0x35')]));_0x5e05b9['attributes']=_0x5e05b9[_0x4396('0x36')][_0x4396('0x44')]?_0x5e05b9[_0x4396('0x36')]:_0xf85e38[_0x4396('0x34')];if(_0x3451ea[_0x4396('0x31')][_0x4396('0x45')]){_0x5e05b9[_0x4396('0x3f')]=[{'all':!![]}];}_0x5e05b9=_['merge']({},_0x5e05b9,_0x3451ea[_0x4396('0x46')]);return db[_0x4396('0x2c')][_0x4396('0x47')](_0x5e05b9)[_0x4396('0x23')](handleEntityNotFound(_0x15ebd2,null))[_0x4396('0x23')](respondWithResult(_0x15ebd2,null))[_0x4396('0x48')](handleError(_0x15ebd2,null));};exports[_0x4396('0x49')]=function(_0x11c5fc,_0x536b8a){return db['MailSubstatus']['create'](_0x11c5fc[_0x4396('0x4a')],{})['then'](respondWithResult(_0x536b8a,0xc9))['catch'](handleError(_0x536b8a,null));};exports['update']=function(_0x599127,_0x22f433){if(_0x599127[_0x4396('0x4a')]['id']){delete _0x599127['body']['id'];}return db[_0x4396('0x2c')]['find']({'where':{'id':_0x599127['params']['id']}})[_0x4396('0x23')](handleEntityNotFound(_0x22f433,null))[_0x4396('0x23')](saveUpdates(_0x599127[_0x4396('0x4a')],null))['then'](respondWithResult(_0x22f433,null))[_0x4396('0x48')](handleError(_0x22f433,null));};exports['destroy']=function(_0x5e9dec,_0x3a5d1f){return db[_0x4396('0x2c')][_0x4396('0x47')]({'where':{'id':_0x5e9dec[_0x4396('0x43')]['id']}})['then'](handleEntityNotFound(_0x3a5d1f,null))['then'](removeEntity(_0x3a5d1f,null))[_0x4396('0x48')](handleError(_0x3a5d1f,null));};exports[_0x4396('0x4b')]=function(_0x27f856,_0x1c474e){return db[_0x4396('0x2c')]['describe']()[_0x4396('0x23')](respondWithResult(_0x1c474e,null))['catch'](handleError(_0x1c474e,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index c5cd111..32bb513 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 _0x5913=['hook','exports','events','MailSubstatus','setMaxListeners','emit','hasOwnProperty'];(function(_0x3b2f5a,_0x5aa5d9){var _0x153848=function(_0x1b6162){while(--_0x1b6162){_0x3b2f5a['push'](_0x3b2f5a['shift']());}};_0x153848(++_0x5aa5d9);}(_0x5913,0x16e));var _0x3591=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5913[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x3591('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0x3591('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x3591('0x2')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x79e08a){return function(_0x49a94d,_0x23830c,_0x257b1e){MailSubstatusEvents[_0x3591('0x3')](_0x79e08a+':'+_0x49a94d['id'],_0x49a94d);MailSubstatusEvents[_0x3591('0x3')](_0x79e08a,_0x49a94d);_0x257b1e(null);};}for(var e in events){if(events[_0x3591('0x4')](e)){var event=events[e];MailSubstatus[_0x3591('0x5')](e,emitEvent(event));}}module[_0x3591('0x6')]=MailSubstatusEvents; \ No newline at end of file +var _0xd0c9=['setMaxListeners','update','emit','hasOwnProperty','hook','events','../../mysqldb','MailSubstatus'];(function(_0x5c9c47,_0x13c9e0){var _0x2af103=function(_0x547ca0){while(--_0x547ca0){_0x5c9c47['push'](_0x5c9c47['shift']());}};_0x2af103(++_0x13c9e0);}(_0xd0c9,0xb5));var _0x9d0c=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xd0c9[_0x4ae6ef];return _0x3cbb4e;};'use strict';var EventEmitter=require(_0x9d0c('0x0'));var MailSubstatus=require(_0x9d0c('0x1'))['db'][_0x9d0c('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x9d0c('0x3')](0x0);var events={'afterUpdate':_0x9d0c('0x4')};function emitEvent(_0x3765a1){return function(_0x4121a9,_0x221165,_0x1ca938){MailSubstatusEvents[_0x9d0c('0x5')](_0x3765a1+':'+_0x4121a9['id'],_0x4121a9);MailSubstatusEvents[_0x9d0c('0x5')](_0x3765a1,_0x4121a9);_0x1ca938(null);};}for(var e in events){if(events[_0x9d0c('0x6')](e)){var event=events[e];MailSubstatus[_0x9d0c('0x7')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 3a11a66..9c4c644 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 _0x942d=['./mailSubstatus.attributes','models','MailSubstatus','mail_substatuses','update','name','_previousDataValues','catch'];(function(_0x52fe38,_0x6d3674){var _0x1838d1=function(_0x504c10){while(--_0x504c10){_0x52fe38['push'](_0x52fe38['shift']());}};_0x1838d1(++_0x6d3674);}(_0x942d,0xb0));var _0xd942=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x942d[_0x138adb];return _0x1b27f2;};'use strict';var attributes=require(_0xd942('0x0'));module['exports']=function(_0x3d4424){var _0x5949e1=_0x3d4424[_0xd942('0x1')];return _0x3d4424['define'](_0xd942('0x2'),attributes,{'tableName':_0xd942('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x14a601,_0x4848a7,_0x46eb83){return _0x5949e1['Condition'][_0xd942('0x4')]({'value':_0x14a601[_0xd942('0x5')]},{'where':{'field':'mailSubstatus','value':_0x14a601[_0xd942('0x6')][_0xd942('0x5')]}})['then'](function(){_0x46eb83();})[_0xd942('0x7')](function(_0x1d454b){_0x46eb83(_0x1d454b);});}}});}; \ No newline at end of file +var _0x541e=['name','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes','exports','models','define','mail_substatuses','Condition','update'];(function(_0x4b5368,_0x1e62bc){var _0x36da89=function(_0x2c3ed3){while(--_0x2c3ed3){_0x4b5368['push'](_0x4b5368['shift']());}};_0x36da89(++_0x1e62bc);}(_0x541e,0x1b5));var _0xe541=function(_0x9e8606,_0x61f146){_0x9e8606=_0x9e8606-0x0;var _0x22fbc0=_0x541e[_0x9e8606];return _0x22fbc0;};'use strict';var attributes=require(_0xe541('0x0'));module[_0xe541('0x1')]=function(_0x490ad4){var _0x1ac0e1=_0x490ad4[_0xe541('0x2')];return _0x490ad4[_0xe541('0x3')]('MailSubstatus',attributes,{'tableName':_0xe541('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x1cfb87,_0x1f499,_0x10fdf4){return _0x1ac0e1[_0xe541('0x5')][_0xe541('0x6')]({'value':_0x1cfb87[_0xe541('0x7')]},{'where':{'field':_0xe541('0x8'),'value':_0x1cfb87[_0xe541('0x9')][_0xe541('0x7')]}})[_0xe541('0xa')](function(){_0x10fdf4();})[_0xe541('0xb')](function(_0xe72f43){_0x10fdf4(_0xe72f43);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 8c60126..187a9c4 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 _0xe84f=['../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','code','MailSubstatus,\x20%s,\x20%s','message','error','result','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5e3acb,_0x19ecd4){var _0x50a2a5=function(_0x4cf865){while(--_0x4cf865){_0x5e3acb['push'](_0x5e3acb['shift']());}};_0x50a2a5(++_0x19ecd4);}(_0xe84f,0xde));var _0xfe84=function(_0x4a2323,_0x43fa16){_0x4a2323=_0x4a2323-0x0;var _0x18bd57=_0xe84f[_0x4a2323];return _0x18bd57;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xfe84('0x0'));var rs=require(_0xfe84('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe84('0x2'))['db'];var utils=require(_0xfe84('0x3'));var logger=require(_0xfe84('0x4'))(_0xfe84('0x5'));var config=require(_0xfe84('0x6'));var jayson=require(_0xfe84('0x7'));var client=jayson[_0xfe84('0x8')][_0xfe84('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a96db,_0x5311dc,_0x77168b){return new BPromise(function(_0x5bea45,_0x21534c){return client[_0xfe84('0xa')](_0x1a96db,_0x77168b)[_0xfe84('0xb')](function(_0x326170){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x5311dc,'request\x20sent');logger[_0xfe84('0xc')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x5311dc,_0xfe84('0xd'),JSON['stringify'](_0x326170));if(_0x326170['error']){if(_0x326170['error'][_0xfe84('0xe')]===0x1f4){logger['error'](_0xfe84('0xf'),_0x5311dc,_0x326170['error'][_0xfe84('0x10')]);return _0x21534c(_0x326170['error']['message']);}logger[_0xfe84('0x11')](_0xfe84('0xf'),_0x5311dc,_0x326170['error'][_0xfe84('0x10')]);return _0x5bea45(_0x326170[_0xfe84('0x11')][_0xfe84('0x10')]);}else{logger['info']('MailSubstatus,\x20%s,\x20%s',_0x5311dc,_0xfe84('0xd'));_0x5bea45(_0x326170[_0xfe84('0x12')][_0xfe84('0x10')]);}})['catch'](function(_0x49fbef){logger[_0xfe84('0x11')](_0xfe84('0xf'),_0x5311dc,_0x49fbef);_0x21534c(_0x49fbef);});});} \ No newline at end of file +var _0x3a14=['client','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x564b1e,_0x4aba84){var _0x453b44=function(_0x3a1e65){while(--_0x3a1e65){_0x564b1e['push'](_0x564b1e['shift']());}};_0x453b44(++_0x4aba84);}(_0x3a14,0x69));var _0x43a1=function(_0xa67be8,_0x8294c8){_0xa67be8=_0xa67be8-0x0;var _0x295391=_0x3a14[_0xa67be8];return _0x295391;};'use strict';var _=require(_0x43a1('0x0'));var util=require(_0x43a1('0x1'));var moment=require(_0x43a1('0x2'));var BPromise=require(_0x43a1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x43a1('0x4'));var db=require(_0x43a1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x43a1('0x6'))(_0x43a1('0x7'));var config=require('../../config/environment');var jayson=require(_0x43a1('0x8'));var client=jayson[_0x43a1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7193b8,_0x344d66,_0x4fc4f1){return new BPromise(function(_0x5e53a3,_0x5f3cb1){return client['request'](_0x7193b8,_0x4fc4f1)[_0x43a1('0xa')](function(_0x5deeb2){logger[_0x43a1('0xb')](_0x43a1('0xc'),_0x344d66,_0x43a1('0xd'));logger['debug'](_0x43a1('0xe'),_0x344d66,_0x43a1('0xd'),JSON[_0x43a1('0xf')](_0x5deeb2));if(_0x5deeb2['error']){if(_0x5deeb2[_0x43a1('0x10')]['code']===0x1f4){logger[_0x43a1('0x10')](_0x43a1('0xc'),_0x344d66,_0x5deeb2['error'][_0x43a1('0x11')]);return _0x5f3cb1(_0x5deeb2[_0x43a1('0x10')]['message']);}logger[_0x43a1('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x344d66,_0x5deeb2[_0x43a1('0x10')]['message']);return _0x5e53a3(_0x5deeb2[_0x43a1('0x10')][_0x43a1('0x11')]);}else{logger[_0x43a1('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x344d66,_0x43a1('0xd'));_0x5e53a3(_0x5deeb2['result']['message']);}})[_0x43a1('0x12')](function(_0x358d12){logger[_0x43a1('0x10')](_0x43a1('0xc'),_0x344d66,_0x358d12);_0x5f3cb1(_0x358d12);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 081d851..7d99036 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 _0x09e9=['create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe'];(function(_0xf0fab,_0x3aaf48){var _0x9f8fb7=function(_0x2a7853){while(--_0x2a7853){_0xf0fab['push'](_0xf0fab['shift']());}};_0x9f8fb7(++_0x3aaf48);}(_0x09e9,0x1e1));var _0x909e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x09e9[_0x3a6efd];return _0x487b9a;};'use strict';var multer=require(_0x909e('0x0'));var util=require(_0x909e('0x1'));var path=require(_0x909e('0x2'));var timeout=require(_0x909e('0x3'));var express=require(_0x909e('0x4'));var router=express[_0x909e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x909e('0x6'));var interaction=require(_0x909e('0x7'));var config=require(_0x909e('0x8'));var controller=require('./mailTransferReport.controller');router[_0x909e('0x9')]('/',auth[_0x909e('0xa')](),controller[_0x909e('0xb')]);router[_0x909e('0x9')]('/describe',auth[_0x909e('0xa')](),controller[_0x909e('0xc')]);router[_0x909e('0x9')]('/:id',auth[_0x909e('0xa')](),controller['show']);router['post']('/',auth[_0x909e('0xa')](),controller[_0x909e('0xd')]);router['put'](_0x909e('0xe'),auth[_0x909e('0xa')](),controller[_0x909e('0xf')]);router[_0x909e('0x10')](_0x909e('0xe'),auth['isAuthenticated'](),controller[_0x909e('0x11')]);module[_0x909e('0x12')]=router; \ No newline at end of file +var _0x0a03=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x5ec6d7,_0x1d3878){var _0x503fb3=function(_0x2a8dc4){while(--_0x2a8dc4){_0x5ec6d7['push'](_0x5ec6d7['shift']());}};_0x503fb3(++_0x1d3878);}(_0x0a03,0x1df));var _0x30a0=function(_0x9c0abf,_0x19b264){_0x9c0abf=_0x9c0abf-0x0;var _0x284ac3=_0x0a03[_0x9c0abf];return _0x284ac3;};'use strict';var multer=require(_0x30a0('0x0'));var util=require(_0x30a0('0x1'));var path=require('path');var timeout=require(_0x30a0('0x2'));var express=require(_0x30a0('0x3'));var router=express['Router']();var fs_extra=require(_0x30a0('0x4'));var auth=require(_0x30a0('0x5'));var interaction=require(_0x30a0('0x6'));var config=require(_0x30a0('0x7'));var controller=require(_0x30a0('0x8'));router[_0x30a0('0x9')]('/',auth[_0x30a0('0xa')](),controller[_0x30a0('0xb')]);router['get'](_0x30a0('0xc'),auth[_0x30a0('0xa')](),controller[_0x30a0('0xd')]);router[_0x30a0('0x9')](_0x30a0('0xe'),auth[_0x30a0('0xa')](),controller[_0x30a0('0xf')]);router[_0x30a0('0x10')]('/',auth[_0x30a0('0xa')](),controller['create']);router[_0x30a0('0x11')](_0x30a0('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x30a0('0x12')](_0x30a0('0xe'),auth['isAuthenticated'](),controller[_0x30a0('0x13')]);module[_0x30a0('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index df8f115..16820f4 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x5584c3,_0x3804c0){var _0x33fca3=function(_0x45ff15){while(--_0x45ff15){_0x5584c3['push'](_0x5584c3['shift']());}};_0x33fca3(++_0x3804c0);}(_0xaa88,0x137));var _0x8aa8=function(_0x2e986d,_0x4b6b63){_0x2e986d=_0x2e986d-0x0;var _0x351c79=_0xaa88[_0x2e986d];return _0x351c79;};'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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x2c2ad2,_0x394959){var _0x34f4fd=function(_0x174d3a){while(--_0x174d3a){_0x2c2ad2['push'](_0x2c2ad2['shift']());}};_0x34f4fd(++_0x394959);}(_0xedd9,0xfc));var _0x9edd=function(_0x564df3,_0x2a88b4){_0x564df3=_0x564df3-0x0;var _0x3cb047=_0xedd9[_0x564df3];return _0x3cb047;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 768d1fb..3ce8533 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 _0x98f2=['request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','undefined','offset','count','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','index','map','MailTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','describe','eml-format','fast-json-patch'];(function(_0x3c49bc,_0x593ddb){var _0x135a9a=function(_0x3c7562){while(--_0x3c7562){_0x3c49bc['push'](_0x3c49bc['shift']());}};_0x135a9a(++_0x593ddb);}(_0x98f2,0x8e));var _0x298f=function(_0x5b6286,_0x1c4a6a){_0x5b6286=_0x5b6286-0x0;var _0xde4486=_0x98f2[_0x5b6286];return _0xde4486;};'use strict';var emlformat=require(_0x298f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x298f('0x1'));var rp=require(_0x298f('0x2'));var moment=require(_0x298f('0x3'));var BPromise=require(_0x298f('0x4'));var Mustache=require(_0x298f('0x5'));var util=require('util');var path=require('path');var sox=require(_0x298f('0x6'));var csv=require(_0x298f('0x7'));var ejs=require(_0x298f('0x8'));var fs=require('fs');var fs_extra=require(_0x298f('0x9'));var _=require('lodash');var squel=require(_0x298f('0xa'));var crypto=require('crypto');var jsforce=require(_0x298f('0xb'));var deskjs=require(_0x298f('0xc'));var toCsv=require(_0x298f('0x7'));var querystring=require(_0x298f('0xd'));var Papa=require(_0x298f('0xe'));var Redis=require('ioredis');var authService=require(_0x298f('0xf'));var qs=require(_0x298f('0x10'));var as=require(_0x298f('0x11'));var hardwareService=require(_0x298f('0x12'));var logger=require('../../config/logger')(_0x298f('0x13'));var utils=require(_0x298f('0x14'));var config=require(_0x298f('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x188b7e,_0xe4b621){_0xe4b621=_0xe4b621||0xcc;return function(_0x3684c6){if(_0x3684c6){return _0x188b7e[_0x298f('0x16')](_0xe4b621);}return _0x188b7e[_0x298f('0x17')](_0xe4b621)['end']();};}function respondWithResult(_0x2aaa94,_0x32f712){_0x32f712=_0x32f712||0xc8;return function(_0x5711e2){if(_0x5711e2){return _0x2aaa94[_0x298f('0x17')](_0x32f712)[_0x298f('0x18')](_0x5711e2);}};}function respondWithFilteredResult(_0x213101,_0x22ae70){return function(_0x1a5b57){if(_0x1a5b57){var _0x23331f=typeof _0x22ae70['offset']===_0x298f('0x19')&&typeof _0x22ae70['limit']==='undefined';var _0x583457=_0x1a5b57['count'];var _0x507ace=_0x23331f?0x0:_0x22ae70[_0x298f('0x1a')];var _0x1bc2b6=_0x23331f?_0x1a5b57[_0x298f('0x1b')]:_0x22ae70[_0x298f('0x1a')]+_0x22ae70['limit'];var _0x452b9e;if(_0x1bc2b6>=_0x583457){_0x1bc2b6=_0x583457;_0x452b9e=0xc8;}else{_0x452b9e=0xce;}_0x213101['status'](_0x452b9e);return _0x213101['set'](_0x298f('0x1c'),_0x507ace+'-'+_0x1bc2b6+'/'+_0x583457)[_0x298f('0x18')](_0x1a5b57);}return null;};}function patchUpdates(_0x1efa94){return function(_0x5da41f){try{jsonpatch[_0x298f('0x1d')](_0x5da41f,_0x1efa94,!![]);}catch(_0x1fdafe){return BPromise[_0x298f('0x1e')](_0x1fdafe);}return _0x5da41f[_0x298f('0x1f')]();};}function saveUpdates(_0x1f1690,_0x32f0cb){return function(_0x29578a){if(_0x29578a){return _0x29578a['update'](_0x1f1690)[_0x298f('0x20')](function(_0x59fd1f){return _0x59fd1f;});}return null;};}function removeEntity(_0x1765c5,_0x5dfb3e){return function(_0x5cfbb9){if(_0x5cfbb9){return _0x5cfbb9[_0x298f('0x21')]()[_0x298f('0x20')](function(){_0x1765c5[_0x298f('0x17')](0xcc)[_0x298f('0x22')]();});}};}function handleEntityNotFound(_0x1ed6ae,_0x59e432){return function(_0x5be925){if(!_0x5be925){_0x1ed6ae[_0x298f('0x16')](0x194);}return _0x5be925;};}function handleError(_0x496b89,_0x8fd34b){_0x8fd34b=_0x8fd34b||0x1f4;return function(_0x4c8f90){logger[_0x298f('0x23')](_0x4c8f90[_0x298f('0x24')]);if(_0x4c8f90['name']){delete _0x4c8f90[_0x298f('0x25')];}_0x496b89[_0x298f('0x17')](_0x8fd34b)['send'](_0x4c8f90);};}exports[_0x298f('0x26')]=function(_0xd6a61,_0x2f7fd1){var _0x3cec3b={},_0xa50685={},_0x4f10c7={'count':0x0,'rows':[]};var _0x160fa2=_[_0x298f('0x27')](db[_0x298f('0x28')][_0x298f('0x29')],function(_0x4d8dd5){return{'name':_0x4d8dd5[_0x298f('0x2a')],'type':_0x4d8dd5[_0x298f('0x2b')]['key']};});_0xa50685[_0x298f('0x2c')]=_['map'](_0x160fa2,_0x298f('0x25'));_0xa50685[_0x298f('0x2d')]=_[_0x298f('0x2e')](_0xd6a61[_0x298f('0x2d')]);_0xa50685[_0x298f('0x2f')]=_[_0x298f('0x30')](_0xa50685[_0x298f('0x2c')],_0xa50685[_0x298f('0x2d')]);_0x3cec3b['attributes']=_[_0x298f('0x30')](_0xa50685[_0x298f('0x2c')],qs[_0x298f('0x31')](_0xd6a61[_0x298f('0x2d')]['fields']));_0x3cec3b['attributes']=_0x3cec3b[_0x298f('0x32')][_0x298f('0x33')]?_0x3cec3b['attributes']:_0xa50685[_0x298f('0x2c')];if(!_0xd6a61[_0x298f('0x2d')][_0x298f('0x34')]('nolimit')){_0x3cec3b['limit']=qs[_0x298f('0x35')](_0xd6a61[_0x298f('0x2d')][_0x298f('0x35')]);_0x3cec3b[_0x298f('0x1a')]=qs[_0x298f('0x1a')](_0xd6a61[_0x298f('0x2d')][_0x298f('0x1a')]);}_0x3cec3b[_0x298f('0x36')]=qs[_0x298f('0x37')](_0xd6a61['query'][_0x298f('0x37')]);_0x3cec3b[_0x298f('0x38')]=qs['filters'](_[_0x298f('0x39')](_0xd6a61[_0x298f('0x2d')],_0xa50685[_0x298f('0x2f')]),_0x160fa2);if(_0xd6a61[_0x298f('0x2d')][_0x298f('0x3a')]){_0x3cec3b[_0x298f('0x38')]=_[_0x298f('0x3b')](_0x3cec3b[_0x298f('0x38')],{'$or':_['map'](_0x160fa2,function(_0x552383){if(_0x552383[_0x298f('0x2b')]!=='VIRTUAL'){var _0x2cf09b={};_0x2cf09b[_0x552383['name']]={'$like':'%'+_0xd6a61['query']['filter']+'%'};return _0x2cf09b;}})});}_0x3cec3b=_[_0x298f('0x3b')]({},_0x3cec3b,_0xd6a61[_0x298f('0x3c')]);var _0x29c0b8={'where':_0x3cec3b[_0x298f('0x38')]};return db[_0x298f('0x28')]['count'](_0x29c0b8)[_0x298f('0x20')](function(_0x5141a5){_0x4f10c7['count']=_0x5141a5;if(_0xd6a61['query'][_0x298f('0x3d')]){_0x3cec3b[_0x298f('0x3e')]=[{'all':!![]}];}return db['MailTransferReport'][_0x298f('0x3f')](_0x3cec3b);})['then'](function(_0x2f77ec){_0x4f10c7[_0x298f('0x40')]=_0x2f77ec;return _0x4f10c7;})[_0x298f('0x20')](respondWithFilteredResult(_0x2f7fd1,_0x3cec3b))[_0x298f('0x41')](handleError(_0x2f7fd1,null));};exports[_0x298f('0x42')]=function(_0x348baa,_0x3ff21f){var _0x571b88={'raw':!![],'where':{'id':_0x348baa['params']['id']}},_0x3e81a6={};_0x3e81a6[_0x298f('0x2c')]=_['keys'](db[_0x298f('0x28')][_0x298f('0x29')]);_0x3e81a6[_0x298f('0x2d')]=_[_0x298f('0x2e')](_0x348baa[_0x298f('0x2d')]);_0x3e81a6[_0x298f('0x2f')]=_[_0x298f('0x30')](_0x3e81a6[_0x298f('0x2c')],_0x3e81a6['query']);_0x571b88[_0x298f('0x32')]=_[_0x298f('0x30')](_0x3e81a6[_0x298f('0x2c')],qs[_0x298f('0x31')](_0x348baa[_0x298f('0x2d')][_0x298f('0x31')]));_0x571b88[_0x298f('0x32')]=_0x571b88[_0x298f('0x32')][_0x298f('0x33')]?_0x571b88[_0x298f('0x32')]:_0x3e81a6[_0x298f('0x2c')];if(_0x348baa[_0x298f('0x2d')][_0x298f('0x3d')]){_0x571b88['include']=[{'all':!![]}];}_0x571b88=_[_0x298f('0x3b')]({},_0x571b88,_0x348baa[_0x298f('0x3c')]);return db[_0x298f('0x28')]['find'](_0x571b88)[_0x298f('0x20')](handleEntityNotFound(_0x3ff21f,null))['then'](respondWithResult(_0x3ff21f,null))['catch'](handleError(_0x3ff21f,null));};exports[_0x298f('0x43')]=function(_0x22765e,_0x5c0251){return db[_0x298f('0x28')][_0x298f('0x43')](_0x22765e[_0x298f('0x44')],{})[_0x298f('0x20')](respondWithResult(_0x5c0251,0xc9))[_0x298f('0x41')](handleError(_0x5c0251,null));};exports['update']=function(_0x16cfa4,_0x9204c5){if(_0x16cfa4[_0x298f('0x44')]['id']){delete _0x16cfa4['body']['id'];}return db[_0x298f('0x28')][_0x298f('0x45')]({'where':{'id':_0x16cfa4[_0x298f('0x46')]['id']}})['then'](handleEntityNotFound(_0x9204c5,null))['then'](saveUpdates(_0x16cfa4[_0x298f('0x44')],null))['then'](respondWithResult(_0x9204c5,null))[_0x298f('0x41')](handleError(_0x9204c5,null));};exports[_0x298f('0x21')]=function(_0x3aa46e,_0x2707d6){return db[_0x298f('0x28')][_0x298f('0x45')]({'where':{'id':_0x3aa46e['params']['id']}})[_0x298f('0x20')](handleEntityNotFound(_0x2707d6,null))[_0x298f('0x20')](removeEntity(_0x2707d6,null))[_0x298f('0x41')](handleError(_0x2707d6,null));};exports[_0x298f('0x47')]=function(_0x1d6020,_0x568e56){return db[_0x298f('0x28')]['describe']()[_0x298f('0x20')](respondWithResult(_0x568e56,null))[_0x298f('0x41')](handleError(_0x568e56,null));}; \ No newline at end of file +var _0xb7a6=['send','index','map','MailTransferReport','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','then','include','findAll','rows','catch','show','keys','includeAll','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','save','update','destroy','name'];(function(_0x3b8021,_0xe200c8){var _0x518f00=function(_0x148ed7){while(--_0x148ed7){_0x3b8021['push'](_0x3b8021['shift']());}};_0x518f00(++_0xe200c8);}(_0xb7a6,0xa9));var _0x6b7a=function(_0x595603,_0x5de06d){_0x595603=_0x595603-0x0;var _0x29ab0d=_0xb7a6[_0x595603];return _0x29ab0d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6b7a('0x0'));var zipdir=require(_0x6b7a('0x1'));var jsonpatch=require(_0x6b7a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6b7a('0x3'));var Mustache=require('mustache');var util=require(_0x6b7a('0x4'));var path=require('path');var sox=require(_0x6b7a('0x5'));var csv=require(_0x6b7a('0x6'));var ejs=require(_0x6b7a('0x7'));var fs=require('fs');var fs_extra=require(_0x6b7a('0x8'));var _=require(_0x6b7a('0x9'));var squel=require(_0x6b7a('0xa'));var crypto=require('crypto');var jsforce=require(_0x6b7a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6b7a('0x6'));var querystring=require(_0x6b7a('0xc'));var Papa=require('papaparse');var Redis=require(_0x6b7a('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6b7a('0xe'));var hardwareService=require(_0x6b7a('0xf'));var logger=require('../../config/logger')(_0x6b7a('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6b7a('0x11'));var db=require(_0x6b7a('0x12'))['db'];function respondWithStatusCode(_0x26d7f8,_0x5d20d9){_0x5d20d9=_0x5d20d9||0xcc;return function(_0x49c249){if(_0x49c249){return _0x26d7f8[_0x6b7a('0x13')](_0x5d20d9);}return _0x26d7f8[_0x6b7a('0x14')](_0x5d20d9)['end']();};}function respondWithResult(_0x3632f1,_0x1de98b){_0x1de98b=_0x1de98b||0xc8;return function(_0x158fa4){if(_0x158fa4){return _0x3632f1['status'](_0x1de98b)[_0x6b7a('0x15')](_0x158fa4);}};}function respondWithFilteredResult(_0x1b7806,_0x1bb30f){return function(_0x58a78b){if(_0x58a78b){var _0x3a8ae3=typeof _0x1bb30f[_0x6b7a('0x16')]==='undefined'&&typeof _0x1bb30f['limit']===_0x6b7a('0x17');var _0x34feb4=_0x58a78b[_0x6b7a('0x18')];var _0x11cc71=_0x3a8ae3?0x0:_0x1bb30f[_0x6b7a('0x16')];var _0x1e004d=_0x3a8ae3?_0x58a78b[_0x6b7a('0x18')]:_0x1bb30f[_0x6b7a('0x16')]+_0x1bb30f[_0x6b7a('0x19')];var _0x19f9db;if(_0x1e004d>=_0x34feb4){_0x1e004d=_0x34feb4;_0x19f9db=0xc8;}else{_0x19f9db=0xce;}_0x1b7806['status'](_0x19f9db);return _0x1b7806[_0x6b7a('0x1a')](_0x6b7a('0x1b'),_0x11cc71+'-'+_0x1e004d+'/'+_0x34feb4)[_0x6b7a('0x15')](_0x58a78b);}return null;};}function patchUpdates(_0x214f6a){return function(_0x243afa){try{jsonpatch['apply'](_0x243afa,_0x214f6a,!![]);}catch(_0x3f709e){return BPromise['reject'](_0x3f709e);}return _0x243afa[_0x6b7a('0x1c')]();};}function saveUpdates(_0x26f54d,_0x1352f9){return function(_0x13f46a){if(_0x13f46a){return _0x13f46a[_0x6b7a('0x1d')](_0x26f54d)['then'](function(_0x47f533){return _0x47f533;});}return null;};}function removeEntity(_0x2dbc74,_0x3d5fbb){return function(_0x5a39e6){if(_0x5a39e6){return _0x5a39e6[_0x6b7a('0x1e')]()['then'](function(){_0x2dbc74[_0x6b7a('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16b642,_0x31304a){return function(_0x2299bf){if(!_0x2299bf){_0x16b642[_0x6b7a('0x13')](0x194);}return _0x2299bf;};}function handleError(_0x1bf506,_0x52c224){_0x52c224=_0x52c224||0x1f4;return function(_0x5ad62e){logger['error'](_0x5ad62e['stack']);if(_0x5ad62e[_0x6b7a('0x1f')]){delete _0x5ad62e[_0x6b7a('0x1f')];}_0x1bf506['status'](_0x52c224)[_0x6b7a('0x20')](_0x5ad62e);};}exports[_0x6b7a('0x21')]=function(_0x2ef956,_0x11a78e){var _0x4a4d17={},_0x37a89b={},_0x1e1a3a={'count':0x0,'rows':[]};var _0x57ecfb=_[_0x6b7a('0x22')](db[_0x6b7a('0x23')][_0x6b7a('0x24')],function(_0x30c06e){return{'name':_0x30c06e['fieldName'],'type':_0x30c06e[_0x6b7a('0x25')][_0x6b7a('0x26')]};});_0x37a89b['model']=_[_0x6b7a('0x22')](_0x57ecfb,_0x6b7a('0x1f'));_0x37a89b[_0x6b7a('0x27')]=_['keys'](_0x2ef956[_0x6b7a('0x27')]);_0x37a89b[_0x6b7a('0x28')]=_[_0x6b7a('0x29')](_0x37a89b[_0x6b7a('0x2a')],_0x37a89b[_0x6b7a('0x27')]);_0x4a4d17[_0x6b7a('0x2b')]=_[_0x6b7a('0x29')](_0x37a89b[_0x6b7a('0x2a')],qs['fields'](_0x2ef956[_0x6b7a('0x27')][_0x6b7a('0x2c')]));_0x4a4d17[_0x6b7a('0x2b')]=_0x4a4d17[_0x6b7a('0x2b')][_0x6b7a('0x2d')]?_0x4a4d17[_0x6b7a('0x2b')]:_0x37a89b['model'];if(!_0x2ef956[_0x6b7a('0x27')][_0x6b7a('0x2e')]('nolimit')){_0x4a4d17['limit']=qs[_0x6b7a('0x19')](_0x2ef956['query'][_0x6b7a('0x19')]);_0x4a4d17[_0x6b7a('0x16')]=qs[_0x6b7a('0x16')](_0x2ef956[_0x6b7a('0x27')][_0x6b7a('0x16')]);}_0x4a4d17[_0x6b7a('0x2f')]=qs['sort'](_0x2ef956[_0x6b7a('0x27')][_0x6b7a('0x30')]);_0x4a4d17['where']=qs['filters'](_[_0x6b7a('0x31')](_0x2ef956[_0x6b7a('0x27')],_0x37a89b[_0x6b7a('0x28')]),_0x57ecfb);if(_0x2ef956[_0x6b7a('0x27')][_0x6b7a('0x32')]){_0x4a4d17[_0x6b7a('0x33')]=_['merge'](_0x4a4d17[_0x6b7a('0x33')],{'$or':_[_0x6b7a('0x22')](_0x57ecfb,function(_0x34a208){if(_0x34a208['type']!=='VIRTUAL'){var _0x34ed45={};_0x34ed45[_0x34a208[_0x6b7a('0x1f')]]={'$like':'%'+_0x2ef956[_0x6b7a('0x27')][_0x6b7a('0x32')]+'%'};return _0x34ed45;}})});}_0x4a4d17=_[_0x6b7a('0x34')]({},_0x4a4d17,_0x2ef956[_0x6b7a('0x35')]);var _0x284c0f={'where':_0x4a4d17['where']};return db[_0x6b7a('0x23')]['count'](_0x284c0f)[_0x6b7a('0x36')](function(_0x57ee5d){_0x1e1a3a[_0x6b7a('0x18')]=_0x57ee5d;if(_0x2ef956[_0x6b7a('0x27')]['includeAll']){_0x4a4d17[_0x6b7a('0x37')]=[{'all':!![]}];}return db[_0x6b7a('0x23')][_0x6b7a('0x38')](_0x4a4d17);})['then'](function(_0x3325cc){_0x1e1a3a[_0x6b7a('0x39')]=_0x3325cc;return _0x1e1a3a;})['then'](respondWithFilteredResult(_0x11a78e,_0x4a4d17))[_0x6b7a('0x3a')](handleError(_0x11a78e,null));};exports[_0x6b7a('0x3b')]=function(_0xc29784,_0x18dd60){var _0x3312e0={'raw':!![],'where':{'id':_0xc29784['params']['id']}},_0x24d33e={};_0x24d33e['model']=_['keys'](db[_0x6b7a('0x23')][_0x6b7a('0x24')]);_0x24d33e['query']=_[_0x6b7a('0x3c')](_0xc29784[_0x6b7a('0x27')]);_0x24d33e[_0x6b7a('0x28')]=_[_0x6b7a('0x29')](_0x24d33e['model'],_0x24d33e['query']);_0x3312e0[_0x6b7a('0x2b')]=_[_0x6b7a('0x29')](_0x24d33e[_0x6b7a('0x2a')],qs[_0x6b7a('0x2c')](_0xc29784['query'][_0x6b7a('0x2c')]));_0x3312e0[_0x6b7a('0x2b')]=_0x3312e0[_0x6b7a('0x2b')][_0x6b7a('0x2d')]?_0x3312e0[_0x6b7a('0x2b')]:_0x24d33e['model'];if(_0xc29784[_0x6b7a('0x27')][_0x6b7a('0x3d')]){_0x3312e0[_0x6b7a('0x37')]=[{'all':!![]}];}_0x3312e0=_['merge']({},_0x3312e0,_0xc29784[_0x6b7a('0x35')]);return db['MailTransferReport'][_0x6b7a('0x3e')](_0x3312e0)['then'](handleEntityNotFound(_0x18dd60,null))[_0x6b7a('0x36')](respondWithResult(_0x18dd60,null))['catch'](handleError(_0x18dd60,null));};exports[_0x6b7a('0x3f')]=function(_0xd22352,_0x11a887){return db['MailTransferReport']['create'](_0xd22352[_0x6b7a('0x40')],{})[_0x6b7a('0x36')](respondWithResult(_0x11a887,0xc9))[_0x6b7a('0x3a')](handleError(_0x11a887,null));};exports['update']=function(_0x217418,_0x45ea1a){if(_0x217418[_0x6b7a('0x40')]['id']){delete _0x217418[_0x6b7a('0x40')]['id'];}return db[_0x6b7a('0x23')][_0x6b7a('0x3e')]({'where':{'id':_0x217418[_0x6b7a('0x41')]['id']}})[_0x6b7a('0x36')](handleEntityNotFound(_0x45ea1a,null))[_0x6b7a('0x36')](saveUpdates(_0x217418[_0x6b7a('0x40')],null))[_0x6b7a('0x36')](respondWithResult(_0x45ea1a,null))[_0x6b7a('0x3a')](handleError(_0x45ea1a,null));};exports[_0x6b7a('0x1e')]=function(_0x33171,_0x1a2b5b){return db['MailTransferReport']['find']({'where':{'id':_0x33171[_0x6b7a('0x41')]['id']}})[_0x6b7a('0x36')](handleEntityNotFound(_0x1a2b5b,null))['then'](removeEntity(_0x1a2b5b,null))[_0x6b7a('0x3a')](handleError(_0x1a2b5b,null));};exports[_0x6b7a('0x42')]=function(_0x2b061d,_0x58d9e5){return db[_0x6b7a('0x23')][_0x6b7a('0x42')]()[_0x6b7a('0x36')](respondWithResult(_0x58d9e5,null))[_0x6b7a('0x3a')](handleError(_0x58d9e5,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 031d1d1..fc6479e 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 _0xcdb1=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_mail_transfer','uniqueid','util','../../config/logger','api'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xcdb1,0x1eb));var _0x1cdb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xcdb1[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x1cdb('0x0'));var logger=require(_0x1cdb('0x1'))(_0x1cdb('0x2'));var moment=require(_0x1cdb('0x3'));var BPromise=require(_0x1cdb('0x4'));var rp=require(_0x1cdb('0x5'));var fs=require('fs');var path=require(_0x1cdb('0x6'));var rimraf=require(_0x1cdb('0x7'));var config=require(_0x1cdb('0x8'));var attributes=require('./mailTransferReport.attributes');module[_0x1cdb('0x9')]=function(_0x39260b,_0x35bf2a){return _0x39260b[_0x1cdb('0xa')]('MailTransferReport',attributes,{'tableName':_0x1cdb('0xb'),'paranoid':![],'indexes':[{'name':_0x1cdb('0xc'),'fields':[_0x1cdb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb2ef=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash'];(function(_0x51d2f8,_0x27a4a0){var _0x335143=function(_0x4e8457){while(--_0x4e8457){_0x51d2f8['push'](_0x51d2f8['shift']());}};_0x335143(++_0x27a4a0);}(_0xb2ef,0xa7));var _0xfb2e=function(_0xdd9f6e,_0x5612b7){_0xdd9f6e=_0xdd9f6e-0x0;var _0x35a8cf=_0xb2ef[_0xdd9f6e];return _0x35a8cf;};'use strict';var _=require(_0xfb2e('0x0'));var util=require(_0xfb2e('0x1'));var logger=require(_0xfb2e('0x2'))('api');var moment=require(_0xfb2e('0x3'));var BPromise=require(_0xfb2e('0x4'));var rp=require(_0xfb2e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb2e('0x6'));var config=require(_0xfb2e('0x7'));var attributes=require(_0xfb2e('0x8'));module[_0xfb2e('0x9')]=function(_0x3069a,_0x2a1c23){return _0x3069a[_0xfb2e('0xa')](_0xfb2e('0xb'),attributes,{'tableName':_0xfb2e('0xc'),'paranoid':![],'indexes':[{'name':_0xfb2e('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index f53c116..54e7617 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 _0xf267=['http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise'];(function(_0x65b1ab,_0x2d1e7a){var _0x3d20ed=function(_0x2d6ad9){while(--_0x2d6ad9){_0x65b1ab['push'](_0x65b1ab['shift']());}};_0x3d20ed(++_0x2d1e7a);}(_0xf267,0x1db));var _0x7f26=function(_0x152a0d,_0x1e6ab5){_0x152a0d=_0x152a0d-0x0;var _0x3d9c51=_0xf267[_0x152a0d];return _0x3d9c51;};'use strict';var _=require(_0x7f26('0x0'));var util=require(_0x7f26('0x1'));var moment=require('moment');var BPromise=require(_0x7f26('0x2'));var rs=require(_0x7f26('0x3'));var fs=require('fs');var Redis=require(_0x7f26('0x4'));var db=require(_0x7f26('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7f26('0x6'));var config=require('../../config/environment');var jayson=require(_0x7f26('0x7'));var client=jayson['client'][_0x7f26('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x29fcb1,_0x55bff9,_0x20fc88){return new BPromise(function(_0x554432,_0x635229){return client[_0x7f26('0x9')](_0x29fcb1,_0x20fc88)[_0x7f26('0xa')](function(_0x511e5f){logger[_0x7f26('0xb')](_0x7f26('0xc'),_0x55bff9,_0x7f26('0xd'));logger['debug'](_0x7f26('0xe'),_0x55bff9,_0x7f26('0xd'),JSON[_0x7f26('0xf')](_0x511e5f));if(_0x511e5f['error']){if(_0x511e5f[_0x7f26('0x10')][_0x7f26('0x11')]===0x1f4){logger['error'](_0x7f26('0xc'),_0x55bff9,_0x511e5f[_0x7f26('0x10')]['message']);return _0x635229(_0x511e5f[_0x7f26('0x10')][_0x7f26('0x12')]);}logger[_0x7f26('0x10')](_0x7f26('0xc'),_0x55bff9,_0x511e5f[_0x7f26('0x10')]['message']);return _0x554432(_0x511e5f[_0x7f26('0x10')]['message']);}else{logger['info'](_0x7f26('0xc'),_0x55bff9,_0x7f26('0xd'));_0x554432(_0x511e5f[_0x7f26('0x13')][_0x7f26('0x12')]);}})[_0x7f26('0x14')](function(_0x3b6ea0){logger[_0x7f26('0x10')](_0x7f26('0xc'),_0x55bff9,_0x3b6ea0);_0x635229(_0x3b6ea0);});});} \ No newline at end of file +var _0xba0f=['request','then','request\x20sent','debug','stringify','error','MailTransferReport,\x20%s,\x20%s','message','info','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x1c27e1,_0x10cc1c){var _0x9a81ac=function(_0x51598d){while(--_0x51598d){_0x1c27e1['push'](_0x1c27e1['shift']());}};_0x9a81ac(++_0x10cc1c);}(_0xba0f,0xd2));var _0xfba0=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xba0f[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfba0('0x0'));var BPromise=require(_0xfba0('0x1'));var rs=require(_0xfba0('0x2'));var fs=require('fs');var Redis=require(_0xfba0('0x3'));var db=require(_0xfba0('0x4'))['db'];var utils=require(_0xfba0('0x5'));var logger=require(_0xfba0('0x6'))(_0xfba0('0x7'));var config=require('../../config/environment');var jayson=require(_0xfba0('0x8'));var client=jayson['client'][_0xfba0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x352c33,_0x58dc04,_0x54d385){return new BPromise(function(_0x1acf0f,_0x3ccf71){return client[_0xfba0('0xa')](_0x352c33,_0x54d385)[_0xfba0('0xb')](function(_0x248e4e){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x58dc04,_0xfba0('0xc'));logger[_0xfba0('0xd')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x58dc04,'request\x20sent',JSON[_0xfba0('0xe')](_0x248e4e));if(_0x248e4e[_0xfba0('0xf')]){if(_0x248e4e['error']['code']===0x1f4){logger['error'](_0xfba0('0x10'),_0x58dc04,_0x248e4e[_0xfba0('0xf')][_0xfba0('0x11')]);return _0x3ccf71(_0x248e4e[_0xfba0('0xf')][_0xfba0('0x11')]);}logger[_0xfba0('0xf')](_0xfba0('0x10'),_0x58dc04,_0x248e4e['error']['message']);return _0x1acf0f(_0x248e4e[_0xfba0('0xf')][_0xfba0('0x11')]);}else{logger[_0xfba0('0x12')](_0xfba0('0x10'),_0x58dc04,_0xfba0('0xc'));_0x1acf0f(_0x248e4e[_0xfba0('0x13')][_0xfba0('0x11')]);}})['catch'](function(_0x376fc6){logger[_0xfba0('0xf')](_0xfba0('0x10'),_0x58dc04,_0x376fc6);_0x3ccf71(_0x376fc6);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 6a97862..17cd6ad 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 _0xc082=['../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','delete','destroy','exports','multer','util','Router'];(function(_0x125d7e,_0x29ceb7){var _0x430030=function(_0x406f4a){while(--_0x406f4a){_0x125d7e['push'](_0x125d7e['shift']());}};_0x430030(++_0x29ceb7);}(_0xc082,0x12f));var _0x2c08=function(_0x237f12,_0x353f98){_0x237f12=_0x237f12-0x0;var _0x3d6d95=_0xc082[_0x237f12];return _0x3d6d95;};'use strict';var multer=require(_0x2c08('0x0'));var util=require(_0x2c08('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2c08('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2c08('0x3'));var interaction=require(_0x2c08('0x4'));var config=require(_0x2c08('0x5'));var controller=require(_0x2c08('0x6'));router[_0x2c08('0x7')]('/',auth[_0x2c08('0x8')](),controller[_0x2c08('0x9')]);router[_0x2c08('0x7')](_0x2c08('0xa'),auth[_0x2c08('0x8')](),controller['describe']);router[_0x2c08('0x7')](_0x2c08('0xb'),auth['isAuthenticated'](),controller[_0x2c08('0xc')]);router[_0x2c08('0xd')]('/',auth[_0x2c08('0x8')](),controller[_0x2c08('0xe')]);router['put'](_0x2c08('0xb'),auth[_0x2c08('0x8')](),controller['update']);router[_0x2c08('0xf')](_0x2c08('0xb'),auth['isAuthenticated'](),controller[_0x2c08('0x10')]);module[_0x2c08('0x11')]=router; \ No newline at end of file +var _0x5080=['../../components/interaction/service','./memberReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3865c4,_0xd26435){var _0x1f079d=function(_0x11deb7){while(--_0x11deb7){_0x3865c4['push'](_0x3865c4['shift']());}};_0x1f079d(++_0xd26435);}(_0x5080,0x1b2));var _0x0508=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5080[_0xfae23b];return _0x200640;};'use strict';var multer=require('multer');var util=require(_0x0508('0x0'));var path=require('path');var timeout=require(_0x0508('0x1'));var express=require(_0x0508('0x2'));var router=express[_0x0508('0x3')]();var fs_extra=require(_0x0508('0x4'));var auth=require(_0x0508('0x5'));var interaction=require(_0x0508('0x6'));var config=require('../../config/environment');var controller=require(_0x0508('0x7'));router[_0x0508('0x8')]('/',auth[_0x0508('0x9')](),controller[_0x0508('0xa')]);router[_0x0508('0x8')](_0x0508('0xb'),auth[_0x0508('0x9')](),controller[_0x0508('0xc')]);router[_0x0508('0x8')]('/:id',auth[_0x0508('0x9')](),controller[_0x0508('0xd')]);router[_0x0508('0xe')]('/',auth['isAuthenticated'](),controller[_0x0508('0xf')]);router['put']('/:id',auth[_0x0508('0x9')](),controller[_0x0508('0x10')]);router[_0x0508('0x11')]('/:id',auth[_0x0508('0x9')](),controller[_0x0508('0x12')]);module[_0x0508('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 2d7d31b..7a154e2 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 _0x4058=['setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','INTEGER','sequelize','STRING','LOGIN,\x20PAUSE,\x20TALKING','DATE','diff'];(function(_0x2fc071,_0x261581){var _0x54c636=function(_0x5104e0){while(--_0x5104e0){_0x2fc071['push'](_0x2fc071['shift']());}};_0x54c636(++_0x261581);}(_0x4058,0x1c7));var _0x8405=function(_0x4c0770,_0x243df2){_0x4c0770=_0x4c0770-0x0;var _0x2b96c3=_0x4058[_0x4c0770];return _0x2b96c3;};'use strict';var Sequelize=require(_0x8405('0x0'));var moment=require('moment');module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x8405('0x1')]},'interface':{'type':Sequelize[_0x8405('0x1')]},'type':{'type':Sequelize[_0x8405('0x1')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x8405('0x2')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x8405('0x3')]},'exitAt':{'type':Sequelize[_0x8405('0x3')],'set':function(_0x54be9c){var _0x10d221=moment(_0x54be9c);var _0x63cfec=moment(this['getDataValue']('enterAt'));var _0x12e512=_0x10d221[_0x8405('0x4')](_0x63cfec,'seconds');this['setDataValue']('exitAt',_0x54be9c);this[_0x8405('0x5')]('duration',_0x12e512>=0x0?_0x12e512:null);}},'data1':{'type':Sequelize[_0x8405('0x1')],'comment':_0x8405('0x6')},'data2':{'type':Sequelize[_0x8405('0x1')],'comment':_0x8405('0x7')},'data3':{'type':Sequelize[_0x8405('0x1')],'comment':_0x8405('0x8')},'data4':{'type':Sequelize[_0x8405('0x1')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize['STRING'],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x8405('0x1')]},'internal':{'type':Sequelize[_0x8405('0x9')]},'uniqueid':{'type':Sequelize[_0x8405('0x1')]}}; \ No newline at end of file +var _0x2732=['exitAt','talk:[start]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','enterAt','diff','seconds','setDataValue'];(function(_0x2966d3,_0x255511){var _0x41c398=function(_0x39e1d7){while(--_0x39e1d7){_0x2966d3['push'](_0x2966d3['shift']());}};_0x41c398(++_0x255511);}(_0x2732,0x112));var _0x2273=function(_0x3ee615,_0x5c3d69){_0x3ee615=_0x3ee615-0x0;var _0x5cb70c=_0x2732[_0x3ee615];return _0x5cb70c;};'use strict';var Sequelize=require(_0x2273('0x0'));var moment=require(_0x2273('0x1'));module[_0x2273('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x2273('0x3')]},'interface':{'type':Sequelize[_0x2273('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x2273('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x2273('0x5')]},'enterAt':{'type':Sequelize[_0x2273('0x6')]},'exitAt':{'type':Sequelize[_0x2273('0x6')],'set':function(_0x2cf39){var _0x1bccde=moment(_0x2cf39);var _0x50d7ce=moment(this['getDataValue'](_0x2273('0x7')));var _0x18742b=_0x1bccde[_0x2273('0x8')](_0x50d7ce,_0x2273('0x9'));this[_0x2273('0xa')](_0x2273('0xb'),_0x2cf39);this[_0x2273('0xa')]('duration',_0x18742b>=0x0?_0x18742b:null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x2273('0x3')],'comment':_0x2273('0xc')},'data3':{'type':Sequelize[_0x2273('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x2273('0x3')],'comment':_0x2273('0xd')},'data5':{'type':Sequelize[_0x2273('0x3')],'comment':_0x2273('0xe')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x2273('0x5')]},'uniqueid':{'type':Sequelize[_0x2273('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index c68f936..040b20d 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 _0x9c44=['catch','params','find','create','body','describe','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','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0xca95cc,_0x36c638){var _0x30b888=function(_0x5ca4d0){while(--_0x5ca4d0){_0xca95cc['push'](_0xca95cc['shift']());}};_0x30b888(++_0x36c638);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'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={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file +var _0x9c44=['catch','params','find','create','body','describe','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','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x4bf54b,_0x371005){var _0x1d9705=function(_0x3d3f7c){while(--_0x3d3f7c){_0x4bf54b['push'](_0x4bf54b['shift']());}};_0x1d9705(++_0x371005);}(_0x9c44,0x178));var _0x49c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c44[_0x3dd15e];return _0x231fd0;};'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={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 3576d71..053d39e 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 _0x23c8=['path','rimraf','../../config/environment','exports','define','report_member','membername_interface','membername','interface','lodash','../../config/logger','bluebird','request-promise'];(function(_0x593752,_0xfc3827){var _0x4612be=function(_0x2d64c6){while(--_0x2d64c6){_0x593752['push'](_0x593752['shift']());}};_0x4612be(++_0xfc3827);}(_0x23c8,0x1d0));var _0x823c=function(_0x45ea86,_0x3d8dc1){_0x45ea86=_0x45ea86-0x0;var _0x200568=_0x23c8[_0x45ea86];return _0x200568;};'use strict';var _=require(_0x823c('0x0'));var util=require('util');var logger=require(_0x823c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x823c('0x2'));var rp=require(_0x823c('0x3'));var fs=require('fs');var path=require(_0x823c('0x4'));var rimraf=require(_0x823c('0x5'));var config=require(_0x823c('0x6'));var attributes=require('./memberReport.attributes');module[_0x823c('0x7')]=function(_0x42ca9e,_0x5dccd4){return _0x42ca9e[_0x823c('0x8')]('MemberReport',attributes,{'tableName':_0x823c('0x9'),'paranoid':![],'indexes':[{'name':_0x823c('0xa'),'fields':[_0x823c('0xb'),_0x823c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9fd8=['../../config/logger','api','request-promise','rimraf','../../config/environment','./memberReport.attributes','MemberReport','report_member','membername_interface','interface','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9fd8,0x18b));var _0x89fd=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9fd8[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x89fd('0x0'));var logger=require(_0x89fd('0x1'))(_0x89fd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x89fd('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x89fd('0x4'));var config=require(_0x89fd('0x5'));var attributes=require(_0x89fd('0x6'));module['exports']=function(_0x3effda,_0x5f4caa){return _0x3effda['define'](_0x89fd('0x7'),attributes,{'tableName':_0x89fd('0x8'),'paranoid':![],'indexes':[{'name':_0x89fd('0x9'),'fields':['membername',_0x89fd('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 3bc9bc7..7a9c137 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 _0xfa45=['MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','GetMemberReport','MemberReport','findAll','options','raw','where','limit','model','attributes','include','CreateMemberReport','create','UpdateMemberReport','body','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x5edf1e,_0x3031b8){var _0x380cda=function(_0x4c0cf3){while(--_0x4c0cf3){_0x5edf1e['push'](_0x5edf1e['shift']());}};_0x380cda(++_0x3031b8);}(_0xfa45,0x11b));var _0x5fa4=function(_0x31cef7,_0x3f8832){_0x31cef7=_0x31cef7-0x0;var _0x5a9f2f=_0xfa45[_0x31cef7];return _0x5a9f2f;};'use strict';var _=require(_0x5fa4('0x0'));var util=require(_0x5fa4('0x1'));var moment=require(_0x5fa4('0x2'));var BPromise=require(_0x5fa4('0x3'));var rs=require(_0x5fa4('0x4'));var fs=require('fs');var Redis=require(_0x5fa4('0x5'));var db=require(_0x5fa4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5fa4('0x7'))('rpc');var config=require(_0x5fa4('0x8'));var jayson=require(_0x5fa4('0x9'));var client=jayson[_0x5fa4('0xa')][_0x5fa4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28a266,_0x465a79,_0x298dce){return new BPromise(function(_0x108de1,_0xeb788d){return client[_0x5fa4('0xc')](_0x28a266,_0x298dce)['then'](function(_0x25d557){logger['info'](_0x5fa4('0xd'),_0x465a79,_0x5fa4('0xe'));logger[_0x5fa4('0xf')](_0x5fa4('0x10'),_0x465a79,_0x5fa4('0xe'),JSON[_0x5fa4('0x11')](_0x25d557));if(_0x25d557[_0x5fa4('0x12')]){if(_0x25d557[_0x5fa4('0x12')]['code']===0x1f4){logger[_0x5fa4('0x12')]('MemberReport,\x20%s,\x20%s',_0x465a79,_0x25d557[_0x5fa4('0x12')][_0x5fa4('0x13')]);return _0xeb788d(_0x25d557[_0x5fa4('0x12')][_0x5fa4('0x13')]);}logger[_0x5fa4('0x12')]('MemberReport,\x20%s,\x20%s',_0x465a79,_0x25d557[_0x5fa4('0x12')][_0x5fa4('0x13')]);return _0x108de1(_0x25d557['error'][_0x5fa4('0x13')]);}else{logger[_0x5fa4('0x14')]('MemberReport,\x20%s,\x20%s',_0x465a79,_0x5fa4('0xe'));_0x108de1(_0x25d557['result']['message']);}})[_0x5fa4('0x15')](function(_0x1645b1){logger[_0x5fa4('0x12')](_0x5fa4('0xd'),_0x465a79,_0x1645b1);_0xeb788d(_0x1645b1);});});}exports[_0x5fa4('0x16')]=function(_0x100a46){var _0x4a3924=this;return new Promise(function(_0x3d6380,_0x4ef44b){return db[_0x5fa4('0x17')][_0x5fa4('0x18')]({'raw':_0x100a46[_0x5fa4('0x19')]?_0x100a46[_0x5fa4('0x19')][_0x5fa4('0x1a')]===undefined?!![]:![]:!![],'where':_0x100a46[_0x5fa4('0x19')]?_0x100a46[_0x5fa4('0x19')][_0x5fa4('0x1b')]||null:null,'attributes':_0x100a46[_0x5fa4('0x19')]?_0x100a46[_0x5fa4('0x19')]['attributes']||null:null,'limit':_0x100a46['options']?_0x100a46[_0x5fa4('0x19')][_0x5fa4('0x1c')]||null:null,'include':_0x100a46[_0x5fa4('0x19')]?_0x100a46[_0x5fa4('0x19')]['include']?_['map'](_0x100a46[_0x5fa4('0x19')]['include'],function(_0xe63c6b){return{'model':db[_0xe63c6b[_0x5fa4('0x1d')]],'as':_0xe63c6b['as'],'attributes':_0xe63c6b[_0x5fa4('0x1e')],'include':_0xe63c6b[_0x5fa4('0x1f')]?_['map'](_0xe63c6b[_0x5fa4('0x1f')],function(_0x3d2abb){return{'model':db[_0x3d2abb[_0x5fa4('0x1d')]],'as':_0x3d2abb['as'],'attributes':_0x3d2abb[_0x5fa4('0x1e')],'include':_0x3d2abb['include']?_['map'](_0x3d2abb[_0x5fa4('0x1f')],function(_0x46a1d9){return{'model':db[_0x46a1d9[_0x5fa4('0x1d')]],'as':_0x46a1d9['as'],'attributes':_0x46a1d9[_0x5fa4('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34006f){logger[_0x5fa4('0x14')](_0x5fa4('0x16'),_0x100a46);logger[_0x5fa4('0xf')]('GetMemberReport',_0x100a46,JSON['stringify'](_0x34006f));_0x3d6380(_0x34006f);})[_0x5fa4('0x15')](function(_0x379fff){logger[_0x5fa4('0x12')](_0x5fa4('0x16'),_0x379fff['message'],_0x100a46);_0x4ef44b(_0x4a3924[_0x5fa4('0x12')](0x1f4,_0x379fff[_0x5fa4('0x13')]));});});};exports[_0x5fa4('0x20')]=function(_0x25ce24){var _0x1f6b19=this;return new Promise(function(_0x1764b6,_0x2c5397){return db[_0x5fa4('0x17')][_0x5fa4('0x21')](_0x25ce24['body'],{'raw':_0x25ce24[_0x5fa4('0x19')]?_0x25ce24[_0x5fa4('0x19')][_0x5fa4('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3b3f52){logger[_0x5fa4('0x14')](_0x5fa4('0x20'),_0x25ce24);logger[_0x5fa4('0xf')](_0x5fa4('0x20'),_0x25ce24,JSON[_0x5fa4('0x11')](_0x3b3f52));_0x1764b6(_0x3b3f52);})['catch'](function(_0x2f734f){logger[_0x5fa4('0x12')](_0x5fa4('0x20'),_0x2f734f[_0x5fa4('0x13')],_0x25ce24);_0x2c5397(_0x1f6b19[_0x5fa4('0x12')](0x1f4,_0x2f734f['message']));});});};exports[_0x5fa4('0x22')]=function(_0x2c31f8){var _0x51f03d=this;return new Promise(function(_0x254ec8,_0x508ff7){return db[_0x5fa4('0x17')]['update'](_0x2c31f8[_0x5fa4('0x23')],{'raw':_0x2c31f8[_0x5fa4('0x19')]?_0x2c31f8['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c31f8['options']?_0x2c31f8[_0x5fa4('0x19')][_0x5fa4('0x1b')]||null:null,'attributes':_0x2c31f8[_0x5fa4('0x19')]?_0x2c31f8[_0x5fa4('0x19')]['attributes']||null:null,'limit':_0x2c31f8['options']?_0x2c31f8[_0x5fa4('0x19')][_0x5fa4('0x1c')]||null:null})[_0x5fa4('0x24')](function(_0x54f7be){logger[_0x5fa4('0x14')](_0x5fa4('0x22'),_0x2c31f8);logger[_0x5fa4('0xf')]('UpdateMemberReport',_0x2c31f8,JSON[_0x5fa4('0x11')](_0x54f7be));_0x254ec8(_0x54f7be);})[_0x5fa4('0x15')](function(_0x519c75){logger[_0x5fa4('0x12')]('UpdateMemberReport',_0x519c75[_0x5fa4('0x13')],_0x2c31f8);_0x508ff7(_0x51f03d[_0x5fa4('0x12')](0x1f4,_0x519c75[_0x5fa4('0x13')]));});});}; \ No newline at end of file +var _0x1b64=['attributes','catch','CreateMemberReport','MemberReport','body','UpdateMemberReport','update','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','GetMemberReport','findAll','options','raw','where','limit','include','map','model'];(function(_0x3fdf02,_0x3799cb){var _0xfeaed0=function(_0x21995d){while(--_0x21995d){_0x3fdf02['push'](_0x3fdf02['shift']());}};_0xfeaed0(++_0x3799cb);}(_0x1b64,0x76));var _0x41b6=function(_0x55bf4e,_0x54c43d){_0x55bf4e=_0x55bf4e-0x0;var _0x2872ec=_0x1b64[_0x55bf4e];return _0x2872ec;};'use strict';var _=require(_0x41b6('0x0'));var util=require(_0x41b6('0x1'));var moment=require('moment');var BPromise=require(_0x41b6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x41b6('0x3'));var logger=require(_0x41b6('0x4'))(_0x41b6('0x5'));var config=require(_0x41b6('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x41b6('0x7')][_0x41b6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5775c8,_0x56bd45,_0x4bb579){return new BPromise(function(_0x7763c3,_0x3cc6f8){return client[_0x41b6('0x9')](_0x5775c8,_0x4bb579)[_0x41b6('0xa')](function(_0x477e12){logger[_0x41b6('0xb')]('MemberReport,\x20%s,\x20%s',_0x56bd45,_0x41b6('0xc'));logger[_0x41b6('0xd')](_0x41b6('0xe'),_0x56bd45,_0x41b6('0xc'),JSON[_0x41b6('0xf')](_0x477e12));if(_0x477e12[_0x41b6('0x10')]){if(_0x477e12[_0x41b6('0x10')][_0x41b6('0x11')]===0x1f4){logger[_0x41b6('0x10')](_0x41b6('0x12'),_0x56bd45,_0x477e12[_0x41b6('0x10')][_0x41b6('0x13')]);return _0x3cc6f8(_0x477e12['error'][_0x41b6('0x13')]);}logger[_0x41b6('0x10')](_0x41b6('0x12'),_0x56bd45,_0x477e12[_0x41b6('0x10')]['message']);return _0x7763c3(_0x477e12[_0x41b6('0x10')][_0x41b6('0x13')]);}else{logger[_0x41b6('0xb')](_0x41b6('0x12'),_0x56bd45,_0x41b6('0xc'));_0x7763c3(_0x477e12[_0x41b6('0x14')][_0x41b6('0x13')]);}})['catch'](function(_0x13ce57){logger[_0x41b6('0x10')](_0x41b6('0x12'),_0x56bd45,_0x13ce57);_0x3cc6f8(_0x13ce57);});});}exports[_0x41b6('0x15')]=function(_0x14a786){var _0x47feb9=this;return new Promise(function(_0x5637f6,_0x482baa){return db['MemberReport'][_0x41b6('0x16')]({'raw':_0x14a786['options']?_0x14a786[_0x41b6('0x17')][_0x41b6('0x18')]===undefined?!![]:![]:!![],'where':_0x14a786[_0x41b6('0x17')]?_0x14a786[_0x41b6('0x17')][_0x41b6('0x19')]||null:null,'attributes':_0x14a786[_0x41b6('0x17')]?_0x14a786['options']['attributes']||null:null,'limit':_0x14a786[_0x41b6('0x17')]?_0x14a786['options'][_0x41b6('0x1a')]||null:null,'include':_0x14a786[_0x41b6('0x17')]?_0x14a786[_0x41b6('0x17')][_0x41b6('0x1b')]?_[_0x41b6('0x1c')](_0x14a786[_0x41b6('0x17')][_0x41b6('0x1b')],function(_0x11cc02){return{'model':db[_0x11cc02[_0x41b6('0x1d')]],'as':_0x11cc02['as'],'attributes':_0x11cc02[_0x41b6('0x1e')],'include':_0x11cc02[_0x41b6('0x1b')]?_['map'](_0x11cc02[_0x41b6('0x1b')],function(_0x2c1290){return{'model':db[_0x2c1290['model']],'as':_0x2c1290['as'],'attributes':_0x2c1290[_0x41b6('0x1e')],'include':_0x2c1290[_0x41b6('0x1b')]?_['map'](_0x2c1290[_0x41b6('0x1b')],function(_0x454b5f){return{'model':db[_0x454b5f[_0x41b6('0x1d')]],'as':_0x454b5f['as'],'attributes':_0x454b5f['attributes']};}):[]};}):[]};}):[]:[]})[_0x41b6('0xa')](function(_0x5e431d){logger['info']('GetMemberReport',_0x14a786);logger[_0x41b6('0xd')](_0x41b6('0x15'),_0x14a786,JSON['stringify'](_0x5e431d));_0x5637f6(_0x5e431d);})[_0x41b6('0x1f')](function(_0x45f9e2){logger[_0x41b6('0x10')](_0x41b6('0x15'),_0x45f9e2[_0x41b6('0x13')],_0x14a786);_0x482baa(_0x47feb9['error'](0x1f4,_0x45f9e2['message']));});});};exports[_0x41b6('0x20')]=function(_0x37bd7a){var _0x14e54b=this;return new Promise(function(_0x56b365,_0x626c53){return db[_0x41b6('0x21')]['create'](_0x37bd7a[_0x41b6('0x22')],{'raw':_0x37bd7a[_0x41b6('0x17')]?_0x37bd7a[_0x41b6('0x17')][_0x41b6('0x18')]===undefined?!![]:![]:!![]})[_0x41b6('0xa')](function(_0x2ac3a7){logger[_0x41b6('0xb')]('CreateMemberReport',_0x37bd7a);logger[_0x41b6('0xd')]('CreateMemberReport',_0x37bd7a,JSON['stringify'](_0x2ac3a7));_0x56b365(_0x2ac3a7);})[_0x41b6('0x1f')](function(_0x4cf4d5){logger[_0x41b6('0x10')](_0x41b6('0x20'),_0x4cf4d5[_0x41b6('0x13')],_0x37bd7a);_0x626c53(_0x14e54b[_0x41b6('0x10')](0x1f4,_0x4cf4d5[_0x41b6('0x13')]));});});};exports[_0x41b6('0x23')]=function(_0x420e40){var _0x2e335a=this;return new Promise(function(_0x486709,_0x457e50){return db[_0x41b6('0x21')][_0x41b6('0x24')](_0x420e40[_0x41b6('0x22')],{'raw':_0x420e40[_0x41b6('0x17')]?_0x420e40[_0x41b6('0x17')][_0x41b6('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x420e40['options']?_0x420e40[_0x41b6('0x17')]['where']||null:null,'attributes':_0x420e40['options']?_0x420e40[_0x41b6('0x17')][_0x41b6('0x1e')]||null:null,'limit':_0x420e40[_0x41b6('0x17')]?_0x420e40[_0x41b6('0x17')][_0x41b6('0x1a')]||null:null})[_0x41b6('0xa')](function(_0x5b7e9d){logger[_0x41b6('0xb')](_0x41b6('0x23'),_0x420e40);logger[_0x41b6('0xd')](_0x41b6('0x23'),_0x420e40,JSON[_0x41b6('0xf')](_0x5b7e9d));_0x486709(_0x5b7e9d);})[_0x41b6('0x1f')](function(_0x434281){logger['error'](_0x41b6('0x23'),_0x434281[_0x41b6('0x13')],_0x420e40);_0x457e50(_0x2e335a[_0x41b6('0x10')](0x1f4,_0x434281[_0x41b6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index bacd345..ae14005 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 _0x090b=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./migration.controller','get','multer','path'];(function(_0x26d9c3,_0x109299){var _0x161a61=function(_0x3d9d53){while(--_0x3d9d53){_0x26d9c3['push'](_0x26d9c3['shift']());}};_0x161a61(++_0x109299);}(_0x090b,0x13e));var _0xb090=function(_0x448500,_0x3c9399){_0x448500=_0x448500-0x0;var _0x556e77=_0x090b[_0x448500];return _0x556e77;};'use strict';var multer=require(_0xb090('0x0'));var util=require('util');var path=require(_0xb090('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb090('0x2')]();var fs_extra=require(_0xb090('0x3'));var auth=require(_0xb090('0x4'));var interaction=require(_0xb090('0x5'));var config=require('../../config/environment');var controller=require(_0xb090('0x6'));router[_0xb090('0x7')]('/',controller['index']);module['exports']=router; \ No newline at end of file +var _0xab7a=['../../components/interaction/service','./migration.controller','get','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x598a58,_0x232f82){var _0x32fff7=function(_0x3c6894){while(--_0x3c6894){_0x598a58['push'](_0x598a58['shift']());}};_0x32fff7(++_0x232f82);}(_0xab7a,0xff));var _0xaab7=function(_0x5dc9ec,_0x407af4){_0x5dc9ec=_0x5dc9ec-0x0;var _0x5b4cdb=_0xab7a[_0x5dc9ec];return _0x5b4cdb;};'use strict';var multer=require('multer');var util=require(_0xaab7('0x0'));var path=require(_0xaab7('0x1'));var timeout=require(_0xaab7('0x2'));var express=require(_0xaab7('0x3'));var router=express['Router']();var fs_extra=require(_0xaab7('0x4'));var auth=require(_0xaab7('0x5'));var interaction=require(_0xaab7('0x6'));var config=require('../../config/environment');var controller=require(_0xaab7('0x7'));router[_0xaab7('0x8')]('/',controller['index']);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index f4127d7..117e45a 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 _0xe5d6=['STRING','sequelize','exports'];(function(_0x278285,_0x106186){var _0x2dc939=function(_0x3f1c39){while(--_0x3f1c39){_0x278285['push'](_0x278285['shift']());}};_0x2dc939(++_0x106186);}(_0xe5d6,0x1cf));var _0x6e5d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xe5d6[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x6e5d('0x0'));module[_0x6e5d('0x1')]={'version':{'type':Sequelize[_0x6e5d('0x2')],'unique':'version'}}; \ No newline at end of file +var _0xac29=['exports','STRING','version','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac29,0x1a3));var _0x9ac2=function(_0x1a4e60,_0x5f5bea){_0x1a4e60=_0x1a4e60-0x0;var _0x1a17f5=_0xac29[_0x1a4e60];return _0x1a17f5;};'use strict';var Sequelize=require(_0x9ac2('0x0'));module[_0x9ac2('0x1')]={'version':{'type':Sequelize[_0x9ac2('0x2')],'unique':_0x9ac2('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 8478245..80711c3 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 _0x94c2=['error','stack','name','send','index','map','Migration','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','limit','set','apply','save','update','destroy','then'];(function(_0x567e4d,_0x59a3e1){var _0x276e5f=function(_0x20012f){while(--_0x20012f){_0x567e4d['push'](_0x567e4d['shift']());}};_0x276e5f(++_0x59a3e1);}(_0x94c2,0xaa));var _0x294c=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x94c2[_0x255d5b];return _0x3e141a;};'use strict';var emlformat=require(_0x294c('0x0'));var rimraf=require(_0x294c('0x1'));var zipdir=require(_0x294c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x294c('0x3'));var moment=require(_0x294c('0x4'));var BPromise=require(_0x294c('0x5'));var Mustache=require('mustache');var util=require(_0x294c('0x6'));var path=require(_0x294c('0x7'));var sox=require(_0x294c('0x8'));var csv=require('to-csv');var ejs=require(_0x294c('0x9'));var fs=require('fs');var fs_extra=require(_0x294c('0xa'));var _=require(_0x294c('0xb'));var squel=require(_0x294c('0xc'));var crypto=require(_0x294c('0xd'));var jsforce=require(_0x294c('0xe'));var deskjs=require(_0x294c('0xf'));var toCsv=require(_0x294c('0x10'));var querystring=require(_0x294c('0x11'));var Papa=require(_0x294c('0x12'));var Redis=require(_0x294c('0x13'));var authService=require(_0x294c('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x294c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x294c('0x16'));var utils=require(_0x294c('0x17'));var config=require(_0x294c('0x18'));var licenseUtil=require(_0x294c('0x19'));var db=require(_0x294c('0x1a'))['db'];function respondWithStatusCode(_0x208969,_0x261386){_0x261386=_0x261386||0xcc;return function(_0x20a0e0){if(_0x20a0e0){return _0x208969[_0x294c('0x1b')](_0x261386);}return _0x208969[_0x294c('0x1c')](_0x261386)[_0x294c('0x1d')]();};}function respondWithResult(_0x16480d,_0x28804b){_0x28804b=_0x28804b||0xc8;return function(_0x272fef){if(_0x272fef){return _0x16480d['status'](_0x28804b)[_0x294c('0x1e')](_0x272fef);}};}function respondWithFilteredResult(_0x285c99,_0x4ee725){return function(_0x233738){if(_0x233738){var _0x4ace81=typeof _0x4ee725['offset']==='undefined'&&typeof _0x4ee725['limit']===_0x294c('0x1f');var _0x5f2b3d=_0x233738[_0x294c('0x20')];var _0x2168f9=_0x4ace81?0x0:_0x4ee725['offset'];var _0x3cc05f=_0x4ace81?_0x233738[_0x294c('0x20')]:_0x4ee725['offset']+_0x4ee725[_0x294c('0x21')];var _0x5003c6;if(_0x3cc05f>=_0x5f2b3d){_0x3cc05f=_0x5f2b3d;_0x5003c6=0xc8;}else{_0x5003c6=0xce;}_0x285c99[_0x294c('0x1c')](_0x5003c6);return _0x285c99[_0x294c('0x22')]('Content-Range',_0x2168f9+'-'+_0x3cc05f+'/'+_0x5f2b3d)['json'](_0x233738);}return null;};}function patchUpdates(_0x5a8beb){return function(_0x5503b4){try{jsonpatch[_0x294c('0x23')](_0x5503b4,_0x5a8beb,!![]);}catch(_0x3692c1){return BPromise['reject'](_0x3692c1);}return _0x5503b4[_0x294c('0x24')]();};}function saveUpdates(_0x560380,_0x3b1d5a){return function(_0x598fd5){if(_0x598fd5){return _0x598fd5[_0x294c('0x25')](_0x560380)['then'](function(_0x3cad90){return _0x3cad90;});}return null;};}function removeEntity(_0x13fa92,_0x197408){return function(_0x246b56){if(_0x246b56){return _0x246b56[_0x294c('0x26')]()[_0x294c('0x27')](function(){_0x13fa92['status'](0xcc)[_0x294c('0x1d')]();});}};}function handleEntityNotFound(_0x3530b8,_0x15fa21){return function(_0x26c202){if(!_0x26c202){_0x3530b8['sendStatus'](0x194);}return _0x26c202;};}function handleError(_0x50596d,_0x5ed51e){_0x5ed51e=_0x5ed51e||0x1f4;return function(_0x4f6d35){logger[_0x294c('0x28')](_0x4f6d35[_0x294c('0x29')]);if(_0x4f6d35['name']){delete _0x4f6d35[_0x294c('0x2a')];}_0x50596d[_0x294c('0x1c')](_0x5ed51e)[_0x294c('0x2b')](_0x4f6d35);};}exports[_0x294c('0x2c')]=function(_0x1472bc,_0xcda5ff){var _0x3096bb={},_0x411191={},_0x3a8c1b={'count':0x0,'rows':[]};var _0x500632=_[_0x294c('0x2d')](db[_0x294c('0x2e')]['rawAttributes'],function(_0x18c47d){return{'name':_0x18c47d[_0x294c('0x2f')],'type':_0x18c47d[_0x294c('0x30')]['key']};});_0x411191[_0x294c('0x31')]=_[_0x294c('0x2d')](_0x500632,'name');_0x411191[_0x294c('0x32')]=_[_0x294c('0x33')](_0x1472bc['query']);_0x411191[_0x294c('0x34')]=_[_0x294c('0x35')](_0x411191[_0x294c('0x31')],_0x411191[_0x294c('0x32')]);_0x3096bb[_0x294c('0x36')]=_[_0x294c('0x35')](_0x411191[_0x294c('0x31')],qs[_0x294c('0x37')](_0x1472bc[_0x294c('0x32')]['fields']));_0x3096bb[_0x294c('0x36')]=_0x3096bb['attributes'][_0x294c('0x38')]?_0x3096bb['attributes']:_0x411191[_0x294c('0x31')];if(!_0x1472bc['query']['hasOwnProperty'](_0x294c('0x39'))){_0x3096bb['limit']=qs['limit'](_0x1472bc[_0x294c('0x32')][_0x294c('0x21')]);_0x3096bb[_0x294c('0x3a')]=qs[_0x294c('0x3a')](_0x1472bc['query'][_0x294c('0x3a')]);}_0x3096bb[_0x294c('0x3b')]=qs[_0x294c('0x3c')](_0x1472bc[_0x294c('0x32')][_0x294c('0x3c')]);_0x3096bb[_0x294c('0x3d')]=qs[_0x294c('0x34')](_[_0x294c('0x3e')](_0x1472bc[_0x294c('0x32')],_0x411191[_0x294c('0x34')]),_0x500632);if(_0x1472bc[_0x294c('0x32')][_0x294c('0x3f')]){_0x3096bb[_0x294c('0x3d')]=_[_0x294c('0x40')](_0x3096bb['where'],{'$or':_[_0x294c('0x2d')](_0x500632,function(_0xcad8d2){if(_0xcad8d2[_0x294c('0x30')]!==_0x294c('0x41')){var _0xc81e7={};_0xc81e7[_0xcad8d2[_0x294c('0x2a')]]={'$like':'%'+_0x1472bc['query'][_0x294c('0x3f')]+'%'};return _0xc81e7;}})});}_0x3096bb=_['merge']({},_0x3096bb,_0x1472bc['options']);var _0x2dd387={'where':_0x3096bb['where']};return db[_0x294c('0x2e')][_0x294c('0x20')](_0x2dd387)[_0x294c('0x27')](function(_0x2bc4de){_0x3a8c1b[_0x294c('0x20')]=_0x2bc4de;if(_0x1472bc[_0x294c('0x32')][_0x294c('0x42')]){_0x3096bb['include']=[{'all':!![]}];}return db['Migration'][_0x294c('0x43')](_0x3096bb);})[_0x294c('0x27')](function(_0x2e836b){_0x3a8c1b[_0x294c('0x44')]=_0x2e836b;return _0x3a8c1b;})[_0x294c('0x27')](respondWithFilteredResult(_0xcda5ff,_0x3096bb))[_0x294c('0x45')](handleError(_0xcda5ff,null));}; \ No newline at end of file +var _0x9d7a=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','rows','catch','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','Migration','rawAttributes','fieldName'];(function(_0x322e51,_0x5e3261){var _0x1cbec9=function(_0x1399b2){while(--_0x1399b2){_0x322e51['push'](_0x322e51['shift']());}};_0x1cbec9(++_0x5e3261);}(_0x9d7a,0x18a));var _0xa9d7=function(_0x3944c1,_0x4cd2e2){_0x3944c1=_0x3944c1-0x0;var _0x275231=_0x9d7a[_0x3944c1];return _0x275231;};'use strict';var emlformat=require(_0xa9d7('0x0'));var rimraf=require(_0xa9d7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa9d7('0x2'));var moment=require(_0xa9d7('0x3'));var BPromise=require(_0xa9d7('0x4'));var Mustache=require(_0xa9d7('0x5'));var util=require(_0xa9d7('0x6'));var path=require(_0xa9d7('0x7'));var sox=require(_0xa9d7('0x8'));var csv=require('to-csv');var ejs=require(_0xa9d7('0x9'));var fs=require('fs');var fs_extra=require(_0xa9d7('0xa'));var _=require(_0xa9d7('0xb'));var squel=require(_0xa9d7('0xc'));var crypto=require(_0xa9d7('0xd'));var jsforce=require(_0xa9d7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa9d7('0xf'));var querystring=require(_0xa9d7('0x10'));var Papa=require(_0xa9d7('0x11'));var Redis=require(_0xa9d7('0x12'));var authService=require(_0xa9d7('0x13'));var qs=require(_0xa9d7('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa9d7('0x15'));var logger=require(_0xa9d7('0x16'))(_0xa9d7('0x17'));var utils=require(_0xa9d7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa9d7('0x19'));var db=require(_0xa9d7('0x1a'))['db'];function respondWithStatusCode(_0x49b9b9,_0x1d532a){_0x1d532a=_0x1d532a||0xcc;return function(_0x27ae3f){if(_0x27ae3f){return _0x49b9b9['sendStatus'](_0x1d532a);}return _0x49b9b9[_0xa9d7('0x1b')](_0x1d532a)[_0xa9d7('0x1c')]();};}function respondWithResult(_0x25a99a,_0x12b3f4){_0x12b3f4=_0x12b3f4||0xc8;return function(_0x379a2d){if(_0x379a2d){return _0x25a99a[_0xa9d7('0x1b')](_0x12b3f4)['json'](_0x379a2d);}};}function respondWithFilteredResult(_0x237b41,_0x3298e3){return function(_0x3aafe2){if(_0x3aafe2){var _0x500c3f=typeof _0x3298e3[_0xa9d7('0x1d')]===_0xa9d7('0x1e')&&typeof _0x3298e3['limit']===_0xa9d7('0x1e');var _0x1bcf6a=_0x3aafe2[_0xa9d7('0x1f')];var _0x5ea960=_0x500c3f?0x0:_0x3298e3['offset'];var _0x1e23cd=_0x500c3f?_0x3aafe2[_0xa9d7('0x1f')]:_0x3298e3[_0xa9d7('0x1d')]+_0x3298e3['limit'];var _0x1ff575;if(_0x1e23cd>=_0x1bcf6a){_0x1e23cd=_0x1bcf6a;_0x1ff575=0xc8;}else{_0x1ff575=0xce;}_0x237b41[_0xa9d7('0x1b')](_0x1ff575);return _0x237b41[_0xa9d7('0x20')](_0xa9d7('0x21'),_0x5ea960+'-'+_0x1e23cd+'/'+_0x1bcf6a)[_0xa9d7('0x22')](_0x3aafe2);}return null;};}function patchUpdates(_0x4d41d3){return function(_0x5a1c68){try{jsonpatch[_0xa9d7('0x23')](_0x5a1c68,_0x4d41d3,!![]);}catch(_0x3102e6){return BPromise[_0xa9d7('0x24')](_0x3102e6);}return _0x5a1c68[_0xa9d7('0x25')]();};}function saveUpdates(_0x327f39,_0x5effd7){return function(_0x5d22c7){if(_0x5d22c7){return _0x5d22c7[_0xa9d7('0x26')](_0x327f39)[_0xa9d7('0x27')](function(_0x489afb){return _0x489afb;});}return null;};}function removeEntity(_0x28e3c4,_0x1d0678){return function(_0x3acd06){if(_0x3acd06){return _0x3acd06[_0xa9d7('0x28')]()[_0xa9d7('0x27')](function(){_0x28e3c4[_0xa9d7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x930a59,_0x165c74){return function(_0xe1ec8d){if(!_0xe1ec8d){_0x930a59[_0xa9d7('0x29')](0x194);}return _0xe1ec8d;};}function handleError(_0x4f912a,_0x16ef96){_0x16ef96=_0x16ef96||0x1f4;return function(_0x3b9816){logger[_0xa9d7('0x2a')](_0x3b9816[_0xa9d7('0x2b')]);if(_0x3b9816['name']){delete _0x3b9816[_0xa9d7('0x2c')];}_0x4f912a[_0xa9d7('0x1b')](_0x16ef96)[_0xa9d7('0x2d')](_0x3b9816);};}exports['index']=function(_0x544d49,_0x2e3ba1){var _0x2d92be={},_0x26a78a={},_0x462d78={'count':0x0,'rows':[]};var _0x488459=_[_0xa9d7('0x2e')](db[_0xa9d7('0x2f')][_0xa9d7('0x30')],function(_0x5e342c){return{'name':_0x5e342c[_0xa9d7('0x31')],'type':_0x5e342c['type'][_0xa9d7('0x32')]};});_0x26a78a[_0xa9d7('0x33')]=_[_0xa9d7('0x2e')](_0x488459,_0xa9d7('0x2c'));_0x26a78a[_0xa9d7('0x34')]=_[_0xa9d7('0x35')](_0x544d49[_0xa9d7('0x34')]);_0x26a78a[_0xa9d7('0x36')]=_[_0xa9d7('0x37')](_0x26a78a[_0xa9d7('0x33')],_0x26a78a[_0xa9d7('0x34')]);_0x2d92be[_0xa9d7('0x38')]=_[_0xa9d7('0x37')](_0x26a78a[_0xa9d7('0x33')],qs[_0xa9d7('0x39')](_0x544d49[_0xa9d7('0x34')][_0xa9d7('0x39')]));_0x2d92be[_0xa9d7('0x38')]=_0x2d92be['attributes'][_0xa9d7('0x3a')]?_0x2d92be[_0xa9d7('0x38')]:_0x26a78a[_0xa9d7('0x33')];if(!_0x544d49[_0xa9d7('0x34')][_0xa9d7('0x3b')](_0xa9d7('0x3c'))){_0x2d92be[_0xa9d7('0x3d')]=qs[_0xa9d7('0x3d')](_0x544d49[_0xa9d7('0x34')][_0xa9d7('0x3d')]);_0x2d92be[_0xa9d7('0x1d')]=qs['offset'](_0x544d49[_0xa9d7('0x34')][_0xa9d7('0x1d')]);}_0x2d92be['order']=qs[_0xa9d7('0x3e')](_0x544d49[_0xa9d7('0x34')][_0xa9d7('0x3e')]);_0x2d92be['where']=qs['filters'](_[_0xa9d7('0x3f')](_0x544d49['query'],_0x26a78a[_0xa9d7('0x36')]),_0x488459);if(_0x544d49[_0xa9d7('0x34')][_0xa9d7('0x40')]){_0x2d92be[_0xa9d7('0x41')]=_[_0xa9d7('0x42')](_0x2d92be['where'],{'$or':_[_0xa9d7('0x2e')](_0x488459,function(_0x5441bc){if(_0x5441bc[_0xa9d7('0x43')]!=='VIRTUAL'){var _0x5aff3c={};_0x5aff3c[_0x5441bc[_0xa9d7('0x2c')]]={'$like':'%'+_0x544d49['query'][_0xa9d7('0x40')]+'%'};return _0x5aff3c;}})});}_0x2d92be=_[_0xa9d7('0x42')]({},_0x2d92be,_0x544d49[_0xa9d7('0x44')]);var _0x298fab={'where':_0x2d92be[_0xa9d7('0x41')]};return db[_0xa9d7('0x2f')][_0xa9d7('0x1f')](_0x298fab)['then'](function(_0x2e2861){_0x462d78[_0xa9d7('0x1f')]=_0x2e2861;if(_0x544d49[_0xa9d7('0x34')][_0xa9d7('0x45')]){_0x2d92be[_0xa9d7('0x46')]=[{'all':!![]}];}return db[_0xa9d7('0x2f')][_0xa9d7('0x47')](_0x2d92be);})['then'](function(_0x42605b){_0x462d78[_0xa9d7('0x48')]=_0x42605b;return _0x462d78;})[_0xa9d7('0x27')](respondWithFilteredResult(_0x2e3ba1,_0x2d92be))[_0xa9d7('0x49')](handleError(_0x2e3ba1,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 8fcf434..29179c2 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 _0x2c43=['request-promise','rimraf','./migration.attributes','Migration','migrations','lodash','../../config/logger','api','moment','bluebird'];(function(_0x105939,_0x28d6aa){var _0x2b44b5=function(_0xa34bb1){while(--_0xa34bb1){_0x105939['push'](_0x105939['shift']());}};_0x2b44b5(++_0x28d6aa);}(_0x2c43,0x195));var _0x32c4=function(_0x5d7cfe,_0x5735c4){_0x5d7cfe=_0x5d7cfe-0x0;var _0x1ccb1b=_0x2c43[_0x5d7cfe];return _0x1ccb1b;};'use strict';var _=require(_0x32c4('0x0'));var util=require('util');var logger=require(_0x32c4('0x1'))(_0x32c4('0x2'));var moment=require(_0x32c4('0x3'));var BPromise=require(_0x32c4('0x4'));var rp=require(_0x32c4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x32c4('0x6'));var config=require('../../config/environment');var attributes=require(_0x32c4('0x7'));module['exports']=function(_0x3c1e62,_0x1fda3d){return _0x3c1e62['define'](_0x32c4('0x8'),attributes,{'tableName':_0x32c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcdde=['migrations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./migration.attributes','exports'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xcdde,0x177));var _0xecdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdde[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xecdd('0x0'));var util=require('util');var logger=require(_0xecdd('0x1'))(_0xecdd('0x2'));var moment=require(_0xecdd('0x3'));var BPromise=require(_0xecdd('0x4'));var rp=require(_0xecdd('0x5'));var fs=require('fs');var path=require(_0xecdd('0x6'));var rimraf=require('rimraf');var config=require(_0xecdd('0x7'));var attributes=require(_0xecdd('0x8'));module[_0xecdd('0x9')]=function(_0x3812fb,_0x115580){return _0x3812fb['define']('Migration',attributes,{'tableName':_0xecdd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index a6ede95..54a9628 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 _0x6f0d=['Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','Migration,\x20%s,\x20%s','request\x20sent'];(function(_0x136e56,_0x29105e){var _0x375a48=function(_0x3fe3da){while(--_0x3fe3da){_0x136e56['push'](_0x136e56['shift']());}};_0x375a48(++_0x29105e);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x48b02c,_0x2b365c){_0x48b02c=_0x48b02c-0x0;var _0xef40ea=_0x6f0d[_0x48b02c];return _0xef40ea;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var moment=require(_0xd6f0('0x1'));var BPromise=require(_0xd6f0('0x2'));var rs=require(_0xd6f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6f0('0x4'))['db'];var utils=require(_0xd6f0('0x5'));var logger=require(_0xd6f0('0x6'))(_0xd6f0('0x7'));var config=require(_0xd6f0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd6f0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe21ac4,_0x1af29c,_0x8b89a9){return new BPromise(function(_0x1a48a0,_0x4c4916){return client['request'](_0xe21ac4,_0x8b89a9)[_0xd6f0('0xa')](function(_0x272c4e){logger[_0xd6f0('0xb')](_0xd6f0('0xc'),_0x1af29c,_0xd6f0('0xd'));logger['debug'](_0xd6f0('0xe'),_0x1af29c,_0xd6f0('0xd'),JSON[_0xd6f0('0xf')](_0x272c4e));if(_0x272c4e[_0xd6f0('0x10')]){if(_0x272c4e['error'][_0xd6f0('0x11')]===0x1f4){logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x272c4e[_0xd6f0('0x10')][_0xd6f0('0x12')]);return _0x4c4916(_0x272c4e[_0xd6f0('0x10')][_0xd6f0('0x12')]);}logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x272c4e['error'][_0xd6f0('0x12')]);return _0x1a48a0(_0x272c4e[_0xd6f0('0x10')]['message']);}else{logger[_0xd6f0('0xb')]('Migration,\x20%s,\x20%s',_0x1af29c,_0xd6f0('0xd'));_0x1a48a0(_0x272c4e[_0xd6f0('0x13')][_0xd6f0('0x12')]);}})[_0xd6f0('0x14')](function(_0x64ff5f){logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x64ff5f);_0x4c4916(_0x64ff5f);});});} \ No newline at end of file +var _0xee4f=['Migration,\x20%s,\x20%s','message','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','client','then','info','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x4d8808,_0x598d58){var _0x49a099=function(_0x9eea50){while(--_0x9eea50){_0x4d8808['push'](_0x4d8808['shift']());}};_0x49a099(++_0x598d58);}(_0xee4f,0xad));var _0xfee4=function(_0xe92a5f,_0x3084b3){_0xe92a5f=_0xe92a5f-0x0;var _0x2dbbd7=_0xee4f[_0xe92a5f];return _0x2dbbd7;};'use strict';var _=require(_0xfee4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfee4('0x1'));var rs=require(_0xfee4('0x2'));var fs=require('fs');var Redis=require(_0xfee4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfee4('0x4'));var logger=require('../../config/logger')(_0xfee4('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfee4('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52fb6b,_0x2fb1b3,_0x16cc9a){return new BPromise(function(_0x34908a,_0x4d3c71){return client['request'](_0x52fb6b,_0x16cc9a)[_0xfee4('0x7')](function(_0x11556d){logger[_0xfee4('0x8')]('Migration,\x20%s,\x20%s',_0x2fb1b3,'request\x20sent');logger[_0xfee4('0x9')](_0xfee4('0xa'),_0x2fb1b3,_0xfee4('0xb'),JSON['stringify'](_0x11556d));if(_0x11556d[_0xfee4('0xc')]){if(_0x11556d[_0xfee4('0xc')][_0xfee4('0xd')]===0x1f4){logger[_0xfee4('0xc')](_0xfee4('0xe'),_0x2fb1b3,_0x11556d[_0xfee4('0xc')][_0xfee4('0xf')]);return _0x4d3c71(_0x11556d['error'][_0xfee4('0xf')]);}logger[_0xfee4('0xc')]('Migration,\x20%s,\x20%s',_0x2fb1b3,_0x11556d[_0xfee4('0xc')][_0xfee4('0xf')]);return _0x34908a(_0x11556d[_0xfee4('0xc')][_0xfee4('0xf')]);}else{logger[_0xfee4('0x8')](_0xfee4('0xe'),_0x2fb1b3,_0xfee4('0xb'));_0x34908a(_0x11556d['result'][_0xfee4('0xf')]);}})[_0xfee4('0x10')](function(_0x437979){logger['error'](_0xfee4('0xe'),_0x2fb1b3,_0x437979);_0x4d3c71(_0x437979);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index c35e070..7055c37 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 _0xbdbe=['./network.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/interaction/service'];(function(_0x54aea6,_0x380675){var _0x4219e7=function(_0xde2945){while(--_0xde2945){_0x54aea6['push'](_0x54aea6['shift']());}};_0x4219e7(++_0x380675);}(_0xbdbe,0x1f3));var _0xebdb=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xbdbe[_0x5c2e3e];return _0x53f64a;};'use strict';var multer=require(_0xebdb('0x0'));var util=require('util');var path=require(_0xebdb('0x1'));var timeout=require('connect-timeout');var express=require(_0xebdb('0x2'));var router=express['Router']();var fs_extra=require(_0xebdb('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xebdb('0x4'));var config=require('../../config/environment');var controller=require(_0xebdb('0x5'));router['get']('/',auth[_0xebdb('0x6')](),controller[_0xebdb('0x7')]);router[_0xebdb('0x8')](_0xebdb('0x9'),auth[_0xebdb('0x6')](),controller[_0xebdb('0xa')]);router[_0xebdb('0xb')]('/',auth[_0xebdb('0x6')](),controller[_0xebdb('0xc')]);router[_0xebdb('0xd')](_0xebdb('0x9'),auth['isAuthenticated'](),controller[_0xebdb('0xe')]);router[_0xebdb('0xf')]('/:id',auth[_0xebdb('0x6')](),controller[_0xebdb('0x10')]);module[_0xebdb('0x11')]=router; \ No newline at end of file +var _0x6af6=['../../components/interaction/service','../../config/environment','./network.controller','get','index','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x5dda0e,_0x306c23){var _0x19c2af=function(_0x377503){while(--_0x377503){_0x5dda0e['push'](_0x5dda0e['shift']());}};_0x19c2af(++_0x306c23);}(_0x6af6,0x176));var _0x66af=function(_0x1b4286,_0x17b119){_0x1b4286=_0x1b4286-0x0;var _0x45be6e=_0x6af6[_0x1b4286];return _0x45be6e;};'use strict';var multer=require(_0x66af('0x0'));var util=require(_0x66af('0x1'));var path=require(_0x66af('0x2'));var timeout=require(_0x66af('0x3'));var express=require(_0x66af('0x4'));var router=express['Router']();var fs_extra=require(_0x66af('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x66af('0x6'));var config=require(_0x66af('0x7'));var controller=require(_0x66af('0x8'));router[_0x66af('0x9')]('/',auth['isAuthenticated'](),controller[_0x66af('0xa')]);router['get'](_0x66af('0xb'),auth[_0x66af('0xc')](),controller[_0x66af('0xd')]);router[_0x66af('0xe')]('/',auth[_0x66af('0xc')](),controller['create']);router[_0x66af('0xf')](_0x66af('0xb'),auth[_0x66af('0xc')](),controller[_0x66af('0x10')]);router[_0x66af('0x11')](_0x66af('0xb'),auth[_0x66af('0xc')](),controller[_0x66af('0x12')]);module[_0x66af('0x13')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index fca3c58..6b496cb 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 _0x8279=['STRING','sequelize','exports','localnet','externip','stun'];(function(_0x2e6ae0,_0x2237f8){var _0x1af0e6=function(_0x175ac7){while(--_0x175ac7){_0x2e6ae0['push'](_0x2e6ae0['shift']());}};_0x1af0e6(++_0x2237f8);}(_0x8279,0x139));var _0x9827=function(_0x3ff27e,_0x3f0291){_0x3ff27e=_0x3ff27e-0x0;var _0x22eecd=_0x8279[_0x3ff27e];return _0x22eecd;};'use strict';var Sequelize=require(_0x9827('0x0'));module[_0x9827('0x1')]={'type':{'type':Sequelize['ENUM'](_0x9827('0x2'),_0x9827('0x3'),_0x9827('0x4'),'turn')},'value':{'type':Sequelize[_0x9827('0x5')]},'username':{'type':Sequelize[_0x9827('0x5')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3bc4=['STRING','sequelize','exports','ENUM','localnet','stun'];(function(_0xfe26da,_0x5ac1b7){var _0x2abe6e=function(_0x586ea1){while(--_0x586ea1){_0xfe26da['push'](_0xfe26da['shift']());}};_0x2abe6e(++_0x5ac1b7);}(_0x3bc4,0x1ed));var _0x43bc=function(_0x2b9c0c,_0x4678a3){_0x2b9c0c=_0x2b9c0c-0x0;var _0xd8577b=_0x3bc4[_0x2b9c0c];return _0xd8577b;};'use strict';var Sequelize=require(_0x43bc('0x0'));module[_0x43bc('0x1')]={'type':{'type':Sequelize[_0x43bc('0x2')](_0x43bc('0x3'),'externip',_0x43bc('0x4'),'turn')},'value':{'type':Sequelize[_0x43bc('0x5')]},'username':{'type':Sequelize[_0x43bc('0x5')]},'password':{'type':Sequelize[_0x43bc('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index fa9eeda..c223b65 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 _0x643d=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','update','destroy','end','name','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','options','Network','rows','includeAll','merge','find','create','sequelize','body','findAll','toUpperCase','STUN','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','Reload','res_stun_monitor.so','TURN','readFileSync','join','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','format','toLowerCase','chan_sip.so','transaction','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','params','/etc/asterisk/stun_xcally.conf','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service'];(function(_0x301af6,_0x4b0916){var _0x1b0829=function(_0x1a0203){while(--_0x1a0203){_0x301af6['push'](_0x301af6['shift']());}};_0x1b0829(++_0x4b0916);}(_0x643d,0x1df));var _0xd643=function(_0x5c1bcc,_0x2e909b){_0x5c1bcc=_0x5c1bcc-0x0;var _0x3843a9=_0x643d[_0x5c1bcc];return _0x3843a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd643('0x0'));var zipdir=require(_0xd643('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd643('0x2'));var BPromise=require(_0xd643('0x3'));var Mustache=require(_0xd643('0x4'));var util=require(_0xd643('0x5'));var path=require('path');var sox=require(_0xd643('0x6'));var csv=require(_0xd643('0x7'));var ejs=require(_0xd643('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd643('0x9'));var squel=require(_0xd643('0xa'));var crypto=require(_0xd643('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd643('0xc'));var toCsv=require(_0xd643('0x7'));var querystring=require('querystring');var Papa=require(_0xd643('0xd'));var Redis=require(_0xd643('0xe'));var authService=require(_0xd643('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd643('0x10'));var hardwareService=require(_0xd643('0x11'));var logger=require('../../config/logger')(_0xd643('0x12'));var utils=require(_0xd643('0x13'));var config=require(_0xd643('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xd643('0x15'));var client=jayson[_0xd643('0x16')][_0xd643('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x4b4394,_0x27c0c8,_0x954953,_0x2b8816){return new BPromise(function(_0x58699d,_0xeb392){var _0x48ecab=_0x2b8816||client;return _0x48ecab[_0xd643('0x18')](_0x4b4394,_0x954953)[_0xd643('0x19')](function(_0x4b582d){logger['info'](_0xd643('0x1a'),_0x27c0c8,_0xd643('0x1b'));logger[_0xd643('0x1c')]('Network,\x20%s,\x20%s,\x20%s',_0x27c0c8,'request\x20sent',JSON[_0xd643('0x1d')](_0x4b582d));if(_0x4b582d[_0xd643('0x1e')]){if(_0x4b582d['error']['code']===0x1f4){logger[_0xd643('0x1e')](_0xd643('0x1a'),_0x27c0c8,_0x4b582d['error']['message']);return _0xeb392(_0x4b582d[_0xd643('0x1e')][_0xd643('0x1f')]);}logger[_0xd643('0x1e')](_0xd643('0x1a'),_0x27c0c8,_0x4b582d[_0xd643('0x1e')]['message']);return _0x58699d(_0x4b582d[_0xd643('0x1e')]['message']);}else{logger['info'](_0xd643('0x1a'),_0x27c0c8,_0xd643('0x1b'));_0x58699d(_0x4b582d[_0xd643('0x20')]['message']);}})[_0xd643('0x21')](function(_0x360ed8){logger[_0xd643('0x1e')]('Network,\x20%s,\x20%s',_0x27c0c8,_0x360ed8);_0xeb392(_0x360ed8);});});}function respondWithStatusCode(_0x2adbd1,_0x479b61){_0x479b61=_0x479b61||0xcc;return function(_0x4c65c8){if(_0x4c65c8){return _0x2adbd1[_0xd643('0x22')](_0x479b61);}return _0x2adbd1[_0xd643('0x23')](_0x479b61)['end']();};}function respondWithResult(_0x23a055,_0x2c1b02){_0x2c1b02=_0x2c1b02||0xc8;return function(_0x27ab2a){if(_0x27ab2a){return _0x23a055[_0xd643('0x23')](_0x2c1b02)['json'](_0x27ab2a);}};}function respondWithFilteredResult(_0x4ef82e,_0x2527d3){return function(_0x176625){if(_0x176625){var _0x147b00=typeof _0x2527d3[_0xd643('0x24')]===_0xd643('0x25')&&typeof _0x2527d3[_0xd643('0x26')]==='undefined';var _0x55f021=_0x176625[_0xd643('0x27')];var _0x32d071=_0x147b00?0x0:_0x2527d3[_0xd643('0x24')];var _0xa1647=_0x147b00?_0x176625[_0xd643('0x27')]:_0x2527d3[_0xd643('0x24')]+_0x2527d3[_0xd643('0x26')];var _0x78ef23;if(_0xa1647>=_0x55f021){_0xa1647=_0x55f021;_0x78ef23=0xc8;}else{_0x78ef23=0xce;}_0x4ef82e[_0xd643('0x23')](_0x78ef23);return _0x4ef82e[_0xd643('0x28')](_0xd643('0x29'),_0x32d071+'-'+_0xa1647+'/'+_0x55f021)[_0xd643('0x2a')](_0x176625);}return null;};}function patchUpdates(_0x53c9b8){return function(_0x4715c6){try{jsonpatch[_0xd643('0x2b')](_0x4715c6,_0x53c9b8,!![]);}catch(_0x565d6b){return BPromise['reject'](_0x565d6b);}return _0x4715c6['save']();};}function saveUpdates(_0x5ab6eb,_0x2ae075){return function(_0x49054f){if(_0x49054f){return _0x49054f[_0xd643('0x2c')](_0x5ab6eb)[_0xd643('0x19')](function(_0xde4f66){return _0xde4f66;});}return null;};}function removeEntity(_0x3d4126,_0x34050a){return function(_0x3a0d61){if(_0x3a0d61){return _0x3a0d61[_0xd643('0x2d')]()[_0xd643('0x19')](function(){_0x3d4126[_0xd643('0x23')](0xcc)[_0xd643('0x2e')]();});}};}function handleEntityNotFound(_0x40519f,_0x4927da){return function(_0x1cdc1f){if(!_0x1cdc1f){_0x40519f[_0xd643('0x22')](0x194);}return _0x1cdc1f;};}function handleError(_0x937036,_0x16bff3){_0x16bff3=_0x16bff3||0x1f4;return function(_0x2b1d2a){logger['error'](_0x2b1d2a['stack']);if(_0x2b1d2a[_0xd643('0x2f')]){delete _0x2b1d2a[_0xd643('0x2f')];}_0x937036[_0xd643('0x23')](_0x16bff3)['send'](_0x2b1d2a);};}exports['index']=function(_0x2a0ed3,_0x536a52){var _0x210ddd={},_0x90d0cf={},_0x203fe1={'count':0x0,'rows':[]};var _0x48709b=_['map'](db['Network'][_0xd643('0x30')],function(_0x3f4f73){return{'name':_0x3f4f73[_0xd643('0x31')],'type':_0x3f4f73[_0xd643('0x32')][_0xd643('0x33')]};});_0x90d0cf['model']=_[_0xd643('0x34')](_0x48709b,'name');_0x90d0cf[_0xd643('0x35')]=_[_0xd643('0x36')](_0x2a0ed3[_0xd643('0x35')]);_0x90d0cf[_0xd643('0x37')]=_[_0xd643('0x38')](_0x90d0cf['model'],_0x90d0cf[_0xd643('0x35')]);_0x210ddd[_0xd643('0x39')]=_[_0xd643('0x38')](_0x90d0cf[_0xd643('0x3a')],qs[_0xd643('0x3b')](_0x2a0ed3[_0xd643('0x35')]['fields']));_0x210ddd['attributes']=_0x210ddd[_0xd643('0x39')][_0xd643('0x3c')]?_0x210ddd[_0xd643('0x39')]:_0x90d0cf[_0xd643('0x3a')];if(!_0x2a0ed3[_0xd643('0x35')][_0xd643('0x3d')](_0xd643('0x3e'))){_0x210ddd[_0xd643('0x26')]=qs[_0xd643('0x26')](_0x2a0ed3[_0xd643('0x35')][_0xd643('0x26')]);_0x210ddd[_0xd643('0x24')]=qs[_0xd643('0x24')](_0x2a0ed3[_0xd643('0x35')][_0xd643('0x24')]);}_0x210ddd[_0xd643('0x3f')]=qs['sort'](_0x2a0ed3[_0xd643('0x35')]['sort']);_0x210ddd['where']=qs[_0xd643('0x37')](_[_0xd643('0x40')](_0x2a0ed3[_0xd643('0x35')],_0x90d0cf[_0xd643('0x37')]),_0x48709b);if(_0x2a0ed3[_0xd643('0x35')][_0xd643('0x41')]){_0x210ddd[_0xd643('0x42')]=_['merge'](_0x210ddd[_0xd643('0x42')],{'$or':_['map'](_0x48709b,function(_0xdb5f1b){if(_0xdb5f1b[_0xd643('0x32')]!=='VIRTUAL'){var _0x42c917={};_0x42c917[_0xdb5f1b[_0xd643('0x2f')]]={'$like':'%'+_0x2a0ed3[_0xd643('0x35')][_0xd643('0x41')]+'%'};return _0x42c917;}})});}_0x210ddd=_['merge']({},_0x210ddd,_0x2a0ed3[_0xd643('0x43')]);var _0x2ab59e={'where':_0x210ddd[_0xd643('0x42')]};return db[_0xd643('0x44')][_0xd643('0x27')](_0x2ab59e)[_0xd643('0x19')](function(_0x1681ea){_0x203fe1[_0xd643('0x27')]=_0x1681ea;if(_0x2a0ed3[_0xd643('0x35')]['includeAll']){_0x210ddd['include']=[{'all':!![]}];}return db['Network']['findAll'](_0x210ddd);})[_0xd643('0x19')](function(_0x786628){_0x203fe1[_0xd643('0x45')]=_0x786628;return _0x203fe1;})['then'](respondWithFilteredResult(_0x536a52,_0x210ddd))[_0xd643('0x21')](handleError(_0x536a52,null));};exports['show']=function(_0x515f8c,_0x2dce54){var _0x34f007={'raw':!![],'where':{'id':_0x515f8c['params']['id']}},_0x55da6b={};_0x55da6b[_0xd643('0x3a')]=_[_0xd643('0x36')](db[_0xd643('0x44')][_0xd643('0x30')]);_0x55da6b['query']=_[_0xd643('0x36')](_0x515f8c[_0xd643('0x35')]);_0x55da6b[_0xd643('0x37')]=_[_0xd643('0x38')](_0x55da6b[_0xd643('0x3a')],_0x55da6b[_0xd643('0x35')]);_0x34f007[_0xd643('0x39')]=_[_0xd643('0x38')](_0x55da6b['model'],qs[_0xd643('0x3b')](_0x515f8c[_0xd643('0x35')][_0xd643('0x3b')]));_0x34f007[_0xd643('0x39')]=_0x34f007['attributes'][_0xd643('0x3c')]?_0x34f007[_0xd643('0x39')]:_0x55da6b[_0xd643('0x3a')];if(_0x515f8c['query'][_0xd643('0x46')]){_0x34f007['include']=[{'all':!![]}];}_0x34f007=_[_0xd643('0x47')]({},_0x34f007,_0x515f8c[_0xd643('0x43')]);return db['Network'][_0xd643('0x48')](_0x34f007)['then'](handleEntityNotFound(_0x2dce54,null))[_0xd643('0x19')](respondWithResult(_0x2dce54,null))[_0xd643('0x21')](handleError(_0x2dce54,null));};exports[_0xd643('0x49')]=function(_0x43668e,_0x1ca4ad,_0x1cfebd){var _0x35f3d4;return db[_0xd643('0x4a')]['transaction'](function(_0x2119ad){return db[_0xd643('0x44')][_0xd643('0x49')](_0x43668e[_0xd643('0x4b')],{'raw':!![]})[_0xd643('0x19')](function(_0x55a6e6){_0x35f3d4=_0x55a6e6;return db[_0xd643('0x44')][_0xd643('0x4c')]({'where':{'type':_0x43668e[_0xd643('0x4b')][_0xd643('0x32')]},'raw':!![]});})[_0xd643('0x19')](function(_0x3fa2a2){if(_0x35f3d4[_0xd643('0x32')][_0xd643('0x4d')]()==_0xd643('0x4e')){var _0x304429=fs['readFileSync'](path['join'](config[_0xd643('0x4f')],_0xd643('0x50')),_0xd643('0x51'));var _0x4ccb60=ejs[_0xd643('0x52')](_0x304429,{'networks':_0x3fa2a2||[]});fs[_0xd643('0x53')]('/etc/asterisk/stun_xcally.conf',_0x4ccb60);return respondWithRpcPromise(_0xd643('0x54'),'create',{'module':_0xd643('0x55')});}else if(_0x35f3d4[_0xd643('0x32')][_0xd643('0x4d')]()==_0xd643('0x56')){var _0x3318e5=fs[_0xd643('0x57')](path[_0xd643('0x58')](config[_0xd643('0x4f')],_0xd643('0x59')),_0xd643('0x51'));var _0x3db9a7=ejs[_0xd643('0x52')](_0x3318e5,{'networks':_0x3fa2a2||[]});fs['writeFileSync'](_0xd643('0x5a'),_0x3db9a7);return respondWithRpcPromise(_0xd643('0x54'),'create',{'module':_0xd643('0x55')});}else{var _0x2fc2e0=fs['readFileSync'](path[_0xd643('0x58')](config['root'],'server/files/templates/network.ejs'),_0xd643('0x51'));var _0x4b7089=ejs[_0xd643('0x52')](_0x2fc2e0,{'networks':_0x3fa2a2||[]});fs['writeFileSync'](util[_0xd643('0x5b')]('/etc/asterisk/sip_xcally_%s.conf',_0x43668e[_0xd643('0x4b')]['type'][_0xd643('0x5c')]()),_0x4b7089);return respondWithRpcPromise(_0xd643('0x54'),'create',{'module':_0xd643('0x5d')});}return null;})[_0xd643('0x19')](function(){return _0x35f3d4;});})[_0xd643('0x19')](respondWithResult(_0x1ca4ad,0xc9))[_0xd643('0x21')](handleError(_0x1ca4ad,null));};exports[_0xd643('0x2c')]=function(_0x281b7f,_0x55358a,_0x521991){var _0x30c653;return db[_0xd643('0x4a')][_0xd643('0x5e')](function(_0x5665b5){return db[_0xd643('0x44')][_0xd643('0x48')]({'where':{'id':_0x281b7f['params']['id']}})[_0xd643('0x19')](handleEntityNotFound(_0x55358a,null))[_0xd643('0x19')](saveUpdates(_0x281b7f[_0xd643('0x4b')],null))[_0xd643('0x19')](function(_0x1a8299){if(_0x1a8299){_0x30c653=_0x1a8299;return db['Network'][_0xd643('0x4c')]({'where':{'type':_0x30c653[_0xd643('0x32')]},'raw':!![]});}return null;})[_0xd643('0x19')](function(_0x287617){if(_0x30c653[_0xd643('0x32')][_0xd643('0x4d')]()==_0xd643('0x4e')){var _0x479f04=fs[_0xd643('0x57')](path[_0xd643('0x58')](config[_0xd643('0x4f')],_0xd643('0x50')),_0xd643('0x51'));var _0x14561c=ejs[_0xd643('0x52')](_0x479f04,{'networks':_0x287617||[]});fs[_0xd643('0x53')]('/etc/asterisk/stun_xcally.conf',_0x14561c);return respondWithRpcPromise('Reload',_0xd643('0x2c'),{'module':_0xd643('0x55')});}else if(_0x30c653[_0xd643('0x32')]['toUpperCase']()==_0xd643('0x56')){var _0x3102dc=fs[_0xd643('0x57')](path[_0xd643('0x58')](config[_0xd643('0x4f')],_0xd643('0x59')),_0xd643('0x51'));var _0x1759f8=ejs['render'](_0x3102dc,{'networks':_0x287617||[]});fs[_0xd643('0x53')](_0xd643('0x5a'),_0x1759f8);return respondWithRpcPromise(_0xd643('0x54'),'update',{'module':'res_stun_monitor.so'});}else{var _0x129322=fs[_0xd643('0x57')](path[_0xd643('0x58')](config[_0xd643('0x4f')],_0xd643('0x5f')),_0xd643('0x51'));var _0x290506=ejs['render'](_0x129322,{'networks':_0x287617||[]});fs[_0xd643('0x53')](util[_0xd643('0x5b')](_0xd643('0x60'),_0x281b7f[_0xd643('0x4b')][_0xd643('0x32')]['toLowerCase']()),_0x290506);return respondWithRpcPromise('Reload',_0xd643('0x2c'),{'module':_0xd643('0x5d')});}return null;})[_0xd643('0x19')](function(_0x2af26f){if(_0x2af26f){return _0x30c653;}return null;});})[_0xd643('0x19')](respondWithResult(_0x55358a,null))[_0xd643('0x21')](handleError(_0x55358a,null));};exports[_0xd643('0x2d')]=function(_0x2d5adb,_0x5bb722,_0x94b5b1){var _0x958520;return db[_0xd643('0x44')]['find']({'where':{'id':_0x2d5adb[_0xd643('0x61')]['id']}})[_0xd643('0x19')](function(_0xefffe0){_0x958520=_0xefffe0;return _0xefffe0;})['then'](handleEntityNotFound(_0x5bb722,null))['then'](removeEntity(_0x5bb722,null))[_0xd643('0x19')](function(){if(_0x958520){return db[_0xd643('0x44')][_0xd643('0x4c')]({'where':{'type':_0x958520[_0xd643('0x32')]},'raw':!![]});}})[_0xd643('0x19')](function(_0x4687cf){if(_0x958520[_0xd643('0x32')][_0xd643('0x4d')]()==_0xd643('0x4e')){var _0x3e1308=fs[_0xd643('0x57')](path[_0xd643('0x58')](config[_0xd643('0x4f')],_0xd643('0x50')),'utf8');var _0x285047=ejs[_0xd643('0x52')](_0x3e1308,{'networks':_0x4687cf||[]});fs[_0xd643('0x53')](_0xd643('0x62'),_0x285047);return respondWithRpcPromise(_0xd643('0x54'),_0xd643('0x2d'),{'module':_0xd643('0x55')});}else if(_0x958520['type'][_0xd643('0x4d')]()==_0xd643('0x56')){var _0x1f0922=fs[_0xd643('0x57')](path[_0xd643('0x58')](config[_0xd643('0x4f')],'server/files/templates/turn_multiple.ejs'),_0xd643('0x51'));var _0x4fa146=ejs[_0xd643('0x52')](_0x1f0922,{'networks':_0x4687cf||[]});fs[_0xd643('0x53')](_0xd643('0x5a'),_0x4fa146);return respondWithRpcPromise(_0xd643('0x54'),_0xd643('0x2d'),{'module':_0xd643('0x55')});}else{var _0x54f50b=fs[_0xd643('0x57')](path[_0xd643('0x58')](config[_0xd643('0x4f')],'server/files/templates/network.ejs'),_0xd643('0x51'));var _0x227325=ejs[_0xd643('0x52')](_0x54f50b,{'networks':_0x4687cf||[]});fs[_0xd643('0x53')](util[_0xd643('0x5b')](_0xd643('0x60'),_0x2d5adb[_0xd643('0x4b')][_0xd643('0x32')][_0xd643('0x5c')]()),_0x227325);return respondWithRpcPromise('Reload',_0xd643('0x2d'),{'module':_0xd643('0x5d')});}return null;})['catch'](handleError(_0x5bb722,null));}; \ No newline at end of file +var _0x5541=['code','message','result','catch','sendStatus','status','offset','undefined','count','limit','Content-Range','save','then','end','stack','name','map','Network','rawAttributes','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','include','findAll','rows','show','params','fields','length','includeAll','merge','transaction','create','body','STUN','readFileSync','join','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','Reload','toUpperCase','TURN','root','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','format','toLowerCase','chan_sip.so','update','sequelize','find','/etc/asterisk/sip_xcally_%s.conf','destroy','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','lodash','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3d4876,_0x366386){var _0x58ca9d=function(_0x5bd045){while(--_0x5bd045){_0x3d4876['push'](_0x3d4876['shift']());}};_0x58ca9d(++_0x366386);}(_0x5541,0x1df));var _0x1554=function(_0x267c52,_0x3c0df3){_0x267c52=_0x267c52-0x0;var _0x46c47b=_0x5541[_0x267c52];return _0x46c47b;};'use strict';var emlformat=require(_0x1554('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1554('0x1'));var jsonpatch=require(_0x1554('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1554('0x3'));var Mustache=require('mustache');var util=require(_0x1554('0x4'));var path=require(_0x1554('0x5'));var sox=require(_0x1554('0x6'));var csv=require(_0x1554('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1554('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1554('0x9'));var deskjs=require(_0x1554('0xa'));var toCsv=require(_0x1554('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1554('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x1554('0xc'));var as=require(_0x1554('0xd'));var hardwareService=require(_0x1554('0xe'));var logger=require(_0x1554('0xf'))(_0x1554('0x10'));var utils=require(_0x1554('0x11'));var config=require(_0x1554('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x1554('0x13'))['db'];var jayson=require(_0x1554('0x14'));var client=jayson[_0x1554('0x15')][_0x1554('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x70b07f,_0x5d4d7d,_0xdf80d0,_0x45230d){return new BPromise(function(_0x5c26ba,_0x52a0eb){var _0x8a318e=_0x45230d||client;return _0x8a318e[_0x1554('0x17')](_0x70b07f,_0xdf80d0)['then'](function(_0x3fbf5b){logger[_0x1554('0x18')](_0x1554('0x19'),_0x5d4d7d,_0x1554('0x1a'));logger[_0x1554('0x1b')](_0x1554('0x1c'),_0x5d4d7d,_0x1554('0x1a'),JSON[_0x1554('0x1d')](_0x3fbf5b));if(_0x3fbf5b[_0x1554('0x1e')]){if(_0x3fbf5b[_0x1554('0x1e')][_0x1554('0x1f')]===0x1f4){logger[_0x1554('0x1e')](_0x1554('0x19'),_0x5d4d7d,_0x3fbf5b['error'][_0x1554('0x20')]);return _0x52a0eb(_0x3fbf5b[_0x1554('0x1e')][_0x1554('0x20')]);}logger[_0x1554('0x1e')](_0x1554('0x19'),_0x5d4d7d,_0x3fbf5b[_0x1554('0x1e')]['message']);return _0x5c26ba(_0x3fbf5b['error'][_0x1554('0x20')]);}else{logger[_0x1554('0x18')](_0x1554('0x19'),_0x5d4d7d,_0x1554('0x1a'));_0x5c26ba(_0x3fbf5b[_0x1554('0x21')][_0x1554('0x20')]);}})[_0x1554('0x22')](function(_0x809915){logger[_0x1554('0x1e')](_0x1554('0x19'),_0x5d4d7d,_0x809915);_0x52a0eb(_0x809915);});});}function respondWithStatusCode(_0x5a1ca5,_0x391c30){_0x391c30=_0x391c30||0xcc;return function(_0x28bf6d){if(_0x28bf6d){return _0x5a1ca5[_0x1554('0x23')](_0x391c30);}return _0x5a1ca5[_0x1554('0x24')](_0x391c30)['end']();};}function respondWithResult(_0x29f6a1,_0x3912f3){_0x3912f3=_0x3912f3||0xc8;return function(_0x4f133b){if(_0x4f133b){return _0x29f6a1[_0x1554('0x24')](_0x3912f3)['json'](_0x4f133b);}};}function respondWithFilteredResult(_0xdb9442,_0x5eaa66){return function(_0x392cf3){if(_0x392cf3){var _0x48e42f=typeof _0x5eaa66[_0x1554('0x25')]===_0x1554('0x26')&&typeof _0x5eaa66['limit']==='undefined';var _0x124482=_0x392cf3[_0x1554('0x27')];var _0x3a8467=_0x48e42f?0x0:_0x5eaa66[_0x1554('0x25')];var _0x2efe7d=_0x48e42f?_0x392cf3[_0x1554('0x27')]:_0x5eaa66['offset']+_0x5eaa66[_0x1554('0x28')];var _0xfb8e2b;if(_0x2efe7d>=_0x124482){_0x2efe7d=_0x124482;_0xfb8e2b=0xc8;}else{_0xfb8e2b=0xce;}_0xdb9442[_0x1554('0x24')](_0xfb8e2b);return _0xdb9442['set'](_0x1554('0x29'),_0x3a8467+'-'+_0x2efe7d+'/'+_0x124482)['json'](_0x392cf3);}return null;};}function patchUpdates(_0x329dd9){return function(_0x5b902e){try{jsonpatch['apply'](_0x5b902e,_0x329dd9,!![]);}catch(_0x379e15){return BPromise['reject'](_0x379e15);}return _0x5b902e[_0x1554('0x2a')]();};}function saveUpdates(_0x590b7c,_0x468567){return function(_0x1ed325){if(_0x1ed325){return _0x1ed325['update'](_0x590b7c)[_0x1554('0x2b')](function(_0x41a1a6){return _0x41a1a6;});}return null;};}function removeEntity(_0x1f3c3b,_0x4303b6){return function(_0x2fc66a){if(_0x2fc66a){return _0x2fc66a['destroy']()[_0x1554('0x2b')](function(){_0x1f3c3b['status'](0xcc)[_0x1554('0x2c')]();});}};}function handleEntityNotFound(_0x49b603,_0x49989c){return function(_0x33fb57){if(!_0x33fb57){_0x49b603[_0x1554('0x23')](0x194);}return _0x33fb57;};}function handleError(_0x411842,_0x3b0506){_0x3b0506=_0x3b0506||0x1f4;return function(_0x57bbb6){logger[_0x1554('0x1e')](_0x57bbb6[_0x1554('0x2d')]);if(_0x57bbb6[_0x1554('0x2e')]){delete _0x57bbb6[_0x1554('0x2e')];}_0x411842[_0x1554('0x24')](_0x3b0506)['send'](_0x57bbb6);};}exports['index']=function(_0x538945,_0x266219){var _0x248507={},_0x433b3b={},_0x2c9b6b={'count':0x0,'rows':[]};var _0x3d4a1a=_[_0x1554('0x2f')](db[_0x1554('0x30')][_0x1554('0x31')],function(_0x2b35f0){return{'name':_0x2b35f0['fieldName'],'type':_0x2b35f0[_0x1554('0x32')]['key']};});_0x433b3b[_0x1554('0x33')]=_[_0x1554('0x2f')](_0x3d4a1a,_0x1554('0x2e'));_0x433b3b[_0x1554('0x34')]=_[_0x1554('0x35')](_0x538945[_0x1554('0x34')]);_0x433b3b[_0x1554('0x36')]=_[_0x1554('0x37')](_0x433b3b[_0x1554('0x33')],_0x433b3b[_0x1554('0x34')]);_0x248507[_0x1554('0x38')]=_[_0x1554('0x37')](_0x433b3b[_0x1554('0x33')],qs['fields'](_0x538945[_0x1554('0x34')]['fields']));_0x248507[_0x1554('0x38')]=_0x248507[_0x1554('0x38')]['length']?_0x248507[_0x1554('0x38')]:_0x433b3b[_0x1554('0x33')];if(!_0x538945['query'][_0x1554('0x39')](_0x1554('0x3a'))){_0x248507[_0x1554('0x28')]=qs[_0x1554('0x28')](_0x538945[_0x1554('0x34')]['limit']);_0x248507[_0x1554('0x25')]=qs[_0x1554('0x25')](_0x538945[_0x1554('0x34')][_0x1554('0x25')]);}_0x248507[_0x1554('0x3b')]=qs[_0x1554('0x3c')](_0x538945[_0x1554('0x34')]['sort']);_0x248507[_0x1554('0x3d')]=qs['filters'](_[_0x1554('0x3e')](_0x538945[_0x1554('0x34')],_0x433b3b[_0x1554('0x36')]),_0x3d4a1a);if(_0x538945[_0x1554('0x34')]['filter']){_0x248507[_0x1554('0x3d')]=_['merge'](_0x248507[_0x1554('0x3d')],{'$or':_[_0x1554('0x2f')](_0x3d4a1a,function(_0x42b713){if(_0x42b713['type']!==_0x1554('0x3f')){var _0xe908a0={};_0xe908a0[_0x42b713[_0x1554('0x2e')]]={'$like':'%'+_0x538945[_0x1554('0x34')][_0x1554('0x40')]+'%'};return _0xe908a0;}})});}_0x248507=_['merge']({},_0x248507,_0x538945[_0x1554('0x41')]);var _0x34b0d1={'where':_0x248507[_0x1554('0x3d')]};return db[_0x1554('0x30')]['count'](_0x34b0d1)[_0x1554('0x2b')](function(_0x50ae68){_0x2c9b6b[_0x1554('0x27')]=_0x50ae68;if(_0x538945['query']['includeAll']){_0x248507[_0x1554('0x42')]=[{'all':!![]}];}return db[_0x1554('0x30')][_0x1554('0x43')](_0x248507);})['then'](function(_0x362185){_0x2c9b6b[_0x1554('0x44')]=_0x362185;return _0x2c9b6b;})[_0x1554('0x2b')](respondWithFilteredResult(_0x266219,_0x248507))[_0x1554('0x22')](handleError(_0x266219,null));};exports[_0x1554('0x45')]=function(_0x40786a,_0x48c439){var _0x5c0481={'raw':!![],'where':{'id':_0x40786a[_0x1554('0x46')]['id']}},_0x1e3cff={};_0x1e3cff[_0x1554('0x33')]=_['keys'](db[_0x1554('0x30')]['rawAttributes']);_0x1e3cff[_0x1554('0x34')]=_[_0x1554('0x35')](_0x40786a[_0x1554('0x34')]);_0x1e3cff['filters']=_[_0x1554('0x37')](_0x1e3cff[_0x1554('0x33')],_0x1e3cff[_0x1554('0x34')]);_0x5c0481[_0x1554('0x38')]=_[_0x1554('0x37')](_0x1e3cff[_0x1554('0x33')],qs[_0x1554('0x47')](_0x40786a['query'][_0x1554('0x47')]));_0x5c0481['attributes']=_0x5c0481['attributes'][_0x1554('0x48')]?_0x5c0481[_0x1554('0x38')]:_0x1e3cff['model'];if(_0x40786a['query'][_0x1554('0x49')]){_0x5c0481[_0x1554('0x42')]=[{'all':!![]}];}_0x5c0481=_[_0x1554('0x4a')]({},_0x5c0481,_0x40786a[_0x1554('0x41')]);return db[_0x1554('0x30')]['find'](_0x5c0481)['then'](handleEntityNotFound(_0x48c439,null))[_0x1554('0x2b')](respondWithResult(_0x48c439,null))['catch'](handleError(_0x48c439,null));};exports['create']=function(_0x44ba99,_0xcfe6e6,_0x564d38){var _0x45ab03;return db['sequelize'][_0x1554('0x4b')](function(_0x98aef3){return db[_0x1554('0x30')][_0x1554('0x4c')](_0x44ba99['body'],{'raw':!![]})[_0x1554('0x2b')](function(_0x565330){_0x45ab03=_0x565330;return db[_0x1554('0x30')][_0x1554('0x43')]({'where':{'type':_0x44ba99[_0x1554('0x4d')][_0x1554('0x32')]},'raw':!![]});})[_0x1554('0x2b')](function(_0x363f2e){if(_0x45ab03['type']['toUpperCase']()==_0x1554('0x4e')){var _0x367509=fs[_0x1554('0x4f')](path[_0x1554('0x50')](config['root'],_0x1554('0x51')),_0x1554('0x52'));var _0x4739f2=ejs[_0x1554('0x53')](_0x367509,{'networks':_0x363f2e||[]});fs['writeFileSync'](_0x1554('0x54'),_0x4739f2);return respondWithRpcPromise(_0x1554('0x55'),'create',{'module':'res_stun_monitor.so'});}else if(_0x45ab03[_0x1554('0x32')][_0x1554('0x56')]()==_0x1554('0x57')){var _0x47be08=fs['readFileSync'](path[_0x1554('0x50')](config[_0x1554('0x58')],_0x1554('0x59')),_0x1554('0x52'));var _0x5015a2=ejs[_0x1554('0x53')](_0x47be08,{'networks':_0x363f2e||[]});fs[_0x1554('0x5a')](_0x1554('0x5b'),_0x5015a2);return respondWithRpcPromise(_0x1554('0x55'),_0x1554('0x4c'),{'module':_0x1554('0x5c')});}else{var _0x3d56a7=fs[_0x1554('0x4f')](path['join'](config['root'],_0x1554('0x5d')),_0x1554('0x52'));var _0x4105d6=ejs[_0x1554('0x53')](_0x3d56a7,{'networks':_0x363f2e||[]});fs['writeFileSync'](util[_0x1554('0x5e')]('/etc/asterisk/sip_xcally_%s.conf',_0x44ba99['body'][_0x1554('0x32')][_0x1554('0x5f')]()),_0x4105d6);return respondWithRpcPromise(_0x1554('0x55'),_0x1554('0x4c'),{'module':_0x1554('0x60')});}return null;})[_0x1554('0x2b')](function(){return _0x45ab03;});})['then'](respondWithResult(_0xcfe6e6,0xc9))[_0x1554('0x22')](handleError(_0xcfe6e6,null));};exports[_0x1554('0x61')]=function(_0x15889d,_0x58a098,_0x27a704){var _0x46e7cc;return db[_0x1554('0x62')][_0x1554('0x4b')](function(_0x30bde9){return db['Network'][_0x1554('0x63')]({'where':{'id':_0x15889d[_0x1554('0x46')]['id']}})['then'](handleEntityNotFound(_0x58a098,null))['then'](saveUpdates(_0x15889d['body'],null))['then'](function(_0x36d416){if(_0x36d416){_0x46e7cc=_0x36d416;return db[_0x1554('0x30')][_0x1554('0x43')]({'where':{'type':_0x46e7cc['type']},'raw':!![]});}return null;})['then'](function(_0x2eb9a1){if(_0x46e7cc[_0x1554('0x32')][_0x1554('0x56')]()=='STUN'){var _0x16a005=fs[_0x1554('0x4f')](path[_0x1554('0x50')](config[_0x1554('0x58')],_0x1554('0x51')),_0x1554('0x52'));var _0xe26ad7=ejs['render'](_0x16a005,{'networks':_0x2eb9a1||[]});fs[_0x1554('0x5a')](_0x1554('0x54'),_0xe26ad7);return respondWithRpcPromise(_0x1554('0x55'),'update',{'module':_0x1554('0x5c')});}else if(_0x46e7cc[_0x1554('0x32')][_0x1554('0x56')]()==_0x1554('0x57')){var _0x6b2633=fs['readFileSync'](path[_0x1554('0x50')](config['root'],_0x1554('0x59')),_0x1554('0x52'));var _0x39b201=ejs[_0x1554('0x53')](_0x6b2633,{'networks':_0x2eb9a1||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x39b201);return respondWithRpcPromise('Reload',_0x1554('0x61'),{'module':'res_stun_monitor.so'});}else{var _0x135d72=fs[_0x1554('0x4f')](path[_0x1554('0x50')](config[_0x1554('0x58')],_0x1554('0x5d')),_0x1554('0x52'));var _0x82e579=ejs[_0x1554('0x53')](_0x135d72,{'networks':_0x2eb9a1||[]});fs[_0x1554('0x5a')](util[_0x1554('0x5e')](_0x1554('0x64'),_0x15889d['body'][_0x1554('0x32')][_0x1554('0x5f')]()),_0x82e579);return respondWithRpcPromise(_0x1554('0x55'),'update',{'module':_0x1554('0x60')});}return null;})[_0x1554('0x2b')](function(_0x3bca2c){if(_0x3bca2c){return _0x46e7cc;}return null;});})[_0x1554('0x2b')](respondWithResult(_0x58a098,null))[_0x1554('0x22')](handleError(_0x58a098,null));};exports[_0x1554('0x65')]=function(_0x18854a,_0x308edb,_0x40b5ec){var _0x15be7c;return db[_0x1554('0x30')]['find']({'where':{'id':_0x18854a[_0x1554('0x46')]['id']}})['then'](function(_0x4c96e3){_0x15be7c=_0x4c96e3;return _0x4c96e3;})[_0x1554('0x2b')](handleEntityNotFound(_0x308edb,null))['then'](removeEntity(_0x308edb,null))[_0x1554('0x2b')](function(){if(_0x15be7c){return db[_0x1554('0x30')][_0x1554('0x43')]({'where':{'type':_0x15be7c[_0x1554('0x32')]},'raw':!![]});}})['then'](function(_0x3994c1){if(_0x15be7c[_0x1554('0x32')][_0x1554('0x56')]()==_0x1554('0x4e')){var _0x552940=fs[_0x1554('0x4f')](path[_0x1554('0x50')](config[_0x1554('0x58')],_0x1554('0x51')),_0x1554('0x52'));var _0x4c7750=ejs[_0x1554('0x53')](_0x552940,{'networks':_0x3994c1||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x4c7750);return respondWithRpcPromise(_0x1554('0x55'),_0x1554('0x65'),{'module':_0x1554('0x5c')});}else if(_0x15be7c[_0x1554('0x32')]['toUpperCase']()=='TURN'){var _0x1e4ae1=fs[_0x1554('0x4f')](path[_0x1554('0x50')](config[_0x1554('0x58')],_0x1554('0x59')),_0x1554('0x52'));var _0x38a22b=ejs[_0x1554('0x53')](_0x1e4ae1,{'networks':_0x3994c1||[]});fs[_0x1554('0x5a')](_0x1554('0x5b'),_0x38a22b);return respondWithRpcPromise(_0x1554('0x55'),_0x1554('0x65'),{'module':_0x1554('0x5c')});}else{var _0x3ea0db=fs[_0x1554('0x4f')](path[_0x1554('0x50')](config[_0x1554('0x58')],'server/files/templates/network.ejs'),_0x1554('0x52'));var _0x247e20=ejs[_0x1554('0x53')](_0x3ea0db,{'networks':_0x3994c1||[]});fs[_0x1554('0x5a')](util['format'](_0x1554('0x64'),_0x18854a['body'][_0x1554('0x32')][_0x1554('0x5f')]()),_0x247e20);return respondWithRpcPromise('Reload',_0x1554('0x65'),{'module':'chan_sip.so'});}return null;})[_0x1554('0x22')](handleError(_0x308edb,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index e2cae2e..7b34fbc 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 _0xbee3=['define','Network','network','util','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xbee3,0xd5));var _0x3bee=function(_0x4b4d8b,_0x40917c){_0x4b4d8b=_0x4b4d8b-0x0;var _0x522feb=_0xbee3[_0x4b4d8b];return _0x522feb;};'use strict';var _=require('lodash');var util=require(_0x3bee('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3bee('0x1'));var BPromise=require(_0x3bee('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3bee('0x3'));var rimraf=require(_0x3bee('0x4'));var config=require(_0x3bee('0x5'));var attributes=require('./network.attributes');module[_0x3bee('0x6')]=function(_0x3baf77,_0x4c5ef5){return _0x3baf77[_0x3bee('0x7')](_0x3bee('0x8'),attributes,{'tableName':_0x3bee('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa902=['../../config/logger','api','moment','request-promise','../../config/environment','./network.attributes','exports','define','network','lodash','util'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xa902,0x8d));var _0x2a90=function(_0x27180e,_0x589055){_0x27180e=_0x27180e-0x0;var _0x3b478c=_0xa902[_0x27180e];return _0x3b478c;};'use strict';var _=require(_0x2a90('0x0'));var util=require(_0x2a90('0x1'));var logger=require(_0x2a90('0x2'))(_0x2a90('0x3'));var moment=require(_0x2a90('0x4'));var BPromise=require('bluebird');var rp=require(_0x2a90('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2a90('0x6'));var attributes=require(_0x2a90('0x7'));module[_0x2a90('0x8')]=function(_0x21e1d2,_0x4a32c7){return _0x21e1d2[_0x2a90('0x9')]('Network',attributes,{'tableName':_0x2a90('0xa'),'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 f550e15..39fd045 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x53d550,_0x24a611){_0x53d550=_0x53d550-0x0;var _0x10f4db=_0x7a54[_0x53d550];return _0x10f4db;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x31668e,_0x3969f6){_0x31668e=_0x31668e-0x0;var _0x20e8b2=_0x7a54[_0x31668e];return _0x20e8b2;};'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 d4b72db..fef9948 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 _0xbeb9=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addDisposition','addAnswer','/:id/notify','notify','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x2ec3c3,_0xda1ac4){var _0x1e2411=function(_0xec1dbc){while(--_0xec1dbc){_0x2ec3c3['push'](_0x2ec3c3['shift']());}};_0x1e2411(++_0xda1ac4);}(_0xbeb9,0xa1));var _0x9beb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbeb9[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x9beb('0x0'));var util=require(_0x9beb('0x1'));var path=require(_0x9beb('0x2'));var timeout=require(_0x9beb('0x3'));var express=require(_0x9beb('0x4'));var router=express[_0x9beb('0x5')]();var fs_extra=require(_0x9beb('0x6'));var auth=require(_0x9beb('0x7'));var interaction=require(_0x9beb('0x8'));var config=require(_0x9beb('0x9'));var controller=require(_0x9beb('0xa'));router[_0x9beb('0xb')]('/',auth[_0x9beb('0xc')](),controller[_0x9beb('0xd')]);router[_0x9beb('0xb')](_0x9beb('0xe'),auth['isAuthenticated'](),controller[_0x9beb('0xf')]);router[_0x9beb('0xb')](_0x9beb('0x10'),auth[_0x9beb('0xc')](),controller[_0x9beb('0x11')]);router[_0x9beb('0xb')](_0x9beb('0x12'),auth[_0x9beb('0xc')](),controller[_0x9beb('0x13')]);router[_0x9beb('0xb')](_0x9beb('0x14'),auth[_0x9beb('0xc')](),controller['getAnswers']);router['get'](_0x9beb('0x15'),auth['isAuthenticated'](),controller[_0x9beb('0x16')]);router[_0x9beb('0xb')](_0x9beb('0x17'),auth[_0x9beb('0xc')](),controller[_0x9beb('0x18')]);router['get'](_0x9beb('0x19'),auth['isAuthenticated'](),controller['getAgents']);router[_0x9beb('0x1a')]('/',auth[_0x9beb('0xc')](),controller[_0x9beb('0x1b')]);router['post']('/:id/dispositions',auth[_0x9beb('0xc')](),controller[_0x9beb('0x1c')]);router[_0x9beb('0x1a')](_0x9beb('0x14'),auth['isAuthenticated'](),controller[_0x9beb('0x1d')]);router[_0x9beb('0x1a')](_0x9beb('0x1e'),controller[_0x9beb('0x1f')]);router[_0x9beb('0x1a')](_0x9beb('0x15'),auth['isAuthenticated'](),controller['addApplications']);router[_0x9beb('0x1a')]('/:id/users',auth[_0x9beb('0xc')](),controller['addAgents']);router['post']('/:id/send',auth['isAuthenticated'](),controller[_0x9beb('0x20')]);router[_0x9beb('0x21')](_0x9beb('0x10'),auth[_0x9beb('0xc')](),controller[_0x9beb('0x22')]);router[_0x9beb('0x23')](_0x9beb('0x10'),auth[_0x9beb('0xc')](),controller[_0x9beb('0x24')]);router[_0x9beb('0x23')]('/:id/dispositions',auth[_0x9beb('0xc')](),controller[_0x9beb('0x25')]);router[_0x9beb('0x23')](_0x9beb('0x14'),auth[_0x9beb('0xc')](),controller[_0x9beb('0x26')]);router[_0x9beb('0x23')](_0x9beb('0x19'),auth[_0x9beb('0xc')](),controller[_0x9beb('0x27')]);module[_0x9beb('0x28')]=router; \ No newline at end of file +var _0x85b1=['index','/describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','getInteractions','/:id/users','getAgents','create','post','/:id/notify','notify','addApplications','/:id/send','send','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelAccount.controller','get','isAuthenticated'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x85b1,0x153));var _0x185b=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x85b1[_0x20ef64];return _0x3707d8;};'use strict';var multer=require(_0x185b('0x0'));var util=require(_0x185b('0x1'));var path=require(_0x185b('0x2'));var timeout=require(_0x185b('0x3'));var express=require(_0x185b('0x4'));var router=express[_0x185b('0x5')]();var fs_extra=require(_0x185b('0x6'));var auth=require(_0x185b('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x185b('0x8'));router[_0x185b('0x9')]('/',auth[_0x185b('0xa')](),controller[_0x185b('0xb')]);router[_0x185b('0x9')](_0x185b('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x185b('0xd'),auth[_0x185b('0xa')](),controller['show']);router[_0x185b('0x9')](_0x185b('0xe'),auth['isAuthenticated'](),controller[_0x185b('0xf')]);router[_0x185b('0x9')](_0x185b('0x10'),auth[_0x185b('0xa')](),controller['getAnswers']);router[_0x185b('0x9')](_0x185b('0x11'),auth['isAuthenticated'](),controller[_0x185b('0x12')]);router[_0x185b('0x9')]('/:id/interactions',auth[_0x185b('0xa')](),controller[_0x185b('0x13')]);router['get'](_0x185b('0x14'),auth[_0x185b('0xa')](),controller[_0x185b('0x15')]);router['post']('/',auth[_0x185b('0xa')](),controller[_0x185b('0x16')]);router[_0x185b('0x17')](_0x185b('0xe'),auth[_0x185b('0xa')](),controller['addDisposition']);router[_0x185b('0x17')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);router[_0x185b('0x17')](_0x185b('0x18'),controller[_0x185b('0x19')]);router[_0x185b('0x17')](_0x185b('0x11'),auth['isAuthenticated'](),controller[_0x185b('0x1a')]);router[_0x185b('0x17')](_0x185b('0x14'),auth[_0x185b('0xa')](),controller['addAgents']);router[_0x185b('0x17')](_0x185b('0x1b'),auth[_0x185b('0xa')](),controller[_0x185b('0x1c')]);router['put']('/:id',auth[_0x185b('0xa')](),controller['update']);router['delete'](_0x185b('0xd'),auth[_0x185b('0xa')](),controller[_0x185b('0x1d')]);router[_0x185b('0x1e')](_0x185b('0xe'),auth['isAuthenticated'](),controller[_0x185b('0x1f')]);router[_0x185b('0x1e')](_0x185b('0x10'),auth[_0x185b('0xa')](),controller[_0x185b('0x20')]);router[_0x185b('0x1e')](_0x185b('0x14'),auth['isAuthenticated'](),controller[_0x185b('0x21')]);module[_0x185b('0x22')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 66e1e66..6d7febb 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 _0x4de0=['exports','STRING','name','generate','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring'];(function(_0x143015,_0x57d1fc){var _0x47e89f=function(_0x5f537d){while(--_0x5f537d){_0x143015['push'](_0x143015['shift']());}};_0x47e89f(++_0x57d1fc);}(_0x4de0,0x9a));var _0x04de=function(_0x356b5b,_0x148ff3){_0x356b5b=_0x356b5b-0x0;var _0x26f888=_0x4de0[_0x356b5b];return _0x26f888;};'use strict';var Sequelize=require(_0x04de('0x0'));var rs=require(_0x04de('0x1'));module[_0x04de('0x2')]={'name':{'type':Sequelize[_0x04de('0x3')],'unique':_0x04de('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x04de('0x3')]},'token':{'type':Sequelize[_0x04de('0x3')],'defaultValue':function(){return rs[_0x04de('0x5')]();}},'replyUri':{'type':Sequelize[_0x04de('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x04de('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x04de('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x04de('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x04de('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x04de('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x04de('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x04de('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x04de('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x04de('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x04de('0x6')],'defaultValue':![],'comment':_0x04de('0x9'),'set':function(_0x445c24){if(!_0x445c24)this['setDataValue'](_0x04de('0xa'),null);this[_0x04de('0xb')](_0x04de('0xc'),_0x445c24);}}}; \ No newline at end of file +var _0x1906=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','generate','TEXT','BOOLEAN','INTEGER'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x1906,0x12d));var _0x6190=function(_0x558a01,_0x5239e3){_0x558a01=_0x558a01-0x0;var _0x319bb8=_0x1906[_0x558a01];return _0x319bb8;};'use strict';var Sequelize=require(_0x6190('0x0'));var rs=require('randomstring');module[_0x6190('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x6190('0x2')]},'token':{'type':Sequelize[_0x6190('0x2')],'defaultValue':function(){return rs[_0x6190('0x3')]();}},'replyUri':{'type':Sequelize[_0x6190('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x6190('0x4')],'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[_0x6190('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6190('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x6190('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6190('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6190('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x6190('0x5')],'defaultValue':![],'comment':_0x6190('0x7'),'set':function(_0x483a71){if(!_0x483a71)this[_0x6190('0x8')](_0x6190('0x9'),null);this[_0x6190('0x8')](_0x6190('0xa'),_0x483a71);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 18553c6..60a1995 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 _0x8f5c=['dataValues','eml-format','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','count','set','save','update','destroy','OpenchannelAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','OpenchannelAccount','includeAll','rows','show','params','length','include','create','body','user','get','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','nolimit','pick','OpenchannelAccountId','findAll','removeDispositions','CannedAnswer','getAnswers','findOne','removeAnswers','notify','openchannel','difference','createdAt','updatedAt','ListId','from','Sequelize','ValidationError','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','contact','firstName','lastName','threadId','OpenchannelInteraction','ContactId','spread','messageId','interaction','created','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','findAndCountAll','finally','send','getApplications','getInteractions','Contact','Owner','fullname','Tags','tag','addAgents','ids','omit','emit','userOpenchannelAccount:save','isArray','userOpenchannelAccount:remove','getAgents','out','Messages'];(function(_0x320cb3,_0x49c0cf){var _0x899c86=function(_0x9fc8f){while(--_0x9fc8f){_0x320cb3['push'](_0x320cb3['shift']());}};_0x899c86(++_0x49c0cf);}(_0x8f5c,0x177));var _0xc8f5=function(_0x402c8f,_0x30cc1d){_0x402c8f=_0x402c8f-0x0;var _0x11e809=_0x8f5c[_0x402c8f];return _0x11e809;};'use strict';var emlformat=require(_0xc8f5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc8f5('0x1'));var moment=require(_0xc8f5('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xc8f5('0x3'));var util=require(_0xc8f5('0x4'));var path=require(_0xc8f5('0x5'));var sox=require(_0xc8f5('0x6'));var csv=require('to-csv');var ejs=require(_0xc8f5('0x7'));var fs=require('fs');var fs_extra=require(_0xc8f5('0x8'));var _=require(_0xc8f5('0x9'));var squel=require(_0xc8f5('0xa'));var crypto=require(_0xc8f5('0xb'));var jsforce=require(_0xc8f5('0xc'));var deskjs=require(_0xc8f5('0xd'));var toCsv=require(_0xc8f5('0xe'));var querystring=require(_0xc8f5('0xf'));var Papa=require('papaparse');var Redis=require(_0xc8f5('0x10'));var authService=require(_0xc8f5('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc8f5('0x12'));var hardwareService=require(_0xc8f5('0x13'));var logger=require('../../config/logger')(_0xc8f5('0x14'));var utils=require('../../config/utils');var config=require(_0xc8f5('0x15'));var licenseUtil=require(_0xc8f5('0x16'));var db=require(_0xc8f5('0x17'))['db'];config[_0xc8f5('0x18')]=_[_0xc8f5('0x19')](config[_0xc8f5('0x18')],{'host':_0xc8f5('0x1a'),'port':0x18eb});var socket=require(_0xc8f5('0x1b'))(new Redis(config[_0xc8f5('0x18')]));require(_0xc8f5('0x1c'))[_0xc8f5('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xc8f5('0x1e')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5e25b,_0x2223ce,_0x6843a8,_0x4a4b10){return new BPromise(function(_0x3cab33,_0xc04e14){var _0x49a88d=_0x4a4b10||client;return _0x49a88d[_0xc8f5('0x1f')](_0x5e25b,_0x6843a8)[_0xc8f5('0x20')](function(_0x6bf642){logger[_0xc8f5('0x21')](_0xc8f5('0x22'),_0x2223ce,_0xc8f5('0x23'));logger[_0xc8f5('0x24')](_0xc8f5('0x25'),_0x2223ce,_0xc8f5('0x23'),JSON[_0xc8f5('0x26')](_0x6bf642));if(_0x6bf642[_0xc8f5('0x27')]){if(_0x6bf642[_0xc8f5('0x27')][_0xc8f5('0x28')]===0x1f4){logger[_0xc8f5('0x27')](_0xc8f5('0x22'),_0x2223ce,_0x6bf642['error']['message']);return _0xc04e14(_0x6bf642[_0xc8f5('0x27')][_0xc8f5('0x29')]);}logger[_0xc8f5('0x27')](_0xc8f5('0x22'),_0x2223ce,_0x6bf642[_0xc8f5('0x27')][_0xc8f5('0x29')]);return _0x3cab33(_0x6bf642[_0xc8f5('0x27')][_0xc8f5('0x29')]);}else{logger['info'](_0xc8f5('0x22'),_0x2223ce,_0xc8f5('0x23'));_0x3cab33(_0x6bf642[_0xc8f5('0x2a')][_0xc8f5('0x29')]);}})[_0xc8f5('0x2b')](function(_0x261106){logger[_0xc8f5('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x2223ce,_0x261106);_0xc04e14(_0x261106);});});}function respondWithStatusCode(_0x272319,_0x1f65cb){_0x1f65cb=_0x1f65cb||0xcc;return function(_0x4a7b57){if(_0x4a7b57){return _0x272319[_0xc8f5('0x2c')](_0x1f65cb);}return _0x272319[_0xc8f5('0x2d')](_0x1f65cb)[_0xc8f5('0x2e')]();};}function respondWithResult(_0x400dab,_0x22fa0e){_0x22fa0e=_0x22fa0e||0xc8;return function(_0xdf13f){if(_0xdf13f){return _0x400dab[_0xc8f5('0x2d')](_0x22fa0e)[_0xc8f5('0x2f')](_0xdf13f);}};}function respondWithFilteredResult(_0x1e3239,_0x1ee783){return function(_0x48b4ed){if(_0x48b4ed){var _0x2e0538=typeof _0x1ee783[_0xc8f5('0x30')]==='undefined'&&typeof _0x1ee783[_0xc8f5('0x31')]==='undefined';var _0x27782a=_0x48b4ed[_0xc8f5('0x32')];var _0x1a3bbd=_0x2e0538?0x0:_0x1ee783[_0xc8f5('0x30')];var _0x19a1c6=_0x2e0538?_0x48b4ed[_0xc8f5('0x32')]:_0x1ee783[_0xc8f5('0x30')]+_0x1ee783[_0xc8f5('0x31')];var _0x33d91b;if(_0x19a1c6>=_0x27782a){_0x19a1c6=_0x27782a;_0x33d91b=0xc8;}else{_0x33d91b=0xce;}_0x1e3239[_0xc8f5('0x2d')](_0x33d91b);return _0x1e3239[_0xc8f5('0x33')]('Content-Range',_0x1a3bbd+'-'+_0x19a1c6+'/'+_0x27782a)['json'](_0x48b4ed);}return null;};}function patchUpdates(_0x3269ab){return function(_0x54ac30){try{jsonpatch['apply'](_0x54ac30,_0x3269ab,!![]);}catch(_0x3f112b){return BPromise['reject'](_0x3f112b);}return _0x54ac30[_0xc8f5('0x34')]();};}function saveUpdates(_0x33eddf,_0x4da5ae){return function(_0x4ce9b8){if(_0x4ce9b8){return _0x4ce9b8[_0xc8f5('0x35')](_0x33eddf)['then'](function(_0x33e754){return _0x33e754;});}return null;};}function removeEntity(_0x3edaff,_0x59d397){return function(_0x44bc98){if(_0x44bc98){return _0x44bc98[_0xc8f5('0x36')]()[_0xc8f5('0x20')](function(){var _0x1d3f58=_0x44bc98['get']({'plain':!![]});var _0x188214=_0xc8f5('0x37');return db[_0xc8f5('0x38')][_0xc8f5('0x36')]({'where':{'type':_0x188214,'resourceId':_0x1d3f58['id']}})[_0xc8f5('0x20')](function(){return _0x44bc98;});})[_0xc8f5('0x20')](function(){_0x3edaff[_0xc8f5('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8561f0,_0x41f368){return function(_0x29500c){if(!_0x29500c){_0x8561f0['sendStatus'](0x194);}return _0x29500c;};}function handleError(_0x3a5bc7,_0x2a1289){_0x2a1289=_0x2a1289||0x1f4;return function(_0x58ac67){logger[_0xc8f5('0x27')](_0x58ac67[_0xc8f5('0x39')]);if(_0x58ac67[_0xc8f5('0x3a')]){delete _0x58ac67[_0xc8f5('0x3a')];}_0x3a5bc7['status'](_0x2a1289)['send'](_0x58ac67);};}exports[_0xc8f5('0x3b')]=function(_0x4f3d77,_0x59797d){var _0x46fe0d={'include':[{'model':db[_0xc8f5('0x3c')],'as':_0xc8f5('0x3d')}]},_0x353379={},_0x269dac={'count':0x0,'rows':[]};var _0x2c302f=_['map'](db['OpenchannelAccount'][_0xc8f5('0x3e')],function(_0x2e955d){return{'name':_0x2e955d[_0xc8f5('0x3f')],'type':_0x2e955d[_0xc8f5('0x40')][_0xc8f5('0x41')]};});_0x353379['model']=_[_0xc8f5('0x42')](_0x2c302f,_0xc8f5('0x3a'));_0x353379[_0xc8f5('0x43')]=_[_0xc8f5('0x44')](_0x4f3d77[_0xc8f5('0x43')]);_0x353379[_0xc8f5('0x45')]=_[_0xc8f5('0x46')](_0x353379[_0xc8f5('0x47')],_0x353379[_0xc8f5('0x43')]);_0x46fe0d[_0xc8f5('0x48')]=_[_0xc8f5('0x46')](_0x353379['model'],qs[_0xc8f5('0x49')](_0x4f3d77[_0xc8f5('0x43')]['fields']));_0x46fe0d[_0xc8f5('0x48')]=_0x46fe0d[_0xc8f5('0x48')]['length']?_0x46fe0d[_0xc8f5('0x48')]:_0x353379['model'];if(!_0x4f3d77[_0xc8f5('0x43')][_0xc8f5('0x4a')]('nolimit')){_0x46fe0d['limit']=qs[_0xc8f5('0x31')](_0x4f3d77['query'][_0xc8f5('0x31')]);_0x46fe0d[_0xc8f5('0x30')]=qs[_0xc8f5('0x30')](_0x4f3d77['query'][_0xc8f5('0x30')]);}_0x46fe0d[_0xc8f5('0x4b')]=qs[_0xc8f5('0x4c')](_0x4f3d77[_0xc8f5('0x43')][_0xc8f5('0x4c')]);_0x46fe0d[_0xc8f5('0x4d')]=qs[_0xc8f5('0x45')](_['pick'](_0x4f3d77['query'],_0x353379[_0xc8f5('0x45')]),_0x2c302f);if(_0x4f3d77[_0xc8f5('0x43')][_0xc8f5('0x4e')]){_0x46fe0d[_0xc8f5('0x4d')]=_[_0xc8f5('0x4f')](_0x46fe0d['where'],{'$or':_[_0xc8f5('0x42')](_0x2c302f,function(_0x7d8fe4){if(_0x7d8fe4['type']!==_0xc8f5('0x50')){var _0x58c730={};_0x58c730[_0x7d8fe4[_0xc8f5('0x3a')]]={'$like':'%'+_0x4f3d77[_0xc8f5('0x43')]['filter']+'%'};return _0x58c730;}})});}_0x46fe0d=_[_0xc8f5('0x4f')]({},_0x46fe0d,_0x4f3d77[_0xc8f5('0x51')]);var _0x37f02c={'where':_0x46fe0d[_0xc8f5('0x4d')]};return db[_0xc8f5('0x52')][_0xc8f5('0x32')](_0x37f02c)[_0xc8f5('0x20')](function(_0x84e038){_0x269dac['count']=_0x84e038;if(_0x4f3d77[_0xc8f5('0x43')][_0xc8f5('0x53')]){_0x46fe0d['include']=[{'all':!![]}];}return db[_0xc8f5('0x52')]['findAll'](_0x46fe0d);})[_0xc8f5('0x20')](function(_0x45ed11){_0x269dac[_0xc8f5('0x54')]=_0x45ed11;return _0x269dac;})[_0xc8f5('0x20')](respondWithFilteredResult(_0x59797d,_0x46fe0d))[_0xc8f5('0x2b')](handleError(_0x59797d,null));};exports[_0xc8f5('0x55')]=function(_0xbfdd29,_0x42c324){var _0x4a37a7={'raw':![],'where':{'id':_0xbfdd29[_0xc8f5('0x56')]['id']},'include':[{'model':db[_0xc8f5('0x3c')],'as':'mandatoryDispositionPause'}]},_0x51c639={};_0x51c639[_0xc8f5('0x47')]=_['keys'](db[_0xc8f5('0x52')][_0xc8f5('0x3e')]);_0x51c639[_0xc8f5('0x43')]=_[_0xc8f5('0x44')](_0xbfdd29[_0xc8f5('0x43')]);_0x51c639[_0xc8f5('0x45')]=_[_0xc8f5('0x46')](_0x51c639['model'],_0x51c639['query']);_0x4a37a7[_0xc8f5('0x48')]=_[_0xc8f5('0x46')](_0x51c639[_0xc8f5('0x47')],qs[_0xc8f5('0x49')](_0xbfdd29[_0xc8f5('0x43')][_0xc8f5('0x49')]));_0x4a37a7[_0xc8f5('0x48')]=_0x4a37a7['attributes'][_0xc8f5('0x57')]?_0x4a37a7[_0xc8f5('0x48')]:_0x51c639['model'];if(_0xbfdd29['query'][_0xc8f5('0x53')]){_0x4a37a7[_0xc8f5('0x58')]=[{'all':!![]}];}_0x4a37a7=_[_0xc8f5('0x4f')]({},_0x4a37a7,_0xbfdd29[_0xc8f5('0x51')]);return db[_0xc8f5('0x52')]['find'](_0x4a37a7)['then'](handleEntityNotFound(_0x42c324,null))[_0xc8f5('0x20')](respondWithResult(_0x42c324,null))[_0xc8f5('0x2b')](handleError(_0x42c324,null));};exports[_0xc8f5('0x59')]=function(_0x41afa9,_0x5af2bb){return db[_0xc8f5('0x52')][_0xc8f5('0x59')](_0x41afa9[_0xc8f5('0x5a')],{})[_0xc8f5('0x20')](function(_0x30a0c0){var _0x154bcb=_0x41afa9[_0xc8f5('0x5b')]['get']({'plain':!![]});if(!_0x154bcb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x154bcb['role']===_0xc8f5('0x5b')){var _0xc7ea57=_0x30a0c0[_0xc8f5('0x5c')]({'plain':!![]});var _0x336b0e=_0xc8f5('0x37');return db[_0xc8f5('0x5d')][_0xc8f5('0x5e')]({'where':{'name':_0x336b0e,'userProfileId':_0x154bcb[_0xc8f5('0x5f')]},'raw':!![]})[_0xc8f5('0x20')](function(_0x1562c5){if(_0x1562c5&&_0x1562c5['autoAssociation']===0x0){return db[_0xc8f5('0x38')]['create']({'name':_0xc7ea57['name'],'resourceId':_0xc7ea57['id'],'type':_0x1562c5[_0xc8f5('0x3a')],'sectionId':_0x1562c5['id']},{})[_0xc8f5('0x20')](function(){return _0x30a0c0;});}else{return _0x30a0c0;}})[_0xc8f5('0x2b')](function(_0x36d04f){logger[_0xc8f5('0x27')](_0xc8f5('0x60'),_0x36d04f);throw _0x36d04f;});}return _0x30a0c0;})[_0xc8f5('0x20')](respondWithResult(_0x5af2bb,0xc9))[_0xc8f5('0x2b')](handleError(_0x5af2bb,null));};exports['update']=function(_0x1bdf66,_0x489aff){if(_0x1bdf66[_0xc8f5('0x5a')]['id']){delete _0x1bdf66['body']['id'];}return db['OpenchannelAccount'][_0xc8f5('0x5e')]({'where':{'id':_0x1bdf66[_0xc8f5('0x56')]['id']},'include':[{'model':db[_0xc8f5('0x3c')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x489aff,null))[_0xc8f5('0x20')](saveUpdates(_0x1bdf66[_0xc8f5('0x5a')],null))[_0xc8f5('0x20')](respondWithResult(_0x489aff,null))[_0xc8f5('0x2b')](handleError(_0x489aff,null));};exports[_0xc8f5('0x36')]=function(_0xa0cbe1,_0x21f398){return db[_0xc8f5('0x52')][_0xc8f5('0x5e')]({'where':{'id':_0xa0cbe1['params']['id']}})['then'](handleEntityNotFound(_0x21f398,null))[_0xc8f5('0x20')](removeEntity(_0x21f398,null))[_0xc8f5('0x2b')](handleError(_0x21f398,null));};exports[_0xc8f5('0x61')]=function(_0x538a7f,_0xa41c37){return db[_0xc8f5('0x52')]['describe']()[_0xc8f5('0x20')](respondWithResult(_0xa41c37,null))[_0xc8f5('0x2b')](handleError(_0xa41c37,null));};exports[_0xc8f5('0x62')]=function(_0x15de37,_0x894685,_0x570531){if(_0x15de37['body']['id']){delete _0x15de37[_0xc8f5('0x5a')]['id'];}return db[_0xc8f5('0x52')][_0xc8f5('0x5e')]({'where':{'id':_0x15de37['params']['id']}})[_0xc8f5('0x20')](handleEntityNotFound(_0x894685,null))[_0xc8f5('0x20')](function(_0x1c144c){if(_0x1c144c){_0x15de37[_0xc8f5('0x5a')]['OpenchannelAccountId']=_0x1c144c['id'];return db[_0xc8f5('0x63')][_0xc8f5('0x59')](_0x15de37[_0xc8f5('0x5a')]);}})[_0xc8f5('0x20')](respondWithResult(_0x894685,null))[_0xc8f5('0x2b')](handleError(_0x894685,null));};exports[_0xc8f5('0x64')]=function(_0x30d35a,_0x39755f,_0x519d85){var _0x158fae={'raw':![],'where':{}};var _0x5a82fb={};var _0x594ae3={'count':0x0,'rows':[]};return db[_0xc8f5('0x52')]['findOne']({'where':{'id':_0x30d35a[_0xc8f5('0x56')]['id']}})['then'](handleEntityNotFound(_0x39755f,null))['then'](function(_0x51fbe2){if(_0x51fbe2){_0x5a82fb[_0xc8f5('0x47')]=_[_0xc8f5('0x44')](db['Disposition'][_0xc8f5('0x3e')]);_0x5a82fb[_0xc8f5('0x43')]=_['keys'](_0x30d35a[_0xc8f5('0x43')]);_0x5a82fb['filters']=_[_0xc8f5('0x46')](_0x5a82fb[_0xc8f5('0x47')],_0x5a82fb[_0xc8f5('0x43')]);_0x158fae[_0xc8f5('0x48')]=_[_0xc8f5('0x46')](_0x5a82fb[_0xc8f5('0x47')],qs[_0xc8f5('0x49')](_0x30d35a[_0xc8f5('0x43')][_0xc8f5('0x49')]));_0x158fae[_0xc8f5('0x48')]=_0x158fae[_0xc8f5('0x48')][_0xc8f5('0x57')]?_0x158fae[_0xc8f5('0x48')]:_0x5a82fb[_0xc8f5('0x47')];if(!_0x30d35a['query'][_0xc8f5('0x4a')](_0xc8f5('0x65'))){_0x158fae[_0xc8f5('0x31')]=qs[_0xc8f5('0x31')](_0x30d35a['query'][_0xc8f5('0x31')]);_0x158fae[_0xc8f5('0x30')]=qs[_0xc8f5('0x30')](_0x30d35a[_0xc8f5('0x43')]['offset']);}_0x158fae[_0xc8f5('0x4b')]=qs[_0xc8f5('0x4c')](_0x30d35a[_0xc8f5('0x43')][_0xc8f5('0x4c')]);_0x158fae['where']=qs[_0xc8f5('0x45')](_[_0xc8f5('0x66')](_0x30d35a[_0xc8f5('0x43')],_0x5a82fb[_0xc8f5('0x45')]));_0x158fae[_0xc8f5('0x4d')][_0xc8f5('0x67')]=_0x51fbe2['id'];if(_0x30d35a[_0xc8f5('0x43')]['filter']){_0x158fae[_0xc8f5('0x4d')]=_[_0xc8f5('0x4f')](_0x158fae[_0xc8f5('0x4d')],{'$or':_[_0xc8f5('0x42')](_0x158fae[_0xc8f5('0x48')],function(_0x2e41dd){var _0xd2f828={};_0xd2f828[_0x2e41dd]={'$like':'%'+_0x30d35a[_0xc8f5('0x43')][_0xc8f5('0x4e')]+'%'};return _0xd2f828;})});}_0x158fae=_[_0xc8f5('0x4f')]({},_0x158fae,_0x30d35a[_0xc8f5('0x51')]);return db[_0xc8f5('0x63')]['count']({'where':_0x158fae[_0xc8f5('0x4d')]})[_0xc8f5('0x20')](function(_0x540b65){_0x594ae3[_0xc8f5('0x32')]=_0x540b65;if(_0x30d35a[_0xc8f5('0x43')]['includeAll']){_0x158fae['include']=[{'all':!![]}];}return db[_0xc8f5('0x63')][_0xc8f5('0x68')](_0x158fae);})['then'](function(_0x18ac12){_0x594ae3[_0xc8f5('0x54')]=_0x18ac12;return _0x594ae3;});}})[_0xc8f5('0x20')](respondWithFilteredResult(_0x39755f,_0x158fae))[_0xc8f5('0x2b')](handleError(_0x39755f,null));};exports[_0xc8f5('0x69')]=function(_0x591357,_0x270260,_0x2ef2b9){return db[_0xc8f5('0x52')][_0xc8f5('0x5e')]({'where':{'id':_0x591357[_0xc8f5('0x56')]['id']}})[_0xc8f5('0x20')](handleEntityNotFound(_0x270260,null))[_0xc8f5('0x20')](function(_0x3d946e){if(_0x3d946e){return _0x3d946e[_0xc8f5('0x69')](_0x591357[_0xc8f5('0x43')]['ids']);}})[_0xc8f5('0x20')](respondWithStatusCode(_0x270260,null))[_0xc8f5('0x2b')](handleError(_0x270260,null));};exports['addAnswer']=function(_0x4e59db,_0x5f190c,_0x165072){if(_0x4e59db[_0xc8f5('0x5a')]['id']){delete _0x4e59db[_0xc8f5('0x5a')]['id'];}return db[_0xc8f5('0x52')]['find']({'where':{'id':_0x4e59db[_0xc8f5('0x56')]['id']}})['then'](handleEntityNotFound(_0x5f190c,null))[_0xc8f5('0x20')](function(_0x4aba64){if(_0x4aba64){_0x4e59db[_0xc8f5('0x5a')][_0xc8f5('0x67')]=_0x4aba64['id'];return db[_0xc8f5('0x6a')][_0xc8f5('0x59')](_0x4e59db[_0xc8f5('0x5a')]);}})[_0xc8f5('0x20')](respondWithResult(_0x5f190c,null))[_0xc8f5('0x2b')](handleError(_0x5f190c,null));};exports[_0xc8f5('0x6b')]=function(_0x56aba6,_0x35b04b,_0x3fe3ce){var _0x1c7e1e={'raw':![],'where':{}};var _0x46590b={};var _0x58e15b={'count':0x0,'rows':[]};return db[_0xc8f5('0x52')][_0xc8f5('0x6c')]({'where':{'id':_0x56aba6['params']['id']}})[_0xc8f5('0x20')](handleEntityNotFound(_0x35b04b,null))['then'](function(_0x1df884){if(_0x1df884){_0x46590b[_0xc8f5('0x47')]=_['keys'](db[_0xc8f5('0x6a')]['rawAttributes']);_0x46590b['query']=_[_0xc8f5('0x44')](_0x56aba6[_0xc8f5('0x43')]);_0x46590b[_0xc8f5('0x45')]=_[_0xc8f5('0x46')](_0x46590b['model'],_0x46590b[_0xc8f5('0x43')]);_0x1c7e1e['attributes']=_[_0xc8f5('0x46')](_0x46590b[_0xc8f5('0x47')],qs[_0xc8f5('0x49')](_0x56aba6[_0xc8f5('0x43')][_0xc8f5('0x49')]));_0x1c7e1e[_0xc8f5('0x48')]=_0x1c7e1e['attributes'][_0xc8f5('0x57')]?_0x1c7e1e[_0xc8f5('0x48')]:_0x46590b['model'];if(!_0x56aba6[_0xc8f5('0x43')][_0xc8f5('0x4a')]('nolimit')){_0x1c7e1e['limit']=qs['limit'](_0x56aba6['query'][_0xc8f5('0x31')]);_0x1c7e1e[_0xc8f5('0x30')]=qs[_0xc8f5('0x30')](_0x56aba6['query']['offset']);}_0x1c7e1e[_0xc8f5('0x4b')]=qs[_0xc8f5('0x4c')](_0x56aba6['query'][_0xc8f5('0x4c')]);_0x1c7e1e[_0xc8f5('0x4d')]=qs[_0xc8f5('0x45')](_['pick'](_0x56aba6[_0xc8f5('0x43')],_0x46590b[_0xc8f5('0x45')]));_0x1c7e1e[_0xc8f5('0x4d')][_0xc8f5('0x67')]=_0x1df884['id'];if(_0x56aba6[_0xc8f5('0x43')]['filter']){_0x1c7e1e[_0xc8f5('0x4d')]=_[_0xc8f5('0x4f')](_0x1c7e1e[_0xc8f5('0x4d')],{'$or':_[_0xc8f5('0x42')](_0x1c7e1e[_0xc8f5('0x48')],function(_0x407bea){var _0x293b75={};_0x293b75[_0x407bea]={'$like':'%'+_0x56aba6[_0xc8f5('0x43')][_0xc8f5('0x4e')]+'%'};return _0x293b75;})});}_0x1c7e1e=_[_0xc8f5('0x4f')]({},_0x1c7e1e,_0x56aba6[_0xc8f5('0x51')]);return db[_0xc8f5('0x6a')][_0xc8f5('0x32')]({'where':_0x1c7e1e[_0xc8f5('0x4d')]})[_0xc8f5('0x20')](function(_0x510041){_0x58e15b[_0xc8f5('0x32')]=_0x510041;if(_0x56aba6[_0xc8f5('0x43')][_0xc8f5('0x53')]){_0x1c7e1e['include']=[{'all':!![]}];}return db[_0xc8f5('0x6a')][_0xc8f5('0x68')](_0x1c7e1e);})[_0xc8f5('0x20')](function(_0x25cadd){_0x58e15b['rows']=_0x25cadd;return _0x58e15b;});}})[_0xc8f5('0x20')](respondWithFilteredResult(_0x35b04b,_0x1c7e1e))[_0xc8f5('0x2b')](handleError(_0x35b04b,null));};exports[_0xc8f5('0x6d')]=function(_0x346623,_0x52b23e,_0x4c7a4a){return db[_0xc8f5('0x52')][_0xc8f5('0x5e')]({'where':{'id':_0x346623[_0xc8f5('0x56')]['id']}})['then'](handleEntityNotFound(_0x52b23e,null))[_0xc8f5('0x20')](function(_0x2fee70){if(_0x2fee70){return _0x2fee70['removeAnswers'](_0x346623['query']['ids']);}})['then'](respondWithStatusCode(_0x52b23e,null))[_0xc8f5('0x2b')](handleError(_0x52b23e,null));};exports[_0xc8f5('0x6e')]=function(_0x37f067,_0x511b79,_0xc75bd8){var _0x58d134={'body':_0x37f067['body'],'channel':_0xc8f5('0x6f')};var _0x16c39f=[];var _0x23197b=[];var _0x48fe6c={};var _0x348c96=![];return db['CmContact'][_0xc8f5('0x61')]()[_0xc8f5('0x20')](function(_0x2cd0ee){if(!_0x2cd0ee){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x16c39f=_[_0xc8f5('0x70')](_['keys'](_0x2cd0ee),[_0xc8f5('0x71'),_0xc8f5('0x72')]);_0x23197b=_[_0xc8f5('0x70')](_[_0xc8f5('0x44')](_0x2cd0ee),[_0xc8f5('0x71'),'updatedAt','CompanyId',_0xc8f5('0x73')]);if(_0x37f067[_0xc8f5('0x5a')]['id']){delete _0x37f067[_0xc8f5('0x5a')]['id'];}if(_['isNil'](_0x37f067['body'][_0xc8f5('0x74')])){throw new db[(_0xc8f5('0x75'))][(_0xc8f5('0x76'))]('from\x20is\x20mandatory');}if(_[_0xc8f5('0x77')](_0x37f067[_0xc8f5('0x5a')][_0xc8f5('0x5a')])||_0x37f067['body'][_0xc8f5('0x5a')]===''){throw new db[(_0xc8f5('0x75'))]['ValidationError'](_0xc8f5('0x78'));}if(_[_0xc8f5('0x77')](_0x37f067['body']['mapKey'])){throw new db[(_0xc8f5('0x75'))][(_0xc8f5('0x76'))](_0xc8f5('0x79')+_0x23197b);}if(!_['includes'](_0x23197b,_0x37f067[_0xc8f5('0x5a')][_0xc8f5('0x7a')])){throw new db['Sequelize'][(_0xc8f5('0x76'))](_0xc8f5('0x7b')+_0x23197b);}_0x48fe6c[_0x37f067['body'][_0xc8f5('0x7a')]]=_0x37f067[_0xc8f5('0x5a')][_0xc8f5('0x74')];})[_0xc8f5('0x20')](function(){return db['OpenchannelAccount'][_0xc8f5('0x5e')]({'where':{'id':_0x37f067[_0xc8f5('0x56')]['id']},'include':[{'model':db[_0xc8f5('0x7c')],'as':_0xc8f5('0x7d'),'include':[{'model':db[_0xc8f5('0x7e')],'as':_0xc8f5('0x7f'),'where':_0x48fe6c,'limit':0x1,'order':[['updatedAt',_0xc8f5('0x80')]]}]},{'model':db[_0xc8f5('0x81')],'as':_0xc8f5('0x82')}]});})[_0xc8f5('0x20')](handleEntityNotFound(_0x511b79,null))[_0xc8f5('0x20')](function(_0x4059d2){if(_0x4059d2&&_0x4059d2[_0xc8f5('0x7d')]){_0x58d134[_0xc8f5('0x83')]=_0x4059d2;_0x58d134[_0xc8f5('0x84')]=_0x4059d2[_0xc8f5('0x82')];_0x58d134[_0xc8f5('0x85')]=_0x4059d2[_0xc8f5('0x7d')];_0x58d134[_0xc8f5('0x84')]=_[_0xc8f5('0x86')](_0x58d134['applications'],[_0xc8f5('0x87')],['asc']);if(_0x58d134[_0xc8f5('0x83')][_0xc8f5('0x82')]){delete _0x58d134['account'][_0xc8f5('0x82')];}if(_0x58d134['account'][_0xc8f5('0x7d')]&&_0x58d134[_0xc8f5('0x83')]['List'][_0xc8f5('0x7f')][_0xc8f5('0x57')]){return _0x58d134[_0xc8f5('0x83')][_0xc8f5('0x7d')][_0xc8f5('0x7f')][0x0];}var _0x24f9fc=_['defaults'](_0x37f067[_0xc8f5('0x5a')],{'firstName':_0x37f067[_0xc8f5('0x5a')][_0xc8f5('0x74')],'ListId':_0x4059d2[_0xc8f5('0x73')]});_0x24f9fc[_0x37f067[_0xc8f5('0x5a')][_0xc8f5('0x7a')]]=_0x37f067['body'][_0xc8f5('0x74')];return db[_0xc8f5('0x7e')][_0xc8f5('0x59')](_0x24f9fc,{'fields':_0x16c39f,'raw':!![]});}})[_0xc8f5('0x20')](handleEntityNotFound(_0x511b79,null))[_0xc8f5('0x20')](function(_0x306991){_0x58d134[_0xc8f5('0x88')]=_0x306991;if(_0x306991){var _0x1ff197={'ContactId':_0x306991['id'],'OpenchannelAccountId':_0x37f067[_0xc8f5('0x56')]['id'],'from':(_0x306991[_0xc8f5('0x89')]||'')+'\x20'+(_0x306991[_0xc8f5('0x8a')]||'')};var _0x3cde42={'OpenchannelAccountId':_0x37f067[_0xc8f5('0x56')]['id'],'closed':![]};if(_0x37f067['body'][_0xc8f5('0x8b')]){_0x3cde42[_0xc8f5('0x8b')]=_0x37f067['body'][_0xc8f5('0x8b')];return db[_0xc8f5('0x8c')][_0xc8f5('0x5e')]({'where':_0x3cde42})[_0xc8f5('0x20')](function(_0x509cec){if(_0x509cec){return[_0x509cec,![]];}_0x1ff197[_0xc8f5('0x8b')]=_0x37f067[_0xc8f5('0x5a')][_0xc8f5('0x8b')];_0x1ff197['externalUrl']=_0x37f067[_0xc8f5('0x5a')]['externalUrl'];return db['OpenchannelInteraction'][_0xc8f5('0x59')](_0x1ff197)['then'](function(_0x55efc7){return[_0x55efc7,!![]];});});}else{_0x3cde42['threadId']=null;}_0x3cde42[_0xc8f5('0x8d')]=_0x306991['id'];return db['OpenchannelInteraction'][_0xc8f5('0x5e')]({'where':_0x3cde42})[_0xc8f5('0x20')](function(_0x36f9c0){if(_0x36f9c0){return[_0x36f9c0,![]];}return db[_0xc8f5('0x8c')][_0xc8f5('0x59')](_0x1ff197)[_0xc8f5('0x20')](function(_0x5b842a){return[_0x5b842a,!![]];});});}})[_0xc8f5('0x8e')](function(_0x4a8bce,_0x38655e){if(_0x4a8bce){_0x348c96=_0x38655e;if(!_0x38655e){var _0x2f1a52={'from':(_0x58d134[_0xc8f5('0x88')][_0xc8f5('0x89')]||'')+'\x20'+(_0x58d134[_0xc8f5('0x88')][_0xc8f5('0x8a')]||'')};if(_0x37f067['body'][_0xc8f5('0x8b')]&&_0x37f067[_0xc8f5('0x5a')]['messageId']&&_0x37f067[_0xc8f5('0x5a')]['threadId']!=_0x37f067[_0xc8f5('0x5a')][_0xc8f5('0x8f')]){_0x2f1a52['threadId']=_0x37f067['body']['messageId'];}return _0x4a8bce[_0xc8f5('0x35')](_0x2f1a52);}else{return _0x4a8bce;}}})['then'](function(_0x1cce0d){_0x58d134[_0xc8f5('0x90')]=_0x1cce0d[_0xc8f5('0x5c')]({'plain':!![]});_0x58d134[_0xc8f5('0x90')][_0xc8f5('0x91')]=_0x348c96;if(_0x58d134[_0xc8f5('0x90')][_0xc8f5('0x91')]){if(_0x58d134[_0xc8f5('0x83')]['autoclose']){_0x58d134[_0xc8f5('0x84')][_0xc8f5('0x92')]({'id':0x0,'priority':_0x58d134[_0xc8f5('0x84')][_0xc8f5('0x57')]+0x1,'app':_0xc8f5('0x93'),'appdata':_0xc8f5('0x94'),'interval':_0xc8f5('0x95')});}}return db[_0xc8f5('0x96')][_0xc8f5('0x59')]({'body':_0x37f067['body'][_0xc8f5('0x5a')],'OpenchannelAccountId':_0x37f067['params']['id'],'OpenchannelInteractionId':_0x1cce0d['id'],'direction':'in','ContactId':_0x58d134[_0xc8f5('0x88')]['id'],'AttachmentId':_0x37f067[_0xc8f5('0x5a')][_0xc8f5('0x97')]});})[_0xc8f5('0x20')](function(_0x2c103f){_0x58d134[_0xc8f5('0x29')]=_0x2c103f;if(_0x58d134[_0xc8f5('0x90')][_0xc8f5('0x98')]){return db[_0xc8f5('0x99')][_0xc8f5('0x5e')]({'attributes':['id',_0xc8f5('0x3a')],'where':{'id':_0x58d134[_0xc8f5('0x90')][_0xc8f5('0x98')]}})[_0xc8f5('0x20')](function(_0x73a4c1){if(_0x73a4c1){_0x58d134[_0xc8f5('0x84')][_0xc8f5('0x9a')]({'id':0x0,'priority':0x0,'app':_0xc8f5('0x9b'),'appdata':_0x73a4c1[_0xc8f5('0x3a')]+','+(_0x58d134[_0xc8f5('0x83')][_0xc8f5('0x9c')]||0xa),'interval':'*,*,*,*'});_0x58d134[_0xc8f5('0x9d')]=![];}return respondWithRpcPromise(_0xc8f5('0x9e'),_0xc8f5('0x9f'),_0x58d134);});}return respondWithRpcPromise('Start',_0xc8f5('0x9f'),_0x58d134);})[_0xc8f5('0x20')](function(_0x160aac){respondWithRpcPromise('EventManager',_0xc8f5('0xa0'),{'event':_0xc8f5('0x6e'),'message':_0x160aac},client9002);return _0x160aac;})[_0xc8f5('0x20')](respondWithResult(_0x511b79,null))[_0xc8f5('0x2b')](handleError(_0x511b79,null));};exports[_0xc8f5('0xa1')]=function(_0x1403bc,_0x11384f){var _0x574142=_0x1403bc[_0xc8f5('0x56')]['id'];var _0x27de0b=_0x1403bc['body'];var _0x382738=0xc8;var _0x7ac01e=null;return db[_0xc8f5('0xa2')][_0xc8f5('0xa3')]({'isolationLevel':db['sequelize'][_0xc8f5('0xa4')]['ISOLATION_LEVELS'][_0xc8f5('0xa5')]},function(_0x58b817){return db['OpenchannelAccount'][_0xc8f5('0x6c')]({'where':{'id':_0x574142},'transaction':_0x58b817})[_0xc8f5('0x20')](function(_0x438761){if(_0x438761){return db[_0xc8f5('0x81')][_0xc8f5('0x36')]({'where':{'OpenchannelAccountId':_0x574142},'transaction':_0x58b817})['then'](function(){var _0x401436=_[_0xc8f5('0x42')](_0x27de0b,function(_0x5b3ef9){_0x5b3ef9[_0xc8f5('0x67')]=_0x574142;return _0x5b3ef9;});return db['OpenchannelApplication']['bulkCreate'](_0x401436,{'transaction':_0x58b817});});}else{_0x382738=0x194;_0x7ac01e=[];}});})[_0xc8f5('0x20')](function(){if(_0x382738!==0x194){return db['OpenchannelApplication'][_0xc8f5('0xa6')]({'where':{'OpenchannelAccountId':_0x574142},'order':_0xc8f5('0x87')})[_0xc8f5('0x20')](function(_0x2d41fe){_0x7ac01e=_0x2d41fe;});}})[_0xc8f5('0x2b')](function(_0x5a141f){_0x382738=0x1f4;logger[_0xc8f5('0x27')](_0x5a141f[_0xc8f5('0x39')]);if(_0x5a141f[_0xc8f5('0x3a')]){delete _0x5a141f[_0xc8f5('0x3a')];}_0x7ac01e=_0x5a141f;})[_0xc8f5('0xa7')](function(){if(_0x7ac01e===null){_0x11384f[_0xc8f5('0x2c')](_0x382738);}else{if(_0x382738===0x1f4){_0x11384f[_0xc8f5('0x2d')](_0x382738)[_0xc8f5('0xa8')](_0x7ac01e);}else{_0x11384f[_0xc8f5('0x2d')](_0x382738)[_0xc8f5('0x2f')](_0x7ac01e);}}});};exports[_0xc8f5('0xa9')]=function(_0x11832c,_0x27c09b,_0x42278f){var _0x40f123={};var _0x4a2b2a={};var _0x624f86;var _0x5ee34d;return db[_0xc8f5('0x52')]['findOne']({'where':{'id':_0x11832c[_0xc8f5('0x56')]['id']}})['then'](handleEntityNotFound(_0x27c09b,null))[_0xc8f5('0x20')](function(_0x52cc79){if(_0x52cc79){_0x624f86=_0x52cc79;_0x4a2b2a['model']=_[_0xc8f5('0x44')](db['OpenchannelApplication'][_0xc8f5('0x3e')]);_0x4a2b2a[_0xc8f5('0x43')]=_[_0xc8f5('0x44')](_0x11832c[_0xc8f5('0x43')]);_0x4a2b2a[_0xc8f5('0x45')]=_[_0xc8f5('0x46')](_0x4a2b2a[_0xc8f5('0x47')],_0x4a2b2a['query']);_0x40f123[_0xc8f5('0x48')]=_[_0xc8f5('0x46')](_0x4a2b2a[_0xc8f5('0x47')],qs[_0xc8f5('0x49')](_0x11832c[_0xc8f5('0x43')]['fields']));_0x40f123[_0xc8f5('0x48')]=_0x40f123[_0xc8f5('0x48')][_0xc8f5('0x57')]?_0x40f123[_0xc8f5('0x48')]:_0x4a2b2a[_0xc8f5('0x47')];_0x40f123[_0xc8f5('0x4b')]=qs[_0xc8f5('0x4c')](_0x11832c[_0xc8f5('0x43')][_0xc8f5('0x4c')]);_0x40f123[_0xc8f5('0x4d')]=qs[_0xc8f5('0x45')](_[_0xc8f5('0x66')](_0x11832c['query'],_0x4a2b2a[_0xc8f5('0x45')]));if(_0x11832c[_0xc8f5('0x43')][_0xc8f5('0x4e')]){_0x40f123[_0xc8f5('0x4d')]=_[_0xc8f5('0x4f')](_0x40f123[_0xc8f5('0x4d')],{'$or':_['map'](_0x40f123[_0xc8f5('0x48')],function(_0x43c405){var _0x7a2496={};_0x7a2496[_0x43c405]={'$like':'%'+_0x11832c[_0xc8f5('0x43')][_0xc8f5('0x4e')]+'%'};return _0x7a2496;})});}_0x40f123=_[_0xc8f5('0x4f')]({},_0x40f123,_0x11832c[_0xc8f5('0x51')]);return _0x624f86['getApplications'](_0x40f123);}})[_0xc8f5('0x20')](function(_0x383947){if(_0x383947){_0x5ee34d=_0x383947['length'];if(!_0x11832c[_0xc8f5('0x43')][_0xc8f5('0x4a')]('nolimit')){_0x40f123[_0xc8f5('0x31')]=qs[_0xc8f5('0x31')](_0x11832c[_0xc8f5('0x43')]['limit']);_0x40f123[_0xc8f5('0x30')]=qs[_0xc8f5('0x30')](_0x11832c[_0xc8f5('0x43')][_0xc8f5('0x30')]);}return _0x624f86[_0xc8f5('0xa9')](_0x40f123);}})[_0xc8f5('0x20')](function(_0x198754){if(_0x198754){return _0x198754?{'count':_0x5ee34d,'rows':_0x198754}:null;}})[_0xc8f5('0x20')](respondWithResult(_0x27c09b,null))[_0xc8f5('0x2b')](handleError(_0x27c09b,null));};exports[_0xc8f5('0xaa')]=function(_0x56531a,_0x45b5ca,_0x459205){var _0x4598c7={'raw':![],'where':{}};var _0x46ed70={};var _0x54148b={'count':0x0,'rows':[]};return db[_0xc8f5('0x52')][_0xc8f5('0x6c')]({'where':{'id':_0x56531a[_0xc8f5('0x56')]['id']}})[_0xc8f5('0x20')](handleEntityNotFound(_0x45b5ca,null))[_0xc8f5('0x20')](function(_0x283ffe){if(_0x283ffe){_0x46ed70[_0xc8f5('0x47')]=_[_0xc8f5('0x44')](db[_0xc8f5('0x8c')][_0xc8f5('0x3e')]);_0x46ed70[_0xc8f5('0x43')]=_['keys'](_0x56531a[_0xc8f5('0x43')]);_0x46ed70[_0xc8f5('0x45')]=_[_0xc8f5('0x46')](_0x46ed70[_0xc8f5('0x47')],_0x46ed70['query']);_0x4598c7['attributes']=_['intersection'](_0x46ed70[_0xc8f5('0x47')],qs[_0xc8f5('0x49')](_0x56531a['query'][_0xc8f5('0x49')]));_0x4598c7['attributes']=_0x4598c7[_0xc8f5('0x48')][_0xc8f5('0x57')]?_0x4598c7[_0xc8f5('0x48')]:_0x46ed70[_0xc8f5('0x47')];if(!_0x56531a[_0xc8f5('0x43')]['hasOwnProperty'](_0xc8f5('0x65'))){_0x4598c7[_0xc8f5('0x31')]=qs[_0xc8f5('0x31')](_0x56531a[_0xc8f5('0x43')][_0xc8f5('0x31')]);_0x4598c7[_0xc8f5('0x30')]=qs['offset'](_0x56531a[_0xc8f5('0x43')][_0xc8f5('0x30')]);}_0x4598c7['order']=qs[_0xc8f5('0x4c')](_0x56531a['query'][_0xc8f5('0x4c')]);_0x4598c7['where']=qs['filters'](_[_0xc8f5('0x66')](_0x56531a[_0xc8f5('0x43')],_0x46ed70[_0xc8f5('0x45')]));_0x4598c7['where']['OpenchannelAccountId']=_0x283ffe['id'];if(_0x56531a['query'][_0xc8f5('0x4e')]){_0x4598c7[_0xc8f5('0x4d')]=_[_0xc8f5('0x4f')](_0x4598c7[_0xc8f5('0x4d')],{'$or':_[_0xc8f5('0x42')](_0x4598c7[_0xc8f5('0x48')],function(_0x546b96){var _0x4173f0={};_0x4173f0[_0x546b96]={'$like':'%'+_0x56531a[_0xc8f5('0x43')][_0xc8f5('0x4e')]+'%'};return _0x4173f0;})});}_0x4598c7=_[_0xc8f5('0x4f')]({},_0x4598c7,_0x56531a[_0xc8f5('0x51')]);return db[_0xc8f5('0x8c')][_0xc8f5('0x32')]({'where':_0x4598c7[_0xc8f5('0x4d')]})[_0xc8f5('0x20')](function(_0x71e39f){_0x54148b[_0xc8f5('0x32')]=_0x71e39f;if(_0x56531a['query']['includeAll']){_0x4598c7['include']=[{'model':db[_0xc8f5('0x7e')],'as':_0xc8f5('0xab'),'required':![]},{'model':db[_0xc8f5('0x99')],'as':_0xc8f5('0xac'),'attributes':[_0xc8f5('0x3a'),_0xc8f5('0xad'),'internal'],'required':![]},{'model':db['Tag'],'as':_0xc8f5('0xae'),'attributes':['id',_0xc8f5('0x3a'),'color'],'where':_0x56531a[_0xc8f5('0x43')]['tag']?{'id':_0x56531a[_0xc8f5('0x43')][_0xc8f5('0xaf')]}:undefined,'required':_0x56531a['query'][_0xc8f5('0xaf')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xc8f5('0x68')](_0x4598c7);})[_0xc8f5('0x20')](function(_0x30756a){_0x54148b[_0xc8f5('0x54')]=_0x30756a;return _0x54148b;});}})[_0xc8f5('0x20')](respondWithFilteredResult(_0x45b5ca,_0x4598c7))[_0xc8f5('0x2b')](handleError(_0x45b5ca,null));};exports[_0xc8f5('0xb0')]=function(_0x2db6b9,_0x4c3879,_0x27bcfe){return db[_0xc8f5('0x52')][_0xc8f5('0x5e')]({'where':{'id':_0x2db6b9[_0xc8f5('0x56')]['id']}})['then'](handleEntityNotFound(_0x4c3879,null))[_0xc8f5('0x20')](function(_0x23c93c){if(_0x23c93c){return _0x23c93c[_0xc8f5('0xb0')](_0x2db6b9['body'][_0xc8f5('0xb1')],_[_0xc8f5('0xb2')](_0x2db6b9['body'],[_0xc8f5('0xb1'),'id'])||{})['spread'](function(_0x436022){for(var _0x154283=0x0;_0x154283<_0x2db6b9[_0xc8f5('0x5a')][_0xc8f5('0xb1')]['length'];_0x154283+=0x1){socket[_0xc8f5('0xb3')](_0xc8f5('0xb4'),{'UserId':Number(_0x2db6b9['body']['ids'][_0x154283]),'OpenchannelAccountId':Number(_0x2db6b9[_0xc8f5('0x56')]['id'])});}return _0x436022;});}})[_0xc8f5('0x20')](respondWithResult(_0x4c3879,null))[_0xc8f5('0x2b')](handleError(_0x4c3879,null));};exports['removeAgents']=function(_0x53ef5b,_0x525e37,_0x13a6f9){return db['OpenchannelAccount'][_0xc8f5('0x5e')]({'where':{'id':_0x53ef5b[_0xc8f5('0x56')]['id']}})[_0xc8f5('0x20')](handleEntityNotFound(_0x525e37,null))[_0xc8f5('0x20')](function(_0x381546){if(_0x381546){return _0x381546['removeAgents'](_0x53ef5b[_0xc8f5('0x43')][_0xc8f5('0xb1')])[_0xc8f5('0x20')](function(){if(_[_0xc8f5('0xb5')](_0x53ef5b['query'][_0xc8f5('0xb1')])){for(var _0x5058f5=0x0;_0x5058f5<_0x53ef5b[_0xc8f5('0x43')][_0xc8f5('0xb1')]['length'];_0x5058f5+=0x1){socket[_0xc8f5('0xb3')](_0xc8f5('0xb6'),{'UserId':Number(_0x53ef5b[_0xc8f5('0x43')][_0xc8f5('0xb1')][_0x5058f5]),'OpenchannelAccountId':Number(_0x53ef5b[_0xc8f5('0x56')]['id'])});}}else{socket['emit'](_0xc8f5('0xb6'),{'UserId':Number(_0x53ef5b[_0xc8f5('0x43')]['ids']),'OpenchannelAccountId':Number(_0x53ef5b[_0xc8f5('0x56')]['id'])});}});}})[_0xc8f5('0x20')](respondWithStatusCode(_0x525e37,null))[_0xc8f5('0x2b')](handleError(_0x525e37,null));};exports['getAgents']=function(_0x5838a7,_0x58cb39,_0x22d232){var _0x3fb302={};var _0x53fe7f={};var _0x5e7002;var _0x40c853;return db[_0xc8f5('0x52')][_0xc8f5('0x6c')]({'where':{'id':_0x5838a7['params']['id']}})[_0xc8f5('0x20')](handleEntityNotFound(_0x58cb39,null))[_0xc8f5('0x20')](function(_0x1dd543){if(_0x1dd543){_0x5e7002=_0x1dd543;_0x53fe7f[_0xc8f5('0x47')]=_[_0xc8f5('0x44')](db['User'][_0xc8f5('0x3e')]);_0x53fe7f[_0xc8f5('0x43')]=_[_0xc8f5('0x44')](_0x5838a7[_0xc8f5('0x43')]);_0x53fe7f[_0xc8f5('0x45')]=_['intersection'](_0x53fe7f['model'],_0x53fe7f['query']);_0x3fb302[_0xc8f5('0x48')]=_[_0xc8f5('0x46')](_0x53fe7f[_0xc8f5('0x47')],qs['fields'](_0x5838a7['query'][_0xc8f5('0x49')]));_0x3fb302['attributes']=_0x3fb302['attributes'][_0xc8f5('0x57')]?_0x3fb302[_0xc8f5('0x48')]:_0x53fe7f['model'];_0x3fb302[_0xc8f5('0x4b')]=qs[_0xc8f5('0x4c')](_0x5838a7[_0xc8f5('0x43')]['sort']);_0x3fb302[_0xc8f5('0x4d')]=qs[_0xc8f5('0x45')](_[_0xc8f5('0x66')](_0x5838a7[_0xc8f5('0x43')],_0x53fe7f[_0xc8f5('0x45')]));if(_0x5838a7[_0xc8f5('0x43')][_0xc8f5('0x4e')]){_0x3fb302[_0xc8f5('0x4d')]=_[_0xc8f5('0x4f')](_0x3fb302[_0xc8f5('0x4d')],{'$or':_['map'](_0x3fb302[_0xc8f5('0x48')],function(_0x3ecf79){var _0x20bf46={};_0x20bf46[_0x3ecf79]={'$like':'%'+_0x5838a7[_0xc8f5('0x43')][_0xc8f5('0x4e')]+'%'};return _0x20bf46;})});}_0x3fb302=_[_0xc8f5('0x4f')]({},_0x3fb302,_0x5838a7[_0xc8f5('0x51')]);return _0x5e7002[_0xc8f5('0xb7')](_0x3fb302);}})[_0xc8f5('0x20')](function(_0x3bb510){if(_0x3bb510){_0x40c853=_0x3bb510[_0xc8f5('0x57')];if(!_0x5838a7['query']['hasOwnProperty'](_0xc8f5('0x65'))){_0x3fb302[_0xc8f5('0x31')]=qs[_0xc8f5('0x31')](_0x5838a7[_0xc8f5('0x43')][_0xc8f5('0x31')]);_0x3fb302['offset']=qs[_0xc8f5('0x30')](_0x5838a7['query'][_0xc8f5('0x30')]);}return _0x5e7002[_0xc8f5('0xb7')](_0x3fb302);}})[_0xc8f5('0x20')](function(_0x1cef86){if(_0x1cef86){return _0x1cef86?{'count':_0x40c853,'rows':_0x1cef86}:null;}})['then'](respondWithResult(_0x58cb39,null))[_0xc8f5('0x2b')](handleError(_0x58cb39,null));};exports['send']=function(_0x34731,_0x2231f0,_0xe4c018){var _0x2c3d47,_0x158765,_0x255ab7;if(_[_0xc8f5('0x77')](_0x34731[_0xc8f5('0x5a')][_0xc8f5('0x5a')])||_0x34731[_0xc8f5('0x5a')][_0xc8f5('0x5a')]===''){throw new db[(_0xc8f5('0x75'))][(_0xc8f5('0x76'))](_0xc8f5('0x78'));}if(_[_0xc8f5('0x77')](_0x34731[_0xc8f5('0x5a')]['to'])){}_0x2c3d47=_0x34731[_0xc8f5('0x5a')]['to'];return db[_0xc8f5('0x52')][_0xc8f5('0x6c')]({'where':{'id':_0x34731[_0xc8f5('0x56')]['id']}})[_0xc8f5('0x20')](handleEntityNotFound(_0x2231f0,null))[_0xc8f5('0x20')](function(_0x4fba97){if(_0x4fba97){return db[_0xc8f5('0x52')][_0xc8f5('0x5e')]({'where':{'id':_0x4fba97['id']},'include':[{'model':db['CmList'],'as':_0xc8f5('0x7d'),'include':[{'model':db[_0xc8f5('0x7e')],'as':'Contacts','where':{[_0x4fba97['mapKey']]:_0x2c3d47},'limit':0x1,'order':[[_0xc8f5('0x72'),_0xc8f5('0x80')]]}]}]})[_0xc8f5('0x20')](handleEntityNotFound(_0x2231f0,null))[_0xc8f5('0x20')](function(_0xe13843){if(_0xe13843&&_0xe13843[_0xc8f5('0x7d')]){_0x158765=_0xe13843['get']({'plain':!![]});if(_0x158765['List']&&_0x158765[_0xc8f5('0x7d')][_0xc8f5('0x7f')]['length']){return _0x158765[_0xc8f5('0x7d')][_0xc8f5('0x7f')][0x0];}return db[_0xc8f5('0x7e')][_0xc8f5('0x59')](_[_0xc8f5('0x19')](_0x34731['body'],{'firstName':_0x2c3d47,[_0xe13843[_0xc8f5('0x7a')]]:_0x2c3d47,'phone':_0x2c3d47,'ListId':_0x158765[_0xc8f5('0x73')]}));}})['then'](handleEntityNotFound(_0x2231f0,null))[_0xc8f5('0x20')](function(_0x2e9925){if(_0x2e9925){_0x255ab7=_0x2e9925;return db[_0xc8f5('0x8c')][_0xc8f5('0x5e')]({'where':{'ContactId':_0x255ab7['id'],'closed':![],'OpenchannelAccountId':_0x158765['id']}})[_0xc8f5('0x20')](function(_0x38487f){if(_0x38487f){return[_0x38487f,![]];}return db['OpenchannelInteraction'][_0xc8f5('0x59')]({'UserId':_0x34731[_0xc8f5('0x5b')]['id'],'ContactId':_0x255ab7['id'],'OpenchannelAccountId':_0x158765['id'],'lastMsgDirection':_0xc8f5('0xb8'),'Messages':[_[_0xc8f5('0x4f')](_0x34731[_0xc8f5('0x5a')],{'read':![],'body':_0x34731[_0xc8f5('0x5a')][_0xc8f5('0x5a')],'OpenchannelAccountId':_0x158765['id'],'UserId':_0x34731[_0xc8f5('0x5b')]['id'],'ContactId':_0x255ab7['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0xc8f5('0xb9')}]})[_0xc8f5('0x20')](function(_0x2a9e22){return[_0x2a9e22,!![]];});});}})[_0xc8f5('0x8e')](function(_0x3603df,_0xcab842){if(_0xcab842){return _0x3603df;}return db[_0xc8f5('0x96')][_0xc8f5('0x59')](_[_0xc8f5('0x4f')](_0x34731[_0xc8f5('0x5a')],{'read':![],'body':_0x34731[_0xc8f5('0x5a')][_0xc8f5('0x5a')],'OpenchannelAccountId':_0x158765['id'],'OpenchannelInteractionId':_0x3603df['id'],'UserId':_0x34731[_0xc8f5('0x5b')]['id'],'ContactId':_0x255ab7['id']}))[_0xc8f5('0x20')](function(_0x3f54f5){_0x3603df[_0xc8f5('0xba')][_0xc8f5('0xb9')]=[];_0x3603df[_0xc8f5('0xba')][_0xc8f5('0xb9')][_0xc8f5('0x92')](_0x3f54f5[_0xc8f5('0xba')]);return _0x3603df;});});}})['then'](respondWithResult(_0x2231f0,null))[_0xc8f5('0x2b')](handleError(_0x2231f0,null));}; \ No newline at end of file +var _0x9ed9=['info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','OpenchannelAccounts','stack','name','send','index','mandatoryDispositionPause','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','OpenchannelAccount','includeAll','include','findAll','rows','show','params','Pause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','CompanyId','isNil','from\x20is\x20mandatory','ValidationError','mapKey','from','Contacts','Applications','applications','list','List','priority','asc','account','contact','threadId','externalUrl','OpenchannelInteraction','ContactId','lastName','messageId','interaction','created','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','OpenchannelApplication','bulkCreate','findAndCountAll','finally','sendStatus','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','ids','omit','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','CmList','DESC','defaults','dataValues','Messages','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./openchannelAccount.socket','register','jayson/promise','client','request','then'];(function(_0x2125f0,_0x2f23b9){var _0x12d6eb=function(_0x7a43ea){while(--_0x7a43ea){_0x2125f0['push'](_0x2125f0['shift']());}};_0x12d6eb(++_0x2f23b9);}(_0x9ed9,0xa0));var _0x99ed=function(_0x2cfee7,_0x1b3757){_0x2cfee7=_0x2cfee7-0x0;var _0xb53aef=_0x9ed9[_0x2cfee7];return _0xb53aef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x99ed('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x99ed('0x1'));var rp=require(_0x99ed('0x2'));var moment=require(_0x99ed('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x99ed('0x4'));var util=require(_0x99ed('0x5'));var path=require('path');var sox=require(_0x99ed('0x6'));var csv=require(_0x99ed('0x7'));var ejs=require(_0x99ed('0x8'));var fs=require('fs');var fs_extra=require(_0x99ed('0x9'));var _=require('lodash');var squel=require(_0x99ed('0xa'));var crypto=require(_0x99ed('0xb'));var jsforce=require(_0x99ed('0xc'));var deskjs=require(_0x99ed('0xd'));var toCsv=require(_0x99ed('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99ed('0xe'));var authService=require(_0x99ed('0xf'));var qs=require(_0x99ed('0x10'));var as=require(_0x99ed('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x99ed('0x12'))(_0x99ed('0x13'));var utils=require(_0x99ed('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x99ed('0x15'));var db=require(_0x99ed('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x99ed('0x17'),'port':0x18eb});var socket=require(_0x99ed('0x18'))(new Redis(config[_0x99ed('0x19')]));require(_0x99ed('0x1a'))[_0x99ed('0x1b')](socket);var jayson=require(_0x99ed('0x1c'));var client=jayson[_0x99ed('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x99ed('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d8b6b,_0x4c617f,_0x25d490,_0x3432ee){return new BPromise(function(_0x5c5f89,_0x4facd1){var _0x198c8e=_0x3432ee||client;return _0x198c8e[_0x99ed('0x1e')](_0x3d8b6b,_0x25d490)[_0x99ed('0x1f')](function(_0x55e41b){logger[_0x99ed('0x20')](_0x99ed('0x21'),_0x4c617f,_0x99ed('0x22'));logger[_0x99ed('0x23')](_0x99ed('0x24'),_0x4c617f,_0x99ed('0x22'),JSON['stringify'](_0x55e41b));if(_0x55e41b['error']){if(_0x55e41b[_0x99ed('0x25')][_0x99ed('0x26')]===0x1f4){logger['error'](_0x99ed('0x21'),_0x4c617f,_0x55e41b['error'][_0x99ed('0x27')]);return _0x4facd1(_0x55e41b[_0x99ed('0x25')][_0x99ed('0x27')]);}logger[_0x99ed('0x25')](_0x99ed('0x21'),_0x4c617f,_0x55e41b[_0x99ed('0x25')][_0x99ed('0x27')]);return _0x5c5f89(_0x55e41b[_0x99ed('0x25')]['message']);}else{logger[_0x99ed('0x20')](_0x99ed('0x21'),_0x4c617f,_0x99ed('0x22'));_0x5c5f89(_0x55e41b['result'][_0x99ed('0x27')]);}})[_0x99ed('0x28')](function(_0x346e46){logger[_0x99ed('0x25')](_0x99ed('0x21'),_0x4c617f,_0x346e46);_0x4facd1(_0x346e46);});});}function respondWithStatusCode(_0x28ae11,_0x155330){_0x155330=_0x155330||0xcc;return function(_0x4280d4){if(_0x4280d4){return _0x28ae11['sendStatus'](_0x155330);}return _0x28ae11[_0x99ed('0x29')](_0x155330)[_0x99ed('0x2a')]();};}function respondWithResult(_0x4a5f39,_0x480be7){_0x480be7=_0x480be7||0xc8;return function(_0x342ede){if(_0x342ede){return _0x4a5f39['status'](_0x480be7)[_0x99ed('0x2b')](_0x342ede);}};}function respondWithFilteredResult(_0x28c7ab,_0x4d40){return function(_0x58d722){if(_0x58d722){var _0x1b445b=typeof _0x4d40[_0x99ed('0x2c')]===_0x99ed('0x2d')&&typeof _0x4d40[_0x99ed('0x2e')]===_0x99ed('0x2d');var _0x2c5871=_0x58d722[_0x99ed('0x2f')];var _0x44d033=_0x1b445b?0x0:_0x4d40[_0x99ed('0x2c')];var _0x130a37=_0x1b445b?_0x58d722['count']:_0x4d40[_0x99ed('0x2c')]+_0x4d40[_0x99ed('0x2e')];var _0x40182a;if(_0x130a37>=_0x2c5871){_0x130a37=_0x2c5871;_0x40182a=0xc8;}else{_0x40182a=0xce;}_0x28c7ab[_0x99ed('0x29')](_0x40182a);return _0x28c7ab[_0x99ed('0x30')]('Content-Range',_0x44d033+'-'+_0x130a37+'/'+_0x2c5871)[_0x99ed('0x2b')](_0x58d722);}return null;};}function patchUpdates(_0x216c29){return function(_0x1102e1){try{jsonpatch['apply'](_0x1102e1,_0x216c29,!![]);}catch(_0x51fa1e){return BPromise[_0x99ed('0x31')](_0x51fa1e);}return _0x1102e1[_0x99ed('0x32')]();};}function saveUpdates(_0x155efc,_0x467330){return function(_0x590c75){if(_0x590c75){return _0x590c75[_0x99ed('0x33')](_0x155efc)[_0x99ed('0x1f')](function(_0x2d0aec){return _0x2d0aec;});}return null;};}function removeEntity(_0x4d3c22,_0x23ae22){return function(_0x3cc972){if(_0x3cc972){return _0x3cc972[_0x99ed('0x34')]()[_0x99ed('0x1f')](function(){var _0x642e61=_0x3cc972['get']({'plain':!![]});var _0x10af4a=_0x99ed('0x35');return db['UserProfileResource']['destroy']({'where':{'type':_0x10af4a,'resourceId':_0x642e61['id']}})['then'](function(){return _0x3cc972;});})[_0x99ed('0x1f')](function(){_0x4d3c22['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc7cdb2,_0x1f1d88){return function(_0x359163){if(!_0x359163){_0xc7cdb2['sendStatus'](0x194);}return _0x359163;};}function handleError(_0x297497,_0x490568){_0x490568=_0x490568||0x1f4;return function(_0x28218a){logger[_0x99ed('0x25')](_0x28218a[_0x99ed('0x36')]);if(_0x28218a[_0x99ed('0x37')]){delete _0x28218a['name'];}_0x297497[_0x99ed('0x29')](_0x490568)[_0x99ed('0x38')](_0x28218a);};}exports[_0x99ed('0x39')]=function(_0x9beed1,_0x3b2edb){var _0x2699fd={'include':[{'model':db['Pause'],'as':_0x99ed('0x3a')}]},_0x3e2bd0={},_0x5014dc={'count':0x0,'rows':[]};var _0x495ef4=_['map'](db['OpenchannelAccount'][_0x99ed('0x3b')],function(_0x5ec7e0){return{'name':_0x5ec7e0[_0x99ed('0x3c')],'type':_0x5ec7e0['type'][_0x99ed('0x3d')]};});_0x3e2bd0[_0x99ed('0x3e')]=_[_0x99ed('0x3f')](_0x495ef4,_0x99ed('0x37'));_0x3e2bd0[_0x99ed('0x40')]=_[_0x99ed('0x41')](_0x9beed1[_0x99ed('0x40')]);_0x3e2bd0[_0x99ed('0x42')]=_[_0x99ed('0x43')](_0x3e2bd0[_0x99ed('0x3e')],_0x3e2bd0['query']);_0x2699fd[_0x99ed('0x44')]=_['intersection'](_0x3e2bd0[_0x99ed('0x3e')],qs[_0x99ed('0x45')](_0x9beed1[_0x99ed('0x40')][_0x99ed('0x45')]));_0x2699fd[_0x99ed('0x44')]=_0x2699fd[_0x99ed('0x44')][_0x99ed('0x46')]?_0x2699fd[_0x99ed('0x44')]:_0x3e2bd0[_0x99ed('0x3e')];if(!_0x9beed1[_0x99ed('0x40')][_0x99ed('0x47')](_0x99ed('0x48'))){_0x2699fd[_0x99ed('0x2e')]=qs[_0x99ed('0x2e')](_0x9beed1[_0x99ed('0x40')][_0x99ed('0x2e')]);_0x2699fd[_0x99ed('0x2c')]=qs[_0x99ed('0x2c')](_0x9beed1['query'][_0x99ed('0x2c')]);}_0x2699fd[_0x99ed('0x49')]=qs[_0x99ed('0x4a')](_0x9beed1['query'][_0x99ed('0x4a')]);_0x2699fd[_0x99ed('0x4b')]=qs['filters'](_[_0x99ed('0x4c')](_0x9beed1[_0x99ed('0x40')],_0x3e2bd0['filters']),_0x495ef4);if(_0x9beed1['query'][_0x99ed('0x4d')]){_0x2699fd[_0x99ed('0x4b')]=_['merge'](_0x2699fd['where'],{'$or':_[_0x99ed('0x3f')](_0x495ef4,function(_0x4c51aa){if(_0x4c51aa[_0x99ed('0x4e')]!==_0x99ed('0x4f')){var _0x3ff446={};_0x3ff446[_0x4c51aa[_0x99ed('0x37')]]={'$like':'%'+_0x9beed1['query'][_0x99ed('0x4d')]+'%'};return _0x3ff446;}})});}_0x2699fd=_[_0x99ed('0x50')]({},_0x2699fd,_0x9beed1[_0x99ed('0x51')]);var _0x1aa299={'where':_0x2699fd[_0x99ed('0x4b')]};return db[_0x99ed('0x52')][_0x99ed('0x2f')](_0x1aa299)[_0x99ed('0x1f')](function(_0x3f214c){_0x5014dc[_0x99ed('0x2f')]=_0x3f214c;if(_0x9beed1['query'][_0x99ed('0x53')]){_0x2699fd[_0x99ed('0x54')]=[{'all':!![]}];}return db[_0x99ed('0x52')][_0x99ed('0x55')](_0x2699fd);})[_0x99ed('0x1f')](function(_0x4ce6fb){_0x5014dc[_0x99ed('0x56')]=_0x4ce6fb;return _0x5014dc;})['then'](respondWithFilteredResult(_0x3b2edb,_0x2699fd))[_0x99ed('0x28')](handleError(_0x3b2edb,null));};exports[_0x99ed('0x57')]=function(_0x36dff4,_0x3aac65){var _0x3130bb={'raw':![],'where':{'id':_0x36dff4[_0x99ed('0x58')]['id']},'include':[{'model':db[_0x99ed('0x59')],'as':_0x99ed('0x3a')}]},_0x4c3d53={};_0x4c3d53[_0x99ed('0x3e')]=_[_0x99ed('0x41')](db['OpenchannelAccount'][_0x99ed('0x3b')]);_0x4c3d53['query']=_[_0x99ed('0x41')](_0x36dff4['query']);_0x4c3d53['filters']=_[_0x99ed('0x43')](_0x4c3d53['model'],_0x4c3d53[_0x99ed('0x40')]);_0x3130bb[_0x99ed('0x44')]=_['intersection'](_0x4c3d53[_0x99ed('0x3e')],qs[_0x99ed('0x45')](_0x36dff4[_0x99ed('0x40')][_0x99ed('0x45')]));_0x3130bb[_0x99ed('0x44')]=_0x3130bb[_0x99ed('0x44')][_0x99ed('0x46')]?_0x3130bb[_0x99ed('0x44')]:_0x4c3d53['model'];if(_0x36dff4[_0x99ed('0x40')][_0x99ed('0x53')]){_0x3130bb['include']=[{'all':!![]}];}_0x3130bb=_['merge']({},_0x3130bb,_0x36dff4[_0x99ed('0x51')]);return db[_0x99ed('0x52')][_0x99ed('0x5a')](_0x3130bb)[_0x99ed('0x1f')](handleEntityNotFound(_0x3aac65,null))[_0x99ed('0x1f')](respondWithResult(_0x3aac65,null))[_0x99ed('0x28')](handleError(_0x3aac65,null));};exports[_0x99ed('0x5b')]=function(_0x23f7b2,_0x537f63){return db[_0x99ed('0x52')][_0x99ed('0x5b')](_0x23f7b2[_0x99ed('0x5c')],{})[_0x99ed('0x1f')](function(_0x37283b){var _0x30f8ae=_0x23f7b2[_0x99ed('0x5d')]['get']({'plain':!![]});if(!_0x30f8ae)throw new Error(_0x99ed('0x5e'));if(_0x30f8ae[_0x99ed('0x5f')]===_0x99ed('0x5d')){var _0x5d9d39=_0x37283b[_0x99ed('0x60')]({'plain':!![]});var _0x1373ba=_0x99ed('0x35');return db[_0x99ed('0x61')][_0x99ed('0x5a')]({'where':{'name':_0x1373ba,'userProfileId':_0x30f8ae[_0x99ed('0x62')]},'raw':!![]})[_0x99ed('0x1f')](function(_0x3857a7){if(_0x3857a7&&_0x3857a7[_0x99ed('0x63')]===0x0){return db[_0x99ed('0x64')][_0x99ed('0x5b')]({'name':_0x5d9d39[_0x99ed('0x37')],'resourceId':_0x5d9d39['id'],'type':_0x3857a7[_0x99ed('0x37')],'sectionId':_0x3857a7['id']},{})['then'](function(){return _0x37283b;});}else{return _0x37283b;}})[_0x99ed('0x28')](function(_0x2b2f93){logger[_0x99ed('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b2f93);throw _0x2b2f93;});}return _0x37283b;})['then'](respondWithResult(_0x537f63,0xc9))['catch'](handleError(_0x537f63,null));};exports[_0x99ed('0x33')]=function(_0x5a2558,_0x483c1b){if(_0x5a2558['body']['id']){delete _0x5a2558['body']['id'];}return db[_0x99ed('0x52')]['find']({'where':{'id':_0x5a2558[_0x99ed('0x58')]['id']},'include':[{'model':db[_0x99ed('0x59')],'as':_0x99ed('0x3a')}]})[_0x99ed('0x1f')](handleEntityNotFound(_0x483c1b,null))[_0x99ed('0x1f')](saveUpdates(_0x5a2558[_0x99ed('0x5c')],null))[_0x99ed('0x1f')](respondWithResult(_0x483c1b,null))[_0x99ed('0x28')](handleError(_0x483c1b,null));};exports[_0x99ed('0x34')]=function(_0x188619,_0x107450){return db[_0x99ed('0x52')]['find']({'where':{'id':_0x188619[_0x99ed('0x58')]['id']}})[_0x99ed('0x1f')](handleEntityNotFound(_0x107450,null))[_0x99ed('0x1f')](removeEntity(_0x107450,null))[_0x99ed('0x28')](handleError(_0x107450,null));};exports['describe']=function(_0x46eb74,_0x36257e){return db['OpenchannelAccount'][_0x99ed('0x65')]()[_0x99ed('0x1f')](respondWithResult(_0x36257e,null))['catch'](handleError(_0x36257e,null));};exports[_0x99ed('0x66')]=function(_0x14ef3d,_0x4e8303,_0x341075){if(_0x14ef3d[_0x99ed('0x5c')]['id']){delete _0x14ef3d['body']['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x14ef3d[_0x99ed('0x58')]['id']}})[_0x99ed('0x1f')](handleEntityNotFound(_0x4e8303,null))[_0x99ed('0x1f')](function(_0x569dd6){if(_0x569dd6){_0x14ef3d[_0x99ed('0x5c')][_0x99ed('0x67')]=_0x569dd6['id'];return db[_0x99ed('0x68')][_0x99ed('0x5b')](_0x14ef3d[_0x99ed('0x5c')]);}})[_0x99ed('0x1f')](respondWithResult(_0x4e8303,null))['catch'](handleError(_0x4e8303,null));};exports[_0x99ed('0x69')]=function(_0x3e0965,_0x446588,_0x53eb93){var _0x3c7f7c={'raw':![],'where':{}};var _0x3eaf5a={};var _0x3e30c2={'count':0x0,'rows':[]};return db[_0x99ed('0x52')][_0x99ed('0x6a')]({'where':{'id':_0x3e0965['params']['id']}})[_0x99ed('0x1f')](handleEntityNotFound(_0x446588,null))[_0x99ed('0x1f')](function(_0x9cd2ef){if(_0x9cd2ef){_0x3eaf5a[_0x99ed('0x3e')]=_[_0x99ed('0x41')](db[_0x99ed('0x68')][_0x99ed('0x3b')]);_0x3eaf5a[_0x99ed('0x40')]=_[_0x99ed('0x41')](_0x3e0965[_0x99ed('0x40')]);_0x3eaf5a[_0x99ed('0x42')]=_[_0x99ed('0x43')](_0x3eaf5a[_0x99ed('0x3e')],_0x3eaf5a[_0x99ed('0x40')]);_0x3c7f7c[_0x99ed('0x44')]=_[_0x99ed('0x43')](_0x3eaf5a[_0x99ed('0x3e')],qs[_0x99ed('0x45')](_0x3e0965[_0x99ed('0x40')][_0x99ed('0x45')]));_0x3c7f7c[_0x99ed('0x44')]=_0x3c7f7c['attributes']['length']?_0x3c7f7c['attributes']:_0x3eaf5a['model'];if(!_0x3e0965[_0x99ed('0x40')][_0x99ed('0x47')](_0x99ed('0x48'))){_0x3c7f7c[_0x99ed('0x2e')]=qs[_0x99ed('0x2e')](_0x3e0965['query'][_0x99ed('0x2e')]);_0x3c7f7c['offset']=qs[_0x99ed('0x2c')](_0x3e0965[_0x99ed('0x40')]['offset']);}_0x3c7f7c[_0x99ed('0x49')]=qs[_0x99ed('0x4a')](_0x3e0965[_0x99ed('0x40')][_0x99ed('0x4a')]);_0x3c7f7c[_0x99ed('0x4b')]=qs[_0x99ed('0x42')](_[_0x99ed('0x4c')](_0x3e0965['query'],_0x3eaf5a[_0x99ed('0x42')]));_0x3c7f7c[_0x99ed('0x4b')][_0x99ed('0x67')]=_0x9cd2ef['id'];if(_0x3e0965['query']['filter']){_0x3c7f7c[_0x99ed('0x4b')]=_[_0x99ed('0x50')](_0x3c7f7c[_0x99ed('0x4b')],{'$or':_[_0x99ed('0x3f')](_0x3c7f7c[_0x99ed('0x44')],function(_0x3462dd){var _0x196fc8={};_0x196fc8[_0x3462dd]={'$like':'%'+_0x3e0965[_0x99ed('0x40')][_0x99ed('0x4d')]+'%'};return _0x196fc8;})});}_0x3c7f7c=_['merge']({},_0x3c7f7c,_0x3e0965['options']);return db[_0x99ed('0x68')][_0x99ed('0x2f')]({'where':_0x3c7f7c[_0x99ed('0x4b')]})[_0x99ed('0x1f')](function(_0x4318b3){_0x3e30c2[_0x99ed('0x2f')]=_0x4318b3;if(_0x3e0965[_0x99ed('0x40')][_0x99ed('0x53')]){_0x3c7f7c[_0x99ed('0x54')]=[{'all':!![]}];}return db[_0x99ed('0x68')][_0x99ed('0x55')](_0x3c7f7c);})['then'](function(_0x5739f2){_0x3e30c2[_0x99ed('0x56')]=_0x5739f2;return _0x3e30c2;});}})[_0x99ed('0x1f')](respondWithFilteredResult(_0x446588,_0x3c7f7c))[_0x99ed('0x28')](handleError(_0x446588,null));};exports[_0x99ed('0x6b')]=function(_0x133984,_0x6e4c72,_0x47d9d8){return db[_0x99ed('0x52')][_0x99ed('0x5a')]({'where':{'id':_0x133984[_0x99ed('0x58')]['id']}})['then'](handleEntityNotFound(_0x6e4c72,null))[_0x99ed('0x1f')](function(_0x43ef44){if(_0x43ef44){return _0x43ef44['removeDispositions'](_0x133984['query']['ids']);}})['then'](respondWithStatusCode(_0x6e4c72,null))[_0x99ed('0x28')](handleError(_0x6e4c72,null));};exports[_0x99ed('0x6c')]=function(_0x4898aa,_0x48f9d3,_0x1aa8dd){if(_0x4898aa[_0x99ed('0x5c')]['id']){delete _0x4898aa[_0x99ed('0x5c')]['id'];}return db[_0x99ed('0x52')][_0x99ed('0x5a')]({'where':{'id':_0x4898aa[_0x99ed('0x58')]['id']}})[_0x99ed('0x1f')](handleEntityNotFound(_0x48f9d3,null))[_0x99ed('0x1f')](function(_0x386b25){if(_0x386b25){_0x4898aa[_0x99ed('0x5c')][_0x99ed('0x67')]=_0x386b25['id'];return db[_0x99ed('0x6d')][_0x99ed('0x5b')](_0x4898aa[_0x99ed('0x5c')]);}})[_0x99ed('0x1f')](respondWithResult(_0x48f9d3,null))[_0x99ed('0x28')](handleError(_0x48f9d3,null));};exports[_0x99ed('0x6e')]=function(_0x509b14,_0x2610cb,_0x4fd283){var _0x1c9238={'raw':![],'where':{}};var _0x187de9={};var _0x32ac16={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x99ed('0x6a')]({'where':{'id':_0x509b14[_0x99ed('0x58')]['id']}})[_0x99ed('0x1f')](handleEntityNotFound(_0x2610cb,null))[_0x99ed('0x1f')](function(_0x52bcb2){if(_0x52bcb2){_0x187de9[_0x99ed('0x3e')]=_['keys'](db['CannedAnswer'][_0x99ed('0x3b')]);_0x187de9[_0x99ed('0x40')]=_[_0x99ed('0x41')](_0x509b14['query']);_0x187de9[_0x99ed('0x42')]=_['intersection'](_0x187de9[_0x99ed('0x3e')],_0x187de9[_0x99ed('0x40')]);_0x1c9238[_0x99ed('0x44')]=_[_0x99ed('0x43')](_0x187de9[_0x99ed('0x3e')],qs['fields'](_0x509b14[_0x99ed('0x40')][_0x99ed('0x45')]));_0x1c9238[_0x99ed('0x44')]=_0x1c9238[_0x99ed('0x44')]['length']?_0x1c9238[_0x99ed('0x44')]:_0x187de9[_0x99ed('0x3e')];if(!_0x509b14[_0x99ed('0x40')]['hasOwnProperty']('nolimit')){_0x1c9238[_0x99ed('0x2e')]=qs[_0x99ed('0x2e')](_0x509b14[_0x99ed('0x40')][_0x99ed('0x2e')]);_0x1c9238[_0x99ed('0x2c')]=qs['offset'](_0x509b14[_0x99ed('0x40')][_0x99ed('0x2c')]);}_0x1c9238[_0x99ed('0x49')]=qs[_0x99ed('0x4a')](_0x509b14['query'][_0x99ed('0x4a')]);_0x1c9238[_0x99ed('0x4b')]=qs['filters'](_[_0x99ed('0x4c')](_0x509b14[_0x99ed('0x40')],_0x187de9[_0x99ed('0x42')]));_0x1c9238[_0x99ed('0x4b')][_0x99ed('0x67')]=_0x52bcb2['id'];if(_0x509b14['query']['filter']){_0x1c9238[_0x99ed('0x4b')]=_[_0x99ed('0x50')](_0x1c9238['where'],{'$or':_['map'](_0x1c9238[_0x99ed('0x44')],function(_0x891fcb){var _0x37feea={};_0x37feea[_0x891fcb]={'$like':'%'+_0x509b14[_0x99ed('0x40')]['filter']+'%'};return _0x37feea;})});}_0x1c9238=_[_0x99ed('0x50')]({},_0x1c9238,_0x509b14[_0x99ed('0x51')]);return db[_0x99ed('0x6d')]['count']({'where':_0x1c9238[_0x99ed('0x4b')]})[_0x99ed('0x1f')](function(_0x477a6a){_0x32ac16['count']=_0x477a6a;if(_0x509b14['query'][_0x99ed('0x53')]){_0x1c9238['include']=[{'all':!![]}];}return db[_0x99ed('0x6d')][_0x99ed('0x55')](_0x1c9238);})[_0x99ed('0x1f')](function(_0x5096cc){_0x32ac16[_0x99ed('0x56')]=_0x5096cc;return _0x32ac16;});}})[_0x99ed('0x1f')](respondWithFilteredResult(_0x2610cb,_0x1c9238))['catch'](handleError(_0x2610cb,null));};exports[_0x99ed('0x6f')]=function(_0x5d4916,_0x9c18d2,_0x3c4867){return db[_0x99ed('0x52')][_0x99ed('0x5a')]({'where':{'id':_0x5d4916[_0x99ed('0x58')]['id']}})[_0x99ed('0x1f')](handleEntityNotFound(_0x9c18d2,null))['then'](function(_0x327c23){if(_0x327c23){return _0x327c23[_0x99ed('0x6f')](_0x5d4916[_0x99ed('0x40')]['ids']);}})[_0x99ed('0x1f')](respondWithStatusCode(_0x9c18d2,null))['catch'](handleError(_0x9c18d2,null));};exports[_0x99ed('0x70')]=function(_0x47e6c0,_0x5150a8,_0x1e220f){var _0x4b40c6={'body':_0x47e6c0[_0x99ed('0x5c')],'channel':_0x99ed('0x71')};var _0x1ab87e=[];var _0x1290d3=[];var _0x3aaf3={};var _0x5c54f9=![];return db[_0x99ed('0x72')][_0x99ed('0x65')]()[_0x99ed('0x1f')](function(_0x29798f){if(!_0x29798f){throw new db[(_0x99ed('0x73'))]['ValidationError'](_0x99ed('0x74'));}_0x1ab87e=_[_0x99ed('0x75')](_[_0x99ed('0x41')](_0x29798f),['createdAt',_0x99ed('0x76')]);_0x1290d3=_[_0x99ed('0x75')](_['keys'](_0x29798f),['createdAt',_0x99ed('0x76'),_0x99ed('0x77'),'ListId']);if(_0x47e6c0[_0x99ed('0x5c')]['id']){delete _0x47e6c0[_0x99ed('0x5c')]['id'];}if(_[_0x99ed('0x78')](_0x47e6c0[_0x99ed('0x5c')]['from'])){throw new db[(_0x99ed('0x73'))]['ValidationError'](_0x99ed('0x79'));}if(_[_0x99ed('0x78')](_0x47e6c0[_0x99ed('0x5c')][_0x99ed('0x5c')])||_0x47e6c0['body'][_0x99ed('0x5c')]===''){throw new db[(_0x99ed('0x73'))][(_0x99ed('0x7a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x99ed('0x78')](_0x47e6c0['body']['mapKey'])){throw new db[(_0x99ed('0x73'))][(_0x99ed('0x7a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1290d3);}if(!_['includes'](_0x1290d3,_0x47e6c0['body']['mapKey'])){throw new db[(_0x99ed('0x73'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1290d3);}_0x3aaf3[_0x47e6c0[_0x99ed('0x5c')][_0x99ed('0x7b')]]=_0x47e6c0[_0x99ed('0x5c')][_0x99ed('0x7c')];})['then'](function(){return db['OpenchannelAccount'][_0x99ed('0x5a')]({'where':{'id':_0x47e6c0[_0x99ed('0x58')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0x99ed('0x7d'),'where':_0x3aaf3,'limit':0x1,'order':[[_0x99ed('0x76'),'DESC']]}]},{'model':db['OpenchannelApplication'],'as':_0x99ed('0x7e')}]});})[_0x99ed('0x1f')](handleEntityNotFound(_0x5150a8,null))['then'](function(_0x2489f2){if(_0x2489f2&&_0x2489f2['List']){_0x4b40c6['account']=_0x2489f2;_0x4b40c6[_0x99ed('0x7f')]=_0x2489f2['Applications'];_0x4b40c6[_0x99ed('0x80')]=_0x2489f2[_0x99ed('0x81')];_0x4b40c6['applications']=_['orderBy'](_0x4b40c6[_0x99ed('0x7f')],[_0x99ed('0x82')],[_0x99ed('0x83')]);if(_0x4b40c6['account']['Applications']){delete _0x4b40c6[_0x99ed('0x84')][_0x99ed('0x7e')];}if(_0x4b40c6[_0x99ed('0x84')][_0x99ed('0x81')]&&_0x4b40c6[_0x99ed('0x84')][_0x99ed('0x81')][_0x99ed('0x7d')][_0x99ed('0x46')]){return _0x4b40c6['account'][_0x99ed('0x81')][_0x99ed('0x7d')][0x0];}var _0x3cdcaf=_['defaults'](_0x47e6c0[_0x99ed('0x5c')],{'firstName':_0x47e6c0[_0x99ed('0x5c')]['from'],'ListId':_0x2489f2['ListId']});_0x3cdcaf[_0x47e6c0[_0x99ed('0x5c')]['mapKey']]=_0x47e6c0['body'][_0x99ed('0x7c')];return db[_0x99ed('0x72')]['create'](_0x3cdcaf,{'fields':_0x1ab87e,'raw':!![]});}})['then'](handleEntityNotFound(_0x5150a8,null))[_0x99ed('0x1f')](function(_0x463e66){_0x4b40c6[_0x99ed('0x85')]=_0x463e66;if(_0x463e66){var _0x31dd63={'ContactId':_0x463e66['id'],'OpenchannelAccountId':_0x47e6c0[_0x99ed('0x58')]['id'],'from':(_0x463e66['firstName']||'')+'\x20'+(_0x463e66['lastName']||'')};var _0x57d86e={'OpenchannelAccountId':_0x47e6c0[_0x99ed('0x58')]['id'],'closed':![]};if(_0x47e6c0[_0x99ed('0x5c')][_0x99ed('0x86')]){_0x57d86e[_0x99ed('0x86')]=_0x47e6c0['body']['threadId'];return db['OpenchannelInteraction'][_0x99ed('0x5a')]({'where':_0x57d86e})[_0x99ed('0x1f')](function(_0x4a8ef2){if(_0x4a8ef2){return[_0x4a8ef2,![]];}_0x31dd63[_0x99ed('0x86')]=_0x47e6c0[_0x99ed('0x5c')]['threadId'];_0x31dd63[_0x99ed('0x87')]=_0x47e6c0[_0x99ed('0x5c')]['externalUrl'];return db[_0x99ed('0x88')][_0x99ed('0x5b')](_0x31dd63)[_0x99ed('0x1f')](function(_0x428e78){return[_0x428e78,!![]];});});}else{_0x57d86e[_0x99ed('0x86')]=null;}_0x57d86e[_0x99ed('0x89')]=_0x463e66['id'];return db[_0x99ed('0x88')][_0x99ed('0x5a')]({'where':_0x57d86e})['then'](function(_0x6e9e68){if(_0x6e9e68){return[_0x6e9e68,![]];}return db[_0x99ed('0x88')][_0x99ed('0x5b')](_0x31dd63)[_0x99ed('0x1f')](function(_0x23a725){return[_0x23a725,!![]];});});}})['spread'](function(_0x4e5277,_0x547ca){if(_0x4e5277){_0x5c54f9=_0x547ca;if(!_0x547ca){var _0x4160de={'from':(_0x4b40c6['contact']['firstName']||'')+'\x20'+(_0x4b40c6[_0x99ed('0x85')][_0x99ed('0x8a')]||'')};if(_0x47e6c0[_0x99ed('0x5c')]['threadId']&&_0x47e6c0[_0x99ed('0x5c')][_0x99ed('0x8b')]&&_0x47e6c0[_0x99ed('0x5c')]['threadId']!=_0x47e6c0[_0x99ed('0x5c')]['messageId']){_0x4160de[_0x99ed('0x86')]=_0x47e6c0[_0x99ed('0x5c')][_0x99ed('0x8b')];}return _0x4e5277[_0x99ed('0x33')](_0x4160de);}else{return _0x4e5277;}}})[_0x99ed('0x1f')](function(_0x205522){_0x4b40c6[_0x99ed('0x8c')]=_0x205522['get']({'plain':!![]});_0x4b40c6[_0x99ed('0x8c')][_0x99ed('0x8d')]=_0x5c54f9;if(_0x4b40c6[_0x99ed('0x8c')][_0x99ed('0x8d')]){if(_0x4b40c6[_0x99ed('0x84')]['autoclose']){_0x4b40c6['applications'][_0x99ed('0x8e')]({'id':0x0,'priority':_0x4b40c6[_0x99ed('0x7f')][_0x99ed('0x46')]+0x1,'app':_0x99ed('0x8f'),'appdata':_0x99ed('0x90'),'interval':_0x99ed('0x91')});}}return db[_0x99ed('0x92')][_0x99ed('0x5b')]({'body':_0x47e6c0[_0x99ed('0x5c')]['body'],'OpenchannelAccountId':_0x47e6c0[_0x99ed('0x58')]['id'],'OpenchannelInteractionId':_0x205522['id'],'direction':'in','ContactId':_0x4b40c6[_0x99ed('0x85')]['id'],'AttachmentId':_0x47e6c0['body'][_0x99ed('0x93')]});})[_0x99ed('0x1f')](function(_0x47f2fb){_0x4b40c6[_0x99ed('0x27')]=_0x47f2fb;if(_0x4b40c6['interaction'][_0x99ed('0x94')]){return db['User'][_0x99ed('0x5a')]({'attributes':['id',_0x99ed('0x37')],'where':{'id':_0x4b40c6[_0x99ed('0x8c')][_0x99ed('0x94')]}})[_0x99ed('0x1f')](function(_0x58a27b){if(_0x58a27b){_0x4b40c6['applications'][_0x99ed('0x95')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x58a27b['name']+','+(_0x4b40c6[_0x99ed('0x84')][_0x99ed('0x96')]||0xa),'interval':'*,*,*,*'});_0x4b40c6[_0x99ed('0x97')]=![];}return respondWithRpcPromise(_0x99ed('0x98'),'startRouting',_0x4b40c6);});}return respondWithRpcPromise(_0x99ed('0x98'),_0x99ed('0x99'),_0x4b40c6);})[_0x99ed('0x1f')](function(_0x5b93ab){respondWithRpcPromise(_0x99ed('0x9a'),_0x99ed('0x9a'),{'event':_0x99ed('0x70'),'message':_0x5b93ab},client9002);return _0x5b93ab;})[_0x99ed('0x1f')](respondWithResult(_0x5150a8,null))[_0x99ed('0x28')](handleError(_0x5150a8,null));};exports[_0x99ed('0x9b')]=function(_0x24e30a,_0x7ba2d3){var _0x121b83=_0x24e30a[_0x99ed('0x58')]['id'];var _0x2a6e03=_0x24e30a[_0x99ed('0x5c')];var _0x1d9ff0=0xc8;var _0x12fdc0=null;return db[_0x99ed('0x9c')]['transaction']({'isolationLevel':db[_0x99ed('0x9c')][_0x99ed('0x9d')][_0x99ed('0x9e')][_0x99ed('0x9f')]},function(_0x1564d1){return db[_0x99ed('0x52')][_0x99ed('0x6a')]({'where':{'id':_0x121b83},'transaction':_0x1564d1})[_0x99ed('0x1f')](function(_0x2d17ca){if(_0x2d17ca){return db[_0x99ed('0xa0')][_0x99ed('0x34')]({'where':{'OpenchannelAccountId':_0x121b83},'transaction':_0x1564d1})[_0x99ed('0x1f')](function(){var _0x220174=_[_0x99ed('0x3f')](_0x2a6e03,function(_0x2556a6){_0x2556a6[_0x99ed('0x67')]=_0x121b83;return _0x2556a6;});return db['OpenchannelApplication'][_0x99ed('0xa1')](_0x220174,{'transaction':_0x1564d1});});}else{_0x1d9ff0=0x194;_0x12fdc0=[];}});})[_0x99ed('0x1f')](function(){if(_0x1d9ff0!==0x194){return db['OpenchannelApplication'][_0x99ed('0xa2')]({'where':{'OpenchannelAccountId':_0x121b83},'order':_0x99ed('0x82')})[_0x99ed('0x1f')](function(_0x2feed3){_0x12fdc0=_0x2feed3;});}})[_0x99ed('0x28')](function(_0x1ffc48){_0x1d9ff0=0x1f4;logger[_0x99ed('0x25')](_0x1ffc48[_0x99ed('0x36')]);if(_0x1ffc48[_0x99ed('0x37')]){delete _0x1ffc48[_0x99ed('0x37')];}_0x12fdc0=_0x1ffc48;})[_0x99ed('0xa3')](function(){if(_0x12fdc0===null){_0x7ba2d3[_0x99ed('0xa4')](_0x1d9ff0);}else{if(_0x1d9ff0===0x1f4){_0x7ba2d3[_0x99ed('0x29')](_0x1d9ff0)['send'](_0x12fdc0);}else{_0x7ba2d3[_0x99ed('0x29')](_0x1d9ff0)[_0x99ed('0x2b')](_0x12fdc0);}}});};exports[_0x99ed('0xa5')]=function(_0x5534cf,_0x3f68ba,_0x4b2831){var _0x279819={};var _0x1fc6b7={};var _0x4f04ce;var _0x2bad57;return db[_0x99ed('0x52')]['findOne']({'where':{'id':_0x5534cf['params']['id']}})[_0x99ed('0x1f')](handleEntityNotFound(_0x3f68ba,null))[_0x99ed('0x1f')](function(_0x21f62f){if(_0x21f62f){_0x4f04ce=_0x21f62f;_0x1fc6b7[_0x99ed('0x3e')]=_[_0x99ed('0x41')](db['OpenchannelApplication'][_0x99ed('0x3b')]);_0x1fc6b7[_0x99ed('0x40')]=_[_0x99ed('0x41')](_0x5534cf[_0x99ed('0x40')]);_0x1fc6b7[_0x99ed('0x42')]=_[_0x99ed('0x43')](_0x1fc6b7[_0x99ed('0x3e')],_0x1fc6b7['query']);_0x279819[_0x99ed('0x44')]=_[_0x99ed('0x43')](_0x1fc6b7[_0x99ed('0x3e')],qs[_0x99ed('0x45')](_0x5534cf[_0x99ed('0x40')][_0x99ed('0x45')]));_0x279819[_0x99ed('0x44')]=_0x279819[_0x99ed('0x44')][_0x99ed('0x46')]?_0x279819['attributes']:_0x1fc6b7[_0x99ed('0x3e')];_0x279819[_0x99ed('0x49')]=qs[_0x99ed('0x4a')](_0x5534cf[_0x99ed('0x40')][_0x99ed('0x4a')]);_0x279819[_0x99ed('0x4b')]=qs[_0x99ed('0x42')](_[_0x99ed('0x4c')](_0x5534cf[_0x99ed('0x40')],_0x1fc6b7['filters']));if(_0x5534cf[_0x99ed('0x40')][_0x99ed('0x4d')]){_0x279819[_0x99ed('0x4b')]=_[_0x99ed('0x50')](_0x279819[_0x99ed('0x4b')],{'$or':_[_0x99ed('0x3f')](_0x279819[_0x99ed('0x44')],function(_0x30b6b0){var _0x3d985f={};_0x3d985f[_0x30b6b0]={'$like':'%'+_0x5534cf['query'][_0x99ed('0x4d')]+'%'};return _0x3d985f;})});}_0x279819=_['merge']({},_0x279819,_0x5534cf['options']);return _0x4f04ce[_0x99ed('0xa5')](_0x279819);}})[_0x99ed('0x1f')](function(_0x130515){if(_0x130515){_0x2bad57=_0x130515[_0x99ed('0x46')];if(!_0x5534cf[_0x99ed('0x40')]['hasOwnProperty'](_0x99ed('0x48'))){_0x279819[_0x99ed('0x2e')]=qs[_0x99ed('0x2e')](_0x5534cf[_0x99ed('0x40')][_0x99ed('0x2e')]);_0x279819['offset']=qs['offset'](_0x5534cf[_0x99ed('0x40')]['offset']);}return _0x4f04ce[_0x99ed('0xa5')](_0x279819);}})[_0x99ed('0x1f')](function(_0x374d04){if(_0x374d04){return _0x374d04?{'count':_0x2bad57,'rows':_0x374d04}:null;}})[_0x99ed('0x1f')](respondWithResult(_0x3f68ba,null))[_0x99ed('0x28')](handleError(_0x3f68ba,null));};exports[_0x99ed('0xa6')]=function(_0x5a1033,_0x2087ea,_0x31ac5a){var _0x27c96c={'raw':![],'where':{}};var _0x11e07e={};var _0x4545af={'count':0x0,'rows':[]};return db[_0x99ed('0x52')][_0x99ed('0x6a')]({'where':{'id':_0x5a1033[_0x99ed('0x58')]['id']}})[_0x99ed('0x1f')](handleEntityNotFound(_0x2087ea,null))[_0x99ed('0x1f')](function(_0x34d25c){if(_0x34d25c){_0x11e07e[_0x99ed('0x3e')]=_[_0x99ed('0x41')](db[_0x99ed('0x88')][_0x99ed('0x3b')]);_0x11e07e[_0x99ed('0x40')]=_['keys'](_0x5a1033['query']);_0x11e07e['filters']=_[_0x99ed('0x43')](_0x11e07e['model'],_0x11e07e['query']);_0x27c96c['attributes']=_[_0x99ed('0x43')](_0x11e07e[_0x99ed('0x3e')],qs['fields'](_0x5a1033[_0x99ed('0x40')][_0x99ed('0x45')]));_0x27c96c['attributes']=_0x27c96c[_0x99ed('0x44')][_0x99ed('0x46')]?_0x27c96c[_0x99ed('0x44')]:_0x11e07e[_0x99ed('0x3e')];if(!_0x5a1033[_0x99ed('0x40')][_0x99ed('0x47')]('nolimit')){_0x27c96c[_0x99ed('0x2e')]=qs['limit'](_0x5a1033['query']['limit']);_0x27c96c[_0x99ed('0x2c')]=qs[_0x99ed('0x2c')](_0x5a1033[_0x99ed('0x40')][_0x99ed('0x2c')]);}_0x27c96c[_0x99ed('0x49')]=qs[_0x99ed('0x4a')](_0x5a1033[_0x99ed('0x40')][_0x99ed('0x4a')]);_0x27c96c[_0x99ed('0x4b')]=qs[_0x99ed('0x42')](_[_0x99ed('0x4c')](_0x5a1033[_0x99ed('0x40')],_0x11e07e[_0x99ed('0x42')]));_0x27c96c[_0x99ed('0x4b')][_0x99ed('0x67')]=_0x34d25c['id'];if(_0x5a1033['query'][_0x99ed('0x4d')]){_0x27c96c[_0x99ed('0x4b')]=_[_0x99ed('0x50')](_0x27c96c[_0x99ed('0x4b')],{'$or':_[_0x99ed('0x3f')](_0x27c96c['attributes'],function(_0x2f6d2a){var _0x1e4fe6={};_0x1e4fe6[_0x2f6d2a]={'$like':'%'+_0x5a1033['query'][_0x99ed('0x4d')]+'%'};return _0x1e4fe6;})});}_0x27c96c=_['merge']({},_0x27c96c,_0x5a1033['options']);return db[_0x99ed('0x88')][_0x99ed('0x2f')]({'where':_0x27c96c['where']})['then'](function(_0x51fdd3){_0x4545af[_0x99ed('0x2f')]=_0x51fdd3;if(_0x5a1033[_0x99ed('0x40')][_0x99ed('0x53')]){_0x27c96c[_0x99ed('0x54')]=[{'model':db[_0x99ed('0x72')],'as':_0x99ed('0xa7'),'required':![]},{'model':db[_0x99ed('0xa8')],'as':_0x99ed('0xa9'),'attributes':['name',_0x99ed('0xaa'),_0x99ed('0xab')],'required':![]},{'model':db[_0x99ed('0xac')],'as':_0x99ed('0xad'),'attributes':['id',_0x99ed('0x37'),_0x99ed('0xae')],'where':_0x5a1033[_0x99ed('0x40')][_0x99ed('0xaf')]?{'id':_0x5a1033[_0x99ed('0x40')][_0x99ed('0xaf')]}:undefined,'required':_0x5a1033[_0x99ed('0x40')][_0x99ed('0xaf')]?!![]:![]}];}return db[_0x99ed('0x88')][_0x99ed('0x55')](_0x27c96c);})[_0x99ed('0x1f')](function(_0x51f552){_0x4545af[_0x99ed('0x56')]=_0x51f552;return _0x4545af;});}})[_0x99ed('0x1f')](respondWithFilteredResult(_0x2087ea,_0x27c96c))[_0x99ed('0x28')](handleError(_0x2087ea,null));};exports[_0x99ed('0xb0')]=function(_0x3c0625,_0x28795a,_0x4f4ae7){return db['OpenchannelAccount'][_0x99ed('0x5a')]({'where':{'id':_0x3c0625[_0x99ed('0x58')]['id']}})[_0x99ed('0x1f')](handleEntityNotFound(_0x28795a,null))[_0x99ed('0x1f')](function(_0x1e1f02){if(_0x1e1f02){return _0x1e1f02[_0x99ed('0xb0')](_0x3c0625['body'][_0x99ed('0xb1')],_[_0x99ed('0xb2')](_0x3c0625['body'],[_0x99ed('0xb1'),'id'])||{})[_0x99ed('0xb3')](function(_0xcad521){for(var _0x1f72fc=0x0;_0x1f72fc<_0x3c0625['body'][_0x99ed('0xb1')]['length'];_0x1f72fc+=0x1){socket[_0x99ed('0xb4')](_0x99ed('0xb5'),{'UserId':Number(_0x3c0625[_0x99ed('0x5c')][_0x99ed('0xb1')][_0x1f72fc]),'OpenchannelAccountId':Number(_0x3c0625[_0x99ed('0x58')]['id'])});}return _0xcad521;});}})['then'](respondWithResult(_0x28795a,null))[_0x99ed('0x28')](handleError(_0x28795a,null));};exports[_0x99ed('0xb6')]=function(_0x50566f,_0x5dbe99,_0x4d6f5c){return db[_0x99ed('0x52')][_0x99ed('0x5a')]({'where':{'id':_0x50566f[_0x99ed('0x58')]['id']}})[_0x99ed('0x1f')](handleEntityNotFound(_0x5dbe99,null))[_0x99ed('0x1f')](function(_0x146337){if(_0x146337){return _0x146337[_0x99ed('0xb6')](_0x50566f[_0x99ed('0x40')]['ids'])['then'](function(){if(_[_0x99ed('0xb7')](_0x50566f[_0x99ed('0x40')][_0x99ed('0xb1')])){for(var _0xb7ce5f=0x0;_0xb7ce5f<_0x50566f['query'][_0x99ed('0xb1')][_0x99ed('0x46')];_0xb7ce5f+=0x1){socket[_0x99ed('0xb4')](_0x99ed('0xb8'),{'UserId':Number(_0x50566f[_0x99ed('0x40')]['ids'][_0xb7ce5f]),'OpenchannelAccountId':Number(_0x50566f[_0x99ed('0x58')]['id'])});}}else{socket[_0x99ed('0xb4')](_0x99ed('0xb8'),{'UserId':Number(_0x50566f[_0x99ed('0x40')][_0x99ed('0xb1')]),'OpenchannelAccountId':Number(_0x50566f['params']['id'])});}});}})['then'](respondWithStatusCode(_0x5dbe99,null))[_0x99ed('0x28')](handleError(_0x5dbe99,null));};exports[_0x99ed('0xb9')]=function(_0x175ea4,_0x1f0b7c,_0x1836b9){var _0x16fb13={};var _0x2b64d6={};var _0x330456;var _0x74cb29;return db[_0x99ed('0x52')][_0x99ed('0x6a')]({'where':{'id':_0x175ea4[_0x99ed('0x58')]['id']}})[_0x99ed('0x1f')](handleEntityNotFound(_0x1f0b7c,null))[_0x99ed('0x1f')](function(_0xaaedda){if(_0xaaedda){_0x330456=_0xaaedda;_0x2b64d6['model']=_['keys'](db['User'][_0x99ed('0x3b')]);_0x2b64d6[_0x99ed('0x40')]=_['keys'](_0x175ea4[_0x99ed('0x40')]);_0x2b64d6['filters']=_[_0x99ed('0x43')](_0x2b64d6[_0x99ed('0x3e')],_0x2b64d6[_0x99ed('0x40')]);_0x16fb13[_0x99ed('0x44')]=_[_0x99ed('0x43')](_0x2b64d6['model'],qs['fields'](_0x175ea4[_0x99ed('0x40')][_0x99ed('0x45')]));_0x16fb13[_0x99ed('0x44')]=_0x16fb13[_0x99ed('0x44')][_0x99ed('0x46')]?_0x16fb13['attributes']:_0x2b64d6[_0x99ed('0x3e')];_0x16fb13[_0x99ed('0x49')]=qs['sort'](_0x175ea4[_0x99ed('0x40')][_0x99ed('0x4a')]);_0x16fb13[_0x99ed('0x4b')]=qs[_0x99ed('0x42')](_['pick'](_0x175ea4[_0x99ed('0x40')],_0x2b64d6[_0x99ed('0x42')]));if(_0x175ea4['query'][_0x99ed('0x4d')]){_0x16fb13[_0x99ed('0x4b')]=_[_0x99ed('0x50')](_0x16fb13[_0x99ed('0x4b')],{'$or':_[_0x99ed('0x3f')](_0x16fb13[_0x99ed('0x44')],function(_0x47c2fc){var _0x1099d1={};_0x1099d1[_0x47c2fc]={'$like':'%'+_0x175ea4[_0x99ed('0x40')]['filter']+'%'};return _0x1099d1;})});}_0x16fb13=_[_0x99ed('0x50')]({},_0x16fb13,_0x175ea4[_0x99ed('0x51')]);return _0x330456[_0x99ed('0xb9')](_0x16fb13);}})[_0x99ed('0x1f')](function(_0x285fe5){if(_0x285fe5){_0x74cb29=_0x285fe5[_0x99ed('0x46')];if(!_0x175ea4['query']['hasOwnProperty']('nolimit')){_0x16fb13[_0x99ed('0x2e')]=qs[_0x99ed('0x2e')](_0x175ea4['query'][_0x99ed('0x2e')]);_0x16fb13['offset']=qs['offset'](_0x175ea4[_0x99ed('0x40')]['offset']);}return _0x330456['getAgents'](_0x16fb13);}})[_0x99ed('0x1f')](function(_0x1a68c9){if(_0x1a68c9){return _0x1a68c9?{'count':_0x74cb29,'rows':_0x1a68c9}:null;}})[_0x99ed('0x1f')](respondWithResult(_0x1f0b7c,null))[_0x99ed('0x28')](handleError(_0x1f0b7c,null));};exports[_0x99ed('0x38')]=function(_0x24d23e,_0x139b03,_0x32a207){var _0x1d5165,_0x417f6d,_0x3bfee2;if(_[_0x99ed('0x78')](_0x24d23e[_0x99ed('0x5c')]['body'])||_0x24d23e[_0x99ed('0x5c')][_0x99ed('0x5c')]===''){throw new db[(_0x99ed('0x73'))]['ValidationError'](_0x99ed('0xba'));}if(_[_0x99ed('0x78')](_0x24d23e[_0x99ed('0x5c')]['to'])){}_0x1d5165=_0x24d23e['body']['to'];return db['OpenchannelAccount'][_0x99ed('0x6a')]({'where':{'id':_0x24d23e[_0x99ed('0x58')]['id']}})['then'](handleEntityNotFound(_0x139b03,null))[_0x99ed('0x1f')](function(_0xb783fe){if(_0xb783fe){return db['OpenchannelAccount'][_0x99ed('0x5a')]({'where':{'id':_0xb783fe['id']},'include':[{'model':db[_0x99ed('0xbb')],'as':_0x99ed('0x81'),'include':[{'model':db[_0x99ed('0x72')],'as':_0x99ed('0x7d'),'where':{[_0xb783fe[_0x99ed('0x7b')]]:_0x1d5165},'limit':0x1,'order':[[_0x99ed('0x76'),_0x99ed('0xbc')]]}]}]})[_0x99ed('0x1f')](handleEntityNotFound(_0x139b03,null))['then'](function(_0x295328){if(_0x295328&&_0x295328[_0x99ed('0x81')]){_0x417f6d=_0x295328[_0x99ed('0x60')]({'plain':!![]});if(_0x417f6d[_0x99ed('0x81')]&&_0x417f6d[_0x99ed('0x81')][_0x99ed('0x7d')][_0x99ed('0x46')]){return _0x417f6d['List'][_0x99ed('0x7d')][0x0];}return db['CmContact'][_0x99ed('0x5b')](_[_0x99ed('0xbd')](_0x24d23e['body'],{'firstName':_0x1d5165,[_0x295328[_0x99ed('0x7b')]]:_0x1d5165,'phone':_0x1d5165,'ListId':_0x417f6d['ListId']}));}})[_0x99ed('0x1f')](handleEntityNotFound(_0x139b03,null))[_0x99ed('0x1f')](function(_0x33c1f9){if(_0x33c1f9){_0x3bfee2=_0x33c1f9;return db[_0x99ed('0x88')][_0x99ed('0x5a')]({'where':{'ContactId':_0x3bfee2['id'],'closed':![],'OpenchannelAccountId':_0x417f6d['id']}})[_0x99ed('0x1f')](function(_0x2caef4){if(_0x2caef4){return[_0x2caef4,![]];}return db[_0x99ed('0x88')][_0x99ed('0x5b')]({'UserId':_0x24d23e[_0x99ed('0x5d')]['id'],'ContactId':_0x3bfee2['id'],'OpenchannelAccountId':_0x417f6d['id'],'lastMsgDirection':'out','Messages':[_[_0x99ed('0x50')](_0x24d23e[_0x99ed('0x5c')],{'read':![],'body':_0x24d23e[_0x99ed('0x5c')]['body'],'OpenchannelAccountId':_0x417f6d['id'],'UserId':_0x24d23e[_0x99ed('0x5d')]['id'],'ContactId':_0x3bfee2['id']})]},{'include':[{'model':db[_0x99ed('0x92')],'as':'Messages'}]})[_0x99ed('0x1f')](function(_0x3fca0d){return[_0x3fca0d,!![]];});});}})[_0x99ed('0xb3')](function(_0x354491,_0x547754){if(_0x547754){return _0x354491;}return db[_0x99ed('0x92')][_0x99ed('0x5b')](_[_0x99ed('0x50')](_0x24d23e[_0x99ed('0x5c')],{'read':![],'body':_0x24d23e['body'][_0x99ed('0x5c')],'OpenchannelAccountId':_0x417f6d['id'],'OpenchannelInteractionId':_0x354491['id'],'UserId':_0x24d23e[_0x99ed('0x5d')]['id'],'ContactId':_0x3bfee2['id']}))[_0x99ed('0x1f')](function(_0x273954){_0x354491[_0x99ed('0xbe')][_0x99ed('0xbf')]=[];_0x354491[_0x99ed('0xbe')]['Messages'][_0x99ed('0x8e')](_0x273954[_0x99ed('0xbe')]);return _0x354491;});});}})[_0x99ed('0x1f')](respondWithResult(_0x139b03,null))['catch'](handleError(_0x139b03,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 6763e0e..b14947a 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 _0x668b=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x2f54b6,_0x3cc6cb){var _0x169f21=function(_0x4dac27){while(--_0x4dac27){_0x2f54b6['push'](_0x2f54b6['shift']());}};_0x169f21(++_0x3cc6cb);}(_0x668b,0x140));var _0xb668=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x668b[_0x433a86];return _0x23000c;};'use strict';var EventEmitter=require(_0xb668('0x0'));var OpenchannelAccount=require(_0xb668('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xb668('0x2')](0x0);var events={'afterCreate':_0xb668('0x3'),'afterUpdate':'update','afterDestroy':_0xb668('0x4')};function emitEvent(_0x5e2e83){return function(_0x2fab11,_0x4092a6,_0x2960f5){OpenchannelAccountEvents['emit'](_0x5e2e83+':'+_0x2fab11['id'],_0x2fab11);OpenchannelAccountEvents[_0xb668('0x5')](_0x5e2e83,_0x2fab11);_0x2960f5(null);};}for(var e in events){if(events[_0xb668('0x6')](e)){var event=events[e];OpenchannelAccount[_0xb668('0x7')](e,emitEvent(event));}}module[_0xb668('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x96cc=['remove','emit','hook','exports','events','OpenchannelAccount','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x96cc,0x16c));var _0xc96c=function(_0x2eea1c,_0x555aae){_0x2eea1c=_0x2eea1c-0x0;var _0x55f270=_0x96cc[_0x2eea1c];return _0x55f270;};'use strict';var EventEmitter=require(_0xc96c('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xc96c('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc96c('0x2'),'afterUpdate':_0xc96c('0x3'),'afterDestroy':_0xc96c('0x4')};function emitEvent(_0x421701){return function(_0x71140d,_0x29b6f1,_0x377e6c){OpenchannelAccountEvents[_0xc96c('0x5')](_0x421701+':'+_0x71140d['id'],_0x71140d);OpenchannelAccountEvents[_0xc96c('0x5')](_0x421701,_0x71140d);_0x377e6c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xc96c('0x6')](e,emitEvent(event));}}module[_0xc96c('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 029fda2..a9a590d 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(_0x443a84,_0x5f1be1){var _0x3b7813=function(_0x439016){while(--_0x439016){_0x443a84['push'](_0x443a84['shift']());}};_0x3b7813(++_0x5f1be1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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(_0x5ce320,_0x3df023){var _0x5cad74=function(_0x31e754){while(--_0x31e754){_0x5ce320['push'](_0x5ce320['shift']());}};_0x5cad74(++_0x3df023);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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 fdf1e0d..11b4485 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 _0x39cb=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x35b18a,_0x6b2fbe){var _0x4db1bd=function(_0x389e62){while(--_0x389e62){_0x35b18a['push'](_0x35b18a['shift']());}};_0x4db1bd(++_0x6b2fbe);}(_0x39cb,0x1bd));var _0xb39c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x39cb[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xb39c('0x0'));var moment=require(_0xb39c('0x1'));var BPromise=require('bluebird');var rs=require(_0xb39c('0x2'));var fs=require('fs');var Redis=require(_0xb39c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb39c('0x4'));var logger=require(_0xb39c('0x5'))(_0xb39c('0x6'));var config=require(_0xb39c('0x7'));var jayson=require(_0xb39c('0x8'));var client=jayson['client'][_0xb39c('0x9')]({'port':0x232a});config[_0xb39c('0xa')]=_[_0xb39c('0xb')](config[_0xb39c('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb39c('0xa')]));require(_0xb39c('0xc'))[_0xb39c('0xd')](socket);function respondWithRpcPromise(_0x42c6dc,_0x5402b2,_0x4a6f36){return new BPromise(function(_0x5a0dba,_0x1de94f){return client[_0xb39c('0xe')](_0x42c6dc,_0x4a6f36)[_0xb39c('0xf')](function(_0x1088ee){logger[_0xb39c('0x10')](_0xb39c('0x11'),_0x5402b2,_0xb39c('0x12'));logger[_0xb39c('0x13')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5402b2,_0xb39c('0x12'),JSON[_0xb39c('0x14')](_0x1088ee));if(_0x1088ee[_0xb39c('0x15')]){if(_0x1088ee['error'][_0xb39c('0x16')]===0x1f4){logger[_0xb39c('0x15')](_0xb39c('0x11'),_0x5402b2,_0x1088ee[_0xb39c('0x15')][_0xb39c('0x17')]);return _0x1de94f(_0x1088ee[_0xb39c('0x15')][_0xb39c('0x17')]);}logger['error'](_0xb39c('0x11'),_0x5402b2,_0x1088ee[_0xb39c('0x15')][_0xb39c('0x17')]);return _0x5a0dba(_0x1088ee[_0xb39c('0x15')][_0xb39c('0x17')]);}else{logger[_0xb39c('0x10')](_0xb39c('0x11'),_0x5402b2,_0xb39c('0x12'));_0x5a0dba(_0x1088ee[_0xb39c('0x18')][_0xb39c('0x17')]);}})['catch'](function(_0x1d2f49){logger[_0xb39c('0x15')](_0xb39c('0x11'),_0x5402b2,_0x1d2f49);_0x1de94f(_0x1d2f49);});});} \ No newline at end of file +var _0x065e=['socket.io-emitter','./openchannelAccount.socket','register','request','then','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelAccount,\x20%s,\x20%s','result','catch','lodash','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis'];(function(_0x328534,_0x33b41e){var _0x2796c0=function(_0x1ba8ad){while(--_0x1ba8ad){_0x328534['push'](_0x328534['shift']());}};_0x2796c0(++_0x33b41e);}(_0x065e,0x1a7));var _0xe065=function(_0x295245,_0x110169){_0x295245=_0x295245-0x0;var _0x3d166a=_0x065e[_0x295245];return _0x3d166a;};'use strict';var _=require(_0xe065('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe065('0x1'));var fs=require('fs');var Redis=require(_0xe065('0x2'));var db=require(_0xe065('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe065('0x4'));var config=require(_0xe065('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xe065('0x6')][_0xe065('0x7')]({'port':0x232a});config[_0xe065('0x8')]=_['defaults'](config[_0xe065('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xe065('0x9'))(new Redis(config[_0xe065('0x8')]));require(_0xe065('0xa'))[_0xe065('0xb')](socket);function respondWithRpcPromise(_0x85001e,_0x531ebd,_0x43827c){return new BPromise(function(_0x6c9117,_0x3f59d3){return client[_0xe065('0xc')](_0x85001e,_0x43827c)[_0xe065('0xd')](function(_0x2a6a6e){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x531ebd,_0xe065('0xe'));logger[_0xe065('0xf')](_0xe065('0x10'),_0x531ebd,'request\x20sent',JSON[_0xe065('0x11')](_0x2a6a6e));if(_0x2a6a6e[_0xe065('0x12')]){if(_0x2a6a6e[_0xe065('0x12')][_0xe065('0x13')]===0x1f4){logger[_0xe065('0x12')]('OpenchannelAccount,\x20%s,\x20%s',_0x531ebd,_0x2a6a6e[_0xe065('0x12')][_0xe065('0x14')]);return _0x3f59d3(_0x2a6a6e[_0xe065('0x12')][_0xe065('0x14')]);}logger[_0xe065('0x12')](_0xe065('0x15'),_0x531ebd,_0x2a6a6e[_0xe065('0x12')]['message']);return _0x6c9117(_0x2a6a6e[_0xe065('0x12')][_0xe065('0x14')]);}else{logger['info'](_0xe065('0x15'),_0x531ebd,_0xe065('0xe'));_0x6c9117(_0x2a6a6e[_0xe065('0x16')][_0xe065('0x14')]);}})[_0xe065('0x17')](function(_0x302adf){logger[_0xe065('0x12')]('OpenchannelAccount,\x20%s,\x20%s',_0x531ebd,_0x302adf);_0x3f59d3(_0x302adf);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 0d3ba4a..375f98d 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 _0x57f8=['save','remove','update','emit','removeListener','register','length','openchannelAccount:'];(function(_0x37205b,_0x2c124d){var _0x4293e5=function(_0x15fc38){while(--_0x15fc38){_0x37205b['push'](_0x37205b['shift']());}};_0x4293e5(++_0x2c124d);}(_0x57f8,0x198));var _0x857f=function(_0x50cc54,_0x54c15f){_0x50cc54=_0x50cc54-0x0;var _0x28ecca=_0x57f8[_0x50cc54];return _0x28ecca;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x857f('0x0'),_0x857f('0x1'),_0x857f('0x2')];function createListener(_0x3c0125,_0x238445){return function(_0x27b98d){_0x238445[_0x857f('0x3')](_0x3c0125,_0x27b98d);};}function removeListener(_0x6f054b,_0x318050){return function(){OpenchannelAccountEvents[_0x857f('0x4')](_0x6f054b,_0x318050);};}exports[_0x857f('0x5')]=function(_0x369c40){for(var _0x5d22e4=0x0,_0x8380e8=events[_0x857f('0x6')];_0x5d22e4<_0x8380e8;_0x5d22e4++){var _0x1aaeea=events[_0x5d22e4];var _0x577fc3=createListener(_0x857f('0x7')+_0x1aaeea,_0x369c40);OpenchannelAccountEvents['on'](_0x1aaeea,_0x577fc3);}}; \ No newline at end of file +var _0x175e=['emit','removeListener','register','length','openchannelAccount:','./openchannelAccount.events','save','remove','update'];(function(_0x436e31,_0x1e3448){var _0x5028bc=function(_0x414857){while(--_0x414857){_0x436e31['push'](_0x436e31['shift']());}};_0x5028bc(++_0x1e3448);}(_0x175e,0xe6));var _0xe175=function(_0x10e1ee,_0x20d13a){_0x10e1ee=_0x10e1ee-0x0;var _0x570720=_0x175e[_0x10e1ee];return _0x570720;};'use strict';var OpenchannelAccountEvents=require(_0xe175('0x0'));var events=[_0xe175('0x1'),_0xe175('0x2'),_0xe175('0x3')];function createListener(_0x449d97,_0x5bec43){return function(_0x4d2bfc){_0x5bec43[_0xe175('0x4')](_0x449d97,_0x4d2bfc);};}function removeListener(_0x3c493c,_0x3fd951){return function(){OpenchannelAccountEvents[_0xe175('0x5')](_0x3c493c,_0x3fd951);};}exports[_0xe175('0x6')]=function(_0x278a8d){for(var _0x7eba=0x0,_0xbe8cd=events[_0xe175('0x7')];_0x7eba<_0xbe8cd;_0x7eba++){var _0x2e1356=events[_0x7eba];var _0x345531=createListener(_0xe175('0x8')+_0x2e1356,_0x278a8d);OpenchannelAccountEvents['on'](_0x2e1356,_0x345531);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index d1c420c..352391a 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 _0x7062=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','show','post','create','/:id'];(function(_0x44ee79,_0x41e740){var _0x362223=function(_0x25068a){while(--_0x25068a){_0x44ee79['push'](_0x44ee79['shift']());}};_0x362223(++_0x41e740);}(_0x7062,0x6d));var _0x2706=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7062[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x2706('0x0'));var util=require(_0x2706('0x1'));var path=require(_0x2706('0x2'));var timeout=require(_0x2706('0x3'));var express=require('express');var router=express[_0x2706('0x4')]();var fs_extra=require(_0x2706('0x5'));var auth=require(_0x2706('0x6'));var interaction=require(_0x2706('0x7'));var config=require(_0x2706('0x8'));var controller=require(_0x2706('0x9'));router[_0x2706('0xa')]('/',auth[_0x2706('0xb')](),controller[_0x2706('0xc')]);router[_0x2706('0xa')]('/:id',auth[_0x2706('0xb')](),controller[_0x2706('0xd')]);router[_0x2706('0xe')]('/',auth['isAuthenticated'](),controller[_0x2706('0xf')]);router['put'](_0x2706('0x10'),auth[_0x2706('0xb')](),controller[_0x2706('0x11')]);router[_0x2706('0x12')](_0x2706('0x10'),auth[_0x2706('0xb')](),controller[_0x2706('0x13')]);module[_0x2706('0x14')]=router; \ No newline at end of file +var _0x9c75=['delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','index','/:id','isAuthenticated','show','post','put'];(function(_0x3660b6,_0x16abe4){var _0x343fb2=function(_0x17e793){while(--_0x17e793){_0x3660b6['push'](_0x3660b6['shift']());}};_0x343fb2(++_0x16abe4);}(_0x9c75,0x173));var _0x59c7=function(_0x230443,_0x2d27dc){_0x230443=_0x230443-0x0;var _0x245f39=_0x9c75[_0x230443];return _0x245f39;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x59c7('0x0'));var timeout=require(_0x59c7('0x1'));var express=require(_0x59c7('0x2'));var router=express[_0x59c7('0x3')]();var fs_extra=require(_0x59c7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x59c7('0x5'));var config=require('../../config/environment');var controller=require('./openchannelApplication.controller');router[_0x59c7('0x6')]('/',auth['isAuthenticated'](),controller[_0x59c7('0x7')]);router['get'](_0x59c7('0x8'),auth[_0x59c7('0x9')](),controller[_0x59c7('0xa')]);router[_0x59c7('0xb')]('/',auth[_0x59c7('0x9')](),controller['create']);router[_0x59c7('0xc')](_0x59c7('0x8'),auth[_0x59c7('0x9')](),controller['update']);router[_0x59c7('0xd')](_0x59c7('0x8'),auth[_0x59c7('0x9')](),controller[_0x59c7('0xe')]);module[_0x59c7('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 9c4226b..c271beb 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 _0x2a7f=['TEXT','*,*,*,*','sequelize','exports','STRING','noop'];(function(_0xa30766,_0x6f613e){var _0x24e780=function(_0x3d58fb){while(--_0x3d58fb){_0xa30766['push'](_0xa30766['shift']());}};_0x24e780(++_0x6f613e);}(_0x2a7f,0x110));var _0xf2a7=function(_0x2c065a,_0x44e071){_0x2c065a=_0x2c065a-0x0;var _0x16dcf0=_0x2a7f[_0x2c065a];return _0x16dcf0;};'use strict';var Sequelize=require(_0xf2a7('0x0'));module[_0xf2a7('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xf2a7('0x2')],'allowNull':![],'defaultValue':_0xf2a7('0x3')},'appdata':{'type':Sequelize[_0xf2a7('0x4')]()},'description':{'type':Sequelize[_0xf2a7('0x2')]},'interval':{'type':Sequelize[_0xf2a7('0x2')],'defaultValue':_0xf2a7('0x5')}}; \ No newline at end of file +var _0x566b=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x3ddb3f,_0x443638){var _0x27f3e2=function(_0x5ec922){while(--_0x5ec922){_0x3ddb3f['push'](_0x3ddb3f['shift']());}};_0x27f3e2(++_0x443638);}(_0x566b,0x72));var _0xb566=function(_0x5a6644,_0x45d612){_0x5a6644=_0x5a6644-0x0;var _0x3a2a5d=_0x566b[_0x5a6644];return _0x3a2a5d;};'use strict';var Sequelize=require(_0xb566('0x0'));module[_0xb566('0x1')]={'priority':{'type':Sequelize[_0xb566('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb566('0x3')],'allowNull':![],'defaultValue':_0xb566('0x4')},'appdata':{'type':Sequelize[_0xb566('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb566('0x3')],'defaultValue':_0xb566('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index fb6360d..71488cb 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 _0xb0b3=['error','stack','name','send','map','OpenchannelApplication','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x136217,_0x385a1c){var _0x1bac9e=function(_0x77af2a){while(--_0x77af2a){_0x136217['push'](_0x136217['shift']());}};_0x1bac9e(++_0x385a1c);}(_0xb0b3,0x19e));var _0x3b0b=function(_0x44e065,_0x231abe){_0x44e065=_0x44e065-0x0;var _0x524a3a=_0xb0b3[_0x44e065];return _0x524a3a;};'use strict';var emlformat=require(_0x3b0b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3b0b('0x1'));var jsonpatch=require(_0x3b0b('0x2'));var rp=require(_0x3b0b('0x3'));var moment=require(_0x3b0b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3b0b('0x5'));var util=require(_0x3b0b('0x6'));var path=require(_0x3b0b('0x7'));var sox=require(_0x3b0b('0x8'));var csv=require(_0x3b0b('0x9'));var ejs=require(_0x3b0b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3b0b('0xb'));var squel=require(_0x3b0b('0xc'));var crypto=require(_0x3b0b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3b0b('0xe'));var toCsv=require(_0x3b0b('0x9'));var querystring=require(_0x3b0b('0xf'));var Papa=require('papaparse');var Redis=require(_0x3b0b('0x10'));var authService=require(_0x3b0b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3b0b('0x12'));var hardwareService=require(_0x3b0b('0x13'));var logger=require(_0x3b0b('0x14'))(_0x3b0b('0x15'));var utils=require(_0x3b0b('0x16'));var config=require(_0x3b0b('0x17'));var licenseUtil=require(_0x3b0b('0x18'));var db=require(_0x3b0b('0x19'))['db'];function respondWithStatusCode(_0x1a861d,_0x5f2bb7){_0x5f2bb7=_0x5f2bb7||0xcc;return function(_0x525dc7){if(_0x525dc7){return _0x1a861d[_0x3b0b('0x1a')](_0x5f2bb7);}return _0x1a861d[_0x3b0b('0x1b')](_0x5f2bb7)[_0x3b0b('0x1c')]();};}function respondWithResult(_0x5ec979,_0x1c973b){_0x1c973b=_0x1c973b||0xc8;return function(_0xfd2864){if(_0xfd2864){return _0x5ec979[_0x3b0b('0x1b')](_0x1c973b)[_0x3b0b('0x1d')](_0xfd2864);}};}function respondWithFilteredResult(_0x4358cb,_0x15836d){return function(_0x219b2){if(_0x219b2){var _0x4581f2=typeof _0x15836d[_0x3b0b('0x1e')]===_0x3b0b('0x1f')&&typeof _0x15836d[_0x3b0b('0x20')]===_0x3b0b('0x1f');var _0x27c0d3=_0x219b2['count'];var _0x2361ab=_0x4581f2?0x0:_0x15836d[_0x3b0b('0x1e')];var _0x5912ae=_0x4581f2?_0x219b2[_0x3b0b('0x21')]:_0x15836d[_0x3b0b('0x1e')]+_0x15836d[_0x3b0b('0x20')];var _0x4f2cc6;if(_0x5912ae>=_0x27c0d3){_0x5912ae=_0x27c0d3;_0x4f2cc6=0xc8;}else{_0x4f2cc6=0xce;}_0x4358cb[_0x3b0b('0x1b')](_0x4f2cc6);return _0x4358cb[_0x3b0b('0x22')](_0x3b0b('0x23'),_0x2361ab+'-'+_0x5912ae+'/'+_0x27c0d3)[_0x3b0b('0x1d')](_0x219b2);}return null;};}function patchUpdates(_0x3d6bba){return function(_0x277bef){try{jsonpatch[_0x3b0b('0x24')](_0x277bef,_0x3d6bba,!![]);}catch(_0x2991d5){return BPromise[_0x3b0b('0x25')](_0x2991d5);}return _0x277bef[_0x3b0b('0x26')]();};}function saveUpdates(_0x27dba6,_0x2e7365){return function(_0x354675){if(_0x354675){return _0x354675[_0x3b0b('0x27')](_0x27dba6)[_0x3b0b('0x28')](function(_0x5d4ee3){return _0x5d4ee3;});}return null;};}function removeEntity(_0x1d193c,_0x287962){return function(_0x3f3470){if(_0x3f3470){return _0x3f3470[_0x3b0b('0x29')]()['then'](function(){_0x1d193c[_0x3b0b('0x1b')](0xcc)[_0x3b0b('0x1c')]();});}};}function handleEntityNotFound(_0x748dc8,_0xa72bf){return function(_0x1a2a80){if(!_0x1a2a80){_0x748dc8[_0x3b0b('0x1a')](0x194);}return _0x1a2a80;};}function handleError(_0x2b2917,_0x1b5c04){_0x1b5c04=_0x1b5c04||0x1f4;return function(_0x11055f){logger[_0x3b0b('0x2a')](_0x11055f[_0x3b0b('0x2b')]);if(_0x11055f[_0x3b0b('0x2c')]){delete _0x11055f[_0x3b0b('0x2c')];}_0x2b2917[_0x3b0b('0x1b')](_0x1b5c04)[_0x3b0b('0x2d')](_0x11055f);};}exports['index']=function(_0x5884cb,_0x29b700){var _0x5e6986={},_0x4d0247={},_0x53e6a3={'count':0x0,'rows':[]};var _0x289025=_[_0x3b0b('0x2e')](db[_0x3b0b('0x2f')]['rawAttributes'],function(_0x19f315){return{'name':_0x19f315[_0x3b0b('0x30')],'type':_0x19f315['type'][_0x3b0b('0x31')]};});_0x4d0247[_0x3b0b('0x32')]=_[_0x3b0b('0x2e')](_0x289025,_0x3b0b('0x2c'));_0x4d0247['query']=_[_0x3b0b('0x33')](_0x5884cb[_0x3b0b('0x34')]);_0x4d0247[_0x3b0b('0x35')]=_['intersection'](_0x4d0247['model'],_0x4d0247[_0x3b0b('0x34')]);_0x5e6986[_0x3b0b('0x36')]=_[_0x3b0b('0x37')](_0x4d0247[_0x3b0b('0x32')],qs[_0x3b0b('0x38')](_0x5884cb[_0x3b0b('0x34')][_0x3b0b('0x38')]));_0x5e6986['attributes']=_0x5e6986[_0x3b0b('0x36')][_0x3b0b('0x39')]?_0x5e6986[_0x3b0b('0x36')]:_0x4d0247[_0x3b0b('0x32')];if(!_0x5884cb['query'][_0x3b0b('0x3a')](_0x3b0b('0x3b'))){_0x5e6986[_0x3b0b('0x20')]=qs[_0x3b0b('0x20')](_0x5884cb[_0x3b0b('0x34')][_0x3b0b('0x20')]);_0x5e6986[_0x3b0b('0x1e')]=qs[_0x3b0b('0x1e')](_0x5884cb[_0x3b0b('0x34')][_0x3b0b('0x1e')]);}_0x5e6986[_0x3b0b('0x3c')]=qs['sort'](_0x5884cb[_0x3b0b('0x34')][_0x3b0b('0x3d')]);_0x5e6986[_0x3b0b('0x3e')]=qs[_0x3b0b('0x35')](_['pick'](_0x5884cb[_0x3b0b('0x34')],_0x4d0247[_0x3b0b('0x35')]),_0x289025);if(_0x5884cb['query']['filter']){_0x5e6986[_0x3b0b('0x3e')]=_[_0x3b0b('0x3f')](_0x5e6986[_0x3b0b('0x3e')],{'$or':_[_0x3b0b('0x2e')](_0x289025,function(_0x196772){if(_0x196772[_0x3b0b('0x40')]!==_0x3b0b('0x41')){var _0x1db73f={};_0x1db73f[_0x196772[_0x3b0b('0x2c')]]={'$like':'%'+_0x5884cb[_0x3b0b('0x34')]['filter']+'%'};return _0x1db73f;}})});}_0x5e6986=_['merge']({},_0x5e6986,_0x5884cb[_0x3b0b('0x42')]);var _0x4bdbd1={'where':_0x5e6986[_0x3b0b('0x3e')]};return db[_0x3b0b('0x2f')]['count'](_0x4bdbd1)[_0x3b0b('0x28')](function(_0x10d9b4){_0x53e6a3[_0x3b0b('0x21')]=_0x10d9b4;if(_0x5884cb[_0x3b0b('0x34')][_0x3b0b('0x43')]){_0x5e6986[_0x3b0b('0x44')]=[{'all':!![]}];}return db[_0x3b0b('0x2f')]['findAll'](_0x5e6986);})[_0x3b0b('0x28')](function(_0x3c3424){_0x53e6a3[_0x3b0b('0x45')]=_0x3c3424;return _0x53e6a3;})[_0x3b0b('0x28')](respondWithFilteredResult(_0x29b700,_0x5e6986))[_0x3b0b('0x46')](handleError(_0x29b700,null));};exports[_0x3b0b('0x47')]=function(_0x1f0753,_0x4eac5b){var _0x319114={'raw':!![],'where':{'id':_0x1f0753[_0x3b0b('0x48')]['id']}},_0x52cff2={};_0x52cff2[_0x3b0b('0x32')]=_['keys'](db[_0x3b0b('0x2f')]['rawAttributes']);_0x52cff2[_0x3b0b('0x34')]=_[_0x3b0b('0x33')](_0x1f0753['query']);_0x52cff2[_0x3b0b('0x35')]=_[_0x3b0b('0x37')](_0x52cff2[_0x3b0b('0x32')],_0x52cff2[_0x3b0b('0x34')]);_0x319114['attributes']=_[_0x3b0b('0x37')](_0x52cff2[_0x3b0b('0x32')],qs[_0x3b0b('0x38')](_0x1f0753[_0x3b0b('0x34')]['fields']));_0x319114['attributes']=_0x319114[_0x3b0b('0x36')][_0x3b0b('0x39')]?_0x319114[_0x3b0b('0x36')]:_0x52cff2['model'];if(_0x1f0753[_0x3b0b('0x34')]['includeAll']){_0x319114['include']=[{'all':!![]}];}_0x319114=_[_0x3b0b('0x3f')]({},_0x319114,_0x1f0753[_0x3b0b('0x42')]);return db['OpenchannelApplication']['find'](_0x319114)[_0x3b0b('0x28')](handleEntityNotFound(_0x4eac5b,null))[_0x3b0b('0x28')](respondWithResult(_0x4eac5b,null))[_0x3b0b('0x46')](handleError(_0x4eac5b,null));};exports[_0x3b0b('0x49')]=function(_0x2f18a3,_0x2332d5){return db[_0x3b0b('0x2f')][_0x3b0b('0x49')](_0x2f18a3[_0x3b0b('0x4a')],{})['then'](respondWithResult(_0x2332d5,0xc9))[_0x3b0b('0x46')](handleError(_0x2332d5,null));};exports[_0x3b0b('0x27')]=function(_0x2cb547,_0x1aa687){if(_0x2cb547[_0x3b0b('0x4a')]['id']){delete _0x2cb547[_0x3b0b('0x4a')]['id'];}return db[_0x3b0b('0x2f')]['find']({'where':{'id':_0x2cb547[_0x3b0b('0x48')]['id']}})[_0x3b0b('0x28')](handleEntityNotFound(_0x1aa687,null))[_0x3b0b('0x28')](saveUpdates(_0x2cb547[_0x3b0b('0x4a')],null))[_0x3b0b('0x28')](respondWithResult(_0x1aa687,null))[_0x3b0b('0x46')](handleError(_0x1aa687,null));};exports['destroy']=function(_0x45f227,_0x5973e3){return db['OpenchannelApplication'][_0x3b0b('0x4b')]({'where':{'id':_0x45f227[_0x3b0b('0x48')]['id']}})['then'](handleEntityNotFound(_0x5973e3,null))[_0x3b0b('0x28')](removeEntity(_0x5973e3,null))['catch'](handleError(_0x5973e3,null));}; \ No newline at end of file +var _0x25c6=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','OpenchannelApplication','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','params','include','find','create','body','eml-format'];(function(_0x357110,_0x4c7262){var _0x554cc4=function(_0xc27a91){while(--_0xc27a91){_0x357110['push'](_0x357110['shift']());}};_0x554cc4(++_0x4c7262);}(_0x25c6,0x1a9));var _0x625c=function(_0x464ec5,_0x708e0a){_0x464ec5=_0x464ec5-0x0;var _0x30a88b=_0x25c6[_0x464ec5];return _0x30a88b;};'use strict';var emlformat=require(_0x625c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x625c('0x1'));var jsonpatch=require(_0x625c('0x2'));var rp=require(_0x625c('0x3'));var moment=require('moment');var BPromise=require(_0x625c('0x4'));var Mustache=require(_0x625c('0x5'));var util=require(_0x625c('0x6'));var path=require(_0x625c('0x7'));var sox=require('sox');var csv=require(_0x625c('0x8'));var ejs=require(_0x625c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x625c('0xa'));var jsforce=require(_0x625c('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x625c('0xc'));var Papa=require(_0x625c('0xd'));var Redis=require(_0x625c('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x625c('0xf'));var hardwareService=require(_0x625c('0x10'));var logger=require('../../config/logger')(_0x625c('0x11'));var utils=require(_0x625c('0x12'));var config=require(_0x625c('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x625c('0x14'))['db'];function respondWithStatusCode(_0x422279,_0x2f8367){_0x2f8367=_0x2f8367||0xcc;return function(_0x5d6368){if(_0x5d6368){return _0x422279['sendStatus'](_0x2f8367);}return _0x422279['status'](_0x2f8367)[_0x625c('0x15')]();};}function respondWithResult(_0x4d44de,_0x5a9a90){_0x5a9a90=_0x5a9a90||0xc8;return function(_0x485d8b){if(_0x485d8b){return _0x4d44de[_0x625c('0x16')](_0x5a9a90)[_0x625c('0x17')](_0x485d8b);}};}function respondWithFilteredResult(_0x107172,_0x2d5352){return function(_0x4305bb){if(_0x4305bb){var _0x3ffe0=typeof _0x2d5352[_0x625c('0x18')]===_0x625c('0x19')&&typeof _0x2d5352['limit']===_0x625c('0x19');var _0x139a9b=_0x4305bb[_0x625c('0x1a')];var _0x382ef5=_0x3ffe0?0x0:_0x2d5352[_0x625c('0x18')];var _0x4e7288=_0x3ffe0?_0x4305bb['count']:_0x2d5352[_0x625c('0x18')]+_0x2d5352[_0x625c('0x1b')];var _0x1337a1;if(_0x4e7288>=_0x139a9b){_0x4e7288=_0x139a9b;_0x1337a1=0xc8;}else{_0x1337a1=0xce;}_0x107172['status'](_0x1337a1);return _0x107172[_0x625c('0x1c')](_0x625c('0x1d'),_0x382ef5+'-'+_0x4e7288+'/'+_0x139a9b)[_0x625c('0x17')](_0x4305bb);}return null;};}function patchUpdates(_0x32e332){return function(_0x197af6){try{jsonpatch[_0x625c('0x1e')](_0x197af6,_0x32e332,!![]);}catch(_0x55fcd5){return BPromise[_0x625c('0x1f')](_0x55fcd5);}return _0x197af6['save']();};}function saveUpdates(_0x3faa13,_0x274113){return function(_0x160836){if(_0x160836){return _0x160836[_0x625c('0x20')](_0x3faa13)[_0x625c('0x21')](function(_0x10075a){return _0x10075a;});}return null;};}function removeEntity(_0x3ca4af,_0xbb6e0d){return function(_0x1d503f){if(_0x1d503f){return _0x1d503f[_0x625c('0x22')]()[_0x625c('0x21')](function(){_0x3ca4af[_0x625c('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e2900,_0x5dde0f){return function(_0x520e28){if(!_0x520e28){_0x3e2900[_0x625c('0x23')](0x194);}return _0x520e28;};}function handleError(_0x30d7d9,_0x17694c){_0x17694c=_0x17694c||0x1f4;return function(_0x2e1900){logger[_0x625c('0x24')](_0x2e1900[_0x625c('0x25')]);if(_0x2e1900[_0x625c('0x26')]){delete _0x2e1900[_0x625c('0x26')];}_0x30d7d9[_0x625c('0x16')](_0x17694c)[_0x625c('0x27')](_0x2e1900);};}exports[_0x625c('0x28')]=function(_0x4a8f85,_0x4997af){var _0x1d9e02={},_0x124f94={},_0x350e02={'count':0x0,'rows':[]};var _0x91a20a=_[_0x625c('0x29')](db[_0x625c('0x2a')]['rawAttributes'],function(_0xb68ce1){return{'name':_0xb68ce1[_0x625c('0x2b')],'type':_0xb68ce1[_0x625c('0x2c')]['key']};});_0x124f94[_0x625c('0x2d')]=_[_0x625c('0x29')](_0x91a20a,'name');_0x124f94['query']=_[_0x625c('0x2e')](_0x4a8f85[_0x625c('0x2f')]);_0x124f94[_0x625c('0x30')]=_[_0x625c('0x31')](_0x124f94[_0x625c('0x2d')],_0x124f94[_0x625c('0x2f')]);_0x1d9e02[_0x625c('0x32')]=_[_0x625c('0x31')](_0x124f94[_0x625c('0x2d')],qs[_0x625c('0x33')](_0x4a8f85['query'][_0x625c('0x33')]));_0x1d9e02[_0x625c('0x32')]=_0x1d9e02[_0x625c('0x32')][_0x625c('0x34')]?_0x1d9e02[_0x625c('0x32')]:_0x124f94[_0x625c('0x2d')];if(!_0x4a8f85[_0x625c('0x2f')][_0x625c('0x35')](_0x625c('0x36'))){_0x1d9e02['limit']=qs[_0x625c('0x1b')](_0x4a8f85[_0x625c('0x2f')][_0x625c('0x1b')]);_0x1d9e02[_0x625c('0x18')]=qs[_0x625c('0x18')](_0x4a8f85[_0x625c('0x2f')][_0x625c('0x18')]);}_0x1d9e02[_0x625c('0x37')]=qs[_0x625c('0x38')](_0x4a8f85[_0x625c('0x2f')][_0x625c('0x38')]);_0x1d9e02[_0x625c('0x39')]=qs[_0x625c('0x30')](_[_0x625c('0x3a')](_0x4a8f85[_0x625c('0x2f')],_0x124f94[_0x625c('0x30')]),_0x91a20a);if(_0x4a8f85[_0x625c('0x2f')][_0x625c('0x3b')]){_0x1d9e02[_0x625c('0x39')]=_[_0x625c('0x3c')](_0x1d9e02['where'],{'$or':_[_0x625c('0x29')](_0x91a20a,function(_0x19dee6){if(_0x19dee6[_0x625c('0x2c')]!=='VIRTUAL'){var _0x24ea9c={};_0x24ea9c[_0x19dee6['name']]={'$like':'%'+_0x4a8f85[_0x625c('0x2f')][_0x625c('0x3b')]+'%'};return _0x24ea9c;}})});}_0x1d9e02=_[_0x625c('0x3c')]({},_0x1d9e02,_0x4a8f85[_0x625c('0x3d')]);var _0x42c23a={'where':_0x1d9e02[_0x625c('0x39')]};return db[_0x625c('0x2a')]['count'](_0x42c23a)[_0x625c('0x21')](function(_0x1d63ac){_0x350e02[_0x625c('0x1a')]=_0x1d63ac;if(_0x4a8f85[_0x625c('0x2f')][_0x625c('0x3e')]){_0x1d9e02['include']=[{'all':!![]}];}return db[_0x625c('0x2a')][_0x625c('0x3f')](_0x1d9e02);})['then'](function(_0x5db0a8){_0x350e02['rows']=_0x5db0a8;return _0x350e02;})['then'](respondWithFilteredResult(_0x4997af,_0x1d9e02))[_0x625c('0x40')](handleError(_0x4997af,null));};exports[_0x625c('0x41')]=function(_0x565559,_0x27d57d){var _0x144257={'raw':!![],'where':{'id':_0x565559[_0x625c('0x42')]['id']}},_0x32a596={};_0x32a596[_0x625c('0x2d')]=_[_0x625c('0x2e')](db[_0x625c('0x2a')]['rawAttributes']);_0x32a596[_0x625c('0x2f')]=_[_0x625c('0x2e')](_0x565559[_0x625c('0x2f')]);_0x32a596['filters']=_[_0x625c('0x31')](_0x32a596[_0x625c('0x2d')],_0x32a596[_0x625c('0x2f')]);_0x144257['attributes']=_['intersection'](_0x32a596[_0x625c('0x2d')],qs[_0x625c('0x33')](_0x565559[_0x625c('0x2f')][_0x625c('0x33')]));_0x144257[_0x625c('0x32')]=_0x144257['attributes'][_0x625c('0x34')]?_0x144257[_0x625c('0x32')]:_0x32a596[_0x625c('0x2d')];if(_0x565559['query'][_0x625c('0x3e')]){_0x144257[_0x625c('0x43')]=[{'all':!![]}];}_0x144257=_[_0x625c('0x3c')]({},_0x144257,_0x565559['options']);return db[_0x625c('0x2a')][_0x625c('0x44')](_0x144257)['then'](handleEntityNotFound(_0x27d57d,null))[_0x625c('0x21')](respondWithResult(_0x27d57d,null))[_0x625c('0x40')](handleError(_0x27d57d,null));};exports[_0x625c('0x45')]=function(_0x4ef657,_0x47612b){return db[_0x625c('0x2a')][_0x625c('0x45')](_0x4ef657[_0x625c('0x46')],{})['then'](respondWithResult(_0x47612b,0xc9))[_0x625c('0x40')](handleError(_0x47612b,null));};exports['update']=function(_0x18534c,_0x3ee5e8){if(_0x18534c['body']['id']){delete _0x18534c[_0x625c('0x46')]['id'];}return db[_0x625c('0x2a')]['find']({'where':{'id':_0x18534c[_0x625c('0x42')]['id']}})['then'](handleEntityNotFound(_0x3ee5e8,null))[_0x625c('0x21')](saveUpdates(_0x18534c['body'],null))[_0x625c('0x21')](respondWithResult(_0x3ee5e8,null))['catch'](handleError(_0x3ee5e8,null));};exports[_0x625c('0x22')]=function(_0x10b43d,_0x1bd829){return db[_0x625c('0x2a')][_0x625c('0x44')]({'where':{'id':_0x10b43d[_0x625c('0x42')]['id']}})[_0x625c('0x21')](handleEntityNotFound(_0x1bd829,null))['then'](removeEntity(_0x1bd829,null))[_0x625c('0x40')](handleError(_0x1bd829,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 48401b1..b45e30c 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 _0x158b=['bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x3cb308,_0x161723){var _0x2d5e42=function(_0x214758){while(--_0x214758){_0x3cb308['push'](_0x3cb308['shift']());}};_0x2d5e42(++_0x161723);}(_0x158b,0xe9));var _0xb158=function(_0x2665b5,_0x30c8ba){_0x2665b5=_0x2665b5-0x0;var _0x4ecdc4=_0x158b[_0x2665b5];return _0x4ecdc4;};'use strict';var _=require(_0xb158('0x0'));var util=require(_0xb158('0x1'));var logger=require(_0xb158('0x2'))(_0xb158('0x3'));var moment=require(_0xb158('0x4'));var BPromise=require(_0xb158('0x5'));var rp=require(_0xb158('0x6'));var fs=require('fs');var path=require(_0xb158('0x7'));var rimraf=require(_0xb158('0x8'));var config=require(_0xb158('0x9'));var attributes=require(_0xb158('0xa'));module[_0xb158('0xb')]=function(_0x4fbbb8,_0x4ef3e5){return _0x4fbbb8[_0xb158('0xc')](_0xb158('0xd'),attributes,{'tableName':_0xb158('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb158('0xf'),'collate':_0xb158('0x10')});}; \ No newline at end of file +var _0x5555=['rimraf','../../config/environment','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','util','api','request-promise','path'];(function(_0x443242,_0x4d9878){var _0x2c7479=function(_0xa1a7b6){while(--_0xa1a7b6){_0x443242['push'](_0x443242['shift']());}};_0x2c7479(++_0x4d9878);}(_0x5555,0x6a));var _0x5555=function(_0x420e6d,_0x3d83db){_0x420e6d=_0x420e6d-0x0;var _0x591cc3=_0x5555[_0x420e6d];return _0x591cc3;};'use strict';var _=require('lodash');var util=require(_0x5555('0x0'));var logger=require('../../config/logger')(_0x5555('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5555('0x2'));var fs=require('fs');var path=require(_0x5555('0x3'));var rimraf=require(_0x5555('0x4'));var config=require(_0x5555('0x5'));var attributes=require('./openchannelApplication.attributes');module[_0x5555('0x6')]=function(_0x20153b,_0x51a7e1){return _0x20153b[_0x5555('0x7')](_0x5555('0x8'),attributes,{'tableName':_0x5555('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5555('0xa')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 43fc828..d5ced4a 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 _0xe42e=['message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','limit','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelApplication,\x20%s,\x20%s'];(function(_0x28cb21,_0x265906){var _0x5c6153=function(_0x16ac9b){while(--_0x16ac9b){_0x28cb21['push'](_0x28cb21['shift']());}};_0x5c6153(++_0x265906);}(_0xe42e,0xbf));var _0xee42=function(_0x340de8,_0x3fbff6){_0x340de8=_0x340de8-0x0;var _0x326015=_0xe42e[_0x340de8];return _0x326015;};'use strict';var _=require(_0xee42('0x0'));var util=require(_0xee42('0x1'));var moment=require('moment');var BPromise=require(_0xee42('0x2'));var rs=require(_0xee42('0x3'));var fs=require('fs');var Redis=require(_0xee42('0x4'));var db=require(_0xee42('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xee42('0x6'))(_0xee42('0x7'));var config=require('../../config/environment');var jayson=require(_0xee42('0x8'));var client=jayson['client'][_0xee42('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7f08f6,_0x5867a4,_0x82bdc4){return new BPromise(function(_0x36f7c0,_0x1e14f1){return client[_0xee42('0xa')](_0x7f08f6,_0x82bdc4)[_0xee42('0xb')](function(_0x520ac6){logger[_0xee42('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x5867a4,_0xee42('0xd'));logger[_0xee42('0xe')](_0xee42('0xf'),_0x5867a4,_0xee42('0xd'),JSON[_0xee42('0x10')](_0x520ac6));if(_0x520ac6[_0xee42('0x11')]){if(_0x520ac6[_0xee42('0x11')]['code']===0x1f4){logger[_0xee42('0x11')](_0xee42('0x12'),_0x5867a4,_0x520ac6['error'][_0xee42('0x13')]);return _0x1e14f1(_0x520ac6[_0xee42('0x11')][_0xee42('0x13')]);}logger[_0xee42('0x11')](_0xee42('0x12'),_0x5867a4,_0x520ac6['error']['message']);return _0x36f7c0(_0x520ac6[_0xee42('0x11')]['message']);}else{logger['info'](_0xee42('0x12'),_0x5867a4,_0xee42('0xd'));_0x36f7c0(_0x520ac6[_0xee42('0x14')][_0xee42('0x13')]);}})['catch'](function(_0x79d34f){logger['error'](_0xee42('0x12'),_0x5867a4,_0x79d34f);_0x1e14f1(_0x79d34f);});});}exports[_0xee42('0x15')]=function(_0x19aeda){var _0x4f876b=this;return new Promise(function(_0x244b70,_0x8dc3de){return db[_0xee42('0x16')][_0xee42('0x17')](_0x19aeda[_0xee42('0x18')],{'raw':_0x19aeda['options']?_0x19aeda[_0xee42('0x19')][_0xee42('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19aeda['options']?_0x19aeda[_0xee42('0x19')][_0xee42('0x1b')]||null:null,'attributes':_0x19aeda[_0xee42('0x19')]?_0x19aeda[_0xee42('0x19')]['attributes']||null:null,'limit':_0x19aeda[_0xee42('0x19')]?_0x19aeda[_0xee42('0x19')][_0xee42('0x1c')]||null:null})[_0xee42('0xb')](function(_0xa5d9f5){logger[_0xee42('0xc')](_0xee42('0x15'),_0x19aeda);logger[_0xee42('0xe')]('UpdateOpenchannelApplication',_0x19aeda,JSON[_0xee42('0x10')](_0xa5d9f5));_0x244b70(_0xa5d9f5);})[_0xee42('0x1d')](function(_0x238bd7){logger[_0xee42('0x11')](_0xee42('0x15'),_0x238bd7[_0xee42('0x13')],_0x19aeda);_0x8dc3de(_0x4f876b[_0xee42('0x11')](0x1f4,_0x238bd7[_0xee42('0x13')]));});});}; \ No newline at end of file +var _0xa835=['../../config/environment','client','http','then','info','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','OpenchannelApplication,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','options','attributes','limit','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1a170a,_0xcc9fca){var _0x413c33=function(_0xbb6447){while(--_0xbb6447){_0x1a170a['push'](_0x1a170a['shift']());}};_0x413c33(++_0xcc9fca);}(_0xa835,0xc2));var _0x5a83=function(_0x4d216f,_0x4c4a62){_0x4d216f=_0x4d216f-0x0;var _0x22827d=_0xa835[_0x4d216f];return _0x22827d;};'use strict';var _=require(_0x5a83('0x0'));var util=require('util');var moment=require(_0x5a83('0x1'));var BPromise=require(_0x5a83('0x2'));var rs=require(_0x5a83('0x3'));var fs=require('fs');var Redis=require(_0x5a83('0x4'));var db=require(_0x5a83('0x5'))['db'];var utils=require(_0x5a83('0x6'));var logger=require(_0x5a83('0x7'))(_0x5a83('0x8'));var config=require(_0x5a83('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5a83('0xa')][_0x5a83('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24fb5d,_0xb124e5,_0x191a93){return new BPromise(function(_0x1f48b3,_0x2c5637){return client['request'](_0x24fb5d,_0x191a93)[_0x5a83('0xc')](function(_0x182e67){logger[_0x5a83('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0xb124e5,'request\x20sent');logger['debug'](_0x5a83('0xe'),_0xb124e5,_0x5a83('0xf'),JSON[_0x5a83('0x10')](_0x182e67));if(_0x182e67[_0x5a83('0x11')]){if(_0x182e67[_0x5a83('0x11')]['code']===0x1f4){logger[_0x5a83('0x11')](_0x5a83('0x12'),_0xb124e5,_0x182e67[_0x5a83('0x11')][_0x5a83('0x13')]);return _0x2c5637(_0x182e67[_0x5a83('0x11')][_0x5a83('0x13')]);}logger[_0x5a83('0x11')](_0x5a83('0x12'),_0xb124e5,_0x182e67['error'][_0x5a83('0x13')]);return _0x1f48b3(_0x182e67[_0x5a83('0x11')][_0x5a83('0x13')]);}else{logger[_0x5a83('0xd')](_0x5a83('0x12'),_0xb124e5,_0x5a83('0xf'));_0x1f48b3(_0x182e67[_0x5a83('0x14')][_0x5a83('0x13')]);}})[_0x5a83('0x15')](function(_0x22e3e7){logger[_0x5a83('0x11')](_0x5a83('0x12'),_0xb124e5,_0x22e3e7);_0x2c5637(_0x22e3e7);});});}exports[_0x5a83('0x16')]=function(_0x356b9d){var _0x7f0738=this;return new Promise(function(_0x3f8da3,_0x31c431){return db[_0x5a83('0x17')][_0x5a83('0x18')](_0x356b9d['body'],{'raw':_0x356b9d['options']?_0x356b9d['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x356b9d[_0x5a83('0x19')]?_0x356b9d[_0x5a83('0x19')]['where']||null:null,'attributes':_0x356b9d[_0x5a83('0x19')]?_0x356b9d[_0x5a83('0x19')][_0x5a83('0x1a')]||null:null,'limit':_0x356b9d[_0x5a83('0x19')]?_0x356b9d[_0x5a83('0x19')][_0x5a83('0x1b')]||null:null})[_0x5a83('0xc')](function(_0x462815){logger['info'](_0x5a83('0x16'),_0x356b9d);logger[_0x5a83('0x1c')]('UpdateOpenchannelApplication',_0x356b9d,JSON[_0x5a83('0x10')](_0x462815));_0x3f8da3(_0x462815);})['catch'](function(_0xb733d0){logger['error'](_0x5a83('0x16'),_0xb733d0[_0x5a83('0x13')],_0x356b9d);_0x31c431(_0x7f0738['error'](0x1f4,_0xb733d0[_0x5a83('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 11f88e6..4a5009a 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 _0xb9ca=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','index','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','download','post','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','update','delete','removeTags','exports','util','path','connect-timeout','fs-extra'];(function(_0x3cebba,_0x6d5a7){var _0x2d2096=function(_0x52f274){while(--_0x52f274){_0x3cebba['push'](_0x3cebba['shift']());}};_0x2d2096(++_0x6d5a7);}(_0xb9ca,0xf8));var _0xab9c=function(_0x134999,_0x4de0c9){_0x134999=_0x134999-0x0;var _0x46e471=_0xb9ca[_0x134999];return _0x46e471;};'use strict';var multer=require('multer');var util=require(_0xab9c('0x0'));var path=require(_0xab9c('0x1'));var timeout=require(_0xab9c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xab9c('0x3'));var auth=require(_0xab9c('0x4'));var interaction=require(_0xab9c('0x5'));var config=require(_0xab9c('0x6'));var controller=require(_0xab9c('0x7'));router[_0xab9c('0x8')]('/',auth['isAuthenticated'](),controller[_0xab9c('0x9')]);router[_0xab9c('0x8')]('/describe',auth[_0xab9c('0xa')](),controller[_0xab9c('0xb')]);router[_0xab9c('0x8')](_0xab9c('0xc'),auth[_0xab9c('0xa')](),controller[_0xab9c('0xd')]);router[_0xab9c('0x8')](_0xab9c('0xe'),auth[_0xab9c('0xa')](),controller[_0xab9c('0xf')]);router[_0xab9c('0x8')]('/:id/download',auth[_0xab9c('0xa')](),controller[_0xab9c('0x10')]);router[_0xab9c('0x11')]('/',auth[_0xab9c('0xa')](),controller['create']);router['post'](_0xab9c('0xe'),auth[_0xab9c('0xa')](),controller['addMessage']);router[_0xab9c('0x11')](_0xab9c('0x12'),auth[_0xab9c('0xa')](),interaction[_0xab9c('0x13')](_0xab9c('0x14'),_0xab9c('0x15')),controller[_0xab9c('0x16')]);router['put'](_0xab9c('0xc'),auth['isAuthenticated'](),interaction[_0xab9c('0x13')](_0xab9c('0x14'),_0xab9c('0x17')),controller[_0xab9c('0x18')]);router[_0xab9c('0x19')](_0xab9c('0xc'),auth[_0xab9c('0xa')](),interaction['tracked'](_0xab9c('0x14'),'openchannelinteraction:destroy'),controller['destroy']);router[_0xab9c('0x19')]('/:id/tags',auth[_0xab9c('0xa')](),controller[_0xab9c('0x1a')]);module[_0xab9c('0x1b')]=router; \ No newline at end of file +var _0x10b5=['delete','openchannelinteraction:destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','get','isAuthenticated','index','describe','/:id','show','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','put','tracked','openchannel','openchannelinteraction:update','update'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x10b5,0xa4));var _0x510b=function(_0x1e8ad7,_0x28681e){_0x1e8ad7=_0x1e8ad7-0x0;var _0x42adf9=_0x10b5[_0x1e8ad7];return _0x42adf9;};'use strict';var multer=require(_0x510b('0x0'));var util=require(_0x510b('0x1'));var path=require(_0x510b('0x2'));var timeout=require(_0x510b('0x3'));var express=require(_0x510b('0x4'));var router=express['Router']();var fs_extra=require(_0x510b('0x5'));var auth=require(_0x510b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelInteraction.controller');router[_0x510b('0x7')]('/',auth[_0x510b('0x8')](),controller[_0x510b('0x9')]);router[_0x510b('0x7')]('/describe',auth[_0x510b('0x8')](),controller[_0x510b('0xa')]);router[_0x510b('0x7')](_0x510b('0xb'),auth[_0x510b('0x8')](),controller[_0x510b('0xc')]);router[_0x510b('0x7')]('/:id/messages',auth[_0x510b('0x8')](),controller[_0x510b('0xd')]);router[_0x510b('0x7')](_0x510b('0xe'),auth['isAuthenticated'](),controller[_0x510b('0xf')]);router[_0x510b('0x10')]('/',auth[_0x510b('0x8')](),controller[_0x510b('0x11')]);router[_0x510b('0x10')]('/:id/messages',auth[_0x510b('0x8')](),controller[_0x510b('0x12')]);router['post'](_0x510b('0x13'),auth['isAuthenticated'](),interaction['tracked']('openchannel','openchannelinteraction:addtags'),controller['addTags']);router[_0x510b('0x14')](_0x510b('0xb'),auth['isAuthenticated'](),interaction[_0x510b('0x15')](_0x510b('0x16'),_0x510b('0x17')),controller[_0x510b('0x18')]);router[_0x510b('0x19')](_0x510b('0xb'),auth[_0x510b('0x8')](),interaction['tracked'](_0x510b('0x16'),_0x510b('0x1a')),controller['destroy']);router[_0x510b('0x19')](_0x510b('0x13'),auth[_0x510b('0x8')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 75110f0..90e7f76 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 _0x6fad=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x4db0c6,_0x5e810e){var _0x4baae9=function(_0x6d56df){while(--_0x6d56df){_0x4db0c6['push'](_0x4db0c6['shift']());}};_0x4baae9(++_0x5e810e);}(_0x6fad,0x174));var _0xd6fa=function(_0xe59443,_0x1c7fbc){_0xe59443=_0xe59443-0x0;var _0x155142=_0x6fad[_0xe59443];return _0x155142;};'use strict';var Sequelize=require(_0xd6fa('0x0'));module[_0xd6fa('0x1')]={'closed':{'type':Sequelize[_0xd6fa('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd6fa('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xd6fa('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xd6fa('0x4')]},'read1stAt':{'type':Sequelize[_0xd6fa('0x3')]},'threadId':{'type':Sequelize[_0xd6fa('0x4')]},'externalUrl':{'type':Sequelize[_0xd6fa('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xd6fa('0x5')]('in',_0xd6fa('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xd6fa('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xd6fa('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x8c25=['STRING','out','sequelize','exports','BOOLEAN','DATE'];(function(_0xd5a33b,_0x52f521){var _0x294254=function(_0x2f865d){while(--_0x2f865d){_0xd5a33b['push'](_0xd5a33b['shift']());}};_0x294254(++_0x52f521);}(_0x8c25,0x15e));var _0x58c2=function(_0x2644b9,_0x51b941){_0x2644b9=_0x2644b9-0x0;var _0x521d8f=_0x8c25[_0x2644b9];return _0x521d8f;};'use strict';var Sequelize=require(_0x58c2('0x0'));module[_0x58c2('0x1')]={'closed':{'type':Sequelize[_0x58c2('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x58c2('0x3')]},'disposition':{'type':Sequelize[_0x58c2('0x4')]},'secondDisposition':{'type':Sequelize[_0x58c2('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x58c2('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x58c2('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x58c2('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 00784f9..1eff4c2 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 _0x8fb2=['fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','fullname','Tags','split','forEach','push','TagIds','index','OpenchannelInteraction','rawAttributes','fieldName','key','model','query','keys','filters','fields','length','attributes','hasOwnProperty','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','user_has_openchannel_interactions','users','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','conditions','unreadMessages','value','`\x20=\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','type','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','some','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','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','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','all','rows','catch','params','intersection','includeAll','merge','options','create','body','destroy','describe','addMessage','ids','omit','getMessages','findOne','nolimit','order','OpenchannelInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','OpenchannelMessage','include','findAll','addTags','setTags','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','transcript-%d-%s.zip','Attachment','createdAt','secret','OpenchannelAccount','Owner','get','mkdirSync','Openchannel','Account','N.A.','closed','threadId','Private','basename','createReadStream','pipe','out','firstName','lastName','direction','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs'];(function(_0x7a3d26,_0x4c1d5d){var _0x293427=function(_0x1711d9){while(--_0x1711d9){_0x7a3d26['push'](_0x7a3d26['shift']());}};_0x293427(++_0x4c1d5d);}(_0x8fb2,0x1dd));var _0x28fb=function(_0x5d3541,_0x5bed00){_0x5d3541=_0x5d3541-0x0;var _0x22faf6=_0x8fb2[_0x5d3541];return _0x22faf6;};'use strict';var emlformat=require(_0x28fb('0x0'));var rimraf=require(_0x28fb('0x1'));var zipdir=require(_0x28fb('0x2'));var jsonpatch=require(_0x28fb('0x3'));var rp=require('request-promise');var moment=require(_0x28fb('0x4'));var BPromise=require(_0x28fb('0x5'));var Mustache=require(_0x28fb('0x6'));var util=require('util');var path=require('path');var sox=require(_0x28fb('0x7'));var csv=require('to-csv');var ejs=require(_0x28fb('0x8'));var fs=require('fs');var fs_extra=require(_0x28fb('0x9'));var _=require(_0x28fb('0xa'));var squel=require(_0x28fb('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x28fb('0xc'));var toCsv=require(_0x28fb('0xd'));var querystring=require(_0x28fb('0xe'));var Papa=require(_0x28fb('0xf'));var Redis=require(_0x28fb('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x28fb('0x11'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0x28fb('0x12'));var logger=require(_0x28fb('0x13'))('api');var utils=require(_0x28fb('0x14'));var config=require(_0x28fb('0x15'));var licenseUtil=require(_0x28fb('0x16'));var db=require(_0x28fb('0x17'))['db'];config[_0x28fb('0x18')]=_['defaults'](config[_0x28fb('0x18')],{'host':_0x28fb('0x19'),'port':0x18eb});var socket=require(_0x28fb('0x1a'))(new Redis(config[_0x28fb('0x18')]));require(_0x28fb('0x1b'))[_0x28fb('0x1c')](socket);function respondWithStatusCode(_0x5d934b,_0x4bf05c){_0x4bf05c=_0x4bf05c||0xcc;return function(_0x9c0a7b){if(_0x9c0a7b){return _0x5d934b[_0x28fb('0x1d')](_0x4bf05c);}return _0x5d934b[_0x28fb('0x1e')](_0x4bf05c)[_0x28fb('0x1f')]();};}function respondWithResult(_0x520283,_0x3173fd){_0x3173fd=_0x3173fd||0xc8;return function(_0x1eb51d){if(_0x1eb51d){return _0x520283[_0x28fb('0x1e')](_0x3173fd)[_0x28fb('0x20')](_0x1eb51d);}};}function respondWithFilteredResult(_0x1ca5ef,_0x4c6993){return function(_0x3c5295){if(_0x3c5295){var _0x453cca=typeof _0x4c6993[_0x28fb('0x21')]===_0x28fb('0x22')&&typeof _0x4c6993[_0x28fb('0x23')]===_0x28fb('0x22');var _0x55b520=_0x3c5295[_0x28fb('0x24')];var _0x3cd886=_0x453cca?0x0:_0x4c6993['offset'];var _0x20c526=_0x453cca?_0x3c5295['count']:_0x4c6993[_0x28fb('0x21')]+_0x4c6993[_0x28fb('0x23')];var _0x2c0799;if(_0x20c526>=_0x55b520){_0x20c526=_0x55b520;_0x2c0799=0xc8;}else{_0x2c0799=0xce;}_0x1ca5ef[_0x28fb('0x1e')](_0x2c0799);return _0x1ca5ef['set'](_0x28fb('0x25'),_0x3cd886+'-'+_0x20c526+'/'+_0x55b520)[_0x28fb('0x20')](_0x3c5295);}return null;};}function patchUpdates(_0x572a7f){return function(_0x86b649){try{jsonpatch[_0x28fb('0x26')](_0x86b649,_0x572a7f,!![]);}catch(_0x5432ba){return BPromise[_0x28fb('0x27')](_0x5432ba);}return _0x86b649[_0x28fb('0x28')]();};}function saveUpdates(_0x50c515,_0x377ccf){return function(_0x444bcc){if(_0x444bcc){return _0x444bcc[_0x28fb('0x29')](_0x50c515)[_0x28fb('0x2a')](function(_0x431c86){return _0x431c86;});}return null;};}function removeEntity(_0x1859bf,_0x5ef1c7){return function(_0x256d78){if(_0x256d78){return _0x256d78['destroy']()[_0x28fb('0x2a')](function(){_0x1859bf[_0x28fb('0x1e')](0xcc)[_0x28fb('0x1f')]();});}};}function handleEntityNotFound(_0x413d4a,_0x1e9f01){return function(_0x460abe){if(!_0x460abe){_0x413d4a[_0x28fb('0x1d')](0x194);}return _0x460abe;};}function handleError(_0x59e73b,_0x6b6900){_0x6b6900=_0x6b6900||0x1f4;return function(_0x50beaa){logger[_0x28fb('0x2b')](_0x50beaa[_0x28fb('0x2c')]);if(_0x50beaa[_0x28fb('0x2d')]){delete _0x50beaa[_0x28fb('0x2d')];}_0x59e73b['status'](_0x6b6900)[_0x28fb('0x2e')](_0x50beaa);};}function getInteractionUsers(_0x1fcc34,_0x180a65){return new BPromise(function(_0x201021,_0x55e9c0){try{if(_0x180a65[_0x1fcc34['id']]){_0x1fcc34['Users']=_[_0x28fb('0x2f')](_0x180a65[_0x1fcc34['id']],function(_0x2e9df4){return{'id':_0x2e9df4['id'],'fullname':_0x2e9df4[_0x28fb('0x30')]};});}}catch(_0x1d4b93){_0x55e9c0(_0x1d4b93);}_0x201021(_0x1fcc34);});}function getInteractionTags(_0x213b5f,_0x1c1d1c){return new BPromise(function(_0x4050c5,_0x4e3b52){try{if(_0x213b5f['TagIds']){_0x213b5f[_0x28fb('0x31')]=[];_0x213b5f['TagIds'][_0x28fb('0x32')](',')[_0x28fb('0x33')](function(_0x509d5e){_0x213b5f['Tags'][_0x28fb('0x34')](_0x1c1d1c[_0x509d5e]);});}delete _0x213b5f[_0x28fb('0x35')];}catch(_0x1be427){_0x4e3b52(_0x1be427);}_0x4050c5(_0x213b5f);});}function updateOpenchannelInteraction(_0x343b94,_0x25fc63,_0x5b06b3){return new BPromise(function(_0xde5646,_0x61905b){return getInteractionUsers(_0x343b94,_0x5b06b3)[_0x28fb('0x2a')](function(_0x400a6e){return getInteractionTags(_0x400a6e,_0x25fc63);})[_0x28fb('0x2a')](function(_0x4ff569){_0xde5646(_0x4ff569);})['catch'](function(_0xa020aa){_0x61905b(_0xa020aa);});});}exports[_0x28fb('0x36')]=function(_0x24e42c,_0x1b4223){var _0x8be75f={},_0x430f3a={},_0x3483cc={'count':0x0,'rows':[]};var _0x2a037a=_[_0x28fb('0x2f')](db[_0x28fb('0x37')][_0x28fb('0x38')],function(_0x375462){return{'name':_0x375462[_0x28fb('0x39')],'type':_0x375462['type'][_0x28fb('0x3a')]};});_0x430f3a[_0x28fb('0x3b')]=_[_0x28fb('0x2f')](_0x2a037a,_0x28fb('0x2d'));_0x430f3a[_0x28fb('0x3c')]=_[_0x28fb('0x3d')](_0x24e42c[_0x28fb('0x3c')]);_0x430f3a[_0x28fb('0x3e')]=_['intersection'](_0x430f3a['model'],_0x430f3a[_0x28fb('0x3c')]);_0x8be75f['attributes']=_['intersection'](_0x430f3a['model'],qs['fields'](_0x24e42c[_0x28fb('0x3c')][_0x28fb('0x3f')]));_0x8be75f['attributes']=_0x8be75f['attributes'][_0x28fb('0x40')]?_0x8be75f[_0x28fb('0x41')]:_0x430f3a['model'];if(!_0x24e42c[_0x28fb('0x3c')][_0x28fb('0x42')]('nolimit')){_0x8be75f[_0x28fb('0x23')]=qs[_0x28fb('0x23')](_0x24e42c[_0x28fb('0x3c')][_0x28fb('0x23')]);_0x8be75f[_0x28fb('0x21')]=qs[_0x28fb('0x21')](_0x24e42c[_0x28fb('0x3c')]['offset']);}_0x8be75f['order']=qs[_0x28fb('0x43')](_0x24e42c[_0x28fb('0x3c')][_0x28fb('0x43')]);_0x8be75f[_0x28fb('0x44')]=qs[_0x28fb('0x3e')](_[_0x28fb('0x45')](_0x24e42c[_0x28fb('0x3c')],_0x430f3a['filters']),_0x2a037a);var _0x4c497a=[];var _0x35b091=squel[_0x28fb('0x46')]()['field']('id')['field'](_0x28fb('0x2d'))[_0x28fb('0x47')](_0x28fb('0x48'))[_0x28fb('0x49')](_0x28fb('0x4a'));var _0x2d4bcb=squel[_0x28fb('0x46')]()['field'](_0x28fb('0x4b'))[_0x28fb('0x47')](_0x28fb('0x4c'))[_0x28fb('0x47')]('ui.OpenchannelInteractionId')[_0x28fb('0x49')](_0x28fb('0x4d'),'ui')['left_join'](_0x28fb('0x4e'),'u',_0x28fb('0x4f'));var _0x459082=squel[_0x28fb('0x46')]()[_0x28fb('0x49')](_0x28fb('0x50'),'i')[_0x28fb('0x51')](_0x28fb('0x52'),'c',_0x28fb('0x53'))[_0x28fb('0x51')](_0x28fb('0x4e'),'o',_0x28fb('0x54'))['left_join']('openchannel_accounts','a','a.id\x20=\x20i.OpenchannelAccountId')[_0x28fb('0x51')]('openchannel_messages','me',_0x28fb('0x55'))['left_join'](_0x28fb('0x56'),'it',_0x28fb('0x57'))[_0x28fb('0x51')](_0x28fb('0x4a'),'t',_0x28fb('0x58'));var _0x31730e=squel['expr']();var _0x5defee=[];var _0x5c7039=squel[_0x28fb('0x59')]();var _0x49c83a;if(_0x24e42c[_0x28fb('0x3c')]['search']){_0x49c83a=as[_0x28fb('0x5a')](_0x24e42c[_0x28fb('0x3c')]['search']);var _0x5d273f=_0x49c83a[_0x28fb('0x5b')];for(var _0x562d27=0x0;_0x562d27<_0x49c83a['conditions'][_0x28fb('0x40')];_0x562d27++){var _0x2e5c3d=_0x49c83a[_0x28fb('0x5c')][_0x562d27];var _0x5ed90c='i';var _0x50fffa=_['find'](_0x2a037a,[_0x28fb('0x2d'),_0x2e5c3d[_0x28fb('0x47')]]);if(!_0x50fffa){switch(_0x2e5c3d[_0x28fb('0x47')]){case _0x28fb('0x5d'):if(_0x2e5c3d[_0x28fb('0x5e')]==0x1){_0x459082['having']('`'+_0x2e5c3d[_0x28fb('0x47')]+_0x28fb('0x5f'));}else{_0x459082['having']('`'+_0x2e5c3d[_0x28fb('0x47')]+'`\x20>\x200');}break;case _0x28fb('0x60'):if(_0x2e5c3d[_0x28fb('0x61')]===_0x28fb('0x62')){if(_0x2e5c3d[_0x28fb('0x5e')][_0x28fb('0x32')]('\x20')[_0x28fb('0x40')]>0x1){_0x31730e[_0x5d273f]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x28fb('0x63')](_0x2e5c3d[_0x28fb('0x5e')]),null);}else{var _0x326005='%'+_0x2e5c3d[_0x28fb('0x5e')]+'%';_0x31730e[_0x5d273f](_0x28fb('0x64'),_0x326005,_0x326005,_0x326005);}}else{_0x50fffa=_[_0x28fb('0x65')](_0x2a037a,[_0x28fb('0x2d'),_0x28fb('0x66')]);_0x2e5c3d['field']=_0x28fb('0x66');_0x274d4c=as[_0x28fb('0x67')](_0x5ed90c,_0x50fffa[_0x28fb('0x68')],_0x2e5c3d);_0x31730e[_0x5d273f](_0x274d4c['text'],_0x274d4c[_0x28fb('0x5e')][_0x28fb('0x69')],_0x274d4c['value'][_0x28fb('0x1f')]);}break;case _0x28fb('0x6a'):var _0x3d39cf=_0x2e5c3d[_0x28fb('0x5e')][_0x28fb('0x32')](',')[_0x28fb('0x2f')](function(_0x12c9b0){return Number(_0x12c9b0);});_0x3d39cf[_0x28fb('0x33')](function(_0x3b94ae){_0x5c7039['or'](_0x28fb('0x6b'),'%,'+_0x3b94ae+',%');});_0x5defee=_[_0x28fb('0x6c')](_0x5defee,_0x3d39cf);break;case _0x28fb('0x6d'):if(_0x2e5c3d[_0x28fb('0x61')]===_0x28fb('0x62')){_0x31730e[_0x5d273f](_0x28fb('0x6e'),'%'+_0x2e5c3d[_0x28fb('0x5e')]+'%',null);}else{_0x50fffa=_[_0x28fb('0x65')](_0x2a037a,[_0x28fb('0x2d'),'UserId']);_0x2e5c3d[_0x28fb('0x47')]='UserId';_0x274d4c=as[_0x28fb('0x67')](_0x5ed90c,_0x50fffa[_0x28fb('0x68')],_0x2e5c3d);_0x31730e[_0x5d273f](_0x274d4c[_0x28fb('0x6f')],_0x274d4c[_0x28fb('0x5e')][_0x28fb('0x69')],_0x274d4c['value']['end']);}break;case'body':_0x274d4c=as[_0x28fb('0x67')]('me',null,_0x2e5c3d);_0x31730e[_0x5d273f](_0x274d4c[_0x28fb('0x6f')],_0x274d4c[_0x28fb('0x5e')][_0x28fb('0x69')],_0x274d4c[_0x28fb('0x5e')][_0x28fb('0x1f')]);break;}}else{var _0x274d4c=as['buildExpression'](_0x5ed90c,_0x50fffa[_0x28fb('0x68')],_0x2e5c3d);_0x31730e[_0x5d273f](_0x274d4c[_0x28fb('0x6f')],_0x274d4c[_0x28fb('0x5e')][_0x28fb('0x69')],_0x274d4c[_0x28fb('0x5e')][_0x28fb('0x1f')]);}}}else{var _0x3b1523=_(_0x24e42c[_0x28fb('0x3c')])[_0x28fb('0x3d')]()[_0x28fb('0x2f')](function(_0x500eec){return _[_0x28fb('0x70')](_0x2a037a,['name',_0x500eec])?_0x500eec:undefined;})['compact']()[_0x28fb('0x5e')]();if(!_[_0x28fb('0x71')](_0x3b1523)){_0x3b1523[_0x28fb('0x33')](function(_0x1f94a7){if(_0x1f94a7===_0x28fb('0x72')){_0x459082['where'](_0x28fb('0x73'),[][_0x28fb('0x74')](_0x24e42c[_0x28fb('0x3c')][_0x1f94a7]));}else if(_0x1f94a7==='createdAt'){var _0x4ca486=JSON['parse'](_0x24e42c['query'][_0x1f94a7])[_0x28fb('0x75')];var _0x44ebb0=JSON[_0x28fb('0x76')](_0x24e42c[_0x28fb('0x3c')][_0x1f94a7])[_0x28fb('0x77')];_0x459082[_0x28fb('0x44')](_0x28fb('0x78'),_0x4ca486,_0x44ebb0);}else{if(_0x24e42c[_0x28fb('0x3c')][_0x1f94a7]===_0x28fb('0x79')){_0x459082[_0x28fb('0x44')]('i.'+_0x1f94a7+_0x28fb('0x7a'));}else{_0x459082[_0x28fb('0x44')]('i.'+_0x1f94a7+_0x28fb('0x7b'),_0x24e42c[_0x28fb('0x3c')][_0x1f94a7]);}}});}if(_0x24e42c['query'][_0x28fb('0x7c')]){if(_0x24e42c['query']['read']==0x1){_0x459082[_0x28fb('0x7d')](_0x28fb('0x7e'));}else{_0x459082[_0x28fb('0x7d')](_0x28fb('0x7f'));}}if(_0x24e42c[_0x28fb('0x3c')]['tag']){_0x5defee=_[_0x28fb('0x80')](_0x24e42c[_0x28fb('0x3c')][_0x28fb('0x81')])?_0x24e42c[_0x28fb('0x3c')]['tag']:new Array(_0x24e42c[_0x28fb('0x3c')][_0x28fb('0x81')]);_0x5defee[_0x28fb('0x33')](function(_0x33e0e9){_0x5c7039['or'](_0x28fb('0x6b'),'%,'+_0x33e0e9+',%');});}if(_0x24e42c[_0x28fb('0x3c')][_0x28fb('0x82')]){var _0x2396f0=_0x24e42c[_0x28fb('0x3c')][_0x28fb('0x82')][_0x28fb('0x83')]('\x5c','\x5c\x5c')[_0x28fb('0x83')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x2396f0)){_0x31730e['or'](_0x28fb('0x84'),_0x2396f0+'%');}else{_0x31730e['or'](_0x28fb('0x85'),qs[_0x28fb('0x63')](_0x2396f0))['or'](_0x28fb('0x86'),_0x2396f0+'%')['or'](_0x28fb('0x87'),_0x2396f0+'%');}}}_0x459082[_0x28fb('0x44')](_0x31730e);_0x459082[_0x28fb('0x88')](_0x28fb('0x89'));var _0x2dc49d={'type':db[_0x28fb('0x8a')][_0x28fb('0x8b')][_0x28fb('0x8c')],'raw':!![]};var _0xed2e89=_0x459082[_0x28fb('0x8d')]();_0xed2e89['field'](_0x28fb('0x89'));_0xed2e89['field'](_0x28fb('0x8e'),_0x28fb('0x5d'));if(_0x8be75f['order']){_0x8be75f['order']['forEach'](function(_0x428641){var _0x161724=_0x428641[0x0]===_0x28fb('0x8f')?_0x428641[0x0]:'i.'+_0x428641[0x0];_0x459082['order'](_0x161724,_0x428641[0x1]===_0x28fb('0x90')?![]:!![]);});}if(!_[_0x28fb('0x71')](_0x5defee)){_0x459082[_0x28fb('0x7d')](_0x5c7039);_0xed2e89['where']('t.id\x20IN\x20?',_0x5defee);}BPromise[_0x28fb('0x91')]()[_0x28fb('0x2a')](function(){if(!_0x49c83a){if(_0x24e42c[_0x28fb('0x3c')][_0x28fb('0x72')])return;_0xed2e89['where'](_0x28fb('0x92'));_0x459082['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x24e42c[_0x28fb('0x93')][_0x28fb('0x94')]!==_0x28fb('0x95'))return;return _0x24e42c['user'][_0x28fb('0x96')]({'attributes':['id'],'raw':!![]})[_0x28fb('0x2a')](function(_0x28c59e){if(_[_0x28fb('0x71')](_0x28c59e)){_0xed2e89['where'](_0x28fb('0x97'));_0x459082[_0x28fb('0x44')](_0x28fb('0x97'));}else{_0xed2e89[_0x28fb('0x44')](_0x28fb('0x73'),_[_0x28fb('0x2f')](_0x28c59e,'id'));_0x459082[_0x28fb('0x44')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x28fb('0x2f')](_0x28c59e,'id'));}});})['then'](function(){if(_0x24e42c[_0x28fb('0x93')][_0x28fb('0x94')]===_0x28fb('0x95')&&!_0x49c83a&&!_0x24e42c[_0x28fb('0x3c')][_0x28fb('0x72')])return[];return db[_0x28fb('0x98')][_0x28fb('0x3c')](_0xed2e89[_0x28fb('0x99')](),_0x2dc49d);})[_0x28fb('0x2a')](function(_0x19b00f){_0x3483cc[_0x28fb('0x24')]=_0x19b00f['length'];if(_0x3483cc[_0x28fb('0x24')]===0x0)return[];return db['sequelize']['query'](_0x35b091[_0x28fb('0x99')](),_0x2dc49d)[_0x28fb('0x2a')](function(_0x5bf5dc){_0x4c497a=_[_0x28fb('0x9a')](_0x5bf5dc,'id');_0x2dc49d=_['merge'](_0x2dc49d,{'model':db[_0x28fb('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x24e42c['query'][_0x28fb('0x3f')]){_0x8be75f[_0x28fb('0x41')][_0x28fb('0x33')](function(_0x47d728){_0x459082[_0x28fb('0x47')]('i.'+_0x47d728);});}else{_0x459082['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x28fb('0x5d'));_0x459082['field'](_0x28fb('0x9b'),_0x28fb('0x9c'));_0x459082[_0x28fb('0x47')](_0x28fb('0x9d'),_0x28fb('0x9e'));_0x459082[_0x28fb('0x47')](_0x28fb('0x9f'),_0x28fb('0x8f'));_0x459082[_0x28fb('0x47')]('i.*');_0x459082[_0x28fb('0x47')](_0x28fb('0xa0'),'Contact.firstName');_0x459082[_0x28fb('0x47')](_0x28fb('0xa1'),_0x28fb('0xa2'));_0x459082[_0x28fb('0x47')](_0x28fb('0xa3'),_0x28fb('0xa4'));_0x459082[_0x28fb('0x47')](_0x28fb('0xa5'),_0x28fb('0xa6'));_0x459082['field'](_0x28fb('0xa7'),'Contact.mobile');_0x459082[_0x28fb('0x47')](_0x28fb('0xa8'),_0x28fb('0xa9'));_0x459082[_0x28fb('0x47')](_0x28fb('0xaa'),_0x28fb('0xab'));_0x459082[_0x28fb('0x47')](_0x28fb('0xac'),_0x28fb('0xad'));_0x459082['field'](_0x28fb('0xae'),_0x28fb('0x35'));}if(_0x8be75f['limit'])_0x459082['limit'](_0x8be75f['limit']);if(_0x8be75f[_0x28fb('0x21')])_0x459082[_0x28fb('0x21')](_0x8be75f[_0x28fb('0x21')]);return db[_0x28fb('0x98')][_0x28fb('0x3c')](_0x459082[_0x28fb('0x99')](),_0x2dc49d);})['then'](function(_0x4e4c82){if(_0x4e4c82['length']>0x0)_0x2d4bcb[_0x28fb('0x44')](_0x28fb('0xaf'),_['map'](_0x4e4c82,'id'));return db[_0x28fb('0x98')][_0x28fb('0x3c')](_0x2d4bcb[_0x28fb('0x99')](),_0x2dc49d)['then'](function(_0x13c6fc){var _0x4b8fe0=_[_0x28fb('0xb0')](_0x13c6fc,'OpenchannelInteractionId');var _0x407ed5=[];_0x4e4c82[_0x28fb('0x33')](function(_0x5bad9c){_0x407ed5['push'](updateOpenchannelInteraction(_0x5bad9c,_0x4c497a,_0x4b8fe0));});return BPromise[_0x28fb('0xb1')](_0x407ed5);});});})[_0x28fb('0x2a')](function(_0x4d288a){_0x3483cc[_0x28fb('0xb2')]=_0x4d288a;return _0x3483cc;})[_0x28fb('0x2a')](respondWithFilteredResult(_0x1b4223,_0x8be75f))[_0x28fb('0xb3')](handleError(_0x1b4223,null));};exports['show']=function(_0x564558,_0x7c7122){var _0x4dc5b2={};if(_0x564558[_0x28fb('0x3c')][_0x28fb('0x68')]&&_0x564558[_0x28fb('0x3c')][_0x28fb('0x68')]===_0x28fb('0x49')){_0x4dc5b2[_0x28fb('0x49')]=_0x564558[_0x28fb('0xb4')]['id'];}else{_0x4dc5b2['id']=_0x564558[_0x28fb('0xb4')]['id'];}var _0x2d5cf7={'raw':![],'where':_0x4dc5b2},_0x3ebfa5={};_0x3ebfa5[_0x28fb('0x3b')]=_[_0x28fb('0x3d')](db[_0x28fb('0x37')]['rawAttributes']);_0x3ebfa5['query']=_['keys'](_0x564558[_0x28fb('0x3c')]);_0x3ebfa5[_0x28fb('0x3e')]=_[_0x28fb('0xb5')](_0x3ebfa5['model'],_0x3ebfa5[_0x28fb('0x3c')]);_0x2d5cf7[_0x28fb('0x41')]=_[_0x28fb('0xb5')](_0x3ebfa5[_0x28fb('0x3b')],qs[_0x28fb('0x3f')](_0x564558[_0x28fb('0x3c')]['fields']));_0x2d5cf7[_0x28fb('0x41')]=_0x2d5cf7[_0x28fb('0x41')][_0x28fb('0x40')]?_0x2d5cf7[_0x28fb('0x41')]:_0x3ebfa5[_0x28fb('0x3b')];if(_0x564558[_0x28fb('0x3c')][_0x28fb('0xb6')]){_0x2d5cf7['include']=[{'all':!![]}];}_0x2d5cf7=_[_0x28fb('0xb7')]({},_0x2d5cf7,_0x564558[_0x28fb('0xb8')]);return db[_0x28fb('0x37')][_0x28fb('0x65')](_0x2d5cf7)['then'](handleEntityNotFound(_0x7c7122,null))[_0x28fb('0x2a')](respondWithResult(_0x7c7122,null))[_0x28fb('0xb3')](handleError(_0x7c7122,null));};exports[_0x28fb('0xb9')]=function(_0x4c22e4,_0x2e600a){return db[_0x28fb('0x37')]['create'](_0x4c22e4[_0x28fb('0xba')],{})[_0x28fb('0x2a')](respondWithResult(_0x2e600a,0xc9))[_0x28fb('0xb3')](handleError(_0x2e600a,null));};exports[_0x28fb('0x29')]=function(_0x1de2cf,_0xf91231){if(_0x1de2cf[_0x28fb('0xba')]['id']){delete _0x1de2cf[_0x28fb('0xba')]['id'];}return db[_0x28fb('0x37')][_0x28fb('0x65')]({'where':{'id':_0x1de2cf[_0x28fb('0xb4')]['id']}})[_0x28fb('0x2a')](handleEntityNotFound(_0xf91231,null))[_0x28fb('0x2a')](saveUpdates(_0x1de2cf[_0x28fb('0xba')],null))[_0x28fb('0x2a')](respondWithResult(_0xf91231,null))[_0x28fb('0xb3')](handleError(_0xf91231,null));};exports[_0x28fb('0xbb')]=function(_0x5be06b,_0x41298c){return db['OpenchannelInteraction'][_0x28fb('0x65')]({'where':{'id':_0x5be06b[_0x28fb('0xb4')]['id']}})['then'](handleEntityNotFound(_0x41298c,null))[_0x28fb('0x2a')](removeEntity(_0x41298c,null))['catch'](handleError(_0x41298c,null));};exports[_0x28fb('0xbc')]=function(_0x454478,_0x155808){return db['OpenchannelInteraction']['describe']()['then'](respondWithResult(_0x155808,null))[_0x28fb('0xb3')](handleError(_0x155808,null));};exports[_0x28fb('0xbd')]=function(_0x338f7c,_0x10f491,_0x2d3266){return db['OpenchannelMessage'][_0x28fb('0x65')]({'where':{'id':_0x338f7c[_0x28fb('0xb4')]['id']}})[_0x28fb('0x2a')](handleEntityNotFound(_0x10f491,null))[_0x28fb('0x2a')](function(_0x22a6ff){if(_0x22a6ff){return _0x22a6ff[_0x28fb('0xbd')](_0x338f7c[_0x28fb('0xba')][_0x28fb('0xbe')],_[_0x28fb('0xbf')](_0x338f7c[_0x28fb('0xba')],[_0x28fb('0xbe'),'id'])||{});}})[_0x28fb('0x2a')](respondWithResult(_0x10f491,null))[_0x28fb('0xb3')](handleError(_0x10f491,null));};exports[_0x28fb('0xc0')]=function(_0x4e41e7,_0x26564d,_0x21395c){var _0x452e8d={'raw':![],'where':{}};var _0x1f06fa={};var _0x310de8={'count':0x0,'rows':[]};return db[_0x28fb('0x37')][_0x28fb('0xc1')]({'where':{'id':_0x4e41e7[_0x28fb('0xb4')]['id']}})[_0x28fb('0x2a')](handleEntityNotFound(_0x26564d,null))[_0x28fb('0x2a')](function(_0x22197e){if(_0x22197e){_0x1f06fa[_0x28fb('0x3b')]=_[_0x28fb('0x3d')](db['OpenchannelMessage']['rawAttributes']);_0x1f06fa[_0x28fb('0x3c')]=_['keys'](_0x4e41e7[_0x28fb('0x3c')]);_0x1f06fa[_0x28fb('0x3e')]=_['intersection'](_0x1f06fa['model'],_0x1f06fa[_0x28fb('0x3c')]);_0x452e8d['attributes']=_[_0x28fb('0xb5')](_0x1f06fa[_0x28fb('0x3b')],qs[_0x28fb('0x3f')](_0x4e41e7[_0x28fb('0x3c')][_0x28fb('0x3f')]));_0x452e8d[_0x28fb('0x41')]=_0x452e8d[_0x28fb('0x41')][_0x28fb('0x40')]?_0x452e8d[_0x28fb('0x41')]:_0x1f06fa[_0x28fb('0x3b')];if(!_0x4e41e7[_0x28fb('0x3c')][_0x28fb('0x42')](_0x28fb('0xc2'))){_0x452e8d['limit']=qs[_0x28fb('0x23')](_0x4e41e7[_0x28fb('0x3c')][_0x28fb('0x23')]);_0x452e8d[_0x28fb('0x21')]=qs['offset'](_0x4e41e7['query'][_0x28fb('0x21')]);}_0x452e8d[_0x28fb('0xc3')]=qs['sort'](_0x4e41e7['query'][_0x28fb('0x43')]);_0x452e8d[_0x28fb('0x44')]=qs[_0x28fb('0x3e')](_[_0x28fb('0x45')](_0x4e41e7[_0x28fb('0x3c')],_0x1f06fa[_0x28fb('0x3e')]));_0x452e8d[_0x28fb('0x44')][_0x28fb('0xc4')]=_0x22197e['id'];if(_0x4e41e7['query'][_0x28fb('0x82')]){_0x452e8d[_0x28fb('0x44')]=_[_0x28fb('0xb7')](_0x452e8d[_0x28fb('0x44')],{'$or':_[_0x28fb('0x2f')](_0x452e8d[_0x28fb('0x41')],function(_0x50def3){var _0x140bba={};_0x140bba[_0x50def3]={'$like':'%'+_0x4e41e7[_0x28fb('0x3c')][_0x28fb('0x82')]+'%'};return _0x140bba;})});}if(_0x4e41e7[_0x28fb('0x3c')]['$gte']){var _0x5c310b=_0x4e41e7[_0x28fb('0x3c')][_0x28fb('0x75')][_0x28fb('0x32')](',');var _0x1b3414={};_0x1b3414[_0x5c310b[0x0]]={'$gte':moment(_0x5c310b[0x1])[_0x28fb('0xc5')](_0x28fb('0xc6'))};_0x452e8d[_0x28fb('0x44')]=_[_0x28fb('0xb7')](_0x452e8d['where'],_0x1b3414);}_0x452e8d=_['merge']({},_0x452e8d,_0x4e41e7[_0x28fb('0xb8')]);return db[_0x28fb('0xc7')][_0x28fb('0x24')]({'where':_0x452e8d[_0x28fb('0x44')]})[_0x28fb('0x2a')](function(_0x2d20d5){_0x310de8['count']=_0x2d20d5;if(_0x4e41e7[_0x28fb('0x3c')][_0x28fb('0xb6')]){_0x452e8d[_0x28fb('0xc8')]=[{'all':!![]}];}return db[_0x28fb('0xc7')][_0x28fb('0xc9')](_0x452e8d);})[_0x28fb('0x2a')](function(_0x36f45b){_0x310de8[_0x28fb('0xb2')]=_0x36f45b;return _0x310de8;});}})[_0x28fb('0x2a')](respondWithFilteredResult(_0x26564d,_0x452e8d))[_0x28fb('0xb3')](handleError(_0x26564d,null));};exports[_0x28fb('0xca')]=function(_0x51ab3a,_0x242d26,_0x32a879){return db['OpenchannelInteraction'][_0x28fb('0x65')]({'where':{'id':_0x51ab3a[_0x28fb('0xb4')]['id']}})[_0x28fb('0x2a')](handleEntityNotFound(_0x242d26,null))[_0x28fb('0x2a')](function(_0x48df74){if(_0x48df74){return _0x48df74[_0x28fb('0xcb')](_0x51ab3a[_0x28fb('0xba')]['ids'],_['omit'](_0x51ab3a[_0x28fb('0xba')],[_0x28fb('0xbe'),'id'])||{})[_0x28fb('0xcc')](function(){return db[_0x28fb('0x6a')][_0x28fb('0xc9')]({'attributes':['id',_0x28fb('0x2d'),_0x28fb('0x48')],'where':{'id':_0x51ab3a[_0x28fb('0xba')][_0x28fb('0xbe')]}});})[_0x28fb('0x2a')](function(_0x210710){socket[_0x28fb('0xcd')](_0x28fb('0xce'),{'id':Number(_0x51ab3a['params']['id']),'tags':_0x210710||[]});return{'id':Number(_0x51ab3a[_0x28fb('0xb4')]['id']),'tags':_0x210710||[]};});}})[_0x28fb('0x2a')](respondWithResult(_0x242d26,null))[_0x28fb('0xb3')](handleError(_0x242d26,null));};exports[_0x28fb('0xcf')]=function(_0x2b0303,_0x15acac,_0x1f8d93){return db[_0x28fb('0x37')][_0x28fb('0x65')]({'where':{'id':_0x2b0303[_0x28fb('0xb4')]['id']}})[_0x28fb('0x2a')](handleEntityNotFound(_0x15acac,null))['then'](function(_0x5f1cdc){if(_0x5f1cdc){return _0x5f1cdc['removeTags'](_0x2b0303[_0x28fb('0x3c')][_0x28fb('0xbe')]);}})['then'](respondWithStatusCode(_0x15acac,null))[_0x28fb('0xb3')](handleError(_0x15acac,null));};exports[_0x28fb('0xd0')]=function(_0x26b3eb,_0x392c59){var _0xf8e5d9=moment()[_0x28fb('0xd1')]()[_0x28fb('0x99')]();var _0x976b11=path[_0x28fb('0xd2')](config[_0x28fb('0xd3')],_0x28fb('0xd4'),'files','tmp');var _0x2c901a=path[_0x28fb('0xd2')](config[_0x28fb('0xd3')],_0x28fb('0xd4'),_0x28fb('0xd5'),_0x28fb('0xd6'));var _0x5c4f4d=path[_0x28fb('0xd2')](_0x976b11,_0xf8e5d9);var _0x1a3085=util[_0x28fb('0xc5')](_0x28fb('0xd7'),_0x26b3eb[_0x28fb('0xb4')]['id'],_0xf8e5d9);var _0xe1bcd0=path[_0x28fb('0xd2')](_0x976b11,_0x1a3085);var _0x3facc3=[];_0x3facc3[_0x28fb('0x34')]({'model':db[_0x28fb('0x6d')],'as':_0x28fb('0x6d'),'attributes':['id',_0x28fb('0x30')],'raw':!![]});_0x3facc3[_0x28fb('0x34')]({'model':db['CmContact'],'as':_0x28fb('0x60'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x26b3eb['query'][_0x28fb('0xd6')]){_0x3facc3[_0x28fb('0x34')]({'model':db[_0x28fb('0xd8')],'as':_0x28fb('0xd8'),'raw':!![]});}var _0x351a92=[{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id','body',_0x28fb('0xd9'),'direction',_0x28fb('0xda'),_0x28fb('0x7c')],'include':_0x3facc3}];_0x351a92[_0x28fb('0x34')]({'model':db[_0x28fb('0xdb')],'as':'Account','attributes':['id',_0x28fb('0x2d')]});_0x351a92[_0x28fb('0x34')]({'model':db[_0x28fb('0x6d')],'as':_0x28fb('0xdc'),'attributes':['id','fullname']});return db[_0x28fb('0x37')][_0x28fb('0x65')]({'where':{'id':_0x26b3eb[_0x28fb('0xb4')]['id']},'include':_0x351a92})[_0x28fb('0x2a')](handleEntityNotFound(_0x392c59,null))[_0x28fb('0x2a')](function(_0x36f2f7){if(_0x36f2f7){var _0x22dde7=_0x36f2f7[_0x28fb('0xdd')]({'plain':!![]});fs[_0x28fb('0xde')](_0x5c4f4d);var _0x57ff1e={'channel':_0x28fb('0xdf'),'account':_0x22dde7[_0x28fb('0xe0')][_0x28fb('0x2d')],'agent':_0x22dde7['Owner']?_0x22dde7[_0x28fb('0xdc')][_0x28fb('0x30')]:_0x28fb('0xe1'),'createdAt':moment(_0x22dde7['createdAt'])[_0x28fb('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')[_0x28fb('0x99')](),'closedAt':_0x22dde7[_0x28fb('0xe2')]?moment(_0x22dde7['closedAt'])[_0x28fb('0xc5')](_0x28fb('0xc6'))[_0x28fb('0x99')]():'','disposition':_0x22dde7['disposition'],'visibility':_0x22dde7[_0x28fb('0xe3')]?'Public':_0x28fb('0xe4'),'messages':_(_0x22dde7['Messages'])[_0x28fb('0x82')]({'secret':![]})[_0x28fb('0x2f')](function(_0xf6f267){if(_0xf6f267[_0x28fb('0xd8')]){var _0x61a2b1=path[_0x28fb('0xd2')](_0x2c901a,_0xf6f267[_0x28fb('0xd8')][_0x28fb('0xe5')]);if(fs['existsSync'](_0x61a2b1)){fs[_0x28fb('0xe6')](_0x61a2b1)[_0x28fb('0xe7')](fs['createWriteStream'](path[_0x28fb('0xd2')](_0x5c4f4d,_0xf6f267[_0x28fb('0xd8')][_0x28fb('0xe5')])));}}return{'date':moment(_0xf6f267[_0x28fb('0xd9')])[_0x28fb('0xc5')](_0x28fb('0xc6'))[_0x28fb('0x99')](),'sender':_0xf6f267['direction']===_0x28fb('0xe8')?_0xf6f267['User']?_0xf6f267[_0x28fb('0x6d')][_0x28fb('0x30')]:'System':_0xf6f267['Contact'][_0x28fb('0xe9')]+(_0xf6f267[_0x28fb('0x60')]['lastName']?'\x20'+_0xf6f267[_0x28fb('0x60')][_0x28fb('0xea')]:''),'body':_0xf6f267[_0x28fb('0xd8')]?_0xf6f267[_0x28fb('0xd8')][_0x28fb('0xe5')]:_0xf6f267['body'],'direction':_0xf6f267[_0x28fb('0xeb')]===_0x28fb('0xe8')?'A':'C','secret':_0xf6f267[_0x28fb('0xda')],'read':_0xf6f267[_0x28fb('0x7c')],'attachment':_0xf6f267[_0x28fb('0xd8')]};})[_0x28fb('0x5e')]()};return ejs[_0x28fb('0xec')](path[_0x28fb('0xd2')](config[_0x28fb('0xd3')],'server',_0x28fb('0xed'),_0x28fb('0xee')),{'interaction':_0x57ff1e})[_0x28fb('0x2a')](function(_0x3fadb4){var _0x53ce39=path[_0x28fb('0xd2')](_0x5c4f4d,_0x28fb('0xef')+_0x22dde7['id']+'-'+_0xf8e5d9+'.pdf');var _0x3ff215={'path':_0x53ce39,'channel':_0x28fb('0xdf'),'interactionId':_0x22dde7['id']};return pdf[_0x28fb('0xf0')](_0x3fadb4,_0x3ff215);})[_0x28fb('0x2a')](function(){return new BPromise(function(_0x36a7f1,_0xef4a04){zipdir(_0x5c4f4d,{'saveTo':_0xe1bcd0},function(_0x39055b,_0xfc9b78){if(_0x39055b)return _0xef4a04(_0x39055b);return _0x36a7f1(_0xfc9b78);});})['then'](function(){return new BPromise(function(_0x4086b3,_0xb7763d){rimraf(_0x5c4f4d,function(_0x47a1b0){if(_0x47a1b0)_0xb7763d(_0x47a1b0);return _0x4086b3();});});})[_0x28fb('0x2a')](function(){return _0x392c59[_0x28fb('0xd0')](_0xe1bcd0,_0x1a3085,function(_0x1c6411){if(_0x1c6411){console[_0x28fb('0xf1')](_0x28fb('0xf2'),_0x1c6411);}else{fs['unlinkSync'](_0xe1bcd0);}});});});}else{return _0x392c59[_0x28fb('0x1d')](0xc8);}})[_0x28fb('0xb3')](handleError(_0x392c59,null));}; \ No newline at end of file +var _0x53af=['.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','update','destroy','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','then','catch','map','fieldName','key','model','query','attributes','fields','nolimit','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','user_has_openchannel_interactions','left_join','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','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?','find','ContactId','text','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?','UserId','type','start','body','buildExpression','keys','some','isEmpty','concat','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','length','merge','OpenchannelInteraction','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','contactName','i.*','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','all','show','params','rawAttributes','intersection','includeAll','include','options','create','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','OpenchannelInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','transcript-%d-%s.zip','CmContact','Contact','lastName','Attachment','Messages','Account','Owner','mkdirSync','Openchannel','N.A.','closed','closedAt','disposition','threadId','Public','Private','existsSync','createReadStream','pipe','createWriteStream','basename','direction','out','System','secret','renderFile','views','transcript-'];(function(_0x21b86e,_0x47c9a8){var _0x4b7723=function(_0x328f03){while(--_0x328f03){_0x21b86e['push'](_0x21b86e['shift']());}};_0x4b7723(++_0x47c9a8);}(_0x53af,0xf4));var _0xf53a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x53af[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xf53a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf53a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf53a('0x2'));var moment=require(_0xf53a('0x3'));var BPromise=require(_0xf53a('0x4'));var Mustache=require(_0xf53a('0x5'));var util=require(_0xf53a('0x6'));var path=require(_0xf53a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf53a('0x8'));var _=require(_0xf53a('0x9'));var squel=require(_0xf53a('0xa'));var crypto=require(_0xf53a('0xb'));var jsforce=require(_0xf53a('0xc'));var deskjs=require(_0xf53a('0xd'));var toCsv=require(_0xf53a('0xe'));var querystring=require(_0xf53a('0xf'));var Papa=require(_0xf53a('0x10'));var Redis=require(_0xf53a('0x11'));var authService=require(_0xf53a('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xf53a('0x13'));var hardwareService=require(_0xf53a('0x14'));var logger=require(_0xf53a('0x15'))('api');var utils=require(_0xf53a('0x16'));var config=require(_0xf53a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf53a('0x18'))['db'];config[_0xf53a('0x19')]=_[_0xf53a('0x1a')](config[_0xf53a('0x19')],{'host':_0xf53a('0x1b'),'port':0x18eb});var socket=require(_0xf53a('0x1c'))(new Redis(config[_0xf53a('0x19')]));require(_0xf53a('0x1d'))[_0xf53a('0x1e')](socket);function respondWithStatusCode(_0x273e03,_0x4db412){_0x4db412=_0x4db412||0xcc;return function(_0x40891c){if(_0x40891c){return _0x273e03[_0xf53a('0x1f')](_0x4db412);}return _0x273e03[_0xf53a('0x20')](_0x4db412)[_0xf53a('0x21')]();};}function respondWithResult(_0x4bc764,_0x2fbb75){_0x2fbb75=_0x2fbb75||0xc8;return function(_0xaf7988){if(_0xaf7988){return _0x4bc764['status'](_0x2fbb75)['json'](_0xaf7988);}};}function respondWithFilteredResult(_0x279259,_0x205716){return function(_0x5bc8c7){if(_0x5bc8c7){var _0xe7acec=typeof _0x205716['offset']===_0xf53a('0x22')&&typeof _0x205716[_0xf53a('0x23')]===_0xf53a('0x22');var _0xd822cc=_0x5bc8c7[_0xf53a('0x24')];var _0x3ed0d4=_0xe7acec?0x0:_0x205716['offset'];var _0x36566a=_0xe7acec?_0x5bc8c7['count']:_0x205716[_0xf53a('0x25')]+_0x205716['limit'];var _0x571098;if(_0x36566a>=_0xd822cc){_0x36566a=_0xd822cc;_0x571098=0xc8;}else{_0x571098=0xce;}_0x279259['status'](_0x571098);return _0x279259[_0xf53a('0x26')](_0xf53a('0x27'),_0x3ed0d4+'-'+_0x36566a+'/'+_0xd822cc)[_0xf53a('0x28')](_0x5bc8c7);}return null;};}function patchUpdates(_0x1d6f29){return function(_0x2f9962){try{jsonpatch['apply'](_0x2f9962,_0x1d6f29,!![]);}catch(_0x50aebf){return BPromise[_0xf53a('0x29')](_0x50aebf);}return _0x2f9962['save']();};}function saveUpdates(_0x42842b,_0x4bccd6){return function(_0x2f57b8){if(_0x2f57b8){return _0x2f57b8[_0xf53a('0x2a')](_0x42842b)['then'](function(_0x284e2e){return _0x284e2e;});}return null;};}function removeEntity(_0x49f6ae,_0x20f1f0){return function(_0x341d28){if(_0x341d28){return _0x341d28[_0xf53a('0x2b')]()['then'](function(){_0x49f6ae['status'](0xcc)[_0xf53a('0x21')]();});}};}function handleEntityNotFound(_0x4fc1e6,_0x456136){return function(_0x417373){if(!_0x417373){_0x4fc1e6[_0xf53a('0x1f')](0x194);}return _0x417373;};}function handleError(_0x5621a7,_0x1c7268){_0x1c7268=_0x1c7268||0x1f4;return function(_0x5f5160){logger[_0xf53a('0x2c')](_0x5f5160[_0xf53a('0x2d')]);if(_0x5f5160[_0xf53a('0x2e')]){delete _0x5f5160[_0xf53a('0x2e')];}_0x5621a7[_0xf53a('0x20')](_0x1c7268)[_0xf53a('0x2f')](_0x5f5160);};}function getInteractionUsers(_0xdb1e42,_0x61209a){return new BPromise(function(_0x2ab658,_0x4ce673){try{if(_0x61209a[_0xdb1e42['id']]){_0xdb1e42['Users']=_['map'](_0x61209a[_0xdb1e42['id']],function(_0x29efb3){return{'id':_0x29efb3['id'],'fullname':_0x29efb3[_0xf53a('0x30')]};});}}catch(_0x536526){_0x4ce673(_0x536526);}_0x2ab658(_0xdb1e42);});}function getInteractionTags(_0x18e088,_0x531c15){return new BPromise(function(_0x540db9,_0x269727){try{if(_0x18e088[_0xf53a('0x31')]){_0x18e088[_0xf53a('0x32')]=[];_0x18e088['TagIds'][_0xf53a('0x33')](',')[_0xf53a('0x34')](function(_0x559341){_0x18e088['Tags'][_0xf53a('0x35')](_0x531c15[_0x559341]);});}delete _0x18e088[_0xf53a('0x31')];}catch(_0x36f4d7){_0x269727(_0x36f4d7);}_0x540db9(_0x18e088);});}function updateOpenchannelInteraction(_0xc3220e,_0x153b8b,_0x527c47){return new BPromise(function(_0x2dd88c,_0x24e791){return getInteractionUsers(_0xc3220e,_0x527c47)['then'](function(_0x407f5b){return getInteractionTags(_0x407f5b,_0x153b8b);})[_0xf53a('0x36')](function(_0x6cd906){_0x2dd88c(_0x6cd906);})[_0xf53a('0x37')](function(_0xd2255f){_0x24e791(_0xd2255f);});});}exports['index']=function(_0x2b6432,_0x4159db){var _0x1ac4ec={},_0x16cafe={},_0x153ec3={'count':0x0,'rows':[]};var _0x3dd714=_[_0xf53a('0x38')](db['OpenchannelInteraction']['rawAttributes'],function(_0x191d70){return{'name':_0x191d70[_0xf53a('0x39')],'type':_0x191d70['type'][_0xf53a('0x3a')]};});_0x16cafe[_0xf53a('0x3b')]=_[_0xf53a('0x38')](_0x3dd714,_0xf53a('0x2e'));_0x16cafe[_0xf53a('0x3c')]=_['keys'](_0x2b6432['query']);_0x16cafe['filters']=_['intersection'](_0x16cafe[_0xf53a('0x3b')],_0x16cafe[_0xf53a('0x3c')]);_0x1ac4ec[_0xf53a('0x3d')]=_['intersection'](_0x16cafe[_0xf53a('0x3b')],qs[_0xf53a('0x3e')](_0x2b6432[_0xf53a('0x3c')][_0xf53a('0x3e')]));_0x1ac4ec[_0xf53a('0x3d')]=_0x1ac4ec[_0xf53a('0x3d')]['length']?_0x1ac4ec['attributes']:_0x16cafe[_0xf53a('0x3b')];if(!_0x2b6432[_0xf53a('0x3c')]['hasOwnProperty'](_0xf53a('0x3f'))){_0x1ac4ec[_0xf53a('0x23')]=qs[_0xf53a('0x23')](_0x2b6432[_0xf53a('0x3c')]['limit']);_0x1ac4ec['offset']=qs['offset'](_0x2b6432[_0xf53a('0x3c')][_0xf53a('0x25')]);}_0x1ac4ec['order']=qs['sort'](_0x2b6432['query'][_0xf53a('0x40')]);_0x1ac4ec[_0xf53a('0x41')]=qs[_0xf53a('0x42')](_[_0xf53a('0x43')](_0x2b6432[_0xf53a('0x3c')],_0x16cafe[_0xf53a('0x42')]),_0x3dd714);var _0x1f0869=[];var _0xafca29=squel[_0xf53a('0x44')]()[_0xf53a('0x45')]('id')[_0xf53a('0x45')]('name')[_0xf53a('0x45')](_0xf53a('0x46'))[_0xf53a('0x47')](_0xf53a('0x48'));var _0x5f49d9=squel['select']()[_0xf53a('0x45')](_0xf53a('0x49'))[_0xf53a('0x45')]('u.fullname')['field']('ui.OpenchannelInteractionId')[_0xf53a('0x47')](_0xf53a('0x4a'),'ui')[_0xf53a('0x4b')]('users','u',_0xf53a('0x4c'));var _0x3de387=squel['select']()[_0xf53a('0x47')](_0xf53a('0x4d'),'i')['left_join'](_0xf53a('0x4e'),'c',_0xf53a('0x4f'))['left_join'](_0xf53a('0x50'),'o',_0xf53a('0x51'))[_0xf53a('0x4b')](_0xf53a('0x52'),'a',_0xf53a('0x53'))[_0xf53a('0x4b')]('openchannel_messages','me',_0xf53a('0x54'))[_0xf53a('0x4b')](_0xf53a('0x55'),'it','it.OpenchannelInteractionId\x20=\x20i.id')[_0xf53a('0x4b')](_0xf53a('0x48'),'t',_0xf53a('0x56'));var _0x16fc57=squel[_0xf53a('0x57')]();var _0x7cbebf=[];var _0x2be715=squel[_0xf53a('0x57')]();var _0x1dfea1;if(_0x2b6432[_0xf53a('0x3c')]['search']){_0x1dfea1=as[_0xf53a('0x58')](_0x2b6432[_0xf53a('0x3c')]['search']);var _0x2d0305=_0x1dfea1[_0xf53a('0x59')];for(var _0x161b29=0x0;_0x161b29<_0x1dfea1[_0xf53a('0x5a')]['length'];_0x161b29++){var _0x236ec2=_0x1dfea1['conditions'][_0x161b29];var _0x3a55b2='i';var _0xf614dd=_['find'](_0x3dd714,[_0xf53a('0x2e'),_0x236ec2[_0xf53a('0x45')]]);if(!_0xf614dd){switch(_0x236ec2[_0xf53a('0x45')]){case _0xf53a('0x5b'):if(_0x236ec2[_0xf53a('0x5c')]==0x1){_0x3de387[_0xf53a('0x5d')]('`'+_0x236ec2['field']+_0xf53a('0x5e'));}else{_0x3de387[_0xf53a('0x5d')]('`'+_0x236ec2[_0xf53a('0x45')]+_0xf53a('0x5f'));}break;case'Contact':if(_0x236ec2[_0xf53a('0x60')]==='$substring'){if(_0x236ec2[_0xf53a('0x5c')][_0xf53a('0x33')]('\x20')['length']>0x1){_0x16fc57[_0x2d0305](_0xf53a('0x61'),qs['getFullTextValue'](_0x236ec2[_0xf53a('0x5c')]),null);}else{var _0x13e884='%'+_0x236ec2[_0xf53a('0x5c')]+'%';_0x16fc57[_0x2d0305](_0xf53a('0x62'),_0x13e884,_0x13e884,_0x13e884);}}else{_0xf614dd=_[_0xf53a('0x63')](_0x3dd714,[_0xf53a('0x2e'),_0xf53a('0x64')]);_0x236ec2['field']=_0xf53a('0x64');_0x1d22a4=as['buildExpression'](_0x3a55b2,_0xf614dd['type'],_0x236ec2);_0x16fc57[_0x2d0305](_0x1d22a4[_0xf53a('0x65')],_0x1d22a4[_0xf53a('0x5c')]['start'],_0x1d22a4[_0xf53a('0x5c')][_0xf53a('0x21')]);}break;case _0xf53a('0x66'):var _0x2fc534=_0x236ec2['value'][_0xf53a('0x33')](',')[_0xf53a('0x38')](function(_0x545ba8){return Number(_0x545ba8);});_0x2fc534[_0xf53a('0x34')](function(_0xce6798){_0x2be715['or'](_0xf53a('0x67'),'%,'+_0xce6798+',%');});_0x7cbebf=_[_0xf53a('0x68')](_0x7cbebf,_0x2fc534);break;case _0xf53a('0x69'):if(_0x236ec2[_0xf53a('0x60')]===_0xf53a('0x6a')){_0x16fc57[_0x2d0305](_0xf53a('0x6b'),'%'+_0x236ec2['value']+'%',null);}else{_0xf614dd=_['find'](_0x3dd714,[_0xf53a('0x2e'),_0xf53a('0x6c')]);_0x236ec2[_0xf53a('0x45')]=_0xf53a('0x6c');_0x1d22a4=as['buildExpression'](_0x3a55b2,_0xf614dd[_0xf53a('0x6d')],_0x236ec2);_0x16fc57[_0x2d0305](_0x1d22a4[_0xf53a('0x65')],_0x1d22a4[_0xf53a('0x5c')][_0xf53a('0x6e')],_0x1d22a4[_0xf53a('0x5c')][_0xf53a('0x21')]);}break;case _0xf53a('0x6f'):_0x1d22a4=as[_0xf53a('0x70')]('me',null,_0x236ec2);_0x16fc57[_0x2d0305](_0x1d22a4[_0xf53a('0x65')],_0x1d22a4[_0xf53a('0x5c')]['start'],_0x1d22a4[_0xf53a('0x5c')][_0xf53a('0x21')]);break;}}else{var _0x1d22a4=as[_0xf53a('0x70')](_0x3a55b2,_0xf614dd[_0xf53a('0x6d')],_0x236ec2);_0x16fc57[_0x2d0305](_0x1d22a4[_0xf53a('0x65')],_0x1d22a4['value'][_0xf53a('0x6e')],_0x1d22a4['value'][_0xf53a('0x21')]);}}}else{var _0x149778=_(_0x2b6432['query'])[_0xf53a('0x71')]()[_0xf53a('0x38')](function(_0x3d135e){return _[_0xf53a('0x72')](_0x3dd714,[_0xf53a('0x2e'),_0x3d135e])?_0x3d135e:undefined;})['compact']()[_0xf53a('0x5c')]();if(!_[_0xf53a('0x73')](_0x149778)){_0x149778[_0xf53a('0x34')](function(_0x2f037d){if(_0x2f037d==='OpenchannelAccountId'){_0x3de387[_0xf53a('0x41')]('i.OpenchannelAccountId\x20IN\x20?',[][_0xf53a('0x74')](_0x2b6432[_0xf53a('0x3c')][_0x2f037d]));}else if(_0x2f037d===_0xf53a('0x75')){var _0x5d7cf7=JSON['parse'](_0x2b6432[_0xf53a('0x3c')][_0x2f037d])[_0xf53a('0x76')];var _0x59f645=JSON[_0xf53a('0x77')](_0x2b6432['query'][_0x2f037d])['$lte'];_0x3de387['where'](_0xf53a('0x78'),_0x5d7cf7,_0x59f645);}else{if(_0x2b6432['query'][_0x2f037d]==='null'){_0x3de387[_0xf53a('0x41')]('i.'+_0x2f037d+'\x20IS\x20NULL');}else{_0x3de387[_0xf53a('0x41')]('i.'+_0x2f037d+_0xf53a('0x79'),_0x2b6432[_0xf53a('0x3c')][_0x2f037d]);}}});}if(_0x2b6432[_0xf53a('0x3c')][_0xf53a('0x7a')]){if(_0x2b6432[_0xf53a('0x3c')][_0xf53a('0x7a')]==0x1){_0x3de387[_0xf53a('0x5d')]('`unreadMessages`\x20=\x200');}else{_0x3de387[_0xf53a('0x5d')](_0xf53a('0x7b'));}}if(_0x2b6432['query'][_0xf53a('0x7c')]){_0x7cbebf=_['isArray'](_0x2b6432[_0xf53a('0x3c')]['tag'])?_0x2b6432['query'][_0xf53a('0x7c')]:new Array(_0x2b6432[_0xf53a('0x3c')][_0xf53a('0x7c')]);_0x7cbebf[_0xf53a('0x34')](function(_0x25a009){_0x2be715['or'](_0xf53a('0x67'),'%,'+_0x25a009+',%');});}if(_0x2b6432[_0xf53a('0x3c')][_0xf53a('0x7d')]){var _0xff709=_0x2b6432[_0xf53a('0x3c')][_0xf53a('0x7d')][_0xf53a('0x7e')]('\x5c','\x5c\x5c')[_0xf53a('0x7e')](/'/g,'\x27\x27');if(qs['isNumeric'](_0xff709)){_0x16fc57['or'](_0xf53a('0x7f'),_0xff709+'%');}else{_0x16fc57['or'](_0xf53a('0x80'),qs[_0xf53a('0x81')](_0xff709))['or'](_0xf53a('0x82'),_0xff709+'%')['or'](_0xf53a('0x83'),_0xff709+'%');}}}_0x3de387['where'](_0x16fc57);_0x3de387[_0xf53a('0x84')]('i.id');var _0xa93c97={'type':db[_0xf53a('0x85')][_0xf53a('0x86')][_0xf53a('0x87')],'raw':!![]};var _0x464020=_0x3de387[_0xf53a('0x88')]();_0x464020[_0xf53a('0x45')](_0xf53a('0x89'));_0x464020[_0xf53a('0x45')](_0xf53a('0x8a'),_0xf53a('0x5b'));if(_0x1ac4ec[_0xf53a('0x8b')]){_0x1ac4ec['order']['forEach'](function(_0x440fc7){var _0x3a515e=_0x440fc7[0x0]==='contactName'?_0x440fc7[0x0]:'i.'+_0x440fc7[0x0];_0x3de387['order'](_0x3a515e,_0x440fc7[0x1]===_0xf53a('0x8c')?![]:!![]);});}if(!_[_0xf53a('0x73')](_0x7cbebf)){_0x3de387[_0xf53a('0x5d')](_0x2be715);_0x464020[_0xf53a('0x41')](_0xf53a('0x8d'),_0x7cbebf);}BPromise['resolve']()[_0xf53a('0x36')](function(){if(!_0x1dfea1){if(_0x2b6432['query'][_0xf53a('0x8e')])return;_0x464020[_0xf53a('0x41')](_0xf53a('0x8f'));_0x3de387[_0xf53a('0x41')](_0xf53a('0x8f'));return;}if(_0x2b6432[_0xf53a('0x90')][_0xf53a('0x91')]!==_0xf53a('0x92'))return;return _0x2b6432['user']['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0xf53a('0x36')](function(_0x24f239){if(_[_0xf53a('0x73')](_0x24f239)){_0x464020[_0xf53a('0x41')](_0xf53a('0x93'));_0x3de387[_0xf53a('0x41')](_0xf53a('0x93'));}else{_0x464020[_0xf53a('0x41')](_0xf53a('0x94'),_[_0xf53a('0x38')](_0x24f239,'id'));_0x3de387[_0xf53a('0x41')]('i.OpenchannelAccountId\x20IN\x20?',_[_0xf53a('0x38')](_0x24f239,'id'));}});})['then'](function(){if(_0x2b6432['user'][_0xf53a('0x91')]===_0xf53a('0x92')&&!_0x1dfea1&&!_0x2b6432['query']['OpenchannelAccountId'])return[];return db[_0xf53a('0x95')][_0xf53a('0x3c')](_0x464020[_0xf53a('0x96')](),_0xa93c97);})[_0xf53a('0x36')](function(_0xc5788b){_0x153ec3[_0xf53a('0x24')]=_0xc5788b[_0xf53a('0x97')];if(_0x153ec3[_0xf53a('0x24')]===0x0)return[];return db[_0xf53a('0x95')]['query'](_0xafca29['toString'](),_0xa93c97)[_0xf53a('0x36')](function(_0x5c3e41){_0x1f0869=_['keyBy'](_0x5c3e41,'id');_0xa93c97=_[_0xf53a('0x98')](_0xa93c97,{'model':db[_0xf53a('0x99')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2b6432[_0xf53a('0x3c')][_0xf53a('0x3e')]){_0x1ac4ec[_0xf53a('0x3d')]['forEach'](function(_0x2d0ab8){_0x3de387[_0xf53a('0x45')]('i.'+_0x2d0ab8);});}else{_0x3de387[_0xf53a('0x45')](_0xf53a('0x8a'),_0xf53a('0x5b'));_0x3de387['field'](_0xf53a('0x9a'),_0xf53a('0x9b'));_0x3de387['field'](_0xf53a('0x9c'),_0xf53a('0x9d'));_0x3de387[_0xf53a('0x45')](_0xf53a('0x9e'),_0xf53a('0x9f'));_0x3de387[_0xf53a('0x45')](_0xf53a('0xa0'));_0x3de387['field']('c.firstName','Contact.firstName');_0x3de387[_0xf53a('0x45')](_0xf53a('0xa1'),_0xf53a('0xa2'));_0x3de387['field'](_0xf53a('0xa3'),_0xf53a('0xa4'));_0x3de387['field'](_0xf53a('0xa5'),'Contact.phone');_0x3de387[_0xf53a('0x45')](_0xf53a('0xa6'),_0xf53a('0xa7'));_0x3de387[_0xf53a('0x45')](_0xf53a('0xa8'),_0xf53a('0xa9'));_0x3de387[_0xf53a('0x45')](_0xf53a('0xaa'),_0xf53a('0xab'));_0x3de387[_0xf53a('0x45')]('o.internal','Owner.internal');_0x3de387[_0xf53a('0x45')](_0xf53a('0xac'),_0xf53a('0x31'));}if(_0x1ac4ec[_0xf53a('0x23')])_0x3de387['limit'](_0x1ac4ec['limit']);if(_0x1ac4ec['offset'])_0x3de387[_0xf53a('0x25')](_0x1ac4ec['offset']);return db[_0xf53a('0x95')][_0xf53a('0x3c')](_0x3de387[_0xf53a('0x96')](),_0xa93c97);})['then'](function(_0x16704f){if(_0x16704f['length']>0x0)_0x5f49d9[_0xf53a('0x41')]('ui.OpenchannelInteractionId\x20IN\x20?',_['map'](_0x16704f,'id'));return db['sequelize'][_0xf53a('0x3c')](_0x5f49d9[_0xf53a('0x96')](),_0xa93c97)[_0xf53a('0x36')](function(_0x998cfd){var _0x25af82=_[_0xf53a('0xad')](_0x998cfd,'OpenchannelInteractionId');var _0x239515=[];_0x16704f[_0xf53a('0x34')](function(_0x31b623){_0x239515[_0xf53a('0x35')](updateOpenchannelInteraction(_0x31b623,_0x1f0869,_0x25af82));});return BPromise[_0xf53a('0xae')](_0x239515);});});})[_0xf53a('0x36')](function(_0x4aeedb){_0x153ec3['rows']=_0x4aeedb;return _0x153ec3;})[_0xf53a('0x36')](respondWithFilteredResult(_0x4159db,_0x1ac4ec))[_0xf53a('0x37')](handleError(_0x4159db,null));};exports[_0xf53a('0xaf')]=function(_0x49d4d7,_0x419000){var _0x5bf720={};if(_0x49d4d7[_0xf53a('0x3c')][_0xf53a('0x6d')]&&_0x49d4d7['query'][_0xf53a('0x6d')]===_0xf53a('0x47')){_0x5bf720[_0xf53a('0x47')]=_0x49d4d7[_0xf53a('0xb0')]['id'];}else{_0x5bf720['id']=_0x49d4d7[_0xf53a('0xb0')]['id'];}var _0x255377={'raw':![],'where':_0x5bf720},_0x35cd53={};_0x35cd53['model']=_[_0xf53a('0x71')](db[_0xf53a('0x99')][_0xf53a('0xb1')]);_0x35cd53['query']=_[_0xf53a('0x71')](_0x49d4d7[_0xf53a('0x3c')]);_0x35cd53[_0xf53a('0x42')]=_[_0xf53a('0xb2')](_0x35cd53[_0xf53a('0x3b')],_0x35cd53['query']);_0x255377['attributes']=_[_0xf53a('0xb2')](_0x35cd53[_0xf53a('0x3b')],qs[_0xf53a('0x3e')](_0x49d4d7[_0xf53a('0x3c')][_0xf53a('0x3e')]));_0x255377[_0xf53a('0x3d')]=_0x255377['attributes'][_0xf53a('0x97')]?_0x255377['attributes']:_0x35cd53[_0xf53a('0x3b')];if(_0x49d4d7['query'][_0xf53a('0xb3')]){_0x255377[_0xf53a('0xb4')]=[{'all':!![]}];}_0x255377=_[_0xf53a('0x98')]({},_0x255377,_0x49d4d7[_0xf53a('0xb5')]);return db[_0xf53a('0x99')]['find'](_0x255377)['then'](handleEntityNotFound(_0x419000,null))['then'](respondWithResult(_0x419000,null))['catch'](handleError(_0x419000,null));};exports[_0xf53a('0xb6')]=function(_0x29c95d,_0x2eb816){return db[_0xf53a('0x99')][_0xf53a('0xb6')](_0x29c95d[_0xf53a('0x6f')],{})[_0xf53a('0x36')](respondWithResult(_0x2eb816,0xc9))['catch'](handleError(_0x2eb816,null));};exports['update']=function(_0x528b5e,_0xa553ea){if(_0x528b5e['body']['id']){delete _0x528b5e[_0xf53a('0x6f')]['id'];}return db[_0xf53a('0x99')][_0xf53a('0x63')]({'where':{'id':_0x528b5e['params']['id']}})[_0xf53a('0x36')](handleEntityNotFound(_0xa553ea,null))[_0xf53a('0x36')](saveUpdates(_0x528b5e[_0xf53a('0x6f')],null))[_0xf53a('0x36')](respondWithResult(_0xa553ea,null))[_0xf53a('0x37')](handleError(_0xa553ea,null));};exports[_0xf53a('0x2b')]=function(_0x28b0da,_0x42f284){return db['OpenchannelInteraction']['find']({'where':{'id':_0x28b0da[_0xf53a('0xb0')]['id']}})[_0xf53a('0x36')](handleEntityNotFound(_0x42f284,null))[_0xf53a('0x36')](removeEntity(_0x42f284,null))[_0xf53a('0x37')](handleError(_0x42f284,null));};exports[_0xf53a('0xb7')]=function(_0x5220e2,_0x382afe){return db[_0xf53a('0x99')]['describe']()[_0xf53a('0x36')](respondWithResult(_0x382afe,null))[_0xf53a('0x37')](handleError(_0x382afe,null));};exports[_0xf53a('0xb8')]=function(_0x4bfcd8,_0x452a57,_0x5bb762){return db[_0xf53a('0xb9')][_0xf53a('0x63')]({'where':{'id':_0x4bfcd8[_0xf53a('0xb0')]['id']}})[_0xf53a('0x36')](handleEntityNotFound(_0x452a57,null))[_0xf53a('0x36')](function(_0x277037){if(_0x277037){return _0x277037[_0xf53a('0xb8')](_0x4bfcd8[_0xf53a('0x6f')][_0xf53a('0xba')],_[_0xf53a('0xbb')](_0x4bfcd8[_0xf53a('0x6f')],['ids','id'])||{});}})['then'](respondWithResult(_0x452a57,null))[_0xf53a('0x37')](handleError(_0x452a57,null));};exports[_0xf53a('0xbc')]=function(_0x32f471,_0x495c1,_0x10d26f){var _0xabedb2={'raw':![],'where':{}};var _0xff2357={};var _0x4c5d1a={'count':0x0,'rows':[]};return db[_0xf53a('0x99')][_0xf53a('0xbd')]({'where':{'id':_0x32f471[_0xf53a('0xb0')]['id']}})[_0xf53a('0x36')](handleEntityNotFound(_0x495c1,null))[_0xf53a('0x36')](function(_0x2c4bef){if(_0x2c4bef){_0xff2357[_0xf53a('0x3b')]=_[_0xf53a('0x71')](db[_0xf53a('0xb9')][_0xf53a('0xb1')]);_0xff2357[_0xf53a('0x3c')]=_[_0xf53a('0x71')](_0x32f471['query']);_0xff2357['filters']=_['intersection'](_0xff2357['model'],_0xff2357[_0xf53a('0x3c')]);_0xabedb2[_0xf53a('0x3d')]=_['intersection'](_0xff2357['model'],qs[_0xf53a('0x3e')](_0x32f471[_0xf53a('0x3c')]['fields']));_0xabedb2[_0xf53a('0x3d')]=_0xabedb2[_0xf53a('0x3d')][_0xf53a('0x97')]?_0xabedb2[_0xf53a('0x3d')]:_0xff2357[_0xf53a('0x3b')];if(!_0x32f471[_0xf53a('0x3c')]['hasOwnProperty']('nolimit')){_0xabedb2[_0xf53a('0x23')]=qs[_0xf53a('0x23')](_0x32f471[_0xf53a('0x3c')][_0xf53a('0x23')]);_0xabedb2[_0xf53a('0x25')]=qs['offset'](_0x32f471['query'][_0xf53a('0x25')]);}_0xabedb2[_0xf53a('0x8b')]=qs['sort'](_0x32f471['query'][_0xf53a('0x40')]);_0xabedb2[_0xf53a('0x41')]=qs[_0xf53a('0x42')](_[_0xf53a('0x43')](_0x32f471[_0xf53a('0x3c')],_0xff2357[_0xf53a('0x42')]));_0xabedb2['where'][_0xf53a('0xbe')]=_0x2c4bef['id'];if(_0x32f471['query'][_0xf53a('0x7d')]){_0xabedb2[_0xf53a('0x41')]=_[_0xf53a('0x98')](_0xabedb2[_0xf53a('0x41')],{'$or':_[_0xf53a('0x38')](_0xabedb2['attributes'],function(_0x4fac59){var _0x5cb43b={};_0x5cb43b[_0x4fac59]={'$like':'%'+_0x32f471[_0xf53a('0x3c')]['filter']+'%'};return _0x5cb43b;})});}if(_0x32f471[_0xf53a('0x3c')][_0xf53a('0x76')]){var _0x42d757=_0x32f471[_0xf53a('0x3c')][_0xf53a('0x76')][_0xf53a('0x33')](',');var _0x3afc3c={};_0x3afc3c[_0x42d757[0x0]]={'$gte':moment(_0x42d757[0x1])[_0xf53a('0xbf')](_0xf53a('0xc0'))};_0xabedb2['where']=_[_0xf53a('0x98')](_0xabedb2[_0xf53a('0x41')],_0x3afc3c);}_0xabedb2=_[_0xf53a('0x98')]({},_0xabedb2,_0x32f471['options']);return db['OpenchannelMessage'][_0xf53a('0x24')]({'where':_0xabedb2[_0xf53a('0x41')]})['then'](function(_0x1b03a6){_0x4c5d1a[_0xf53a('0x24')]=_0x1b03a6;if(_0x32f471[_0xf53a('0x3c')][_0xf53a('0xb3')]){_0xabedb2[_0xf53a('0xb4')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0xabedb2);})[_0xf53a('0x36')](function(_0x5b2779){_0x4c5d1a['rows']=_0x5b2779;return _0x4c5d1a;});}})[_0xf53a('0x36')](respondWithFilteredResult(_0x495c1,_0xabedb2))[_0xf53a('0x37')](handleError(_0x495c1,null));};exports[_0xf53a('0xc1')]=function(_0x2edc5e,_0xe0665b,_0x342062){return db[_0xf53a('0x99')][_0xf53a('0x63')]({'where':{'id':_0x2edc5e[_0xf53a('0xb0')]['id']}})[_0xf53a('0x36')](handleEntityNotFound(_0xe0665b,null))[_0xf53a('0x36')](function(_0x189688){if(_0x189688){return _0x189688[_0xf53a('0xc2')](_0x2edc5e[_0xf53a('0x6f')]['ids'],_['omit'](_0x2edc5e[_0xf53a('0x6f')],['ids','id'])||{})[_0xf53a('0xc3')](function(){return db[_0xf53a('0x66')]['findAll']({'attributes':['id',_0xf53a('0x2e'),_0xf53a('0x46')],'where':{'id':_0x2edc5e[_0xf53a('0x6f')][_0xf53a('0xba')]}});})[_0xf53a('0x36')](function(_0x4096e4){socket['emit'](_0xf53a('0xc4'),{'id':Number(_0x2edc5e[_0xf53a('0xb0')]['id']),'tags':_0x4096e4||[]});return{'id':Number(_0x2edc5e[_0xf53a('0xb0')]['id']),'tags':_0x4096e4||[]};});}})[_0xf53a('0x36')](respondWithResult(_0xe0665b,null))[_0xf53a('0x37')](handleError(_0xe0665b,null));};exports[_0xf53a('0xc5')]=function(_0x375203,_0x147db8,_0x6b5837){return db[_0xf53a('0x99')]['find']({'where':{'id':_0x375203[_0xf53a('0xb0')]['id']}})['then'](handleEntityNotFound(_0x147db8,null))['then'](function(_0x2292bb){if(_0x2292bb){return _0x2292bb[_0xf53a('0xc5')](_0x375203[_0xf53a('0x3c')][_0xf53a('0xba')]);}})[_0xf53a('0x36')](respondWithStatusCode(_0x147db8,null))['catch'](handleError(_0x147db8,null));};exports[_0xf53a('0xc6')]=function(_0x1bb371,_0x5efc21){var _0x12e897=moment()[_0xf53a('0xc7')]()[_0xf53a('0x96')]();var _0x1642a7=path[_0xf53a('0xc8')](config[_0xf53a('0xc9')],_0xf53a('0xca'),'files','tmp');var _0x54dc90=path[_0xf53a('0xc8')](config[_0xf53a('0xc9')],_0xf53a('0xca'),_0xf53a('0xcb'),_0xf53a('0xcc'));var _0x24ee42=path[_0xf53a('0xc8')](_0x1642a7,_0x12e897);var _0x54677d=util[_0xf53a('0xbf')](_0xf53a('0xcd'),_0x1bb371[_0xf53a('0xb0')]['id'],_0x12e897);var _0x1e32f4=path[_0xf53a('0xc8')](_0x1642a7,_0x54677d);var _0x3dd9b1=[];_0x3dd9b1[_0xf53a('0x35')]({'model':db[_0xf53a('0x69')],'as':_0xf53a('0x69'),'attributes':['id',_0xf53a('0x30')],'raw':!![]});_0x3dd9b1[_0xf53a('0x35')]({'model':db[_0xf53a('0xce')],'as':_0xf53a('0xcf'),'attributes':['id','firstName',_0xf53a('0xd0')],'raw':!![]});if(_0x1bb371[_0xf53a('0x3c')][_0xf53a('0xcc')]){_0x3dd9b1[_0xf53a('0x35')]({'model':db[_0xf53a('0xd1')],'as':_0xf53a('0xd1'),'raw':!![]});}var _0x3abb55=[{'model':db['OpenchannelMessage'],'as':_0xf53a('0xd2'),'attributes':['id',_0xf53a('0x6f'),_0xf53a('0x75'),'direction','secret',_0xf53a('0x7a')],'include':_0x3dd9b1}];_0x3abb55[_0xf53a('0x35')]({'model':db['OpenchannelAccount'],'as':_0xf53a('0xd3'),'attributes':['id',_0xf53a('0x2e')]});_0x3abb55[_0xf53a('0x35')]({'model':db[_0xf53a('0x69')],'as':_0xf53a('0xd4'),'attributes':['id','fullname']});return db[_0xf53a('0x99')][_0xf53a('0x63')]({'where':{'id':_0x1bb371[_0xf53a('0xb0')]['id']},'include':_0x3abb55})[_0xf53a('0x36')](handleEntityNotFound(_0x5efc21,null))[_0xf53a('0x36')](function(_0x21a5fb){if(_0x21a5fb){var _0x171c82=_0x21a5fb['get']({'plain':!![]});fs[_0xf53a('0xd5')](_0x24ee42);var _0x45479a={'channel':_0xf53a('0xd6'),'account':_0x171c82[_0xf53a('0xd3')]['name'],'agent':_0x171c82[_0xf53a('0xd4')]?_0x171c82[_0xf53a('0xd4')][_0xf53a('0x30')]:_0xf53a('0xd7'),'createdAt':moment(_0x171c82[_0xf53a('0x75')])[_0xf53a('0xbf')](_0xf53a('0xc0'))[_0xf53a('0x96')](),'closedAt':_0x171c82[_0xf53a('0xd8')]?moment(_0x171c82[_0xf53a('0xd9')])[_0xf53a('0xbf')](_0xf53a('0xc0'))[_0xf53a('0x96')]():'','disposition':_0x171c82[_0xf53a('0xda')],'visibility':_0x171c82[_0xf53a('0xdb')]?_0xf53a('0xdc'):_0xf53a('0xdd'),'messages':_(_0x171c82[_0xf53a('0xd2')])[_0xf53a('0x7d')]({'secret':![]})[_0xf53a('0x38')](function(_0x2fe2ec){if(_0x2fe2ec['Attachment']){var _0x25786f=path['join'](_0x54dc90,_0x2fe2ec[_0xf53a('0xd1')]['basename']);if(fs[_0xf53a('0xde')](_0x25786f)){fs[_0xf53a('0xdf')](_0x25786f)[_0xf53a('0xe0')](fs[_0xf53a('0xe1')](path[_0xf53a('0xc8')](_0x24ee42,_0x2fe2ec[_0xf53a('0xd1')][_0xf53a('0xe2')])));}}return{'date':moment(_0x2fe2ec[_0xf53a('0x75')])['format'](_0xf53a('0xc0'))[_0xf53a('0x96')](),'sender':_0x2fe2ec[_0xf53a('0xe3')]===_0xf53a('0xe4')?_0x2fe2ec[_0xf53a('0x69')]?_0x2fe2ec[_0xf53a('0x69')][_0xf53a('0x30')]:_0xf53a('0xe5'):_0x2fe2ec[_0xf53a('0xcf')]['firstName']+(_0x2fe2ec[_0xf53a('0xcf')]['lastName']?'\x20'+_0x2fe2ec['Contact'][_0xf53a('0xd0')]:''),'body':_0x2fe2ec[_0xf53a('0xd1')]?_0x2fe2ec[_0xf53a('0xd1')][_0xf53a('0xe2')]:_0x2fe2ec['body'],'direction':_0x2fe2ec[_0xf53a('0xe3')]===_0xf53a('0xe4')?'A':'C','secret':_0x2fe2ec[_0xf53a('0xe6')],'read':_0x2fe2ec[_0xf53a('0x7a')],'attachment':_0x2fe2ec[_0xf53a('0xd1')]};})[_0xf53a('0x5c')]()};return ejs[_0xf53a('0xe7')](path[_0xf53a('0xc8')](config[_0xf53a('0xc9')],_0xf53a('0xca'),_0xf53a('0xe8'),'downloadInteraction.ejs'),{'interaction':_0x45479a})[_0xf53a('0x36')](function(_0x5d1129){var _0x4d34c6=path[_0xf53a('0xc8')](_0x24ee42,_0xf53a('0xe9')+_0x171c82['id']+'-'+_0x12e897+_0xf53a('0xea'));var _0x12dda4={'path':_0x4d34c6,'channel':_0xf53a('0xd6'),'interactionId':_0x171c82['id']};return pdf[_0xf53a('0xeb')](_0x5d1129,_0x12dda4);})[_0xf53a('0x36')](function(){return new BPromise(function(_0x3c1104,_0x46a0a8){zipdir(_0x24ee42,{'saveTo':_0x1e32f4},function(_0x30f89a,_0x3eb2dd){if(_0x30f89a)return _0x46a0a8(_0x30f89a);return _0x3c1104(_0x3eb2dd);});})['then'](function(){return new BPromise(function(_0x1b143f,_0x3c553a){rimraf(_0x24ee42,function(_0x4d8704){if(_0x4d8704)_0x3c553a(_0x4d8704);return _0x1b143f();});});})[_0xf53a('0x36')](function(){return _0x5efc21[_0xf53a('0xc6')](_0x1e32f4,_0x54677d,function(_0x19817c){if(_0x19817c){console[_0xf53a('0xec')](_0xf53a('0xed'),_0x19817c);}else{fs[_0xf53a('0xee')](_0x1e32f4);}});});});}else{return _0x5efc21['sendStatus'](0xc8);}})[_0xf53a('0x37')](handleError(_0x5efc21,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 654a1bd..e7daf7f 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 _0xc527=['OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4e28c6,_0x457ace){var _0x4fa6b3=function(_0x2e461e){while(--_0x2e461e){_0x4e28c6['push'](_0x4e28c6['shift']());}};_0x4fa6b3(++_0x457ace);}(_0xc527,0x12e));var _0x7c52=function(_0x1e3f01,_0x2e666e){_0x1e3f01=_0x1e3f01-0x0;var _0x32ac41=_0xc527[_0x1e3f01];return _0x32ac41;};'use strict';var EventEmitter=require(_0x7c52('0x0'));var OpenchannelInteraction=require(_0x7c52('0x1'))['db'][_0x7c52('0x2')];var OpenchannelMessage=require(_0x7c52('0x1'))['db'][_0x7c52('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x7c52('0x4')](0x0);var events={'afterCreate':_0x7c52('0x5'),'afterUpdate':'update','afterDestroy':_0x7c52('0x6')};function emitEvent(_0x338384){return function(_0x53a571,_0x14f672,_0x47f85e){_0x53a571[_0x7c52('0x7')]({'attributes':['id'],'raw':!![]})[_0x7c52('0x8')](function(_0x565aa2){_0x53a571[_0x7c52('0x9')]('Users',_0x565aa2[_0x7c52('0xa')](function(_0x31ce19){return{'id':_0x31ce19['id']};}));return OpenchannelMessage[_0x7c52('0xb')]({'where':{'OpenchannelInteractionId':_0x53a571['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7c52('0x8')](function(_0x3a4c4f){_0x53a571[_0x7c52('0x9')](_0x7c52('0xc'),_0x3a4c4f[_0x7c52('0xd')]);OpenchannelInteractionEvents[_0x7c52('0xe')](_0x338384+':'+_0x53a571['id'],_0x53a571);OpenchannelInteractionEvents[_0x7c52('0xe')](_0x338384,_0x53a571);_0x47f85e(null);})[_0x7c52('0xf')](_0x47f85e(null));};}for(var e in events){if(events[_0x7c52('0x10')](e)){var event=events[e];OpenchannelInteraction[_0x7c52('0x11')](e,emitEvent(event));}}module[_0x7c52('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xbddd=['../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hook','events'];(function(_0x24403d,_0x94ebf1){var _0x3fabf3=function(_0x39b1a9){while(--_0x39b1a9){_0x24403d['push'](_0x24403d['shift']());}};_0x3fabf3(++_0x94ebf1);}(_0xbddd,0x19d));var _0xdbdd=function(_0x20fcc3,_0x31dfff){_0x20fcc3=_0x20fcc3-0x0;var _0x482216=_0xbddd[_0x20fcc3];return _0x482216;};'use strict';var EventEmitter=require(_0xdbdd('0x0'));var OpenchannelInteraction=require(_0xdbdd('0x1'))['db'][_0xdbdd('0x2')];var OpenchannelMessage=require(_0xdbdd('0x1'))['db'][_0xdbdd('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xdbdd('0x4')](0x0);var events={'afterCreate':_0xdbdd('0x5'),'afterUpdate':_0xdbdd('0x6'),'afterDestroy':_0xdbdd('0x7')};function emitEvent(_0xc2d5){return function(_0x313d7c,_0x44acba,_0x56b362){_0x313d7c[_0xdbdd('0x8')]({'attributes':['id'],'raw':!![]})[_0xdbdd('0x9')](function(_0x89c4da){_0x313d7c[_0xdbdd('0xa')](_0xdbdd('0xb'),_0x89c4da[_0xdbdd('0xc')](function(_0x15db11){return{'id':_0x15db11['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x313d7c['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdbdd('0x9')](function(_0x49e790){_0x313d7c['setDataValue'](_0xdbdd('0xd'),_0x49e790[_0xdbdd('0xe')]);OpenchannelInteractionEvents['emit'](_0xc2d5+':'+_0x313d7c['id'],_0x313d7c);OpenchannelInteractionEvents[_0xdbdd('0xf')](_0xc2d5,_0x313d7c);_0x56b362(null);})[_0xdbdd('0x10')](_0x56b362(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0xdbdd('0x11')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index cef3aa7..1043023 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 _0x07b4=['exports','define','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x225475,_0x37f89f){var _0x1e44cb=function(_0x58f473){while(--_0x58f473){_0x225475['push'](_0x225475['shift']());}};_0x1e44cb(++_0x37f89f);}(_0x07b4,0x1c9));var _0x407b=function(_0x5cb4ca,_0x2e7dcf){_0x5cb4ca=_0x5cb4ca-0x0;var _0x463c45=_0x07b4[_0x5cb4ca];return _0x463c45;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x407b('0x0'));var moment=require('moment');var BPromise=require(_0x407b('0x1'));var rp=require(_0x407b('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x407b('0x3'));var config=require(_0x407b('0x4'));var attributes=require('./openchannelInteraction.attributes');module[_0x407b('0x5')]=function(_0x542a1d,_0x25d694){return _0x542a1d[_0x407b('0x6')]('OpenchannelInteraction',attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x4de447,_0x307da0,_0x68fec6){if(_0x4de447[_0x407b('0x7')](_0x407b('0x8'))){_0x4de447['closedAt']=moment()[_0x407b('0x9')](_0x407b('0xa'));}_0x68fec6(null,_0x4de447);}}});}; \ No newline at end of file +var _0xb271=['closedAt','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed'];(function(_0x3137f9,_0xf9094d){var _0xebaec5=function(_0x2cd481){while(--_0x2cd481){_0x3137f9['push'](_0x3137f9['shift']());}};_0xebaec5(++_0xf9094d);}(_0xb271,0x145));var _0x1b27=function(_0x41b192,_0x4a4c4f){_0x41b192=_0x41b192-0x0;var _0x3f8763=_0xb271[_0x41b192];return _0x3f8763;};'use strict';var _=require(_0x1b27('0x0'));var util=require('util');var logger=require(_0x1b27('0x1'))(_0x1b27('0x2'));var moment=require(_0x1b27('0x3'));var BPromise=require(_0x1b27('0x4'));var rp=require(_0x1b27('0x5'));var fs=require('fs');var path=require(_0x1b27('0x6'));var rimraf=require(_0x1b27('0x7'));var config=require(_0x1b27('0x8'));var attributes=require(_0x1b27('0x9'));module[_0x1b27('0xa')]=function(_0x5b53e5,_0x42335d){return _0x5b53e5[_0x1b27('0xb')](_0x1b27('0xc'),attributes,{'tableName':_0x1b27('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1b27('0xe'),'collate':_0x1b27('0xf'),'hooks':{'beforeUpdate':function(_0x22a4a1,_0x261c39,_0x54d51e){if(_0x22a4a1[_0x1b27('0x10')]('closed')){_0x22a4a1[_0x1b27('0x11')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x54d51e(null,_0x22a4a1);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index bc8c79b..1bb83f5 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 _0x7adf=['info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','limit','catch','find','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','request','then'];(function(_0x4c2436,_0x5451cf){var _0x19afd8=function(_0x23c654){while(--_0x23c654){_0x4c2436['push'](_0x4c2436['shift']());}};_0x19afd8(++_0x5451cf);}(_0x7adf,0x1bc));var _0xf7ad=function(_0x130580,_0x32ac4d){_0x130580=_0x130580-0x0;var _0x1a9f85=_0x7adf[_0x130580];return _0x1a9f85;};'use strict';var _=require(_0xf7ad('0x0'));var util=require(_0xf7ad('0x1'));var moment=require('moment');var BPromise=require(_0xf7ad('0x2'));var rs=require(_0xf7ad('0x3'));var fs=require('fs');var Redis=require(_0xf7ad('0x4'));var db=require(_0xf7ad('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf7ad('0x6'))('rpc');var config=require(_0xf7ad('0x7'));var jayson=require(_0xf7ad('0x8'));var client=jayson[_0xf7ad('0x9')][_0xf7ad('0xa')]({'port':0x232a});config['redis']=_[_0xf7ad('0xb')](config[_0xf7ad('0xc')],{'host':_0xf7ad('0xd'),'port':0x18eb});var socket=require(_0xf7ad('0xe'))(new Redis(config[_0xf7ad('0xc')]));require(_0xf7ad('0xf'))['register'](socket);function respondWithRpcPromise(_0x1eb58d,_0x3a1a9f,_0xbc5af2){return new BPromise(function(_0x738558,_0x192246){return client[_0xf7ad('0x10')](_0x1eb58d,_0xbc5af2)[_0xf7ad('0x11')](function(_0x473d2c){logger[_0xf7ad('0x12')](_0xf7ad('0x13'),_0x3a1a9f,_0xf7ad('0x14'));logger[_0xf7ad('0x15')](_0xf7ad('0x16'),_0x3a1a9f,'request\x20sent',JSON[_0xf7ad('0x17')](_0x473d2c));if(_0x473d2c[_0xf7ad('0x18')]){if(_0x473d2c[_0xf7ad('0x18')][_0xf7ad('0x19')]===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x3a1a9f,_0x473d2c['error']['message']);return _0x192246(_0x473d2c[_0xf7ad('0x18')][_0xf7ad('0x1a')]);}logger[_0xf7ad('0x18')](_0xf7ad('0x13'),_0x3a1a9f,_0x473d2c['error']['message']);return _0x738558(_0x473d2c[_0xf7ad('0x18')]['message']);}else{logger[_0xf7ad('0x12')](_0xf7ad('0x13'),_0x3a1a9f,_0xf7ad('0x14'));_0x738558(_0x473d2c[_0xf7ad('0x1b')]['message']);}})['catch'](function(_0x46019e){logger[_0xf7ad('0x18')](_0xf7ad('0x13'),_0x3a1a9f,_0x46019e);_0x192246(_0x46019e);});});}exports[_0xf7ad('0x1c')]=function(_0x531107){var _0x34d159=this;return new Promise(function(_0x1c83b7,_0x591289){return db[_0xf7ad('0x1d')][_0xf7ad('0x1e')](_0x531107[_0xf7ad('0x1f')],{'raw':_0x531107[_0xf7ad('0x20')]?_0x531107[_0xf7ad('0x20')][_0xf7ad('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x531107[_0xf7ad('0x20')]?_0x531107[_0xf7ad('0x20')][_0xf7ad('0x22')]||null:null,'attributes':_0x531107[_0xf7ad('0x20')]?_0x531107[_0xf7ad('0x20')]['attributes']||null:null,'limit':_0x531107[_0xf7ad('0x20')]?_0x531107['options'][_0xf7ad('0x23')]||null:null})['then'](function(_0x22afa7){logger[_0xf7ad('0x12')](_0xf7ad('0x1c'),_0x531107);logger[_0xf7ad('0x15')](_0xf7ad('0x1c'),_0x531107,JSON[_0xf7ad('0x17')](_0x22afa7));_0x1c83b7(_0x22afa7);})[_0xf7ad('0x24')](function(_0x5b0a72){logger[_0xf7ad('0x18')](_0xf7ad('0x1c'),_0x5b0a72[_0xf7ad('0x1a')],_0x531107);_0x591289(_0x34d159[_0xf7ad('0x18')](0x1f4,_0x5b0a72[_0xf7ad('0x1a')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x416c12){return new Promise(function(_0x53a106,_0x355bf9){return db[_0xf7ad('0x1d')][_0xf7ad('0x25')]({'where':_0x416c12[_0xf7ad('0x20')]?_0x416c12['options'][_0xf7ad('0x22')]||null:null})[_0xf7ad('0x11')](function(_0x3ba7b5){if(_0x3ba7b5){return _0x3ba7b5['addTags'](_0x416c12['body'][_0xf7ad('0x26')],_[_0xf7ad('0x27')](_0x416c12['body'],[_0xf7ad('0x26'),'id'])||{});}})[_0xf7ad('0x28')](function(_0x19da2f){logger['info']('AddTags',_0x416c12);logger[_0xf7ad('0x15')](_0xf7ad('0x29'),_0x416c12,JSON[_0xf7ad('0x17')](_0x19da2f));_0x53a106(_0x19da2f);})[_0xf7ad('0x24')](function(_0xc91dac){logger[_0xf7ad('0x18')](_0xf7ad('0x29'),_0xc91dac[_0xf7ad('0x1a')],_0x416c12);_0x355bf9(_this[_0xf7ad('0x18')](0x1f4,_0xc91dac[_0xf7ad('0x1a')]));});});}; \ No newline at end of file +var _0x54f5=['attributes','AddTagsToOpenchannelInteraction','addTags','omit','ids','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','where'];(function(_0x179b32,_0x428c8b){var _0x37071a=function(_0x3eda23){while(--_0x3eda23){_0x179b32['push'](_0x179b32['shift']());}};_0x37071a(++_0x428c8b);}(_0x54f5,0x154));var _0x554f=function(_0x25df80,_0xa2aec5){_0x25df80=_0x25df80-0x0;var _0x17b6d0=_0x54f5[_0x25df80];return _0x17b6d0;};'use strict';var _=require(_0x554f('0x0'));var util=require(_0x554f('0x1'));var moment=require('moment');var BPromise=require(_0x554f('0x2'));var rs=require(_0x554f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x554f('0x4'))['db'];var utils=require(_0x554f('0x5'));var logger=require(_0x554f('0x6'))('rpc');var config=require(_0x554f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x554f('0x8')]['http']({'port':0x232a});config[_0x554f('0x9')]=_[_0x554f('0xa')](config[_0x554f('0x9')],{'host':_0x554f('0xb'),'port':0x18eb});var socket=require(_0x554f('0xc'))(new Redis(config[_0x554f('0x9')]));require(_0x554f('0xd'))[_0x554f('0xe')](socket);function respondWithRpcPromise(_0x1eb734,_0x14c5e9,_0x370fdf){return new BPromise(function(_0x1a5b3a,_0x5decd3){return client[_0x554f('0xf')](_0x1eb734,_0x370fdf)[_0x554f('0x10')](function(_0x3b28cf){logger[_0x554f('0x11')](_0x554f('0x12'),_0x14c5e9,_0x554f('0x13'));logger[_0x554f('0x14')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x14c5e9,_0x554f('0x13'),JSON[_0x554f('0x15')](_0x3b28cf));if(_0x3b28cf[_0x554f('0x16')]){if(_0x3b28cf[_0x554f('0x16')]['code']===0x1f4){logger[_0x554f('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x14c5e9,_0x3b28cf[_0x554f('0x16')][_0x554f('0x17')]);return _0x5decd3(_0x3b28cf['error'][_0x554f('0x17')]);}logger[_0x554f('0x16')](_0x554f('0x12'),_0x14c5e9,_0x3b28cf[_0x554f('0x16')][_0x554f('0x17')]);return _0x1a5b3a(_0x3b28cf[_0x554f('0x16')][_0x554f('0x17')]);}else{logger[_0x554f('0x11')](_0x554f('0x12'),_0x14c5e9,_0x554f('0x13'));_0x1a5b3a(_0x3b28cf['result']['message']);}})[_0x554f('0x18')](function(_0x9c889b){logger['error'](_0x554f('0x12'),_0x14c5e9,_0x9c889b);_0x5decd3(_0x9c889b);});});}exports[_0x554f('0x19')]=function(_0x21ea01){var _0x5e7f7f=this;return new Promise(function(_0x5111fb,_0x57e521){return db[_0x554f('0x1a')]['update'](_0x21ea01[_0x554f('0x1b')],{'raw':_0x21ea01['options']?_0x21ea01[_0x554f('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21ea01['options']?_0x21ea01[_0x554f('0x1c')][_0x554f('0x1d')]||null:null,'attributes':_0x21ea01['options']?_0x21ea01[_0x554f('0x1c')][_0x554f('0x1e')]||null:null,'limit':_0x21ea01[_0x554f('0x1c')]?_0x21ea01[_0x554f('0x1c')]['limit']||null:null})[_0x554f('0x10')](function(_0x3ef831){logger[_0x554f('0x11')](_0x554f('0x19'),_0x21ea01);logger[_0x554f('0x14')]('UpdateOpenchannelInteraction',_0x21ea01,JSON[_0x554f('0x15')](_0x3ef831));_0x5111fb(_0x3ef831);})[_0x554f('0x18')](function(_0x5818d4){logger[_0x554f('0x16')]('UpdateOpenchannelInteraction',_0x5818d4[_0x554f('0x17')],_0x21ea01);_0x57e521(_0x5e7f7f['error'](0x1f4,_0x5818d4[_0x554f('0x17')]));});});};exports[_0x554f('0x1f')]=function(_0x66c0fa){return new Promise(function(_0x5e041f,_0x56a674){return db[_0x554f('0x1a')]['find']({'where':_0x66c0fa[_0x554f('0x1c')]?_0x66c0fa[_0x554f('0x1c')][_0x554f('0x1d')]||null:null})[_0x554f('0x10')](function(_0x3fe8f5){if(_0x3fe8f5){return _0x3fe8f5[_0x554f('0x20')](_0x66c0fa[_0x554f('0x1b')]['ids'],_[_0x554f('0x21')](_0x66c0fa[_0x554f('0x1b')],[_0x554f('0x22'),'id'])||{});}})[_0x554f('0x23')](function(_0x516ac9){logger['info'](_0x554f('0x24'),_0x66c0fa);logger['debug'](_0x554f('0x24'),_0x66c0fa,JSON[_0x554f('0x15')](_0x516ac9));_0x5e041f(_0x516ac9);})[_0x554f('0x18')](function(_0x1eaf96){logger[_0x554f('0x16')]('AddTags',_0x1eaf96[_0x554f('0x17')],_0x66c0fa);_0x56a674(_this['error'](0x1f4,_0x1eaf96[_0x554f('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 32dec78..c05c5d2 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 _0x0049=['removeListener','register','openchannelInteraction:','./openchannelInteraction.events','save','remove','update','emit'];(function(_0x1bf081,_0x5ac441){var _0x87269f=function(_0x54064f){while(--_0x54064f){_0x1bf081['push'](_0x1bf081['shift']());}};_0x87269f(++_0x5ac441);}(_0x0049,0x1f3));var _0x9004=function(_0x1ae3b4,_0x425eea){_0x1ae3b4=_0x1ae3b4-0x0;var _0x4f2024=_0x0049[_0x1ae3b4];return _0x4f2024;};'use strict';var OpenchannelInteractionEvents=require(_0x9004('0x0'));var events=[_0x9004('0x1'),_0x9004('0x2'),_0x9004('0x3')];function createListener(_0x3487d0,_0x2475c8){return function(_0x56face){_0x2475c8[_0x9004('0x4')](_0x3487d0,_0x56face);};}function removeListener(_0x19f3bf,_0x366992){return function(){OpenchannelInteractionEvents[_0x9004('0x5')](_0x19f3bf,_0x366992);};}exports[_0x9004('0x6')]=function(_0x27f813){for(var _0x32cfe3=0x0,_0x1f9b60=events['length'];_0x32cfe3<_0x1f9b60;_0x32cfe3++){var _0x4e88f3=events[_0x32cfe3];var _0x159a3c=createListener(_0x9004('0x7')+_0x4e88f3,_0x27f813);OpenchannelInteractionEvents['on'](_0x4e88f3,_0x159a3c);}}; \ No newline at end of file +var _0x3d0f=['save','remove','emit','removeListener','length','./openchannelInteraction.events'];(function(_0x535c7e,_0x43a005){var _0x567a3a=function(_0xc9215f){while(--_0xc9215f){_0x535c7e['push'](_0x535c7e['shift']());}};_0x567a3a(++_0x43a005);}(_0x3d0f,0xa1));var _0xf3d0=function(_0x448bab,_0x25517b){_0x448bab=_0x448bab-0x0;var _0x5dc534=_0x3d0f[_0x448bab];return _0x5dc534;};'use strict';var OpenchannelInteractionEvents=require(_0xf3d0('0x0'));var events=[_0xf3d0('0x1'),_0xf3d0('0x2'),'update'];function createListener(_0x4f82eb,_0x8df0df){return function(_0x3a860a){_0x8df0df[_0xf3d0('0x3')](_0x4f82eb,_0x3a860a);};}function removeListener(_0x127e45,_0x1d7862){return function(){OpenchannelInteractionEvents[_0xf3d0('0x4')](_0x127e45,_0x1d7862);};}exports['register']=function(_0x168694){for(var _0x56e800=0x0,_0x3d150c=events[_0xf3d0('0x5')];_0x56e800<_0x3d150c;_0x56e800++){var _0x2d2cc1=events[_0x56e800];var _0x41a116=createListener('openchannelInteraction:'+_0x2d2cc1,_0x168694);OpenchannelInteractionEvents['on'](_0x2d2cc1,_0x41a116);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index b6117f3..ca0d05f 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x50af45,_0x14966e){_0x50af45=_0x50af45-0x0;var _0x3d0da6=_0x70e0[_0x50af45];return _0x3d0da6;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file +var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0xd548a1,_0x2225e3){var _0x3a85f=function(_0x4a4944){while(--_0x4a4944){_0xd548a1['push'](_0xd548a1['shift']());}};_0x3a85f(++_0x2225e3);}(_0xe706,0xa3));var _0x6e70=function(_0x2f2dd0,_0x242127){_0x2f2dd0=_0x2f2dd0-0x0;var _0x3c48d1=_0xe706[_0x2f2dd0];return _0x3c48d1;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 0608672..cb49c2b 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 _0x6000=['out','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6000,0x17c));var _0x0600=function(_0x153c25,_0x5ebe53){_0x153c25=_0x153c25-0x0;var _0x6df50a=_0x6000[_0x153c25];return _0x6df50a;};'use strict';var Sequelize=require(_0x0600('0x0'));module[_0x0600('0x1')]={'body':{'type':Sequelize[_0x0600('0x2')](_0x0600('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x0600('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x0600('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x0600('0x5')),'defaultValue':_0x0600('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x0600('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x657b=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x20c6e3,_0x400b33){var _0x2bc769=function(_0x41fff6){while(--_0x41fff6){_0x20c6e3['push'](_0x20c6e3['shift']());}};_0x2bc769(++_0x400b33);}(_0x657b,0x131));var _0xb657=function(_0x5c7961,_0xd0e981){_0x5c7961=_0x5c7961-0x0;var _0x27f9cc=_0x657b[_0x5c7961];return _0x27f9cc;};'use strict';var Sequelize=require(_0xb657('0x0'));module[_0xb657('0x1')]={'body':{'type':Sequelize[_0xb657('0x2')](_0xb657('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xb657('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xb657('0x5')]('in',_0xb657('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xb657('0x7')]},'providerName':{'type':Sequelize[_0xb657('0x8')]},'providerResponse':{'type':Sequelize[_0xb657('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 516e76e..ea8f128 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 _0x9137=['rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','describe','../../config/logger','openchannel-interactions','accept','openchannel','read','readAt','format','user','agent','UserId','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[OPENCHANNELMESSAGE: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','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','reject','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','sequelize','motionChannel','rejectmessage','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/environment','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','client','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','sendStatus','stack','name','send','index','OpenchannelMessage'];(function(_0x180c9e,_0x43da96){var _0x5015ce=function(_0x5cc8fa){while(--_0x5cc8fa){_0x180c9e['push'](_0x180c9e['shift']());}};_0x5015ce(++_0x43da96);}(_0x9137,0x15d));var _0x7913=function(_0x3fdae4,_0x16182d){_0x3fdae4=_0x3fdae4-0x0;var _0x5c4538=_0x9137[_0x3fdae4];return _0x5c4538;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7913('0x0'));var zipdir=require(_0x7913('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7913('0x2'));var moment=require('moment');var BPromise=require(_0x7913('0x3'));var Mustache=require('mustache');var util=require(_0x7913('0x4'));var path=require(_0x7913('0x5'));var sox=require(_0x7913('0x6'));var csv=require(_0x7913('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7913('0x8'));var squel=require(_0x7913('0x9'));var crypto=require(_0x7913('0xa'));var jsforce=require(_0x7913('0xb'));var deskjs=require(_0x7913('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7913('0xd'));var Papa=require(_0x7913('0xe'));var Redis=require(_0x7913('0xf'));var authService=require(_0x7913('0x10'));var qs=require(_0x7913('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x7913('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x7913('0x13')](config[_0x7913('0x14')],{'host':_0x7913('0x15'),'port':0x18eb});var socket=require(_0x7913('0x16'))(new Redis(config['redis']));require(_0x7913('0x17'))[_0x7913('0x18')](socket);var jayson=require(_0x7913('0x19'));var client=jayson['client'][_0x7913('0x1a')]({'port':0x232c});var client9002=jayson[_0x7913('0x1b')][_0x7913('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x11e5d0,_0x5cb3d2,_0x2001ae,_0x391b3e){return new BPromise(function(_0x308a14,_0x782010){var _0x657441=_0x391b3e||client;return _0x657441[_0x7913('0x1c')](_0x11e5d0,_0x2001ae)[_0x7913('0x1d')](function(_0x4da294){logger[_0x7913('0x1e')](_0x7913('0x1f'),_0x5cb3d2,_0x7913('0x20'));logger[_0x7913('0x21')](_0x7913('0x22'),_0x5cb3d2,'request\x20sent',JSON[_0x7913('0x23')](_0x4da294));if(_0x4da294[_0x7913('0x24')]){if(_0x4da294[_0x7913('0x24')][_0x7913('0x25')]===0x1f4){logger[_0x7913('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x5cb3d2,_0x4da294[_0x7913('0x24')]['message']);return _0x782010(_0x4da294[_0x7913('0x24')][_0x7913('0x26')]);}logger[_0x7913('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x5cb3d2,_0x4da294[_0x7913('0x24')]['message']);return _0x308a14(_0x4da294[_0x7913('0x24')][_0x7913('0x26')]);}else{logger['info'](_0x7913('0x1f'),_0x5cb3d2,_0x7913('0x20'));_0x308a14(_0x4da294[_0x7913('0x27')][_0x7913('0x26')]);}})[_0x7913('0x28')](function(_0xc1dc91){logger['error'](_0x7913('0x1f'),_0x5cb3d2,_0xc1dc91);_0x782010(_0xc1dc91);});});}function respondWithStatusCode(_0x357205,_0x55a8e4){_0x55a8e4=_0x55a8e4||0xcc;return function(_0x5638f6){if(_0x5638f6){return _0x357205['sendStatus'](_0x55a8e4);}return _0x357205[_0x7913('0x29')](_0x55a8e4)[_0x7913('0x2a')]();};}function respondWithResult(_0x4f93ef,_0x162f57){_0x162f57=_0x162f57||0xc8;return function(_0x339959){if(_0x339959){return _0x4f93ef[_0x7913('0x29')](_0x162f57)[_0x7913('0x2b')](_0x339959);}};}function respondWithFilteredResult(_0x3b9afa,_0x57b4fe){return function(_0x23c9c2){if(_0x23c9c2){var _0x1fe96c=typeof _0x57b4fe[_0x7913('0x2c')]===_0x7913('0x2d')&&typeof _0x57b4fe[_0x7913('0x2e')]===_0x7913('0x2d');var _0x46a24b=_0x23c9c2[_0x7913('0x2f')];var _0x539e54=_0x1fe96c?0x0:_0x57b4fe[_0x7913('0x2c')];var _0x557b1=_0x1fe96c?_0x23c9c2['count']:_0x57b4fe[_0x7913('0x2c')]+_0x57b4fe[_0x7913('0x2e')];var _0x2beb1f;if(_0x557b1>=_0x46a24b){_0x557b1=_0x46a24b;_0x2beb1f=0xc8;}else{_0x2beb1f=0xce;}_0x3b9afa[_0x7913('0x29')](_0x2beb1f);return _0x3b9afa['set'](_0x7913('0x30'),_0x539e54+'-'+_0x557b1+'/'+_0x46a24b)[_0x7913('0x2b')](_0x23c9c2);}return null;};}function patchUpdates(_0x5ab054){return function(_0x326aeb){try{jsonpatch[_0x7913('0x31')](_0x326aeb,_0x5ab054,!![]);}catch(_0x10d8da){return BPromise['reject'](_0x10d8da);}return _0x326aeb[_0x7913('0x32')]();};}function saveUpdates(_0x58d0c1,_0x4225df){return function(_0x597533){if(_0x597533){return _0x597533[_0x7913('0x33')](_0x58d0c1)[_0x7913('0x1d')](function(_0x1420e8){return _0x1420e8;});}return null;};}function removeEntity(_0x1c24ef,_0x5bc29f){return function(_0x571278){if(_0x571278){return _0x571278[_0x7913('0x34')]()['then'](function(){_0x1c24ef[_0x7913('0x29')](0xcc)[_0x7913('0x2a')]();});}};}function handleEntityNotFound(_0x1d7428,_0x16230a){return function(_0x55091b){if(!_0x55091b){_0x1d7428[_0x7913('0x35')](0x194);}return _0x55091b;};}function handleError(_0xd2b06d,_0xf75356){_0xf75356=_0xf75356||0x1f4;return function(_0x483abe){logger[_0x7913('0x24')](_0x483abe[_0x7913('0x36')]);if(_0x483abe[_0x7913('0x37')]){delete _0x483abe['name'];}_0xd2b06d[_0x7913('0x29')](_0xf75356)[_0x7913('0x38')](_0x483abe);};}exports[_0x7913('0x39')]=function(_0x52281a,_0x39c1d6){var _0x517d60={},_0x4344d4={},_0x272eba={'count':0x0,'rows':[]};var _0x886229=_['map'](db[_0x7913('0x3a')][_0x7913('0x3b')],function(_0x3203fe){return{'name':_0x3203fe[_0x7913('0x3c')],'type':_0x3203fe[_0x7913('0x3d')][_0x7913('0x3e')]};});_0x4344d4[_0x7913('0x3f')]=_['map'](_0x886229,'name');_0x4344d4['query']=_[_0x7913('0x40')](_0x52281a[_0x7913('0x41')]);_0x4344d4['filters']=_['intersection'](_0x4344d4[_0x7913('0x3f')],_0x4344d4['query']);_0x517d60['attributes']=_[_0x7913('0x42')](_0x4344d4[_0x7913('0x3f')],qs[_0x7913('0x43')](_0x52281a[_0x7913('0x41')][_0x7913('0x43')]));_0x517d60[_0x7913('0x44')]=_0x517d60[_0x7913('0x44')][_0x7913('0x45')]?_0x517d60[_0x7913('0x44')]:_0x4344d4[_0x7913('0x3f')];if(!_0x52281a['query'][_0x7913('0x46')](_0x7913('0x47'))){_0x517d60[_0x7913('0x2e')]=qs[_0x7913('0x2e')](_0x52281a[_0x7913('0x41')][_0x7913('0x2e')]);_0x517d60['offset']=qs['offset'](_0x52281a['query'][_0x7913('0x2c')]);}_0x517d60[_0x7913('0x48')]=qs[_0x7913('0x49')](_0x52281a[_0x7913('0x41')][_0x7913('0x49')]);_0x517d60[_0x7913('0x4a')]=qs[_0x7913('0x4b')](_[_0x7913('0x4c')](_0x52281a[_0x7913('0x41')],_0x4344d4[_0x7913('0x4b')]),_0x886229);if(_0x52281a['query'][_0x7913('0x4d')]){_0x517d60['where']=_[_0x7913('0x4e')](_0x517d60[_0x7913('0x4a')],{'$or':_['map'](_0x886229,function(_0x1ce582){if(_0x1ce582[_0x7913('0x3d')]!=='VIRTUAL'){var _0x22cd1f={};_0x22cd1f[_0x1ce582[_0x7913('0x37')]]={'$like':'%'+_0x52281a[_0x7913('0x41')][_0x7913('0x4d')]+'%'};return _0x22cd1f;}})});}_0x517d60=_[_0x7913('0x4e')]({},_0x517d60,_0x52281a[_0x7913('0x4f')]);var _0x2b651f={'where':_0x517d60['where']};return db[_0x7913('0x3a')][_0x7913('0x2f')](_0x2b651f)[_0x7913('0x1d')](function(_0x294978){_0x272eba[_0x7913('0x2f')]=_0x294978;if(_0x52281a[_0x7913('0x41')][_0x7913('0x50')]){_0x517d60[_0x7913('0x51')]=[{'all':!![]}];}return db[_0x7913('0x3a')][_0x7913('0x52')](_0x517d60);})[_0x7913('0x1d')](function(_0x1d1358){_0x272eba[_0x7913('0x53')]=_0x1d1358;return _0x272eba;})[_0x7913('0x1d')](respondWithFilteredResult(_0x39c1d6,_0x517d60))['catch'](handleError(_0x39c1d6,null));};exports[_0x7913('0x54')]=function(_0x36413e,_0x1dcaa7){var _0x372300={'raw':!![],'where':{'id':_0x36413e[_0x7913('0x55')]['id']}},_0x2d20e1={};_0x2d20e1[_0x7913('0x3f')]=_[_0x7913('0x40')](db[_0x7913('0x3a')][_0x7913('0x3b')]);_0x2d20e1[_0x7913('0x41')]=_['keys'](_0x36413e[_0x7913('0x41')]);_0x2d20e1['filters']=_['intersection'](_0x2d20e1[_0x7913('0x3f')],_0x2d20e1['query']);_0x372300[_0x7913('0x44')]=_[_0x7913('0x42')](_0x2d20e1[_0x7913('0x3f')],qs[_0x7913('0x43')](_0x36413e['query']['fields']));_0x372300[_0x7913('0x44')]=_0x372300['attributes']['length']?_0x372300[_0x7913('0x44')]:_0x2d20e1[_0x7913('0x3f')];if(_0x36413e[_0x7913('0x41')][_0x7913('0x50')]){_0x372300[_0x7913('0x51')]=[{'all':!![]}];}_0x372300=_[_0x7913('0x4e')]({},_0x372300,_0x36413e[_0x7913('0x4f')]);return db[_0x7913('0x3a')][_0x7913('0x56')](_0x372300)[_0x7913('0x1d')](handleEntityNotFound(_0x1dcaa7,null))[_0x7913('0x1d')](respondWithResult(_0x1dcaa7,null))[_0x7913('0x28')](handleError(_0x1dcaa7,null));};exports[_0x7913('0x57')]=function(_0x4bddbb,_0x4875e3){return db[_0x7913('0x3a')][_0x7913('0x57')](_0x4bddbb[_0x7913('0x58')],{})[_0x7913('0x1d')](respondWithResult(_0x4875e3,0xc9))[_0x7913('0x28')](handleError(_0x4875e3,null));};exports[_0x7913('0x33')]=function(_0x5996f8,_0x513ef7){if(_0x5996f8[_0x7913('0x58')]['id']){delete _0x5996f8[_0x7913('0x58')]['id'];}return db[_0x7913('0x3a')]['find']({'where':{'id':_0x5996f8['params']['id']}})[_0x7913('0x1d')](handleEntityNotFound(_0x513ef7,null))['then'](saveUpdates(_0x5996f8[_0x7913('0x58')],null))[_0x7913('0x1d')](respondWithResult(_0x513ef7,null))[_0x7913('0x28')](handleError(_0x513ef7,null));};exports[_0x7913('0x34')]=function(_0x2bc409,_0x45ee05){return db[_0x7913('0x3a')][_0x7913('0x56')]({'where':{'id':_0x2bc409[_0x7913('0x55')]['id']}})[_0x7913('0x1d')](handleEntityNotFound(_0x45ee05,null))[_0x7913('0x1d')](removeEntity(_0x45ee05,null))['catch'](handleError(_0x45ee05,null));};exports['describe']=function(_0x168b49,_0x31829f){return db[_0x7913('0x3a')][_0x7913('0x59')]()[_0x7913('0x1d')](respondWithResult(_0x31829f,null))[_0x7913('0x28')](handleError(_0x31829f,null));};var interaction_log=require(_0x7913('0x5a'))(_0x7913('0x5b'));exports[_0x7913('0x5c')]=function(_0x246d97,_0x1f9df2,_0x273933){var _0x29be2f={'agent':{},'channel':_0x7913('0x5d')};if(_0x246d97[_0x7913('0x58')]['id']){delete _0x246d97[_0x7913('0x58')]['id'];}_0x246d97['body'][_0x7913('0x5e')]=!![];_0x246d97[_0x7913('0x58')][_0x7913('0x5f')]=moment()[_0x7913('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x246d97[_0x7913('0x58')]['UserId']=_0x246d97[_0x7913('0x58')]['UserId']||_0x246d97[_0x7913('0x61')]['id'];_0x29be2f[_0x7913('0x62')]['id']=_0x246d97[_0x7913('0x58')][_0x7913('0x63')];return db[_0x7913('0x3a')][_0x7913('0x56')]({'where':{'id':_0x246d97['params']['id'],'UserId':null}})[_0x7913('0x1d')](handleEntityNotFound(_0x1f9df2,null))[_0x7913('0x1d')](saveUpdates(_0x246d97[_0x7913('0x58')],null))[_0x7913('0x1d')](function(_0x459d4e){if(_0x459d4e){_0x29be2f[_0x7913('0x26')]=_0x459d4e[_0x7913('0x64')]({'plain':!![]});return db[_0x7913('0x65')]['find']({'where':{'id':_0x459d4e[_0x7913('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x1f9df2,null))['then'](function(_0x401d11){if(_0x401d11){return _0x401d11[_0x7913('0x33')]({'UserId':_0x246d97[_0x7913('0x58')][_0x7913('0x63')],'read1stAt':_[_0x7913('0x67')](_0x401d11[_0x7913('0x68')])?moment()['format'](_0x7913('0x69')):undefined});}return null;})['then'](function(_0x10d274){if(_0x10d274){_0x29be2f[_0x7913('0x6a')]=_0x10d274[_0x7913('0x64')]({'plain':!![]});interaction_log[_0x7913('0x1e')](_0x7913('0x6b'),_0x246d97['user']['id'],_0x246d97[_0x7913('0x61')]['name'],_0x246d97[_0x7913('0x61')]['role'],_0x29be2f[_0x7913('0x6a')]['id'],_0x246d97[_0x7913('0x58')]?JSON[_0x7913('0x23')](_0x246d97[_0x7913('0x58')]):_0x7913('0x6c'));return respondWithRpcPromise(_0x7913('0x6d'),_0x7913('0x6e'),_0x29be2f);}return null;})[_0x7913('0x1d')](function(_0x3fedbb){var _0x3e39bc=_0x7913('0x6f')+_0x3fedbb['message'][_0x7913('0x70')];return db['sequelize']['query'](_0x3e39bc,{'type':db[_0x7913('0x71')][_0x7913('0x72')][_0x7913('0x73')],'raw':!![]})['then'](function(_0x5ba94d){return _0x5ba94d;});})[_0x7913('0x1d')](function(_0x24206b){if(_0x24206b){_0x29be2f[_0x7913('0x26')][_0x7913('0x74')]=_0x24206b[0x0];if(!_0x246d97[_0x7913('0x58')]['UserId'])return;return db[_0x7913('0x75')][_0x7913('0x56')]({'where':{'id':_0x246d97['body']['UserId'],'role':_0x7913('0x62')},'attributes':['id',_0x7913('0x37'),_0x7913('0x76'),_0x7913('0x77'),_0x7913('0x78')],'raw':!![]});}return null;})[_0x7913('0x1d')](function(_0x37b723){if(!_0x37b723)return null;_0x29be2f[_0x7913('0x26')][_0x7913('0x62')]=_0x37b723;return _0x29be2f;})[_0x7913('0x1d')](function(_0x4db83a){if(_0x4db83a){if(_0x246d97[_0x7913('0x58')][_0x7913('0x79')]){_0x29be2f['message'][_0x7913('0x7a')]=util['format'](_0x7913('0x7b'),_0x246d97[_0x7913('0x61')]['name']);_0x29be2f[_0x7913('0x26')][_0x7913('0x7c')]=_0x29be2f[_0x7913('0x7c')];_0x29be2f[_0x7913('0x26')]['motionChannel']=_0x29be2f[_0x7913('0x7c')];_0x29be2f[_0x7913('0x26')][_0x7913('0x7d')]=_0x7913('0x5c');return respondWithRpcPromise('EventManager',_0x7913('0x7e'),{'event':_0x7913('0x7f'),'message':_0x29be2f[_0x7913('0x26')]},client9002)['then'](function(){return _0x29be2f;});}return _0x29be2f;}return null;})[_0x7913('0x1d')](respondWithResult(_0x1f9df2,null))[_0x7913('0x28')](handleError(_0x1f9df2,null));};var interaction_log=require('../../config/logger')(_0x7913('0x5b'));exports[_0x7913('0x80')]=function(_0x392ff9,_0x1f86f5,_0x21c088){var _0x5891b1={'agent':{},'channel':_0x7913('0x5d')};if(_0x392ff9[_0x7913('0x58')]['id']){delete _0x392ff9[_0x7913('0x58')]['id'];}_0x392ff9['body'][_0x7913('0x63')]=_0x392ff9[_0x7913('0x58')]['UserId']||_0x392ff9[_0x7913('0x61')]['id'];_0x5891b1[_0x7913('0x62')]['id']=_0x392ff9[_0x7913('0x58')][_0x7913('0x63')];return db[_0x7913('0x3a')][_0x7913('0x56')]({'where':{'id':_0x392ff9[_0x7913('0x55')]['id'],'UserId':null}})[_0x7913('0x1d')](handleEntityNotFound(_0x1f86f5,null))[_0x7913('0x1d')](function(_0x4000ef){if(_0x4000ef){_0x5891b1['message']=_0x4000ef[_0x7913('0x64')]({'plain':!![]});return db[_0x7913('0x65')][_0x7913('0x56')]({'where':{'id':_0x4000ef[_0x7913('0x66')]}});}return null;})[_0x7913('0x1d')](handleEntityNotFound(_0x1f86f5,null))[_0x7913('0x1d')](function(_0x266faa){if(_0x266faa){_0x5891b1['interaction']=_0x266faa['get']({'plain':!![]});interaction_log[_0x7913('0x1e')](_0x7913('0x81'),_0x392ff9[_0x7913('0x61')]['id'],_0x392ff9[_0x7913('0x61')]['name'],_0x392ff9[_0x7913('0x61')][_0x7913('0x82')],_0x5891b1['interaction']['id'],_0x392ff9[_0x7913('0x58')]?JSON['stringify'](_0x392ff9[_0x7913('0x58')]):_0x7913('0x6c'));return respondWithRpcPromise(_0x7913('0x83'),_0x7913('0x84'),_0x5891b1);}return null;})['then'](function(_0x49472f){var _0x321038=_0x7913('0x6f')+_0x49472f['message'][_0x7913('0x70')];return db[_0x7913('0x85')][_0x7913('0x41')](_0x321038,{'type':db[_0x7913('0x71')][_0x7913('0x72')]['SELECT'],'raw':!![]})['then'](function(_0x4bbf9e){return _0x4bbf9e;});})[_0x7913('0x1d')](function(_0x8c0666){if(_0x8c0666){_0x5891b1[_0x7913('0x26')][_0x7913('0x74')]=_0x8c0666[0x0];if(!_0x392ff9[_0x7913('0x58')]['UserId'])return;return db[_0x7913('0x75')][_0x7913('0x56')]({'where':{'id':_0x392ff9[_0x7913('0x58')]['UserId'],'role':_0x7913('0x62')},'attributes':['id',_0x7913('0x37'),'fullname',_0x7913('0x77'),_0x7913('0x78')],'raw':!![]});}return null;})[_0x7913('0x1d')](function(_0x1bc149){if(!_0x1bc149)return null;_0x5891b1['message'][_0x7913('0x62')]=_0x1bc149;return _0x5891b1;})[_0x7913('0x1d')](function(_0x4ab561){if(_0x4ab561){_0x4ab561[_0x7913('0x26')][_0x7913('0x7a')]=util[_0x7913('0x60')](_0x7913('0x7b'),_0x392ff9[_0x7913('0x61')]['name']);_0x4ab561[_0x7913('0x26')][_0x7913('0x7c')]=_0x5891b1[_0x7913('0x7c')];_0x4ab561['message'][_0x7913('0x86')]=_0x5891b1[_0x7913('0x7c')];_0x4ab561[_0x7913('0x26')]['event']='reject';respondWithRpcPromise(_0x7913('0x7e'),_0x7913('0x7e'),{'event':_0x7913('0x87'),'message':_0x4ab561[_0x7913('0x26')]},client9002);return _0x5891b1;}return null;})[_0x7913('0x1d')](respondWithResult(_0x1f86f5,null))[_0x7913('0x28')](handleError(_0x1f86f5,null));}; \ No newline at end of file +var _0xbf4e=['../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','offset','order','sort','filters','filter','where','merge','VIRTUAL','options','OpenchannelMessage','includeAll','findAll','rows','show','params','keys','include','body','find','describe','accept','read','format','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','info','[OPENCHANNELMESSAGE: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','QueryTypes','SELECT','contact','User','fullname','internal','channel','motionChannel','event','EventManager','openchannel-interactions','openchannel','role','rejectMessage','Sequelize','email','SIP/%s','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','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'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xbf4e,0x172));var _0xebf4=function(_0x7d9d28,_0x139d3f){_0x7d9d28=_0x7d9d28-0x0;var _0x9b00b0=_0xbf4e[_0x7d9d28];return _0x9b00b0;};'use strict';var emlformat=require(_0xebf4('0x0'));var rimraf=require(_0xebf4('0x1'));var zipdir=require(_0xebf4('0x2'));var jsonpatch=require(_0xebf4('0x3'));var rp=require(_0xebf4('0x4'));var moment=require(_0xebf4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xebf4('0x6'));var util=require('util');var path=require('path');var sox=require(_0xebf4('0x7'));var csv=require(_0xebf4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xebf4('0x9'));var _=require(_0xebf4('0xa'));var squel=require(_0xebf4('0xb'));var crypto=require('crypto');var jsforce=require(_0xebf4('0xc'));var deskjs=require(_0xebf4('0xd'));var toCsv=require(_0xebf4('0x8'));var querystring=require(_0xebf4('0xe'));var Papa=require(_0xebf4('0xf'));var Redis=require(_0xebf4('0x10'));var authService=require(_0xebf4('0x11'));var qs=require(_0xebf4('0x12'));var as=require(_0xebf4('0x13'));var hardwareService=require(_0xebf4('0x14'));var logger=require(_0xebf4('0x15'))(_0xebf4('0x16'));var utils=require(_0xebf4('0x17'));var config=require(_0xebf4('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xebf4('0x19'))['db'];config[_0xebf4('0x1a')]=_[_0xebf4('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xebf4('0x1c'))(new Redis(config[_0xebf4('0x1a')]));require(_0xebf4('0x1d'))[_0xebf4('0x1e')](socket);var jayson=require(_0xebf4('0x1f'));var client=jayson[_0xebf4('0x20')][_0xebf4('0x21')]({'port':0x232c});var client9002=jayson[_0xebf4('0x20')][_0xebf4('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x313880,_0x14c06d,_0xb5805f,_0x432fd8){return new BPromise(function(_0x2b0259,_0x2205c4){var _0x43cd50=_0x432fd8||client;return _0x43cd50[_0xebf4('0x22')](_0x313880,_0xb5805f)[_0xebf4('0x23')](function(_0x5e1b61){logger['info'](_0xebf4('0x24'),_0x14c06d,_0xebf4('0x25'));logger[_0xebf4('0x26')](_0xebf4('0x27'),_0x14c06d,_0xebf4('0x25'),JSON[_0xebf4('0x28')](_0x5e1b61));if(_0x5e1b61[_0xebf4('0x29')]){if(_0x5e1b61[_0xebf4('0x29')][_0xebf4('0x2a')]===0x1f4){logger['error'](_0xebf4('0x24'),_0x14c06d,_0x5e1b61[_0xebf4('0x29')][_0xebf4('0x2b')]);return _0x2205c4(_0x5e1b61[_0xebf4('0x29')][_0xebf4('0x2b')]);}logger[_0xebf4('0x29')](_0xebf4('0x24'),_0x14c06d,_0x5e1b61['error'][_0xebf4('0x2b')]);return _0x2b0259(_0x5e1b61[_0xebf4('0x29')]['message']);}else{logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x14c06d,'request\x20sent');_0x2b0259(_0x5e1b61[_0xebf4('0x2c')][_0xebf4('0x2b')]);}})[_0xebf4('0x2d')](function(_0x31c070){logger[_0xebf4('0x29')](_0xebf4('0x24'),_0x14c06d,_0x31c070);_0x2205c4(_0x31c070);});});}function respondWithStatusCode(_0x3488e4,_0x11ca94){_0x11ca94=_0x11ca94||0xcc;return function(_0x504349){if(_0x504349){return _0x3488e4[_0xebf4('0x2e')](_0x11ca94);}return _0x3488e4['status'](_0x11ca94)[_0xebf4('0x2f')]();};}function respondWithResult(_0x919571,_0x534272){_0x534272=_0x534272||0xc8;return function(_0x327ea9){if(_0x327ea9){return _0x919571[_0xebf4('0x30')](_0x534272)['json'](_0x327ea9);}};}function respondWithFilteredResult(_0x64293d,_0x484305){return function(_0xd33862){if(_0xd33862){var _0x3632c9=typeof _0x484305['offset']===_0xebf4('0x31')&&typeof _0x484305['limit']==='undefined';var _0x565349=_0xd33862[_0xebf4('0x32')];var _0x329804=_0x3632c9?0x0:_0x484305['offset'];var _0x416b66=_0x3632c9?_0xd33862[_0xebf4('0x32')]:_0x484305['offset']+_0x484305[_0xebf4('0x33')];var _0xdb7921;if(_0x416b66>=_0x565349){_0x416b66=_0x565349;_0xdb7921=0xc8;}else{_0xdb7921=0xce;}_0x64293d[_0xebf4('0x30')](_0xdb7921);return _0x64293d[_0xebf4('0x34')](_0xebf4('0x35'),_0x329804+'-'+_0x416b66+'/'+_0x565349)['json'](_0xd33862);}return null;};}function patchUpdates(_0x1580ea){return function(_0x3ee843){try{jsonpatch[_0xebf4('0x36')](_0x3ee843,_0x1580ea,!![]);}catch(_0x9520a2){return BPromise[_0xebf4('0x37')](_0x9520a2);}return _0x3ee843[_0xebf4('0x38')]();};}function saveUpdates(_0x154e1a,_0x1e253d){return function(_0x55e690){if(_0x55e690){return _0x55e690[_0xebf4('0x39')](_0x154e1a)[_0xebf4('0x23')](function(_0x63a89){return _0x63a89;});}return null;};}function removeEntity(_0x1c0f85,_0x5c0b75){return function(_0x4b2a98){if(_0x4b2a98){return _0x4b2a98[_0xebf4('0x3a')]()[_0xebf4('0x23')](function(){_0x1c0f85[_0xebf4('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e5a2c,_0x34c681){return function(_0xc3d9a6){if(!_0xc3d9a6){_0x5e5a2c['sendStatus'](0x194);}return _0xc3d9a6;};}function handleError(_0x457176,_0x53f150){_0x53f150=_0x53f150||0x1f4;return function(_0x348455){logger[_0xebf4('0x29')](_0x348455[_0xebf4('0x3b')]);if(_0x348455['name']){delete _0x348455[_0xebf4('0x3c')];}_0x457176['status'](_0x53f150)[_0xebf4('0x3d')](_0x348455);};}exports[_0xebf4('0x3e')]=function(_0x3aec22,_0xf6da9a){var _0xb6f4c8={},_0x354ab2={},_0x2e84b5={'count':0x0,'rows':[]};var _0x269afb=_[_0xebf4('0x3f')](db['OpenchannelMessage']['rawAttributes'],function(_0x2afb9c){return{'name':_0x2afb9c[_0xebf4('0x40')],'type':_0x2afb9c[_0xebf4('0x41')]['key']};});_0x354ab2[_0xebf4('0x42')]=_[_0xebf4('0x3f')](_0x269afb,'name');_0x354ab2[_0xebf4('0x43')]=_['keys'](_0x3aec22[_0xebf4('0x43')]);_0x354ab2['filters']=_['intersection'](_0x354ab2['model'],_0x354ab2['query']);_0xb6f4c8['attributes']=_[_0xebf4('0x44')](_0x354ab2['model'],qs[_0xebf4('0x45')](_0x3aec22['query'][_0xebf4('0x45')]));_0xb6f4c8['attributes']=_0xb6f4c8[_0xebf4('0x46')][_0xebf4('0x47')]?_0xb6f4c8['attributes']:_0x354ab2['model'];if(!_0x3aec22[_0xebf4('0x43')][_0xebf4('0x48')]('nolimit')){_0xb6f4c8[_0xebf4('0x33')]=qs[_0xebf4('0x33')](_0x3aec22['query'][_0xebf4('0x33')]);_0xb6f4c8[_0xebf4('0x49')]=qs[_0xebf4('0x49')](_0x3aec22[_0xebf4('0x43')][_0xebf4('0x49')]);}_0xb6f4c8[_0xebf4('0x4a')]=qs[_0xebf4('0x4b')](_0x3aec22[_0xebf4('0x43')][_0xebf4('0x4b')]);_0xb6f4c8['where']=qs[_0xebf4('0x4c')](_['pick'](_0x3aec22[_0xebf4('0x43')],_0x354ab2['filters']),_0x269afb);if(_0x3aec22[_0xebf4('0x43')][_0xebf4('0x4d')]){_0xb6f4c8[_0xebf4('0x4e')]=_[_0xebf4('0x4f')](_0xb6f4c8[_0xebf4('0x4e')],{'$or':_[_0xebf4('0x3f')](_0x269afb,function(_0x68a3a2){if(_0x68a3a2['type']!==_0xebf4('0x50')){var _0x4adf3c={};_0x4adf3c[_0x68a3a2[_0xebf4('0x3c')]]={'$like':'%'+_0x3aec22['query'][_0xebf4('0x4d')]+'%'};return _0x4adf3c;}})});}_0xb6f4c8=_[_0xebf4('0x4f')]({},_0xb6f4c8,_0x3aec22[_0xebf4('0x51')]);var _0x1b1898={'where':_0xb6f4c8[_0xebf4('0x4e')]};return db[_0xebf4('0x52')][_0xebf4('0x32')](_0x1b1898)[_0xebf4('0x23')](function(_0x4a8137){_0x2e84b5[_0xebf4('0x32')]=_0x4a8137;if(_0x3aec22['query'][_0xebf4('0x53')]){_0xb6f4c8['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0xebf4('0x54')](_0xb6f4c8);})[_0xebf4('0x23')](function(_0x42c7c4){_0x2e84b5[_0xebf4('0x55')]=_0x42c7c4;return _0x2e84b5;})['then'](respondWithFilteredResult(_0xf6da9a,_0xb6f4c8))[_0xebf4('0x2d')](handleError(_0xf6da9a,null));};exports[_0xebf4('0x56')]=function(_0x5a6483,_0x59689c){var _0x50ac8f={'raw':!![],'where':{'id':_0x5a6483[_0xebf4('0x57')]['id']}},_0x178c8e={};_0x178c8e['model']=_[_0xebf4('0x58')](db['OpenchannelMessage']['rawAttributes']);_0x178c8e[_0xebf4('0x43')]=_[_0xebf4('0x58')](_0x5a6483[_0xebf4('0x43')]);_0x178c8e[_0xebf4('0x4c')]=_[_0xebf4('0x44')](_0x178c8e['model'],_0x178c8e[_0xebf4('0x43')]);_0x50ac8f[_0xebf4('0x46')]=_[_0xebf4('0x44')](_0x178c8e['model'],qs['fields'](_0x5a6483[_0xebf4('0x43')]['fields']));_0x50ac8f['attributes']=_0x50ac8f[_0xebf4('0x46')][_0xebf4('0x47')]?_0x50ac8f[_0xebf4('0x46')]:_0x178c8e[_0xebf4('0x42')];if(_0x5a6483[_0xebf4('0x43')][_0xebf4('0x53')]){_0x50ac8f[_0xebf4('0x59')]=[{'all':!![]}];}_0x50ac8f=_[_0xebf4('0x4f')]({},_0x50ac8f,_0x5a6483[_0xebf4('0x51')]);return db[_0xebf4('0x52')]['find'](_0x50ac8f)[_0xebf4('0x23')](handleEntityNotFound(_0x59689c,null))['then'](respondWithResult(_0x59689c,null))[_0xebf4('0x2d')](handleError(_0x59689c,null));};exports['create']=function(_0x49f9c9,_0x46843a){return db['OpenchannelMessage']['create'](_0x49f9c9['body'],{})['then'](respondWithResult(_0x46843a,0xc9))[_0xebf4('0x2d')](handleError(_0x46843a,null));};exports[_0xebf4('0x39')]=function(_0x36b5a7,_0x4da0da){if(_0x36b5a7[_0xebf4('0x5a')]['id']){delete _0x36b5a7[_0xebf4('0x5a')]['id'];}return db[_0xebf4('0x52')][_0xebf4('0x5b')]({'where':{'id':_0x36b5a7[_0xebf4('0x57')]['id']}})[_0xebf4('0x23')](handleEntityNotFound(_0x4da0da,null))['then'](saveUpdates(_0x36b5a7[_0xebf4('0x5a')],null))[_0xebf4('0x23')](respondWithResult(_0x4da0da,null))[_0xebf4('0x2d')](handleError(_0x4da0da,null));};exports[_0xebf4('0x3a')]=function(_0x21d341,_0x28e90e){return db[_0xebf4('0x52')][_0xebf4('0x5b')]({'where':{'id':_0x21d341['params']['id']}})[_0xebf4('0x23')](handleEntityNotFound(_0x28e90e,null))[_0xebf4('0x23')](removeEntity(_0x28e90e,null))[_0xebf4('0x2d')](handleError(_0x28e90e,null));};exports['describe']=function(_0x180408,_0x18394f){return db[_0xebf4('0x52')][_0xebf4('0x5c')]()['then'](respondWithResult(_0x18394f,null))['catch'](handleError(_0x18394f,null));};var interaction_log=require(_0xebf4('0x15'))('openchannel-interactions');exports[_0xebf4('0x5d')]=function(_0x2bea17,_0x34b405,_0x18f7b4){var _0x2ba5a9={'agent':{},'channel':'openchannel'};if(_0x2bea17['body']['id']){delete _0x2bea17['body']['id'];}_0x2bea17[_0xebf4('0x5a')][_0xebf4('0x5e')]=!![];_0x2bea17[_0xebf4('0x5a')]['readAt']=moment()[_0xebf4('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x2bea17['body'][_0xebf4('0x60')]=_0x2bea17[_0xebf4('0x5a')]['UserId']||_0x2bea17[_0xebf4('0x61')]['id'];_0x2ba5a9[_0xebf4('0x62')]['id']=_0x2bea17[_0xebf4('0x5a')]['UserId'];return db[_0xebf4('0x52')][_0xebf4('0x5b')]({'where':{'id':_0x2bea17[_0xebf4('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x34b405,null))[_0xebf4('0x23')](saveUpdates(_0x2bea17[_0xebf4('0x5a')],null))['then'](function(_0x2947c1){if(_0x2947c1){_0x2ba5a9[_0xebf4('0x2b')]=_0x2947c1[_0xebf4('0x63')]({'plain':!![]});return db[_0xebf4('0x64')][_0xebf4('0x5b')]({'where':{'id':_0x2947c1[_0xebf4('0x65')]}});}return null;})[_0xebf4('0x23')](handleEntityNotFound(_0x34b405,null))['then'](function(_0x13f3a2){if(_0x13f3a2){return _0x13f3a2[_0xebf4('0x39')]({'UserId':_0x2bea17[_0xebf4('0x5a')][_0xebf4('0x60')],'read1stAt':_[_0xebf4('0x66')](_0x13f3a2[_0xebf4('0x67')])?moment()[_0xebf4('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xebf4('0x23')](function(_0x59063e){if(_0x59063e){_0x2ba5a9[_0xebf4('0x68')]=_0x59063e[_0xebf4('0x63')]({'plain':!![]});interaction_log[_0xebf4('0x69')](_0xebf4('0x6a'),_0x2bea17[_0xebf4('0x61')]['id'],_0x2bea17['user']['name'],_0x2bea17[_0xebf4('0x61')]['role'],_0x2ba5a9[_0xebf4('0x68')]['id'],_0x2bea17['body']?JSON[_0xebf4('0x28')](_0x2bea17[_0xebf4('0x5a')]):_0xebf4('0x6b'));return respondWithRpcPromise(_0xebf4('0x6c'),_0xebf4('0x6d'),_0x2ba5a9);}return null;})['then'](function(_0x1e42b5){var _0x5e2ea7=_0xebf4('0x6e')+_0x1e42b5['message'][_0xebf4('0x6f')];return db[_0xebf4('0x70')][_0xebf4('0x43')](_0x5e2ea7,{'type':db['Sequelize'][_0xebf4('0x71')][_0xebf4('0x72')],'raw':!![]})[_0xebf4('0x23')](function(_0x9f290a){return _0x9f290a;});})[_0xebf4('0x23')](function(_0x3f8c09){if(_0x3f8c09){_0x2ba5a9['message'][_0xebf4('0x73')]=_0x3f8c09[0x0];if(!_0x2bea17['body'][_0xebf4('0x60')])return;return db[_0xebf4('0x74')][_0xebf4('0x5b')]({'where':{'id':_0x2bea17[_0xebf4('0x5a')][_0xebf4('0x60')],'role':_0xebf4('0x62')},'attributes':['id',_0xebf4('0x3c'),_0xebf4('0x75'),'email',_0xebf4('0x76')],'raw':!![]});}return null;})[_0xebf4('0x23')](function(_0x30f719){if(!_0x30f719)return null;_0x2ba5a9['message']['agent']=_0x30f719;return _0x2ba5a9;})[_0xebf4('0x23')](function(_0x2cbf35){if(_0x2cbf35){if(_0x2bea17[_0xebf4('0x5a')]['manual']){_0x2ba5a9[_0xebf4('0x2b')]['interface']=util[_0xebf4('0x5f')]('SIP/%s',_0x2bea17[_0xebf4('0x61')][_0xebf4('0x3c')]);_0x2ba5a9[_0xebf4('0x2b')][_0xebf4('0x77')]=_0x2ba5a9['channel'];_0x2ba5a9[_0xebf4('0x2b')][_0xebf4('0x78')]=_0x2ba5a9[_0xebf4('0x77')];_0x2ba5a9[_0xebf4('0x2b')][_0xebf4('0x79')]=_0xebf4('0x5d');return respondWithRpcPromise(_0xebf4('0x7a'),_0xebf4('0x7a'),{'event':'acceptmessage','message':_0x2ba5a9[_0xebf4('0x2b')]},client9002)[_0xebf4('0x23')](function(){return _0x2ba5a9;});}return _0x2ba5a9;}return null;})[_0xebf4('0x23')](respondWithResult(_0x34b405,null))[_0xebf4('0x2d')](handleError(_0x34b405,null));};var interaction_log=require(_0xebf4('0x15'))(_0xebf4('0x7b'));exports[_0xebf4('0x37')]=function(_0x23942c,_0x7c03c7,_0x208e96){var _0xe9da5b={'agent':{},'channel':_0xebf4('0x7c')};if(_0x23942c[_0xebf4('0x5a')]['id']){delete _0x23942c[_0xebf4('0x5a')]['id'];}_0x23942c[_0xebf4('0x5a')][_0xebf4('0x60')]=_0x23942c['body'][_0xebf4('0x60')]||_0x23942c[_0xebf4('0x61')]['id'];_0xe9da5b[_0xebf4('0x62')]['id']=_0x23942c[_0xebf4('0x5a')][_0xebf4('0x60')];return db[_0xebf4('0x52')]['find']({'where':{'id':_0x23942c[_0xebf4('0x57')]['id'],'UserId':null}})[_0xebf4('0x23')](handleEntityNotFound(_0x7c03c7,null))[_0xebf4('0x23')](function(_0x12056d){if(_0x12056d){_0xe9da5b[_0xebf4('0x2b')]=_0x12056d[_0xebf4('0x63')]({'plain':!![]});return db[_0xebf4('0x64')][_0xebf4('0x5b')]({'where':{'id':_0x12056d[_0xebf4('0x65')]}});}return null;})[_0xebf4('0x23')](handleEntityNotFound(_0x7c03c7,null))['then'](function(_0x5af7a4){if(_0x5af7a4){_0xe9da5b[_0xebf4('0x68')]=_0x5af7a4[_0xebf4('0x63')]({'plain':!![]});interaction_log[_0xebf4('0x69')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x23942c[_0xebf4('0x61')]['id'],_0x23942c['user']['name'],_0x23942c[_0xebf4('0x61')][_0xebf4('0x7d')],_0xe9da5b[_0xebf4('0x68')]['id'],_0x23942c[_0xebf4('0x5a')]?JSON[_0xebf4('0x28')](_0x23942c[_0xebf4('0x5a')]):_0xebf4('0x6b'));return respondWithRpcPromise('RejectMessage',_0xebf4('0x7e'),_0xe9da5b);}return null;})[_0xebf4('0x23')](function(_0x41cee5){var _0x22b68b=_0xebf4('0x6e')+_0x41cee5['message'][_0xebf4('0x6f')];return db[_0xebf4('0x70')][_0xebf4('0x43')](_0x22b68b,{'type':db[_0xebf4('0x7f')]['QueryTypes'][_0xebf4('0x72')],'raw':!![]})[_0xebf4('0x23')](function(_0x226266){return _0x226266;});})[_0xebf4('0x23')](function(_0x46a5c9){if(_0x46a5c9){_0xe9da5b[_0xebf4('0x2b')][_0xebf4('0x73')]=_0x46a5c9[0x0];if(!_0x23942c[_0xebf4('0x5a')][_0xebf4('0x60')])return;return db[_0xebf4('0x74')][_0xebf4('0x5b')]({'where':{'id':_0x23942c[_0xebf4('0x5a')][_0xebf4('0x60')],'role':'agent'},'attributes':['id',_0xebf4('0x3c'),_0xebf4('0x75'),_0xebf4('0x80'),'internal'],'raw':!![]});}return null;})[_0xebf4('0x23')](function(_0x1753a6){if(!_0x1753a6)return null;_0xe9da5b['message']['agent']=_0x1753a6;return _0xe9da5b;})['then'](function(_0x5ea2a6){if(_0x5ea2a6){_0x5ea2a6[_0xebf4('0x2b')]['interface']=util['format'](_0xebf4('0x81'),_0x23942c[_0xebf4('0x61')][_0xebf4('0x3c')]);_0x5ea2a6[_0xebf4('0x2b')][_0xebf4('0x77')]=_0xe9da5b[_0xebf4('0x77')];_0x5ea2a6[_0xebf4('0x2b')][_0xebf4('0x78')]=_0xe9da5b['channel'];_0x5ea2a6[_0xebf4('0x2b')][_0xebf4('0x79')]=_0xebf4('0x37');respondWithRpcPromise(_0xebf4('0x7a'),_0xebf4('0x7a'),{'event':_0xebf4('0x82'),'message':_0x5ea2a6[_0xebf4('0x2b')]},client9002);return _0xe9da5b;}return null;})[_0xebf4('0x23')](respondWithResult(_0x7c03c7,null))[_0xebf4('0x2d')](handleError(_0x7c03c7,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index ef76130..2111461 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 _0xee11=['exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee11,0x19f));var _0x1ee1=function(_0x5e5ad9,_0x18845f){_0x5e5ad9=_0x5e5ad9-0x0;var _0x396036=_0xee11[_0x5e5ad9];return _0x396036;};'use strict';var EventEmitter=require(_0x1ee1('0x0'));var OpenchannelMessage=require(_0x1ee1('0x1'))['db'][_0x1ee1('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x1ee1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1ee1('0x4'),'afterDestroy':_0x1ee1('0x5')};function emitEvent(_0x39776f){return function(_0x20a3bc,_0x5416e4,_0x1a46da){OpenchannelMessageEvents[_0x1ee1('0x6')](_0x39776f+':'+_0x20a3bc['id'],_0x20a3bc);OpenchannelMessageEvents['emit'](_0x39776f,_0x20a3bc);_0x1a46da(null);};}for(var e in events){if(events[_0x1ee1('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x1ee1('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xa119=['setMaxListeners','save','update','remove','emit','exports','events','OpenchannelMessage'];(function(_0x102d89,_0x3388b9){var _0x24eb37=function(_0xeffb8d){while(--_0xeffb8d){_0x102d89['push'](_0x102d89['shift']());}};_0x24eb37(++_0x3388b9);}(_0xa119,0x17e));var _0x9a11=function(_0x3a07ee,_0x2649a5){_0x3a07ee=_0x3a07ee-0x0;var _0x42fbb1=_0xa119[_0x3a07ee];return _0x42fbb1;};'use strict';var EventEmitter=require(_0x9a11('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x9a11('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x9a11('0x2')](0x0);var events={'afterCreate':_0x9a11('0x3'),'afterUpdate':_0x9a11('0x4'),'afterDestroy':_0x9a11('0x5')};function emitEvent(_0x10637a){return function(_0xa80d14,_0x3b8e48,_0x14ed99){OpenchannelMessageEvents['emit'](_0x10637a+':'+_0xa80d14['id'],_0xa80d14);OpenchannelMessageEvents[_0x9a11('0x6')](_0x10637a,_0xa80d14);_0x14ed99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x9a11('0x7')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 8917e21..e6c3687 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 _0x5c3c=['Forwarding\x20message\x20%d\x20to\x20%s','omit','Contact','method','GET','POST','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','fti_openchannel_messages','body','models','get','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','update','createdAt','catch','error','describe','OpenchannelAccount','find','Interactions','CmContact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format'];(function(_0x546ac5,_0x4e6058){var _0x12ed69=function(_0xb5ff3){while(--_0xb5ff3){_0x546ac5['push'](_0x546ac5['shift']());}};_0x12ed69(++_0x4e6058);}(_0x5c3c,0x132));var _0xc5c3=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5c3c[_0x173441];return _0x2423a8;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var logger=require(_0xc5c3('0x2'))(_0xc5c3('0x3'));var moment=require('moment');var BPromise=require(_0xc5c3('0x4'));var rp=require(_0xc5c3('0x5'));var fs=require('fs');var path=require(_0xc5c3('0x6'));var rimraf=require(_0xc5c3('0x7'));var config=require(_0xc5c3('0x8'));var attributes=require(_0xc5c3('0x9'));module[_0xc5c3('0xa')]=function(_0x23a6b5,_0x28bdd9){return _0x23a6b5['define']('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xc5c3('0xb'),'fields':[_0xc5c3('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x110b89,_0x46e2c1,_0x52f3eb){var _0x14140f=_0x23a6b5[_0xc5c3('0xd')];var _0x4e329f=_0x110b89[_0xc5c3('0xe')]({'plain':!![]});if(_0x4e329f[_0xc5c3('0xf')][_0xc5c3('0x10')]()==='in'||_0x4e329f['direction'][_0xc5c3('0x10')]()===_0xc5c3('0x11')&&!_0x4e329f['secret']&&!_[_0xc5c3('0x12')](_0x4e329f[_0xc5c3('0x13')])){_0x14140f[_0xc5c3('0x14')]['findOne']({'where':{'id':_0x4e329f[_0xc5c3('0x15')]}})[_0xc5c3('0x16')](function(_0x1488ab){if(_0x1488ab){_0x1488ab[_0xc5c3('0x17')]({'lastMsgAt':_0x4e329f[_0xc5c3('0x18')],'lastMsgDirection':_0x4e329f['direction']['toLowerCase']()});}})[_0xc5c3('0x19')](function(_0x577e1a){console[_0xc5c3('0x1a')](_0x577e1a);});}if(_0x4e329f[_0xc5c3('0xf')]==='out'&&!_0x4e329f['secret']){var _0x467ba9;_0x14140f['CmContact'][_0xc5c3('0x1b')]()[_0xc5c3('0x16')](function(_0x2ff158){return _0x14140f[_0xc5c3('0x1c')][_0xc5c3('0x1d')]({'where':{'id':_0x4e329f['OpenchannelAccountId']},'include':[{'model':_0x14140f[_0xc5c3('0x14')],'as':_0xc5c3('0x1e'),'where':{'id':_0x4e329f[_0xc5c3('0x15')]},'limit':0x1,'include':[{'model':_0x14140f[_0xc5c3('0x1f')],'as':'Contact','attributes':_[_0xc5c3('0x20')](_0x2ff158)}]}]});})[_0xc5c3('0x16')](function(_0x3cc612){_0x467ba9=_0x3cc612[_0xc5c3('0xe')]({'plain':!![]});if(_0x467ba9&&_0x467ba9[_0xc5c3('0x21')]){logger['info'](_0xc5c3('0x22'),_0xc5c3('0x23'),util[_0xc5c3('0x24')](_0xc5c3('0x25'),_0x4e329f['id'],_0x467ba9[_0xc5c3('0x21')]));if(_0x467ba9[_0xc5c3('0x1e')]&&_0x467ba9[_0xc5c3('0x1e')]['length']){_0x4e329f['Interaction']=_[_0xc5c3('0x26')](_0x467ba9[_0xc5c3('0x1e')][0x0],'Contact');_0x4e329f['Contact']=_0x467ba9[_0xc5c3('0x1e')][0x0][_0xc5c3('0x27')];}var _0x46e2c1={'method':'POST','uri':encodeURI(_0x467ba9['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x46e2c1[_0xc5c3('0x28')]){case _0xc5c3('0x29'):_0x46e2c1['qs']=_0x4e329f;break;case _0xc5c3('0x2a'):_0x46e2c1[_0xc5c3('0xc')]=_0x4e329f;break;}return rp(_0x46e2c1)['then'](function(_0x21efd6){logger['info'](_0xc5c3('0x22'),'afterCreate',util[_0xc5c3('0x24')](_0xc5c3('0x2b'),_0x4e329f['id'],_0x467ba9[_0xc5c3('0x21')]));if(_0x21efd6[_0xc5c3('0xc')][_0xc5c3('0x2c')]&&_0x21efd6[_0xc5c3('0xc')][_0xc5c3('0x2c')]!=_0x4e329f['Interaction'][_0xc5c3('0x2c')]){return _0x14140f['OpenchannelInteraction'][_0xc5c3('0x17')]({'threadId':_0x21efd6[_0xc5c3('0xc')]['threadId']},{'logging':!![],'where':{'id':_0x4e329f['Interaction']['id']}});}else{return;}})[_0xc5c3('0x16')](function(){return _0x110b89[_0xc5c3('0x17')]({'read':!![]});})[_0xc5c3('0x19')](function(_0x19e482){logger['error'](_0xc5c3('0x22'),_0xc5c3('0x23'),util[_0xc5c3('0x2d')](_0x19e482,{'showHidden':![],'depth':null}));_0x52f3eb();});}else{_0x52f3eb();}})[_0xc5c3('0x2e')](function(){_0x52f3eb();});}else{_0x52f3eb();}}},'charset':_0xc5c3('0x2f'),'collate':_0xc5c3('0x30')});}; \ No newline at end of file +var _0x2032=['body','models','direction','out','secret','then','createdAt','toLowerCase','catch','error','describe','OpenchannelAccount','find','OpenchannelInteraction','OpenchannelInteractionId','CmContact','Contact','keys','replyUri','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','omit','POST','method','GET','OpenchannelMessage,\x20%s,\x20%s','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages'];(function(_0x47cce4,_0x50e878){var _0x53e939=function(_0xf2fecb){while(--_0xf2fecb){_0x47cce4['push'](_0x47cce4['shift']());}};_0x53e939(++_0x50e878);}(_0x2032,0xd9));var _0x2203=function(_0x2907e3,_0x8c2bd5){_0x2907e3=_0x2907e3-0x0;var _0x631f4=_0x2032[_0x2907e3];return _0x631f4;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var attributes=require(_0x2203('0x7'));module[_0x2203('0x8')]=function(_0x3f7ba1,_0x13367a){return _0x3f7ba1[_0x2203('0x9')](_0x2203('0xa'),attributes,{'tableName':_0x2203('0xb'),'paranoid':![],'indexes':[{'name':_0x2203('0xc'),'fields':[_0x2203('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x526ae0,_0x10f055,_0x549908){var _0x27081c=_0x3f7ba1[_0x2203('0xe')];var _0x6339c4=_0x526ae0['get']({'plain':!![]});if(_0x6339c4[_0x2203('0xf')]['toLowerCase']()==='in'||_0x6339c4[_0x2203('0xf')]['toLowerCase']()===_0x2203('0x10')&&!_0x6339c4[_0x2203('0x11')]&&!_['isNil'](_0x6339c4['UserId'])){_0x27081c['OpenchannelInteraction']['findOne']({'where':{'id':_0x6339c4['OpenchannelInteractionId']}})[_0x2203('0x12')](function(_0x538b30){if(_0x538b30){_0x538b30['update']({'lastMsgAt':_0x6339c4[_0x2203('0x13')],'lastMsgDirection':_0x6339c4[_0x2203('0xf')][_0x2203('0x14')]()});}})[_0x2203('0x15')](function(_0x226209){console[_0x2203('0x16')](_0x226209);});}if(_0x6339c4[_0x2203('0xf')]===_0x2203('0x10')&&!_0x6339c4[_0x2203('0x11')]){var _0x3053f3;_0x27081c['CmContact'][_0x2203('0x17')]()[_0x2203('0x12')](function(_0x4893ff){return _0x27081c[_0x2203('0x18')][_0x2203('0x19')]({'where':{'id':_0x6339c4['OpenchannelAccountId']},'include':[{'model':_0x27081c[_0x2203('0x1a')],'as':'Interactions','where':{'id':_0x6339c4[_0x2203('0x1b')]},'limit':0x1,'include':[{'model':_0x27081c[_0x2203('0x1c')],'as':_0x2203('0x1d'),'attributes':_[_0x2203('0x1e')](_0x4893ff)}]}]});})[_0x2203('0x12')](function(_0x449039){_0x3053f3=_0x449039['get']({'plain':!![]});if(_0x3053f3&&_0x3053f3[_0x2203('0x1f')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x2203('0x20'),util['format'](_0x2203('0x21'),_0x6339c4['id'],_0x3053f3[_0x2203('0x1f')]));if(_0x3053f3['Interactions']&&_0x3053f3[_0x2203('0x22')]['length']){_0x6339c4['Interaction']=_[_0x2203('0x23')](_0x3053f3[_0x2203('0x22')][0x0],_0x2203('0x1d'));_0x6339c4[_0x2203('0x1d')]=_0x3053f3[_0x2203('0x22')][0x0][_0x2203('0x1d')];}var _0x10f055={'method':_0x2203('0x24'),'uri':encodeURI(_0x3053f3['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x10f055[_0x2203('0x25')]){case _0x2203('0x26'):_0x10f055['qs']=_0x6339c4;break;case _0x2203('0x24'):_0x10f055['body']=_0x6339c4;break;}return rp(_0x10f055)[_0x2203('0x12')](function(_0x1cec17){logger['info'](_0x2203('0x27'),_0x2203('0x20'),util[_0x2203('0x28')](_0x2203('0x29'),_0x6339c4['id'],_0x3053f3[_0x2203('0x1f')]));if(_0x1cec17[_0x2203('0xd')][_0x2203('0x2a')]&&_0x1cec17['body'][_0x2203('0x2a')]!=_0x6339c4[_0x2203('0x2b')][_0x2203('0x2a')]){return _0x27081c[_0x2203('0x1a')]['update']({'threadId':_0x1cec17[_0x2203('0xd')][_0x2203('0x2a')]},{'logging':!![],'where':{'id':_0x6339c4[_0x2203('0x2b')]['id']}});}else{return;}})[_0x2203('0x12')](function(){return _0x526ae0['update']({'read':!![]});})[_0x2203('0x15')](function(_0x50aa17){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x2203('0x20'),util['inspect'](_0x50aa17,{'showHidden':![],'depth':null}));_0x549908();});}else{_0x549908();}})['finally'](function(){_0x549908();});}else{_0x549908();}}},'charset':_0x2203('0x2c'),'collate':_0x2203('0x2d')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index a5f21c5..84256ee 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 _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x5cbfd0,_0x38bce9){var _0x2640d4=function(_0x226176){while(--_0x226176){_0x5cbfd0['push'](_0x5cbfd0['shift']());}};_0x2640d4(++_0x38bce9);}(_0x7a54,0x106));var _0x47a5=function(_0x5886b1,_0x520bbd){_0x5886b1=_0x5886b1-0x0;var _0x32478a=_0x7a54[_0x5886b1];return _0x32478a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file +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(_0x13260f,_0x514db7){var _0x18da8e=function(_0x16a081){while(--_0x16a081){_0x13260f['push'](_0x13260f['shift']());}};_0x18da8e(++_0x514db7);}(_0xadb5,0xad));var _0x5adb=function(_0x3ef0d2,_0xdcae70){_0x3ef0d2=_0x3ef0d2-0x0;var _0x2bfc1a=_0xadb5[_0x3ef0d2];return _0x2bfc1a;};'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 0a73a9f..2c2c76c 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 _0x1c88=['openchannelMessage:','./openchannelMessage.events','remove','update','emit','removeListener','register','length'];(function(_0x14ea32,_0x262909){var _0x137bbb=function(_0x4a36ab){while(--_0x4a36ab){_0x14ea32['push'](_0x14ea32['shift']());}};_0x137bbb(++_0x262909);}(_0x1c88,0x1a9));var _0x81c8=function(_0x895358,_0x32f914){_0x895358=_0x895358-0x0;var _0x26e26e=_0x1c88[_0x895358];return _0x26e26e;};'use strict';var OpenchannelMessageEvents=require(_0x81c8('0x0'));var events=['save',_0x81c8('0x1'),_0x81c8('0x2')];function createListener(_0x8bf6db,_0x4da0d8){return function(_0x51a2f7){_0x4da0d8[_0x81c8('0x3')](_0x8bf6db,_0x51a2f7);};}function removeListener(_0x4049a1,_0x5dbe5){return function(){OpenchannelMessageEvents[_0x81c8('0x4')](_0x4049a1,_0x5dbe5);};}exports[_0x81c8('0x5')]=function(_0x3e5721){for(var _0x3f4e27=0x0,_0x182e47=events[_0x81c8('0x6')];_0x3f4e27<_0x182e47;_0x3f4e27++){var _0x2111ca=events[_0x3f4e27];var _0x191c40=createListener(_0x81c8('0x7')+_0x2111ca,_0x3e5721);OpenchannelMessageEvents['on'](_0x2111ca,_0x191c40);}}; \ No newline at end of file +var _0x749a=['openchannelMessage:','./openchannelMessage.events','save','remove','emit','register','length'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x749a,0xbe));var _0xa749=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x749a[_0x122ef9];return _0x42fba0;};'use strict';var OpenchannelMessageEvents=require(_0xa749('0x0'));var events=[_0xa749('0x1'),_0xa749('0x2'),'update'];function createListener(_0x813248,_0x4fa1db){return function(_0x3c034d){_0x4fa1db[_0xa749('0x3')](_0x813248,_0x3c034d);};}function removeListener(_0x35bc69,_0x263541){return function(){OpenchannelMessageEvents['removeListener'](_0x35bc69,_0x263541);};}exports[_0xa749('0x4')]=function(_0x334ae4){for(var _0xe73bed=0x0,_0x1d6d7c=events[_0xa749('0x5')];_0xe73bed<_0x1d6d7c;_0xe73bed++){var _0x3fc0f9=events[_0xe73bed];var _0x4ecf21=createListener(_0xa749('0x6')+_0x3fc0f9,_0x334ae4);OpenchannelMessageEvents['on'](_0x3fc0f9,_0x4ecf21);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index f58170a..881a3b9 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 _0x480a=['../../components/auth/service','./openchannelQueue.controller','get','isAuthenticated','/describe','describe','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','delete','/:id','removeTeams','removeAgents','exports','multer','util','path','express','fs-extra'];(function(_0x17529d,_0x7f21c4){var _0x35a8e0=function(_0x2ab9e6){while(--_0x2ab9e6){_0x17529d['push'](_0x17529d['shift']());}};_0x35a8e0(++_0x7f21c4);}(_0x480a,0x182));var _0xa480=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x480a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa480('0x0'));var util=require(_0xa480('0x1'));var path=require(_0xa480('0x2'));var timeout=require('connect-timeout');var express=require(_0xa480('0x3'));var router=express['Router']();var fs_extra=require(_0xa480('0x4'));var auth=require(_0xa480('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa480('0x6'));router[_0xa480('0x7')]('/',auth[_0xa480('0x8')](),controller['index']);router['get'](_0xa480('0x9'),auth[_0xa480('0x8')](),controller[_0xa480('0xa')]);router[_0xa480('0x7')]('/:id',auth[_0xa480('0x8')](),controller[_0xa480('0xb')]);router['get']('/:id/members',auth[_0xa480('0x8')](),controller[_0xa480('0xc')]);router[_0xa480('0x7')](_0xa480('0xd'),auth['isAuthenticated'](),controller[_0xa480('0xe')]);router[_0xa480('0x7')](_0xa480('0xf'),auth[_0xa480('0x8')](),controller[_0xa480('0x10')]);router['post']('/',auth[_0xa480('0x8')](),controller['create']);router[_0xa480('0x11')]('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0xa480('0x11')](_0xa480('0xf'),auth['isAuthenticated'](),controller['addAgents']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xa480('0x12')](_0xa480('0x13'),auth[_0xa480('0x8')](),controller['destroy']);router[_0xa480('0x12')](_0xa480('0xd'),auth[_0xa480('0x8')](),controller[_0xa480('0x14')]);router['delete'](_0xa480('0xf'),auth[_0xa480('0x8')](),controller[_0xa480('0x15')]);module[_0xa480('0x16')]=router; \ No newline at end of file +var _0x961f=['removeAgents','exports','multer','util','../../components/auth/service','./openchannelQueue.controller','get','isAuthenticated','index','/describe','/:id','show','getMembers','getTeams','getAgents','post','create','/:id/users','addAgents','put','update','delete','destroy','/:id/teams','removeTeams'];(function(_0x626e85,_0xd9be0b){var _0x2334f1=function(_0xc860bd){while(--_0xc860bd){_0x626e85['push'](_0x626e85['shift']());}};_0x2334f1(++_0xd9be0b);}(_0x961f,0x147));var _0xf961=function(_0x28dd1a,_0x48ecb3){_0x28dd1a=_0x28dd1a-0x0;var _0x18d911=_0x961f[_0x28dd1a];return _0x18d911;};'use strict';var multer=require(_0xf961('0x0'));var util=require(_0xf961('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf961('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf961('0x3'));router[_0xf961('0x4')]('/',auth[_0xf961('0x5')](),controller[_0xf961('0x6')]);router[_0xf961('0x4')](_0xf961('0x7'),auth[_0xf961('0x5')](),controller['describe']);router[_0xf961('0x4')](_0xf961('0x8'),auth[_0xf961('0x5')](),controller[_0xf961('0x9')]);router[_0xf961('0x4')]('/:id/members',auth[_0xf961('0x5')](),controller[_0xf961('0xa')]);router[_0xf961('0x4')]('/:id/teams',auth[_0xf961('0x5')](),controller[_0xf961('0xb')]);router['get']('/:id/users',auth[_0xf961('0x5')](),controller[_0xf961('0xc')]);router[_0xf961('0xd')]('/',auth['isAuthenticated'](),controller[_0xf961('0xe')]);router[_0xf961('0xd')]('/:id/teams',auth[_0xf961('0x5')](),controller['addTeams']);router[_0xf961('0xd')](_0xf961('0xf'),auth[_0xf961('0x5')](),controller[_0xf961('0x10')]);router[_0xf961('0x11')](_0xf961('0x8'),auth['isAuthenticated'](),controller[_0xf961('0x12')]);router[_0xf961('0x13')]('/:id',auth[_0xf961('0x5')](),controller[_0xf961('0x14')]);router['delete'](_0xf961('0x15'),auth[_0xf961('0x5')](),controller[_0xf961('0x16')]);router[_0xf961('0x13')](_0xf961('0xf'),auth['isAuthenticated'](),controller[_0xf961('0x17')]);module[_0xf961('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 9c50175..dce864d 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 _0x89e7=['INTEGER','ENUM','rrmemory','roundrobin','sequelize','STRING','name'];(function(_0x47ae2d,_0x103157){var _0x16b032=function(_0x5961e9){while(--_0x5961e9){_0x47ae2d['push'](_0x47ae2d['shift']());}};_0x16b032(++_0x103157);}(_0x89e7,0x107));var _0x789e=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x89e7[_0x5d2803];return _0xdcad2c;};'use strict';var Sequelize=require(_0x789e('0x0'));module['exports']={'name':{'type':Sequelize[_0x789e('0x1')],'unique':_0x789e('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x789e('0x1')]},'timeout':{'type':Sequelize[_0x789e('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x789e('0x4')](_0x789e('0x5'),'beepall',_0x789e('0x6'))}}; \ No newline at end of file +var _0x40db=['STRING','ENUM','roundrobin','sequelize','exports'];(function(_0xb5c06e,_0x49cb99){var _0xe76bde=function(_0x12ed89){while(--_0x12ed89){_0xb5c06e['push'](_0xb5c06e['shift']());}};_0xe76bde(++_0x49cb99);}(_0x40db,0x193));var _0xb40d=function(_0x2c2c7c,_0x516e0d){_0x2c2c7c=_0x2c2c7c-0x0;var _0x20bef6=_0x40db[_0x2c2c7c];return _0x20bef6;};'use strict';var Sequelize=require(_0xb40d('0x0'));module[_0xb40d('0x1')]={'name':{'type':Sequelize[_0xb40d('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb40d('0x3')]('rrmemory','beepall',_0xb40d('0x4'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 4aa093f..37cca1d 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 _0xd6ef=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','./openchannelQueue.socket','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','OpenchannelQueues','UserProfileResource','then','end','sendStatus','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','OpenchannelQueue','findAll','rows','params','includeAll','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','format','%s/%s','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','clone','push','QueryTypes','SELECT','TeamId','includes','union','compact','value','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','addAgents','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x272ed4,_0x3db871){var _0x5775e3=function(_0x30a65e){while(--_0x30a65e){_0x272ed4['push'](_0x272ed4['shift']());}};_0x5775e3(++_0x3db871);}(_0xd6ef,0x102));var _0xfd6e=function(_0xe928a4,_0x774593){_0xe928a4=_0xe928a4-0x0;var _0x4b4016=_0xd6ef[_0xe928a4];return _0x4b4016;};'use strict';var emlformat=require(_0xfd6e('0x0'));var rimraf=require(_0xfd6e('0x1'));var zipdir=require(_0xfd6e('0x2'));var jsonpatch=require(_0xfd6e('0x3'));var rp=require('request-promise');var moment=require(_0xfd6e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfd6e('0x5'));var util=require(_0xfd6e('0x6'));var path=require(_0xfd6e('0x7'));var sox=require(_0xfd6e('0x8'));var csv=require(_0xfd6e('0x9'));var ejs=require(_0xfd6e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfd6e('0xb'));var squel=require(_0xfd6e('0xc'));var crypto=require(_0xfd6e('0xd'));var jsforce=require(_0xfd6e('0xe'));var deskjs=require(_0xfd6e('0xf'));var toCsv=require(_0xfd6e('0x9'));var querystring=require(_0xfd6e('0x10'));var Papa=require(_0xfd6e('0x11'));var Redis=require(_0xfd6e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xfd6e('0x13'));var as=require(_0xfd6e('0x14'));var hardwareService=require(_0xfd6e('0x15'));var logger=require(_0xfd6e('0x16'))(_0xfd6e('0x17'));var utils=require(_0xfd6e('0x18'));var config=require(_0xfd6e('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xfd6e('0x1a'))['db'];config['redis']=_['defaults'](config[_0xfd6e('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfd6e('0x1b')]));require(_0xfd6e('0x1c'))['register'](socket);function respondWithStatusCode(_0x212986,_0xa0932b){_0xa0932b=_0xa0932b||0xcc;return function(_0xcc8f39){if(_0xcc8f39){return _0x212986['sendStatus'](_0xa0932b);}return _0x212986[_0xfd6e('0x1d')](_0xa0932b)['end']();};}function respondWithResult(_0x44a05a,_0x453096){_0x453096=_0x453096||0xc8;return function(_0x54f723){if(_0x54f723){return _0x44a05a['status'](_0x453096)[_0xfd6e('0x1e')](_0x54f723);}};}function respondWithFilteredResult(_0x5e79f1,_0x142b96){return function(_0xee74da){if(_0xee74da){var _0x522321=typeof _0x142b96[_0xfd6e('0x1f')]==='undefined'&&typeof _0x142b96[_0xfd6e('0x20')]===_0xfd6e('0x21');var _0x37f0e0=_0xee74da[_0xfd6e('0x22')];var _0x2fa69d=_0x522321?0x0:_0x142b96['offset'];var _0x36adcd=_0x522321?_0xee74da[_0xfd6e('0x22')]:_0x142b96['offset']+_0x142b96[_0xfd6e('0x20')];var _0x1973e1;if(_0x36adcd>=_0x37f0e0){_0x36adcd=_0x37f0e0;_0x1973e1=0xc8;}else{_0x1973e1=0xce;}_0x5e79f1[_0xfd6e('0x1d')](_0x1973e1);return _0x5e79f1[_0xfd6e('0x23')](_0xfd6e('0x24'),_0x2fa69d+'-'+_0x36adcd+'/'+_0x37f0e0)[_0xfd6e('0x1e')](_0xee74da);}return null;};}function patchUpdates(_0x2ca72f){return function(_0x161b38){try{jsonpatch[_0xfd6e('0x25')](_0x161b38,_0x2ca72f,!![]);}catch(_0xdf11ed){return BPromise[_0xfd6e('0x26')](_0xdf11ed);}return _0x161b38['save']();};}function saveUpdates(_0x246879,_0x833332){return function(_0x4d138c){if(_0x4d138c){return _0x4d138c[_0xfd6e('0x27')](_0x246879)['then'](function(_0xccef6e){return _0xccef6e;});}return null;};}function removeEntity(_0xb247f8,_0x575ab8){return function(_0x44d8e7){if(_0x44d8e7){return _0x44d8e7[_0xfd6e('0x28')]()['then'](function(){var _0x9a743c=_0x44d8e7['get']({'plain':!![]});var _0x5366c2=_0xfd6e('0x29');return db[_0xfd6e('0x2a')]['destroy']({'where':{'type':_0x5366c2,'resourceId':_0x9a743c['id']}})[_0xfd6e('0x2b')](function(){return _0x44d8e7;});})[_0xfd6e('0x2b')](function(){_0xb247f8['status'](0xcc)[_0xfd6e('0x2c')]();});}};}function handleEntityNotFound(_0x1aa376,_0xa9da2c){return function(_0xfa9aa3){if(!_0xfa9aa3){_0x1aa376[_0xfd6e('0x2d')](0x194);}return _0xfa9aa3;};}function handleError(_0x58aa1b,_0x19e3ca){_0x19e3ca=_0x19e3ca||0x1f4;return function(_0x47064a){logger['error'](_0x47064a[_0xfd6e('0x2e')]);if(_0x47064a[_0xfd6e('0x2f')]){delete _0x47064a[_0xfd6e('0x2f')];}_0x58aa1b[_0xfd6e('0x1d')](_0x19e3ca)[_0xfd6e('0x30')](_0x47064a);};}exports[_0xfd6e('0x31')]=function(_0x46adac,_0x500401){var _0x208220={},_0x499607={},_0x3348eb={'count':0x0,'rows':[]};var _0x3f04a4=_[_0xfd6e('0x32')](db['OpenchannelQueue'][_0xfd6e('0x33')],function(_0x520163){return{'name':_0x520163['fieldName'],'type':_0x520163[_0xfd6e('0x34')]['key']};});_0x499607[_0xfd6e('0x35')]=_[_0xfd6e('0x32')](_0x3f04a4,'name');_0x499607[_0xfd6e('0x36')]=_[_0xfd6e('0x37')](_0x46adac[_0xfd6e('0x36')]);_0x499607[_0xfd6e('0x38')]=_[_0xfd6e('0x39')](_0x499607[_0xfd6e('0x35')],_0x499607[_0xfd6e('0x36')]);_0x208220[_0xfd6e('0x3a')]=_[_0xfd6e('0x39')](_0x499607[_0xfd6e('0x35')],qs[_0xfd6e('0x3b')](_0x46adac[_0xfd6e('0x36')][_0xfd6e('0x3b')]));_0x208220['attributes']=_0x208220[_0xfd6e('0x3a')][_0xfd6e('0x3c')]?_0x208220[_0xfd6e('0x3a')]:_0x499607['model'];if(!_0x46adac['query'][_0xfd6e('0x3d')](_0xfd6e('0x3e'))){_0x208220[_0xfd6e('0x20')]=qs[_0xfd6e('0x20')](_0x46adac[_0xfd6e('0x36')]['limit']);_0x208220[_0xfd6e('0x1f')]=qs[_0xfd6e('0x1f')](_0x46adac[_0xfd6e('0x36')]['offset']);}_0x208220[_0xfd6e('0x3f')]=qs['sort'](_0x46adac[_0xfd6e('0x36')][_0xfd6e('0x40')]);_0x208220[_0xfd6e('0x41')]=qs[_0xfd6e('0x38')](_[_0xfd6e('0x42')](_0x46adac['query'],_0x499607[_0xfd6e('0x38')]),_0x3f04a4);if(_0x46adac[_0xfd6e('0x36')]['filter']){_0x208220[_0xfd6e('0x41')]=_[_0xfd6e('0x43')](_0x208220[_0xfd6e('0x41')],{'$or':_[_0xfd6e('0x32')](_0x3f04a4,function(_0x4b7813){if(_0x4b7813['type']!==_0xfd6e('0x44')){var _0x83926={};_0x83926[_0x4b7813[_0xfd6e('0x2f')]]={'$like':'%'+_0x46adac[_0xfd6e('0x36')][_0xfd6e('0x45')]+'%'};return _0x83926;}})});}_0x208220=_[_0xfd6e('0x43')]({},_0x208220,_0x46adac[_0xfd6e('0x46')]);var _0x4d36ba={'where':_0x208220[_0xfd6e('0x41')]};return db['OpenchannelQueue'][_0xfd6e('0x22')](_0x4d36ba)[_0xfd6e('0x2b')](function(_0x12e53d){_0x3348eb[_0xfd6e('0x22')]=_0x12e53d;if(_0x46adac[_0xfd6e('0x36')]['includeAll']){_0x208220['include']=[{'all':!![]}];}return db[_0xfd6e('0x47')][_0xfd6e('0x48')](_0x208220);})[_0xfd6e('0x2b')](function(_0x512551){_0x3348eb[_0xfd6e('0x49')]=_0x512551;return _0x3348eb;})[_0xfd6e('0x2b')](respondWithFilteredResult(_0x500401,_0x208220))['catch'](handleError(_0x500401,null));};exports['show']=function(_0x38b311,_0x265a73){var _0x59de82={'raw':!![],'where':{'id':_0x38b311[_0xfd6e('0x4a')]['id']}},_0x1d6744={};_0x1d6744[_0xfd6e('0x35')]=_[_0xfd6e('0x37')](db[_0xfd6e('0x47')]['rawAttributes']);_0x1d6744['query']=_[_0xfd6e('0x37')](_0x38b311['query']);_0x1d6744[_0xfd6e('0x38')]=_[_0xfd6e('0x39')](_0x1d6744['model'],_0x1d6744['query']);_0x59de82[_0xfd6e('0x3a')]=_[_0xfd6e('0x39')](_0x1d6744[_0xfd6e('0x35')],qs[_0xfd6e('0x3b')](_0x38b311[_0xfd6e('0x36')][_0xfd6e('0x3b')]));_0x59de82[_0xfd6e('0x3a')]=_0x59de82[_0xfd6e('0x3a')]['length']?_0x59de82[_0xfd6e('0x3a')]:_0x1d6744[_0xfd6e('0x35')];if(_0x38b311[_0xfd6e('0x36')][_0xfd6e('0x4b')]){_0x59de82['include']=[{'all':!![]}];}_0x59de82=_[_0xfd6e('0x43')]({},_0x59de82,_0x38b311[_0xfd6e('0x46')]);return db['OpenchannelQueue'][_0xfd6e('0x4c')](_0x59de82)[_0xfd6e('0x2b')](handleEntityNotFound(_0x265a73,null))['then'](respondWithResult(_0x265a73,null))[_0xfd6e('0x4d')](handleError(_0x265a73,null));};exports['create']=function(_0x45dafe,_0x299773){return db[_0xfd6e('0x47')][_0xfd6e('0x4e')](_0x45dafe['body'],{})[_0xfd6e('0x2b')](function(_0xba0741){var _0x15c999=_0x45dafe[_0xfd6e('0x4f')]['get']({'plain':!![]});if(!_0x15c999)throw new Error(_0xfd6e('0x50'));if(_0x15c999[_0xfd6e('0x51')]===_0xfd6e('0x4f')){var _0x343c78=_0xba0741[_0xfd6e('0x52')]({'plain':!![]});var _0xadb1d2=_0xfd6e('0x29');return db['UserProfileSection'][_0xfd6e('0x4c')]({'where':{'name':_0xadb1d2,'userProfileId':_0x15c999[_0xfd6e('0x53')]},'raw':!![]})[_0xfd6e('0x2b')](function(_0x40f4df){if(_0x40f4df&&_0x40f4df['autoAssociation']===0x0){return db['UserProfileResource'][_0xfd6e('0x4e')]({'name':_0x343c78[_0xfd6e('0x2f')],'resourceId':_0x343c78['id'],'type':_0x40f4df[_0xfd6e('0x2f')],'sectionId':_0x40f4df['id']},{})['then'](function(){return _0xba0741;});}else{return _0xba0741;}})[_0xfd6e('0x4d')](function(_0x4b6634){logger[_0xfd6e('0x54')](_0xfd6e('0x55'),_0x4b6634);throw _0x4b6634;});}return _0xba0741;})[_0xfd6e('0x2b')](respondWithResult(_0x299773,0xc9))['catch'](handleError(_0x299773,null));};exports[_0xfd6e('0x27')]=function(_0x45bf8a,_0x4dbe0f){if(_0x45bf8a[_0xfd6e('0x56')]['id']){delete _0x45bf8a[_0xfd6e('0x56')]['id'];}return db[_0xfd6e('0x47')]['find']({'where':{'id':_0x45bf8a[_0xfd6e('0x4a')]['id']}})[_0xfd6e('0x2b')](handleEntityNotFound(_0x4dbe0f,null))[_0xfd6e('0x2b')](saveUpdates(_0x45bf8a[_0xfd6e('0x56')],null))[_0xfd6e('0x2b')](respondWithResult(_0x4dbe0f,null))['catch'](handleError(_0x4dbe0f,null));};exports[_0xfd6e('0x28')]=function(_0x28c57a,_0x2b3f82){return db[_0xfd6e('0x47')][_0xfd6e('0x4c')]({'where':{'id':_0x28c57a['params']['id']}})[_0xfd6e('0x2b')](handleEntityNotFound(_0x2b3f82,null))['then'](removeEntity(_0x2b3f82,null))[_0xfd6e('0x4d')](handleError(_0x2b3f82,null));};exports[_0xfd6e('0x57')]=function(_0x191f96,_0x1de687){return db[_0xfd6e('0x47')][_0xfd6e('0x57')]()[_0xfd6e('0x2b')](respondWithResult(_0x1de687,null))['catch'](handleError(_0x1de687,null));};exports[_0xfd6e('0x58')]=function(_0x18a30f,_0x533db9,_0x2223c4){var _0x4c8105={'raw':!![],'where':{}},_0x35ba2d={},_0x44b637;return db[_0xfd6e('0x47')][_0xfd6e('0x59')]({'where':{'id':_0x18a30f['params']['id']}})['then'](handleEntityNotFound(_0x533db9,null))[_0xfd6e('0x2b')](function(_0x1c46a5){if(_0x1c46a5){_0x44b637=_0x1c46a5[_0xfd6e('0x52')]({'plain':!![]});_0x35ba2d[_0xfd6e('0x35')]=_[_0xfd6e('0x37')](db[_0xfd6e('0x5a')][_0xfd6e('0x33')]);_0x35ba2d[_0xfd6e('0x36')]=_['keys'](_0x18a30f[_0xfd6e('0x36')]);_0x35ba2d[_0xfd6e('0x38')]=_[_0xfd6e('0x39')](_0x35ba2d[_0xfd6e('0x35')],_0x35ba2d[_0xfd6e('0x36')]);_0x4c8105['attributes']=_[_0xfd6e('0x39')](_0x35ba2d[_0xfd6e('0x35')],qs['fields'](_0x18a30f[_0xfd6e('0x36')][_0xfd6e('0x3b')]));_0x4c8105[_0xfd6e('0x3a')]=_0x4c8105[_0xfd6e('0x3a')][_0xfd6e('0x3c')]?_0x4c8105[_0xfd6e('0x3a')]:_0x35ba2d[_0xfd6e('0x35')];if(!_0x18a30f['query'][_0xfd6e('0x3d')](_0xfd6e('0x3e'))){_0x4c8105[_0xfd6e('0x20')]=qs[_0xfd6e('0x20')](_0x18a30f[_0xfd6e('0x36')][_0xfd6e('0x20')]);_0x4c8105[_0xfd6e('0x1f')]=qs[_0xfd6e('0x1f')](_0x18a30f[_0xfd6e('0x36')][_0xfd6e('0x1f')]);}_0x4c8105[_0xfd6e('0x3f')]=qs[_0xfd6e('0x40')](_0x18a30f[_0xfd6e('0x36')][_0xfd6e('0x40')]);_0x4c8105[_0xfd6e('0x41')]=qs['filters'](_['pick'](_0x18a30f[_0xfd6e('0x36')],_0x35ba2d['filters']));_0x4c8105[_0xfd6e('0x41')][_0xfd6e('0x5b')]=_0x1c46a5['id'];if(_0x18a30f[_0xfd6e('0x36')][_0xfd6e('0x45')]){_0x4c8105[_0xfd6e('0x41')]=_['merge'](_0x4c8105[_0xfd6e('0x41')],{'$or':_[_0xfd6e('0x32')](_0x4c8105[_0xfd6e('0x3a')],function(_0x42cfa8){var _0x4929f1={};_0x4929f1[_0x42cfa8]={'$like':'%'+_0x18a30f[_0xfd6e('0x36')][_0xfd6e('0x45')]+'%'};return _0x4929f1;})});}_0x4c8105=_[_0xfd6e('0x43')]({},_0x4c8105,_0x18a30f[_0xfd6e('0x46')]);return db[_0xfd6e('0x5a')][_0xfd6e('0x48')](_0x4c8105);}})[_0xfd6e('0x2b')](function(_0x27fe55){if(_0x27fe55){return db[_0xfd6e('0x5c')][_0xfd6e('0x5d')]({'where':{'id':_['map'](_0x27fe55,_0xfd6e('0x5e')),'role':_0xfd6e('0x5f')},'attributes':['id','name',_0xfd6e('0x60'),_0xfd6e('0x61'),'createdAt']});}})[_0xfd6e('0x2b')](function(_0x2c5103){if(_0x2c5103){return{'count':_0x2c5103['count'],'rows':_[_0xfd6e('0x32')](_0x2c5103[_0xfd6e('0x49')],function(_0x258fd2){return{'membername':_0x258fd2[_0xfd6e('0x2f')],'UserId':_0x258fd2['id'],'queue_name':_0x44b637['name'],'OpenchannelQueueId':_0x44b637['id'],'interface':util[_0xfd6e('0x62')](_0xfd6e('0x63'),'SIP',_0x258fd2[_0xfd6e('0x2f')]),'penalty':0x0,'paused':_0x258fd2['openchannelPause'],'createdAt':_0x258fd2[_0xfd6e('0x64')],'updatedAt':_0x258fd2[_0xfd6e('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfd6e('0x2b')](respondWithFilteredResult(_0x533db9,_0x4c8105))[_0xfd6e('0x4d')](handleError(_0x533db9,null));};exports[_0xfd6e('0x65')]=function(_0x490e8c,_0x963484,_0x4059ac){var _0x4f8ea0={};var _0x309641={};var _0x17a430;var _0x242acb;return db[_0xfd6e('0x47')][_0xfd6e('0x59')]({'where':{'id':_0x490e8c[_0xfd6e('0x4a')]['id']}})[_0xfd6e('0x2b')](handleEntityNotFound(_0x963484,null))[_0xfd6e('0x2b')](function(_0x569e98){if(_0x569e98){_0x17a430=_0x569e98;_0x309641[_0xfd6e('0x35')]=_['keys'](db[_0xfd6e('0x66')]['rawAttributes']);_0x309641[_0xfd6e('0x36')]=_['keys'](_0x490e8c['query']);_0x309641[_0xfd6e('0x38')]=_[_0xfd6e('0x39')](_0x309641[_0xfd6e('0x35')],_0x309641[_0xfd6e('0x36')]);_0x4f8ea0[_0xfd6e('0x3a')]=_['intersection'](_0x309641[_0xfd6e('0x35')],qs[_0xfd6e('0x3b')](_0x490e8c[_0xfd6e('0x36')]['fields']));_0x4f8ea0[_0xfd6e('0x3a')]=_0x4f8ea0[_0xfd6e('0x3a')][_0xfd6e('0x3c')]?_0x4f8ea0['attributes']:_0x309641[_0xfd6e('0x35')];_0x4f8ea0[_0xfd6e('0x3f')]=qs[_0xfd6e('0x40')](_0x490e8c[_0xfd6e('0x36')][_0xfd6e('0x40')]);_0x4f8ea0['where']=qs[_0xfd6e('0x38')](_[_0xfd6e('0x42')](_0x490e8c['query'],_0x309641[_0xfd6e('0x38')]));if(_0x490e8c[_0xfd6e('0x36')][_0xfd6e('0x45')]){_0x4f8ea0[_0xfd6e('0x41')]=_['merge'](_0x4f8ea0[_0xfd6e('0x41')],{'$or':_[_0xfd6e('0x32')](_0x4f8ea0[_0xfd6e('0x3a')],function(_0x3a238c){var _0x32aad3={};_0x32aad3[_0x3a238c]={'$like':'%'+_0x490e8c[_0xfd6e('0x36')][_0xfd6e('0x45')]+'%'};return _0x32aad3;})});}_0x4f8ea0=_[_0xfd6e('0x43')]({},_0x4f8ea0,_0x490e8c['options']);return _0x17a430[_0xfd6e('0x65')](_0x4f8ea0);}})[_0xfd6e('0x2b')](function(_0x581ea9){if(_0x581ea9){_0x242acb=_0x581ea9[_0xfd6e('0x3c')];if(!_0x490e8c[_0xfd6e('0x36')][_0xfd6e('0x3d')](_0xfd6e('0x3e'))){_0x4f8ea0[_0xfd6e('0x20')]=qs[_0xfd6e('0x20')](_0x490e8c[_0xfd6e('0x36')][_0xfd6e('0x20')]);_0x4f8ea0[_0xfd6e('0x1f')]=qs[_0xfd6e('0x1f')](_0x490e8c[_0xfd6e('0x36')]['offset']);}return _0x17a430[_0xfd6e('0x65')](_0x4f8ea0);}})[_0xfd6e('0x2b')](function(_0x20e768){if(_0x20e768){return _0x20e768?{'count':_0x242acb,'rows':_0x20e768}:null;}})[_0xfd6e('0x2b')](respondWithResult(_0x963484,null))[_0xfd6e('0x4d')](handleError(_0x963484,null));};exports[_0xfd6e('0x67')]=function(_0x222aab,_0x1bc93d,_0x5738c1){var _0x3e955c=_0x222aab[_0xfd6e('0x56')][_0xfd6e('0x68')];return db[_0xfd6e('0x66')][_0xfd6e('0x48')]({'where':{'id':_0x3e955c},'attributes':['id'],'include':[{'model':db[_0xfd6e('0x5c')],'as':_0xfd6e('0x69'),'attributes':['id',_0xfd6e('0x2f'),_0xfd6e('0x6a'),_0xfd6e('0x6b'),_0xfd6e('0x6c')],'raw':!![]}]})[_0xfd6e('0x2b')](function(_0x3aaabe){if(_0x3aaabe){var _0x45a107=_[_0xfd6e('0x6d')](_0x3aaabe,function(_0x36a96c){var _0xf2be25=_0x36a96c[_0xfd6e('0x52')]({'plain':!![]});return _0xf2be25['Agents'];});return db[_0xfd6e('0x47')][_0xfd6e('0x4c')]({'where':{'id':_0x222aab['params']['id']}})['then'](function(_0x532943){return db[_0xfd6e('0x6e')][_0xfd6e('0x6f')](function(_0x41bae6){return _0x532943['addTeams'](_0x3e955c,{'transaction':_0x41bae6})[_0xfd6e('0x2b')](function(){return BPromise['each'](_0x45a107,function(_0x46728d){return db['UserOpenchannelQueue'][_0xfd6e('0x70')]({'where':{'UserId':_0x46728d['id'],'OpenchannelQueueId':_0x222aab['params']['id']},'transaction':_0x41bae6});});})['then'](function(){_0x45a107[_0xfd6e('0x71')](function(_0x2407e1){socket['emit'](_0xfd6e('0x72'),{'UserId':_0x2407e1['id'],'OpenchannelQueueId':_0x532943['id']});});});});});}})['then'](respondWithStatusCode(_0x1bc93d,null))[_0xfd6e('0x4d')](handleError(_0x1bc93d,null));};exports[_0xfd6e('0x73')]=function(_0x7d45a7,_0x54baf8,_0x3f3715){return db[_0xfd6e('0x66')]['findAll']({'where':{'id':_0x7d45a7[_0xfd6e('0x36')][_0xfd6e('0x68')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfd6e('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x54baf8,null))[_0xfd6e('0x2b')](function(_0x39f06d){var _0x17b33c=_[_0xfd6e('0x32')](_0x39f06d,'id');var _0x1251f7=[];var _0x1f19af=[];var _0x237404=squel[_0xfd6e('0x74')]();_0x237404[_0xfd6e('0x75')](_0xfd6e('0x76'))[_0xfd6e('0x77')](_0xfd6e('0x78'),'tq')['join'](_0xfd6e('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('OpenchannelQueueId\x20=\x20?',_0x7d45a7['params']['id']);for(var _0x4ba0eb=0x0;_0x4ba0eb<_0x39f06d[_0xfd6e('0x3c')];_0x4ba0eb+=0x1){let _0x162ab6=_0x39f06d[_0x4ba0eb];for(var _0x512fb7=0x0;_0x512fb7<_0x162ab6[_0xfd6e('0x69')][_0xfd6e('0x3c')];_0x512fb7+=0x1){let _0xada851=_0x162ab6[_0xfd6e('0x69')][_0x512fb7];var _0x47e4e2=_0x237404[_0xfd6e('0x7a')]();_0x47e4e2[_0xfd6e('0x41')]('ut.UserId\x20=\x20?',_0xada851['id']);_0x1f19af[_0xfd6e('0x7b')](db[_0xfd6e('0x6e')][_0xfd6e('0x36')](_0x47e4e2['toString'](),{'type':db[_0xfd6e('0x6e')][_0xfd6e('0x7c')][_0xfd6e('0x7d')]})[_0xfd6e('0x2b')](function(_0x11b61f){if(_0x11b61f[_0xfd6e('0x3c')]===0x1){return _0xada851['id'];}else{var _0x2ebc1b=_['every'](_[_0xfd6e('0x32')](_0x11b61f,_0xfd6e('0x7e')),function(_0x20eced){return _[_0xfd6e('0x7f')](_0x17b33c,_0x20eced);});if(_0x2ebc1b){return _0xada851['id'];}}}));}}return BPromise['all'](_0x1f19af)[_0xfd6e('0x2b')](function(_0x35371a){_0x1251f7=_(_0x1251f7)[_0xfd6e('0x80')](_0x35371a)[_0xfd6e('0x81')]()[_0xfd6e('0x82')]();return db[_0xfd6e('0x47')][_0xfd6e('0x4c')]({'where':{'id':_0x7d45a7[_0xfd6e('0x4a')]['id']}})[_0xfd6e('0x2b')](function(_0x2f4393){return db[_0xfd6e('0x6e')][_0xfd6e('0x6f')](function(_0x19caf2){return _0x2f4393[_0xfd6e('0x73')](_0x7d45a7[_0xfd6e('0x36')][_0xfd6e('0x68')],{'transaction':_0x19caf2})[_0xfd6e('0x2b')](function(){if(!_[_0xfd6e('0x83')](_0x1251f7)){return _0x2f4393[_0xfd6e('0x84')](_0x1251f7,{'transaction':_0x19caf2});}})[_0xfd6e('0x2b')](function(){_0x1251f7[_0xfd6e('0x71')](function(_0x7ee64a){socket[_0xfd6e('0x85')](_0xfd6e('0x86'),{'UserId':_0x7ee64a,'OpenchannelQueueId':_0x2f4393['id']});});});});});});})['then'](respondWithStatusCode(_0x54baf8,null))[_0xfd6e('0x4d')](handleError(_0x54baf8,null));};exports[_0xfd6e('0x87')]=function(_0x151c79,_0x36c78b,_0x4eb184){return db[_0xfd6e('0x47')][_0xfd6e('0x4c')]({'where':{'id':_0x151c79[_0xfd6e('0x4a')]['id']}})[_0xfd6e('0x2b')](handleEntityNotFound(_0x36c78b,null))['then'](function(_0xd60a22){if(_0xd60a22){return _0xd60a22[_0xfd6e('0x87')](_0x151c79[_0xfd6e('0x56')]['ids'],_['omit'](_0x151c79[_0xfd6e('0x56')],[_0xfd6e('0x68'),'id'])||{})[_0xfd6e('0x88')](function(_0x138ece){for(var _0xd35be7=0x0;_0xd35be7<_0x151c79[_0xfd6e('0x56')][_0xfd6e('0x68')][_0xfd6e('0x3c')];_0xd35be7+=0x1){socket[_0xfd6e('0x85')](_0xfd6e('0x72'),{'UserId':Number(_0x151c79[_0xfd6e('0x56')][_0xfd6e('0x68')][_0xd35be7]),'OpenchannelQueueId':Number(_0x151c79['params']['id'])});}return _0x138ece;});}})[_0xfd6e('0x2b')](respondWithResult(_0x36c78b,null))[_0xfd6e('0x4d')](handleError(_0x36c78b,null));};exports[_0xfd6e('0x84')]=function(_0x2714a5,_0x60b681,_0x2a4a21){return db[_0xfd6e('0x47')]['find']({'where':{'id':_0x2714a5[_0xfd6e('0x4a')]['id']}})[_0xfd6e('0x2b')](handleEntityNotFound(_0x60b681,null))[_0xfd6e('0x2b')](function(_0x55cf94){if(_0x55cf94){return _0x55cf94[_0xfd6e('0x84')](_0x2714a5['query']['ids'])[_0xfd6e('0x2b')](function(){if(_['isArray'](_0x2714a5[_0xfd6e('0x36')][_0xfd6e('0x68')])){for(var _0x493c93=0x0;_0x493c93<_0x2714a5['query']['ids'][_0xfd6e('0x3c')];_0x493c93+=0x1){socket['emit'](_0xfd6e('0x86'),{'UserId':Number(_0x2714a5[_0xfd6e('0x36')]['ids'][_0x493c93]),'OpenchannelQueueId':Number(_0x2714a5['params']['id'])});}}else{socket[_0xfd6e('0x85')](_0xfd6e('0x86'),{'UserId':Number(_0x2714a5[_0xfd6e('0x36')][_0xfd6e('0x68')]),'OpenchannelQueueId':Number(_0x2714a5[_0xfd6e('0x4a')]['id'])});}});}})[_0xfd6e('0x2b')](respondWithStatusCode(_0x60b681,null))['catch'](handleError(_0x60b681,null));};exports['getAgents']=function(_0x4001e0,_0x26cd1f,_0x13f743){var _0xf4f43f={};var _0x556d53={};var _0xe2d030;var _0x186b70;return db[_0xfd6e('0x47')][_0xfd6e('0x59')]({'where':{'id':_0x4001e0['params']['id']}})[_0xfd6e('0x2b')](handleEntityNotFound(_0x26cd1f,null))['then'](function(_0xa3cf13){if(_0xa3cf13){_0xe2d030=_0xa3cf13;_0x556d53[_0xfd6e('0x35')]=_[_0xfd6e('0x37')](db[_0xfd6e('0x5c')][_0xfd6e('0x33')]);_0x556d53['query']=_['keys'](_0x4001e0[_0xfd6e('0x36')]);_0x556d53[_0xfd6e('0x38')]=_[_0xfd6e('0x39')](_0x556d53['model'],_0x556d53[_0xfd6e('0x36')]);_0xf4f43f[_0xfd6e('0x3a')]=_['intersection'](_0x556d53['model'],qs['fields'](_0x4001e0['query'][_0xfd6e('0x3b')]));_0xf4f43f[_0xfd6e('0x3a')]=_0xf4f43f[_0xfd6e('0x3a')][_0xfd6e('0x3c')]?_0xf4f43f[_0xfd6e('0x3a')]:_0x556d53['model'];_0xf4f43f['order']=qs[_0xfd6e('0x40')](_0x4001e0['query'][_0xfd6e('0x40')]);_0xf4f43f[_0xfd6e('0x41')]=qs[_0xfd6e('0x38')](_[_0xfd6e('0x42')](_0x4001e0['query'],_0x556d53[_0xfd6e('0x38')]));if(_0x4001e0['query']['filter']){_0xf4f43f[_0xfd6e('0x41')]=_[_0xfd6e('0x43')](_0xf4f43f[_0xfd6e('0x41')],{'$or':_[_0xfd6e('0x32')](_0xf4f43f[_0xfd6e('0x3a')],function(_0x2ad8ed){var _0x28da50={};_0x28da50[_0x2ad8ed]={'$like':'%'+_0x4001e0[_0xfd6e('0x36')]['filter']+'%'};return _0x28da50;})});}_0xf4f43f=_[_0xfd6e('0x43')]({},_0xf4f43f,_0x4001e0[_0xfd6e('0x46')]);return _0xe2d030['getAgents'](_0xf4f43f);}})[_0xfd6e('0x2b')](function(_0x4aa7bc){if(_0x4aa7bc){_0x186b70=_0x4aa7bc['length'];if(!_0x4001e0[_0xfd6e('0x36')]['hasOwnProperty'](_0xfd6e('0x3e'))){_0xf4f43f[_0xfd6e('0x20')]=qs[_0xfd6e('0x20')](_0x4001e0['query']['limit']);_0xf4f43f[_0xfd6e('0x1f')]=qs[_0xfd6e('0x1f')](_0x4001e0['query'][_0xfd6e('0x1f')]);}return _0xe2d030[_0xfd6e('0x89')](_0xf4f43f);}})[_0xfd6e('0x2b')](function(_0xed2d5){if(_0xed2d5){return _0xed2d5?{'count':_0x186b70,'rows':_0xed2d5}:null;}})[_0xfd6e('0x2b')](respondWithResult(_0x26cd1f,null))[_0xfd6e('0x4d')](handleError(_0x26cd1f,null));}; \ No newline at end of file +var _0x692c=['stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','params','include','find','catch','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','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','findAndCountAll','UserId','updatedAt','createdAt','%s/%s','SIP','openchannelPause','getTeams','addTeams','Team','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','ids','tq.TeamId','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','transaction','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','User','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','redis','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','OpenchannelQueues','error'];(function(_0x452985,_0x1ca4af){var _0x115294=function(_0x38a74d){while(--_0x38a74d){_0x452985['push'](_0x452985['shift']());}};_0x115294(++_0x1ca4af);}(_0x692c,0x17a));var _0xc692=function(_0xab551,_0x145c86){_0xab551=_0xab551-0x0;var _0x479877=_0x692c[_0xab551];return _0x479877;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc692('0x0'));var zipdir=require(_0xc692('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc692('0x2'));var moment=require(_0xc692('0x3'));var BPromise=require(_0xc692('0x4'));var Mustache=require('mustache');var util=require(_0xc692('0x5'));var path=require('path');var sox=require(_0xc692('0x6'));var csv=require(_0xc692('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc692('0x8'));var squel=require(_0xc692('0x9'));var crypto=require(_0xc692('0xa'));var jsforce=require(_0xc692('0xb'));var deskjs=require(_0xc692('0xc'));var toCsv=require(_0xc692('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc692('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc692('0xe'));var hardwareService=require(_0xc692('0xf'));var logger=require(_0xc692('0x10'))(_0xc692('0x11'));var utils=require(_0xc692('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc692('0x13'))['db'];config['redis']=_[_0xc692('0x14')](config['redis'],{'host':_0xc692('0x15'),'port':0x18eb});var socket=require(_0xc692('0x16'))(new Redis(config[_0xc692('0x17')]));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x4f5487,_0x4c517a){_0x4c517a=_0x4c517a||0xcc;return function(_0xb31220){if(_0xb31220){return _0x4f5487[_0xc692('0x18')](_0x4c517a);}return _0x4f5487['status'](_0x4c517a)['end']();};}function respondWithResult(_0x4d9a08,_0x4c154b){_0x4c154b=_0x4c154b||0xc8;return function(_0x297b10){if(_0x297b10){return _0x4d9a08[_0xc692('0x19')](_0x4c154b)[_0xc692('0x1a')](_0x297b10);}};}function respondWithFilteredResult(_0x1a88ab,_0x109230){return function(_0x147890){if(_0x147890){var _0x37af0a=typeof _0x109230['offset']===_0xc692('0x1b')&&typeof _0x109230['limit']===_0xc692('0x1b');var _0x531700=_0x147890[_0xc692('0x1c')];var _0x4fdd7e=_0x37af0a?0x0:_0x109230[_0xc692('0x1d')];var _0xf23ca1=_0x37af0a?_0x147890['count']:_0x109230[_0xc692('0x1d')]+_0x109230[_0xc692('0x1e')];var _0x467ea2;if(_0xf23ca1>=_0x531700){_0xf23ca1=_0x531700;_0x467ea2=0xc8;}else{_0x467ea2=0xce;}_0x1a88ab['status'](_0x467ea2);return _0x1a88ab[_0xc692('0x1f')](_0xc692('0x20'),_0x4fdd7e+'-'+_0xf23ca1+'/'+_0x531700)['json'](_0x147890);}return null;};}function patchUpdates(_0xd98f6b){return function(_0x2b25ad){try{jsonpatch[_0xc692('0x21')](_0x2b25ad,_0xd98f6b,!![]);}catch(_0x103902){return BPromise[_0xc692('0x22')](_0x103902);}return _0x2b25ad[_0xc692('0x23')]();};}function saveUpdates(_0x574e4b,_0x2d74e2){return function(_0x31bbef){if(_0x31bbef){return _0x31bbef[_0xc692('0x24')](_0x574e4b)['then'](function(_0x1e1a22){return _0x1e1a22;});}return null;};}function removeEntity(_0x5743fa,_0x12f103){return function(_0x49f390){if(_0x49f390){return _0x49f390[_0xc692('0x25')]()[_0xc692('0x26')](function(){var _0x605c1=_0x49f390[_0xc692('0x27')]({'plain':!![]});var _0x44668b=_0xc692('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x44668b,'resourceId':_0x605c1['id']}})[_0xc692('0x26')](function(){return _0x49f390;});})['then'](function(){_0x5743fa[_0xc692('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39e9f5,_0x386256){return function(_0x229115){if(!_0x229115){_0x39e9f5['sendStatus'](0x194);}return _0x229115;};}function handleError(_0x328d60,_0x21821d){_0x21821d=_0x21821d||0x1f4;return function(_0x441f30){logger[_0xc692('0x29')](_0x441f30[_0xc692('0x2a')]);if(_0x441f30[_0xc692('0x2b')]){delete _0x441f30[_0xc692('0x2b')];}_0x328d60[_0xc692('0x19')](_0x21821d)[_0xc692('0x2c')](_0x441f30);};}exports[_0xc692('0x2d')]=function(_0x2b7970,_0x24202a){var _0x338371={},_0x1332d0={},_0xce4169={'count':0x0,'rows':[]};var _0x2c6559=_[_0xc692('0x2e')](db[_0xc692('0x2f')][_0xc692('0x30')],function(_0x41b26e){return{'name':_0x41b26e[_0xc692('0x31')],'type':_0x41b26e[_0xc692('0x32')][_0xc692('0x33')]};});_0x1332d0['model']=_['map'](_0x2c6559,_0xc692('0x2b'));_0x1332d0[_0xc692('0x34')]=_[_0xc692('0x35')](_0x2b7970['query']);_0x1332d0[_0xc692('0x36')]=_[_0xc692('0x37')](_0x1332d0[_0xc692('0x38')],_0x1332d0[_0xc692('0x34')]);_0x338371[_0xc692('0x39')]=_[_0xc692('0x37')](_0x1332d0[_0xc692('0x38')],qs[_0xc692('0x3a')](_0x2b7970[_0xc692('0x34')]['fields']));_0x338371['attributes']=_0x338371['attributes'][_0xc692('0x3b')]?_0x338371[_0xc692('0x39')]:_0x1332d0[_0xc692('0x38')];if(!_0x2b7970['query'][_0xc692('0x3c')](_0xc692('0x3d'))){_0x338371[_0xc692('0x1e')]=qs['limit'](_0x2b7970[_0xc692('0x34')][_0xc692('0x1e')]);_0x338371[_0xc692('0x1d')]=qs[_0xc692('0x1d')](_0x2b7970[_0xc692('0x34')][_0xc692('0x1d')]);}_0x338371[_0xc692('0x3e')]=qs[_0xc692('0x3f')](_0x2b7970[_0xc692('0x34')]['sort']);_0x338371[_0xc692('0x40')]=qs[_0xc692('0x36')](_[_0xc692('0x41')](_0x2b7970[_0xc692('0x34')],_0x1332d0[_0xc692('0x36')]),_0x2c6559);if(_0x2b7970[_0xc692('0x34')][_0xc692('0x42')]){_0x338371[_0xc692('0x40')]=_['merge'](_0x338371[_0xc692('0x40')],{'$or':_[_0xc692('0x2e')](_0x2c6559,function(_0xe0896c){if(_0xe0896c[_0xc692('0x32')]!==_0xc692('0x43')){var _0x3bd3b2={};_0x3bd3b2[_0xe0896c['name']]={'$like':'%'+_0x2b7970[_0xc692('0x34')]['filter']+'%'};return _0x3bd3b2;}})});}_0x338371=_[_0xc692('0x44')]({},_0x338371,_0x2b7970[_0xc692('0x45')]);var _0x5da684={'where':_0x338371['where']};return db[_0xc692('0x2f')][_0xc692('0x1c')](_0x5da684)['then'](function(_0x2a379a){_0xce4169[_0xc692('0x1c')]=_0x2a379a;if(_0x2b7970[_0xc692('0x34')][_0xc692('0x46')]){_0x338371['include']=[{'all':!![]}];}return db['OpenchannelQueue'][_0xc692('0x47')](_0x338371);})[_0xc692('0x26')](function(_0x183b6b){_0xce4169['rows']=_0x183b6b;return _0xce4169;})['then'](respondWithFilteredResult(_0x24202a,_0x338371))['catch'](handleError(_0x24202a,null));};exports['show']=function(_0x2650b5,_0x420b7d){var _0x8b96c7={'raw':!![],'where':{'id':_0x2650b5[_0xc692('0x48')]['id']}},_0x517730={};_0x517730['model']=_[_0xc692('0x35')](db[_0xc692('0x2f')]['rawAttributes']);_0x517730[_0xc692('0x34')]=_['keys'](_0x2650b5['query']);_0x517730[_0xc692('0x36')]=_[_0xc692('0x37')](_0x517730[_0xc692('0x38')],_0x517730[_0xc692('0x34')]);_0x8b96c7[_0xc692('0x39')]=_[_0xc692('0x37')](_0x517730[_0xc692('0x38')],qs[_0xc692('0x3a')](_0x2650b5[_0xc692('0x34')][_0xc692('0x3a')]));_0x8b96c7['attributes']=_0x8b96c7[_0xc692('0x39')][_0xc692('0x3b')]?_0x8b96c7[_0xc692('0x39')]:_0x517730[_0xc692('0x38')];if(_0x2650b5[_0xc692('0x34')][_0xc692('0x46')]){_0x8b96c7[_0xc692('0x49')]=[{'all':!![]}];}_0x8b96c7=_[_0xc692('0x44')]({},_0x8b96c7,_0x2650b5[_0xc692('0x45')]);return db[_0xc692('0x2f')][_0xc692('0x4a')](_0x8b96c7)[_0xc692('0x26')](handleEntityNotFound(_0x420b7d,null))['then'](respondWithResult(_0x420b7d,null))[_0xc692('0x4b')](handleError(_0x420b7d,null));};exports[_0xc692('0x4c')]=function(_0x53b34c,_0x422399){return db[_0xc692('0x2f')]['create'](_0x53b34c[_0xc692('0x4d')],{})[_0xc692('0x26')](function(_0x15fd54){var _0x49100a=_0x53b34c[_0xc692('0x4e')][_0xc692('0x27')]({'plain':!![]});if(!_0x49100a)throw new Error(_0xc692('0x4f'));if(_0x49100a[_0xc692('0x50')]==='user'){var _0x38ad1d=_0x15fd54[_0xc692('0x27')]({'plain':!![]});var _0x50521=_0xc692('0x28');return db[_0xc692('0x51')][_0xc692('0x4a')]({'where':{'name':_0x50521,'userProfileId':_0x49100a[_0xc692('0x52')]},'raw':!![]})[_0xc692('0x26')](function(_0x1d830a){if(_0x1d830a&&_0x1d830a[_0xc692('0x53')]===0x0){return db[_0xc692('0x54')][_0xc692('0x4c')]({'name':_0x38ad1d[_0xc692('0x2b')],'resourceId':_0x38ad1d['id'],'type':_0x1d830a[_0xc692('0x2b')],'sectionId':_0x1d830a['id']},{})[_0xc692('0x26')](function(){return _0x15fd54;});}else{return _0x15fd54;}})[_0xc692('0x4b')](function(_0x392bde){logger[_0xc692('0x29')](_0xc692('0x55'),_0x392bde);throw _0x392bde;});}return _0x15fd54;})[_0xc692('0x26')](respondWithResult(_0x422399,0xc9))[_0xc692('0x4b')](handleError(_0x422399,null));};exports[_0xc692('0x24')]=function(_0x92eebe,_0x4cfabc){if(_0x92eebe['body']['id']){delete _0x92eebe[_0xc692('0x4d')]['id'];}return db[_0xc692('0x2f')][_0xc692('0x4a')]({'where':{'id':_0x92eebe[_0xc692('0x48')]['id']}})[_0xc692('0x26')](handleEntityNotFound(_0x4cfabc,null))[_0xc692('0x26')](saveUpdates(_0x92eebe[_0xc692('0x4d')],null))[_0xc692('0x26')](respondWithResult(_0x4cfabc,null))[_0xc692('0x4b')](handleError(_0x4cfabc,null));};exports[_0xc692('0x25')]=function(_0x47b998,_0x317018){return db[_0xc692('0x2f')]['find']({'where':{'id':_0x47b998[_0xc692('0x48')]['id']}})['then'](handleEntityNotFound(_0x317018,null))[_0xc692('0x26')](removeEntity(_0x317018,null))[_0xc692('0x4b')](handleError(_0x317018,null));};exports[_0xc692('0x56')]=function(_0x1da840,_0x48a1ba){return db['OpenchannelQueue'][_0xc692('0x56')]()[_0xc692('0x26')](respondWithResult(_0x48a1ba,null))[_0xc692('0x4b')](handleError(_0x48a1ba,null));};exports[_0xc692('0x57')]=function(_0x3879cf,_0x3fde4a,_0x9a30e9){var _0x1b093e={'raw':!![],'where':{}},_0x3a2765={},_0x3eaa51;return db[_0xc692('0x2f')][_0xc692('0x58')]({'where':{'id':_0x3879cf['params']['id']}})[_0xc692('0x26')](handleEntityNotFound(_0x3fde4a,null))['then'](function(_0x4bbb54){if(_0x4bbb54){_0x3eaa51=_0x4bbb54[_0xc692('0x27')]({'plain':!![]});_0x3a2765[_0xc692('0x38')]=_['keys'](db[_0xc692('0x59')][_0xc692('0x30')]);_0x3a2765[_0xc692('0x34')]=_[_0xc692('0x35')](_0x3879cf['query']);_0x3a2765[_0xc692('0x36')]=_[_0xc692('0x37')](_0x3a2765['model'],_0x3a2765[_0xc692('0x34')]);_0x1b093e[_0xc692('0x39')]=_[_0xc692('0x37')](_0x3a2765[_0xc692('0x38')],qs[_0xc692('0x3a')](_0x3879cf[_0xc692('0x34')][_0xc692('0x3a')]));_0x1b093e[_0xc692('0x39')]=_0x1b093e[_0xc692('0x39')][_0xc692('0x3b')]?_0x1b093e['attributes']:_0x3a2765[_0xc692('0x38')];if(!_0x3879cf[_0xc692('0x34')][_0xc692('0x3c')](_0xc692('0x3d'))){_0x1b093e[_0xc692('0x1e')]=qs[_0xc692('0x1e')](_0x3879cf[_0xc692('0x34')][_0xc692('0x1e')]);_0x1b093e['offset']=qs['offset'](_0x3879cf[_0xc692('0x34')][_0xc692('0x1d')]);}_0x1b093e[_0xc692('0x3e')]=qs['sort'](_0x3879cf['query']['sort']);_0x1b093e[_0xc692('0x40')]=qs[_0xc692('0x36')](_[_0xc692('0x41')](_0x3879cf['query'],_0x3a2765[_0xc692('0x36')]));_0x1b093e[_0xc692('0x40')][_0xc692('0x5a')]=_0x4bbb54['id'];if(_0x3879cf['query'][_0xc692('0x42')]){_0x1b093e[_0xc692('0x40')]=_['merge'](_0x1b093e['where'],{'$or':_[_0xc692('0x2e')](_0x1b093e['attributes'],function(_0x55899a){var _0x37be09={};_0x37be09[_0x55899a]={'$like':'%'+_0x3879cf['query'][_0xc692('0x42')]+'%'};return _0x37be09;})});}_0x1b093e=_['merge']({},_0x1b093e,_0x3879cf[_0xc692('0x45')]);return db['UserOpenchannelQueue'][_0xc692('0x47')](_0x1b093e);}})['then'](function(_0x2b4dc8){if(_0x2b4dc8){return db['User'][_0xc692('0x5b')]({'where':{'id':_[_0xc692('0x2e')](_0x2b4dc8,_0xc692('0x5c')),'role':'agent'},'attributes':['id','name','openchannelPause',_0xc692('0x5d'),_0xc692('0x5e')]});}})[_0xc692('0x26')](function(_0x55cad7){if(_0x55cad7){return{'count':_0x55cad7[_0xc692('0x1c')],'rows':_[_0xc692('0x2e')](_0x55cad7['rows'],function(_0x33f860){return{'membername':_0x33f860[_0xc692('0x2b')],'UserId':_0x33f860['id'],'queue_name':_0x3eaa51[_0xc692('0x2b')],'OpenchannelQueueId':_0x3eaa51['id'],'interface':util['format'](_0xc692('0x5f'),_0xc692('0x60'),_0x33f860['name']),'penalty':0x0,'paused':_0x33f860[_0xc692('0x61')],'createdAt':_0x33f860[_0xc692('0x5e')],'updatedAt':_0x33f860[_0xc692('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3fde4a,_0x1b093e))[_0xc692('0x4b')](handleError(_0x3fde4a,null));};exports['getTeams']=function(_0x55507d,_0x4d72a2,_0xcc47f8){var _0x14be1b={};var _0x361536={};var _0x4dd5d7;var _0x4079f2;return db[_0xc692('0x2f')][_0xc692('0x58')]({'where':{'id':_0x55507d[_0xc692('0x48')]['id']}})['then'](handleEntityNotFound(_0x4d72a2,null))[_0xc692('0x26')](function(_0x32e06e){if(_0x32e06e){_0x4dd5d7=_0x32e06e;_0x361536[_0xc692('0x38')]=_[_0xc692('0x35')](db['Team'][_0xc692('0x30')]);_0x361536[_0xc692('0x34')]=_[_0xc692('0x35')](_0x55507d[_0xc692('0x34')]);_0x361536[_0xc692('0x36')]=_[_0xc692('0x37')](_0x361536[_0xc692('0x38')],_0x361536[_0xc692('0x34')]);_0x14be1b['attributes']=_[_0xc692('0x37')](_0x361536['model'],qs['fields'](_0x55507d[_0xc692('0x34')][_0xc692('0x3a')]));_0x14be1b[_0xc692('0x39')]=_0x14be1b[_0xc692('0x39')][_0xc692('0x3b')]?_0x14be1b[_0xc692('0x39')]:_0x361536['model'];_0x14be1b[_0xc692('0x3e')]=qs[_0xc692('0x3f')](_0x55507d[_0xc692('0x34')][_0xc692('0x3f')]);_0x14be1b['where']=qs[_0xc692('0x36')](_[_0xc692('0x41')](_0x55507d[_0xc692('0x34')],_0x361536[_0xc692('0x36')]));if(_0x55507d['query']['filter']){_0x14be1b[_0xc692('0x40')]=_[_0xc692('0x44')](_0x14be1b['where'],{'$or':_['map'](_0x14be1b['attributes'],function(_0x33d92e){var _0x4a3e37={};_0x4a3e37[_0x33d92e]={'$like':'%'+_0x55507d[_0xc692('0x34')]['filter']+'%'};return _0x4a3e37;})});}_0x14be1b=_[_0xc692('0x44')]({},_0x14be1b,_0x55507d[_0xc692('0x45')]);return _0x4dd5d7[_0xc692('0x62')](_0x14be1b);}})['then'](function(_0x3e51b9){if(_0x3e51b9){_0x4079f2=_0x3e51b9[_0xc692('0x3b')];if(!_0x55507d[_0xc692('0x34')][_0xc692('0x3c')](_0xc692('0x3d'))){_0x14be1b[_0xc692('0x1e')]=qs[_0xc692('0x1e')](_0x55507d[_0xc692('0x34')][_0xc692('0x1e')]);_0x14be1b[_0xc692('0x1d')]=qs['offset'](_0x55507d[_0xc692('0x34')][_0xc692('0x1d')]);}return _0x4dd5d7[_0xc692('0x62')](_0x14be1b);}})[_0xc692('0x26')](function(_0x58c734){if(_0x58c734){return _0x58c734?{'count':_0x4079f2,'rows':_0x58c734}:null;}})[_0xc692('0x26')](respondWithResult(_0x4d72a2,null))[_0xc692('0x4b')](handleError(_0x4d72a2,null));};exports[_0xc692('0x63')]=function(_0x5782fe,_0x54f833,_0x38995a){var _0x762d86=_0x5782fe['body']['ids'];return db[_0xc692('0x64')]['findAll']({'where':{'id':_0x762d86},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc692('0x65'),'attributes':['id',_0xc692('0x2b'),_0xc692('0x66'),_0xc692('0x67'),_0xc692('0x68')],'raw':!![]}]})['then'](function(_0x542820){if(_0x542820){var _0x4e39b4=_[_0xc692('0x69')](_0x542820,function(_0x23ea00){var _0x2d4e14=_0x23ea00[_0xc692('0x27')]({'plain':!![]});return _0x2d4e14[_0xc692('0x65')];});return db[_0xc692('0x2f')][_0xc692('0x4a')]({'where':{'id':_0x5782fe[_0xc692('0x48')]['id']}})['then'](function(_0x1e2c78){return db[_0xc692('0x6a')]['transaction'](function(_0x44e65d){return _0x1e2c78[_0xc692('0x63')](_0x762d86,{'transaction':_0x44e65d})[_0xc692('0x26')](function(){return BPromise[_0xc692('0x6b')](_0x4e39b4,function(_0x3af0cf){return db[_0xc692('0x59')][_0xc692('0x6c')]({'where':{'UserId':_0x3af0cf['id'],'OpenchannelQueueId':_0x5782fe[_0xc692('0x48')]['id']},'transaction':_0x44e65d});});})['then'](function(){_0x4e39b4[_0xc692('0x6d')](function(_0x404a69){socket[_0xc692('0x6e')](_0xc692('0x6f'),{'UserId':_0x404a69['id'],'OpenchannelQueueId':_0x1e2c78['id']});});});});});}})['then'](respondWithStatusCode(_0x54f833,null))['catch'](handleError(_0x54f833,null));};exports[_0xc692('0x70')]=function(_0x4bd76e,_0x4ed042,_0xec9403){return db[_0xc692('0x64')][_0xc692('0x47')]({'where':{'id':_0x4bd76e['query'][_0xc692('0x71')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc692('0x65'),'attributes':['id'],'raw':!![]}]})[_0xc692('0x26')](handleEntityNotFound(_0x4ed042,null))[_0xc692('0x26')](function(_0x1293c4){var _0x33a92e=_[_0xc692('0x2e')](_0x1293c4,'id');var _0x3dd05c=[];var _0x4cd82d=[];var _0x4cf8c7=squel['select']();_0x4cf8c7['field'](_0xc692('0x72'))['from'](_0xc692('0x73'),'tq')[_0xc692('0x74')]('user_has_teams','ut',_0xc692('0x75'))[_0xc692('0x40')](_0xc692('0x76'),_0x4bd76e[_0xc692('0x48')]['id']);for(var _0x970368=0x0;_0x970368<_0x1293c4['length'];_0x970368+=0x1){let _0x871258=_0x1293c4[_0x970368];for(var _0x19fcbe=0x0;_0x19fcbe<_0x871258[_0xc692('0x65')][_0xc692('0x3b')];_0x19fcbe+=0x1){let _0x38455f=_0x871258[_0xc692('0x65')][_0x19fcbe];var _0x1a2c99=_0x4cf8c7['clone']();_0x1a2c99[_0xc692('0x40')](_0xc692('0x77'),_0x38455f['id']);_0x4cd82d[_0xc692('0x78')](db[_0xc692('0x6a')][_0xc692('0x34')](_0x1a2c99[_0xc692('0x79')](),{'type':db[_0xc692('0x6a')][_0xc692('0x7a')][_0xc692('0x7b')]})['then'](function(_0x4609ce){if(_0x4609ce[_0xc692('0x3b')]===0x1){return _0x38455f['id'];}else{var _0x493759=_[_0xc692('0x7c')](_[_0xc692('0x2e')](_0x4609ce,_0xc692('0x7d')),function(_0xb54ddd){return _[_0xc692('0x7e')](_0x33a92e,_0xb54ddd);});if(_0x493759){return _0x38455f['id'];}}}));}}return BPromise[_0xc692('0x7f')](_0x4cd82d)['then'](function(_0x2bcd49){_0x3dd05c=_(_0x3dd05c)['union'](_0x2bcd49)[_0xc692('0x80')]()[_0xc692('0x81')]();return db[_0xc692('0x2f')][_0xc692('0x4a')]({'where':{'id':_0x4bd76e[_0xc692('0x48')]['id']}})[_0xc692('0x26')](function(_0x59fdcd){return db[_0xc692('0x6a')][_0xc692('0x82')](function(_0x393c3a){return _0x59fdcd[_0xc692('0x70')](_0x4bd76e[_0xc692('0x34')][_0xc692('0x71')],{'transaction':_0x393c3a})[_0xc692('0x26')](function(){if(!_[_0xc692('0x83')](_0x3dd05c)){return _0x59fdcd[_0xc692('0x84')](_0x3dd05c,{'transaction':_0x393c3a});}})[_0xc692('0x26')](function(){_0x3dd05c[_0xc692('0x6d')](function(_0x5d26ce){socket[_0xc692('0x6e')](_0xc692('0x85'),{'UserId':_0x5d26ce,'OpenchannelQueueId':_0x59fdcd['id']});});});});});});})[_0xc692('0x26')](respondWithStatusCode(_0x4ed042,null))[_0xc692('0x4b')](handleError(_0x4ed042,null));};exports[_0xc692('0x86')]=function(_0xbc2786,_0x11b534,_0x34cc0b){return db[_0xc692('0x2f')][_0xc692('0x4a')]({'where':{'id':_0xbc2786[_0xc692('0x48')]['id']}})[_0xc692('0x26')](handleEntityNotFound(_0x11b534,null))[_0xc692('0x26')](function(_0x3cb917){if(_0x3cb917){return _0x3cb917['addAgents'](_0xbc2786[_0xc692('0x4d')][_0xc692('0x71')],_[_0xc692('0x87')](_0xbc2786[_0xc692('0x4d')],[_0xc692('0x71'),'id'])||{})[_0xc692('0x88')](function(_0xdcd446){for(var _0x252488=0x0;_0x252488<_0xbc2786[_0xc692('0x4d')][_0xc692('0x71')][_0xc692('0x3b')];_0x252488+=0x1){socket[_0xc692('0x6e')](_0xc692('0x6f'),{'UserId':Number(_0xbc2786[_0xc692('0x4d')][_0xc692('0x71')][_0x252488]),'OpenchannelQueueId':Number(_0xbc2786['params']['id'])});}return _0xdcd446;});}})[_0xc692('0x26')](respondWithResult(_0x11b534,null))[_0xc692('0x4b')](handleError(_0x11b534,null));};exports[_0xc692('0x84')]=function(_0xcb46be,_0x52013c,_0x5419ac){return db['OpenchannelQueue'][_0xc692('0x4a')]({'where':{'id':_0xcb46be[_0xc692('0x48')]['id']}})['then'](handleEntityNotFound(_0x52013c,null))[_0xc692('0x26')](function(_0x12d26b){if(_0x12d26b){return _0x12d26b['removeAgents'](_0xcb46be[_0xc692('0x34')][_0xc692('0x71')])[_0xc692('0x26')](function(){if(_[_0xc692('0x89')](_0xcb46be['query'][_0xc692('0x71')])){for(var _0x422f9e=0x0;_0x422f9e<_0xcb46be[_0xc692('0x34')][_0xc692('0x71')][_0xc692('0x3b')];_0x422f9e+=0x1){socket[_0xc692('0x6e')](_0xc692('0x85'),{'UserId':Number(_0xcb46be[_0xc692('0x34')][_0xc692('0x71')][_0x422f9e]),'OpenchannelQueueId':Number(_0xcb46be[_0xc692('0x48')]['id'])});}}else{socket['emit'](_0xc692('0x85'),{'UserId':Number(_0xcb46be[_0xc692('0x34')]['ids']),'OpenchannelQueueId':Number(_0xcb46be['params']['id'])});}});}})[_0xc692('0x26')](respondWithStatusCode(_0x52013c,null))[_0xc692('0x4b')](handleError(_0x52013c,null));};exports[_0xc692('0x8a')]=function(_0x501312,_0x5a4b20,_0x4e037d){var _0x1bb19e={};var _0x14e0ef={};var _0x4b1640;var _0x33c602;return db['OpenchannelQueue'][_0xc692('0x58')]({'where':{'id':_0x501312[_0xc692('0x48')]['id']}})['then'](handleEntityNotFound(_0x5a4b20,null))['then'](function(_0x4cd934){if(_0x4cd934){_0x4b1640=_0x4cd934;_0x14e0ef[_0xc692('0x38')]=_[_0xc692('0x35')](db[_0xc692('0x8b')][_0xc692('0x30')]);_0x14e0ef[_0xc692('0x34')]=_[_0xc692('0x35')](_0x501312['query']);_0x14e0ef[_0xc692('0x36')]=_[_0xc692('0x37')](_0x14e0ef[_0xc692('0x38')],_0x14e0ef[_0xc692('0x34')]);_0x1bb19e['attributes']=_[_0xc692('0x37')](_0x14e0ef['model'],qs[_0xc692('0x3a')](_0x501312[_0xc692('0x34')][_0xc692('0x3a')]));_0x1bb19e[_0xc692('0x39')]=_0x1bb19e[_0xc692('0x39')]['length']?_0x1bb19e[_0xc692('0x39')]:_0x14e0ef[_0xc692('0x38')];_0x1bb19e['order']=qs[_0xc692('0x3f')](_0x501312['query'][_0xc692('0x3f')]);_0x1bb19e['where']=qs[_0xc692('0x36')](_[_0xc692('0x41')](_0x501312[_0xc692('0x34')],_0x14e0ef[_0xc692('0x36')]));if(_0x501312[_0xc692('0x34')][_0xc692('0x42')]){_0x1bb19e['where']=_[_0xc692('0x44')](_0x1bb19e['where'],{'$or':_['map'](_0x1bb19e[_0xc692('0x39')],function(_0x43558d){var _0x33bbf1={};_0x33bbf1[_0x43558d]={'$like':'%'+_0x501312[_0xc692('0x34')][_0xc692('0x42')]+'%'};return _0x33bbf1;})});}_0x1bb19e=_[_0xc692('0x44')]({},_0x1bb19e,_0x501312['options']);return _0x4b1640[_0xc692('0x8a')](_0x1bb19e);}})['then'](function(_0xe74c49){if(_0xe74c49){_0x33c602=_0xe74c49[_0xc692('0x3b')];if(!_0x501312['query'][_0xc692('0x3c')]('nolimit')){_0x1bb19e[_0xc692('0x1e')]=qs[_0xc692('0x1e')](_0x501312['query']['limit']);_0x1bb19e[_0xc692('0x1d')]=qs['offset'](_0x501312[_0xc692('0x34')][_0xc692('0x1d')]);}return _0x4b1640[_0xc692('0x8a')](_0x1bb19e);}})[_0xc692('0x26')](function(_0x403d3d){if(_0x403d3d){return _0x403d3d?{'count':_0x33c602,'rows':_0x403d3d}:null;}})['then'](respondWithResult(_0x5a4b20,null))['catch'](handleError(_0x5a4b20,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index a261c10..9735ebb 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 _0x07c8=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x07c8,0xb0));var _0x807c=function(_0x36b2ec,_0x31504a){_0x36b2ec=_0x36b2ec-0x0;var _0x364a53=_0x07c8[_0x36b2ec];return _0x364a53;};'use strict';var EventEmitter=require(_0x807c('0x0'));var OpenchannelQueue=require(_0x807c('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x807c('0x2')](0x0);var events={'afterCreate':_0x807c('0x3'),'afterUpdate':_0x807c('0x4'),'afterDestroy':_0x807c('0x5')};function emitEvent(_0x4ce929){return function(_0x1e18d1,_0x433521,_0x17d18f){OpenchannelQueueEvents[_0x807c('0x6')](_0x4ce929+':'+_0x1e18d1['id'],_0x1e18d1);OpenchannelQueueEvents[_0x807c('0x6')](_0x4ce929,_0x1e18d1);_0x17d18f(null);};}for(var e in events){if(events[_0x807c('0x7')](e)){var event=events[e];OpenchannelQueue[_0x807c('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0xfab3=['save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelQueue'];(function(_0x2f4559,_0x4a72a7){var _0x51ec76=function(_0x4eece){while(--_0x4eece){_0x2f4559['push'](_0x2f4559['shift']());}};_0x51ec76(++_0x4a72a7);}(_0xfab3,0x16d));var _0x3fab=function(_0xd584f6,_0x34cfe6){_0xd584f6=_0xd584f6-0x0;var _0x5ec250=_0xfab3[_0xd584f6];return _0x5ec250;};'use strict';var EventEmitter=require(_0x3fab('0x0'));var OpenchannelQueue=require(_0x3fab('0x1'))['db'][_0x3fab('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3fab('0x3'),'afterUpdate':'update','afterDestroy':_0x3fab('0x4')};function emitEvent(_0xa78822){return function(_0x1fcfa9,_0x1b5e28,_0x40ce1b){OpenchannelQueueEvents[_0x3fab('0x5')](_0xa78822+':'+_0x1fcfa9['id'],_0x1fcfa9);OpenchannelQueueEvents['emit'](_0xa78822,_0x1fcfa9);_0x40ce1b(null);};}for(var e in events){if(events[_0x3fab('0x6')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x3fab('0x7')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 1d150ad..b2a0094 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 _0x346a=['../../config/environment','./openchannelQueue.attributes','lodash','util','../../config/logger','api','path','rimraf'];(function(_0x3c077d,_0x49beeb){var _0x35a4f8=function(_0x1323cf){while(--_0x1323cf){_0x3c077d['push'](_0x3c077d['shift']());}};_0x35a4f8(++_0x49beeb);}(_0x346a,0xb2));var _0xa346=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x346a[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0xa346('0x0'));var util=require(_0xa346('0x1'));var logger=require(_0xa346('0x2'))(_0xa346('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa346('0x4'));var rimraf=require(_0xa346('0x5'));var config=require(_0xa346('0x6'));var attributes=require(_0xa346('0x7'));module['exports']=function(_0x3effd3,_0x3689cb){return _0x3effd3['define']('OpenchannelQueue',attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb173=['util','../../config/logger','moment','request-promise','rimraf','exports','define','OpenchannelQueue','openchannel_queues','lodash'];(function(_0x2d0854,_0x4c5b12){var _0x287c91=function(_0x469aa7){while(--_0x469aa7){_0x2d0854['push'](_0x2d0854['shift']());}};_0x287c91(++_0x4c5b12);}(_0xb173,0x103));var _0x3b17=function(_0x5204d9,_0x23cdab){_0x5204d9=_0x5204d9-0x0;var _0x1825cd=_0xb173[_0x5204d9];return _0x1825cd;};'use strict';var _=require(_0x3b17('0x0'));var util=require(_0x3b17('0x1'));var logger=require(_0x3b17('0x2'))('api');var moment=require(_0x3b17('0x3'));var BPromise=require('bluebird');var rp=require(_0x3b17('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3b17('0x5'));var config=require('../../config/environment');var attributes=require('./openchannelQueue.attributes');module[_0x3b17('0x6')]=function(_0x1cc8b0,_0x4dd639){return _0x1cc8b0[_0x3b17('0x7')](_0x3b17('0x8'),attributes,{'tableName':_0x3b17('0x9'),'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 f1cc56b..72e9ded 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 _0x1214=['code','message','request\x20sent','result','GetOpenchannelQueue','findAll','options','where','attributes','include','map','model','then','catch','ShowOpenchannelQueue','OpenchannelQueue','raw','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./openchannelQueue.socket','register','request','info','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2b8309,_0xdd481f){var _0x5b17ab=function(_0x34d76f){while(--_0x34d76f){_0x2b8309['push'](_0x2b8309['shift']());}};_0x5b17ab(++_0xdd481f);}(_0x1214,0xe9));var _0x4121=function(_0x490b05,_0x7f0934){_0x490b05=_0x490b05-0x0;var _0x37ad3c=_0x1214[_0x490b05];return _0x37ad3c;};'use strict';var _=require('lodash');var util=require(_0x4121('0x0'));var moment=require('moment');var BPromise=require(_0x4121('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4121('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4121('0x3'));var logger=require('../../config/logger')(_0x4121('0x4'));var config=require(_0x4121('0x5'));var jayson=require(_0x4121('0x6'));var client=jayson[_0x4121('0x7')]['http']({'port':0x232a});config[_0x4121('0x8')]=_['defaults'](config[_0x4121('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x4121('0x9'))(new Redis(config['redis']));require(_0x4121('0xa'))[_0x4121('0xb')](socket);function respondWithRpcPromise(_0x149d39,_0x133f85,_0x451f5b){return new BPromise(function(_0x33c36a,_0x3c6ed0){return client[_0x4121('0xc')](_0x149d39,_0x451f5b)['then'](function(_0x333757){logger[_0x4121('0xd')](_0x4121('0xe'),_0x133f85,'request\x20sent');logger[_0x4121('0xf')](_0x4121('0x10'),_0x133f85,'request\x20sent',JSON[_0x4121('0x11')](_0x333757));if(_0x333757[_0x4121('0x12')]){if(_0x333757[_0x4121('0x12')][_0x4121('0x13')]===0x1f4){logger['error'](_0x4121('0xe'),_0x133f85,_0x333757['error'][_0x4121('0x14')]);return _0x3c6ed0(_0x333757['error'][_0x4121('0x14')]);}logger[_0x4121('0x12')](_0x4121('0xe'),_0x133f85,_0x333757[_0x4121('0x12')]['message']);return _0x33c36a(_0x333757[_0x4121('0x12')]['message']);}else{logger[_0x4121('0xd')]('OpenchannelQueue,\x20%s,\x20%s',_0x133f85,_0x4121('0x15'));_0x33c36a(_0x333757[_0x4121('0x16')][_0x4121('0x14')]);}})['catch'](function(_0x346f96){logger[_0x4121('0x12')](_0x4121('0xe'),_0x133f85,_0x346f96);_0x3c6ed0(_0x346f96);});});}exports[_0x4121('0x17')]=function(_0x5eebe0){var _0x202463=this;return new Promise(function(_0x3180b3,_0xbd6dca){return db['OpenchannelQueue'][_0x4121('0x18')]({'raw':_0x5eebe0[_0x4121('0x19')]?_0x5eebe0[_0x4121('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5eebe0['options']?_0x5eebe0[_0x4121('0x19')][_0x4121('0x1a')]||null:null,'attributes':_0x5eebe0[_0x4121('0x19')]?_0x5eebe0[_0x4121('0x19')][_0x4121('0x1b')]||null:null,'limit':_0x5eebe0[_0x4121('0x19')]?_0x5eebe0[_0x4121('0x19')]['limit']||null:null,'include':_0x5eebe0['options']?_0x5eebe0[_0x4121('0x19')][_0x4121('0x1c')]?_[_0x4121('0x1d')](_0x5eebe0[_0x4121('0x19')][_0x4121('0x1c')],function(_0xe5bd1f){return{'model':db[_0xe5bd1f['model']],'as':_0xe5bd1f['as'],'attributes':_0xe5bd1f[_0x4121('0x1b')],'include':_0xe5bd1f[_0x4121('0x1c')]?_[_0x4121('0x1d')](_0xe5bd1f[_0x4121('0x1c')],function(_0x201c41){return{'model':db[_0x201c41['model']],'as':_0x201c41['as'],'attributes':_0x201c41[_0x4121('0x1b')],'include':_0x201c41[_0x4121('0x1c')]?_[_0x4121('0x1d')](_0x201c41['include'],function(_0x3662e5){return{'model':db[_0x3662e5[_0x4121('0x1e')]],'as':_0x3662e5['as'],'attributes':_0x3662e5['attributes']};}):[]};}):[]};}):[]:[]})[_0x4121('0x1f')](function(_0xa5784c){logger['info']('GetOpenchannelQueue',_0x5eebe0);logger[_0x4121('0xf')](_0x4121('0x17'),_0x5eebe0,JSON['stringify'](_0xa5784c));_0x3180b3(_0xa5784c);})[_0x4121('0x20')](function(_0x491200){logger[_0x4121('0x12')](_0x4121('0x17'),_0x491200[_0x4121('0x14')],_0x5eebe0);_0xbd6dca(_0x202463[_0x4121('0x12')](0x1f4,_0x491200[_0x4121('0x14')]));});});};exports[_0x4121('0x21')]=function(_0x9f1ee3){var _0x967d25=this;return new Promise(function(_0x5533fb,_0x5eb147){return db[_0x4121('0x22')]['find']({'raw':_0x9f1ee3[_0x4121('0x19')]?_0x9f1ee3[_0x4121('0x19')][_0x4121('0x23')]===undefined?!![]:![]:!![],'where':_0x9f1ee3[_0x4121('0x19')]?_0x9f1ee3['options']['where']||null:null,'attributes':_0x9f1ee3[_0x4121('0x19')]?_0x9f1ee3['options']['attributes']||null:null,'include':_0x9f1ee3['options']?_0x9f1ee3[_0x4121('0x19')][_0x4121('0x1c')]?_[_0x4121('0x1d')](_0x9f1ee3[_0x4121('0x19')][_0x4121('0x1c')],function(_0x56c850){return{'model':db[_0x56c850[_0x4121('0x1e')]],'as':_0x56c850['as'],'attributes':_0x56c850[_0x4121('0x1b')],'include':_0x56c850[_0x4121('0x1c')]?_['map'](_0x56c850[_0x4121('0x1c')],function(_0x4aca83){return{'model':db[_0x4aca83[_0x4121('0x1e')]],'as':_0x4aca83['as'],'attributes':_0x4aca83[_0x4121('0x1b')],'include':_0x4aca83[_0x4121('0x1c')]?_[_0x4121('0x1d')](_0x4aca83['include'],function(_0x22dc24){return{'model':db[_0x22dc24['model']],'as':_0x22dc24['as'],'attributes':_0x22dc24[_0x4121('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4121('0x1f')](function(_0x325381){logger[_0x4121('0xd')]('ShowOpenchannelQueue',_0x9f1ee3);logger[_0x4121('0xf')](_0x4121('0x21'),_0x9f1ee3,JSON[_0x4121('0x11')](_0x325381));_0x5533fb(_0x325381);})[_0x4121('0x20')](function(_0x43a4e2){logger['error'](_0x4121('0x21'),_0x43a4e2['message'],_0x9f1ee3);_0x5eb147(_0x967d25[_0x4121('0x12')](0x1f4,_0x43a4e2[_0x4121('0x14')]));});});}; \ No newline at end of file +var _0x398d=['info','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetOpenchannelQueue','options','raw','where','attributes','limit','include','map','model','catch','ShowOpenchannelQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','./openchannelQueue.socket','register','request','then'];(function(_0x4060ca,_0x5234d8){var _0x1bc049=function(_0x670f1c){while(--_0x670f1c){_0x4060ca['push'](_0x4060ca['shift']());}};_0x1bc049(++_0x5234d8);}(_0x398d,0x88));var _0xd398=function(_0x53a6b1,_0x29455b){_0x53a6b1=_0x53a6b1-0x0;var _0x358f81=_0x398d[_0x53a6b1];return _0x358f81;};'use strict';var _=require(_0xd398('0x0'));var util=require(_0xd398('0x1'));var moment=require(_0xd398('0x2'));var BPromise=require(_0xd398('0x3'));var rs=require(_0xd398('0x4'));var fs=require('fs');var Redis=require(_0xd398('0x5'));var db=require(_0xd398('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd398('0x7'));var jayson=require(_0xd398('0x8'));var client=jayson[_0xd398('0x9')][_0xd398('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xd398('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd398('0xb')]));require(_0xd398('0xc'))[_0xd398('0xd')](socket);function respondWithRpcPromise(_0x313640,_0x453abe,_0x3c789d){return new BPromise(function(_0x466cf1,_0x3788e3){return client[_0xd398('0xe')](_0x313640,_0x3c789d)[_0xd398('0xf')](function(_0x27be36){logger[_0xd398('0x10')](_0xd398('0x11'),_0x453abe,'request\x20sent');logger[_0xd398('0x12')](_0xd398('0x13'),_0x453abe,_0xd398('0x14'),JSON[_0xd398('0x15')](_0x27be36));if(_0x27be36['error']){if(_0x27be36[_0xd398('0x16')][_0xd398('0x17')]===0x1f4){logger[_0xd398('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x453abe,_0x27be36['error']['message']);return _0x3788e3(_0x27be36['error'][_0xd398('0x18')]);}logger[_0xd398('0x16')](_0xd398('0x11'),_0x453abe,_0x27be36[_0xd398('0x16')][_0xd398('0x18')]);return _0x466cf1(_0x27be36['error']['message']);}else{logger[_0xd398('0x10')](_0xd398('0x11'),_0x453abe,_0xd398('0x14'));_0x466cf1(_0x27be36[_0xd398('0x19')][_0xd398('0x18')]);}})['catch'](function(_0x56f115){logger['error'](_0xd398('0x11'),_0x453abe,_0x56f115);_0x3788e3(_0x56f115);});});}exports[_0xd398('0x1a')]=function(_0x2c992a){var _0x3623c3=this;return new Promise(function(_0x383a39,_0xb8ee34){return db['OpenchannelQueue']['findAll']({'raw':_0x2c992a[_0xd398('0x1b')]?_0x2c992a['options'][_0xd398('0x1c')]===undefined?!![]:![]:!![],'where':_0x2c992a[_0xd398('0x1b')]?_0x2c992a[_0xd398('0x1b')][_0xd398('0x1d')]||null:null,'attributes':_0x2c992a[_0xd398('0x1b')]?_0x2c992a[_0xd398('0x1b')][_0xd398('0x1e')]||null:null,'limit':_0x2c992a[_0xd398('0x1b')]?_0x2c992a[_0xd398('0x1b')][_0xd398('0x1f')]||null:null,'include':_0x2c992a[_0xd398('0x1b')]?_0x2c992a[_0xd398('0x1b')][_0xd398('0x20')]?_[_0xd398('0x21')](_0x2c992a['options'][_0xd398('0x20')],function(_0x2953ec){return{'model':db[_0x2953ec['model']],'as':_0x2953ec['as'],'attributes':_0x2953ec[_0xd398('0x1e')],'include':_0x2953ec[_0xd398('0x20')]?_[_0xd398('0x21')](_0x2953ec[_0xd398('0x20')],function(_0x35e804){return{'model':db[_0x35e804[_0xd398('0x22')]],'as':_0x35e804['as'],'attributes':_0x35e804[_0xd398('0x1e')],'include':_0x35e804['include']?_[_0xd398('0x21')](_0x35e804['include'],function(_0xf86365){return{'model':db[_0xf86365['model']],'as':_0xf86365['as'],'attributes':_0xf86365[_0xd398('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd398('0xf')](function(_0x449119){logger[_0xd398('0x10')]('GetOpenchannelQueue',_0x2c992a);logger[_0xd398('0x12')](_0xd398('0x1a'),_0x2c992a,JSON['stringify'](_0x449119));_0x383a39(_0x449119);})[_0xd398('0x23')](function(_0x1ceefe){logger[_0xd398('0x16')](_0xd398('0x1a'),_0x1ceefe[_0xd398('0x18')],_0x2c992a);_0xb8ee34(_0x3623c3[_0xd398('0x16')](0x1f4,_0x1ceefe['message']));});});};exports[_0xd398('0x24')]=function(_0x2c3bef){var _0x3f3b33=this;return new Promise(function(_0x11bc7a,_0x3612f9){return db['OpenchannelQueue'][_0xd398('0x25')]({'raw':_0x2c3bef['options']?_0x2c3bef[_0xd398('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2c3bef['options']?_0x2c3bef['options'][_0xd398('0x1d')]||null:null,'attributes':_0x2c3bef[_0xd398('0x1b')]?_0x2c3bef[_0xd398('0x1b')][_0xd398('0x1e')]||null:null,'include':_0x2c3bef[_0xd398('0x1b')]?_0x2c3bef['options'][_0xd398('0x20')]?_[_0xd398('0x21')](_0x2c3bef['options'][_0xd398('0x20')],function(_0x365289){return{'model':db[_0x365289[_0xd398('0x22')]],'as':_0x365289['as'],'attributes':_0x365289['attributes'],'include':_0x365289[_0xd398('0x20')]?_[_0xd398('0x21')](_0x365289['include'],function(_0x1f0ee1){return{'model':db[_0x1f0ee1[_0xd398('0x22')]],'as':_0x1f0ee1['as'],'attributes':_0x1f0ee1[_0xd398('0x1e')],'include':_0x1f0ee1['include']?_[_0xd398('0x21')](_0x1f0ee1[_0xd398('0x20')],function(_0x18261a){return{'model':db[_0x18261a['model']],'as':_0x18261a['as'],'attributes':_0x18261a['attributes']};}):[]};}):[]};}):[]:[]})[_0xd398('0xf')](function(_0x12fb55){logger[_0xd398('0x10')](_0xd398('0x24'),_0x2c3bef);logger[_0xd398('0x12')]('ShowOpenchannelQueue',_0x2c3bef,JSON[_0xd398('0x15')](_0x12fb55));_0x11bc7a(_0x12fb55);})[_0xd398('0x23')](function(_0x5cc8f6){logger[_0xd398('0x16')](_0xd398('0x24'),_0x5cc8f6['message'],_0x2c3bef);_0x3612f9(_0x3f3b33[_0xd398('0x16')](0x1f4,_0x5cc8f6['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index e9fa261..d2b6a79 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 _0xafec=['remove','update','emit','removeListener','register','length','openchannelQueue:','save'];(function(_0x2a821e,_0x54ce0d){var _0x358b7a=function(_0x3eead8){while(--_0x3eead8){_0x2a821e['push'](_0x2a821e['shift']());}};_0x358b7a(++_0x54ce0d);}(_0xafec,0xff));var _0xcafe=function(_0x32dcbd,_0x522a54){_0x32dcbd=_0x32dcbd-0x0;var _0x4d2e4d=_0xafec[_0x32dcbd];return _0x4d2e4d;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xcafe('0x0'),_0xcafe('0x1'),_0xcafe('0x2')];function createListener(_0x23fe37,_0x435291){return function(_0x81336b){_0x435291[_0xcafe('0x3')](_0x23fe37,_0x81336b);};}function removeListener(_0x2bd7ed,_0x488a73){return function(){OpenchannelQueueEvents[_0xcafe('0x4')](_0x2bd7ed,_0x488a73);};}exports[_0xcafe('0x5')]=function(_0x335866){for(var _0x8e232a=0x0,_0x5d4bfe=events[_0xcafe('0x6')];_0x8e232a<_0x5d4bfe;_0x8e232a++){var _0x292346=events[_0x8e232a];var _0x586fb2=createListener(_0xcafe('0x7')+_0x292346,_0x335866);OpenchannelQueueEvents['on'](_0x292346,_0x586fb2);}}; \ No newline at end of file +var _0x8b90=['openchannelQueue:','./openchannelQueue.events','save','remove','removeListener','register','length'];(function(_0x1f8246,_0x50cd78){var _0x41e27d=function(_0x39c3c8){while(--_0x39c3c8){_0x1f8246['push'](_0x1f8246['shift']());}};_0x41e27d(++_0x50cd78);}(_0x8b90,0x1a5));var _0x08b9=function(_0x1a22ef,_0x1ef6df){_0x1a22ef=_0x1a22ef-0x0;var _0x4a8226=_0x8b90[_0x1a22ef];return _0x4a8226;};'use strict';var OpenchannelQueueEvents=require(_0x08b9('0x0'));var events=[_0x08b9('0x1'),_0x08b9('0x2'),'update'];function createListener(_0x1847e5,_0x3bd1e6){return function(_0x171190){_0x3bd1e6['emit'](_0x1847e5,_0x171190);};}function removeListener(_0x45879c,_0x14a148){return function(){OpenchannelQueueEvents[_0x08b9('0x3')](_0x45879c,_0x14a148);};}exports[_0x08b9('0x4')]=function(_0x1bffa5){for(var _0x2a64f2=0x0,_0x4ecccf=events[_0x08b9('0x5')];_0x2a64f2<_0x4ecccf;_0x2a64f2++){var _0x213cb3=events[_0x2a64f2];var _0x4759a8=createListener(_0x08b9('0x6')+_0x213cb3,_0x1bffa5);OpenchannelQueueEvents['on'](_0x213cb3,_0x4759a8);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 3b0ed09..b96269b 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 _0x82aa=['get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','index'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x82aa,0x115));var _0xa82a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x82aa[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0xa82a('0x0'));var util=require('util');var path=require(_0xa82a('0x1'));var timeout=require(_0xa82a('0x2'));var express=require(_0xa82a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa82a('0x4'));var interaction=require(_0xa82a('0x5'));var config=require(_0xa82a('0x6'));var controller=require(_0xa82a('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xa82a('0x8')]);router[_0xa82a('0x9')](_0xa82a('0xa'),auth[_0xa82a('0xb')](),controller[_0xa82a('0xc')]);router['get'](_0xa82a('0xd'),auth[_0xa82a('0xb')](),controller[_0xa82a('0xe')]);router[_0xa82a('0xf')]('/',auth['isAuthenticated'](),controller[_0xa82a('0x10')]);router[_0xa82a('0x11')](_0xa82a('0xd'),auth[_0xa82a('0xb')](),controller[_0xa82a('0x12')]);router[_0xa82a('0x13')]('/:id',auth[_0xa82a('0xb')](),controller[_0xa82a('0x14')]);module[_0xa82a('0x15')]=router; \ No newline at end of file +var _0xa8b9=['post','create','put','update','delete','destroy','exports','express','Router','fs-extra','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x4e992b,_0x1778a3){var _0x100346=function(_0x362860){while(--_0x362860){_0x4e992b['push'](_0x4e992b['shift']());}};_0x100346(++_0x1778a3);}(_0xa8b9,0x97));var _0x9a8b=function(_0x2866f6,_0xc44b99){_0x2866f6=_0x2866f6-0x0;var _0x3648c2=_0xa8b9[_0x2866f6];return _0x3648c2;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9a8b('0x0'));var router=express[_0x9a8b('0x1')]();var fs_extra=require(_0x9a8b('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9a8b('0x3'));var controller=require(_0x9a8b('0x4'));router[_0x9a8b('0x5')]('/',auth[_0x9a8b('0x6')](),controller[_0x9a8b('0x7')]);router[_0x9a8b('0x5')](_0x9a8b('0x8'),auth[_0x9a8b('0x6')](),controller['describe']);router[_0x9a8b('0x5')](_0x9a8b('0x9'),auth[_0x9a8b('0x6')](),controller[_0x9a8b('0xa')]);router[_0x9a8b('0xb')]('/',auth[_0x9a8b('0x6')](),controller[_0x9a8b('0xc')]);router[_0x9a8b('0xd')](_0x9a8b('0x9'),auth[_0x9a8b('0x6')](),controller[_0x9a8b('0xe')]);router[_0x9a8b('0xf')](_0x9a8b('0x9'),auth['isAuthenticated'](),controller[_0x9a8b('0x10')]);module[_0x9a8b('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 2628690..9208971 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 _0xa9fd=['DATE','sequelize','exports'];(function(_0xf5e2f3,_0x4531f0){var _0x35e8e2=function(_0x5e833c){while(--_0x5e833c){_0xf5e2f3['push'](_0xf5e2f3['shift']());}};_0x35e8e2(++_0x4531f0);}(_0xa9fd,0xa0));var _0xda9f=function(_0x4df144,_0x43b6a0){_0x4df144=_0x4df144-0x0;var _0x527877=_0xa9fd[_0x4df144];return _0x527877;};'use strict';var moment=require('moment');var Sequelize=require(_0xda9f('0x0'));module[_0xda9f('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xda9f('0x2')]},'acceptAt':{'type':Sequelize[_0xda9f('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9a6e=['DATE','moment','sequelize','STRING'];(function(_0x1ca438,_0x3d250e){var _0x4959ac=function(_0x3d8799){while(--_0x3d8799){_0x1ca438['push'](_0x1ca438['shift']());}};_0x4959ac(++_0x3d250e);}(_0x9a6e,0xc1));var _0xe9a6=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x9a6e[_0x11c573];return _0x6b72de;};'use strict';var moment=require(_0xe9a6('0x0'));var Sequelize=require(_0xe9a6('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9a6('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xe9a6('0x2')]},'joinAt':{'type':Sequelize[_0xe9a6('0x3')]},'leaveAt':{'type':Sequelize[_0xe9a6('0x3')]},'acceptAt':{'type':Sequelize[_0xe9a6('0x3')]},'exitAt':{'type':Sequelize[_0xe9a6('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 947d9df..7012998 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 _0xa7dd=['filter','VIRTUAL','options','OpenchannelQueueReport','includeAll','findAll','rows','catch','params','merge','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','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','../../mysqldb','sendStatus','end','json','offset','count','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x151418,_0x2cbffa){var _0x40e29a=function(_0xec4d7){while(--_0xec4d7){_0x151418['push'](_0x151418['shift']());}};_0x40e29a(++_0x2cbffa);}(_0xa7dd,0x13e));var _0xda7d=function(_0x4e584a,_0x5127bc){_0x4e584a=_0x4e584a-0x0;var _0x41e8cc=_0xa7dd[_0x4e584a];return _0x41e8cc;};'use strict';var emlformat=require(_0xda7d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xda7d('0x1'));var jsonpatch=require(_0xda7d('0x2'));var rp=require(_0xda7d('0x3'));var moment=require(_0xda7d('0x4'));var BPromise=require(_0xda7d('0x5'));var Mustache=require(_0xda7d('0x6'));var util=require('util');var path=require('path');var sox=require(_0xda7d('0x7'));var csv=require(_0xda7d('0x8'));var ejs=require(_0xda7d('0x9'));var fs=require('fs');var fs_extra=require(_0xda7d('0xa'));var _=require(_0xda7d('0xb'));var squel=require(_0xda7d('0xc'));var crypto=require('crypto');var jsforce=require(_0xda7d('0xd'));var deskjs=require(_0xda7d('0xe'));var toCsv=require(_0xda7d('0x8'));var querystring=require(_0xda7d('0xf'));var Papa=require(_0xda7d('0x10'));var Redis=require(_0xda7d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xda7d('0x12'));var as=require(_0xda7d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xda7d('0x14'))(_0xda7d('0x15'));var utils=require(_0xda7d('0x16'));var config=require(_0xda7d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xda7d('0x18'))['db'];function respondWithStatusCode(_0x40a1af,_0x24d854){_0x24d854=_0x24d854||0xcc;return function(_0x31349b){if(_0x31349b){return _0x40a1af[_0xda7d('0x19')](_0x24d854);}return _0x40a1af['status'](_0x24d854)[_0xda7d('0x1a')]();};}function respondWithResult(_0x2bcfc1,_0x58ca85){_0x58ca85=_0x58ca85||0xc8;return function(_0x4f3980){if(_0x4f3980){return _0x2bcfc1['status'](_0x58ca85)[_0xda7d('0x1b')](_0x4f3980);}};}function respondWithFilteredResult(_0xc9ea96,_0x4ae8df){return function(_0x43057c){if(_0x43057c){var _0x230d5c=typeof _0x4ae8df[_0xda7d('0x1c')]==='undefined'&&typeof _0x4ae8df['limit']==='undefined';var _0x3ef057=_0x43057c[_0xda7d('0x1d')];var _0x3e8e19=_0x230d5c?0x0:_0x4ae8df[_0xda7d('0x1c')];var _0x3b1cfc=_0x230d5c?_0x43057c[_0xda7d('0x1d')]:_0x4ae8df['offset']+_0x4ae8df[_0xda7d('0x1e')];var _0x728f1;if(_0x3b1cfc>=_0x3ef057){_0x3b1cfc=_0x3ef057;_0x728f1=0xc8;}else{_0x728f1=0xce;}_0xc9ea96[_0xda7d('0x1f')](_0x728f1);return _0xc9ea96[_0xda7d('0x20')](_0xda7d('0x21'),_0x3e8e19+'-'+_0x3b1cfc+'/'+_0x3ef057)[_0xda7d('0x1b')](_0x43057c);}return null;};}function patchUpdates(_0x55b68c){return function(_0x3556d0){try{jsonpatch[_0xda7d('0x22')](_0x3556d0,_0x55b68c,!![]);}catch(_0x39a38b){return BPromise[_0xda7d('0x23')](_0x39a38b);}return _0x3556d0[_0xda7d('0x24')]();};}function saveUpdates(_0x353b55,_0x361226){return function(_0x22665d){if(_0x22665d){return _0x22665d[_0xda7d('0x25')](_0x353b55)[_0xda7d('0x26')](function(_0x53d8bc){return _0x53d8bc;});}return null;};}function removeEntity(_0x3a620b,_0x156412){return function(_0x19aa40){if(_0x19aa40){return _0x19aa40[_0xda7d('0x27')]()[_0xda7d('0x26')](function(){_0x3a620b[_0xda7d('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b1cb1,_0x46092f){return function(_0x219ca3){if(!_0x219ca3){_0x5b1cb1[_0xda7d('0x19')](0x194);}return _0x219ca3;};}function handleError(_0x30b3f1,_0x313e89){_0x313e89=_0x313e89||0x1f4;return function(_0x5e22ab){logger[_0xda7d('0x28')](_0x5e22ab[_0xda7d('0x29')]);if(_0x5e22ab[_0xda7d('0x2a')]){delete _0x5e22ab[_0xda7d('0x2a')];}_0x30b3f1['status'](_0x313e89)[_0xda7d('0x2b')](_0x5e22ab);};}exports[_0xda7d('0x2c')]=function(_0x2d191b,_0xe055d){var _0xd9746f={},_0xd24599={},_0x23efcf={'count':0x0,'rows':[]};var _0x131648=_[_0xda7d('0x2d')](db['OpenchannelQueueReport'][_0xda7d('0x2e')],function(_0x1f9756){return{'name':_0x1f9756[_0xda7d('0x2f')],'type':_0x1f9756[_0xda7d('0x30')][_0xda7d('0x31')]};});_0xd24599[_0xda7d('0x32')]=_['map'](_0x131648,_0xda7d('0x2a'));_0xd24599[_0xda7d('0x33')]=_[_0xda7d('0x34')](_0x2d191b[_0xda7d('0x33')]);_0xd24599[_0xda7d('0x35')]=_[_0xda7d('0x36')](_0xd24599['model'],_0xd24599[_0xda7d('0x33')]);_0xd9746f[_0xda7d('0x37')]=_[_0xda7d('0x36')](_0xd24599[_0xda7d('0x32')],qs[_0xda7d('0x38')](_0x2d191b['query'][_0xda7d('0x38')]));_0xd9746f[_0xda7d('0x37')]=_0xd9746f[_0xda7d('0x37')]['length']?_0xd9746f[_0xda7d('0x37')]:_0xd24599[_0xda7d('0x32')];if(!_0x2d191b[_0xda7d('0x33')][_0xda7d('0x39')](_0xda7d('0x3a'))){_0xd9746f[_0xda7d('0x1e')]=qs[_0xda7d('0x1e')](_0x2d191b[_0xda7d('0x33')]['limit']);_0xd9746f[_0xda7d('0x1c')]=qs['offset'](_0x2d191b[_0xda7d('0x33')][_0xda7d('0x1c')]);}_0xd9746f[_0xda7d('0x3b')]=qs[_0xda7d('0x3c')](_0x2d191b[_0xda7d('0x33')][_0xda7d('0x3c')]);_0xd9746f[_0xda7d('0x3d')]=qs[_0xda7d('0x35')](_['pick'](_0x2d191b[_0xda7d('0x33')],_0xd24599[_0xda7d('0x35')]),_0x131648);if(_0x2d191b['query'][_0xda7d('0x3e')]){_0xd9746f[_0xda7d('0x3d')]=_['merge'](_0xd9746f[_0xda7d('0x3d')],{'$or':_[_0xda7d('0x2d')](_0x131648,function(_0x5a3872){if(_0x5a3872[_0xda7d('0x30')]!==_0xda7d('0x3f')){var _0x1fdbb7={};_0x1fdbb7[_0x5a3872['name']]={'$like':'%'+_0x2d191b['query'][_0xda7d('0x3e')]+'%'};return _0x1fdbb7;}})});}_0xd9746f=_['merge']({},_0xd9746f,_0x2d191b[_0xda7d('0x40')]);var _0x24559e={'where':_0xd9746f[_0xda7d('0x3d')]};return db[_0xda7d('0x41')]['count'](_0x24559e)['then'](function(_0x13f7de){_0x23efcf[_0xda7d('0x1d')]=_0x13f7de;if(_0x2d191b[_0xda7d('0x33')][_0xda7d('0x42')]){_0xd9746f['include']=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xda7d('0x43')](_0xd9746f);})['then'](function(_0x5bed3b){_0x23efcf[_0xda7d('0x44')]=_0x5bed3b;return _0x23efcf;})[_0xda7d('0x26')](respondWithFilteredResult(_0xe055d,_0xd9746f))[_0xda7d('0x45')](handleError(_0xe055d,null));};exports['show']=function(_0x503947,_0x5e5e9b){var _0x5c35e8={'raw':!![],'where':{'id':_0x503947[_0xda7d('0x46')]['id']}},_0x1d7bc0={};_0x1d7bc0['model']=_[_0xda7d('0x34')](db[_0xda7d('0x41')]['rawAttributes']);_0x1d7bc0['query']=_['keys'](_0x503947['query']);_0x1d7bc0[_0xda7d('0x35')]=_[_0xda7d('0x36')](_0x1d7bc0[_0xda7d('0x32')],_0x1d7bc0[_0xda7d('0x33')]);_0x5c35e8[_0xda7d('0x37')]=_[_0xda7d('0x36')](_0x1d7bc0[_0xda7d('0x32')],qs[_0xda7d('0x38')](_0x503947['query'][_0xda7d('0x38')]));_0x5c35e8[_0xda7d('0x37')]=_0x5c35e8[_0xda7d('0x37')]['length']?_0x5c35e8['attributes']:_0x1d7bc0[_0xda7d('0x32')];if(_0x503947[_0xda7d('0x33')][_0xda7d('0x42')]){_0x5c35e8['include']=[{'all':!![]}];}_0x5c35e8=_[_0xda7d('0x47')]({},_0x5c35e8,_0x503947[_0xda7d('0x40')]);return db[_0xda7d('0x41')][_0xda7d('0x48')](_0x5c35e8)[_0xda7d('0x26')](handleEntityNotFound(_0x5e5e9b,null))['then'](respondWithResult(_0x5e5e9b,null))[_0xda7d('0x45')](handleError(_0x5e5e9b,null));};exports[_0xda7d('0x49')]=function(_0x4b50f6,_0x420db1){return db[_0xda7d('0x41')][_0xda7d('0x49')](_0x4b50f6['body'],{})[_0xda7d('0x26')](respondWithResult(_0x420db1,0xc9))[_0xda7d('0x45')](handleError(_0x420db1,null));};exports[_0xda7d('0x25')]=function(_0xd587bf,_0x4a1d8d){if(_0xd587bf[_0xda7d('0x4a')]['id']){delete _0xd587bf['body']['id'];}return db[_0xda7d('0x41')]['find']({'where':{'id':_0xd587bf[_0xda7d('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a1d8d,null))[_0xda7d('0x26')](saveUpdates(_0xd587bf['body'],null))[_0xda7d('0x26')](respondWithResult(_0x4a1d8d,null))[_0xda7d('0x45')](handleError(_0x4a1d8d,null));};exports[_0xda7d('0x27')]=function(_0x362054,_0x2b59de){return db['OpenchannelQueueReport'][_0xda7d('0x48')]({'where':{'id':_0x362054['params']['id']}})[_0xda7d('0x26')](handleEntityNotFound(_0x2b59de,null))[_0xda7d('0x26')](removeEntity(_0x2b59de,null))[_0xda7d('0x45')](handleError(_0x2b59de,null));};exports['describe']=function(_0x1dfc70,_0xecd119){return db['OpenchannelQueueReport'][_0xda7d('0x4b')]()[_0xda7d('0x26')](respondWithResult(_0xecd119,null))[_0xda7d('0x45')](handleError(_0xecd119,null));}; \ No newline at end of file +var _0xa779=['index','OpenchannelQueueReport','rawAttributes','fieldName','map','query','keys','intersection','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','catch','show','fields','includeAll','include','find','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','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send'];(function(_0x96a6d6,_0x5c5dd8){var _0xd845b1=function(_0x4b0f79){while(--_0x4b0f79){_0x96a6d6['push'](_0x96a6d6['shift']());}};_0xd845b1(++_0x5c5dd8);}(_0xa779,0x1f3));var _0x9a77=function(_0x301b89,_0x145f35){_0x301b89=_0x301b89-0x0;var _0x2c97e8=_0xa779[_0x301b89];return _0x2c97e8;};'use strict';var emlformat=require(_0x9a77('0x0'));var rimraf=require(_0x9a77('0x1'));var zipdir=require(_0x9a77('0x2'));var jsonpatch=require(_0x9a77('0x3'));var rp=require(_0x9a77('0x4'));var moment=require(_0x9a77('0x5'));var BPromise=require(_0x9a77('0x6'));var Mustache=require('mustache');var util=require(_0x9a77('0x7'));var path=require(_0x9a77('0x8'));var sox=require(_0x9a77('0x9'));var csv=require(_0x9a77('0xa'));var ejs=require(_0x9a77('0xb'));var fs=require('fs');var fs_extra=require(_0x9a77('0xc'));var _=require(_0x9a77('0xd'));var squel=require(_0x9a77('0xe'));var crypto=require(_0x9a77('0xf'));var jsforce=require(_0x9a77('0x10'));var deskjs=require(_0x9a77('0x11'));var toCsv=require(_0x9a77('0xa'));var querystring=require(_0x9a77('0x12'));var Papa=require('papaparse');var Redis=require(_0x9a77('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9a77('0x14'));var hardwareService=require(_0x9a77('0x15'));var logger=require(_0x9a77('0x16'))(_0x9a77('0x17'));var utils=require(_0x9a77('0x18'));var config=require(_0x9a77('0x19'));var licenseUtil=require(_0x9a77('0x1a'));var db=require(_0x9a77('0x1b'))['db'];function respondWithStatusCode(_0x362d37,_0x18175f){_0x18175f=_0x18175f||0xcc;return function(_0x27d456){if(_0x27d456){return _0x362d37['sendStatus'](_0x18175f);}return _0x362d37[_0x9a77('0x1c')](_0x18175f)[_0x9a77('0x1d')]();};}function respondWithResult(_0x576187,_0xbb31c6){_0xbb31c6=_0xbb31c6||0xc8;return function(_0x6218d){if(_0x6218d){return _0x576187['status'](_0xbb31c6)[_0x9a77('0x1e')](_0x6218d);}};}function respondWithFilteredResult(_0x24a780,_0x1715c0){return function(_0x156dbc){if(_0x156dbc){var _0x44f7b8=typeof _0x1715c0['offset']==='undefined'&&typeof _0x1715c0['limit']===_0x9a77('0x1f');var _0x500e01=_0x156dbc[_0x9a77('0x20')];var _0x16df51=_0x44f7b8?0x0:_0x1715c0[_0x9a77('0x21')];var _0x1c7883=_0x44f7b8?_0x156dbc['count']:_0x1715c0[_0x9a77('0x21')]+_0x1715c0[_0x9a77('0x22')];var _0x3f5829;if(_0x1c7883>=_0x500e01){_0x1c7883=_0x500e01;_0x3f5829=0xc8;}else{_0x3f5829=0xce;}_0x24a780[_0x9a77('0x1c')](_0x3f5829);return _0x24a780[_0x9a77('0x23')](_0x9a77('0x24'),_0x16df51+'-'+_0x1c7883+'/'+_0x500e01)['json'](_0x156dbc);}return null;};}function patchUpdates(_0x26cf10){return function(_0x3f4996){try{jsonpatch[_0x9a77('0x25')](_0x3f4996,_0x26cf10,!![]);}catch(_0x4b1408){return BPromise[_0x9a77('0x26')](_0x4b1408);}return _0x3f4996[_0x9a77('0x27')]();};}function saveUpdates(_0x51b130,_0x5ef71f){return function(_0x580492){if(_0x580492){return _0x580492[_0x9a77('0x28')](_0x51b130)[_0x9a77('0x29')](function(_0x2bb4f0){return _0x2bb4f0;});}return null;};}function removeEntity(_0x143c72,_0x41a652){return function(_0x17ca2e){if(_0x17ca2e){return _0x17ca2e[_0x9a77('0x2a')]()['then'](function(){_0x143c72['status'](0xcc)[_0x9a77('0x1d')]();});}};}function handleEntityNotFound(_0x384e26,_0x5f3ea1){return function(_0x18764e){if(!_0x18764e){_0x384e26[_0x9a77('0x2b')](0x194);}return _0x18764e;};}function handleError(_0x2959d1,_0xfc7654){_0xfc7654=_0xfc7654||0x1f4;return function(_0x443c2b){logger['error'](_0x443c2b[_0x9a77('0x2c')]);if(_0x443c2b[_0x9a77('0x2d')]){delete _0x443c2b[_0x9a77('0x2d')];}_0x2959d1[_0x9a77('0x1c')](_0xfc7654)[_0x9a77('0x2e')](_0x443c2b);};}exports[_0x9a77('0x2f')]=function(_0x1ee2e8,_0x588066){var _0x59d97b={},_0x12500c={},_0x4e2470={'count':0x0,'rows':[]};var _0x1dac08=_['map'](db[_0x9a77('0x30')][_0x9a77('0x31')],function(_0x2771a7){return{'name':_0x2771a7[_0x9a77('0x32')],'type':_0x2771a7['type']['key']};});_0x12500c['model']=_[_0x9a77('0x33')](_0x1dac08,_0x9a77('0x2d'));_0x12500c[_0x9a77('0x34')]=_[_0x9a77('0x35')](_0x1ee2e8[_0x9a77('0x34')]);_0x12500c['filters']=_[_0x9a77('0x36')](_0x12500c['model'],_0x12500c[_0x9a77('0x34')]);_0x59d97b[_0x9a77('0x37')]=_['intersection'](_0x12500c['model'],qs['fields'](_0x1ee2e8[_0x9a77('0x34')]['fields']));_0x59d97b['attributes']=_0x59d97b['attributes'][_0x9a77('0x38')]?_0x59d97b[_0x9a77('0x37')]:_0x12500c[_0x9a77('0x39')];if(!_0x1ee2e8[_0x9a77('0x34')][_0x9a77('0x3a')](_0x9a77('0x3b'))){_0x59d97b['limit']=qs[_0x9a77('0x22')](_0x1ee2e8[_0x9a77('0x34')][_0x9a77('0x22')]);_0x59d97b[_0x9a77('0x21')]=qs['offset'](_0x1ee2e8[_0x9a77('0x34')][_0x9a77('0x21')]);}_0x59d97b[_0x9a77('0x3c')]=qs['sort'](_0x1ee2e8[_0x9a77('0x34')][_0x9a77('0x3d')]);_0x59d97b[_0x9a77('0x3e')]=qs[_0x9a77('0x3f')](_[_0x9a77('0x40')](_0x1ee2e8[_0x9a77('0x34')],_0x12500c[_0x9a77('0x3f')]),_0x1dac08);if(_0x1ee2e8['query'][_0x9a77('0x41')]){_0x59d97b[_0x9a77('0x3e')]=_[_0x9a77('0x42')](_0x59d97b['where'],{'$or':_[_0x9a77('0x33')](_0x1dac08,function(_0x5b57e8){if(_0x5b57e8[_0x9a77('0x43')]!=='VIRTUAL'){var _0x5890b3={};_0x5890b3[_0x5b57e8[_0x9a77('0x2d')]]={'$like':'%'+_0x1ee2e8[_0x9a77('0x34')]['filter']+'%'};return _0x5890b3;}})});}_0x59d97b=_[_0x9a77('0x42')]({},_0x59d97b,_0x1ee2e8[_0x9a77('0x44')]);var _0x669a83={'where':_0x59d97b[_0x9a77('0x3e')]};return db[_0x9a77('0x30')][_0x9a77('0x20')](_0x669a83)[_0x9a77('0x29')](function(_0x46be78){_0x4e2470[_0x9a77('0x20')]=_0x46be78;if(_0x1ee2e8[_0x9a77('0x34')]['includeAll']){_0x59d97b['include']=[{'all':!![]}];}return db[_0x9a77('0x30')]['findAll'](_0x59d97b);})[_0x9a77('0x29')](function(_0x37e1f1){_0x4e2470['rows']=_0x37e1f1;return _0x4e2470;})[_0x9a77('0x29')](respondWithFilteredResult(_0x588066,_0x59d97b))[_0x9a77('0x45')](handleError(_0x588066,null));};exports[_0x9a77('0x46')]=function(_0x25ae20,_0x2322f3){var _0x4bf5fd={'raw':!![],'where':{'id':_0x25ae20['params']['id']}},_0x530660={};_0x530660['model']=_[_0x9a77('0x35')](db[_0x9a77('0x30')][_0x9a77('0x31')]);_0x530660[_0x9a77('0x34')]=_['keys'](_0x25ae20[_0x9a77('0x34')]);_0x530660[_0x9a77('0x3f')]=_['intersection'](_0x530660[_0x9a77('0x39')],_0x530660[_0x9a77('0x34')]);_0x4bf5fd['attributes']=_[_0x9a77('0x36')](_0x530660[_0x9a77('0x39')],qs[_0x9a77('0x47')](_0x25ae20[_0x9a77('0x34')]['fields']));_0x4bf5fd[_0x9a77('0x37')]=_0x4bf5fd[_0x9a77('0x37')][_0x9a77('0x38')]?_0x4bf5fd[_0x9a77('0x37')]:_0x530660[_0x9a77('0x39')];if(_0x25ae20['query'][_0x9a77('0x48')]){_0x4bf5fd[_0x9a77('0x49')]=[{'all':!![]}];}_0x4bf5fd=_[_0x9a77('0x42')]({},_0x4bf5fd,_0x25ae20[_0x9a77('0x44')]);return db[_0x9a77('0x30')][_0x9a77('0x4a')](_0x4bf5fd)[_0x9a77('0x29')](handleEntityNotFound(_0x2322f3,null))[_0x9a77('0x29')](respondWithResult(_0x2322f3,null))[_0x9a77('0x45')](handleError(_0x2322f3,null));};exports['create']=function(_0x4a9d08,_0x59b1ed){return db[_0x9a77('0x30')]['create'](_0x4a9d08[_0x9a77('0x4b')],{})[_0x9a77('0x29')](respondWithResult(_0x59b1ed,0xc9))[_0x9a77('0x45')](handleError(_0x59b1ed,null));};exports[_0x9a77('0x28')]=function(_0xa6ba8b,_0x414bca){if(_0xa6ba8b['body']['id']){delete _0xa6ba8b['body']['id'];}return db[_0x9a77('0x30')][_0x9a77('0x4a')]({'where':{'id':_0xa6ba8b[_0x9a77('0x4c')]['id']}})[_0x9a77('0x29')](handleEntityNotFound(_0x414bca,null))[_0x9a77('0x29')](saveUpdates(_0xa6ba8b[_0x9a77('0x4b')],null))[_0x9a77('0x29')](respondWithResult(_0x414bca,null))[_0x9a77('0x45')](handleError(_0x414bca,null));};exports[_0x9a77('0x2a')]=function(_0x2ae881,_0x1b1141){return db[_0x9a77('0x30')][_0x9a77('0x4a')]({'where':{'id':_0x2ae881['params']['id']}})[_0x9a77('0x29')](handleEntityNotFound(_0x1b1141,null))['then'](removeEntity(_0x1b1141,null))[_0x9a77('0x45')](handleError(_0x1b1141,null));};exports[_0x9a77('0x4d')]=function(_0x5a1424,_0x4eb5a5){return db['OpenchannelQueueReport'][_0x9a77('0x4d')]()[_0x9a77('0x29')](respondWithResult(_0x4eb5a5,null))[_0x9a77('0x45')](handleError(_0x4eb5a5,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 7594de2..5e36e6a 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 _0x2ef3=['define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./openchannelQueueReport.attributes','exports'];(function(_0x29c5f1,_0x4dcbe9){var _0x591bf7=function(_0x50aeab){while(--_0x50aeab){_0x29c5f1['push'](_0x29c5f1['shift']());}};_0x591bf7(++_0x4dcbe9);}(_0x2ef3,0xba));var _0x32ef=function(_0x2dc243,_0x300006){_0x2dc243=_0x2dc243-0x0;var _0x207be9=_0x2ef3[_0x2dc243];return _0x207be9;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ef('0x6'));var rimraf=require(_0x32ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x32ef('0x8'));module[_0x32ef('0x9')]=function(_0x4c8104,_0x5dfa09){return _0x4c8104[_0x32ef('0xa')](_0x32ef('0xb'),attributes,{'tableName':_0x32ef('0xc'),'paranoid':![],'indexes':[{'name':_0x32ef('0xd'),'fields':[_0x32ef('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x4005b2,_0x1fe448){var _0x2ab573=function(_0x330b94){while(--_0x330b94){_0x4005b2['push'](_0x4005b2['shift']());}};_0x2ab573(++_0x1fe448);}(_0x1261,0x144));var _0x1126=function(_0x5a30fb,_0x206270){_0x5a30fb=_0x5a30fb-0x0;var _0x3b86aa=_0x1261[_0x5a30fb];return _0x3b86aa;};'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 diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 4a3188e..ea1290f 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 _0x1280=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','OpenchannelQueueReport','create','options','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','update','body','limit','lodash','moment'];(function(_0x414297,_0x18578e){var _0x51ea47=function(_0x4a7b22){while(--_0x4a7b22){_0x414297['push'](_0x414297['shift']());}};_0x51ea47(++_0x18578e);}(_0x1280,0xac));var _0x0128=function(_0x21fc68,_0x459828){_0x21fc68=_0x21fc68-0x0;var _0x3561e1=_0x1280[_0x21fc68];return _0x3561e1;};'use strict';var _=require(_0x0128('0x0'));var util=require('util');var moment=require(_0x0128('0x1'));var BPromise=require(_0x0128('0x2'));var rs=require(_0x0128('0x3'));var fs=require('fs');var Redis=require(_0x0128('0x4'));var db=require(_0x0128('0x5'))['db'];var utils=require(_0x0128('0x6'));var logger=require('../../config/logger')(_0x0128('0x7'));var config=require(_0x0128('0x8'));var jayson=require(_0x0128('0x9'));var client=jayson[_0x0128('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e74fe,_0x1d647f,_0x134abd){return new BPromise(function(_0x2b8b86,_0x43a105){return client['request'](_0x4e74fe,_0x134abd)[_0x0128('0xb')](function(_0x2fa9cb){logger['info'](_0x0128('0xc'),_0x1d647f,_0x0128('0xd'));logger[_0x0128('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x1d647f,'request\x20sent',JSON[_0x0128('0xf')](_0x2fa9cb));if(_0x2fa9cb[_0x0128('0x10')]){if(_0x2fa9cb[_0x0128('0x10')]['code']===0x1f4){logger[_0x0128('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1d647f,_0x2fa9cb[_0x0128('0x10')]['message']);return _0x43a105(_0x2fa9cb[_0x0128('0x10')]['message']);}logger[_0x0128('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1d647f,_0x2fa9cb[_0x0128('0x10')][_0x0128('0x11')]);return _0x2b8b86(_0x2fa9cb[_0x0128('0x10')][_0x0128('0x11')]);}else{logger[_0x0128('0x12')](_0x0128('0xc'),_0x1d647f,'request\x20sent');_0x2b8b86(_0x2fa9cb[_0x0128('0x13')][_0x0128('0x11')]);}})[_0x0128('0x14')](function(_0x16a4b7){logger[_0x0128('0x10')](_0x0128('0xc'),_0x1d647f,_0x16a4b7);_0x43a105(_0x16a4b7);});});}exports['CreateOpenchannelQueueReport']=function(_0x2524b1){var _0x18a955=this;return new Promise(function(_0x1a5818,_0x431b13){return db[_0x0128('0x15')][_0x0128('0x16')](_0x2524b1['body'],{'raw':_0x2524b1[_0x0128('0x17')]?_0x2524b1[_0x0128('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2c000a){logger[_0x0128('0x12')](_0x0128('0x18'),_0x2524b1);logger[_0x0128('0xe')](_0x0128('0x18'),_0x2524b1,JSON[_0x0128('0xf')](_0x2c000a));_0x1a5818(_0x2c000a);})[_0x0128('0x14')](function(_0x167c33){logger['error']('CreateOpenchannelQueueReport',_0x167c33[_0x0128('0x11')],_0x2524b1);_0x431b13(_0x18a955['error'](0x1f4,_0x167c33[_0x0128('0x11')]));});});};exports[_0x0128('0x19')]=function(_0x22f70c){var _0x47d79d=this;return new Promise(function(_0x135b8b,_0x54e1cc){return db[_0x0128('0x15')][_0x0128('0x1a')](_0x22f70c[_0x0128('0x1b')],{'raw':_0x22f70c[_0x0128('0x17')]?_0x22f70c[_0x0128('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22f70c[_0x0128('0x17')]?_0x22f70c[_0x0128('0x17')]['where']||null:null,'attributes':_0x22f70c[_0x0128('0x17')]?_0x22f70c[_0x0128('0x17')]['attributes']||null:null,'limit':_0x22f70c[_0x0128('0x17')]?_0x22f70c[_0x0128('0x17')][_0x0128('0x1c')]||null:null})['then'](function(_0x5b7ab2){logger[_0x0128('0x12')]('UpdateOpenchannelQueueReport',_0x22f70c);logger['debug']('UpdateOpenchannelQueueReport',_0x22f70c,JSON[_0x0128('0xf')](_0x5b7ab2));_0x135b8b(_0x5b7ab2);})['catch'](function(_0x4449b9){logger[_0x0128('0x10')](_0x0128('0x19'),_0x4449b9[_0x0128('0x11')],_0x22f70c);_0x54e1cc(_0x47d79d['error'](0x1f4,_0x4449b9[_0x0128('0x11')]));});});}; \ No newline at end of file +var _0xfcbb=['body','raw','where','attributes','limit','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','UpdateOpenchannelQueueReport','update'];(function(_0x2aa866,_0x14443a){var _0x47456c=function(_0x7e638f){while(--_0x7e638f){_0x2aa866['push'](_0x2aa866['shift']());}};_0x47456c(++_0x14443a);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x5286f5,_0x49878c){_0x5286f5=_0x5286f5-0x0;var _0x41d1f5=_0xfcbb[_0x5286f5];return _0x41d1f5;};'use strict';var _=require(_0xbfcb('0x0'));var util=require(_0xbfcb('0x1'));var moment=require(_0xbfcb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfcb('0x3'));var db=require(_0xbfcb('0x4'))['db'];var utils=require(_0xbfcb('0x5'));var logger=require(_0xbfcb('0x6'))(_0xbfcb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbfcb('0x8')][_0xbfcb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8d4e6a,_0x2df839,_0x288ee5){return new BPromise(function(_0x2f875c,_0x49717b){return client['request'](_0x8d4e6a,_0x288ee5)[_0xbfcb('0xa')](function(_0x331173){logger[_0xbfcb('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x2df839,_0xbfcb('0xc'));logger[_0xbfcb('0xd')](_0xbfcb('0xe'),_0x2df839,_0xbfcb('0xc'),JSON[_0xbfcb('0xf')](_0x331173));if(_0x331173[_0xbfcb('0x10')]){if(_0x331173['error'][_0xbfcb('0x11')]===0x1f4){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')]['message']);return _0x49717b(_0x331173[_0xbfcb('0x10')]['message']);}logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);return _0x2f875c(_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);}else{logger[_0xbfcb('0xb')](_0xbfcb('0x12'),_0x2df839,_0xbfcb('0xc'));_0x2f875c(_0x331173[_0xbfcb('0x14')][_0xbfcb('0x13')]);}})[_0xbfcb('0x15')](function(_0x26f335){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x26f335);_0x49717b(_0x26f335);});});}exports[_0xbfcb('0x16')]=function(_0xba1d6){var _0x38689e=this;return new Promise(function(_0x3404aa,_0x46b8d2){return db[_0xbfcb('0x17')][_0xbfcb('0x18')](_0xba1d6['body'],{'raw':_0xba1d6[_0xbfcb('0x19')]?_0xba1d6[_0xbfcb('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xbfcb('0xa')](function(_0x1a7225){logger['info']('CreateOpenchannelQueueReport',_0xba1d6);logger[_0xbfcb('0xd')](_0xbfcb('0x16'),_0xba1d6,JSON[_0xbfcb('0xf')](_0x1a7225));_0x3404aa(_0x1a7225);})[_0xbfcb('0x15')](function(_0x1c5924){logger['error'](_0xbfcb('0x16'),_0x1c5924[_0xbfcb('0x13')],_0xba1d6);_0x46b8d2(_0x38689e[_0xbfcb('0x10')](0x1f4,_0x1c5924[_0xbfcb('0x13')]));});});};exports[_0xbfcb('0x1a')]=function(_0x19616c){var _0x69c8e9=this;return new Promise(function(_0x14e43c,_0x11f6f7){return db[_0xbfcb('0x17')][_0xbfcb('0x1b')](_0x19616c[_0xbfcb('0x1c')],{'raw':_0x19616c[_0xbfcb('0x19')]?_0x19616c[_0xbfcb('0x19')][_0xbfcb('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19616c[_0xbfcb('0x19')]?_0x19616c['options'][_0xbfcb('0x1e')]||null:null,'attributes':_0x19616c[_0xbfcb('0x19')]?_0x19616c['options'][_0xbfcb('0x1f')]||null:null,'limit':_0x19616c[_0xbfcb('0x19')]?_0x19616c[_0xbfcb('0x19')][_0xbfcb('0x20')]||null:null})[_0xbfcb('0xa')](function(_0x3542e9){logger[_0xbfcb('0xb')](_0xbfcb('0x1a'),_0x19616c);logger[_0xbfcb('0xd')](_0xbfcb('0x1a'),_0x19616c,JSON['stringify'](_0x3542e9));_0x14e43c(_0x3542e9);})[_0xbfcb('0x15')](function(_0x3aa3cd){logger[_0xbfcb('0x10')](_0xbfcb('0x1a'),_0x3aa3cd[_0xbfcb('0x13')],_0x19616c);_0x11f6f7(_0x69c8e9[_0xbfcb('0x10')](0x1f4,_0x3aa3cd[_0xbfcb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index b43f220..8586c46 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 _0xed7e=['show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id'];(function(_0x3d1cc7,_0x214c1f){var _0x58cf58=function(_0x2666ce){while(--_0x2666ce){_0x3d1cc7['push'](_0x3d1cc7['shift']());}};_0x58cf58(++_0x214c1f);}(_0xed7e,0x16f));var _0xeed7=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xed7e[_0x1b349a];return _0x5d1f7c;};'use strict';var multer=require(_0xeed7('0x0'));var util=require(_0xeed7('0x1'));var path=require('path');var timeout=require(_0xeed7('0x2'));var express=require('express');var router=express[_0xeed7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xeed7('0x4'));var interaction=require(_0xeed7('0x5'));var config=require(_0xeed7('0x6'));var controller=require('./openchannelTransferReport.controller');router['get']('/',auth[_0xeed7('0x7')](),controller[_0xeed7('0x8')]);router['get'](_0xeed7('0x9'),auth['isAuthenticated'](),controller[_0xeed7('0xa')]);router[_0xeed7('0xb')](_0xeed7('0xc'),auth[_0xeed7('0x7')](),controller[_0xeed7('0xd')]);router[_0xeed7('0xe')]('/',auth[_0xeed7('0x7')](),controller[_0xeed7('0xf')]);router['put'](_0xeed7('0xc'),auth['isAuthenticated'](),controller[_0xeed7('0x10')]);router[_0xeed7('0x11')](_0xeed7('0xc'),auth[_0xeed7('0x7')](),controller[_0xeed7('0x12')]);module[_0xeed7('0x13')]=router; \ No newline at end of file +var _0x1ee9=['put','update','delete','destroy','exports','multer','path','connect-timeout','Router','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create'];(function(_0x573367,_0x4548d0){var _0x310f32=function(_0x3f60a6){while(--_0x3f60a6){_0x573367['push'](_0x573367['shift']());}};_0x310f32(++_0x4548d0);}(_0x1ee9,0x125));var _0x91ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1ee9[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x91ee('0x0'));var util=require('util');var path=require(_0x91ee('0x1'));var timeout=require(_0x91ee('0x2'));var express=require('express');var router=express[_0x91ee('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(_0x91ee('0x4'));router[_0x91ee('0x5')]('/',auth[_0x91ee('0x6')](),controller[_0x91ee('0x7')]);router[_0x91ee('0x5')](_0x91ee('0x8'),auth[_0x91ee('0x6')](),controller[_0x91ee('0x9')]);router[_0x91ee('0x5')](_0x91ee('0xa'),auth[_0x91ee('0x6')](),controller['show']);router[_0x91ee('0xb')]('/',auth['isAuthenticated'](),controller[_0x91ee('0xc')]);router[_0x91ee('0xd')](_0x91ee('0xa'),auth[_0x91ee('0x6')](),controller[_0x91ee('0xe')]);router[_0x91ee('0xf')](_0x91ee('0xa'),auth['isAuthenticated'](),controller[_0x91ee('0x10')]);module[_0x91ee('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 06244a7..0c773f8 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x22e47a,_0x4ea10c){var _0x15a12a=function(_0x4a097f){while(--_0x4a097f){_0x22e47a['push'](_0x22e47a['shift']());}};_0x15a12a(++_0x4ea10c);}(_0x9bde,0xe1));var _0xe9bd=function(_0x37110d,_0x1fcc74){_0x37110d=_0x37110d-0x0;var _0x5e33b5=_0x9bde[_0x37110d];return _0x5e33b5;};'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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x40e181,_0x1953ee){var _0x257e72=function(_0x51ea44){while(--_0x51ea44){_0x40e181['push'](_0x40e181['shift']());}};_0x257e72(++_0x1953ee);}(_0xaa88,0x137));var _0x8aa8=function(_0x138836,_0x229129){_0x138836=_0x138836-0x0;var _0x322688=_0xaa88[_0x138836];return _0x322688;};'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 diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 8ecab4f..234edc5 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 _0x1185=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','map','OpenchannelTransferReport','fieldName','type','model','query','keys','filters','intersection'];(function(_0x362929,_0x20c083){var _0x1a6ecf=function(_0x2dcc82){while(--_0x2dcc82){_0x362929['push'](_0x362929['shift']());}};_0x1a6ecf(++_0x20c083);}(_0x1185,0x17e));var _0x5118=function(_0x517cae,_0x30eff3){_0x517cae=_0x517cae-0x0;var _0x287be2=_0x1185[_0x517cae];return _0x287be2;};'use strict';var emlformat=require(_0x5118('0x0'));var rimraf=require(_0x5118('0x1'));var zipdir=require(_0x5118('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5118('0x3'));var moment=require('moment');var BPromise=require(_0x5118('0x4'));var Mustache=require(_0x5118('0x5'));var util=require(_0x5118('0x6'));var path=require(_0x5118('0x7'));var sox=require(_0x5118('0x8'));var csv=require(_0x5118('0x9'));var ejs=require(_0x5118('0xa'));var fs=require('fs');var fs_extra=require(_0x5118('0xb'));var _=require(_0x5118('0xc'));var squel=require('squel');var crypto=require(_0x5118('0xd'));var jsforce=require(_0x5118('0xe'));var deskjs=require(_0x5118('0xf'));var toCsv=require(_0x5118('0x9'));var querystring=require('querystring');var Papa=require(_0x5118('0x10'));var Redis=require(_0x5118('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5118('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5118('0x13'));var logger=require(_0x5118('0x14'))(_0x5118('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5118('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48fbf4,_0x4949d1){_0x4949d1=_0x4949d1||0xcc;return function(_0x137490){if(_0x137490){return _0x48fbf4[_0x5118('0x17')](_0x4949d1);}return _0x48fbf4[_0x5118('0x18')](_0x4949d1)[_0x5118('0x19')]();};}function respondWithResult(_0x328b57,_0x2b0549){_0x2b0549=_0x2b0549||0xc8;return function(_0x16155e){if(_0x16155e){return _0x328b57[_0x5118('0x18')](_0x2b0549)['json'](_0x16155e);}};}function respondWithFilteredResult(_0x135c3a,_0x5eeb06){return function(_0x27db2d){if(_0x27db2d){var _0x418d64=typeof _0x5eeb06['offset']==='undefined'&&typeof _0x5eeb06[_0x5118('0x1a')]===_0x5118('0x1b');var _0x4d8ca9=_0x27db2d[_0x5118('0x1c')];var _0x224dd2=_0x418d64?0x0:_0x5eeb06[_0x5118('0x1d')];var _0x4fb30d=_0x418d64?_0x27db2d[_0x5118('0x1c')]:_0x5eeb06[_0x5118('0x1d')]+_0x5eeb06['limit'];var _0x5b3cdd;if(_0x4fb30d>=_0x4d8ca9){_0x4fb30d=_0x4d8ca9;_0x5b3cdd=0xc8;}else{_0x5b3cdd=0xce;}_0x135c3a['status'](_0x5b3cdd);return _0x135c3a[_0x5118('0x1e')](_0x5118('0x1f'),_0x224dd2+'-'+_0x4fb30d+'/'+_0x4d8ca9)[_0x5118('0x20')](_0x27db2d);}return null;};}function patchUpdates(_0x2c386a){return function(_0x278f14){try{jsonpatch[_0x5118('0x21')](_0x278f14,_0x2c386a,!![]);}catch(_0x478b4f){return BPromise['reject'](_0x478b4f);}return _0x278f14[_0x5118('0x22')]();};}function saveUpdates(_0x10d7ef,_0x66917a){return function(_0x3cd2ba){if(_0x3cd2ba){return _0x3cd2ba[_0x5118('0x23')](_0x10d7ef)[_0x5118('0x24')](function(_0x340d6b){return _0x340d6b;});}return null;};}function removeEntity(_0x4b6128,_0x3bc332){return function(_0x2d0832){if(_0x2d0832){return _0x2d0832[_0x5118('0x25')]()[_0x5118('0x24')](function(){_0x4b6128[_0x5118('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b09e8,_0x5d27c7){return function(_0x22bf39){if(!_0x22bf39){_0x4b09e8['sendStatus'](0x194);}return _0x22bf39;};}function handleError(_0x288f6e,_0x50ccdc){_0x50ccdc=_0x50ccdc||0x1f4;return function(_0x47f10b){logger[_0x5118('0x26')](_0x47f10b[_0x5118('0x27')]);if(_0x47f10b[_0x5118('0x28')]){delete _0x47f10b[_0x5118('0x28')];}_0x288f6e['status'](_0x50ccdc)['send'](_0x47f10b);};}exports['index']=function(_0x23a384,_0x492063){var _0x44ee1e={},_0x44a60c={},_0x4784c7={'count':0x0,'rows':[]};var _0x34a878=_[_0x5118('0x29')](db[_0x5118('0x2a')]['rawAttributes'],function(_0x56eda5){return{'name':_0x56eda5[_0x5118('0x2b')],'type':_0x56eda5[_0x5118('0x2c')]['key']};});_0x44a60c[_0x5118('0x2d')]=_[_0x5118('0x29')](_0x34a878,_0x5118('0x28'));_0x44a60c[_0x5118('0x2e')]=_[_0x5118('0x2f')](_0x23a384[_0x5118('0x2e')]);_0x44a60c[_0x5118('0x30')]=_[_0x5118('0x31')](_0x44a60c[_0x5118('0x2d')],_0x44a60c[_0x5118('0x2e')]);_0x44ee1e['attributes']=_[_0x5118('0x31')](_0x44a60c['model'],qs[_0x5118('0x32')](_0x23a384[_0x5118('0x2e')]['fields']));_0x44ee1e[_0x5118('0x33')]=_0x44ee1e[_0x5118('0x33')][_0x5118('0x34')]?_0x44ee1e['attributes']:_0x44a60c['model'];if(!_0x23a384[_0x5118('0x2e')][_0x5118('0x35')](_0x5118('0x36'))){_0x44ee1e[_0x5118('0x1a')]=qs[_0x5118('0x1a')](_0x23a384[_0x5118('0x2e')]['limit']);_0x44ee1e['offset']=qs['offset'](_0x23a384[_0x5118('0x2e')][_0x5118('0x1d')]);}_0x44ee1e[_0x5118('0x37')]=qs[_0x5118('0x38')](_0x23a384[_0x5118('0x2e')][_0x5118('0x38')]);_0x44ee1e['where']=qs[_0x5118('0x30')](_['pick'](_0x23a384[_0x5118('0x2e')],_0x44a60c['filters']),_0x34a878);if(_0x23a384[_0x5118('0x2e')][_0x5118('0x39')]){_0x44ee1e[_0x5118('0x3a')]=_[_0x5118('0x3b')](_0x44ee1e[_0x5118('0x3a')],{'$or':_[_0x5118('0x29')](_0x34a878,function(_0x55115a){if(_0x55115a[_0x5118('0x2c')]!=='VIRTUAL'){var _0x1721a2={};_0x1721a2[_0x55115a[_0x5118('0x28')]]={'$like':'%'+_0x23a384[_0x5118('0x2e')][_0x5118('0x39')]+'%'};return _0x1721a2;}})});}_0x44ee1e=_[_0x5118('0x3b')]({},_0x44ee1e,_0x23a384[_0x5118('0x3c')]);var _0x3866f8={'where':_0x44ee1e[_0x5118('0x3a')]};return db[_0x5118('0x2a')]['count'](_0x3866f8)[_0x5118('0x24')](function(_0x3f06da){_0x4784c7[_0x5118('0x1c')]=_0x3f06da;if(_0x23a384[_0x5118('0x2e')][_0x5118('0x3d')]){_0x44ee1e[_0x5118('0x3e')]=[{'all':!![]}];}return db[_0x5118('0x2a')][_0x5118('0x3f')](_0x44ee1e);})[_0x5118('0x24')](function(_0x1b8021){_0x4784c7[_0x5118('0x40')]=_0x1b8021;return _0x4784c7;})[_0x5118('0x24')](respondWithFilteredResult(_0x492063,_0x44ee1e))[_0x5118('0x41')](handleError(_0x492063,null));};exports['show']=function(_0x4edd0c,_0x12089f){var _0x563305={'raw':!![],'where':{'id':_0x4edd0c[_0x5118('0x42')]['id']}},_0x1bb55b={};_0x1bb55b['model']=_['keys'](db['OpenchannelTransferReport'][_0x5118('0x43')]);_0x1bb55b[_0x5118('0x2e')]=_[_0x5118('0x2f')](_0x4edd0c[_0x5118('0x2e')]);_0x1bb55b['filters']=_[_0x5118('0x31')](_0x1bb55b['model'],_0x1bb55b[_0x5118('0x2e')]);_0x563305[_0x5118('0x33')]=_[_0x5118('0x31')](_0x1bb55b[_0x5118('0x2d')],qs['fields'](_0x4edd0c['query']['fields']));_0x563305[_0x5118('0x33')]=_0x563305[_0x5118('0x33')][_0x5118('0x34')]?_0x563305[_0x5118('0x33')]:_0x1bb55b[_0x5118('0x2d')];if(_0x4edd0c[_0x5118('0x2e')]['includeAll']){_0x563305[_0x5118('0x3e')]=[{'all':!![]}];}_0x563305=_[_0x5118('0x3b')]({},_0x563305,_0x4edd0c[_0x5118('0x3c')]);return db[_0x5118('0x2a')]['find'](_0x563305)['then'](handleEntityNotFound(_0x12089f,null))[_0x5118('0x24')](respondWithResult(_0x12089f,null))['catch'](handleError(_0x12089f,null));};exports[_0x5118('0x44')]=function(_0x315a97,_0x57deb4){return db['OpenchannelTransferReport'][_0x5118('0x44')](_0x315a97[_0x5118('0x45')],{})[_0x5118('0x24')](respondWithResult(_0x57deb4,0xc9))[_0x5118('0x41')](handleError(_0x57deb4,null));};exports[_0x5118('0x23')]=function(_0x3c0e0f,_0x1488e0){if(_0x3c0e0f[_0x5118('0x45')]['id']){delete _0x3c0e0f[_0x5118('0x45')]['id'];}return db[_0x5118('0x2a')][_0x5118('0x46')]({'where':{'id':_0x3c0e0f[_0x5118('0x42')]['id']}})[_0x5118('0x24')](handleEntityNotFound(_0x1488e0,null))[_0x5118('0x24')](saveUpdates(_0x3c0e0f[_0x5118('0x45')],null))[_0x5118('0x24')](respondWithResult(_0x1488e0,null))[_0x5118('0x41')](handleError(_0x1488e0,null));};exports[_0x5118('0x25')]=function(_0x11008e,_0x38a783){return db[_0x5118('0x2a')][_0x5118('0x46')]({'where':{'id':_0x11008e[_0x5118('0x42')]['id']}})['then'](handleEntityNotFound(_0x38a783,null))[_0x5118('0x24')](removeEntity(_0x38a783,null))[_0x5118('0x41')](handleError(_0x38a783,null));};exports[_0x5118('0x47')]=function(_0x2eb206,_0x3b3ff2){return db['OpenchannelTransferReport'][_0x5118('0x47')]()[_0x5118('0x24')](respondWithResult(_0x3b3ff2,null))[_0x5118('0x41')](handleError(_0x3b3ff2,null));}; \ No newline at end of file +var _0xfdfd=['rows','show','params','keys','options','catch','create','body','find','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','OpenchannelTransferReport','includeAll','include','findAll'];(function(_0x57d9f1,_0x45123d){var _0x3ae610=function(_0x463911){while(--_0x463911){_0x57d9f1['push'](_0x57d9f1['shift']());}};_0x3ae610(++_0x45123d);}(_0xfdfd,0x14e));var _0xdfdf=function(_0x1e0779,_0x45715f){_0x1e0779=_0x1e0779-0x0;var _0x4b22c7=_0xfdfd[_0x1e0779];return _0x4b22c7;};'use strict';var emlformat=require(_0xdfdf('0x0'));var rimraf=require(_0xdfdf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdfdf('0x2'));var rp=require('request-promise');var moment=require(_0xdfdf('0x3'));var BPromise=require(_0xdfdf('0x4'));var Mustache=require(_0xdfdf('0x5'));var util=require(_0xdfdf('0x6'));var path=require(_0xdfdf('0x7'));var sox=require(_0xdfdf('0x8'));var csv=require(_0xdfdf('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdfdf('0xa'));var _=require(_0xdfdf('0xb'));var squel=require(_0xdfdf('0xc'));var crypto=require(_0xdfdf('0xd'));var jsforce=require(_0xdfdf('0xe'));var deskjs=require(_0xdfdf('0xf'));var toCsv=require(_0xdfdf('0x9'));var querystring=require('querystring');var Papa=require(_0xdfdf('0x10'));var Redis=require(_0xdfdf('0x11'));var authService=require(_0xdfdf('0x12'));var qs=require(_0xdfdf('0x13'));var as=require(_0xdfdf('0x14'));var hardwareService=require(_0xdfdf('0x15'));var logger=require(_0xdfdf('0x16'))(_0xdfdf('0x17'));var utils=require('../../config/utils');var config=require(_0xdfdf('0x18'));var licenseUtil=require(_0xdfdf('0x19'));var db=require(_0xdfdf('0x1a'))['db'];function respondWithStatusCode(_0x18a478,_0x26d864){_0x26d864=_0x26d864||0xcc;return function(_0x2e39d4){if(_0x2e39d4){return _0x18a478[_0xdfdf('0x1b')](_0x26d864);}return _0x18a478[_0xdfdf('0x1c')](_0x26d864)['end']();};}function respondWithResult(_0x2832eb,_0x2d3e97){_0x2d3e97=_0x2d3e97||0xc8;return function(_0x4d4646){if(_0x4d4646){return _0x2832eb[_0xdfdf('0x1c')](_0x2d3e97)[_0xdfdf('0x1d')](_0x4d4646);}};}function respondWithFilteredResult(_0x5ef390,_0x4f5ec7){return function(_0x1ddef0){if(_0x1ddef0){var _0x47070d=typeof _0x4f5ec7[_0xdfdf('0x1e')]===_0xdfdf('0x1f')&&typeof _0x4f5ec7[_0xdfdf('0x20')]===_0xdfdf('0x1f');var _0x4438d0=_0x1ddef0[_0xdfdf('0x21')];var _0x185c58=_0x47070d?0x0:_0x4f5ec7[_0xdfdf('0x1e')];var _0x3ce588=_0x47070d?_0x1ddef0[_0xdfdf('0x21')]:_0x4f5ec7['offset']+_0x4f5ec7[_0xdfdf('0x20')];var _0x549e8a;if(_0x3ce588>=_0x4438d0){_0x3ce588=_0x4438d0;_0x549e8a=0xc8;}else{_0x549e8a=0xce;}_0x5ef390[_0xdfdf('0x1c')](_0x549e8a);return _0x5ef390[_0xdfdf('0x22')](_0xdfdf('0x23'),_0x185c58+'-'+_0x3ce588+'/'+_0x4438d0)['json'](_0x1ddef0);}return null;};}function patchUpdates(_0x64ec61){return function(_0x1c9450){try{jsonpatch['apply'](_0x1c9450,_0x64ec61,!![]);}catch(_0x599221){return BPromise[_0xdfdf('0x24')](_0x599221);}return _0x1c9450[_0xdfdf('0x25')]();};}function saveUpdates(_0x257d55,_0x443171){return function(_0x40c3fe){if(_0x40c3fe){return _0x40c3fe[_0xdfdf('0x26')](_0x257d55)[_0xdfdf('0x27')](function(_0x1fc02a){return _0x1fc02a;});}return null;};}function removeEntity(_0x34000e,_0x68c37c){return function(_0x2ac93d){if(_0x2ac93d){return _0x2ac93d[_0xdfdf('0x28')]()[_0xdfdf('0x27')](function(){_0x34000e[_0xdfdf('0x1c')](0xcc)[_0xdfdf('0x29')]();});}};}function handleEntityNotFound(_0x3cb14c,_0x20c721){return function(_0x2e721a){if(!_0x2e721a){_0x3cb14c['sendStatus'](0x194);}return _0x2e721a;};}function handleError(_0x3eb4d7,_0x4e4765){_0x4e4765=_0x4e4765||0x1f4;return function(_0x416aeb){logger[_0xdfdf('0x2a')](_0x416aeb['stack']);if(_0x416aeb[_0xdfdf('0x2b')]){delete _0x416aeb[_0xdfdf('0x2b')];}_0x3eb4d7[_0xdfdf('0x1c')](_0x4e4765)[_0xdfdf('0x2c')](_0x416aeb);};}exports[_0xdfdf('0x2d')]=function(_0x2084d4,_0x12c15d){var _0x1a6f61={},_0x3d8ef8={},_0xe26c01={'count':0x0,'rows':[]};var _0x35db88=_[_0xdfdf('0x2e')](db['OpenchannelTransferReport'][_0xdfdf('0x2f')],function(_0x27b957){return{'name':_0x27b957[_0xdfdf('0x30')],'type':_0x27b957[_0xdfdf('0x31')][_0xdfdf('0x32')]};});_0x3d8ef8[_0xdfdf('0x33')]=_[_0xdfdf('0x2e')](_0x35db88,_0xdfdf('0x2b'));_0x3d8ef8[_0xdfdf('0x34')]=_['keys'](_0x2084d4[_0xdfdf('0x34')]);_0x3d8ef8[_0xdfdf('0x35')]=_[_0xdfdf('0x36')](_0x3d8ef8[_0xdfdf('0x33')],_0x3d8ef8[_0xdfdf('0x34')]);_0x1a6f61[_0xdfdf('0x37')]=_[_0xdfdf('0x36')](_0x3d8ef8[_0xdfdf('0x33')],qs[_0xdfdf('0x38')](_0x2084d4[_0xdfdf('0x34')][_0xdfdf('0x38')]));_0x1a6f61[_0xdfdf('0x37')]=_0x1a6f61[_0xdfdf('0x37')][_0xdfdf('0x39')]?_0x1a6f61[_0xdfdf('0x37')]:_0x3d8ef8[_0xdfdf('0x33')];if(!_0x2084d4[_0xdfdf('0x34')][_0xdfdf('0x3a')](_0xdfdf('0x3b'))){_0x1a6f61[_0xdfdf('0x20')]=qs[_0xdfdf('0x20')](_0x2084d4['query'][_0xdfdf('0x20')]);_0x1a6f61[_0xdfdf('0x1e')]=qs['offset'](_0x2084d4[_0xdfdf('0x34')][_0xdfdf('0x1e')]);}_0x1a6f61[_0xdfdf('0x3c')]=qs[_0xdfdf('0x3d')](_0x2084d4[_0xdfdf('0x34')]['sort']);_0x1a6f61[_0xdfdf('0x3e')]=qs[_0xdfdf('0x35')](_[_0xdfdf('0x3f')](_0x2084d4['query'],_0x3d8ef8[_0xdfdf('0x35')]),_0x35db88);if(_0x2084d4[_0xdfdf('0x34')]['filter']){_0x1a6f61[_0xdfdf('0x3e')]=_[_0xdfdf('0x40')](_0x1a6f61['where'],{'$or':_['map'](_0x35db88,function(_0x1bac9b){if(_0x1bac9b['type']!==_0xdfdf('0x41')){var _0xb61813={};_0xb61813[_0x1bac9b[_0xdfdf('0x2b')]]={'$like':'%'+_0x2084d4[_0xdfdf('0x34')][_0xdfdf('0x42')]+'%'};return _0xb61813;}})});}_0x1a6f61=_[_0xdfdf('0x40')]({},_0x1a6f61,_0x2084d4['options']);var _0x2969e4={'where':_0x1a6f61[_0xdfdf('0x3e')]};return db[_0xdfdf('0x43')][_0xdfdf('0x21')](_0x2969e4)[_0xdfdf('0x27')](function(_0x4a1492){_0xe26c01[_0xdfdf('0x21')]=_0x4a1492;if(_0x2084d4[_0xdfdf('0x34')][_0xdfdf('0x44')]){_0x1a6f61[_0xdfdf('0x45')]=[{'all':!![]}];}return db[_0xdfdf('0x43')][_0xdfdf('0x46')](_0x1a6f61);})['then'](function(_0x3a80d0){_0xe26c01[_0xdfdf('0x47')]=_0x3a80d0;return _0xe26c01;})[_0xdfdf('0x27')](respondWithFilteredResult(_0x12c15d,_0x1a6f61))['catch'](handleError(_0x12c15d,null));};exports[_0xdfdf('0x48')]=function(_0x56c13f,_0xff4503){var _0x488157={'raw':!![],'where':{'id':_0x56c13f[_0xdfdf('0x49')]['id']}},_0x2b6592={};_0x2b6592[_0xdfdf('0x33')]=_['keys'](db[_0xdfdf('0x43')][_0xdfdf('0x2f')]);_0x2b6592[_0xdfdf('0x34')]=_[_0xdfdf('0x4a')](_0x56c13f['query']);_0x2b6592['filters']=_['intersection'](_0x2b6592[_0xdfdf('0x33')],_0x2b6592['query']);_0x488157['attributes']=_['intersection'](_0x2b6592[_0xdfdf('0x33')],qs[_0xdfdf('0x38')](_0x56c13f[_0xdfdf('0x34')][_0xdfdf('0x38')]));_0x488157[_0xdfdf('0x37')]=_0x488157[_0xdfdf('0x37')][_0xdfdf('0x39')]?_0x488157[_0xdfdf('0x37')]:_0x2b6592[_0xdfdf('0x33')];if(_0x56c13f[_0xdfdf('0x34')]['includeAll']){_0x488157[_0xdfdf('0x45')]=[{'all':!![]}];}_0x488157=_[_0xdfdf('0x40')]({},_0x488157,_0x56c13f[_0xdfdf('0x4b')]);return db[_0xdfdf('0x43')]['find'](_0x488157)[_0xdfdf('0x27')](handleEntityNotFound(_0xff4503,null))[_0xdfdf('0x27')](respondWithResult(_0xff4503,null))[_0xdfdf('0x4c')](handleError(_0xff4503,null));};exports[_0xdfdf('0x4d')]=function(_0x50764d,_0x3ea27f){return db[_0xdfdf('0x43')][_0xdfdf('0x4d')](_0x50764d[_0xdfdf('0x4e')],{})[_0xdfdf('0x27')](respondWithResult(_0x3ea27f,0xc9))[_0xdfdf('0x4c')](handleError(_0x3ea27f,null));};exports[_0xdfdf('0x26')]=function(_0x6d9766,_0x5b08a5){if(_0x6d9766[_0xdfdf('0x4e')]['id']){delete _0x6d9766[_0xdfdf('0x4e')]['id'];}return db['OpenchannelTransferReport'][_0xdfdf('0x4f')]({'where':{'id':_0x6d9766[_0xdfdf('0x49')]['id']}})[_0xdfdf('0x27')](handleEntityNotFound(_0x5b08a5,null))[_0xdfdf('0x27')](saveUpdates(_0x6d9766[_0xdfdf('0x4e')],null))['then'](respondWithResult(_0x5b08a5,null))[_0xdfdf('0x4c')](handleError(_0x5b08a5,null));};exports[_0xdfdf('0x28')]=function(_0x30ed65,_0x281025){return db[_0xdfdf('0x43')][_0xdfdf('0x4f')]({'where':{'id':_0x30ed65[_0xdfdf('0x49')]['id']}})[_0xdfdf('0x27')](handleEntityNotFound(_0x281025,null))[_0xdfdf('0x27')](removeEntity(_0x281025,null))[_0xdfdf('0x4c')](handleError(_0x281025,null));};exports[_0xdfdf('0x50')]=function(_0x5f4cb8,_0x4c7406){return db[_0xdfdf('0x43')][_0xdfdf('0x50')]()[_0xdfdf('0x27')](respondWithResult(_0x4c7406,null))[_0xdfdf('0x4c')](handleError(_0x4c7406,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index d59589d..228be23 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 _0x9faa=['path','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','uniqueid','util','api','moment','request-promise'];(function(_0x44923a,_0x5eaebf){var _0x2c87b5=function(_0xe333b4){while(--_0xe333b4){_0x44923a['push'](_0x44923a['shift']());}};_0x2c87b5(++_0x5eaebf);}(_0x9faa,0x9e));var _0xa9fa=function(_0x3cfb86,_0x914214){_0x3cfb86=_0x3cfb86-0x0;var _0x4dd6ee=_0x9faa[_0x3cfb86];return _0x4dd6ee;};'use strict';var _=require('lodash');var util=require(_0xa9fa('0x0'));var logger=require('../../config/logger')(_0xa9fa('0x1'));var moment=require(_0xa9fa('0x2'));var BPromise=require('bluebird');var rp=require(_0xa9fa('0x3'));var fs=require('fs');var path=require(_0xa9fa('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa9fa('0x5'));module[_0xa9fa('0x6')]=function(_0x4f8c94,_0x577f54){return _0x4f8c94['define'](_0xa9fa('0x7'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0xa9fa('0x8'),'fields':[_0xa9fa('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xce5c=['rimraf','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','util','../../config/logger','api','moment','request-promise','path'];(function(_0x5ac5be,_0x45217d){var _0x22f30f=function(_0x1cd2fe){while(--_0x1cd2fe){_0x5ac5be['push'](_0x5ac5be['shift']());}};_0x22f30f(++_0x45217d);}(_0xce5c,0x8a));var _0xcce5=function(_0x25c988,_0xce8221){_0x25c988=_0x25c988-0x0;var _0x45fcc2=_0xce5c[_0x25c988];return _0x45fcc2;};'use strict';var _=require('lodash');var util=require(_0xcce5('0x0'));var logger=require(_0xcce5('0x1'))(_0xcce5('0x2'));var moment=require(_0xcce5('0x3'));var BPromise=require('bluebird');var rp=require(_0xcce5('0x4'));var fs=require('fs');var path=require(_0xcce5('0x5'));var rimraf=require(_0xcce5('0x6'));var config=require('../../config/environment');var attributes=require(_0xcce5('0x7'));module[_0xcce5('0x8')]=function(_0x3e3e01,_0x1020e4){return _0x3e3e01['define'](_0xcce5('0x9'),attributes,{'tableName':_0xcce5('0xa'),'paranoid':![],'indexes':[{'name':_0xcce5('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 6f3f7fb..28bcd6e 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 _0xbcba=['code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5f4cf6,_0x4e3aa9){var _0x43d9b6=function(_0x5a0711){while(--_0x5a0711){_0x5f4cf6['push'](_0x5f4cf6['shift']());}};_0x43d9b6(++_0x4e3aa9);}(_0xbcba,0x6d));var _0xabcb=function(_0x1ae4ff,_0x61c979){_0x1ae4ff=_0x1ae4ff-0x0;var _0x35edcc=_0xbcba[_0x1ae4ff];return _0x35edcc;};'use strict';var _=require(_0xabcb('0x0'));var util=require(_0xabcb('0x1'));var moment=require('moment');var BPromise=require(_0xabcb('0x2'));var rs=require(_0xabcb('0x3'));var fs=require('fs');var Redis=require(_0xabcb('0x4'));var db=require(_0xabcb('0x5'))['db'];var utils=require(_0xabcb('0x6'));var logger=require(_0xabcb('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xabcb('0x8'));var client=jayson[_0xabcb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5322e7,_0x84557f,_0x192b36){return new BPromise(function(_0x5e693d,_0x4b43c0){return client[_0xabcb('0xa')](_0x5322e7,_0x192b36)['then'](function(_0x28e6fc){logger[_0xabcb('0xb')](_0xabcb('0xc'),_0x84557f,_0xabcb('0xd'));logger['debug'](_0xabcb('0xe'),_0x84557f,_0xabcb('0xd'),JSON[_0xabcb('0xf')](_0x28e6fc));if(_0x28e6fc[_0xabcb('0x10')]){if(_0x28e6fc[_0xabcb('0x10')][_0xabcb('0x11')]===0x1f4){logger[_0xabcb('0x10')](_0xabcb('0xc'),_0x84557f,_0x28e6fc['error'][_0xabcb('0x12')]);return _0x4b43c0(_0x28e6fc[_0xabcb('0x10')][_0xabcb('0x12')]);}logger[_0xabcb('0x10')](_0xabcb('0xc'),_0x84557f,_0x28e6fc[_0xabcb('0x10')]['message']);return _0x5e693d(_0x28e6fc[_0xabcb('0x10')][_0xabcb('0x12')]);}else{logger[_0xabcb('0xb')](_0xabcb('0xc'),_0x84557f,_0xabcb('0xd'));_0x5e693d(_0x28e6fc[_0xabcb('0x13')][_0xabcb('0x12')]);}})[_0xabcb('0x14')](function(_0x19032f){logger[_0xabcb('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x84557f,_0x19032f);_0x4b43c0(_0x19032f);});});} \ No newline at end of file +var _0x0207=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','util','randomstring','ioredis'];(function(_0x55a5e2,_0x3b9712){var _0x577445=function(_0x2e411d){while(--_0x2e411d){_0x55a5e2['push'](_0x55a5e2['shift']());}};_0x577445(++_0x3b9712);}(_0x0207,0x162));var _0x7020=function(_0x429f1d,_0x80ee79){_0x429f1d=_0x429f1d-0x0;var _0xbc3342=_0x0207[_0x429f1d];return _0xbc3342;};'use strict';var _=require('lodash');var util=require(_0x7020('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7020('0x1'));var fs=require('fs');var Redis=require(_0x7020('0x2'));var db=require(_0x7020('0x3'))['db'];var utils=require(_0x7020('0x4'));var logger=require(_0x7020('0x5'))(_0x7020('0x6'));var config=require(_0x7020('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7020('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39263c,_0x3c6c11,_0x17deac){return new BPromise(function(_0x42bc79,_0x22ba3e){return client[_0x7020('0x9')](_0x39263c,_0x17deac)['then'](function(_0x5e86b5){logger[_0x7020('0xa')](_0x7020('0xb'),_0x3c6c11,_0x7020('0xc'));logger['debug'](_0x7020('0xd'),_0x3c6c11,_0x7020('0xc'),JSON['stringify'](_0x5e86b5));if(_0x5e86b5[_0x7020('0xe')]){if(_0x5e86b5[_0x7020('0xe')][_0x7020('0xf')]===0x1f4){logger['error'](_0x7020('0xb'),_0x3c6c11,_0x5e86b5[_0x7020('0xe')][_0x7020('0x10')]);return _0x22ba3e(_0x5e86b5[_0x7020('0xe')][_0x7020('0x10')]);}logger['error'](_0x7020('0xb'),_0x3c6c11,_0x5e86b5['error'][_0x7020('0x10')]);return _0x42bc79(_0x5e86b5[_0x7020('0xe')][_0x7020('0x10')]);}else{logger[_0x7020('0xa')](_0x7020('0xb'),_0x3c6c11,_0x7020('0xc'));_0x42bc79(_0x5e86b5['result'][_0x7020('0x10')]);}})['catch'](function(_0x2f4db5){logger[_0x7020('0xe')](_0x7020('0xb'),_0x3c6c11,_0x2f4db5);_0x22ba3e(_0x2f4db5);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index a998690..2bf595d 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 _0xd030=['update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','index','/:id','show','post'];(function(_0x55d8c5,_0x10287a){var _0x225ae5=function(_0x2ba03a){while(--_0x2ba03a){_0x55d8c5['push'](_0x55d8c5['shift']());}};_0x225ae5(++_0x10287a);}(_0xd030,0x16c));var _0x0d03=function(_0x440d81,_0x3609cc){_0x440d81=_0x440d81-0x0;var _0x10e7aa=_0xd030[_0x440d81];return _0x10e7aa;};'use strict';var multer=require('multer');var util=require(_0x0d03('0x0'));var path=require('path');var timeout=require(_0x0d03('0x1'));var express=require(_0x0d03('0x2'));var router=express[_0x0d03('0x3')]();var fs_extra=require(_0x0d03('0x4'));var auth=require(_0x0d03('0x5'));var interaction=require(_0x0d03('0x6'));var config=require(_0x0d03('0x7'));var controller=require(_0x0d03('0x8'));router['get']('/',auth[_0x0d03('0x9')](),controller[_0x0d03('0xa')]);router['get'](_0x0d03('0xb'),auth['isAuthenticated'](),controller[_0x0d03('0xc')]);router[_0x0d03('0xd')]('/',auth[_0x0d03('0x9')](),controller['create']);router['put']('/:id',auth[_0x0d03('0x9')](),controller[_0x0d03('0xe')]);router[_0x0d03('0xf')](_0x0d03('0xb'),auth[_0x0d03('0x9')](),controller[_0x0d03('0x10')]);module[_0x0d03('0x11')]=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(_0x41648f,_0x4a8936){var _0x20340a=function(_0x358f29){while(--_0x358f29){_0x41648f['push'](_0x41648f['shift']());}};_0x20340a(++_0x4a8936);}(_0x5b2a,0x150));var _0xa5b2=function(_0x414655,_0x79d916){_0x414655=_0x414655-0x0;var _0x237884=_0x5b2a[_0x414655];return _0x237884;};'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 2c148dc..449023e 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 _0x49bd=['name','sequelize','STRING'];(function(_0x3ce6dc,_0x495488){var _0x1fb809=function(_0x1ec9a9){while(--_0x1ec9a9){_0x3ce6dc['push'](_0x3ce6dc['shift']());}};_0x1fb809(++_0x495488);}(_0x49bd,0x1e4));var _0xd49b=function(_0x57a739,_0x4d22bf){_0x57a739=_0x57a739-0x0;var _0xdac45f=_0x49bd[_0x57a739];return _0xdac45f;};'use strict';var Sequelize=require(_0xd49b('0x0'));module['exports']={'name':{'type':Sequelize[_0xd49b('0x1')],'unique':_0xd49b('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xd49b('0x1')]}}; \ No newline at end of file +var _0xe205=['exports','name','sequelize'];(function(_0x4f0a61,_0x1df9a7){var _0x447ea6=function(_0x22577e){while(--_0x22577e){_0x4f0a61['push'](_0x4f0a61['shift']());}};_0x447ea6(++_0x1df9a7);}(_0xe205,0x125));var _0x5e20=function(_0x417df8,_0x379eb1){_0x417df8=_0x417df8-0x0;var _0x3da045=_0xe205[_0x417df8];return _0x3da045;};'use strict';var Sequelize=require(_0x5e20('0x0'));module[_0x5e20('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5e20('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 87ee3d2..710a888 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 _0x91fe=['length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','rows','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','limit','count','offset','set','apply','reject','save','update','then','destroy','get','Pauses','error','stack','name','send','index','map','Pause','type','key','model','query','keys','intersection','fields','attributes'];(function(_0x3746d3,_0x26e5a5){var _0x2af995=function(_0x2f5352){while(--_0x2f5352){_0x3746d3['push'](_0x3746d3['shift']());}};_0x2af995(++_0x26e5a5);}(_0x91fe,0x1a0));var _0xe91f=function(_0x317bc,_0x3dc5dd){_0x317bc=_0x317bc-0x0;var _0x2ee40a=_0x91fe[_0x317bc];return _0x2ee40a;};'use strict';var emlformat=require(_0xe91f('0x0'));var rimraf=require(_0xe91f('0x1'));var zipdir=require(_0xe91f('0x2'));var jsonpatch=require(_0xe91f('0x3'));var rp=require(_0xe91f('0x4'));var moment=require('moment');var BPromise=require(_0xe91f('0x5'));var Mustache=require('mustache');var util=require(_0xe91f('0x6'));var path=require(_0xe91f('0x7'));var sox=require(_0xe91f('0x8'));var csv=require(_0xe91f('0x9'));var ejs=require(_0xe91f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe91f('0xb'));var squel=require(_0xe91f('0xc'));var crypto=require(_0xe91f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe91f('0xe'));var toCsv=require(_0xe91f('0x9'));var querystring=require('querystring');var Papa=require(_0xe91f('0xf'));var Redis=require(_0xe91f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe91f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe91f('0x12'));var utils=require(_0xe91f('0x13'));var config=require(_0xe91f('0x14'));var licenseUtil=require(_0xe91f('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x103a6f,_0x4b603f){_0x4b603f=_0x4b603f||0xcc;return function(_0x3282a1){if(_0x3282a1){return _0x103a6f[_0xe91f('0x16')](_0x4b603f);}return _0x103a6f[_0xe91f('0x17')](_0x4b603f)[_0xe91f('0x18')]();};}function respondWithResult(_0x3f3590,_0x5063cd){_0x5063cd=_0x5063cd||0xc8;return function(_0x1dd32f){if(_0x1dd32f){return _0x3f3590[_0xe91f('0x17')](_0x5063cd)['json'](_0x1dd32f);}};}function respondWithFilteredResult(_0x4a344e,_0x5035d8){return function(_0x582d51){if(_0x582d51){var _0x2c00e2=typeof _0x5035d8['offset']==='undefined'&&typeof _0x5035d8[_0xe91f('0x19')]==='undefined';var _0x27e655=_0x582d51[_0xe91f('0x1a')];var _0x50faa3=_0x2c00e2?0x0:_0x5035d8[_0xe91f('0x1b')];var _0x247f9b=_0x2c00e2?_0x582d51['count']:_0x5035d8['offset']+_0x5035d8[_0xe91f('0x19')];var _0x826115;if(_0x247f9b>=_0x27e655){_0x247f9b=_0x27e655;_0x826115=0xc8;}else{_0x826115=0xce;}_0x4a344e[_0xe91f('0x17')](_0x826115);return _0x4a344e[_0xe91f('0x1c')]('Content-Range',_0x50faa3+'-'+_0x247f9b+'/'+_0x27e655)['json'](_0x582d51);}return null;};}function patchUpdates(_0x42eb96){return function(_0x1717b9){try{jsonpatch[_0xe91f('0x1d')](_0x1717b9,_0x42eb96,!![]);}catch(_0x17e273){return BPromise[_0xe91f('0x1e')](_0x17e273);}return _0x1717b9[_0xe91f('0x1f')]();};}function saveUpdates(_0x44dce2,_0x40e0d5){return function(_0x1f16f1){if(_0x1f16f1){return _0x1f16f1[_0xe91f('0x20')](_0x44dce2)[_0xe91f('0x21')](function(_0xf3ec4d){return _0xf3ec4d;});}return null;};}function removeEntity(_0x2090e6,_0x87d269){return function(_0x2ca33a){if(_0x2ca33a){return _0x2ca33a[_0xe91f('0x22')]()[_0xe91f('0x21')](function(){var _0x3c4034=_0x2ca33a[_0xe91f('0x23')]({'plain':!![]});var _0x17eee8=_0xe91f('0x24');return db['UserProfileResource'][_0xe91f('0x22')]({'where':{'type':_0x17eee8,'resourceId':_0x3c4034['id']}})[_0xe91f('0x21')](function(){return _0x2ca33a;});})['then'](function(){_0x2090e6[_0xe91f('0x17')](0xcc)[_0xe91f('0x18')]();});}};}function handleEntityNotFound(_0x4b18f6,_0x517e90){return function(_0x3d63ae){if(!_0x3d63ae){_0x4b18f6[_0xe91f('0x16')](0x194);}return _0x3d63ae;};}function handleError(_0x24f5dd,_0x3c3f83){_0x3c3f83=_0x3c3f83||0x1f4;return function(_0x129a65){logger[_0xe91f('0x25')](_0x129a65[_0xe91f('0x26')]);if(_0x129a65[_0xe91f('0x27')]){delete _0x129a65[_0xe91f('0x27')];}_0x24f5dd[_0xe91f('0x17')](_0x3c3f83)[_0xe91f('0x28')](_0x129a65);};}exports[_0xe91f('0x29')]=function(_0x3c5dbd,_0x2fbee1){var _0x23c127={},_0x1ea8bd={},_0x236e5c={'count':0x0,'rows':[]};var _0x55445b=_[_0xe91f('0x2a')](db[_0xe91f('0x2b')]['rawAttributes'],function(_0x5111b3){return{'name':_0x5111b3['fieldName'],'type':_0x5111b3[_0xe91f('0x2c')][_0xe91f('0x2d')]};});_0x1ea8bd[_0xe91f('0x2e')]=_[_0xe91f('0x2a')](_0x55445b,_0xe91f('0x27'));_0x1ea8bd[_0xe91f('0x2f')]=_[_0xe91f('0x30')](_0x3c5dbd['query']);_0x1ea8bd['filters']=_[_0xe91f('0x31')](_0x1ea8bd[_0xe91f('0x2e')],_0x1ea8bd[_0xe91f('0x2f')]);_0x23c127['attributes']=_[_0xe91f('0x31')](_0x1ea8bd['model'],qs['fields'](_0x3c5dbd[_0xe91f('0x2f')][_0xe91f('0x32')]));_0x23c127[_0xe91f('0x33')]=_0x23c127[_0xe91f('0x33')][_0xe91f('0x34')]?_0x23c127['attributes']:_0x1ea8bd[_0xe91f('0x2e')];if(!_0x3c5dbd[_0xe91f('0x2f')][_0xe91f('0x35')](_0xe91f('0x36'))){_0x23c127['limit']=qs[_0xe91f('0x19')](_0x3c5dbd[_0xe91f('0x2f')]['limit']);_0x23c127[_0xe91f('0x1b')]=qs[_0xe91f('0x1b')](_0x3c5dbd[_0xe91f('0x2f')][_0xe91f('0x1b')]);}_0x23c127['order']=qs['sort'](_0x3c5dbd[_0xe91f('0x2f')][_0xe91f('0x37')]);_0x23c127['where']=qs[_0xe91f('0x38')](_[_0xe91f('0x39')](_0x3c5dbd[_0xe91f('0x2f')],_0x1ea8bd[_0xe91f('0x38')]),_0x55445b);if(_0x3c5dbd['query'][_0xe91f('0x3a')]){_0x23c127[_0xe91f('0x3b')]=_[_0xe91f('0x3c')](_0x23c127[_0xe91f('0x3b')],{'$or':_['map'](_0x55445b,function(_0x39c750){if(_0x39c750[_0xe91f('0x2c')]!==_0xe91f('0x3d')){var _0x24b183={};_0x24b183[_0x39c750[_0xe91f('0x27')]]={'$like':'%'+_0x3c5dbd[_0xe91f('0x2f')][_0xe91f('0x3a')]+'%'};return _0x24b183;}})});}_0x23c127=_[_0xe91f('0x3c')]({},_0x23c127,_0x3c5dbd['options']);var _0x3e96f5={'where':_0x23c127['where']};return db['Pause']['count'](_0x3e96f5)[_0xe91f('0x21')](function(_0x2f2fb3){_0x236e5c[_0xe91f('0x1a')]=_0x2f2fb3;if(_0x3c5dbd[_0xe91f('0x2f')][_0xe91f('0x3e')]){_0x23c127['include']=[{'all':!![]}];}return db[_0xe91f('0x2b')]['findAll'](_0x23c127);})[_0xe91f('0x21')](function(_0x35cfba){_0x236e5c[_0xe91f('0x3f')]=_0x35cfba;return _0x236e5c;})[_0xe91f('0x21')](respondWithFilteredResult(_0x2fbee1,_0x23c127))[_0xe91f('0x40')](handleError(_0x2fbee1,null));};exports[_0xe91f('0x41')]=function(_0x344e63,_0x1e29ca){var _0x1e7b5b={'raw':!![],'where':{'id':_0x344e63[_0xe91f('0x42')]['id']}},_0xbd0ca0={};_0xbd0ca0['model']=_['keys'](db[_0xe91f('0x2b')]['rawAttributes']);_0xbd0ca0[_0xe91f('0x2f')]=_[_0xe91f('0x30')](_0x344e63[_0xe91f('0x2f')]);_0xbd0ca0['filters']=_[_0xe91f('0x31')](_0xbd0ca0[_0xe91f('0x2e')],_0xbd0ca0['query']);_0x1e7b5b[_0xe91f('0x33')]=_[_0xe91f('0x31')](_0xbd0ca0[_0xe91f('0x2e')],qs[_0xe91f('0x32')](_0x344e63[_0xe91f('0x2f')][_0xe91f('0x32')]));_0x1e7b5b[_0xe91f('0x33')]=_0x1e7b5b['attributes'][_0xe91f('0x34')]?_0x1e7b5b[_0xe91f('0x33')]:_0xbd0ca0[_0xe91f('0x2e')];if(_0x344e63[_0xe91f('0x2f')][_0xe91f('0x3e')]){_0x1e7b5b['include']=[{'all':!![]}];}_0x1e7b5b=_[_0xe91f('0x3c')]({},_0x1e7b5b,_0x344e63[_0xe91f('0x43')]);return db[_0xe91f('0x2b')][_0xe91f('0x44')](_0x1e7b5b)[_0xe91f('0x21')](handleEntityNotFound(_0x1e29ca,null))[_0xe91f('0x21')](respondWithResult(_0x1e29ca,null))['catch'](handleError(_0x1e29ca,null));};exports[_0xe91f('0x45')]=function(_0x1b026a,_0x342534){return db[_0xe91f('0x2b')][_0xe91f('0x45')](_0x1b026a[_0xe91f('0x46')],{})[_0xe91f('0x21')](function(_0x1ddb6f){var _0x422e24=_0x1b026a['user'][_0xe91f('0x23')]({'plain':!![]});if(!_0x422e24)throw new Error(_0xe91f('0x47'));if(_0x422e24[_0xe91f('0x48')]===_0xe91f('0x49')){var _0x1fa8ed=_0x1ddb6f[_0xe91f('0x23')]({'plain':!![]});var _0x404cc1=_0xe91f('0x24');return db['UserProfileSection'][_0xe91f('0x44')]({'where':{'name':_0x404cc1,'userProfileId':_0x422e24[_0xe91f('0x4a')]},'raw':!![]})[_0xe91f('0x21')](function(_0x159bc5){if(_0x159bc5&&_0x159bc5[_0xe91f('0x4b')]===0x0){return db[_0xe91f('0x4c')][_0xe91f('0x45')]({'name':_0x1fa8ed['name'],'resourceId':_0x1fa8ed['id'],'type':_0x159bc5[_0xe91f('0x27')],'sectionId':_0x159bc5['id']},{})[_0xe91f('0x21')](function(){return _0x1ddb6f;});}else{return _0x1ddb6f;}})[_0xe91f('0x40')](function(_0x51a091){logger[_0xe91f('0x25')](_0xe91f('0x4d'),_0x51a091);throw _0x51a091;});}return _0x1ddb6f;})[_0xe91f('0x21')](respondWithResult(_0x342534,0xc9))[_0xe91f('0x40')](handleError(_0x342534,null));};exports[_0xe91f('0x20')]=function(_0x47aca1,_0x166ca3){if(_0x47aca1[_0xe91f('0x46')]['id']){delete _0x47aca1['body']['id'];}return db['Pause'][_0xe91f('0x44')]({'where':{'id':_0x47aca1['params']['id']}})[_0xe91f('0x21')](handleEntityNotFound(_0x166ca3,null))[_0xe91f('0x21')](saveUpdates(_0x47aca1[_0xe91f('0x46')],null))[_0xe91f('0x21')](respondWithResult(_0x166ca3,null))[_0xe91f('0x40')](handleError(_0x166ca3,null));};exports[_0xe91f('0x22')]=function(_0x434f78,_0x3a76dd){return db[_0xe91f('0x2b')][_0xe91f('0x44')]({'where':{'id':_0x434f78['params']['id']}})[_0xe91f('0x21')](handleEntityNotFound(_0x3a76dd,null))[_0xe91f('0x21')](removeEntity(_0x3a76dd,null))[_0xe91f('0x40')](handleError(_0x3a76dd,null));}; \ No newline at end of file +var _0x293d=['Pause','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','options','includeAll','findAll','rows','catch','show','params','include','merge','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','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','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','save','then','destroy','get','Pauses','UserProfileResource','error','stack','name','send','index','map'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x293d,0x1d0));var _0xd293=function(_0x4eef5c,_0x495a8f){_0x4eef5c=_0x4eef5c-0x0;var _0x431053=_0x293d[_0x4eef5c];return _0x431053;};'use strict';var emlformat=require(_0xd293('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd293('0x1'));var jsonpatch=require(_0xd293('0x2'));var rp=require(_0xd293('0x3'));var moment=require(_0xd293('0x4'));var BPromise=require(_0xd293('0x5'));var Mustache=require(_0xd293('0x6'));var util=require(_0xd293('0x7'));var path=require(_0xd293('0x8'));var sox=require(_0xd293('0x9'));var csv=require(_0xd293('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd293('0xb'));var _=require(_0xd293('0xc'));var squel=require('squel');var crypto=require(_0xd293('0xd'));var jsforce=require(_0xd293('0xe'));var deskjs=require(_0xd293('0xf'));var toCsv=require(_0xd293('0xa'));var querystring=require(_0xd293('0x10'));var Papa=require('papaparse');var Redis=require(_0xd293('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd293('0x12'));var as=require(_0xd293('0x13'));var hardwareService=require(_0xd293('0x14'));var logger=require(_0xd293('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xd293('0x16'));var licenseUtil=require(_0xd293('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ef421,_0x435509){_0x435509=_0x435509||0xcc;return function(_0x8ba6c){if(_0x8ba6c){return _0x2ef421[_0xd293('0x18')](_0x435509);}return _0x2ef421['status'](_0x435509)[_0xd293('0x19')]();};}function respondWithResult(_0x3e02e7,_0x25d619){_0x25d619=_0x25d619||0xc8;return function(_0x1226cd){if(_0x1226cd){return _0x3e02e7['status'](_0x25d619)[_0xd293('0x1a')](_0x1226cd);}};}function respondWithFilteredResult(_0x3266b5,_0x1a05f4){return function(_0x2d1f9c){if(_0x2d1f9c){var _0x443cd9=typeof _0x1a05f4[_0xd293('0x1b')]===_0xd293('0x1c')&&typeof _0x1a05f4[_0xd293('0x1d')]==='undefined';var _0x2e1e57=_0x2d1f9c['count'];var _0x2de8ad=_0x443cd9?0x0:_0x1a05f4[_0xd293('0x1b')];var _0x13e1c5=_0x443cd9?_0x2d1f9c[_0xd293('0x1e')]:_0x1a05f4[_0xd293('0x1b')]+_0x1a05f4['limit'];var _0x287c52;if(_0x13e1c5>=_0x2e1e57){_0x13e1c5=_0x2e1e57;_0x287c52=0xc8;}else{_0x287c52=0xce;}_0x3266b5[_0xd293('0x1f')](_0x287c52);return _0x3266b5['set'](_0xd293('0x20'),_0x2de8ad+'-'+_0x13e1c5+'/'+_0x2e1e57)[_0xd293('0x1a')](_0x2d1f9c);}return null;};}function patchUpdates(_0x27bee2){return function(_0x30643f){try{jsonpatch[_0xd293('0x21')](_0x30643f,_0x27bee2,!![]);}catch(_0x134a08){return BPromise['reject'](_0x134a08);}return _0x30643f[_0xd293('0x22')]();};}function saveUpdates(_0x531a3b,_0x38265e){return function(_0x3e6dba){if(_0x3e6dba){return _0x3e6dba['update'](_0x531a3b)[_0xd293('0x23')](function(_0x76f39a){return _0x76f39a;});}return null;};}function removeEntity(_0x47763e,_0x113c90){return function(_0x289e6f){if(_0x289e6f){return _0x289e6f[_0xd293('0x24')]()[_0xd293('0x23')](function(){var _0x11254e=_0x289e6f[_0xd293('0x25')]({'plain':!![]});var _0x205eeb=_0xd293('0x26');return db[_0xd293('0x27')][_0xd293('0x24')]({'where':{'type':_0x205eeb,'resourceId':_0x11254e['id']}})[_0xd293('0x23')](function(){return _0x289e6f;});})[_0xd293('0x23')](function(){_0x47763e[_0xd293('0x1f')](0xcc)[_0xd293('0x19')]();});}};}function handleEntityNotFound(_0x4d2430,_0x521bbc){return function(_0xb65911){if(!_0xb65911){_0x4d2430[_0xd293('0x18')](0x194);}return _0xb65911;};}function handleError(_0xef5115,_0x50adc2){_0x50adc2=_0x50adc2||0x1f4;return function(_0x9c054e){logger[_0xd293('0x28')](_0x9c054e[_0xd293('0x29')]);if(_0x9c054e[_0xd293('0x2a')]){delete _0x9c054e['name'];}_0xef5115[_0xd293('0x1f')](_0x50adc2)[_0xd293('0x2b')](_0x9c054e);};}exports[_0xd293('0x2c')]=function(_0x48beba,_0xe5a37){var _0x5f5c84={},_0x4edb15={},_0x127451={'count':0x0,'rows':[]};var _0x4b0f98=_[_0xd293('0x2d')](db[_0xd293('0x2e')][_0xd293('0x2f')],function(_0x2f4b10){return{'name':_0x2f4b10[_0xd293('0x30')],'type':_0x2f4b10['type'][_0xd293('0x31')]};});_0x4edb15[_0xd293('0x32')]=_[_0xd293('0x2d')](_0x4b0f98,_0xd293('0x2a'));_0x4edb15[_0xd293('0x33')]=_[_0xd293('0x34')](_0x48beba['query']);_0x4edb15[_0xd293('0x35')]=_[_0xd293('0x36')](_0x4edb15[_0xd293('0x32')],_0x4edb15[_0xd293('0x33')]);_0x5f5c84[_0xd293('0x37')]=_[_0xd293('0x36')](_0x4edb15[_0xd293('0x32')],qs[_0xd293('0x38')](_0x48beba[_0xd293('0x33')][_0xd293('0x38')]));_0x5f5c84[_0xd293('0x37')]=_0x5f5c84[_0xd293('0x37')][_0xd293('0x39')]?_0x5f5c84[_0xd293('0x37')]:_0x4edb15[_0xd293('0x32')];if(!_0x48beba['query'][_0xd293('0x3a')](_0xd293('0x3b'))){_0x5f5c84['limit']=qs[_0xd293('0x1d')](_0x48beba[_0xd293('0x33')]['limit']);_0x5f5c84[_0xd293('0x1b')]=qs['offset'](_0x48beba[_0xd293('0x33')]['offset']);}_0x5f5c84[_0xd293('0x3c')]=qs[_0xd293('0x3d')](_0x48beba[_0xd293('0x33')][_0xd293('0x3d')]);_0x5f5c84['where']=qs[_0xd293('0x35')](_[_0xd293('0x3e')](_0x48beba['query'],_0x4edb15[_0xd293('0x35')]),_0x4b0f98);if(_0x48beba[_0xd293('0x33')][_0xd293('0x3f')]){_0x5f5c84[_0xd293('0x40')]=_['merge'](_0x5f5c84[_0xd293('0x40')],{'$or':_[_0xd293('0x2d')](_0x4b0f98,function(_0x450e78){if(_0x450e78[_0xd293('0x41')]!=='VIRTUAL'){var _0x2afd70={};_0x2afd70[_0x450e78[_0xd293('0x2a')]]={'$like':'%'+_0x48beba[_0xd293('0x33')][_0xd293('0x3f')]+'%'};return _0x2afd70;}})});}_0x5f5c84=_['merge']({},_0x5f5c84,_0x48beba[_0xd293('0x42')]);var _0x6ccd22={'where':_0x5f5c84[_0xd293('0x40')]};return db[_0xd293('0x2e')][_0xd293('0x1e')](_0x6ccd22)[_0xd293('0x23')](function(_0x43f73c){_0x127451[_0xd293('0x1e')]=_0x43f73c;if(_0x48beba['query'][_0xd293('0x43')]){_0x5f5c84['include']=[{'all':!![]}];}return db[_0xd293('0x2e')][_0xd293('0x44')](_0x5f5c84);})[_0xd293('0x23')](function(_0x239324){_0x127451[_0xd293('0x45')]=_0x239324;return _0x127451;})[_0xd293('0x23')](respondWithFilteredResult(_0xe5a37,_0x5f5c84))[_0xd293('0x46')](handleError(_0xe5a37,null));};exports[_0xd293('0x47')]=function(_0x470a07,_0x306137){var _0x1bc039={'raw':!![],'where':{'id':_0x470a07[_0xd293('0x48')]['id']}},_0x5b26e0={};_0x5b26e0['model']=_['keys'](db[_0xd293('0x2e')][_0xd293('0x2f')]);_0x5b26e0[_0xd293('0x33')]=_[_0xd293('0x34')](_0x470a07['query']);_0x5b26e0[_0xd293('0x35')]=_[_0xd293('0x36')](_0x5b26e0[_0xd293('0x32')],_0x5b26e0[_0xd293('0x33')]);_0x1bc039[_0xd293('0x37')]=_[_0xd293('0x36')](_0x5b26e0[_0xd293('0x32')],qs[_0xd293('0x38')](_0x470a07[_0xd293('0x33')]['fields']));_0x1bc039[_0xd293('0x37')]=_0x1bc039[_0xd293('0x37')][_0xd293('0x39')]?_0x1bc039[_0xd293('0x37')]:_0x5b26e0[_0xd293('0x32')];if(_0x470a07['query'][_0xd293('0x43')]){_0x1bc039[_0xd293('0x49')]=[{'all':!![]}];}_0x1bc039=_[_0xd293('0x4a')]({},_0x1bc039,_0x470a07[_0xd293('0x42')]);return db[_0xd293('0x2e')][_0xd293('0x4b')](_0x1bc039)[_0xd293('0x23')](handleEntityNotFound(_0x306137,null))[_0xd293('0x23')](respondWithResult(_0x306137,null))['catch'](handleError(_0x306137,null));};exports[_0xd293('0x4c')]=function(_0x57971f,_0x8cb328){return db['Pause'][_0xd293('0x4c')](_0x57971f[_0xd293('0x4d')],{})[_0xd293('0x23')](function(_0x1b2b91){var _0x1dd57c=_0x57971f[_0xd293('0x4e')]['get']({'plain':!![]});if(!_0x1dd57c)throw new Error(_0xd293('0x4f'));if(_0x1dd57c['role']==='user'){var _0x34adad=_0x1b2b91[_0xd293('0x25')]({'plain':!![]});var _0x4a3e2c=_0xd293('0x26');return db[_0xd293('0x50')]['find']({'where':{'name':_0x4a3e2c,'userProfileId':_0x1dd57c[_0xd293('0x51')]},'raw':!![]})[_0xd293('0x23')](function(_0x4b3083){if(_0x4b3083&&_0x4b3083[_0xd293('0x52')]===0x0){return db[_0xd293('0x27')][_0xd293('0x4c')]({'name':_0x34adad[_0xd293('0x2a')],'resourceId':_0x34adad['id'],'type':_0x4b3083[_0xd293('0x2a')],'sectionId':_0x4b3083['id']},{})[_0xd293('0x23')](function(){return _0x1b2b91;});}else{return _0x1b2b91;}})['catch'](function(_0x141778){logger[_0xd293('0x28')](_0xd293('0x53'),_0x141778);throw _0x141778;});}return _0x1b2b91;})[_0xd293('0x23')](respondWithResult(_0x8cb328,0xc9))[_0xd293('0x46')](handleError(_0x8cb328,null));};exports[_0xd293('0x54')]=function(_0x5c94ca,_0x1a10e6){if(_0x5c94ca[_0xd293('0x4d')]['id']){delete _0x5c94ca[_0xd293('0x4d')]['id'];}return db[_0xd293('0x2e')][_0xd293('0x4b')]({'where':{'id':_0x5c94ca['params']['id']}})['then'](handleEntityNotFound(_0x1a10e6,null))[_0xd293('0x23')](saveUpdates(_0x5c94ca[_0xd293('0x4d')],null))[_0xd293('0x23')](respondWithResult(_0x1a10e6,null))[_0xd293('0x46')](handleError(_0x1a10e6,null));};exports[_0xd293('0x24')]=function(_0x38a70f,_0x4a129c){return db[_0xd293('0x2e')][_0xd293('0x4b')]({'where':{'id':_0x38a70f[_0xd293('0x48')]['id']}})[_0xd293('0x23')](handleEntityNotFound(_0x4a129c,null))[_0xd293('0x23')](removeEntity(_0x4a129c,null))[_0xd293('0x46')](handleError(_0x4a129c,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 26b45bc..03c6f62 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 _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','lodash','util'];(function(_0x40762c,_0x430c25){var _0xc7e7d7=function(_0x2c494f){while(--_0x2c494f){_0x40762c['push'](_0x40762c['shift']());}};_0xc7e7d7(++_0x430c25);}(_0xf494,0x1c6));var _0x4f49=function(_0x35ae71,_0x21b2b6){_0x35ae71=_0x35ae71-0x0;var _0x23aacf=_0xf494[_0x35ae71];return _0x23aacf;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('Pause',attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb9=['./pause.attributes','exports','define','Pause','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x5e271e,_0x21f7ba){var _0x148e01=function(_0x2c1a3b){while(--_0x2c1a3b){_0x5e271e['push'](_0x5e271e['shift']());}};_0x148e01(++_0x21f7ba);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4b4397,_0x389ffe){_0x4b4397=_0x4b4397-0x0;var _0x2bfff3=_0x1cb9[_0x4b4397];return _0x2bfff3;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('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 cf3c068..631a842 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0xccf49,_0xc50088){var _0x57b34c=function(_0x5c021b){while(--_0x5c021b){_0xccf49['push'](_0xccf49['shift']());}};_0x57b34c(++_0xc50088);}(_0x7a54,0x106));var _0x47a5=function(_0x785de3,_0x4bee32){_0x785de3=_0x785de3-0x0;var _0x2bfc2a=_0x7a54[_0x785de3];return _0x2bfc2a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x24b55c,_0x5d5fe5){var _0x4556b0=function(_0x579c6c){while(--_0x579c6c){_0x24b55c['push'](_0x24b55c['shift']());}};_0x4556b0(++_0x5d5fe5);}(_0xb10b,0x12a));var _0xbb10=function(_0x15ece6,_0x51a965){_0x15ece6=_0x15ece6-0x0;var _0x3dc05c=_0xb10b[_0x15ece6];return _0x3dc05c;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 8e85fd7..274ac3e 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 _0x303a=['show','/:id/download','download','join','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','/:id','update','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook'];(function(_0xe881da,_0x5a0186){var _0x25092d=function(_0x2a7af0){while(--_0x2a7af0){_0xe881da['push'](_0xe881da['shift']());}};_0x25092d(++_0x5a0186);}(_0x303a,0x1a0));var _0xa303=function(_0x4f7618,_0x243df2){_0x4f7618=_0x4f7618-0x0;var _0x20ba5f=_0x303a[_0x4f7618];return _0x20ba5f;};'use strict';var multer=require(_0xa303('0x0'));var util=require('util');var path=require(_0xa303('0x1'));var timeout=require(_0xa303('0x2'));var express=require(_0xa303('0x3'));var router=express[_0xa303('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa303('0x5'));var interaction=require(_0xa303('0x6'));var config=require(_0xa303('0x7'));var controller=require(_0xa303('0x8'));router[_0xa303('0x9')]('/',auth[_0xa303('0xa')](),controller[_0xa303('0xb')]);router[_0xa303('0x9')](_0xa303('0xc'),controller['webhookGet']);router['get']('/:id',auth[_0xa303('0xa')](),controller[_0xa303('0xd')]);router['get'](_0xa303('0xe'),auth['isAuthenticated'](),controller[_0xa303('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x29cd60,_0x17dfcd,_0x382cfd){_0x382cfd(null,path[_0xa303('0x10')](config['root'],_0xa303('0x11')));},'filename':function(_0x4c0169,_0xf5df1e,_0x43a054){_0xf5df1e[_0xa303('0x12')]=_0xf5df1e['originalname'][_0xa303('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x43a054(null,util[_0xa303('0x14')](_0xa303('0x15'),path[_0xa303('0x16')](_0xf5df1e[_0xa303('0x12')],path[_0xa303('0x17')](_0xf5df1e[_0xa303('0x12')])),Date[_0xa303('0x18')](),path['extname'](_0xf5df1e[_0xa303('0x12')])));}})});router[_0xa303('0x19')]('/',upload[_0xa303('0x1a')](_0xa303('0x1b')),controller[_0xa303('0x1c')]);router[_0xa303('0x19')]('/webhook',controller[_0xa303('0x1d')]);router['put'](_0xa303('0x1e'),auth['isAuthenticated'](),controller[_0xa303('0x1f')]);router['delete'](_0xa303('0x1e'),auth[_0xa303('0xa')](),controller[_0xa303('0x20')]);module['exports']=router; \ No newline at end of file +var _0xa41a=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','webhookGet','get','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','extname','now','post','file','upload','/webhook','webhookPost','put','/:id','update','delete','exports','multer'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xa41a,0x6b));var _0xaa41=function(_0x3fc6c2,_0x3acffd){_0x3fc6c2=_0x3fc6c2-0x0;var _0x1b025e=_0xa41a[_0x3fc6c2];return _0x1b025e;};'use strict';var multer=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var path=require('path');var timeout=require(_0xaa41('0x2'));var express=require(_0xaa41('0x3'));var router=express[_0xaa41('0x4')]();var fs_extra=require(_0xaa41('0x5'));var auth=require(_0xaa41('0x6'));var interaction=require(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var controller=require(_0xaa41('0x9'));router['get']('/',auth[_0xaa41('0xa')](),controller[_0xaa41('0xb')]);router['get']('/webhook',controller[_0xaa41('0xc')]);router[_0xaa41('0xd')]('/:id',auth[_0xaa41('0xa')](),controller[_0xaa41('0xe')]);router[_0xaa41('0xd')](_0xaa41('0xf'),auth[_0xaa41('0xa')](),controller[_0xaa41('0x10')]);var upload=multer({'storage':multer[_0xaa41('0x11')]({'destination':function(_0x423a19,_0x1c291e,_0x5c9fc7){_0x5c9fc7(null,path[_0xaa41('0x12')](config[_0xaa41('0x13')],'server/files/plugins'));},'filename':function(_0x54827c,_0x1d0a54,_0x518b5b){_0x1d0a54[_0xaa41('0x14')]=_0x1d0a54[_0xaa41('0x14')][_0xaa41('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x518b5b(null,util[_0xaa41('0x16')](_0xaa41('0x17'),path['basename'](_0x1d0a54[_0xaa41('0x14')],path[_0xaa41('0x18')](_0x1d0a54[_0xaa41('0x14')])),Date[_0xaa41('0x19')](),path[_0xaa41('0x18')](_0x1d0a54[_0xaa41('0x14')])));}})});router[_0xaa41('0x1a')]('/',upload['single'](_0xaa41('0x1b')),controller[_0xaa41('0x1c')]);router[_0xaa41('0x1a')](_0xaa41('0x1d'),controller[_0xaa41('0x1e')]);router[_0xaa41('0x1f')](_0xaa41('0x20'),auth[_0xaa41('0xa')](),controller[_0xaa41('0x21')]);router['delete']('/:id',auth[_0xaa41('0xa')](),controller[_0xaa41('0x22')]);module[_0xaa41('0x23')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 7d4ad1b..bae1d09 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 _0x94b7=['BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','ENUM','html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x5818e3,_0x52a13d){var _0x3e4890=function(_0x4c7a1f){while(--_0x4c7a1f){_0x5818e3['push'](_0x5818e3['shift']());}};_0x3e4890(++_0x52a13d);}(_0x94b7,0x126));var _0x794b=function(_0x3fdb45,_0x32a38a){_0x3fdb45=_0x3fdb45-0x0;var _0xbc66db=_0x94b7[_0x3fdb45];return _0xbc66db;};'use strict';var Sequelize=require(_0x794b('0x0'));module['exports']={'name':{'type':Sequelize[_0x794b('0x1')]},'type':{'type':Sequelize[_0x794b('0x2')](_0x794b('0x3'),'script')},'description':{'type':Sequelize[_0x794b('0x4')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x794b('0x1')],'comment':_0x794b('0x5')},'active':{'type':Sequelize[_0x794b('0x6')],'defaultValue':0x0,'comment':_0x794b('0x7')},'sidebar':{'type':Sequelize[_0x794b('0x2')](_0x794b('0x8'),'agentOnly','always',_0x794b('0x9')),'defaultValue':_0x794b('0xa'),'comment':_0x794b('0xb')},'icon':{'type':Sequelize[_0x794b('0x1')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x794b('0x1')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x794b('0x1')]}}; \ No newline at end of file +var _0x9879=['never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always'];(function(_0x2038a5,_0xf86914){var _0x20a8cf=function(_0x4fb974){while(--_0x4fb974){_0x2038a5['push'](_0x2038a5['shift']());}};_0x20a8cf(++_0xf86914);}(_0x9879,0x92));var _0x9987=function(_0x3df8a0,_0x2c14df){_0x3df8a0=_0x3df8a0-0x0;var _0x867f54=_0x9879[_0x3df8a0];return _0x867f54;};'use strict';var Sequelize=require(_0x9987('0x0'));module[_0x9987('0x1')]={'name':{'type':Sequelize[_0x9987('0x2')]},'type':{'type':Sequelize[_0x9987('0x3')](_0x9987('0x4'),_0x9987('0x5'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x9987('0x6')],'defaultValue':0x0,'comment':_0x9987('0x7')},'sidebar':{'type':Sequelize['ENUM']('adminOnly',_0x9987('0x8'),_0x9987('0x9'),_0x9987('0xa')),'defaultValue':_0x9987('0x9'),'comment':_0x9987('0xb')},'icon':{'type':Sequelize[_0x9987('0x2')]},'adminUrl':{'type':Sequelize[_0x9987('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x9987('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index d3c989e..8366c84 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 _0x2655=['method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','eml-format','rimraf','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','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','sendStatus','end','status','offset','undefined','limit','count','set','apply','reject','save','then','destroy','get','Plugins','UserProfileResource','error','stack','name','send','index','map','Plugin','rawAttributes','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show','params','keys','includeAll','include','find','join','server/files/plugins','format','basename','createWriteStream','zip','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','root','dirname','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','download','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','sidebar','always','icon','version','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','script','body','role','userProfileId','UserProfileSection','autoAssociation','unlinkSync','Extracted\x20folder\x20removed','update','delete','webhookGet','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','json','encoding'];(function(_0x5567cd,_0x35ca37){var _0x559621=function(_0x133b94){while(--_0x133b94){_0x5567cd['push'](_0x5567cd['shift']());}};_0x559621(++_0x35ca37);}(_0x2655,0x160));var _0x5265=function(_0x5036fe,_0x188b6f){_0x5036fe=_0x5036fe-0x0;var _0x5a76d9=_0x2655[_0x5036fe];return _0x5a76d9;};'use strict';var emlformat=require(_0x5265('0x0'));var rimraf=require(_0x5265('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5265('0x2'));var rp=require(_0x5265('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5265('0x4'));var path=require(_0x5265('0x5'));var sox=require(_0x5265('0x6'));var csv=require(_0x5265('0x7'));var ejs=require(_0x5265('0x8'));var fs=require('fs');var fs_extra=require(_0x5265('0x9'));var _=require(_0x5265('0xa'));var squel=require(_0x5265('0xb'));var crypto=require('crypto');var jsforce=require(_0x5265('0xc'));var deskjs=require(_0x5265('0xd'));var toCsv=require(_0x5265('0x7'));var querystring=require(_0x5265('0xe'));var Papa=require(_0x5265('0xf'));var extract=require(_0x5265('0x10'));var rimraf=require(_0x5265('0x1'));var archiver=require(_0x5265('0x11'));var Redis=require(_0x5265('0x12'));var authService=require(_0x5265('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5265('0x14'));var hardwareService=require(_0x5265('0x15'));var logger=require('../../config/logger')(_0x5265('0x16'));var utils=require(_0x5265('0x17'));var config=require(_0x5265('0x18'));var licenseUtil=require(_0x5265('0x19'));var db=require(_0x5265('0x1a'))['db'];config[_0x5265('0x1b')]=_[_0x5265('0x1c')](config[_0x5265('0x1b')],{'host':_0x5265('0x1d'),'port':0x18eb});var socket=require(_0x5265('0x1e'))(new Redis(config[_0x5265('0x1b')]));require('./plugin.socket')['register'](socket);function respondWithStatusCode(_0x577817,_0x4d3de0){_0x4d3de0=_0x4d3de0||0xcc;return function(_0x512a53){if(_0x512a53){return _0x577817[_0x5265('0x1f')](_0x4d3de0);}return _0x577817['status'](_0x4d3de0)[_0x5265('0x20')]();};}function respondWithResult(_0x33ca40,_0x14b097){_0x14b097=_0x14b097||0xc8;return function(_0xfb40b0){if(_0xfb40b0){return _0x33ca40[_0x5265('0x21')](_0x14b097)['json'](_0xfb40b0);}};}function respondWithFilteredResult(_0x4ba7f8,_0x5b6be5){return function(_0x5840a9){if(_0x5840a9){var _0x25a2c8=typeof _0x5b6be5[_0x5265('0x22')]===_0x5265('0x23')&&typeof _0x5b6be5[_0x5265('0x24')]==='undefined';var _0x106132=_0x5840a9[_0x5265('0x25')];var _0x2ebadd=_0x25a2c8?0x0:_0x5b6be5[_0x5265('0x22')];var _0x15791e=_0x25a2c8?_0x5840a9[_0x5265('0x25')]:_0x5b6be5[_0x5265('0x22')]+_0x5b6be5[_0x5265('0x24')];var _0x330671;if(_0x15791e>=_0x106132){_0x15791e=_0x106132;_0x330671=0xc8;}else{_0x330671=0xce;}_0x4ba7f8['status'](_0x330671);return _0x4ba7f8[_0x5265('0x26')]('Content-Range',_0x2ebadd+'-'+_0x15791e+'/'+_0x106132)['json'](_0x5840a9);}return null;};}function patchUpdates(_0x5e597d){return function(_0x457681){try{jsonpatch[_0x5265('0x27')](_0x457681,_0x5e597d,!![]);}catch(_0x288c08){return BPromise[_0x5265('0x28')](_0x288c08);}return _0x457681[_0x5265('0x29')]();};}function saveUpdates(_0x3106cc,_0x2f76a5){return function(_0x423210){if(_0x423210){return _0x423210['update'](_0x3106cc)[_0x5265('0x2a')](function(_0xd6b235){return _0xd6b235;});}return null;};}function removeEntity(_0x533d8a,_0x28df47){return function(_0x172463){if(_0x172463){return _0x172463[_0x5265('0x2b')]()['then'](function(){var _0x413e9c=_0x172463[_0x5265('0x2c')]({'plain':!![]});var _0x508203=_0x5265('0x2d');return db[_0x5265('0x2e')]['destroy']({'where':{'type':_0x508203,'resourceId':_0x413e9c['id']}})['then'](function(){return _0x172463;});})[_0x5265('0x2a')](function(){_0x533d8a['status'](0xcc)[_0x5265('0x20')]();});}};}function handleEntityNotFound(_0x7edf12,_0xa142d4){return function(_0x378de0){if(!_0x378de0){_0x7edf12['sendStatus'](0x194);}return _0x378de0;};}function handleError(_0x4fe4cd,_0x8a5dae){_0x8a5dae=_0x8a5dae||0x1f4;return function(_0x39c84b){logger[_0x5265('0x2f')](_0x39c84b[_0x5265('0x30')]);if(_0x39c84b['name']){delete _0x39c84b[_0x5265('0x31')];}_0x4fe4cd[_0x5265('0x21')](_0x8a5dae)[_0x5265('0x32')](_0x39c84b);};}exports[_0x5265('0x33')]=function(_0x1e88cd,_0x1d771d){var _0x1c85e9={},_0x29caf2={},_0x5306ad={'count':0x0,'rows':[]};var _0x2d546b=_[_0x5265('0x34')](db[_0x5265('0x35')][_0x5265('0x36')],function(_0x53016c){return{'name':_0x53016c['fieldName'],'type':_0x53016c['type'][_0x5265('0x37')]};});_0x29caf2[_0x5265('0x38')]=_[_0x5265('0x34')](_0x2d546b,_0x5265('0x31'));_0x29caf2[_0x5265('0x39')]=_['keys'](_0x1e88cd[_0x5265('0x39')]);_0x29caf2['filters']=_[_0x5265('0x3a')](_0x29caf2[_0x5265('0x38')],_0x29caf2['query']);_0x1c85e9[_0x5265('0x3b')]=_[_0x5265('0x3a')](_0x29caf2[_0x5265('0x38')],qs[_0x5265('0x3c')](_0x1e88cd[_0x5265('0x39')][_0x5265('0x3c')]));_0x1c85e9[_0x5265('0x3b')]=_0x1c85e9[_0x5265('0x3b')][_0x5265('0x3d')]?_0x1c85e9[_0x5265('0x3b')]:_0x29caf2['model'];if(!_0x1e88cd[_0x5265('0x39')]['hasOwnProperty'](_0x5265('0x3e'))){_0x1c85e9[_0x5265('0x24')]=qs[_0x5265('0x24')](_0x1e88cd[_0x5265('0x39')][_0x5265('0x24')]);_0x1c85e9[_0x5265('0x22')]=qs[_0x5265('0x22')](_0x1e88cd[_0x5265('0x39')][_0x5265('0x22')]);}_0x1c85e9[_0x5265('0x3f')]=qs[_0x5265('0x40')](_0x1e88cd[_0x5265('0x39')][_0x5265('0x40')]);_0x1c85e9[_0x5265('0x41')]=qs[_0x5265('0x42')](_[_0x5265('0x43')](_0x1e88cd['query'],_0x29caf2[_0x5265('0x42')]),_0x2d546b);if(_0x1e88cd[_0x5265('0x39')][_0x5265('0x44')]){_0x1c85e9[_0x5265('0x41')]=_[_0x5265('0x45')](_0x1c85e9[_0x5265('0x41')],{'$or':_[_0x5265('0x34')](_0x2d546b,function(_0x1bc713){if(_0x1bc713[_0x5265('0x46')]!==_0x5265('0x47')){var _0x3c5e87={};_0x3c5e87[_0x1bc713['name']]={'$like':'%'+_0x1e88cd['query']['filter']+'%'};return _0x3c5e87;}})});}_0x1c85e9=_[_0x5265('0x45')]({},_0x1c85e9,_0x1e88cd[_0x5265('0x48')]);var _0x2d1c6a={'where':_0x1c85e9[_0x5265('0x41')]};return db[_0x5265('0x35')]['count'](_0x2d1c6a)['then'](function(_0x567b93){_0x5306ad[_0x5265('0x25')]=_0x567b93;if(_0x1e88cd[_0x5265('0x39')]['includeAll']){_0x1c85e9['include']=[{'all':!![]}];}return db['Plugin'][_0x5265('0x49')](_0x1c85e9);})[_0x5265('0x2a')](function(_0x44d233){_0x5306ad[_0x5265('0x4a')]=_0x44d233;return _0x5306ad;})[_0x5265('0x2a')](respondWithFilteredResult(_0x1d771d,_0x1c85e9))[_0x5265('0x4b')](handleError(_0x1d771d,null));};exports[_0x5265('0x4c')]=function(_0x482c62,_0x3f255f){var _0x28d6cf={'raw':!![],'where':{'id':_0x482c62[_0x5265('0x4d')]['id']}},_0x32cc9f={};_0x32cc9f[_0x5265('0x38')]=_[_0x5265('0x4e')](db[_0x5265('0x35')][_0x5265('0x36')]);_0x32cc9f[_0x5265('0x39')]=_['keys'](_0x482c62[_0x5265('0x39')]);_0x32cc9f[_0x5265('0x42')]=_['intersection'](_0x32cc9f['model'],_0x32cc9f['query']);_0x28d6cf['attributes']=_[_0x5265('0x3a')](_0x32cc9f['model'],qs[_0x5265('0x3c')](_0x482c62['query']['fields']));_0x28d6cf[_0x5265('0x3b')]=_0x28d6cf[_0x5265('0x3b')][_0x5265('0x3d')]?_0x28d6cf[_0x5265('0x3b')]:_0x32cc9f[_0x5265('0x38')];if(_0x482c62['query'][_0x5265('0x4f')]){_0x28d6cf[_0x5265('0x50')]=[{'all':!![]}];}_0x28d6cf=_[_0x5265('0x45')]({},_0x28d6cf,_0x482c62[_0x5265('0x48')]);return db['Plugin'][_0x5265('0x51')](_0x28d6cf)[_0x5265('0x2a')](handleEntityNotFound(_0x3f255f,null))[_0x5265('0x2a')](respondWithResult(_0x3f255f,null))['catch'](handleError(_0x3f255f,null));};exports['download']=function(_0x310f20,_0x115b8c,_0x42dcf5){return db[_0x5265('0x35')][_0x5265('0x51')]({'where':{'id':_0x310f20['params']['id']},'attributes':[_0x5265('0x31'),_0x5265('0x5')],'raw':!![]})[_0x5265('0x2a')](handleEntityNotFound(_0x115b8c,null))[_0x5265('0x2a')](function(_0x472315){if(_0x472315){var _0x40e6a1=path[_0x5265('0x52')](config['root'],_0x5265('0x53'),util[_0x5265('0x54')]('%s.zip',path[_0x5265('0x55')](_0x472315[_0x5265('0x5')])));var _0x3c648d=fs[_0x5265('0x56')](_0x40e6a1);var _0xc588b1=archiver(_0x5265('0x57'),{'zlib':{'level':0x9}});_0xc588b1['on'](_0x5265('0x58'),function(_0x583590){if(_0x583590['code']===_0x5265('0x59')){logger[_0x5265('0x2f')](_0x583590);}else{throw new db[(_0x5265('0x5a'))][(_0x5265('0x5b'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0xc588b1['on'](_0x5265('0x2f'),function(_0x5edc83){throw new db[(_0x5265('0x5a'))]['Error'](_0x5265('0x5c'));});_0xc588b1['pipe'](_0x3c648d);_0xc588b1[_0x5265('0x5d')](_0x5265('0x5e'),{'cwd':path[_0x5265('0x52')](config[_0x5265('0x5f')],_0x5265('0x53'),path[_0x5265('0x60')](_0x472315[_0x5265('0x5')])),'ignore':[path[_0x5265('0x52')](path[_0x5265('0x55')](_0x472315['path']),'node_modules/**/*'),path[_0x5265('0x52')](path[_0x5265('0x55')](_0x472315['path']),_0x5265('0x61'))],'nodir':!![]})[_0x5265('0x62')]();_0x3c648d['on'](_0x5265('0x63'),function(){if(!fs[_0x5265('0x64')](_0x40e6a1)){throw new db[(_0x5265('0x5a'))]['Error'](_0x5265('0x65'));}return _0x115b8c[_0x5265('0x66')](_0x40e6a1,util[_0x5265('0x54')](_0x5265('0x67'),path[_0x5265('0x55')](_0x472315[_0x5265('0x5')])),function(_0x5bd4f7){if(_0x5bd4f7){throw new db[(_0x5265('0x5a'))][(_0x5265('0x5b'))](_0x5265('0x68'));}fs['unlinkSync'](_0x40e6a1);logger[_0x5265('0x69')](_0x5265('0x6a'));logger[_0x5265('0x69')](_0x5265('0x6b'));});});}return null;})[_0x5265('0x4b')](handleError(_0x115b8c,null));};exports[_0x5265('0x6c')]=function(_0x543ff1,_0x616da2,_0x175493){var _0x1a8aa3=path[_0x5265('0x55')](_0x543ff1['file']['filename'],path['extname'](_0x543ff1[_0x5265('0x6d')][_0x5265('0x6e')]));var _0x5e5462=path['join'](config[_0x5265('0x5f')],_0x5265('0x53'),_0x543ff1[_0x5265('0x6d')][_0x5265('0x6e')]);var _0x15f1e8=path[_0x5265('0x52')](config[_0x5265('0x5f')],_0x5265('0x53'),_0x1a8aa3);logger['info'](_0x5265('0x6f'),_0x5e5462);logger[_0x5265('0x69')](_0x5265('0x70'),_0x15f1e8);try{fs[_0x5265('0x71')](_0x5e5462,parseInt(_0x5265('0x72'),0x8));extract(_0x5e5462,{'dir':_0x15f1e8},function(_0x277572){if(_0x277572){logger[_0x5265('0x2f')](_0x277572);handleError(_0x277572,!![]);};var _0x1d79b2=fs[_0x5265('0x73')](_0x15f1e8);if(_0x1d79b2[_0x5265('0x3d')]>0x1){removeReferences(_0x5e5462,_0x15f1e8);logger[_0x5265('0x2f')](_0x5265('0x74'));return _0x175493(new Error(_0x5265('0x74')));}var _0x2ee9d5=fs[_0x5265('0x75')](path[_0x5265('0x52')](_0x15f1e8,_0x1d79b2[0x0]));if(_0x2ee9d5[_0x5265('0x76')]()){removeReferences(_0x5e5462,_0x15f1e8);logger[_0x5265('0x2f')]('Invalid\x20plugin\x20structure');return _0x175493(new Error('Invalid\x20plugin\x20structure'));}if(_0x2ee9d5[_0x5265('0x77')]()){var _0x46e5d4=fs[_0x5265('0x73')](path[_0x5265('0x52')](_0x15f1e8,_0x1d79b2[0x0]));if(_0x46e5d4[_0x5265('0x3d')]===0x0){removeReferences(_0x5e5462,_0x15f1e8);logger[_0x5265('0x2f')](_0x5265('0x74'));return _0x175493(new Error(_0x5265('0x74')));}var _0x5bd28e=_0x46e5d4[_0x5265('0x78')](function(_0x2516f4){return _0x2516f4==='manifest.json';});if(!_0x5bd28e){return _0x175493(new Error(_0x5265('0x79')));}var _0x6cfd4a=fs[_0x5265('0x7a')](path[_0x5265('0x52')](_0x15f1e8,_0x1d79b2[0x0],_0x5265('0x7b')));var _0x494b52=JSON[_0x5265('0x7c')](_0x6cfd4a);if('undefined'==typeof _0x494b52['name']){return _0x175493(new Error(_0x5265('0x7d')));}if(_0x5265('0x23')==typeof _0x494b52[_0x5265('0x46')]){return _0x175493(new Error(_0x5265('0x7e')));}if('undefined'==typeof _0x494b52['version']){return _0x175493(new Error(_0x5265('0x7f')));}if(_0x5265('0x23')==typeof _0x494b52[_0x5265('0x80')]){return _0x175493(new Error(_0x5265('0x81')));}if(_0x494b52[_0x5265('0x46')]===_0x5265('0x82')){if('undefined'==typeof _0x494b52[_0x5265('0x80')][_0x5265('0x83')]){return _0x175493(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x5265('0x23')==typeof _0x494b52[_0x5265('0x80')][_0x5265('0x83')][_0x5265('0x84')]&&'undefined'==typeof _0x494b52[_0x5265('0x80')][_0x5265('0x83')]['agent']){return _0x175493(new Error(_0x5265('0x85')));}}else if(_0x494b52[_0x5265('0x46')]==='script'){if(_0x5265('0x23')==typeof _0x494b52[_0x5265('0x80')][_0x5265('0x86')]){return _0x175493(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x494b52[_0x5265('0x80')][_0x5265('0x87')]){return _0x175493(new Error(_0x5265('0x88')));}}else{return _0x175493(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x376b2a=_0x494b52[_0x5265('0x31')];var _0x507f9f=_0x494b52['description'];var _0x1d97f9=_0x494b52[_0x5265('0x46')];var _0x374639=_0x494b52[_0x5265('0x89')]?_0x494b52[_0x5265('0x89')]:_0x5265('0x8a');var _0x4367cd=_0x494b52['icon']?_0x494b52[_0x5265('0x8b')]:'icon-apps';var _0x301c91='';var _0xc32f1e='';var _0x1f4db0='';var _0x105379='';var _0x494207=_0x494b52[_0x5265('0x8c')];if(_0x1d97f9===_0x5265('0x82')){if(_0x5265('0x23')!=typeof _0x494b52['parameters'][_0x5265('0x83')][_0x5265('0x84')]){var _0x53d12e=_0x494b52['parameters']['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x5265('0x8d')](_0x53d12e)){_0x301c91=path[_0x5265('0x52')](_0x5265('0x8e'),_0x1a8aa3,_0x1d79b2[0x0],_0x53d12e);}else{_0x301c91=_0x53d12e;}}else{logger[_0x5265('0x69')](_0x5265('0x8f'));}if(_0x5265('0x23')!=typeof _0x494b52['parameters']['views'][_0x5265('0x90')]){var _0x146182=_0x494b52[_0x5265('0x80')][_0x5265('0x83')][_0x5265('0x90')];if(!/^(f|ht)tps?:\/\//i[_0x5265('0x8d')](_0x146182)){_0xc32f1e=path[_0x5265('0x52')](_0x5265('0x8e'),_0x1a8aa3,_0x1d79b2[0x0],_0x146182);}else{_0xc32f1e=_0x146182;}}else{logger[_0x5265('0x69')](_0x5265('0x91'));}}else if(_0x1d97f9===_0x5265('0x92')){_0x1f4db0=_0x494b52['parameters'][_0x5265('0x86')];_0x105379=_0x494b52[_0x5265('0x80')]['scriptPath'];if(_0x5265('0x23')!=typeof _0x494b52[_0x5265('0x80')][_0x5265('0x83')]){if(_0x5265('0x23')!=typeof _0x494b52[_0x5265('0x80')][_0x5265('0x83')]['admin']){var _0x53d12e=_0x494b52[_0x5265('0x80')][_0x5265('0x83')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x5265('0x8d')](_0x53d12e)){_0x301c91=path[_0x5265('0x52')]('plugins',_0x1a8aa3,_0x1d79b2[0x0],_0x53d12e);}else{_0x301c91=_0x53d12e;}}if(_0x5265('0x23')!=typeof _0x494b52[_0x5265('0x80')][_0x5265('0x83')][_0x5265('0x90')]){var _0x146182=_0x494b52[_0x5265('0x80')][_0x5265('0x83')][_0x5265('0x90')];if(!/^(f|ht)tps?:\/\//i[_0x5265('0x8d')](_0x146182)){_0xc32f1e=path['join'](_0x5265('0x8e'),_0x1a8aa3,_0x1d79b2[0x0],_0x146182);}else{_0xc32f1e=_0x146182;}}}}var _0x3bbc6f={'name':_0x376b2a,'description':_0x507f9f,'path':path[_0x5265('0x52')](_0x1a8aa3,_0x1d79b2[0x0]),'type':_0x1d97f9,'sidebar':_0x374639,'icon':_0x4367cd,'adminUrl':_0x301c91,'agentUrl':_0xc32f1e,'scriptName':_0x1f4db0,'scriptPath':_0x105379,'version':_0x494207};removeReferences(_0x5e5462,null);return db['Plugin']['create'](_0x3bbc6f)[_0x5265('0x2a')](function(_0x2e3d15){var _0x7dea3a={'role':_0x543ff1[_0x5265('0x93')][_0x5265('0x94')],'userProfileId':_0x543ff1[_0x5265('0x93')][_0x5265('0x95')]};if(!_0x7dea3a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7dea3a[_0x5265('0x94')]==='user'){var _0x187392=_0x2e3d15[_0x5265('0x2c')]({'plain':!![]});return db[_0x5265('0x96')][_0x5265('0x51')]({'where':{'name':_0x5265('0x2d'),'userProfileId':_0x7dea3a[_0x5265('0x95')]},'raw':!![]})[_0x5265('0x2a')](function(_0xe37b1a){if(_0xe37b1a&&_0xe37b1a[_0x5265('0x97')]===0x0){return db[_0x5265('0x2e')]['create']({'name':_0x187392['name'],'resourceId':_0x187392['id'],'type':_0xe37b1a[_0x5265('0x31')],'sectionId':_0xe37b1a['id']},{})[_0x5265('0x2a')](function(){return _0x2e3d15;});}else{return _0x2e3d15;}})['catch'](function(_0x2fb6d0){logger[_0x5265('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2fb6d0);throw _0x2fb6d0;});}return _0x2e3d15;})['then'](respondWithResult(_0x616da2,null))['catch'](handleError(_0x616da2,null));}});}catch(_0x104ff3){_0x616da2[_0x5265('0x21')](0x1f4)[_0x5265('0x32')](_0x104ff3);}};function removeReferences(_0x5a38f9,_0x4deba2){try{if(_0x5a38f9){fs[_0x5265('0x98')](_0x5a38f9);logger[_0x5265('0x69')]('Zip\x20archive\x20removed');}if(_0x4deba2){rimraf(_0x4deba2,function(){});logger[_0x5265('0x69')](_0x5265('0x99'));}}catch(_0x20d8dd){logger[_0x5265('0x2f')](_0x20d8dd);}}exports[_0x5265('0x9a')]=function(_0x2d147b,_0x1d0634,_0x56378d){return db[_0x5265('0x35')][_0x5265('0x51')]({'where':{'id':_0x2d147b['params']['id']}})[_0x5265('0x2a')](handleEntityNotFound(_0x1d0634,null))['then'](saveUpdates(_0x2d147b[_0x5265('0x93')],null))['then'](respondWithResult(_0x1d0634,null))['catch'](handleError(_0x1d0634,null));};exports[_0x5265('0x9b')]=function(_0xb8ce93,_0x35c283,_0x198674){return db[_0x5265('0x35')][_0x5265('0x51')]({'where':{'id':_0xb8ce93['params']['id']}})[_0x5265('0x2a')](function(_0x7cdd68){if(_0x7cdd68){return _0x7cdd68[_0x5265('0x2b')]();}})[_0x5265('0x2a')](function(_0x862c95){rimraf(path[_0x5265('0x52')](config[_0x5265('0x5f')],_0x5265('0x53'),path['dirname'](_0x862c95['path'])),function(){});return _0x862c95;})[_0x5265('0x2a')](handleEntityNotFound(_0x35c283,null))[_0x5265('0x2a')](respondWithStatusCode(_0x35c283,null))[_0x5265('0x4b')](handleError(_0x35c283,null));};exports[_0x5265('0x9c')]=function(_0x367350,_0x321f75,_0x32e7f0){return BPromise[_0x5265('0x9d')]()[_0x5265('0x2a')](function(){if(!_0x367350[_0x5265('0x39')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x367350[_0x5265('0x39')]['port']){throw new Error(_0x5265('0x9e'));}var _0x2b36d2=_0x367350[_0x5265('0x39')]['hostname']?_0x367350[_0x5265('0x39')][_0x5265('0x9f')]+':'+_0x367350[_0x5265('0x39')][_0x5265('0xa0')]:_0x5265('0xa1')+_0x367350[_0x5265('0x39')][_0x5265('0xa0')];var _0xfe9946=_0x367350[_0x5265('0x39')][_0x5265('0xa2')]?_0x367350[_0x5265('0x39')]['json']:!![];var _0x202257=_0x367350['query'][_0x5265('0xa3')]?_0x367350['query'][_0x5265('0xa3')]:null;var _0x4cf489={'method':_0x367350[_0x5265('0xa4')],'uri':util['format'](_0x5265('0xa5'),_0x2b36d2,_0x367350[_0x5265('0x39')][_0x5265('0x5')]),'json':_0xfe9946,'resolveWithFullResponse':!![],'encoding':_0x202257,'qs':_0x367350['query']};if(_0x367350[_0x5265('0xa6')]){_0x4cf489[_0x5265('0xa6')]=_0x367350[_0x5265('0xa6')];if(_0x4cf489[_0x5265('0xa6')]['content-length']){delete _0x4cf489[_0x5265('0xa6')][_0x5265('0xa7')];}}if(_0x4cf489[_0x5265('0xa6')][_0x5265('0xa8')]){delete _0x4cf489[_0x5265('0xa6')][_0x5265('0xa8')];}return rp(_0x4cf489);})[_0x5265('0x2a')](function(_0x51675b){if(_0x51675b){_0x321f75['set'](_0x51675b[_0x5265('0xa6')]);logger[_0x5265('0x69')](_0x51675b[_0x5265('0x93')]);if(_[_0x5265('0xa9')](_0x367350[_0x5265('0x39')][_0x5265('0x5')],_0x5265('0x66'))&&_0x51675b[_0x5265('0xaa')]==0x1f4){return _0x321f75[_0x5265('0x1f')](_0x51675b[_0x5265('0xaa')]);}else{return _0x321f75[_0x5265('0x21')](_0x51675b[_0x5265('0xaa')])[_0x5265('0x32')](_0x51675b[_0x5265('0x93')]);}}else{return _0x321f75[_0x5265('0x1f')](0xc8);}})[_0x5265('0x4b')](handleError(_0x321f75,null));};exports[_0x5265('0xab')]=function(_0x306e98,_0x26dd58,_0x3e0a28){return BPromise[_0x5265('0x9d')]()[_0x5265('0x2a')](function(){if(!_0x306e98[_0x5265('0x39')][_0x5265('0x5')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x306e98[_0x5265('0x39')][_0x5265('0xa0')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x379f37=_0x306e98['query']['hostname']?_0x306e98['query'][_0x5265('0x9f')]+':'+_0x306e98['query'][_0x5265('0xa0')]:_0x5265('0xa1')+_0x306e98['query'][_0x5265('0xa0')];var _0x398e78=_0x306e98[_0x5265('0x39')]['json']?_0x306e98[_0x5265('0x39')][_0x5265('0xa2')]:!![];var _0x4869e5=_0x306e98[_0x5265('0x39')][_0x5265('0xa3')]?_0x306e98[_0x5265('0x39')][_0x5265('0xa3')]:null;var _0x1b1d32={'method':_0x306e98['method'],'uri':util[_0x5265('0x54')](_0x5265('0xa5'),_0x379f37,_0x306e98[_0x5265('0x39')][_0x5265('0x5')]),'json':_0x398e78,'resolveWithFullResponse':!![],'encoding':_0x4869e5,'body':_0x306e98[_0x5265('0x93')]};if(_0x306e98['headers']){_0x1b1d32[_0x5265('0xa6')]=_0x306e98['headers'];if(_0x1b1d32['headers'][_0x5265('0xa7')]){delete _0x1b1d32[_0x5265('0xa6')][_0x5265('0xa7')];}}if(_0x1b1d32[_0x5265('0xa6')][_0x5265('0xa8')]){delete _0x1b1d32[_0x5265('0xa6')][_0x5265('0xa8')];}return rp(_0x1b1d32);})[_0x5265('0x2a')](function(_0x5a0884){if(_0x5a0884){_0x26dd58[_0x5265('0x26')](_0x5a0884[_0x5265('0xa6')]);logger[_0x5265('0x69')](_0x5a0884['body']);return _0x26dd58[_0x5265('0x21')](_0x5a0884['statusCode'])[_0x5265('0x32')](_0x5a0884[_0x5265('0x93')]);}else{return _0x26dd58[_0x5265('0x1f')](0xc8);}})['catch'](handleError(_0x26dd58,null));}; \ No newline at end of file +var _0x0470=['limit','Content-Range','save','update','then','destroy','get','Plugins','UserProfileResource','sendStatus','error','stack','send','index','map','rawAttributes','type','key','model','name','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Plugin','includeAll','include','rows','show','params','catch','download','join','root','%s.zip','createWriteStream','zip','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','server/files/plugins','dirname','node_modules/**/*','basename','finalize','close','existsSync','Plugin\x20not\x20found','format','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','Invalid\x20manifest:\x20views\x20missing','views','admin','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','agent','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','find','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','set','endsWith','statusCode','webhookPost','resolve','method','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','extract-zip','archiver','../../config/license/hardware','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','end','status','json','offset','undefined','count'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x0470,0x1d4));var _0x0047=function(_0x5bef8b,_0x297cac){_0x5bef8b=_0x5bef8b-0x0;var _0x1129de=_0x0470[_0x5bef8b];return _0x1129de;};'use strict';var emlformat=require(_0x0047('0x0'));var rimraf=require(_0x0047('0x1'));var zipdir=require(_0x0047('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0047('0x3'));var moment=require(_0x0047('0x4'));var BPromise=require(_0x0047('0x5'));var Mustache=require(_0x0047('0x6'));var util=require('util');var path=require(_0x0047('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0047('0x8'));var fs=require('fs');var fs_extra=require(_0x0047('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0047('0xa'));var jsforce=require(_0x0047('0xb'));var deskjs=require(_0x0047('0xc'));var toCsv=require(_0x0047('0xd'));var querystring=require(_0x0047('0xe'));var Papa=require(_0x0047('0xf'));var extract=require(_0x0047('0x10'));var rimraf=require(_0x0047('0x1'));var archiver=require(_0x0047('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0047('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x0047('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0047('0x14'));var db=require('../../mysqldb')['db'];config[_0x0047('0x15')]=_[_0x0047('0x16')](config['redis'],{'host':_0x0047('0x17'),'port':0x18eb});var socket=require(_0x0047('0x18'))(new Redis(config['redis']));require(_0x0047('0x19'))[_0x0047('0x1a')](socket);function respondWithStatusCode(_0x20e765,_0x225a93){_0x225a93=_0x225a93||0xcc;return function(_0x2d0865){if(_0x2d0865){return _0x20e765['sendStatus'](_0x225a93);}return _0x20e765['status'](_0x225a93)[_0x0047('0x1b')]();};}function respondWithResult(_0x3860b8,_0x42d81e){_0x42d81e=_0x42d81e||0xc8;return function(_0x24782f){if(_0x24782f){return _0x3860b8[_0x0047('0x1c')](_0x42d81e)[_0x0047('0x1d')](_0x24782f);}};}function respondWithFilteredResult(_0x2c45e7,_0xf37e2a){return function(_0x404a5d){if(_0x404a5d){var _0x1da44f=typeof _0xf37e2a[_0x0047('0x1e')]==='undefined'&&typeof _0xf37e2a['limit']===_0x0047('0x1f');var _0x40901e=_0x404a5d['count'];var _0x219080=_0x1da44f?0x0:_0xf37e2a['offset'];var _0x24a9d6=_0x1da44f?_0x404a5d[_0x0047('0x20')]:_0xf37e2a[_0x0047('0x1e')]+_0xf37e2a[_0x0047('0x21')];var _0x3fdd8e;if(_0x24a9d6>=_0x40901e){_0x24a9d6=_0x40901e;_0x3fdd8e=0xc8;}else{_0x3fdd8e=0xce;}_0x2c45e7['status'](_0x3fdd8e);return _0x2c45e7['set'](_0x0047('0x22'),_0x219080+'-'+_0x24a9d6+'/'+_0x40901e)['json'](_0x404a5d);}return null;};}function patchUpdates(_0x2e78b0){return function(_0x3634bd){try{jsonpatch['apply'](_0x3634bd,_0x2e78b0,!![]);}catch(_0x2bf6b4){return BPromise['reject'](_0x2bf6b4);}return _0x3634bd[_0x0047('0x23')]();};}function saveUpdates(_0x41d096,_0x18a437){return function(_0x3c6a2f){if(_0x3c6a2f){return _0x3c6a2f[_0x0047('0x24')](_0x41d096)[_0x0047('0x25')](function(_0x38ce0a){return _0x38ce0a;});}return null;};}function removeEntity(_0x2b684d,_0x1adfba){return function(_0x5f53ab){if(_0x5f53ab){return _0x5f53ab[_0x0047('0x26')]()[_0x0047('0x25')](function(){var _0x29ed82=_0x5f53ab[_0x0047('0x27')]({'plain':!![]});var _0xd1e00f=_0x0047('0x28');return db[_0x0047('0x29')][_0x0047('0x26')]({'where':{'type':_0xd1e00f,'resourceId':_0x29ed82['id']}})[_0x0047('0x25')](function(){return _0x5f53ab;});})[_0x0047('0x25')](function(){_0x2b684d['status'](0xcc)[_0x0047('0x1b')]();});}};}function handleEntityNotFound(_0x3edeb8,_0x2ac11b){return function(_0x4cde80){if(!_0x4cde80){_0x3edeb8[_0x0047('0x2a')](0x194);}return _0x4cde80;};}function handleError(_0x3aeaea,_0x20a735){_0x20a735=_0x20a735||0x1f4;return function(_0x8b89a1){logger[_0x0047('0x2b')](_0x8b89a1[_0x0047('0x2c')]);if(_0x8b89a1['name']){delete _0x8b89a1['name'];}_0x3aeaea[_0x0047('0x1c')](_0x20a735)[_0x0047('0x2d')](_0x8b89a1);};}exports[_0x0047('0x2e')]=function(_0x1fb958,_0xf5032c){var _0x3fb061={},_0xe8dc7f={},_0x5a359d={'count':0x0,'rows':[]};var _0x2484fe=_[_0x0047('0x2f')](db['Plugin'][_0x0047('0x30')],function(_0x5ae008){return{'name':_0x5ae008['fieldName'],'type':_0x5ae008[_0x0047('0x31')][_0x0047('0x32')]};});_0xe8dc7f[_0x0047('0x33')]=_[_0x0047('0x2f')](_0x2484fe,_0x0047('0x34'));_0xe8dc7f['query']=_[_0x0047('0x35')](_0x1fb958['query']);_0xe8dc7f[_0x0047('0x36')]=_[_0x0047('0x37')](_0xe8dc7f[_0x0047('0x33')],_0xe8dc7f[_0x0047('0x38')]);_0x3fb061[_0x0047('0x39')]=_[_0x0047('0x37')](_0xe8dc7f[_0x0047('0x33')],qs[_0x0047('0x3a')](_0x1fb958['query'][_0x0047('0x3a')]));_0x3fb061[_0x0047('0x39')]=_0x3fb061[_0x0047('0x39')][_0x0047('0x3b')]?_0x3fb061['attributes']:_0xe8dc7f[_0x0047('0x33')];if(!_0x1fb958[_0x0047('0x38')][_0x0047('0x3c')](_0x0047('0x3d'))){_0x3fb061['limit']=qs[_0x0047('0x21')](_0x1fb958[_0x0047('0x38')][_0x0047('0x21')]);_0x3fb061[_0x0047('0x1e')]=qs[_0x0047('0x1e')](_0x1fb958[_0x0047('0x38')][_0x0047('0x1e')]);}_0x3fb061[_0x0047('0x3e')]=qs[_0x0047('0x3f')](_0x1fb958[_0x0047('0x38')]['sort']);_0x3fb061[_0x0047('0x40')]=qs[_0x0047('0x36')](_[_0x0047('0x41')](_0x1fb958[_0x0047('0x38')],_0xe8dc7f[_0x0047('0x36')]),_0x2484fe);if(_0x1fb958[_0x0047('0x38')][_0x0047('0x42')]){_0x3fb061['where']=_[_0x0047('0x43')](_0x3fb061[_0x0047('0x40')],{'$or':_[_0x0047('0x2f')](_0x2484fe,function(_0xb9e8f9){if(_0xb9e8f9[_0x0047('0x31')]!==_0x0047('0x44')){var _0x2f3651={};_0x2f3651[_0xb9e8f9[_0x0047('0x34')]]={'$like':'%'+_0x1fb958[_0x0047('0x38')]['filter']+'%'};return _0x2f3651;}})});}_0x3fb061=_['merge']({},_0x3fb061,_0x1fb958[_0x0047('0x45')]);var _0x4d5832={'where':_0x3fb061[_0x0047('0x40')]};return db[_0x0047('0x46')][_0x0047('0x20')](_0x4d5832)[_0x0047('0x25')](function(_0x180ef4){_0x5a359d[_0x0047('0x20')]=_0x180ef4;if(_0x1fb958['query'][_0x0047('0x47')]){_0x3fb061[_0x0047('0x48')]=[{'all':!![]}];}return db[_0x0047('0x46')]['findAll'](_0x3fb061);})[_0x0047('0x25')](function(_0x32f88e){_0x5a359d[_0x0047('0x49')]=_0x32f88e;return _0x5a359d;})[_0x0047('0x25')](respondWithFilteredResult(_0xf5032c,_0x3fb061))['catch'](handleError(_0xf5032c,null));};exports[_0x0047('0x4a')]=function(_0x590d4a,_0x27ff0d){var _0x422ce2={'raw':!![],'where':{'id':_0x590d4a[_0x0047('0x4b')]['id']}},_0x4784cf={};_0x4784cf[_0x0047('0x33')]=_[_0x0047('0x35')](db[_0x0047('0x46')][_0x0047('0x30')]);_0x4784cf[_0x0047('0x38')]=_[_0x0047('0x35')](_0x590d4a[_0x0047('0x38')]);_0x4784cf[_0x0047('0x36')]=_['intersection'](_0x4784cf['model'],_0x4784cf['query']);_0x422ce2[_0x0047('0x39')]=_[_0x0047('0x37')](_0x4784cf[_0x0047('0x33')],qs['fields'](_0x590d4a[_0x0047('0x38')]['fields']));_0x422ce2[_0x0047('0x39')]=_0x422ce2[_0x0047('0x39')][_0x0047('0x3b')]?_0x422ce2[_0x0047('0x39')]:_0x4784cf[_0x0047('0x33')];if(_0x590d4a[_0x0047('0x38')][_0x0047('0x47')]){_0x422ce2[_0x0047('0x48')]=[{'all':!![]}];}_0x422ce2=_[_0x0047('0x43')]({},_0x422ce2,_0x590d4a[_0x0047('0x45')]);return db[_0x0047('0x46')]['find'](_0x422ce2)[_0x0047('0x25')](handleEntityNotFound(_0x27ff0d,null))[_0x0047('0x25')](respondWithResult(_0x27ff0d,null))[_0x0047('0x4c')](handleError(_0x27ff0d,null));};exports[_0x0047('0x4d')]=function(_0x44deb2,_0xdc96e0,_0x3c1586){return db[_0x0047('0x46')]['find']({'where':{'id':_0x44deb2['params']['id']},'attributes':[_0x0047('0x34'),_0x0047('0x7')],'raw':!![]})[_0x0047('0x25')](handleEntityNotFound(_0xdc96e0,null))[_0x0047('0x25')](function(_0x3e9a4e){if(_0x3e9a4e){var _0x228c5a=path[_0x0047('0x4e')](config[_0x0047('0x4f')],'server/files/plugins',util['format'](_0x0047('0x50'),path['basename'](_0x3e9a4e[_0x0047('0x7')])));var _0x5b4276=fs[_0x0047('0x51')](_0x228c5a);var _0x5cca0a=archiver(_0x0047('0x52'),{'zlib':{'level':0x9}});_0x5cca0a['on']('warning',function(_0x3b9472){if(_0x3b9472[_0x0047('0x53')]===_0x0047('0x54')){logger[_0x0047('0x2b')](_0x3b9472);}else{throw new db[(_0x0047('0x55'))][(_0x0047('0x56'))](_0x0047('0x57'));}});_0x5cca0a['on'](_0x0047('0x2b'),function(_0x14e69f){throw new db[(_0x0047('0x55'))][(_0x0047('0x56'))](_0x0047('0x57'));});_0x5cca0a[_0x0047('0x58')](_0x5b4276);_0x5cca0a[_0x0047('0x59')](_0x0047('0x5a'),{'cwd':path[_0x0047('0x4e')](config['root'],_0x0047('0x5b'),path[_0x0047('0x5c')](_0x3e9a4e['path'])),'ignore':[path[_0x0047('0x4e')](path['basename'](_0x3e9a4e[_0x0047('0x7')]),_0x0047('0x5d')),path[_0x0047('0x4e')](path[_0x0047('0x5e')](_0x3e9a4e[_0x0047('0x7')]),'attachments/**/*')],'nodir':!![]})[_0x0047('0x5f')]();_0x5b4276['on'](_0x0047('0x60'),function(){if(!fs[_0x0047('0x61')](_0x228c5a)){throw new db[(_0x0047('0x55'))][(_0x0047('0x56'))](_0x0047('0x62'));}return _0xdc96e0['download'](_0x228c5a,util[_0x0047('0x63')](_0x0047('0x50'),path[_0x0047('0x5e')](_0x3e9a4e[_0x0047('0x7')])),function(_0x239463){if(_0x239463){throw new db[(_0x0047('0x55'))][(_0x0047('0x56'))](_0x0047('0x64'));}fs[_0x0047('0x65')](_0x228c5a);logger[_0x0047('0x66')]('Download\x20completed');logger[_0x0047('0x66')]('Temporary\x20file\x20removed');});});}return null;})[_0x0047('0x4c')](handleError(_0xdc96e0,null));};exports['upload']=function(_0x1daa63,_0x55a510,_0x1eb248){var _0x2bb758=path[_0x0047('0x5e')](_0x1daa63[_0x0047('0x67')][_0x0047('0x68')],path[_0x0047('0x69')](_0x1daa63[_0x0047('0x67')][_0x0047('0x68')]));var _0x2dacc3=path[_0x0047('0x4e')](config[_0x0047('0x4f')],_0x0047('0x5b'),_0x1daa63[_0x0047('0x67')]['filename']);var _0x418940=path['join'](config[_0x0047('0x4f')],'server/files/plugins',_0x2bb758);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x2dacc3);logger[_0x0047('0x66')](_0x0047('0x6a'),_0x418940);try{fs[_0x0047('0x6b')](_0x2dacc3,parseInt(_0x0047('0x6c'),0x8));extract(_0x2dacc3,{'dir':_0x418940},function(_0x1aad17){if(_0x1aad17){logger[_0x0047('0x2b')](_0x1aad17);handleError(_0x1aad17,!![]);};var _0x4d210f=fs[_0x0047('0x6d')](_0x418940);if(_0x4d210f[_0x0047('0x3b')]>0x1){removeReferences(_0x2dacc3,_0x418940);logger[_0x0047('0x2b')]('Invalid\x20plugin\x20structure');return _0x1eb248(new Error(_0x0047('0x6e')));}var _0x1cdb48=fs[_0x0047('0x6f')](path[_0x0047('0x4e')](_0x418940,_0x4d210f[0x0]));if(_0x1cdb48[_0x0047('0x70')]()){removeReferences(_0x2dacc3,_0x418940);logger['error'](_0x0047('0x6e'));return _0x1eb248(new Error(_0x0047('0x6e')));}if(_0x1cdb48[_0x0047('0x71')]()){var _0x5ccd86=fs[_0x0047('0x6d')](path['join'](_0x418940,_0x4d210f[0x0]));if(_0x5ccd86[_0x0047('0x3b')]===0x0){removeReferences(_0x2dacc3,_0x418940);logger['error']('Invalid\x20plugin\x20structure');return _0x1eb248(new Error(_0x0047('0x6e')));}var _0x7f01e=_0x5ccd86[_0x0047('0x72')](function(_0x1b9a33){return _0x1b9a33==='manifest.json';});if(!_0x7f01e){return _0x1eb248(new Error('Plugin\x20manifest\x20missing'));}var _0x431358=fs[_0x0047('0x73')](path['join'](_0x418940,_0x4d210f[0x0],'manifest.json'));var _0x410136=JSON['parse'](_0x431358);if(_0x0047('0x1f')==typeof _0x410136[_0x0047('0x34')]){return _0x1eb248(new Error(_0x0047('0x74')));}if('undefined'==typeof _0x410136['type']){return _0x1eb248(new Error(_0x0047('0x75')));}if(_0x0047('0x1f')==typeof _0x410136[_0x0047('0x76')]){return _0x1eb248(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x0047('0x1f')==typeof _0x410136['parameters']){return _0x1eb248(new Error(_0x0047('0x77')));}if(_0x410136['type']===_0x0047('0x78')){if(_0x0047('0x1f')==typeof _0x410136[_0x0047('0x79')]['views']){return _0x1eb248(new Error(_0x0047('0x7a')));}if(_0x0047('0x1f')==typeof _0x410136['parameters'][_0x0047('0x7b')][_0x0047('0x7c')]&&_0x0047('0x1f')==typeof _0x410136[_0x0047('0x79')][_0x0047('0x7b')]['agent']){return _0x1eb248(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x410136['type']===_0x0047('0x7d')){if(_0x0047('0x1f')==typeof _0x410136[_0x0047('0x79')][_0x0047('0x7e')]){return _0x1eb248(new Error(_0x0047('0x7f')));}if('undefined'==typeof _0x410136['parameters'][_0x0047('0x80')]){return _0x1eb248(new Error(_0x0047('0x81')));}}else{return _0x1eb248(new Error(_0x0047('0x82')));}var _0x424565=_0x410136[_0x0047('0x34')];var _0x2f3fa6=_0x410136[_0x0047('0x83')];var _0xdbb860=_0x410136[_0x0047('0x31')];var _0x1dc006=_0x410136[_0x0047('0x84')]?_0x410136[_0x0047('0x84')]:_0x0047('0x85');var _0x1a624a=_0x410136[_0x0047('0x86')]?_0x410136['icon']:'icon-apps';var _0x2c8058='';var _0x454ec8='';var _0x41fbff='';var _0x5a6bc6='';var _0x5659ce=_0x410136['version'];if(_0xdbb860===_0x0047('0x78')){if(_0x0047('0x1f')!=typeof _0x410136[_0x0047('0x79')][_0x0047('0x7b')][_0x0047('0x7c')]){var _0x5f0f8d=_0x410136[_0x0047('0x79')][_0x0047('0x7b')][_0x0047('0x7c')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5f0f8d)){_0x2c8058=path[_0x0047('0x4e')]('plugins',_0x2bb758,_0x4d210f[0x0],_0x5f0f8d);}else{_0x2c8058=_0x5f0f8d;}}else{logger[_0x0047('0x66')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x0047('0x1f')!=typeof _0x410136['parameters'][_0x0047('0x7b')][_0x0047('0x87')]){var _0x31df4b=_0x410136['parameters'][_0x0047('0x7b')][_0x0047('0x87')];if(!/^(f|ht)tps?:\/\//i[_0x0047('0x88')](_0x31df4b)){_0x454ec8=path[_0x0047('0x4e')](_0x0047('0x89'),_0x2bb758,_0x4d210f[0x0],_0x31df4b);}else{_0x454ec8=_0x31df4b;}}else{logger[_0x0047('0x66')](_0x0047('0x8a'));}}else if(_0xdbb860===_0x0047('0x7d')){_0x41fbff=_0x410136['parameters'][_0x0047('0x7e')];_0x5a6bc6=_0x410136[_0x0047('0x79')][_0x0047('0x80')];if(_0x0047('0x1f')!=typeof _0x410136['parameters'][_0x0047('0x7b')]){if(_0x0047('0x1f')!=typeof _0x410136[_0x0047('0x79')][_0x0047('0x7b')][_0x0047('0x7c')]){var _0x5f0f8d=_0x410136['parameters'][_0x0047('0x7b')][_0x0047('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x0047('0x88')](_0x5f0f8d)){_0x2c8058=path[_0x0047('0x4e')](_0x0047('0x89'),_0x2bb758,_0x4d210f[0x0],_0x5f0f8d);}else{_0x2c8058=_0x5f0f8d;}}if(_0x0047('0x1f')!=typeof _0x410136[_0x0047('0x79')][_0x0047('0x7b')][_0x0047('0x87')]){var _0x31df4b=_0x410136[_0x0047('0x79')][_0x0047('0x7b')][_0x0047('0x87')];if(!/^(f|ht)tps?:\/\//i[_0x0047('0x88')](_0x31df4b)){_0x454ec8=path[_0x0047('0x4e')](_0x0047('0x89'),_0x2bb758,_0x4d210f[0x0],_0x31df4b);}else{_0x454ec8=_0x31df4b;}}}}var _0x8d4889={'name':_0x424565,'description':_0x2f3fa6,'path':path[_0x0047('0x4e')](_0x2bb758,_0x4d210f[0x0]),'type':_0xdbb860,'sidebar':_0x1dc006,'icon':_0x1a624a,'adminUrl':_0x2c8058,'agentUrl':_0x454ec8,'scriptName':_0x41fbff,'scriptPath':_0x5a6bc6,'version':_0x5659ce};removeReferences(_0x2dacc3,null);return db[_0x0047('0x46')][_0x0047('0x8b')](_0x8d4889)[_0x0047('0x25')](function(_0x2055ac){var _0x13d8cc={'role':_0x1daa63[_0x0047('0x8c')][_0x0047('0x8d')],'userProfileId':_0x1daa63['body'][_0x0047('0x8e')]};if(!_0x13d8cc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13d8cc['role']===_0x0047('0x8f')){var _0x48c879=_0x2055ac[_0x0047('0x27')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x0047('0x28'),'userProfileId':_0x13d8cc[_0x0047('0x8e')]},'raw':!![]})[_0x0047('0x25')](function(_0x1b54b0){if(_0x1b54b0&&_0x1b54b0[_0x0047('0x90')]===0x0){return db[_0x0047('0x29')][_0x0047('0x8b')]({'name':_0x48c879[_0x0047('0x34')],'resourceId':_0x48c879['id'],'type':_0x1b54b0[_0x0047('0x34')],'sectionId':_0x1b54b0['id']},{})['then'](function(){return _0x2055ac;});}else{return _0x2055ac;}})[_0x0047('0x4c')](function(_0xbaae67){logger[_0x0047('0x2b')](_0x0047('0x91'),_0xbaae67);throw _0xbaae67;});}return _0x2055ac;})['then'](respondWithResult(_0x55a510,null))[_0x0047('0x4c')](handleError(_0x55a510,null));}});}catch(_0x18de50){_0x55a510[_0x0047('0x1c')](0x1f4)[_0x0047('0x2d')](_0x18de50);}};function removeReferences(_0x4d8ed1,_0x2e6bd3){try{if(_0x4d8ed1){fs[_0x0047('0x65')](_0x4d8ed1);logger['info'](_0x0047('0x92'));}if(_0x2e6bd3){rimraf(_0x2e6bd3,function(){});logger[_0x0047('0x66')](_0x0047('0x93'));}}catch(_0xda5680){logger[_0x0047('0x2b')](_0xda5680);}}exports['update']=function(_0x320817,_0x467fb0,_0x412dee){return db[_0x0047('0x46')][_0x0047('0x94')]({'where':{'id':_0x320817[_0x0047('0x4b')]['id']}})[_0x0047('0x25')](handleEntityNotFound(_0x467fb0,null))['then'](saveUpdates(_0x320817[_0x0047('0x8c')],null))[_0x0047('0x25')](respondWithResult(_0x467fb0,null))[_0x0047('0x4c')](handleError(_0x467fb0,null));};exports[_0x0047('0x95')]=function(_0x3f865d,_0x166fd6,_0x163cfe){return db['Plugin'][_0x0047('0x94')]({'where':{'id':_0x3f865d[_0x0047('0x4b')]['id']}})[_0x0047('0x25')](function(_0x4b57a6){if(_0x4b57a6){return _0x4b57a6[_0x0047('0x26')]();}})[_0x0047('0x25')](function(_0x179fc2){rimraf(path[_0x0047('0x4e')](config['root'],_0x0047('0x5b'),path[_0x0047('0x5c')](_0x179fc2[_0x0047('0x7')])),function(){});return _0x179fc2;})[_0x0047('0x25')](handleEntityNotFound(_0x166fd6,null))['then'](respondWithStatusCode(_0x166fd6,null))['catch'](handleError(_0x166fd6,null));};exports[_0x0047('0x96')]=function(_0x4d969b,_0x332b56,_0x171b13){return BPromise['resolve']()['then'](function(){if(!_0x4d969b[_0x0047('0x38')][_0x0047('0x7')]){throw new Error(_0x0047('0x97'));}if(!_0x4d969b['query'][_0x0047('0x98')]){throw new Error(_0x0047('0x99'));}var _0x149088=_0x4d969b[_0x0047('0x38')]['hostname']?_0x4d969b[_0x0047('0x38')][_0x0047('0x9a')]+':'+_0x4d969b[_0x0047('0x38')][_0x0047('0x98')]:_0x0047('0x9b')+_0x4d969b['query'][_0x0047('0x98')];var _0xae48e1=_0x4d969b['query'][_0x0047('0x1d')]?_0x4d969b['query']['json']:!![];var _0x7b52df=_0x4d969b[_0x0047('0x38')][_0x0047('0x9c')]?_0x4d969b[_0x0047('0x38')]['encoding']:null;var _0x435a50={'method':_0x4d969b['method'],'uri':util[_0x0047('0x63')](_0x0047('0x9d'),_0x149088,_0x4d969b[_0x0047('0x38')][_0x0047('0x7')]),'json':_0xae48e1,'resolveWithFullResponse':!![],'encoding':_0x7b52df,'qs':_0x4d969b[_0x0047('0x38')]};if(_0x4d969b[_0x0047('0x9e')]){_0x435a50[_0x0047('0x9e')]=_0x4d969b[_0x0047('0x9e')];if(_0x435a50[_0x0047('0x9e')][_0x0047('0x9f')]){delete _0x435a50[_0x0047('0x9e')][_0x0047('0x9f')];}}if(_0x435a50['headers'][_0x0047('0xa0')]){delete _0x435a50[_0x0047('0x9e')]['content-type'];}return rp(_0x435a50);})[_0x0047('0x25')](function(_0x359d05){if(_0x359d05){_0x332b56[_0x0047('0xa1')](_0x359d05['headers']);logger[_0x0047('0x66')](_0x359d05[_0x0047('0x8c')]);if(_[_0x0047('0xa2')](_0x4d969b[_0x0047('0x38')][_0x0047('0x7')],'download')&&_0x359d05[_0x0047('0xa3')]==0x1f4){return _0x332b56[_0x0047('0x2a')](_0x359d05[_0x0047('0xa3')]);}else{return _0x332b56[_0x0047('0x1c')](_0x359d05[_0x0047('0xa3')])[_0x0047('0x2d')](_0x359d05[_0x0047('0x8c')]);}}else{return _0x332b56['sendStatus'](0xc8);}})['catch'](handleError(_0x332b56,null));};exports[_0x0047('0xa4')]=function(_0x2e5368,_0x3f6825,_0x1521dc){return BPromise[_0x0047('0xa5')]()[_0x0047('0x25')](function(){if(!_0x2e5368[_0x0047('0x38')]['path']){throw new Error(_0x0047('0x97'));}if(!_0x2e5368[_0x0047('0x38')][_0x0047('0x98')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x4afd03=_0x2e5368[_0x0047('0x38')][_0x0047('0x9a')]?_0x2e5368['query'][_0x0047('0x9a')]+':'+_0x2e5368[_0x0047('0x38')][_0x0047('0x98')]:_0x0047('0x9b')+_0x2e5368[_0x0047('0x38')][_0x0047('0x98')];var _0x58a8ba=_0x2e5368[_0x0047('0x38')]['json']?_0x2e5368[_0x0047('0x38')][_0x0047('0x1d')]:!![];var _0x3ae7ea=_0x2e5368[_0x0047('0x38')][_0x0047('0x9c')]?_0x2e5368['query']['encoding']:null;var _0x2c2e54={'method':_0x2e5368[_0x0047('0xa6')],'uri':util['format'](_0x0047('0x9d'),_0x4afd03,_0x2e5368[_0x0047('0x38')][_0x0047('0x7')]),'json':_0x58a8ba,'resolveWithFullResponse':!![],'encoding':_0x3ae7ea,'body':_0x2e5368[_0x0047('0x8c')]};if(_0x2e5368[_0x0047('0x9e')]){_0x2c2e54[_0x0047('0x9e')]=_0x2e5368[_0x0047('0x9e')];if(_0x2c2e54['headers'][_0x0047('0x9f')]){delete _0x2c2e54[_0x0047('0x9e')][_0x0047('0x9f')];}}if(_0x2c2e54['headers']['content-type']){delete _0x2c2e54[_0x0047('0x9e')][_0x0047('0xa0')];}return rp(_0x2c2e54);})[_0x0047('0x25')](function(_0x420c1b){if(_0x420c1b){_0x3f6825[_0x0047('0xa1')](_0x420c1b[_0x0047('0x9e')]);logger['info'](_0x420c1b[_0x0047('0x8c')]);return _0x3f6825[_0x0047('0x1c')](_0x420c1b[_0x0047('0xa3')])[_0x0047('0x2d')](_0x420c1b[_0x0047('0x8c')]);}else{return _0x3f6825[_0x0047('0x2a')](0xc8);}})['catch'](handleError(_0x3f6825,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 1921514..3727d04 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 _0xf3fe=['save','update','emit','hook','exports','../../mysqldb','Plugin','setMaxListeners'];(function(_0x4178a4,_0x3d1b58){var _0x158e50=function(_0x49eff4){while(--_0x49eff4){_0x4178a4['push'](_0x4178a4['shift']());}};_0x158e50(++_0x3d1b58);}(_0xf3fe,0x1cd));var _0xef3f=function(_0x12f4d8,_0x1f6d82){_0x12f4d8=_0x12f4d8-0x0;var _0x265413=_0xf3fe[_0x12f4d8];return _0x265413;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xef3f('0x0'))['db'][_0xef3f('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xef3f('0x2')](0x0);var events={'afterCreate':_0xef3f('0x3'),'afterUpdate':_0xef3f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x29b501){return function(_0x18a97c,_0x171ff9,_0x431bc5){PluginEvents[_0xef3f('0x5')](_0x29b501+':'+_0x18a97c['id'],_0x18a97c);PluginEvents['emit'](_0x29b501,_0x18a97c);_0x431bc5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0xef3f('0x6')](e,emitEvent(event));}}module[_0xef3f('0x7')]=PluginEvents; \ No newline at end of file +var _0xa786=['save','update','remove','emit','hasOwnProperty','hook','exports','Plugin','setMaxListeners'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xa786,0x1d2));var _0x6a78=function(_0x20adfa,_0x258941){_0x20adfa=_0x20adfa-0x0;var _0x54f04e=_0xa786[_0x20adfa];return _0x54f04e;};'use strict';var EventEmitter=require('events');var Plugin=require('../../mysqldb')['db'][_0x6a78('0x0')];var PluginEvents=new EventEmitter();PluginEvents[_0x6a78('0x1')](0x0);var events={'afterCreate':_0x6a78('0x2'),'afterUpdate':_0x6a78('0x3'),'afterDestroy':_0x6a78('0x4')};function emitEvent(_0x1ca897){return function(_0x34b520,_0x521b4a,_0x14cd87){PluginEvents[_0x6a78('0x5')](_0x1ca897+':'+_0x34b520['id'],_0x34b520);PluginEvents[_0x6a78('0x5')](_0x1ca897,_0x34b520);_0x14cd87(null);};}for(var e in events){if(events[_0x6a78('0x6')](e)){var event=events[e];Plugin[_0x6a78('0x7')](e,emitEvent(event));}}module[_0x6a78('0x8')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 74a97b8..82145f9 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 _0xb63c=['../../config/environment','./plugin.attributes','exports','define','Plugin','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xb63c,0x170));var _0xcb63=function(_0x30df82,_0x4c2176){_0x30df82=_0x30df82-0x0;var _0x3779e8=_0xb63c[_0x30df82];return _0x3779e8;};'use strict';var _=require('lodash');var util=require(_0xcb63('0x0'));var logger=require(_0xcb63('0x1'))(_0xcb63('0x2'));var moment=require(_0xcb63('0x3'));var BPromise=require(_0xcb63('0x4'));var rp=require(_0xcb63('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcb63('0x6'));var attributes=require(_0xcb63('0x7'));module[_0xcb63('0x8')]=function(_0x2af805,_0x13e24c){return _0x2af805[_0xcb63('0x9')](_0xcb63('0xa'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d8d=['rimraf','exports','define','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1fdaf8,_0xe0c77f){var _0x5d49d7=function(_0x2b6063){while(--_0x2b6063){_0x1fdaf8['push'](_0x1fdaf8['shift']());}};_0x5d49d7(++_0xe0c77f);}(_0x5d8d,0x1a9));var _0xd5d8=function(_0x446f18,_0x47cf94){_0x446f18=_0x446f18-0x0;var _0xfe8927=_0x5d8d[_0x446f18];return _0xfe8927;};'use strict';var _=require(_0xd5d8('0x0'));var util=require(_0xd5d8('0x1'));var logger=require(_0xd5d8('0x2'))(_0xd5d8('0x3'));var moment=require(_0xd5d8('0x4'));var BPromise=require(_0xd5d8('0x5'));var rp=require(_0xd5d8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd5d8('0x7'));var config=require('../../config/environment');var attributes=require('./plugin.attributes');module[_0xd5d8('0x8')]=function(_0x484435,_0x1e619f){return _0x484435[_0xd5d8('0x9')](_0xd5d8('0xa'),attributes,{'tableName':_0xd5d8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index f21777f..b431520 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 _0x3dde=['error','message','Plugin,\x20%s,\x20%s','result','catch','CreatePlugin','Plugin','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x3dde,0x14b));var _0xe3dd=function(_0x2be9e6,_0x46d6ef){_0x2be9e6=_0x2be9e6-0x0;var _0x1dfbda=_0x3dde[_0x2be9e6];return _0x1dfbda;};'use strict';var _=require('lodash');var util=require(_0xe3dd('0x0'));var moment=require(_0xe3dd('0x1'));var BPromise=require(_0xe3dd('0x2'));var rs=require(_0xe3dd('0x3'));var fs=require('fs');var Redis=require(_0xe3dd('0x4'));var db=require(_0xe3dd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe3dd('0x6'))(_0xe3dd('0x7'));var config=require(_0xe3dd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe3dd('0x9')][_0xe3dd('0xa')]({'port':0x232a});config[_0xe3dd('0xb')]=_[_0xe3dd('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe3dd('0xd'))(new Redis(config[_0xe3dd('0xb')]));require('./plugin.socket')[_0xe3dd('0xe')](socket);function respondWithRpcPromise(_0x35a0f1,_0x7a05fe,_0x3d1e87){return new BPromise(function(_0x45116c,_0x12b31a){return client['request'](_0x35a0f1,_0x3d1e87)[_0xe3dd('0xf')](function(_0x2c31ff){logger[_0xe3dd('0x10')]('Plugin,\x20%s,\x20%s',_0x7a05fe,_0xe3dd('0x11'));logger[_0xe3dd('0x12')](_0xe3dd('0x13'),_0x7a05fe,_0xe3dd('0x11'),JSON[_0xe3dd('0x14')](_0x2c31ff));if(_0x2c31ff['error']){if(_0x2c31ff[_0xe3dd('0x15')]['code']===0x1f4){logger[_0xe3dd('0x15')]('Plugin,\x20%s,\x20%s',_0x7a05fe,_0x2c31ff[_0xe3dd('0x15')]['message']);return _0x12b31a(_0x2c31ff[_0xe3dd('0x15')][_0xe3dd('0x16')]);}logger[_0xe3dd('0x15')]('Plugin,\x20%s,\x20%s',_0x7a05fe,_0x2c31ff[_0xe3dd('0x15')][_0xe3dd('0x16')]);return _0x45116c(_0x2c31ff['error'][_0xe3dd('0x16')]);}else{logger['info'](_0xe3dd('0x17'),_0x7a05fe,_0xe3dd('0x11'));_0x45116c(_0x2c31ff[_0xe3dd('0x18')]['message']);}})[_0xe3dd('0x19')](function(_0x3be279){logger[_0xe3dd('0x15')]('Plugin,\x20%s,\x20%s',_0x7a05fe,_0x3be279);_0x12b31a(_0x3be279);});});}exports[_0xe3dd('0x1a')]=function(_0x48afcc){var _0x9cc75c=this;return new Promise(function(_0x403e32,_0x2c965d){return db[_0xe3dd('0x1b')][_0xe3dd('0x1c')](_0x48afcc[_0xe3dd('0x1d')],{'raw':_0x48afcc['options']?_0x48afcc[_0xe3dd('0x1e')][_0xe3dd('0x1f')]===undefined?!![]:![]:!![]})[_0xe3dd('0xf')](function(_0x10add3){logger[_0xe3dd('0x10')](_0xe3dd('0x1a'),_0x48afcc);logger[_0xe3dd('0x12')](_0xe3dd('0x1a'),_0x48afcc,JSON[_0xe3dd('0x14')](_0x10add3));_0x403e32(_0x10add3);})[_0xe3dd('0x19')](function(_0x30e9e0){logger['error'](_0xe3dd('0x1a'),_0x30e9e0[_0xe3dd('0x16')],_0x48afcc);_0x2c965d(_0x9cc75c['error'](0x1f4,_0x30e9e0[_0xe3dd('0x16')]));});});}; \ No newline at end of file +var _0x2e35=['debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreatePlugin','Plugin','create','body','options','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent'];(function(_0x4c9316,_0x5c7f6f){var _0x146aad=function(_0x4fa179){while(--_0x4fa179){_0x4c9316['push'](_0x4c9316['shift']());}};_0x146aad(++_0x5c7f6f);}(_0x2e35,0xd9));var _0x52e3=function(_0x5198a3,_0x440517){_0x5198a3=_0x5198a3-0x0;var _0x564c09=_0x2e35[_0x5198a3];return _0x564c09;};'use strict';var _=require('lodash');var util=require(_0x52e3('0x0'));var moment=require(_0x52e3('0x1'));var BPromise=require(_0x52e3('0x2'));var rs=require(_0x52e3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x52e3('0x4'))['db'];var utils=require(_0x52e3('0x5'));var logger=require('../../config/logger')(_0x52e3('0x6'));var config=require(_0x52e3('0x7'));var jayson=require(_0x52e3('0x8'));var client=jayson[_0x52e3('0x9')][_0x52e3('0xa')]({'port':0x232a});config[_0x52e3('0xb')]=_[_0x52e3('0xc')](config[_0x52e3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x52e3('0xd'))(new Redis(config[_0x52e3('0xb')]));require(_0x52e3('0xe'))[_0x52e3('0xf')](socket);function respondWithRpcPromise(_0x2d1c09,_0x36edee,_0x552393){return new BPromise(function(_0xd947be,_0x5ac540){return client[_0x52e3('0x10')](_0x2d1c09,_0x552393)[_0x52e3('0x11')](function(_0x395312){logger[_0x52e3('0x12')](_0x52e3('0x13'),_0x36edee,_0x52e3('0x14'));logger[_0x52e3('0x15')](_0x52e3('0x16'),_0x36edee,_0x52e3('0x14'),JSON[_0x52e3('0x17')](_0x395312));if(_0x395312['error']){if(_0x395312[_0x52e3('0x18')][_0x52e3('0x19')]===0x1f4){logger[_0x52e3('0x18')]('Plugin,\x20%s,\x20%s',_0x36edee,_0x395312[_0x52e3('0x18')][_0x52e3('0x1a')]);return _0x5ac540(_0x395312[_0x52e3('0x18')][_0x52e3('0x1a')]);}logger[_0x52e3('0x18')](_0x52e3('0x13'),_0x36edee,_0x395312[_0x52e3('0x18')][_0x52e3('0x1a')]);return _0xd947be(_0x395312[_0x52e3('0x18')][_0x52e3('0x1a')]);}else{logger['info'](_0x52e3('0x13'),_0x36edee,_0x52e3('0x14'));_0xd947be(_0x395312[_0x52e3('0x1b')][_0x52e3('0x1a')]);}})['catch'](function(_0x1fbe23){logger['error'](_0x52e3('0x13'),_0x36edee,_0x1fbe23);_0x5ac540(_0x1fbe23);});});}exports[_0x52e3('0x1c')]=function(_0x3d14ed){var _0x36957e=this;return new Promise(function(_0x44f720,_0x57590b){return db[_0x52e3('0x1d')][_0x52e3('0x1e')](_0x3d14ed[_0x52e3('0x1f')],{'raw':_0x3d14ed['options']?_0x3d14ed[_0x52e3('0x20')]['raw']===undefined?!![]:![]:!![]})[_0x52e3('0x11')](function(_0x4de790){logger[_0x52e3('0x12')](_0x52e3('0x1c'),_0x3d14ed);logger[_0x52e3('0x15')](_0x52e3('0x1c'),_0x3d14ed,JSON[_0x52e3('0x17')](_0x4de790));_0x44f720(_0x4de790);})[_0x52e3('0x21')](function(_0x51f0e0){logger[_0x52e3('0x18')]('CreatePlugin',_0x51f0e0[_0x52e3('0x1a')],_0x3d14ed);_0x57590b(_0x36957e[_0x52e3('0x18')](0x1f4,_0x51f0e0[_0x52e3('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index d4a26e9..2cd8258 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 _0xf5f0=['update','emit','removeListener','length','./plugin.events','save'];(function(_0x6a10fa,_0x1712fe){var _0x3b703a=function(_0x47c98d){while(--_0x47c98d){_0x6a10fa['push'](_0x6a10fa['shift']());}};_0x3b703a(++_0x1712fe);}(_0xf5f0,0xa0));var _0x0f5f=function(_0x3e8392,_0x2a0c08){_0x3e8392=_0x3e8392-0x0;var _0x3b49e2=_0xf5f0[_0x3e8392];return _0x3b49e2;};'use strict';var PluginEvents=require(_0x0f5f('0x0'));var events=[_0x0f5f('0x1'),'remove',_0x0f5f('0x2')];function createListener(_0x35b930,_0x51b36e){return function(_0x232dc8){_0x51b36e[_0x0f5f('0x3')](_0x35b930,_0x232dc8);};}function removeListener(_0x38ba78,_0x5459cd){return function(){PluginEvents[_0x0f5f('0x4')](_0x38ba78,_0x5459cd);};}exports['register']=function(_0x307474){for(var _0xf31f30=0x0,_0xa2b255=events[_0x0f5f('0x5')];_0xf31f30<_0xa2b255;_0xf31f30++){var _0x1b4450=events[_0xf31f30];var _0x222fbb=createListener('plugin:'+_0x1b4450,_0x307474);PluginEvents['on'](_0x1b4450,_0x222fbb);}}; \ No newline at end of file +var _0xda91=['remove','update','removeListener','register','./plugin.events','save'];(function(_0xe9f509,_0x877922){var _0x3f7c9b=function(_0xaf70df){while(--_0xaf70df){_0xe9f509['push'](_0xe9f509['shift']());}};_0x3f7c9b(++_0x877922);}(_0xda91,0x178));var _0x1da9=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xda91[_0x3947c9];return _0x2e7871;};'use strict';var PluginEvents=require(_0x1da9('0x0'));var events=[_0x1da9('0x1'),_0x1da9('0x2'),_0x1da9('0x3')];function createListener(_0x1d0c15,_0x353ae4){return function(_0x24a059){_0x353ae4['emit'](_0x1d0c15,_0x24a059);};}function removeListener(_0x24e8fa,_0x30da18){return function(){PluginEvents[_0x1da9('0x4')](_0x24e8fa,_0x30da18);};}exports[_0x1da9('0x5')]=function(_0x2b05e8){for(var _0x321550=0x0,_0x3d6cd3=events['length'];_0x321550<_0x3d6cd3;_0x321550++){var _0x302b69=events[_0x321550];var _0x5ebf50=createListener('plugin:'+_0x302b69,_0x2b05e8);PluginEvents['on'](_0x302b69,_0x5ebf50);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 94bde3f..54d25e4 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(_0xc8a7bb,_0x480fa5){var _0x54c632=function(_0x4a953a){while(--_0x4a953a){_0xc8a7bb['push'](_0xc8a7bb['shift']());}};_0x54c632(++_0x480fa5);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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(_0x74517f,_0x3c3164){var _0x5ba911=function(_0x242c99){while(--_0x242c99){_0x74517f['push'](_0x74517f['shift']());}};_0x5ba911(++_0x3c3164);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 b907fc9..627638a 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 _0xa9e0=['list','then','reject','express','motion2','catch','describe','params','create','body','script','join','../../files/plugins','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','stop','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','child_process','bluebird','sendStatus','status','stack','name','send','info','error','index'];(function(_0x5d7bef,_0x404410){var _0x13b450=function(_0x52bc61){while(--_0x52bc61){_0x5d7bef['push'](_0x5d7bef['shift']());}};_0x13b450(++_0x404410);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x0a9e('0x0'));var pm2=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var path=require('path');var exec=require(_0x0a9e('0x3'))['exec'];var BPromise=require(_0x0a9e('0x4'));function handleEntityNotFound(_0x432180,_0x2ab90b){return function(_0x991246){if(!_0x991246){_0x432180[_0x0a9e('0x5')](0x194);;}return _0x991246;};}function respondWithResult(_0x57b080,_0x219af0){_0x219af0=_0x219af0||0xc8;return function(_0x441e3a){if(_0x441e3a){return _0x57b080[_0x0a9e('0x6')](_0x219af0)['json'](_0x441e3a);}return null;};}function handleError(_0x503809,_0xe42b77){_0xe42b77=_0xe42b77||0x1f4;return function(_0x56465b){logger['error'](_0x56465b[_0x0a9e('0x7')]);if(_0x56465b[_0x0a9e('0x8')]){delete _0x56465b[_0x0a9e('0x8')];}_0x503809[_0x0a9e('0x6')](_0xe42b77)[_0x0a9e('0x9')](_0x56465b);};}function execChildProcess(){return new BPromise(function(_0xbd1168,_0x4a4c56){exec('npm\x20install',function(_0x527cdd,_0x4cfe67,_0x273d4d){logger[_0x0a9e('0xa')](_0x4cfe67);logger[_0x0a9e('0xa')](_0x273d4d);if(_0x527cdd){logger[_0x0a9e('0xb')](_0x527cdd);return _0x4a4c56(_0x527cdd);}return _0xbd1168(_0x4cfe67);});});}exports[_0x0a9e('0xc')]=function(_0x69aeb7,_0x5db4b0){return pm2[_0x0a9e('0xd')]()[_0x0a9e('0xe')](function(_0x2b4227){if(_0x2b4227){var _0x281129=_[_0x0a9e('0xf')](_0x2b4227,function(_0x4d5611){return _0x4d5611['name']===_0x0a9e('0x10')||_0x4d5611['name']===_0x0a9e('0x11');});return{'rows':_0x281129,'count':_0x281129['length']};}return null;})[_0x0a9e('0xe')](respondWithResult(_0x5db4b0,null))[_0x0a9e('0x12')](handleError(_0x5db4b0,null));};exports['show']=function(_0x225616,_0x5a0a06){return pm2[_0x0a9e('0x13')](_0x225616[_0x0a9e('0x14')]['id'])[_0x0a9e('0xe')](respondWithResult(_0x5a0a06,null))[_0x0a9e('0xe')](handleEntityNotFound(_0x5a0a06,null))[_0x0a9e('0x12')](handleError(_0x5a0a06,null));};exports[_0x0a9e('0x15')]=function(_0x530eb7,_0x20559e){if(_0x530eb7[_0x0a9e('0x16')][_0x0a9e('0x8')]&&_0x530eb7[_0x0a9e('0x16')][_0x0a9e('0x17')]){var _0x4bb1e3=path[_0x0a9e('0x18')](__dirname,_0x0a9e('0x19'),_0x530eb7['body'][_0x0a9e('0x17')]);var _0x5a09ef=process['cwd']();process[_0x0a9e('0x1a')](path[_0x0a9e('0x1b')](_0x4bb1e3));return execChildProcess()[_0x0a9e('0xe')](function(_0x30bae6){process['chdir'](_0x5a09ef);return pm2[_0x0a9e('0x1c')]({'name':_0x530eb7[_0x0a9e('0x16')][_0x0a9e('0x8')],'script':_0x4bb1e3});})[_0x0a9e('0xe')](function(_0x370d86){pm2[_0x0a9e('0x1d')]();return _0x370d86[0x0];})[_0x0a9e('0xe')](respondWithResult(_0x20559e,0xc9))['catch'](handleError(_0x20559e,null));}else{return _0x20559e['status'](0x1f4)[_0x0a9e('0x9')]({'message':_0x0a9e('0x1e')});}};exports[_0x0a9e('0x1f')]=function(_0x33161b,_0x526cf3){if(_0x33161b[_0x0a9e('0x16')]['id']){delete _0x33161b['body']['id'];}var _0x45a1e7={'online':'restart','stopped':_0x0a9e('0x20')};if(_0x45a1e7[_0x0a9e('0x21')](_0x33161b[_0x0a9e('0x16')][_0x0a9e('0x6')])){return pm2[_0x45a1e7[_0x33161b[_0x0a9e('0x16')][_0x0a9e('0x6')]]](_0x33161b[_0x0a9e('0x14')]['id'])[_0x0a9e('0xe')](respondWithResult(_0x526cf3,0xc8))['catch'](handleError(_0x526cf3,null));}else{return _0x526cf3[_0x0a9e('0x6')](0x1f4)[_0x0a9e('0x9')]({'message':_0x0a9e('0x22')});}};exports[_0x0a9e('0x23')]=function(_0x5c877d,_0x15b200){if(_0x5c877d[_0x0a9e('0x16')]['id']){delete _0x5c877d[_0x0a9e('0x16')]['id'];}if(_0x5c877d[_0x0a9e('0x14')]['id']){return pm2[_0x0a9e('0x24')](_0x5c877d[_0x0a9e('0x14')]['id'])[_0x0a9e('0xe')](function(_0x2e8759){pm2[_0x0a9e('0x1d')]();return _0x2e8759[0x0];})['then'](respondWithResult(_0x15b200,null))[_0x0a9e('0x12')](handleError(_0x15b200,null));}else{return _0x15b200['status'](0x1f4)[_0x0a9e('0x9')]({'message':_0x0a9e('0x25')});}}; \ No newline at end of file +var _0xd87e=['catch','describe','params','create','body','script','cwd','chdir','start','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','api','path','child_process','bluebird','status','json','error','stack','name','send','npm\x20install','info','index','list','then','reject','express','motion2','length'];(function(_0x25aaa1,_0x8405a3){var _0x2fa2c1=function(_0x1d4efd){while(--_0x1d4efd){_0x25aaa1['push'](_0x25aaa1['shift']());}};_0x2fa2c1(++_0x8405a3);}(_0xd87e,0x1bf));var _0xed87=function(_0x44f470,_0x74d1a8){_0x44f470=_0x44f470-0x0;var _0x54f0f5=_0xd87e[_0x44f470];return _0x54f0f5;};'use strict';var _=require(_0xed87('0x0'));var pm2=require(_0xed87('0x1'));var logger=require('../../config/logger')(_0xed87('0x2'));var path=require(_0xed87('0x3'));var exec=require(_0xed87('0x4'))['exec'];var BPromise=require(_0xed87('0x5'));function handleEntityNotFound(_0x5e960f,_0x11a5d9){return function(_0x41ca7c){if(!_0x41ca7c){_0x5e960f['sendStatus'](0x194);;}return _0x41ca7c;};}function respondWithResult(_0x17adfe,_0x589fb9){_0x589fb9=_0x589fb9||0xc8;return function(_0x5da793){if(_0x5da793){return _0x17adfe[_0xed87('0x6')](_0x589fb9)[_0xed87('0x7')](_0x5da793);}return null;};}function handleError(_0x33e1c1,_0x2f348a){_0x2f348a=_0x2f348a||0x1f4;return function(_0x569d66){logger[_0xed87('0x8')](_0x569d66[_0xed87('0x9')]);if(_0x569d66[_0xed87('0xa')]){delete _0x569d66[_0xed87('0xa')];}_0x33e1c1[_0xed87('0x6')](_0x2f348a)[_0xed87('0xb')](_0x569d66);};}function execChildProcess(){return new BPromise(function(_0x293db4,_0x5b8ab4){exec(_0xed87('0xc'),function(_0xf104cb,_0x5cf4fe,_0x2f642f){logger[_0xed87('0xd')](_0x5cf4fe);logger['info'](_0x2f642f);if(_0xf104cb){logger['error'](_0xf104cb);return _0x5b8ab4(_0xf104cb);}return _0x293db4(_0x5cf4fe);});});}exports[_0xed87('0xe')]=function(_0x32276e,_0x353d46){return pm2[_0xed87('0xf')]()[_0xed87('0x10')](function(_0x3865c5){if(_0x3865c5){var _0x52dfe8=_[_0xed87('0x11')](_0x3865c5,function(_0x19b283){return _0x19b283[_0xed87('0xa')]===_0xed87('0x12')||_0x19b283[_0xed87('0xa')]===_0xed87('0x13');});return{'rows':_0x52dfe8,'count':_0x52dfe8[_0xed87('0x14')]};}return null;})[_0xed87('0x10')](respondWithResult(_0x353d46,null))[_0xed87('0x15')](handleError(_0x353d46,null));};exports['show']=function(_0x3db5ea,_0x18ab7d){return pm2[_0xed87('0x16')](_0x3db5ea[_0xed87('0x17')]['id'])['then'](respondWithResult(_0x18ab7d,null))[_0xed87('0x10')](handleEntityNotFound(_0x18ab7d,null))[_0xed87('0x15')](handleError(_0x18ab7d,null));};exports[_0xed87('0x18')]=function(_0x3f9e08,_0x98a2ca){if(_0x3f9e08[_0xed87('0x19')][_0xed87('0xa')]&&_0x3f9e08[_0xed87('0x19')][_0xed87('0x1a')]){var _0x52e81c=path['join'](__dirname,'../../files/plugins',_0x3f9e08['body'][_0xed87('0x1a')]);var _0x5d3ec8=process[_0xed87('0x1b')]();process[_0xed87('0x1c')](path['dirname'](_0x52e81c));return execChildProcess()[_0xed87('0x10')](function(_0x505733){process[_0xed87('0x1c')](_0x5d3ec8);return pm2[_0xed87('0x1d')]({'name':_0x3f9e08[_0xed87('0x19')][_0xed87('0xa')],'script':_0x52e81c});})[_0xed87('0x10')](function(_0x5d15b3){pm2[_0xed87('0x1e')]();return _0x5d15b3[0x0];})[_0xed87('0x10')](respondWithResult(_0x98a2ca,0xc9))[_0xed87('0x15')](handleError(_0x98a2ca,null));}else{return _0x98a2ca[_0xed87('0x6')](0x1f4)[_0xed87('0xb')]({'message':_0xed87('0x1f')});}};exports[_0xed87('0x20')]=function(_0x4735b3,_0x40b2fa){if(_0x4735b3[_0xed87('0x19')]['id']){delete _0x4735b3[_0xed87('0x19')]['id'];}var _0x341a35={'online':_0xed87('0x21'),'stopped':_0xed87('0x22')};if(_0x341a35['hasOwnProperty'](_0x4735b3[_0xed87('0x19')][_0xed87('0x6')])){return pm2[_0x341a35[_0x4735b3['body'][_0xed87('0x6')]]](_0x4735b3[_0xed87('0x17')]['id'])[_0xed87('0x10')](respondWithResult(_0x40b2fa,0xc8))['catch'](handleError(_0x40b2fa,null));}else{return _0x40b2fa['status'](0x1f4)[_0xed87('0xb')]({'message':_0xed87('0x23')});}};exports[_0xed87('0x24')]=function(_0x549a19,_0x37d45a){if(_0x549a19[_0xed87('0x19')]['id']){delete _0x549a19[_0xed87('0x19')]['id'];}if(_0x549a19[_0xed87('0x17')]['id']){return pm2[_0xed87('0x25')](_0x549a19[_0xed87('0x17')]['id'])[_0xed87('0x10')](function(_0x10509d){pm2[_0xed87('0x1e')]();return _0x10509d[0x0];})['then'](respondWithResult(_0x37d45a,null))[_0xed87('0x15')](handleError(_0x37d45a,null));}else{return _0x37d45a[_0xed87('0x6')](0x1f4)['send']({'message':_0xed87('0x26')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index d4b93e5..f18336c 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 _0x5194=['express','Router','../../components/auth/service','./realtime.controller','/agents','/queues','isAuthenticated','exports'];(function(_0x2e8833,_0x1b5134){var _0x11cdf6=function(_0x5d975a){while(--_0x5d975a){_0x2e8833['push'](_0x2e8833['shift']());}};_0x11cdf6(++_0x1b5134);}(_0x5194,0x1e0));var _0x4519=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5194[_0xfae23b];return _0x200640;};'use strict';var express=require(_0x4519('0x0'));var router=express[_0x4519('0x1')]();var auth=require(_0x4519('0x2'));var controller=require(_0x4519('0x3'));router['get'](_0x4519('0x4'),auth['isAuthenticated'](),controller['getAgents']);router['get'](_0x4519('0x5'),auth[_0x4519('0x6')](),controller['getQueues']);module[_0x4519('0x7')]=router; \ No newline at end of file +var _0x71d3=['getQueues','express','Router','../../components/auth/service','./realtime.controller','isAuthenticated','getAgents','get','/queues'];(function(_0x1407d1,_0x4cc88c){var _0x4e6cbe=function(_0x40b958){while(--_0x40b958){_0x1407d1['push'](_0x1407d1['shift']());}};_0x4e6cbe(++_0x4cc88c);}(_0x71d3,0x1d5));var _0x371d=function(_0xa454a,_0x598f3c){_0xa454a=_0xa454a-0x0;var _0x53de0c=_0x71d3[_0xa454a];return _0x53de0c;};'use strict';var express=require(_0x371d('0x0'));var router=express[_0x371d('0x1')]();var auth=require(_0x371d('0x2'));var controller=require(_0x371d('0x3'));router['get']('/agents',auth[_0x371d('0x4')](),controller[_0x371d('0x5')]);router[_0x371d('0x6')](_0x371d('0x7'),auth['isAuthenticated'](),controller[_0x371d('0x8')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 2dc044e..67f53e0 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 _0x62d2=['userpic','lastLoginAt','lastPauseAt','address','openchannelPause','smsPause','faxPause','chatCapacity','openchannelCapacity','mailCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','smsStatus','faxStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','routealias','resolve','rawAttributes','fieldName','type','key','query','role','agent','getOptions','raw','user','userProfileId','nolimit','sort','UserProfile','rows','globalStatus','globalStatusFilter','pauseTypeFilter','pauseType','getQueues','mail','sms','fax','whatsapp','channel','toLowerCase','QueueCampaigns','getResources','all','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','client','http','offset','count','limit','Content-Range','json','error','status','send','Agents','then','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','request','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','talking','paused','voice','push','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','map','get','agents','waiting','busy','outbound','find','merge','pick','filter','queue','name','length','some','connectedlinenum','internal','toString','UserId','accountcode','online','voiceStatus','loggedInDb','User','Queue','findAll','QueueId','unknown','ringing','isNil','chatPause','mailPause','voicePause','whatsappPause','every','idle','pause','chatStatus','mailStatus','openchannelStatus','whatsappStatus','*pause','getAgents'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x62d2,0xce));var _0x262d=function(_0x21ecc8,_0x2bdead){_0x21ecc8=_0x21ecc8-0x0;var _0x510c1d=_0x62d2[_0x21ecc8];return _0x510c1d;};'use strict';var util=require(_0x262d('0x0'));var _=require(_0x262d('0x1'));var jayson=require(_0x262d('0x2'));var qs=require(_0x262d('0x3'));var logger=require(_0x262d('0x4'))(_0x262d('0x5'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x262d('0x6')][_0x262d('0x7')]({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithFilteredResult(_0x1e2814,_0x35cd27){return function(_0x235b1b){if(_0x235b1b){var _0x37cfe7=typeof _0x35cd27[_0x262d('0x8')]==='undefined'&&typeof _0x35cd27['limit']==='undefined';var _0x474653=_0x235b1b[_0x262d('0x9')];var _0x304b96=_0x37cfe7?0x0:_0x35cd27[_0x262d('0x8')];var _0xac667a=_0x37cfe7?_0x235b1b['count']:_0x35cd27[_0x262d('0x8')]+_0x35cd27[_0x262d('0xa')];var _0x3b8fbb;if(_0xac667a>=_0x474653){_0xac667a=_0x474653;_0x3b8fbb=0xc8;}else{_0x3b8fbb=0xce;}_0x1e2814['status'](_0x3b8fbb);return _0x1e2814['set'](_0x262d('0xb'),_0x304b96+'-'+_0xac667a+'/'+_0x474653)[_0x262d('0xc')](_0x235b1b);}return null;};}function handleError(_0xd191ce,_0x4058b8){_0x4058b8=_0x4058b8||0x1f4;return function(_0x1cbfce){logger[_0x262d('0xd')](_0x1cbfce['stack']);if(_0x1cbfce['name']){delete _0x1cbfce['name'];}_0xd191ce[_0x262d('0xe')](_0x4058b8)[_0x262d('0xf')](_0x1cbfce);};}function getRealtimeAgents(){return new Promise(function(_0x3ea759,_0x147463){return amiClient['request'](_0x262d('0x10'),{})[_0x262d('0x11')](function(_0x4587d3){if(_0x4587d3[_0x262d('0xd')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x3ea697=_0x4587d3[_0x262d('0x12')];return routingClient['request'](_0x262d('0x10'),{})['then'](function(_0x889d3a){if(_0x889d3a['error'])throw new Error(_0x262d('0x13'));var _0x3ee9d5=_0x889d3a[_0x262d('0x12')];return _0x3ea759(_['merge']({},_0x3ea697,_0x3ee9d5));});})['catch'](function(_0xc1a74){_0x147463(_0xc1a74);});});}function getRealtimeQueues(_0x2d55a2,_0x4a0f49){return new Promise(function(_0x8592c6,_0x2a4c8b){var _0x2524b0=_0x4a0f49==='voice'?amiClient:routingClient;return _0x2524b0['request'](_[_0x262d('0x14')](_0x4a0f49)+_0x262d('0x15'),_0x2d55a2)['then'](function(_0x17ec90){if(_0x17ec90[_0x262d('0xd')])throw new Error(util[_0x262d('0x16')](_0x262d('0x17'),_0x4a0f49));return _0x8592c6(_0x17ec90[_0x262d('0x12')]);})[_0x262d('0x18')](function(_0x23b39b){_0x2a4c8b(_0x23b39b);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x1b3e70,_0xa42bc7){return amiClient[_0x262d('0x19')](_0x262d('0x1a'),{})[_0x262d('0x11')](function(_0x3ffe17){if(_0x3ffe17[_0x262d('0xd')])throw new Error(_0x262d('0x1b'));return _0x1b3e70(_0x3ffe17[_0x262d('0x12')]);})[_0x262d('0x18')](function(_0x44c5e4){_0xa42bc7(_0x44c5e4);});});}function initializeQueues(_0x20b7eb,_0x328f6e,_0x312df9,_0x49807b){var _0x500123=[_0x262d('0x1c'),_0x262d('0x1d'),'waiting',_0x262d('0x1e'),_0x262d('0x1f')];if(_0x312df9===_0x262d('0x20')&&_0x49807b==='outbound'){_0x500123[_0x262d('0x21')]('pTalking',_0x262d('0x22'),_0x262d('0x23'),_0x262d('0x24'),_0x262d('0x25'),_0x262d('0x26'),_0x262d('0x27'),_0x262d('0x28'),_0x262d('0x29'),_0x262d('0x2a'),_0x262d('0x2b'),_0x262d('0x2c'),_0x262d('0x2d'),_0x262d('0x2e'),'dialPredictiveIntervalMinThreshold',_0x262d('0x2f'),'predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls',_0x262d('0x30'),_0x262d('0x31'),'predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime');}return _0x20b7eb[_0x262d('0x32')](function(_0x378e0c){var _0x20d36e=_0x378e0c[_0x262d('0x33')]({'plain':!![]});_0x20d36e[_0x262d('0x34')]=[];_0x20d36e[_0x262d('0x1f')]=0x0;_0x20d36e['loggedInDb']=0x0;_0x20d36e[_0x262d('0x1c')]=0x0;_0x20d36e['available']=0x0;_0x20d36e[_0x262d('0x35')]=0x0;if(_0x312df9===_0x262d('0x20')){_0x20d36e[_0x262d('0x1e')]=0x0;_0x20d36e[_0x262d('0x36')]=0x0;if(_0x49807b===_0x262d('0x37')){_0x20d36e['pTalking']=0x0;_0x20d36e['originated']=0x0;}}var _0x4d30fe=_[_0x262d('0x38')](_0x328f6e,['id',_0x20d36e['id']]);if(_0x4d30fe)_[_0x262d('0x39')](_0x20d36e,_[_0x262d('0x3a')](_0x4d30fe,_0x500123));return _0x20d36e;});}function updateAgentVoiceStatus(_0x5acd6e,_0xe72513,_0x450323){var _0x16d1ee=_[_0x262d('0x3b')](_0x450323,[_0x262d('0x3c'),_0xe72513[_0x262d('0x3d')]]);if(_0x16d1ee[_0x262d('0x3e')]===0x0)return _0x5acd6e['busy']=!![];if(_[_0x262d('0x3f')](_0x16d1ee,[_0x262d('0x40'),_0x5acd6e[_0x262d('0x41')][_0x262d('0x42')]()]))return _0x5acd6e[_0x262d('0x1e')]=!![];if(!_0x5acd6e[_0x262d('0x1e')])return _0x5acd6e[_0x262d('0x36')]=!![];}function getVoiceQueueAgents(_0x53ed53,_0x3db064,_0x58ac63,_0xae486b){var _0x584517=_['find'](_0x3db064,['id',_0x53ed53['id']]);if(!_0x584517)return _0x53ed53;return _0x584517['getMembers']({'raw':!![]})[_0x262d('0x11')](function(_0x669ee4){for(var _0x4cce34=0x0;_0x4cce34<_0x669ee4[_0x262d('0x3e')];_0x4cce34++){var _0x1f5af7=_[_0x262d('0x38')](_0x58ac63,['id',_0x669ee4[_0x4cce34]['UserId']]);if(!_0x1f5af7){_0x1f5af7={'id':_0x669ee4[_0x4cce34]['UserId'],'name':_0x669ee4[_0x4cce34][_0x262d('0x43')],'accountcode':'','online':![]};}var _0x414dec={'id':_0x1f5af7['id'],'name':_0x1f5af7[_0x262d('0x3d')],'internal':_0x1f5af7[_0x262d('0x44')],'online':Boolean(_0x1f5af7[_0x262d('0x45')]),'paused':Boolean(_0x669ee4[_0x4cce34][_0x262d('0x1f')])};if(_0x1f5af7[_0x262d('0x46')]===_0x262d('0x1e'))updateAgentVoiceStatus(_0x414dec,_0x53ed53,_0xae486b);if(_0x414dec[_0x262d('0x45')])_0x53ed53[_0x262d('0x47')]++;if(_0x414dec['busy'])_0x53ed53[_0x262d('0x36')]++;if(_0x414dec[_0x262d('0x1f')]&&!_0x414dec[_0x262d('0x36')]&&!_0x414dec[_0x262d('0x1e')])_0x53ed53[_0x262d('0x1f')]++;_0x53ed53[_0x262d('0x34')][_0x262d('0x21')](_0x414dec);}return _0x53ed53;});}function getQueueAgents(_0x56a1a6,_0xe62679,_0x43223f){var _0x5b92c3=_0x262d('0x48')+_['startCase'](_0x43223f)+_0x262d('0x49');var _0x13bff9=_0x43223f+'Pause';return db[_0x5b92c3][_0x262d('0x4a')]({'where':{[_[_0x262d('0x14')](_0x43223f)+_0x262d('0x4b')]:_0x56a1a6['id']},'raw':!![]})[_0x262d('0x11')](function(_0x2192cb){for(var _0x53ae66=0x0;_0x53ae66<_0x2192cb[_0x262d('0x3e')];_0x53ae66++){var _0x39459d=_[_0x262d('0x38')](_0xe62679,['id',_0x2192cb[_0x53ae66][_0x262d('0x43')]]);if(!_0x39459d){_0x39459d={'id':_0x2192cb[_0x53ae66]['UserId'],'name':_0x2192cb[_0x53ae66][_0x262d('0x43')],'online':![],['pauseField']:![]};}var _0x447e9f={'id':_0x39459d['id'],'name':_0x39459d[_0x262d('0x3d')],'online':Boolean(_0x39459d[_0x262d('0x45')]),'paused':Boolean(_0x39459d[_0x13bff9])};if(_0x447e9f[_0x262d('0x45')])_0x56a1a6['loggedInDb']++;_0x56a1a6['agents'][_0x262d('0x21')](_0x447e9f);}return _0x56a1a6;});}function isIdle(_0x31cf14){return _0x31cf14==='idle'||_0x31cf14===_0x262d('0x4c')||_0x31cf14==='unavailable'||_0x31cf14===_0x262d('0x4d')||_[_0x262d('0x4e')](_0x31cf14);}function isAgentPaused(_0x104563,_0xdb2907){var _0x49eedb=[_0x104563[_0x262d('0x4f')],_0x104563['faxPause'],_0x104563[_0x262d('0x50')],_0x104563['openchannelPause'],_0x104563['smsPause'],_0x104563[_0x262d('0x51')],_0x104563[_0x262d('0x52')]];if(!_0xdb2907)return _[_0x262d('0x53')](_0x49eedb);var _0x2546c7=_[_0x262d('0x3b')](_0x49eedb);return _0x2546c7[_0x262d('0x3e')]>0x0&&_0x2546c7[_0x262d('0x3e')]<_0x49eedb[_0x262d('0x3e')]?!![]:![];}function isAgentIdle(_0x511282){if(_0x511282[_0x262d('0x46')]!==_0x262d('0x54')&&_0x511282['voicePause']){_0x511282[_0x262d('0x46')]=_0x262d('0x55');return![];}return _['every']([_0x511282[_0x262d('0x56')],_0x511282['faxStatus'],_0x511282[_0x262d('0x57')],_0x511282[_0x262d('0x58')],_0x511282['smsStatus'],_0x511282[_0x262d('0x46')],_0x511282[_0x262d('0x59')]],isIdle);}function getAgentStatus(_0x54fe46){var _0x46dbbc=_0x262d('0x4c');if(isAgentPaused(_0x54fe46))_0x46dbbc=_0x262d('0x55');else if(isAgentPaused(_0x54fe46,!![]))_0x46dbbc=_0x262d('0x5a');else if(isAgentIdle(_0x54fe46))_0x46dbbc='idle';else _0x46dbbc=_0x262d('0x36');return _0x46dbbc;}exports[_0x262d('0x5b')]=function(_0x383144,_0x5ed94a){var _0x224639={'count':0x0,'rows':[]},_0x3b6d2f={},_0xdd98e1,_0x2fa81c,_0x1e6981=[_0x262d('0x5c'),'online',_0x262d('0x5d'),'lastPauseAt','pauseType',_0x262d('0x5e'),_0x262d('0x41'),_0x262d('0x5f'),'chatPause',_0x262d('0x60'),_0x262d('0x50'),_0x262d('0x61'),_0x262d('0x52'),_0x262d('0x62'),_0x262d('0x51'),_0x262d('0x63'),_0x262d('0x64'),_0x262d('0x65'),'smsCapacity','whatsappCapacity',_0x262d('0x66'),_0x262d('0x67'),_0x262d('0x68'),'mailCurrentCapacity',_0x262d('0x69'),'whatsappCurrentCapacity',_0x262d('0x6a'),'chatStatus',_0x262d('0x58'),_0x262d('0x57'),_0x262d('0x6b'),'whatsappStatus',_0x262d('0x6c'),_0x262d('0x46'),_0x262d('0x6d'),_0x262d('0x6e'),_0x262d('0x6f'),_0x262d('0x70'),_0x262d('0x71'),_0x262d('0x72'),'voiceStatusTime',_0x262d('0x3c'),_0x262d('0x73'),_0x262d('0x74'),_0x262d('0x75'),'phoneBarEnableAutomaticScreenRecording',_0x262d('0x76')],_0x11bbf1=[_0x262d('0x4f'),'openchannelPause','mailPause',_0x262d('0x61'),_0x262d('0x52'),_0x262d('0x62'),_0x262d('0x51'),'online'];Promise[_0x262d('0x77')]()[_0x262d('0x11')](function(){var _0x9d7dd5=_[_0x262d('0x32')](db[_0x262d('0x48')][_0x262d('0x78')],function(_0x1877cf){return{'name':_0x1877cf[_0x262d('0x79')],'type':_0x1877cf[_0x262d('0x7a')][_0x262d('0x7b')]};});_0x383144[_0x262d('0x7c')][_0x262d('0x7d')]=_0x262d('0x7e');_0x383144['query'][_0x262d('0x45')]=!![];_0x3b6d2f=qs[_0x262d('0x7f')](_0x9d7dd5,_0x383144);_0x3b6d2f[_0x262d('0x80')]=!![];if(_0x383144['user'][_0x262d('0x7d')]===_0x262d('0x81')){var _0x4b10d9={'params':{'id':_0x383144['user'][_0x262d('0x82')]},'query':{'section':_0x262d('0x10'),'role':_0x262d('0x7e'),'online':!![],'nolimit':_0x383144[_0x262d('0x7c')][_0x262d('0x83')],'sort':_0x383144['query'][_0x262d('0x84')],'filter':_0x383144[_0x262d('0x7c')][_0x262d('0x3b')]},'raw':!![]};return db[_0x262d('0x85')]['getResources'](_0x4b10d9);}return db[_0x262d('0x48')]['findAndCountAll'](_0x3b6d2f);})['then'](function(_0x4ece5e){_0x224639[_0x262d('0x9')]=_0x4ece5e[_0x262d('0x9')];_0xdd98e1=_0x4ece5e[_0x262d('0x86')];return getRealtimeAgents();})[_0x262d('0x11')](function(_0x17ca0c){_0x2fa81c=_0x17ca0c[_0x262d('0x86')];return _0xdd98e1['map'](function(_0xa11500){var _0x42adf3=_[_0x262d('0x38')](_0x2fa81c,['id',_0xa11500['id']]);if(_0x42adf3)_[_0x262d('0x39')](_0xa11500,_['pick'](_['omit'](_0x42adf3,_0x11bbf1),_0x1e6981));_0xa11500[_0x262d('0x87')]=getAgentStatus(_0xa11500);return _0xa11500;});})[_0x262d('0x11')](function(_0x1a847f){if(_0x383144[_0x262d('0x7c')][_0x262d('0x88')]){var _0x32e7e3=_['filter'](_0x1a847f,[_0x262d('0x87'),_0x383144['query'][_0x262d('0x88')]]);if(_0x383144[_0x262d('0x7c')][_0x262d('0x89')]){_0x32e7e3=_[_0x262d('0x3b')](_0x32e7e3,[_0x262d('0x8a'),_0x383144[_0x262d('0x7c')][_0x262d('0x89')]]);}}_0x224639[_0x262d('0x86')]=_0x32e7e3||_0x1a847f;return _0x224639;})['then'](respondWithFilteredResult(_0x5ed94a,_0x3b6d2f))['catch'](handleError(_0x5ed94a,null));};exports[_0x262d('0x8b')]=function(_0x5c3f38,_0xe9f503){var _0xcee68e=[_0x262d('0x8c'),'chat',_0x262d('0x8d'),'openchannel',_0x262d('0x8e'),_0x262d('0x8f'),'voice'];var _0x46b7d3={'count':0x0,'rows':[]},_0x470cfd={},_0x5cbebe,_0x4ef6c8,_0x264f96,_0x449dd1,_0xe63ed;Promise[_0x262d('0x77')]()[_0x262d('0x11')](function(){if(_0x5c3f38['query'][_0x262d('0x90')]){if(!_['includes'](_0xcee68e,_0x5c3f38['query'][_0x262d('0x90')][_0x262d('0x91')]()))throw new Error('Invalid\x20channel');_0x5cbebe=_0x5c3f38['query'][_0x262d('0x90')][_0x262d('0x91')]();}var _0x51d50d=_['startCase'](_0x5cbebe)+'Queue';var _0x513d9f=_[_0x262d('0x32')](db[_0x51d50d][_0x262d('0x78')],function(_0x1f2f73){return{'name':_0x1f2f73[_0x262d('0x79')],'type':_0x1f2f73[_0x262d('0x7a')][_0x262d('0x7b')]};});_0x470cfd=qs[_0x262d('0x7f')](_0x513d9f,_0x5c3f38);if(_0x5c3f38[_0x262d('0x81')][_0x262d('0x7d')]==='user'){var _0x3e0b4c={'params':{'id':_0x5c3f38[_0x262d('0x81')][_0x262d('0x82')]},'query':{'section':_0x5cbebe===_0x262d('0x20')&&_0x5c3f38['query'][_0x262d('0x7a')]===_0x262d('0x37')?_0x262d('0x92'):_['startCase'](_0x5cbebe)+_0x262d('0x15'),'type':_0x5c3f38[_0x262d('0x7c')][_0x262d('0x7a')],'nolimit':!![],'sort':_0x262d('0x3d'),'filter':_0x5c3f38['query'][_0x262d('0x3b')]}};return db[_0x262d('0x85')][_0x262d('0x93')](_0x3e0b4c);}return db[_0x51d50d]['findAndCountAll'](_0x470cfd);})[_0x262d('0x11')](function(_0xe6e9ae){_0x46b7d3[_0x262d('0x9')]=_0xe6e9ae[_0x262d('0x9')];_0x4ef6c8=_0xe6e9ae[_0x262d('0x86')];return getRealtimeQueues(_0x5c3f38,_0x5cbebe);})[_0x262d('0x11')](function(_0x70aac9){_0x449dd1=_0x70aac9['rows'];return getRealtimeAgents();})[_0x262d('0x11')](function(_0x3947a7){_0x264f96=_0x3947a7[_0x262d('0x86')];if(_0x5cbebe!='voice')return;return getRealtimeVoiceQueueChannels();})[_0x262d('0x11')](function(_0x4a7dcd){_0xe63ed=_0x4a7dcd?_0x4a7dcd['rows']:[];return initializeQueues(_0x4ef6c8,_0x449dd1,_0x5cbebe,_0x5c3f38[_0x262d('0x7c')][_0x262d('0x7a')]);})[_0x262d('0x11')](function(_0x2640e0){var _0x2a39ac=_0x2640e0[_0x262d('0x32')](function(_0x12fd67){if(_0x5cbebe===_0x262d('0x20'))return getVoiceQueueAgents(_0x12fd67,_0x4ef6c8,_0x264f96,_0xe63ed);else return getQueueAgents(_0x12fd67,_0x264f96,_0x5cbebe);});return Promise[_0x262d('0x94')](_0x2a39ac);})[_0x262d('0x11')](function(_0x3e11b2){_0x46b7d3[_0x262d('0x86')]=_0x3e11b2;return _0x46b7d3;})['then'](respondWithFilteredResult(_0xe9f503,_0x470cfd))[_0x262d('0x18')](handleError(_0xe9f503,null));}; \ No newline at end of file +var _0x372d=['get','agents','loggedIn','busy','outbound','find','pick','queue','length','some','connectedlinenum','internal','getMembers','UserId','voiceStatus','loggedInDb','User','findAll','QueueId','online','unknown','unavailable','isNil','faxPause','mailPause','openchannelPause','smsPause','voicePause','filter','idle','pause','every','chatStatus','faxStatus','openchannelStatus','smsStatus','*pause','getAgents','userpic','lastPauseAt','pauseType','address','chatPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','faxCapacity','chatCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','mailStatus','whatsappStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','screenrecording','phoneBarEnableScreenRecordingByAgent','routealias','whatsappPause','resolve','rawAttributes','fieldName','type','key','query','getOptions','raw','user','agent','nolimit','sort','UserProfile','getResources','rows','merge','globalStatus','globalStatusFilter','mail','chat','fax','whatsapp','channel','includes','Invalid\x20channel','toLowerCase','Queue','role','userProfileId','QueueCampaigns','Queues','findAndCountAll','util','../../components/parsers/qs','../../config/logger','../../mysqldb','http','client','offset','undefined','limit','count','status','error','name','send','request','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','voice','startCase','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','available','waiting','talking','paused','push','pTalking','originated','message','dialMethod','Trunk','startPredictive','startProgressive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map'];(function(_0xbac97,_0x509573){var _0x397cde=function(_0x4d4d21){while(--_0x4d4d21){_0xbac97['push'](_0xbac97['shift']());}};_0x397cde(++_0x509573);}(_0x372d,0x182));var _0xd372=function(_0x498ec3,_0x23257b){_0x498ec3=_0x498ec3-0x0;var _0x5218ed=_0x372d[_0x498ec3];return _0x5218ed;};'use strict';var util=require(_0xd372('0x0'));var _=require('lodash');var jayson=require('jayson/promise');var qs=require(_0xd372('0x1'));var logger=require(_0xd372('0x2'))('api');var db=require(_0xd372('0x3'))['db'];var amiClient=jayson['client'][_0xd372('0x4')]({'port':0x232a});var routingClient=jayson[_0xd372('0x5')][_0xd372('0x4')]({'port':0x232c});function respondWithFilteredResult(_0xe25a8c,_0x261e4a){return function(_0x123838){if(_0x123838){var _0x55f57c=typeof _0x261e4a[_0xd372('0x6')]===_0xd372('0x7')&&typeof _0x261e4a[_0xd372('0x8')]===_0xd372('0x7');var _0x1a8a68=_0x123838[_0xd372('0x9')];var _0x254540=_0x55f57c?0x0:_0x261e4a[_0xd372('0x6')];var _0x477170=_0x55f57c?_0x123838[_0xd372('0x9')]:_0x261e4a[_0xd372('0x6')]+_0x261e4a[_0xd372('0x8')];var _0x21a39e;if(_0x477170>=_0x1a8a68){_0x477170=_0x1a8a68;_0x21a39e=0xc8;}else{_0x21a39e=0xce;}_0xe25a8c[_0xd372('0xa')](_0x21a39e);return _0xe25a8c['set']('Content-Range',_0x254540+'-'+_0x477170+'/'+_0x1a8a68)['json'](_0x123838);}return null;};}function handleError(_0x65ba00,_0x41c7d2){_0x41c7d2=_0x41c7d2||0x1f4;return function(_0x5915ab){logger[_0xd372('0xb')](_0x5915ab['stack']);if(_0x5915ab[_0xd372('0xc')]){delete _0x5915ab[_0xd372('0xc')];}_0x65ba00[_0xd372('0xa')](_0x41c7d2)[_0xd372('0xd')](_0x5915ab);};}function getRealtimeAgents(){return new Promise(function(_0x29a46f,_0x4d499){return amiClient[_0xd372('0xe')](_0xd372('0xf'),{})['then'](function(_0x9276da){if(_0x9276da[_0xd372('0xb')])throw new Error(_0xd372('0x10'));var _0x3c93a0=_0x9276da[_0xd372('0x11')];return routingClient[_0xd372('0xe')](_0xd372('0xf'),{})[_0xd372('0x12')](function(_0x39d7ea){if(_0x39d7ea['error'])throw new Error(_0xd372('0x13'));var _0x58a56e=_0x39d7ea[_0xd372('0x11')];return _0x29a46f(_['merge']({},_0x3c93a0,_0x58a56e));});})['catch'](function(_0x3484ce){_0x4d499(_0x3484ce);});});}function getRealtimeQueues(_0x8a6c9e,_0x5509b3){return new Promise(function(_0x37c417,_0x22bd7a){var _0x48d0e7=_0x5509b3===_0xd372('0x14')?amiClient:routingClient;return _0x48d0e7['request'](_[_0xd372('0x15')](_0x5509b3)+'Queues',_0x8a6c9e)[_0xd372('0x12')](function(_0x1309ca){if(_0x1309ca[_0xd372('0xb')])throw new Error(util[_0xd372('0x16')](_0xd372('0x17'),_0x5509b3));return _0x37c417(_0x1309ca[_0xd372('0x11')]);})[_0xd372('0x18')](function(_0x2f2267){_0x22bd7a(_0x2f2267);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x5c456d,_0x323ee7){return amiClient[_0xd372('0xe')]('VoiceQueuesChannels',{})[_0xd372('0x12')](function(_0x4bcf4b){if(_0x4bcf4b[_0xd372('0xb')])throw new Error(_0xd372('0x19'));return _0x5c456d(_0x4bcf4b[_0xd372('0x11')]);})[_0xd372('0x18')](function(_0x5c0990){_0x323ee7(_0x5c0990);});});}function initializeQueues(_0x3fd8e3,_0x25d07d,_0x58103c,_0x59ad54){var _0x4b07bc=['loggedIn',_0xd372('0x1a'),_0xd372('0x1b'),_0xd372('0x1c'),_0xd372('0x1d')];if(_0x58103c===_0xd372('0x14')&&_0x59ad54==='outbound'){_0x4b07bc[_0xd372('0x1e')](_0xd372('0x1f'),_0xd372('0x20'),_0xd372('0x21'),'dialActive',_0xd372('0x22'),_0xd372('0x23'),_0xd372('0x24'),_0xd372('0x25'),'erlangCalls',_0xd372('0x26'),_0xd372('0x27'),_0xd372('0x28'),_0xd372('0x29'),_0xd372('0x2a'),_0xd372('0x2b'),_0xd372('0x2c'),'predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls',_0xd372('0x2d'),'predictiveIntervalDroppedCallsCallersExit',_0xd372('0x2e'),_0xd372('0x2f'));}return _0x3fd8e3[_0xd372('0x30')](function(_0x3bb513){var _0x1609f2=_0x3bb513[_0xd372('0x31')]({'plain':!![]});_0x1609f2[_0xd372('0x32')]=[];_0x1609f2[_0xd372('0x1d')]=0x0;_0x1609f2['loggedInDb']=0x0;_0x1609f2[_0xd372('0x33')]=0x0;_0x1609f2[_0xd372('0x1a')]=0x0;_0x1609f2[_0xd372('0x1b')]=0x0;if(_0x58103c===_0xd372('0x14')){_0x1609f2[_0xd372('0x1c')]=0x0;_0x1609f2[_0xd372('0x34')]=0x0;if(_0x59ad54===_0xd372('0x35')){_0x1609f2['pTalking']=0x0;_0x1609f2[_0xd372('0x20')]=0x0;}}var _0x3d796e=_[_0xd372('0x36')](_0x25d07d,['id',_0x1609f2['id']]);if(_0x3d796e)_['merge'](_0x1609f2,_[_0xd372('0x37')](_0x3d796e,_0x4b07bc));return _0x1609f2;});}function updateAgentVoiceStatus(_0x5340d1,_0x343b6b,_0x103216){var _0x4a0035=_['filter'](_0x103216,[_0xd372('0x38'),_0x343b6b[_0xd372('0xc')]]);if(_0x4a0035[_0xd372('0x39')]===0x0)return _0x5340d1['busy']=!![];if(_[_0xd372('0x3a')](_0x4a0035,[_0xd372('0x3b'),_0x5340d1[_0xd372('0x3c')]['toString']()]))return _0x5340d1['talking']=!![];if(!_0x5340d1[_0xd372('0x1c')])return _0x5340d1[_0xd372('0x34')]=!![];}function getVoiceQueueAgents(_0x5ab638,_0x73a689,_0x3f4b82,_0x376923){var _0x5ad1ed=_[_0xd372('0x36')](_0x73a689,['id',_0x5ab638['id']]);if(!_0x5ad1ed)return _0x5ab638;return _0x5ad1ed[_0xd372('0x3d')]({'raw':!![]})[_0xd372('0x12')](function(_0x1e8dcf){for(var _0x46c96e=0x0;_0x46c96e<_0x1e8dcf[_0xd372('0x39')];_0x46c96e++){var _0x251a94=_[_0xd372('0x36')](_0x3f4b82,['id',_0x1e8dcf[_0x46c96e][_0xd372('0x3e')]]);if(!_0x251a94){_0x251a94={'id':_0x1e8dcf[_0x46c96e]['UserId'],'name':_0x1e8dcf[_0x46c96e][_0xd372('0x3e')],'accountcode':'','online':![]};}var _0x4fad2a={'id':_0x251a94['id'],'name':_0x251a94['name'],'internal':_0x251a94['accountcode'],'online':Boolean(_0x251a94['online']),'paused':Boolean(_0x1e8dcf[_0x46c96e][_0xd372('0x1d')])};if(_0x251a94[_0xd372('0x3f')]===_0xd372('0x1c'))updateAgentVoiceStatus(_0x4fad2a,_0x5ab638,_0x376923);if(_0x4fad2a['online'])_0x5ab638[_0xd372('0x40')]++;if(_0x4fad2a[_0xd372('0x34')])_0x5ab638['busy']++;if(_0x4fad2a[_0xd372('0x1d')]&&!_0x4fad2a[_0xd372('0x34')]&&!_0x4fad2a[_0xd372('0x1c')])_0x5ab638[_0xd372('0x1d')]++;_0x5ab638[_0xd372('0x32')][_0xd372('0x1e')](_0x4fad2a);}return _0x5ab638;});}function getQueueAgents(_0x257419,_0x32e84b,_0x4c8734){var _0x342f51=_0xd372('0x41')+_[_0xd372('0x15')](_0x4c8734)+'Queue';var _0x38ce29=_0x4c8734+'Pause';return db[_0x342f51][_0xd372('0x42')]({'where':{[_[_0xd372('0x15')](_0x4c8734)+_0xd372('0x43')]:_0x257419['id']},'raw':!![]})[_0xd372('0x12')](function(_0x5fd168){for(var _0x31a889=0x0;_0x31a889<_0x5fd168[_0xd372('0x39')];_0x31a889++){var _0x37d3c4=_[_0xd372('0x36')](_0x32e84b,['id',_0x5fd168[_0x31a889][_0xd372('0x3e')]]);if(!_0x37d3c4){_0x37d3c4={'id':_0x5fd168[_0x31a889]['UserId'],'name':_0x5fd168[_0x31a889][_0xd372('0x3e')],'online':![],['pauseField']:![]};}var _0x1de0d0={'id':_0x37d3c4['id'],'name':_0x37d3c4['name'],'online':Boolean(_0x37d3c4[_0xd372('0x44')]),'paused':Boolean(_0x37d3c4[_0x38ce29])};if(_0x1de0d0[_0xd372('0x44')])_0x257419[_0xd372('0x40')]++;_0x257419[_0xd372('0x32')][_0xd372('0x1e')](_0x1de0d0);}return _0x257419;});}function isIdle(_0x4323cf){return _0x4323cf==='idle'||_0x4323cf===_0xd372('0x45')||_0x4323cf===_0xd372('0x46')||_0x4323cf==='ringing'||_[_0xd372('0x47')](_0x4323cf);}function isAgentPaused(_0x329929,_0x5f41c7){var _0xa6a493=[_0x329929['chatPause'],_0x329929[_0xd372('0x48')],_0x329929[_0xd372('0x49')],_0x329929[_0xd372('0x4a')],_0x329929[_0xd372('0x4b')],_0x329929[_0xd372('0x4c')],_0x329929['whatsappPause']];if(!_0x5f41c7)return _['every'](_0xa6a493);var _0x3b71fc=_[_0xd372('0x4d')](_0xa6a493);return _0x3b71fc[_0xd372('0x39')]>0x0&&_0x3b71fc['length']<_0xa6a493[_0xd372('0x39')]?!![]:![];}function isAgentIdle(_0x596c0a){if(_0x596c0a[_0xd372('0x3f')]!==_0xd372('0x4e')&&_0x596c0a['voicePause']){_0x596c0a[_0xd372('0x3f')]=_0xd372('0x4f');return![];}return _[_0xd372('0x50')]([_0x596c0a[_0xd372('0x51')],_0x596c0a[_0xd372('0x52')],_0x596c0a['mailStatus'],_0x596c0a[_0xd372('0x53')],_0x596c0a[_0xd372('0x54')],_0x596c0a[_0xd372('0x3f')],_0x596c0a['whatsappStatus']],isIdle);}function getAgentStatus(_0x1e7c1b){var _0x4c47f2=_0xd372('0x45');if(isAgentPaused(_0x1e7c1b))_0x4c47f2=_0xd372('0x4f');else if(isAgentPaused(_0x1e7c1b,!![]))_0x4c47f2=_0xd372('0x55');else if(isAgentIdle(_0x1e7c1b))_0x4c47f2=_0xd372('0x4e');else _0x4c47f2=_0xd372('0x34');return _0x4c47f2;}exports[_0xd372('0x56')]=function(_0x341471,_0x196c31){var _0xf7cef4={'count':0x0,'rows':[]},_0x19effb={},_0x319a58,_0x4a3b94,_0x428f21=[_0xd372('0x57'),_0xd372('0x44'),'lastLoginAt',_0xd372('0x58'),_0xd372('0x59'),_0xd372('0x58'),_0xd372('0x3c'),_0xd372('0x5a'),_0xd372('0x5b'),_0xd372('0x4a'),_0xd372('0x49'),_0xd372('0x4b'),'whatsappPause',_0xd372('0x48'),_0xd372('0x4c'),_0xd372('0x5c'),_0xd372('0x5d'),_0xd372('0x5e'),_0xd372('0x5f'),'whatsappCapacity',_0xd372('0x60'),_0xd372('0x61'),'openchannelCurrentCapacity','mailCurrentCapacity',_0xd372('0x62'),_0xd372('0x63'),_0xd372('0x64'),_0xd372('0x51'),'openchannelStatus',_0xd372('0x65'),'smsStatus',_0xd372('0x66'),_0xd372('0x52'),_0xd372('0x3f'),_0xd372('0x67'),_0xd372('0x68'),_0xd372('0x69'),'smsStatusTime',_0xd372('0x6a'),_0xd372('0x6b'),_0xd372('0x6c'),'queue','destconnectedlinenum',_0xd372('0x6d'),_0xd372('0x6e'),'phoneBarEnableAutomaticScreenRecording',_0xd372('0x6f')],_0x4b0580=[_0xd372('0x5b'),_0xd372('0x4a'),_0xd372('0x49'),_0xd372('0x4b'),_0xd372('0x70'),_0xd372('0x48'),'voicePause','online'];Promise[_0xd372('0x71')]()['then'](function(){var _0x49ba64=_[_0xd372('0x30')](db[_0xd372('0x41')][_0xd372('0x72')],function(_0x10116b){return{'name':_0x10116b[_0xd372('0x73')],'type':_0x10116b[_0xd372('0x74')][_0xd372('0x75')]};});_0x341471[_0xd372('0x76')]['role']='agent';_0x341471[_0xd372('0x76')]['online']=!![];_0x19effb=qs[_0xd372('0x77')](_0x49ba64,_0x341471);_0x19effb[_0xd372('0x78')]=!![];if(_0x341471[_0xd372('0x79')]['role']===_0xd372('0x79')){var _0x353b78={'params':{'id':_0x341471['user']['userProfileId']},'query':{'section':'Agents','role':_0xd372('0x7a'),'online':!![],'nolimit':_0x341471['query'][_0xd372('0x7b')],'sort':_0x341471[_0xd372('0x76')][_0xd372('0x7c')],'filter':_0x341471[_0xd372('0x76')][_0xd372('0x4d')]},'raw':!![]};return db[_0xd372('0x7d')][_0xd372('0x7e')](_0x353b78);}return db['User']['findAndCountAll'](_0x19effb);})[_0xd372('0x12')](function(_0x1ada74){_0xf7cef4[_0xd372('0x9')]=_0x1ada74['count'];_0x319a58=_0x1ada74[_0xd372('0x7f')];return getRealtimeAgents();})[_0xd372('0x12')](function(_0x2ab5b0){_0x4a3b94=_0x2ab5b0[_0xd372('0x7f')];return _0x319a58['map'](function(_0xf40b4a){var _0x1fbfda=_[_0xd372('0x36')](_0x4a3b94,['id',_0xf40b4a['id']]);if(_0x1fbfda)_[_0xd372('0x80')](_0xf40b4a,_['pick'](_['omit'](_0x1fbfda,_0x4b0580),_0x428f21));_0xf40b4a[_0xd372('0x81')]=getAgentStatus(_0xf40b4a);return _0xf40b4a;});})[_0xd372('0x12')](function(_0x28c63d){if(_0x341471[_0xd372('0x76')][_0xd372('0x82')]){var _0x40d4f6=_[_0xd372('0x4d')](_0x28c63d,['globalStatus',_0x341471[_0xd372('0x76')][_0xd372('0x82')]]);if(_0x341471['query']['pauseTypeFilter']){_0x40d4f6=_[_0xd372('0x4d')](_0x40d4f6,[_0xd372('0x59'),_0x341471[_0xd372('0x76')]['pauseTypeFilter']]);}}_0xf7cef4['rows']=_0x40d4f6||_0x28c63d;return _0xf7cef4;})[_0xd372('0x12')](respondWithFilteredResult(_0x196c31,_0x19effb))[_0xd372('0x18')](handleError(_0x196c31,null));};exports['getQueues']=function(_0x3a1dc8,_0x459e69){var _0x2e0674=[_0xd372('0x83'),_0xd372('0x84'),'sms','openchannel',_0xd372('0x85'),_0xd372('0x86'),_0xd372('0x14')];var _0x247434={'count':0x0,'rows':[]},_0x3e9b6e={},_0x1535d1,_0x108bd3,_0x1c456c,_0x531281,_0x475b88;Promise['resolve']()['then'](function(){if(_0x3a1dc8[_0xd372('0x76')][_0xd372('0x87')]){if(!_[_0xd372('0x88')](_0x2e0674,_0x3a1dc8[_0xd372('0x76')]['channel']['toLowerCase']()))throw new Error(_0xd372('0x89'));_0x1535d1=_0x3a1dc8['query'][_0xd372('0x87')][_0xd372('0x8a')]();}var _0x4f0861=_['startCase'](_0x1535d1)+_0xd372('0x8b');var _0x16f2fe=_[_0xd372('0x30')](db[_0x4f0861][_0xd372('0x72')],function(_0x19a561){return{'name':_0x19a561[_0xd372('0x73')],'type':_0x19a561[_0xd372('0x74')]['key']};});_0x3e9b6e=qs['getOptions'](_0x16f2fe,_0x3a1dc8);if(_0x3a1dc8[_0xd372('0x79')][_0xd372('0x8c')]===_0xd372('0x79')){var _0x4c57b4={'params':{'id':_0x3a1dc8[_0xd372('0x79')][_0xd372('0x8d')]},'query':{'section':_0x1535d1===_0xd372('0x14')&&_0x3a1dc8[_0xd372('0x76')][_0xd372('0x74')]===_0xd372('0x35')?_0xd372('0x8e'):_[_0xd372('0x15')](_0x1535d1)+_0xd372('0x8f'),'type':_0x3a1dc8['query'][_0xd372('0x74')],'nolimit':!![],'sort':_0xd372('0xc'),'filter':_0x3a1dc8[_0xd372('0x76')]['filter']}};return db[_0xd372('0x7d')][_0xd372('0x7e')](_0x4c57b4);}return db[_0x4f0861][_0xd372('0x90')](_0x3e9b6e);})['then'](function(_0x2b157e){_0x247434[_0xd372('0x9')]=_0x2b157e[_0xd372('0x9')];_0x108bd3=_0x2b157e[_0xd372('0x7f')];return getRealtimeQueues(_0x3a1dc8,_0x1535d1);})[_0xd372('0x12')](function(_0x25c380){_0x531281=_0x25c380[_0xd372('0x7f')];return getRealtimeAgents();})['then'](function(_0x4bf0eb){_0x1c456c=_0x4bf0eb[_0xd372('0x7f')];if(_0x1535d1!=_0xd372('0x14'))return;return getRealtimeVoiceQueueChannels();})[_0xd372('0x12')](function(_0x31006a){_0x475b88=_0x31006a?_0x31006a[_0xd372('0x7f')]:[];return initializeQueues(_0x108bd3,_0x531281,_0x1535d1,_0x3a1dc8['query'][_0xd372('0x74')]);})['then'](function(_0x5b4035){var _0x2d69e6=_0x5b4035['map'](function(_0x2d203e){if(_0x1535d1===_0xd372('0x14'))return getVoiceQueueAgents(_0x2d203e,_0x108bd3,_0x1c456c,_0x475b88);else return getQueueAgents(_0x2d203e,_0x1c456c,_0x1535d1);});return Promise['all'](_0x2d69e6);})[_0xd372('0x12')](function(_0x1ba41a){_0x247434['rows']=_0x1ba41a;return _0x247434;})[_0xd372('0x12')](respondWithFilteredResult(_0x459e69,_0x3e9b6e))[_0xd372('0x18')](handleError(_0x459e69,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 8344519..4b10862 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3cb300,_0x14eeec){var _0x38848e=function(_0x3a49f6){while(--_0x3a49f6){_0x3cb300['push'](_0x3cb300['shift']());}};_0x38848e(++_0x14eeec);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x328196,_0x14bd89){var _0x9c5d77=function(_0x18da76){while(--_0x18da76){_0x328196['push'](_0x328196['shift']());}};_0x9c5d77(++_0x14bd89);}(_0xedd9,0xfc));var _0x9edd=function(_0x2ced3b,_0xe131cf){_0x2ced3b=_0x2ced3b-0x0;var _0xed9aed=_0xedd9[_0x2ced3b];return _0xed9aed;};'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 ebd7291..167d410 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 _0xcb41=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0xbb6273,_0x5dd3af){var _0x38365a=function(_0x48b307){while(--_0x48b307){_0xbb6273['push'](_0xbb6273['shift']());}};_0x38365a(++_0x5dd3af);}(_0xcb41,0x1df));var _0x1cb4=function(_0x1cf93a,_0x44c237){_0x1cf93a=_0x1cf93a-0x0;var _0x3e2ad7=_0xcb41[_0x1cf93a];return _0x3e2ad7;};'use strict';var Sequelize=require(_0x1cb4('0x0'));module[_0x1cb4('0x1')]={'state':{'type':Sequelize[_0x1cb4('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x1cb4('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x1cb4('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x1cb4('0x4')]},'ringtime':{'type':Sequelize[_0x1cb4('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x1cb4('0x3')]},'campaigntype':{'type':Sequelize[_0x1cb4('0x3')]},'membername':{'type':Sequelize[_0x1cb4('0x3')]}}; \ No newline at end of file +var _0xfb65=['DATE','STRING','exports','INTEGER'];(function(_0x162ae9,_0x80a632){var _0x4e1701=function(_0x2caea5){while(--_0x2caea5){_0x162ae9['push'](_0x162ae9['shift']());}};_0x4e1701(++_0x80a632);}(_0xfb65,0x82));var _0x5fb6=function(_0x37263c,_0x1aa946){_0x37263c=_0x37263c-0x0;var _0x5aacdb=_0xfb65[_0x37263c];return _0x5aacdb;};'use strict';var Sequelize=require('sequelize');module[_0x5fb6('0x0')]={'state':{'type':Sequelize[_0x5fb6('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x5fb6('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x5fb6('0x2')]},'responsetime':{'type':Sequelize[_0x5fb6('0x2')]},'ringtime':{'type':Sequelize[_0x5fb6('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x5fb6('0x3')]},'campaigntype':{'type':Sequelize[_0x5fb6('0x3')]},'membername':{'type':Sequelize[_0x5fb6('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 533529b..fd5ae28 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 _0x2384=['api','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util'];(function(_0xd34d3b,_0x52fc18){var _0x42d0b2=function(_0x13a635){while(--_0x13a635){_0xd34d3b['push'](_0xd34d3b['shift']());}};_0x42d0b2(++_0x52fc18);}(_0x2384,0x102));var _0x4238=function(_0x3b7e93,_0x2801c8){_0x3b7e93=_0x3b7e93-0x0;var _0x572544=_0x2384[_0x3b7e93];return _0x572544;};'use strict';var _=require(_0x4238('0x0'));var util=require(_0x4238('0x1'));var logger=require('../../config/logger')(_0x4238('0x2'));var moment=require('moment');var BPromise=require(_0x4238('0x3'));var rp=require(_0x4238('0x4'));var fs=require('fs');var path=require(_0x4238('0x5'));var rimraf=require(_0x4238('0x6'));var config=require(_0x4238('0x7'));var attributes=require(_0x4238('0x8'));module[_0x4238('0x9')]=function(_0x54e406,_0x1325d0){return _0x54e406[_0x4238('0xa')](_0x4238('0xb'),attributes,{'tableName':_0x4238('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6998=['report_agent_preview','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x4318ad,_0x206dca){var _0x7c3a43=function(_0x4a74d8){while(--_0x4a74d8){_0x4318ad['push'](_0x4318ad['shift']());}};_0x7c3a43(++_0x206dca);}(_0x6998,0x12d));var _0x8699=function(_0x119705,_0xba9427){_0x119705=_0x119705-0x0;var _0x2affc2=_0x6998[_0x119705];return _0x2affc2;};'use strict';var _=require(_0x8699('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8699('0x1'));var moment=require(_0x8699('0x2'));var BPromise=require(_0x8699('0x3'));var rp=require(_0x8699('0x4'));var fs=require('fs');var path=require(_0x8699('0x5'));var rimraf=require(_0x8699('0x6'));var config=require(_0x8699('0x7'));var attributes=require('./reportAgentPreview.attributes');module['exports']=function(_0x27e52f,_0x50affd){return _0x27e52f[_0x8699('0x8')]('ReportAgentPreview',attributes,{'tableName':_0x8699('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 1acc248..a58a399 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 _0xabf8=['request','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','then','info','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x11bbec,_0x5647b6){var _0x4647c2=function(_0x1711b0){while(--_0x1711b0){_0x11bbec['push'](_0x11bbec['shift']());}};_0x4647c2(++_0x5647b6);}(_0xabf8,0x1ba));var _0x8abf=function(_0x235224,_0x3ccb3e){_0x235224=_0x235224-0x0;var _0x279af6=_0xabf8[_0x235224];return _0x279af6;};'use strict';var _=require(_0x8abf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8abf('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8abf('0x2'));var db=require(_0x8abf('0x3'))['db'];var utils=require(_0x8abf('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x8abf('0x5'));var jayson=require(_0x8abf('0x6'));var client=jayson[_0x8abf('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5080e9,_0x4f8f93,_0x4e5dda){return new BPromise(function(_0x4a06dc,_0x38c75d){return client[_0x8abf('0x8')](_0x5080e9,_0x4e5dda)['then'](function(_0x57aff4){logger['info'](_0x8abf('0x9'),_0x4f8f93,'request\x20sent');logger[_0x8abf('0xa')](_0x8abf('0xb'),_0x4f8f93,_0x8abf('0xc'),JSON[_0x8abf('0xd')](_0x57aff4));if(_0x57aff4[_0x8abf('0xe')]){if(_0x57aff4[_0x8abf('0xe')][_0x8abf('0xf')]===0x1f4){logger[_0x8abf('0xe')](_0x8abf('0x9'),_0x4f8f93,_0x57aff4[_0x8abf('0xe')][_0x8abf('0x10')]);return _0x38c75d(_0x57aff4['error'][_0x8abf('0x10')]);}logger[_0x8abf('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x4f8f93,_0x57aff4[_0x8abf('0xe')][_0x8abf('0x10')]);return _0x4a06dc(_0x57aff4[_0x8abf('0xe')][_0x8abf('0x10')]);}else{logger['info'](_0x8abf('0x9'),_0x4f8f93,_0x8abf('0xc'));_0x4a06dc(_0x57aff4['result'][_0x8abf('0x10')]);}})['catch'](function(_0x4fadae){logger['error'](_0x8abf('0x9'),_0x4f8f93,_0x4fadae);_0x38c75d(_0x4fadae);});});}exports[_0x8abf('0x11')]=function(_0x4be867){var _0x316772=this;return new Promise(function(_0x3376ec,_0x3f85a2){return db[_0x8abf('0x12')][_0x8abf('0x13')](_0x4be867[_0x8abf('0x14')],{'raw':_0x4be867[_0x8abf('0x15')]?_0x4be867[_0x8abf('0x15')][_0x8abf('0x16')]===undefined?!![]:![]:!![]})[_0x8abf('0x17')](function(_0x12ff86){logger[_0x8abf('0x18')]('CreateReportAgentPreview',_0x4be867);logger[_0x8abf('0xa')](_0x8abf('0x11'),_0x4be867,JSON[_0x8abf('0xd')](_0x12ff86));_0x3376ec(_0x12ff86);})['catch'](function(_0x267632){logger[_0x8abf('0xe')](_0x8abf('0x11'),_0x267632[_0x8abf('0x10')],_0x4be867);_0x3f85a2(_0x316772['error'](0x1f4,_0x267632[_0x8abf('0x10')]));});});}; \ No newline at end of file +var _0x5c5f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','debug','request\x20sent','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','result','catch','ReportAgentPreview','create','body','options','raw','CreateReportAgentPreview','lodash','util'];(function(_0x2658b0,_0x2c7d75){var _0x1851dc=function(_0x18c687){while(--_0x18c687){_0x2658b0['push'](_0x2658b0['shift']());}};_0x1851dc(++_0x2c7d75);}(_0x5c5f,0xa6));var _0xf5c5=function(_0x16bb39,_0x293e15){_0x16bb39=_0x16bb39-0x0;var _0x3daba8=_0x5c5f[_0x16bb39];return _0x3daba8;};'use strict';var _=require(_0xf5c5('0x0'));var util=require(_0xf5c5('0x1'));var moment=require('moment');var BPromise=require(_0xf5c5('0x2'));var rs=require(_0xf5c5('0x3'));var fs=require('fs');var Redis=require(_0xf5c5('0x4'));var db=require(_0xf5c5('0x5'))['db'];var utils=require(_0xf5c5('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5c5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf5c5('0x8')][_0xf5c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ee169,_0x60022,_0x42cd27){return new BPromise(function(_0x129f7c,_0x7b8b80){return client[_0xf5c5('0xa')](_0x4ee169,_0x42cd27)[_0xf5c5('0xb')](function(_0x39750d){logger[_0xf5c5('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x60022,'request\x20sent');logger[_0xf5c5('0xd')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x60022,_0xf5c5('0xe'),JSON[_0xf5c5('0xf')](_0x39750d));if(_0x39750d[_0xf5c5('0x10')]){if(_0x39750d[_0xf5c5('0x10')][_0xf5c5('0x11')]===0x1f4){logger['error'](_0xf5c5('0x12'),_0x60022,_0x39750d[_0xf5c5('0x10')][_0xf5c5('0x13')]);return _0x7b8b80(_0x39750d[_0xf5c5('0x10')]['message']);}logger[_0xf5c5('0x10')](_0xf5c5('0x12'),_0x60022,_0x39750d[_0xf5c5('0x10')][_0xf5c5('0x13')]);return _0x129f7c(_0x39750d[_0xf5c5('0x10')][_0xf5c5('0x13')]);}else{logger[_0xf5c5('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x60022,_0xf5c5('0xe'));_0x129f7c(_0x39750d[_0xf5c5('0x14')][_0xf5c5('0x13')]);}})[_0xf5c5('0x15')](function(_0x2cb7f8){logger[_0xf5c5('0x10')](_0xf5c5('0x12'),_0x60022,_0x2cb7f8);_0x7b8b80(_0x2cb7f8);});});}exports['CreateReportAgentPreview']=function(_0x420128){var _0x5b82de=this;return new Promise(function(_0x158592,_0x54e900){return db[_0xf5c5('0x16')][_0xf5c5('0x17')](_0x420128[_0xf5c5('0x18')],{'raw':_0x420128[_0xf5c5('0x19')]?_0x420128[_0xf5c5('0x19')][_0xf5c5('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x16b5a3){logger[_0xf5c5('0xc')](_0xf5c5('0x1b'),_0x420128);logger[_0xf5c5('0xd')](_0xf5c5('0x1b'),_0x420128,JSON['stringify'](_0x16b5a3));_0x158592(_0x16b5a3);})[_0xf5c5('0x15')](function(_0x354229){logger[_0xf5c5('0x10')]('CreateReportAgentPreview',_0x354229['message'],_0x420128);_0x54e900(_0x5b82de['error'](0x1f4,_0x354229[_0xf5c5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index fe6e3c3..94eb110 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 _0x4a5a=['showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','put','/agents/:id/capacity','/telephones','telephones','/trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','chat','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id'];(function(_0x5914e0,_0x402557){var _0x44734c=function(_0x14cf24){while(--_0x14cf24){_0x5914e0['push'](_0x5914e0['shift']());}};_0x44734c(++_0x402557);}(_0x4a5a,0x14c));var _0xa4a5=function(_0x533415,_0x1cfa14){_0x533415=_0x533415-0x0;var _0x5d18d2=_0x4a5a[_0x533415];return _0x5d18d2;};'use strict';var multer=require(_0xa4a5('0x0'));var util=require(_0xa4a5('0x1'));var path=require(_0xa4a5('0x2'));var express=require(_0xa4a5('0x3'));var router=express[_0xa4a5('0x4')]();var auth=require(_0xa4a5('0x5'));var controller=require(_0xa4a5('0x6'));router[_0xa4a5('0x7')](_0xa4a5('0x8'),auth[_0xa4a5('0x9')](),controller[_0xa4a5('0xa')]);router[_0xa4a5('0x7')](_0xa4a5('0xb'),auth[_0xa4a5('0x9')](),controller['voiceChannelMixMonitor']);router['get']('/voice/channels/:uniqueid/stopmixmonitor',auth[_0xa4a5('0x9')](),controller[_0xa4a5('0xc')]);router[_0xa4a5('0x7')](_0xa4a5('0xd'),auth[_0xa4a5('0x9')](),controller[_0xa4a5('0xe')]);router[_0xa4a5('0x7')](_0xa4a5('0xf'),auth['isAuthenticated'](),controller[_0xa4a5('0x10')]);router[_0xa4a5('0x7')]('/mail/queues',auth[_0xa4a5('0x9')](),controller[_0xa4a5('0x11')]);router[_0xa4a5('0x7')](_0xa4a5('0x12'),auth[_0xa4a5('0x9')](),controller[_0xa4a5('0x13')]);router[_0xa4a5('0x7')](_0xa4a5('0x14'),auth[_0xa4a5('0x9')](),controller[_0xa4a5('0x15')]);router[_0xa4a5('0x7')](_0xa4a5('0x16'),auth[_0xa4a5('0x9')](),controller[_0xa4a5('0x17')]);router[_0xa4a5('0x7')](_0xa4a5('0x18'),auth['isAuthenticated'](),controller['whatsappQueues']);router['get'](_0xa4a5('0x19'),auth[_0xa4a5('0x9')](),controller[_0xa4a5('0x1a')]);router['get']('/voice/queues/preview/:id',auth[_0xa4a5('0x9')](),controller[_0xa4a5('0x1b')]);router['get'](_0xa4a5('0x1c'),auth['isAuthenticated'](),controller[_0xa4a5('0x1d')]);router[_0xa4a5('0x7')](_0xa4a5('0x1e'),auth[_0xa4a5('0x9')](),controller[_0xa4a5('0x1f')]);router[_0xa4a5('0x7')]('/voice/queues/channels/:uniqueid/hangup',auth[_0xa4a5('0x9')](),controller['voiceQueuesChannelHangup']);router[_0xa4a5('0x7')](_0xa4a5('0x20'),auth[_0xa4a5('0x9')](),controller['voiceQueuesChannelRedirect']);router[_0xa4a5('0x7')](_0xa4a5('0x21'),auth[_0xa4a5('0x9')](),controller[_0xa4a5('0x22')]);router['put'](_0xa4a5('0x21'),auth['isAuthenticated'](),controller[_0xa4a5('0x23')]);router[_0xa4a5('0x7')](_0xa4a5('0x24'),auth[_0xa4a5('0x9')](),controller[_0xa4a5('0x25')]);router[_0xa4a5('0x7')](_0xa4a5('0x26'),auth['isAuthenticated'](),controller[_0xa4a5('0x27')]);router[_0xa4a5('0x7')](_0xa4a5('0x28'),auth[_0xa4a5('0x9')](),controller[_0xa4a5('0x29')]);router[_0xa4a5('0x2a')](_0xa4a5('0x2b'),auth['isAuthenticated'](),controller['agentCapacity']);router[_0xa4a5('0x7')](_0xa4a5('0x2c'),auth['isAuthenticated'](),controller[_0xa4a5('0x2d')]);router[_0xa4a5('0x7')](_0xa4a5('0x2e'),auth[_0xa4a5('0x9')](),controller['trunks']);router[_0xa4a5('0x7')](_0xa4a5('0x2f'),auth[_0xa4a5('0x9')](),controller[_0xa4a5('0x30')]);router[_0xa4a5('0x7')](_0xa4a5('0x31'),auth[_0xa4a5('0x9')](),controller[_0xa4a5('0x32')]);router[_0xa4a5('0x7')](_0xa4a5('0x33'),auth[_0xa4a5('0x9')](),controller[_0xa4a5('0x34')]);router[_0xa4a5('0x7')](_0xa4a5('0x35'),auth[_0xa4a5('0x9')](),controller[_0xa4a5('0x36')]);router[_0xa4a5('0x7')]('/openchannel/queues/waitinginteractions',auth[_0xa4a5('0x9')](),controller['openchannelQueuesWaitingInteractions']);router['get'](_0xa4a5('0x37'),auth[_0xa4a5('0x9')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0xa4a5('0x7')](_0xa4a5('0x38'),auth['isAuthenticated'](),controller['smsQueuesWaitingInteractions']);router[_0xa4a5('0x7')](_0xa4a5('0x39'),auth[_0xa4a5('0x9')](),controller['whatsappQueuesWaitingInteractions']);router[_0xa4a5('0x7')]('/fax/queues/waitinginteractions',auth[_0xa4a5('0x9')](),controller[_0xa4a5('0x3a')]);router[_0xa4a5('0x3b')](_0xa4a5('0x3c'),auth['isAuthenticated'](),controller[_0xa4a5('0x3d')](_0xa4a5('0x3e')));router[_0xa4a5('0x7')](_0xa4a5('0x3f'),auth[_0xa4a5('0x9')](),controller['showMailQueues']);router['post']('/chat/queues/:id/notify',auth[_0xa4a5('0x9')](),controller['queueNotify'](_0xa4a5('0x40')));router['get'](_0xa4a5('0x41'),auth[_0xa4a5('0x9')](),controller[_0xa4a5('0x42')]);router[_0xa4a5('0x3b')]('/fax/queues/:id/notify',auth[_0xa4a5('0x9')](),controller[_0xa4a5('0x3d')](_0xa4a5('0x43')));router[_0xa4a5('0x7')](_0xa4a5('0x44'),auth[_0xa4a5('0x9')](),controller[_0xa4a5('0x45')]);router[_0xa4a5('0x3b')](_0xa4a5('0x46'),auth[_0xa4a5('0x9')](),controller[_0xa4a5('0x3d')](_0xa4a5('0x47')));router[_0xa4a5('0x7')]('/openchannel/queues/:id',auth['isAuthenticated'](),controller[_0xa4a5('0x48')]);router[_0xa4a5('0x3b')](_0xa4a5('0x49'),auth[_0xa4a5('0x9')](),controller['queueNotify'](_0xa4a5('0x4a')));router[_0xa4a5('0x3b')](_0xa4a5('0x4b'),auth['isAuthenticated'](),controller[_0xa4a5('0x3d')](_0xa4a5('0x4c')));router[_0xa4a5('0x7')](_0xa4a5('0x4d'),auth['isAuthenticated'](),controller[_0xa4a5('0x4e')]);router[_0xa4a5('0x7')](_0xa4a5('0x4f'),auth[_0xa4a5('0x9')](),controller[_0xa4a5('0x50')]);router['post']('/agents/:id/notify',auth[_0xa4a5('0x9')](),controller[_0xa4a5('0x51')]);module['exports']=router; \ No newline at end of file +var _0x08dc=['faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','chat','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showWhatsappQueues','agentNotify','exports','multer','path','express','Router','../../components/auth/service','get','/voice/channels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','/agents','agents','/telephones','telephones','/trunks','trunks','/campaigns'];(function(_0x348b7b,_0x23b9a3){var _0x4323a5=function(_0x287d89){while(--_0x287d89){_0x348b7b['push'](_0x348b7b['shift']());}};_0x4323a5(++_0x23b9a3);}(_0x08dc,0x189));var _0xc08d=function(_0x148c0d,_0x9566c9){_0x148c0d=_0x148c0d-0x0;var _0x4e22e9=_0x08dc[_0x148c0d];return _0x4e22e9;};'use strict';var multer=require(_0xc08d('0x0'));var util=require('util');var path=require(_0xc08d('0x1'));var express=require(_0xc08d('0x2'));var router=express[_0xc08d('0x3')]();var auth=require(_0xc08d('0x4'));var controller=require('./rpc.controller');router[_0xc08d('0x5')](_0xc08d('0x6'),auth['isAuthenticated'](),controller['voiceChannels']);router['get'](_0xc08d('0x7'),auth[_0xc08d('0x8')](),controller['voiceChannelMixMonitor']);router[_0xc08d('0x5')](_0xc08d('0x9'),auth['isAuthenticated'](),controller[_0xc08d('0xa')]);router[_0xc08d('0x5')]('/voice/queues',auth[_0xc08d('0x8')](),controller[_0xc08d('0xb')]);router[_0xc08d('0x5')](_0xc08d('0xc'),auth[_0xc08d('0x8')](),controller['chatQueues']);router[_0xc08d('0x5')](_0xc08d('0xd'),auth[_0xc08d('0x8')](),controller[_0xc08d('0xe')]);router[_0xc08d('0x5')](_0xc08d('0xf'),auth['isAuthenticated'](),controller[_0xc08d('0x10')]);router[_0xc08d('0x5')](_0xc08d('0x11'),auth[_0xc08d('0x8')](),controller[_0xc08d('0x12')]);router['get'](_0xc08d('0x13'),auth[_0xc08d('0x8')](),controller[_0xc08d('0x14')]);router['get'](_0xc08d('0x15'),auth['isAuthenticated'](),controller[_0xc08d('0x16')]);router['get']('/fax/queues',auth[_0xc08d('0x8')](),controller[_0xc08d('0x17')]);router[_0xc08d('0x5')](_0xc08d('0x18'),auth['isAuthenticated'](),controller[_0xc08d('0x19')]);router[_0xc08d('0x5')]('/voice/queues/channels',auth[_0xc08d('0x8')](),controller[_0xc08d('0x1a')]);router['get'](_0xc08d('0x1b'),auth[_0xc08d('0x8')](),controller[_0xc08d('0x1c')]);router['get']('/voice/queues/channels/:uniqueid/hangup',auth[_0xc08d('0x8')](),controller[_0xc08d('0x1d')]);router[_0xc08d('0x5')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0xc08d('0x8')](),controller[_0xc08d('0x1e')]);router[_0xc08d('0x5')](_0xc08d('0x1f'),auth[_0xc08d('0x8')](),controller[_0xc08d('0x20')]);router[_0xc08d('0x21')](_0xc08d('0x1f'),auth[_0xc08d('0x8')](),controller[_0xc08d('0x22')]);router['get'](_0xc08d('0x23'),auth['isAuthenticated'](),controller[_0xc08d('0x24')]);router[_0xc08d('0x5')](_0xc08d('0x25'),auth[_0xc08d('0x8')](),controller['outboundChannels']);router[_0xc08d('0x5')](_0xc08d('0x26'),auth[_0xc08d('0x8')](),controller[_0xc08d('0x27')]);router[_0xc08d('0x21')]('/agents/:id/capacity',auth[_0xc08d('0x8')](),controller['agentCapacity']);router['get'](_0xc08d('0x28'),auth[_0xc08d('0x8')](),controller[_0xc08d('0x29')]);router[_0xc08d('0x5')](_0xc08d('0x2a'),auth[_0xc08d('0x8')](),controller[_0xc08d('0x2b')]);router[_0xc08d('0x5')](_0xc08d('0x2c'),auth[_0xc08d('0x8')](),controller['campaigns']);router[_0xc08d('0x5')]('/fax/accounts',auth[_0xc08d('0x8')](),controller[_0xc08d('0x2d')]);router[_0xc08d('0x5')](_0xc08d('0x2e'),auth[_0xc08d('0x8')](),controller[_0xc08d('0x2f')]);router[_0xc08d('0x5')](_0xc08d('0x30'),auth[_0xc08d('0x8')](),controller['mailQueuesWaitingInteractions']);router[_0xc08d('0x5')]('/openchannel/queues/waitinginteractions',auth['isAuthenticated'](),controller['openchannelQueuesWaitingInteractions']);router[_0xc08d('0x5')](_0xc08d('0x31'),auth[_0xc08d('0x8')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0xc08d('0x5')](_0xc08d('0x32'),auth['isAuthenticated'](),controller[_0xc08d('0x33')]);router[_0xc08d('0x5')]('/whatsapp/queues/waitinginteractions',auth[_0xc08d('0x8')](),controller[_0xc08d('0x34')]);router[_0xc08d('0x5')](_0xc08d('0x35'),auth[_0xc08d('0x8')](),controller[_0xc08d('0x36')]);router[_0xc08d('0x37')]('/mail/queues/:id/notify',auth[_0xc08d('0x8')](),controller[_0xc08d('0x38')](_0xc08d('0x39')));router[_0xc08d('0x5')](_0xc08d('0x3a'),auth[_0xc08d('0x8')](),controller['showMailQueues']);router[_0xc08d('0x37')]('/chat/queues/:id/notify',auth[_0xc08d('0x8')](),controller['queueNotify'](_0xc08d('0x3b')));router[_0xc08d('0x5')](_0xc08d('0x3c'),auth[_0xc08d('0x8')](),controller[_0xc08d('0x3d')]);router[_0xc08d('0x37')]('/fax/queues/:id/notify',auth[_0xc08d('0x8')](),controller[_0xc08d('0x38')](_0xc08d('0x3e')));router[_0xc08d('0x5')](_0xc08d('0x3f'),auth['isAuthenticated'](),controller['showFaxQueues']);router[_0xc08d('0x37')]('/openchannel/queues/:id/notify',auth[_0xc08d('0x8')](),controller[_0xc08d('0x38')]('openchannel'));router['get']('/openchannel/queues/:id',auth[_0xc08d('0x8')](),controller[_0xc08d('0x40')]);router[_0xc08d('0x37')](_0xc08d('0x41'),auth[_0xc08d('0x8')](),controller['queueNotify'](_0xc08d('0x42')));router[_0xc08d('0x37')](_0xc08d('0x43'),auth['isAuthenticated'](),controller[_0xc08d('0x38')](_0xc08d('0x44')));router[_0xc08d('0x5')](_0xc08d('0x45'),auth[_0xc08d('0x8')](),controller['showSmsQueues']);router['get']('/whatsapp/queues/:id',auth[_0xc08d('0x8')](),controller[_0xc08d('0x46')]);router[_0xc08d('0x37')]('/agents/:id/notify',auth[_0xc08d('0x8')](),controller[_0xc08d('0x47')]);module[_0xc08d('0x48')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 8fc9d57..f367f0b 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 _0x425d=['http','request','then','error','code','message','result','catch','status','sendStatus','stack','name','isNil','rows','find','query','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outboundChannels','agents','Agents','agentCapacity','body','interaction','user','MemberReport','length','format','updateAttributes','findOrCreate','INTERACTION','interface','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','Telephones','trunks','campaigns','Campaigns','ChatQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','Message','messageId','Interaction','\x20Message\x20not\x20found','MessageId','InteractionId','From','QueueId','TransferReport','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','User','update','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client'];(function(_0x485f95,_0x174b92){var _0x4254f0=function(_0x5bee28){while(--_0x5bee28){_0x485f95['push'](_0x485f95['shift']());}};_0x4254f0(++_0x174b92);}(_0x425d,0x1e0));var _0xd425=function(_0x23c251,_0x1c4342){_0x23c251=_0x23c251-0x0;var _0x1b2097=_0x425d[_0x23c251];return _0x1b2097;};'use strict';var BPromise=require(_0xd425('0x0'));var moment=require('moment');var _=require(_0xd425('0x1'));var util=require(_0xd425('0x2'));var db=require(_0xd425('0x3'))['db'];var logger=require(_0xd425('0x4'))(_0xd425('0x5'));var jayson=require(_0xd425('0x6'));var amiClient=jayson[_0xd425('0x7')]['http']({'port':0x232a});var mailClient=jayson[_0xd425('0x7')][_0xd425('0x8')]({'port':0x232b});var routingClient=jayson[_0xd425('0x7')][_0xd425('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x1d97d9,_0x1d2ed0,_0x50b061){return new BPromise(function(_0xb6ba8e,_0x374c3d){var _0x262b02=_0x50b061?_0x50b061:amiClient;return _0x262b02[_0xd425('0x9')](_0x1d97d9,_0x1d2ed0)[_0xd425('0xa')](function(_0x2beb20){if(_0x2beb20[_0xd425('0xb')]){if(_0x2beb20[_0xd425('0xb')][_0xd425('0xc')]===0x1f4){return _0x374c3d(_0x2beb20[_0xd425('0xb')][_0xd425('0xd')]);}return _0xb6ba8e(_0x2beb20[_0xd425('0xb')][_0xd425('0xd')]);}else{_0xb6ba8e(_0x2beb20[_0xd425('0xe')]);}})[_0xd425('0xf')](function(_0x2385a5){_0x374c3d(_0x2385a5);});});}function respondWithResult(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xc8;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x10')](_0x3cacf7)['json'](_0x3b5de8);}return _0x9bb611[_0xd425('0x11')](0x194);};}function handleError(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0x1f4;return function(_0x5d3d60){logger[_0xd425('0xb')](_0x5d3d60[_0xd425('0x12')]);if(_0x5d3d60[_0xd425('0x13')]){delete _0x5d3d60[_0xd425('0x13')];}_0x17a498[_0xd425('0x10')](_0x336dc3)['send'](_0x5d3d60);};}function findById(_0x278626){return function(_0x471267){if(!_[_0xd425('0x14')](_0x278626)&&!_[_0xd425('0x14')](_0x471267)&&!_['isNil'](_0x471267[_0xd425('0x15')])){return _[_0xd425('0x16')](_0x471267[_0xd425('0x15')],function(_0x1155bc){return _0x1155bc['id']==_0x278626;});}return null;};}exports['voiceChannels']=function(_0x58a0c1,_0x5debc3){return respondWithRpcPromise('VoiceChannels',_0x58a0c1[_0xd425('0x17')])[_0xd425('0xa')](respondWithResult(_0x5debc3,null))[_0xd425('0xf')](handleError(_0x5debc3,null));};exports['voiceChannelMixMonitor']=function(_0x355af0,_0x7e982e){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xd425('0x18')](_0x355af0[_0xd425('0x17')],_0x355af0[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x7e982e,null))[_0xd425('0xf')](handleError(_0x7e982e,null));};exports[_0xd425('0x1a')]=function(_0x2480a0,_0x3500bb){return respondWithRpcPromise(_0xd425('0x1b'),_[_0xd425('0x18')](_0x2480a0[_0xd425('0x17')],_0x2480a0[_0xd425('0x19')]))['then'](respondWithResult(_0x3500bb,null))[_0xd425('0xf')](handleError(_0x3500bb,null));};exports[_0xd425('0x1c')]=function(_0x398985,_0x1908a5){return respondWithRpcPromise(_0xd425('0x1d'),_0x398985[_0xd425('0x17')])[_0xd425('0xa')](respondWithResult(_0x1908a5,null))['catch'](handleError(_0x1908a5,null));};exports[_0xd425('0x1e')]=function(_0x177de2,_0x1d8861){return respondWithRpcPromise('VoiceQueues',_0x177de2[_0xd425('0x17')])[_0xd425('0xa')](findById(_0x177de2[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x1d8861,null))[_0xd425('0xf')](handleError(_0x1d8861,null));};exports[_0xd425('0x1f')]=function(_0x2fd17a,_0x37b63c){return respondWithRpcPromise(_0xd425('0x20'),_[_0xd425('0x18')](_0x2fd17a['body'],_0x2fd17a[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x37b63c,null))[_0xd425('0xf')](handleError(_0x37b63c,null));};exports[_0xd425('0x21')]=function(_0x3275b1,_0x1abf33){return respondWithRpcPromise(_0xd425('0x22'),_[_0xd425('0x18')](_0x3275b1[_0xd425('0x17')],_0x3275b1[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x1abf33,null))['catch'](handleError(_0x1abf33,null));};exports[_0xd425('0x23')]=function(_0x2a2a9b,_0x3120a4){return respondWithRpcPromise(_0xd425('0x24'),_0x2a2a9b[_0xd425('0x17')])['then'](respondWithResult(_0x3120a4,null))[_0xd425('0xf')](handleError(_0x3120a4,null));};exports[_0xd425('0x25')]=function(_0x4cfcd1,_0x574962){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xd425('0x18')](_0x4cfcd1[_0xd425('0x17')],_0x4cfcd1[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x574962,null))['catch'](handleError(_0x574962,null));};exports[_0xd425('0x26')]=function(_0x1d4414,_0x30a9dc){return respondWithRpcPromise(_0xd425('0x27'),_[_0xd425('0x18')](_0x1d4414[_0xd425('0x17')],_0x1d4414[_0xd425('0x19')]))['then'](respondWithResult(_0x30a9dc,null))[_0xd425('0xf')](handleError(_0x30a9dc,null));};exports['voiceQueuesChannelRedirect']=function(_0x22df81,_0x29cca9){return respondWithRpcPromise(_0xd425('0x28'),_['merge'](_0x22df81[_0xd425('0x17')],_0x22df81[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x29cca9,null))[_0xd425('0xf')](handleError(_0x29cca9,null));};exports['outbound']=function(_0x1d38fa,_0x3cf540){return respondWithRpcPromise('Outbound',_0x1d38fa['query'])['then'](respondWithResult(_0x3cf540,null))[_0xd425('0xf')](handleError(_0x3cf540,null));};exports[_0xd425('0x29')]=function(_0x1f30c1,_0x588688){return respondWithRpcPromise('OutboundChannels',_0x1f30c1['query'])[_0xd425('0xa')](respondWithResult(_0x588688,null))[_0xd425('0xf')](handleError(_0x588688,null));};exports[_0xd425('0x2a')]=function(_0x1d5017,_0xa9fd7c){var _0x14f3be;return respondWithRpcPromise(_0xd425('0x2b'),_0x1d5017['query'])[_0xd425('0xa')](function(_0x3c88a8){_0x14f3be=_0x3c88a8;return respondWithRpcPromise(_0xd425('0x2b'),_0x1d5017['query'],routingClient);})[_0xd425('0xa')](function(_0x2dffc7){return _[_0xd425('0x18')]({},_0x2dffc7,_0x14f3be);})['then'](respondWithResult(_0xa9fd7c,null))[_0xd425('0xf')](handleError(_0xa9fd7c,null));};exports[_0xd425('0x2c')]=function(_0x1c5ba6,_0x2d7a2f){if(_0x1c5ba6['body']&&_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')]&&_0x1c5ba6[_0xd425('0x2f')]&&_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x13')]){for(var _0x2f6bf7 in _0x1c5ba6[_0xd425('0x2d')]['interaction']){if(_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')]['hasOwnProperty'](_0x2f6bf7)){db[_0xd425('0x30')]['findAll']({'where':{'channel':_0x2f6bf7,'membername':_0x1c5ba6['user'][_0xd425('0x13')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x1c5ba6[_0xd425('0x2d')]['interaction'][_0x2f6bf7]&&_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')][_0x2f6bf7][_0xd425('0x31')]?{'$notIn':_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')][_0x2f6bf7]}:{'$ne':null}}})['then'](function(_0x2e4b21){var _0x5f3cfd=moment()[_0xd425('0x32')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x78ed9b=0x0,_0x16f61c=_0x2e4b21[_0xd425('0x31')];_0x78ed9b<_0x16f61c;_0x78ed9b+=0x1){_0x2e4b21[_0x78ed9b][_0xd425('0x33')]({'exitAt':_0x5f3cfd});}});for(var _0x624543=0x0;_0x624543<_0x1c5ba6['body'][_0xd425('0x2e')][_0x2f6bf7][_0xd425('0x31')];_0x624543+=0x1){db[_0xd425('0x30')][_0xd425('0x34')]({'where':{'channel':_0x2f6bf7,'membername':_0x1c5ba6[_0xd425('0x2f')]['name'],'type':_0xd425('0x35'),'uniqueid':_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')][_0x2f6bf7][_0x624543],'exitAt':null},'defaults':{'channel':_0x2f6bf7,'membername':_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x13')],'interface':_[_0xd425('0x14')](_0x1c5ba6['user'][_0xd425('0x36')])?util[_0xd425('0x32')]('SIP/%s',_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x13')]):_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x36')],'type':'INTERACTION','enterAt':moment()[_0xd425('0x32')](_0xd425('0x37')),'role':_0xd425('0x38'),'internal':_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x39')],'uniqueid':_0x1c5ba6['body']['interaction'][_0x2f6bf7][_0x624543]}});}}}}return respondWithRpcPromise(_0xd425('0x3a'),{'id':_0x1c5ba6['params']['id'],'capacity':_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x3b')]},routingClient)['then'](respondWithResult(_0x2d7a2f,null))[_0xd425('0xf')](handleError(_0x2d7a2f,null));};exports['telephones']=function(_0x48d5b8,_0x39f588){return respondWithRpcPromise(_0xd425('0x3c'),_0x48d5b8[_0xd425('0x17')])[_0xd425('0xa')](respondWithResult(_0x39f588,null))[_0xd425('0xf')](handleError(_0x39f588,null));};exports[_0xd425('0x3d')]=function(_0xeb3586,_0x4118fe){return respondWithRpcPromise('Trunks',_0xeb3586[_0xd425('0x17')])[_0xd425('0xa')](respondWithResult(_0x4118fe,null))[_0xd425('0xf')](handleError(_0x4118fe,null));};exports[_0xd425('0x3e')]=function(_0x7b1080,_0x1c80c2){return respondWithRpcPromise(_0xd425('0x3f'),_0x7b1080[_0xd425('0x17')])['then'](respondWithResult(_0x1c80c2,null))['catch'](handleError(_0x1c80c2,null));};exports['chatQueues']=function(_0x145e76,_0x2c5d01){return respondWithRpcPromise(_0xd425('0x40'),_0x145e76[_0xd425('0x17')],routingClient)['then'](respondWithResult(_0x2c5d01,null))['catch'](handleError(_0x2c5d01,null));};exports['showChatQueues']=function(_0x5e1294,_0x254b8b){return respondWithRpcPromise(_0xd425('0x40'),_0x5e1294['query'],routingClient)[_0xd425('0xa')](findById(_0x5e1294[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x254b8b,null))['catch'](handleError(_0x254b8b,null));};exports['mailQueues']=function(_0x599cb5,_0x49d75e){return respondWithRpcPromise('MailQueues',_0x599cb5['query'],routingClient)[_0xd425('0xa')](respondWithResult(_0x49d75e,null))[_0xd425('0xf')](handleError(_0x49d75e,null));};exports[_0xd425('0x41')]=function(_0x5b2323,_0x3395d8){return respondWithRpcPromise('MailQueues',_0x5b2323[_0xd425('0x17')],routingClient)[_0xd425('0xa')](findById(_0x5b2323[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x3395d8,null))[_0xd425('0xf')](handleError(_0x3395d8,null));};exports[_0xd425('0x42')]=function(_0xa21f7c,_0x3ca6a6){return respondWithRpcPromise(_0xd425('0x43'),_0xa21f7c['query'],mailClient)[_0xd425('0xa')](respondWithResult(_0x3ca6a6,null))[_0xd425('0xf')](handleError(_0x3ca6a6,null));};exports[_0xd425('0x44')]=function(_0xf22906,_0x5c4df8){return respondWithRpcPromise('OpenchannelQueues',_0xf22906[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x5c4df8,null))[_0xd425('0xf')](handleError(_0x5c4df8,null));};exports[_0xd425('0x45')]=function(_0x464ed1,_0x2e0f00){return respondWithRpcPromise(_0xd425('0x46'),_0x464ed1[_0xd425('0x17')],routingClient)[_0xd425('0xa')](findById(_0x464ed1[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x2e0f00,null))[_0xd425('0xf')](handleError(_0x2e0f00,null));};exports[_0xd425('0x47')]=function(_0x28979e,_0x5e72db){return respondWithRpcPromise(_0xd425('0x48'),_0x28979e[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x5e72db,null))['catch'](handleError(_0x5e72db,null));};exports['showSmsQueues']=function(_0x5ade1a,_0x403cb3){return respondWithRpcPromise(_0xd425('0x48'),_0x5ade1a[_0xd425('0x17')],routingClient)['then'](findById(_0x5ade1a[_0xd425('0x19')]['id']))['then'](respondWithResult(_0x403cb3,null))[_0xd425('0xf')](handleError(_0x403cb3,null));};exports[_0xd425('0x49')]=function(_0x21d26e,_0x5113fc){return respondWithRpcPromise(_0xd425('0x4a'),_0x21d26e[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x5113fc,null))[_0xd425('0xf')](handleError(_0x5113fc,null));};exports[_0xd425('0x4b')]=function(_0x43b1a9,_0x38a762){return respondWithRpcPromise(_0xd425('0x4a'),_0x43b1a9[_0xd425('0x17')],routingClient)[_0xd425('0xa')](findById(_0x43b1a9[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x38a762,null))[_0xd425('0xf')](handleError(_0x38a762,null));};exports[_0xd425('0x4c')]=function(_0x445f98,_0x443126){return respondWithRpcPromise(_0xd425('0x4d'),_0x445f98[_0xd425('0x17')],routingClient)['then'](respondWithResult(_0x443126,null))['catch'](handleError(_0x443126,null));};exports[_0xd425('0x4e')]=function(_0x5c333a,_0x135048){return respondWithRpcPromise(_0xd425('0x4d'),_0x5c333a[_0xd425('0x17')],routingClient)[_0xd425('0xa')](findById(_0x5c333a['params']['id']))[_0xd425('0xa')](respondWithResult(_0x135048,null))[_0xd425('0xf')](handleError(_0x135048,null));};exports[_0xd425('0x4f')]=function(_0x689332,_0x2536bd){return respondWithRpcPromise(_0xd425('0x50'),_0x689332['query'])['then'](respondWithResult(_0x2536bd,null))[_0xd425('0xf')](handleError(_0x2536bd,null));};exports[_0xd425('0x51')]=function(_0x5e76f5,_0x174081){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x5e76f5[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x174081,null))[_0xd425('0xf')](handleError(_0x174081,null));};exports[_0xd425('0x52')]=function(_0x376134,_0x2514fa){return respondWithRpcPromise(_0xd425('0x53'),_0x376134['query'],routingClient)[_0xd425('0xa')](respondWithResult(_0x2514fa,null))[_0xd425('0xf')](handleError(_0x2514fa,null));};exports[_0xd425('0x54')]=function(_0x233efa,_0xfcba08){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x233efa[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0xfcba08,null))['catch'](handleError(_0xfcba08,null));};exports[_0xd425('0x55')]=function(_0x4599b0,_0x48bed3){return respondWithRpcPromise(_0xd425('0x56'),_0x4599b0[_0xd425('0x17')],routingClient)[_0xd425('0xa')](function(_0xd923bb){if(_0x4599b0[_0xd425('0x17')]['type']!==undefined){var _0x454cce=_(_0xd923bb['rows'])[_0xd425('0x57')]([_0x4599b0[_0xd425('0x17')]['type'],_0x4599b0[_0xd425('0x19')]['id']])[_0xd425('0x58')](_0xd425('0x59'))[_0xd425('0x5a')]()['value']();return _0xd923bb['rows'][_0xd425('0x57')](function(_0x2312c1){return _0x454cce[_0xd425('0x5b')](_0x2312c1['queue_id'])>-0x1;});}else{return _0xd923bb[_0xd425('0x15')][_0xd425('0x57')](function(_0x5b932c){return _0x5b932c[_0xd425('0x59')]===parseInt(_0x4599b0['params']['id']);});}})[_0xd425('0xa')](respondWithResult(_0x48bed3,null))[_0xd425('0xf')](handleError(_0x48bed3,null));};exports[_0xd425('0x5c')]=function(_0x2493e7,_0x5750dc){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2493e7[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x5750dc,null))['catch'](handleError(_0x5750dc,null));};exports[_0xd425('0x5d')]=function(_0x389099,_0x51c9ad){return respondWithRpcPromise(_0xd425('0x5e'),_0x389099[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x51c9ad,null))[_0xd425('0xf')](handleError(_0x51c9ad,null));};exports[_0xd425('0x5f')]=function(_0xf251e6,_0x302066){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0xf251e6['query'],routingClient)[_0xd425('0xa')](respondWithResult(_0x302066,null))['catch'](handleError(_0x302066,null));};exports[_0xd425('0x60')]=function(_0x236030){return function(_0x58cad5,_0x244789){var _0x1c1c77,_0x5dac05;var _0x592c40=_[_0xd425('0x61')](_0x236030);var _0x242ed8=_0x236030===_0xd425('0x62')?_0xd425('0x63'):_0xd425('0x64');return db[_0x592c40+_0xd425('0x65')][_0xd425('0x66')]({'raw':!![],'where':{'id':_0x58cad5[_0xd425('0x19')]['id']}})['then'](function(_0x2cff42){if(_[_0xd425('0x14')](_0x2cff42)){throw new Error(_0x592c40+'\x20Queue\x20not\x20found');}_0x1c1c77=_0x2cff42;return db[_0x592c40+_0xd425('0x67')][_0xd425('0x66')]({'where':{'id':_0x58cad5[_0xd425('0x2d')][_0xd425('0x68')]},'include':[{'model':db[_0x592c40+_0xd425('0x69')],'as':_0xd425('0x69')},{'model':db[_0x592c40+_0x242ed8],'as':_0xd425('0x64')}]});})[_0xd425('0xa')](function(_0x334062){if(_[_0xd425('0x14')](_0x334062)){throw new Error(_0x592c40+_0xd425('0x6a'));}_0x5dac05=_0x334062;return _0x334062['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xd425('0xa')](function(){var _0x498e81={'uniqueid':_0x236030+'.'+_0x5dac05['id']+'.'+_0x5dac05['Interaction']['id'],'FromUserId':_0x58cad5[_0xd425('0x2f')]['id'],'type':'queue'};_0x498e81[_0x592c40+_0xd425('0x6b')]=_0x5dac05['id'];_0x498e81[_0x592c40+_0xd425('0x6c')]=_0x5dac05[_0xd425('0x69')]['id'];_0x498e81[_0xd425('0x6d')+_0x592c40+_0x242ed8+'Id']=_0x5dac05[_0xd425('0x64')]['id'];_0x498e81['To'+_0x592c40+_0xd425('0x6e')]=_0x1c1c77['id'];return db[_0x592c40+_0xd425('0x6f')]['create'](_0x498e81);})[_0xd425('0xa')](function(){return respondWithRpcPromise(_0xd425('0x70'),{'channel':_0x236030,'interaction':_0x5dac05[_0xd425('0x69')],'message':_0x5dac05,'account':_0x5dac05[_0xd425('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd425('0x71'),'appdata':_0x1c1c77['name']+','+(_0x5dac05[_0xd425('0x64')][_0xd425('0x72')]||0x12c),'interval':_0xd425('0x73')}]},routingClient);})[_0xd425('0xa')](respondWithResult(_0x244789,null))[_0xd425('0xf')](handleError(_0x244789,null));};};exports[_0xd425('0x74')]=function(_0x409612,_0x4147eb){var _0x433e5d,_0x334226;if(_[_0xd425('0x14')](_0x409612[_0xd425('0x2d')]['channel'])){throw new Error(_0xd425('0x75'));}var _0x5d8a47=_0x409612[_0xd425('0x2d')][_0xd425('0x76')];var _0x1c03d6=_[_0xd425('0x61')](_0x5d8a47);var _0xf06395=_0x5d8a47==='chat'?_0xd425('0x63'):_0xd425('0x64');return db[_0xd425('0x77')][_0xd425('0x66')]({'raw':!![],'where':{'id':_0x409612[_0xd425('0x19')]['id'],'role':_0xd425('0x38')}})[_0xd425('0xa')](function(_0x568a83){if(_[_0xd425('0x14')](_0x568a83)){throw new Error('Agent\x20not\x20found');}_0x433e5d=_0x568a83;return db[_0x1c03d6+_0xd425('0x67')][_0xd425('0x66')]({'where':{'id':_0x409612['body'][_0xd425('0x68')]},'include':[{'model':db[_0x1c03d6+_0xd425('0x69')],'as':'Interaction'},{'model':db[_0x1c03d6+_0xf06395],'as':_0xd425('0x64')}]});})[_0xd425('0xa')](function(_0xca2955){if(_[_0xd425('0x14')](_0xca2955)){throw new Error(_0x1c03d6+_0xd425('0x6a'));}_0x334226=_0xca2955;return _0xca2955[_0xd425('0x78')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x3f1a48={'uniqueid':_0x5d8a47+'.'+_0x334226['id']+'.'+_0x334226['Interaction']['id'],'FromUserId':_0x409612[_0xd425('0x2f')]['id'],'type':'queue','ToUserId':_0x433e5d['id']};_0x3f1a48[_0x1c03d6+_0xd425('0x6b')]=_0x334226['id'];_0x3f1a48[_0x1c03d6+_0xd425('0x6c')]=_0x334226[_0xd425('0x69')]['id'];_0x3f1a48[_0xd425('0x6d')+_0x1c03d6+_0xf06395+'Id']=_0x334226['Account']['id'];return db[_0x1c03d6+'TransferReport']['create'](_0x3f1a48);})['then'](function(){return respondWithRpcPromise(_0xd425('0x70'),{'channel':_0x5d8a47,'interaction':_0x334226['Interaction'],'message':_0x334226,'account':_0x334226[_0xd425('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd425('0x38'),'appdata':_0x433e5d[_0xd425('0x13')]+','+(_0x334226[_0xd425('0x64')][_0xd425('0x79')]||0x12c),'interval':_0xd425('0x73')}]},routingClient);})['then'](respondWithResult(_0x4147eb,null))[_0xd425('0xf')](handleError(_0x4147eb,null));}; \ No newline at end of file +var _0x207c=['moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','http','then','error','code','result','status','json','sendStatus','stack','name','isNil','rows','find','voiceChannels','VoiceChannels','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelRedirect','Outbound','outboundChannels','agents','Agents','interaction','user','hasOwnProperty','MemberReport','length','format','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','INTERACTION','interface','agent','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','showMailQueues','MailQueues','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','map','queue_id','value','filter','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','capitalize','chat','Account','Queue','findOne','Message','messageId','Interaction','queue','QueueId','TransferReport','create','Start','queueTransferTimeout','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','User','\x20Message\x20not\x20found','MessageId','From','*,*,*,*'];(function(_0x3d65b6,_0x3d906f){var _0x5b7be4=function(_0x59c934){while(--_0x59c934){_0x3d65b6['push'](_0x3d65b6['shift']());}};_0x5b7be4(++_0x3d906f);}(_0x207c,0x1e8));var _0xc207=function(_0x8ae98b,_0x155f88){_0x8ae98b=_0x8ae98b-0x0;var _0xc30bd4=_0x207c[_0x8ae98b];return _0xc30bd4;};'use strict';var BPromise=require('bluebird');var moment=require(_0xc207('0x0'));var _=require(_0xc207('0x1'));var util=require(_0xc207('0x2'));var db=require(_0xc207('0x3'))['db'];var logger=require(_0xc207('0x4'))(_0xc207('0x5'));var jayson=require(_0xc207('0x6'));var amiClient=jayson['client'][_0xc207('0x7')]({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson['client'][_0xc207('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x314561,_0x3395e4,_0x59ff6f){return new BPromise(function(_0x25cb97,_0xad159b){var _0x3c579f=_0x59ff6f?_0x59ff6f:amiClient;return _0x3c579f['request'](_0x314561,_0x3395e4)[_0xc207('0x8')](function(_0x817576){if(_0x817576[_0xc207('0x9')]){if(_0x817576[_0xc207('0x9')][_0xc207('0xa')]===0x1f4){return _0xad159b(_0x817576[_0xc207('0x9')]['message']);}return _0x25cb97(_0x817576['error']['message']);}else{_0x25cb97(_0x817576[_0xc207('0xb')]);}})['catch'](function(_0x2741f3){_0xad159b(_0x2741f3);});});}function respondWithResult(_0x2782ce,_0x59d401){_0x59d401=_0x59d401||0xc8;return function(_0x3e1108){if(_0x3e1108){return _0x2782ce[_0xc207('0xc')](_0x59d401)[_0xc207('0xd')](_0x3e1108);}return _0x2782ce[_0xc207('0xe')](0x194);};}function handleError(_0xe993a0,_0x51e967){_0x51e967=_0x51e967||0x1f4;return function(_0xc62672){logger[_0xc207('0x9')](_0xc62672[_0xc207('0xf')]);if(_0xc62672[_0xc207('0x10')]){delete _0xc62672['name'];}_0xe993a0['status'](_0x51e967)['send'](_0xc62672);};}function findById(_0x1cebfa){return function(_0x6e793d){if(!_[_0xc207('0x11')](_0x1cebfa)&&!_[_0xc207('0x11')](_0x6e793d)&&!_['isNil'](_0x6e793d[_0xc207('0x12')])){return _[_0xc207('0x13')](_0x6e793d[_0xc207('0x12')],function(_0x5f288e){return _0x5f288e['id']==_0x1cebfa;});}return null;};}exports[_0xc207('0x14')]=function(_0x488cc0,_0x42c8ba){return respondWithRpcPromise(_0xc207('0x15'),_0x488cc0[_0xc207('0x16')])[_0xc207('0x8')](respondWithResult(_0x42c8ba,null))[_0xc207('0x17')](handleError(_0x42c8ba,null));};exports[_0xc207('0x18')]=function(_0x35c0b0,_0x464dea){return respondWithRpcPromise(_0xc207('0x19'),_[_0xc207('0x1a')](_0x35c0b0[_0xc207('0x16')],_0x35c0b0[_0xc207('0x1b')]))[_0xc207('0x8')](respondWithResult(_0x464dea,null))['catch'](handleError(_0x464dea,null));};exports[_0xc207('0x1c')]=function(_0x5cda23,_0x2e89c5){return respondWithRpcPromise(_0xc207('0x1d'),_[_0xc207('0x1a')](_0x5cda23[_0xc207('0x16')],_0x5cda23[_0xc207('0x1b')]))[_0xc207('0x8')](respondWithResult(_0x2e89c5,null))[_0xc207('0x17')](handleError(_0x2e89c5,null));};exports[_0xc207('0x1e')]=function(_0xa52138,_0x2385f7){return respondWithRpcPromise(_0xc207('0x1f'),_0xa52138[_0xc207('0x16')])[_0xc207('0x8')](respondWithResult(_0x2385f7,null))[_0xc207('0x17')](handleError(_0x2385f7,null));};exports[_0xc207('0x20')]=function(_0x56a066,_0x1e1440){return respondWithRpcPromise('VoiceQueues',_0x56a066['query'])[_0xc207('0x8')](findById(_0x56a066[_0xc207('0x1b')]['id']))[_0xc207('0x8')](respondWithResult(_0x1e1440,null))[_0xc207('0x17')](handleError(_0x1e1440,null));};exports[_0xc207('0x21')]=function(_0x478af7,_0xe5e848){return respondWithRpcPromise(_0xc207('0x22'),_[_0xc207('0x1a')](_0x478af7[_0xc207('0x23')],_0x478af7[_0xc207('0x1b')]))[_0xc207('0x8')](respondWithResult(_0xe5e848,null))[_0xc207('0x17')](handleError(_0xe5e848,null));};exports[_0xc207('0x24')]=function(_0xc6a7ce,_0x3f79e8){return respondWithRpcPromise(_0xc207('0x25'),_[_0xc207('0x1a')](_0xc6a7ce[_0xc207('0x16')],_0xc6a7ce['params']))[_0xc207('0x8')](respondWithResult(_0x3f79e8,null))[_0xc207('0x17')](handleError(_0x3f79e8,null));};exports[_0xc207('0x26')]=function(_0x448df1,_0x24df00){return respondWithRpcPromise(_0xc207('0x27'),_0x448df1['query'])[_0xc207('0x8')](respondWithResult(_0x24df00,null))[_0xc207('0x17')](handleError(_0x24df00,null));};exports[_0xc207('0x28')]=function(_0x1d12fa,_0x58e906){return respondWithRpcPromise(_0xc207('0x29'),_[_0xc207('0x1a')](_0x1d12fa[_0xc207('0x16')],_0x1d12fa[_0xc207('0x1b')]))[_0xc207('0x8')](respondWithResult(_0x58e906,null))[_0xc207('0x17')](handleError(_0x58e906,null));};exports[_0xc207('0x2a')]=function(_0x458de9,_0x586776){return respondWithRpcPromise('VoiceQueuesChannelHangup',_['merge'](_0x458de9[_0xc207('0x16')],_0x458de9[_0xc207('0x1b')]))[_0xc207('0x8')](respondWithResult(_0x586776,null))[_0xc207('0x17')](handleError(_0x586776,null));};exports['voiceQueuesChannelRedirect']=function(_0x3bfbf4,_0x433c0f){return respondWithRpcPromise(_0xc207('0x2b'),_[_0xc207('0x1a')](_0x3bfbf4[_0xc207('0x16')],_0x3bfbf4['params']))[_0xc207('0x8')](respondWithResult(_0x433c0f,null))[_0xc207('0x17')](handleError(_0x433c0f,null));};exports['outbound']=function(_0x21dd42,_0x49bada){return respondWithRpcPromise(_0xc207('0x2c'),_0x21dd42[_0xc207('0x16')])['then'](respondWithResult(_0x49bada,null))[_0xc207('0x17')](handleError(_0x49bada,null));};exports[_0xc207('0x2d')]=function(_0x3313b1,_0x502dde){return respondWithRpcPromise('OutboundChannels',_0x3313b1[_0xc207('0x16')])[_0xc207('0x8')](respondWithResult(_0x502dde,null))[_0xc207('0x17')](handleError(_0x502dde,null));};exports[_0xc207('0x2e')]=function(_0x4c3e29,_0x3a6f45){var _0x47cdc4;return respondWithRpcPromise('Agents',_0x4c3e29['query'])['then'](function(_0x20cb64){_0x47cdc4=_0x20cb64;return respondWithRpcPromise(_0xc207('0x2f'),_0x4c3e29[_0xc207('0x16')],routingClient);})['then'](function(_0x1dd71e){return _[_0xc207('0x1a')]({},_0x1dd71e,_0x47cdc4);})[_0xc207('0x8')](respondWithResult(_0x3a6f45,null))[_0xc207('0x17')](handleError(_0x3a6f45,null));};exports['agentCapacity']=function(_0x47d43a,_0x223349){if(_0x47d43a[_0xc207('0x23')]&&_0x47d43a[_0xc207('0x23')][_0xc207('0x30')]&&_0x47d43a['user']&&_0x47d43a[_0xc207('0x31')][_0xc207('0x10')]){for(var _0x3a935a in _0x47d43a[_0xc207('0x23')][_0xc207('0x30')]){if(_0x47d43a[_0xc207('0x23')][_0xc207('0x30')][_0xc207('0x32')](_0x3a935a)){db[_0xc207('0x33')]['findAll']({'where':{'channel':_0x3a935a,'membername':_0x47d43a[_0xc207('0x31')][_0xc207('0x10')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x47d43a[_0xc207('0x23')][_0xc207('0x30')][_0x3a935a]&&_0x47d43a[_0xc207('0x23')][_0xc207('0x30')][_0x3a935a][_0xc207('0x34')]?{'$notIn':_0x47d43a['body'][_0xc207('0x30')][_0x3a935a]}:{'$ne':null}}})[_0xc207('0x8')](function(_0x17da25){var _0x5b50cf=moment()[_0xc207('0x35')](_0xc207('0x36'));for(var _0x2967ad=0x0,_0x45536e=_0x17da25['length'];_0x2967ad<_0x45536e;_0x2967ad+=0x1){_0x17da25[_0x2967ad]['updateAttributes']({'exitAt':_0x5b50cf});}});for(var _0x11ce5a=0x0;_0x11ce5a<_0x47d43a[_0xc207('0x23')][_0xc207('0x30')][_0x3a935a][_0xc207('0x34')];_0x11ce5a+=0x1){db[_0xc207('0x33')][_0xc207('0x37')]({'where':{'channel':_0x3a935a,'membername':_0x47d43a[_0xc207('0x31')][_0xc207('0x10')],'type':_0xc207('0x38'),'uniqueid':_0x47d43a[_0xc207('0x23')][_0xc207('0x30')][_0x3a935a][_0x11ce5a],'exitAt':null},'defaults':{'channel':_0x3a935a,'membername':_0x47d43a[_0xc207('0x31')]['name'],'interface':_['isNil'](_0x47d43a[_0xc207('0x31')][_0xc207('0x39')])?util[_0xc207('0x35')]('SIP/%s',_0x47d43a[_0xc207('0x31')][_0xc207('0x10')]):_0x47d43a[_0xc207('0x31')][_0xc207('0x39')],'type':'INTERACTION','enterAt':moment()[_0xc207('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xc207('0x3a'),'internal':_0x47d43a['user']['internal'],'uniqueid':_0x47d43a[_0xc207('0x23')][_0xc207('0x30')][_0x3a935a][_0x11ce5a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x47d43a['params']['id'],'capacity':_0x47d43a['body'][_0xc207('0x3b')]},routingClient)[_0xc207('0x8')](respondWithResult(_0x223349,null))[_0xc207('0x17')](handleError(_0x223349,null));};exports[_0xc207('0x3c')]=function(_0x173acf,_0x35e967){return respondWithRpcPromise(_0xc207('0x3d'),_0x173acf[_0xc207('0x16')])['then'](respondWithResult(_0x35e967,null))[_0xc207('0x17')](handleError(_0x35e967,null));};exports[_0xc207('0x3e')]=function(_0x5aedd3,_0x55e0c5){return respondWithRpcPromise(_0xc207('0x3f'),_0x5aedd3['query'])['then'](respondWithResult(_0x55e0c5,null))[_0xc207('0x17')](handleError(_0x55e0c5,null));};exports[_0xc207('0x40')]=function(_0x356c8c,_0x3b2448){return respondWithRpcPromise(_0xc207('0x41'),_0x356c8c[_0xc207('0x16')])[_0xc207('0x8')](respondWithResult(_0x3b2448,null))[_0xc207('0x17')](handleError(_0x3b2448,null));};exports[_0xc207('0x42')]=function(_0x278717,_0x2fcfee){return respondWithRpcPromise('ChatQueues',_0x278717['query'],routingClient)[_0xc207('0x8')](respondWithResult(_0x2fcfee,null))[_0xc207('0x17')](handleError(_0x2fcfee,null));};exports[_0xc207('0x43')]=function(_0x313580,_0xaff7a0){return respondWithRpcPromise(_0xc207('0x44'),_0x313580[_0xc207('0x16')],routingClient)[_0xc207('0x8')](findById(_0x313580[_0xc207('0x1b')]['id']))['then'](respondWithResult(_0xaff7a0,null))[_0xc207('0x17')](handleError(_0xaff7a0,null));};exports[_0xc207('0x45')]=function(_0x19637d,_0x6d387e){return respondWithRpcPromise('MailQueues',_0x19637d[_0xc207('0x16')],routingClient)[_0xc207('0x8')](respondWithResult(_0x6d387e,null))[_0xc207('0x17')](handleError(_0x6d387e,null));};exports[_0xc207('0x46')]=function(_0x464263,_0x45ad58){return respondWithRpcPromise(_0xc207('0x47'),_0x464263['query'],routingClient)[_0xc207('0x8')](findById(_0x464263[_0xc207('0x1b')]['id']))[_0xc207('0x8')](respondWithResult(_0x45ad58,null))[_0xc207('0x17')](handleError(_0x45ad58,null));};exports['mailAccounts']=function(_0xc7812,_0x4f4b58){return respondWithRpcPromise('MailAccounts',_0xc7812[_0xc207('0x16')],mailClient)[_0xc207('0x8')](respondWithResult(_0x4f4b58,null))[_0xc207('0x17')](handleError(_0x4f4b58,null));};exports[_0xc207('0x48')]=function(_0x441d5f,_0x3b1b4c){return respondWithRpcPromise(_0xc207('0x49'),_0x441d5f[_0xc207('0x16')],routingClient)[_0xc207('0x8')](respondWithResult(_0x3b1b4c,null))[_0xc207('0x17')](handleError(_0x3b1b4c,null));};exports[_0xc207('0x4a')]=function(_0x2f97bf,_0x416e85){return respondWithRpcPromise(_0xc207('0x49'),_0x2f97bf[_0xc207('0x16')],routingClient)['then'](findById(_0x2f97bf[_0xc207('0x1b')]['id']))['then'](respondWithResult(_0x416e85,null))[_0xc207('0x17')](handleError(_0x416e85,null));};exports[_0xc207('0x4b')]=function(_0x2ade23,_0x52dec1){return respondWithRpcPromise('SmsQueues',_0x2ade23[_0xc207('0x16')],routingClient)[_0xc207('0x8')](respondWithResult(_0x52dec1,null))[_0xc207('0x17')](handleError(_0x52dec1,null));};exports['showSmsQueues']=function(_0x31182c,_0x1cefa3){return respondWithRpcPromise(_0xc207('0x4c'),_0x31182c['query'],routingClient)['then'](findById(_0x31182c[_0xc207('0x1b')]['id']))['then'](respondWithResult(_0x1cefa3,null))[_0xc207('0x17')](handleError(_0x1cefa3,null));};exports[_0xc207('0x4d')]=function(_0x3cca53,_0x4b197){return respondWithRpcPromise(_0xc207('0x4e'),_0x3cca53[_0xc207('0x16')],routingClient)[_0xc207('0x8')](respondWithResult(_0x4b197,null))[_0xc207('0x17')](handleError(_0x4b197,null));};exports['showWhatsappQueues']=function(_0x289f7c,_0x85ecad){return respondWithRpcPromise(_0xc207('0x4e'),_0x289f7c[_0xc207('0x16')],routingClient)[_0xc207('0x8')](findById(_0x289f7c[_0xc207('0x1b')]['id']))[_0xc207('0x8')](respondWithResult(_0x85ecad,null))[_0xc207('0x17')](handleError(_0x85ecad,null));};exports[_0xc207('0x4f')]=function(_0x28f467,_0x203686){return respondWithRpcPromise('FaxQueues',_0x28f467[_0xc207('0x16')],routingClient)[_0xc207('0x8')](respondWithResult(_0x203686,null))[_0xc207('0x17')](handleError(_0x203686,null));};exports[_0xc207('0x50')]=function(_0x584a40,_0x586c41){return respondWithRpcPromise(_0xc207('0x51'),_0x584a40[_0xc207('0x16')],routingClient)[_0xc207('0x8')](findById(_0x584a40[_0xc207('0x1b')]['id']))['then'](respondWithResult(_0x586c41,null))[_0xc207('0x17')](handleError(_0x586c41,null));};exports[_0xc207('0x52')]=function(_0x440fc2,_0x5a04d5){return respondWithRpcPromise(_0xc207('0x53'),_0x440fc2[_0xc207('0x16')])[_0xc207('0x8')](respondWithResult(_0x5a04d5,null))['catch'](handleError(_0x5a04d5,null));};exports[_0xc207('0x54')]=function(_0x488c1f,_0x1290e4){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x488c1f[_0xc207('0x16')],routingClient)[_0xc207('0x8')](respondWithResult(_0x1290e4,null))['catch'](handleError(_0x1290e4,null));};exports[_0xc207('0x55')]=function(_0x4c0ef0,_0x446fe8){return respondWithRpcPromise(_0xc207('0x56'),_0x4c0ef0[_0xc207('0x16')],routingClient)[_0xc207('0x8')](respondWithResult(_0x446fe8,null))[_0xc207('0x17')](handleError(_0x446fe8,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x4b9342,_0x3d1659){return respondWithRpcPromise(_0xc207('0x57'),_0x4b9342['query'],routingClient)[_0xc207('0x8')](respondWithResult(_0x3d1659,null))[_0xc207('0x17')](handleError(_0x3d1659,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x10ab93,_0x13954e){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x10ab93[_0xc207('0x16')],routingClient)[_0xc207('0x8')](function(_0x3748de){if(_0x10ab93[_0xc207('0x16')][_0xc207('0x58')]!==undefined){var _0xef037c=_(_0x3748de['rows'])['filter']([_0x10ab93[_0xc207('0x16')][_0xc207('0x58')],_0x10ab93[_0xc207('0x1b')]['id']])[_0xc207('0x59')](_0xc207('0x5a'))['uniq']()[_0xc207('0x5b')]();return _0x3748de['rows'][_0xc207('0x5c')](function(_0x97f43){return _0xef037c[_0xc207('0x5d')](_0x97f43[_0xc207('0x5a')])>-0x1;});}else{return _0x3748de[_0xc207('0x12')][_0xc207('0x5c')](function(_0x49ebe1){return _0x49ebe1[_0xc207('0x5a')]===parseInt(_0x10ab93[_0xc207('0x1b')]['id']);});}})['then'](respondWithResult(_0x13954e,null))[_0xc207('0x17')](handleError(_0x13954e,null));};exports[_0xc207('0x5e')]=function(_0x36e8b1,_0x3cb12d){return respondWithRpcPromise(_0xc207('0x5f'),_0x36e8b1[_0xc207('0x16')],routingClient)[_0xc207('0x8')](respondWithResult(_0x3cb12d,null))[_0xc207('0x17')](handleError(_0x3cb12d,null));};exports[_0xc207('0x60')]=function(_0x281c71,_0x473560){return respondWithRpcPromise(_0xc207('0x61'),_0x281c71[_0xc207('0x16')],routingClient)['then'](respondWithResult(_0x473560,null))[_0xc207('0x17')](handleError(_0x473560,null));};exports[_0xc207('0x62')]=function(_0x2f4efd,_0x266e65){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x2f4efd[_0xc207('0x16')],routingClient)['then'](respondWithResult(_0x266e65,null))[_0xc207('0x17')](handleError(_0x266e65,null));};exports['queueNotify']=function(_0x53cb21){return function(_0x2967e6,_0x220293){var _0x383f83,_0x3adfeb;var _0x20089a=_[_0xc207('0x63')](_0x53cb21);var _0x51b775=_0x53cb21===_0xc207('0x64')?'Website':_0xc207('0x65');return db[_0x20089a+_0xc207('0x66')][_0xc207('0x67')]({'raw':!![],'where':{'id':_0x2967e6[_0xc207('0x1b')]['id']}})['then'](function(_0x25731c){if(_[_0xc207('0x11')](_0x25731c)){throw new Error(_0x20089a+'\x20Queue\x20not\x20found');}_0x383f83=_0x25731c;return db[_0x20089a+_0xc207('0x68')][_0xc207('0x67')]({'where':{'id':_0x2967e6[_0xc207('0x23')][_0xc207('0x69')]},'include':[{'model':db[_0x20089a+'Interaction'],'as':_0xc207('0x6a')},{'model':db[_0x20089a+_0x51b775],'as':_0xc207('0x65')}]});})[_0xc207('0x8')](function(_0x297ee0){if(_['isNil'](_0x297ee0)){throw new Error(_0x20089a+'\x20Message\x20not\x20found');}_0x3adfeb=_0x297ee0;return _0x297ee0['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x273b30={'uniqueid':_0x53cb21+'.'+_0x3adfeb['id']+'.'+_0x3adfeb[_0xc207('0x6a')]['id'],'FromUserId':_0x2967e6[_0xc207('0x31')]['id'],'type':_0xc207('0x6b')};_0x273b30[_0x20089a+'MessageId']=_0x3adfeb['id'];_0x273b30[_0x20089a+'InteractionId']=_0x3adfeb[_0xc207('0x6a')]['id'];_0x273b30['From'+_0x20089a+_0x51b775+'Id']=_0x3adfeb['Account']['id'];_0x273b30['To'+_0x20089a+_0xc207('0x6c')]=_0x383f83['id'];return db[_0x20089a+_0xc207('0x6d')][_0xc207('0x6e')](_0x273b30);})[_0xc207('0x8')](function(){return respondWithRpcPromise(_0xc207('0x6f'),{'channel':_0x53cb21,'interaction':_0x3adfeb['Interaction'],'message':_0x3adfeb,'account':_0x3adfeb[_0xc207('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x383f83[_0xc207('0x10')]+','+(_0x3adfeb[_0xc207('0x65')][_0xc207('0x70')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x220293,null))[_0xc207('0x17')](handleError(_0x220293,null));};};exports[_0xc207('0x71')]=function(_0x1841a4,_0x7d4f9c){var _0x4e5b1c,_0x4d05e5;if(_[_0xc207('0x11')](_0x1841a4['body'][_0xc207('0x72')])){throw new Error(_0xc207('0x73'));}var _0x211884=_0x1841a4[_0xc207('0x23')][_0xc207('0x72')];var _0x5a7bc9=_[_0xc207('0x63')](_0x211884);var _0x328016=_0x211884===_0xc207('0x64')?_0xc207('0x74'):_0xc207('0x65');return db[_0xc207('0x75')][_0xc207('0x67')]({'raw':!![],'where':{'id':_0x1841a4[_0xc207('0x1b')]['id'],'role':_0xc207('0x3a')}})[_0xc207('0x8')](function(_0x48213b){if(_[_0xc207('0x11')](_0x48213b)){throw new Error('Agent\x20not\x20found');}_0x4e5b1c=_0x48213b;return db[_0x5a7bc9+'Message'][_0xc207('0x67')]({'where':{'id':_0x1841a4[_0xc207('0x23')]['messageId']},'include':[{'model':db[_0x5a7bc9+'Interaction'],'as':_0xc207('0x6a')},{'model':db[_0x5a7bc9+_0x328016],'as':_0xc207('0x65')}]});})[_0xc207('0x8')](function(_0x41b655){if(_['isNil'](_0x41b655)){throw new Error(_0x5a7bc9+_0xc207('0x76'));}_0x4d05e5=_0x41b655;return _0x41b655['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xc207('0x8')](function(){var _0x1c7886={'uniqueid':_0x211884+'.'+_0x4d05e5['id']+'.'+_0x4d05e5[_0xc207('0x6a')]['id'],'FromUserId':_0x1841a4[_0xc207('0x31')]['id'],'type':_0xc207('0x6b'),'ToUserId':_0x4e5b1c['id']};_0x1c7886[_0x5a7bc9+_0xc207('0x77')]=_0x4d05e5['id'];_0x1c7886[_0x5a7bc9+'InteractionId']=_0x4d05e5[_0xc207('0x6a')]['id'];_0x1c7886[_0xc207('0x78')+_0x5a7bc9+_0x328016+'Id']=_0x4d05e5['Account']['id'];return db[_0x5a7bc9+'TransferReport']['create'](_0x1c7886);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x211884,'interaction':_0x4d05e5[_0xc207('0x6a')],'message':_0x4d05e5,'account':_0x4d05e5[_0xc207('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0xc207('0x3a'),'appdata':_0x4e5b1c['name']+','+(_0x4d05e5[_0xc207('0x65')]['agentTransferTimeout']||0x12c),'interval':_0xc207('0x79')}]},routingClient);})[_0xc207('0x8')](respondWithResult(_0x7d4f9c,null))[_0xc207('0x17')](handleError(_0x7d4f9c,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index ca039a3..238c588 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 _0x36b8=['./schedule.controller','get','isAuthenticated','/:id','show','run','post','create','put','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x182aff,_0x44a53c){var _0x4ad04c=function(_0x1d24e9){while(--_0x1d24e9){_0x182aff['push'](_0x182aff['shift']());}};_0x4ad04c(++_0x44a53c);}(_0x36b8,0x83));var _0x836b=function(_0x5aeb3d,_0x334bff){_0x5aeb3d=_0x5aeb3d-0x0;var _0x4b6e8b=_0x36b8[_0x5aeb3d];return _0x4b6e8b;};'use strict';var multer=require(_0x836b('0x0'));var util=require(_0x836b('0x1'));var path=require(_0x836b('0x2'));var timeout=require(_0x836b('0x3'));var express=require('express');var router=express[_0x836b('0x4')]();var fs_extra=require(_0x836b('0x5'));var auth=require(_0x836b('0x6'));var interaction=require(_0x836b('0x7'));var config=require(_0x836b('0x8'));var controller=require(_0x836b('0x9'));router[_0x836b('0xa')]('/',auth[_0x836b('0xb')](),controller['index']);router[_0x836b('0xa')](_0x836b('0xc'),auth['isAuthenticated'](),controller[_0x836b('0xd')]);router[_0x836b('0xa')]('/:id/run',auth[_0x836b('0xb')](),controller[_0x836b('0xe')]);router[_0x836b('0xf')]('/',auth[_0x836b('0xb')](),controller[_0x836b('0x10')]);router[_0x836b('0x11')](_0x836b('0xc'),auth['isAuthenticated'](),controller[_0x836b('0x12')]);router[_0x836b('0x13')](_0x836b('0xc'),auth[_0x836b('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7cdd=['fs-extra','../../config/environment','./schedule.controller','get','index','/:id','show','/:id/run','run','post','isAuthenticated','create','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x15f852,_0x530d85){var _0x387460=function(_0x4aa3df){while(--_0x4aa3df){_0x15f852['push'](_0x15f852['shift']());}};_0x387460(++_0x530d85);}(_0x7cdd,0x164));var _0xd7cd=function(_0x2b1f35,_0xc9169f){_0x2b1f35=_0x2b1f35-0x0;var _0x22d6f5=_0x7cdd[_0x2b1f35];return _0x22d6f5;};'use strict';var multer=require(_0xd7cd('0x0'));var util=require(_0xd7cd('0x1'));var path=require(_0xd7cd('0x2'));var timeout=require(_0xd7cd('0x3'));var express=require(_0xd7cd('0x4'));var router=express['Router']();var fs_extra=require(_0xd7cd('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd7cd('0x6'));var controller=require(_0xd7cd('0x7'));router[_0xd7cd('0x8')]('/',auth['isAuthenticated'](),controller[_0xd7cd('0x9')]);router[_0xd7cd('0x8')](_0xd7cd('0xa'),auth['isAuthenticated'](),controller[_0xd7cd('0xb')]);router[_0xd7cd('0x8')](_0xd7cd('0xc'),auth['isAuthenticated'](),controller[_0xd7cd('0xd')]);router[_0xd7cd('0xe')]('/',auth[_0xd7cd('0xf')](),controller[_0xd7cd('0x10')]);router['put'](_0xd7cd('0xa'),auth[_0xd7cd('0xf')](),controller['update']);router[_0xd7cd('0x11')](_0xd7cd('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xd7cd('0x12')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index ea00af2..b897dcb 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 _0x09ff=['pdf','custom','default','BOOLEAN','TEXT','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','days','hours','minutes'];(function(_0x2dee5d,_0x4e259d){var _0x311115=function(_0x55ba56){while(--_0x55ba56){_0x2dee5d['push'](_0x2dee5d['shift']());}};_0x311115(++_0x4e259d);}(_0x09ff,0x126));var _0xf09f=function(_0x25515a,_0x2993f7){_0x25515a=_0x25515a-0x0;var _0x400c66=_0x09ff[_0x25515a];return _0x400c66;};'use strict';var Sequelize=require(_0xf09f('0x0'));module[_0xf09f('0x1')]={'name':{'type':Sequelize[_0xf09f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf09f('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf09f('0x3')},'startAt':{'type':Sequelize[_0xf09f('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xf09f('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xf09f('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xf09f('0x6')](_0xf09f('0x7'),_0xf09f('0x8'),'months','weeks',_0xf09f('0x9'),_0xf09f('0xa'),_0xf09f('0xb')),'allowNull':![],'defaultValue':_0xf09f('0x9')},'output':{'type':Sequelize['ENUM']('csv',_0xf09f('0xc'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xf09f('0x6')](_0xf09f('0xd'),_0xf09f('0xe')),'allowNull':![],'defaultValue':_0xf09f('0xd')},'sendMail':{'type':Sequelize[_0xf09f('0xf')],'defaultValue':![]},'email':{'type':Sequelize[_0xf09f('0x2')]},'cc':{'type':Sequelize[_0xf09f('0x10')]},'bcc':{'type':Sequelize[_0xf09f('0x10')]},'sendIfEmpty':{'type':Sequelize[_0xf09f('0xf')],'defaultValue':!![]}}; \ No newline at end of file +var _0xcd43=['csv','custom','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','quarters','months','days','minutes','pdf','xlsx'];(function(_0x555b03,_0x354313){var _0x39aea3=function(_0x1a5a02){while(--_0x1a5a02){_0x555b03['push'](_0x555b03['shift']());}};_0x39aea3(++_0x354313);}(_0xcd43,0x1c3));var _0x3cd4=function(_0x367361,_0x311488){_0x367361=_0x367361-0x0;var _0x195d2d=_0xcd43[_0x367361];return _0x195d2d;};'use strict';var Sequelize=require(_0x3cd4('0x0'));module[_0x3cd4('0x1')]={'name':{'type':Sequelize[_0x3cd4('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3cd4('0x2')]},'active':{'type':Sequelize[_0x3cd4('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3cd4('0x4')},'startAt':{'type':Sequelize[_0x3cd4('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x3cd4('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x3cd4('0x6')]('years',_0x3cd4('0x7'),_0x3cd4('0x8'),'weeks',_0x3cd4('0x9'),'hours',_0x3cd4('0xa')),'allowNull':![],'defaultValue':_0x3cd4('0x9')},'output':{'type':Sequelize[_0x3cd4('0x6')]('csv',_0x3cd4('0xb'),_0x3cd4('0xc')),'allowNull':![],'defaultValue':_0x3cd4('0xd')},'type':{'type':Sequelize[_0x3cd4('0x6')]('custom','default'),'allowNull':![],'defaultValue':_0x3cd4('0xe')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x3cd4('0x2')]},'cc':{'type':Sequelize[_0x3cd4('0xf')]},'bcc':{'type':Sequelize[_0x3cd4('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x3cd4('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index bd33692..9d59e9d 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 _0xce87=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','sendStatus','error','stack','name','send','index','map','Schedule','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','rows','params','length','includeAll','options','find','catch','create','body','user','role','UserProfileSection','autoAssociation','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x424501,_0x42096d){var _0xb719af=function(_0x37adcf){while(--_0x37adcf){_0x424501['push'](_0x424501['shift']());}};_0xb719af(++_0x42096d);}(_0xce87,0x1f0));var _0x7ce8=function(_0x4482bb,_0x2aa412){_0x4482bb=_0x4482bb-0x0;var _0x542d0e=_0xce87[_0x4482bb];return _0x542d0e;};'use strict';var emlformat=require(_0x7ce8('0x0'));var rimraf=require(_0x7ce8('0x1'));var zipdir=require(_0x7ce8('0x2'));var jsonpatch=require(_0x7ce8('0x3'));var rp=require('request-promise');var moment=require(_0x7ce8('0x4'));var BPromise=require(_0x7ce8('0x5'));var Mustache=require(_0x7ce8('0x6'));var util=require(_0x7ce8('0x7'));var path=require('path');var sox=require(_0x7ce8('0x8'));var csv=require(_0x7ce8('0x9'));var ejs=require(_0x7ce8('0xa'));var fs=require('fs');var fs_extra=require(_0x7ce8('0xb'));var _=require(_0x7ce8('0xc'));var squel=require(_0x7ce8('0xd'));var crypto=require(_0x7ce8('0xe'));var jsforce=require(_0x7ce8('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7ce8('0x10'));var Papa=require('papaparse');var Redis=require(_0x7ce8('0x11'));var authService=require(_0x7ce8('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7ce8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7ce8('0x14'))(_0x7ce8('0x15'));var utils=require(_0x7ce8('0x16'));var config=require(_0x7ce8('0x17'));var licenseUtil=require(_0x7ce8('0x18'));var db=require(_0x7ce8('0x19'))['db'];function respondWithStatusCode(_0xba8c8b,_0x2b08de){_0x2b08de=_0x2b08de||0xcc;return function(_0x3ec922){if(_0x3ec922){return _0xba8c8b['sendStatus'](_0x2b08de);}return _0xba8c8b[_0x7ce8('0x1a')](_0x2b08de)[_0x7ce8('0x1b')]();};}function respondWithResult(_0x7405c9,_0x3d8adf){_0x3d8adf=_0x3d8adf||0xc8;return function(_0x405e86){if(_0x405e86){return _0x7405c9[_0x7ce8('0x1a')](_0x3d8adf)['json'](_0x405e86);}};}function respondWithFilteredResult(_0x3ee928,_0x6db03a){return function(_0x55032b){if(_0x55032b){var _0x4e1fb6=typeof _0x6db03a[_0x7ce8('0x1c')]===_0x7ce8('0x1d')&&typeof _0x6db03a[_0x7ce8('0x1e')]===_0x7ce8('0x1d');var _0xd44d6c=_0x55032b['count'];var _0x2a0bea=_0x4e1fb6?0x0:_0x6db03a[_0x7ce8('0x1c')];var _0x471fad=_0x4e1fb6?_0x55032b[_0x7ce8('0x1f')]:_0x6db03a['offset']+_0x6db03a[_0x7ce8('0x1e')];var _0x2cdb1b;if(_0x471fad>=_0xd44d6c){_0x471fad=_0xd44d6c;_0x2cdb1b=0xc8;}else{_0x2cdb1b=0xce;}_0x3ee928['status'](_0x2cdb1b);return _0x3ee928[_0x7ce8('0x20')]('Content-Range',_0x2a0bea+'-'+_0x471fad+'/'+_0xd44d6c)[_0x7ce8('0x21')](_0x55032b);}return null;};}function patchUpdates(_0x41017a){return function(_0x4d571c){try{jsonpatch[_0x7ce8('0x22')](_0x4d571c,_0x41017a,!![]);}catch(_0x482a9f){return BPromise[_0x7ce8('0x23')](_0x482a9f);}return _0x4d571c[_0x7ce8('0x24')]();};}function saveUpdates(_0xae037c,_0x336cde){return function(_0x1a1207){if(_0x1a1207){return _0x1a1207[_0x7ce8('0x25')](_0xae037c)[_0x7ce8('0x26')](function(_0x17474c){return _0x17474c;});}return null;};}function removeEntity(_0x2c3369,_0x32ef87){return function(_0x41f757){if(_0x41f757){return _0x41f757[_0x7ce8('0x27')]()[_0x7ce8('0x26')](function(){var _0x4089aa=_0x41f757[_0x7ce8('0x28')]({'plain':!![]});var _0xad4db6=_0x7ce8('0x29');return db[_0x7ce8('0x2a')][_0x7ce8('0x27')]({'where':{'type':_0xad4db6,'resourceId':_0x4089aa['id']}})[_0x7ce8('0x26')](function(){return _0x41f757;});})['then'](function(){_0x2c3369[_0x7ce8('0x1a')](0xcc)[_0x7ce8('0x1b')]();});}};}function handleEntityNotFound(_0x1175cb,_0x2b701e){return function(_0x111513){if(!_0x111513){_0x1175cb[_0x7ce8('0x2b')](0x194);}return _0x111513;};}function handleError(_0x330357,_0x198171){_0x198171=_0x198171||0x1f4;return function(_0x145c34){logger[_0x7ce8('0x2c')](_0x145c34[_0x7ce8('0x2d')]);if(_0x145c34[_0x7ce8('0x2e')]){delete _0x145c34['name'];}_0x330357[_0x7ce8('0x1a')](_0x198171)[_0x7ce8('0x2f')](_0x145c34);};}exports[_0x7ce8('0x30')]=function(_0x119115,_0x1b3e91){var _0x112b4b={},_0x426383={},_0x5297e7={'count':0x0,'rows':[]};var _0x14debb=_[_0x7ce8('0x31')](db[_0x7ce8('0x32')][_0x7ce8('0x33')],function(_0x4d4b81){return{'name':_0x4d4b81['fieldName'],'type':_0x4d4b81[_0x7ce8('0x34')]['key']};});_0x426383[_0x7ce8('0x35')]=_['map'](_0x14debb,_0x7ce8('0x2e'));_0x426383[_0x7ce8('0x36')]=_[_0x7ce8('0x37')](_0x119115[_0x7ce8('0x36')]);_0x426383[_0x7ce8('0x38')]=_['intersection'](_0x426383['model'],_0x426383[_0x7ce8('0x36')]);_0x112b4b['attributes']=_[_0x7ce8('0x39')](_0x426383[_0x7ce8('0x35')],qs[_0x7ce8('0x3a')](_0x119115[_0x7ce8('0x36')][_0x7ce8('0x3a')]));_0x112b4b[_0x7ce8('0x3b')]=_0x112b4b[_0x7ce8('0x3b')]['length']?_0x112b4b[_0x7ce8('0x3b')]:_0x426383['model'];if(!_0x119115[_0x7ce8('0x36')][_0x7ce8('0x3c')](_0x7ce8('0x3d'))){_0x112b4b['limit']=qs[_0x7ce8('0x1e')](_0x119115[_0x7ce8('0x36')][_0x7ce8('0x1e')]);_0x112b4b[_0x7ce8('0x1c')]=qs[_0x7ce8('0x1c')](_0x119115[_0x7ce8('0x36')][_0x7ce8('0x1c')]);}_0x112b4b[_0x7ce8('0x3e')]=qs[_0x7ce8('0x3f')](_0x119115[_0x7ce8('0x36')][_0x7ce8('0x3f')]);_0x112b4b[_0x7ce8('0x40')]=qs[_0x7ce8('0x38')](_[_0x7ce8('0x41')](_0x119115[_0x7ce8('0x36')],_0x426383[_0x7ce8('0x38')]),_0x14debb);if(_0x119115['query'][_0x7ce8('0x42')]){_0x112b4b[_0x7ce8('0x40')]=_[_0x7ce8('0x43')](_0x112b4b['where'],{'$or':_[_0x7ce8('0x31')](_0x14debb,function(_0x16f829){if(_0x16f829[_0x7ce8('0x34')]!=='VIRTUAL'){var _0x315ea2={};_0x315ea2[_0x16f829['name']]={'$like':'%'+_0x119115[_0x7ce8('0x36')]['filter']+'%'};return _0x315ea2;}})});}_0x112b4b=_['merge']({},_0x112b4b,_0x119115['options']);var _0x11e6df={'where':_0x112b4b[_0x7ce8('0x40')]};return db['Schedule'][_0x7ce8('0x1f')](_0x11e6df)[_0x7ce8('0x26')](function(_0x9982ad){_0x5297e7[_0x7ce8('0x1f')]=_0x9982ad;if(_0x119115[_0x7ce8('0x36')]['includeAll']){_0x112b4b[_0x7ce8('0x44')]=[{'all':!![]}];}return db[_0x7ce8('0x32')]['findAll'](_0x112b4b);})[_0x7ce8('0x26')](function(_0x25aebd){_0x5297e7[_0x7ce8('0x45')]=_0x25aebd;return _0x5297e7;})[_0x7ce8('0x26')](respondWithFilteredResult(_0x1b3e91,_0x112b4b))['catch'](handleError(_0x1b3e91,null));};exports['show']=function(_0x3ccd3d,_0x106045){var _0xd5db64={'raw':![],'where':{'id':_0x3ccd3d[_0x7ce8('0x46')]['id']}},_0x402ae9={};_0x402ae9[_0x7ce8('0x35')]=_['keys'](db[_0x7ce8('0x32')]['rawAttributes']);_0x402ae9[_0x7ce8('0x36')]=_[_0x7ce8('0x37')](_0x3ccd3d[_0x7ce8('0x36')]);_0x402ae9[_0x7ce8('0x38')]=_[_0x7ce8('0x39')](_0x402ae9[_0x7ce8('0x35')],_0x402ae9[_0x7ce8('0x36')]);_0xd5db64[_0x7ce8('0x3b')]=_[_0x7ce8('0x39')](_0x402ae9[_0x7ce8('0x35')],qs[_0x7ce8('0x3a')](_0x3ccd3d[_0x7ce8('0x36')]['fields']));_0xd5db64[_0x7ce8('0x3b')]=_0xd5db64[_0x7ce8('0x3b')][_0x7ce8('0x47')]?_0xd5db64[_0x7ce8('0x3b')]:_0x402ae9['model'];if(_0x3ccd3d[_0x7ce8('0x36')][_0x7ce8('0x48')]){_0xd5db64[_0x7ce8('0x44')]=[{'all':!![]}];}_0xd5db64=_[_0x7ce8('0x43')]({},_0xd5db64,_0x3ccd3d[_0x7ce8('0x49')]);return db[_0x7ce8('0x32')][_0x7ce8('0x4a')](_0xd5db64)['then'](handleEntityNotFound(_0x106045,null))[_0x7ce8('0x26')](respondWithResult(_0x106045,null))[_0x7ce8('0x4b')](handleError(_0x106045,null));};exports['create']=function(_0x3de303,_0x311a1c){return db['Schedule'][_0x7ce8('0x4c')](_0x3de303[_0x7ce8('0x4d')],{})[_0x7ce8('0x26')](function(_0x40566b){var _0x3f5c61=_0x3de303[_0x7ce8('0x4e')][_0x7ce8('0x28')]({'plain':!![]});if(!_0x3f5c61)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f5c61[_0x7ce8('0x4f')]==='user'){var _0x60448a=_0x40566b[_0x7ce8('0x28')]({'plain':!![]});var _0x5af6aa=_0x7ce8('0x29');return db[_0x7ce8('0x50')][_0x7ce8('0x4a')]({'where':{'name':_0x5af6aa,'userProfileId':_0x3f5c61['userProfileId']},'raw':!![]})[_0x7ce8('0x26')](function(_0x3501cf){if(_0x3501cf&&_0x3501cf[_0x7ce8('0x51')]===0x0){return db[_0x7ce8('0x2a')][_0x7ce8('0x4c')]({'name':_0x60448a[_0x7ce8('0x2e')],'resourceId':_0x60448a['id'],'type':_0x3501cf[_0x7ce8('0x2e')],'sectionId':_0x3501cf['id']},{})['then'](function(){return _0x40566b;});}else{return _0x40566b;}})[_0x7ce8('0x4b')](function(_0x1bfc34){logger[_0x7ce8('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1bfc34);throw _0x1bfc34;});}return _0x40566b;})[_0x7ce8('0x26')](respondWithResult(_0x311a1c,0xc9))[_0x7ce8('0x4b')](handleError(_0x311a1c,null));};exports[_0x7ce8('0x25')]=function(_0x15c288,_0x23e66b){if(_0x15c288[_0x7ce8('0x4d')]['id']){delete _0x15c288[_0x7ce8('0x4d')]['id'];}return db[_0x7ce8('0x32')][_0x7ce8('0x4a')]({'where':{'id':_0x15c288[_0x7ce8('0x46')]['id']}})[_0x7ce8('0x26')](handleEntityNotFound(_0x23e66b,null))[_0x7ce8('0x26')](saveUpdates(_0x15c288[_0x7ce8('0x4d')],null))[_0x7ce8('0x26')](respondWithResult(_0x23e66b,null))[_0x7ce8('0x4b')](handleError(_0x23e66b,null));};exports['destroy']=function(_0x11bed2,_0x58506c){return db[_0x7ce8('0x32')][_0x7ce8('0x4a')]({'where':{'id':_0x11bed2[_0x7ce8('0x46')]['id']}})[_0x7ce8('0x26')](handleEntityNotFound(_0x58506c,null))[_0x7ce8('0x26')](removeEntity(_0x58506c,null))['catch'](handleError(_0x58506c,null));};exports[_0x7ce8('0x52')]=function(_0x3cfdaa,_0xf66255,_0x25b866){var _0x16567d=require(_0x7ce8('0x53'));return db['Schedule'][_0x7ce8('0x4a')]({'where':{'id':_0x3cfdaa[_0x7ce8('0x46')]['id']},'raw':!![]})[_0x7ce8('0x26')](handleEntityNotFound(_0xf66255,null))[_0x7ce8('0x26')](function(){_0x16567d[_0x7ce8('0x52')](_0x3cfdaa['params']['id']);})[_0x7ce8('0x26')](respondWithStatusCode(_0xf66255,null))[_0x7ce8('0x4b')](handleError(_0xf66255,null));}; \ No newline at end of file +var _0x98c2=['status','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Scheduler','error','stack','name','send','index','map','Schedule','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','end'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x98c2,0x1db));var _0x298c=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x98c2[_0x1e3c16];return _0x47a0c9;};'use strict';var emlformat=require(_0x298c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x298c('0x1'));var jsonpatch=require(_0x298c('0x2'));var rp=require(_0x298c('0x3'));var moment=require('moment');var BPromise=require(_0x298c('0x4'));var Mustache=require(_0x298c('0x5'));var util=require('util');var path=require(_0x298c('0x6'));var sox=require(_0x298c('0x7'));var csv=require(_0x298c('0x8'));var ejs=require(_0x298c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x298c('0xa'));var jsforce=require(_0x298c('0xb'));var deskjs=require(_0x298c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x298c('0xd'));var Papa=require(_0x298c('0xe'));var Redis=require('ioredis');var authService=require(_0x298c('0xf'));var qs=require(_0x298c('0x10'));var as=require(_0x298c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x298c('0x12'))('api');var utils=require(_0x298c('0x13'));var config=require(_0x298c('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13ed99,_0x1d7216){_0x1d7216=_0x1d7216||0xcc;return function(_0x4d0c70){if(_0x4d0c70){return _0x13ed99[_0x298c('0x15')](_0x1d7216);}return _0x13ed99['status'](_0x1d7216)[_0x298c('0x16')]();};}function respondWithResult(_0x452a98,_0x531c0e){_0x531c0e=_0x531c0e||0xc8;return function(_0x6389df){if(_0x6389df){return _0x452a98[_0x298c('0x17')](_0x531c0e)[_0x298c('0x18')](_0x6389df);}};}function respondWithFilteredResult(_0x4f29c6,_0x2d92ad){return function(_0x100bc1){if(_0x100bc1){var _0x379db4=typeof _0x2d92ad['offset']===_0x298c('0x19')&&typeof _0x2d92ad['limit']==='undefined';var _0x2d308e=_0x100bc1['count'];var _0x361ab8=_0x379db4?0x0:_0x2d92ad[_0x298c('0x1a')];var _0x2b7404=_0x379db4?_0x100bc1[_0x298c('0x1b')]:_0x2d92ad[_0x298c('0x1a')]+_0x2d92ad[_0x298c('0x1c')];var _0x1f1783;if(_0x2b7404>=_0x2d308e){_0x2b7404=_0x2d308e;_0x1f1783=0xc8;}else{_0x1f1783=0xce;}_0x4f29c6[_0x298c('0x17')](_0x1f1783);return _0x4f29c6[_0x298c('0x1d')](_0x298c('0x1e'),_0x361ab8+'-'+_0x2b7404+'/'+_0x2d308e)[_0x298c('0x18')](_0x100bc1);}return null;};}function patchUpdates(_0x18c109){return function(_0x72ccbc){try{jsonpatch[_0x298c('0x1f')](_0x72ccbc,_0x18c109,!![]);}catch(_0x452081){return BPromise[_0x298c('0x20')](_0x452081);}return _0x72ccbc[_0x298c('0x21')]();};}function saveUpdates(_0x2713f7,_0x1ad066){return function(_0x3557a7){if(_0x3557a7){return _0x3557a7[_0x298c('0x22')](_0x2713f7)[_0x298c('0x23')](function(_0xea7c7e){return _0xea7c7e;});}return null;};}function removeEntity(_0x25672c,_0x16d39a){return function(_0x22df93){if(_0x22df93){return _0x22df93[_0x298c('0x24')]()[_0x298c('0x23')](function(){var _0x1674ae=_0x22df93[_0x298c('0x25')]({'plain':!![]});var _0x5dae4c=_0x298c('0x26');return db['UserProfileResource'][_0x298c('0x24')]({'where':{'type':_0x5dae4c,'resourceId':_0x1674ae['id']}})[_0x298c('0x23')](function(){return _0x22df93;});})['then'](function(){_0x25672c[_0x298c('0x17')](0xcc)[_0x298c('0x16')]();});}};}function handleEntityNotFound(_0x2c48b8,_0x516235){return function(_0x385ada){if(!_0x385ada){_0x2c48b8['sendStatus'](0x194);}return _0x385ada;};}function handleError(_0x5b3f0c,_0x469918){_0x469918=_0x469918||0x1f4;return function(_0x3a9c24){logger[_0x298c('0x27')](_0x3a9c24[_0x298c('0x28')]);if(_0x3a9c24[_0x298c('0x29')]){delete _0x3a9c24[_0x298c('0x29')];}_0x5b3f0c[_0x298c('0x17')](_0x469918)[_0x298c('0x2a')](_0x3a9c24);};}exports[_0x298c('0x2b')]=function(_0x25dda1,_0x43cc72){var _0x6036d7={},_0x1e7b34={},_0x1afa80={'count':0x0,'rows':[]};var _0x474a60=_[_0x298c('0x2c')](db[_0x298c('0x2d')][_0x298c('0x2e')],function(_0x27782f){return{'name':_0x27782f['fieldName'],'type':_0x27782f[_0x298c('0x2f')][_0x298c('0x30')]};});_0x1e7b34['model']=_[_0x298c('0x2c')](_0x474a60,'name');_0x1e7b34[_0x298c('0x31')]=_[_0x298c('0x32')](_0x25dda1[_0x298c('0x31')]);_0x1e7b34['filters']=_[_0x298c('0x33')](_0x1e7b34[_0x298c('0x34')],_0x1e7b34[_0x298c('0x31')]);_0x6036d7[_0x298c('0x35')]=_['intersection'](_0x1e7b34[_0x298c('0x34')],qs[_0x298c('0x36')](_0x25dda1[_0x298c('0x31')][_0x298c('0x36')]));_0x6036d7[_0x298c('0x35')]=_0x6036d7['attributes']['length']?_0x6036d7['attributes']:_0x1e7b34[_0x298c('0x34')];if(!_0x25dda1[_0x298c('0x31')][_0x298c('0x37')](_0x298c('0x38'))){_0x6036d7[_0x298c('0x1c')]=qs[_0x298c('0x1c')](_0x25dda1[_0x298c('0x31')][_0x298c('0x1c')]);_0x6036d7[_0x298c('0x1a')]=qs[_0x298c('0x1a')](_0x25dda1['query'][_0x298c('0x1a')]);}_0x6036d7[_0x298c('0x39')]=qs['sort'](_0x25dda1[_0x298c('0x31')][_0x298c('0x3a')]);_0x6036d7[_0x298c('0x3b')]=qs[_0x298c('0x3c')](_['pick'](_0x25dda1[_0x298c('0x31')],_0x1e7b34['filters']),_0x474a60);if(_0x25dda1[_0x298c('0x31')][_0x298c('0x3d')]){_0x6036d7[_0x298c('0x3b')]=_[_0x298c('0x3e')](_0x6036d7[_0x298c('0x3b')],{'$or':_['map'](_0x474a60,function(_0x41e326){if(_0x41e326[_0x298c('0x2f')]!==_0x298c('0x3f')){var _0x1e2cf6={};_0x1e2cf6[_0x41e326['name']]={'$like':'%'+_0x25dda1[_0x298c('0x31')][_0x298c('0x3d')]+'%'};return _0x1e2cf6;}})});}_0x6036d7=_['merge']({},_0x6036d7,_0x25dda1[_0x298c('0x40')]);var _0x154fc0={'where':_0x6036d7[_0x298c('0x3b')]};return db[_0x298c('0x2d')]['count'](_0x154fc0)[_0x298c('0x23')](function(_0x58a3dd){_0x1afa80[_0x298c('0x1b')]=_0x58a3dd;if(_0x25dda1[_0x298c('0x31')][_0x298c('0x41')]){_0x6036d7['include']=[{'all':!![]}];}return db[_0x298c('0x2d')]['findAll'](_0x6036d7);})[_0x298c('0x23')](function(_0x40a136){_0x1afa80[_0x298c('0x42')]=_0x40a136;return _0x1afa80;})[_0x298c('0x23')](respondWithFilteredResult(_0x43cc72,_0x6036d7))[_0x298c('0x43')](handleError(_0x43cc72,null));};exports['show']=function(_0x4a51b2,_0x2a5eb2){var _0xe9dc38={'raw':![],'where':{'id':_0x4a51b2[_0x298c('0x44')]['id']}},_0x1873ed={};_0x1873ed['model']=_['keys'](db['Schedule']['rawAttributes']);_0x1873ed[_0x298c('0x31')]=_[_0x298c('0x32')](_0x4a51b2[_0x298c('0x31')]);_0x1873ed[_0x298c('0x3c')]=_['intersection'](_0x1873ed[_0x298c('0x34')],_0x1873ed[_0x298c('0x31')]);_0xe9dc38[_0x298c('0x35')]=_[_0x298c('0x33')](_0x1873ed['model'],qs['fields'](_0x4a51b2[_0x298c('0x31')][_0x298c('0x36')]));_0xe9dc38[_0x298c('0x35')]=_0xe9dc38[_0x298c('0x35')][_0x298c('0x45')]?_0xe9dc38[_0x298c('0x35')]:_0x1873ed[_0x298c('0x34')];if(_0x4a51b2[_0x298c('0x31')][_0x298c('0x41')]){_0xe9dc38[_0x298c('0x46')]=[{'all':!![]}];}_0xe9dc38=_[_0x298c('0x3e')]({},_0xe9dc38,_0x4a51b2[_0x298c('0x40')]);return db[_0x298c('0x2d')][_0x298c('0x47')](_0xe9dc38)[_0x298c('0x23')](handleEntityNotFound(_0x2a5eb2,null))['then'](respondWithResult(_0x2a5eb2,null))[_0x298c('0x43')](handleError(_0x2a5eb2,null));};exports[_0x298c('0x48')]=function(_0x12a7a0,_0x55fcbb){return db[_0x298c('0x2d')]['create'](_0x12a7a0[_0x298c('0x49')],{})[_0x298c('0x23')](function(_0x36c671){var _0x5171da=_0x12a7a0[_0x298c('0x4a')]['get']({'plain':!![]});if(!_0x5171da)throw new Error(_0x298c('0x4b'));if(_0x5171da[_0x298c('0x4c')]===_0x298c('0x4a')){var _0x48c841=_0x36c671[_0x298c('0x25')]({'plain':!![]});var _0x133fb6=_0x298c('0x26');return db[_0x298c('0x4d')][_0x298c('0x47')]({'where':{'name':_0x133fb6,'userProfileId':_0x5171da[_0x298c('0x4e')]},'raw':!![]})[_0x298c('0x23')](function(_0x3f8484){if(_0x3f8484&&_0x3f8484[_0x298c('0x4f')]===0x0){return db[_0x298c('0x50')][_0x298c('0x48')]({'name':_0x48c841[_0x298c('0x29')],'resourceId':_0x48c841['id'],'type':_0x3f8484['name'],'sectionId':_0x3f8484['id']},{})[_0x298c('0x23')](function(){return _0x36c671;});}else{return _0x36c671;}})['catch'](function(_0x6331){logger[_0x298c('0x27')](_0x298c('0x51'),_0x6331);throw _0x6331;});}return _0x36c671;})[_0x298c('0x23')](respondWithResult(_0x55fcbb,0xc9))[_0x298c('0x43')](handleError(_0x55fcbb,null));};exports[_0x298c('0x22')]=function(_0x206bfa,_0x250560){if(_0x206bfa[_0x298c('0x49')]['id']){delete _0x206bfa[_0x298c('0x49')]['id'];}return db[_0x298c('0x2d')][_0x298c('0x47')]({'where':{'id':_0x206bfa[_0x298c('0x44')]['id']}})['then'](handleEntityNotFound(_0x250560,null))['then'](saveUpdates(_0x206bfa[_0x298c('0x49')],null))[_0x298c('0x23')](respondWithResult(_0x250560,null))[_0x298c('0x43')](handleError(_0x250560,null));};exports[_0x298c('0x24')]=function(_0xb8291,_0x362935){return db[_0x298c('0x2d')]['find']({'where':{'id':_0xb8291[_0x298c('0x44')]['id']}})[_0x298c('0x23')](handleEntityNotFound(_0x362935,null))[_0x298c('0x23')](removeEntity(_0x362935,null))[_0x298c('0x43')](handleError(_0x362935,null));};exports[_0x298c('0x52')]=function(_0x5d4da4,_0x19c4fd,_0x2f5ea0){var _0x595740=require('../../config/schedule');return db[_0x298c('0x2d')][_0x298c('0x47')]({'where':{'id':_0x5d4da4['params']['id']},'raw':!![]})[_0x298c('0x23')](handleEntityNotFound(_0x19c4fd,null))[_0x298c('0x23')](function(){_0x595740[_0x298c('0x52')](_0x5d4da4[_0x298c('0x44')]['id']);})['then'](respondWithStatusCode(_0x19c4fd,null))[_0x298c('0x43')](handleError(_0x19c4fd,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 1f90d2f..8500ae2 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 _0x0954=['rimraf','./schedule.attributes','exports','Schedule','tools_schedules','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x1a093a,_0x1fddca){var _0x263fb3=function(_0x2cffae){while(--_0x2cffae){_0x1a093a['push'](_0x1a093a['shift']());}};_0x263fb3(++_0x1fddca);}(_0x0954,0x13d));var _0x4095=function(_0xbc4659,_0x578fba){_0xbc4659=_0xbc4659-0x0;var _0x5831f9=_0x0954[_0xbc4659];return _0x5831f9;};'use strict';var _=require(_0x4095('0x0'));var util=require(_0x4095('0x1'));var logger=require(_0x4095('0x2'))(_0x4095('0x3'));var moment=require(_0x4095('0x4'));var BPromise=require('bluebird');var rp=require(_0x4095('0x5'));var fs=require('fs');var path=require(_0x4095('0x6'));var rimraf=require(_0x4095('0x7'));var config=require('../../config/environment');var attributes=require(_0x4095('0x8'));module[_0x4095('0x9')]=function(_0x4fd1ec,_0x147a12){return _0x4fd1ec['define'](_0x4095('0xa'),attributes,{'tableName':_0x4095('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x357c=['tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','Schedule'];(function(_0x106a8e,_0x1b2145){var _0x47baf6=function(_0x5a5022){while(--_0x5a5022){_0x106a8e['push'](_0x106a8e['shift']());}};_0x47baf6(++_0x1b2145);}(_0x357c,0x1b1));var _0xc357=function(_0x2c6810,_0x23c079){_0x2c6810=_0x2c6810-0x0;var _0x213881=_0x357c[_0x2c6810];return _0x213881;};'use strict';var _=require(_0xc357('0x0'));var util=require(_0xc357('0x1'));var logger=require(_0xc357('0x2'))(_0xc357('0x3'));var moment=require(_0xc357('0x4'));var BPromise=require(_0xc357('0x5'));var rp=require(_0xc357('0x6'));var fs=require('fs');var path=require(_0xc357('0x7'));var rimraf=require(_0xc357('0x8'));var config=require(_0xc357('0x9'));var attributes=require('./schedule.attributes');module['exports']=function(_0x2b758e,_0x2b5955){return _0x2b758e['define'](_0xc357('0xa'),attributes,{'tableName':_0xc357('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 96c5977..aaeed16 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 _0xe808=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1c9a9a,_0x30a12f){var _0xca3172=function(_0x1d005d){while(--_0x1d005d){_0x1c9a9a['push'](_0x1c9a9a['shift']());}};_0xca3172(++_0x30a12f);}(_0xe808,0xc9));var _0x8e80=function(_0x12a14f,_0x5df022){_0x12a14f=_0x12a14f-0x0;var _0x49e087=_0xe808[_0x12a14f];return _0x49e087;};'use strict';var _=require(_0x8e80('0x0'));var util=require(_0x8e80('0x1'));var moment=require(_0x8e80('0x2'));var BPromise=require(_0x8e80('0x3'));var rs=require(_0x8e80('0x4'));var fs=require('fs');var Redis=require(_0x8e80('0x5'));var db=require(_0x8e80('0x6'))['db'];var utils=require(_0x8e80('0x7'));var logger=require(_0x8e80('0x8'))('rpc');var config=require(_0x8e80('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8e80('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x68dcbb,_0x38f573,_0x32b9ea){return new BPromise(function(_0x3a0954,_0x4844b5){return client['request'](_0x68dcbb,_0x32b9ea)[_0x8e80('0xb')](function(_0x421875){logger[_0x8e80('0xc')](_0x8e80('0xd'),_0x38f573,_0x8e80('0xe'));logger[_0x8e80('0xf')](_0x8e80('0x10'),_0x38f573,_0x8e80('0xe'),JSON[_0x8e80('0x11')](_0x421875));if(_0x421875[_0x8e80('0x12')]){if(_0x421875[_0x8e80('0x12')][_0x8e80('0x13')]===0x1f4){logger[_0x8e80('0x12')](_0x8e80('0xd'),_0x38f573,_0x421875[_0x8e80('0x12')][_0x8e80('0x14')]);return _0x4844b5(_0x421875[_0x8e80('0x12')][_0x8e80('0x14')]);}logger[_0x8e80('0x12')]('Schedule,\x20%s,\x20%s',_0x38f573,_0x421875[_0x8e80('0x12')]['message']);return _0x3a0954(_0x421875['error'][_0x8e80('0x14')]);}else{logger[_0x8e80('0xc')](_0x8e80('0xd'),_0x38f573,_0x8e80('0xe'));_0x3a0954(_0x421875[_0x8e80('0x15')][_0x8e80('0x14')]);}})[_0x8e80('0x16')](function(_0x220050){logger[_0x8e80('0x12')](_0x8e80('0xd'),_0x38f573,_0x220050);_0x4844b5(_0x220050);});});} \ No newline at end of file +var _0x9c96=['Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','debug'];(function(_0x5a6961,_0xd41ca6){var _0x4af0a6=function(_0x1201fe){while(--_0x1201fe){_0x5a6961['push'](_0x5a6961['shift']());}};_0x4af0a6(++_0xd41ca6);}(_0x9c96,0x126));var _0x69c9=function(_0x91928a,_0x587f7a){_0x91928a=_0x91928a-0x0;var _0x6882ba=_0x9c96[_0x91928a];return _0x6882ba;};'use strict';var _=require(_0x69c9('0x0'));var util=require(_0x69c9('0x1'));var moment=require(_0x69c9('0x2'));var BPromise=require(_0x69c9('0x3'));var rs=require(_0x69c9('0x4'));var fs=require('fs');var Redis=require(_0x69c9('0x5'));var db=require(_0x69c9('0x6'))['db'];var utils=require(_0x69c9('0x7'));var logger=require('../../config/logger')(_0x69c9('0x8'));var config=require(_0x69c9('0x9'));var jayson=require(_0x69c9('0xa'));var client=jayson[_0x69c9('0xb')][_0x69c9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4d3ee6,_0x39731e,_0x140d74){return new BPromise(function(_0x2cfe6c,_0x1973ea){return client[_0x69c9('0xd')](_0x4d3ee6,_0x140d74)[_0x69c9('0xe')](function(_0x4a31d1){logger[_0x69c9('0xf')](_0x69c9('0x10'),_0x39731e,'request\x20sent');logger[_0x69c9('0x11')](_0x69c9('0x12'),_0x39731e,_0x69c9('0x13'),JSON[_0x69c9('0x14')](_0x4a31d1));if(_0x4a31d1[_0x69c9('0x15')]){if(_0x4a31d1[_0x69c9('0x15')]['code']===0x1f4){logger[_0x69c9('0x15')]('Schedule,\x20%s,\x20%s',_0x39731e,_0x4a31d1['error']['message']);return _0x1973ea(_0x4a31d1['error'][_0x69c9('0x16')]);}logger[_0x69c9('0x15')](_0x69c9('0x10'),_0x39731e,_0x4a31d1[_0x69c9('0x15')]['message']);return _0x2cfe6c(_0x4a31d1[_0x69c9('0x15')][_0x69c9('0x16')]);}else{logger['info'](_0x69c9('0x10'),_0x39731e,_0x69c9('0x13'));_0x2cfe6c(_0x4a31d1[_0x69c9('0x17')]['message']);}})['catch'](function(_0xa7fdb){logger[_0x69c9('0x15')](_0x69c9('0x10'),_0x39731e,_0xa7fdb);_0x1973ea(_0xa7fdb);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 8cc05c2..d5c2eb3 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 _0x4ecb=['/:id/download','download','post','create','put','update','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3e86ba,_0x156277){var _0x5a8512=function(_0x24348b){while(--_0x24348b){_0x3e86ba['push'](_0x3e86ba['shift']());}};_0x5a8512(++_0x156277);}(_0x4ecb,0x194));var _0xb4ec=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x4ecb[_0x243b2f];return _0xcb3c2d;};'use strict';var multer=require(_0xb4ec('0x0'));var util=require(_0xb4ec('0x1'));var path=require('path');var timeout=require(_0xb4ec('0x2'));var express=require('express');var router=express[_0xb4ec('0x3')]();var fs_extra=require(_0xb4ec('0x4'));var auth=require(_0xb4ec('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb4ec('0x6'));var controller=require(_0xb4ec('0x7'));router[_0xb4ec('0x8')]('/',auth[_0xb4ec('0x9')](),controller[_0xb4ec('0xa')]);router['get'](_0xb4ec('0xb'),auth[_0xb4ec('0x9')](),controller[_0xb4ec('0xc')]);router[_0xb4ec('0x8')](_0xb4ec('0xd'),auth[_0xb4ec('0x9')](),controller['show']);router[_0xb4ec('0x8')](_0xb4ec('0xe'),auth['isAuthenticated'](),controller[_0xb4ec('0xf')]);router[_0xb4ec('0x10')]('/',auth['isAuthenticated'](),controller[_0xb4ec('0x11')]);router[_0xb4ec('0x12')](_0xb4ec('0xd'),auth['isAuthenticated'](),controller[_0xb4ec('0x13')]);router[_0xb4ec('0x14')](_0xb4ec('0xd'),auth[_0xb4ec('0x9')](),controller[_0xb4ec('0x15')]);module['exports']=router; \ No newline at end of file +var _0x2729=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/download','download','post','create','put','update','delete'];(function(_0x49305f,_0x2691c2){var _0x4b4e5e=function(_0x2c763b){while(--_0x2c763b){_0x49305f['push'](_0x49305f['shift']());}};_0x4b4e5e(++_0x2691c2);}(_0x2729,0xaa));var _0x9272=function(_0x43d94d,_0x2f167d){_0x43d94d=_0x43d94d-0x0;var _0x5aa4ff=_0x2729[_0x43d94d];return _0x5aa4ff;};'use strict';var multer=require(_0x9272('0x0'));var util=require(_0x9272('0x1'));var path=require('path');var timeout=require(_0x9272('0x2'));var express=require(_0x9272('0x3'));var router=express[_0x9272('0x4')]();var fs_extra=require(_0x9272('0x5'));var auth=require(_0x9272('0x6'));var interaction=require(_0x9272('0x7'));var config=require(_0x9272('0x8'));var controller=require('./screenRecording.controller');router[_0x9272('0x9')]('/',auth[_0x9272('0xa')](),controller[_0x9272('0xb')]);router['get']('/describe',auth[_0x9272('0xa')](),controller[_0x9272('0xc')]);router['get'](_0x9272('0xd'),auth[_0x9272('0xa')](),controller[_0x9272('0xe')]);router[_0x9272('0x9')](_0x9272('0xf'),auth[_0x9272('0xa')](),controller[_0x9272('0x10')]);router[_0x9272('0x11')]('/',auth[_0x9272('0xa')](),controller[_0x9272('0x12')]);router[_0x9272('0x13')](_0x9272('0xd'),auth[_0x9272('0xa')](),controller[_0x9272('0x14')]);router[_0x9272('0x15')]('/:id',auth[_0x9272('0xa')](),controller[_0x9272('0x16')]);module[_0x9272('0x17')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 3f21636..c2199fd 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 _0x68b3=['startedAt','subtract','duration','DATE','format','toString','closedAt','createdAt','MM-DD-YYYY\x20HH:mm','updatedAt','sequelize','moment','path','../../config/environment','exports','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER'];(function(_0x182af7,_0x14ce4f){var _0x3c7c89=function(_0x638422){while(--_0x638422){_0x182af7['push'](_0x182af7['shift']());}};_0x3c7c89(++_0x14ce4f);}(_0x68b3,0x1d8));var _0x368b=function(_0x3864ca,_0x469194){_0x3864ca=_0x3864ca-0x0;var _0x1ac94d=_0x68b3[_0x3864ca];return _0x1ac94d;};'use strict';var Sequelize=require(_0x368b('0x0'));var moment=require(_0x368b('0x1'));var path=require(_0x368b('0x2'));var config=require(_0x368b('0x3'));module[_0x368b('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x368b('0x5')](_0x368b('0x6'))?path[_0x368b('0x7')](this[_0x368b('0x5')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x368b('0x8')]},'channel':{'type':Sequelize[_0x368b('0x8')]},'value':{'type':Sequelize[_0x368b('0x8')],'set':function(_0x23584a){var _0x4406c8=_0x23584a[_0x368b('0x9')](/\\/g,'/');this[_0x368b('0xa')](_0x368b('0x6'),_0x4406c8);}},'rating':{'type':Sequelize[_0x368b('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x368b('0xb')],'set':function(_0x2a7b9f){this['setDataValue'](_0x368b('0xc'),moment()[_0x368b('0xd')](_0x2a7b9f,'ms'));this[_0x368b('0xa')]('closedAt',moment());this[_0x368b('0xa')](_0x368b('0xe'),_0x2a7b9f);}},'startedAt':{'type':Sequelize[_0x368b('0xf')],'get':function(){return moment(this['getDataValue'](_0x368b('0xc')))[_0x368b('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x368b('0x11')]();}},'closedAt':{'type':Sequelize[_0x368b('0xf')],'get':function(){return moment(this[_0x368b('0x5')](_0x368b('0x12')))[_0x368b('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x368b('0x11')]();}},'createdAt':{'type':Sequelize[_0x368b('0xf')],'get':function(){return moment(this['getDataValue'](_0x368b('0x13')))[_0x368b('0x10')](_0x368b('0x14'))['toString']();}},'updatedAt':{'type':Sequelize[_0x368b('0xf')],'get':function(){return moment(this[_0x368b('0x5')](_0x368b('0x15')))['format'](_0x368b('0x14'))[_0x368b('0x11')]();}}}; \ No newline at end of file +var _0xb78e=['getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','updatedAt','sequelize','moment','../../config/environment','exports','VIRTUAL'];(function(_0x49f856,_0x26dc54){var _0x1bacb6=function(_0xd115b3){while(--_0xd115b3){_0x49f856['push'](_0x49f856['shift']());}};_0x1bacb6(++_0x26dc54);}(_0xb78e,0x1c9));var _0xeb78=function(_0x3ed954,_0x19696a){_0x3ed954=_0x3ed954-0x0;var _0x2c7c3f=_0xb78e[_0x3ed954];return _0x2c7c3f;};'use strict';var Sequelize=require(_0xeb78('0x0'));var moment=require(_0xeb78('0x1'));var path=require('path');var config=require(_0xeb78('0x2'));module[_0xeb78('0x3')]={'format':{'type':Sequelize[_0xeb78('0x4')],'get':function(){return this[_0xeb78('0x5')](_0xeb78('0x6'))?path[_0xeb78('0x7')](this[_0xeb78('0x5')](_0xeb78('0x6'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xeb78('0x8')]},'value':{'type':Sequelize[_0xeb78('0x8')],'set':function(_0x1ccc2f){var _0x30c884=_0x1ccc2f[_0xeb78('0x9')](/\\/g,'/');this[_0xeb78('0xa')](_0xeb78('0x6'),_0x30c884);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xeb78('0xb')],'set':function(_0x1c941d){this[_0xeb78('0xa')](_0xeb78('0xc'),moment()[_0xeb78('0xd')](_0x1c941d,'ms'));this[_0xeb78('0xa')](_0xeb78('0xe'),moment());this[_0xeb78('0xa')](_0xeb78('0xf'),_0x1c941d);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xeb78('0x5')](_0xeb78('0xc')))[_0xeb78('0x10')](_0xeb78('0x11'))[_0xeb78('0x12')]();}},'closedAt':{'type':Sequelize[_0xeb78('0x13')],'get':function(){return moment(this[_0xeb78('0x5')](_0xeb78('0xe')))[_0xeb78('0x10')](_0xeb78('0x11'))['toString']();}},'createdAt':{'type':Sequelize[_0xeb78('0x13')],'get':function(){return moment(this[_0xeb78('0x5')]('createdAt'))['format']('MM-DD-YYYY\x20HH:mm')[_0xeb78('0x12')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xeb78('0x5')](_0xeb78('0x14')))['format'](_0xeb78('0x11'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index a87579b..c271512 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 _0x2bd8=['unlink','Not\x20found','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','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','index','ScreenRecording','rawAttributes','type','model','differenceBy','map','name','format','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','include','rows','catch','show','params','find','create','body','duration','createdAt','closedAt','value','../../components/encryptor','uniqueid','%s.cypher','secrets','recording','join','root','server/files/screen_recordings','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','download','extname'];(function(_0xc24fc4,_0x31de5e){var _0x301b5a=function(_0x39fd93){while(--_0x39fd93){_0xc24fc4['push'](_0xc24fc4['shift']());}};_0x301b5a(++_0x31de5e);}(_0x2bd8,0x130));var _0x82bd=function(_0x2d93ba,_0x2c0a85){_0x2d93ba=_0x2d93ba-0x0;var _0x3e14c3=_0x2bd8[_0x2d93ba];return _0x3e14c3;};'use strict';var emlformat=require(_0x82bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x82bd('0x1'));var jsonpatch=require(_0x82bd('0x2'));var rp=require(_0x82bd('0x3'));var moment=require(_0x82bd('0x4'));var BPromise=require(_0x82bd('0x5'));var Mustache=require(_0x82bd('0x6'));var util=require(_0x82bd('0x7'));var path=require('path');var sox=require(_0x82bd('0x8'));var csv=require(_0x82bd('0x9'));var ejs=require(_0x82bd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82bd('0xb'));var squel=require(_0x82bd('0xc'));var crypto=require(_0x82bd('0xd'));var jsforce=require(_0x82bd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x82bd('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x82bd('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x82bd('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x82bd('0x11'));var config=require(_0x82bd('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x82bd('0x13'))['db'];function respondWithStatusCode(_0x5f1ab9,_0xfaccf7){_0xfaccf7=_0xfaccf7||0xcc;return function(_0x51e17e){if(_0x51e17e){return _0x5f1ab9[_0x82bd('0x14')](_0xfaccf7);}return _0x5f1ab9[_0x82bd('0x15')](_0xfaccf7)[_0x82bd('0x16')]();};}function respondWithResult(_0x2ca530,_0x58d82b){_0x58d82b=_0x58d82b||0xc8;return function(_0x446ffc){if(_0x446ffc){return _0x2ca530[_0x82bd('0x15')](_0x58d82b)['json'](_0x446ffc);}};}function respondWithFilteredResult(_0x3667ef,_0x4db39d){return function(_0x35dd09){if(_0x35dd09){var _0x433e7d=typeof _0x4db39d[_0x82bd('0x17')]===_0x82bd('0x18')&&typeof _0x4db39d[_0x82bd('0x19')]===_0x82bd('0x18');var _0x387d21=_0x35dd09[_0x82bd('0x1a')];var _0x31a350=_0x433e7d?0x0:_0x4db39d[_0x82bd('0x17')];var _0x390107=_0x433e7d?_0x35dd09[_0x82bd('0x1a')]:_0x4db39d[_0x82bd('0x17')]+_0x4db39d[_0x82bd('0x19')];var _0x4a1e62;if(_0x390107>=_0x387d21){_0x390107=_0x387d21;_0x4a1e62=0xc8;}else{_0x4a1e62=0xce;}_0x3667ef['status'](_0x4a1e62);return _0x3667ef[_0x82bd('0x1b')](_0x82bd('0x1c'),_0x31a350+'-'+_0x390107+'/'+_0x387d21)[_0x82bd('0x1d')](_0x35dd09);}return null;};}function patchUpdates(_0xc9fcdf){return function(_0x34899b){try{jsonpatch[_0x82bd('0x1e')](_0x34899b,_0xc9fcdf,!![]);}catch(_0x2c1810){return BPromise[_0x82bd('0x1f')](_0x2c1810);}return _0x34899b[_0x82bd('0x20')]();};}function saveUpdates(_0x3291cd,_0x2caa29){return function(_0x177025){if(_0x177025){return _0x177025[_0x82bd('0x21')](_0x3291cd)[_0x82bd('0x22')](function(_0x3d9f03){return _0x3d9f03;});}return null;};}function removeEntity(_0x2d9d95,_0x13a42a){return function(_0x3b6b93){if(_0x3b6b93){return _0x3b6b93[_0x82bd('0x23')]()['then'](function(){_0x2d9d95['status'](0xcc)[_0x82bd('0x16')]();});}};}function handleEntityNotFound(_0x436ecd,_0x1cb292){return function(_0x3eb6a5){if(!_0x3eb6a5){_0x436ecd[_0x82bd('0x14')](0x194);}return _0x3eb6a5;};}function handleError(_0x10d101,_0x3c7751){_0x3c7751=_0x3c7751||0x1f4;return function(_0xbef23b){logger[_0x82bd('0x24')](_0xbef23b[_0x82bd('0x25')]);if(_0xbef23b['name']){delete _0xbef23b['name'];}_0x10d101['status'](_0x3c7751)['send'](_0xbef23b);};}exports[_0x82bd('0x26')]=function(_0x52bcd8,_0x351d3d){var _0x190bca={},_0x363ef9={},_0x50585e={'count':0x0,'rows':[]};var _0x516c6d=_['map'](db[_0x82bd('0x27')][_0x82bd('0x28')],function(_0x40884f){return{'name':_0x40884f['fieldName'],'type':_0x40884f[_0x82bd('0x29')]['key']};});_0x363ef9[_0x82bd('0x2a')]=_[_0x82bd('0x2b')](_[_0x82bd('0x2c')](_0x516c6d,_0x82bd('0x2d')),[_0x82bd('0x2e')]);_0x363ef9[_0x82bd('0x2f')]=_['keys'](_0x52bcd8[_0x82bd('0x2f')]);_0x363ef9[_0x82bd('0x30')]=_[_0x82bd('0x31')](_0x363ef9['model'],_0x363ef9[_0x82bd('0x2f')]);_0x190bca['attributes']=_['intersection'](_0x363ef9[_0x82bd('0x2a')],qs[_0x82bd('0x32')](_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x32')]));_0x190bca[_0x82bd('0x33')]=_0x190bca[_0x82bd('0x33')][_0x82bd('0x34')]?_0x190bca[_0x82bd('0x33')]:_0x363ef9[_0x82bd('0x2a')];if(!_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x35')](_0x82bd('0x36'))){_0x190bca[_0x82bd('0x19')]=qs[_0x82bd('0x19')](_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x19')]);_0x190bca[_0x82bd('0x17')]=qs['offset'](_0x52bcd8['query']['offset']);}_0x190bca[_0x82bd('0x37')]=qs[_0x82bd('0x38')](_0x52bcd8['query'][_0x82bd('0x38')]);_0x190bca['where']=qs['filters'](_['pick'](_0x52bcd8[_0x82bd('0x2f')],_0x363ef9[_0x82bd('0x30')]),_0x516c6d);if(_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x39')]){_0x190bca[_0x82bd('0x3a')]=_['merge'](_0x190bca['where'],{'$or':_['map'](_0x516c6d,function(_0x64bc54){if(_0x64bc54['type']!=='VIRTUAL'){var _0xba38a4={};_0xba38a4[_0x64bc54[_0x82bd('0x2d')]]={'$like':'%'+_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x39')]+'%'};return _0xba38a4;}})});}_0x190bca=_[_0x82bd('0x3b')]({},_0x190bca,_0x52bcd8[_0x82bd('0x3c')]);var _0x65335b={'where':_0x190bca[_0x82bd('0x3a')]};return db[_0x82bd('0x27')]['count'](_0x65335b)['then'](function(_0xe210f4){_0x50585e[_0x82bd('0x1a')]=_0xe210f4;if(_0x52bcd8['query']['includeAll']){_0x190bca[_0x82bd('0x3d')]=[{'all':!![]}];}return db[_0x82bd('0x27')]['findAll'](_0x190bca);})[_0x82bd('0x22')](function(_0x21868d){_0x50585e[_0x82bd('0x3e')]=_0x21868d;return _0x50585e;})[_0x82bd('0x22')](respondWithFilteredResult(_0x351d3d,_0x190bca))[_0x82bd('0x3f')](handleError(_0x351d3d,null));};exports[_0x82bd('0x40')]=function(_0x2a18c3,_0x2c429d){var _0x21d7d4={'raw':![],'where':{'id':_0x2a18c3[_0x82bd('0x41')]['id']}},_0x239d48={};_0x239d48[_0x82bd('0x2a')]=_['keys'](db[_0x82bd('0x27')][_0x82bd('0x28')]);_0x239d48['query']=_['keys'](_0x2a18c3[_0x82bd('0x2f')]);_0x239d48[_0x82bd('0x30')]=_[_0x82bd('0x31')](_0x239d48[_0x82bd('0x2a')],_0x239d48[_0x82bd('0x2f')]);_0x21d7d4['attributes']=_['intersection'](_0x239d48[_0x82bd('0x2a')],qs[_0x82bd('0x32')](_0x2a18c3['query'][_0x82bd('0x32')]));_0x21d7d4['attributes']=_0x21d7d4[_0x82bd('0x33')][_0x82bd('0x34')]?_0x21d7d4['attributes']:_0x239d48[_0x82bd('0x2a')];if(_0x2a18c3[_0x82bd('0x2f')]['includeAll']){_0x21d7d4['include']=[{'all':!![]}];}_0x21d7d4=_[_0x82bd('0x3b')]({},_0x21d7d4,_0x2a18c3['options']);return db[_0x82bd('0x27')][_0x82bd('0x42')](_0x21d7d4)[_0x82bd('0x22')](handleEntityNotFound(_0x2c429d,null))[_0x82bd('0x22')](respondWithResult(_0x2c429d,null))['catch'](handleError(_0x2c429d,null));};exports['create']=function(_0x1852f2,_0x5a0ca6){return db['ScreenRecording'][_0x82bd('0x43')](_0x1852f2[_0x82bd('0x44')],{})[_0x82bd('0x22')](respondWithResult(_0x5a0ca6,0xc9))['catch'](handleError(_0x5a0ca6,null));};exports[_0x82bd('0x21')]=function(_0x92ba88,_0x1db61b){if(_0x92ba88[_0x82bd('0x44')]['id']){delete _0x92ba88[_0x82bd('0x44')]['id'];}delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x45')];delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x46')];delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x47')];delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x48')];return db['ScreenRecording'][_0x82bd('0x42')]({'where':{'id':_0x92ba88[_0x82bd('0x41')]['id']}})['then'](handleEntityNotFound(_0x1db61b,null))[_0x82bd('0x22')](saveUpdates(_0x92ba88[_0x82bd('0x44')],null))[_0x82bd('0x22')](respondWithResult(_0x1db61b,null))[_0x82bd('0x3f')](handleError(_0x1db61b,null));};exports['describe']=function(_0x5b4fd2,_0x37d1f0){return db['ScreenRecording']['describe']()[_0x82bd('0x22')](respondWithResult(_0x37d1f0,null))['catch'](handleError(_0x37d1f0,null));};exports['download']=function(_0x31b41d,_0x3f94f3,_0x3dbee7){var _0xcfb5ef=require(_0x82bd('0x49'));var _0x1a7402=![];var _0x417c29={};if(_0x31b41d[_0x82bd('0x2f')][_0x82bd('0x29')]&&_0x31b41d[_0x82bd('0x2f')][_0x82bd('0x29')]===_0x82bd('0x4a')){_0x417c29[_0x82bd('0x4a')]=_0x31b41d[_0x82bd('0x41')]['id'];}else{_0x417c29['id']=_0x31b41d[_0x82bd('0x41')]['id'];}return db['ScreenRecording'][_0x82bd('0x42')]({'where':_0x417c29,'attributes':['id',_0x82bd('0x48')],'raw':!![]})[_0x82bd('0x22')](handleEntityNotFound(_0x3f94f3,null))[_0x82bd('0x22')](function(_0x9bf8fa){if(_0x9bf8fa){var _0x5466d9=path['join'](config['root'],'server/files/screen_recordings',_0x9bf8fa[_0x82bd('0x48')]);var _0x2cc6ea=util[_0x82bd('0x2e')](_0x82bd('0x4b'),_0x5466d9);if(fs['existsSync'](_0x2cc6ea)){_0x1a7402=!![];return _0xcfb5ef['decryptFile'](_0x2cc6ea,_0x5466d9,config[_0x82bd('0x4c')][_0x82bd('0x4d')])[_0x82bd('0x22')](function(){return _0x9bf8fa;});}return _0x9bf8fa;}})['then'](function(_0x2657bc){if(_0x2657bc){var _0x2252ef=path[_0x82bd('0x4e')](config[_0x82bd('0x4f')],_0x82bd('0x50'),_0x2657bc[_0x82bd('0x48')]);if(!fs[_0x82bd('0x51')](_0x2252ef)){throw new db[(_0x82bd('0x52'))][(_0x82bd('0x53'))](_0x82bd('0x54'));}if(_0x2657bc[_0x82bd('0x55')]){return _0x3f94f3[_0x82bd('0x56')](_0x2252ef,_0x2657bc[_0x82bd('0x55')]+path[_0x82bd('0x57')](_0x2252ef),function(){if(_0x1a7402){fs[_0x82bd('0x58')](_0x2252ef);}});}else{return _0x3f94f3[_0x82bd('0x56')](_0x2252ef,function(_0x124ca4){if(_0x1a7402){fs[_0x82bd('0x58')](_0x2252ef);}});}}})['catch'](function(_0x566b01){if(_0x566b01['message']==='ScreenRecording\x20not\x20found'){_0x3f94f3[_0x82bd('0x15')](0x194)['send'](_0x82bd('0x59'));}else{return handleError(_0x3f94f3,null);}});};exports[_0x82bd('0x23')]=function(_0x3ee7c7,_0x409b06){return db[_0x82bd('0x27')][_0x82bd('0x42')]({'where':{'id':_0x3ee7c7[_0x82bd('0x41')]['id']}})[_0x82bd('0x22')](function(_0x40d6cf){if(_[_0x82bd('0x5a')](_0x40d6cf)){throw new ReferenceError(_0x82bd('0x5b'));}return _0x40d6cf;})['then'](function(_0x4c54f0){var _0x419965=path[_0x82bd('0x4e')](config['root'],'server/files/screen_recordings',_0x4c54f0[_0x82bd('0x48')]);logger[_0x82bd('0x5c')](_0x82bd('0x5d'),_0x419965);if(!_[_0x82bd('0x5a')](_0x4c54f0['value'])&&fs[_0x82bd('0x51')](_0x419965)){logger['info'](_0x82bd('0x5e')+_0x419965+_0x82bd('0x5f'));fs['unlinkSync'](_0x419965);}_0x419965=_0x419965+_0x82bd('0x60');if(!_[_0x82bd('0x5a')](_0x4c54f0[_0x82bd('0x48')])&&fs[_0x82bd('0x51')](_0x419965)){logger['info'](_0x82bd('0x5e')+_0x419965+_0x82bd('0x5f'));fs[_0x82bd('0x61')](_0x419965);}return _0x4c54f0;})[_0x82bd('0x22')](function(_0x243fba){if(!_0x243fba)throw new InternalError();return _0x243fba[_0x82bd('0x23')]();})[_0x82bd('0x22')](function(){_0x409b06[_0x82bd('0x15')](0xcc)[_0x82bd('0x16')]();})['catch'](handleError(_0x409b06,null));}; \ No newline at end of file +var _0x4c4e=['findAll','rows','catch','params','keys','find','create','body','duration','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','secrets','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','send','Not\x20found','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','destroy','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../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','limit','count','set','apply','reject','save','update','then','sendStatus','name','index','map','ScreenRecording','rawAttributes','type','key','model','differenceBy','format','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include'];(function(_0x34b1b8,_0x54c9bf){var _0x542dd8=function(_0xff3f89){while(--_0xff3f89){_0x34b1b8['push'](_0x34b1b8['shift']());}};_0x542dd8(++_0x54c9bf);}(_0x4c4e,0x152));var _0xe4c4=function(_0x20b07d,_0x469187){_0x20b07d=_0x20b07d-0x0;var _0x418210=_0x4c4e[_0x20b07d];return _0x418210;};'use strict';var emlformat=require(_0xe4c4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe4c4('0x1'));var jsonpatch=require(_0xe4c4('0x2'));var rp=require(_0xe4c4('0x3'));var moment=require('moment');var BPromise=require(_0xe4c4('0x4'));var Mustache=require(_0xe4c4('0x5'));var util=require(_0xe4c4('0x6'));var path=require('path');var sox=require(_0xe4c4('0x7'));var csv=require('to-csv');var ejs=require(_0xe4c4('0x8'));var fs=require('fs');var fs_extra=require(_0xe4c4('0x9'));var _=require(_0xe4c4('0xa'));var squel=require(_0xe4c4('0xb'));var crypto=require(_0xe4c4('0xc'));var jsforce=require(_0xe4c4('0xd'));var deskjs=require(_0xe4c4('0xe'));var toCsv=require(_0xe4c4('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe4c4('0x10'));var authService=require(_0xe4c4('0x11'));var qs=require(_0xe4c4('0x12'));var as=require(_0xe4c4('0x13'));var hardwareService=require(_0xe4c4('0x14'));var logger=require(_0xe4c4('0x15'))('api');var utils=require(_0xe4c4('0x16'));var config=require(_0xe4c4('0x17'));var licenseUtil=require(_0xe4c4('0x18'));var db=require(_0xe4c4('0x19'))['db'];function respondWithStatusCode(_0x50bfab,_0x262083){_0x262083=_0x262083||0xcc;return function(_0x115802){if(_0x115802){return _0x50bfab['sendStatus'](_0x262083);}return _0x50bfab[_0xe4c4('0x1a')](_0x262083)[_0xe4c4('0x1b')]();};}function respondWithResult(_0x5aa89b,_0x42ce9e){_0x42ce9e=_0x42ce9e||0xc8;return function(_0x29766a){if(_0x29766a){return _0x5aa89b['status'](_0x42ce9e)[_0xe4c4('0x1c')](_0x29766a);}};}function respondWithFilteredResult(_0x465c9b,_0x26ea05){return function(_0x40a36e){if(_0x40a36e){var _0x19e59b=typeof _0x26ea05[_0xe4c4('0x1d')]===_0xe4c4('0x1e')&&typeof _0x26ea05[_0xe4c4('0x1f')]===_0xe4c4('0x1e');var _0x36b10c=_0x40a36e[_0xe4c4('0x20')];var _0x42242c=_0x19e59b?0x0:_0x26ea05[_0xe4c4('0x1d')];var _0x43a9ce=_0x19e59b?_0x40a36e[_0xe4c4('0x20')]:_0x26ea05['offset']+_0x26ea05[_0xe4c4('0x1f')];var _0x24f946;if(_0x43a9ce>=_0x36b10c){_0x43a9ce=_0x36b10c;_0x24f946=0xc8;}else{_0x24f946=0xce;}_0x465c9b[_0xe4c4('0x1a')](_0x24f946);return _0x465c9b[_0xe4c4('0x21')]('Content-Range',_0x42242c+'-'+_0x43a9ce+'/'+_0x36b10c)[_0xe4c4('0x1c')](_0x40a36e);}return null;};}function patchUpdates(_0x1cad5d){return function(_0x1727eb){try{jsonpatch[_0xe4c4('0x22')](_0x1727eb,_0x1cad5d,!![]);}catch(_0x2c5aea){return BPromise[_0xe4c4('0x23')](_0x2c5aea);}return _0x1727eb[_0xe4c4('0x24')]();};}function saveUpdates(_0x393c96,_0x21bbb1){return function(_0x1a7690){if(_0x1a7690){return _0x1a7690[_0xe4c4('0x25')](_0x393c96)[_0xe4c4('0x26')](function(_0x138ead){return _0x138ead;});}return null;};}function removeEntity(_0x1db719,_0x15873e){return function(_0x59498e){if(_0x59498e){return _0x59498e['destroy']()[_0xe4c4('0x26')](function(){_0x1db719['status'](0xcc)[_0xe4c4('0x1b')]();});}};}function handleEntityNotFound(_0x5374fd,_0x3adfcb){return function(_0x5efc4c){if(!_0x5efc4c){_0x5374fd[_0xe4c4('0x27')](0x194);}return _0x5efc4c;};}function handleError(_0x583393,_0xba53ef){_0xba53ef=_0xba53ef||0x1f4;return function(_0x4a0199){logger['error'](_0x4a0199['stack']);if(_0x4a0199['name']){delete _0x4a0199[_0xe4c4('0x28')];}_0x583393['status'](_0xba53ef)['send'](_0x4a0199);};}exports[_0xe4c4('0x29')]=function(_0x11deab,_0x4bb911){var _0x57ba43={},_0x7428ad={},_0x33de43={'count':0x0,'rows':[]};var _0x4aa6c1=_[_0xe4c4('0x2a')](db[_0xe4c4('0x2b')][_0xe4c4('0x2c')],function(_0x48060e){return{'name':_0x48060e['fieldName'],'type':_0x48060e[_0xe4c4('0x2d')][_0xe4c4('0x2e')]};});_0x7428ad[_0xe4c4('0x2f')]=_[_0xe4c4('0x30')](_['map'](_0x4aa6c1,'name'),[_0xe4c4('0x31')]);_0x7428ad[_0xe4c4('0x32')]=_['keys'](_0x11deab[_0xe4c4('0x32')]);_0x7428ad[_0xe4c4('0x33')]=_[_0xe4c4('0x34')](_0x7428ad['model'],_0x7428ad[_0xe4c4('0x32')]);_0x57ba43['attributes']=_[_0xe4c4('0x34')](_0x7428ad[_0xe4c4('0x2f')],qs[_0xe4c4('0x35')](_0x11deab[_0xe4c4('0x32')][_0xe4c4('0x35')]));_0x57ba43[_0xe4c4('0x36')]=_0x57ba43[_0xe4c4('0x36')][_0xe4c4('0x37')]?_0x57ba43[_0xe4c4('0x36')]:_0x7428ad[_0xe4c4('0x2f')];if(!_0x11deab[_0xe4c4('0x32')][_0xe4c4('0x38')]('nolimit')){_0x57ba43[_0xe4c4('0x1f')]=qs[_0xe4c4('0x1f')](_0x11deab[_0xe4c4('0x32')]['limit']);_0x57ba43[_0xe4c4('0x1d')]=qs[_0xe4c4('0x1d')](_0x11deab[_0xe4c4('0x32')]['offset']);}_0x57ba43[_0xe4c4('0x39')]=qs[_0xe4c4('0x3a')](_0x11deab[_0xe4c4('0x32')][_0xe4c4('0x3a')]);_0x57ba43[_0xe4c4('0x3b')]=qs[_0xe4c4('0x33')](_[_0xe4c4('0x3c')](_0x11deab[_0xe4c4('0x32')],_0x7428ad[_0xe4c4('0x33')]),_0x4aa6c1);if(_0x11deab[_0xe4c4('0x32')]['filter']){_0x57ba43[_0xe4c4('0x3b')]=_[_0xe4c4('0x3d')](_0x57ba43[_0xe4c4('0x3b')],{'$or':_[_0xe4c4('0x2a')](_0x4aa6c1,function(_0x4c5551){if(_0x4c5551[_0xe4c4('0x2d')]!==_0xe4c4('0x3e')){var _0x4e6bd9={};_0x4e6bd9[_0x4c5551[_0xe4c4('0x28')]]={'$like':'%'+_0x11deab[_0xe4c4('0x32')]['filter']+'%'};return _0x4e6bd9;}})});}_0x57ba43=_[_0xe4c4('0x3d')]({},_0x57ba43,_0x11deab[_0xe4c4('0x3f')]);var _0x127bcd={'where':_0x57ba43[_0xe4c4('0x3b')]};return db[_0xe4c4('0x2b')][_0xe4c4('0x20')](_0x127bcd)[_0xe4c4('0x26')](function(_0x43201e){_0x33de43[_0xe4c4('0x20')]=_0x43201e;if(_0x11deab[_0xe4c4('0x32')][_0xe4c4('0x40')]){_0x57ba43[_0xe4c4('0x41')]=[{'all':!![]}];}return db['ScreenRecording'][_0xe4c4('0x42')](_0x57ba43);})[_0xe4c4('0x26')](function(_0x2b306d){_0x33de43[_0xe4c4('0x43')]=_0x2b306d;return _0x33de43;})[_0xe4c4('0x26')](respondWithFilteredResult(_0x4bb911,_0x57ba43))[_0xe4c4('0x44')](handleError(_0x4bb911,null));};exports['show']=function(_0x312a49,_0x526bef){var _0xca07dc={'raw':![],'where':{'id':_0x312a49[_0xe4c4('0x45')]['id']}},_0x3c067a={};_0x3c067a[_0xe4c4('0x2f')]=_[_0xe4c4('0x46')](db['ScreenRecording']['rawAttributes']);_0x3c067a[_0xe4c4('0x32')]=_[_0xe4c4('0x46')](_0x312a49[_0xe4c4('0x32')]);_0x3c067a['filters']=_[_0xe4c4('0x34')](_0x3c067a[_0xe4c4('0x2f')],_0x3c067a[_0xe4c4('0x32')]);_0xca07dc[_0xe4c4('0x36')]=_['intersection'](_0x3c067a[_0xe4c4('0x2f')],qs[_0xe4c4('0x35')](_0x312a49[_0xe4c4('0x32')][_0xe4c4('0x35')]));_0xca07dc[_0xe4c4('0x36')]=_0xca07dc[_0xe4c4('0x36')][_0xe4c4('0x37')]?_0xca07dc[_0xe4c4('0x36')]:_0x3c067a[_0xe4c4('0x2f')];if(_0x312a49['query'][_0xe4c4('0x40')]){_0xca07dc['include']=[{'all':!![]}];}_0xca07dc=_[_0xe4c4('0x3d')]({},_0xca07dc,_0x312a49[_0xe4c4('0x3f')]);return db[_0xe4c4('0x2b')][_0xe4c4('0x47')](_0xca07dc)[_0xe4c4('0x26')](handleEntityNotFound(_0x526bef,null))[_0xe4c4('0x26')](respondWithResult(_0x526bef,null))[_0xe4c4('0x44')](handleError(_0x526bef,null));};exports[_0xe4c4('0x48')]=function(_0x36f8ad,_0x18fb82){return db[_0xe4c4('0x2b')][_0xe4c4('0x48')](_0x36f8ad[_0xe4c4('0x49')],{})[_0xe4c4('0x26')](respondWithResult(_0x18fb82,0xc9))['catch'](handleError(_0x18fb82,null));};exports['update']=function(_0xe0e351,_0x198961){if(_0xe0e351['body']['id']){delete _0xe0e351[_0xe4c4('0x49')]['id'];}delete _0xe0e351[_0xe4c4('0x49')][_0xe4c4('0x4a')];delete _0xe0e351[_0xe4c4('0x49')][_0xe4c4('0x4b')];delete _0xe0e351['body'][_0xe4c4('0x4c')];delete _0xe0e351[_0xe4c4('0x49')]['value'];return db[_0xe4c4('0x2b')][_0xe4c4('0x47')]({'where':{'id':_0xe0e351['params']['id']}})[_0xe4c4('0x26')](handleEntityNotFound(_0x198961,null))['then'](saveUpdates(_0xe0e351[_0xe4c4('0x49')],null))[_0xe4c4('0x26')](respondWithResult(_0x198961,null))[_0xe4c4('0x44')](handleError(_0x198961,null));};exports[_0xe4c4('0x4d')]=function(_0x12eaed,_0x525534){return db[_0xe4c4('0x2b')][_0xe4c4('0x4d')]()[_0xe4c4('0x26')](respondWithResult(_0x525534,null))[_0xe4c4('0x44')](handleError(_0x525534,null));};exports[_0xe4c4('0x4e')]=function(_0x32a50e,_0x3ddcbe,_0x3aa205){var _0x1a96ba=require(_0xe4c4('0x4f'));var _0x1fe354=![];var _0x1940e3={};if(_0x32a50e[_0xe4c4('0x32')][_0xe4c4('0x2d')]&&_0x32a50e[_0xe4c4('0x32')][_0xe4c4('0x2d')]==='uniqueid'){_0x1940e3[_0xe4c4('0x50')]=_0x32a50e[_0xe4c4('0x45')]['id'];}else{_0x1940e3['id']=_0x32a50e[_0xe4c4('0x45')]['id'];}return db['ScreenRecording'][_0xe4c4('0x47')]({'where':_0x1940e3,'attributes':['id',_0xe4c4('0x51')],'raw':!![]})[_0xe4c4('0x26')](handleEntityNotFound(_0x3ddcbe,null))['then'](function(_0x45f959){if(_0x45f959){var _0x485c50=path[_0xe4c4('0x52')](config[_0xe4c4('0x53')],_0xe4c4('0x54'),_0x45f959['value']);var _0x479361=util[_0xe4c4('0x31')](_0xe4c4('0x55'),_0x485c50);if(fs[_0xe4c4('0x56')](_0x479361)){_0x1fe354=!![];return _0x1a96ba['decryptFile'](_0x479361,_0x485c50,config[_0xe4c4('0x57')]['recording'])['then'](function(){return _0x45f959;});}return _0x45f959;}})['then'](function(_0x4e08ec){if(_0x4e08ec){var _0x1ca931=path[_0xe4c4('0x52')](config[_0xe4c4('0x53')],_0xe4c4('0x54'),_0x4e08ec[_0xe4c4('0x51')]);if(!fs[_0xe4c4('0x56')](_0x1ca931)){throw new db['Sequelize'][(_0xe4c4('0x58'))](_0xe4c4('0x59'));}if(_0x4e08ec[_0xe4c4('0x5a')]){return _0x3ddcbe[_0xe4c4('0x4e')](_0x1ca931,_0x4e08ec[_0xe4c4('0x5a')]+path[_0xe4c4('0x5b')](_0x1ca931),function(){if(_0x1fe354){fs['unlink'](_0x1ca931);}});}else{return _0x3ddcbe['download'](_0x1ca931,function(_0x27599b){if(_0x1fe354){fs[_0xe4c4('0x5c')](_0x1ca931);}});}}})[_0xe4c4('0x44')](function(_0x3c8e44){if(_0x3c8e44[_0xe4c4('0x5d')]===_0xe4c4('0x59')){_0x3ddcbe[_0xe4c4('0x1a')](0x194)[_0xe4c4('0x5e')](_0xe4c4('0x5f'));}else{return handleError(_0x3ddcbe,null);}});};exports['destroy']=function(_0x59f033,_0x5a4138){return db['ScreenRecording'][_0xe4c4('0x47')]({'where':{'id':_0x59f033[_0xe4c4('0x45')]['id']}})[_0xe4c4('0x26')](function(_0x58f2dd){if(_[_0xe4c4('0x60')](_0x58f2dd)){throw new ReferenceError('Entity\x20not\x20found');}return _0x58f2dd;})[_0xe4c4('0x26')](function(_0x56ead3){var _0x5d6c0a=path[_0xe4c4('0x52')](config[_0xe4c4('0x53')],_0xe4c4('0x54'),_0x56ead3['value']);logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x5d6c0a);if(!_[_0xe4c4('0x60')](_0x56ead3[_0xe4c4('0x51')])&&fs['existsSync'](_0x5d6c0a)){logger[_0xe4c4('0x61')](_0xe4c4('0x62')+_0x5d6c0a+_0xe4c4('0x63'));fs['unlinkSync'](_0x5d6c0a);}_0x5d6c0a=_0x5d6c0a+'.cypher';if(!_[_0xe4c4('0x60')](_0x56ead3[_0xe4c4('0x51')])&&fs[_0xe4c4('0x56')](_0x5d6c0a)){logger[_0xe4c4('0x61')](_0xe4c4('0x62')+_0x5d6c0a+_0xe4c4('0x63'));fs['unlinkSync'](_0x5d6c0a);}return _0x56ead3;})[_0xe4c4('0x26')](function(_0x1bddd5){if(!_0x1bddd5)throw new InternalError();return _0x1bddd5[_0xe4c4('0x64')]();})['then'](function(){_0x5a4138[_0xe4c4('0x1a')](0xcc)[_0xe4c4('0x1b')]();})[_0xe4c4('0x44')](handleError(_0x5a4138,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 06986e1..bf98d67 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 _0x1d70=['api','moment','bluebird','path','rimraf','./screenRecording.attributes','screen_recordings','interactionid','lodash','util'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x1d70,0x18e));var _0x01d7=function(_0x2ecba4,_0x25fd2e){_0x2ecba4=_0x2ecba4-0x0;var _0x17d463=_0x1d70[_0x2ecba4];return _0x17d463;};'use strict';var _=require(_0x01d7('0x0'));var util=require(_0x01d7('0x1'));var logger=require('../../config/logger')(_0x01d7('0x2'));var moment=require(_0x01d7('0x3'));var BPromise=require(_0x01d7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x01d7('0x5'));var rimraf=require(_0x01d7('0x6'));var config=require('../../config/environment');var attributes=require(_0x01d7('0x7'));module['exports']=function(_0x424030,_0x45b7b2){return _0x424030['define']('ScreenRecording',attributes,{'tableName':_0x01d7('0x8'),'paranoid':![],'indexes':[{'name':_0x01d7('0x9'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3fff=['../../config/logger','api','moment','request-promise','path','./screenRecording.attributes','exports','lodash','util'];(function(_0x4d954f,_0x41c1df){var _0x2c6db2=function(_0x2ab407){while(--_0x2ab407){_0x4d954f['push'](_0x4d954f['shift']());}};_0x2c6db2(++_0x41c1df);}(_0x3fff,0x1e4));var _0xf3ff=function(_0xde8111,_0x15702c){_0xde8111=_0xde8111-0x0;var _0x29af0b=_0x3fff[_0xde8111];return _0x29af0b;};'use strict';var _=require(_0xf3ff('0x0'));var util=require(_0xf3ff('0x1'));var logger=require(_0xf3ff('0x2'))(_0xf3ff('0x3'));var moment=require(_0xf3ff('0x4'));var BPromise=require('bluebird');var rp=require(_0xf3ff('0x5'));var fs=require('fs');var path=require(_0xf3ff('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf3ff('0x7'));module[_0xf3ff('0x8')]=function(_0x1b51e9,_0x566dd0){return _0x1b51e9['define']('ScreenRecording',attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index a3b0b4a..86c0dfc 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 _0x2495=['ScreenRecording,\x20%s,\x20%s','message','result','lodash','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xe7a2ce,_0x988cb9){var _0xfa0470=function(_0x381fb1){while(--_0x381fb1){_0xe7a2ce['push'](_0xe7a2ce['shift']());}};_0xfa0470(++_0x988cb9);}(_0x2495,0x111));var _0x5249=function(_0x491d35,_0x43f6e5){_0x491d35=_0x491d35-0x0;var _0x5a2de7=_0x2495[_0x491d35];return _0x5a2de7;};'use strict';var _=require(_0x5249('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5249('0x1'));var rs=require(_0x5249('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5249('0x3'))(_0x5249('0x4'));var config=require(_0x5249('0x5'));var jayson=require(_0x5249('0x6'));var client=jayson[_0x5249('0x7')][_0x5249('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2c66fd,_0x52843c,_0x255ff9){return new BPromise(function(_0x22365d,_0x14d5d6){return client[_0x5249('0x9')](_0x2c66fd,_0x255ff9)['then'](function(_0x1510b7){logger['info']('ScreenRecording,\x20%s,\x20%s',_0x52843c,_0x5249('0xa'));logger[_0x5249('0xb')](_0x5249('0xc'),_0x52843c,_0x5249('0xa'),JSON[_0x5249('0xd')](_0x1510b7));if(_0x1510b7['error']){if(_0x1510b7['error']['code']===0x1f4){logger[_0x5249('0xe')](_0x5249('0xf'),_0x52843c,_0x1510b7[_0x5249('0xe')][_0x5249('0x10')]);return _0x14d5d6(_0x1510b7[_0x5249('0xe')]['message']);}logger['error'](_0x5249('0xf'),_0x52843c,_0x1510b7[_0x5249('0xe')]['message']);return _0x22365d(_0x1510b7[_0x5249('0xe')]['message']);}else{logger['info'](_0x5249('0xf'),_0x52843c,'request\x20sent');_0x22365d(_0x1510b7[_0x5249('0x11')][_0x5249('0x10')]);}})['catch'](function(_0x37dd44){logger[_0x5249('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x52843c,_0x37dd44);_0x14d5d6(_0x37dd44);});});} \ No newline at end of file +var _0x05b6=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','lodash','moment','bluebird','randomstring'];(function(_0x20c205,_0x39bc5e){var _0x3d6cf2=function(_0x209286){while(--_0x209286){_0x20c205['push'](_0x20c205['shift']());}};_0x3d6cf2(++_0x39bc5e);}(_0x05b6,0x1c8));var _0x605b=function(_0x3fbb91,_0x5ec106){_0x3fbb91=_0x3fbb91-0x0;var _0x3eb213=_0x05b6[_0x3fbb91];return _0x3eb213;};'use strict';var _=require(_0x605b('0x0'));var util=require('util');var moment=require(_0x605b('0x1'));var BPromise=require(_0x605b('0x2'));var rs=require(_0x605b('0x3'));var fs=require('fs');var Redis=require(_0x605b('0x4'));var db=require(_0x605b('0x5'))['db'];var utils=require(_0x605b('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x605b('0x7'));var jayson=require(_0x605b('0x8'));var client=jayson[_0x605b('0x9')][_0x605b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x369e36,_0x3bc844,_0x5d3cb7){return new BPromise(function(_0x2a93c7,_0x4de2dd){return client[_0x605b('0xb')](_0x369e36,_0x5d3cb7)[_0x605b('0xc')](function(_0x573506){logger['info'](_0x605b('0xd'),_0x3bc844,_0x605b('0xe'));logger['debug']('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x3bc844,_0x605b('0xe'),JSON['stringify'](_0x573506));if(_0x573506[_0x605b('0xf')]){if(_0x573506[_0x605b('0xf')][_0x605b('0x10')]===0x1f4){logger['error'](_0x605b('0xd'),_0x3bc844,_0x573506[_0x605b('0xf')][_0x605b('0x11')]);return _0x4de2dd(_0x573506[_0x605b('0xf')]['message']);}logger[_0x605b('0xf')](_0x605b('0xd'),_0x3bc844,_0x573506[_0x605b('0xf')]['message']);return _0x2a93c7(_0x573506[_0x605b('0xf')]['message']);}else{logger[_0x605b('0x12')](_0x605b('0xd'),_0x3bc844,'request\x20sent');_0x2a93c7(_0x573506['result'][_0x605b('0x11')]);}})[_0x605b('0x13')](function(_0x17849e){logger[_0x605b('0xf')](_0x605b('0xd'),_0x3bc844,_0x17849e);_0x4de2dd(_0x17849e);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 53ce904..00574d4 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 _0x67cf=['addLogoLogin','server/files/images/logos/','preferred','post','/:id/preferred','addPreferred','favicon','file','addFavicon','/:id','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./setting.controller','isAuthenticated','index','getDate','get','show','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','%s%s','logo','extname','originalname','/:id/logo','single','format'];(function(_0x4c259c,_0x2183a0){var _0x39e6a2=function(_0x353d90){while(--_0x353d90){_0x4c259c['push'](_0x4c259c['shift']());}};_0x39e6a2(++_0x2183a0);}(_0x67cf,0xd8));var _0xf67c=function(_0x57014b,_0x360c0f){_0x57014b=_0x57014b-0x0;var _0x2b258a=_0x67cf[_0x57014b];return _0x2b258a;};'use strict';var multer=require(_0xf67c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf67c('0x1'));var express=require(_0xf67c('0x2'));var router=express[_0xf67c('0x3')]();var fs_extra=require(_0xf67c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf67c('0x5'));var config=require('../../config/environment');var controller=require(_0xf67c('0x6'));router['get']('/',auth[_0xf67c('0x7')](),controller[_0xf67c('0x8')]);router['get']('/now',controller[_0xf67c('0x9')]);router[_0xf67c('0xa')]('/:id',controller[_0xf67c('0xb')]);router[_0xf67c('0xa')]('/:id/logo',controller[_0xf67c('0xc')]);router[_0xf67c('0xa')](_0xf67c('0xd'),controller[_0xf67c('0xe')]);router[_0xf67c('0xa')](_0xf67c('0xf'),controller[_0xf67c('0x10')]);router[_0xf67c('0xa')]('/:id/preferred',controller[_0xf67c('0x11')]);router['get'](_0xf67c('0x12'),controller[_0xf67c('0x13')]);var upload=multer({'storage':multer[_0xf67c('0x14')]({'destination':function(_0xb198e1,_0x475cdb,_0x51a90c){_0x51a90c(null,path[_0xf67c('0x15')](config[_0xf67c('0x16')],'server/files/images/logos/'));},'filename':function(_0xddb7fa,_0x32126a,_0x380a38){_0x380a38(null,util['format'](_0xf67c('0x17'),_0xf67c('0x18'),path[_0xf67c('0x19')](_0x32126a[_0xf67c('0x1a')])));}})});router['post'](_0xf67c('0x1b'),upload[_0xf67c('0x1c')]('file'),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3dd4f6,_0x29ecf3,_0x3fba74){_0x3fba74(null,path[_0xf67c('0x15')](config[_0xf67c('0x16')],'server/files/images/logos/'));},'filename':function(_0x154027,_0x39387c,_0x1b613c){_0x1b613c(null,util[_0xf67c('0x1d')](_0xf67c('0x17'),'logologin',path[_0xf67c('0x19')](_0x39387c[_0xf67c('0x1a')])));}})});router['post'](_0xf67c('0xd'),upload[_0xf67c('0x1c')]('file'),controller[_0xf67c('0x1e')]);var upload=multer({'storage':multer[_0xf67c('0x14')]({'destination':function(_0x59944d,_0x90b5ff,_0x122850){_0x122850(null,path[_0xf67c('0x15')](config['root'],_0xf67c('0x1f')));},'filename':function(_0x4764d9,_0x43339c,_0x68e505){_0x68e505(null,util[_0xf67c('0x1d')]('%s%s',_0xf67c('0x20'),path['extname'](_0x43339c['originalname'])));}})});router[_0xf67c('0x21')](_0xf67c('0x22'),upload[_0xf67c('0x1c')]('file'),controller[_0xf67c('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x25c8df,_0x1841c4,_0x1e70c5){_0x1e70c5(null,path[_0xf67c('0x15')](config['root'],'server/files/images/logos/'));},'filename':function(_0x5a1d50,_0x43e5b4,_0x46c668){_0x46c668(null,util[_0xf67c('0x1d')](_0xf67c('0x17'),_0xf67c('0x24'),path['extname'](_0x43e5b4['originalname'])));}})});router['post'](_0xf67c('0x12'),upload[_0xf67c('0x1c')](_0xf67c('0x25')),controller[_0xf67c('0x26')]);router['put'](_0xf67c('0x27'),auth['isAuthenticated'](),controller['update']);module[_0xf67c('0x28')]=router; \ No newline at end of file +var _0xbed5=['root','server/files/images/logos/','format','%s%s','originalname','post','single','logologin','extname','file','preferred','addPreferred','favicon','addFavicon','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','index','getDate','/:id','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join'];(function(_0xd99f27,_0x2cabf9){var _0x4725ab=function(_0x45188d){while(--_0x45188d){_0xd99f27['push'](_0xd99f27['shift']());}};_0x4725ab(++_0x2cabf9);}(_0xbed5,0x1ef));var _0x5bed=function(_0x4293be,_0x4cf6d0){_0x4293be=_0x4293be-0x0;var _0x366840=_0xbed5[_0x4293be];return _0x366840;};'use strict';var multer=require(_0x5bed('0x0'));var util=require(_0x5bed('0x1'));var path=require(_0x5bed('0x2'));var timeout=require('connect-timeout');var express=require(_0x5bed('0x3'));var router=express[_0x5bed('0x4')]();var fs_extra=require(_0x5bed('0x5'));var auth=require(_0x5bed('0x6'));var interaction=require(_0x5bed('0x7'));var config=require(_0x5bed('0x8'));var controller=require(_0x5bed('0x9'));router[_0x5bed('0xa')]('/',auth['isAuthenticated'](),controller[_0x5bed('0xb')]);router['get']('/now',controller[_0x5bed('0xc')]);router['get'](_0x5bed('0xd'),controller['show']);router[_0x5bed('0xa')](_0x5bed('0xe'),controller['getLogo']);router['get'](_0x5bed('0xf'),controller[_0x5bed('0x10')]);router[_0x5bed('0xa')](_0x5bed('0x11'),controller[_0x5bed('0x12')]);router[_0x5bed('0xa')](_0x5bed('0x13'),controller[_0x5bed('0x14')]);router[_0x5bed('0xa')](_0x5bed('0x15'),controller[_0x5bed('0x16')]);var upload=multer({'storage':multer[_0x5bed('0x17')]({'destination':function(_0x4aee1f,_0x19d574,_0x127b25){_0x127b25(null,path[_0x5bed('0x18')](config[_0x5bed('0x19')],_0x5bed('0x1a')));},'filename':function(_0x4ea390,_0x5e785c,_0x40b491){_0x40b491(null,util[_0x5bed('0x1b')](_0x5bed('0x1c'),'logo',path['extname'](_0x5e785c[_0x5bed('0x1d')])));}})});router[_0x5bed('0x1e')](_0x5bed('0xe'),upload[_0x5bed('0x1f')]('file'),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3cba3f,_0x3c3765,_0xd20c64){_0xd20c64(null,path[_0x5bed('0x18')](config[_0x5bed('0x19')],_0x5bed('0x1a')));},'filename':function(_0x559f78,_0x5d9983,_0x131bb6){_0x131bb6(null,util['format'](_0x5bed('0x1c'),_0x5bed('0x20'),path[_0x5bed('0x21')](_0x5d9983['originalname'])));}})});router[_0x5bed('0x1e')](_0x5bed('0xf'),upload['single'](_0x5bed('0x22')),controller['addLogoLogin']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x39c929,_0x8f478e,_0x1c03c0){_0x1c03c0(null,path['join'](config['root'],_0x5bed('0x1a')));},'filename':function(_0x490921,_0x1bb624,_0xa1c251){_0xa1c251(null,util[_0x5bed('0x1b')](_0x5bed('0x1c'),_0x5bed('0x23'),path['extname'](_0x1bb624[_0x5bed('0x1d')])));}})});router[_0x5bed('0x1e')](_0x5bed('0x13'),upload['single'](_0x5bed('0x22')),controller[_0x5bed('0x24')]);var upload=multer({'storage':multer[_0x5bed('0x17')]({'destination':function(_0x16dba8,_0x6abfab,_0xc56e70){_0xc56e70(null,path[_0x5bed('0x18')](config[_0x5bed('0x19')],'server/files/images/logos/'));},'filename':function(_0x40caad,_0x313d56,_0x4168bc){_0x4168bc(null,util[_0x5bed('0x1b')]('%s%s',_0x5bed('0x25'),path['extname'](_0x313d56['originalname'])));}})});router['post']('/:id/favicon',upload[_0x5bed('0x1f')](_0x5bed('0x22')),controller[_0x5bed('0x26')]);router['put'](_0x5bed('0xd'),auth['isAuthenticated'](),controller['update']);module[_0x5bed('0x27')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 9f45b2e..73f4d63 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 _0xd8b0=['alternate','UNSIGNED','sequelize','exports','min_mailbox','INTEGER','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0d8b('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x0d8b('0x3')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0d8b('0x4')],'defaultValue':_0x0d8b('0x5')},'logo':{'type':Sequelize[_0x0d8b('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0d8b('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x0d8b('0x4')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0x0d8b('0x4')]},'turnpassword':{'type':Sequelize[_0x0d8b('0x4')]},'pageTitle':{'type':Sequelize[_0x0d8b('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0d8b('0x3')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0d8b('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x0d8b('0x3')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0d8b('0x3')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0d8b('0x3')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0d8b('0x4')],'defaultValue':_0x0d8b('0x7')},'chatTimeout':{'type':Sequelize[_0x0d8b('0x3')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x0d8b('0x4')]},'defaultPreferred':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0d8b('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0d8b('0x3')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0d8b('0x3')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0d8b('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0d8b('0x3')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x0d8b('0x3')]},'transcribeRegion':{'type':Sequelize[_0x0d8b('0x4')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0d8b('0x3')]},'sentimentRegion':{'type':Sequelize[_0x0d8b('0x4')]},'language':{'type':Sequelize[_0x0d8b('0x4')]},'bucket':{'type':Sequelize[_0x0d8b('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x0d8b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0d8b('0x3')](0x2)[_0x0d8b('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0d8b('0x3')](0x2)[_0x0d8b('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0d8b('0x3')](0x2)[_0x0d8b('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0d8b('0x3')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x3d867a,_0xef01ff){var _0x39e95a=function(_0x2b1c31){while(--_0x2b1c31){_0x3d867a['push'](_0x3d867a['shift']());}};_0x39e95a(++_0xef01ff);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index f3fc96a..7b34279 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 _0xbdfd=['query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','show','params','include','find','body','addLogo','file','filename','loginLogo','getLicense','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default','upperFirst','default_logo.svg','Sequelize','ValidationError','download','default_loginLogo.svg','custom','\x20not\x20found','gdpr','addPreferred','getPreferred','server/files/images/logos','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','Setting','rawAttributes','type','key'];(function(_0x1559b5,_0x3e6332){var _0x5ce77f=function(_0x372cab){while(--_0x372cab){_0x1559b5['push'](_0x1559b5['shift']());}};_0x5ce77f(++_0x3e6332);}(_0xbdfd,0x135));var _0xdbdf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbdfd[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xdbdf('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdbdf('0x1'));var rp=require(_0xdbdf('0x2'));var moment=require(_0xdbdf('0x3'));var BPromise=require(_0xdbdf('0x4'));var Mustache=require('mustache');var util=require(_0xdbdf('0x5'));var path=require(_0xdbdf('0x6'));var sox=require('sox');var csv=require(_0xdbdf('0x7'));var ejs=require(_0xdbdf('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdbdf('0x9'));var squel=require(_0xdbdf('0xa'));var crypto=require(_0xdbdf('0xb'));var jsforce=require(_0xdbdf('0xc'));var deskjs=require(_0xdbdf('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdbdf('0xe'));var Papa=require(_0xdbdf('0xf'));var Redis=require(_0xdbdf('0x10'));var authService=require(_0xdbdf('0x11'));var qs=require(_0xdbdf('0x12'));var as=require(_0xdbdf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdbdf('0x14'));var utils=require(_0xdbdf('0x15'));var config=require(_0xdbdf('0x16'));var licenseUtil=require(_0xdbdf('0x17'));var db=require(_0xdbdf('0x18'))['db'];var jayson=require(_0xdbdf('0x19'));var client=jayson['client'][_0xdbdf('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x191420,_0x33b716,_0xc1de13,_0x45b824){return new BPromise(function(_0x24dfde,_0xae4a21){var _0x4876cb=_0x45b824||client;return _0x4876cb[_0xdbdf('0x1b')](_0x191420,_0xc1de13)[_0xdbdf('0x1c')](function(_0x98c104){logger[_0xdbdf('0x1d')](_0xdbdf('0x1e'),_0x33b716,'request\x20sent');logger[_0xdbdf('0x1f')](_0xdbdf('0x20'),_0x33b716,_0xdbdf('0x21'),JSON[_0xdbdf('0x22')](_0x98c104));if(_0x98c104[_0xdbdf('0x23')]){if(_0x98c104[_0xdbdf('0x23')][_0xdbdf('0x24')]===0x1f4){logger[_0xdbdf('0x23')](_0xdbdf('0x1e'),_0x33b716,_0x98c104[_0xdbdf('0x23')][_0xdbdf('0x25')]);return _0xae4a21(_0x98c104[_0xdbdf('0x23')]['message']);}logger[_0xdbdf('0x23')](_0xdbdf('0x1e'),_0x33b716,_0x98c104[_0xdbdf('0x23')][_0xdbdf('0x25')]);return _0x24dfde(_0x98c104[_0xdbdf('0x23')][_0xdbdf('0x25')]);}else{logger[_0xdbdf('0x1d')](_0xdbdf('0x1e'),_0x33b716,'request\x20sent');_0x24dfde(_0x98c104[_0xdbdf('0x26')][_0xdbdf('0x25')]);}})[_0xdbdf('0x27')](function(_0xe629d2){logger['error'](_0xdbdf('0x1e'),_0x33b716,_0xe629d2);_0xae4a21(_0xe629d2);});});}function respondWithStatusCode(_0x3f02b8,_0x237d86){_0x237d86=_0x237d86||0xcc;return function(_0x563628){if(_0x563628){return _0x3f02b8[_0xdbdf('0x28')](_0x237d86);}return _0x3f02b8[_0xdbdf('0x29')](_0x237d86)[_0xdbdf('0x2a')]();};}function respondWithResult(_0x16fc97,_0x5219f9){_0x5219f9=_0x5219f9||0xc8;return function(_0x3446f2){if(_0x3446f2){return _0x16fc97[_0xdbdf('0x29')](_0x5219f9)[_0xdbdf('0x2b')](_0x3446f2);}};}function respondWithFilteredResult(_0x23b080,_0x1bc27b){return function(_0xcd0ee7){if(_0xcd0ee7){var _0x2dac85=typeof _0x1bc27b[_0xdbdf('0x2c')]===_0xdbdf('0x2d')&&typeof _0x1bc27b[_0xdbdf('0x2e')]==='undefined';var _0x5c09e4=_0xcd0ee7[_0xdbdf('0x2f')];var _0x501ca8=_0x2dac85?0x0:_0x1bc27b[_0xdbdf('0x2c')];var _0xfa1cd9=_0x2dac85?_0xcd0ee7[_0xdbdf('0x2f')]:_0x1bc27b[_0xdbdf('0x2c')]+_0x1bc27b[_0xdbdf('0x2e')];var _0x450ad5;if(_0xfa1cd9>=_0x5c09e4){_0xfa1cd9=_0x5c09e4;_0x450ad5=0xc8;}else{_0x450ad5=0xce;}_0x23b080[_0xdbdf('0x29')](_0x450ad5);return _0x23b080[_0xdbdf('0x30')](_0xdbdf('0x31'),_0x501ca8+'-'+_0xfa1cd9+'/'+_0x5c09e4)['json'](_0xcd0ee7);}return null;};}function patchUpdates(_0x46da0b){return function(_0x2a1a92){try{jsonpatch['apply'](_0x2a1a92,_0x46da0b,!![]);}catch(_0x32c7a4){return BPromise[_0xdbdf('0x32')](_0x32c7a4);}return _0x2a1a92[_0xdbdf('0x33')]();};}function saveUpdates(_0x8b0b0f,_0x2a17f1){return function(_0x530757){if(_0x530757){return _0x530757[_0xdbdf('0x34')](_0x8b0b0f)[_0xdbdf('0x1c')](function(_0x4eaf57){return _0x4eaf57;});}return null;};}function removeEntity(_0xe33de9,_0x380296){return function(_0x437901){if(_0x437901){return _0x437901[_0xdbdf('0x35')]()[_0xdbdf('0x1c')](function(){_0xe33de9[_0xdbdf('0x29')](0xcc)[_0xdbdf('0x2a')]();});}};}function handleEntityNotFound(_0x498417,_0x4b8ad4){return function(_0x4b2180){if(!_0x4b2180){_0x498417[_0xdbdf('0x28')](0x194);}return _0x4b2180;};}function handleError(_0x480d42,_0x310e14){_0x310e14=_0x310e14||0x1f4;return function(_0x54724a){logger['error'](_0x54724a[_0xdbdf('0x36')]);if(_0x54724a[_0xdbdf('0x37')]){delete _0x54724a[_0xdbdf('0x37')];}_0x480d42[_0xdbdf('0x29')](_0x310e14)[_0xdbdf('0x38')](_0x54724a);};}exports[_0xdbdf('0x39')]=function(_0x3a507b,_0x4925c7){var _0x1025df={},_0x1ae043={},_0x189413={'count':0x0,'rows':[]};var _0x3f4eec=_[_0xdbdf('0x3a')](db[_0xdbdf('0x3b')][_0xdbdf('0x3c')],function(_0x1bb441){return{'name':_0x1bb441['fieldName'],'type':_0x1bb441[_0xdbdf('0x3d')][_0xdbdf('0x3e')]};});_0x1ae043['model']=_[_0xdbdf('0x3a')](_0x3f4eec,_0xdbdf('0x37'));_0x1ae043[_0xdbdf('0x3f')]=_[_0xdbdf('0x40')](_0x3a507b['query']);_0x1ae043[_0xdbdf('0x41')]=_['intersection'](_0x1ae043[_0xdbdf('0x42')],_0x1ae043['query']);_0x1025df['attributes']=_[_0xdbdf('0x43')](_0x1ae043['model'],qs[_0xdbdf('0x44')](_0x3a507b[_0xdbdf('0x3f')][_0xdbdf('0x44')]));_0x1025df[_0xdbdf('0x45')]=_0x1025df[_0xdbdf('0x45')][_0xdbdf('0x46')]?_0x1025df['attributes']:_0x1ae043['model'];if(!_0x3a507b[_0xdbdf('0x3f')][_0xdbdf('0x47')](_0xdbdf('0x48'))){_0x1025df[_0xdbdf('0x2e')]=qs['limit'](_0x3a507b[_0xdbdf('0x3f')]['limit']);_0x1025df[_0xdbdf('0x2c')]=qs[_0xdbdf('0x2c')](_0x3a507b[_0xdbdf('0x3f')][_0xdbdf('0x2c')]);}_0x1025df[_0xdbdf('0x49')]=qs['sort'](_0x3a507b[_0xdbdf('0x3f')][_0xdbdf('0x4a')]);_0x1025df['where']=qs[_0xdbdf('0x41')](_['pick'](_0x3a507b[_0xdbdf('0x3f')],_0x1ae043['filters']),_0x3f4eec);if(_0x3a507b[_0xdbdf('0x3f')]['filter']){_0x1025df[_0xdbdf('0x4b')]=_[_0xdbdf('0x4c')](_0x1025df[_0xdbdf('0x4b')],{'$or':_[_0xdbdf('0x3a')](_0x3f4eec,function(_0x23136e){if(_0x23136e[_0xdbdf('0x3d')]!==_0xdbdf('0x4d')){var _0x17d7e1={};_0x17d7e1[_0x23136e[_0xdbdf('0x37')]]={'$like':'%'+_0x3a507b[_0xdbdf('0x3f')][_0xdbdf('0x4e')]+'%'};return _0x17d7e1;}})});}_0x1025df=_['merge']({},_0x1025df,_0x3a507b[_0xdbdf('0x4f')]);var _0x58c0cb={'where':_0x1025df[_0xdbdf('0x4b')]};return db[_0xdbdf('0x3b')][_0xdbdf('0x2f')](_0x58c0cb)[_0xdbdf('0x1c')](function(_0x3b0fc3){_0x189413['count']=_0x3b0fc3;if(_0x3a507b[_0xdbdf('0x3f')][_0xdbdf('0x50')]){_0x1025df['include']=[{'all':!![]}];}return db[_0xdbdf('0x3b')]['findAll'](_0x1025df);})[_0xdbdf('0x1c')](function(_0x446ca5){_0x189413['rows']=_0x446ca5;return _0x189413;})[_0xdbdf('0x1c')](respondWithFilteredResult(_0x4925c7,_0x1025df))[_0xdbdf('0x27')](handleError(_0x4925c7,null));};exports[_0xdbdf('0x51')]=function(_0x40ca3e,_0x2a6066){var _0x433aef={'raw':![],'where':{'id':_0x40ca3e[_0xdbdf('0x52')]['id']}},_0x257d43={};_0x257d43[_0xdbdf('0x42')]=_[_0xdbdf('0x40')](db['Setting'][_0xdbdf('0x3c')]);_0x257d43[_0xdbdf('0x3f')]=_[_0xdbdf('0x40')](_0x40ca3e[_0xdbdf('0x3f')]);_0x257d43[_0xdbdf('0x41')]=_[_0xdbdf('0x43')](_0x257d43[_0xdbdf('0x42')],_0x257d43[_0xdbdf('0x3f')]);_0x433aef['attributes']=_[_0xdbdf('0x43')](_0x257d43['model'],qs[_0xdbdf('0x44')](_0x40ca3e['query'][_0xdbdf('0x44')]));_0x433aef['attributes']=_0x433aef[_0xdbdf('0x45')]['length']?_0x433aef[_0xdbdf('0x45')]:_0x257d43[_0xdbdf('0x42')];if(_0x40ca3e[_0xdbdf('0x3f')][_0xdbdf('0x50')]){_0x433aef[_0xdbdf('0x53')]=[{'all':!![]}];}_0x433aef=_[_0xdbdf('0x4c')]({},_0x433aef,_0x40ca3e['options']);return db[_0xdbdf('0x3b')][_0xdbdf('0x54')](_0x433aef)[_0xdbdf('0x1c')](handleEntityNotFound(_0x2a6066,null))[_0xdbdf('0x1c')](respondWithResult(_0x2a6066,null))[_0xdbdf('0x27')](handleError(_0x2a6066,null));};exports[_0xdbdf('0x34')]=function(_0x454387,_0x289bea){if(_0x454387[_0xdbdf('0x55')]['id']){delete _0x454387[_0xdbdf('0x55')]['id'];}return db[_0xdbdf('0x3b')][_0xdbdf('0x54')]({'where':{'id':_0x454387['params']['id']}})[_0xdbdf('0x1c')](handleEntityNotFound(_0x289bea,null))[_0xdbdf('0x1c')](saveUpdates(_0x454387['body'],null))[_0xdbdf('0x1c')](respondWithResult(_0x289bea,null))[_0xdbdf('0x27')](handleError(_0x289bea,null));};exports[_0xdbdf('0x56')]=function(_0x3fbfac,_0x1fd0c5,_0x1f5f4f){if(_0x3fbfac[_0xdbdf('0x57')]&&_0x3fbfac['file'][_0xdbdf('0x58')]){_0x3fbfac[_0xdbdf('0x55')]['logo']=_0x3fbfac[_0xdbdf('0x57')][_0xdbdf('0x58')];}return db['Setting'][_0xdbdf('0x54')]({'where':{'id':_0x3fbfac[_0xdbdf('0x52')]['id']}})['then'](handleEntityNotFound(_0x1fd0c5,null))['then'](saveUpdates(_0x3fbfac[_0xdbdf('0x55')],null))[_0xdbdf('0x1c')](respondWithResult(_0x1fd0c5,null))['catch'](handleError(_0x1fd0c5,null));};exports['addLogoLogin']=function(_0x2b79ce,_0x5f18fa,_0x2315a3){if(_0x2b79ce[_0xdbdf('0x57')]&&_0x2b79ce[_0xdbdf('0x57')][_0xdbdf('0x58')]){_0x2b79ce[_0xdbdf('0x55')][_0xdbdf('0x59')]=_0x2b79ce['file'][_0xdbdf('0x58')];}return db[_0xdbdf('0x3b')][_0xdbdf('0x54')]({'where':{'id':_0x2b79ce[_0xdbdf('0x52')]['id']}})['then'](handleEntityNotFound(_0x5f18fa,null))['then'](saveUpdates(_0x2b79ce[_0xdbdf('0x55')],null))['then'](respondWithResult(_0x5f18fa,null))[_0xdbdf('0x27')](handleError(_0x5f18fa,null));};var utilLicense=require(_0xdbdf('0x17'));exports['getLogo']=function(_0x555313,_0x59428a,_0x2cbfc0){var _0xd94e49='server/files/images/logos';var _0x339d47={'custom':![]};return utilLicense[_0xdbdf('0x5a')]()[_0xdbdf('0x1c')](function(_0x1b44ba){if(_0x1b44ba){_0x339d47=_0x1b44ba;}return db[_0xdbdf('0x3b')][_0xdbdf('0x54')]({'where':{'id':_0x555313[_0xdbdf('0x52')]['id']},'attributes':[_0xdbdf('0x5b'),_0xdbdf('0x59'),_0xdbdf('0x5c'),_0xdbdf('0x5d'),_0xdbdf('0x5e'),_0xdbdf('0x5f'),_0xdbdf('0x60'),_0xdbdf('0x61')],'raw':!![]});})[_0xdbdf('0x1c')](handleEntityNotFound(_0x59428a,null))['then'](function(_0x3d3a67){if(_0x3d3a67){var _0x5c4139=_0x3d3a67['logo']&&fs[_0xdbdf('0x62')](path[_0xdbdf('0x63')](config[_0xdbdf('0x64')],_0xd94e49,_[_0xdbdf('0x65')](_0x3d3a67['logo'])))?path[_0xdbdf('0x63')](config[_0xdbdf('0x64')],_0xd94e49,_[_0xdbdf('0x65')](_0x3d3a67[_0xdbdf('0x5b')])):path[_0xdbdf('0x63')](config[_0xdbdf('0x64')],_0xd94e49,_[_0xdbdf('0x65')]('default_logo.svg'));var _0x187a5a=_0xdbdf('0x66')+_[_0xdbdf('0x67')]('logo');if(_0x3d3a67[_0x187a5a]||!_0x339d47['custom']){_0x5c4139=path[_0xdbdf('0x63')](config[_0xdbdf('0x64')],_0xd94e49,_[_0xdbdf('0x65')](_0xdbdf('0x68')));}if(!fs[_0xdbdf('0x62')](_0x5c4139)){throw new db[(_0xdbdf('0x69'))][(_0xdbdf('0x6a'))](_[_0xdbdf('0x67')](_0xdbdf('0x5b'))+'\x20not\x20found');}return _0x59428a[_0xdbdf('0x6b')](_0x5c4139);}})['catch'](handleError(_0x59428a,null));};var utilLicense=require('../../config/license/util');exports['getLogoLogin']=function(_0x3a7955,_0x442a5f,_0x45dc8e){var _0x3605be='server/files/images/logos';var _0x50ac1b={'custom':![]};return utilLicense['getLicense']()['then'](function(_0xd01b85){if(_0xd01b85){_0x50ac1b=_0xd01b85;}return db['Setting'][_0xdbdf('0x54')]({'where':{'id':_0x3a7955[_0xdbdf('0x52')]['id']},'attributes':['logo','loginLogo',_0xdbdf('0x5c'),_0xdbdf('0x5d'),_0xdbdf('0x5e'),'defaultLoginLogo','defaultPreferred',_0xdbdf('0x61')],'raw':!![]});})[_0xdbdf('0x1c')](handleEntityNotFound(_0x442a5f,null))[_0xdbdf('0x1c')](function(_0x36ae85){if(_0x36ae85){var _0x53f2af=_0x36ae85[_0xdbdf('0x59')]&&fs[_0xdbdf('0x62')](path[_0xdbdf('0x63')](config[_0xdbdf('0x64')],_0x3605be,_[_0xdbdf('0x65')](_0x36ae85[_0xdbdf('0x59')])))?path[_0xdbdf('0x63')](config['root'],_0x3605be,_['toLower'](_0x36ae85[_0xdbdf('0x59')])):path['join'](config[_0xdbdf('0x64')],_0x3605be,_[_0xdbdf('0x65')](_0xdbdf('0x6c')));var _0x10f796=_0xdbdf('0x66')+_[_0xdbdf('0x67')](_0xdbdf('0x59'));if(_0x36ae85[_0x10f796]||!_0x50ac1b[_0xdbdf('0x6d')]){_0x53f2af=path[_0xdbdf('0x63')](config[_0xdbdf('0x64')],_0x3605be,_[_0xdbdf('0x65')](_0xdbdf('0x6c')));}if(!fs['existsSync'](_0x53f2af)){throw new db[(_0xdbdf('0x69'))][(_0xdbdf('0x6a'))](_[_0xdbdf('0x67')](_0xdbdf('0x59'))+_0xdbdf('0x6e'));}return _0x442a5f[_0xdbdf('0x6b')](_0x53f2af);}})[_0xdbdf('0x27')](handleError(_0x442a5f,null));};exports[_0xdbdf('0x6f')]=function(_0xb8ecaf,_0x10874f){return db['Setting'][_0xdbdf('0x54')]({'where':{'id':_0xb8ecaf[_0xdbdf('0x52')]['id']},'attributes':['securePassword']})[_0xdbdf('0x1c')](respondWithResult(_0x10874f,null))['catch'](handleError(_0x10874f,null));};exports[_0xdbdf('0x70')]=function(_0x3c86c2,_0x36a292,_0x44c9df){if(_0x3c86c2['file']&&_0x3c86c2[_0xdbdf('0x57')]['filename']){_0x3c86c2[_0xdbdf('0x55')][_0xdbdf('0x5c')]=_0x3c86c2[_0xdbdf('0x57')][_0xdbdf('0x58')];}return db[_0xdbdf('0x3b')]['find']({'where':{'id':_0x3c86c2[_0xdbdf('0x52')]['id']}})[_0xdbdf('0x1c')](handleEntityNotFound(_0x36a292,null))[_0xdbdf('0x1c')](saveUpdates(_0x3c86c2[_0xdbdf('0x55')],null))[_0xdbdf('0x1c')](respondWithResult(_0x36a292,null))[_0xdbdf('0x27')](handleError(_0x36a292,null));};var utilLicense=require(_0xdbdf('0x17'));exports[_0xdbdf('0x71')]=function(_0x41a120,_0x8424c4,_0x15bb9d){var _0x5eea1a=_0xdbdf('0x72');var _0x7ff62={'custom':![]};return utilLicense['getLicense']()[_0xdbdf('0x1c')](function(_0x52c569){if(_0x52c569){_0x7ff62=_0x52c569;}return db[_0xdbdf('0x3b')][_0xdbdf('0x54')]({'where':{'id':_0x41a120[_0xdbdf('0x52')]['id']},'attributes':[_0xdbdf('0x5b'),_0xdbdf('0x59'),_0xdbdf('0x5c'),_0xdbdf('0x5d'),_0xdbdf('0x5e'),_0xdbdf('0x5f'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xdbdf('0x1c')](handleEntityNotFound(_0x8424c4,null))[_0xdbdf('0x1c')](function(_0xccb388){if(_0xccb388){var _0x1e968f=_0xccb388['preferred']&&fs[_0xdbdf('0x62')](path[_0xdbdf('0x63')](config[_0xdbdf('0x64')],_0x5eea1a,_[_0xdbdf('0x65')](_0xccb388[_0xdbdf('0x5c')])))?path[_0xdbdf('0x63')](config['root'],_0x5eea1a,_[_0xdbdf('0x65')](_0xccb388[_0xdbdf('0x5c')])):path['join'](config[_0xdbdf('0x64')],_0x5eea1a,_[_0xdbdf('0x65')](_0xdbdf('0x73')));var _0x2e2d5b='default'+_[_0xdbdf('0x67')](_0xdbdf('0x5c'));if(_0xccb388[_0x2e2d5b]||!_0x7ff62[_0xdbdf('0x6d')]||!_0x7ff62[_0xdbdf('0x5c')]){_0x1e968f=path[_0xdbdf('0x63')](config['root'],_0x5eea1a,_['toLower'](_0xdbdf('0x73')));}if(!fs[_0xdbdf('0x62')](_0x1e968f)){throw new db[(_0xdbdf('0x69'))][(_0xdbdf('0x6a'))](_[_0xdbdf('0x67')](_0xdbdf('0x5c'))+'\x20not\x20found');}return _0x8424c4[_0xdbdf('0x6b')](_0x1e968f);}})[_0xdbdf('0x27')](handleError(_0x8424c4,null));};exports[_0xdbdf('0x74')]=function(_0x2f8ee6,_0x4060a5,_0x100c30){if(_0x2f8ee6['file']&&_0x2f8ee6[_0xdbdf('0x57')][_0xdbdf('0x58')]){_0x2f8ee6[_0xdbdf('0x55')][_0xdbdf('0x5d')]=_0x2f8ee6[_0xdbdf('0x57')][_0xdbdf('0x58')];}return db[_0xdbdf('0x3b')][_0xdbdf('0x54')]({'where':{'id':_0x2f8ee6[_0xdbdf('0x52')]['id']}})[_0xdbdf('0x1c')](handleEntityNotFound(_0x4060a5,null))[_0xdbdf('0x1c')](saveUpdates(_0x2f8ee6['body'],null))['then'](respondWithResult(_0x4060a5,null))[_0xdbdf('0x27')](handleError(_0x4060a5,null));};var utilLicense=require(_0xdbdf('0x17'));exports[_0xdbdf('0x75')]=function(_0x3a4fa2,_0x11f0cc,_0x742c20){var _0x5885bf=_0xdbdf('0x72');var _0x11c109={'custom':![]};return utilLicense[_0xdbdf('0x5a')]()[_0xdbdf('0x1c')](function(_0x435e6c){if(_0x435e6c){_0x11c109=_0x435e6c;}return db[_0xdbdf('0x3b')][_0xdbdf('0x54')]({'where':{'id':_0x3a4fa2['params']['id']},'attributes':[_0xdbdf('0x5b'),_0xdbdf('0x59'),_0xdbdf('0x5c'),'favicon',_0xdbdf('0x5e'),'defaultLoginLogo',_0xdbdf('0x60'),'defaultFavicon'],'raw':!![]});})[_0xdbdf('0x1c')](handleEntityNotFound(_0x11f0cc,null))[_0xdbdf('0x1c')](function(_0x5c8c7f){if(_0x5c8c7f){var _0x271d2b=_0x5c8c7f[_0xdbdf('0x5d')]&&fs[_0xdbdf('0x62')](path[_0xdbdf('0x63')](config[_0xdbdf('0x64')],_0x5885bf,_[_0xdbdf('0x65')](_0x5c8c7f[_0xdbdf('0x5d')])))?path[_0xdbdf('0x63')](config['root'],_0x5885bf,_['toLower'](_0x5c8c7f['favicon'])):path[_0xdbdf('0x63')](config[_0xdbdf('0x64')],_0x5885bf,_[_0xdbdf('0x65')]('default_favicon.ico'));var _0x5eecda='default'+_[_0xdbdf('0x67')](_0xdbdf('0x5d'));if(_0x5c8c7f[_0x5eecda]||!_0x11c109['custom']){_0x271d2b=path[_0xdbdf('0x63')](config['root'],_0x5885bf,_['toLower'](_0xdbdf('0x76')));}if(!fs[_0xdbdf('0x62')](_0x271d2b)){throw new db[(_0xdbdf('0x69'))][(_0xdbdf('0x6a'))](_[_0xdbdf('0x67')](_0xdbdf('0x5d'))+_0xdbdf('0x6e'));}return _0x11f0cc[_0xdbdf('0x6b')](_0x271d2b);}})[_0xdbdf('0x27')](handleError(_0x11f0cc,null));};exports[_0xdbdf('0x77')]=function(_0x41feeb,_0x24f073){var _0x5a9774={'offset':moment()[_0xdbdf('0x78')]()};_0x5a9774[_0xdbdf('0x79')]=moment()[_0xdbdf('0x78')](_0x5a9774[_0xdbdf('0x2c')])[_0xdbdf('0x7a')](_0xdbdf('0x7b'));return _0x24f073[_0xdbdf('0x29')](0xc8)[_0xdbdf('0x38')](_0x5a9774);}; \ No newline at end of file +var _0x323f=['jayson/promise','client','http','request','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','Setting','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','rawAttributes','find','body','addLogo','file','filename','logo','getLogo','server/files/images/logos','getLicense','loginLogo','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','preferred','defaultLogo','default_loginLogo.svg','securePassword','addPreferred','default_preferred.png','getFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x52f279,_0x359767){var _0x3bdbc4=function(_0x4e48b8){while(--_0x4e48b8){_0x52f279['push'](_0x52f279['shift']());}};_0x3bdbc4(++_0x359767);}(_0x323f,0xde));var _0xf323=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x323f[_0x42245d];return _0x4b211a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf323('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf323('0x1'));var rp=require('request-promise');var moment=require(_0xf323('0x2'));var BPromise=require(_0xf323('0x3'));var Mustache=require(_0xf323('0x4'));var util=require(_0xf323('0x5'));var path=require('path');var sox=require(_0xf323('0x6'));var csv=require('to-csv');var ejs=require(_0xf323('0x7'));var fs=require('fs');var fs_extra=require(_0xf323('0x8'));var _=require(_0xf323('0x9'));var squel=require(_0xf323('0xa'));var crypto=require(_0xf323('0xb'));var jsforce=require(_0xf323('0xc'));var deskjs=require(_0xf323('0xd'));var toCsv=require(_0xf323('0xe'));var querystring=require(_0xf323('0xf'));var Papa=require('papaparse');var Redis=require(_0xf323('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf323('0x11'));var logger=require(_0xf323('0x12'))(_0xf323('0x13'));var utils=require('../../config/utils');var config=require(_0xf323('0x14'));var licenseUtil=require(_0xf323('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0xf323('0x16'));var client=jayson[_0xf323('0x17')][_0xf323('0x18')]({'port':0x232a});function respondWithRpcPromise(_0xcac862,_0x12b083,_0x2c5afb,_0x5a6888){return new BPromise(function(_0x32d36c,_0x37eff7){var _0xd95389=_0x5a6888||client;return _0xd95389[_0xf323('0x19')](_0xcac862,_0x2c5afb)['then'](function(_0x4053bf){logger['info']('Setting,\x20%s,\x20%s',_0x12b083,_0xf323('0x1a'));logger['debug'](_0xf323('0x1b'),_0x12b083,'request\x20sent',JSON[_0xf323('0x1c')](_0x4053bf));if(_0x4053bf[_0xf323('0x1d')]){if(_0x4053bf[_0xf323('0x1d')][_0xf323('0x1e')]===0x1f4){logger[_0xf323('0x1d')](_0xf323('0x1f'),_0x12b083,_0x4053bf['error']['message']);return _0x37eff7(_0x4053bf[_0xf323('0x1d')]['message']);}logger['error'](_0xf323('0x1f'),_0x12b083,_0x4053bf[_0xf323('0x1d')]['message']);return _0x32d36c(_0x4053bf[_0xf323('0x1d')][_0xf323('0x20')]);}else{logger[_0xf323('0x21')]('Setting,\x20%s,\x20%s',_0x12b083,_0xf323('0x1a'));_0x32d36c(_0x4053bf[_0xf323('0x22')]['message']);}})[_0xf323('0x23')](function(_0x170a18){logger[_0xf323('0x1d')]('Setting,\x20%s,\x20%s',_0x12b083,_0x170a18);_0x37eff7(_0x170a18);});});}function respondWithStatusCode(_0x21374a,_0x2dba99){_0x2dba99=_0x2dba99||0xcc;return function(_0x190262){if(_0x190262){return _0x21374a[_0xf323('0x24')](_0x2dba99);}return _0x21374a[_0xf323('0x25')](_0x2dba99)[_0xf323('0x26')]();};}function respondWithResult(_0xe15d1f,_0x5a38c6){_0x5a38c6=_0x5a38c6||0xc8;return function(_0xe4b40d){if(_0xe4b40d){return _0xe15d1f[_0xf323('0x25')](_0x5a38c6)[_0xf323('0x27')](_0xe4b40d);}};}function respondWithFilteredResult(_0x1db0af,_0x850901){return function(_0x58fcd1){if(_0x58fcd1){var _0x4e57d5=typeof _0x850901[_0xf323('0x28')]==='undefined'&&typeof _0x850901['limit']===_0xf323('0x29');var _0x529cf3=_0x58fcd1[_0xf323('0x2a')];var _0x535834=_0x4e57d5?0x0:_0x850901[_0xf323('0x28')];var _0xe6c8aa=_0x4e57d5?_0x58fcd1[_0xf323('0x2a')]:_0x850901[_0xf323('0x28')]+_0x850901['limit'];var _0x8d4dd1;if(_0xe6c8aa>=_0x529cf3){_0xe6c8aa=_0x529cf3;_0x8d4dd1=0xc8;}else{_0x8d4dd1=0xce;}_0x1db0af[_0xf323('0x25')](_0x8d4dd1);return _0x1db0af[_0xf323('0x2b')](_0xf323('0x2c'),_0x535834+'-'+_0xe6c8aa+'/'+_0x529cf3)['json'](_0x58fcd1);}return null;};}function patchUpdates(_0x4a8a50){return function(_0x29a76c){try{jsonpatch[_0xf323('0x2d')](_0x29a76c,_0x4a8a50,!![]);}catch(_0x22ef15){return BPromise[_0xf323('0x2e')](_0x22ef15);}return _0x29a76c['save']();};}function saveUpdates(_0x162d8b,_0x3873b0){return function(_0x90118e){if(_0x90118e){return _0x90118e[_0xf323('0x2f')](_0x162d8b)[_0xf323('0x30')](function(_0x212be9){return _0x212be9;});}return null;};}function removeEntity(_0x2a036a,_0x4d7c0b){return function(_0x4b7054){if(_0x4b7054){return _0x4b7054[_0xf323('0x31')]()[_0xf323('0x30')](function(){_0x2a036a['status'](0xcc)[_0xf323('0x26')]();});}};}function handleEntityNotFound(_0x5a3d2b,_0xa0b7a0){return function(_0x26cc4f){if(!_0x26cc4f){_0x5a3d2b['sendStatus'](0x194);}return _0x26cc4f;};}function handleError(_0x2609f1,_0x42c505){_0x42c505=_0x42c505||0x1f4;return function(_0x3708ba){logger[_0xf323('0x1d')](_0x3708ba[_0xf323('0x32')]);if(_0x3708ba['name']){delete _0x3708ba[_0xf323('0x33')];}_0x2609f1[_0xf323('0x25')](_0x42c505)[_0xf323('0x34')](_0x3708ba);};}exports[_0xf323('0x35')]=function(_0x526fbc,_0x1f1dcd){var _0x40380a={},_0x14ef51={},_0x420443={'count':0x0,'rows':[]};var _0x53d535=_[_0xf323('0x36')](db[_0xf323('0x37')]['rawAttributes'],function(_0x3768c){return{'name':_0x3768c['fieldName'],'type':_0x3768c[_0xf323('0x38')][_0xf323('0x39')]};});_0x14ef51[_0xf323('0x3a')]=_[_0xf323('0x36')](_0x53d535,'name');_0x14ef51[_0xf323('0x3b')]=_[_0xf323('0x3c')](_0x526fbc[_0xf323('0x3b')]);_0x14ef51[_0xf323('0x3d')]=_[_0xf323('0x3e')](_0x14ef51['model'],_0x14ef51['query']);_0x40380a[_0xf323('0x3f')]=_[_0xf323('0x3e')](_0x14ef51[_0xf323('0x3a')],qs[_0xf323('0x40')](_0x526fbc[_0xf323('0x3b')][_0xf323('0x40')]));_0x40380a[_0xf323('0x3f')]=_0x40380a[_0xf323('0x3f')][_0xf323('0x41')]?_0x40380a[_0xf323('0x3f')]:_0x14ef51['model'];if(!_0x526fbc[_0xf323('0x3b')][_0xf323('0x42')](_0xf323('0x43'))){_0x40380a[_0xf323('0x44')]=qs[_0xf323('0x44')](_0x526fbc[_0xf323('0x3b')][_0xf323('0x44')]);_0x40380a['offset']=qs[_0xf323('0x28')](_0x526fbc[_0xf323('0x3b')][_0xf323('0x28')]);}_0x40380a[_0xf323('0x45')]=qs[_0xf323('0x46')](_0x526fbc[_0xf323('0x3b')][_0xf323('0x46')]);_0x40380a[_0xf323('0x47')]=qs[_0xf323('0x3d')](_[_0xf323('0x48')](_0x526fbc[_0xf323('0x3b')],_0x14ef51[_0xf323('0x3d')]),_0x53d535);if(_0x526fbc[_0xf323('0x3b')][_0xf323('0x49')]){_0x40380a[_0xf323('0x47')]=_[_0xf323('0x4a')](_0x40380a['where'],{'$or':_[_0xf323('0x36')](_0x53d535,function(_0x542ede){if(_0x542ede[_0xf323('0x38')]!==_0xf323('0x4b')){var _0x12accf={};_0x12accf[_0x542ede['name']]={'$like':'%'+_0x526fbc[_0xf323('0x3b')][_0xf323('0x49')]+'%'};return _0x12accf;}})});}_0x40380a=_[_0xf323('0x4a')]({},_0x40380a,_0x526fbc[_0xf323('0x4c')]);var _0x41f7ad={'where':_0x40380a[_0xf323('0x47')]};return db[_0xf323('0x37')]['count'](_0x41f7ad)[_0xf323('0x30')](function(_0x3502e3){_0x420443[_0xf323('0x2a')]=_0x3502e3;if(_0x526fbc['query'][_0xf323('0x4d')]){_0x40380a[_0xf323('0x4e')]=[{'all':!![]}];}return db[_0xf323('0x37')][_0xf323('0x4f')](_0x40380a);})[_0xf323('0x30')](function(_0x5238ae){_0x420443['rows']=_0x5238ae;return _0x420443;})['then'](respondWithFilteredResult(_0x1f1dcd,_0x40380a))[_0xf323('0x23')](handleError(_0x1f1dcd,null));};exports[_0xf323('0x50')]=function(_0x496fc3,_0x1a75c4){var _0x222a4d={'raw':![],'where':{'id':_0x496fc3[_0xf323('0x51')]['id']}},_0x2000b5={};_0x2000b5[_0xf323('0x3a')]=_['keys'](db[_0xf323('0x37')][_0xf323('0x52')]);_0x2000b5[_0xf323('0x3b')]=_['keys'](_0x496fc3[_0xf323('0x3b')]);_0x2000b5[_0xf323('0x3d')]=_['intersection'](_0x2000b5[_0xf323('0x3a')],_0x2000b5[_0xf323('0x3b')]);_0x222a4d['attributes']=_['intersection'](_0x2000b5[_0xf323('0x3a')],qs[_0xf323('0x40')](_0x496fc3[_0xf323('0x3b')]['fields']));_0x222a4d[_0xf323('0x3f')]=_0x222a4d['attributes'][_0xf323('0x41')]?_0x222a4d[_0xf323('0x3f')]:_0x2000b5[_0xf323('0x3a')];if(_0x496fc3[_0xf323('0x3b')][_0xf323('0x4d')]){_0x222a4d[_0xf323('0x4e')]=[{'all':!![]}];}_0x222a4d=_[_0xf323('0x4a')]({},_0x222a4d,_0x496fc3[_0xf323('0x4c')]);return db['Setting'][_0xf323('0x53')](_0x222a4d)[_0xf323('0x30')](handleEntityNotFound(_0x1a75c4,null))['then'](respondWithResult(_0x1a75c4,null))[_0xf323('0x23')](handleError(_0x1a75c4,null));};exports[_0xf323('0x2f')]=function(_0x59c846,_0x2e1434){if(_0x59c846[_0xf323('0x54')]['id']){delete _0x59c846['body']['id'];}return db[_0xf323('0x37')][_0xf323('0x53')]({'where':{'id':_0x59c846[_0xf323('0x51')]['id']}})[_0xf323('0x30')](handleEntityNotFound(_0x2e1434,null))[_0xf323('0x30')](saveUpdates(_0x59c846[_0xf323('0x54')],null))[_0xf323('0x30')](respondWithResult(_0x2e1434,null))[_0xf323('0x23')](handleError(_0x2e1434,null));};exports[_0xf323('0x55')]=function(_0x598269,_0x523a5f,_0x154fb3){if(_0x598269[_0xf323('0x56')]&&_0x598269[_0xf323('0x56')][_0xf323('0x57')]){_0x598269['body'][_0xf323('0x58')]=_0x598269[_0xf323('0x56')][_0xf323('0x57')];}return db[_0xf323('0x37')][_0xf323('0x53')]({'where':{'id':_0x598269['params']['id']}})['then'](handleEntityNotFound(_0x523a5f,null))['then'](saveUpdates(_0x598269['body'],null))['then'](respondWithResult(_0x523a5f,null))[_0xf323('0x23')](handleError(_0x523a5f,null));};exports['addLogoLogin']=function(_0x2e1593,_0x448f99,_0x52ca3a){if(_0x2e1593[_0xf323('0x56')]&&_0x2e1593[_0xf323('0x56')][_0xf323('0x57')]){_0x2e1593[_0xf323('0x54')]['loginLogo']=_0x2e1593['file'][_0xf323('0x57')];}return db['Setting'][_0xf323('0x53')]({'where':{'id':_0x2e1593[_0xf323('0x51')]['id']}})[_0xf323('0x30')](handleEntityNotFound(_0x448f99,null))[_0xf323('0x30')](saveUpdates(_0x2e1593[_0xf323('0x54')],null))['then'](respondWithResult(_0x448f99,null))[_0xf323('0x23')](handleError(_0x448f99,null));};var utilLicense=require(_0xf323('0x15'));exports[_0xf323('0x59')]=function(_0x253d06,_0x51af2f,_0x138ce9){var _0xaac4d0=_0xf323('0x5a');var _0x139262={'custom':![]};return utilLicense[_0xf323('0x5b')]()['then'](function(_0x34d001){if(_0x34d001){_0x139262=_0x34d001;}return db[_0xf323('0x37')][_0xf323('0x53')]({'where':{'id':_0x253d06[_0xf323('0x51')]['id']},'attributes':[_0xf323('0x58'),_0xf323('0x5c'),'preferred',_0xf323('0x5d'),'defaultLogo',_0xf323('0x5e'),_0xf323('0x5f'),_0xf323('0x60')],'raw':!![]});})['then'](handleEntityNotFound(_0x51af2f,null))[_0xf323('0x30')](function(_0x38c4fb){if(_0x38c4fb){var _0x4be4c7=_0x38c4fb[_0xf323('0x58')]&&fs[_0xf323('0x61')](path[_0xf323('0x62')](config['root'],_0xaac4d0,_[_0xf323('0x63')](_0x38c4fb[_0xf323('0x58')])))?path['join'](config[_0xf323('0x64')],_0xaac4d0,_[_0xf323('0x63')](_0x38c4fb[_0xf323('0x58')])):path[_0xf323('0x62')](config[_0xf323('0x64')],_0xaac4d0,_['toLower'](_0xf323('0x65')));var _0x167166=_0xf323('0x66')+_[_0xf323('0x67')](_0xf323('0x58'));if(_0x38c4fb[_0x167166]||!_0x139262[_0xf323('0x68')]){_0x4be4c7=path[_0xf323('0x62')](config[_0xf323('0x64')],_0xaac4d0,_[_0xf323('0x63')]('default_logo.svg'));}if(!fs['existsSync'](_0x4be4c7)){throw new db[(_0xf323('0x69'))][(_0xf323('0x6a'))](_[_0xf323('0x67')](_0xf323('0x58'))+_0xf323('0x6b'));}return _0x51af2f[_0xf323('0x6c')](_0x4be4c7);}})[_0xf323('0x23')](handleError(_0x51af2f,null));};var utilLicense=require(_0xf323('0x15'));exports[_0xf323('0x6d')]=function(_0x3e7110,_0x2e9fef,_0x50a1b2){var _0x3a2e65='server/files/images/logos';var _0x4b79c1={'custom':![]};return utilLicense[_0xf323('0x5b')]()[_0xf323('0x30')](function(_0x4d816c){if(_0x4d816c){_0x4b79c1=_0x4d816c;}return db[_0xf323('0x37')][_0xf323('0x53')]({'where':{'id':_0x3e7110[_0xf323('0x51')]['id']},'attributes':[_0xf323('0x58'),'loginLogo',_0xf323('0x6e'),_0xf323('0x5d'),_0xf323('0x6f'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xf323('0x30')](handleEntityNotFound(_0x2e9fef,null))[_0xf323('0x30')](function(_0x2519ec){if(_0x2519ec){var _0x17ec3f=_0x2519ec[_0xf323('0x5c')]&&fs[_0xf323('0x61')](path[_0xf323('0x62')](config['root'],_0x3a2e65,_[_0xf323('0x63')](_0x2519ec[_0xf323('0x5c')])))?path[_0xf323('0x62')](config[_0xf323('0x64')],_0x3a2e65,_['toLower'](_0x2519ec[_0xf323('0x5c')])):path['join'](config[_0xf323('0x64')],_0x3a2e65,_[_0xf323('0x63')](_0xf323('0x70')));var _0x4bcacd='default'+_[_0xf323('0x67')](_0xf323('0x5c'));if(_0x2519ec[_0x4bcacd]||!_0x4b79c1['custom']){_0x17ec3f=path[_0xf323('0x62')](config[_0xf323('0x64')],_0x3a2e65,_['toLower']('default_loginLogo.svg'));}if(!fs[_0xf323('0x61')](_0x17ec3f)){throw new db[(_0xf323('0x69'))][(_0xf323('0x6a'))](_['upperFirst'](_0xf323('0x5c'))+_0xf323('0x6b'));}return _0x2e9fef[_0xf323('0x6c')](_0x17ec3f);}})[_0xf323('0x23')](handleError(_0x2e9fef,null));};exports['gdpr']=function(_0x1602dd,_0x39fb37){return db[_0xf323('0x37')][_0xf323('0x53')]({'where':{'id':_0x1602dd[_0xf323('0x51')]['id']},'attributes':[_0xf323('0x71')]})[_0xf323('0x30')](respondWithResult(_0x39fb37,null))[_0xf323('0x23')](handleError(_0x39fb37,null));};exports[_0xf323('0x72')]=function(_0x557d1a,_0x230735,_0x1a7e32){if(_0x557d1a[_0xf323('0x56')]&&_0x557d1a['file'][_0xf323('0x57')]){_0x557d1a['body'][_0xf323('0x6e')]=_0x557d1a[_0xf323('0x56')]['filename'];}return db[_0xf323('0x37')]['find']({'where':{'id':_0x557d1a['params']['id']}})[_0xf323('0x30')](handleEntityNotFound(_0x230735,null))[_0xf323('0x30')](saveUpdates(_0x557d1a['body'],null))[_0xf323('0x30')](respondWithResult(_0x230735,null))[_0xf323('0x23')](handleError(_0x230735,null));};var utilLicense=require(_0xf323('0x15'));exports['getPreferred']=function(_0x152860,_0x4adb24,_0x5bac0c){var _0x7ff447='server/files/images/logos';var _0x58d82f={'custom':![]};return utilLicense['getLicense']()[_0xf323('0x30')](function(_0x199b25){if(_0x199b25){_0x58d82f=_0x199b25;}return db[_0xf323('0x37')][_0xf323('0x53')]({'where':{'id':_0x152860[_0xf323('0x51')]['id']},'attributes':[_0xf323('0x58'),_0xf323('0x5c'),_0xf323('0x6e'),'favicon',_0xf323('0x6f'),_0xf323('0x5e'),'defaultPreferred',_0xf323('0x60')],'raw':!![]});})[_0xf323('0x30')](handleEntityNotFound(_0x4adb24,null))['then'](function(_0x5d9f09){if(_0x5d9f09){var _0x41cbd8=_0x5d9f09['preferred']&&fs[_0xf323('0x61')](path[_0xf323('0x62')](config[_0xf323('0x64')],_0x7ff447,_[_0xf323('0x63')](_0x5d9f09['preferred'])))?path[_0xf323('0x62')](config[_0xf323('0x64')],_0x7ff447,_['toLower'](_0x5d9f09[_0xf323('0x6e')])):path[_0xf323('0x62')](config[_0xf323('0x64')],_0x7ff447,_['toLower'](_0xf323('0x73')));var _0x2fce69='default'+_[_0xf323('0x67')]('preferred');if(_0x5d9f09[_0x2fce69]||!_0x58d82f[_0xf323('0x68')]||!_0x58d82f[_0xf323('0x6e')]){_0x41cbd8=path['join'](config[_0xf323('0x64')],_0x7ff447,_[_0xf323('0x63')](_0xf323('0x73')));}if(!fs[_0xf323('0x61')](_0x41cbd8)){throw new db[(_0xf323('0x69'))][(_0xf323('0x6a'))](_[_0xf323('0x67')]('preferred')+'\x20not\x20found');}return _0x4adb24[_0xf323('0x6c')](_0x41cbd8);}})[_0xf323('0x23')](handleError(_0x4adb24,null));};exports['addFavicon']=function(_0x43ddb5,_0xacdbbc,_0x34df6a){if(_0x43ddb5[_0xf323('0x56')]&&_0x43ddb5[_0xf323('0x56')][_0xf323('0x57')]){_0x43ddb5[_0xf323('0x54')][_0xf323('0x5d')]=_0x43ddb5['file']['filename'];}return db[_0xf323('0x37')][_0xf323('0x53')]({'where':{'id':_0x43ddb5[_0xf323('0x51')]['id']}})[_0xf323('0x30')](handleEntityNotFound(_0xacdbbc,null))[_0xf323('0x30')](saveUpdates(_0x43ddb5[_0xf323('0x54')],null))['then'](respondWithResult(_0xacdbbc,null))['catch'](handleError(_0xacdbbc,null));};var utilLicense=require(_0xf323('0x15'));exports[_0xf323('0x74')]=function(_0x4001f7,_0x5a779a,_0x1b8be9){var _0x5b1452=_0xf323('0x5a');var _0x4cac39={'custom':![]};return utilLicense['getLicense']()[_0xf323('0x30')](function(_0x5452c1){if(_0x5452c1){_0x4cac39=_0x5452c1;}return db[_0xf323('0x37')][_0xf323('0x53')]({'where':{'id':_0x4001f7[_0xf323('0x51')]['id']},'attributes':[_0xf323('0x58'),_0xf323('0x5c'),_0xf323('0x6e'),_0xf323('0x5d'),_0xf323('0x6f'),_0xf323('0x5e'),_0xf323('0x5f'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x5a779a,null))['then'](function(_0x3f9f86){if(_0x3f9f86){var _0x318410=_0x3f9f86[_0xf323('0x5d')]&&fs[_0xf323('0x61')](path['join'](config[_0xf323('0x64')],_0x5b1452,_['toLower'](_0x3f9f86[_0xf323('0x5d')])))?path['join'](config[_0xf323('0x64')],_0x5b1452,_['toLower'](_0x3f9f86[_0xf323('0x5d')])):path[_0xf323('0x62')](config[_0xf323('0x64')],_0x5b1452,_[_0xf323('0x63')](_0xf323('0x75')));var _0x29a898=_0xf323('0x66')+_['upperFirst']('favicon');if(_0x3f9f86[_0x29a898]||!_0x4cac39['custom']){_0x318410=path[_0xf323('0x62')](config['root'],_0x5b1452,_[_0xf323('0x63')](_0xf323('0x75')));}if(!fs[_0xf323('0x61')](_0x318410)){throw new db[(_0xf323('0x69'))][(_0xf323('0x6a'))](_['upperFirst']('favicon')+_0xf323('0x6b'));}return _0x5a779a[_0xf323('0x6c')](_0x318410);}})['catch'](handleError(_0x5a779a,null));};exports[_0xf323('0x76')]=function(_0x24c523,_0x171c1c){var _0x4c1bad={'offset':moment()[_0xf323('0x77')]()};_0x4c1bad['now']=moment()[_0xf323('0x77')](_0x4c1bad['offset'])[_0xf323('0x78')](_0xf323('0x79'));return _0x171c1c[_0xf323('0x25')](0xc8)[_0xf323('0x34')](_0x4c1bad);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 5a8c017..0ed6825 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 5377345..beb09f7 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 _0x7086=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Setting','options','raw','where','attributes','include','model','map','ShowSetting'];(function(_0x131314,_0x2378a3){var _0x281333=function(_0x442ac1){while(--_0x442ac1){_0x131314['push'](_0x131314['shift']());}};_0x281333(++_0x2378a3);}(_0x7086,0x117));var _0x6708=function(_0x3157d1,_0xe98441){_0x3157d1=_0x3157d1-0x0;var _0x4e7a63=_0x7086[_0x3157d1];return _0x4e7a63;};'use strict';var _=require(_0x6708('0x0'));var util=require(_0x6708('0x1'));var moment=require(_0x6708('0x2'));var BPromise=require(_0x6708('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6708('0x4'))['db'];var utils=require(_0x6708('0x5'));var logger=require('../../config/logger')(_0x6708('0x6'));var config=require(_0x6708('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6708('0x8')][_0x6708('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4602b6,_0x469b4d,_0x2cc79c){return new BPromise(function(_0x371cce,_0x34d8ef){return client[_0x6708('0xa')](_0x4602b6,_0x2cc79c)[_0x6708('0xb')](function(_0x2a0855){logger['info'](_0x6708('0xc'),_0x469b4d,_0x6708('0xd'));logger[_0x6708('0xe')](_0x6708('0xf'),_0x469b4d,_0x6708('0xd'),JSON[_0x6708('0x10')](_0x2a0855));if(_0x2a0855['error']){if(_0x2a0855[_0x6708('0x11')][_0x6708('0x12')]===0x1f4){logger[_0x6708('0x11')](_0x6708('0xc'),_0x469b4d,_0x2a0855[_0x6708('0x11')][_0x6708('0x13')]);return _0x34d8ef(_0x2a0855[_0x6708('0x11')]['message']);}logger['error'](_0x6708('0xc'),_0x469b4d,_0x2a0855['error'][_0x6708('0x13')]);return _0x371cce(_0x2a0855[_0x6708('0x11')][_0x6708('0x13')]);}else{logger['info'](_0x6708('0xc'),_0x469b4d,'request\x20sent');_0x371cce(_0x2a0855[_0x6708('0x14')][_0x6708('0x13')]);}})[_0x6708('0x15')](function(_0x5c1466){logger[_0x6708('0x11')]('Setting,\x20%s,\x20%s',_0x469b4d,_0x5c1466);_0x34d8ef(_0x5c1466);});});}exports['ShowSetting']=function(_0x3c4f66){var _0x168e06=this;return new Promise(function(_0x3ea2ae,_0x3e7626){return db[_0x6708('0x16')]['find']({'raw':_0x3c4f66[_0x6708('0x17')]?_0x3c4f66[_0x6708('0x17')][_0x6708('0x18')]===undefined?!![]:![]:!![],'where':_0x3c4f66['options']?_0x3c4f66[_0x6708('0x17')][_0x6708('0x19')]||null:null,'attributes':_0x3c4f66[_0x6708('0x17')]?_0x3c4f66[_0x6708('0x17')][_0x6708('0x1a')]||null:null,'include':_0x3c4f66['options']?_0x3c4f66[_0x6708('0x17')][_0x6708('0x1b')]?_['map'](_0x3c4f66['options'][_0x6708('0x1b')],function(_0x3e751f){return{'model':db[_0x3e751f[_0x6708('0x1c')]],'as':_0x3e751f['as'],'attributes':_0x3e751f[_0x6708('0x1a')],'include':_0x3e751f['include']?_[_0x6708('0x1d')](_0x3e751f[_0x6708('0x1b')],function(_0x3514b2){return{'model':db[_0x3514b2[_0x6708('0x1c')]],'as':_0x3514b2['as'],'attributes':_0x3514b2[_0x6708('0x1a')],'include':_0x3514b2[_0x6708('0x1b')]?_[_0x6708('0x1d')](_0x3514b2['include'],function(_0x539513){return{'model':db[_0x539513['model']],'as':_0x539513['as'],'attributes':_0x539513['attributes']};}):[]};}):[]};}):[]:[]})[_0x6708('0xb')](function(_0x537e1d){logger['info'](_0x6708('0x1e'),_0x3c4f66);logger[_0x6708('0xe')](_0x6708('0x1e'),_0x3c4f66,JSON[_0x6708('0x10')](_0x537e1d));_0x3ea2ae(_0x537e1d);})['catch'](function(_0x5ba6ba){logger[_0x6708('0x11')](_0x6708('0x1e'),_0x5ba6ba[_0x6708('0x13')],_0x3c4f66);_0x3e7626(_0x168e06[_0x6708('0x11')](0x1f4,_0x5ba6ba[_0x6708('0x13')]));});});}; \ No newline at end of file +var _0xb2f6=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','ShowSetting','Setting','find','options','raw','where','attributes','include','map','model'];(function(_0x3d7cc4,_0x47bc65){var _0x264015=function(_0x21ca80){while(--_0x21ca80){_0x3d7cc4['push'](_0x3d7cc4['shift']());}};_0x264015(++_0x47bc65);}(_0xb2f6,0x160));var _0x6b2f=function(_0x5a9050,_0x57e5a9){_0x5a9050=_0x5a9050-0x0;var _0x23839b=_0xb2f6[_0x5a9050];return _0x23839b;};'use strict';var _=require(_0x6b2f('0x0'));var util=require('util');var moment=require(_0x6b2f('0x1'));var BPromise=require(_0x6b2f('0x2'));var rs=require(_0x6b2f('0x3'));var fs=require('fs');var Redis=require(_0x6b2f('0x4'));var db=require(_0x6b2f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6b2f('0x6'))(_0x6b2f('0x7'));var config=require(_0x6b2f('0x8'));var jayson=require(_0x6b2f('0x9'));var client=jayson[_0x6b2f('0xa')][_0x6b2f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x51d303,_0x4bcbda,_0x138a4d){return new BPromise(function(_0x48b36a,_0x461d1f){return client[_0x6b2f('0xc')](_0x51d303,_0x138a4d)[_0x6b2f('0xd')](function(_0x2a0da4){logger[_0x6b2f('0xe')](_0x6b2f('0xf'),_0x4bcbda,_0x6b2f('0x10'));logger['debug'](_0x6b2f('0x11'),_0x4bcbda,_0x6b2f('0x10'),JSON[_0x6b2f('0x12')](_0x2a0da4));if(_0x2a0da4[_0x6b2f('0x13')]){if(_0x2a0da4['error']['code']===0x1f4){logger[_0x6b2f('0x13')](_0x6b2f('0xf'),_0x4bcbda,_0x2a0da4[_0x6b2f('0x13')][_0x6b2f('0x14')]);return _0x461d1f(_0x2a0da4[_0x6b2f('0x13')][_0x6b2f('0x14')]);}logger['error'](_0x6b2f('0xf'),_0x4bcbda,_0x2a0da4[_0x6b2f('0x13')][_0x6b2f('0x14')]);return _0x48b36a(_0x2a0da4['error'][_0x6b2f('0x14')]);}else{logger['info'](_0x6b2f('0xf'),_0x4bcbda,_0x6b2f('0x10'));_0x48b36a(_0x2a0da4[_0x6b2f('0x15')][_0x6b2f('0x14')]);}})['catch'](function(_0x3d4b8d){logger['error'](_0x6b2f('0xf'),_0x4bcbda,_0x3d4b8d);_0x461d1f(_0x3d4b8d);});});}exports[_0x6b2f('0x16')]=function(_0x487fa5){var _0x3245f1=this;return new Promise(function(_0x429364,_0x1d5604){return db[_0x6b2f('0x17')][_0x6b2f('0x18')]({'raw':_0x487fa5[_0x6b2f('0x19')]?_0x487fa5['options'][_0x6b2f('0x1a')]===undefined?!![]:![]:!![],'where':_0x487fa5[_0x6b2f('0x19')]?_0x487fa5[_0x6b2f('0x19')][_0x6b2f('0x1b')]||null:null,'attributes':_0x487fa5[_0x6b2f('0x19')]?_0x487fa5['options'][_0x6b2f('0x1c')]||null:null,'include':_0x487fa5[_0x6b2f('0x19')]?_0x487fa5[_0x6b2f('0x19')][_0x6b2f('0x1d')]?_[_0x6b2f('0x1e')](_0x487fa5['options'][_0x6b2f('0x1d')],function(_0x10e78c){return{'model':db[_0x10e78c[_0x6b2f('0x1f')]],'as':_0x10e78c['as'],'attributes':_0x10e78c[_0x6b2f('0x1c')],'include':_0x10e78c[_0x6b2f('0x1d')]?_[_0x6b2f('0x1e')](_0x10e78c[_0x6b2f('0x1d')],function(_0x52eed1){return{'model':db[_0x52eed1[_0x6b2f('0x1f')]],'as':_0x52eed1['as'],'attributes':_0x52eed1[_0x6b2f('0x1c')],'include':_0x52eed1['include']?_[_0x6b2f('0x1e')](_0x52eed1['include'],function(_0x173f34){return{'model':db[_0x173f34[_0x6b2f('0x1f')]],'as':_0x173f34['as'],'attributes':_0x173f34[_0x6b2f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6b2f('0xd')](function(_0x596cf9){logger[_0x6b2f('0xe')]('ShowSetting',_0x487fa5);logger['debug'](_0x6b2f('0x16'),_0x487fa5,JSON['stringify'](_0x596cf9));_0x429364(_0x596cf9);})['catch'](function(_0x162f3c){logger[_0x6b2f('0x13')](_0x6b2f('0x16'),_0x162f3c[_0x6b2f('0x14')],_0x487fa5);_0x1d5604(_0x3245f1[_0x6b2f('0x13')](0x1f4,_0x162f3c[_0x6b2f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 017bec6..41c6ec9 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 _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','/:id/applications','addApplications','/:id/send','send','/:id/users','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf494,0x1c6));var _0x4f49=function(_0x4dcaa2,_0x1315e5){_0x4dcaa2=_0x4dcaa2-0x0;var _0x500c72=_0xf494[_0x4dcaa2];return _0x500c72;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0xa')](_0x4f49('0x10'),auth[_0x4f49('0xb')](),controller['getDispositions']);router[_0x4f49('0xa')](_0x4f49('0x11'),auth['isAuthenticated'](),controller[_0x4f49('0x12')]);router['get']('/:id/applications',auth[_0x4f49('0xb')](),controller[_0x4f49('0x13')]);router['get'](_0x4f49('0x14'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x15')]);router[_0x4f49('0xa')](_0x4f49('0x16'),controller[_0x4f49('0x17')]);router[_0x4f49('0xa')]('/:id/users',auth[_0x4f49('0xb')](),controller[_0x4f49('0x18')]);router[_0x4f49('0x19')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4f49('0x19')](_0x4f49('0x10'),auth[_0x4f49('0xb')](),controller['addDisposition']);router[_0x4f49('0x19')](_0x4f49('0x11'),auth[_0x4f49('0xb')](),controller['addAnswer']);router['post']('/:id/notify',controller['notify']);router[_0x4f49('0x19')](_0x4f49('0x1a'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x1b')]);router['post'](_0x4f49('0x1c'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x1d')]);router[_0x4f49('0x19')](_0x4f49('0x16'),controller['status']);router[_0x4f49('0x19')](_0x4f49('0x1e'),auth[_0x4f49('0xb')](),controller['addAgents']);router[_0x4f49('0x1f')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x20')]);router[_0x4f49('0x21')](_0x4f49('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0x4f49('0x21')](_0x4f49('0x10'),auth['isAuthenticated'](),controller[_0x4f49('0x22')]);router[_0x4f49('0x21')](_0x4f49('0x11'),auth['isAuthenticated'](),controller[_0x4f49('0x23')]);router[_0x4f49('0x21')](_0x4f49('0x1e'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x24')]);module[_0x4f49('0x25')]=router; \ No newline at end of file +var _0xc4aa=['statusGet','/:id/users','getAgents','post','addDisposition','addAnswer','notify','addApplications','/:id/send','send','status','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0xda86e8,_0x4483f3){var _0x55769c=function(_0x73847c){while(--_0x73847c){_0xda86e8['push'](_0xda86e8['shift']());}};_0x55769c(++_0x4483f3);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xc4aa[_0x17b6e3];return _0x3906f3;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['describe']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['get'](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xf')]);router['get'](_0xac4a('0x10'),auth['isAuthenticated'](),controller[_0xac4a('0x11')]);router['get'](_0xac4a('0x12'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x13')]);router['get'](_0xac4a('0x14'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x15')]);router[_0xac4a('0x8')](_0xac4a('0x16'),controller[_0xac4a('0x17')]);router[_0xac4a('0x8')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x19')]);router[_0xac4a('0x1a')]('/',auth[_0xac4a('0x9')](),controller['create']);router[_0xac4a('0x1a')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1b')]);router[_0xac4a('0x1a')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1c')]);router['post']('/:id/notify',controller[_0xac4a('0x1d')]);router[_0xac4a('0x1a')](_0xac4a('0x12'),auth['isAuthenticated'](),controller[_0xac4a('0x1e')]);router[_0xac4a('0x1a')](_0xac4a('0x1f'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x20')]);router[_0xac4a('0x1a')](_0xac4a('0x16'),controller[_0xac4a('0x21')]);router['post'](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller['addAgents']);router[_0xac4a('0x22')](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x23')]);router['delete'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x24')]);router[_0xac4a('0x25')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x26')]);router[_0xac4a('0x25')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x27')]);router[_0xac4a('0x25')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x28')]);module[_0xac4a('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index be0b3cc..37d20e6 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 _0xeee0=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','generate','twilio','skebby','connectel','clicksend','plivo','infobip','intelepeer','ENUM','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER'];(function(_0x55c4c4,_0x38840a){var _0x335f5a=function(_0x33d34d){while(--_0x33d34d){_0x55c4c4['push'](_0x55c4c4['shift']());}};_0x335f5a(++_0x38840a);}(_0xeee0,0x16c));var _0x0eee=function(_0x1269c6,_0x1c8942){_0x1269c6=_0x1269c6-0x0;var _0x4868c7=_0xeee0[_0x1269c6];return _0x4868c7;};'use strict';var Sequelize=require(_0x0eee('0x0'));var rs=require('randomstring');module[_0x0eee('0x1')]={'name':{'type':Sequelize[_0x0eee('0x2')],'unique':_0x0eee('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x0eee('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x0eee('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x0eee('0x2')],'defaultValue':function(){return rs[_0x0eee('0x4')]();}},'phone':{'type':Sequelize[_0x0eee('0x2')]},'type':{'type':Sequelize['ENUM'](_0x0eee('0x5'),_0x0eee('0x6'),_0x0eee('0x7'),_0x0eee('0x8'),_0x0eee('0x9'),'clickatell','bandwidth','csc',_0x0eee('0xa'),_0x0eee('0xb'))},'accountSid':{'type':Sequelize[_0x0eee('0x2')]},'authId':{'type':Sequelize[_0x0eee('0x2')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x0eee('0xc')]('SI','TI','GP')},'username':{'type':Sequelize[_0x0eee('0x2')]},'password':{'type':Sequelize[_0x0eee('0x2')]},'apiKey':{'type':Sequelize[_0x0eee('0x2')]},'applicationId':{'type':Sequelize[_0x0eee('0x2')]},'accountId':{'type':Sequelize[_0x0eee('0x2')]},'senderString':{'type':Sequelize[_0x0eee('0x2')]},'deliveryReport':{'type':Sequelize[_0x0eee('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x0eee('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x0eee('0xe');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0eee('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0eee('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0eee('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0eee('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0eee('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0eee('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x0eee('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0eee('0xf')],'comment':_0x0eee('0x10')},'mandatoryDisposition':{'type':Sequelize[_0x0eee('0xd')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4217e1){if(!_0x4217e1)this[_0x0eee('0x11')](_0x0eee('0x12'),null);this[_0x0eee('0x11')](_0x0eee('0x13'),_0x4217e1);}}}; \ No newline at end of file +var _0xb4fb=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','csc','intelepeer','BOOLEAN','INTEGER'];(function(_0x3220c2,_0x19f3db){var _0x5bbed2=function(_0x33e252){while(--_0x33e252){_0x3220c2['push'](_0x3220c2['shift']());}};_0x5bbed2(++_0x19f3db);}(_0xb4fb,0xe0));var _0xbb4f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb4fb[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xbb4f('0x0'));var rs=require('randomstring');module[_0xbb4f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xbb4f('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xbb4f('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xbb4f('0x4')](_0xbb4f('0x5'),_0xbb4f('0x6'),_0xbb4f('0x7'),_0xbb4f('0x8'),_0xbb4f('0x9'),'clickatell','bandwidth',_0xbb4f('0xa'),'infobip',_0xbb4f('0xb'))},'accountSid':{'type':Sequelize[_0xbb4f('0x2')]},'authId':{'type':Sequelize[_0xbb4f('0x2')]},'authToken':{'type':Sequelize[_0xbb4f('0x2')]},'smsMethod':{'type':Sequelize[_0xbb4f('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0xbb4f('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0xbb4f('0x2')]},'accountId':{'type':Sequelize[_0xbb4f('0x2')]},'senderString':{'type':Sequelize[_0xbb4f('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xbb4f('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbb4f('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xbb4f('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbb4f('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbb4f('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbb4f('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xbb4f('0xc')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x57768a){if(!_0x57768a)this[_0xbb4f('0xe')](_0xbb4f('0xf'),null);this[_0xbb4f('0xe')](_0xbb4f('0x10'),_0x57768a);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 687d423..b880508 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 _0xba2f=['messageId','MessageSid','skebby','connectel','message_id','plivo','Text','results','text','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','intelepeer','isNil','Sequelize','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','list','omit','contact','SmsInteraction','interaction','push','unmanaged','created','ContactId','UserId','unshift','agent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','send','\x0a','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tag','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','out','SmsMessage','dataValues','Messages','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','clicksend','infobip','DELIVERED','groupName','bandwidth','redif','clickatell','DELIVERED_TO_GATEWAY','DELIVRD','ACCEPTD','message-id','state','addAgents','emit','isArray','userSmsAccount:remove','getAgents','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','http','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','destroy','SmsAccounts','UserProfileResource','stack','name','Pause','mandatoryDispositionPause','map','SmsAccount','fieldName','type','model','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','keys','rawAttributes','fields','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','params','describe','addDisposition','SmsAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','nolimit','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','ValidationError','no\x20available\x20attributes','createdAt','difference','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body'];(function(_0x3f31a7,_0x4bdf46){var _0x1ac7be=function(_0x52da64){while(--_0x52da64){_0x3f31a7['push'](_0x3f31a7['shift']());}};_0x1ac7be(++_0x4bdf46);}(_0xba2f,0x138));var _0xfba2=function(_0xe55101,_0x4585be){_0xe55101=_0xe55101-0x0;var _0x488e1d=_0xba2f[_0xe55101];return _0x488e1d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfba2('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfba2('0x1'));var moment=require('moment');var BPromise=require(_0xfba2('0x2'));var Mustache=require(_0xfba2('0x3'));var util=require(_0xfba2('0x4'));var path=require('path');var sox=require(_0xfba2('0x5'));var csv=require(_0xfba2('0x6'));var ejs=require(_0xfba2('0x7'));var fs=require('fs');var fs_extra=require(_0xfba2('0x8'));var _=require(_0xfba2('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfba2('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xfba2('0x6'));var querystring=require('querystring');var Papa=require(_0xfba2('0xb'));var Redis=require(_0xfba2('0xc'));var authService=require(_0xfba2('0xd'));var qs=require(_0xfba2('0xe'));var as=require(_0xfba2('0xf'));var hardwareService=require(_0xfba2('0x10'));var logger=require(_0xfba2('0x11'))(_0xfba2('0x12'));var utils=require('../../config/utils');var config=require(_0xfba2('0x13'));var licenseUtil=require(_0xfba2('0x14'));var db=require(_0xfba2('0x15'))['db'];config[_0xfba2('0x16')]=_[_0xfba2('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfba2('0x18'))(new Redis(config[_0xfba2('0x16')]));require(_0xfba2('0x19'))[_0xfba2('0x1a')](socket);var jayson=require(_0xfba2('0x1b'));var client=jayson['client'][_0xfba2('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x49888b,_0x555ef5,_0x2e56c1,_0x49e84d){return new BPromise(function(_0x926eb4,_0x19f1b8){var _0x416c97=_0x49e84d||client;return _0x416c97[_0xfba2('0x1d')](_0x49888b,_0x2e56c1)[_0xfba2('0x1e')](function(_0x3ede88){logger[_0xfba2('0x1f')](_0xfba2('0x20'),_0x555ef5,'request\x20sent');logger[_0xfba2('0x21')](_0xfba2('0x22'),_0x555ef5,'request\x20sent',JSON[_0xfba2('0x23')](_0x3ede88));if(_0x3ede88[_0xfba2('0x24')]){if(_0x3ede88['error'][_0xfba2('0x25')]===0x1f4){logger[_0xfba2('0x24')]('SmsAccount,\x20%s,\x20%s',_0x555ef5,_0x3ede88[_0xfba2('0x24')]['message']);return _0x19f1b8(_0x3ede88[_0xfba2('0x24')][_0xfba2('0x26')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x555ef5,_0x3ede88[_0xfba2('0x24')][_0xfba2('0x26')]);return _0x926eb4(_0x3ede88[_0xfba2('0x24')][_0xfba2('0x26')]);}else{logger[_0xfba2('0x1f')](_0xfba2('0x20'),_0x555ef5,'request\x20sent');_0x926eb4(_0x3ede88[_0xfba2('0x27')][_0xfba2('0x26')]);}})[_0xfba2('0x28')](function(_0x1dda05){logger[_0xfba2('0x24')]('SmsAccount,\x20%s,\x20%s',_0x555ef5,_0x1dda05);_0x19f1b8(_0x1dda05);});});}function respondWithStatusCode(_0x243698,_0x1fe249){_0x1fe249=_0x1fe249||0xcc;return function(_0x1bf644){if(_0x1bf644){return _0x243698[_0xfba2('0x29')](_0x1fe249);}return _0x243698[_0xfba2('0x2a')](_0x1fe249)[_0xfba2('0x2b')]();};}function respondWithResult(_0x32aace,_0x52c112){_0x52c112=_0x52c112||0xc8;return function(_0x923df3){if(_0x923df3){return _0x32aace[_0xfba2('0x2a')](_0x52c112)[_0xfba2('0x2c')](_0x923df3);}};}function respondWithFilteredResult(_0x30eda8,_0x5053ca){return function(_0x1a5cd7){if(_0x1a5cd7){var _0x3bd779=typeof _0x5053ca[_0xfba2('0x2d')]==='undefined'&&typeof _0x5053ca[_0xfba2('0x2e')]===_0xfba2('0x2f');var _0x2c3789=_0x1a5cd7[_0xfba2('0x30')];var _0x213446=_0x3bd779?0x0:_0x5053ca[_0xfba2('0x2d')];var _0x26a677=_0x3bd779?_0x1a5cd7[_0xfba2('0x30')]:_0x5053ca['offset']+_0x5053ca['limit'];var _0x58c2c1;if(_0x26a677>=_0x2c3789){_0x26a677=_0x2c3789;_0x58c2c1=0xc8;}else{_0x58c2c1=0xce;}_0x30eda8[_0xfba2('0x2a')](_0x58c2c1);return _0x30eda8['set'](_0xfba2('0x31'),_0x213446+'-'+_0x26a677+'/'+_0x2c3789)[_0xfba2('0x2c')](_0x1a5cd7);}return null;};}function patchUpdates(_0x166fb9){return function(_0x571d14){try{jsonpatch[_0xfba2('0x32')](_0x571d14,_0x166fb9,!![]);}catch(_0x3b81f8){return BPromise[_0xfba2('0x33')](_0x3b81f8);}return _0x571d14['save']();};}function saveUpdates(_0x2acafb,_0xd7c9f5){return function(_0x251259){if(_0x251259){return _0x251259[_0xfba2('0x34')](_0x2acafb)['then'](function(_0x5ad614){return _0x5ad614;});}return null;};}function removeEntity(_0x33bfdc,_0x37e390){return function(_0xbe733c){if(_0xbe733c){return _0xbe733c[_0xfba2('0x35')]()['then'](function(){var _0x1eacbd=_0xbe733c['get']({'plain':!![]});var _0x194b4c=_0xfba2('0x36');return db[_0xfba2('0x37')][_0xfba2('0x35')]({'where':{'type':_0x194b4c,'resourceId':_0x1eacbd['id']}})[_0xfba2('0x1e')](function(){return _0xbe733c;});})[_0xfba2('0x1e')](function(){_0x33bfdc[_0xfba2('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13a5df,_0x487b49){return function(_0x43f52f){if(!_0x43f52f){_0x13a5df[_0xfba2('0x29')](0x194);}return _0x43f52f;};}function handleError(_0x562cf4,_0x424468){_0x424468=_0x424468||0x1f4;return function(_0x1f043c){logger[_0xfba2('0x24')](_0x1f043c[_0xfba2('0x38')]);if(_0x1f043c[_0xfba2('0x39')]){delete _0x1f043c[_0xfba2('0x39')];}_0x562cf4[_0xfba2('0x2a')](_0x424468)['send'](_0x1f043c);};}exports['index']=function(_0xb5afa2,_0x35d9c9){var _0x102863={'include':[{'model':db[_0xfba2('0x3a')],'as':_0xfba2('0x3b')}]},_0x51e107={},_0x59ae4a={'count':0x0,'rows':[]};var _0x161d6f=_[_0xfba2('0x3c')](db[_0xfba2('0x3d')]['rawAttributes'],function(_0x4606c4){return{'name':_0x4606c4[_0xfba2('0x3e')],'type':_0x4606c4[_0xfba2('0x3f')]['key']};});_0x51e107[_0xfba2('0x40')]=_['map'](_0x161d6f,_0xfba2('0x39'));_0x51e107[_0xfba2('0x41')]=_['keys'](_0xb5afa2[_0xfba2('0x41')]);_0x51e107[_0xfba2('0x42')]=_[_0xfba2('0x43')](_0x51e107['model'],_0x51e107[_0xfba2('0x41')]);_0x102863[_0xfba2('0x44')]=_[_0xfba2('0x43')](_0x51e107[_0xfba2('0x40')],qs['fields'](_0xb5afa2[_0xfba2('0x41')]['fields']));_0x102863[_0xfba2('0x44')]=_0x102863[_0xfba2('0x44')][_0xfba2('0x45')]?_0x102863[_0xfba2('0x44')]:_0x51e107[_0xfba2('0x40')];if(!_0xb5afa2[_0xfba2('0x41')][_0xfba2('0x46')]('nolimit')){_0x102863['limit']=qs[_0xfba2('0x2e')](_0xb5afa2[_0xfba2('0x41')][_0xfba2('0x2e')]);_0x102863[_0xfba2('0x2d')]=qs['offset'](_0xb5afa2[_0xfba2('0x41')][_0xfba2('0x2d')]);}_0x102863[_0xfba2('0x47')]=qs[_0xfba2('0x48')](_0xb5afa2[_0xfba2('0x41')][_0xfba2('0x48')]);_0x102863[_0xfba2('0x49')]=qs[_0xfba2('0x42')](_[_0xfba2('0x4a')](_0xb5afa2[_0xfba2('0x41')],_0x51e107[_0xfba2('0x42')]),_0x161d6f);if(_0xb5afa2[_0xfba2('0x41')]['filter']){_0x102863['where']=_[_0xfba2('0x4b')](_0x102863[_0xfba2('0x49')],{'$or':_[_0xfba2('0x3c')](_0x161d6f,function(_0x116b86){if(_0x116b86[_0xfba2('0x3f')]!==_0xfba2('0x4c')){var _0x26d7f8={};_0x26d7f8[_0x116b86['name']]={'$like':'%'+_0xb5afa2[_0xfba2('0x41')][_0xfba2('0x4d')]+'%'};return _0x26d7f8;}})});}_0x102863=_[_0xfba2('0x4b')]({},_0x102863,_0xb5afa2[_0xfba2('0x4e')]);var _0x22d959={'where':_0x102863[_0xfba2('0x49')]};return db[_0xfba2('0x3d')][_0xfba2('0x30')](_0x22d959)[_0xfba2('0x1e')](function(_0x37f97a){_0x59ae4a['count']=_0x37f97a;if(_0xb5afa2[_0xfba2('0x41')][_0xfba2('0x4f')]){_0x102863[_0xfba2('0x50')]=[{'all':!![]}];}return db[_0xfba2('0x3d')][_0xfba2('0x51')](_0x102863);})['then'](function(_0x4c8ca7){_0x59ae4a[_0xfba2('0x52')]=_0x4c8ca7;return _0x59ae4a;})[_0xfba2('0x1e')](respondWithFilteredResult(_0x35d9c9,_0x102863))[_0xfba2('0x28')](handleError(_0x35d9c9,null));};exports[_0xfba2('0x53')]=function(_0x6dd939,_0x2bffa4){var _0x232679={'raw':![],'where':{'id':_0x6dd939['params']['id']},'include':[{'model':db['Pause'],'as':_0xfba2('0x3b')}]},_0x51e4ae={};_0x51e4ae[_0xfba2('0x40')]=_[_0xfba2('0x54')](db[_0xfba2('0x3d')][_0xfba2('0x55')]);_0x51e4ae[_0xfba2('0x41')]=_[_0xfba2('0x54')](_0x6dd939[_0xfba2('0x41')]);_0x51e4ae[_0xfba2('0x42')]=_[_0xfba2('0x43')](_0x51e4ae[_0xfba2('0x40')],_0x51e4ae['query']);_0x232679['attributes']=_[_0xfba2('0x43')](_0x51e4ae[_0xfba2('0x40')],qs[_0xfba2('0x56')](_0x6dd939['query']['fields']));_0x232679['attributes']=_0x232679[_0xfba2('0x44')][_0xfba2('0x45')]?_0x232679[_0xfba2('0x44')]:_0x51e4ae[_0xfba2('0x40')];if(_0x6dd939[_0xfba2('0x41')][_0xfba2('0x4f')]){_0x232679[_0xfba2('0x50')]=[{'all':!![]}];}_0x232679=_['merge']({},_0x232679,_0x6dd939[_0xfba2('0x4e')]);return db[_0xfba2('0x3d')]['find'](_0x232679)[_0xfba2('0x1e')](handleEntityNotFound(_0x2bffa4,null))[_0xfba2('0x1e')](respondWithResult(_0x2bffa4,null))[_0xfba2('0x28')](handleError(_0x2bffa4,null));};exports[_0xfba2('0x57')]=function(_0x5ccca0,_0x4ab083){return db[_0xfba2('0x3d')][_0xfba2('0x57')](_0x5ccca0[_0xfba2('0x58')],{})[_0xfba2('0x1e')](function(_0x1a415b){var _0x15f3c5=_0x5ccca0['user'][_0xfba2('0x59')]({'plain':!![]});if(!_0x15f3c5)throw new Error(_0xfba2('0x5a'));if(_0x15f3c5[_0xfba2('0x5b')]===_0xfba2('0x5c')){var _0x3f077e=_0x1a415b[_0xfba2('0x59')]({'plain':!![]});var _0x585d06=_0xfba2('0x36');return db[_0xfba2('0x5d')][_0xfba2('0x5e')]({'where':{'name':_0x585d06,'userProfileId':_0x15f3c5[_0xfba2('0x5f')]},'raw':!![]})['then'](function(_0x194a96){if(_0x194a96&&_0x194a96[_0xfba2('0x60')]===0x0){return db['UserProfileResource'][_0xfba2('0x57')]({'name':_0x3f077e[_0xfba2('0x39')],'resourceId':_0x3f077e['id'],'type':_0x194a96['name'],'sectionId':_0x194a96['id']},{})['then'](function(){return _0x1a415b;});}else{return _0x1a415b;}})['catch'](function(_0x57b97b){logger[_0xfba2('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57b97b);throw _0x57b97b;});}return _0x1a415b;})['then'](respondWithResult(_0x4ab083,0xc9))['catch'](handleError(_0x4ab083,null));};exports[_0xfba2('0x34')]=function(_0x120ca2,_0x4ad994){if(_0x120ca2[_0xfba2('0x58')]['id']){delete _0x120ca2[_0xfba2('0x58')]['id'];}return db[_0xfba2('0x3d')][_0xfba2('0x5e')]({'where':{'id':_0x120ca2[_0xfba2('0x61')]['id']},'include':[{'model':db['Pause'],'as':_0xfba2('0x3b')}]})[_0xfba2('0x1e')](handleEntityNotFound(_0x4ad994,null))[_0xfba2('0x1e')](saveUpdates(_0x120ca2[_0xfba2('0x58')],null))[_0xfba2('0x1e')](respondWithResult(_0x4ad994,null))[_0xfba2('0x28')](handleError(_0x4ad994,null));};exports[_0xfba2('0x35')]=function(_0x44f48e,_0xe1a54b){return db['SmsAccount'][_0xfba2('0x5e')]({'where':{'id':_0x44f48e['params']['id']}})[_0xfba2('0x1e')](handleEntityNotFound(_0xe1a54b,null))['then'](removeEntity(_0xe1a54b,null))[_0xfba2('0x28')](handleError(_0xe1a54b,null));};exports[_0xfba2('0x62')]=function(_0x10b23a,_0x9702b1){return db['SmsAccount']['describe']()[_0xfba2('0x1e')](respondWithResult(_0x9702b1,null))['catch'](handleError(_0x9702b1,null));};exports[_0xfba2('0x63')]=function(_0x5a6465,_0x49113d,_0x2f129e){if(_0x5a6465[_0xfba2('0x58')]['id']){delete _0x5a6465[_0xfba2('0x58')]['id'];}return db['SmsAccount'][_0xfba2('0x5e')]({'where':{'id':_0x5a6465[_0xfba2('0x61')]['id']}})[_0xfba2('0x1e')](handleEntityNotFound(_0x49113d,null))[_0xfba2('0x1e')](function(_0x4314dd){if(_0x4314dd){_0x5a6465[_0xfba2('0x58')][_0xfba2('0x64')]=_0x4314dd['id'];return db[_0xfba2('0x65')]['create'](_0x5a6465[_0xfba2('0x58')]);}})[_0xfba2('0x1e')](respondWithResult(_0x49113d,null))[_0xfba2('0x28')](handleError(_0x49113d,null));};exports[_0xfba2('0x66')]=function(_0x5e6f1b,_0x12f181,_0x549ab5){var _0x1951aa={'raw':![],'where':{}};var _0x4bec2c={};var _0x32200b={'count':0x0,'rows':[]};return db[_0xfba2('0x3d')]['findOne']({'where':{'id':_0x5e6f1b[_0xfba2('0x61')]['id']}})[_0xfba2('0x1e')](handleEntityNotFound(_0x12f181,null))[_0xfba2('0x1e')](function(_0x4f782c){if(_0x4f782c){_0x4bec2c[_0xfba2('0x40')]=_[_0xfba2('0x54')](db[_0xfba2('0x65')][_0xfba2('0x55')]);_0x4bec2c[_0xfba2('0x41')]=_[_0xfba2('0x54')](_0x5e6f1b['query']);_0x4bec2c[_0xfba2('0x42')]=_[_0xfba2('0x43')](_0x4bec2c['model'],_0x4bec2c[_0xfba2('0x41')]);_0x1951aa['attributes']=_[_0xfba2('0x43')](_0x4bec2c['model'],qs[_0xfba2('0x56')](_0x5e6f1b[_0xfba2('0x41')][_0xfba2('0x56')]));_0x1951aa[_0xfba2('0x44')]=_0x1951aa[_0xfba2('0x44')][_0xfba2('0x45')]?_0x1951aa[_0xfba2('0x44')]:_0x4bec2c['model'];if(!_0x5e6f1b['query'][_0xfba2('0x46')]('nolimit')){_0x1951aa['limit']=qs[_0xfba2('0x2e')](_0x5e6f1b['query']['limit']);_0x1951aa[_0xfba2('0x2d')]=qs['offset'](_0x5e6f1b['query'][_0xfba2('0x2d')]);}_0x1951aa['order']=qs['sort'](_0x5e6f1b[_0xfba2('0x41')]['sort']);_0x1951aa[_0xfba2('0x49')]=qs['filters'](_['pick'](_0x5e6f1b[_0xfba2('0x41')],_0x4bec2c[_0xfba2('0x42')]));_0x1951aa[_0xfba2('0x49')][_0xfba2('0x64')]=_0x4f782c['id'];if(_0x5e6f1b[_0xfba2('0x41')]['filter']){_0x1951aa['where']=_[_0xfba2('0x4b')](_0x1951aa['where'],{'$or':_[_0xfba2('0x3c')](_0x1951aa[_0xfba2('0x44')],function(_0x2c06d3){var _0x2c9906={};_0x2c9906[_0x2c06d3]={'$like':'%'+_0x5e6f1b[_0xfba2('0x41')][_0xfba2('0x4d')]+'%'};return _0x2c9906;})});}_0x1951aa=_[_0xfba2('0x4b')]({},_0x1951aa,_0x5e6f1b[_0xfba2('0x4e')]);return db[_0xfba2('0x65')][_0xfba2('0x30')]({'where':_0x1951aa[_0xfba2('0x49')]})[_0xfba2('0x1e')](function(_0x292723){_0x32200b[_0xfba2('0x30')]=_0x292723;if(_0x5e6f1b[_0xfba2('0x41')][_0xfba2('0x4f')]){_0x1951aa[_0xfba2('0x50')]=[{'all':!![]}];}return db[_0xfba2('0x65')][_0xfba2('0x51')](_0x1951aa);})[_0xfba2('0x1e')](function(_0x1b95cb){_0x32200b[_0xfba2('0x52')]=_0x1b95cb;return _0x32200b;});}})[_0xfba2('0x1e')](respondWithFilteredResult(_0x12f181,_0x1951aa))['catch'](handleError(_0x12f181,null));};exports[_0xfba2('0x67')]=function(_0x574400,_0x2f6dfc,_0x30a472){return db[_0xfba2('0x3d')][_0xfba2('0x5e')]({'where':{'id':_0x574400[_0xfba2('0x61')]['id']}})[_0xfba2('0x1e')](handleEntityNotFound(_0x2f6dfc,null))[_0xfba2('0x1e')](function(_0x1fb9b3){if(_0x1fb9b3){return _0x1fb9b3[_0xfba2('0x67')](_0x574400[_0xfba2('0x41')][_0xfba2('0x68')]);}})['then'](respondWithStatusCode(_0x2f6dfc,null))[_0xfba2('0x28')](handleError(_0x2f6dfc,null));};exports[_0xfba2('0x69')]=function(_0x4a3167,_0x3e6d18,_0x555658){if(_0x4a3167[_0xfba2('0x58')]['id']){delete _0x4a3167[_0xfba2('0x58')]['id'];}return db[_0xfba2('0x3d')]['find']({'where':{'id':_0x4a3167[_0xfba2('0x61')]['id']}})[_0xfba2('0x1e')](handleEntityNotFound(_0x3e6d18,null))[_0xfba2('0x1e')](function(_0x571ff0){if(_0x571ff0){_0x4a3167[_0xfba2('0x58')][_0xfba2('0x64')]=_0x571ff0['id'];return db[_0xfba2('0x6a')]['create'](_0x4a3167[_0xfba2('0x58')]);}})[_0xfba2('0x1e')](respondWithResult(_0x3e6d18,null))['catch'](handleError(_0x3e6d18,null));};exports[_0xfba2('0x6b')]=function(_0x4ffb29,_0x59ca13,_0x5e6d41){var _0x40c477={'raw':![],'where':{}};var _0x36652d={};var _0x9c2d82={'count':0x0,'rows':[]};return db[_0xfba2('0x3d')][_0xfba2('0x6c')]({'where':{'id':_0x4ffb29[_0xfba2('0x61')]['id']}})[_0xfba2('0x1e')](handleEntityNotFound(_0x59ca13,null))['then'](function(_0x4150e9){if(_0x4150e9){_0x36652d[_0xfba2('0x40')]=_[_0xfba2('0x54')](db[_0xfba2('0x6a')][_0xfba2('0x55')]);_0x36652d[_0xfba2('0x41')]=_[_0xfba2('0x54')](_0x4ffb29[_0xfba2('0x41')]);_0x36652d['filters']=_['intersection'](_0x36652d['model'],_0x36652d[_0xfba2('0x41')]);_0x40c477[_0xfba2('0x44')]=_[_0xfba2('0x43')](_0x36652d['model'],qs[_0xfba2('0x56')](_0x4ffb29[_0xfba2('0x41')][_0xfba2('0x56')]));_0x40c477[_0xfba2('0x44')]=_0x40c477[_0xfba2('0x44')][_0xfba2('0x45')]?_0x40c477[_0xfba2('0x44')]:_0x36652d[_0xfba2('0x40')];if(!_0x4ffb29['query'][_0xfba2('0x46')](_0xfba2('0x6d'))){_0x40c477[_0xfba2('0x2e')]=qs[_0xfba2('0x2e')](_0x4ffb29[_0xfba2('0x41')][_0xfba2('0x2e')]);_0x40c477['offset']=qs[_0xfba2('0x2d')](_0x4ffb29[_0xfba2('0x41')][_0xfba2('0x2d')]);}_0x40c477[_0xfba2('0x47')]=qs[_0xfba2('0x48')](_0x4ffb29[_0xfba2('0x41')][_0xfba2('0x48')]);_0x40c477[_0xfba2('0x49')]=qs['filters'](_['pick'](_0x4ffb29['query'],_0x36652d[_0xfba2('0x42')]));_0x40c477[_0xfba2('0x49')][_0xfba2('0x64')]=_0x4150e9['id'];if(_0x4ffb29['query'][_0xfba2('0x4d')]){_0x40c477[_0xfba2('0x49')]=_['merge'](_0x40c477['where'],{'$or':_[_0xfba2('0x3c')](_0x40c477[_0xfba2('0x44')],function(_0x463222){var _0x39cee2={};_0x39cee2[_0x463222]={'$like':'%'+_0x4ffb29[_0xfba2('0x41')][_0xfba2('0x4d')]+'%'};return _0x39cee2;})});}_0x40c477=_[_0xfba2('0x4b')]({},_0x40c477,_0x4ffb29['options']);return db[_0xfba2('0x6a')][_0xfba2('0x30')]({'where':_0x40c477['where']})[_0xfba2('0x1e')](function(_0x1ab731){_0x9c2d82[_0xfba2('0x30')]=_0x1ab731;if(_0x4ffb29[_0xfba2('0x41')][_0xfba2('0x4f')]){_0x40c477['include']=[{'all':!![]}];}return db[_0xfba2('0x6a')][_0xfba2('0x51')](_0x40c477);})['then'](function(_0x215f04){_0x9c2d82[_0xfba2('0x52')]=_0x215f04;return _0x9c2d82;});}})[_0xfba2('0x1e')](respondWithFilteredResult(_0x59ca13,_0x40c477))[_0xfba2('0x28')](handleError(_0x59ca13,null));};exports['removeAnswers']=function(_0x5631c3,_0x9285c6,_0x286a99){return db[_0xfba2('0x3d')][_0xfba2('0x5e')]({'where':{'id':_0x5631c3['params']['id']}})[_0xfba2('0x1e')](handleEntityNotFound(_0x9285c6,null))[_0xfba2('0x1e')](function(_0x349ead){if(_0x349ead){return _0x349ead['removeAnswers'](_0x5631c3[_0xfba2('0x41')]['ids']);}})['then'](respondWithStatusCode(_0x9285c6,null))[_0xfba2('0x28')](handleError(_0x9285c6,null));};exports[_0xfba2('0x6e')]=function(_0x48251f,_0xfc3cf8,_0x369dbb){var _0x537964={'channel':_0xfba2('0x6f')};var _0x3ad639=[];var _0x3dd003=[];var _0x580cf1={};return db[_0xfba2('0x3d')]['find']({'where':{'id':_0x48251f[_0xfba2('0x61')]['id']},'include':[{'model':db[_0xfba2('0x70')],'as':_0xfba2('0x71')}]})[_0xfba2('0x1e')](handleEntityNotFound(_0xfc3cf8,null))['then'](function(_0x58425c){_0x537964[_0xfba2('0x72')]=_0x58425c;_0x537964[_0xfba2('0x73')]=_[_0xfba2('0x74')](_0x58425c[_0xfba2('0x71')],[_0xfba2('0x75')],[_0xfba2('0x76')]);if(_0x537964[_0xfba2('0x72')][_0xfba2('0x71')]){delete _0x537964[_0xfba2('0x72')][_0xfba2('0x71')];}return db[_0xfba2('0x77')][_0xfba2('0x62')]();})[_0xfba2('0x1e')](function(_0x3c3b03){if(!_0x3c3b03){throw new db['Sequelize'][(_0xfba2('0x78'))](_0xfba2('0x79'));}_0x3ad639=_['difference'](_[_0xfba2('0x54')](_0x3c3b03),[_0xfba2('0x7a'),'updatedAt']);_0x3dd003=_[_0xfba2('0x7b')](_['keys'](_0x3c3b03),[_0xfba2('0x7a'),_0xfba2('0x7c'),_0xfba2('0x7d'),_0xfba2('0x7e')]);_0x537964['body']={'mapKey':_0xfba2('0x7f')};if(_0x537964[_0xfba2('0x72')][_0xfba2('0x3f')]){switch(_0x537964['account'][_0xfba2('0x3f')]){case _0xfba2('0x80'):_0x537964[_0xfba2('0x58')][_0xfba2('0x81')]=_0x48251f[_0xfba2('0x58')][_0xfba2('0x82')];_0x537964[_0xfba2('0x58')][_0xfba2('0x58')]=_0x48251f[_0xfba2('0x58')][_0xfba2('0x83')];_0x537964[_0xfba2('0x58')][_0xfba2('0x84')]=_0x48251f[_0xfba2('0x58')][_0xfba2('0x85')];break;case _0xfba2('0x86'):_0x537964[_0xfba2('0x58')]['from']='+'+_0x48251f[_0xfba2('0x58')]['sender'];_0x537964[_0xfba2('0x58')][_0xfba2('0x58')]=_0x48251f['body']['text'];break;case _0xfba2('0x87'):_0x537964['body']['from']=_0x48251f[_0xfba2('0x58')][_0xfba2('0x81')];_0x537964[_0xfba2('0x58')][_0xfba2('0x58')]=_0x48251f['body'][_0xfba2('0x26')];break;case'clicksend':_0x537964[_0xfba2('0x58')]['from']=_0x48251f[_0xfba2('0x58')][_0xfba2('0x81')];_0x537964[_0xfba2('0x58')]['body']=_0x48251f[_0xfba2('0x58')]['body'];_0x537964[_0xfba2('0x58')][_0xfba2('0x84')]=_0x48251f[_0xfba2('0x58')][_0xfba2('0x88')];break;case _0xfba2('0x89'):_0x537964[_0xfba2('0x58')]['from']=_0x48251f['body']['From'];_0x537964['body'][_0xfba2('0x58')]=_0x48251f[_0xfba2('0x58')][_0xfba2('0x8a')];_0x537964['body'][_0xfba2('0x84')]=_0x48251f[_0xfba2('0x58')]['MessageUUID'];break;case'infobip':_0x537964['body'][_0xfba2('0x81')]='+'+_0x48251f[_0xfba2('0x58')]['results'][0x0][_0xfba2('0x81')];_0x537964['body'][_0xfba2('0x58')]=_0x48251f['body'][_0xfba2('0x8b')][0x0][_0xfba2('0x8c')];_0x537964[_0xfba2('0x58')][_0xfba2('0x84')]=_0x48251f[_0xfba2('0x58')][_0xfba2('0x8b')][0x0][_0xfba2('0x84')];break;case _0xfba2('0x8d'):_0x537964[_0xfba2('0x58')][_0xfba2('0x81')]=_0x48251f['body'][_0xfba2('0x8e')];_0x537964['body'][_0xfba2('0x58')]=_0x48251f['body'][_0xfba2('0x8f')]['message'];break;case'clickatell':_0x537964[_0xfba2('0x58')][_0xfba2('0x81')]=_0x48251f[_0xfba2('0x58')][_0xfba2('0x90')];_0x537964[_0xfba2('0x58')][_0xfba2('0x58')]=_0x48251f[_0xfba2('0x58')][_0xfba2('0x8c')];_0x537964['body'][_0xfba2('0x84')]=_0x48251f['body'][_0xfba2('0x91')];break;case'bandwidth':_0x537964['body']['messageId']=_0x48251f[_0xfba2('0x58')][0x0]['message']['id'];_0x537964[_0xfba2('0x58')][_0xfba2('0x81')]=_0x48251f[_0xfba2('0x58')][0x0][_0xfba2('0x26')][_0xfba2('0x81')];_0x537964[_0xfba2('0x58')][_0xfba2('0x58')]=_0x48251f[_0xfba2('0x58')][0x0]['message'][_0xfba2('0x8c')];break;case _0xfba2('0x92'):_0x537964[_0xfba2('0x58')][_0xfba2('0x81')]=_0x48251f[_0xfba2('0x58')][_0xfba2('0x81')];_0x537964[_0xfba2('0x58')]['body']=_0x48251f[_0xfba2('0x58')][_0xfba2('0x26')];_0x537964[_0xfba2('0x58')]['messageId']=_0x48251f[_0xfba2('0x58')]['refid'];break;}}if(_0x537964[_0xfba2('0x58')]['id']){delete _0x537964[_0xfba2('0x58')]['id'];}if(_[_0xfba2('0x93')](_0x537964[_0xfba2('0x58')][_0xfba2('0x81')])){throw new db[(_0xfba2('0x94'))][(_0xfba2('0x78'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x537964[_0xfba2('0x58')][_0xfba2('0x58')])||_0x537964[_0xfba2('0x58')][_0xfba2('0x58')]===''){throw new db['Sequelize'][(_0xfba2('0x78'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xfba2('0x93')](_0x537964[_0xfba2('0x58')][_0xfba2('0x95')])){throw new db['Sequelize'][(_0xfba2('0x78'))](_0xfba2('0x96')+_0x3dd003);}if(!_[_0xfba2('0x97')](_0x3dd003,_0x537964[_0xfba2('0x58')][_0xfba2('0x95')])){throw new db['Sequelize'][(_0xfba2('0x78'))](_0xfba2('0x98')+_0x3dd003);}_0x580cf1[_0x537964[_0xfba2('0x58')]['mapKey']]=_0x537964['body'][_0xfba2('0x81')];return db['CmList']['find']({'where':{'id':_0x537964['account']['ListId']},'include':[{'model':db[_0xfba2('0x77')],'as':_0xfba2('0x99'),'where':_0x580cf1,'limit':0x1,'order':[[_0xfba2('0x7c'),'DESC']]}]});})['then'](handleEntityNotFound(_0xfc3cf8,null))['then'](function(_0x15cf0f){if(_0x15cf0f){_0x537964[_0xfba2('0x9a')]=_[_0xfba2('0x9b')](_0x15cf0f,['Contacts']);if(_0x15cf0f[_0xfba2('0x99')]['length']){return _0x15cf0f[_0xfba2('0x99')][0x0];}var _0x5ebb0e=_[_0xfba2('0x17')](_0x537964[_0xfba2('0x58')],{'firstName':_0x537964['body'][_0xfba2('0x81')],'ListId':_0x15cf0f['id']});_0x5ebb0e[_0x537964[_0xfba2('0x58')][_0xfba2('0x95')]]=_0x537964[_0xfba2('0x58')]['from'];return db[_0xfba2('0x77')][_0xfba2('0x57')](_0x5ebb0e,{'fields':_0x3ad639,'raw':!![]});}})['then'](handleEntityNotFound(_0xfc3cf8,null))[_0xfba2('0x1e')](function(_0x544c24){if(_0x544c24){_0x537964[_0xfba2('0x9c')]=_0x544c24;var _0x96195f={'ContactId':_0x544c24['id'],'phone':_0x537964[_0xfba2('0x58')][_0xfba2('0x81')],'SmsAccountId':_0x48251f['params']['id']};var _0x4f20ae={'ContactId':_0x544c24['id'],'SmsAccountId':_0x48251f['params']['id'],'closed':![]};return db[_0xfba2('0x9d')][_0xfba2('0x5e')]({'where':_0x4f20ae})[_0xfba2('0x1e')](function(_0x165221){if(_0x165221){return[_0x165221,![]];}return db[_0xfba2('0x9d')][_0xfba2('0x57')](_0x96195f)['then'](function(_0x4ee481){return[_0x4ee481,!![]];});});}})['spread'](function(_0x1f5481,_0x1a51b0){_0x537964['interaction']=_0x1f5481[_0xfba2('0x59')]({'plain':!![]});_0x537964[_0xfba2('0x9e')]['created']=![];if(_0x1a51b0){if(_0x537964['account']['autoclose']){_0x537964[_0xfba2('0x73')][_0xfba2('0x9f')]({'id':0x0,'priority':_0x537964['applications']['length']+0x1,'app':'close','appdata':_0xfba2('0xa0'),'interval':'*,*,*,*'});}_0x537964[_0xfba2('0x9e')][_0xfba2('0xa1')]=!![];}return db['SmsMessage'][_0xfba2('0x57')]({'phone':_0x537964[_0xfba2('0x58')]['from'],'messageId':_0x537964[_0xfba2('0x58')][_0xfba2('0x84')],'body':_0x537964[_0xfba2('0x58')]['body'],'SmsAccountId':_0x48251f[_0xfba2('0x61')]['id'],'SmsInteractionId':_0x1f5481['id'],'direction':'in','ContactId':_0x1f5481[_0xfba2('0xa2')],'AttachmentId':_0x537964['body']['AttachmentId']});})[_0xfba2('0x1e')](function(_0x12302f){_0x537964['message']=_0x12302f;if(_0x537964[_0xfba2('0x9e')][_0xfba2('0xa3')]){return db['User']['find']({'attributes':['id',_0xfba2('0x39')],'where':{'id':_0x537964['interaction'][_0xfba2('0xa3')]}})[_0xfba2('0x1e')](function(_0xf79830){if(_0xf79830){_0x537964[_0xfba2('0x73')][_0xfba2('0xa4')]({'id':0x0,'priority':0x0,'app':_0xfba2('0xa5'),'appdata':_0xf79830[_0xfba2('0x39')]+','+(_0x537964['account']['waitForTheAssignedAgent']||0xa),'interval':_0xfba2('0xa6')});}return respondWithRpcPromise(_0xfba2('0xa7'),_0xfba2('0xa8'),_0x537964);});}return respondWithRpcPromise(_0xfba2('0xa7'),_0xfba2('0xa8'),_0x537964);})[_0xfba2('0x1e')](function(_0x1ca08e){if(_0x1ca08e){var _0xc865f=0xc8;var _0x380233=_0xfba2('0xa9');logger[_0xfba2('0x1f')](_0xfba2('0x22'),_0x380233,_0xc865f,_0xfba2('0xaa'));logger[_0xfba2('0x21')](_0xfba2('0xab'),_0x380233,_0xc865f,_0xfba2('0xaa'),JSON[_0xfba2('0x23')](_0x1ca08e));if(_0x537964[_0xfba2('0x72')][_0xfba2('0x3f')]==='twilio'){return _0xfc3cf8[_0xfba2('0x2a')](_0xc865f)[_0xfba2('0xac')](_0xfba2('0xad'),_0xfba2('0xae'))[_0xfba2('0xaf')](_0xfba2('0xb0'));}else{return _0xfc3cf8[_0xfba2('0x2a')](_0xc865f)[_0xfba2('0x2c')](_0x1ca08e);}}})[_0xfba2('0x28')](handleError(_0xfc3cf8,null));};exports[_0xfba2('0xb1')]=function(_0x58fa51,_0x47f15e){var _0x3da754=_0x58fa51['params']['id'];var _0x35af32=_0x58fa51[_0xfba2('0x58')];var _0x198811=0xc8;var _0x4769de=null;return db[_0xfba2('0xb2')][_0xfba2('0xb3')]({'isolationLevel':db[_0xfba2('0xb2')][_0xfba2('0xb4')]['ISOLATION_LEVELS'][_0xfba2('0xb5')]},function(_0x578d94){return db['SmsAccount'][_0xfba2('0x6c')]({'where':{'id':_0x3da754},'transaction':_0x578d94})['then'](function(_0x31f28b){if(_0x31f28b){return db[_0xfba2('0x70')][_0xfba2('0x35')]({'where':{'SmsAccountId':_0x3da754},'transaction':_0x578d94})[_0xfba2('0x1e')](function(){var _0x5d5481=_['map'](_0x35af32,function(_0x236038){_0x236038[_0xfba2('0x64')]=_0x3da754;return _0x236038;});return db[_0xfba2('0x70')]['bulkCreate'](_0x5d5481,{'transaction':_0x578d94});});}else{_0x198811=0x194;_0x4769de=[];}});})[_0xfba2('0x1e')](function(){if(_0x198811!==0x194){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x3da754},'order':_0xfba2('0x75')})[_0xfba2('0x1e')](function(_0xa05fc9){_0x4769de=_0xa05fc9;});}})['catch'](function(_0x4d2eef){_0x198811=0x1f4;logger['error'](_0x4d2eef[_0xfba2('0x38')]);if(_0x4d2eef[_0xfba2('0x39')]){delete _0x4d2eef[_0xfba2('0x39')];}_0x4769de=_0x4d2eef;})['finally'](function(){if(_0x4769de===null){_0x47f15e[_0xfba2('0x29')](_0x198811);}else{if(_0x198811===0x1f4){_0x47f15e[_0xfba2('0x2a')](_0x198811)[_0xfba2('0xaf')](_0x4769de);}else{_0x47f15e[_0xfba2('0x2a')](_0x198811)['json'](_0x4769de);}}});};exports[_0xfba2('0xb6')]=function(_0x1c32ce,_0x29de3d,_0x4e349e){var _0x1d3703={};var _0x39fba4={};var _0x19716a;var _0x56510f;return db[_0xfba2('0x3d')][_0xfba2('0x6c')]({'where':{'id':_0x1c32ce['params']['id']}})['then'](handleEntityNotFound(_0x29de3d,null))[_0xfba2('0x1e')](function(_0x136d4c){if(_0x136d4c){_0x19716a=_0x136d4c;_0x39fba4[_0xfba2('0x40')]=_[_0xfba2('0x54')](db[_0xfba2('0x70')][_0xfba2('0x55')]);_0x39fba4['query']=_['keys'](_0x1c32ce['query']);_0x39fba4[_0xfba2('0x42')]=_['intersection'](_0x39fba4[_0xfba2('0x40')],_0x39fba4[_0xfba2('0x41')]);_0x1d3703[_0xfba2('0x44')]=_[_0xfba2('0x43')](_0x39fba4[_0xfba2('0x40')],qs['fields'](_0x1c32ce[_0xfba2('0x41')][_0xfba2('0x56')]));_0x1d3703[_0xfba2('0x44')]=_0x1d3703[_0xfba2('0x44')][_0xfba2('0x45')]?_0x1d3703['attributes']:_0x39fba4[_0xfba2('0x40')];_0x1d3703[_0xfba2('0x47')]=qs[_0xfba2('0x48')](_0x1c32ce[_0xfba2('0x41')][_0xfba2('0x48')]);_0x1d3703[_0xfba2('0x49')]=qs[_0xfba2('0x42')](_[_0xfba2('0x4a')](_0x1c32ce[_0xfba2('0x41')],_0x39fba4['filters']));if(_0x1c32ce[_0xfba2('0x41')]['filter']){_0x1d3703[_0xfba2('0x49')]=_[_0xfba2('0x4b')](_0x1d3703[_0xfba2('0x49')],{'$or':_[_0xfba2('0x3c')](_0x1d3703[_0xfba2('0x44')],function(_0xffffec){var _0x37ba89={};_0x37ba89[_0xffffec]={'$like':'%'+_0x1c32ce['query'][_0xfba2('0x4d')]+'%'};return _0x37ba89;})});}_0x1d3703=_['merge']({},_0x1d3703,_0x1c32ce['options']);return _0x19716a[_0xfba2('0xb6')](_0x1d3703);}})[_0xfba2('0x1e')](function(_0x2658f2){if(_0x2658f2){_0x56510f=_0x2658f2[_0xfba2('0x45')];if(!_0x1c32ce['query'][_0xfba2('0x46')](_0xfba2('0x6d'))){_0x1d3703[_0xfba2('0x2e')]=qs[_0xfba2('0x2e')](_0x1c32ce[_0xfba2('0x41')]['limit']);_0x1d3703[_0xfba2('0x2d')]=qs[_0xfba2('0x2d')](_0x1c32ce['query']['offset']);}return _0x19716a[_0xfba2('0xb6')](_0x1d3703);}})[_0xfba2('0x1e')](function(_0x516488){if(_0x516488){return _0x516488?{'count':_0x56510f,'rows':_0x516488}:null;}})[_0xfba2('0x1e')](respondWithResult(_0x29de3d,null))[_0xfba2('0x28')](handleError(_0x29de3d,null));};exports[_0xfba2('0xb7')]=function(_0x1e6f58,_0x3a92da,_0x18d299){var _0x3f2b16={'raw':![],'where':{}};var _0x4d7626={};var _0x5d120c={'count':0x0,'rows':[]};return db[_0xfba2('0x3d')]['findOne']({'where':{'id':_0x1e6f58[_0xfba2('0x61')]['id']}})[_0xfba2('0x1e')](handleEntityNotFound(_0x3a92da,null))['then'](function(_0x1742aa){if(_0x1742aa){_0x4d7626[_0xfba2('0x40')]=_[_0xfba2('0x54')](db[_0xfba2('0x9d')][_0xfba2('0x55')]);_0x4d7626[_0xfba2('0x41')]=_[_0xfba2('0x54')](_0x1e6f58[_0xfba2('0x41')]);_0x4d7626[_0xfba2('0x42')]=_[_0xfba2('0x43')](_0x4d7626[_0xfba2('0x40')],_0x4d7626[_0xfba2('0x41')]);_0x3f2b16[_0xfba2('0x44')]=_[_0xfba2('0x43')](_0x4d7626[_0xfba2('0x40')],qs[_0xfba2('0x56')](_0x1e6f58[_0xfba2('0x41')][_0xfba2('0x56')]));_0x3f2b16['attributes']=_0x3f2b16['attributes'][_0xfba2('0x45')]?_0x3f2b16[_0xfba2('0x44')]:_0x4d7626[_0xfba2('0x40')];if(!_0x1e6f58['query']['hasOwnProperty'](_0xfba2('0x6d'))){_0x3f2b16[_0xfba2('0x2e')]=qs[_0xfba2('0x2e')](_0x1e6f58[_0xfba2('0x41')][_0xfba2('0x2e')]);_0x3f2b16[_0xfba2('0x2d')]=qs[_0xfba2('0x2d')](_0x1e6f58[_0xfba2('0x41')][_0xfba2('0x2d')]);}_0x3f2b16['order']=qs[_0xfba2('0x48')](_0x1e6f58['query'][_0xfba2('0x48')]);_0x3f2b16[_0xfba2('0x49')]=qs[_0xfba2('0x42')](_[_0xfba2('0x4a')](_0x1e6f58[_0xfba2('0x41')],_0x4d7626[_0xfba2('0x42')]));_0x3f2b16['where']['SmsAccountId']=_0x1742aa['id'];if(_0x1e6f58[_0xfba2('0x41')][_0xfba2('0x4d')]){_0x3f2b16[_0xfba2('0x49')]=_[_0xfba2('0x4b')](_0x3f2b16['where'],{'$or':_['map'](_0x3f2b16[_0xfba2('0x44')],function(_0xdeeeee){var _0x41149d={};_0x41149d[_0xdeeeee]={'$like':'%'+_0x1e6f58[_0xfba2('0x41')]['filter']+'%'};return _0x41149d;})});}_0x3f2b16=_[_0xfba2('0x4b')]({},_0x3f2b16,_0x1e6f58[_0xfba2('0x4e')]);return db['SmsInteraction'][_0xfba2('0x30')]({'where':_0x3f2b16[_0xfba2('0x49')]})[_0xfba2('0x1e')](function(_0x2a47fd){_0x5d120c[_0xfba2('0x30')]=_0x2a47fd;if(_0x1e6f58['query'][_0xfba2('0x4f')]){_0x3f2b16[_0xfba2('0x50')]=[{'model':db[_0xfba2('0x77')],'as':_0xfba2('0xb8'),'required':![]},{'model':db[_0xfba2('0xb9')],'as':_0xfba2('0xba'),'attributes':[_0xfba2('0x39'),_0xfba2('0xbb'),_0xfba2('0xbc')],'required':![]},{'model':db[_0xfba2('0xbd')],'as':'Tags','attributes':['id',_0xfba2('0x39'),_0xfba2('0xbe')],'where':_0x1e6f58['query']['tag']?{'id':_0x1e6f58['query'][_0xfba2('0xbf')]}:undefined,'required':_0x1e6f58[_0xfba2('0x41')][_0xfba2('0xbf')]?!![]:![]}];}return db[_0xfba2('0x9d')][_0xfba2('0x51')](_0x3f2b16);})[_0xfba2('0x1e')](function(_0x4ee91b){_0x5d120c[_0xfba2('0x52')]=_0x4ee91b;return _0x5d120c;});}})[_0xfba2('0x1e')](respondWithFilteredResult(_0x3a92da,_0x3f2b16))[_0xfba2('0x28')](handleError(_0x3a92da,null));};exports[_0xfba2('0xaf')]=function(_0x37f401,_0x2a6c7b,_0x4b8a77){var _0x1bf701,_0x322d76,_0x19d3d2;if(_[_0xfba2('0x93')](_0x37f401[_0xfba2('0x58')][_0xfba2('0x58')])||_0x37f401[_0xfba2('0x58')][_0xfba2('0x58')]===''){throw new db[(_0xfba2('0x94'))]['ValidationError'](_0xfba2('0xc0'));}if(_['isNil'](_0x37f401['body']['to'])){throw new db['Sequelize'][(_0xfba2('0x78'))](_0xfba2('0xc1'));}_0x1bf701=_0x37f401[_0xfba2('0x58')]['to'];return db[_0xfba2('0x3d')][_0xfba2('0x5e')]({'where':{'id':_0x37f401[_0xfba2('0x61')]['id']},'include':[{'model':db[_0xfba2('0xc2')],'as':_0xfba2('0xc3'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x1bf701},'limit':0x1,'order':[[_0xfba2('0x7c'),'DESC']]}]}]})[_0xfba2('0x1e')](handleEntityNotFound(_0x2a6c7b,null))[_0xfba2('0x1e')](function(_0x3c743f){if(_0x3c743f&&_0x3c743f['List']){_0x322d76=_0x3c743f[_0xfba2('0x59')]({'plain':!![]});if(_0x322d76[_0xfba2('0xc3')]&&_0x322d76[_0xfba2('0xc3')][_0xfba2('0x99')][_0xfba2('0x45')]){return _0x322d76[_0xfba2('0xc3')]['Contacts'][0x0];}return db[_0xfba2('0x77')]['create'](_[_0xfba2('0x17')](_0x37f401['body'],{'firstName':_0x1bf701,'mobile':_0x1bf701,'phone':_0x1bf701,'ListId':_0x322d76[_0xfba2('0x7e')]}));}})[_0xfba2('0x1e')](handleEntityNotFound(_0x2a6c7b,null))[_0xfba2('0x1e')](function(_0x5530f2){if(_0x5530f2){_0x19d3d2=_0x5530f2;return db[_0xfba2('0x9d')]['find']({'where':{'ContactId':_0x19d3d2['id'],'closed':![],'SmsAccountId':_0x322d76['id']}})[_0xfba2('0x1e')](function(_0x4d5b32){if(_0x4d5b32){return[_0x4d5b32,![]];}return db[_0xfba2('0x9d')][_0xfba2('0x57')]({'UserId':_0x37f401[_0xfba2('0x5c')]['id'],'ContactId':_0x19d3d2['id'],'SmsAccountId':_0x322d76['id'],'phone':_0x1bf701,'firstMsgDirection':_0xfba2('0xc4'),'Messages':[_[_0xfba2('0x4b')](_0x37f401[_0xfba2('0x58')],{'read':![],'body':_0x37f401['body'][_0xfba2('0x58')],'phone':_0x1bf701,'SmsAccountId':_0x322d76['id'],'UserId':_0x37f401['user']['id'],'ContactId':_0x19d3d2['id']})]},{'include':[{'model':db[_0xfba2('0xc5')],'as':'Messages'}]})['then'](function(_0x2137fa){return[_0x2137fa,!![]];});});}})['spread'](function(_0x215d44,_0xd38b0b){if(_0xd38b0b){return _0x215d44;}return db['SmsMessage']['create'](_['merge'](_0x37f401['body'],{'read':![],'body':_0x37f401[_0xfba2('0x58')][_0xfba2('0x58')],'phone':_0x1bf701,'SmsAccountId':_0x322d76['id'],'SmsInteractionId':_0x215d44['id'],'UserId':_0x37f401['user']['id'],'ContactId':_0x19d3d2['id']}))[_0xfba2('0x1e')](function(_0x148389){_0x215d44[_0xfba2('0xc6')][_0xfba2('0xc7')]=[];_0x215d44[_0xfba2('0xc6')]['Messages'][_0xfba2('0x9f')](_0x148389[_0xfba2('0xc6')]);return _0x215d44;});})[_0xfba2('0x1e')](respondWithResult(_0x2a6c7b,null))[_0xfba2('0x28')](handleError(_0x2a6c7b,null));};exports[_0xfba2('0x2a')]=function(_0x5aaf5c,_0x10c121,_0x224624){if(_0x5aaf5c[_0xfba2('0x58')]['id']){delete _0x5aaf5c[_0xfba2('0x58')]['id'];}var _0xfc5f01,_0x5cb67c,_0x4b48cb;return db[_0xfba2('0x3d')][_0xfba2('0x5e')]({'where':{'id':_0x5aaf5c['params']['id']}})['then'](handleEntityNotFound(_0x10c121,null))[_0xfba2('0x1e')](function(_0x5e081d){if(_0x5e081d){_0x4b48cb=_0x5e081d;logger['debug'](_0xfba2('0x22'),_0xfba2('0x2a'),_0xfba2('0xc8'),_0x5e081d[_0xfba2('0x3f')],util[_0xfba2('0xc9')](_0x5aaf5c['body'],{'showHidden':![],'depth':null}));switch(_0x5e081d[_0xfba2('0x3f')]){case _0xfba2('0x86'):if(_0x5aaf5c[_0xfba2('0x58')]['skebby_dispatch_id']&&_0x5aaf5c['body'][_0xfba2('0x2a')]){_0x5cb67c=_0x5aaf5c[_0xfba2('0x58')]['status'];return db['SmsMessage']['find']({'where':{'messageId':_0x5aaf5c[_0xfba2('0x58')][_0xfba2('0xca')]}});}break;case _0xfba2('0x87'):if(_0x5aaf5c[_0xfba2('0x58')][_0xfba2('0xcb')]&&_0x5aaf5c[_0xfba2('0x58')][_0xfba2('0xcc')]){_0x5cb67c=_0x5aaf5c[_0xfba2('0x58')][_0xfba2('0xcc')];return db[_0xfba2('0xc5')]['find']({'where':{'messageId':_0x5aaf5c[_0xfba2('0x58')][_0xfba2('0xcb')]}});}break;case _0xfba2('0xcd'):if(_0x5aaf5c[_0xfba2('0x58')][_0xfba2('0x88')]&&_0x5aaf5c['body']['status_code']){_0x5cb67c=_0x5aaf5c[_0xfba2('0x58')]['status_code'];return db[_0xfba2('0xc5')][_0xfba2('0x5e')]({'where':{'messageId':_0x5aaf5c[_0xfba2('0x58')][_0xfba2('0x88')]}});}break;case _0xfba2('0xce'):var _0x488990=_0x5aaf5c['body']['results'][0x0];if(_0x488990[_0xfba2('0x84')]&&_0x488990['status']['groupName']===_0xfba2('0xcf')){_0x5cb67c=_0x488990['status'][_0xfba2('0xd0')];return db[_0xfba2('0xc5')][_0xfba2('0x5e')]({'where':{'messageId':_0x488990[_0xfba2('0x84')]}});}break;case'clickatell':if(_0x5aaf5c[_0xfba2('0x58')][_0xfba2('0x84')]&&_0x5aaf5c[_0xfba2('0x58')]['status']){_0x5cb67c=_0x5aaf5c[_0xfba2('0x58')][_0xfba2('0x2a')];return db[_0xfba2('0xc5')]['find']({'where':{'messageId':_0x5aaf5c[_0xfba2('0x58')][_0xfba2('0x84')]}});}break;case _0xfba2('0xd1'):if(_0x5aaf5c[_0xfba2('0x58')][0x0][_0xfba2('0x26')]['id']){_0x5cb67c=_0x5aaf5c[_0xfba2('0x58')][0x0][_0xfba2('0x3f')];return db[_0xfba2('0xc5')][_0xfba2('0x5e')]({'where':{'messageId':_0x5aaf5c['body'][0x0][_0xfba2('0x26')]['id']}});}break;case _0xfba2('0x92'):if(_0x5aaf5c['body'][_0xfba2('0xd2')]&&_0x5aaf5c[_0xfba2('0x58')][_0xfba2('0x2a')]){_0x5cb67c=_0x5aaf5c[_0xfba2('0x58')][_0xfba2('0x2a')];return db['SmsMessage']['find']({'where':{'messageId':_0x5aaf5c['body'][_0xfba2('0xd2')]}});}break;}}})[_0xfba2('0x1e')](handleEntityNotFound(_0x10c121,null))[_0xfba2('0x1e')](function(_0x4ca73f){if(_0x4ca73f){_0xfc5f01=_0x4ca73f;switch(_0x4b48cb[_0xfba2('0x3f')]){case _0xfba2('0x86'):if(_0x5cb67c===_0xfba2('0xcf')){return _0xfc5f01[_0xfba2('0x34')]({'read':!![]});}else{logger[_0xfba2('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfba2('0x2a'),_0xfba2('0x86'),util[_0xfba2('0xc9')](_0x5aaf5c['body'],{'showHidden':![],'depth':null}));}break;case _0xfba2('0x87'):if(_0x5cb67c==='1'){return _0xfc5f01['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfba2('0x2a'),_0xfba2('0x86'),util['inspect'](_0x5aaf5c[_0xfba2('0x58')],{'showHidden':![],'depth':null}));}break;case _0xfba2('0xcd'):if(!_0x5aaf5c[_0xfba2('0x58')]['error_code']&&_0x5cb67c>=0xc8&&_0x5cb67c<=0xce){return _0xfc5f01[_0xfba2('0x34')]({'read':!![]});}else{logger[_0xfba2('0x24')](_0xfba2('0x22'),_0xfba2('0x2a'),_0xfba2('0xcd'),util[_0xfba2('0xc9')](_0x5aaf5c[_0xfba2('0x58')],{'showHidden':![],'depth':null}));}break;case _0xfba2('0xce'):var _0x4f109a=_0x5aaf5c[_0xfba2('0x58')]['results'][0x0];if(_0x4f109a[_0xfba2('0x2a')][_0xfba2('0xd0')]==='DELIVERED'){return _0xfc5f01[_0xfba2('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfba2('0x2a'),'infobip',util[_0xfba2('0xc9')](_0x5aaf5c['body'],{'showHidden':![],'depth':null}));}break;case _0xfba2('0xd3'):if(_0x5cb67c==_0xfba2('0xd4')||_0x5cb67c=='RECEIVED_BY_RECIPIENT'){return _0xfc5f01[_0xfba2('0x34')]({'read':!![]});}else{logger[_0xfba2('0x24')](_0xfba2('0x22'),_0xfba2('0x2a'),_0xfba2('0xd3'),util[_0xfba2('0xc9')](_0x5aaf5c['body'],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x5cb67c=='message-delivered'){return _0xfc5f01[_0xfba2('0x34')]({'read':!![]});}else{logger[_0xfba2('0x24')](_0xfba2('0x22'),_0xfba2('0x2a'),'bandwidth',util[_0xfba2('0xc9')](_0x5aaf5c[_0xfba2('0x58')],{'showHidden':![],'depth':null}));}break;case _0xfba2('0x92'):if(_0x5cb67c===_0xfba2('0xd5')||_0x5cb67c===_0xfba2('0xd6')){return _0xfc5f01[_0xfba2('0x34')]({'read':!![]});}else{logger[_0xfba2('0x24')](_0xfba2('0x22'),_0xfba2('0x2a'),_0xfba2('0x92'),util['inspect'](_0x5aaf5c[_0xfba2('0x58')],{'showHidden':![],'depth':null}));}break;}return _0xfc5f01;}})[_0xfba2('0x1e')](respondWithResult(_0x10c121,null))[_0xfba2('0x28')](handleError(_0x10c121,null));};exports['statusGet']=function(_0x54ddc4,_0x1254d2,_0x1ac905){var _0x4fba09,_0x4a6c46,_0x472778;return db[_0xfba2('0x3d')][_0xfba2('0x5e')]({'where':{'id':_0x54ddc4[_0xfba2('0x61')]['id']}})[_0xfba2('0x1e')](handleEntityNotFound(_0x1254d2,null))[_0xfba2('0x1e')](function(_0x36aa07){if(_0x36aa07){_0x472778=_0x36aa07;logger[_0xfba2('0x21')](_0xfba2('0x22'),_0xfba2('0x2a'),_0xfba2('0xc8'),_0x36aa07['type'],util['inspect'](_0x54ddc4['query'],{'showHidden':![],'depth':null}));switch(_0x36aa07[_0xfba2('0x3f')]){case _0xfba2('0x8d'):if(_0x54ddc4[_0xfba2('0x41')][_0xfba2('0xd7')]&&_0x54ddc4['query']['state']){_0x4a6c46=_0x54ddc4[_0xfba2('0x41')][_0xfba2('0xd8')];return db[_0xfba2('0xc5')][_0xfba2('0x5e')]({'where':{'messageId':_0x54ddc4[_0xfba2('0x41')][_0xfba2('0xd7')]}});}break;}}})[_0xfba2('0x1e')](handleEntityNotFound(_0x1254d2,null))[_0xfba2('0x1e')](function(_0x29915c){if(_0x29915c){_0x4fba09=_0x29915c;switch(_0x472778[_0xfba2('0x3f')]){case'csc':if(_0x4a6c46==='2'||_0x4a6c46==='6'){return _0x4fba09['update']({'read':!![]});}else{logger['error'](_0xfba2('0x22'),_0xfba2('0x2a'),_0xfba2('0x8d'),util['inspect'](_0x54ddc4[_0xfba2('0x41')],{'showHidden':![],'depth':null}));};break;}return _0x4fba09;}})[_0xfba2('0x1e')](respondWithResult(_0x1254d2,null))[_0xfba2('0x28')](handleError(_0x1254d2,null));};exports['addAgents']=function(_0x3fe2e7,_0x5a2e57,_0x4b6a5a){return db[_0xfba2('0x3d')]['find']({'where':{'id':_0x3fe2e7['params']['id']}})[_0xfba2('0x1e')](handleEntityNotFound(_0x5a2e57,null))['then'](function(_0x50e0d8){if(_0x50e0d8){return _0x50e0d8[_0xfba2('0xd9')](_0x3fe2e7[_0xfba2('0x58')]['ids'],_[_0xfba2('0x9b')](_0x3fe2e7[_0xfba2('0x58')],[_0xfba2('0x68'),'id'])||{})['spread'](function(_0x1a3cd7){for(var _0xa4fd6b=0x0;_0xa4fd6b<_0x3fe2e7[_0xfba2('0x58')][_0xfba2('0x68')][_0xfba2('0x45')];_0xa4fd6b+=0x1){socket[_0xfba2('0xda')]('userSmsAccount:save',{'UserId':Number(_0x3fe2e7[_0xfba2('0x58')]['ids'][_0xa4fd6b]),'SmsAccountId':Number(_0x3fe2e7[_0xfba2('0x61')]['id'])});}return _0x1a3cd7;});}})[_0xfba2('0x1e')](respondWithResult(_0x5a2e57,null))[_0xfba2('0x28')](handleError(_0x5a2e57,null));};exports['removeAgents']=function(_0x17f53c,_0x423f1a,_0x349af8){return db['SmsAccount']['find']({'where':{'id':_0x17f53c[_0xfba2('0x61')]['id']}})[_0xfba2('0x1e')](handleEntityNotFound(_0x423f1a,null))[_0xfba2('0x1e')](function(_0x3d9729){if(_0x3d9729){return _0x3d9729['removeAgents'](_0x17f53c[_0xfba2('0x41')][_0xfba2('0x68')])[_0xfba2('0x1e')](function(){if(_[_0xfba2('0xdb')](_0x17f53c['query'][_0xfba2('0x68')])){for(var _0x34799a=0x0;_0x34799a<_0x17f53c[_0xfba2('0x41')][_0xfba2('0x68')][_0xfba2('0x45')];_0x34799a+=0x1){socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x17f53c['query'][_0xfba2('0x68')][_0x34799a]),'SmsAccountId':Number(_0x17f53c['params']['id'])});}}else{socket[_0xfba2('0xda')](_0xfba2('0xdc'),{'UserId':Number(_0x17f53c[_0xfba2('0x41')][_0xfba2('0x68')]),'SmsAccountId':Number(_0x17f53c[_0xfba2('0x61')]['id'])});}});}})[_0xfba2('0x1e')](respondWithStatusCode(_0x423f1a,null))[_0xfba2('0x28')](handleError(_0x423f1a,null));};exports[_0xfba2('0xdd')]=function(_0x5e83ea,_0x190883,_0x4b42a8){var _0x165208={};var _0x2d85b0={};var _0x1b6fb4;var _0x4f3e9f;return db[_0xfba2('0x3d')][_0xfba2('0x6c')]({'where':{'id':_0x5e83ea[_0xfba2('0x61')]['id']}})[_0xfba2('0x1e')](handleEntityNotFound(_0x190883,null))[_0xfba2('0x1e')](function(_0x24536c){if(_0x24536c){_0x1b6fb4=_0x24536c;_0x2d85b0[_0xfba2('0x40')]=_[_0xfba2('0x54')](db['User']['rawAttributes']);_0x2d85b0[_0xfba2('0x41')]=_[_0xfba2('0x54')](_0x5e83ea['query']);_0x2d85b0[_0xfba2('0x42')]=_[_0xfba2('0x43')](_0x2d85b0[_0xfba2('0x40')],_0x2d85b0['query']);_0x165208[_0xfba2('0x44')]=_[_0xfba2('0x43')](_0x2d85b0[_0xfba2('0x40')],qs[_0xfba2('0x56')](_0x5e83ea[_0xfba2('0x41')][_0xfba2('0x56')]));_0x165208[_0xfba2('0x44')]=_0x165208[_0xfba2('0x44')]['length']?_0x165208[_0xfba2('0x44')]:_0x2d85b0[_0xfba2('0x40')];_0x165208[_0xfba2('0x47')]=qs[_0xfba2('0x48')](_0x5e83ea['query']['sort']);_0x165208['where']=qs[_0xfba2('0x42')](_[_0xfba2('0x4a')](_0x5e83ea[_0xfba2('0x41')],_0x2d85b0['filters']));if(_0x5e83ea[_0xfba2('0x41')][_0xfba2('0x4d')]){_0x165208[_0xfba2('0x49')]=_[_0xfba2('0x4b')](_0x165208[_0xfba2('0x49')],{'$or':_[_0xfba2('0x3c')](_0x165208[_0xfba2('0x44')],function(_0x502c89){var _0x16712c={};_0x16712c[_0x502c89]={'$like':'%'+_0x5e83ea[_0xfba2('0x41')][_0xfba2('0x4d')]+'%'};return _0x16712c;})});}_0x165208=_[_0xfba2('0x4b')]({},_0x165208,_0x5e83ea[_0xfba2('0x4e')]);return _0x1b6fb4[_0xfba2('0xdd')](_0x165208);}})[_0xfba2('0x1e')](function(_0x387aca){if(_0x387aca){_0x4f3e9f=_0x387aca[_0xfba2('0x45')];if(!_0x5e83ea['query'][_0xfba2('0x46')]('nolimit')){_0x165208[_0xfba2('0x2e')]=qs[_0xfba2('0x2e')](_0x5e83ea[_0xfba2('0x41')][_0xfba2('0x2e')]);_0x165208['offset']=qs[_0xfba2('0x2d')](_0x5e83ea[_0xfba2('0x41')][_0xfba2('0x2d')]);}return _0x1b6fb4[_0xfba2('0xdd')](_0x165208);}})[_0xfba2('0x1e')](function(_0x2b454a){if(_0x2b454a){return _0x2b454a?{'count':_0x4f3e9f,'rows':_0x2b454a}:null;}})[_0xfba2('0x1e')](respondWithResult(_0x190883,null))[_0xfba2('0x28')](handleError(_0x190883,null));}; \ No newline at end of file +var _0x7af9=['isNil','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','CmList','ListId','updatedAt','DESC','list','omit','Contacts','SmsInteraction','interaction','push','close','unmanaged','*,*,*,*','created','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','Start','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','destroy','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','internal','Tags','color','tag','to\x20is\x20mandatory','List','Messages','spread','dataValues','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','connectel','requestid','statusInt','status_code','groupName','redif','DELIVERED','error_code','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsAccount.socket','register','request','then','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','SmsAccount,\x20%s,\x20%s','message','info','request\x20sent','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','get','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','getDispositions','findOne','nolimit','pick','removeDispositions','ids','addAnswer','SmsAccountId','getAnswers','CannedAnswer','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','difference','CompanyId','mobile','twilio','from','From','Body','MessageSid','sender','text','clicksend','messageId','message_id','plivo','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','bandwidth','intelepeer','refid'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7af9,0x140));var _0x97af=function(_0x2a0245,_0x53eedb){_0x2a0245=_0x2a0245-0x0;var _0x55e063=_0x7af9[_0x2a0245];return _0x55e063;};'use strict';var emlformat=require(_0x97af('0x0'));var rimraf=require(_0x97af('0x1'));var zipdir=require(_0x97af('0x2'));var jsonpatch=require(_0x97af('0x3'));var rp=require(_0x97af('0x4'));var moment=require(_0x97af('0x5'));var BPromise=require(_0x97af('0x6'));var Mustache=require('mustache');var util=require(_0x97af('0x7'));var path=require(_0x97af('0x8'));var sox=require(_0x97af('0x9'));var csv=require(_0x97af('0xa'));var ejs=require(_0x97af('0xb'));var fs=require('fs');var fs_extra=require(_0x97af('0xc'));var _=require(_0x97af('0xd'));var squel=require(_0x97af('0xe'));var crypto=require('crypto');var jsforce=require(_0x97af('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x97af('0xa'));var querystring=require('querystring');var Papa=require(_0x97af('0x10'));var Redis=require(_0x97af('0x11'));var authService=require(_0x97af('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x97af('0x13'));var hardwareService=require(_0x97af('0x14'));var logger=require(_0x97af('0x15'))(_0x97af('0x16'));var utils=require(_0x97af('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x97af('0x18'));var db=require(_0x97af('0x19'))['db'];config[_0x97af('0x1a')]=_[_0x97af('0x1b')](config[_0x97af('0x1a')],{'host':_0x97af('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x97af('0x1a')]));require(_0x97af('0x1d'))[_0x97af('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x5ea6fc,_0x16ad54,_0x457cf3,_0x592873){return new BPromise(function(_0x54f558,_0x1ebd41){var _0x2b575a=_0x592873||client;return _0x2b575a[_0x97af('0x1f')](_0x5ea6fc,_0x457cf3)[_0x97af('0x20')](function(_0x5b7551){logger['info']('SmsAccount,\x20%s,\x20%s',_0x16ad54,'request\x20sent');logger[_0x97af('0x21')](_0x97af('0x22'),_0x16ad54,'request\x20sent',JSON[_0x97af('0x23')](_0x5b7551));if(_0x5b7551['error']){if(_0x5b7551['error'][_0x97af('0x24')]===0x1f4){logger[_0x97af('0x25')](_0x97af('0x26'),_0x16ad54,_0x5b7551['error']['message']);return _0x1ebd41(_0x5b7551['error'][_0x97af('0x27')]);}logger['error'](_0x97af('0x26'),_0x16ad54,_0x5b7551['error'][_0x97af('0x27')]);return _0x54f558(_0x5b7551[_0x97af('0x25')]['message']);}else{logger[_0x97af('0x28')](_0x97af('0x26'),_0x16ad54,_0x97af('0x29'));_0x54f558(_0x5b7551[_0x97af('0x2a')][_0x97af('0x27')]);}})[_0x97af('0x2b')](function(_0x222612){logger[_0x97af('0x25')]('SmsAccount,\x20%s,\x20%s',_0x16ad54,_0x222612);_0x1ebd41(_0x222612);});});}function respondWithStatusCode(_0x37d57b,_0x28819f){_0x28819f=_0x28819f||0xcc;return function(_0x943cb0){if(_0x943cb0){return _0x37d57b[_0x97af('0x2c')](_0x28819f);}return _0x37d57b['status'](_0x28819f)[_0x97af('0x2d')]();};}function respondWithResult(_0x2cc307,_0x1fa0d6){_0x1fa0d6=_0x1fa0d6||0xc8;return function(_0x4e4c44){if(_0x4e4c44){return _0x2cc307[_0x97af('0x2e')](_0x1fa0d6)[_0x97af('0x2f')](_0x4e4c44);}};}function respondWithFilteredResult(_0x5f0b5f,_0x5c6cb3){return function(_0x3f43d2){if(_0x3f43d2){var _0x4d686b=typeof _0x5c6cb3[_0x97af('0x30')]===_0x97af('0x31')&&typeof _0x5c6cb3[_0x97af('0x32')]===_0x97af('0x31');var _0x1bb2eb=_0x3f43d2['count'];var _0x853c20=_0x4d686b?0x0:_0x5c6cb3[_0x97af('0x30')];var _0x390fcd=_0x4d686b?_0x3f43d2[_0x97af('0x33')]:_0x5c6cb3['offset']+_0x5c6cb3[_0x97af('0x32')];var _0x1d2716;if(_0x390fcd>=_0x1bb2eb){_0x390fcd=_0x1bb2eb;_0x1d2716=0xc8;}else{_0x1d2716=0xce;}_0x5f0b5f[_0x97af('0x2e')](_0x1d2716);return _0x5f0b5f[_0x97af('0x34')](_0x97af('0x35'),_0x853c20+'-'+_0x390fcd+'/'+_0x1bb2eb)['json'](_0x3f43d2);}return null;};}function patchUpdates(_0x5b3880){return function(_0x34e97e){try{jsonpatch[_0x97af('0x36')](_0x34e97e,_0x5b3880,!![]);}catch(_0x25ba69){return BPromise['reject'](_0x25ba69);}return _0x34e97e[_0x97af('0x37')]();};}function saveUpdates(_0xc71e03,_0x33576){return function(_0x1f36c2){if(_0x1f36c2){return _0x1f36c2[_0x97af('0x38')](_0xc71e03)[_0x97af('0x20')](function(_0x2f6a80){return _0x2f6a80;});}return null;};}function removeEntity(_0x171b58,_0x3a4246){return function(_0x2a5e64){if(_0x2a5e64){return _0x2a5e64['destroy']()[_0x97af('0x20')](function(){var _0x350253=_0x2a5e64[_0x97af('0x39')]({'plain':!![]});var _0x145ab=_0x97af('0x3a');return db[_0x97af('0x3b')]['destroy']({'where':{'type':_0x145ab,'resourceId':_0x350253['id']}})['then'](function(){return _0x2a5e64;});})['then'](function(){_0x171b58[_0x97af('0x2e')](0xcc)[_0x97af('0x2d')]();});}};}function handleEntityNotFound(_0x39ab20,_0x179f35){return function(_0x1233cc){if(!_0x1233cc){_0x39ab20[_0x97af('0x2c')](0x194);}return _0x1233cc;};}function handleError(_0x1710d5,_0x38ce17){_0x38ce17=_0x38ce17||0x1f4;return function(_0x47464d){logger['error'](_0x47464d[_0x97af('0x3c')]);if(_0x47464d[_0x97af('0x3d')]){delete _0x47464d[_0x97af('0x3d')];}_0x1710d5[_0x97af('0x2e')](_0x38ce17)[_0x97af('0x3e')](_0x47464d);};}exports[_0x97af('0x3f')]=function(_0x33d091,_0x347586){var _0x48136e={'include':[{'model':db[_0x97af('0x40')],'as':_0x97af('0x41')}]},_0x474b17={},_0x2f36bf={'count':0x0,'rows':[]};var _0x339a4b=_[_0x97af('0x42')](db[_0x97af('0x43')]['rawAttributes'],function(_0x3ff6bd){return{'name':_0x3ff6bd[_0x97af('0x44')],'type':_0x3ff6bd[_0x97af('0x45')][_0x97af('0x46')]};});_0x474b17[_0x97af('0x47')]=_[_0x97af('0x42')](_0x339a4b,_0x97af('0x3d'));_0x474b17[_0x97af('0x48')]=_[_0x97af('0x49')](_0x33d091[_0x97af('0x48')]);_0x474b17[_0x97af('0x4a')]=_[_0x97af('0x4b')](_0x474b17[_0x97af('0x47')],_0x474b17['query']);_0x48136e[_0x97af('0x4c')]=_[_0x97af('0x4b')](_0x474b17[_0x97af('0x47')],qs[_0x97af('0x4d')](_0x33d091[_0x97af('0x48')]['fields']));_0x48136e['attributes']=_0x48136e[_0x97af('0x4c')][_0x97af('0x4e')]?_0x48136e[_0x97af('0x4c')]:_0x474b17[_0x97af('0x47')];if(!_0x33d091[_0x97af('0x48')][_0x97af('0x4f')]('nolimit')){_0x48136e[_0x97af('0x32')]=qs[_0x97af('0x32')](_0x33d091['query'][_0x97af('0x32')]);_0x48136e[_0x97af('0x30')]=qs[_0x97af('0x30')](_0x33d091[_0x97af('0x48')][_0x97af('0x30')]);}_0x48136e[_0x97af('0x50')]=qs[_0x97af('0x51')](_0x33d091[_0x97af('0x48')][_0x97af('0x51')]);_0x48136e[_0x97af('0x52')]=qs['filters'](_['pick'](_0x33d091[_0x97af('0x48')],_0x474b17['filters']),_0x339a4b);if(_0x33d091[_0x97af('0x48')][_0x97af('0x53')]){_0x48136e[_0x97af('0x52')]=_[_0x97af('0x54')](_0x48136e[_0x97af('0x52')],{'$or':_[_0x97af('0x42')](_0x339a4b,function(_0x1db0c9){if(_0x1db0c9[_0x97af('0x45')]!==_0x97af('0x55')){var _0x3b615d={};_0x3b615d[_0x1db0c9['name']]={'$like':'%'+_0x33d091[_0x97af('0x48')][_0x97af('0x53')]+'%'};return _0x3b615d;}})});}_0x48136e=_[_0x97af('0x54')]({},_0x48136e,_0x33d091[_0x97af('0x56')]);var _0x321fa8={'where':_0x48136e['where']};return db[_0x97af('0x43')][_0x97af('0x33')](_0x321fa8)[_0x97af('0x20')](function(_0x4f1d71){_0x2f36bf['count']=_0x4f1d71;if(_0x33d091[_0x97af('0x48')][_0x97af('0x57')]){_0x48136e[_0x97af('0x58')]=[{'all':!![]}];}return db[_0x97af('0x43')][_0x97af('0x59')](_0x48136e);})[_0x97af('0x20')](function(_0x3240a8){_0x2f36bf[_0x97af('0x5a')]=_0x3240a8;return _0x2f36bf;})[_0x97af('0x20')](respondWithFilteredResult(_0x347586,_0x48136e))[_0x97af('0x2b')](handleError(_0x347586,null));};exports[_0x97af('0x5b')]=function(_0xdc05b1,_0x4b9f8f){var _0xfb2da7={'raw':![],'where':{'id':_0xdc05b1['params']['id']},'include':[{'model':db[_0x97af('0x40')],'as':_0x97af('0x41')}]},_0x5605dc={};_0x5605dc[_0x97af('0x47')]=_['keys'](db[_0x97af('0x43')][_0x97af('0x5c')]);_0x5605dc[_0x97af('0x48')]=_[_0x97af('0x49')](_0xdc05b1[_0x97af('0x48')]);_0x5605dc[_0x97af('0x4a')]=_[_0x97af('0x4b')](_0x5605dc[_0x97af('0x47')],_0x5605dc[_0x97af('0x48')]);_0xfb2da7[_0x97af('0x4c')]=_[_0x97af('0x4b')](_0x5605dc[_0x97af('0x47')],qs[_0x97af('0x4d')](_0xdc05b1['query'][_0x97af('0x4d')]));_0xfb2da7[_0x97af('0x4c')]=_0xfb2da7[_0x97af('0x4c')][_0x97af('0x4e')]?_0xfb2da7[_0x97af('0x4c')]:_0x5605dc['model'];if(_0xdc05b1[_0x97af('0x48')][_0x97af('0x57')]){_0xfb2da7[_0x97af('0x58')]=[{'all':!![]}];}_0xfb2da7=_[_0x97af('0x54')]({},_0xfb2da7,_0xdc05b1[_0x97af('0x56')]);return db['SmsAccount'][_0x97af('0x5d')](_0xfb2da7)['then'](handleEntityNotFound(_0x4b9f8f,null))['then'](respondWithResult(_0x4b9f8f,null))['catch'](handleError(_0x4b9f8f,null));};exports[_0x97af('0x5e')]=function(_0x39e868,_0x810911){return db[_0x97af('0x43')][_0x97af('0x5e')](_0x39e868[_0x97af('0x5f')],{})[_0x97af('0x20')](function(_0x8f6438){var _0x3952d5=_0x39e868[_0x97af('0x60')]['get']({'plain':!![]});if(!_0x3952d5)throw new Error(_0x97af('0x61'));if(_0x3952d5[_0x97af('0x62')]===_0x97af('0x60')){var _0x1ce6d1=_0x8f6438[_0x97af('0x39')]({'plain':!![]});var _0x565eae=_0x97af('0x3a');return db[_0x97af('0x63')][_0x97af('0x5d')]({'where':{'name':_0x565eae,'userProfileId':_0x3952d5[_0x97af('0x64')]},'raw':!![]})[_0x97af('0x20')](function(_0x3352de){if(_0x3352de&&_0x3352de['autoAssociation']===0x0){return db[_0x97af('0x3b')][_0x97af('0x5e')]({'name':_0x1ce6d1[_0x97af('0x3d')],'resourceId':_0x1ce6d1['id'],'type':_0x3352de[_0x97af('0x3d')],'sectionId':_0x3352de['id']},{})[_0x97af('0x20')](function(){return _0x8f6438;});}else{return _0x8f6438;}})['catch'](function(_0x18ea12){logger[_0x97af('0x25')](_0x97af('0x65'),_0x18ea12);throw _0x18ea12;});}return _0x8f6438;})[_0x97af('0x20')](respondWithResult(_0x810911,0xc9))[_0x97af('0x2b')](handleError(_0x810911,null));};exports[_0x97af('0x38')]=function(_0x39a34a,_0x3e42ee){if(_0x39a34a[_0x97af('0x5f')]['id']){delete _0x39a34a[_0x97af('0x5f')]['id'];}return db[_0x97af('0x43')][_0x97af('0x5d')]({'where':{'id':_0x39a34a[_0x97af('0x66')]['id']},'include':[{'model':db[_0x97af('0x40')],'as':_0x97af('0x41')}]})[_0x97af('0x20')](handleEntityNotFound(_0x3e42ee,null))['then'](saveUpdates(_0x39a34a[_0x97af('0x5f')],null))[_0x97af('0x20')](respondWithResult(_0x3e42ee,null))[_0x97af('0x2b')](handleError(_0x3e42ee,null));};exports['destroy']=function(_0x5742d5,_0x509a42){return db['SmsAccount'][_0x97af('0x5d')]({'where':{'id':_0x5742d5[_0x97af('0x66')]['id']}})[_0x97af('0x20')](handleEntityNotFound(_0x509a42,null))['then'](removeEntity(_0x509a42,null))['catch'](handleError(_0x509a42,null));};exports[_0x97af('0x67')]=function(_0x28713e,_0x979cf2){return db[_0x97af('0x43')][_0x97af('0x67')]()['then'](respondWithResult(_0x979cf2,null))['catch'](handleError(_0x979cf2,null));};exports[_0x97af('0x68')]=function(_0x5724e5,_0x57cb37,_0x2187b6){if(_0x5724e5[_0x97af('0x5f')]['id']){delete _0x5724e5['body']['id'];}return db[_0x97af('0x43')][_0x97af('0x5d')]({'where':{'id':_0x5724e5['params']['id']}})[_0x97af('0x20')](handleEntityNotFound(_0x57cb37,null))[_0x97af('0x20')](function(_0x281015){if(_0x281015){_0x5724e5[_0x97af('0x5f')]['SmsAccountId']=_0x281015['id'];return db[_0x97af('0x69')]['create'](_0x5724e5[_0x97af('0x5f')]);}})[_0x97af('0x20')](respondWithResult(_0x57cb37,null))[_0x97af('0x2b')](handleError(_0x57cb37,null));};exports[_0x97af('0x6a')]=function(_0x5c5341,_0x1bb44d,_0x1485cb){var _0x551ff1={'raw':![],'where':{}};var _0x188841={};var _0x4fe040={'count':0x0,'rows':[]};return db[_0x97af('0x43')][_0x97af('0x6b')]({'where':{'id':_0x5c5341[_0x97af('0x66')]['id']}})[_0x97af('0x20')](handleEntityNotFound(_0x1bb44d,null))[_0x97af('0x20')](function(_0x4f5b52){if(_0x4f5b52){_0x188841[_0x97af('0x47')]=_[_0x97af('0x49')](db[_0x97af('0x69')]['rawAttributes']);_0x188841[_0x97af('0x48')]=_['keys'](_0x5c5341['query']);_0x188841['filters']=_['intersection'](_0x188841[_0x97af('0x47')],_0x188841[_0x97af('0x48')]);_0x551ff1[_0x97af('0x4c')]=_[_0x97af('0x4b')](_0x188841[_0x97af('0x47')],qs[_0x97af('0x4d')](_0x5c5341['query'][_0x97af('0x4d')]));_0x551ff1['attributes']=_0x551ff1[_0x97af('0x4c')][_0x97af('0x4e')]?_0x551ff1[_0x97af('0x4c')]:_0x188841[_0x97af('0x47')];if(!_0x5c5341[_0x97af('0x48')]['hasOwnProperty'](_0x97af('0x6c'))){_0x551ff1[_0x97af('0x32')]=qs[_0x97af('0x32')](_0x5c5341['query']['limit']);_0x551ff1[_0x97af('0x30')]=qs[_0x97af('0x30')](_0x5c5341[_0x97af('0x48')][_0x97af('0x30')]);}_0x551ff1[_0x97af('0x50')]=qs['sort'](_0x5c5341[_0x97af('0x48')][_0x97af('0x51')]);_0x551ff1[_0x97af('0x52')]=qs[_0x97af('0x4a')](_[_0x97af('0x6d')](_0x5c5341[_0x97af('0x48')],_0x188841[_0x97af('0x4a')]));_0x551ff1[_0x97af('0x52')]['SmsAccountId']=_0x4f5b52['id'];if(_0x5c5341[_0x97af('0x48')][_0x97af('0x53')]){_0x551ff1[_0x97af('0x52')]=_[_0x97af('0x54')](_0x551ff1[_0x97af('0x52')],{'$or':_[_0x97af('0x42')](_0x551ff1[_0x97af('0x4c')],function(_0x53a10a){var _0x3a39a3={};_0x3a39a3[_0x53a10a]={'$like':'%'+_0x5c5341[_0x97af('0x48')][_0x97af('0x53')]+'%'};return _0x3a39a3;})});}_0x551ff1=_[_0x97af('0x54')]({},_0x551ff1,_0x5c5341[_0x97af('0x56')]);return db[_0x97af('0x69')][_0x97af('0x33')]({'where':_0x551ff1[_0x97af('0x52')]})[_0x97af('0x20')](function(_0xa3f500){_0x4fe040[_0x97af('0x33')]=_0xa3f500;if(_0x5c5341[_0x97af('0x48')][_0x97af('0x57')]){_0x551ff1[_0x97af('0x58')]=[{'all':!![]}];}return db[_0x97af('0x69')]['findAll'](_0x551ff1);})[_0x97af('0x20')](function(_0x24a738){_0x4fe040[_0x97af('0x5a')]=_0x24a738;return _0x4fe040;});}})[_0x97af('0x20')](respondWithFilteredResult(_0x1bb44d,_0x551ff1))[_0x97af('0x2b')](handleError(_0x1bb44d,null));};exports[_0x97af('0x6e')]=function(_0x4676e1,_0x2712c0,_0x463902){return db[_0x97af('0x43')][_0x97af('0x5d')]({'where':{'id':_0x4676e1['params']['id']}})['then'](handleEntityNotFound(_0x2712c0,null))[_0x97af('0x20')](function(_0x4bee95){if(_0x4bee95){return _0x4bee95[_0x97af('0x6e')](_0x4676e1[_0x97af('0x48')][_0x97af('0x6f')]);}})[_0x97af('0x20')](respondWithStatusCode(_0x2712c0,null))[_0x97af('0x2b')](handleError(_0x2712c0,null));};exports[_0x97af('0x70')]=function(_0x367ca3,_0x30a97d,_0x3a271c){if(_0x367ca3[_0x97af('0x5f')]['id']){delete _0x367ca3[_0x97af('0x5f')]['id'];}return db[_0x97af('0x43')][_0x97af('0x5d')]({'where':{'id':_0x367ca3[_0x97af('0x66')]['id']}})[_0x97af('0x20')](handleEntityNotFound(_0x30a97d,null))[_0x97af('0x20')](function(_0x5a2cea){if(_0x5a2cea){_0x367ca3[_0x97af('0x5f')][_0x97af('0x71')]=_0x5a2cea['id'];return db['CannedAnswer'][_0x97af('0x5e')](_0x367ca3[_0x97af('0x5f')]);}})[_0x97af('0x20')](respondWithResult(_0x30a97d,null))[_0x97af('0x2b')](handleError(_0x30a97d,null));};exports[_0x97af('0x72')]=function(_0x1f6d1d,_0x1efa0e,_0x3ae2b4){var _0x1b5601={'raw':![],'where':{}};var _0x55b2cc={};var _0xe210d5={'count':0x0,'rows':[]};return db[_0x97af('0x43')][_0x97af('0x6b')]({'where':{'id':_0x1f6d1d[_0x97af('0x66')]['id']}})[_0x97af('0x20')](handleEntityNotFound(_0x1efa0e,null))[_0x97af('0x20')](function(_0x49755a){if(_0x49755a){_0x55b2cc[_0x97af('0x47')]=_['keys'](db[_0x97af('0x73')][_0x97af('0x5c')]);_0x55b2cc[_0x97af('0x48')]=_['keys'](_0x1f6d1d[_0x97af('0x48')]);_0x55b2cc[_0x97af('0x4a')]=_[_0x97af('0x4b')](_0x55b2cc[_0x97af('0x47')],_0x55b2cc[_0x97af('0x48')]);_0x1b5601[_0x97af('0x4c')]=_['intersection'](_0x55b2cc['model'],qs[_0x97af('0x4d')](_0x1f6d1d[_0x97af('0x48')][_0x97af('0x4d')]));_0x1b5601['attributes']=_0x1b5601[_0x97af('0x4c')][_0x97af('0x4e')]?_0x1b5601[_0x97af('0x4c')]:_0x55b2cc['model'];if(!_0x1f6d1d[_0x97af('0x48')][_0x97af('0x4f')](_0x97af('0x6c'))){_0x1b5601[_0x97af('0x32')]=qs['limit'](_0x1f6d1d['query'][_0x97af('0x32')]);_0x1b5601[_0x97af('0x30')]=qs[_0x97af('0x30')](_0x1f6d1d[_0x97af('0x48')][_0x97af('0x30')]);}_0x1b5601[_0x97af('0x50')]=qs[_0x97af('0x51')](_0x1f6d1d[_0x97af('0x48')][_0x97af('0x51')]);_0x1b5601[_0x97af('0x52')]=qs[_0x97af('0x4a')](_[_0x97af('0x6d')](_0x1f6d1d[_0x97af('0x48')],_0x55b2cc[_0x97af('0x4a')]));_0x1b5601[_0x97af('0x52')][_0x97af('0x71')]=_0x49755a['id'];if(_0x1f6d1d['query'][_0x97af('0x53')]){_0x1b5601['where']=_['merge'](_0x1b5601[_0x97af('0x52')],{'$or':_[_0x97af('0x42')](_0x1b5601[_0x97af('0x4c')],function(_0x5013bc){var _0x3c9ca1={};_0x3c9ca1[_0x5013bc]={'$like':'%'+_0x1f6d1d['query'][_0x97af('0x53')]+'%'};return _0x3c9ca1;})});}_0x1b5601=_[_0x97af('0x54')]({},_0x1b5601,_0x1f6d1d[_0x97af('0x56')]);return db[_0x97af('0x73')][_0x97af('0x33')]({'where':_0x1b5601['where']})[_0x97af('0x20')](function(_0x317734){_0xe210d5[_0x97af('0x33')]=_0x317734;if(_0x1f6d1d[_0x97af('0x48')][_0x97af('0x57')]){_0x1b5601[_0x97af('0x58')]=[{'all':!![]}];}return db['CannedAnswer'][_0x97af('0x59')](_0x1b5601);})[_0x97af('0x20')](function(_0x2778e3){_0xe210d5[_0x97af('0x5a')]=_0x2778e3;return _0xe210d5;});}})[_0x97af('0x20')](respondWithFilteredResult(_0x1efa0e,_0x1b5601))[_0x97af('0x2b')](handleError(_0x1efa0e,null));};exports[_0x97af('0x74')]=function(_0x2f57a8,_0x47ba17,_0x4d900d){return db[_0x97af('0x43')][_0x97af('0x5d')]({'where':{'id':_0x2f57a8['params']['id']}})[_0x97af('0x20')](handleEntityNotFound(_0x47ba17,null))[_0x97af('0x20')](function(_0x22c4ee){if(_0x22c4ee){return _0x22c4ee[_0x97af('0x74')](_0x2f57a8[_0x97af('0x48')]['ids']);}})[_0x97af('0x20')](respondWithStatusCode(_0x47ba17,null))['catch'](handleError(_0x47ba17,null));};exports[_0x97af('0x75')]=function(_0x2ffc17,_0x2a6356,_0x73fe64){var _0x5172af={'channel':_0x97af('0x76')};var _0x3cac23=[];var _0x57fceb=[];var _0x599532={};return db[_0x97af('0x43')]['find']({'where':{'id':_0x2ffc17[_0x97af('0x66')]['id']},'include':[{'model':db[_0x97af('0x77')],'as':_0x97af('0x78')}]})[_0x97af('0x20')](handleEntityNotFound(_0x2a6356,null))[_0x97af('0x20')](function(_0x27b920){_0x5172af[_0x97af('0x79')]=_0x27b920;_0x5172af[_0x97af('0x7a')]=_[_0x97af('0x7b')](_0x27b920[_0x97af('0x78')],[_0x97af('0x7c')],[_0x97af('0x7d')]);if(_0x5172af['account'][_0x97af('0x78')]){delete _0x5172af[_0x97af('0x79')]['Applications'];}return db[_0x97af('0x7e')]['describe']();})[_0x97af('0x20')](function(_0x5c0414){if(!_0x5c0414){throw new db[(_0x97af('0x7f'))][(_0x97af('0x80'))](_0x97af('0x81'));}_0x3cac23=_['difference'](_[_0x97af('0x49')](_0x5c0414),[_0x97af('0x82'),'updatedAt']);_0x57fceb=_[_0x97af('0x83')](_[_0x97af('0x49')](_0x5c0414),['createdAt','updatedAt',_0x97af('0x84'),'ListId']);_0x5172af[_0x97af('0x5f')]={'mapKey':_0x97af('0x85')};if(_0x5172af[_0x97af('0x79')][_0x97af('0x45')]){switch(_0x5172af[_0x97af('0x79')]['type']){case _0x97af('0x86'):_0x5172af['body'][_0x97af('0x87')]=_0x2ffc17[_0x97af('0x5f')][_0x97af('0x88')];_0x5172af[_0x97af('0x5f')][_0x97af('0x5f')]=_0x2ffc17[_0x97af('0x5f')][_0x97af('0x89')];_0x5172af[_0x97af('0x5f')]['messageId']=_0x2ffc17[_0x97af('0x5f')][_0x97af('0x8a')];break;case'skebby':_0x5172af[_0x97af('0x5f')][_0x97af('0x87')]='+'+_0x2ffc17[_0x97af('0x5f')][_0x97af('0x8b')];_0x5172af[_0x97af('0x5f')][_0x97af('0x5f')]=_0x2ffc17['body'][_0x97af('0x8c')];break;case'connectel':_0x5172af['body'][_0x97af('0x87')]=_0x2ffc17[_0x97af('0x5f')][_0x97af('0x87')];_0x5172af[_0x97af('0x5f')][_0x97af('0x5f')]=_0x2ffc17['body'][_0x97af('0x27')];break;case _0x97af('0x8d'):_0x5172af[_0x97af('0x5f')][_0x97af('0x87')]=_0x2ffc17[_0x97af('0x5f')]['from'];_0x5172af[_0x97af('0x5f')][_0x97af('0x5f')]=_0x2ffc17['body']['body'];_0x5172af[_0x97af('0x5f')][_0x97af('0x8e')]=_0x2ffc17[_0x97af('0x5f')][_0x97af('0x8f')];break;case _0x97af('0x90'):_0x5172af[_0x97af('0x5f')][_0x97af('0x87')]=_0x2ffc17[_0x97af('0x5f')]['From'];_0x5172af[_0x97af('0x5f')][_0x97af('0x5f')]=_0x2ffc17[_0x97af('0x5f')]['Text'];_0x5172af[_0x97af('0x5f')]['messageId']=_0x2ffc17[_0x97af('0x5f')][_0x97af('0x91')];break;case _0x97af('0x92'):_0x5172af[_0x97af('0x5f')][_0x97af('0x87')]='+'+_0x2ffc17[_0x97af('0x5f')][_0x97af('0x93')][0x0][_0x97af('0x87')];_0x5172af[_0x97af('0x5f')][_0x97af('0x5f')]=_0x2ffc17[_0x97af('0x5f')][_0x97af('0x93')][0x0][_0x97af('0x8c')];_0x5172af[_0x97af('0x5f')][_0x97af('0x8e')]=_0x2ffc17[_0x97af('0x5f')]['results'][0x0][_0x97af('0x8e')];break;case _0x97af('0x94'):_0x5172af[_0x97af('0x5f')]['from']=_0x2ffc17[_0x97af('0x5f')][_0x97af('0x95')];_0x5172af[_0x97af('0x5f')][_0x97af('0x5f')]=_0x2ffc17[_0x97af('0x5f')][_0x97af('0x96')][_0x97af('0x27')];break;case _0x97af('0x97'):_0x5172af[_0x97af('0x5f')]['from']=_0x2ffc17[_0x97af('0x5f')][_0x97af('0x98')];_0x5172af[_0x97af('0x5f')]['body']=_0x2ffc17[_0x97af('0x5f')]['text'];_0x5172af[_0x97af('0x5f')][_0x97af('0x8e')]=_0x2ffc17[_0x97af('0x5f')]['replyMessageId'];break;case _0x97af('0x99'):_0x5172af[_0x97af('0x5f')][_0x97af('0x8e')]=_0x2ffc17[_0x97af('0x5f')][0x0]['message']['id'];_0x5172af[_0x97af('0x5f')][_0x97af('0x87')]=_0x2ffc17[_0x97af('0x5f')][0x0][_0x97af('0x27')][_0x97af('0x87')];_0x5172af[_0x97af('0x5f')]['body']=_0x2ffc17[_0x97af('0x5f')][0x0][_0x97af('0x27')][_0x97af('0x8c')];break;case _0x97af('0x9a'):_0x5172af[_0x97af('0x5f')][_0x97af('0x87')]=_0x2ffc17[_0x97af('0x5f')]['from'];_0x5172af['body']['body']=_0x2ffc17[_0x97af('0x5f')][_0x97af('0x27')];_0x5172af[_0x97af('0x5f')][_0x97af('0x8e')]=_0x2ffc17['body'][_0x97af('0x9b')];break;}}if(_0x5172af[_0x97af('0x5f')]['id']){delete _0x5172af[_0x97af('0x5f')]['id'];}if(_[_0x97af('0x9c')](_0x5172af[_0x97af('0x5f')][_0x97af('0x87')])){throw new db[(_0x97af('0x7f'))][(_0x97af('0x80'))](_0x97af('0x9d'));}if(_[_0x97af('0x9c')](_0x5172af[_0x97af('0x5f')]['body'])||_0x5172af[_0x97af('0x5f')]['body']===''){throw new db['Sequelize'][(_0x97af('0x80'))](_0x97af('0x9e'));}if(_[_0x97af('0x9c')](_0x5172af[_0x97af('0x5f')][_0x97af('0x9f')])){throw new db[(_0x97af('0x7f'))]['ValidationError'](_0x97af('0xa0')+_0x57fceb);}if(!_['includes'](_0x57fceb,_0x5172af[_0x97af('0x5f')][_0x97af('0x9f')])){throw new db[(_0x97af('0x7f'))][(_0x97af('0x80'))](_0x97af('0xa1')+_0x57fceb);}_0x599532[_0x5172af[_0x97af('0x5f')]['mapKey']]=_0x5172af[_0x97af('0x5f')][_0x97af('0x87')];return db[_0x97af('0xa2')][_0x97af('0x5d')]({'where':{'id':_0x5172af[_0x97af('0x79')][_0x97af('0xa3')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x599532,'limit':0x1,'order':[[_0x97af('0xa4'),_0x97af('0xa5')]]}]});})[_0x97af('0x20')](handleEntityNotFound(_0x2a6356,null))[_0x97af('0x20')](function(_0x9b4e51){if(_0x9b4e51){_0x5172af[_0x97af('0xa6')]=_[_0x97af('0xa7')](_0x9b4e51,[_0x97af('0xa8')]);if(_0x9b4e51[_0x97af('0xa8')]['length']){return _0x9b4e51[_0x97af('0xa8')][0x0];}var _0x1d1409=_['defaults'](_0x5172af[_0x97af('0x5f')],{'firstName':_0x5172af['body'][_0x97af('0x87')],'ListId':_0x9b4e51['id']});_0x1d1409[_0x5172af[_0x97af('0x5f')][_0x97af('0x9f')]]=_0x5172af[_0x97af('0x5f')][_0x97af('0x87')];return db['CmContact'][_0x97af('0x5e')](_0x1d1409,{'fields':_0x3cac23,'raw':!![]});}})[_0x97af('0x20')](handleEntityNotFound(_0x2a6356,null))['then'](function(_0x4db585){if(_0x4db585){_0x5172af['contact']=_0x4db585;var _0x444954={'ContactId':_0x4db585['id'],'phone':_0x5172af['body'][_0x97af('0x87')],'SmsAccountId':_0x2ffc17[_0x97af('0x66')]['id']};var _0x422033={'ContactId':_0x4db585['id'],'SmsAccountId':_0x2ffc17[_0x97af('0x66')]['id'],'closed':![]};return db[_0x97af('0xa9')][_0x97af('0x5d')]({'where':_0x422033})[_0x97af('0x20')](function(_0x3990e6){if(_0x3990e6){return[_0x3990e6,![]];}return db[_0x97af('0xa9')][_0x97af('0x5e')](_0x444954)[_0x97af('0x20')](function(_0x33fbd0){return[_0x33fbd0,!![]];});});}})['spread'](function(_0x3881db,_0xee22f5){_0x5172af['interaction']=_0x3881db[_0x97af('0x39')]({'plain':!![]});_0x5172af[_0x97af('0xaa')]['created']=![];if(_0xee22f5){if(_0x5172af[_0x97af('0x79')]['autoclose']){_0x5172af['applications'][_0x97af('0xab')]({'id':0x0,'priority':_0x5172af[_0x97af('0x7a')][_0x97af('0x4e')]+0x1,'app':_0x97af('0xac'),'appdata':_0x97af('0xad'),'interval':_0x97af('0xae')});}_0x5172af['interaction'][_0x97af('0xaf')]=!![];}return db[_0x97af('0xb0')][_0x97af('0x5e')]({'phone':_0x5172af['body'][_0x97af('0x87')],'messageId':_0x5172af[_0x97af('0x5f')][_0x97af('0x8e')],'body':_0x5172af[_0x97af('0x5f')]['body'],'SmsAccountId':_0x2ffc17[_0x97af('0x66')]['id'],'SmsInteractionId':_0x3881db['id'],'direction':'in','ContactId':_0x3881db[_0x97af('0xb1')],'AttachmentId':_0x5172af[_0x97af('0x5f')][_0x97af('0xb2')]});})[_0x97af('0x20')](function(_0x47349c){_0x5172af[_0x97af('0x27')]=_0x47349c;if(_0x5172af[_0x97af('0xaa')][_0x97af('0xb3')]){return db[_0x97af('0xb4')]['find']({'attributes':['id',_0x97af('0x3d')],'where':{'id':_0x5172af[_0x97af('0xaa')][_0x97af('0xb3')]}})[_0x97af('0x20')](function(_0x1ec076){if(_0x1ec076){_0x5172af[_0x97af('0x7a')][_0x97af('0xb5')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1ec076['name']+','+(_0x5172af[_0x97af('0x79')][_0x97af('0xb6')]||0xa),'interval':_0x97af('0xae')});}return respondWithRpcPromise(_0x97af('0xb7'),_0x97af('0xb8'),_0x5172af);});}return respondWithRpcPromise(_0x97af('0xb7'),_0x97af('0xb8'),_0x5172af);})[_0x97af('0x20')](function(_0x5693bd){if(_0x5693bd){var _0x39e442=0xc8;var _0x3510f6='receiveMessage';logger['info'](_0x97af('0x22'),_0x3510f6,_0x39e442,_0x97af('0xb9'));logger[_0x97af('0x21')](_0x97af('0xba'),_0x3510f6,_0x39e442,_0x97af('0xb9'),JSON['stringify'](_0x5693bd));if(_0x5172af[_0x97af('0x79')][_0x97af('0x45')]===_0x97af('0x86')){return _0x2a6356[_0x97af('0x2e')](_0x39e442)[_0x97af('0x34')](_0x97af('0xbb'),_0x97af('0xbc'))[_0x97af('0x3e')](_0x97af('0xbd'));}else{return _0x2a6356[_0x97af('0x2e')](_0x39e442)[_0x97af('0x2f')](_0x5693bd);}}})[_0x97af('0x2b')](handleError(_0x2a6356,null));};exports[_0x97af('0xbe')]=function(_0x7a7c20,_0x5023f9){var _0x36fdc8=_0x7a7c20[_0x97af('0x66')]['id'];var _0x9539ad=_0x7a7c20[_0x97af('0x5f')];var _0x14cbd5=0xc8;var _0x55b22e=null;return db[_0x97af('0xbf')][_0x97af('0xc0')]({'isolationLevel':db[_0x97af('0xbf')][_0x97af('0xc1')][_0x97af('0xc2')][_0x97af('0xc3')]},function(_0x4638cb){return db[_0x97af('0x43')]['findOne']({'where':{'id':_0x36fdc8},'transaction':_0x4638cb})['then'](function(_0x4c0b3b){if(_0x4c0b3b){return db[_0x97af('0x77')][_0x97af('0xc4')]({'where':{'SmsAccountId':_0x36fdc8},'transaction':_0x4638cb})['then'](function(){var _0x5a609a=_[_0x97af('0x42')](_0x9539ad,function(_0x28006f){_0x28006f[_0x97af('0x71')]=_0x36fdc8;return _0x28006f;});return db[_0x97af('0x77')][_0x97af('0xc5')](_0x5a609a,{'transaction':_0x4638cb});});}else{_0x14cbd5=0x194;_0x55b22e=[];}});})[_0x97af('0x20')](function(){if(_0x14cbd5!==0x194){return db['SmsApplication'][_0x97af('0xc6')]({'where':{'SmsAccountId':_0x36fdc8},'order':_0x97af('0x7c')})[_0x97af('0x20')](function(_0x1184c3){_0x55b22e=_0x1184c3;});}})['catch'](function(_0x3ead3a){_0x14cbd5=0x1f4;logger['error'](_0x3ead3a['stack']);if(_0x3ead3a['name']){delete _0x3ead3a[_0x97af('0x3d')];}_0x55b22e=_0x3ead3a;})[_0x97af('0xc7')](function(){if(_0x55b22e===null){_0x5023f9[_0x97af('0x2c')](_0x14cbd5);}else{if(_0x14cbd5===0x1f4){_0x5023f9['status'](_0x14cbd5)[_0x97af('0x3e')](_0x55b22e);}else{_0x5023f9[_0x97af('0x2e')](_0x14cbd5)[_0x97af('0x2f')](_0x55b22e);}}});};exports[_0x97af('0xc8')]=function(_0x70dd0c,_0x9e897f,_0x407990){var _0x241b10={};var _0x1d6e88={};var _0x5903b6;var _0x50723c;return db[_0x97af('0x43')]['findOne']({'where':{'id':_0x70dd0c[_0x97af('0x66')]['id']}})['then'](handleEntityNotFound(_0x9e897f,null))[_0x97af('0x20')](function(_0x57eb07){if(_0x57eb07){_0x5903b6=_0x57eb07;_0x1d6e88[_0x97af('0x47')]=_[_0x97af('0x49')](db['SmsApplication'][_0x97af('0x5c')]);_0x1d6e88[_0x97af('0x48')]=_[_0x97af('0x49')](_0x70dd0c['query']);_0x1d6e88['filters']=_['intersection'](_0x1d6e88['model'],_0x1d6e88[_0x97af('0x48')]);_0x241b10[_0x97af('0x4c')]=_['intersection'](_0x1d6e88['model'],qs['fields'](_0x70dd0c[_0x97af('0x48')][_0x97af('0x4d')]));_0x241b10[_0x97af('0x4c')]=_0x241b10[_0x97af('0x4c')][_0x97af('0x4e')]?_0x241b10[_0x97af('0x4c')]:_0x1d6e88[_0x97af('0x47')];_0x241b10[_0x97af('0x50')]=qs[_0x97af('0x51')](_0x70dd0c['query'][_0x97af('0x51')]);_0x241b10['where']=qs[_0x97af('0x4a')](_[_0x97af('0x6d')](_0x70dd0c[_0x97af('0x48')],_0x1d6e88[_0x97af('0x4a')]));if(_0x70dd0c[_0x97af('0x48')][_0x97af('0x53')]){_0x241b10[_0x97af('0x52')]=_[_0x97af('0x54')](_0x241b10['where'],{'$or':_[_0x97af('0x42')](_0x241b10[_0x97af('0x4c')],function(_0xa5af8a){var _0x4b5135={};_0x4b5135[_0xa5af8a]={'$like':'%'+_0x70dd0c[_0x97af('0x48')][_0x97af('0x53')]+'%'};return _0x4b5135;})});}_0x241b10=_[_0x97af('0x54')]({},_0x241b10,_0x70dd0c[_0x97af('0x56')]);return _0x5903b6[_0x97af('0xc8')](_0x241b10);}})[_0x97af('0x20')](function(_0x1817c4){if(_0x1817c4){_0x50723c=_0x1817c4['length'];if(!_0x70dd0c[_0x97af('0x48')]['hasOwnProperty'](_0x97af('0x6c'))){_0x241b10[_0x97af('0x32')]=qs['limit'](_0x70dd0c[_0x97af('0x48')][_0x97af('0x32')]);_0x241b10[_0x97af('0x30')]=qs[_0x97af('0x30')](_0x70dd0c[_0x97af('0x48')]['offset']);}return _0x5903b6[_0x97af('0xc8')](_0x241b10);}})[_0x97af('0x20')](function(_0x23ce36){if(_0x23ce36){return _0x23ce36?{'count':_0x50723c,'rows':_0x23ce36}:null;}})[_0x97af('0x20')](respondWithResult(_0x9e897f,null))[_0x97af('0x2b')](handleError(_0x9e897f,null));};exports[_0x97af('0xc9')]=function(_0x3b6f0c,_0x2a9773,_0x2ba692){var _0x1a6e6c={'raw':![],'where':{}};var _0x597302={};var _0x41e402={'count':0x0,'rows':[]};return db['SmsAccount'][_0x97af('0x6b')]({'where':{'id':_0x3b6f0c['params']['id']}})[_0x97af('0x20')](handleEntityNotFound(_0x2a9773,null))['then'](function(_0xda4c5b){if(_0xda4c5b){_0x597302['model']=_[_0x97af('0x49')](db[_0x97af('0xa9')][_0x97af('0x5c')]);_0x597302[_0x97af('0x48')]=_['keys'](_0x3b6f0c[_0x97af('0x48')]);_0x597302[_0x97af('0x4a')]=_[_0x97af('0x4b')](_0x597302[_0x97af('0x47')],_0x597302[_0x97af('0x48')]);_0x1a6e6c[_0x97af('0x4c')]=_[_0x97af('0x4b')](_0x597302[_0x97af('0x47')],qs[_0x97af('0x4d')](_0x3b6f0c[_0x97af('0x48')]['fields']));_0x1a6e6c[_0x97af('0x4c')]=_0x1a6e6c[_0x97af('0x4c')][_0x97af('0x4e')]?_0x1a6e6c['attributes']:_0x597302[_0x97af('0x47')];if(!_0x3b6f0c[_0x97af('0x48')][_0x97af('0x4f')](_0x97af('0x6c'))){_0x1a6e6c[_0x97af('0x32')]=qs[_0x97af('0x32')](_0x3b6f0c[_0x97af('0x48')]['limit']);_0x1a6e6c[_0x97af('0x30')]=qs[_0x97af('0x30')](_0x3b6f0c[_0x97af('0x48')][_0x97af('0x30')]);}_0x1a6e6c[_0x97af('0x50')]=qs[_0x97af('0x51')](_0x3b6f0c[_0x97af('0x48')][_0x97af('0x51')]);_0x1a6e6c[_0x97af('0x52')]=qs['filters'](_[_0x97af('0x6d')](_0x3b6f0c[_0x97af('0x48')],_0x597302[_0x97af('0x4a')]));_0x1a6e6c['where']['SmsAccountId']=_0xda4c5b['id'];if(_0x3b6f0c[_0x97af('0x48')][_0x97af('0x53')]){_0x1a6e6c[_0x97af('0x52')]=_[_0x97af('0x54')](_0x1a6e6c['where'],{'$or':_[_0x97af('0x42')](_0x1a6e6c['attributes'],function(_0x25589b){var _0x3682d7={};_0x3682d7[_0x25589b]={'$like':'%'+_0x3b6f0c[_0x97af('0x48')]['filter']+'%'};return _0x3682d7;})});}_0x1a6e6c=_[_0x97af('0x54')]({},_0x1a6e6c,_0x3b6f0c[_0x97af('0x56')]);return db[_0x97af('0xa9')][_0x97af('0x33')]({'where':_0x1a6e6c['where']})[_0x97af('0x20')](function(_0x5797ce){_0x41e402[_0x97af('0x33')]=_0x5797ce;if(_0x3b6f0c[_0x97af('0x48')][_0x97af('0x57')]){_0x1a6e6c['include']=[{'model':db[_0x97af('0x7e')],'as':_0x97af('0xca'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x97af('0x3d'),'fullname',_0x97af('0xcb')],'required':![]},{'model':db['Tag'],'as':_0x97af('0xcc'),'attributes':['id',_0x97af('0x3d'),_0x97af('0xcd')],'where':_0x3b6f0c['query'][_0x97af('0xce')]?{'id':_0x3b6f0c['query']['tag']}:undefined,'required':_0x3b6f0c['query'][_0x97af('0xce')]?!![]:![]}];}return db[_0x97af('0xa9')][_0x97af('0x59')](_0x1a6e6c);})[_0x97af('0x20')](function(_0x531391){_0x41e402[_0x97af('0x5a')]=_0x531391;return _0x41e402;});}})[_0x97af('0x20')](respondWithFilteredResult(_0x2a9773,_0x1a6e6c))[_0x97af('0x2b')](handleError(_0x2a9773,null));};exports['send']=function(_0x302620,_0x9fad09,_0xa1a4e9){var _0x4a6f64,_0x40b30e,_0x57eec4;if(_[_0x97af('0x9c')](_0x302620[_0x97af('0x5f')]['body'])||_0x302620[_0x97af('0x5f')][_0x97af('0x5f')]===''){throw new db['Sequelize']['ValidationError'](_0x97af('0x9e'));}if(_[_0x97af('0x9c')](_0x302620[_0x97af('0x5f')]['to'])){throw new db[(_0x97af('0x7f'))]['ValidationError'](_0x97af('0xcf'));}_0x4a6f64=_0x302620[_0x97af('0x5f')]['to'];return db['SmsAccount'][_0x97af('0x5d')]({'where':{'id':_0x302620[_0x97af('0x66')]['id']},'include':[{'model':db[_0x97af('0xa2')],'as':_0x97af('0xd0'),'include':[{'model':db[_0x97af('0x7e')],'as':_0x97af('0xa8'),'where':{'mobile':_0x4a6f64},'limit':0x1,'order':[['updatedAt',_0x97af('0xa5')]]}]}]})[_0x97af('0x20')](handleEntityNotFound(_0x9fad09,null))[_0x97af('0x20')](function(_0x1f00b2){if(_0x1f00b2&&_0x1f00b2[_0x97af('0xd0')]){_0x40b30e=_0x1f00b2['get']({'plain':!![]});if(_0x40b30e[_0x97af('0xd0')]&&_0x40b30e[_0x97af('0xd0')][_0x97af('0xa8')][_0x97af('0x4e')]){return _0x40b30e[_0x97af('0xd0')][_0x97af('0xa8')][0x0];}return db[_0x97af('0x7e')][_0x97af('0x5e')](_['defaults'](_0x302620[_0x97af('0x5f')],{'firstName':_0x4a6f64,'mobile':_0x4a6f64,'phone':_0x4a6f64,'ListId':_0x40b30e[_0x97af('0xa3')]}));}})[_0x97af('0x20')](handleEntityNotFound(_0x9fad09,null))[_0x97af('0x20')](function(_0x3cff4d){if(_0x3cff4d){_0x57eec4=_0x3cff4d;return db[_0x97af('0xa9')][_0x97af('0x5d')]({'where':{'ContactId':_0x57eec4['id'],'closed':![],'SmsAccountId':_0x40b30e['id']}})[_0x97af('0x20')](function(_0x456cfb){if(_0x456cfb){return[_0x456cfb,![]];}return db[_0x97af('0xa9')][_0x97af('0x5e')]({'UserId':_0x302620['user']['id'],'ContactId':_0x57eec4['id'],'SmsAccountId':_0x40b30e['id'],'phone':_0x4a6f64,'firstMsgDirection':'out','Messages':[_[_0x97af('0x54')](_0x302620[_0x97af('0x5f')],{'read':![],'body':_0x302620['body'][_0x97af('0x5f')],'phone':_0x4a6f64,'SmsAccountId':_0x40b30e['id'],'UserId':_0x302620[_0x97af('0x60')]['id'],'ContactId':_0x57eec4['id']})]},{'include':[{'model':db[_0x97af('0xb0')],'as':_0x97af('0xd1')}]})[_0x97af('0x20')](function(_0x24b949){return[_0x24b949,!![]];});});}})[_0x97af('0xd2')](function(_0x583d53,_0x275991){if(_0x275991){return _0x583d53;}return db[_0x97af('0xb0')][_0x97af('0x5e')](_['merge'](_0x302620[_0x97af('0x5f')],{'read':![],'body':_0x302620[_0x97af('0x5f')][_0x97af('0x5f')],'phone':_0x4a6f64,'SmsAccountId':_0x40b30e['id'],'SmsInteractionId':_0x583d53['id'],'UserId':_0x302620[_0x97af('0x60')]['id'],'ContactId':_0x57eec4['id']}))[_0x97af('0x20')](function(_0x3099f6){_0x583d53['dataValues'][_0x97af('0xd1')]=[];_0x583d53[_0x97af('0xd3')][_0x97af('0xd1')][_0x97af('0xab')](_0x3099f6[_0x97af('0xd3')]);return _0x583d53;});})[_0x97af('0x20')](respondWithResult(_0x9fad09,null))[_0x97af('0x2b')](handleError(_0x9fad09,null));};exports['status']=function(_0x402efd,_0x20c5cf,_0xdd5086){if(_0x402efd[_0x97af('0x5f')]['id']){delete _0x402efd['body']['id'];}var _0x92ac46,_0x2b951d,_0x125357;return db[_0x97af('0x43')]['find']({'where':{'id':_0x402efd[_0x97af('0x66')]['id']}})['then'](handleEntityNotFound(_0x20c5cf,null))[_0x97af('0x20')](function(_0x75f9ef){if(_0x75f9ef){_0x125357=_0x75f9ef;logger['debug'](_0x97af('0x22'),'status',_0x97af('0xd4'),_0x75f9ef[_0x97af('0x45')],util[_0x97af('0xd5')](_0x402efd[_0x97af('0x5f')],{'showHidden':![],'depth':null}));switch(_0x75f9ef['type']){case _0x97af('0xd6'):if(_0x402efd['body'][_0x97af('0xd7')]&&_0x402efd[_0x97af('0x5f')][_0x97af('0x2e')]){_0x2b951d=_0x402efd['body'][_0x97af('0x2e')];return db[_0x97af('0xb0')][_0x97af('0x5d')]({'where':{'messageId':_0x402efd[_0x97af('0x5f')][_0x97af('0xd7')]}});}break;case _0x97af('0xd8'):if(_0x402efd[_0x97af('0x5f')][_0x97af('0xd9')]&&_0x402efd[_0x97af('0x5f')][_0x97af('0xda')]){_0x2b951d=_0x402efd['body']['statusInt'];return db[_0x97af('0xb0')]['find']({'where':{'messageId':_0x402efd[_0x97af('0x5f')][_0x97af('0xd9')]}});}break;case'clicksend':if(_0x402efd[_0x97af('0x5f')][_0x97af('0x8f')]&&_0x402efd[_0x97af('0x5f')]['status_code']){_0x2b951d=_0x402efd[_0x97af('0x5f')][_0x97af('0xdb')];return db[_0x97af('0xb0')][_0x97af('0x5d')]({'where':{'messageId':_0x402efd[_0x97af('0x5f')][_0x97af('0x8f')]}});}break;case _0x97af('0x92'):var _0x2799f5=_0x402efd[_0x97af('0x5f')]['results'][0x0];if(_0x2799f5[_0x97af('0x8e')]&&_0x2799f5[_0x97af('0x2e')][_0x97af('0xdc')]==='DELIVERED'){_0x2b951d=_0x2799f5[_0x97af('0x2e')]['groupName'];return db[_0x97af('0xb0')][_0x97af('0x5d')]({'where':{'messageId':_0x2799f5[_0x97af('0x8e')]}});}break;case _0x97af('0x97'):if(_0x402efd[_0x97af('0x5f')][_0x97af('0x8e')]&&_0x402efd[_0x97af('0x5f')][_0x97af('0x2e')]){_0x2b951d=_0x402efd[_0x97af('0x5f')][_0x97af('0x2e')];return db[_0x97af('0xb0')]['find']({'where':{'messageId':_0x402efd[_0x97af('0x5f')]['messageId']}});}break;case _0x97af('0x99'):if(_0x402efd[_0x97af('0x5f')][0x0]['message']['id']){_0x2b951d=_0x402efd[_0x97af('0x5f')][0x0]['type'];return db[_0x97af('0xb0')][_0x97af('0x5d')]({'where':{'messageId':_0x402efd[_0x97af('0x5f')][0x0][_0x97af('0x27')]['id']}});}break;case _0x97af('0x9a'):if(_0x402efd['body']['redif']&&_0x402efd[_0x97af('0x5f')][_0x97af('0x2e')]){_0x2b951d=_0x402efd['body'][_0x97af('0x2e')];return db[_0x97af('0xb0')][_0x97af('0x5d')]({'where':{'messageId':_0x402efd[_0x97af('0x5f')][_0x97af('0xdd')]}});}break;}}})['then'](handleEntityNotFound(_0x20c5cf,null))[_0x97af('0x20')](function(_0x5b35d4){if(_0x5b35d4){_0x92ac46=_0x5b35d4;switch(_0x125357[_0x97af('0x45')]){case'skebby':if(_0x2b951d===_0x97af('0xde')){return _0x92ac46['update']({'read':!![]});}else{logger[_0x97af('0x25')](_0x97af('0x22'),_0x97af('0x2e'),_0x97af('0xd6'),util[_0x97af('0xd5')](_0x402efd[_0x97af('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x97af('0xd8'):if(_0x2b951d==='1'){return _0x92ac46[_0x97af('0x38')]({'read':!![]});}else{logger[_0x97af('0x25')](_0x97af('0x22'),_0x97af('0x2e'),_0x97af('0xd6'),util[_0x97af('0xd5')](_0x402efd[_0x97af('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x97af('0x8d'):if(!_0x402efd[_0x97af('0x5f')][_0x97af('0xdf')]&&_0x2b951d>=0xc8&&_0x2b951d<=0xce){return _0x92ac46[_0x97af('0x38')]({'read':!![]});}else{logger[_0x97af('0x25')](_0x97af('0x22'),_0x97af('0x2e'),_0x97af('0x8d'),util[_0x97af('0xd5')](_0x402efd[_0x97af('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x97af('0x92'):var _0x2eee6f=_0x402efd[_0x97af('0x5f')][_0x97af('0x93')][0x0];if(_0x2eee6f['status'][_0x97af('0xdc')]===_0x97af('0xde')){return _0x92ac46[_0x97af('0x38')]({'read':!![]});}else{logger[_0x97af('0x25')](_0x97af('0x22'),_0x97af('0x2e'),'infobip',util[_0x97af('0xd5')](_0x402efd[_0x97af('0x5f')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x2b951d==_0x97af('0xe0')||_0x2b951d=='RECEIVED_BY_RECIPIENT'){return _0x92ac46[_0x97af('0x38')]({'read':!![]});}else{logger[_0x97af('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x97af('0x2e'),_0x97af('0x97'),util['inspect'](_0x402efd[_0x97af('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x97af('0x99'):if(_0x2b951d==_0x97af('0xe1')){return _0x92ac46[_0x97af('0x38')]({'read':!![]});}else{logger[_0x97af('0x25')](_0x97af('0x22'),_0x97af('0x2e'),_0x97af('0x99'),util[_0x97af('0xd5')](_0x402efd[_0x97af('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x97af('0x9a'):if(_0x2b951d===_0x97af('0xe2')||_0x2b951d===_0x97af('0xe3')){return _0x92ac46[_0x97af('0x38')]({'read':!![]});}else{logger[_0x97af('0x25')](_0x97af('0x22'),_0x97af('0x2e'),'intelepeer',util[_0x97af('0xd5')](_0x402efd[_0x97af('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x92ac46;}})[_0x97af('0x20')](respondWithResult(_0x20c5cf,null))[_0x97af('0x2b')](handleError(_0x20c5cf,null));};exports[_0x97af('0xe4')]=function(_0x3d8d34,_0x59570b,_0x10897a){var _0x266737,_0x464e4e,_0x594054;return db[_0x97af('0x43')][_0x97af('0x5d')]({'where':{'id':_0x3d8d34[_0x97af('0x66')]['id']}})[_0x97af('0x20')](handleEntityNotFound(_0x59570b,null))['then'](function(_0x5ab5e5){if(_0x5ab5e5){_0x594054=_0x5ab5e5;logger[_0x97af('0x21')](_0x97af('0x22'),_0x97af('0x2e'),'received\x20delivery\x20report\x20from',_0x5ab5e5[_0x97af('0x45')],util[_0x97af('0xd5')](_0x3d8d34[_0x97af('0x48')],{'showHidden':![],'depth':null}));switch(_0x5ab5e5[_0x97af('0x45')]){case _0x97af('0x94'):if(_0x3d8d34[_0x97af('0x48')][_0x97af('0xe5')]&&_0x3d8d34[_0x97af('0x48')][_0x97af('0xe6')]){_0x464e4e=_0x3d8d34[_0x97af('0x48')][_0x97af('0xe6')];return db[_0x97af('0xb0')][_0x97af('0x5d')]({'where':{'messageId':_0x3d8d34[_0x97af('0x48')][_0x97af('0xe5')]}});}break;}}})[_0x97af('0x20')](handleEntityNotFound(_0x59570b,null))[_0x97af('0x20')](function(_0x101820){if(_0x101820){_0x266737=_0x101820;switch(_0x594054[_0x97af('0x45')]){case _0x97af('0x94'):if(_0x464e4e==='2'||_0x464e4e==='6'){return _0x266737[_0x97af('0x38')]({'read':!![]});}else{logger['error'](_0x97af('0x22'),'status',_0x97af('0x94'),util['inspect'](_0x3d8d34['query'],{'showHidden':![],'depth':null}));};break;}return _0x266737;}})['then'](respondWithResult(_0x59570b,null))[_0x97af('0x2b')](handleError(_0x59570b,null));};exports[_0x97af('0xe7')]=function(_0xab97a1,_0x290d4a,_0x1a820c){return db[_0x97af('0x43')][_0x97af('0x5d')]({'where':{'id':_0xab97a1[_0x97af('0x66')]['id']}})[_0x97af('0x20')](handleEntityNotFound(_0x290d4a,null))[_0x97af('0x20')](function(_0x48f03f){if(_0x48f03f){return _0x48f03f['addAgents'](_0xab97a1[_0x97af('0x5f')]['ids'],_[_0x97af('0xa7')](_0xab97a1[_0x97af('0x5f')],['ids','id'])||{})[_0x97af('0xd2')](function(_0x58e953){for(var _0x590c0f=0x0;_0x590c0f<_0xab97a1[_0x97af('0x5f')][_0x97af('0x6f')][_0x97af('0x4e')];_0x590c0f+=0x1){socket[_0x97af('0xe8')](_0x97af('0xe9'),{'UserId':Number(_0xab97a1[_0x97af('0x5f')][_0x97af('0x6f')][_0x590c0f]),'SmsAccountId':Number(_0xab97a1[_0x97af('0x66')]['id'])});}return _0x58e953;});}})[_0x97af('0x20')](respondWithResult(_0x290d4a,null))[_0x97af('0x2b')](handleError(_0x290d4a,null));};exports[_0x97af('0xea')]=function(_0x5b2d36,_0x59dc52,_0x52e2d0){return db[_0x97af('0x43')][_0x97af('0x5d')]({'where':{'id':_0x5b2d36[_0x97af('0x66')]['id']}})[_0x97af('0x20')](handleEntityNotFound(_0x59dc52,null))[_0x97af('0x20')](function(_0x5be877){if(_0x5be877){return _0x5be877[_0x97af('0xea')](_0x5b2d36[_0x97af('0x48')][_0x97af('0x6f')])[_0x97af('0x20')](function(){if(_[_0x97af('0xeb')](_0x5b2d36[_0x97af('0x48')][_0x97af('0x6f')])){for(var _0x74b8e4=0x0;_0x74b8e4<_0x5b2d36[_0x97af('0x48')][_0x97af('0x6f')][_0x97af('0x4e')];_0x74b8e4+=0x1){socket[_0x97af('0xe8')](_0x97af('0xec'),{'UserId':Number(_0x5b2d36[_0x97af('0x48')][_0x97af('0x6f')][_0x74b8e4]),'SmsAccountId':Number(_0x5b2d36[_0x97af('0x66')]['id'])});}}else{socket[_0x97af('0xe8')](_0x97af('0xec'),{'UserId':Number(_0x5b2d36[_0x97af('0x48')][_0x97af('0x6f')]),'SmsAccountId':Number(_0x5b2d36[_0x97af('0x66')]['id'])});}});}})[_0x97af('0x20')](respondWithStatusCode(_0x59dc52,null))[_0x97af('0x2b')](handleError(_0x59dc52,null));};exports[_0x97af('0xed')]=function(_0x5a7b30,_0x2c979b,_0x1e8de5){var _0x1f60a7={};var _0x3ce7f0={};var _0x12eae7;var _0x4a59b5;return db[_0x97af('0x43')][_0x97af('0x6b')]({'where':{'id':_0x5a7b30['params']['id']}})[_0x97af('0x20')](handleEntityNotFound(_0x2c979b,null))[_0x97af('0x20')](function(_0x4e9e75){if(_0x4e9e75){_0x12eae7=_0x4e9e75;_0x3ce7f0['model']=_[_0x97af('0x49')](db['User'][_0x97af('0x5c')]);_0x3ce7f0[_0x97af('0x48')]=_[_0x97af('0x49')](_0x5a7b30['query']);_0x3ce7f0[_0x97af('0x4a')]=_['intersection'](_0x3ce7f0[_0x97af('0x47')],_0x3ce7f0[_0x97af('0x48')]);_0x1f60a7['attributes']=_[_0x97af('0x4b')](_0x3ce7f0['model'],qs[_0x97af('0x4d')](_0x5a7b30['query'][_0x97af('0x4d')]));_0x1f60a7[_0x97af('0x4c')]=_0x1f60a7[_0x97af('0x4c')][_0x97af('0x4e')]?_0x1f60a7[_0x97af('0x4c')]:_0x3ce7f0['model'];_0x1f60a7[_0x97af('0x50')]=qs[_0x97af('0x51')](_0x5a7b30[_0x97af('0x48')][_0x97af('0x51')]);_0x1f60a7[_0x97af('0x52')]=qs[_0x97af('0x4a')](_[_0x97af('0x6d')](_0x5a7b30[_0x97af('0x48')],_0x3ce7f0[_0x97af('0x4a')]));if(_0x5a7b30[_0x97af('0x48')][_0x97af('0x53')]){_0x1f60a7['where']=_[_0x97af('0x54')](_0x1f60a7['where'],{'$or':_['map'](_0x1f60a7['attributes'],function(_0x358d6f){var _0x201249={};_0x201249[_0x358d6f]={'$like':'%'+_0x5a7b30[_0x97af('0x48')][_0x97af('0x53')]+'%'};return _0x201249;})});}_0x1f60a7=_['merge']({},_0x1f60a7,_0x5a7b30[_0x97af('0x56')]);return _0x12eae7[_0x97af('0xed')](_0x1f60a7);}})[_0x97af('0x20')](function(_0x2c7482){if(_0x2c7482){_0x4a59b5=_0x2c7482[_0x97af('0x4e')];if(!_0x5a7b30[_0x97af('0x48')][_0x97af('0x4f')](_0x97af('0x6c'))){_0x1f60a7['limit']=qs[_0x97af('0x32')](_0x5a7b30[_0x97af('0x48')][_0x97af('0x32')]);_0x1f60a7[_0x97af('0x30')]=qs[_0x97af('0x30')](_0x5a7b30[_0x97af('0x48')][_0x97af('0x30')]);}return _0x12eae7[_0x97af('0xed')](_0x1f60a7);}})[_0x97af('0x20')](function(_0x38f2e0){if(_0x38f2e0){return _0x38f2e0?{'count':_0x4a59b5,'rows':_0x38f2e0}:null;}})['then'](respondWithResult(_0x2c979b,null))[_0x97af('0x2b')](handleError(_0x2c979b,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index af6fece..ab0fd89 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 _0x984d=['hook','events','../../mysqldb','SmsAccount','remove','emit','hasOwnProperty'];(function(_0x28a8c2,_0x494d5){var _0x37ac3c=function(_0x2882b3){while(--_0x2882b3){_0x28a8c2['push'](_0x28a8c2['shift']());}};_0x37ac3c(++_0x494d5);}(_0x984d,0x1ac));var _0xd984=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x984d[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xd984('0x0'));var SmsAccount=require(_0xd984('0x1'))['db'][_0xd984('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd984('0x3')};function emitEvent(_0x158e47){return function(_0xa69803,_0x13691a,_0x96b536){SmsAccountEvents[_0xd984('0x4')](_0x158e47+':'+_0xa69803['id'],_0xa69803);SmsAccountEvents[_0xd984('0x4')](_0x158e47,_0xa69803);_0x96b536(null);};}for(var e in events){if(events[_0xd984('0x5')](e)){var event=events[e];SmsAccount[_0xd984('0x6')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0xdbad=['exports','events','SmsAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xdbad,0x13c));var _0xddba=function(_0x3adfcd,_0x453886){_0x3adfcd=_0x3adfcd-0x0;var _0x239322=_0xdbad[_0x3adfcd];return _0x239322;};'use strict';var EventEmitter=require(_0xddba('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0xddba('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xddba('0x2')](0x0);var events={'afterCreate':_0xddba('0x3'),'afterUpdate':'update','afterDestroy':_0xddba('0x4')};function emitEvent(_0x4fe067){return function(_0x56f375,_0x46f833,_0x5ee069){SmsAccountEvents[_0xddba('0x5')](_0x4fe067+':'+_0x56f375['id'],_0x56f375);SmsAccountEvents[_0xddba('0x5')](_0x4fe067,_0x56f375);_0x5ee069(null);};}for(var e in events){if(events[_0xddba('0x6')](e)){var event=events[e];SmsAccount[_0xddba('0x7')](e,emitEvent(event));}}module[_0xddba('0x8')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index d45542a..eb2d0c0 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 _0x063a=['lodash','moment','bluebird','request-promise','path','../../config/environment','./smsAccount.attributes','define','SmsAccount','sms_accounts'];(function(_0x2625bc,_0x2a23b4){var _0x585f87=function(_0x1d606d){while(--_0x1d606d){_0x2625bc['push'](_0x2625bc['shift']());}};_0x585f87(++_0x2a23b4);}(_0x063a,0xc8));var _0xa063=function(_0x24579a,_0x28f30b){_0x24579a=_0x24579a-0x0;var _0x1bcf8e=_0x063a[_0x24579a];return _0x1bcf8e;};'use strict';var _=require(_0xa063('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xa063('0x1'));var BPromise=require(_0xa063('0x2'));var rp=require(_0xa063('0x3'));var fs=require('fs');var path=require(_0xa063('0x4'));var rimraf=require('rimraf');var config=require(_0xa063('0x5'));var attributes=require(_0xa063('0x6'));module['exports']=function(_0x11178b,_0x36206e){return _0x11178b[_0xa063('0x7')](_0xa063('0x8'),attributes,{'tableName':_0xa063('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x684b=['path','rimraf','../../config/environment','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4d40dd,_0x39592b){var _0x1c51f2=function(_0x53e502){while(--_0x53e502){_0x4d40dd['push'](_0x4d40dd['shift']());}};_0x1c51f2(++_0x39592b);}(_0x684b,0x10d));var _0xb684=function(_0xc87b8c,_0xcadd0){_0xc87b8c=_0xc87b8c-0x0;var _0x242c16=_0x684b[_0xc87b8c];return _0x242c16;};'use strict';var _=require(_0xb684('0x0'));var util=require(_0xb684('0x1'));var logger=require(_0xb684('0x2'))(_0xb684('0x3'));var moment=require(_0xb684('0x4'));var BPromise=require(_0xb684('0x5'));var rp=require(_0xb684('0x6'));var fs=require('fs');var path=require(_0xb684('0x7'));var rimraf=require(_0xb684('0x8'));var config=require(_0xb684('0x9'));var attributes=require('./smsAccount.attributes');module['exports']=function(_0x4a9088,_0x1ad7f9){return _0x4a9088['define'](_0xb684('0xa'),attributes,{'tableName':_0xb684('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 89090d0..9e46e4a 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 _0x3a61=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','SmsAccount','find','options','where','attributes','include','map','model','ShowSmsAccount','debug','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x5107dd,_0x4d8ce8){var _0x463571=function(_0x552a73){while(--_0x552a73){_0x5107dd['push'](_0x5107dd['shift']());}};_0x463571(++_0x4d8ce8);}(_0x3a61,0x1f3));var _0x13a6=function(_0x5e58f9,_0x2e3bd5){_0x5e58f9=_0x5e58f9-0x0;var _0x319157=_0x3a61[_0x5e58f9];return _0x319157;};'use strict';var _=require(_0x13a6('0x0'));var util=require('util');var moment=require(_0x13a6('0x1'));var BPromise=require(_0x13a6('0x2'));var rs=require(_0x13a6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x13a6('0x4'))['db'];var utils=require(_0x13a6('0x5'));var logger=require(_0x13a6('0x6'))(_0x13a6('0x7'));var config=require('../../config/environment');var jayson=require(_0x13a6('0x8'));var client=jayson[_0x13a6('0x9')][_0x13a6('0xa')]({'port':0x232a});config[_0x13a6('0xb')]=_[_0x13a6('0xc')](config[_0x13a6('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x13a6('0xb')]));require(_0x13a6('0xd'))[_0x13a6('0xe')](socket);function respondWithRpcPromise(_0x215833,_0x1b8f55,_0x564980){return new BPromise(function(_0x47410d,_0x345cbf){return client[_0x13a6('0xf')](_0x215833,_0x564980)[_0x13a6('0x10')](function(_0x42512b){logger[_0x13a6('0x11')](_0x13a6('0x12'),_0x1b8f55,_0x13a6('0x13'));logger['debug'](_0x13a6('0x14'),_0x1b8f55,_0x13a6('0x13'),JSON[_0x13a6('0x15')](_0x42512b));if(_0x42512b[_0x13a6('0x16')]){if(_0x42512b[_0x13a6('0x16')][_0x13a6('0x17')]===0x1f4){logger[_0x13a6('0x16')](_0x13a6('0x12'),_0x1b8f55,_0x42512b['error'][_0x13a6('0x18')]);return _0x345cbf(_0x42512b[_0x13a6('0x16')][_0x13a6('0x18')]);}logger[_0x13a6('0x16')](_0x13a6('0x12'),_0x1b8f55,_0x42512b[_0x13a6('0x16')][_0x13a6('0x18')]);return _0x47410d(_0x42512b['error'][_0x13a6('0x18')]);}else{logger[_0x13a6('0x11')](_0x13a6('0x12'),_0x1b8f55,_0x13a6('0x13'));_0x47410d(_0x42512b['result'][_0x13a6('0x18')]);}})[_0x13a6('0x19')](function(_0x16a3c7){logger[_0x13a6('0x16')](_0x13a6('0x12'),_0x1b8f55,_0x16a3c7);_0x345cbf(_0x16a3c7);});});}exports['ShowSmsAccount']=function(_0x2dcd41){var _0x4c6924=this;return new Promise(function(_0x1b2f4b,_0x30348d){return db[_0x13a6('0x1a')][_0x13a6('0x1b')]({'raw':_0x2dcd41[_0x13a6('0x1c')]?_0x2dcd41['options']['raw']===undefined?!![]:![]:!![],'where':_0x2dcd41[_0x13a6('0x1c')]?_0x2dcd41[_0x13a6('0x1c')][_0x13a6('0x1d')]||null:null,'attributes':_0x2dcd41[_0x13a6('0x1c')]?_0x2dcd41[_0x13a6('0x1c')][_0x13a6('0x1e')]||null:null,'include':_0x2dcd41['options']?_0x2dcd41[_0x13a6('0x1c')][_0x13a6('0x1f')]?_[_0x13a6('0x20')](_0x2dcd41['options'][_0x13a6('0x1f')],function(_0x4f1add){return{'model':db[_0x4f1add[_0x13a6('0x21')]],'as':_0x4f1add['as'],'attributes':_0x4f1add[_0x13a6('0x1e')],'include':_0x4f1add[_0x13a6('0x1f')]?_[_0x13a6('0x20')](_0x4f1add[_0x13a6('0x1f')],function(_0x154849){return{'model':db[_0x154849['model']],'as':_0x154849['as'],'attributes':_0x154849[_0x13a6('0x1e')],'include':_0x154849[_0x13a6('0x1f')]?_[_0x13a6('0x20')](_0x154849['include'],function(_0x133850){return{'model':db[_0x133850[_0x13a6('0x21')]],'as':_0x133850['as'],'attributes':_0x133850['attributes']};}):[]};}):[]};}):[]:[]})[_0x13a6('0x10')](function(_0x3a7946){logger[_0x13a6('0x11')](_0x13a6('0x22'),_0x2dcd41);logger[_0x13a6('0x23')](_0x13a6('0x22'),_0x2dcd41,JSON[_0x13a6('0x15')](_0x3a7946));_0x1b2f4b(_0x3a7946);})[_0x13a6('0x19')](function(_0x30e6a7){logger[_0x13a6('0x16')](_0x13a6('0x22'),_0x30e6a7[_0x13a6('0x18')],_0x2dcd41);_0x30348d(_0x4c6924[_0x13a6('0x16')](0x1f4,_0x30e6a7['message']));});});}; \ No newline at end of file +var _0xeb2f=['http','defaults','redis','socket.io-emitter','./smsAccount.socket','request','info','request\x20sent','debug','stringify','code','error','SmsAccount,\x20%s,\x20%s','message','SmsAccount','find','options','raw','attributes','map','include','model','then','ShowSmsAccount','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x312440,_0x10c4aa){var _0x145314=function(_0x508530){while(--_0x508530){_0x312440['push'](_0x312440['shift']());}};_0x145314(++_0x10c4aa);}(_0xeb2f,0x177));var _0xfeb2=function(_0x40ff79,_0x578a04){_0x40ff79=_0x40ff79-0x0;var _0x32234c=_0xeb2f[_0x40ff79];return _0x32234c;};'use strict';var _=require(_0xfeb2('0x0'));var util=require('util');var moment=require(_0xfeb2('0x1'));var BPromise=require(_0xfeb2('0x2'));var rs=require(_0xfeb2('0x3'));var fs=require('fs');var Redis=require(_0xfeb2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfeb2('0x5'));var logger=require('../../config/logger')(_0xfeb2('0x6'));var config=require(_0xfeb2('0x7'));var jayson=require(_0xfeb2('0x8'));var client=jayson[_0xfeb2('0x9')][_0xfeb2('0xa')]({'port':0x232a});config['redis']=_[_0xfeb2('0xb')](config[_0xfeb2('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xfeb2('0xd'))(new Redis(config[_0xfeb2('0xc')]));require(_0xfeb2('0xe'))['register'](socket);function respondWithRpcPromise(_0x29b452,_0x3301b2,_0x33d4db){return new BPromise(function(_0x50197b,_0x3e7644){return client[_0xfeb2('0xf')](_0x29b452,_0x33d4db)['then'](function(_0xd1c73f){logger[_0xfeb2('0x10')]('SmsAccount,\x20%s,\x20%s',_0x3301b2,_0xfeb2('0x11'));logger[_0xfeb2('0x12')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3301b2,_0xfeb2('0x11'),JSON[_0xfeb2('0x13')](_0xd1c73f));if(_0xd1c73f['error']){if(_0xd1c73f['error'][_0xfeb2('0x14')]===0x1f4){logger[_0xfeb2('0x15')](_0xfeb2('0x16'),_0x3301b2,_0xd1c73f[_0xfeb2('0x15')]['message']);return _0x3e7644(_0xd1c73f[_0xfeb2('0x15')][_0xfeb2('0x17')]);}logger[_0xfeb2('0x15')](_0xfeb2('0x16'),_0x3301b2,_0xd1c73f[_0xfeb2('0x15')]['message']);return _0x50197b(_0xd1c73f['error']['message']);}else{logger[_0xfeb2('0x10')](_0xfeb2('0x16'),_0x3301b2,_0xfeb2('0x11'));_0x50197b(_0xd1c73f['result'][_0xfeb2('0x17')]);}})['catch'](function(_0x4bd3da){logger[_0xfeb2('0x15')]('SmsAccount,\x20%s,\x20%s',_0x3301b2,_0x4bd3da);_0x3e7644(_0x4bd3da);});});}exports['ShowSmsAccount']=function(_0x377437){var _0x3d15a4=this;return new Promise(function(_0x16b6bb,_0x23e335){return db[_0xfeb2('0x18')][_0xfeb2('0x19')]({'raw':_0x377437[_0xfeb2('0x1a')]?_0x377437['options'][_0xfeb2('0x1b')]===undefined?!![]:![]:!![],'where':_0x377437[_0xfeb2('0x1a')]?_0x377437[_0xfeb2('0x1a')]['where']||null:null,'attributes':_0x377437[_0xfeb2('0x1a')]?_0x377437['options'][_0xfeb2('0x1c')]||null:null,'include':_0x377437[_0xfeb2('0x1a')]?_0x377437[_0xfeb2('0x1a')]['include']?_[_0xfeb2('0x1d')](_0x377437[_0xfeb2('0x1a')][_0xfeb2('0x1e')],function(_0x4c8e5b){return{'model':db[_0x4c8e5b[_0xfeb2('0x1f')]],'as':_0x4c8e5b['as'],'attributes':_0x4c8e5b[_0xfeb2('0x1c')],'include':_0x4c8e5b[_0xfeb2('0x1e')]?_['map'](_0x4c8e5b['include'],function(_0x325ff3){return{'model':db[_0x325ff3[_0xfeb2('0x1f')]],'as':_0x325ff3['as'],'attributes':_0x325ff3[_0xfeb2('0x1c')],'include':_0x325ff3[_0xfeb2('0x1e')]?_[_0xfeb2('0x1d')](_0x325ff3[_0xfeb2('0x1e')],function(_0x3ea10c){return{'model':db[_0x3ea10c[_0xfeb2('0x1f')]],'as':_0x3ea10c['as'],'attributes':_0x3ea10c[_0xfeb2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xfeb2('0x20')](function(_0x4c4133){logger[_0xfeb2('0x10')](_0xfeb2('0x21'),_0x377437);logger['debug'](_0xfeb2('0x21'),_0x377437,JSON[_0xfeb2('0x13')](_0x4c4133));_0x16b6bb(_0x4c4133);})[_0xfeb2('0x22')](function(_0x2c66a6){logger['error']('ShowSmsAccount',_0x2c66a6[_0xfeb2('0x17')],_0x377437);_0x23e335(_0x3d15a4[_0xfeb2('0x15')](0x1f4,_0x2c66a6['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 1345518..e56824c 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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 a51f398..3534277 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 _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(_0x5c5364,_0x36e29e){var _0x469579=function(_0x4300bb){while(--_0x4300bb){_0x5c5364['push'](_0x5c5364['shift']());}};_0x469579(++_0x36e29e);}(_0x008c,0x188));var _0xc008=function(_0x3afbdf,_0x9e463b){_0x3afbdf=_0x3afbdf-0x0;var _0x5b6861=_0x008c[_0x3afbdf];return _0x5b6861;};'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 +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(_0x46415c,_0x11c85e){var _0x5983e0=function(_0x316127){while(--_0x316127){_0x46415c['push'](_0x46415c['shift']());}};_0x5983e0(++_0x11c85e);}(_0x7217,0x19e));var _0x7721=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x7217[_0x1b828b];return _0x98da1a;};'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 diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index b22ef4a..ecc7fd4 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 _0x9eb1=['noop','TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9eb1,0x164));var _0x19eb=function(_0xe260c2,_0x56d51e){_0xe260c2=_0xe260c2-0x0;var _0x32ddfb=_0x9eb1[_0xe260c2];return _0x32ddfb;};'use strict';var Sequelize=require(_0x19eb('0x0'));module[_0x19eb('0x1')]={'priority':{'type':Sequelize[_0x19eb('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x19eb('0x3')],'allowNull':![],'defaultValue':_0x19eb('0x4')},'appdata':{'type':Sequelize[_0x19eb('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x19eb('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x6f76=['*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0x543f55,_0x3c3828){var _0xce8f8f=function(_0x1d5d39){while(--_0x1d5d39){_0x543f55['push'](_0x543f55['shift']());}};_0xce8f8f(++_0x3c3828);}(_0x6f76,0xc4));var _0x66f7=function(_0x154079,_0x2b89cb){_0x154079=_0x154079-0x0;var _0x4f0bdb=_0x6f76[_0x154079];return _0x4f0bdb;};'use strict';var Sequelize=require('sequelize');module[_0x66f7('0x0')]={'priority':{'type':Sequelize[_0x66f7('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x66f7('0x2')],'allowNull':![],'defaultValue':_0x66f7('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x66f7('0x2')]},'interval':{'type':Sequelize[_0x66f7('0x2')],'defaultValue':_0x66f7('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 48b9077..25e7e38 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 _0xed29=['destroy','name','index','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','options','rows','show','includeAll','include','merge','find','catch','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then'];(function(_0x5bc27a,_0x32e2d1){var _0x2c8a4d=function(_0x1a7dd9){while(--_0x1a7dd9){_0x5bc27a['push'](_0x5bc27a['shift']());}};_0x2c8a4d(++_0x32e2d1);}(_0xed29,0x6a));var _0x9ed2=function(_0xe7a99e,_0x4902a1){_0xe7a99e=_0xe7a99e-0x0;var _0x3bef5c=_0xed29[_0xe7a99e];return _0x3bef5c;};'use strict';var emlformat=require(_0x9ed2('0x0'));var rimraf=require(_0x9ed2('0x1'));var zipdir=require(_0x9ed2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9ed2('0x3'));var moment=require(_0x9ed2('0x4'));var BPromise=require(_0x9ed2('0x5'));var Mustache=require(_0x9ed2('0x6'));var util=require('util');var path=require(_0x9ed2('0x7'));var sox=require(_0x9ed2('0x8'));var csv=require(_0x9ed2('0x9'));var ejs=require(_0x9ed2('0xa'));var fs=require('fs');var fs_extra=require(_0x9ed2('0xb'));var _=require(_0x9ed2('0xc'));var squel=require(_0x9ed2('0xd'));var crypto=require(_0x9ed2('0xe'));var jsforce=require(_0x9ed2('0xf'));var deskjs=require(_0x9ed2('0x10'));var toCsv=require(_0x9ed2('0x9'));var querystring=require(_0x9ed2('0x11'));var Papa=require(_0x9ed2('0x12'));var Redis=require(_0x9ed2('0x13'));var authService=require(_0x9ed2('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x9ed2('0x15'));var hardwareService=require(_0x9ed2('0x16'));var logger=require('../../config/logger')(_0x9ed2('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9ed2('0x18'))['db'];function respondWithStatusCode(_0x1218ed,_0x425a19){_0x425a19=_0x425a19||0xcc;return function(_0x276ff8){if(_0x276ff8){return _0x1218ed[_0x9ed2('0x19')](_0x425a19);}return _0x1218ed[_0x9ed2('0x1a')](_0x425a19)['end']();};}function respondWithResult(_0x31f133,_0x4cc159){_0x4cc159=_0x4cc159||0xc8;return function(_0x5a9d31){if(_0x5a9d31){return _0x31f133['status'](_0x4cc159)[_0x9ed2('0x1b')](_0x5a9d31);}};}function respondWithFilteredResult(_0x20a928,_0xd9bcd4){return function(_0x44447a){if(_0x44447a){var _0x4b33f3=typeof _0xd9bcd4[_0x9ed2('0x1c')]===_0x9ed2('0x1d')&&typeof _0xd9bcd4['limit']===_0x9ed2('0x1d');var _0x5c2ee2=_0x44447a['count'];var _0x47e993=_0x4b33f3?0x0:_0xd9bcd4['offset'];var _0x29b606=_0x4b33f3?_0x44447a[_0x9ed2('0x1e')]:_0xd9bcd4[_0x9ed2('0x1c')]+_0xd9bcd4[_0x9ed2('0x1f')];var _0x3d54f4;if(_0x29b606>=_0x5c2ee2){_0x29b606=_0x5c2ee2;_0x3d54f4=0xc8;}else{_0x3d54f4=0xce;}_0x20a928['status'](_0x3d54f4);return _0x20a928[_0x9ed2('0x20')](_0x9ed2('0x21'),_0x47e993+'-'+_0x29b606+'/'+_0x5c2ee2)['json'](_0x44447a);}return null;};}function patchUpdates(_0x4509d1){return function(_0x31098e){try{jsonpatch['apply'](_0x31098e,_0x4509d1,!![]);}catch(_0x20bec2){return BPromise[_0x9ed2('0x22')](_0x20bec2);}return _0x31098e[_0x9ed2('0x23')]();};}function saveUpdates(_0x55344b,_0x23c430){return function(_0x41d756){if(_0x41d756){return _0x41d756[_0x9ed2('0x24')](_0x55344b)[_0x9ed2('0x25')](function(_0x58276e){return _0x58276e;});}return null;};}function removeEntity(_0x2a04b7,_0x30f167){return function(_0x11b7a3){if(_0x11b7a3){return _0x11b7a3[_0x9ed2('0x26')]()[_0x9ed2('0x25')](function(){_0x2a04b7[_0x9ed2('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f7328,_0x1c3de6){return function(_0x4beed2){if(!_0x4beed2){_0x1f7328[_0x9ed2('0x19')](0x194);}return _0x4beed2;};}function handleError(_0x270100,_0x4e82f3){_0x4e82f3=_0x4e82f3||0x1f4;return function(_0x323da3){logger['error'](_0x323da3['stack']);if(_0x323da3[_0x9ed2('0x27')]){delete _0x323da3['name'];}_0x270100[_0x9ed2('0x1a')](_0x4e82f3)['send'](_0x323da3);};}exports[_0x9ed2('0x28')]=function(_0x598861,_0x2d1df5){var _0x369474={},_0xf48ab2={},_0x3c6870={'count':0x0,'rows':[]};var _0x1399ff=_[_0x9ed2('0x29')](db[_0x9ed2('0x2a')][_0x9ed2('0x2b')],function(_0x388e09){return{'name':_0x388e09[_0x9ed2('0x2c')],'type':_0x388e09[_0x9ed2('0x2d')][_0x9ed2('0x2e')]};});_0xf48ab2[_0x9ed2('0x2f')]=_[_0x9ed2('0x29')](_0x1399ff,_0x9ed2('0x27'));_0xf48ab2[_0x9ed2('0x30')]=_[_0x9ed2('0x31')](_0x598861[_0x9ed2('0x30')]);_0xf48ab2[_0x9ed2('0x32')]=_[_0x9ed2('0x33')](_0xf48ab2['model'],_0xf48ab2['query']);_0x369474[_0x9ed2('0x34')]=_[_0x9ed2('0x33')](_0xf48ab2[_0x9ed2('0x2f')],qs[_0x9ed2('0x35')](_0x598861[_0x9ed2('0x30')][_0x9ed2('0x35')]));_0x369474[_0x9ed2('0x34')]=_0x369474[_0x9ed2('0x34')][_0x9ed2('0x36')]?_0x369474[_0x9ed2('0x34')]:_0xf48ab2['model'];if(!_0x598861[_0x9ed2('0x30')][_0x9ed2('0x37')](_0x9ed2('0x38'))){_0x369474[_0x9ed2('0x1f')]=qs[_0x9ed2('0x1f')](_0x598861[_0x9ed2('0x30')][_0x9ed2('0x1f')]);_0x369474[_0x9ed2('0x1c')]=qs[_0x9ed2('0x1c')](_0x598861[_0x9ed2('0x30')][_0x9ed2('0x1c')]);}_0x369474[_0x9ed2('0x39')]=qs[_0x9ed2('0x3a')](_0x598861['query'][_0x9ed2('0x3a')]);_0x369474['where']=qs[_0x9ed2('0x32')](_[_0x9ed2('0x3b')](_0x598861['query'],_0xf48ab2[_0x9ed2('0x32')]),_0x1399ff);if(_0x598861[_0x9ed2('0x30')]['filter']){_0x369474['where']=_['merge'](_0x369474[_0x9ed2('0x3c')],{'$or':_['map'](_0x1399ff,function(_0x20422e){if(_0x20422e['type']!=='VIRTUAL'){var _0x5f00a1={};_0x5f00a1[_0x20422e[_0x9ed2('0x27')]]={'$like':'%'+_0x598861[_0x9ed2('0x30')]['filter']+'%'};return _0x5f00a1;}})});}_0x369474=_['merge']({},_0x369474,_0x598861[_0x9ed2('0x3d')]);var _0x587dde={'where':_0x369474[_0x9ed2('0x3c')]};return db['SmsApplication']['count'](_0x587dde)[_0x9ed2('0x25')](function(_0x19bfa9){_0x3c6870['count']=_0x19bfa9;if(_0x598861[_0x9ed2('0x30')]['includeAll']){_0x369474['include']=[{'all':!![]}];}return db[_0x9ed2('0x2a')]['findAll'](_0x369474);})[_0x9ed2('0x25')](function(_0x1ec47b){_0x3c6870[_0x9ed2('0x3e')]=_0x1ec47b;return _0x3c6870;})[_0x9ed2('0x25')](respondWithFilteredResult(_0x2d1df5,_0x369474))['catch'](handleError(_0x2d1df5,null));};exports[_0x9ed2('0x3f')]=function(_0x4ee448,_0x5d482f){var _0x310827={'raw':!![],'where':{'id':_0x4ee448['params']['id']}},_0x2fe03f={};_0x2fe03f['model']=_[_0x9ed2('0x31')](db[_0x9ed2('0x2a')][_0x9ed2('0x2b')]);_0x2fe03f[_0x9ed2('0x30')]=_[_0x9ed2('0x31')](_0x4ee448[_0x9ed2('0x30')]);_0x2fe03f[_0x9ed2('0x32')]=_['intersection'](_0x2fe03f['model'],_0x2fe03f[_0x9ed2('0x30')]);_0x310827['attributes']=_[_0x9ed2('0x33')](_0x2fe03f[_0x9ed2('0x2f')],qs['fields'](_0x4ee448[_0x9ed2('0x30')][_0x9ed2('0x35')]));_0x310827[_0x9ed2('0x34')]=_0x310827[_0x9ed2('0x34')]['length']?_0x310827[_0x9ed2('0x34')]:_0x2fe03f[_0x9ed2('0x2f')];if(_0x4ee448[_0x9ed2('0x30')][_0x9ed2('0x40')]){_0x310827[_0x9ed2('0x41')]=[{'all':!![]}];}_0x310827=_[_0x9ed2('0x42')]({},_0x310827,_0x4ee448[_0x9ed2('0x3d')]);return db[_0x9ed2('0x2a')][_0x9ed2('0x43')](_0x310827)[_0x9ed2('0x25')](handleEntityNotFound(_0x5d482f,null))[_0x9ed2('0x25')](respondWithResult(_0x5d482f,null))[_0x9ed2('0x44')](handleError(_0x5d482f,null));};exports[_0x9ed2('0x45')]=function(_0x5e5100,_0x5718b9){return db[_0x9ed2('0x2a')][_0x9ed2('0x45')](_0x5e5100['body'],{})['then'](respondWithResult(_0x5718b9,0xc9))['catch'](handleError(_0x5718b9,null));};exports[_0x9ed2('0x24')]=function(_0xb1c486,_0x11dd3d){if(_0xb1c486[_0x9ed2('0x46')]['id']){delete _0xb1c486[_0x9ed2('0x46')]['id'];}return db[_0x9ed2('0x2a')][_0x9ed2('0x43')]({'where':{'id':_0xb1c486[_0x9ed2('0x47')]['id']}})['then'](handleEntityNotFound(_0x11dd3d,null))[_0x9ed2('0x25')](saveUpdates(_0xb1c486['body'],null))[_0x9ed2('0x25')](respondWithResult(_0x11dd3d,null))[_0x9ed2('0x44')](handleError(_0x11dd3d,null));};exports[_0x9ed2('0x26')]=function(_0x11bf1e,_0x1d944c){return db[_0x9ed2('0x2a')][_0x9ed2('0x43')]({'where':{'id':_0x11bf1e[_0x9ed2('0x47')]['id']}})[_0x9ed2('0x25')](handleEntityNotFound(_0x1d944c,null))[_0x9ed2('0x25')](removeEntity(_0x1d944c,null))['catch'](handleError(_0x1d944c,null));}; \ No newline at end of file +var _0x8e4c=['apply','reject','save','update','then','error','stack','name','index','map','SmsApplication','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json'];(function(_0x570435,_0x3fd1bb){var _0x5084c1=function(_0x29ab8a){while(--_0x29ab8a){_0x570435['push'](_0x570435['shift']());}};_0x5084c1(++_0x3fd1bb);}(_0x8e4c,0x14b));var _0xc8e4=function(_0x5de1bc,_0x434be1){_0x5de1bc=_0x5de1bc-0x0;var _0x19f4b8=_0x8e4c[_0x5de1bc];return _0x19f4b8;};'use strict';var emlformat=require(_0xc8e4('0x0'));var rimraf=require(_0xc8e4('0x1'));var zipdir=require(_0xc8e4('0x2'));var jsonpatch=require(_0xc8e4('0x3'));var rp=require('request-promise');var moment=require(_0xc8e4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc8e4('0x5'));var util=require(_0xc8e4('0x6'));var path=require(_0xc8e4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc8e4('0x8'));var _=require(_0xc8e4('0x9'));var squel=require(_0xc8e4('0xa'));var crypto=require(_0xc8e4('0xb'));var jsforce=require(_0xc8e4('0xc'));var deskjs=require(_0xc8e4('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(_0xc8e4('0xe'));var as=require(_0xc8e4('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc8e4('0x10'));var utils=require(_0xc8e4('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xc8e4('0x12'));var db=require(_0xc8e4('0x13'))['db'];function respondWithStatusCode(_0x3a1b01,_0x9a66de){_0x9a66de=_0x9a66de||0xcc;return function(_0x33d99d){if(_0x33d99d){return _0x3a1b01[_0xc8e4('0x14')](_0x9a66de);}return _0x3a1b01[_0xc8e4('0x15')](_0x9a66de)[_0xc8e4('0x16')]();};}function respondWithResult(_0xdb5fec,_0x2ff103){_0x2ff103=_0x2ff103||0xc8;return function(_0x47b5b8){if(_0x47b5b8){return _0xdb5fec[_0xc8e4('0x15')](_0x2ff103)['json'](_0x47b5b8);}};}function respondWithFilteredResult(_0x58c8da,_0x2b089f){return function(_0x452906){if(_0x452906){var _0x45b5f7=typeof _0x2b089f[_0xc8e4('0x17')]===_0xc8e4('0x18')&&typeof _0x2b089f[_0xc8e4('0x19')]==='undefined';var _0x3fb80a=_0x452906[_0xc8e4('0x1a')];var _0xe62ec8=_0x45b5f7?0x0:_0x2b089f[_0xc8e4('0x17')];var _0x501f56=_0x45b5f7?_0x452906['count']:_0x2b089f[_0xc8e4('0x17')]+_0x2b089f[_0xc8e4('0x19')];var _0x1c2278;if(_0x501f56>=_0x3fb80a){_0x501f56=_0x3fb80a;_0x1c2278=0xc8;}else{_0x1c2278=0xce;}_0x58c8da[_0xc8e4('0x15')](_0x1c2278);return _0x58c8da[_0xc8e4('0x1b')]('Content-Range',_0xe62ec8+'-'+_0x501f56+'/'+_0x3fb80a)[_0xc8e4('0x1c')](_0x452906);}return null;};}function patchUpdates(_0x35fba7){return function(_0x2c4344){try{jsonpatch[_0xc8e4('0x1d')](_0x2c4344,_0x35fba7,!![]);}catch(_0x2d6d24){return BPromise[_0xc8e4('0x1e')](_0x2d6d24);}return _0x2c4344[_0xc8e4('0x1f')]();};}function saveUpdates(_0x4ebc67,_0x126593){return function(_0xf43699){if(_0xf43699){return _0xf43699[_0xc8e4('0x20')](_0x4ebc67)[_0xc8e4('0x21')](function(_0x2d555b){return _0x2d555b;});}return null;};}function removeEntity(_0x37bfc4,_0x242fd3){return function(_0x5123b0){if(_0x5123b0){return _0x5123b0['destroy']()['then'](function(){_0x37bfc4[_0xc8e4('0x15')](0xcc)[_0xc8e4('0x16')]();});}};}function handleEntityNotFound(_0xbb65f1,_0x338488){return function(_0xd4d1c5){if(!_0xd4d1c5){_0xbb65f1[_0xc8e4('0x14')](0x194);}return _0xd4d1c5;};}function handleError(_0xa9a5a2,_0x314221){_0x314221=_0x314221||0x1f4;return function(_0x160078){logger[_0xc8e4('0x22')](_0x160078[_0xc8e4('0x23')]);if(_0x160078[_0xc8e4('0x24')]){delete _0x160078[_0xc8e4('0x24')];}_0xa9a5a2['status'](_0x314221)['send'](_0x160078);};}exports[_0xc8e4('0x25')]=function(_0x206d63,_0x5d41fe){var _0xebd4c9={},_0x3cba92={},_0x222073={'count':0x0,'rows':[]};var _0x57057f=_[_0xc8e4('0x26')](db[_0xc8e4('0x27')]['rawAttributes'],function(_0x3da6fb){return{'name':_0x3da6fb[_0xc8e4('0x28')],'type':_0x3da6fb[_0xc8e4('0x29')][_0xc8e4('0x2a')]};});_0x3cba92[_0xc8e4('0x2b')]=_[_0xc8e4('0x26')](_0x57057f,'name');_0x3cba92['query']=_[_0xc8e4('0x2c')](_0x206d63['query']);_0x3cba92[_0xc8e4('0x2d')]=_[_0xc8e4('0x2e')](_0x3cba92[_0xc8e4('0x2b')],_0x3cba92[_0xc8e4('0x2f')]);_0xebd4c9[_0xc8e4('0x30')]=_[_0xc8e4('0x2e')](_0x3cba92[_0xc8e4('0x2b')],qs[_0xc8e4('0x31')](_0x206d63[_0xc8e4('0x2f')][_0xc8e4('0x31')]));_0xebd4c9[_0xc8e4('0x30')]=_0xebd4c9[_0xc8e4('0x30')][_0xc8e4('0x32')]?_0xebd4c9['attributes']:_0x3cba92[_0xc8e4('0x2b')];if(!_0x206d63[_0xc8e4('0x2f')][_0xc8e4('0x33')](_0xc8e4('0x34'))){_0xebd4c9[_0xc8e4('0x19')]=qs['limit'](_0x206d63[_0xc8e4('0x2f')][_0xc8e4('0x19')]);_0xebd4c9[_0xc8e4('0x17')]=qs['offset'](_0x206d63[_0xc8e4('0x2f')][_0xc8e4('0x17')]);}_0xebd4c9[_0xc8e4('0x35')]=qs['sort'](_0x206d63[_0xc8e4('0x2f')]['sort']);_0xebd4c9[_0xc8e4('0x36')]=qs[_0xc8e4('0x2d')](_[_0xc8e4('0x37')](_0x206d63[_0xc8e4('0x2f')],_0x3cba92[_0xc8e4('0x2d')]),_0x57057f);if(_0x206d63[_0xc8e4('0x2f')][_0xc8e4('0x38')]){_0xebd4c9[_0xc8e4('0x36')]=_[_0xc8e4('0x39')](_0xebd4c9[_0xc8e4('0x36')],{'$or':_['map'](_0x57057f,function(_0x2439e6){if(_0x2439e6['type']!==_0xc8e4('0x3a')){var _0x1d221c={};_0x1d221c[_0x2439e6[_0xc8e4('0x24')]]={'$like':'%'+_0x206d63[_0xc8e4('0x2f')][_0xc8e4('0x38')]+'%'};return _0x1d221c;}})});}_0xebd4c9=_[_0xc8e4('0x39')]({},_0xebd4c9,_0x206d63['options']);var _0x1bc00c={'where':_0xebd4c9[_0xc8e4('0x36')]};return db[_0xc8e4('0x27')][_0xc8e4('0x1a')](_0x1bc00c)[_0xc8e4('0x21')](function(_0x2c5797){_0x222073['count']=_0x2c5797;if(_0x206d63['query'][_0xc8e4('0x3b')]){_0xebd4c9[_0xc8e4('0x3c')]=[{'all':!![]}];}return db['SmsApplication'][_0xc8e4('0x3d')](_0xebd4c9);})[_0xc8e4('0x21')](function(_0x3a82f9){_0x222073[_0xc8e4('0x3e')]=_0x3a82f9;return _0x222073;})[_0xc8e4('0x21')](respondWithFilteredResult(_0x5d41fe,_0xebd4c9))[_0xc8e4('0x3f')](handleError(_0x5d41fe,null));};exports[_0xc8e4('0x40')]=function(_0x46afb2,_0x1fd6e6){var _0x292782={'raw':!![],'where':{'id':_0x46afb2[_0xc8e4('0x41')]['id']}},_0x25a319={};_0x25a319['model']=_[_0xc8e4('0x2c')](db['SmsApplication'][_0xc8e4('0x42')]);_0x25a319[_0xc8e4('0x2f')]=_[_0xc8e4('0x2c')](_0x46afb2[_0xc8e4('0x2f')]);_0x25a319[_0xc8e4('0x2d')]=_[_0xc8e4('0x2e')](_0x25a319[_0xc8e4('0x2b')],_0x25a319[_0xc8e4('0x2f')]);_0x292782[_0xc8e4('0x30')]=_[_0xc8e4('0x2e')](_0x25a319[_0xc8e4('0x2b')],qs[_0xc8e4('0x31')](_0x46afb2[_0xc8e4('0x2f')][_0xc8e4('0x31')]));_0x292782[_0xc8e4('0x30')]=_0x292782['attributes'][_0xc8e4('0x32')]?_0x292782[_0xc8e4('0x30')]:_0x25a319['model'];if(_0x46afb2[_0xc8e4('0x2f')][_0xc8e4('0x3b')]){_0x292782[_0xc8e4('0x3c')]=[{'all':!![]}];}_0x292782=_[_0xc8e4('0x39')]({},_0x292782,_0x46afb2[_0xc8e4('0x43')]);return db[_0xc8e4('0x27')][_0xc8e4('0x44')](_0x292782)[_0xc8e4('0x21')](handleEntityNotFound(_0x1fd6e6,null))[_0xc8e4('0x21')](respondWithResult(_0x1fd6e6,null))[_0xc8e4('0x3f')](handleError(_0x1fd6e6,null));};exports[_0xc8e4('0x45')]=function(_0xbd1e7d,_0x16b04d){return db[_0xc8e4('0x27')][_0xc8e4('0x45')](_0xbd1e7d[_0xc8e4('0x46')],{})[_0xc8e4('0x21')](respondWithResult(_0x16b04d,0xc9))[_0xc8e4('0x3f')](handleError(_0x16b04d,null));};exports['update']=function(_0x218305,_0x5ebb94){if(_0x218305[_0xc8e4('0x46')]['id']){delete _0x218305[_0xc8e4('0x46')]['id'];}return db[_0xc8e4('0x27')][_0xc8e4('0x44')]({'where':{'id':_0x218305[_0xc8e4('0x41')]['id']}})[_0xc8e4('0x21')](handleEntityNotFound(_0x5ebb94,null))[_0xc8e4('0x21')](saveUpdates(_0x218305[_0xc8e4('0x46')],null))[_0xc8e4('0x21')](respondWithResult(_0x5ebb94,null))[_0xc8e4('0x3f')](handleError(_0x5ebb94,null));};exports[_0xc8e4('0x47')]=function(_0x8cf989,_0x9c0c63){return db[_0xc8e4('0x27')][_0xc8e4('0x44')]({'where':{'id':_0x8cf989['params']['id']}})[_0xc8e4('0x21')](handleEntityNotFound(_0x9c0c63,null))[_0xc8e4('0x21')](removeEntity(_0x9c0c63,null))['catch'](handleError(_0x9c0c63,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index d4c4e09..5b79c54 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 _0x8981=['./smsApplication.attributes','exports','define','SmsApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x8981,0x76));var _0x1898=function(_0x37544f,_0x20c0e9){_0x37544f=_0x37544f-0x0;var _0x51524b=_0x8981[_0x37544f];return _0x51524b;};'use strict';var _=require(_0x1898('0x0'));var util=require(_0x1898('0x1'));var logger=require(_0x1898('0x2'))(_0x1898('0x3'));var moment=require(_0x1898('0x4'));var BPromise=require('bluebird');var rp=require(_0x1898('0x5'));var fs=require('fs');var path=require(_0x1898('0x6'));var rimraf=require(_0x1898('0x7'));var config=require('../../config/environment');var attributes=require(_0x1898('0x8'));module[_0x1898('0x9')]=function(_0x383f1b,_0x3ad793){return _0x383f1b[_0x1898('0xa')](_0x1898('0xb'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1898('0xc'),'collate':_0x1898('0xd')});}; \ No newline at end of file +var _0x9438=['request-promise','path','rimraf','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x44ab8c,_0x185623){var _0x360567=function(_0x751c63){while(--_0x751c63){_0x44ab8c['push'](_0x44ab8c['shift']());}};_0x360567(++_0x185623);}(_0x9438,0x1cb));var _0x8943=function(_0x34633b,_0x1c5d92){_0x34633b=_0x34633b-0x0;var _0xa34f3d=_0x9438[_0x34633b];return _0xa34f3d;};'use strict';var _=require(_0x8943('0x0'));var util=require(_0x8943('0x1'));var logger=require(_0x8943('0x2'))(_0x8943('0x3'));var moment=require(_0x8943('0x4'));var BPromise=require(_0x8943('0x5'));var rp=require(_0x8943('0x6'));var fs=require('fs');var path=require(_0x8943('0x7'));var rimraf=require(_0x8943('0x8'));var config=require('../../config/environment');var attributes=require('./smsApplication.attributes');module[_0x8943('0x9')]=function(_0x240579,_0x505e2a){return _0x240579[_0x8943('0xa')](_0x8943('0xb'),attributes,{'tableName':_0x8943('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8943('0xd'),'collate':_0x8943('0xe')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index a55308c..059c7fd 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 _0x7804=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http','info','SmsApplication,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch'];(function(_0x33c157,_0x3cfc90){var _0xeff135=function(_0x179928){while(--_0x179928){_0x33c157['push'](_0x33c157['shift']());}};_0xeff135(++_0x3cfc90);}(_0x7804,0xc3));var _0x4780=function(_0x1e99a4,_0x474d90){_0x1e99a4=_0x1e99a4-0x0;var _0x40f4d8=_0x7804[_0x1e99a4];return _0x40f4d8;};'use strict';var _=require(_0x4780('0x0'));var util=require('util');var moment=require(_0x4780('0x1'));var BPromise=require(_0x4780('0x2'));var rs=require(_0x4780('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4780('0x4'))['db'];var utils=require(_0x4780('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4780('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4780('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x36df6b,_0x9cd1a1,_0x19356d){return new BPromise(function(_0x5dbc26,_0x2ba140){return client['request'](_0x36df6b,_0x19356d)['then'](function(_0x299992){logger[_0x4780('0x8')](_0x4780('0x9'),_0x9cd1a1,_0x4780('0xa'));logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0x9cd1a1,_0x4780('0xa'),JSON[_0x4780('0xb')](_0x299992));if(_0x299992[_0x4780('0xc')]){if(_0x299992['error']['code']===0x1f4){logger[_0x4780('0xc')](_0x4780('0x9'),_0x9cd1a1,_0x299992[_0x4780('0xc')][_0x4780('0xd')]);return _0x2ba140(_0x299992[_0x4780('0xc')]['message']);}logger['error'](_0x4780('0x9'),_0x9cd1a1,_0x299992['error'][_0x4780('0xd')]);return _0x5dbc26(_0x299992[_0x4780('0xc')][_0x4780('0xd')]);}else{logger[_0x4780('0x8')]('SmsApplication,\x20%s,\x20%s',_0x9cd1a1,_0x4780('0xa'));_0x5dbc26(_0x299992['result'][_0x4780('0xd')]);}})[_0x4780('0xe')](function(_0x522b0f){logger[_0x4780('0xc')]('SmsApplication,\x20%s,\x20%s',_0x9cd1a1,_0x522b0f);_0x2ba140(_0x522b0f);});});} \ No newline at end of file +var _0x1921=['rpc','../../config/environment','jayson/promise','client','request','then','info','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1921,0xf2));var _0x1192=function(_0x4bf649,_0x285041){_0x4bf649=_0x4bf649-0x0;var _0x216f4c=_0x1921[_0x4bf649];return _0x216f4c;};'use strict';var _=require(_0x1192('0x0'));var util=require('util');var moment=require(_0x1192('0x1'));var BPromise=require(_0x1192('0x2'));var rs=require(_0x1192('0x3'));var fs=require('fs');var Redis=require(_0x1192('0x4'));var db=require(_0x1192('0x5'))['db'];var utils=require(_0x1192('0x6'));var logger=require(_0x1192('0x7'))(_0x1192('0x8'));var config=require(_0x1192('0x9'));var jayson=require(_0x1192('0xa'));var client=jayson[_0x1192('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56989b,_0x350776,_0x1df881){return new BPromise(function(_0x19ed6f,_0x2d7ae4){return client[_0x1192('0xc')](_0x56989b,_0x1df881)[_0x1192('0xd')](function(_0x1fc22e){logger[_0x1192('0xe')]('SmsApplication,\x20%s,\x20%s',_0x350776,'request\x20sent');logger[_0x1192('0xf')](_0x1192('0x10'),_0x350776,_0x1192('0x11'),JSON[_0x1192('0x12')](_0x1fc22e));if(_0x1fc22e[_0x1192('0x13')]){if(_0x1fc22e[_0x1192('0x13')][_0x1192('0x14')]===0x1f4){logger['error'](_0x1192('0x15'),_0x350776,_0x1fc22e['error'][_0x1192('0x16')]);return _0x2d7ae4(_0x1fc22e[_0x1192('0x13')]['message']);}logger[_0x1192('0x13')](_0x1192('0x15'),_0x350776,_0x1fc22e[_0x1192('0x13')]['message']);return _0x19ed6f(_0x1fc22e[_0x1192('0x13')][_0x1192('0x16')]);}else{logger['info'](_0x1192('0x15'),_0x350776,_0x1192('0x11'));_0x19ed6f(_0x1fc22e[_0x1192('0x17')]['message']);}})[_0x1192('0x18')](function(_0x5ed569){logger[_0x1192('0x13')](_0x1192('0x15'),_0x350776,_0x5ed569);_0x2d7ae4(_0x5ed569);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 5bfb1f5..4e51ef7 100644 --- a/server/api/smsInteraction/index.js +++ b/server/api/smsInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','smsinteraction:update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer'];(function(_0x1e6813,_0x1c1ba0){var _0x3f7013=function(_0x186474){while(--_0x186474){_0x1e6813['push'](_0x1e6813['shift']());}};_0x3f7013(++_0x1c1ba0);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./smsInteraction.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x9')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x9')]('/:id/download',auth[_0x0d8b('0x7')](),controller['download']);router[_0x0d8b('0xf')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x10')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);router[_0x0d8b('0xf')](_0x0d8b('0x12'),auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0x13')](_0x0d8b('0x14'),_0x0d8b('0x15')),controller[_0x0d8b('0x16')]);router['put'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0x13')](_0x0d8b('0x14'),_0x0d8b('0x17')),controller['update']);router[_0x0d8b('0x18')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0x13')](_0x0d8b('0x14'),_0x0d8b('0x19')),controller[_0x0d8b('0x1a')]);router[_0x0d8b('0x18')]('/:id/tags',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x1b')]);module[_0x0d8b('0x1c')]=router; \ No newline at end of file +var _0x1775=['/:id','show','getMessages','/:id/download','download','create','post','/:id/messages','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','delete','smsinteraction:destroy','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1775,0x1db));var _0x5177=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x1775[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0x5177('0x0'));var path=require(_0x5177('0x1'));var timeout=require(_0x5177('0x2'));var express=require(_0x5177('0x3'));var router=express[_0x5177('0x4')]();var fs_extra=require(_0x5177('0x5'));var auth=require(_0x5177('0x6'));var interaction=require(_0x5177('0x7'));var config=require(_0x5177('0x8'));var controller=require(_0x5177('0x9'));router[_0x5177('0xa')]('/',auth[_0x5177('0xb')](),controller[_0x5177('0xc')]);router[_0x5177('0xa')](_0x5177('0xd'),auth[_0x5177('0xb')](),controller[_0x5177('0xe')]);router[_0x5177('0xa')](_0x5177('0xf'),auth[_0x5177('0xb')](),controller[_0x5177('0x10')]);router[_0x5177('0xa')]('/:id/messages',auth['isAuthenticated'](),controller[_0x5177('0x11')]);router[_0x5177('0xa')](_0x5177('0x12'),auth[_0x5177('0xb')](),controller[_0x5177('0x13')]);router['post']('/',auth[_0x5177('0xb')](),controller[_0x5177('0x14')]);router[_0x5177('0x15')](_0x5177('0x16'),auth[_0x5177('0xb')](),controller[_0x5177('0x17')]);router[_0x5177('0x15')](_0x5177('0x18'),auth[_0x5177('0xb')](),interaction[_0x5177('0x19')](_0x5177('0x1a'),_0x5177('0x1b')),controller[_0x5177('0x1c')]);router[_0x5177('0x1d')](_0x5177('0xf'),auth[_0x5177('0xb')](),interaction[_0x5177('0x19')](_0x5177('0x1a'),_0x5177('0x1e')),controller['update']);router[_0x5177('0x1f')](_0x5177('0xf'),auth[_0x5177('0xb')](),interaction[_0x5177('0x19')]('sms',_0x5177('0x20')),controller[_0x5177('0x21')]);router[_0x5177('0x1f')]('/:id/tags',auth[_0x5177('0xb')](),controller['removeTags']);module[_0x5177('0x22')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 25bbdc5..3882370 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 _0x4ce6=['sequelize','exports','BOOLEAN','DATE','STRING','out'];(function(_0x24bca5,_0x507dd0){var _0x27a181=function(_0x43de3f){while(--_0x43de3f){_0x24bca5['push'](_0x24bca5['shift']());}};_0x27a181(++_0x507dd0);}(_0x4ce6,0x108));var _0x64ce=function(_0x3da707,_0x30c36d){_0x3da707=_0x3da707-0x0;var _0x342ee7=_0x4ce6[_0x3da707];return _0x342ee7;};'use strict';var Sequelize=require(_0x64ce('0x0'));var moment=require('moment');module[_0x64ce('0x1')]={'closed':{'type':Sequelize[_0x64ce('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x64ce('0x3')]},'disposition':{'type':Sequelize[_0x64ce('0x4')]},'secondDisposition':{'type':Sequelize[_0x64ce('0x4')]},'thirdDisposition':{'type':Sequelize[_0x64ce('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x64ce('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x64ce('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x64ce('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x64ce('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x64ce('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x13fe=['sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x5609d9,_0x1ddb0e){var _0x287b84=function(_0x39c3d4){while(--_0x39c3d4){_0x5609d9['push'](_0x5609d9['shift']());}};_0x287b84(++_0x1ddb0e);}(_0x13fe,0x138));var _0xe13f=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x13fe[_0x4fc9e6];return _0x551d28;};'use strict';var Sequelize=require(_0xe13f('0x0'));var moment=require(_0xe13f('0x1'));module[_0xe13f('0x2')]={'closed':{'type':Sequelize[_0xe13f('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe13f('0x4')]},'disposition':{'type':Sequelize[_0xe13f('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xe13f('0x5')]},'note':{'type':Sequelize[_0xe13f('0x5')]},'phone':{'type':Sequelize[_0xe13f('0x5')]},'read1stAt':{'type':Sequelize[_0xe13f('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xe13f('0x6')]('in',_0xe13f('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe13f('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xe13f('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 2ebc290..ad3e5ec 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 _0xf756=['length','hasOwnProperty','nolimit','order','sort','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','o.id\x20=\x20i.UserId','sms_accounts','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','find','unreadMessages','value','having','`\x20>\x200','operator','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','text','start','Tag','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','SmsAccountId','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','where','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','getSmsAccounts','isEmpty','i.SmsAccountId\x20IN\x20?','role','sequelize','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','params','includeAll','include','options','catch','create','destroy','addMessage','ids','omit','$gte','format','SmsMessage','findAll','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','unix','server','files','tmp','join','root','transcript-%d-%s.zip','push','CmContact','Contact','firstName','lastName','Messages','direction','secret','SmsAccount','Account','Owner','get','mkdirSync','Sms','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','out','renderFile','views','download','log','err','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','path','to-csv','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','end','error','name','send','Users','map','fullname','TagIds','forEach','Tags','then','index','SmsInteraction','rawAttributes','type','key','query','keys','intersection','model','attributes','fields'];(function(_0x82d330,_0x3040b0){var _0x39b5c5=function(_0x508f3e){while(--_0x508f3e){_0x82d330['push'](_0x82d330['shift']());}};_0x39b5c5(++_0x3040b0);}(_0xf756,0x18e));var _0x6f75=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xf756[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x6f75('0x0'));var rimraf=require(_0x6f75('0x1'));var zipdir=require(_0x6f75('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6f75('0x3'));var BPromise=require(_0x6f75('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6f75('0x5'));var sox=require('sox');var csv=require(_0x6f75('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6f75('0x7'));var crypto=require(_0x6f75('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x6f75('0x9'));var toCsv=require(_0x6f75('0x6'));var querystring=require('querystring');var Papa=require(_0x6f75('0xa'));var Redis=require('ioredis');var authService=require(_0x6f75('0xb'));var qs=require(_0x6f75('0xc'));var as=require(_0x6f75('0xd'));var pdf=require(_0x6f75('0xe'));var hardwareService=require(_0x6f75('0xf'));var logger=require(_0x6f75('0x10'))('api');var utils=require(_0x6f75('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x6f75('0x12'));var db=require(_0x6f75('0x13'))['db'];config[_0x6f75('0x14')]=_[_0x6f75('0x15')](config['redis'],{'host':_0x6f75('0x16'),'port':0x18eb});var socket=require(_0x6f75('0x17'))(new Redis(config[_0x6f75('0x14')]));require(_0x6f75('0x18'))[_0x6f75('0x19')](socket);function respondWithStatusCode(_0x2a5623,_0x25a7bf){_0x25a7bf=_0x25a7bf||0xcc;return function(_0x1e582f){if(_0x1e582f){return _0x2a5623[_0x6f75('0x1a')](_0x25a7bf);}return _0x2a5623[_0x6f75('0x1b')](_0x25a7bf)['end']();};}function respondWithResult(_0x1a7832,_0x289056){_0x289056=_0x289056||0xc8;return function(_0x53314d){if(_0x53314d){return _0x1a7832[_0x6f75('0x1b')](_0x289056)['json'](_0x53314d);}};}function respondWithFilteredResult(_0x563e08,_0x51f186){return function(_0x520c5a){if(_0x520c5a){var _0x38b847=typeof _0x51f186[_0x6f75('0x1c')]===_0x6f75('0x1d')&&typeof _0x51f186[_0x6f75('0x1e')]==='undefined';var _0xf7bb00=_0x520c5a['count'];var _0xa58f38=_0x38b847?0x0:_0x51f186[_0x6f75('0x1c')];var _0x54b905=_0x38b847?_0x520c5a[_0x6f75('0x1f')]:_0x51f186['offset']+_0x51f186[_0x6f75('0x1e')];var _0x1b930d;if(_0x54b905>=_0xf7bb00){_0x54b905=_0xf7bb00;_0x1b930d=0xc8;}else{_0x1b930d=0xce;}_0x563e08[_0x6f75('0x1b')](_0x1b930d);return _0x563e08[_0x6f75('0x20')](_0x6f75('0x21'),_0xa58f38+'-'+_0x54b905+'/'+_0xf7bb00)['json'](_0x520c5a);}return null;};}function patchUpdates(_0x1af3e8){return function(_0x2357ed){try{jsonpatch[_0x6f75('0x22')](_0x2357ed,_0x1af3e8,!![]);}catch(_0x10ad99){return BPromise[_0x6f75('0x23')](_0x10ad99);}return _0x2357ed[_0x6f75('0x24')]();};}function saveUpdates(_0x28170e,_0x398866){return function(_0x2a9c9f){if(_0x2a9c9f){return _0x2a9c9f[_0x6f75('0x25')](_0x28170e)['then'](function(_0x9ae8bd){return _0x9ae8bd;});}return null;};}function removeEntity(_0x9f843d,_0x17409b){return function(_0x51e9ce){if(_0x51e9ce){return _0x51e9ce['destroy']()['then'](function(){_0x9f843d[_0x6f75('0x1b')](0xcc)[_0x6f75('0x26')]();});}};}function handleEntityNotFound(_0x259909,_0x46e81e){return function(_0x17ab1c){if(!_0x17ab1c){_0x259909[_0x6f75('0x1a')](0x194);}return _0x17ab1c;};}function handleError(_0x778e28,_0x41dd6e){_0x41dd6e=_0x41dd6e||0x1f4;return function(_0x18f641){logger[_0x6f75('0x27')](_0x18f641['stack']);if(_0x18f641[_0x6f75('0x28')]){delete _0x18f641['name'];}_0x778e28[_0x6f75('0x1b')](_0x41dd6e)[_0x6f75('0x29')](_0x18f641);};}function getInteractionUsers(_0x186989,_0x3f186f){return new BPromise(function(_0x544cf6,_0x5ed6cd){try{if(_0x3f186f[_0x186989['id']]){_0x186989[_0x6f75('0x2a')]=_[_0x6f75('0x2b')](_0x3f186f[_0x186989['id']],function(_0x178b4c){return{'id':_0x178b4c['id'],'fullname':_0x178b4c[_0x6f75('0x2c')]};});}}catch(_0x2db41a){_0x5ed6cd(_0x2db41a);}_0x544cf6(_0x186989);});}function getInteractionTags(_0x2beb5a,_0x1262aa){return new BPromise(function(_0x11ad90,_0x10846d){try{if(_0x2beb5a[_0x6f75('0x2d')]){_0x2beb5a['Tags']=[];_0x2beb5a[_0x6f75('0x2d')]['split'](',')[_0x6f75('0x2e')](function(_0x201721){_0x2beb5a[_0x6f75('0x2f')]['push'](_0x1262aa[_0x201721]);});}delete _0x2beb5a[_0x6f75('0x2d')];}catch(_0x1aad3d){_0x10846d(_0x1aad3d);}_0x11ad90(_0x2beb5a);});}function updateSmsInteraction(_0x18ef88,_0x3f2318,_0x1d2a64){return new BPromise(function(_0x5c3b4a,_0x275c37){return getInteractionUsers(_0x18ef88,_0x1d2a64)[_0x6f75('0x30')](function(_0x31a5af){return getInteractionTags(_0x31a5af,_0x3f2318);})[_0x6f75('0x30')](function(_0x1bc8d1){_0x5c3b4a(_0x1bc8d1);})['catch'](function(_0x415e1c){_0x275c37(_0x415e1c);});});}exports[_0x6f75('0x31')]=function(_0xe3fac,_0x1252c5){var _0x161c5a={},_0x4bf3cb={},_0x1ea4c9={'count':0x0,'rows':[]};var _0x1dacab=_[_0x6f75('0x2b')](db[_0x6f75('0x32')][_0x6f75('0x33')],function(_0x209d69){return{'name':_0x209d69['fieldName'],'type':_0x209d69[_0x6f75('0x34')][_0x6f75('0x35')]};});_0x4bf3cb['model']=_['map'](_0x1dacab,_0x6f75('0x28'));_0x4bf3cb[_0x6f75('0x36')]=_[_0x6f75('0x37')](_0xe3fac[_0x6f75('0x36')]);_0x4bf3cb['filters']=_[_0x6f75('0x38')](_0x4bf3cb[_0x6f75('0x39')],_0x4bf3cb[_0x6f75('0x36')]);_0x161c5a[_0x6f75('0x3a')]=_[_0x6f75('0x38')](_0x4bf3cb['model'],qs[_0x6f75('0x3b')](_0xe3fac['query'][_0x6f75('0x3b')]));_0x161c5a[_0x6f75('0x3a')]=_0x161c5a[_0x6f75('0x3a')][_0x6f75('0x3c')]?_0x161c5a[_0x6f75('0x3a')]:_0x4bf3cb[_0x6f75('0x39')];if(!_0xe3fac['query'][_0x6f75('0x3d')](_0x6f75('0x3e'))){_0x161c5a[_0x6f75('0x1e')]=qs[_0x6f75('0x1e')](_0xe3fac[_0x6f75('0x36')][_0x6f75('0x1e')]);_0x161c5a['offset']=qs[_0x6f75('0x1c')](_0xe3fac[_0x6f75('0x36')][_0x6f75('0x1c')]);}_0x161c5a[_0x6f75('0x3f')]=qs[_0x6f75('0x40')](_0xe3fac[_0x6f75('0x36')]['sort']);_0x161c5a['where']=qs[_0x6f75('0x41')](_[_0x6f75('0x42')](_0xe3fac['query'],_0x4bf3cb['filters']),_0x1dacab);var _0x24424b=[];var _0x9d5bd7=squel[_0x6f75('0x43')]()[_0x6f75('0x44')]('id')[_0x6f75('0x44')](_0x6f75('0x28'))[_0x6f75('0x44')](_0x6f75('0x45'))[_0x6f75('0x46')](_0x6f75('0x47'));var _0x2e46d3=squel[_0x6f75('0x43')]()[_0x6f75('0x44')](_0x6f75('0x48'))[_0x6f75('0x44')](_0x6f75('0x49'))['field']('ui.SmsInteractionId')[_0x6f75('0x46')](_0x6f75('0x4a'),'ui')[_0x6f75('0x4b')](_0x6f75('0x4c'),'u',_0x6f75('0x4d'));var _0x4f362f=squel['select']()[_0x6f75('0x46')](_0x6f75('0x4e'),'i')[_0x6f75('0x4b')](_0x6f75('0x4f'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x6f75('0x4b')]('users','o',_0x6f75('0x50'))[_0x6f75('0x4b')](_0x6f75('0x51'),'a','a.id\x20=\x20i.SmsAccountId')[_0x6f75('0x4b')](_0x6f75('0x52'),'me',_0x6f75('0x53'))[_0x6f75('0x4b')](_0x6f75('0x54'),'it',_0x6f75('0x55'))[_0x6f75('0x4b')]('tools_tags','t',_0x6f75('0x56'));var _0x155716=squel[_0x6f75('0x57')]();var _0x31491a=[];var _0x4df144=squel['expr']();var _0x464efd;if(_0xe3fac['query'][_0x6f75('0x58')]){_0x464efd=as[_0x6f75('0x59')](_0xe3fac[_0x6f75('0x36')][_0x6f75('0x58')]);var _0x1ce4fd=_0x464efd[_0x6f75('0x5a')];for(var _0x108019=0x0;_0x108019<_0x464efd[_0x6f75('0x5b')][_0x6f75('0x3c')];_0x108019++){var _0x546a17=_0x464efd[_0x6f75('0x5b')][_0x108019];var _0x206411='i';var _0x168e38=_[_0x6f75('0x5c')](_0x1dacab,[_0x6f75('0x28'),_0x546a17[_0x6f75('0x44')]]);if(!_0x168e38){switch(_0x546a17[_0x6f75('0x44')]){case _0x6f75('0x5d'):if(_0x546a17[_0x6f75('0x5e')]==0x1){_0x4f362f[_0x6f75('0x5f')]('`'+_0x546a17['field']+'`\x20=\x200');}else{_0x4f362f['having']('`'+_0x546a17[_0x6f75('0x44')]+_0x6f75('0x60'));}break;case'Contact':if(_0x546a17[_0x6f75('0x61')]==='$substring'){if(_0x546a17[_0x6f75('0x5e')][_0x6f75('0x62')]('\x20')[_0x6f75('0x3c')]>0x1){_0x155716[_0x1ce4fd](_0x6f75('0x63'),qs['getFullTextValue'](_0x546a17[_0x6f75('0x5e')]),null);}else{var _0x5a7437='%'+_0x546a17[_0x6f75('0x5e')]+'%';_0x155716[_0x1ce4fd](_0x6f75('0x64'),_0x5a7437,_0x5a7437,_0x5a7437);}}else{_0x168e38=_['find'](_0x1dacab,[_0x6f75('0x28'),'ContactId']);_0x546a17['field']=_0x6f75('0x65');_0xa9fab5=as[_0x6f75('0x66')](_0x206411,_0x168e38[_0x6f75('0x34')],_0x546a17);_0x155716[_0x1ce4fd](_0xa9fab5[_0x6f75('0x67')],_0xa9fab5[_0x6f75('0x5e')][_0x6f75('0x68')],_0xa9fab5[_0x6f75('0x5e')][_0x6f75('0x26')]);}break;case _0x6f75('0x69'):var _0x31422d=_0x546a17[_0x6f75('0x5e')][_0x6f75('0x62')](',')[_0x6f75('0x2b')](function(_0x4935d8){return Number(_0x4935d8);});_0x31422d[_0x6f75('0x2e')](function(_0x5d6819){_0x4df144['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5d6819+',%');});_0x31491a=_['union'](_0x31491a,_0x31422d);break;case _0x6f75('0x6a'):if(_0x546a17[_0x6f75('0x61')]===_0x6f75('0x6b')){_0x155716[_0x1ce4fd](_0x6f75('0x6c'),'%'+_0x546a17['value']+'%',null);}else{_0x168e38=_[_0x6f75('0x5c')](_0x1dacab,[_0x6f75('0x28'),_0x6f75('0x6d')]);_0x546a17['field']='UserId';_0xa9fab5=as[_0x6f75('0x66')](_0x206411,_0x168e38[_0x6f75('0x34')],_0x546a17);_0x155716[_0x1ce4fd](_0xa9fab5[_0x6f75('0x67')],_0xa9fab5[_0x6f75('0x5e')][_0x6f75('0x68')],_0xa9fab5['value']['end']);}break;case _0x6f75('0x6e'):_0xa9fab5=as[_0x6f75('0x66')]('me',null,_0x546a17);_0x155716[_0x1ce4fd](_0xa9fab5[_0x6f75('0x67')],_0xa9fab5[_0x6f75('0x5e')][_0x6f75('0x68')],_0xa9fab5[_0x6f75('0x5e')][_0x6f75('0x26')]);break;}}else{var _0xa9fab5=as[_0x6f75('0x66')](_0x206411,_0x168e38[_0x6f75('0x34')],_0x546a17);_0x155716[_0x1ce4fd](_0xa9fab5[_0x6f75('0x67')],_0xa9fab5['value'][_0x6f75('0x68')],_0xa9fab5[_0x6f75('0x5e')][_0x6f75('0x26')]);}}}else{var _0x59b73f=_(_0xe3fac['query'])[_0x6f75('0x37')]()[_0x6f75('0x2b')](function(_0x50848a){return _[_0x6f75('0x6f')](_0x1dacab,[_0x6f75('0x28'),_0x50848a])?_0x50848a:undefined;})[_0x6f75('0x70')]()[_0x6f75('0x5e')]();if(!_['isEmpty'](_0x59b73f)){_0x59b73f[_0x6f75('0x2e')](function(_0x251011){if(_0x251011===_0x6f75('0x71')){_0x4f362f['where']('i.SmsAccountId\x20IN\x20?',[]['concat'](_0xe3fac['query'][_0x251011]));}else if(_0x251011===_0x6f75('0x72')){var _0xf64e7d=JSON[_0x6f75('0x73')](_0xe3fac[_0x6f75('0x36')][_0x251011])['$gte'];var _0xa1d5d4=JSON[_0x6f75('0x73')](_0xe3fac[_0x6f75('0x36')][_0x251011])[_0x6f75('0x74')];_0x4f362f['where'](_0x6f75('0x75'),_0xf64e7d,_0xa1d5d4);}else{if(_0xe3fac[_0x6f75('0x36')][_0x251011]==='null'){_0x4f362f[_0x6f75('0x76')]('i.'+_0x251011+_0x6f75('0x77'));}else{_0x4f362f[_0x6f75('0x76')]('i.'+_0x251011+_0x6f75('0x78'),_0xe3fac['query'][_0x251011]);}}});}if(_0xe3fac[_0x6f75('0x36')][_0x6f75('0x79')]){if(_0xe3fac[_0x6f75('0x36')][_0x6f75('0x79')]==0x1){_0x4f362f[_0x6f75('0x5f')](_0x6f75('0x7a'));}else{_0x4f362f[_0x6f75('0x5f')](_0x6f75('0x7b'));}}if(_0xe3fac[_0x6f75('0x36')][_0x6f75('0x7c')]){_0x31491a=_[_0x6f75('0x7d')](_0xe3fac[_0x6f75('0x36')]['tag'])?_0xe3fac[_0x6f75('0x36')][_0x6f75('0x7c')]:new Array(_0xe3fac['query']['tag']);_0x31491a['forEach'](function(_0x4c18e9){_0x4df144['or'](_0x6f75('0x7e'),'%,'+_0x4c18e9+',%');});}if(_0xe3fac[_0x6f75('0x36')]['filter']){var _0x257cde=_0xe3fac[_0x6f75('0x36')][_0x6f75('0x7f')]['replace']('\x5c','\x5c\x5c')[_0x6f75('0x80')](/'/g,'\x27\x27');if(qs[_0x6f75('0x81')](_0x257cde)){_0x155716['or']('i.id\x20LIKE\x20?',_0x257cde+'%')['or'](_0x6f75('0x82'),_0x257cde+'%');}else{_0x155716['or'](_0x6f75('0x83'),qs[_0x6f75('0x84')](_0x257cde))['or'](_0x6f75('0x85'),_0x257cde+'%');}}}_0x4f362f[_0x6f75('0x76')](_0x155716);_0x4f362f['group'](_0x6f75('0x86'));var _0x4a8a3e={'type':db['Sequelize'][_0x6f75('0x87')][_0x6f75('0x88')],'raw':!![]};var _0x21f4e7=_0x4f362f['clone']();_0x21f4e7[_0x6f75('0x44')](_0x6f75('0x86'));_0x21f4e7[_0x6f75('0x44')](_0x6f75('0x89'),_0x6f75('0x5d'));if(_0x161c5a[_0x6f75('0x3f')]){_0x161c5a[_0x6f75('0x3f')][_0x6f75('0x2e')](function(_0x2a1370){var _0x1d132c=_0x2a1370[0x0]===_0x6f75('0x8a')?_0x2a1370[0x0]:'i.'+_0x2a1370[0x0];_0x4f362f[_0x6f75('0x3f')](_0x1d132c,_0x2a1370[0x1]===_0x6f75('0x8b')?![]:!![]);});}if(!_['isEmpty'](_0x31491a)){_0x4f362f[_0x6f75('0x5f')](_0x4df144);_0x21f4e7[_0x6f75('0x76')](_0x6f75('0x8c'),_0x31491a);}BPromise[_0x6f75('0x8d')]()[_0x6f75('0x30')](function(){if(!_0x464efd){if(_0xe3fac[_0x6f75('0x36')][_0x6f75('0x71')])return;_0x21f4e7['where'](_0x6f75('0x8e'));_0x4f362f[_0x6f75('0x76')](_0x6f75('0x8e'));return;}if(_0xe3fac[_0x6f75('0x8f')]['role']!=='agent')return;return _0xe3fac[_0x6f75('0x8f')][_0x6f75('0x90')]({'attributes':['id'],'raw':!![]})[_0x6f75('0x30')](function(_0x4b1be1){if(_[_0x6f75('0x91')](_0x4b1be1)){_0x21f4e7[_0x6f75('0x76')]('i.SmsAccountId\x20IS\x20NULL');_0x4f362f[_0x6f75('0x76')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x21f4e7['where'](_0x6f75('0x92'),_[_0x6f75('0x2b')](_0x4b1be1,'id'));_0x4f362f[_0x6f75('0x76')](_0x6f75('0x92'),_[_0x6f75('0x2b')](_0x4b1be1,'id'));}});})[_0x6f75('0x30')](function(){if(_0xe3fac[_0x6f75('0x8f')][_0x6f75('0x93')]==='agent'&&!_0x464efd&&!_0xe3fac[_0x6f75('0x36')][_0x6f75('0x71')])return[];return db[_0x6f75('0x94')]['query'](_0x21f4e7['toString'](),_0x4a8a3e);})['then'](function(_0x142ca9){_0x1ea4c9['count']=_0x142ca9[_0x6f75('0x3c')];if(_0x1ea4c9[_0x6f75('0x1f')]===0x0)return[];return db[_0x6f75('0x94')][_0x6f75('0x36')](_0x9d5bd7['toString'](),_0x4a8a3e)[_0x6f75('0x30')](function(_0xb24716){_0x24424b=_[_0x6f75('0x95')](_0xb24716,'id');_0x4a8a3e=_[_0x6f75('0x96')](_0x4a8a3e,{'model':db[_0x6f75('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xe3fac[_0x6f75('0x36')][_0x6f75('0x3b')]){_0x161c5a['attributes']['forEach'](function(_0x5451e6){_0x4f362f[_0x6f75('0x44')]('i.'+_0x5451e6);});}else{_0x4f362f[_0x6f75('0x44')](_0x6f75('0x89'),'unreadMessages');_0x4f362f[_0x6f75('0x44')](_0x6f75('0x97'),_0x6f75('0x98'));_0x4f362f['field']('a.mandatoryDisposition',_0x6f75('0x99'));_0x4f362f['field'](_0x6f75('0x9a'),_0x6f75('0x8a'));_0x4f362f[_0x6f75('0x44')](_0x6f75('0x9b'));_0x4f362f[_0x6f75('0x44')]('c.firstName',_0x6f75('0x9c'));_0x4f362f[_0x6f75('0x44')](_0x6f75('0x9d'),_0x6f75('0x9e'));_0x4f362f[_0x6f75('0x44')](_0x6f75('0x9f'),'Contact.email');_0x4f362f[_0x6f75('0x44')](_0x6f75('0xa0'),_0x6f75('0xa1'));_0x4f362f[_0x6f75('0x44')]('c.mobile',_0x6f75('0xa2'));_0x4f362f[_0x6f75('0x44')](_0x6f75('0xa3'),_0x6f75('0xa4'));_0x4f362f[_0x6f75('0x44')](_0x6f75('0xa5'),_0x6f75('0xa6'));_0x4f362f[_0x6f75('0x44')](_0x6f75('0xa7'),_0x6f75('0xa8'));_0x4f362f[_0x6f75('0x44')](_0x6f75('0xa9'),'TagIds');}if(_0x161c5a[_0x6f75('0x1e')])_0x4f362f[_0x6f75('0x1e')](_0x161c5a[_0x6f75('0x1e')]);if(_0x161c5a[_0x6f75('0x1c')])_0x4f362f[_0x6f75('0x1c')](_0x161c5a[_0x6f75('0x1c')]);return db[_0x6f75('0x94')][_0x6f75('0x36')](_0x4f362f[_0x6f75('0xaa')](),_0x4a8a3e);})['then'](function(_0x146243){if(_0x146243[_0x6f75('0x3c')]>0x0)_0x2e46d3[_0x6f75('0x76')](_0x6f75('0xab'),_[_0x6f75('0x2b')](_0x146243,'id'));return db['sequelize'][_0x6f75('0x36')](_0x2e46d3[_0x6f75('0xaa')](),_0x4a8a3e)['then'](function(_0x493878){var _0x49d32f=_[_0x6f75('0xac')](_0x493878,_0x6f75('0xad'));var _0x14f4c5=[];_0x146243[_0x6f75('0x2e')](function(_0x1433a9){_0x14f4c5['push'](updateSmsInteraction(_0x1433a9,_0x24424b,_0x49d32f));});return BPromise[_0x6f75('0xae')](_0x14f4c5);});});})['then'](function(_0x5ac2f0){_0x1ea4c9[_0x6f75('0xaf')]=_0x5ac2f0;return _0x1ea4c9;})['then'](respondWithFilteredResult(_0x1252c5,_0x161c5a))['catch'](handleError(_0x1252c5,null));};exports['show']=function(_0x1d6f60,_0x29ae69){var _0x39114c={'raw':![],'where':{'id':_0x1d6f60[_0x6f75('0xb0')]['id']}},_0x130748={};_0x130748[_0x6f75('0x39')]=_[_0x6f75('0x37')](db['SmsInteraction'][_0x6f75('0x33')]);_0x130748[_0x6f75('0x36')]=_[_0x6f75('0x37')](_0x1d6f60[_0x6f75('0x36')]);_0x130748[_0x6f75('0x41')]=_[_0x6f75('0x38')](_0x130748[_0x6f75('0x39')],_0x130748[_0x6f75('0x36')]);_0x39114c[_0x6f75('0x3a')]=_[_0x6f75('0x38')](_0x130748['model'],qs[_0x6f75('0x3b')](_0x1d6f60['query'][_0x6f75('0x3b')]));_0x39114c['attributes']=_0x39114c[_0x6f75('0x3a')]['length']?_0x39114c['attributes']:_0x130748[_0x6f75('0x39')];if(_0x1d6f60[_0x6f75('0x36')][_0x6f75('0xb1')]){_0x39114c[_0x6f75('0xb2')]=[{'all':!![]}];}_0x39114c=_[_0x6f75('0x96')]({},_0x39114c,_0x1d6f60[_0x6f75('0xb3')]);return db[_0x6f75('0x32')][_0x6f75('0x5c')](_0x39114c)['then'](handleEntityNotFound(_0x29ae69,null))[_0x6f75('0x30')](respondWithResult(_0x29ae69,null))[_0x6f75('0xb4')](handleError(_0x29ae69,null));};exports['create']=function(_0x1afb20,_0x141389){return db[_0x6f75('0x32')][_0x6f75('0xb5')](_0x1afb20[_0x6f75('0x6e')],{})['then'](respondWithResult(_0x141389,0xc9))['catch'](handleError(_0x141389,null));};exports[_0x6f75('0x25')]=function(_0x18d582,_0x2472a3){if(_0x18d582[_0x6f75('0x6e')]['id']){delete _0x18d582[_0x6f75('0x6e')]['id'];}return db[_0x6f75('0x32')][_0x6f75('0x5c')]({'where':{'id':_0x18d582[_0x6f75('0xb0')]['id']}})[_0x6f75('0x30')](handleEntityNotFound(_0x2472a3,null))['then'](saveUpdates(_0x18d582[_0x6f75('0x6e')],null))['then'](respondWithResult(_0x2472a3,null))[_0x6f75('0xb4')](handleError(_0x2472a3,null));};exports[_0x6f75('0xb6')]=function(_0x74c98d,_0x539e34){return db[_0x6f75('0x32')][_0x6f75('0x5c')]({'where':{'id':_0x74c98d['params']['id']}})[_0x6f75('0x30')](handleEntityNotFound(_0x539e34,null))[_0x6f75('0x30')](removeEntity(_0x539e34,null))[_0x6f75('0xb4')](handleError(_0x539e34,null));};exports['describe']=function(_0x502215,_0x365635){return db[_0x6f75('0x32')]['describe']()[_0x6f75('0x30')](respondWithResult(_0x365635,null))[_0x6f75('0xb4')](handleError(_0x365635,null));};exports[_0x6f75('0xb7')]=function(_0x41a797,_0x3408df,_0x272d07){return db['SmsMessage'][_0x6f75('0x5c')]({'where':{'id':_0x41a797[_0x6f75('0xb0')]['id']}})['then'](handleEntityNotFound(_0x3408df,null))[_0x6f75('0x30')](function(_0x196ab0){if(_0x196ab0){return _0x196ab0[_0x6f75('0xb7')](_0x41a797[_0x6f75('0x6e')][_0x6f75('0xb8')],_[_0x6f75('0xb9')](_0x41a797[_0x6f75('0x6e')],[_0x6f75('0xb8'),'id'])||{});}})['then'](respondWithResult(_0x3408df,null))[_0x6f75('0xb4')](handleError(_0x3408df,null));};exports['getMessages']=function(_0x4c2c5d,_0x418bf2,_0x53b742){var _0x850a8={'raw':![],'where':{}};var _0x3ade35={};var _0x1d1698={'count':0x0,'rows':[]};return db[_0x6f75('0x32')]['findOne']({'where':{'id':_0x4c2c5d[_0x6f75('0xb0')]['id']}})[_0x6f75('0x30')](handleEntityNotFound(_0x418bf2,null))[_0x6f75('0x30')](function(_0xd132a5){if(_0xd132a5){_0x3ade35[_0x6f75('0x39')]=_[_0x6f75('0x37')](db['SmsMessage'][_0x6f75('0x33')]);_0x3ade35[_0x6f75('0x36')]=_[_0x6f75('0x37')](_0x4c2c5d[_0x6f75('0x36')]);_0x3ade35[_0x6f75('0x41')]=_[_0x6f75('0x38')](_0x3ade35[_0x6f75('0x39')],_0x3ade35[_0x6f75('0x36')]);_0x850a8['attributes']=_['intersection'](_0x3ade35[_0x6f75('0x39')],qs[_0x6f75('0x3b')](_0x4c2c5d[_0x6f75('0x36')][_0x6f75('0x3b')]));_0x850a8[_0x6f75('0x3a')]=_0x850a8[_0x6f75('0x3a')]['length']?_0x850a8[_0x6f75('0x3a')]:_0x3ade35[_0x6f75('0x39')];if(!_0x4c2c5d['query'][_0x6f75('0x3d')](_0x6f75('0x3e'))){_0x850a8['limit']=qs['limit'](_0x4c2c5d['query'][_0x6f75('0x1e')]);_0x850a8[_0x6f75('0x1c')]=qs[_0x6f75('0x1c')](_0x4c2c5d[_0x6f75('0x36')]['offset']);}_0x850a8['order']=qs['sort'](_0x4c2c5d['query']['sort']);_0x850a8[_0x6f75('0x76')]=qs['filters'](_[_0x6f75('0x42')](_0x4c2c5d[_0x6f75('0x36')],_0x3ade35['filters']));_0x850a8[_0x6f75('0x76')][_0x6f75('0xad')]=_0xd132a5['id'];if(_0x4c2c5d[_0x6f75('0x36')][_0x6f75('0x7f')]){_0x850a8[_0x6f75('0x76')]=_['merge'](_0x850a8[_0x6f75('0x76')],{'$or':_[_0x6f75('0x2b')](_0x850a8['attributes'],function(_0x55dc49){var _0x355721={};_0x355721[_0x55dc49]={'$like':'%'+_0x4c2c5d[_0x6f75('0x36')]['filter']+'%'};return _0x355721;})});}if(_0x4c2c5d[_0x6f75('0x36')][_0x6f75('0xba')]){var _0x259176=_0x4c2c5d[_0x6f75('0x36')][_0x6f75('0xba')]['split'](',');var _0x449d7a={};_0x449d7a[_0x259176[0x0]]={'$gte':moment(_0x259176[0x1])[_0x6f75('0xbb')]('YYYY-MM-DD\x20HH:mm:ss')};_0x850a8[_0x6f75('0x76')]=_[_0x6f75('0x96')](_0x850a8[_0x6f75('0x76')],_0x449d7a);}_0x850a8=_['merge']({},_0x850a8,_0x4c2c5d['options']);return db['SmsMessage']['count']({'where':_0x850a8[_0x6f75('0x76')]})['then'](function(_0x14f2f2){_0x1d1698[_0x6f75('0x1f')]=_0x14f2f2;if(_0x4c2c5d['query'][_0x6f75('0xb1')]){_0x850a8[_0x6f75('0xb2')]=[{'all':!![]}];}return db[_0x6f75('0xbc')][_0x6f75('0xbd')](_0x850a8);})[_0x6f75('0x30')](function(_0x2de020){_0x1d1698['rows']=_0x2de020;return _0x1d1698;});}})[_0x6f75('0x30')](respondWithFilteredResult(_0x418bf2,_0x850a8))[_0x6f75('0xb4')](handleError(_0x418bf2,null));};exports[_0x6f75('0xbe')]=function(_0x1de27d,_0x33bb36,_0x41d899){return db['SmsInteraction']['find']({'where':{'id':_0x1de27d[_0x6f75('0xb0')]['id']}})[_0x6f75('0x30')](handleEntityNotFound(_0x33bb36,null))[_0x6f75('0x30')](function(_0x1f9095){if(_0x1f9095){return _0x1f9095[_0x6f75('0xbf')](_0x1de27d[_0x6f75('0x6e')][_0x6f75('0xb8')],_[_0x6f75('0xb9')](_0x1de27d['body'],[_0x6f75('0xb8'),'id'])||{})[_0x6f75('0xc0')](function(){return db['Tag'][_0x6f75('0xbd')]({'attributes':['id',_0x6f75('0x28'),_0x6f75('0x45')],'where':{'id':_0x1de27d[_0x6f75('0x6e')][_0x6f75('0xb8')]}});})[_0x6f75('0x30')](function(_0x14f299){socket[_0x6f75('0xc1')](_0x6f75('0xc2'),{'id':Number(_0x1de27d[_0x6f75('0xb0')]['id']),'tags':_0x14f299||[]});return{'id':Number(_0x1de27d[_0x6f75('0xb0')]['id']),'tags':_0x14f299||[]};});}})[_0x6f75('0x30')](respondWithResult(_0x33bb36,null))[_0x6f75('0xb4')](handleError(_0x33bb36,null));};exports['removeTags']=function(_0x32aa33,_0x34a16d,_0x555def){return db['SmsInteraction']['find']({'where':{'id':_0x32aa33['params']['id']}})[_0x6f75('0x30')](handleEntityNotFound(_0x34a16d,null))[_0x6f75('0x30')](function(_0x1133a5){if(_0x1133a5){return _0x1133a5[_0x6f75('0xc3')](_0x32aa33[_0x6f75('0x36')][_0x6f75('0xb8')]);}})['then'](respondWithStatusCode(_0x34a16d,null))[_0x6f75('0xb4')](handleError(_0x34a16d,null));};exports['download']=function(_0xe5c94d,_0x3b0082){var _0x2304f6=moment()[_0x6f75('0xc4')]()[_0x6f75('0xaa')]();var _0x2772b5=path['join'](config['root'],_0x6f75('0xc5'),_0x6f75('0xc6'),_0x6f75('0xc7'));var _0x45f03b=path[_0x6f75('0xc8')](config[_0x6f75('0xc9')],_0x6f75('0xc5'),_0x6f75('0xc6'),'attachments');var _0x2182cc=path[_0x6f75('0xc8')](_0x2772b5,_0x2304f6);var _0x59f108=util[_0x6f75('0xbb')](_0x6f75('0xca'),_0xe5c94d[_0x6f75('0xb0')]['id'],_0x2304f6);var _0x2ebd29=path[_0x6f75('0xc8')](_0x2772b5,_0x59f108);var _0x241e0e=[];_0x241e0e[_0x6f75('0xcb')]({'model':db[_0x6f75('0x6a')],'as':'User','attributes':['id',_0x6f75('0x2c')],'raw':!![]});_0x241e0e[_0x6f75('0xcb')]({'model':db[_0x6f75('0xcc')],'as':_0x6f75('0xcd'),'attributes':['id',_0x6f75('0xce'),_0x6f75('0xcf')],'raw':!![]});var _0x2fdfb0=[{'model':db['SmsMessage'],'as':_0x6f75('0xd0'),'attributes':['id',_0x6f75('0x6e'),'createdAt',_0x6f75('0xd1'),_0x6f75('0xd2'),_0x6f75('0x79')],'include':_0x241e0e}];_0x2fdfb0[_0x6f75('0xcb')]({'model':db[_0x6f75('0xd3')],'as':_0x6f75('0xd4'),'attributes':['id',_0x6f75('0x28')]});_0x2fdfb0[_0x6f75('0xcb')]({'model':db[_0x6f75('0x6a')],'as':_0x6f75('0xd5'),'attributes':['id',_0x6f75('0x2c')]});return db['SmsInteraction'][_0x6f75('0x5c')]({'where':{'id':_0xe5c94d['params']['id']},'include':_0x2fdfb0})[_0x6f75('0x30')](handleEntityNotFound(_0x3b0082,null))[_0x6f75('0x30')](function(_0x134ebe){if(_0x134ebe){var _0x4f1291=_0x134ebe[_0x6f75('0xd6')]({'plain':!![]});fs[_0x6f75('0xd7')](_0x2182cc);var _0x289e25={'channel':_0x6f75('0xd8'),'account':_0x4f1291['Account']['name'],'agent':_0x4f1291[_0x6f75('0xd5')]?_0x4f1291[_0x6f75('0xd5')][_0x6f75('0x2c')]:_0x6f75('0xd9'),'createdAt':moment(_0x4f1291[_0x6f75('0x72')])['format'](_0x6f75('0xda'))[_0x6f75('0xaa')](),'closedAt':_0x4f1291[_0x6f75('0xdb')]?moment(_0x4f1291[_0x6f75('0xdc')])[_0x6f75('0xbb')](_0x6f75('0xda'))[_0x6f75('0xaa')]():'','disposition':_0x4f1291[_0x6f75('0xdd')],'messages':_(_0x4f1291[_0x6f75('0xd0')])[_0x6f75('0x7f')]({'secret':![]})[_0x6f75('0x2b')](function(_0x4fafcf){return{'date':moment(_0x4fafcf['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x6f75('0xaa')](),'sender':_0x4fafcf[_0x6f75('0xd1')]===_0x6f75('0xde')?_0x4fafcf['User']?_0x4fafcf[_0x6f75('0x6a')][_0x6f75('0x2c')]:'System':_0x4fafcf['Contact'][_0x6f75('0xce')]+(_0x4fafcf[_0x6f75('0xcd')][_0x6f75('0xcf')]?'\x20'+_0x4fafcf[_0x6f75('0xcd')][_0x6f75('0xcf')]:''),'body':_0x4fafcf['body'],'direction':_0x4fafcf[_0x6f75('0xd1')]===_0x6f75('0xde')?'A':'C','secret':_0x4fafcf['secret'],'read':_0x4fafcf['read']};})[_0x6f75('0x5e')]()};return ejs[_0x6f75('0xdf')](path[_0x6f75('0xc8')](config['root'],_0x6f75('0xc5'),_0x6f75('0xe0'),'downloadInteraction.ejs'),{'interaction':_0x289e25})[_0x6f75('0x30')](function(_0x452c1e){var _0x115ca9=path['join'](_0x2182cc,'transcript-'+_0x4f1291['id']+'-'+_0x2304f6+'.pdf');var _0x4bd850={'path':_0x115ca9,'channel':_0x6f75('0xd8'),'interactionId':_0x4f1291['id']};return pdf['createPdfFromHTML'](_0x452c1e,_0x4bd850);})[_0x6f75('0x30')](function(){return new BPromise(function(_0x2a2e66,_0x3ffcd3){zipdir(_0x2182cc,{'saveTo':_0x2ebd29},function(_0x29cd97,_0x4401cd){if(_0x29cd97)return _0x3ffcd3(_0x29cd97);return _0x2a2e66(_0x4401cd);});})[_0x6f75('0x30')](function(){return new BPromise(function(_0x104dee,_0x178881){rimraf(_0x2182cc,function(_0x58afa3){if(_0x58afa3)_0x178881(_0x58afa3);return _0x104dee();});});})[_0x6f75('0x30')](function(){return _0x3b0082[_0x6f75('0xe1')](_0x2ebd29,_0x59f108,function(_0x161101){if(_0x161101){console[_0x6f75('0xe2')](_0x6f75('0xe3'),_0x161101);}else{fs[_0x6f75('0xe4')](_0x2ebd29);}});});});}else{return _0x3b0082[_0x6f75('0x1a')](0xc8);}})[_0x6f75('0xb4')](handleError(_0x3b0082,null));}; \ No newline at end of file +var _0x41e7=['renderFile','transcript-','.pdf','Sms','createPdfFromHTML','log','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','error','name','send','Users','map','fullname','TagIds','split','Tags','catch','index','rawAttributes','type','query','keys','filters','intersection','model','attributes','length','nolimit','sort','pick','select','field','color','from','u.id','u.fullname','ui.SmsInteractionId','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','tools_tags','expr','parseSearch','search','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','start','some','compact','where','i.SmsAccountId\x20IN\x20?','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','SELECT','clone','order','contactName','DESC','isEmpty','t.id\x20IN\x20?','SmsAccountId','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','merge','fields','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','push','all','show','params','includeAll','include','options','SmsInteraction','create','body','destroy','describe','SmsMessage','omit','ids','getMessages','hasOwnProperty','SmsInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','setTags','spread','emit','download','unix','join','root','files','tmp','server','attachments','format','transcript-%d-%s.zip','User','CmContact','Contact','lastName','Messages','secret','SmsAccount','Account','Owner','get','mkdirSync','closed','closedAt','disposition','direction','out','firstName'];(function(_0x122e9b,_0x391bf4){var _0x22c247=function(_0x1b2c65){while(--_0x1b2c65){_0x122e9b['push'](_0x122e9b['shift']());}};_0x22c247(++_0x391bf4);}(_0x41e7,0x1c9));var _0x741e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x41e7[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x741e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x741e('0x1'));var jsonpatch=require(_0x741e('0x2'));var rp=require(_0x741e('0x3'));var moment=require(_0x741e('0x4'));var BPromise=require(_0x741e('0x5'));var Mustache=require('mustache');var util=require(_0x741e('0x6'));var path=require(_0x741e('0x7'));var sox=require(_0x741e('0x8'));var csv=require(_0x741e('0x9'));var ejs=require(_0x741e('0xa'));var fs=require('fs');var fs_extra=require(_0x741e('0xb'));var _=require(_0x741e('0xc'));var squel=require(_0x741e('0xd'));var crypto=require('crypto');var jsforce=require(_0x741e('0xe'));var deskjs=require(_0x741e('0xf'));var toCsv=require('to-csv');var querystring=require(_0x741e('0x10'));var Papa=require(_0x741e('0x11'));var Redis=require(_0x741e('0x12'));var authService=require(_0x741e('0x13'));var qs=require(_0x741e('0x14'));var as=require(_0x741e('0x15'));var pdf=require(_0x741e('0x16'));var hardwareService=require(_0x741e('0x17'));var logger=require('../../config/logger')(_0x741e('0x18'));var utils=require(_0x741e('0x19'));var config=require(_0x741e('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x741e('0x1b'))['db'];config[_0x741e('0x1c')]=_[_0x741e('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x741e('0x1e'))(new Redis(config[_0x741e('0x1c')]));require(_0x741e('0x1f'))[_0x741e('0x20')](socket);function respondWithStatusCode(_0x544623,_0x823a8f){_0x823a8f=_0x823a8f||0xcc;return function(_0x52181c){if(_0x52181c){return _0x544623[_0x741e('0x21')](_0x823a8f);}return _0x544623[_0x741e('0x22')](_0x823a8f)[_0x741e('0x23')]();};}function respondWithResult(_0x2836b5,_0x3041c4){_0x3041c4=_0x3041c4||0xc8;return function(_0x37884f){if(_0x37884f){return _0x2836b5[_0x741e('0x22')](_0x3041c4)[_0x741e('0x24')](_0x37884f);}};}function respondWithFilteredResult(_0x4e5590,_0x583771){return function(_0x265bbe){if(_0x265bbe){var _0x4b3349=typeof _0x583771[_0x741e('0x25')]==='undefined'&&typeof _0x583771[_0x741e('0x26')]===_0x741e('0x27');var _0x46ccb7=_0x265bbe[_0x741e('0x28')];var _0x311aa9=_0x4b3349?0x0:_0x583771['offset'];var _0x407e46=_0x4b3349?_0x265bbe[_0x741e('0x28')]:_0x583771[_0x741e('0x25')]+_0x583771[_0x741e('0x26')];var _0x1ab4ed;if(_0x407e46>=_0x46ccb7){_0x407e46=_0x46ccb7;_0x1ab4ed=0xc8;}else{_0x1ab4ed=0xce;}_0x4e5590[_0x741e('0x22')](_0x1ab4ed);return _0x4e5590[_0x741e('0x29')](_0x741e('0x2a'),_0x311aa9+'-'+_0x407e46+'/'+_0x46ccb7)[_0x741e('0x24')](_0x265bbe);}return null;};}function patchUpdates(_0x41a491){return function(_0x54795c){try{jsonpatch[_0x741e('0x2b')](_0x54795c,_0x41a491,!![]);}catch(_0x5ebfd7){return BPromise[_0x741e('0x2c')](_0x5ebfd7);}return _0x54795c['save']();};}function saveUpdates(_0xd2c2e4,_0x38635f){return function(_0x12dd91){if(_0x12dd91){return _0x12dd91['update'](_0xd2c2e4)[_0x741e('0x2d')](function(_0x1fcadb){return _0x1fcadb;});}return null;};}function removeEntity(_0x5107d6,_0x1b19ee){return function(_0xe87668){if(_0xe87668){return _0xe87668['destroy']()['then'](function(){_0x5107d6[_0x741e('0x22')](0xcc)[_0x741e('0x23')]();});}};}function handleEntityNotFound(_0x4dd010,_0x18b628){return function(_0x37bbfb){if(!_0x37bbfb){_0x4dd010[_0x741e('0x21')](0x194);}return _0x37bbfb;};}function handleError(_0x10f0da,_0x5eab47){_0x5eab47=_0x5eab47||0x1f4;return function(_0x303b80){logger[_0x741e('0x2e')](_0x303b80['stack']);if(_0x303b80[_0x741e('0x2f')]){delete _0x303b80['name'];}_0x10f0da[_0x741e('0x22')](_0x5eab47)[_0x741e('0x30')](_0x303b80);};}function getInteractionUsers(_0x3ae016,_0x3569e2){return new BPromise(function(_0x232b89,_0x299594){try{if(_0x3569e2[_0x3ae016['id']]){_0x3ae016[_0x741e('0x31')]=_[_0x741e('0x32')](_0x3569e2[_0x3ae016['id']],function(_0x3c49c0){return{'id':_0x3c49c0['id'],'fullname':_0x3c49c0[_0x741e('0x33')]};});}}catch(_0x3904a6){_0x299594(_0x3904a6);}_0x232b89(_0x3ae016);});}function getInteractionTags(_0x15be7c,_0x13e984){return new BPromise(function(_0x24cab7,_0x1e91dd){try{if(_0x15be7c[_0x741e('0x34')]){_0x15be7c['Tags']=[];_0x15be7c['TagIds'][_0x741e('0x35')](',')['forEach'](function(_0x1903ac){_0x15be7c[_0x741e('0x36')]['push'](_0x13e984[_0x1903ac]);});}delete _0x15be7c[_0x741e('0x34')];}catch(_0x13ef74){_0x1e91dd(_0x13ef74);}_0x24cab7(_0x15be7c);});}function updateSmsInteraction(_0x4ef05f,_0x5e75e9,_0x230c3f){return new BPromise(function(_0x45b885,_0x5bc6f7){return getInteractionUsers(_0x4ef05f,_0x230c3f)[_0x741e('0x2d')](function(_0x38a8bf){return getInteractionTags(_0x38a8bf,_0x5e75e9);})[_0x741e('0x2d')](function(_0x35fff6){_0x45b885(_0x35fff6);})[_0x741e('0x37')](function(_0xec34d7){_0x5bc6f7(_0xec34d7);});});}exports[_0x741e('0x38')]=function(_0x6257b4,_0x113108){var _0xb39c62={},_0x16772a={},_0x490c9e={'count':0x0,'rows':[]};var _0x2ca4d1=_[_0x741e('0x32')](db['SmsInteraction'][_0x741e('0x39')],function(_0x19d81d){return{'name':_0x19d81d['fieldName'],'type':_0x19d81d[_0x741e('0x3a')]['key']};});_0x16772a['model']=_[_0x741e('0x32')](_0x2ca4d1,_0x741e('0x2f'));_0x16772a[_0x741e('0x3b')]=_[_0x741e('0x3c')](_0x6257b4[_0x741e('0x3b')]);_0x16772a[_0x741e('0x3d')]=_[_0x741e('0x3e')](_0x16772a[_0x741e('0x3f')],_0x16772a['query']);_0xb39c62[_0x741e('0x40')]=_[_0x741e('0x3e')](_0x16772a[_0x741e('0x3f')],qs['fields'](_0x6257b4[_0x741e('0x3b')]['fields']));_0xb39c62['attributes']=_0xb39c62['attributes'][_0x741e('0x41')]?_0xb39c62[_0x741e('0x40')]:_0x16772a[_0x741e('0x3f')];if(!_0x6257b4[_0x741e('0x3b')]['hasOwnProperty'](_0x741e('0x42'))){_0xb39c62['limit']=qs[_0x741e('0x26')](_0x6257b4[_0x741e('0x3b')][_0x741e('0x26')]);_0xb39c62['offset']=qs['offset'](_0x6257b4[_0x741e('0x3b')][_0x741e('0x25')]);}_0xb39c62['order']=qs[_0x741e('0x43')](_0x6257b4[_0x741e('0x3b')][_0x741e('0x43')]);_0xb39c62['where']=qs['filters'](_[_0x741e('0x44')](_0x6257b4[_0x741e('0x3b')],_0x16772a[_0x741e('0x3d')]),_0x2ca4d1);var _0x2bf508=[];var _0x3f0315=squel[_0x741e('0x45')]()[_0x741e('0x46')]('id')[_0x741e('0x46')](_0x741e('0x2f'))[_0x741e('0x46')](_0x741e('0x47'))[_0x741e('0x48')]('tools_tags');var _0x1fc510=squel['select']()['field'](_0x741e('0x49'))['field'](_0x741e('0x4a'))['field'](_0x741e('0x4b'))['from']('user_has_sms_interactions','ui')[_0x741e('0x4c')]('users','u','u.id\x20=\x20ui.UserId');var _0x38d775=squel[_0x741e('0x45')]()[_0x741e('0x48')]('sms_interactions','i')[_0x741e('0x4c')](_0x741e('0x4d'),'c',_0x741e('0x4e'))['left_join'](_0x741e('0x4f'),'o',_0x741e('0x50'))[_0x741e('0x4c')](_0x741e('0x51'),'a',_0x741e('0x52'))['left_join']('sms_messages','me','me.SmsInteractionId\x20=\x20i.id')[_0x741e('0x4c')]('sms_interaction_has_tags','it','it.SmsInteractionId\x20=\x20i.id')['left_join'](_0x741e('0x53'),'t','t.id\x20=\x20it.TagId');var _0x254ac7=squel['expr']();var _0x4fb7f2=[];var _0x2b60ab=squel[_0x741e('0x54')]();var _0x3176ef;if(_0x6257b4['query']['search']){_0x3176ef=as[_0x741e('0x55')](_0x6257b4[_0x741e('0x3b')][_0x741e('0x56')]);var _0x2ea2d6=_0x3176ef['sqlOperator'];for(var _0x574415=0x0;_0x574415<_0x3176ef[_0x741e('0x57')]['length'];_0x574415++){var _0x438e70=_0x3176ef[_0x741e('0x57')][_0x574415];var _0x548601='i';var _0x2407ec=_[_0x741e('0x58')](_0x2ca4d1,[_0x741e('0x2f'),_0x438e70[_0x741e('0x46')]]);if(!_0x2407ec){switch(_0x438e70[_0x741e('0x46')]){case _0x741e('0x59'):if(_0x438e70[_0x741e('0x5a')]==0x1){_0x38d775['having']('`'+_0x438e70[_0x741e('0x46')]+_0x741e('0x5b'));}else{_0x38d775[_0x741e('0x5c')]('`'+_0x438e70[_0x741e('0x46')]+_0x741e('0x5d'));}break;case'Contact':if(_0x438e70[_0x741e('0x5e')]===_0x741e('0x5f')){if(_0x438e70[_0x741e('0x5a')][_0x741e('0x35')]('\x20')[_0x741e('0x41')]>0x1){_0x254ac7[_0x2ea2d6](_0x741e('0x60'),qs[_0x741e('0x61')](_0x438e70[_0x741e('0x5a')]),null);}else{var _0x4b942a='%'+_0x438e70[_0x741e('0x5a')]+'%';_0x254ac7[_0x2ea2d6](_0x741e('0x62'),_0x4b942a,_0x4b942a,_0x4b942a);}}else{_0x2407ec=_[_0x741e('0x58')](_0x2ca4d1,[_0x741e('0x2f'),_0x741e('0x63')]);_0x438e70['field']=_0x741e('0x63');_0x4e772a=as['buildExpression'](_0x548601,_0x2407ec[_0x741e('0x3a')],_0x438e70);_0x254ac7[_0x2ea2d6](_0x4e772a[_0x741e('0x64')],_0x4e772a[_0x741e('0x5a')]['start'],_0x4e772a['value']['end']);}break;case _0x741e('0x65'):var _0x202b5b=_0x438e70[_0x741e('0x5a')][_0x741e('0x35')](',')[_0x741e('0x32')](function(_0x1d21e7){return Number(_0x1d21e7);});_0x202b5b[_0x741e('0x66')](function(_0x13213b){_0x2b60ab['or'](_0x741e('0x67'),'%,'+_0x13213b+',%');});_0x4fb7f2=_[_0x741e('0x68')](_0x4fb7f2,_0x202b5b);break;case'User':if(_0x438e70[_0x741e('0x5e')]===_0x741e('0x5f')){_0x254ac7[_0x2ea2d6](_0x741e('0x69'),'%'+_0x438e70[_0x741e('0x5a')]+'%',null);}else{_0x2407ec=_['find'](_0x2ca4d1,[_0x741e('0x2f'),'UserId']);_0x438e70[_0x741e('0x46')]=_0x741e('0x6a');_0x4e772a=as[_0x741e('0x6b')](_0x548601,_0x2407ec[_0x741e('0x3a')],_0x438e70);_0x254ac7[_0x2ea2d6](_0x4e772a[_0x741e('0x64')],_0x4e772a['value'][_0x741e('0x6c')],_0x4e772a['value'][_0x741e('0x23')]);}break;case'body':_0x4e772a=as['buildExpression']('me',null,_0x438e70);_0x254ac7[_0x2ea2d6](_0x4e772a[_0x741e('0x64')],_0x4e772a[_0x741e('0x5a')][_0x741e('0x6c')],_0x4e772a[_0x741e('0x5a')][_0x741e('0x23')]);break;}}else{var _0x4e772a=as[_0x741e('0x6b')](_0x548601,_0x2407ec[_0x741e('0x3a')],_0x438e70);_0x254ac7[_0x2ea2d6](_0x4e772a[_0x741e('0x64')],_0x4e772a[_0x741e('0x5a')]['start'],_0x4e772a['value'][_0x741e('0x23')]);}}}else{var _0x3c17d5=_(_0x6257b4[_0x741e('0x3b')])[_0x741e('0x3c')]()[_0x741e('0x32')](function(_0x5f597f){return _[_0x741e('0x6d')](_0x2ca4d1,[_0x741e('0x2f'),_0x5f597f])?_0x5f597f:undefined;})[_0x741e('0x6e')]()['value']();if(!_['isEmpty'](_0x3c17d5)){_0x3c17d5[_0x741e('0x66')](function(_0x19b90f){if(_0x19b90f==='SmsAccountId'){_0x38d775[_0x741e('0x6f')](_0x741e('0x70'),[]['concat'](_0x6257b4[_0x741e('0x3b')][_0x19b90f]));}else if(_0x19b90f===_0x741e('0x71')){var _0x5dae5e=JSON['parse'](_0x6257b4[_0x741e('0x3b')][_0x19b90f])[_0x741e('0x72')];var _0x4777e1=JSON[_0x741e('0x73')](_0x6257b4[_0x741e('0x3b')][_0x19b90f])['$lte'];_0x38d775[_0x741e('0x6f')](_0x741e('0x74'),_0x5dae5e,_0x4777e1);}else{if(_0x6257b4[_0x741e('0x3b')][_0x19b90f]==='null'){_0x38d775[_0x741e('0x6f')]('i.'+_0x19b90f+_0x741e('0x75'));}else{_0x38d775[_0x741e('0x6f')]('i.'+_0x19b90f+_0x741e('0x76'),_0x6257b4[_0x741e('0x3b')][_0x19b90f]);}}});}if(_0x6257b4['query'][_0x741e('0x77')]){if(_0x6257b4[_0x741e('0x3b')]['read']==0x1){_0x38d775[_0x741e('0x5c')]('`unreadMessages`\x20=\x200');}else{_0x38d775['having'](_0x741e('0x78'));}}if(_0x6257b4[_0x741e('0x3b')][_0x741e('0x79')]){_0x4fb7f2=_[_0x741e('0x7a')](_0x6257b4[_0x741e('0x3b')]['tag'])?_0x6257b4[_0x741e('0x3b')][_0x741e('0x79')]:new Array(_0x6257b4['query'][_0x741e('0x79')]);_0x4fb7f2[_0x741e('0x66')](function(_0x334e91){_0x2b60ab['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x334e91+',%');});}if(_0x6257b4[_0x741e('0x3b')][_0x741e('0x7b')]){var _0x136518=_0x6257b4[_0x741e('0x3b')][_0x741e('0x7b')][_0x741e('0x7c')]('\x5c','\x5c\x5c')[_0x741e('0x7c')](/'/g,'\x27\x27');if(qs[_0x741e('0x7d')](_0x136518)){_0x254ac7['or'](_0x741e('0x7e'),_0x136518+'%')['or'](_0x741e('0x7f'),_0x136518+'%');}else{_0x254ac7['or'](_0x741e('0x80'),qs['getFullTextValue'](_0x136518))['or'](_0x741e('0x81'),_0x136518+'%');}}}_0x38d775[_0x741e('0x6f')](_0x254ac7);_0x38d775['group'](_0x741e('0x82'));var _0x416ae2={'type':db[_0x741e('0x83')]['QueryTypes'][_0x741e('0x84')],'raw':!![]};var _0x1f6253=_0x38d775[_0x741e('0x85')]();_0x1f6253['field'](_0x741e('0x82'));_0x1f6253[_0x741e('0x46')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x741e('0x59'));if(_0xb39c62[_0x741e('0x86')]){_0xb39c62[_0x741e('0x86')]['forEach'](function(_0x12d908){var _0x2216a4=_0x12d908[0x0]===_0x741e('0x87')?_0x12d908[0x0]:'i.'+_0x12d908[0x0];_0x38d775[_0x741e('0x86')](_0x2216a4,_0x12d908[0x1]===_0x741e('0x88')?![]:!![]);});}if(!_[_0x741e('0x89')](_0x4fb7f2)){_0x38d775[_0x741e('0x5c')](_0x2b60ab);_0x1f6253[_0x741e('0x6f')](_0x741e('0x8a'),_0x4fb7f2);}BPromise['resolve']()[_0x741e('0x2d')](function(){if(!_0x3176ef){if(_0x6257b4[_0x741e('0x3b')][_0x741e('0x8b')])return;_0x1f6253[_0x741e('0x6f')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x38d775[_0x741e('0x6f')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x6257b4[_0x741e('0x8c')]['role']!=='agent')return;return _0x6257b4[_0x741e('0x8c')][_0x741e('0x8d')]({'attributes':['id'],'raw':!![]})[_0x741e('0x2d')](function(_0x4cc28d){if(_[_0x741e('0x89')](_0x4cc28d)){_0x1f6253['where'](_0x741e('0x8e'));_0x38d775['where'](_0x741e('0x8e'));}else{_0x1f6253[_0x741e('0x6f')](_0x741e('0x70'),_[_0x741e('0x32')](_0x4cc28d,'id'));_0x38d775[_0x741e('0x6f')](_0x741e('0x70'),_[_0x741e('0x32')](_0x4cc28d,'id'));}});})['then'](function(){if(_0x6257b4[_0x741e('0x8c')]['role']===_0x741e('0x8f')&&!_0x3176ef&&!_0x6257b4['query']['SmsAccountId'])return[];return db['sequelize'][_0x741e('0x3b')](_0x1f6253[_0x741e('0x90')](),_0x416ae2);})['then'](function(_0x27f1fb){_0x490c9e['count']=_0x27f1fb[_0x741e('0x41')];if(_0x490c9e[_0x741e('0x28')]===0x0)return[];return db[_0x741e('0x91')][_0x741e('0x3b')](_0x3f0315['toString'](),_0x416ae2)[_0x741e('0x2d')](function(_0x2141ba){_0x2bf508=_[_0x741e('0x92')](_0x2141ba,'id');_0x416ae2=_[_0x741e('0x93')](_0x416ae2,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x6257b4[_0x741e('0x3b')][_0x741e('0x94')]){_0xb39c62[_0x741e('0x40')][_0x741e('0x66')](function(_0x12e6c3){_0x38d775[_0x741e('0x46')]('i.'+_0x12e6c3);});}else{_0x38d775[_0x741e('0x46')](_0x741e('0x95'),_0x741e('0x59'));_0x38d775[_0x741e('0x46')](_0x741e('0x96'),_0x741e('0x97'));_0x38d775[_0x741e('0x46')](_0x741e('0x98'),_0x741e('0x99'));_0x38d775[_0x741e('0x46')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x38d775['field'](_0x741e('0x9a'));_0x38d775[_0x741e('0x46')]('c.firstName',_0x741e('0x9b'));_0x38d775[_0x741e('0x46')]('c.lastName',_0x741e('0x9c'));_0x38d775[_0x741e('0x46')](_0x741e('0x9d'),_0x741e('0x9e'));_0x38d775['field']('c.phone',_0x741e('0x9f'));_0x38d775['field'](_0x741e('0xa0'),_0x741e('0xa1'));_0x38d775[_0x741e('0x46')](_0x741e('0xa2'),'Contact.fax');_0x38d775[_0x741e('0x46')](_0x741e('0xa3'),'Owner.fullname');_0x38d775[_0x741e('0x46')](_0x741e('0xa4'),_0x741e('0xa5'));_0x38d775[_0x741e('0x46')](_0x741e('0xa6'),_0x741e('0x34'));}if(_0xb39c62[_0x741e('0x26')])_0x38d775[_0x741e('0x26')](_0xb39c62[_0x741e('0x26')]);if(_0xb39c62[_0x741e('0x25')])_0x38d775[_0x741e('0x25')](_0xb39c62[_0x741e('0x25')]);return db['sequelize']['query'](_0x38d775[_0x741e('0x90')](),_0x416ae2);})[_0x741e('0x2d')](function(_0x19e56c){if(_0x19e56c[_0x741e('0x41')]>0x0)_0x1fc510['where']('ui.SmsInteractionId\x20IN\x20?',_[_0x741e('0x32')](_0x19e56c,'id'));return db['sequelize'][_0x741e('0x3b')](_0x1fc510['toString'](),_0x416ae2)[_0x741e('0x2d')](function(_0xd14607){var _0x4d0674=_['groupBy'](_0xd14607,'SmsInteractionId');var _0x2aff5c=[];_0x19e56c[_0x741e('0x66')](function(_0x447efc){_0x2aff5c[_0x741e('0xa7')](updateSmsInteraction(_0x447efc,_0x2bf508,_0x4d0674));});return BPromise[_0x741e('0xa8')](_0x2aff5c);});});})[_0x741e('0x2d')](function(_0xaaaa55){_0x490c9e['rows']=_0xaaaa55;return _0x490c9e;})[_0x741e('0x2d')](respondWithFilteredResult(_0x113108,_0xb39c62))[_0x741e('0x37')](handleError(_0x113108,null));};exports[_0x741e('0xa9')]=function(_0xb1b864,_0x4d899f){var _0x52e199={'raw':![],'where':{'id':_0xb1b864[_0x741e('0xaa')]['id']}},_0x2fe66e={};_0x2fe66e['model']=_[_0x741e('0x3c')](db['SmsInteraction'][_0x741e('0x39')]);_0x2fe66e[_0x741e('0x3b')]=_['keys'](_0xb1b864[_0x741e('0x3b')]);_0x2fe66e[_0x741e('0x3d')]=_['intersection'](_0x2fe66e['model'],_0x2fe66e['query']);_0x52e199['attributes']=_[_0x741e('0x3e')](_0x2fe66e[_0x741e('0x3f')],qs[_0x741e('0x94')](_0xb1b864['query']['fields']));_0x52e199[_0x741e('0x40')]=_0x52e199[_0x741e('0x40')]['length']?_0x52e199[_0x741e('0x40')]:_0x2fe66e[_0x741e('0x3f')];if(_0xb1b864['query'][_0x741e('0xab')]){_0x52e199[_0x741e('0xac')]=[{'all':!![]}];}_0x52e199=_[_0x741e('0x93')]({},_0x52e199,_0xb1b864[_0x741e('0xad')]);return db[_0x741e('0xae')][_0x741e('0x58')](_0x52e199)[_0x741e('0x2d')](handleEntityNotFound(_0x4d899f,null))['then'](respondWithResult(_0x4d899f,null))[_0x741e('0x37')](handleError(_0x4d899f,null));};exports[_0x741e('0xaf')]=function(_0x1125c7,_0x17d169){return db['SmsInteraction']['create'](_0x1125c7[_0x741e('0xb0')],{})[_0x741e('0x2d')](respondWithResult(_0x17d169,0xc9))[_0x741e('0x37')](handleError(_0x17d169,null));};exports['update']=function(_0x22eafe,_0x5698cf){if(_0x22eafe[_0x741e('0xb0')]['id']){delete _0x22eafe['body']['id'];}return db[_0x741e('0xae')]['find']({'where':{'id':_0x22eafe[_0x741e('0xaa')]['id']}})[_0x741e('0x2d')](handleEntityNotFound(_0x5698cf,null))[_0x741e('0x2d')](saveUpdates(_0x22eafe['body'],null))[_0x741e('0x2d')](respondWithResult(_0x5698cf,null))[_0x741e('0x37')](handleError(_0x5698cf,null));};exports[_0x741e('0xb1')]=function(_0x45fb11,_0x17bc5b){return db[_0x741e('0xae')]['find']({'where':{'id':_0x45fb11[_0x741e('0xaa')]['id']}})['then'](handleEntityNotFound(_0x17bc5b,null))['then'](removeEntity(_0x17bc5b,null))[_0x741e('0x37')](handleError(_0x17bc5b,null));};exports[_0x741e('0xb2')]=function(_0x799146,_0x274515){return db['SmsInteraction'][_0x741e('0xb2')]()[_0x741e('0x2d')](respondWithResult(_0x274515,null))[_0x741e('0x37')](handleError(_0x274515,null));};exports['addMessage']=function(_0x41f80e,_0x49bc01,_0x4e27ed){return db[_0x741e('0xb3')][_0x741e('0x58')]({'where':{'id':_0x41f80e[_0x741e('0xaa')]['id']}})[_0x741e('0x2d')](handleEntityNotFound(_0x49bc01,null))[_0x741e('0x2d')](function(_0x42602a){if(_0x42602a){return _0x42602a['addMessage'](_0x41f80e['body']['ids'],_[_0x741e('0xb4')](_0x41f80e[_0x741e('0xb0')],[_0x741e('0xb5'),'id'])||{});}})['then'](respondWithResult(_0x49bc01,null))[_0x741e('0x37')](handleError(_0x49bc01,null));};exports[_0x741e('0xb6')]=function(_0x4e74ff,_0x2ee178,_0x5d180f){var _0x2a0f15={'raw':![],'where':{}};var _0x29767b={};var _0x5c5f28={'count':0x0,'rows':[]};return db[_0x741e('0xae')]['findOne']({'where':{'id':_0x4e74ff[_0x741e('0xaa')]['id']}})[_0x741e('0x2d')](handleEntityNotFound(_0x2ee178,null))[_0x741e('0x2d')](function(_0x17898f){if(_0x17898f){_0x29767b[_0x741e('0x3f')]=_[_0x741e('0x3c')](db[_0x741e('0xb3')][_0x741e('0x39')]);_0x29767b['query']=_[_0x741e('0x3c')](_0x4e74ff[_0x741e('0x3b')]);_0x29767b[_0x741e('0x3d')]=_[_0x741e('0x3e')](_0x29767b[_0x741e('0x3f')],_0x29767b[_0x741e('0x3b')]);_0x2a0f15[_0x741e('0x40')]=_[_0x741e('0x3e')](_0x29767b[_0x741e('0x3f')],qs[_0x741e('0x94')](_0x4e74ff['query'][_0x741e('0x94')]));_0x2a0f15[_0x741e('0x40')]=_0x2a0f15[_0x741e('0x40')][_0x741e('0x41')]?_0x2a0f15['attributes']:_0x29767b[_0x741e('0x3f')];if(!_0x4e74ff['query'][_0x741e('0xb7')]('nolimit')){_0x2a0f15['limit']=qs[_0x741e('0x26')](_0x4e74ff[_0x741e('0x3b')][_0x741e('0x26')]);_0x2a0f15[_0x741e('0x25')]=qs[_0x741e('0x25')](_0x4e74ff[_0x741e('0x3b')]['offset']);}_0x2a0f15[_0x741e('0x86')]=qs[_0x741e('0x43')](_0x4e74ff['query'][_0x741e('0x43')]);_0x2a0f15[_0x741e('0x6f')]=qs[_0x741e('0x3d')](_[_0x741e('0x44')](_0x4e74ff[_0x741e('0x3b')],_0x29767b['filters']));_0x2a0f15[_0x741e('0x6f')][_0x741e('0xb8')]=_0x17898f['id'];if(_0x4e74ff[_0x741e('0x3b')][_0x741e('0x7b')]){_0x2a0f15['where']=_['merge'](_0x2a0f15[_0x741e('0x6f')],{'$or':_[_0x741e('0x32')](_0x2a0f15[_0x741e('0x40')],function(_0x48bb1a){var _0x1ffec5={};_0x1ffec5[_0x48bb1a]={'$like':'%'+_0x4e74ff[_0x741e('0x3b')]['filter']+'%'};return _0x1ffec5;})});}if(_0x4e74ff[_0x741e('0x3b')][_0x741e('0x72')]){var _0x4bea4b=_0x4e74ff[_0x741e('0x3b')][_0x741e('0x72')][_0x741e('0x35')](',');var _0x16065a={};_0x16065a[_0x4bea4b[0x0]]={'$gte':moment(_0x4bea4b[0x1])['format'](_0x741e('0xb9'))};_0x2a0f15[_0x741e('0x6f')]=_[_0x741e('0x93')](_0x2a0f15[_0x741e('0x6f')],_0x16065a);}_0x2a0f15=_[_0x741e('0x93')]({},_0x2a0f15,_0x4e74ff['options']);return db[_0x741e('0xb3')][_0x741e('0x28')]({'where':_0x2a0f15[_0x741e('0x6f')]})[_0x741e('0x2d')](function(_0x72092){_0x5c5f28[_0x741e('0x28')]=_0x72092;if(_0x4e74ff['query']['includeAll']){_0x2a0f15[_0x741e('0xac')]=[{'all':!![]}];}return db['SmsMessage'][_0x741e('0xba')](_0x2a0f15);})[_0x741e('0x2d')](function(_0x2782ed){_0x5c5f28[_0x741e('0xbb')]=_0x2782ed;return _0x5c5f28;});}})[_0x741e('0x2d')](respondWithFilteredResult(_0x2ee178,_0x2a0f15))[_0x741e('0x37')](handleError(_0x2ee178,null));};exports['addTags']=function(_0x1919f6,_0x31b377,_0x38db6e){return db[_0x741e('0xae')][_0x741e('0x58')]({'where':{'id':_0x1919f6[_0x741e('0xaa')]['id']}})[_0x741e('0x2d')](handleEntityNotFound(_0x31b377,null))['then'](function(_0xa89614){if(_0xa89614){return _0xa89614[_0x741e('0xbc')](_0x1919f6[_0x741e('0xb0')]['ids'],_[_0x741e('0xb4')](_0x1919f6[_0x741e('0xb0')],[_0x741e('0xb5'),'id'])||{})[_0x741e('0xbd')](function(){return db[_0x741e('0x65')]['findAll']({'attributes':['id',_0x741e('0x2f'),_0x741e('0x47')],'where':{'id':_0x1919f6['body'][_0x741e('0xb5')]}});})['then'](function(_0x2dea85){socket[_0x741e('0xbe')]('smsInteractionTags:save',{'id':Number(_0x1919f6['params']['id']),'tags':_0x2dea85||[]});return{'id':Number(_0x1919f6[_0x741e('0xaa')]['id']),'tags':_0x2dea85||[]};});}})[_0x741e('0x2d')](respondWithResult(_0x31b377,null))[_0x741e('0x37')](handleError(_0x31b377,null));};exports['removeTags']=function(_0x507d39,_0x2f1880,_0x3b5f9f){return db['SmsInteraction'][_0x741e('0x58')]({'where':{'id':_0x507d39[_0x741e('0xaa')]['id']}})[_0x741e('0x2d')](handleEntityNotFound(_0x2f1880,null))['then'](function(_0x552824){if(_0x552824){return _0x552824['removeTags'](_0x507d39[_0x741e('0x3b')]['ids']);}})[_0x741e('0x2d')](respondWithStatusCode(_0x2f1880,null))['catch'](handleError(_0x2f1880,null));};exports[_0x741e('0xbf')]=function(_0x27a5fb,_0x2da248){var _0x1935a8=moment()[_0x741e('0xc0')]()[_0x741e('0x90')]();var _0x43165c=path[_0x741e('0xc1')](config[_0x741e('0xc2')],'server',_0x741e('0xc3'),_0x741e('0xc4'));var _0x3357da=path[_0x741e('0xc1')](config[_0x741e('0xc2')],_0x741e('0xc5'),_0x741e('0xc3'),_0x741e('0xc6'));var _0x497169=path['join'](_0x43165c,_0x1935a8);var _0x22a317=util[_0x741e('0xc7')](_0x741e('0xc8'),_0x27a5fb[_0x741e('0xaa')]['id'],_0x1935a8);var _0x261255=path[_0x741e('0xc1')](_0x43165c,_0x22a317);var _0x38f4e1=[];_0x38f4e1[_0x741e('0xa7')]({'model':db['User'],'as':_0x741e('0xc9'),'attributes':['id',_0x741e('0x33')],'raw':!![]});_0x38f4e1['push']({'model':db[_0x741e('0xca')],'as':_0x741e('0xcb'),'attributes':['id','firstName',_0x741e('0xcc')],'raw':!![]});var _0x4c0753=[{'model':db[_0x741e('0xb3')],'as':_0x741e('0xcd'),'attributes':['id',_0x741e('0xb0'),_0x741e('0x71'),'direction',_0x741e('0xce'),_0x741e('0x77')],'include':_0x38f4e1}];_0x4c0753['push']({'model':db[_0x741e('0xcf')],'as':_0x741e('0xd0'),'attributes':['id',_0x741e('0x2f')]});_0x4c0753[_0x741e('0xa7')]({'model':db['User'],'as':_0x741e('0xd1'),'attributes':['id',_0x741e('0x33')]});return db[_0x741e('0xae')][_0x741e('0x58')]({'where':{'id':_0x27a5fb[_0x741e('0xaa')]['id']},'include':_0x4c0753})[_0x741e('0x2d')](handleEntityNotFound(_0x2da248,null))[_0x741e('0x2d')](function(_0x1b4639){if(_0x1b4639){var _0x28f68a=_0x1b4639[_0x741e('0xd2')]({'plain':!![]});fs[_0x741e('0xd3')](_0x497169);var _0x4df2d3={'channel':'Sms','account':_0x28f68a[_0x741e('0xd0')][_0x741e('0x2f')],'agent':_0x28f68a[_0x741e('0xd1')]?_0x28f68a[_0x741e('0xd1')][_0x741e('0x33')]:'N.A.','createdAt':moment(_0x28f68a[_0x741e('0x71')])['format'](_0x741e('0xb9'))[_0x741e('0x90')](),'closedAt':_0x28f68a[_0x741e('0xd4')]?moment(_0x28f68a[_0x741e('0xd5')])['format'](_0x741e('0xb9'))[_0x741e('0x90')]():'','disposition':_0x28f68a[_0x741e('0xd6')],'messages':_(_0x28f68a['Messages'])['filter']({'secret':![]})[_0x741e('0x32')](function(_0x5d9e09){return{'date':moment(_0x5d9e09[_0x741e('0x71')])[_0x741e('0xc7')](_0x741e('0xb9'))[_0x741e('0x90')](),'sender':_0x5d9e09[_0x741e('0xd7')]===_0x741e('0xd8')?_0x5d9e09[_0x741e('0xc9')]?_0x5d9e09[_0x741e('0xc9')]['fullname']:'System':_0x5d9e09['Contact'][_0x741e('0xd9')]+(_0x5d9e09[_0x741e('0xcb')][_0x741e('0xcc')]?'\x20'+_0x5d9e09[_0x741e('0xcb')]['lastName']:''),'body':_0x5d9e09[_0x741e('0xb0')],'direction':_0x5d9e09[_0x741e('0xd7')]===_0x741e('0xd8')?'A':'C','secret':_0x5d9e09[_0x741e('0xce')],'read':_0x5d9e09[_0x741e('0x77')]};})[_0x741e('0x5a')]()};return ejs[_0x741e('0xda')](path[_0x741e('0xc1')](config[_0x741e('0xc2')],'server','views','downloadInteraction.ejs'),{'interaction':_0x4df2d3})[_0x741e('0x2d')](function(_0x5a69d4){var _0x18600d=path['join'](_0x497169,_0x741e('0xdb')+_0x28f68a['id']+'-'+_0x1935a8+_0x741e('0xdc'));var _0x1463af={'path':_0x18600d,'channel':_0x741e('0xdd'),'interactionId':_0x28f68a['id']};return pdf[_0x741e('0xde')](_0x5a69d4,_0x1463af);})[_0x741e('0x2d')](function(){return new BPromise(function(_0x537044,_0x2f22f8){zipdir(_0x497169,{'saveTo':_0x261255},function(_0x90d195,_0x47e00b){if(_0x90d195)return _0x2f22f8(_0x90d195);return _0x537044(_0x47e00b);});})[_0x741e('0x2d')](function(){return new BPromise(function(_0x3b50d4,_0x8c337d){rimraf(_0x497169,function(_0x3c20e9){if(_0x3c20e9)_0x8c337d(_0x3c20e9);return _0x3b50d4();});});})['then'](function(){return _0x2da248[_0x741e('0xbf')](_0x261255,_0x22a317,function(_0x426d9f){if(_0x426d9f){console[_0x741e('0xdf')]('err',_0x426d9f);}else{fs[_0x741e('0xe0')](_0x261255);}});});});}else{return _0x2da248[_0x741e('0x21')](0xc8);}})[_0x741e('0x37')](handleError(_0x2da248,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index ee36e15..44dc66f 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 _0x5eb8=['SmsInteraction','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','then','unreadMessages','length','emit','hasOwnProperty','hook'];(function(_0x289cb5,_0x432784){var _0xfcc872=function(_0x2cd033){while(--_0x2cd033){_0x289cb5['push'](_0x289cb5['shift']());}};_0xfcc872(++_0x432784);}(_0x5eb8,0xb0));var _0x85eb=function(_0x30d87a,_0xf3a07f){_0x30d87a=_0x30d87a-0x0;var _0x48f64b=_0x5eb8[_0x30d87a];return _0x48f64b;};'use strict';var EventEmitter=require('events');var SmsInteraction=require('../../mysqldb')['db'][_0x85eb('0x0')];var SmsMessage=require(_0x85eb('0x1'))['db'][_0x85eb('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x85eb('0x3')](0x0);var events={'afterCreate':_0x85eb('0x4'),'afterUpdate':_0x85eb('0x5'),'afterDestroy':_0x85eb('0x6')};function emitEvent(_0x44e313){return function(_0x3c5798,_0x1fde1a,_0x2bf83c){_0x3c5798[_0x85eb('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x16d7b9){_0x3c5798[_0x85eb('0x8')](_0x85eb('0x9'),_0x16d7b9['map'](function(_0x2da3b0){return{'id':_0x2da3b0['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x3c5798['id'],'direction':'in','read':![]},'raw':!![]});})[_0x85eb('0xa')](function(_0x40d6b6){_0x3c5798[_0x85eb('0x8')](_0x85eb('0xb'),_0x40d6b6[_0x85eb('0xc')]);SmsInteractionEvents[_0x85eb('0xd')](_0x44e313+':'+_0x3c5798['id'],_0x3c5798);SmsInteractionEvents[_0x85eb('0xd')](_0x44e313,_0x3c5798);_0x2bf83c(null);})['catch'](_0x2bf83c(null));};}for(var e in events){if(events[_0x85eb('0xe')](e)){var event=events[e];SmsInteraction[_0x85eb('0xf')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x66fa=['remove','getUsers','then','setDataValue','map','findAll','emit','hasOwnProperty','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update'];(function(_0x5a4e93,_0x1eee27){var _0x2d3cd9=function(_0x265b03){while(--_0x265b03){_0x5a4e93['push'](_0x5a4e93['shift']());}};_0x2d3cd9(++_0x1eee27);}(_0x66fa,0x117));var _0xa66f=function(_0x4f38f9,_0x363d07){_0x4f38f9=_0x4f38f9-0x0;var _0x1cffec=_0x66fa[_0x4f38f9];return _0x1cffec;};'use strict';var EventEmitter=require(_0xa66f('0x0'));var SmsInteraction=require(_0xa66f('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0xa66f('0x1'))['db'][_0xa66f('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xa66f('0x3')](0x0);var events={'afterCreate':_0xa66f('0x4'),'afterUpdate':_0xa66f('0x5'),'afterDestroy':_0xa66f('0x6')};function emitEvent(_0x3f4904){return function(_0x5ebea5,_0x4fd9d0,_0x2239d3){_0x5ebea5[_0xa66f('0x7')]({'attributes':['id'],'raw':!![]})[_0xa66f('0x8')](function(_0x1d02fc){_0x5ebea5[_0xa66f('0x9')]('Users',_0x1d02fc[_0xa66f('0xa')](function(_0x4f6717){return{'id':_0x4f6717['id']};}));return SmsMessage[_0xa66f('0xb')]({'where':{'SmsInteractionId':_0x5ebea5['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x101e10){_0x5ebea5['setDataValue']('unreadMessages',_0x101e10['length']);SmsInteractionEvents[_0xa66f('0xc')](_0x3f4904+':'+_0x5ebea5['id'],_0x5ebea5);SmsInteractionEvents[_0xa66f('0xc')](_0x3f4904,_0x5ebea5);_0x2239d3(null);})['catch'](_0x2239d3(null));};}for(var e in events){if(events[_0xa66f('0xd')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xa66f('0xe')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index b39eff1..448ba43 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 _0x76b8=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsInteraction.attributes','SmsInteraction','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1c66c2,_0x5ae360){var _0x14619b=function(_0x5424a1){while(--_0x5424a1){_0x1c66c2['push'](_0x1c66c2['shift']());}};_0x14619b(++_0x5ae360);}(_0x76b8,0x186));var _0x876b=function(_0x150cc4,_0x15e9f1){_0x150cc4=_0x150cc4-0x0;var _0x22a995=_0x76b8[_0x150cc4];return _0x22a995;};'use strict';var _=require(_0x876b('0x0'));var util=require(_0x876b('0x1'));var logger=require(_0x876b('0x2'))(_0x876b('0x3'));var moment=require(_0x876b('0x4'));var BPromise=require(_0x876b('0x5'));var rp=require(_0x876b('0x6'));var fs=require('fs');var path=require(_0x876b('0x7'));var rimraf=require('rimraf');var config=require(_0x876b('0x8'));var attributes=require(_0x876b('0x9'));module['exports']=function(_0x74ddde,_0x17731b){return _0x74ddde['define'](_0x876b('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3fc992,_0x50c081,_0x4f452f){if(_0x3fc992[_0x876b('0xb')](_0x876b('0xc'))){_0x3fc992[_0x876b('0xd')]=moment()['format'](_0x876b('0xe'));}_0x4f452f(null,_0x3fc992);}}});}; \ No newline at end of file +var _0xf9ff=['api','moment','bluebird','request-promise','../../config/environment','define','SmsInteraction','sms_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger'];(function(_0x4ddbf5,_0x233f7e){var _0x325fdf=function(_0x49edf7){while(--_0x49edf7){_0x4ddbf5['push'](_0x4ddbf5['shift']());}};_0x325fdf(++_0x233f7e);}(_0xf9ff,0x16a));var _0xff9f=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0xf9ff[_0x455c6c];return _0x488242;};'use strict';var _=require(_0xff9f('0x0'));var util=require('util');var logger=require(_0xff9f('0x1'))(_0xff9f('0x2'));var moment=require(_0xff9f('0x3'));var BPromise=require(_0xff9f('0x4'));var rp=require(_0xff9f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xff9f('0x6'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x4570a4,_0x47bd61){return _0x4570a4[_0xff9f('0x7')](_0xff9f('0x8'),attributes,{'tableName':_0xff9f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x28a2b2,_0xbe8a54,_0x655a70){if(_0x28a2b2['changed'](_0xff9f('0xa'))){_0x28a2b2['closedAt']=moment()[_0xff9f('0xb')](_0xff9f('0xc'));}_0x655a70(null,_0x28a2b2);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index b2f7b76..e2f06f7 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 _0xf881=['attributes','then','debug','find','where','body','ids','spread','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateSmsInteraction','SmsInteraction','update','options','raw'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xf881,0x1d1));var _0x1f88=function(_0x9d91b0,_0x54b153){_0x9d91b0=_0x9d91b0-0x0;var _0x138732=_0xf881[_0x9d91b0];return _0x138732;};'use strict';var _=require(_0x1f88('0x0'));var util=require(_0x1f88('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1f88('0x2'));var fs=require('fs');var Redis=require(_0x1f88('0x3'));var db=require(_0x1f88('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1f88('0x5'))(_0x1f88('0x6'));var config=require(_0x1f88('0x7'));var jayson=require(_0x1f88('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x1f88('0x9')](config[_0x1f88('0xa')],{'host':_0x1f88('0xb'),'port':0x18eb});var socket=require(_0x1f88('0xc'))(new Redis(config['redis']));require(_0x1f88('0xd'))['register'](socket);function respondWithRpcPromise(_0x5d9890,_0x421009,_0x587a3d){return new BPromise(function(_0x3cf39a,_0x160a8){return client[_0x1f88('0xe')](_0x5d9890,_0x587a3d)['then'](function(_0x411eeb){logger[_0x1f88('0xf')](_0x1f88('0x10'),_0x421009,_0x1f88('0x11'));logger['debug'](_0x1f88('0x12'),_0x421009,_0x1f88('0x11'),JSON[_0x1f88('0x13')](_0x411eeb));if(_0x411eeb[_0x1f88('0x14')]){if(_0x411eeb[_0x1f88('0x14')][_0x1f88('0x15')]===0x1f4){logger[_0x1f88('0x14')](_0x1f88('0x10'),_0x421009,_0x411eeb[_0x1f88('0x14')][_0x1f88('0x16')]);return _0x160a8(_0x411eeb[_0x1f88('0x14')]['message']);}logger[_0x1f88('0x14')](_0x1f88('0x10'),_0x421009,_0x411eeb['error']['message']);return _0x3cf39a(_0x411eeb[_0x1f88('0x14')][_0x1f88('0x16')]);}else{logger[_0x1f88('0xf')]('SmsInteraction,\x20%s,\x20%s',_0x421009,'request\x20sent');_0x3cf39a(_0x411eeb[_0x1f88('0x17')][_0x1f88('0x16')]);}})['catch'](function(_0x390642){logger[_0x1f88('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x421009,_0x390642);_0x160a8(_0x390642);});});}exports[_0x1f88('0x18')]=function(_0x56fe57){var _0x21a258=this;return new Promise(function(_0x18ad78,_0x5c2831){return db[_0x1f88('0x19')][_0x1f88('0x1a')](_0x56fe57['body'],{'raw':_0x56fe57[_0x1f88('0x1b')]?_0x56fe57[_0x1f88('0x1b')][_0x1f88('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56fe57[_0x1f88('0x1b')]?_0x56fe57[_0x1f88('0x1b')]['where']||null:null,'attributes':_0x56fe57[_0x1f88('0x1b')]?_0x56fe57[_0x1f88('0x1b')][_0x1f88('0x1d')]||null:null,'limit':_0x56fe57[_0x1f88('0x1b')]?_0x56fe57[_0x1f88('0x1b')]['limit']||null:null})[_0x1f88('0x1e')](function(_0x444c56){logger['info']('UpdateSmsInteraction',_0x56fe57);logger[_0x1f88('0x1f')]('UpdateSmsInteraction',_0x56fe57,JSON[_0x1f88('0x13')](_0x444c56));_0x18ad78(_0x444c56);})['catch'](function(_0x38d2ee){logger[_0x1f88('0x14')]('UpdateSmsInteraction',_0x38d2ee[_0x1f88('0x16')],_0x56fe57);_0x5c2831(_0x21a258[_0x1f88('0x14')](0x1f4,_0x38d2ee['message']));});});};exports['AddTagsToSmsInteraction']=function(_0x22e5de){return new Promise(function(_0x3f3e8e,_0xf6720){return db[_0x1f88('0x19')][_0x1f88('0x20')]({'where':_0x22e5de['options']?_0x22e5de['options'][_0x1f88('0x21')]||null:null})[_0x1f88('0x1e')](function(_0xb7289c){if(_0xb7289c){return _0xb7289c['addTags'](_0x22e5de[_0x1f88('0x22')][_0x1f88('0x23')],_['omit'](_0x22e5de['body'],['ids','id'])||{});}})[_0x1f88('0x24')](function(_0x366205){logger[_0x1f88('0xf')](_0x1f88('0x25'),_0x22e5de);logger[_0x1f88('0x1f')]('AddTags',_0x22e5de,JSON[_0x1f88('0x13')](_0x366205));_0x3f3e8e(_0x366205);})['catch'](function(_0x1843fc){logger[_0x1f88('0x14')](_0x1f88('0x25'),_0x1843fc[_0x1f88('0x16')],_0x22e5de);_0xf6720(_this[_0x1f88('0x14')](0x1f4,_0x1843fc[_0x1f88('0x16')]));});});}; \ No newline at end of file +var _0xfd48=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','UpdateSmsInteraction','SmsInteraction','update','options','raw','where','attributes','limit','catch','AddTagsToSmsInteraction','addTags','ids','AddTags','lodash','bluebird','randomstring'];(function(_0x3ef2b9,_0x181bcf){var _0x42ff00=function(_0x9a7c6a){while(--_0x9a7c6a){_0x3ef2b9['push'](_0x3ef2b9['shift']());}};_0x42ff00(++_0x181bcf);}(_0xfd48,0xe7));var _0x8fd4=function(_0x153899,_0x5b19a4){_0x153899=_0x153899-0x0;var _0xb8e403=_0xfd48[_0x153899];return _0xb8e403;};'use strict';var _=require(_0x8fd4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8fd4('0x1'));var rs=require(_0x8fd4('0x2'));var fs=require('fs');var Redis=require(_0x8fd4('0x3'));var db=require(_0x8fd4('0x4'))['db'];var utils=require(_0x8fd4('0x5'));var logger=require(_0x8fd4('0x6'))(_0x8fd4('0x7'));var config=require(_0x8fd4('0x8'));var jayson=require(_0x8fd4('0x9'));var client=jayson[_0x8fd4('0xa')][_0x8fd4('0xb')]({'port':0x232a});config[_0x8fd4('0xc')]=_['defaults'](config[_0x8fd4('0xc')],{'host':_0x8fd4('0xd'),'port':0x18eb});var socket=require(_0x8fd4('0xe'))(new Redis(config[_0x8fd4('0xc')]));require('./smsInteraction.socket')[_0x8fd4('0xf')](socket);function respondWithRpcPromise(_0x3fa111,_0x2b5ac7,_0x1ba1c7){return new BPromise(function(_0x5b20c4,_0x41a6d2){return client[_0x8fd4('0x10')](_0x3fa111,_0x1ba1c7)[_0x8fd4('0x11')](function(_0x3af496){logger[_0x8fd4('0x12')](_0x8fd4('0x13'),_0x2b5ac7,_0x8fd4('0x14'));logger[_0x8fd4('0x15')](_0x8fd4('0x16'),_0x2b5ac7,_0x8fd4('0x14'),JSON[_0x8fd4('0x17')](_0x3af496));if(_0x3af496[_0x8fd4('0x18')]){if(_0x3af496['error']['code']===0x1f4){logger[_0x8fd4('0x18')](_0x8fd4('0x13'),_0x2b5ac7,_0x3af496[_0x8fd4('0x18')][_0x8fd4('0x19')]);return _0x41a6d2(_0x3af496[_0x8fd4('0x18')][_0x8fd4('0x19')]);}logger[_0x8fd4('0x18')](_0x8fd4('0x13'),_0x2b5ac7,_0x3af496[_0x8fd4('0x18')][_0x8fd4('0x19')]);return _0x5b20c4(_0x3af496['error'][_0x8fd4('0x19')]);}else{logger[_0x8fd4('0x12')](_0x8fd4('0x13'),_0x2b5ac7,'request\x20sent');_0x5b20c4(_0x3af496['result'][_0x8fd4('0x19')]);}})['catch'](function(_0x3c51b0){logger[_0x8fd4('0x18')]('SmsInteraction,\x20%s,\x20%s',_0x2b5ac7,_0x3c51b0);_0x41a6d2(_0x3c51b0);});});}exports[_0x8fd4('0x1a')]=function(_0x269a5d){var _0x25f90f=this;return new Promise(function(_0x47e78f,_0x4ea80a){return db[_0x8fd4('0x1b')][_0x8fd4('0x1c')](_0x269a5d['body'],{'raw':_0x269a5d['options']?_0x269a5d[_0x8fd4('0x1d')][_0x8fd4('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x269a5d[_0x8fd4('0x1d')]?_0x269a5d[_0x8fd4('0x1d')][_0x8fd4('0x1f')]||null:null,'attributes':_0x269a5d[_0x8fd4('0x1d')]?_0x269a5d[_0x8fd4('0x1d')][_0x8fd4('0x20')]||null:null,'limit':_0x269a5d[_0x8fd4('0x1d')]?_0x269a5d['options'][_0x8fd4('0x21')]||null:null})['then'](function(_0x1ba00b){logger[_0x8fd4('0x12')](_0x8fd4('0x1a'),_0x269a5d);logger[_0x8fd4('0x15')](_0x8fd4('0x1a'),_0x269a5d,JSON['stringify'](_0x1ba00b));_0x47e78f(_0x1ba00b);})[_0x8fd4('0x22')](function(_0x19c457){logger[_0x8fd4('0x18')](_0x8fd4('0x1a'),_0x19c457[_0x8fd4('0x19')],_0x269a5d);_0x4ea80a(_0x25f90f['error'](0x1f4,_0x19c457[_0x8fd4('0x19')]));});});};exports[_0x8fd4('0x23')]=function(_0x50746c){return new Promise(function(_0x593b1e,_0x2529b7){return db[_0x8fd4('0x1b')]['find']({'where':_0x50746c[_0x8fd4('0x1d')]?_0x50746c['options'][_0x8fd4('0x1f')]||null:null})[_0x8fd4('0x11')](function(_0x57c4c5){if(_0x57c4c5){return _0x57c4c5[_0x8fd4('0x24')](_0x50746c['body']['ids'],_['omit'](_0x50746c['body'],[_0x8fd4('0x25'),'id'])||{});}})['spread'](function(_0x1beb2c){logger[_0x8fd4('0x12')](_0x8fd4('0x26'),_0x50746c);logger[_0x8fd4('0x15')](_0x8fd4('0x26'),_0x50746c,JSON[_0x8fd4('0x17')](_0x1beb2c));_0x593b1e(_0x1beb2c);})[_0x8fd4('0x22')](function(_0x43c849){logger[_0x8fd4('0x18')](_0x8fd4('0x26'),_0x43c849['message'],_0x50746c);_0x2529b7(_this[_0x8fd4('0x18')](0x1f4,_0x43c849[_0x8fd4('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 7d43daa..34b8667 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 _0xc68e=['remove','emit','removeListener','register','smsInteraction:','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc68e,0x9b));var _0xec68=function(_0xff78b6,_0x381f63){_0xff78b6=_0xff78b6-0x0;var _0x29ad45=_0xc68e[_0xff78b6];return _0x29ad45;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xec68('0x0'),_0xec68('0x1'),'update'];function createListener(_0x14d4cb,_0x1be10b){return function(_0x2d41bc){_0x1be10b[_0xec68('0x2')](_0x14d4cb,_0x2d41bc);};}function removeListener(_0x344830,_0x5ec370){return function(){SmsInteractionEvents[_0xec68('0x3')](_0x344830,_0x5ec370);};}exports[_0xec68('0x4')]=function(_0x1e06ef){for(var _0xc751b4=0x0,_0x24dbe0=events['length'];_0xc751b4<_0x24dbe0;_0xc751b4++){var _0x53f7e9=events[_0xc751b4];var _0x4400b5=createListener(_0xec68('0x5')+_0x53f7e9,_0x1e06ef);SmsInteractionEvents['on'](_0x53f7e9,_0x4400b5);}}; \ No newline at end of file +var _0xab29=['smsInteraction:','./smsInteraction.events','remove','update','emit','removeListener','register','length'];(function(_0x4f16c8,_0x151bf0){var _0x57c4a2=function(_0x31f0c0){while(--_0x31f0c0){_0x4f16c8['push'](_0x4f16c8['shift']());}};_0x57c4a2(++_0x151bf0);}(_0xab29,0x81));var _0x9ab2=function(_0x30fe50,_0x17952e){_0x30fe50=_0x30fe50-0x0;var _0x573d17=_0xab29[_0x30fe50];return _0x573d17;};'use strict';var SmsInteractionEvents=require(_0x9ab2('0x0'));var events=['save',_0x9ab2('0x1'),_0x9ab2('0x2')];function createListener(_0x5bb013,_0x462b5a){return function(_0x34da26){_0x462b5a[_0x9ab2('0x3')](_0x5bb013,_0x34da26);};}function removeListener(_0x269046,_0x3d40fe){return function(){SmsInteractionEvents[_0x9ab2('0x4')](_0x269046,_0x3d40fe);};}exports[_0x9ab2('0x5')]=function(_0x33c02e){for(var _0x12c793=0x0,_0x197ea9=events[_0x9ab2('0x6')];_0x12c793<_0x197ea9;_0x12c793++){var _0x33efcb=events[_0x12c793];var _0x431d6b=createListener(_0x9ab2('0x7')+_0x33efcb,_0x33c02e);SmsInteractionEvents['on'](_0x33efcb,_0x431d6b);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 06cbabc..d6772b7 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 _0x0cde=['accept','/:id/reject','reject','delete','destroy','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','/:id','show','tracked','smsmessage:create','create','post','/:id/status','status','put','update'];(function(_0x43109a,_0x1539ee){var _0x7d63da=function(_0x4aacd1){while(--_0x4aacd1){_0x43109a['push'](_0x43109a['shift']());}};_0x7d63da(++_0x1539ee);}(_0x0cde,0x1d0));var _0xe0cd=function(_0x2b4db2,_0x178dc9){_0x2b4db2=_0x2b4db2-0x0;var _0x5d54cc=_0x0cde[_0x2b4db2];return _0x5d54cc;};'use strict';var multer=require('multer');var util=require(_0xe0cd('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe0cd('0x1'));var router=express[_0xe0cd('0x2')]();var fs_extra=require(_0xe0cd('0x3'));var auth=require(_0xe0cd('0x4'));var interaction=require(_0xe0cd('0x5'));var config=require(_0xe0cd('0x6'));var controller=require(_0xe0cd('0x7'));router[_0xe0cd('0x8')]('/',auth[_0xe0cd('0x9')](),controller[_0xe0cd('0xa')]);router['get'](_0xe0cd('0xb'),auth[_0xe0cd('0x9')](),controller['describe']);router['get'](_0xe0cd('0xc'),auth[_0xe0cd('0x9')](),controller[_0xe0cd('0xd')]);router['post']('/',auth[_0xe0cd('0x9')](),interaction[_0xe0cd('0xe')]('sms',_0xe0cd('0xf')),controller[_0xe0cd('0x10')]);router[_0xe0cd('0x11')](_0xe0cd('0x12'),controller[_0xe0cd('0x13')]);router[_0xe0cd('0x14')](_0xe0cd('0xc'),auth['isAuthenticated'](),controller[_0xe0cd('0x15')]);router[_0xe0cd('0x14')]('/:id/accept',auth[_0xe0cd('0x9')](),controller[_0xe0cd('0x16')]);router[_0xe0cd('0x14')](_0xe0cd('0x17'),auth[_0xe0cd('0x9')](),controller[_0xe0cd('0x18')]);router[_0xe0cd('0x19')](_0xe0cd('0xc'),auth[_0xe0cd('0x9')](),controller[_0xe0cd('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x20fb=['get','index','/describe','isAuthenticated','describe','/:id','show','post','tracked','/:id/status','status','put','update','accept','/:id/reject','reject','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./smsMessage.controller'];(function(_0x3ee55a,_0x19aeea){var _0x581800=function(_0x636cb7){while(--_0x636cb7){_0x3ee55a['push'](_0x3ee55a['shift']());}};_0x581800(++_0x19aeea);}(_0x20fb,0x1b2));var _0xb20f=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x20fb[_0x164eca];return _0x2ce562;};'use strict';var multer=require(_0xb20f('0x0'));var util=require(_0xb20f('0x1'));var path=require(_0xb20f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb20f('0x3')]();var fs_extra=require(_0xb20f('0x4'));var auth=require(_0xb20f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb20f('0x6'));var controller=require(_0xb20f('0x7'));router[_0xb20f('0x8')]('/',auth['isAuthenticated'](),controller[_0xb20f('0x9')]);router[_0xb20f('0x8')](_0xb20f('0xa'),auth[_0xb20f('0xb')](),controller[_0xb20f('0xc')]);router[_0xb20f('0x8')](_0xb20f('0xd'),auth[_0xb20f('0xb')](),controller[_0xb20f('0xe')]);router[_0xb20f('0xf')]('/',auth[_0xb20f('0xb')](),interaction[_0xb20f('0x10')]('sms','smsmessage:create'),controller['create']);router[_0xb20f('0xf')](_0xb20f('0x11'),controller[_0xb20f('0x12')]);router[_0xb20f('0x13')](_0xb20f('0xd'),auth[_0xb20f('0xb')](),controller[_0xb20f('0x14')]);router[_0xb20f('0x13')]('/:id/accept',auth['isAuthenticated'](),controller[_0xb20f('0x15')]);router[_0xb20f('0x13')](_0xb20f('0x16'),auth[_0xb20f('0xb')](),controller[_0xb20f('0x17')]);router['delete'](_0xb20f('0xd'),auth['isAuthenticated'](),controller[_0xb20f('0x18')]);module[_0xb20f('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 11ce2d7..b20a69b 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 _0x84cc=['TEXT','medium','BOOLEAN','out','STRING','DATE','sequelize'];(function(_0x3e2739,_0x146720){var _0x1c80af=function(_0x20cb96){while(--_0x20cb96){_0x3e2739['push'](_0x3e2739['shift']());}};_0x1c80af(++_0x146720);}(_0x84cc,0x1c6));var _0xc84c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x84cc[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xc84c('0x0'));module['exports']={'body':{'type':Sequelize[_0xc84c('0x1')](_0xc84c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xc84c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xc84c('0x4')),'defaultValue':_0xc84c('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xc84c('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xc84c('0x6')]},'secret':{'type':Sequelize[_0xc84c('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xc84c('0x5')]},'providerResponse':{'type':Sequelize[_0xc84c('0x1')]}}; \ No newline at end of file +var _0xec32=['ENUM','out','STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0xec32,0xb8));var _0x2ec3=function(_0x5b00fe,_0x4e5a0a){_0x5b00fe=_0x5b00fe-0x0;var _0x5aee5c=_0xec32[_0x5b00fe];return _0x5aee5c;};'use strict';var Sequelize=require(_0x2ec3('0x0'));module[_0x2ec3('0x1')]={'body':{'type':Sequelize[_0x2ec3('0x2')](_0x2ec3('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x2ec3('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2ec3('0x5')]('in','out'),'defaultValue':_0x2ec3('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x2ec3('0x7')]},'readAt':{'type':Sequelize[_0x2ec3('0x8')]},'secret':{'type':Sequelize[_0x2ec3('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x2ec3('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 099ace1..fda120a 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 _0x1967=['where','type','VIRTUAL','include','rows','show','params','rawAttributes','includeAll','merge','options','find','create','body','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','get','info','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','email','internal','rejectmessage','SmsAccount','SmsAccountId','inspect','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','sent','delivered','plivio','infobip','results','groupName','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsMessage.socket','register','jayson/promise','http','request','then','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','SmsMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','end','name','send','index','map','SmsMessage','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','pick','filters','filter'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x1967,0x173));var _0x7196=function(_0x35129b,_0x1def4e){_0x35129b=_0x35129b-0x0;var _0x28b627=_0x1967[_0x35129b];return _0x28b627;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];config[_0x7196('0x1c')]=_[_0x7196('0x1d')](config[_0x7196('0x1c')],{'host':_0x7196('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7196('0x1c')]));require(_0x7196('0x1f'))[_0x7196('0x20')](socket);var jayson=require(_0x7196('0x21'));var client=jayson['client'][_0x7196('0x22')]({'port':0x232c});var client9002=jayson['client'][_0x7196('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x2590a6,_0xf7e97,_0x3ed1ad,_0x12dce7){return new BPromise(function(_0x2e3e0e,_0x22bd62){var _0x1ed296=_0x12dce7||client;return _0x1ed296[_0x7196('0x23')](_0x2590a6,_0x3ed1ad)[_0x7196('0x24')](function(_0x385f2d){logger['info']('SmsMessage,\x20%s,\x20%s',_0xf7e97,_0x7196('0x25'));logger[_0x7196('0x26')](_0x7196('0x27'),_0xf7e97,'request\x20sent',JSON[_0x7196('0x28')](_0x385f2d));if(_0x385f2d['error']){if(_0x385f2d['error'][_0x7196('0x29')]===0x1f4){logger[_0x7196('0x2a')](_0x7196('0x2b'),_0xf7e97,_0x385f2d['error']['message']);return _0x22bd62(_0x385f2d[_0x7196('0x2a')][_0x7196('0x2c')]);}logger['error'](_0x7196('0x2b'),_0xf7e97,_0x385f2d[_0x7196('0x2a')][_0x7196('0x2c')]);return _0x2e3e0e(_0x385f2d[_0x7196('0x2a')][_0x7196('0x2c')]);}else{logger['info'](_0x7196('0x2b'),_0xf7e97,'request\x20sent');_0x2e3e0e(_0x385f2d[_0x7196('0x2d')][_0x7196('0x2c')]);}})[_0x7196('0x2e')](function(_0xa69810){logger[_0x7196('0x2a')](_0x7196('0x2b'),_0xf7e97,_0xa69810);_0x22bd62(_0xa69810);});});}function respondWithStatusCode(_0x530ab5,_0x57c404){_0x57c404=_0x57c404||0xcc;return function(_0x1482e5){if(_0x1482e5){return _0x530ab5[_0x7196('0x2f')](_0x57c404);}return _0x530ab5[_0x7196('0x30')](_0x57c404)['end']();};}function respondWithResult(_0x5aa538,_0x41cfd2){_0x41cfd2=_0x41cfd2||0xc8;return function(_0x162cfc){if(_0x162cfc){return _0x5aa538[_0x7196('0x30')](_0x41cfd2)['json'](_0x162cfc);}};}function respondWithFilteredResult(_0x35eef9,_0x4ecea1){return function(_0x4fd339){if(_0x4fd339){var _0x59d79d=typeof _0x4ecea1[_0x7196('0x31')]===_0x7196('0x32')&&typeof _0x4ecea1[_0x7196('0x33')]==='undefined';var _0x35116f=_0x4fd339[_0x7196('0x34')];var _0x2f9583=_0x59d79d?0x0:_0x4ecea1[_0x7196('0x31')];var _0x50c386=_0x59d79d?_0x4fd339[_0x7196('0x34')]:_0x4ecea1[_0x7196('0x31')]+_0x4ecea1[_0x7196('0x33')];var _0x651d7e;if(_0x50c386>=_0x35116f){_0x50c386=_0x35116f;_0x651d7e=0xc8;}else{_0x651d7e=0xce;}_0x35eef9[_0x7196('0x30')](_0x651d7e);return _0x35eef9[_0x7196('0x35')](_0x7196('0x36'),_0x2f9583+'-'+_0x50c386+'/'+_0x35116f)[_0x7196('0x37')](_0x4fd339);}return null;};}function patchUpdates(_0x354175){return function(_0xf33b59){try{jsonpatch[_0x7196('0x38')](_0xf33b59,_0x354175,!![]);}catch(_0x54e46b){return BPromise[_0x7196('0x39')](_0x54e46b);}return _0xf33b59['save']();};}function saveUpdates(_0x2452f6,_0x4c3365){return function(_0x372ddc){if(_0x372ddc){return _0x372ddc[_0x7196('0x3a')](_0x2452f6)['then'](function(_0x628e7d){return _0x628e7d;});}return null;};}function removeEntity(_0x2bcadd,_0x4531d7){return function(_0x3a56b4){if(_0x3a56b4){return _0x3a56b4[_0x7196('0x3b')]()['then'](function(){_0x2bcadd[_0x7196('0x30')](0xcc)[_0x7196('0x3c')]();});}};}function handleEntityNotFound(_0x2174ca,_0xf2b652){return function(_0x3e8f98){if(!_0x3e8f98){_0x2174ca[_0x7196('0x2f')](0x194);}return _0x3e8f98;};}function handleError(_0x50a101,_0x23d7aa){_0x23d7aa=_0x23d7aa||0x1f4;return function(_0xe04e44){logger[_0x7196('0x2a')](_0xe04e44['stack']);if(_0xe04e44[_0x7196('0x3d')]){delete _0xe04e44[_0x7196('0x3d')];}_0x50a101[_0x7196('0x30')](_0x23d7aa)[_0x7196('0x3e')](_0xe04e44);};}exports[_0x7196('0x3f')]=function(_0x31fca7,_0x938e49){var _0x1ab720={},_0x92cfb1={},_0x3ee114={'count':0x0,'rows':[]};var _0x5354d3=_[_0x7196('0x40')](db[_0x7196('0x41')]['rawAttributes'],function(_0x186efe){return{'name':_0x186efe['fieldName'],'type':_0x186efe['type'][_0x7196('0x42')]};});_0x92cfb1[_0x7196('0x43')]=_['map'](_0x5354d3,'name');_0x92cfb1[_0x7196('0x44')]=_[_0x7196('0x45')](_0x31fca7[_0x7196('0x44')]);_0x92cfb1['filters']=_[_0x7196('0x46')](_0x92cfb1[_0x7196('0x43')],_0x92cfb1[_0x7196('0x44')]);_0x1ab720[_0x7196('0x47')]=_[_0x7196('0x46')](_0x92cfb1[_0x7196('0x43')],qs[_0x7196('0x48')](_0x31fca7[_0x7196('0x44')]['fields']));_0x1ab720[_0x7196('0x47')]=_0x1ab720[_0x7196('0x47')]['length']?_0x1ab720[_0x7196('0x47')]:_0x92cfb1[_0x7196('0x43')];if(!_0x31fca7['query'][_0x7196('0x49')](_0x7196('0x4a'))){_0x1ab720[_0x7196('0x33')]=qs['limit'](_0x31fca7[_0x7196('0x44')][_0x7196('0x33')]);_0x1ab720['offset']=qs[_0x7196('0x31')](_0x31fca7[_0x7196('0x44')]['offset']);}_0x1ab720[_0x7196('0x4b')]=qs['sort'](_0x31fca7['query']['sort']);_0x1ab720['where']=qs['filters'](_[_0x7196('0x4c')](_0x31fca7['query'],_0x92cfb1[_0x7196('0x4d')]),_0x5354d3);if(_0x31fca7[_0x7196('0x44')][_0x7196('0x4e')]){_0x1ab720[_0x7196('0x4f')]=_['merge'](_0x1ab720[_0x7196('0x4f')],{'$or':_['map'](_0x5354d3,function(_0x12ee76){if(_0x12ee76[_0x7196('0x50')]!==_0x7196('0x51')){var _0x5e34e8={};_0x5e34e8[_0x12ee76[_0x7196('0x3d')]]={'$like':'%'+_0x31fca7[_0x7196('0x44')][_0x7196('0x4e')]+'%'};return _0x5e34e8;}})});}_0x1ab720=_['merge']({},_0x1ab720,_0x31fca7['options']);var _0x1faa7b={'where':_0x1ab720['where']};return db[_0x7196('0x41')]['count'](_0x1faa7b)['then'](function(_0x14b489){_0x3ee114['count']=_0x14b489;if(_0x31fca7['query']['includeAll']){_0x1ab720[_0x7196('0x52')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x1ab720);})[_0x7196('0x24')](function(_0x182c8b){_0x3ee114[_0x7196('0x53')]=_0x182c8b;return _0x3ee114;})[_0x7196('0x24')](respondWithFilteredResult(_0x938e49,_0x1ab720))['catch'](handleError(_0x938e49,null));};exports[_0x7196('0x54')]=function(_0x564688,_0x36844f){var _0x143c58={'raw':!![],'where':{'id':_0x564688[_0x7196('0x55')]['id']}},_0x513855={};_0x513855[_0x7196('0x43')]=_[_0x7196('0x45')](db['SmsMessage'][_0x7196('0x56')]);_0x513855['query']=_[_0x7196('0x45')](_0x564688[_0x7196('0x44')]);_0x513855[_0x7196('0x4d')]=_[_0x7196('0x46')](_0x513855[_0x7196('0x43')],_0x513855[_0x7196('0x44')]);_0x143c58[_0x7196('0x47')]=_[_0x7196('0x46')](_0x513855['model'],qs['fields'](_0x564688[_0x7196('0x44')][_0x7196('0x48')]));_0x143c58[_0x7196('0x47')]=_0x143c58[_0x7196('0x47')]['length']?_0x143c58[_0x7196('0x47')]:_0x513855[_0x7196('0x43')];if(_0x564688[_0x7196('0x44')][_0x7196('0x57')]){_0x143c58[_0x7196('0x52')]=[{'all':!![]}];}_0x143c58=_[_0x7196('0x58')]({},_0x143c58,_0x564688[_0x7196('0x59')]);return db[_0x7196('0x41')][_0x7196('0x5a')](_0x143c58)[_0x7196('0x24')](handleEntityNotFound(_0x36844f,null))[_0x7196('0x24')](respondWithResult(_0x36844f,null))['catch'](handleError(_0x36844f,null));};exports[_0x7196('0x5b')]=function(_0x6b65c1,_0x10ee13){return db['SmsMessage'][_0x7196('0x5b')](_0x6b65c1['body'],{})[_0x7196('0x24')](respondWithResult(_0x10ee13,0xc9))[_0x7196('0x2e')](handleError(_0x10ee13,null));};exports[_0x7196('0x3a')]=function(_0x3e74ef,_0x469bac){if(_0x3e74ef['body']['id']){delete _0x3e74ef[_0x7196('0x5c')]['id'];}return db['SmsMessage']['find']({'where':{'id':_0x3e74ef['params']['id']}})[_0x7196('0x24')](handleEntityNotFound(_0x469bac,null))[_0x7196('0x24')](saveUpdates(_0x3e74ef[_0x7196('0x5c')],null))[_0x7196('0x24')](respondWithResult(_0x469bac,null))[_0x7196('0x2e')](handleError(_0x469bac,null));};exports[_0x7196('0x3b')]=function(_0x2d8b3d,_0x560ddb){return db[_0x7196('0x41')][_0x7196('0x5a')]({'where':{'id':_0x2d8b3d[_0x7196('0x55')]['id']}})[_0x7196('0x24')](handleEntityNotFound(_0x560ddb,null))[_0x7196('0x24')](removeEntity(_0x560ddb,null))['catch'](handleError(_0x560ddb,null));};exports['describe']=function(_0xa7ecfb,_0x1c7eb2){return db[_0x7196('0x41')][_0x7196('0x5d')]()[_0x7196('0x24')](respondWithResult(_0x1c7eb2,null))[_0x7196('0x2e')](handleError(_0x1c7eb2,null));};var interaction_log=require(_0x7196('0x16'))(_0x7196('0x5e'));exports[_0x7196('0x5f')]=function(_0x2caadd,_0x4cb49b,_0x57d729){var _0x33dee7={'agent':{},'channel':_0x7196('0x60')};if(_0x2caadd[_0x7196('0x5c')]['id']){delete _0x2caadd[_0x7196('0x5c')]['id'];}_0x2caadd['body'][_0x7196('0x61')]=!![];_0x2caadd[_0x7196('0x5c')][_0x7196('0x62')]=moment()[_0x7196('0x63')](_0x7196('0x64'));_0x2caadd[_0x7196('0x5c')][_0x7196('0x65')]=_0x2caadd['body'][_0x7196('0x65')]||_0x2caadd[_0x7196('0x66')]['id'];_0x33dee7[_0x7196('0x67')]['id']=_0x2caadd[_0x7196('0x5c')]['UserId'];return db[_0x7196('0x41')][_0x7196('0x5a')]({'where':{'id':_0x2caadd[_0x7196('0x55')]['id'],'UserId':null}})[_0x7196('0x24')](handleEntityNotFound(_0x4cb49b,null))[_0x7196('0x24')](saveUpdates(_0x2caadd[_0x7196('0x5c')],null))[_0x7196('0x24')](function(_0x517dfb){if(_0x517dfb){_0x33dee7['message']=_0x517dfb['get']({'plain':!![]});return db[_0x7196('0x68')]['find']({'where':{'id':_0x517dfb[_0x7196('0x69')]}});}return null;})[_0x7196('0x24')](handleEntityNotFound(_0x4cb49b,null))[_0x7196('0x24')](function(_0x37c7d4){if(_0x37c7d4){return _0x37c7d4[_0x7196('0x3a')]({'UserId':_0x2caadd[_0x7196('0x5c')][_0x7196('0x65')],'read1stAt':_[_0x7196('0x6a')](_0x37c7d4[_0x7196('0x6b')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x7196('0x24')](function(_0x3f939a){if(_0x3f939a){_0x33dee7[_0x7196('0x6c')]=_0x3f939a[_0x7196('0x6d')]({'plain':!![]});interaction_log[_0x7196('0x6e')](_0x7196('0x6f'),_0x2caadd[_0x7196('0x66')]['id'],_0x2caadd[_0x7196('0x66')]['name'],_0x2caadd['user'][_0x7196('0x70')],_0x33dee7['interaction']['id'],_0x2caadd[_0x7196('0x5c')]?JSON['stringify'](_0x2caadd[_0x7196('0x5c')]):_0x7196('0x71'));return respondWithRpcPromise(_0x7196('0x72'),_0x7196('0x73'),_0x33dee7);}return null;})['then'](function(_0x5a786a){var _0x33d301='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5a786a[_0x7196('0x2c')][_0x7196('0x74')];return db[_0x7196('0x75')][_0x7196('0x44')](_0x33d301,{'type':db[_0x7196('0x76')][_0x7196('0x77')]['SELECT'],'raw':!![]})[_0x7196('0x24')](function(_0x25b862){return _0x25b862;});})[_0x7196('0x24')](function(_0x294a4b){if(_0x294a4b){_0x33dee7[_0x7196('0x2c')][_0x7196('0x78')]=_0x294a4b[0x0];if(!_0x2caadd[_0x7196('0x5c')][_0x7196('0x65')])return;return db[_0x7196('0x79')][_0x7196('0x5a')]({'where':{'id':_0x2caadd[_0x7196('0x5c')][_0x7196('0x65')],'role':'agent'},'attributes':['id',_0x7196('0x3d'),_0x7196('0x7a'),'email','internal'],'raw':!![]});}return null;})[_0x7196('0x24')](function(_0x45363c){if(!_0x45363c)return null;_0x33dee7[_0x7196('0x2c')]['agent']=_0x45363c;return _0x33dee7;})[_0x7196('0x24')](function(_0x550454){if(_0x550454){if(_0x2caadd[_0x7196('0x5c')][_0x7196('0x7b')]){_0x33dee7['message'][_0x7196('0x7c')]=util['format']('SIP/%s',_0x2caadd[_0x7196('0x66')][_0x7196('0x3d')]);_0x33dee7[_0x7196('0x2c')]['channel']=_0x33dee7[_0x7196('0x7d')];_0x33dee7['message'][_0x7196('0x7e')]=_0x33dee7[_0x7196('0x7d')];_0x33dee7[_0x7196('0x2c')][_0x7196('0x7f')]=_0x7196('0x5f');return respondWithRpcPromise('EventManager',_0x7196('0x80'),{'event':_0x7196('0x81'),'message':_0x33dee7[_0x7196('0x2c')]},client9002)[_0x7196('0x24')](function(){return _0x33dee7;});}return _0x33dee7;}return null;})[_0x7196('0x24')](respondWithResult(_0x4cb49b,null))[_0x7196('0x2e')](handleError(_0x4cb49b,null));};var interaction_log=require(_0x7196('0x16'))(_0x7196('0x5e'));exports['reject']=function(_0x2be199,_0x1919d8,_0x28a29d){var _0x2b899d={'agent':{},'channel':'sms'};if(_0x2be199[_0x7196('0x5c')]['id']){delete _0x2be199[_0x7196('0x5c')]['id'];}_0x2be199['body'][_0x7196('0x65')]=_0x2be199['body'][_0x7196('0x65')]||_0x2be199['user']['id'];_0x2b899d[_0x7196('0x67')]['id']=_0x2be199[_0x7196('0x5c')]['UserId'];return db[_0x7196('0x41')][_0x7196('0x5a')]({'where':{'id':_0x2be199[_0x7196('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1919d8,null))['then'](function(_0x1c5a41){if(_0x1c5a41){_0x2b899d['message']=_0x1c5a41['get']({'plain':!![]});return db[_0x7196('0x68')][_0x7196('0x5a')]({'where':{'id':_0x1c5a41[_0x7196('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x1919d8,null))[_0x7196('0x24')](function(_0x59370b){if(_0x59370b){_0x2b899d[_0x7196('0x6c')]=_0x59370b[_0x7196('0x6d')]({'plain':!![]});interaction_log[_0x7196('0x6e')](_0x7196('0x82'),_0x2be199[_0x7196('0x66')]['id'],_0x2be199[_0x7196('0x66')][_0x7196('0x3d')],_0x2be199[_0x7196('0x66')][_0x7196('0x70')],_0x2b899d['interaction']['id'],_0x2be199['body']?JSON[_0x7196('0x28')](_0x2be199['body']):'null');return respondWithRpcPromise(_0x7196('0x83'),_0x7196('0x84'),_0x2b899d);}return null;})[_0x7196('0x24')](function(_0x3fe7fd){var _0x4c9a66='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3fe7fd[_0x7196('0x2c')][_0x7196('0x74')];return db[_0x7196('0x75')][_0x7196('0x44')](_0x4c9a66,{'type':db['Sequelize'][_0x7196('0x77')]['SELECT'],'raw':!![]})['then'](function(_0x2820ef){return _0x2820ef;});})[_0x7196('0x24')](function(_0x1e14da){if(_0x1e14da){_0x2b899d['message'][_0x7196('0x78')]=_0x1e14da[0x0];if(!_0x2be199[_0x7196('0x5c')][_0x7196('0x65')])return;return db[_0x7196('0x79')][_0x7196('0x5a')]({'where':{'id':_0x2be199[_0x7196('0x5c')][_0x7196('0x65')],'role':_0x7196('0x67')},'attributes':['id','name',_0x7196('0x7a'),_0x7196('0x85'),_0x7196('0x86')],'raw':!![]});}return null;})[_0x7196('0x24')](function(_0x1a1c82){if(!_0x1a1c82)return null;_0x2b899d['message'][_0x7196('0x67')]=_0x1a1c82;return _0x2b899d;})[_0x7196('0x24')](function(_0x446eb8){if(_0x446eb8){_0x446eb8['message'][_0x7196('0x7c')]=util['format']('SIP/%s',_0x2be199[_0x7196('0x66')][_0x7196('0x3d')]);_0x446eb8['message'][_0x7196('0x7d')]=_0x2b899d[_0x7196('0x7d')];_0x446eb8['message'][_0x7196('0x7e')]=_0x2b899d[_0x7196('0x7d')];_0x446eb8[_0x7196('0x2c')][_0x7196('0x7f')]=_0x7196('0x39');respondWithRpcPromise(_0x7196('0x80'),'EventManager',{'event':_0x7196('0x87'),'message':_0x446eb8[_0x7196('0x2c')]},client9002);return _0x2b899d;}return null;})[_0x7196('0x24')](respondWithResult(_0x1919d8,null))['catch'](handleError(_0x1919d8,null));};exports['status']=function(_0x4a9b34,_0x1ae7cb,_0x3e104f){if(_0x4a9b34[_0x7196('0x5c')]['id']){delete _0x4a9b34['body']['id'];}var _0x4659d5;return db['SmsMessage'][_0x7196('0x5a')]({'where':{'id':_0x4a9b34['params']['id']}})[_0x7196('0x24')](handleEntityNotFound(_0x1ae7cb,null))[_0x7196('0x24')](function(_0x33d5bf){if(_0x33d5bf){_0x4659d5=_0x33d5bf;return db[_0x7196('0x88')][_0x7196('0x5a')]({'where':{'id':_0x33d5bf[_0x7196('0x89')]}});}})[_0x7196('0x24')](handleEntityNotFound(_0x1ae7cb,null))['then'](function(_0x301bba){if(_0x301bba){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0x301bba['type'],util[_0x7196('0x8a')](_0x4a9b34[_0x7196('0x5c')],{'showHidden':![],'depth':null}));switch(_0x301bba[_0x7196('0x50')]){case'twilio':if(_0x4a9b34[_0x7196('0x5c')]['MessageSid']&&_0x4a9b34['body']['MessageSid']===_0x4659d5[_0x7196('0x8b')]){return _0x4659d5['update']({'read':!![]});}else{logger[_0x7196('0x2a')](_0x7196('0x8c'),_0x7196('0x30'),_0x7196('0x8d'),util[_0x7196('0x8a')](_0x4a9b34[_0x7196('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x7196('0x8e'):if(_0x4a9b34[_0x7196('0x5c')]['MessageUUID']&&_0x4a9b34[_0x7196('0x5c')][_0x7196('0x8f')]===_0x4659d5[_0x7196('0x8b')]&&_['indexOf']([_0x7196('0x90'),_0x7196('0x91')],_0x4a9b34[_0x7196('0x5c')]['Status'])>=0x0){return _0x4659d5[_0x7196('0x3a')]({'read':!![]});}else{logger[_0x7196('0x2a')](_0x7196('0x8c'),'status',_0x7196('0x92'),util[_0x7196('0x8a')](_0x4a9b34['body'],{'showHidden':![],'depth':null}));}break;case _0x7196('0x93'):var _0x5db5f1=_0x4a9b34[_0x7196('0x5c')][_0x7196('0x94')][0x0];if(_0x5db5f1['status'][_0x7196('0x95')]==='DELIVERED'){return _0x4659d5[_0x7196('0x3a')]({'read':!![]});}else{logger[_0x7196('0x2a')](_0x7196('0x8c'),'status',_0x7196('0x93'),util[_0x7196('0x8a')](_0x4a9b34[_0x7196('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x4659d5;}})[_0x7196('0x24')](respondWithResult(_0x1ae7cb,null))['catch'](handleError(_0x1ae7cb,null));}; \ No newline at end of file +var _0xe98c=['destroy','describe','sms-interactions','accept','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','get','SmsInteraction','SmsInteractionId','UserId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','agent','fullname','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','role','RejectMessage','rejectMessage','Sequelize','motionChannel','rejectmessage','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','indexOf','delivered','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./smsMessage.socket','jayson/promise','http','client','request','info','SmsMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','then','stack','name','index','SmsMessage','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','show','params','rawAttributes','fields','find','create','body','update'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xe98c,0xd3));var _0xce98=function(_0x4caff1,_0x4d7ce1){_0x4caff1=_0x4caff1-0x0;var _0x2e088f=_0xe98c[_0x4caff1];return _0x2e088f;};'use strict';var emlformat=require(_0xce98('0x0'));var rimraf=require(_0xce98('0x1'));var zipdir=require(_0xce98('0x2'));var jsonpatch=require(_0xce98('0x3'));var rp=require(_0xce98('0x4'));var moment=require('moment');var BPromise=require(_0xce98('0x5'));var Mustache=require(_0xce98('0x6'));var util=require(_0xce98('0x7'));var path=require(_0xce98('0x8'));var sox=require(_0xce98('0x9'));var csv=require(_0xce98('0xa'));var ejs=require(_0xce98('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xce98('0xc'));var squel=require(_0xce98('0xd'));var crypto=require(_0xce98('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xce98('0xf'));var toCsv=require('to-csv');var querystring=require(_0xce98('0x10'));var Papa=require('papaparse');var Redis=require(_0xce98('0x11'));var authService=require(_0xce98('0x12'));var qs=require(_0xce98('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xce98('0x14'));var logger=require(_0xce98('0x15'))(_0xce98('0x16'));var utils=require('../../config/utils');var config=require(_0xce98('0x17'));var licenseUtil=require(_0xce98('0x18'));var db=require(_0xce98('0x19'))['db'];config[_0xce98('0x1a')]=_[_0xce98('0x1b')](config[_0xce98('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xce98('0x1a')]));require(_0xce98('0x1c'))['register'](socket);var jayson=require(_0xce98('0x1d'));var client=jayson['client'][_0xce98('0x1e')]({'port':0x232c});var client9002=jayson[_0xce98('0x1f')][_0xce98('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0xd68d7d,_0x176b15,_0x3460f5,_0x2613b0){return new BPromise(function(_0x1944e2,_0x147392){var _0x4d69a1=_0x2613b0||client;return _0x4d69a1[_0xce98('0x20')](_0xd68d7d,_0x3460f5)['then'](function(_0xd0ef6e){logger[_0xce98('0x21')](_0xce98('0x22'),_0x176b15,'request\x20sent');logger[_0xce98('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x176b15,_0xce98('0x24'),JSON[_0xce98('0x25')](_0xd0ef6e));if(_0xd0ef6e['error']){if(_0xd0ef6e[_0xce98('0x26')][_0xce98('0x27')]===0x1f4){logger[_0xce98('0x26')](_0xce98('0x22'),_0x176b15,_0xd0ef6e[_0xce98('0x26')]['message']);return _0x147392(_0xd0ef6e[_0xce98('0x26')][_0xce98('0x28')]);}logger[_0xce98('0x26')](_0xce98('0x22'),_0x176b15,_0xd0ef6e[_0xce98('0x26')]['message']);return _0x1944e2(_0xd0ef6e[_0xce98('0x26')][_0xce98('0x28')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x176b15,_0xce98('0x24'));_0x1944e2(_0xd0ef6e[_0xce98('0x29')][_0xce98('0x28')]);}})[_0xce98('0x2a')](function(_0x21b681){logger['error'](_0xce98('0x22'),_0x176b15,_0x21b681);_0x147392(_0x21b681);});});}function respondWithStatusCode(_0x4368f4,_0x5ccc1f){_0x5ccc1f=_0x5ccc1f||0xcc;return function(_0x163eb6){if(_0x163eb6){return _0x4368f4['sendStatus'](_0x5ccc1f);}return _0x4368f4[_0xce98('0x2b')](_0x5ccc1f)[_0xce98('0x2c')]();};}function respondWithResult(_0x3987aa,_0x53d3ef){_0x53d3ef=_0x53d3ef||0xc8;return function(_0x422677){if(_0x422677){return _0x3987aa[_0xce98('0x2b')](_0x53d3ef)['json'](_0x422677);}};}function respondWithFilteredResult(_0x3849e8,_0x54132b){return function(_0x50a3c5){if(_0x50a3c5){var _0x12f180=typeof _0x54132b['offset']===_0xce98('0x2d')&&typeof _0x54132b[_0xce98('0x2e')]===_0xce98('0x2d');var _0xb80887=_0x50a3c5[_0xce98('0x2f')];var _0x3df91d=_0x12f180?0x0:_0x54132b[_0xce98('0x30')];var _0x2e6b4a=_0x12f180?_0x50a3c5[_0xce98('0x2f')]:_0x54132b[_0xce98('0x30')]+_0x54132b[_0xce98('0x2e')];var _0x1af843;if(_0x2e6b4a>=_0xb80887){_0x2e6b4a=_0xb80887;_0x1af843=0xc8;}else{_0x1af843=0xce;}_0x3849e8[_0xce98('0x2b')](_0x1af843);return _0x3849e8[_0xce98('0x31')](_0xce98('0x32'),_0x3df91d+'-'+_0x2e6b4a+'/'+_0xb80887)[_0xce98('0x33')](_0x50a3c5);}return null;};}function patchUpdates(_0x2559e9){return function(_0x200647){try{jsonpatch['apply'](_0x200647,_0x2559e9,!![]);}catch(_0x15685e){return BPromise[_0xce98('0x34')](_0x15685e);}return _0x200647['save']();};}function saveUpdates(_0x389a2a,_0x27cebc){return function(_0x4f7d44){if(_0x4f7d44){return _0x4f7d44['update'](_0x389a2a)['then'](function(_0x517efa){return _0x517efa;});}return null;};}function removeEntity(_0x297384,_0x414c8b){return function(_0xdc7f88){if(_0xdc7f88){return _0xdc7f88['destroy']()[_0xce98('0x35')](function(){_0x297384[_0xce98('0x2b')](0xcc)[_0xce98('0x2c')]();});}};}function handleEntityNotFound(_0x102e79,_0x2ef325){return function(_0xee4629){if(!_0xee4629){_0x102e79['sendStatus'](0x194);}return _0xee4629;};}function handleError(_0x14da15,_0x15f7e5){_0x15f7e5=_0x15f7e5||0x1f4;return function(_0x1534a6){logger[_0xce98('0x26')](_0x1534a6[_0xce98('0x36')]);if(_0x1534a6['name']){delete _0x1534a6[_0xce98('0x37')];}_0x14da15[_0xce98('0x2b')](_0x15f7e5)['send'](_0x1534a6);};}exports[_0xce98('0x38')]=function(_0xc25a4d,_0x9bc65e){var _0x2d26aa={},_0x57f010={},_0x4e07cb={'count':0x0,'rows':[]};var _0x2f9c4b=_['map'](db[_0xce98('0x39')]['rawAttributes'],function(_0x530d0d){return{'name':_0x530d0d[_0xce98('0x3a')],'type':_0x530d0d[_0xce98('0x3b')][_0xce98('0x3c')]};});_0x57f010[_0xce98('0x3d')]=_[_0xce98('0x3e')](_0x2f9c4b,_0xce98('0x37'));_0x57f010['query']=_[_0xce98('0x3f')](_0xc25a4d[_0xce98('0x40')]);_0x57f010[_0xce98('0x41')]=_[_0xce98('0x42')](_0x57f010[_0xce98('0x3d')],_0x57f010[_0xce98('0x40')]);_0x2d26aa[_0xce98('0x43')]=_[_0xce98('0x42')](_0x57f010[_0xce98('0x3d')],qs['fields'](_0xc25a4d[_0xce98('0x40')]['fields']));_0x2d26aa[_0xce98('0x43')]=_0x2d26aa[_0xce98('0x43')][_0xce98('0x44')]?_0x2d26aa['attributes']:_0x57f010['model'];if(!_0xc25a4d['query'][_0xce98('0x45')](_0xce98('0x46'))){_0x2d26aa[_0xce98('0x2e')]=qs['limit'](_0xc25a4d[_0xce98('0x40')][_0xce98('0x2e')]);_0x2d26aa['offset']=qs['offset'](_0xc25a4d[_0xce98('0x40')][_0xce98('0x30')]);}_0x2d26aa[_0xce98('0x47')]=qs[_0xce98('0x48')](_0xc25a4d[_0xce98('0x40')][_0xce98('0x48')]);_0x2d26aa['where']=qs[_0xce98('0x41')](_['pick'](_0xc25a4d[_0xce98('0x40')],_0x57f010[_0xce98('0x41')]),_0x2f9c4b);if(_0xc25a4d['query'][_0xce98('0x49')]){_0x2d26aa['where']=_[_0xce98('0x4a')](_0x2d26aa[_0xce98('0x4b')],{'$or':_[_0xce98('0x3e')](_0x2f9c4b,function(_0x327ab1){if(_0x327ab1[_0xce98('0x3b')]!==_0xce98('0x4c')){var _0x222ea5={};_0x222ea5[_0x327ab1['name']]={'$like':'%'+_0xc25a4d[_0xce98('0x40')]['filter']+'%'};return _0x222ea5;}})});}_0x2d26aa=_[_0xce98('0x4a')]({},_0x2d26aa,_0xc25a4d[_0xce98('0x4d')]);var _0x15628d={'where':_0x2d26aa['where']};return db[_0xce98('0x39')][_0xce98('0x2f')](_0x15628d)[_0xce98('0x35')](function(_0x59a868){_0x4e07cb[_0xce98('0x2f')]=_0x59a868;if(_0xc25a4d[_0xce98('0x40')][_0xce98('0x4e')]){_0x2d26aa[_0xce98('0x4f')]=[{'all':!![]}];}return db[_0xce98('0x39')][_0xce98('0x50')](_0x2d26aa);})[_0xce98('0x35')](function(_0x342a6f){_0x4e07cb['rows']=_0x342a6f;return _0x4e07cb;})[_0xce98('0x35')](respondWithFilteredResult(_0x9bc65e,_0x2d26aa))['catch'](handleError(_0x9bc65e,null));};exports[_0xce98('0x51')]=function(_0x1fb9e1,_0x458382){var _0x2db0a2={'raw':!![],'where':{'id':_0x1fb9e1[_0xce98('0x52')]['id']}},_0x295cca={};_0x295cca[_0xce98('0x3d')]=_[_0xce98('0x3f')](db['SmsMessage'][_0xce98('0x53')]);_0x295cca[_0xce98('0x40')]=_[_0xce98('0x3f')](_0x1fb9e1[_0xce98('0x40')]);_0x295cca[_0xce98('0x41')]=_[_0xce98('0x42')](_0x295cca[_0xce98('0x3d')],_0x295cca['query']);_0x2db0a2[_0xce98('0x43')]=_[_0xce98('0x42')](_0x295cca['model'],qs['fields'](_0x1fb9e1[_0xce98('0x40')][_0xce98('0x54')]));_0x2db0a2['attributes']=_0x2db0a2[_0xce98('0x43')][_0xce98('0x44')]?_0x2db0a2[_0xce98('0x43')]:_0x295cca[_0xce98('0x3d')];if(_0x1fb9e1['query'][_0xce98('0x4e')]){_0x2db0a2[_0xce98('0x4f')]=[{'all':!![]}];}_0x2db0a2=_[_0xce98('0x4a')]({},_0x2db0a2,_0x1fb9e1['options']);return db[_0xce98('0x39')][_0xce98('0x55')](_0x2db0a2)[_0xce98('0x35')](handleEntityNotFound(_0x458382,null))[_0xce98('0x35')](respondWithResult(_0x458382,null))[_0xce98('0x2a')](handleError(_0x458382,null));};exports[_0xce98('0x56')]=function(_0x1ff630,_0xfa5e6f){return db['SmsMessage'][_0xce98('0x56')](_0x1ff630[_0xce98('0x57')],{})[_0xce98('0x35')](respondWithResult(_0xfa5e6f,0xc9))[_0xce98('0x2a')](handleError(_0xfa5e6f,null));};exports[_0xce98('0x58')]=function(_0x179f13,_0x5d541e){if(_0x179f13[_0xce98('0x57')]['id']){delete _0x179f13[_0xce98('0x57')]['id'];}return db['SmsMessage'][_0xce98('0x55')]({'where':{'id':_0x179f13[_0xce98('0x52')]['id']}})['then'](handleEntityNotFound(_0x5d541e,null))[_0xce98('0x35')](saveUpdates(_0x179f13[_0xce98('0x57')],null))['then'](respondWithResult(_0x5d541e,null))[_0xce98('0x2a')](handleError(_0x5d541e,null));};exports[_0xce98('0x59')]=function(_0xcfce73,_0x2e9ec5){return db[_0xce98('0x39')][_0xce98('0x55')]({'where':{'id':_0xcfce73[_0xce98('0x52')]['id']}})[_0xce98('0x35')](handleEntityNotFound(_0x2e9ec5,null))[_0xce98('0x35')](removeEntity(_0x2e9ec5,null))[_0xce98('0x2a')](handleError(_0x2e9ec5,null));};exports[_0xce98('0x5a')]=function(_0x5b3990,_0x4682c4){return db['SmsMessage']['describe']()[_0xce98('0x35')](respondWithResult(_0x4682c4,null))[_0xce98('0x2a')](handleError(_0x4682c4,null));};var interaction_log=require('../../config/logger')(_0xce98('0x5b'));exports[_0xce98('0x5c')]=function(_0x366500,_0x2e662c,_0x3c3a0f){var _0x2946d0={'agent':{},'channel':_0xce98('0x5d')};if(_0x366500[_0xce98('0x57')]['id']){delete _0x366500['body']['id'];}_0x366500[_0xce98('0x57')][_0xce98('0x5e')]=!![];_0x366500[_0xce98('0x57')]['readAt']=moment()[_0xce98('0x5f')](_0xce98('0x60'));_0x366500[_0xce98('0x57')]['UserId']=_0x366500['body']['UserId']||_0x366500['user']['id'];_0x2946d0['agent']['id']=_0x366500[_0xce98('0x57')]['UserId'];return db[_0xce98('0x39')][_0xce98('0x55')]({'where':{'id':_0x366500[_0xce98('0x52')]['id'],'UserId':null}})[_0xce98('0x35')](handleEntityNotFound(_0x2e662c,null))['then'](saveUpdates(_0x366500['body'],null))['then'](function(_0x3f951c){if(_0x3f951c){_0x2946d0[_0xce98('0x28')]=_0x3f951c[_0xce98('0x61')]({'plain':!![]});return db[_0xce98('0x62')]['find']({'where':{'id':_0x3f951c[_0xce98('0x63')]}});}return null;})[_0xce98('0x35')](handleEntityNotFound(_0x2e662c,null))[_0xce98('0x35')](function(_0x2a0119){if(_0x2a0119){return _0x2a0119[_0xce98('0x58')]({'UserId':_0x366500[_0xce98('0x57')][_0xce98('0x64')],'read1stAt':_[_0xce98('0x65')](_0x2a0119[_0xce98('0x66')])?moment()['format'](_0xce98('0x60')):undefined});}return null;})[_0xce98('0x35')](function(_0x112e28){if(_0x112e28){_0x2946d0[_0xce98('0x67')]=_0x112e28['get']({'plain':!![]});interaction_log['info'](_0xce98('0x68'),_0x366500['user']['id'],_0x366500['user'][_0xce98('0x37')],_0x366500[_0xce98('0x69')]['role'],_0x2946d0['interaction']['id'],_0x366500[_0xce98('0x57')]?JSON[_0xce98('0x25')](_0x366500['body']):_0xce98('0x6a'));return respondWithRpcPromise('AcceptMessage',_0xce98('0x6b'),_0x2946d0);}return null;})['then'](function(_0x1590e5){var _0x4f3763=_0xce98('0x6c')+_0x1590e5[_0xce98('0x28')][_0xce98('0x6d')];return db[_0xce98('0x6e')][_0xce98('0x40')](_0x4f3763,{'type':db['Sequelize'][_0xce98('0x6f')][_0xce98('0x70')],'raw':!![]})['then'](function(_0x17a605){return _0x17a605;});})[_0xce98('0x35')](function(_0x500512){if(_0x500512){_0x2946d0['message'][_0xce98('0x71')]=_0x500512[0x0];if(!_0x366500[_0xce98('0x57')][_0xce98('0x64')])return;return db[_0xce98('0x72')][_0xce98('0x55')]({'where':{'id':_0x366500[_0xce98('0x57')][_0xce98('0x64')],'role':_0xce98('0x73')},'attributes':['id',_0xce98('0x37'),_0xce98('0x74'),'email',_0xce98('0x75')],'raw':!![]});}return null;})['then'](function(_0x36c5b3){if(!_0x36c5b3)return null;_0x2946d0[_0xce98('0x28')][_0xce98('0x73')]=_0x36c5b3;return _0x2946d0;})[_0xce98('0x35')](function(_0x34f093){if(_0x34f093){if(_0x366500[_0xce98('0x57')][_0xce98('0x76')]){_0x2946d0[_0xce98('0x28')][_0xce98('0x77')]=util[_0xce98('0x5f')](_0xce98('0x78'),_0x366500[_0xce98('0x69')][_0xce98('0x37')]);_0x2946d0[_0xce98('0x28')]['channel']=_0x2946d0[_0xce98('0x79')];_0x2946d0['message']['motionChannel']=_0x2946d0[_0xce98('0x79')];_0x2946d0['message'][_0xce98('0x7a')]=_0xce98('0x5c');return respondWithRpcPromise(_0xce98('0x7b'),_0xce98('0x7b'),{'event':_0xce98('0x7c'),'message':_0x2946d0['message']},client9002)[_0xce98('0x35')](function(){return _0x2946d0;});}return _0x2946d0;}return null;})['then'](respondWithResult(_0x2e662c,null))[_0xce98('0x2a')](handleError(_0x2e662c,null));};var interaction_log=require('../../config/logger')(_0xce98('0x5b'));exports[_0xce98('0x34')]=function(_0x2cc6c9,_0x30c8c7,_0x35c226){var _0x1bf662={'agent':{},'channel':_0xce98('0x5d')};if(_0x2cc6c9['body']['id']){delete _0x2cc6c9[_0xce98('0x57')]['id'];}_0x2cc6c9[_0xce98('0x57')][_0xce98('0x64')]=_0x2cc6c9[_0xce98('0x57')]['UserId']||_0x2cc6c9[_0xce98('0x69')]['id'];_0x1bf662[_0xce98('0x73')]['id']=_0x2cc6c9[_0xce98('0x57')][_0xce98('0x64')];return db[_0xce98('0x39')][_0xce98('0x55')]({'where':{'id':_0x2cc6c9[_0xce98('0x52')]['id'],'UserId':null}})[_0xce98('0x35')](handleEntityNotFound(_0x30c8c7,null))[_0xce98('0x35')](function(_0x72a7e4){if(_0x72a7e4){_0x1bf662['message']=_0x72a7e4[_0xce98('0x61')]({'plain':!![]});return db['SmsInteraction'][_0xce98('0x55')]({'where':{'id':_0x72a7e4['SmsInteractionId']}});}return null;})[_0xce98('0x35')](handleEntityNotFound(_0x30c8c7,null))[_0xce98('0x35')](function(_0x2fa241){if(_0x2fa241){_0x1bf662[_0xce98('0x67')]=_0x2fa241[_0xce98('0x61')]({'plain':!![]});interaction_log[_0xce98('0x21')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2cc6c9[_0xce98('0x69')]['id'],_0x2cc6c9[_0xce98('0x69')]['name'],_0x2cc6c9[_0xce98('0x69')][_0xce98('0x7d')],_0x1bf662[_0xce98('0x67')]['id'],_0x2cc6c9[_0xce98('0x57')]?JSON[_0xce98('0x25')](_0x2cc6c9[_0xce98('0x57')]):_0xce98('0x6a'));return respondWithRpcPromise(_0xce98('0x7e'),_0xce98('0x7f'),_0x1bf662);}return null;})[_0xce98('0x35')](function(_0x1c5104){var _0x33b45c=_0xce98('0x6c')+_0x1c5104[_0xce98('0x28')][_0xce98('0x6d')];return db[_0xce98('0x6e')][_0xce98('0x40')](_0x33b45c,{'type':db[_0xce98('0x80')][_0xce98('0x6f')][_0xce98('0x70')],'raw':!![]})['then'](function(_0x17aef0){return _0x17aef0;});})[_0xce98('0x35')](function(_0x389e44){if(_0x389e44){_0x1bf662[_0xce98('0x28')]['contact']=_0x389e44[0x0];if(!_0x2cc6c9['body'][_0xce98('0x64')])return;return db[_0xce98('0x72')][_0xce98('0x55')]({'where':{'id':_0x2cc6c9[_0xce98('0x57')][_0xce98('0x64')],'role':_0xce98('0x73')},'attributes':['id',_0xce98('0x37'),_0xce98('0x74'),'email','internal'],'raw':!![]});}return null;})[_0xce98('0x35')](function(_0x33219a){if(!_0x33219a)return null;_0x1bf662[_0xce98('0x28')][_0xce98('0x73')]=_0x33219a;return _0x1bf662;})[_0xce98('0x35')](function(_0x4a7ffa){if(_0x4a7ffa){_0x4a7ffa[_0xce98('0x28')][_0xce98('0x77')]=util[_0xce98('0x5f')](_0xce98('0x78'),_0x2cc6c9[_0xce98('0x69')][_0xce98('0x37')]);_0x4a7ffa[_0xce98('0x28')]['channel']=_0x1bf662['channel'];_0x4a7ffa['message'][_0xce98('0x81')]=_0x1bf662[_0xce98('0x79')];_0x4a7ffa[_0xce98('0x28')][_0xce98('0x7a')]=_0xce98('0x34');respondWithRpcPromise(_0xce98('0x7b'),_0xce98('0x7b'),{'event':_0xce98('0x82'),'message':_0x4a7ffa['message']},client9002);return _0x1bf662;}return null;})['then'](respondWithResult(_0x30c8c7,null))[_0xce98('0x2a')](handleError(_0x30c8c7,null));};exports['status']=function(_0x3caba2,_0x5b8cf5,_0x279139){if(_0x3caba2[_0xce98('0x57')]['id']){delete _0x3caba2[_0xce98('0x57')]['id'];}var _0x46e9d0;return db['SmsMessage'][_0xce98('0x55')]({'where':{'id':_0x3caba2[_0xce98('0x52')]['id']}})['then'](handleEntityNotFound(_0x5b8cf5,null))[_0xce98('0x35')](function(_0x5ef73a){if(_0x5ef73a){_0x46e9d0=_0x5ef73a;return db[_0xce98('0x83')]['find']({'where':{'id':_0x5ef73a[_0xce98('0x84')]}});}})['then'](handleEntityNotFound(_0x5b8cf5,null))[_0xce98('0x35')](function(_0x11a533){if(_0x11a533){logger[_0xce98('0x23')](_0xce98('0x85'),_0xce98('0x2b'),_0xce98('0x86'),_0x11a533['type'],util['inspect'](_0x3caba2[_0xce98('0x57')],{'showHidden':![],'depth':null}));switch(_0x11a533['type']){case _0xce98('0x87'):if(_0x3caba2[_0xce98('0x57')][_0xce98('0x88')]&&_0x3caba2[_0xce98('0x57')][_0xce98('0x88')]===_0x46e9d0[_0xce98('0x89')]){return _0x46e9d0[_0xce98('0x58')]({'read':!![]});}else{logger['error'](_0xce98('0x8a'),_0xce98('0x2b'),_0xce98('0x87'),util[_0xce98('0x8b')](_0x3caba2[_0xce98('0x57')],{'showHidden':![],'depth':null}));}break;case _0xce98('0x8c'):if(_0x3caba2[_0xce98('0x57')][_0xce98('0x8d')]&&_0x3caba2['body']['MessageUUID']===_0x46e9d0[_0xce98('0x89')]&&_[_0xce98('0x8e')](['sent',_0xce98('0x8f')],_0x3caba2[_0xce98('0x57')][_0xce98('0x90')])>=0x0){return _0x46e9d0[_0xce98('0x58')]({'read':!![]});}else{logger[_0xce98('0x26')](_0xce98('0x8a'),_0xce98('0x2b'),_0xce98('0x91'),util['inspect'](_0x3caba2[_0xce98('0x57')],{'showHidden':![],'depth':null}));}break;case _0xce98('0x92'):var _0x1a3ac7=_0x3caba2[_0xce98('0x57')][_0xce98('0x93')][0x0];if(_0x1a3ac7['status'][_0xce98('0x94')]===_0xce98('0x95')){return _0x46e9d0[_0xce98('0x58')]({'read':!![]});}else{logger[_0xce98('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xce98('0x92'),util[_0xce98('0x8b')](_0x3caba2['body'],{'showHidden':![],'depth':null}));}break;}return _0x46e9d0;}})[_0xce98('0x35')](respondWithResult(_0x5b8cf5,null))[_0xce98('0x2a')](handleError(_0x5b8cf5,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 1e676c4..a489237 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 _0x59ec=['exports','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x38a9e5,_0x947f7d){var _0x2d451a=function(_0x283629){while(--_0x283629){_0x38a9e5['push'](_0x38a9e5['shift']());}};_0x2d451a(++_0x947f7d);}(_0x59ec,0xa1));var _0xc59e=function(_0xe28f18,_0x14d43a){_0xe28f18=_0xe28f18-0x0;var _0x4ffbf6=_0x59ec[_0xe28f18];return _0x4ffbf6;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0xc59e('0x0'))['db'][_0xc59e('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xc59e('0x2')](0x0);var events={'afterCreate':_0xc59e('0x3'),'afterUpdate':_0xc59e('0x4'),'afterDestroy':_0xc59e('0x5')};function emitEvent(_0x16110b){return function(_0x4abc03,_0x367dd8,_0x5e169d){SmsMessageEvents['emit'](_0x16110b+':'+_0x4abc03['id'],_0x4abc03);SmsMessageEvents[_0xc59e('0x6')](_0x16110b,_0x4abc03);_0x5e169d(null);};}for(var e in events){if(events[_0xc59e('0x7')](e)){var event=events[e];SmsMessage[_0xc59e('0x8')](e,emitEvent(event));}}module[_0xc59e('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0x7b81=['SmsMessage','setMaxListeners','remove','emit','exports','events'];(function(_0x3bdde7,_0x5949fd){var _0xf94a37=function(_0x588c7b){while(--_0x588c7b){_0x3bdde7['push'](_0x3bdde7['shift']());}};_0xf94a37(++_0x5949fd);}(_0x7b81,0x7d));var _0x17b8=function(_0x571d70,_0x311888){_0x571d70=_0x571d70-0x0;var _0x48f094=_0x7b81[_0x571d70];return _0x48f094;};'use strict';var EventEmitter=require(_0x17b8('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x17b8('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x17b8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x17b8('0x3')};function emitEvent(_0x3dcac9){return function(_0x25a451,_0x1f76ce,_0x3a4504){SmsMessageEvents['emit'](_0x3dcac9+':'+_0x25a451['id'],_0x25a451);SmsMessageEvents[_0x17b8('0x4')](_0x3dcac9,_0x25a451);_0x3a4504(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x17b8('0x5')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 0dd0f18..dfed329 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 _0x62a5=['https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','user_key','session_key','total_sent','internal_order_id','deliveryReport','update','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','read','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','POST','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','queued_count','head','messages','message_id','clickSend','plivo','authId','format','%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','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','login','text','keys','sort','length','apiKey','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','uuid','UTF-8','apiMessageId','clickatell','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','utf8mb4','utf8mb4_unicode_ci','util','api','bluebird','path','rimraf','../../config/environment','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','get','toLowerCase','out','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','createdAt','catch','direction','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','create','phone','remote','/api/sms/messages/','/status?token=','token','sid','error','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','skebby'];(function(_0x373e27,_0x527f8d){var _0x4a336f=function(_0x2cf6c0){while(--_0x2cf6c0){_0x373e27['push'](_0x373e27['shift']());}};_0x4a336f(++_0x527f8d);}(_0x62a5,0x154));var _0x562a=function(_0x56d1dc,_0x5f0dae){_0x56d1dc=_0x56d1dc-0x0;var _0x17a3aa=_0x62a5[_0x56d1dc];return _0x17a3aa;};'use strict';var _=require('lodash');var util=require(_0x562a('0x0'));var logger=require('../../config/logger')(_0x562a('0x1'));var moment=require('moment');var BPromise=require(_0x562a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x562a('0x3'));var rimraf=require(_0x562a('0x4'));var config=require(_0x562a('0x5'));var attributes=require('./smsMessage.attributes');module[_0x562a('0x6')]=function(_0x149401,_0x556573){return _0x149401[_0x562a('0x7')](_0x562a('0x8'),attributes,{'tableName':_0x562a('0x9'),'paranoid':![],'indexes':[{'name':_0x562a('0xa'),'fields':[_0x562a('0xa')]},{'name':_0x562a('0xb'),'fields':[_0x562a('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x447fce,_0x345235,_0xf73c76){var _0x22a4de=_0x149401['models'];var _0x2ec0d2=_0x447fce[_0x562a('0xd')]({'plain':!![]});if(_0x2ec0d2['direction']['toLowerCase']()==='in'||_0x2ec0d2['direction'][_0x562a('0xe')]()===_0x562a('0xf')&&!_0x2ec0d2[_0x562a('0x10')]&&!_[_0x562a('0x11')](_0x2ec0d2[_0x562a('0x12')])&&!_[_0x562a('0x11')](_0x2ec0d2['SmsInteractionId'])){_0x22a4de[_0x562a('0x13')][_0x562a('0x14')]({'where':{'id':_0x2ec0d2[_0x562a('0x15')]}})[_0x562a('0x16')](function(_0x2ba822){if(_0x2ba822){_0x2ba822['update']({'lastMsgAt':_0x2ec0d2[_0x562a('0x17')],'lastMsgDirection':_0x2ec0d2['direction']['toLowerCase']()});}})[_0x562a('0x18')](function(_0x47ae22){console['error'](_0x47ae22);});}if(_0x2ec0d2[_0x562a('0x19')]==='out'&&!_0x2ec0d2[_0x562a('0x10')]){var _0xa87624;_0x22a4de[_0x562a('0x1a')]['find']({'where':{'id':_0x2ec0d2[_0x562a('0x1b')]},'raw':!![]})['then'](function(_0x562fa4){_0xa87624=_0x562fa4;if(_0xa87624&&_0xa87624[_0x562a('0x1c')]){switch(_0xa87624[_0x562a('0x1c')]){case _0x562a('0x1d'):var _0x28b1e7=require('twilio');if(_0xa87624[_0x562a('0x1e')]&&_0xa87624['authToken']&&_0xa87624['phone']){var _0x1431be=new _0x28b1e7(_0xa87624[_0x562a('0x1e')],_0xa87624[_0x562a('0x1f')]);_0x1431be['messages'][_0x562a('0x20')]({'body':_0x2ec0d2[_0x562a('0xc')],'to':_0x2ec0d2['phone'],'from':_0xa87624[_0x562a('0x21')],'statusCallback':_0xa87624[_0x562a('0x22')]+_0x562a('0x23')+_0x2ec0d2['id']+_0x562a('0x24')+_0xa87624[_0x562a('0x25')]})[_0x562a('0x16')](function(_0x661c8b){if(_0x661c8b[_0x562a('0x26')]){return _0x447fce['update']({'messageId':_0x661c8b[_0x562a('0x26')]});}})[_0x562a('0x18')](function(_0x2d7351){logger[_0x562a('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x562a('0x28'),_0x562a('0x1d'),util[_0x562a('0x29')](_0x2d7351,{'showHidden':![],'depth':null}));});}else{logger[_0x562a('0x27')](_0x562a('0x2a'),_0x562a('0x28'),_0x562a('0x1d'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x562a('0x2b'):var _0x1e7afe=_0x562a('0x2c');if(_0xa87624[_0x562a('0x2d')]&&_0xa87624[_0x562a('0x2e')]){var _0x5bca47={'recipient':[_0x2ec0d2[_0x562a('0x21')]],'message':_0x2ec0d2[_0x562a('0xc')],'message_type':_0xa87624[_0x562a('0x2f')]};if(_0xa87624[_0x562a('0x2f')]&&_0xa87624[_0x562a('0x2f')]!=='SI'){_0x5bca47[_0x562a('0x30')]=_0xa87624[_0x562a('0x21')];}var _0x54acc1={'url':_0x1e7afe+_0x562a('0x31')+_0xa87624[_0x562a('0x2d')]+_0x562a('0x32')+_0xa87624[_0x562a('0x2e')],'method':_0x562a('0x33')};rp(_0x54acc1)[_0x562a('0x16')](function(_0xf8584a){var _0x585cf2=_0xf8584a[_0x562a('0x34')](';');var _0x3efaa6={'user_key':_0x585cf2[0x0],'session_key':_0x585cf2[0x1]};_0x54acc1={'url':_0x1e7afe+_0x562a('0x35'),'method':'POST','headers':{'user_key':_0x3efaa6[_0x562a('0x36')],'Session_key':_0x3efaa6[_0x562a('0x37')]},'json':!![],'body':_0x5bca47};return rp(_0x54acc1);})[_0x562a('0x16')](function(_0x51d23c){if(_0x51d23c[_0x562a('0x38')]>=0x1){var _0x57add9={'messageId':_0x51d23c[_0x562a('0x39')]};if(_0xa87624['smsMethod']!=='GP'||!_0xa87624[_0x562a('0x3a')]){_0x57add9['read']=!![];}return _0x447fce[_0x562a('0x3b')](_0x57add9);}else{return logger[_0x562a('0x27')](_0x562a('0x2a'),_0x562a('0x28'),_0x562a('0x2b'),util[_0x562a('0x29')](_0x51d23c,{'showHidden':![],'depth':null}));}})[_0x562a('0x18')](function(_0x24ddcf){return logger[_0x562a('0x27')](_0x562a('0x2a'),_0x562a('0x28'),_0x562a('0x2b'),util[_0x562a('0x29')](_0x24ddcf,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x562a('0x28'),_0x562a('0x2b'),_0x562a('0x3c'));}break;case'connectel':if(_0xa87624[_0x562a('0x1f')]){var _0x4ce682={'recipient':_0x2ec0d2['phone'],'message':_0x2ec0d2[_0x562a('0xc')],'sender':_0xa87624[_0x562a('0x3d')]||_0xa87624[_0x562a('0x21')],'authorization':_0xa87624[_0x562a('0x1f')]};var _0x345235={'method':'POST','uri':_0x562a('0x3e'),'body':_0x4ce682,'json':!![]};rp(_0x345235)[_0x562a('0x16')](function(_0x1e32ac){var _0xc9e284={'messageId':_0x1e32ac[_0x562a('0x3f')]};if(!_0xa87624['deliveryReport']){_0xc9e284[_0x562a('0x40')]=!![];}return _0x447fce[_0x562a('0x3b')](_0xc9e284);})['catch'](function(_0x43f254){logger[_0x562a('0x27')](_0x562a('0x2a'),_0x562a('0x28'),_0x562a('0x41'),util[_0x562a('0x29')](_0x43f254,{'showHidden':![],'depth':null}));});}else{logger[_0x562a('0x27')](_0x562a('0x2a'),_0x562a('0x28'),_0x562a('0x41'),_0x562a('0x42'));}break;case _0x562a('0x43'):if(_0xa87624[_0x562a('0x2d')]&&_0xa87624[_0x562a('0x2e')]){var _0x4ce682={'messages':[{'source':_0x562a('0x44'),'to':_0x2ec0d2['phone'],'body':_0x2ec0d2[_0x562a('0xc')],'from':_0xa87624[_0x562a('0x3d')]||_0xa87624[_0x562a('0x21')]}]};var _0x483bce=util['format']('%s:%s',_0xa87624['username'],_0xa87624['password']);var _0x345235={'method':_0x562a('0x45'),'uri':_0x562a('0x46'),'body':_0x4ce682,'headers':{'Authorization':util['format'](_0x562a('0x47'),new Buffer(_0x483bce)[_0x562a('0x48')](_0x562a('0x49')))},'json':!![]};rp(_0x345235)['then'](function(_0x4dddf8){if(_0x4dddf8['http_code']>=0xc8&&_0x4dddf8[_0x562a('0x4a')]<=0xce){if(_0x4dddf8['data']&&_0x4dddf8['data'][_0x562a('0x4b')]>0x0){var _0x5e52e2=_[_0x562a('0x4c')](_0x4dddf8['data'][_0x562a('0x4d')]);var _0x252aa3={'messageId':_0x5e52e2[_0x562a('0x4e')]};if(!_0xa87624[_0x562a('0x3a')]){_0x252aa3[_0x562a('0x40')]=!![];}return _0x447fce[_0x562a('0x3b')](_0x252aa3);}else{logger[_0x562a('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickSend',util[_0x562a('0x29')](_0x4dddf8,{'showHidden':![],'depth':null}));}}else{logger[_0x562a('0x27')](_0x562a('0x2a'),_0x562a('0x28'),'clickSend',util[_0x562a('0x29')](_0x4dddf8,{'showHidden':![],'depth':null}));}})[_0x562a('0x18')](function(_0x23f796){logger[_0x562a('0x27')](_0x562a('0x2a'),_0x562a('0x28'),_0x562a('0x4f'),util[_0x562a('0x29')](_0x23f796,{'showHidden':![],'depth':null}));});}else{logger[_0x562a('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x562a('0x28'),_0x562a('0x4f'),_0x562a('0x3c'));}break;case _0x562a('0x50'):if(_0xa87624[_0x562a('0x51')]&&_0xa87624[_0x562a('0x1f')]){var _0x4ce682={'dst':_0x2ec0d2['phone'],'text':_0x2ec0d2[_0x562a('0xc')],'src':_0xa87624['senderString']||_0xa87624[_0x562a('0x21')],'url':_0xa87624['remote']+_0x562a('0x23')+_0x2ec0d2['id']+_0x562a('0x24')+_0xa87624[_0x562a('0x25')]};var _0x483bce=util[_0x562a('0x52')](_0x562a('0x53'),_0xa87624['authId'],_0xa87624[_0x562a('0x1f')]);var _0x345235={'method':'POST','uri':util[_0x562a('0x52')](_0x562a('0x54'),_0xa87624[_0x562a('0x51')]),'body':_0x4ce682,'headers':{'Authorization':util[_0x562a('0x52')]('Basic\x20%s',new Buffer(_0x483bce)['toString']('base64'))},'json':!![]};rp(_0x345235)[_0x562a('0x16')](function(_0x160e08){var _0x17fe27={'messageId':_0x160e08[_0x562a('0x55')][0x0]};return _0x447fce['update'](_0x17fe27);})['catch'](function(_0x539e90){logger[_0x562a('0x27')](_0x562a('0x2a'),_0x562a('0x28'),'plivo',util[_0x562a('0x29')](_0x539e90,{'showHidden':![],'depth':null}));});}else{logger[_0x562a('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x562a('0x28'),_0x562a('0x50'),_0x562a('0x56'));}break;case _0x562a('0x57'):if(_0xa87624['username']&&_0xa87624[_0x562a('0x2e')]){if(_0xa87624['baseUrl']){var _0x4115af={'method':_0x562a('0x45'),'uri':_0xa87624[_0x562a('0x58')]+_0x562a('0x59'),'body':{'username':_0xa87624[_0x562a('0x2d')],'password':_0xa87624[_0x562a('0x2e')]},'json':!![]};return rp(_0x4115af)[_0x562a('0x16')](function(_0x157203){var _0x33579f={'method':_0x562a('0x45'),'uri':_0xa87624['baseUrl']+_0x562a('0x5a'),'body':{'messages':[{'from':_0xa87624[_0x562a('0x21')],'destinations':[{'to':_0x2ec0d2['phone']}],'text':_0x2ec0d2[_0x562a('0xc')],'notifyUrl':_0xa87624[_0x562a('0x22')]+_0x562a('0x23')+_0x2ec0d2['id']+_0x562a('0x24')+_0xa87624['token'],'notifyContentType':_0x562a('0x5b'),'callbackData':_0xa87624['phone']+';'+_0x2ec0d2[_0x562a('0xc')]}]},'headers':{'Authorization':_0x562a('0x5c')+_0x157203[_0x562a('0x25')]},'json':!![]};return rp(_0x33579f)[_0x562a('0x16')](function(_0x4d9273){if(_0x4d9273[_0x562a('0x4d')]){var _0x58dea2={'messageId':_0x4d9273[_0x562a('0x4d')][0x0][_0x562a('0xa')]};if(!_0xa87624[_0x562a('0x3a')]){_0x58dea2['read']=!![];}return _0x447fce[_0x562a('0x3b')](_0x58dea2);}else{return logger[_0x562a('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x562a('0x57'),util[_0x562a('0x29')](_0x4d9273,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x4c8335){return logger[_0x562a('0x27')](_0x562a('0x2a'),_0x562a('0x28'),_0x562a('0x57'),util['inspect'](_0x4c8335,{'showHidden':![],'depth':null}));});}else{logger[_0x562a('0x27')](_0x562a('0x2a'),_0x562a('0x28'),_0x562a('0x57'),_0x562a('0x5d'));}}else{logger[_0x562a('0x27')](_0x562a('0x2a'),'afterCreate','infobip',_0x562a('0x3c'));}break;case _0x562a('0x5e'):var _0x4cb436=require(_0x562a('0x5f'));if(_0xa87624['apiKey']){var _0x270686={};_0x270686[_0x562a('0x60')]=_0xa87624[_0x562a('0x2d')];_0x270686[_0x562a('0x21')]=_0x2ec0d2[_0x562a('0x21')];_0x270686[_0x562a('0x30')]=_0xa87624['phone'];_0x270686[_0x562a('0x61')]=_0x2ec0d2['body'];_0x270686['timestamp']=+new Date();var _0x193006='';var _0x4bdb12='';var _0x2ad849=Object[_0x562a('0x62')](_0x270686);_0x2ad849[_0x562a('0x63')]();for(var _0x42b49a=0x0;_0x42b49a<_0x2ad849[_0x562a('0x64')];_0x42b49a++){if(_0x193006!=''){_0x193006+='&';}_0x193006+=_0x2ad849[_0x42b49a]+'='+encodeURIComponent(_0x270686[_0x2ad849[_0x42b49a]]);_0x4bdb12+=_0x270686[_0x2ad849[_0x42b49a]];}_0x4bdb12+=_0xa87624[_0x562a('0x65')];_0x4bdb12=_0x4cb436[_0x562a('0x66')](_0x562a('0x67'))[_0x562a('0x3b')](_0x4bdb12)[_0x562a('0x68')](_0x562a('0x69'));if(_0x193006!==''){_0x193006+='&';}_0x193006+=_0x562a('0x6a')+_0x4bdb12;var _0x54acc1={'method':'GET','uri':_0xa87624['baseUrl']+_0x562a('0x6b')+_0x193006,'json':!![]};return rp(_0x54acc1)['then'](function(_0x5247d1){var _0x440fca=Object[_0x562a('0x62')](_0x5247d1);if(_0x5247d1[_0x440fca[0x0]][_0x562a('0x27')]&&parseInt(_0x5247d1[_0x440fca[0x0]]['error'])===0x0){var _0x42b2f7={'messageId':_0x5247d1[_0x440fca[0x0]][_0x562a('0x6c')]};if(!_0xa87624['deliveryReport']){_0x42b2f7[_0x562a('0x40')]=!![];}return _0x447fce[_0x562a('0x3b')](_0x42b2f7);}else{return logger['error'](_0x562a('0x2a'),_0x562a('0x28'),_0x562a('0x5e'),util[_0x562a('0x29')](_0x5247d1[_0x562a('0x27')],{'showHidden':![],'depth':null}));}})[_0x562a('0x18')](function(_0x4cccd1){return logger[_0x562a('0x27')](_0x562a('0x2a'),_0x562a('0x28'),_0x562a('0x5e'),util[_0x562a('0x29')](_0x4cccd1,{'showHidden':![],'depth':null}));});}else{logger[_0x562a('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','csc','Missing\x20parameters:\x20apiKey');}break;case'clickatell':if(_0xa87624[_0x562a('0x65')]){var _0x4ea0fb={'method':_0x562a('0x45'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0xa87624[_0x562a('0x65')]},'body':{'content':_0x2ec0d2[_0x562a('0xc')],'to':[_0x2ec0d2['phone']],'from':_0xa87624[_0x562a('0x21')],'binary':![],'clientMessageId':_0x562a('0x6d'),'charset':_0x562a('0x6e')},'json':!![]};rp(_0x4ea0fb)[_0x562a('0x16')](function(_0xfe88fe){if(!_0xfe88fe[_0x562a('0x27')]){var _0x48f5d8={'messageId':_0xfe88fe[_0x562a('0x4d')][0x0][_0x562a('0x6f')]};if(!_0xa87624[_0x562a('0x3a')]){_0x48f5d8[_0x562a('0x40')]=!![];}return _0x447fce[_0x562a('0x3b')](_0x48f5d8);}else{return logger['error'](_0x562a('0x2a'),_0x562a('0x28'),_0x562a('0x70'),util['inspect'](_0xfe88fe[_0x562a('0x27')],{'showHidden':![],'depth':null}));}})[_0x562a('0x18')](function(_0x4ef8ce){return logger[_0x562a('0x27')](_0x562a('0x2a'),_0x562a('0x28'),_0x562a('0x70'),util[_0x562a('0x29')](_0x4ef8ce,{'showHidden':![],'depth':null}));});}else{logger[_0x562a('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x562a('0x28'),_0x562a('0x70'),_0x562a('0x71'));}break;case _0x562a('0x72'):if(_0xa87624['username']&&_0xa87624[_0x562a('0x2e')]){var _0x483bce=util['format'](_0x562a('0x53'),_0xa87624[_0x562a('0x2d')],_0xa87624[_0x562a('0x2e')]);var _0x345235={'method':'POST','uri':_0x562a('0x73')+_0xa87624[_0x562a('0x74')]+_0x562a('0x75'),'body':{'to':[_0x2ec0d2[_0x562a('0x21')]],'text':_0x2ec0d2[_0x562a('0xc')],'from':_0xa87624[_0x562a('0x21')],'applicationId':_0xa87624[_0x562a('0x76')]},'headers':{'Authorization':util[_0x562a('0x52')]('Basic\x20%s',new Buffer(_0x483bce)[_0x562a('0x48')]('base64'))},'json':!![]};rp(_0x345235)[_0x562a('0x16')](function(_0x4ebac3){if(_0x4ebac3['id']){var _0x55b2a1={'messageId':_0x4ebac3['id']};return _0x447fce[_0x562a('0x3b')](_0x55b2a1);}else{logger[_0x562a('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x562a('0x28'),'bandwidth',util[_0x562a('0x29')](_0x4ebac3,{'showHidden':![],'depth':null}));}})['catch'](function(_0x411044){logger[_0x562a('0x27')](_0x562a('0x2a'),_0x562a('0x28'),_0x562a('0x72'),util[_0x562a('0x29')](_0x411044,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x562a('0x2a'),'afterCreate',_0x562a('0x72'),_0x562a('0x3c'));}break;case _0x562a('0x77'):if(_0xa87624[_0x562a('0x65')]){var _0x4f6b7c={};var _0x54acc1={'method':_0x562a('0x45'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x562a('0x78')+_0xa87624[_0x562a('0x65')],'Content-Type':_0x562a('0x5b')},'body':{'from':_0xa87624[_0x562a('0x21')],'to':_0x2ec0d2['phone'],'text':_0x2ec0d2['body']},'json':!![]};return rp(_0x54acc1)['then'](function(_0x587c0e){if(_0x587c0e[_0x562a('0x79')]==0xca){_0x4f6b7c[_0x562a('0x7a')]=_0x587c0e;var _0x31d709={'method':_0x562a('0x45'),'uri':_0x562a('0x7b'),'headers':{'Authorization':_0x562a('0x78')+_0xa87624['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0x4f6b7c['message'][_0x562a('0x7c')]},'json':!![]};return rp(_0x31d709)[_0x562a('0x16')](function(_0x4b7d2b){_0x4f6b7c[_0x562a('0x7d')]=_0x4b7d2b;var _0x120041={'messageId':_0x4f6b7c[_0x562a('0x7a')][_0x562a('0x7c')],'read':!![]};return _0x447fce[_0x562a('0x3b')](_0x120041);});}else{return logger[_0x562a('0x27')](_0x562a('0x2a'),_0x562a('0x28'),_0x562a('0x77'),util[_0x562a('0x29')](_0x587c0e,{'showHidden':![],'depth':null}));}})[_0x562a('0x18')](function(_0xcddacc){return logger[_0x562a('0x27')](_0x562a('0x2a'),_0x562a('0x28'),_0x562a('0x77'),util[_0x562a('0x29')](_0xcddacc,{'showHidden':![],'depth':null}));});}else{return logger[_0x562a('0x27')](_0x562a('0x2a'),'afterCreate',_0x562a('0x77'),'Token\x20not\x20received');}break;}}})['finally'](function(){_0xf73c76();});}else{_0xf73c76();}}},'charset':_0x562a('0x7e'),'collate':_0x562a('0x7f')});}; \ No newline at end of file +var _0xbe65=['twilio','accountSid','authToken','phone','messages','/api/sms/messages/','/status?token=','token','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','password','body','smsMethod','sender','login?username=','username','&password=','GET','split','POST','session_key','total_sent','internal_order_id','deliveryReport','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','clicksend','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','http_code','data','head','message_id','update','clickSend','plivo','remote','%s:%s','authId','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','apiKey','login','text','timestamp','keys','sort','length','createHash','md5','digest','signature=','/external/get/send.php?','clickatell','https://platform.clickatell.com/messages','UTF-8','apiMessageId','Missing\x20parameters:\x20apiKey','bandwidth','accountId','/messages','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','createdAt','error','out','SmsAccount','SmsAccountId','type'];(function(_0x3cf772,_0x31e205){var _0x4dfa3b=function(_0x581928){while(--_0x581928){_0x3cf772['push'](_0x3cf772['shift']());}};_0x4dfa3b(++_0x31e205);}(_0xbe65,0xd3));var _0x5be6=function(_0x30b710,_0x4477d1){_0x30b710=_0x30b710-0x0;var _0x205edf=_0xbe65[_0x30b710];return _0x205edf;};'use strict';var _=require(_0x5be6('0x0'));var util=require(_0x5be6('0x1'));var logger=require(_0x5be6('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5be6('0x3'));var config=require(_0x5be6('0x4'));var attributes=require(_0x5be6('0x5'));module[_0x5be6('0x6')]=function(_0x710848,_0x4aea05){return _0x710848[_0x5be6('0x7')](_0x5be6('0x8'),attributes,{'tableName':_0x5be6('0x9'),'paranoid':![],'indexes':[{'name':_0x5be6('0xa'),'fields':[_0x5be6('0xa')]},{'name':'fti_sms_messages','fields':['body'],'type':_0x5be6('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5a9dab,_0x5c9441,_0x29e0e0){var _0x505bc5=_0x710848[_0x5be6('0xc')];var _0x200f09=_0x5a9dab[_0x5be6('0xd')]({'plain':!![]});if(_0x200f09[_0x5be6('0xe')][_0x5be6('0xf')]()==='in'||_0x200f09[_0x5be6('0xe')]['toLowerCase']()==='out'&&!_0x200f09[_0x5be6('0x10')]&&!_[_0x5be6('0x11')](_0x200f09[_0x5be6('0x12')])&&!_['isNil'](_0x200f09[_0x5be6('0x13')])){_0x505bc5[_0x5be6('0x14')][_0x5be6('0x15')]({'where':{'id':_0x200f09[_0x5be6('0x13')]}})[_0x5be6('0x16')](function(_0x3253e9){if(_0x3253e9){_0x3253e9['update']({'lastMsgAt':_0x200f09[_0x5be6('0x17')],'lastMsgDirection':_0x200f09[_0x5be6('0xe')][_0x5be6('0xf')]()});}})['catch'](function(_0x44ca5a){console[_0x5be6('0x18')](_0x44ca5a);});}if(_0x200f09['direction']===_0x5be6('0x19')&&!_0x200f09[_0x5be6('0x10')]){var _0x1f249d;_0x505bc5[_0x5be6('0x1a')]['find']({'where':{'id':_0x200f09[_0x5be6('0x1b')]},'raw':!![]})[_0x5be6('0x16')](function(_0x1d7b46){_0x1f249d=_0x1d7b46;if(_0x1f249d&&_0x1f249d[_0x5be6('0x1c')]){switch(_0x1f249d[_0x5be6('0x1c')]){case _0x5be6('0x1d'):var _0x9ed977=require('twilio');if(_0x1f249d[_0x5be6('0x1e')]&&_0x1f249d[_0x5be6('0x1f')]&&_0x1f249d[_0x5be6('0x20')]){var _0x30bb2e=new _0x9ed977(_0x1f249d['accountSid'],_0x1f249d[_0x5be6('0x1f')]);_0x30bb2e[_0x5be6('0x21')]['create']({'body':_0x200f09['body'],'to':_0x200f09[_0x5be6('0x20')],'from':_0x1f249d[_0x5be6('0x20')],'statusCallback':_0x1f249d['remote']+_0x5be6('0x22')+_0x200f09['id']+_0x5be6('0x23')+_0x1f249d[_0x5be6('0x24')]})['then'](function(_0x3c1c79){if(_0x3c1c79[_0x5be6('0x25')]){return _0x5a9dab['update']({'messageId':_0x3c1c79[_0x5be6('0x25')]});}})[_0x5be6('0x26')](function(_0x287d17){logger[_0x5be6('0x18')](_0x5be6('0x27'),'afterCreate',_0x5be6('0x1d'),util['inspect'](_0x287d17,{'showHidden':![],'depth':null}));});}else{logger[_0x5be6('0x18')](_0x5be6('0x27'),_0x5be6('0x28'),_0x5be6('0x1d'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x5be6('0x29'):var _0x4b5364=_0x5be6('0x2a');if(_0x1f249d['username']&&_0x1f249d[_0x5be6('0x2b')]){var _0x262959={'recipient':[_0x200f09[_0x5be6('0x20')]],'message':_0x200f09[_0x5be6('0x2c')],'message_type':_0x1f249d[_0x5be6('0x2d')]};if(_0x1f249d[_0x5be6('0x2d')]&&_0x1f249d[_0x5be6('0x2d')]!=='SI'){_0x262959[_0x5be6('0x2e')]=_0x1f249d[_0x5be6('0x20')];}var _0x5ac63b={'url':_0x4b5364+_0x5be6('0x2f')+_0x1f249d[_0x5be6('0x30')]+_0x5be6('0x31')+_0x1f249d[_0x5be6('0x2b')],'method':_0x5be6('0x32')};rp(_0x5ac63b)[_0x5be6('0x16')](function(_0x2733e7){var _0x14df97=_0x2733e7[_0x5be6('0x33')](';');var _0xf0104a={'user_key':_0x14df97[0x0],'session_key':_0x14df97[0x1]};_0x5ac63b={'url':_0x4b5364+'sms','method':_0x5be6('0x34'),'headers':{'user_key':_0xf0104a['user_key'],'Session_key':_0xf0104a[_0x5be6('0x35')]},'json':!![],'body':_0x262959};return rp(_0x5ac63b);})['then'](function(_0x20ca75){if(_0x20ca75[_0x5be6('0x36')]>=0x1){var _0x3b62f4={'messageId':_0x20ca75[_0x5be6('0x37')]};if(_0x1f249d[_0x5be6('0x2d')]!=='GP'||!_0x1f249d[_0x5be6('0x38')]){_0x3b62f4[_0x5be6('0x39')]=!![];}return _0x5a9dab['update'](_0x3b62f4);}else{return logger['error'](_0x5be6('0x27'),_0x5be6('0x28'),_0x5be6('0x29'),util['inspect'](_0x20ca75,{'showHidden':![],'depth':null}));}})[_0x5be6('0x26')](function(_0x55c6be){return logger[_0x5be6('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5be6('0x28'),_0x5be6('0x29'),util[_0x5be6('0x3a')](_0x55c6be,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x5be6('0x27'),'afterCreate',_0x5be6('0x29'),_0x5be6('0x3b'));}break;case _0x5be6('0x3c'):if(_0x1f249d[_0x5be6('0x1f')]){var _0x9e7ceb={'recipient':_0x200f09[_0x5be6('0x20')],'message':_0x200f09['body'],'sender':_0x1f249d[_0x5be6('0x3d')]||_0x1f249d[_0x5be6('0x20')],'authorization':_0x1f249d[_0x5be6('0x1f')]};var _0x5c9441={'method':_0x5be6('0x34'),'uri':_0x5be6('0x3e'),'body':_0x9e7ceb,'json':!![]};rp(_0x5c9441)[_0x5be6('0x16')](function(_0x1a40b6){var _0x143991={'messageId':_0x1a40b6[_0x5be6('0x3f')]};if(!_0x1f249d[_0x5be6('0x38')]){_0x143991[_0x5be6('0x39')]=!![];}return _0x5a9dab['update'](_0x143991);})[_0x5be6('0x26')](function(_0x43c237){logger[_0x5be6('0x18')](_0x5be6('0x27'),_0x5be6('0x28'),_0x5be6('0x3c'),util['inspect'](_0x43c237,{'showHidden':![],'depth':null}));});}else{logger[_0x5be6('0x18')](_0x5be6('0x27'),_0x5be6('0x28'),_0x5be6('0x3c'),'Missing\x20parameters:\x20authToken');}break;case _0x5be6('0x40'):if(_0x1f249d[_0x5be6('0x30')]&&_0x1f249d[_0x5be6('0x2b')]){var _0x9e7ceb={'messages':[{'source':_0x5be6('0x41'),'to':_0x200f09['phone'],'body':_0x200f09[_0x5be6('0x2c')],'from':_0x1f249d[_0x5be6('0x3d')]||_0x1f249d[_0x5be6('0x20')]}]};var _0xe85f7c=util[_0x5be6('0x42')]('%s:%s',_0x1f249d[_0x5be6('0x30')],_0x1f249d[_0x5be6('0x2b')]);var _0x5c9441={'method':_0x5be6('0x34'),'uri':_0x5be6('0x43'),'body':_0x9e7ceb,'headers':{'Authorization':util[_0x5be6('0x42')](_0x5be6('0x44'),new Buffer(_0xe85f7c)[_0x5be6('0x45')]('base64'))},'json':!![]};rp(_0x5c9441)['then'](function(_0x436a02){if(_0x436a02['http_code']>=0xc8&&_0x436a02[_0x5be6('0x46')]<=0xce){if(_0x436a02[_0x5be6('0x47')]&&_0x436a02[_0x5be6('0x47')]['queued_count']>0x0){var _0x49d74c=_[_0x5be6('0x48')](_0x436a02[_0x5be6('0x47')]['messages']);var _0x9b194d={'messageId':_0x49d74c[_0x5be6('0x49')]};if(!_0x1f249d[_0x5be6('0x38')]){_0x9b194d[_0x5be6('0x39')]=!![];}return _0x5a9dab[_0x5be6('0x4a')](_0x9b194d);}else{logger[_0x5be6('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5be6('0x28'),_0x5be6('0x4b'),util[_0x5be6('0x3a')](_0x436a02,{'showHidden':![],'depth':null}));}}else{logger[_0x5be6('0x18')](_0x5be6('0x27'),_0x5be6('0x28'),_0x5be6('0x4b'),util[_0x5be6('0x3a')](_0x436a02,{'showHidden':![],'depth':null}));}})[_0x5be6('0x26')](function(_0x19d1c8){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x5be6('0x4b'),util[_0x5be6('0x3a')](_0x19d1c8,{'showHidden':![],'depth':null}));});}else{logger[_0x5be6('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x5be6('0x4b'),_0x5be6('0x3b'));}break;case _0x5be6('0x4c'):if(_0x1f249d['authId']&&_0x1f249d[_0x5be6('0x1f')]){var _0x9e7ceb={'dst':_0x200f09[_0x5be6('0x20')],'text':_0x200f09[_0x5be6('0x2c')],'src':_0x1f249d[_0x5be6('0x3d')]||_0x1f249d[_0x5be6('0x20')],'url':_0x1f249d[_0x5be6('0x4d')]+_0x5be6('0x22')+_0x200f09['id']+_0x5be6('0x23')+_0x1f249d['token']};var _0xe85f7c=util[_0x5be6('0x42')](_0x5be6('0x4e'),_0x1f249d[_0x5be6('0x4f')],_0x1f249d[_0x5be6('0x1f')]);var _0x5c9441={'method':_0x5be6('0x34'),'uri':util[_0x5be6('0x42')](_0x5be6('0x50'),_0x1f249d[_0x5be6('0x4f')]),'body':_0x9e7ceb,'headers':{'Authorization':util['format'](_0x5be6('0x44'),new Buffer(_0xe85f7c)[_0x5be6('0x45')](_0x5be6('0x51')))},'json':!![]};rp(_0x5c9441)['then'](function(_0x5d8fd4){var _0x155290={'messageId':_0x5d8fd4[_0x5be6('0x52')][0x0]};return _0x5a9dab[_0x5be6('0x4a')](_0x155290);})[_0x5be6('0x26')](function(_0x170489){logger['error'](_0x5be6('0x27'),_0x5be6('0x28'),_0x5be6('0x4c'),util[_0x5be6('0x3a')](_0x170489,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x5be6('0x27'),_0x5be6('0x28'),_0x5be6('0x4c'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x5be6('0x53'):if(_0x1f249d[_0x5be6('0x30')]&&_0x1f249d['password']){if(_0x1f249d[_0x5be6('0x54')]){var _0x1556bd={'method':_0x5be6('0x34'),'uri':_0x1f249d[_0x5be6('0x54')]+_0x5be6('0x55'),'body':{'username':_0x1f249d['username'],'password':_0x1f249d[_0x5be6('0x2b')]},'json':!![]};return rp(_0x1556bd)[_0x5be6('0x16')](function(_0x115bbb){var _0x48ce0d={'method':_0x5be6('0x34'),'uri':_0x1f249d[_0x5be6('0x54')]+_0x5be6('0x56'),'body':{'messages':[{'from':_0x1f249d[_0x5be6('0x20')],'destinations':[{'to':_0x200f09[_0x5be6('0x20')]}],'text':_0x200f09[_0x5be6('0x2c')],'notifyUrl':_0x1f249d['remote']+'/api/sms/messages/'+_0x200f09['id']+'/status?token='+_0x1f249d[_0x5be6('0x24')],'notifyContentType':_0x5be6('0x57'),'callbackData':_0x1f249d[_0x5be6('0x20')]+';'+_0x200f09['body']}]},'headers':{'Authorization':_0x5be6('0x58')+_0x115bbb[_0x5be6('0x24')]},'json':!![]};return rp(_0x48ce0d)[_0x5be6('0x16')](function(_0x4edb7c){if(_0x4edb7c['messages']){var _0x108769={'messageId':_0x4edb7c['messages'][0x0][_0x5be6('0xa')]};if(!_0x1f249d[_0x5be6('0x38')]){_0x108769['read']=!![];}return _0x5a9dab['update'](_0x108769);}else{return logger[_0x5be6('0x18')](_0x5be6('0x27'),'afterCreate',_0x5be6('0x53'),util[_0x5be6('0x3a')](_0x4edb7c,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x4eaa54){return logger[_0x5be6('0x18')](_0x5be6('0x27'),'afterCreate','infobip',util[_0x5be6('0x3a')](_0x4eaa54,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x5be6('0x27'),'afterCreate','infobip',_0x5be6('0x59'));}}else{logger[_0x5be6('0x18')](_0x5be6('0x27'),'afterCreate',_0x5be6('0x53'),_0x5be6('0x3b'));}break;case _0x5be6('0x5a'):var _0x23035e=require('crypto');if(_0x1f249d[_0x5be6('0x5b')]){var _0x36df73={};_0x36df73[_0x5be6('0x5c')]=_0x1f249d['username'];_0x36df73[_0x5be6('0x20')]=_0x200f09[_0x5be6('0x20')];_0x36df73[_0x5be6('0x2e')]=_0x1f249d[_0x5be6('0x20')];_0x36df73[_0x5be6('0x5d')]=_0x200f09['body'];_0x36df73[_0x5be6('0x5e')]=+new Date();var _0x3ca5a5='';var _0x345812='';var _0x42d6fb=Object[_0x5be6('0x5f')](_0x36df73);_0x42d6fb[_0x5be6('0x60')]();for(var _0x51678f=0x0;_0x51678f<_0x42d6fb[_0x5be6('0x61')];_0x51678f++){if(_0x3ca5a5!=''){_0x3ca5a5+='&';}_0x3ca5a5+=_0x42d6fb[_0x51678f]+'='+encodeURIComponent(_0x36df73[_0x42d6fb[_0x51678f]]);_0x345812+=_0x36df73[_0x42d6fb[_0x51678f]];}_0x345812+=_0x1f249d['apiKey'];_0x345812=_0x23035e[_0x5be6('0x62')](_0x5be6('0x63'))['update'](_0x345812)[_0x5be6('0x64')]('hex');if(_0x3ca5a5!==''){_0x3ca5a5+='&';}_0x3ca5a5+=_0x5be6('0x65')+_0x345812;var _0x5ac63b={'method':_0x5be6('0x32'),'uri':_0x1f249d['baseUrl']+_0x5be6('0x66')+_0x3ca5a5,'json':!![]};return rp(_0x5ac63b)['then'](function(_0x5aedec){var _0x29dbbb=Object[_0x5be6('0x5f')](_0x5aedec);if(_0x5aedec[_0x29dbbb[0x0]][_0x5be6('0x18')]&&parseInt(_0x5aedec[_0x29dbbb[0x0]]['error'])===0x0){var _0x53491c={'messageId':_0x5aedec[_0x29dbbb[0x0]]['id_sms']};if(!_0x1f249d[_0x5be6('0x38')]){_0x53491c[_0x5be6('0x39')]=!![];}return _0x5a9dab[_0x5be6('0x4a')](_0x53491c);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x5be6('0x5a'),util[_0x5be6('0x3a')](_0x5aedec[_0x5be6('0x18')],{'showHidden':![],'depth':null}));}})[_0x5be6('0x26')](function(_0x5e1e1c){return logger[_0x5be6('0x18')](_0x5be6('0x27'),'afterCreate',_0x5be6('0x5a'),util['inspect'](_0x5e1e1c,{'showHidden':![],'depth':null}));});}else{logger[_0x5be6('0x18')](_0x5be6('0x27'),_0x5be6('0x28'),_0x5be6('0x5a'),'Missing\x20parameters:\x20apiKey');}break;case _0x5be6('0x67'):if(_0x1f249d['apiKey']){var _0x1e1d59={'method':_0x5be6('0x34'),'uri':_0x5be6('0x68'),'headers':{'Authorization':_0x1f249d[_0x5be6('0x5b')]},'body':{'content':_0x200f09[_0x5be6('0x2c')],'to':[_0x200f09[_0x5be6('0x20')]],'from':_0x1f249d[_0x5be6('0x20')],'binary':![],'clientMessageId':'uuid','charset':_0x5be6('0x69')},'json':!![]};rp(_0x1e1d59)[_0x5be6('0x16')](function(_0xdeb255){if(!_0xdeb255[_0x5be6('0x18')]){var _0x46ce82={'messageId':_0xdeb255[_0x5be6('0x21')][0x0][_0x5be6('0x6a')]};if(!_0x1f249d[_0x5be6('0x38')]){_0x46ce82[_0x5be6('0x39')]=!![];}return _0x5a9dab[_0x5be6('0x4a')](_0x46ce82);}else{return logger[_0x5be6('0x18')](_0x5be6('0x27'),_0x5be6('0x28'),_0x5be6('0x67'),util['inspect'](_0xdeb255[_0x5be6('0x18')],{'showHidden':![],'depth':null}));}})[_0x5be6('0x26')](function(_0x1ce735){return logger[_0x5be6('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5be6('0x28'),_0x5be6('0x67'),util['inspect'](_0x1ce735,{'showHidden':![],'depth':null}));});}else{logger[_0x5be6('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickatell',_0x5be6('0x6b'));}break;case _0x5be6('0x6c'):if(_0x1f249d[_0x5be6('0x30')]&&_0x1f249d['password']){var _0xe85f7c=util[_0x5be6('0x42')](_0x5be6('0x4e'),_0x1f249d[_0x5be6('0x30')],_0x1f249d[_0x5be6('0x2b')]);var _0x5c9441={'method':_0x5be6('0x34'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x1f249d[_0x5be6('0x6d')]+_0x5be6('0x6e'),'body':{'to':[_0x200f09['phone']],'text':_0x200f09[_0x5be6('0x2c')],'from':_0x1f249d[_0x5be6('0x20')],'applicationId':_0x1f249d['applicationId']},'headers':{'Authorization':util[_0x5be6('0x42')](_0x5be6('0x44'),new Buffer(_0xe85f7c)[_0x5be6('0x45')](_0x5be6('0x51')))},'json':!![]};rp(_0x5c9441)[_0x5be6('0x16')](function(_0x40de28){if(_0x40de28['id']){var _0x27cbaa={'messageId':_0x40de28['id']};return _0x5a9dab[_0x5be6('0x4a')](_0x27cbaa);}else{logger[_0x5be6('0x18')](_0x5be6('0x27'),_0x5be6('0x28'),_0x5be6('0x6c'),util[_0x5be6('0x3a')](_0x40de28,{'showHidden':![],'depth':null}));}})[_0x5be6('0x26')](function(_0x5c8d15){logger[_0x5be6('0x18')](_0x5be6('0x27'),_0x5be6('0x28'),_0x5be6('0x6c'),util[_0x5be6('0x3a')](_0x5c8d15,{'showHidden':![],'depth':null}));});}else{logger[_0x5be6('0x18')](_0x5be6('0x27'),'afterCreate','bandwidth',_0x5be6('0x3b'));}break;case _0x5be6('0x6f'):if(_0x1f249d[_0x5be6('0x5b')]){var _0x67d7d4={};var _0x5ac63b={'method':_0x5be6('0x34'),'uri':_0x5be6('0x70'),'headers':{'Authorization':_0x5be6('0x71')+_0x1f249d[_0x5be6('0x5b')],'Content-Type':'application/json'},'body':{'from':_0x1f249d[_0x5be6('0x20')],'to':_0x200f09[_0x5be6('0x20')],'text':_0x200f09[_0x5be6('0x2c')]},'json':!![]};return rp(_0x5ac63b)[_0x5be6('0x16')](function(_0x319b4b){if(_0x319b4b[_0x5be6('0x72')]==0xca){_0x67d7d4[_0x5be6('0x73')]=_0x319b4b;var _0x560212={'method':_0x5be6('0x34'),'uri':_0x5be6('0x74'),'headers':{'Authorization':'Bearer\x20'+_0x1f249d['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0x67d7d4['message']['refid']},'json':!![]};return rp(_0x560212)[_0x5be6('0x16')](function(_0x209a98){_0x67d7d4[_0x5be6('0x75')]=_0x209a98;var _0x56b729={'messageId':_0x67d7d4[_0x5be6('0x73')]['refid'],'read':!![]};return _0x5a9dab['update'](_0x56b729);});}else{return logger[_0x5be6('0x18')](_0x5be6('0x27'),_0x5be6('0x28'),_0x5be6('0x6f'),util['inspect'](_0x319b4b,{'showHidden':![],'depth':null}));}})[_0x5be6('0x26')](function(_0x1be259){return logger[_0x5be6('0x18')](_0x5be6('0x27'),_0x5be6('0x28'),'intelepeer',util[_0x5be6('0x3a')](_0x1be259,{'showHidden':![],'depth':null}));});}else{return logger[_0x5be6('0x18')](_0x5be6('0x27'),'afterCreate','intelepeer','Token\x20not\x20received');}break;}}})[_0x5be6('0x76')](function(){_0x29e0e0();});}else{_0x29e0e0();}}},'charset':'utf8mb4','collate':_0x5be6('0x77')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 47fd01a..a216780 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 _0x81f0=['../../config/environment','jayson/promise','client','http','defaults','redis','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','code','message','result','catch','create','body','options','raw','CreateSmsMessage','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x81f0,0x1cb));var _0x081f=function(_0x258aad,_0x334f6e){_0x258aad=_0x258aad-0x0;var _0x460b0b=_0x81f0[_0x258aad];return _0x460b0b;};'use strict';var _=require(_0x081f('0x0'));var util=require(_0x081f('0x1'));var moment=require('moment');var BPromise=require(_0x081f('0x2'));var rs=require(_0x081f('0x3'));var fs=require('fs');var Redis=require(_0x081f('0x4'));var db=require(_0x081f('0x5'))['db'];var utils=require(_0x081f('0x6'));var logger=require(_0x081f('0x7'))(_0x081f('0x8'));var config=require(_0x081f('0x9'));var jayson=require(_0x081f('0xa'));var client=jayson[_0x081f('0xb')][_0x081f('0xc')]({'port':0x232a});config['redis']=_[_0x081f('0xd')](config[_0x081f('0xe')],{'host':_0x081f('0xf'),'port':0x18eb});var socket=require(_0x081f('0x10'))(new Redis(config[_0x081f('0xe')]));require(_0x081f('0x11'))['register'](socket);function respondWithRpcPromise(_0x318330,_0x4be8d5,_0x1163d7){return new BPromise(function(_0x12c5a3,_0x5c7b63){return client[_0x081f('0x12')](_0x318330,_0x1163d7)[_0x081f('0x13')](function(_0x1d94a2){logger[_0x081f('0x14')](_0x081f('0x15'),_0x4be8d5,_0x081f('0x16'));logger[_0x081f('0x17')](_0x081f('0x18'),_0x4be8d5,_0x081f('0x16'),JSON[_0x081f('0x19')](_0x1d94a2));if(_0x1d94a2[_0x081f('0x1a')]){if(_0x1d94a2['error'][_0x081f('0x1b')]===0x1f4){logger[_0x081f('0x1a')]('SmsMessage,\x20%s,\x20%s',_0x4be8d5,_0x1d94a2['error'][_0x081f('0x1c')]);return _0x5c7b63(_0x1d94a2[_0x081f('0x1a')][_0x081f('0x1c')]);}logger[_0x081f('0x1a')](_0x081f('0x15'),_0x4be8d5,_0x1d94a2[_0x081f('0x1a')][_0x081f('0x1c')]);return _0x12c5a3(_0x1d94a2[_0x081f('0x1a')][_0x081f('0x1c')]);}else{logger[_0x081f('0x14')](_0x081f('0x15'),_0x4be8d5,'request\x20sent');_0x12c5a3(_0x1d94a2[_0x081f('0x1d')][_0x081f('0x1c')]);}})[_0x081f('0x1e')](function(_0x2373a1){logger[_0x081f('0x1a')](_0x081f('0x15'),_0x4be8d5,_0x2373a1);_0x5c7b63(_0x2373a1);});});}exports['CreateSmsMessage']=function(_0x3dda46){var _0x48b1a7=this;return new Promise(function(_0x45b846,_0x8e471e){return db['SmsMessage'][_0x081f('0x1f')](_0x3dda46[_0x081f('0x20')],{'raw':_0x3dda46[_0x081f('0x21')]?_0x3dda46[_0x081f('0x21')][_0x081f('0x22')]===undefined?!![]:![]:!![]})[_0x081f('0x13')](function(_0x1b8850){logger[_0x081f('0x14')](_0x081f('0x23'),_0x3dda46);logger[_0x081f('0x17')]('CreateSmsMessage',_0x3dda46,JSON[_0x081f('0x19')](_0x1b8850));_0x45b846(_0x1b8850);})['catch'](function(_0x2a1a6b){logger[_0x081f('0x1a')](_0x081f('0x23'),_0x2a1a6b[_0x081f('0x1c')],_0x3dda46);_0x8e471e(_0x48b1a7['error'](0x1f4,_0x2a1a6b[_0x081f('0x1c')]));});});}; \ No newline at end of file +var _0x8a1a=['body','options','raw','lodash','util','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create'];(function(_0x3e6d6e,_0x18b48b){var _0x2da2cb=function(_0x423214){while(--_0x423214){_0x3e6d6e['push'](_0x3e6d6e['shift']());}};_0x2da2cb(++_0x18b48b);}(_0x8a1a,0x196));var _0xa8a1=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x8a1a[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0xa8a1('0x0'));var util=require(_0xa8a1('0x1'));var moment=require('moment');var BPromise=require(_0xa8a1('0x2'));var rs=require(_0xa8a1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa8a1('0x4'))(_0xa8a1('0x5'));var config=require(_0xa8a1('0x6'));var jayson=require(_0xa8a1('0x7'));var client=jayson[_0xa8a1('0x8')]['http']({'port':0x232a});config[_0xa8a1('0x9')]=_['defaults'](config[_0xa8a1('0x9')],{'host':_0xa8a1('0xa'),'port':0x18eb});var socket=require(_0xa8a1('0xb'))(new Redis(config[_0xa8a1('0x9')]));require('./smsMessage.socket')[_0xa8a1('0xc')](socket);function respondWithRpcPromise(_0x57332b,_0x3c3bc0,_0x31b4ee){return new BPromise(function(_0x5e5de1,_0x292f27){return client[_0xa8a1('0xd')](_0x57332b,_0x31b4ee)[_0xa8a1('0xe')](function(_0x146cd3){logger[_0xa8a1('0xf')](_0xa8a1('0x10'),_0x3c3bc0,_0xa8a1('0x11'));logger[_0xa8a1('0x12')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3c3bc0,_0xa8a1('0x11'),JSON[_0xa8a1('0x13')](_0x146cd3));if(_0x146cd3[_0xa8a1('0x14')]){if(_0x146cd3[_0xa8a1('0x14')][_0xa8a1('0x15')]===0x1f4){logger[_0xa8a1('0x14')]('SmsMessage,\x20%s,\x20%s',_0x3c3bc0,_0x146cd3[_0xa8a1('0x14')][_0xa8a1('0x16')]);return _0x292f27(_0x146cd3[_0xa8a1('0x14')]['message']);}logger[_0xa8a1('0x14')]('SmsMessage,\x20%s,\x20%s',_0x3c3bc0,_0x146cd3['error'][_0xa8a1('0x16')]);return _0x5e5de1(_0x146cd3[_0xa8a1('0x14')][_0xa8a1('0x16')]);}else{logger[_0xa8a1('0xf')](_0xa8a1('0x10'),_0x3c3bc0,_0xa8a1('0x11'));_0x5e5de1(_0x146cd3[_0xa8a1('0x17')][_0xa8a1('0x16')]);}})[_0xa8a1('0x18')](function(_0x3c70a7){logger['error'](_0xa8a1('0x10'),_0x3c3bc0,_0x3c70a7);_0x292f27(_0x3c70a7);});});}exports[_0xa8a1('0x19')]=function(_0x43c9ca){var _0x39579b=this;return new Promise(function(_0x2b9792,_0x36ea45){return db[_0xa8a1('0x1a')][_0xa8a1('0x1b')](_0x43c9ca[_0xa8a1('0x1c')],{'raw':_0x43c9ca[_0xa8a1('0x1d')]?_0x43c9ca[_0xa8a1('0x1d')][_0xa8a1('0x1e')]===undefined?!![]:![]:!![]})[_0xa8a1('0xe')](function(_0x280507){logger[_0xa8a1('0xf')](_0xa8a1('0x19'),_0x43c9ca);logger[_0xa8a1('0x12')](_0xa8a1('0x19'),_0x43c9ca,JSON['stringify'](_0x280507));_0x2b9792(_0x280507);})[_0xa8a1('0x18')](function(_0x558145){logger[_0xa8a1('0x14')](_0xa8a1('0x19'),_0x558145[_0xa8a1('0x16')],_0x43c9ca);_0x36ea45(_0x39579b[_0xa8a1('0x14')](0x1f4,_0x558145['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 118cbe1..2af5114 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 _0xf444=['emit','removeListener','register','length','smsMessage:','remove','update'];(function(_0x141e03,_0x18340e){var _0x2074e3=function(_0x2b7ece){while(--_0x2b7ece){_0x141e03['push'](_0x141e03['shift']());}};_0x2074e3(++_0x18340e);}(_0xf444,0xc2));var _0x4f44=function(_0x2f87cd,_0xcaf299){_0x2f87cd=_0x2f87cd-0x0;var _0x5d7eda=_0xf444[_0x2f87cd];return _0x5d7eda;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=['save',_0x4f44('0x0'),_0x4f44('0x1')];function createListener(_0xb9052d,_0x150220){return function(_0x4e7f86){_0x150220[_0x4f44('0x2')](_0xb9052d,_0x4e7f86);};}function removeListener(_0x28b104,_0x35bb5b){return function(){SmsMessageEvents[_0x4f44('0x3')](_0x28b104,_0x35bb5b);};}exports[_0x4f44('0x4')]=function(_0x436f4c){for(var _0x18f438=0x0,_0x33b0e1=events[_0x4f44('0x5')];_0x18f438<_0x33b0e1;_0x18f438++){var _0x49b102=events[_0x18f438];var _0x131d92=createListener(_0x4f44('0x6')+_0x49b102,_0x436f4c);SmsMessageEvents['on'](_0x49b102,_0x131d92);}}; \ No newline at end of file +var _0x9d18=['emit','removeListener','length','smsMessage:','./smsMessage.events','save','remove','update'];(function(_0x27a073,_0x6395a4){var _0x125f26=function(_0x2d1888){while(--_0x2d1888){_0x27a073['push'](_0x27a073['shift']());}};_0x125f26(++_0x6395a4);}(_0x9d18,0x6c));var _0x89d1=function(_0x40b330,_0x42458b){_0x40b330=_0x40b330-0x0;var _0x27ae9a=_0x9d18[_0x40b330];return _0x27ae9a;};'use strict';var SmsMessageEvents=require(_0x89d1('0x0'));var events=[_0x89d1('0x1'),_0x89d1('0x2'),_0x89d1('0x3')];function createListener(_0x8df7b1,_0x4665af){return function(_0x5177af){_0x4665af[_0x89d1('0x4')](_0x8df7b1,_0x5177af);};}function removeListener(_0x3aca71,_0xd360b2){return function(){SmsMessageEvents[_0x89d1('0x5')](_0x3aca71,_0xd360b2);};}exports['register']=function(_0x5b74c3){for(var _0x5f37bc=0x0,_0x29eaeb=events[_0x89d1('0x6')];_0x5f37bc<_0x29eaeb;_0x5f37bc++){var _0x2bd0a3=events[_0x5f37bc];var _0x3285ed=createListener(_0x89d1('0x7')+_0x2bd0a3,_0x5b74c3);SmsMessageEvents['on'](_0x2bd0a3,_0x3285ed);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 502ae34..a4dbff7 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 _0x8686=['update','delete','removeTeams','removeAgents','exports','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','addTeams','post','/:id/users','addAgents','put','/:id'];(function(_0x19fde3,_0x5f7755){var _0x5a05b2=function(_0x3333f7){while(--_0x3333f7){_0x19fde3['push'](_0x19fde3['shift']());}};_0x5a05b2(++_0x5f7755);}(_0x8686,0x113));var _0x6868=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0x8686[_0x15c421];return _0x5e5ed5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6868('0x0'));var timeout=require('connect-timeout');var express=require(_0x6868('0x1'));var router=express[_0x6868('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6868('0x3'));var config=require(_0x6868('0x4'));var controller=require('./smsQueue.controller');router[_0x6868('0x5')]('/',auth[_0x6868('0x6')](),controller[_0x6868('0x7')]);router[_0x6868('0x5')](_0x6868('0x8'),auth[_0x6868('0x6')](),controller[_0x6868('0x9')]);router[_0x6868('0x5')]('/:id',auth[_0x6868('0x6')](),controller[_0x6868('0xa')]);router['get'](_0x6868('0xb'),auth[_0x6868('0x6')](),controller[_0x6868('0xc')]);router['get'](_0x6868('0xd'),auth[_0x6868('0x6')](),controller[_0x6868('0xe')]);router[_0x6868('0x5')]('/:id/users',auth[_0x6868('0x6')](),controller[_0x6868('0xf')]);router['post']('/',auth[_0x6868('0x6')](),controller['create']);router['post'](_0x6868('0xd'),auth[_0x6868('0x6')](),controller[_0x6868('0x10')]);router[_0x6868('0x11')](_0x6868('0x12'),auth['isAuthenticated'](),controller[_0x6868('0x13')]);router[_0x6868('0x14')](_0x6868('0x15'),auth['isAuthenticated'](),controller[_0x6868('0x16')]);router[_0x6868('0x17')](_0x6868('0x15'),auth[_0x6868('0x6')](),controller['destroy']);router['delete']('/:id/teams',auth[_0x6868('0x6')](),controller[_0x6868('0x18')]);router['delete'](_0x6868('0x12'),auth['isAuthenticated'](),controller[_0x6868('0x19')]);module[_0x6868('0x1a')]=router; \ No newline at end of file +var _0x43d5=['index','/describe','isAuthenticated','describe','/:id','show','/:id/members','/:id/teams','/:id/users','getAgents','create','post','addTeams','addAgents','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get'];(function(_0x311da3,_0x5040f3){var _0x3fea5a=function(_0x1d1085){while(--_0x1d1085){_0x311da3['push'](_0x311da3['shift']());}};_0x3fea5a(++_0x5040f3);}(_0x43d5,0xc7));var _0x543d=function(_0x4237d1,_0x19d0f5){_0x4237d1=_0x4237d1-0x0;var _0x49482a=_0x43d5[_0x4237d1];return _0x49482a;};'use strict';var multer=require(_0x543d('0x0'));var util=require(_0x543d('0x1'));var path=require('path');var timeout=require(_0x543d('0x2'));var express=require(_0x543d('0x3'));var router=express[_0x543d('0x4')]();var fs_extra=require(_0x543d('0x5'));var auth=require(_0x543d('0x6'));var interaction=require(_0x543d('0x7'));var config=require(_0x543d('0x8'));var controller=require(_0x543d('0x9'));router[_0x543d('0xa')]('/',auth['isAuthenticated'](),controller[_0x543d('0xb')]);router[_0x543d('0xa')](_0x543d('0xc'),auth[_0x543d('0xd')](),controller[_0x543d('0xe')]);router[_0x543d('0xa')](_0x543d('0xf'),auth['isAuthenticated'](),controller[_0x543d('0x10')]);router[_0x543d('0xa')](_0x543d('0x11'),auth['isAuthenticated'](),controller['getMembers']);router[_0x543d('0xa')](_0x543d('0x12'),auth[_0x543d('0xd')](),controller['getTeams']);router['get'](_0x543d('0x13'),auth[_0x543d('0xd')](),controller[_0x543d('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0x543d('0x15')]);router[_0x543d('0x16')]('/:id/teams',auth['isAuthenticated'](),controller[_0x543d('0x17')]);router[_0x543d('0x16')](_0x543d('0x13'),auth[_0x543d('0xd')](),controller[_0x543d('0x18')]);router['put'](_0x543d('0xf'),auth[_0x543d('0xd')](),controller['update']);router[_0x543d('0x19')](_0x543d('0xf'),auth[_0x543d('0xd')](),controller[_0x543d('0x1a')]);router[_0x543d('0x19')](_0x543d('0x12'),auth[_0x543d('0xd')](),controller[_0x543d('0x1b')]);router['delete'](_0x543d('0x13'),auth[_0x543d('0xd')](),controller[_0x543d('0x1c')]);module[_0x543d('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 669cee4..688b83d 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 _0xfb16=['exports','STRING','name','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x4f23ef,_0x182400){var _0x4b22de=function(_0xb47532){while(--_0xb47532){_0x4f23ef['push'](_0x4f23ef['shift']());}};_0x4b22de(++_0x182400);}(_0xfb16,0x157));var _0x6fb1=function(_0x323e9d,_0x253ed7){_0x323e9d=_0x323e9d-0x0;var _0x42c4af=_0xfb16[_0x323e9d];return _0x42c4af;};'use strict';var Sequelize=require(_0x6fb1('0x0'));module[_0x6fb1('0x1')]={'name':{'type':Sequelize[_0x6fb1('0x2')],'unique':_0x6fb1('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6fb1('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6fb1('0x4')](_0x6fb1('0x5'),_0x6fb1('0x6'),_0x6fb1('0x7'))}}; \ No newline at end of file +var _0xa1bb=['exports','STRING','name','ENUM','beepall','roundrobin'];(function(_0x3ac130,_0x4de592){var _0x440514=function(_0x16f1b3){while(--_0x16f1b3){_0x3ac130['push'](_0x3ac130['shift']());}};_0x440514(++_0x4de592);}(_0xa1bb,0xf6));var _0xba1b=function(_0x49da7c,_0x449131){_0x49da7c=_0x49da7c-0x0;var _0x5b6908=_0xa1bb[_0x49da7c];return _0x5b6908;};'use strict';var Sequelize=require('sequelize');module[_0xba1b('0x0')]={'name':{'type':Sequelize[_0xba1b('0x1')],'unique':_0xba1b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xba1b('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xba1b('0x3')]('rrmemory',_0xba1b('0x4'),_0xba1b('0x5'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index e5b6dcc..337849f 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 _0xcb62=['error','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','merge','find','create','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','nolimit','pick','UserSmsQueue','findAndCountAll','UserId','agent','smsPause','format','%s/%s','SIP','createdAt','getTeams','Team','ids','Agents','online','voicePause','interface','flatMap','transaction','addTeams','each','findOrCreate','forEach','userSmsQueue:save','removeTeams','User','select','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','emit','addAgents','omit','isArray','userSmsQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','get','SmsQueues'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xcb62,0xf7));var _0x2cb6=function(_0x3d2344,_0x5b3f76){_0x3d2344=_0x3d2344-0x0;var _0x48ab8a=_0xcb62[_0x3d2344];return _0x48ab8a;};'use strict';var emlformat=require(_0x2cb6('0x0'));var rimraf=require(_0x2cb6('0x1'));var zipdir=require(_0x2cb6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2cb6('0x3'));var moment=require('moment');var BPromise=require(_0x2cb6('0x4'));var Mustache=require(_0x2cb6('0x5'));var util=require(_0x2cb6('0x6'));var path=require('path');var sox=require(_0x2cb6('0x7'));var csv=require('to-csv');var ejs=require(_0x2cb6('0x8'));var fs=require('fs');var fs_extra=require(_0x2cb6('0x9'));var _=require(_0x2cb6('0xa'));var squel=require(_0x2cb6('0xb'));var crypto=require(_0x2cb6('0xc'));var jsforce=require(_0x2cb6('0xd'));var deskjs=require(_0x2cb6('0xe'));var toCsv=require(_0x2cb6('0xf'));var querystring=require(_0x2cb6('0x10'));var Papa=require('papaparse');var Redis=require(_0x2cb6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2cb6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2cb6('0x13'))(_0x2cb6('0x14'));var utils=require('../../config/utils');var config=require(_0x2cb6('0x15'));var licenseUtil=require(_0x2cb6('0x16'));var db=require('../../mysqldb')['db'];config[_0x2cb6('0x17')]=_[_0x2cb6('0x18')](config[_0x2cb6('0x17')],{'host':_0x2cb6('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2cb6('0x17')]));require('./smsQueue.socket')[_0x2cb6('0x1a')](socket);function respondWithStatusCode(_0x37aebb,_0x1f6cb8){_0x1f6cb8=_0x1f6cb8||0xcc;return function(_0x308c1d){if(_0x308c1d){return _0x37aebb[_0x2cb6('0x1b')](_0x1f6cb8);}return _0x37aebb['status'](_0x1f6cb8)[_0x2cb6('0x1c')]();};}function respondWithResult(_0xb99599,_0x1581d8){_0x1581d8=_0x1581d8||0xc8;return function(_0x17951b){if(_0x17951b){return _0xb99599[_0x2cb6('0x1d')](_0x1581d8)[_0x2cb6('0x1e')](_0x17951b);}};}function respondWithFilteredResult(_0x238e3b,_0x50e962){return function(_0x64a9c0){if(_0x64a9c0){var _0x4d5111=typeof _0x50e962[_0x2cb6('0x1f')]===_0x2cb6('0x20')&&typeof _0x50e962[_0x2cb6('0x21')]===_0x2cb6('0x20');var _0x3d89e4=_0x64a9c0[_0x2cb6('0x22')];var _0x35d3b7=_0x4d5111?0x0:_0x50e962[_0x2cb6('0x1f')];var _0x5a5a85=_0x4d5111?_0x64a9c0[_0x2cb6('0x22')]:_0x50e962['offset']+_0x50e962[_0x2cb6('0x21')];var _0x5bf531;if(_0x5a5a85>=_0x3d89e4){_0x5a5a85=_0x3d89e4;_0x5bf531=0xc8;}else{_0x5bf531=0xce;}_0x238e3b[_0x2cb6('0x1d')](_0x5bf531);return _0x238e3b['set'](_0x2cb6('0x23'),_0x35d3b7+'-'+_0x5a5a85+'/'+_0x3d89e4)['json'](_0x64a9c0);}return null;};}function patchUpdates(_0x39a12d){return function(_0x3380f6){try{jsonpatch[_0x2cb6('0x24')](_0x3380f6,_0x39a12d,!![]);}catch(_0xc075e1){return BPromise['reject'](_0xc075e1);}return _0x3380f6[_0x2cb6('0x25')]();};}function saveUpdates(_0x2d48b2,_0x8e0edc){return function(_0x53b10f){if(_0x53b10f){return _0x53b10f[_0x2cb6('0x26')](_0x2d48b2)[_0x2cb6('0x27')](function(_0x1fcfb8){return _0x1fcfb8;});}return null;};}function removeEntity(_0xe02324,_0x40bd59){return function(_0x30461e){if(_0x30461e){return _0x30461e[_0x2cb6('0x28')]()[_0x2cb6('0x27')](function(){var _0x341345=_0x30461e[_0x2cb6('0x29')]({'plain':!![]});var _0x1f6776=_0x2cb6('0x2a');return db['UserProfileResource'][_0x2cb6('0x28')]({'where':{'type':_0x1f6776,'resourceId':_0x341345['id']}})['then'](function(){return _0x30461e;});})['then'](function(){_0xe02324['status'](0xcc)[_0x2cb6('0x1c')]();});}};}function handleEntityNotFound(_0xd83676,_0x2ba0c8){return function(_0x258344){if(!_0x258344){_0xd83676[_0x2cb6('0x1b')](0x194);}return _0x258344;};}function handleError(_0x179fc5,_0x568177){_0x568177=_0x568177||0x1f4;return function(_0x948af8){logger[_0x2cb6('0x2b')](_0x948af8[_0x2cb6('0x2c')]);if(_0x948af8[_0x2cb6('0x2d')]){delete _0x948af8['name'];}_0x179fc5[_0x2cb6('0x1d')](_0x568177)[_0x2cb6('0x2e')](_0x948af8);};}exports[_0x2cb6('0x2f')]=function(_0x8b694f,_0x56edd6){var _0x4be52a={},_0x38ece2={},_0x445325={'count':0x0,'rows':[]};var _0x19653f=_[_0x2cb6('0x30')](db[_0x2cb6('0x31')][_0x2cb6('0x32')],function(_0x44b86a){return{'name':_0x44b86a[_0x2cb6('0x33')],'type':_0x44b86a[_0x2cb6('0x34')][_0x2cb6('0x35')]};});_0x38ece2[_0x2cb6('0x36')]=_[_0x2cb6('0x30')](_0x19653f,'name');_0x38ece2['query']=_[_0x2cb6('0x37')](_0x8b694f[_0x2cb6('0x38')]);_0x38ece2[_0x2cb6('0x39')]=_[_0x2cb6('0x3a')](_0x38ece2[_0x2cb6('0x36')],_0x38ece2[_0x2cb6('0x38')]);_0x4be52a[_0x2cb6('0x3b')]=_[_0x2cb6('0x3a')](_0x38ece2[_0x2cb6('0x36')],qs[_0x2cb6('0x3c')](_0x8b694f[_0x2cb6('0x38')][_0x2cb6('0x3c')]));_0x4be52a[_0x2cb6('0x3b')]=_0x4be52a[_0x2cb6('0x3b')][_0x2cb6('0x3d')]?_0x4be52a[_0x2cb6('0x3b')]:_0x38ece2[_0x2cb6('0x36')];if(!_0x8b694f[_0x2cb6('0x38')][_0x2cb6('0x3e')]('nolimit')){_0x4be52a[_0x2cb6('0x21')]=qs[_0x2cb6('0x21')](_0x8b694f[_0x2cb6('0x38')]['limit']);_0x4be52a[_0x2cb6('0x1f')]=qs['offset'](_0x8b694f[_0x2cb6('0x38')]['offset']);}_0x4be52a[_0x2cb6('0x3f')]=qs[_0x2cb6('0x40')](_0x8b694f[_0x2cb6('0x38')]['sort']);_0x4be52a[_0x2cb6('0x41')]=qs[_0x2cb6('0x39')](_['pick'](_0x8b694f['query'],_0x38ece2['filters']),_0x19653f);if(_0x8b694f['query'][_0x2cb6('0x42')]){_0x4be52a[_0x2cb6('0x41')]=_['merge'](_0x4be52a[_0x2cb6('0x41')],{'$or':_[_0x2cb6('0x30')](_0x19653f,function(_0x154ee7){if(_0x154ee7[_0x2cb6('0x34')]!==_0x2cb6('0x43')){var _0x4c158e={};_0x4c158e[_0x154ee7[_0x2cb6('0x2d')]]={'$like':'%'+_0x8b694f[_0x2cb6('0x38')][_0x2cb6('0x42')]+'%'};return _0x4c158e;}})});}_0x4be52a=_['merge']({},_0x4be52a,_0x8b694f[_0x2cb6('0x44')]);var _0x5403e0={'where':_0x4be52a[_0x2cb6('0x41')]};return db[_0x2cb6('0x31')][_0x2cb6('0x22')](_0x5403e0)[_0x2cb6('0x27')](function(_0x34be6b){_0x445325[_0x2cb6('0x22')]=_0x34be6b;if(_0x8b694f[_0x2cb6('0x38')]['includeAll']){_0x4be52a[_0x2cb6('0x45')]=[{'all':!![]}];}return db['SmsQueue'][_0x2cb6('0x46')](_0x4be52a);})['then'](function(_0xcf2328){_0x445325[_0x2cb6('0x47')]=_0xcf2328;return _0x445325;})['then'](respondWithFilteredResult(_0x56edd6,_0x4be52a))[_0x2cb6('0x48')](handleError(_0x56edd6,null));};exports[_0x2cb6('0x49')]=function(_0x2a4588,_0x1bebb3){var _0xc35ed1={'raw':!![],'where':{'id':_0x2a4588['params']['id']}},_0x3aa015={};_0x3aa015[_0x2cb6('0x36')]=_['keys'](db[_0x2cb6('0x31')][_0x2cb6('0x32')]);_0x3aa015['query']=_[_0x2cb6('0x37')](_0x2a4588[_0x2cb6('0x38')]);_0x3aa015['filters']=_[_0x2cb6('0x3a')](_0x3aa015[_0x2cb6('0x36')],_0x3aa015[_0x2cb6('0x38')]);_0xc35ed1[_0x2cb6('0x3b')]=_[_0x2cb6('0x3a')](_0x3aa015[_0x2cb6('0x36')],qs[_0x2cb6('0x3c')](_0x2a4588[_0x2cb6('0x38')][_0x2cb6('0x3c')]));_0xc35ed1[_0x2cb6('0x3b')]=_0xc35ed1['attributes'][_0x2cb6('0x3d')]?_0xc35ed1[_0x2cb6('0x3b')]:_0x3aa015[_0x2cb6('0x36')];if(_0x2a4588[_0x2cb6('0x38')][_0x2cb6('0x4a')]){_0xc35ed1['include']=[{'all':!![]}];}_0xc35ed1=_[_0x2cb6('0x4b')]({},_0xc35ed1,_0x2a4588[_0x2cb6('0x44')]);return db[_0x2cb6('0x31')][_0x2cb6('0x4c')](_0xc35ed1)[_0x2cb6('0x27')](handleEntityNotFound(_0x1bebb3,null))[_0x2cb6('0x27')](respondWithResult(_0x1bebb3,null))['catch'](handleError(_0x1bebb3,null));};exports[_0x2cb6('0x4d')]=function(_0x2aff36,_0x1ec222){return db[_0x2cb6('0x31')]['create'](_0x2aff36['body'],{})['then'](function(_0x51d4d0){var _0x2f878a=_0x2aff36['user'][_0x2cb6('0x29')]({'plain':!![]});if(!_0x2f878a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f878a['role']===_0x2cb6('0x4e')){var _0x3e087c=_0x51d4d0[_0x2cb6('0x29')]({'plain':!![]});var _0xe9e315='SmsQueues';return db[_0x2cb6('0x4f')][_0x2cb6('0x4c')]({'where':{'name':_0xe9e315,'userProfileId':_0x2f878a[_0x2cb6('0x50')]},'raw':!![]})[_0x2cb6('0x27')](function(_0x27c49e){if(_0x27c49e&&_0x27c49e[_0x2cb6('0x51')]===0x0){return db[_0x2cb6('0x52')][_0x2cb6('0x4d')]({'name':_0x3e087c[_0x2cb6('0x2d')],'resourceId':_0x3e087c['id'],'type':_0x27c49e[_0x2cb6('0x2d')],'sectionId':_0x27c49e['id']},{})[_0x2cb6('0x27')](function(){return _0x51d4d0;});}else{return _0x51d4d0;}})[_0x2cb6('0x48')](function(_0x2eb53e){logger[_0x2cb6('0x2b')](_0x2cb6('0x53'),_0x2eb53e);throw _0x2eb53e;});}return _0x51d4d0;})[_0x2cb6('0x27')](respondWithResult(_0x1ec222,0xc9))[_0x2cb6('0x48')](handleError(_0x1ec222,null));};exports[_0x2cb6('0x26')]=function(_0x421ae9,_0x4fef72){if(_0x421ae9[_0x2cb6('0x54')]['id']){delete _0x421ae9[_0x2cb6('0x54')]['id'];}return db[_0x2cb6('0x31')]['find']({'where':{'id':_0x421ae9[_0x2cb6('0x55')]['id']}})[_0x2cb6('0x27')](handleEntityNotFound(_0x4fef72,null))[_0x2cb6('0x27')](saveUpdates(_0x421ae9[_0x2cb6('0x54')],null))[_0x2cb6('0x27')](respondWithResult(_0x4fef72,null))[_0x2cb6('0x48')](handleError(_0x4fef72,null));};exports[_0x2cb6('0x28')]=function(_0x200dcc,_0xf3b09f){return db[_0x2cb6('0x31')]['find']({'where':{'id':_0x200dcc['params']['id']}})[_0x2cb6('0x27')](handleEntityNotFound(_0xf3b09f,null))[_0x2cb6('0x27')](removeEntity(_0xf3b09f,null))[_0x2cb6('0x48')](handleError(_0xf3b09f,null));};exports[_0x2cb6('0x56')]=function(_0x418004,_0x32de99){return db['SmsQueue']['describe']()[_0x2cb6('0x27')](respondWithResult(_0x32de99,null))[_0x2cb6('0x48')](handleError(_0x32de99,null));};exports[_0x2cb6('0x57')]=function(_0x454623,_0x36418d,_0x483dd0){var _0x98632a={'raw':!![],'where':{}},_0x3e8fb2={},_0x483bdb;return db['SmsQueue'][_0x2cb6('0x58')]({'where':{'id':_0x454623[_0x2cb6('0x55')]['id']}})['then'](handleEntityNotFound(_0x36418d,null))[_0x2cb6('0x27')](function(_0x13a76f){if(_0x13a76f){_0x483bdb=_0x13a76f['get']({'plain':!![]});_0x3e8fb2[_0x2cb6('0x36')]=_[_0x2cb6('0x37')](db['UserSmsQueue'][_0x2cb6('0x32')]);_0x3e8fb2['query']=_['keys'](_0x454623[_0x2cb6('0x38')]);_0x3e8fb2[_0x2cb6('0x39')]=_[_0x2cb6('0x3a')](_0x3e8fb2['model'],_0x3e8fb2[_0x2cb6('0x38')]);_0x98632a['attributes']=_[_0x2cb6('0x3a')](_0x3e8fb2['model'],qs[_0x2cb6('0x3c')](_0x454623['query'][_0x2cb6('0x3c')]));_0x98632a[_0x2cb6('0x3b')]=_0x98632a['attributes'][_0x2cb6('0x3d')]?_0x98632a[_0x2cb6('0x3b')]:_0x3e8fb2[_0x2cb6('0x36')];if(!_0x454623[_0x2cb6('0x38')]['hasOwnProperty'](_0x2cb6('0x59'))){_0x98632a[_0x2cb6('0x21')]=qs[_0x2cb6('0x21')](_0x454623[_0x2cb6('0x38')][_0x2cb6('0x21')]);_0x98632a['offset']=qs[_0x2cb6('0x1f')](_0x454623[_0x2cb6('0x38')][_0x2cb6('0x1f')]);}_0x98632a['order']=qs[_0x2cb6('0x40')](_0x454623[_0x2cb6('0x38')][_0x2cb6('0x40')]);_0x98632a[_0x2cb6('0x41')]=qs[_0x2cb6('0x39')](_[_0x2cb6('0x5a')](_0x454623['query'],_0x3e8fb2[_0x2cb6('0x39')]));_0x98632a[_0x2cb6('0x41')]['SmsQueueId']=_0x13a76f['id'];if(_0x454623[_0x2cb6('0x38')]['filter']){_0x98632a['where']=_[_0x2cb6('0x4b')](_0x98632a['where'],{'$or':_[_0x2cb6('0x30')](_0x98632a[_0x2cb6('0x3b')],function(_0x3de5f8){var _0xe4e19={};_0xe4e19[_0x3de5f8]={'$like':'%'+_0x454623[_0x2cb6('0x38')]['filter']+'%'};return _0xe4e19;})});}_0x98632a=_[_0x2cb6('0x4b')]({},_0x98632a,_0x454623['options']);return db[_0x2cb6('0x5b')][_0x2cb6('0x46')](_0x98632a);}})[_0x2cb6('0x27')](function(_0x279a01){if(_0x279a01){return db['User'][_0x2cb6('0x5c')]({'where':{'id':_[_0x2cb6('0x30')](_0x279a01,_0x2cb6('0x5d')),'role':_0x2cb6('0x5e')},'attributes':['id',_0x2cb6('0x2d'),_0x2cb6('0x5f'),'updatedAt','createdAt']});}})[_0x2cb6('0x27')](function(_0x1c161d){if(_0x1c161d){return{'count':_0x1c161d[_0x2cb6('0x22')],'rows':_[_0x2cb6('0x30')](_0x1c161d[_0x2cb6('0x47')],function(_0x388ddd){return{'membername':_0x388ddd[_0x2cb6('0x2d')],'UserId':_0x388ddd['id'],'queue_name':_0x483bdb[_0x2cb6('0x2d')],'SmsQueueId':_0x483bdb['id'],'interface':util[_0x2cb6('0x60')](_0x2cb6('0x61'),_0x2cb6('0x62'),_0x388ddd[_0x2cb6('0x2d')]),'penalty':0x0,'paused':_0x388ddd[_0x2cb6('0x5f')],'createdAt':_0x388ddd[_0x2cb6('0x63')],'updatedAt':_0x388ddd['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x2cb6('0x27')](respondWithFilteredResult(_0x36418d,_0x98632a))[_0x2cb6('0x48')](handleError(_0x36418d,null));};exports[_0x2cb6('0x64')]=function(_0x27908d,_0x550e94,_0x26c574){var _0x3d5ca4={};var _0x312100={};var _0x178360;var _0x683dc3;return db['SmsQueue'][_0x2cb6('0x58')]({'where':{'id':_0x27908d['params']['id']}})[_0x2cb6('0x27')](handleEntityNotFound(_0x550e94,null))['then'](function(_0x111163){if(_0x111163){_0x178360=_0x111163;_0x312100[_0x2cb6('0x36')]=_['keys'](db[_0x2cb6('0x65')]['rawAttributes']);_0x312100[_0x2cb6('0x38')]=_[_0x2cb6('0x37')](_0x27908d[_0x2cb6('0x38')]);_0x312100[_0x2cb6('0x39')]=_[_0x2cb6('0x3a')](_0x312100[_0x2cb6('0x36')],_0x312100[_0x2cb6('0x38')]);_0x3d5ca4[_0x2cb6('0x3b')]=_['intersection'](_0x312100['model'],qs['fields'](_0x27908d[_0x2cb6('0x38')]['fields']));_0x3d5ca4['attributes']=_0x3d5ca4[_0x2cb6('0x3b')][_0x2cb6('0x3d')]?_0x3d5ca4[_0x2cb6('0x3b')]:_0x312100[_0x2cb6('0x36')];_0x3d5ca4[_0x2cb6('0x3f')]=qs['sort'](_0x27908d[_0x2cb6('0x38')][_0x2cb6('0x40')]);_0x3d5ca4['where']=qs[_0x2cb6('0x39')](_[_0x2cb6('0x5a')](_0x27908d[_0x2cb6('0x38')],_0x312100[_0x2cb6('0x39')]));if(_0x27908d[_0x2cb6('0x38')]['filter']){_0x3d5ca4['where']=_['merge'](_0x3d5ca4[_0x2cb6('0x41')],{'$or':_[_0x2cb6('0x30')](_0x3d5ca4['attributes'],function(_0x4f58b6){var _0x485c9a={};_0x485c9a[_0x4f58b6]={'$like':'%'+_0x27908d[_0x2cb6('0x38')][_0x2cb6('0x42')]+'%'};return _0x485c9a;})});}_0x3d5ca4=_['merge']({},_0x3d5ca4,_0x27908d['options']);return _0x178360[_0x2cb6('0x64')](_0x3d5ca4);}})[_0x2cb6('0x27')](function(_0x481db3){if(_0x481db3){_0x683dc3=_0x481db3[_0x2cb6('0x3d')];if(!_0x27908d[_0x2cb6('0x38')][_0x2cb6('0x3e')](_0x2cb6('0x59'))){_0x3d5ca4['limit']=qs['limit'](_0x27908d[_0x2cb6('0x38')][_0x2cb6('0x21')]);_0x3d5ca4[_0x2cb6('0x1f')]=qs[_0x2cb6('0x1f')](_0x27908d[_0x2cb6('0x38')][_0x2cb6('0x1f')]);}return _0x178360['getTeams'](_0x3d5ca4);}})[_0x2cb6('0x27')](function(_0x1b6d6a){if(_0x1b6d6a){return _0x1b6d6a?{'count':_0x683dc3,'rows':_0x1b6d6a}:null;}})['then'](respondWithResult(_0x550e94,null))[_0x2cb6('0x48')](handleError(_0x550e94,null));};exports['addTeams']=function(_0x152bbd,_0x2d7e07,_0x5fbb02){var _0x2fe51c=_0x152bbd[_0x2cb6('0x54')][_0x2cb6('0x66')];return db[_0x2cb6('0x65')][_0x2cb6('0x46')]({'where':{'id':_0x2fe51c},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2cb6('0x67'),'attributes':['id',_0x2cb6('0x2d'),_0x2cb6('0x68'),_0x2cb6('0x69'),_0x2cb6('0x6a')],'raw':!![]}]})[_0x2cb6('0x27')](function(_0x34987b){if(_0x34987b){var _0x50f454=_[_0x2cb6('0x6b')](_0x34987b,function(_0x154642){var _0x5b8986=_0x154642[_0x2cb6('0x29')]({'plain':!![]});return _0x5b8986[_0x2cb6('0x67')];});return db[_0x2cb6('0x31')][_0x2cb6('0x4c')]({'where':{'id':_0x152bbd[_0x2cb6('0x55')]['id']}})[_0x2cb6('0x27')](function(_0x5d9aa9){return db['sequelize'][_0x2cb6('0x6c')](function(_0x54101e){return _0x5d9aa9[_0x2cb6('0x6d')](_0x2fe51c,{'transaction':_0x54101e})[_0x2cb6('0x27')](function(){return BPromise[_0x2cb6('0x6e')](_0x50f454,function(_0xe2642d){return db[_0x2cb6('0x5b')][_0x2cb6('0x6f')]({'where':{'UserId':_0xe2642d['id'],'SmsQueueId':_0x152bbd[_0x2cb6('0x55')]['id']},'transaction':_0x54101e});});})[_0x2cb6('0x27')](function(){_0x50f454[_0x2cb6('0x70')](function(_0x377bfd){socket['emit'](_0x2cb6('0x71'),{'UserId':_0x377bfd['id'],'SmsQueueId':_0x5d9aa9['id']});});});});});}})['then'](respondWithStatusCode(_0x2d7e07,null))[_0x2cb6('0x48')](handleError(_0x2d7e07,null));};exports[_0x2cb6('0x72')]=function(_0x469b7b,_0x4bf5bc,_0x122b3b){return db[_0x2cb6('0x65')][_0x2cb6('0x46')]({'where':{'id':_0x469b7b[_0x2cb6('0x38')][_0x2cb6('0x66')]},'attributes':['id'],'include':[{'model':db[_0x2cb6('0x73')],'as':_0x2cb6('0x67'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4bf5bc,null))['then'](function(_0x4efd7e){var _0x2a74cb=_[_0x2cb6('0x30')](_0x4efd7e,'id');var _0x1f7832=[];var _0x435af7=[];var _0x33f60d=squel[_0x2cb6('0x74')]();_0x33f60d['field'](_0x2cb6('0x75'))[_0x2cb6('0x76')](_0x2cb6('0x77'),'tq')[_0x2cb6('0x78')](_0x2cb6('0x79'),'ut',_0x2cb6('0x7a'))[_0x2cb6('0x41')](_0x2cb6('0x7b'),_0x469b7b[_0x2cb6('0x55')]['id']);for(var _0x566a10=0x0;_0x566a10<_0x4efd7e[_0x2cb6('0x3d')];_0x566a10+=0x1){let _0x7470d1=_0x4efd7e[_0x566a10];for(var _0x86162=0x0;_0x86162<_0x7470d1[_0x2cb6('0x67')][_0x2cb6('0x3d')];_0x86162+=0x1){let _0x4d55cb=_0x7470d1[_0x2cb6('0x67')][_0x86162];var _0x35777d=_0x33f60d[_0x2cb6('0x7c')]();_0x35777d[_0x2cb6('0x41')](_0x2cb6('0x7d'),_0x4d55cb['id']);_0x435af7[_0x2cb6('0x7e')](db[_0x2cb6('0x7f')]['query'](_0x35777d[_0x2cb6('0x80')](),{'type':db[_0x2cb6('0x7f')][_0x2cb6('0x81')][_0x2cb6('0x82')]})['then'](function(_0x218764){if(_0x218764[_0x2cb6('0x3d')]===0x1){return _0x4d55cb['id'];}else{var _0x1e3673=_[_0x2cb6('0x83')](_['map'](_0x218764,_0x2cb6('0x84')),function(_0x5641f4){return _[_0x2cb6('0x85')](_0x2a74cb,_0x5641f4);});if(_0x1e3673){return _0x4d55cb['id'];}}}));}}return BPromise['all'](_0x435af7)[_0x2cb6('0x27')](function(_0x5e63b5){_0x1f7832=_(_0x1f7832)[_0x2cb6('0x86')](_0x5e63b5)[_0x2cb6('0x87')]()[_0x2cb6('0x88')]();return db['SmsQueue'][_0x2cb6('0x4c')]({'where':{'id':_0x469b7b[_0x2cb6('0x55')]['id']}})['then'](function(_0x2684a3){return db['sequelize'][_0x2cb6('0x6c')](function(_0x14582f){return _0x2684a3[_0x2cb6('0x72')](_0x469b7b['query'][_0x2cb6('0x66')],{'transaction':_0x14582f})[_0x2cb6('0x27')](function(){if(!_[_0x2cb6('0x89')](_0x1f7832)){return _0x2684a3[_0x2cb6('0x8a')](_0x1f7832,{'transaction':_0x14582f});}})[_0x2cb6('0x27')](function(){_0x1f7832[_0x2cb6('0x70')](function(_0x23cff7){socket[_0x2cb6('0x8b')]('userSmsQueue:remove',{'UserId':_0x23cff7,'SmsQueueId':_0x2684a3['id']});});});});});});})[_0x2cb6('0x27')](respondWithStatusCode(_0x4bf5bc,null))[_0x2cb6('0x48')](handleError(_0x4bf5bc,null));};exports[_0x2cb6('0x8c')]=function(_0x5c266b,_0x4d18b2,_0x4fe5f9){return db[_0x2cb6('0x31')][_0x2cb6('0x4c')]({'where':{'id':_0x5c266b[_0x2cb6('0x55')]['id']}})[_0x2cb6('0x27')](handleEntityNotFound(_0x4d18b2,null))[_0x2cb6('0x27')](function(_0x2eb20a){if(_0x2eb20a){return _0x2eb20a[_0x2cb6('0x8c')](_0x5c266b['body'][_0x2cb6('0x66')],_[_0x2cb6('0x8d')](_0x5c266b[_0x2cb6('0x54')],[_0x2cb6('0x66'),'id'])||{})['spread'](function(_0x4b4319){for(var _0xcf73b8=0x0;_0xcf73b8<_0x5c266b[_0x2cb6('0x54')][_0x2cb6('0x66')][_0x2cb6('0x3d')];_0xcf73b8+=0x1){socket[_0x2cb6('0x8b')](_0x2cb6('0x71'),{'UserId':Number(_0x5c266b[_0x2cb6('0x54')][_0x2cb6('0x66')][_0xcf73b8]),'SmsQueueId':Number(_0x5c266b[_0x2cb6('0x55')]['id'])});}return _0x4b4319;});}})[_0x2cb6('0x27')](respondWithResult(_0x4d18b2,null))[_0x2cb6('0x48')](handleError(_0x4d18b2,null));};exports[_0x2cb6('0x8a')]=function(_0x443139,_0x52c8d5,_0x3c1d91){return db[_0x2cb6('0x31')][_0x2cb6('0x4c')]({'where':{'id':_0x443139[_0x2cb6('0x55')]['id']}})[_0x2cb6('0x27')](handleEntityNotFound(_0x52c8d5,null))[_0x2cb6('0x27')](function(_0x1d511c){if(_0x1d511c){return _0x1d511c[_0x2cb6('0x8a')](_0x443139[_0x2cb6('0x38')][_0x2cb6('0x66')])[_0x2cb6('0x27')](function(){if(_[_0x2cb6('0x8e')](_0x443139[_0x2cb6('0x38')][_0x2cb6('0x66')])){for(var _0x1825fa=0x0;_0x1825fa<_0x443139[_0x2cb6('0x38')][_0x2cb6('0x66')][_0x2cb6('0x3d')];_0x1825fa+=0x1){socket[_0x2cb6('0x8b')](_0x2cb6('0x8f'),{'UserId':Number(_0x443139[_0x2cb6('0x38')]['ids'][_0x1825fa]),'SmsQueueId':Number(_0x443139[_0x2cb6('0x55')]['id'])});}}else{socket[_0x2cb6('0x8b')](_0x2cb6('0x8f'),{'UserId':Number(_0x443139[_0x2cb6('0x38')][_0x2cb6('0x66')]),'SmsQueueId':Number(_0x443139[_0x2cb6('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x52c8d5,null))['catch'](handleError(_0x52c8d5,null));};exports['getAgents']=function(_0x39f331,_0xe603af,_0x4b7908){var _0x471b6e={};var _0x4b0c27={};var _0x172c54;var _0x8de157;return db['SmsQueue'][_0x2cb6('0x58')]({'where':{'id':_0x39f331[_0x2cb6('0x55')]['id']}})[_0x2cb6('0x27')](handleEntityNotFound(_0xe603af,null))[_0x2cb6('0x27')](function(_0x5eb8de){if(_0x5eb8de){_0x172c54=_0x5eb8de;_0x4b0c27[_0x2cb6('0x36')]=_[_0x2cb6('0x37')](db[_0x2cb6('0x73')][_0x2cb6('0x32')]);_0x4b0c27[_0x2cb6('0x38')]=_[_0x2cb6('0x37')](_0x39f331['query']);_0x4b0c27[_0x2cb6('0x39')]=_[_0x2cb6('0x3a')](_0x4b0c27[_0x2cb6('0x36')],_0x4b0c27['query']);_0x471b6e[_0x2cb6('0x3b')]=_[_0x2cb6('0x3a')](_0x4b0c27['model'],qs[_0x2cb6('0x3c')](_0x39f331['query'][_0x2cb6('0x3c')]));_0x471b6e[_0x2cb6('0x3b')]=_0x471b6e[_0x2cb6('0x3b')]['length']?_0x471b6e[_0x2cb6('0x3b')]:_0x4b0c27[_0x2cb6('0x36')];_0x471b6e[_0x2cb6('0x3f')]=qs['sort'](_0x39f331[_0x2cb6('0x38')][_0x2cb6('0x40')]);_0x471b6e['where']=qs[_0x2cb6('0x39')](_[_0x2cb6('0x5a')](_0x39f331[_0x2cb6('0x38')],_0x4b0c27[_0x2cb6('0x39')]));if(_0x39f331[_0x2cb6('0x38')][_0x2cb6('0x42')]){_0x471b6e['where']=_[_0x2cb6('0x4b')](_0x471b6e[_0x2cb6('0x41')],{'$or':_[_0x2cb6('0x30')](_0x471b6e[_0x2cb6('0x3b')],function(_0x5cb297){var _0x107af5={};_0x107af5[_0x5cb297]={'$like':'%'+_0x39f331[_0x2cb6('0x38')]['filter']+'%'};return _0x107af5;})});}_0x471b6e=_[_0x2cb6('0x4b')]({},_0x471b6e,_0x39f331[_0x2cb6('0x44')]);return _0x172c54[_0x2cb6('0x90')](_0x471b6e);}})[_0x2cb6('0x27')](function(_0x592588){if(_0x592588){_0x8de157=_0x592588[_0x2cb6('0x3d')];if(!_0x39f331[_0x2cb6('0x38')][_0x2cb6('0x3e')]('nolimit')){_0x471b6e[_0x2cb6('0x21')]=qs[_0x2cb6('0x21')](_0x39f331[_0x2cb6('0x38')][_0x2cb6('0x21')]);_0x471b6e[_0x2cb6('0x1f')]=qs[_0x2cb6('0x1f')](_0x39f331[_0x2cb6('0x38')][_0x2cb6('0x1f')]);}return _0x172c54[_0x2cb6('0x90')](_0x471b6e);}})[_0x2cb6('0x27')](function(_0x2cc1a5){if(_0x2cc1a5){return _0x2cc1a5?{'count':_0x8de157,'rows':_0x2cc1a5}:null;}})[_0x2cb6('0x27')](respondWithResult(_0xe603af,null))[_0x2cb6('0x48')](handleError(_0xe603af,null));}; \ No newline at end of file +var _0xe91c=['VIRTUAL','filter','merge','includeAll','include','rows','show','params','keys','rawAttributes','intersection','length','create','role','UserProfileSection','find','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','nolimit','pick','SmsQueueId','options','UserSmsQueue','findAll','findAndCountAll','UserId','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','hasOwnProperty','addTeams','body','ids','online','voicePause','interface','findOrCreate','emit','userSmsQueue:save','removeTeams','Agents','field','tq.TeamId','from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','forEach','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','User','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','name','index','SmsQueue','fieldName','type','key','map','query','filters','model','fields','attributes','order','sort','where'];(function(_0x5ca15f,_0x19ce28){var _0x55d478=function(_0x2f3ff7){while(--_0x2f3ff7){_0x5ca15f['push'](_0x5ca15f['shift']());}};_0x55d478(++_0x19ce28);}(_0xe91c,0xe1));var _0xce91=function(_0x4d7ddc,_0x5d679e){_0x4d7ddc=_0x4d7ddc-0x0;var _0x117bf6=_0xe91c[_0x4d7ddc];return _0x117bf6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xce91('0x0'));var zipdir=require(_0xce91('0x1'));var jsonpatch=require(_0xce91('0x2'));var rp=require(_0xce91('0x3'));var moment=require(_0xce91('0x4'));var BPromise=require(_0xce91('0x5'));var Mustache=require(_0xce91('0x6'));var util=require('util');var path=require(_0xce91('0x7'));var sox=require(_0xce91('0x8'));var csv=require('to-csv');var ejs=require(_0xce91('0x9'));var fs=require('fs');var fs_extra=require(_0xce91('0xa'));var _=require(_0xce91('0xb'));var squel=require(_0xce91('0xc'));var crypto=require(_0xce91('0xd'));var jsforce=require(_0xce91('0xe'));var deskjs=require(_0xce91('0xf'));var toCsv=require(_0xce91('0x10'));var querystring=require(_0xce91('0x11'));var Papa=require(_0xce91('0x12'));var Redis=require(_0xce91('0x13'));var authService=require(_0xce91('0x14'));var qs=require(_0xce91('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xce91('0x16'));var logger=require(_0xce91('0x17'))(_0xce91('0x18'));var utils=require(_0xce91('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xce91('0x1a'));var db=require('../../mysqldb')['db'];config[_0xce91('0x1b')]=_[_0xce91('0x1c')](config[_0xce91('0x1b')],{'host':_0xce91('0x1d'),'port':0x18eb});var socket=require(_0xce91('0x1e'))(new Redis(config[_0xce91('0x1b')]));require(_0xce91('0x1f'))['register'](socket);function respondWithStatusCode(_0x342458,_0x41fadb){_0x41fadb=_0x41fadb||0xcc;return function(_0x36c75c){if(_0x36c75c){return _0x342458['sendStatus'](_0x41fadb);}return _0x342458['status'](_0x41fadb)[_0xce91('0x20')]();};}function respondWithResult(_0x308d51,_0xaa4f12){_0xaa4f12=_0xaa4f12||0xc8;return function(_0x42e898){if(_0x42e898){return _0x308d51[_0xce91('0x21')](_0xaa4f12)[_0xce91('0x22')](_0x42e898);}};}function respondWithFilteredResult(_0x53f0d7,_0x4e82a5){return function(_0x51d179){if(_0x51d179){var _0x22edd7=typeof _0x4e82a5[_0xce91('0x23')]===_0xce91('0x24')&&typeof _0x4e82a5[_0xce91('0x25')]===_0xce91('0x24');var _0x3e8355=_0x51d179[_0xce91('0x26')];var _0x2e033b=_0x22edd7?0x0:_0x4e82a5['offset'];var _0x1664d7=_0x22edd7?_0x51d179[_0xce91('0x26')]:_0x4e82a5['offset']+_0x4e82a5[_0xce91('0x25')];var _0x567f55;if(_0x1664d7>=_0x3e8355){_0x1664d7=_0x3e8355;_0x567f55=0xc8;}else{_0x567f55=0xce;}_0x53f0d7[_0xce91('0x21')](_0x567f55);return _0x53f0d7[_0xce91('0x27')](_0xce91('0x28'),_0x2e033b+'-'+_0x1664d7+'/'+_0x3e8355)[_0xce91('0x22')](_0x51d179);}return null;};}function patchUpdates(_0x580d73){return function(_0x443d29){try{jsonpatch['apply'](_0x443d29,_0x580d73,!![]);}catch(_0x122dcd){return BPromise[_0xce91('0x29')](_0x122dcd);}return _0x443d29[_0xce91('0x2a')]();};}function saveUpdates(_0x717d9b,_0x2bb7c6){return function(_0x3baaf8){if(_0x3baaf8){return _0x3baaf8[_0xce91('0x2b')](_0x717d9b)[_0xce91('0x2c')](function(_0x515f1f){return _0x515f1f;});}return null;};}function removeEntity(_0x97895d,_0x25786b){return function(_0x56b6aa){if(_0x56b6aa){return _0x56b6aa[_0xce91('0x2d')]()['then'](function(){var _0x175453=_0x56b6aa[_0xce91('0x2e')]({'plain':!![]});var _0x2242a3='SmsQueues';return db[_0xce91('0x2f')][_0xce91('0x2d')]({'where':{'type':_0x2242a3,'resourceId':_0x175453['id']}})['then'](function(){return _0x56b6aa;});})[_0xce91('0x2c')](function(){_0x97895d[_0xce91('0x21')](0xcc)[_0xce91('0x20')]();});}};}function handleEntityNotFound(_0x1a6e20,_0x55a651){return function(_0x556e09){if(!_0x556e09){_0x1a6e20[_0xce91('0x30')](0x194);}return _0x556e09;};}function handleError(_0x10c3ff,_0x245117){_0x245117=_0x245117||0x1f4;return function(_0x247bf0){logger[_0xce91('0x31')](_0x247bf0['stack']);if(_0x247bf0[_0xce91('0x32')]){delete _0x247bf0['name'];}_0x10c3ff[_0xce91('0x21')](_0x245117)['send'](_0x247bf0);};}exports[_0xce91('0x33')]=function(_0x96c972,_0x9df2a2){var _0x10775a={},_0x545a2d={},_0xfa2ccd={'count':0x0,'rows':[]};var _0x43a0b7=_['map'](db[_0xce91('0x34')]['rawAttributes'],function(_0x5980df){return{'name':_0x5980df[_0xce91('0x35')],'type':_0x5980df[_0xce91('0x36')][_0xce91('0x37')]};});_0x545a2d['model']=_[_0xce91('0x38')](_0x43a0b7,'name');_0x545a2d['query']=_['keys'](_0x96c972[_0xce91('0x39')]);_0x545a2d[_0xce91('0x3a')]=_['intersection'](_0x545a2d[_0xce91('0x3b')],_0x545a2d[_0xce91('0x39')]);_0x10775a['attributes']=_['intersection'](_0x545a2d['model'],qs[_0xce91('0x3c')](_0x96c972[_0xce91('0x39')][_0xce91('0x3c')]));_0x10775a['attributes']=_0x10775a[_0xce91('0x3d')]['length']?_0x10775a[_0xce91('0x3d')]:_0x545a2d['model'];if(!_0x96c972[_0xce91('0x39')]['hasOwnProperty']('nolimit')){_0x10775a[_0xce91('0x25')]=qs[_0xce91('0x25')](_0x96c972['query'][_0xce91('0x25')]);_0x10775a[_0xce91('0x23')]=qs[_0xce91('0x23')](_0x96c972['query']['offset']);}_0x10775a[_0xce91('0x3e')]=qs[_0xce91('0x3f')](_0x96c972[_0xce91('0x39')][_0xce91('0x3f')]);_0x10775a[_0xce91('0x40')]=qs[_0xce91('0x3a')](_['pick'](_0x96c972[_0xce91('0x39')],_0x545a2d[_0xce91('0x3a')]),_0x43a0b7);if(_0x96c972['query']['filter']){_0x10775a[_0xce91('0x40')]=_['merge'](_0x10775a[_0xce91('0x40')],{'$or':_[_0xce91('0x38')](_0x43a0b7,function(_0x676a87){if(_0x676a87[_0xce91('0x36')]!==_0xce91('0x41')){var _0x1c3b41={};_0x1c3b41[_0x676a87[_0xce91('0x32')]]={'$like':'%'+_0x96c972['query'][_0xce91('0x42')]+'%'};return _0x1c3b41;}})});}_0x10775a=_[_0xce91('0x43')]({},_0x10775a,_0x96c972['options']);var _0x259f36={'where':_0x10775a[_0xce91('0x40')]};return db['SmsQueue'][_0xce91('0x26')](_0x259f36)[_0xce91('0x2c')](function(_0x295e3a){_0xfa2ccd[_0xce91('0x26')]=_0x295e3a;if(_0x96c972[_0xce91('0x39')][_0xce91('0x44')]){_0x10775a[_0xce91('0x45')]=[{'all':!![]}];}return db[_0xce91('0x34')]['findAll'](_0x10775a);})[_0xce91('0x2c')](function(_0x116eb5){_0xfa2ccd[_0xce91('0x46')]=_0x116eb5;return _0xfa2ccd;})['then'](respondWithFilteredResult(_0x9df2a2,_0x10775a))['catch'](handleError(_0x9df2a2,null));};exports[_0xce91('0x47')]=function(_0x1e29bb,_0x353351){var _0x45758c={'raw':!![],'where':{'id':_0x1e29bb[_0xce91('0x48')]['id']}},_0x164316={};_0x164316[_0xce91('0x3b')]=_[_0xce91('0x49')](db[_0xce91('0x34')][_0xce91('0x4a')]);_0x164316[_0xce91('0x39')]=_[_0xce91('0x49')](_0x1e29bb[_0xce91('0x39')]);_0x164316['filters']=_['intersection'](_0x164316[_0xce91('0x3b')],_0x164316[_0xce91('0x39')]);_0x45758c[_0xce91('0x3d')]=_[_0xce91('0x4b')](_0x164316[_0xce91('0x3b')],qs['fields'](_0x1e29bb[_0xce91('0x39')][_0xce91('0x3c')]));_0x45758c[_0xce91('0x3d')]=_0x45758c[_0xce91('0x3d')][_0xce91('0x4c')]?_0x45758c[_0xce91('0x3d')]:_0x164316[_0xce91('0x3b')];if(_0x1e29bb[_0xce91('0x39')][_0xce91('0x44')]){_0x45758c[_0xce91('0x45')]=[{'all':!![]}];}_0x45758c=_[_0xce91('0x43')]({},_0x45758c,_0x1e29bb['options']);return db[_0xce91('0x34')]['find'](_0x45758c)['then'](handleEntityNotFound(_0x353351,null))[_0xce91('0x2c')](respondWithResult(_0x353351,null))['catch'](handleError(_0x353351,null));};exports['create']=function(_0x246f25,_0x47b52d){return db[_0xce91('0x34')][_0xce91('0x4d')](_0x246f25['body'],{})[_0xce91('0x2c')](function(_0x2f23ef){var _0x15c722=_0x246f25['user']['get']({'plain':!![]});if(!_0x15c722)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15c722[_0xce91('0x4e')]==='user'){var _0x2654bd=_0x2f23ef['get']({'plain':!![]});var _0x314f0d='SmsQueues';return db[_0xce91('0x4f')][_0xce91('0x50')]({'where':{'name':_0x314f0d,'userProfileId':_0x15c722[_0xce91('0x51')]},'raw':!![]})[_0xce91('0x2c')](function(_0x5db3f6){if(_0x5db3f6&&_0x5db3f6[_0xce91('0x52')]===0x0){return db['UserProfileResource'][_0xce91('0x4d')]({'name':_0x2654bd[_0xce91('0x32')],'resourceId':_0x2654bd['id'],'type':_0x5db3f6['name'],'sectionId':_0x5db3f6['id']},{})[_0xce91('0x2c')](function(){return _0x2f23ef;});}else{return _0x2f23ef;}})[_0xce91('0x53')](function(_0x268f14){logger[_0xce91('0x31')](_0xce91('0x54'),_0x268f14);throw _0x268f14;});}return _0x2f23ef;})[_0xce91('0x2c')](respondWithResult(_0x47b52d,0xc9))[_0xce91('0x53')](handleError(_0x47b52d,null));};exports[_0xce91('0x2b')]=function(_0x2895fb,_0x1fa559){if(_0x2895fb['body']['id']){delete _0x2895fb['body']['id'];}return db[_0xce91('0x34')][_0xce91('0x50')]({'where':{'id':_0x2895fb[_0xce91('0x48')]['id']}})[_0xce91('0x2c')](handleEntityNotFound(_0x1fa559,null))[_0xce91('0x2c')](saveUpdates(_0x2895fb['body'],null))[_0xce91('0x2c')](respondWithResult(_0x1fa559,null))[_0xce91('0x53')](handleError(_0x1fa559,null));};exports['destroy']=function(_0x12b5bf,_0x210bba){return db['SmsQueue']['find']({'where':{'id':_0x12b5bf[_0xce91('0x48')]['id']}})[_0xce91('0x2c')](handleEntityNotFound(_0x210bba,null))[_0xce91('0x2c')](removeEntity(_0x210bba,null))[_0xce91('0x53')](handleError(_0x210bba,null));};exports[_0xce91('0x55')]=function(_0x33544c,_0x358f31){return db[_0xce91('0x34')]['describe']()['then'](respondWithResult(_0x358f31,null))['catch'](handleError(_0x358f31,null));};exports[_0xce91('0x56')]=function(_0x53d615,_0x55544b,_0x14aa57){var _0x16610b={'raw':!![],'where':{}},_0x32a28f={},_0x4db164;return db['SmsQueue'][_0xce91('0x57')]({'where':{'id':_0x53d615['params']['id']}})[_0xce91('0x2c')](handleEntityNotFound(_0x55544b,null))[_0xce91('0x2c')](function(_0x44864a){if(_0x44864a){_0x4db164=_0x44864a[_0xce91('0x2e')]({'plain':!![]});_0x32a28f[_0xce91('0x3b')]=_[_0xce91('0x49')](db['UserSmsQueue'][_0xce91('0x4a')]);_0x32a28f[_0xce91('0x39')]=_[_0xce91('0x49')](_0x53d615[_0xce91('0x39')]);_0x32a28f[_0xce91('0x3a')]=_[_0xce91('0x4b')](_0x32a28f[_0xce91('0x3b')],_0x32a28f[_0xce91('0x39')]);_0x16610b[_0xce91('0x3d')]=_[_0xce91('0x4b')](_0x32a28f[_0xce91('0x3b')],qs[_0xce91('0x3c')](_0x53d615['query'][_0xce91('0x3c')]));_0x16610b[_0xce91('0x3d')]=_0x16610b[_0xce91('0x3d')][_0xce91('0x4c')]?_0x16610b[_0xce91('0x3d')]:_0x32a28f['model'];if(!_0x53d615[_0xce91('0x39')]['hasOwnProperty'](_0xce91('0x58'))){_0x16610b[_0xce91('0x25')]=qs[_0xce91('0x25')](_0x53d615[_0xce91('0x39')][_0xce91('0x25')]);_0x16610b[_0xce91('0x23')]=qs['offset'](_0x53d615[_0xce91('0x39')][_0xce91('0x23')]);}_0x16610b[_0xce91('0x3e')]=qs['sort'](_0x53d615[_0xce91('0x39')][_0xce91('0x3f')]);_0x16610b[_0xce91('0x40')]=qs['filters'](_[_0xce91('0x59')](_0x53d615[_0xce91('0x39')],_0x32a28f[_0xce91('0x3a')]));_0x16610b[_0xce91('0x40')][_0xce91('0x5a')]=_0x44864a['id'];if(_0x53d615['query'][_0xce91('0x42')]){_0x16610b[_0xce91('0x40')]=_['merge'](_0x16610b[_0xce91('0x40')],{'$or':_['map'](_0x16610b[_0xce91('0x3d')],function(_0x2222fd){var _0x2282a6={};_0x2282a6[_0x2222fd]={'$like':'%'+_0x53d615[_0xce91('0x39')]['filter']+'%'};return _0x2282a6;})});}_0x16610b=_[_0xce91('0x43')]({},_0x16610b,_0x53d615[_0xce91('0x5b')]);return db[_0xce91('0x5c')][_0xce91('0x5d')](_0x16610b);}})['then'](function(_0x3600fe){if(_0x3600fe){return db['User'][_0xce91('0x5e')]({'where':{'id':_[_0xce91('0x38')](_0x3600fe,_0xce91('0x5f')),'role':'agent'},'attributes':['id',_0xce91('0x32'),_0xce91('0x60'),_0xce91('0x61'),_0xce91('0x62')]});}})[_0xce91('0x2c')](function(_0x1c8a49){if(_0x1c8a49){return{'count':_0x1c8a49['count'],'rows':_[_0xce91('0x38')](_0x1c8a49['rows'],function(_0x2c194c){return{'membername':_0x2c194c[_0xce91('0x32')],'UserId':_0x2c194c['id'],'queue_name':_0x4db164[_0xce91('0x32')],'SmsQueueId':_0x4db164['id'],'interface':util[_0xce91('0x63')](_0xce91('0x64'),_0xce91('0x65'),_0x2c194c['name']),'penalty':0x0,'paused':_0x2c194c[_0xce91('0x60')],'createdAt':_0x2c194c[_0xce91('0x62')],'updatedAt':_0x2c194c[_0xce91('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xce91('0x2c')](respondWithFilteredResult(_0x55544b,_0x16610b))[_0xce91('0x53')](handleError(_0x55544b,null));};exports[_0xce91('0x66')]=function(_0x1392b9,_0x31e1eb,_0x5c91f9){var _0x558024={};var _0x103278={};var _0x375d59;var _0xd4b139;return db[_0xce91('0x34')][_0xce91('0x57')]({'where':{'id':_0x1392b9['params']['id']}})[_0xce91('0x2c')](handleEntityNotFound(_0x31e1eb,null))[_0xce91('0x2c')](function(_0x1130a2){if(_0x1130a2){_0x375d59=_0x1130a2;_0x103278['model']=_[_0xce91('0x49')](db[_0xce91('0x67')][_0xce91('0x4a')]);_0x103278[_0xce91('0x39')]=_[_0xce91('0x49')](_0x1392b9[_0xce91('0x39')]);_0x103278[_0xce91('0x3a')]=_['intersection'](_0x103278[_0xce91('0x3b')],_0x103278[_0xce91('0x39')]);_0x558024[_0xce91('0x3d')]=_[_0xce91('0x4b')](_0x103278[_0xce91('0x3b')],qs[_0xce91('0x3c')](_0x1392b9[_0xce91('0x39')][_0xce91('0x3c')]));_0x558024[_0xce91('0x3d')]=_0x558024[_0xce91('0x3d')][_0xce91('0x4c')]?_0x558024['attributes']:_0x103278[_0xce91('0x3b')];_0x558024[_0xce91('0x3e')]=qs[_0xce91('0x3f')](_0x1392b9['query']['sort']);_0x558024[_0xce91('0x40')]=qs[_0xce91('0x3a')](_[_0xce91('0x59')](_0x1392b9[_0xce91('0x39')],_0x103278[_0xce91('0x3a')]));if(_0x1392b9[_0xce91('0x39')][_0xce91('0x42')]){_0x558024[_0xce91('0x40')]=_[_0xce91('0x43')](_0x558024[_0xce91('0x40')],{'$or':_[_0xce91('0x38')](_0x558024[_0xce91('0x3d')],function(_0x80333f){var _0x326342={};_0x326342[_0x80333f]={'$like':'%'+_0x1392b9[_0xce91('0x39')][_0xce91('0x42')]+'%'};return _0x326342;})});}_0x558024=_[_0xce91('0x43')]({},_0x558024,_0x1392b9[_0xce91('0x5b')]);return _0x375d59[_0xce91('0x66')](_0x558024);}})[_0xce91('0x2c')](function(_0x2d612f){if(_0x2d612f){_0xd4b139=_0x2d612f[_0xce91('0x4c')];if(!_0x1392b9[_0xce91('0x39')][_0xce91('0x68')](_0xce91('0x58'))){_0x558024['limit']=qs['limit'](_0x1392b9[_0xce91('0x39')][_0xce91('0x25')]);_0x558024[_0xce91('0x23')]=qs['offset'](_0x1392b9['query'][_0xce91('0x23')]);}return _0x375d59['getTeams'](_0x558024);}})[_0xce91('0x2c')](function(_0x154052){if(_0x154052){return _0x154052?{'count':_0xd4b139,'rows':_0x154052}:null;}})['then'](respondWithResult(_0x31e1eb,null))['catch'](handleError(_0x31e1eb,null));};exports[_0xce91('0x69')]=function(_0x2318fc,_0x40c292,_0x1bc9a5){var _0x2a95d0=_0x2318fc[_0xce91('0x6a')][_0xce91('0x6b')];return db['Team'][_0xce91('0x5d')]({'where':{'id':_0x2a95d0},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0xce91('0x6c'),_0xce91('0x6d'),_0xce91('0x6e')],'raw':!![]}]})[_0xce91('0x2c')](function(_0x5ad98a){if(_0x5ad98a){var _0x685f0c=_['flatMap'](_0x5ad98a,function(_0x590f7f){var _0x2eb80a=_0x590f7f['get']({'plain':!![]});return _0x2eb80a['Agents'];});return db[_0xce91('0x34')]['find']({'where':{'id':_0x2318fc[_0xce91('0x48')]['id']}})[_0xce91('0x2c')](function(_0x2f58a8){return db['sequelize']['transaction'](function(_0x5dedee){return _0x2f58a8['addTeams'](_0x2a95d0,{'transaction':_0x5dedee})[_0xce91('0x2c')](function(){return BPromise['each'](_0x685f0c,function(_0x3dcdb7){return db[_0xce91('0x5c')][_0xce91('0x6f')]({'where':{'UserId':_0x3dcdb7['id'],'SmsQueueId':_0x2318fc[_0xce91('0x48')]['id']},'transaction':_0x5dedee});});})['then'](function(){_0x685f0c['forEach'](function(_0x4feded){socket[_0xce91('0x70')](_0xce91('0x71'),{'UserId':_0x4feded['id'],'SmsQueueId':_0x2f58a8['id']});});});});});}})['then'](respondWithStatusCode(_0x40c292,null))['catch'](handleError(_0x40c292,null));};exports[_0xce91('0x72')]=function(_0xe46345,_0x415398,_0x1f2b2e){return db[_0xce91('0x67')][_0xce91('0x5d')]({'where':{'id':_0xe46345[_0xce91('0x39')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xce91('0x73'),'attributes':['id'],'raw':!![]}]})[_0xce91('0x2c')](handleEntityNotFound(_0x415398,null))[_0xce91('0x2c')](function(_0x60367){var _0x874fdf=_[_0xce91('0x38')](_0x60367,'id');var _0xcbe511=[];var _0x2f2a72=[];var _0x4a9943=squel['select']();_0x4a9943[_0xce91('0x74')](_0xce91('0x75'))[_0xce91('0x76')](_0xce91('0x77'),'tq')['join'](_0xce91('0x78'),'ut',_0xce91('0x79'))['where'](_0xce91('0x7a'),_0xe46345[_0xce91('0x48')]['id']);for(var _0x1299b5=0x0;_0x1299b5<_0x60367[_0xce91('0x4c')];_0x1299b5+=0x1){let _0x1b7680=_0x60367[_0x1299b5];for(var _0x5daa47=0x0;_0x5daa47<_0x1b7680[_0xce91('0x73')]['length'];_0x5daa47+=0x1){let _0x5aabd6=_0x1b7680[_0xce91('0x73')][_0x5daa47];var _0x1eef8d=_0x4a9943[_0xce91('0x7b')]();_0x1eef8d[_0xce91('0x40')](_0xce91('0x7c'),_0x5aabd6['id']);_0x2f2a72[_0xce91('0x7d')](db['sequelize'][_0xce91('0x39')](_0x1eef8d[_0xce91('0x7e')](),{'type':db[_0xce91('0x7f')]['QueryTypes'][_0xce91('0x80')]})[_0xce91('0x2c')](function(_0x416643){if(_0x416643['length']===0x1){return _0x5aabd6['id'];}else{var _0x54338a=_[_0xce91('0x81')](_[_0xce91('0x38')](_0x416643,_0xce91('0x82')),function(_0x3d6191){return _[_0xce91('0x83')](_0x874fdf,_0x3d6191);});if(_0x54338a){return _0x5aabd6['id'];}}}));}}return BPromise[_0xce91('0x84')](_0x2f2a72)[_0xce91('0x2c')](function(_0x3a4254){_0xcbe511=_(_0xcbe511)['union'](_0x3a4254)[_0xce91('0x85')]()[_0xce91('0x86')]();return db[_0xce91('0x34')]['find']({'where':{'id':_0xe46345[_0xce91('0x48')]['id']}})[_0xce91('0x2c')](function(_0x373915){return db[_0xce91('0x7f')]['transaction'](function(_0x171fcc){return _0x373915[_0xce91('0x72')](_0xe46345[_0xce91('0x39')][_0xce91('0x6b')],{'transaction':_0x171fcc})[_0xce91('0x2c')](function(){if(!_[_0xce91('0x87')](_0xcbe511)){return _0x373915[_0xce91('0x88')](_0xcbe511,{'transaction':_0x171fcc});}})[_0xce91('0x2c')](function(){_0xcbe511[_0xce91('0x89')](function(_0x3bbe81){socket[_0xce91('0x70')](_0xce91('0x8a'),{'UserId':_0x3bbe81,'SmsQueueId':_0x373915['id']});});});});});});})[_0xce91('0x2c')](respondWithStatusCode(_0x415398,null))[_0xce91('0x53')](handleError(_0x415398,null));};exports['addAgents']=function(_0x502b3f,_0x1084a6,_0x29a9fb){return db[_0xce91('0x34')][_0xce91('0x50')]({'where':{'id':_0x502b3f[_0xce91('0x48')]['id']}})[_0xce91('0x2c')](handleEntityNotFound(_0x1084a6,null))[_0xce91('0x2c')](function(_0x5a47e8){if(_0x5a47e8){return _0x5a47e8[_0xce91('0x8b')](_0x502b3f[_0xce91('0x6a')]['ids'],_[_0xce91('0x8c')](_0x502b3f[_0xce91('0x6a')],[_0xce91('0x6b'),'id'])||{})[_0xce91('0x8d')](function(_0x526efb){for(var _0x5f1b9d=0x0;_0x5f1b9d<_0x502b3f[_0xce91('0x6a')]['ids'][_0xce91('0x4c')];_0x5f1b9d+=0x1){socket['emit']('userSmsQueue:save',{'UserId':Number(_0x502b3f[_0xce91('0x6a')][_0xce91('0x6b')][_0x5f1b9d]),'SmsQueueId':Number(_0x502b3f[_0xce91('0x48')]['id'])});}return _0x526efb;});}})['then'](respondWithResult(_0x1084a6,null))[_0xce91('0x53')](handleError(_0x1084a6,null));};exports['removeAgents']=function(_0x173595,_0x3ba38b,_0xf6db70){return db[_0xce91('0x34')]['find']({'where':{'id':_0x173595[_0xce91('0x48')]['id']}})['then'](handleEntityNotFound(_0x3ba38b,null))[_0xce91('0x2c')](function(_0x33bff0){if(_0x33bff0){return _0x33bff0[_0xce91('0x88')](_0x173595[_0xce91('0x39')][_0xce91('0x6b')])[_0xce91('0x2c')](function(){if(_[_0xce91('0x8e')](_0x173595[_0xce91('0x39')]['ids'])){for(var _0x363c70=0x0;_0x363c70<_0x173595[_0xce91('0x39')]['ids']['length'];_0x363c70+=0x1){socket[_0xce91('0x70')](_0xce91('0x8a'),{'UserId':Number(_0x173595[_0xce91('0x39')][_0xce91('0x6b')][_0x363c70]),'SmsQueueId':Number(_0x173595[_0xce91('0x48')]['id'])});}}else{socket[_0xce91('0x70')](_0xce91('0x8a'),{'UserId':Number(_0x173595[_0xce91('0x39')][_0xce91('0x6b')]),'SmsQueueId':Number(_0x173595[_0xce91('0x48')]['id'])});}});}})[_0xce91('0x2c')](respondWithStatusCode(_0x3ba38b,null))[_0xce91('0x53')](handleError(_0x3ba38b,null));};exports[_0xce91('0x8f')]=function(_0x3c56ab,_0x2c8b4d,_0x556a57){var _0xd99b69={};var _0x34da43={};var _0x3eac06;var _0x2bda58;return db[_0xce91('0x34')][_0xce91('0x57')]({'where':{'id':_0x3c56ab[_0xce91('0x48')]['id']}})[_0xce91('0x2c')](handleEntityNotFound(_0x2c8b4d,null))['then'](function(_0x520810){if(_0x520810){_0x3eac06=_0x520810;_0x34da43[_0xce91('0x3b')]=_[_0xce91('0x49')](db[_0xce91('0x90')][_0xce91('0x4a')]);_0x34da43['query']=_['keys'](_0x3c56ab[_0xce91('0x39')]);_0x34da43[_0xce91('0x3a')]=_['intersection'](_0x34da43[_0xce91('0x3b')],_0x34da43['query']);_0xd99b69[_0xce91('0x3d')]=_[_0xce91('0x4b')](_0x34da43[_0xce91('0x3b')],qs[_0xce91('0x3c')](_0x3c56ab[_0xce91('0x39')]['fields']));_0xd99b69['attributes']=_0xd99b69[_0xce91('0x3d')]['length']?_0xd99b69[_0xce91('0x3d')]:_0x34da43['model'];_0xd99b69['order']=qs[_0xce91('0x3f')](_0x3c56ab[_0xce91('0x39')][_0xce91('0x3f')]);_0xd99b69['where']=qs[_0xce91('0x3a')](_[_0xce91('0x59')](_0x3c56ab[_0xce91('0x39')],_0x34da43['filters']));if(_0x3c56ab[_0xce91('0x39')]['filter']){_0xd99b69[_0xce91('0x40')]=_[_0xce91('0x43')](_0xd99b69['where'],{'$or':_[_0xce91('0x38')](_0xd99b69[_0xce91('0x3d')],function(_0x4857f3){var _0x3880fa={};_0x3880fa[_0x4857f3]={'$like':'%'+_0x3c56ab[_0xce91('0x39')]['filter']+'%'};return _0x3880fa;})});}_0xd99b69=_[_0xce91('0x43')]({},_0xd99b69,_0x3c56ab['options']);return _0x3eac06[_0xce91('0x8f')](_0xd99b69);}})[_0xce91('0x2c')](function(_0x546ba3){if(_0x546ba3){_0x2bda58=_0x546ba3['length'];if(!_0x3c56ab[_0xce91('0x39')]['hasOwnProperty'](_0xce91('0x58'))){_0xd99b69[_0xce91('0x25')]=qs[_0xce91('0x25')](_0x3c56ab[_0xce91('0x39')]['limit']);_0xd99b69[_0xce91('0x23')]=qs['offset'](_0x3c56ab[_0xce91('0x39')][_0xce91('0x23')]);}return _0x3eac06[_0xce91('0x8f')](_0xd99b69);}})[_0xce91('0x2c')](function(_0x30c868){if(_0x30c868){return _0x30c868?{'count':_0x2bda58,'rows':_0x30c868}:null;}})[_0xce91('0x2c')](respondWithResult(_0x2c8b4d,null))[_0xce91('0x53')](handleError(_0x2c8b4d,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 6ced523..22a7796 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 _0xa58a=['remove','hook','exports','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa58a,0x1a3));var _0xaa58=function(_0x367e5b,_0x5721e4){_0x367e5b=_0x367e5b-0x0;var _0x4b909e=_0xa58a[_0x367e5b];return _0x4b909e;};'use strict';var EventEmitter=require('events');var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xaa58('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xaa58('0x1')};function emitEvent(_0xaa3c89){return function(_0x2d272b,_0x5655f1,_0x54754c){SmsQueueEvents['emit'](_0xaa3c89+':'+_0x2d272b['id'],_0x2d272b);SmsQueueEvents['emit'](_0xaa3c89,_0x2d272b);_0x54754c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xaa58('0x2')](e,emitEvent(event));}}module[_0xaa58('0x3')]=SmsQueueEvents; \ No newline at end of file +var _0x3ccc=['setMaxListeners','save','update','remove','emit','hook','exports','../../mysqldb','SmsQueue'];(function(_0x2e854f,_0x498724){var _0x1f383a=function(_0xe8cd9){while(--_0xe8cd9){_0x2e854f['push'](_0x2e854f['shift']());}};_0x1f383a(++_0x498724);}(_0x3ccc,0x1ae));var _0xc3cc=function(_0x552041,_0xc34ee7){_0x552041=_0x552041-0x0;var _0x198a1a=_0x3ccc[_0x552041];return _0x198a1a;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xc3cc('0x0'))['db'][_0xc3cc('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xc3cc('0x2')](0x0);var events={'afterCreate':_0xc3cc('0x3'),'afterUpdate':_0xc3cc('0x4'),'afterDestroy':_0xc3cc('0x5')};function emitEvent(_0x12782b){return function(_0x56b1aa,_0x4c12ae,_0x4f09a7){SmsQueueEvents[_0xc3cc('0x6')](_0x12782b+':'+_0x56b1aa['id'],_0x56b1aa);SmsQueueEvents[_0xc3cc('0x6')](_0x12782b,_0x56b1aa);_0x4f09a7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xc3cc('0x7')](e,emitEvent(event));}}module[_0xc3cc('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index d4854fd..16f0e70 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 _0xb149=['../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','api','moment','request-promise','rimraf'];(function(_0xb9e2bc,_0x1bb304){var _0x5cddae=function(_0x6a282e){while(--_0x6a282e){_0xb9e2bc['push'](_0xb9e2bc['shift']());}};_0x5cddae(++_0x1bb304);}(_0xb149,0x1be));var _0x9b14=function(_0x1ac9f4,_0x5b796f){_0x1ac9f4=_0x1ac9f4-0x0;var _0x502020=_0xb149[_0x1ac9f4];return _0x502020;};'use strict';var _=require(_0x9b14('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9b14('0x1'));var moment=require(_0x9b14('0x2'));var BPromise=require('bluebird');var rp=require(_0x9b14('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9b14('0x4'));var config=require(_0x9b14('0x5'));var attributes=require(_0x9b14('0x6'));module[_0x9b14('0x7')]=function(_0x3174ef,_0x204a55){return _0x3174ef[_0x9b14('0x8')](_0x9b14('0x9'),attributes,{'tableName':_0x9b14('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0251=['sms_queues','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0251,0xaa));var _0x1025=function(_0x3f8c19,_0x21b96d){_0x3f8c19=_0x3f8c19-0x0;var _0x4d7b70=_0x0251[_0x3f8c19];return _0x4d7b70;};'use strict';var _=require(_0x1025('0x0'));var util=require('util');var logger=require(_0x1025('0x1'))(_0x1025('0x2'));var moment=require('moment');var BPromise=require(_0x1025('0x3'));var rp=require(_0x1025('0x4'));var fs=require('fs');var path=require(_0x1025('0x5'));var rimraf=require(_0x1025('0x6'));var config=require(_0x1025('0x7'));var attributes=require(_0x1025('0x8'));module[_0x1025('0x9')]=function(_0x2593a9,_0x287025){return _0x2593a9[_0x1025('0xa')](_0x1025('0xb'),attributes,{'tableName':_0x1025('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index b068e46..5248bfa 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 _0x65a9=['register','request','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','GetSmsQueue','SmsQueue','findAll','raw','options','where','limit','include','map','model','attributes','then','catch','find','ShowSmsQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x65a9,0x98));var _0x965a=function(_0x377ef7,_0x4a4345){_0x377ef7=_0x377ef7-0x0;var _0x4b1ef2=_0x65a9[_0x377ef7];return _0x4b1ef2;};'use strict';var _=require(_0x965a('0x0'));var util=require('util');var moment=require(_0x965a('0x1'));var BPromise=require(_0x965a('0x2'));var rs=require(_0x965a('0x3'));var fs=require('fs');var Redis=require(_0x965a('0x4'));var db=require(_0x965a('0x5'))['db'];var utils=require(_0x965a('0x6'));var logger=require(_0x965a('0x7'))(_0x965a('0x8'));var config=require(_0x965a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x965a('0xa')]['http']({'port':0x232a});config[_0x965a('0xb')]=_[_0x965a('0xc')](config[_0x965a('0xb')],{'host':_0x965a('0xd'),'port':0x18eb});var socket=require(_0x965a('0xe'))(new Redis(config[_0x965a('0xb')]));require(_0x965a('0xf'))[_0x965a('0x10')](socket);function respondWithRpcPromise(_0x2992b2,_0x2fed25,_0x32754a){return new BPromise(function(_0x32a4cb,_0x43ed05){return client[_0x965a('0x11')](_0x2992b2,_0x32754a)['then'](function(_0x89424d){logger['info'](_0x965a('0x12'),_0x2fed25,_0x965a('0x13'));logger[_0x965a('0x14')](_0x965a('0x15'),_0x2fed25,_0x965a('0x13'),JSON[_0x965a('0x16')](_0x89424d));if(_0x89424d[_0x965a('0x17')]){if(_0x89424d[_0x965a('0x17')][_0x965a('0x18')]===0x1f4){logger[_0x965a('0x17')](_0x965a('0x12'),_0x2fed25,_0x89424d[_0x965a('0x17')][_0x965a('0x19')]);return _0x43ed05(_0x89424d[_0x965a('0x17')][_0x965a('0x19')]);}logger['error'](_0x965a('0x12'),_0x2fed25,_0x89424d[_0x965a('0x17')][_0x965a('0x19')]);return _0x32a4cb(_0x89424d[_0x965a('0x17')]['message']);}else{logger[_0x965a('0x1a')](_0x965a('0x12'),_0x2fed25,_0x965a('0x13'));_0x32a4cb(_0x89424d['result']['message']);}})['catch'](function(_0x440ed4){logger[_0x965a('0x17')](_0x965a('0x12'),_0x2fed25,_0x440ed4);_0x43ed05(_0x440ed4);});});}exports[_0x965a('0x1b')]=function(_0x48316e){var _0x13367c=this;return new Promise(function(_0x555964,_0x40ec74){return db[_0x965a('0x1c')][_0x965a('0x1d')]({'raw':_0x48316e['options']?_0x48316e['options'][_0x965a('0x1e')]===undefined?!![]:![]:!![],'where':_0x48316e[_0x965a('0x1f')]?_0x48316e[_0x965a('0x1f')][_0x965a('0x20')]||null:null,'attributes':_0x48316e['options']?_0x48316e['options']['attributes']||null:null,'limit':_0x48316e[_0x965a('0x1f')]?_0x48316e['options'][_0x965a('0x21')]||null:null,'include':_0x48316e['options']?_0x48316e[_0x965a('0x1f')][_0x965a('0x22')]?_[_0x965a('0x23')](_0x48316e[_0x965a('0x1f')][_0x965a('0x22')],function(_0x4178ee){return{'model':db[_0x4178ee[_0x965a('0x24')]],'as':_0x4178ee['as'],'attributes':_0x4178ee['attributes'],'include':_0x4178ee[_0x965a('0x22')]?_[_0x965a('0x23')](_0x4178ee[_0x965a('0x22')],function(_0x456f41){return{'model':db[_0x456f41['model']],'as':_0x456f41['as'],'attributes':_0x456f41[_0x965a('0x25')],'include':_0x456f41[_0x965a('0x22')]?_['map'](_0x456f41['include'],function(_0x53262a){return{'model':db[_0x53262a[_0x965a('0x24')]],'as':_0x53262a['as'],'attributes':_0x53262a[_0x965a('0x25')]};}):[]};}):[]};}):[]:[]})[_0x965a('0x26')](function(_0x46ad74){logger['info'](_0x965a('0x1b'),_0x48316e);logger[_0x965a('0x14')](_0x965a('0x1b'),_0x48316e,JSON[_0x965a('0x16')](_0x46ad74));_0x555964(_0x46ad74);})[_0x965a('0x27')](function(_0x53b17a){logger[_0x965a('0x17')](_0x965a('0x1b'),_0x53b17a[_0x965a('0x19')],_0x48316e);_0x40ec74(_0x13367c['error'](0x1f4,_0x53b17a['message']));});});};exports['ShowSmsQueue']=function(_0x1ba63e){var _0x6280cf=this;return new Promise(function(_0x5820dd,_0x12d657){return db['SmsQueue'][_0x965a('0x28')]({'raw':_0x1ba63e[_0x965a('0x1f')]?_0x1ba63e[_0x965a('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x1ba63e[_0x965a('0x1f')]?_0x1ba63e[_0x965a('0x1f')][_0x965a('0x20')]||null:null,'attributes':_0x1ba63e['options']?_0x1ba63e[_0x965a('0x1f')][_0x965a('0x25')]||null:null,'include':_0x1ba63e[_0x965a('0x1f')]?_0x1ba63e[_0x965a('0x1f')][_0x965a('0x22')]?_['map'](_0x1ba63e[_0x965a('0x1f')][_0x965a('0x22')],function(_0x5db29a){return{'model':db[_0x5db29a[_0x965a('0x24')]],'as':_0x5db29a['as'],'attributes':_0x5db29a[_0x965a('0x25')],'include':_0x5db29a['include']?_[_0x965a('0x23')](_0x5db29a[_0x965a('0x22')],function(_0x31c511){return{'model':db[_0x31c511[_0x965a('0x24')]],'as':_0x31c511['as'],'attributes':_0x31c511[_0x965a('0x25')],'include':_0x31c511[_0x965a('0x22')]?_[_0x965a('0x23')](_0x31c511[_0x965a('0x22')],function(_0xd3140a){return{'model':db[_0xd3140a[_0x965a('0x24')]],'as':_0xd3140a['as'],'attributes':_0xd3140a[_0x965a('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1705d2){logger[_0x965a('0x1a')]('ShowSmsQueue',_0x1ba63e);logger[_0x965a('0x14')](_0x965a('0x29'),_0x1ba63e,JSON[_0x965a('0x16')](_0x1705d2));_0x5820dd(_0x1705d2);})[_0x965a('0x27')](function(_0x559c2d){logger['error'](_0x965a('0x29'),_0x559c2d[_0x965a('0x19')],_0x1ba63e);_0x12d657(_0x6280cf[_0x965a('0x17')](0x1f4,_0x559c2d[_0x965a('0x19')]));});});}; \ No newline at end of file +var _0xcbd3=['SmsQueue,\x20%s,\x20%s,\x20%s','error','SmsQueue,\x20%s,\x20%s','message','request\x20sent','catch','GetSmsQueue','SmsQueue','options','raw','where','attributes','limit','include','model','stringify','ShowSmsQueue','find','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','request','then','info','debug'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xcbd3,0x124));var _0x3cbd=function(_0x1de0cc,_0xcf125){_0x1de0cc=_0x1de0cc-0x0;var _0x1e19ae=_0xcbd3[_0x1de0cc];return _0x1e19ae;};'use strict';var _=require(_0x3cbd('0x0'));var util=require(_0x3cbd('0x1'));var moment=require(_0x3cbd('0x2'));var BPromise=require(_0x3cbd('0x3'));var rs=require(_0x3cbd('0x4'));var fs=require('fs');var Redis=require(_0x3cbd('0x5'));var db=require(_0x3cbd('0x6'))['db'];var utils=require(_0x3cbd('0x7'));var logger=require(_0x3cbd('0x8'))('rpc');var config=require(_0x3cbd('0x9'));var jayson=require(_0x3cbd('0xa'));var client=jayson[_0x3cbd('0xb')]['http']({'port':0x232a});config[_0x3cbd('0xc')]=_[_0x3cbd('0xd')](config[_0x3cbd('0xc')],{'host':_0x3cbd('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3cbd('0xc')]));require('./smsQueue.socket')[_0x3cbd('0xf')](socket);function respondWithRpcPromise(_0x43859e,_0x302d65,_0x245077){return new BPromise(function(_0x2b1ee2,_0x51216b){return client[_0x3cbd('0x10')](_0x43859e,_0x245077)[_0x3cbd('0x11')](function(_0x344d26){logger[_0x3cbd('0x12')]('SmsQueue,\x20%s,\x20%s',_0x302d65,'request\x20sent');logger[_0x3cbd('0x13')](_0x3cbd('0x14'),_0x302d65,'request\x20sent',JSON['stringify'](_0x344d26));if(_0x344d26[_0x3cbd('0x15')]){if(_0x344d26[_0x3cbd('0x15')]['code']===0x1f4){logger['error'](_0x3cbd('0x16'),_0x302d65,_0x344d26[_0x3cbd('0x15')][_0x3cbd('0x17')]);return _0x51216b(_0x344d26[_0x3cbd('0x15')][_0x3cbd('0x17')]);}logger['error'](_0x3cbd('0x16'),_0x302d65,_0x344d26[_0x3cbd('0x15')][_0x3cbd('0x17')]);return _0x2b1ee2(_0x344d26['error']['message']);}else{logger[_0x3cbd('0x12')](_0x3cbd('0x16'),_0x302d65,_0x3cbd('0x18'));_0x2b1ee2(_0x344d26['result'][_0x3cbd('0x17')]);}})[_0x3cbd('0x19')](function(_0xcedd2e){logger[_0x3cbd('0x15')](_0x3cbd('0x16'),_0x302d65,_0xcedd2e);_0x51216b(_0xcedd2e);});});}exports[_0x3cbd('0x1a')]=function(_0x566e70){var _0x57276f=this;return new Promise(function(_0x46c534,_0x3969e3){return db[_0x3cbd('0x1b')]['findAll']({'raw':_0x566e70[_0x3cbd('0x1c')]?_0x566e70[_0x3cbd('0x1c')][_0x3cbd('0x1d')]===undefined?!![]:![]:!![],'where':_0x566e70['options']?_0x566e70[_0x3cbd('0x1c')][_0x3cbd('0x1e')]||null:null,'attributes':_0x566e70[_0x3cbd('0x1c')]?_0x566e70[_0x3cbd('0x1c')][_0x3cbd('0x1f')]||null:null,'limit':_0x566e70[_0x3cbd('0x1c')]?_0x566e70[_0x3cbd('0x1c')][_0x3cbd('0x20')]||null:null,'include':_0x566e70[_0x3cbd('0x1c')]?_0x566e70['options']['include']?_['map'](_0x566e70[_0x3cbd('0x1c')][_0x3cbd('0x21')],function(_0x2ba9b1){return{'model':db[_0x2ba9b1[_0x3cbd('0x22')]],'as':_0x2ba9b1['as'],'attributes':_0x2ba9b1[_0x3cbd('0x1f')],'include':_0x2ba9b1[_0x3cbd('0x21')]?_['map'](_0x2ba9b1[_0x3cbd('0x21')],function(_0x5d9b2c){return{'model':db[_0x5d9b2c['model']],'as':_0x5d9b2c['as'],'attributes':_0x5d9b2c['attributes'],'include':_0x5d9b2c[_0x3cbd('0x21')]?_['map'](_0x5d9b2c[_0x3cbd('0x21')],function(_0x1da1ed){return{'model':db[_0x1da1ed['model']],'as':_0x1da1ed['as'],'attributes':_0x1da1ed[_0x3cbd('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3cbd('0x11')](function(_0x2d0509){logger[_0x3cbd('0x12')](_0x3cbd('0x1a'),_0x566e70);logger[_0x3cbd('0x13')](_0x3cbd('0x1a'),_0x566e70,JSON[_0x3cbd('0x23')](_0x2d0509));_0x46c534(_0x2d0509);})[_0x3cbd('0x19')](function(_0x4493ce){logger[_0x3cbd('0x15')](_0x3cbd('0x1a'),_0x4493ce[_0x3cbd('0x17')],_0x566e70);_0x3969e3(_0x57276f[_0x3cbd('0x15')](0x1f4,_0x4493ce[_0x3cbd('0x17')]));});});};exports[_0x3cbd('0x24')]=function(_0x1509ae){var _0x305e2f=this;return new Promise(function(_0x45edac,_0x19866f){return db[_0x3cbd('0x1b')][_0x3cbd('0x25')]({'raw':_0x1509ae[_0x3cbd('0x1c')]?_0x1509ae['options'][_0x3cbd('0x1d')]===undefined?!![]:![]:!![],'where':_0x1509ae[_0x3cbd('0x1c')]?_0x1509ae['options']['where']||null:null,'attributes':_0x1509ae[_0x3cbd('0x1c')]?_0x1509ae[_0x3cbd('0x1c')][_0x3cbd('0x1f')]||null:null,'include':_0x1509ae[_0x3cbd('0x1c')]?_0x1509ae[_0x3cbd('0x1c')][_0x3cbd('0x21')]?_[_0x3cbd('0x26')](_0x1509ae['options'][_0x3cbd('0x21')],function(_0x2cea80){return{'model':db[_0x2cea80[_0x3cbd('0x22')]],'as':_0x2cea80['as'],'attributes':_0x2cea80['attributes'],'include':_0x2cea80[_0x3cbd('0x21')]?_[_0x3cbd('0x26')](_0x2cea80[_0x3cbd('0x21')],function(_0x3624ee){return{'model':db[_0x3624ee[_0x3cbd('0x22')]],'as':_0x3624ee['as'],'attributes':_0x3624ee[_0x3cbd('0x1f')],'include':_0x3624ee['include']?_[_0x3cbd('0x26')](_0x3624ee[_0x3cbd('0x21')],function(_0x19be36){return{'model':db[_0x19be36['model']],'as':_0x19be36['as'],'attributes':_0x19be36[_0x3cbd('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3cbd('0x11')](function(_0x421550){logger['info'](_0x3cbd('0x24'),_0x1509ae);logger[_0x3cbd('0x13')]('ShowSmsQueue',_0x1509ae,JSON[_0x3cbd('0x23')](_0x421550));_0x45edac(_0x421550);})[_0x3cbd('0x19')](function(_0x5cbf83){logger[_0x3cbd('0x15')]('ShowSmsQueue',_0x5cbf83[_0x3cbd('0x17')],_0x1509ae);_0x19866f(_0x305e2f[_0x3cbd('0x15')](0x1f4,_0x5cbf83[_0x3cbd('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 5ec8621..8644f04 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 _0x196f=['smsQueue:','./smsQueue.events','save','remove','update','emit','length'];(function(_0x205b46,_0x3ca65b){var _0x2b6ae8=function(_0x1f4ae9){while(--_0x1f4ae9){_0x205b46['push'](_0x205b46['shift']());}};_0x2b6ae8(++_0x3ca65b);}(_0x196f,0x86));var _0xf196=function(_0x175c33,_0x294e11){_0x175c33=_0x175c33-0x0;var _0x472e97=_0x196f[_0x175c33];return _0x472e97;};'use strict';var SmsQueueEvents=require(_0xf196('0x0'));var events=[_0xf196('0x1'),_0xf196('0x2'),_0xf196('0x3')];function createListener(_0x3339b7,_0xd0b263){return function(_0x5a0305){_0xd0b263[_0xf196('0x4')](_0x3339b7,_0x5a0305);};}function removeListener(_0x2acaa9,_0x12847c){return function(){SmsQueueEvents['removeListener'](_0x2acaa9,_0x12847c);};}exports['register']=function(_0x2461bd){for(var _0x3bc76a=0x0,_0x3a9440=events[_0xf196('0x5')];_0x3bc76a<_0x3a9440;_0x3bc76a++){var _0x336754=events[_0x3bc76a];var _0x1c357d=createListener(_0xf196('0x6')+_0x336754,_0x2461bd);SmsQueueEvents['on'](_0x336754,_0x1c357d);}}; \ No newline at end of file +var _0xc612=['smsQueue:','save','remove','emit','removeListener','register','length'];(function(_0x5412e4,_0x1a2e3a){var _0xd27c2a=function(_0x322340){while(--_0x322340){_0x5412e4['push'](_0x5412e4['shift']());}};_0xd27c2a(++_0x1a2e3a);}(_0xc612,0x166));var _0x2c61=function(_0x31760f,_0xacc31a){_0x31760f=_0x31760f-0x0;var _0xfca380=_0xc612[_0x31760f];return _0xfca380;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x2c61('0x0'),_0x2c61('0x1'),'update'];function createListener(_0x1ad2fd,_0x2ce081){return function(_0x39e077){_0x2ce081[_0x2c61('0x2')](_0x1ad2fd,_0x39e077);};}function removeListener(_0x42450c,_0x483db8){return function(){SmsQueueEvents[_0x2c61('0x3')](_0x42450c,_0x483db8);};}exports[_0x2c61('0x4')]=function(_0x102f07){for(var _0x1c660a=0x0,_0x390422=events[_0x2c61('0x5')];_0x1c660a<_0x390422;_0x1c660a++){var _0x17e989=events[_0x1c660a];var _0x50d2c7=createListener(_0x2c61('0x6')+_0x17e989,_0x102f07);SmsQueueEvents['on'](_0x17e989,_0x50d2c7);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 37102b9..28346c1 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 _0x890b=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer'];(function(_0x1440d7,_0x30f2af){var _0x44a24e=function(_0x13dbaa){while(--_0x13dbaa){_0x1440d7['push'](_0x1440d7['shift']());}};_0x44a24e(++_0x30f2af);}(_0x890b,0x168));var _0xb890=function(_0x552ab8,_0x24de58){_0x552ab8=_0x552ab8-0x0;var _0x1884a2=_0x890b[_0x552ab8];return _0x1884a2;};'use strict';var multer=require(_0xb890('0x0'));var util=require('util');var path=require(_0xb890('0x1'));var timeout=require(_0xb890('0x2'));var express=require(_0xb890('0x3'));var router=express[_0xb890('0x4')]();var fs_extra=require(_0xb890('0x5'));var auth=require(_0xb890('0x6'));var interaction=require(_0xb890('0x7'));var config=require('../../config/environment');var controller=require('./smsQueueReport.controller');router[_0xb890('0x8')]('/',auth['isAuthenticated'](),controller[_0xb890('0x9')]);router[_0xb890('0x8')](_0xb890('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xb890('0x8')](_0xb890('0xb'),auth[_0xb890('0xc')](),controller[_0xb890('0xd')]);router['post']('/',auth[_0xb890('0xc')](),controller['create']);router[_0xb890('0xe')](_0xb890('0xb'),auth[_0xb890('0xc')](),controller[_0xb890('0xf')]);router[_0xb890('0x10')](_0xb890('0xb'),auth[_0xb890('0xc')](),controller[_0xb890('0x11')]);module[_0xb890('0x12')]=router; \ No newline at end of file +var _0xbb6b=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','create','put','update','delete','destroy'];(function(_0x1107cc,_0x2dbdc2){var _0x4a50ca=function(_0x34cf75){while(--_0x34cf75){_0x1107cc['push'](_0x1107cc['shift']());}};_0x4a50ca(++_0x2dbdc2);}(_0xbb6b,0xa9));var _0xbbb6=function(_0x2e48d1,_0x9d6d72){_0x2e48d1=_0x2e48d1-0x0;var _0x20c03a=_0xbb6b[_0x2e48d1];return _0x20c03a;};'use strict';var multer=require(_0xbbb6('0x0'));var util=require(_0xbbb6('0x1'));var path=require(_0xbbb6('0x2'));var timeout=require(_0xbbb6('0x3'));var express=require(_0xbbb6('0x4'));var router=express['Router']();var fs_extra=require(_0xbbb6('0x5'));var auth=require(_0xbbb6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbbb6('0x7'));var controller=require(_0xbbb6('0x8'));router[_0xbbb6('0x9')]('/',auth[_0xbbb6('0xa')](),controller[_0xbbb6('0xb')]);router[_0xbbb6('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xbbb6('0xc')]);router[_0xbbb6('0x9')](_0xbbb6('0xd'),auth[_0xbbb6('0xa')](),controller[_0xbbb6('0xe')]);router['post']('/',auth[_0xbbb6('0xa')](),controller[_0xbbb6('0xf')]);router[_0xbbb6('0x10')](_0xbbb6('0xd'),auth[_0xbbb6('0xa')](),controller[_0xbbb6('0x11')]);router[_0xbbb6('0x12')](_0xbbb6('0xd'),auth['isAuthenticated'](),controller[_0xbbb6('0x13')]);module[_0xbbb6('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 7e75b2f..057dc52 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 _0xc4e5=['DATE','sequelize','STRING'];(function(_0x467408,_0x3b1c2f){var _0x3e77d9=function(_0x4cb118){while(--_0x4cb118){_0x467408['push'](_0x467408['shift']());}};_0x3e77d9(++_0x3b1c2f);}(_0xc4e5,0x12a));var _0x5c4e=function(_0x215e65,_0x183f97){_0x215e65=_0x215e65-0x0;var _0xa85842=_0xc4e5[_0x215e65];return _0xa85842;};'use strict';var moment=require('moment');var Sequelize=require(_0x5c4e('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x5c4e('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x5c4e('0x1')]},'joinAt':{'type':Sequelize[_0x5c4e('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x5c4e('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9cfc=['STRING','DATE','moment','sequelize','exports'];(function(_0xc68cef,_0x2773fe){var _0x33783e=function(_0x517d7c){while(--_0x517d7c){_0xc68cef['push'](_0xc68cef['shift']());}};_0x33783e(++_0x2773fe);}(_0x9cfc,0x1b0));var _0xc9cf=function(_0x41835c,_0x138035){_0x41835c=_0x41835c-0x0;var _0x4b0168=_0x9cfc[_0x41835c];return _0x4b0168;};'use strict';var moment=require(_0xc9cf('0x0'));var Sequelize=require(_0xc9cf('0x1'));module[_0xc9cf('0x2')]={'uniqueid':{'type':Sequelize[_0xc9cf('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xc9cf('0x4')]},'leaveAt':{'type':Sequelize[_0xc9cf('0x4')]},'acceptAt':{'type':Sequelize[_0xc9cf('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 30aebc1..7f638fa 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 _0xa6fc=['fast-json-patch','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','end','status','offset','undefined','count','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','index','SmsQueueReport','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','findAll','rows','params','rawAttributes','includeAll','include','find','create','catch','update','body','destroy','rimraf','zip-dir'];(function(_0x282ed6,_0x1244f6){var _0x1f85ca=function(_0x2083b6){while(--_0x2083b6){_0x282ed6['push'](_0x282ed6['shift']());}};_0x1f85ca(++_0x1244f6);}(_0xa6fc,0xd3));var _0xca6f=function(_0x5e2a60,_0x407edf){_0x5e2a60=_0x5e2a60-0x0;var _0x121e8e=_0xa6fc[_0x5e2a60];return _0x121e8e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca6f('0x0'));var zipdir=require(_0xca6f('0x1'));var jsonpatch=require(_0xca6f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xca6f('0x3'));var path=require('path');var sox=require(_0xca6f('0x4'));var csv=require(_0xca6f('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca6f('0x6'));var _=require('lodash');var squel=require(_0xca6f('0x7'));var crypto=require(_0xca6f('0x8'));var jsforce=require(_0xca6f('0x9'));var deskjs=require(_0xca6f('0xa'));var toCsv=require(_0xca6f('0x5'));var querystring=require('querystring');var Papa=require(_0xca6f('0xb'));var Redis=require(_0xca6f('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xca6f('0xd'));var hardwareService=require(_0xca6f('0xe'));var logger=require(_0xca6f('0xf'))('api');var utils=require(_0xca6f('0x10'));var config=require(_0xca6f('0x11'));var licenseUtil=require(_0xca6f('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d9a8f,_0x52ed6a){_0x52ed6a=_0x52ed6a||0xcc;return function(_0x403090){if(_0x403090){return _0x3d9a8f['sendStatus'](_0x52ed6a);}return _0x3d9a8f['status'](_0x52ed6a)[_0xca6f('0x13')]();};}function respondWithResult(_0x1aed94,_0x108321){_0x108321=_0x108321||0xc8;return function(_0x179b15){if(_0x179b15){return _0x1aed94[_0xca6f('0x14')](_0x108321)['json'](_0x179b15);}};}function respondWithFilteredResult(_0x5b575d,_0x41139b){return function(_0x4f2d50){if(_0x4f2d50){var _0x5d3afe=typeof _0x41139b[_0xca6f('0x15')]===_0xca6f('0x16')&&typeof _0x41139b['limit']===_0xca6f('0x16');var _0x562cd4=_0x4f2d50[_0xca6f('0x17')];var _0x1b96c7=_0x5d3afe?0x0:_0x41139b[_0xca6f('0x15')];var _0x2e95ff=_0x5d3afe?_0x4f2d50['count']:_0x41139b['offset']+_0x41139b['limit'];var _0xe0d182;if(_0x2e95ff>=_0x562cd4){_0x2e95ff=_0x562cd4;_0xe0d182=0xc8;}else{_0xe0d182=0xce;}_0x5b575d['status'](_0xe0d182);return _0x5b575d[_0xca6f('0x18')](_0xca6f('0x19'),_0x1b96c7+'-'+_0x2e95ff+'/'+_0x562cd4)['json'](_0x4f2d50);}return null;};}function patchUpdates(_0x5d5265){return function(_0x5d01b4){try{jsonpatch[_0xca6f('0x1a')](_0x5d01b4,_0x5d5265,!![]);}catch(_0x2d7238){return BPromise[_0xca6f('0x1b')](_0x2d7238);}return _0x5d01b4[_0xca6f('0x1c')]();};}function saveUpdates(_0x217a5d,_0x25006f){return function(_0x407d4c){if(_0x407d4c){return _0x407d4c['update'](_0x217a5d)[_0xca6f('0x1d')](function(_0x128606){return _0x128606;});}return null;};}function removeEntity(_0x4e4d7f,_0x17d9ea){return function(_0x20ee88){if(_0x20ee88){return _0x20ee88['destroy']()[_0xca6f('0x1d')](function(){_0x4e4d7f['status'](0xcc)[_0xca6f('0x13')]();});}};}function handleEntityNotFound(_0x18d3cc,_0x1a583d){return function(_0x13219f){if(!_0x13219f){_0x18d3cc[_0xca6f('0x1e')](0x194);}return _0x13219f;};}function handleError(_0x48e07c,_0x55df2a){_0x55df2a=_0x55df2a||0x1f4;return function(_0x43b11e){logger[_0xca6f('0x1f')](_0x43b11e[_0xca6f('0x20')]);if(_0x43b11e[_0xca6f('0x21')]){delete _0x43b11e[_0xca6f('0x21')];}_0x48e07c[_0xca6f('0x14')](_0x55df2a)[_0xca6f('0x22')](_0x43b11e);};}exports[_0xca6f('0x23')]=function(_0xbd3d03,_0x334a1c){var _0x16ccdb={},_0x1ad6ec={},_0x2a3125={'count':0x0,'rows':[]};var _0x3264ab=_['map'](db[_0xca6f('0x24')]['rawAttributes'],function(_0x13bb9d){return{'name':_0x13bb9d[_0xca6f('0x25')],'type':_0x13bb9d[_0xca6f('0x26')][_0xca6f('0x27')]};});_0x1ad6ec[_0xca6f('0x28')]=_[_0xca6f('0x29')](_0x3264ab,_0xca6f('0x21'));_0x1ad6ec['query']=_[_0xca6f('0x2a')](_0xbd3d03[_0xca6f('0x2b')]);_0x1ad6ec['filters']=_[_0xca6f('0x2c')](_0x1ad6ec[_0xca6f('0x28')],_0x1ad6ec['query']);_0x16ccdb[_0xca6f('0x2d')]=_[_0xca6f('0x2c')](_0x1ad6ec[_0xca6f('0x28')],qs[_0xca6f('0x2e')](_0xbd3d03[_0xca6f('0x2b')]['fields']));_0x16ccdb[_0xca6f('0x2d')]=_0x16ccdb[_0xca6f('0x2d')][_0xca6f('0x2f')]?_0x16ccdb[_0xca6f('0x2d')]:_0x1ad6ec[_0xca6f('0x28')];if(!_0xbd3d03[_0xca6f('0x2b')][_0xca6f('0x30')](_0xca6f('0x31'))){_0x16ccdb[_0xca6f('0x32')]=qs[_0xca6f('0x32')](_0xbd3d03[_0xca6f('0x2b')][_0xca6f('0x32')]);_0x16ccdb[_0xca6f('0x15')]=qs[_0xca6f('0x15')](_0xbd3d03['query']['offset']);}_0x16ccdb[_0xca6f('0x33')]=qs['sort'](_0xbd3d03[_0xca6f('0x2b')][_0xca6f('0x34')]);_0x16ccdb['where']=qs['filters'](_[_0xca6f('0x35')](_0xbd3d03[_0xca6f('0x2b')],_0x1ad6ec['filters']),_0x3264ab);if(_0xbd3d03[_0xca6f('0x2b')][_0xca6f('0x36')]){_0x16ccdb[_0xca6f('0x37')]=_[_0xca6f('0x38')](_0x16ccdb[_0xca6f('0x37')],{'$or':_['map'](_0x3264ab,function(_0x37513b){if(_0x37513b['type']!==_0xca6f('0x39')){var _0x280f09={};_0x280f09[_0x37513b[_0xca6f('0x21')]]={'$like':'%'+_0xbd3d03[_0xca6f('0x2b')]['filter']+'%'};return _0x280f09;}})});}_0x16ccdb=_['merge']({},_0x16ccdb,_0xbd3d03[_0xca6f('0x3a')]);var _0x5628f3={'where':_0x16ccdb[_0xca6f('0x37')]};return db[_0xca6f('0x24')][_0xca6f('0x17')](_0x5628f3)[_0xca6f('0x1d')](function(_0x4eb0fc){_0x2a3125['count']=_0x4eb0fc;if(_0xbd3d03[_0xca6f('0x2b')]['includeAll']){_0x16ccdb['include']=[{'all':!![]}];}return db[_0xca6f('0x24')][_0xca6f('0x3b')](_0x16ccdb);})[_0xca6f('0x1d')](function(_0x38611f){_0x2a3125[_0xca6f('0x3c')]=_0x38611f;return _0x2a3125;})[_0xca6f('0x1d')](respondWithFilteredResult(_0x334a1c,_0x16ccdb))['catch'](handleError(_0x334a1c,null));};exports['show']=function(_0x39ddc2,_0x12c91b){var _0x232e61={'raw':!![],'where':{'id':_0x39ddc2[_0xca6f('0x3d')]['id']}},_0x369e23={};_0x369e23[_0xca6f('0x28')]=_[_0xca6f('0x2a')](db[_0xca6f('0x24')][_0xca6f('0x3e')]);_0x369e23['query']=_[_0xca6f('0x2a')](_0x39ddc2[_0xca6f('0x2b')]);_0x369e23['filters']=_[_0xca6f('0x2c')](_0x369e23[_0xca6f('0x28')],_0x369e23['query']);_0x232e61[_0xca6f('0x2d')]=_['intersection'](_0x369e23[_0xca6f('0x28')],qs[_0xca6f('0x2e')](_0x39ddc2[_0xca6f('0x2b')][_0xca6f('0x2e')]));_0x232e61[_0xca6f('0x2d')]=_0x232e61[_0xca6f('0x2d')][_0xca6f('0x2f')]?_0x232e61[_0xca6f('0x2d')]:_0x369e23[_0xca6f('0x28')];if(_0x39ddc2[_0xca6f('0x2b')][_0xca6f('0x3f')]){_0x232e61[_0xca6f('0x40')]=[{'all':!![]}];}_0x232e61=_[_0xca6f('0x38')]({},_0x232e61,_0x39ddc2[_0xca6f('0x3a')]);return db[_0xca6f('0x24')][_0xca6f('0x41')](_0x232e61)[_0xca6f('0x1d')](handleEntityNotFound(_0x12c91b,null))['then'](respondWithResult(_0x12c91b,null))['catch'](handleError(_0x12c91b,null));};exports['create']=function(_0x30df28,_0x3930f7){return db[_0xca6f('0x24')][_0xca6f('0x42')](_0x30df28['body'],{})[_0xca6f('0x1d')](respondWithResult(_0x3930f7,0xc9))[_0xca6f('0x43')](handleError(_0x3930f7,null));};exports[_0xca6f('0x44')]=function(_0x4df15c,_0x444a54){if(_0x4df15c[_0xca6f('0x45')]['id']){delete _0x4df15c[_0xca6f('0x45')]['id'];}return db[_0xca6f('0x24')]['find']({'where':{'id':_0x4df15c[_0xca6f('0x3d')]['id']}})[_0xca6f('0x1d')](handleEntityNotFound(_0x444a54,null))[_0xca6f('0x1d')](saveUpdates(_0x4df15c['body'],null))[_0xca6f('0x1d')](respondWithResult(_0x444a54,null))[_0xca6f('0x43')](handleError(_0x444a54,null));};exports[_0xca6f('0x46')]=function(_0xa6c137,_0xb98a94){return db['SmsQueueReport'][_0xca6f('0x41')]({'where':{'id':_0xa6c137[_0xca6f('0x3d')]['id']}})[_0xca6f('0x1d')](handleEntityNotFound(_0xb98a94,null))[_0xca6f('0x1d')](removeEntity(_0xb98a94,null))[_0xca6f('0x43')](handleError(_0xb98a94,null));};exports['describe']=function(_0x4db35c,_0x1f91d8){return db[_0xca6f('0x24')]['describe']()[_0xca6f('0x1d')](respondWithResult(_0x1f91d8,null))[_0xca6f('0x43')](handleError(_0x1f91d8,null));}; \ No newline at end of file +var _0x828c=['nolimit','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','intersection','create','body','destroy','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','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','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','update','then','end','stack','name','send','index','map','SmsQueueReport','fieldName','type','key','model','query','keys','attributes','fields','length','hasOwnProperty'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x828c,0xf6));var _0xc828=function(_0x24431a,_0x52459a){_0x24431a=_0x24431a-0x0;var _0x454ec7=_0x828c[_0x24431a];return _0x454ec7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc828('0x0'));var zipdir=require(_0xc828('0x1'));var jsonpatch=require(_0xc828('0x2'));var rp=require(_0xc828('0x3'));var moment=require(_0xc828('0x4'));var BPromise=require(_0xc828('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc828('0x6'));var sox=require(_0xc828('0x7'));var csv=require('to-csv');var ejs=require(_0xc828('0x8'));var fs=require('fs');var fs_extra=require(_0xc828('0x9'));var _=require('lodash');var squel=require(_0xc828('0xa'));var crypto=require('crypto');var jsforce=require(_0xc828('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc828('0xc'));var Papa=require(_0xc828('0xd'));var Redis=require(_0xc828('0xe'));var authService=require(_0xc828('0xf'));var qs=require(_0xc828('0x10'));var as=require(_0xc828('0x11'));var hardwareService=require(_0xc828('0x12'));var logger=require(_0xc828('0x13'))(_0xc828('0x14'));var utils=require(_0xc828('0x15'));var config=require(_0xc828('0x16'));var licenseUtil=require(_0xc828('0x17'));var db=require(_0xc828('0x18'))['db'];function respondWithStatusCode(_0x18819b,_0x18888c){_0x18888c=_0x18888c||0xcc;return function(_0x20832d){if(_0x20832d){return _0x18819b[_0xc828('0x19')](_0x18888c);}return _0x18819b[_0xc828('0x1a')](_0x18888c)['end']();};}function respondWithResult(_0x11e657,_0x3ef300){_0x3ef300=_0x3ef300||0xc8;return function(_0x101de7){if(_0x101de7){return _0x11e657[_0xc828('0x1a')](_0x3ef300)['json'](_0x101de7);}};}function respondWithFilteredResult(_0x2e12ef,_0x1779d1){return function(_0x28a285){if(_0x28a285){var _0x2542ca=typeof _0x1779d1[_0xc828('0x1b')]===_0xc828('0x1c')&&typeof _0x1779d1[_0xc828('0x1d')]===_0xc828('0x1c');var _0x4375d0=_0x28a285['count'];var _0x35c940=_0x2542ca?0x0:_0x1779d1[_0xc828('0x1b')];var _0x3207be=_0x2542ca?_0x28a285[_0xc828('0x1e')]:_0x1779d1[_0xc828('0x1b')]+_0x1779d1[_0xc828('0x1d')];var _0x54e6c0;if(_0x3207be>=_0x4375d0){_0x3207be=_0x4375d0;_0x54e6c0=0xc8;}else{_0x54e6c0=0xce;}_0x2e12ef[_0xc828('0x1a')](_0x54e6c0);return _0x2e12ef[_0xc828('0x1f')]('Content-Range',_0x35c940+'-'+_0x3207be+'/'+_0x4375d0)[_0xc828('0x20')](_0x28a285);}return null;};}function patchUpdates(_0x3aea2d){return function(_0x36c7d5){try{jsonpatch['apply'](_0x36c7d5,_0x3aea2d,!![]);}catch(_0x1c96d8){return BPromise[_0xc828('0x21')](_0x1c96d8);}return _0x36c7d5[_0xc828('0x22')]();};}function saveUpdates(_0x334505,_0x565d12){return function(_0x2ad0f0){if(_0x2ad0f0){return _0x2ad0f0[_0xc828('0x23')](_0x334505)[_0xc828('0x24')](function(_0x45b7b2){return _0x45b7b2;});}return null;};}function removeEntity(_0x564972,_0x57d9a0){return function(_0x16357d){if(_0x16357d){return _0x16357d['destroy']()[_0xc828('0x24')](function(){_0x564972[_0xc828('0x1a')](0xcc)[_0xc828('0x25')]();});}};}function handleEntityNotFound(_0x3ee04e,_0x462d00){return function(_0x582eb7){if(!_0x582eb7){_0x3ee04e[_0xc828('0x19')](0x194);}return _0x582eb7;};}function handleError(_0x30be43,_0x115d8b){_0x115d8b=_0x115d8b||0x1f4;return function(_0x514951){logger['error'](_0x514951[_0xc828('0x26')]);if(_0x514951[_0xc828('0x27')]){delete _0x514951[_0xc828('0x27')];}_0x30be43[_0xc828('0x1a')](_0x115d8b)[_0xc828('0x28')](_0x514951);};}exports[_0xc828('0x29')]=function(_0x3b6ebc,_0xdee679){var _0x492422={},_0x5b75ca={},_0x3a6a68={'count':0x0,'rows':[]};var _0x2d8826=_[_0xc828('0x2a')](db[_0xc828('0x2b')]['rawAttributes'],function(_0x12b02c){return{'name':_0x12b02c[_0xc828('0x2c')],'type':_0x12b02c[_0xc828('0x2d')][_0xc828('0x2e')]};});_0x5b75ca[_0xc828('0x2f')]=_[_0xc828('0x2a')](_0x2d8826,_0xc828('0x27'));_0x5b75ca[_0xc828('0x30')]=_[_0xc828('0x31')](_0x3b6ebc['query']);_0x5b75ca['filters']=_['intersection'](_0x5b75ca[_0xc828('0x2f')],_0x5b75ca[_0xc828('0x30')]);_0x492422[_0xc828('0x32')]=_['intersection'](_0x5b75ca[_0xc828('0x2f')],qs[_0xc828('0x33')](_0x3b6ebc[_0xc828('0x30')]['fields']));_0x492422[_0xc828('0x32')]=_0x492422[_0xc828('0x32')][_0xc828('0x34')]?_0x492422['attributes']:_0x5b75ca[_0xc828('0x2f')];if(!_0x3b6ebc[_0xc828('0x30')][_0xc828('0x35')](_0xc828('0x36'))){_0x492422[_0xc828('0x1d')]=qs[_0xc828('0x1d')](_0x3b6ebc['query']['limit']);_0x492422[_0xc828('0x1b')]=qs[_0xc828('0x1b')](_0x3b6ebc[_0xc828('0x30')]['offset']);}_0x492422['order']=qs[_0xc828('0x37')](_0x3b6ebc[_0xc828('0x30')][_0xc828('0x37')]);_0x492422['where']=qs['filters'](_['pick'](_0x3b6ebc[_0xc828('0x30')],_0x5b75ca[_0xc828('0x38')]),_0x2d8826);if(_0x3b6ebc['query'][_0xc828('0x39')]){_0x492422['where']=_['merge'](_0x492422[_0xc828('0x3a')],{'$or':_[_0xc828('0x2a')](_0x2d8826,function(_0x18aaf6){if(_0x18aaf6['type']!==_0xc828('0x3b')){var _0x538551={};_0x538551[_0x18aaf6[_0xc828('0x27')]]={'$like':'%'+_0x3b6ebc[_0xc828('0x30')][_0xc828('0x39')]+'%'};return _0x538551;}})});}_0x492422=_[_0xc828('0x3c')]({},_0x492422,_0x3b6ebc[_0xc828('0x3d')]);var _0xfe83cb={'where':_0x492422[_0xc828('0x3a')]};return db['SmsQueueReport'][_0xc828('0x1e')](_0xfe83cb)[_0xc828('0x24')](function(_0x218b3f){_0x3a6a68[_0xc828('0x1e')]=_0x218b3f;if(_0x3b6ebc[_0xc828('0x30')][_0xc828('0x3e')]){_0x492422[_0xc828('0x3f')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xc828('0x40')](_0x492422);})['then'](function(_0x48eee0){_0x3a6a68[_0xc828('0x41')]=_0x48eee0;return _0x3a6a68;})['then'](respondWithFilteredResult(_0xdee679,_0x492422))[_0xc828('0x42')](handleError(_0xdee679,null));};exports[_0xc828('0x43')]=function(_0x461dc5,_0x181e7b){var _0x201c46={'raw':!![],'where':{'id':_0x461dc5[_0xc828('0x44')]['id']}},_0x1a3b96={};_0x1a3b96['model']=_[_0xc828('0x31')](db['SmsQueueReport']['rawAttributes']);_0x1a3b96['query']=_['keys'](_0x461dc5[_0xc828('0x30')]);_0x1a3b96[_0xc828('0x38')]=_[_0xc828('0x45')](_0x1a3b96[_0xc828('0x2f')],_0x1a3b96[_0xc828('0x30')]);_0x201c46['attributes']=_[_0xc828('0x45')](_0x1a3b96['model'],qs[_0xc828('0x33')](_0x461dc5[_0xc828('0x30')][_0xc828('0x33')]));_0x201c46[_0xc828('0x32')]=_0x201c46['attributes'][_0xc828('0x34')]?_0x201c46[_0xc828('0x32')]:_0x1a3b96[_0xc828('0x2f')];if(_0x461dc5[_0xc828('0x30')][_0xc828('0x3e')]){_0x201c46['include']=[{'all':!![]}];}_0x201c46=_[_0xc828('0x3c')]({},_0x201c46,_0x461dc5['options']);return db[_0xc828('0x2b')]['find'](_0x201c46)['then'](handleEntityNotFound(_0x181e7b,null))[_0xc828('0x24')](respondWithResult(_0x181e7b,null))['catch'](handleError(_0x181e7b,null));};exports[_0xc828('0x46')]=function(_0x483176,_0x852b8b){return db['SmsQueueReport']['create'](_0x483176[_0xc828('0x47')],{})[_0xc828('0x24')](respondWithResult(_0x852b8b,0xc9))[_0xc828('0x42')](handleError(_0x852b8b,null));};exports[_0xc828('0x23')]=function(_0x588fd0,_0x1fb016){if(_0x588fd0[_0xc828('0x47')]['id']){delete _0x588fd0[_0xc828('0x47')]['id'];}return db['SmsQueueReport']['find']({'where':{'id':_0x588fd0[_0xc828('0x44')]['id']}})[_0xc828('0x24')](handleEntityNotFound(_0x1fb016,null))[_0xc828('0x24')](saveUpdates(_0x588fd0[_0xc828('0x47')],null))[_0xc828('0x24')](respondWithResult(_0x1fb016,null))[_0xc828('0x42')](handleError(_0x1fb016,null));};exports[_0xc828('0x48')]=function(_0x15b8ab,_0x2585a4){return db[_0xc828('0x2b')][_0xc828('0x49')]({'where':{'id':_0x15b8ab[_0xc828('0x44')]['id']}})['then'](handleEntityNotFound(_0x2585a4,null))['then'](removeEntity(_0x2585a4,null))[_0xc828('0x42')](handleError(_0x2585a4,null));};exports[_0xc828('0x4a')]=function(_0x453dba,_0x24b2a1){return db[_0xc828('0x2b')][_0xc828('0x4a')]()[_0xc828('0x24')](respondWithResult(_0x24b2a1,null))[_0xc828('0x42')](handleError(_0x24b2a1,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index f7565f3..0347f72 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 _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x123fa5,_0xc2af63){var _0x5242ed=function(_0x430542){while(--_0x430542){_0x123fa5['push'](_0x123fa5['shift']());}};_0x5242ed(++_0xc2af63);}(_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('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x207bd5,_0x300b89){var _0x4c1122=function(_0x21e2f5){while(--_0x21e2f5){_0x207bd5['push'](_0x207bd5['shift']());}};_0x4c1122(++_0x300b89);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0xb7e7[_0x1fc122];return _0xa2cb13;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index c203333..532e728 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 _0xf007=['SmsQueueReport','create','body','options','raw','CreateSmsQueueReport','UpdateSmsQueueReport','update','where','attributes','limit','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x3a7f8f,_0x47bbbd){var _0x4fdbd0=function(_0x5ae69c){while(--_0x5ae69c){_0x3a7f8f['push'](_0x3a7f8f['shift']());}};_0x4fdbd0(++_0x47bbbd);}(_0xf007,0x19e));var _0x7f00=function(_0x5c3143,_0x12d54c){_0x5c3143=_0x5c3143-0x0;var _0x42708d=_0xf007[_0x5c3143];return _0x42708d;};'use strict';var _=require(_0x7f00('0x0'));var util=require(_0x7f00('0x1'));var moment=require('moment');var BPromise=require(_0x7f00('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f00('0x3'));var db=require(_0x7f00('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f00('0x5'))(_0x7f00('0x6'));var config=require('../../config/environment');var jayson=require(_0x7f00('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x33ca73,_0x642137,_0x3bd04b){return new BPromise(function(_0x3a3608,_0x10f53d){return client[_0x7f00('0x8')](_0x33ca73,_0x3bd04b)[_0x7f00('0x9')](function(_0x2672c4){logger[_0x7f00('0xa')](_0x7f00('0xb'),_0x642137,_0x7f00('0xc'));logger[_0x7f00('0xd')](_0x7f00('0xe'),_0x642137,'request\x20sent',JSON[_0x7f00('0xf')](_0x2672c4));if(_0x2672c4['error']){if(_0x2672c4[_0x7f00('0x10')]['code']===0x1f4){logger[_0x7f00('0x10')](_0x7f00('0xb'),_0x642137,_0x2672c4[_0x7f00('0x10')][_0x7f00('0x11')]);return _0x10f53d(_0x2672c4['error'][_0x7f00('0x11')]);}logger[_0x7f00('0x10')](_0x7f00('0xb'),_0x642137,_0x2672c4['error'][_0x7f00('0x11')]);return _0x3a3608(_0x2672c4[_0x7f00('0x10')]['message']);}else{logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x642137,_0x7f00('0xc'));_0x3a3608(_0x2672c4[_0x7f00('0x12')]['message']);}})[_0x7f00('0x13')](function(_0x54bb70){logger[_0x7f00('0x10')](_0x7f00('0xb'),_0x642137,_0x54bb70);_0x10f53d(_0x54bb70);});});}exports['CreateSmsQueueReport']=function(_0x52a073){var _0x4a3363=this;return new Promise(function(_0x13097a,_0x1b4ac6){return db[_0x7f00('0x14')][_0x7f00('0x15')](_0x52a073[_0x7f00('0x16')],{'raw':_0x52a073[_0x7f00('0x17')]?_0x52a073['options'][_0x7f00('0x18')]===undefined?!![]:![]:!![]})[_0x7f00('0x9')](function(_0x3aa745){logger[_0x7f00('0xa')](_0x7f00('0x19'),_0x52a073);logger[_0x7f00('0xd')](_0x7f00('0x19'),_0x52a073,JSON[_0x7f00('0xf')](_0x3aa745));_0x13097a(_0x3aa745);})[_0x7f00('0x13')](function(_0xc6b5f1){logger[_0x7f00('0x10')](_0x7f00('0x19'),_0xc6b5f1[_0x7f00('0x11')],_0x52a073);_0x1b4ac6(_0x4a3363[_0x7f00('0x10')](0x1f4,_0xc6b5f1[_0x7f00('0x11')]));});});};exports[_0x7f00('0x1a')]=function(_0x1bd029){var _0xa61d79=this;return new Promise(function(_0xda81c6,_0x29c945){return db[_0x7f00('0x14')][_0x7f00('0x1b')](_0x1bd029['body'],{'raw':_0x1bd029['options']?_0x1bd029[_0x7f00('0x17')][_0x7f00('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bd029[_0x7f00('0x17')]?_0x1bd029['options'][_0x7f00('0x1c')]||null:null,'attributes':_0x1bd029[_0x7f00('0x17')]?_0x1bd029['options'][_0x7f00('0x1d')]||null:null,'limit':_0x1bd029[_0x7f00('0x17')]?_0x1bd029[_0x7f00('0x17')][_0x7f00('0x1e')]||null:null})[_0x7f00('0x9')](function(_0x57183a){logger[_0x7f00('0xa')](_0x7f00('0x1a'),_0x1bd029);logger['debug']('UpdateSmsQueueReport',_0x1bd029,JSON[_0x7f00('0xf')](_0x57183a));_0xda81c6(_0x57183a);})['catch'](function(_0x4de7a6){logger[_0x7f00('0x10')]('UpdateSmsQueueReport',_0x4de7a6[_0x7f00('0x11')],_0x1bd029);_0x29c945(_0xa61d79[_0x7f00('0x10')](0x1f4,_0x4de7a6['message']));});});}; \ No newline at end of file +var _0x5729=['create','body','options','raw','then','UpdateSmsQueueReport','update','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateSmsQueueReport','SmsQueueReport'];(function(_0x27a997,_0x85f149){var _0x5aa288=function(_0x38f03c){while(--_0x38f03c){_0x27a997['push'](_0x27a997['shift']());}};_0x5aa288(++_0x85f149);}(_0x5729,0x13f));var _0x9572=function(_0x433795,_0x253d09){_0x433795=_0x433795-0x0;var _0x27661e=_0x5729[_0x433795];return _0x27661e;};'use strict';var _=require('lodash');var util=require(_0x9572('0x0'));var moment=require(_0x9572('0x1'));var BPromise=require(_0x9572('0x2'));var rs=require(_0x9572('0x3'));var fs=require('fs');var Redis=require(_0x9572('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9572('0x5'))(_0x9572('0x6'));var config=require('../../config/environment');var jayson=require(_0x9572('0x7'));var client=jayson[_0x9572('0x8')][_0x9572('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xee9b6e,_0x1cc0db,_0x488b16){return new BPromise(function(_0x3dcf48,_0x72e628){return client[_0x9572('0xa')](_0xee9b6e,_0x488b16)['then'](function(_0x38c936){logger[_0x9572('0xb')](_0x9572('0xc'),_0x1cc0db,_0x9572('0xd'));logger[_0x9572('0xe')](_0x9572('0xf'),_0x1cc0db,'request\x20sent',JSON[_0x9572('0x10')](_0x38c936));if(_0x38c936[_0x9572('0x11')]){if(_0x38c936[_0x9572('0x11')]['code']===0x1f4){logger[_0x9572('0x11')](_0x9572('0xc'),_0x1cc0db,_0x38c936[_0x9572('0x11')][_0x9572('0x12')]);return _0x72e628(_0x38c936[_0x9572('0x11')][_0x9572('0x12')]);}logger[_0x9572('0x11')](_0x9572('0xc'),_0x1cc0db,_0x38c936[_0x9572('0x11')][_0x9572('0x12')]);return _0x3dcf48(_0x38c936['error'][_0x9572('0x12')]);}else{logger[_0x9572('0xb')](_0x9572('0xc'),_0x1cc0db,_0x9572('0xd'));_0x3dcf48(_0x38c936['result']['message']);}})[_0x9572('0x13')](function(_0x44e2f8){logger[_0x9572('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x1cc0db,_0x44e2f8);_0x72e628(_0x44e2f8);});});}exports[_0x9572('0x14')]=function(_0x34be51){var _0x599c71=this;return new Promise(function(_0x5c56d5,_0x1d08c4){return db[_0x9572('0x15')][_0x9572('0x16')](_0x34be51[_0x9572('0x17')],{'raw':_0x34be51[_0x9572('0x18')]?_0x34be51['options'][_0x9572('0x19')]===undefined?!![]:![]:!![]})[_0x9572('0x1a')](function(_0x3e9cb7){logger[_0x9572('0xb')](_0x9572('0x14'),_0x34be51);logger[_0x9572('0xe')](_0x9572('0x14'),_0x34be51,JSON[_0x9572('0x10')](_0x3e9cb7));_0x5c56d5(_0x3e9cb7);})['catch'](function(_0x16e41d){logger['error'](_0x9572('0x14'),_0x16e41d[_0x9572('0x12')],_0x34be51);_0x1d08c4(_0x599c71[_0x9572('0x11')](0x1f4,_0x16e41d[_0x9572('0x12')]));});});};exports[_0x9572('0x1b')]=function(_0x2cbc95){var _0x34c651=this;return new Promise(function(_0x3666cd,_0x32ec52){return db['SmsQueueReport'][_0x9572('0x1c')](_0x2cbc95[_0x9572('0x17')],{'raw':_0x2cbc95['options']?_0x2cbc95['options'][_0x9572('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2cbc95['options']?_0x2cbc95[_0x9572('0x18')]['where']||null:null,'attributes':_0x2cbc95[_0x9572('0x18')]?_0x2cbc95[_0x9572('0x18')][_0x9572('0x1d')]||null:null,'limit':_0x2cbc95[_0x9572('0x18')]?_0x2cbc95[_0x9572('0x18')][_0x9572('0x1e')]||null:null})[_0x9572('0x1a')](function(_0x2ae4c8){logger[_0x9572('0xb')](_0x9572('0x1b'),_0x2cbc95);logger[_0x9572('0xe')](_0x9572('0x1b'),_0x2cbc95,JSON[_0x9572('0x10')](_0x2ae4c8));_0x3666cd(_0x2ae4c8);})[_0x9572('0x13')](function(_0x111a28){logger[_0x9572('0x11')]('UpdateSmsQueueReport',_0x111a28[_0x9572('0x12')],_0x2cbc95);_0x32ec52(_0x34c651[_0x9572('0x11')](0x1f4,_0x111a28[_0x9572('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 26812ce..7d56eb0 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 _0x2d17=['destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','describe','show','post','create','put','/:id','update','delete'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x2d17,0x17e));var _0x72d1=function(_0x51d4eb,_0x2ce62d){_0x51d4eb=_0x51d4eb-0x0;var _0x3303b6=_0x2d17[_0x51d4eb];return _0x3303b6;};'use strict';var multer=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var path=require('path');var timeout=require(_0x72d1('0x2'));var express=require(_0x72d1('0x3'));var router=express['Router']();var fs_extra=require(_0x72d1('0x4'));var auth=require(_0x72d1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x72d1('0x6'));var controller=require('./smsTransferReport.controller');router[_0x72d1('0x7')]('/',auth['isAuthenticated'](),controller[_0x72d1('0x8')]);router[_0x72d1('0x7')]('/describe',auth[_0x72d1('0x9')](),controller[_0x72d1('0xa')]);router[_0x72d1('0x7')]('/:id',auth[_0x72d1('0x9')](),controller[_0x72d1('0xb')]);router[_0x72d1('0xc')]('/',auth['isAuthenticated'](),controller[_0x72d1('0xd')]);router[_0x72d1('0xe')](_0x72d1('0xf'),auth[_0x72d1('0x9')](),controller[_0x72d1('0x10')]);router[_0x72d1('0x11')](_0x72d1('0xf'),auth[_0x72d1('0x9')](),controller[_0x72d1('0x12')]);module[_0x72d1('0x13')]=router; \ No newline at end of file +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(_0x5272d9,_0x2d5513){var _0x464524=function(_0x584f9c){while(--_0x584f9c){_0x5272d9['push'](_0x5272d9['shift']());}};_0x464524(++_0x2d5513);}(_0x5178,0x171));var _0x8517=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x5178[_0x3bf83f];return _0x22c4a9;};'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 diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index a13f954..9e76890 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x3c59fc,_0x10dbd2){var _0x2b78d4=function(_0x5f161a){while(--_0x5f161a){_0x3c59fc['push'](_0x3c59fc['shift']());}};_0x2b78d4(++_0x10dbd2);}(_0xb43b,0x1b2));var _0xbb43=function(_0x2ea01a,_0x5015b2){_0x2ea01a=_0x2ea01a-0x0;var _0xa6ea9f=_0xb43b[_0x2ea01a];return _0xa6ea9f;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x487e12,_0x5ef95b){var _0x3f31a0=function(_0x17b7db){while(--_0x17b7db){_0x487e12['push'](_0x487e12['shift']());}};_0x3f31a0(++_0x5ef95b);}(_0xedd9,0xfc));var _0x9edd=function(_0x435b1a,_0x2fccdd){_0x435b1a=_0x435b1a-0x0;var _0x40fe3c=_0xedd9[_0x435b1a];return _0x40fe3c;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 45e5e0d..87ffc13 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 _0x0dab=['count','set','Content-Range','apply','save','then','destroy','end','stack','name','index','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','SmsTransferReport','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit'];(function(_0x3b3088,_0x4ccf8d){var _0x10a4d9=function(_0x2b091b){while(--_0x2b091b){_0x3b3088['push'](_0x3b3088['shift']());}};_0x10a4d9(++_0x4ccf8d);}(_0x0dab,0x1e9));var _0xb0da=function(_0x384edb,_0x18fe0b){_0x384edb=_0x384edb-0x0;var _0x4caa07=_0x0dab[_0x384edb];return _0x4caa07;};'use strict';var emlformat=require(_0xb0da('0x0'));var rimraf=require(_0xb0da('0x1'));var zipdir=require(_0xb0da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb0da('0x3'));var moment=require(_0xb0da('0x4'));var BPromise=require(_0xb0da('0x5'));var Mustache=require(_0xb0da('0x6'));var util=require(_0xb0da('0x7'));var path=require('path');var sox=require(_0xb0da('0x8'));var csv=require('to-csv');var ejs=require(_0xb0da('0x9'));var fs=require('fs');var fs_extra=require(_0xb0da('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb0da('0xb'));var querystring=require(_0xb0da('0xc'));var Papa=require('papaparse');var Redis=require(_0xb0da('0xd'));var authService=require(_0xb0da('0xe'));var qs=require(_0xb0da('0xf'));var as=require(_0xb0da('0x10'));var hardwareService=require(_0xb0da('0x11'));var logger=require('../../config/logger')(_0xb0da('0x12'));var utils=require(_0xb0da('0x13'));var config=require(_0xb0da('0x14'));var licenseUtil=require(_0xb0da('0x15'));var db=require(_0xb0da('0x16'))['db'];function respondWithStatusCode(_0x4f51fa,_0x17b2bd){_0x17b2bd=_0x17b2bd||0xcc;return function(_0x36aecd){if(_0x36aecd){return _0x4f51fa[_0xb0da('0x17')](_0x17b2bd);}return _0x4f51fa[_0xb0da('0x18')](_0x17b2bd)['end']();};}function respondWithResult(_0x5071b1,_0x53a991){_0x53a991=_0x53a991||0xc8;return function(_0x38688a){if(_0x38688a){return _0x5071b1[_0xb0da('0x18')](_0x53a991)[_0xb0da('0x19')](_0x38688a);}};}function respondWithFilteredResult(_0x422c92,_0x3d7711){return function(_0x354588){if(_0x354588){var _0x5b9414=typeof _0x3d7711[_0xb0da('0x1a')]===_0xb0da('0x1b')&&typeof _0x3d7711[_0xb0da('0x1c')]===_0xb0da('0x1b');var _0x45c53d=_0x354588[_0xb0da('0x1d')];var _0x11ffe0=_0x5b9414?0x0:_0x3d7711['offset'];var _0x174742=_0x5b9414?_0x354588['count']:_0x3d7711[_0xb0da('0x1a')]+_0x3d7711['limit'];var _0x42a0be;if(_0x174742>=_0x45c53d){_0x174742=_0x45c53d;_0x42a0be=0xc8;}else{_0x42a0be=0xce;}_0x422c92[_0xb0da('0x18')](_0x42a0be);return _0x422c92[_0xb0da('0x1e')](_0xb0da('0x1f'),_0x11ffe0+'-'+_0x174742+'/'+_0x45c53d)[_0xb0da('0x19')](_0x354588);}return null;};}function patchUpdates(_0x544df5){return function(_0x1a9ed9){try{jsonpatch[_0xb0da('0x20')](_0x1a9ed9,_0x544df5,!![]);}catch(_0x14b06e){return BPromise['reject'](_0x14b06e);}return _0x1a9ed9[_0xb0da('0x21')]();};}function saveUpdates(_0x1b0f78,_0x4460ac){return function(_0xe4e7e1){if(_0xe4e7e1){return _0xe4e7e1['update'](_0x1b0f78)[_0xb0da('0x22')](function(_0x50cd39){return _0x50cd39;});}return null;};}function removeEntity(_0x26d1db,_0x4e0dd2){return function(_0x326720){if(_0x326720){return _0x326720[_0xb0da('0x23')]()[_0xb0da('0x22')](function(){_0x26d1db[_0xb0da('0x18')](0xcc)[_0xb0da('0x24')]();});}};}function handleEntityNotFound(_0x399332,_0x4d0c85){return function(_0x1f2d07){if(!_0x1f2d07){_0x399332['sendStatus'](0x194);}return _0x1f2d07;};}function handleError(_0x3de18a,_0xbd64cf){_0xbd64cf=_0xbd64cf||0x1f4;return function(_0x1ffdce){logger['error'](_0x1ffdce[_0xb0da('0x25')]);if(_0x1ffdce[_0xb0da('0x26')]){delete _0x1ffdce[_0xb0da('0x26')];}_0x3de18a[_0xb0da('0x18')](_0xbd64cf)['send'](_0x1ffdce);};}exports[_0xb0da('0x27')]=function(_0x987bbf,_0x23ba39){var _0x51cf81={},_0x55e885={},_0x52014d={'count':0x0,'rows':[]};var _0x5c2ebc=_['map'](db['SmsTransferReport']['rawAttributes'],function(_0x299538){return{'name':_0x299538[_0xb0da('0x28')],'type':_0x299538[_0xb0da('0x29')][_0xb0da('0x2a')]};});_0x55e885[_0xb0da('0x2b')]=_['map'](_0x5c2ebc,_0xb0da('0x26'));_0x55e885['query']=_[_0xb0da('0x2c')](_0x987bbf['query']);_0x55e885[_0xb0da('0x2d')]=_[_0xb0da('0x2e')](_0x55e885[_0xb0da('0x2b')],_0x55e885[_0xb0da('0x2f')]);_0x51cf81['attributes']=_[_0xb0da('0x2e')](_0x55e885[_0xb0da('0x2b')],qs[_0xb0da('0x30')](_0x987bbf[_0xb0da('0x2f')][_0xb0da('0x30')]));_0x51cf81['attributes']=_0x51cf81[_0xb0da('0x31')][_0xb0da('0x32')]?_0x51cf81[_0xb0da('0x31')]:_0x55e885[_0xb0da('0x2b')];if(!_0x987bbf['query'][_0xb0da('0x33')](_0xb0da('0x34'))){_0x51cf81[_0xb0da('0x1c')]=qs['limit'](_0x987bbf['query'][_0xb0da('0x1c')]);_0x51cf81['offset']=qs[_0xb0da('0x1a')](_0x987bbf[_0xb0da('0x2f')][_0xb0da('0x1a')]);}_0x51cf81[_0xb0da('0x35')]=qs[_0xb0da('0x36')](_0x987bbf[_0xb0da('0x2f')][_0xb0da('0x36')]);_0x51cf81[_0xb0da('0x37')]=qs[_0xb0da('0x2d')](_[_0xb0da('0x38')](_0x987bbf['query'],_0x55e885[_0xb0da('0x2d')]),_0x5c2ebc);if(_0x987bbf[_0xb0da('0x2f')][_0xb0da('0x39')]){_0x51cf81['where']=_[_0xb0da('0x3a')](_0x51cf81[_0xb0da('0x37')],{'$or':_[_0xb0da('0x3b')](_0x5c2ebc,function(_0x49db69){if(_0x49db69['type']!==_0xb0da('0x3c')){var _0x109489={};_0x109489[_0x49db69[_0xb0da('0x26')]]={'$like':'%'+_0x987bbf[_0xb0da('0x2f')][_0xb0da('0x39')]+'%'};return _0x109489;}})});}_0x51cf81=_[_0xb0da('0x3a')]({},_0x51cf81,_0x987bbf[_0xb0da('0x3d')]);var _0x3ee298={'where':_0x51cf81[_0xb0da('0x37')]};return db[_0xb0da('0x3e')][_0xb0da('0x1d')](_0x3ee298)[_0xb0da('0x22')](function(_0x3824b5){_0x52014d[_0xb0da('0x1d')]=_0x3824b5;if(_0x987bbf[_0xb0da('0x2f')][_0xb0da('0x3f')]){_0x51cf81[_0xb0da('0x40')]=[{'all':!![]}];}return db['SmsTransferReport'][_0xb0da('0x41')](_0x51cf81);})['then'](function(_0xcf3545){_0x52014d['rows']=_0xcf3545;return _0x52014d;})[_0xb0da('0x22')](respondWithFilteredResult(_0x23ba39,_0x51cf81))[_0xb0da('0x42')](handleError(_0x23ba39,null));};exports[_0xb0da('0x43')]=function(_0x240bec,_0x571b0b){var _0x2fd4c4={'raw':!![],'where':{'id':_0x240bec[_0xb0da('0x44')]['id']}},_0x120e36={};_0x120e36[_0xb0da('0x2b')]=_['keys'](db['SmsTransferReport'][_0xb0da('0x45')]);_0x120e36[_0xb0da('0x2f')]=_[_0xb0da('0x2c')](_0x240bec[_0xb0da('0x2f')]);_0x120e36[_0xb0da('0x2d')]=_['intersection'](_0x120e36[_0xb0da('0x2b')],_0x120e36[_0xb0da('0x2f')]);_0x2fd4c4[_0xb0da('0x31')]=_[_0xb0da('0x2e')](_0x120e36[_0xb0da('0x2b')],qs[_0xb0da('0x30')](_0x240bec[_0xb0da('0x2f')][_0xb0da('0x30')]));_0x2fd4c4[_0xb0da('0x31')]=_0x2fd4c4[_0xb0da('0x31')]['length']?_0x2fd4c4[_0xb0da('0x31')]:_0x120e36[_0xb0da('0x2b')];if(_0x240bec[_0xb0da('0x2f')][_0xb0da('0x3f')]){_0x2fd4c4['include']=[{'all':!![]}];}_0x2fd4c4=_[_0xb0da('0x3a')]({},_0x2fd4c4,_0x240bec[_0xb0da('0x3d')]);return db[_0xb0da('0x3e')][_0xb0da('0x46')](_0x2fd4c4)['then'](handleEntityNotFound(_0x571b0b,null))[_0xb0da('0x22')](respondWithResult(_0x571b0b,null))['catch'](handleError(_0x571b0b,null));};exports[_0xb0da('0x47')]=function(_0x2792a6,_0x4f76f1){return db[_0xb0da('0x3e')]['create'](_0x2792a6[_0xb0da('0x48')],{})[_0xb0da('0x22')](respondWithResult(_0x4f76f1,0xc9))['catch'](handleError(_0x4f76f1,null));};exports[_0xb0da('0x49')]=function(_0x3d3ec1,_0x4f4b7a){if(_0x3d3ec1[_0xb0da('0x48')]['id']){delete _0x3d3ec1[_0xb0da('0x48')]['id'];}return db['SmsTransferReport'][_0xb0da('0x46')]({'where':{'id':_0x3d3ec1[_0xb0da('0x44')]['id']}})[_0xb0da('0x22')](handleEntityNotFound(_0x4f4b7a,null))[_0xb0da('0x22')](saveUpdates(_0x3d3ec1['body'],null))[_0xb0da('0x22')](respondWithResult(_0x4f4b7a,null))[_0xb0da('0x42')](handleError(_0x4f4b7a,null));};exports['destroy']=function(_0xeb6719,_0x58eec7){return db[_0xb0da('0x3e')]['find']({'where':{'id':_0xeb6719['params']['id']}})[_0xb0da('0x22')](handleEntityNotFound(_0x58eec7,null))[_0xb0da('0x22')](removeEntity(_0x58eec7,null))[_0xb0da('0x42')](handleError(_0x58eec7,null));};exports['describe']=function(_0x23719f,_0x7e0f3c){return db[_0xb0da('0x3e')]['describe']()[_0xb0da('0x22')](respondWithResult(_0x7e0f3c,null))['catch'](handleError(_0x7e0f3c,null));}; \ No newline at end of file +var _0x2851=['model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','create','body','update','find','params','destroy','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','reject','save','then','error','stack','name','send','index','SmsTransferReport','rawAttributes','fieldName','type','key'];(function(_0x580197,_0xbb7e10){var _0x54a754=function(_0x271e2b){while(--_0x271e2b){_0x580197['push'](_0x580197['shift']());}};_0x54a754(++_0xbb7e10);}(_0x2851,0xb8));var _0x1285=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x2851[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1285('0x0'));var zipdir=require(_0x1285('0x1'));var jsonpatch=require(_0x1285('0x2'));var rp=require('request-promise');var moment=require(_0x1285('0x3'));var BPromise=require(_0x1285('0x4'));var Mustache=require(_0x1285('0x5'));var util=require(_0x1285('0x6'));var path=require(_0x1285('0x7'));var sox=require(_0x1285('0x8'));var csv=require(_0x1285('0x9'));var ejs=require(_0x1285('0xa'));var fs=require('fs');var fs_extra=require(_0x1285('0xb'));var _=require(_0x1285('0xc'));var squel=require(_0x1285('0xd'));var crypto=require(_0x1285('0xe'));var jsforce=require(_0x1285('0xf'));var deskjs=require(_0x1285('0x10'));var toCsv=require(_0x1285('0x9'));var querystring=require(_0x1285('0x11'));var Papa=require(_0x1285('0x12'));var Redis=require(_0x1285('0x13'));var authService=require(_0x1285('0x14'));var qs=require(_0x1285('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1285('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x1285('0x17'));var config=require(_0x1285('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1285('0x19'))['db'];function respondWithStatusCode(_0x6b895f,_0x63cd2d){_0x63cd2d=_0x63cd2d||0xcc;return function(_0x41fb89){if(_0x41fb89){return _0x6b895f['sendStatus'](_0x63cd2d);}return _0x6b895f[_0x1285('0x1a')](_0x63cd2d)[_0x1285('0x1b')]();};}function respondWithResult(_0xcb6fc6,_0x2d75d5){_0x2d75d5=_0x2d75d5||0xc8;return function(_0x2dc1ed){if(_0x2dc1ed){return _0xcb6fc6[_0x1285('0x1a')](_0x2d75d5)[_0x1285('0x1c')](_0x2dc1ed);}};}function respondWithFilteredResult(_0x57b747,_0x2baf9a){return function(_0x4b306b){if(_0x4b306b){var _0x3fdd69=typeof _0x2baf9a[_0x1285('0x1d')]===_0x1285('0x1e')&&typeof _0x2baf9a[_0x1285('0x1f')]===_0x1285('0x1e');var _0x334a42=_0x4b306b[_0x1285('0x20')];var _0x2ffcac=_0x3fdd69?0x0:_0x2baf9a[_0x1285('0x1d')];var _0x13a189=_0x3fdd69?_0x4b306b[_0x1285('0x20')]:_0x2baf9a[_0x1285('0x1d')]+_0x2baf9a[_0x1285('0x1f')];var _0x27630a;if(_0x13a189>=_0x334a42){_0x13a189=_0x334a42;_0x27630a=0xc8;}else{_0x27630a=0xce;}_0x57b747[_0x1285('0x1a')](_0x27630a);return _0x57b747['set']('Content-Range',_0x2ffcac+'-'+_0x13a189+'/'+_0x334a42)[_0x1285('0x1c')](_0x4b306b);}return null;};}function patchUpdates(_0x19abe3){return function(_0x44fe3b){try{jsonpatch[_0x1285('0x21')](_0x44fe3b,_0x19abe3,!![]);}catch(_0x47fc74){return BPromise[_0x1285('0x22')](_0x47fc74);}return _0x44fe3b[_0x1285('0x23')]();};}function saveUpdates(_0x24c6d0,_0x479d0a){return function(_0xc36252){if(_0xc36252){return _0xc36252['update'](_0x24c6d0)[_0x1285('0x24')](function(_0x59790d){return _0x59790d;});}return null;};}function removeEntity(_0x3fb4ae,_0x8676f2){return function(_0x32c5fc){if(_0x32c5fc){return _0x32c5fc['destroy']()[_0x1285('0x24')](function(){_0x3fb4ae[_0x1285('0x1a')](0xcc)[_0x1285('0x1b')]();});}};}function handleEntityNotFound(_0x257554,_0x3daaef){return function(_0x50bca6){if(!_0x50bca6){_0x257554['sendStatus'](0x194);}return _0x50bca6;};}function handleError(_0x2e926e,_0x3712f2){_0x3712f2=_0x3712f2||0x1f4;return function(_0x54fc9c){logger[_0x1285('0x25')](_0x54fc9c[_0x1285('0x26')]);if(_0x54fc9c[_0x1285('0x27')]){delete _0x54fc9c[_0x1285('0x27')];}_0x2e926e[_0x1285('0x1a')](_0x3712f2)[_0x1285('0x28')](_0x54fc9c);};}exports[_0x1285('0x29')]=function(_0x4827fd,_0x982ebc){var _0x5e4784={},_0x566f78={},_0x1aa2e0={'count':0x0,'rows':[]};var _0x1b2e1f=_['map'](db[_0x1285('0x2a')][_0x1285('0x2b')],function(_0x8e03b4){return{'name':_0x8e03b4[_0x1285('0x2c')],'type':_0x8e03b4[_0x1285('0x2d')][_0x1285('0x2e')]};});_0x566f78[_0x1285('0x2f')]=_[_0x1285('0x30')](_0x1b2e1f,_0x1285('0x27'));_0x566f78[_0x1285('0x31')]=_[_0x1285('0x32')](_0x4827fd[_0x1285('0x31')]);_0x566f78[_0x1285('0x33')]=_[_0x1285('0x34')](_0x566f78['model'],_0x566f78[_0x1285('0x31')]);_0x5e4784[_0x1285('0x35')]=_[_0x1285('0x34')](_0x566f78[_0x1285('0x2f')],qs[_0x1285('0x36')](_0x4827fd[_0x1285('0x31')][_0x1285('0x36')]));_0x5e4784['attributes']=_0x5e4784[_0x1285('0x35')][_0x1285('0x37')]?_0x5e4784[_0x1285('0x35')]:_0x566f78['model'];if(!_0x4827fd[_0x1285('0x31')][_0x1285('0x38')](_0x1285('0x39'))){_0x5e4784[_0x1285('0x1f')]=qs['limit'](_0x4827fd[_0x1285('0x31')][_0x1285('0x1f')]);_0x5e4784[_0x1285('0x1d')]=qs[_0x1285('0x1d')](_0x4827fd[_0x1285('0x31')][_0x1285('0x1d')]);}_0x5e4784[_0x1285('0x3a')]=qs['sort'](_0x4827fd[_0x1285('0x31')]['sort']);_0x5e4784[_0x1285('0x3b')]=qs[_0x1285('0x33')](_[_0x1285('0x3c')](_0x4827fd[_0x1285('0x31')],_0x566f78['filters']),_0x1b2e1f);if(_0x4827fd[_0x1285('0x31')][_0x1285('0x3d')]){_0x5e4784[_0x1285('0x3b')]=_[_0x1285('0x3e')](_0x5e4784['where'],{'$or':_[_0x1285('0x30')](_0x1b2e1f,function(_0x35f06b){if(_0x35f06b[_0x1285('0x2d')]!==_0x1285('0x3f')){var _0x427bfe={};_0x427bfe[_0x35f06b[_0x1285('0x27')]]={'$like':'%'+_0x4827fd[_0x1285('0x31')][_0x1285('0x3d')]+'%'};return _0x427bfe;}})});}_0x5e4784=_[_0x1285('0x3e')]({},_0x5e4784,_0x4827fd[_0x1285('0x40')]);var _0x3f0e86={'where':_0x5e4784[_0x1285('0x3b')]};return db[_0x1285('0x2a')][_0x1285('0x20')](_0x3f0e86)[_0x1285('0x24')](function(_0x1f39fb){_0x1aa2e0[_0x1285('0x20')]=_0x1f39fb;if(_0x4827fd[_0x1285('0x31')][_0x1285('0x41')]){_0x5e4784[_0x1285('0x42')]=[{'all':!![]}];}return db[_0x1285('0x2a')][_0x1285('0x43')](_0x5e4784);})[_0x1285('0x24')](function(_0x3e2b8e){_0x1aa2e0[_0x1285('0x44')]=_0x3e2b8e;return _0x1aa2e0;})['then'](respondWithFilteredResult(_0x982ebc,_0x5e4784))[_0x1285('0x45')](handleError(_0x982ebc,null));};exports['show']=function(_0xb9498d,_0x4e710e){var _0x164dd9={'raw':!![],'where':{'id':_0xb9498d['params']['id']}},_0x28fb20={};_0x28fb20[_0x1285('0x2f')]=_[_0x1285('0x32')](db[_0x1285('0x2a')][_0x1285('0x2b')]);_0x28fb20[_0x1285('0x31')]=_['keys'](_0xb9498d[_0x1285('0x31')]);_0x28fb20[_0x1285('0x33')]=_[_0x1285('0x34')](_0x28fb20[_0x1285('0x2f')],_0x28fb20[_0x1285('0x31')]);_0x164dd9[_0x1285('0x35')]=_[_0x1285('0x34')](_0x28fb20[_0x1285('0x2f')],qs[_0x1285('0x36')](_0xb9498d[_0x1285('0x31')]['fields']));_0x164dd9['attributes']=_0x164dd9[_0x1285('0x35')][_0x1285('0x37')]?_0x164dd9[_0x1285('0x35')]:_0x28fb20[_0x1285('0x2f')];if(_0xb9498d[_0x1285('0x31')][_0x1285('0x41')]){_0x164dd9['include']=[{'all':!![]}];}_0x164dd9=_[_0x1285('0x3e')]({},_0x164dd9,_0xb9498d[_0x1285('0x40')]);return db['SmsTransferReport']['find'](_0x164dd9)[_0x1285('0x24')](handleEntityNotFound(_0x4e710e,null))['then'](respondWithResult(_0x4e710e,null))[_0x1285('0x45')](handleError(_0x4e710e,null));};exports[_0x1285('0x46')]=function(_0x1ca0ea,_0xf9e31e){return db[_0x1285('0x2a')]['create'](_0x1ca0ea[_0x1285('0x47')],{})[_0x1285('0x24')](respondWithResult(_0xf9e31e,0xc9))[_0x1285('0x45')](handleError(_0xf9e31e,null));};exports[_0x1285('0x48')]=function(_0x103f6d,_0x30ffb7){if(_0x103f6d[_0x1285('0x47')]['id']){delete _0x103f6d[_0x1285('0x47')]['id'];}return db[_0x1285('0x2a')][_0x1285('0x49')]({'where':{'id':_0x103f6d[_0x1285('0x4a')]['id']}})[_0x1285('0x24')](handleEntityNotFound(_0x30ffb7,null))['then'](saveUpdates(_0x103f6d[_0x1285('0x47')],null))[_0x1285('0x24')](respondWithResult(_0x30ffb7,null))['catch'](handleError(_0x30ffb7,null));};exports[_0x1285('0x4b')]=function(_0x358950,_0x50c497){return db['SmsTransferReport']['find']({'where':{'id':_0x358950['params']['id']}})[_0x1285('0x24')](handleEntityNotFound(_0x50c497,null))[_0x1285('0x24')](removeEntity(_0x50c497,null))[_0x1285('0x45')](handleError(_0x50c497,null));};exports[_0x1285('0x4c')]=function(_0x1b55d2,_0x5b6b79){return db[_0x1285('0x2a')][_0x1285('0x4c')]()['then'](respondWithResult(_0x5b6b79,null))[_0x1285('0x45')](handleError(_0x5b6b79,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index b7268a0..de44e2b 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 _0xaa48=['request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x272166,_0x122e6b){var _0x28524b=function(_0x1ee93e){while(--_0x1ee93e){_0x272166['push'](_0x272166['shift']());}};_0x28524b(++_0x122e6b);}(_0xaa48,0x15a));var _0x8aa4=function(_0x3f1072,_0x3bd391){_0x3f1072=_0x3f1072-0x0;var _0x5d9379=_0xaa48[_0x3f1072];return _0x5d9379;};'use strict';var _=require(_0x8aa4('0x0'));var util=require(_0x8aa4('0x1'));var logger=require(_0x8aa4('0x2'))(_0x8aa4('0x3'));var moment=require(_0x8aa4('0x4'));var BPromise=require(_0x8aa4('0x5'));var rp=require(_0x8aa4('0x6'));var fs=require('fs');var path=require(_0x8aa4('0x7'));var rimraf=require(_0x8aa4('0x8'));var config=require(_0x8aa4('0x9'));var attributes=require(_0x8aa4('0xa'));module[_0x8aa4('0xb')]=function(_0x141d8b,_0x14614c){return _0x141d8b[_0x8aa4('0xc')](_0x8aa4('0xd'),attributes,{'tableName':_0x8aa4('0xe'),'paranoid':![],'indexes':[{'name':_0x8aa4('0xf'),'fields':[_0x8aa4('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7e63=['request-promise','rimraf','../../config/environment','define','report_sms_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3e3bed,_0x28cdc0){var _0x30595b=function(_0xa67c7d){while(--_0xa67c7d){_0x3e3bed['push'](_0x3e3bed['shift']());}};_0x30595b(++_0x28cdc0);}(_0x7e63,0x74));var _0x37e6=function(_0x9eae93,_0x41e262){_0x9eae93=_0x9eae93-0x0;var _0x210b66=_0x7e63[_0x9eae93];return _0x210b66;};'use strict';var _=require(_0x37e6('0x0'));var util=require(_0x37e6('0x1'));var logger=require(_0x37e6('0x2'))('api');var moment=require(_0x37e6('0x3'));var BPromise=require(_0x37e6('0x4'));var rp=require(_0x37e6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x37e6('0x6'));var config=require(_0x37e6('0x7'));var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x201f4b,_0x7943bc){return _0x201f4b[_0x37e6('0x8')]('SmsTransferReport',attributes,{'tableName':_0x37e6('0x9'),'paranoid':![],'indexes':[{'name':_0x37e6('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 803a3d8..7090c23 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 _0x202c=['message','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x55fa69,_0x4b1325){var _0x11c103=function(_0x5ae6b3){while(--_0x5ae6b3){_0x55fa69['push'](_0x55fa69['shift']());}};_0x11c103(++_0x4b1325);}(_0x202c,0x178));var _0xc202=function(_0x46105e,_0x4bd518){_0x46105e=_0x46105e-0x0;var _0x2e95f0=_0x202c[_0x46105e];return _0x2e95f0;};'use strict';var _=require(_0xc202('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc202('0x1'));var rs=require(_0xc202('0x2'));var fs=require('fs');var Redis=require(_0xc202('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc202('0x4'));var logger=require(_0xc202('0x5'))(_0xc202('0x6'));var config=require(_0xc202('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc202('0x8')][_0xc202('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59563a,_0xc2b3eb,_0x574549){return new BPromise(function(_0x872c1a,_0x5978fe){return client[_0xc202('0xa')](_0x59563a,_0x574549)[_0xc202('0xb')](function(_0x36fcb7){logger[_0xc202('0xc')](_0xc202('0xd'),_0xc2b3eb,_0xc202('0xe'));logger[_0xc202('0xf')](_0xc202('0x10'),_0xc2b3eb,_0xc202('0xe'),JSON[_0xc202('0x11')](_0x36fcb7));if(_0x36fcb7[_0xc202('0x12')]){if(_0x36fcb7['error'][_0xc202('0x13')]===0x1f4){logger[_0xc202('0x12')](_0xc202('0xd'),_0xc2b3eb,_0x36fcb7[_0xc202('0x12')][_0xc202('0x14')]);return _0x5978fe(_0x36fcb7[_0xc202('0x12')][_0xc202('0x14')]);}logger['error'](_0xc202('0xd'),_0xc2b3eb,_0x36fcb7[_0xc202('0x12')]['message']);return _0x872c1a(_0x36fcb7['error']['message']);}else{logger[_0xc202('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0xc2b3eb,_0xc202('0xe'));_0x872c1a(_0x36fcb7['result'][_0xc202('0x14')]);}})[_0xc202('0x15')](function(_0x3018c8){logger[_0xc202('0x12')](_0xc202('0xd'),_0xc2b3eb,_0x3018c8);_0x5978fe(_0x3018c8);});});} \ No newline at end of file +var _0x121d=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','SmsTransferReport,\x20%s,\x20%s','message','info','result','catch'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x121d,0xea));var _0xd121=function(_0x32894e,_0x131a45){_0x32894e=_0x32894e-0x0;var _0x264937=_0x121d[_0x32894e];return _0x264937;};'use strict';var _=require(_0xd121('0x0'));var util=require(_0xd121('0x1'));var moment=require(_0xd121('0x2'));var BPromise=require(_0xd121('0x3'));var rs=require(_0xd121('0x4'));var fs=require('fs');var Redis=require(_0xd121('0x5'));var db=require(_0xd121('0x6'))['db'];var utils=require(_0xd121('0x7'));var logger=require(_0xd121('0x8'))(_0xd121('0x9'));var config=require(_0xd121('0xa'));var jayson=require(_0xd121('0xb'));var client=jayson[_0xd121('0xc')][_0xd121('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x540cf2,_0x517982,_0x5b67f7){return new BPromise(function(_0x1da01c,_0x4947ff){return client[_0xd121('0xe')](_0x540cf2,_0x5b67f7)[_0xd121('0xf')](function(_0x4d966f){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x517982,_0xd121('0x10'));logger[_0xd121('0x11')](_0xd121('0x12'),_0x517982,_0xd121('0x10'),JSON[_0xd121('0x13')](_0x4d966f));if(_0x4d966f[_0xd121('0x14')]){if(_0x4d966f[_0xd121('0x14')]['code']===0x1f4){logger[_0xd121('0x14')](_0xd121('0x15'),_0x517982,_0x4d966f['error'][_0xd121('0x16')]);return _0x4947ff(_0x4d966f[_0xd121('0x14')][_0xd121('0x16')]);}logger[_0xd121('0x14')]('SmsTransferReport,\x20%s,\x20%s',_0x517982,_0x4d966f[_0xd121('0x14')][_0xd121('0x16')]);return _0x1da01c(_0x4d966f[_0xd121('0x14')]['message']);}else{logger[_0xd121('0x17')](_0xd121('0x15'),_0x517982,'request\x20sent');_0x1da01c(_0x4d966f[_0xd121('0x18')]['message']);}})[_0xd121('0x19')](function(_0x3d4c64){logger[_0xd121('0x14')](_0xd121('0x15'),_0x517982,_0x3d4c64);_0x4947ff(_0x3d4c64);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index c06d661..46c8726 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 _0xb4ea=['now','post','file','create','put','delete','exports','util','path','Router','fs-extra','../../config/environment','./sound.controller','get','/:id','isAuthenticated','show','/:id/download','download','join','root','originalname','format','%s-%s%s','basename','extname'];(function(_0x4ab746,_0x4994e4){var _0x5dc590=function(_0x3173d5){while(--_0x3173d5){_0x4ab746['push'](_0x4ab746['shift']());}};_0x5dc590(++_0x4994e4);}(_0xb4ea,0x125));var _0xab4e=function(_0x3287c1,_0x410556){_0x3287c1=_0x3287c1-0x0;var _0x150646=_0xb4ea[_0x3287c1];return _0x150646;};'use strict';var multer=require('multer');var util=require(_0xab4e('0x0'));var path=require(_0xab4e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xab4e('0x2')]();var fs_extra=require(_0xab4e('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xab4e('0x4'));var controller=require(_0xab4e('0x5'));router[_0xab4e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xab4e('0x6')](_0xab4e('0x7'),auth[_0xab4e('0x8')](),controller[_0xab4e('0x9')]);router['get'](_0xab4e('0xa'),auth[_0xab4e('0x8')](),controller[_0xab4e('0xb')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x40779d,_0x4279c1,_0x593907){_0x593907(null,path[_0xab4e('0xc')](config[_0xab4e('0xd')],'server/files/sounds/original/'));},'filename':function(_0x1bdbb5,_0x57ae6a,_0x2c2a1e){_0x57ae6a[_0xab4e('0xe')]=_0x57ae6a[_0xab4e('0xe')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2c2a1e(null,util[_0xab4e('0xf')](_0xab4e('0x10'),path[_0xab4e('0x11')](_0x57ae6a[_0xab4e('0xe')],path[_0xab4e('0x12')](_0x57ae6a['originalname'])),Date[_0xab4e('0x13')](),path[_0xab4e('0x12')](_0x57ae6a[_0xab4e('0xe')])));}})});router[_0xab4e('0x14')]('/',upload['single'](_0xab4e('0x15')),controller[_0xab4e('0x16')]);router[_0xab4e('0x17')](_0xab4e('0x7'),auth['isAuthenticated'](),controller['update']);router[_0xab4e('0x18')](_0xab4e('0x7'),auth[_0xab4e('0x8')](),controller[_0xab4e('0x18')]);module[_0xab4e('0x19')]=router; \ No newline at end of file +var _0x2860=['diskStorage','join','root','originalname','format','%s-%s%s','basename','extname','now','post','file','update','delete','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','download'];(function(_0x2acb57,_0x470c66){var _0x3d2f00=function(_0x3220e9){while(--_0x3220e9){_0x2acb57['push'](_0x2acb57['shift']());}};_0x3d2f00(++_0x470c66);}(_0x2860,0x15d));var _0x0286=function(_0x3ae00b,_0x260102){_0x3ae00b=_0x3ae00b-0x0;var _0x396e24=_0x2860[_0x3ae00b];return _0x396e24;};'use strict';var multer=require(_0x0286('0x0'));var util=require(_0x0286('0x1'));var path=require(_0x0286('0x2'));var timeout=require(_0x0286('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0286('0x4'));var auth=require(_0x0286('0x5'));var interaction=require(_0x0286('0x6'));var config=require(_0x0286('0x7'));var controller=require(_0x0286('0x8'));router[_0x0286('0x9')]('/',auth[_0x0286('0xa')](),controller[_0x0286('0xb')]);router[_0x0286('0x9')](_0x0286('0xc'),auth['isAuthenticated'](),controller[_0x0286('0xd')]);router[_0x0286('0x9')]('/:id/download',auth[_0x0286('0xa')](),controller[_0x0286('0xe')]);var upload=multer({'storage':multer[_0x0286('0xf')]({'destination':function(_0x10b0a3,_0x4dc745,_0xc080d8){_0xc080d8(null,path[_0x0286('0x10')](config[_0x0286('0x11')],'server/files/sounds/original/'));},'filename':function(_0x51b54e,_0x415bc0,_0x539f05){_0x415bc0[_0x0286('0x12')]=_0x415bc0['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x539f05(null,util[_0x0286('0x13')](_0x0286('0x14'),path[_0x0286('0x15')](_0x415bc0[_0x0286('0x12')],path[_0x0286('0x16')](_0x415bc0[_0x0286('0x12')])),Date[_0x0286('0x17')](),path[_0x0286('0x16')](_0x415bc0[_0x0286('0x12')])));}})});router[_0x0286('0x18')]('/',upload['single'](_0x0286('0x19')),controller['create']);router['put'](_0x0286('0xc'),auth[_0x0286('0xa')](),controller[_0x0286('0x1a')]);router['delete']('/:id',auth[_0x0286('0xa')](),controller[_0x0286('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 710ba3d..1dc6201 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 _0x5391=['name','FLOAT','INTEGER','BIGINT','sequelize','exports','STRING'];(function(_0x12b83d,_0x4bcec7){var _0x1fd39d=function(_0x449185){while(--_0x449185){_0x12b83d['push'](_0x12b83d['shift']());}};_0x1fd39d(++_0x4bcec7);}(_0x5391,0x11c));var _0x1539=function(_0x1b6d13,_0x36311b){_0x1b6d13=_0x1b6d13-0x0;var _0x4fd949=_0x5391[_0x1b6d13];return _0x4fd949;};'use strict';var Sequelize=require(_0x1539('0x0'));module[_0x1539('0x1')]={'name':{'type':Sequelize[_0x1539('0x2')],'unique':_0x1539('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x1539('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x1539('0x2')]},'original_duration':{'type':Sequelize[_0x1539('0x4')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x1539('0x5')]},'original_bitRate':{'type':Sequelize[_0x1539('0x6')]},'original_sampleRate':{'type':Sequelize[_0x1539('0x5')]},'converted_format':{'type':Sequelize[_0x1539('0x2')]},'converted_duration':{'type':Sequelize[_0x1539('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x1539('0x6')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x1539('0x6')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x062f=['STRING','FLOAT','INTEGER','BIGINT','sequelize'];(function(_0x1e32ba,_0x3c8ce3){var _0x38ac18=function(_0x41a065){while(--_0x41a065){_0x1e32ba['push'](_0x1e32ba['shift']());}};_0x38ac18(++_0x3c8ce3);}(_0x062f,0x1ad));var _0xf062=function(_0x55b86a,_0x9f9772){_0x55b86a=_0x55b86a-0x0;var _0x46f950=_0x062f[_0x55b86a];return _0x46f950;};'use strict';var Sequelize=require(_0xf062('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xf062('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xf062('0x1')]},'original_duration':{'type':Sequelize[_0xf062('0x2')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xf062('0x3')]},'original_bitRate':{'type':Sequelize[_0xf062('0x4')]},'original_sampleRate':{'type':Sequelize[_0xf062('0x3')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xf062('0x4')]},'converted_channelCount':{'type':Sequelize[_0xf062('0x3')]},'converted_bitRate':{'type':Sequelize[_0xf062('0x4')]},'converted_sampleRate':{'type':Sequelize[_0xf062('0x3')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 38abb6d..e74b732 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 _0xda68=['squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','get','Sounds','UserProfileResource','error','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','Sound','includeAll','include','findAll','rows','show','options','catch','params','save_name','converted_format','existsSync','join','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','download','root','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','chmodSync','transcode','src','duration','original_sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','sampleCount','converted_channelCount','converted_bitRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','unlinkSync','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x530e42,_0xfd9ef1){var _0x5ee62c=function(_0x247322){while(--_0x247322){_0x530e42['push'](_0x530e42['shift']());}};_0x5ee62c(++_0xfd9ef1);}(_0xda68,0x1e7));var _0x8da6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xda68[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x8da6('0x0'));var rimraf=require(_0x8da6('0x1'));var zipdir=require(_0x8da6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8da6('0x3'));var moment=require('moment');var BPromise=require(_0x8da6('0x4'));var Mustache=require(_0x8da6('0x5'));var util=require(_0x8da6('0x6'));var path=require(_0x8da6('0x7'));var sox=require(_0x8da6('0x8'));var csv=require(_0x8da6('0x9'));var ejs=require(_0x8da6('0xa'));var fs=require('fs');var fs_extra=require(_0x8da6('0xb'));var _=require(_0x8da6('0xc'));var squel=require(_0x8da6('0xd'));var crypto=require('crypto');var jsforce=require(_0x8da6('0xe'));var deskjs=require(_0x8da6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8da6('0x10'));var Papa=require(_0x8da6('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8da6('0x12'));var as=require(_0x8da6('0x13'));var hardwareService=require(_0x8da6('0x14'));var logger=require('../../config/logger')(_0x8da6('0x15'));var utils=require('../../config/utils');var config=require(_0x8da6('0x16'));var licenseUtil=require(_0x8da6('0x17'));var db=require(_0x8da6('0x18'))['db'];function respondWithStatusCode(_0x503fba,_0x11ba40){_0x11ba40=_0x11ba40||0xcc;return function(_0x4d5569){if(_0x4d5569){return _0x503fba[_0x8da6('0x19')](_0x11ba40);}return _0x503fba[_0x8da6('0x1a')](_0x11ba40)[_0x8da6('0x1b')]();};}function respondWithResult(_0x5a1813,_0x40bc1c){_0x40bc1c=_0x40bc1c||0xc8;return function(_0x9665b4){if(_0x9665b4){return _0x5a1813[_0x8da6('0x1a')](_0x40bc1c)[_0x8da6('0x1c')](_0x9665b4);}};}function respondWithFilteredResult(_0x369651,_0x14bcb4){return function(_0x37bd53){if(_0x37bd53){var _0x3ddfa1=typeof _0x14bcb4[_0x8da6('0x1d')]===_0x8da6('0x1e')&&typeof _0x14bcb4[_0x8da6('0x1f')]===_0x8da6('0x1e');var _0x40fde4=_0x37bd53['count'];var _0x192769=_0x3ddfa1?0x0:_0x14bcb4[_0x8da6('0x1d')];var _0x20e141=_0x3ddfa1?_0x37bd53[_0x8da6('0x20')]:_0x14bcb4[_0x8da6('0x1d')]+_0x14bcb4['limit'];var _0xdd1780;if(_0x20e141>=_0x40fde4){_0x20e141=_0x40fde4;_0xdd1780=0xc8;}else{_0xdd1780=0xce;}_0x369651[_0x8da6('0x1a')](_0xdd1780);return _0x369651[_0x8da6('0x21')]('Content-Range',_0x192769+'-'+_0x20e141+'/'+_0x40fde4)['json'](_0x37bd53);}return null;};}function patchUpdates(_0xfbf92a){return function(_0x4f5051){try{jsonpatch['apply'](_0x4f5051,_0xfbf92a,!![]);}catch(_0x2c13ed){return BPromise[_0x8da6('0x22')](_0x2c13ed);}return _0x4f5051[_0x8da6('0x23')]();};}function saveUpdates(_0x415db9,_0x586663){return function(_0x50ab29){if(_0x50ab29){return _0x50ab29[_0x8da6('0x24')](_0x415db9)[_0x8da6('0x25')](function(_0x332a9c){return _0x332a9c;});}return null;};}function removeEntity(_0x23b675,_0x22fe29){return function(_0x5550b8){if(_0x5550b8){return _0x5550b8[_0x8da6('0x26')]()['then'](function(){var _0x1900a8=_0x5550b8[_0x8da6('0x27')]({'plain':!![]});var _0x17d5b1=_0x8da6('0x28');return db[_0x8da6('0x29')][_0x8da6('0x26')]({'where':{'type':_0x17d5b1,'resourceId':_0x1900a8['id']}})['then'](function(){return _0x5550b8;});})[_0x8da6('0x25')](function(){_0x23b675[_0x8da6('0x1a')](0xcc)[_0x8da6('0x1b')]();});}};}function handleEntityNotFound(_0x20f0f1,_0x190149){return function(_0x290820){if(!_0x290820){_0x20f0f1['sendStatus'](0x194);}return _0x290820;};}function handleError(_0x3bb915,_0x252521){_0x252521=_0x252521||0x1f4;return function(_0x315ac2){logger[_0x8da6('0x2a')](_0x315ac2['stack']);if(_0x315ac2['name']){delete _0x315ac2[_0x8da6('0x2b')];}_0x3bb915['status'](_0x252521)[_0x8da6('0x2c')](_0x315ac2);};}exports[_0x8da6('0x2d')]=function(_0xc53793,_0x5a6cea){var _0x9e5aa6={},_0x5b6475={},_0xcaa18={'count':0x0,'rows':[]};var _0x1e8351=_['map'](db['Sound'][_0x8da6('0x2e')],function(_0x863527){return{'name':_0x863527[_0x8da6('0x2f')],'type':_0x863527[_0x8da6('0x30')]['key']};});_0x5b6475[_0x8da6('0x31')]=_[_0x8da6('0x32')](_0x1e8351,_0x8da6('0x2b'));_0x5b6475[_0x8da6('0x33')]=_[_0x8da6('0x34')](_0xc53793['query']);_0x5b6475[_0x8da6('0x35')]=_['intersection'](_0x5b6475[_0x8da6('0x31')],_0x5b6475[_0x8da6('0x33')]);_0x9e5aa6[_0x8da6('0x36')]=_[_0x8da6('0x37')](_0x5b6475[_0x8da6('0x31')],qs['fields'](_0xc53793[_0x8da6('0x33')][_0x8da6('0x38')]));_0x9e5aa6[_0x8da6('0x36')]=_0x9e5aa6['attributes']['length']?_0x9e5aa6[_0x8da6('0x36')]:_0x5b6475['model'];if(!_0xc53793[_0x8da6('0x33')][_0x8da6('0x39')](_0x8da6('0x3a'))){_0x9e5aa6[_0x8da6('0x1f')]=qs['limit'](_0xc53793[_0x8da6('0x33')]['limit']);_0x9e5aa6[_0x8da6('0x1d')]=qs[_0x8da6('0x1d')](_0xc53793[_0x8da6('0x33')][_0x8da6('0x1d')]);}_0x9e5aa6[_0x8da6('0x3b')]=qs['sort'](_0xc53793[_0x8da6('0x33')][_0x8da6('0x3c')]);_0x9e5aa6[_0x8da6('0x3d')]=qs[_0x8da6('0x35')](_[_0x8da6('0x3e')](_0xc53793[_0x8da6('0x33')],_0x5b6475[_0x8da6('0x35')]),_0x1e8351);if(_0xc53793[_0x8da6('0x33')][_0x8da6('0x3f')]){_0x9e5aa6[_0x8da6('0x3d')]=_[_0x8da6('0x40')](_0x9e5aa6[_0x8da6('0x3d')],{'$or':_[_0x8da6('0x32')](_0x1e8351,function(_0xa3b02a){if(_0xa3b02a[_0x8da6('0x30')]!==_0x8da6('0x41')){var _0x15cf90={};_0x15cf90[_0xa3b02a['name']]={'$like':'%'+_0xc53793[_0x8da6('0x33')][_0x8da6('0x3f')]+'%'};return _0x15cf90;}})});}_0x9e5aa6=_['merge']({},_0x9e5aa6,_0xc53793['options']);var _0x2f441f={'where':_0x9e5aa6['where']};return db[_0x8da6('0x42')][_0x8da6('0x20')](_0x2f441f)[_0x8da6('0x25')](function(_0x155d54){_0xcaa18[_0x8da6('0x20')]=_0x155d54;if(_0xc53793['query'][_0x8da6('0x43')]){_0x9e5aa6[_0x8da6('0x44')]=[{'all':!![]}];}return db['Sound'][_0x8da6('0x45')](_0x9e5aa6);})['then'](function(_0x2b47f7){_0xcaa18[_0x8da6('0x46')]=_0x2b47f7;return _0xcaa18;})[_0x8da6('0x25')](respondWithFilteredResult(_0x5a6cea,_0x9e5aa6))['catch'](handleError(_0x5a6cea,null));};exports[_0x8da6('0x47')]=function(_0x4d0985,_0x510678){var _0xee58d={'raw':!![],'where':{'id':_0x4d0985['params']['id']}},_0x4d6bfb={};_0x4d6bfb[_0x8da6('0x31')]=_[_0x8da6('0x34')](db[_0x8da6('0x42')][_0x8da6('0x2e')]);_0x4d6bfb[_0x8da6('0x33')]=_[_0x8da6('0x34')](_0x4d0985[_0x8da6('0x33')]);_0x4d6bfb[_0x8da6('0x35')]=_[_0x8da6('0x37')](_0x4d6bfb[_0x8da6('0x31')],_0x4d6bfb[_0x8da6('0x33')]);_0xee58d[_0x8da6('0x36')]=_[_0x8da6('0x37')](_0x4d6bfb[_0x8da6('0x31')],qs[_0x8da6('0x38')](_0x4d0985['query']['fields']));_0xee58d[_0x8da6('0x36')]=_0xee58d[_0x8da6('0x36')]['length']?_0xee58d['attributes']:_0x4d6bfb['model'];if(_0x4d0985[_0x8da6('0x33')]['includeAll']){_0xee58d['include']=[{'all':!![]}];}_0xee58d=_['merge']({},_0xee58d,_0x4d0985[_0x8da6('0x48')]);return db[_0x8da6('0x42')]['find'](_0xee58d)[_0x8da6('0x25')](handleEntityNotFound(_0x510678,null))[_0x8da6('0x25')](respondWithResult(_0x510678,null))[_0x8da6('0x49')](handleError(_0x510678,null));};exports['download']=function(_0x4584a8,_0x521ee6,_0x166f93){return db[_0x8da6('0x42')]['find']({'where':{'id':_0x4584a8[_0x8da6('0x4a')]['id']},'attributes':[_0x8da6('0x2b'),_0x8da6('0x4b'),_0x8da6('0x4c')],'raw':!![]})[_0x8da6('0x25')](handleEntityNotFound(_0x521ee6,null))['then'](function(_0x24ccfb){if(_0x24ccfb){if(!fs[_0x8da6('0x4d')](path[_0x8da6('0x4e')](config['root'],_0x8da6('0x4f'),_0x24ccfb[_0x8da6('0x4b')]+'.'+_0x24ccfb[_0x8da6('0x4c')]))){throw new db[(_0x8da6('0x50'))][(_0x8da6('0x51'))](_0x8da6('0x52'));}return _0x521ee6[_0x8da6('0x53')](path[_0x8da6('0x4e')](config[_0x8da6('0x54')],_0x8da6('0x4f'),util[_0x8da6('0x55')](_0x8da6('0x56'),_0x24ccfb[_0x8da6('0x4b')],_0x24ccfb['converted_format'])),util[_0x8da6('0x55')](_0x8da6('0x56'),_0x24ccfb['name'],_0x24ccfb[_0x8da6('0x4c')]));}return null;})[_0x8da6('0x49')](handleError(_0x521ee6,null));};exports[_0x8da6('0x57')]=function(_0x233f89,_0x2595e8,_0x35d42b){var _0x3d821a={'name':path[_0x8da6('0x58')](_0x233f89[_0x8da6('0x59')][_0x8da6('0x5a')],path[_0x8da6('0x5b')](_0x233f89[_0x8da6('0x59')][_0x8da6('0x5a')])),'save_name':path[_0x8da6('0x58')](_0x233f89[_0x8da6('0x59')][_0x8da6('0x5c')],path[_0x8da6('0x5b')](_0x233f89[_0x8da6('0x59')][_0x8da6('0x5c')])),'original_format':path[_0x8da6('0x5b')](_0x233f89['file'][_0x8da6('0x5a')])[_0x8da6('0x5d')](0x1),'converted_format':_0x8da6('0x5e')};var _0x16d0f7=path['join'](config[_0x8da6('0x54')],_0x8da6('0x5f'),_0x233f89[_0x8da6('0x59')][_0x8da6('0x5c')]);var _0x279751=path['join'](config[_0x8da6('0x54')],_0x8da6('0x4f'),util[_0x8da6('0x55')](_0x8da6('0x56'),path[_0x8da6('0x58')](_0x233f89['file']['filename'],path['extname'](_0x233f89['file'][_0x8da6('0x5c')])),_0x3d821a[_0x8da6('0x4c')]));logger[_0x8da6('0x60')]('Sound\x20upload\x20filepath:\x20%s',_0x16d0f7);logger[_0x8da6('0x60')]('Sound\x20upload\x20destination:\x20%s',_0x279751);try{fs[_0x8da6('0x61')](_0x16d0f7,parseInt('0777',0x8));var _0x3465f6=sox[_0x8da6('0x62')](_0x16d0f7,_0x279751,{'sampleRate':0x1f40,'format':_0x8da6('0x5e'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3465f6['on'](_0x8da6('0x2a'),function(_0x4c448d){fs['unlinkSync'](_0x16d0f7);_0x2595e8['status'](0x1f4)[_0x8da6('0x2c')](_0x4c448d);});_0x3465f6['on'](_0x8da6('0x63'),function(_0x5e80ed){_0x3d821a['original_duration']=isNaN(_0x5e80ed[_0x8da6('0x64')])?null:_0x5e80ed[_0x8da6('0x64')]*0x3e8;_0x3d821a[_0x8da6('0x65')]=isNaN(_0x5e80ed['sampleCount'])?null:_0x5e80ed['sampleCount'];_0x3d821a['original_channelCount']=isNaN(_0x5e80ed['channelCount'])?null:_0x5e80ed[_0x8da6('0x66')];_0x3d821a[_0x8da6('0x67')]=isNaN(_0x5e80ed['bitRate'])?null:_0x5e80ed[_0x8da6('0x68')];_0x3d821a[_0x8da6('0x69')]=isNaN(_0x5e80ed[_0x8da6('0x6a')])?null:_0x5e80ed[_0x8da6('0x6a')];});_0x3465f6['on'](_0x8da6('0x6b'),function(_0x1ace9d){_0x3d821a['converted_duration']=isNaN(_0x1ace9d['duration'])?null:_0x1ace9d['duration']*0x3e8;_0x3d821a[_0x8da6('0x6c')]=isNaN(_0x1ace9d[_0x8da6('0x6d')])?null:_0x1ace9d[_0x8da6('0x6d')];_0x3d821a[_0x8da6('0x6e')]=isNaN(_0x1ace9d[_0x8da6('0x66')])?null:_0x1ace9d['channelCount'];_0x3d821a[_0x8da6('0x6f')]=isNaN(_0x1ace9d[_0x8da6('0x68')])?null:_0x1ace9d[_0x8da6('0x68')];_0x3d821a['converted_sampleRate']=isNaN(_0x1ace9d[_0x8da6('0x6a')])?null:_0x1ace9d[_0x8da6('0x6a')];});_0x3465f6['on'](_0x8da6('0x1b'),function(){fs[_0x8da6('0x61')](_0x279751,parseInt('0777',0x8));return db[_0x8da6('0x42')][_0x8da6('0x57')](_0x3d821a)[_0x8da6('0x25')](function(_0x1ebe0c){var _0x6f7e26={'role':_0x233f89[_0x8da6('0x70')][_0x8da6('0x71')],'userProfileId':_0x233f89[_0x8da6('0x70')][_0x8da6('0x72')]};if(!_0x6f7e26)throw new Error(_0x8da6('0x73'));if(_0x6f7e26[_0x8da6('0x71')]===_0x8da6('0x74')){var _0x4c7dd7=_0x1ebe0c[_0x8da6('0x27')]({'plain':!![]});return db[_0x8da6('0x75')][_0x8da6('0x76')]({'where':{'name':_0x8da6('0x28'),'userProfileId':_0x6f7e26[_0x8da6('0x72')]},'raw':!![]})[_0x8da6('0x25')](function(_0xb182ca){if(_0xb182ca&&_0xb182ca[_0x8da6('0x77')]===0x0){return db['UserProfileResource'][_0x8da6('0x57')]({'name':_0x4c7dd7[_0x8da6('0x2b')],'resourceId':_0x4c7dd7['id'],'type':_0xb182ca[_0x8da6('0x2b')],'sectionId':_0xb182ca['id']},{})['then'](function(){return _0x1ebe0c;});}else{return _0x1ebe0c;}})[_0x8da6('0x49')](function(_0x470814){logger[_0x8da6('0x2a')](_0x8da6('0x78'),_0x470814);throw _0x470814;});}return _0x1ebe0c;})[_0x8da6('0x25')](respondWithResult(_0x2595e8,null))[_0x8da6('0x49')](handleError(_0x2595e8,null));});_0x3465f6[_0x8da6('0x79')]();}catch(_0x15bd42){_0x2595e8['status'](0x1f4)[_0x8da6('0x2c')](_0x15bd42);}};exports[_0x8da6('0x24')]=function(_0x9c71b,_0x40d702,_0x559fd7){return db['Sound'][_0x8da6('0x76')]({'where':{'id':_0x9c71b[_0x8da6('0x4a')]['id']}})[_0x8da6('0x25')](handleEntityNotFound(_0x40d702,null))[_0x8da6('0x25')](saveUpdates(_[_0x8da6('0x3e')](_0x9c71b['body'],[_0x8da6('0x2b'),_0x8da6('0x7a')]),null))[_0x8da6('0x25')](respondWithResult(_0x40d702,null))['catch'](handleError(_0x40d702,null));};exports[_0x8da6('0x7b')]=function(_0x395527,_0x4a411d,_0x12b227){return db['Sound'][_0x8da6('0x76')]({'where':{'id':_0x395527[_0x8da6('0x4a')]['id']}})[_0x8da6('0x25')](function(_0x111b08){if(_0x111b08){return _0x111b08[_0x8da6('0x26')]();}})[_0x8da6('0x25')](function(_0x252fce){var _0x297516=path[_0x8da6('0x4e')](config[_0x8da6('0x54')],'server/files/sounds/original',util['format'](_0x8da6('0x56'),_0x252fce[_0x8da6('0x4b')],_0x252fce['original_format']));var _0x2d9ab9=path[_0x8da6('0x4e')](config[_0x8da6('0x54')],_0x8da6('0x4f'),util['format'](_0x8da6('0x56'),_0x252fce[_0x8da6('0x4b')],_0x252fce['converted_format']));fs[_0x8da6('0x7c')](_0x297516);fs[_0x8da6('0x7c')](_0x2d9ab9);return _0x252fce;})[_0x8da6('0x25')](function(_0x25e2b6){if(_0x25e2b6){return _0x4a411d[_0x8da6('0x1a')](0xcc)['end']();}})['then'](handleEntityNotFound(_0x4a411d,null))[_0x8da6('0x49')](handleError(_0x4a411d,null));}; \ No newline at end of file +var _0xa468=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','count','set','json','apply','reject','save','destroy','then','get','Sounds','UserProfileResource','sendStatus','error','name','send','index','map','Sound','rawAttributes','fieldName','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','fields','includeAll','find','download','save_name','converted_format','join','root','server/files/sounds/converted','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','file','extname','filename','originalname','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','description','delete','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x1e46c7,_0x4a6480){var _0x231115=function(_0x466bcc){while(--_0x466bcc){_0x1e46c7['push'](_0x1e46c7['shift']());}};_0x231115(++_0x4a6480);}(_0xa468,0x16c));var _0x8a46=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa468[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x8a46('0x0'));var rimraf=require(_0x8a46('0x1'));var zipdir=require(_0x8a46('0x2'));var jsonpatch=require(_0x8a46('0x3'));var rp=require(_0x8a46('0x4'));var moment=require(_0x8a46('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8a46('0x6'));var util=require(_0x8a46('0x7'));var path=require(_0x8a46('0x8'));var sox=require(_0x8a46('0x9'));var csv=require('to-csv');var ejs=require(_0x8a46('0xa'));var fs=require('fs');var fs_extra=require(_0x8a46('0xb'));var _=require(_0x8a46('0xc'));var squel=require('squel');var crypto=require(_0x8a46('0xd'));var jsforce=require(_0x8a46('0xe'));var deskjs=require(_0x8a46('0xf'));var toCsv=require(_0x8a46('0x10'));var querystring=require(_0x8a46('0x11'));var Papa=require(_0x8a46('0x12'));var Redis=require(_0x8a46('0x13'));var authService=require(_0x8a46('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x8a46('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a46('0x16'))(_0x8a46('0x17'));var utils=require(_0x8a46('0x18'));var config=require(_0x8a46('0x19'));var licenseUtil=require(_0x8a46('0x1a'));var db=require(_0x8a46('0x1b'))['db'];function respondWithStatusCode(_0x5777c7,_0x466a99){_0x466a99=_0x466a99||0xcc;return function(_0x524812){if(_0x524812){return _0x5777c7['sendStatus'](_0x466a99);}return _0x5777c7[_0x8a46('0x1c')](_0x466a99)[_0x8a46('0x1d')]();};}function respondWithResult(_0x1f1d7a,_0x32b7ac){_0x32b7ac=_0x32b7ac||0xc8;return function(_0x1b1b99){if(_0x1b1b99){return _0x1f1d7a[_0x8a46('0x1c')](_0x32b7ac)['json'](_0x1b1b99);}};}function respondWithFilteredResult(_0x1ce453,_0x2723e3){return function(_0x2a04df){if(_0x2a04df){var _0x4e6a3c=typeof _0x2723e3[_0x8a46('0x1e')]==='undefined'&&typeof _0x2723e3[_0x8a46('0x1f')]==='undefined';var _0x4d3f89=_0x2a04df[_0x8a46('0x20')];var _0x4b72f9=_0x4e6a3c?0x0:_0x2723e3['offset'];var _0x322493=_0x4e6a3c?_0x2a04df['count']:_0x2723e3['offset']+_0x2723e3['limit'];var _0x3fbce5;if(_0x322493>=_0x4d3f89){_0x322493=_0x4d3f89;_0x3fbce5=0xc8;}else{_0x3fbce5=0xce;}_0x1ce453[_0x8a46('0x1c')](_0x3fbce5);return _0x1ce453[_0x8a46('0x21')]('Content-Range',_0x4b72f9+'-'+_0x322493+'/'+_0x4d3f89)[_0x8a46('0x22')](_0x2a04df);}return null;};}function patchUpdates(_0x173218){return function(_0x55b001){try{jsonpatch[_0x8a46('0x23')](_0x55b001,_0x173218,!![]);}catch(_0x59e316){return BPromise[_0x8a46('0x24')](_0x59e316);}return _0x55b001[_0x8a46('0x25')]();};}function saveUpdates(_0x5844e2,_0x11f9bd){return function(_0x11ed46){if(_0x11ed46){return _0x11ed46['update'](_0x5844e2)['then'](function(_0x203183){return _0x203183;});}return null;};}function removeEntity(_0x3e9fbd,_0x22d9d5){return function(_0x54486e){if(_0x54486e){return _0x54486e[_0x8a46('0x26')]()[_0x8a46('0x27')](function(){var _0x8a2710=_0x54486e[_0x8a46('0x28')]({'plain':!![]});var _0x417a68=_0x8a46('0x29');return db[_0x8a46('0x2a')][_0x8a46('0x26')]({'where':{'type':_0x417a68,'resourceId':_0x8a2710['id']}})['then'](function(){return _0x54486e;});})[_0x8a46('0x27')](function(){_0x3e9fbd[_0x8a46('0x1c')](0xcc)[_0x8a46('0x1d')]();});}};}function handleEntityNotFound(_0x4f0558,_0x4f3803){return function(_0x1c6e53){if(!_0x1c6e53){_0x4f0558[_0x8a46('0x2b')](0x194);}return _0x1c6e53;};}function handleError(_0x5e8479,_0x270cae){_0x270cae=_0x270cae||0x1f4;return function(_0x9c0ac){logger[_0x8a46('0x2c')](_0x9c0ac['stack']);if(_0x9c0ac[_0x8a46('0x2d')]){delete _0x9c0ac[_0x8a46('0x2d')];}_0x5e8479[_0x8a46('0x1c')](_0x270cae)[_0x8a46('0x2e')](_0x9c0ac);};}exports[_0x8a46('0x2f')]=function(_0x3554d0,_0x4c4b36){var _0x450add={},_0x6f402e={},_0xc81609={'count':0x0,'rows':[]};var _0x4974ee=_[_0x8a46('0x30')](db[_0x8a46('0x31')][_0x8a46('0x32')],function(_0x2c4b9a){return{'name':_0x2c4b9a[_0x8a46('0x33')],'type':_0x2c4b9a['type']['key']};});_0x6f402e[_0x8a46('0x34')]=_[_0x8a46('0x30')](_0x4974ee,'name');_0x6f402e[_0x8a46('0x35')]=_['keys'](_0x3554d0['query']);_0x6f402e[_0x8a46('0x36')]=_[_0x8a46('0x37')](_0x6f402e[_0x8a46('0x34')],_0x6f402e[_0x8a46('0x35')]);_0x450add['attributes']=_[_0x8a46('0x37')](_0x6f402e[_0x8a46('0x34')],qs['fields'](_0x3554d0['query']['fields']));_0x450add[_0x8a46('0x38')]=_0x450add[_0x8a46('0x38')][_0x8a46('0x39')]?_0x450add[_0x8a46('0x38')]:_0x6f402e[_0x8a46('0x34')];if(!_0x3554d0[_0x8a46('0x35')][_0x8a46('0x3a')](_0x8a46('0x3b'))){_0x450add[_0x8a46('0x1f')]=qs[_0x8a46('0x1f')](_0x3554d0[_0x8a46('0x35')][_0x8a46('0x1f')]);_0x450add[_0x8a46('0x1e')]=qs[_0x8a46('0x1e')](_0x3554d0['query'][_0x8a46('0x1e')]);}_0x450add[_0x8a46('0x3c')]=qs['sort'](_0x3554d0[_0x8a46('0x35')][_0x8a46('0x3d')]);_0x450add[_0x8a46('0x3e')]=qs['filters'](_[_0x8a46('0x3f')](_0x3554d0[_0x8a46('0x35')],_0x6f402e[_0x8a46('0x36')]),_0x4974ee);if(_0x3554d0[_0x8a46('0x35')][_0x8a46('0x40')]){_0x450add[_0x8a46('0x3e')]=_[_0x8a46('0x41')](_0x450add['where'],{'$or':_[_0x8a46('0x30')](_0x4974ee,function(_0x575b6d){if(_0x575b6d[_0x8a46('0x42')]!==_0x8a46('0x43')){var _0x3d1c3f={};_0x3d1c3f[_0x575b6d['name']]={'$like':'%'+_0x3554d0[_0x8a46('0x35')]['filter']+'%'};return _0x3d1c3f;}})});}_0x450add=_[_0x8a46('0x41')]({},_0x450add,_0x3554d0[_0x8a46('0x44')]);var _0xd1c582={'where':_0x450add[_0x8a46('0x3e')]};return db[_0x8a46('0x31')][_0x8a46('0x20')](_0xd1c582)[_0x8a46('0x27')](function(_0x542ee7){_0xc81609[_0x8a46('0x20')]=_0x542ee7;if(_0x3554d0[_0x8a46('0x35')]['includeAll']){_0x450add[_0x8a46('0x45')]=[{'all':!![]}];}return db['Sound'][_0x8a46('0x46')](_0x450add);})[_0x8a46('0x27')](function(_0x5b7cef){_0xc81609[_0x8a46('0x47')]=_0x5b7cef;return _0xc81609;})['then'](respondWithFilteredResult(_0x4c4b36,_0x450add))[_0x8a46('0x48')](handleError(_0x4c4b36,null));};exports[_0x8a46('0x49')]=function(_0x43a447,_0x4d5076){var _0x3fdf61={'raw':!![],'where':{'id':_0x43a447[_0x8a46('0x4a')]['id']}},_0x5eaba5={};_0x5eaba5[_0x8a46('0x34')]=_[_0x8a46('0x4b')](db['Sound'][_0x8a46('0x32')]);_0x5eaba5[_0x8a46('0x35')]=_[_0x8a46('0x4b')](_0x43a447[_0x8a46('0x35')]);_0x5eaba5[_0x8a46('0x36')]=_[_0x8a46('0x37')](_0x5eaba5[_0x8a46('0x34')],_0x5eaba5[_0x8a46('0x35')]);_0x3fdf61['attributes']=_[_0x8a46('0x37')](_0x5eaba5[_0x8a46('0x34')],qs[_0x8a46('0x4c')](_0x43a447['query']['fields']));_0x3fdf61['attributes']=_0x3fdf61[_0x8a46('0x38')][_0x8a46('0x39')]?_0x3fdf61['attributes']:_0x5eaba5[_0x8a46('0x34')];if(_0x43a447[_0x8a46('0x35')][_0x8a46('0x4d')]){_0x3fdf61[_0x8a46('0x45')]=[{'all':!![]}];}_0x3fdf61=_[_0x8a46('0x41')]({},_0x3fdf61,_0x43a447[_0x8a46('0x44')]);return db['Sound'][_0x8a46('0x4e')](_0x3fdf61)[_0x8a46('0x27')](handleEntityNotFound(_0x4d5076,null))[_0x8a46('0x27')](respondWithResult(_0x4d5076,null))[_0x8a46('0x48')](handleError(_0x4d5076,null));};exports[_0x8a46('0x4f')]=function(_0x1e79ff,_0x5020a1,_0x248137){return db['Sound']['find']({'where':{'id':_0x1e79ff['params']['id']},'attributes':[_0x8a46('0x2d'),_0x8a46('0x50'),_0x8a46('0x51')],'raw':!![]})[_0x8a46('0x27')](handleEntityNotFound(_0x5020a1,null))[_0x8a46('0x27')](function(_0x165c66){if(_0x165c66){if(!fs['existsSync'](path[_0x8a46('0x52')](config[_0x8a46('0x53')],_0x8a46('0x54'),_0x165c66['save_name']+'.'+_0x165c66['converted_format']))){throw new db['Sequelize'][(_0x8a46('0x55'))](_0x8a46('0x56'));}return _0x5020a1[_0x8a46('0x4f')](path[_0x8a46('0x52')](config[_0x8a46('0x53')],_0x8a46('0x54'),util[_0x8a46('0x57')](_0x8a46('0x58'),_0x165c66['save_name'],_0x165c66[_0x8a46('0x51')])),util[_0x8a46('0x57')](_0x8a46('0x58'),_0x165c66[_0x8a46('0x2d')],_0x165c66[_0x8a46('0x51')]));}return null;})[_0x8a46('0x48')](handleError(_0x5020a1,null));};exports[_0x8a46('0x59')]=function(_0x5d6c48,_0x59aa7c,_0x3b7868){var _0xb6c8e0={'name':path[_0x8a46('0x5a')](_0x5d6c48[_0x8a46('0x5b')]['originalname'],path[_0x8a46('0x5c')](_0x5d6c48[_0x8a46('0x5b')]['originalname'])),'save_name':path[_0x8a46('0x5a')](_0x5d6c48['file'][_0x8a46('0x5d')],path[_0x8a46('0x5c')](_0x5d6c48[_0x8a46('0x5b')]['filename'])),'original_format':path['extname'](_0x5d6c48['file'][_0x8a46('0x5e')])[_0x8a46('0x5f')](0x1),'converted_format':_0x8a46('0x60')};var _0x272674=path[_0x8a46('0x52')](config[_0x8a46('0x53')],_0x8a46('0x61'),_0x5d6c48['file'][_0x8a46('0x5d')]);var _0x59c88a=path[_0x8a46('0x52')](config[_0x8a46('0x53')],_0x8a46('0x54'),util[_0x8a46('0x57')](_0x8a46('0x58'),path['basename'](_0x5d6c48['file']['filename'],path['extname'](_0x5d6c48[_0x8a46('0x5b')][_0x8a46('0x5d')])),_0xb6c8e0[_0x8a46('0x51')]));logger[_0x8a46('0x62')](_0x8a46('0x63'),_0x272674);logger['info'](_0x8a46('0x64'),_0x59c88a);try{fs[_0x8a46('0x65')](_0x272674,parseInt(_0x8a46('0x66'),0x8));var _0x5290a7=sox['transcode'](_0x272674,_0x59c88a,{'sampleRate':0x1f40,'format':_0x8a46('0x60'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5290a7['on']('error',function(_0x47c94a){fs['unlinkSync'](_0x272674);_0x59aa7c[_0x8a46('0x1c')](0x1f4)[_0x8a46('0x2e')](_0x47c94a);});_0x5290a7['on'](_0x8a46('0x67'),function(_0x233f65){_0xb6c8e0[_0x8a46('0x68')]=isNaN(_0x233f65[_0x8a46('0x69')])?null:_0x233f65['duration']*0x3e8;_0xb6c8e0[_0x8a46('0x6a')]=isNaN(_0x233f65[_0x8a46('0x6b')])?null:_0x233f65['sampleCount'];_0xb6c8e0[_0x8a46('0x6c')]=isNaN(_0x233f65['channelCount'])?null:_0x233f65[_0x8a46('0x6d')];_0xb6c8e0[_0x8a46('0x6e')]=isNaN(_0x233f65[_0x8a46('0x6f')])?null:_0x233f65[_0x8a46('0x6f')];_0xb6c8e0[_0x8a46('0x70')]=isNaN(_0x233f65[_0x8a46('0x71')])?null:_0x233f65['sampleRate'];});_0x5290a7['on'](_0x8a46('0x72'),function(_0x587484){_0xb6c8e0[_0x8a46('0x73')]=isNaN(_0x587484['duration'])?null:_0x587484[_0x8a46('0x69')]*0x3e8;_0xb6c8e0['converted_sampleCount']=isNaN(_0x587484[_0x8a46('0x6b')])?null:_0x587484['sampleCount'];_0xb6c8e0[_0x8a46('0x74')]=isNaN(_0x587484[_0x8a46('0x6d')])?null:_0x587484[_0x8a46('0x6d')];_0xb6c8e0[_0x8a46('0x75')]=isNaN(_0x587484[_0x8a46('0x6f')])?null:_0x587484['bitRate'];_0xb6c8e0[_0x8a46('0x76')]=isNaN(_0x587484['sampleRate'])?null:_0x587484[_0x8a46('0x71')];});_0x5290a7['on'](_0x8a46('0x1d'),function(){fs['chmodSync'](_0x59c88a,parseInt(_0x8a46('0x66'),0x8));return db['Sound'][_0x8a46('0x59')](_0xb6c8e0)[_0x8a46('0x27')](function(_0x55690f){var _0x10da5f={'role':_0x5d6c48[_0x8a46('0x77')][_0x8a46('0x78')],'userProfileId':_0x5d6c48[_0x8a46('0x77')]['userProfileId']};if(!_0x10da5f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x10da5f[_0x8a46('0x78')]===_0x8a46('0x79')){var _0x4c4add=_0x55690f[_0x8a46('0x28')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x8a46('0x29'),'userProfileId':_0x10da5f['userProfileId']},'raw':!![]})['then'](function(_0x4a73f7){if(_0x4a73f7&&_0x4a73f7['autoAssociation']===0x0){return db[_0x8a46('0x2a')][_0x8a46('0x59')]({'name':_0x4c4add[_0x8a46('0x2d')],'resourceId':_0x4c4add['id'],'type':_0x4a73f7[_0x8a46('0x2d')],'sectionId':_0x4a73f7['id']},{})[_0x8a46('0x27')](function(){return _0x55690f;});}else{return _0x55690f;}})[_0x8a46('0x48')](function(_0x4cbcb6){logger[_0x8a46('0x2c')](_0x8a46('0x7a'),_0x4cbcb6);throw _0x4cbcb6;});}return _0x55690f;})[_0x8a46('0x27')](respondWithResult(_0x59aa7c,null))['catch'](handleError(_0x59aa7c,null));});_0x5290a7[_0x8a46('0x7b')]();}catch(_0x1511a6){_0x59aa7c[_0x8a46('0x1c')](0x1f4)[_0x8a46('0x2e')](_0x1511a6);}};exports[_0x8a46('0x7c')]=function(_0x5563e0,_0x5ac096,_0x43ab4b){return db[_0x8a46('0x31')][_0x8a46('0x4e')]({'where':{'id':_0x5563e0[_0x8a46('0x4a')]['id']}})[_0x8a46('0x27')](handleEntityNotFound(_0x5ac096,null))[_0x8a46('0x27')](saveUpdates(_[_0x8a46('0x3f')](_0x5563e0[_0x8a46('0x77')],[_0x8a46('0x2d'),_0x8a46('0x7d')]),null))[_0x8a46('0x27')](respondWithResult(_0x5ac096,null))[_0x8a46('0x48')](handleError(_0x5ac096,null));};exports[_0x8a46('0x7e')]=function(_0x2f5124,_0x142cbd,_0xbf3c36){return db['Sound'][_0x8a46('0x4e')]({'where':{'id':_0x2f5124[_0x8a46('0x4a')]['id']}})['then'](function(_0x22ff55){if(_0x22ff55){return _0x22ff55['destroy']();}})[_0x8a46('0x27')](function(_0x5e8d25){var _0x446176=path['join'](config[_0x8a46('0x53')],'server/files/sounds/original',util['format']('%s.%s',_0x5e8d25[_0x8a46('0x50')],_0x5e8d25['original_format']));var _0x1cb3a9=path[_0x8a46('0x52')](config[_0x8a46('0x53')],'server/files/sounds/converted',util['format'](_0x8a46('0x58'),_0x5e8d25[_0x8a46('0x50')],_0x5e8d25[_0x8a46('0x51')]));fs['unlinkSync'](_0x446176);fs[_0x8a46('0x7f')](_0x1cb3a9);return _0x5e8d25;})['then'](function(_0x9a8935){if(_0x9a8935){return _0x142cbd['status'](0xcc)['end']();}})[_0x8a46('0x27')](handleEntityNotFound(_0x142cbd,null))[_0x8a46('0x48')](handleError(_0x142cbd,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 7e3919c..e4d4089 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 _0x4a7b=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Sound'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4a7b,0xe4));var _0xb4a7=function(_0x30e2e3,_0x735618){_0x30e2e3=_0x30e2e3-0x0;var _0x56f292=_0x4a7b[_0x30e2e3];return _0x56f292;};'use strict';var _=require(_0xb4a7('0x0'));var util=require('util');var logger=require(_0xb4a7('0x1'))(_0xb4a7('0x2'));var moment=require(_0xb4a7('0x3'));var BPromise=require(_0xb4a7('0x4'));var rp=require(_0xb4a7('0x5'));var fs=require('fs');var path=require(_0xb4a7('0x6'));var rimraf=require(_0xb4a7('0x7'));var config=require(_0xb4a7('0x8'));var attributes=require('./sound.attributes');module[_0xb4a7('0x9')]=function(_0xfd4385,_0x165e30){return _0xfd4385[_0xb4a7('0xa')](_0xb4a7('0xb'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf9b6=['moment','bluebird','rimraf','./sound.attributes','define','Sound','tools_sounds','lodash','util','../../config/logger','api'];(function(_0x43762c,_0x48ff0f){var _0x4a85e0=function(_0x452e89){while(--_0x452e89){_0x43762c['push'](_0x43762c['shift']());}};_0x4a85e0(++_0x48ff0f);}(_0xf9b6,0x1bf));var _0x6f9b=function(_0x32b4aa,_0x12eba6){_0x32b4aa=_0x32b4aa-0x0;var _0x473160=_0xf9b6[_0x32b4aa];return _0x473160;};'use strict';var _=require(_0x6f9b('0x0'));var util=require(_0x6f9b('0x1'));var logger=require(_0x6f9b('0x2'))(_0x6f9b('0x3'));var moment=require(_0x6f9b('0x4'));var BPromise=require(_0x6f9b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6f9b('0x6'));var config=require('../../config/environment');var attributes=require(_0x6f9b('0x7'));module['exports']=function(_0xf1b5a2,_0x579733){return _0xf1b5a2[_0x6f9b('0x8')](_0x6f9b('0x9'),attributes,{'tableName':_0x6f9b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 6085770..9b733c8 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 _0x1619=['rpc','jayson/promise','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','message','Sound','options','raw','where','attributes','include','map','model','ShowSound','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x101842,_0x4db31b){var _0x45ce04=function(_0x1754a3){while(--_0x1754a3){_0x101842['push'](_0x101842['shift']());}};_0x45ce04(++_0x4db31b);}(_0x1619,0x17e));var _0x9161=function(_0x195fa1,_0x129b90){_0x195fa1=_0x195fa1-0x0;var _0x1a19af=_0x1619[_0x195fa1];return _0x1a19af;};'use strict';var _=require(_0x9161('0x0'));var util=require(_0x9161('0x1'));var moment=require(_0x9161('0x2'));var BPromise=require(_0x9161('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9161('0x4'));var db=require(_0x9161('0x5'))['db'];var utils=require(_0x9161('0x6'));var logger=require(_0x9161('0x7'))(_0x9161('0x8'));var config=require('../../config/environment');var jayson=require(_0x9161('0x9'));var client=jayson['client'][_0x9161('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a6102,_0x4ce442,_0x2ee889){return new BPromise(function(_0x3981a9,_0x28f8ce){return client[_0x9161('0xb')](_0x4a6102,_0x2ee889)[_0x9161('0xc')](function(_0x1f194d){logger[_0x9161('0xd')](_0x9161('0xe'),_0x4ce442,_0x9161('0xf'));logger[_0x9161('0x10')](_0x9161('0x11'),_0x4ce442,_0x9161('0xf'),JSON['stringify'](_0x1f194d));if(_0x1f194d[_0x9161('0x12')]){if(_0x1f194d['error']['code']===0x1f4){logger['error'](_0x9161('0xe'),_0x4ce442,_0x1f194d['error'][_0x9161('0x13')]);return _0x28f8ce(_0x1f194d[_0x9161('0x12')][_0x9161('0x13')]);}logger[_0x9161('0x12')](_0x9161('0xe'),_0x4ce442,_0x1f194d[_0x9161('0x12')][_0x9161('0x13')]);return _0x3981a9(_0x1f194d[_0x9161('0x12')][_0x9161('0x13')]);}else{logger[_0x9161('0xd')](_0x9161('0xe'),_0x4ce442,_0x9161('0xf'));_0x3981a9(_0x1f194d['result'][_0x9161('0x13')]);}})['catch'](function(_0x4cca41){logger['error'](_0x9161('0xe'),_0x4ce442,_0x4cca41);_0x28f8ce(_0x4cca41);});});}exports['ShowSound']=function(_0x492538){var _0xc2fcc3=this;return new Promise(function(_0x2fc7cd,_0x966967){return db[_0x9161('0x14')]['find']({'raw':_0x492538[_0x9161('0x15')]?_0x492538[_0x9161('0x15')][_0x9161('0x16')]===undefined?!![]:![]:!![],'where':_0x492538[_0x9161('0x15')]?_0x492538[_0x9161('0x15')][_0x9161('0x17')]||null:null,'attributes':_0x492538[_0x9161('0x15')]?_0x492538[_0x9161('0x15')][_0x9161('0x18')]||null:null,'include':_0x492538[_0x9161('0x15')]?_0x492538['options'][_0x9161('0x19')]?_[_0x9161('0x1a')](_0x492538['options']['include'],function(_0x587e10){return{'model':db[_0x587e10[_0x9161('0x1b')]],'as':_0x587e10['as'],'attributes':_0x587e10[_0x9161('0x18')],'include':_0x587e10[_0x9161('0x19')]?_[_0x9161('0x1a')](_0x587e10[_0x9161('0x19')],function(_0x38278d){return{'model':db[_0x38278d[_0x9161('0x1b')]],'as':_0x38278d['as'],'attributes':_0x38278d['attributes'],'include':_0x38278d[_0x9161('0x19')]?_['map'](_0x38278d[_0x9161('0x19')],function(_0x47f1c1){return{'model':db[_0x47f1c1['model']],'as':_0x47f1c1['as'],'attributes':_0x47f1c1['attributes']};}):[]};}):[]};}):[]:[]})[_0x9161('0xc')](function(_0x132ece){logger[_0x9161('0xd')](_0x9161('0x1c'),_0x492538);logger['debug'](_0x9161('0x1c'),_0x492538,JSON[_0x9161('0x1d')](_0x132ece));_0x2fc7cd(_0x132ece);})['catch'](function(_0xf9be44){logger['error'](_0x9161('0x1c'),_0xf9be44[_0x9161('0x13')],_0x492538);_0x966967(_0xc2fcc3[_0x9161('0x12')](0x1f4,_0xf9be44[_0x9161('0x13')]));});});}; \ No newline at end of file +var _0xa6db=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','ShowSound','Sound','options','raw','attributes','model','include','map','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5987ae,_0x202985){var _0x4a444d=function(_0x361ca1){while(--_0x361ca1){_0x5987ae['push'](_0x5987ae['shift']());}};_0x4a444d(++_0x202985);}(_0xa6db,0x84));var _0xba6d=function(_0x47ec53,_0x5106fd){_0x47ec53=_0x47ec53-0x0;var _0x54eb20=_0xa6db[_0x47ec53];return _0x54eb20;};'use strict';var _=require(_0xba6d('0x0'));var util=require(_0xba6d('0x1'));var moment=require(_0xba6d('0x2'));var BPromise=require(_0xba6d('0x3'));var rs=require(_0xba6d('0x4'));var fs=require('fs');var Redis=require(_0xba6d('0x5'));var db=require(_0xba6d('0x6'))['db'];var utils=require(_0xba6d('0x7'));var logger=require(_0xba6d('0x8'))(_0xba6d('0x9'));var config=require(_0xba6d('0xa'));var jayson=require(_0xba6d('0xb'));var client=jayson[_0xba6d('0xc')][_0xba6d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x423d86,_0x157ef7,_0x44dbf4){return new BPromise(function(_0x3e940b,_0x3ba5c5){return client[_0xba6d('0xe')](_0x423d86,_0x44dbf4)[_0xba6d('0xf')](function(_0x19a5ee){logger['info'](_0xba6d('0x10'),_0x157ef7,'request\x20sent');logger[_0xba6d('0x11')](_0xba6d('0x12'),_0x157ef7,_0xba6d('0x13'),JSON[_0xba6d('0x14')](_0x19a5ee));if(_0x19a5ee[_0xba6d('0x15')]){if(_0x19a5ee[_0xba6d('0x15')][_0xba6d('0x16')]===0x1f4){logger[_0xba6d('0x15')](_0xba6d('0x10'),_0x157ef7,_0x19a5ee[_0xba6d('0x15')]['message']);return _0x3ba5c5(_0x19a5ee[_0xba6d('0x15')][_0xba6d('0x17')]);}logger[_0xba6d('0x15')](_0xba6d('0x10'),_0x157ef7,_0x19a5ee[_0xba6d('0x15')][_0xba6d('0x17')]);return _0x3e940b(_0x19a5ee[_0xba6d('0x15')][_0xba6d('0x17')]);}else{logger[_0xba6d('0x18')](_0xba6d('0x10'),_0x157ef7,'request\x20sent');_0x3e940b(_0x19a5ee[_0xba6d('0x19')][_0xba6d('0x17')]);}})['catch'](function(_0x1b570c){logger[_0xba6d('0x15')](_0xba6d('0x10'),_0x157ef7,_0x1b570c);_0x3ba5c5(_0x1b570c);});});}exports[_0xba6d('0x1a')]=function(_0x2ecf57){var _0x22fa45=this;return new Promise(function(_0x53c6d1,_0x56a343){return db[_0xba6d('0x1b')]['find']({'raw':_0x2ecf57['options']?_0x2ecf57[_0xba6d('0x1c')][_0xba6d('0x1d')]===undefined?!![]:![]:!![],'where':_0x2ecf57[_0xba6d('0x1c')]?_0x2ecf57[_0xba6d('0x1c')]['where']||null:null,'attributes':_0x2ecf57[_0xba6d('0x1c')]?_0x2ecf57[_0xba6d('0x1c')][_0xba6d('0x1e')]||null:null,'include':_0x2ecf57[_0xba6d('0x1c')]?_0x2ecf57['options']['include']?_['map'](_0x2ecf57[_0xba6d('0x1c')]['include'],function(_0x50723d){return{'model':db[_0x50723d[_0xba6d('0x1f')]],'as':_0x50723d['as'],'attributes':_0x50723d[_0xba6d('0x1e')],'include':_0x50723d[_0xba6d('0x20')]?_[_0xba6d('0x21')](_0x50723d[_0xba6d('0x20')],function(_0x1c1f3b){return{'model':db[_0x1c1f3b[_0xba6d('0x1f')]],'as':_0x1c1f3b['as'],'attributes':_0x1c1f3b[_0xba6d('0x1e')],'include':_0x1c1f3b[_0xba6d('0x20')]?_[_0xba6d('0x21')](_0x1c1f3b['include'],function(_0xebedc9){return{'model':db[_0xebedc9[_0xba6d('0x1f')]],'as':_0xebedc9['as'],'attributes':_0xebedc9[_0xba6d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xba6d('0xf')](function(_0x267109){logger[_0xba6d('0x18')](_0xba6d('0x1a'),_0x2ecf57);logger['debug'](_0xba6d('0x1a'),_0x2ecf57,JSON[_0xba6d('0x14')](_0x267109));_0x53c6d1(_0x267109);})[_0xba6d('0x22')](function(_0xdf8857){logger['error'](_0xba6d('0x1a'),_0xdf8857[_0xba6d('0x17')],_0x2ecf57);_0x56a343(_0x22fa45[_0xba6d('0x15')](0x1f4,_0xdf8857[_0xba6d('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index afd7d97..416cf0b 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 _0x8603=['../../components/interaction/service','./squareMessage.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x39f375,_0x3aa8ec){var _0x463f93=function(_0x290215){while(--_0x290215){_0x39f375['push'](_0x39f375['shift']());}};_0x463f93(++_0x3aa8ec);}(_0x8603,0x190));var _0x3860=function(_0x5263d2,_0x476862){_0x5263d2=_0x5263d2-0x0;var _0x2363a0=_0x8603[_0x5263d2];return _0x2363a0;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['delete'](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['destroy']);module[_0x3860('0xe')]=router; \ No newline at end of file +var _0xac4a=['express','Router','../../components/interaction/service','../../config/environment','./squareMessage.controller','isAuthenticated','get','show','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x336d88,_0x300c76){var _0x46eaec=function(_0x1ee440){while(--_0x1ee440){_0x336d88['push'](_0x336d88['shift']());}};_0x46eaec(++_0x300c76);}(_0xac4a,0x13f));var _0xaac4=function(_0x2ac65c,_0x351398){_0x2ac65c=_0x2ac65c-0x0;var _0x498f39=_0xac4a[_0x2ac65c];return _0x498f39;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var controller=require(_0xaac4('0x8'));router['get']('/',auth[_0xaac4('0x9')](),controller['index']);router[_0xaac4('0xa')]('/:id',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router['put'](_0xaac4('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xaac4('0xe')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xf')]);module[_0xaac4('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index b408404..a0bd0f9 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 _0xcfed=['ENUM','out','exports','STRING','medium'];(function(_0x3fc63e,_0x49e7f7){var _0x3e600f=function(_0x1c33f4){while(--_0x1c33f4){_0x3fc63e['push'](_0x3fc63e['shift']());}};_0x3e600f(++_0x49e7f7);}(_0xcfed,0x1d8));var _0xdcfe=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xcfed[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require('sequelize');module[_0xdcfe('0x0')]={'uniqueid':{'type':Sequelize[_0xdcfe('0x1')]},'body':{'type':Sequelize['TEXT'](_0xdcfe('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0xdcfe('0x3')]('in',_0xdcfe('0x4')),'defaultValue':_0xdcfe('0x4'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x44f7=['exports','STRING','TEXT','medium','ENUM','out','sequelize'];(function(_0x41777a,_0x3e9d1d){var _0x147d8b=function(_0x29b7dd){while(--_0x29b7dd){_0x41777a['push'](_0x41777a['shift']());}};_0x147d8b(++_0x3e9d1d);}(_0x44f7,0x11e));var _0x744f=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x44f7[_0x58dc25];return _0x21b0a7;};'use strict';var Sequelize=require(_0x744f('0x0'));module[_0x744f('0x1')]={'uniqueid':{'type':Sequelize[_0x744f('0x2')]},'body':{'type':Sequelize[_0x744f('0x3')](_0x744f('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x744f('0x5')]('in',_0x744f('0x6')),'defaultValue':_0x744f('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0x744f('0x2')]},'providerResponse':{'type':Sequelize[_0x744f('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index b7f4071..1957d64 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 _0x97e6=['eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','name','send','index','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','options','SquareMessage','includeAll','rows','catch','show','include','find','create','body','update','params'];(function(_0x2283b9,_0x331e46){var _0x109e65=function(_0x442268){while(--_0x442268){_0x2283b9['push'](_0x2283b9['shift']());}};_0x109e65(++_0x331e46);}(_0x97e6,0x159));var _0x697e=function(_0x223a99,_0x1ddaff){_0x223a99=_0x223a99-0x0;var _0x5a2346=_0x97e6[_0x223a99];return _0x5a2346;};'use strict';var emlformat=require(_0x697e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x697e('0x1'));var jsonpatch=require(_0x697e('0x2'));var rp=require(_0x697e('0x3'));var moment=require('moment');var BPromise=require(_0x697e('0x4'));var Mustache=require(_0x697e('0x5'));var util=require('util');var path=require(_0x697e('0x6'));var sox=require('sox');var csv=require(_0x697e('0x7'));var ejs=require(_0x697e('0x8'));var fs=require('fs');var fs_extra=require(_0x697e('0x9'));var _=require(_0x697e('0xa'));var squel=require(_0x697e('0xb'));var crypto=require(_0x697e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x697e('0x7'));var querystring=require(_0x697e('0xd'));var Papa=require(_0x697e('0xe'));var Redis=require('ioredis');var authService=require(_0x697e('0xf'));var qs=require(_0x697e('0x10'));var as=require(_0x697e('0x11'));var hardwareService=require(_0x697e('0x12'));var logger=require(_0x697e('0x13'))('api');var utils=require(_0x697e('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x697e('0x15'))['db'];function respondWithStatusCode(_0x381c9d,_0x1aa4bb){_0x1aa4bb=_0x1aa4bb||0xcc;return function(_0x555677){if(_0x555677){return _0x381c9d[_0x697e('0x16')](_0x1aa4bb);}return _0x381c9d[_0x697e('0x17')](_0x1aa4bb)['end']();};}function respondWithResult(_0x504b68,_0x27a5f1){_0x27a5f1=_0x27a5f1||0xc8;return function(_0x2b5c28){if(_0x2b5c28){return _0x504b68[_0x697e('0x17')](_0x27a5f1)[_0x697e('0x18')](_0x2b5c28);}};}function respondWithFilteredResult(_0x357b6a,_0x698b6d){return function(_0x1f0f4f){if(_0x1f0f4f){var _0x32ff03=typeof _0x698b6d[_0x697e('0x19')]==='undefined'&&typeof _0x698b6d[_0x697e('0x1a')]===_0x697e('0x1b');var _0x5581e7=_0x1f0f4f[_0x697e('0x1c')];var _0x5edd20=_0x32ff03?0x0:_0x698b6d[_0x697e('0x19')];var _0x281216=_0x32ff03?_0x1f0f4f['count']:_0x698b6d[_0x697e('0x19')]+_0x698b6d[_0x697e('0x1a')];var _0x284070;if(_0x281216>=_0x5581e7){_0x281216=_0x5581e7;_0x284070=0xc8;}else{_0x284070=0xce;}_0x357b6a[_0x697e('0x17')](_0x284070);return _0x357b6a[_0x697e('0x1d')](_0x697e('0x1e'),_0x5edd20+'-'+_0x281216+'/'+_0x5581e7)[_0x697e('0x18')](_0x1f0f4f);}return null;};}function patchUpdates(_0x26e3cd){return function(_0x504727){try{jsonpatch[_0x697e('0x1f')](_0x504727,_0x26e3cd,!![]);}catch(_0x40525f){return BPromise['reject'](_0x40525f);}return _0x504727[_0x697e('0x20')]();};}function saveUpdates(_0x5949e5,_0x179fab){return function(_0x2e1609){if(_0x2e1609){return _0x2e1609['update'](_0x5949e5)[_0x697e('0x21')](function(_0x5a72bb){return _0x5a72bb;});}return null;};}function removeEntity(_0xa5f268,_0x1afb71){return function(_0x1d37ae){if(_0x1d37ae){return _0x1d37ae[_0x697e('0x22')]()[_0x697e('0x21')](function(){_0xa5f268['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc3d9d0,_0x3bf9d5){return function(_0x3d0ac6){if(!_0x3d0ac6){_0xc3d9d0[_0x697e('0x16')](0x194);}return _0x3d0ac6;};}function handleError(_0xb33a1c,_0x411c63){_0x411c63=_0x411c63||0x1f4;return function(_0x3df903){logger['error'](_0x3df903['stack']);if(_0x3df903[_0x697e('0x23')]){delete _0x3df903[_0x697e('0x23')];}_0xb33a1c[_0x697e('0x17')](_0x411c63)[_0x697e('0x24')](_0x3df903);};}exports[_0x697e('0x25')]=function(_0x46e01b,_0x33f4b5){var _0x55833e={},_0x492b6a={},_0x4b1862={'count':0x0,'rows':[]};var _0x2d6c36=_['map'](db['SquareMessage']['rawAttributes'],function(_0x500b95){return{'name':_0x500b95[_0x697e('0x26')],'type':_0x500b95[_0x697e('0x27')][_0x697e('0x28')]};});_0x492b6a[_0x697e('0x29')]=_['map'](_0x2d6c36,_0x697e('0x23'));_0x492b6a[_0x697e('0x2a')]=_[_0x697e('0x2b')](_0x46e01b[_0x697e('0x2a')]);_0x492b6a[_0x697e('0x2c')]=_[_0x697e('0x2d')](_0x492b6a['model'],_0x492b6a['query']);_0x55833e[_0x697e('0x2e')]=_[_0x697e('0x2d')](_0x492b6a['model'],qs[_0x697e('0x2f')](_0x46e01b[_0x697e('0x2a')]['fields']));_0x55833e[_0x697e('0x2e')]=_0x55833e[_0x697e('0x2e')][_0x697e('0x30')]?_0x55833e[_0x697e('0x2e')]:_0x492b6a[_0x697e('0x29')];if(!_0x46e01b[_0x697e('0x2a')]['hasOwnProperty'](_0x697e('0x31'))){_0x55833e['limit']=qs['limit'](_0x46e01b[_0x697e('0x2a')][_0x697e('0x1a')]);_0x55833e[_0x697e('0x19')]=qs['offset'](_0x46e01b[_0x697e('0x2a')][_0x697e('0x19')]);}_0x55833e[_0x697e('0x32')]=qs['sort'](_0x46e01b[_0x697e('0x2a')][_0x697e('0x33')]);_0x55833e[_0x697e('0x34')]=qs[_0x697e('0x2c')](_[_0x697e('0x35')](_0x46e01b['query'],_0x492b6a['filters']),_0x2d6c36);if(_0x46e01b[_0x697e('0x2a')][_0x697e('0x36')]){_0x55833e[_0x697e('0x34')]=_[_0x697e('0x37')](_0x55833e[_0x697e('0x34')],{'$or':_[_0x697e('0x38')](_0x2d6c36,function(_0x5e4c37){if(_0x5e4c37[_0x697e('0x27')]!=='VIRTUAL'){var _0x3c796d={};_0x3c796d[_0x5e4c37['name']]={'$like':'%'+_0x46e01b[_0x697e('0x2a')][_0x697e('0x36')]+'%'};return _0x3c796d;}})});}_0x55833e=_['merge']({},_0x55833e,_0x46e01b[_0x697e('0x39')]);var _0x375159={'where':_0x55833e[_0x697e('0x34')]};return db[_0x697e('0x3a')][_0x697e('0x1c')](_0x375159)[_0x697e('0x21')](function(_0x508077){_0x4b1862[_0x697e('0x1c')]=_0x508077;if(_0x46e01b[_0x697e('0x2a')][_0x697e('0x3b')]){_0x55833e['include']=[{'all':!![]}];}return db[_0x697e('0x3a')]['findAll'](_0x55833e);})[_0x697e('0x21')](function(_0x2c3bdc){_0x4b1862[_0x697e('0x3c')]=_0x2c3bdc;return _0x4b1862;})['then'](respondWithFilteredResult(_0x33f4b5,_0x55833e))[_0x697e('0x3d')](handleError(_0x33f4b5,null));};exports[_0x697e('0x3e')]=function(_0x8ac3d5,_0x2b3e8f){var _0x19de50={'raw':!![],'where':{'id':_0x8ac3d5['params']['id']}},_0x476997={};_0x476997[_0x697e('0x29')]=_[_0x697e('0x2b')](db[_0x697e('0x3a')]['rawAttributes']);_0x476997[_0x697e('0x2a')]=_['keys'](_0x8ac3d5['query']);_0x476997[_0x697e('0x2c')]=_[_0x697e('0x2d')](_0x476997['model'],_0x476997[_0x697e('0x2a')]);_0x19de50['attributes']=_[_0x697e('0x2d')](_0x476997[_0x697e('0x29')],qs[_0x697e('0x2f')](_0x8ac3d5['query'][_0x697e('0x2f')]));_0x19de50[_0x697e('0x2e')]=_0x19de50[_0x697e('0x2e')]['length']?_0x19de50['attributes']:_0x476997[_0x697e('0x29')];if(_0x8ac3d5[_0x697e('0x2a')][_0x697e('0x3b')]){_0x19de50[_0x697e('0x3f')]=[{'all':!![]}];}_0x19de50=_[_0x697e('0x37')]({},_0x19de50,_0x8ac3d5[_0x697e('0x39')]);return db[_0x697e('0x3a')][_0x697e('0x40')](_0x19de50)[_0x697e('0x21')](handleEntityNotFound(_0x2b3e8f,null))[_0x697e('0x21')](respondWithResult(_0x2b3e8f,null))[_0x697e('0x3d')](handleError(_0x2b3e8f,null));};exports[_0x697e('0x41')]=function(_0x2571f6,_0x4a938d){return db[_0x697e('0x3a')][_0x697e('0x41')](_0x2571f6[_0x697e('0x42')],{})[_0x697e('0x21')](respondWithResult(_0x4a938d,0xc9))[_0x697e('0x3d')](handleError(_0x4a938d,null));};exports[_0x697e('0x43')]=function(_0x2b7be9,_0x5721f4){if(_0x2b7be9[_0x697e('0x42')]['id']){delete _0x2b7be9[_0x697e('0x42')]['id'];}return db['SquareMessage'][_0x697e('0x40')]({'where':{'id':_0x2b7be9[_0x697e('0x44')]['id']}})[_0x697e('0x21')](handleEntityNotFound(_0x5721f4,null))[_0x697e('0x21')](saveUpdates(_0x2b7be9[_0x697e('0x42')],null))[_0x697e('0x21')](respondWithResult(_0x5721f4,null))['catch'](handleError(_0x5721f4,null));};exports[_0x697e('0x22')]=function(_0x264af1,_0x3d6dc9){return db[_0x697e('0x3a')][_0x697e('0x40')]({'where':{'id':_0x264af1['params']['id']}})[_0x697e('0x21')](handleEntityNotFound(_0x3d6dc9,null))['then'](removeEntity(_0x3d6dc9,null))[_0x697e('0x3d')](handleError(_0x3d6dc9,null));}; \ No newline at end of file +var _0x8481=['key','query','keys','intersection','model','attributes','nolimit','order','where','filters','filter','VIRTUAL','options','includeAll','SquareMessage','findAll','rows','catch','show','rawAttributes','fields','length','include','merge','create','body','update','find','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','then','error','stack','name','send','map','fieldName','type'];(function(_0xbb9c6,_0x19957e){var _0x2ef027=function(_0x42b196){while(--_0x42b196){_0xbb9c6['push'](_0xbb9c6['shift']());}};_0x2ef027(++_0x19957e);}(_0x8481,0x1c7));var _0x1848=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x8481[_0x28947d];return _0x12d2ee;};'use strict';var emlformat=require(_0x1848('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1848('0x1'));var jsonpatch=require(_0x1848('0x2'));var rp=require(_0x1848('0x3'));var moment=require(_0x1848('0x4'));var BPromise=require(_0x1848('0x5'));var Mustache=require(_0x1848('0x6'));var util=require(_0x1848('0x7'));var path=require(_0x1848('0x8'));var sox=require('sox');var csv=require(_0x1848('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(_0x1848('0xa'));var jsforce=require(_0x1848('0xb'));var deskjs=require(_0x1848('0xc'));var toCsv=require(_0x1848('0x9'));var querystring=require(_0x1848('0xd'));var Papa=require('papaparse');var Redis=require(_0x1848('0xe'));var authService=require(_0x1848('0xf'));var qs=require(_0x1848('0x10'));var as=require(_0x1848('0x11'));var hardwareService=require(_0x1848('0x12'));var logger=require(_0x1848('0x13'))(_0x1848('0x14'));var utils=require(_0x1848('0x15'));var config=require(_0x1848('0x16'));var licenseUtil=require(_0x1848('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20cdc6,_0x45222b){_0x45222b=_0x45222b||0xcc;return function(_0x4f1f7b){if(_0x4f1f7b){return _0x20cdc6['sendStatus'](_0x45222b);}return _0x20cdc6[_0x1848('0x18')](_0x45222b)[_0x1848('0x19')]();};}function respondWithResult(_0x4eb5dd,_0x3b2770){_0x3b2770=_0x3b2770||0xc8;return function(_0x325246){if(_0x325246){return _0x4eb5dd[_0x1848('0x18')](_0x3b2770)[_0x1848('0x1a')](_0x325246);}};}function respondWithFilteredResult(_0x514ef9,_0x43a5bd){return function(_0x1d717a){if(_0x1d717a){var _0x1ba98c=typeof _0x43a5bd['offset']===_0x1848('0x1b')&&typeof _0x43a5bd[_0x1848('0x1c')]===_0x1848('0x1b');var _0x50b3d7=_0x1d717a[_0x1848('0x1d')];var _0x25a2ee=_0x1ba98c?0x0:_0x43a5bd[_0x1848('0x1e')];var _0x48efb6=_0x1ba98c?_0x1d717a[_0x1848('0x1d')]:_0x43a5bd['offset']+_0x43a5bd[_0x1848('0x1c')];var _0x49d4ba;if(_0x48efb6>=_0x50b3d7){_0x48efb6=_0x50b3d7;_0x49d4ba=0xc8;}else{_0x49d4ba=0xce;}_0x514ef9[_0x1848('0x18')](_0x49d4ba);return _0x514ef9['set'](_0x1848('0x1f'),_0x25a2ee+'-'+_0x48efb6+'/'+_0x50b3d7)['json'](_0x1d717a);}return null;};}function patchUpdates(_0x25c2a3){return function(_0x50e85c){try{jsonpatch[_0x1848('0x20')](_0x50e85c,_0x25c2a3,!![]);}catch(_0x9a0605){return BPromise[_0x1848('0x21')](_0x9a0605);}return _0x50e85c['save']();};}function saveUpdates(_0x1d87f8,_0x1941db){return function(_0x22f8a3){if(_0x22f8a3){return _0x22f8a3['update'](_0x1d87f8)['then'](function(_0xebffdb){return _0xebffdb;});}return null;};}function removeEntity(_0x55e139,_0x1e7e08){return function(_0x26b4b6){if(_0x26b4b6){return _0x26b4b6['destroy']()[_0x1848('0x22')](function(){_0x55e139[_0x1848('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15ad7e,_0x44aa86){return function(_0x2dcb49){if(!_0x2dcb49){_0x15ad7e['sendStatus'](0x194);}return _0x2dcb49;};}function handleError(_0x4f3d28,_0x22cac2){_0x22cac2=_0x22cac2||0x1f4;return function(_0x41c797){logger[_0x1848('0x23')](_0x41c797[_0x1848('0x24')]);if(_0x41c797[_0x1848('0x25')]){delete _0x41c797[_0x1848('0x25')];}_0x4f3d28['status'](_0x22cac2)[_0x1848('0x26')](_0x41c797);};}exports['index']=function(_0x440e3b,_0x40b786){var _0x2f171a={},_0x429305={},_0x100d98={'count':0x0,'rows':[]};var _0x490686=_[_0x1848('0x27')](db['SquareMessage']['rawAttributes'],function(_0xcce2e6){return{'name':_0xcce2e6[_0x1848('0x28')],'type':_0xcce2e6[_0x1848('0x29')][_0x1848('0x2a')]};});_0x429305['model']=_[_0x1848('0x27')](_0x490686,_0x1848('0x25'));_0x429305[_0x1848('0x2b')]=_[_0x1848('0x2c')](_0x440e3b['query']);_0x429305['filters']=_[_0x1848('0x2d')](_0x429305[_0x1848('0x2e')],_0x429305[_0x1848('0x2b')]);_0x2f171a[_0x1848('0x2f')]=_[_0x1848('0x2d')](_0x429305[_0x1848('0x2e')],qs['fields'](_0x440e3b['query']['fields']));_0x2f171a[_0x1848('0x2f')]=_0x2f171a[_0x1848('0x2f')]['length']?_0x2f171a[_0x1848('0x2f')]:_0x429305[_0x1848('0x2e')];if(!_0x440e3b[_0x1848('0x2b')]['hasOwnProperty'](_0x1848('0x30'))){_0x2f171a[_0x1848('0x1c')]=qs[_0x1848('0x1c')](_0x440e3b[_0x1848('0x2b')][_0x1848('0x1c')]);_0x2f171a[_0x1848('0x1e')]=qs[_0x1848('0x1e')](_0x440e3b['query'][_0x1848('0x1e')]);}_0x2f171a[_0x1848('0x31')]=qs['sort'](_0x440e3b[_0x1848('0x2b')]['sort']);_0x2f171a[_0x1848('0x32')]=qs[_0x1848('0x33')](_['pick'](_0x440e3b[_0x1848('0x2b')],_0x429305[_0x1848('0x33')]),_0x490686);if(_0x440e3b['query'][_0x1848('0x34')]){_0x2f171a[_0x1848('0x32')]=_['merge'](_0x2f171a[_0x1848('0x32')],{'$or':_[_0x1848('0x27')](_0x490686,function(_0x5d0bf4){if(_0x5d0bf4['type']!==_0x1848('0x35')){var _0x37d6af={};_0x37d6af[_0x5d0bf4[_0x1848('0x25')]]={'$like':'%'+_0x440e3b[_0x1848('0x2b')][_0x1848('0x34')]+'%'};return _0x37d6af;}})});}_0x2f171a=_['merge']({},_0x2f171a,_0x440e3b[_0x1848('0x36')]);var _0x1781cb={'where':_0x2f171a['where']};return db['SquareMessage']['count'](_0x1781cb)[_0x1848('0x22')](function(_0x261926){_0x100d98[_0x1848('0x1d')]=_0x261926;if(_0x440e3b['query'][_0x1848('0x37')]){_0x2f171a['include']=[{'all':!![]}];}return db[_0x1848('0x38')][_0x1848('0x39')](_0x2f171a);})[_0x1848('0x22')](function(_0x45458a){_0x100d98[_0x1848('0x3a')]=_0x45458a;return _0x100d98;})[_0x1848('0x22')](respondWithFilteredResult(_0x40b786,_0x2f171a))[_0x1848('0x3b')](handleError(_0x40b786,null));};exports[_0x1848('0x3c')]=function(_0x3c072a,_0xa1e3ee){var _0x2ea364={'raw':!![],'where':{'id':_0x3c072a['params']['id']}},_0x3b97f1={};_0x3b97f1[_0x1848('0x2e')]=_['keys'](db['SquareMessage'][_0x1848('0x3d')]);_0x3b97f1[_0x1848('0x2b')]=_[_0x1848('0x2c')](_0x3c072a[_0x1848('0x2b')]);_0x3b97f1[_0x1848('0x33')]=_[_0x1848('0x2d')](_0x3b97f1[_0x1848('0x2e')],_0x3b97f1[_0x1848('0x2b')]);_0x2ea364['attributes']=_[_0x1848('0x2d')](_0x3b97f1['model'],qs[_0x1848('0x3e')](_0x3c072a[_0x1848('0x2b')]['fields']));_0x2ea364[_0x1848('0x2f')]=_0x2ea364[_0x1848('0x2f')][_0x1848('0x3f')]?_0x2ea364[_0x1848('0x2f')]:_0x3b97f1['model'];if(_0x3c072a[_0x1848('0x2b')][_0x1848('0x37')]){_0x2ea364[_0x1848('0x40')]=[{'all':!![]}];}_0x2ea364=_[_0x1848('0x41')]({},_0x2ea364,_0x3c072a['options']);return db[_0x1848('0x38')]['find'](_0x2ea364)['then'](handleEntityNotFound(_0xa1e3ee,null))['then'](respondWithResult(_0xa1e3ee,null))['catch'](handleError(_0xa1e3ee,null));};exports[_0x1848('0x42')]=function(_0x434d1a,_0x4a329c){return db[_0x1848('0x38')]['create'](_0x434d1a[_0x1848('0x43')],{})[_0x1848('0x22')](respondWithResult(_0x4a329c,0xc9))[_0x1848('0x3b')](handleError(_0x4a329c,null));};exports[_0x1848('0x44')]=function(_0x221e3b,_0x366acc){if(_0x221e3b[_0x1848('0x43')]['id']){delete _0x221e3b[_0x1848('0x43')]['id'];}return db[_0x1848('0x38')][_0x1848('0x45')]({'where':{'id':_0x221e3b[_0x1848('0x46')]['id']}})[_0x1848('0x22')](handleEntityNotFound(_0x366acc,null))[_0x1848('0x22')](saveUpdates(_0x221e3b[_0x1848('0x43')],null))[_0x1848('0x22')](respondWithResult(_0x366acc,null))['catch'](handleError(_0x366acc,null));};exports['destroy']=function(_0x5e4a61,_0x4361ab){return db['SquareMessage']['find']({'where':{'id':_0x5e4a61[_0x1848('0x46')]['id']}})['then'](handleEntityNotFound(_0x4361ab,null))[_0x1848('0x22')](removeEntity(_0x4361ab,null))[_0x1848('0x3b')](handleError(_0x4361ab,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 50bd858..437bf5f 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 _0x7847=['request-promise','../../config/environment','define','SquareMessage','square_messages','lodash','util','../../config/logger','moment'];(function(_0x4f7cce,_0x456bd9){var _0x39c566=function(_0x1a476a){while(--_0x1a476a){_0x4f7cce['push'](_0x4f7cce['shift']());}};_0x39c566(++_0x456bd9);}(_0x7847,0x1a3));var _0x7784=function(_0x2b63a0,_0x14fc48){_0x2b63a0=_0x2b63a0-0x0;var _0x4f0434=_0x7847[_0x2b63a0];return _0x4f0434;};'use strict';var _=require(_0x7784('0x0'));var util=require(_0x7784('0x1'));var logger=require(_0x7784('0x2'))('api');var moment=require(_0x7784('0x3'));var BPromise=require('bluebird');var rp=require(_0x7784('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7784('0x5'));var attributes=require('./squareMessage.attributes');module['exports']=function(_0x5bfd7e,_0x22ded2){return _0x5bfd7e[_0x7784('0x6')](_0x7784('0x7'),attributes,{'tableName':_0x7784('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb027=['api','moment','request-promise','path','rimraf','./squareMessage.attributes','exports','SquareMessage','square_messages','lodash','util','../../config/logger'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xb027,0x111));var _0x7b02=function(_0x27d462,_0x3704d8){_0x27d462=_0x27d462-0x0;var _0x3fc3c1=_0xb027[_0x27d462];return _0x3fc3c1;};'use strict';var _=require(_0x7b02('0x0'));var util=require(_0x7b02('0x1'));var logger=require(_0x7b02('0x2'))(_0x7b02('0x3'));var moment=require(_0x7b02('0x4'));var BPromise=require('bluebird');var rp=require(_0x7b02('0x5'));var fs=require('fs');var path=require(_0x7b02('0x6'));var rimraf=require(_0x7b02('0x7'));var config=require('../../config/environment');var attributes=require(_0x7b02('0x8'));module[_0x7b02('0x9')]=function(_0x3d7014,_0x342860){return _0x3d7014['define'](_0x7b02('0xa'),attributes,{'tableName':_0x7b02('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 08e15c7..d0a8293 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 _0x9c03=['info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareMessage','SquareMessage','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x96616f,_0x46dbc6){var _0x1a8b61=function(_0x166b76){while(--_0x166b76){_0x96616f['push'](_0x96616f['shift']());}};_0x1a8b61(++_0x46dbc6);}(_0x9c03,0x1e0));var _0x39c0=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9c03[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x39c0('0x0'));var util=require(_0x39c0('0x1'));var moment=require('moment');var BPromise=require(_0x39c0('0x2'));var rs=require(_0x39c0('0x3'));var fs=require('fs');var Redis=require(_0x39c0('0x4'));var db=require(_0x39c0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x39c0('0x6'))('rpc');var config=require(_0x39c0('0x7'));var jayson=require(_0x39c0('0x8'));var client=jayson[_0x39c0('0x9')][_0x39c0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xff7bc,_0x69211f,_0x2eda7b){return new BPromise(function(_0x270642,_0x1fbb0c){return client[_0x39c0('0xb')](_0xff7bc,_0x2eda7b)[_0x39c0('0xc')](function(_0x59be9e){logger[_0x39c0('0xd')](_0x39c0('0xe'),_0x69211f,_0x39c0('0xf'));logger[_0x39c0('0x10')](_0x39c0('0x11'),_0x69211f,_0x39c0('0xf'),JSON[_0x39c0('0x12')](_0x59be9e));if(_0x59be9e[_0x39c0('0x13')]){if(_0x59be9e[_0x39c0('0x13')][_0x39c0('0x14')]===0x1f4){logger['error'](_0x39c0('0xe'),_0x69211f,_0x59be9e[_0x39c0('0x13')][_0x39c0('0x15')]);return _0x1fbb0c(_0x59be9e[_0x39c0('0x13')][_0x39c0('0x15')]);}logger[_0x39c0('0x13')]('SquareMessage,\x20%s,\x20%s',_0x69211f,_0x59be9e['error']['message']);return _0x270642(_0x59be9e[_0x39c0('0x13')][_0x39c0('0x15')]);}else{logger[_0x39c0('0xd')]('SquareMessage,\x20%s,\x20%s',_0x69211f,'request\x20sent');_0x270642(_0x59be9e[_0x39c0('0x16')][_0x39c0('0x15')]);}})[_0x39c0('0x17')](function(_0x12e134){logger[_0x39c0('0x13')](_0x39c0('0xe'),_0x69211f,_0x12e134);_0x1fbb0c(_0x12e134);});});}exports[_0x39c0('0x18')]=function(_0x3ebc9d){var _0x259129=this;return new Promise(function(_0x197762,_0x320e78){return db[_0x39c0('0x19')]['create'](_0x3ebc9d[_0x39c0('0x1a')],{'raw':_0x3ebc9d['options']?_0x3ebc9d[_0x39c0('0x1b')][_0x39c0('0x1c')]===undefined?!![]:![]:!![]})[_0x39c0('0xc')](function(_0x1cb6e9){logger[_0x39c0('0xd')](_0x39c0('0x18'),_0x3ebc9d);logger[_0x39c0('0x10')](_0x39c0('0x18'),_0x3ebc9d,JSON[_0x39c0('0x12')](_0x1cb6e9));_0x197762(_0x1cb6e9);})[_0x39c0('0x17')](function(_0x20d2f1){logger[_0x39c0('0x13')]('CreateSquareMessage',_0x20d2f1[_0x39c0('0x15')],_0x3ebc9d);_0x320e78(_0x259129[_0x39c0('0x13')](0x1f4,_0x20d2f1['message']));});});}; \ No newline at end of file +var _0xba88=['CreateSquareMessage','SquareMessage','create','body','options','raw','debug','stringify','catch','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','error','code','SquareMessage,\x20%s,\x20%s','message','result'];(function(_0x1635fe,_0x5f1d9f){var _0x3c512a=function(_0x26b53d){while(--_0x26b53d){_0x1635fe['push'](_0x1635fe['shift']());}};_0x3c512a(++_0x5f1d9f);}(_0xba88,0x1e4));var _0x8ba8=function(_0x573f73,_0x500eee){_0x573f73=_0x573f73-0x0;var _0xfe6186=_0xba88[_0x573f73];return _0xfe6186;};'use strict';var _=require('lodash');var util=require(_0x8ba8('0x0'));var moment=require(_0x8ba8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ba8('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ba8('0x3'))(_0x8ba8('0x4'));var config=require(_0x8ba8('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x8ba8('0x6')][_0x8ba8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2df2ca,_0x25709e,_0x4f98b9){return new BPromise(function(_0x14b4a1,_0x3b4847){return client[_0x8ba8('0x8')](_0x2df2ca,_0x4f98b9)[_0x8ba8('0x9')](function(_0x67a64a){logger[_0x8ba8('0xa')]('SquareMessage,\x20%s,\x20%s',_0x25709e,'request\x20sent');logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x25709e,'request\x20sent',JSON['stringify'](_0x67a64a));if(_0x67a64a[_0x8ba8('0xb')]){if(_0x67a64a[_0x8ba8('0xb')][_0x8ba8('0xc')]===0x1f4){logger[_0x8ba8('0xb')](_0x8ba8('0xd'),_0x25709e,_0x67a64a[_0x8ba8('0xb')][_0x8ba8('0xe')]);return _0x3b4847(_0x67a64a[_0x8ba8('0xb')][_0x8ba8('0xe')]);}logger[_0x8ba8('0xb')](_0x8ba8('0xd'),_0x25709e,_0x67a64a[_0x8ba8('0xb')][_0x8ba8('0xe')]);return _0x14b4a1(_0x67a64a[_0x8ba8('0xb')]['message']);}else{logger[_0x8ba8('0xa')]('SquareMessage,\x20%s,\x20%s',_0x25709e,'request\x20sent');_0x14b4a1(_0x67a64a[_0x8ba8('0xf')]['message']);}})['catch'](function(_0xd9bd86){logger[_0x8ba8('0xb')](_0x8ba8('0xd'),_0x25709e,_0xd9bd86);_0x3b4847(_0xd9bd86);});});}exports[_0x8ba8('0x10')]=function(_0xa7e6e9){var _0x44cf50=this;return new Promise(function(_0x149dfb,_0xfade8c){return db[_0x8ba8('0x11')][_0x8ba8('0x12')](_0xa7e6e9[_0x8ba8('0x13')],{'raw':_0xa7e6e9['options']?_0xa7e6e9[_0x8ba8('0x14')][_0x8ba8('0x15')]===undefined?!![]:![]:!![]})[_0x8ba8('0x9')](function(_0x9da49){logger[_0x8ba8('0xa')](_0x8ba8('0x10'),_0xa7e6e9);logger[_0x8ba8('0x16')](_0x8ba8('0x10'),_0xa7e6e9,JSON[_0x8ba8('0x17')](_0x9da49));_0x149dfb(_0x9da49);})[_0x8ba8('0x18')](function(_0x2cd2f2){logger[_0x8ba8('0xb')](_0x8ba8('0x10'),_0x2cd2f2[_0x8ba8('0xe')],_0xa7e6e9);_0xfade8c(_0x44cf50[_0x8ba8('0xb')](0x1f4,_0x2cd2f2['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index e42298a..2ef93e0 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 _0x8634=['delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','index','/:id','/:id/test','15s','test','create','put','update'];(function(_0x253a83,_0x3e7356){var _0x577b14=function(_0x43bd15){while(--_0x43bd15){_0x253a83['push'](_0x253a83['shift']());}};_0x577b14(++_0x3e7356);}(_0x8634,0x1a7));var _0x4863=function(_0xdbb6cb,_0x3b8fda){_0xdbb6cb=_0xdbb6cb-0x0;var _0x476b50=_0x8634[_0xdbb6cb];return _0x476b50;};'use strict';var multer=require('multer');var util=require(_0x4863('0x0'));var path=require('path');var timeout=require(_0x4863('0x1'));var express=require(_0x4863('0x2'));var router=express[_0x4863('0x3')]();var fs_extra=require(_0x4863('0x4'));var auth=require(_0x4863('0x5'));var interaction=require(_0x4863('0x6'));var config=require('../../config/environment');var controller=require(_0x4863('0x7'));router[_0x4863('0x8')]('/',auth[_0x4863('0x9')](),controller[_0x4863('0xa')]);router[_0x4863('0x8')](_0x4863('0xb'),auth[_0x4863('0x9')](),controller['show']);router['get'](_0x4863('0xc'),auth['isAuthenticated'](),timeout(_0x4863('0xd')),controller[_0x4863('0xe')]);router['post']('/',auth[_0x4863('0x9')](),controller[_0x4863('0xf')]);router[_0x4863('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x4863('0x11')]);router[_0x4863('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x4863('0x13')]);module[_0x4863('0x14')]=router; \ No newline at end of file +var _0xb881=['index','show','/:id/test','test','delete','/:id','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated'];(function(_0x3a0224,_0x518b92){var _0x16f4bc=function(_0x45dec0){while(--_0x45dec0){_0x3a0224['push'](_0x3a0224['shift']());}};_0x16f4bc(++_0x518b92);}(_0xb881,0x170));var _0x1b88=function(_0x58fa29,_0x1135f2){_0x58fa29=_0x58fa29-0x0;var _0x59044e=_0xb881[_0x58fa29];return _0x59044e;};'use strict';var multer=require(_0x1b88('0x0'));var util=require(_0x1b88('0x1'));var path=require('path');var timeout=require(_0x1b88('0x2'));var express=require(_0x1b88('0x3'));var router=express[_0x1b88('0x4')]();var fs_extra=require(_0x1b88('0x5'));var auth=require(_0x1b88('0x6'));var interaction=require(_0x1b88('0x7'));var config=require(_0x1b88('0x8'));var controller=require(_0x1b88('0x9'));router[_0x1b88('0xa')]('/',auth[_0x1b88('0xb')](),controller[_0x1b88('0xc')]);router[_0x1b88('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x1b88('0xd')]);router[_0x1b88('0xa')](_0x1b88('0xe'),auth['isAuthenticated'](),timeout('15s'),controller[_0x1b88('0xf')]);router['post']('/',auth[_0x1b88('0xb')](),controller['create']);router['put']('/:id',auth[_0x1b88('0xb')](),controller['update']);router[_0x1b88('0x10')](_0x1b88('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x1b88('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index d9e1ddc..d316c6e 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 _0x8c06=['sequelize','exports','STRING'];(function(_0x39116a,_0x4eb9cf){var _0x22269d=function(_0x5a7df0){while(--_0x5a7df0){_0x39116a['push'](_0x39116a['shift']());}};_0x22269d(++_0x4eb9cf);}(_0x8c06,0x72));var _0x68c0=function(_0x523edb,_0x2f36b4){_0x523edb=_0x523edb-0x0;var _0xc2103f=_0x8c06[_0x523edb];return _0xc2103f;};'use strict';var Sequelize=require(_0x68c0('0x0'));module[_0x68c0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x68c0('0x2')]},'description':{'type':Sequelize[_0x68c0('0x2')]}}; \ No newline at end of file +var _0x1da6=['sequelize','exports','STRING','name'];(function(_0x2f4fe7,_0x5119bf){var _0x40d436=function(_0x26b05d){while(--_0x26b05d){_0x2f4fe7['push'](_0x2f4fe7['shift']());}};_0x40d436(++_0x5119bf);}(_0x1da6,0x7c));var _0x61da=function(_0xb3b452,_0x582e8e){_0xb3b452=_0xb3b452-0x0;var _0x238983=_0x1da6[_0xb3b452];return _0x238983;};'use strict';var Sequelize=require(_0x61da('0x0'));module[_0x61da('0x1')]={'name':{'type':Sequelize[_0x61da('0x2')],'unique':_0x61da('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x61da('0x2')]},'description':{'type':Sequelize[_0x61da('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 429ba4b..7ed30a6 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 _0x4d94=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','SquareOdbc','rawAttributes','type','key','map','query','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','order','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','show','params','keys','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ODBC','userProfileId','autoAssociation','body','test','dsn','openSync','closeSync','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra'];(function(_0x25384d,_0xc12419){var _0x54d551=function(_0x383d4e){while(--_0x383d4e){_0x25384d['push'](_0x25384d['shift']());}};_0x54d551(++_0xc12419);}(_0x4d94,0x146));var _0x44d9=function(_0x3fa7c1,_0x3aaa7e){_0x3fa7c1=_0x3fa7c1-0x0;var _0x5c1dcb=_0x4d94[_0x3fa7c1];return _0x5c1dcb;};'use strict';var emlformat=require(_0x44d9('0x0'));var rimraf=require(_0x44d9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x44d9('0x2'));var rp=require(_0x44d9('0x3'));var moment=require(_0x44d9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x44d9('0x5'));var util=require('util');var path=require('path');var sox=require(_0x44d9('0x6'));var csv=require(_0x44d9('0x7'));var ejs=require(_0x44d9('0x8'));var fs=require('fs');var fs_extra=require(_0x44d9('0x9'));var _=require('lodash');var squel=require(_0x44d9('0xa'));var crypto=require(_0x44d9('0xb'));var jsforce=require(_0x44d9('0xc'));var deskjs=require(_0x44d9('0xd'));var toCsv=require('to-csv');var querystring=require(_0x44d9('0xe'));var Papa=require('papaparse');var Redis=require(_0x44d9('0xf'));var authService=require(_0x44d9('0x10'));var qs=require(_0x44d9('0x11'));var as=require(_0x44d9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x44d9('0x13'));var config=require(_0x44d9('0x14'));var licenseUtil=require(_0x44d9('0x15'));var db=require(_0x44d9('0x16'))['db'];function respondWithStatusCode(_0xaab59,_0x519a31){_0x519a31=_0x519a31||0xcc;return function(_0x33d100){if(_0x33d100){return _0xaab59[_0x44d9('0x17')](_0x519a31);}return _0xaab59['status'](_0x519a31)[_0x44d9('0x18')]();};}function respondWithResult(_0x36cd59,_0x38617a){_0x38617a=_0x38617a||0xc8;return function(_0x30de57){if(_0x30de57){return _0x36cd59[_0x44d9('0x19')](_0x38617a)[_0x44d9('0x1a')](_0x30de57);}};}function respondWithFilteredResult(_0x544461,_0x3e6704){return function(_0x6e325d){if(_0x6e325d){var _0x1c6dd1=typeof _0x3e6704[_0x44d9('0x1b')]===_0x44d9('0x1c')&&typeof _0x3e6704[_0x44d9('0x1d')]==='undefined';var _0x25e4be=_0x6e325d[_0x44d9('0x1e')];var _0x4afb8d=_0x1c6dd1?0x0:_0x3e6704[_0x44d9('0x1b')];var _0x44c5f7=_0x1c6dd1?_0x6e325d[_0x44d9('0x1e')]:_0x3e6704[_0x44d9('0x1b')]+_0x3e6704[_0x44d9('0x1d')];var _0x24ad23;if(_0x44c5f7>=_0x25e4be){_0x44c5f7=_0x25e4be;_0x24ad23=0xc8;}else{_0x24ad23=0xce;}_0x544461['status'](_0x24ad23);return _0x544461[_0x44d9('0x1f')](_0x44d9('0x20'),_0x4afb8d+'-'+_0x44c5f7+'/'+_0x25e4be)[_0x44d9('0x1a')](_0x6e325d);}return null;};}function patchUpdates(_0x5dfa8a){return function(_0x198fd6){try{jsonpatch['apply'](_0x198fd6,_0x5dfa8a,!![]);}catch(_0x1d6bb3){return BPromise[_0x44d9('0x21')](_0x1d6bb3);}return _0x198fd6[_0x44d9('0x22')]();};}function saveUpdates(_0x2a2c7d,_0x2e6335){return function(_0xdda6ec){if(_0xdda6ec){return _0xdda6ec[_0x44d9('0x23')](_0x2a2c7d)[_0x44d9('0x24')](function(_0x253cb2){return _0x253cb2;});}return null;};}function removeEntity(_0x568fd3,_0x5824e9){return function(_0x3ca7fd){if(_0x3ca7fd){return _0x3ca7fd[_0x44d9('0x25')]()['then'](function(){var _0x230f6c=_0x3ca7fd[_0x44d9('0x26')]({'plain':!![]});var _0x529e9a='ODBC';return db[_0x44d9('0x27')][_0x44d9('0x25')]({'where':{'type':_0x529e9a,'resourceId':_0x230f6c['id']}})['then'](function(){return _0x3ca7fd;});})[_0x44d9('0x24')](function(){_0x568fd3[_0x44d9('0x19')](0xcc)[_0x44d9('0x18')]();});}};}function handleEntityNotFound(_0x4bddcf,_0x49920e){return function(_0x345438){if(!_0x345438){_0x4bddcf[_0x44d9('0x17')](0x194);}return _0x345438;};}function handleError(_0x2ad191,_0x274ae5){_0x274ae5=_0x274ae5||0x1f4;return function(_0x87dc94){logger[_0x44d9('0x28')](_0x87dc94[_0x44d9('0x29')]);if(_0x87dc94['name']){delete _0x87dc94[_0x44d9('0x2a')];}_0x2ad191[_0x44d9('0x19')](_0x274ae5)[_0x44d9('0x2b')](_0x87dc94);};}exports['index']=function(_0x1fad22,_0x117d00){var _0x9beafe={},_0x240a0f={},_0x2f09f5={'count':0x0,'rows':[]};var _0x2f5477=_['map'](db[_0x44d9('0x2c')][_0x44d9('0x2d')],function(_0x483226){return{'name':_0x483226['fieldName'],'type':_0x483226[_0x44d9('0x2e')][_0x44d9('0x2f')]};});_0x240a0f['model']=_[_0x44d9('0x30')](_0x2f5477,_0x44d9('0x2a'));_0x240a0f[_0x44d9('0x31')]=_['keys'](_0x1fad22['query']);_0x240a0f['filters']=_[_0x44d9('0x32')](_0x240a0f[_0x44d9('0x33')],_0x240a0f[_0x44d9('0x31')]);_0x9beafe['attributes']=_[_0x44d9('0x32')](_0x240a0f[_0x44d9('0x33')],qs[_0x44d9('0x34')](_0x1fad22['query'][_0x44d9('0x34')]));_0x9beafe['attributes']=_0x9beafe['attributes'][_0x44d9('0x35')]?_0x9beafe[_0x44d9('0x36')]:_0x240a0f[_0x44d9('0x33')];if(!_0x1fad22['query'][_0x44d9('0x37')](_0x44d9('0x38'))){_0x9beafe[_0x44d9('0x1d')]=qs[_0x44d9('0x1d')](_0x1fad22[_0x44d9('0x31')][_0x44d9('0x1d')]);_0x9beafe[_0x44d9('0x1b')]=qs[_0x44d9('0x1b')](_0x1fad22[_0x44d9('0x31')][_0x44d9('0x1b')]);}_0x9beafe[_0x44d9('0x39')]=qs['sort'](_0x1fad22[_0x44d9('0x31')]['sort']);_0x9beafe['where']=qs[_0x44d9('0x3a')](_[_0x44d9('0x3b')](_0x1fad22[_0x44d9('0x31')],_0x240a0f[_0x44d9('0x3a')]),_0x2f5477);if(_0x1fad22['query'][_0x44d9('0x3c')]){_0x9beafe[_0x44d9('0x3d')]=_[_0x44d9('0x3e')](_0x9beafe[_0x44d9('0x3d')],{'$or':_[_0x44d9('0x30')](_0x2f5477,function(_0x36d883){if(_0x36d883[_0x44d9('0x2e')]!==_0x44d9('0x3f')){var _0x5ccbc5={};_0x5ccbc5[_0x36d883[_0x44d9('0x2a')]]={'$like':'%'+_0x1fad22['query'][_0x44d9('0x3c')]+'%'};return _0x5ccbc5;}})});}_0x9beafe=_[_0x44d9('0x3e')]({},_0x9beafe,_0x1fad22[_0x44d9('0x40')]);var _0x5f4425={'where':_0x9beafe[_0x44d9('0x3d')]};return db[_0x44d9('0x2c')][_0x44d9('0x1e')](_0x5f4425)[_0x44d9('0x24')](function(_0x5c0b21){_0x2f09f5[_0x44d9('0x1e')]=_0x5c0b21;if(_0x1fad22[_0x44d9('0x31')][_0x44d9('0x41')]){_0x9beafe['include']=[{'all':!![]}];}return db[_0x44d9('0x2c')]['findAll'](_0x9beafe);})[_0x44d9('0x24')](function(_0x3a8043){_0x2f09f5[_0x44d9('0x42')]=_0x3a8043;return _0x2f09f5;})[_0x44d9('0x24')](respondWithFilteredResult(_0x117d00,_0x9beafe))['catch'](handleError(_0x117d00,null));};exports[_0x44d9('0x43')]=function(_0x4caf05,_0x3fbd8a){var _0x782ceb={'raw':!![],'where':{'id':_0x4caf05[_0x44d9('0x44')]['id']}},_0x4e6852={};_0x4e6852[_0x44d9('0x33')]=_[_0x44d9('0x45')](db[_0x44d9('0x2c')][_0x44d9('0x2d')]);_0x4e6852[_0x44d9('0x31')]=_[_0x44d9('0x45')](_0x4caf05[_0x44d9('0x31')]);_0x4e6852['filters']=_[_0x44d9('0x32')](_0x4e6852[_0x44d9('0x33')],_0x4e6852[_0x44d9('0x31')]);_0x782ceb[_0x44d9('0x36')]=_['intersection'](_0x4e6852['model'],qs['fields'](_0x4caf05[_0x44d9('0x31')][_0x44d9('0x34')]));_0x782ceb[_0x44d9('0x36')]=_0x782ceb[_0x44d9('0x36')]['length']?_0x782ceb[_0x44d9('0x36')]:_0x4e6852[_0x44d9('0x33')];if(_0x4caf05['query'][_0x44d9('0x41')]){_0x782ceb[_0x44d9('0x46')]=[{'all':!![]}];}_0x782ceb=_[_0x44d9('0x3e')]({},_0x782ceb,_0x4caf05[_0x44d9('0x40')]);return db['SquareOdbc'][_0x44d9('0x47')](_0x782ceb)[_0x44d9('0x24')](handleEntityNotFound(_0x3fbd8a,null))['then'](respondWithResult(_0x3fbd8a,null))[_0x44d9('0x48')](handleError(_0x3fbd8a,null));};exports[_0x44d9('0x49')]=function(_0x4ba759,_0x4de19f){return db[_0x44d9('0x2c')]['create'](_0x4ba759['body'],{})['then'](function(_0x49276e){var _0x100f25=_0x4ba759[_0x44d9('0x4a')]['get']({'plain':!![]});if(!_0x100f25)throw new Error(_0x44d9('0x4b'));if(_0x100f25['role']===_0x44d9('0x4a')){var _0xbf20e3=_0x49276e['get']({'plain':!![]});var _0x1715c6=_0x44d9('0x4c');return db['UserProfileSection']['find']({'where':{'name':_0x1715c6,'userProfileId':_0x100f25[_0x44d9('0x4d')]},'raw':!![]})[_0x44d9('0x24')](function(_0x2fdc89){if(_0x2fdc89&&_0x2fdc89[_0x44d9('0x4e')]===0x0){return db[_0x44d9('0x27')]['create']({'name':_0xbf20e3[_0x44d9('0x2a')],'resourceId':_0xbf20e3['id'],'type':_0x2fdc89['name'],'sectionId':_0x2fdc89['id']},{})[_0x44d9('0x24')](function(){return _0x49276e;});}else{return _0x49276e;}})['catch'](function(_0x1ba549){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ba549);throw _0x1ba549;});}return _0x49276e;})[_0x44d9('0x24')](respondWithResult(_0x4de19f,0xc9))['catch'](handleError(_0x4de19f,null));};exports[_0x44d9('0x23')]=function(_0x280c52,_0x1aadec){if(_0x280c52['body']['id']){delete _0x280c52['body']['id'];}return db['SquareOdbc'][_0x44d9('0x47')]({'where':{'id':_0x280c52['params']['id']}})[_0x44d9('0x24')](handleEntityNotFound(_0x1aadec,null))['then'](saveUpdates(_0x280c52[_0x44d9('0x4f')],null))['then'](respondWithResult(_0x1aadec,null))[_0x44d9('0x48')](handleError(_0x1aadec,null));};exports[_0x44d9('0x25')]=function(_0x51978b,_0xd822d){return db[_0x44d9('0x2c')][_0x44d9('0x47')]({'where':{'id':_0x51978b[_0x44d9('0x44')]['id']}})[_0x44d9('0x24')](handleEntityNotFound(_0xd822d,null))['then'](removeEntity(_0xd822d,null))[_0x44d9('0x48')](handleError(_0xd822d,null));};exports[_0x44d9('0x50')]=function(_0x5dd5c2,_0x898b1e,_0x59fb98){var _0x2af20d;return db['SquareOdbc']['find']({'where':{'id':_0x5dd5c2[_0x44d9('0x44')]['id']},'attributes':['id',_0x44d9('0x51')]})['then'](handleEntityNotFound(_0x898b1e,null))[_0x44d9('0x24')](function(_0x4695cc){if(_0x4695cc){var _0x2c54dc=require('odbc')();_0x2c54dc[_0x44d9('0x52')](_0x4695cc['dsn']);_0x2c54dc[_0x44d9('0x53')]();return _0x4695cc;}})['then'](respondWithResult(_0x898b1e,null))[_0x44d9('0x48')](handleError(_0x898b1e,null));}; \ No newline at end of file +var _0xcafc=['mustache','util','path','sox','fs-extra','lodash','squel','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','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','ODBC','end','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','include','rows','catch','params','SquareOdbc','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','dsn','openSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x8b8564,_0x162976){var _0x360c61=function(_0x164cc9){while(--_0x164cc9){_0x8b8564['push'](_0x8b8564['shift']());}};_0x360c61(++_0x162976);}(_0xcafc,0x1a8));var _0xccaf=function(_0x5af08c,_0x50dab0){_0x5af08c=_0x5af08c-0x0;var _0x233265=_0xcafc[_0x5af08c];return _0x233265;};'use strict';var emlformat=require(_0xccaf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xccaf('0x1'));var jsonpatch=require(_0xccaf('0x2'));var rp=require(_0xccaf('0x3'));var moment=require(_0xccaf('0x4'));var BPromise=require(_0xccaf('0x5'));var Mustache=require(_0xccaf('0x6'));var util=require(_0xccaf('0x7'));var path=require(_0xccaf('0x8'));var sox=require(_0xccaf('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xccaf('0xa'));var _=require(_0xccaf('0xb'));var squel=require(_0xccaf('0xc'));var crypto=require('crypto');var jsforce=require(_0xccaf('0xd'));var deskjs=require(_0xccaf('0xe'));var toCsv=require('to-csv');var querystring=require(_0xccaf('0xf'));var Papa=require(_0xccaf('0x10'));var Redis=require(_0xccaf('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xccaf('0x12'));var as=require(_0xccaf('0x13'));var hardwareService=require(_0xccaf('0x14'));var logger=require(_0xccaf('0x15'))('api');var utils=require(_0xccaf('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xccaf('0x17'));var db=require(_0xccaf('0x18'))['db'];function respondWithStatusCode(_0x39cccd,_0x6c95bd){_0x6c95bd=_0x6c95bd||0xcc;return function(_0x45f495){if(_0x45f495){return _0x39cccd[_0xccaf('0x19')](_0x6c95bd);}return _0x39cccd['status'](_0x6c95bd)['end']();};}function respondWithResult(_0x21f6b4,_0x210f43){_0x210f43=_0x210f43||0xc8;return function(_0x28dde7){if(_0x28dde7){return _0x21f6b4[_0xccaf('0x1a')](_0x210f43)[_0xccaf('0x1b')](_0x28dde7);}};}function respondWithFilteredResult(_0x55d1c6,_0x3c8ddb){return function(_0x2adc61){if(_0x2adc61){var _0x102f5b=typeof _0x3c8ddb[_0xccaf('0x1c')]===_0xccaf('0x1d')&&typeof _0x3c8ddb[_0xccaf('0x1e')]==='undefined';var _0x295767=_0x2adc61[_0xccaf('0x1f')];var _0xc5a7ef=_0x102f5b?0x0:_0x3c8ddb[_0xccaf('0x1c')];var _0x43bf2b=_0x102f5b?_0x2adc61[_0xccaf('0x1f')]:_0x3c8ddb['offset']+_0x3c8ddb[_0xccaf('0x1e')];var _0x3c1f80;if(_0x43bf2b>=_0x295767){_0x43bf2b=_0x295767;_0x3c1f80=0xc8;}else{_0x3c1f80=0xce;}_0x55d1c6['status'](_0x3c1f80);return _0x55d1c6['set'](_0xccaf('0x20'),_0xc5a7ef+'-'+_0x43bf2b+'/'+_0x295767)[_0xccaf('0x1b')](_0x2adc61);}return null;};}function patchUpdates(_0x260304){return function(_0x53185b){try{jsonpatch['apply'](_0x53185b,_0x260304,!![]);}catch(_0x53c5ee){return BPromise[_0xccaf('0x21')](_0x53c5ee);}return _0x53185b['save']();};}function saveUpdates(_0x270dc6,_0x415199){return function(_0x5a2bb4){if(_0x5a2bb4){return _0x5a2bb4[_0xccaf('0x22')](_0x270dc6)[_0xccaf('0x23')](function(_0x2f638e){return _0x2f638e;});}return null;};}function removeEntity(_0x31320c,_0x378f50){return function(_0x151208){if(_0x151208){return _0x151208[_0xccaf('0x24')]()[_0xccaf('0x23')](function(){var _0xae0d50=_0x151208['get']({'plain':!![]});var _0x4ab6ab=_0xccaf('0x25');return db['UserProfileResource'][_0xccaf('0x24')]({'where':{'type':_0x4ab6ab,'resourceId':_0xae0d50['id']}})[_0xccaf('0x23')](function(){return _0x151208;});})['then'](function(){_0x31320c['status'](0xcc)[_0xccaf('0x26')]();});}};}function handleEntityNotFound(_0x595377,_0x539bd0){return function(_0x35458a){if(!_0x35458a){_0x595377[_0xccaf('0x19')](0x194);}return _0x35458a;};}function handleError(_0x139f79,_0x4ba5ea){_0x4ba5ea=_0x4ba5ea||0x1f4;return function(_0x1f9fb6){logger[_0xccaf('0x27')](_0x1f9fb6[_0xccaf('0x28')]);if(_0x1f9fb6[_0xccaf('0x29')]){delete _0x1f9fb6[_0xccaf('0x29')];}_0x139f79[_0xccaf('0x1a')](_0x4ba5ea)[_0xccaf('0x2a')](_0x1f9fb6);};}exports[_0xccaf('0x2b')]=function(_0x343f9f,_0x5d6d4a){var _0x34f16c={},_0x1ba6e3={},_0x5db1d3={'count':0x0,'rows':[]};var _0x30eed8=_['map'](db['SquareOdbc'][_0xccaf('0x2c')],function(_0x21c3f1){return{'name':_0x21c3f1[_0xccaf('0x2d')],'type':_0x21c3f1['type'][_0xccaf('0x2e')]};});_0x1ba6e3[_0xccaf('0x2f')]=_[_0xccaf('0x30')](_0x30eed8,'name');_0x1ba6e3['query']=_[_0xccaf('0x31')](_0x343f9f[_0xccaf('0x32')]);_0x1ba6e3['filters']=_[_0xccaf('0x33')](_0x1ba6e3['model'],_0x1ba6e3['query']);_0x34f16c['attributes']=_['intersection'](_0x1ba6e3[_0xccaf('0x2f')],qs['fields'](_0x343f9f[_0xccaf('0x32')][_0xccaf('0x34')]));_0x34f16c[_0xccaf('0x35')]=_0x34f16c[_0xccaf('0x35')][_0xccaf('0x36')]?_0x34f16c['attributes']:_0x1ba6e3['model'];if(!_0x343f9f[_0xccaf('0x32')][_0xccaf('0x37')](_0xccaf('0x38'))){_0x34f16c['limit']=qs[_0xccaf('0x1e')](_0x343f9f['query'][_0xccaf('0x1e')]);_0x34f16c[_0xccaf('0x1c')]=qs[_0xccaf('0x1c')](_0x343f9f[_0xccaf('0x32')][_0xccaf('0x1c')]);}_0x34f16c[_0xccaf('0x39')]=qs[_0xccaf('0x3a')](_0x343f9f[_0xccaf('0x32')][_0xccaf('0x3a')]);_0x34f16c[_0xccaf('0x3b')]=qs[_0xccaf('0x3c')](_[_0xccaf('0x3d')](_0x343f9f[_0xccaf('0x32')],_0x1ba6e3[_0xccaf('0x3c')]),_0x30eed8);if(_0x343f9f[_0xccaf('0x32')][_0xccaf('0x3e')]){_0x34f16c[_0xccaf('0x3b')]=_['merge'](_0x34f16c[_0xccaf('0x3b')],{'$or':_[_0xccaf('0x30')](_0x30eed8,function(_0x1a2867){if(_0x1a2867[_0xccaf('0x3f')]!==_0xccaf('0x40')){var _0x1fcd64={};_0x1fcd64[_0x1a2867['name']]={'$like':'%'+_0x343f9f[_0xccaf('0x32')][_0xccaf('0x3e')]+'%'};return _0x1fcd64;}})});}_0x34f16c=_[_0xccaf('0x41')]({},_0x34f16c,_0x343f9f[_0xccaf('0x42')]);var _0x4d33df={'where':_0x34f16c[_0xccaf('0x3b')]};return db['SquareOdbc'][_0xccaf('0x1f')](_0x4d33df)[_0xccaf('0x23')](function(_0x422eff){_0x5db1d3['count']=_0x422eff;if(_0x343f9f[_0xccaf('0x32')][_0xccaf('0x43')]){_0x34f16c[_0xccaf('0x44')]=[{'all':!![]}];}return db['SquareOdbc']['findAll'](_0x34f16c);})[_0xccaf('0x23')](function(_0x8a7f34){_0x5db1d3[_0xccaf('0x45')]=_0x8a7f34;return _0x5db1d3;})[_0xccaf('0x23')](respondWithFilteredResult(_0x5d6d4a,_0x34f16c))[_0xccaf('0x46')](handleError(_0x5d6d4a,null));};exports['show']=function(_0x4cf20c,_0x305642){var _0x3bd228={'raw':!![],'where':{'id':_0x4cf20c[_0xccaf('0x47')]['id']}},_0x77b5ca={};_0x77b5ca['model']=_[_0xccaf('0x31')](db[_0xccaf('0x48')][_0xccaf('0x2c')]);_0x77b5ca[_0xccaf('0x32')]=_[_0xccaf('0x31')](_0x4cf20c[_0xccaf('0x32')]);_0x77b5ca[_0xccaf('0x3c')]=_[_0xccaf('0x33')](_0x77b5ca[_0xccaf('0x2f')],_0x77b5ca[_0xccaf('0x32')]);_0x3bd228[_0xccaf('0x35')]=_[_0xccaf('0x33')](_0x77b5ca['model'],qs[_0xccaf('0x34')](_0x4cf20c[_0xccaf('0x32')][_0xccaf('0x34')]));_0x3bd228[_0xccaf('0x35')]=_0x3bd228[_0xccaf('0x35')]['length']?_0x3bd228[_0xccaf('0x35')]:_0x77b5ca[_0xccaf('0x2f')];if(_0x4cf20c[_0xccaf('0x32')][_0xccaf('0x43')]){_0x3bd228[_0xccaf('0x44')]=[{'all':!![]}];}_0x3bd228=_[_0xccaf('0x41')]({},_0x3bd228,_0x4cf20c[_0xccaf('0x42')]);return db[_0xccaf('0x48')]['find'](_0x3bd228)[_0xccaf('0x23')](handleEntityNotFound(_0x305642,null))[_0xccaf('0x23')](respondWithResult(_0x305642,null))[_0xccaf('0x46')](handleError(_0x305642,null));};exports['create']=function(_0x325997,_0x4d52a1){return db[_0xccaf('0x48')]['create'](_0x325997[_0xccaf('0x49')],{})[_0xccaf('0x23')](function(_0x288e07){var _0x4b31bf=_0x325997['user'][_0xccaf('0x4a')]({'plain':!![]});if(!_0x4b31bf)throw new Error(_0xccaf('0x4b'));if(_0x4b31bf[_0xccaf('0x4c')]===_0xccaf('0x4d')){var _0x33c571=_0x288e07[_0xccaf('0x4a')]({'plain':!![]});var _0x242308='ODBC';return db[_0xccaf('0x4e')]['find']({'where':{'name':_0x242308,'userProfileId':_0x4b31bf[_0xccaf('0x4f')]},'raw':!![]})[_0xccaf('0x23')](function(_0x1c9163){if(_0x1c9163&&_0x1c9163['autoAssociation']===0x0){return db[_0xccaf('0x50')][_0xccaf('0x51')]({'name':_0x33c571[_0xccaf('0x29')],'resourceId':_0x33c571['id'],'type':_0x1c9163[_0xccaf('0x29')],'sectionId':_0x1c9163['id']},{})[_0xccaf('0x23')](function(){return _0x288e07;});}else{return _0x288e07;}})['catch'](function(_0x35d643){logger['error'](_0xccaf('0x52'),_0x35d643);throw _0x35d643;});}return _0x288e07;})['then'](respondWithResult(_0x4d52a1,0xc9))[_0xccaf('0x46')](handleError(_0x4d52a1,null));};exports[_0xccaf('0x22')]=function(_0x37948f,_0x296a0c){if(_0x37948f[_0xccaf('0x49')]['id']){delete _0x37948f['body']['id'];}return db['SquareOdbc']['find']({'where':{'id':_0x37948f[_0xccaf('0x47')]['id']}})[_0xccaf('0x23')](handleEntityNotFound(_0x296a0c,null))[_0xccaf('0x23')](saveUpdates(_0x37948f[_0xccaf('0x49')],null))[_0xccaf('0x23')](respondWithResult(_0x296a0c,null))[_0xccaf('0x46')](handleError(_0x296a0c,null));};exports[_0xccaf('0x24')]=function(_0x25fb3c,_0x298f18){return db['SquareOdbc'][_0xccaf('0x53')]({'where':{'id':_0x25fb3c[_0xccaf('0x47')]['id']}})['then'](handleEntityNotFound(_0x298f18,null))[_0xccaf('0x23')](removeEntity(_0x298f18,null))['catch'](handleError(_0x298f18,null));};exports['test']=function(_0x194edd,_0x273059,_0x5063cc){var _0x2e710f;return db[_0xccaf('0x48')][_0xccaf('0x53')]({'where':{'id':_0x194edd['params']['id']},'attributes':['id',_0xccaf('0x54')]})['then'](handleEntityNotFound(_0x273059,null))[_0xccaf('0x23')](function(_0x111c48){if(_0x111c48){var _0x2d2209=require('odbc')();_0x2d2209[_0xccaf('0x55')](_0x111c48[_0xccaf('0x54')]);_0x2d2209['closeSync']();return _0x111c48;}})[_0xccaf('0x23')](respondWithResult(_0x273059,null))[_0xccaf('0x46')](handleError(_0x273059,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 92a5569..d5192ce 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 _0x1488=['exports','define','SquareOdbc','square_odbc','lodash','../../config/logger','api','moment','path','../../config/environment','./squareOdbc.attributes'];(function(_0x31d77d,_0x5c5fb1){var _0x3105ef=function(_0x296e6d){while(--_0x296e6d){_0x31d77d['push'](_0x31d77d['shift']());}};_0x3105ef(++_0x5c5fb1);}(_0x1488,0x88));var _0x8148=function(_0x2211ed,_0x1bca0b){_0x2211ed=_0x2211ed-0x0;var _0x4d78cc=_0x1488[_0x2211ed];return _0x4d78cc;};'use strict';var _=require(_0x8148('0x0'));var util=require('util');var logger=require(_0x8148('0x1'))(_0x8148('0x2'));var moment=require(_0x8148('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8148('0x4'));var rimraf=require('rimraf');var config=require(_0x8148('0x5'));var attributes=require(_0x8148('0x6'));module[_0x8148('0x7')]=function(_0x153009,_0x173d87){return _0x153009[_0x8148('0x8')](_0x8148('0x9'),attributes,{'tableName':_0x8148('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd59c=['../../config/environment','exports','define','SquareOdbc','lodash','util','../../config/logger','api','moment'];(function(_0x50fa55,_0x5824d9){var _0x278b36=function(_0xeb6360){while(--_0xeb6360){_0x50fa55['push'](_0x50fa55['shift']());}};_0x278b36(++_0x5824d9);}(_0xd59c,0x12d));var _0xcd59=function(_0x4cb48d,_0x268d5c){_0x4cb48d=_0x4cb48d-0x0;var _0x3a805b=_0xd59c[_0x4cb48d];return _0x3a805b;};'use strict';var _=require(_0xcd59('0x0'));var util=require(_0xcd59('0x1'));var logger=require(_0xcd59('0x2'))(_0xcd59('0x3'));var moment=require(_0xcd59('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(_0xcd59('0x5'));var attributes=require('./squareOdbc.attributes');module[_0xcd59('0x6')]=function(_0x414482,_0x1ca4d2){return _0x414482[_0xcd59('0x7')](_0xcd59('0x8'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 971d07c..246b370 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 _0x05ce=['SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareOdbc','find','options','raw','where','attributes','include','map','model','info','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x05ce,0xe6));var _0xe05c=function(_0x5b06b4,_0x5e8611){_0x5b06b4=_0x5b06b4-0x0;var _0x3c5245=_0x05ce[_0x5b06b4];return _0x3c5245;};'use strict';var _=require(_0xe05c('0x0'));var util=require(_0xe05c('0x1'));var moment=require(_0xe05c('0x2'));var BPromise=require(_0xe05c('0x3'));var rs=require(_0xe05c('0x4'));var fs=require('fs');var Redis=require(_0xe05c('0x5'));var db=require(_0xe05c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe05c('0x7'))(_0xe05c('0x8'));var config=require(_0xe05c('0x9'));var jayson=require(_0xe05c('0xa'));var client=jayson[_0xe05c('0xb')][_0xe05c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5754e8,_0x4725bb,_0x56fe07){return new BPromise(function(_0x59837b,_0xabaf71){return client[_0xe05c('0xd')](_0x5754e8,_0x56fe07)[_0xe05c('0xe')](function(_0x1001c4){logger['info'](_0xe05c('0xf'),_0x4725bb,_0xe05c('0x10'));logger['debug'](_0xe05c('0x11'),_0x4725bb,_0xe05c('0x10'),JSON[_0xe05c('0x12')](_0x1001c4));if(_0x1001c4[_0xe05c('0x13')]){if(_0x1001c4[_0xe05c('0x13')][_0xe05c('0x14')]===0x1f4){logger[_0xe05c('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x4725bb,_0x1001c4['error'][_0xe05c('0x15')]);return _0xabaf71(_0x1001c4[_0xe05c('0x13')][_0xe05c('0x15')]);}logger[_0xe05c('0x13')](_0xe05c('0xf'),_0x4725bb,_0x1001c4[_0xe05c('0x13')][_0xe05c('0x15')]);return _0x59837b(_0x1001c4[_0xe05c('0x13')][_0xe05c('0x15')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x4725bb,'request\x20sent');_0x59837b(_0x1001c4[_0xe05c('0x16')]['message']);}})[_0xe05c('0x17')](function(_0x1b1aeb){logger['error'](_0xe05c('0xf'),_0x4725bb,_0x1b1aeb);_0xabaf71(_0x1b1aeb);});});}exports[_0xe05c('0x18')]=function(_0x378b37){var _0x185463=this;return new Promise(function(_0x45ae70,_0x3f7fd7){return db['SquareOdbc'][_0xe05c('0x19')]({'raw':_0x378b37[_0xe05c('0x1a')]?_0x378b37[_0xe05c('0x1a')][_0xe05c('0x1b')]===undefined?!![]:![]:!![],'where':_0x378b37[_0xe05c('0x1a')]?_0x378b37[_0xe05c('0x1a')][_0xe05c('0x1c')]||null:null,'attributes':_0x378b37[_0xe05c('0x1a')]?_0x378b37[_0xe05c('0x1a')][_0xe05c('0x1d')]||null:null,'include':_0x378b37[_0xe05c('0x1a')]?_0x378b37['options'][_0xe05c('0x1e')]?_[_0xe05c('0x1f')](_0x378b37['options'][_0xe05c('0x1e')],function(_0x3d596d){return{'model':db[_0x3d596d[_0xe05c('0x20')]],'as':_0x3d596d['as'],'attributes':_0x3d596d['attributes'],'include':_0x3d596d[_0xe05c('0x1e')]?_[_0xe05c('0x1f')](_0x3d596d['include'],function(_0x21ad1b){return{'model':db[_0x21ad1b[_0xe05c('0x20')]],'as':_0x21ad1b['as'],'attributes':_0x21ad1b[_0xe05c('0x1d')],'include':_0x21ad1b[_0xe05c('0x1e')]?_[_0xe05c('0x1f')](_0x21ad1b[_0xe05c('0x1e')],function(_0x2cd294){return{'model':db[_0x2cd294[_0xe05c('0x20')]],'as':_0x2cd294['as'],'attributes':_0x2cd294[_0xe05c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe05c('0xe')](function(_0x1a703a){logger[_0xe05c('0x21')]('ShowSquareOdbc',_0x378b37);logger[_0xe05c('0x22')]('ShowSquareOdbc',_0x378b37,JSON[_0xe05c('0x12')](_0x1a703a));_0x45ae70(_0x1a703a);})[_0xe05c('0x17')](function(_0x30775f){logger['error'](_0xe05c('0x18'),_0x30775f[_0xe05c('0x15')],_0x378b37);_0x3f7fd7(_0x185463['error'](0x1f4,_0x30775f[_0xe05c('0x15')]));});});}; \ No newline at end of file +var _0x1b2f=['find','options','raw','where','include','map','model','ShowSquareOdbc','debug','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SquareOdbc'];(function(_0x2cd91f,_0x343632){var _0x24a06a=function(_0x5e68d3){while(--_0x5e68d3){_0x2cd91f['push'](_0x2cd91f['shift']());}};_0x24a06a(++_0x343632);}(_0x1b2f,0xa4));var _0xf1b2=function(_0x40858c,_0x4fdd5f){_0x40858c=_0x40858c-0x0;var _0x50aec1=_0x1b2f[_0x40858c];return _0x50aec1;};'use strict';var _=require('lodash');var util=require(_0xf1b2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf1b2('0x1'));var fs=require('fs');var Redis=require(_0xf1b2('0x2'));var db=require(_0xf1b2('0x3'))['db'];var utils=require(_0xf1b2('0x4'));var logger=require(_0xf1b2('0x5'))(_0xf1b2('0x6'));var config=require(_0xf1b2('0x7'));var jayson=require(_0xf1b2('0x8'));var client=jayson[_0xf1b2('0x9')][_0xf1b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16f0c8,_0x3dfd73,_0x349cfe){return new BPromise(function(_0x3c4d11,_0x435f8b){return client[_0xf1b2('0xb')](_0x16f0c8,_0x349cfe)['then'](function(_0x566fc1){logger[_0xf1b2('0xc')](_0xf1b2('0xd'),_0x3dfd73,'request\x20sent');logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x3dfd73,_0xf1b2('0xe'),JSON[_0xf1b2('0xf')](_0x566fc1));if(_0x566fc1[_0xf1b2('0x10')]){if(_0x566fc1[_0xf1b2('0x10')][_0xf1b2('0x11')]===0x1f4){logger[_0xf1b2('0x10')](_0xf1b2('0xd'),_0x3dfd73,_0x566fc1['error'][_0xf1b2('0x12')]);return _0x435f8b(_0x566fc1[_0xf1b2('0x10')]['message']);}logger[_0xf1b2('0x10')](_0xf1b2('0xd'),_0x3dfd73,_0x566fc1['error'][_0xf1b2('0x12')]);return _0x3c4d11(_0x566fc1[_0xf1b2('0x10')][_0xf1b2('0x12')]);}else{logger[_0xf1b2('0xc')]('SquareOdbc,\x20%s,\x20%s',_0x3dfd73,_0xf1b2('0xe'));_0x3c4d11(_0x566fc1[_0xf1b2('0x13')][_0xf1b2('0x12')]);}})[_0xf1b2('0x14')](function(_0x53335f){logger[_0xf1b2('0x10')](_0xf1b2('0xd'),_0x3dfd73,_0x53335f);_0x435f8b(_0x53335f);});});}exports['ShowSquareOdbc']=function(_0x2159fa){var _0x1d0a95=this;return new Promise(function(_0x3994ae,_0x5a1d52){return db[_0xf1b2('0x15')][_0xf1b2('0x16')]({'raw':_0x2159fa['options']?_0x2159fa[_0xf1b2('0x17')][_0xf1b2('0x18')]===undefined?!![]:![]:!![],'where':_0x2159fa[_0xf1b2('0x17')]?_0x2159fa[_0xf1b2('0x17')][_0xf1b2('0x19')]||null:null,'attributes':_0x2159fa[_0xf1b2('0x17')]?_0x2159fa[_0xf1b2('0x17')]['attributes']||null:null,'include':_0x2159fa[_0xf1b2('0x17')]?_0x2159fa[_0xf1b2('0x17')][_0xf1b2('0x1a')]?_[_0xf1b2('0x1b')](_0x2159fa[_0xf1b2('0x17')][_0xf1b2('0x1a')],function(_0x24da7){return{'model':db[_0x24da7['model']],'as':_0x24da7['as'],'attributes':_0x24da7['attributes'],'include':_0x24da7[_0xf1b2('0x1a')]?_['map'](_0x24da7[_0xf1b2('0x1a')],function(_0x1398fe){return{'model':db[_0x1398fe['model']],'as':_0x1398fe['as'],'attributes':_0x1398fe['attributes'],'include':_0x1398fe[_0xf1b2('0x1a')]?_[_0xf1b2('0x1b')](_0x1398fe[_0xf1b2('0x1a')],function(_0x45af76){return{'model':db[_0x45af76[_0xf1b2('0x1c')]],'as':_0x45af76['as'],'attributes':_0x45af76['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1bfd0e){logger['info'](_0xf1b2('0x1d'),_0x2159fa);logger[_0xf1b2('0x1e')](_0xf1b2('0x1d'),_0x2159fa,JSON[_0xf1b2('0xf')](_0x1bfd0e));_0x3994ae(_0x1bfd0e);})[_0xf1b2('0x14')](function(_0x140a74){logger[_0xf1b2('0x10')](_0xf1b2('0x1d'),_0x140a74['message'],_0x2159fa);_0x5a1d52(_0x1d0a95[_0xf1b2('0x10')](0x1f4,_0x140a74['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index ea67fae..f360c6b 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 _0x02a4=['./squareProject.controller','get','index','/:id','show','isAuthenticated','getUsers','post','addUsers','update','destroy','removeUsers','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x02a4,0x19d));var _0x402a=function(_0x3fcc54,_0x1d7e94){_0x3fcc54=_0x3fcc54-0x0;var _0x1f60af=_0x02a4[_0x3fcc54];return _0x1f60af;};'use strict';var multer=require(_0x402a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x402a('0x1'));var express=require(_0x402a('0x2'));var router=express[_0x402a('0x3')]();var fs_extra=require(_0x402a('0x4'));var auth=require(_0x402a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x402a('0x6'));var controller=require(_0x402a('0x7'));router[_0x402a('0x8')]('/',auth['isAuthenticated'](),controller[_0x402a('0x9')]);router[_0x402a('0x8')](_0x402a('0xa'),auth['isAuthenticated'](),controller[_0x402a('0xb')]);router[_0x402a('0x8')]('/:id/users',auth[_0x402a('0xc')](),controller[_0x402a('0xd')]);router[_0x402a('0xe')]('/',auth[_0x402a('0xc')](),controller['create']);router['post']('/:id/users',auth[_0x402a('0xc')](),controller[_0x402a('0xf')]);router['put']('/:id',auth[_0x402a('0xc')](),controller[_0x402a('0x10')]);router['delete'](_0x402a('0xa'),auth[_0x402a('0xc')](),controller[_0x402a('0x11')]);router['delete']('/:id/users',auth[_0x402a('0xc')](),controller[_0x402a('0x12')]);module[_0x402a('0x13')]=router; \ No newline at end of file +var _0x21ad=['get','isAuthenticated','/:id','/:id/users','getUsers','post','create','addUsers','put','update','destroy','delete','removeUsers','multer','path','connect-timeout','express','fs-extra','../../config/environment','./squareProject.controller'];(function(_0x2e7553,_0x39f65b){var _0x3d1ddf=function(_0x49b1a0){while(--_0x49b1a0){_0x2e7553['push'](_0x2e7553['shift']());}};_0x3d1ddf(++_0x39f65b);}(_0x21ad,0x85));var _0xd21a=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x21ad[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0xd21a('0x0'));var util=require('util');var path=require(_0xd21a('0x1'));var timeout=require(_0xd21a('0x2'));var express=require(_0xd21a('0x3'));var router=express['Router']();var fs_extra=require(_0xd21a('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd21a('0x5'));var controller=require(_0xd21a('0x6'));router[_0xd21a('0x7')]('/',auth[_0xd21a('0x8')](),controller['index']);router[_0xd21a('0x7')](_0xd21a('0x9'),auth[_0xd21a('0x8')](),controller['show']);router[_0xd21a('0x7')](_0xd21a('0xa'),auth['isAuthenticated'](),controller[_0xd21a('0xb')]);router[_0xd21a('0xc')]('/',auth['isAuthenticated'](),controller[_0xd21a('0xd')]);router[_0xd21a('0xc')](_0xd21a('0xa'),auth[_0xd21a('0x8')](),controller[_0xd21a('0xe')]);router[_0xd21a('0xf')]('/:id',auth[_0xd21a('0x8')](),controller[_0xd21a('0x10')]);router['delete'](_0xd21a('0x9'),auth[_0xd21a('0x8')](),controller[_0xd21a('0x11')]);router[_0xd21a('0x12')](_0xd21a('0xa'),auth[_0xd21a('0x8')](),controller[_0xd21a('0x13')]);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 4a65431..48f7c20 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 _0xac73=['preproduction','toString','utf8','BLOB','production','DATE','sequelize','exports','STRING','name','long','getDataValue'];(function(_0x410988,_0x2d9899){var _0x51ea6e=function(_0x2703e7){while(--_0x2703e7){_0x410988['push'](_0x410988['shift']());}};_0x51ea6e(++_0x2d9899);}(_0xac73,0x186));var _0x3ac7=function(_0x2197b7,_0x30fce2){_0x2197b7=_0x2197b7-0x0;var _0x1a6731=_0xac73[_0x2197b7];return _0x1a6731;};'use strict';var Sequelize=require(_0x3ac7('0x0'));module[_0x3ac7('0x1')]={'name':{'type':Sequelize[_0x3ac7('0x2')],'unique':_0x3ac7('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x3ac7('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize['BLOB'](_0x3ac7('0x4')),'get':function(){if(this[_0x3ac7('0x5')](_0x3ac7('0x6'))){return this[_0x3ac7('0x5')]('preproduction')[_0x3ac7('0x7')](_0x3ac7('0x8'));}}},'production':{'type':Sequelize[_0x3ac7('0x9')](_0x3ac7('0x4')),'get':function(){if(this[_0x3ac7('0x5')]('production')){return this[_0x3ac7('0x5')](_0x3ac7('0xa'))[_0x3ac7('0x7')]('utf8');}}},'savedAt':{'type':Sequelize[_0x3ac7('0xb')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x292c=['preproduction','toString','utf8','long','production','DATE','sequelize','STRING','name','TEXT','BLOB','getDataValue'];(function(_0x18fb16,_0x45edbc){var _0x147b0d=function(_0x5b1b00){while(--_0x5b1b00){_0x18fb16['push'](_0x18fb16['shift']());}};_0x147b0d(++_0x45edbc);}(_0x292c,0x66));var _0xc292=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x292c[_0x5e3b04];return _0x1fc44d;};'use strict';var Sequelize=require(_0xc292('0x0'));module['exports']={'name':{'type':Sequelize[_0xc292('0x1')],'unique':_0xc292('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xc292('0x1')]},'notes':{'type':Sequelize[_0xc292('0x3')]},'preproduction':{'type':Sequelize[_0xc292('0x4')]('long'),'get':function(){if(this[_0xc292('0x5')]('preproduction')){return this['getDataValue'](_0xc292('0x6'))[_0xc292('0x7')](_0xc292('0x8'));}}},'production':{'type':Sequelize[_0xc292('0x4')](_0xc292('0x9')),'get':function(){if(this[_0xc292('0x5')](_0xc292('0xa'))){return this[_0xc292('0x5')](_0xc292('0xa'))[_0xc292('0x7')]('utf8');}}},'savedAt':{'type':Sequelize[_0xc292('0xb')]},'publishedAt':{'type':Sequelize[_0xc292('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 0f4a367..3608ca3 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 _0xaf9c=['../../config/license/util','../../mysqldb','redis','defaults','localhost','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','name','send','index','map','SquareProject','rawAttributes','fieldName','key','model','query','intersection','attributes','length','nolimit','order','where','filters','filter','type','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','keys','fields','include','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','addUsers','ids','omit','isArray','userSquareProject:remove','emit','getUsers','User','sort','pick','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x55d83d,_0x3241d8){var _0x25df7f=function(_0x224f76){while(--_0x224f76){_0x55d83d['push'](_0x55d83d['shift']());}};_0x25df7f(++_0x3241d8);}(_0xaf9c,0xb1));var _0xcaf9=function(_0x4aa838,_0x4aa14f){_0x4aa838=_0x4aa838-0x0;var _0x3abff0=_0xaf9c[_0x4aa838];return _0x3abff0;};'use strict';var emlformat=require(_0xcaf9('0x0'));var rimraf=require(_0xcaf9('0x1'));var zipdir=require(_0xcaf9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcaf9('0x3'));var moment=require(_0xcaf9('0x4'));var BPromise=require(_0xcaf9('0x5'));var Mustache=require(_0xcaf9('0x6'));var util=require('util');var path=require(_0xcaf9('0x7'));var sox=require(_0xcaf9('0x8'));var csv=require(_0xcaf9('0x9'));var ejs=require(_0xcaf9('0xa'));var fs=require('fs');var fs_extra=require(_0xcaf9('0xb'));var _=require(_0xcaf9('0xc'));var squel=require(_0xcaf9('0xd'));var crypto=require(_0xcaf9('0xe'));var jsforce=require(_0xcaf9('0xf'));var deskjs=require(_0xcaf9('0x10'));var toCsv=require(_0xcaf9('0x9'));var querystring=require(_0xcaf9('0x11'));var Papa=require(_0xcaf9('0x12'));var Redis=require(_0xcaf9('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xcaf9('0x14'));var as=require(_0xcaf9('0x15'));var hardwareService=require(_0xcaf9('0x16'));var logger=require(_0xcaf9('0x17'))(_0xcaf9('0x18'));var utils=require(_0xcaf9('0x19'));var config=require(_0xcaf9('0x1a'));var licenseUtil=require(_0xcaf9('0x1b'));var db=require(_0xcaf9('0x1c'))['db'];config[_0xcaf9('0x1d')]=_[_0xcaf9('0x1e')](config[_0xcaf9('0x1d')],{'host':_0xcaf9('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcaf9('0x1d')]));require(_0xcaf9('0x20'))[_0xcaf9('0x21')](socket);function respondWithStatusCode(_0x31a5a9,_0x3e2875){_0x3e2875=_0x3e2875||0xcc;return function(_0x5d3b15){if(_0x5d3b15){return _0x31a5a9[_0xcaf9('0x22')](_0x3e2875);}return _0x31a5a9[_0xcaf9('0x23')](_0x3e2875)[_0xcaf9('0x24')]();};}function respondWithResult(_0x81fe26,_0x498b08){_0x498b08=_0x498b08||0xc8;return function(_0x715dfb){if(_0x715dfb){return _0x81fe26['status'](_0x498b08)[_0xcaf9('0x25')](_0x715dfb);}};}function respondWithFilteredResult(_0x57e322,_0x4adc2c){return function(_0x10c4b4){if(_0x10c4b4){var _0x571cd1=typeof _0x4adc2c[_0xcaf9('0x26')]===_0xcaf9('0x27')&&typeof _0x4adc2c[_0xcaf9('0x28')]===_0xcaf9('0x27');var _0x1353a6=_0x10c4b4[_0xcaf9('0x29')];var _0x38617a=_0x571cd1?0x0:_0x4adc2c[_0xcaf9('0x26')];var _0xedc40d=_0x571cd1?_0x10c4b4[_0xcaf9('0x29')]:_0x4adc2c[_0xcaf9('0x26')]+_0x4adc2c[_0xcaf9('0x28')];var _0x469095;if(_0xedc40d>=_0x1353a6){_0xedc40d=_0x1353a6;_0x469095=0xc8;}else{_0x469095=0xce;}_0x57e322['status'](_0x469095);return _0x57e322['set'](_0xcaf9('0x2a'),_0x38617a+'-'+_0xedc40d+'/'+_0x1353a6)[_0xcaf9('0x25')](_0x10c4b4);}return null;};}function patchUpdates(_0x4c23f0){return function(_0x3cde69){try{jsonpatch[_0xcaf9('0x2b')](_0x3cde69,_0x4c23f0,!![]);}catch(_0x3b6f1a){return BPromise[_0xcaf9('0x2c')](_0x3b6f1a);}return _0x3cde69[_0xcaf9('0x2d')]();};}function saveUpdates(_0x277b80,_0x27ad11){return function(_0x20cd9c){if(_0x20cd9c){return _0x20cd9c[_0xcaf9('0x2e')](_0x277b80)['then'](function(_0x2796ab){return _0x2796ab;});}return null;};}function removeEntity(_0x3b9332,_0x4c5398){return function(_0x669372){if(_0x669372){return _0x669372[_0xcaf9('0x2f')]()[_0xcaf9('0x30')](function(){var _0x4b5254=_0x669372[_0xcaf9('0x31')]({'plain':!![]});var _0x5d9c21='SquareProjects';return db[_0xcaf9('0x32')]['destroy']({'where':{'type':_0x5d9c21,'resourceId':_0x4b5254['id']}})[_0xcaf9('0x30')](function(){return _0x669372;});})[_0xcaf9('0x30')](function(){_0x3b9332[_0xcaf9('0x23')](0xcc)[_0xcaf9('0x24')]();});}};}function handleEntityNotFound(_0x3e85e5,_0x5cfe36){return function(_0x2e95f1){if(!_0x2e95f1){_0x3e85e5[_0xcaf9('0x22')](0x194);}return _0x2e95f1;};}function handleError(_0x4126eb,_0x1caeb5){_0x1caeb5=_0x1caeb5||0x1f4;return function(_0x5e1b93){logger['error'](_0x5e1b93['stack']);if(_0x5e1b93[_0xcaf9('0x33')]){delete _0x5e1b93['name'];}_0x4126eb[_0xcaf9('0x23')](_0x1caeb5)[_0xcaf9('0x34')](_0x5e1b93);};}exports[_0xcaf9('0x35')]=function(_0x56c9db,_0x158f79){var _0x2d1c33={},_0x494580={},_0x200cd1={'count':0x0,'rows':[]};var _0x57d8a1=_[_0xcaf9('0x36')](db[_0xcaf9('0x37')][_0xcaf9('0x38')],function(_0x4726a1){return{'name':_0x4726a1[_0xcaf9('0x39')],'type':_0x4726a1['type'][_0xcaf9('0x3a')]};});_0x494580[_0xcaf9('0x3b')]=_[_0xcaf9('0x36')](_0x57d8a1,_0xcaf9('0x33'));_0x494580[_0xcaf9('0x3c')]=_['keys'](_0x56c9db['query']);_0x494580['filters']=_[_0xcaf9('0x3d')](_0x494580[_0xcaf9('0x3b')],_0x494580['query']);_0x2d1c33[_0xcaf9('0x3e')]=_[_0xcaf9('0x3d')](_0x494580[_0xcaf9('0x3b')],qs['fields'](_0x56c9db['query']['fields']));_0x2d1c33[_0xcaf9('0x3e')]=_0x2d1c33['attributes'][_0xcaf9('0x3f')]?_0x2d1c33[_0xcaf9('0x3e')]:_0x494580['model'];if(!_0x56c9db[_0xcaf9('0x3c')]['hasOwnProperty'](_0xcaf9('0x40'))){_0x2d1c33[_0xcaf9('0x28')]=qs[_0xcaf9('0x28')](_0x56c9db[_0xcaf9('0x3c')][_0xcaf9('0x28')]);_0x2d1c33[_0xcaf9('0x26')]=qs[_0xcaf9('0x26')](_0x56c9db[_0xcaf9('0x3c')][_0xcaf9('0x26')]);}_0x2d1c33[_0xcaf9('0x41')]=qs['sort'](_0x56c9db[_0xcaf9('0x3c')]['sort']);_0x2d1c33[_0xcaf9('0x42')]=qs[_0xcaf9('0x43')](_['pick'](_0x56c9db[_0xcaf9('0x3c')],_0x494580[_0xcaf9('0x43')]),_0x57d8a1);if(_0x56c9db[_0xcaf9('0x3c')][_0xcaf9('0x44')]){_0x2d1c33[_0xcaf9('0x42')]=_['merge'](_0x2d1c33[_0xcaf9('0x42')],{'$or':_[_0xcaf9('0x36')](_0x57d8a1,function(_0x44a2c4){if(_0x44a2c4[_0xcaf9('0x45')]!==_0xcaf9('0x46')){var _0x1ff964={};_0x1ff964[_0x44a2c4[_0xcaf9('0x33')]]={'$like':'%'+_0x56c9db[_0xcaf9('0x3c')][_0xcaf9('0x44')]+'%'};return _0x1ff964;}})});}_0x2d1c33=_[_0xcaf9('0x47')]({},_0x2d1c33,_0x56c9db[_0xcaf9('0x48')]);var _0x34ffab={'where':_0x2d1c33[_0xcaf9('0x42')]};return db[_0xcaf9('0x37')][_0xcaf9('0x29')](_0x34ffab)[_0xcaf9('0x30')](function(_0x7809cc){_0x200cd1[_0xcaf9('0x29')]=_0x7809cc;if(_0x56c9db[_0xcaf9('0x3c')][_0xcaf9('0x49')]){_0x2d1c33['include']=[{'all':!![]}];}return db['SquareProject'][_0xcaf9('0x4a')](_0x2d1c33);})[_0xcaf9('0x30')](function(_0xb89f63){_0x200cd1['rows']=_0xb89f63;return _0x200cd1;})['then'](respondWithFilteredResult(_0x158f79,_0x2d1c33))[_0xcaf9('0x4b')](handleError(_0x158f79,null));};exports[_0xcaf9('0x4c')]=function(_0x59f59f,_0x2cb578){var _0x147822={'raw':![],'where':{'id':_0x59f59f[_0xcaf9('0x4d')]['id']}},_0xe3f648={};_0xe3f648[_0xcaf9('0x3b')]=_['keys'](db[_0xcaf9('0x37')][_0xcaf9('0x38')]);_0xe3f648[_0xcaf9('0x3c')]=_[_0xcaf9('0x4e')](_0x59f59f['query']);_0xe3f648['filters']=_[_0xcaf9('0x3d')](_0xe3f648[_0xcaf9('0x3b')],_0xe3f648[_0xcaf9('0x3c')]);_0x147822['attributes']=_[_0xcaf9('0x3d')](_0xe3f648[_0xcaf9('0x3b')],qs[_0xcaf9('0x4f')](_0x59f59f['query']['fields']));_0x147822[_0xcaf9('0x3e')]=_0x147822[_0xcaf9('0x3e')][_0xcaf9('0x3f')]?_0x147822[_0xcaf9('0x3e')]:_0xe3f648['model'];if(_0x59f59f['query'][_0xcaf9('0x49')]){_0x147822[_0xcaf9('0x50')]=[{'all':!![]}];}_0x147822=_[_0xcaf9('0x47')]({},_0x147822,_0x59f59f[_0xcaf9('0x48')]);return db[_0xcaf9('0x37')]['find'](_0x147822)['then'](handleEntityNotFound(_0x2cb578,null))['then'](respondWithResult(_0x2cb578,null))[_0xcaf9('0x4b')](handleError(_0x2cb578,null));};exports[_0xcaf9('0x51')]=function(_0xef17f9,_0x60fcd2){return db[_0xcaf9('0x37')][_0xcaf9('0x51')](_0xef17f9[_0xcaf9('0x52')],{})[_0xcaf9('0x30')](function(_0x3418dc){var _0x1cf64e=_0xef17f9['user'][_0xcaf9('0x31')]({'plain':!![]});if(!_0x1cf64e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1cf64e[_0xcaf9('0x53')]===_0xcaf9('0x54')){var _0x1d8bea=_0x3418dc['get']({'plain':!![]});var _0x1cd7f3='SquareProjects';return db[_0xcaf9('0x55')]['find']({'where':{'name':_0x1cd7f3,'userProfileId':_0x1cf64e[_0xcaf9('0x56')]},'raw':!![]})['then'](function(_0x171df6){if(_0x171df6&&_0x171df6[_0xcaf9('0x57')]===0x0){return db[_0xcaf9('0x32')][_0xcaf9('0x51')]({'name':_0x1d8bea[_0xcaf9('0x33')],'resourceId':_0x1d8bea['id'],'type':_0x171df6[_0xcaf9('0x33')],'sectionId':_0x171df6['id']},{})[_0xcaf9('0x30')](function(){return _0x3418dc;});}else{return _0x3418dc;}})[_0xcaf9('0x4b')](function(_0x3e3244){logger[_0xcaf9('0x58')](_0xcaf9('0x59'),_0x3e3244);throw _0x3e3244;});}return _0x3418dc;})[_0xcaf9('0x30')](respondWithResult(_0x60fcd2,0xc9))[_0xcaf9('0x4b')](handleError(_0x60fcd2,null));};exports[_0xcaf9('0x2e')]=function(_0x5d7f77,_0x3550ff){if(_0x5d7f77['body']['id']){delete _0x5d7f77[_0xcaf9('0x52')]['id'];}return db[_0xcaf9('0x37')][_0xcaf9('0x5a')]({'where':{'id':_0x5d7f77['params']['id']}})[_0xcaf9('0x30')](handleEntityNotFound(_0x3550ff,null))[_0xcaf9('0x30')](saveUpdates(_0x5d7f77[_0xcaf9('0x52')],null))[_0xcaf9('0x30')](respondWithResult(_0x3550ff,null))['catch'](handleError(_0x3550ff,null));};exports[_0xcaf9('0x2f')]=function(_0x4e2bcc,_0x2d9af2){return db[_0xcaf9('0x37')][_0xcaf9('0x5a')]({'where':{'id':_0x4e2bcc[_0xcaf9('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2d9af2,null))[_0xcaf9('0x30')](removeEntity(_0x2d9af2,null))['catch'](handleError(_0x2d9af2,null));};exports['addUsers']=function(_0x3be76e,_0x2d8caf,_0x6e9497){return db[_0xcaf9('0x37')][_0xcaf9('0x5a')]({'where':{'id':_0x3be76e['params']['id']}})['then'](handleEntityNotFound(_0x2d8caf,null))[_0xcaf9('0x30')](function(_0x3bfb99){if(_0x3bfb99){return _0x3bfb99[_0xcaf9('0x5b')](_0x3be76e['body'][_0xcaf9('0x5c')],_[_0xcaf9('0x5d')](_0x3be76e[_0xcaf9('0x52')],[_0xcaf9('0x5c'),'id'])||{});}})['then'](respondWithResult(_0x2d8caf,null))[_0xcaf9('0x4b')](handleError(_0x2d8caf,null));};exports['removeUsers']=function(_0x58d495,_0x5f0d61,_0x253a2e){return db['SquareProject'][_0xcaf9('0x5a')]({'where':{'id':_0x58d495[_0xcaf9('0x4d')]['id']}})[_0xcaf9('0x30')](handleEntityNotFound(_0x5f0d61,null))[_0xcaf9('0x30')](function(_0x3f9c02){if(_0x3f9c02){return _0x3f9c02['removeUsers'](_0x58d495[_0xcaf9('0x3c')][_0xcaf9('0x5c')])[_0xcaf9('0x30')](function(){if(_[_0xcaf9('0x5e')](_0x58d495['query'][_0xcaf9('0x5c')])){for(var _0x347bfa=0x0;_0x347bfa<_0x58d495['query'][_0xcaf9('0x5c')][_0xcaf9('0x3f')];_0x347bfa+=0x1){socket['emit'](_0xcaf9('0x5f'),{'UserId':Number(_0x58d495[_0xcaf9('0x3c')][_0xcaf9('0x5c')][_0x347bfa]),'SquareProjectId':Number(_0x58d495[_0xcaf9('0x4d')]['id'])});}}else{socket[_0xcaf9('0x60')](_0xcaf9('0x5f'),{'UserId':Number(_0x58d495[_0xcaf9('0x3c')][_0xcaf9('0x5c')]),'SquareProjectId':Number(_0x58d495[_0xcaf9('0x4d')]['id'])});}});}})[_0xcaf9('0x30')](respondWithStatusCode(_0x5f0d61,null))[_0xcaf9('0x4b')](handleError(_0x5f0d61,null));};exports[_0xcaf9('0x61')]=function(_0x218d3f,_0x3e33ea,_0x149bd1){var _0x10128d={};var _0x1152aa={};var _0x5c81ed;var _0x3b227c;return db[_0xcaf9('0x37')]['findOne']({'where':{'id':_0x218d3f[_0xcaf9('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3e33ea,null))[_0xcaf9('0x30')](function(_0x31eb8d){if(_0x31eb8d){_0x5c81ed=_0x31eb8d;_0x1152aa[_0xcaf9('0x3b')]=_[_0xcaf9('0x4e')](db[_0xcaf9('0x62')][_0xcaf9('0x38')]);_0x1152aa[_0xcaf9('0x3c')]=_[_0xcaf9('0x4e')](_0x218d3f[_0xcaf9('0x3c')]);_0x1152aa[_0xcaf9('0x43')]=_['intersection'](_0x1152aa[_0xcaf9('0x3b')],_0x1152aa[_0xcaf9('0x3c')]);_0x10128d[_0xcaf9('0x3e')]=_[_0xcaf9('0x3d')](_0x1152aa[_0xcaf9('0x3b')],qs[_0xcaf9('0x4f')](_0x218d3f[_0xcaf9('0x3c')][_0xcaf9('0x4f')]));_0x10128d['attributes']=_0x10128d[_0xcaf9('0x3e')]['length']?_0x10128d['attributes']:_0x1152aa[_0xcaf9('0x3b')];_0x10128d[_0xcaf9('0x41')]=qs[_0xcaf9('0x63')](_0x218d3f[_0xcaf9('0x3c')][_0xcaf9('0x63')]);_0x10128d[_0xcaf9('0x42')]=qs[_0xcaf9('0x43')](_[_0xcaf9('0x64')](_0x218d3f[_0xcaf9('0x3c')],_0x1152aa['filters']));if(_0x218d3f[_0xcaf9('0x3c')][_0xcaf9('0x44')]){_0x10128d[_0xcaf9('0x42')]=_['merge'](_0x10128d[_0xcaf9('0x42')],{'$or':_[_0xcaf9('0x36')](_0x10128d[_0xcaf9('0x3e')],function(_0x3ca6b6){var _0x9774b={};_0x9774b[_0x3ca6b6]={'$like':'%'+_0x218d3f[_0xcaf9('0x3c')][_0xcaf9('0x44')]+'%'};return _0x9774b;})});}_0x10128d=_[_0xcaf9('0x47')]({},_0x10128d,_0x218d3f['options']);return _0x5c81ed['getUsers'](_0x10128d);}})[_0xcaf9('0x30')](function(_0x4b4673){if(_0x4b4673){_0x3b227c=_0x4b4673[_0xcaf9('0x3f')];if(!_0x218d3f[_0xcaf9('0x3c')][_0xcaf9('0x65')](_0xcaf9('0x40'))){_0x10128d[_0xcaf9('0x28')]=qs[_0xcaf9('0x28')](_0x218d3f['query'][_0xcaf9('0x28')]);_0x10128d[_0xcaf9('0x26')]=qs[_0xcaf9('0x26')](_0x218d3f[_0xcaf9('0x3c')][_0xcaf9('0x26')]);}return _0x5c81ed[_0xcaf9('0x61')](_0x10128d);}})['then'](function(_0x4c37e6){if(_0x4c37e6){return _0x4c37e6?{'count':_0x3b227c,'rows':_0x4c37e6}:null;}})['then'](respondWithResult(_0x3e33ea,null))['catch'](handleError(_0x3e33ea,null));}; \ No newline at end of file +var _0x929e=['filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','SquareProject','findAll','rows','catch','show','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','find','addUsers','params','ids','omit','removeUsers','isArray','userSquareProject:remove','getUsers','User','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','SquareProjects','name','map','rawAttributes','fieldName','type','model','query','keys'];(function(_0xddfa28,_0x34962d){var _0x4f10ae=function(_0x417785){while(--_0x417785){_0xddfa28['push'](_0xddfa28['shift']());}};_0x4f10ae(++_0x34962d);}(_0x929e,0xe5));var _0xe929=function(_0x16cb4c,_0x2144c9){_0x16cb4c=_0x16cb4c-0x0;var _0x3ea5d7=_0x929e[_0x16cb4c];return _0x3ea5d7;};'use strict';var emlformat=require(_0xe929('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe929('0x1'));var jsonpatch=require(_0xe929('0x2'));var rp=require(_0xe929('0x3'));var moment=require(_0xe929('0x4'));var BPromise=require(_0xe929('0x5'));var Mustache=require('mustache');var util=require(_0xe929('0x6'));var path=require(_0xe929('0x7'));var sox=require(_0xe929('0x8'));var csv=require(_0xe929('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe929('0xa'));var _=require(_0xe929('0xb'));var squel=require(_0xe929('0xc'));var crypto=require(_0xe929('0xd'));var jsforce=require(_0xe929('0xe'));var deskjs=require(_0xe929('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe929('0x10'));var Redis=require('ioredis');var authService=require(_0xe929('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe929('0x12'));var hardwareService=require(_0xe929('0x13'));var logger=require('../../config/logger')(_0xe929('0x14'));var utils=require(_0xe929('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe929('0x16'))['db'];config[_0xe929('0x17')]=_['defaults'](config[_0xe929('0x17')],{'host':_0xe929('0x18'),'port':0x18eb});var socket=require(_0xe929('0x19'))(new Redis(config['redis']));require(_0xe929('0x1a'))[_0xe929('0x1b')](socket);function respondWithStatusCode(_0x523d89,_0x1d7c8d){_0x1d7c8d=_0x1d7c8d||0xcc;return function(_0x1ba836){if(_0x1ba836){return _0x523d89[_0xe929('0x1c')](_0x1d7c8d);}return _0x523d89[_0xe929('0x1d')](_0x1d7c8d)[_0xe929('0x1e')]();};}function respondWithResult(_0x17bb0c,_0x225ace){_0x225ace=_0x225ace||0xc8;return function(_0x339188){if(_0x339188){return _0x17bb0c['status'](_0x225ace)[_0xe929('0x1f')](_0x339188);}};}function respondWithFilteredResult(_0x272b92,_0x79224d){return function(_0x4a5a94){if(_0x4a5a94){var _0x33d847=typeof _0x79224d[_0xe929('0x20')]===_0xe929('0x21')&&typeof _0x79224d['limit']===_0xe929('0x21');var _0x5551bc=_0x4a5a94[_0xe929('0x22')];var _0x2e93f6=_0x33d847?0x0:_0x79224d['offset'];var _0x50d5df=_0x33d847?_0x4a5a94[_0xe929('0x22')]:_0x79224d['offset']+_0x79224d[_0xe929('0x23')];var _0x1eddb6;if(_0x50d5df>=_0x5551bc){_0x50d5df=_0x5551bc;_0x1eddb6=0xc8;}else{_0x1eddb6=0xce;}_0x272b92['status'](_0x1eddb6);return _0x272b92['set'](_0xe929('0x24'),_0x2e93f6+'-'+_0x50d5df+'/'+_0x5551bc)[_0xe929('0x1f')](_0x4a5a94);}return null;};}function patchUpdates(_0x38c894){return function(_0x59e60d){try{jsonpatch[_0xe929('0x25')](_0x59e60d,_0x38c894,!![]);}catch(_0x446999){return BPromise[_0xe929('0x26')](_0x446999);}return _0x59e60d[_0xe929('0x27')]();};}function saveUpdates(_0x2e2137,_0x22de73){return function(_0x5f062f){if(_0x5f062f){return _0x5f062f[_0xe929('0x28')](_0x2e2137)[_0xe929('0x29')](function(_0x4a87ef){return _0x4a87ef;});}return null;};}function removeEntity(_0x3f30eb,_0x4b62f8){return function(_0x2279d1){if(_0x2279d1){return _0x2279d1[_0xe929('0x2a')]()[_0xe929('0x29')](function(){var _0x1b00cf=_0x2279d1[_0xe929('0x2b')]({'plain':!![]});var _0x712c15=_0xe929('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x712c15,'resourceId':_0x1b00cf['id']}})['then'](function(){return _0x2279d1;});})[_0xe929('0x29')](function(){_0x3f30eb[_0xe929('0x1d')](0xcc)[_0xe929('0x1e')]();});}};}function handleEntityNotFound(_0x3c0f6b,_0xc84241){return function(_0x498667){if(!_0x498667){_0x3c0f6b[_0xe929('0x1c')](0x194);}return _0x498667;};}function handleError(_0x4bb089,_0xc8a3d4){_0xc8a3d4=_0xc8a3d4||0x1f4;return function(_0x4f5c55){logger['error'](_0x4f5c55['stack']);if(_0x4f5c55[_0xe929('0x2d')]){delete _0x4f5c55[_0xe929('0x2d')];}_0x4bb089[_0xe929('0x1d')](_0xc8a3d4)['send'](_0x4f5c55);};}exports['index']=function(_0x2251a7,_0x46f6e2){var _0x36315f={},_0x488f76={},_0x464a77={'count':0x0,'rows':[]};var _0xab5203=_[_0xe929('0x2e')](db['SquareProject'][_0xe929('0x2f')],function(_0xaafbae){return{'name':_0xaafbae[_0xe929('0x30')],'type':_0xaafbae[_0xe929('0x31')]['key']};});_0x488f76[_0xe929('0x32')]=_[_0xe929('0x2e')](_0xab5203,_0xe929('0x2d'));_0x488f76[_0xe929('0x33')]=_[_0xe929('0x34')](_0x2251a7[_0xe929('0x33')]);_0x488f76[_0xe929('0x35')]=_[_0xe929('0x36')](_0x488f76[_0xe929('0x32')],_0x488f76['query']);_0x36315f['attributes']=_[_0xe929('0x36')](_0x488f76['model'],qs[_0xe929('0x37')](_0x2251a7[_0xe929('0x33')][_0xe929('0x37')]));_0x36315f[_0xe929('0x38')]=_0x36315f[_0xe929('0x38')][_0xe929('0x39')]?_0x36315f['attributes']:_0x488f76[_0xe929('0x32')];if(!_0x2251a7['query'][_0xe929('0x3a')](_0xe929('0x3b'))){_0x36315f[_0xe929('0x23')]=qs['limit'](_0x2251a7[_0xe929('0x33')][_0xe929('0x23')]);_0x36315f[_0xe929('0x20')]=qs[_0xe929('0x20')](_0x2251a7[_0xe929('0x33')][_0xe929('0x20')]);}_0x36315f[_0xe929('0x3c')]=qs[_0xe929('0x3d')](_0x2251a7[_0xe929('0x33')][_0xe929('0x3d')]);_0x36315f[_0xe929('0x3e')]=qs[_0xe929('0x35')](_[_0xe929('0x3f')](_0x2251a7[_0xe929('0x33')],_0x488f76[_0xe929('0x35')]),_0xab5203);if(_0x2251a7['query']['filter']){_0x36315f[_0xe929('0x3e')]=_[_0xe929('0x40')](_0x36315f[_0xe929('0x3e')],{'$or':_[_0xe929('0x2e')](_0xab5203,function(_0x212964){if(_0x212964[_0xe929('0x31')]!==_0xe929('0x41')){var _0x34e865={};_0x34e865[_0x212964['name']]={'$like':'%'+_0x2251a7[_0xe929('0x33')][_0xe929('0x42')]+'%'};return _0x34e865;}})});}_0x36315f=_[_0xe929('0x40')]({},_0x36315f,_0x2251a7[_0xe929('0x43')]);var _0x132032={'where':_0x36315f[_0xe929('0x3e')]};return db[_0xe929('0x44')]['count'](_0x132032)[_0xe929('0x29')](function(_0x1ac8f3){_0x464a77['count']=_0x1ac8f3;if(_0x2251a7[_0xe929('0x33')]['includeAll']){_0x36315f['include']=[{'all':!![]}];}return db[_0xe929('0x44')][_0xe929('0x45')](_0x36315f);})['then'](function(_0x1a5f2e){_0x464a77[_0xe929('0x46')]=_0x1a5f2e;return _0x464a77;})[_0xe929('0x29')](respondWithFilteredResult(_0x46f6e2,_0x36315f))[_0xe929('0x47')](handleError(_0x46f6e2,null));};exports[_0xe929('0x48')]=function(_0x47bf9e,_0x43f163){var _0x3f4d40={'raw':![],'where':{'id':_0x47bf9e['params']['id']}},_0x32ef86={};_0x32ef86[_0xe929('0x32')]=_[_0xe929('0x34')](db['SquareProject'][_0xe929('0x2f')]);_0x32ef86[_0xe929('0x33')]=_[_0xe929('0x34')](_0x47bf9e[_0xe929('0x33')]);_0x32ef86[_0xe929('0x35')]=_[_0xe929('0x36')](_0x32ef86[_0xe929('0x32')],_0x32ef86[_0xe929('0x33')]);_0x3f4d40[_0xe929('0x38')]=_[_0xe929('0x36')](_0x32ef86[_0xe929('0x32')],qs[_0xe929('0x37')](_0x47bf9e[_0xe929('0x33')][_0xe929('0x37')]));_0x3f4d40[_0xe929('0x38')]=_0x3f4d40[_0xe929('0x38')][_0xe929('0x39')]?_0x3f4d40[_0xe929('0x38')]:_0x32ef86[_0xe929('0x32')];if(_0x47bf9e['query'][_0xe929('0x49')]){_0x3f4d40['include']=[{'all':!![]}];}_0x3f4d40=_['merge']({},_0x3f4d40,_0x47bf9e[_0xe929('0x43')]);return db['SquareProject']['find'](_0x3f4d40)[_0xe929('0x29')](handleEntityNotFound(_0x43f163,null))[_0xe929('0x29')](respondWithResult(_0x43f163,null))[_0xe929('0x47')](handleError(_0x43f163,null));};exports[_0xe929('0x4a')]=function(_0x434cb8,_0x19652d){return db[_0xe929('0x44')][_0xe929('0x4a')](_0x434cb8[_0xe929('0x4b')],{})['then'](function(_0x452bbc){var _0x282863=_0x434cb8[_0xe929('0x4c')]['get']({'plain':!![]});if(!_0x282863)throw new Error(_0xe929('0x4d'));if(_0x282863[_0xe929('0x4e')]==='user'){var _0xeb2ae9=_0x452bbc[_0xe929('0x2b')]({'plain':!![]});var _0x1e9083=_0xe929('0x2c');return db[_0xe929('0x4f')]['find']({'where':{'name':_0x1e9083,'userProfileId':_0x282863[_0xe929('0x50')]},'raw':!![]})[_0xe929('0x29')](function(_0x5b73ec){if(_0x5b73ec&&_0x5b73ec[_0xe929('0x51')]===0x0){return db[_0xe929('0x52')][_0xe929('0x4a')]({'name':_0xeb2ae9[_0xe929('0x2d')],'resourceId':_0xeb2ae9['id'],'type':_0x5b73ec[_0xe929('0x2d')],'sectionId':_0x5b73ec['id']},{})[_0xe929('0x29')](function(){return _0x452bbc;});}else{return _0x452bbc;}})['catch'](function(_0x3d4c73){logger[_0xe929('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d4c73);throw _0x3d4c73;});}return _0x452bbc;})[_0xe929('0x29')](respondWithResult(_0x19652d,0xc9))[_0xe929('0x47')](handleError(_0x19652d,null));};exports[_0xe929('0x28')]=function(_0x1ecddc,_0x570510){if(_0x1ecddc['body']['id']){delete _0x1ecddc[_0xe929('0x4b')]['id'];}return db[_0xe929('0x44')][_0xe929('0x54')]({'where':{'id':_0x1ecddc['params']['id']}})[_0xe929('0x29')](handleEntityNotFound(_0x570510,null))[_0xe929('0x29')](saveUpdates(_0x1ecddc['body'],null))[_0xe929('0x29')](respondWithResult(_0x570510,null))[_0xe929('0x47')](handleError(_0x570510,null));};exports[_0xe929('0x2a')]=function(_0xd6a5ba,_0x28aca2){return db[_0xe929('0x44')][_0xe929('0x54')]({'where':{'id':_0xd6a5ba['params']['id']}})[_0xe929('0x29')](handleEntityNotFound(_0x28aca2,null))[_0xe929('0x29')](removeEntity(_0x28aca2,null))[_0xe929('0x47')](handleError(_0x28aca2,null));};exports[_0xe929('0x55')]=function(_0xc61035,_0x1feda8,_0x9409ed){return db[_0xe929('0x44')][_0xe929('0x54')]({'where':{'id':_0xc61035[_0xe929('0x56')]['id']}})[_0xe929('0x29')](handleEntityNotFound(_0x1feda8,null))['then'](function(_0x2a0c3d){if(_0x2a0c3d){return _0x2a0c3d['addUsers'](_0xc61035[_0xe929('0x4b')][_0xe929('0x57')],_[_0xe929('0x58')](_0xc61035[_0xe929('0x4b')],[_0xe929('0x57'),'id'])||{});}})['then'](respondWithResult(_0x1feda8,null))['catch'](handleError(_0x1feda8,null));};exports[_0xe929('0x59')]=function(_0x58b568,_0x38bfb2,_0x12581c){return db[_0xe929('0x44')]['find']({'where':{'id':_0x58b568[_0xe929('0x56')]['id']}})[_0xe929('0x29')](handleEntityNotFound(_0x38bfb2,null))['then'](function(_0x45e35a){if(_0x45e35a){return _0x45e35a['removeUsers'](_0x58b568['query'][_0xe929('0x57')])[_0xe929('0x29')](function(){if(_[_0xe929('0x5a')](_0x58b568[_0xe929('0x33')][_0xe929('0x57')])){for(var _0x1abd10=0x0;_0x1abd10<_0x58b568[_0xe929('0x33')][_0xe929('0x57')][_0xe929('0x39')];_0x1abd10+=0x1){socket['emit'](_0xe929('0x5b'),{'UserId':Number(_0x58b568['query']['ids'][_0x1abd10]),'SquareProjectId':Number(_0x58b568['params']['id'])});}}else{socket['emit'](_0xe929('0x5b'),{'UserId':Number(_0x58b568['query'][_0xe929('0x57')]),'SquareProjectId':Number(_0x58b568[_0xe929('0x56')]['id'])});}});}})[_0xe929('0x29')](respondWithStatusCode(_0x38bfb2,null))[_0xe929('0x47')](handleError(_0x38bfb2,null));};exports[_0xe929('0x5c')]=function(_0x4c0cc9,_0x3a509e,_0x42c686){var _0x2d2139={};var _0x23fda3={};var _0x104d7a;var _0xe55bd7;return db[_0xe929('0x44')]['findOne']({'where':{'id':_0x4c0cc9[_0xe929('0x56')]['id']}})[_0xe929('0x29')](handleEntityNotFound(_0x3a509e,null))[_0xe929('0x29')](function(_0x466975){if(_0x466975){_0x104d7a=_0x466975;_0x23fda3[_0xe929('0x32')]=_[_0xe929('0x34')](db[_0xe929('0x5d')]['rawAttributes']);_0x23fda3[_0xe929('0x33')]=_[_0xe929('0x34')](_0x4c0cc9[_0xe929('0x33')]);_0x23fda3['filters']=_[_0xe929('0x36')](_0x23fda3[_0xe929('0x32')],_0x23fda3[_0xe929('0x33')]);_0x2d2139[_0xe929('0x38')]=_[_0xe929('0x36')](_0x23fda3[_0xe929('0x32')],qs[_0xe929('0x37')](_0x4c0cc9[_0xe929('0x33')][_0xe929('0x37')]));_0x2d2139[_0xe929('0x38')]=_0x2d2139[_0xe929('0x38')][_0xe929('0x39')]?_0x2d2139['attributes']:_0x23fda3[_0xe929('0x32')];_0x2d2139[_0xe929('0x3c')]=qs[_0xe929('0x3d')](_0x4c0cc9[_0xe929('0x33')][_0xe929('0x3d')]);_0x2d2139[_0xe929('0x3e')]=qs['filters'](_[_0xe929('0x3f')](_0x4c0cc9[_0xe929('0x33')],_0x23fda3['filters']));if(_0x4c0cc9['query']['filter']){_0x2d2139[_0xe929('0x3e')]=_[_0xe929('0x40')](_0x2d2139[_0xe929('0x3e')],{'$or':_[_0xe929('0x2e')](_0x2d2139[_0xe929('0x38')],function(_0x5234f0){var _0x3e1d6c={};_0x3e1d6c[_0x5234f0]={'$like':'%'+_0x4c0cc9[_0xe929('0x33')]['filter']+'%'};return _0x3e1d6c;})});}_0x2d2139=_[_0xe929('0x40')]({},_0x2d2139,_0x4c0cc9[_0xe929('0x43')]);return _0x104d7a[_0xe929('0x5c')](_0x2d2139);}})[_0xe929('0x29')](function(_0x382b5f){if(_0x382b5f){_0xe55bd7=_0x382b5f[_0xe929('0x39')];if(!_0x4c0cc9[_0xe929('0x33')][_0xe929('0x3a')](_0xe929('0x3b'))){_0x2d2139[_0xe929('0x23')]=qs[_0xe929('0x23')](_0x4c0cc9[_0xe929('0x33')]['limit']);_0x2d2139['offset']=qs[_0xe929('0x20')](_0x4c0cc9[_0xe929('0x33')][_0xe929('0x20')]);}return _0x104d7a[_0xe929('0x5c')](_0x2d2139);}})[_0xe929('0x29')](function(_0x1926a6){if(_0x1926a6){return _0x1926a6?{'count':_0xe55bd7,'rows':_0x1926a6}:null;}})[_0xe929('0x29')](respondWithResult(_0x3a509e,null))[_0xe929('0x47')](handleError(_0x3a509e,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 598b1e9..f849917 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 _0xf836=['emit','hasOwnProperty','hook','events','../../mysqldb','save','update','remove'];(function(_0x5dab65,_0x7cb495){var _0xf39d74=function(_0x35c2c3){while(--_0x35c2c3){_0x5dab65['push'](_0x5dab65['shift']());}};_0xf39d74(++_0x7cb495);}(_0xf836,0x1db));var _0x6f83=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf836[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x6f83('0x0'));var SquareProject=require(_0x6f83('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6f83('0x2'),'afterUpdate':_0x6f83('0x3'),'afterDestroy':_0x6f83('0x4')};function emitEvent(_0x1c9037){return function(_0x536bc3,_0x3f446b,_0x11244b){SquareProjectEvents[_0x6f83('0x5')](_0x1c9037+':'+_0x536bc3['id'],_0x536bc3);SquareProjectEvents[_0x6f83('0x5')](_0x1c9037,_0x536bc3);_0x11244b(null);};}for(var e in events){if(events[_0x6f83('0x6')](e)){var event=events[e];SquareProject[_0x6f83('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0x2d51=['remove','emit','hasOwnProperty','hook','exports','events','SquareProject','update'];(function(_0x3246ee,_0x4b9b26){var _0xc7c978=function(_0x59cc77){while(--_0x59cc77){_0x3246ee['push'](_0x3246ee['shift']());}};_0xc7c978(++_0x4b9b26);}(_0x2d51,0xfd));var _0x12d5=function(_0x278c1a,_0x2538f6){_0x278c1a=_0x278c1a-0x0;var _0x12eba5=_0x2d51[_0x278c1a];return _0x12eba5;};'use strict';var EventEmitter=require(_0x12d5('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x12d5('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x12d5('0x2'),'afterDestroy':_0x12d5('0x3')};function emitEvent(_0x1d2084){return function(_0x23a0bb,_0x37758d,_0x49beb5){SquareProjectEvents[_0x12d5('0x4')](_0x1d2084+':'+_0x23a0bb['id'],_0x23a0bb);SquareProjectEvents[_0x12d5('0x4')](_0x1d2084,_0x23a0bb);_0x49beb5(null);};}for(var e in events){if(events[_0x12d5('0x5')](e)){var event=events[e];SquareProject[_0x12d5('0x6')](e,emitEvent(event));}}module[_0x12d5('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 307de85..af6f290 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 _0xdd66=['changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./squareProject.attributes','exports','define','SquareProject','square_projects'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xdd66,0x6b));var _0x6dd6=function(_0x900dff,_0x22481a){_0x900dff=_0x900dff-0x0;var _0xd48581=_0xdd66[_0x900dff];return _0xd48581;};'use strict';var _=require(_0x6dd6('0x0'));var util=require(_0x6dd6('0x1'));var logger=require(_0x6dd6('0x2'))(_0x6dd6('0x3'));var moment=require(_0x6dd6('0x4'));var BPromise=require('bluebird');var rp=require(_0x6dd6('0x5'));var fs=require('fs');var path=require(_0x6dd6('0x6'));var rimraf=require(_0x6dd6('0x7'));var config=require('../../config/environment');var attributes=require(_0x6dd6('0x8'));module[_0x6dd6('0x9')]=function(_0xf2b19,_0x3ff3df){return _0xf2b19[_0x6dd6('0xa')](_0x6dd6('0xb'),attributes,{'tableName':_0x6dd6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2cc470,_0xdea4d0,_0x545e5b){if(_0x2cc470[_0x6dd6('0xd')](_0x6dd6('0xe'))){_0x2cc470[_0x6dd6('0xf')]=moment()[_0x6dd6('0x10')](_0x6dd6('0x11'));}if(_0x2cc470['changed'](_0x6dd6('0x12'))){_0x2cc470[_0x6dd6('0x13')]=moment()[_0x6dd6('0x10')](_0x6dd6('0x11'));}_0x545e5b(null,_0x2cc470);}}});}; \ No newline at end of file +var _0xd89e=['savedAt','production','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','square_projects','changed'];(function(_0x169f24,_0x324251){var _0x24e37e=function(_0x256af0){while(--_0x256af0){_0x169f24['push'](_0x169f24['shift']());}};_0x24e37e(++_0x324251);}(_0xd89e,0x1d3));var _0xed89=function(_0x22cecf,_0x4f7338){_0x22cecf=_0x22cecf-0x0;var _0x559b05=_0xd89e[_0x22cecf];return _0x559b05;};'use strict';var _=require(_0xed89('0x0'));var util=require(_0xed89('0x1'));var logger=require(_0xed89('0x2'))(_0xed89('0x3'));var moment=require(_0xed89('0x4'));var BPromise=require(_0xed89('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed89('0x6'));var rimraf=require(_0xed89('0x7'));var config=require(_0xed89('0x8'));var attributes=require('./squareProject.attributes');module[_0xed89('0x9')]=function(_0x1fa48c,_0x4f790e){return _0x1fa48c[_0xed89('0xa')]('SquareProject',attributes,{'tableName':_0xed89('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5597bf,_0xeb09db,_0x267534){if(_0x5597bf[_0xed89('0xc')]('preproduction')){_0x5597bf[_0xed89('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x5597bf[_0xed89('0xc')](_0xed89('0xe'))){_0x5597bf['publishedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x267534(null,_0x5597bf);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index e0df8a6..89d079f 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 _0xdc59=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','SquareProject,\x20%s,\x20%s','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','ShowSquareProject','SquareProject','find','options','attributes','map','include','model','then','debug','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4e8867,_0x4b1d85){var _0x1fd0c7=function(_0x3c2c68){while(--_0x3c2c68){_0x4e8867['push'](_0x4e8867['shift']());}};_0x1fd0c7(++_0x4b1d85);}(_0xdc59,0x19c));var _0x9dc5=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0xdc59[_0x1992f1];return _0x413dfe;};'use strict';var _=require(_0x9dc5('0x0'));var util=require(_0x9dc5('0x1'));var moment=require(_0x9dc5('0x2'));var BPromise=require(_0x9dc5('0x3'));var rs=require(_0x9dc5('0x4'));var fs=require('fs');var Redis=require(_0x9dc5('0x5'));var db=require(_0x9dc5('0x6'))['db'];var utils=require(_0x9dc5('0x7'));var logger=require(_0x9dc5('0x8'))(_0x9dc5('0x9'));var config=require(_0x9dc5('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x9dc5('0xb')][_0x9dc5('0xc')]({'port':0x232a});config[_0x9dc5('0xd')]=_[_0x9dc5('0xe')](config[_0x9dc5('0xd')],{'host':_0x9dc5('0xf'),'port':0x18eb});var socket=require(_0x9dc5('0x10'))(new Redis(config['redis']));require(_0x9dc5('0x11'))[_0x9dc5('0x12')](socket);function respondWithRpcPromise(_0x17b1a4,_0x196e45,_0x31a47b){return new BPromise(function(_0x1a75b4,_0x533766){return client['request'](_0x17b1a4,_0x31a47b)['then'](function(_0x5c2b59){logger['info'](_0x9dc5('0x13'),_0x196e45,_0x9dc5('0x14'));logger['debug'](_0x9dc5('0x15'),_0x196e45,_0x9dc5('0x14'),JSON[_0x9dc5('0x16')](_0x5c2b59));if(_0x5c2b59[_0x9dc5('0x17')]){if(_0x5c2b59[_0x9dc5('0x17')]['code']===0x1f4){logger[_0x9dc5('0x17')](_0x9dc5('0x13'),_0x196e45,_0x5c2b59['error'][_0x9dc5('0x18')]);return _0x533766(_0x5c2b59[_0x9dc5('0x17')]['message']);}logger[_0x9dc5('0x17')]('SquareProject,\x20%s,\x20%s',_0x196e45,_0x5c2b59['error'][_0x9dc5('0x18')]);return _0x1a75b4(_0x5c2b59[_0x9dc5('0x17')]['message']);}else{logger[_0x9dc5('0x19')](_0x9dc5('0x13'),_0x196e45,'request\x20sent');_0x1a75b4(_0x5c2b59[_0x9dc5('0x1a')][_0x9dc5('0x18')]);}})[_0x9dc5('0x1b')](function(_0x4f35f7){logger['error'](_0x9dc5('0x13'),_0x196e45,_0x4f35f7);_0x533766(_0x4f35f7);});});}exports[_0x9dc5('0x1c')]=function(_0x5b75e2){var _0x14637e=this;return new Promise(function(_0x21f381,_0x3963a0){return db[_0x9dc5('0x1d')][_0x9dc5('0x1e')]({'raw':_0x5b75e2[_0x9dc5('0x1f')]?_0x5b75e2[_0x9dc5('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x5b75e2[_0x9dc5('0x1f')]?_0x5b75e2[_0x9dc5('0x1f')]['where']||null:null,'attributes':_0x5b75e2['options']?_0x5b75e2[_0x9dc5('0x1f')][_0x9dc5('0x20')]||null:null,'include':_0x5b75e2[_0x9dc5('0x1f')]?_0x5b75e2[_0x9dc5('0x1f')]['include']?_[_0x9dc5('0x21')](_0x5b75e2['options'][_0x9dc5('0x22')],function(_0x30f354){return{'model':db[_0x30f354[_0x9dc5('0x23')]],'as':_0x30f354['as'],'attributes':_0x30f354[_0x9dc5('0x20')],'include':_0x30f354[_0x9dc5('0x22')]?_[_0x9dc5('0x21')](_0x30f354[_0x9dc5('0x22')],function(_0x356df9){return{'model':db[_0x356df9['model']],'as':_0x356df9['as'],'attributes':_0x356df9['attributes'],'include':_0x356df9[_0x9dc5('0x22')]?_[_0x9dc5('0x21')](_0x356df9[_0x9dc5('0x22')],function(_0x2b4a5d){return{'model':db[_0x2b4a5d[_0x9dc5('0x23')]],'as':_0x2b4a5d['as'],'attributes':_0x2b4a5d[_0x9dc5('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9dc5('0x24')](function(_0x5a7f10){logger[_0x9dc5('0x19')](_0x9dc5('0x1c'),_0x5b75e2);logger[_0x9dc5('0x25')]('ShowSquareProject',_0x5b75e2,JSON[_0x9dc5('0x16')](_0x5a7f10));_0x21f381(_0x5a7f10);})['catch'](function(_0x347a32){logger[_0x9dc5('0x17')](_0x9dc5('0x1c'),_0x347a32['message'],_0x5b75e2);_0x3963a0(_0x14637e['error'](0x1f4,_0x347a32[_0x9dc5('0x18')]));});});}; \ No newline at end of file +var _0xc1e7=['request\x20sent','debug','stringify','error','code','message','result','SquareProject','find','options','raw','attributes','include','model','map','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','client','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s'];(function(_0x2bfcad,_0x5d382d){var _0x86b35d=function(_0x3294bd){while(--_0x3294bd){_0x2bfcad['push'](_0x2bfcad['shift']());}};_0x86b35d(++_0x5d382d);}(_0xc1e7,0x139));var _0x7c1e=function(_0x27b949,_0x1f090f){_0x27b949=_0x27b949-0x0;var _0x17b9c8=_0xc1e7[_0x27b949];return _0x17b9c8;};'use strict';var _=require(_0x7c1e('0x0'));var util=require(_0x7c1e('0x1'));var moment=require('moment');var BPromise=require(_0x7c1e('0x2'));var rs=require(_0x7c1e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7c1e('0x4'));var logger=require(_0x7c1e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7c1e('0x6')]['http']({'port':0x232a});config['redis']=_[_0x7c1e('0x7')](config[_0x7c1e('0x8')],{'host':_0x7c1e('0x9'),'port':0x18eb});var socket=require(_0x7c1e('0xa'))(new Redis(config[_0x7c1e('0x8')]));require(_0x7c1e('0xb'))[_0x7c1e('0xc')](socket);function respondWithRpcPromise(_0x1a2b9,_0x92a8d8,_0x44a63c){return new BPromise(function(_0x2e9b24,_0x3074f2){return client[_0x7c1e('0xd')](_0x1a2b9,_0x44a63c)[_0x7c1e('0xe')](function(_0x1d187b){logger[_0x7c1e('0xf')](_0x7c1e('0x10'),_0x92a8d8,_0x7c1e('0x11'));logger[_0x7c1e('0x12')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x92a8d8,_0x7c1e('0x11'),JSON[_0x7c1e('0x13')](_0x1d187b));if(_0x1d187b['error']){if(_0x1d187b[_0x7c1e('0x14')][_0x7c1e('0x15')]===0x1f4){logger['error'](_0x7c1e('0x10'),_0x92a8d8,_0x1d187b[_0x7c1e('0x14')][_0x7c1e('0x16')]);return _0x3074f2(_0x1d187b[_0x7c1e('0x14')][_0x7c1e('0x16')]);}logger[_0x7c1e('0x14')]('SquareProject,\x20%s,\x20%s',_0x92a8d8,_0x1d187b['error']['message']);return _0x2e9b24(_0x1d187b[_0x7c1e('0x14')][_0x7c1e('0x16')]);}else{logger['info'](_0x7c1e('0x10'),_0x92a8d8,'request\x20sent');_0x2e9b24(_0x1d187b[_0x7c1e('0x17')]['message']);}})['catch'](function(_0x2263ec){logger[_0x7c1e('0x14')](_0x7c1e('0x10'),_0x92a8d8,_0x2263ec);_0x3074f2(_0x2263ec);});});}exports['ShowSquareProject']=function(_0x2bb552){var _0x1f1248=this;return new Promise(function(_0x247ff0,_0x2ea2be){return db[_0x7c1e('0x18')][_0x7c1e('0x19')]({'raw':_0x2bb552[_0x7c1e('0x1a')]?_0x2bb552[_0x7c1e('0x1a')][_0x7c1e('0x1b')]===undefined?!![]:![]:!![],'where':_0x2bb552[_0x7c1e('0x1a')]?_0x2bb552[_0x7c1e('0x1a')]['where']||null:null,'attributes':_0x2bb552[_0x7c1e('0x1a')]?_0x2bb552[_0x7c1e('0x1a')][_0x7c1e('0x1c')]||null:null,'include':_0x2bb552['options']?_0x2bb552[_0x7c1e('0x1a')]['include']?_['map'](_0x2bb552[_0x7c1e('0x1a')][_0x7c1e('0x1d')],function(_0x2093ea){return{'model':db[_0x2093ea[_0x7c1e('0x1e')]],'as':_0x2093ea['as'],'attributes':_0x2093ea['attributes'],'include':_0x2093ea[_0x7c1e('0x1d')]?_['map'](_0x2093ea[_0x7c1e('0x1d')],function(_0x3c86cf){return{'model':db[_0x3c86cf[_0x7c1e('0x1e')]],'as':_0x3c86cf['as'],'attributes':_0x3c86cf[_0x7c1e('0x1c')],'include':_0x3c86cf['include']?_[_0x7c1e('0x1f')](_0x3c86cf[_0x7c1e('0x1d')],function(_0x59149f){return{'model':db[_0x59149f[_0x7c1e('0x1e')]],'as':_0x59149f['as'],'attributes':_0x59149f[_0x7c1e('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xfd43ca){logger['info']('ShowSquareProject',_0x2bb552);logger[_0x7c1e('0x12')]('ShowSquareProject',_0x2bb552,JSON[_0x7c1e('0x13')](_0xfd43ca));_0x247ff0(_0xfd43ca);})[_0x7c1e('0x20')](function(_0x5ba10c){logger[_0x7c1e('0x14')]('ShowSquareProject',_0x5ba10c[_0x7c1e('0x16')],_0x2bb552);_0x2ea2be(_0x1f1248[_0x7c1e('0x14')](0x1f4,_0x5ba10c[_0x7c1e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 3868c3f..f33c4c6 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 _0xa6a7=['removeListener','register','squareProject:','./squareProject.events','remove','emit'];(function(_0x121f76,_0x537da9){var _0x3fcde0=function(_0x418ffd){while(--_0x418ffd){_0x121f76['push'](_0x121f76['shift']());}};_0x3fcde0(++_0x537da9);}(_0xa6a7,0x1ad));var _0x7a6a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa6a7[_0x3dd15e];return _0x231fd0;};'use strict';var SquareProjectEvents=require(_0x7a6a('0x0'));var events=['save',_0x7a6a('0x1'),'update'];function createListener(_0x3b1921,_0x2f55c6){return function(_0x46ff7f){_0x2f55c6[_0x7a6a('0x2')](_0x3b1921,_0x46ff7f);};}function removeListener(_0x5e9970,_0xeaa1d3){return function(){SquareProjectEvents[_0x7a6a('0x3')](_0x5e9970,_0xeaa1d3);};}exports[_0x7a6a('0x4')]=function(_0x58669a){for(var _0x565569=0x0,_0x62c4fe=events['length'];_0x565569<_0x62c4fe;_0x565569++){var _0x3b2c12=events[_0x565569];var _0x2a287f=createListener(_0x7a6a('0x5')+_0x3b2c12,_0x58669a);SquareProjectEvents['on'](_0x3b2c12,_0x2a287f);}}; \ No newline at end of file +var _0xda12=['update','removeListener','register','length','squareProject:','save','remove'];(function(_0x1849cb,_0x16d069){var _0x54790d=function(_0x3b645c){while(--_0x3b645c){_0x1849cb['push'](_0x1849cb['shift']());}};_0x54790d(++_0x16d069);}(_0xda12,0x1e8));var _0x2da1=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xda12[_0x4a9fb1];return _0x348672;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x2da1('0x0'),_0x2da1('0x1'),_0x2da1('0x2')];function createListener(_0xeb4894,_0x16d560){return function(_0x2beaa1){_0x16d560['emit'](_0xeb4894,_0x2beaa1);};}function removeListener(_0x31fef5,_0x5818d5){return function(){SquareProjectEvents[_0x2da1('0x3')](_0x31fef5,_0x5818d5);};}exports[_0x2da1('0x4')]=function(_0x41cd1c){for(var _0x5b1e0b=0x0,_0x517fe8=events[_0x2da1('0x5')];_0x5b1e0b<_0x517fe8;_0x5b1e0b++){var _0x3e7ab3=events[_0x5b1e0b];var _0x1a5241=createListener(_0x2da1('0x6')+_0x3e7ab3,_0x41cd1c);SquareProjectEvents['on'](_0x3e7ab3,_0x1a5241);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 996d449..7f9f2ac 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','post','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x53bc6c,_0x159830){var _0x584722=function(_0x145b5b){while(--_0x145b5b){_0x53bc6c['push'](_0x53bc6c['shift']());}};_0x584722(++_0x159830);}(_0x7a54,0x106));var _0x47a5=function(_0x2d95b0,_0xa9a742){_0x2d95b0=_0x2d95b0-0x0;var _0x190fbe=_0x7a54[_0x2d95b0];return _0x190fbe;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);module[_0x47a5('0x12')]=router; \ No newline at end of file +var _0xe14b=['Router','../../components/auth/service','./squareRecording.controller','get','isAuthenticated','index','/:id','download','post','delete','destroy','exports','multer','util','express'];(function(_0xae17ab,_0x3f46c1){var _0x4bd6fc=function(_0x5228bf){while(--_0x5228bf){_0xae17ab['push'](_0xae17ab['shift']());}};_0x4bd6fc(++_0x3f46c1);}(_0xe14b,0x93));var _0xbe14=function(_0xae66d4,_0x196774){_0xae66d4=_0xae66d4-0x0;var _0x3fcaaa=_0xe14b[_0xae66d4];return _0x3fcaaa;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['show']);router['get']('/:id/download',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')]('/',auth[_0xbe14('0x7')](),controller['create']);router['put'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0xc')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xd')]);module[_0xbe14('0xe')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index c37adb6..3abb83e 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 _0x038b=['lastIndexOf','exports','STRING','VIRTUAL','substring'];(function(_0x40167c,_0x3c4c2d){var _0x529928=function(_0x3cc168){while(--_0x3cc168){_0x40167c['push'](_0x40167c['shift']());}};_0x529928(++_0x3c4c2d);}(_0x038b,0x114));var _0xb038=function(_0x303d53,_0x4e7551){_0x303d53=_0x303d53-0x0;var _0x5e6b90=_0x038b[_0x303d53];return _0x5e6b90;};'use strict';var Sequelize=require('sequelize');module[_0xb038('0x0')]={'uniqueid':{'type':Sequelize[_0xb038('0x1')]},'callerid':{'type':Sequelize[_0xb038('0x1')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xb038('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb038('0x1')]},'accountcode':{'type':Sequelize[_0xb038('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xb038('0x1')]},'saveName':{'type':Sequelize[_0xb038('0x1')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xb038('0x2')],'get':function(){var _0x1b077a='';var _0x1534a9=this['getDataValue']('savePath');if(_0x1534a9){_0x1b077a=_0x1534a9[_0xb038('0x3')](_0x1534a9[_0xb038('0x4')]('.'));}return _0x1b077a;}}}; \ No newline at end of file +var _0xae24=['VIRTUAL','savePath','sequelize','STRING'];(function(_0x89ff7d,_0x1941d3){var _0x37f742=function(_0x371fa3){while(--_0x371fa3){_0x89ff7d['push'](_0x89ff7d['shift']());}};_0x37f742(++_0x1941d3);}(_0xae24,0x182));var _0x4ae2=function(_0x14c14a,_0x5bc705){_0x14c14a=_0x14c14a-0x0;var _0x5ee3f5=_0xae24[_0x14c14a];return _0x5ee3f5;};'use strict';var Sequelize=require(_0x4ae2('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x4ae2('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x4ae2('0x1')]},'context':{'type':Sequelize[_0x4ae2('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x4ae2('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x4ae2('0x1')]},'saveName':{'type':Sequelize[_0x4ae2('0x1')]},'filename':{'type':Sequelize[_0x4ae2('0x1')]},'savePath':{'type':Sequelize[_0x4ae2('0x1')]},'format':{'type':Sequelize[_0x4ae2('0x2')],'get':function(){var _0x307247='';var _0x4f2e84=this['getDataValue'](_0x4ae2('0x3'));if(_0x4f2e84){_0x307247=_0x4f2e84['substring'](_0x4f2e84['lastIndexOf']('.'));}return _0x307247;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 0d39816..ac1174c 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 _0xdba4=['stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filters','merge','VIRTUAL','SquareRecording','includeAll','include','catch','params','options','find','create','body','download','uniqueid','savePath','filename','%s.cypher','existsSync','decryptFile','recording','SquareRecording\x20not\x20found','unlink','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','count','Content-Range','apply','save','update','then','destroy','end','sendStatus','error'];(function(_0xd76b2b,_0x522ce9){var _0x4d6f2d=function(_0xfead76){while(--_0xfead76){_0xd76b2b['push'](_0xd76b2b['shift']());}};_0x4d6f2d(++_0x522ce9);}(_0xdba4,0x1dd));var _0x4dba=function(_0x2a17aa,_0x32a382){_0x2a17aa=_0x2a17aa-0x0;var _0x921b89=_0xdba4[_0x2a17aa];return _0x921b89;};'use strict';var emlformat=require(_0x4dba('0x0'));var rimraf=require(_0x4dba('0x1'));var zipdir=require(_0x4dba('0x2'));var jsonpatch=require(_0x4dba('0x3'));var rp=require(_0x4dba('0x4'));var moment=require('moment');var BPromise=require(_0x4dba('0x5'));var Mustache=require('mustache');var util=require(_0x4dba('0x6'));var path=require('path');var sox=require(_0x4dba('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4dba('0x8'));var _=require(_0x4dba('0x9'));var squel=require('squel');var crypto=require(_0x4dba('0xa'));var jsforce=require(_0x4dba('0xb'));var deskjs=require(_0x4dba('0xc'));var toCsv=require(_0x4dba('0xd'));var querystring=require(_0x4dba('0xe'));var Papa=require(_0x4dba('0xf'));var Redis=require(_0x4dba('0x10'));var authService=require(_0x4dba('0x11'));var qs=require(_0x4dba('0x12'));var as=require(_0x4dba('0x13'));var hardwareService=require(_0x4dba('0x14'));var logger=require(_0x4dba('0x15'))('api');var utils=require(_0x4dba('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4dba('0x17'));var db=require(_0x4dba('0x18'))['db'];function respondWithStatusCode(_0x1c07ef,_0x2c625c){_0x2c625c=_0x2c625c||0xcc;return function(_0xc9a978){if(_0xc9a978){return _0x1c07ef['sendStatus'](_0x2c625c);}return _0x1c07ef[_0x4dba('0x19')](_0x2c625c)['end']();};}function respondWithResult(_0x3e1541,_0x51a584){_0x51a584=_0x51a584||0xc8;return function(_0x855060){if(_0x855060){return _0x3e1541['status'](_0x51a584)[_0x4dba('0x1a')](_0x855060);}};}function respondWithFilteredResult(_0x4fb27f,_0x53f963){return function(_0x1e402f){if(_0x1e402f){var _0x3ceff4=typeof _0x53f963[_0x4dba('0x1b')]==='undefined'&&typeof _0x53f963[_0x4dba('0x1c')]==='undefined';var _0xd8a0a7=_0x1e402f['count'];var _0x211b8f=_0x3ceff4?0x0:_0x53f963[_0x4dba('0x1b')];var _0x58fae1=_0x3ceff4?_0x1e402f[_0x4dba('0x1d')]:_0x53f963['offset']+_0x53f963['limit'];var _0x401f3d;if(_0x58fae1>=_0xd8a0a7){_0x58fae1=_0xd8a0a7;_0x401f3d=0xc8;}else{_0x401f3d=0xce;}_0x4fb27f[_0x4dba('0x19')](_0x401f3d);return _0x4fb27f['set'](_0x4dba('0x1e'),_0x211b8f+'-'+_0x58fae1+'/'+_0xd8a0a7)[_0x4dba('0x1a')](_0x1e402f);}return null;};}function patchUpdates(_0xd99a80){return function(_0x44fa05){try{jsonpatch[_0x4dba('0x1f')](_0x44fa05,_0xd99a80,!![]);}catch(_0x2d758b){return BPromise['reject'](_0x2d758b);}return _0x44fa05[_0x4dba('0x20')]();};}function saveUpdates(_0x219cf4,_0x38db30){return function(_0x44278d){if(_0x44278d){return _0x44278d[_0x4dba('0x21')](_0x219cf4)[_0x4dba('0x22')](function(_0x58bf7a){return _0x58bf7a;});}return null;};}function removeEntity(_0x4148a7,_0x58d45e){return function(_0x38277a){if(_0x38277a){return _0x38277a[_0x4dba('0x23')]()[_0x4dba('0x22')](function(){_0x4148a7['status'](0xcc)[_0x4dba('0x24')]();});}};}function handleEntityNotFound(_0x3dc27b,_0x3bae6a){return function(_0x1621e8){if(!_0x1621e8){_0x3dc27b[_0x4dba('0x25')](0x194);}return _0x1621e8;};}function handleError(_0x14ccda,_0x19c825){_0x19c825=_0x19c825||0x1f4;return function(_0x15af96){logger[_0x4dba('0x26')](_0x15af96[_0x4dba('0x27')]);if(_0x15af96['name']){delete _0x15af96[_0x4dba('0x28')];}_0x14ccda[_0x4dba('0x19')](_0x19c825)[_0x4dba('0x29')](_0x15af96);};}exports[_0x4dba('0x2a')]=function(_0x4d195d,_0x188ea8){var _0x3dae5f={},_0x29e691={},_0x3547bd={'count':0x0,'rows':[]};var _0x261d12=_[_0x4dba('0x2b')](db['SquareRecording'][_0x4dba('0x2c')],function(_0x3ec0e9){return{'name':_0x3ec0e9[_0x4dba('0x2d')],'type':_0x3ec0e9[_0x4dba('0x2e')][_0x4dba('0x2f')]};});_0x29e691[_0x4dba('0x30')]=_[_0x4dba('0x2b')](_0x261d12,_0x4dba('0x28'));_0x29e691[_0x4dba('0x31')]=_[_0x4dba('0x32')](_0x4d195d[_0x4dba('0x31')]);_0x29e691['filters']=_[_0x4dba('0x33')](_0x29e691['model'],_0x29e691[_0x4dba('0x31')]);_0x3dae5f[_0x4dba('0x34')]=_[_0x4dba('0x33')](_0x29e691['model'],qs[_0x4dba('0x35')](_0x4d195d[_0x4dba('0x31')][_0x4dba('0x35')]));_0x3dae5f[_0x4dba('0x34')]=_0x3dae5f[_0x4dba('0x34')]['length']?_0x3dae5f[_0x4dba('0x34')]:_0x29e691[_0x4dba('0x30')];if(!_0x4d195d[_0x4dba('0x31')][_0x4dba('0x36')]('nolimit')){_0x3dae5f[_0x4dba('0x1c')]=qs['limit'](_0x4d195d[_0x4dba('0x31')][_0x4dba('0x1c')]);_0x3dae5f[_0x4dba('0x1b')]=qs[_0x4dba('0x1b')](_0x4d195d['query']['offset']);}_0x3dae5f[_0x4dba('0x37')]=qs[_0x4dba('0x38')](_0x4d195d[_0x4dba('0x31')][_0x4dba('0x38')]);_0x3dae5f[_0x4dba('0x39')]=qs['filters'](_[_0x4dba('0x3a')](_0x4d195d['query'],_0x29e691[_0x4dba('0x3b')]),_0x261d12);if(_0x4d195d['query']['filter']){_0x3dae5f[_0x4dba('0x39')]=_[_0x4dba('0x3c')](_0x3dae5f[_0x4dba('0x39')],{'$or':_[_0x4dba('0x2b')](_0x261d12,function(_0x37c995){if(_0x37c995[_0x4dba('0x2e')]!==_0x4dba('0x3d')){var _0x502270={};_0x502270[_0x37c995[_0x4dba('0x28')]]={'$like':'%'+_0x4d195d[_0x4dba('0x31')]['filter']+'%'};return _0x502270;}})});}_0x3dae5f=_[_0x4dba('0x3c')]({},_0x3dae5f,_0x4d195d['options']);var _0x6a6bbf={'where':_0x3dae5f['where']};return db[_0x4dba('0x3e')]['count'](_0x6a6bbf)[_0x4dba('0x22')](function(_0x10209c){_0x3547bd[_0x4dba('0x1d')]=_0x10209c;if(_0x4d195d[_0x4dba('0x31')][_0x4dba('0x3f')]){_0x3dae5f[_0x4dba('0x40')]=[{'all':!![]}];}return db[_0x4dba('0x3e')]['findAll'](_0x3dae5f);})['then'](function(_0x323e2f){_0x3547bd['rows']=_0x323e2f;return _0x3547bd;})[_0x4dba('0x22')](respondWithFilteredResult(_0x188ea8,_0x3dae5f))[_0x4dba('0x41')](handleError(_0x188ea8,null));};exports['show']=function(_0xc321eb,_0x3bcb89){var _0x41550a={'raw':!![],'where':{'id':_0xc321eb[_0x4dba('0x42')]['id']}},_0x1adabc={};_0x1adabc['model']=_[_0x4dba('0x32')](db[_0x4dba('0x3e')][_0x4dba('0x2c')]);_0x1adabc['query']=_[_0x4dba('0x32')](_0xc321eb['query']);_0x1adabc[_0x4dba('0x3b')]=_['intersection'](_0x1adabc[_0x4dba('0x30')],_0x1adabc['query']);_0x41550a['attributes']=_[_0x4dba('0x33')](_0x1adabc[_0x4dba('0x30')],qs[_0x4dba('0x35')](_0xc321eb[_0x4dba('0x31')][_0x4dba('0x35')]));_0x41550a[_0x4dba('0x34')]=_0x41550a[_0x4dba('0x34')]['length']?_0x41550a[_0x4dba('0x34')]:_0x1adabc[_0x4dba('0x30')];if(_0xc321eb[_0x4dba('0x31')][_0x4dba('0x3f')]){_0x41550a[_0x4dba('0x40')]=[{'all':!![]}];}_0x41550a=_['merge']({},_0x41550a,_0xc321eb[_0x4dba('0x43')]);return db[_0x4dba('0x3e')][_0x4dba('0x44')](_0x41550a)['then'](handleEntityNotFound(_0x3bcb89,null))[_0x4dba('0x22')](respondWithResult(_0x3bcb89,null))['catch'](handleError(_0x3bcb89,null));};exports[_0x4dba('0x45')]=function(_0x27f933,_0x18a7fb){return db[_0x4dba('0x3e')][_0x4dba('0x45')](_0x27f933[_0x4dba('0x46')],{})[_0x4dba('0x22')](respondWithResult(_0x18a7fb,0xc9))[_0x4dba('0x41')](handleError(_0x18a7fb,null));};exports[_0x4dba('0x21')]=function(_0xaa7c1f,_0x547947){if(_0xaa7c1f[_0x4dba('0x46')]['id']){delete _0xaa7c1f[_0x4dba('0x46')]['id'];}return db['SquareRecording']['find']({'where':{'id':_0xaa7c1f[_0x4dba('0x42')]['id']}})[_0x4dba('0x22')](handleEntityNotFound(_0x547947,null))[_0x4dba('0x22')](saveUpdates(_0xaa7c1f[_0x4dba('0x46')],null))['then'](respondWithResult(_0x547947,null))[_0x4dba('0x41')](handleError(_0x547947,null));};exports[_0x4dba('0x47')]=function(_0x40c8f8,_0x4d0830,_0x2006ae){var _0x2f7627=require('../../components/encryptor');var _0x18057a=![];var _0x49f8d1={};if(_0x40c8f8[_0x4dba('0x31')][_0x4dba('0x2e')]&&_0x40c8f8[_0x4dba('0x31')][_0x4dba('0x2e')]===_0x4dba('0x48')){_0x49f8d1[_0x4dba('0x48')]=_0x40c8f8[_0x4dba('0x42')]['id'];}else{_0x49f8d1['id']=_0x40c8f8[_0x4dba('0x42')]['id'];}return db['SquareRecording'][_0x4dba('0x44')]({'where':_0x49f8d1,'attributes':['id',_0x4dba('0x49'),_0x4dba('0x4a')],'raw':!![]})[_0x4dba('0x22')](handleEntityNotFound(_0x4d0830,null))['then'](function(_0x5b0951){if(_0x5b0951){var _0x2c2380=_0x5b0951[_0x4dba('0x49')];var _0x3a151b=util['format'](_0x4dba('0x4b'),_0x2c2380);if(fs[_0x4dba('0x4c')](_0x3a151b)){_0x18057a=!![];return _0x2f7627[_0x4dba('0x4d')](_0x3a151b,_0x2c2380,config['secrets'][_0x4dba('0x4e')])[_0x4dba('0x22')](function(){return _0x5b0951;});}return _0x5b0951;}})[_0x4dba('0x22')](function(_0x4aa328){if(_0x4aa328){var _0xf97a6f=_0x4aa328[_0x4dba('0x49')];if(!fs['existsSync'](_0xf97a6f)){throw new db['Sequelize']['ValidationError'](_0x4dba('0x4f'));}if(_0x4aa328[_0x4dba('0x4a')]){return _0x4d0830['download'](_0xf97a6f,_0x4aa328[_0x4dba('0x4a')]+path['extname'](_0xf97a6f),function(){if(_0x18057a){fs[_0x4dba('0x50')](_0xf97a6f);}});}else{return _0x4d0830['download'](_0xf97a6f,function(_0x265b8a){if(_0x18057a){fs[_0x4dba('0x50')](_0xf97a6f);}});}}})['catch'](function(_0x1f1900){if(_0x1f1900['message']===_0x4dba('0x4f')){_0x4d0830[_0x4dba('0x19')](0x194)[_0x4dba('0x29')]('Not\x20found');}else{return handleError(_0x4d0830,null);}});};exports[_0x4dba('0x23')]=function(_0x28ec02,_0x512126){return db[_0x4dba('0x3e')][_0x4dba('0x44')]({'where':{'id':_0x28ec02['params']['id']}})[_0x4dba('0x22')](function(_0x323729){if(_[_0x4dba('0x51')](_0x323729)){throw new ReferenceError('Entity\x20not\x20found');}return _0x323729;})['then'](function(_0x47aaf0){var _0x4da012=_0x47aaf0[_0x4dba('0x49')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x4da012);if(!_[_0x4dba('0x51')](_0x47aaf0['savePath'])&&fs[_0x4dba('0x4c')](_0x4da012)){logger['info']('File:\x20\x22'+_0x4da012+_0x4dba('0x52'));fs[_0x4dba('0x53')](_0x4da012);}_0x4da012=_0x4da012+_0x4dba('0x54');if(!_[_0x4dba('0x51')](_0x47aaf0['savePath'])&&fs[_0x4dba('0x4c')](_0x4da012)){logger['info'](_0x4dba('0x55')+_0x4da012+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x4dba('0x53')](_0x4da012);}return _0x47aaf0;})['then'](function(_0x2d0438){if(!_0x2d0438)throw new InternalError();return _0x2d0438[_0x4dba('0x23')]();})[_0x4dba('0x22')](function(){_0x512126['status'](0xcc)['end']();})[_0x4dba('0x41')](handleError(_0x512126,null));}; \ No newline at end of file +var _0xde16=['%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','Not\x20found','Entity\x20not\x20found','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','info','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','map','SquareRecording','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','order','sort','where','merge','VIRTUAL','filter','include','findAll','show','params','options','find','catch','body','download','../../components/encryptor','uniqueid','savePath','format'];(function(_0x163498,_0x24d05a){var _0x432ee3=function(_0x133c7b){while(--_0x133c7b){_0x163498['push'](_0x163498['shift']());}};_0x432ee3(++_0x24d05a);}(_0xde16,0x6a));var _0x6de1=function(_0x5f37d4,_0x337bc0){_0x5f37d4=_0x5f37d4-0x0;var _0x35dba2=_0xde16[_0x5f37d4];return _0x35dba2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6de1('0x0'));var jsonpatch=require(_0x6de1('0x1'));var rp=require(_0x6de1('0x2'));var moment=require(_0x6de1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6de1('0x4'));var util=require(_0x6de1('0x5'));var path=require(_0x6de1('0x6'));var sox=require(_0x6de1('0x7'));var csv=require(_0x6de1('0x8'));var ejs=require(_0x6de1('0x9'));var fs=require('fs');var fs_extra=require(_0x6de1('0xa'));var _=require(_0x6de1('0xb'));var squel=require('squel');var crypto=require(_0x6de1('0xc'));var jsforce=require(_0x6de1('0xd'));var deskjs=require(_0x6de1('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6de1('0xf'));var Papa=require('papaparse');var Redis=require(_0x6de1('0x10'));var authService=require(_0x6de1('0x11'));var qs=require(_0x6de1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6de1('0x13'))(_0x6de1('0x14'));var utils=require(_0x6de1('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6de1('0x16'));var db=require(_0x6de1('0x17'))['db'];function respondWithStatusCode(_0x191300,_0x5505be){_0x5505be=_0x5505be||0xcc;return function(_0x1ec631){if(_0x1ec631){return _0x191300['sendStatus'](_0x5505be);}return _0x191300['status'](_0x5505be)['end']();};}function respondWithResult(_0x386b78,_0x36cb74){_0x36cb74=_0x36cb74||0xc8;return function(_0x4d4cb6){if(_0x4d4cb6){return _0x386b78[_0x6de1('0x18')](_0x36cb74)['json'](_0x4d4cb6);}};}function respondWithFilteredResult(_0x22930d,_0x3b6e24){return function(_0x37bf67){if(_0x37bf67){var _0x544b1e=typeof _0x3b6e24[_0x6de1('0x19')]===_0x6de1('0x1a')&&typeof _0x3b6e24[_0x6de1('0x1b')]===_0x6de1('0x1a');var _0x4e0ad1=_0x37bf67['count'];var _0x551535=_0x544b1e?0x0:_0x3b6e24[_0x6de1('0x19')];var _0x1d49c6=_0x544b1e?_0x37bf67[_0x6de1('0x1c')]:_0x3b6e24[_0x6de1('0x19')]+_0x3b6e24['limit'];var _0xdcfa2b;if(_0x1d49c6>=_0x4e0ad1){_0x1d49c6=_0x4e0ad1;_0xdcfa2b=0xc8;}else{_0xdcfa2b=0xce;}_0x22930d[_0x6de1('0x18')](_0xdcfa2b);return _0x22930d[_0x6de1('0x1d')](_0x6de1('0x1e'),_0x551535+'-'+_0x1d49c6+'/'+_0x4e0ad1)['json'](_0x37bf67);}return null;};}function patchUpdates(_0x57d2ae){return function(_0x2c5ce2){try{jsonpatch['apply'](_0x2c5ce2,_0x57d2ae,!![]);}catch(_0x5dd3d2){return BPromise[_0x6de1('0x1f')](_0x5dd3d2);}return _0x2c5ce2[_0x6de1('0x20')]();};}function saveUpdates(_0x5ac0b4,_0x10f64d){return function(_0x184436){if(_0x184436){return _0x184436[_0x6de1('0x21')](_0x5ac0b4)[_0x6de1('0x22')](function(_0x23cd76){return _0x23cd76;});}return null;};}function removeEntity(_0x4b3764,_0x172222){return function(_0x18cf1f){if(_0x18cf1f){return _0x18cf1f[_0x6de1('0x23')]()['then'](function(){_0x4b3764[_0x6de1('0x18')](0xcc)[_0x6de1('0x24')]();});}};}function handleEntityNotFound(_0x2f66a0,_0x2a24bd){return function(_0x1b6f73){if(!_0x1b6f73){_0x2f66a0[_0x6de1('0x25')](0x194);}return _0x1b6f73;};}function handleError(_0x2175ba,_0x216ff3){_0x216ff3=_0x216ff3||0x1f4;return function(_0x9f8de3){logger[_0x6de1('0x26')](_0x9f8de3[_0x6de1('0x27')]);if(_0x9f8de3[_0x6de1('0x28')]){delete _0x9f8de3[_0x6de1('0x28')];}_0x2175ba['status'](_0x216ff3)[_0x6de1('0x29')](_0x9f8de3);};}exports['index']=function(_0x5e00a2,_0xf442e5){var _0x13a997={},_0x58317c={},_0x3285b1={'count':0x0,'rows':[]};var _0x1a2101=_[_0x6de1('0x2a')](db[_0x6de1('0x2b')][_0x6de1('0x2c')],function(_0x58f927){return{'name':_0x58f927['fieldName'],'type':_0x58f927[_0x6de1('0x2d')][_0x6de1('0x2e')]};});_0x58317c[_0x6de1('0x2f')]=_['map'](_0x1a2101,_0x6de1('0x28'));_0x58317c['query']=_[_0x6de1('0x30')](_0x5e00a2[_0x6de1('0x31')]);_0x58317c[_0x6de1('0x32')]=_['intersection'](_0x58317c[_0x6de1('0x2f')],_0x58317c[_0x6de1('0x31')]);_0x13a997['attributes']=_[_0x6de1('0x33')](_0x58317c[_0x6de1('0x2f')],qs[_0x6de1('0x34')](_0x5e00a2[_0x6de1('0x31')]['fields']));_0x13a997[_0x6de1('0x35')]=_0x13a997[_0x6de1('0x35')][_0x6de1('0x36')]?_0x13a997[_0x6de1('0x35')]:_0x58317c[_0x6de1('0x2f')];if(!_0x5e00a2[_0x6de1('0x31')]['hasOwnProperty']('nolimit')){_0x13a997[_0x6de1('0x1b')]=qs['limit'](_0x5e00a2[_0x6de1('0x31')][_0x6de1('0x1b')]);_0x13a997[_0x6de1('0x19')]=qs[_0x6de1('0x19')](_0x5e00a2['query'][_0x6de1('0x19')]);}_0x13a997[_0x6de1('0x37')]=qs[_0x6de1('0x38')](_0x5e00a2[_0x6de1('0x31')][_0x6de1('0x38')]);_0x13a997[_0x6de1('0x39')]=qs[_0x6de1('0x32')](_['pick'](_0x5e00a2[_0x6de1('0x31')],_0x58317c[_0x6de1('0x32')]),_0x1a2101);if(_0x5e00a2['query']['filter']){_0x13a997[_0x6de1('0x39')]=_[_0x6de1('0x3a')](_0x13a997[_0x6de1('0x39')],{'$or':_['map'](_0x1a2101,function(_0x312348){if(_0x312348['type']!==_0x6de1('0x3b')){var _0x5ce93b={};_0x5ce93b[_0x312348[_0x6de1('0x28')]]={'$like':'%'+_0x5e00a2[_0x6de1('0x31')][_0x6de1('0x3c')]+'%'};return _0x5ce93b;}})});}_0x13a997=_['merge']({},_0x13a997,_0x5e00a2['options']);var _0x3c51da={'where':_0x13a997[_0x6de1('0x39')]};return db['SquareRecording']['count'](_0x3c51da)['then'](function(_0x5a21a5){_0x3285b1[_0x6de1('0x1c')]=_0x5a21a5;if(_0x5e00a2['query']['includeAll']){_0x13a997[_0x6de1('0x3d')]=[{'all':!![]}];}return db[_0x6de1('0x2b')][_0x6de1('0x3e')](_0x13a997);})['then'](function(_0x2c4e63){_0x3285b1['rows']=_0x2c4e63;return _0x3285b1;})[_0x6de1('0x22')](respondWithFilteredResult(_0xf442e5,_0x13a997))['catch'](handleError(_0xf442e5,null));};exports[_0x6de1('0x3f')]=function(_0x3fac64,_0x53c6b7){var _0x3c3f81={'raw':!![],'where':{'id':_0x3fac64[_0x6de1('0x40')]['id']}},_0x41e921={};_0x41e921['model']=_[_0x6de1('0x30')](db[_0x6de1('0x2b')][_0x6de1('0x2c')]);_0x41e921['query']=_[_0x6de1('0x30')](_0x3fac64[_0x6de1('0x31')]);_0x41e921[_0x6de1('0x32')]=_['intersection'](_0x41e921['model'],_0x41e921[_0x6de1('0x31')]);_0x3c3f81[_0x6de1('0x35')]=_[_0x6de1('0x33')](_0x41e921['model'],qs['fields'](_0x3fac64['query'][_0x6de1('0x34')]));_0x3c3f81['attributes']=_0x3c3f81[_0x6de1('0x35')][_0x6de1('0x36')]?_0x3c3f81[_0x6de1('0x35')]:_0x41e921[_0x6de1('0x2f')];if(_0x3fac64[_0x6de1('0x31')]['includeAll']){_0x3c3f81['include']=[{'all':!![]}];}_0x3c3f81=_[_0x6de1('0x3a')]({},_0x3c3f81,_0x3fac64[_0x6de1('0x41')]);return db[_0x6de1('0x2b')][_0x6de1('0x42')](_0x3c3f81)['then'](handleEntityNotFound(_0x53c6b7,null))[_0x6de1('0x22')](respondWithResult(_0x53c6b7,null))[_0x6de1('0x43')](handleError(_0x53c6b7,null));};exports['create']=function(_0x3211db,_0x1d5eeb){return db[_0x6de1('0x2b')]['create'](_0x3211db[_0x6de1('0x44')],{})['then'](respondWithResult(_0x1d5eeb,0xc9))[_0x6de1('0x43')](handleError(_0x1d5eeb,null));};exports[_0x6de1('0x21')]=function(_0xbadca7,_0x27e698){if(_0xbadca7[_0x6de1('0x44')]['id']){delete _0xbadca7[_0x6de1('0x44')]['id'];}return db[_0x6de1('0x2b')][_0x6de1('0x42')]({'where':{'id':_0xbadca7[_0x6de1('0x40')]['id']}})[_0x6de1('0x22')](handleEntityNotFound(_0x27e698,null))[_0x6de1('0x22')](saveUpdates(_0xbadca7[_0x6de1('0x44')],null))[_0x6de1('0x22')](respondWithResult(_0x27e698,null))[_0x6de1('0x43')](handleError(_0x27e698,null));};exports[_0x6de1('0x45')]=function(_0x539c4c,_0x9b6f2b,_0x15d653){var _0x36b90e=require(_0x6de1('0x46'));var _0x5c8a05=![];var _0x4bb438={};if(_0x539c4c[_0x6de1('0x31')][_0x6de1('0x2d')]&&_0x539c4c[_0x6de1('0x31')][_0x6de1('0x2d')]==='uniqueid'){_0x4bb438[_0x6de1('0x47')]=_0x539c4c[_0x6de1('0x40')]['id'];}else{_0x4bb438['id']=_0x539c4c[_0x6de1('0x40')]['id'];}return db[_0x6de1('0x2b')][_0x6de1('0x42')]({'where':_0x4bb438,'attributes':['id',_0x6de1('0x48'),'filename'],'raw':!![]})['then'](handleEntityNotFound(_0x9b6f2b,null))[_0x6de1('0x22')](function(_0x14eccc){if(_0x14eccc){var _0x14a2c4=_0x14eccc['savePath'];var _0x3ef967=util[_0x6de1('0x49')](_0x6de1('0x4a'),_0x14a2c4);if(fs[_0x6de1('0x4b')](_0x3ef967)){_0x5c8a05=!![];return _0x36b90e[_0x6de1('0x4c')](_0x3ef967,_0x14a2c4,config[_0x6de1('0x4d')]['recording'])[_0x6de1('0x22')](function(){return _0x14eccc;});}return _0x14eccc;}})[_0x6de1('0x22')](function(_0x59cfcf){if(_0x59cfcf){var _0x5702ef=_0x59cfcf[_0x6de1('0x48')];if(!fs[_0x6de1('0x4b')](_0x5702ef)){throw new db[(_0x6de1('0x4e'))][(_0x6de1('0x4f'))](_0x6de1('0x50'));}if(_0x59cfcf[_0x6de1('0x51')]){return _0x9b6f2b[_0x6de1('0x45')](_0x5702ef,_0x59cfcf[_0x6de1('0x51')]+path[_0x6de1('0x52')](_0x5702ef),function(){if(_0x5c8a05){fs[_0x6de1('0x53')](_0x5702ef);}});}else{return _0x9b6f2b[_0x6de1('0x45')](_0x5702ef,function(_0x34fc6d){if(_0x5c8a05){fs[_0x6de1('0x53')](_0x5702ef);}});}}})[_0x6de1('0x43')](function(_0x4a20d3){if(_0x4a20d3['message']===_0x6de1('0x50')){_0x9b6f2b[_0x6de1('0x18')](0x194)[_0x6de1('0x29')](_0x6de1('0x54'));}else{return handleError(_0x9b6f2b,null);}});};exports[_0x6de1('0x23')]=function(_0x4a134a,_0x104533){return db['SquareRecording']['find']({'where':{'id':_0x4a134a[_0x6de1('0x40')]['id']}})[_0x6de1('0x22')](function(_0x25b348){if(_['isNil'](_0x25b348)){throw new ReferenceError(_0x6de1('0x55'));}return _0x25b348;})[_0x6de1('0x22')](function(_0x5c0220){var _0x3791dc=_0x5c0220['savePath'];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x3791dc);if(!_['isNil'](_0x5c0220[_0x6de1('0x48')])&&fs['existsSync'](_0x3791dc)){logger['info'](_0x6de1('0x56')+_0x3791dc+_0x6de1('0x57'));fs[_0x6de1('0x58')](_0x3791dc);}_0x3791dc=_0x3791dc+'.cypher';if(!_['isNil'](_0x5c0220[_0x6de1('0x48')])&&fs['existsSync'](_0x3791dc)){logger[_0x6de1('0x59')](_0x6de1('0x56')+_0x3791dc+_0x6de1('0x57'));fs['unlinkSync'](_0x3791dc);}return _0x5c0220;})[_0x6de1('0x22')](function(_0x50ec6e){if(!_0x50ec6e)throw new InternalError();return _0x50ec6e[_0x6de1('0x23')]();})[_0x6de1('0x22')](function(){_0x104533[_0x6de1('0x18')](0xcc)[_0x6de1('0x24')]();})[_0x6de1('0x43')](handleError(_0x104533,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 038f2a9..dca7175 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 _0x47a1=['SquareRecording','square_recordings','lodash','api','bluebird','request-promise','rimraf','../../config/environment','./squareRecording.attributes','exports','define'];(function(_0x2f3ecd,_0x57976b){var _0xffdc44=function(_0xf21bc6){while(--_0xf21bc6){_0x2f3ecd['push'](_0x2f3ecd['shift']());}};_0xffdc44(++_0x57976b);}(_0x47a1,0xbd));var _0x147a=function(_0x23abc8,_0x39929c){_0x23abc8=_0x23abc8-0x0;var _0x384c1f=_0x47a1[_0x23abc8];return _0x384c1f;};'use strict';var _=require(_0x147a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x147a('0x1'));var moment=require('moment');var BPromise=require(_0x147a('0x2'));var rp=require(_0x147a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x147a('0x4'));var config=require(_0x147a('0x5'));var attributes=require(_0x147a('0x6'));module[_0x147a('0x7')]=function(_0x31373d,_0x57e7a2){return _0x31373d[_0x147a('0x8')](_0x147a('0x9'),attributes,{'tableName':_0x147a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa6b0=['rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','moment','bluebird','request-promise'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x33e08e,_0xc23943){_0x33e08e=_0x33e08e-0x0;var _0xd6665a=_0xa6b0[_0x33e08e];return _0xd6665a;};'use strict';var _=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0a6b('0x2'));var BPromise=require(_0x0a6b('0x3'));var rp=require(_0x0a6b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a6b('0x5'));var config=require(_0x0a6b('0x6'));var attributes=require(_0x0a6b('0x7'));module[_0x0a6b('0x8')]=function(_0x3dc2b0,_0x3b6967){return _0x3dc2b0[_0x0a6b('0x9')](_0x0a6b('0xa'),attributes,{'tableName':_0x0a6b('0xb'),'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 a748ebe..90a52c8 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 _0xdef9=['debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','SquareRecording,\x20%s,\x20%s','request\x20sent'];(function(_0xdeac17,_0x19ad66){var _0x33aabd=function(_0x558a9e){while(--_0x558a9e){_0xdeac17['push'](_0xdeac17['shift']());}};_0x33aabd(++_0x19ad66);}(_0xdef9,0x1ed));var _0x9def=function(_0x23a79e,_0x235f89){_0x23a79e=_0x23a79e-0x0;var _0x3dab57=_0xdef9[_0x23a79e];return _0x3dab57;};'use strict';var _=require(_0x9def('0x0'));var util=require(_0x9def('0x1'));var moment=require(_0x9def('0x2'));var BPromise=require(_0x9def('0x3'));var rs=require(_0x9def('0x4'));var fs=require('fs');var Redis=require(_0x9def('0x5'));var db=require(_0x9def('0x6'))['db'];var utils=require(_0x9def('0x7'));var logger=require(_0x9def('0x8'))(_0x9def('0x9'));var config=require(_0x9def('0xa'));var jayson=require(_0x9def('0xb'));var client=jayson[_0x9def('0xc')][_0x9def('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x40c607,_0x25a03e,_0x42296c){return new BPromise(function(_0x1efce0,_0x8262f1){return client['request'](_0x40c607,_0x42296c)[_0x9def('0xe')](function(_0x4f0a0d){logger['info'](_0x9def('0xf'),_0x25a03e,_0x9def('0x10'));logger[_0x9def('0x11')](_0x9def('0x12'),_0x25a03e,'request\x20sent',JSON[_0x9def('0x13')](_0x4f0a0d));if(_0x4f0a0d[_0x9def('0x14')]){if(_0x4f0a0d[_0x9def('0x14')][_0x9def('0x15')]===0x1f4){logger['error'](_0x9def('0xf'),_0x25a03e,_0x4f0a0d[_0x9def('0x14')]['message']);return _0x8262f1(_0x4f0a0d[_0x9def('0x14')]['message']);}logger['error'](_0x9def('0xf'),_0x25a03e,_0x4f0a0d[_0x9def('0x14')][_0x9def('0x16')]);return _0x1efce0(_0x4f0a0d['error'][_0x9def('0x16')]);}else{logger['info']('SquareRecording,\x20%s,\x20%s',_0x25a03e,_0x9def('0x10'));_0x1efce0(_0x4f0a0d[_0x9def('0x17')][_0x9def('0x16')]);}})[_0x9def('0x18')](function(_0x463520){logger[_0x9def('0x14')](_0x9def('0xf'),_0x25a03e,_0x463520);_0x8262f1(_0x463520);});});}exports[_0x9def('0x19')]=function(_0x2d3f63){var _0x160711=this;return new Promise(function(_0x5294fe,_0x2be0fb){return db[_0x9def('0x1a')]['create'](_0x2d3f63[_0x9def('0x1b')],{'raw':_0x2d3f63[_0x9def('0x1c')]?_0x2d3f63['options'][_0x9def('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x2edbb2){logger['info'](_0x9def('0x19'),_0x2d3f63);logger[_0x9def('0x11')]('CreateSquareRecording',_0x2d3f63,JSON[_0x9def('0x13')](_0x2edbb2));_0x5294fe(_0x2edbb2);})[_0x9def('0x18')](function(_0x400fed){logger['error'](_0x9def('0x19'),_0x400fed['message'],_0x2d3f63);_0x2be0fb(_0x160711[_0x9def('0x14')](0x1f4,_0x400fed[_0x9def('0x16')]));});});}; \ No newline at end of file +var _0x57c9=['debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','message','SquareRecording,\x20%s,\x20%s','result','catch','CreateSquareRecording','create','body','options','raw','then','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent'];(function(_0x164f7d,_0x265b2b){var _0x2a5376=function(_0x1d2015){while(--_0x1d2015){_0x164f7d['push'](_0x164f7d['shift']());}};_0x2a5376(++_0x265b2b);}(_0x57c9,0xd2));var _0x957c=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x57c9[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x957c('0x0'));var util=require(_0x957c('0x1'));var moment=require(_0x957c('0x2'));var BPromise=require(_0x957c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x957c('0x4'))['db'];var utils=require(_0x957c('0x5'));var logger=require(_0x957c('0x6'))('rpc');var config=require(_0x957c('0x7'));var jayson=require(_0x957c('0x8'));var client=jayson[_0x957c('0x9')][_0x957c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1291f9,_0x34ab12,_0x5a28bb){return new BPromise(function(_0x55a727,_0x3ebc21){return client[_0x957c('0xb')](_0x1291f9,_0x5a28bb)['then'](function(_0x421c1c){logger[_0x957c('0xc')]('SquareRecording,\x20%s,\x20%s',_0x34ab12,_0x957c('0xd'));logger[_0x957c('0xe')](_0x957c('0xf'),_0x34ab12,_0x957c('0xd'),JSON['stringify'](_0x421c1c));if(_0x421c1c[_0x957c('0x10')]){if(_0x421c1c['error'][_0x957c('0x11')]===0x1f4){logger[_0x957c('0x10')]('SquareRecording,\x20%s,\x20%s',_0x34ab12,_0x421c1c[_0x957c('0x10')][_0x957c('0x12')]);return _0x3ebc21(_0x421c1c[_0x957c('0x10')][_0x957c('0x12')]);}logger[_0x957c('0x10')](_0x957c('0x13'),_0x34ab12,_0x421c1c[_0x957c('0x10')]['message']);return _0x55a727(_0x421c1c['error'][_0x957c('0x12')]);}else{logger['info']('SquareRecording,\x20%s,\x20%s',_0x34ab12,_0x957c('0xd'));_0x55a727(_0x421c1c[_0x957c('0x14')][_0x957c('0x12')]);}})[_0x957c('0x15')](function(_0x2ddf89){logger[_0x957c('0x10')](_0x957c('0x13'),_0x34ab12,_0x2ddf89);_0x3ebc21(_0x2ddf89);});});}exports[_0x957c('0x16')]=function(_0x2e2d3b){var _0x435fab=this;return new Promise(function(_0x52ce95,_0x59b1d4){return db['SquareRecording'][_0x957c('0x17')](_0x2e2d3b[_0x957c('0x18')],{'raw':_0x2e2d3b[_0x957c('0x19')]?_0x2e2d3b[_0x957c('0x19')][_0x957c('0x1a')]===undefined?!![]:![]:!![]})[_0x957c('0x1b')](function(_0x5d2a5a){logger[_0x957c('0xc')](_0x957c('0x16'),_0x2e2d3b);logger[_0x957c('0xe')](_0x957c('0x16'),_0x2e2d3b,JSON['stringify'](_0x5d2a5a));_0x52ce95(_0x5d2a5a);})[_0x957c('0x15')](function(_0xde83da){logger[_0x957c('0x10')]('CreateSquareRecording',_0xde83da[_0x957c('0x12')],_0x2e2d3b);_0x59b1d4(_0x435fab[_0x957c('0x10')](0x1f4,_0xde83da[_0x957c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 444b1cb..ef2f6fb 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 _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x57a078,_0x159bf9){var _0x5e57c8=function(_0x38774b){while(--_0x38774b){_0x57a078['push'](_0x57a078['shift']());}};_0x5e57c8(++_0x159bf9);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0xff7c9e,_0x3b0d4d){var _0x31af3d=function(_0x22c6b2){while(--_0x22c6b2){_0xff7c9e['push'](_0xff7c9e['shift']());}};_0x31af3d(++_0x3b0d4d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbaf0[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 3744d27..996655b 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 _0x6262=['DATE','BOOLEAN','exports','STRING'];(function(_0x2568c0,_0x378ce8){var _0x2636f1=function(_0x12b267){while(--_0x12b267){_0x2568c0['push'](_0x2568c0['shift']());}};_0x2636f1(++_0x378ce8);}(_0x6262,0x72));var _0x2626=function(_0x24853d,_0x16931f){_0x24853d=_0x24853d-0x0;var _0x4c5cff=_0x6262[_0x24853d];return _0x4c5cff;};'use strict';var Sequelize=require('sequelize');module[_0x2626('0x0')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x2626('0x1')]},'request':{'type':Sequelize[_0x2626('0x1')]},'channel':{'type':Sequelize[_0x2626('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x2626('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2626('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x2626('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x2626('0x1')]},'rdnis':{'type':Sequelize[_0x2626('0x1')]},'context':{'type':Sequelize[_0x2626('0x1')]},'extension':{'type':Sequelize[_0x2626('0x1')]},'priority':{'type':Sequelize[_0x2626('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x2626('0x1')]},'project_name':{'type':Sequelize[_0x2626('0x1')]},'joinAt':{'type':Sequelize[_0x2626('0x2')]},'leaveAt':{'type':Sequelize[_0x2626('0x2')]},'bot':{'type':Sequelize[_0x2626('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x1ad3=['BOOLEAN','STRING','DATE'];(function(_0x5a6a35,_0x3207d4){var _0x1a8d4b=function(_0x3ce9e0){while(--_0x3ce9e0){_0x5a6a35['push'](_0x5a6a35['shift']());}};_0x1a8d4b(++_0x3207d4);}(_0x1ad3,0xd6));var _0x31ad=function(_0x468a77,_0x1382be){_0x468a77=_0x468a77-0x0;var _0x2d1c33=_0x1ad3[_0x468a77];return _0x2d1c33;};'use strict';var Sequelize=require('sequelize');module['exports']={'network':{'type':Sequelize[_0x31ad('0x0')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x31ad('0x0')]},'channel':{'type':Sequelize[_0x31ad('0x0')]},'language':{'type':Sequelize[_0x31ad('0x0')]},'type':{'type':Sequelize[_0x31ad('0x0')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x31ad('0x0')]},'callerid':{'type':Sequelize[_0x31ad('0x0')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x31ad('0x0')]},'callingani2':{'type':Sequelize[_0x31ad('0x0')]},'callington':{'type':Sequelize[_0x31ad('0x0')]},'callingtns':{'type':Sequelize[_0x31ad('0x0')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x31ad('0x0')]},'context':{'type':Sequelize[_0x31ad('0x0')]},'extension':{'type':Sequelize[_0x31ad('0x0')]},'priority':{'type':Sequelize[_0x31ad('0x0')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x31ad('0x0')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x31ad('0x1')]},'leaveAt':{'type':Sequelize[_0x31ad('0x1')]},'bot':{'type':Sequelize[_0x31ad('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 3dd688f..3c46676 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 _0x3967=['count','set','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','SquareReport','findAll','catch','show','params','keys','length','create','body','find','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x3967,0x1f1));var _0x7396=function(_0x5d5bcb,_0x25e2ea){_0x5d5bcb=_0x5d5bcb-0x0;var _0x4ea5eb=_0x3967[_0x5d5bcb];return _0x4ea5eb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7396('0x0'));var jsonpatch=require(_0x7396('0x1'));var rp=require(_0x7396('0x2'));var moment=require(_0x7396('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7396('0x4'));var util=require(_0x7396('0x5'));var path=require(_0x7396('0x6'));var sox=require(_0x7396('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7396('0x8'));var _=require(_0x7396('0x9'));var squel=require(_0x7396('0xa'));var crypto=require(_0x7396('0xb'));var jsforce=require(_0x7396('0xc'));var deskjs=require(_0x7396('0xd'));var toCsv=require(_0x7396('0xe'));var querystring=require(_0x7396('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7396('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7396('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7396('0x12'))(_0x7396('0x13'));var utils=require(_0x7396('0x14'));var config=require(_0x7396('0x15'));var licenseUtil=require(_0x7396('0x16'));var db=require(_0x7396('0x17'))['db'];function respondWithStatusCode(_0x3353e3,_0x5c64ee){_0x5c64ee=_0x5c64ee||0xcc;return function(_0x1f28a3){if(_0x1f28a3){return _0x3353e3['sendStatus'](_0x5c64ee);}return _0x3353e3[_0x7396('0x18')](_0x5c64ee)['end']();};}function respondWithResult(_0x36da02,_0x1d3267){_0x1d3267=_0x1d3267||0xc8;return function(_0x3b446e){if(_0x3b446e){return _0x36da02[_0x7396('0x18')](_0x1d3267)['json'](_0x3b446e);}};}function respondWithFilteredResult(_0x23f687,_0x24fac0){return function(_0x580e1d){if(_0x580e1d){var _0x283ba7=typeof _0x24fac0[_0x7396('0x19')]===_0x7396('0x1a')&&typeof _0x24fac0[_0x7396('0x1b')]===_0x7396('0x1a');var _0x90f808=_0x580e1d['count'];var _0x21f54f=_0x283ba7?0x0:_0x24fac0[_0x7396('0x19')];var _0x22fdf5=_0x283ba7?_0x580e1d[_0x7396('0x1c')]:_0x24fac0[_0x7396('0x19')]+_0x24fac0[_0x7396('0x1b')];var _0x479f3b;if(_0x22fdf5>=_0x90f808){_0x22fdf5=_0x90f808;_0x479f3b=0xc8;}else{_0x479f3b=0xce;}_0x23f687[_0x7396('0x18')](_0x479f3b);return _0x23f687[_0x7396('0x1d')](_0x7396('0x1e'),_0x21f54f+'-'+_0x22fdf5+'/'+_0x90f808)['json'](_0x580e1d);}return null;};}function patchUpdates(_0x1fd33a){return function(_0x33fcec){try{jsonpatch[_0x7396('0x1f')](_0x33fcec,_0x1fd33a,!![]);}catch(_0x5b82f8){return BPromise[_0x7396('0x20')](_0x5b82f8);}return _0x33fcec[_0x7396('0x21')]();};}function saveUpdates(_0x3634c0,_0x489b5d){return function(_0x3d79a1){if(_0x3d79a1){return _0x3d79a1[_0x7396('0x22')](_0x3634c0)['then'](function(_0x452899){return _0x452899;});}return null;};}function removeEntity(_0x1724ff,_0x5ad1bb){return function(_0xbad8c0){if(_0xbad8c0){return _0xbad8c0[_0x7396('0x23')]()[_0x7396('0x24')](function(){_0x1724ff[_0x7396('0x18')](0xcc)[_0x7396('0x25')]();});}};}function handleEntityNotFound(_0x41309f,_0xd9d076){return function(_0x5a1a32){if(!_0x5a1a32){_0x41309f[_0x7396('0x26')](0x194);}return _0x5a1a32;};}function handleError(_0x40feb0,_0x144393){_0x144393=_0x144393||0x1f4;return function(_0x46663d){logger[_0x7396('0x27')](_0x46663d[_0x7396('0x28')]);if(_0x46663d[_0x7396('0x29')]){delete _0x46663d['name'];}_0x40feb0[_0x7396('0x18')](_0x144393)['send'](_0x46663d);};}exports[_0x7396('0x2a')]=function(_0x48d5a1,_0x144e7b){var _0x273c63={},_0xd92032={},_0x1be2b5={'count':0x0,'rows':[]};var _0x82b2cb=_[_0x7396('0x2b')](db['SquareReport'][_0x7396('0x2c')],function(_0x18496c){return{'name':_0x18496c[_0x7396('0x2d')],'type':_0x18496c[_0x7396('0x2e')][_0x7396('0x2f')]};});_0xd92032[_0x7396('0x30')]=_[_0x7396('0x2b')](_0x82b2cb,_0x7396('0x29'));_0xd92032[_0x7396('0x31')]=_['keys'](_0x48d5a1[_0x7396('0x31')]);_0xd92032[_0x7396('0x32')]=_[_0x7396('0x33')](_0xd92032[_0x7396('0x30')],_0xd92032[_0x7396('0x31')]);_0x273c63[_0x7396('0x34')]=_[_0x7396('0x33')](_0xd92032[_0x7396('0x30')],qs[_0x7396('0x35')](_0x48d5a1[_0x7396('0x31')][_0x7396('0x35')]));_0x273c63[_0x7396('0x34')]=_0x273c63[_0x7396('0x34')]['length']?_0x273c63[_0x7396('0x34')]:_0xd92032[_0x7396('0x30')];if(!_0x48d5a1[_0x7396('0x31')][_0x7396('0x36')](_0x7396('0x37'))){_0x273c63[_0x7396('0x1b')]=qs['limit'](_0x48d5a1[_0x7396('0x31')][_0x7396('0x1b')]);_0x273c63['offset']=qs[_0x7396('0x19')](_0x48d5a1[_0x7396('0x31')]['offset']);}_0x273c63[_0x7396('0x38')]=qs[_0x7396('0x39')](_0x48d5a1[_0x7396('0x31')]['sort']);_0x273c63['where']=qs[_0x7396('0x32')](_[_0x7396('0x3a')](_0x48d5a1['query'],_0xd92032['filters']),_0x82b2cb);if(_0x48d5a1[_0x7396('0x31')][_0x7396('0x3b')]){_0x273c63[_0x7396('0x3c')]=_[_0x7396('0x3d')](_0x273c63[_0x7396('0x3c')],{'$or':_[_0x7396('0x2b')](_0x82b2cb,function(_0x142b95){if(_0x142b95[_0x7396('0x2e')]!=='VIRTUAL'){var _0x35599={};_0x35599[_0x142b95[_0x7396('0x29')]]={'$like':'%'+_0x48d5a1[_0x7396('0x31')][_0x7396('0x3b')]+'%'};return _0x35599;}})});}_0x273c63=_[_0x7396('0x3d')]({},_0x273c63,_0x48d5a1[_0x7396('0x3e')]);var _0x36e457={'where':_0x273c63[_0x7396('0x3c')]};return db['SquareReport'][_0x7396('0x1c')](_0x36e457)[_0x7396('0x24')](function(_0x278231){_0x1be2b5[_0x7396('0x1c')]=_0x278231;if(_0x48d5a1[_0x7396('0x31')][_0x7396('0x3f')]){_0x273c63['include']=[{'all':!![]}];}return db[_0x7396('0x40')][_0x7396('0x41')](_0x273c63);})[_0x7396('0x24')](function(_0x4b3fc9){_0x1be2b5['rows']=_0x4b3fc9;return _0x1be2b5;})[_0x7396('0x24')](respondWithFilteredResult(_0x144e7b,_0x273c63))[_0x7396('0x42')](handleError(_0x144e7b,null));};exports[_0x7396('0x43')]=function(_0x28f06e,_0x4b9e32){var _0x407031={'raw':!![],'where':{'id':_0x28f06e[_0x7396('0x44')]['id']}},_0x37857e={};_0x37857e[_0x7396('0x30')]=_[_0x7396('0x45')](db[_0x7396('0x40')][_0x7396('0x2c')]);_0x37857e[_0x7396('0x31')]=_[_0x7396('0x45')](_0x28f06e[_0x7396('0x31')]);_0x37857e[_0x7396('0x32')]=_['intersection'](_0x37857e['model'],_0x37857e[_0x7396('0x31')]);_0x407031[_0x7396('0x34')]=_[_0x7396('0x33')](_0x37857e[_0x7396('0x30')],qs[_0x7396('0x35')](_0x28f06e[_0x7396('0x31')][_0x7396('0x35')]));_0x407031[_0x7396('0x34')]=_0x407031[_0x7396('0x34')][_0x7396('0x46')]?_0x407031[_0x7396('0x34')]:_0x37857e[_0x7396('0x30')];if(_0x28f06e[_0x7396('0x31')]['includeAll']){_0x407031['include']=[{'all':!![]}];}_0x407031=_['merge']({},_0x407031,_0x28f06e[_0x7396('0x3e')]);return db[_0x7396('0x40')]['find'](_0x407031)[_0x7396('0x24')](handleEntityNotFound(_0x4b9e32,null))[_0x7396('0x24')](respondWithResult(_0x4b9e32,null))[_0x7396('0x42')](handleError(_0x4b9e32,null));};exports[_0x7396('0x47')]=function(_0x130c50,_0x594030){return db[_0x7396('0x40')][_0x7396('0x47')](_0x130c50[_0x7396('0x48')],{})[_0x7396('0x24')](respondWithResult(_0x594030,0xc9))[_0x7396('0x42')](handleError(_0x594030,null));};exports['update']=function(_0x4c228a,_0x3720da){if(_0x4c228a['body']['id']){delete _0x4c228a['body']['id'];}return db[_0x7396('0x40')]['find']({'where':{'id':_0x4c228a[_0x7396('0x44')]['id']}})[_0x7396('0x24')](handleEntityNotFound(_0x3720da,null))[_0x7396('0x24')](saveUpdates(_0x4c228a[_0x7396('0x48')],null))[_0x7396('0x24')](respondWithResult(_0x3720da,null))[_0x7396('0x42')](handleError(_0x3720da,null));};exports['destroy']=function(_0x460d0e,_0x3cd41c){return db[_0x7396('0x40')][_0x7396('0x49')]({'where':{'id':_0x460d0e[_0x7396('0x44')]['id']}})[_0x7396('0x24')](handleEntityNotFound(_0x3cd41c,null))[_0x7396('0x24')](removeEntity(_0x3cd41c,null))[_0x7396('0x42')](handleError(_0x3cd41c,null));};exports[_0x7396('0x4a')]=function(_0x3a14b6,_0x42f25e){return db['SquareReport']['describe']()[_0x7396('0x24')](respondWithResult(_0x42f25e,null))[_0x7396('0x42')](handleError(_0x42f25e,null));}; \ No newline at end of file +var _0xb3e3=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','where','pick','filter','merge','VIRTUAL','includeAll','SquareReport','findAll','rows','catch','params','keys','include','options','find','create','body','describe','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x488ca1,_0xf6858e){var _0x4dd0a4=function(_0x40fb65){while(--_0x40fb65){_0x488ca1['push'](_0x488ca1['shift']());}};_0x4dd0a4(++_0xf6858e);}(_0xb3e3,0x114));var _0x3b3e=function(_0x828eee,_0x3f1299){_0x828eee=_0x828eee-0x0;var _0x513622=_0xb3e3[_0x828eee];return _0x513622;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3b3e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3b3e('0x1'));var rp=require(_0x3b3e('0x2'));var moment=require('moment');var BPromise=require(_0x3b3e('0x3'));var Mustache=require(_0x3b3e('0x4'));var util=require('util');var path=require(_0x3b3e('0x5'));var sox=require(_0x3b3e('0x6'));var csv=require('to-csv');var ejs=require(_0x3b3e('0x7'));var fs=require('fs');var fs_extra=require(_0x3b3e('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3b3e('0x9'));var jsforce=require(_0x3b3e('0xa'));var deskjs=require(_0x3b3e('0xb'));var toCsv=require(_0x3b3e('0xc'));var querystring=require(_0x3b3e('0xd'));var Papa=require('papaparse');var Redis=require(_0x3b3e('0xe'));var authService=require(_0x3b3e('0xf'));var qs=require(_0x3b3e('0x10'));var as=require(_0x3b3e('0x11'));var hardwareService=require(_0x3b3e('0x12'));var logger=require('../../config/logger')(_0x3b3e('0x13'));var utils=require(_0x3b3e('0x14'));var config=require(_0x3b3e('0x15'));var licenseUtil=require(_0x3b3e('0x16'));var db=require(_0x3b3e('0x17'))['db'];function respondWithStatusCode(_0x4d5909,_0x4abb56){_0x4abb56=_0x4abb56||0xcc;return function(_0x4bff49){if(_0x4bff49){return _0x4d5909[_0x3b3e('0x18')](_0x4abb56);}return _0x4d5909[_0x3b3e('0x19')](_0x4abb56)[_0x3b3e('0x1a')]();};}function respondWithResult(_0x4a1578,_0x4c18e8){_0x4c18e8=_0x4c18e8||0xc8;return function(_0xb0cf58){if(_0xb0cf58){return _0x4a1578[_0x3b3e('0x19')](_0x4c18e8)[_0x3b3e('0x1b')](_0xb0cf58);}};}function respondWithFilteredResult(_0xc90756,_0x1f919a){return function(_0x1f871a){if(_0x1f871a){var _0x35e08d=typeof _0x1f919a[_0x3b3e('0x1c')]===_0x3b3e('0x1d')&&typeof _0x1f919a[_0x3b3e('0x1e')]===_0x3b3e('0x1d');var _0x2753a3=_0x1f871a[_0x3b3e('0x1f')];var _0x97c72f=_0x35e08d?0x0:_0x1f919a[_0x3b3e('0x1c')];var _0x176229=_0x35e08d?_0x1f871a[_0x3b3e('0x1f')]:_0x1f919a[_0x3b3e('0x1c')]+_0x1f919a[_0x3b3e('0x1e')];var _0x3b5d57;if(_0x176229>=_0x2753a3){_0x176229=_0x2753a3;_0x3b5d57=0xc8;}else{_0x3b5d57=0xce;}_0xc90756[_0x3b3e('0x19')](_0x3b5d57);return _0xc90756[_0x3b3e('0x20')](_0x3b3e('0x21'),_0x97c72f+'-'+_0x176229+'/'+_0x2753a3)[_0x3b3e('0x1b')](_0x1f871a);}return null;};}function patchUpdates(_0xd827d9){return function(_0x2680c8){try{jsonpatch[_0x3b3e('0x22')](_0x2680c8,_0xd827d9,!![]);}catch(_0x5e08c4){return BPromise[_0x3b3e('0x23')](_0x5e08c4);}return _0x2680c8[_0x3b3e('0x24')]();};}function saveUpdates(_0x3daec6,_0x38a835){return function(_0x13fc06){if(_0x13fc06){return _0x13fc06[_0x3b3e('0x25')](_0x3daec6)['then'](function(_0x1df24a){return _0x1df24a;});}return null;};}function removeEntity(_0x59ac85,_0x19e4ff){return function(_0x29ddaf){if(_0x29ddaf){return _0x29ddaf[_0x3b3e('0x26')]()[_0x3b3e('0x27')](function(){_0x59ac85[_0x3b3e('0x19')](0xcc)[_0x3b3e('0x1a')]();});}};}function handleEntityNotFound(_0x1f4e8d,_0xfb819a){return function(_0x13520e){if(!_0x13520e){_0x1f4e8d[_0x3b3e('0x18')](0x194);}return _0x13520e;};}function handleError(_0x4f3dc1,_0x57b99b){_0x57b99b=_0x57b99b||0x1f4;return function(_0x4a81ff){logger[_0x3b3e('0x28')](_0x4a81ff['stack']);if(_0x4a81ff[_0x3b3e('0x29')]){delete _0x4a81ff[_0x3b3e('0x29')];}_0x4f3dc1[_0x3b3e('0x19')](_0x57b99b)[_0x3b3e('0x2a')](_0x4a81ff);};}exports[_0x3b3e('0x2b')]=function(_0x2a9190,_0xc40dea){var _0x3236ec={},_0x21af47={},_0x209987={'count':0x0,'rows':[]};var _0x77a3e6=_[_0x3b3e('0x2c')](db['SquareReport'][_0x3b3e('0x2d')],function(_0x4e24f9){return{'name':_0x4e24f9[_0x3b3e('0x2e')],'type':_0x4e24f9[_0x3b3e('0x2f')][_0x3b3e('0x30')]};});_0x21af47['model']=_[_0x3b3e('0x2c')](_0x77a3e6,'name');_0x21af47[_0x3b3e('0x31')]=_['keys'](_0x2a9190[_0x3b3e('0x31')]);_0x21af47[_0x3b3e('0x32')]=_[_0x3b3e('0x33')](_0x21af47[_0x3b3e('0x34')],_0x21af47['query']);_0x3236ec[_0x3b3e('0x35')]=_[_0x3b3e('0x33')](_0x21af47[_0x3b3e('0x34')],qs[_0x3b3e('0x36')](_0x2a9190['query'][_0x3b3e('0x36')]));_0x3236ec[_0x3b3e('0x35')]=_0x3236ec[_0x3b3e('0x35')][_0x3b3e('0x37')]?_0x3236ec['attributes']:_0x21af47['model'];if(!_0x2a9190[_0x3b3e('0x31')][_0x3b3e('0x38')]('nolimit')){_0x3236ec[_0x3b3e('0x1e')]=qs[_0x3b3e('0x1e')](_0x2a9190[_0x3b3e('0x31')][_0x3b3e('0x1e')]);_0x3236ec['offset']=qs[_0x3b3e('0x1c')](_0x2a9190['query'][_0x3b3e('0x1c')]);}_0x3236ec['order']=qs['sort'](_0x2a9190['query']['sort']);_0x3236ec[_0x3b3e('0x39')]=qs[_0x3b3e('0x32')](_[_0x3b3e('0x3a')](_0x2a9190[_0x3b3e('0x31')],_0x21af47[_0x3b3e('0x32')]),_0x77a3e6);if(_0x2a9190['query'][_0x3b3e('0x3b')]){_0x3236ec[_0x3b3e('0x39')]=_[_0x3b3e('0x3c')](_0x3236ec[_0x3b3e('0x39')],{'$or':_[_0x3b3e('0x2c')](_0x77a3e6,function(_0x4a69ee){if(_0x4a69ee[_0x3b3e('0x2f')]!==_0x3b3e('0x3d')){var _0x13edc5={};_0x13edc5[_0x4a69ee[_0x3b3e('0x29')]]={'$like':'%'+_0x2a9190[_0x3b3e('0x31')][_0x3b3e('0x3b')]+'%'};return _0x13edc5;}})});}_0x3236ec=_[_0x3b3e('0x3c')]({},_0x3236ec,_0x2a9190['options']);var _0x578fe7={'where':_0x3236ec[_0x3b3e('0x39')]};return db['SquareReport'][_0x3b3e('0x1f')](_0x578fe7)['then'](function(_0x1b1032){_0x209987[_0x3b3e('0x1f')]=_0x1b1032;if(_0x2a9190[_0x3b3e('0x31')][_0x3b3e('0x3e')]){_0x3236ec['include']=[{'all':!![]}];}return db[_0x3b3e('0x3f')][_0x3b3e('0x40')](_0x3236ec);})[_0x3b3e('0x27')](function(_0x153ea4){_0x209987[_0x3b3e('0x41')]=_0x153ea4;return _0x209987;})[_0x3b3e('0x27')](respondWithFilteredResult(_0xc40dea,_0x3236ec))[_0x3b3e('0x42')](handleError(_0xc40dea,null));};exports['show']=function(_0x5c34db,_0x56ad34){var _0x1e8576={'raw':!![],'where':{'id':_0x5c34db[_0x3b3e('0x43')]['id']}},_0xfe4095={};_0xfe4095[_0x3b3e('0x34')]=_[_0x3b3e('0x44')](db[_0x3b3e('0x3f')][_0x3b3e('0x2d')]);_0xfe4095[_0x3b3e('0x31')]=_[_0x3b3e('0x44')](_0x5c34db['query']);_0xfe4095[_0x3b3e('0x32')]=_[_0x3b3e('0x33')](_0xfe4095[_0x3b3e('0x34')],_0xfe4095['query']);_0x1e8576[_0x3b3e('0x35')]=_[_0x3b3e('0x33')](_0xfe4095[_0x3b3e('0x34')],qs['fields'](_0x5c34db['query'][_0x3b3e('0x36')]));_0x1e8576[_0x3b3e('0x35')]=_0x1e8576['attributes'][_0x3b3e('0x37')]?_0x1e8576[_0x3b3e('0x35')]:_0xfe4095[_0x3b3e('0x34')];if(_0x5c34db[_0x3b3e('0x31')]['includeAll']){_0x1e8576[_0x3b3e('0x45')]=[{'all':!![]}];}_0x1e8576=_[_0x3b3e('0x3c')]({},_0x1e8576,_0x5c34db[_0x3b3e('0x46')]);return db['SquareReport'][_0x3b3e('0x47')](_0x1e8576)[_0x3b3e('0x27')](handleEntityNotFound(_0x56ad34,null))[_0x3b3e('0x27')](respondWithResult(_0x56ad34,null))[_0x3b3e('0x42')](handleError(_0x56ad34,null));};exports[_0x3b3e('0x48')]=function(_0x5c536b,_0x3f3134){return db[_0x3b3e('0x3f')][_0x3b3e('0x48')](_0x5c536b[_0x3b3e('0x49')],{})[_0x3b3e('0x27')](respondWithResult(_0x3f3134,0xc9))[_0x3b3e('0x42')](handleError(_0x3f3134,null));};exports['update']=function(_0x484740,_0x3f5e5a){if(_0x484740[_0x3b3e('0x49')]['id']){delete _0x484740[_0x3b3e('0x49')]['id'];}return db[_0x3b3e('0x3f')][_0x3b3e('0x47')]({'where':{'id':_0x484740[_0x3b3e('0x43')]['id']}})[_0x3b3e('0x27')](handleEntityNotFound(_0x3f5e5a,null))[_0x3b3e('0x27')](saveUpdates(_0x484740['body'],null))[_0x3b3e('0x27')](respondWithResult(_0x3f5e5a,null))['catch'](handleError(_0x3f5e5a,null));};exports['destroy']=function(_0x200805,_0x3a019b){return db[_0x3b3e('0x3f')][_0x3b3e('0x47')]({'where':{'id':_0x200805[_0x3b3e('0x43')]['id']}})['then'](handleEntityNotFound(_0x3a019b,null))[_0x3b3e('0x27')](removeEntity(_0x3a019b,null))[_0x3b3e('0x42')](handleError(_0x3a019b,null));};exports[_0x3b3e('0x4a')]=function(_0x1b8aea,_0x1a6cd2){return db[_0x3b3e('0x3f')][_0x3b3e('0x4a')]()['then'](respondWithResult(_0x1a6cd2,null))['catch'](handleError(_0x1a6cd2,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index e338ed9..b0cc486 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 _0xcd0b=['rimraf','../../config/environment','exports','define','SquareReport','uid_pname','uniqueid','project_name','leaveAt','lodash','util','moment','bluebird','request-promise','path'];(function(_0x47d630,_0x134063){var _0x3b0cf8=function(_0x53c10e){while(--_0x53c10e){_0x47d630['push'](_0x47d630['shift']());}};_0x3b0cf8(++_0x134063);}(_0xcd0b,0xdb));var _0xbcd0=function(_0x1633a0,_0x3cdfc1){_0x1633a0=_0x1633a0-0x0;var _0x523846=_0xcd0b[_0x1633a0];return _0x523846;};'use strict';var _=require(_0xbcd0('0x0'));var util=require(_0xbcd0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbcd0('0x2'));var BPromise=require(_0xbcd0('0x3'));var rp=require(_0xbcd0('0x4'));var fs=require('fs');var path=require(_0xbcd0('0x5'));var rimraf=require(_0xbcd0('0x6'));var config=require(_0xbcd0('0x7'));var attributes=require('./squareReport.attributes');module[_0xbcd0('0x8')]=function(_0x2898e2,_0x2706ee){return _0x2898e2[_0xbcd0('0x9')](_0xbcd0('0xa'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xbcd0('0xb'),'fields':[_0xbcd0('0xc'),_0xbcd0('0xd')]},{'name':'leaveAt','fields':[_0xbcd0('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaa5=['report_square','uid_pname','project_name','leaveAt','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','SquareReport'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xbaa5,0x18c));var _0x5baa=function(_0x47469d,_0x60b2d1){_0x47469d=_0x47469d-0x0;var _0x5a0e51=_0xbaa5[_0x47469d];return _0x5a0e51;};'use strict';var _=require('lodash');var util=require(_0x5baa('0x0'));var logger=require(_0x5baa('0x1'))(_0x5baa('0x2'));var moment=require('moment');var BPromise=require(_0x5baa('0x3'));var rp=require(_0x5baa('0x4'));var fs=require('fs');var path=require(_0x5baa('0x5'));var rimraf=require(_0x5baa('0x6'));var config=require(_0x5baa('0x7'));var attributes=require(_0x5baa('0x8'));module['exports']=function(_0x470f2f,_0x196bf8){return _0x470f2f['define'](_0x5baa('0x9'),attributes,{'tableName':_0x5baa('0xa'),'paranoid':![],'indexes':[{'name':_0x5baa('0xb'),'fields':['uniqueid',_0x5baa('0xc')]},{'name':'leaveAt','fields':[_0x5baa('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 31a5505..66133ec 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 _0x9fbc=['CreateSquareReport','SquareReport','create','body','options','raw','UpdateSquareReport','update','where','limit','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareReport,\x20%s,\x20%s','message','result','catch'];(function(_0x218b11,_0x5578ae){var _0x2047b9=function(_0x16b52a){while(--_0x16b52a){_0x218b11['push'](_0x218b11['shift']());}};_0x2047b9(++_0x5578ae);}(_0x9fbc,0x8a));var _0xc9fb=function(_0x3f2a90,_0x50baf1){_0x3f2a90=_0x3f2a90-0x0;var _0xb46279=_0x9fbc[_0x3f2a90];return _0xb46279;};'use strict';var _=require('lodash');var util=require(_0xc9fb('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc9fb('0x1'));var db=require(_0xc9fb('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xc9fb('0x3'))(_0xc9fb('0x4'));var config=require(_0xc9fb('0x5'));var jayson=require(_0xc9fb('0x6'));var client=jayson[_0xc9fb('0x7')][_0xc9fb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x34c130,_0x4c4694,_0xbc5e34){return new BPromise(function(_0x2437a2,_0x4f7449){return client[_0xc9fb('0x9')](_0x34c130,_0xbc5e34)[_0xc9fb('0xa')](function(_0x487b6d){logger[_0xc9fb('0xb')]('SquareReport,\x20%s,\x20%s',_0x4c4694,_0xc9fb('0xc'));logger[_0xc9fb('0xd')](_0xc9fb('0xe'),_0x4c4694,_0xc9fb('0xc'),JSON[_0xc9fb('0xf')](_0x487b6d));if(_0x487b6d[_0xc9fb('0x10')]){if(_0x487b6d[_0xc9fb('0x10')][_0xc9fb('0x11')]===0x1f4){logger[_0xc9fb('0x10')](_0xc9fb('0x12'),_0x4c4694,_0x487b6d[_0xc9fb('0x10')]['message']);return _0x4f7449(_0x487b6d[_0xc9fb('0x10')]['message']);}logger[_0xc9fb('0x10')](_0xc9fb('0x12'),_0x4c4694,_0x487b6d[_0xc9fb('0x10')][_0xc9fb('0x13')]);return _0x2437a2(_0x487b6d[_0xc9fb('0x10')][_0xc9fb('0x13')]);}else{logger[_0xc9fb('0xb')]('SquareReport,\x20%s,\x20%s',_0x4c4694,'request\x20sent');_0x2437a2(_0x487b6d[_0xc9fb('0x14')][_0xc9fb('0x13')]);}})[_0xc9fb('0x15')](function(_0x3ac226){logger[_0xc9fb('0x10')](_0xc9fb('0x12'),_0x4c4694,_0x3ac226);_0x4f7449(_0x3ac226);});});}exports[_0xc9fb('0x16')]=function(_0x22f59e){var _0x2952a7=this;return new Promise(function(_0x4f0513,_0x5cd5fb){return db[_0xc9fb('0x17')][_0xc9fb('0x18')](_0x22f59e[_0xc9fb('0x19')],{'raw':_0x22f59e[_0xc9fb('0x1a')]?_0x22f59e[_0xc9fb('0x1a')][_0xc9fb('0x1b')]===undefined?!![]:![]:!![]})[_0xc9fb('0xa')](function(_0x372a19){logger[_0xc9fb('0xb')]('CreateSquareReport',_0x22f59e);logger[_0xc9fb('0xd')](_0xc9fb('0x16'),_0x22f59e,JSON[_0xc9fb('0xf')](_0x372a19));_0x4f0513(_0x372a19);})['catch'](function(_0xfbc542){logger[_0xc9fb('0x10')]('CreateSquareReport',_0xfbc542[_0xc9fb('0x13')],_0x22f59e);_0x5cd5fb(_0x2952a7['error'](0x1f4,_0xfbc542[_0xc9fb('0x13')]));});});};exports[_0xc9fb('0x1c')]=function(_0x188734){var _0x508c79=this;return new Promise(function(_0x55fd40,_0x2e1dd2){return db[_0xc9fb('0x17')][_0xc9fb('0x1d')](_0x188734[_0xc9fb('0x19')],{'raw':_0x188734[_0xc9fb('0x1a')]?_0x188734['options'][_0xc9fb('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x188734['options']?_0x188734[_0xc9fb('0x1a')][_0xc9fb('0x1e')]||null:null,'attributes':_0x188734[_0xc9fb('0x1a')]?_0x188734[_0xc9fb('0x1a')]['attributes']||null:null,'limit':_0x188734['options']?_0x188734[_0xc9fb('0x1a')][_0xc9fb('0x1f')]||null:null})[_0xc9fb('0xa')](function(_0x5a627c){logger[_0xc9fb('0xb')](_0xc9fb('0x1c'),_0x188734);logger['debug'](_0xc9fb('0x1c'),_0x188734,JSON['stringify'](_0x5a627c));_0x55fd40(_0x5a627c);})[_0xc9fb('0x15')](function(_0x50c80f){logger[_0xc9fb('0x10')](_0xc9fb('0x1c'),_0x50c80f['message'],_0x188734);_0x2e1dd2(_0x508c79['error'](0x1f4,_0x50c80f[_0xc9fb('0x13')]));});});}; \ No newline at end of file +var _0x620b=['SquareReport,\x20%s,\x20%s','result','catch','SquareReport','create','body','options','CreateSquareReport','stringify','UpdateSquareReport','where','attributes','limit','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x5cf102,_0x3e000d){var _0x44913a=function(_0x77ed83){while(--_0x77ed83){_0x5cf102['push'](_0x5cf102['shift']());}};_0x44913a(++_0x3e000d);}(_0x620b,0x1b1));var _0xb620=function(_0x4ff928,_0x221965){_0x4ff928=_0x4ff928-0x0;var _0x505fb1=_0x620b[_0x4ff928];return _0x505fb1;};'use strict';var _=require(_0xb620('0x0'));var util=require('util');var moment=require(_0xb620('0x1'));var BPromise=require(_0xb620('0x2'));var rs=require(_0xb620('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb620('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb620('0x5'))(_0xb620('0x6'));var config=require(_0xb620('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb620('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x523f47,_0x311432,_0x475f93){return new BPromise(function(_0x374a31,_0x39a40e){return client[_0xb620('0x9')](_0x523f47,_0x475f93)[_0xb620('0xa')](function(_0x108bee){logger[_0xb620('0xb')]('SquareReport,\x20%s,\x20%s',_0x311432,_0xb620('0xc'));logger[_0xb620('0xd')](_0xb620('0xe'),_0x311432,_0xb620('0xc'),JSON['stringify'](_0x108bee));if(_0x108bee[_0xb620('0xf')]){if(_0x108bee[_0xb620('0xf')]['code']===0x1f4){logger['error']('SquareReport,\x20%s,\x20%s',_0x311432,_0x108bee['error'][_0xb620('0x10')]);return _0x39a40e(_0x108bee[_0xb620('0xf')][_0xb620('0x10')]);}logger['error'](_0xb620('0x11'),_0x311432,_0x108bee[_0xb620('0xf')][_0xb620('0x10')]);return _0x374a31(_0x108bee['error']['message']);}else{logger[_0xb620('0xb')](_0xb620('0x11'),_0x311432,'request\x20sent');_0x374a31(_0x108bee[_0xb620('0x12')]['message']);}})[_0xb620('0x13')](function(_0x3f61a3){logger[_0xb620('0xf')](_0xb620('0x11'),_0x311432,_0x3f61a3);_0x39a40e(_0x3f61a3);});});}exports['CreateSquareReport']=function(_0x5a3852){var _0x29bcf0=this;return new Promise(function(_0x51372f,_0x5162e5){return db[_0xb620('0x14')][_0xb620('0x15')](_0x5a3852[_0xb620('0x16')],{'raw':_0x5a3852[_0xb620('0x17')]?_0x5a3852[_0xb620('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xb620('0xa')](function(_0x4bbdb7){logger[_0xb620('0xb')]('CreateSquareReport',_0x5a3852);logger[_0xb620('0xd')](_0xb620('0x18'),_0x5a3852,JSON[_0xb620('0x19')](_0x4bbdb7));_0x51372f(_0x4bbdb7);})[_0xb620('0x13')](function(_0xd49c23){logger['error']('CreateSquareReport',_0xd49c23[_0xb620('0x10')],_0x5a3852);_0x5162e5(_0x29bcf0[_0xb620('0xf')](0x1f4,_0xd49c23[_0xb620('0x10')]));});});};exports[_0xb620('0x1a')]=function(_0x3d462e){var _0x7058f7=this;return new Promise(function(_0x301e59,_0x104ab7){return db[_0xb620('0x14')]['update'](_0x3d462e[_0xb620('0x16')],{'raw':_0x3d462e[_0xb620('0x17')]?_0x3d462e[_0xb620('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d462e[_0xb620('0x17')]?_0x3d462e[_0xb620('0x17')][_0xb620('0x1b')]||null:null,'attributes':_0x3d462e[_0xb620('0x17')]?_0x3d462e[_0xb620('0x17')][_0xb620('0x1c')]||null:null,'limit':_0x3d462e[_0xb620('0x17')]?_0x3d462e[_0xb620('0x17')][_0xb620('0x1d')]||null:null})['then'](function(_0x327aaa){logger[_0xb620('0xb')](_0xb620('0x1a'),_0x3d462e);logger[_0xb620('0xd')]('UpdateSquareReport',_0x3d462e,JSON[_0xb620('0x19')](_0x327aaa));_0x301e59(_0x327aaa);})['catch'](function(_0x17dbdb){logger[_0xb620('0xf')](_0xb620('0x1a'),_0x17dbdb[_0xb620('0x10')],_0x3d462e);_0x104ab7(_0x7058f7[_0xb620('0xf')](0x1f4,_0x17dbdb[_0xb620('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 6f89dea..62b85ab 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 _0xcf50=['../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','show','/:id','update','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1ea7f4,_0x22600c){var _0x3122e5=function(_0x42862a){while(--_0x42862a){_0x1ea7f4['push'](_0x1ea7f4['shift']());}};_0x3122e5(++_0x22600c);}(_0xcf50,0xb7));var _0x0cf5=function(_0x25c418,_0x8d97d1){_0x25c418=_0x25c418-0x0;var _0x306021=_0xcf50[_0x25c418];return _0x306021;};'use strict';var multer=require(_0x0cf5('0x0'));var util=require(_0x0cf5('0x1'));var path=require(_0x0cf5('0x2'));var timeout=require('connect-timeout');var express=require(_0x0cf5('0x3'));var router=express[_0x0cf5('0x4')]();var fs_extra=require(_0x0cf5('0x5'));var auth=require(_0x0cf5('0x6'));var interaction=require(_0x0cf5('0x7'));var config=require(_0x0cf5('0x8'));var controller=require(_0x0cf5('0x9'));router[_0x0cf5('0xa')]('/',auth[_0x0cf5('0xb')](),controller[_0x0cf5('0xc')]);router[_0x0cf5('0xa')](_0x0cf5('0xd'),auth[_0x0cf5('0xb')](),controller[_0x0cf5('0xe')]);router[_0x0cf5('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0cf5('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x0cf5('0x10'),auth['isAuthenticated'](),controller[_0x0cf5('0x11')]);router[_0x0cf5('0x12')](_0x0cf5('0x10'),auth[_0x0cf5('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5d77=['update','delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','index','show','put'];(function(_0x12ab7e,_0x435244){var _0xf9de20=function(_0x480b56){while(--_0x480b56){_0x12ab7e['push'](_0x12ab7e['shift']());}};_0xf9de20(++_0x435244);}(_0x5d77,0x193));var _0x75d7=function(_0x18949e,_0x5b4d53){_0x18949e=_0x18949e-0x0;var _0x2dbab3=_0x5d77[_0x18949e];return _0x2dbab3;};'use strict';var multer=require(_0x75d7('0x0'));var util=require(_0x75d7('0x1'));var path=require(_0x75d7('0x2'));var timeout=require(_0x75d7('0x3'));var express=require(_0x75d7('0x4'));var router=express[_0x75d7('0x5')]();var fs_extra=require(_0x75d7('0x6'));var auth=require(_0x75d7('0x7'));var interaction=require(_0x75d7('0x8'));var config=require('../../config/environment');var controller=require(_0x75d7('0x9'));router[_0x75d7('0xa')]('/',auth[_0x75d7('0xb')](),controller[_0x75d7('0xc')]);router[_0x75d7('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x75d7('0xa')]('/:id',auth[_0x75d7('0xb')](),controller[_0x75d7('0xd')]);router['post']('/',auth[_0x75d7('0xb')](),controller['create']);router[_0x75d7('0xe')]('/:id',auth[_0x75d7('0xb')](),controller[_0x75d7('0xf')]);router[_0x75d7('0x10')](_0x75d7('0x11'),auth[_0x75d7('0xb')](),controller[_0x75d7('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index f692533..ed0279f 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 _0xe373=['sequelize','exports','STRING','TEXT'];(function(_0x4093dd,_0x170029){var _0x244c50=function(_0xef709b){while(--_0xef709b){_0x4093dd['push'](_0x4093dd['shift']());}};_0x244c50(++_0x170029);}(_0xe373,0x11c));var _0x3e37=function(_0x50bd5a,_0x306368){_0x50bd5a=_0x50bd5a-0x0;var _0x30755e=_0xe373[_0x50bd5a];return _0x30755e;};'use strict';var Sequelize=require(_0x3e37('0x0'));module[_0x3e37('0x1')]={'uniqueid':{'type':Sequelize[_0x3e37('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x3e37('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x3e37('0x2')]}}; \ No newline at end of file +var _0xa4b3=['sequelize','STRING','TEXT'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xa4b3,0xc9));var _0x3a4b=function(_0x3bd447,_0xe66643){_0x3bd447=_0x3bd447-0x0;var _0x51740c=_0xa4b3[_0x3bd447];return _0x51740c;};'use strict';var Sequelize=require(_0x3a4b('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x3a4b('0x1')]},'node':{'type':Sequelize[_0x3a4b('0x1')]},'application':{'type':Sequelize[_0x3a4b('0x1')]},'data':{'type':Sequelize[_0x3a4b('0x2')]},'project_name':{'type':Sequelize[_0x3a4b('0x1')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 20f3640..a6ca727 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 _0xf55c=['show','params','keys','find','body','catch','update','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','reject','save','then','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','SquareDetailsReport','includeAll','include','findAll','rows'];(function(_0x55778f,_0x2b0806){var _0x6136fe=function(_0x29e248){while(--_0x29e248){_0x55778f['push'](_0x55778f['shift']());}};_0x6136fe(++_0x2b0806);}(_0xf55c,0x1cb));var _0xcf55=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xf55c[_0x5b561d];return _0x431060;};'use strict';var emlformat=require(_0xcf55('0x0'));var rimraf=require(_0xcf55('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcf55('0x2'));var rp=require(_0xcf55('0x3'));var moment=require(_0xcf55('0x4'));var BPromise=require(_0xcf55('0x5'));var Mustache=require(_0xcf55('0x6'));var util=require(_0xcf55('0x7'));var path=require(_0xcf55('0x8'));var sox=require(_0xcf55('0x9'));var csv=require('to-csv');var ejs=require(_0xcf55('0xa'));var fs=require('fs');var fs_extra=require(_0xcf55('0xb'));var _=require(_0xcf55('0xc'));var squel=require(_0xcf55('0xd'));var crypto=require(_0xcf55('0xe'));var jsforce=require(_0xcf55('0xf'));var deskjs=require(_0xcf55('0x10'));var toCsv=require('to-csv');var querystring=require(_0xcf55('0x11'));var Papa=require(_0xcf55('0x12'));var Redis=require(_0xcf55('0x13'));var authService=require(_0xcf55('0x14'));var qs=require(_0xcf55('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xcf55('0x16'));var config=require(_0xcf55('0x17'));var licenseUtil=require(_0xcf55('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b3f3b,_0x57d920){_0x57d920=_0x57d920||0xcc;return function(_0x15642c){if(_0x15642c){return _0x1b3f3b[_0xcf55('0x19')](_0x57d920);}return _0x1b3f3b[_0xcf55('0x1a')](_0x57d920)['end']();};}function respondWithResult(_0x4d27c5,_0x1f0659){_0x1f0659=_0x1f0659||0xc8;return function(_0x222823){if(_0x222823){return _0x4d27c5[_0xcf55('0x1a')](_0x1f0659)[_0xcf55('0x1b')](_0x222823);}};}function respondWithFilteredResult(_0x5da4a5,_0x5dd243){return function(_0x2d04de){if(_0x2d04de){var _0x44426d=typeof _0x5dd243['offset']===_0xcf55('0x1c')&&typeof _0x5dd243[_0xcf55('0x1d')]===_0xcf55('0x1c');var _0x2ae025=_0x2d04de[_0xcf55('0x1e')];var _0x48de99=_0x44426d?0x0:_0x5dd243[_0xcf55('0x1f')];var _0x52bd3c=_0x44426d?_0x2d04de[_0xcf55('0x1e')]:_0x5dd243['offset']+_0x5dd243[_0xcf55('0x1d')];var _0x6ded73;if(_0x52bd3c>=_0x2ae025){_0x52bd3c=_0x2ae025;_0x6ded73=0xc8;}else{_0x6ded73=0xce;}_0x5da4a5['status'](_0x6ded73);return _0x5da4a5['set']('Content-Range',_0x48de99+'-'+_0x52bd3c+'/'+_0x2ae025)[_0xcf55('0x1b')](_0x2d04de);}return null;};}function patchUpdates(_0x5e2f01){return function(_0x33bcbc){try{jsonpatch['apply'](_0x33bcbc,_0x5e2f01,!![]);}catch(_0x16ec6b){return BPromise[_0xcf55('0x20')](_0x16ec6b);}return _0x33bcbc[_0xcf55('0x21')]();};}function saveUpdates(_0x34df1a,_0x18477a){return function(_0x1235f4){if(_0x1235f4){return _0x1235f4['update'](_0x34df1a)[_0xcf55('0x22')](function(_0x495938){return _0x495938;});}return null;};}function removeEntity(_0xe049b3,_0x2289b3){return function(_0x501476){if(_0x501476){return _0x501476['destroy']()['then'](function(){_0xe049b3['status'](0xcc)[_0xcf55('0x23')]();});}};}function handleEntityNotFound(_0x37b2e5,_0x5f58cb){return function(_0x3d2e7c){if(!_0x3d2e7c){_0x37b2e5[_0xcf55('0x19')](0x194);}return _0x3d2e7c;};}function handleError(_0x23f01f,_0x1e37b1){_0x1e37b1=_0x1e37b1||0x1f4;return function(_0x65b996){logger[_0xcf55('0x24')](_0x65b996['stack']);if(_0x65b996[_0xcf55('0x25')]){delete _0x65b996[_0xcf55('0x25')];}_0x23f01f[_0xcf55('0x1a')](_0x1e37b1)[_0xcf55('0x26')](_0x65b996);};}exports[_0xcf55('0x27')]=function(_0x281d47,_0x5dbd8c){var _0x3a0d19={},_0x3ec165={},_0x2aba63={'count':0x0,'rows':[]};var _0x551fc0=_[_0xcf55('0x28')](db['SquareDetailsReport'][_0xcf55('0x29')],function(_0x5c8c26){return{'name':_0x5c8c26[_0xcf55('0x2a')],'type':_0x5c8c26[_0xcf55('0x2b')][_0xcf55('0x2c')]};});_0x3ec165[_0xcf55('0x2d')]=_[_0xcf55('0x28')](_0x551fc0,_0xcf55('0x25'));_0x3ec165[_0xcf55('0x2e')]=_['keys'](_0x281d47['query']);_0x3ec165['filters']=_['intersection'](_0x3ec165[_0xcf55('0x2d')],_0x3ec165['query']);_0x3a0d19[_0xcf55('0x2f')]=_[_0xcf55('0x30')](_0x3ec165[_0xcf55('0x2d')],qs[_0xcf55('0x31')](_0x281d47[_0xcf55('0x2e')]['fields']));_0x3a0d19[_0xcf55('0x2f')]=_0x3a0d19[_0xcf55('0x2f')][_0xcf55('0x32')]?_0x3a0d19['attributes']:_0x3ec165['model'];if(!_0x281d47[_0xcf55('0x2e')][_0xcf55('0x33')]('nolimit')){_0x3a0d19[_0xcf55('0x1d')]=qs[_0xcf55('0x1d')](_0x281d47['query']['limit']);_0x3a0d19[_0xcf55('0x1f')]=qs['offset'](_0x281d47[_0xcf55('0x2e')][_0xcf55('0x1f')]);}_0x3a0d19[_0xcf55('0x34')]=qs[_0xcf55('0x35')](_0x281d47[_0xcf55('0x2e')][_0xcf55('0x35')]);_0x3a0d19[_0xcf55('0x36')]=qs['filters'](_[_0xcf55('0x37')](_0x281d47['query'],_0x3ec165[_0xcf55('0x38')]),_0x551fc0);if(_0x281d47[_0xcf55('0x2e')][_0xcf55('0x39')]){_0x3a0d19[_0xcf55('0x36')]=_['merge'](_0x3a0d19[_0xcf55('0x36')],{'$or':_['map'](_0x551fc0,function(_0x39bd64){if(_0x39bd64['type']!==_0xcf55('0x3a')){var _0x259b7d={};_0x259b7d[_0x39bd64['name']]={'$like':'%'+_0x281d47[_0xcf55('0x2e')][_0xcf55('0x39')]+'%'};return _0x259b7d;}})});}_0x3a0d19=_[_0xcf55('0x3b')]({},_0x3a0d19,_0x281d47[_0xcf55('0x3c')]);var _0x22fa13={'where':_0x3a0d19[_0xcf55('0x36')]};return db[_0xcf55('0x3d')]['count'](_0x22fa13)[_0xcf55('0x22')](function(_0x40e265){_0x2aba63[_0xcf55('0x1e')]=_0x40e265;if(_0x281d47['query'][_0xcf55('0x3e')]){_0x3a0d19[_0xcf55('0x3f')]=[{'all':!![]}];}return db[_0xcf55('0x3d')][_0xcf55('0x40')](_0x3a0d19);})[_0xcf55('0x22')](function(_0x41814b){_0x2aba63[_0xcf55('0x41')]=_0x41814b;return _0x2aba63;})[_0xcf55('0x22')](respondWithFilteredResult(_0x5dbd8c,_0x3a0d19))['catch'](handleError(_0x5dbd8c,null));};exports[_0xcf55('0x42')]=function(_0x517cf5,_0x5b9444){var _0x34cce2={'raw':!![],'where':{'id':_0x517cf5[_0xcf55('0x43')]['id']}},_0x453592={};_0x453592['model']=_['keys'](db[_0xcf55('0x3d')][_0xcf55('0x29')]);_0x453592[_0xcf55('0x2e')]=_[_0xcf55('0x44')](_0x517cf5[_0xcf55('0x2e')]);_0x453592[_0xcf55('0x38')]=_[_0xcf55('0x30')](_0x453592[_0xcf55('0x2d')],_0x453592[_0xcf55('0x2e')]);_0x34cce2['attributes']=_[_0xcf55('0x30')](_0x453592[_0xcf55('0x2d')],qs[_0xcf55('0x31')](_0x517cf5[_0xcf55('0x2e')][_0xcf55('0x31')]));_0x34cce2[_0xcf55('0x2f')]=_0x34cce2[_0xcf55('0x2f')][_0xcf55('0x32')]?_0x34cce2[_0xcf55('0x2f')]:_0x453592[_0xcf55('0x2d')];if(_0x517cf5['query'][_0xcf55('0x3e')]){_0x34cce2['include']=[{'all':!![]}];}_0x34cce2=_['merge']({},_0x34cce2,_0x517cf5[_0xcf55('0x3c')]);return db[_0xcf55('0x3d')][_0xcf55('0x45')](_0x34cce2)[_0xcf55('0x22')](handleEntityNotFound(_0x5b9444,null))[_0xcf55('0x22')](respondWithResult(_0x5b9444,null))['catch'](handleError(_0x5b9444,null));};exports['create']=function(_0x110202,_0x400cf1){return db[_0xcf55('0x3d')]['create'](_0x110202[_0xcf55('0x46')],{})[_0xcf55('0x22')](respondWithResult(_0x400cf1,0xc9))[_0xcf55('0x47')](handleError(_0x400cf1,null));};exports[_0xcf55('0x48')]=function(_0x2a8d9d,_0x104cbd){if(_0x2a8d9d['body']['id']){delete _0x2a8d9d['body']['id'];}return db['SquareDetailsReport'][_0xcf55('0x45')]({'where':{'id':_0x2a8d9d['params']['id']}})[_0xcf55('0x22')](handleEntityNotFound(_0x104cbd,null))[_0xcf55('0x22')](saveUpdates(_0x2a8d9d['body'],null))['then'](respondWithResult(_0x104cbd,null))[_0xcf55('0x47')](handleError(_0x104cbd,null));};exports[_0xcf55('0x49')]=function(_0x3c7769,_0x3a8d35){return db[_0xcf55('0x3d')][_0xcf55('0x45')]({'where':{'id':_0x3c7769[_0xcf55('0x43')]['id']}})[_0xcf55('0x22')](handleEntityNotFound(_0x3a8d35,null))[_0xcf55('0x22')](removeEntity(_0x3a8d35,null))['catch'](handleError(_0x3a8d35,null));};exports[_0xcf55('0x4a')]=function(_0x54d9d9,_0x13d765){return db[_0xcf55('0x3d')]['describe']()[_0xcf55('0x22')](respondWithResult(_0x13d765,null))['catch'](handleError(_0x13d765,null));}; \ No newline at end of file +var _0x32b9=['filter','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','reject','then','destroy','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters'];(function(_0x4f4902,_0x2de251){var _0x3f350a=function(_0x5bf866){while(--_0x5bf866){_0x4f4902['push'](_0x4f4902['shift']());}};_0x3f350a(++_0x2de251);}(_0x32b9,0xf0));var _0x932b=function(_0x4c9fb3,_0x70c50d){_0x4c9fb3=_0x4c9fb3-0x0;var _0x5e7b18=_0x32b9[_0x4c9fb3];return _0x5e7b18;};'use strict';var emlformat=require(_0x932b('0x0'));var rimraf=require(_0x932b('0x1'));var zipdir=require(_0x932b('0x2'));var jsonpatch=require(_0x932b('0x3'));var rp=require(_0x932b('0x4'));var moment=require(_0x932b('0x5'));var BPromise=require(_0x932b('0x6'));var Mustache=require(_0x932b('0x7'));var util=require('util');var path=require(_0x932b('0x8'));var sox=require('sox');var csv=require(_0x932b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x932b('0xa'));var _=require('lodash');var squel=require(_0x932b('0xb'));var crypto=require('crypto');var jsforce=require(_0x932b('0xc'));var deskjs=require(_0x932b('0xd'));var toCsv=require(_0x932b('0x9'));var querystring=require('querystring');var Papa=require(_0x932b('0xe'));var Redis=require('ioredis');var authService=require(_0x932b('0xf'));var qs=require(_0x932b('0x10'));var as=require(_0x932b('0x11'));var hardwareService=require(_0x932b('0x12'));var logger=require(_0x932b('0x13'))(_0x932b('0x14'));var utils=require('../../config/utils');var config=require(_0x932b('0x15'));var licenseUtil=require(_0x932b('0x16'));var db=require(_0x932b('0x17'))['db'];function respondWithStatusCode(_0x129f0a,_0x19a35f){_0x19a35f=_0x19a35f||0xcc;return function(_0x20e1b0){if(_0x20e1b0){return _0x129f0a[_0x932b('0x18')](_0x19a35f);}return _0x129f0a['status'](_0x19a35f)[_0x932b('0x19')]();};}function respondWithResult(_0x5324c4,_0x87aad2){_0x87aad2=_0x87aad2||0xc8;return function(_0x39c487){if(_0x39c487){return _0x5324c4[_0x932b('0x1a')](_0x87aad2)['json'](_0x39c487);}};}function respondWithFilteredResult(_0x3c3bd7,_0x3ee266){return function(_0xcd6cfd){if(_0xcd6cfd){var _0x31567b=typeof _0x3ee266[_0x932b('0x1b')]===_0x932b('0x1c')&&typeof _0x3ee266['limit']==='undefined';var _0x241458=_0xcd6cfd['count'];var _0x45cc0a=_0x31567b?0x0:_0x3ee266[_0x932b('0x1b')];var _0x50a942=_0x31567b?_0xcd6cfd[_0x932b('0x1d')]:_0x3ee266[_0x932b('0x1b')]+_0x3ee266[_0x932b('0x1e')];var _0x78a394;if(_0x50a942>=_0x241458){_0x50a942=_0x241458;_0x78a394=0xc8;}else{_0x78a394=0xce;}_0x3c3bd7[_0x932b('0x1a')](_0x78a394);return _0x3c3bd7[_0x932b('0x1f')](_0x932b('0x20'),_0x45cc0a+'-'+_0x50a942+'/'+_0x241458)[_0x932b('0x21')](_0xcd6cfd);}return null;};}function patchUpdates(_0x1d61d0){return function(_0x1729c1){try{jsonpatch['apply'](_0x1729c1,_0x1d61d0,!![]);}catch(_0x1e555d){return BPromise[_0x932b('0x22')](_0x1e555d);}return _0x1729c1['save']();};}function saveUpdates(_0x427462,_0x100478){return function(_0xa192f4){if(_0xa192f4){return _0xa192f4['update'](_0x427462)[_0x932b('0x23')](function(_0x16aca3){return _0x16aca3;});}return null;};}function removeEntity(_0x3acd61,_0x11d49d){return function(_0x1c3053){if(_0x1c3053){return _0x1c3053[_0x932b('0x24')]()['then'](function(){_0x3acd61[_0x932b('0x1a')](0xcc)[_0x932b('0x19')]();});}};}function handleEntityNotFound(_0x222054,_0x155458){return function(_0x38d07c){if(!_0x38d07c){_0x222054[_0x932b('0x18')](0x194);}return _0x38d07c;};}function handleError(_0x3b44db,_0x429f70){_0x429f70=_0x429f70||0x1f4;return function(_0x3c90ec){logger[_0x932b('0x25')](_0x3c90ec[_0x932b('0x26')]);if(_0x3c90ec[_0x932b('0x27')]){delete _0x3c90ec[_0x932b('0x27')];}_0x3b44db[_0x932b('0x1a')](_0x429f70)[_0x932b('0x28')](_0x3c90ec);};}exports[_0x932b('0x29')]=function(_0x5ce232,_0x4aa1bc){var _0x52a0d3={},_0x5da376={},_0x4231c2={'count':0x0,'rows':[]};var _0x3cfadb=_[_0x932b('0x2a')](db[_0x932b('0x2b')][_0x932b('0x2c')],function(_0x25f2e6){return{'name':_0x25f2e6[_0x932b('0x2d')],'type':_0x25f2e6[_0x932b('0x2e')][_0x932b('0x2f')]};});_0x5da376[_0x932b('0x30')]=_[_0x932b('0x2a')](_0x3cfadb,_0x932b('0x27'));_0x5da376[_0x932b('0x31')]=_['keys'](_0x5ce232[_0x932b('0x31')]);_0x5da376['filters']=_[_0x932b('0x32')](_0x5da376['model'],_0x5da376[_0x932b('0x31')]);_0x52a0d3[_0x932b('0x33')]=_['intersection'](_0x5da376['model'],qs[_0x932b('0x34')](_0x5ce232[_0x932b('0x31')][_0x932b('0x34')]));_0x52a0d3[_0x932b('0x33')]=_0x52a0d3[_0x932b('0x33')]['length']?_0x52a0d3[_0x932b('0x33')]:_0x5da376[_0x932b('0x30')];if(!_0x5ce232['query'][_0x932b('0x35')](_0x932b('0x36'))){_0x52a0d3[_0x932b('0x1e')]=qs['limit'](_0x5ce232[_0x932b('0x31')][_0x932b('0x1e')]);_0x52a0d3['offset']=qs[_0x932b('0x1b')](_0x5ce232[_0x932b('0x31')][_0x932b('0x1b')]);}_0x52a0d3[_0x932b('0x37')]=qs[_0x932b('0x38')](_0x5ce232[_0x932b('0x31')]['sort']);_0x52a0d3[_0x932b('0x39')]=qs['filters'](_[_0x932b('0x3a')](_0x5ce232[_0x932b('0x31')],_0x5da376[_0x932b('0x3b')]),_0x3cfadb);if(_0x5ce232[_0x932b('0x31')][_0x932b('0x3c')]){_0x52a0d3[_0x932b('0x39')]=_['merge'](_0x52a0d3['where'],{'$or':_[_0x932b('0x2a')](_0x3cfadb,function(_0x44352f){if(_0x44352f[_0x932b('0x2e')]!=='VIRTUAL'){var _0x4384d0={};_0x4384d0[_0x44352f[_0x932b('0x27')]]={'$like':'%'+_0x5ce232['query'][_0x932b('0x3c')]+'%'};return _0x4384d0;}})});}_0x52a0d3=_[_0x932b('0x3d')]({},_0x52a0d3,_0x5ce232[_0x932b('0x3e')]);var _0x34920f={'where':_0x52a0d3[_0x932b('0x39')]};return db[_0x932b('0x2b')]['count'](_0x34920f)[_0x932b('0x23')](function(_0x2635a5){_0x4231c2[_0x932b('0x1d')]=_0x2635a5;if(_0x5ce232[_0x932b('0x31')][_0x932b('0x3f')]){_0x52a0d3[_0x932b('0x40')]=[{'all':!![]}];}return db[_0x932b('0x2b')][_0x932b('0x41')](_0x52a0d3);})[_0x932b('0x23')](function(_0xc1c0a6){_0x4231c2[_0x932b('0x42')]=_0xc1c0a6;return _0x4231c2;})['then'](respondWithFilteredResult(_0x4aa1bc,_0x52a0d3))['catch'](handleError(_0x4aa1bc,null));};exports[_0x932b('0x43')]=function(_0x87f007,_0x3019a6){var _0x4a4081={'raw':!![],'where':{'id':_0x87f007[_0x932b('0x44')]['id']}},_0x3cf4b4={};_0x3cf4b4['model']=_[_0x932b('0x45')](db[_0x932b('0x2b')]['rawAttributes']);_0x3cf4b4[_0x932b('0x31')]=_[_0x932b('0x45')](_0x87f007[_0x932b('0x31')]);_0x3cf4b4[_0x932b('0x3b')]=_[_0x932b('0x32')](_0x3cf4b4[_0x932b('0x30')],_0x3cf4b4['query']);_0x4a4081[_0x932b('0x33')]=_[_0x932b('0x32')](_0x3cf4b4[_0x932b('0x30')],qs['fields'](_0x87f007[_0x932b('0x31')][_0x932b('0x34')]));_0x4a4081['attributes']=_0x4a4081[_0x932b('0x33')]['length']?_0x4a4081[_0x932b('0x33')]:_0x3cf4b4[_0x932b('0x30')];if(_0x87f007[_0x932b('0x31')]['includeAll']){_0x4a4081[_0x932b('0x40')]=[{'all':!![]}];}_0x4a4081=_[_0x932b('0x3d')]({},_0x4a4081,_0x87f007[_0x932b('0x3e')]);return db['SquareDetailsReport'][_0x932b('0x46')](_0x4a4081)['then'](handleEntityNotFound(_0x3019a6,null))[_0x932b('0x23')](respondWithResult(_0x3019a6,null))[_0x932b('0x47')](handleError(_0x3019a6,null));};exports[_0x932b('0x48')]=function(_0x5e878a,_0x254b0f){return db[_0x932b('0x2b')]['create'](_0x5e878a['body'],{})[_0x932b('0x23')](respondWithResult(_0x254b0f,0xc9))[_0x932b('0x47')](handleError(_0x254b0f,null));};exports['update']=function(_0x562ce8,_0x9821f0){if(_0x562ce8[_0x932b('0x49')]['id']){delete _0x562ce8[_0x932b('0x49')]['id'];}return db[_0x932b('0x2b')][_0x932b('0x46')]({'where':{'id':_0x562ce8['params']['id']}})[_0x932b('0x23')](handleEntityNotFound(_0x9821f0,null))['then'](saveUpdates(_0x562ce8[_0x932b('0x49')],null))['then'](respondWithResult(_0x9821f0,null))[_0x932b('0x47')](handleError(_0x9821f0,null));};exports[_0x932b('0x24')]=function(_0x4266dc,_0x4a265f){return db[_0x932b('0x2b')][_0x932b('0x46')]({'where':{'id':_0x4266dc['params']['id']}})[_0x932b('0x23')](handleEntityNotFound(_0x4a265f,null))['then'](removeEntity(_0x4a265f,null))['catch'](handleError(_0x4a265f,null));};exports[_0x932b('0x4a')]=function(_0xc54488,_0x492997){return db[_0x932b('0x2b')][_0x932b('0x4a')]()[_0x932b('0x23')](respondWithResult(_0x492997,null))[_0x932b('0x47')](handleError(_0x492997,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index cea7dd6..1fece9c 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 _0x131d=['exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','moment','bluebird','rimraf','./squareReportDetail.attributes'];(function(_0x571f33,_0xb751b5){var _0x187a30=function(_0xc53323){while(--_0xc53323){_0x571f33['push'](_0x571f33['shift']());}};_0x187a30(++_0xb751b5);}(_0x131d,0x88));var _0xd131=function(_0x3e3ba0,_0x5c3afd){_0x3e3ba0=_0x3e3ba0-0x0;var _0x18281b=_0x131d[_0x3e3ba0];return _0x18281b;};'use strict';var _=require(_0xd131('0x0'));var util=require(_0xd131('0x1'));var logger=require(_0xd131('0x2'))('api');var moment=require(_0xd131('0x3'));var BPromise=require(_0xd131('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd131('0x5'));var config=require('../../config/environment');var attributes=require(_0xd131('0x6'));module[_0xd131('0x7')]=function(_0xe4a69a,_0x2217cd){return _0xe4a69a[_0xd131('0x8')](_0xd131('0x9'),attributes,{'tableName':_0xd131('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c32=['./squareReportDetail.attributes','define','report_square_details','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9c32,0x163));var _0x29c3=function(_0x1cf53d,_0xdb8608){_0x1cf53d=_0x1cf53d-0x0;var _0x47bb91=_0x9c32[_0x1cf53d];return _0x47bb91;};'use strict';var _=require(_0x29c3('0x0'));var util=require(_0x29c3('0x1'));var logger=require(_0x29c3('0x2'))(_0x29c3('0x3'));var moment=require(_0x29c3('0x4'));var BPromise=require('bluebird');var rp=require(_0x29c3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x29c3('0x6'));var config=require(_0x29c3('0x7'));var attributes=require(_0x29c3('0x8'));module['exports']=function(_0x14c9ec,_0x2e8a14){return _0x14c9ec[_0x29c3('0x9')]('SquareDetailsReport',attributes,{'tableName':_0x29c3('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 cc663d8..9413519 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 _0xcecc=['SquareDetailsReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','SquareDetailsReport','create','body','options','raw','CreateSquareDetailsReport','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info'];(function(_0x1865cb,_0x2558fc){var _0x27db59=function(_0x4030f5){while(--_0x4030f5){_0x1865cb['push'](_0x1865cb['shift']());}};_0x27db59(++_0x2558fc);}(_0xcecc,0x186));var _0xccec=function(_0x1ff338,_0x4713a3){_0x1ff338=_0x1ff338-0x0;var _0x4a39f6=_0xcecc[_0x1ff338];return _0x4a39f6;};'use strict';var _=require(_0xccec('0x0'));var util=require('util');var moment=require(_0xccec('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xccec('0x2'));var db=require(_0xccec('0x3'))['db'];var utils=require(_0xccec('0x4'));var logger=require(_0xccec('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xccec('0x6'));var client=jayson['client'][_0xccec('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x44ed01,_0x2a66e5,_0x5788aa){return new BPromise(function(_0x372ea6,_0x3d7b1a){return client['request'](_0x44ed01,_0x5788aa)[_0xccec('0x8')](function(_0xbbf504){logger[_0xccec('0x9')](_0xccec('0xa'),_0x2a66e5,'request\x20sent');logger[_0xccec('0xb')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x2a66e5,_0xccec('0xc'),JSON[_0xccec('0xd')](_0xbbf504));if(_0xbbf504['error']){if(_0xbbf504[_0xccec('0xe')][_0xccec('0xf')]===0x1f4){logger[_0xccec('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x2a66e5,_0xbbf504[_0xccec('0xe')][_0xccec('0x10')]);return _0x3d7b1a(_0xbbf504[_0xccec('0xe')][_0xccec('0x10')]);}logger[_0xccec('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x2a66e5,_0xbbf504[_0xccec('0xe')]['message']);return _0x372ea6(_0xbbf504['error']['message']);}else{logger[_0xccec('0x9')](_0xccec('0xa'),_0x2a66e5,_0xccec('0xc'));_0x372ea6(_0xbbf504[_0xccec('0x11')][_0xccec('0x10')]);}})[_0xccec('0x12')](function(_0x7abe38){logger[_0xccec('0xe')](_0xccec('0xa'),_0x2a66e5,_0x7abe38);_0x3d7b1a(_0x7abe38);});});}exports['CreateSquareDetailsReport']=function(_0x518016){var _0x56b926=this;return new Promise(function(_0x970c66,_0x551d33){return db[_0xccec('0x13')][_0xccec('0x14')](_0x518016[_0xccec('0x15')],{'raw':_0x518016['options']?_0x518016[_0xccec('0x16')][_0xccec('0x17')]===undefined?!![]:![]:!![]})[_0xccec('0x8')](function(_0x4a7f08){logger[_0xccec('0x9')](_0xccec('0x18'),_0x518016);logger[_0xccec('0xb')]('CreateSquareDetailsReport',_0x518016,JSON[_0xccec('0xd')](_0x4a7f08));_0x970c66(_0x4a7f08);})['catch'](function(_0x9065a3){logger['error'](_0xccec('0x18'),_0x9065a3[_0xccec('0x10')],_0x518016);_0x551d33(_0x56b926[_0xccec('0xe')](0x1f4,_0x9065a3[_0xccec('0x10')]));});});}; \ No newline at end of file +var _0xd7a0=['SquareDetailsReport,\x20%s,\x20%s','catch','CreateSquareDetailsReport','options','raw','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xd7a0,0x163));var _0x0d7a=function(_0x348b5c,_0xfd43ac){_0x348b5c=_0x348b5c-0x0;var _0x301562=_0xd7a0[_0x348b5c];return _0x301562;};'use strict';var _=require(_0x0d7a('0x0'));var util=require(_0x0d7a('0x1'));var moment=require('moment');var BPromise=require(_0x0d7a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d7a('0x3'));var db=require(_0x0d7a('0x4'))['db'];var utils=require(_0x0d7a('0x5'));var logger=require(_0x0d7a('0x6'))(_0x0d7a('0x7'));var config=require('../../config/environment');var jayson=require(_0x0d7a('0x8'));var client=jayson[_0x0d7a('0x9')][_0x0d7a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16461e,_0x22b404,_0x371b7d){return new BPromise(function(_0x1514ae,_0x55d585){return client[_0x0d7a('0xb')](_0x16461e,_0x371b7d)[_0x0d7a('0xc')](function(_0x450d42){logger[_0x0d7a('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x22b404,_0x0d7a('0xe'));logger[_0x0d7a('0xf')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x22b404,_0x0d7a('0xe'),JSON[_0x0d7a('0x10')](_0x450d42));if(_0x450d42[_0x0d7a('0x11')]){if(_0x450d42[_0x0d7a('0x11')][_0x0d7a('0x12')]===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x22b404,_0x450d42[_0x0d7a('0x11')][_0x0d7a('0x13')]);return _0x55d585(_0x450d42[_0x0d7a('0x11')]['message']);}logger[_0x0d7a('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x22b404,_0x450d42['error'][_0x0d7a('0x13')]);return _0x1514ae(_0x450d42['error'][_0x0d7a('0x13')]);}else{logger[_0x0d7a('0xd')](_0x0d7a('0x14'),_0x22b404,_0x0d7a('0xe'));_0x1514ae(_0x450d42['result'][_0x0d7a('0x13')]);}})[_0x0d7a('0x15')](function(_0x497cbb){logger[_0x0d7a('0x11')](_0x0d7a('0x14'),_0x22b404,_0x497cbb);_0x55d585(_0x497cbb);});});}exports[_0x0d7a('0x16')]=function(_0x406b0c){var _0x5c54a6=this;return new Promise(function(_0x2180fa,_0x4cfcdc){return db['SquareDetailsReport']['create'](_0x406b0c['body'],{'raw':_0x406b0c[_0x0d7a('0x17')]?_0x406b0c['options'][_0x0d7a('0x18')]===undefined?!![]:![]:!![]})[_0x0d7a('0xc')](function(_0x4c997f){logger[_0x0d7a('0xd')](_0x0d7a('0x16'),_0x406b0c);logger[_0x0d7a('0xf')](_0x0d7a('0x16'),_0x406b0c,JSON['stringify'](_0x4c997f));_0x2180fa(_0x4c997f);})[_0x0d7a('0x15')](function(_0x2c11b6){logger[_0x0d7a('0x11')]('CreateSquareDetailsReport',_0x2c11b6['message'],_0x406b0c);_0x4cfcdc(_0x5c54a6[_0x0d7a('0x11')](0x1f4,_0x2c11b6[_0x0d7a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 780228f..d877871 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 _0xcb77=['get','isAuthenticated','index','/process/:pid/kill','killProcess','exports','Router','../../components/auth/service'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xcb77,0x186));var _0x7cb7=function(_0x277fa3,_0x3b2dde){_0x277fa3=_0x277fa3-0x0;var _0x2e4520=_0xcb77[_0x277fa3];return _0x2e4520;};'use strict';var express=require('express');var router=express[_0x7cb7('0x0')]();var auth=require(_0x7cb7('0x1'));var controller=require('./system.controller');router[_0x7cb7('0x2')]('/',auth[_0x7cb7('0x3')](),controller[_0x7cb7('0x4')]);router['get'](_0x7cb7('0x5'),auth[_0x7cb7('0x3')](),controller[_0x7cb7('0x6')]);module[_0x7cb7('0x7')]=router; \ No newline at end of file +var _0x5f0b=['isAuthenticated','killProcess','exports','express','Router','../../components/auth/service','get','index','/process/:pid/kill'];(function(_0x4a68ba,_0x32d2e7){var _0x11c5c5=function(_0x4a1cf6){while(--_0x4a1cf6){_0x4a68ba['push'](_0x4a68ba['shift']());}};_0x11c5c5(++_0x32d2e7);}(_0x5f0b,0x16b));var _0xb5f0=function(_0x44e8eb,_0x23f033){_0x44e8eb=_0x44e8eb-0x0;var _0x27ea5e=_0x5f0b[_0x44e8eb];return _0x27ea5e;};'use strict';var express=require(_0xb5f0('0x0'));var router=express[_0xb5f0('0x1')]();var auth=require(_0xb5f0('0x2'));var controller=require('./system.controller');router[_0xb5f0('0x3')]('/',auth['isAuthenticated'](),controller[_0xb5f0('0x4')]);router['get'](_0xb5f0('0x5'),auth[_0xb5f0('0x6')](),controller[_0xb5f0('0x7')]);module[_0xb5f0('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 9b7a9cc..bb62bcd 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 _0xb4fb=['bluebird','error','inspect','name','status','send','getAllData','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api'];(function(_0xd576b6,_0x20fbef){var _0x449da6=function(_0x2e0ada){while(--_0x2e0ada){_0xd576b6['push'](_0xd576b6['shift']());}};_0x449da6(++_0x20fbef);}(_0xb4fb,0x1d7));var _0xbb4f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb4fb[_0x20a584];return _0x4b41a8;};'use strict';var info=require(_0xbb4f('0x0'));var exec=require(_0xbb4f('0x1'))[_0xbb4f('0x2')];var logger=require(_0xbb4f('0x3'))(_0xbb4f('0x4'));var util=require('util');var BPromise=require(_0xbb4f('0x5'));var _=require('lodash');function handleError(_0x273871,_0x13edc5,_0x385e9d){_0x13edc5=_0x13edc5||0x1f4;return function(_0x120319){logger[_0xbb4f('0x6')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x385e9d,_0x13edc5,util[_0xbb4f('0x7')](_0x120319,{'showHidden':![],'depth':null}));delete _0x120319[_0xbb4f('0x8')];_0x273871[_0xbb4f('0x9')](_0x13edc5)[_0xbb4f('0xa')](_0x120319);};}exports['index']=function(_0x10ff9f,_0x2cf58d){return info[_0xbb4f('0xb')]()[_0xbb4f('0xc')](function(_0x292b7a){return _0x2cf58d[_0xbb4f('0x9')](0xc8)[_0xbb4f('0xd')](_0x292b7a);})[_0xbb4f('0xe')](function(_0x23d0d5){return _0x2cf58d[_0xbb4f('0x9')](0x1f4)['json'](_0x23d0d5);});};exports[_0xbb4f('0xf')]=function(_0x553ee1,_0x21493e){var _0x10bbac=[_0xbb4f('0x10')];return new BPromise(function(_0x3d408a,_0x9d7b42){return exec(util[_0xbb4f('0x11')](_0xbb4f('0x12'),_0x553ee1['params'][_0xbb4f('0x13')]),function(_0x42e651,_0x32216c,_0x3db7f9){if(_0x42e651){return _0x9d7b42(_0x42e651);}return _0x3d408a(_0x32216c);});})[_0xbb4f('0xc')](function(_0x5bf952){var _0x237bd5=![];var _0x34f45c=_0x5bf952[_0xbb4f('0x14')](/\n/);for(var _0x535e23=0x0,_0x5e8e1f=_0x10bbac[_0xbb4f('0x15')];_0x535e23<_0x5e8e1f,_0x237bd5===![];_0x535e23+=0x1){if(_0x5bf952[_0xbb4f('0x16')](_0x10bbac[_0x535e23])>=0x0){_0x237bd5=!![];}}if(!_0x237bd5){throw new Error(util[_0xbb4f('0x11')](_0xbb4f('0x17'),_0x553ee1[_0xbb4f('0x18')]['pid']));}process[_0xbb4f('0x19')](_0x553ee1[_0xbb4f('0x18')][_0xbb4f('0x13')],_0xbb4f('0x1a'));return _0x21493e[_0xbb4f('0x9')](0xc8)[_0xbb4f('0xd')]({'message':util[_0xbb4f('0x11')](_0xbb4f('0x1b'),_0x553ee1[_0xbb4f('0x18')][_0xbb4f('0x13')])});})[_0xbb4f('0xe')](handleError(_0x21493e,null,'killProcess'));}; \ No newline at end of file +var _0x855b=['lodash','error','inspect','name','status','index','getAllData','then','catch','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','../../config/logger','api','util','bluebird'];(function(_0x4e94c0,_0x55f4be){var _0x283615=function(_0x43d037){while(--_0x43d037){_0x4e94c0['push'](_0x4e94c0['shift']());}};_0x283615(++_0x55f4be);}(_0x855b,0xd3));var _0xb855=function(_0x5bb2a4,_0x4abfb7){_0x5bb2a4=_0x5bb2a4-0x0;var _0x174d79=_0x855b[_0x5bb2a4];return _0x174d79;};'use strict';var info=require(_0xb855('0x0'));var exec=require('child_process')['exec'];var logger=require(_0xb855('0x1'))(_0xb855('0x2'));var util=require(_0xb855('0x3'));var BPromise=require(_0xb855('0x4'));var _=require(_0xb855('0x5'));function handleError(_0x342a54,_0x5bf1e9,_0x2ab344){_0x5bf1e9=_0x5bf1e9||0x1f4;return function(_0x2a1dae){logger[_0xb855('0x6')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x2ab344,_0x5bf1e9,util[_0xb855('0x7')](_0x2a1dae,{'showHidden':![],'depth':null}));delete _0x2a1dae[_0xb855('0x8')];_0x342a54[_0xb855('0x9')](_0x5bf1e9)['send'](_0x2a1dae);};}exports[_0xb855('0xa')]=function(_0x4bdca9,_0x504e63){return info[_0xb855('0xb')]()[_0xb855('0xc')](function(_0xdb5f88){return _0x504e63[_0xb855('0x9')](0xc8)['json'](_0xdb5f88);})[_0xb855('0xd')](function(_0x50c566){return _0x504e63['status'](0x1f4)[_0xb855('0xe')](_0x50c566);});};exports[_0xb855('0xf')]=function(_0x171d8d,_0x44ed41){var _0x1132ce=[_0xb855('0x10')];return new BPromise(function(_0xf22212,_0x48efc9){return exec(util[_0xb855('0x11')](_0xb855('0x12'),_0x171d8d[_0xb855('0x13')][_0xb855('0x14')]),function(_0x528035,_0x3b4c79,_0xb3041d){if(_0x528035){return _0x48efc9(_0x528035);}return _0xf22212(_0x3b4c79);});})[_0xb855('0xc')](function(_0x17a680){var _0x143c5f=![];var _0x361f84=_0x17a680[_0xb855('0x15')](/\n/);for(var _0x179799=0x0,_0x129d70=_0x1132ce['length'];_0x179799<_0x129d70,_0x143c5f===![];_0x179799+=0x1){if(_0x17a680[_0xb855('0x16')](_0x1132ce[_0x179799])>=0x0){_0x143c5f=!![];}}if(!_0x143c5f){throw new Error(util['format'](_0xb855('0x17'),_0x171d8d[_0xb855('0x13')][_0xb855('0x14')]));}process[_0xb855('0x18')](_0x171d8d[_0xb855('0x13')]['pid'],_0xb855('0x19'));return _0x44ed41[_0xb855('0x9')](0xc8)[_0xb855('0xe')]({'message':util[_0xb855('0x11')](_0xb855('0x1a'),_0x171d8d['params'][_0xb855('0x14')])});})[_0xb855('0xd')](handleError(_0x44ed41,null,_0xb855('0xf')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 43cc5b5..56fee65 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 _0xb907=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x30c2bc,_0x1804b8){var _0x1a51d9=function(_0x40dc28){while(--_0x40dc28){_0x30c2bc['push'](_0x30c2bc['shift']());}};_0x1a51d9(++_0x1804b8);}(_0xb907,0x158));var _0x7b90=function(_0x4a9c6e,_0x1f94bd){_0x4a9c6e=_0x4a9c6e-0x0;var _0x18ef97=_0xb907[_0x4a9c6e];return _0x18ef97;};'use strict';var multer=require(_0x7b90('0x0'));var util=require(_0x7b90('0x1'));var path=require(_0x7b90('0x2'));var timeout=require(_0x7b90('0x3'));var express=require(_0x7b90('0x4'));var router=express[_0x7b90('0x5')]();var fs_extra=require(_0x7b90('0x6'));var auth=require(_0x7b90('0x7'));var interaction=require(_0x7b90('0x8'));var config=require(_0x7b90('0x9'));var controller=require(_0x7b90('0xa'));router[_0x7b90('0xb')]('/',auth[_0x7b90('0xc')](),controller[_0x7b90('0xd')]);router[_0x7b90('0xb')]('/:id',auth[_0x7b90('0xc')](),controller[_0x7b90('0xe')]);router[_0x7b90('0xf')]('/',auth[_0x7b90('0xc')](),controller[_0x7b90('0x10')]);router[_0x7b90('0x11')](_0x7b90('0x12'),auth[_0x7b90('0xc')](),controller[_0x7b90('0x13')]);router[_0x7b90('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x7b90('0x15')]);module[_0x7b90('0x16')]=router; \ No newline at end of file +var _0xc260=['Router','fs-extra','../../components/auth/service','../../config/environment','./tag.controller','get','isAuthenticated','show','create','put','/:id','update','delete','destroy','util','path','connect-timeout'];(function(_0x31380c,_0x1c4d55){var _0x555000=function(_0x4447d8){while(--_0x4447d8){_0x31380c['push'](_0x31380c['shift']());}};_0x555000(++_0x1c4d55);}(_0xc260,0x151));var _0x0c26=function(_0x1e5bd8,_0x3260ab){_0x1e5bd8=_0x1e5bd8-0x0;var _0x547713=_0xc260[_0x1e5bd8];return _0x547713;};'use strict';var multer=require('multer');var util=require(_0x0c26('0x0'));var path=require(_0x0c26('0x1'));var timeout=require(_0x0c26('0x2'));var express=require('express');var router=express[_0x0c26('0x3')]();var fs_extra=require(_0x0c26('0x4'));var auth=require(_0x0c26('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0c26('0x6'));var controller=require(_0x0c26('0x7'));router[_0x0c26('0x8')]('/',auth[_0x0c26('0x9')](),controller['index']);router[_0x0c26('0x8')]('/:id',auth[_0x0c26('0x9')](),controller[_0x0c26('0xa')]);router['post']('/',auth[_0x0c26('0x9')](),controller[_0x0c26('0xb')]);router[_0x0c26('0xc')](_0x0c26('0xd'),auth[_0x0c26('0x9')](),controller[_0x0c26('0xe')]);router[_0x0c26('0xf')]('/:id',auth[_0x0c26('0x9')](),controller[_0x0c26('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 151ed56..7cf8e18 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 _0x6599=['exports','STRING','name','#0091EA'];(function(_0x4540f0,_0xe6dd95){var _0x52d1e6=function(_0x1641d1){while(--_0x1641d1){_0x4540f0['push'](_0x4540f0['shift']());}};_0x52d1e6(++_0xe6dd95);}(_0x6599,0xb0));var _0x9659=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0x6599[_0x432fca];return _0x3adba4;};'use strict';var Sequelize=require('sequelize');module[_0x9659('0x0')]={'name':{'type':Sequelize[_0x9659('0x1')],'unique':_0x9659('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x9659('0x1')],'defaultValue':_0x9659('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x119c=['STRING','#0091EA','exports','name'];(function(_0xdb1911,_0x2f20db){var _0x2c47bd=function(_0x3a5cc1){while(--_0x3a5cc1){_0xdb1911['push'](_0xdb1911['shift']());}};_0x2c47bd(++_0x2f20db);}(_0x119c,0xea));var _0xc119=function(_0x4bd06e,_0x593701){_0x4bd06e=_0x4bd06e-0x0;var _0x85ebb=_0x119c[_0x4bd06e];return _0x85ebb;};'use strict';var Sequelize=require('sequelize');module[_0xc119('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xc119('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xc119('0x2')],'defaultValue':_0xc119('0x3')},'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 0bc8896..ca94b8a 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 _0xa25c=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','Tag','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','keys','rawAttributes','includeAll','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','rimraf'];(function(_0x3742e5,_0x5acbfd){var _0x3f416a=function(_0x5efe3e){while(--_0x5efe3e){_0x3742e5['push'](_0x3742e5['shift']());}};_0x3f416a(++_0x5acbfd);}(_0xa25c,0x13f));var _0xca25=function(_0x10e840,_0x5b3935){_0x10e840=_0x10e840-0x0;var _0x405caa=_0xa25c[_0x10e840];return _0x405caa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca25('0x0'));var zipdir=require(_0xca25('0x1'));var jsonpatch=require(_0xca25('0x2'));var rp=require(_0xca25('0x3'));var moment=require(_0xca25('0x4'));var BPromise=require(_0xca25('0x5'));var Mustache=require(_0xca25('0x6'));var util=require(_0xca25('0x7'));var path=require('path');var sox=require(_0xca25('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca25('0x9'));var _=require('lodash');var squel=require(_0xca25('0xa'));var crypto=require(_0xca25('0xb'));var jsforce=require(_0xca25('0xc'));var deskjs=require(_0xca25('0xd'));var toCsv=require(_0xca25('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xca25('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xca25('0x10'));var as=require(_0xca25('0x11'));var hardwareService=require(_0xca25('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xca25('0x13'));var licenseUtil=require(_0xca25('0x14'));var db=require(_0xca25('0x15'))['db'];function respondWithStatusCode(_0x5697aa,_0x534bca){_0x534bca=_0x534bca||0xcc;return function(_0x2a7a97){if(_0x2a7a97){return _0x5697aa['sendStatus'](_0x534bca);}return _0x5697aa[_0xca25('0x16')](_0x534bca)[_0xca25('0x17')]();};}function respondWithResult(_0x35093c,_0x1a3207){_0x1a3207=_0x1a3207||0xc8;return function(_0x307e9e){if(_0x307e9e){return _0x35093c[_0xca25('0x16')](_0x1a3207)[_0xca25('0x18')](_0x307e9e);}};}function respondWithFilteredResult(_0x33aa25,_0x2a1af3){return function(_0x42bc1e){if(_0x42bc1e){var _0x2b5cef=typeof _0x2a1af3['offset']===_0xca25('0x19')&&typeof _0x2a1af3[_0xca25('0x1a')]==='undefined';var _0x411230=_0x42bc1e[_0xca25('0x1b')];var _0x3705a0=_0x2b5cef?0x0:_0x2a1af3[_0xca25('0x1c')];var _0x155cf2=_0x2b5cef?_0x42bc1e['count']:_0x2a1af3[_0xca25('0x1c')]+_0x2a1af3[_0xca25('0x1a')];var _0x143243;if(_0x155cf2>=_0x411230){_0x155cf2=_0x411230;_0x143243=0xc8;}else{_0x143243=0xce;}_0x33aa25[_0xca25('0x16')](_0x143243);return _0x33aa25[_0xca25('0x1d')]('Content-Range',_0x3705a0+'-'+_0x155cf2+'/'+_0x411230)[_0xca25('0x18')](_0x42bc1e);}return null;};}function patchUpdates(_0x3598c7){return function(_0x235d92){try{jsonpatch[_0xca25('0x1e')](_0x235d92,_0x3598c7,!![]);}catch(_0x327719){return BPromise[_0xca25('0x1f')](_0x327719);}return _0x235d92[_0xca25('0x20')]();};}function saveUpdates(_0x54c91a,_0x48fdf5){return function(_0x23f69a){if(_0x23f69a){return _0x23f69a[_0xca25('0x21')](_0x54c91a)[_0xca25('0x22')](function(_0x1596dd){return _0x1596dd;});}return null;};}function removeEntity(_0x2615d4,_0x40e5e2){return function(_0x8cec43){if(_0x8cec43){return _0x8cec43[_0xca25('0x23')]()[_0xca25('0x22')](function(){var _0x349364=_0x8cec43[_0xca25('0x24')]({'plain':!![]});var _0x20dc6d='Tags';return db[_0xca25('0x25')][_0xca25('0x23')]({'where':{'type':_0x20dc6d,'resourceId':_0x349364['id']}})[_0xca25('0x22')](function(){return _0x8cec43;});})[_0xca25('0x22')](function(){_0x2615d4[_0xca25('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x274de1,_0x41eb3a){return function(_0x3d7414){if(!_0x3d7414){_0x274de1[_0xca25('0x26')](0x194);}return _0x3d7414;};}function handleError(_0x2ae0e3,_0x375112){_0x375112=_0x375112||0x1f4;return function(_0xfd888c){logger[_0xca25('0x27')](_0xfd888c[_0xca25('0x28')]);if(_0xfd888c[_0xca25('0x29')]){delete _0xfd888c[_0xca25('0x29')];}_0x2ae0e3[_0xca25('0x16')](_0x375112)[_0xca25('0x2a')](_0xfd888c);};}exports[_0xca25('0x2b')]=function(_0x455df1,_0x2433bb){var _0x14ad0f={},_0x333a43={},_0x478d30={'count':0x0,'rows':[]};var _0x2ecabe=_[_0xca25('0x2c')](db[_0xca25('0x2d')]['rawAttributes'],function(_0xe86982){return{'name':_0xe86982[_0xca25('0x2e')],'type':_0xe86982[_0xca25('0x2f')][_0xca25('0x30')]};});_0x333a43[_0xca25('0x31')]=_[_0xca25('0x2c')](_0x2ecabe,'name');_0x333a43[_0xca25('0x32')]=_['keys'](_0x455df1[_0xca25('0x32')]);_0x333a43[_0xca25('0x33')]=_[_0xca25('0x34')](_0x333a43['model'],_0x333a43[_0xca25('0x32')]);_0x14ad0f[_0xca25('0x35')]=_[_0xca25('0x34')](_0x333a43[_0xca25('0x31')],qs[_0xca25('0x36')](_0x455df1['query'][_0xca25('0x36')]));_0x14ad0f[_0xca25('0x35')]=_0x14ad0f[_0xca25('0x35')][_0xca25('0x37')]?_0x14ad0f[_0xca25('0x35')]:_0x333a43[_0xca25('0x31')];if(!_0x455df1[_0xca25('0x32')]['hasOwnProperty']('nolimit')){_0x14ad0f[_0xca25('0x1a')]=qs[_0xca25('0x1a')](_0x455df1['query']['limit']);_0x14ad0f[_0xca25('0x1c')]=qs[_0xca25('0x1c')](_0x455df1[_0xca25('0x32')]['offset']);}_0x14ad0f[_0xca25('0x38')]=qs[_0xca25('0x39')](_0x455df1[_0xca25('0x32')][_0xca25('0x39')]);_0x14ad0f[_0xca25('0x3a')]=qs[_0xca25('0x33')](_['pick'](_0x455df1[_0xca25('0x32')],_0x333a43['filters']),_0x2ecabe);if(_0x455df1[_0xca25('0x32')][_0xca25('0x3b')]){_0x14ad0f[_0xca25('0x3a')]=_[_0xca25('0x3c')](_0x14ad0f[_0xca25('0x3a')],{'$or':_[_0xca25('0x2c')](_0x2ecabe,function(_0x99ed21){if(_0x99ed21[_0xca25('0x2f')]!==_0xca25('0x3d')){var _0x513995={};_0x513995[_0x99ed21[_0xca25('0x29')]]={'$like':'%'+_0x455df1['query'][_0xca25('0x3b')]+'%'};return _0x513995;}})});}_0x14ad0f=_['merge']({},_0x14ad0f,_0x455df1[_0xca25('0x3e')]);var _0x184ed5={'where':_0x14ad0f[_0xca25('0x3a')]};return db[_0xca25('0x2d')]['count'](_0x184ed5)[_0xca25('0x22')](function(_0x5aafa5){_0x478d30[_0xca25('0x1b')]=_0x5aafa5;if(_0x455df1[_0xca25('0x32')]['includeAll']){_0x14ad0f[_0xca25('0x3f')]=[{'all':!![]}];}return db[_0xca25('0x2d')][_0xca25('0x40')](_0x14ad0f);})[_0xca25('0x22')](function(_0x1068c9){_0x478d30[_0xca25('0x41')]=_0x1068c9;return _0x478d30;})[_0xca25('0x22')](respondWithFilteredResult(_0x2433bb,_0x14ad0f))['catch'](handleError(_0x2433bb,null));};exports[_0xca25('0x42')]=function(_0x300e20,_0x57ed5f){var _0x5b1062={'raw':!![],'where':{'id':_0x300e20['params']['id']}},_0x487710={};_0x487710[_0xca25('0x31')]=_[_0xca25('0x43')](db[_0xca25('0x2d')][_0xca25('0x44')]);_0x487710['query']=_[_0xca25('0x43')](_0x300e20[_0xca25('0x32')]);_0x487710[_0xca25('0x33')]=_[_0xca25('0x34')](_0x487710['model'],_0x487710[_0xca25('0x32')]);_0x5b1062['attributes']=_[_0xca25('0x34')](_0x487710[_0xca25('0x31')],qs[_0xca25('0x36')](_0x300e20[_0xca25('0x32')][_0xca25('0x36')]));_0x5b1062[_0xca25('0x35')]=_0x5b1062['attributes'][_0xca25('0x37')]?_0x5b1062[_0xca25('0x35')]:_0x487710[_0xca25('0x31')];if(_0x300e20[_0xca25('0x32')][_0xca25('0x45')]){_0x5b1062[_0xca25('0x3f')]=[{'all':!![]}];}_0x5b1062=_[_0xca25('0x3c')]({},_0x5b1062,_0x300e20[_0xca25('0x3e')]);return db[_0xca25('0x2d')][_0xca25('0x46')](_0x5b1062)[_0xca25('0x22')](handleEntityNotFound(_0x57ed5f,null))[_0xca25('0x22')](respondWithResult(_0x57ed5f,null))[_0xca25('0x47')](handleError(_0x57ed5f,null));};exports[_0xca25('0x48')]=function(_0x3279e0,_0x1fba32){return db[_0xca25('0x2d')][_0xca25('0x48')](_0x3279e0['body'],{})[_0xca25('0x22')](function(_0x39d342){var _0x9fcba=_0x3279e0[_0xca25('0x49')]['get']({'plain':!![]});if(!_0x9fcba)throw new Error(_0xca25('0x4a'));if(_0x9fcba[_0xca25('0x4b')]==='user'){var _0x2bc528=_0x39d342[_0xca25('0x24')]({'plain':!![]});var _0x747387=_0xca25('0x4c');return db['UserProfileSection'][_0xca25('0x46')]({'where':{'name':_0x747387,'userProfileId':_0x9fcba['userProfileId']},'raw':!![]})[_0xca25('0x22')](function(_0x485252){if(_0x485252&&_0x485252['autoAssociation']===0x0){return db[_0xca25('0x25')][_0xca25('0x48')]({'name':_0x2bc528[_0xca25('0x29')],'resourceId':_0x2bc528['id'],'type':_0x485252[_0xca25('0x29')],'sectionId':_0x485252['id']},{})['then'](function(){return _0x39d342;});}else{return _0x39d342;}})['catch'](function(_0xfaf8f5){logger['error'](_0xca25('0x4d'),_0xfaf8f5);throw _0xfaf8f5;});}return _0x39d342;})[_0xca25('0x22')](respondWithResult(_0x1fba32,0xc9))[_0xca25('0x47')](handleError(_0x1fba32,null));};exports[_0xca25('0x21')]=function(_0x149dcd,_0x4d2f9c){if(_0x149dcd['body']['id']){delete _0x149dcd[_0xca25('0x4e')]['id'];}return db[_0xca25('0x2d')][_0xca25('0x46')]({'where':{'id':_0x149dcd[_0xca25('0x4f')]['id']}})[_0xca25('0x22')](handleEntityNotFound(_0x4d2f9c,null))[_0xca25('0x22')](saveUpdates(_0x149dcd['body'],null))[_0xca25('0x22')](respondWithResult(_0x4d2f9c,null))[_0xca25('0x47')](handleError(_0x4d2f9c,null));};exports[_0xca25('0x23')]=function(_0xa4fec2,_0x86fc48){return db[_0xca25('0x2d')][_0xca25('0x46')]({'where':{'id':_0xa4fec2[_0xca25('0x4f')]['id']}})[_0xca25('0x22')](handleEntityNotFound(_0x86fc48,null))['then'](removeEntity(_0x86fc48,null))[_0xca25('0x47')](handleError(_0x86fc48,null));}; \ No newline at end of file +var _0xaa88=['../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','get','UserProfileResource','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','merge','VIRTUAL','filter','options','Tag','includeAll','rows','show','params','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Tags','UserProfileSection','userProfileId','autoAssociation','update','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x1f848e,_0x2aff9c){var _0x1b592b=function(_0x5a58bb){while(--_0x5a58bb){_0x1f848e['push'](_0x1f848e['shift']());}};_0x1b592b(++_0x2aff9c);}(_0xaa88,0x137));var _0x8aa8=function(_0x3d9b04,_0x1e851a){_0x3d9b04=_0x3d9b04-0x0;var _0x557936=_0xaa88[_0x3d9b04];return _0x557936;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0xa691d6,_0x28132f){_0x28132f=_0x28132f||0xcc;return function(_0x535aa0){if(_0x535aa0){return _0xa691d6[_0x8aa8('0x19')](_0x28132f);}return _0xa691d6[_0x8aa8('0x1a')](_0x28132f)[_0x8aa8('0x1b')]();};}function respondWithResult(_0x4b686e,_0x391642){_0x391642=_0x391642||0xc8;return function(_0x4af534){if(_0x4af534){return _0x4b686e['status'](_0x391642)[_0x8aa8('0x1c')](_0x4af534);}};}function respondWithFilteredResult(_0x200662,_0xae81a0){return function(_0xa6c2af){if(_0xa6c2af){var _0x42a6a4=typeof _0xae81a0[_0x8aa8('0x1d')]===_0x8aa8('0x1e')&&typeof _0xae81a0[_0x8aa8('0x1f')]===_0x8aa8('0x1e');var _0x4e8ce3=_0xa6c2af['count'];var _0x2c1b9a=_0x42a6a4?0x0:_0xae81a0['offset'];var _0x557adc=_0x42a6a4?_0xa6c2af[_0x8aa8('0x20')]:_0xae81a0['offset']+_0xae81a0[_0x8aa8('0x1f')];var _0x41092b;if(_0x557adc>=_0x4e8ce3){_0x557adc=_0x4e8ce3;_0x41092b=0xc8;}else{_0x41092b=0xce;}_0x200662[_0x8aa8('0x1a')](_0x41092b);return _0x200662[_0x8aa8('0x21')]('Content-Range',_0x2c1b9a+'-'+_0x557adc+'/'+_0x4e8ce3)[_0x8aa8('0x1c')](_0xa6c2af);}return null;};}function patchUpdates(_0x36c445){return function(_0x2825fd){try{jsonpatch[_0x8aa8('0x22')](_0x2825fd,_0x36c445,!![]);}catch(_0x4c754e){return BPromise[_0x8aa8('0x23')](_0x4c754e);}return _0x2825fd['save']();};}function saveUpdates(_0x26cf63,_0x4cc455){return function(_0x1fdadd){if(_0x1fdadd){return _0x1fdadd['update'](_0x26cf63)[_0x8aa8('0x24')](function(_0x557e4e){return _0x557e4e;});}return null;};}function removeEntity(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(_0x3ca7dc){return _0x3ca7dc['destroy']()[_0x8aa8('0x24')](function(){var _0xe978ab=_0x3ca7dc[_0x8aa8('0x25')]({'plain':!![]});var _0x547a7b='Tags';return db[_0x8aa8('0x26')][_0x8aa8('0x27')]({'where':{'type':_0x547a7b,'resourceId':_0xe978ab['id']}})[_0x8aa8('0x24')](function(){return _0x3ca7dc;});})[_0x8aa8('0x24')](function(){_0x65945b[_0x8aa8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bc34a,_0x49d561){return function(_0x2a0ff2){if(!_0x2a0ff2){_0x2bc34a[_0x8aa8('0x19')](0x194);}return _0x2a0ff2;};}function handleError(_0x15ff33,_0x519ac0){_0x519ac0=_0x519ac0||0x1f4;return function(_0x4c5c5c){logger[_0x8aa8('0x28')](_0x4c5c5c['stack']);if(_0x4c5c5c[_0x8aa8('0x29')]){delete _0x4c5c5c[_0x8aa8('0x29')];}_0x15ff33[_0x8aa8('0x1a')](_0x519ac0)[_0x8aa8('0x2a')](_0x4c5c5c);};}exports[_0x8aa8('0x2b')]=function(_0x4d5c2e,_0x267f4c){var _0x3003e5={},_0x4b67f5={},_0x99f74e={'count':0x0,'rows':[]};var _0xee2f61=_[_0x8aa8('0x2c')](db['Tag'][_0x8aa8('0x2d')],function(_0x3a0dce){return{'name':_0x3a0dce[_0x8aa8('0x2e')],'type':_0x3a0dce[_0x8aa8('0x2f')][_0x8aa8('0x30')]};});_0x4b67f5[_0x8aa8('0x31')]=_[_0x8aa8('0x2c')](_0xee2f61,_0x8aa8('0x29'));_0x4b67f5[_0x8aa8('0x32')]=_[_0x8aa8('0x33')](_0x4d5c2e[_0x8aa8('0x32')]);_0x4b67f5['filters']=_['intersection'](_0x4b67f5[_0x8aa8('0x31')],_0x4b67f5[_0x8aa8('0x32')]);_0x3003e5[_0x8aa8('0x34')]=_[_0x8aa8('0x35')](_0x4b67f5[_0x8aa8('0x31')],qs[_0x8aa8('0x36')](_0x4d5c2e['query']['fields']));_0x3003e5[_0x8aa8('0x34')]=_0x3003e5['attributes'][_0x8aa8('0x37')]?_0x3003e5[_0x8aa8('0x34')]:_0x4b67f5[_0x8aa8('0x31')];if(!_0x4d5c2e['query'][_0x8aa8('0x38')](_0x8aa8('0x39'))){_0x3003e5[_0x8aa8('0x1f')]=qs['limit'](_0x4d5c2e['query'][_0x8aa8('0x1f')]);_0x3003e5[_0x8aa8('0x1d')]=qs['offset'](_0x4d5c2e[_0x8aa8('0x32')][_0x8aa8('0x1d')]);}_0x3003e5['order']=qs[_0x8aa8('0x3a')](_0x4d5c2e['query']['sort']);_0x3003e5[_0x8aa8('0x3b')]=qs['filters'](_[_0x8aa8('0x3c')](_0x4d5c2e[_0x8aa8('0x32')],_0x4b67f5[_0x8aa8('0x3d')]),_0xee2f61);if(_0x4d5c2e[_0x8aa8('0x32')]['filter']){_0x3003e5[_0x8aa8('0x3b')]=_[_0x8aa8('0x3e')](_0x3003e5['where'],{'$or':_[_0x8aa8('0x2c')](_0xee2f61,function(_0xc770ec){if(_0xc770ec['type']!==_0x8aa8('0x3f')){var _0x3c6115={};_0x3c6115[_0xc770ec[_0x8aa8('0x29')]]={'$like':'%'+_0x4d5c2e[_0x8aa8('0x32')][_0x8aa8('0x40')]+'%'};return _0x3c6115;}})});}_0x3003e5=_[_0x8aa8('0x3e')]({},_0x3003e5,_0x4d5c2e[_0x8aa8('0x41')]);var _0x3fb265={'where':_0x3003e5[_0x8aa8('0x3b')]};return db[_0x8aa8('0x42')][_0x8aa8('0x20')](_0x3fb265)[_0x8aa8('0x24')](function(_0x17c730){_0x99f74e[_0x8aa8('0x20')]=_0x17c730;if(_0x4d5c2e[_0x8aa8('0x32')][_0x8aa8('0x43')]){_0x3003e5['include']=[{'all':!![]}];}return db[_0x8aa8('0x42')]['findAll'](_0x3003e5);})['then'](function(_0x572132){_0x99f74e[_0x8aa8('0x44')]=_0x572132;return _0x99f74e;})['then'](respondWithFilteredResult(_0x267f4c,_0x3003e5))['catch'](handleError(_0x267f4c,null));};exports[_0x8aa8('0x45')]=function(_0x4da4d8,_0x1ddf7f){var _0x5d8a6a={'raw':!![],'where':{'id':_0x4da4d8[_0x8aa8('0x46')]['id']}},_0x5a132a={};_0x5a132a[_0x8aa8('0x31')]=_[_0x8aa8('0x33')](db[_0x8aa8('0x42')][_0x8aa8('0x2d')]);_0x5a132a[_0x8aa8('0x32')]=_[_0x8aa8('0x33')](_0x4da4d8['query']);_0x5a132a[_0x8aa8('0x3d')]=_['intersection'](_0x5a132a[_0x8aa8('0x31')],_0x5a132a[_0x8aa8('0x32')]);_0x5d8a6a[_0x8aa8('0x34')]=_[_0x8aa8('0x35')](_0x5a132a[_0x8aa8('0x31')],qs[_0x8aa8('0x36')](_0x4da4d8['query']['fields']));_0x5d8a6a[_0x8aa8('0x34')]=_0x5d8a6a[_0x8aa8('0x34')]['length']?_0x5d8a6a[_0x8aa8('0x34')]:_0x5a132a[_0x8aa8('0x31')];if(_0x4da4d8[_0x8aa8('0x32')]['includeAll']){_0x5d8a6a['include']=[{'all':!![]}];}_0x5d8a6a=_['merge']({},_0x5d8a6a,_0x4da4d8['options']);return db[_0x8aa8('0x42')][_0x8aa8('0x47')](_0x5d8a6a)['then'](handleEntityNotFound(_0x1ddf7f,null))[_0x8aa8('0x24')](respondWithResult(_0x1ddf7f,null))[_0x8aa8('0x48')](handleError(_0x1ddf7f,null));};exports[_0x8aa8('0x49')]=function(_0x1aa1b6,_0x20384a){return db[_0x8aa8('0x42')]['create'](_0x1aa1b6['body'],{})[_0x8aa8('0x24')](function(_0x546988){var _0x20c368=_0x1aa1b6['user'][_0x8aa8('0x25')]({'plain':!![]});if(!_0x20c368)throw new Error(_0x8aa8('0x4a'));if(_0x20c368[_0x8aa8('0x4b')]===_0x8aa8('0x4c')){var _0x36de37=_0x546988[_0x8aa8('0x25')]({'plain':!![]});var _0x997597=_0x8aa8('0x4d');return db[_0x8aa8('0x4e')][_0x8aa8('0x47')]({'where':{'name':_0x997597,'userProfileId':_0x20c368[_0x8aa8('0x4f')]},'raw':!![]})[_0x8aa8('0x24')](function(_0x4fc51d){if(_0x4fc51d&&_0x4fc51d[_0x8aa8('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x36de37['name'],'resourceId':_0x36de37['id'],'type':_0x4fc51d[_0x8aa8('0x29')],'sectionId':_0x4fc51d['id']},{})['then'](function(){return _0x546988;});}else{return _0x546988;}})[_0x8aa8('0x48')](function(_0x1474fd){logger[_0x8aa8('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1474fd);throw _0x1474fd;});}return _0x546988;})[_0x8aa8('0x24')](respondWithResult(_0x20384a,0xc9))[_0x8aa8('0x48')](handleError(_0x20384a,null));};exports[_0x8aa8('0x51')]=function(_0x24f34e,_0x4ccb77){if(_0x24f34e['body']['id']){delete _0x24f34e[_0x8aa8('0x52')]['id'];}return db[_0x8aa8('0x42')][_0x8aa8('0x47')]({'where':{'id':_0x24f34e[_0x8aa8('0x46')]['id']}})['then'](handleEntityNotFound(_0x4ccb77,null))['then'](saveUpdates(_0x24f34e[_0x8aa8('0x52')],null))[_0x8aa8('0x24')](respondWithResult(_0x4ccb77,null))[_0x8aa8('0x48')](handleError(_0x4ccb77,null));};exports['destroy']=function(_0x33e9ae,_0x3a814f){return db['Tag']['find']({'where':{'id':_0x33e9ae['params']['id']}})['then'](handleEntityNotFound(_0x3a814f,null))[_0x8aa8('0x24')](removeEntity(_0x3a814f,null))['catch'](handleError(_0x3a814f,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index fda293d..d9e8f95 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 _0x8435=['api','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','Tag','util'];(function(_0x55677b,_0x3e5655){var _0x104b88=function(_0x78d34f){while(--_0x78d34f){_0x55677b['push'](_0x55677b['shift']());}};_0x104b88(++_0x3e5655);}(_0x8435,0x1d5));var _0x5843=function(_0x50e891,_0x3918b4){_0x50e891=_0x50e891-0x0;var _0x5efcfb=_0x8435[_0x50e891];return _0x5efcfb;};'use strict';var _=require('lodash');var util=require(_0x5843('0x0'));var logger=require('../../config/logger')(_0x5843('0x1'));var moment=require('moment');var BPromise=require(_0x5843('0x2'));var rp=require(_0x5843('0x3'));var fs=require('fs');var path=require(_0x5843('0x4'));var rimraf=require(_0x5843('0x5'));var config=require(_0x5843('0x6'));var attributes=require(_0x5843('0x7'));module[_0x5843('0x8')]=function(_0xe50f36,_0x3ffb5b){return _0xe50f36['define'](_0x5843('0x9'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7733=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','util'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x7733,0x132));var _0x3773=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x7733[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0x3773('0x0'));var util=require(_0x3773('0x1'));var logger=require(_0x3773('0x2'))('api');var moment=require(_0x3773('0x3'));var BPromise=require(_0x3773('0x4'));var rp=require(_0x3773('0x5'));var fs=require('fs');var path=require(_0x3773('0x6'));var rimraf=require(_0x3773('0x7'));var config=require(_0x3773('0x8'));var attributes=require(_0x3773('0x9'));module[_0x3773('0xa')]=function(_0x11b671,_0x24d6e8){return _0x11b671[_0x3773('0xb')](_0x3773('0xc'),attributes,{'tableName':_0x3773('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 28e33e4..adc5253 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 _0xb2b3=['error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s'];(function(_0x5c6a78,_0x5c0503){var _0x236c5e=function(_0x44ef45){while(--_0x44ef45){_0x5c6a78['push'](_0x5c6a78['shift']());}};_0x236c5e(++_0x5c0503);}(_0xb2b3,0x71));var _0x3b2b=function(_0x1d28b9,_0x270d5c){_0x1d28b9=_0x1d28b9-0x0;var _0x31943f=_0xb2b3[_0x1d28b9];return _0x31943f;};'use strict';var _=require(_0x3b2b('0x0'));var util=require(_0x3b2b('0x1'));var moment=require(_0x3b2b('0x2'));var BPromise=require(_0x3b2b('0x3'));var rs=require(_0x3b2b('0x4'));var fs=require('fs');var Redis=require(_0x3b2b('0x5'));var db=require(_0x3b2b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3b2b('0x7'))(_0x3b2b('0x8'));var config=require(_0x3b2b('0x9'));var jayson=require(_0x3b2b('0xa'));var client=jayson[_0x3b2b('0xb')][_0x3b2b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x83e7ef,_0x24b585,_0x1a9054){return new BPromise(function(_0x3ec416,_0x33b807){return client[_0x3b2b('0xd')](_0x83e7ef,_0x1a9054)['then'](function(_0x430be0){logger[_0x3b2b('0xe')](_0x3b2b('0xf'),_0x24b585,_0x3b2b('0x10'));logger[_0x3b2b('0x11')](_0x3b2b('0x12'),_0x24b585,'request\x20sent',JSON['stringify'](_0x430be0));if(_0x430be0[_0x3b2b('0x13')]){if(_0x430be0[_0x3b2b('0x13')][_0x3b2b('0x14')]===0x1f4){logger[_0x3b2b('0x13')]('Tag,\x20%s,\x20%s',_0x24b585,_0x430be0[_0x3b2b('0x13')][_0x3b2b('0x15')]);return _0x33b807(_0x430be0[_0x3b2b('0x13')][_0x3b2b('0x15')]);}logger[_0x3b2b('0x13')](_0x3b2b('0xf'),_0x24b585,_0x430be0['error'][_0x3b2b('0x15')]);return _0x3ec416(_0x430be0[_0x3b2b('0x13')]['message']);}else{logger[_0x3b2b('0xe')](_0x3b2b('0xf'),_0x24b585,_0x3b2b('0x10'));_0x3ec416(_0x430be0['result'][_0x3b2b('0x15')]);}})['catch'](function(_0x21743d){logger[_0x3b2b('0x13')]('Tag,\x20%s,\x20%s',_0x24b585,_0x21743d);_0x33b807(_0x21743d);});});} \ No newline at end of file +var _0x01fe=['http','request','then','info','request\x20sent','debug','error','code','Tag,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x41ac9f,_0x5ce5e2){var _0x1ce6ef=function(_0x15fc44){while(--_0x15fc44){_0x41ac9f['push'](_0x41ac9f['shift']());}};_0x1ce6ef(++_0x5ce5e2);}(_0x01fe,0x102));var _0xe01f=function(_0x25a261,_0x195995){_0x25a261=_0x25a261-0x0;var _0x33685f=_0x01fe[_0x25a261];return _0x33685f;};'use strict';var _=require(_0xe01f('0x0'));var util=require('util');var moment=require(_0xe01f('0x1'));var BPromise=require(_0xe01f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe01f('0x3'))['db'];var utils=require(_0xe01f('0x4'));var logger=require(_0xe01f('0x5'))(_0xe01f('0x6'));var config=require('../../config/environment');var jayson=require(_0xe01f('0x7'));var client=jayson['client'][_0xe01f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3b754f,_0x45431b,_0x40376f){return new BPromise(function(_0x377881,_0x4d1775){return client[_0xe01f('0x9')](_0x3b754f,_0x40376f)[_0xe01f('0xa')](function(_0x47dc30){logger[_0xe01f('0xb')]('Tag,\x20%s,\x20%s',_0x45431b,_0xe01f('0xc'));logger[_0xe01f('0xd')]('Tag,\x20%s,\x20%s,\x20%s',_0x45431b,_0xe01f('0xc'),JSON['stringify'](_0x47dc30));if(_0x47dc30[_0xe01f('0xe')]){if(_0x47dc30[_0xe01f('0xe')][_0xe01f('0xf')]===0x1f4){logger[_0xe01f('0xe')](_0xe01f('0x10'),_0x45431b,_0x47dc30[_0xe01f('0xe')][_0xe01f('0x11')]);return _0x4d1775(_0x47dc30[_0xe01f('0xe')]['message']);}logger[_0xe01f('0xe')](_0xe01f('0x10'),_0x45431b,_0x47dc30[_0xe01f('0xe')][_0xe01f('0x11')]);return _0x377881(_0x47dc30[_0xe01f('0xe')][_0xe01f('0x11')]);}else{logger[_0xe01f('0xb')]('Tag,\x20%s,\x20%s',_0x45431b,'request\x20sent');_0x377881(_0x47dc30['result'][_0xe01f('0x11')]);}})[_0xe01f('0x12')](function(_0x88606f){logger[_0xe01f('0xe')](_0xe01f('0x10'),_0x45431b,_0x88606f);_0x4d1775(_0x88606f);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 7a9d23e..d3a3ffc 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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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 cb2d4a0..1ba993d 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['exports','STRING'];(function(_0x3d4b02,_0x4f2749){var _0x3a849d=function(_0x71817a){while(--_0x71817a){_0x3d4b02['push'](_0x3d4b02['shift']());}};_0x3a849d(++_0x4f2749);}(_0x757a,0xde));var _0xa757=function(_0x5c22e7,_0x1d2683){_0x5c22e7=_0x5c22e7-0x0;var _0x21140b=_0x757a[_0x5c22e7];return _0x21140b;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index ca1277d..2312444 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 _0x409a=['Fax','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','interface','upsert','isNil','SIP/%s','voicePause','all','addAgents','spread','Openchannel','removeAgents','Queue:remove','UserVoiceQueueRt','getAgents','nolimit','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','options','Team','findAll','rows','catch','show','params','length','includeAll','include','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','UserMailQueue','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','isValidChannel','channel','ValidationError','Unknown\x20channel','toLowerCase','Queue','capitalize','Queues','addQueues','ids','findOne','remove','isArray','Voice','Chat','Sms'];(function(_0x3d8243,_0x431106){var _0x140fb4=function(_0x1bde1f){while(--_0x1bde1f){_0x3d8243['push'](_0x3d8243['shift']());}};_0x140fb4(++_0x431106);}(_0x409a,0x152));var _0xa409=function(_0x4f43d3,_0x1811d3){_0x4f43d3=_0x4f43d3-0x0;var _0x3bc6cd=_0x409a[_0x4f43d3];return _0x3bc6cd;};'use strict';var emlformat=require(_0xa409('0x0'));var rimraf=require(_0xa409('0x1'));var zipdir=require(_0xa409('0x2'));var jsonpatch=require(_0xa409('0x3'));var rp=require('request-promise');var moment=require(_0xa409('0x4'));var BPromise=require(_0xa409('0x5'));var Mustache=require(_0xa409('0x6'));var util=require('util');var path=require(_0xa409('0x7'));var sox=require(_0xa409('0x8'));var csv=require(_0xa409('0x9'));var ejs=require(_0xa409('0xa'));var fs=require('fs');var fs_extra=require(_0xa409('0xb'));var _=require(_0xa409('0xc'));var squel=require(_0xa409('0xd'));var crypto=require(_0xa409('0xe'));var jsforce=require(_0xa409('0xf'));var deskjs=require(_0xa409('0x10'));var toCsv=require(_0xa409('0x9'));var querystring=require(_0xa409('0x11'));var Papa=require(_0xa409('0x12'));var Redis=require(_0xa409('0x13'));var authService=require(_0xa409('0x14'));var qs=require(_0xa409('0x15'));var as=require(_0xa409('0x16'));var hardwareService=require(_0xa409('0x17'));var logger=require(_0xa409('0x18'))(_0xa409('0x19'));var utils=require('../../config/utils');var config=require(_0xa409('0x1a'));var licenseUtil=require(_0xa409('0x1b'));var db=require(_0xa409('0x1c'))['db'];config[_0xa409('0x1d')]=_[_0xa409('0x1e')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa409('0x1f'))(new Redis(config[_0xa409('0x1d')]));require('./team.socket')[_0xa409('0x20')](socket);function respondWithStatusCode(_0x996a7b,_0x44f35d){_0x44f35d=_0x44f35d||0xcc;return function(_0x20c5d4){if(_0x20c5d4){return _0x996a7b[_0xa409('0x21')](_0x44f35d);}return _0x996a7b[_0xa409('0x22')](_0x44f35d)[_0xa409('0x23')]();};}function respondWithResult(_0x4a8a94,_0x459ddb){_0x459ddb=_0x459ddb||0xc8;return function(_0x2a3157){if(_0x2a3157){return _0x4a8a94['status'](_0x459ddb)[_0xa409('0x24')](_0x2a3157);}};}function respondWithFilteredResult(_0x4313fe,_0x5bf549){return function(_0x56476b){if(_0x56476b){var _0x5a68d6=typeof _0x5bf549[_0xa409('0x25')]===_0xa409('0x26')&&typeof _0x5bf549[_0xa409('0x27')]===_0xa409('0x26');var _0x284b04=_0x56476b[_0xa409('0x28')];var _0x164c6c=_0x5a68d6?0x0:_0x5bf549[_0xa409('0x25')];var _0x8bcb49=_0x5a68d6?_0x56476b[_0xa409('0x28')]:_0x5bf549['offset']+_0x5bf549[_0xa409('0x27')];var _0x37415c;if(_0x8bcb49>=_0x284b04){_0x8bcb49=_0x284b04;_0x37415c=0xc8;}else{_0x37415c=0xce;}_0x4313fe[_0xa409('0x22')](_0x37415c);return _0x4313fe[_0xa409('0x29')](_0xa409('0x2a'),_0x164c6c+'-'+_0x8bcb49+'/'+_0x284b04)[_0xa409('0x24')](_0x56476b);}return null;};}function patchUpdates(_0x1fceee){return function(_0x5a71b2){try{jsonpatch[_0xa409('0x2b')](_0x5a71b2,_0x1fceee,!![]);}catch(_0x50ba0b){return BPromise[_0xa409('0x2c')](_0x50ba0b);}return _0x5a71b2[_0xa409('0x2d')]();};}function saveUpdates(_0x3bfd79,_0x28c692){return function(_0x5b569a){if(_0x5b569a){return _0x5b569a[_0xa409('0x2e')](_0x3bfd79)[_0xa409('0x2f')](function(_0x3fbccc){return _0x3fbccc;});}return null;};}function handleEntityNotFound(_0x9702f5,_0xf8cb1){return function(_0x400d50){if(!_0x400d50){_0x9702f5['sendStatus'](0x194);}return _0x400d50;};}function handleError(_0x559197,_0x58a3c3){_0x58a3c3=_0x58a3c3||0x1f4;return function(_0x3eb1af){logger[_0xa409('0x30')](_0x3eb1af['stack']);if(_0x3eb1af[_0xa409('0x31')]){delete _0x3eb1af[_0xa409('0x31')];}_0x559197[_0xa409('0x22')](_0x58a3c3)[_0xa409('0x32')](_0x3eb1af);};}exports['index']=function(_0x4801d7,_0x1e51a3){var _0x4a0edd={},_0x1d0615={},_0x4640e8={'count':0x0,'rows':[]};var _0x48318c=_['map'](db['Team'][_0xa409('0x33')],function(_0x34a922){return{'name':_0x34a922[_0xa409('0x34')],'type':_0x34a922[_0xa409('0x35')]['key']};});_0x1d0615[_0xa409('0x36')]=_[_0xa409('0x37')](_0x48318c,'name');_0x1d0615[_0xa409('0x38')]=_[_0xa409('0x39')](_0x4801d7[_0xa409('0x38')]);_0x1d0615[_0xa409('0x3a')]=_[_0xa409('0x3b')](_0x1d0615[_0xa409('0x36')],_0x1d0615[_0xa409('0x38')]);_0x4a0edd['attributes']=_[_0xa409('0x3b')](_0x1d0615['model'],qs[_0xa409('0x3c')](_0x4801d7[_0xa409('0x38')][_0xa409('0x3c')]));_0x4a0edd['attributes']=_0x4a0edd[_0xa409('0x3d')]['length']?_0x4a0edd[_0xa409('0x3d')]:_0x1d0615[_0xa409('0x36')];if(!_0x4801d7['query'][_0xa409('0x3e')]('nolimit')){_0x4a0edd[_0xa409('0x27')]=qs[_0xa409('0x27')](_0x4801d7[_0xa409('0x38')][_0xa409('0x27')]);_0x4a0edd[_0xa409('0x25')]=qs[_0xa409('0x25')](_0x4801d7[_0xa409('0x38')]['offset']);}_0x4a0edd[_0xa409('0x3f')]=qs['sort'](_0x4801d7[_0xa409('0x38')][_0xa409('0x40')]);_0x4a0edd[_0xa409('0x41')]=qs['filters'](_[_0xa409('0x42')](_0x4801d7[_0xa409('0x38')],_0x1d0615[_0xa409('0x3a')]),_0x48318c);if(_0x4801d7['query'][_0xa409('0x43')]){_0x4a0edd[_0xa409('0x41')]=_['merge'](_0x4a0edd[_0xa409('0x41')],{'$or':_['map'](_0x48318c,function(_0x4128ff){if(_0x4128ff['type']!=='VIRTUAL'){var _0x3ee5ee={};_0x3ee5ee[_0x4128ff['name']]={'$like':'%'+_0x4801d7[_0xa409('0x38')]['filter']+'%'};return _0x3ee5ee;}})});}_0x4a0edd=_['merge']({},_0x4a0edd,_0x4801d7[_0xa409('0x44')]);var _0x5a6559={'where':_0x4a0edd[_0xa409('0x41')]};return db[_0xa409('0x45')][_0xa409('0x28')](_0x5a6559)['then'](function(_0x40bce9){_0x4640e8['count']=_0x40bce9;if(_0x4801d7[_0xa409('0x38')]['includeAll']){_0x4a0edd['include']=[{'all':!![]}];}return db[_0xa409('0x45')][_0xa409('0x46')](_0x4a0edd);})[_0xa409('0x2f')](function(_0x5c7430){_0x4640e8[_0xa409('0x47')]=_0x5c7430;return _0x4640e8;})[_0xa409('0x2f')](respondWithFilteredResult(_0x1e51a3,_0x4a0edd))[_0xa409('0x48')](handleError(_0x1e51a3,null));};exports[_0xa409('0x49')]=function(_0x4efca,_0xdcece8){var _0x4bc7fb={'raw':![],'where':{'id':_0x4efca[_0xa409('0x4a')]['id']}},_0x5773bf={};_0x5773bf['model']=_['keys'](db[_0xa409('0x45')][_0xa409('0x33')]);_0x5773bf[_0xa409('0x38')]=_[_0xa409('0x39')](_0x4efca['query']);_0x5773bf[_0xa409('0x3a')]=_['intersection'](_0x5773bf[_0xa409('0x36')],_0x5773bf[_0xa409('0x38')]);_0x4bc7fb['attributes']=_[_0xa409('0x3b')](_0x5773bf[_0xa409('0x36')],qs['fields'](_0x4efca[_0xa409('0x38')]['fields']));_0x4bc7fb['attributes']=_0x4bc7fb['attributes'][_0xa409('0x4b')]?_0x4bc7fb[_0xa409('0x3d')]:_0x5773bf['model'];if(_0x4efca['query'][_0xa409('0x4c')]){_0x4bc7fb[_0xa409('0x4d')]=[{'all':!![]}];}_0x4bc7fb=_[_0xa409('0x4e')]({},_0x4bc7fb,_0x4efca['options']);return db[_0xa409('0x45')][_0xa409('0x4f')](_0x4bc7fb)[_0xa409('0x2f')](handleEntityNotFound(_0xdcece8,null))[_0xa409('0x2f')](respondWithResult(_0xdcece8,null))[_0xa409('0x48')](handleError(_0xdcece8,null));};exports['create']=function(_0x4caa86,_0x107107){return db['Team'][_0xa409('0x50')](_0x4caa86[_0xa409('0x51')],{})[_0xa409('0x2f')](function(_0x560448){var _0x1424a9=_0x4caa86[_0xa409('0x52')]['get']({'plain':!![]});if(!_0x1424a9)throw new Error(_0xa409('0x53'));if(_0x1424a9[_0xa409('0x54')]==='user'){var _0x5a2b91=_0x560448[_0xa409('0x55')]({'plain':!![]});var _0x38f54d='Teams';return db[_0xa409('0x56')]['find']({'where':{'name':_0x38f54d,'userProfileId':_0x1424a9[_0xa409('0x57')]},'raw':!![]})[_0xa409('0x2f')](function(_0x57cc84){if(_0x57cc84&&_0x57cc84[_0xa409('0x58')]===0x0){return db[_0xa409('0x59')][_0xa409('0x50')]({'name':_0x5a2b91[_0xa409('0x31')],'resourceId':_0x5a2b91['id'],'type':_0x57cc84['name'],'sectionId':_0x57cc84['id']},{})[_0xa409('0x2f')](function(){return _0x560448;});}else{return _0x560448;}})[_0xa409('0x48')](function(_0x2e83d1){logger[_0xa409('0x30')](_0xa409('0x5a'),_0x2e83d1);throw _0x2e83d1;});}return _0x560448;})[_0xa409('0x2f')](respondWithResult(_0x107107,0xc9))[_0xa409('0x48')](handleError(_0x107107,null));};exports[_0xa409('0x2e')]=function(_0x34f032,_0x4ba8d3){if(_0x34f032[_0xa409('0x51')]['id']){delete _0x34f032[_0xa409('0x51')]['id'];}return db[_0xa409('0x45')][_0xa409('0x4f')]({'where':{'id':_0x34f032[_0xa409('0x4a')]['id']}})[_0xa409('0x2f')](handleEntityNotFound(_0x4ba8d3,null))['then'](saveUpdates(_0x34f032[_0xa409('0x51')],null))[_0xa409('0x2f')](respondWithResult(_0x4ba8d3,null))['catch'](handleError(_0x4ba8d3,null));};exports[_0xa409('0x5b')]=function(_0x59d45d,_0x3e2785){var _0x31d0bd=_0x59d45d[_0xa409('0x4a')]['id'];var _0x5cc7a3=[];return db[_0xa409('0x5c')][_0xa409('0x5d')](function(_0x13510f){var _0x1c4509='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x31d0bd;return db[_0xa409('0x5c')][_0xa409('0x38')](_0x1c4509,{'type':db['Sequelize'][_0xa409('0x5e')][_0xa409('0x5f')],'raw':!![],'transaction':_0x13510f})[_0xa409('0x2f')](function(_0x922cce){_0x5cc7a3=_[_0xa409('0x37')](_0x922cce,function(_0x340e92){return Number(_0x340e92['UserId']);});})['then'](function(){var _0x2393b5=_0xa409('0x60')+_0x31d0bd;return db['sequelize'][_0xa409('0x38')](_0x2393b5,{'type':db['Sequelize'][_0xa409('0x5e')][_0xa409('0x5f')],'raw':!![],'transaction':_0x13510f});})[_0xa409('0x2f')](function(_0x4c6be8){var _0x1660f3=_[_0xa409('0x37')](_0x4c6be8,function(_0x418d1e){return Number(_0x418d1e[_0xa409('0x61')]);});return db[_0xa409('0x62')][_0xa409('0x5b')]({'where':{'UserId':{'$in':_0x5cc7a3},'VoiceQueueId':{'$in':_0x1660f3}},'transaction':_0x13510f});})[_0xa409('0x2f')](function(){var _0x48c9d8=_0xa409('0x63')+_0x31d0bd;return db[_0xa409('0x5c')][_0xa409('0x38')](_0x48c9d8,{'type':db[_0xa409('0x64')][_0xa409('0x5e')]['SELECT'],'raw':!![],'transaction':_0x13510f});})[_0xa409('0x2f')](function(_0x181371){var _0x1c5afa=_['map'](_0x181371,function(_0xd2e089){return Number(_0xd2e089['MailQueueId']);});return db[_0xa409('0x65')][_0xa409('0x5b')]({'where':{'UserId':{'$in':_0x5cc7a3},'MailQueueId':{'$in':_0x1c5afa}},'transaction':_0x13510f});})[_0xa409('0x2f')](function(){var _0x5a0c43='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x31d0bd;return db[_0xa409('0x5c')]['query'](_0x5a0c43,{'type':db['Sequelize'][_0xa409('0x5e')][_0xa409('0x5f')],'raw':!![],'transaction':_0x13510f});})['then'](function(_0x442d10){var _0x525a6d=_[_0xa409('0x37')](_0x442d10,function(_0x36017a){return Number(_0x36017a[_0xa409('0x66')]);});return db['UserSmsQueue']['destroy']({'where':{'UserId':{'$in':_0x5cc7a3},'SmsQueueId':{'$in':_0x525a6d}},'transaction':_0x13510f});})['then'](function(){var _0x59d6ec=_0xa409('0x67')+_0x31d0bd;return db[_0xa409('0x5c')][_0xa409('0x38')](_0x59d6ec,{'type':db['Sequelize']['QueryTypes'][_0xa409('0x5f')],'raw':!![],'transaction':_0x13510f});})[_0xa409('0x2f')](function(_0x140aca){var _0x3caa6b=_[_0xa409('0x37')](_0x140aca,function(_0x266e17){return Number(_0x266e17['ChatQueueId']);});return db[_0xa409('0x68')][_0xa409('0x5b')]({'where':{'UserId':{'$in':_0x5cc7a3},'ChatQueueId':{'$in':_0x3caa6b}},'transaction':_0x13510f});})['then'](function(){var _0x362025=_0xa409('0x69')+_0x31d0bd;return db[_0xa409('0x5c')]['query'](_0x362025,{'type':db[_0xa409('0x64')][_0xa409('0x5e')][_0xa409('0x5f')],'raw':!![],'transaction':_0x13510f});})[_0xa409('0x2f')](function(_0x4e4c73){var _0x3790fd=_[_0xa409('0x37')](_0x4e4c73,function(_0x543bef){return Number(_0x543bef[_0xa409('0x6a')]);});return db['UserFaxQueue'][_0xa409('0x5b')]({'where':{'UserId':{'$in':_0x5cc7a3},'FaxQueueId':{'$in':_0x3790fd}},'transaction':_0x13510f});})[_0xa409('0x2f')](function(){var _0x1b7d88=_0xa409('0x6b')+_0x31d0bd;return db[_0xa409('0x5c')][_0xa409('0x38')](_0x1b7d88,{'type':db[_0xa409('0x64')][_0xa409('0x5e')][_0xa409('0x5f')],'raw':!![],'transaction':_0x13510f});})[_0xa409('0x2f')](function(_0x4b5580){var _0x50fe3d=_[_0xa409('0x37')](_0x4b5580,function(_0x27b229){return Number(_0x27b229[_0xa409('0x6c')]);});return db[_0xa409('0x6d')][_0xa409('0x5b')]({'where':{'UserId':{'$in':_0x5cc7a3},'OpenchannelQueueId':{'$in':_0x50fe3d}},'transaction':_0x13510f});})[_0xa409('0x2f')](function(){var _0x34625e=_0xa409('0x6e')+_0x31d0bd;return db[_0xa409('0x5c')][_0xa409('0x38')](_0x34625e,{'type':db['Sequelize'][_0xa409('0x5e')][_0xa409('0x5f')],'raw':!![],'transaction':_0x13510f});})[_0xa409('0x2f')](function(_0x325f77){var _0x123525=_[_0xa409('0x37')](_0x325f77,function(_0x46a470){return Number(_0x46a470[_0xa409('0x6f')]);});return db[_0xa409('0x70')][_0xa409('0x5b')]({'where':{'UserId':{'$in':_0x5cc7a3},'WhatsappQueueId':{'$in':_0x123525}},'transaction':_0x13510f});})['then'](function(){return db[_0xa409('0x71')][_0xa409('0x4f')]({'where':{'TeamId':_0x31d0bd}});})[_0xa409('0x2f')](function(_0x272bf3){if(_0x272bf3===null){return;}return db[_0xa409('0x72')][_0xa409('0x5b')]({'where':{'UserId':{'$in':_0x5cc7a3},'VoicePrefixId':_0x272bf3[_0xa409('0x73')]},'transaction':_0x13510f});})['then'](function(){return db['Team'][_0xa409('0x5b')]({'where':{'id':_0x31d0bd},'cascade':!![],'transaction':_0x13510f});})['then'](function(_0xb775fe){if(_0xb775fe===0x0){_0x3e2785[_0xa409('0x21')](0x194);}else{return db[_0xa409('0x59')][_0xa409('0x5b')]({'where':{'type':'Teams','resourceId':_0x31d0bd},'cascade':!![],'transaction':_0x13510f})[_0xa409('0x2f')](function(){_0x3e2785['status'](0xcc)[_0xa409('0x23')]();});}})['catch'](function(_0x508987){_0x3e2785[_0xa409('0x22')](0x1f4)['send'](_0x508987);});});};exports[_0xa409('0x74')]=function(_0x589faf,_0x431991,_0x4e6fa1){return db[_0xa409('0x45')]['findOne']({'where':{'id':_0x589faf[_0xa409('0x4a')]['id']}})[_0xa409('0x2f')](handleEntityNotFound(_0x431991,null))[_0xa409('0x2f')](function(_0x2609c6){if(!_0x589faf[_0xa409('0x38')]['channel']||!utils[_0xa409('0x75')](_0x589faf[_0xa409('0x38')][_0xa409('0x76')])){throw new db['Sequelize'][(_0xa409('0x77'))](_0xa409('0x78'));}var _0x5c29c3={};var _0x2b1919={};_0x2b1919[_0xa409('0x36')]=_[_0xa409('0x39')](db[_['capitalize'](_0x589faf[_0xa409('0x38')][_0xa409('0x76')][_0xa409('0x79')]())+_0xa409('0x7a')][_0xa409('0x33')]);_0x2b1919[_0xa409('0x38')]=_['keys'](_0x589faf[_0xa409('0x38')]);_0x2b1919['filters']=_['intersection'](_0x2b1919[_0xa409('0x36')],_0x2b1919[_0xa409('0x38')]);_0x5c29c3['attributes']=_[_0xa409('0x3b')](_0x2b1919[_0xa409('0x36')],qs[_0xa409('0x3c')](_0x589faf['query'][_0xa409('0x3c')]));_0x5c29c3['attributes']=_0x5c29c3[_0xa409('0x3d')]['length']?_0x5c29c3[_0xa409('0x3d')]:_0x2b1919[_0xa409('0x36')];_0x5c29c3['limit']=qs[_0xa409('0x27')](_0x589faf['query'][_0xa409('0x27')]);_0x5c29c3['offset']=qs['offset'](_0x589faf[_0xa409('0x38')]['offset']);_0x5c29c3[_0xa409('0x3f')]=qs[_0xa409('0x40')](_0x589faf[_0xa409('0x38')][_0xa409('0x40')]);_0x5c29c3['where']=qs[_0xa409('0x3a')](_[_0xa409('0x42')](_0x589faf[_0xa409('0x38')],_0x2b1919[_0xa409('0x3a')]));_0x5c29c3=_[_0xa409('0x4e')]({},_0x5c29c3,_0x589faf[_0xa409('0x44')]);return _0x2609c6['get'+_[_0xa409('0x7b')](_0x589faf[_0xa409('0x38')][_0xa409('0x76')][_0xa409('0x79')]())+_0xa409('0x7c')](_0x5c29c3);})['then'](respondWithResult(_0x431991,null))['catch'](handleError(_0x431991,null));};exports[_0xa409('0x7d')]=function(_0x1bf68f,_0x462aa8,_0x494e1f){return db['Team']['findOne']({'where':{'id':_0x1bf68f['params']['id']}})[_0xa409('0x2f')](function(_0x3f9503){if(_0x3f9503){if(!_0x1bf68f[_0xa409('0x51')][_0xa409('0x76')]||!utils['isValidChannel'](_0x1bf68f['body'][_0xa409('0x76')])){throw new db['Sequelize'][(_0xa409('0x77'))](_0xa409('0x78'));}return _0x3f9503['add'+_['capitalize'](_0x1bf68f[_0xa409('0x51')]['channel'][_0xa409('0x79')]())+_0xa409('0x7c')](_0x1bf68f[_0xa409('0x51')][_0xa409('0x7e')]);}return null;})['then'](handleEntityNotFound(_0x462aa8,null))[_0xa409('0x2f')](respondWithStatusCode(_0x462aa8,null))[_0xa409('0x48')](handleError(_0x462aa8,null));};exports['removeQueues']=function(_0x56abf8,_0x5327d1,_0x3c02a2){return db[_0xa409('0x45')][_0xa409('0x7f')]({'where':{'id':_0x56abf8[_0xa409('0x4a')]['id']}})[_0xa409('0x2f')](function(_0x50927a){if(_0x50927a){if(!_0x56abf8['query'][_0xa409('0x76')]||!utils[_0xa409('0x75')](_0x56abf8[_0xa409('0x38')][_0xa409('0x76')])){throw new db[(_0xa409('0x64'))][(_0xa409('0x77'))](_0xa409('0x78'));}return _0x50927a[_0xa409('0x80')+_[_0xa409('0x7b')](_0x56abf8[_0xa409('0x38')][_0xa409('0x76')][_0xa409('0x79')]())+_0xa409('0x7c')](_0x56abf8['query']['ids']);}return null;})['then'](handleEntityNotFound(_0x5327d1,null))[_0xa409('0x2f')](respondWithStatusCode(_0x5327d1,null))[_0xa409('0x48')](handleError(_0x5327d1,null));};exports['addAgents']=function(_0x7e5068,_0x45d22c){var _0x4b34fa=_[_0xa409('0x81')](_0x7e5068[_0xa409('0x51')]['ids'])?_0x7e5068[_0xa409('0x51')][_0xa409('0x7e')]:[_0x7e5068[_0xa409('0x51')]['ids']];var _0x55fd68=_0x7e5068['params']['id'];return db['Team']['find']({'where':{'id':_0x55fd68}})[_0xa409('0x2f')](handleEntityNotFound(_0x45d22c,null))['then'](function(_0x551545){if(_0x551545){var _0x5c722e=[_0xa409('0x82'),_0xa409('0x83'),'Mail',_0xa409('0x84'),_0xa409('0x85'),'Openchannel',_0xa409('0x86')];return db[_0xa409('0x5c')][_0xa409('0x5d')](function(_0x866124){var _0x4cd2db=_[_0xa409('0x37')](_0x5c722e,function(_0x1cbbc6){var _0x15c5f9={'attributes':['id','name']};if(_0x1cbbc6===_0xa409('0x82')){_0x15c5f9[_0xa409('0x87')]={'attributes':[_0xa409('0x88')]};}return _0x551545[_0xa409('0x55')+_0x1cbbc6+_0xa409('0x7c')](_0x15c5f9)[_0xa409('0x2f')](function(_0xb5f7b0){var _0x51ee4e=_[_0xa409('0x37')](_0xb5f7b0,function(_0x32aaa4){var _0x5b33be=_[_0xa409('0x37')](_0x4b34fa,function(_0x410863){var _0x5c42ad={'where':{'UserId':_0x410863,[_0x1cbbc6+_0xa409('0x89')]:_0x32aaa4['id']},'transaction':_0x866124};if(_0x1cbbc6==='Voice'){_0x5c42ad[_0xa409('0x1e')]={'penalty':_0x32aaa4[_0xa409('0x8a')][_0xa409('0x88')]};}return db[_0xa409('0x8b')+_0x1cbbc6+_0xa409('0x7a')][_0xa409('0x8c')](_0x5c42ad)[_0xa409('0x2f')](function(){socket[_0xa409('0x8d')](_0xa409('0x52')+_0x1cbbc6+_0xa409('0x8e'),{'UserId':_0x410863,[_0x1cbbc6+_0xa409('0x89')]:_0x32aaa4['id']});if(_0x1cbbc6!==_0xa409('0x82')){return;}return db[_0xa409('0x8b')][_0xa409('0x46')]({'where':{'id':_0x4b34fa,'online':0x1},'attributes':['id','name','online','voicePause',_0xa409('0x8f')],'raw':!![]})[_0xa409('0x2f')](function(_0x3631fe){var _0x3224d5=_['map'](_0x3631fe,function(_0x1bd8ba){return db['UserVoiceQueueRt'][_0xa409('0x90')]({'membername':_0x1bd8ba['name'],'UserId':_0x1bd8ba['id'],'queue_name':_0x32aaa4[_0xa409('0x31')],'VoiceQueueId':_0x32aaa4['id'],'interface':_[_0xa409('0x91')](_0x1bd8ba['interface'])?util['format'](_0xa409('0x92'),_0x1bd8ba[_0xa409('0x31')]):_0x1bd8ba[_0xa409('0x8f')],'paused':_0x1bd8ba[_0xa409('0x93')]||![],'penalty':_0x32aaa4[_0xa409('0x8a')][_0xa409('0x88')]},{'transaction':_0x866124});});return Promise['all'](_0x3224d5);});});});return Promise[_0xa409('0x94')](_0x5b33be);});return Promise[_0xa409('0x94')](_0x51ee4e);})['then'](function(){return db[_0xa409('0x71')][_0xa409('0x7f')]({'where':{'teamId':_0x55fd68}})[_0xa409('0x2f')](function(_0x42a383){if(_0x42a383){var _0x51d55a=_[_0xa409('0x37')](_0x4b34fa,function(_0x231c12){db[_0xa409('0x72')][_0xa409('0x90')]({'UserId':_0x231c12,'VoicePrefixId':_0x42a383[_0xa409('0x73')]});});return Promise[_0xa409('0x94')](_0x51d55a);}});});});return Promise[_0xa409('0x94')](_0x4cd2db)[_0xa409('0x2f')](function(){return _0x551545[_0xa409('0x95')](_0x4b34fa,{'transaction':_0x866124})[_0xa409('0x96')](function(_0xfca6a6){return _0xfca6a6;});});});}})[_0xa409('0x2f')](respondWithResult(_0x45d22c,null))[_0xa409('0x48')](handleError(_0x45d22c,null));};exports['removeAgents']=function(_0x1509b7,_0xaba8bb){var _0x3bc875=_[_0xa409('0x81')](_0x1509b7[_0xa409('0x38')][_0xa409('0x7e')])?_0x1509b7['query'][_0xa409('0x7e')]:[_0x1509b7[_0xa409('0x38')][_0xa409('0x7e')]];var _0x493af3=_0x1509b7[_0xa409('0x4a')]['id'];return db[_0xa409('0x45')]['find']({'where':{'id':_0x493af3}})[_0xa409('0x2f')](handleEntityNotFound(_0xaba8bb,null))[_0xa409('0x2f')](function(_0x3b13d7){if(_0x3b13d7){var _0x4b86ae=[_0xa409('0x82'),_0xa409('0x83'),'Mail',_0xa409('0x84'),_0xa409('0x85'),_0xa409('0x97'),_0xa409('0x86')];return db['sequelize'][_0xa409('0x5d')](function(_0x5609f8){var _0x5cf4f0=_[_0xa409('0x37')](_0x4b86ae,function(_0x1ed36b){var _0x3e97e7={'attributes':['id','name']};return _0x3b13d7['get'+_0x1ed36b+_0xa409('0x7c')](_0x3e97e7)[_0xa409('0x2f')](function(_0x47a566){var _0x402bbd=_[_0xa409('0x37')](_0x47a566,function(_0x4d569f){return _0x4d569f[_0xa409('0x98')](_0x3bc875,{'transaction':_0x5609f8})[_0xa409('0x2f')](function(){var _0x47b3ae=_[_0xa409('0x37')](_0x3bc875,function(_0x5eb9db){socket[_0xa409('0x8d')](_0xa409('0x52')+_0x1ed36b+_0xa409('0x99'),{'UserId':Number(_0x5eb9db),[_0x1ed36b+'QueueId']:_0x4d569f['id']});if(_0x1ed36b!==_0xa409('0x82')){return;}return db[_0xa409('0x9a')][_0xa409('0x5b')]({'where':{'VoiceQueueId':_0x4d569f['id'],'UserId':_0x5eb9db},'transaction':_0x5609f8});});return Promise[_0xa409('0x94')](_0x47b3ae);});});return Promise['all'](_0x402bbd);});});return Promise[_0xa409('0x94')](_0x5cf4f0)[_0xa409('0x2f')](function(){return _0x3b13d7[_0xa409('0x98')](_0x3bc875,{'transaction':_0x5609f8});})[_0xa409('0x2f')](function(){return db[_0xa409('0x71')][_0xa409('0x7f')]({'where':{'teamId':_0x493af3}})[_0xa409('0x2f')](function(_0x2e4b33){if(_0x2e4b33){var _0x1d9141=_[_0xa409('0x37')](_0x3bc875,function(_0xc7d904){db[_0xa409('0x72')][_0xa409('0x5b')]({'where':{'UserId':_0xc7d904,'VoicePrefixId':_0x2e4b33[_0xa409('0x73')]}});});return Promise[_0xa409('0x94')](_0x1d9141);}});});});}})['then'](respondWithStatusCode(_0xaba8bb,null))['catch'](handleError(_0xaba8bb,null));};exports[_0xa409('0x9b')]=function(_0x51c993,_0x568baf,_0x41324e){var _0x2ad87e={};var _0x360373={};var _0x13dfc9;var _0x938d7b;return db[_0xa409('0x45')][_0xa409('0x7f')]({'where':{'id':_0x51c993['params']['id']}})[_0xa409('0x2f')](handleEntityNotFound(_0x568baf,null))[_0xa409('0x2f')](function(_0x2f8492){if(_0x2f8492){_0x13dfc9=_0x2f8492;_0x360373['model']=_[_0xa409('0x39')](db['User'][_0xa409('0x33')]);_0x360373[_0xa409('0x38')]=_[_0xa409('0x39')](_0x51c993[_0xa409('0x38')]);_0x360373['filters']=_[_0xa409('0x3b')](_0x360373['model'],_0x360373[_0xa409('0x38')]);_0x2ad87e[_0xa409('0x3d')]=_[_0xa409('0x3b')](_0x360373[_0xa409('0x36')],qs[_0xa409('0x3c')](_0x51c993[_0xa409('0x38')][_0xa409('0x3c')]));_0x2ad87e[_0xa409('0x3d')]=_0x2ad87e[_0xa409('0x3d')]['length']?_0x2ad87e['attributes']:_0x360373['model'];_0x2ad87e[_0xa409('0x3f')]=qs[_0xa409('0x40')](_0x51c993[_0xa409('0x38')][_0xa409('0x40')]);_0x2ad87e[_0xa409('0x41')]=qs['filters'](_['pick'](_0x51c993[_0xa409('0x38')],_0x360373[_0xa409('0x3a')]));if(_0x51c993['query'][_0xa409('0x43')]){_0x2ad87e['where']=_[_0xa409('0x4e')](_0x2ad87e[_0xa409('0x41')],{'$or':_[_0xa409('0x37')](_0x2ad87e[_0xa409('0x3d')],function(_0x18062e){var _0x12f899={};_0x12f899[_0x18062e]={'$like':'%'+_0x51c993[_0xa409('0x38')]['filter']+'%'};return _0x12f899;})});}_0x2ad87e=_[_0xa409('0x4e')]({},_0x2ad87e,_0x51c993[_0xa409('0x44')]);return _0x13dfc9['getAgents'](_0x2ad87e);}})['then'](function(_0x11381c){if(_0x11381c){_0x938d7b=_0x11381c[_0xa409('0x4b')];if(!_0x51c993[_0xa409('0x38')][_0xa409('0x3e')](_0xa409('0x9c'))){_0x2ad87e[_0xa409('0x27')]=qs['limit'](_0x51c993[_0xa409('0x38')]['limit']);_0x2ad87e[_0xa409('0x25')]=qs['offset'](_0x51c993[_0xa409('0x38')]['offset']);}return _0x13dfc9['getAgents'](_0x2ad87e);}})[_0xa409('0x2f')](function(_0x9ac5b){if(_0x9ac5b){return _0x9ac5b?{'count':_0x938d7b,'rows':_0x9ac5b}:null;}})[_0xa409('0x2f')](respondWithResult(_0x568baf,null))[_0xa409('0x48')](handleError(_0x568baf,null));}; \ No newline at end of file +var _0x706b=['UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','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','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','options','Queues','addQueues','add','ids','removeQueues','remove','addAgents','isArray','Voice','Mail','Sms','Fax','Openchannel','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','emit','User','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','spread','removeAgents','Chat','Queue:remove','getAgents','nolimit','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','sendStatus','error','stack','name','send','index','map','fieldName','type','key','keys','intersection','model','query','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','Team','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','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','ChatQueueId'];(function(_0x199906,_0x4b2987){var _0x10722c=function(_0x3110da){while(--_0x3110da){_0x199906['push'](_0x199906['shift']());}};_0x10722c(++_0x4b2987);}(_0x706b,0xd6));var _0xb706=function(_0x9c4300,_0x1077c5){_0x9c4300=_0x9c4300-0x0;var _0x3cde86=_0x706b[_0x9c4300];return _0x3cde86;};'use strict';var emlformat=require(_0xb706('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb706('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb706('0x2'));var moment=require(_0xb706('0x3'));var BPromise=require(_0xb706('0x4'));var Mustache=require(_0xb706('0x5'));var util=require('util');var path=require(_0xb706('0x6'));var sox=require(_0xb706('0x7'));var csv=require(_0xb706('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb706('0x9'));var squel=require('squel');var crypto=require(_0xb706('0xa'));var jsforce=require(_0xb706('0xb'));var deskjs=require(_0xb706('0xc'));var toCsv=require(_0xb706('0x8'));var querystring=require(_0xb706('0xd'));var Papa=require(_0xb706('0xe'));var Redis=require('ioredis');var authService=require(_0xb706('0xf'));var qs=require(_0xb706('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb706('0x11'));var logger=require(_0xb706('0x12'))(_0xb706('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb706('0x14'));var db=require(_0xb706('0x15'))['db'];config[_0xb706('0x16')]=_[_0xb706('0x17')](config['redis'],{'host':_0xb706('0x18'),'port':0x18eb});var socket=require(_0xb706('0x19'))(new Redis(config[_0xb706('0x16')]));require(_0xb706('0x1a'))[_0xb706('0x1b')](socket);function respondWithStatusCode(_0x3fd850,_0x80d068){_0x80d068=_0x80d068||0xcc;return function(_0x2982d3){if(_0x2982d3){return _0x3fd850['sendStatus'](_0x80d068);}return _0x3fd850['status'](_0x80d068)[_0xb706('0x1c')]();};}function respondWithResult(_0x229f68,_0x3a276b){_0x3a276b=_0x3a276b||0xc8;return function(_0x428fb2){if(_0x428fb2){return _0x229f68[_0xb706('0x1d')](_0x3a276b)[_0xb706('0x1e')](_0x428fb2);}};}function respondWithFilteredResult(_0x48a9f9,_0x574cc8){return function(_0x21cef0){if(_0x21cef0){var _0x52d016=typeof _0x574cc8['offset']===_0xb706('0x1f')&&typeof _0x574cc8[_0xb706('0x20')]===_0xb706('0x1f');var _0xe8ded7=_0x21cef0[_0xb706('0x21')];var _0x36572a=_0x52d016?0x0:_0x574cc8[_0xb706('0x22')];var _0x31404f=_0x52d016?_0x21cef0[_0xb706('0x21')]:_0x574cc8[_0xb706('0x22')]+_0x574cc8[_0xb706('0x20')];var _0x10be07;if(_0x31404f>=_0xe8ded7){_0x31404f=_0xe8ded7;_0x10be07=0xc8;}else{_0x10be07=0xce;}_0x48a9f9[_0xb706('0x1d')](_0x10be07);return _0x48a9f9[_0xb706('0x23')](_0xb706('0x24'),_0x36572a+'-'+_0x31404f+'/'+_0xe8ded7)[_0xb706('0x1e')](_0x21cef0);}return null;};}function patchUpdates(_0x3fbb5b){return function(_0x8a2108){try{jsonpatch['apply'](_0x8a2108,_0x3fbb5b,!![]);}catch(_0x2bab97){return BPromise[_0xb706('0x25')](_0x2bab97);}return _0x8a2108['save']();};}function saveUpdates(_0x3eb8d1,_0x5e5e09){return function(_0x4b5225){if(_0x4b5225){return _0x4b5225[_0xb706('0x26')](_0x3eb8d1)[_0xb706('0x27')](function(_0x2154ea){return _0x2154ea;});}return null;};}function handleEntityNotFound(_0x5cd21a,_0x52e8f5){return function(_0x42bb6e){if(!_0x42bb6e){_0x5cd21a[_0xb706('0x28')](0x194);}return _0x42bb6e;};}function handleError(_0x10076a,_0xac7548){_0xac7548=_0xac7548||0x1f4;return function(_0x224b08){logger[_0xb706('0x29')](_0x224b08[_0xb706('0x2a')]);if(_0x224b08[_0xb706('0x2b')]){delete _0x224b08[_0xb706('0x2b')];}_0x10076a[_0xb706('0x1d')](_0xac7548)[_0xb706('0x2c')](_0x224b08);};}exports[_0xb706('0x2d')]=function(_0x5729c3,_0x276fec){var _0x217006={},_0x232a10={},_0x37e516={'count':0x0,'rows':[]};var _0x466e73=_[_0xb706('0x2e')](db['Team']['rawAttributes'],function(_0x3e442a){return{'name':_0x3e442a[_0xb706('0x2f')],'type':_0x3e442a[_0xb706('0x30')][_0xb706('0x31')]};});_0x232a10['model']=_['map'](_0x466e73,'name');_0x232a10['query']=_[_0xb706('0x32')](_0x5729c3['query']);_0x232a10['filters']=_[_0xb706('0x33')](_0x232a10[_0xb706('0x34')],_0x232a10[_0xb706('0x35')]);_0x217006[_0xb706('0x36')]=_['intersection'](_0x232a10[_0xb706('0x34')],qs['fields'](_0x5729c3['query'][_0xb706('0x37')]));_0x217006[_0xb706('0x36')]=_0x217006[_0xb706('0x36')][_0xb706('0x38')]?_0x217006[_0xb706('0x36')]:_0x232a10[_0xb706('0x34')];if(!_0x5729c3[_0xb706('0x35')][_0xb706('0x39')]('nolimit')){_0x217006[_0xb706('0x20')]=qs[_0xb706('0x20')](_0x5729c3['query'][_0xb706('0x20')]);_0x217006[_0xb706('0x22')]=qs['offset'](_0x5729c3[_0xb706('0x35')]['offset']);}_0x217006[_0xb706('0x3a')]=qs[_0xb706('0x3b')](_0x5729c3['query'][_0xb706('0x3b')]);_0x217006['where']=qs[_0xb706('0x3c')](_[_0xb706('0x3d')](_0x5729c3['query'],_0x232a10['filters']),_0x466e73);if(_0x5729c3['query'][_0xb706('0x3e')]){_0x217006[_0xb706('0x3f')]=_[_0xb706('0x40')](_0x217006['where'],{'$or':_[_0xb706('0x2e')](_0x466e73,function(_0x5e0275){if(_0x5e0275[_0xb706('0x30')]!==_0xb706('0x41')){var _0x455cf0={};_0x455cf0[_0x5e0275[_0xb706('0x2b')]]={'$like':'%'+_0x5729c3[_0xb706('0x35')][_0xb706('0x3e')]+'%'};return _0x455cf0;}})});}_0x217006=_[_0xb706('0x40')]({},_0x217006,_0x5729c3['options']);var _0x20c95c={'where':_0x217006['where']};return db[_0xb706('0x42')][_0xb706('0x21')](_0x20c95c)[_0xb706('0x27')](function(_0x3fb4d0){_0x37e516['count']=_0x3fb4d0;if(_0x5729c3[_0xb706('0x35')][_0xb706('0x43')]){_0x217006['include']=[{'all':!![]}];}return db['Team'][_0xb706('0x44')](_0x217006);})[_0xb706('0x27')](function(_0xe5c991){_0x37e516[_0xb706('0x45')]=_0xe5c991;return _0x37e516;})[_0xb706('0x27')](respondWithFilteredResult(_0x276fec,_0x217006))[_0xb706('0x46')](handleError(_0x276fec,null));};exports['show']=function(_0x128aaa,_0x3a1f55){var _0x3a88b7={'raw':![],'where':{'id':_0x128aaa[_0xb706('0x47')]['id']}},_0x3950a6={};_0x3950a6[_0xb706('0x34')]=_[_0xb706('0x32')](db[_0xb706('0x42')][_0xb706('0x48')]);_0x3950a6[_0xb706('0x35')]=_[_0xb706('0x32')](_0x128aaa[_0xb706('0x35')]);_0x3950a6[_0xb706('0x3c')]=_['intersection'](_0x3950a6[_0xb706('0x34')],_0x3950a6[_0xb706('0x35')]);_0x3a88b7[_0xb706('0x36')]=_[_0xb706('0x33')](_0x3950a6[_0xb706('0x34')],qs[_0xb706('0x37')](_0x128aaa[_0xb706('0x35')]['fields']));_0x3a88b7['attributes']=_0x3a88b7[_0xb706('0x36')][_0xb706('0x38')]?_0x3a88b7[_0xb706('0x36')]:_0x3950a6[_0xb706('0x34')];if(_0x128aaa[_0xb706('0x35')]['includeAll']){_0x3a88b7[_0xb706('0x49')]=[{'all':!![]}];}_0x3a88b7=_[_0xb706('0x40')]({},_0x3a88b7,_0x128aaa['options']);return db['Team'][_0xb706('0x4a')](_0x3a88b7)[_0xb706('0x27')](handleEntityNotFound(_0x3a1f55,null))[_0xb706('0x27')](respondWithResult(_0x3a1f55,null))[_0xb706('0x46')](handleError(_0x3a1f55,null));};exports['create']=function(_0x39291d,_0x45c7c3){return db[_0xb706('0x42')][_0xb706('0x4b')](_0x39291d[_0xb706('0x4c')],{})[_0xb706('0x27')](function(_0x4200fc){var _0x128c2e=_0x39291d['user'][_0xb706('0x4d')]({'plain':!![]});if(!_0x128c2e)throw new Error(_0xb706('0x4e'));if(_0x128c2e['role']===_0xb706('0x4f')){var _0xc9b97=_0x4200fc[_0xb706('0x4d')]({'plain':!![]});var _0x384ffd='Teams';return db[_0xb706('0x50')][_0xb706('0x4a')]({'where':{'name':_0x384ffd,'userProfileId':_0x128c2e[_0xb706('0x51')]},'raw':!![]})[_0xb706('0x27')](function(_0x3b64bc){if(_0x3b64bc&&_0x3b64bc[_0xb706('0x52')]===0x0){return db[_0xb706('0x53')][_0xb706('0x4b')]({'name':_0xc9b97[_0xb706('0x2b')],'resourceId':_0xc9b97['id'],'type':_0x3b64bc[_0xb706('0x2b')],'sectionId':_0x3b64bc['id']},{})[_0xb706('0x27')](function(){return _0x4200fc;});}else{return _0x4200fc;}})[_0xb706('0x46')](function(_0x540f00){logger['error'](_0xb706('0x54'),_0x540f00);throw _0x540f00;});}return _0x4200fc;})[_0xb706('0x27')](respondWithResult(_0x45c7c3,0xc9))[_0xb706('0x46')](handleError(_0x45c7c3,null));};exports[_0xb706('0x26')]=function(_0x4ccb8b,_0x2b3920){if(_0x4ccb8b[_0xb706('0x4c')]['id']){delete _0x4ccb8b['body']['id'];}return db[_0xb706('0x42')]['find']({'where':{'id':_0x4ccb8b['params']['id']}})[_0xb706('0x27')](handleEntityNotFound(_0x2b3920,null))[_0xb706('0x27')](saveUpdates(_0x4ccb8b[_0xb706('0x4c')],null))[_0xb706('0x27')](respondWithResult(_0x2b3920,null))['catch'](handleError(_0x2b3920,null));};exports[_0xb706('0x55')]=function(_0x5b8e26,_0x5c8bb2){var _0x53bf3d=_0x5b8e26[_0xb706('0x47')]['id'];var _0x2d192d=[];return db[_0xb706('0x56')][_0xb706('0x57')](function(_0x1dd50d){var _0x300a7a='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x53bf3d;return db[_0xb706('0x56')][_0xb706('0x35')](_0x300a7a,{'type':db['Sequelize']['QueryTypes'][_0xb706('0x58')],'raw':!![],'transaction':_0x1dd50d})[_0xb706('0x27')](function(_0xb88b5c){_0x2d192d=_['map'](_0xb88b5c,function(_0x27a9b3){return Number(_0x27a9b3[_0xb706('0x59')]);});})[_0xb706('0x27')](function(){var _0x4cccbd=_0xb706('0x5a')+_0x53bf3d;return db[_0xb706('0x56')][_0xb706('0x35')](_0x4cccbd,{'type':db['Sequelize'][_0xb706('0x5b')]['SELECT'],'raw':!![],'transaction':_0x1dd50d});})['then'](function(_0x20179d){var _0x1494bf=_[_0xb706('0x2e')](_0x20179d,function(_0x28435e){return Number(_0x28435e['VoiceQueueId']);});return db['UserVoiceQueue']['destroy']({'where':{'UserId':{'$in':_0x2d192d},'VoiceQueueId':{'$in':_0x1494bf}},'transaction':_0x1dd50d});})[_0xb706('0x27')](function(){var _0x1d7b28=_0xb706('0x5c')+_0x53bf3d;return db[_0xb706('0x56')][_0xb706('0x35')](_0x1d7b28,{'type':db['Sequelize'][_0xb706('0x5b')][_0xb706('0x58')],'raw':!![],'transaction':_0x1dd50d});})[_0xb706('0x27')](function(_0x599165){var _0x526dca=_[_0xb706('0x2e')](_0x599165,function(_0x148933){return Number(_0x148933[_0xb706('0x5d')]);});return db[_0xb706('0x5e')][_0xb706('0x55')]({'where':{'UserId':{'$in':_0x2d192d},'MailQueueId':{'$in':_0x526dca}},'transaction':_0x1dd50d});})['then'](function(){var _0x307075=_0xb706('0x5f')+_0x53bf3d;return db[_0xb706('0x56')][_0xb706('0x35')](_0x307075,{'type':db['Sequelize'][_0xb706('0x5b')][_0xb706('0x58')],'raw':!![],'transaction':_0x1dd50d});})[_0xb706('0x27')](function(_0x25e29f){var _0x42d6c7=_[_0xb706('0x2e')](_0x25e29f,function(_0x41fe96){return Number(_0x41fe96['SmsQueueId']);});return db[_0xb706('0x60')]['destroy']({'where':{'UserId':{'$in':_0x2d192d},'SmsQueueId':{'$in':_0x42d6c7}},'transaction':_0x1dd50d});})['then'](function(){var _0x223c53='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x53bf3d;return db[_0xb706('0x56')][_0xb706('0x35')](_0x223c53,{'type':db['Sequelize'][_0xb706('0x5b')][_0xb706('0x58')],'raw':!![],'transaction':_0x1dd50d});})[_0xb706('0x27')](function(_0x13a109){var _0x4d9d14=_[_0xb706('0x2e')](_0x13a109,function(_0x1abfc9){return Number(_0x1abfc9[_0xb706('0x61')]);});return db[_0xb706('0x62')][_0xb706('0x55')]({'where':{'UserId':{'$in':_0x2d192d},'ChatQueueId':{'$in':_0x4d9d14}},'transaction':_0x1dd50d});})[_0xb706('0x27')](function(){var _0x47dbaf=_0xb706('0x63')+_0x53bf3d;return db[_0xb706('0x56')][_0xb706('0x35')](_0x47dbaf,{'type':db[_0xb706('0x64')][_0xb706('0x5b')][_0xb706('0x58')],'raw':!![],'transaction':_0x1dd50d});})[_0xb706('0x27')](function(_0x1b36f5){var _0x3fa7aa=_['map'](_0x1b36f5,function(_0x273fe6){return Number(_0x273fe6[_0xb706('0x65')]);});return db[_0xb706('0x66')][_0xb706('0x55')]({'where':{'UserId':{'$in':_0x2d192d},'FaxQueueId':{'$in':_0x3fa7aa}},'transaction':_0x1dd50d});})[_0xb706('0x27')](function(){var _0x1b568d=_0xb706('0x67')+_0x53bf3d;return db[_0xb706('0x56')][_0xb706('0x35')](_0x1b568d,{'type':db['Sequelize'][_0xb706('0x5b')][_0xb706('0x58')],'raw':!![],'transaction':_0x1dd50d});})[_0xb706('0x27')](function(_0x103dd5){var _0x1703ef=_[_0xb706('0x2e')](_0x103dd5,function(_0x40eb9c){return Number(_0x40eb9c[_0xb706('0x68')]);});return db[_0xb706('0x69')][_0xb706('0x55')]({'where':{'UserId':{'$in':_0x2d192d},'OpenchannelQueueId':{'$in':_0x1703ef}},'transaction':_0x1dd50d});})[_0xb706('0x27')](function(){var _0x44215f=_0xb706('0x6a')+_0x53bf3d;return db[_0xb706('0x56')]['query'](_0x44215f,{'type':db[_0xb706('0x64')][_0xb706('0x5b')][_0xb706('0x58')],'raw':!![],'transaction':_0x1dd50d});})[_0xb706('0x27')](function(_0x4a8d1a){var _0x2803c5=_['map'](_0x4a8d1a,function(_0x11b1af){return Number(_0x11b1af[_0xb706('0x6b')]);});return db[_0xb706('0x6c')][_0xb706('0x55')]({'where':{'UserId':{'$in':_0x2d192d},'WhatsappQueueId':{'$in':_0x2803c5}},'transaction':_0x1dd50d});})['then'](function(){return db[_0xb706('0x6d')]['find']({'where':{'TeamId':_0x53bf3d}});})['then'](function(_0x563536){if(_0x563536===null){return;}return db[_0xb706('0x6e')][_0xb706('0x55')]({'where':{'UserId':{'$in':_0x2d192d},'VoicePrefixId':_0x563536[_0xb706('0x6f')]},'transaction':_0x1dd50d});})[_0xb706('0x27')](function(){return db[_0xb706('0x42')]['destroy']({'where':{'id':_0x53bf3d},'cascade':!![],'transaction':_0x1dd50d});})[_0xb706('0x27')](function(_0x13521e){if(_0x13521e===0x0){_0x5c8bb2['sendStatus'](0x194);}else{return db['UserProfileResource'][_0xb706('0x55')]({'where':{'type':'Teams','resourceId':_0x53bf3d},'cascade':!![],'transaction':_0x1dd50d})[_0xb706('0x27')](function(){_0x5c8bb2['status'](0xcc)['end']();});}})[_0xb706('0x46')](function(_0x304b0f){_0x5c8bb2[_0xb706('0x1d')](0x1f4)[_0xb706('0x2c')](_0x304b0f);});});};exports['getQueues']=function(_0x3f2693,_0x4c3367,_0x542e08){return db[_0xb706('0x42')][_0xb706('0x70')]({'where':{'id':_0x3f2693[_0xb706('0x47')]['id']}})[_0xb706('0x27')](handleEntityNotFound(_0x4c3367,null))['then'](function(_0x14fa0c){if(!_0x3f2693[_0xb706('0x35')][_0xb706('0x71')]||!utils[_0xb706('0x72')](_0x3f2693[_0xb706('0x35')][_0xb706('0x71')])){throw new db[(_0xb706('0x64'))][(_0xb706('0x73'))](_0xb706('0x74'));}var _0xf66dc={};var _0x4f8973={};_0x4f8973[_0xb706('0x34')]=_[_0xb706('0x32')](db[_[_0xb706('0x75')](_0x3f2693['query'][_0xb706('0x71')][_0xb706('0x76')]())+_0xb706('0x77')][_0xb706('0x48')]);_0x4f8973['query']=_[_0xb706('0x32')](_0x3f2693['query']);_0x4f8973[_0xb706('0x3c')]=_[_0xb706('0x33')](_0x4f8973[_0xb706('0x34')],_0x4f8973[_0xb706('0x35')]);_0xf66dc[_0xb706('0x36')]=_[_0xb706('0x33')](_0x4f8973[_0xb706('0x34')],qs[_0xb706('0x37')](_0x3f2693['query']['fields']));_0xf66dc[_0xb706('0x36')]=_0xf66dc[_0xb706('0x36')][_0xb706('0x38')]?_0xf66dc['attributes']:_0x4f8973[_0xb706('0x34')];_0xf66dc[_0xb706('0x20')]=qs[_0xb706('0x20')](_0x3f2693[_0xb706('0x35')]['limit']);_0xf66dc[_0xb706('0x22')]=qs['offset'](_0x3f2693[_0xb706('0x35')][_0xb706('0x22')]);_0xf66dc[_0xb706('0x3a')]=qs[_0xb706('0x3b')](_0x3f2693['query'][_0xb706('0x3b')]);_0xf66dc[_0xb706('0x3f')]=qs['filters'](_['pick'](_0x3f2693[_0xb706('0x35')],_0x4f8973[_0xb706('0x3c')]));_0xf66dc=_[_0xb706('0x40')]({},_0xf66dc,_0x3f2693[_0xb706('0x78')]);return _0x14fa0c[_0xb706('0x4d')+_[_0xb706('0x75')](_0x3f2693[_0xb706('0x35')][_0xb706('0x71')]['toLowerCase']())+_0xb706('0x79')](_0xf66dc);})[_0xb706('0x27')](respondWithResult(_0x4c3367,null))[_0xb706('0x46')](handleError(_0x4c3367,null));};exports[_0xb706('0x7a')]=function(_0x54e4c5,_0x283f5c,_0x20e52b){return db['Team'][_0xb706('0x70')]({'where':{'id':_0x54e4c5[_0xb706('0x47')]['id']}})[_0xb706('0x27')](function(_0x1950d9){if(_0x1950d9){if(!_0x54e4c5[_0xb706('0x4c')][_0xb706('0x71')]||!utils[_0xb706('0x72')](_0x54e4c5[_0xb706('0x4c')][_0xb706('0x71')])){throw new db['Sequelize'][(_0xb706('0x73'))](_0xb706('0x74'));}return _0x1950d9[_0xb706('0x7b')+_[_0xb706('0x75')](_0x54e4c5['body'][_0xb706('0x71')][_0xb706('0x76')]())+_0xb706('0x79')](_0x54e4c5[_0xb706('0x4c')][_0xb706('0x7c')]);}return null;})['then'](handleEntityNotFound(_0x283f5c,null))[_0xb706('0x27')](respondWithStatusCode(_0x283f5c,null))[_0xb706('0x46')](handleError(_0x283f5c,null));};exports[_0xb706('0x7d')]=function(_0x1a754a,_0xe874f7,_0x2bff26){return db['Team']['findOne']({'where':{'id':_0x1a754a[_0xb706('0x47')]['id']}})['then'](function(_0x581c73){if(_0x581c73){if(!_0x1a754a[_0xb706('0x35')][_0xb706('0x71')]||!utils[_0xb706('0x72')](_0x1a754a[_0xb706('0x35')][_0xb706('0x71')])){throw new db[(_0xb706('0x64'))][(_0xb706('0x73'))](_0xb706('0x74'));}return _0x581c73[_0xb706('0x7e')+_[_0xb706('0x75')](_0x1a754a[_0xb706('0x35')][_0xb706('0x71')]['toLowerCase']())+'Queues'](_0x1a754a[_0xb706('0x35')][_0xb706('0x7c')]);}return null;})[_0xb706('0x27')](handleEntityNotFound(_0xe874f7,null))[_0xb706('0x27')](respondWithStatusCode(_0xe874f7,null))[_0xb706('0x46')](handleError(_0xe874f7,null));};exports[_0xb706('0x7f')]=function(_0x1f7b17,_0x3914fa){var _0x265751=_[_0xb706('0x80')](_0x1f7b17[_0xb706('0x4c')][_0xb706('0x7c')])?_0x1f7b17[_0xb706('0x4c')]['ids']:[_0x1f7b17[_0xb706('0x4c')][_0xb706('0x7c')]];var _0x5e54d4=_0x1f7b17[_0xb706('0x47')]['id'];return db[_0xb706('0x42')][_0xb706('0x4a')]({'where':{'id':_0x5e54d4}})[_0xb706('0x27')](handleEntityNotFound(_0x3914fa,null))[_0xb706('0x27')](function(_0x37c014){if(_0x37c014){var _0x25cf54=[_0xb706('0x81'),'Chat',_0xb706('0x82'),_0xb706('0x83'),_0xb706('0x84'),_0xb706('0x85'),_0xb706('0x86')];return db[_0xb706('0x56')]['transaction'](function(_0x41b16e){var _0x304dc0=_['map'](_0x25cf54,function(_0x2ad64b){var _0xbb0c80={'attributes':['id',_0xb706('0x2b')]};if(_0x2ad64b===_0xb706('0x81')){_0xbb0c80[_0xb706('0x87')]={'attributes':[_0xb706('0x88')]};}return _0x37c014[_0xb706('0x4d')+_0x2ad64b+_0xb706('0x79')](_0xbb0c80)[_0xb706('0x27')](function(_0x14891c){var _0x29d760=_[_0xb706('0x2e')](_0x14891c,function(_0x2cd2c9){var _0x298f7e=_[_0xb706('0x2e')](_0x265751,function(_0xfc67d6){var _0x1d6031={'where':{'UserId':_0xfc67d6,[_0x2ad64b+_0xb706('0x89')]:_0x2cd2c9['id']},'transaction':_0x41b16e};if(_0x2ad64b===_0xb706('0x81')){_0x1d6031[_0xb706('0x17')]={'penalty':_0x2cd2c9[_0xb706('0x8a')][_0xb706('0x88')]};}return db['User'+_0x2ad64b+_0xb706('0x77')]['findOrCreate'](_0x1d6031)[_0xb706('0x27')](function(){socket[_0xb706('0x8b')](_0xb706('0x4f')+_0x2ad64b+'Queue:save',{'UserId':_0xfc67d6,[_0x2ad64b+'QueueId']:_0x2cd2c9['id']});if(_0x2ad64b!==_0xb706('0x81')){return;}return db[_0xb706('0x8c')][_0xb706('0x44')]({'where':{'id':_0x265751,'online':0x1},'attributes':['id',_0xb706('0x2b'),_0xb706('0x8d'),_0xb706('0x8e'),_0xb706('0x8f')],'raw':!![]})[_0xb706('0x27')](function(_0x1d2fd1){var _0x20008d=_[_0xb706('0x2e')](_0x1d2fd1,function(_0x36be12){return db[_0xb706('0x90')][_0xb706('0x91')]({'membername':_0x36be12['name'],'UserId':_0x36be12['id'],'queue_name':_0x2cd2c9[_0xb706('0x2b')],'VoiceQueueId':_0x2cd2c9['id'],'interface':_[_0xb706('0x92')](_0x36be12[_0xb706('0x8f')])?util[_0xb706('0x93')](_0xb706('0x94'),_0x36be12[_0xb706('0x2b')]):_0x36be12[_0xb706('0x8f')],'paused':_0x36be12[_0xb706('0x8e')]||![],'penalty':_0x2cd2c9[_0xb706('0x8a')][_0xb706('0x88')]},{'transaction':_0x41b16e});});return Promise['all'](_0x20008d);});});});return Promise[_0xb706('0x95')](_0x298f7e);});return Promise[_0xb706('0x95')](_0x29d760);})[_0xb706('0x27')](function(){return db[_0xb706('0x6d')][_0xb706('0x70')]({'where':{'teamId':_0x5e54d4}})['then'](function(_0xa1958f){if(_0xa1958f){var _0x1bf671=_[_0xb706('0x2e')](_0x265751,function(_0x7bdf0b){db[_0xb706('0x6e')][_0xb706('0x91')]({'UserId':_0x7bdf0b,'VoicePrefixId':_0xa1958f[_0xb706('0x6f')]});});return Promise[_0xb706('0x95')](_0x1bf671);}});});});return Promise['all'](_0x304dc0)[_0xb706('0x27')](function(){return _0x37c014[_0xb706('0x7f')](_0x265751,{'transaction':_0x41b16e})[_0xb706('0x96')](function(_0xf56328){return _0xf56328;});});});}})[_0xb706('0x27')](respondWithResult(_0x3914fa,null))[_0xb706('0x46')](handleError(_0x3914fa,null));};exports[_0xb706('0x97')]=function(_0x5b3ef2,_0x400b9c){var _0x179d25=_[_0xb706('0x80')](_0x5b3ef2['query'][_0xb706('0x7c')])?_0x5b3ef2[_0xb706('0x35')][_0xb706('0x7c')]:[_0x5b3ef2[_0xb706('0x35')][_0xb706('0x7c')]];var _0x3cd687=_0x5b3ef2[_0xb706('0x47')]['id'];return db['Team'][_0xb706('0x4a')]({'where':{'id':_0x3cd687}})[_0xb706('0x27')](handleEntityNotFound(_0x400b9c,null))[_0xb706('0x27')](function(_0x5b2a57){if(_0x5b2a57){var _0x1188e2=[_0xb706('0x81'),_0xb706('0x98'),_0xb706('0x82'),_0xb706('0x83'),_0xb706('0x84'),_0xb706('0x85'),_0xb706('0x86')];return db['sequelize']['transaction'](function(_0x3edc7a){var _0x357126=_['map'](_0x1188e2,function(_0x700c0d){var _0x134cdf={'attributes':['id',_0xb706('0x2b')]};return _0x5b2a57[_0xb706('0x4d')+_0x700c0d+'Queues'](_0x134cdf)['then'](function(_0x5d4ab2){var _0x40d687=_[_0xb706('0x2e')](_0x5d4ab2,function(_0x277274){return _0x277274[_0xb706('0x97')](_0x179d25,{'transaction':_0x3edc7a})[_0xb706('0x27')](function(){var _0x4f7ea8=_[_0xb706('0x2e')](_0x179d25,function(_0xcdd34b){socket[_0xb706('0x8b')](_0xb706('0x4f')+_0x700c0d+_0xb706('0x99'),{'UserId':Number(_0xcdd34b),[_0x700c0d+_0xb706('0x89')]:_0x277274['id']});if(_0x700c0d!=='Voice'){return;}return db[_0xb706('0x90')]['destroy']({'where':{'VoiceQueueId':_0x277274['id'],'UserId':_0xcdd34b},'transaction':_0x3edc7a});});return Promise[_0xb706('0x95')](_0x4f7ea8);});});return Promise[_0xb706('0x95')](_0x40d687);});});return Promise[_0xb706('0x95')](_0x357126)[_0xb706('0x27')](function(){return _0x5b2a57['removeAgents'](_0x179d25,{'transaction':_0x3edc7a});})[_0xb706('0x27')](function(){return db[_0xb706('0x6d')][_0xb706('0x70')]({'where':{'teamId':_0x3cd687}})['then'](function(_0x5431b3){if(_0x5431b3){var _0x211d92=_[_0xb706('0x2e')](_0x179d25,function(_0x500b49){db[_0xb706('0x6e')][_0xb706('0x55')]({'where':{'UserId':_0x500b49,'VoicePrefixId':_0x5431b3[_0xb706('0x6f')]}});});return Promise[_0xb706('0x95')](_0x211d92);}});});});}})['then'](respondWithStatusCode(_0x400b9c,null))[_0xb706('0x46')](handleError(_0x400b9c,null));};exports[_0xb706('0x9a')]=function(_0x1750e0,_0x4c3e0b,_0x14dd6b){var _0x1ff077={};var _0x1f98be={};var _0x43a2a0;var _0x4e6ca9;return db[_0xb706('0x42')][_0xb706('0x70')]({'where':{'id':_0x1750e0[_0xb706('0x47')]['id']}})['then'](handleEntityNotFound(_0x4c3e0b,null))[_0xb706('0x27')](function(_0x54228d){if(_0x54228d){_0x43a2a0=_0x54228d;_0x1f98be[_0xb706('0x34')]=_['keys'](db['User'][_0xb706('0x48')]);_0x1f98be[_0xb706('0x35')]=_[_0xb706('0x32')](_0x1750e0['query']);_0x1f98be[_0xb706('0x3c')]=_['intersection'](_0x1f98be[_0xb706('0x34')],_0x1f98be[_0xb706('0x35')]);_0x1ff077[_0xb706('0x36')]=_[_0xb706('0x33')](_0x1f98be[_0xb706('0x34')],qs[_0xb706('0x37')](_0x1750e0[_0xb706('0x35')]['fields']));_0x1ff077[_0xb706('0x36')]=_0x1ff077[_0xb706('0x36')][_0xb706('0x38')]?_0x1ff077[_0xb706('0x36')]:_0x1f98be['model'];_0x1ff077['order']=qs[_0xb706('0x3b')](_0x1750e0[_0xb706('0x35')]['sort']);_0x1ff077[_0xb706('0x3f')]=qs['filters'](_['pick'](_0x1750e0[_0xb706('0x35')],_0x1f98be[_0xb706('0x3c')]));if(_0x1750e0[_0xb706('0x35')][_0xb706('0x3e')]){_0x1ff077[_0xb706('0x3f')]=_['merge'](_0x1ff077[_0xb706('0x3f')],{'$or':_['map'](_0x1ff077['attributes'],function(_0x4f9d7d){var _0x24b3c3={};_0x24b3c3[_0x4f9d7d]={'$like':'%'+_0x1750e0[_0xb706('0x35')][_0xb706('0x3e')]+'%'};return _0x24b3c3;})});}_0x1ff077=_['merge']({},_0x1ff077,_0x1750e0[_0xb706('0x78')]);return _0x43a2a0[_0xb706('0x9a')](_0x1ff077);}})['then'](function(_0x5b013d){if(_0x5b013d){_0x4e6ca9=_0x5b013d[_0xb706('0x38')];if(!_0x1750e0['query']['hasOwnProperty'](_0xb706('0x9b'))){_0x1ff077[_0xb706('0x20')]=qs['limit'](_0x1750e0['query']['limit']);_0x1ff077['offset']=qs[_0xb706('0x22')](_0x1750e0[_0xb706('0x35')][_0xb706('0x22')]);}return _0x43a2a0[_0xb706('0x9a')](_0x1ff077);}})[_0xb706('0x27')](function(_0x49ab4d){if(_0x49ab4d){return _0x49ab4d?{'count':_0x4e6ca9,'rows':_0x49ab4d}:null;}})[_0xb706('0x27')](respondWithResult(_0x4c3e0b,null))['catch'](handleError(_0x4c3e0b,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index e3c0917..1f13d8c 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 _0x74a7=['hasOwnProperty','exports','events','../../mysqldb','Team','setMaxListeners','save','update','remove','emit'];(function(_0x174287,_0x41543a){var _0x48b532=function(_0x207d5b){while(--_0x207d5b){_0x174287['push'](_0x174287['shift']());}};_0x48b532(++_0x41543a);}(_0x74a7,0x106));var _0x774a=function(_0x923007,_0x3db4bf){_0x923007=_0x923007-0x0;var _0x359d90=_0x74a7[_0x923007];return _0x359d90;};'use strict';var EventEmitter=require(_0x774a('0x0'));var Team=require(_0x774a('0x1'))['db'][_0x774a('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x774a('0x3')](0x0);var events={'afterCreate':_0x774a('0x4'),'afterUpdate':_0x774a('0x5'),'afterDestroy':_0x774a('0x6')};function emitEvent(_0xd86486){return function(_0x37efa7,_0x5e4b97,_0x1074b6){TeamEvents[_0x774a('0x7')](_0xd86486+':'+_0x37efa7['id'],_0x37efa7);TeamEvents[_0x774a('0x7')](_0xd86486,_0x37efa7);_0x1074b6(null);};}for(var e in events){if(events[_0x774a('0x8')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x774a('0x9')]=TeamEvents; \ No newline at end of file +var _0x8b54=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','save','update'];(function(_0x3a678e,_0x4d297c){var _0x2e62e7=function(_0x8cf1a9){while(--_0x8cf1a9){_0x3a678e['push'](_0x3a678e['shift']());}};_0x2e62e7(++_0x4d297c);}(_0x8b54,0x1bc));var _0x48b5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8b54[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x48b5('0x0'));var Team=require(_0x48b5('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x48b5('0x2'),'afterUpdate':_0x48b5('0x3'),'afterDestroy':_0x48b5('0x4')};function emitEvent(_0xa52246){return function(_0x351212,_0x5227a8,_0x3f7f55){TeamEvents['emit'](_0xa52246+':'+_0x351212['id'],_0x351212);TeamEvents[_0x48b5('0x5')](_0xa52246,_0x351212);_0x3f7f55(null);};}for(var e in events){if(events[_0x48b5('0x6')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x48b5('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 3da3eee..8e54317 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 _0x701c=['../../config/environment','./team.attributes','exports','define','Team','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x7c3555,_0x514fd9){var _0x49c4dc=function(_0x3530fb){while(--_0x3530fb){_0x7c3555['push'](_0x7c3555['shift']());}};_0x49c4dc(++_0x514fd9);}(_0x701c,0x130));var _0xc701=function(_0x53fc13,_0x5e225d){_0x53fc13=_0x53fc13-0x0;var _0x5e5a5e=_0x701c[_0x53fc13];return _0x5e5a5e;};'use strict';var _=require(_0xc701('0x0'));var util=require('util');var logger=require(_0xc701('0x1'))(_0xc701('0x2'));var moment=require(_0xc701('0x3'));var BPromise=require(_0xc701('0x4'));var rp=require(_0xc701('0x5'));var fs=require('fs');var path=require(_0xc701('0x6'));var rimraf=require(_0xc701('0x7'));var config=require(_0xc701('0x8'));var attributes=require(_0xc701('0x9'));module[_0xc701('0xa')]=function(_0x1b600b,_0x4bd723){return _0x1b600b[_0xc701('0xb')](_0xc701('0xc'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe3f=['bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','exports','define','Team','lodash','../../config/logger','moment'];(function(_0x22d5ca,_0x418dbd){var _0x43d2bf=function(_0x179762){while(--_0x179762){_0x22d5ca['push'](_0x22d5ca['shift']());}};_0x43d2bf(++_0x418dbd);}(_0xfe3f,0x75));var _0xffe3=function(_0xc7e8c1,_0x412a01){_0xc7e8c1=_0xc7e8c1-0x0;var _0x30d27a=_0xfe3f[_0xc7e8c1];return _0x30d27a;};'use strict';var _=require(_0xffe3('0x0'));var util=require('util');var logger=require(_0xffe3('0x1'))('api');var moment=require(_0xffe3('0x2'));var BPromise=require(_0xffe3('0x3'));var rp=require(_0xffe3('0x4'));var fs=require('fs');var path=require(_0xffe3('0x5'));var rimraf=require(_0xffe3('0x6'));var config=require(_0xffe3('0x7'));var attributes=require(_0xffe3('0x8'));module[_0xffe3('0x9')]=function(_0x81bbd6,_0x3a7baa){return _0x81bbd6[_0xffe3('0xa')](_0xffe3('0xb'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 99335b4..3099f80 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 _0xe0e7=['client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x516441,_0x35d8c4){var _0x364752=function(_0x2bf3ea){while(--_0x2bf3ea){_0x516441['push'](_0x516441['shift']());}};_0x364752(++_0x35d8c4);}(_0xe0e7,0x18c));var _0x7e0e=function(_0x4e55a9,_0x241b22){_0x4e55a9=_0x4e55a9-0x0;var _0x4a9b67=_0xe0e7[_0x4e55a9];return _0x4a9b67;};'use strict';var _=require(_0x7e0e('0x0'));var util=require(_0x7e0e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7e0e('0x2'));var fs=require('fs');var Redis=require(_0x7e0e('0x3'));var db=require(_0x7e0e('0x4'))['db'];var utils=require(_0x7e0e('0x5'));var logger=require(_0x7e0e('0x6'))(_0x7e0e('0x7'));var config=require(_0x7e0e('0x8'));var jayson=require(_0x7e0e('0x9'));var client=jayson[_0x7e0e('0xa')][_0x7e0e('0xb')]({'port':0x232a});config[_0x7e0e('0xc')]=_[_0x7e0e('0xd')](config[_0x7e0e('0xc')],{'host':_0x7e0e('0xe'),'port':0x18eb});var socket=require(_0x7e0e('0xf'))(new Redis(config[_0x7e0e('0xc')]));require(_0x7e0e('0x10'))[_0x7e0e('0x11')](socket);function respondWithRpcPromise(_0x559984,_0x55f6aa,_0x2cbf5d){return new BPromise(function(_0x29fa4c,_0x57d49e){return client['request'](_0x559984,_0x2cbf5d)[_0x7e0e('0x12')](function(_0xb89c55){logger[_0x7e0e('0x13')](_0x7e0e('0x14'),_0x55f6aa,_0x7e0e('0x15'));logger[_0x7e0e('0x16')](_0x7e0e('0x17'),_0x55f6aa,'request\x20sent',JSON['stringify'](_0xb89c55));if(_0xb89c55[_0x7e0e('0x18')]){if(_0xb89c55[_0x7e0e('0x18')][_0x7e0e('0x19')]===0x1f4){logger['error'](_0x7e0e('0x14'),_0x55f6aa,_0xb89c55[_0x7e0e('0x18')]['message']);return _0x57d49e(_0xb89c55['error'][_0x7e0e('0x1a')]);}logger[_0x7e0e('0x18')](_0x7e0e('0x14'),_0x55f6aa,_0xb89c55[_0x7e0e('0x18')][_0x7e0e('0x1a')]);return _0x29fa4c(_0xb89c55[_0x7e0e('0x18')][_0x7e0e('0x1a')]);}else{logger['info'](_0x7e0e('0x14'),_0x55f6aa,'request\x20sent');_0x29fa4c(_0xb89c55[_0x7e0e('0x1b')][_0x7e0e('0x1a')]);}})[_0x7e0e('0x1c')](function(_0x11559d){logger[_0x7e0e('0x18')](_0x7e0e('0x14'),_0x55f6aa,_0x11559d);_0x57d49e(_0x11559d);});});} \ No newline at end of file +var _0x81fb=['localhost','socket.io-emitter','./team.socket','register','request','then','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis'];(function(_0x1780f8,_0x11ba93){var _0x33a410=function(_0x2a015f){while(--_0x2a015f){_0x1780f8['push'](_0x1780f8['shift']());}};_0x33a410(++_0x11ba93);}(_0x81fb,0x196));var _0xb81f=function(_0x55b4b1,_0x386ead){_0x55b4b1=_0x55b4b1-0x0;var _0x95c169=_0x81fb[_0x55b4b1];return _0x95c169;};'use strict';var _=require(_0xb81f('0x0'));var util=require(_0xb81f('0x1'));var moment=require('moment');var BPromise=require(_0xb81f('0x2'));var rs=require(_0xb81f('0x3'));var fs=require('fs');var Redis=require(_0xb81f('0x4'));var db=require(_0xb81f('0x5'))['db'];var utils=require(_0xb81f('0x6'));var logger=require(_0xb81f('0x7'))(_0xb81f('0x8'));var config=require(_0xb81f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb81f('0xa')][_0xb81f('0xb')]({'port':0x232a});config['redis']=_[_0xb81f('0xc')](config[_0xb81f('0xd')],{'host':_0xb81f('0xe'),'port':0x18eb});var socket=require(_0xb81f('0xf'))(new Redis(config[_0xb81f('0xd')]));require(_0xb81f('0x10'))[_0xb81f('0x11')](socket);function respondWithRpcPromise(_0x12c35d,_0x4f26fa,_0x4a3a00){return new BPromise(function(_0x1d92aa,_0xfd9790){return client[_0xb81f('0x12')](_0x12c35d,_0x4a3a00)[_0xb81f('0x13')](function(_0x37a961){logger['info'](_0xb81f('0x14'),_0x4f26fa,_0xb81f('0x15'));logger[_0xb81f('0x16')](_0xb81f('0x17'),_0x4f26fa,_0xb81f('0x15'),JSON[_0xb81f('0x18')](_0x37a961));if(_0x37a961[_0xb81f('0x19')]){if(_0x37a961[_0xb81f('0x19')][_0xb81f('0x1a')]===0x1f4){logger[_0xb81f('0x19')](_0xb81f('0x14'),_0x4f26fa,_0x37a961['error'][_0xb81f('0x1b')]);return _0xfd9790(_0x37a961[_0xb81f('0x19')][_0xb81f('0x1b')]);}logger[_0xb81f('0x19')](_0xb81f('0x14'),_0x4f26fa,_0x37a961[_0xb81f('0x19')][_0xb81f('0x1b')]);return _0x1d92aa(_0x37a961['error'][_0xb81f('0x1b')]);}else{logger['info'](_0xb81f('0x14'),_0x4f26fa,'request\x20sent');_0x1d92aa(_0x37a961[_0xb81f('0x1c')][_0xb81f('0x1b')]);}})[_0xb81f('0x1d')](function(_0x2d053f){logger[_0xb81f('0x19')](_0xb81f('0x14'),_0x4f26fa,_0x2d053f);_0xfd9790(_0x2d053f);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 55666a6..9d72c77 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 _0xef88=['update','emit','register','length','team:','save','remove'];(function(_0x50db77,_0x4bb936){var _0x569398=function(_0x4a6b54){while(--_0x4a6b54){_0x50db77['push'](_0x50db77['shift']());}};_0x569398(++_0x4bb936);}(_0xef88,0x10f));var _0x8ef8=function(_0x3cb51f,_0x2d89a5){_0x3cb51f=_0x3cb51f-0x0;var _0x23ead7=_0xef88[_0x3cb51f];return _0x23ead7;};'use strict';var TeamEvents=require('./team.events');var events=[_0x8ef8('0x0'),_0x8ef8('0x1'),_0x8ef8('0x2')];function createListener(_0x54cbe4,_0x2fcbbd){return function(_0x2d03fd){_0x2fcbbd[_0x8ef8('0x3')](_0x54cbe4,_0x2d03fd);};}function removeListener(_0x7226af,_0x69db1a){return function(){TeamEvents['removeListener'](_0x7226af,_0x69db1a);};}exports[_0x8ef8('0x4')]=function(_0x443d5a){for(var _0x4400af=0x0,_0x3cc25f=events[_0x8ef8('0x5')];_0x4400af<_0x3cc25f;_0x4400af++){var _0x565639=events[_0x4400af];var _0x5e3464=createListener(_0x8ef8('0x6')+_0x565639,_0x443d5a);TeamEvents['on'](_0x565639,_0x5e3464);}}; \ No newline at end of file +var _0x45bb=['update','removeListener','register','team:','./team.events'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x45bb,0xd1));var _0xb45b=function(_0xd76828,_0x27e947){_0xd76828=_0xd76828-0x0;var _0x5b9244=_0x45bb[_0xd76828];return _0x5b9244;};'use strict';var TeamEvents=require(_0xb45b('0x0'));var events=['save','remove',_0xb45b('0x1')];function createListener(_0x7448f1,_0x20f3d8){return function(_0x4cb2b6){_0x20f3d8['emit'](_0x7448f1,_0x4cb2b6);};}function removeListener(_0xec3106,_0x3d6839){return function(){TeamEvents[_0xb45b('0x2')](_0xec3106,_0x3d6839);};}exports[_0xb45b('0x3')]=function(_0x266813){for(var _0x319f53=0x0,_0x4fc69e=events['length'];_0x319f53<_0x4fc69e;_0x319f53++){var _0x30064e=events[_0x319f53];var _0x39bb61=createListener(_0xb45b('0x4')+_0x30064e,_0x266813);TeamEvents['on'](_0x30064e,_0x39bb61);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 5ba443d..82b417d 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 _0xf257=['INTEGER'];(function(_0x492e1d,_0x63d19c){var _0x25b261=function(_0x3268d7){while(--_0x3268d7){_0x492e1d['push'](_0x492e1d['shift']());}};_0x25b261(++_0x63d19c);}(_0xf257,0x82));var _0x7f25=function(_0xbf6e7a,_0x291599){_0xbf6e7a=_0xbf6e7a-0x0;var _0x1a9080=_0xf257[_0xbf6e7a];return _0x1a9080;};'use strict';var Sequelize=require('sequelize');module['exports']={'TeamId':{'type':Sequelize[_0x7f25('0x0')]},'VoicePrefixId':{'type':Sequelize[_0x7f25('0x0')]}}; \ No newline at end of file +var _0x5bbd=['exports','INTEGER','sequelize'];(function(_0x1e384d,_0xf98b3e){var _0x19654d=function(_0x33cd2c){while(--_0x33cd2c){_0x1e384d['push'](_0x1e384d['shift']());}};_0x19654d(++_0xf98b3e);}(_0x5bbd,0x12b));var _0xd5bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5bbd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd5bb('0x0'));module[_0xd5bb('0x1')]={'TeamId':{'type':Sequelize[_0xd5bb('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xd5bb('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 2dc05c0..2038c0a 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 _0x105b=['request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4b1e09,_0x3b93ea){var _0x155d59=function(_0x31db85){while(--_0x31db85){_0x4b1e09['push'](_0x4b1e09['shift']());}};_0x155d59(++_0x3b93ea);}(_0x105b,0x1a7));var _0xb105=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x105b[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0xb105('0x0'));var util=require(_0xb105('0x1'));var logger=require(_0xb105('0x2'))(_0xb105('0x3'));var moment=require(_0xb105('0x4'));var BPromise=require(_0xb105('0x5'));var rp=require(_0xb105('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb105('0x7'));var config=require(_0xb105('0x8'));var attributes=require(_0xb105('0x9'));module['exports']=function(_0x33602c,_0xec2901){return _0x33602c[_0xb105('0xa')](_0xb105('0xb'),attributes,{'tableName':_0xb105('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e65=['api','moment','bluebird','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','team_has_voice_prefixes','util','../../config/logger'];(function(_0x1f175e,_0x25487c){var _0x4ab74c=function(_0x301e14){while(--_0x301e14){_0x1f175e['push'](_0x1f175e['shift']());}};_0x4ab74c(++_0x25487c);}(_0x4e65,0xc4));var _0x54e6=function(_0x379fdb,_0x5b8315){_0x379fdb=_0x379fdb-0x0;var _0x203985=_0x4e65[_0x379fdb];return _0x203985;};'use strict';var _=require('lodash');var util=require(_0x54e6('0x0'));var logger=require(_0x54e6('0x1'))(_0x54e6('0x2'));var moment=require(_0x54e6('0x3'));var BPromise=require(_0x54e6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x54e6('0x5'));var config=require(_0x54e6('0x6'));var attributes=require(_0x54e6('0x7'));module[_0x54e6('0x8')]=function(_0x23b09a,_0x5d1ffc){return _0x23b09a[_0x54e6('0x9')]('TeamVoicePrefix',attributes,{'tableName':_0x54e6('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 36adae3..40a6308 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x17f7c9,_0x2727cf){var _0x5ad7ca=function(_0x4c834c){while(--_0x4c834c){_0x17f7c9['push'](_0x17f7c9['shift']());}};_0x5ad7ca(++_0x2727cf);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x45977c,_0x7eaed0){var _0x399413=function(_0x41cc76){while(--_0x41cc76){_0x45977c['push'](_0x45977c['shift']());}};_0x399413(++_0x7eaed0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 9006424..e804c9e 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. * // * * // ************************************************************************* -'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2942=['sequelize','exports','INTEGER'];(function(_0x16f6e7,_0x2c16b4){var _0x81831a=function(_0x1b2d49){while(--_0x1b2d49){_0x16f6e7['push'](_0x16f6e7['shift']());}};_0x81831a(++_0x2c16b4);}(_0x2942,0x15f));var _0x2294=function(_0x4aba79,_0x1acd82){_0x4aba79=_0x4aba79-0x0;var _0x15a66a=_0x2942[_0x4aba79];return _0x15a66a;};'use strict';var Sequelize=require(_0x2294('0x0'));module[_0x2294('0x1')]={'penalty':{'type':Sequelize[_0x2294('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 af517a1..1a3700b 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 _0x330c=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','define','TeamVoiceQueue','team_has_voice_queues'];(function(_0x1c1fba,_0xd5872d){var _0x37e346=function(_0xa5d2c0){while(--_0xa5d2c0){_0x1c1fba['push'](_0x1c1fba['shift']());}};_0x37e346(++_0xd5872d);}(_0x330c,0x186));var _0xc330=function(_0x309465,_0x17ef48){_0x309465=_0x309465-0x0;var _0xdfcb54=_0x330c[_0x309465];return _0xdfcb54;};'use strict';var _=require(_0xc330('0x0'));var util=require(_0xc330('0x1'));var logger=require(_0xc330('0x2'))(_0xc330('0x3'));var moment=require('moment');var BPromise=require(_0xc330('0x4'));var rp=require(_0xc330('0x5'));var fs=require('fs');var path=require(_0xc330('0x6'));var rimraf=require(_0xc330('0x7'));var config=require(_0xc330('0x8'));var attributes=require(_0xc330('0x9'));module['exports']=function(_0x4f49fb,_0x53d0ca){return _0x4f49fb[_0xc330('0xa')](_0xc330('0xb'),attributes,{'tableName':_0xc330('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x39a9=['TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','define'];(function(_0x5bac95,_0x2b8a59){var _0x61361e=function(_0x33652d){while(--_0x33652d){_0x5bac95['push'](_0x5bac95['shift']());}};_0x61361e(++_0x2b8a59);}(_0x39a9,0x1d0));var _0x939a=function(_0x5d1044,_0x18f656){_0x5d1044=_0x5d1044-0x0;var _0x3cd90e=_0x39a9[_0x5d1044];return _0x3cd90e;};'use strict';var _=require(_0x939a('0x0'));var util=require(_0x939a('0x1'));var logger=require(_0x939a('0x2'))(_0x939a('0x3'));var moment=require(_0x939a('0x4'));var BPromise=require(_0x939a('0x5'));var rp=require(_0x939a('0x6'));var fs=require('fs');var path=require(_0x939a('0x7'));var rimraf=require(_0x939a('0x8'));var config=require(_0x939a('0x9'));var attributes=require(_0x939a('0xa'));module['exports']=function(_0x5793fe,_0xed3974){return _0x5793fe[_0x939a('0xb')](_0x939a('0xc'),attributes,{'tableName':_0x939a('0xd'),'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 ce7e7da..bee3f4e 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 _0xa23d=['stringify','error','TeamVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x429c68,_0x2d2dc9){var _0x2c232f=function(_0x11d559){while(--_0x11d559){_0x429c68['push'](_0x429c68['shift']());}};_0x2c232f(++_0x2d2dc9);}(_0xa23d,0x131));var _0xda23=function(_0x3d7f7a,_0x445652){_0x3d7f7a=_0x3d7f7a-0x0;var _0x52d6a6=_0xa23d[_0x3d7f7a];return _0x52d6a6;};'use strict';var _=require(_0xda23('0x0'));var util=require(_0xda23('0x1'));var moment=require(_0xda23('0x2'));var BPromise=require(_0xda23('0x3'));var rs=require(_0xda23('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xda23('0x5'))['db'];var utils=require(_0xda23('0x6'));var logger=require('../../config/logger')(_0xda23('0x7'));var config=require(_0xda23('0x8'));var jayson=require(_0xda23('0x9'));var client=jayson[_0xda23('0xa')][_0xda23('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f434e,_0x123b65,_0x49c989){return new BPromise(function(_0x492c3f,_0x3ca325){return client[_0xda23('0xc')](_0x5f434e,_0x49c989)[_0xda23('0xd')](function(_0x702029){logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x123b65,_0xda23('0xe'));logger[_0xda23('0xf')](_0xda23('0x10'),_0x123b65,_0xda23('0xe'),JSON[_0xda23('0x11')](_0x702029));if(_0x702029[_0xda23('0x12')]){if(_0x702029[_0xda23('0x12')]['code']===0x1f4){logger[_0xda23('0x12')](_0xda23('0x13'),_0x123b65,_0x702029[_0xda23('0x12')][_0xda23('0x14')]);return _0x3ca325(_0x702029['error'][_0xda23('0x14')]);}logger[_0xda23('0x12')](_0xda23('0x13'),_0x123b65,_0x702029[_0xda23('0x12')][_0xda23('0x14')]);return _0x492c3f(_0x702029[_0xda23('0x12')]['message']);}else{logger['info'](_0xda23('0x13'),_0x123b65,_0xda23('0xe'));_0x492c3f(_0x702029[_0xda23('0x15')][_0xda23('0x14')]);}})[_0xda23('0x16')](function(_0x5ad2ab){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x123b65,_0x5ad2ab);_0x3ca325(_0x5ad2ab);});});} \ No newline at end of file +var _0x12dc=['then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x1a34b9,_0x546fd5){var _0x31cf0f=function(_0x35ad7a){while(--_0x35ad7a){_0x1a34b9['push'](_0x1a34b9['shift']());}};_0x31cf0f(++_0x546fd5);}(_0x12dc,0xb4));var _0xc12d=function(_0x43d890,_0xfec884){_0x43d890=_0x43d890-0x0;var _0x45f1b6=_0x12dc[_0x43d890];return _0x45f1b6;};'use strict';var _=require(_0xc12d('0x0'));var util=require(_0xc12d('0x1'));var moment=require('moment');var BPromise=require(_0xc12d('0x2'));var rs=require(_0xc12d('0x3'));var fs=require('fs');var Redis=require(_0xc12d('0x4'));var db=require(_0xc12d('0x5'))['db'];var utils=require(_0xc12d('0x6'));var logger=require(_0xc12d('0x7'))(_0xc12d('0x8'));var config=require(_0xc12d('0x9'));var jayson=require(_0xc12d('0xa'));var client=jayson['client'][_0xc12d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb47653,_0x3f831b,_0x468429){return new BPromise(function(_0x38a0a2,_0x3cbd03){return client['request'](_0xb47653,_0x468429)[_0xc12d('0xc')](function(_0x25ff0a){logger['info'](_0xc12d('0xd'),_0x3f831b,_0xc12d('0xe'));logger[_0xc12d('0xf')](_0xc12d('0x10'),_0x3f831b,_0xc12d('0xe'),JSON[_0xc12d('0x11')](_0x25ff0a));if(_0x25ff0a[_0xc12d('0x12')]){if(_0x25ff0a[_0xc12d('0x12')][_0xc12d('0x13')]===0x1f4){logger[_0xc12d('0x12')](_0xc12d('0xd'),_0x3f831b,_0x25ff0a[_0xc12d('0x12')][_0xc12d('0x14')]);return _0x3cbd03(_0x25ff0a[_0xc12d('0x12')][_0xc12d('0x14')]);}logger['error'](_0xc12d('0xd'),_0x3f831b,_0x25ff0a[_0xc12d('0x12')]['message']);return _0x38a0a2(_0x25ff0a[_0xc12d('0x12')][_0xc12d('0x14')]);}else{logger[_0xc12d('0x15')](_0xc12d('0xd'),_0x3f831b,_0xc12d('0xe'));_0x38a0a2(_0x25ff0a[_0xc12d('0x16')][_0xc12d('0x14')]);}})[_0xc12d('0x17')](function(_0x39d962){logger[_0xc12d('0x12')](_0xc12d('0xd'),_0x3f831b,_0x39d962);_0x3cbd03(_0x39d962);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 09ac67d..b747e48 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 _0x9f0e=['../../config/environment','./template.controller','get','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x9f0e,0x116));var _0xe9f0=function(_0x2488a7,_0x4868ba){_0x2488a7=_0x2488a7-0x0;var _0x80a356=_0x9f0e[_0x2488a7];return _0x80a356;};'use strict';var multer=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var path=require(_0xe9f0('0x2'));var timeout=require(_0xe9f0('0x3'));var express=require(_0xe9f0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe9f0('0x5'));var interaction=require(_0xe9f0('0x6'));var config=require(_0xe9f0('0x7'));var controller=require(_0xe9f0('0x8'));router[_0xe9f0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe9f0('0x9')](_0xe9f0('0xa'),auth[_0xe9f0('0xb')](),controller['show']);router[_0xe9f0('0xc')]('/',auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xd')]);router[_0xe9f0('0xe')](_0xe9f0('0xa'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xf')]);router[_0xe9f0('0x10')](_0xe9f0('0xa'),auth['isAuthenticated'](),controller[_0xe9f0('0x11')]);module[_0xe9f0('0x12')]=router; \ No newline at end of file +var _0x3c8b=['../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','post','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x3c8b,0x18b));var _0xb3c8=function(_0x52edbc,_0x237a2b){_0x52edbc=_0x52edbc-0x0;var _0xea0a2a=_0x3c8b[_0x52edbc];return _0xea0a2a;};'use strict';var multer=require('multer');var util=require(_0xb3c8('0x0'));var path=require('path');var timeout=require(_0xb3c8('0x1'));var express=require(_0xb3c8('0x2'));var router=express[_0xb3c8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb3c8('0x4'));var interaction=require(_0xb3c8('0x5'));var config=require(_0xb3c8('0x6'));var controller=require(_0xb3c8('0x7'));router[_0xb3c8('0x8')]('/',auth[_0xb3c8('0x9')](),controller[_0xb3c8('0xa')]);router[_0xb3c8('0x8')]('/:id',auth[_0xb3c8('0x9')](),controller['show']);router[_0xb3c8('0xb')]('/',auth[_0xb3c8('0x9')](),controller['create']);router['put']('/:id',auth[_0xb3c8('0x9')](),controller[_0xb3c8('0xc')]);router[_0xb3c8('0xd')]('/:id',auth[_0xb3c8('0x9')](),controller[_0xb3c8('0xe')]);module[_0xb3c8('0xf')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 1ce86bd..1c995b6 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 _0x5a81=['sequelize','STRING','TEXT'];(function(_0x4b8f95,_0x3f3e){var _0x58ac65=function(_0x1e7a46){while(--_0x1e7a46){_0x4b8f95['push'](_0x4b8f95['shift']());}};_0x58ac65(++_0x3f3e);}(_0x5a81,0x90));var _0x15a8=function(_0x56f662,_0x33afa6){_0x56f662=_0x56f662-0x0;var _0x4d27d1=_0x5a81[_0x56f662];return _0x4d27d1;};'use strict';var Sequelize=require(_0x15a8('0x0'));module['exports']={'name':{'type':Sequelize[_0x15a8('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x15a8('0x2')]}}; \ No newline at end of file +var _0x5033=['exports','STRING','sequelize'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x5033,0xb9));var _0x3503=function(_0x34b728,_0x47d7bb){_0x34b728=_0x34b728-0x0;var _0x346125=_0x5033[_0x34b728];return _0x346125;};'use strict';var Sequelize=require(_0x3503('0x0'));module[_0x3503('0x1')]={'name':{'type':Sequelize[_0x3503('0x2')]},'description':{'type':Sequelize[_0x3503('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 53a1e30..5d4658b 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 _0x8eb1=['length','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','Templates','UserProfileResource','sendStatus','error','stack','name','index','map','Template','rawAttributes','fieldName','model','query','intersection','attributes','fields'];(function(_0x5d35c1,_0x1512cc){var _0x25b854=function(_0xf70b83){while(--_0xf70b83){_0x5d35c1['push'](_0x5d35c1['shift']());}};_0x25b854(++_0x1512cc);}(_0x8eb1,0x116));var _0x18eb=function(_0x3373cf,_0x32ec83){_0x3373cf=_0x3373cf-0x0;var _0x3da7c5=_0x8eb1[_0x3373cf];return _0x3da7c5;};'use strict';var emlformat=require(_0x18eb('0x0'));var rimraf=require(_0x18eb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x18eb('0x2'));var moment=require(_0x18eb('0x3'));var BPromise=require(_0x18eb('0x4'));var Mustache=require(_0x18eb('0x5'));var util=require('util');var path=require(_0x18eb('0x6'));var sox=require(_0x18eb('0x7'));var csv=require(_0x18eb('0x8'));var ejs=require(_0x18eb('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x18eb('0xa'));var crypto=require(_0x18eb('0xb'));var jsforce=require(_0x18eb('0xc'));var deskjs=require(_0x18eb('0xd'));var toCsv=require(_0x18eb('0x8'));var querystring=require(_0x18eb('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x18eb('0xf'));var qs=require(_0x18eb('0x10'));var as=require(_0x18eb('0x11'));var hardwareService=require(_0x18eb('0x12'));var logger=require(_0x18eb('0x13'))(_0x18eb('0x14'));var utils=require(_0x18eb('0x15'));var config=require(_0x18eb('0x16'));var licenseUtil=require(_0x18eb('0x17'));var db=require(_0x18eb('0x18'))['db'];function respondWithStatusCode(_0x2c929e,_0x2145ff){_0x2145ff=_0x2145ff||0xcc;return function(_0x30a489){if(_0x30a489){return _0x2c929e['sendStatus'](_0x2145ff);}return _0x2c929e[_0x18eb('0x19')](_0x2145ff)[_0x18eb('0x1a')]();};}function respondWithResult(_0x292209,_0x4e6bb2){_0x4e6bb2=_0x4e6bb2||0xc8;return function(_0x46514f){if(_0x46514f){return _0x292209['status'](_0x4e6bb2)[_0x18eb('0x1b')](_0x46514f);}};}function respondWithFilteredResult(_0x2d2350,_0x16a935){return function(_0x3646a5){if(_0x3646a5){var _0x1cefb6=typeof _0x16a935[_0x18eb('0x1c')]==='undefined'&&typeof _0x16a935[_0x18eb('0x1d')]===_0x18eb('0x1e');var _0x34d15a=_0x3646a5[_0x18eb('0x1f')];var _0x39554d=_0x1cefb6?0x0:_0x16a935[_0x18eb('0x1c')];var _0x13024d=_0x1cefb6?_0x3646a5[_0x18eb('0x1f')]:_0x16a935[_0x18eb('0x1c')]+_0x16a935['limit'];var _0x4e7023;if(_0x13024d>=_0x34d15a){_0x13024d=_0x34d15a;_0x4e7023=0xc8;}else{_0x4e7023=0xce;}_0x2d2350[_0x18eb('0x19')](_0x4e7023);return _0x2d2350[_0x18eb('0x20')](_0x18eb('0x21'),_0x39554d+'-'+_0x13024d+'/'+_0x34d15a)['json'](_0x3646a5);}return null;};}function patchUpdates(_0x417e65){return function(_0x24eb49){try{jsonpatch[_0x18eb('0x22')](_0x24eb49,_0x417e65,!![]);}catch(_0x3a50db){return BPromise[_0x18eb('0x23')](_0x3a50db);}return _0x24eb49['save']();};}function saveUpdates(_0x3c93a5,_0x50448d){return function(_0x1e30f0){if(_0x1e30f0){return _0x1e30f0['update'](_0x3c93a5)[_0x18eb('0x24')](function(_0x1a8279){return _0x1a8279;});}return null;};}function removeEntity(_0x393434,_0x1caf90){return function(_0xb82240){if(_0xb82240){return _0xb82240[_0x18eb('0x25')]()[_0x18eb('0x24')](function(){var _0x32c10e=_0xb82240['get']({'plain':!![]});var _0x35eaaa=_0x18eb('0x26');return db[_0x18eb('0x27')][_0x18eb('0x25')]({'where':{'type':_0x35eaaa,'resourceId':_0x32c10e['id']}})[_0x18eb('0x24')](function(){return _0xb82240;});})[_0x18eb('0x24')](function(){_0x393434[_0x18eb('0x19')](0xcc)[_0x18eb('0x1a')]();});}};}function handleEntityNotFound(_0x29a543,_0x283885){return function(_0x38d893){if(!_0x38d893){_0x29a543[_0x18eb('0x28')](0x194);}return _0x38d893;};}function handleError(_0x5e8083,_0x5110a6){_0x5110a6=_0x5110a6||0x1f4;return function(_0x57fb63){logger[_0x18eb('0x29')](_0x57fb63[_0x18eb('0x2a')]);if(_0x57fb63['name']){delete _0x57fb63[_0x18eb('0x2b')];}_0x5e8083['status'](_0x5110a6)['send'](_0x57fb63);};}exports[_0x18eb('0x2c')]=function(_0x1327e8,_0x9953ed){var _0x98386d={},_0x2cabf2={},_0x378b8b={'count':0x0,'rows':[]};var _0x25f960=_[_0x18eb('0x2d')](db[_0x18eb('0x2e')][_0x18eb('0x2f')],function(_0x4cb846){return{'name':_0x4cb846[_0x18eb('0x30')],'type':_0x4cb846['type']['key']};});_0x2cabf2[_0x18eb('0x31')]=_['map'](_0x25f960,_0x18eb('0x2b'));_0x2cabf2[_0x18eb('0x32')]=_['keys'](_0x1327e8[_0x18eb('0x32')]);_0x2cabf2['filters']=_[_0x18eb('0x33')](_0x2cabf2['model'],_0x2cabf2['query']);_0x98386d[_0x18eb('0x34')]=_['intersection'](_0x2cabf2[_0x18eb('0x31')],qs[_0x18eb('0x35')](_0x1327e8[_0x18eb('0x32')][_0x18eb('0x35')]));_0x98386d[_0x18eb('0x34')]=_0x98386d[_0x18eb('0x34')][_0x18eb('0x36')]?_0x98386d['attributes']:_0x2cabf2[_0x18eb('0x31')];if(!_0x1327e8[_0x18eb('0x32')][_0x18eb('0x37')](_0x18eb('0x38'))){_0x98386d[_0x18eb('0x1d')]=qs[_0x18eb('0x1d')](_0x1327e8['query'][_0x18eb('0x1d')]);_0x98386d['offset']=qs['offset'](_0x1327e8[_0x18eb('0x32')][_0x18eb('0x1c')]);}_0x98386d[_0x18eb('0x39')]=qs[_0x18eb('0x3a')](_0x1327e8[_0x18eb('0x32')]['sort']);_0x98386d[_0x18eb('0x3b')]=qs[_0x18eb('0x3c')](_['pick'](_0x1327e8[_0x18eb('0x32')],_0x2cabf2[_0x18eb('0x3c')]),_0x25f960);if(_0x1327e8['query'][_0x18eb('0x3d')]){_0x98386d['where']=_['merge'](_0x98386d[_0x18eb('0x3b')],{'$or':_[_0x18eb('0x2d')](_0x25f960,function(_0x5d173c){if(_0x5d173c[_0x18eb('0x3e')]!==_0x18eb('0x3f')){var _0x16f729={};_0x16f729[_0x5d173c[_0x18eb('0x2b')]]={'$like':'%'+_0x1327e8[_0x18eb('0x32')][_0x18eb('0x3d')]+'%'};return _0x16f729;}})});}_0x98386d=_[_0x18eb('0x40')]({},_0x98386d,_0x1327e8[_0x18eb('0x41')]);var _0x21b6a0={'where':_0x98386d[_0x18eb('0x3b')]};return db[_0x18eb('0x2e')][_0x18eb('0x1f')](_0x21b6a0)[_0x18eb('0x24')](function(_0x3e0b5e){_0x378b8b['count']=_0x3e0b5e;if(_0x1327e8['query'][_0x18eb('0x42')]){_0x98386d[_0x18eb('0x43')]=[{'all':!![]}];}return db[_0x18eb('0x2e')][_0x18eb('0x44')](_0x98386d);})[_0x18eb('0x24')](function(_0x26be9d){_0x378b8b[_0x18eb('0x45')]=_0x26be9d;return _0x378b8b;})[_0x18eb('0x24')](respondWithFilteredResult(_0x9953ed,_0x98386d))['catch'](handleError(_0x9953ed,null));};exports[_0x18eb('0x46')]=function(_0x30eccf,_0x2daa38){var _0x1ea850={'raw':!![],'where':{'id':_0x30eccf[_0x18eb('0x47')]['id']}},_0x11bee5={};_0x11bee5[_0x18eb('0x31')]=_[_0x18eb('0x48')](db[_0x18eb('0x2e')]['rawAttributes']);_0x11bee5[_0x18eb('0x32')]=_[_0x18eb('0x48')](_0x30eccf[_0x18eb('0x32')]);_0x11bee5[_0x18eb('0x3c')]=_['intersection'](_0x11bee5[_0x18eb('0x31')],_0x11bee5[_0x18eb('0x32')]);_0x1ea850[_0x18eb('0x34')]=_['intersection'](_0x11bee5['model'],qs[_0x18eb('0x35')](_0x30eccf[_0x18eb('0x32')][_0x18eb('0x35')]));_0x1ea850[_0x18eb('0x34')]=_0x1ea850[_0x18eb('0x34')][_0x18eb('0x36')]?_0x1ea850[_0x18eb('0x34')]:_0x11bee5[_0x18eb('0x31')];if(_0x30eccf['query'][_0x18eb('0x42')]){_0x1ea850[_0x18eb('0x43')]=[{'all':!![]}];}_0x1ea850=_[_0x18eb('0x40')]({},_0x1ea850,_0x30eccf[_0x18eb('0x41')]);return db[_0x18eb('0x2e')][_0x18eb('0x49')](_0x1ea850)['then'](handleEntityNotFound(_0x2daa38,null))[_0x18eb('0x24')](respondWithResult(_0x2daa38,null))[_0x18eb('0x4a')](handleError(_0x2daa38,null));};exports[_0x18eb('0x4b')]=function(_0x49f0f5,_0xc3e3c8){return db[_0x18eb('0x2e')][_0x18eb('0x4b')](_0x49f0f5['body'],{})[_0x18eb('0x24')](function(_0x573095){var _0x1bdb26=_0x49f0f5[_0x18eb('0x4c')][_0x18eb('0x4d')]({'plain':!![]});if(!_0x1bdb26)throw new Error(_0x18eb('0x4e'));if(_0x1bdb26[_0x18eb('0x4f')]==='user'){var _0x1788be=_0x573095[_0x18eb('0x4d')]({'plain':!![]});var _0x1189b5=_0x18eb('0x26');return db['UserProfileSection'][_0x18eb('0x49')]({'where':{'name':_0x1189b5,'userProfileId':_0x1bdb26[_0x18eb('0x50')]},'raw':!![]})['then'](function(_0x4fe85c){if(_0x4fe85c&&_0x4fe85c[_0x18eb('0x51')]===0x0){return db[_0x18eb('0x27')][_0x18eb('0x4b')]({'name':_0x1788be[_0x18eb('0x2b')],'resourceId':_0x1788be['id'],'type':_0x4fe85c[_0x18eb('0x2b')],'sectionId':_0x4fe85c['id']},{})[_0x18eb('0x24')](function(){return _0x573095;});}else{return _0x573095;}})[_0x18eb('0x4a')](function(_0x2a69e5){logger['error'](_0x18eb('0x52'),_0x2a69e5);throw _0x2a69e5;});}return _0x573095;})['then'](respondWithResult(_0xc3e3c8,0xc9))[_0x18eb('0x4a')](handleError(_0xc3e3c8,null));};exports['update']=function(_0x3c317f,_0x51a1f7){if(_0x3c317f['body']['id']){delete _0x3c317f['body']['id'];}return db[_0x18eb('0x2e')][_0x18eb('0x49')]({'where':{'id':_0x3c317f[_0x18eb('0x47')]['id']}})[_0x18eb('0x24')](handleEntityNotFound(_0x51a1f7,null))[_0x18eb('0x24')](saveUpdates(_0x3c317f['body'],null))[_0x18eb('0x24')](respondWithResult(_0x51a1f7,null))[_0x18eb('0x4a')](handleError(_0x51a1f7,null));};exports[_0x18eb('0x25')]=function(_0x57c349,_0x21c962){return db[_0x18eb('0x2e')][_0x18eb('0x49')]({'where':{'id':_0x57c349[_0x18eb('0x47')]['id']}})[_0x18eb('0x24')](handleEntityNotFound(_0x21c962,null))[_0x18eb('0x24')](removeEntity(_0x21c962,null))[_0x18eb('0x4a')](handleError(_0x21c962,null));}; \ No newline at end of file +var _0xd849=['includeAll','include','findAll','rows','show','params','options','find','catch','create','body','user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','count','limit','apply','update','then','destroy','get','Templates','end','error','stack','name','index','map','Template','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL'];(function(_0x31416e,_0x1abf1a){var _0x346c98=function(_0x58c09a){while(--_0x58c09a){_0x31416e['push'](_0x31416e['shift']());}};_0x346c98(++_0x1abf1a);}(_0xd849,0xaf));var _0x9d84=function(_0x5e2f89,_0x7b2df8){_0x5e2f89=_0x5e2f89-0x0;var _0x30ebe6=_0xd849[_0x5e2f89];return _0x30ebe6;};'use strict';var emlformat=require(_0x9d84('0x0'));var rimraf=require(_0x9d84('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9d84('0x2'));var Mustache=require(_0x9d84('0x3'));var util=require('util');var path=require(_0x9d84('0x4'));var sox=require(_0x9d84('0x5'));var csv=require(_0x9d84('0x6'));var ejs=require(_0x9d84('0x7'));var fs=require('fs');var fs_extra=require(_0x9d84('0x8'));var _=require('lodash');var squel=require(_0x9d84('0x9'));var crypto=require('crypto');var jsforce=require(_0x9d84('0xa'));var deskjs=require(_0x9d84('0xb'));var toCsv=require(_0x9d84('0x6'));var querystring=require(_0x9d84('0xc'));var Papa=require(_0x9d84('0xd'));var Redis=require(_0x9d84('0xe'));var authService=require(_0x9d84('0xf'));var qs=require(_0x9d84('0x10'));var as=require(_0x9d84('0x11'));var hardwareService=require(_0x9d84('0x12'));var logger=require('../../config/logger')(_0x9d84('0x13'));var utils=require(_0x9d84('0x14'));var config=require(_0x9d84('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9d84('0x16'))['db'];function respondWithStatusCode(_0x518e97,_0x5df68f){_0x5df68f=_0x5df68f||0xcc;return function(_0x4506e1){if(_0x4506e1){return _0x518e97['sendStatus'](_0x5df68f);}return _0x518e97[_0x9d84('0x17')](_0x5df68f)['end']();};}function respondWithResult(_0x59f61a,_0x138e6a){_0x138e6a=_0x138e6a||0xc8;return function(_0x257a0d){if(_0x257a0d){return _0x59f61a[_0x9d84('0x17')](_0x138e6a)[_0x9d84('0x18')](_0x257a0d);}};}function respondWithFilteredResult(_0xb8d2fe,_0x1fc9d2){return function(_0x4ff663){if(_0x4ff663){var _0xb4f888=typeof _0x1fc9d2[_0x9d84('0x19')]===_0x9d84('0x1a')&&typeof _0x1fc9d2['limit']===_0x9d84('0x1a');var _0x3b64d2=_0x4ff663[_0x9d84('0x1b')];var _0x9a4a8b=_0xb4f888?0x0:_0x1fc9d2['offset'];var _0x3f4a65=_0xb4f888?_0x4ff663[_0x9d84('0x1b')]:_0x1fc9d2[_0x9d84('0x19')]+_0x1fc9d2[_0x9d84('0x1c')];var _0x48b608;if(_0x3f4a65>=_0x3b64d2){_0x3f4a65=_0x3b64d2;_0x48b608=0xc8;}else{_0x48b608=0xce;}_0xb8d2fe[_0x9d84('0x17')](_0x48b608);return _0xb8d2fe['set']('Content-Range',_0x9a4a8b+'-'+_0x3f4a65+'/'+_0x3b64d2)[_0x9d84('0x18')](_0x4ff663);}return null;};}function patchUpdates(_0x191bc3){return function(_0xc17a04){try{jsonpatch[_0x9d84('0x1d')](_0xc17a04,_0x191bc3,!![]);}catch(_0xdf726){return BPromise['reject'](_0xdf726);}return _0xc17a04['save']();};}function saveUpdates(_0xbc7d25,_0x59750f){return function(_0x459076){if(_0x459076){return _0x459076[_0x9d84('0x1e')](_0xbc7d25)[_0x9d84('0x1f')](function(_0x2a52c4){return _0x2a52c4;});}return null;};}function removeEntity(_0x3601ec,_0x77a240){return function(_0x4cb4ea){if(_0x4cb4ea){return _0x4cb4ea[_0x9d84('0x20')]()[_0x9d84('0x1f')](function(){var _0x1f1ca0=_0x4cb4ea[_0x9d84('0x21')]({'plain':!![]});var _0x552fec=_0x9d84('0x22');return db['UserProfileResource'][_0x9d84('0x20')]({'where':{'type':_0x552fec,'resourceId':_0x1f1ca0['id']}})[_0x9d84('0x1f')](function(){return _0x4cb4ea;});})[_0x9d84('0x1f')](function(){_0x3601ec['status'](0xcc)[_0x9d84('0x23')]();});}};}function handleEntityNotFound(_0x15268d,_0x43f35a){return function(_0x505d63){if(!_0x505d63){_0x15268d['sendStatus'](0x194);}return _0x505d63;};}function handleError(_0x3b5059,_0x8ba3bb){_0x8ba3bb=_0x8ba3bb||0x1f4;return function(_0x178a82){logger[_0x9d84('0x24')](_0x178a82[_0x9d84('0x25')]);if(_0x178a82[_0x9d84('0x26')]){delete _0x178a82['name'];}_0x3b5059[_0x9d84('0x17')](_0x8ba3bb)['send'](_0x178a82);};}exports[_0x9d84('0x27')]=function(_0x2f30b1,_0xb04fb7){var _0x17e632={},_0x158fd5={},_0x42955a={'count':0x0,'rows':[]};var _0x596bc1=_[_0x9d84('0x28')](db[_0x9d84('0x29')][_0x9d84('0x2a')],function(_0x18aafc){return{'name':_0x18aafc['fieldName'],'type':_0x18aafc['type'][_0x9d84('0x2b')]};});_0x158fd5[_0x9d84('0x2c')]=_[_0x9d84('0x28')](_0x596bc1,_0x9d84('0x26'));_0x158fd5[_0x9d84('0x2d')]=_[_0x9d84('0x2e')](_0x2f30b1[_0x9d84('0x2d')]);_0x158fd5[_0x9d84('0x2f')]=_[_0x9d84('0x30')](_0x158fd5['model'],_0x158fd5[_0x9d84('0x2d')]);_0x17e632[_0x9d84('0x31')]=_[_0x9d84('0x30')](_0x158fd5[_0x9d84('0x2c')],qs[_0x9d84('0x32')](_0x2f30b1[_0x9d84('0x2d')]['fields']));_0x17e632[_0x9d84('0x31')]=_0x17e632[_0x9d84('0x31')][_0x9d84('0x33')]?_0x17e632[_0x9d84('0x31')]:_0x158fd5[_0x9d84('0x2c')];if(!_0x2f30b1['query'][_0x9d84('0x34')](_0x9d84('0x35'))){_0x17e632[_0x9d84('0x1c')]=qs[_0x9d84('0x1c')](_0x2f30b1[_0x9d84('0x2d')][_0x9d84('0x1c')]);_0x17e632[_0x9d84('0x19')]=qs[_0x9d84('0x19')](_0x2f30b1[_0x9d84('0x2d')]['offset']);}_0x17e632[_0x9d84('0x36')]=qs[_0x9d84('0x37')](_0x2f30b1[_0x9d84('0x2d')][_0x9d84('0x37')]);_0x17e632[_0x9d84('0x38')]=qs[_0x9d84('0x2f')](_[_0x9d84('0x39')](_0x2f30b1[_0x9d84('0x2d')],_0x158fd5[_0x9d84('0x2f')]),_0x596bc1);if(_0x2f30b1[_0x9d84('0x2d')][_0x9d84('0x3a')]){_0x17e632[_0x9d84('0x38')]=_[_0x9d84('0x3b')](_0x17e632[_0x9d84('0x38')],{'$or':_[_0x9d84('0x28')](_0x596bc1,function(_0xaff2e4){if(_0xaff2e4[_0x9d84('0x3c')]!==_0x9d84('0x3d')){var _0x5b7f6f={};_0x5b7f6f[_0xaff2e4[_0x9d84('0x26')]]={'$like':'%'+_0x2f30b1[_0x9d84('0x2d')][_0x9d84('0x3a')]+'%'};return _0x5b7f6f;}})});}_0x17e632=_[_0x9d84('0x3b')]({},_0x17e632,_0x2f30b1['options']);var _0x57f125={'where':_0x17e632[_0x9d84('0x38')]};return db[_0x9d84('0x29')][_0x9d84('0x1b')](_0x57f125)[_0x9d84('0x1f')](function(_0x5c55ce){_0x42955a[_0x9d84('0x1b')]=_0x5c55ce;if(_0x2f30b1[_0x9d84('0x2d')][_0x9d84('0x3e')]){_0x17e632[_0x9d84('0x3f')]=[{'all':!![]}];}return db[_0x9d84('0x29')][_0x9d84('0x40')](_0x17e632);})[_0x9d84('0x1f')](function(_0x4f2d54){_0x42955a[_0x9d84('0x41')]=_0x4f2d54;return _0x42955a;})['then'](respondWithFilteredResult(_0xb04fb7,_0x17e632))['catch'](handleError(_0xb04fb7,null));};exports[_0x9d84('0x42')]=function(_0x43e84a,_0xfd6a11){var _0x36ccfd={'raw':!![],'where':{'id':_0x43e84a[_0x9d84('0x43')]['id']}},_0x5e67d0={};_0x5e67d0[_0x9d84('0x2c')]=_['keys'](db[_0x9d84('0x29')][_0x9d84('0x2a')]);_0x5e67d0[_0x9d84('0x2d')]=_[_0x9d84('0x2e')](_0x43e84a['query']);_0x5e67d0[_0x9d84('0x2f')]=_[_0x9d84('0x30')](_0x5e67d0[_0x9d84('0x2c')],_0x5e67d0[_0x9d84('0x2d')]);_0x36ccfd[_0x9d84('0x31')]=_[_0x9d84('0x30')](_0x5e67d0['model'],qs[_0x9d84('0x32')](_0x43e84a[_0x9d84('0x2d')][_0x9d84('0x32')]));_0x36ccfd[_0x9d84('0x31')]=_0x36ccfd[_0x9d84('0x31')][_0x9d84('0x33')]?_0x36ccfd['attributes']:_0x5e67d0[_0x9d84('0x2c')];if(_0x43e84a['query'][_0x9d84('0x3e')]){_0x36ccfd[_0x9d84('0x3f')]=[{'all':!![]}];}_0x36ccfd=_[_0x9d84('0x3b')]({},_0x36ccfd,_0x43e84a[_0x9d84('0x44')]);return db['Template'][_0x9d84('0x45')](_0x36ccfd)[_0x9d84('0x1f')](handleEntityNotFound(_0xfd6a11,null))[_0x9d84('0x1f')](respondWithResult(_0xfd6a11,null))[_0x9d84('0x46')](handleError(_0xfd6a11,null));};exports[_0x9d84('0x47')]=function(_0x4935ad,_0x57d6d8){return db[_0x9d84('0x29')][_0x9d84('0x47')](_0x4935ad[_0x9d84('0x48')],{})['then'](function(_0x454f7f){var _0x42aaba=_0x4935ad[_0x9d84('0x49')]['get']({'plain':!![]});if(!_0x42aaba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x42aaba[_0x9d84('0x4a')]===_0x9d84('0x49')){var _0x2af481=_0x454f7f[_0x9d84('0x21')]({'plain':!![]});var _0x2af0b1=_0x9d84('0x22');return db[_0x9d84('0x4b')][_0x9d84('0x45')]({'where':{'name':_0x2af0b1,'userProfileId':_0x42aaba['userProfileId']},'raw':!![]})[_0x9d84('0x1f')](function(_0x38f703){if(_0x38f703&&_0x38f703[_0x9d84('0x4c')]===0x0){return db[_0x9d84('0x4d')][_0x9d84('0x47')]({'name':_0x2af481[_0x9d84('0x26')],'resourceId':_0x2af481['id'],'type':_0x38f703[_0x9d84('0x26')],'sectionId':_0x38f703['id']},{})['then'](function(){return _0x454f7f;});}else{return _0x454f7f;}})[_0x9d84('0x46')](function(_0x2d0340){logger[_0x9d84('0x24')](_0x9d84('0x4e'),_0x2d0340);throw _0x2d0340;});}return _0x454f7f;})[_0x9d84('0x1f')](respondWithResult(_0x57d6d8,0xc9))[_0x9d84('0x46')](handleError(_0x57d6d8,null));};exports['update']=function(_0x4145db,_0x1d0a12){if(_0x4145db[_0x9d84('0x48')]['id']){delete _0x4145db[_0x9d84('0x48')]['id'];}return db[_0x9d84('0x29')][_0x9d84('0x45')]({'where':{'id':_0x4145db[_0x9d84('0x43')]['id']}})[_0x9d84('0x1f')](handleEntityNotFound(_0x1d0a12,null))['then'](saveUpdates(_0x4145db[_0x9d84('0x48')],null))[_0x9d84('0x1f')](respondWithResult(_0x1d0a12,null))[_0x9d84('0x46')](handleError(_0x1d0a12,null));};exports[_0x9d84('0x20')]=function(_0x298e2e,_0x382c6f){return db[_0x9d84('0x29')][_0x9d84('0x45')]({'where':{'id':_0x298e2e['params']['id']}})[_0x9d84('0x1f')](handleEntityNotFound(_0x382c6f,null))[_0x9d84('0x1f')](removeEntity(_0x382c6f,null))['catch'](handleError(_0x382c6f,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 794d40e..c471643 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 _0x3d4d=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','tools_templates','util'];(function(_0x4eb9ae,_0x5eaac4){var _0x54c234=function(_0x1dfb08){while(--_0x1dfb08){_0x4eb9ae['push'](_0x4eb9ae['shift']());}};_0x54c234(++_0x5eaac4);}(_0x3d4d,0x182));var _0xd3d4=function(_0x1adca9,_0x2de2f9){_0x1adca9=_0x1adca9-0x0;var _0x49aaf8=_0x3d4d[_0x1adca9];return _0x49aaf8;};'use strict';var _=require('lodash');var util=require(_0xd3d4('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xd3d4('0x1'));var BPromise=require(_0xd3d4('0x2'));var rp=require(_0xd3d4('0x3'));var fs=require('fs');var path=require(_0xd3d4('0x4'));var rimraf=require(_0xd3d4('0x5'));var config=require(_0xd3d4('0x6'));var attributes=require('./template.attributes');module['exports']=function(_0x36a3bb,_0x14bfa9){return _0x36a3bb[_0xd3d4('0x7')]('Template',attributes,{'tableName':_0xd3d4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce39=['moment','request-promise','rimraf','../../config/environment','./template.attributes','Template','tools_templates','lodash','util','api'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xce39,0x11f));var _0x9ce3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce39[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9ce3('0x0'));var util=require(_0x9ce3('0x1'));var logger=require('../../config/logger')(_0x9ce3('0x2'));var moment=require(_0x9ce3('0x3'));var BPromise=require('bluebird');var rp=require(_0x9ce3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ce3('0x5'));var config=require(_0x9ce3('0x6'));var attributes=require(_0x9ce3('0x7'));module['exports']=function(_0xd366e,_0x5ddf7a){return _0xd366e['define'](_0x9ce3('0x8'),attributes,{'tableName':_0x9ce3('0x9'),'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 a83d849..0a55394 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 _0xaa10=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','debug','Template,\x20%s,\x20%s,\x20%s','error','code','message','Template,\x20%s,\x20%s','request\x20sent','result','catch','GetTemplate','Template','options','raw','where','attributes','limit','include','map','model','stringify','lodash'];(function(_0x3201ef,_0x396c2e){var _0x1e2257=function(_0x1b6db6){while(--_0x1b6db6){_0x3201ef['push'](_0x3201ef['shift']());}};_0x1e2257(++_0x396c2e);}(_0xaa10,0x1ac));var _0x0aa1=function(_0x2b66b7,_0x55f6a3){_0x2b66b7=_0x2b66b7-0x0;var _0x5c9a8b=_0xaa10[_0x2b66b7];return _0x5c9a8b;};'use strict';var _=require(_0x0aa1('0x0'));var util=require(_0x0aa1('0x1'));var moment=require(_0x0aa1('0x2'));var BPromise=require(_0x0aa1('0x3'));var rs=require(_0x0aa1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0aa1('0x5'))['db'];var utils=require(_0x0aa1('0x6'));var logger=require('../../config/logger')(_0x0aa1('0x7'));var config=require(_0x0aa1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0aa1('0x9')][_0x0aa1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10ceb0,_0x424b68,_0x3d2840){return new BPromise(function(_0x5399b2,_0xd31a04){return client['request'](_0x10ceb0,_0x3d2840)[_0x0aa1('0xb')](function(_0x1c803d){logger[_0x0aa1('0xc')]('Template,\x20%s,\x20%s',_0x424b68,'request\x20sent');logger[_0x0aa1('0xd')](_0x0aa1('0xe'),_0x424b68,'request\x20sent',JSON['stringify'](_0x1c803d));if(_0x1c803d[_0x0aa1('0xf')]){if(_0x1c803d[_0x0aa1('0xf')][_0x0aa1('0x10')]===0x1f4){logger[_0x0aa1('0xf')]('Template,\x20%s,\x20%s',_0x424b68,_0x1c803d[_0x0aa1('0xf')][_0x0aa1('0x11')]);return _0xd31a04(_0x1c803d[_0x0aa1('0xf')][_0x0aa1('0x11')]);}logger[_0x0aa1('0xf')]('Template,\x20%s,\x20%s',_0x424b68,_0x1c803d[_0x0aa1('0xf')]['message']);return _0x5399b2(_0x1c803d[_0x0aa1('0xf')][_0x0aa1('0x11')]);}else{logger[_0x0aa1('0xc')](_0x0aa1('0x12'),_0x424b68,_0x0aa1('0x13'));_0x5399b2(_0x1c803d[_0x0aa1('0x14')][_0x0aa1('0x11')]);}})[_0x0aa1('0x15')](function(_0x5633c1){logger[_0x0aa1('0xf')]('Template,\x20%s,\x20%s',_0x424b68,_0x5633c1);_0xd31a04(_0x5633c1);});});}exports[_0x0aa1('0x16')]=function(_0x1d4e23){var _0x40a7d9=this;return new Promise(function(_0x23f89d,_0x46278b){return db[_0x0aa1('0x17')]['findAll']({'raw':_0x1d4e23[_0x0aa1('0x18')]?_0x1d4e23['options'][_0x0aa1('0x19')]===undefined?!![]:![]:!![],'where':_0x1d4e23['options']?_0x1d4e23[_0x0aa1('0x18')][_0x0aa1('0x1a')]||null:null,'attributes':_0x1d4e23[_0x0aa1('0x18')]?_0x1d4e23[_0x0aa1('0x18')][_0x0aa1('0x1b')]||null:null,'limit':_0x1d4e23[_0x0aa1('0x18')]?_0x1d4e23[_0x0aa1('0x18')][_0x0aa1('0x1c')]||null:null,'include':_0x1d4e23[_0x0aa1('0x18')]?_0x1d4e23[_0x0aa1('0x18')][_0x0aa1('0x1d')]?_[_0x0aa1('0x1e')](_0x1d4e23[_0x0aa1('0x18')][_0x0aa1('0x1d')],function(_0x411e6b){return{'model':db[_0x411e6b[_0x0aa1('0x1f')]],'as':_0x411e6b['as'],'attributes':_0x411e6b[_0x0aa1('0x1b')],'include':_0x411e6b[_0x0aa1('0x1d')]?_[_0x0aa1('0x1e')](_0x411e6b['include'],function(_0x20e6f6){return{'model':db[_0x20e6f6[_0x0aa1('0x1f')]],'as':_0x20e6f6['as'],'attributes':_0x20e6f6[_0x0aa1('0x1b')],'include':_0x20e6f6[_0x0aa1('0x1d')]?_['map'](_0x20e6f6[_0x0aa1('0x1d')],function(_0x477e9f){return{'model':db[_0x477e9f[_0x0aa1('0x1f')]],'as':_0x477e9f['as'],'attributes':_0x477e9f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0aa1('0xb')](function(_0x52fe14){logger[_0x0aa1('0xc')](_0x0aa1('0x16'),_0x1d4e23);logger['debug'](_0x0aa1('0x16'),_0x1d4e23,JSON[_0x0aa1('0x20')](_0x52fe14));_0x23f89d(_0x52fe14);})[_0x0aa1('0x15')](function(_0x5731c3){logger[_0x0aa1('0xf')](_0x0aa1('0x16'),_0x5731c3[_0x0aa1('0x11')],_0x1d4e23);_0x46278b(_0x40a7d9['error'](0x1f4,_0x5731c3['message']));});});}; \ No newline at end of file +var _0x66ee=['GetTemplate','Template','options','raw','where','attributes','limit','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','error','code','Template,\x20%s,\x20%s','message','result','catch'];(function(_0x18b5fd,_0x5ea562){var _0x1adb88=function(_0x4c1349){while(--_0x4c1349){_0x18b5fd['push'](_0x18b5fd['shift']());}};_0x1adb88(++_0x5ea562);}(_0x66ee,0xb4));var _0xe66e=function(_0x3b4d9e,_0x50544e){_0x3b4d9e=_0x3b4d9e-0x0;var _0x226d99=_0x66ee[_0x3b4d9e];return _0x226d99;};'use strict';var _=require('lodash');var util=require(_0xe66e('0x0'));var moment=require(_0xe66e('0x1'));var BPromise=require(_0xe66e('0x2'));var rs=require(_0xe66e('0x3'));var fs=require('fs');var Redis=require(_0xe66e('0x4'));var db=require(_0xe66e('0x5'))['db'];var utils=require(_0xe66e('0x6'));var logger=require(_0xe66e('0x7'))(_0xe66e('0x8'));var config=require(_0xe66e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe66e('0xa')][_0xe66e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16b5f5,_0x5eb0af,_0x57b034){return new BPromise(function(_0x1eeac3,_0x1dd85f){return client[_0xe66e('0xc')](_0x16b5f5,_0x57b034)[_0xe66e('0xd')](function(_0x34e9f5){logger[_0xe66e('0xe')]('Template,\x20%s,\x20%s',_0x5eb0af,_0xe66e('0xf'));logger[_0xe66e('0x10')]('Template,\x20%s,\x20%s,\x20%s',_0x5eb0af,'request\x20sent',JSON[_0xe66e('0x11')](_0x34e9f5));if(_0x34e9f5[_0xe66e('0x12')]){if(_0x34e9f5[_0xe66e('0x12')][_0xe66e('0x13')]===0x1f4){logger['error'](_0xe66e('0x14'),_0x5eb0af,_0x34e9f5[_0xe66e('0x12')][_0xe66e('0x15')]);return _0x1dd85f(_0x34e9f5[_0xe66e('0x12')][_0xe66e('0x15')]);}logger[_0xe66e('0x12')](_0xe66e('0x14'),_0x5eb0af,_0x34e9f5[_0xe66e('0x12')][_0xe66e('0x15')]);return _0x1eeac3(_0x34e9f5[_0xe66e('0x12')][_0xe66e('0x15')]);}else{logger[_0xe66e('0xe')](_0xe66e('0x14'),_0x5eb0af,_0xe66e('0xf'));_0x1eeac3(_0x34e9f5[_0xe66e('0x16')]['message']);}})[_0xe66e('0x17')](function(_0x1a14ba){logger['error'](_0xe66e('0x14'),_0x5eb0af,_0x1a14ba);_0x1dd85f(_0x1a14ba);});});}exports[_0xe66e('0x18')]=function(_0xa90457){var _0x1691c4=this;return new Promise(function(_0x1c95b4,_0x39199d){return db[_0xe66e('0x19')]['findAll']({'raw':_0xa90457['options']?_0xa90457[_0xe66e('0x1a')][_0xe66e('0x1b')]===undefined?!![]:![]:!![],'where':_0xa90457['options']?_0xa90457[_0xe66e('0x1a')][_0xe66e('0x1c')]||null:null,'attributes':_0xa90457['options']?_0xa90457['options'][_0xe66e('0x1d')]||null:null,'limit':_0xa90457['options']?_0xa90457['options'][_0xe66e('0x1e')]||null:null,'include':_0xa90457[_0xe66e('0x1a')]?_0xa90457['options'][_0xe66e('0x1f')]?_[_0xe66e('0x20')](_0xa90457['options']['include'],function(_0x3cd697){return{'model':db[_0x3cd697['model']],'as':_0x3cd697['as'],'attributes':_0x3cd697[_0xe66e('0x1d')],'include':_0x3cd697[_0xe66e('0x1f')]?_[_0xe66e('0x20')](_0x3cd697['include'],function(_0xccf76d){return{'model':db[_0xccf76d[_0xe66e('0x21')]],'as':_0xccf76d['as'],'attributes':_0xccf76d[_0xe66e('0x1d')],'include':_0xccf76d[_0xe66e('0x1f')]?_[_0xe66e('0x20')](_0xccf76d[_0xe66e('0x1f')],function(_0xc4631f){return{'model':db[_0xc4631f[_0xe66e('0x21')]],'as':_0xc4631f['as'],'attributes':_0xc4631f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xafb198){logger['info'](_0xe66e('0x18'),_0xa90457);logger[_0xe66e('0x10')]('GetTemplate',_0xa90457,JSON[_0xe66e('0x11')](_0xafb198));_0x1c95b4(_0xafb198);})['catch'](function(_0xbd355f){logger['error'](_0xe66e('0x18'),_0xbd355f[_0xe66e('0x15')],_0xa90457);_0x39199d(_0x1691c4[_0xe66e('0x12')](0x1f4,_0xbd355f['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index d369900..708879d 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 _0xfe85=['destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id/all_conditions','/:id/any_conditions','getAnyConditions','getActions','create','addAllCondition','post','/:id/actions','update','delete','/:id'];(function(_0x3267a1,_0x903620){var _0x51acb6=function(_0x5a4af4){while(--_0x5a4af4){_0x3267a1['push'](_0x3267a1['shift']());}};_0x51acb6(++_0x903620);}(_0xfe85,0x75));var _0x5fe8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfe85[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x5fe8('0x0'));var path=require(_0x5fe8('0x1'));var timeout=require(_0x5fe8('0x2'));var express=require('express');var router=express[_0x5fe8('0x3')]();var fs_extra=require(_0x5fe8('0x4'));var auth=require(_0x5fe8('0x5'));var interaction=require(_0x5fe8('0x6'));var config=require(_0x5fe8('0x7'));var controller=require('./trigger.controller');router[_0x5fe8('0x8')]('/',auth[_0x5fe8('0x9')](),controller['index']);router['get']('/:id',auth[_0x5fe8('0x9')](),controller['show']);router[_0x5fe8('0x8')](_0x5fe8('0xa'),auth[_0x5fe8('0x9')](),controller['getAllConditions']);router[_0x5fe8('0x8')](_0x5fe8('0xb'),auth[_0x5fe8('0x9')](),controller[_0x5fe8('0xc')]);router['get']('/:id/actions',auth[_0x5fe8('0x9')](),controller[_0x5fe8('0xd')]);router['post']('/',auth[_0x5fe8('0x9')](),controller[_0x5fe8('0xe')]);router['post'](_0x5fe8('0xa'),auth[_0x5fe8('0x9')](),controller[_0x5fe8('0xf')]);router[_0x5fe8('0x10')]('/:id/any_conditions',auth['isAuthenticated'](),controller['addAnyCondition']);router[_0x5fe8('0x10')](_0x5fe8('0x11'),auth[_0x5fe8('0x9')](),controller['addAction']);router['put']('/:id',auth[_0x5fe8('0x9')](),controller[_0x5fe8('0x12')]);router[_0x5fe8('0x13')](_0x5fe8('0x14'),auth[_0x5fe8('0x9')](),controller[_0x5fe8('0x15')]);module[_0x5fe8('0x16')]=router; \ No newline at end of file +var _0x95a2=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./trigger.controller','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','get','getAnyConditions','getActions','post','create','addAllCondition','/:id/any_conditions','addAnyCondition','/:id/actions','addAction','put','delete','destroy','exports','multer','util'];(function(_0x319c65,_0x2ed6b9){var _0x34f381=function(_0x1118a8){while(--_0x1118a8){_0x319c65['push'](_0x319c65['shift']());}};_0x34f381(++_0x2ed6b9);}(_0x95a2,0x120));var _0x295a=function(_0x476b00,_0x250877){_0x476b00=_0x476b00-0x0;var _0x44ec8e=_0x95a2[_0x476b00];return _0x44ec8e;};'use strict';var multer=require(_0x295a('0x0'));var util=require(_0x295a('0x1'));var path=require('path');var timeout=require(_0x295a('0x2'));var express=require(_0x295a('0x3'));var router=express[_0x295a('0x4')]();var fs_extra=require(_0x295a('0x5'));var auth=require(_0x295a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x295a('0x7'));var controller=require(_0x295a('0x8'));router['get']('/',auth[_0x295a('0x9')](),controller[_0x295a('0xa')]);router['get'](_0x295a('0xb'),auth[_0x295a('0x9')](),controller[_0x295a('0xc')]);router['get'](_0x295a('0xd'),auth[_0x295a('0x9')](),controller[_0x295a('0xe')]);router[_0x295a('0xf')]('/:id/any_conditions',auth[_0x295a('0x9')](),controller[_0x295a('0x10')]);router[_0x295a('0xf')]('/:id/actions',auth[_0x295a('0x9')](),controller[_0x295a('0x11')]);router[_0x295a('0x12')]('/',auth['isAuthenticated'](),controller[_0x295a('0x13')]);router[_0x295a('0x12')](_0x295a('0xd'),auth[_0x295a('0x9')](),controller[_0x295a('0x14')]);router[_0x295a('0x12')](_0x295a('0x15'),auth['isAuthenticated'](),controller[_0x295a('0x16')]);router[_0x295a('0x12')](_0x295a('0x17'),auth[_0x295a('0x9')](),controller[_0x295a('0x18')]);router[_0x295a('0x19')](_0x295a('0xb'),auth[_0x295a('0x9')](),controller['update']);router[_0x295a('0x1a')]('/:id',auth[_0x295a('0x9')](),controller[_0x295a('0x1b')]);module[_0x295a('0x1c')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 29a86a2..617b6a5 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 _0x4094=['STRING','BOOLEAN'];(function(_0x17f7b4,_0x5bd28b){var _0x431e2a=function(_0x4dfc7a){while(--_0x4dfc7a){_0x17f7b4['push'](_0x17f7b4['shift']());}};_0x431e2a(++_0x5bd28b);}(_0x4094,0x1d2));var _0x4409=function(_0xdcbf1e,_0x1cc8cf){_0xdcbf1e=_0xdcbf1e-0x0;var _0x1261b4=_0x4094[_0xdcbf1e];return _0x1261b4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4409('0x0')]},'channel':{'type':Sequelize[_0x4409('0x0')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x4409('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x956f=['sequelize','exports','STRING','BOOLEAN'];(function(_0x4105d3,_0x2adb2a){var _0x3930df=function(_0xa3af2f){while(--_0xa3af2f){_0x4105d3['push'](_0x4105d3['shift']());}};_0x3930df(++_0x2adb2a);}(_0x956f,0x198));var _0xf956=function(_0x5d1d99,_0x10ca23){_0x5d1d99=_0x5d1d99-0x0;var _0x2957ec=_0x956f[_0x5d1d99];return _0x2957ec;};'use strict';var Sequelize=require(_0xf956('0x0'));module[_0xf956('0x1')]={'name':{'type':Sequelize[_0xf956('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf956('0x2')]},'status':{'type':Sequelize[_0xf956('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index f8fb50b..4532a51 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 _0x1eec=['order','getAnyConditions','addAction','TriggerId','getActions','Action','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','Triggers','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','rows','catch','show','params','merge','find','create','user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addAllCondition','TriggerAllId','Condition','getAllConditions','findOne'];(function(_0x1c510a,_0x1413a9){var _0x23cedd=function(_0x3f3e43){while(--_0x3f3e43){_0x1c510a['push'](_0x1c510a['shift']());}};_0x23cedd(++_0x1413a9);}(_0x1eec,0x172));var _0xc1ee=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x1eec[_0x1e4360];return _0x31e6b4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc1ee('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc1ee('0x1'));var BPromise=require(_0xc1ee('0x2'));var Mustache=require('mustache');var util=require(_0xc1ee('0x3'));var path=require(_0xc1ee('0x4'));var sox=require(_0xc1ee('0x5'));var csv=require(_0xc1ee('0x6'));var ejs=require(_0xc1ee('0x7'));var fs=require('fs');var fs_extra=require(_0xc1ee('0x8'));var _=require(_0xc1ee('0x9'));var squel=require(_0xc1ee('0xa'));var crypto=require(_0xc1ee('0xb'));var jsforce=require(_0xc1ee('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc1ee('0x6'));var querystring=require('querystring');var Papa=require(_0xc1ee('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc1ee('0xe'));var as=require(_0xc1ee('0xf'));var hardwareService=require(_0xc1ee('0x10'));var logger=require(_0xc1ee('0x11'))(_0xc1ee('0x12'));var utils=require(_0xc1ee('0x13'));var config=require(_0xc1ee('0x14'));var licenseUtil=require(_0xc1ee('0x15'));var db=require(_0xc1ee('0x16'))['db'];function respondWithStatusCode(_0x40e201,_0x4215ae){_0x4215ae=_0x4215ae||0xcc;return function(_0x35dbb8){if(_0x35dbb8){return _0x40e201[_0xc1ee('0x17')](_0x4215ae);}return _0x40e201['status'](_0x4215ae)[_0xc1ee('0x18')]();};}function respondWithResult(_0x38d815,_0x29fb25){_0x29fb25=_0x29fb25||0xc8;return function(_0x2bcd1a){if(_0x2bcd1a){return _0x38d815[_0xc1ee('0x19')](_0x29fb25)[_0xc1ee('0x1a')](_0x2bcd1a);}};}function respondWithFilteredResult(_0x1c6f88,_0x40e27f){return function(_0x3b3aff){if(_0x3b3aff){var _0x51248e=typeof _0x40e27f[_0xc1ee('0x1b')]===_0xc1ee('0x1c')&&typeof _0x40e27f[_0xc1ee('0x1d')]===_0xc1ee('0x1c');var _0x271a43=_0x3b3aff[_0xc1ee('0x1e')];var _0x3aac88=_0x51248e?0x0:_0x40e27f[_0xc1ee('0x1b')];var _0x5f06d6=_0x51248e?_0x3b3aff[_0xc1ee('0x1e')]:_0x40e27f['offset']+_0x40e27f[_0xc1ee('0x1d')];var _0x14fad8;if(_0x5f06d6>=_0x271a43){_0x5f06d6=_0x271a43;_0x14fad8=0xc8;}else{_0x14fad8=0xce;}_0x1c6f88['status'](_0x14fad8);return _0x1c6f88[_0xc1ee('0x1f')]('Content-Range',_0x3aac88+'-'+_0x5f06d6+'/'+_0x271a43)[_0xc1ee('0x1a')](_0x3b3aff);}return null;};}function patchUpdates(_0x2d4266){return function(_0x3868f2){try{jsonpatch[_0xc1ee('0x20')](_0x3868f2,_0x2d4266,!![]);}catch(_0x27ceae){return BPromise[_0xc1ee('0x21')](_0x27ceae);}return _0x3868f2[_0xc1ee('0x22')]();};}function saveUpdates(_0x21671d,_0x700986){return function(_0x18df7f){if(_0x18df7f){return _0x18df7f[_0xc1ee('0x23')](_0x21671d)[_0xc1ee('0x24')](function(_0x2b9340){return _0x2b9340;});}return null;};}function removeEntity(_0x3b6296,_0x31937f){return function(_0x9c4a33){if(_0x9c4a33){return _0x9c4a33[_0xc1ee('0x25')]()[_0xc1ee('0x24')](function(){var _0x255018=_0x9c4a33[_0xc1ee('0x26')]({'plain':!![]});var _0xfac21b=_0xc1ee('0x27');return db['UserProfileResource'][_0xc1ee('0x25')]({'where':{'type':_0xfac21b,'resourceId':_0x255018['id']}})[_0xc1ee('0x24')](function(){return _0x9c4a33;});})[_0xc1ee('0x24')](function(){_0x3b6296[_0xc1ee('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23cc4b,_0x4d3f3c){return function(_0x1700b3){if(!_0x1700b3){_0x23cc4b[_0xc1ee('0x17')](0x194);}return _0x1700b3;};}function handleError(_0x40b4c3,_0x368292){_0x368292=_0x368292||0x1f4;return function(_0x2c24c2){logger[_0xc1ee('0x28')](_0x2c24c2[_0xc1ee('0x29')]);if(_0x2c24c2[_0xc1ee('0x2a')]){delete _0x2c24c2[_0xc1ee('0x2a')];}_0x40b4c3[_0xc1ee('0x19')](_0x368292)[_0xc1ee('0x2b')](_0x2c24c2);};}exports[_0xc1ee('0x2c')]=function(_0x42ad51,_0x444d9b){var _0x5dfd7e={},_0x45642d={},_0x230186={'count':0x0,'rows':[]};var _0x79c129=_[_0xc1ee('0x2d')](db[_0xc1ee('0x2e')][_0xc1ee('0x2f')],function(_0x35c152){return{'name':_0x35c152[_0xc1ee('0x30')],'type':_0x35c152[_0xc1ee('0x31')]['key']};});_0x45642d[_0xc1ee('0x32')]=_[_0xc1ee('0x2d')](_0x79c129,_0xc1ee('0x2a'));_0x45642d[_0xc1ee('0x33')]=_[_0xc1ee('0x34')](_0x42ad51['query']);_0x45642d[_0xc1ee('0x35')]=_['intersection'](_0x45642d[_0xc1ee('0x32')],_0x45642d['query']);_0x5dfd7e[_0xc1ee('0x36')]=_[_0xc1ee('0x37')](_0x45642d[_0xc1ee('0x32')],qs['fields'](_0x42ad51[_0xc1ee('0x33')][_0xc1ee('0x38')]));_0x5dfd7e[_0xc1ee('0x36')]=_0x5dfd7e[_0xc1ee('0x36')][_0xc1ee('0x39')]?_0x5dfd7e[_0xc1ee('0x36')]:_0x45642d[_0xc1ee('0x32')];if(!_0x42ad51['query'][_0xc1ee('0x3a')](_0xc1ee('0x3b'))){_0x5dfd7e[_0xc1ee('0x1d')]=qs['limit'](_0x42ad51[_0xc1ee('0x33')][_0xc1ee('0x1d')]);_0x5dfd7e['offset']=qs[_0xc1ee('0x1b')](_0x42ad51[_0xc1ee('0x33')][_0xc1ee('0x1b')]);}_0x5dfd7e['order']=qs['sort'](_0x42ad51[_0xc1ee('0x33')][_0xc1ee('0x3c')]);_0x5dfd7e[_0xc1ee('0x3d')]=qs[_0xc1ee('0x35')](_[_0xc1ee('0x3e')](_0x42ad51['query'],_0x45642d[_0xc1ee('0x35')]),_0x79c129);if(_0x42ad51[_0xc1ee('0x33')][_0xc1ee('0x3f')]){_0x5dfd7e['where']=_['merge'](_0x5dfd7e[_0xc1ee('0x3d')],{'$or':_[_0xc1ee('0x2d')](_0x79c129,function(_0x191b39){if(_0x191b39['type']!==_0xc1ee('0x40')){var _0x4dcc0c={};_0x4dcc0c[_0x191b39[_0xc1ee('0x2a')]]={'$like':'%'+_0x42ad51[_0xc1ee('0x33')][_0xc1ee('0x3f')]+'%'};return _0x4dcc0c;}})});}_0x5dfd7e=_['merge']({},_0x5dfd7e,_0x42ad51[_0xc1ee('0x41')]);var _0x403227={'where':_0x5dfd7e[_0xc1ee('0x3d')]};return db['Trigger'][_0xc1ee('0x1e')](_0x403227)[_0xc1ee('0x24')](function(_0x23fc63){_0x230186['count']=_0x23fc63;if(_0x42ad51[_0xc1ee('0x33')][_0xc1ee('0x42')]){_0x5dfd7e['include']=[{'all':!![]}];}return db[_0xc1ee('0x2e')]['findAll'](_0x5dfd7e);})[_0xc1ee('0x24')](function(_0x81d849){_0x230186[_0xc1ee('0x43')]=_0x81d849;return _0x230186;})[_0xc1ee('0x24')](respondWithFilteredResult(_0x444d9b,_0x5dfd7e))[_0xc1ee('0x44')](handleError(_0x444d9b,null));};exports[_0xc1ee('0x45')]=function(_0x2f6ccf,_0x2f475a){var _0xa50cf7={'raw':![],'where':{'id':_0x2f6ccf[_0xc1ee('0x46')]['id']}},_0x2f4a74={};_0x2f4a74[_0xc1ee('0x32')]=_[_0xc1ee('0x34')](db[_0xc1ee('0x2e')]['rawAttributes']);_0x2f4a74[_0xc1ee('0x33')]=_[_0xc1ee('0x34')](_0x2f6ccf['query']);_0x2f4a74['filters']=_['intersection'](_0x2f4a74[_0xc1ee('0x32')],_0x2f4a74['query']);_0xa50cf7[_0xc1ee('0x36')]=_['intersection'](_0x2f4a74['model'],qs[_0xc1ee('0x38')](_0x2f6ccf[_0xc1ee('0x33')][_0xc1ee('0x38')]));_0xa50cf7['attributes']=_0xa50cf7[_0xc1ee('0x36')]['length']?_0xa50cf7['attributes']:_0x2f4a74[_0xc1ee('0x32')];if(_0x2f6ccf[_0xc1ee('0x33')][_0xc1ee('0x42')]){_0xa50cf7['include']=[{'all':!![]}];}_0xa50cf7=_[_0xc1ee('0x47')]({},_0xa50cf7,_0x2f6ccf[_0xc1ee('0x41')]);return db[_0xc1ee('0x2e')][_0xc1ee('0x48')](_0xa50cf7)[_0xc1ee('0x24')](handleEntityNotFound(_0x2f475a,null))['then'](respondWithResult(_0x2f475a,null))[_0xc1ee('0x44')](handleError(_0x2f475a,null));};exports[_0xc1ee('0x49')]=function(_0x2bbbef,_0x1789ba){return db['Trigger'][_0xc1ee('0x49')](_0x2bbbef['body'],{})[_0xc1ee('0x24')](function(_0x1ae4cc){var _0x33f099=_0x2bbbef[_0xc1ee('0x4a')]['get']({'plain':!![]});if(!_0x33f099)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x33f099[_0xc1ee('0x4b')]===_0xc1ee('0x4a')){var _0x206e6c=_0x1ae4cc[_0xc1ee('0x26')]({'plain':!![]});var _0x2e11e7=_0xc1ee('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x2e11e7,'userProfileId':_0x33f099[_0xc1ee('0x4c')]},'raw':!![]})['then'](function(_0x251bb4){if(_0x251bb4&&_0x251bb4['autoAssociation']===0x0){return db[_0xc1ee('0x4d')][_0xc1ee('0x49')]({'name':_0x206e6c[_0xc1ee('0x2a')],'resourceId':_0x206e6c['id'],'type':_0x251bb4[_0xc1ee('0x2a')],'sectionId':_0x251bb4['id']},{})['then'](function(){return _0x1ae4cc;});}else{return _0x1ae4cc;}})[_0xc1ee('0x44')](function(_0x32281a){logger[_0xc1ee('0x28')](_0xc1ee('0x4e'),_0x32281a);throw _0x32281a;});}return _0x1ae4cc;})[_0xc1ee('0x24')](respondWithResult(_0x1789ba,0xc9))[_0xc1ee('0x44')](handleError(_0x1789ba,null));};exports[_0xc1ee('0x23')]=function(_0xef603b,_0x103a67){if(_0xef603b['body']['id']){delete _0xef603b[_0xc1ee('0x4f')]['id'];}return db['Trigger'][_0xc1ee('0x48')]({'where':{'id':_0xef603b[_0xc1ee('0x46')]['id']}})[_0xc1ee('0x24')](handleEntityNotFound(_0x103a67,null))[_0xc1ee('0x24')](saveUpdates(_0xef603b[_0xc1ee('0x4f')],null))[_0xc1ee('0x24')](respondWithResult(_0x103a67,null))[_0xc1ee('0x44')](handleError(_0x103a67,null));};exports[_0xc1ee('0x25')]=function(_0x28a01f,_0x4a52f6){return db['Trigger'][_0xc1ee('0x48')]({'where':{'id':_0x28a01f[_0xc1ee('0x46')]['id']}})[_0xc1ee('0x24')](handleEntityNotFound(_0x4a52f6,null))[_0xc1ee('0x24')](removeEntity(_0x4a52f6,null))[_0xc1ee('0x44')](handleError(_0x4a52f6,null));};exports[_0xc1ee('0x50')]=function(_0x5684c9,_0x427923,_0x126b88){if(_0x5684c9['body']['id']){delete _0x5684c9['body']['id'];}return db[_0xc1ee('0x2e')]['find']({'where':{'id':_0x5684c9[_0xc1ee('0x46')]['id']}})['then'](handleEntityNotFound(_0x427923,null))['then'](function(_0x545a6c){if(_0x545a6c){_0x5684c9['body'][_0xc1ee('0x51')]=_0x545a6c['id'];return db[_0xc1ee('0x52')][_0xc1ee('0x49')](_0x5684c9[_0xc1ee('0x4f')]);}})[_0xc1ee('0x24')](respondWithResult(_0x427923,null))[_0xc1ee('0x44')](handleError(_0x427923,null));};exports['addAnyCondition']=function(_0x1e4f39,_0x4addf9,_0x5cdd97){if(_0x1e4f39[_0xc1ee('0x4f')]['id']){delete _0x1e4f39[_0xc1ee('0x4f')]['id'];}return db[_0xc1ee('0x2e')][_0xc1ee('0x48')]({'where':{'id':_0x1e4f39[_0xc1ee('0x46')]['id']}})[_0xc1ee('0x24')](handleEntityNotFound(_0x4addf9,null))[_0xc1ee('0x24')](function(_0x13e6cf){if(_0x13e6cf){_0x1e4f39[_0xc1ee('0x4f')]['TriggerAnyId']=_0x13e6cf['id'];return db[_0xc1ee('0x52')][_0xc1ee('0x49')](_0x1e4f39[_0xc1ee('0x4f')]);}})[_0xc1ee('0x24')](respondWithResult(_0x4addf9,null))[_0xc1ee('0x44')](handleError(_0x4addf9,null));};exports[_0xc1ee('0x53')]=function(_0xbc4b6d,_0x590416,_0x3fc700){var _0x5c5caa={};var _0xa3eaa8={};var _0x34bcc1;var _0x45523a;return db['Trigger'][_0xc1ee('0x54')]({'where':{'id':_0xbc4b6d[_0xc1ee('0x46')]['id']}})[_0xc1ee('0x24')](handleEntityNotFound(_0x590416,null))[_0xc1ee('0x24')](function(_0x1a0cdf){if(_0x1a0cdf){_0x34bcc1=_0x1a0cdf;_0xa3eaa8['model']=_[_0xc1ee('0x34')](db['Condition'][_0xc1ee('0x2f')]);_0xa3eaa8[_0xc1ee('0x33')]=_[_0xc1ee('0x34')](_0xbc4b6d[_0xc1ee('0x33')]);_0xa3eaa8['filters']=_[_0xc1ee('0x37')](_0xa3eaa8[_0xc1ee('0x32')],_0xa3eaa8[_0xc1ee('0x33')]);_0x5c5caa[_0xc1ee('0x36')]=_[_0xc1ee('0x37')](_0xa3eaa8['model'],qs[_0xc1ee('0x38')](_0xbc4b6d[_0xc1ee('0x33')][_0xc1ee('0x38')]));_0x5c5caa['attributes']=_0x5c5caa[_0xc1ee('0x36')][_0xc1ee('0x39')]?_0x5c5caa[_0xc1ee('0x36')]:_0xa3eaa8[_0xc1ee('0x32')];_0x5c5caa[_0xc1ee('0x55')]=qs[_0xc1ee('0x3c')](_0xbc4b6d[_0xc1ee('0x33')][_0xc1ee('0x3c')]);_0x5c5caa[_0xc1ee('0x3d')]=qs[_0xc1ee('0x35')](_[_0xc1ee('0x3e')](_0xbc4b6d[_0xc1ee('0x33')],_0xa3eaa8[_0xc1ee('0x35')]));if(_0xbc4b6d['query'][_0xc1ee('0x3f')]){_0x5c5caa[_0xc1ee('0x3d')]=_[_0xc1ee('0x47')](_0x5c5caa[_0xc1ee('0x3d')],{'$or':_[_0xc1ee('0x2d')](_0x5c5caa[_0xc1ee('0x36')],function(_0x180d4c){var _0x1e6594={};_0x1e6594[_0x180d4c]={'$like':'%'+_0xbc4b6d[_0xc1ee('0x33')][_0xc1ee('0x3f')]+'%'};return _0x1e6594;})});}_0x5c5caa=_[_0xc1ee('0x47')]({},_0x5c5caa,_0xbc4b6d[_0xc1ee('0x41')]);return _0x34bcc1[_0xc1ee('0x53')](_0x5c5caa);}})[_0xc1ee('0x24')](function(_0xed9325){if(_0xed9325){_0x45523a=_0xed9325[_0xc1ee('0x39')];if(!_0xbc4b6d['query']['hasOwnProperty'](_0xc1ee('0x3b'))){_0x5c5caa[_0xc1ee('0x1d')]=qs[_0xc1ee('0x1d')](_0xbc4b6d[_0xc1ee('0x33')][_0xc1ee('0x1d')]);_0x5c5caa[_0xc1ee('0x1b')]=qs[_0xc1ee('0x1b')](_0xbc4b6d['query'][_0xc1ee('0x1b')]);}return _0x34bcc1[_0xc1ee('0x53')](_0x5c5caa);}})[_0xc1ee('0x24')](function(_0x4d35c3){if(_0x4d35c3){return _0x4d35c3?{'count':_0x45523a,'rows':_0x4d35c3}:null;}})[_0xc1ee('0x24')](respondWithResult(_0x590416,null))[_0xc1ee('0x44')](handleError(_0x590416,null));};exports[_0xc1ee('0x56')]=function(_0x188128,_0x5da920,_0x972853){var _0x2b8021={};var _0x139aaf={};var _0x5b30e9;var _0x4d9d6c;return db['Trigger'][_0xc1ee('0x54')]({'where':{'id':_0x188128['params']['id']}})[_0xc1ee('0x24')](handleEntityNotFound(_0x5da920,null))[_0xc1ee('0x24')](function(_0x396370){if(_0x396370){_0x5b30e9=_0x396370;_0x139aaf[_0xc1ee('0x32')]=_[_0xc1ee('0x34')](db[_0xc1ee('0x52')][_0xc1ee('0x2f')]);_0x139aaf[_0xc1ee('0x33')]=_[_0xc1ee('0x34')](_0x188128[_0xc1ee('0x33')]);_0x139aaf[_0xc1ee('0x35')]=_['intersection'](_0x139aaf[_0xc1ee('0x32')],_0x139aaf['query']);_0x2b8021['attributes']=_['intersection'](_0x139aaf['model'],qs[_0xc1ee('0x38')](_0x188128[_0xc1ee('0x33')][_0xc1ee('0x38')]));_0x2b8021['attributes']=_0x2b8021['attributes'][_0xc1ee('0x39')]?_0x2b8021['attributes']:_0x139aaf[_0xc1ee('0x32')];_0x2b8021[_0xc1ee('0x55')]=qs['sort'](_0x188128['query'][_0xc1ee('0x3c')]);_0x2b8021[_0xc1ee('0x3d')]=qs[_0xc1ee('0x35')](_[_0xc1ee('0x3e')](_0x188128['query'],_0x139aaf['filters']));if(_0x188128[_0xc1ee('0x33')]['filter']){_0x2b8021['where']=_[_0xc1ee('0x47')](_0x2b8021[_0xc1ee('0x3d')],{'$or':_[_0xc1ee('0x2d')](_0x2b8021[_0xc1ee('0x36')],function(_0x35382c){var _0x320f4c={};_0x320f4c[_0x35382c]={'$like':'%'+_0x188128['query'][_0xc1ee('0x3f')]+'%'};return _0x320f4c;})});}_0x2b8021=_[_0xc1ee('0x47')]({},_0x2b8021,_0x188128[_0xc1ee('0x41')]);return _0x5b30e9[_0xc1ee('0x56')](_0x2b8021);}})['then'](function(_0x4dd0be){if(_0x4dd0be){_0x4d9d6c=_0x4dd0be[_0xc1ee('0x39')];if(!_0x188128[_0xc1ee('0x33')][_0xc1ee('0x3a')](_0xc1ee('0x3b'))){_0x2b8021[_0xc1ee('0x1d')]=qs[_0xc1ee('0x1d')](_0x188128[_0xc1ee('0x33')]['limit']);_0x2b8021[_0xc1ee('0x1b')]=qs[_0xc1ee('0x1b')](_0x188128['query'][_0xc1ee('0x1b')]);}return _0x5b30e9['getAnyConditions'](_0x2b8021);}})[_0xc1ee('0x24')](function(_0x52852b){if(_0x52852b){return _0x52852b?{'count':_0x4d9d6c,'rows':_0x52852b}:null;}})[_0xc1ee('0x24')](respondWithResult(_0x5da920,null))[_0xc1ee('0x44')](handleError(_0x5da920,null));};exports[_0xc1ee('0x57')]=function(_0x32850b,_0xd470bd,_0x394cb8){if(_0x32850b['body']['id']){delete _0x32850b['body']['id'];}return db['Trigger'][_0xc1ee('0x48')]({'where':{'id':_0x32850b[_0xc1ee('0x46')]['id']}})['then'](handleEntityNotFound(_0xd470bd,null))[_0xc1ee('0x24')](function(_0x24d80c){if(_0x24d80c){_0x32850b[_0xc1ee('0x4f')][_0xc1ee('0x58')]=_0x24d80c['id'];return db['Action'][_0xc1ee('0x49')](_0x32850b[_0xc1ee('0x4f')]);}})['then'](respondWithResult(_0xd470bd,null))[_0xc1ee('0x44')](handleError(_0xd470bd,null));};exports[_0xc1ee('0x59')]=function(_0x19fb08,_0x37930c,_0x3a25d6){var _0x32edcb={};var _0x225071={};var _0x275c3b;var _0x767871;return db[_0xc1ee('0x2e')][_0xc1ee('0x54')]({'where':{'id':_0x19fb08[_0xc1ee('0x46')]['id']}})[_0xc1ee('0x24')](handleEntityNotFound(_0x37930c,null))[_0xc1ee('0x24')](function(_0x2b9593){if(_0x2b9593){_0x275c3b=_0x2b9593;_0x225071[_0xc1ee('0x32')]=_[_0xc1ee('0x34')](db[_0xc1ee('0x5a')][_0xc1ee('0x2f')]);_0x225071['query']=_[_0xc1ee('0x34')](_0x19fb08[_0xc1ee('0x33')]);_0x225071['filters']=_[_0xc1ee('0x37')](_0x225071['model'],_0x225071[_0xc1ee('0x33')]);_0x32edcb[_0xc1ee('0x36')]=_[_0xc1ee('0x37')](_0x225071[_0xc1ee('0x32')],qs[_0xc1ee('0x38')](_0x19fb08[_0xc1ee('0x33')][_0xc1ee('0x38')]));_0x32edcb['attributes']=_0x32edcb[_0xc1ee('0x36')]['length']?_0x32edcb[_0xc1ee('0x36')]:_0x225071['model'];_0x32edcb[_0xc1ee('0x55')]=qs[_0xc1ee('0x3c')](_0x19fb08[_0xc1ee('0x33')][_0xc1ee('0x3c')]);_0x32edcb[_0xc1ee('0x3d')]=qs['filters'](_[_0xc1ee('0x3e')](_0x19fb08['query'],_0x225071[_0xc1ee('0x35')]));if(_0x19fb08[_0xc1ee('0x33')][_0xc1ee('0x3f')]){_0x32edcb[_0xc1ee('0x3d')]=_[_0xc1ee('0x47')](_0x32edcb['where'],{'$or':_['map'](_0x32edcb[_0xc1ee('0x36')],function(_0x3a2aef){var _0x3a10cc={};_0x3a10cc[_0x3a2aef]={'$like':'%'+_0x19fb08['query']['filter']+'%'};return _0x3a10cc;})});}_0x32edcb=_[_0xc1ee('0x47')]({},_0x32edcb,_0x19fb08[_0xc1ee('0x41')]);return _0x275c3b[_0xc1ee('0x59')](_0x32edcb);}})[_0xc1ee('0x24')](function(_0x47a0d6){if(_0x47a0d6){_0x767871=_0x47a0d6['length'];if(!_0x19fb08[_0xc1ee('0x33')][_0xc1ee('0x3a')](_0xc1ee('0x3b'))){_0x32edcb[_0xc1ee('0x1d')]=qs[_0xc1ee('0x1d')](_0x19fb08[_0xc1ee('0x33')][_0xc1ee('0x1d')]);_0x32edcb[_0xc1ee('0x1b')]=qs['offset'](_0x19fb08['query']['offset']);}return _0x275c3b[_0xc1ee('0x59')](_0x32edcb);}})['then'](function(_0x9e3f29){if(_0x9e3f29){return _0x9e3f29?{'count':_0x767871,'rows':_0x9e3f29}:null;}})[_0xc1ee('0x24')](respondWithResult(_0x37930c,null))[_0xc1ee('0x44')](handleError(_0x37930c,null));}; \ No newline at end of file +var _0xd8a6=['addAnyCondition','getAllConditions','findOne','nolimit','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Triggers','UserProfileResource','destroy','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','options','include','findAll','catch','show','params','length','includeAll','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','addAllCondition','TriggerAllId','Condition'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xd8a6,0x6c));var _0x6d8a=function(_0x5a2bbd,_0x542ede){_0x5a2bbd=_0x5a2bbd-0x0;var _0x42bbe8=_0xd8a6[_0x5a2bbd];return _0x42bbe8;};'use strict';var emlformat=require(_0x6d8a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6d8a('0x1'));var BPromise=require(_0x6d8a('0x2'));var Mustache=require(_0x6d8a('0x3'));var util=require(_0x6d8a('0x4'));var path=require(_0x6d8a('0x5'));var sox=require(_0x6d8a('0x6'));var csv=require(_0x6d8a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d8a('0x8'));var _=require(_0x6d8a('0x9'));var squel=require(_0x6d8a('0xa'));var crypto=require(_0x6d8a('0xb'));var jsforce=require(_0x6d8a('0xc'));var deskjs=require(_0x6d8a('0xd'));var toCsv=require(_0x6d8a('0x7'));var querystring=require(_0x6d8a('0xe'));var Papa=require(_0x6d8a('0xf'));var Redis=require('ioredis');var authService=require(_0x6d8a('0x10'));var qs=require(_0x6d8a('0x11'));var as=require(_0x6d8a('0x12'));var hardwareService=require(_0x6d8a('0x13'));var logger=require(_0x6d8a('0x14'))(_0x6d8a('0x15'));var utils=require(_0x6d8a('0x16'));var config=require(_0x6d8a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6d8a('0x18'))['db'];function respondWithStatusCode(_0x1a7f84,_0x1a9886){_0x1a9886=_0x1a9886||0xcc;return function(_0x50ac56){if(_0x50ac56){return _0x1a7f84[_0x6d8a('0x19')](_0x1a9886);}return _0x1a7f84[_0x6d8a('0x1a')](_0x1a9886)[_0x6d8a('0x1b')]();};}function respondWithResult(_0x6e6b0,_0x2f67e9){_0x2f67e9=_0x2f67e9||0xc8;return function(_0x26b5ed){if(_0x26b5ed){return _0x6e6b0['status'](_0x2f67e9)[_0x6d8a('0x1c')](_0x26b5ed);}};}function respondWithFilteredResult(_0x18a33b,_0xf814e5){return function(_0x19e8a6){if(_0x19e8a6){var _0x1d2a8a=typeof _0xf814e5[_0x6d8a('0x1d')]===_0x6d8a('0x1e')&&typeof _0xf814e5[_0x6d8a('0x1f')]===_0x6d8a('0x1e');var _0x5c6107=_0x19e8a6[_0x6d8a('0x20')];var _0x2f81e1=_0x1d2a8a?0x0:_0xf814e5[_0x6d8a('0x1d')];var _0x2b7446=_0x1d2a8a?_0x19e8a6[_0x6d8a('0x20')]:_0xf814e5[_0x6d8a('0x1d')]+_0xf814e5[_0x6d8a('0x1f')];var _0x547425;if(_0x2b7446>=_0x5c6107){_0x2b7446=_0x5c6107;_0x547425=0xc8;}else{_0x547425=0xce;}_0x18a33b[_0x6d8a('0x1a')](_0x547425);return _0x18a33b[_0x6d8a('0x21')](_0x6d8a('0x22'),_0x2f81e1+'-'+_0x2b7446+'/'+_0x5c6107)[_0x6d8a('0x1c')](_0x19e8a6);}return null;};}function patchUpdates(_0x1f74f4){return function(_0x27e2c4){try{jsonpatch[_0x6d8a('0x23')](_0x27e2c4,_0x1f74f4,!![]);}catch(_0xe2fd7){return BPromise[_0x6d8a('0x24')](_0xe2fd7);}return _0x27e2c4[_0x6d8a('0x25')]();};}function saveUpdates(_0x300e48,_0x503d61){return function(_0xef8057){if(_0xef8057){return _0xef8057[_0x6d8a('0x26')](_0x300e48)[_0x6d8a('0x27')](function(_0x4db7f3){return _0x4db7f3;});}return null;};}function removeEntity(_0x332d3b,_0x58d1f4){return function(_0x4caae9){if(_0x4caae9){return _0x4caae9['destroy']()[_0x6d8a('0x27')](function(){var _0x1aece7=_0x4caae9[_0x6d8a('0x28')]({'plain':!![]});var _0x1aafe7=_0x6d8a('0x29');return db[_0x6d8a('0x2a')][_0x6d8a('0x2b')]({'where':{'type':_0x1aafe7,'resourceId':_0x1aece7['id']}})[_0x6d8a('0x27')](function(){return _0x4caae9;});})['then'](function(){_0x332d3b['status'](0xcc)[_0x6d8a('0x1b')]();});}};}function handleEntityNotFound(_0x5267f9,_0x37b950){return function(_0xdd4764){if(!_0xdd4764){_0x5267f9[_0x6d8a('0x19')](0x194);}return _0xdd4764;};}function handleError(_0x430170,_0x1503d9){_0x1503d9=_0x1503d9||0x1f4;return function(_0x557abd){logger[_0x6d8a('0x2c')](_0x557abd[_0x6d8a('0x2d')]);if(_0x557abd[_0x6d8a('0x2e')]){delete _0x557abd[_0x6d8a('0x2e')];}_0x430170[_0x6d8a('0x1a')](_0x1503d9)[_0x6d8a('0x2f')](_0x557abd);};}exports[_0x6d8a('0x30')]=function(_0x23a01b,_0x54ab85){var _0x232cb6={},_0x5c1be3={},_0x1a218d={'count':0x0,'rows':[]};var _0x21a621=_[_0x6d8a('0x31')](db[_0x6d8a('0x32')][_0x6d8a('0x33')],function(_0x3eb42b){return{'name':_0x3eb42b[_0x6d8a('0x34')],'type':_0x3eb42b['type'][_0x6d8a('0x35')]};});_0x5c1be3['model']=_[_0x6d8a('0x31')](_0x21a621,_0x6d8a('0x2e'));_0x5c1be3[_0x6d8a('0x36')]=_[_0x6d8a('0x37')](_0x23a01b[_0x6d8a('0x36')]);_0x5c1be3[_0x6d8a('0x38')]=_[_0x6d8a('0x39')](_0x5c1be3[_0x6d8a('0x3a')],_0x5c1be3[_0x6d8a('0x36')]);_0x232cb6[_0x6d8a('0x3b')]=_[_0x6d8a('0x39')](_0x5c1be3[_0x6d8a('0x3a')],qs[_0x6d8a('0x3c')](_0x23a01b[_0x6d8a('0x36')][_0x6d8a('0x3c')]));_0x232cb6[_0x6d8a('0x3b')]=_0x232cb6[_0x6d8a('0x3b')]['length']?_0x232cb6[_0x6d8a('0x3b')]:_0x5c1be3[_0x6d8a('0x3a')];if(!_0x23a01b[_0x6d8a('0x36')][_0x6d8a('0x3d')]('nolimit')){_0x232cb6['limit']=qs[_0x6d8a('0x1f')](_0x23a01b['query'][_0x6d8a('0x1f')]);_0x232cb6[_0x6d8a('0x1d')]=qs[_0x6d8a('0x1d')](_0x23a01b['query'][_0x6d8a('0x1d')]);}_0x232cb6[_0x6d8a('0x3e')]=qs[_0x6d8a('0x3f')](_0x23a01b[_0x6d8a('0x36')]['sort']);_0x232cb6[_0x6d8a('0x40')]=qs[_0x6d8a('0x38')](_[_0x6d8a('0x41')](_0x23a01b[_0x6d8a('0x36')],_0x5c1be3['filters']),_0x21a621);if(_0x23a01b['query'][_0x6d8a('0x42')]){_0x232cb6['where']=_['merge'](_0x232cb6[_0x6d8a('0x40')],{'$or':_[_0x6d8a('0x31')](_0x21a621,function(_0xe9a457){if(_0xe9a457[_0x6d8a('0x43')]!==_0x6d8a('0x44')){var _0x5bd71a={};_0x5bd71a[_0xe9a457[_0x6d8a('0x2e')]]={'$like':'%'+_0x23a01b[_0x6d8a('0x36')]['filter']+'%'};return _0x5bd71a;}})});}_0x232cb6=_['merge']({},_0x232cb6,_0x23a01b[_0x6d8a('0x45')]);var _0x3ded13={'where':_0x232cb6[_0x6d8a('0x40')]};return db['Trigger'][_0x6d8a('0x20')](_0x3ded13)[_0x6d8a('0x27')](function(_0x5c4eba){_0x1a218d['count']=_0x5c4eba;if(_0x23a01b[_0x6d8a('0x36')]['includeAll']){_0x232cb6[_0x6d8a('0x46')]=[{'all':!![]}];}return db[_0x6d8a('0x32')][_0x6d8a('0x47')](_0x232cb6);})[_0x6d8a('0x27')](function(_0x47c49f){_0x1a218d['rows']=_0x47c49f;return _0x1a218d;})[_0x6d8a('0x27')](respondWithFilteredResult(_0x54ab85,_0x232cb6))[_0x6d8a('0x48')](handleError(_0x54ab85,null));};exports[_0x6d8a('0x49')]=function(_0x802d73,_0x2af442){var _0x933a1e={'raw':![],'where':{'id':_0x802d73[_0x6d8a('0x4a')]['id']}},_0x4652b7={};_0x4652b7[_0x6d8a('0x3a')]=_[_0x6d8a('0x37')](db[_0x6d8a('0x32')][_0x6d8a('0x33')]);_0x4652b7[_0x6d8a('0x36')]=_[_0x6d8a('0x37')](_0x802d73['query']);_0x4652b7[_0x6d8a('0x38')]=_['intersection'](_0x4652b7[_0x6d8a('0x3a')],_0x4652b7[_0x6d8a('0x36')]);_0x933a1e[_0x6d8a('0x3b')]=_[_0x6d8a('0x39')](_0x4652b7[_0x6d8a('0x3a')],qs[_0x6d8a('0x3c')](_0x802d73[_0x6d8a('0x36')][_0x6d8a('0x3c')]));_0x933a1e[_0x6d8a('0x3b')]=_0x933a1e[_0x6d8a('0x3b')][_0x6d8a('0x4b')]?_0x933a1e[_0x6d8a('0x3b')]:_0x4652b7['model'];if(_0x802d73[_0x6d8a('0x36')][_0x6d8a('0x4c')]){_0x933a1e[_0x6d8a('0x46')]=[{'all':!![]}];}_0x933a1e=_[_0x6d8a('0x4d')]({},_0x933a1e,_0x802d73['options']);return db[_0x6d8a('0x32')]['find'](_0x933a1e)[_0x6d8a('0x27')](handleEntityNotFound(_0x2af442,null))[_0x6d8a('0x27')](respondWithResult(_0x2af442,null))[_0x6d8a('0x48')](handleError(_0x2af442,null));};exports[_0x6d8a('0x4e')]=function(_0x241151,_0x55ed40){return db[_0x6d8a('0x32')]['create'](_0x241151[_0x6d8a('0x4f')],{})[_0x6d8a('0x27')](function(_0x141c61){var _0x1d8813=_0x241151[_0x6d8a('0x50')]['get']({'plain':!![]});if(!_0x1d8813)throw new Error(_0x6d8a('0x51'));if(_0x1d8813[_0x6d8a('0x52')]==='user'){var _0x2224b7=_0x141c61['get']({'plain':!![]});var _0x346721=_0x6d8a('0x29');return db[_0x6d8a('0x53')]['find']({'where':{'name':_0x346721,'userProfileId':_0x1d8813['userProfileId']},'raw':!![]})[_0x6d8a('0x27')](function(_0x32168f){if(_0x32168f&&_0x32168f[_0x6d8a('0x54')]===0x0){return db[_0x6d8a('0x2a')][_0x6d8a('0x4e')]({'name':_0x2224b7['name'],'resourceId':_0x2224b7['id'],'type':_0x32168f[_0x6d8a('0x2e')],'sectionId':_0x32168f['id']},{})[_0x6d8a('0x27')](function(){return _0x141c61;});}else{return _0x141c61;}})[_0x6d8a('0x48')](function(_0x401940){logger[_0x6d8a('0x2c')](_0x6d8a('0x55'),_0x401940);throw _0x401940;});}return _0x141c61;})[_0x6d8a('0x27')](respondWithResult(_0x55ed40,0xc9))[_0x6d8a('0x48')](handleError(_0x55ed40,null));};exports[_0x6d8a('0x26')]=function(_0x2bbf67,_0x2f9ac2){if(_0x2bbf67[_0x6d8a('0x4f')]['id']){delete _0x2bbf67[_0x6d8a('0x4f')]['id'];}return db[_0x6d8a('0x32')][_0x6d8a('0x56')]({'where':{'id':_0x2bbf67[_0x6d8a('0x4a')]['id']}})[_0x6d8a('0x27')](handleEntityNotFound(_0x2f9ac2,null))['then'](saveUpdates(_0x2bbf67[_0x6d8a('0x4f')],null))[_0x6d8a('0x27')](respondWithResult(_0x2f9ac2,null))[_0x6d8a('0x48')](handleError(_0x2f9ac2,null));};exports[_0x6d8a('0x2b')]=function(_0x31cb7f,_0x10c574){return db[_0x6d8a('0x32')][_0x6d8a('0x56')]({'where':{'id':_0x31cb7f['params']['id']}})[_0x6d8a('0x27')](handleEntityNotFound(_0x10c574,null))[_0x6d8a('0x27')](removeEntity(_0x10c574,null))[_0x6d8a('0x48')](handleError(_0x10c574,null));};exports[_0x6d8a('0x57')]=function(_0x2bf5cf,_0x7449ad,_0x29a7ff){if(_0x2bf5cf['body']['id']){delete _0x2bf5cf[_0x6d8a('0x4f')]['id'];}return db['Trigger']['find']({'where':{'id':_0x2bf5cf[_0x6d8a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x7449ad,null))[_0x6d8a('0x27')](function(_0x467eaf){if(_0x467eaf){_0x2bf5cf[_0x6d8a('0x4f')][_0x6d8a('0x58')]=_0x467eaf['id'];return db[_0x6d8a('0x59')][_0x6d8a('0x4e')](_0x2bf5cf['body']);}})[_0x6d8a('0x27')](respondWithResult(_0x7449ad,null))[_0x6d8a('0x48')](handleError(_0x7449ad,null));};exports[_0x6d8a('0x5a')]=function(_0x5b6ff6,_0x1b5476,_0x4f8b20){if(_0x5b6ff6['body']['id']){delete _0x5b6ff6[_0x6d8a('0x4f')]['id'];}return db[_0x6d8a('0x32')][_0x6d8a('0x56')]({'where':{'id':_0x5b6ff6[_0x6d8a('0x4a')]['id']}})[_0x6d8a('0x27')](handleEntityNotFound(_0x1b5476,null))[_0x6d8a('0x27')](function(_0x3ef901){if(_0x3ef901){_0x5b6ff6[_0x6d8a('0x4f')]['TriggerAnyId']=_0x3ef901['id'];return db[_0x6d8a('0x59')]['create'](_0x5b6ff6[_0x6d8a('0x4f')]);}})['then'](respondWithResult(_0x1b5476,null))[_0x6d8a('0x48')](handleError(_0x1b5476,null));};exports[_0x6d8a('0x5b')]=function(_0x1cf3c4,_0x23dcd9,_0x1ce6a2){var _0x248e0c={};var _0x38a3b1={};var _0x3b11d7;var _0x407ed0;return db['Trigger'][_0x6d8a('0x5c')]({'where':{'id':_0x1cf3c4[_0x6d8a('0x4a')]['id']}})[_0x6d8a('0x27')](handleEntityNotFound(_0x23dcd9,null))['then'](function(_0x336637){if(_0x336637){_0x3b11d7=_0x336637;_0x38a3b1[_0x6d8a('0x3a')]=_[_0x6d8a('0x37')](db[_0x6d8a('0x59')][_0x6d8a('0x33')]);_0x38a3b1[_0x6d8a('0x36')]=_[_0x6d8a('0x37')](_0x1cf3c4[_0x6d8a('0x36')]);_0x38a3b1['filters']=_[_0x6d8a('0x39')](_0x38a3b1['model'],_0x38a3b1[_0x6d8a('0x36')]);_0x248e0c['attributes']=_['intersection'](_0x38a3b1[_0x6d8a('0x3a')],qs[_0x6d8a('0x3c')](_0x1cf3c4[_0x6d8a('0x36')]['fields']));_0x248e0c[_0x6d8a('0x3b')]=_0x248e0c[_0x6d8a('0x3b')][_0x6d8a('0x4b')]?_0x248e0c['attributes']:_0x38a3b1[_0x6d8a('0x3a')];_0x248e0c['order']=qs['sort'](_0x1cf3c4[_0x6d8a('0x36')]['sort']);_0x248e0c[_0x6d8a('0x40')]=qs[_0x6d8a('0x38')](_[_0x6d8a('0x41')](_0x1cf3c4[_0x6d8a('0x36')],_0x38a3b1[_0x6d8a('0x38')]));if(_0x1cf3c4['query'][_0x6d8a('0x42')]){_0x248e0c[_0x6d8a('0x40')]=_['merge'](_0x248e0c[_0x6d8a('0x40')],{'$or':_[_0x6d8a('0x31')](_0x248e0c[_0x6d8a('0x3b')],function(_0x4af1bf){var _0x3b932c={};_0x3b932c[_0x4af1bf]={'$like':'%'+_0x1cf3c4[_0x6d8a('0x36')]['filter']+'%'};return _0x3b932c;})});}_0x248e0c=_[_0x6d8a('0x4d')]({},_0x248e0c,_0x1cf3c4[_0x6d8a('0x45')]);return _0x3b11d7[_0x6d8a('0x5b')](_0x248e0c);}})[_0x6d8a('0x27')](function(_0x1cf438){if(_0x1cf438){_0x407ed0=_0x1cf438[_0x6d8a('0x4b')];if(!_0x1cf3c4[_0x6d8a('0x36')][_0x6d8a('0x3d')](_0x6d8a('0x5d'))){_0x248e0c[_0x6d8a('0x1f')]=qs['limit'](_0x1cf3c4[_0x6d8a('0x36')][_0x6d8a('0x1f')]);_0x248e0c['offset']=qs['offset'](_0x1cf3c4['query'][_0x6d8a('0x1d')]);}return _0x3b11d7[_0x6d8a('0x5b')](_0x248e0c);}})[_0x6d8a('0x27')](function(_0x23418a){if(_0x23418a){return _0x23418a?{'count':_0x407ed0,'rows':_0x23418a}:null;}})[_0x6d8a('0x27')](respondWithResult(_0x23dcd9,null))[_0x6d8a('0x48')](handleError(_0x23dcd9,null));};exports[_0x6d8a('0x5e')]=function(_0x262cf9,_0xfa7611,_0x58e5a7){var _0x183b3c={};var _0x180df={};var _0x429f4f;var _0x1df34a;return db[_0x6d8a('0x32')][_0x6d8a('0x5c')]({'where':{'id':_0x262cf9[_0x6d8a('0x4a')]['id']}})[_0x6d8a('0x27')](handleEntityNotFound(_0xfa7611,null))[_0x6d8a('0x27')](function(_0x428030){if(_0x428030){_0x429f4f=_0x428030;_0x180df[_0x6d8a('0x3a')]=_[_0x6d8a('0x37')](db['Condition'][_0x6d8a('0x33')]);_0x180df[_0x6d8a('0x36')]=_[_0x6d8a('0x37')](_0x262cf9[_0x6d8a('0x36')]);_0x180df['filters']=_[_0x6d8a('0x39')](_0x180df[_0x6d8a('0x3a')],_0x180df[_0x6d8a('0x36')]);_0x183b3c[_0x6d8a('0x3b')]=_['intersection'](_0x180df[_0x6d8a('0x3a')],qs[_0x6d8a('0x3c')](_0x262cf9[_0x6d8a('0x36')][_0x6d8a('0x3c')]));_0x183b3c[_0x6d8a('0x3b')]=_0x183b3c['attributes'][_0x6d8a('0x4b')]?_0x183b3c[_0x6d8a('0x3b')]:_0x180df[_0x6d8a('0x3a')];_0x183b3c[_0x6d8a('0x3e')]=qs[_0x6d8a('0x3f')](_0x262cf9['query'][_0x6d8a('0x3f')]);_0x183b3c[_0x6d8a('0x40')]=qs[_0x6d8a('0x38')](_[_0x6d8a('0x41')](_0x262cf9['query'],_0x180df[_0x6d8a('0x38')]));if(_0x262cf9[_0x6d8a('0x36')][_0x6d8a('0x42')]){_0x183b3c[_0x6d8a('0x40')]=_[_0x6d8a('0x4d')](_0x183b3c[_0x6d8a('0x40')],{'$or':_[_0x6d8a('0x31')](_0x183b3c['attributes'],function(_0x15c35e){var _0x1dc7b6={};_0x1dc7b6[_0x15c35e]={'$like':'%'+_0x262cf9[_0x6d8a('0x36')][_0x6d8a('0x42')]+'%'};return _0x1dc7b6;})});}_0x183b3c=_['merge']({},_0x183b3c,_0x262cf9['options']);return _0x429f4f[_0x6d8a('0x5e')](_0x183b3c);}})[_0x6d8a('0x27')](function(_0xa34fc){if(_0xa34fc){_0x1df34a=_0xa34fc[_0x6d8a('0x4b')];if(!_0x262cf9[_0x6d8a('0x36')][_0x6d8a('0x3d')](_0x6d8a('0x5d'))){_0x183b3c['limit']=qs['limit'](_0x262cf9[_0x6d8a('0x36')][_0x6d8a('0x1f')]);_0x183b3c[_0x6d8a('0x1d')]=qs['offset'](_0x262cf9[_0x6d8a('0x36')][_0x6d8a('0x1d')]);}return _0x429f4f['getAnyConditions'](_0x183b3c);}})[_0x6d8a('0x27')](function(_0xe4fb8){if(_0xe4fb8){return _0xe4fb8?{'count':_0x1df34a,'rows':_0xe4fb8}:null;}})['then'](respondWithResult(_0xfa7611,null))[_0x6d8a('0x48')](handleError(_0xfa7611,null));};exports[_0x6d8a('0x5f')]=function(_0x429303,_0x173e40,_0x5eaa87){if(_0x429303[_0x6d8a('0x4f')]['id']){delete _0x429303[_0x6d8a('0x4f')]['id'];}return db[_0x6d8a('0x32')][_0x6d8a('0x56')]({'where':{'id':_0x429303[_0x6d8a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x173e40,null))['then'](function(_0x128dcd){if(_0x128dcd){_0x429303[_0x6d8a('0x4f')][_0x6d8a('0x60')]=_0x128dcd['id'];return db[_0x6d8a('0x61')][_0x6d8a('0x4e')](_0x429303[_0x6d8a('0x4f')]);}})[_0x6d8a('0x27')](respondWithResult(_0x173e40,null))[_0x6d8a('0x48')](handleError(_0x173e40,null));};exports[_0x6d8a('0x62')]=function(_0x499edb,_0x1482a9,_0x3d95ec){var _0x3b0f38={};var _0x3bd6f3={};var _0xe340bf;var _0x54baa7;return db[_0x6d8a('0x32')][_0x6d8a('0x5c')]({'where':{'id':_0x499edb[_0x6d8a('0x4a')]['id']}})[_0x6d8a('0x27')](handleEntityNotFound(_0x1482a9,null))[_0x6d8a('0x27')](function(_0x467e9e){if(_0x467e9e){_0xe340bf=_0x467e9e;_0x3bd6f3[_0x6d8a('0x3a')]=_[_0x6d8a('0x37')](db[_0x6d8a('0x61')][_0x6d8a('0x33')]);_0x3bd6f3['query']=_[_0x6d8a('0x37')](_0x499edb['query']);_0x3bd6f3[_0x6d8a('0x38')]=_[_0x6d8a('0x39')](_0x3bd6f3[_0x6d8a('0x3a')],_0x3bd6f3['query']);_0x3b0f38['attributes']=_[_0x6d8a('0x39')](_0x3bd6f3[_0x6d8a('0x3a')],qs[_0x6d8a('0x3c')](_0x499edb[_0x6d8a('0x36')][_0x6d8a('0x3c')]));_0x3b0f38[_0x6d8a('0x3b')]=_0x3b0f38[_0x6d8a('0x3b')]['length']?_0x3b0f38[_0x6d8a('0x3b')]:_0x3bd6f3[_0x6d8a('0x3a')];_0x3b0f38[_0x6d8a('0x3e')]=qs[_0x6d8a('0x3f')](_0x499edb[_0x6d8a('0x36')]['sort']);_0x3b0f38[_0x6d8a('0x40')]=qs[_0x6d8a('0x38')](_[_0x6d8a('0x41')](_0x499edb[_0x6d8a('0x36')],_0x3bd6f3[_0x6d8a('0x38')]));if(_0x499edb[_0x6d8a('0x36')]['filter']){_0x3b0f38['where']=_[_0x6d8a('0x4d')](_0x3b0f38[_0x6d8a('0x40')],{'$or':_['map'](_0x3b0f38[_0x6d8a('0x3b')],function(_0x5e96ad){var _0x39d58c={};_0x39d58c[_0x5e96ad]={'$like':'%'+_0x499edb[_0x6d8a('0x36')][_0x6d8a('0x42')]+'%'};return _0x39d58c;})});}_0x3b0f38=_['merge']({},_0x3b0f38,_0x499edb['options']);return _0xe340bf['getActions'](_0x3b0f38);}})['then'](function(_0x5c454c){if(_0x5c454c){_0x54baa7=_0x5c454c[_0x6d8a('0x4b')];if(!_0x499edb[_0x6d8a('0x36')]['hasOwnProperty']('nolimit')){_0x3b0f38[_0x6d8a('0x1f')]=qs['limit'](_0x499edb[_0x6d8a('0x36')][_0x6d8a('0x1f')]);_0x3b0f38[_0x6d8a('0x1d')]=qs[_0x6d8a('0x1d')](_0x499edb[_0x6d8a('0x36')][_0x6d8a('0x1d')]);}return _0xe340bf[_0x6d8a('0x62')](_0x3b0f38);}})['then'](function(_0x2c10eb){if(_0x2c10eb){return _0x2c10eb?{'count':_0x54baa7,'rows':_0x2c10eb}:null;}})[_0x6d8a('0x27')](respondWithResult(_0x1482a9,null))[_0x6d8a('0x48')](handleError(_0x1482a9,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 10759fd..e1ad00b 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 _0x4c6d=['moment','request-promise','path','rimraf','./trigger.attributes','exports','define','Trigger','lodash','util','../../config/logger','api'];(function(_0x1196bd,_0xba4aea){var _0x26014f=function(_0x542a3d){while(--_0x542a3d){_0x1196bd['push'](_0x1196bd['shift']());}};_0x26014f(++_0xba4aea);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x2bf409,_0x1ae11b){_0x2bf409=_0x2bf409-0x0;var _0x234033=_0x4c6d[_0x2bf409];return _0x234033;};'use strict';var _=require(_0xd4c6('0x0'));var util=require(_0xd4c6('0x1'));var logger=require(_0xd4c6('0x2'))(_0xd4c6('0x3'));var moment=require(_0xd4c6('0x4'));var BPromise=require('bluebird');var rp=require(_0xd4c6('0x5'));var fs=require('fs');var path=require(_0xd4c6('0x6'));var rimraf=require(_0xd4c6('0x7'));var config=require('../../config/environment');var attributes=require(_0xd4c6('0x8'));module[_0xd4c6('0x9')]=function(_0x56279c,_0x182671){return _0x56279c[_0xd4c6('0xa')](_0xd4c6('0xb'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e9d=['Trigger','tools_triggers','lodash','util','api','moment','bluebird','request-promise','../../config/environment','./trigger.attributes','exports'];(function(_0x478fe5,_0x3bf70b){var _0x371ba3=function(_0x677f27){while(--_0x677f27){_0x478fe5['push'](_0x478fe5['shift']());}};_0x371ba3(++_0x3bf70b);}(_0x3e9d,0x1ba));var _0xd3e9=function(_0x183d78,_0x2b2120){_0x183d78=_0x183d78-0x0;var _0x13dffd=_0x3e9d[_0x183d78];return _0x13dffd;};'use strict';var _=require(_0xd3e9('0x0'));var util=require(_0xd3e9('0x1'));var logger=require('../../config/logger')(_0xd3e9('0x2'));var moment=require(_0xd3e9('0x3'));var BPromise=require(_0xd3e9('0x4'));var rp=require(_0xd3e9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd3e9('0x6'));var attributes=require(_0xd3e9('0x7'));module[_0xd3e9('0x8')]=function(_0x3dea0a,_0x568eea){return _0x3dea0a['define'](_0xd3e9('0x9'),attributes,{'tableName':_0xd3e9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 91d2126..209a678 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 _0x8239=['../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetTrigger','Trigger','findAll','options','map','include','model','attributes','ShowTrigger','find','where','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x372169,_0x2ec7a0){var _0x147f14=function(_0x47daac){while(--_0x47daac){_0x372169['push'](_0x372169['shift']());}};_0x147f14(++_0x2ec7a0);}(_0x8239,0x1e2));var _0x9823=function(_0x1a704c,_0x43d64a){_0x1a704c=_0x1a704c-0x0;var _0x9e1340=_0x8239[_0x1a704c];return _0x9e1340;};'use strict';var _=require('lodash');var util=require(_0x9823('0x0'));var moment=require(_0x9823('0x1'));var BPromise=require(_0x9823('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9823('0x3'));var db=require(_0x9823('0x4'))['db'];var utils=require(_0x9823('0x5'));var logger=require(_0x9823('0x6'))(_0x9823('0x7'));var config=require(_0x9823('0x8'));var jayson=require(_0x9823('0x9'));var client=jayson[_0x9823('0xa')][_0x9823('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3cd0e6,_0x570e3f,_0x589db9){return new BPromise(function(_0x3dadbd,_0x25445f){return client[_0x9823('0xc')](_0x3cd0e6,_0x589db9)[_0x9823('0xd')](function(_0x8fc375){logger[_0x9823('0xe')](_0x9823('0xf'),_0x570e3f,'request\x20sent');logger[_0x9823('0x10')](_0x9823('0x11'),_0x570e3f,'request\x20sent',JSON[_0x9823('0x12')](_0x8fc375));if(_0x8fc375[_0x9823('0x13')]){if(_0x8fc375[_0x9823('0x13')][_0x9823('0x14')]===0x1f4){logger[_0x9823('0x13')](_0x9823('0xf'),_0x570e3f,_0x8fc375['error'][_0x9823('0x15')]);return _0x25445f(_0x8fc375[_0x9823('0x13')][_0x9823('0x15')]);}logger[_0x9823('0x13')](_0x9823('0xf'),_0x570e3f,_0x8fc375[_0x9823('0x13')]['message']);return _0x3dadbd(_0x8fc375[_0x9823('0x13')][_0x9823('0x15')]);}else{logger[_0x9823('0xe')](_0x9823('0xf'),_0x570e3f,_0x9823('0x16'));_0x3dadbd(_0x8fc375['result'][_0x9823('0x15')]);}})[_0x9823('0x17')](function(_0x38c835){logger['error'](_0x9823('0xf'),_0x570e3f,_0x38c835);_0x25445f(_0x38c835);});});}exports[_0x9823('0x18')]=function(_0x347426){var _0x36defc=this;return new Promise(function(_0x23c73e,_0x328d03){return db[_0x9823('0x19')][_0x9823('0x1a')]({'raw':_0x347426[_0x9823('0x1b')]?_0x347426[_0x9823('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x347426[_0x9823('0x1b')]?_0x347426[_0x9823('0x1b')]['where']||null:null,'attributes':_0x347426[_0x9823('0x1b')]?_0x347426[_0x9823('0x1b')]['attributes']||null:null,'limit':_0x347426[_0x9823('0x1b')]?_0x347426[_0x9823('0x1b')]['limit']||null:null,'include':_0x347426['options']?_0x347426[_0x9823('0x1b')]['include']?_[_0x9823('0x1c')](_0x347426[_0x9823('0x1b')][_0x9823('0x1d')],function(_0x493880){return{'model':db[_0x493880[_0x9823('0x1e')]],'as':_0x493880['as'],'attributes':_0x493880['attributes'],'include':_0x493880[_0x9823('0x1d')]?_[_0x9823('0x1c')](_0x493880[_0x9823('0x1d')],function(_0x1fa0b2){return{'model':db[_0x1fa0b2[_0x9823('0x1e')]],'as':_0x1fa0b2['as'],'attributes':_0x1fa0b2[_0x9823('0x1f')],'include':_0x1fa0b2['include']?_[_0x9823('0x1c')](_0x1fa0b2[_0x9823('0x1d')],function(_0x529694){return{'model':db[_0x529694[_0x9823('0x1e')]],'as':_0x529694['as'],'attributes':_0x529694['attributes']};}):[]};}):[]};}):[]:[]})[_0x9823('0xd')](function(_0xa2e84c){logger[_0x9823('0xe')](_0x9823('0x18'),_0x347426);logger['debug'](_0x9823('0x18'),_0x347426,JSON['stringify'](_0xa2e84c));_0x23c73e(_0xa2e84c);})['catch'](function(_0x34469b){logger[_0x9823('0x13')](_0x9823('0x18'),_0x34469b[_0x9823('0x15')],_0x347426);_0x328d03(_0x36defc['error'](0x1f4,_0x34469b[_0x9823('0x15')]));});});};exports[_0x9823('0x20')]=function(_0x4499f7){var _0x4c0634=this;return new Promise(function(_0x444144,_0x18db33){return db[_0x9823('0x19')][_0x9823('0x21')]({'raw':_0x4499f7['options']?_0x4499f7[_0x9823('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4499f7['options']?_0x4499f7[_0x9823('0x1b')][_0x9823('0x22')]||null:null,'attributes':_0x4499f7[_0x9823('0x1b')]?_0x4499f7[_0x9823('0x1b')][_0x9823('0x1f')]||null:null,'include':_0x4499f7[_0x9823('0x1b')]?_0x4499f7[_0x9823('0x1b')]['include']?_[_0x9823('0x1c')](_0x4499f7['options'][_0x9823('0x1d')],function(_0x4ecd43){return{'model':db[_0x4ecd43['model']],'as':_0x4ecd43['as'],'attributes':_0x4ecd43['attributes'],'include':_0x4ecd43['include']?_['map'](_0x4ecd43['include'],function(_0x3cdcf5){return{'model':db[_0x3cdcf5['model']],'as':_0x3cdcf5['as'],'attributes':_0x3cdcf5[_0x9823('0x1f')],'include':_0x3cdcf5[_0x9823('0x1d')]?_[_0x9823('0x1c')](_0x3cdcf5['include'],function(_0x413cde){return{'model':db[_0x413cde[_0x9823('0x1e')]],'as':_0x413cde['as'],'attributes':_0x413cde[_0x9823('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9823('0xd')](function(_0x1d788f){logger[_0x9823('0xe')](_0x9823('0x20'),_0x4499f7);logger[_0x9823('0x10')](_0x9823('0x20'),_0x4499f7,JSON[_0x9823('0x12')](_0x1d788f));_0x444144(_0x1d788f);})['catch'](function(_0x1b5c1b){logger[_0x9823('0x13')](_0x9823('0x20'),_0x1b5c1b['message'],_0x4499f7);_0x18db33(_0x4c0634[_0x9823('0x13')](0x1f4,_0x1b5c1b[_0x9823('0x15')]));});});}; \ No newline at end of file +var _0x8fc7=['ShowTrigger','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','message','catch','Trigger','options','raw','attributes','limit','include','map','model','GetTrigger'];(function(_0x1f3fc9,_0x59811f){var _0x4488fc=function(_0x1e398c){while(--_0x1e398c){_0x1f3fc9['push'](_0x1f3fc9['shift']());}};_0x4488fc(++_0x59811f);}(_0x8fc7,0x182));var _0x78fc=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x8fc7[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require('lodash');var util=require(_0x78fc('0x0'));var moment=require(_0x78fc('0x1'));var BPromise=require(_0x78fc('0x2'));var rs=require(_0x78fc('0x3'));var fs=require('fs');var Redis=require(_0x78fc('0x4'));var db=require(_0x78fc('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x78fc('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x78fc('0x7')][_0x78fc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c84da,_0x56be57,_0x3d3cc9){return new BPromise(function(_0x1486d9,_0x37240c){return client[_0x78fc('0x9')](_0x3c84da,_0x3d3cc9)[_0x78fc('0xa')](function(_0x467b1b){logger[_0x78fc('0xb')]('Trigger,\x20%s,\x20%s',_0x56be57,_0x78fc('0xc'));logger[_0x78fc('0xd')](_0x78fc('0xe'),_0x56be57,_0x78fc('0xc'),JSON[_0x78fc('0xf')](_0x467b1b));if(_0x467b1b[_0x78fc('0x10')]){if(_0x467b1b['error'][_0x78fc('0x11')]===0x1f4){logger[_0x78fc('0x10')](_0x78fc('0x12'),_0x56be57,_0x467b1b[_0x78fc('0x10')][_0x78fc('0x13')]);return _0x37240c(_0x467b1b[_0x78fc('0x10')][_0x78fc('0x13')]);}logger[_0x78fc('0x10')](_0x78fc('0x12'),_0x56be57,_0x467b1b[_0x78fc('0x10')][_0x78fc('0x13')]);return _0x1486d9(_0x467b1b[_0x78fc('0x10')][_0x78fc('0x13')]);}else{logger[_0x78fc('0xb')]('Trigger,\x20%s,\x20%s',_0x56be57,_0x78fc('0xc'));_0x1486d9(_0x467b1b['result'][_0x78fc('0x13')]);}})[_0x78fc('0x14')](function(_0x4a991b){logger[_0x78fc('0x10')]('Trigger,\x20%s,\x20%s',_0x56be57,_0x4a991b);_0x37240c(_0x4a991b);});});}exports['GetTrigger']=function(_0x1fc14b){var _0x4c7caa=this;return new Promise(function(_0x2a73d0,_0x4875ad){return db[_0x78fc('0x15')]['findAll']({'raw':_0x1fc14b[_0x78fc('0x16')]?_0x1fc14b[_0x78fc('0x16')][_0x78fc('0x17')]===undefined?!![]:![]:!![],'where':_0x1fc14b[_0x78fc('0x16')]?_0x1fc14b[_0x78fc('0x16')]['where']||null:null,'attributes':_0x1fc14b[_0x78fc('0x16')]?_0x1fc14b[_0x78fc('0x16')][_0x78fc('0x18')]||null:null,'limit':_0x1fc14b['options']?_0x1fc14b[_0x78fc('0x16')][_0x78fc('0x19')]||null:null,'include':_0x1fc14b[_0x78fc('0x16')]?_0x1fc14b[_0x78fc('0x16')][_0x78fc('0x1a')]?_[_0x78fc('0x1b')](_0x1fc14b[_0x78fc('0x16')][_0x78fc('0x1a')],function(_0x399530){return{'model':db[_0x399530[_0x78fc('0x1c')]],'as':_0x399530['as'],'attributes':_0x399530['attributes'],'include':_0x399530[_0x78fc('0x1a')]?_[_0x78fc('0x1b')](_0x399530[_0x78fc('0x1a')],function(_0x2eda45){return{'model':db[_0x2eda45['model']],'as':_0x2eda45['as'],'attributes':_0x2eda45['attributes'],'include':_0x2eda45[_0x78fc('0x1a')]?_['map'](_0x2eda45[_0x78fc('0x1a')],function(_0x33b643){return{'model':db[_0x33b643['model']],'as':_0x33b643['as'],'attributes':_0x33b643[_0x78fc('0x18')]};}):[]};}):[]};}):[]:[]})[_0x78fc('0xa')](function(_0x4cfab3){logger[_0x78fc('0xb')](_0x78fc('0x1d'),_0x1fc14b);logger['debug']('GetTrigger',_0x1fc14b,JSON[_0x78fc('0xf')](_0x4cfab3));_0x2a73d0(_0x4cfab3);})[_0x78fc('0x14')](function(_0x57d39a){logger[_0x78fc('0x10')]('GetTrigger',_0x57d39a[_0x78fc('0x13')],_0x1fc14b);_0x4875ad(_0x4c7caa[_0x78fc('0x10')](0x1f4,_0x57d39a[_0x78fc('0x13')]));});});};exports[_0x78fc('0x1e')]=function(_0x209d0c){var _0x2a7547=this;return new Promise(function(_0x52755b,_0x176ea5){return db[_0x78fc('0x15')][_0x78fc('0x1f')]({'raw':_0x209d0c['options']?_0x209d0c[_0x78fc('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x209d0c[_0x78fc('0x16')]?_0x209d0c[_0x78fc('0x16')]['where']||null:null,'attributes':_0x209d0c['options']?_0x209d0c[_0x78fc('0x16')][_0x78fc('0x18')]||null:null,'include':_0x209d0c[_0x78fc('0x16')]?_0x209d0c[_0x78fc('0x16')][_0x78fc('0x1a')]?_[_0x78fc('0x1b')](_0x209d0c[_0x78fc('0x16')][_0x78fc('0x1a')],function(_0x59e45e){return{'model':db[_0x59e45e[_0x78fc('0x1c')]],'as':_0x59e45e['as'],'attributes':_0x59e45e[_0x78fc('0x18')],'include':_0x59e45e[_0x78fc('0x1a')]?_[_0x78fc('0x1b')](_0x59e45e['include'],function(_0x54a07f){return{'model':db[_0x54a07f[_0x78fc('0x1c')]],'as':_0x54a07f['as'],'attributes':_0x54a07f[_0x78fc('0x18')],'include':_0x54a07f[_0x78fc('0x1a')]?_[_0x78fc('0x1b')](_0x54a07f['include'],function(_0x2966e0){return{'model':db[_0x2966e0[_0x78fc('0x1c')]],'as':_0x2966e0['as'],'attributes':_0x2966e0[_0x78fc('0x18')]};}):[]};}):[]};}):[]:[]})[_0x78fc('0xa')](function(_0x5713f3){logger[_0x78fc('0xb')]('ShowTrigger',_0x209d0c);logger[_0x78fc('0xd')](_0x78fc('0x1e'),_0x209d0c,JSON[_0x78fc('0xf')](_0x5713f3));_0x52755b(_0x5713f3);})[_0x78fc('0x14')](function(_0x137295){logger[_0x78fc('0x10')]('ShowTrigger',_0x137295['message'],_0x209d0c);_0x176ea5(_0x2a7547[_0x78fc('0x10')](0x1f4,_0x137295['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index c777518..92f0624 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 _0x78b3=['show','post','/:id/clone','put','delete','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','get','isAuthenticated','index','/:id'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x78b3,0x127));var _0x378b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x78b3[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x378b('0x0'));var util=require(_0x378b('0x1'));var path=require(_0x378b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x378b('0x3'));var auth=require(_0x378b('0x4'));var interaction=require(_0x378b('0x5'));var config=require('../../config/environment');var controller=require(_0x378b('0x6'));router[_0x378b('0x7')]('/',auth[_0x378b('0x8')](),controller[_0x378b('0x9')]);router[_0x378b('0x7')](_0x378b('0xa'),auth[_0x378b('0x8')](),controller[_0x378b('0xb')]);router[_0x378b('0xc')](_0x378b('0xd'),auth[_0x378b('0x8')](),controller['clone']);router[_0x378b('0xc')]('/',auth[_0x378b('0x8')](),controller['create']);router[_0x378b('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x378b('0xf')](_0x378b('0xa'),auth[_0x378b('0x8')](),controller['destroy']);module[_0x378b('0x10')]=router; \ No newline at end of file +var _0x682c=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','isAuthenticated','index','get','show','post','clone','create','put','/:id','delete','destroy','multer','util','path'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x682c,0xba));var _0xc682=function(_0x541b78,_0xea3bdb){_0x541b78=_0x541b78-0x0;var _0xf5a5be=_0x682c[_0x541b78];return _0xf5a5be;};'use strict';var multer=require(_0xc682('0x0'));var util=require(_0xc682('0x1'));var path=require(_0xc682('0x2'));var timeout=require(_0xc682('0x3'));var express=require(_0xc682('0x4'));var router=express[_0xc682('0x5')]();var fs_extra=require(_0xc682('0x6'));var auth=require(_0xc682('0x7'));var interaction=require(_0xc682('0x8'));var config=require('../../config/environment');var controller=require(_0xc682('0x9'));router['get']('/',auth[_0xc682('0xa')](),controller[_0xc682('0xb')]);router[_0xc682('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xc682('0xd')]);router[_0xc682('0xe')]('/:id/clone',auth[_0xc682('0xa')](),controller[_0xc682('0xf')]);router['post']('/',auth[_0xc682('0xa')](),controller[_0xc682('0x10')]);router[_0xc682('0x11')](_0xc682('0x12'),auth['isAuthenticated'](),controller['update']);router[_0xc682('0x13')](_0xc682('0x12'),auth[_0xc682('0xa')](),controller[_0xc682('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 5c82b76..8784946 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 _0x3437=['PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','getDataValue','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','inband','auto','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','setDataValue','join','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','never','INTEGER','refuse','originate','uac','uas','pai','fingerprint','active','passive','actpass','dynamic','update,nonat','sequelize','exports','STRING','name','user','friend','ENUM'];(function(_0x53145f,_0x47e237){var _0x4a4dd1=function(_0x249a9a){while(--_0x249a9a){_0x53145f['push'](_0x53145f['shift']());}};_0x4a4dd1(++_0x47e237);}(_0x3437,0x149));var _0x7343=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3437[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x7343('0x0'));module[_0x7343('0x1')]={'name':{'type':Sequelize[_0x7343('0x2')],'allowNull':![],'unique':_0x7343('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('friend',_0x7343('0x4'),'peer'),'allowNull':![],'defaultValue':_0x7343('0x5')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x7343('0x6')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED',_0x7343('0x7'),_0x7343('0x8'),_0x7343('0x9'),_0x7343('0xa'))},'deny':{'type':Sequelize[_0x7343('0x2')]},'permit':{'type':Sequelize[_0x7343('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x7343('0x2')]},'remotesecret':{'type':Sequelize[_0x7343('0x2')]},'transport':{'type':Sequelize[_0x7343('0x2')],'defaultValue':_0x7343('0xb'),'set':function(_0x454476){this['setDataValue']('transport',_0x454476?_0x454476['join'](','):null);},'get':function(){return this[_0x7343('0xc')](_0x7343('0xd'))?this[_0x7343('0xc')]('transport')['split'](','):null;},'comment':_0x7343('0xe')},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0x7343('0xf'),'shortinfo',_0x7343('0x10'),_0x7343('0x11')),'defaultValue':_0x7343('0x12')},'directmedia':{'type':Sequelize['ENUM'](_0x7343('0x13'),'no',_0x7343('0x14'),_0x7343('0x15'),_0x7343('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x7343('0x6')](_0x7343('0x13'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x7343('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x7343('0x17'),'set':function(_0x3adf38){this[_0x7343('0x18')]('nat',_0x3adf38?_0x3adf38[_0x7343('0x19')](','):null);},'get':function(){return this[_0x7343('0xc')](_0x7343('0x1a'))?this[_0x7343('0xc')](_0x7343('0x1a'))[_0x7343('0x1b')](','):null;},'comment':_0x7343('0x1c')},'callgroup':{'type':Sequelize[_0x7343('0x2')]},'namedcallgroup':{'type':Sequelize[_0x7343('0x2')]},'pickupgroup':{'type':Sequelize[_0x7343('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x7343('0x2')]},'language':{'type':Sequelize[_0x7343('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x7343('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x7343('0x2')],'defaultValue':_0x7343('0x1d')},'allow':{'type':Sequelize[_0x7343('0x2')],'allowNull':![],'defaultValue':_0x7343('0x1e'),'set':function(_0x2842d1){this[_0x7343('0x18')]('allow',_0x2842d1?_0x2842d1['join'](';'):_0x7343('0x1e'));},'get':function(){return this['getDataValue'](_0x7343('0x1f'))?this[_0x7343('0xc')]('allow')[_0x7343('0x1b')](';'):null;},'comment':_0x7343('0x20')},'autoframing':{'type':Sequelize['ENUM'](_0x7343('0x13'),'no')},'insecure':{'type':Sequelize[_0x7343('0x2')],'defaultValue':_0x7343('0x21'),'set':function(_0x452b2f){this[_0x7343('0x18')](_0x7343('0x22'),_0x452b2f?_0x452b2f[_0x7343('0x19')](','):null);},'get':function(){return this['getDataValue'](_0x7343('0x22'))?this[_0x7343('0xc')](_0x7343('0x22'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x7343('0x13'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x7343('0x13'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x7343('0x13'),'no',_0x7343('0x23'))},'promiscredir':{'type':Sequelize['ENUM'](_0x7343('0x13'),'no')},'useclientcode':{'type':Sequelize[_0x7343('0x6')](_0x7343('0x13'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x7343('0x2')]},'callerid':{'type':Sequelize[_0x7343('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x7343('0x6')](_0x7343('0x13'),'no'),'defaultValue':_0x7343('0x13')},'busylevel':{'type':Sequelize[_0x7343('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x7343('0x6')](_0x7343('0x13'),'no')},'allowsubscribe':{'type':Sequelize[_0x7343('0x6')](_0x7343('0x13'),'no')},'allowtransfer':{'type':Sequelize['ENUM']('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x7343('0x6')](_0x7343('0x13'),'no')},'subscribecontext':{'type':Sequelize[_0x7343('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize['ENUM'](_0x7343('0x13'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x7343('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x7343('0x6')]('yes','no')},'mailbox':{'type':Sequelize[_0x7343('0x2')]},'session_timers':{'type':Sequelize['ENUM']('accept',_0x7343('0x25'),_0x7343('0x26'))},'session_expires':{'type':Sequelize[_0x7343('0x24')](0xb)},'session_minse':{'type':Sequelize[_0x7343('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0x7343('0x6')](_0x7343('0x27'),_0x7343('0x28')),'defaultValue':_0x7343('0x28')},'t38pt_usertpsource':{'type':Sequelize[_0x7343('0x2')]},'regexten':{'type':Sequelize[_0x7343('0x2')]},'fromdomain':{'type':Sequelize[_0x7343('0x2')]},'fromuser':{'type':Sequelize[_0x7343('0x2')]},'port':{'type':Sequelize[_0x7343('0x24')](0x5)},'qualify':{'type':Sequelize[_0x7343('0x6')]('yes','no'),'defaultValue':_0x7343('0x13')},'keepalive':{'type':Sequelize[_0x7343('0x24')](0xb)},'defaultip':{'type':Sequelize[_0x7343('0x2')]},'defaultuser':{'type':Sequelize[_0x7343('0x2')]},'rtptimeout':{'type':Sequelize[_0x7343('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x7343('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x7343('0x6')]('yes','no',_0x7343('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x7343('0x24')](0xb)},'timerb':{'type':Sequelize[_0x7343('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x7343('0x24')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x7343('0x2')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x7343('0x2')]},'use_q850_reason':{'type':Sequelize[_0x7343('0x2')]},'maxforwards':{'type':Sequelize[_0x7343('0x24')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x7343('0x13'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x7343('0x6')]('yes','no')},'force_avp':{'type':Sequelize[_0x7343('0x6')](_0x7343('0x13'),'no')},'icesupport':{'type':Sequelize[_0x7343('0x6')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x7343('0x6')](_0x7343('0x13'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x7343('0x13'),'no',_0x7343('0x2a'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x7343('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x7343('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x7343('0x2')]},'dtlscipher':{'type':Sequelize[_0x7343('0x2')]},'dtlscafile':{'type':Sequelize[_0x7343('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize['ENUM'](_0x7343('0x2b'),_0x7343('0x2c'),_0x7343('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x7343('0x2')]},'usereqphone':{'type':Sequelize[_0x7343('0x6')](_0x7343('0x13'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x7343('0x2')]},'call_limit':{'type':Sequelize[_0x7343('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x7343('0x6')]('yes','no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x7343('0x13'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x7343('0x2')]},'parkinglot':{'type':Sequelize[_0x7343('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x7343('0x2')],'defaultValue':_0x7343('0x2e')},'canreinvite':{'type':Sequelize[_0x7343('0x6')]('yes','no',_0x7343('0x14'),'update',_0x7343('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x7343('0x2')]},'otherFields':{'type':Sequelize[_0x7343('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x7343('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0xfe91=['user','peer','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','nonat','outgoing','yes','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','never','INTEGER','\x22\x22\x20<>','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','update','update,nonat','BOOLEAN','sequelize','exports','STRING','friend'];(function(_0x59689c,_0x36f091){var _0x12f635=function(_0x3cb0b2){while(--_0x3cb0b2){_0x59689c['push'](_0x59689c['shift']());}};_0x12f635(++_0x36f091);}(_0xfe91,0x134));var _0x1fe9=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0xfe91[_0x397cfb];return _0x15fed9;};'use strict';var Sequelize=require(_0x1fe9('0x0'));module[_0x1fe9('0x1')]={'name':{'type':Sequelize[_0x1fe9('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x1fe9('0x3'),_0x1fe9('0x4'),_0x1fe9('0x5')),'allowNull':![],'defaultValue':_0x1fe9('0x3')},'context':{'type':Sequelize[_0x1fe9('0x2')],'allowNull':![],'defaultValue':_0x1fe9('0x6')},'callingpres':{'type':Sequelize[_0x1fe9('0x7')](_0x1fe9('0x8'),_0x1fe9('0x9'),_0x1fe9('0xa'),_0x1fe9('0xb'),_0x1fe9('0xc'),_0x1fe9('0xd'),'PROHIB_FAILED_SCREEN',_0x1fe9('0xe'))},'deny':{'type':Sequelize[_0x1fe9('0x2')]},'permit':{'type':Sequelize[_0x1fe9('0x2')]},'secret':{'type':Sequelize[_0x1fe9('0x2')]},'md5secret':{'type':Sequelize[_0x1fe9('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x1fe9('0x2')],'defaultValue':_0x1fe9('0xf'),'set':function(_0x4a1ab4){this[_0x1fe9('0x10')](_0x1fe9('0x11'),_0x4a1ab4?_0x4a1ab4[_0x1fe9('0x12')](','):null);},'get':function(){return this[_0x1fe9('0x13')](_0x1fe9('0x11'))?this[_0x1fe9('0x13')](_0x1fe9('0x11'))['split'](','):null;},'comment':_0x1fe9('0x14')},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0x1fe9('0x15'),_0x1fe9('0x16'),_0x1fe9('0x17'),_0x1fe9('0x18')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x1fe9('0x7')]('yes','no',_0x1fe9('0x19'),'update',_0x1fe9('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1fe9('0x7')](_0x1fe9('0x1b'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1fe9('0x2')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x1fe9('0x1c'),'set':function(_0x97dcc9){this[_0x1fe9('0x10')](_0x1fe9('0x1d'),_0x97dcc9?_0x97dcc9['join'](','):null);},'get':function(){return this[_0x1fe9('0x13')](_0x1fe9('0x1d'))?this[_0x1fe9('0x13')](_0x1fe9('0x1d'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x1fe9('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x1fe9('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x1fe9('0x2')]},'language':{'type':Sequelize[_0x1fe9('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1fe9('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x1fe9('0x2')],'defaultValue':_0x1fe9('0x1e')},'allow':{'type':Sequelize[_0x1fe9('0x2')],'allowNull':![],'defaultValue':_0x1fe9('0x1f'),'set':function(_0x571958){this[_0x1fe9('0x10')](_0x1fe9('0x20'),_0x571958?_0x571958[_0x1fe9('0x12')](';'):_0x1fe9('0x1f'));},'get':function(){return this[_0x1fe9('0x13')](_0x1fe9('0x20'))?this[_0x1fe9('0x13')](_0x1fe9('0x20'))[_0x1fe9('0x21')](';'):null;},'comment':_0x1fe9('0x22')},'autoframing':{'type':Sequelize[_0x1fe9('0x7')](_0x1fe9('0x1b'),'no')},'insecure':{'type':Sequelize[_0x1fe9('0x2')],'defaultValue':'port,invite','set':function(_0x1c8399){this[_0x1fe9('0x10')]('insecure',_0x1c8399?_0x1c8399[_0x1fe9('0x12')](','):null);},'get':function(){return this['getDataValue'](_0x1fe9('0x23'))?this[_0x1fe9('0x13')](_0x1fe9('0x23'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x1fe9('0x1b'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1fe9('0x7')](_0x1fe9('0x1b'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x1fe9('0x1b'),'no',_0x1fe9('0x24'))},'promiscredir':{'type':Sequelize[_0x1fe9('0x7')](_0x1fe9('0x1b'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x1fe9('0x1b'),'no')},'accountcode':{'type':Sequelize[_0x1fe9('0x25')](0xb)},'setvar':{'type':Sequelize[_0x1fe9('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x1fe9('0x26')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x1fe9('0x7')]('yes','no'),'defaultValue':_0x1fe9('0x1b')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x1fe9('0x7')](_0x1fe9('0x1b'),'no')},'allowsubscribe':{'type':Sequelize[_0x1fe9('0x7')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x1fe9('0x7')](_0x1fe9('0x1b'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x1fe9('0x1b'),'no')},'subscribecontext':{'type':Sequelize[_0x1fe9('0x2')]},'template':{'type':Sequelize[_0x1fe9('0x2')]},'videosupport':{'type':Sequelize[_0x1fe9('0x7')](_0x1fe9('0x1b'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1fe9('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x1fe9('0x1b'),'no')},'mailbox':{'type':Sequelize[_0x1fe9('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0x1fe9('0x27'),_0x1fe9('0x28'),_0x1fe9('0x29'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x1fe9('0x7')](_0x1fe9('0x2a'),_0x1fe9('0x2b')),'defaultValue':_0x1fe9('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x1fe9('0x2')]},'regexten':{'type':Sequelize[_0x1fe9('0x2')]},'fromdomain':{'type':Sequelize[_0x1fe9('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x1fe9('0x25')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x1fe9('0x1b'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x1fe9('0x25')](0xb)},'defaultip':{'type':Sequelize[_0x1fe9('0x2')]},'defaultuser':{'type':Sequelize[_0x1fe9('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x1fe9('0x25')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x1fe9('0x1b'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1fe9('0x2')]},'callbackextension':{'type':Sequelize[_0x1fe9('0x2')]},'timert1':{'type':Sequelize[_0x1fe9('0x25')](0xb)},'timerb':{'type':Sequelize[_0x1fe9('0x25')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x1fe9('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x1fe9('0x2')]},'maxforwards':{'type':Sequelize[_0x1fe9('0x25')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x1fe9('0x7')](_0x1fe9('0x1b'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0x1fe9('0x1b'),'no')},'icesupport':{'type':Sequelize['ENUM']('yes','no')},'dtlsenable':{'type':Sequelize[_0x1fe9('0x7')]('yes','no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x1fe9('0x1b'),'no',_0x1fe9('0x2c'),_0x1fe9('0x2d'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x1fe9('0x2')]},'dtlscipher':{'type':Sequelize[_0x1fe9('0x2')]},'dtlscafile':{'type':Sequelize[_0x1fe9('0x2')]},'dtlscapath':{'type':Sequelize[_0x1fe9('0x2')]},'dtlssetup':{'type':Sequelize['ENUM'](_0x1fe9('0x2e'),_0x1fe9('0x2f'),_0x1fe9('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1fe9('0x2')]},'usereqphone':{'type':Sequelize[_0x1fe9('0x7')](_0x1fe9('0x1b'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x1fe9('0x2')]},'call_limit':{'type':Sequelize[_0x1fe9('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x1fe9('0x7')](_0x1fe9('0x1b'),'no')},'subscribemwi':{'type':Sequelize[_0x1fe9('0x7')](_0x1fe9('0x1b'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x1fe9('0x2')]},'mohsuggest':{'type':Sequelize[_0x1fe9('0x2')]},'parkinglot':{'type':Sequelize[_0x1fe9('0x2')]},'description':{'type':Sequelize[_0x1fe9('0x2')]},'host':{'type':Sequelize[_0x1fe9('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize['ENUM'](_0x1fe9('0x1b'),'no',_0x1fe9('0x19'),_0x1fe9('0x31'),_0x1fe9('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x1fe9('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x1fe9('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x1fe9('0x2')],'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 06af986..11fcb60 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 _0x55ca=['catch','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','destroy','get','UserProfileResource','end','stack','name','send','Trunk','rawAttributes','type','model','map','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','keys','length','options','find','clone','omit','updatedAt','body','createdAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','render','Reload','chan_sip.so','readFileSync','/etc/asterisk/sip_xcally_registers.conf','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x3e28bf,_0x3bbe69){var _0xfc484e=function(_0x122c2c){while(--_0x122c2c){_0x3e28bf['push'](_0x3e28bf['shift']());}};_0xfc484e(++_0x3bbe69);}(_0x55ca,0x126));var _0xa55c=function(_0x1f0724,_0x3a58bf){_0x1f0724=_0x1f0724-0x0;var _0x253ffb=_0x55ca[_0x1f0724];return _0x253ffb;};'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'];var jayson=require('jayson/promise');var client=jayson['client'][_0xa55c('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x576044,_0x5a3672,_0x59ea8d,_0x18ee85){return new BPromise(function(_0x3930e4,_0x462cd6){var _0x938bd6=_0x18ee85||client;return _0x938bd6[_0xa55c('0x19')](_0x576044,_0x59ea8d)[_0xa55c('0x1a')](function(_0x4e0b2f){logger[_0xa55c('0x1b')](_0xa55c('0x1c'),_0x5a3672,_0xa55c('0x1d'));logger[_0xa55c('0x1e')](_0xa55c('0x1f'),_0x5a3672,_0xa55c('0x1d'),JSON[_0xa55c('0x20')](_0x4e0b2f));if(_0x4e0b2f[_0xa55c('0x21')]){if(_0x4e0b2f[_0xa55c('0x21')]['code']===0x1f4){logger[_0xa55c('0x21')](_0xa55c('0x1c'),_0x5a3672,_0x4e0b2f[_0xa55c('0x21')][_0xa55c('0x22')]);return _0x462cd6(_0x4e0b2f[_0xa55c('0x21')][_0xa55c('0x22')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5a3672,_0x4e0b2f[_0xa55c('0x21')][_0xa55c('0x22')]);return _0x3930e4(_0x4e0b2f[_0xa55c('0x21')]['message']);}else{logger[_0xa55c('0x1b')](_0xa55c('0x1c'),_0x5a3672,'request\x20sent');_0x3930e4(_0x4e0b2f[_0xa55c('0x23')][_0xa55c('0x22')]);}})[_0xa55c('0x24')](function(_0x1965f1){logger[_0xa55c('0x21')]('Trunk,\x20%s,\x20%s',_0x5a3672,_0x1965f1);_0x462cd6(_0x1965f1);});});}function respondWithStatusCode(_0x1fc828,_0x504c24){_0x504c24=_0x504c24||0xcc;return function(_0x5ba836){if(_0x5ba836){return _0x1fc828['sendStatus'](_0x504c24);}return _0x1fc828[_0xa55c('0x25')](_0x504c24)['end']();};}function respondWithResult(_0x3ecbe7,_0x190757){_0x190757=_0x190757||0xc8;return function(_0x3f64de){if(_0x3f64de){return _0x3ecbe7[_0xa55c('0x25')](_0x190757)[_0xa55c('0x26')](_0x3f64de);}};}function respondWithFilteredResult(_0x170ba4,_0x1da633){return function(_0x11e7f7){if(_0x11e7f7){var _0x192df2=typeof _0x1da633[_0xa55c('0x27')]===_0xa55c('0x28')&&typeof _0x1da633['limit']===_0xa55c('0x28');var _0x28814f=_0x11e7f7[_0xa55c('0x29')];var _0x906caa=_0x192df2?0x0:_0x1da633['offset'];var _0x1377b0=_0x192df2?_0x11e7f7[_0xa55c('0x29')]:_0x1da633[_0xa55c('0x27')]+_0x1da633[_0xa55c('0x2a')];var _0x45ee8d;if(_0x1377b0>=_0x28814f){_0x1377b0=_0x28814f;_0x45ee8d=0xc8;}else{_0x45ee8d=0xce;}_0x170ba4[_0xa55c('0x25')](_0x45ee8d);return _0x170ba4['set'](_0xa55c('0x2b'),_0x906caa+'-'+_0x1377b0+'/'+_0x28814f)['json'](_0x11e7f7);}return null;};}function patchUpdates(_0x35c9c2){return function(_0x1d730b){try{jsonpatch[_0xa55c('0x2c')](_0x1d730b,_0x35c9c2,!![]);}catch(_0x223813){return BPromise['reject'](_0x223813);}return _0x1d730b[_0xa55c('0x2d')]();};}function saveUpdates(_0x2096ae,_0x331e58){return function(_0x20da31){if(_0x20da31){return _0x20da31[_0xa55c('0x2e')](_0x2096ae)[_0xa55c('0x1a')](function(_0x29748a){return _0x29748a;});}return null;};}function removeEntity(_0x24d44d,_0x2808e9){return function(_0xcbaf2e){if(_0xcbaf2e){return _0xcbaf2e[_0xa55c('0x2f')]()['then'](function(){var _0x54ca97=_0xcbaf2e[_0xa55c('0x30')]({'plain':!![]});var _0x19733e='Trunks';return db[_0xa55c('0x31')][_0xa55c('0x2f')]({'where':{'type':_0x19733e,'resourceId':_0x54ca97['id']}})[_0xa55c('0x1a')](function(){return _0xcbaf2e;});})[_0xa55c('0x1a')](function(){_0x24d44d[_0xa55c('0x25')](0xcc)[_0xa55c('0x32')]();});}};}function handleEntityNotFound(_0x3ce1b3,_0x222d4b){return function(_0x3959e3){if(!_0x3959e3){_0x3ce1b3['sendStatus'](0x194);}return _0x3959e3;};}function handleError(_0x5f3e99,_0x4b23d3){_0x4b23d3=_0x4b23d3||0x1f4;return function(_0x3fd75f){logger[_0xa55c('0x21')](_0x3fd75f[_0xa55c('0x33')]);if(_0x3fd75f['name']){delete _0x3fd75f[_0xa55c('0x34')];}_0x5f3e99['status'](_0x4b23d3)[_0xa55c('0x35')](_0x3fd75f);};}exports['index']=function(_0x18c6f1,_0x39267c){var _0x3c0ec1={},_0x4d3eb5={},_0x7c4a47={'count':0x0,'rows':[]};var _0x30f23b=_['map'](db[_0xa55c('0x36')][_0xa55c('0x37')],function(_0x4d9083){return{'name':_0x4d9083['fieldName'],'type':_0x4d9083[_0xa55c('0x38')]['key']};});_0x4d3eb5[_0xa55c('0x39')]=_[_0xa55c('0x3a')](_0x30f23b,'name');_0x4d3eb5['query']=_['keys'](_0x18c6f1['query']);_0x4d3eb5[_0xa55c('0x3b')]=_[_0xa55c('0x3c')](_0x4d3eb5[_0xa55c('0x39')],_0x4d3eb5[_0xa55c('0x3d')]);_0x3c0ec1[_0xa55c('0x3e')]=_['intersection'](_0x4d3eb5[_0xa55c('0x39')],qs[_0xa55c('0x3f')](_0x18c6f1[_0xa55c('0x3d')][_0xa55c('0x3f')]));_0x3c0ec1[_0xa55c('0x3e')]=_0x3c0ec1[_0xa55c('0x3e')]['length']?_0x3c0ec1[_0xa55c('0x3e')]:_0x4d3eb5['model'];if(!_0x18c6f1['query'][_0xa55c('0x40')](_0xa55c('0x41'))){_0x3c0ec1['limit']=qs[_0xa55c('0x2a')](_0x18c6f1['query']['limit']);_0x3c0ec1[_0xa55c('0x27')]=qs[_0xa55c('0x27')](_0x18c6f1[_0xa55c('0x3d')]['offset']);}_0x3c0ec1[_0xa55c('0x42')]=qs[_0xa55c('0x43')](_0x18c6f1['query'][_0xa55c('0x43')]);_0x3c0ec1['where']=qs[_0xa55c('0x3b')](_[_0xa55c('0x44')](_0x18c6f1['query'],_0x4d3eb5[_0xa55c('0x3b')]),_0x30f23b);if(_0x18c6f1[_0xa55c('0x3d')]['filter']){_0x3c0ec1[_0xa55c('0x45')]=_[_0xa55c('0x46')](_0x3c0ec1[_0xa55c('0x45')],{'$or':_['map'](_0x30f23b,function(_0x334f52){if(_0x334f52['type']!==_0xa55c('0x47')){var _0x3a8af4={};_0x3a8af4[_0x334f52[_0xa55c('0x34')]]={'$like':'%'+_0x18c6f1['query'][_0xa55c('0x48')]+'%'};return _0x3a8af4;}})});}_0x3c0ec1=_[_0xa55c('0x46')]({},_0x3c0ec1,_0x18c6f1['options']);var _0x3d19f5={'where':_0x3c0ec1[_0xa55c('0x45')]};return db['Trunk'][_0xa55c('0x29')](_0x3d19f5)[_0xa55c('0x1a')](function(_0x52f9a7){_0x7c4a47[_0xa55c('0x29')]=_0x52f9a7;if(_0x18c6f1[_0xa55c('0x3d')][_0xa55c('0x49')]){_0x3c0ec1[_0xa55c('0x4a')]=[{'all':!![]}];}return db['Trunk'][_0xa55c('0x4b')](_0x3c0ec1);})['then'](function(_0x2157d6){_0x7c4a47[_0xa55c('0x4c')]=_0x2157d6;return _0x7c4a47;})[_0xa55c('0x1a')](respondWithFilteredResult(_0x39267c,_0x3c0ec1))['catch'](handleError(_0x39267c,null));};exports[_0xa55c('0x4d')]=function(_0x250b00,_0x574fe9){var _0x5be06={'raw':![],'where':{'id':_0x250b00[_0xa55c('0x4e')]['id']}},_0x34de95={};_0x34de95[_0xa55c('0x39')]=_[_0xa55c('0x4f')](db[_0xa55c('0x36')][_0xa55c('0x37')]);_0x34de95[_0xa55c('0x3d')]=_[_0xa55c('0x4f')](_0x250b00[_0xa55c('0x3d')]);_0x34de95['filters']=_[_0xa55c('0x3c')](_0x34de95[_0xa55c('0x39')],_0x34de95[_0xa55c('0x3d')]);_0x5be06['attributes']=_[_0xa55c('0x3c')](_0x34de95[_0xa55c('0x39')],qs['fields'](_0x250b00[_0xa55c('0x3d')]['fields']));_0x5be06[_0xa55c('0x3e')]=_0x5be06[_0xa55c('0x3e')][_0xa55c('0x50')]?_0x5be06[_0xa55c('0x3e')]:_0x34de95[_0xa55c('0x39')];if(_0x250b00['query'][_0xa55c('0x49')]){_0x5be06[_0xa55c('0x4a')]=[{'all':!![]}];}_0x5be06=_['merge']({},_0x5be06,_0x250b00[_0xa55c('0x51')]);return db[_0xa55c('0x36')][_0xa55c('0x52')](_0x5be06)[_0xa55c('0x1a')](handleEntityNotFound(_0x574fe9,null))['then'](respondWithResult(_0x574fe9,null))['catch'](handleError(_0x574fe9,null));};exports[_0xa55c('0x53')]=function(_0x250dea,_0x3ca5b8){var _0x44ac57={'where':{'id':_0x250dea[_0xa55c('0x4e')]['id']}},_0x54cbde={};_0x54cbde['model']=_[_0xa55c('0x4f')](db[_0xa55c('0x36')][_0xa55c('0x37')]);_0x44ac57[_0xa55c('0x3e')]=_[_0xa55c('0x3c')](_0x54cbde['model'],qs[_0xa55c('0x3f')](_0x250dea['query'][_0xa55c('0x3f')]));_0x44ac57[_0xa55c('0x3e')]=_0x44ac57[_0xa55c('0x3e')][_0xa55c('0x50')]?_0x44ac57[_0xa55c('0x3e')]:_0x54cbde[_0xa55c('0x39')];if(_0x250dea[_0xa55c('0x3d')]['includeAll']){_0x44ac57[_0xa55c('0x4a')]=[{'all':!![]}];}_0x44ac57=_[_0xa55c('0x46')]({},_0x44ac57,_0x250dea[_0xa55c('0x51')]);return db[_0xa55c('0x36')][_0xa55c('0x52')](_0x44ac57)['then'](handleEntityNotFound(_0x3ca5b8,null))[_0xa55c('0x1a')](function(_0x3cd40d){if(_0x3cd40d){var _0x28bac4=_0x3cd40d[_0xa55c('0x30')]({'plain':!![]});_0x28bac4=qs[_0xa55c('0x54')](_0x28bac4,['id','createdAt',_0xa55c('0x55')]);_0x250dea[_0xa55c('0x56')]=_[_0xa55c('0x54')](_0x250dea[_0xa55c('0x56')],['id',_0xa55c('0x57'),'updatedAt']);return db[_0xa55c('0x36')]['create'](_[_0xa55c('0x46')](_0x28bac4,_0x250dea['body']),{'include':_0x250dea[_0xa55c('0x3d')]['includeAll']?[{'all':!![]}]:undefined})[_0xa55c('0x1a')](function(_0x1333da){var _0x21d6b4=_0x250dea[_0xa55c('0x58')][_0xa55c('0x30')]({'plain':!![]});if(!_0x21d6b4)throw new Error(_0xa55c('0x59'));if(_0x21d6b4[_0xa55c('0x5a')]===_0xa55c('0x58')){var _0x14b515=_0x1333da[_0xa55c('0x30')]({'plain':!![]});var _0x51c736=_0xa55c('0x5b');return db[_0xa55c('0x5c')]['find']({'where':{'name':_0x51c736,'userProfileId':_0x21d6b4[_0xa55c('0x5d')]},'raw':!![]})[_0xa55c('0x1a')](function(_0x3e3b4b){if(_0x3e3b4b&&_0x3e3b4b[_0xa55c('0x5e')]===0x0){return db[_0xa55c('0x31')][_0xa55c('0x5f')]({'name':_0x14b515[_0xa55c('0x34')],'resourceId':_0x14b515['id'],'type':_0x3e3b4b[_0xa55c('0x34')],'sectionId':_0x3e3b4b['id']},{})['then'](function(){return _0x1333da;});}else{return _0x1333da;}})[_0xa55c('0x24')](function(_0x475131){logger[_0xa55c('0x21')](_0xa55c('0x60'),_0x475131);throw _0x475131;});}return _0x1333da;});}})[_0xa55c('0x1a')](respondWithResult(_0x3ca5b8,0xc9))[_0xa55c('0x24')](handleError(_0x3ca5b8,null));};exports[_0xa55c('0x5f')]=function(_0x4249c1,_0x25d5a1,_0x4a08ca){var _0x347562;return db[_0xa55c('0x36')][_0xa55c('0x5f')](_0x4249c1[_0xa55c('0x56')],{'raw':!![]})[_0xa55c('0x1a')](function(_0x10e711){_0x347562=_0x10e711;return db[_0xa55c('0x36')][_0xa55c('0x4b')]({'raw':!![]});})[_0xa55c('0x1a')](function(_0x3178a6){var _0x3bbc4b=fs['readFileSync'](path[_0xa55c('0x61')](config['root'],_0xa55c('0x62')),_0xa55c('0x63'));var _0x129bb4=fs['readFileSync'](path['join'](config[_0xa55c('0x64')],_0xa55c('0x65')),_0xa55c('0x63'));var _0x42529f=ejs['render'](_0x3bbc4b,{'trunks':_0x3178a6||[]});fs[_0xa55c('0x66')](_0xa55c('0x67'),_0x42529f);if(_0x347562[_0xa55c('0x68')]){var _0x3a9910=ejs[_0xa55c('0x69')](_0x129bb4,{'trunks':_0x3178a6||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x3a9910);}})[_0xa55c('0x1a')](function(){return respondWithRpcPromise(_0xa55c('0x6a'),_0xa55c('0x5f'),{'module':_0xa55c('0x6b')});})[_0xa55c('0x1a')](function(){var _0x4b2032=_0x4249c1[_0xa55c('0x58')][_0xa55c('0x30')]({'plain':!![]});if(!_0x4b2032)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b2032[_0xa55c('0x5a')]===_0xa55c('0x58')){var _0xa340fb=_0x347562['get']({'plain':!![]});return db[_0xa55c('0x5c')][_0xa55c('0x52')]({'where':{'name':_0xa55c('0x5b'),'userProfileId':_0x4b2032[_0xa55c('0x5d')]},'raw':!![]})[_0xa55c('0x1a')](function(_0x506f74){if(_0x506f74&&_0x506f74[_0xa55c('0x5e')]===0x0){return db[_0xa55c('0x31')]['create']({'name':_0xa340fb['name'],'resourceId':_0xa340fb['id'],'type':_0x506f74[_0xa55c('0x34')],'sectionId':_0x506f74['id']},{})['then'](function(){return _0x347562;});}else{return _0x347562;}})[_0xa55c('0x24')](function(_0x5ca0bc){logger[_0xa55c('0x21')](_0xa55c('0x60'),_0x5ca0bc);throw _0x5ca0bc;});}return _0x347562;})[_0xa55c('0x1a')](respondWithResult(_0x25d5a1,0xc9))[_0xa55c('0x24')](handleError(_0x25d5a1,null));};exports[_0xa55c('0x2e')]=function(_0xff7b1c,_0x16dfc6,_0x5d8551){var _0x463195;return db[_0xa55c('0x36')][_0xa55c('0x52')]({'where':{'id':_0xff7b1c[_0xa55c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x16dfc6,null))[_0xa55c('0x1a')](saveUpdates(_0xff7b1c[_0xa55c('0x56')],null))[_0xa55c('0x1a')](function(_0x2298ac){if(_0x2298ac){_0x463195=_0x2298ac;return db['Trunk']['findAll']({'raw':!![]});}})[_0xa55c('0x1a')](function(_0x428872){if(_0x428872){var _0x12e3a8=fs[_0xa55c('0x6c')](path['join'](config['root'],_0xa55c('0x62')),_0xa55c('0x63'));var _0xd33c9c=fs[_0xa55c('0x6c')](path[_0xa55c('0x61')](config[_0xa55c('0x64')],_0xa55c('0x65')),'utf8');var _0x19497b=ejs['render'](_0x12e3a8,{'trunks':_0x428872||[]});fs[_0xa55c('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x19497b);var _0x36ded7=ejs[_0xa55c('0x69')](_0xd33c9c,{'trunks':_0x428872||[]});fs[_0xa55c('0x66')](_0xa55c('0x6d'),_0x36ded7);return respondWithRpcPromise(_0xa55c('0x6a'),_0xa55c('0x2e'),{'module':_0xa55c('0x6b')});}return null;})[_0xa55c('0x1a')](function(_0x576a1b){if(_0x576a1b){return _0x463195;}})['then'](respondWithResult(_0x16dfc6,null))[_0xa55c('0x24')](handleError(_0x16dfc6,null));};exports[_0xa55c('0x2f')]=function(_0xc2ad5c,_0x256db0,_0x1622cb){var _0x137728;return db['Trunk'][_0xa55c('0x52')]({'where':{'id':_0xc2ad5c[_0xa55c('0x4e')]['id']}})[_0xa55c('0x1a')](handleEntityNotFound(_0x256db0,null))[_0xa55c('0x1a')](removeEntity(_0x256db0,null))[_0xa55c('0x1a')](function(){return db[_0xa55c('0x36')][_0xa55c('0x4b')]({'raw':!![]});})[_0xa55c('0x1a')](function(_0x58b670){var _0x25d09d=fs[_0xa55c('0x6c')](path[_0xa55c('0x61')](config[_0xa55c('0x64')],_0xa55c('0x62')),'utf8');var _0x2685d8=fs[_0xa55c('0x6c')](path['join'](config['root'],_0xa55c('0x65')),_0xa55c('0x63'));var _0x5c2229=ejs['render'](_0x25d09d,{'trunks':_0x58b670});var _0x579726=ejs['render'](_0x2685d8,{'trunks':_0x58b670});fs[_0xa55c('0x66')](_0xa55c('0x67'),_0x5c2229);fs[_0xa55c('0x66')](_0xa55c('0x6d'),_0x579726);return respondWithRpcPromise(_0xa55c('0x6a'),_0xa55c('0x2f'),{'module':'chan_sip.so'});})[_0xa55c('0x24')](handleError(_0x256db0,null));}; \ No newline at end of file +var _0xe14d=['options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','omit','createdAt','updatedAt','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','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','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','UserProfileSection','autoAssociation','readFileSync','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','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','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','get','Trunks','UserProfileResource','destroy','stack','name','map','Trunk','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','where','pick','filter','merge','VIRTUAL'];(function(_0x1dc929,_0x51b2f9){var _0x4b28d9=function(_0x2b0797){while(--_0x2b0797){_0x1dc929['push'](_0x1dc929['shift']());}};_0x4b28d9(++_0x51b2f9);}(_0xe14d,0x1ee));var _0xde14=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xe14d[_0x134c2e];return _0x2825db;};'use strict';var emlformat=require(_0xde14('0x0'));var rimraf=require(_0xde14('0x1'));var zipdir=require(_0xde14('0x2'));var jsonpatch=require(_0xde14('0x3'));var rp=require('request-promise');var moment=require(_0xde14('0x4'));var BPromise=require(_0xde14('0x5'));var Mustache=require('mustache');var util=require(_0xde14('0x6'));var path=require(_0xde14('0x7'));var sox=require(_0xde14('0x8'));var csv=require(_0xde14('0x9'));var ejs=require(_0xde14('0xa'));var fs=require('fs');var fs_extra=require(_0xde14('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xde14('0xc'));var jsforce=require(_0xde14('0xd'));var deskjs=require(_0xde14('0xe'));var toCsv=require(_0xde14('0x9'));var querystring=require(_0xde14('0xf'));var Papa=require(_0xde14('0x10'));var Redis=require(_0xde14('0x11'));var authService=require(_0xde14('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xde14('0x13'));var hardwareService=require(_0xde14('0x14'));var logger=require(_0xde14('0x15'))(_0xde14('0x16'));var utils=require(_0xde14('0x17'));var config=require(_0xde14('0x18'));var licenseUtil=require(_0xde14('0x19'));var db=require(_0xde14('0x1a'))['db'];var jayson=require(_0xde14('0x1b'));var client=jayson[_0xde14('0x1c')][_0xde14('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x464624,_0x3521d4,_0x281c54,_0x1489e9){return new BPromise(function(_0x54c58b,_0x584959){var _0x23c878=_0x1489e9||client;return _0x23c878[_0xde14('0x1e')](_0x464624,_0x281c54)[_0xde14('0x1f')](function(_0x4c86ff){logger[_0xde14('0x20')](_0xde14('0x21'),_0x3521d4,_0xde14('0x22'));logger[_0xde14('0x23')](_0xde14('0x24'),_0x3521d4,_0xde14('0x22'),JSON[_0xde14('0x25')](_0x4c86ff));if(_0x4c86ff[_0xde14('0x26')]){if(_0x4c86ff[_0xde14('0x26')][_0xde14('0x27')]===0x1f4){logger['error'](_0xde14('0x21'),_0x3521d4,_0x4c86ff[_0xde14('0x26')][_0xde14('0x28')]);return _0x584959(_0x4c86ff[_0xde14('0x26')]['message']);}logger[_0xde14('0x26')]('Trunk,\x20%s,\x20%s',_0x3521d4,_0x4c86ff[_0xde14('0x26')]['message']);return _0x54c58b(_0x4c86ff[_0xde14('0x26')][_0xde14('0x28')]);}else{logger[_0xde14('0x20')](_0xde14('0x21'),_0x3521d4,_0xde14('0x22'));_0x54c58b(_0x4c86ff[_0xde14('0x29')][_0xde14('0x28')]);}})[_0xde14('0x2a')](function(_0xdd8d59){logger[_0xde14('0x26')](_0xde14('0x21'),_0x3521d4,_0xdd8d59);_0x584959(_0xdd8d59);});});}function respondWithStatusCode(_0xbaa078,_0x8f8033){_0x8f8033=_0x8f8033||0xcc;return function(_0x5ae4c1){if(_0x5ae4c1){return _0xbaa078[_0xde14('0x2b')](_0x8f8033);}return _0xbaa078[_0xde14('0x2c')](_0x8f8033)[_0xde14('0x2d')]();};}function respondWithResult(_0xbd05d6,_0x1bb7be){_0x1bb7be=_0x1bb7be||0xc8;return function(_0x21ef15){if(_0x21ef15){return _0xbd05d6[_0xde14('0x2c')](_0x1bb7be)[_0xde14('0x2e')](_0x21ef15);}};}function respondWithFilteredResult(_0x1618e1,_0x350a78){return function(_0x4eff65){if(_0x4eff65){var _0x309922=typeof _0x350a78[_0xde14('0x2f')]===_0xde14('0x30')&&typeof _0x350a78[_0xde14('0x31')]==='undefined';var _0x3fc2a4=_0x4eff65[_0xde14('0x32')];var _0x30c4a8=_0x309922?0x0:_0x350a78['offset'];var _0x4655fb=_0x309922?_0x4eff65['count']:_0x350a78[_0xde14('0x2f')]+_0x350a78[_0xde14('0x31')];var _0x3bb1da;if(_0x4655fb>=_0x3fc2a4){_0x4655fb=_0x3fc2a4;_0x3bb1da=0xc8;}else{_0x3bb1da=0xce;}_0x1618e1[_0xde14('0x2c')](_0x3bb1da);return _0x1618e1[_0xde14('0x33')](_0xde14('0x34'),_0x30c4a8+'-'+_0x4655fb+'/'+_0x3fc2a4)[_0xde14('0x2e')](_0x4eff65);}return null;};}function patchUpdates(_0x464666){return function(_0x4e7c5b){try{jsonpatch[_0xde14('0x35')](_0x4e7c5b,_0x464666,!![]);}catch(_0xbf49ac){return BPromise['reject'](_0xbf49ac);}return _0x4e7c5b[_0xde14('0x36')]();};}function saveUpdates(_0x4c9b15,_0x2e40ad){return function(_0x44e88a){if(_0x44e88a){return _0x44e88a[_0xde14('0x37')](_0x4c9b15)[_0xde14('0x1f')](function(_0x13c164){return _0x13c164;});}return null;};}function removeEntity(_0x57fc47,_0x26dfa9){return function(_0x57b98b){if(_0x57b98b){return _0x57b98b['destroy']()[_0xde14('0x1f')](function(){var _0x3c943b=_0x57b98b[_0xde14('0x38')]({'plain':!![]});var _0x319136=_0xde14('0x39');return db[_0xde14('0x3a')][_0xde14('0x3b')]({'where':{'type':_0x319136,'resourceId':_0x3c943b['id']}})[_0xde14('0x1f')](function(){return _0x57b98b;});})[_0xde14('0x1f')](function(){_0x57fc47['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c7136,_0x403007){return function(_0x20913d){if(!_0x20913d){_0x1c7136[_0xde14('0x2b')](0x194);}return _0x20913d;};}function handleError(_0x31cad4,_0x23813f){_0x23813f=_0x23813f||0x1f4;return function(_0x1f42ab){logger[_0xde14('0x26')](_0x1f42ab[_0xde14('0x3c')]);if(_0x1f42ab['name']){delete _0x1f42ab[_0xde14('0x3d')];}_0x31cad4['status'](_0x23813f)['send'](_0x1f42ab);};}exports['index']=function(_0xb0eba6,_0x258759){var _0x398f63={},_0x152dab={},_0x1228d8={'count':0x0,'rows':[]};var _0x8b5bb4=_[_0xde14('0x3e')](db[_0xde14('0x3f')]['rawAttributes'],function(_0xc2a39d){return{'name':_0xc2a39d[_0xde14('0x40')],'type':_0xc2a39d[_0xde14('0x41')][_0xde14('0x42')]};});_0x152dab[_0xde14('0x43')]=_[_0xde14('0x3e')](_0x8b5bb4,_0xde14('0x3d'));_0x152dab[_0xde14('0x44')]=_['keys'](_0xb0eba6[_0xde14('0x44')]);_0x152dab[_0xde14('0x45')]=_[_0xde14('0x46')](_0x152dab[_0xde14('0x43')],_0x152dab['query']);_0x398f63['attributes']=_[_0xde14('0x46')](_0x152dab[_0xde14('0x43')],qs[_0xde14('0x47')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x47')]));_0x398f63['attributes']=_0x398f63[_0xde14('0x48')][_0xde14('0x49')]?_0x398f63[_0xde14('0x48')]:_0x152dab['model'];if(!_0xb0eba6[_0xde14('0x44')]['hasOwnProperty'](_0xde14('0x4a'))){_0x398f63['limit']=qs[_0xde14('0x31')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x31')]);_0x398f63[_0xde14('0x2f')]=qs[_0xde14('0x2f')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x2f')]);}_0x398f63[_0xde14('0x4b')]=qs['sort'](_0xb0eba6[_0xde14('0x44')]['sort']);_0x398f63[_0xde14('0x4c')]=qs['filters'](_[_0xde14('0x4d')](_0xb0eba6[_0xde14('0x44')],_0x152dab[_0xde14('0x45')]),_0x8b5bb4);if(_0xb0eba6[_0xde14('0x44')][_0xde14('0x4e')]){_0x398f63[_0xde14('0x4c')]=_[_0xde14('0x4f')](_0x398f63[_0xde14('0x4c')],{'$or':_['map'](_0x8b5bb4,function(_0x15859c){if(_0x15859c[_0xde14('0x41')]!==_0xde14('0x50')){var _0x4b1ef7={};_0x4b1ef7[_0x15859c['name']]={'$like':'%'+_0xb0eba6[_0xde14('0x44')][_0xde14('0x4e')]+'%'};return _0x4b1ef7;}})});}_0x398f63=_[_0xde14('0x4f')]({},_0x398f63,_0xb0eba6[_0xde14('0x51')]);var _0x39572b={'where':_0x398f63[_0xde14('0x4c')]};return db['Trunk'][_0xde14('0x32')](_0x39572b)['then'](function(_0xa408ec){_0x1228d8[_0xde14('0x32')]=_0xa408ec;if(_0xb0eba6['query'][_0xde14('0x52')]){_0x398f63[_0xde14('0x53')]=[{'all':!![]}];}return db[_0xde14('0x3f')][_0xde14('0x54')](_0x398f63);})[_0xde14('0x1f')](function(_0x1c87e1){_0x1228d8[_0xde14('0x55')]=_0x1c87e1;return _0x1228d8;})['then'](respondWithFilteredResult(_0x258759,_0x398f63))[_0xde14('0x2a')](handleError(_0x258759,null));};exports['show']=function(_0xfa80c8,_0x6aa9ab){var _0x237be4={'raw':![],'where':{'id':_0xfa80c8[_0xde14('0x56')]['id']}},_0x235202={};_0x235202[_0xde14('0x43')]=_[_0xde14('0x57')](db[_0xde14('0x3f')][_0xde14('0x58')]);_0x235202[_0xde14('0x44')]=_['keys'](_0xfa80c8[_0xde14('0x44')]);_0x235202[_0xde14('0x45')]=_[_0xde14('0x46')](_0x235202[_0xde14('0x43')],_0x235202[_0xde14('0x44')]);_0x237be4['attributes']=_[_0xde14('0x46')](_0x235202['model'],qs[_0xde14('0x47')](_0xfa80c8[_0xde14('0x44')][_0xde14('0x47')]));_0x237be4[_0xde14('0x48')]=_0x237be4[_0xde14('0x48')]['length']?_0x237be4['attributes']:_0x235202[_0xde14('0x43')];if(_0xfa80c8['query'][_0xde14('0x52')]){_0x237be4[_0xde14('0x53')]=[{'all':!![]}];}_0x237be4=_[_0xde14('0x4f')]({},_0x237be4,_0xfa80c8[_0xde14('0x51')]);return db[_0xde14('0x3f')][_0xde14('0x59')](_0x237be4)[_0xde14('0x1f')](handleEntityNotFound(_0x6aa9ab,null))[_0xde14('0x1f')](respondWithResult(_0x6aa9ab,null))[_0xde14('0x2a')](handleError(_0x6aa9ab,null));};exports['clone']=function(_0x205a94,_0x2c972b){var _0x1ea6d2={'where':{'id':_0x205a94[_0xde14('0x56')]['id']}},_0x21d226={};_0x21d226['model']=_[_0xde14('0x57')](db['Trunk'][_0xde14('0x58')]);_0x1ea6d2[_0xde14('0x48')]=_[_0xde14('0x46')](_0x21d226[_0xde14('0x43')],qs[_0xde14('0x47')](_0x205a94[_0xde14('0x44')][_0xde14('0x47')]));_0x1ea6d2[_0xde14('0x48')]=_0x1ea6d2['attributes']['length']?_0x1ea6d2['attributes']:_0x21d226[_0xde14('0x43')];if(_0x205a94['query']['includeAll']){_0x1ea6d2[_0xde14('0x53')]=[{'all':!![]}];}_0x1ea6d2=_[_0xde14('0x4f')]({},_0x1ea6d2,_0x205a94[_0xde14('0x51')]);return db[_0xde14('0x3f')][_0xde14('0x59')](_0x1ea6d2)[_0xde14('0x1f')](handleEntityNotFound(_0x2c972b,null))[_0xde14('0x1f')](function(_0x13f698){if(_0x13f698){var _0x2dd108=_0x13f698['get']({'plain':!![]});_0x2dd108=qs[_0xde14('0x5a')](_0x2dd108,['id',_0xde14('0x5b'),_0xde14('0x5c')]);_0x205a94['body']=_[_0xde14('0x5a')](_0x205a94['body'],['id',_0xde14('0x5b'),_0xde14('0x5c')]);return db[_0xde14('0x3f')][_0xde14('0x5d')](_[_0xde14('0x4f')](_0x2dd108,_0x205a94[_0xde14('0x5e')]),{'include':_0x205a94[_0xde14('0x44')]['includeAll']?[{'all':!![]}]:undefined})[_0xde14('0x1f')](function(_0x25ba7e){var _0x1a0bb1=_0x205a94[_0xde14('0x5f')][_0xde14('0x38')]({'plain':!![]});if(!_0x1a0bb1)throw new Error(_0xde14('0x60'));if(_0x1a0bb1[_0xde14('0x61')]==='user'){var _0x4a9e85=_0x25ba7e[_0xde14('0x38')]({'plain':!![]});var _0x19a162=_0xde14('0x39');return db['UserProfileSection'][_0xde14('0x59')]({'where':{'name':_0x19a162,'userProfileId':_0x1a0bb1[_0xde14('0x62')]},'raw':!![]})[_0xde14('0x1f')](function(_0x32e075){if(_0x32e075&&_0x32e075['autoAssociation']===0x0){return db['UserProfileResource'][_0xde14('0x5d')]({'name':_0x4a9e85[_0xde14('0x3d')],'resourceId':_0x4a9e85['id'],'type':_0x32e075[_0xde14('0x3d')],'sectionId':_0x32e075['id']},{})[_0xde14('0x1f')](function(){return _0x25ba7e;});}else{return _0x25ba7e;}})[_0xde14('0x2a')](function(_0x120284){logger[_0xde14('0x26')](_0xde14('0x63'),_0x120284);throw _0x120284;});}return _0x25ba7e;});}})[_0xde14('0x1f')](respondWithResult(_0x2c972b,0xc9))[_0xde14('0x2a')](handleError(_0x2c972b,null));};exports[_0xde14('0x5d')]=function(_0x299b69,_0x1ff577,_0x42329a){var _0x6a641f;return db[_0xde14('0x3f')][_0xde14('0x5d')](_0x299b69[_0xde14('0x5e')],{'raw':!![]})[_0xde14('0x1f')](function(_0x1b5d70){_0x6a641f=_0x1b5d70;return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});})[_0xde14('0x1f')](function(_0x4809fa){var _0x1084fb=fs['readFileSync'](path[_0xde14('0x64')](config['root'],_0xde14('0x65')),_0xde14('0x66'));var _0x3aaba2=fs['readFileSync'](path['join'](config[_0xde14('0x67')],_0xde14('0x68')),_0xde14('0x66'));var _0x430bdb=ejs['render'](_0x1084fb,{'trunks':_0x4809fa||[]});fs[_0xde14('0x69')](_0xde14('0x6a'),_0x430bdb);if(_0x6a641f[_0xde14('0x6b')]){var _0x500344=ejs['render'](_0x3aaba2,{'trunks':_0x4809fa||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x500344);}})[_0xde14('0x1f')](function(){return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x5d'),{'module':'chan_sip.so'});})[_0xde14('0x1f')](function(){var _0x37f7c3=_0x299b69[_0xde14('0x5f')][_0xde14('0x38')]({'plain':!![]});if(!_0x37f7c3)throw new Error(_0xde14('0x60'));if(_0x37f7c3[_0xde14('0x61')]==='user'){var _0x579a6c=_0x6a641f[_0xde14('0x38')]({'plain':!![]});return db[_0xde14('0x6d')]['find']({'where':{'name':_0xde14('0x39'),'userProfileId':_0x37f7c3[_0xde14('0x62')]},'raw':!![]})[_0xde14('0x1f')](function(_0x367ede){if(_0x367ede&&_0x367ede[_0xde14('0x6e')]===0x0){return db[_0xde14('0x3a')][_0xde14('0x5d')]({'name':_0x579a6c['name'],'resourceId':_0x579a6c['id'],'type':_0x367ede['name'],'sectionId':_0x367ede['id']},{})['then'](function(){return _0x6a641f;});}else{return _0x6a641f;}})['catch'](function(_0x3dbda9){logger[_0xde14('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3dbda9);throw _0x3dbda9;});}return _0x6a641f;})['then'](respondWithResult(_0x1ff577,0xc9))[_0xde14('0x2a')](handleError(_0x1ff577,null));};exports[_0xde14('0x37')]=function(_0xe2b9f5,_0x5805ec,_0x1aa75d){var _0x2b1e2e;return db['Trunk'][_0xde14('0x59')]({'where':{'id':_0xe2b9f5[_0xde14('0x56')]['id']}})[_0xde14('0x1f')](handleEntityNotFound(_0x5805ec,null))[_0xde14('0x1f')](saveUpdates(_0xe2b9f5['body'],null))[_0xde14('0x1f')](function(_0x5a5b25){if(_0x5a5b25){_0x2b1e2e=_0x5a5b25;return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});}})[_0xde14('0x1f')](function(_0x5f49d1){if(_0x5f49d1){var _0x283eb8=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],_0xde14('0x65')),'utf8');var _0x53433d=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],'server/files/templates/registry.ejs'),_0xde14('0x66'));var _0x1a12b5=ejs[_0xde14('0x70')](_0x283eb8,{'trunks':_0x5f49d1||[]});fs[_0xde14('0x69')](_0xde14('0x6a'),_0x1a12b5);var _0x2cc5b7=ejs[_0xde14('0x70')](_0x53433d,{'trunks':_0x5f49d1||[]});fs['writeFileSync'](_0xde14('0x71'),_0x2cc5b7);return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x37'),{'module':_0xde14('0x72')});}return null;})[_0xde14('0x1f')](function(_0x1732d0){if(_0x1732d0){return _0x2b1e2e;}})[_0xde14('0x1f')](respondWithResult(_0x5805ec,null))['catch'](handleError(_0x5805ec,null));};exports[_0xde14('0x3b')]=function(_0x1bdeae,_0x5f4b92,_0x4543f1){var _0x4a0108;return db[_0xde14('0x3f')]['find']({'where':{'id':_0x1bdeae[_0xde14('0x56')]['id']}})[_0xde14('0x1f')](handleEntityNotFound(_0x5f4b92,null))[_0xde14('0x1f')](removeEntity(_0x5f4b92,null))[_0xde14('0x1f')](function(){return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});})['then'](function(_0x43a155){var _0x58cf06=fs[_0xde14('0x6f')](path['join'](config[_0xde14('0x67')],_0xde14('0x65')),_0xde14('0x66'));var _0x4a1114=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x495741=ejs['render'](_0x58cf06,{'trunks':_0x43a155});var _0x381d6d=ejs[_0xde14('0x70')](_0x4a1114,{'trunks':_0x43a155});fs['writeFileSync'](_0xde14('0x6a'),_0x495741);fs[_0xde14('0x69')](_0xde14('0x71'),_0x381d6d);return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x3b'),{'module':'chan_sip.so'});})[_0xde14('0x2a')](handleError(_0x5f4b92,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 80eb90d..45cf515 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 _0x56ae=['util','api','moment','request-promise','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','lodash'];(function(_0x5cf3c0,_0x4363c1){var _0x39a680=function(_0x2a10f1){while(--_0x2a10f1){_0x5cf3c0['push'](_0x5cf3c0['shift']());}};_0x39a680(++_0x4363c1);}(_0x56ae,0x1b7));var _0xe56a=function(_0x1ca01f,_0x21f40b){_0x1ca01f=_0x1ca01f-0x0;var _0x194571=_0x56ae[_0x1ca01f];return _0x194571;};'use strict';var _=require(_0xe56a('0x0'));var util=require(_0xe56a('0x1'));var logger=require('../../config/logger')(_0xe56a('0x2'));var moment=require(_0xe56a('0x3'));var BPromise=require('bluebird');var rp=require(_0xe56a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe56a('0x5'));var config=require(_0xe56a('0x6'));var attributes=require(_0xe56a('0x7'));module[_0xe56a('0x8')]=function(_0x509d53,_0x3bfbfb){return _0x509d53[_0xe56a('0x9')](_0xe56a('0xa'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfafe=['path','../../config/environment','define','lodash','util','moment','bluebird','request-promise'];(function(_0x17c2e8,_0x1ed798){var _0x452f70=function(_0x10da7c){while(--_0x10da7c){_0x17c2e8['push'](_0x17c2e8['shift']());}};_0x452f70(++_0x1ed798);}(_0xfafe,0xdb));var _0xefaf=function(_0x235750,_0x256ddb){_0x235750=_0x235750-0x0;var _0xf5c632=_0xfafe[_0x235750];return _0xf5c632;};'use strict';var _=require(_0xefaf('0x0'));var util=require(_0xefaf('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xefaf('0x2'));var BPromise=require(_0xefaf('0x3'));var rp=require(_0xefaf('0x4'));var fs=require('fs');var path=require(_0xefaf('0x5'));var rimraf=require('rimraf');var config=require(_0xefaf('0x6'));var attributes=require('./trunk.attributes');module['exports']=function(_0x28c8a3,_0x5d2601){return _0x28c8a3[_0xefaf('0x7')]('Trunk',attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 4d1e54e..532a7ce 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 _0xb695=['../../config/utils','../../config/logger','rpc','../../config/environment','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetTrunk','Trunk','findAll','options','raw','where','attributes','map','include','model','then','info','catch','ShowTrunk','find','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x85b156,_0xf9e096){var _0x413603=function(_0x236ec1){while(--_0x236ec1){_0x85b156['push'](_0x85b156['shift']());}};_0x413603(++_0xf9e096);}(_0xb695,0x9b));var _0x5b69=function(_0x5438b0,_0x19fcf6){_0x5438b0=_0x5438b0-0x0;var _0x483c5c=_0xb695[_0x5438b0];return _0x483c5c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5b69('0x0'));var BPromise=require(_0x5b69('0x1'));var rs=require(_0x5b69('0x2'));var fs=require('fs');var Redis=require(_0x5b69('0x3'));var db=require(_0x5b69('0x4'))['db'];var utils=require(_0x5b69('0x5'));var logger=require(_0x5b69('0x6'))(_0x5b69('0x7'));var config=require(_0x5b69('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x484b28,_0x290ff2,_0x29def0){return new BPromise(function(_0x1e8a21,_0x4a2c9f){return client['request'](_0x484b28,_0x29def0)['then'](function(_0x2304dc){logger['info'](_0x5b69('0x9'),_0x290ff2,_0x5b69('0xa'));logger[_0x5b69('0xb')]('Trunk,\x20%s,\x20%s,\x20%s',_0x290ff2,_0x5b69('0xa'),JSON[_0x5b69('0xc')](_0x2304dc));if(_0x2304dc[_0x5b69('0xd')]){if(_0x2304dc[_0x5b69('0xd')][_0x5b69('0xe')]===0x1f4){logger[_0x5b69('0xd')](_0x5b69('0x9'),_0x290ff2,_0x2304dc[_0x5b69('0xd')][_0x5b69('0xf')]);return _0x4a2c9f(_0x2304dc['error']['message']);}logger[_0x5b69('0xd')](_0x5b69('0x9'),_0x290ff2,_0x2304dc['error'][_0x5b69('0xf')]);return _0x1e8a21(_0x2304dc[_0x5b69('0xd')][_0x5b69('0xf')]);}else{logger['info'](_0x5b69('0x9'),_0x290ff2,_0x5b69('0xa'));_0x1e8a21(_0x2304dc[_0x5b69('0x10')][_0x5b69('0xf')]);}})['catch'](function(_0x2358f3){logger['error']('Trunk,\x20%s,\x20%s',_0x290ff2,_0x2358f3);_0x4a2c9f(_0x2358f3);});});}exports[_0x5b69('0x11')]=function(_0x1560c1){var _0x17306f=this;return new Promise(function(_0x46d3b4,_0x50294d){return db[_0x5b69('0x12')][_0x5b69('0x13')]({'raw':_0x1560c1[_0x5b69('0x14')]?_0x1560c1['options'][_0x5b69('0x15')]===undefined?!![]:![]:!![],'where':_0x1560c1[_0x5b69('0x14')]?_0x1560c1['options'][_0x5b69('0x16')]||null:null,'attributes':_0x1560c1['options']?_0x1560c1[_0x5b69('0x14')][_0x5b69('0x17')]||null:null,'limit':_0x1560c1[_0x5b69('0x14')]?_0x1560c1[_0x5b69('0x14')]['limit']||null:null,'include':_0x1560c1[_0x5b69('0x14')]?_0x1560c1[_0x5b69('0x14')]['include']?_[_0x5b69('0x18')](_0x1560c1[_0x5b69('0x14')][_0x5b69('0x19')],function(_0xe1871c){return{'model':db[_0xe1871c['model']],'as':_0xe1871c['as'],'attributes':_0xe1871c[_0x5b69('0x17')],'include':_0xe1871c['include']?_[_0x5b69('0x18')](_0xe1871c[_0x5b69('0x19')],function(_0x187d39){return{'model':db[_0x187d39[_0x5b69('0x1a')]],'as':_0x187d39['as'],'attributes':_0x187d39[_0x5b69('0x17')],'include':_0x187d39[_0x5b69('0x19')]?_[_0x5b69('0x18')](_0x187d39[_0x5b69('0x19')],function(_0x4a8959){return{'model':db[_0x4a8959['model']],'as':_0x4a8959['as'],'attributes':_0x4a8959[_0x5b69('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5b69('0x1b')](function(_0x5032e6){logger[_0x5b69('0x1c')]('GetTrunk',_0x1560c1);logger['debug'](_0x5b69('0x11'),_0x1560c1,JSON[_0x5b69('0xc')](_0x5032e6));_0x46d3b4(_0x5032e6);})[_0x5b69('0x1d')](function(_0x11ea4c){logger[_0x5b69('0xd')](_0x5b69('0x11'),_0x11ea4c[_0x5b69('0xf')],_0x1560c1);_0x50294d(_0x17306f[_0x5b69('0xd')](0x1f4,_0x11ea4c[_0x5b69('0xf')]));});});};exports[_0x5b69('0x1e')]=function(_0x5199eb){var _0x174514=this;return new Promise(function(_0x104c8d,_0x36d582){return db['Trunk'][_0x5b69('0x1f')]({'raw':_0x5199eb['options']?_0x5199eb[_0x5b69('0x14')][_0x5b69('0x15')]===undefined?!![]:![]:!![],'where':_0x5199eb[_0x5b69('0x14')]?_0x5199eb[_0x5b69('0x14')][_0x5b69('0x16')]||null:null,'attributes':_0x5199eb[_0x5b69('0x14')]?_0x5199eb[_0x5b69('0x14')][_0x5b69('0x17')]||null:null,'include':_0x5199eb[_0x5b69('0x14')]?_0x5199eb['options'][_0x5b69('0x19')]?_[_0x5b69('0x18')](_0x5199eb[_0x5b69('0x14')][_0x5b69('0x19')],function(_0x41591a){return{'model':db[_0x41591a[_0x5b69('0x1a')]],'as':_0x41591a['as'],'attributes':_0x41591a[_0x5b69('0x17')],'include':_0x41591a[_0x5b69('0x19')]?_[_0x5b69('0x18')](_0x41591a[_0x5b69('0x19')],function(_0x1f4ee5){return{'model':db[_0x1f4ee5[_0x5b69('0x1a')]],'as':_0x1f4ee5['as'],'attributes':_0x1f4ee5[_0x5b69('0x17')],'include':_0x1f4ee5['include']?_['map'](_0x1f4ee5[_0x5b69('0x19')],function(_0x48671a){return{'model':db[_0x48671a[_0x5b69('0x1a')]],'as':_0x48671a['as'],'attributes':_0x48671a['attributes']};}):[]};}):[]};}):[]:[]})[_0x5b69('0x1b')](function(_0x1bd9da){logger[_0x5b69('0x1c')]('ShowTrunk',_0x5199eb);logger[_0x5b69('0xb')](_0x5b69('0x1e'),_0x5199eb,JSON[_0x5b69('0xc')](_0x1bd9da));_0x104c8d(_0x1bd9da);})[_0x5b69('0x1d')](function(_0xe7836c){logger[_0x5b69('0xd')](_0x5b69('0x1e'),_0xe7836c[_0x5b69('0xf')],_0x5199eb);_0x36d582(_0x174514[_0x5b69('0xd')](0x1f4,_0xe7836c[_0x5b69('0xf')]));});});}; \ No newline at end of file +var _0xe0da=['stringify','ShowTrunk','Trunk','find','raw','where','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','code','error','message','result','options','attributes','include','map','model','GetTrunk','debug'];(function(_0x3e7435,_0x4ec46a){var _0x53eadd=function(_0x349ae9){while(--_0x349ae9){_0x3e7435['push'](_0x3e7435['shift']());}};_0x53eadd(++_0x4ec46a);}(_0xe0da,0x16f));var _0xae0d=function(_0x5a4f3f,_0x4f5f71){_0x5a4f3f=_0x5a4f3f-0x0;var _0xc03078=_0xe0da[_0x5a4f3f];return _0xc03078;};'use strict';var _=require('lodash');var util=require(_0xae0d('0x0'));var moment=require(_0xae0d('0x1'));var BPromise=require(_0xae0d('0x2'));var rs=require(_0xae0d('0x3'));var fs=require('fs');var Redis=require(_0xae0d('0x4'));var db=require(_0xae0d('0x5'))['db'];var utils=require(_0xae0d('0x6'));var logger=require(_0xae0d('0x7'))(_0xae0d('0x8'));var config=require(_0xae0d('0x9'));var jayson=require(_0xae0d('0xa'));var client=jayson['client'][_0xae0d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x203e4d,_0x4c3fb8,_0x9a2f1c){return new BPromise(function(_0x22f556,_0x15f976){return client[_0xae0d('0xc')](_0x203e4d,_0x9a2f1c)[_0xae0d('0xd')](function(_0x5d89d1){logger[_0xae0d('0xe')](_0xae0d('0xf'),_0x4c3fb8,_0xae0d('0x10'));logger['debug'](_0xae0d('0x11'),_0x4c3fb8,'request\x20sent',JSON['stringify'](_0x5d89d1));if(_0x5d89d1['error']){if(_0x5d89d1['error'][_0xae0d('0x12')]===0x1f4){logger[_0xae0d('0x13')](_0xae0d('0xf'),_0x4c3fb8,_0x5d89d1['error']['message']);return _0x15f976(_0x5d89d1[_0xae0d('0x13')]['message']);}logger[_0xae0d('0x13')](_0xae0d('0xf'),_0x4c3fb8,_0x5d89d1[_0xae0d('0x13')]['message']);return _0x22f556(_0x5d89d1[_0xae0d('0x13')][_0xae0d('0x14')]);}else{logger[_0xae0d('0xe')]('Trunk,\x20%s,\x20%s',_0x4c3fb8,_0xae0d('0x10'));_0x22f556(_0x5d89d1[_0xae0d('0x15')][_0xae0d('0x14')]);}})['catch'](function(_0x4e47ab){logger[_0xae0d('0x13')](_0xae0d('0xf'),_0x4c3fb8,_0x4e47ab);_0x15f976(_0x4e47ab);});});}exports['GetTrunk']=function(_0xef14ec){var _0x9059a8=this;return new Promise(function(_0x38c51a,_0x352ccc){return db['Trunk']['findAll']({'raw':_0xef14ec['options']?_0xef14ec['options']['raw']===undefined?!![]:![]:!![],'where':_0xef14ec['options']?_0xef14ec[_0xae0d('0x16')]['where']||null:null,'attributes':_0xef14ec[_0xae0d('0x16')]?_0xef14ec[_0xae0d('0x16')][_0xae0d('0x17')]||null:null,'limit':_0xef14ec[_0xae0d('0x16')]?_0xef14ec[_0xae0d('0x16')]['limit']||null:null,'include':_0xef14ec[_0xae0d('0x16')]?_0xef14ec[_0xae0d('0x16')][_0xae0d('0x18')]?_[_0xae0d('0x19')](_0xef14ec[_0xae0d('0x16')][_0xae0d('0x18')],function(_0x547904){return{'model':db[_0x547904[_0xae0d('0x1a')]],'as':_0x547904['as'],'attributes':_0x547904[_0xae0d('0x17')],'include':_0x547904[_0xae0d('0x18')]?_[_0xae0d('0x19')](_0x547904[_0xae0d('0x18')],function(_0x62eb0){return{'model':db[_0x62eb0['model']],'as':_0x62eb0['as'],'attributes':_0x62eb0[_0xae0d('0x17')],'include':_0x62eb0['include']?_[_0xae0d('0x19')](_0x62eb0[_0xae0d('0x18')],function(_0x3cd0dd){return{'model':db[_0x3cd0dd[_0xae0d('0x1a')]],'as':_0x3cd0dd['as'],'attributes':_0x3cd0dd[_0xae0d('0x17')]};}):[]};}):[]};}):[]:[]})[_0xae0d('0xd')](function(_0x47934d){logger[_0xae0d('0xe')](_0xae0d('0x1b'),_0xef14ec);logger[_0xae0d('0x1c')](_0xae0d('0x1b'),_0xef14ec,JSON[_0xae0d('0x1d')](_0x47934d));_0x38c51a(_0x47934d);})['catch'](function(_0x51f5a1){logger[_0xae0d('0x13')](_0xae0d('0x1b'),_0x51f5a1[_0xae0d('0x14')],_0xef14ec);_0x352ccc(_0x9059a8[_0xae0d('0x13')](0x1f4,_0x51f5a1[_0xae0d('0x14')]));});});};exports[_0xae0d('0x1e')]=function(_0x2ff4fb){var _0x397d70=this;return new Promise(function(_0x5dbb50,_0x158e60){return db[_0xae0d('0x1f')][_0xae0d('0x20')]({'raw':_0x2ff4fb[_0xae0d('0x16')]?_0x2ff4fb[_0xae0d('0x16')][_0xae0d('0x21')]===undefined?!![]:![]:!![],'where':_0x2ff4fb[_0xae0d('0x16')]?_0x2ff4fb['options'][_0xae0d('0x22')]||null:null,'attributes':_0x2ff4fb['options']?_0x2ff4fb[_0xae0d('0x16')][_0xae0d('0x17')]||null:null,'include':_0x2ff4fb[_0xae0d('0x16')]?_0x2ff4fb[_0xae0d('0x16')][_0xae0d('0x18')]?_[_0xae0d('0x19')](_0x2ff4fb['options'][_0xae0d('0x18')],function(_0x405f8d){return{'model':db[_0x405f8d[_0xae0d('0x1a')]],'as':_0x405f8d['as'],'attributes':_0x405f8d[_0xae0d('0x17')],'include':_0x405f8d['include']?_[_0xae0d('0x19')](_0x405f8d[_0xae0d('0x18')],function(_0x1f1226){return{'model':db[_0x1f1226[_0xae0d('0x1a')]],'as':_0x1f1226['as'],'attributes':_0x1f1226[_0xae0d('0x17')],'include':_0x1f1226[_0xae0d('0x18')]?_['map'](_0x1f1226[_0xae0d('0x18')],function(_0x1931f5){return{'model':db[_0x1931f5[_0xae0d('0x1a')]],'as':_0x1931f5['as'],'attributes':_0x1931f5[_0xae0d('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5cab92){logger[_0xae0d('0xe')](_0xae0d('0x1e'),_0x2ff4fb);logger[_0xae0d('0x1c')](_0xae0d('0x1e'),_0x2ff4fb,JSON[_0xae0d('0x1d')](_0x5cab92));_0x5dbb50(_0x5cab92);})[_0xae0d('0x23')](function(_0x16db32){logger[_0xae0d('0x13')](_0xae0d('0x1e'),_0x16db32[_0xae0d('0x14')],_0x2ff4fb);_0x158e60(_0x397d70['error'](0x1f4,_0x16db32[_0xae0d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index a4bea83..03c5986 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 _0xebee=['/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','/create_many','bulkCreate','addQueues','join','server/files/images/','format','%s-%s','originalname','file','addAvatar','/:id/login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','put','update','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','/:id/sms_accounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','get','isAuthenticated','describe','/whoami','whoami','/presence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes'];(function(_0xff5df6,_0x514e73){var _0x2634bb=function(_0x1bb600){while(--_0x1bb600){_0xff5df6['push'](_0xff5df6['shift']());}};_0x2634bb(++_0x514e73);}(_0xebee,0x1b3));var _0xeebe=function(_0xef0d67,_0x5126b8){_0xef0d67=_0xef0d67-0x0;var _0x3abefe=_0xebee[_0xef0d67];return _0x3abefe;};'use strict';var multer=require(_0xeebe('0x0'));var util=require(_0xeebe('0x1'));var path=require(_0xeebe('0x2'));var timeout=require(_0xeebe('0x3'));var express=require('express');var router=express[_0xeebe('0x4')]();var fs_extra=require(_0xeebe('0x5'));var auth=require(_0xeebe('0x6'));var interaction=require(_0xeebe('0x7'));var config=require('../../config/environment');var controller=require(_0xeebe('0x8'));router[_0xeebe('0x9')]('/',auth[_0xeebe('0xa')](),controller['index']);router[_0xeebe('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xeebe('0xb')]);router[_0xeebe('0x9')](_0xeebe('0xc'),auth[_0xeebe('0xa')](),controller[_0xeebe('0xd')]);router[_0xeebe('0x9')](_0xeebe('0xe'),auth[_0xeebe('0xa')](),controller['getPresence']);router['get'](_0xeebe('0xf'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x10')]);router[_0xeebe('0x9')](_0xeebe('0x11'),controller[_0xeebe('0x12')]);router[_0xeebe('0x9')](_0xeebe('0x13'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x14')]);router['get'](_0xeebe('0x15'),auth['isAuthenticated'](),controller[_0xeebe('0x16')]);router['get'](_0xeebe('0x17'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x18')]);router['get'](_0xeebe('0x19'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x1a')]);router[_0xeebe('0x9')](_0xeebe('0x1b'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x1c')]);router['get']('/:id/recordings',auth[_0xeebe('0xa')](),controller[_0xeebe('0x1d')]);router[_0xeebe('0x9')]('/:id/screen_recordings',auth['isAuthenticated'](),controller['getScreenRecordings']);router['get'](_0xeebe('0x1e'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x1f')]);router['get'](_0xeebe('0x20'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x21')]);router['get'](_0xeebe('0x22'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x23')]);router['get'](_0xeebe('0x24'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x25')]);router['get'](_0xeebe('0x26'),auth['isAuthenticated'](),controller[_0xeebe('0x27')]);router[_0xeebe('0x9')](_0xeebe('0x28'),auth['isAuthenticated'](),controller[_0xeebe('0x29')]);router[_0xeebe('0x9')](_0xeebe('0x2a'),auth[_0xeebe('0xa')](),controller['getTeams']);router['get'](_0xeebe('0x2b'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x2c')]);router[_0xeebe('0x9')](_0xeebe('0x2d'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x2e')]);router[_0xeebe('0x9')](_0xeebe('0x2f'),auth['isAuthenticated'](),controller[_0xeebe('0x30')]);router['get'](_0xeebe('0x31'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x32')]);router['get'](_0xeebe('0x33'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x34')]);router[_0xeebe('0x9')](_0xeebe('0x35'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x36')]);router[_0xeebe('0x9')]('/:id/sms_accounts',auth[_0xeebe('0xa')](),controller[_0xeebe('0x37')]);router['get'](_0xeebe('0x38'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x39')]);router[_0xeebe('0x9')](_0xeebe('0x3a'),auth['isAuthenticated'](),controller['getWhatsappAccounts']);router[_0xeebe('0x9')](_0xeebe('0x3b'),auth['isAuthenticated'](),controller[_0xeebe('0x3c')]);router[_0xeebe('0x9')](_0xeebe('0x3d'),auth['isAuthenticated'](),controller[_0xeebe('0x3e')]);router[_0xeebe('0x9')](_0xeebe('0x3f'),auth['isAuthenticated'](),controller[_0xeebe('0x40')]);router[_0xeebe('0x41')](_0xeebe('0x15'),auth[_0xeebe('0xa')](),controller['addContacts']);router[_0xeebe('0x41')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xeebe('0x42'),auth['isAuthenticated'](),controller[_0xeebe('0x43')]);router[_0xeebe('0x41')]('/:id/queues',auth['isAuthenticated'](),controller[_0xeebe('0x44')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3ca841,_0x56d3c7,_0x31d00e){_0x31d00e(null,path[_0xeebe('0x45')](config['root'],_0xeebe('0x46')));},'filename':function(_0x49b28b,_0x329ca1,_0x1634a3){_0x1634a3(null,util[_0xeebe('0x47')](_0xeebe('0x48'),Date['now'](),_0x329ca1[_0xeebe('0x49')]));}})});router['post'](_0xeebe('0x11'),upload['single'](_0xeebe('0x4a')),controller[_0xeebe('0x4b')]);router[_0xeebe('0x41')](_0xeebe('0x4c'),auth[_0xeebe('0xa')](),controller['login']);router['post'](_0xeebe('0x4d'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x4e')]);router[_0xeebe('0x41')](_0xeebe('0x4f'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x50')]);router[_0xeebe('0x41')](_0xeebe('0x51'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x52')]);router[_0xeebe('0x41')](_0xeebe('0x2a'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x53')]);router[_0xeebe('0x41')](_0xeebe('0x54'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x55')]);router[_0xeebe('0x41')](_0xeebe('0x56'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x57')]);router[_0xeebe('0x41')](_0xeebe('0x58'),auth[_0xeebe('0xa')](),controller['addFaxInteractions']);router[_0xeebe('0x41')](_0xeebe('0x59'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x5a')]);router[_0xeebe('0x41')]('/:id/openchannel_interactions',auth[_0xeebe('0xa')](),controller[_0xeebe('0x5b')]);router[_0xeebe('0x41')]('/:id/whatsapp_interactions',auth[_0xeebe('0xa')](),controller[_0xeebe('0x5c')]);router[_0xeebe('0x41')](_0xeebe('0x31'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x5d')]);router[_0xeebe('0x41')](_0xeebe('0x33'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x5e')]);router[_0xeebe('0x41')](_0xeebe('0x35'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x5f')]);router[_0xeebe('0x41')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0xeebe('0x60')]);router['post']('/:id/chat_websites',auth[_0xeebe('0xa')](),controller[_0xeebe('0x61')]);router[_0xeebe('0x41')]('/:id/whatsapp_accounts',auth[_0xeebe('0xa')](),controller[_0xeebe('0x62')]);router[_0xeebe('0x41')](_0xeebe('0x3b'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x63')]);router[_0xeebe('0x41')](_0xeebe('0x3f'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x64')]);router[_0xeebe('0x65')](_0xeebe('0xf'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x66')]);router[_0xeebe('0x65')]('/:id/password',auth[_0xeebe('0xa')](),controller[_0xeebe('0x67')]);router[_0xeebe('0x68')]('/:id/queues',auth['isAuthenticated'](),controller[_0xeebe('0x69')]);router['delete'](_0xeebe('0x2a'),auth['isAuthenticated'](),controller[_0xeebe('0x6a')]);router[_0xeebe('0x68')]('/:id',auth[_0xeebe('0xa')](),controller[_0xeebe('0x6b')]);router[_0xeebe('0x68')](_0xeebe('0x54'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x6c')]);router[_0xeebe('0x68')](_0xeebe('0x56'),auth[_0xeebe('0xa')](),controller['removeMailInteractions']);router[_0xeebe('0x68')](_0xeebe('0x58'),auth[_0xeebe('0xa')](),controller['removeFaxInteractions']);router['delete'](_0xeebe('0x59'),auth[_0xeebe('0xa')](),controller['removeSmsInteractions']);router[_0xeebe('0x68')]('/:id/openchannel_interactions',auth[_0xeebe('0xa')](),controller[_0xeebe('0x6d')]);router[_0xeebe('0x68')](_0xeebe('0x6e'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x6f')]);router['delete'](_0xeebe('0x31'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x70')]);router['delete'](_0xeebe('0x33'),auth['isAuthenticated'](),controller['removeMailAccounts']);router[_0xeebe('0x68')](_0xeebe('0x35'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x71')]);router[_0xeebe('0x68')](_0xeebe('0x72'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x73')]);router[_0xeebe('0x68')](_0xeebe('0x38'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x74')]);router['delete'](_0xeebe('0x3a'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x75')]);router['delete'](_0xeebe('0x3b'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x76')]);router[_0xeebe('0x68')](_0xeebe('0x3f'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x77')]);module[_0xeebe('0x78')]=router; \ No newline at end of file +var _0xcd1e=['/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','/:id/contacts','addContacts','create','/create_many','bulkCreate','addQueues','join','server/files/images/','format','%s-%s','originalname','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeWhatsappInteractions','/:id/fax_accounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','whoami','/presence','getPresence','/:id','show','/:id/avatar','/:id/open_tabs','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts'];(function(_0x485c3c,_0x5041c5){var _0x3a599d=function(_0x468fa1){while(--_0x468fa1){_0x485c3c['push'](_0x485c3c['shift']());}};_0x3a599d(++_0x5041c5);}(_0xcd1e,0x19f));var _0xecd1=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xcd1e[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require(_0xecd1('0x0'));var path=require(_0xecd1('0x1'));var timeout=require('connect-timeout');var express=require(_0xecd1('0x2'));var router=express['Router']();var fs_extra=require(_0xecd1('0x3'));var auth=require(_0xecd1('0x4'));var interaction=require(_0xecd1('0x5'));var config=require(_0xecd1('0x6'));var controller=require(_0xecd1('0x7'));router[_0xecd1('0x8')]('/',auth[_0xecd1('0x9')](),controller[_0xecd1('0xa')]);router['get'](_0xecd1('0xb'),auth[_0xecd1('0x9')](),controller['describe']);router['get']('/whoami',auth[_0xecd1('0x9')](),controller[_0xecd1('0xc')]);router['get'](_0xecd1('0xd'),auth['isAuthenticated'](),controller[_0xecd1('0xe')]);router['get'](_0xecd1('0xf'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x10')]);router[_0xecd1('0x8')](_0xecd1('0x11'),controller['getAvatar']);router[_0xecd1('0x8')](_0xecd1('0x12'),auth[_0xecd1('0x9')](),controller['getOpenTabs']);router[_0xecd1('0x8')]('/:id/contacts',auth[_0xecd1('0x9')](),controller['getContacts']);router[_0xecd1('0x8')](_0xecd1('0x13'),auth['isAuthenticated'](),controller[_0xecd1('0x14')]);router[_0xecd1('0x8')](_0xecd1('0x15'),auth['isAuthenticated'](),controller[_0xecd1('0x16')]);router[_0xecd1('0x8')](_0xecd1('0x17'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x18')]);router[_0xecd1('0x8')](_0xecd1('0x19'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x1a')]);router[_0xecd1('0x8')](_0xecd1('0x1b'),auth[_0xecd1('0x9')](),controller['getScreenRecordings']);router[_0xecd1('0x8')](_0xecd1('0x1c'),auth['isAuthenticated'](),controller[_0xecd1('0x1d')]);router['get'](_0xecd1('0x1e'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x1f')]);router[_0xecd1('0x8')]('/:id/mail/interactions',auth[_0xecd1('0x9')](),controller[_0xecd1('0x20')]);router[_0xecd1('0x8')]('/:id/sms/interactions',auth[_0xecd1('0x9')](),controller['getSmsInteractions']);router[_0xecd1('0x8')](_0xecd1('0x21'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x22')]);router[_0xecd1('0x8')]('/:id/whatsapp/interactions',auth[_0xecd1('0x9')](),controller[_0xecd1('0x23')]);router[_0xecd1('0x8')](_0xecd1('0x24'),auth['isAuthenticated'](),controller[_0xecd1('0x25')]);router[_0xecd1('0x8')](_0xecd1('0x26'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x27')]);router[_0xecd1('0x8')](_0xecd1('0x28'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x29')]);router[_0xecd1('0x8')](_0xecd1('0x2a'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x2b')]);router[_0xecd1('0x8')]('/:id/fax_accounts',auth[_0xecd1('0x9')](),controller[_0xecd1('0x2c')]);router[_0xecd1('0x8')](_0xecd1('0x2d'),auth['isAuthenticated'](),controller[_0xecd1('0x2e')]);router[_0xecd1('0x8')]('/:id/openchannel_accounts',auth[_0xecd1('0x9')](),controller[_0xecd1('0x2f')]);router[_0xecd1('0x8')](_0xecd1('0x30'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x31')]);router[_0xecd1('0x8')](_0xecd1('0x32'),auth['isAuthenticated'](),controller[_0xecd1('0x33')]);router[_0xecd1('0x8')](_0xecd1('0x34'),auth[_0xecd1('0x9')](),controller['getWhatsappAccounts']);router[_0xecd1('0x8')](_0xecd1('0x35'),auth[_0xecd1('0x9')](),controller['getSquareProjects']);router[_0xecd1('0x8')](_0xecd1('0x36'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x37')]);router[_0xecd1('0x8')](_0xecd1('0x38'),auth[_0xecd1('0x9')](),controller['getApiKey']);router[_0xecd1('0x39')](_0xecd1('0x3a'),auth['isAuthenticated'](),controller[_0xecd1('0x3b')]);router[_0xecd1('0x39')]('/',auth[_0xecd1('0x9')](),controller[_0xecd1('0x3c')]);router[_0xecd1('0x39')](_0xecd1('0x3d'),auth['isAuthenticated'](),controller[_0xecd1('0x3e')]);router[_0xecd1('0x39')]('/:id/queues',auth[_0xecd1('0x9')](),controller[_0xecd1('0x3f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x43a858,_0x5506cb,_0x512747){_0x512747(null,path[_0xecd1('0x40')](config['root'],_0xecd1('0x41')));},'filename':function(_0x677989,_0x265438,_0x211942){_0x211942(null,util[_0xecd1('0x42')](_0xecd1('0x43'),Date['now'](),_0x265438[_0xecd1('0x44')]));}})});router[_0xecd1('0x39')](_0xecd1('0x11'),upload['single'](_0xecd1('0x45')),controller[_0xecd1('0x46')]);router[_0xecd1('0x39')](_0xecd1('0x47'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x48')]);router[_0xecd1('0x39')](_0xecd1('0x49'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x4a')]);router['post'](_0xecd1('0x4b'),auth[_0xecd1('0x9')](),controller['pause']);router['post']('/:id/unpause',auth['isAuthenticated'](),controller[_0xecd1('0x4c')]);router['post'](_0xecd1('0x24'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x4d')]);router['post'](_0xecd1('0x4e'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x4f')]);router[_0xecd1('0x39')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0xecd1('0x50')]);router[_0xecd1('0x39')](_0xecd1('0x51'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x52')]);router['post']('/:id/sms_interactions',auth[_0xecd1('0x9')](),controller[_0xecd1('0x53')]);router[_0xecd1('0x39')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router[_0xecd1('0x39')](_0xecd1('0x54'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x55')]);router[_0xecd1('0x39')]('/:id/fax_accounts',auth[_0xecd1('0x9')](),controller['addFaxAccounts']);router['post']('/:id/mail_accounts',auth[_0xecd1('0x9')](),controller[_0xecd1('0x56')]);router['post'](_0xecd1('0x57'),auth['isAuthenticated'](),controller[_0xecd1('0x58')]);router[_0xecd1('0x39')](_0xecd1('0x30'),auth['isAuthenticated'](),controller[_0xecd1('0x59')]);router[_0xecd1('0x39')](_0xecd1('0x32'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x5a')]);router[_0xecd1('0x39')](_0xecd1('0x34'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x5b')]);router[_0xecd1('0x39')]('/:id/square_projects',auth['isAuthenticated'](),controller['addSquareProjects']);router[_0xecd1('0x39')]('/:id/api_key',auth[_0xecd1('0x9')](),controller[_0xecd1('0x5c')]);router[_0xecd1('0x5d')]('/:id',auth[_0xecd1('0x9')](),controller['update']);router['put'](_0xecd1('0x5e'),auth['isAuthenticated'](),controller[_0xecd1('0x5f')]);router[_0xecd1('0x60')](_0xecd1('0x13'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x61')]);router[_0xecd1('0x60')](_0xecd1('0x24'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x62')]);router['delete'](_0xecd1('0xf'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x63')]);router[_0xecd1('0x60')](_0xecd1('0x4e'),auth['isAuthenticated'](),controller[_0xecd1('0x64')]);router[_0xecd1('0x60')](_0xecd1('0x65'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x66')]);router[_0xecd1('0x60')](_0xecd1('0x51'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x67')]);router[_0xecd1('0x60')]('/:id/sms_interactions',auth[_0xecd1('0x9')](),controller[_0xecd1('0x68')]);router['delete'](_0xecd1('0x69'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x6a')]);router[_0xecd1('0x60')](_0xecd1('0x54'),auth['isAuthenticated'](),controller[_0xecd1('0x6b')]);router[_0xecd1('0x60')](_0xecd1('0x6c'),auth['isAuthenticated'](),controller['removeFaxAccounts']);router['delete'](_0xecd1('0x2d'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x6d')]);router['delete']('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0xecd1('0x6e')]);router[_0xecd1('0x60')]('/:id/sms_accounts',auth[_0xecd1('0x9')](),controller[_0xecd1('0x6f')]);router[_0xecd1('0x60')]('/:id/chat_websites',auth[_0xecd1('0x9')](),controller[_0xecd1('0x70')]);router['delete'](_0xecd1('0x34'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x71')]);router[_0xecd1('0x60')](_0xecd1('0x35'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x72')]);router[_0xecd1('0x60')](_0xecd1('0x38'),auth[_0xecd1('0x9')](),controller[_0xecd1('0x73')]);module[_0xecd1('0x74')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index e6f1dfd..e7702ff 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 _0xf9f7=['yes','nonat','update','force_rport,comedia','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','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','uas','fingerprint','certificate','active','actpass','DATE','TEXT','showWebBar','get','wss','avpf','icesupport','dtlsenable','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','encryption','dtlsverify','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','lodash','exports','STRING','setDataValue','name','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','getDataValue','internal','email','toLowerCase','ENUM','agent','INTEGER','accountcode','BOOLEAN','friend','user','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto'];(function(_0x975078,_0x2ca975){var _0x2d7dd6=function(_0x57399b){while(--_0x57399b){_0x975078['push'](_0x975078['shift']());}};_0x2d7dd6(++_0x2ca975);}(_0xf9f7,0xdf));var _0x7f9f=function(_0x1da5f4,_0x44bca7){_0x1da5f4=_0x1da5f4-0x0;var _0x58e944=_0xf9f7[_0x1da5f4];return _0x58e944;};'use strict';var Sequelize=require(_0x7f9f('0x0'));var moment=require(_0x7f9f('0x1'));var util=require(_0x7f9f('0x2'));var _=require(_0x7f9f('0x3'));module[_0x7f9f('0x4')]={'name':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5c456a){this[_0x7f9f('0x6')](_0x7f9f('0x7'),_0x5c456a);this[_0x7f9f('0x6')](_0x7f9f('0x8'),_0x5c456a);},'comment':_0x7f9f('0x9')},'fullname':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':![],'set':function(_0x5b5819){this[_0x7f9f('0x6')](_0x7f9f('0xa'),_0x5b5819);this[_0x7f9f('0x6')](_0x7f9f('0xb'),util[_0x7f9f('0xc')]('\x22%s\x22\x20<%s>',_0x5b5819,this[_0x7f9f('0xd')](_0x7f9f('0xe'))));}},'alias':{'type':Sequelize[_0x7f9f('0x5')]},'email':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':![],'unique':_0x7f9f('0xf'),'validate':{'isEmail':!![]},'set':function(_0x3ff15a){if(_0x3ff15a){this[_0x7f9f('0x6')]('email',_0x3ff15a[_0x7f9f('0x10')]());}}},'role':{'type':Sequelize[_0x7f9f('0x11')]('admin','user',_0x7f9f('0x12'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x7f9f('0x5')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x7f9f('0x13')](0xb),'allowNull':![],'unique':'internal','set':function(_0x292470){this[_0x7f9f('0x6')](_0x7f9f('0xe'),_0x292470);this[_0x7f9f('0x6')](_0x7f9f('0x14'),_0x292470);this['setDataValue'](_0x7f9f('0xb'),util[_0x7f9f('0xc')]('\x22%s\x22\x20<%s>',this[_0x7f9f('0xd')]('fullname'),_0x292470));}},'salt':{'type':Sequelize[_0x7f9f('0x5')]},'phone':{'type':Sequelize[_0x7f9f('0x5')]},'mobile':{'type':Sequelize[_0x7f9f('0x5')]},'address':{'type':Sequelize[_0x7f9f('0x5')]},'zipcode':{'type':Sequelize[_0x7f9f('0x5')]},'userpic':{'type':Sequelize[_0x7f9f('0x5')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x7f9f('0x5')]},'online':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x7f9f('0x5')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x7f9f('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x7f9f('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x7f9f('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x7f9f('0x13')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x7f9f('0x13')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x7f9f('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x7f9f('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'port':{'type':Sequelize[_0x7f9f('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x7f9f('0x13')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x7f9f('0x13')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x7f9f('0x16'),_0x7f9f('0x17'),'peer'),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x7f9f('0x18')},'callingpres':{'type':Sequelize['ENUM'](_0x7f9f('0x19'),_0x7f9f('0x1a'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0x7f9f('0x1b'),'PROHIB_PASSED_SCREEN',_0x7f9f('0x1c'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'transport':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![],'defaultValue':_0x7f9f('0x1d'),'set':function(_0xa890c3){this[_0x7f9f('0x6')]('transport',_0xa890c3?_0xa890c3['join'](','):null);},'get':function(){return this[_0x7f9f('0xd')]('transport')?this['getDataValue'](_0x7f9f('0x1e'))[_0x7f9f('0x1f')](','):null;},'comment':_0x7f9f('0x20')},'dtmfmode':{'type':Sequelize[_0x7f9f('0x11')](_0x7f9f('0x21'),_0x7f9f('0x22'),_0x7f9f('0x23'),_0x7f9f('0x24'),_0x7f9f('0x25')),'allowNull':!![],'defaultValue':_0x7f9f('0x21')},'directmedia':{'type':Sequelize[_0x7f9f('0x11')](_0x7f9f('0x26'),'no',_0x7f9f('0x27'),_0x7f9f('0x28'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x7f9f('0x11')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'nat':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![],'defaultValue':_0x7f9f('0x29'),'set':function(_0x9bf722){this['setDataValue'](_0x7f9f('0x2a'),_0x9bf722?_0x9bf722[_0x7f9f('0x2b')](','):null);},'get':function(){return this['getDataValue'](_0x7f9f('0x2a'))?this[_0x7f9f('0xd')](_0x7f9f('0x2a'))[_0x7f9f('0x1f')](','):null;},'comment':_0x7f9f('0x2c')},'callgroup':{'type':Sequelize[_0x7f9f('0x5')]},'namedcallgroup':{'type':Sequelize[_0x7f9f('0x5')]},'pickupgroup':{'type':Sequelize[_0x7f9f('0x5')]},'namedpickupgroup':{'type':Sequelize[_0x7f9f('0x5')]},'language':{'type':Sequelize[_0x7f9f('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x7f9f('0x5')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7f9f('0x2d')},'allow':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x605a74){this[_0x7f9f('0x6')](_0x7f9f('0x2e'),_0x605a74?_0x605a74[_0x7f9f('0x2b')](';'):_0x7f9f('0x2f'));},'get':function(){return this[_0x7f9f('0xd')](_0x7f9f('0x2e'))?this[_0x7f9f('0xd')](_0x7f9f('0x2e'))['split'](';'):null;},'comment':_0x7f9f('0x30')},'autoframing':{'type':Sequelize[_0x7f9f('0x11')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x21d583){this[_0x7f9f('0x6')](_0x7f9f('0x31'),_0x21d583?_0x21d583[_0x7f9f('0x2b')](','):null);},'get':function(){return this[_0x7f9f('0xd')]('insecure')?this['getDataValue'](_0x7f9f('0x31'))[_0x7f9f('0x1f')](','):null;},'comment':_0x7f9f('0x32')},'trustrpid':{'type':Sequelize[_0x7f9f('0x11')](_0x7f9f('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x7f9f('0x11')](_0x7f9f('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x7f9f('0x11')](_0x7f9f('0x26'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x7f9f('0x26'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x7f9f('0x11')](_0x7f9f('0x26'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x7f9f('0x33')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x7f9f('0x11')](_0x7f9f('0x26'),'no'),'allowNull':!![],'defaultValue':_0x7f9f('0x26')},'busylevel':{'type':Sequelize[_0x7f9f('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x7f9f('0x11')](_0x7f9f('0x26'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x7f9f('0x26'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x7f9f('0x26'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x7f9f('0x11')](_0x7f9f('0x26'),'no',_0x7f9f('0x34')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x7f9f('0x11')](_0x7f9f('0x26'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x7f9f('0x35'),_0x7f9f('0x36'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x7f9f('0x11')]('uac',_0x7f9f('0x37')),'allowNull':!![],'defaultValue':_0x7f9f('0x37')},'t38pt_usertpsource':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x7f9f('0x11')](_0x7f9f('0x26'),'no'),'allowNull':!![],'defaultValue':_0x7f9f('0x26')},'keepalive':{'type':Sequelize[_0x7f9f('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x7f9f('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x7f9f('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x7f9f('0x11')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x7f9f('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x7f9f('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x7f9f('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x7f9f('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x7f9f('0x11')](_0x7f9f('0x26'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x7f9f('0x11')](_0x7f9f('0x26'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x7f9f('0x26'),'no',_0x7f9f('0x38'),_0x7f9f('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0x7f9f('0x3a'),'passive',_0x7f9f('0x3b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x7f9f('0x11')](_0x7f9f('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x7f9f('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x7f9f('0x26'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x7f9f('0x11')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x7f9f('0x26'),'no',_0x7f9f('0x27'),_0x7f9f('0x28'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x7f9f('0x3c')]},'passwordResetAt':{'type':Sequelize[_0x7f9f('0x3c')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x7f9f('0x3d')]},'showWebBar':{'type':Sequelize[_0x7f9f('0x13')],'defaultValue':0x0,'set':function(_0x47ba43){this[_0x7f9f('0x6')](_0x7f9f('0x3e'),_0x47ba43);var _0xdf6fa5=this[_0x7f9f('0x3f')]({'plain':!![]});switch(_0x47ba43){case 0x0:case 0x1:var _0x126f54=_0xdf6fa5[_0x7f9f('0x1e')]?_['isArray'](_0xdf6fa5[_0x7f9f('0x1e')])?_0xdf6fa5[_0x7f9f('0x1e')][_0x7f9f('0x2b')]():_0xdf6fa5[_0x7f9f('0x1e')]:_0x7f9f('0x1d');if(_0x126f54===_0x7f9f('0x40')){_0x126f54=_0x7f9f('0x1d');}this[_0x7f9f('0x6')](_0x7f9f('0x1e'),_0x126f54);this[_0x7f9f('0x6')]('encryption','no');this[_0x7f9f('0x6')](_0x7f9f('0x41'),null);this[_0x7f9f('0x6')]('force_avp',null);this[_0x7f9f('0x6')](_0x7f9f('0x42'),null);this[_0x7f9f('0x6')](_0x7f9f('0x43'),null);this['setDataValue']('dtlsverify',null);this['setDataValue'](_0x7f9f('0x44'),null);this[_0x7f9f('0x6')](_0x7f9f('0x45'),null);this[_0x7f9f('0x6')](_0x7f9f('0x46'),null);this[_0x7f9f('0x6')](_0x7f9f('0x47'),'no');break;case 0x2:this[_0x7f9f('0x6')]('transport',_0x7f9f('0x40'));this[_0x7f9f('0x6')](_0x7f9f('0x48'),_0x7f9f('0x26'));this['setDataValue'](_0x7f9f('0x41'),_0x7f9f('0x26'));this['setDataValue']('force_avp',_0x7f9f('0x26'));this[_0x7f9f('0x6')](_0x7f9f('0x42'),_0x7f9f('0x26'));this[_0x7f9f('0x6')](_0x7f9f('0x43'),_0x7f9f('0x26'));this['setDataValue'](_0x7f9f('0x49'),'no');this['setDataValue']('dtlssetup','actpass');this['setDataValue']('dtlscertfile',_0xdf6fa5['dtlscertfile']||_0x7f9f('0x4a'));this[_0x7f9f('0x6')](_0x7f9f('0x46'),_0xdf6fa5[_0x7f9f('0x46')]||_0x7f9f('0x4b'));this[_0x7f9f('0x6')](_0x7f9f('0x47'),_0x7f9f('0x26'));break;default:}}},'permissions':{'type':Sequelize[_0x7f9f('0x3d')],'set':function(_0xe118d7){this[_0x7f9f('0x6')](_0x7f9f('0x4c'),_0xe118d7?_0xe118d7[_0x7f9f('0x2b')](','):[]);},'get':function(){return this[_0x7f9f('0xd')](_0x7f9f('0x4c'))?_[_0x7f9f('0x4d')](this[_0x7f9f('0xd')](_0x7f9f('0x4c'))[_0x7f9f('0x1f')](','),function(_0x3d0747){return parseInt(_0x3d0747,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x7f9f('0x5')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x7f9f('0x5')]},'phoneBarUnconditional':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x7f9f('0x5')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x7f9f('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x7f9f('0x11')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x7f9f('0x5')]},'phoneBarEnableJaws':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x7f9f('0x4e')],'get':function(){return this[_0x7f9f('0xd')](_0x7f9f('0x4f'))?this[_0x7f9f('0xd')](_0x7f9f('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x7f9f('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':![],'set':function(_0x184976){if(typeof _0x184976===_0x7f9f('0x50')){var _0x57df99=_0x184976==='1'?!![]:_0x184976==='0'?![]:_0x184976===_0x7f9f('0x51')?!![]:_0x184976===_0x7f9f('0x52')?![]:![];this[_0x7f9f('0x6')]('screenrecording',_0x57df99);}else{this['setDataValue'](_0x7f9f('0x53'),_0x184976);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x4ef81e){this[_0x7f9f('0x6')]('blocked',_0x4ef81e);if(_0x4ef81e===!![]){this[_0x7f9f('0x6')](_0x7f9f('0x54'),moment());this[_0x7f9f('0x6')](_0x7f9f('0x55'),0x0);}else{this['setDataValue'](_0x7f9f('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x7f9f('0x3c')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x7f9f('0x13')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0x7f9f('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x7f9f('0x15')],'defaultValue':![]}}; \ No newline at end of file +var _0x56dc=['dtlscertfile','dtlsprivatekey','rtcp_mux','icesupport','actpass','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','exports','STRING','name','defaultuser','The\x20name\x20of\x20the\x20user','setDataValue','fullname','callerid','format','internal','email','toLowerCase','admin','user','agent','telephone','local','INTEGER','\x22%s\x22\x20<%s>','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','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]','info','shortinfo','inband','auto','yes','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','refuse','originate','uac','uas','passive','nonat','TEXT','showWebBar','get','isArray','wss','avpf','force_avp','dtlsenable','dtlsverify','dtlssetup'];(function(_0x4ea728,_0x3ba8a8){var _0x290764=function(_0x35f0e0){while(--_0x35f0e0){_0x4ea728['push'](_0x4ea728['shift']());}};_0x290764(++_0x3ba8a8);}(_0x56dc,0x188));var _0xc56d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56dc[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc56d('0x0'));var moment=require(_0xc56d('0x1'));var util=require(_0xc56d('0x2'));var _=require('lodash');module[_0xc56d('0x3')]={'name':{'type':Sequelize[_0xc56d('0x4')],'allowNull':![],'unique':_0xc56d('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x96a65d){this['setDataValue'](_0xc56d('0x5'),_0x96a65d);this['setDataValue'](_0xc56d('0x6'),_0x96a65d);},'comment':_0xc56d('0x7')},'fullname':{'type':Sequelize[_0xc56d('0x4')],'allowNull':![],'set':function(_0x519b24){this[_0xc56d('0x8')](_0xc56d('0x9'),_0x519b24);this['setDataValue'](_0xc56d('0xa'),util[_0xc56d('0xb')]('\x22%s\x22\x20<%s>',_0x519b24,this['getDataValue'](_0xc56d('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xc56d('0x4')],'allowNull':![],'unique':_0xc56d('0xd'),'validate':{'isEmail':!![]},'set':function(_0x3c3d3a){if(_0x3c3d3a){this[_0xc56d('0x8')]('email',_0x3c3d3a[_0xc56d('0xe')]());}}},'role':{'type':Sequelize['ENUM'](_0xc56d('0xf'),_0xc56d('0x10'),_0xc56d('0x11'),_0xc56d('0x12')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xc56d('0x4')],'defaultValue':_0xc56d('0x13')},'internal':{'type':Sequelize[_0xc56d('0x14')](0xb),'allowNull':![],'unique':_0xc56d('0xc'),'set':function(_0x3bf589){this[_0xc56d('0x8')](_0xc56d('0xc'),_0x3bf589);this['setDataValue']('accountcode',_0x3bf589);this[_0xc56d('0x8')](_0xc56d('0xa'),util[_0xc56d('0xb')](_0xc56d('0x15'),this[_0xc56d('0x16')](_0xc56d('0x9')),_0x3bf589));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xc56d('0x4')]},'mobile':{'type':Sequelize[_0xc56d('0x4')]},'address':{'type':Sequelize[_0xc56d('0x4')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xc56d('0x4')]},'city':{'type':Sequelize[_0xc56d('0x4')]},'country':{'type':Sequelize[_0xc56d('0x4')]},'online':{'type':Sequelize[_0xc56d('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xc56d('0x18')]},'voicePause':{'type':Sequelize[_0xc56d('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xc56d('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xc56d('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xc56d('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xc56d('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xc56d('0x4')],'defaultValue':_0xc56d('0x19')},'lastPauseAt':{'type':Sequelize[_0xc56d('0x18')]},'chatCapacity':{'type':Sequelize[_0xc56d('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xc56d('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xc56d('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xc56d('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xc56d('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xc56d('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xc56d('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xc56d('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xc56d('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xc56d('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xc56d('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xc56d('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![],'defaultValue':_0xc56d('0x1a')},'ipaddr':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xc56d('0x1b')](_0xc56d('0x1c'),'user',_0xc56d('0x1d')),'allowNull':!![],'defaultValue':_0xc56d('0x1c')},'context':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![],'defaultValue':_0xc56d('0x1e')},'callingpres':{'type':Sequelize[_0xc56d('0x1b')](_0xc56d('0x1f'),_0xc56d('0x20'),_0xc56d('0x21'),_0xc56d('0x22'),'PROHIB_NOT_SCREENED',_0xc56d('0x23'),_0xc56d('0x24'),_0xc56d('0x25')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xc56d('0x26'),'set':function(_0x53b0b6){this[_0xc56d('0x8')](_0xc56d('0x27'),_0x53b0b6?_0x53b0b6[_0xc56d('0x28')](','):null);},'get':function(){return this[_0xc56d('0x16')](_0xc56d('0x27'))?this['getDataValue'](_0xc56d('0x27'))[_0xc56d('0x29')](','):null;},'comment':_0xc56d('0x2a')},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0xc56d('0x2b'),_0xc56d('0x2c'),_0xc56d('0x2d'),_0xc56d('0x2e')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0xc56d('0x2f'),'no','nonat',_0xc56d('0x30'),_0xc56d('0x31')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xc56d('0x1b')](_0xc56d('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![],'defaultValue':_0xc56d('0x32'),'set':function(_0x3daef7){this[_0xc56d('0x8')](_0xc56d('0x33'),_0x3daef7?_0x3daef7[_0xc56d('0x28')](','):null);},'get':function(){return this['getDataValue'](_0xc56d('0x33'))?this[_0xc56d('0x16')](_0xc56d('0x33'))[_0xc56d('0x29')](','):null;},'comment':_0xc56d('0x34')},'callgroup':{'type':Sequelize[_0xc56d('0x4')]},'namedcallgroup':{'type':Sequelize[_0xc56d('0x4')]},'pickupgroup':{'type':Sequelize[_0xc56d('0x4')]},'namedpickupgroup':{'type':Sequelize[_0xc56d('0x4')]},'language':{'type':Sequelize[_0xc56d('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xc56d('0x4')]},'disallow':{'type':Sequelize[_0xc56d('0x4')],'allowNull':![],'defaultValue':_0xc56d('0x35')},'allow':{'type':Sequelize[_0xc56d('0x4')],'allowNull':![],'defaultValue':_0xc56d('0x36'),'set':function(_0x11ab37){this['setDataValue'](_0xc56d('0x37'),_0x11ab37?_0x11ab37[_0xc56d('0x28')](';'):_0xc56d('0x36'));},'get':function(){return this[_0xc56d('0x16')]('allow')?this['getDataValue'](_0xc56d('0x37'))[_0xc56d('0x29')](';'):null;},'comment':_0xc56d('0x38')},'autoframing':{'type':Sequelize['ENUM'](_0xc56d('0x2f'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![],'set':function(_0x2e31cb){this[_0xc56d('0x8')]('insecure',_0x2e31cb?_0x2e31cb[_0xc56d('0x28')](','):null);},'get':function(){return this[_0xc56d('0x16')](_0xc56d('0x39'))?this[_0xc56d('0x16')](_0xc56d('0x39'))[_0xc56d('0x29')](','):null;},'comment':_0xc56d('0x3a')},'trustrpid':{'type':Sequelize['ENUM'](_0xc56d('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xc56d('0x1b')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xc56d('0x2f'),'no',_0xc56d('0x3b')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xc56d('0x1b')](_0xc56d('0x2f'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xc56d('0x2f'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xc56d('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![],'defaultValue':_0xc56d('0x3c')},'amaflags':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xc56d('0x1b')](_0xc56d('0x2f'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xc56d('0x2f'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xc56d('0x1b')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xc56d('0x1b')](_0xc56d('0x2f'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xc56d('0x1b')](_0xc56d('0x2f'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0xc56d('0x2f'),'no',_0xc56d('0x3d')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xc56d('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xc56d('0x1b')](_0xc56d('0x2f'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xc56d('0x1b')]('accept',_0xc56d('0x3e'),_0xc56d('0x3f')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xc56d('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xc56d('0x1b')](_0xc56d('0x40'),_0xc56d('0x41')),'allowNull':!![],'defaultValue':_0xc56d('0x41')},'t38pt_usertpsource':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xc56d('0x1b')](_0xc56d('0x2f'),'no'),'allowNull':!![],'defaultValue':_0xc56d('0x2f')},'keepalive':{'type':Sequelize[_0xc56d('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xc56d('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xc56d('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xc56d('0x1b')](_0xc56d('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xc56d('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xc56d('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xc56d('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0xc56d('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xc56d('0x1b')](_0xc56d('0x2f'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0xc56d('0x2f'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xc56d('0x1b')](_0xc56d('0x2f'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xc56d('0x1b')](_0xc56d('0x2f'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0xc56d('0x2f'),'no','fingerprint','certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0xc56d('0x42'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xc56d('0x1b')](_0xc56d('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xc56d('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0xc56d('0x2f'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xc56d('0x1b')](_0xc56d('0x2f'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xc56d('0x1b')](_0xc56d('0x2f'),'no',_0xc56d('0x43'),_0xc56d('0x30'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xc56d('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xc56d('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xc56d('0x18')]},'passwordResetAt':{'type':Sequelize[_0xc56d('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xc56d('0x44')]},'showWebBar':{'type':Sequelize[_0xc56d('0x14')],'defaultValue':0x0,'set':function(_0x3b6ff0){this[_0xc56d('0x8')](_0xc56d('0x45'),_0x3b6ff0);var _0x3a43af=this[_0xc56d('0x46')]({'plain':!![]});switch(_0x3b6ff0){case 0x0:case 0x1:var _0x4ce81a=_0x3a43af[_0xc56d('0x27')]?_[_0xc56d('0x47')](_0x3a43af[_0xc56d('0x27')])?_0x3a43af[_0xc56d('0x27')]['join']():_0x3a43af[_0xc56d('0x27')]:_0xc56d('0x26');if(_0x4ce81a===_0xc56d('0x48')){_0x4ce81a=_0xc56d('0x26');}this[_0xc56d('0x8')]('transport',_0x4ce81a);this['setDataValue']('encryption','no');this[_0xc56d('0x8')](_0xc56d('0x49'),null);this[_0xc56d('0x8')](_0xc56d('0x4a'),null);this[_0xc56d('0x8')]('icesupport',null);this[_0xc56d('0x8')](_0xc56d('0x4b'),null);this[_0xc56d('0x8')](_0xc56d('0x4c'),null);this['setDataValue'](_0xc56d('0x4d'),null);this[_0xc56d('0x8')](_0xc56d('0x4e'),null);this[_0xc56d('0x8')](_0xc56d('0x4f'),null);this[_0xc56d('0x8')](_0xc56d('0x50'),'no');break;case 0x2:this[_0xc56d('0x8')]('transport',_0xc56d('0x48'));this[_0xc56d('0x8')]('encryption',_0xc56d('0x2f'));this['setDataValue']('avpf',_0xc56d('0x2f'));this['setDataValue']('force_avp',_0xc56d('0x2f'));this[_0xc56d('0x8')](_0xc56d('0x51'),'yes');this[_0xc56d('0x8')](_0xc56d('0x4b'),_0xc56d('0x2f'));this['setDataValue']('dtlsverify','no');this[_0xc56d('0x8')](_0xc56d('0x4d'),_0xc56d('0x52'));this[_0xc56d('0x8')](_0xc56d('0x4e'),_0x3a43af[_0xc56d('0x4e')]||_0xc56d('0x53'));this[_0xc56d('0x8')]('dtlsprivatekey',_0x3a43af[_0xc56d('0x4f')]||_0xc56d('0x54'));this[_0xc56d('0x8')](_0xc56d('0x50'),_0xc56d('0x2f'));break;default:}}},'permissions':{'type':Sequelize[_0xc56d('0x44')],'set':function(_0x226bce){this[_0xc56d('0x8')]('permissions',_0x226bce?_0x226bce[_0xc56d('0x28')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_['map'](this['getDataValue'](_0xc56d('0x55'))[_0xc56d('0x29')](','),function(_0xc207f4){return parseInt(_0xc207f4,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0xc56d('0x4')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0xc56d('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xc56d('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xc56d('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xc56d('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xc56d('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xc56d('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xc56d('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0xc56d('0x2f'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xc56d('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0xc56d('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xc56d('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0xc56d('0x56'))?this[_0xc56d('0x16')](_0xc56d('0x56')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xc56d('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0xc56d('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xc56d('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xc56d('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xc56d('0x17')],'defaultValue':![],'set':function(_0x54f754){if(typeof _0x54f754===_0xc56d('0x57')){var _0x2f9813=_0x54f754==='1'?!![]:_0x54f754==='0'?![]:_0x54f754===_0xc56d('0x58')?!![]:_0x54f754==='false'?![]:![];this[_0xc56d('0x8')](_0xc56d('0x59'),_0x2f9813);}else{this[_0xc56d('0x8')](_0xc56d('0x59'),_0x54f754);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x1bf022){this[_0xc56d('0x8')](_0xc56d('0x5a'),_0x1bf022);if(_0x1bf022===!![]){this['setDataValue'](_0xc56d('0x5b'),moment());this[_0xc56d('0x8')](_0xc56d('0x5c'),0x0);}else{this['setDataValue']('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0xc56d('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xc56d('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xc56d('0x14')](0x5)[_0xc56d('0x5d')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xc56d('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xc56d('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xc56d('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xc56d('0x17')],'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 208a284..e6e7321 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 _0x430c=['select','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','path','lodash','squel','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','localhost','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','end','json','undefined','count','offset','limit','set','Content-Range','update','destroy','role','admin','Users','Agents','agent','telephone','ignore','map','value','includes','find','UserProfileResource','sendStatus','stack','name','send','index','User','rawAttributes','fieldName','type','key','password','salt','where','query','includeAll','include','attributes','push','rows','openTabs','true','length','chat','dataValues','sms','fax','mail','openchannel','show','params','differenceBy','keys','filters','intersection','model','merge','all','body','addContacts','omit','ids','internal','Setting','validatePasswordPattern','max','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','from','voicemail','mailbox','VoiceMail','email','permissions','101','102','113','110','104','105','108','111','114','create','user','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','userProfileId','Telephones','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','checkUserLimits','each','UserProfileSection','findAll','isEmpty','compact','changePassword','oldPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','newPassword','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','addQueues','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queues','penalty','spread','QueueId','emit','Queue:save','voice','VoiceQueue','get','format','UserVoiceQueueRt','upsert','removeQueues','channel','remove','isArray','Queue:remove','addAvatar','filename','getAvatar','join','root','userpic','download','existsSync','server/files/images/','getOpenTabs','whatsapp','ChatOpenTabs','CHAT','FaxOpenTabs','createdAt','OpenchannelOpenTabs','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','CmContact','fields','order','sort','filter','options','getContacts','hasOwnProperty','List','Tags','tag','getQueues','Queue','pick','nolimit','getGroups','ChatGroup','getRecordings','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:%s','user:forcelogout','remoteAddress','socket','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','PAUSE','LOGININPAUSE','concat','isMiddleware','logout','pause','QueuePause','updateAttributes','getChannels','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','smsPause','pauseType','lastPauseAt','manual','%s%s','Pause','getTeams','addTeams','Team','setDataValue','Voice','getChatQueues','Chat','getMailQueues','Mail','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','getDataValue','UserVoicePrefix','removeTeams','transaction','TeamVoicePrefix','VoicePrefixId','CmList','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','$and','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$contains','$any','lastName','Contact','dialActive','CmHopper','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','createApiKey','generateApiKey','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','resolve','queues','teams','flatten','lower','col','toString','asc','desc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','offline','idle','unknown','unavailable','voiceStatus','busy','charAt','toUpperCase','slice','QueryTypes'];(function(_0x400aa0,_0x594ab4){var _0x5070ee=function(_0x11ffe7){while(--_0x11ffe7){_0x400aa0['push'](_0x400aa0['shift']());}};_0x5070ee(++_0x594ab4);}(_0x430c,0x1a1));var _0xc430=function(_0x47242d,_0x13f993){_0x47242d=_0x47242d-0x0;var _0x30273a=_0x430c[_0x47242d];return _0x30273a;};'use strict';var moment=require(_0xc430('0x0'));var BPromise=require('bluebird');var util=require('util');var path=require(_0xc430('0x1'));var fs=require('fs');var _=require(_0xc430('0x2'));var squel=require(_0xc430('0x3'));var jayson=require('jayson/promise');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var logger=require(_0xc430('0x4'))(_0xc430('0x5'));var utils=require('../../config/utils');var config=require(_0xc430('0x6'));var licenseUtil=require('../../config/license/util');var db=require(_0xc430('0x7'))['db'];var socket=require(_0xc430('0x8'))(new Redis(config[_0xc430('0x9')]));require(_0xc430('0xa'))[_0xc430('0xb')](socket);config[_0xc430('0x9')]=_[_0xc430('0xc')](config[_0xc430('0x9')],{'host':_0xc430('0xd'),'port':0x18eb});var client=jayson['client'][_0xc430('0xe')]({'port':0x232a});var values;function respondWithRpcPromise(_0x2b47d6,_0x56c090,_0x39e624,_0x5aeed9){return new BPromise(function(_0x3b84bc,_0x47e664){var _0x2ce28a=_0x5aeed9||client;return _0x2ce28a[_0xc430('0xf')](_0x2b47d6,_0x39e624)[_0xc430('0x10')](function(_0x1fb8ce){logger[_0xc430('0x11')](_0xc430('0x12'),_0x56c090,_0xc430('0x13'));logger['debug']('User,\x20%s,\x20%s,\x20%s',_0x56c090,_0xc430('0x13'),JSON[_0xc430('0x14')](_0x1fb8ce));if(_0x1fb8ce[_0xc430('0x15')]){if(_0x1fb8ce[_0xc430('0x15')][_0xc430('0x16')]===0x1f4){logger['error'](_0xc430('0x12'),_0x56c090,_0x1fb8ce['error']['message']);return _0x47e664(_0x1fb8ce[_0xc430('0x15')][_0xc430('0x17')]);}logger[_0xc430('0x15')]('User,\x20%s,\x20%s',_0x56c090,_0x1fb8ce['error'][_0xc430('0x17')]);return _0x3b84bc(_0x1fb8ce['error'][_0xc430('0x17')]);}else{logger['info']('User,\x20%s,\x20%s',_0x56c090,_0xc430('0x13'));_0x3b84bc(_0x1fb8ce['result'][_0xc430('0x17')]);}})[_0xc430('0x18')](function(_0x3eb888){logger[_0xc430('0x15')](_0xc430('0x12'),_0x56c090,_0x3eb888);_0x47e664(_0x3eb888);});});}function respondWithStatusCode(_0x5af282,_0x388a2f){_0x388a2f=_0x388a2f||0xcc;return function(_0x4d9dbf){if(_0x4d9dbf){return _0x5af282['sendStatus'](_0x388a2f);}return _0x5af282[_0xc430('0x19')](_0x388a2f)[_0xc430('0x1a')]();};}function respondWithResult(_0x3c7afa,_0x56dd16){_0x56dd16=_0x56dd16||0xc8;return function(_0x3fd56b){if(_0x3fd56b){return _0x3c7afa['status'](_0x56dd16)[_0xc430('0x1b')](_0x3fd56b);}};}function respondWithFilteredResult(_0x22ebfb,_0x4efecd){return function(_0x31b4f1){if(_0x31b4f1){var _0x3cdbd3=typeof _0x4efecd['offset']===_0xc430('0x1c')&&typeof _0x4efecd['limit']===_0xc430('0x1c');var _0x4b5280=_0x31b4f1[_0xc430('0x1d')];var _0x21e28a=_0x3cdbd3?0x0:_0x4efecd['offset'];var _0x33433f=_0x3cdbd3?_0x31b4f1[_0xc430('0x1d')]:_0x4efecd[_0xc430('0x1e')]+_0x4efecd[_0xc430('0x1f')];var _0x285407;if(_0x33433f>=_0x4b5280){_0x33433f=_0x4b5280;_0x285407=0xc8;}else{_0x285407=0xce;}_0x22ebfb['status'](_0x285407);return _0x22ebfb[_0xc430('0x20')](_0xc430('0x21'),_0x21e28a+'-'+_0x33433f+'/'+_0x4b5280)[_0xc430('0x1b')](_0x31b4f1);}return null;};}function saveUpdates(_0x1591e3){return function(_0x542cba){if(_0x542cba){return _0x542cba[_0xc430('0x22')](_0x1591e3)['then'](function(_0x1d65ee){return _0x1d65ee;});}return null;};}function removeEntity(_0x4ad29e){return function(_0x6b263b){if(_0x6b263b){return _0x6b263b[_0xc430('0x23')]()[_0xc430('0x10')](function(){var _0x3d7ccf=_0x6b263b['get']({'plain':!![]});if(_0x3d7ccf[_0xc430('0x24')]===_0xc430('0x25'))return;var _0x2bdfc4=[{'name':_0xc430('0x26'),'value':'user','ignore':!![]},{'name':_0xc430('0x27'),'value':_0xc430('0x28'),'ignore':![]},{'name':'Telephones','value':_0xc430('0x29'),'ignore':![]}];var _0x4ded17=_(_0x2bdfc4)['filter'](_0xc430('0x2a'))[_0xc430('0x2b')](_0xc430('0x2c'))[_0xc430('0x2c')]();if(_[_0xc430('0x2d')](_0x4ded17,_0x3d7ccf[_0xc430('0x24')])){return;}var _0x438879=_[_0xc430('0x2e')](_0x2bdfc4,['value',_0x3d7ccf[_0xc430('0x24')]])['name'];return db[_0xc430('0x2f')][_0xc430('0x23')]({'where':{'type':_0x438879,'resourceId':_0x3d7ccf['id']}})[_0xc430('0x10')](function(){return _0x6b263b;});})[_0xc430('0x10')](function(){_0x4ad29e['status'](0xcc)[_0xc430('0x1a')]();});}};}function handleEntityNotFound(_0x510fa1){return function(_0x517d2b){if(!_0x517d2b){_0x510fa1[_0xc430('0x30')](0x194);}return _0x517d2b;};}function handleError(_0x3ebdc0,_0x521793){_0x521793=_0x521793||0x1f4;return function(_0x5ff73c){logger[_0xc430('0x15')](_0x5ff73c[_0xc430('0x31')]);if(_0x5ff73c[_0xc430('0x32')]){delete _0x5ff73c[_0xc430('0x32')];}_0x3ebdc0[_0xc430('0x19')](_0x521793)[_0xc430('0x33')](_0x5ff73c);};}exports[_0xc430('0x34')]=function(_0x242844,_0x7e18ec){var _0x2ef4a6={},_0x41a2c2={'count':0x0,'rows':[]};var _0x5fd38b=_(db[_0xc430('0x35')][_0xc430('0x36')])['map'](function(_0x253fc0){return{'name':_0x253fc0[_0xc430('0x37')],'type':_0x253fc0[_0xc430('0x38')][_0xc430('0x39')]};})['filter'](function(_0x30f9b7){return!_[_0xc430('0x2d')]([_0xc430('0x3a'),_0xc430('0x3b')],_0x30f9b7[_0xc430('0x32')]);})[_0xc430('0x2c')]();_0x2ef4a6=qs['getOptions'](_0x5fd38b,_0x242844);var _0xa93ed0={'where':_0x2ef4a6[_0xc430('0x3c')]};return db[_0xc430('0x35')][_0xc430('0x1d')](_0xa93ed0)[_0xc430('0x10')](function(_0x463873){_0x41a2c2[_0xc430('0x1d')]=_0x463873;if(_0x242844[_0xc430('0x3d')][_0xc430('0x3e')]){_0x2ef4a6[_0xc430('0x3f')]=[{'all':!![]}];}if(!_[_0xc430('0x2d')](_0x2ef4a6[_0xc430('0x40')],'id')){_0x2ef4a6[_0xc430('0x40')][_0xc430('0x41')]('id');}return db['User']['findAll'](_0x2ef4a6);})['then'](function(_0x262063){_0x41a2c2[_0xc430('0x42')]=_0x262063;if(_0x242844[_0xc430('0x3d')][_0xc430('0x43')]===_0xc430('0x44')){var _0x3bfb23=[];for(var _0x26cc86=0x0;_0x26cc86<_0x41a2c2[_0xc430('0x42')][_0xc430('0x45')];_0x26cc86++){_0x3bfb23[_0xc430('0x41')](get_open_tabs(_0xc430('0x46'),_0x41a2c2[_0xc430('0x42')][_0x26cc86][_0xc430('0x47')]));_0x3bfb23[_0xc430('0x41')](get_open_tabs(_0xc430('0x48'),_0x41a2c2[_0xc430('0x42')][_0x26cc86]['dataValues']));_0x3bfb23[_0xc430('0x41')](get_open_tabs(_0xc430('0x49'),_0x41a2c2[_0xc430('0x42')][_0x26cc86][_0xc430('0x47')]));_0x3bfb23[_0xc430('0x41')](get_open_tabs(_0xc430('0x4a'),_0x41a2c2[_0xc430('0x42')][_0x26cc86][_0xc430('0x47')]));_0x3bfb23['push'](get_open_tabs(_0xc430('0x4b'),_0x41a2c2['rows'][_0x26cc86][_0xc430('0x47')]));_0x3bfb23[_0xc430('0x41')](get_open_tabs('whatsapp',_0x41a2c2['rows'][_0x26cc86][_0xc430('0x47')]));}return BPromise['all'](_0x3bfb23)['then'](function(_0x10db27){return _0x41a2c2;});}else{return _0x41a2c2;}})['then'](respondWithFilteredResult(_0x7e18ec,_0x2ef4a6))[_0xc430('0x18')](handleError(_0x7e18ec,null));};exports[_0xc430('0x4c')]=function(_0xe2d510,_0x4e759a){var _0x2ac26c={'raw':![],'where':{'id':_0xe2d510[_0xc430('0x4d')]['id']}},_0x2e7052={};_0x2e7052['model']=_[_0xc430('0x4e')](_[_0xc430('0x4f')](db[_0xc430('0x35')][_0xc430('0x36')]),[_0xc430('0x3a'),_0xc430('0x3b')]);_0x2e7052[_0xc430('0x3d')]=_['keys'](_0xe2d510[_0xc430('0x3d')]);_0x2e7052[_0xc430('0x50')]=_[_0xc430('0x51')](_0x2e7052['model'],_0x2e7052[_0xc430('0x3d')]);_0x2ac26c[_0xc430('0x40')]=_[_0xc430('0x51')](_0x2e7052[_0xc430('0x52')],qs['fields'](_0xe2d510[_0xc430('0x3d')]['fields']));_0x2ac26c[_0xc430('0x40')]=_0x2ac26c[_0xc430('0x40')][_0xc430('0x45')]?_0x2ac26c[_0xc430('0x40')]:_0x2e7052[_0xc430('0x52')];if(_0xe2d510[_0xc430('0x3d')]['includeAll']){_0x2ac26c[_0xc430('0x3f')]=[{'all':!![]}];}_0x2ac26c=_[_0xc430('0x53')]({},_0x2ac26c,_0xe2d510['options']);if(!_[_0xc430('0x2d')](_0x2ac26c[_0xc430('0x40')],'id')){_0x2ac26c[_0xc430('0x40')][_0xc430('0x41')]('id');}return db['User'][_0xc430('0x2e')](_0x2ac26c)['then'](handleEntityNotFound(_0x4e759a,null))[_0xc430('0x10')](function(_0x322835){var _0x2ea527=[];values=_0x322835;if(_0xe2d510[_0xc430('0x3d')]['openTabs']===_0xc430('0x44')){_0x2ea527[_0xc430('0x41')](get_open_tabs('chat',_0x322835['dataValues']));_0x2ea527[_0xc430('0x41')](get_open_tabs(_0xc430('0x48'),_0x322835[_0xc430('0x47')]));_0x2ea527[_0xc430('0x41')](get_open_tabs(_0xc430('0x4b'),_0x322835[_0xc430('0x47')]));_0x2ea527[_0xc430('0x41')](get_open_tabs('whatsapp',_0x322835[_0xc430('0x47')]));_0x2ea527['push'](get_open_tabs(_0xc430('0x49'),_0x322835[_0xc430('0x47')]));_0x2ea527[_0xc430('0x41')](get_open_tabs(_0xc430('0x4a'),_0x322835[_0xc430('0x47')]));return BPromise[_0xc430('0x54')](_0x2ea527);}else{return values;}})['then'](function(_0x1b2214){return values;})[_0xc430('0x10')](respondWithResult(_0x4e759a,null))[_0xc430('0x18')](handleError(_0x4e759a,null));};exports[_0xc430('0x22')]=function(_0x10c7a4,_0xb4d28f){if(_0x10c7a4[_0xc430('0x55')]['id']){delete _0x10c7a4['body']['id'];}delete _0x10c7a4[_0xc430('0x55')]['role'];return db[_0xc430('0x35')]['find']({'where':{'id':_0x10c7a4[_0xc430('0x4d')]['id']}})[_0xc430('0x10')](handleEntityNotFound(_0xb4d28f,null))[_0xc430('0x10')](saveUpdates(_0x10c7a4[_0xc430('0x55')],null))[_0xc430('0x10')](respondWithResult(_0xb4d28f,null))[_0xc430('0x18')](handleError(_0xb4d28f,null));};exports['describe']=function(_0x3ad99c,_0x31fcdd){return db['User']['describe']()[_0xc430('0x10')](respondWithResult(_0x31fcdd,null))[_0xc430('0x18')](handleError(_0x31fcdd,null));};exports[_0xc430('0x56')]=function(_0x37d225,_0x3ca9ac){return db[_0xc430('0x35')][_0xc430('0x2e')]({'where':{'id':_0x37d225[_0xc430('0x4d')]['id']}})[_0xc430('0x10')](handleEntityNotFound(_0x3ca9ac,null))[_0xc430('0x10')](function(_0x2eb99e){if(_0x2eb99e){return _0x2eb99e[_0xc430('0x56')](_0x37d225['body']['ids'],_[_0xc430('0x57')](_0x37d225['body'],[_0xc430('0x58'),'id'])||{});}})[_0xc430('0x10')](respondWithResult(_0x3ca9ac,null))['catch'](handleError(_0x3ca9ac,null));};function validateUser(_0x37e58b){return new BPromise(function(_0x4e1732,_0x4f4c0b){if(_0x37e58b[_0xc430('0x59')])return _0x4e1732(_0x37e58b);return db[_0xc430('0x5a')]['findById'](0x1)[_0xc430('0x10')](function(_0x5bb111){if(_0x5bb111['securePassword'])authService[_0xc430('0x5b')](_0x37e58b[_0xc430('0x3a')]);db[_0xc430('0x35')][_0xc430('0x5c')]('internal')[_0xc430('0x10')](function(_0x2672dd){if(_[_0xc430('0x5d')](_0x2672dd)){_0x37e58b[_0xc430('0x59')]=_0x5bb111['min_internal']||0x1;return;}if(_[_0xc430('0x5d')](_0x5bb111[_0xc430('0x5e')])||_0x5bb111[_0xc430('0x5e')]===_0x2672dd){_0x37e58b[_0xc430('0x59')]=_0x2672dd+0x1;return;}if(_0x5bb111[_0xc430('0x5e')]>_0x2672dd){_0x37e58b[_0xc430('0x59')]=_0x5bb111[_0xc430('0x5e')];return;}return db[_0xc430('0x5f')][_0xc430('0x3d')](_0xc430('0x60'),{'type':db[_0xc430('0x5f')]['QueryTypes']['SELECT']})['then'](function(_0x4000c0){if(_0x4000c0&&_0x4000c0[_0xc430('0x45')]){for(var _0xdde142=0x0,_0x49e158=_0x4000c0['length'];_0xdde142<_0x49e158&&_[_0xc430('0x5d')](_0x37e58b[_0xc430('0x59')]);_0xdde142++){if(_0x5bb111[_0xc430('0x5e')]<=_0x4000c0[_0xdde142][_0xc430('0x61')]){_0x37e58b[_0xc430('0x59')]=_0x4000c0[_0xdde142][_0xc430('0x61')];}else if(_0x5bb111[_0xc430('0x5e')]>_0x4000c0[_0xdde142][_0xc430('0x61')]&&_0x5bb111[_0xc430('0x5e')]<=_0x4000c0[_0xdde142]['to']){_0x37e58b[_0xc430('0x59')]=_0x5bb111['min_internal'];}}}if(_[_0xc430('0x5d')](_0x37e58b[_0xc430('0x59')])){_0x37e58b[_0xc430('0x59')]=_0x2672dd+0x1;}return _0x4e1732(_0x37e58b);});});})['catch'](function(_0x503c80){_0x4f4c0b(_0x503c80);});});}function updateUser(_0x50b32a){return new BPromise(function(_0x2d77fc,_0x1ae142){try{if(_0x50b32a[_0xc430('0x62')]){_0x50b32a[_0xc430('0x63')]=_0x50b32a['internal'];_0x50b32a[_0xc430('0x64')]={'mailbox':_0x50b32a[_0xc430('0x59')],'password':_0x50b32a[_0xc430('0x3a')],'fullname':_0x50b32a['fullname'],'email':_0x50b32a[_0xc430('0x65')]};}if(_0x50b32a['role']===_0xc430('0x28')){if(!_0x50b32a[_0xc430('0x66')])_0x50b32a[_0xc430('0x66')]=[_0xc430('0x67'),_0xc430('0x68'),'103',_0xc430('0x69'),_0xc430('0x6a'),_0xc430('0x6b'),_0xc430('0x6c'),'106','107',_0xc430('0x6d'),'109','100',_0xc430('0x6e'),_0xc430('0x6f'),'115'];}_0x2d77fc(_0x50b32a);}catch(_0xf5bca){_0x1ae142(_0xf5bca);}});}exports[_0xc430('0x70')]=function(_0x26cd60,_0x403c0f){if(_0x26cd60[_0xc430('0x71')][_0xc430('0x24')]==='agent')throw new Error(_0xc430('0x72'));if(_0x26cd60[_0xc430('0x55')][_0xc430('0x24')]===_0xc430('0x71')&&_0x26cd60['user'][_0xc430('0x24')]!==_0xc430('0x25')){throw new Error(_0xc430('0x73'));}if(_0x26cd60['body'][_0xc430('0x24')]==='admin'&&_0x26cd60['user'][_0xc430('0x24')]!=='admin'){throw new Error(_0xc430('0x74'));}return licenseUtil['checkUserLimits']([_0x26cd60[_0xc430('0x55')]])[_0xc430('0x10')](function(){return validateUser(_0x26cd60['body']);})[_0xc430('0x10')](function(_0x12a26b){return updateUser(_0x12a26b)['then'](function(_0x3778e7){if(_0x3778e7[_0xc430('0x24')]==='admin'){_0x3778e7[_0xc430('0x75')]=_0x26cd60[_0xc430('0x71')]['settingsEnabled'];delete _0x3778e7[_0xc430('0x76')];}return _0x3778e7;});})[_0xc430('0x10')](function(_0x3dbc0f){return db[_0xc430('0x35')][_0xc430('0x70')](_0x3dbc0f,{'include':[{'model':db[_0xc430('0x64')],'as':_0xc430('0x64')}]});})[_0xc430('0x10')](function(_0x28d06f){if(_0x26cd60[_0xc430('0x55')][_0xc430('0x24')]==='user')return _0x28d06f;if(_0x26cd60[_0xc430('0x71')][_0xc430('0x24')]!==_0xc430('0x71'))return _0x28d06f;return db['UserProfileSection']['find']({'where':{'name':_0x28d06f[_0xc430('0x24')]==='agent'?_0xc430('0x27'):_0xc430('0x77'),'userProfileId':_0x26cd60['user']['userProfileId']},'raw':!![]})[_0xc430('0x10')](function(_0x293cc1){if(!_0x293cc1||_0x293cc1[_0xc430('0x78')]!=0x0)return _0x28d06f;return db['UserProfileResource'][_0xc430('0x70')]({'name':_0x28d06f['name'],'resourceId':_0x28d06f['id'],'type':_0x293cc1['name'],'sectionId':_0x293cc1['id']},{})[_0xc430('0x10')](function(){return _0x28d06f;});})[_0xc430('0x18')](function(_0x1e2f9c){logger['error'](_0xc430('0x79'),_0x1e2f9c);throw _0x1e2f9c;});})[_0xc430('0x10')](respondWithResult(_0x403c0f,0xc9))[_0xc430('0x18')](handleError(_0x403c0f,null));};exports[_0xc430('0x7a')]=function(_0x4054b8,_0x4d9ba8){var _0x550472=_0x4054b8[_0xc430('0x55')];var _0x251b15=[];if(_0x4054b8[_0xc430('0x71')][_0xc430('0x24')]===_0xc430('0x28'))throw new Error(_0xc430('0x72'));if(_[_0xc430('0x7b')](_0x550472,[_0xc430('0x24'),_0xc430('0x71')])&&_0x4054b8[_0xc430('0x71')][_0xc430('0x24')]!=='admin'){throw new Error(_0xc430('0x73'));}if(_[_0xc430('0x7b')](_0x550472,[_0xc430('0x24'),_0xc430('0x25')])&&_0x4054b8['user']['role']!==_0xc430('0x25')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0xc430('0x7c')](_0x550472)[_0xc430('0x10')](function(){return validateUser(_0x550472[0x0]);})[_0xc430('0x10')](function(){for(var _0x15fe67=0x1;_0x15fe67<_0x550472[_0xc430('0x45')];_0x15fe67++){var _0x59c102=_0x550472[_0x15fe67-0x1]['internal'];if(!_0x550472[_0x15fe67]['internal'])_0x550472[_0x15fe67]['internal']=_0x59c102+0x1;_0x251b15[_0xc430('0x41')](validateUser(_0x550472[_0x15fe67]));}return BPromise['all'](_0x251b15);})['then'](function(){_0x251b15=[];for(var _0x251a36=0x0;_0x251a36<_0x550472[_0xc430('0x45')];_0x251a36++){_0x251b15[_0xc430('0x41')](updateUser(_0x550472[_0x251a36]));}return BPromise[_0xc430('0x54')](_0x251b15);})[_0xc430('0x10')](function(){return BPromise[_0xc430('0x7d')](_0x550472,function(_0xadab04){return db[_0xc430('0x35')][_0xc430('0x70')](_0xadab04,{'include':[{'model':db[_0xc430('0x64')],'as':_0xc430('0x64')}]})[_0xc430('0x10')](function(_0x32ec63){_0xadab04['id']=_0x32ec63['id'];return _0xadab04;});});})['then'](function(_0x57f1a9){if(_0x4054b8[_0xc430('0x55')][_0xc430('0x24')]===_0xc430('0x71'))return _0x57f1a9;if(_0x4054b8[_0xc430('0x71')][_0xc430('0x24')]!==_0xc430('0x71'))return _0x57f1a9;var _0x3c4c9b=_['some'](_0x57f1a9,function(_0x363188){return _0x363188[_0xc430('0x24')]==='agent'||_0x363188[_0xc430('0x24')]===_0xc430('0x29');});if(!_0x3c4c9b)return _0x57f1a9;return db[_0xc430('0x7e')][_0xc430('0x7f')]({'where':{'name':{'$or':['Agents',_0xc430('0x77')]},'userProfileId':_0x4054b8['user']['userProfileId']},'raw':!![]})[_0xc430('0x10')](function(_0x3a8ac0){if(_[_0xc430('0x80')](_0x3a8ac0)||!_[_0xc430('0x7b')](_0x3a8ac0,[_0xc430('0x78'),0x0]))return _0x57f1a9;_0x251b15=[];var _0x18859d=_(_0x3a8ac0)['map'](function(_0x3b2b3b){if(_0x3b2b3b[_0xc430('0x78')]===0x1)return;return _0x3b2b3b[_0xc430('0x32')]===_0xc430('0x27')?_0xc430('0x28'):_0xc430('0x29');})[_0xc430('0x81')]()[_0xc430('0x2c')]();for(var _0x1cd2c7=0x0;_0x1cd2c7<_0x57f1a9[_0xc430('0x45')];_0x1cd2c7++){if(!_['includes'](_0x18859d,_0x57f1a9[_0x1cd2c7][_0xc430('0x24')]))return;var _0x3f25e7=_0x57f1a9[_0x1cd2c7]['role']==='agent'?_0xc430('0x27'):_0xc430('0x77');_0x251b15[_0xc430('0x41')](db[_0xc430('0x2f')][_0xc430('0x70')]({'name':_0x57f1a9[_0x1cd2c7]['name'],'resourceId':_0x57f1a9[_0x1cd2c7]['id'],'type':_0x3f25e7,'sectionId':_[_0xc430('0x2e')](_0x3a8ac0,[_0xc430('0x32'),_0x3f25e7])['id']},{}));}return BPromise[_0xc430('0x54')](_0x251b15);});})[_0xc430('0x10')](respondWithResult(_0x4d9ba8,0xc9))['catch'](handleError(_0x4d9ba8,null));};exports[_0xc430('0x82')]=function(_0x59d117,_0x520de2){if(_0x59d117[_0xc430('0x55')]['id']){delete _0x59d117[_0xc430('0x55')]['id'];}return db[_0xc430('0x35')][_0xc430('0x2e')]({'where':{'id':_0x59d117['params']['id']}})[_0xc430('0x10')](function(_0x7e062a){if(!_0x7e062a)return null;if(_0x7e062a['id']===_0x59d117['user']['id']){if(!_0x59d117['body'][_0xc430('0x83')]||!_0x59d117[_0xc430('0x55')]['newPassword']){throw new db[(_0xc430('0x84'))][(_0xc430('0x85'))](_0xc430('0x86'));}if(!_0x7e062a[_0xc430('0x87')](_0x59d117[_0xc430('0x55')][_0xc430('0x83')])){throw new db[(_0xc430('0x84'))]['ValidationError'](_0xc430('0x88'));}if(_0x59d117[_0xc430('0x55')][_0xc430('0x83')]===_0x59d117['body'][_0xc430('0x89')]){throw new db[(_0xc430('0x84'))]['ValidationError']('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x59d117[_0xc430('0x71')]['role']===_0xc430('0x25')){if(!_0x59d117[_0xc430('0x55')][_0xc430('0x89')]){throw new db[(_0xc430('0x84'))]['ValidationError'](_0xc430('0x8a'));}}else if(_0x59d117[_0xc430('0x71')][_0xc430('0x24')]===_0xc430('0x71')){if(!_0x59d117[_0xc430('0x55')][_0xc430('0x89')]){throw new db[(_0xc430('0x84'))]['ValidationError'](_0xc430('0x8a'));}if(_0x7e062a[_0xc430('0x24')]!=='agent'){throw new db[(_0xc430('0x84'))][(_0xc430('0x85'))](_0xc430('0x72'));}}else{throw new db['Sequelize'][(_0xc430('0x85'))](_0xc430('0x72'));}return _0x7e062a;})[_0xc430('0x10')](handleEntityNotFound(_0x520de2,null))[_0xc430('0x10')](function(_0x5164be){return db[_0xc430('0x5a')][_0xc430('0x8b')]({'attributes':['id',_0xc430('0x8c'),_0xc430('0x8d'),_0xc430('0x8e')]})[_0xc430('0x10')](function(_0x1c8855){if(_0x1c8855[_0xc430('0x8c')])authService[_0xc430('0x5b')](_0x59d117[_0xc430('0x55')]['newPassword']);if(!_0x1c8855[_0xc430('0x8d')]||!_0x5164be[_0xc430('0x8f')])return _0x5164be;authService[_0xc430('0x90')](_0x59d117[_0xc430('0x55')][_0xc430('0x89')],_0x5164be['previousPasswords'],_0x1c8855[_0xc430('0x8e')]);return _0x5164be;})['then'](saveUpdates({'password':_0x59d117[_0xc430('0x55')]['newPassword'],'passwordResetAt':_0x59d117['user']['id']==_0x59d117[_0xc430('0x4d')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x59d117[_0xc430('0x55')][_0xc430('0x89')],_0x5164be[_0xc430('0x8f')])},null));})[_0xc430('0x10')](respondWithResult(_0x520de2,null))[_0xc430('0x18')](handleError(_0x520de2,null));};exports[_0xc430('0x91')]=function(_0x2b4381,_0x2a053f){var _0x142b21=_0x2b4381['body']['channel'];return db[_0xc430('0x35')]['find']({'where':{'id':_0x2b4381[_0xc430('0x4d')]['id']},'attributes':['id',_0xc430('0x32'),'role',_0xc430('0x92'),_0xc430('0x93'),_0xc430('0x94'),_0xc430('0x95')]})[_0xc430('0x10')](handleEntityNotFound(_0x2a053f,null))[_0xc430('0x10')](function(_0x17fb84){if(_0x17fb84){if(!utils[_0xc430('0x96')](_0x142b21)){throw new db['Sequelize'][(_0xc430('0x85'))](_0xc430('0x97'));}return _0x17fb84['add'+_[_0xc430('0x98')](_0x142b21[_0xc430('0x99')]())+_0xc430('0x9a')](_0x2b4381[_0xc430('0x55')][_0xc430('0x58')],{'penalty':_0x2b4381[_0xc430('0x55')][_0xc430('0x9b')]||0x0})[_0xc430('0x9c')](function(_0x28eac9){for(var _0x3dda26=0x0;_0x3dda26<_0x2b4381[_0xc430('0x55')]['ids'][_0xc430('0x45')];_0x3dda26+=0x1){var _0x1ad10f={'UserId':Number(_0x2b4381[_0xc430('0x4d')]['id'])};_0x1ad10f[_[_0xc430('0x98')](_0x142b21[_0xc430('0x99')]())+_0xc430('0x9d')]=Number(_0x2b4381[_0xc430('0x55')][_0xc430('0x58')][_0x3dda26]);socket[_0xc430('0x9e')](_0xc430('0x71')+_[_0xc430('0x98')](_0x142b21[_0xc430('0x99')]())+_0xc430('0x9f'),_0x1ad10f);}return _0x28eac9;})[_0xc430('0x10')](function(){if(_0x142b21===_0xc430('0xa0')){return db[_0xc430('0xa1')][_0xc430('0x7f')]({'where':{'id':_0x2b4381[_0xc430('0x55')][_0xc430('0x58')]||[]},'raw':!![],'attributes':['id',_0xc430('0x32')]});}})[_0xc430('0x10')](function(_0x3f3158){var _0xbb647a=_0x17fb84[_0xc430('0xa2')]({'plain':!![]});var _0x4baa6c=[];if(_0x142b21===_0xc430('0xa0')&&_0xbb647a[_0xc430('0x24')]===_0xc430('0x28')&&_0xbb647a[_0xc430('0x92')]){for(var _0x169c51=0x0;_0x169c51<_0x3f3158[_0xc430('0x45')];_0x169c51+=0x1){_0x4baa6c['push']({'membername':_0xbb647a['name'],'UserId':_0xbb647a['id'],'queue_name':_0x3f3158[_0x169c51][_0xc430('0x32')],'VoiceQueueId':_0x3f3158[_0x169c51]['id'],'interface':_['isNil'](_0xbb647a[_0xc430('0x95')])?util[_0xc430('0xa3')]('SIP/%s',_0xbb647a[_0xc430('0x32')]):_0xbb647a[_0xc430('0x95')],'paused':_0xbb647a[_0xc430('0x94')]||![],'penalty':_0x2b4381[_0xc430('0x55')]['penalty']||0x0});}return BPromise[_0xc430('0x7d')](_0x4baa6c,function(_0x4de335){return db[_0xc430('0xa4')][_0xc430('0xa5')](_0x4de335);});}return _0x17fb84;});}})[_0xc430('0x10')](respondWithStatusCode(_0x2a053f,null))[_0xc430('0x18')](handleError(_0x2a053f,null));};exports[_0xc430('0xa6')]=function(_0x29c336,_0x294ef8){var _0x12b3eb;return db['User']['find']({'where':{'id':_0x29c336['params']['id']},'attributes':['id',_0xc430('0x32'),_0xc430('0x24')]})[_0xc430('0x10')](handleEntityNotFound(_0x294ef8,null))['then'](function(_0x24713a){if(_0x24713a){_0x12b3eb=_0x24713a;if(!_0x29c336['query'][_0xc430('0xa7')]||!utils[_0xc430('0x96')](_0x29c336[_0xc430('0x3d')][_0xc430('0xa7')])){throw new db['Sequelize'][(_0xc430('0x85'))](_0xc430('0x97'));}return _0x24713a[_0xc430('0xa8')+_[_0xc430('0x98')](_0x29c336[_0xc430('0x3d')][_0xc430('0xa7')][_0xc430('0x99')]())+_0xc430('0x9a')](_0x29c336['query'][_0xc430('0x58')]);}})[_0xc430('0x10')](function(_0x175e38){if(_[_0xc430('0xa9')](_0x29c336[_0xc430('0x3d')][_0xc430('0x58')])){for(var _0xdeee04=0x0;_0xdeee04<_0x29c336['query'][_0xc430('0x58')][_0xc430('0x45')];_0xdeee04+=0x1){var _0x38a606={'UserId':Number(_0x29c336[_0xc430('0x4d')]['id'])};_0x38a606[_[_0xc430('0x98')](_0x29c336[_0xc430('0x3d')][_0xc430('0xa7')][_0xc430('0x99')]())+_0xc430('0x9d')]=Number(_0x29c336[_0xc430('0x3d')][_0xc430('0x58')][_0xdeee04]);socket[_0xc430('0x9e')](_0xc430('0x71')+_[_0xc430('0x98')](_0x29c336[_0xc430('0x3d')][_0xc430('0xa7')][_0xc430('0x99')]())+_0xc430('0xaa'),_0x38a606);}}else{var _0x38a606={'UserId':Number(_0x29c336[_0xc430('0x4d')]['id'])};_0x38a606[_['capitalize'](_0x29c336[_0xc430('0x3d')]['channel'][_0xc430('0x99')]())+_0xc430('0x9d')]=Number(_0x29c336[_0xc430('0x3d')][_0xc430('0x58')]);socket[_0xc430('0x9e')](_0xc430('0x71')+_[_0xc430('0x98')](_0x29c336[_0xc430('0x3d')][_0xc430('0xa7')][_0xc430('0x99')]())+_0xc430('0xaa'),_0x38a606);}return _0x175e38;})[_0xc430('0x10')](function(){if(_0x29c336[_0xc430('0x3d')][_0xc430('0xa7')]===_0xc430('0xa0')){return db[_0xc430('0xa4')][_0xc430('0x23')]({'where':{'UserId':_0x29c336[_0xc430('0x4d')]['id'],'VoiceQueueId':_0x29c336[_0xc430('0x3d')][_0xc430('0x58')]},'individualHooks':!![]})[_0xc430('0x10')](function(){return _0x12b3eb;});}return _0x12b3eb;})['then'](respondWithStatusCode(_0x294ef8,null))['catch'](handleError(_0x294ef8,null));};exports[_0xc430('0xab')]=function(_0x44af2e,_0x5efc63){_0x44af2e[_0xc430('0x55')]['userpic']=_0x44af2e['file'][_0xc430('0xac')];return db[_0xc430('0x35')]['find']({'where':{'id':_0x44af2e['params']['id']}})[_0xc430('0x10')](handleEntityNotFound(_0x5efc63,null))[_0xc430('0x10')](saveUpdates(_0x44af2e[_0xc430('0x55')],null))['then'](respondWithResult(_0x5efc63,null))[_0xc430('0x18')](handleError(_0x5efc63,null));};exports[_0xc430('0xad')]=function(_0xfd62ab,_0x229de2){var _0x5e8cf1=path[_0xc430('0xae')](config[_0xc430('0xaf')],'server/files/images/logos/default_profile.png');return db['User'][_0xc430('0x2e')]({'where':{'id':_0xfd62ab[_0xc430('0x4d')]['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x229de2,null))[_0xc430('0x10')](function(_0x246ff9){if(_0x246ff9){if(_[_0xc430('0x5d')](_0x246ff9[_0xc430('0xb0')])){return _0x229de2[_0xc430('0xb1')](_0x5e8cf1);}else{if(!fs[_0xc430('0xb2')](path[_0xc430('0xae')](config['root'],_0xc430('0xb3'),_0x246ff9[_0xc430('0xb0')]))){return _0x229de2[_0xc430('0xb1')](_0x5e8cf1);}return _0x229de2[_0xc430('0xb1')](path[_0xc430('0xae')](config[_0xc430('0xaf')],_0xc430('0xb3'),_0x246ff9['userpic']));}}})['catch'](handleError(_0x229de2,null));};exports[_0xc430('0xb4')]=function(_0x28153e,_0x2006b8){return db[_0xc430('0x35')][_0xc430('0x2e')]({'where':{'id':_0x28153e[_0xc430('0x4d')]['id']},'attributes':['id']})[_0xc430('0x10')](handleEntityNotFound(_0x2006b8,null))[_0xc430('0x10')](function(_0xbec0c1){var _0x5cbdef=[];values=_0xbec0c1['dataValues'];_0x5cbdef[_0xc430('0x41')](get_open_tabs(_0xc430('0x46'),_0xbec0c1[_0xc430('0x47')]));_0x5cbdef['push'](get_open_tabs('sms',_0xbec0c1[_0xc430('0x47')]));_0x5cbdef['push'](get_open_tabs(_0xc430('0x4b'),_0xbec0c1[_0xc430('0x47')]));_0x5cbdef[_0xc430('0x41')](get_open_tabs(_0xc430('0xb5'),_0xbec0c1['dataValues']));_0x5cbdef[_0xc430('0x41')](get_open_tabs('fax',_0xbec0c1['dataValues']));_0x5cbdef['push'](get_open_tabs(_0xc430('0x4a'),_0xbec0c1[_0xc430('0x47')]));return BPromise['all'](_0x5cbdef);})[_0xc430('0x10')](function(_0x2fb750){var _0x5dfd2b=[];if(_0x2fb750){for(var _0x350ddb=0x0;_0x350ddb=_0x417b42){_0x157a2d=_0x417b42;_0x12ebd2=0xc8;}else{_0x12ebd2=0xce;}_0x33d526[_0xf8e3('0x22')](_0x12ebd2);return _0x33d526[_0xf8e3('0x29')](_0xf8e3('0x2a'),_0x3b41a1+'-'+_0x157a2d+'/'+_0x417b42)[_0xf8e3('0x24')](_0x1f4b68);}return null;};}function saveUpdates(_0xfaf15d){return function(_0x4f2ae9){if(_0x4f2ae9){return _0x4f2ae9[_0xf8e3('0x2b')](_0xfaf15d)[_0xf8e3('0x15')](function(_0x492694){return _0x492694;});}return null;};}function removeEntity(_0x28b2f2){return function(_0x567153){if(_0x567153){return _0x567153[_0xf8e3('0x2c')]()[_0xf8e3('0x15')](function(){var _0x40f64d=_0x567153[_0xf8e3('0x2d')]({'plain':!![]});if(_0x40f64d[_0xf8e3('0x2e')]===_0xf8e3('0x2f'))return;var _0xb9c26=[{'name':_0xf8e3('0x30'),'value':'user','ignore':!![]},{'name':_0xf8e3('0x31'),'value':_0xf8e3('0x32'),'ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0x5cc1ed=_(_0xb9c26)[_0xf8e3('0x33')]('ignore')[_0xf8e3('0x34')](_0xf8e3('0x35'))[_0xf8e3('0x35')]();if(_[_0xf8e3('0x36')](_0x5cc1ed,_0x40f64d['role'])){return;}var _0x581a97=_[_0xf8e3('0x37')](_0xb9c26,[_0xf8e3('0x35'),_0x40f64d[_0xf8e3('0x2e')]])[_0xf8e3('0x38')];return db[_0xf8e3('0x39')][_0xf8e3('0x2c')]({'where':{'type':_0x581a97,'resourceId':_0x40f64d['id']}})['then'](function(){return _0x567153;});})[_0xf8e3('0x15')](function(){_0x28b2f2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1eaa03){return function(_0x1e8878){if(!_0x1e8878){_0x1eaa03[_0xf8e3('0x21')](0x194);}return _0x1e8878;};}function handleError(_0x1b7af2,_0x4cb46a){_0x4cb46a=_0x4cb46a||0x1f4;return function(_0x5ece46){logger[_0xf8e3('0x1b')](_0x5ece46[_0xf8e3('0x3a')]);if(_0x5ece46['name']){delete _0x5ece46[_0xf8e3('0x38')];}_0x1b7af2[_0xf8e3('0x22')](_0x4cb46a)[_0xf8e3('0x3b')](_0x5ece46);};}exports[_0xf8e3('0x3c')]=function(_0x547f53,_0x53cfea){var _0x5d307e={},_0x22b65e={'count':0x0,'rows':[]};var _0xcd2ffe=_(db[_0xf8e3('0x3d')][_0xf8e3('0x3e')])['map'](function(_0xee2e34){return{'name':_0xee2e34['fieldName'],'type':_0xee2e34[_0xf8e3('0x3f')][_0xf8e3('0x40')]};})[_0xf8e3('0x33')](function(_0x10e225){return!_[_0xf8e3('0x36')]([_0xf8e3('0x41'),_0xf8e3('0x42')],_0x10e225[_0xf8e3('0x38')]);})[_0xf8e3('0x35')]();_0x5d307e=qs['getOptions'](_0xcd2ffe,_0x547f53);var _0x211620={'where':_0x5d307e['where']};return db[_0xf8e3('0x3d')][_0xf8e3('0x27')](_0x211620)[_0xf8e3('0x15')](function(_0x9a6b37){_0x22b65e[_0xf8e3('0x27')]=_0x9a6b37;if(_0x547f53[_0xf8e3('0x43')][_0xf8e3('0x44')]){_0x5d307e[_0xf8e3('0x45')]=[{'all':!![]}];}if(!_['includes'](_0x5d307e[_0xf8e3('0x46')],'id')){_0x5d307e[_0xf8e3('0x46')][_0xf8e3('0x47')]('id');}return db[_0xf8e3('0x3d')][_0xf8e3('0x48')](_0x5d307e);})[_0xf8e3('0x15')](function(_0x792190){_0x22b65e[_0xf8e3('0x49')]=_0x792190;if(_0x547f53['query']['openTabs']==='true'){var _0x30fecf=[];for(var _0x3d3ea5=0x0;_0x3d3ea5<_0x22b65e['rows'][_0xf8e3('0x4a')];_0x3d3ea5++){_0x30fecf['push'](get_open_tabs(_0xf8e3('0x4b'),_0x22b65e[_0xf8e3('0x49')][_0x3d3ea5]['dataValues']));_0x30fecf[_0xf8e3('0x47')](get_open_tabs('sms',_0x22b65e[_0xf8e3('0x49')][_0x3d3ea5][_0xf8e3('0x4c')]));_0x30fecf['push'](get_open_tabs(_0xf8e3('0x4d'),_0x22b65e[_0xf8e3('0x49')][_0x3d3ea5][_0xf8e3('0x4c')]));_0x30fecf[_0xf8e3('0x47')](get_open_tabs('mail',_0x22b65e['rows'][_0x3d3ea5]['dataValues']));_0x30fecf[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x4e'),_0x22b65e[_0xf8e3('0x49')][_0x3d3ea5]['dataValues']));_0x30fecf[_0xf8e3('0x47')](get_open_tabs('whatsapp',_0x22b65e[_0xf8e3('0x49')][_0x3d3ea5][_0xf8e3('0x4c')]));}return BPromise['all'](_0x30fecf)['then'](function(_0x128234){return _0x22b65e;});}else{return _0x22b65e;}})[_0xf8e3('0x15')](respondWithFilteredResult(_0x53cfea,_0x5d307e))[_0xf8e3('0x20')](handleError(_0x53cfea,null));};exports[_0xf8e3('0x4f')]=function(_0x3b790f,_0x1fc2a6){var _0x3b56ed={'raw':![],'where':{'id':_0x3b790f[_0xf8e3('0x50')]['id']}},_0x2a58e2={};_0x2a58e2[_0xf8e3('0x51')]=_[_0xf8e3('0x52')](_['keys'](db[_0xf8e3('0x3d')][_0xf8e3('0x3e')]),[_0xf8e3('0x41'),_0xf8e3('0x42')]);_0x2a58e2[_0xf8e3('0x43')]=_[_0xf8e3('0x53')](_0x3b790f['query']);_0x2a58e2[_0xf8e3('0x54')]=_[_0xf8e3('0x55')](_0x2a58e2[_0xf8e3('0x51')],_0x2a58e2[_0xf8e3('0x43')]);_0x3b56ed[_0xf8e3('0x46')]=_[_0xf8e3('0x55')](_0x2a58e2['model'],qs[_0xf8e3('0x56')](_0x3b790f[_0xf8e3('0x43')][_0xf8e3('0x56')]));_0x3b56ed[_0xf8e3('0x46')]=_0x3b56ed[_0xf8e3('0x46')][_0xf8e3('0x4a')]?_0x3b56ed['attributes']:_0x2a58e2[_0xf8e3('0x51')];if(_0x3b790f[_0xf8e3('0x43')][_0xf8e3('0x44')]){_0x3b56ed[_0xf8e3('0x45')]=[{'all':!![]}];}_0x3b56ed=_[_0xf8e3('0x57')]({},_0x3b56ed,_0x3b790f['options']);if(!_[_0xf8e3('0x36')](_0x3b56ed[_0xf8e3('0x46')],'id')){_0x3b56ed[_0xf8e3('0x46')]['push']('id');}return db['User'][_0xf8e3('0x37')](_0x3b56ed)[_0xf8e3('0x15')](handleEntityNotFound(_0x1fc2a6,null))[_0xf8e3('0x15')](function(_0x3ad7f1){var _0x58ad2f=[];values=_0x3ad7f1;if(_0x3b790f[_0xf8e3('0x43')][_0xf8e3('0x58')]==='true'){_0x58ad2f['push'](get_open_tabs(_0xf8e3('0x4b'),_0x3ad7f1[_0xf8e3('0x4c')]));_0x58ad2f[_0xf8e3('0x47')](get_open_tabs('sms',_0x3ad7f1['dataValues']));_0x58ad2f['push'](get_open_tabs(_0xf8e3('0x4e'),_0x3ad7f1[_0xf8e3('0x4c')]));_0x58ad2f['push'](get_open_tabs('whatsapp',_0x3ad7f1['dataValues']));_0x58ad2f[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x4d'),_0x3ad7f1['dataValues']));_0x58ad2f[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x59'),_0x3ad7f1[_0xf8e3('0x4c')]));return BPromise['all'](_0x58ad2f);}else{return values;}})['then'](function(_0x524fbc){return values;})['then'](respondWithResult(_0x1fc2a6,null))[_0xf8e3('0x20')](handleError(_0x1fc2a6,null));};exports[_0xf8e3('0x2b')]=function(_0x3ef144,_0x447efe){if(_0x3ef144[_0xf8e3('0x5a')]['id']){delete _0x3ef144[_0xf8e3('0x5a')]['id'];}delete _0x3ef144[_0xf8e3('0x5a')][_0xf8e3('0x2e')];return db[_0xf8e3('0x3d')]['find']({'where':{'id':_0x3ef144['params']['id']}})[_0xf8e3('0x15')](handleEntityNotFound(_0x447efe,null))[_0xf8e3('0x15')](saveUpdates(_0x3ef144[_0xf8e3('0x5a')],null))['then'](respondWithResult(_0x447efe,null))[_0xf8e3('0x20')](handleError(_0x447efe,null));};exports[_0xf8e3('0x5b')]=function(_0x4879c7,_0x48bb3f){return db[_0xf8e3('0x3d')][_0xf8e3('0x5b')]()[_0xf8e3('0x15')](respondWithResult(_0x48bb3f,null))[_0xf8e3('0x20')](handleError(_0x48bb3f,null));};exports['addContacts']=function(_0x5bd7bf,_0x37751e){return db[_0xf8e3('0x3d')][_0xf8e3('0x37')]({'where':{'id':_0x5bd7bf[_0xf8e3('0x50')]['id']}})['then'](handleEntityNotFound(_0x37751e,null))['then'](function(_0x324ad5){if(_0x324ad5){return _0x324ad5[_0xf8e3('0x5c')](_0x5bd7bf['body'][_0xf8e3('0x5d')],_[_0xf8e3('0x5e')](_0x5bd7bf[_0xf8e3('0x5a')],[_0xf8e3('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x37751e,null))[_0xf8e3('0x20')](handleError(_0x37751e,null));};function validateUser(_0x5d2ecf){return new BPromise(function(_0x217979,_0x1cad38){if(_0x5d2ecf['internal'])return _0x217979(_0x5d2ecf);return db[_0xf8e3('0x5f')][_0xf8e3('0x60')](0x1)['then'](function(_0x232d83){if(_0x232d83[_0xf8e3('0x61')])authService[_0xf8e3('0x62')](_0x5d2ecf[_0xf8e3('0x41')]);db['User'][_0xf8e3('0x63')](_0xf8e3('0x64'))[_0xf8e3('0x15')](function(_0x3c214f){if(_[_0xf8e3('0x65')](_0x3c214f)){_0x5d2ecf[_0xf8e3('0x64')]=_0x232d83[_0xf8e3('0x66')]||0x1;return;}if(_[_0xf8e3('0x65')](_0x232d83[_0xf8e3('0x66')])||_0x232d83[_0xf8e3('0x66')]===_0x3c214f){_0x5d2ecf[_0xf8e3('0x64')]=_0x3c214f+0x1;return;}if(_0x232d83[_0xf8e3('0x66')]>_0x3c214f){_0x5d2ecf['internal']=_0x232d83['min_internal'];return;}return db[_0xf8e3('0x67')][_0xf8e3('0x43')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0xf8e3('0x67')][_0xf8e3('0x68')][_0xf8e3('0x69')]})[_0xf8e3('0x15')](function(_0x18a810){if(_0x18a810&&_0x18a810['length']){for(var _0x3e501c=0x0,_0x1dcd23=_0x18a810['length'];_0x3e501c<_0x1dcd23&&_[_0xf8e3('0x65')](_0x5d2ecf['internal']);_0x3e501c++){if(_0x232d83[_0xf8e3('0x66')]<=_0x18a810[_0x3e501c]['from']){_0x5d2ecf[_0xf8e3('0x64')]=_0x18a810[_0x3e501c][_0xf8e3('0x6a')];}else if(_0x232d83[_0xf8e3('0x66')]>_0x18a810[_0x3e501c][_0xf8e3('0x6a')]&&_0x232d83[_0xf8e3('0x66')]<=_0x18a810[_0x3e501c]['to']){_0x5d2ecf['internal']=_0x232d83[_0xf8e3('0x66')];}}}if(_[_0xf8e3('0x65')](_0x5d2ecf[_0xf8e3('0x64')])){_0x5d2ecf[_0xf8e3('0x64')]=_0x3c214f+0x1;}return _0x217979(_0x5d2ecf);});});})[_0xf8e3('0x20')](function(_0x3852d1){_0x1cad38(_0x3852d1);});});}function updateUser(_0x459562){return new BPromise(function(_0x2ccd34,_0x3ddc19){try{if(_0x459562[_0xf8e3('0x6b')]){_0x459562[_0xf8e3('0x6c')]=_0x459562[_0xf8e3('0x64')];_0x459562['VoiceMail']={'mailbox':_0x459562[_0xf8e3('0x64')],'password':_0x459562[_0xf8e3('0x41')],'fullname':_0x459562[_0xf8e3('0x6d')],'email':_0x459562['email']};}if(_0x459562[_0xf8e3('0x2e')]===_0xf8e3('0x32')){if(!_0x459562[_0xf8e3('0x6e')])_0x459562[_0xf8e3('0x6e')]=[_0xf8e3('0x6f'),_0xf8e3('0x70'),_0xf8e3('0x71'),_0xf8e3('0x72'),_0xf8e3('0x73'),_0xf8e3('0x74'),_0xf8e3('0x75'),_0xf8e3('0x76'),'107',_0xf8e3('0x77'),_0xf8e3('0x78'),_0xf8e3('0x79'),_0xf8e3('0x7a'),'114','115'];}_0x2ccd34(_0x459562);}catch(_0x11aa1d){_0x3ddc19(_0x11aa1d);}});}exports[_0xf8e3('0x7b')]=function(_0x4c8707,_0x5bedc7){if(_0x4c8707[_0xf8e3('0x7c')][_0xf8e3('0x2e')]==='agent')throw new Error(_0xf8e3('0x7d'));if(_0x4c8707[_0xf8e3('0x5a')][_0xf8e3('0x2e')]===_0xf8e3('0x7c')&&_0x4c8707[_0xf8e3('0x7c')]['role']!==_0xf8e3('0x2f')){throw new Error(_0xf8e3('0x7e'));}if(_0x4c8707['body']['role']===_0xf8e3('0x2f')&&_0x4c8707[_0xf8e3('0x7c')][_0xf8e3('0x2e')]!==_0xf8e3('0x2f')){throw new Error(_0xf8e3('0x7f'));}return licenseUtil[_0xf8e3('0x80')]([_0x4c8707[_0xf8e3('0x5a')]])[_0xf8e3('0x15')](function(){return validateUser(_0x4c8707['body']);})[_0xf8e3('0x15')](function(_0x2c9a8e){return updateUser(_0x2c9a8e)[_0xf8e3('0x15')](function(_0x16f087){if(_0x16f087[_0xf8e3('0x2e')]===_0xf8e3('0x2f')){_0x16f087['settingsEnabled']=_0x4c8707[_0xf8e3('0x7c')][_0xf8e3('0x81')];delete _0x16f087[_0xf8e3('0x82')];}return _0x16f087;});})['then'](function(_0x47a748){return db[_0xf8e3('0x3d')][_0xf8e3('0x7b')](_0x47a748,{'include':[{'model':db[_0xf8e3('0x83')],'as':_0xf8e3('0x83')}]});})[_0xf8e3('0x15')](function(_0x5b8840){if(_0x4c8707[_0xf8e3('0x5a')][_0xf8e3('0x2e')]===_0xf8e3('0x7c'))return _0x5b8840;if(_0x4c8707[_0xf8e3('0x7c')][_0xf8e3('0x2e')]!==_0xf8e3('0x7c'))return _0x5b8840;return db[_0xf8e3('0x84')][_0xf8e3('0x37')]({'where':{'name':_0x5b8840[_0xf8e3('0x2e')]==='agent'?_0xf8e3('0x31'):_0xf8e3('0x85'),'userProfileId':_0x4c8707[_0xf8e3('0x7c')][_0xf8e3('0x82')]},'raw':!![]})[_0xf8e3('0x15')](function(_0xb2f16e){if(!_0xb2f16e||_0xb2f16e[_0xf8e3('0x86')]!=0x0)return _0x5b8840;return db['UserProfileResource']['create']({'name':_0x5b8840[_0xf8e3('0x38')],'resourceId':_0x5b8840['id'],'type':_0xb2f16e[_0xf8e3('0x38')],'sectionId':_0xb2f16e['id']},{})['then'](function(){return _0x5b8840;});})[_0xf8e3('0x20')](function(_0x2412f9){logger[_0xf8e3('0x1b')](_0xf8e3('0x87'),_0x2412f9);throw _0x2412f9;});})[_0xf8e3('0x15')](respondWithResult(_0x5bedc7,0xc9))[_0xf8e3('0x20')](handleError(_0x5bedc7,null));};exports[_0xf8e3('0x88')]=function(_0x4b5a1f,_0xddfaee){var _0x2121f3=_0x4b5a1f[_0xf8e3('0x5a')];var _0xc8c987=[];if(_0x4b5a1f[_0xf8e3('0x7c')][_0xf8e3('0x2e')]===_0xf8e3('0x32'))throw new Error(_0xf8e3('0x7d'));if(_[_0xf8e3('0x89')](_0x2121f3,[_0xf8e3('0x2e'),_0xf8e3('0x7c')])&&_0x4b5a1f['user']['role']!==_0xf8e3('0x2f')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xf8e3('0x89')](_0x2121f3,['role',_0xf8e3('0x2f')])&&_0x4b5a1f[_0xf8e3('0x7c')][_0xf8e3('0x2e')]!=='admin'){throw new Error(_0xf8e3('0x8a'));}return licenseUtil[_0xf8e3('0x80')](_0x2121f3)[_0xf8e3('0x15')](function(){return validateUser(_0x2121f3[0x0]);})[_0xf8e3('0x15')](function(){for(var _0x3619cd=0x1;_0x3619cd<_0x2121f3['length'];_0x3619cd++){var _0xec1ff5=_0x2121f3[_0x3619cd-0x1]['internal'];if(!_0x2121f3[_0x3619cd][_0xf8e3('0x64')])_0x2121f3[_0x3619cd][_0xf8e3('0x64')]=_0xec1ff5+0x1;_0xc8c987[_0xf8e3('0x47')](validateUser(_0x2121f3[_0x3619cd]));}return BPromise[_0xf8e3('0x8b')](_0xc8c987);})[_0xf8e3('0x15')](function(){_0xc8c987=[];for(var _0x3243b5=0x0;_0x3243b5<_0x2121f3[_0xf8e3('0x4a')];_0x3243b5++){_0xc8c987['push'](updateUser(_0x2121f3[_0x3243b5]));}return BPromise[_0xf8e3('0x8b')](_0xc8c987);})[_0xf8e3('0x15')](function(){return BPromise[_0xf8e3('0x8c')](_0x2121f3,function(_0x1a9ba6){return db['User'][_0xf8e3('0x7b')](_0x1a9ba6,{'include':[{'model':db[_0xf8e3('0x83')],'as':_0xf8e3('0x83')}]})[_0xf8e3('0x15')](function(_0x22fa2f){_0x1a9ba6['id']=_0x22fa2f['id'];return _0x1a9ba6;});});})[_0xf8e3('0x15')](function(_0x477589){if(_0x4b5a1f[_0xf8e3('0x5a')]['role']==='user')return _0x477589;if(_0x4b5a1f[_0xf8e3('0x7c')][_0xf8e3('0x2e')]!==_0xf8e3('0x7c'))return _0x477589;var _0x161347=_[_0xf8e3('0x89')](_0x477589,function(_0x12bc5b){return _0x12bc5b[_0xf8e3('0x2e')]==='agent'||_0x12bc5b[_0xf8e3('0x2e')]==='telephone';});if(!_0x161347)return _0x477589;return db[_0xf8e3('0x84')][_0xf8e3('0x48')]({'where':{'name':{'$or':[_0xf8e3('0x31'),_0xf8e3('0x85')]},'userProfileId':_0x4b5a1f['user'][_0xf8e3('0x82')]},'raw':!![]})['then'](function(_0x567d66){if(_[_0xf8e3('0x8d')](_0x567d66)||!_[_0xf8e3('0x89')](_0x567d66,[_0xf8e3('0x86'),0x0]))return _0x477589;_0xc8c987=[];var _0x2db4e4=_(_0x567d66)['map'](function(_0x4e7821){if(_0x4e7821[_0xf8e3('0x86')]===0x1)return;return _0x4e7821[_0xf8e3('0x38')]==='Agents'?'agent':_0xf8e3('0x8e');})[_0xf8e3('0x8f')]()['value']();for(var _0x1844da=0x0;_0x1844da<_0x477589[_0xf8e3('0x4a')];_0x1844da++){if(!_[_0xf8e3('0x36')](_0x2db4e4,_0x477589[_0x1844da][_0xf8e3('0x2e')]))return;var _0x1bae38=_0x477589[_0x1844da][_0xf8e3('0x2e')]===_0xf8e3('0x32')?'Agents':_0xf8e3('0x85');_0xc8c987[_0xf8e3('0x47')](db['UserProfileResource'][_0xf8e3('0x7b')]({'name':_0x477589[_0x1844da]['name'],'resourceId':_0x477589[_0x1844da]['id'],'type':_0x1bae38,'sectionId':_[_0xf8e3('0x37')](_0x567d66,[_0xf8e3('0x38'),_0x1bae38])['id']},{}));}return BPromise[_0xf8e3('0x8b')](_0xc8c987);});})['then'](respondWithResult(_0xddfaee,0xc9))[_0xf8e3('0x20')](handleError(_0xddfaee,null));};exports['changePassword']=function(_0x153c80,_0x41ca1b){if(_0x153c80[_0xf8e3('0x5a')]['id']){delete _0x153c80[_0xf8e3('0x5a')]['id'];}return db['User']['find']({'where':{'id':_0x153c80[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x15')](function(_0x268855){if(!_0x268855)return null;if(_0x268855['id']===_0x153c80[_0xf8e3('0x7c')]['id']){if(!_0x153c80[_0xf8e3('0x5a')][_0xf8e3('0x90')]||!_0x153c80['body'][_0xf8e3('0x91')]){throw new db[(_0xf8e3('0x92'))][(_0xf8e3('0x93'))](_0xf8e3('0x94'));}if(!_0x268855['authenticate'](_0x153c80[_0xf8e3('0x5a')]['oldPassword'])){throw new db[(_0xf8e3('0x92'))][(_0xf8e3('0x93'))]('Wrong\x20credentials');}if(_0x153c80[_0xf8e3('0x5a')]['oldPassword']===_0x153c80[_0xf8e3('0x5a')][_0xf8e3('0x91')]){throw new db['Sequelize'][(_0xf8e3('0x93'))](_0xf8e3('0x95'));}}else if(_0x153c80['user'][_0xf8e3('0x2e')]===_0xf8e3('0x2f')){if(!_0x153c80[_0xf8e3('0x5a')][_0xf8e3('0x91')]){throw new db[(_0xf8e3('0x92'))][(_0xf8e3('0x93'))](_0xf8e3('0x96'));}}else if(_0x153c80[_0xf8e3('0x7c')][_0xf8e3('0x2e')]===_0xf8e3('0x7c')){if(!_0x153c80[_0xf8e3('0x5a')][_0xf8e3('0x91')]){throw new db['Sequelize'][(_0xf8e3('0x93'))](_0xf8e3('0x96'));}if(_0x268855[_0xf8e3('0x2e')]!=='agent'){throw new db[(_0xf8e3('0x92'))][(_0xf8e3('0x93'))](_0xf8e3('0x7d'));}}else{throw new db[(_0xf8e3('0x92'))][(_0xf8e3('0x93'))](_0xf8e3('0x7d'));}return _0x268855;})[_0xf8e3('0x15')](handleEntityNotFound(_0x41ca1b,null))['then'](function(_0x513b90){return db[_0xf8e3('0x5f')][_0xf8e3('0x97')]({'attributes':['id','securePassword',_0xf8e3('0x98'),_0xf8e3('0x99')]})['then'](function(_0x45919d){if(_0x45919d[_0xf8e3('0x61')])authService[_0xf8e3('0x62')](_0x153c80[_0xf8e3('0x5a')][_0xf8e3('0x91')]);if(!_0x45919d['enforcePasswordHistory']||!_0x513b90[_0xf8e3('0x9a')])return _0x513b90;authService[_0xf8e3('0x9b')](_0x153c80['body'][_0xf8e3('0x91')],_0x513b90[_0xf8e3('0x9a')],_0x45919d[_0xf8e3('0x99')]);return _0x513b90;})[_0xf8e3('0x15')](saveUpdates({'password':_0x153c80[_0xf8e3('0x5a')][_0xf8e3('0x91')],'passwordResetAt':_0x153c80[_0xf8e3('0x7c')]['id']==_0x153c80['params']['id']?moment():null,'previousPasswords':authService[_0xf8e3('0x9c')](_0x153c80[_0xf8e3('0x5a')]['newPassword'],_0x513b90['previousPasswords'])},null));})['then'](respondWithResult(_0x41ca1b,null))[_0xf8e3('0x20')](handleError(_0x41ca1b,null));};exports[_0xf8e3('0x9d')]=function(_0x417af2,_0x29f5d0){var _0x4622b1=_0x417af2[_0xf8e3('0x5a')][_0xf8e3('0x9e')];return db['User']['find']({'where':{'id':_0x417af2[_0xf8e3('0x50')]['id']},'attributes':['id','name','role',_0xf8e3('0x9f'),_0xf8e3('0xa0'),'voicePause',_0xf8e3('0xa1')]})[_0xf8e3('0x15')](handleEntityNotFound(_0x29f5d0,null))[_0xf8e3('0x15')](function(_0x2c4060){if(_0x2c4060){if(!utils[_0xf8e3('0xa2')](_0x4622b1)){throw new db[(_0xf8e3('0x92'))][(_0xf8e3('0x93'))](_0xf8e3('0xa3'));}return _0x2c4060[_0xf8e3('0xa4')+_[_0xf8e3('0xa5')](_0x4622b1[_0xf8e3('0xa6')]())+_0xf8e3('0xa7')](_0x417af2[_0xf8e3('0x5a')][_0xf8e3('0x5d')],{'penalty':_0x417af2[_0xf8e3('0x5a')]['penalty']||0x0})[_0xf8e3('0xa8')](function(_0x3de54e){for(var _0x4cb7c0=0x0;_0x4cb7c0<_0x417af2[_0xf8e3('0x5a')]['ids']['length'];_0x4cb7c0+=0x1){var _0x5a66ee={'UserId':Number(_0x417af2[_0xf8e3('0x50')]['id'])};_0x5a66ee[_[_0xf8e3('0xa5')](_0x4622b1['toLowerCase']())+_0xf8e3('0xa9')]=Number(_0x417af2[_0xf8e3('0x5a')][_0xf8e3('0x5d')][_0x4cb7c0]);socket['emit'](_0xf8e3('0x7c')+_[_0xf8e3('0xa5')](_0x4622b1[_0xf8e3('0xa6')]())+'Queue:save',_0x5a66ee);}return _0x3de54e;})[_0xf8e3('0x15')](function(){if(_0x4622b1===_0xf8e3('0xaa')){return db[_0xf8e3('0xab')]['findAll']({'where':{'id':_0x417af2[_0xf8e3('0x5a')][_0xf8e3('0x5d')]||[]},'raw':!![],'attributes':['id',_0xf8e3('0x38')]});}})[_0xf8e3('0x15')](function(_0x239890){var _0x446bf8=_0x2c4060['get']({'plain':!![]});var _0x14b346=[];if(_0x4622b1===_0xf8e3('0xaa')&&_0x446bf8['role']===_0xf8e3('0x32')&&_0x446bf8[_0xf8e3('0x9f')]){for(var _0xcf534f=0x0;_0xcf534f<_0x239890[_0xf8e3('0x4a')];_0xcf534f+=0x1){_0x14b346['push']({'membername':_0x446bf8[_0xf8e3('0x38')],'UserId':_0x446bf8['id'],'queue_name':_0x239890[_0xcf534f]['name'],'VoiceQueueId':_0x239890[_0xcf534f]['id'],'interface':_[_0xf8e3('0x65')](_0x446bf8['interface'])?util[_0xf8e3('0xac')](_0xf8e3('0xad'),_0x446bf8['name']):_0x446bf8[_0xf8e3('0xa1')],'paused':_0x446bf8[_0xf8e3('0xae')]||![],'penalty':_0x417af2[_0xf8e3('0x5a')][_0xf8e3('0xaf')]||0x0});}return BPromise[_0xf8e3('0x8c')](_0x14b346,function(_0x1b02c8){return db[_0xf8e3('0xb0')][_0xf8e3('0xb1')](_0x1b02c8);});}return _0x2c4060;});}})[_0xf8e3('0x15')](respondWithStatusCode(_0x29f5d0,null))[_0xf8e3('0x20')](handleError(_0x29f5d0,null));};exports[_0xf8e3('0xb2')]=function(_0xba6c1a,_0x4508d2){var _0x430f5b;return db[_0xf8e3('0x3d')][_0xf8e3('0x37')]({'where':{'id':_0xba6c1a['params']['id']},'attributes':['id',_0xf8e3('0x38'),'role']})[_0xf8e3('0x15')](handleEntityNotFound(_0x4508d2,null))[_0xf8e3('0x15')](function(_0x50b249){if(_0x50b249){_0x430f5b=_0x50b249;if(!_0xba6c1a[_0xf8e3('0x43')]['channel']||!utils[_0xf8e3('0xa2')](_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x9e')])){throw new db[(_0xf8e3('0x92'))]['ValidationError'](_0xf8e3('0xa3'));}return _0x50b249[_0xf8e3('0xb3')+_[_0xf8e3('0xa5')](_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x9e')][_0xf8e3('0xa6')]())+'Queues'](_0xba6c1a[_0xf8e3('0x43')]['ids']);}})['then'](function(_0x490b3c){if(_[_0xf8e3('0xb4')](_0xba6c1a['query']['ids'])){for(var _0x537cf0=0x0;_0x537cf0<_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x5d')][_0xf8e3('0x4a')];_0x537cf0+=0x1){var _0x5399b5={'UserId':Number(_0xba6c1a[_0xf8e3('0x50')]['id'])};_0x5399b5[_[_0xf8e3('0xa5')](_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x9e')][_0xf8e3('0xa6')]())+_0xf8e3('0xa9')]=Number(_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x5d')][_0x537cf0]);socket[_0xf8e3('0xb5')](_0xf8e3('0x7c')+_[_0xf8e3('0xa5')](_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x9e')][_0xf8e3('0xa6')]())+_0xf8e3('0xb6'),_0x5399b5);}}else{var _0x5399b5={'UserId':Number(_0xba6c1a[_0xf8e3('0x50')]['id'])};_0x5399b5[_[_0xf8e3('0xa5')](_0xba6c1a['query'][_0xf8e3('0x9e')]['toLowerCase']())+_0xf8e3('0xa9')]=Number(_0xba6c1a[_0xf8e3('0x43')]['ids']);socket[_0xf8e3('0xb5')]('user'+_[_0xf8e3('0xa5')](_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x9e')][_0xf8e3('0xa6')]())+_0xf8e3('0xb6'),_0x5399b5);}return _0x490b3c;})[_0xf8e3('0x15')](function(){if(_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x9e')]===_0xf8e3('0xaa')){return db[_0xf8e3('0xb0')][_0xf8e3('0x2c')]({'where':{'UserId':_0xba6c1a[_0xf8e3('0x50')]['id'],'VoiceQueueId':_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x5d')]},'individualHooks':!![]})[_0xf8e3('0x15')](function(){return _0x430f5b;});}return _0x430f5b;})[_0xf8e3('0x15')](respondWithStatusCode(_0x4508d2,null))[_0xf8e3('0x20')](handleError(_0x4508d2,null));};exports['addAvatar']=function(_0x463566,_0x37d5c9){_0x463566[_0xf8e3('0x5a')][_0xf8e3('0xb7')]=_0x463566[_0xf8e3('0xb8')][_0xf8e3('0xb9')];return db[_0xf8e3('0x3d')][_0xf8e3('0x37')]({'where':{'id':_0x463566[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x15')](handleEntityNotFound(_0x37d5c9,null))[_0xf8e3('0x15')](saveUpdates(_0x463566[_0xf8e3('0x5a')],null))[_0xf8e3('0x15')](respondWithResult(_0x37d5c9,null))[_0xf8e3('0x20')](handleError(_0x37d5c9,null));};exports[_0xf8e3('0xba')]=function(_0x3cf809,_0x4d2cdb){var _0x3f4924=path[_0xf8e3('0xbb')](config['root'],_0xf8e3('0xbc'));return db[_0xf8e3('0x3d')][_0xf8e3('0x37')]({'where':{'id':_0x3cf809['params']['id']},'attributes':['id','userpic'],'raw':!![]})[_0xf8e3('0x15')](handleEntityNotFound(_0x4d2cdb,null))['then'](function(_0x445091){if(_0x445091){if(_['isNil'](_0x445091['userpic'])){return _0x4d2cdb[_0xf8e3('0xbd')](_0x3f4924);}else{if(!fs['existsSync'](path[_0xf8e3('0xbb')](config[_0xf8e3('0xbe')],'server/files/images/',_0x445091['userpic']))){return _0x4d2cdb[_0xf8e3('0xbd')](_0x3f4924);}return _0x4d2cdb['download'](path[_0xf8e3('0xbb')](config[_0xf8e3('0xbe')],_0xf8e3('0xbf'),_0x445091['userpic']));}}})[_0xf8e3('0x20')](handleError(_0x4d2cdb,null));};exports[_0xf8e3('0xc0')]=function(_0x33cf45,_0xfd0019){return db[_0xf8e3('0x3d')][_0xf8e3('0x37')]({'where':{'id':_0x33cf45[_0xf8e3('0x50')]['id']},'attributes':['id']})[_0xf8e3('0x15')](handleEntityNotFound(_0xfd0019,null))[_0xf8e3('0x15')](function(_0xe70da7){var _0x3bffa9=[];values=_0xe70da7[_0xf8e3('0x4c')];_0x3bffa9[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x4b'),_0xe70da7['dataValues']));_0x3bffa9['push'](get_open_tabs(_0xf8e3('0xc1'),_0xe70da7['dataValues']));_0x3bffa9[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x4e'),_0xe70da7['dataValues']));_0x3bffa9[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0xc2'),_0xe70da7[_0xf8e3('0x4c')]));_0x3bffa9[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x4d'),_0xe70da7[_0xf8e3('0x4c')]));_0x3bffa9[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x59'),_0xe70da7[_0xf8e3('0x4c')]));return BPromise['all'](_0x3bffa9);})[_0xf8e3('0x15')](function(_0x3996fe){var _0x5e026c=[];if(_0x3996fe){for(var _0x15fa6f=0x0;_0x15fa6f=_0x34d035['agents']){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x4d97('0xf')](function(){if(_0x4d289f){return db[_0x4d97('0x2a')]['destroy']({'where':{'membername':_0x4d289f[_0x4d97('0x26')]},'individualHooks':!![]});}})[_0x4d97('0xf')](function(){if(_0x4d289f){return _0x4d289f[_0x4d97('0x50')]({'raw':!![]});}})[_0x4d97('0xf')](function(_0x4064d8){if(_0x4d289f){if(_0x4064d8){var _0x4c8e7d=[];_0x482eda=_0x4064d8;if(_0x482eda[_0x4d97('0x2e')]){for(var _0x1f7ed4=0x0;_0x1f7ed4<_0x482eda[_0x4d97('0x2e')];_0x1f7ed4++){_0x4c8e7d[_0x4d97('0x33')](db[_0x4d97('0x2a')][_0x4d97('0x51')]({'membername':_0x4d289f['name'],'UserId':_0x4d289f['id'],'queue_name':_0x482eda[_0x1f7ed4][_0x4d97('0x26')],'VoiceQueueId':_0x482eda[_0x1f7ed4]['id'],'interface':_0x41eeaa,'paused':_0x4d289f['loginInPause']||![],'penalty':_0x482eda[_0x1f7ed4][_0x4d97('0x52')]||0x0}));}return BPromise[_0x4d97('0x45')](_0x4c8e7d);}}}})[_0x4d97('0xf')](function(){if(_0x4d289f){return db[_0x4d97('0x2c')][_0x4d97('0x1a')]({'where':{'membername':_0x4d289f[_0x4d97('0x26')],'exitAt':null}});}})[_0x4d97('0xf')](function(_0x345340){if(_0x4d289f){if(_0x345340&&_0x345340['length']){var _0x3a44cb=[];_0x345340['forEach'](function(_0x8600a4){_0x3a44cb['push'](_0x8600a4['update']({'exitAt':moment()['format'](_0x4d97('0x30'))}));});return BPromise[_0x4d97('0x45')](_0x3a44cb);}}})['then'](function(_0xaa8250){if(_0x4d289f){var _0x3967a7=[];var _0x2624b3=[];var _0x4dd33b=utils[_0x4d97('0x53')]();var _0x2e102d={'membername':_0x4d289f[_0x4d97('0x26')],'interface':_0x41eeaa,'enterAt':moment()[_0x4d97('0x2f')](_0x4d97('0x30')),'role':_0x4d289f[_0x4d97('0x27')],'internal':_0x4d289f[_0x4d97('0x28')]};_0x4dd33b[_0x4d97('0x32')](function(_0x12a7fe){_0x3967a7['push'](_['merge']({'channel':_0x12a7fe,'type':_0x4d97('0x54'),'data1':'callysquare','data2':_0x41eeaa},_0x2e102d));if(_0x4d289f[_0x4d97('0x4b')]){_0x2624b3[_0x4d97('0x33')](_[_0x4d97('0x55')]({'channel':_0x12a7fe,'type':'PAUSE','data1':'LOGININPAUSE'},_0x2e102d));}});return db[_0x4d97('0x2c')][_0x4d97('0x38')](_0x3967a7['concat'](_0x2624b3),{'individualHooks':!![]});}})[_0x4d97('0xf')](function(){if(_0x4d289f){return _0x4d289f[_0x4d97('0x2b')]({'online':!![],'lastLoginAt':moment()[_0x4d97('0x2f')](_0x4d97('0x30')),'voicePause':_0x4d289f['loginInPause']||![],'mailPause':_0x4d289f['loginInPause']||![],'chatPause':_0x4d289f['loginInPause']||![],'faxPause':_0x4d289f[_0x4d97('0x4b')]||![],'smsPause':_0x4d289f[_0x4d97('0x4b')]||![],'openchannelPause':_0x4d289f['loginInPause']||![],'pauseType':_0x4d289f['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x4d97('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x41eeaa});}})['then'](function(_0x1b6993){_0x8892a4(_0x1b6993);})[_0x4d97('0x18')](function(_0x122ec4){_0x524f6f(_0x41d0be['error'](0x1f4,_0x122ec4[_0x4d97('0x17')]));});});}; \ No newline at end of file +var _0x6a52=['request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','GetUser','findAll','options','where','attributes','include','model','map','User','find','ShowUser','stringify','PauseUser','name','role','internal','interface','UserVoiceQueueRt','update','PAUSE','length','format','getChannels','forEach','push','SIP/%s','body','type','DEFAULT\x20PAUSE','uniqueid','MemberReport','YYYY-MM-DD\x20HH:mm:ss','UnpauseUser','channel','isValidChannel','Unknown\x20channel','voice','system','mail','fax','sms','openchannel','whatsapp','set','%s%s','Pause','all','LogoutUser','findOne','destroy','LoginUser','loginInPause','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','UserVoiceQueue.penalty','merge','LOGIN','callysquare','bulkCreate','concat','lodash','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./user.socket'];(function(_0xb4c7a5,_0x59af48){var _0x382caa=function(_0x45365d){while(--_0x45365d){_0xb4c7a5['push'](_0xb4c7a5['shift']());}};_0x382caa(++_0x59af48);}(_0x6a52,0x153));var _0x26a5=function(_0x5c2c7c,_0xa7d3b1){_0x5c2c7c=_0x5c2c7c-0x0;var _0xea7ffe=_0x6a52[_0x5c2c7c];return _0xea7ffe;};'use strict';var _=require(_0x26a5('0x0'));var util=require(_0x26a5('0x1'));var moment=require(_0x26a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x26a5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26a5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x26a5('0x5'));var config=require(_0x26a5('0x6'));var jayson=require(_0x26a5('0x7'));var client=jayson[_0x26a5('0x8')]['http']({'port':0x232a});config[_0x26a5('0x9')]=_['defaults'](config['redis'],{'host':_0x26a5('0xa'),'port':0x18eb});var socket=require(_0x26a5('0xb'))(new Redis(config[_0x26a5('0x9')]));require(_0x26a5('0xc'))['register'](socket);function respondWithRpcPromise(_0x581d4d,_0x4a5cd1,_0x258e5c){return new BPromise(function(_0xe210dc,_0x508556){return client[_0x26a5('0xd')](_0x581d4d,_0x258e5c)[_0x26a5('0xe')](function(_0xca789b){logger[_0x26a5('0xf')](_0x26a5('0x10'),_0x4a5cd1,_0x26a5('0x11'));logger[_0x26a5('0x12')]('User,\x20%s,\x20%s,\x20%s',_0x4a5cd1,_0x26a5('0x11'),JSON['stringify'](_0xca789b));if(_0xca789b[_0x26a5('0x13')]){if(_0xca789b[_0x26a5('0x13')][_0x26a5('0x14')]===0x1f4){logger[_0x26a5('0x13')](_0x26a5('0x10'),_0x4a5cd1,_0xca789b[_0x26a5('0x13')][_0x26a5('0x15')]);return _0x508556(_0xca789b['error'][_0x26a5('0x15')]);}logger[_0x26a5('0x13')](_0x26a5('0x10'),_0x4a5cd1,_0xca789b[_0x26a5('0x13')][_0x26a5('0x15')]);return _0xe210dc(_0xca789b[_0x26a5('0x13')][_0x26a5('0x15')]);}else{logger[_0x26a5('0xf')](_0x26a5('0x10'),_0x4a5cd1,_0x26a5('0x11'));_0xe210dc(_0xca789b['result']['message']);}})[_0x26a5('0x16')](function(_0x3f4018){logger[_0x26a5('0x13')](_0x26a5('0x10'),_0x4a5cd1,_0x3f4018);_0x508556(_0x3f4018);});});}exports[_0x26a5('0x17')]=function(_0x490e23){var _0x5351fb=this;return new Promise(function(_0x3a3d04,_0x182eab){return db['User'][_0x26a5('0x18')]({'raw':_0x490e23[_0x26a5('0x19')]?_0x490e23[_0x26a5('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x490e23[_0x26a5('0x19')]?_0x490e23[_0x26a5('0x19')][_0x26a5('0x1a')]||null:null,'attributes':_0x490e23[_0x26a5('0x19')]?_0x490e23[_0x26a5('0x19')][_0x26a5('0x1b')]||null:null,'limit':_0x490e23[_0x26a5('0x19')]?_0x490e23[_0x26a5('0x19')]['limit']||null:null,'include':_0x490e23['options']?_0x490e23[_0x26a5('0x19')]['include']?_['map'](_0x490e23['options'][_0x26a5('0x1c')],function(_0x4ff00e){return{'model':db[_0x4ff00e[_0x26a5('0x1d')]],'as':_0x4ff00e['as'],'attributes':_0x4ff00e[_0x26a5('0x1b')],'include':_0x4ff00e[_0x26a5('0x1c')]?_[_0x26a5('0x1e')](_0x4ff00e['include'],function(_0x36060f){return{'model':db[_0x36060f[_0x26a5('0x1d')]],'as':_0x36060f['as'],'attributes':_0x36060f[_0x26a5('0x1b')],'include':_0x36060f['include']?_[_0x26a5('0x1e')](_0x36060f['include'],function(_0x56d7c8){return{'model':db[_0x56d7c8['model']],'as':_0x56d7c8['as'],'attributes':_0x56d7c8['attributes']};}):[]};}):[]};}):[]:[]})[_0x26a5('0xe')](function(_0x23650a){logger[_0x26a5('0xf')](_0x26a5('0x17'),_0x490e23);logger['debug'](_0x26a5('0x17'),_0x490e23,JSON['stringify'](_0x23650a));_0x3a3d04(_0x23650a);})[_0x26a5('0x16')](function(_0xc3597){logger[_0x26a5('0x13')]('GetUser',_0xc3597[_0x26a5('0x15')],_0x490e23);_0x182eab(_0x5351fb['error'](0x1f4,_0xc3597[_0x26a5('0x15')]));});});};exports['ShowUser']=function(_0x180a4d){var _0x26ed0f=this;return new Promise(function(_0xabfe8a,_0x4d7ba4){return db[_0x26a5('0x1f')][_0x26a5('0x20')]({'raw':_0x180a4d['options']?_0x180a4d[_0x26a5('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x180a4d[_0x26a5('0x19')]?_0x180a4d[_0x26a5('0x19')][_0x26a5('0x1a')]||null:null,'attributes':_0x180a4d['options']?_0x180a4d[_0x26a5('0x19')][_0x26a5('0x1b')]||null:null,'include':_0x180a4d[_0x26a5('0x19')]?_0x180a4d[_0x26a5('0x19')][_0x26a5('0x1c')]?_[_0x26a5('0x1e')](_0x180a4d[_0x26a5('0x19')][_0x26a5('0x1c')],function(_0x517d05){return{'model':db[_0x517d05[_0x26a5('0x1d')]],'as':_0x517d05['as'],'attributes':_0x517d05['attributes'],'include':_0x517d05[_0x26a5('0x1c')]?_[_0x26a5('0x1e')](_0x517d05[_0x26a5('0x1c')],function(_0x5760b5){return{'model':db[_0x5760b5[_0x26a5('0x1d')]],'as':_0x5760b5['as'],'attributes':_0x5760b5[_0x26a5('0x1b')],'include':_0x5760b5[_0x26a5('0x1c')]?_[_0x26a5('0x1e')](_0x5760b5['include'],function(_0x1167d){return{'model':db[_0x1167d[_0x26a5('0x1d')]],'as':_0x1167d['as'],'attributes':_0x1167d[_0x26a5('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x26a5('0xe')](function(_0x46c570){logger[_0x26a5('0xf')](_0x26a5('0x21'),_0x180a4d);logger['debug'](_0x26a5('0x21'),_0x180a4d,JSON[_0x26a5('0x22')](_0x46c570));_0xabfe8a(_0x46c570);})[_0x26a5('0x16')](function(_0x5147d7){logger[_0x26a5('0x13')]('ShowUser',_0x5147d7[_0x26a5('0x15')],_0x180a4d);_0x4d7ba4(_0x26ed0f[_0x26a5('0x13')](0x1f4,_0x5147d7[_0x26a5('0x15')]));});});};exports[_0x26a5('0x23')]=function(_0x9271f6){var _0x55928e=this;return new Promise(function(_0x128007,_0x19521e){var _0x12fae9;return db['User'][_0x26a5('0x20')]({'where':_0x9271f6[_0x26a5('0x19')][_0x26a5('0x1a')]||{},'attributes':['id',_0x26a5('0x24'),_0x26a5('0x25'),_0x26a5('0x26'),_0x26a5('0x27')]})[_0x26a5('0xe')](function(_0x472522){if(_0x472522){_0x12fae9=_0x472522;return db[_0x26a5('0x28')][_0x26a5('0x29')]({'paused':0x1},{'where':{'UserId':_0x12fae9['id']},'individualHooks':!![]});}})['then'](function(){if(_0x12fae9){return db['MemberReport']['findAll']({'where':{'membername':_0x12fae9[_0x26a5('0x24')],'type':_0x26a5('0x2a'),'exitAt':null}});}})[_0x26a5('0xe')](function(_0x296143){if(_0x12fae9){if(_0x296143&&_0x296143[_0x26a5('0x2b')]){var _0x456a03=moment()[_0x26a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x49be1a=0x0,_0x314ce6=_0x296143['length'];_0x49be1a<_0x314ce6;_0x49be1a++){_0x296143[_0x49be1a]['updateAttributes']({'exitAt':_0x456a03});}}}})['then'](function(){if(_0x12fae9){var _0x5483da=[];var _0x3fa606=utils[_0x26a5('0x2d')]();_0x3fa606[_0x26a5('0x2e')](function(_0xfe884f){_0x5483da[_0x26a5('0x2f')]({'channel':_0xfe884f,'membername':_0x12fae9['name'],'interface':_['isNil'](_0x12fae9['interface'])?util[_0x26a5('0x2c')](_0x26a5('0x30'),_0x12fae9['name']):_0x12fae9[_0x26a5('0x27')],'type':_0x26a5('0x2a'),'enterAt':moment()[_0x26a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x9271f6[_0x26a5('0x31')][_0x26a5('0x32')]||_0x26a5('0x33'),'role':_0x12fae9[_0x26a5('0x25')],'internal':_0x12fae9['internal'],'uniqueid':_0x9271f6[_0x26a5('0x31')][_0x26a5('0x34')]||null});});return db[_0x26a5('0x35')]['bulkCreate'](_0x5483da,{'individualHooks':!![]});}})[_0x26a5('0xe')](function(){if(_0x12fae9){return _0x12fae9[_0x26a5('0x29')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x9271f6[_0x26a5('0x31')][_0x26a5('0x32')]||_0x26a5('0x33'),'lastPauseAt':moment()[_0x26a5('0x2c')](_0x26a5('0x36'))});}})[_0x26a5('0xe')](function(_0x5f4f62){_0x128007(_0x5f4f62);})[_0x26a5('0x16')](function(_0x193171){_0x19521e(_0x55928e['error'](0x1f4,_0x193171[_0x26a5('0x15')]));});});};exports[_0x26a5('0x37')]=function(_0x47afd0){var _0x33c251=this;return new Promise(function(_0x5cd5b1,_0x21e8bd){var _0x5dbb62;return db[_0x26a5('0x1f')]['findOne']({'where':_0x47afd0['options'][_0x26a5('0x1a')]||{},'attributes':['id',_0x26a5('0x24')]})[_0x26a5('0xe')](function(_0x10e071){if(_0x10e071){_0x5dbb62=_0x10e071;if(_0x47afd0[_0x26a5('0x31')][_0x26a5('0x38')]&&!utils[_0x26a5('0x39')](_0x47afd0[_0x26a5('0x31')][_0x26a5('0x38')])){throw new Error(_0x26a5('0x3a'));}switch(_0x47afd0[_0x26a5('0x31')][_0x26a5('0x38')]){case _0x26a5('0x3b'):return db[_0x26a5('0x28')][_0x26a5('0x29')]({'paused':0x0},{'where':{'UserId':_0x5dbb62['id']}})[_0x26a5('0xe')](function(){return db[_0x26a5('0x35')][_0x26a5('0x20')]({'where':{'channel':_0x47afd0[_0x26a5('0x31')][_0x26a5('0x38')],'membername':_0x5dbb62[_0x26a5('0x24')],'type':_0x26a5('0x2a'),'exitAt':null}});})[_0x26a5('0xe')](function(_0x6a85c5){if(_0x6a85c5){return _0x6a85c5[_0x26a5('0x29')]({'exitAt':moment()[_0x26a5('0x2c')](_0x26a5('0x36')),'data2':_0x26a5('0x3c')},{'individualHooks':!![]});}return null;})[_0x26a5('0xe')](function(){return _0x5dbb62[_0x26a5('0x29')]({'voicePause':![]});});case _0x26a5('0x3d'):case'chat':case _0x26a5('0x3e'):case _0x26a5('0x3f'):case _0x26a5('0x40'):case _0x26a5('0x41'):return db['MemberReport'][_0x26a5('0x20')]({'where':{'channel':_0x47afd0[_0x26a5('0x31')][_0x26a5('0x38')],'membername':_0x5dbb62[_0x26a5('0x24')],'type':_0x26a5('0x2a'),'exitAt':null}})[_0x26a5('0xe')](function(_0x204500){return _0x204500[_0x26a5('0x29')]({'exitAt':moment()[_0x26a5('0x2c')](_0x26a5('0x36')),'data2':_0x26a5('0x3c')},{'individualHooks':!![]});})['then'](function(){var _0x5a7837={};_[_0x26a5('0x42')](_0x5a7837,util[_0x26a5('0x2c')](_0x26a5('0x43'),_0x47afd0[_0x26a5('0x31')][_0x26a5('0x38')],_0x26a5('0x44')),![]);return _0x5dbb62[_0x26a5('0x29')](_0x5a7837);});default:return db[_0x26a5('0x28')][_0x26a5('0x29')]({'paused':0x0},{'where':{'UserId':_0x5dbb62['id']}})['then'](function(){return db[_0x26a5('0x35')][_0x26a5('0x18')]({'where':{'membername':_0x5dbb62['name'],'type':_0x26a5('0x2a'),'exitAt':null}});})['then'](function(_0x36070b){var _0x1254ef=[];_0x36070b[_0x26a5('0x2e')](function(_0x8762e0){_0x1254ef['push'](_0x8762e0[_0x26a5('0x29')]({'exitAt':moment()[_0x26a5('0x2c')](_0x26a5('0x36')),'data2':_0x26a5('0x3c')}));});return BPromise[_0x26a5('0x45')](_0x1254ef);})[_0x26a5('0xe')](function(){return _0x5dbb62[_0x26a5('0x29')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x26a5('0xe')](function(_0x10f878){_0x5cd5b1(_0x10f878);})[_0x26a5('0x16')](function(_0x2cf996){_0x21e8bd(_0x33c251[_0x26a5('0x13')](0x1f4,_0x2cf996[_0x26a5('0x15')]));});});};exports[_0x26a5('0x46')]=function(_0x23b895){var _0x365379=this;return new Promise(function(_0x201727,_0x21a8b7){var _0x507305;return db['User'][_0x26a5('0x47')]({'where':_0x23b895[_0x26a5('0x19')][_0x26a5('0x1a')]||{},'attributes':['id',_0x26a5('0x24')]})[_0x26a5('0xe')](function(_0x2b378d){if(_0x2b378d){_0x507305=_0x2b378d;return db[_0x26a5('0x28')][_0x26a5('0x48')]({'where':{'membername':_0x507305[_0x26a5('0x24')]},'individualHooks':!![]});}})[_0x26a5('0xe')](function(){if(_0x507305){return db[_0x26a5('0x35')][_0x26a5('0x18')]({'where':{'membername':_0x507305[_0x26a5('0x24')],'exitAt':null}});}})[_0x26a5('0xe')](function(_0x4f9e8e){if(_0x507305){if(_0x4f9e8e&&_0x4f9e8e[_0x26a5('0x2b')]){var _0x417dfa=[];_0x4f9e8e[_0x26a5('0x2e')](function(_0x1ce829){_0x417dfa[_0x26a5('0x2f')](_0x1ce829[_0x26a5('0x29')]({'exitAt':moment()[_0x26a5('0x2c')](_0x26a5('0x36'))}));});return BPromise[_0x26a5('0x45')](_0x417dfa);}}})[_0x26a5('0xe')](function(){if(_0x507305){return _0x507305['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x2d6210){_0x201727(_0x2d6210);})[_0x26a5('0x16')](function(_0xc09ab5){_0x21a8b7(_0x365379[_0x26a5('0x13')](0x1f4,_0xc09ab5[_0x26a5('0x15')]));});});};exports[_0x26a5('0x49')]=function(_0x241239){var _0x49d03d=this;return new Promise(function(_0xc5011d,_0x28c356){var _0x1239f8;var _0x2ce809;var _0x32c955;var _0x4468ab;return db[_0x26a5('0x1f')][_0x26a5('0x47')]({'where':_0x241239[_0x26a5('0x19')][_0x26a5('0x1a')]||{},'attributes':['id',_0x26a5('0x24'),_0x26a5('0x25'),'mobile','phone','internal',_0x26a5('0x4a'),'interface']})['then'](function(_0x555d78){if(_0x555d78){_0x1239f8=_0x555d78;_0x4468ab=_0x241239[_0x26a5('0x31')][_0x26a5('0x27')]?_0x241239[_0x26a5('0x31')]['interface']:util[_0x26a5('0x2c')]('SIP/%s',_0x1239f8[_0x26a5('0x24')]);return db['User'][_0x26a5('0x4b')]({'where':{'role':_0x26a5('0x4c'),'online':!![],'id':{'$ne':_0x1239f8['id']}}});}})['then'](function(_0x808cf0){if(_0x808cf0){_0x32c955=_0x808cf0;return require(_0x26a5('0x4d'))[_0x26a5('0x4e')]();}})[_0x26a5('0xe')](function(_0x1675ef){if(_0x1675ef&&_0x1675ef[_0x26a5('0x4f')]&&_0x32c955>=_0x1675ef[_0x26a5('0x4f')]){throw new Error(_0x26a5('0x50'));}})[_0x26a5('0xe')](function(){if(_0x1239f8){return db[_0x26a5('0x28')]['destroy']({'where':{'membername':_0x1239f8[_0x26a5('0x24')]},'individualHooks':!![]});}})[_0x26a5('0xe')](function(){if(_0x1239f8){return _0x1239f8[_0x26a5('0x51')]({'raw':!![]});}})['then'](function(_0xf0ea23){if(_0x1239f8){if(_0xf0ea23){var _0x106760=[];_0x2ce809=_0xf0ea23;if(_0x2ce809[_0x26a5('0x2b')]){for(var _0x542dcb=0x0;_0x542dcb<_0x2ce809['length'];_0x542dcb++){_0x106760[_0x26a5('0x2f')](db[_0x26a5('0x28')]['upsert']({'membername':_0x1239f8[_0x26a5('0x24')],'UserId':_0x1239f8['id'],'queue_name':_0x2ce809[_0x542dcb][_0x26a5('0x24')],'VoiceQueueId':_0x2ce809[_0x542dcb]['id'],'interface':_0x4468ab,'paused':_0x1239f8[_0x26a5('0x4a')]||![],'penalty':_0x2ce809[_0x542dcb][_0x26a5('0x52')]||0x0}));}return BPromise[_0x26a5('0x45')](_0x106760);}}}})[_0x26a5('0xe')](function(){if(_0x1239f8){return db[_0x26a5('0x35')]['findAll']({'where':{'membername':_0x1239f8[_0x26a5('0x24')],'exitAt':null}});}})[_0x26a5('0xe')](function(_0x5dbb0c){if(_0x1239f8){if(_0x5dbb0c&&_0x5dbb0c['length']){var _0x1a3df6=[];_0x5dbb0c['forEach'](function(_0x20fcbd){_0x1a3df6[_0x26a5('0x2f')](_0x20fcbd[_0x26a5('0x29')]({'exitAt':moment()[_0x26a5('0x2c')](_0x26a5('0x36'))}));});return BPromise[_0x26a5('0x45')](_0x1a3df6);}}})[_0x26a5('0xe')](function(_0x4bdf5e){if(_0x1239f8){var _0x31bb3f=[];var _0x39dcca=[];var _0x4d0433=utils['getChannels']();var _0xf9d80d={'membername':_0x1239f8[_0x26a5('0x24')],'interface':_0x4468ab,'enterAt':moment()['format'](_0x26a5('0x36')),'role':_0x1239f8[_0x26a5('0x25')],'internal':_0x1239f8[_0x26a5('0x26')]};_0x4d0433[_0x26a5('0x2e')](function(_0x540755){_0x31bb3f[_0x26a5('0x2f')](_[_0x26a5('0x53')]({'channel':_0x540755,'type':_0x26a5('0x54'),'data1':_0x26a5('0x55'),'data2':_0x4468ab},_0xf9d80d));if(_0x1239f8[_0x26a5('0x4a')]){_0x39dcca[_0x26a5('0x2f')](_[_0x26a5('0x53')]({'channel':_0x540755,'type':_0x26a5('0x2a'),'data1':'LOGININPAUSE'},_0xf9d80d));}});return db[_0x26a5('0x35')][_0x26a5('0x56')](_0x31bb3f[_0x26a5('0x57')](_0x39dcca),{'individualHooks':!![]});}})[_0x26a5('0xe')](function(){if(_0x1239f8){return _0x1239f8['update']({'online':!![],'lastLoginAt':moment()[_0x26a5('0x2c')](_0x26a5('0x36')),'voicePause':_0x1239f8[_0x26a5('0x4a')]||![],'mailPause':_0x1239f8[_0x26a5('0x4a')]||![],'chatPause':_0x1239f8[_0x26a5('0x4a')]||![],'faxPause':_0x1239f8[_0x26a5('0x4a')]||![],'smsPause':_0x1239f8['loginInPause']||![],'openchannelPause':_0x1239f8[_0x26a5('0x4a')]||![],'pauseType':_0x1239f8['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x26a5('0x2c')](_0x26a5('0x36')),'interface':_0x4468ab});}})[_0x26a5('0xe')](function(_0x3c091f){_0xc5011d(_0x3c091f);})[_0x26a5('0x16')](function(_0x5b2ebd){_0x28c356(_0x49d03d['error'](0x1f4,_0x5b2ebd['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 297316e..8b58ee2 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 _0x26e7=['length','./user.events','save','update','emit','removeListener','register'];(function(_0x2da3f5,_0x5c79a7){var _0x1c9291=function(_0x3bc6a2){while(--_0x3bc6a2){_0x2da3f5['push'](_0x2da3f5['shift']());}};_0x1c9291(++_0x5c79a7);}(_0x26e7,0xe8));var _0x726e=function(_0x54e333,_0x4ba478){_0x54e333=_0x54e333-0x0;var _0x47279e=_0x26e7[_0x54e333];return _0x47279e;};'use strict';var UserEvents=require(_0x726e('0x0'));var events=[_0x726e('0x1'),'remove',_0x726e('0x2')];function createListener(_0x2db69d,_0x2fbfe6){return function(_0x20c6f5){_0x2fbfe6[_0x726e('0x3')](_0x2db69d,_0x20c6f5);};}function removeListener(_0x3a2a9d,_0x11d20f){return function(){UserEvents[_0x726e('0x4')](_0x3a2a9d,_0x11d20f);};}exports[_0x726e('0x5')]=function(_0xc5f3d2){for(var _0x4e0a14=0x0,_0x2e6442=events[_0x726e('0x6')];_0x4e0a14<_0x2e6442;_0x4e0a14++){var _0x50b61e=events[_0x4e0a14];var _0x1aa44a=createListener('user:'+_0x50b61e,_0xc5f3d2);UserEvents['on'](_0x50b61e,_0x1aa44a);}}; \ No newline at end of file +var _0x297a=['remove','removeListener','register','./user.events','save'];(function(_0x18a71e,_0x1887ec){var _0x6a2ef7=function(_0x195001){while(--_0x195001){_0x18a71e['push'](_0x18a71e['shift']());}};_0x6a2ef7(++_0x1887ec);}(_0x297a,0x17a));var _0xa297=function(_0x57202e,_0x51c81f){_0x57202e=_0x57202e-0x0;var _0x3dc668=_0x297a[_0x57202e];return _0x3dc668;};'use strict';var UserEvents=require(_0xa297('0x0'));var events=[_0xa297('0x1'),_0xa297('0x2'),'update'];function createListener(_0x42f673,_0xd12bf3){return function(_0x22dd1a){_0xd12bf3['emit'](_0x42f673,_0x22dd1a);};}function removeListener(_0x3ba76b,_0x1562df){return function(){UserEvents[_0xa297('0x3')](_0x3ba76b,_0x1562df);};}exports[_0xa297('0x4')]=function(_0x4d6cbf){for(var _0x5a2fd7=0x0,_0x198431=events['length'];_0x5a2fd7<_0x198431;_0x5a2fd7++){var _0x40b9dd=events[_0x5a2fd7];var _0x1b0da9=createListener('user:'+_0x40b9dd,_0x4d6cbf);UserEvents['on'](_0x40b9dd,_0x1b0da9);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 2aefaf9..c143092 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xbc9917,_0x479324){var _0x20ab5a=function(_0x43951d){while(--_0x43951d){_0xbc9917['push'](_0xbc9917['shift']());}};_0x20ab5a(++_0x479324);}(_0x9c44,0x178));var _0x49c4=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9c44[_0x160c73];return _0xd9302;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2e6458,_0x57d896){var _0x205b8c=function(_0x5b1186){while(--_0x5b1186){_0x2e6458['push'](_0x2e6458['shift']());}};_0x205b8c(++_0x57d896);}(_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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 987e23c..dfe6531 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 _0xd943=['sequelize','exports','INTEGER'];(function(_0x16d951,_0x5ae7bf){var _0x1f2b65=function(_0x345359){while(--_0x345359){_0x16d951['push'](_0x16d951['shift']());}};_0x1f2b65(++_0x5ae7bf);}(_0xd943,0x114));var _0x3d94=function(_0x4e1e56,_0x2cfa36){_0x4e1e56=_0x4e1e56-0x0;var _0x9c4f7=_0xd943[_0x4e1e56];return _0x9c4f7;};'use strict';var Sequelize=require(_0x3d94('0x0'));module[_0x3d94('0x1')]={'penalty':{'type':Sequelize[_0x3d94('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x196e=['sequelize','exports','INTEGER'];(function(_0x3eb307,_0x311906){var _0x378017=function(_0x517c52){while(--_0x517c52){_0x3eb307['push'](_0x3eb307['shift']());}};_0x378017(++_0x311906);}(_0x196e,0xcc));var _0xe196=function(_0x5eaa0b,_0x433b2f){_0x5eaa0b=_0x5eaa0b-0x0;var _0x28b295=_0x196e[_0x5eaa0b];return _0x28b295;};'use strict';var Sequelize=require(_0xe196('0x0'));module[_0xe196('0x1')]={'penalty':{'type':Sequelize[_0xe196('0x2')],'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 4d802ac..c7e6635 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 _0xbf42=['moment','bluebird','path','rimraf','../../config/environment','exports','define','UserChatQueue','user_has_chat_queues','lodash'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xbf42,0x81));var _0x2bf4=function(_0x361d3f,_0x3be2aa){_0x361d3f=_0x361d3f-0x0;var _0x320229=_0xbf42[_0x361d3f];return _0x320229;};'use strict';var _=require(_0x2bf4('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x2bf4('0x1'));var BPromise=require(_0x2bf4('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2bf4('0x3'));var rimraf=require(_0x2bf4('0x4'));var config=require(_0x2bf4('0x5'));var attributes=require('./userChatQueue.attributes');module[_0x2bf4('0x6')]=function(_0x286c8b,_0x256dab){return _0x286c8b[_0x2bf4('0x7')](_0x2bf4('0x8'),attributes,{'tableName':_0x2bf4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb2fa=['bluebird','request-promise','rimraf','../../config/environment','./userChatQueue.attributes','UserChatQueue','lodash','util','../../config/logger','moment'];(function(_0x519756,_0x288785){var _0x37047e=function(_0x3d64a7){while(--_0x3d64a7){_0x519756['push'](_0x519756['shift']());}};_0x37047e(++_0x288785);}(_0xb2fa,0x132));var _0xab2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb2fa[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xab2f('0x0'));var util=require(_0xab2f('0x1'));var logger=require(_0xab2f('0x2'))('api');var moment=require(_0xab2f('0x3'));var BPromise=require(_0xab2f('0x4'));var rp=require(_0xab2f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xab2f('0x6'));var config=require(_0xab2f('0x7'));var attributes=require(_0xab2f('0x8'));module['exports']=function(_0x21e7c9,_0x382963){return _0x21e7c9['define'](_0xab2f('0x9'),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 64f3286..733c2b6 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 _0x8ef5=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','util'];(function(_0x5ff027,_0x451702){var _0x2ca147=function(_0x54f4c0){while(--_0x54f4c0){_0x5ff027['push'](_0x5ff027['shift']());}};_0x2ca147(++_0x451702);}(_0x8ef5,0x110));var _0x58ef=function(_0x3fd5cc,_0x4ce9fe){_0x3fd5cc=_0x3fd5cc-0x0;var _0x472851=_0x8ef5[_0x3fd5cc];return _0x472851;};'use strict';var _=require('lodash');var util=require(_0x58ef('0x0'));var moment=require(_0x58ef('0x1'));var BPromise=require(_0x58ef('0x2'));var rs=require(_0x58ef('0x3'));var fs=require('fs');var Redis=require(_0x58ef('0x4'));var db=require(_0x58ef('0x5'))['db'];var utils=require(_0x58ef('0x6'));var logger=require(_0x58ef('0x7'))(_0x58ef('0x8'));var config=require(_0x58ef('0x9'));var jayson=require(_0x58ef('0xa'));var client=jayson['client'][_0x58ef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7827e4,_0x3ee9fc,_0x1ea15d){return new BPromise(function(_0x592889,_0x205f7f){return client[_0x58ef('0xc')](_0x7827e4,_0x1ea15d)['then'](function(_0x408bf2){logger[_0x58ef('0xd')](_0x58ef('0xe'),_0x3ee9fc,'request\x20sent');logger[_0x58ef('0xf')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x3ee9fc,_0x58ef('0x10'),JSON[_0x58ef('0x11')](_0x408bf2));if(_0x408bf2['error']){if(_0x408bf2['error'][_0x58ef('0x12')]===0x1f4){logger[_0x58ef('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x3ee9fc,_0x408bf2[_0x58ef('0x13')][_0x58ef('0x14')]);return _0x205f7f(_0x408bf2['error']['message']);}logger['error']('UserChatQueue,\x20%s,\x20%s',_0x3ee9fc,_0x408bf2[_0x58ef('0x13')][_0x58ef('0x14')]);return _0x592889(_0x408bf2['error'][_0x58ef('0x14')]);}else{logger[_0x58ef('0xd')](_0x58ef('0xe'),_0x3ee9fc,_0x58ef('0x10'));_0x592889(_0x408bf2['result'][_0x58ef('0x14')]);}})['catch'](function(_0xddd5bc){logger[_0x58ef('0x13')](_0x58ef('0xe'),_0x3ee9fc,_0xddd5bc);_0x205f7f(_0xddd5bc);});});} \ No newline at end of file +var _0x1fe1=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x1f6f84,_0x2bab55){var _0x177f40=function(_0x384ab4){while(--_0x384ab4){_0x1f6f84['push'](_0x1f6f84['shift']());}};_0x177f40(++_0x2bab55);}(_0x1fe1,0x19b));var _0x11fe=function(_0x295f66,_0x2b545b){_0x295f66=_0x295f66-0x0;var _0x3fd093=_0x1fe1[_0x295f66];return _0x3fd093;};'use strict';var _=require(_0x11fe('0x0'));var util=require(_0x11fe('0x1'));var moment=require(_0x11fe('0x2'));var BPromise=require(_0x11fe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11fe('0x4'));var db=require(_0x11fe('0x5'))['db'];var utils=require(_0x11fe('0x6'));var logger=require(_0x11fe('0x7'))(_0x11fe('0x8'));var config=require(_0x11fe('0x9'));var jayson=require(_0x11fe('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x6bc56b,_0x541edb,_0x44cea1){return new BPromise(function(_0x6064e9,_0x4e2353){return client[_0x11fe('0xb')](_0x6bc56b,_0x44cea1)[_0x11fe('0xc')](function(_0x2b1817){logger[_0x11fe('0xd')](_0x11fe('0xe'),_0x541edb,'request\x20sent');logger[_0x11fe('0xf')](_0x11fe('0x10'),_0x541edb,_0x11fe('0x11'),JSON[_0x11fe('0x12')](_0x2b1817));if(_0x2b1817['error']){if(_0x2b1817[_0x11fe('0x13')][_0x11fe('0x14')]===0x1f4){logger[_0x11fe('0x13')](_0x11fe('0xe'),_0x541edb,_0x2b1817[_0x11fe('0x13')][_0x11fe('0x15')]);return _0x4e2353(_0x2b1817['error'][_0x11fe('0x15')]);}logger[_0x11fe('0x13')](_0x11fe('0xe'),_0x541edb,_0x2b1817['error'][_0x11fe('0x15')]);return _0x6064e9(_0x2b1817[_0x11fe('0x13')][_0x11fe('0x15')]);}else{logger[_0x11fe('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x541edb,_0x11fe('0x11'));_0x6064e9(_0x2b1817[_0x11fe('0x16')][_0x11fe('0x15')]);}})[_0x11fe('0x17')](function(_0x41f47d){logger[_0x11fe('0x13')](_0x11fe('0xe'),_0x541edb,_0x41f47d);_0x4e2353(_0x41f47d);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 3bdb0ef..40a46e5 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x276f5b,_0x5cb495){var _0x4e6f40=function(_0x218f6c){while(--_0x218f6c){_0x276f5b['push'](_0x276f5b['shift']());}};_0x4e6f40(++_0x5cb495);}(_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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x311c35,_0x54a2b0){var _0x31ff65=function(_0x2efbe1){while(--_0x2efbe1){_0x311c35['push'](_0x311c35['shift']());}};_0x31ff65(++_0x54a2b0);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 73a85d1..d5509cb 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 _0x1d82=['sequelize','INTEGER'];(function(_0x167901,_0x293dcb){var _0x2168f0=function(_0x528fd1){while(--_0x528fd1){_0x167901['push'](_0x167901['shift']());}};_0x2168f0(++_0x293dcb);}(_0x1d82,0xb4));var _0x21d8=function(_0x442298,_0x201675){_0x442298=_0x442298-0x0;var _0x423bb1=_0x1d82[_0x442298];return _0x423bb1;};'use strict';var Sequelize=require(_0x21d8('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x21d8('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3e35=['STRING','sequelize','exports','INTEGER'];(function(_0x24afd3,_0xcc36f0){var _0xffe96f=function(_0x4f9cb0){while(--_0x4f9cb0){_0x24afd3['push'](_0x24afd3['shift']());}};_0xffe96f(++_0xcc36f0);}(_0x3e35,0x111));var _0x53e3=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0x3e35[_0x79b649];return _0x1af9b1;};'use strict';var Sequelize=require(_0x53e3('0x0'));module[_0x53e3('0x1')]={'penalty':{'type':Sequelize[_0x53e3('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x53e3('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x53e3('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 050e572..9bb49c0 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 _0x0e33=['exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','moment','bluebird','path','rimraf','./userFaxQueue.attributes'];(function(_0x159e2e,_0x45d0fc){var _0x384707=function(_0x1fa83b){while(--_0x1fa83b){_0x159e2e['push'](_0x159e2e['shift']());}};_0x384707(++_0x45d0fc);}(_0x0e33,0x16f));var _0x30e3=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x0e33[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x30e3('0x0'));var util=require(_0x30e3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x30e3('0x2'));var BPromise=require(_0x30e3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x30e3('0x4'));var rimraf=require(_0x30e3('0x5'));var config=require('../../config/environment');var attributes=require(_0x30e3('0x6'));module[_0x30e3('0x7')]=function(_0x51ad15,_0x144f08){return _0x51ad15[_0x30e3('0x8')](_0x30e3('0x9'),attributes,{'tableName':_0x30e3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x296c=['moment','path','rimraf','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue','lodash','../../config/logger','api'];(function(_0x5d246d,_0x8e46d5){var _0x1cfedf=function(_0x107058){while(--_0x107058){_0x5d246d['push'](_0x5d246d['shift']());}};_0x1cfedf(++_0x8e46d5);}(_0x296c,0xf7));var _0xc296=function(_0xbe6d85,_0x296fed){_0xbe6d85=_0xbe6d85-0x0;var _0x595074=_0x296c[_0xbe6d85];return _0x595074;};'use strict';var _=require(_0xc296('0x0'));var util=require('util');var logger=require(_0xc296('0x1'))(_0xc296('0x2'));var moment=require(_0xc296('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc296('0x4'));var rimraf=require(_0xc296('0x5'));var config=require(_0xc296('0x6'));var attributes=require(_0xc296('0x7'));module['exports']=function(_0xb12fbf,_0x33211b){return _0xb12fbf[_0xc296('0x8')](_0xc296('0x9'),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 3cb1080..de575d8 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 _0x584a=['client','http','then','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','UserFaxQueue,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise'];(function(_0x104def,_0xdb8a19){var _0x2e0f01=function(_0x370975){while(--_0x370975){_0x104def['push'](_0x104def['shift']());}};_0x2e0f01(++_0xdb8a19);}(_0x584a,0x75));var _0xa584=function(_0x2bc2a2,_0x51e95f){_0x2bc2a2=_0x2bc2a2-0x0;var _0x20de67=_0x584a[_0x2bc2a2];return _0x20de67;};'use strict';var _=require(_0xa584('0x0'));var util=require(_0xa584('0x1'));var moment=require(_0xa584('0x2'));var BPromise=require(_0xa584('0x3'));var rs=require(_0xa584('0x4'));var fs=require('fs');var Redis=require(_0xa584('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa584('0x6'));var config=require(_0xa584('0x7'));var jayson=require(_0xa584('0x8'));var client=jayson[_0xa584('0x9')][_0xa584('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c71a4,_0x1cbe80,_0x8b7f83){return new BPromise(function(_0x4733cc,_0x3d312e){return client['request'](_0x3c71a4,_0x8b7f83)[_0xa584('0xb')](function(_0x37648c){logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x1cbe80,_0xa584('0xc'));logger['debug'](_0xa584('0xd'),_0x1cbe80,_0xa584('0xc'),JSON['stringify'](_0x37648c));if(_0x37648c[_0xa584('0xe')]){if(_0x37648c['error'][_0xa584('0xf')]===0x1f4){logger['error'](_0xa584('0x10'),_0x1cbe80,_0x37648c[_0xa584('0xe')][_0xa584('0x11')]);return _0x3d312e(_0x37648c[_0xa584('0xe')][_0xa584('0x11')]);}logger[_0xa584('0xe')](_0xa584('0x10'),_0x1cbe80,_0x37648c[_0xa584('0xe')][_0xa584('0x11')]);return _0x4733cc(_0x37648c['error'][_0xa584('0x11')]);}else{logger[_0xa584('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x1cbe80,'request\x20sent');_0x4733cc(_0x37648c[_0xa584('0x13')]['message']);}})[_0xa584('0x14')](function(_0x526a65){logger[_0xa584('0xe')](_0xa584('0x10'),_0x1cbe80,_0x526a65);_0x3d312e(_0x526a65);});});} \ No newline at end of file +var _0xcef5=['client','http','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x45694f,_0x4cd365){var _0x443ccd=function(_0x48ae72){while(--_0x48ae72){_0x45694f['push'](_0x45694f['shift']());}};_0x443ccd(++_0x4cd365);}(_0xcef5,0xf6));var _0x5cef=function(_0x27b521,_0x5bc532){_0x27b521=_0x27b521-0x0;var _0x1805f1=_0xcef5[_0x27b521];return _0x1805f1;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x5cef('0x0'));var rs=require(_0x5cef('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5cef('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x5cef('0x3'))('rpc');var config=require(_0x5cef('0x4'));var jayson=require(_0x5cef('0x5'));var client=jayson[_0x5cef('0x6')][_0x5cef('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x368d5c,_0x4ca00e,_0x295f3b){return new BPromise(function(_0x3a3f1d,_0x1e3ef1){return client['request'](_0x368d5c,_0x295f3b)[_0x5cef('0x8')](function(_0x3f1dde){logger[_0x5cef('0x9')](_0x5cef('0xa'),_0x4ca00e,_0x5cef('0xb'));logger['debug'](_0x5cef('0xc'),_0x4ca00e,_0x5cef('0xb'),JSON[_0x5cef('0xd')](_0x3f1dde));if(_0x3f1dde['error']){if(_0x3f1dde[_0x5cef('0xe')][_0x5cef('0xf')]===0x1f4){logger[_0x5cef('0xe')](_0x5cef('0xa'),_0x4ca00e,_0x3f1dde[_0x5cef('0xe')][_0x5cef('0x10')]);return _0x1e3ef1(_0x3f1dde['error'][_0x5cef('0x10')]);}logger[_0x5cef('0xe')](_0x5cef('0xa'),_0x4ca00e,_0x3f1dde[_0x5cef('0xe')]['message']);return _0x3a3f1d(_0x3f1dde[_0x5cef('0xe')]['message']);}else{logger[_0x5cef('0x9')](_0x5cef('0xa'),_0x4ca00e,_0x5cef('0xb'));_0x3a3f1d(_0x3f1dde['result'][_0x5cef('0x10')]);}})[_0x5cef('0x11')](function(_0x39f29b){logger[_0x5cef('0xe')](_0x5cef('0xa'),_0x4ca00e,_0x39f29b);_0x1e3ef1(_0x39f29b);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 0862fa7..bcbba0d 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x515b7a,_0x53f15b){var _0x4de6a8=function(_0x58c52b){while(--_0x58c52b){_0x515b7a['push'](_0x515b7a['shift']());}};_0x4de6a8(++_0x53f15b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x368587,_0x1b6554){_0x368587=_0x368587-0x0;var _0x42d33c=_0xcb91[_0x368587];return _0x42d33c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x15ada9,_0x50f0a2){var _0x587361=function(_0x332a97){while(--_0x332a97){_0x15ada9['push'](_0x15ada9['shift']());}};_0x587361(++_0x50f0a2);}(_0x9c44,0x178));var _0x49c4=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x9c44[_0x543084];return _0x306a57;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index d260fb7..2591699 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 _0x18a8=['sequelize','INTEGER'];(function(_0x3a1fb8,_0x3ff4d6){var _0x4b914d=function(_0x3bab6d){while(--_0x3bab6d){_0x3a1fb8['push'](_0x3a1fb8['shift']());}};_0x4b914d(++_0x3ff4d6);}(_0x18a8,0x160));var _0x818a=function(_0x435b2f,_0x4c44da){_0x435b2f=_0x435b2f-0x0;var _0x181648=_0x18a8[_0x435b2f];return _0x181648;};'use strict';var Sequelize=require(_0x818a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x818a('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc777=['exports','sequelize'];(function(_0x9067c8,_0x386bdb){var _0x1f6f8a=function(_0x36d25c){while(--_0x36d25c){_0x9067c8['push'](_0x9067c8['shift']());}};_0x1f6f8a(++_0x386bdb);}(_0xc777,0x1b7));var _0x7c77=function(_0x50a0d0,_0x3c79b6){_0x50a0d0=_0x50a0d0-0x0;var _0x53e7a6=_0xc777[_0x50a0d0];return _0x53e7a6;};'use strict';var Sequelize=require(_0x7c77('0x0'));module[_0x7c77('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 7381e35..5ae8fc7 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 _0xbab8=['request-promise','path','../../config/environment','exports','define','UserMailQueue','util','../../config/logger','api','moment','bluebird'];(function(_0x3050b5,_0x182c6a){var _0x37cceb=function(_0x49b797){while(--_0x49b797){_0x3050b5['push'](_0x3050b5['shift']());}};_0x37cceb(++_0x182c6a);}(_0xbab8,0x187));var _0x8bab=function(_0x580cf8,_0x26751e){_0x580cf8=_0x580cf8-0x0;var _0xcc9a9e=_0xbab8[_0x580cf8];return _0xcc9a9e;};'use strict';var _=require('lodash');var util=require(_0x8bab('0x0'));var logger=require(_0x8bab('0x1'))(_0x8bab('0x2'));var moment=require(_0x8bab('0x3'));var BPromise=require(_0x8bab('0x4'));var rp=require(_0x8bab('0x5'));var fs=require('fs');var path=require(_0x8bab('0x6'));var rimraf=require('rimraf');var config=require(_0x8bab('0x7'));var attributes=require('./userMailQueue.attributes');module[_0x8bab('0x8')]=function(_0x113e08,_0x4da01f){return _0x113e08[_0x8bab('0x9')](_0x8bab('0xa'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ea3=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','user_has_mail_queues','lodash'];(function(_0x2f34f2,_0x4f49d8){var _0x35f87d=function(_0x1b4e43){while(--_0x1b4e43){_0x2f34f2['push'](_0x2f34f2['shift']());}};_0x35f87d(++_0x4f49d8);}(_0x4ea3,0x9b));var _0x34ea=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x4ea3[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x34ea('0x0'));var util=require('util');var logger=require(_0x34ea('0x1'))(_0x34ea('0x2'));var moment=require(_0x34ea('0x3'));var BPromise=require(_0x34ea('0x4'));var rp=require(_0x34ea('0x5'));var fs=require('fs');var path=require(_0x34ea('0x6'));var rimraf=require(_0x34ea('0x7'));var config=require(_0x34ea('0x8'));var attributes=require(_0x34ea('0x9'));module[_0x34ea('0xa')]=function(_0x9d704d,_0x143366){return _0x9d704d['define']('UserMailQueue',attributes,{'tableName':_0x34ea('0xb'),'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 022ce2d..75cc1b2 100644 --- a/server/api/userMailQueue/userMailQueue.rpc.js +++ b/server/api/userMailQueue/userMailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x4e48be,_0xb25356){var _0x39c910=function(_0x287648){while(--_0x287648){_0x4e48be['push'](_0x4e48be['shift']());}};_0x39c910(++_0xb25356);}(_0xe14b,0x93));var _0xbe14=function(_0x32c8ec,_0xd0e561){_0x32c8ec=_0x32c8ec-0x0;var _0x15ae95=_0xe14b[_0x32c8ec];return _0x15ae95;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file +var _0x6aa7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x351b52,_0xfbd9ab){var _0x1db268=function(_0x36aab1){while(--_0x36aab1){_0x351b52['push'](_0x351b52['shift']());}};_0x1db268(++_0xfbd9ab);}(_0x6aa7,0x178));var _0x76aa=function(_0x1f6d0b,_0x591550){_0x1f6d0b=_0x1f6d0b-0x0;var _0x523380=_0x6aa7[_0x1f6d0b];return _0x523380;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 205e836..c9e518c 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 _0x4aa3=['Router','fs-extra','../../config/environment','./userNotification.controller','isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout','express'];(function(_0x25fb28,_0x1cc456){var _0x20cce8=function(_0x2fbb3c){while(--_0x2fbb3c){_0x25fb28['push'](_0x25fb28['shift']());}};_0x20cce8(++_0x1cc456);}(_0x4aa3,0x7f));var _0x34aa=function(_0x5dc441,_0x1deb3d){_0x5dc441=_0x5dc441-0x0;var _0x403d17=_0x4aa3[_0x5dc441];return _0x403d17;};'use strict';var multer=require(_0x34aa('0x0'));var util=require(_0x34aa('0x1'));var path=require(_0x34aa('0x2'));var timeout=require(_0x34aa('0x3'));var express=require(_0x34aa('0x4'));var router=express[_0x34aa('0x5')]();var fs_extra=require(_0x34aa('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x34aa('0x7'));var controller=require(_0x34aa('0x8'));router['post']('/',auth[_0x34aa('0x9')](),controller[_0x34aa('0xa')]);module[_0x34aa('0xb')]=router; \ No newline at end of file +var _0x453c=['express','Router','fs-extra','../../config/environment','./userNotification.controller','post','isAuthenticated','exports','multer','util','path','connect-timeout'];(function(_0x3d39e5,_0xc26f28){var _0x4e48ca=function(_0x2c8f9e){while(--_0x2c8f9e){_0x3d39e5['push'](_0x3d39e5['shift']());}};_0x4e48ca(++_0xc26f28);}(_0x453c,0x128));var _0xc453=function(_0x12ca5f,_0x223d98){_0x12ca5f=_0x12ca5f-0x0;var _0xfc3ae9=_0x453c[_0x12ca5f];return _0xfc3ae9;};'use strict';var multer=require(_0xc453('0x0'));var util=require(_0xc453('0x1'));var path=require(_0xc453('0x2'));var timeout=require(_0xc453('0x3'));var express=require(_0xc453('0x4'));var router=express[_0xc453('0x5')]();var fs_extra=require(_0xc453('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc453('0x7'));var controller=require(_0xc453('0x8'));router[_0xc453('0x9')]('/',auth[_0xc453('0xa')](),controller['sendUserNotification']);module[_0xc453('0xb')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index cc030f6..b500c8a 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 _0xc45d=['sequelize','TEXT','STRING','BOOLEAN'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xc45d,0x100));var _0xdc45=function(_0x4b784d,_0x5efb2f){_0x4b784d=_0x4b784d-0x0;var _0x2cdeaf=_0xc45d[_0x4b784d];return _0x2cdeaf;};'use strict';var Sequelize=require(_0xdc45('0x0'));module['exports']={'body':{'type':Sequelize[_0xdc45('0x1')]},'senderName':{'type':Sequelize[_0xdc45('0x2')]},'recipientsId':{'type':Sequelize[_0xdc45('0x1')]},'recipientsDescription':{'type':Sequelize[_0xdc45('0x2')]},'beep':{'type':Sequelize[_0xdc45('0x3')]}}; \ No newline at end of file +var _0xbc1c=['sequelize','exports','TEXT'];(function(_0x13323a,_0x281e09){var _0x2f7c92=function(_0x39b259){while(--_0x39b259){_0x13323a['push'](_0x13323a['shift']());}};_0x2f7c92(++_0x281e09);}(_0xbc1c,0x168));var _0xcbc1=function(_0x27b423,_0x312583){_0x27b423=_0x27b423-0x0;var _0x5c11b8=_0xbc1c[_0x27b423];return _0x5c11b8;};'use strict';var Sequelize=require(_0xcbc1('0x0'));module[_0xcbc1('0x1')]={'body':{'type':Sequelize[_0xcbc1('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0xcbc1('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'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 0da23c3..69c42ca 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 _0xe8c8=['../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','end','json','offset','undefined','count','status','Content-Range','reject','update','then','destroy','error','name','send','body','hasOwnProperty','text','TemplateId','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','ValidationError','recipients','Sequelize','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','findOne','render','html','view','startCase','User','union','ids','queue','Queue','all','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api'];(function(_0x3ff902,_0x48c23d){var _0x3656e0=function(_0x23a346){while(--_0x23a346){_0x3ff902['push'](_0x3ff902['shift']());}};_0x3656e0(++_0x48c23d);}(_0xe8c8,0x11b));var _0x8e8c=function(_0x5db030,_0x2111f3){_0x5db030=_0x5db030-0x0;var _0x4a8d66=_0xe8c8[_0x5db030];return _0x4a8d66;};'use strict';var emlformat=require(_0x8e8c('0x0'));var rimraf=require(_0x8e8c('0x1'));var zipdir=require(_0x8e8c('0x2'));var jsonpatch=require(_0x8e8c('0x3'));var rp=require(_0x8e8c('0x4'));var moment=require(_0x8e8c('0x5'));var BPromise=require(_0x8e8c('0x6'));var Mustache=require(_0x8e8c('0x7'));var util=require('util');var path=require(_0x8e8c('0x8'));var sox=require(_0x8e8c('0x9'));var csv=require('to-csv');var ejs=require(_0x8e8c('0xa'));var fs=require('fs');var fs_extra=require(_0x8e8c('0xb'));var _=require(_0x8e8c('0xc'));var squel=require(_0x8e8c('0xd'));var crypto=require('crypto');var jsforce=require(_0x8e8c('0xe'));var deskjs=require(_0x8e8c('0xf'));var toCsv=require(_0x8e8c('0x10'));var querystring=require('querystring');var Papa=require(_0x8e8c('0x11'));var Redis=require(_0x8e8c('0x12'));var authService=require(_0x8e8c('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8e8c('0x14'));var logger=require(_0x8e8c('0x15'))(_0x8e8c('0x16'));var utils=require(_0x8e8c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8e8c('0x18'));var db=require(_0x8e8c('0x19'))['db'];config['redis']=_[_0x8e8c('0x1a')](config[_0x8e8c('0x1b')],{'host':_0x8e8c('0x1c'),'port':0x18eb});var socket=require(_0x8e8c('0x1d'))(new Redis(config['redis']));require(_0x8e8c('0x1e'))[_0x8e8c('0x1f')](socket);function respondWithStatusCode(_0x3fcfa5,_0x20d7ba){_0x20d7ba=_0x20d7ba||0xcc;return function(_0x36b052){if(_0x36b052){return _0x3fcfa5[_0x8e8c('0x20')](_0x20d7ba);}return _0x3fcfa5['status'](_0x20d7ba)[_0x8e8c('0x21')]();};}function respondWithResult(_0x4b1746,_0x5e8bf1){_0x5e8bf1=_0x5e8bf1||0xc8;return function(_0x5dad8e){if(_0x5dad8e){return _0x4b1746['status'](_0x5e8bf1)[_0x8e8c('0x22')](_0x5dad8e);}};}function respondWithFilteredResult(_0x2f9496,_0x35919a){return function(_0x1f37c3){if(_0x1f37c3){var _0x49a87a=typeof _0x35919a[_0x8e8c('0x23')]===_0x8e8c('0x24')&&typeof _0x35919a['limit']===_0x8e8c('0x24');var _0x1997c7=_0x1f37c3[_0x8e8c('0x25')];var _0x1756b6=_0x49a87a?0x0:_0x35919a[_0x8e8c('0x23')];var _0x3a8e17=_0x49a87a?_0x1f37c3[_0x8e8c('0x25')]:_0x35919a[_0x8e8c('0x23')]+_0x35919a['limit'];var _0x34bb9c;if(_0x3a8e17>=_0x1997c7){_0x3a8e17=_0x1997c7;_0x34bb9c=0xc8;}else{_0x34bb9c=0xce;}_0x2f9496[_0x8e8c('0x26')](_0x34bb9c);return _0x2f9496['set'](_0x8e8c('0x27'),_0x1756b6+'-'+_0x3a8e17+'/'+_0x1997c7)[_0x8e8c('0x22')](_0x1f37c3);}return null;};}function patchUpdates(_0x3cb260){return function(_0x5bdb84){try{jsonpatch['apply'](_0x5bdb84,_0x3cb260,!![]);}catch(_0x40d23a){return BPromise[_0x8e8c('0x28')](_0x40d23a);}return _0x5bdb84['save']();};}function saveUpdates(_0x183df6,_0x5f3b9d){return function(_0x2321b6){if(_0x2321b6){return _0x2321b6[_0x8e8c('0x29')](_0x183df6)[_0x8e8c('0x2a')](function(_0x1bf809){return _0x1bf809;});}return null;};}function removeEntity(_0x54881d,_0x145bd7){return function(_0x26ee7d){if(_0x26ee7d){return _0x26ee7d[_0x8e8c('0x2b')]()['then'](function(){_0x54881d[_0x8e8c('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5253d6,_0x4e75c6){return function(_0x4a9141){if(!_0x4a9141){_0x5253d6[_0x8e8c('0x20')](0x194);}return _0x4a9141;};}function handleError(_0x424104,_0x509878){_0x509878=_0x509878||0x1f4;return function(_0x1c6733){logger[_0x8e8c('0x2c')](_0x1c6733['stack']);if(_0x1c6733[_0x8e8c('0x2d')]){delete _0x1c6733[_0x8e8c('0x2d')];}_0x424104[_0x8e8c('0x26')](_0x509878)[_0x8e8c('0x2e')](_0x1c6733);};}exports['sendUserNotification']=function(_0x576ac4,_0x111b3a,_0x4ad0a3){if(!_0x576ac4[_0x8e8c('0x2f')][_0x8e8c('0x30')](_0x8e8c('0x31'))&&!_0x576ac4[_0x8e8c('0x2f')][_0x8e8c('0x30')](_0x8e8c('0x32'))){throw new db['Sequelize']['ValidationError'](_0x8e8c('0x33'));}else{if(_0x576ac4[_0x8e8c('0x2f')][_0x8e8c('0x30')]('TemplateId')&&!_0x576ac4[_0x8e8c('0x2f')]['hasOwnProperty']('view')){throw new db['Sequelize'][(_0x8e8c('0x34'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x576ac4[_0x8e8c('0x2f')][_0x8e8c('0x30')](_0x8e8c('0x35'))){throw new db[(_0x8e8c('0x36'))][(_0x8e8c('0x34'))](_0x8e8c('0x37'));}else{try{var _0xfa199=JSON[_0x8e8c('0x38')](_0x576ac4[_0x8e8c('0x2f')][_0x8e8c('0x35')]);}catch(_0x4a01a5){logger[_0x8e8c('0x2c')](_0x4a01a5);throw new db['Sequelize'][(_0x8e8c('0x34'))](_0x8e8c('0x39'));}var _0x2b6e58=[_0x8e8c('0x3a'),_0x8e8c('0x3b'),_0x8e8c('0x3c'),_0x8e8c('0x3d'),_0x8e8c('0x3e'),_0x8e8c('0x3f'),_0x8e8c('0x40'),_0x8e8c('0x41'),_0x8e8c('0x42')];if(_[_0x8e8c('0x43')](_0xfa199,function(_0x38f8f6){return!_[_0x8e8c('0x44')](_0x2b6e58,_0x38f8f6[_0x8e8c('0x45')]['toLowerCase']());})){throw new db[(_0x8e8c('0x36'))][(_0x8e8c('0x34'))](_0x8e8c('0x46'));}}}var _0x3163bc={};_0x3163bc['senderName']=_0x576ac4['body']['hasOwnProperty'](_0x8e8c('0x47'))?_0x576ac4[_0x8e8c('0x2f')]['senderName']:_0x576ac4['user'][_0x8e8c('0x48')];_0x3163bc[_0x8e8c('0x49')]=_[_0x8e8c('0x4a')](_0x576ac4[_0x8e8c('0x2f')][_0x8e8c('0x49')])?null:_0x576ac4[_0x8e8c('0x2f')][_0x8e8c('0x49')];_0x3163bc[_0x8e8c('0x4b')]=_0x576ac4['body'][_0x8e8c('0x4b')]||![];_0x3163bc[_0x8e8c('0x4c')]=_0x576ac4[_0x8e8c('0x42')]['id'];return getContent(_0x576ac4[_0x8e8c('0x2f')])[_0x8e8c('0x2a')](function(_0x598de9){_0x3163bc[_0x8e8c('0x2f')]=_0x598de9;return getRecipients(_0xfa199);})[_0x8e8c('0x2a')](function(_0x1469c8){_0x3163bc[_0x8e8c('0x4d')]=_[_0x8e8c('0x4e')](_0x1469c8)[_0x8e8c('0x4f')](',');return db['sequelize'][_0x8e8c('0x50')](function(_0x3e8a18){return db[_0x8e8c('0x51')][_0x8e8c('0x52')](_0x3163bc,{'raw':!![],'transaction':_0x3e8a18})[_0x8e8c('0x2a')](function(_0x517c40){var _0x1eed63={'sender':_0x3163bc[_0x8e8c('0x47')],'description':_0x3163bc[_0x8e8c('0x49')],'content':_0x3163bc[_0x8e8c('0x2f')],'beep':_0x3163bc[_0x8e8c('0x4b')]};_0x1469c8[_0x8e8c('0x53')](function(_0x2b9256){_0x1eed63[_0x8e8c('0x54')]=_0x2b9256;socket[_0x8e8c('0x55')](_0x8e8c('0x56'),_0x1eed63);});return _0x517c40;});});})[_0x8e8c('0x2a')](respondWithResult(_0x111b3a,0xc9))[_0x8e8c('0x57')](handleError(_0x111b3a,null));};function getContent(_0x3b63ed){return new BPromise(function(_0x3f585f,_0x4da301){if(_0x3b63ed['text']){_0x3f585f(_0x3b63ed['text']);return;}return db['Template'][_0x8e8c('0x58')]({'attributes':['html'],'where':{'id':_0x3b63ed['TemplateId']},'raw':!![]})[_0x8e8c('0x2a')](function(_0x2c2fe6){if(!_0x2c2fe6)throw new db[(_0x8e8c('0x36'))]['ValidationError']('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x90b9e5=Mustache[_0x8e8c('0x59')](_0x2c2fe6[_0x8e8c('0x5a')],_0x3b63ed[_0x8e8c('0x5b')]);_0x3f585f(_0x90b9e5);})[_0x8e8c('0x57')](function(_0x404159){_0x4da301(_0x404159);});});}function getRecipients(_0x2b46ce){return new BPromise(function(_0xd992dd,_0xde47cf){var _0x4677e5=[];var _0x72339a=[];_0x2b46ce[_0x8e8c('0x53')](function(_0x21d16a){var _0x1920ba=_[_0x8e8c('0x5c')](_0x21d16a[_0x8e8c('0x45')]['toLowerCase']());if(_0x1920ba===_0x8e8c('0x5d')){_0x4677e5=_[_0x8e8c('0x5e')](_0x4677e5,_0x21d16a[_0x8e8c('0x5f')]);}else{if(_['includes'](_0x1920ba,_0x8e8c('0x60')))_0x1920ba=_0x1920ba['replace']('queue',_0x8e8c('0x61'));_0x21d16a[_0x8e8c('0x5f')][_0x8e8c('0x53')](function(_0x6248d5){_0x72339a['push'](getAgents(_0x1920ba,_0x6248d5));});}});return BPromise[_0x8e8c('0x62')](_0x72339a)[_0x8e8c('0x2a')](function(_0x16f17a){_0x4677e5=_[_0x8e8c('0x5e')](_0x4677e5,_[_0x8e8c('0x63')](_0x16f17a));_0xd992dd(_0x4677e5);})['catch'](function(_0x423f0a){_0xde47cf(_0x423f0a);});});}function getAgents(_0x5af848,_0x173672){return new BPromise(function(_0x45d557,_0x2ee9b2){return db[_0x5af848][_0x8e8c('0x58')]({'where':{'id':_0x173672}})[_0x8e8c('0x2a')](function(_0x355c7e){return _0x355c7e[_0x8e8c('0x64')]({'attributes':['id'],'raw':!![]})[_0x8e8c('0x2a')](function(_0x19c883){var _0x479690=_[_0x8e8c('0x65')](_0x19c883,'id');_0x45d557(_0x479690);});})[_0x8e8c('0x57')](function(_0x431caf){_0x2ee9b2(_0x431caf);});});} \ No newline at end of file +var _0x16d8=['smsqueue','voicequeue','whatsappqueue','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','forEach','recipient','emit','userNotification:send','text','Template','findOne','html','TemplateId','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','toLowerCase','union','ids','queue','Queue','push','all','catch','getAgents','map','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./userNotification.socket','register','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','then','destroy','sendStatus','error','stack','send','sendUserNotification','body','hasOwnProperty','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','openchannelqueue'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x16d8,0x154));var _0x816d=function(_0x33475a,_0x46a6b8){_0x33475a=_0x33475a-0x0;var _0x327bb4=_0x16d8[_0x33475a];return _0x327bb4;};'use strict';var emlformat=require(_0x816d('0x0'));var rimraf=require(_0x816d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x816d('0x2'));var rp=require(_0x816d('0x3'));var moment=require(_0x816d('0x4'));var BPromise=require(_0x816d('0x5'));var Mustache=require(_0x816d('0x6'));var util=require(_0x816d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x816d('0x8'));var ejs=require(_0x816d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x816d('0xa'));var crypto=require('crypto');var jsforce=require(_0x816d('0xb'));var deskjs=require(_0x816d('0xc'));var toCsv=require(_0x816d('0x8'));var querystring=require(_0x816d('0xd'));var Papa=require(_0x816d('0xe'));var Redis=require(_0x816d('0xf'));var authService=require(_0x816d('0x10'));var qs=require(_0x816d('0x11'));var as=require(_0x816d('0x12'));var hardwareService=require(_0x816d('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x816d('0x14'));var config=require(_0x816d('0x15'));var licenseUtil=require(_0x816d('0x16'));var db=require(_0x816d('0x17'))['db'];config['redis']=_[_0x816d('0x18')](config[_0x816d('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x816d('0x1a'))(new Redis(config[_0x816d('0x19')]));require(_0x816d('0x1b'))[_0x816d('0x1c')](socket);function respondWithStatusCode(_0x16fca0,_0x552355){_0x552355=_0x552355||0xcc;return function(_0x489be8){if(_0x489be8){return _0x16fca0['sendStatus'](_0x552355);}return _0x16fca0[_0x816d('0x1d')](_0x552355)[_0x816d('0x1e')]();};}function respondWithResult(_0x9d74e6,_0x137ad0){_0x137ad0=_0x137ad0||0xc8;return function(_0x30d330){if(_0x30d330){return _0x9d74e6[_0x816d('0x1d')](_0x137ad0)[_0x816d('0x1f')](_0x30d330);}};}function respondWithFilteredResult(_0x1f3a4f,_0x9916de){return function(_0x4fd892){if(_0x4fd892){var _0xf631b3=typeof _0x9916de[_0x816d('0x20')]==='undefined'&&typeof _0x9916de['limit']===_0x816d('0x21');var _0x253864=_0x4fd892['count'];var _0x35caee=_0xf631b3?0x0:_0x9916de[_0x816d('0x20')];var _0x39103e=_0xf631b3?_0x4fd892[_0x816d('0x22')]:_0x9916de['offset']+_0x9916de[_0x816d('0x23')];var _0x3c32b2;if(_0x39103e>=_0x253864){_0x39103e=_0x253864;_0x3c32b2=0xc8;}else{_0x3c32b2=0xce;}_0x1f3a4f['status'](_0x3c32b2);return _0x1f3a4f['set'](_0x816d('0x24'),_0x35caee+'-'+_0x39103e+'/'+_0x253864)[_0x816d('0x1f')](_0x4fd892);}return null;};}function patchUpdates(_0x3aabbb){return function(_0xe591de){try{jsonpatch[_0x816d('0x25')](_0xe591de,_0x3aabbb,!![]);}catch(_0x3ac0dd){return BPromise['reject'](_0x3ac0dd);}return _0xe591de[_0x816d('0x26')]();};}function saveUpdates(_0x4507a9,_0x1824f0){return function(_0x49d030){if(_0x49d030){return _0x49d030['update'](_0x4507a9)[_0x816d('0x27')](function(_0x48df73){return _0x48df73;});}return null;};}function removeEntity(_0x3739cf,_0x20a7d4){return function(_0x30e943){if(_0x30e943){return _0x30e943[_0x816d('0x28')]()['then'](function(){_0x3739cf[_0x816d('0x1d')](0xcc)[_0x816d('0x1e')]();});}};}function handleEntityNotFound(_0x2977f8,_0x3d677f){return function(_0x2dfb7f){if(!_0x2dfb7f){_0x2977f8[_0x816d('0x29')](0x194);}return _0x2dfb7f;};}function handleError(_0x56a30c,_0x43aacd){_0x43aacd=_0x43aacd||0x1f4;return function(_0x43a609){logger[_0x816d('0x2a')](_0x43a609[_0x816d('0x2b')]);if(_0x43a609['name']){delete _0x43a609['name'];}_0x56a30c[_0x816d('0x1d')](_0x43aacd)[_0x816d('0x2c')](_0x43a609);};}exports[_0x816d('0x2d')]=function(_0x1278a1,_0x56c79e,_0x298fe5){if(!_0x1278a1['body']['hasOwnProperty']('text')&&!_0x1278a1[_0x816d('0x2e')][_0x816d('0x2f')]('TemplateId')){throw new db[(_0x816d('0x30'))][(_0x816d('0x31'))](_0x816d('0x32'));}else{if(_0x1278a1[_0x816d('0x2e')][_0x816d('0x2f')]('TemplateId')&&!_0x1278a1['body'][_0x816d('0x2f')](_0x816d('0x33'))){throw new db[(_0x816d('0x30'))][(_0x816d('0x31'))](_0x816d('0x34'));}if(!_0x1278a1[_0x816d('0x2e')][_0x816d('0x2f')](_0x816d('0x35'))){throw new db['Sequelize'][(_0x816d('0x31'))](_0x816d('0x36'));}else{try{var _0x3b60fd=JSON[_0x816d('0x37')](_0x1278a1['body']['recipients']);}catch(_0x3f4a68){logger['error'](_0x3f4a68);throw new db[(_0x816d('0x30'))][(_0x816d('0x31'))](_0x816d('0x38'));}var _0x5696e8=['chatqueue',_0x816d('0x39'),_0x816d('0x3a'),_0x816d('0x3b'),_0x816d('0x3c'),_0x816d('0x3d'),_0x816d('0x3e'),'team',_0x816d('0x3f')];if(_[_0x816d('0x40')](_0x3b60fd,function(_0xb64b01){return!_[_0x816d('0x41')](_0x5696e8,_0xb64b01[_0x816d('0x42')]['toLowerCase']());})){throw new db[(_0x816d('0x30'))][(_0x816d('0x31'))](_0x816d('0x43'));}}}var _0x14886e={};_0x14886e[_0x816d('0x44')]=_0x1278a1[_0x816d('0x2e')][_0x816d('0x2f')]('senderName')?_0x1278a1['body'][_0x816d('0x44')]:_0x1278a1[_0x816d('0x3f')]['fullname'];_0x14886e[_0x816d('0x45')]=_[_0x816d('0x46')](_0x1278a1[_0x816d('0x2e')][_0x816d('0x45')])?null:_0x1278a1['body'][_0x816d('0x45')];_0x14886e[_0x816d('0x47')]=_0x1278a1[_0x816d('0x2e')]['beep']||![];_0x14886e[_0x816d('0x48')]=_0x1278a1[_0x816d('0x3f')]['id'];return getContent(_0x1278a1[_0x816d('0x2e')])['then'](function(_0x41ddff){_0x14886e['body']=_0x41ddff;return getRecipients(_0x3b60fd);})[_0x816d('0x27')](function(_0x2fb318){_0x14886e[_0x816d('0x49')]=_[_0x816d('0x4a')](_0x2fb318)[_0x816d('0x4b')](',');return db[_0x816d('0x4c')][_0x816d('0x4d')](function(_0x2b7055){return db['UserNotification']['create'](_0x14886e,{'raw':!![],'transaction':_0x2b7055})[_0x816d('0x27')](function(_0x5d876b){var _0x4be341={'sender':_0x14886e[_0x816d('0x44')],'description':_0x14886e[_0x816d('0x45')],'content':_0x14886e[_0x816d('0x2e')],'beep':_0x14886e[_0x816d('0x47')]};_0x2fb318[_0x816d('0x4e')](function(_0x3609e4){_0x4be341[_0x816d('0x4f')]=_0x3609e4;socket[_0x816d('0x50')](_0x816d('0x51'),_0x4be341);});return _0x5d876b;});});})[_0x816d('0x27')](respondWithResult(_0x56c79e,0xc9))['catch'](handleError(_0x56c79e,null));};function getContent(_0x322f10){return new BPromise(function(_0x97d336,_0x371eaa){if(_0x322f10['text']){_0x97d336(_0x322f10[_0x816d('0x52')]);return;}return db[_0x816d('0x53')][_0x816d('0x54')]({'attributes':[_0x816d('0x55')],'where':{'id':_0x322f10[_0x816d('0x56')]},'raw':!![]})[_0x816d('0x27')](function(_0x3a9122){if(!_0x3a9122)throw new db[(_0x816d('0x30'))][(_0x816d('0x31'))](_0x816d('0x57'));var _0x3fa9c8=Mustache[_0x816d('0x58')](_0x3a9122[_0x816d('0x55')],_0x322f10['view']);_0x97d336(_0x3fa9c8);})['catch'](function(_0x123af3){_0x371eaa(_0x123af3);});});}function getRecipients(_0x2d2f7a){return new BPromise(function(_0x3f4ab0,_0x4e73a4){var _0x45a622=[];var _0x3fd646=[];_0x2d2f7a[_0x816d('0x4e')](function(_0x49eea7){var _0x42a29a=_[_0x816d('0x59')](_0x49eea7[_0x816d('0x42')][_0x816d('0x5a')]());if(_0x42a29a==='User'){_0x45a622=_[_0x816d('0x5b')](_0x45a622,_0x49eea7[_0x816d('0x5c')]);}else{if(_[_0x816d('0x41')](_0x42a29a,'queue'))_0x42a29a=_0x42a29a['replace'](_0x816d('0x5d'),_0x816d('0x5e'));_0x49eea7[_0x816d('0x5c')][_0x816d('0x4e')](function(_0x25a82e){_0x3fd646[_0x816d('0x5f')](getAgents(_0x42a29a,_0x25a82e));});}});return BPromise[_0x816d('0x60')](_0x3fd646)[_0x816d('0x27')](function(_0x110606){_0x45a622=_[_0x816d('0x5b')](_0x45a622,_['flatten'](_0x110606));_0x3f4ab0(_0x45a622);})[_0x816d('0x61')](function(_0x1c6952){_0x4e73a4(_0x1c6952);});});}function getAgents(_0x47a47b,_0x4552c2){return new BPromise(function(_0x4293b5,_0x4e3af2){return db[_0x47a47b]['findOne']({'where':{'id':_0x4552c2}})['then'](function(_0x23adfb){return _0x23adfb[_0x816d('0x62')]({'attributes':['id'],'raw':!![]})[_0x816d('0x27')](function(_0x5cb5b0){var _0x1bb7df=_[_0x816d('0x63')](_0x5cb5b0,'id');_0x4293b5(_0x1bb7df);});})['catch'](function(_0x3e7fa6){_0x4e3af2(_0x3e7fa6);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index aec8aa7..9b00be9 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 _0x3712=['exports','events','../../mysqldb','UserNotification','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3c110d,_0x3afe37){var _0x20916c=function(_0xb89a56){while(--_0xb89a56){_0x3c110d['push'](_0x3c110d['shift']());}};_0x20916c(++_0x3afe37);}(_0x3712,0xa1));var _0x2371=function(_0x1741a1,_0x3ab2f5){_0x1741a1=_0x1741a1-0x0;var _0x20f178=_0x3712[_0x1741a1];return _0x20f178;};'use strict';var EventEmitter=require(_0x2371('0x0'));var UserNotification=require(_0x2371('0x1'))['db'][_0x2371('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x2371('0x3')](0x0);var events={'afterCreate':_0x2371('0x4'),'afterUpdate':_0x2371('0x5'),'afterDestroy':_0x2371('0x6')};function emitEvent(_0x3f9874){return function(_0x509eec,_0x1fe98c,_0xf492a9){UserNotificationEvents[_0x2371('0x7')](_0x3f9874+':'+_0x509eec['id'],_0x509eec);UserNotificationEvents[_0x2371('0x7')](_0x3f9874,_0x509eec);_0xf492a9(null);};}for(var e in events){if(events[_0x2371('0x8')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x2371('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0x03da=['emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x870b62,_0x2143f9){var _0x2dcb39=function(_0x2fb63d){while(--_0x2fb63d){_0x870b62['push'](_0x870b62['shift']());}};_0x2dcb39(++_0x2143f9);}(_0x03da,0xd1));var _0xa03d=function(_0x42c118,_0x197006){_0x42c118=_0x42c118-0x0;var _0x112ebd=_0x03da[_0x42c118];return _0x112ebd;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0xa03d('0x0'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x337e24){return function(_0x503b4c,_0x558754,_0x4d8abd){UserNotificationEvents[_0xa03d('0x1')](_0x337e24+':'+_0x503b4c['id'],_0x503b4c);UserNotificationEvents[_0xa03d('0x1')](_0x337e24,_0x503b4c);_0x4d8abd(null);};}for(var e in events){if(events[_0xa03d('0x2')](e)){var event=events[e];UserNotification[_0xa03d('0x3')](e,emitEvent(event));}}module[_0xa03d('0x4')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 83110cc..35ea7e4 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 _0x3f91=['api','moment','bluebird','request-promise','./userNotification.attributes','exports','define','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x5dd862,_0x58ca35){var _0x47dc79=function(_0x4d7d57){while(--_0x4d7d57){_0x5dd862['push'](_0x5dd862['shift']());}};_0x47dc79(++_0x58ca35);}(_0x3f91,0x1ae));var _0x13f9=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x3f91[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0x13f9('0x0'));var util=require(_0x13f9('0x1'));var logger=require('../../config/logger')(_0x13f9('0x2'));var moment=require(_0x13f9('0x3'));var BPromise=require(_0x13f9('0x4'));var rp=require(_0x13f9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x13f9('0x6'));module[_0x13f9('0x7')]=function(_0x141d2d,_0x42d058){return _0x141d2d[_0x13f9('0x8')]('UserNotification',attributes,{'tableName':_0x13f9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x13f9('0xa'),'collate':_0x13f9('0xb')});}; \ No newline at end of file +var _0x6eaf=['./userNotification.attributes','UserNotification','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','bluebird','path','rimraf'];(function(_0x35c571,_0x33e0b1){var _0x22cf8d=function(_0xa7a205){while(--_0xa7a205){_0x35c571['push'](_0x35c571['shift']());}};_0x22cf8d(++_0x33e0b1);}(_0x6eaf,0x1d8));var _0xf6ea=function(_0x117b5d,_0x7adf5c){_0x117b5d=_0x117b5d-0x0;var _0x199c3d=_0x6eaf[_0x117b5d];return _0x199c3d;};'use strict';var _=require('lodash');var util=require(_0xf6ea('0x0'));var logger=require(_0xf6ea('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf6ea('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf6ea('0x3'));var rimraf=require(_0xf6ea('0x4'));var config=require('../../config/environment');var attributes=require(_0xf6ea('0x5'));module['exports']=function(_0x22949d,_0x3fe7c0){return _0x22949d['define'](_0xf6ea('0x6'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf6ea('0x7'),'collate':_0xf6ea('0x8')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index c7717b6..8ad7a3a 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 _0xc45e=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./userNotification.socket','register','request','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x50125c,_0x1dbc29){var _0x3aee37=function(_0x49db16){while(--_0x49db16){_0x50125c['push'](_0x50125c['shift']());}};_0x3aee37(++_0x1dbc29);}(_0xc45e,0x1b0));var _0xec45=function(_0xd3bdab,_0x5d784a){_0xd3bdab=_0xd3bdab-0x0;var _0x1c3178=_0xc45e[_0xd3bdab];return _0x1c3178;};'use strict';var _=require('lodash');var util=require(_0xec45('0x0'));var moment=require(_0xec45('0x1'));var BPromise=require('bluebird');var rs=require(_0xec45('0x2'));var fs=require('fs');var Redis=require(_0xec45('0x3'));var db=require(_0xec45('0x4'))['db'];var utils=require(_0xec45('0x5'));var logger=require(_0xec45('0x6'))('rpc');var config=require(_0xec45('0x7'));var jayson=require(_0xec45('0x8'));var client=jayson[_0xec45('0x9')][_0xec45('0xa')]({'port':0x232a});config[_0xec45('0xb')]=_['defaults'](config[_0xec45('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xec45('0xc'))(new Redis(config['redis']));require(_0xec45('0xd'))[_0xec45('0xe')](socket);function respondWithRpcPromise(_0x49e369,_0x1940c4,_0x5b12d0){return new BPromise(function(_0x4dbd7f,_0x1c74d2){return client[_0xec45('0xf')](_0x49e369,_0x5b12d0)['then'](function(_0x195f03){logger['info'](_0xec45('0x10'),_0x1940c4,_0xec45('0x11'));logger[_0xec45('0x12')](_0xec45('0x13'),_0x1940c4,_0xec45('0x11'),JSON[_0xec45('0x14')](_0x195f03));if(_0x195f03[_0xec45('0x15')]){if(_0x195f03[_0xec45('0x15')]['code']===0x1f4){logger[_0xec45('0x15')](_0xec45('0x10'),_0x1940c4,_0x195f03[_0xec45('0x15')][_0xec45('0x16')]);return _0x1c74d2(_0x195f03[_0xec45('0x15')][_0xec45('0x16')]);}logger['error'](_0xec45('0x10'),_0x1940c4,_0x195f03['error']['message']);return _0x4dbd7f(_0x195f03[_0xec45('0x15')][_0xec45('0x16')]);}else{logger['info'](_0xec45('0x10'),_0x1940c4,_0xec45('0x11'));_0x4dbd7f(_0x195f03['result'][_0xec45('0x16')]);}})[_0xec45('0x17')](function(_0x2d401d){logger['error'](_0xec45('0x10'),_0x1940c4,_0x2d401d);_0x1c74d2(_0x2d401d);});});} \ No newline at end of file +var _0x9fee=['redis','defaults','socket.io-emitter','./userNotification.socket','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http'];(function(_0x2482d6,_0x4f4e47){var _0x578839=function(_0x45132c){while(--_0x45132c){_0x2482d6['push'](_0x2482d6['shift']());}};_0x578839(++_0x4f4e47);}(_0x9fee,0x1f0));var _0xe9fe=function(_0x51e902,_0xacf919){_0x51e902=_0x51e902-0x0;var _0x3e328d=_0x9fee[_0x51e902];return _0x3e328d;};'use strict';var _=require('lodash');var util=require(_0xe9fe('0x0'));var moment=require(_0xe9fe('0x1'));var BPromise=require(_0xe9fe('0x2'));var rs=require(_0xe9fe('0x3'));var fs=require('fs');var Redis=require(_0xe9fe('0x4'));var db=require(_0xe9fe('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe9fe('0x6'));var config=require(_0xe9fe('0x7'));var jayson=require(_0xe9fe('0x8'));var client=jayson['client'][_0xe9fe('0x9')]({'port':0x232a});config[_0xe9fe('0xa')]=_[_0xe9fe('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe9fe('0xc'))(new Redis(config[_0xe9fe('0xa')]));require(_0xe9fe('0xd'))['register'](socket);function respondWithRpcPromise(_0x52b516,_0x139a86,_0x4688c4){return new BPromise(function(_0x46599a,_0x1d2f6a){return client['request'](_0x52b516,_0x4688c4)[_0xe9fe('0xe')](function(_0x458e71){logger[_0xe9fe('0xf')](_0xe9fe('0x10'),_0x139a86,_0xe9fe('0x11'));logger['debug']('UserNotification,\x20%s,\x20%s,\x20%s',_0x139a86,'request\x20sent',JSON[_0xe9fe('0x12')](_0x458e71));if(_0x458e71[_0xe9fe('0x13')]){if(_0x458e71['error'][_0xe9fe('0x14')]===0x1f4){logger[_0xe9fe('0x13')](_0xe9fe('0x10'),_0x139a86,_0x458e71[_0xe9fe('0x13')]['message']);return _0x1d2f6a(_0x458e71[_0xe9fe('0x13')]['message']);}logger[_0xe9fe('0x13')](_0xe9fe('0x10'),_0x139a86,_0x458e71['error']['message']);return _0x46599a(_0x458e71[_0xe9fe('0x13')][_0xe9fe('0x15')]);}else{logger[_0xe9fe('0xf')](_0xe9fe('0x10'),_0x139a86,_0xe9fe('0x11'));_0x46599a(_0x458e71[_0xe9fe('0x16')][_0xe9fe('0x15')]);}})['catch'](function(_0x36a456){logger[_0xe9fe('0x13')]('UserNotification,\x20%s,\x20%s',_0x139a86,_0x36a456);_0x1d2f6a(_0x36a456);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index a428043..839871b 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 _0x0c88=['./userNotification.events','save','remove','update','emit','length'];(function(_0xc102b0,_0x4c9b9a){var _0x522bf7=function(_0x504ab4){while(--_0x504ab4){_0xc102b0['push'](_0xc102b0['shift']());}};_0x522bf7(++_0x4c9b9a);}(_0x0c88,0xde));var _0x80c8=function(_0x59f0dc,_0x1e2497){_0x59f0dc=_0x59f0dc-0x0;var _0x5b5445=_0x0c88[_0x59f0dc];return _0x5b5445;};'use strict';var UserNotificationEvents=require(_0x80c8('0x0'));var events=[_0x80c8('0x1'),_0x80c8('0x2'),_0x80c8('0x3')];function createListener(_0x541193,_0x33cf10){return function(_0x331261){_0x33cf10[_0x80c8('0x4')](_0x541193,_0x331261);};}function removeListener(_0x279e98,_0x1225e3){return function(){UserNotificationEvents['removeListener'](_0x279e98,_0x1225e3);};}exports['register']=function(_0x3b13a7){for(var _0x59baad=0x0,_0x410f90=events[_0x80c8('0x5')];_0x59baad<_0x410f90;_0x59baad++){var _0x1a7125=events[_0x59baad];var _0x2c1773=createListener('userNotification:'+_0x1a7125,_0x3b13a7);UserNotificationEvents['on'](_0x1a7125,_0x2c1773);}}; \ No newline at end of file +var _0xeed2=['userNotification:','./userNotification.events','save','emit','removeListener','register'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xeed2,0xbb));var _0x2eed=function(_0x1e4d5a,_0x2fcfd5){_0x1e4d5a=_0x1e4d5a-0x0;var _0x1605ce=_0xeed2[_0x1e4d5a];return _0x1605ce;};'use strict';var UserNotificationEvents=require(_0x2eed('0x0'));var events=[_0x2eed('0x1'),'remove','update'];function createListener(_0x4da438,_0x3aac31){return function(_0x408e44){_0x3aac31[_0x2eed('0x2')](_0x4da438,_0x408e44);};}function removeListener(_0x45a689,_0x1e5fd2){return function(){UserNotificationEvents[_0x2eed('0x3')](_0x45a689,_0x1e5fd2);};}exports[_0x2eed('0x4')]=function(_0x4802ad){for(var _0x5e4353=0x0,_0x3d74ee=events['length'];_0x5e4353<_0x3d74ee;_0x5e4353++){var _0x4bea15=events[_0x5e4353];var _0x9f2b4e=createListener(_0x2eed('0x5')+_0x4bea15,_0x4802ad);UserNotificationEvents['on'](_0x4bea15,_0x9f2b4e);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index a523439..d55efb1 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x342120,_0x2a44ff){var _0x477798=function(_0x64308){while(--_0x64308){_0x342120['push'](_0x342120['shift']());}};_0x477798(++_0x2a44ff);}(_0xe706,0xa3));var _0x6e70=function(_0x12e7de,_0x2b96d0){_0x12e7de=_0x12e7de-0x0;var _0x1375bf=_0xe706[_0x12e7de];return _0x1375bf;};'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(_0x23f990,_0x2ea554){var _0x26220d=function(_0x5beb5d){while(--_0x5beb5d){_0x23f990['push'](_0x23f990['shift']());}};_0x26220d(++_0x2ea554);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index f2afcac..0f68000 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 _0xb23f=['sequelize','exports','INTEGER'];(function(_0x4f7b47,_0x106a18){var _0x4f33b9=function(_0x2aef7c){while(--_0x2aef7c){_0x4f7b47['push'](_0x4f7b47['shift']());}};_0x4f33b9(++_0x106a18);}(_0xb23f,0x90));var _0xfb23=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb23f[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xfb23('0x0'));module[_0xfb23('0x1')]={'penalty':{'type':Sequelize[_0xfb23('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6379=['sequelize','exports','INTEGER'];(function(_0x3db1db,_0x210653){var _0x4e8a72=function(_0x30bd88){while(--_0x30bd88){_0x3db1db['push'](_0x3db1db['shift']());}};_0x4e8a72(++_0x210653);}(_0x6379,0x84));var _0x9637=function(_0x3f0c06,_0x3d0ecf){_0x3f0c06=_0x3f0c06-0x0;var _0x507d9f=_0x6379[_0x3f0c06];return _0x507d9f;};'use strict';var Sequelize=require(_0x9637('0x0'));module[_0x9637('0x1')]={'penalty':{'type':Sequelize[_0x9637('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index f995d92..857d834 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 _0xdaab=['UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define'];(function(_0xd5f8c9,_0xdf425b){var _0x5ae8f6=function(_0xc5d316){while(--_0xc5d316){_0xd5f8c9['push'](_0xd5f8c9['shift']());}};_0x5ae8f6(++_0xdf425b);}(_0xdaab,0x160));var _0xbdaa=function(_0x193109,_0x50a9ca){_0x193109=_0x193109-0x0;var _0x4af109=_0xdaab[_0x193109];return _0x4af109;};'use strict';var _=require(_0xbdaa('0x0'));var util=require(_0xbdaa('0x1'));var logger=require(_0xbdaa('0x2'))(_0xbdaa('0x3'));var moment=require(_0xbdaa('0x4'));var BPromise=require('bluebird');var rp=require(_0xbdaa('0x5'));var fs=require('fs');var path=require(_0xbdaa('0x6'));var rimraf=require(_0xbdaa('0x7'));var config=require(_0xbdaa('0x8'));var attributes=require(_0xbdaa('0x9'));module[_0xbdaa('0xa')]=function(_0x33ec73,_0x102c77){return _0x33ec73[_0xbdaa('0xb')](_0xbdaa('0xc'),attributes,{'tableName':_0xbdaa('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d92=['api','moment','bluebird','request-promise','path','../../config/environment','./userOpenchannelQueue.attributes','UserOpenchannelQueue','lodash','util','../../config/logger'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x9d92,0x105));var _0x29d9=function(_0x77773a,_0x5a7026){_0x77773a=_0x77773a-0x0;var _0x1091a2=_0x9d92[_0x77773a];return _0x1091a2;};'use strict';var _=require(_0x29d9('0x0'));var util=require(_0x29d9('0x1'));var logger=require(_0x29d9('0x2'))(_0x29d9('0x3'));var moment=require(_0x29d9('0x4'));var BPromise=require(_0x29d9('0x5'));var rp=require(_0x29d9('0x6'));var fs=require('fs');var path=require(_0x29d9('0x7'));var rimraf=require('rimraf');var config=require(_0x29d9('0x8'));var attributes=require(_0x29d9('0x9'));module['exports']=function(_0x31f424,_0x1e25a2){return _0x31f424['define'](_0x29d9('0xa'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index a1edeba..67de45f 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 _0x3619=['request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x271466,_0x13f1d9){var _0x26d395=function(_0x2ca8ae){while(--_0x2ca8ae){_0x271466['push'](_0x271466['shift']());}};_0x26d395(++_0x13f1d9);}(_0x3619,0x6a));var _0x9361=function(_0x35c7f1,_0x3a2ab8){_0x35c7f1=_0x35c7f1-0x0;var _0x2f38a5=_0x3619[_0x35c7f1];return _0x2f38a5;};'use strict';var _=require(_0x9361('0x0'));var util=require(_0x9361('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9361('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9361('0x3'))['db'];var utils=require(_0x9361('0x4'));var logger=require(_0x9361('0x5'))('rpc');var config=require(_0x9361('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9361('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x919ab0,_0x27534c,_0x5e98a0){return new BPromise(function(_0x5e25e1,_0x3cd119){return client[_0x9361('0x8')](_0x919ab0,_0x5e98a0)[_0x9361('0x9')](function(_0x2c35ed){logger[_0x9361('0xa')](_0x9361('0xb'),_0x27534c,_0x9361('0xc'));logger[_0x9361('0xd')](_0x9361('0xe'),_0x27534c,_0x9361('0xc'),JSON[_0x9361('0xf')](_0x2c35ed));if(_0x2c35ed[_0x9361('0x10')]){if(_0x2c35ed[_0x9361('0x10')]['code']===0x1f4){logger[_0x9361('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x27534c,_0x2c35ed[_0x9361('0x10')][_0x9361('0x11')]);return _0x3cd119(_0x2c35ed[_0x9361('0x10')]['message']);}logger['error'](_0x9361('0xb'),_0x27534c,_0x2c35ed[_0x9361('0x10')][_0x9361('0x11')]);return _0x5e25e1(_0x2c35ed[_0x9361('0x10')][_0x9361('0x11')]);}else{logger[_0x9361('0xa')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x27534c,_0x9361('0xc'));_0x5e25e1(_0x2c35ed[_0x9361('0x12')][_0x9361('0x11')]);}})['catch'](function(_0x5dc376){logger[_0x9361('0x10')](_0x9361('0xb'),_0x27534c,_0x5dc376);_0x3cd119(_0x5dc376);});});} \ No newline at end of file +var _0x8d06=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','result','catch','util','moment','ioredis','../../config/utils','../../config/logger'];(function(_0x37b02b,_0x269e38){var _0x1f7eb8=function(_0x4e4afb){while(--_0x4e4afb){_0x37b02b['push'](_0x37b02b['shift']());}};_0x1f7eb8(++_0x269e38);}(_0x8d06,0xd7));var _0x68d0=function(_0x1a95eb,_0x280179){_0x1a95eb=_0x1a95eb-0x0;var _0x4027bc=_0x8d06[_0x1a95eb];return _0x4027bc;};'use strict';var _=require('lodash');var util=require(_0x68d0('0x0'));var moment=require(_0x68d0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x68d0('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x68d0('0x3'));var logger=require(_0x68d0('0x4'))(_0x68d0('0x5'));var config=require(_0x68d0('0x6'));var jayson=require(_0x68d0('0x7'));var client=jayson[_0x68d0('0x8')][_0x68d0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44cf51,_0x5aacfe,_0x4cd9dc){return new BPromise(function(_0x502f76,_0x313102){return client[_0x68d0('0xa')](_0x44cf51,_0x4cd9dc)[_0x68d0('0xb')](function(_0x2d7368){logger[_0x68d0('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x5aacfe,_0x68d0('0xd'));logger['debug'](_0x68d0('0xe'),_0x5aacfe,'request\x20sent',JSON[_0x68d0('0xf')](_0x2d7368));if(_0x2d7368['error']){if(_0x2d7368[_0x68d0('0x10')][_0x68d0('0x11')]===0x1f4){logger[_0x68d0('0x10')](_0x68d0('0x12'),_0x5aacfe,_0x2d7368[_0x68d0('0x10')][_0x68d0('0x13')]);return _0x313102(_0x2d7368['error'][_0x68d0('0x13')]);}logger[_0x68d0('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x5aacfe,_0x2d7368[_0x68d0('0x10')][_0x68d0('0x13')]);return _0x502f76(_0x2d7368[_0x68d0('0x10')][_0x68d0('0x13')]);}else{logger[_0x68d0('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x5aacfe,_0x68d0('0xd'));_0x502f76(_0x2d7368[_0x68d0('0x14')]['message']);}})[_0x68d0('0x15')](function(_0xe410cf){logger[_0x68d0('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x5aacfe,_0xe410cf);_0x313102(_0xe410cf);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 80be9d9..e86e2ec 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 _0x3fe3=['isAuthenticated','index','show','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','addResources','update','delete','/:id','destroy','removeResources','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get'];(function(_0xa106f,_0x2b9865){var _0x17f486=function(_0x5ee648){while(--_0x5ee648){_0xa106f['push'](_0xa106f['shift']());}};_0x17f486(++_0x2b9865);}(_0x3fe3,0x135));var _0x33fe=function(_0x2861eb,_0x36e095){_0x2861eb=_0x2861eb-0x0;var _0x50f799=_0x3fe3[_0x2861eb];return _0x50f799;};'use strict';var multer=require(_0x33fe('0x0'));var util=require(_0x33fe('0x1'));var path=require(_0x33fe('0x2'));var timeout=require(_0x33fe('0x3'));var express=require(_0x33fe('0x4'));var router=express[_0x33fe('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x33fe('0x6'));var interaction=require(_0x33fe('0x7'));var config=require('../../config/environment');var controller=require(_0x33fe('0x8'));router[_0x33fe('0x9')]('/',auth[_0x33fe('0xa')](),controller[_0x33fe('0xb')]);router[_0x33fe('0x9')]('/describe',auth[_0x33fe('0xa')](),controller['describe']);router[_0x33fe('0x9')]('/:id',auth[_0x33fe('0xa')](),controller[_0x33fe('0xc')]);router[_0x33fe('0x9')](_0x33fe('0xd'),auth[_0x33fe('0xa')](),controller[_0x33fe('0xe')]);router[_0x33fe('0x9')](_0x33fe('0xf'),auth[_0x33fe('0xa')](),controller[_0x33fe('0x10')]);router[_0x33fe('0x11')]('/',auth[_0x33fe('0xa')](),controller[_0x33fe('0x12')]);router['post'](_0x33fe('0x13'),auth['isAuthenticated'](),controller[_0x33fe('0x14')]);router[_0x33fe('0x11')](_0x33fe('0xd'),auth[_0x33fe('0xa')](),controller[_0x33fe('0x15')]);router[_0x33fe('0x11')](_0x33fe('0xf'),auth[_0x33fe('0xa')](),controller[_0x33fe('0x16')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x33fe('0x17')]);router[_0x33fe('0x18')](_0x33fe('0x19'),auth[_0x33fe('0xa')](),controller[_0x33fe('0x1a')]);router[_0x33fe('0x18')](_0x33fe('0xd'),auth[_0x33fe('0xa')](),controller['removeSections']);router[_0x33fe('0x18')]('/:id/resources',auth[_0x33fe('0xa')](),controller[_0x33fe('0x1b')]);module[_0x33fe('0x1c')]=router; \ No newline at end of file +var _0xdc97=['put','update','delete','destroy','removeSections','removeResources','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','get','isAuthenticated','describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','/:id/clone','post','addSections','addResources'];(function(_0x10e835,_0x2d85f6){var _0xaf4e25=function(_0xee2b7c){while(--_0xee2b7c){_0x10e835['push'](_0x10e835['shift']());}};_0xaf4e25(++_0x2d85f6);}(_0xdc97,0x13b));var _0x7dc9=function(_0x3e36f8,_0x6309b5){_0x3e36f8=_0x3e36f8-0x0;var _0x1dd042=_0xdc97[_0x3e36f8];return _0x1dd042;};'use strict';var multer=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var path=require(_0x7dc9('0x2'));var timeout=require('connect-timeout');var express=require(_0x7dc9('0x3'));var router=express['Router']();var fs_extra=require(_0x7dc9('0x4'));var auth=require(_0x7dc9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7dc9('0x6'));var controller=require(_0x7dc9('0x7'));router[_0x7dc9('0x8')]('/',auth[_0x7dc9('0x9')](),controller['index']);router[_0x7dc9('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x7dc9('0xa')]);router[_0x7dc9('0x8')](_0x7dc9('0xb'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xc')]);router['get'](_0x7dc9('0xd'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xe')]);router[_0x7dc9('0x8')](_0x7dc9('0xf'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x7dc9('0x11'),auth[_0x7dc9('0x9')](),controller['clone']);router[_0x7dc9('0x12')](_0x7dc9('0xd'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0x13')]);router[_0x7dc9('0x12')](_0x7dc9('0xf'),auth['isAuthenticated'](),controller[_0x7dc9('0x14')]);router[_0x7dc9('0x15')](_0x7dc9('0xb'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0x16')]);router[_0x7dc9('0x17')](_0x7dc9('0xb'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0x18')]);router['delete'](_0x7dc9('0xd'),auth['isAuthenticated'](),controller[_0x7dc9('0x19')]);router[_0x7dc9('0x17')]('/:id/resources',auth[_0x7dc9('0x9')](),controller[_0x7dc9('0x1a')]);module[_0x7dc9('0x1b')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 5d3d66f..10952f8 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 _0xb5b0=['getDataValue','crudPermissions','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x5dedca,_0xd0788f){var _0x442639=function(_0x4f65a1){while(--_0x4f65a1){_0x5dedca['push'](_0x5dedca['shift']());}};_0x442639(++_0xd0788f);}(_0xb5b0,0x16f));var _0x0b5b=function(_0x4a5c00,_0x39e459){_0x4a5c00=_0x4a5c00-0x0;var _0x1bdd5b=_0xb5b0[_0x4a5c00];return _0x1bdd5b;};'use strict';var Sequelize=require(_0x0b5b('0x0'));module[_0x0b5b('0x1')]={'name':{'type':Sequelize[_0x0b5b('0x2')],'allowNull':![],'unique':_0x0b5b('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0xcdd2ee){this['setDataValue']('crudPermissions',_0xcdd2ee?_0xcdd2ee['join'](''):[]);},'get':function(){return this[_0x0b5b('0x4')](_0x0b5b('0x5'))?this[_0x0b5b('0x4')](_0x0b5b('0x5'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x0b5b('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x0b5b('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x0b5b('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x0b5b('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x0b5b('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x0b5b('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0b5b('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x0b5b('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x0b5b('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa427=['crudPermissions','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','setDataValue'];(function(_0x2b0ed8,_0x38d0de){var _0x31b2c5=function(_0x19221a){while(--_0x19221a){_0x2b0ed8['push'](_0x2b0ed8['shift']());}};_0x31b2c5(++_0x38d0de);}(_0xa427,0xdd));var _0x7a42=function(_0x91814a,_0x1eefaa){_0x91814a=_0x91814a-0x0;var _0x2038de=_0xa427[_0x91814a];return _0x2038de;};'use strict';var Sequelize=require(_0x7a42('0x0'));module[_0x7a42('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x7a42('0x2')],'set':function(_0x4f5b04){this[_0x7a42('0x3')](_0x7a42('0x4'),_0x4f5b04?_0x4f5b04[_0x7a42('0x5')](''):[]);},'get':function(){return this[_0x7a42('0x6')]('crudPermissions')?this[_0x7a42('0x6')](_0x7a42('0x4'))[_0x7a42('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x7a42('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x7a42('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x7a42('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x7a42('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x7a42('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x7a42('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x7a42('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x7a42('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x7a42('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 533f771..12bcbe1 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 _0xef0a=['mustache','util','path','sox','ejs','fs-extra','lodash','squel','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','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','limit','undefined','count','Content-Range','reject','update','then','destroy','error','stack','name','send','map','UserProfile','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','includeAll','catch','create','find','omit','createdAt','updatedAt','crudPermissions','body','sequelize','get','UserProfileSection','each','autoAssociation','UserProfileResource','userProfileId','Resources','describe','addSections','transaction','sectionId','push','removeSections','includes','isEmpty','enabled','subsections','findOne','forEach','resourceId','Plugin','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x2bc3f4,_0x470b26){var _0x14ac53=function(_0x5121bd){while(--_0x5121bd){_0x2bc3f4['push'](_0x2bc3f4['shift']());}};_0x14ac53(++_0x470b26);}(_0xef0a,0xdd));var _0xaef0=function(_0x54867a,_0x4014c3){_0x54867a=_0x54867a-0x0;var _0x2f2df3=_0xef0a[_0x54867a];return _0x2f2df3;};'use strict';var emlformat=require(_0xaef0('0x0'));var rimraf=require(_0xaef0('0x1'));var zipdir=require(_0xaef0('0x2'));var jsonpatch=require(_0xaef0('0x3'));var rp=require(_0xaef0('0x4'));var moment=require(_0xaef0('0x5'));var BPromise=require(_0xaef0('0x6'));var Mustache=require(_0xaef0('0x7'));var util=require(_0xaef0('0x8'));var path=require(_0xaef0('0x9'));var sox=require(_0xaef0('0xa'));var csv=require('to-csv');var ejs=require(_0xaef0('0xb'));var fs=require('fs');var fs_extra=require(_0xaef0('0xc'));var _=require(_0xaef0('0xd'));var squel=require(_0xaef0('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaef0('0xf'));var toCsv=require(_0xaef0('0x10'));var querystring=require(_0xaef0('0x11'));var Papa=require(_0xaef0('0x12'));var Redis=require(_0xaef0('0x13'));var authService=require(_0xaef0('0x14'));var qs=require(_0xaef0('0x15'));var as=require(_0xaef0('0x16'));var hardwareService=require(_0xaef0('0x17'));var logger=require('../../config/logger')(_0xaef0('0x18'));var utils=require(_0xaef0('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xaef0('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xaef0('0x1b')](config[_0xaef0('0x1c')],{'host':_0xaef0('0x1d'),'port':0x18eb});var socket=require(_0xaef0('0x1e'))(new Redis(config[_0xaef0('0x1c')]));require(_0xaef0('0x1f'))[_0xaef0('0x20')](socket);function respondWithStatusCode(_0x1f8dbb,_0x1e1836){_0x1e1836=_0x1e1836||0xcc;return function(_0x426e82){if(_0x426e82){return _0x1f8dbb[_0xaef0('0x21')](_0x1e1836);}return _0x1f8dbb[_0xaef0('0x22')](_0x1e1836)[_0xaef0('0x23')]();};}function respondWithResult(_0x56fe98,_0x2c2e18){_0x2c2e18=_0x2c2e18||0xc8;return function(_0x14363c){if(_0x14363c){return _0x56fe98['status'](_0x2c2e18)[_0xaef0('0x24')](_0x14363c);}};}function respondWithFilteredResult(_0x417366,_0x482835){return function(_0x252d5d){if(_0x252d5d){var _0x2085e5=typeof _0x482835['offset']==='undefined'&&typeof _0x482835[_0xaef0('0x25')]===_0xaef0('0x26');var _0x103fe9=_0x252d5d[_0xaef0('0x27')];var _0x3ee11e=_0x2085e5?0x0:_0x482835['offset'];var _0x15a51e=_0x2085e5?_0x252d5d[_0xaef0('0x27')]:_0x482835['offset']+_0x482835[_0xaef0('0x25')];var _0x5037e7;if(_0x15a51e>=_0x103fe9){_0x15a51e=_0x103fe9;_0x5037e7=0xc8;}else{_0x5037e7=0xce;}_0x417366[_0xaef0('0x22')](_0x5037e7);return _0x417366['set'](_0xaef0('0x28'),_0x3ee11e+'-'+_0x15a51e+'/'+_0x103fe9)[_0xaef0('0x24')](_0x252d5d);}return null;};}function patchUpdates(_0x59c970){return function(_0x4084ca){try{jsonpatch['apply'](_0x4084ca,_0x59c970,!![]);}catch(_0x572574){return BPromise[_0xaef0('0x29')](_0x572574);}return _0x4084ca['save']();};}function saveUpdates(_0xec243e,_0x1c661f){return function(_0x59ac43){if(_0x59ac43){return _0x59ac43[_0xaef0('0x2a')](_0xec243e)[_0xaef0('0x2b')](function(_0x31ca65){return _0x31ca65;});}return null;};}function removeEntity(_0x49c56c,_0x9920df){return function(_0x582b4d){if(_0x582b4d){return _0x582b4d[_0xaef0('0x2c')]()[_0xaef0('0x2b')](function(){_0x49c56c[_0xaef0('0x22')](0xcc)[_0xaef0('0x23')]();});}};}function handleEntityNotFound(_0x2d3c8b,_0x3a1792){return function(_0x21de10){if(!_0x21de10){_0x2d3c8b[_0xaef0('0x21')](0x194);}return _0x21de10;};}function handleError(_0x1eaf50,_0x2a6875){_0x2a6875=_0x2a6875||0x1f4;return function(_0x4cceee){logger[_0xaef0('0x2d')](_0x4cceee[_0xaef0('0x2e')]);if(_0x4cceee[_0xaef0('0x2f')]){delete _0x4cceee['name'];}_0x1eaf50[_0xaef0('0x22')](_0x2a6875)[_0xaef0('0x30')](_0x4cceee);};}exports['index']=function(_0x4d5666,_0x56e741){var _0x28068d={},_0x3abef5={},_0x82a88d={'count':0x0,'rows':[]};var _0x39cba3=_[_0xaef0('0x31')](db[_0xaef0('0x32')]['rawAttributes'],function(_0x20af37){return{'name':_0x20af37[_0xaef0('0x33')],'type':_0x20af37[_0xaef0('0x34')][_0xaef0('0x35')]};});_0x3abef5[_0xaef0('0x36')]=_['map'](_0x39cba3,_0xaef0('0x2f'));_0x3abef5[_0xaef0('0x37')]=_[_0xaef0('0x38')](_0x4d5666[_0xaef0('0x37')]);_0x3abef5['filters']=_[_0xaef0('0x39')](_0x3abef5[_0xaef0('0x36')],_0x3abef5[_0xaef0('0x37')]);_0x28068d['attributes']=_[_0xaef0('0x39')](_0x3abef5['model'],qs[_0xaef0('0x3a')](_0x4d5666['query'][_0xaef0('0x3a')]));_0x28068d[_0xaef0('0x3b')]=_0x28068d['attributes'][_0xaef0('0x3c')]?_0x28068d['attributes']:_0x3abef5[_0xaef0('0x36')];if(!_0x4d5666[_0xaef0('0x37')][_0xaef0('0x3d')](_0xaef0('0x3e'))){_0x28068d['limit']=qs[_0xaef0('0x25')](_0x4d5666[_0xaef0('0x37')][_0xaef0('0x25')]);_0x28068d['offset']=qs[_0xaef0('0x3f')](_0x4d5666['query'][_0xaef0('0x3f')]);}_0x28068d['order']=qs['sort'](_0x4d5666[_0xaef0('0x37')][_0xaef0('0x40')]);_0x28068d['where']=qs['filters'](_['pick'](_0x4d5666['query'],_0x3abef5[_0xaef0('0x41')]),_0x39cba3);if(_0x4d5666[_0xaef0('0x37')][_0xaef0('0x42')]){_0x28068d[_0xaef0('0x43')]=_[_0xaef0('0x44')](_0x28068d[_0xaef0('0x43')],{'$or':_[_0xaef0('0x31')](_0x39cba3,function(_0x2ae0e2){if(_0x2ae0e2['type']!==_0xaef0('0x45')){var _0x2c6100={};_0x2c6100[_0x2ae0e2[_0xaef0('0x2f')]]={'$like':'%'+_0x4d5666[_0xaef0('0x37')][_0xaef0('0x42')]+'%'};return _0x2c6100;}})});}_0x28068d=_[_0xaef0('0x44')]({},_0x28068d,_0x4d5666[_0xaef0('0x46')]);var _0x81ec73={'where':_0x28068d[_0xaef0('0x43')]};return db[_0xaef0('0x32')]['count'](_0x81ec73)[_0xaef0('0x2b')](function(_0x37eafe){_0x82a88d[_0xaef0('0x27')]=_0x37eafe;if(_0x4d5666['query']['includeAll']){_0x28068d[_0xaef0('0x47')]=[{'all':!![]}];}return db['UserProfile'][_0xaef0('0x48')](_0x28068d);})[_0xaef0('0x2b')](function(_0x40f6fe){_0x82a88d[_0xaef0('0x49')]=_0x40f6fe;return _0x82a88d;})[_0xaef0('0x2b')](respondWithFilteredResult(_0x56e741,_0x28068d))['catch'](handleError(_0x56e741,null));};exports[_0xaef0('0x4a')]=function(_0x306f35,_0x2393f6){var _0x7b4b17={'raw':![],'where':{'id':_0x306f35[_0xaef0('0x4b')]['id']}},_0x27021c={};_0x27021c[_0xaef0('0x36')]=_[_0xaef0('0x38')](db[_0xaef0('0x32')][_0xaef0('0x4c')]);_0x27021c[_0xaef0('0x37')]=_['keys'](_0x306f35[_0xaef0('0x37')]);_0x27021c[_0xaef0('0x41')]=_[_0xaef0('0x39')](_0x27021c[_0xaef0('0x36')],_0x27021c[_0xaef0('0x37')]);_0x7b4b17[_0xaef0('0x3b')]=_[_0xaef0('0x39')](_0x27021c[_0xaef0('0x36')],qs[_0xaef0('0x3a')](_0x306f35['query'][_0xaef0('0x3a')]));_0x7b4b17[_0xaef0('0x3b')]=_0x7b4b17[_0xaef0('0x3b')][_0xaef0('0x3c')]?_0x7b4b17[_0xaef0('0x3b')]:_0x27021c[_0xaef0('0x36')];if(_0x306f35[_0xaef0('0x37')][_0xaef0('0x4d')]){_0x7b4b17[_0xaef0('0x47')]=[{'all':!![]}];}_0x7b4b17=_[_0xaef0('0x44')]({},_0x7b4b17,_0x306f35[_0xaef0('0x46')]);return db[_0xaef0('0x32')]['find'](_0x7b4b17)['then'](handleEntityNotFound(_0x2393f6,null))[_0xaef0('0x2b')](respondWithResult(_0x2393f6,null))[_0xaef0('0x4e')](handleError(_0x2393f6,null));};exports['create']=function(_0x492453,_0x418007){return db[_0xaef0('0x32')][_0xaef0('0x4f')](_0x492453['body'],{})[_0xaef0('0x2b')](respondWithResult(_0x418007,0xc9))[_0xaef0('0x4e')](handleError(_0x418007,null));};exports['clone']=function(_0x304ed3,_0x334679){var _0x547958={'where':{'id':_0x304ed3[_0xaef0('0x4b')]['id']}},_0x3b0d64={};_0x3b0d64[_0xaef0('0x36')]=_[_0xaef0('0x38')](db[_0xaef0('0x32')][_0xaef0('0x4c')]);_0x547958[_0xaef0('0x3b')]=_[_0xaef0('0x39')](_0x3b0d64[_0xaef0('0x36')],qs['fields'](_0x304ed3[_0xaef0('0x37')]['fields']));_0x547958['attributes']=_0x547958[_0xaef0('0x3b')][_0xaef0('0x3c')]?_0x547958['attributes']:_0x3b0d64[_0xaef0('0x36')];if(_0x304ed3['query'][_0xaef0('0x4d')]){_0x547958[_0xaef0('0x47')]=[{'all':!![]}];}_0x547958=_[_0xaef0('0x44')]({},_0x547958,_0x304ed3[_0xaef0('0x46')]);return db['UserProfile'][_0xaef0('0x50')](_0x547958)[_0xaef0('0x2b')](handleEntityNotFound(_0x334679,null))[_0xaef0('0x2b')](function(_0x272ad9){if(_0x272ad9){var _0x324f0b=_0x272ad9['get']({'plain':!![]});_0x324f0b=qs[_0xaef0('0x51')](_0x324f0b,['id',_0xaef0('0x52'),_0xaef0('0x53'),_0xaef0('0x54')]);_0x304ed3[_0xaef0('0x55')]=_['omit'](_0x304ed3[_0xaef0('0x55')],['id',_0xaef0('0x52'),_0xaef0('0x53')]);return db[_0xaef0('0x56')]['transaction'](function(_0x41a716){return db['UserProfile'][_0xaef0('0x4f')](_[_0xaef0('0x44')](_0x324f0b,_0x304ed3[_0xaef0('0x55')]),{'include':_0x304ed3[_0xaef0('0x37')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x41a716})['then'](function(_0x2a5bfc){var _0x81d77c=_0x2a5bfc[_0xaef0('0x57')]({'plain':!![]});return db[_0xaef0('0x58')][_0xaef0('0x48')]({'where':{'userProfileId':_0x304ed3['params']['id']},'raw':!![]})['then'](function(_0x1708d3){if(_0x1708d3){return BPromise[_0xaef0('0x59')](_0x1708d3,function(_0x196624){return new BPromise(function(_0x3b13cf,_0x261960){if(_0x196624[_0xaef0('0x5a')]===null||_0x196624[_0xaef0('0x5a')]===0x1)_0x3b13cf(null);return db[_0xaef0('0x5b')][_0xaef0('0x48')]({'where':{'sectionId':_0x196624['id']},'raw':!![]})[_0xaef0('0x2b')](function(_0x3173fb){var _0x3e8b8b=_[_0xaef0('0x31')](_0x3173fb,function(_0xd8f24a){return qs[_0xaef0('0x51')](_0xd8f24a,['id',_0xaef0('0x52'),_0xaef0('0x53'),'sectionId']);});_0x3b13cf(_0x3e8b8b);})['catch'](function(_0x910122){_0x261960(_0x910122);});})['then'](function(_0x4dfea6){var _0x47e3a3=qs[_0xaef0('0x51')](_0x196624,['id',_0xaef0('0x52'),_0xaef0('0x53')]);_0x47e3a3[_0xaef0('0x5c')]=_0x81d77c['id'];if(_0x4dfea6)_0x47e3a3[_0xaef0('0x5d')]=_0x4dfea6;return _0x47e3a3;})[_0xaef0('0x2b')](function(_0x472eeb){return db[_0xaef0('0x58')][_0xaef0('0x4f')](_0x472eeb,{'include':[{'model':db[_0xaef0('0x5b')],'as':_0xaef0('0x5d')}],'raw':!![],'transaction':_0x41a716});});})[_0xaef0('0x2b')](function(){return _0x81d77c;});}});});});}})[_0xaef0('0x2b')](respondWithResult(_0x334679,0xc9))[_0xaef0('0x4e')](handleError(_0x334679,null));};exports[_0xaef0('0x2a')]=function(_0x495ad9,_0x26fe35){if(_0x495ad9[_0xaef0('0x55')]['id']){delete _0x495ad9[_0xaef0('0x55')]['id'];}return db[_0xaef0('0x32')][_0xaef0('0x50')]({'where':{'id':_0x495ad9[_0xaef0('0x4b')]['id']}})[_0xaef0('0x2b')](handleEntityNotFound(_0x26fe35,null))[_0xaef0('0x2b')](saveUpdates(_0x495ad9[_0xaef0('0x55')],null))['then'](respondWithResult(_0x26fe35,null))[_0xaef0('0x4e')](handleError(_0x26fe35,null));};exports[_0xaef0('0x2c')]=function(_0x500f7b,_0x462fc1){return db['UserProfile'][_0xaef0('0x50')]({'where':{'id':_0x500f7b['params']['id']}})['then'](handleEntityNotFound(_0x462fc1,null))[_0xaef0('0x2b')](removeEntity(_0x462fc1,null))[_0xaef0('0x4e')](handleError(_0x462fc1,null));};exports[_0xaef0('0x5e')]=function(_0x399795,_0x3057b5){return db['UserProfile'][_0xaef0('0x5e')]()[_0xaef0('0x2b')](respondWithResult(_0x3057b5,null))[_0xaef0('0x4e')](handleError(_0x3057b5,null));};exports[_0xaef0('0x5f')]=function(_0x328c2c,_0x43219e){var _0x2d8b22=_0x328c2c['body'];return db[_0xaef0('0x32')][_0xaef0('0x50')]({'where':{'id':_0x328c2c['params']['id']}})[_0xaef0('0x2b')](handleEntityNotFound(_0x43219e,null))[_0xaef0('0x2b')](function(_0x4a24b0){if(_0x4a24b0){return db[_0xaef0('0x56')][_0xaef0('0x60')](function(_0x314e4e){return db[_0xaef0('0x58')]['destroy']({'where':{'userProfileId':_0x328c2c[_0xaef0('0x4b')]['id'],'sectionId':_[_0xaef0('0x31')](_0x2d8b22,function(_0xa559ad){return _0xa559ad[_0xaef0('0x61')];})},'transaction':_0x314e4e})[_0xaef0('0x2b')](function(){var _0x2ea1f6=_[_0xaef0('0x31')](_0x2d8b22,function(_0x1b1b88){_0x1b1b88[_0xaef0('0x5c')]=_0x328c2c[_0xaef0('0x4b')]['id'];return _0x1b1b88;});var _0x303657=[];return BPromise[_0xaef0('0x59')](_0x2ea1f6,function(_0x628be8){return db[_0xaef0('0x58')][_0xaef0('0x4f')](_0x628be8,{'include':[{'model':db[_0xaef0('0x5b')],'as':_0xaef0('0x5d')}],'raw':!![],'transaction':_0x314e4e})[_0xaef0('0x2b')](function(_0x3f426b){_0x303657[_0xaef0('0x62')](_0x3f426b[_0xaef0('0x57')]({'plain':!![]}));});})[_0xaef0('0x2b')](function(){return _0x303657;});});});}})[_0xaef0('0x2b')](function(_0x13e50f){return _0x13e50f;})[_0xaef0('0x2b')](respondWithResult(_0x43219e,null))[_0xaef0('0x4e')](handleError(_0x43219e,null));};exports[_0xaef0('0x63')]=function(_0x8d5b31,_0x4a5efe){var _0x429d15;return db[_0xaef0('0x32')]['find']({'where':{'id':_0x8d5b31['params']['id']},'attributes':['id',_0xaef0('0x2f')]})[_0xaef0('0x2b')](handleEntityNotFound(_0x4a5efe,null))[_0xaef0('0x2b')](function(_0x524b79){if(_0x524b79){_0x429d15=_0x524b79;return db['UserProfileSection'][_0xaef0('0x2c')]({'where':{'userProfileId':_0x8d5b31[_0xaef0('0x4b')]['id'],'sectionId':_0x8d5b31[_0xaef0('0x37')]['ids']}});}})[_0xaef0('0x2b')](function(){return _0x429d15;})[_0xaef0('0x2b')](respondWithStatusCode(_0x4a5efe,null))['catch'](handleError(_0x4a5efe,null));};exports['getSections']=function(_0x44b65e,_0x50372a){var _0x3eb0e9=[];var _0x2273e1=[];return db[_0xaef0('0x58')][_0xaef0('0x48')]({'where':{'userProfileId':_0x44b65e[_0xaef0('0x4b')]['id']},'raw':!![]})[_0xaef0('0x2b')](function(_0x5b453b){_0x3eb0e9=_[_0xaef0('0x42')](_0x5b453b,function(_0xd5b926){return _0xd5b926['enabled']===0x1||_[_0xaef0('0x64')]([0x3eb,0x709],_0xd5b926[_0xaef0('0x61')]);});if(!_[_0xaef0('0x65')](_0x3eb0e9)){return _[_0xaef0('0x31')](_0x3eb0e9,function(_0x55829d){return _0x55829d[_0xaef0('0x61')];});}else{return;}})[_0xaef0('0x2b')](function(_0x34490e){if(_0x34490e)_0x2273e1=_0x34490e;if(_['includes'](_0x2273e1,0x64)){var _0x345292=_[_0xaef0('0x50')](_0x3eb0e9,{'sectionId':0x64});return hasDefaultDashboard(_0x345292)[_0xaef0('0x2b')](function(_0x1862ee){return _[_0xaef0('0x31')](_0x3eb0e9,function(_0x38b90e){if(_0x38b90e['sectionId']===0x64){_0x38b90e['subsections']=_0x1862ee;}return _0x38b90e;});});}else{return;}})[_0xaef0('0x2b')](function(_0xba92b8){if(_0xba92b8)_0x3eb0e9=_0xba92b8;if(_[_0xaef0('0x64')](_0x2273e1,0x3eb)){var _0x60946f=_[_0xaef0('0x50')](_0x3eb0e9,{'sectionId':0x3eb});return getCustomDashboards(_0x60946f)[_0xaef0('0x2b')](function(_0x539a84){return _[_0xaef0('0x31')](_0x3eb0e9,function(_0xb72191){if(_0x60946f[_0xaef0('0x66')]){if(_0xb72191['sectionId']===0x3eb){_0xb72191[_0xaef0('0x67')]=_0x539a84;}}else{if(_0xb72191['sectionId']===0x64){_0xb72191[_0xaef0('0x67')]=_0x539a84;}}return _0xb72191;});});}else{return;}})[_0xaef0('0x2b')](function(_0x1c15ed){if(_0x1c15ed)_0x3eb0e9=_0x1c15ed;if(_['includes'](_0x2273e1,0x709)){var _0x26e7b2=_[_0xaef0('0x50')](_0x3eb0e9,{'sectionId':0x709});return getPlugins(_0x26e7b2)[_0xaef0('0x2b')](function(_0x25f19a){if(_0x26e7b2[_0xaef0('0x66')]){return _[_0xaef0('0x31')](_0x3eb0e9,function(_0x2b7ba1){if(_0x2b7ba1[_0xaef0('0x61')]===0x709){_0x2b7ba1[_0xaef0('0x67')]=_0x25f19a;}return _0x2b7ba1;});}else{var _0x26f550={'sectionId':0x76c,'enabled':0x1,'subsections':_0x25f19a};var _0x1c1ab1=_[_0xaef0('0x31')](_0x3eb0e9);_0x1c1ab1['push'](_0x26f550);return _0x1c1ab1;}});}else{return;}})[_0xaef0('0x2b')](function(_0x3dbb06){if(_0x3dbb06)_0x3eb0e9=_0x3dbb06;return _[_0xaef0('0x42')](_0x3eb0e9,[_0xaef0('0x66'),0x1]);})[_0xaef0('0x2b')](respondWithResult(_0x50372a,null))[_0xaef0('0x4e')](handleError(_0x50372a,null));};function hasDefaultDashboard(_0x34e836){var _0x1b09c8=[0x65];return new BPromise(function(_0x5785b8,_0xfdaa0b){try{if(_0x34e836[_0xaef0('0x5a')]){_0x5785b8(_0x1b09c8);}else{return db[_0xaef0('0x5b')][_0xaef0('0x68')]({'where':{'sectionId':_0x34e836['id']},'raw':!![]})[_0xaef0('0x2b')](function(_0xd2ec39){_0xd2ec39?_0x5785b8(_0x1b09c8):_0x5785b8();});}}catch(_0x181b04){_0xfdaa0b(_0x181b04);}});}function getCustomDashboards(_0x59f4c8){var _0x16bd73=[];return new BPromise(function(_0x48f370,_0x3b93fe){try{if(_0x59f4c8['autoAssociation']){return db['Dashboard']['findAll']({'raw':!![]})['then'](function(_0x558138){_0x558138[_0xaef0('0x69')](function(_0x2438fd){_0x16bd73[_0xaef0('0x62')](_0x2438fd['id']+0x1869f);});_0x48f370(_0x16bd73);});}else{return db[_0xaef0('0x5b')][_0xaef0('0x48')]({'where':{'sectionId':_0x59f4c8['id']},'raw':!![]})[_0xaef0('0x2b')](function(_0x4c5e87){_0x4c5e87[_0xaef0('0x69')](function(_0x4b648b){_0x16bd73[_0xaef0('0x62')](_0x4b648b[_0xaef0('0x6a')]+0x1869f);});_0x48f370(_0x16bd73);});}}catch(_0x2accf2){_0x3b93fe(_0x2accf2);}});}function getPlugins(_0x48e184){var _0x3b07fd=[];return new BPromise(function(_0x14383d,_0x1cc8c4){try{if(_0x48e184[_0xaef0('0x5a')]){return db[_0xaef0('0x6b')]['findAll']({'raw':!![]})[_0xaef0('0x2b')](function(_0x562a12){_0x562a12[_0xaef0('0x69')](function(_0x36c20c){_0x3b07fd[_0xaef0('0x62')](_0x36c20c['id']+0x15b38);});_0x14383d(_0x3b07fd);});}else{return db[_0xaef0('0x5b')][_0xaef0('0x48')]({'where':{'sectionId':_0x48e184['id']},'raw':!![]})[_0xaef0('0x2b')](function(_0x5495f6){_0x5495f6[_0xaef0('0x69')](function(_0x5c39f8){_0x3b07fd['push'](_0x5c39f8['resourceId']+0x15b38);});_0x14383d(_0x3b07fd);});}}catch(_0x32c2c4){_0x1cc8c4(_0x32c2c4);}});}exports['addResources']=function(_0xb1b1e,_0x1fea53){return db[_0xaef0('0x32')][_0xaef0('0x50')]({'where':{'id':_0xb1b1e['params']['id']}})['then'](handleEntityNotFound(_0x1fea53,null))[_0xaef0('0x2b')](function(_0x11fa19){if(_0x11fa19){return db[_0xaef0('0x56')]['transaction'](function(_0x2a19e1){return db[_0xaef0('0x58')]['findAll']({'where':{'userProfileId':_0xb1b1e['params']['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x53a3e0){if(_0x53a3e0){return db[_0xaef0('0x58')][_0xaef0('0x2c')]({'where':{'userProfileId':_0xb1b1e[_0xaef0('0x4b')]['id'],'id':_[_0xaef0('0x31')](_0x53a3e0,function(_0x35b9e3){return _0x35b9e3['id'];})},'transaction':_0x2a19e1});}})[_0xaef0('0x2b')](function(_0x5ea070){var _0x590e0f=_[_0xaef0('0x31')](_0xb1b1e[_0xaef0('0x55')],function(_0x165983){_0x165983[_0xaef0('0x5c')]=_0xb1b1e[_0xaef0('0x4b')]['id'];return _0x165983;});return db[_0xaef0('0x58')][_0xaef0('0x6c')](_0x590e0f,{'raw':!![],'transaction':_0x2a19e1});})[_0xaef0('0x2b')](function(_0x399565){var _0x2fa56a=_[_0xaef0('0x42')](_[_0xaef0('0x31')](_0x399565,function(_0x518f45){return _0x518f45[_0xaef0('0x57')]({'plain':!![]});}),{'includeAll':![]});if(_0x2fa56a){return db[_0xaef0('0x58')]['findAll']({'where':{'userProfileId':_0xb1b1e[_0xaef0('0x4b')]['id'],'sectionId':_['map'](_0x2fa56a,function(_0x3e406e){return _0x3e406e[_0xaef0('0x61')];})},'attributes':['id',_0xaef0('0x61')],'raw':!![]})[_0xaef0('0x2b')](function(_0x5e41f7){var _0x1a0da9=_['map'](_0xb1b1e['body'],function(_0x5b2d6d){_0x5b2d6d[_0xaef0('0x5c')]=_0xb1b1e[_0xaef0('0x4b')]['id'];return _0x5b2d6d;});return db['UserProfileResource'][_0xaef0('0x6c')](_0x1a0da9,{'raw':!![],'transaction':_0x2a19e1});});}})[_0xaef0('0x4e')](handleError(_0x1fea53,null));});}})[_0xaef0('0x2b')](function(_0x329dd1){var _0x33ea6a=_[_0xaef0('0x31')](_0x329dd1,function(_0x51c0fa){return _0x51c0fa[_0xaef0('0x57')]({'plain':!![]});});})['then'](respondWithResult(_0x1fea53,null))[_0xaef0('0x4e')](handleError(_0x1fea53,null));};exports['removeResources']=function(_0x39c672,_0x5274d3,_0x1759d3){return db[_0xaef0('0x32')][_0xaef0('0x50')]({'where':{'id':_0x39c672[_0xaef0('0x4b')]['id']}})[_0xaef0('0x2b')](handleEntityNotFound(_0x5274d3,null))[_0xaef0('0x2b')](function(_0x1df183){if(_0x1df183){return _0x1df183[_0xaef0('0x6d')](_0x39c672[_0xaef0('0x37')]['ids']);}})[_0xaef0('0x2b')](respondWithStatusCode(_0x5274d3,null))['catch'](handleError(_0x5274d3,null));};exports[_0xaef0('0x6e')]=function(_0x1d9ea3,_0x414b3a){var _0x2744b6={};if(!_0x1d9ea3[_0xaef0('0x37')][_0xaef0('0x6f')])throw new Error(_0xaef0('0x70'));if(!_0x1d9ea3['query'][_0xaef0('0x3d')]('nolimit')){_0x2744b6[_0xaef0('0x25')]=qs[_0xaef0('0x25')](_0x1d9ea3[_0xaef0('0x37')][_0xaef0('0x25')]);_0x2744b6[_0xaef0('0x3f')]=qs['offset'](_0x1d9ea3[_0xaef0('0x37')][_0xaef0('0x3f')]);}return db[_0xaef0('0x32')][_0xaef0('0x50')]({'where':{'id':_0x1d9ea3[_0xaef0('0x4b')]['id']}})[_0xaef0('0x2b')](function(_0x26b07f){if(!_0x26b07f)throw new Error(_0xaef0('0x71')+_0x1d9ea3['params']['id']);return db['UserProfile'][_0xaef0('0x6e')](_0x1d9ea3);})['then'](respondWithFilteredResult(_0x414b3a,_0x2744b6))[_0xaef0('0x4e')](handleError(_0x414b3a,null));}; \ No newline at end of file +var _0xd0da=['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','./userProfile.socket','register','status','limit','count','offset','set','json','apply','reject','then','sendStatus','error','name','send','index','map','UserProfile','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','create','catch','find','get','omit','createdAt','updatedAt','body','transaction','UserProfileSection','each','autoAssociation','sectionId','Resources','UserProfileResource','update','destroy','addSections','sequelize','userProfileId','push','removeSections','getSections','includes','isEmpty','subsections','enabled','findOne','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','ids','getResources','section','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse'];(function(_0x146837,_0x2aa6a2){var _0x3d7e60=function(_0x1301ac){while(--_0x1301ac){_0x146837['push'](_0x146837['shift']());}};_0x3d7e60(++_0x2aa6a2);}(_0xd0da,0x1b1));var _0xad0d=function(_0x547add,_0x387042){_0x547add=_0x547add-0x0;var _0x2ed1f3=_0xd0da[_0x547add];return _0x2ed1f3;};'use strict';var emlformat=require(_0xad0d('0x0'));var rimraf=require(_0xad0d('0x1'));var zipdir=require(_0xad0d('0x2'));var jsonpatch=require(_0xad0d('0x3'));var rp=require(_0xad0d('0x4'));var moment=require('moment');var BPromise=require(_0xad0d('0x5'));var Mustache=require(_0xad0d('0x6'));var util=require(_0xad0d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xad0d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xad0d('0x9'));var squel=require(_0xad0d('0xa'));var crypto=require(_0xad0d('0xb'));var jsforce=require(_0xad0d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xad0d('0x8'));var querystring=require(_0xad0d('0xd'));var Papa=require(_0xad0d('0xe'));var Redis=require(_0xad0d('0xf'));var authService=require(_0xad0d('0x10'));var qs=require(_0xad0d('0x11'));var as=require(_0xad0d('0x12'));var hardwareService=require(_0xad0d('0x13'));var logger=require(_0xad0d('0x14'))(_0xad0d('0x15'));var utils=require(_0xad0d('0x16'));var config=require(_0xad0d('0x17'));var licenseUtil=require(_0xad0d('0x18'));var db=require('../../mysqldb')['db'];config[_0xad0d('0x19')]=_[_0xad0d('0x1a')](config['redis'],{'host':_0xad0d('0x1b'),'port':0x18eb});var socket=require(_0xad0d('0x1c'))(new Redis(config['redis']));require(_0xad0d('0x1d'))[_0xad0d('0x1e')](socket);function respondWithStatusCode(_0x5973a4,_0x2cab04){_0x2cab04=_0x2cab04||0xcc;return function(_0x698ee){if(_0x698ee){return _0x5973a4['sendStatus'](_0x2cab04);}return _0x5973a4[_0xad0d('0x1f')](_0x2cab04)['end']();};}function respondWithResult(_0x56d253,_0x3efaab){_0x3efaab=_0x3efaab||0xc8;return function(_0x3677b5){if(_0x3677b5){return _0x56d253[_0xad0d('0x1f')](_0x3efaab)['json'](_0x3677b5);}};}function respondWithFilteredResult(_0x1cac0c,_0x2f3bb3){return function(_0x5862bd){if(_0x5862bd){var _0xb6c032=typeof _0x2f3bb3['offset']==='undefined'&&typeof _0x2f3bb3[_0xad0d('0x20')]==='undefined';var _0x439484=_0x5862bd[_0xad0d('0x21')];var _0x3f77b1=_0xb6c032?0x0:_0x2f3bb3['offset'];var _0x490bb9=_0xb6c032?_0x5862bd[_0xad0d('0x21')]:_0x2f3bb3[_0xad0d('0x22')]+_0x2f3bb3[_0xad0d('0x20')];var _0x542bd8;if(_0x490bb9>=_0x439484){_0x490bb9=_0x439484;_0x542bd8=0xc8;}else{_0x542bd8=0xce;}_0x1cac0c['status'](_0x542bd8);return _0x1cac0c[_0xad0d('0x23')]('Content-Range',_0x3f77b1+'-'+_0x490bb9+'/'+_0x439484)[_0xad0d('0x24')](_0x5862bd);}return null;};}function patchUpdates(_0x129e80){return function(_0x3dd9a4){try{jsonpatch[_0xad0d('0x25')](_0x3dd9a4,_0x129e80,!![]);}catch(_0xefaf5f){return BPromise[_0xad0d('0x26')](_0xefaf5f);}return _0x3dd9a4['save']();};}function saveUpdates(_0x171757,_0x45f401){return function(_0x59499a){if(_0x59499a){return _0x59499a['update'](_0x171757)[_0xad0d('0x27')](function(_0x3e510e){return _0x3e510e;});}return null;};}function removeEntity(_0x444eda,_0x4ed3c8){return function(_0x3f70a6){if(_0x3f70a6){return _0x3f70a6['destroy']()[_0xad0d('0x27')](function(){_0x444eda[_0xad0d('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x481e1a,_0x3111fd){return function(_0x434221){if(!_0x434221){_0x481e1a[_0xad0d('0x28')](0x194);}return _0x434221;};}function handleError(_0x54a0c1,_0x472706){_0x472706=_0x472706||0x1f4;return function(_0x62dfed){logger[_0xad0d('0x29')](_0x62dfed['stack']);if(_0x62dfed[_0xad0d('0x2a')]){delete _0x62dfed[_0xad0d('0x2a')];}_0x54a0c1['status'](_0x472706)[_0xad0d('0x2b')](_0x62dfed);};}exports[_0xad0d('0x2c')]=function(_0x20bb3d,_0x11c203){var _0x185b9e={},_0x36c0f9={},_0x299752={'count':0x0,'rows':[]};var _0x4372e3=_[_0xad0d('0x2d')](db[_0xad0d('0x2e')][_0xad0d('0x2f')],function(_0x53ebdf){return{'name':_0x53ebdf[_0xad0d('0x30')],'type':_0x53ebdf['type'][_0xad0d('0x31')]};});_0x36c0f9[_0xad0d('0x32')]=_[_0xad0d('0x2d')](_0x4372e3,_0xad0d('0x2a'));_0x36c0f9['query']=_[_0xad0d('0x33')](_0x20bb3d[_0xad0d('0x34')]);_0x36c0f9['filters']=_[_0xad0d('0x35')](_0x36c0f9[_0xad0d('0x32')],_0x36c0f9[_0xad0d('0x34')]);_0x185b9e[_0xad0d('0x36')]=_[_0xad0d('0x35')](_0x36c0f9['model'],qs[_0xad0d('0x37')](_0x20bb3d[_0xad0d('0x34')][_0xad0d('0x37')]));_0x185b9e[_0xad0d('0x36')]=_0x185b9e['attributes'][_0xad0d('0x38')]?_0x185b9e['attributes']:_0x36c0f9[_0xad0d('0x32')];if(!_0x20bb3d[_0xad0d('0x34')][_0xad0d('0x39')]('nolimit')){_0x185b9e[_0xad0d('0x20')]=qs[_0xad0d('0x20')](_0x20bb3d[_0xad0d('0x34')][_0xad0d('0x20')]);_0x185b9e[_0xad0d('0x22')]=qs[_0xad0d('0x22')](_0x20bb3d[_0xad0d('0x34')][_0xad0d('0x22')]);}_0x185b9e['order']=qs[_0xad0d('0x3a')](_0x20bb3d[_0xad0d('0x34')][_0xad0d('0x3a')]);_0x185b9e[_0xad0d('0x3b')]=qs['filters'](_[_0xad0d('0x3c')](_0x20bb3d[_0xad0d('0x34')],_0x36c0f9[_0xad0d('0x3d')]),_0x4372e3);if(_0x20bb3d[_0xad0d('0x34')][_0xad0d('0x3e')]){_0x185b9e['where']=_['merge'](_0x185b9e[_0xad0d('0x3b')],{'$or':_['map'](_0x4372e3,function(_0x3b617d){if(_0x3b617d[_0xad0d('0x3f')]!==_0xad0d('0x40')){var _0x3041f8={};_0x3041f8[_0x3b617d[_0xad0d('0x2a')]]={'$like':'%'+_0x20bb3d[_0xad0d('0x34')][_0xad0d('0x3e')]+'%'};return _0x3041f8;}})});}_0x185b9e=_[_0xad0d('0x41')]({},_0x185b9e,_0x20bb3d[_0xad0d('0x42')]);var _0x539d55={'where':_0x185b9e[_0xad0d('0x3b')]};return db[_0xad0d('0x2e')][_0xad0d('0x21')](_0x539d55)[_0xad0d('0x27')](function(_0x3a1775){_0x299752[_0xad0d('0x21')]=_0x3a1775;if(_0x20bb3d[_0xad0d('0x34')][_0xad0d('0x43')]){_0x185b9e[_0xad0d('0x44')]=[{'all':!![]}];}return db[_0xad0d('0x2e')][_0xad0d('0x45')](_0x185b9e);})[_0xad0d('0x27')](function(_0x336ac8){_0x299752[_0xad0d('0x46')]=_0x336ac8;return _0x299752;})[_0xad0d('0x27')](respondWithFilteredResult(_0x11c203,_0x185b9e))['catch'](handleError(_0x11c203,null));};exports[_0xad0d('0x47')]=function(_0x8816f0,_0x20f0f6){var _0xb9ba8c={'raw':![],'where':{'id':_0x8816f0[_0xad0d('0x48')]['id']}},_0x416b6e={};_0x416b6e[_0xad0d('0x32')]=_[_0xad0d('0x33')](db[_0xad0d('0x2e')][_0xad0d('0x2f')]);_0x416b6e['query']=_[_0xad0d('0x33')](_0x8816f0[_0xad0d('0x34')]);_0x416b6e[_0xad0d('0x3d')]=_['intersection'](_0x416b6e[_0xad0d('0x32')],_0x416b6e[_0xad0d('0x34')]);_0xb9ba8c['attributes']=_[_0xad0d('0x35')](_0x416b6e['model'],qs[_0xad0d('0x37')](_0x8816f0['query']['fields']));_0xb9ba8c['attributes']=_0xb9ba8c['attributes'][_0xad0d('0x38')]?_0xb9ba8c['attributes']:_0x416b6e['model'];if(_0x8816f0['query'][_0xad0d('0x43')]){_0xb9ba8c['include']=[{'all':!![]}];}_0xb9ba8c=_['merge']({},_0xb9ba8c,_0x8816f0[_0xad0d('0x42')]);return db[_0xad0d('0x2e')]['find'](_0xb9ba8c)[_0xad0d('0x27')](handleEntityNotFound(_0x20f0f6,null))[_0xad0d('0x27')](respondWithResult(_0x20f0f6,null))['catch'](handleError(_0x20f0f6,null));};exports[_0xad0d('0x49')]=function(_0x3ef5e7,_0x32bad5){return db[_0xad0d('0x2e')][_0xad0d('0x49')](_0x3ef5e7['body'],{})[_0xad0d('0x27')](respondWithResult(_0x32bad5,0xc9))[_0xad0d('0x4a')](handleError(_0x32bad5,null));};exports['clone']=function(_0x5ece67,_0x323b1e){var _0x2ced7c={'where':{'id':_0x5ece67[_0xad0d('0x48')]['id']}},_0x140eac={};_0x140eac['model']=_[_0xad0d('0x33')](db[_0xad0d('0x2e')][_0xad0d('0x2f')]);_0x2ced7c['attributes']=_[_0xad0d('0x35')](_0x140eac[_0xad0d('0x32')],qs[_0xad0d('0x37')](_0x5ece67[_0xad0d('0x34')][_0xad0d('0x37')]));_0x2ced7c[_0xad0d('0x36')]=_0x2ced7c[_0xad0d('0x36')][_0xad0d('0x38')]?_0x2ced7c['attributes']:_0x140eac['model'];if(_0x5ece67[_0xad0d('0x34')][_0xad0d('0x43')]){_0x2ced7c[_0xad0d('0x44')]=[{'all':!![]}];}_0x2ced7c=_[_0xad0d('0x41')]({},_0x2ced7c,_0x5ece67[_0xad0d('0x42')]);return db[_0xad0d('0x2e')][_0xad0d('0x4b')](_0x2ced7c)[_0xad0d('0x27')](handleEntityNotFound(_0x323b1e,null))['then'](function(_0x19dd26){if(_0x19dd26){var _0x5b8b02=_0x19dd26[_0xad0d('0x4c')]({'plain':!![]});_0x5b8b02=qs[_0xad0d('0x4d')](_0x5b8b02,['id',_0xad0d('0x4e'),_0xad0d('0x4f'),'crudPermissions']);_0x5ece67[_0xad0d('0x50')]=_[_0xad0d('0x4d')](_0x5ece67['body'],['id',_0xad0d('0x4e'),_0xad0d('0x4f')]);return db['sequelize'][_0xad0d('0x51')](function(_0x1e34ab){return db[_0xad0d('0x2e')]['create'](_[_0xad0d('0x41')](_0x5b8b02,_0x5ece67[_0xad0d('0x50')]),{'include':_0x5ece67['query'][_0xad0d('0x43')]?[{'all':!![]}]:undefined,'transaction':_0x1e34ab})[_0xad0d('0x27')](function(_0x5cffc5){var _0x4658c9=_0x5cffc5[_0xad0d('0x4c')]({'plain':!![]});return db[_0xad0d('0x52')][_0xad0d('0x45')]({'where':{'userProfileId':_0x5ece67[_0xad0d('0x48')]['id']},'raw':!![]})[_0xad0d('0x27')](function(_0x265076){if(_0x265076){return BPromise[_0xad0d('0x53')](_0x265076,function(_0x93b874){return new BPromise(function(_0x3de9f1,_0x4519c9){if(_0x93b874['autoAssociation']===null||_0x93b874[_0xad0d('0x54')]===0x1)_0x3de9f1(null);return db['UserProfileResource'][_0xad0d('0x45')]({'where':{'sectionId':_0x93b874['id']},'raw':!![]})['then'](function(_0x503037){var _0x5ef2e2=_[_0xad0d('0x2d')](_0x503037,function(_0x3a7268){return qs[_0xad0d('0x4d')](_0x3a7268,['id',_0xad0d('0x4e'),_0xad0d('0x4f'),_0xad0d('0x55')]);});_0x3de9f1(_0x5ef2e2);})[_0xad0d('0x4a')](function(_0x11b492){_0x4519c9(_0x11b492);});})['then'](function(_0x4f7cc9){var _0x313b3e=qs['omit'](_0x93b874,['id','createdAt',_0xad0d('0x4f')]);_0x313b3e['userProfileId']=_0x4658c9['id'];if(_0x4f7cc9)_0x313b3e[_0xad0d('0x56')]=_0x4f7cc9;return _0x313b3e;})[_0xad0d('0x27')](function(_0x597ddb){return db[_0xad0d('0x52')][_0xad0d('0x49')](_0x597ddb,{'include':[{'model':db[_0xad0d('0x57')],'as':_0xad0d('0x56')}],'raw':!![],'transaction':_0x1e34ab});});})[_0xad0d('0x27')](function(){return _0x4658c9;});}});});});}})[_0xad0d('0x27')](respondWithResult(_0x323b1e,0xc9))[_0xad0d('0x4a')](handleError(_0x323b1e,null));};exports[_0xad0d('0x58')]=function(_0x299d09,_0x15404b){if(_0x299d09[_0xad0d('0x50')]['id']){delete _0x299d09[_0xad0d('0x50')]['id'];}return db[_0xad0d('0x2e')][_0xad0d('0x4b')]({'where':{'id':_0x299d09['params']['id']}})[_0xad0d('0x27')](handleEntityNotFound(_0x15404b,null))[_0xad0d('0x27')](saveUpdates(_0x299d09[_0xad0d('0x50')],null))['then'](respondWithResult(_0x15404b,null))['catch'](handleError(_0x15404b,null));};exports[_0xad0d('0x59')]=function(_0x47bd94,_0xaa56ed){return db[_0xad0d('0x2e')][_0xad0d('0x4b')]({'where':{'id':_0x47bd94[_0xad0d('0x48')]['id']}})[_0xad0d('0x27')](handleEntityNotFound(_0xaa56ed,null))[_0xad0d('0x27')](removeEntity(_0xaa56ed,null))['catch'](handleError(_0xaa56ed,null));};exports['describe']=function(_0x10958f,_0x4c3768){return db[_0xad0d('0x2e')]['describe']()['then'](respondWithResult(_0x4c3768,null))[_0xad0d('0x4a')](handleError(_0x4c3768,null));};exports[_0xad0d('0x5a')]=function(_0x2a3509,_0x11cf4a){var _0x222b3a=_0x2a3509['body'];return db[_0xad0d('0x2e')][_0xad0d('0x4b')]({'where':{'id':_0x2a3509[_0xad0d('0x48')]['id']}})['then'](handleEntityNotFound(_0x11cf4a,null))[_0xad0d('0x27')](function(_0x530297){if(_0x530297){return db[_0xad0d('0x5b')][_0xad0d('0x51')](function(_0x52ccb8){return db[_0xad0d('0x52')][_0xad0d('0x59')]({'where':{'userProfileId':_0x2a3509[_0xad0d('0x48')]['id'],'sectionId':_[_0xad0d('0x2d')](_0x222b3a,function(_0x3f5899){return _0x3f5899[_0xad0d('0x55')];})},'transaction':_0x52ccb8})['then'](function(){var _0x21cc0f=_['map'](_0x222b3a,function(_0x2dafe6){_0x2dafe6[_0xad0d('0x5c')]=_0x2a3509[_0xad0d('0x48')]['id'];return _0x2dafe6;});var _0x37664f=[];return BPromise[_0xad0d('0x53')](_0x21cc0f,function(_0xc077d7){return db[_0xad0d('0x52')][_0xad0d('0x49')](_0xc077d7,{'include':[{'model':db['UserProfileResource'],'as':_0xad0d('0x56')}],'raw':!![],'transaction':_0x52ccb8})[_0xad0d('0x27')](function(_0x92aa13){_0x37664f[_0xad0d('0x5d')](_0x92aa13['get']({'plain':!![]}));});})[_0xad0d('0x27')](function(){return _0x37664f;});});});}})[_0xad0d('0x27')](function(_0x32de95){return _0x32de95;})[_0xad0d('0x27')](respondWithResult(_0x11cf4a,null))[_0xad0d('0x4a')](handleError(_0x11cf4a,null));};exports[_0xad0d('0x5e')]=function(_0x11e002,_0xc257b4){var _0x2db0c2;return db[_0xad0d('0x2e')]['find']({'where':{'id':_0x11e002['params']['id']},'attributes':['id',_0xad0d('0x2a')]})['then'](handleEntityNotFound(_0xc257b4,null))['then'](function(_0x2f8dcb){if(_0x2f8dcb){_0x2db0c2=_0x2f8dcb;return db[_0xad0d('0x52')][_0xad0d('0x59')]({'where':{'userProfileId':_0x11e002['params']['id'],'sectionId':_0x11e002[_0xad0d('0x34')]['ids']}});}})[_0xad0d('0x27')](function(){return _0x2db0c2;})[_0xad0d('0x27')](respondWithStatusCode(_0xc257b4,null))[_0xad0d('0x4a')](handleError(_0xc257b4,null));};exports[_0xad0d('0x5f')]=function(_0xfddadb,_0x48c584){var _0x382b18=[];var _0x10120d=[];return db[_0xad0d('0x52')][_0xad0d('0x45')]({'where':{'userProfileId':_0xfddadb[_0xad0d('0x48')]['id']},'raw':!![]})['then'](function(_0x26d5d3){_0x382b18=_[_0xad0d('0x3e')](_0x26d5d3,function(_0x47a4c6){return _0x47a4c6['enabled']===0x1||_[_0xad0d('0x60')]([0x3eb,0x709],_0x47a4c6['sectionId']);});if(!_[_0xad0d('0x61')](_0x382b18)){return _['map'](_0x382b18,function(_0x1df5cb){return _0x1df5cb[_0xad0d('0x55')];});}else{return;}})[_0xad0d('0x27')](function(_0x3ca170){if(_0x3ca170)_0x10120d=_0x3ca170;if(_[_0xad0d('0x60')](_0x10120d,0x64)){var _0x35195a=_[_0xad0d('0x4b')](_0x382b18,{'sectionId':0x64});return hasDefaultDashboard(_0x35195a)[_0xad0d('0x27')](function(_0x437307){return _[_0xad0d('0x2d')](_0x382b18,function(_0xe1c7a6){if(_0xe1c7a6[_0xad0d('0x55')]===0x64){_0xe1c7a6[_0xad0d('0x62')]=_0x437307;}return _0xe1c7a6;});});}else{return;}})['then'](function(_0x12063c){if(_0x12063c)_0x382b18=_0x12063c;if(_[_0xad0d('0x60')](_0x10120d,0x3eb)){var _0xfe3458=_[_0xad0d('0x4b')](_0x382b18,{'sectionId':0x3eb});return getCustomDashboards(_0xfe3458)[_0xad0d('0x27')](function(_0x135f52){return _[_0xad0d('0x2d')](_0x382b18,function(_0x19d5b7){if(_0xfe3458[_0xad0d('0x63')]){if(_0x19d5b7['sectionId']===0x3eb){_0x19d5b7['subsections']=_0x135f52;}}else{if(_0x19d5b7[_0xad0d('0x55')]===0x64){_0x19d5b7['subsections']=_0x135f52;}}return _0x19d5b7;});});}else{return;}})[_0xad0d('0x27')](function(_0x51f4e2){if(_0x51f4e2)_0x382b18=_0x51f4e2;if(_[_0xad0d('0x60')](_0x10120d,0x709)){var _0x3f70a7=_[_0xad0d('0x4b')](_0x382b18,{'sectionId':0x709});return getPlugins(_0x3f70a7)[_0xad0d('0x27')](function(_0x554f78){if(_0x3f70a7[_0xad0d('0x63')]){return _[_0xad0d('0x2d')](_0x382b18,function(_0x5e64cf){if(_0x5e64cf[_0xad0d('0x55')]===0x709){_0x5e64cf[_0xad0d('0x62')]=_0x554f78;}return _0x5e64cf;});}else{var _0x152332={'sectionId':0x76c,'enabled':0x1,'subsections':_0x554f78};var _0x428e83=_[_0xad0d('0x2d')](_0x382b18);_0x428e83['push'](_0x152332);return _0x428e83;}});}else{return;}})['then'](function(_0x59841c){if(_0x59841c)_0x382b18=_0x59841c;return _[_0xad0d('0x3e')](_0x382b18,['enabled',0x1]);})[_0xad0d('0x27')](respondWithResult(_0x48c584,null))[_0xad0d('0x4a')](handleError(_0x48c584,null));};function hasDefaultDashboard(_0x29c4b8){var _0x51f788=[0x65];return new BPromise(function(_0x572196,_0x486b23){try{if(_0x29c4b8[_0xad0d('0x54')]){_0x572196(_0x51f788);}else{return db['UserProfileResource'][_0xad0d('0x64')]({'where':{'sectionId':_0x29c4b8['id']},'raw':!![]})['then'](function(_0x29c307){_0x29c307?_0x572196(_0x51f788):_0x572196();});}}catch(_0x461ba8){_0x486b23(_0x461ba8);}});}function getCustomDashboards(_0x476bb4){var _0x3a6373=[];return new BPromise(function(_0x469987,_0xcfde6){try{if(_0x476bb4['autoAssociation']){return db[_0xad0d('0x65')][_0xad0d('0x45')]({'raw':!![]})['then'](function(_0x207a06){_0x207a06['forEach'](function(_0x259d65){_0x3a6373[_0xad0d('0x5d')](_0x259d65['id']+0x1869f);});_0x469987(_0x3a6373);});}else{return db[_0xad0d('0x57')]['findAll']({'where':{'sectionId':_0x476bb4['id']},'raw':!![]})['then'](function(_0x9436a5){_0x9436a5[_0xad0d('0x66')](function(_0x41a462){_0x3a6373[_0xad0d('0x5d')](_0x41a462[_0xad0d('0x67')]+0x1869f);});_0x469987(_0x3a6373);});}}catch(_0x2b3dfc){_0xcfde6(_0x2b3dfc);}});}function getPlugins(_0x100dc4){var _0x46e828=[];return new BPromise(function(_0x1e418f,_0x53bfbe){try{if(_0x100dc4[_0xad0d('0x54')]){return db[_0xad0d('0x68')][_0xad0d('0x45')]({'raw':!![]})[_0xad0d('0x27')](function(_0x3530c1){_0x3530c1[_0xad0d('0x66')](function(_0x3b54f3){_0x46e828[_0xad0d('0x5d')](_0x3b54f3['id']+0x15b38);});_0x1e418f(_0x46e828);});}else{return db[_0xad0d('0x57')][_0xad0d('0x45')]({'where':{'sectionId':_0x100dc4['id']},'raw':!![]})[_0xad0d('0x27')](function(_0x529c53){_0x529c53[_0xad0d('0x66')](function(_0x9e3216){_0x46e828[_0xad0d('0x5d')](_0x9e3216[_0xad0d('0x67')]+0x15b38);});_0x1e418f(_0x46e828);});}}catch(_0x1d2116){_0x53bfbe(_0x1d2116);}});}exports['addResources']=function(_0x167f0f,_0x10fd8f){return db[_0xad0d('0x2e')]['find']({'where':{'id':_0x167f0f['params']['id']}})[_0xad0d('0x27')](handleEntityNotFound(_0x10fd8f,null))[_0xad0d('0x27')](function(_0x118180){if(_0x118180){return db['sequelize']['transaction'](function(_0x4b8691){return db[_0xad0d('0x52')][_0xad0d('0x45')]({'where':{'userProfileId':_0x167f0f[_0xad0d('0x48')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x13892d){if(_0x13892d){return db[_0xad0d('0x52')]['destroy']({'where':{'userProfileId':_0x167f0f[_0xad0d('0x48')]['id'],'id':_[_0xad0d('0x2d')](_0x13892d,function(_0x34f3db){return _0x34f3db['id'];})},'transaction':_0x4b8691});}})[_0xad0d('0x27')](function(_0x3b05ef){var _0x15a94e=_[_0xad0d('0x2d')](_0x167f0f[_0xad0d('0x50')],function(_0x3d8e4a){_0x3d8e4a[_0xad0d('0x5c')]=_0x167f0f[_0xad0d('0x48')]['id'];return _0x3d8e4a;});return db[_0xad0d('0x52')]['bulkCreate'](_0x15a94e,{'raw':!![],'transaction':_0x4b8691});})[_0xad0d('0x27')](function(_0x4f33f2){var _0x28a7b3=_[_0xad0d('0x3e')](_[_0xad0d('0x2d')](_0x4f33f2,function(_0x37d48){return _0x37d48['get']({'plain':!![]});}),{'includeAll':![]});if(_0x28a7b3){return db[_0xad0d('0x52')][_0xad0d('0x45')]({'where':{'userProfileId':_0x167f0f[_0xad0d('0x48')]['id'],'sectionId':_['map'](_0x28a7b3,function(_0x2d2620){return _0x2d2620['sectionId'];})},'attributes':['id',_0xad0d('0x55')],'raw':!![]})[_0xad0d('0x27')](function(_0x19c57d){var _0x1b3def=_['map'](_0x167f0f[_0xad0d('0x50')],function(_0x5e065c){_0x5e065c[_0xad0d('0x5c')]=_0x167f0f[_0xad0d('0x48')]['id'];return _0x5e065c;});return db[_0xad0d('0x57')][_0xad0d('0x69')](_0x1b3def,{'raw':!![],'transaction':_0x4b8691});});}})[_0xad0d('0x4a')](handleError(_0x10fd8f,null));});}})['then'](function(_0x5f22ce){var _0x3820ed=_['map'](_0x5f22ce,function(_0x3b909c){return _0x3b909c[_0xad0d('0x4c')]({'plain':!![]});});})[_0xad0d('0x27')](respondWithResult(_0x10fd8f,null))[_0xad0d('0x4a')](handleError(_0x10fd8f,null));};exports[_0xad0d('0x6a')]=function(_0x5dff1a,_0x21c59f,_0x12e3a3){return db['UserProfile'][_0xad0d('0x4b')]({'where':{'id':_0x5dff1a[_0xad0d('0x48')]['id']}})[_0xad0d('0x27')](handleEntityNotFound(_0x21c59f,null))['then'](function(_0x2f9ac7){if(_0x2f9ac7){return _0x2f9ac7[_0xad0d('0x6a')](_0x5dff1a['query'][_0xad0d('0x6b')]);}})[_0xad0d('0x27')](respondWithStatusCode(_0x21c59f,null))[_0xad0d('0x4a')](handleError(_0x21c59f,null));};exports[_0xad0d('0x6c')]=function(_0x1e40b4,_0x32e6ff){var _0x4cdec6={};if(!_0x1e40b4[_0xad0d('0x34')][_0xad0d('0x6d')])throw new Error('Missing\x20section\x20parameter');if(!_0x1e40b4[_0xad0d('0x34')][_0xad0d('0x39')](_0xad0d('0x6e'))){_0x4cdec6[_0xad0d('0x20')]=qs[_0xad0d('0x20')](_0x1e40b4[_0xad0d('0x34')]['limit']);_0x4cdec6[_0xad0d('0x22')]=qs['offset'](_0x1e40b4[_0xad0d('0x34')][_0xad0d('0x22')]);}return db[_0xad0d('0x2e')][_0xad0d('0x4b')]({'where':{'id':_0x1e40b4[_0xad0d('0x48')]['id']}})[_0xad0d('0x27')](function(_0x17d86e){if(!_0x17d86e)throw new Error(_0xad0d('0x6f')+_0x1e40b4[_0xad0d('0x48')]['id']);return db[_0xad0d('0x2e')][_0xad0d('0x6c')](_0x1e40b4);})[_0xad0d('0x27')](respondWithFilteredResult(_0x32e6ff,_0x4cdec6))[_0xad0d('0x4a')](handleError(_0x32e6ff,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index e2d321e..2d4b1d4 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 _0xf03a=['remove','emit','hook','../../mysqldb','UserProfile','setMaxListeners','save'];(function(_0x2e1371,_0x58e90){var _0x567351=function(_0x9b751){while(--_0x9b751){_0x2e1371['push'](_0x2e1371['shift']());}};_0x567351(++_0x58e90);}(_0xf03a,0x1a0));var _0xaf03=function(_0x56fb4a,_0x1a66ec){_0x56fb4a=_0x56fb4a-0x0;var _0x4e47fd=_0xf03a[_0x56fb4a];return _0x4e47fd;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xaf03('0x0'))['db'][_0xaf03('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xaf03('0x2')](0x0);var events={'afterCreate':_0xaf03('0x3'),'afterUpdate':'update','afterDestroy':_0xaf03('0x4')};function emitEvent(_0xfe64f3){return function(_0x4f13f3,_0x3aa47d,_0x10a6a5){UserProfileEvents[_0xaf03('0x5')](_0xfe64f3+':'+_0x4f13f3['id'],_0x4f13f3);UserProfileEvents[_0xaf03('0x5')](_0xfe64f3,_0x4f13f3);_0x10a6a5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xaf03('0x6')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0x6931=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','UserProfile','setMaxListeners','save'];(function(_0x56f604,_0x31e0fc){var _0x5c3f23=function(_0x507065){while(--_0x507065){_0x56f604['push'](_0x56f604['shift']());}};_0x5c3f23(++_0x31e0fc);}(_0x6931,0x1a9));var _0x1693=function(_0x471b93,_0x3ce579){_0x471b93=_0x471b93-0x0;var _0x1bc440=_0x6931[_0x471b93];return _0x1bc440;};'use strict';var EventEmitter=require(_0x1693('0x0'));var UserProfile=require(_0x1693('0x1'))['db'][_0x1693('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x1693('0x3')](0x0);var events={'afterCreate':_0x1693('0x4'),'afterUpdate':_0x1693('0x5'),'afterDestroy':_0x1693('0x6')};function emitEvent(_0x2cb142){return function(_0x59d148,_0x19ff1c,_0x2ca960){UserProfileEvents[_0x1693('0x7')](_0x2cb142+':'+_0x59d148['id'],_0x59d148);UserProfileEvents[_0x1693('0x7')](_0x2cb142,_0x59d148);_0x2ca960(null);};}for(var e in events){if(events[_0x1693('0x8')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x1693('0x9')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 5a413f2..007db89 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 _0xd8fb=['CmList','companies','CmCompany','CmCustomField','chatqueues','ChatWebsite','faxqueues','faxaccounts','FaxAccount','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','voicerecordings','VoiceRecording','Agents','agent','Telephones','membername','User','role','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','musiconholds','VoiceMusicOnHold','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','whatsappqueues','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','intervals','Interval','pauses','Pause','Schedule','sounds','Sound','tags','Tag','templates','Template','Trigger','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','Sequelize','QueryTypes','SELECT','ui.','InteractionId','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','mergeResources','length','UserProfileSection','find','all','ignore','isEmpty','push','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','pick','merge','key','foreignKey','autoAssociation','includeAll','include','forEach','default','DefaultReports','custom','CustomReports','count','rows','Tags','color','ThroughTags','tag','openTabs','true','chat','dataValues','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','models','filter','value','associatedResources','map','field','model','findAll','then','name','catch','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','parentSections','SquareProjects','projectName','JscriptyProject','contacts','CmContact','ListId','lists'];(function(_0x255304,_0x1d0c6f){var _0x1b5e4c=function(_0x27dd97){while(--_0x27dd97){_0x255304['push'](_0x255304['shift']());}};_0x1b5e4c(++_0x1d0c6f);}(_0xd8fb,0x99));var _0xbd8f=function(_0xd308ab,_0x4afb2c){_0xd308ab=_0xd308ab-0x0;var _0x5dc179=_0xd8fb[_0xd308ab];return _0x5dc179;};'use strict';var _=require(_0xbd8f('0x0'));var attributes=require(_0xbd8f('0x1'));var qs=require(_0xbd8f('0x2'));var squel=require(_0xbd8f('0x3'));module['exports']=function(_0x5ea933){var _0x4e9545=_0x5ea933[_0xbd8f('0x4')];function _0x43d177(_0x53cccc,_0x400dfb){return new Promise(function(_0x2343bf,_0x5543b2){if(!_0x400dfb)return _0x2343bf(null);var _0x33d541=_0x400dfb['filter']?{[_0x400dfb[_0xbd8f('0x5')]['field']]:_0x400dfb[_0xbd8f('0x5')][_0xbd8f('0x6')]}:undefined;return _0x4e9545[_0x53cccc]['findAll']({'where':_0x33d541,'raw':!![]})['then'](function(_0x3caa93){_0x400dfb[_0xbd8f('0x7')]=_[_0xbd8f('0x8')](_0x3caa93,'id');_0x2343bf(_0x400dfb);})['catch'](function(_0x255af3){_0x5543b2(_0x255af3);});});}function _0x42ae20(_0x5b834b,_0x4ac253){return new Promise(function(_0x342bcb,_0x40a5bc){var _0x12dcac=_0x5b834b['filter']?{[_0x5b834b[_0xbd8f('0x5')][_0xbd8f('0x9')]]:_0x5b834b[_0xbd8f('0x5')][_0xbd8f('0x6')]}:undefined;return _0x4e9545[_0x5b834b[_0xbd8f('0xa')]][_0xbd8f('0xb')]({'where':_0x12dcac,'raw':!![]})[_0xbd8f('0xc')](function(_0x29ffe8){_0x4ac253[_0xbd8f('0x7')]=_['map'](_0x29ffe8,function(_0x31573c){return _0x31573c[_0xbd8f('0xd')];});_0x342bcb(_0x4ac253);})[_0xbd8f('0xe')](function(_0x10d72e){_0x40a5bc(_0x10d72e);});});}function _0x4da96f(_0x174929,_0x63db18,_0x5ebf8b){if(!_0x63db18)return Promise[_0xbd8f('0xf')](null);return new Promise(function(_0xf5e7a,_0x504adb){return _0x4e9545[_0xbd8f('0x10')][_0xbd8f('0xb')]({'where':{'sectionId':_0x63db18['id']},'raw':!![]})['then'](function(_0x5a572b){if(_0x174929[_0xbd8f('0x9')]&&_0x174929['field']!=='id'){_0x63db18['associatedResources']=_[_0xbd8f('0x8')](_0x5a572b,function(_0x4b5fac){return _0x4b5fac[_0x174929[_0xbd8f('0x9')]];});}else{if(_0x5ebf8b===_0xbd8f('0x11')){_0x63db18[_0xbd8f('0x7')]=_[_0xbd8f('0x8')](_0x5a572b,function(_0xdc11cc){return{'id':_0xdc11cc[_0xbd8f('0x12')],'type':_0xdc11cc[_0xbd8f('0x13')]};});}else{_0x63db18[_0xbd8f('0x7')]=_[_0xbd8f('0x8')](_0x5a572b,function(_0x775acc){return _0x775acc[_0xbd8f('0x12')];});}}_0xf5e7a(_0x63db18);})[_0xbd8f('0xe')](function(_0x2f7c45){_0x504adb(_0x2f7c45);});});}function _0x15c4a9(_0x320ede,_0xd11ae){var _0x395b1b={'parentSections':[]};switch(_0x320ede['toLowerCase']()){case _0xbd8f('0x14'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x16');break;case _0xbd8f('0x17'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x18');break;case _0xbd8f('0x19'):_0x395b1b[_0xbd8f('0x15')]='SquareRecording';_0x395b1b[_0xbd8f('0x1a')]=[{'name':_0xbd8f('0x1b'),'field':'name','foreignKey':_0xbd8f('0x1c')}];break;case'projects':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x1d');break;case _0xbd8f('0x1e'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x1f');_0x395b1b[_0xbd8f('0x1a')]=[{'name':'Lists','field':'id','foreignKey':_0xbd8f('0x20')}];break;case _0xbd8f('0x21'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x22');break;case _0xbd8f('0x23'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x24');break;case'globalcustomfields':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x25');break;case _0xbd8f('0x26'):_0x395b1b[_0xbd8f('0x15')]='ChatQueue';break;case'chatwebsites':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x27');break;case _0xbd8f('0x28'):_0x395b1b[_0xbd8f('0x15')]='FaxQueue';break;case _0xbd8f('0x29'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x2a');break;case _0xbd8f('0x2b'):case _0xbd8f('0x2c'):case'outboundroutes':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x2d');break;case _0xbd8f('0x2e'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x2f');break;case'voicemails':_0x395b1b[_0xbd8f('0x15')]='VoiceMail';break;case _0xbd8f('0x30'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x31');_0x395b1b[_0xbd8f('0x1a')]=[{'name':_0xbd8f('0x32'),'field':_0xbd8f('0xd'),'foreignKey':'membername','model':'User','filter':{'field':'role','value':[_0xbd8f('0x33')]}},{'name':_0xbd8f('0x34'),'field':_0xbd8f('0xd'),'foreignKey':_0xbd8f('0x35'),'model':_0xbd8f('0x36'),'filter':{'field':_0xbd8f('0x37'),'value':[_0xbd8f('0x38')]}},{'name':_0xbd8f('0x39'),'field':_0xbd8f('0xd'),'foreignKey':_0xbd8f('0x3a'),'model':_0xbd8f('0x3b'),'filter':{'field':_0xbd8f('0x13'),'value':[_0xbd8f('0x3c')]}},{'name':_0xbd8f('0x3d'),'field':_0xbd8f('0xd'),'foreignKey':'queue','model':_0xbd8f('0x3b'),'filter':{'field':_0xbd8f('0x13'),'value':['outbound']}}];break;case _0xbd8f('0x3e'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x3f');break;case'chanspies':_0x395b1b[_0xbd8f('0x15')]='VoiceChanSpy';break;case _0xbd8f('0x40'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x41');break;case'ivrcampaigns':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x42');break;case _0xbd8f('0x43'):_0x395b1b['childModel']=_0xbd8f('0x44');break;case _0xbd8f('0x45'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x46');break;case _0xbd8f('0x47'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x48');break;case _0xbd8f('0x49'):_0x395b1b[_0xbd8f('0x15')]='OpenchannelQueue';break;case'openchannelaccounts':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x4a');break;case _0xbd8f('0x4b'):_0x395b1b[_0xbd8f('0x15')]='SmsQueue';break;case _0xbd8f('0x4c'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x4d');break;case _0xbd8f('0x4e'):_0x395b1b[_0xbd8f('0x15')]='WhatsappQueue';break;case'whatsappaccounts':_0x395b1b[_0xbd8f('0x15')]='WhatsappAccount';break;case _0xbd8f('0x4f'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x50');break;case _0xbd8f('0x51'):case _0xbd8f('0x52'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x3b');if(_0xd11ae){_0x395b1b[_0xbd8f('0x1a')]=[{'name':'VoiceQueues'},{'name':_0xbd8f('0x3d')}];}break;case _0xbd8f('0x53'):case _0xbd8f('0x54'):case _0xbd8f('0x55'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x36');if(_0xd11ae){_0x395b1b[_0xbd8f('0x1a')]=[{'name':_0xbd8f('0x56'),'filter':{'field':'role','value':[_0xbd8f('0x57'),_0xbd8f('0x58')]},'ignore':!![]},{'name':_0xbd8f('0x32')},{'name':_0xbd8f('0x34')}];}break;case _0xbd8f('0x59'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x5a');break;case _0xbd8f('0x5b'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x5c');break;case _0xbd8f('0x5d'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x5e');break;case _0xbd8f('0x5f'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x60');break;case _0xbd8f('0x61'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x62');break;case'zohoaccounts':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x63');break;case _0xbd8f('0x64'):_0x395b1b[_0xbd8f('0x15')]='User';break;case _0xbd8f('0x65'):_0x395b1b['childModel']=_0xbd8f('0x66');break;case _0xbd8f('0x67'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x68');break;case'customdashboards':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x69');break;case _0xbd8f('0x6a'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x6b');break;case _0xbd8f('0x6c'):_0x395b1b['childModel']=_0xbd8f('0x6d');break;case'scheduler':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x6e');break;case _0xbd8f('0x6f'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x70');break;case _0xbd8f('0x71'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x72');break;case _0xbd8f('0x73'):_0x395b1b['childModel']=_0xbd8f('0x74');break;case'triggers':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x75');break;case'trunks':_0x395b1b[_0xbd8f('0x15')]='Trunk';break;case'variables':_0x395b1b['childModel']='Variable';break;case _0xbd8f('0x76'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x77');break;case _0xbd8f('0x78'):_0x395b1b[_0xbd8f('0x15')]='AnalyticExtractedReport';_0x395b1b['parentSections']=[{'name':_0xbd8f('0x79'),'field':'id','foreignKey':_0xbd8f('0x7a')}];break;case _0xbd8f('0x7b'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x7c');break;}return _0x395b1b;}function _0x576970(_0x4d2b28,_0x55a99b){var _0x9cf2d5=_0x4d2b28[_0xbd8f('0x7d')](0x0)[_0xbd8f('0x7e')]()+_0x4d2b28['slice'](0x1);var _0x3255be={'type':_0x4e9545[_0xbd8f('0x7f')][_0xbd8f('0x80')][_0xbd8f('0x81')],'raw':!![]};return new Promise(function(_0x50622d,_0x5327f2){var _0x388af8=squel['select']()[_0xbd8f('0x9')](_0xbd8f('0x82')+_0x9cf2d5+_0xbd8f('0x83'),'id')[_0xbd8f('0x9')]('ui.createdAt')['from'](_0xbd8f('0x84')+_0x4d2b28+_0xbd8f('0x85'),'ui')[_0xbd8f('0x86')](_0xbd8f('0x87'),_0x55a99b['id']);return _0x4e9545[_0xbd8f('0x88')][_0xbd8f('0x89')](_0x388af8[_0xbd8f('0x8a')](),_0x3255be)[_0xbd8f('0xc')](function(_0x2b9ba3){_0x55a99b[_0x9cf2d5+_0xbd8f('0x8b')]=_0x2b9ba3;_0x50622d(_0x2b9ba3);})[_0xbd8f('0xe')](function(_0x5c69c6){_0x5327f2(_0x5c69c6);});});}return _0x5ea933[_0xbd8f('0x8c')](_0xbd8f('0x8d'),attributes,{'tableName':_0xbd8f('0x8e'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x12ee82){var _0x3b43f7={'raw':![],'where':{}};var _0xbbe096={};var _0x50e345={'count':0x0,'rows':[]};var _0x46c686=_0x12ee82[_0xbd8f('0x89')]['section'];var _0x5e18fc=_0x12ee82[_0xbd8f('0x89')][_0xbd8f('0x8f')]||![];var _0x109616=_0x15c4a9(_0x46c686,_0x5e18fc);if(!_0x109616['childModel'])throw new Error('Invalid\x20section\x20\x27'+_0x46c686+'\x27');var _0x118f1a=[{'name':_0x46c686}];if(!_['isEmpty'](_0x109616['parentSections']))_0x118f1a=_0x109616['parentSections'];var _0x5a858e=[];for(var _0x5b26eb=0x0;_0x5b26eb<_0x118f1a[_0xbd8f('0x90')];_0x5b26eb++){_0x5a858e['push'](_0x4e9545[_0xbd8f('0x91')][_0xbd8f('0x92')]({'where':{'userProfileId':_0x12ee82['params']['id'],'name':_0x118f1a[_0x5b26eb][_0xbd8f('0xd')]},'raw':!![]}));}return Promise[_0xbd8f('0x93')](_0x5a858e)[_0xbd8f('0xc')](function(_0xeabb79){var _0x199d7d=_['filter'](_0xeabb79,function(_0x583d7a){return _0x583d7a?_0x583d7a:undefined;});var _0x378e72=_[_0xbd8f('0x5')](_0x118f1a,[_0xbd8f('0x94'),!![]]);var _0x296794=_[_0xbd8f('0x95')](_0x199d7d)&&_[_0xbd8f('0x95')](_0x378e72)?null:_['union'](_0x378e72,_0x199d7d);if(!_0x296794)return null;var _0x4eddf2=[];for(var _0x467b0f=0x0;_0x467b0f<_0x296794[_0xbd8f('0x90')];_0x467b0f++){var _0x528b29=_[_0xbd8f('0x92')](_0x118f1a,function(_0x372386){return _0x296794[_0x467b0f]?_0x372386['name']===_0x296794[_0x467b0f][_0xbd8f('0xd')]:null;});if(_0x528b29){if(_0x296794[_0x467b0f][_0xbd8f('0x94')]){_0x4eddf2[_0xbd8f('0x96')](_0x43d177(_0x109616['childModel'],_0x296794[_0x467b0f]));}else{if(!_0x296794[_0x467b0f]['autoAssociation']){_0x4eddf2[_0xbd8f('0x96')](_0x4da96f(_0x528b29,_0x296794[_0x467b0f],_0x109616[_0xbd8f('0x15')]));}else{if(_0x528b29[_0xbd8f('0xa')]){_0x4eddf2[_0xbd8f('0x96')](_0x42ae20(_0x528b29,_0x296794[_0x467b0f]));}}}}}return Promise[_0xbd8f('0x93')](_0x4eddf2);})['then'](function(_0x200718){var _0x27ec14=_0x200718;var _0x400bf6=null;if(_0x27ec14){_0x400bf6=_0x27ec14[_0xbd8f('0x90')]===0x1?_0x27ec14[0x0]:null;}if(!_0x400bf6&&!_0x27ec14)return _0x50e345;var _0x1efdf4=_0x4e9545[_0x109616[_0xbd8f('0x15')]][_0xbd8f('0x97')];_0xbbe096[_0xbd8f('0xa')]=_[_0xbd8f('0x98')](_0x1efdf4);_0xbbe096[_0xbd8f('0x89')]=_[_0xbd8f('0x98')](_0x12ee82[_0xbd8f('0x89')]);_0xbbe096[_0xbd8f('0x99')]=_[_0xbd8f('0x9a')](_0xbbe096[_0xbd8f('0xa')],_0xbbe096[_0xbd8f('0x89')]);_0x3b43f7[_0xbd8f('0x9b')]=_[_0xbd8f('0x9a')](_0xbbe096['model'],qs[_0xbd8f('0x9c')](_0x12ee82[_0xbd8f('0x89')][_0xbd8f('0x9c')]));_0x3b43f7[_0xbd8f('0x9b')]=_0x3b43f7[_0xbd8f('0x9b')][_0xbd8f('0x90')]?_0x3b43f7['attributes']:_0xbbe096['model'];if(!_0x12ee82[_0xbd8f('0x89')][_0xbd8f('0x9d')]('nolimit')){_0x3b43f7[_0xbd8f('0x9e')]=qs['limit'](_0x12ee82[_0xbd8f('0x89')][_0xbd8f('0x9e')]);_0x3b43f7[_0xbd8f('0x9f')]=qs[_0xbd8f('0x9f')](_0x12ee82['query'][_0xbd8f('0x9f')]);}_0x3b43f7[_0xbd8f('0xa0')]=qs[_0xbd8f('0xa1')](_0x12ee82['query'][_0xbd8f('0xa1')]);_0x3b43f7[_0xbd8f('0x86')]=qs[_0xbd8f('0x99')](_[_0xbd8f('0xa2')](_0x12ee82['query'],_0xbbe096[_0xbd8f('0x99')]));if(_0x12ee82[_0xbd8f('0x89')][_0xbd8f('0x5')]){_0x3b43f7[_0xbd8f('0x86')]=_[_0xbd8f('0xa3')](_0x3b43f7[_0xbd8f('0x86')],{'$or':_[_0xbd8f('0x8')](_0x1efdf4,function(_0x3a320c){if(_0x3a320c['type'][_0xbd8f('0xa4')]!=='VIRTUAL'){var _0x3da31b={};_0x3da31b[_0x3a320c['field']]={'$like':'%'+_0x12ee82[_0xbd8f('0x89')][_0xbd8f('0x5')]+'%'};return _0x3da31b;}})});}var _0x5465e5=[];var _0x3d015f=null;var _0x87191={};if(_0x400bf6){_0x3d015f=_[_0xbd8f('0x92')](_0x118f1a,[_0xbd8f('0xd'),_0x400bf6['name']]);if(_0x3d015f[_0xbd8f('0x9')]){_0x87191={};if(_0x109616[_0xbd8f('0x15')]===_0xbd8f('0x11')){_0x87191[_0x3d015f[_0xbd8f('0xa5')]]=_['map'](_0x400bf6['associatedResources'],'id');}else{_0x87191[_0x3d015f[_0xbd8f('0xa5')]]=_0x400bf6[_0xbd8f('0x7')];}_0x5465e5[_0xbd8f('0x96')](_0x87191);}else{_0x3b43f7[_0xbd8f('0x86')]['id']=_0x400bf6[_0xbd8f('0x7')];}}else{for(var _0x53076d=0x0;_0x53076d<_0x27ec14[_0xbd8f('0x90')];_0x53076d++){_0x3d015f=_[_0xbd8f('0x92')](_0x118f1a,[_0xbd8f('0xd'),_0x27ec14[_0x53076d][_0xbd8f('0xd')]]);if(_0x3d015f[_0xbd8f('0x9')]){_0x87191={};_0x87191[_0x3d015f['foreignKey']]=_0x27ec14[_0x53076d]['associatedResources'];_0x5465e5['push'](_0x87191);}else{if(!_0x3b43f7[_0xbd8f('0x86')]['id'])_0x3b43f7['where']['id']=[];_0x27ec14[_0x53076d]['associatedResources']['forEach'](function(_0x63c20c){_0x3b43f7[_0xbd8f('0x86')]['id'][_0xbd8f('0x96')](_0x63c20c);});}}}if(!_[_0xbd8f('0x95')](_0x5465e5)){_0x3b43f7[_0xbd8f('0x86')]=_[_0xbd8f('0xa3')](_0x3b43f7[_0xbd8f('0x86')],{'$and':{'$or':_0x5465e5}});}_0x3b43f7=_[_0xbd8f('0xa3')]({},_0x3b43f7,_0x12ee82['options']);if(_0x400bf6&&!_0x400bf6[_0xbd8f('0xa6')]&&_0x109616[_0xbd8f('0x15')]===_0xbd8f('0x11')){if(_0x12ee82['query'][_0xbd8f('0xa7')]){_0x3b43f7[_0xbd8f('0xa8')]=[{'all':!![]}];}return _0x4e9545[_0x109616[_0xbd8f('0x15')]][_0xbd8f('0xb')](_0x3b43f7)[_0xbd8f('0xc')](function(_0x44ee0d){var _0x1d3c63=[];_0x44ee0d[_0xbd8f('0xa9')](function(_0x3aa33a){var _0x9e2f8a;switch(_0x3aa33a['reportType']){case _0xbd8f('0xaa'):_0x9e2f8a=_[_0xbd8f('0x92')](_0x400bf6[_0xbd8f('0x7')],function(_0x5c9c3a){return _0x5c9c3a['id']===_0x3aa33a[_0xbd8f('0x7a')]&&_0x5c9c3a['type']===_0xbd8f('0xab');});break;case _0xbd8f('0xac'):_0x9e2f8a=_[_0xbd8f('0x92')](_0x400bf6[_0xbd8f('0x7')],function(_0x351caa){return _0x351caa['id']===_0x3aa33a['reportId']&&_0x351caa[_0xbd8f('0x13')]===_0xbd8f('0xad');});break;}if(_0x9e2f8a)_0x1d3c63[_0xbd8f('0x96')](_0x3aa33a);});_0x50e345[_0xbd8f('0xae')]=_0x1d3c63[_0xbd8f('0x90')];_0x50e345[_0xbd8f('0xaf')]=_0x1d3c63;return _0x50e345;});}else{return _0x4e9545[_0x109616['childModel']][_0xbd8f('0xae')]({'where':_0x3b43f7[_0xbd8f('0x86')]})['then'](function(_0x49e15e){_0x50e345[_0xbd8f('0xae')]=_0x49e15e;if(_0x12ee82['query']['includeAll']){if(_0x109616['childModel']===_0xbd8f('0x1f')){_0x3b43f7[_0xbd8f('0xa8')]=[{'model':_0x4e9545[_0xbd8f('0x72')],'as':_0xbd8f('0xb0'),'attributes':['id','name',_0xbd8f('0xb1')],'required':_0x12ee82[_0xbd8f('0x89')]['tag']?!![]:![]},{'model':_0x4e9545['Tag'],'as':_0xbd8f('0xb2'),'attributes':['id','name',_0xbd8f('0xb1')],'through':_0x12ee82['query']['tag']?{'attributes':[],'where':{'TagId':_0x12ee82[_0xbd8f('0x89')][_0xbd8f('0xb3')]||undefined}}:{},'required':_0x12ee82[_0xbd8f('0x89')][_0xbd8f('0xb3')]?!![]:![]}];}else{_0x3b43f7[_0xbd8f('0xa8')]=[{'all':!![]}];}}return _0x4e9545[_0x109616['childModel']][_0xbd8f('0xb')](_0x3b43f7);})[_0xbd8f('0xc')](function(_0x3a6ec4){_0x50e345['rows']=_0x3a6ec4;if(_0x46c686===_0xbd8f('0x32')&&_0x12ee82[_0xbd8f('0x89')][_0xbd8f('0xb4')]===_0xbd8f('0xb5')){var _0x11fb11=[];for(var _0xc7a57c=0x0;_0xc7a57c<_0x50e345[_0xbd8f('0xaf')][_0xbd8f('0x90')];_0xc7a57c++){_0x11fb11[_0xbd8f('0x96')](_0x576970(_0xbd8f('0xb6'),_0x50e345['rows'][_0xc7a57c]['dataValues']));_0x11fb11['push'](_0x576970('sms',_0x50e345[_0xbd8f('0xaf')][_0xc7a57c][_0xbd8f('0xb7')]));_0x11fb11['push'](_0x576970('fax',_0x50e345['rows'][_0xc7a57c]['dataValues']));_0x11fb11[_0xbd8f('0x96')](_0x576970(_0xbd8f('0xb8'),_0x50e345[_0xbd8f('0xaf')][_0xc7a57c]['dataValues']));_0x11fb11[_0xbd8f('0x96')](_0x576970(_0xbd8f('0xb9'),_0x50e345[_0xbd8f('0xaf')][_0xc7a57c][_0xbd8f('0xb7')]));_0x11fb11['push'](_0x576970(_0xbd8f('0xba'),_0x50e345[_0xbd8f('0xaf')][_0xc7a57c][_0xbd8f('0xb7')]));}return Promise['all'](_0x11fb11)[_0xbd8f('0xc')](function(){return _0x50e345;});}return _0x50e345;});}});}}});}; \ No newline at end of file +var _0xc1c6=['query','toString','OpenTabs','define','UserProfile','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','ignore','autoAssociation','all','model','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','merge','VIRTUAL','foreignKey','forEach','options','includeAll','include','reportType','default','DefaultReports','custom','count','CmContact','Tag','color','tag','ThroughTags','rows','openTabs','true','chat','dataValues','sms','fax','mail','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','exports','models','filter','field','value','then','map','catch','findAll','associatedResources','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','contacts','parentSections','Lists','lists','CmList','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','ChatWebsite','FaxQueue','faxaccounts','inboundroutes','internalroutes','outboundroutes','VoiceExtension','voicemails','VoiceMail','VoiceRecording','Agents','membername','agent','Telephones','role','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','mailaccounts','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','whatsappqueues','whatsappaccounts','Team','voicequeues','queuecampaigns','users','agents','Users','admin','user','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','dispositions','customdashboards','Dashboard','Interval','pauses','Pause','scheduler','Schedule','sounds','tags','Template','triggers','Trigger','trunks','Trunk','Variable','plugins','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','SELECT','select','ui.','InteractionId','ui.createdAt','from','_interactions','ui.UserId\x20=\x20?','sequelize'];(function(_0x1c88f9,_0x211646){var _0x1779f7=function(_0x1dc48e){while(--_0x1dc48e){_0x1c88f9['push'](_0x1c88f9['shift']());}};_0x1779f7(++_0x211646);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x324091,_0x18514a){_0x324091=_0x324091-0x0;var _0x463d8d=_0xc1c6[_0x324091];return _0x463d8d;};'use strict';var _=require(_0x6c1c('0x0'));var attributes=require(_0x6c1c('0x1'));var qs=require(_0x6c1c('0x2'));var squel=require('squel');module[_0x6c1c('0x3')]=function(_0x4c33ca){var _0x426398=_0x4c33ca[_0x6c1c('0x4')];function _0x265d2c(_0x59f799,_0x56ed6f){return new Promise(function(_0x32af84,_0x524a6b){if(!_0x56ed6f)return _0x32af84(null);var _0x50c1bb=_0x56ed6f['filter']?{[_0x56ed6f[_0x6c1c('0x5')][_0x6c1c('0x6')]]:_0x56ed6f[_0x6c1c('0x5')][_0x6c1c('0x7')]}:undefined;return _0x426398[_0x59f799]['findAll']({'where':_0x50c1bb,'raw':!![]})[_0x6c1c('0x8')](function(_0x3ca985){_0x56ed6f['associatedResources']=_[_0x6c1c('0x9')](_0x3ca985,'id');_0x32af84(_0x56ed6f);})[_0x6c1c('0xa')](function(_0xb3bd12){_0x524a6b(_0xb3bd12);});});}function _0x1137e8(_0x49fb01,_0x3a25a2){return new Promise(function(_0x2a4fd4,_0x40cebf){var _0x5af308=_0x49fb01[_0x6c1c('0x5')]?{[_0x49fb01[_0x6c1c('0x5')][_0x6c1c('0x6')]]:_0x49fb01['filter'][_0x6c1c('0x7')]}:undefined;return _0x426398[_0x49fb01['model']][_0x6c1c('0xb')]({'where':_0x5af308,'raw':!![]})[_0x6c1c('0x8')](function(_0x2d279e){_0x3a25a2[_0x6c1c('0xc')]=_[_0x6c1c('0x9')](_0x2d279e,function(_0x3f532c){return _0x3f532c[_0x6c1c('0xd')];});_0x2a4fd4(_0x3a25a2);})[_0x6c1c('0xa')](function(_0x448f35){_0x40cebf(_0x448f35);});});}function _0x5f3758(_0x3df1b7,_0x174657,_0x5214ee){if(!_0x174657)return Promise[_0x6c1c('0xe')](null);return new Promise(function(_0x237cac,_0x494ffc){return _0x426398[_0x6c1c('0xf')]['findAll']({'where':{'sectionId':_0x174657['id']},'raw':!![]})[_0x6c1c('0x8')](function(_0x1a0ab9){if(_0x3df1b7['field']&&_0x3df1b7[_0x6c1c('0x6')]!=='id'){_0x174657['associatedResources']=_[_0x6c1c('0x9')](_0x1a0ab9,function(_0x3527bf){return _0x3527bf[_0x3df1b7[_0x6c1c('0x6')]];});}else{if(_0x5214ee===_0x6c1c('0x10')){_0x174657[_0x6c1c('0xc')]=_[_0x6c1c('0x9')](_0x1a0ab9,function(_0x1993c5){return{'id':_0x1993c5[_0x6c1c('0x11')],'type':_0x1993c5[_0x6c1c('0x12')]};});}else{_0x174657[_0x6c1c('0xc')]=_[_0x6c1c('0x9')](_0x1a0ab9,function(_0x450b1f){return _0x450b1f[_0x6c1c('0x11')];});}}_0x237cac(_0x174657);})[_0x6c1c('0xa')](function(_0x31fed2){_0x494ffc(_0x31fed2);});});}function _0x19c269(_0x2319d3,_0x12c638){var _0x3a3f13={'parentSections':[]};switch(_0x2319d3[_0x6c1c('0x13')]()){case _0x6c1c('0x14'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x16');break;case _0x6c1c('0x17'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x18');break;case _0x6c1c('0x19'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x1a');_0x3a3f13['parentSections']=[{'name':_0x6c1c('0x1b'),'field':'name','foreignKey':_0x6c1c('0x1c')}];break;case'projects':_0x3a3f13[_0x6c1c('0x15')]='JscriptyProject';break;case _0x6c1c('0x1d'):_0x3a3f13[_0x6c1c('0x15')]='CmContact';_0x3a3f13[_0x6c1c('0x1e')]=[{'name':_0x6c1c('0x1f'),'field':'id','foreignKey':'ListId'}];break;case _0x6c1c('0x20'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x21');break;case _0x6c1c('0x22'):_0x3a3f13['childModel']='CmCompany';break;case _0x6c1c('0x23'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x24');break;case _0x6c1c('0x25'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x26');break;case'chatwebsites':_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x27');break;case'faxqueues':_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x28');break;case _0x6c1c('0x29'):_0x3a3f13[_0x6c1c('0x15')]='FaxAccount';break;case _0x6c1c('0x2a'):case _0x6c1c('0x2b'):case _0x6c1c('0x2c'):_0x3a3f13['childModel']=_0x6c1c('0x2d');break;case'contexts':_0x3a3f13[_0x6c1c('0x15')]='VoiceContext';break;case _0x6c1c('0x2e'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x2f');break;case'voicerecordings':_0x3a3f13['childModel']=_0x6c1c('0x30');_0x3a3f13[_0x6c1c('0x1e')]=[{'name':_0x6c1c('0x31'),'field':'name','foreignKey':_0x6c1c('0x32'),'model':'User','filter':{'field':'role','value':[_0x6c1c('0x33')]}},{'name':_0x6c1c('0x34'),'field':_0x6c1c('0xd'),'foreignKey':_0x6c1c('0x32'),'model':'User','filter':{'field':_0x6c1c('0x35'),'value':[_0x6c1c('0x36')]}},{'name':_0x6c1c('0x37'),'field':_0x6c1c('0xd'),'foreignKey':_0x6c1c('0x38'),'model':_0x6c1c('0x39'),'filter':{'field':_0x6c1c('0x12'),'value':[_0x6c1c('0x3a')]}},{'name':_0x6c1c('0x3b'),'field':_0x6c1c('0xd'),'foreignKey':'queue','model':_0x6c1c('0x39'),'filter':{'field':_0x6c1c('0x12'),'value':[_0x6c1c('0x3c')]}}];break;case _0x6c1c('0x3d'):_0x3a3f13[_0x6c1c('0x15')]='VoiceMusicOnHold';break;case'chanspies':_0x3a3f13['childModel']=_0x6c1c('0x3e');break;case'voiceprefixes':_0x3a3f13['childModel']=_0x6c1c('0x3f');break;case _0x6c1c('0x40'):_0x3a3f13['childModel']=_0x6c1c('0x41');break;case _0x6c1c('0x42'):_0x3a3f13[_0x6c1c('0x15')]='MailQueue';break;case _0x6c1c('0x43'):_0x3a3f13[_0x6c1c('0x15')]='MailAccount';break;case _0x6c1c('0x44'):_0x3a3f13['childModel']=_0x6c1c('0x45');break;case _0x6c1c('0x46'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x47');break;case _0x6c1c('0x48'):_0x3a3f13['childModel']=_0x6c1c('0x49');break;case _0x6c1c('0x4a'):_0x3a3f13[_0x6c1c('0x15')]='SmsQueue';break;case _0x6c1c('0x4b'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x4c');break;case _0x6c1c('0x4d'):_0x3a3f13[_0x6c1c('0x15')]='WhatsappQueue';break;case _0x6c1c('0x4e'):_0x3a3f13['childModel']='WhatsappAccount';break;case'teams':_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x4f');break;case _0x6c1c('0x50'):case _0x6c1c('0x51'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x39');if(_0x12c638){_0x3a3f13[_0x6c1c('0x1e')]=[{'name':_0x6c1c('0x37')},{'name':'QueueCampaigns'}];}break;case _0x6c1c('0x52'):case _0x6c1c('0x53'):case'telephones':_0x3a3f13[_0x6c1c('0x15')]='User';if(_0x12c638){_0x3a3f13[_0x6c1c('0x1e')]=[{'name':_0x6c1c('0x54'),'filter':{'field':_0x6c1c('0x35'),'value':[_0x6c1c('0x55'),_0x6c1c('0x56')]},'ignore':!![]},{'name':'Agents'},{'name':_0x6c1c('0x34')}];}break;case'zendeskaccounts':_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x57');break;case _0x6c1c('0x58'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x59');break;case _0x6c1c('0x5a'):_0x3a3f13['childModel']=_0x6c1c('0x5b');break;case _0x6c1c('0x5c'):_0x3a3f13['childModel']=_0x6c1c('0x5d');break;case _0x6c1c('0x5e'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x5f');break;case'zohoaccounts':_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x60');break;case _0x6c1c('0x61'):_0x3a3f13['childModel']='User';break;case'cannedanswers':_0x3a3f13['childModel']='CannedAnswer';break;case _0x6c1c('0x62'):_0x3a3f13[_0x6c1c('0x15')]='Disposition';break;case _0x6c1c('0x63'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x64');break;case'intervals':_0x3a3f13['childModel']=_0x6c1c('0x65');break;case _0x6c1c('0x66'):_0x3a3f13['childModel']=_0x6c1c('0x67');break;case _0x6c1c('0x68'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x69');break;case _0x6c1c('0x6a'):_0x3a3f13[_0x6c1c('0x15')]='Sound';break;case _0x6c1c('0x6b'):_0x3a3f13[_0x6c1c('0x15')]='Tag';break;case'templates':_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x6c');break;case _0x6c1c('0x6d'):_0x3a3f13['childModel']=_0x6c1c('0x6e');break;case _0x6c1c('0x6f'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x70');break;case'variables':_0x3a3f13['childModel']=_0x6c1c('0x71');break;case _0x6c1c('0x72'):_0x3a3f13[_0x6c1c('0x15')]='Plugin';break;case'extractedreports':_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x10');_0x3a3f13['parentSections']=[{'name':_0x6c1c('0x73'),'field':'id','foreignKey':_0x6c1c('0x74')}];break;case _0x6c1c('0x75'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x76');break;}return _0x3a3f13;}function _0x24c993(_0x4f027a,_0x398bca){var _0x5a2692=_0x4f027a[_0x6c1c('0x77')](0x0)[_0x6c1c('0x78')]()+_0x4f027a[_0x6c1c('0x79')](0x1);var _0x319820={'type':_0x426398['Sequelize']['QueryTypes'][_0x6c1c('0x7a')],'raw':!![]};return new Promise(function(_0x3255e1,_0x612be2){var _0x54da73=squel[_0x6c1c('0x7b')]()[_0x6c1c('0x6')](_0x6c1c('0x7c')+_0x5a2692+_0x6c1c('0x7d'),'id')[_0x6c1c('0x6')](_0x6c1c('0x7e'))[_0x6c1c('0x7f')]('user_has_'+_0x4f027a+_0x6c1c('0x80'),'ui')['where'](_0x6c1c('0x81'),_0x398bca['id']);return _0x426398[_0x6c1c('0x82')][_0x6c1c('0x83')](_0x54da73[_0x6c1c('0x84')](),_0x319820)['then'](function(_0x43423e){_0x398bca[_0x5a2692+_0x6c1c('0x85')]=_0x43423e;_0x3255e1(_0x43423e);})[_0x6c1c('0xa')](function(_0x1de8c9){_0x612be2(_0x1de8c9);});});}return _0x4c33ca[_0x6c1c('0x86')](_0x6c1c('0x87'),attributes,{'tableName':_0x6c1c('0x88'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x458c01){var _0x2d248c={'raw':![],'where':{}};var _0x13963a={};var _0x26ee48={'count':0x0,'rows':[]};var _0x4fa646=_0x458c01[_0x6c1c('0x83')][_0x6c1c('0x89')];var _0x18cb06=_0x458c01[_0x6c1c('0x83')][_0x6c1c('0x8a')]||![];var _0x59bd3f=_0x19c269(_0x4fa646,_0x18cb06);if(!_0x59bd3f[_0x6c1c('0x15')])throw new Error(_0x6c1c('0x8b')+_0x4fa646+'\x27');var _0x494a6f=[{'name':_0x4fa646}];if(!_[_0x6c1c('0x8c')](_0x59bd3f[_0x6c1c('0x1e')]))_0x494a6f=_0x59bd3f[_0x6c1c('0x1e')];var _0x552718=[];for(var _0x3d3ed=0x0;_0x3d3ed<_0x494a6f[_0x6c1c('0x8d')];_0x3d3ed++){_0x552718[_0x6c1c('0x8e')](_0x426398[_0x6c1c('0x8f')][_0x6c1c('0x90')]({'where':{'userProfileId':_0x458c01[_0x6c1c('0x91')]['id'],'name':_0x494a6f[_0x3d3ed]['name']},'raw':!![]}));}return Promise['all'](_0x552718)[_0x6c1c('0x8')](function(_0x153ff1){var _0x5a35a1=_['filter'](_0x153ff1,function(_0x5f125d){return _0x5f125d?_0x5f125d:undefined;});var _0x45da13=_[_0x6c1c('0x5')](_0x494a6f,[_0x6c1c('0x92'),!![]]);var _0x5a7298=_['isEmpty'](_0x5a35a1)&&_[_0x6c1c('0x8c')](_0x45da13)?null:_['union'](_0x45da13,_0x5a35a1);if(!_0x5a7298)return null;var _0x5e3c65=[];for(var _0x4f3ade=0x0;_0x4f3ade<_0x5a7298[_0x6c1c('0x8d')];_0x4f3ade++){var _0x1e20a9=_[_0x6c1c('0x90')](_0x494a6f,function(_0x42ae1b){return _0x5a7298[_0x4f3ade]?_0x42ae1b[_0x6c1c('0xd')]===_0x5a7298[_0x4f3ade][_0x6c1c('0xd')]:null;});if(_0x1e20a9){if(_0x5a7298[_0x4f3ade]['ignore']){_0x5e3c65[_0x6c1c('0x8e')](_0x265d2c(_0x59bd3f[_0x6c1c('0x15')],_0x5a7298[_0x4f3ade]));}else{if(!_0x5a7298[_0x4f3ade][_0x6c1c('0x93')]){_0x5e3c65['push'](_0x5f3758(_0x1e20a9,_0x5a7298[_0x4f3ade],_0x59bd3f['childModel']));}else{if(_0x1e20a9['model']){_0x5e3c65[_0x6c1c('0x8e')](_0x1137e8(_0x1e20a9,_0x5a7298[_0x4f3ade]));}}}}}return Promise[_0x6c1c('0x94')](_0x5e3c65);})['then'](function(_0x10e499){var _0x579ca3=_0x10e499;var _0x40a0c5=null;if(_0x579ca3){_0x40a0c5=_0x579ca3[_0x6c1c('0x8d')]===0x1?_0x579ca3[0x0]:null;}if(!_0x40a0c5&&!_0x579ca3)return _0x26ee48;var _0x1a9489=_0x426398[_0x59bd3f[_0x6c1c('0x15')]]['rawAttributes'];_0x13963a[_0x6c1c('0x95')]=_[_0x6c1c('0x96')](_0x1a9489);_0x13963a['query']=_['keys'](_0x458c01[_0x6c1c('0x83')]);_0x13963a[_0x6c1c('0x97')]=_[_0x6c1c('0x98')](_0x13963a['model'],_0x13963a[_0x6c1c('0x83')]);_0x2d248c[_0x6c1c('0x99')]=_['intersection'](_0x13963a['model'],qs['fields'](_0x458c01['query'][_0x6c1c('0x9a')]));_0x2d248c['attributes']=_0x2d248c[_0x6c1c('0x99')][_0x6c1c('0x8d')]?_0x2d248c[_0x6c1c('0x99')]:_0x13963a['model'];if(!_0x458c01[_0x6c1c('0x83')][_0x6c1c('0x9b')](_0x6c1c('0x9c'))){_0x2d248c[_0x6c1c('0x9d')]=qs[_0x6c1c('0x9d')](_0x458c01['query'][_0x6c1c('0x9d')]);_0x2d248c['offset']=qs[_0x6c1c('0x9e')](_0x458c01[_0x6c1c('0x83')][_0x6c1c('0x9e')]);}_0x2d248c[_0x6c1c('0x9f')]=qs[_0x6c1c('0xa0')](_0x458c01[_0x6c1c('0x83')][_0x6c1c('0xa0')]);_0x2d248c[_0x6c1c('0xa1')]=qs['filters'](_[_0x6c1c('0xa2')](_0x458c01['query'],_0x13963a['filters']));if(_0x458c01[_0x6c1c('0x83')][_0x6c1c('0x5')]){_0x2d248c[_0x6c1c('0xa1')]=_[_0x6c1c('0xa3')](_0x2d248c['where'],{'$or':_[_0x6c1c('0x9')](_0x1a9489,function(_0x4c7856){if(_0x4c7856[_0x6c1c('0x12')]['key']!==_0x6c1c('0xa4')){var _0x23332d={};_0x23332d[_0x4c7856[_0x6c1c('0x6')]]={'$like':'%'+_0x458c01['query'][_0x6c1c('0x5')]+'%'};return _0x23332d;}})});}var _0xa9a844=[];var _0x19a26b=null;var _0x4b5801={};if(_0x40a0c5){_0x19a26b=_[_0x6c1c('0x90')](_0x494a6f,[_0x6c1c('0xd'),_0x40a0c5[_0x6c1c('0xd')]]);if(_0x19a26b[_0x6c1c('0x6')]){_0x4b5801={};if(_0x59bd3f['childModel']===_0x6c1c('0x10')){_0x4b5801[_0x19a26b[_0x6c1c('0xa5')]]=_[_0x6c1c('0x9')](_0x40a0c5[_0x6c1c('0xc')],'id');}else{_0x4b5801[_0x19a26b[_0x6c1c('0xa5')]]=_0x40a0c5['associatedResources'];}_0xa9a844[_0x6c1c('0x8e')](_0x4b5801);}else{_0x2d248c[_0x6c1c('0xa1')]['id']=_0x40a0c5[_0x6c1c('0xc')];}}else{for(var _0x1a5476=0x0;_0x1a5476<_0x579ca3['length'];_0x1a5476++){_0x19a26b=_[_0x6c1c('0x90')](_0x494a6f,[_0x6c1c('0xd'),_0x579ca3[_0x1a5476][_0x6c1c('0xd')]]);if(_0x19a26b['field']){_0x4b5801={};_0x4b5801[_0x19a26b[_0x6c1c('0xa5')]]=_0x579ca3[_0x1a5476][_0x6c1c('0xc')];_0xa9a844['push'](_0x4b5801);}else{if(!_0x2d248c[_0x6c1c('0xa1')]['id'])_0x2d248c['where']['id']=[];_0x579ca3[_0x1a5476][_0x6c1c('0xc')][_0x6c1c('0xa6')](function(_0x246682){_0x2d248c[_0x6c1c('0xa1')]['id']['push'](_0x246682);});}}}if(!_[_0x6c1c('0x8c')](_0xa9a844)){_0x2d248c[_0x6c1c('0xa1')]=_[_0x6c1c('0xa3')](_0x2d248c['where'],{'$and':{'$or':_0xa9a844}});}_0x2d248c=_[_0x6c1c('0xa3')]({},_0x2d248c,_0x458c01[_0x6c1c('0xa7')]);if(_0x40a0c5&&!_0x40a0c5[_0x6c1c('0x93')]&&_0x59bd3f[_0x6c1c('0x15')]==='AnalyticExtractedReport'){if(_0x458c01[_0x6c1c('0x83')][_0x6c1c('0xa8')]){_0x2d248c[_0x6c1c('0xa9')]=[{'all':!![]}];}return _0x426398[_0x59bd3f['childModel']][_0x6c1c('0xb')](_0x2d248c)['then'](function(_0x29c5c8){var _0x27a9ea=[];_0x29c5c8[_0x6c1c('0xa6')](function(_0x1fd7ec){var _0x29da07;switch(_0x1fd7ec[_0x6c1c('0xaa')]){case _0x6c1c('0xab'):_0x29da07=_[_0x6c1c('0x90')](_0x40a0c5['associatedResources'],function(_0x426d7c){return _0x426d7c['id']===_0x1fd7ec['reportId']&&_0x426d7c[_0x6c1c('0x12')]===_0x6c1c('0xac');});break;case _0x6c1c('0xad'):_0x29da07=_[_0x6c1c('0x90')](_0x40a0c5['associatedResources'],function(_0x357e1a){return _0x357e1a['id']===_0x1fd7ec[_0x6c1c('0x74')]&&_0x357e1a[_0x6c1c('0x12')]==='CustomReports';});break;}if(_0x29da07)_0x27a9ea[_0x6c1c('0x8e')](_0x1fd7ec);});_0x26ee48[_0x6c1c('0xae')]=_0x27a9ea['length'];_0x26ee48['rows']=_0x27a9ea;return _0x26ee48;});}else{return _0x426398[_0x59bd3f[_0x6c1c('0x15')]][_0x6c1c('0xae')]({'where':_0x2d248c[_0x6c1c('0xa1')]})[_0x6c1c('0x8')](function(_0x305cc2){_0x26ee48[_0x6c1c('0xae')]=_0x305cc2;if(_0x458c01[_0x6c1c('0x83')][_0x6c1c('0xa8')]){if(_0x59bd3f[_0x6c1c('0x15')]===_0x6c1c('0xaf')){_0x2d248c[_0x6c1c('0xa9')]=[{'model':_0x426398[_0x6c1c('0xb0')],'as':'Tags','attributes':['id',_0x6c1c('0xd'),_0x6c1c('0xb1')],'required':_0x458c01[_0x6c1c('0x83')][_0x6c1c('0xb2')]?!![]:![]},{'model':_0x426398[_0x6c1c('0xb0')],'as':_0x6c1c('0xb3'),'attributes':['id',_0x6c1c('0xd'),'color'],'through':_0x458c01[_0x6c1c('0x83')]['tag']?{'attributes':[],'where':{'TagId':_0x458c01['query'][_0x6c1c('0xb2')]||undefined}}:{},'required':_0x458c01[_0x6c1c('0x83')][_0x6c1c('0xb2')]?!![]:![]}];}else{_0x2d248c[_0x6c1c('0xa9')]=[{'all':!![]}];}}return _0x426398[_0x59bd3f[_0x6c1c('0x15')]][_0x6c1c('0xb')](_0x2d248c);})[_0x6c1c('0x8')](function(_0x2a2797){_0x26ee48[_0x6c1c('0xb4')]=_0x2a2797;if(_0x4fa646===_0x6c1c('0x31')&&_0x458c01['query'][_0x6c1c('0xb5')]===_0x6c1c('0xb6')){var _0x1a0da8=[];for(var _0x3efe9c=0x0;_0x3efe9c<_0x26ee48[_0x6c1c('0xb4')][_0x6c1c('0x8d')];_0x3efe9c++){_0x1a0da8[_0x6c1c('0x8e')](_0x24c993(_0x6c1c('0xb7'),_0x26ee48['rows'][_0x3efe9c][_0x6c1c('0xb8')]));_0x1a0da8[_0x6c1c('0x8e')](_0x24c993(_0x6c1c('0xb9'),_0x26ee48[_0x6c1c('0xb4')][_0x3efe9c][_0x6c1c('0xb8')]));_0x1a0da8[_0x6c1c('0x8e')](_0x24c993(_0x6c1c('0xba'),_0x26ee48[_0x6c1c('0xb4')][_0x3efe9c][_0x6c1c('0xb8')]));_0x1a0da8[_0x6c1c('0x8e')](_0x24c993(_0x6c1c('0xbb'),_0x26ee48[_0x6c1c('0xb4')][_0x3efe9c][_0x6c1c('0xb8')]));_0x1a0da8[_0x6c1c('0x8e')](_0x24c993('openchannel',_0x26ee48['rows'][_0x3efe9c][_0x6c1c('0xb8')]));_0x1a0da8['push'](_0x24c993(_0x6c1c('0xbc'),_0x26ee48[_0x6c1c('0xb4')][_0x3efe9c][_0x6c1c('0xb8')]));}return Promise[_0x6c1c('0x94')](_0x1a0da8)[_0x6c1c('0x8')](function(){return _0x26ee48;});}return _0x26ee48;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 6bfad66..2bb2134 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 _0xd1ca=['./userProfile.socket','register','request','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','UserProfile,\x20%s,\x20%s','message','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','socket.io-emitter'];(function(_0x5aa6a9,_0x3ae14c){var _0x119ce5=function(_0x4a97ef){while(--_0x4a97ef){_0x5aa6a9['push'](_0x5aa6a9['shift']());}};_0x119ce5(++_0x3ae14c);}(_0xd1ca,0x140));var _0xad1c=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xd1ca[_0x1b2ff7];return _0x31656a;};'use strict';var _=require(_0xad1c('0x0'));var util=require(_0xad1c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad1c('0x2'));var db=require(_0xad1c('0x3'))['db'];var utils=require(_0xad1c('0x4'));var logger=require('../../config/logger')(_0xad1c('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xad1c('0x6')][_0xad1c('0x7')]({'port':0x232a});config[_0xad1c('0x8')]=_['defaults'](config[_0xad1c('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xad1c('0x9'))(new Redis(config[_0xad1c('0x8')]));require(_0xad1c('0xa'))[_0xad1c('0xb')](socket);function respondWithRpcPromise(_0x24bad3,_0x27364d,_0x1cc68b){return new BPromise(function(_0x3d790c,_0x46ecae){return client[_0xad1c('0xc')](_0x24bad3,_0x1cc68b)['then'](function(_0x195454){logger[_0xad1c('0xd')]('UserProfile,\x20%s,\x20%s',_0x27364d,_0xad1c('0xe'));logger[_0xad1c('0xf')](_0xad1c('0x10'),_0x27364d,_0xad1c('0xe'),JSON[_0xad1c('0x11')](_0x195454));if(_0x195454[_0xad1c('0x12')]){if(_0x195454[_0xad1c('0x12')]['code']===0x1f4){logger[_0xad1c('0x12')](_0xad1c('0x13'),_0x27364d,_0x195454[_0xad1c('0x12')][_0xad1c('0x14')]);return _0x46ecae(_0x195454[_0xad1c('0x12')]['message']);}logger[_0xad1c('0x12')](_0xad1c('0x13'),_0x27364d,_0x195454[_0xad1c('0x12')][_0xad1c('0x14')]);return _0x3d790c(_0x195454['error'][_0xad1c('0x14')]);}else{logger['info'](_0xad1c('0x13'),_0x27364d,_0xad1c('0xe'));_0x3d790c(_0x195454['result']['message']);}})[_0xad1c('0x15')](function(_0xa353d8){logger[_0xad1c('0x12')](_0xad1c('0x13'),_0x27364d,_0xa353d8);_0x46ecae(_0xa353d8);});});} \ No newline at end of file +var _0xaafc=['localhost','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','redis','defaults'];(function(_0x4b51cd,_0x101350){var _0x14460d=function(_0x17bbff){while(--_0x17bbff){_0x4b51cd['push'](_0x4b51cd['shift']());}};_0x14460d(++_0x101350);}(_0xaafc,0x176));var _0xcaaf=function(_0x131321,_0x257fd8){_0x131321=_0x131321-0x0;var _0x51232a=_0xaafc[_0x131321];return _0x51232a;};'use strict';var _=require('lodash');var util=require(_0xcaaf('0x0'));var moment=require(_0xcaaf('0x1'));var BPromise=require(_0xcaaf('0x2'));var rs=require(_0xcaaf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcaaf('0x4'))['db'];var utils=require(_0xcaaf('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xcaaf('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xcaaf('0x7')]['http']({'port':0x232a});config[_0xcaaf('0x8')]=_[_0xcaaf('0x9')](config[_0xcaaf('0x8')],{'host':_0xcaaf('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcaaf('0x8')]));require('./userProfile.socket')[_0xcaaf('0xb')](socket);function respondWithRpcPromise(_0x54dc9d,_0x94f4d6,_0x5f11b0){return new BPromise(function(_0x163ced,_0x12f13d){return client[_0xcaaf('0xc')](_0x54dc9d,_0x5f11b0)[_0xcaaf('0xd')](function(_0x3c6e77){logger[_0xcaaf('0xe')](_0xcaaf('0xf'),_0x94f4d6,_0xcaaf('0x10'));logger[_0xcaaf('0x11')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x94f4d6,_0xcaaf('0x10'),JSON[_0xcaaf('0x12')](_0x3c6e77));if(_0x3c6e77[_0xcaaf('0x13')]){if(_0x3c6e77[_0xcaaf('0x13')][_0xcaaf('0x14')]===0x1f4){logger[_0xcaaf('0x13')](_0xcaaf('0xf'),_0x94f4d6,_0x3c6e77[_0xcaaf('0x13')][_0xcaaf('0x15')]);return _0x12f13d(_0x3c6e77[_0xcaaf('0x13')][_0xcaaf('0x15')]);}logger['error'](_0xcaaf('0xf'),_0x94f4d6,_0x3c6e77[_0xcaaf('0x13')][_0xcaaf('0x15')]);return _0x163ced(_0x3c6e77[_0xcaaf('0x13')][_0xcaaf('0x15')]);}else{logger[_0xcaaf('0xe')]('UserProfile,\x20%s,\x20%s',_0x94f4d6,_0xcaaf('0x10'));_0x163ced(_0x3c6e77[_0xcaaf('0x16')]['message']);}})[_0xcaaf('0x17')](function(_0x2c988c){logger[_0xcaaf('0x13')](_0xcaaf('0xf'),_0x94f4d6,_0x2c988c);_0x12f13d(_0x2c988c);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 76c524a..956b85a 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 _0x47b0=['remove','update','length','userProfile:','./userProfile.events','save'];(function(_0x355fdd,_0x1b5f2e){var _0x52b12b=function(_0x3b80d4){while(--_0x3b80d4){_0x355fdd['push'](_0x355fdd['shift']());}};_0x52b12b(++_0x1b5f2e);}(_0x47b0,0x112));var _0x047b=function(_0x6b350e,_0x41f42f){_0x6b350e=_0x6b350e-0x0;var _0x26c664=_0x47b0[_0x6b350e];return _0x26c664;};'use strict';var UserProfileEvents=require(_0x047b('0x0'));var events=[_0x047b('0x1'),_0x047b('0x2'),_0x047b('0x3')];function createListener(_0x56537a,_0x151828){return function(_0x1d9c1d){_0x151828['emit'](_0x56537a,_0x1d9c1d);};}function removeListener(_0x32a9f8,_0x23bd21){return function(){UserProfileEvents['removeListener'](_0x32a9f8,_0x23bd21);};}exports['register']=function(_0x13f25d){for(var _0x1070ee=0x0,_0x10300c=events[_0x047b('0x4')];_0x1070ee<_0x10300c;_0x1070ee++){var _0x5576bf=events[_0x1070ee];var _0x343308=createListener(_0x047b('0x5')+_0x5576bf,_0x13f25d);UserProfileEvents['on'](_0x5576bf,_0x343308);}}; \ No newline at end of file +var _0x6fc2=['length','userProfile:','./userProfile.events','remove','update','emit','register'];(function(_0x2c8972,_0x1aff63){var _0x5d1e22=function(_0x56428c){while(--_0x56428c){_0x2c8972['push'](_0x2c8972['shift']());}};_0x5d1e22(++_0x1aff63);}(_0x6fc2,0x64));var _0x26fc=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x6fc2[_0x2112d4];return _0x434972;};'use strict';var UserProfileEvents=require(_0x26fc('0x0'));var events=['save',_0x26fc('0x1'),_0x26fc('0x2')];function createListener(_0x295075,_0x50e4cd){return function(_0x294643){_0x50e4cd[_0x26fc('0x3')](_0x295075,_0x294643);};}function removeListener(_0x12b54f,_0x4a4f6a){return function(){UserProfileEvents['removeListener'](_0x12b54f,_0x4a4f6a);};}exports[_0x26fc('0x4')]=function(_0x3c9cd1){for(var _0x4e255b=0x0,_0x15580b=events[_0x26fc('0x5')];_0x4e255b<_0x15580b;_0x4e255b++){var _0xe38e60=events[_0x4e255b];var _0x10b9f6=createListener(_0x26fc('0x6')+_0xe38e60,_0x3c9cd1);UserProfileEvents['on'](_0xe38e60,_0x10b9f6);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 637605d..7e28f91 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 _0x7f53=['isAuthenticated','index','/describe','/:id','show','post','create','put','update','destroy','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileResource.controller','get'];(function(_0x33c083,_0x524693){var _0x25a74f=function(_0xf9ea42){while(--_0xf9ea42){_0x33c083['push'](_0x33c083['shift']());}};_0x25a74f(++_0x524693);}(_0x7f53,0xd0));var _0x37f5=function(_0x153e7d,_0x10a35f){_0x153e7d=_0x153e7d-0x0;var _0x3c22dd=_0x7f53[_0x153e7d];return _0x3c22dd;};'use strict';var multer=require('multer');var util=require(_0x37f5('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x37f5('0x1'));var router=express[_0x37f5('0x2')]();var fs_extra=require(_0x37f5('0x3'));var auth=require(_0x37f5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x37f5('0x5'));var controller=require(_0x37f5('0x6'));router[_0x37f5('0x7')]('/',auth[_0x37f5('0x8')](),controller[_0x37f5('0x9')]);router[_0x37f5('0x7')](_0x37f5('0xa'),auth[_0x37f5('0x8')](),controller['describe']);router[_0x37f5('0x7')](_0x37f5('0xb'),auth['isAuthenticated'](),controller[_0x37f5('0xc')]);router[_0x37f5('0xd')]('/',auth['isAuthenticated'](),controller[_0x37f5('0xe')]);router[_0x37f5('0xf')](_0x37f5('0xb'),auth[_0x37f5('0x8')](),controller[_0x37f5('0x10')]);router['delete']('/:id',auth[_0x37f5('0x8')](),controller[_0x37f5('0x11')]);module['exports']=router; \ No newline at end of file +var _0x75be=['express','Router','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','delete','destroy','exports','multer','path'];(function(_0x22dcba,_0x315637){var _0x330c1c=function(_0x4aba19){while(--_0x4aba19){_0x22dcba['push'](_0x22dcba['shift']());}};_0x330c1c(++_0x315637);}(_0x75be,0x11b));var _0xe75b=function(_0x5177b9,_0x48f3df){_0x5177b9=_0x5177b9-0x0;var _0x46419b=_0x75be[_0x5177b9];return _0x46419b;};'use strict';var multer=require(_0xe75b('0x0'));var util=require('util');var path=require(_0xe75b('0x1'));var timeout=require('connect-timeout');var express=require(_0xe75b('0x2'));var router=express[_0xe75b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe75b('0x4'));var interaction=require(_0xe75b('0x5'));var config=require('../../config/environment');var controller=require(_0xe75b('0x6'));router[_0xe75b('0x7')]('/',auth[_0xe75b('0x8')](),controller[_0xe75b('0x9')]);router[_0xe75b('0x7')](_0xe75b('0xa'),auth[_0xe75b('0x8')](),controller[_0xe75b('0xb')]);router[_0xe75b('0x7')]('/:id',auth[_0xe75b('0x8')](),controller['show']);router[_0xe75b('0xc')]('/',auth['isAuthenticated'](),controller[_0xe75b('0xd')]);router[_0xe75b('0xe')](_0xe75b('0xf'),auth[_0xe75b('0x8')](),controller['update']);router[_0xe75b('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xe75b('0x11')]);module[_0xe75b('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 9f76c33..f3375af 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 _0x85fc=['STRING','sequelize','exports','INTEGER'];(function(_0x1ec607,_0x283fc0){var _0x5025e7=function(_0x138ed4){while(--_0x138ed4){_0x1ec607['push'](_0x1ec607['shift']());}};_0x5025e7(++_0x283fc0);}(_0x85fc,0x1d9));var _0xc85f=function(_0x1660c1,_0x330b1c){_0x1660c1=_0x1660c1-0x0;var _0x1a13ea=_0x85fc[_0x1660c1];return _0x1a13ea;};'use strict';var Sequelize=require(_0xc85f('0x0'));module[_0xc85f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xc85f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xc85f('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x567d=['STRING','exports'];(function(_0x56a6b6,_0x3e35a9){var _0x47a5b4=function(_0x348a5c){while(--_0x348a5c){_0x56a6b6['push'](_0x56a6b6['shift']());}};_0x47a5b4(++_0x3e35a9);}(_0x567d,0x93));var _0xd567=function(_0x357e51,_0x455cb3){_0x357e51=_0x357e51-0x0;var _0x2a8d9a=_0x567d[_0x357e51];return _0x2a8d9a;};'use strict';var Sequelize=require('sequelize');module[_0xd567('0x0')]={'name':{'type':Sequelize[_0xd567('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xd567('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index d5974b8..8432d2b 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 _0x187d=['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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','error','stack','name','index','map','UserProfileResource','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','where','filter','merge','includeAll','include','findAll','then','rows','catch','show','params','fields','options','find','create','body','describe','eml-format'];(function(_0x462221,_0x2b34ea){var _0x545588=function(_0x289066){while(--_0x289066){_0x462221['push'](_0x462221['shift']());}};_0x545588(++_0x2b34ea);}(_0x187d,0x93));var _0xd187=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x187d[_0x45e98e];return _0x374dba;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];function respondWithStatusCode(_0x4545cf,_0x32ba07){_0x32ba07=_0x32ba07||0xcc;return function(_0x59ee4a){if(_0x59ee4a){return _0x4545cf[_0xd187('0x1b')](_0x32ba07);}return _0x4545cf[_0xd187('0x1c')](_0x32ba07)[_0xd187('0x1d')]();};}function respondWithResult(_0x126d1a,_0x517b25){_0x517b25=_0x517b25||0xc8;return function(_0x39a927){if(_0x39a927){return _0x126d1a[_0xd187('0x1c')](_0x517b25)[_0xd187('0x1e')](_0x39a927);}};}function respondWithFilteredResult(_0x188cfe,_0x4c8f68){return function(_0x245d3e){if(_0x245d3e){var _0x52a208=typeof _0x4c8f68['offset']===_0xd187('0x1f')&&typeof _0x4c8f68['limit']==='undefined';var _0x207b36=_0x245d3e[_0xd187('0x20')];var _0x374fe0=_0x52a208?0x0:_0x4c8f68[_0xd187('0x21')];var _0x21df74=_0x52a208?_0x245d3e[_0xd187('0x20')]:_0x4c8f68[_0xd187('0x21')]+_0x4c8f68[_0xd187('0x22')];var _0x4f2f88;if(_0x21df74>=_0x207b36){_0x21df74=_0x207b36;_0x4f2f88=0xc8;}else{_0x4f2f88=0xce;}_0x188cfe[_0xd187('0x1c')](_0x4f2f88);return _0x188cfe[_0xd187('0x23')](_0xd187('0x24'),_0x374fe0+'-'+_0x21df74+'/'+_0x207b36)[_0xd187('0x1e')](_0x245d3e);}return null;};}function patchUpdates(_0x5204ee){return function(_0x2f7fb3){try{jsonpatch[_0xd187('0x25')](_0x2f7fb3,_0x5204ee,!![]);}catch(_0xc5bba5){return BPromise['reject'](_0xc5bba5);}return _0x2f7fb3['save']();};}function saveUpdates(_0x57cf1d,_0x435d94){return function(_0x33741d){if(_0x33741d){return _0x33741d[_0xd187('0x26')](_0x57cf1d)['then'](function(_0x2c07c8){return _0x2c07c8;});}return null;};}function removeEntity(_0x57186b,_0x145771){return function(_0x5a7a23){if(_0x5a7a23){return _0x5a7a23[_0xd187('0x27')]()['then'](function(){_0x57186b['status'](0xcc)[_0xd187('0x1d')]();});}};}function handleEntityNotFound(_0x4d992b,_0x12da33){return function(_0x598aa4){if(!_0x598aa4){_0x4d992b['sendStatus'](0x194);}return _0x598aa4;};}function handleError(_0x4eac6a,_0x848ddd){_0x848ddd=_0x848ddd||0x1f4;return function(_0xeff822){logger[_0xd187('0x28')](_0xeff822[_0xd187('0x29')]);if(_0xeff822['name']){delete _0xeff822[_0xd187('0x2a')];}_0x4eac6a[_0xd187('0x1c')](_0x848ddd)['send'](_0xeff822);};}exports[_0xd187('0x2b')]=function(_0x1c87ee,_0x34febe){var _0x4c50a5={},_0x15e2e8={},_0x56e292={'count':0x0,'rows':[]};var _0x263e31=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x489f2e){return{'name':_0x489f2e[_0xd187('0x2f')],'type':_0x489f2e[_0xd187('0x30')]['key']};});_0x15e2e8['model']=_[_0xd187('0x2c')](_0x263e31,_0xd187('0x2a'));_0x15e2e8[_0xd187('0x31')]=_[_0xd187('0x32')](_0x1c87ee[_0xd187('0x31')]);_0x15e2e8[_0xd187('0x33')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],_0x15e2e8['query']);_0x4c50a5[_0xd187('0x36')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],qs['fields'](_0x1c87ee[_0xd187('0x31')]['fields']));_0x4c50a5[_0xd187('0x36')]=_0x4c50a5[_0xd187('0x36')][_0xd187('0x37')]?_0x4c50a5['attributes']:_0x15e2e8['model'];if(!_0x1c87ee[_0xd187('0x31')][_0xd187('0x38')]('nolimit')){_0x4c50a5[_0xd187('0x22')]=qs[_0xd187('0x22')](_0x1c87ee[_0xd187('0x31')]['limit']);_0x4c50a5['offset']=qs[_0xd187('0x21')](_0x1c87ee[_0xd187('0x31')]['offset']);}_0x4c50a5['order']=qs['sort'](_0x1c87ee[_0xd187('0x31')]['sort']);_0x4c50a5[_0xd187('0x39')]=qs[_0xd187('0x33')](_['pick'](_0x1c87ee[_0xd187('0x31')],_0x15e2e8['filters']),_0x263e31);if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]){_0x4c50a5['where']=_[_0xd187('0x3b')](_0x4c50a5[_0xd187('0x39')],{'$or':_['map'](_0x263e31,function(_0x4399a5){if(_0x4399a5['type']!=='VIRTUAL'){var _0x26b06d={};_0x26b06d[_0x4399a5[_0xd187('0x2a')]]={'$like':'%'+_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]+'%'};return _0x26b06d;}})});}_0x4c50a5=_[_0xd187('0x3b')]({},_0x4c50a5,_0x1c87ee['options']);var _0x8860c={'where':_0x4c50a5[_0xd187('0x39')]};return db[_0xd187('0x2d')]['count'](_0x8860c)['then'](function(_0x538c05){_0x56e292['count']=_0x538c05;if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3c')]){_0x4c50a5[_0xd187('0x3d')]=[{'all':!![]}];}return db[_0xd187('0x2d')][_0xd187('0x3e')](_0x4c50a5);})[_0xd187('0x3f')](function(_0x4699e1){_0x56e292[_0xd187('0x40')]=_0x4699e1;return _0x56e292;})['then'](respondWithFilteredResult(_0x34febe,_0x4c50a5))[_0xd187('0x41')](handleError(_0x34febe,null));};exports[_0xd187('0x42')]=function(_0x31d9d2,_0x51c7fc){var _0x21cbf6={'raw':![],'where':{'id':_0x31d9d2[_0xd187('0x43')]['id']}},_0x48c100={};_0x48c100[_0xd187('0x35')]=_[_0xd187('0x32')](db[_0xd187('0x2d')][_0xd187('0x2e')]);_0x48c100['query']=_[_0xd187('0x32')](_0x31d9d2[_0xd187('0x31')]);_0x48c100[_0xd187('0x33')]=_[_0xd187('0x34')](_0x48c100['model'],_0x48c100[_0xd187('0x31')]);_0x21cbf6[_0xd187('0x36')]=_['intersection'](_0x48c100[_0xd187('0x35')],qs[_0xd187('0x44')](_0x31d9d2['query']['fields']));_0x21cbf6[_0xd187('0x36')]=_0x21cbf6[_0xd187('0x36')]['length']?_0x21cbf6['attributes']:_0x48c100['model'];if(_0x31d9d2[_0xd187('0x31')][_0xd187('0x3c')]){_0x21cbf6[_0xd187('0x3d')]=[{'all':!![]}];}_0x21cbf6=_[_0xd187('0x3b')]({},_0x21cbf6,_0x31d9d2[_0xd187('0x45')]);return db[_0xd187('0x2d')][_0xd187('0x46')](_0x21cbf6)['then'](handleEntityNotFound(_0x51c7fc,null))[_0xd187('0x3f')](respondWithResult(_0x51c7fc,null))[_0xd187('0x41')](handleError(_0x51c7fc,null));};exports[_0xd187('0x47')]=function(_0x3ce4a1,_0x3f5def){return db[_0xd187('0x2d')][_0xd187('0x47')](_0x3ce4a1[_0xd187('0x48')],{})['then'](respondWithResult(_0x3f5def,0xc9))[_0xd187('0x41')](handleError(_0x3f5def,null));};exports[_0xd187('0x26')]=function(_0x4523c8,_0x1449d7){if(_0x4523c8[_0xd187('0x48')]['id']){delete _0x4523c8['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x46')]({'where':{'id':_0x4523c8['params']['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x1449d7,null))[_0xd187('0x3f')](saveUpdates(_0x4523c8['body'],null))['then'](respondWithResult(_0x1449d7,null))['catch'](handleError(_0x1449d7,null));};exports['destroy']=function(_0x473bef,_0x22f432){return db[_0xd187('0x2d')][_0xd187('0x46')]({'where':{'id':_0x473bef[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x22f432,null))[_0xd187('0x3f')](removeEntity(_0x22f432,null))['catch'](handleError(_0x22f432,null));};exports[_0xd187('0x49')]=function(_0x3aaeaa,_0x1b12c4){return db[_0xd187('0x2d')]['describe']()[_0xd187('0x3f')](respondWithResult(_0x1b12c4,null))['catch'](handleError(_0x1b12c4,null));}; \ No newline at end of file +var _0x5f2f=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x101d5b,_0x40cfd){var _0x382a50=function(_0x2fd131){while(--_0x2fd131){_0x101d5b['push'](_0x101d5b['shift']());}};_0x382a50(++_0x40cfd);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2449c8,_0x517beb){_0x2449c8=_0x2449c8-0x0;var _0x3540ed=_0x5f2f[_0x2449c8];return _0x3540ed;};'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 diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index a7f5844..ddfdfa0 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 _0x1872=['define','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userProfileResource.attributes','exports'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x1872,0xd6));var _0x2187=function(_0x20ba6d,_0x256177){_0x20ba6d=_0x20ba6d-0x0;var _0x338188=_0x1872[_0x20ba6d];return _0x338188;};'use strict';var _=require(_0x2187('0x0'));var util=require(_0x2187('0x1'));var logger=require(_0x2187('0x2'))(_0x2187('0x3'));var moment=require(_0x2187('0x4'));var BPromise=require(_0x2187('0x5'));var rp=require(_0x2187('0x6'));var fs=require('fs');var path=require(_0x2187('0x7'));var rimraf=require(_0x2187('0x8'));var config=require('../../config/environment');var attributes=require(_0x2187('0x9'));module[_0x2187('0xa')]=function(_0x590abc,_0x348152){return _0x590abc[_0x2187('0xb')]('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x2187('0xc'),'fields':[_0x2187('0xd'),_0x2187('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcd54=['compositeIndex','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','UserProfileResource'];(function(_0x35ad5c,_0x58ccf7){var _0x2bd8aa=function(_0x426bdf){while(--_0x426bdf){_0x35ad5c['push'](_0x35ad5c['shift']());}};_0x2bd8aa(++_0x58ccf7);}(_0xcd54,0x123));var _0x4cd5=function(_0x11c327,_0x1132c0){_0x11c327=_0x11c327-0x0;var _0x151829=_0xcd54[_0x11c327];return _0x151829;};'use strict';var _=require(_0x4cd5('0x0'));var util=require(_0x4cd5('0x1'));var logger=require(_0x4cd5('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4cd5('0x3'));var fs=require('fs');var path=require(_0x4cd5('0x4'));var rimraf=require(_0x4cd5('0x5'));var config=require(_0x4cd5('0x6'));var attributes=require(_0x4cd5('0x7'));module['exports']=function(_0xa266b1,_0x3767b9){return _0xa266b1['define'](_0x4cd5('0x8'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x4cd5('0x9'),'fields':['resourceId','sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 6b3ec44..6b27f62 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 _0x699a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x699a,0x175));var _0xa699=function(_0x1667df,_0x266940){_0x1667df=_0x1667df-0x0;var _0x341abf=_0x699a[_0x1667df];return _0x341abf;};'use strict';var _=require(_0xa699('0x0'));var util=require(_0xa699('0x1'));var moment=require(_0xa699('0x2'));var BPromise=require(_0xa699('0x3'));var rs=require(_0xa699('0x4'));var fs=require('fs');var Redis=require(_0xa699('0x5'));var db=require(_0xa699('0x6'))['db'];var utils=require(_0xa699('0x7'));var logger=require('../../config/logger')(_0xa699('0x8'));var config=require(_0xa699('0x9'));var jayson=require(_0xa699('0xa'));var client=jayson[_0xa699('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5cf8cc,_0x15abe5,_0x5fb649){return new BPromise(function(_0x260438,_0x242af1){return client[_0xa699('0xc')](_0x5cf8cc,_0x5fb649)[_0xa699('0xd')](function(_0x3a6b5b){logger[_0xa699('0xe')](_0xa699('0xf'),_0x15abe5,_0xa699('0x10'));logger[_0xa699('0x11')](_0xa699('0x12'),_0x15abe5,_0xa699('0x10'),JSON[_0xa699('0x13')](_0x3a6b5b));if(_0x3a6b5b['error']){if(_0x3a6b5b[_0xa699('0x14')][_0xa699('0x15')]===0x1f4){logger['error'](_0xa699('0xf'),_0x15abe5,_0x3a6b5b[_0xa699('0x14')][_0xa699('0x16')]);return _0x242af1(_0x3a6b5b[_0xa699('0x14')][_0xa699('0x16')]);}logger['error'](_0xa699('0xf'),_0x15abe5,_0x3a6b5b[_0xa699('0x14')]['message']);return _0x260438(_0x3a6b5b['error'][_0xa699('0x16')]);}else{logger[_0xa699('0xe')](_0xa699('0xf'),_0x15abe5,_0xa699('0x10'));_0x260438(_0x3a6b5b[_0xa699('0x17')]['message']);}})[_0xa699('0x18')](function(_0x4b3105){logger['error'](_0xa699('0xf'),_0x15abe5,_0x4b3105);_0x242af1(_0x4b3105);});});} \ No newline at end of file +var _0xee1f=['request','info','UserProfileResource,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x489d51,_0x433289){var _0x2451d3=function(_0x5143f3){while(--_0x5143f3){_0x489d51['push'](_0x489d51['shift']());}};_0x2451d3(++_0x433289);}(_0xee1f,0x8f));var _0xfee1=function(_0x31e3d9,_0x5ddc23){_0x31e3d9=_0x31e3d9-0x0;var _0x341935=_0xee1f[_0x31e3d9];return _0x341935;};'use strict';var _=require(_0xfee1('0x0'));var util=require('util');var moment=require(_0xfee1('0x1'));var BPromise=require('bluebird');var rs=require(_0xfee1('0x2'));var fs=require('fs');var Redis=require(_0xfee1('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfee1('0x4'))(_0xfee1('0x5'));var config=require(_0xfee1('0x6'));var jayson=require(_0xfee1('0x7'));var client=jayson[_0xfee1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46db22,_0x10e7fc,_0x34774a){return new BPromise(function(_0x472ea2,_0x535d24){return client[_0xfee1('0x9')](_0x46db22,_0x34774a)['then'](function(_0x87b06d){logger[_0xfee1('0xa')](_0xfee1('0xb'),_0x10e7fc,'request\x20sent');logger[_0xfee1('0xc')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x10e7fc,_0xfee1('0xd'),JSON[_0xfee1('0xe')](_0x87b06d));if(_0x87b06d[_0xfee1('0xf')]){if(_0x87b06d[_0xfee1('0xf')][_0xfee1('0x10')]===0x1f4){logger[_0xfee1('0xf')]('UserProfileResource,\x20%s,\x20%s',_0x10e7fc,_0x87b06d[_0xfee1('0xf')]['message']);return _0x535d24(_0x87b06d[_0xfee1('0xf')]['message']);}logger[_0xfee1('0xf')](_0xfee1('0xb'),_0x10e7fc,_0x87b06d['error'][_0xfee1('0x11')]);return _0x472ea2(_0x87b06d['error']['message']);}else{logger[_0xfee1('0xa')]('UserProfileResource,\x20%s,\x20%s',_0x10e7fc,_0xfee1('0xd'));_0x472ea2(_0x87b06d[_0xfee1('0x12')]['message']);}})['catch'](function(_0x11a72f){logger['error'](_0xfee1('0xb'),_0x10e7fc,_0x11a72f);_0x535d24(_0x11a72f);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index d6e26e7..390a493 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 _0x6b79=['fs-extra','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','get','/describe','describe','show','post','create','/:id','update','delete','destroy','exports','util','express'];(function(_0x4cea8c,_0x3b3b5f){var _0x19b1c3=function(_0x363645){while(--_0x363645){_0x4cea8c['push'](_0x4cea8c['shift']());}};_0x19b1c3(++_0x3b3b5f);}(_0x6b79,0x1e4));var _0x96b7=function(_0x2f2582,_0xd42a1b){_0x2f2582=_0x2f2582-0x0;var _0x3e797f=_0x6b79[_0x2f2582];return _0x3e797f;};'use strict';var multer=require('multer');var util=require(_0x96b7('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x96b7('0x1'));var router=express['Router']();var fs_extra=require(_0x96b7('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x96b7('0x3'));var config=require(_0x96b7('0x4'));var controller=require(_0x96b7('0x5'));router['get']('/',auth[_0x96b7('0x6')](),controller['index']);router[_0x96b7('0x7')](_0x96b7('0x8'),auth[_0x96b7('0x6')](),controller[_0x96b7('0x9')]);router['get']('/:id',auth[_0x96b7('0x6')](),controller[_0x96b7('0xa')]);router[_0x96b7('0xb')]('/',auth[_0x96b7('0x6')](),controller[_0x96b7('0xc')]);router['put'](_0x96b7('0xd'),auth[_0x96b7('0x6')](),controller[_0x96b7('0xe')]);router[_0x96b7('0xf')](_0x96b7('0xd'),auth[_0x96b7('0x6')](),controller[_0x96b7('0x10')]);module[_0x96b7('0x11')]=router; \ No newline at end of file +var _0xc1ab=['get','isAuthenticated','index','/describe','describe','/:id','show','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc1ab,0x74));var _0xbc1a=function(_0x4169b7,_0x4dc964){_0x4169b7=_0x4169b7-0x0;var _0x1e1005=_0xc1ab[_0x4169b7];return _0x1e1005;};'use strict';var multer=require('multer');var util=require(_0xbc1a('0x0'));var path=require(_0xbc1a('0x1'));var timeout=require(_0xbc1a('0x2'));var express=require(_0xbc1a('0x3'));var router=express[_0xbc1a('0x4')]();var fs_extra=require(_0xbc1a('0x5'));var auth=require(_0xbc1a('0x6'));var interaction=require(_0xbc1a('0x7'));var config=require(_0xbc1a('0x8'));var controller=require(_0xbc1a('0x9'));router[_0xbc1a('0xa')]('/',auth[_0xbc1a('0xb')](),controller[_0xbc1a('0xc')]);router[_0xbc1a('0xa')](_0xbc1a('0xd'),auth[_0xbc1a('0xb')](),controller[_0xbc1a('0xe')]);router[_0xbc1a('0xa')](_0xbc1a('0xf'),auth[_0xbc1a('0xb')](),controller[_0xbc1a('0x10')]);router['post']('/',auth[_0xbc1a('0xb')](),controller['create']);router[_0xbc1a('0x11')]('/:id',auth[_0xbc1a('0xb')](),controller[_0xbc1a('0x12')]);router['delete'](_0xbc1a('0xf'),auth['isAuthenticated'](),controller[_0xbc1a('0x13')]);module[_0xbc1a('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 3040155..2227f3f 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 _0x087b=['getDataValue','split','sequelize','exports','INTEGER','BOOLEAN','STRING','setDataValue','crudPermissions','join'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x087b,0x11a));var _0xb087=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x087b[_0x29d915];return _0x160f86;};'use strict';var Sequelize=require(_0xb087('0x0'));module[_0xb087('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0xb087('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xb087('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xb087('0x4')],'set':function(_0x1d3299){this[_0xb087('0x5')](_0xb087('0x6'),_0x1d3299?_0x1d3299[_0xb087('0x7')](''):[]);},'get':function(){return this[_0xb087('0x8')](_0xb087('0x6'))?this[_0xb087('0x8')](_0xb087('0x6'))[_0xb087('0x9')](''):[];}}}; \ No newline at end of file +var _0x1399=['sequelize','exports','STRING','BOOLEAN','setDataValue','crudPermissions','getDataValue'];(function(_0x564f1e,_0x45fc17){var _0x3fd66d=function(_0x18c11b){while(--_0x18c11b){_0x564f1e['push'](_0x564f1e['shift']());}};_0x3fd66d(++_0x45fc17);}(_0x1399,0x16c));var _0x9139=function(_0xe4976c,_0x50e724){_0xe4976c=_0xe4976c-0x0;var _0xb69102=_0x1399[_0xe4976c];return _0xb69102;};'use strict';var Sequelize=require(_0x9139('0x0'));module[_0x9139('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x9139('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x9139('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x9139('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x9139('0x2')],'set':function(_0x28f155){this[_0x9139('0x4')](_0x9139('0x5'),_0x28f155?_0x28f155['join'](''):[]);},'get':function(){return this['getDataValue'](_0x9139('0x5'))?this[_0x9139('0x6')](_0x9139('0x5'))['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 2eb8cf6..c36de56 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 _0x0b1b=['show','params','keys','find','create','body','destroy','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','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','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','stack','name','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0b1b,0xef));var _0xb0b1=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x0b1b[_0x725b8e];return _0x43ac45;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb0b1('0x0'));var zipdir=require(_0xb0b1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb0b1('0x2'));var moment=require(_0xb0b1('0x3'));var BPromise=require(_0xb0b1('0x4'));var Mustache=require(_0xb0b1('0x5'));var util=require('util');var path=require(_0xb0b1('0x6'));var sox=require(_0xb0b1('0x7'));var csv=require(_0xb0b1('0x8'));var ejs=require(_0xb0b1('0x9'));var fs=require('fs');var fs_extra=require(_0xb0b1('0xa'));var _=require(_0xb0b1('0xb'));var squel=require(_0xb0b1('0xc'));var crypto=require(_0xb0b1('0xd'));var jsforce=require(_0xb0b1('0xe'));var deskjs=require(_0xb0b1('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb0b1('0x10'));var Papa=require(_0xb0b1('0x11'));var Redis=require(_0xb0b1('0x12'));var authService=require(_0xb0b1('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb0b1('0x14'));var hardwareService=require(_0xb0b1('0x15'));var logger=require(_0xb0b1('0x16'))(_0xb0b1('0x17'));var utils=require(_0xb0b1('0x18'));var config=require(_0xb0b1('0x19'));var licenseUtil=require(_0xb0b1('0x1a'));var db=require(_0xb0b1('0x1b'))['db'];function respondWithStatusCode(_0xba4b08,_0x5edb86){_0x5edb86=_0x5edb86||0xcc;return function(_0x208dff){if(_0x208dff){return _0xba4b08[_0xb0b1('0x1c')](_0x5edb86);}return _0xba4b08[_0xb0b1('0x1d')](_0x5edb86)[_0xb0b1('0x1e')]();};}function respondWithResult(_0x52177b,_0x196d5c){_0x196d5c=_0x196d5c||0xc8;return function(_0x4c6e95){if(_0x4c6e95){return _0x52177b['status'](_0x196d5c)['json'](_0x4c6e95);}};}function respondWithFilteredResult(_0x2b887c,_0x34efe5){return function(_0x4f42a0){if(_0x4f42a0){var _0x329e54=typeof _0x34efe5[_0xb0b1('0x1f')]===_0xb0b1('0x20')&&typeof _0x34efe5[_0xb0b1('0x21')]===_0xb0b1('0x20');var _0x5aead4=_0x4f42a0[_0xb0b1('0x22')];var _0x49cb96=_0x329e54?0x0:_0x34efe5[_0xb0b1('0x1f')];var _0x15b248=_0x329e54?_0x4f42a0[_0xb0b1('0x22')]:_0x34efe5['offset']+_0x34efe5['limit'];var _0x730043;if(_0x15b248>=_0x5aead4){_0x15b248=_0x5aead4;_0x730043=0xc8;}else{_0x730043=0xce;}_0x2b887c['status'](_0x730043);return _0x2b887c['set'](_0xb0b1('0x23'),_0x49cb96+'-'+_0x15b248+'/'+_0x5aead4)[_0xb0b1('0x24')](_0x4f42a0);}return null;};}function patchUpdates(_0x1666dc){return function(_0x34bf5a){try{jsonpatch[_0xb0b1('0x25')](_0x34bf5a,_0x1666dc,!![]);}catch(_0x16c0d4){return BPromise[_0xb0b1('0x26')](_0x16c0d4);}return _0x34bf5a['save']();};}function saveUpdates(_0xf70bf3,_0x2d50dc){return function(_0x4ad925){if(_0x4ad925){return _0x4ad925[_0xb0b1('0x27')](_0xf70bf3)[_0xb0b1('0x28')](function(_0x584389){return _0x584389;});}return null;};}function removeEntity(_0x4d6d52,_0x252d8e){return function(_0x2c59d4){if(_0x2c59d4){return _0x2c59d4['destroy']()[_0xb0b1('0x28')](function(){_0x4d6d52[_0xb0b1('0x1d')](0xcc)[_0xb0b1('0x1e')]();});}};}function handleEntityNotFound(_0xc99135,_0x3c37a4){return function(_0x32d6fe){if(!_0x32d6fe){_0xc99135[_0xb0b1('0x1c')](0x194);}return _0x32d6fe;};}function handleError(_0x1d40cb,_0x410a90){_0x410a90=_0x410a90||0x1f4;return function(_0x3ba679){logger['error'](_0x3ba679[_0xb0b1('0x29')]);if(_0x3ba679[_0xb0b1('0x2a')]){delete _0x3ba679[_0xb0b1('0x2a')];}_0x1d40cb[_0xb0b1('0x1d')](_0x410a90)['send'](_0x3ba679);};}exports[_0xb0b1('0x2b')]=function(_0x4255bb,_0x1f4636){var _0xc62620={},_0x5542e2={},_0x1282ab={'count':0x0,'rows':[]};var _0x4c780e=_[_0xb0b1('0x2c')](db[_0xb0b1('0x2d')][_0xb0b1('0x2e')],function(_0x149c19){return{'name':_0x149c19[_0xb0b1('0x2f')],'type':_0x149c19[_0xb0b1('0x30')][_0xb0b1('0x31')]};});_0x5542e2[_0xb0b1('0x32')]=_[_0xb0b1('0x2c')](_0x4c780e,'name');_0x5542e2[_0xb0b1('0x33')]=_['keys'](_0x4255bb[_0xb0b1('0x33')]);_0x5542e2[_0xb0b1('0x34')]=_[_0xb0b1('0x35')](_0x5542e2['model'],_0x5542e2['query']);_0xc62620['attributes']=_[_0xb0b1('0x35')](_0x5542e2[_0xb0b1('0x32')],qs[_0xb0b1('0x36')](_0x4255bb[_0xb0b1('0x33')][_0xb0b1('0x36')]));_0xc62620[_0xb0b1('0x37')]=_0xc62620[_0xb0b1('0x37')][_0xb0b1('0x38')]?_0xc62620['attributes']:_0x5542e2[_0xb0b1('0x32')];if(!_0x4255bb[_0xb0b1('0x33')][_0xb0b1('0x39')](_0xb0b1('0x3a'))){_0xc62620[_0xb0b1('0x21')]=qs[_0xb0b1('0x21')](_0x4255bb[_0xb0b1('0x33')]['limit']);_0xc62620[_0xb0b1('0x1f')]=qs['offset'](_0x4255bb[_0xb0b1('0x33')]['offset']);}_0xc62620['order']=qs[_0xb0b1('0x3b')](_0x4255bb[_0xb0b1('0x33')][_0xb0b1('0x3b')]);_0xc62620[_0xb0b1('0x3c')]=qs['filters'](_[_0xb0b1('0x3d')](_0x4255bb[_0xb0b1('0x33')],_0x5542e2['filters']),_0x4c780e);if(_0x4255bb[_0xb0b1('0x33')]['filter']){_0xc62620['where']=_[_0xb0b1('0x3e')](_0xc62620['where'],{'$or':_[_0xb0b1('0x2c')](_0x4c780e,function(_0x5d8935){if(_0x5d8935[_0xb0b1('0x30')]!==_0xb0b1('0x3f')){var _0x18b847={};_0x18b847[_0x5d8935[_0xb0b1('0x2a')]]={'$like':'%'+_0x4255bb['query'][_0xb0b1('0x40')]+'%'};return _0x18b847;}})});}_0xc62620=_['merge']({},_0xc62620,_0x4255bb['options']);var _0x4bceda={'where':_0xc62620['where']};return db[_0xb0b1('0x2d')][_0xb0b1('0x22')](_0x4bceda)[_0xb0b1('0x28')](function(_0x411c95){_0x1282ab[_0xb0b1('0x22')]=_0x411c95;if(_0x4255bb[_0xb0b1('0x33')][_0xb0b1('0x41')]){_0xc62620[_0xb0b1('0x42')]=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0xc62620);})[_0xb0b1('0x28')](function(_0x52bcec){_0x1282ab[_0xb0b1('0x43')]=_0x52bcec;return _0x1282ab;})['then'](respondWithFilteredResult(_0x1f4636,_0xc62620))[_0xb0b1('0x44')](handleError(_0x1f4636,null));};exports[_0xb0b1('0x45')]=function(_0x3619dd,_0x2f1930){var _0x5b0b6e={'raw':![],'where':{'id':_0x3619dd[_0xb0b1('0x46')]['id']}},_0x285f16={};_0x285f16[_0xb0b1('0x32')]=_[_0xb0b1('0x47')](db[_0xb0b1('0x2d')][_0xb0b1('0x2e')]);_0x285f16[_0xb0b1('0x33')]=_[_0xb0b1('0x47')](_0x3619dd['query']);_0x285f16[_0xb0b1('0x34')]=_[_0xb0b1('0x35')](_0x285f16[_0xb0b1('0x32')],_0x285f16[_0xb0b1('0x33')]);_0x5b0b6e[_0xb0b1('0x37')]=_[_0xb0b1('0x35')](_0x285f16[_0xb0b1('0x32')],qs[_0xb0b1('0x36')](_0x3619dd['query'][_0xb0b1('0x36')]));_0x5b0b6e[_0xb0b1('0x37')]=_0x5b0b6e[_0xb0b1('0x37')]['length']?_0x5b0b6e[_0xb0b1('0x37')]:_0x285f16['model'];if(_0x3619dd[_0xb0b1('0x33')][_0xb0b1('0x41')]){_0x5b0b6e[_0xb0b1('0x42')]=[{'all':!![]}];}_0x5b0b6e=_[_0xb0b1('0x3e')]({},_0x5b0b6e,_0x3619dd['options']);return db[_0xb0b1('0x2d')][_0xb0b1('0x48')](_0x5b0b6e)[_0xb0b1('0x28')](handleEntityNotFound(_0x2f1930,null))['then'](respondWithResult(_0x2f1930,null))['catch'](handleError(_0x2f1930,null));};exports['create']=function(_0x564b34,_0x3f70b5){return db['UserProfileSection'][_0xb0b1('0x49')](_0x564b34[_0xb0b1('0x4a')],{})[_0xb0b1('0x28')](respondWithResult(_0x3f70b5,0xc9))[_0xb0b1('0x44')](handleError(_0x3f70b5,null));};exports[_0xb0b1('0x27')]=function(_0xac55b2,_0x425ee2){if(_0xac55b2[_0xb0b1('0x4a')]['id']){delete _0xac55b2[_0xb0b1('0x4a')]['id'];}return db['UserProfileSection'][_0xb0b1('0x48')]({'where':{'id':_0xac55b2[_0xb0b1('0x46')]['id']}})[_0xb0b1('0x28')](handleEntityNotFound(_0x425ee2,null))[_0xb0b1('0x28')](saveUpdates(_0xac55b2[_0xb0b1('0x4a')],null))[_0xb0b1('0x28')](respondWithResult(_0x425ee2,null))[_0xb0b1('0x44')](handleError(_0x425ee2,null));};exports[_0xb0b1('0x4b')]=function(_0x12231b,_0x5a35ba){return db[_0xb0b1('0x2d')][_0xb0b1('0x48')]({'where':{'id':_0x12231b[_0xb0b1('0x46')]['id']}})[_0xb0b1('0x28')](handleEntityNotFound(_0x5a35ba,null))['then'](removeEntity(_0x5a35ba,null))[_0xb0b1('0x44')](handleError(_0x5a35ba,null));};exports[_0xb0b1('0x4c')]=function(_0x200f97,_0x13c5c3){return db[_0xb0b1('0x2d')]['describe']()[_0xb0b1('0x28')](respondWithResult(_0x13c5c3,null))[_0xb0b1('0x44')](handleError(_0x13c5c3,null));}; \ No newline at end of file +var _0x55b5=['update','then','destroy','sendStatus','error','stack','name','send','index','UserProfileSection','rawAttributes','fieldName','type','key','model','map','keys','intersection','attributes','fields','length','query','hasOwnProperty','order','sort','filters','filter','where','merge','options','include','findAll','catch','show','params','find','body','describe','eml-format','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','save'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x55b5,0x13e));var _0x555b=function(_0x36fc37,_0x1653e8){_0x36fc37=_0x36fc37-0x0;var _0x99b55e=_0x55b5[_0x36fc37];return _0x99b55e;};'use strict';var emlformat=require(_0x555b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x555b('0x1'));var rp=require('request-promise');var moment=require(_0x555b('0x2'));var BPromise=require(_0x555b('0x3'));var Mustache=require('mustache');var util=require(_0x555b('0x4'));var path=require(_0x555b('0x5'));var sox=require(_0x555b('0x6'));var csv=require('to-csv');var ejs=require(_0x555b('0x7'));var fs=require('fs');var fs_extra=require(_0x555b('0x8'));var _=require(_0x555b('0x9'));var squel=require(_0x555b('0xa'));var crypto=require(_0x555b('0xb'));var jsforce=require(_0x555b('0xc'));var deskjs=require(_0x555b('0xd'));var toCsv=require(_0x555b('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x555b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x555b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x555b('0x11'));var logger=require('../../config/logger')(_0x555b('0x12'));var utils=require(_0x555b('0x13'));var config=require(_0x555b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x555b('0x15'))['db'];function respondWithStatusCode(_0xcf41dd,_0x231dcd){_0x231dcd=_0x231dcd||0xcc;return function(_0x363517){if(_0x363517){return _0xcf41dd['sendStatus'](_0x231dcd);}return _0xcf41dd[_0x555b('0x16')](_0x231dcd)[_0x555b('0x17')]();};}function respondWithResult(_0x26bc11,_0x53f2bb){_0x53f2bb=_0x53f2bb||0xc8;return function(_0x2eed94){if(_0x2eed94){return _0x26bc11[_0x555b('0x16')](_0x53f2bb)[_0x555b('0x18')](_0x2eed94);}};}function respondWithFilteredResult(_0x247363,_0x49e5f0){return function(_0x5c196a){if(_0x5c196a){var _0x345ed8=typeof _0x49e5f0[_0x555b('0x19')]===_0x555b('0x1a')&&typeof _0x49e5f0[_0x555b('0x1b')]===_0x555b('0x1a');var _0x308285=_0x5c196a['count'];var _0xbe08ee=_0x345ed8?0x0:_0x49e5f0[_0x555b('0x19')];var _0x3ee1bd=_0x345ed8?_0x5c196a[_0x555b('0x1c')]:_0x49e5f0['offset']+_0x49e5f0[_0x555b('0x1b')];var _0x1af4a9;if(_0x3ee1bd>=_0x308285){_0x3ee1bd=_0x308285;_0x1af4a9=0xc8;}else{_0x1af4a9=0xce;}_0x247363[_0x555b('0x16')](_0x1af4a9);return _0x247363[_0x555b('0x1d')](_0x555b('0x1e'),_0xbe08ee+'-'+_0x3ee1bd+'/'+_0x308285)[_0x555b('0x18')](_0x5c196a);}return null;};}function patchUpdates(_0x588618){return function(_0x4b98df){try{jsonpatch['apply'](_0x4b98df,_0x588618,!![]);}catch(_0xb8f3b3){return BPromise['reject'](_0xb8f3b3);}return _0x4b98df[_0x555b('0x1f')]();};}function saveUpdates(_0x3b04d7,_0xdbf98c){return function(_0x5a12e1){if(_0x5a12e1){return _0x5a12e1[_0x555b('0x20')](_0x3b04d7)[_0x555b('0x21')](function(_0x412839){return _0x412839;});}return null;};}function removeEntity(_0x273e1d,_0x30be6d){return function(_0x5eb05e){if(_0x5eb05e){return _0x5eb05e[_0x555b('0x22')]()[_0x555b('0x21')](function(){_0x273e1d[_0x555b('0x16')](0xcc)[_0x555b('0x17')]();});}};}function handleEntityNotFound(_0x58a94d,_0x55541e){return function(_0x32080f){if(!_0x32080f){_0x58a94d[_0x555b('0x23')](0x194);}return _0x32080f;};}function handleError(_0x1cb865,_0x5f4438){_0x5f4438=_0x5f4438||0x1f4;return function(_0x4726d6){logger[_0x555b('0x24')](_0x4726d6[_0x555b('0x25')]);if(_0x4726d6[_0x555b('0x26')]){delete _0x4726d6[_0x555b('0x26')];}_0x1cb865[_0x555b('0x16')](_0x5f4438)[_0x555b('0x27')](_0x4726d6);};}exports[_0x555b('0x28')]=function(_0x21b6b7,_0x50b38c){var _0x49a23d={},_0x26e8b5={},_0x26bb13={'count':0x0,'rows':[]};var _0x2b2cd2=_['map'](db[_0x555b('0x29')][_0x555b('0x2a')],function(_0x221975){return{'name':_0x221975[_0x555b('0x2b')],'type':_0x221975[_0x555b('0x2c')][_0x555b('0x2d')]};});_0x26e8b5[_0x555b('0x2e')]=_[_0x555b('0x2f')](_0x2b2cd2,_0x555b('0x26'));_0x26e8b5['query']=_[_0x555b('0x30')](_0x21b6b7['query']);_0x26e8b5['filters']=_[_0x555b('0x31')](_0x26e8b5[_0x555b('0x2e')],_0x26e8b5['query']);_0x49a23d[_0x555b('0x32')]=_[_0x555b('0x31')](_0x26e8b5['model'],qs[_0x555b('0x33')](_0x21b6b7['query']['fields']));_0x49a23d[_0x555b('0x32')]=_0x49a23d[_0x555b('0x32')][_0x555b('0x34')]?_0x49a23d[_0x555b('0x32')]:_0x26e8b5[_0x555b('0x2e')];if(!_0x21b6b7[_0x555b('0x35')][_0x555b('0x36')]('nolimit')){_0x49a23d[_0x555b('0x1b')]=qs[_0x555b('0x1b')](_0x21b6b7['query'][_0x555b('0x1b')]);_0x49a23d[_0x555b('0x19')]=qs['offset'](_0x21b6b7[_0x555b('0x35')][_0x555b('0x19')]);}_0x49a23d[_0x555b('0x37')]=qs[_0x555b('0x38')](_0x21b6b7[_0x555b('0x35')][_0x555b('0x38')]);_0x49a23d['where']=qs[_0x555b('0x39')](_['pick'](_0x21b6b7[_0x555b('0x35')],_0x26e8b5[_0x555b('0x39')]),_0x2b2cd2);if(_0x21b6b7['query'][_0x555b('0x3a')]){_0x49a23d[_0x555b('0x3b')]=_[_0x555b('0x3c')](_0x49a23d[_0x555b('0x3b')],{'$or':_[_0x555b('0x2f')](_0x2b2cd2,function(_0x237538){if(_0x237538[_0x555b('0x2c')]!=='VIRTUAL'){var _0x1add81={};_0x1add81[_0x237538[_0x555b('0x26')]]={'$like':'%'+_0x21b6b7[_0x555b('0x35')][_0x555b('0x3a')]+'%'};return _0x1add81;}})});}_0x49a23d=_[_0x555b('0x3c')]({},_0x49a23d,_0x21b6b7[_0x555b('0x3d')]);var _0x4af198={'where':_0x49a23d[_0x555b('0x3b')]};return db[_0x555b('0x29')][_0x555b('0x1c')](_0x4af198)[_0x555b('0x21')](function(_0x164744){_0x26bb13['count']=_0x164744;if(_0x21b6b7[_0x555b('0x35')]['includeAll']){_0x49a23d[_0x555b('0x3e')]=[{'all':!![]}];}return db['UserProfileSection'][_0x555b('0x3f')](_0x49a23d);})[_0x555b('0x21')](function(_0x4cef9c){_0x26bb13['rows']=_0x4cef9c;return _0x26bb13;})[_0x555b('0x21')](respondWithFilteredResult(_0x50b38c,_0x49a23d))[_0x555b('0x40')](handleError(_0x50b38c,null));};exports[_0x555b('0x41')]=function(_0xb7c9ce,_0x4931e7){var _0x536032={'raw':![],'where':{'id':_0xb7c9ce[_0x555b('0x42')]['id']}},_0x23d593={};_0x23d593[_0x555b('0x2e')]=_[_0x555b('0x30')](db[_0x555b('0x29')][_0x555b('0x2a')]);_0x23d593['query']=_[_0x555b('0x30')](_0xb7c9ce['query']);_0x23d593[_0x555b('0x39')]=_[_0x555b('0x31')](_0x23d593['model'],_0x23d593[_0x555b('0x35')]);_0x536032['attributes']=_[_0x555b('0x31')](_0x23d593[_0x555b('0x2e')],qs[_0x555b('0x33')](_0xb7c9ce['query'][_0x555b('0x33')]));_0x536032[_0x555b('0x32')]=_0x536032['attributes'][_0x555b('0x34')]?_0x536032[_0x555b('0x32')]:_0x23d593['model'];if(_0xb7c9ce[_0x555b('0x35')]['includeAll']){_0x536032[_0x555b('0x3e')]=[{'all':!![]}];}_0x536032=_[_0x555b('0x3c')]({},_0x536032,_0xb7c9ce['options']);return db['UserProfileSection'][_0x555b('0x43')](_0x536032)['then'](handleEntityNotFound(_0x4931e7,null))[_0x555b('0x21')](respondWithResult(_0x4931e7,null))[_0x555b('0x40')](handleError(_0x4931e7,null));};exports['create']=function(_0x5a9091,_0x494e68){return db['UserProfileSection']['create'](_0x5a9091[_0x555b('0x44')],{})['then'](respondWithResult(_0x494e68,0xc9))['catch'](handleError(_0x494e68,null));};exports[_0x555b('0x20')]=function(_0x421d11,_0x2a085b){if(_0x421d11[_0x555b('0x44')]['id']){delete _0x421d11[_0x555b('0x44')]['id'];}return db[_0x555b('0x29')][_0x555b('0x43')]({'where':{'id':_0x421d11['params']['id']}})[_0x555b('0x21')](handleEntityNotFound(_0x2a085b,null))[_0x555b('0x21')](saveUpdates(_0x421d11[_0x555b('0x44')],null))['then'](respondWithResult(_0x2a085b,null))[_0x555b('0x40')](handleError(_0x2a085b,null));};exports[_0x555b('0x22')]=function(_0x44dd92,_0x371028){return db['UserProfileSection']['find']({'where':{'id':_0x44dd92[_0x555b('0x42')]['id']}})[_0x555b('0x21')](handleEntityNotFound(_0x371028,null))[_0x555b('0x21')](removeEntity(_0x371028,null))['catch'](handleError(_0x371028,null));};exports[_0x555b('0x45')]=function(_0x9f89fd,_0x25f322){return db[_0x555b('0x29')][_0x555b('0x45')]()[_0x555b('0x21')](respondWithResult(_0x25f322,null))[_0x555b('0x40')](handleError(_0x25f322,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 556e62e..48a2b27 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 _0xf898=['exports','define','sectionId','lodash','util','api','moment','bluebird','request-promise','./userProfileSection.attributes'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xf898,0x14d));var _0x8f89=function(_0x237810,_0x32f6cd){_0x237810=_0x237810-0x0;var _0x425285=_0xf898[_0x237810];return _0x425285;};'use strict';var _=require(_0x8f89('0x0'));var util=require(_0x8f89('0x1'));var logger=require('../../config/logger')(_0x8f89('0x2'));var moment=require(_0x8f89('0x3'));var BPromise=require(_0x8f89('0x4'));var rp=require(_0x8f89('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8f89('0x6'));module[_0x8f89('0x7')]=function(_0x19321c,_0x43f8ee){return _0x19321c[_0x8f89('0x8')]('UserProfileSection',attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x8f89('0x9'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7b80=['bluebird','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','userProfileId','lodash','util','../../config/logger','moment'];(function(_0x15b399,_0x59db1a){var _0x199f2d=function(_0x3bd31c){while(--_0x3bd31c){_0x15b399['push'](_0x15b399['shift']());}};_0x199f2d(++_0x59db1a);}(_0x7b80,0x18f));var _0x07b8=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x7b80[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x07b8('0x0'));var util=require(_0x07b8('0x1'));var logger=require(_0x07b8('0x2'))('api');var moment=require(_0x07b8('0x3'));var BPromise=require(_0x07b8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x07b8('0x5'));var config=require(_0x07b8('0x6'));var attributes=require(_0x07b8('0x7'));module[_0x07b8('0x8')]=function(_0x245efa,_0x16d263){return _0x245efa[_0x07b8('0x9')](_0x07b8('0xa'),attributes,{'tableName':_0x07b8('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId',_0x07b8('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 11ef168..df880d4 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 _0x02ac=['info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x2c2980,_0x34282a){var _0x2a20a9=function(_0x537b18){while(--_0x537b18){_0x2c2980['push'](_0x2c2980['shift']());}};_0x2a20a9(++_0x34282a);}(_0x02ac,0x1ed));var _0xc02a=function(_0x2e50ab,_0x14b947){_0x2e50ab=_0x2e50ab-0x0;var _0x28c86b=_0x02ac[_0x2e50ab];return _0x28c86b;};'use strict';var _=require(_0xc02a('0x0'));var util=require('util');var moment=require(_0xc02a('0x1'));var BPromise=require(_0xc02a('0x2'));var rs=require(_0xc02a('0x3'));var fs=require('fs');var Redis=require(_0xc02a('0x4'));var db=require(_0xc02a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc02a('0x6'))(_0xc02a('0x7'));var config=require(_0xc02a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc02a('0x9')][_0xc02a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x377924,_0x466f7a,_0xcff225){return new BPromise(function(_0xa3324d,_0x4ded4f){return client[_0xc02a('0xb')](_0x377924,_0xcff225)[_0xc02a('0xc')](function(_0x2e6733){logger[_0xc02a('0xd')](_0xc02a('0xe'),_0x466f7a,_0xc02a('0xf'));logger[_0xc02a('0x10')](_0xc02a('0x11'),_0x466f7a,'request\x20sent',JSON[_0xc02a('0x12')](_0x2e6733));if(_0x2e6733[_0xc02a('0x13')]){if(_0x2e6733[_0xc02a('0x13')][_0xc02a('0x14')]===0x1f4){logger[_0xc02a('0x13')]('UserProfileSection,\x20%s,\x20%s',_0x466f7a,_0x2e6733[_0xc02a('0x13')][_0xc02a('0x15')]);return _0x4ded4f(_0x2e6733['error'][_0xc02a('0x15')]);}logger[_0xc02a('0x13')](_0xc02a('0xe'),_0x466f7a,_0x2e6733['error']['message']);return _0xa3324d(_0x2e6733[_0xc02a('0x13')]['message']);}else{logger[_0xc02a('0xd')](_0xc02a('0xe'),_0x466f7a,_0xc02a('0xf'));_0xa3324d(_0x2e6733[_0xc02a('0x16')][_0xc02a('0x15')]);}})['catch'](function(_0x33cc0e){logger[_0xc02a('0x13')](_0xc02a('0xe'),_0x466f7a,_0x33cc0e);_0x4ded4f(_0x33cc0e);});});} \ No newline at end of file +var _0x22f3=['UserProfileSection,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','error','code'];(function(_0x5a0b65,_0x3bc1bc){var _0x2b228b=function(_0x5bbdcc){while(--_0x5bbdcc){_0x5a0b65['push'](_0x5a0b65['shift']());}};_0x2b228b(++_0x3bc1bc);}(_0x22f3,0x73));var _0x322f=function(_0x42506f,_0x6adadb){_0x42506f=_0x42506f-0x0;var _0x7a6b4b=_0x22f3[_0x42506f];return _0x7a6b4b;};'use strict';var _=require(_0x322f('0x0'));var util=require(_0x322f('0x1'));var moment=require(_0x322f('0x2'));var BPromise=require('bluebird');var rs=require(_0x322f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x322f('0x4'))['db'];var utils=require(_0x322f('0x5'));var logger=require(_0x322f('0x6'))('rpc');var config=require(_0x322f('0x7'));var jayson=require(_0x322f('0x8'));var client=jayson[_0x322f('0x9')][_0x322f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x514221,_0x41ca9c,_0x3b64c6){return new BPromise(function(_0x4d4b9f,_0x4d1251){return client[_0x322f('0xb')](_0x514221,_0x3b64c6)[_0x322f('0xc')](function(_0x47c2ed){logger['info']('UserProfileSection,\x20%s,\x20%s',_0x41ca9c,'request\x20sent');logger[_0x322f('0xd')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x41ca9c,_0x322f('0xe'),JSON['stringify'](_0x47c2ed));if(_0x47c2ed[_0x322f('0xf')]){if(_0x47c2ed[_0x322f('0xf')][_0x322f('0x10')]===0x1f4){logger[_0x322f('0xf')](_0x322f('0x11'),_0x41ca9c,_0x47c2ed[_0x322f('0xf')][_0x322f('0x12')]);return _0x4d1251(_0x47c2ed['error'][_0x322f('0x12')]);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x41ca9c,_0x47c2ed[_0x322f('0xf')][_0x322f('0x12')]);return _0x4d4b9f(_0x47c2ed[_0x322f('0xf')]['message']);}else{logger[_0x322f('0x13')](_0x322f('0x11'),_0x41ca9c,_0x322f('0xe'));_0x4d4b9f(_0x47c2ed[_0x322f('0x14')]['message']);}})[_0x322f('0x15')](function(_0x45c943){logger[_0x322f('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x41ca9c,_0x45c943);_0x4d1251(_0x45c943);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index e663d5c..4681d9e 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(_0x365788,_0x2bbdd7){var _0x741a0f=function(_0x31ed02){while(--_0x31ed02){_0x365788['push'](_0x365788['shift']());}};_0x741a0f(++_0x2bbdd7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x32a773,_0x57b5c7){var _0x430dcb=function(_0x209f30){while(--_0x209f30){_0x32a773['push'](_0x32a773['shift']());}};_0x430dcb(++_0x57b5c7);}(_0x9c44,0x178));var _0x49c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c44[_0x3511d3];return _0x5d6321;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 1304496..71750e2 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 _0x18a7=['exports','INTEGER','sequelize'];(function(_0xadecbc,_0x2b3792){var _0x3efb06=function(_0xffb03f){while(--_0xffb03f){_0xadecbc['push'](_0xadecbc['shift']());}};_0x3efb06(++_0x2b3792);}(_0x18a7,0x14f));var _0x718a=function(_0x4267ba,_0x447e80){_0x4267ba=_0x4267ba-0x0;var _0x52137d=_0x18a7[_0x4267ba];return _0x52137d;};'use strict';var Sequelize=require(_0x718a('0x0'));module[_0x718a('0x1')]={'penalty':{'type':Sequelize[_0x718a('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcf6a=['INTEGER','sequelize','exports'];(function(_0x376e5a,_0x2b7bd3){var _0x582bbb=function(_0x523d85){while(--_0x523d85){_0x376e5a['push'](_0x376e5a['shift']());}};_0x582bbb(++_0x2b7bd3);}(_0xcf6a,0xbb));var _0xacf6=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xcf6a[_0x4d8ed9];return _0x1e2140;};'use strict';var Sequelize=require(_0xacf6('0x0'));module[_0xacf6('0x1')]={'penalty':{'type':Sequelize[_0xacf6('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 2287343..2961eeb 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 _0x7046=['path','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x34dd23,_0x50ce42){var _0x18a648=function(_0xee63a4){while(--_0xee63a4){_0x34dd23['push'](_0x34dd23['shift']());}};_0x18a648(++_0x50ce42);}(_0x7046,0x144));var _0x6704=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7046[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var logger=require(_0x6704('0x2'))(_0x6704('0x3'));var moment=require('moment');var BPromise=require(_0x6704('0x4'));var rp=require(_0x6704('0x5'));var fs=require('fs');var path=require(_0x6704('0x6'));var rimraf=require('rimraf');var config=require(_0x6704('0x7'));var attributes=require(_0x6704('0x8'));module[_0x6704('0x9')]=function(_0x626a14,_0x2917be){return _0x626a14['define'](_0x6704('0xa'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6363=['define','UserSmsQueue','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports'];(function(_0x1cbb29,_0x1e9873){var _0x1bc3c9=function(_0x2f1220){while(--_0x2f1220){_0x1cbb29['push'](_0x1cbb29['shift']());}};_0x1bc3c9(++_0x1e9873);}(_0x6363,0x13a));var _0x3636=function(_0x2f9b40,_0x1837ff){_0x2f9b40=_0x2f9b40-0x0;var _0x42e9f0=_0x6363[_0x2f9b40];return _0x42e9f0;};'use strict';var _=require(_0x3636('0x0'));var util=require('util');var logger=require(_0x3636('0x1'))(_0x3636('0x2'));var moment=require(_0x3636('0x3'));var BPromise=require(_0x3636('0x4'));var rp=require(_0x3636('0x5'));var fs=require('fs');var path=require(_0x3636('0x6'));var rimraf=require(_0x3636('0x7'));var config=require(_0x3636('0x8'));var attributes=require(_0x3636('0x9'));module[_0x3636('0xa')]=function(_0x15728f,_0x1f94ef){return _0x15728f[_0x3636('0xb')](_0x3636('0xc'),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 6e2e9f6..f2028d7 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 _0x4f6d=['catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x4f6d,0x161));var _0xd4f6=function(_0x3b1abf,_0x505d76){_0x3b1abf=_0x3b1abf-0x0;var _0x56dfab=_0x4f6d[_0x3b1abf];return _0x56dfab;};'use strict';var _=require('lodash');var util=require(_0xd4f6('0x0'));var moment=require('moment');var BPromise=require(_0xd4f6('0x1'));var rs=require(_0xd4f6('0x2'));var fs=require('fs');var Redis=require(_0xd4f6('0x3'));var db=require(_0xd4f6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd4f6('0x5'))(_0xd4f6('0x6'));var config=require(_0xd4f6('0x7'));var jayson=require(_0xd4f6('0x8'));var client=jayson[_0xd4f6('0x9')][_0xd4f6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25e9bd,_0x87160a,_0x3ee904){return new BPromise(function(_0x340d69,_0x4149eb){return client['request'](_0x25e9bd,_0x3ee904)['then'](function(_0x1d9bbc){logger[_0xd4f6('0xb')](_0xd4f6('0xc'),_0x87160a,_0xd4f6('0xd'));logger[_0xd4f6('0xe')](_0xd4f6('0xf'),_0x87160a,_0xd4f6('0xd'),JSON[_0xd4f6('0x10')](_0x1d9bbc));if(_0x1d9bbc[_0xd4f6('0x11')]){if(_0x1d9bbc[_0xd4f6('0x11')][_0xd4f6('0x12')]===0x1f4){logger['error'](_0xd4f6('0xc'),_0x87160a,_0x1d9bbc['error'][_0xd4f6('0x13')]);return _0x4149eb(_0x1d9bbc['error'][_0xd4f6('0x13')]);}logger[_0xd4f6('0x11')](_0xd4f6('0xc'),_0x87160a,_0x1d9bbc[_0xd4f6('0x11')][_0xd4f6('0x13')]);return _0x340d69(_0x1d9bbc[_0xd4f6('0x11')][_0xd4f6('0x13')]);}else{logger[_0xd4f6('0xb')](_0xd4f6('0xc'),_0x87160a,_0xd4f6('0xd'));_0x340d69(_0x1d9bbc[_0xd4f6('0x14')][_0xd4f6('0x13')]);}})[_0xd4f6('0x15')](function(_0x541f11){logger['error'](_0xd4f6('0xc'),_0x87160a,_0x541f11);_0x4149eb(_0x541f11);});});} \ No newline at end of file +var _0x8c7e=['client','http','request','then','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','../../config/utils','jayson/promise'];(function(_0x3573c1,_0x110869){var _0x1a7c62=function(_0x35cb1d){while(--_0x35cb1d){_0x3573c1['push'](_0x3573c1['shift']());}};_0x1a7c62(++_0x110869);}(_0x8c7e,0x126));var _0xe8c7=function(_0x4eaa4c,_0x2f7422){_0x4eaa4c=_0x4eaa4c-0x0;var _0x15aec6=_0x8c7e[_0x4eaa4c];return _0x15aec6;};'use strict';var _=require(_0xe8c7('0x0'));var util=require(_0xe8c7('0x1'));var moment=require(_0xe8c7('0x2'));var BPromise=require(_0xe8c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe8c7('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xe8c7('0x5'));var client=jayson[_0xe8c7('0x6')][_0xe8c7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5ef53d,_0x216ec5,_0x48fdda){return new BPromise(function(_0x3e519e,_0x13b668){return client[_0xe8c7('0x8')](_0x5ef53d,_0x48fdda)[_0xe8c7('0x9')](function(_0x4751e7){logger['info'](_0xe8c7('0xa'),_0x216ec5,'request\x20sent');logger[_0xe8c7('0xb')](_0xe8c7('0xc'),_0x216ec5,'request\x20sent',JSON[_0xe8c7('0xd')](_0x4751e7));if(_0x4751e7[_0xe8c7('0xe')]){if(_0x4751e7[_0xe8c7('0xe')][_0xe8c7('0xf')]===0x1f4){logger[_0xe8c7('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x216ec5,_0x4751e7[_0xe8c7('0xe')][_0xe8c7('0x10')]);return _0x13b668(_0x4751e7[_0xe8c7('0xe')][_0xe8c7('0x10')]);}logger[_0xe8c7('0xe')](_0xe8c7('0xa'),_0x216ec5,_0x4751e7[_0xe8c7('0xe')]['message']);return _0x3e519e(_0x4751e7[_0xe8c7('0xe')]['message']);}else{logger['info'](_0xe8c7('0xa'),_0x216ec5,_0xe8c7('0x11'));_0x3e519e(_0x4751e7[_0xe8c7('0x12')][_0xe8c7('0x10')]);}})[_0xe8c7('0x13')](function(_0x128121){logger[_0xe8c7('0xe')](_0xe8c7('0xa'),_0x216ec5,_0x128121);_0x13b668(_0x128121);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index defae68..1269d49 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 _0xa3d2=['sequelize','INTEGER'];(function(_0x39fb0b,_0x5e42fa){var _0x106023=function(_0x61006d){while(--_0x61006d){_0x39fb0b['push'](_0x39fb0b['shift']());}};_0x106023(++_0x5e42fa);}(_0xa3d2,0x11a));var _0x2a3d=function(_0x5e8d3e,_0x18ed2e){_0x5e8d3e=_0x5e8d3e-0x0;var _0x1348c0=_0xa3d2[_0x5e8d3e];return _0x1348c0;};'use strict';var Sequelize=require(_0x2a3d('0x0'));module['exports']={'UserId':{'type':Sequelize[_0x2a3d('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x2e0c=['sequelize'];(function(_0x2aae5b,_0x14b687){var _0x444648=function(_0x1581d5){while(--_0x1581d5){_0x2aae5b['push'](_0x2aae5b['shift']());}};_0x444648(++_0x14b687);}(_0x2e0c,0x13a));var _0xc2e0=function(_0xe0eb73,_0x5e8190){_0xe0eb73=_0xe0eb73-0x0;var _0x1e5036=_0x2e0c[_0xe0eb73];return _0x1e5036;};'use strict';var Sequelize=require(_0xc2e0('0x0'));module['exports']={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index b03d3f0..4db5cac 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(_0x52bc59,_0x3f0153){var _0x4646ee=function(_0x2c5b1a){while(--_0x2c5b1a){_0x52bc59['push'](_0x52bc59['shift']());}};_0x4646ee(++_0x3f0153);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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(_0x2b1f9a,_0x557af0){var _0x1121c8=function(_0xc0efc0){while(--_0xc0efc0){_0x2b1f9a['push'](_0x2b1f9a['shift']());}};_0x1121c8(++_0x557af0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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 9649387..d96650e 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x460b81,_0x20056c){var _0x3136db=function(_0x4fc05d){while(--_0x4fc05d){_0x460b81['push'](_0x460b81['shift']());}};_0x3136db(++_0x20056c);}(_0x70e0,0x17b));var _0x070e=function(_0x4ab59e,_0x554c36){_0x4ab59e=_0x4ab59e-0x0;var _0x4740f8=_0x70e0[_0x4ab59e];return _0x4740f8;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xc68650,_0x258343){var _0x57bd40=function(_0x8d9e8c){while(--_0x8d9e8c){_0xc68650['push'](_0xc68650['shift']());}};_0x57bd40(++_0x258343);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index c30a7c7..a4de128 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 _0x63b1=['sequelize','exports','INTEGER'];(function(_0x286c4c,_0xa633d){var _0x8a6e0e=function(_0x22c105){while(--_0x22c105){_0x286c4c['push'](_0x286c4c['shift']());}};_0x8a6e0e(++_0xa633d);}(_0x63b1,0x177));var _0x163b=function(_0x1d092d,_0x3962d5){_0x1d092d=_0x1d092d-0x0;var _0x562829=_0x63b1[_0x1d092d];return _0x562829;};'use strict';var Sequelize=require(_0x163b('0x0'));module[_0x163b('0x1')]={'penalty':{'type':Sequelize[_0x163b('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x65b5=['sequelize','exports','INTEGER'];(function(_0x3985f3,_0xa9a894){var _0x2def37=function(_0x386f69){while(--_0x386f69){_0x3985f3['push'](_0x3985f3['shift']());}};_0x2def37(++_0xa9a894);}(_0x65b5,0xd2));var _0x565b=function(_0x2eb8fa,_0x295f4f){_0x2eb8fa=_0x2eb8fa-0x0;var _0xe26256=_0x65b5[_0x2eb8fa];return _0xe26256;};'use strict';var Sequelize=require(_0x565b('0x0'));module[_0x565b('0x1')]={'penalty':{'type':Sequelize[_0x565b('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 b74fb33..4a0e693 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 _0x89f7=['./userVoiceQueue.attributes','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','request-promise','../../config/environment'];(function(_0x128443,_0x2fe025){var _0x1a4ce1=function(_0x12d72c){while(--_0x12d72c){_0x128443['push'](_0x128443['shift']());}};_0x1a4ce1(++_0x2fe025);}(_0x89f7,0x1a8));var _0x789f=function(_0x2b9c0c,_0x4678a3){_0x2b9c0c=_0x2b9c0c-0x0;var _0xd8577b=_0x89f7[_0x2b9c0c];return _0xd8577b;};'use strict';var _=require(_0x789f('0x0'));var util=require(_0x789f('0x1'));var logger=require(_0x789f('0x2'))(_0x789f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x789f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x789f('0x5'));var attributes=require(_0x789f('0x6'));module['exports']=function(_0x496587,_0xfc6a0c){return _0x496587[_0x789f('0x7')](_0x789f('0x8'),attributes,{'tableName':_0x789f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x89cd=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userVoiceQueue.attributes','define','UserVoiceQueue','user_has_voice_queues'];(function(_0x43d012,_0x286e4d){var _0x52e052=function(_0x497c03){while(--_0x497c03){_0x43d012['push'](_0x43d012['shift']());}};_0x52e052(++_0x286e4d);}(_0x89cd,0x120));var _0xd89c=function(_0x4fd51c,_0x212fca){_0x4fd51c=_0x4fd51c-0x0;var _0xde5b62=_0x89cd[_0x4fd51c];return _0xde5b62;};'use strict';var _=require('lodash');var util=require(_0xd89c('0x0'));var logger=require(_0xd89c('0x1'))(_0xd89c('0x2'));var moment=require(_0xd89c('0x3'));var BPromise=require(_0xd89c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd89c('0x5'));var rimraf=require(_0xd89c('0x6'));var config=require(_0xd89c('0x7'));var attributes=require(_0xd89c('0x8'));module['exports']=function(_0x42158b,_0x2c1b95){return _0x42158b[_0xd89c('0x9')](_0xd89c('0xa'),attributes,{'tableName':_0xd89c('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 3c8bee7..1e57555 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 _0x745f=['UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x745f,0xe8));var _0xf745=function(_0x5a2291,_0x3ddda7){_0x5a2291=_0x5a2291-0x0;var _0x10e3f5=_0x745f[_0x5a2291];return _0x10e3f5;};'use strict';var _=require(_0xf745('0x0'));var util=require(_0xf745('0x1'));var moment=require(_0xf745('0x2'));var BPromise=require(_0xf745('0x3'));var rs=require(_0xf745('0x4'));var fs=require('fs');var Redis=require(_0xf745('0x5'));var db=require(_0xf745('0x6'))['db'];var utils=require(_0xf745('0x7'));var logger=require(_0xf745('0x8'))(_0xf745('0x9'));var config=require(_0xf745('0xa'));var jayson=require(_0xf745('0xb'));var client=jayson[_0xf745('0xc')][_0xf745('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x468760,_0x2df8de,_0x43fbe8){return new BPromise(function(_0x36e166,_0x279356){return client[_0xf745('0xe')](_0x468760,_0x43fbe8)[_0xf745('0xf')](function(_0x2c0766){logger[_0xf745('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x2df8de,_0xf745('0x11'));logger['debug'](_0xf745('0x12'),_0x2df8de,'request\x20sent',JSON[_0xf745('0x13')](_0x2c0766));if(_0x2c0766[_0xf745('0x14')]){if(_0x2c0766[_0xf745('0x14')]['code']===0x1f4){logger['error'](_0xf745('0x15'),_0x2df8de,_0x2c0766[_0xf745('0x14')][_0xf745('0x16')]);return _0x279356(_0x2c0766[_0xf745('0x14')]['message']);}logger[_0xf745('0x14')](_0xf745('0x15'),_0x2df8de,_0x2c0766[_0xf745('0x14')][_0xf745('0x16')]);return _0x36e166(_0x2c0766[_0xf745('0x14')][_0xf745('0x16')]);}else{logger[_0xf745('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x2df8de,_0xf745('0x11'));_0x36e166(_0x2c0766[_0xf745('0x17')]['message']);}})[_0xf745('0x18')](function(_0x35db0d){logger[_0xf745('0x14')]('UserVoiceQueue,\x20%s,\x20%s',_0x2df8de,_0x35db0d);_0x279356(_0x35db0d);});});} \ No newline at end of file +var _0x446d=['client','http','info','request\x20sent','debug','error','code','UserVoiceQueue,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x513a87,_0x1d8ea2){var _0x55bb38=function(_0x35c562){while(--_0x35c562){_0x513a87['push'](_0x513a87['shift']());}};_0x55bb38(++_0x1d8ea2);}(_0x446d,0xe6));var _0xd446=function(_0xf8973d,_0x56a803){_0xf8973d=_0xf8973d-0x0;var _0x1c46bc=_0x446d[_0xf8973d];return _0x1c46bc;};'use strict';var _=require('lodash');var util=require(_0xd446('0x0'));var moment=require(_0xd446('0x1'));var BPromise=require(_0xd446('0x2'));var rs=require(_0xd446('0x3'));var fs=require('fs');var Redis=require(_0xd446('0x4'));var db=require(_0xd446('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd446('0x6'))(_0xd446('0x7'));var config=require(_0xd446('0x8'));var jayson=require(_0xd446('0x9'));var client=jayson[_0xd446('0xa')][_0xd446('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a64bc,_0x2ccaa4,_0x459cc5){return new BPromise(function(_0x1e895f,_0x37ff89){return client['request'](_0x1a64bc,_0x459cc5)['then'](function(_0x1433b0){logger[_0xd446('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x2ccaa4,_0xd446('0xd'));logger[_0xd446('0xe')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x2ccaa4,'request\x20sent',JSON['stringify'](_0x1433b0));if(_0x1433b0[_0xd446('0xf')]){if(_0x1433b0[_0xd446('0xf')][_0xd446('0x10')]===0x1f4){logger[_0xd446('0xf')](_0xd446('0x11'),_0x2ccaa4,_0x1433b0[_0xd446('0xf')][_0xd446('0x12')]);return _0x37ff89(_0x1433b0[_0xd446('0xf')][_0xd446('0x12')]);}logger[_0xd446('0xf')](_0xd446('0x11'),_0x2ccaa4,_0x1433b0[_0xd446('0xf')][_0xd446('0x12')]);return _0x1e895f(_0x1433b0[_0xd446('0xf')][_0xd446('0x12')]);}else{logger[_0xd446('0xc')](_0xd446('0x11'),_0x2ccaa4,_0xd446('0xd'));_0x1e895f(_0x1433b0['result'][_0xd446('0x12')]);}})[_0xd446('0x13')](function(_0x642f7){logger[_0xd446('0xf')](_0xd446('0x11'),_0x2ccaa4,_0x642f7);_0x37ff89(_0x642f7);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 5067c69..21aa01f 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x59e988,_0x23f4e8){var _0x26eda4=function(_0x2ca6e8){while(--_0x2ca6e8){_0x59e988['push'](_0x59e988['shift']());}};_0x26eda4(++_0x23f4e8);}(_0xedd9,0xfc));var _0x9edd=function(_0x1d707,_0x28baac){_0x1d707=_0x1d707-0x0;var _0x27105e=_0xedd9[_0x1d707];return _0x27105e;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4f3039,_0x100a43){var _0x13218c=function(_0x55c86e){while(--_0x55c86e){_0x4f3039['push'](_0x4f3039['shift']());}};_0x13218c(++_0x100a43);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 9464cba..d2b8b84 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 _0xbcfe=['queue_interface','sequelize','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x8a8f18,_0x4b38f1){var _0x29bb54=function(_0x3d0ab2){while(--_0x3d0ab2){_0x8a8f18['push'](_0x8a8f18['shift']());}};_0x29bb54(++_0x4b38f1);}(_0xbcfe,0x128));var _0xebcf=function(_0x3cbee,_0x180221){_0x3cbee=_0x3cbee-0x0;var _0x146764=_0xbcfe[_0x3cbee];return _0x146764;};'use strict';var Sequelize=require(_0xebcf('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xebcf('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xebcf('0x2')},'membername':{'type':Sequelize[_0xebcf('0x3')],'allowNull':![],'comment':_0xebcf('0x2')},'UserId':{'type':Sequelize[_0xebcf('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xebcf('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0xebcf('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xebcf('0x3')],'allowNull':![],'unique':_0xebcf('0x4'),'comment':_0xebcf('0x2')},'penalty':{'type':Sequelize[_0xebcf('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0xebcf('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0xd5d0=['INTEGER','Required\x20by\x20Asterisk','STRING','sequelize'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xd5d0,0x153));var _0x0d5d=function(_0x59cbfb,_0x37321f){_0x59cbfb=_0x59cbfb-0x0;var _0x3c512c=_0xd5d0[_0x59cbfb];return _0x3c512c;};'use strict';var Sequelize=require(_0x0d5d('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x0d5d('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x0d5d('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x0d5d('0x2')},'UserId':{'type':Sequelize[_0x0d5d('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x0d5d('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x0d5d('0x2')},'VoiceQueueId':{'type':Sequelize[_0x0d5d('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x0d5d('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x0d5d('0x2')},'penalty':{'type':Sequelize[_0x0d5d('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x0d5d('0x1')](0xb),'defaultValue':0x0,'comment':_0x0d5d('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 27f8a39..eaf5232 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 _0xa5fc=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','UserVoiceQueueRt'];(function(_0x4deb06,_0x3f57e7){var _0x4c8715=function(_0x1e9740){while(--_0x1e9740){_0x4deb06['push'](_0x4deb06['shift']());}};_0x4c8715(++_0x3f57e7);}(_0xa5fc,0x1ac));var _0xca5f=function(_0x5b873a,_0x773b4){_0x5b873a=_0x5b873a-0x0;var _0x1e11fb=_0xa5fc[_0x5b873a];return _0x1e11fb;};'use strict';var EventEmitter=require(_0xca5f('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xca5f('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xca5f('0x2')](0x0);var events={'afterCreate':_0xca5f('0x3'),'afterUpdate':_0xca5f('0x4'),'afterDestroy':_0xca5f('0x5')};function emitEvent(_0x402ff3){return function(_0x291662,_0x1bffc3,_0x52b236){UserVoiceQueueRtEvents[_0xca5f('0x6')](_0x402ff3+':'+_0x291662['id'],_0x291662);UserVoiceQueueRtEvents['emit'](_0x402ff3,_0x291662);_0x52b236(null);};}for(var e in events){if(events[_0xca5f('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0xca5f('0x8')](e,emitEvent(event));}}module[_0xca5f('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x00cf=['UserVoiceQueueRt','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x369534,_0x5557c4){var _0x524bf9=function(_0x24c6fb){while(--_0x24c6fb){_0x369534['push'](_0x369534['shift']());}};_0x524bf9(++_0x5557c4);}(_0x00cf,0xda));var _0xf00c=function(_0x374cd9,_0x118a5a){_0x374cd9=_0x374cd9-0x0;var _0x16b8d9=_0x00cf[_0x374cd9];return _0x16b8d9;};'use strict';var EventEmitter=require(_0xf00c('0x0'));var UserVoiceQueueRt=require(_0xf00c('0x1'))['db'][_0xf00c('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xf00c('0x3')](0x0);var events={'afterCreate':_0xf00c('0x4'),'afterUpdate':_0xf00c('0x5'),'afterDestroy':_0xf00c('0x6')};function emitEvent(_0x39d4c0){return function(_0x2707e2,_0x453f59,_0xc6efbd){UserVoiceQueueRtEvents[_0xf00c('0x7')](_0x39d4c0+':'+_0x2707e2['id'],_0x2707e2);UserVoiceQueueRtEvents[_0xf00c('0x7')](_0x39d4c0,_0x2707e2);_0xc6efbd(null);};}for(var e in events){if(events[_0xf00c('0x8')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0xf00c('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 310644b..3faedd3 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 _0x7e03=['../../config/environment','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xd456f5,_0x14b44f){var _0x4b1b39=function(_0x39e49b){while(--_0x39e49b){_0xd456f5['push'](_0xd456f5['shift']());}};_0x4b1b39(++_0x14b44f);}(_0x7e03,0x1a5));var _0x37e0=function(_0x4aa26f,_0x3a3994){_0x4aa26f=_0x4aa26f-0x0;var _0x526df2=_0x7e03[_0x4aa26f];return _0x526df2;};'use strict';var _=require(_0x37e0('0x0'));var util=require(_0x37e0('0x1'));var logger=require(_0x37e0('0x2'))(_0x37e0('0x3'));var moment=require(_0x37e0('0x4'));var BPromise=require(_0x37e0('0x5'));var rp=require(_0x37e0('0x6'));var fs=require('fs');var path=require(_0x37e0('0x7'));var rimraf=require('rimraf');var config=require(_0x37e0('0x8'));var attributes=require(_0x37e0('0x9'));module['exports']=function(_0x49537f,_0xd782b6){return _0x49537f[_0x37e0('0xa')](_0x37e0('0xb'),attributes,{'tableName':_0x37e0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0711=['exports','define','user_has_voice_queues_rt','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes'];(function(_0x35ba3f,_0x481358){var _0x140889=function(_0x5e7201){while(--_0x5e7201){_0x35ba3f['push'](_0x35ba3f['shift']());}};_0x140889(++_0x481358);}(_0x0711,0xd4));var _0x1071=function(_0x47404e,_0x286834){_0x47404e=_0x47404e-0x0;var _0x5f4967=_0x0711[_0x47404e];return _0x5f4967;};'use strict';var _=require(_0x1071('0x0'));var util=require('util');var logger=require(_0x1071('0x1'))(_0x1071('0x2'));var moment=require('moment');var BPromise=require(_0x1071('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1071('0x4'));var rimraf=require(_0x1071('0x5'));var config=require(_0x1071('0x6'));var attributes=require(_0x1071('0x7'));module[_0x1071('0x8')]=function(_0x1e9cb8,_0xad0656){return _0x1e9cb8[_0x1071('0x9')]('UserVoiceQueueRt',attributes,{'tableName':_0x1071('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 1f51fb5..1eb1539 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 _0x1148=['request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetVoiceQueueRtPauses','findAll','options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket'];(function(_0x595c70,_0x102993){var _0x2cb097=function(_0x25c0fe){while(--_0x25c0fe){_0x595c70['push'](_0x595c70['shift']());}};_0x2cb097(++_0x102993);}(_0x1148,0x1ac));var _0x8114=function(_0x1ff35f,_0x3124d6){_0x1ff35f=_0x1ff35f-0x0;var _0x5edf15=_0x1148[_0x1ff35f];return _0x5edf15;};'use strict';var _=require(_0x8114('0x0'));var util=require(_0x8114('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8114('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8114('0x3'))['db'];var utils=require(_0x8114('0x4'));var logger=require(_0x8114('0x5'))(_0x8114('0x6'));var config=require(_0x8114('0x7'));var jayson=require(_0x8114('0x8'));var client=jayson[_0x8114('0x9')][_0x8114('0xa')]({'port':0x232a});config[_0x8114('0xb')]=_[_0x8114('0xc')](config['redis'],{'host':_0x8114('0xd'),'port':0x18eb});var socket=require(_0x8114('0xe'))(new Redis(config[_0x8114('0xb')]));require(_0x8114('0xf'))['register'](socket);function respondWithRpcPromise(_0x4f33b3,_0x3707ba,_0x1333c6){return new BPromise(function(_0x1550ad,_0x3aeaa2){return client[_0x8114('0x10')](_0x4f33b3,_0x1333c6)[_0x8114('0x11')](function(_0x50452b){logger[_0x8114('0x12')](_0x8114('0x13'),_0x3707ba,'request\x20sent');logger[_0x8114('0x14')](_0x8114('0x15'),_0x3707ba,_0x8114('0x16'),JSON[_0x8114('0x17')](_0x50452b));if(_0x50452b[_0x8114('0x18')]){if(_0x50452b[_0x8114('0x18')]['code']===0x1f4){logger[_0x8114('0x18')](_0x8114('0x13'),_0x3707ba,_0x50452b[_0x8114('0x18')]['message']);return _0x3aeaa2(_0x50452b[_0x8114('0x18')][_0x8114('0x19')]);}logger[_0x8114('0x18')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3707ba,_0x50452b[_0x8114('0x18')][_0x8114('0x19')]);return _0x1550ad(_0x50452b['error'][_0x8114('0x19')]);}else{logger[_0x8114('0x12')](_0x8114('0x13'),_0x3707ba,_0x8114('0x16'));_0x1550ad(_0x50452b[_0x8114('0x1a')][_0x8114('0x19')]);}})['catch'](function(_0x3185e0){logger[_0x8114('0x18')](_0x8114('0x13'),_0x3707ba,_0x3185e0);_0x3aeaa2(_0x3185e0);});});}exports[_0x8114('0x1b')]=function(_0x4e9d43){var _0x49d0ed=this;return new Promise(function(_0x5c14d7,_0x3f27e6){return db['UserVoiceQueueRt'][_0x8114('0x1c')]({'raw':_0x4e9d43['options']?_0x4e9d43['options']['raw']===undefined?!![]:![]:!![],'where':_0x4e9d43[_0x8114('0x1d')]?_0x4e9d43[_0x8114('0x1d')][_0x8114('0x1e')]||null:null,'attributes':[[db[_0x8114('0x1f')]['fn'](_0x8114('0x20'),db['sequelize']['fn']('IF',db[_0x8114('0x1f')][_0x8114('0x21')](_0x8114('0x22')))),_0x8114('0x23')]]})['then'](function(_0x407d08){logger[_0x8114('0x12')](_0x8114('0x1b'),_0x4e9d43);logger[_0x8114('0x14')](_0x8114('0x1b'),_0x4e9d43,JSON['stringify'](_0x407d08));_0x5c14d7(_0x407d08);})[_0x8114('0x24')](function(_0x187fe7){logger[_0x8114('0x18')]('GetVoiceQueueRtPauses',_0x187fe7[_0x8114('0x19')],_0x4e9d43);_0x3f27e6(_0x49d0ed[_0x8114('0x18')](0x1f4,_0x187fe7[_0x8114('0x19')]));});});}; \ No newline at end of file +var _0x6184=['redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','outboundQueuePauses','lodash','util','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1ea954,_0x4810c1){var _0x2c2b94=function(_0x1dfc67){while(--_0x1dfc67){_0x1ea954['push'](_0x1ea954['shift']());}};_0x2c2b94(++_0x4810c1);}(_0x6184,0x1d2));var _0x4618=function(_0x4ffa64,_0x271035){_0x4ffa64=_0x4ffa64-0x0;var _0x5da001=_0x6184[_0x4ffa64];return _0x5da001;};'use strict';var _=require(_0x4618('0x0'));var util=require(_0x4618('0x1'));var moment=require(_0x4618('0x2'));var BPromise=require(_0x4618('0x3'));var rs=require(_0x4618('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4618('0x5'));var config=require(_0x4618('0x6'));var jayson=require(_0x4618('0x7'));var client=jayson[_0x4618('0x8')][_0x4618('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4618('0xa')],{'host':_0x4618('0xb'),'port':0x18eb});var socket=require(_0x4618('0xc'))(new Redis(config[_0x4618('0xa')]));require(_0x4618('0xd'))[_0x4618('0xe')](socket);function respondWithRpcPromise(_0x475d8d,_0x5f50b9,_0x1c3eb3){return new BPromise(function(_0x35db44,_0x276c80){return client[_0x4618('0xf')](_0x475d8d,_0x1c3eb3)[_0x4618('0x10')](function(_0x1981fa){logger['info'](_0x4618('0x11'),_0x5f50b9,_0x4618('0x12'));logger[_0x4618('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x5f50b9,_0x4618('0x12'),JSON['stringify'](_0x1981fa));if(_0x1981fa[_0x4618('0x14')]){if(_0x1981fa['error']['code']===0x1f4){logger[_0x4618('0x14')](_0x4618('0x11'),_0x5f50b9,_0x1981fa[_0x4618('0x14')][_0x4618('0x15')]);return _0x276c80(_0x1981fa['error'][_0x4618('0x15')]);}logger[_0x4618('0x14')](_0x4618('0x11'),_0x5f50b9,_0x1981fa['error']['message']);return _0x35db44(_0x1981fa[_0x4618('0x14')][_0x4618('0x15')]);}else{logger[_0x4618('0x16')](_0x4618('0x11'),_0x5f50b9,'request\x20sent');_0x35db44(_0x1981fa[_0x4618('0x17')][_0x4618('0x15')]);}})[_0x4618('0x18')](function(_0x4b4dd5){logger[_0x4618('0x14')](_0x4618('0x11'),_0x5f50b9,_0x4b4dd5);_0x276c80(_0x4b4dd5);});});}exports[_0x4618('0x19')]=function(_0x517ccc){var _0xb2a209=this;return new Promise(function(_0x437069,_0x409fd2){return db[_0x4618('0x1a')][_0x4618('0x1b')]({'raw':_0x517ccc[_0x4618('0x1c')]?_0x517ccc[_0x4618('0x1c')][_0x4618('0x1d')]===undefined?!![]:![]:!![],'where':_0x517ccc[_0x4618('0x1c')]?_0x517ccc[_0x4618('0x1c')][_0x4618('0x1e')]||null:null,'attributes':[[db[_0x4618('0x1f')]['fn'](_0x4618('0x20'),db[_0x4618('0x1f')]['fn']('IF',db['sequelize']['literal']('`paused`\x20=\x201,\x201,\x20null'))),_0x4618('0x21')]]})[_0x4618('0x10')](function(_0x3a85d7){logger['info'](_0x4618('0x19'),_0x517ccc);logger[_0x4618('0x13')](_0x4618('0x19'),_0x517ccc,JSON['stringify'](_0x3a85d7));_0x437069(_0x3a85d7);})[_0x4618('0x18')](function(_0x2627c0){logger[_0x4618('0x14')](_0x4618('0x19'),_0x2627c0['message'],_0x517ccc);_0x409fd2(_0xb2a209[_0x4618('0x14')](0x1f4,_0x2627c0[_0x4618('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 03ce3e1..798978f 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 _0xb0e5=['update','emit','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove'];(function(_0xbc49ea,_0x3ac1e4){var _0x29295f=function(_0x333223){while(--_0x333223){_0xbc49ea['push'](_0xbc49ea['shift']());}};_0x29295f(++_0x3ac1e4);}(_0xb0e5,0x1ad));var _0x5b0e=function(_0x16972f,_0x24951d){_0x16972f=_0x16972f-0x0;var _0x3e2509=_0xb0e5[_0x16972f];return _0x3e2509;};'use strict';var UserVoiceQueueRtEvents=require(_0x5b0e('0x0'));var events=[_0x5b0e('0x1'),_0x5b0e('0x2'),_0x5b0e('0x3')];function createListener(_0x2392fb,_0x59e7f5){return function(_0x5e1498){_0x59e7f5[_0x5b0e('0x4')](_0x2392fb,_0x5e1498);};}function removeListener(_0x582501,_0x38ca7c){return function(){UserVoiceQueueRtEvents['removeListener'](_0x582501,_0x38ca7c);};}exports[_0x5b0e('0x5')]=function(_0x3f9d1b){for(var _0x5222fe=0x0,_0x598ede=events[_0x5b0e('0x6')];_0x5222fe<_0x598ede;_0x5222fe++){var _0x1bf5d0=events[_0x5222fe];var _0x2e7503=createListener(_0x5b0e('0x7')+_0x1bf5d0,_0x3f9d1b);UserVoiceQueueRtEvents['on'](_0x1bf5d0,_0x2e7503);}}; \ No newline at end of file +var _0x938d=['./userVoiceQueueRt.events','save','update','removeListener','length'];(function(_0x23fcbd,_0x5a9934){var _0x3f6360=function(_0x1a9d59){while(--_0x1a9d59){_0x23fcbd['push'](_0x23fcbd['shift']());}};_0x3f6360(++_0x5a9934);}(_0x938d,0x122));var _0xd938=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x938d[_0x3dd15e];return _0x231fd0;};'use strict';var UserVoiceQueueRtEvents=require(_0xd938('0x0'));var events=[_0xd938('0x1'),'remove',_0xd938('0x2')];function createListener(_0x29cf5f,_0x221132){return function(_0x5349c7){_0x221132['emit'](_0x29cf5f,_0x5349c7);};}function removeListener(_0xc9f24b,_0x429911){return function(){UserVoiceQueueRtEvents[_0xd938('0x3')](_0xc9f24b,_0x429911);};}exports['register']=function(_0x3a81d2){for(var _0xb5e113=0x0,_0x1ed46b=events[_0xd938('0x4')];_0xb5e113<_0x1ed46b;_0xb5e113++){var _0x678164=events[_0xb5e113];var _0x419e0b=createListener('userVoiceQueueRt:'+_0x678164,_0x3a81d2);UserVoiceQueueRtEvents['on'](_0x678164,_0x419e0b);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index e963dd0..bfa3bbe 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3bee78,_0x4323b4){var _0x3f4e72=function(_0x144ddc){while(--_0x144ddc){_0x3bee78['push'](_0x3bee78['shift']());}};_0x3f4e72(++_0x4323b4);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x55abdc,_0xc008b5){var _0xd8d97f=function(_0x3d72ac){while(--_0x3d72ac){_0x55abdc['push'](_0x55abdc['shift']());}};_0xd8d97f(++_0xc008b5);}(_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 d9b983c..3d9013c 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 _0x86a8=['INTEGER','sequelize','exports'];(function(_0x14be9e,_0x44e984){var _0x11fd99=function(_0x26cd70){while(--_0x26cd70){_0x14be9e['push'](_0x14be9e['shift']());}};_0x11fd99(++_0x44e984);}(_0x86a8,0xdf));var _0x886a=function(_0x236658,_0x39e45d){_0x236658=_0x236658-0x0;var _0x3dd7a8=_0x86a8[_0x236658];return _0x3dd7a8;};'use strict';var Sequelize=require(_0x886a('0x0'));module[_0x886a('0x1')]={'penalty':{'type':Sequelize[_0x886a('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x38ec=['INTEGER','sequelize','exports'];(function(_0x3d32c5,_0x348802){var _0x1d676e=function(_0x1c4234){while(--_0x1c4234){_0x3d32c5['push'](_0x3d32c5['shift']());}};_0x1d676e(++_0x348802);}(_0x38ec,0xfa));var _0xc38e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x38ec[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xc38e('0x0'));module[_0xc38e('0x1')]={'penalty':{'type':Sequelize[_0xc38e('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 455390b..468948b 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 _0x670e=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','UserWhatsappQueue','user_has_whatsapp_queues'];(function(_0x7e51fb,_0x123ff5){var _0x524b8e=function(_0x3493f0){while(--_0x3493f0){_0x7e51fb['push'](_0x7e51fb['shift']());}};_0x524b8e(++_0x123ff5);}(_0x670e,0x108));var _0xe670=function(_0xfc107f,_0x498e46){_0xfc107f=_0xfc107f-0x0;var _0x634c58=_0x670e[_0xfc107f];return _0x634c58;};'use strict';var _=require(_0xe670('0x0'));var util=require('util');var logger=require(_0xe670('0x1'))(_0xe670('0x2'));var moment=require(_0xe670('0x3'));var BPromise=require(_0xe670('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe670('0x5'));var rimraf=require(_0xe670('0x6'));var config=require(_0xe670('0x7'));var attributes=require('./userWhatsappQueue.attributes');module[_0xe670('0x8')]=function(_0x5a5ceb,_0x5cae13){return _0x5a5ceb[_0xe670('0x9')](_0xe670('0xa'),attributes,{'tableName':_0xe670('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc947=['UserWhatsappQueue','lodash','../../config/logger','api','moment','path','../../config/environment','exports','define'];(function(_0xdb576,_0x13705e){var _0x98a94b=function(_0x4c1533){while(--_0x4c1533){_0xdb576['push'](_0xdb576['shift']());}};_0x98a94b(++_0x13705e);}(_0xc947,0x169));var _0x7c94=function(_0x54c2d2,_0x3df46c){_0x54c2d2=_0x54c2d2-0x0;var _0x2bd554=_0xc947[_0x54c2d2];return _0x2bd554;};'use strict';var _=require(_0x7c94('0x0'));var util=require('util');var logger=require(_0x7c94('0x1'))(_0x7c94('0x2'));var moment=require(_0x7c94('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c94('0x4'));var rimraf=require('rimraf');var config=require(_0x7c94('0x5'));var attributes=require('./userWhatsappQueue.attributes');module[_0x7c94('0x6')]=function(_0x22adae,_0x59375b){return _0x22adae[_0x7c94('0x7')](_0x7c94('0x8'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 37bd1c3..4d7627a 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 _0x77f6=['info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','request\x20sent','debug','error','code','UserWhatsappQueue,\x20%s,\x20%s','message'];(function(_0x17a754,_0x5f1052){var _0x545d3e=function(_0x24ec39){while(--_0x24ec39){_0x17a754['push'](_0x17a754['shift']());}};_0x545d3e(++_0x5f1052);}(_0x77f6,0xe9));var _0x677f=function(_0x3fece0,_0x1ebf74){_0x3fece0=_0x3fece0-0x0;var _0xc2cf1d=_0x77f6[_0x3fece0];return _0xc2cf1d;};'use strict';var _=require(_0x677f('0x0'));var util=require(_0x677f('0x1'));var moment=require(_0x677f('0x2'));var BPromise=require(_0x677f('0x3'));var rs=require(_0x677f('0x4'));var fs=require('fs');var Redis=require(_0x677f('0x5'));var db=require(_0x677f('0x6'))['db'];var utils=require(_0x677f('0x7'));var logger=require(_0x677f('0x8'))('rpc');var config=require(_0x677f('0x9'));var jayson=require(_0x677f('0xa'));var client=jayson['client'][_0x677f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3713a1,_0x4c8fd3,_0x499619){return new BPromise(function(_0x1a730a,_0x533926){return client[_0x677f('0xc')](_0x3713a1,_0x499619)['then'](function(_0x183eef){logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x4c8fd3,_0x677f('0xd'));logger[_0x677f('0xe')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x4c8fd3,'request\x20sent',JSON['stringify'](_0x183eef));if(_0x183eef[_0x677f('0xf')]){if(_0x183eef['error'][_0x677f('0x10')]===0x1f4){logger[_0x677f('0xf')](_0x677f('0x11'),_0x4c8fd3,_0x183eef[_0x677f('0xf')][_0x677f('0x12')]);return _0x533926(_0x183eef[_0x677f('0xf')][_0x677f('0x12')]);}logger[_0x677f('0xf')](_0x677f('0x11'),_0x4c8fd3,_0x183eef['error'][_0x677f('0x12')]);return _0x1a730a(_0x183eef[_0x677f('0xf')][_0x677f('0x12')]);}else{logger[_0x677f('0x13')](_0x677f('0x11'),_0x4c8fd3,_0x677f('0xd'));_0x1a730a(_0x183eef['result'][_0x677f('0x12')]);}})[_0x677f('0x14')](function(_0x227929){logger[_0x677f('0xf')](_0x677f('0x11'),_0x4c8fd3,_0x227929);_0x533926(_0x227929);});});} \ No newline at end of file +var _0x337e=['rpc','../../config/environment','jayson/promise','client','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x43e45d,_0x287b69){var _0x44ee61=function(_0x497563){while(--_0x497563){_0x43e45d['push'](_0x43e45d['shift']());}};_0x44ee61(++_0x287b69);}(_0x337e,0x162));var _0xe337=function(_0x4d446d,_0x4ca224){_0x4d446d=_0x4d446d-0x0;var _0x416ca8=_0x337e[_0x4d446d];return _0x416ca8;};'use strict';var _=require(_0xe337('0x0'));var util=require(_0xe337('0x1'));var moment=require(_0xe337('0x2'));var BPromise=require(_0xe337('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe337('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe337('0x5'));var logger=require('../../config/logger')(_0xe337('0x6'));var config=require(_0xe337('0x7'));var jayson=require(_0xe337('0x8'));var client=jayson[_0xe337('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2294ef,_0x34d1f1,_0x5c215b){return new BPromise(function(_0x3fc52b,_0x448023){return client[_0xe337('0xa')](_0x2294ef,_0x5c215b)[_0xe337('0xb')](function(_0x29c107){logger[_0xe337('0xc')](_0xe337('0xd'),_0x34d1f1,_0xe337('0xe'));logger[_0xe337('0xf')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x34d1f1,_0xe337('0xe'),JSON[_0xe337('0x10')](_0x29c107));if(_0x29c107['error']){if(_0x29c107['error']['code']===0x1f4){logger['error'](_0xe337('0xd'),_0x34d1f1,_0x29c107[_0xe337('0x11')]['message']);return _0x448023(_0x29c107[_0xe337('0x11')][_0xe337('0x12')]);}logger['error'](_0xe337('0xd'),_0x34d1f1,_0x29c107[_0xe337('0x11')][_0xe337('0x12')]);return _0x3fc52b(_0x29c107['error'][_0xe337('0x12')]);}else{logger[_0xe337('0xc')](_0xe337('0xd'),_0x34d1f1,'request\x20sent');_0x3fc52b(_0x29c107['result'][_0xe337('0x12')]);}})[_0xe337('0x13')](function(_0x4b6941){logger['error'](_0xe337('0xd'),_0x34d1f1,_0x4b6941);_0x448023(_0x4b6941);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index b08018f..83de0c0 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 _0x0328=['../../config/environment','./variable.controller','isAuthenticated','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0328,0x172));var _0x8032=function(_0xf9fce7,_0x2b7e72){_0xf9fce7=_0xf9fce7-0x0;var _0x2b27c3=_0x0328[_0xf9fce7];return _0x2b27c3;};'use strict';var multer=require(_0x8032('0x0'));var util=require(_0x8032('0x1'));var path=require(_0x8032('0x2'));var timeout=require(_0x8032('0x3'));var express=require(_0x8032('0x4'));var router=express[_0x8032('0x5')]();var fs_extra=require(_0x8032('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8032('0x7'));var config=require(_0x8032('0x8'));var controller=require(_0x8032('0x9'));router['get']('/',auth[_0x8032('0xa')](),controller['index']);router['get'](_0x8032('0xb'),auth[_0x8032('0xa')](),controller['show']);router[_0x8032('0xc')]('/',auth['isAuthenticated'](),controller[_0x8032('0xd')]);router[_0x8032('0xe')](_0x8032('0xb'),auth['isAuthenticated'](),controller[_0x8032('0xf')]);router[_0x8032('0x10')](_0x8032('0xb'),auth['isAuthenticated'](),controller[_0x8032('0x11')]);module['exports']=router; \ No newline at end of file +var _0xa1a5=['/:id','update','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','show','post','create','put'];(function(_0x42d1c8,_0xc13c44){var _0x22f990=function(_0x3ce85f){while(--_0x3ce85f){_0x42d1c8['push'](_0x42d1c8['shift']());}};_0x22f990(++_0xc13c44);}(_0xa1a5,0x1b8));var _0x5a1a=function(_0x228cb5,_0x854201){_0x228cb5=_0x228cb5-0x0;var _0x577170=_0xa1a5[_0x228cb5];return _0x577170;};'use strict';var multer=require(_0x5a1a('0x0'));var util=require('util');var path=require(_0x5a1a('0x1'));var timeout=require(_0x5a1a('0x2'));var express=require(_0x5a1a('0x3'));var router=express[_0x5a1a('0x4')]();var fs_extra=require(_0x5a1a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5a1a('0x6'));var config=require(_0x5a1a('0x7'));var controller=require(_0x5a1a('0x8'));router[_0x5a1a('0x9')]('/',auth[_0x5a1a('0xa')](),controller[_0x5a1a('0xb')]);router[_0x5a1a('0x9')]('/:id',auth[_0x5a1a('0xa')](),controller[_0x5a1a('0xc')]);router[_0x5a1a('0xd')]('/',auth[_0x5a1a('0xa')](),controller[_0x5a1a('0xe')]);router[_0x5a1a('0xf')](_0x5a1a('0x10'),auth[_0x5a1a('0xa')](),controller[_0x5a1a('0x11')]);router['delete'](_0x5a1a('0x10'),auth[_0x5a1a('0xa')](),controller[_0x5a1a('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 8f81081..eadb86b 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 _0xc628=['STRING','sequelize','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xc628,0x6d));var _0x8c62=function(_0x856f37,_0x51476a){_0x856f37=_0x856f37-0x0;var _0x5ee158=_0xc628[_0x856f37];return _0x5ee158;};'use strict';var Sequelize=require(_0x8c62('0x0'));module[_0x8c62('0x1')]={'name':{'type':Sequelize[_0x8c62('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8c62('0x2')]}}; \ No newline at end of file +var _0x9e43=['STRING','name','sequelize','exports'];(function(_0x1125ef,_0x89658){var _0x5155e8=function(_0x562f5c){while(--_0x562f5c){_0x1125ef['push'](_0x1125ef['shift']());}};_0x5155e8(++_0x89658);}(_0x9e43,0x18a));var _0x39e4=function(_0x5bb207,_0x157700){_0x5bb207=_0x5bb207-0x0;var _0x4b198e=_0x9e43[_0x5bb207];return _0x4b198e;};'use strict';var Sequelize=require(_0x39e4('0x0'));module[_0x39e4('0x1')]={'name':{'type':Sequelize[_0x39e4('0x2')],'unique':_0x39e4('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x39e4('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index baec464..60b5e34 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 _0x6dd0=['Content-Range','apply','reject','save','update','then','get','Variables','UserProfileResource','destroy','stack','name','send','index','map','fieldName','type','query','intersection','model','attributes','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','Variable','findAll','rows','catch','show','params','keys','rawAttributes','fields','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count'];(function(_0x5a160f,_0x4703e7){var _0x1fcefe=function(_0x44f583){while(--_0x44f583){_0x5a160f['push'](_0x5a160f['shift']());}};_0x1fcefe(++_0x4703e7);}(_0x6dd0,0x8b));var _0x06dd=function(_0xf0b1a9,_0x589f41){_0xf0b1a9=_0xf0b1a9-0x0;var _0x2aeb98=_0x6dd0[_0xf0b1a9];return _0x2aeb98;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x06dd('0x0'));var zipdir=require(_0x06dd('0x1'));var jsonpatch=require(_0x06dd('0x2'));var rp=require(_0x06dd('0x3'));var moment=require(_0x06dd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x06dd('0x5'));var util=require('util');var path=require(_0x06dd('0x6'));var sox=require(_0x06dd('0x7'));var csv=require(_0x06dd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x06dd('0x9'));var _=require(_0x06dd('0xa'));var squel=require(_0x06dd('0xb'));var crypto=require(_0x06dd('0xc'));var jsforce=require(_0x06dd('0xd'));var deskjs=require(_0x06dd('0xe'));var toCsv=require('to-csv');var querystring=require(_0x06dd('0xf'));var Papa=require(_0x06dd('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x06dd('0x11'));var as=require(_0x06dd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x06dd('0x13'))(_0x06dd('0x14'));var utils=require(_0x06dd('0x15'));var config=require(_0x06dd('0x16'));var licenseUtil=require(_0x06dd('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x348d0,_0x4c6acf){_0x4c6acf=_0x4c6acf||0xcc;return function(_0x382d02){if(_0x382d02){return _0x348d0[_0x06dd('0x18')](_0x4c6acf);}return _0x348d0[_0x06dd('0x19')](_0x4c6acf)[_0x06dd('0x1a')]();};}function respondWithResult(_0x5fe2f8,_0x591eee){_0x591eee=_0x591eee||0xc8;return function(_0x4f6c16){if(_0x4f6c16){return _0x5fe2f8['status'](_0x591eee)[_0x06dd('0x1b')](_0x4f6c16);}};}function respondWithFilteredResult(_0x15e8b3,_0x4f1091){return function(_0x247a61){if(_0x247a61){var _0x38fa6b=typeof _0x4f1091[_0x06dd('0x1c')]===_0x06dd('0x1d')&&typeof _0x4f1091['limit']==='undefined';var _0x5324ce=_0x247a61['count'];var _0x465181=_0x38fa6b?0x0:_0x4f1091[_0x06dd('0x1c')];var _0x154260=_0x38fa6b?_0x247a61[_0x06dd('0x1e')]:_0x4f1091[_0x06dd('0x1c')]+_0x4f1091['limit'];var _0x4ebf62;if(_0x154260>=_0x5324ce){_0x154260=_0x5324ce;_0x4ebf62=0xc8;}else{_0x4ebf62=0xce;}_0x15e8b3[_0x06dd('0x19')](_0x4ebf62);return _0x15e8b3['set'](_0x06dd('0x1f'),_0x465181+'-'+_0x154260+'/'+_0x5324ce)[_0x06dd('0x1b')](_0x247a61);}return null;};}function patchUpdates(_0x3b615a){return function(_0x2ee71c){try{jsonpatch[_0x06dd('0x20')](_0x2ee71c,_0x3b615a,!![]);}catch(_0x540fcc){return BPromise[_0x06dd('0x21')](_0x540fcc);}return _0x2ee71c[_0x06dd('0x22')]();};}function saveUpdates(_0x50881e,_0x1f47af){return function(_0x1fbd83){if(_0x1fbd83){return _0x1fbd83[_0x06dd('0x23')](_0x50881e)['then'](function(_0x3141e0){return _0x3141e0;});}return null;};}function removeEntity(_0x2a4655,_0x1bf90b){return function(_0x388979){if(_0x388979){return _0x388979['destroy']()[_0x06dd('0x24')](function(){var _0x2563b5=_0x388979[_0x06dd('0x25')]({'plain':!![]});var _0x47bf04=_0x06dd('0x26');return db[_0x06dd('0x27')][_0x06dd('0x28')]({'where':{'type':_0x47bf04,'resourceId':_0x2563b5['id']}})[_0x06dd('0x24')](function(){return _0x388979;});})[_0x06dd('0x24')](function(){_0x2a4655[_0x06dd('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24ad42,_0x4eb4ca){return function(_0x23c453){if(!_0x23c453){_0x24ad42[_0x06dd('0x18')](0x194);}return _0x23c453;};}function handleError(_0x38d4de,_0x29e00f){_0x29e00f=_0x29e00f||0x1f4;return function(_0x23dd2c){logger['error'](_0x23dd2c[_0x06dd('0x29')]);if(_0x23dd2c[_0x06dd('0x2a')]){delete _0x23dd2c[_0x06dd('0x2a')];}_0x38d4de[_0x06dd('0x19')](_0x29e00f)[_0x06dd('0x2b')](_0x23dd2c);};}exports[_0x06dd('0x2c')]=function(_0x3846b6,_0x1610ef){var _0x25f2e1={},_0x2ab8e0={},_0x33a416={'count':0x0,'rows':[]};var _0x91ebee=_[_0x06dd('0x2d')](db['Variable']['rawAttributes'],function(_0x33896c){return{'name':_0x33896c[_0x06dd('0x2e')],'type':_0x33896c[_0x06dd('0x2f')]['key']};});_0x2ab8e0['model']=_['map'](_0x91ebee,'name');_0x2ab8e0['query']=_['keys'](_0x3846b6[_0x06dd('0x30')]);_0x2ab8e0['filters']=_[_0x06dd('0x31')](_0x2ab8e0[_0x06dd('0x32')],_0x2ab8e0[_0x06dd('0x30')]);_0x25f2e1[_0x06dd('0x33')]=_[_0x06dd('0x31')](_0x2ab8e0['model'],qs['fields'](_0x3846b6['query']['fields']));_0x25f2e1[_0x06dd('0x33')]=_0x25f2e1[_0x06dd('0x33')]['length']?_0x25f2e1[_0x06dd('0x33')]:_0x2ab8e0[_0x06dd('0x32')];if(!_0x3846b6[_0x06dd('0x30')][_0x06dd('0x34')](_0x06dd('0x35'))){_0x25f2e1[_0x06dd('0x36')]=qs[_0x06dd('0x36')](_0x3846b6['query']['limit']);_0x25f2e1[_0x06dd('0x1c')]=qs[_0x06dd('0x1c')](_0x3846b6['query'][_0x06dd('0x1c')]);}_0x25f2e1[_0x06dd('0x37')]=qs[_0x06dd('0x38')](_0x3846b6[_0x06dd('0x30')][_0x06dd('0x38')]);_0x25f2e1['where']=qs[_0x06dd('0x39')](_[_0x06dd('0x3a')](_0x3846b6[_0x06dd('0x30')],_0x2ab8e0[_0x06dd('0x39')]),_0x91ebee);if(_0x3846b6[_0x06dd('0x30')][_0x06dd('0x3b')]){_0x25f2e1[_0x06dd('0x3c')]=_[_0x06dd('0x3d')](_0x25f2e1['where'],{'$or':_['map'](_0x91ebee,function(_0x40f2cb){if(_0x40f2cb['type']!==_0x06dd('0x3e')){var _0x5dd8ab={};_0x5dd8ab[_0x40f2cb[_0x06dd('0x2a')]]={'$like':'%'+_0x3846b6['query']['filter']+'%'};return _0x5dd8ab;}})});}_0x25f2e1=_[_0x06dd('0x3d')]({},_0x25f2e1,_0x3846b6[_0x06dd('0x3f')]);var _0x50b179={'where':_0x25f2e1['where']};return db['Variable'][_0x06dd('0x1e')](_0x50b179)[_0x06dd('0x24')](function(_0x803cf0){_0x33a416[_0x06dd('0x1e')]=_0x803cf0;if(_0x3846b6['query'][_0x06dd('0x40')]){_0x25f2e1[_0x06dd('0x41')]=[{'all':!![]}];}return db[_0x06dd('0x42')][_0x06dd('0x43')](_0x25f2e1);})[_0x06dd('0x24')](function(_0x48735b){_0x33a416[_0x06dd('0x44')]=_0x48735b;return _0x33a416;})[_0x06dd('0x24')](respondWithFilteredResult(_0x1610ef,_0x25f2e1))[_0x06dd('0x45')](handleError(_0x1610ef,null));};exports[_0x06dd('0x46')]=function(_0x32c4f4,_0x571b75){var _0x314c7d={'raw':!![],'where':{'id':_0x32c4f4[_0x06dd('0x47')]['id']}},_0x163853={};_0x163853[_0x06dd('0x32')]=_[_0x06dd('0x48')](db[_0x06dd('0x42')][_0x06dd('0x49')]);_0x163853[_0x06dd('0x30')]=_[_0x06dd('0x48')](_0x32c4f4[_0x06dd('0x30')]);_0x163853[_0x06dd('0x39')]=_[_0x06dd('0x31')](_0x163853[_0x06dd('0x32')],_0x163853[_0x06dd('0x30')]);_0x314c7d['attributes']=_[_0x06dd('0x31')](_0x163853[_0x06dd('0x32')],qs[_0x06dd('0x4a')](_0x32c4f4[_0x06dd('0x30')][_0x06dd('0x4a')]));_0x314c7d[_0x06dd('0x33')]=_0x314c7d[_0x06dd('0x33')][_0x06dd('0x4b')]?_0x314c7d[_0x06dd('0x33')]:_0x163853[_0x06dd('0x32')];if(_0x32c4f4[_0x06dd('0x30')][_0x06dd('0x40')]){_0x314c7d[_0x06dd('0x41')]=[{'all':!![]}];}_0x314c7d=_[_0x06dd('0x3d')]({},_0x314c7d,_0x32c4f4[_0x06dd('0x3f')]);return db['Variable'][_0x06dd('0x4c')](_0x314c7d)['then'](handleEntityNotFound(_0x571b75,null))[_0x06dd('0x24')](respondWithResult(_0x571b75,null))[_0x06dd('0x45')](handleError(_0x571b75,null));};exports[_0x06dd('0x4d')]=function(_0x561465,_0x511082){return db[_0x06dd('0x42')][_0x06dd('0x4d')](_0x561465[_0x06dd('0x4e')],{})[_0x06dd('0x24')](function(_0x1bfbf3){var _0x51e0e1=_0x561465['user']['get']({'plain':!![]});if(!_0x51e0e1)throw new Error(_0x06dd('0x4f'));if(_0x51e0e1['role']==='user'){var _0x256368=_0x1bfbf3[_0x06dd('0x25')]({'plain':!![]});var _0x2e71d6='Variables';return db[_0x06dd('0x50')]['find']({'where':{'name':_0x2e71d6,'userProfileId':_0x51e0e1[_0x06dd('0x51')]},'raw':!![]})[_0x06dd('0x24')](function(_0x263033){if(_0x263033&&_0x263033[_0x06dd('0x52')]===0x0){return db['UserProfileResource'][_0x06dd('0x4d')]({'name':_0x256368[_0x06dd('0x2a')],'resourceId':_0x256368['id'],'type':_0x263033[_0x06dd('0x2a')],'sectionId':_0x263033['id']},{})[_0x06dd('0x24')](function(){return _0x1bfbf3;});}else{return _0x1bfbf3;}})[_0x06dd('0x45')](function(_0x22feb6){logger[_0x06dd('0x53')](_0x06dd('0x54'),_0x22feb6);throw _0x22feb6;});}return _0x1bfbf3;})[_0x06dd('0x24')](respondWithResult(_0x511082,0xc9))[_0x06dd('0x45')](handleError(_0x511082,null));};exports[_0x06dd('0x23')]=function(_0x33c857,_0x5b2909){if(_0x33c857[_0x06dd('0x4e')]['id']){delete _0x33c857[_0x06dd('0x4e')]['id'];}return db[_0x06dd('0x42')][_0x06dd('0x4c')]({'where':{'id':_0x33c857['params']['id']}})['then'](handleEntityNotFound(_0x5b2909,null))['then'](saveUpdates(_0x33c857[_0x06dd('0x4e')],null))[_0x06dd('0x24')](respondWithResult(_0x5b2909,null))['catch'](handleError(_0x5b2909,null));};exports['destroy']=function(_0x14656c,_0x547962){return db[_0x06dd('0x42')]['find']({'where':{'id':_0x14656c[_0x06dd('0x47')]['id']}})[_0x06dd('0x24')](handleEntityNotFound(_0x547962,null))[_0x06dd('0x24')](removeEntity(_0x547962,null))[_0x06dd('0x45')](handleError(_0x547962,null));}; \ No newline at end of file +var _0x98bf=['save','update','then','destroy','get','Variables','end','error','stack','name','send','index','Variable','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','sendStatus','status','undefined','limit','count','offset','Content-Range','json','apply','reject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x98bf,0x83));var _0xf98b=function(_0x5eacaf,_0xdea236){_0x5eacaf=_0x5eacaf-0x0;var _0x5c7f7f=_0x98bf[_0x5eacaf];return _0x5c7f7f;};'use strict';var emlformat=require(_0xf98b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf98b('0x1'));var jsonpatch=require(_0xf98b('0x2'));var rp=require('request-promise');var moment=require(_0xf98b('0x3'));var BPromise=require(_0xf98b('0x4'));var Mustache=require(_0xf98b('0x5'));var util=require(_0xf98b('0x6'));var path=require('path');var sox=require(_0xf98b('0x7'));var csv=require(_0xf98b('0x8'));var ejs=require(_0xf98b('0x9'));var fs=require('fs');var fs_extra=require(_0xf98b('0xa'));var _=require(_0xf98b('0xb'));var squel=require(_0xf98b('0xc'));var crypto=require(_0xf98b('0xd'));var jsforce=require(_0xf98b('0xe'));var deskjs=require(_0xf98b('0xf'));var toCsv=require(_0xf98b('0x8'));var querystring=require('querystring');var Papa=require(_0xf98b('0x10'));var Redis=require(_0xf98b('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf98b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xf98b('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xf98b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xbd83fa,_0x27eaa1){_0x27eaa1=_0x27eaa1||0xcc;return function(_0x4dad75){if(_0x4dad75){return _0xbd83fa[_0xf98b('0x15')](_0x27eaa1);}return _0xbd83fa[_0xf98b('0x16')](_0x27eaa1)['end']();};}function respondWithResult(_0x49fa86,_0x39e143){_0x39e143=_0x39e143||0xc8;return function(_0x549c39){if(_0x549c39){return _0x49fa86[_0xf98b('0x16')](_0x39e143)['json'](_0x549c39);}};}function respondWithFilteredResult(_0x5e418e,_0x10a2eb){return function(_0x2f0a9b){if(_0x2f0a9b){var _0x5897ac=typeof _0x10a2eb['offset']===_0xf98b('0x17')&&typeof _0x10a2eb[_0xf98b('0x18')]===_0xf98b('0x17');var _0x2e7294=_0x2f0a9b['count'];var _0x1c477e=_0x5897ac?0x0:_0x10a2eb['offset'];var _0x31a8bc=_0x5897ac?_0x2f0a9b[_0xf98b('0x19')]:_0x10a2eb[_0xf98b('0x1a')]+_0x10a2eb[_0xf98b('0x18')];var _0x2d515b;if(_0x31a8bc>=_0x2e7294){_0x31a8bc=_0x2e7294;_0x2d515b=0xc8;}else{_0x2d515b=0xce;}_0x5e418e[_0xf98b('0x16')](_0x2d515b);return _0x5e418e['set'](_0xf98b('0x1b'),_0x1c477e+'-'+_0x31a8bc+'/'+_0x2e7294)[_0xf98b('0x1c')](_0x2f0a9b);}return null;};}function patchUpdates(_0x4cab36){return function(_0x38c0f8){try{jsonpatch[_0xf98b('0x1d')](_0x38c0f8,_0x4cab36,!![]);}catch(_0x3d0b92){return BPromise[_0xf98b('0x1e')](_0x3d0b92);}return _0x38c0f8[_0xf98b('0x1f')]();};}function saveUpdates(_0x4f4edb,_0x50f082){return function(_0x3539e3){if(_0x3539e3){return _0x3539e3[_0xf98b('0x20')](_0x4f4edb)[_0xf98b('0x21')](function(_0x1e7f0f){return _0x1e7f0f;});}return null;};}function removeEntity(_0x576a47,_0x242b5f){return function(_0x1d4ebb){if(_0x1d4ebb){return _0x1d4ebb[_0xf98b('0x22')]()[_0xf98b('0x21')](function(){var _0x159bad=_0x1d4ebb[_0xf98b('0x23')]({'plain':!![]});var _0x45944f=_0xf98b('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x45944f,'resourceId':_0x159bad['id']}})[_0xf98b('0x21')](function(){return _0x1d4ebb;});})[_0xf98b('0x21')](function(){_0x576a47[_0xf98b('0x16')](0xcc)[_0xf98b('0x25')]();});}};}function handleEntityNotFound(_0x5d4d3a,_0x3f13ca){return function(_0x4260df){if(!_0x4260df){_0x5d4d3a[_0xf98b('0x15')](0x194);}return _0x4260df;};}function handleError(_0x1c035e,_0x3bed5a){_0x3bed5a=_0x3bed5a||0x1f4;return function(_0x4ffb86){logger[_0xf98b('0x26')](_0x4ffb86[_0xf98b('0x27')]);if(_0x4ffb86[_0xf98b('0x28')]){delete _0x4ffb86['name'];}_0x1c035e[_0xf98b('0x16')](_0x3bed5a)[_0xf98b('0x29')](_0x4ffb86);};}exports[_0xf98b('0x2a')]=function(_0x4855fe,_0x4ffa34){var _0x222029={},_0x3cd7d8={},_0x498342={'count':0x0,'rows':[]};var _0x3065d4=_['map'](db[_0xf98b('0x2b')][_0xf98b('0x2c')],function(_0x14a65a){return{'name':_0x14a65a[_0xf98b('0x2d')],'type':_0x14a65a[_0xf98b('0x2e')][_0xf98b('0x2f')]};});_0x3cd7d8[_0xf98b('0x30')]=_[_0xf98b('0x31')](_0x3065d4,_0xf98b('0x28'));_0x3cd7d8[_0xf98b('0x32')]=_[_0xf98b('0x33')](_0x4855fe[_0xf98b('0x32')]);_0x3cd7d8[_0xf98b('0x34')]=_[_0xf98b('0x35')](_0x3cd7d8['model'],_0x3cd7d8[_0xf98b('0x32')]);_0x222029[_0xf98b('0x36')]=_[_0xf98b('0x35')](_0x3cd7d8[_0xf98b('0x30')],qs[_0xf98b('0x37')](_0x4855fe[_0xf98b('0x32')][_0xf98b('0x37')]));_0x222029[_0xf98b('0x36')]=_0x222029[_0xf98b('0x36')][_0xf98b('0x38')]?_0x222029[_0xf98b('0x36')]:_0x3cd7d8[_0xf98b('0x30')];if(!_0x4855fe[_0xf98b('0x32')][_0xf98b('0x39')](_0xf98b('0x3a'))){_0x222029['limit']=qs[_0xf98b('0x18')](_0x4855fe[_0xf98b('0x32')]['limit']);_0x222029[_0xf98b('0x1a')]=qs[_0xf98b('0x1a')](_0x4855fe[_0xf98b('0x32')][_0xf98b('0x1a')]);}_0x222029[_0xf98b('0x3b')]=qs[_0xf98b('0x3c')](_0x4855fe[_0xf98b('0x32')][_0xf98b('0x3c')]);_0x222029[_0xf98b('0x3d')]=qs['filters'](_['pick'](_0x4855fe[_0xf98b('0x32')],_0x3cd7d8[_0xf98b('0x34')]),_0x3065d4);if(_0x4855fe[_0xf98b('0x32')][_0xf98b('0x3e')]){_0x222029[_0xf98b('0x3d')]=_[_0xf98b('0x3f')](_0x222029['where'],{'$or':_[_0xf98b('0x31')](_0x3065d4,function(_0x3f5a45){if(_0x3f5a45['type']!==_0xf98b('0x40')){var _0x208606={};_0x208606[_0x3f5a45[_0xf98b('0x28')]]={'$like':'%'+_0x4855fe['query'][_0xf98b('0x3e')]+'%'};return _0x208606;}})});}_0x222029=_[_0xf98b('0x3f')]({},_0x222029,_0x4855fe[_0xf98b('0x41')]);var _0x33a5d0={'where':_0x222029[_0xf98b('0x3d')]};return db[_0xf98b('0x2b')][_0xf98b('0x19')](_0x33a5d0)[_0xf98b('0x21')](function(_0xf00650){_0x498342['count']=_0xf00650;if(_0x4855fe['query'][_0xf98b('0x42')]){_0x222029[_0xf98b('0x43')]=[{'all':!![]}];}return db[_0xf98b('0x2b')][_0xf98b('0x44')](_0x222029);})[_0xf98b('0x21')](function(_0x5dc501){_0x498342['rows']=_0x5dc501;return _0x498342;})[_0xf98b('0x21')](respondWithFilteredResult(_0x4ffa34,_0x222029))[_0xf98b('0x45')](handleError(_0x4ffa34,null));};exports[_0xf98b('0x46')]=function(_0x208dc6,_0x3caec8){var _0x38a365={'raw':!![],'where':{'id':_0x208dc6['params']['id']}},_0x1d25cb={};_0x1d25cb[_0xf98b('0x30')]=_[_0xf98b('0x33')](db['Variable']['rawAttributes']);_0x1d25cb[_0xf98b('0x32')]=_[_0xf98b('0x33')](_0x208dc6['query']);_0x1d25cb[_0xf98b('0x34')]=_[_0xf98b('0x35')](_0x1d25cb[_0xf98b('0x30')],_0x1d25cb['query']);_0x38a365[_0xf98b('0x36')]=_[_0xf98b('0x35')](_0x1d25cb[_0xf98b('0x30')],qs[_0xf98b('0x37')](_0x208dc6['query'][_0xf98b('0x37')]));_0x38a365[_0xf98b('0x36')]=_0x38a365[_0xf98b('0x36')][_0xf98b('0x38')]?_0x38a365[_0xf98b('0x36')]:_0x1d25cb[_0xf98b('0x30')];if(_0x208dc6[_0xf98b('0x32')]['includeAll']){_0x38a365[_0xf98b('0x43')]=[{'all':!![]}];}_0x38a365=_[_0xf98b('0x3f')]({},_0x38a365,_0x208dc6[_0xf98b('0x41')]);return db[_0xf98b('0x2b')][_0xf98b('0x47')](_0x38a365)['then'](handleEntityNotFound(_0x3caec8,null))[_0xf98b('0x21')](respondWithResult(_0x3caec8,null))[_0xf98b('0x45')](handleError(_0x3caec8,null));};exports[_0xf98b('0x48')]=function(_0x2e627a,_0x21abf2){return db[_0xf98b('0x2b')]['create'](_0x2e627a[_0xf98b('0x49')],{})[_0xf98b('0x21')](function(_0x55d75c){var _0x28ce49=_0x2e627a[_0xf98b('0x4a')][_0xf98b('0x23')]({'plain':!![]});if(!_0x28ce49)throw new Error(_0xf98b('0x4b'));if(_0x28ce49['role']==='user'){var _0x41ed21=_0x55d75c[_0xf98b('0x23')]({'plain':!![]});var _0x1949e7='Variables';return db[_0xf98b('0x4c')][_0xf98b('0x47')]({'where':{'name':_0x1949e7,'userProfileId':_0x28ce49[_0xf98b('0x4d')]},'raw':!![]})[_0xf98b('0x21')](function(_0xbc110c){if(_0xbc110c&&_0xbc110c[_0xf98b('0x4e')]===0x0){return db['UserProfileResource'][_0xf98b('0x48')]({'name':_0x41ed21[_0xf98b('0x28')],'resourceId':_0x41ed21['id'],'type':_0xbc110c['name'],'sectionId':_0xbc110c['id']},{})[_0xf98b('0x21')](function(){return _0x55d75c;});}else{return _0x55d75c;}})[_0xf98b('0x45')](function(_0x27a9ee){logger[_0xf98b('0x26')](_0xf98b('0x4f'),_0x27a9ee);throw _0x27a9ee;});}return _0x55d75c;})[_0xf98b('0x21')](respondWithResult(_0x21abf2,0xc9))['catch'](handleError(_0x21abf2,null));};exports['update']=function(_0x791c60,_0x132107){if(_0x791c60[_0xf98b('0x49')]['id']){delete _0x791c60[_0xf98b('0x49')]['id'];}return db[_0xf98b('0x2b')][_0xf98b('0x47')]({'where':{'id':_0x791c60[_0xf98b('0x50')]['id']}})['then'](handleEntityNotFound(_0x132107,null))[_0xf98b('0x21')](saveUpdates(_0x791c60[_0xf98b('0x49')],null))[_0xf98b('0x21')](respondWithResult(_0x132107,null))[_0xf98b('0x45')](handleError(_0x132107,null));};exports[_0xf98b('0x22')]=function(_0xd1b067,_0x3fd6bf){return db[_0xf98b('0x2b')][_0xf98b('0x47')]({'where':{'id':_0xd1b067['params']['id']}})[_0xf98b('0x21')](handleEntityNotFound(_0x3fd6bf,null))['then'](removeEntity(_0x3fd6bf,null))[_0xf98b('0x45')](handleError(_0x3fd6bf,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 3c23e61..f6999a4 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 _0x921c=['define','tools_variables','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./variable.attributes'];(function(_0x4cbf20,_0x1bfa66){var _0x582ae4=function(_0x5eca38){while(--_0x5eca38){_0x4cbf20['push'](_0x4cbf20['shift']());}};_0x582ae4(++_0x1bfa66);}(_0x921c,0x77));var _0xc921=function(_0x4af9a5,_0x53bf37){_0x4af9a5=_0x4af9a5-0x0;var _0x81bcca=_0x921c[_0x4af9a5];return _0x81bcca;};'use strict';var _=require('lodash');var util=require(_0xc921('0x0'));var logger=require(_0xc921('0x1'))(_0xc921('0x2'));var moment=require('moment');var BPromise=require(_0xc921('0x3'));var rp=require(_0xc921('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc921('0x5'));var attributes=require(_0xc921('0x6'));module['exports']=function(_0x14611f,_0x3b6e6e){return _0x14611f[_0xc921('0x7')]('Variable',attributes,{'tableName':_0xc921('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3503=['api','moment','bluebird','request-promise','path','rimraf','./variable.attributes','exports','Variable','tools_variables'];(function(_0x164619,_0x1ef6f9){var _0x250786=function(_0x4445ae){while(--_0x4445ae){_0x164619['push'](_0x164619['shift']());}};_0x250786(++_0x1ef6f9);}(_0x3503,0x118));var _0x3350=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x3503[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3350('0x0'));var moment=require(_0x3350('0x1'));var BPromise=require(_0x3350('0x2'));var rp=require(_0x3350('0x3'));var fs=require('fs');var path=require(_0x3350('0x4'));var rimraf=require(_0x3350('0x5'));var config=require('../../config/environment');var attributes=require(_0x3350('0x6'));module[_0x3350('0x7')]=function(_0x275371,_0x5b5959){return _0x275371['define'](_0x3350('0x8'),attributes,{'tableName':_0x3350('0x9'),'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 c548418..8983429 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 _0x1cb9=['include','map','model','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowVariable','Variable','options','attributes'];(function(_0x16e9b5,_0x192142){var _0x206df0=function(_0x1a0a8f){while(--_0x1a0a8f){_0x16e9b5['push'](_0x16e9b5['shift']());}};_0x206df0(++_0x192142);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3f8c2f,_0x383d34){_0x3f8c2f=_0x3f8c2f-0x0;var _0x908803=_0x1cb9[_0x3f8c2f];return _0x908803;};'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')]('Variable,\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);});});}exports[_0x91cb('0x16')]=function(_0x1cd34b){var _0xcd1a78=this;return new Promise(function(_0x5cc1c3,_0x3fba4f){return db[_0x91cb('0x17')]['find']({'raw':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')]['where']||null:null,'attributes':_0x1cd34b['options']?_0x1cd34b['options'][_0x91cb('0x19')]||null:null,'include':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')]?_['map'](_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')],function(_0x1fa837){return{'model':db[_0x1fa837['model']],'as':_0x1fa837['as'],'attributes':_0x1fa837[_0x91cb('0x19')],'include':_0x1fa837[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x1fa837[_0x91cb('0x1a')],function(_0x3ca500){return{'model':db[_0x3ca500[_0x91cb('0x1c')]],'as':_0x3ca500['as'],'attributes':_0x3ca500[_0x91cb('0x19')],'include':_0x3ca500[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x3ca500['include'],function(_0x59bf3a){return{'model':db[_0x59bf3a[_0x91cb('0x1c')]],'as':_0x59bf3a['as'],'attributes':_0x59bf3a['attributes']};}):[]};}):[]};}):[]:[]})[_0x91cb('0x1d')](function(_0x34d372){logger[_0x91cb('0xc')]('ShowVariable',_0x1cd34b);logger[_0x91cb('0xf')]('ShowVariable',_0x1cd34b,JSON[_0x91cb('0x11')](_0x34d372));_0x5cc1c3(_0x34d372);})[_0x91cb('0x15')](function(_0x3b3ee6){logger[_0x91cb('0x12')](_0x91cb('0x16'),_0x3b3ee6['message'],_0x1cd34b);_0x3fba4f(_0xcd1a78[_0x91cb('0x12')](0x1f4,_0x3b3ee6['message']));});});}; \ No newline at end of file +var _0x6aa7=['include','model','attributes','map','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','find','options','raw','where'];(function(_0x2c42a5,_0x2d1b8f){var _0x50ef99=function(_0x1415f4){while(--_0x1415f4){_0x2c42a5['push'](_0x2c42a5['shift']());}};_0x50ef99(++_0x2d1b8f);}(_0x6aa7,0x178));var _0x76aa=function(_0x5494f7,_0x1b0372){_0x5494f7=_0x5494f7-0x0;var _0x12ba05=_0x6aa7[_0x5494f7];return _0x12ba05;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}exports[_0x76aa('0x16')]=function(_0x21c16d){var _0xa1bc7=this;return new Promise(function(_0x3ead3f,_0x496902){return db['Variable'][_0x76aa('0x17')]({'raw':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x19')]===undefined?!![]:![]:!![],'where':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1a')]||null:null,'attributes':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')]['attributes']||null:null,'include':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')]?_['map'](_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')],function(_0x31252f){return{'model':db[_0x31252f[_0x76aa('0x1c')]],'as':_0x31252f['as'],'attributes':_0x31252f[_0x76aa('0x1d')],'include':_0x31252f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x31252f[_0x76aa('0x1b')],function(_0x32bf9f){return{'model':db[_0x32bf9f[_0x76aa('0x1c')]],'as':_0x32bf9f['as'],'attributes':_0x32bf9f[_0x76aa('0x1d')],'include':_0x32bf9f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x32bf9f['include'],function(_0xb5e8a9){return{'model':db[_0xb5e8a9[_0x76aa('0x1c')]],'as':_0xb5e8a9['as'],'attributes':_0xb5e8a9[_0x76aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x76aa('0xa')](function(_0xa1e6){logger[_0x76aa('0xb')](_0x76aa('0x16'),_0x21c16d);logger[_0x76aa('0xe')](_0x76aa('0x16'),_0x21c16d,JSON[_0x76aa('0x10')](_0xa1e6));_0x3ead3f(_0xa1e6);})['catch'](function(_0x3fcb7f){logger['error'](_0x76aa('0x16'),_0x3fcb7f[_0x76aa('0x13')],_0x21c16d);_0x496902(_0xa1bc7[_0x76aa('0x11')](0x1f4,_0x3fcb7f[_0x76aa('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index bdbad3d..68c8438 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 _0x1add=['canUpdate','fetch','reset','/pull','pull','/restart','/migrations','migrations','express','Router','../../components/auth/service','./version.controller','get','index','isAuthenticated'];(function(_0x503ffd,_0x8ecde){var _0x160437=function(_0x2d45dd){while(--_0x2d45dd){_0x503ffd['push'](_0x503ffd['shift']());}};_0x160437(++_0x8ecde);}(_0x1add,0x1e8));var _0xd1ad=function(_0x58b23d,_0x225f08){_0x58b23d=_0x58b23d-0x0;var _0x43272f=_0x1add[_0x58b23d];return _0x43272f;};'use strict';var express=require(_0xd1ad('0x0'));var router=express[_0xd1ad('0x1')]();var auth=require(_0xd1ad('0x2'));var controller=require(_0xd1ad('0x3'));router[_0xd1ad('0x4')]('/',controller[_0xd1ad('0x5')]);router[_0xd1ad('0x4')]('/fetch',auth[_0xd1ad('0x6')](),auth[_0xd1ad('0x7')](),controller[_0xd1ad('0x8')]);router[_0xd1ad('0x4')]('/reset',auth[_0xd1ad('0x6')](),auth[_0xd1ad('0x7')](),controller[_0xd1ad('0x9')]);router[_0xd1ad('0x4')](_0xd1ad('0xa'),auth[_0xd1ad('0x6')](),auth['canUpdate'](),controller[_0xd1ad('0xb')]);router[_0xd1ad('0x4')](_0xd1ad('0xc'),auth[_0xd1ad('0x6')](),controller['restart']);router[_0xd1ad('0x4')](_0xd1ad('0xd'),controller[_0xd1ad('0xe')]);module['exports']=router; \ No newline at end of file +var _0x89d6=['express','Router','../../components/auth/service','./version.controller','get','index','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull','/restart','restart','migrations','exports'];(function(_0x254035,_0x2a8ed5){var _0x28c831=function(_0xfab489){while(--_0xfab489){_0x254035['push'](_0x254035['shift']());}};_0x28c831(++_0x2a8ed5);}(_0x89d6,0xaa));var _0x689d=function(_0x242b12,_0xda87b0){_0x242b12=_0x242b12-0x0;var _0x59ee49=_0x89d6[_0x242b12];return _0x59ee49;};'use strict';var express=require(_0x689d('0x0'));var router=express[_0x689d('0x1')]();var auth=require(_0x689d('0x2'));var controller=require(_0x689d('0x3'));router[_0x689d('0x4')]('/',controller[_0x689d('0x5')]);router[_0x689d('0x4')]('/fetch',auth[_0x689d('0x6')](),auth[_0x689d('0x7')](),controller[_0x689d('0x8')]);router['get'](_0x689d('0x9'),auth[_0x689d('0x6')](),auth['canUpdate'](),controller[_0x689d('0xa')]);router[_0x689d('0x4')](_0x689d('0xb'),auth[_0x689d('0x6')](),auth[_0x689d('0x7')](),controller[_0x689d('0xc')]);router[_0x689d('0x4')](_0x689d('0xd'),auth[_0x689d('0x6')](),controller[_0x689d('0xe')]);router[_0x689d('0x4')]('/migrations',controller[_0x689d('0xf')]);module[_0x689d('0x10')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 5cd9cbe..34e8f61 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 _0xa6f5=['migrations','readdirSync','join','root','server','length','replace','.js','push','sort','Migration','sequelize','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','path','pkginfo','version','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','index','exports','query','fetch','tags','latest','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch'];(function(_0xb47dc0,_0x407032){var _0x57f0b0=function(_0x11c030){while(--_0x11c030){_0xb47dc0['push'](_0xb47dc0['shift']());}};_0x57f0b0(++_0x407032);}(_0xa6f5,0x1c3));var _0x5a6f=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa6f5[_0x4154a6];return _0x3b2786;};'use strict';var Umzug=require('umzug');var path=require(_0x5a6f('0x0'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x5a6f('0x1'))(module,_0x5a6f('0x2'));var compareVersions=require('compare-versions');var exec=require('child_process')[_0x5a6f('0x3')];var db=require(_0x5a6f('0x4'))['db'];var config=require(_0x5a6f('0x5'));var pm2=require(_0x5a6f('0x6'));var logger=require(_0x5a6f('0x7'))(_0x5a6f('0x8'));var git=require(_0x5a6f('0x9'))(config['root']);exports[_0x5a6f('0xa')]=function(_0x551089,_0x1e8b08){var _0x5379a5={'current':module[_0x5a6f('0xb')][_0x5a6f('0x2')],'phonebar':0x2};if(_0x551089[_0x5a6f('0xc')]&&_0x551089[_0x5a6f('0xc')]['latest']){return git[_0x5a6f('0xd')]()[_0x5a6f('0xe')](function(_0x454ebc,_0x5141b7){_0x5379a5[_0x5a6f('0xf')]=(_0x454ebc?module[_0x5a6f('0xb')][_0x5a6f('0x2')]:_0x5141b7['latest'])||_0x5a6f('0x10');return _0x1e8b08[_0x5a6f('0x11')](0xc8)[_0x5a6f('0x12')](_0x5379a5);});}else{return _0x1e8b08['status'](0xc8)[_0x5a6f('0x12')](_0x5379a5);}};exports[_0x5a6f('0xd')]=function(_0x1b60da,_0x3936d8){return git['fetch']([_0x5a6f('0x13'),_0x5a6f('0x14')],function(_0x4ca025){if(_0x4ca025){logger[_0x5a6f('0x15')](_0x4ca025);return _0x3936d8[_0x5a6f('0x11')](0x1f4)['json'](_0x4ca025);}logger[_0x5a6f('0x16')](_0x5a6f('0x17'));return _0x3936d8[_0x5a6f('0x11')](0xc8)[_0x5a6f('0x12')]({'output':_0x5a6f('0x18')});});};exports[_0x5a6f('0x19')]=function(_0x1fbd1e,_0x34b398){return git[_0x5a6f('0x19')]([_0x5a6f('0x1a'),_0x5a6f('0x1b')],function(_0x5701b6){if(_0x5701b6){logger[_0x5a6f('0x15')](_0x5701b6);return _0x34b398[_0x5a6f('0x11')](0x1f4)[_0x5a6f('0x12')](_0x5701b6);}logger[_0x5a6f('0x16')](_0x5a6f('0x1c'));return _0x34b398[_0x5a6f('0x11')](0xc8)[_0x5a6f('0x12')]({'output':'git\x20reset\x20--hard'});});};exports[_0x5a6f('0x1d')]=function(_0x2aa379,_0x4da803){exec(_0x5a6f('0x1e'),function(_0x466f6f,_0x42d7a8,_0x6f20a6){logger[_0x5a6f('0x16')](_0x42d7a8);logger[_0x5a6f('0x16')](_0x6f20a6);if(_0x466f6f){logger[_0x5a6f('0x15')](_0x466f6f);return _0x4da803['status'](0x1f4)[_0x5a6f('0x12')](_0x466f6f);}return _0x4da803[_0x5a6f('0x11')](0xc8)[_0x5a6f('0x12')]({'output':_0x42d7a8});});};exports[_0x5a6f('0x1f')]=function(_0x20ae99,_0x14ecb5){return pm2[_0x5a6f('0x1f')]('motion2')[_0x5a6f('0x20')](function(_0x3516b3){logger[_0x5a6f('0x16')]('pm2\x20restart\x20motion\x20%s',_0x3516b3);return _0x14ecb5[_0x5a6f('0x11')](0xc8)[_0x5a6f('0x12')]({'output':_0x5a6f('0x21')});})[_0x5a6f('0x22')](function(_0x194548){logger['error'](_0x194548);return _0x14ecb5[_0x5a6f('0x11')](0x1f4)['json'](_0x194548);});};exports[_0x5a6f('0x23')]=function(_0x5a276a,_0xa5edc9){var _0x53c319=fs[_0x5a6f('0x24')](path[_0x5a6f('0x25')](config[_0x5a6f('0x26')],_0x5a6f('0x27'),_0x5a6f('0x23')));var _0x5ab971=[];for(var _0x9b572e=0x0;_0x9b572e<_0x53c319[_0x5a6f('0x28')];_0x9b572e++){var _0x185cbd=_0x53c319[_0x9b572e][_0x5a6f('0x29')](_0x5a6f('0x2a'),'');if(compareVersions(module[_0x5a6f('0xb')][_0x5a6f('0x2')],_0x185cbd)===-0x1){_0x5ab971[_0x5a6f('0x2b')](_0x185cbd);}}if(_0x5ab971['length']){var _0x5c89cf=_0x5ab971[_0x5a6f('0x2c')](compareVersions);var _0x33bb03=new Umzug({'storage':'sequelize','storageOptions':{'model':db['Migration'],'modelName':_0x5a6f('0x2d'),'columnName':_0x5a6f('0x2')},'migrations':{'params':[db[_0x5a6f('0x2e')]['getQueryInterface'](),db[_0x5a6f('0x2e')]['constructor'],function(){throw new Error(_0x5a6f('0x2f'));}],'path':path['join'](config[_0x5a6f('0x26')],'server',_0x5a6f('0x23')),'pattern':/\.js$/}});_0x33bb03['up']({'migrations':_[_0x5a6f('0x30')](_0x5c89cf,function(_0x3b1fa0){return _0x3b1fa0+_0x5a6f('0x2a');})})[_0x5a6f('0x20')](function(){return _0xa5edc9[_0x5a6f('0x11')](0xc8)[_0x5a6f('0x12')]({'output':_0x5a6f('0x31')+module[_0x5a6f('0xb')][_0x5a6f('0x2')]+_0x5a6f('0x32')+_[_0x5a6f('0x33')](_0x5c89cf),'migrations':_[_0x5a6f('0x25')](_0x5c89cf)});})[_0x5a6f('0x22')](function(_0x583a32){if(_0x583a32 instanceof db[_0x5a6f('0x2e')][_0x5a6f('0x34')]){return _0xa5edc9[_0x5a6f('0x11')](0xc8)['json']({'output':_0x5a6f('0x35')});}else{return _0xa5edc9['status'](0x1f4)[_0x5a6f('0x12')](_0x583a32);}});}else{return _0xa5edc9[_0x5a6f('0x11')](0xc8)[_0x5a6f('0x12')]({'output':_0x5a6f('0x35')});}}; \ No newline at end of file +var _0x8679=['npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','catch','migrations','readdirSync','root','length','replace','push','sort','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','server','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','sequelize','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','index','exports','query','latest','fetch','tags','2.0.0','status','json','origin','master','error','info','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull'];(function(_0x3450ef,_0x393a82){var _0x22b4f4=function(_0x8b1c43){while(--_0x8b1c43){_0x3450ef['push'](_0x3450ef['shift']());}};_0x22b4f4(++_0x393a82);}(_0x8679,0x176));var _0x9867=function(_0x5b2ff6,_0x517c4c){_0x5b2ff6=_0x5b2ff6-0x0;var _0x5b9926=_0x8679[_0x5b2ff6];return _0x5b9926;};'use strict';var Umzug=require(_0x9867('0x0'));var path=require(_0x9867('0x1'));var fs=require('fs');var _=require(_0x9867('0x2'));var pkginfo=require(_0x9867('0x3'))(module,_0x9867('0x4'));var compareVersions=require(_0x9867('0x5'));var exec=require(_0x9867('0x6'))['exec'];var db=require(_0x9867('0x7'))['db'];var config=require(_0x9867('0x8'));var pm2=require(_0x9867('0x9'));var logger=require(_0x9867('0xa'))(_0x9867('0xb'));var git=require(_0x9867('0xc'))(config['root']);exports[_0x9867('0xd')]=function(_0x2f4d42,_0xa35a22){var _0x1772f2={'current':module[_0x9867('0xe')][_0x9867('0x4')],'phonebar':0x2};if(_0x2f4d42[_0x9867('0xf')]&&_0x2f4d42['query'][_0x9867('0x10')]){return git[_0x9867('0x11')]()[_0x9867('0x12')](function(_0x3ed5d5,_0x1f1fe0){_0x1772f2[_0x9867('0x10')]=(_0x3ed5d5?module[_0x9867('0xe')][_0x9867('0x4')]:_0x1f1fe0[_0x9867('0x10')])||_0x9867('0x13');return _0xa35a22[_0x9867('0x14')](0xc8)[_0x9867('0x15')](_0x1772f2);});}else{return _0xa35a22[_0x9867('0x14')](0xc8)[_0x9867('0x15')](_0x1772f2);}};exports['fetch']=function(_0x466672,_0x1e5c9f){return git['fetch']([_0x9867('0x16'),_0x9867('0x17')],function(_0x5c7ac8){if(_0x5c7ac8){logger[_0x9867('0x18')](_0x5c7ac8);return _0x1e5c9f['status'](0x1f4)[_0x9867('0x15')](_0x5c7ac8);}logger[_0x9867('0x19')]('git\x20fetch');return _0x1e5c9f[_0x9867('0x14')](0xc8)[_0x9867('0x15')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x9867('0x1a')]=function(_0x356695,_0x48fe54){return git[_0x9867('0x1a')]([_0x9867('0x1b'),_0x9867('0x1c')],function(_0x21ad11){if(_0x21ad11){logger[_0x9867('0x18')](_0x21ad11);return _0x48fe54['status'](0x1f4)[_0x9867('0x15')](_0x21ad11);}logger['info'](_0x9867('0x1d'));return _0x48fe54['status'](0xc8)[_0x9867('0x15')]({'output':_0x9867('0x1e')});});};exports[_0x9867('0x1f')]=function(_0x5cdbb7,_0x3975a4){exec(_0x9867('0x20'),function(_0x361f03,_0x57d10e,_0x15d058){logger[_0x9867('0x19')](_0x57d10e);logger[_0x9867('0x19')](_0x15d058);if(_0x361f03){logger[_0x9867('0x18')](_0x361f03);return _0x3975a4[_0x9867('0x14')](0x1f4)[_0x9867('0x15')](_0x361f03);}return _0x3975a4[_0x9867('0x14')](0xc8)['json']({'output':_0x57d10e});});};exports[_0x9867('0x21')]=function(_0x4b184e,_0x1b96ce){return pm2['restart'](_0x9867('0x22'))[_0x9867('0x23')](function(_0x1b489b){logger['info'](_0x9867('0x24'),_0x1b489b);return _0x1b96ce[_0x9867('0x14')](0xc8)[_0x9867('0x15')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x9867('0x25')](function(_0x13b1e5){logger['error'](_0x13b1e5);return _0x1b96ce['status'](0x1f4)[_0x9867('0x15')](_0x13b1e5);});};exports[_0x9867('0x26')]=function(_0x37c51e,_0x4510f0){var _0x810118=fs[_0x9867('0x27')](path['join'](config[_0x9867('0x28')],'server',_0x9867('0x26')));var _0x14b9c8=[];for(var _0x4c3dce=0x0;_0x4c3dce<_0x810118[_0x9867('0x29')];_0x4c3dce++){var _0x46b245=_0x810118[_0x4c3dce][_0x9867('0x2a')]('.js','');if(compareVersions(module[_0x9867('0xe')][_0x9867('0x4')],_0x46b245)===-0x1){_0x14b9c8[_0x9867('0x2b')](_0x46b245);}}if(_0x14b9c8[_0x9867('0x29')]){var _0x4fb81b=_0x14b9c8[_0x9867('0x2c')](compareVersions);var _0x465a42=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x9867('0x2d')],'modelName':_0x9867('0x2d'),'columnName':_0x9867('0x4')},'migrations':{'params':[db['sequelize'][_0x9867('0x2e')](),db['sequelize'][_0x9867('0x2f')],function(){throw new Error(_0x9867('0x30'));}],'path':path[_0x9867('0x31')](config[_0x9867('0x28')],_0x9867('0x32'),_0x9867('0x26')),'pattern':/\.js$/}});_0x465a42['up']({'migrations':_['map'](_0x4fb81b,function(_0xab3761){return _0xab3761+_0x9867('0x33');})})[_0x9867('0x23')](function(){return _0x4510f0[_0x9867('0x14')](0xc8)['json']({'output':_0x9867('0x34')+module[_0x9867('0xe')][_0x9867('0x4')]+_0x9867('0x35')+_[_0x9867('0x36')](_0x4fb81b),'migrations':_[_0x9867('0x31')](_0x4fb81b)});})[_0x9867('0x25')](function(_0x9c8191){if(_0x9c8191 instanceof db[_0x9867('0x37')][_0x9867('0x38')]){return _0x4510f0['status'](0xc8)['json']({'output':_0x9867('0x39')});}else{return _0x4510f0[_0x9867('0x14')](0x1f4)[_0x9867('0x15')](_0x9c8191);}});}else{return _0x4510f0[_0x9867('0x14')](0xc8)['json']({'output':_0x9867('0x39')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index c3d4558..ee70e20 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 _0x467b=['/:id','show','post','create','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x468ac5,_0x2edfd5){var _0x33a807=function(_0x204fb5){while(--_0x204fb5){_0x468ac5['push'](_0x468ac5['shift']());}};_0x33a807(++_0x2edfd5);}(_0x467b,0x15e));var _0xb467=function(_0x39afe3,_0x5a1ebc){_0x39afe3=_0x39afe3-0x0;var _0x5f3215=_0x467b[_0x39afe3];return _0x5f3215;};'use strict';var multer=require('multer');var util=require(_0xb467('0x0'));var path=require('path');var timeout=require(_0xb467('0x1'));var express=require(_0xb467('0x2'));var router=express[_0xb467('0x3')]();var fs_extra=require(_0xb467('0x4'));var auth=require(_0xb467('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb467('0x6'));var controller=require('./voiceAgentReport.controller');router[_0xb467('0x7')]('/',auth[_0xb467('0x8')](),controller[_0xb467('0x9')]);router[_0xb467('0x7')](_0xb467('0xa'),auth[_0xb467('0x8')](),controller['describe']);router[_0xb467('0x7')](_0xb467('0xb'),auth['isAuthenticated'](),controller[_0xb467('0xc')]);router[_0xb467('0xd')]('/',auth[_0xb467('0x8')](),controller[_0xb467('0xe')]);router['put'](_0xb467('0xb'),auth['isAuthenticated'](),controller[_0xb467('0xf')]);router[_0xb467('0x10')](_0xb467('0xb'),auth[_0xb467('0x8')](),controller[_0xb467('0x11')]);module[_0xb467('0x12')]=router; \ No newline at end of file +var _0x9c5d=['./voiceAgentReport.controller','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x9c5d,0xfc));var _0xd9c5=function(_0x22658d,_0x328f29){_0x22658d=_0x22658d-0x0;var _0x49a56b=_0x9c5d[_0x22658d];return _0x49a56b;};'use strict';var multer=require('multer');var util=require(_0xd9c5('0x0'));var path=require(_0xd9c5('0x1'));var timeout=require(_0xd9c5('0x2'));var express=require(_0xd9c5('0x3'));var router=express['Router']();var fs_extra=require(_0xd9c5('0x4'));var auth=require(_0xd9c5('0x5'));var interaction=require(_0xd9c5('0x6'));var config=require(_0xd9c5('0x7'));var controller=require(_0xd9c5('0x8'));router['get']('/',auth[_0xd9c5('0x9')](),controller['index']);router['get'](_0xd9c5('0xa'),auth[_0xd9c5('0x9')](),controller[_0xd9c5('0xb')]);router['get'](_0xd9c5('0xc'),auth[_0xd9c5('0x9')](),controller[_0xd9c5('0xd')]);router[_0xd9c5('0xe')]('/',auth['isAuthenticated'](),controller[_0xd9c5('0xf')]);router[_0xd9c5('0x10')](_0xd9c5('0xc'),auth[_0xd9c5('0x9')](),controller[_0xd9c5('0x11')]);router[_0xd9c5('0x12')](_0xd9c5('0xc'),auth['isAuthenticated'](),controller[_0xd9c5('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 576b968..ceaa9ec 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 _0x2b65=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0xb5d87f,_0x128343){var _0x49fb2e=function(_0x58f4a8){while(--_0x58f4a8){_0xb5d87f['push'](_0xb5d87f['shift']());}};_0x49fb2e(++_0x128343);}(_0x2b65,0x131));var _0x52b6=function(_0x378d18,_0x17362b){_0x378d18=_0x378d18-0x0;var _0x52d233=_0x2b65[_0x378d18];return _0x52d233;};'use strict';var Sequelize=require(_0x52b6('0x0'));module[_0x52b6('0x1')]={'type':{'type':Sequelize[_0x52b6('0x2')]},'uniqueid':{'type':Sequelize[_0x52b6('0x2')]},'calleridnum':{'type':Sequelize[_0x52b6('0x2')]},'calleridname':{'type':Sequelize[_0x52b6('0x2')]},'queue':{'type':Sequelize[_0x52b6('0x2')]},'interface':{'type':Sequelize[_0x52b6('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x52b6('0x3')]},'agentconnectAt':{'type':Sequelize[_0x52b6('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x52b6('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x52b6('0x3')]},'agentdumpAt':{'type':Sequelize[_0x52b6('0x3')]},'holdtime':{'type':Sequelize[_0x52b6('0x4')]},'agentcomplete':{'type':Sequelize[_0x52b6('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x52b6('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x52b6('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x52b6('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x52b6('0x4')]},'reason':{'type':Sequelize[_0x52b6('0x2')]},'lastevent':{'type':Sequelize[_0x52b6('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x52b6('0x4')]},'channelstatedesc':{'type':Sequelize[_0x52b6('0x2')]},'connectedlinenum':{'type':Sequelize[_0x52b6('0x2')]},'connectedlinename':{'type':Sequelize[_0x52b6('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x52b6('0x2')]},'context':{'type':Sequelize[_0x52b6('0x2')]},'exten':{'type':Sequelize[_0x52b6('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x52b6('0x2')]},'destchannelstate':{'type':Sequelize[_0x52b6('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x52b6('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x52b6('0x2')]},'destlanguage':{'type':Sequelize[_0x52b6('0x2')]},'destaccountcode':{'type':Sequelize[_0x52b6('0x2')]},'destcontext':{'type':Sequelize[_0x52b6('0x2')]},'destexten':{'type':Sequelize[_0x52b6('0x2')]},'destpriority':{'type':Sequelize[_0x52b6('0x2')]},'destuniqueid':{'type':Sequelize[_0x52b6('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x52b6('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x52b6('0x2')]},'transfer':{'type':Sequelize[_0x52b6('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x52b6('0x2')],'comment':_0x52b6('0x6')},'transferexten':{'type':Sequelize[_0x52b6('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x52b6('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x056b=['INTEGER','BOOLEAN','exports','STRING','DATE'];(function(_0x2ef9e2,_0x376185){var _0x2d4632=function(_0x4abaf4){while(--_0x4abaf4){_0x2ef9e2['push'](_0x2ef9e2['shift']());}};_0x2d4632(++_0x376185);}(_0x056b,0xb6));var _0xb056=function(_0x244f8a,_0x5d6b6b){_0x244f8a=_0x244f8a-0x0;var _0x410e61=_0x056b[_0x244f8a];return _0x410e61;};'use strict';var Sequelize=require('sequelize');module[_0xb056('0x0')]={'type':{'type':Sequelize[_0xb056('0x1')]},'uniqueid':{'type':Sequelize[_0xb056('0x1')]},'calleridnum':{'type':Sequelize[_0xb056('0x1')]},'calleridname':{'type':Sequelize[_0xb056('0x1')]},'queue':{'type':Sequelize[_0xb056('0x1')]},'interface':{'type':Sequelize[_0xb056('0x1')]},'membername':{'type':Sequelize[_0xb056('0x1')]},'agentcalledAt':{'type':Sequelize[_0xb056('0x2')]},'agentconnectAt':{'type':Sequelize[_0xb056('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xb056('0x2')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0xb056('0x2')]},'holdtime':{'type':Sequelize[_0xb056('0x3')]},'agentcomplete':{'type':Sequelize[_0xb056('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xb056('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xb056('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xb056('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xb056('0x1')]},'lastevent':{'type':Sequelize[_0xb056('0x1')]},'channel':{'type':Sequelize[_0xb056('0x1')]},'channelstate':{'type':Sequelize[_0xb056('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xb056('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xb056('0x1')]},'accountcode':{'type':Sequelize[_0xb056('0x1')]},'context':{'type':Sequelize[_0xb056('0x1')]},'exten':{'type':Sequelize[_0xb056('0x1')]},'priority':{'type':Sequelize[_0xb056('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xb056('0x1')]},'destcalleridnum':{'type':Sequelize[_0xb056('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xb056('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xb056('0x1')]},'destlanguage':{'type':Sequelize[_0xb056('0x1')]},'destaccountcode':{'type':Sequelize[_0xb056('0x1')]},'destcontext':{'type':Sequelize[_0xb056('0x1')]},'destexten':{'type':Sequelize[_0xb056('0x1')]},'destpriority':{'type':Sequelize[_0xb056('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xb056('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xb056('0x1')]},'transfer':{'type':Sequelize[_0xb056('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xb056('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xb056('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xb056('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 29e93ce..4694f4b 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(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 57986ed..4a1c1f1 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 _0xda19=['request-promise','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','util','../../config/logger','moment'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xda19,0xd5));var _0x9da1=function(_0x6e6bed,_0x2685fc){_0x6e6bed=_0x6e6bed-0x0;var _0x4f6ce1=_0xda19[_0x6e6bed];return _0x4f6ce1;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var logger=require(_0x9da1('0x1'))('api');var moment=require(_0x9da1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9da1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var attributes=require(_0x9da1('0x6'));module[_0x9da1('0x7')]=function(_0x156faf,_0x2dcbc6){return _0x156faf[_0x9da1('0x8')](_0x9da1('0x9'),attributes,{'tableName':_0x9da1('0xa'),'paranoid':![],'indexes':[{'fields':[_0x9da1('0xb'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6c32=['exports','define','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceAgentReport.attributes'];(function(_0xbe40ad,_0x44343c){var _0x50fac9=function(_0xdaed07){while(--_0xdaed07){_0xbe40ad['push'](_0xbe40ad['shift']());}};_0x50fac9(++_0x44343c);}(_0x6c32,0x6e));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x26c3('0x0'));var util=require(_0x26c3('0x1'));var logger=require(_0x26c3('0x2'))(_0x26c3('0x3'));var moment=require(_0x26c3('0x4'));var BPromise=require(_0x26c3('0x5'));var rp=require(_0x26c3('0x6'));var fs=require('fs');var path=require(_0x26c3('0x7'));var rimraf=require(_0x26c3('0x8'));var config=require('../../config/environment');var attributes=require(_0x26c3('0x9'));module[_0x26c3('0xa')]=function(_0x15ac36,_0x57d915){return _0x15ac36[_0x26c3('0xb')]('VoiceAgentReport',attributes,{'tableName':_0x26c3('0xc'),'paranoid':![],'indexes':[{'fields':[_0x26c3('0xd'),_0x26c3('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 8caec9a..1d4cc8d 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 _0x7fab=['then','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceAgentReport,\x20%s,\x20%s','result','CreateVoiceAgentReport','create','body','options','raw','VoiceAgentReport','update','where','attributes','limit','UpdateVoiceAgentReport','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request'];(function(_0x56e0e8,_0x16ef91){var _0x2dab50=function(_0x4fe720){while(--_0x4fe720){_0x56e0e8['push'](_0x56e0e8['shift']());}};_0x2dab50(++_0x16ef91);}(_0x7fab,0x73));var _0xb7fa=function(_0x470ada,_0x453059){_0x470ada=_0x470ada-0x0;var _0x5a71e0=_0x7fab[_0x470ada];return _0x5a71e0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb7fa('0x0'));var rs=require(_0xb7fa('0x1'));var fs=require('fs');var Redis=require(_0xb7fa('0x2'));var db=require(_0xb7fa('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb7fa('0x4'))(_0xb7fa('0x5'));var config=require('../../config/environment');var jayson=require(_0xb7fa('0x6'));var client=jayson['client'][_0xb7fa('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3927a1,_0x58aa77,_0x2eb6a7){return new BPromise(function(_0x2b4935,_0x5e41a8){return client[_0xb7fa('0x8')](_0x3927a1,_0x2eb6a7)[_0xb7fa('0x9')](function(_0x4841f1){logger[_0xb7fa('0xa')]('VoiceAgentReport,\x20%s,\x20%s',_0x58aa77,_0xb7fa('0xb'));logger[_0xb7fa('0xc')](_0xb7fa('0xd'),_0x58aa77,'request\x20sent',JSON[_0xb7fa('0xe')](_0x4841f1));if(_0x4841f1[_0xb7fa('0xf')]){if(_0x4841f1['error'][_0xb7fa('0x10')]===0x1f4){logger[_0xb7fa('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x58aa77,_0x4841f1[_0xb7fa('0xf')][_0xb7fa('0x11')]);return _0x5e41a8(_0x4841f1['error']['message']);}logger[_0xb7fa('0xf')](_0xb7fa('0x12'),_0x58aa77,_0x4841f1['error'][_0xb7fa('0x11')]);return _0x2b4935(_0x4841f1['error'][_0xb7fa('0x11')]);}else{logger[_0xb7fa('0xa')](_0xb7fa('0x12'),_0x58aa77,_0xb7fa('0xb'));_0x2b4935(_0x4841f1[_0xb7fa('0x13')][_0xb7fa('0x11')]);}})['catch'](function(_0x1a3cff){logger[_0xb7fa('0xf')](_0xb7fa('0x12'),_0x58aa77,_0x1a3cff);_0x5e41a8(_0x1a3cff);});});}exports[_0xb7fa('0x14')]=function(_0x5e5241){var _0xd409d2=this;return new Promise(function(_0x1f076e,_0x3b7e79){return db['VoiceAgentReport'][_0xb7fa('0x15')](_0x5e5241[_0xb7fa('0x16')],{'raw':_0x5e5241[_0xb7fa('0x17')]?_0x5e5241[_0xb7fa('0x17')][_0xb7fa('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x3dc0dc){logger[_0xb7fa('0xa')](_0xb7fa('0x14'),_0x5e5241);logger[_0xb7fa('0xc')](_0xb7fa('0x14'),_0x5e5241,JSON[_0xb7fa('0xe')](_0x3dc0dc));_0x1f076e(_0x3dc0dc);})['catch'](function(_0x417eb4){logger[_0xb7fa('0xf')]('CreateVoiceAgentReport',_0x417eb4[_0xb7fa('0x11')],_0x5e5241);_0x3b7e79(_0xd409d2['error'](0x1f4,_0x417eb4['message']));});});};exports['UpdateVoiceAgentReport']=function(_0x30b3df){var _0x487d2f=this;return new Promise(function(_0x43f89e,_0x1268e6){return db[_0xb7fa('0x19')][_0xb7fa('0x1a')](_0x30b3df[_0xb7fa('0x16')],{'raw':_0x30b3df[_0xb7fa('0x17')]?_0x30b3df['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30b3df['options']?_0x30b3df[_0xb7fa('0x17')][_0xb7fa('0x1b')]||null:null,'attributes':_0x30b3df[_0xb7fa('0x17')]?_0x30b3df[_0xb7fa('0x17')][_0xb7fa('0x1c')]||null:null,'limit':_0x30b3df[_0xb7fa('0x17')]?_0x30b3df['options'][_0xb7fa('0x1d')]||null:null})[_0xb7fa('0x9')](function(_0x102902){logger[_0xb7fa('0xa')](_0xb7fa('0x1e'),_0x30b3df);logger[_0xb7fa('0xc')]('UpdateVoiceAgentReport',_0x30b3df,JSON['stringify'](_0x102902));_0x43f89e(_0x102902);})['catch'](function(_0x199ac8){logger[_0xb7fa('0xf')](_0xb7fa('0x1e'),_0x199ac8[_0xb7fa('0x11')],_0x30b3df);_0x1268e6(_0x487d2f[_0xb7fa('0xf')](0x1f4,_0x199ac8[_0xb7fa('0x11')]));});});}; \ No newline at end of file +var _0xed7a=['result','create','body','options','raw','then','CreateVoiceAgentReport','catch','VoiceAgentReport','update','where','limit','UpdateVoiceAgentReport','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xed7a,0xcd));var _0xaed7=function(_0x380365,_0x24308a){_0x380365=_0x380365-0x0;var _0x50f567=_0xed7a[_0x380365];return _0x50f567;};'use strict';var _=require(_0xaed7('0x0'));var util=require('util');var moment=require(_0xaed7('0x1'));var BPromise=require('bluebird');var rs=require(_0xaed7('0x2'));var fs=require('fs');var Redis=require(_0xaed7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xaed7('0x4'));var logger=require('../../config/logger')(_0xaed7('0x5'));var config=require(_0xaed7('0x6'));var jayson=require(_0xaed7('0x7'));var client=jayson[_0xaed7('0x8')][_0xaed7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54ac84,_0x29ba0c,_0x3d1387){return new BPromise(function(_0x36b94d,_0x170a2d){return client[_0xaed7('0xa')](_0x54ac84,_0x3d1387)['then'](function(_0x2c6e76){logger[_0xaed7('0xb')](_0xaed7('0xc'),_0x29ba0c,_0xaed7('0xd'));logger[_0xaed7('0xe')](_0xaed7('0xf'),_0x29ba0c,_0xaed7('0xd'),JSON[_0xaed7('0x10')](_0x2c6e76));if(_0x2c6e76[_0xaed7('0x11')]){if(_0x2c6e76['error']['code']===0x1f4){logger[_0xaed7('0x11')](_0xaed7('0xc'),_0x29ba0c,_0x2c6e76[_0xaed7('0x11')][_0xaed7('0x12')]);return _0x170a2d(_0x2c6e76[_0xaed7('0x11')][_0xaed7('0x12')]);}logger['error'](_0xaed7('0xc'),_0x29ba0c,_0x2c6e76[_0xaed7('0x11')][_0xaed7('0x12')]);return _0x36b94d(_0x2c6e76[_0xaed7('0x11')]['message']);}else{logger[_0xaed7('0xb')]('VoiceAgentReport,\x20%s,\x20%s',_0x29ba0c,_0xaed7('0xd'));_0x36b94d(_0x2c6e76[_0xaed7('0x13')]['message']);}})['catch'](function(_0x16727d){logger[_0xaed7('0x11')](_0xaed7('0xc'),_0x29ba0c,_0x16727d);_0x170a2d(_0x16727d);});});}exports['CreateVoiceAgentReport']=function(_0x4bb725){var _0x16d3e0=this;return new Promise(function(_0xeaa628,_0xe6ceb3){return db['VoiceAgentReport'][_0xaed7('0x14')](_0x4bb725[_0xaed7('0x15')],{'raw':_0x4bb725[_0xaed7('0x16')]?_0x4bb725[_0xaed7('0x16')][_0xaed7('0x17')]===undefined?!![]:![]:!![]})[_0xaed7('0x18')](function(_0x5ac4aa){logger[_0xaed7('0xb')](_0xaed7('0x19'),_0x4bb725);logger[_0xaed7('0xe')]('CreateVoiceAgentReport',_0x4bb725,JSON[_0xaed7('0x10')](_0x5ac4aa));_0xeaa628(_0x5ac4aa);})[_0xaed7('0x1a')](function(_0x580cc9){logger[_0xaed7('0x11')](_0xaed7('0x19'),_0x580cc9[_0xaed7('0x12')],_0x4bb725);_0xe6ceb3(_0x16d3e0['error'](0x1f4,_0x580cc9[_0xaed7('0x12')]));});});};exports['UpdateVoiceAgentReport']=function(_0x1acd20){var _0x1f22e6=this;return new Promise(function(_0x3eb805,_0x3d5792){return db[_0xaed7('0x1b')][_0xaed7('0x1c')](_0x1acd20['body'],{'raw':_0x1acd20[_0xaed7('0x16')]?_0x1acd20[_0xaed7('0x16')][_0xaed7('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1acd20[_0xaed7('0x16')]?_0x1acd20[_0xaed7('0x16')][_0xaed7('0x1d')]||null:null,'attributes':_0x1acd20['options']?_0x1acd20[_0xaed7('0x16')]['attributes']||null:null,'limit':_0x1acd20[_0xaed7('0x16')]?_0x1acd20[_0xaed7('0x16')][_0xaed7('0x1e')]||null:null})[_0xaed7('0x18')](function(_0xc4565a){logger[_0xaed7('0xb')](_0xaed7('0x1f'),_0x1acd20);logger[_0xaed7('0xe')](_0xaed7('0x1f'),_0x1acd20,JSON['stringify'](_0xc4565a));_0x3eb805(_0xc4565a);})[_0xaed7('0x1a')](function(_0x3025d7){logger['error'](_0xaed7('0x1f'),_0x3025d7[_0xaed7('0x12')],_0x1acd20);_0x3d5792(_0x1f22e6[_0xaed7('0x11')](0x1f4,_0x3025d7[_0xaed7('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index e96fb87..eb904d7 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 _0x3baf=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x5c16d7,_0x2cbc6e){var _0x4a0d47=function(_0x4175b6){while(--_0x4175b6){_0x5c16d7['push'](_0x5c16d7['shift']());}};_0x4a0d47(++_0x2cbc6e);}(_0x3baf,0xf7));var _0xf3ba=function(_0x44b91b,_0x182042){_0x44b91b=_0x44b91b-0x0;var _0xfeb56b=_0x3baf[_0x44b91b];return _0xfeb56b;};'use strict';var multer=require(_0xf3ba('0x0'));var util=require(_0xf3ba('0x1'));var path=require(_0xf3ba('0x2'));var timeout=require(_0xf3ba('0x3'));var express=require(_0xf3ba('0x4'));var router=express[_0xf3ba('0x5')]();var fs_extra=require(_0xf3ba('0x6'));var auth=require(_0xf3ba('0x7'));var interaction=require(_0xf3ba('0x8'));var config=require(_0xf3ba('0x9'));var controller=require(_0xf3ba('0xa'));router[_0xf3ba('0xb')]('/',auth[_0xf3ba('0xc')](),controller[_0xf3ba('0xd')]);router[_0xf3ba('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xf3ba('0xb')]('/:id',auth[_0xf3ba('0xc')](),controller[_0xf3ba('0xe')]);router[_0xf3ba('0xf')]('/',auth[_0xf3ba('0xc')](),controller[_0xf3ba('0x10')]);router[_0xf3ba('0x11')](_0xf3ba('0x12'),auth[_0xf3ba('0xc')](),controller[_0xf3ba('0x13')]);router[_0xf3ba('0x14')](_0xf3ba('0x12'),auth[_0xf3ba('0xc')](),controller[_0xf3ba('0x15')]);module[_0xf3ba('0x16')]=router; \ No newline at end of file +var _0x4b84=['update','delete','destroy','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/describe','describe','isAuthenticated','show','post','create','put','/:id'];(function(_0x1b40b5,_0x25e063){var _0x5f0a6e=function(_0x22af6d){while(--_0x22af6d){_0x1b40b5['push'](_0x1b40b5['shift']());}};_0x5f0a6e(++_0x25e063);}(_0x4b84,0x1cc));var _0x44b8=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x4b84[_0x54d4a8];return _0x3b321b;};'use strict';var multer=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x44b8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x44b8('0x3'));var interaction=require(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var controller=require('./voiceCallReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x44b8('0x6')]);router['get'](_0x44b8('0x7'),auth['isAuthenticated'](),controller[_0x44b8('0x8')]);router['get']('/:id',auth[_0x44b8('0x9')](),controller[_0x44b8('0xa')]);router[_0x44b8('0xb')]('/',auth['isAuthenticated'](),controller[_0x44b8('0xc')]);router[_0x44b8('0xd')](_0x44b8('0xe'),auth[_0x44b8('0x9')](),controller[_0x44b8('0xf')]);router[_0x44b8('0x10')](_0x44b8('0xe'),auth['isAuthenticated'](),controller[_0x44b8('0x11')]);module[_0x44b8('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 91e1f37..0ee723b 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 _0x9036=['inbound','internal','outbound','inbound-fax','TEXT','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0x9036,0x151));var _0x6903=function(_0x56e0e8,_0x16ef91){_0x56e0e8=_0x56e0e8-0x0;var _0x2dab50=_0x9036[_0x56e0e8];return _0x2dab50;};'use strict';var Sequelize=require(_0x6903('0x0'));module[_0x6903('0x1')]={'uniqueid':{'type':Sequelize[_0x6903('0x2')]},'type':{'type':Sequelize['ENUM'](_0x6903('0x3'),_0x6903('0x4'),_0x6903('0x5'),_0x6903('0x6'),'outbound-fax','dialer')},'tag':{'type':Sequelize[_0x6903('0x2')]},'accountcode':{'type':Sequelize[_0x6903('0x2')]},'source':{'type':Sequelize[_0x6903('0x2')]},'destination':{'type':Sequelize[_0x6903('0x2')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x6903('0x2')]},'channel':{'type':Sequelize[_0x6903('0x2')]},'destinationchannel':{'type':Sequelize[_0x6903('0x2')]},'lastapplication':{'type':Sequelize[_0x6903('0x2')]},'lastdata':{'type':Sequelize[_0x6903('0x7')]},'starttime':{'type':Sequelize[_0x6903('0x8')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x6903('0x8')]},'endtime':{'type':Sequelize[_0x6903('0x8')]},'duration':{'type':Sequelize[_0x6903('0x9')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x6903('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6903('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x6903('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x6903('0x2')]},'note':{'type':Sequelize[_0x6903('0x2')]},'prefix':{'type':Sequelize[_0x6903('0x2')]},'routeid':{'type':Sequelize[_0x6903('0x9')]},'sipcallid':{'type':Sequelize[_0x6903('0x2')]}}; \ No newline at end of file +var _0x552c=['STRING','ENUM','inbound','TEXT','DATE','INTEGER','exports'];(function(_0x33a694,_0x9b6640){var _0x41ff01=function(_0x4c38b7){while(--_0x4c38b7){_0x33a694['push'](_0x33a694['shift']());}};_0x41ff01(++_0x9b6640);}(_0x552c,0xa0));var _0xc552=function(_0x210b24,_0x11eea6){_0x210b24=_0x210b24-0x0;var _0x267fad=_0x552c[_0x210b24];return _0x267fad;};'use strict';var Sequelize=require('sequelize');module[_0xc552('0x0')]={'uniqueid':{'type':Sequelize[_0xc552('0x1')]},'type':{'type':Sequelize[_0xc552('0x2')](_0xc552('0x3'),'internal','outbound','inbound-fax','outbound-fax','dialer')},'tag':{'type':Sequelize[_0xc552('0x1')]},'accountcode':{'type':Sequelize[_0xc552('0x1')]},'source':{'type':Sequelize[_0xc552('0x1')]},'destination':{'type':Sequelize[_0xc552('0x1')]},'destinationcontext':{'type':Sequelize[_0xc552('0x1')]},'callerid':{'type':Sequelize[_0xc552('0x1')]},'channel':{'type':Sequelize[_0xc552('0x1')]},'destinationchannel':{'type':Sequelize[_0xc552('0x1')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xc552('0x4')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0xc552('0x5')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xc552('0x5')]},'duration':{'type':Sequelize[_0xc552('0x6')]},'billableseconds':{'type':Sequelize[_0xc552('0x6')]},'mohtime':{'type':Sequelize[_0xc552('0x6')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xc552('0x1')]},'userfield':{'type':Sequelize[_0xc552('0x1')]},'userDisposition':{'type':Sequelize[_0xc552('0x1')]},'userSecondDisposition':{'type':Sequelize[_0xc552('0x1')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc552('0x1')]},'prefix':{'type':Sequelize[_0xc552('0x1')]},'routeid':{'type':Sequelize[_0xc552('0x6')]},'sipcallid':{'type':Sequelize[_0xc552('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 020b019..8c5586c 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 _0x0b0e=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceCallReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','fullname','alias','User','findAll','rows','params','find','create','body','catch','describe','update','uniqueid','user','eml-format','zip-dir','request-promise','moment'];(function(_0x16c7c2,_0x5a51d4){var _0x419e06=function(_0x55e14f){while(--_0x55e14f){_0x16c7c2['push'](_0x16c7c2['shift']());}};_0x419e06(++_0x5a51d4);}(_0x0b0e,0x187));var _0xe0b0=function(_0x58a4b5,_0x182439){_0x58a4b5=_0x58a4b5-0x0;var _0x51821d=_0x0b0e[_0x58a4b5];return _0x51821d;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['VoiceCallReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'attributes':['id',_0xe0b0('0x27'),_0xe0b0('0x41'),_0xe0b0('0x42')],'model':db[_0xe0b0('0x43')],'as':_0xe0b0('0x43')}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x44')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x52ffe4){_0x36d137[_0xe0b0('0x45')]=_0x52ffe4;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))['catch'](handleError(_0x5b7a64,null));};exports['show']=function(_0x327fb4,_0x247f8d){var _0x56e7df={'raw':!![],'where':{'id':_0x327fb4[_0xe0b0('0x46')]['id']}},_0x18a59d={};_0x18a59d[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x2a')]['rawAttributes']);_0x18a59d['query']=_['keys'](_0x327fb4[_0xe0b0('0x2e')]);_0x18a59d[_0xe0b0('0x39')]=_['intersection'](_0x18a59d[_0xe0b0('0x31')],_0x18a59d[_0xe0b0('0x2e')]);_0x56e7df[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x18a59d[_0xe0b0('0x31')],qs['fields'](_0x327fb4['query'][_0xe0b0('0x33')]));_0x56e7df[_0xe0b0('0x32')]=_0x56e7df[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x56e7df[_0xe0b0('0x32')]:_0x18a59d['model'];if(_0x327fb4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x56e7df['include']=[{'all':!![]}];}_0x56e7df=_['merge']({},_0x56e7df,_0x327fb4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x47')](_0x56e7df)[_0xe0b0('0x23')](handleEntityNotFound(_0x247f8d,null))[_0xe0b0('0x23')](respondWithResult(_0x247f8d,null))['catch'](handleError(_0x247f8d,null));};exports[_0xe0b0('0x48')]=function(_0x87d8f3,_0x483f12){return db['VoiceCallReport'][_0xe0b0('0x48')](_0x87d8f3[_0xe0b0('0x49')],{})['then'](respondWithResult(_0x483f12,0xc9))[_0xe0b0('0x4a')](handleError(_0x483f12,null));};exports[_0xe0b0('0x24')]=function(_0x504284,_0x5cb2b6){return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x504284[_0xe0b0('0x46')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x5cb2b6,null))[_0xe0b0('0x23')](removeEntity(_0x5cb2b6,null))[_0xe0b0('0x4a')](handleError(_0x5cb2b6,null));};exports[_0xe0b0('0x4b')]=function(_0xf9e694,_0x5f5486){return db['VoiceCallReport'][_0xe0b0('0x4b')]()['then'](respondWithResult(_0x5f5486,null))['catch'](handleError(_0x5f5486,null));};exports[_0xe0b0('0x4c')]=function(_0x222174,_0x54cf7b){if(_0x222174['body'][_0xe0b0('0x4d')]){delete _0x222174[_0xe0b0('0x49')][_0xe0b0('0x4d')];}return db[_0xe0b0('0x2a')][_0xe0b0('0x47')]({'where':{'uniqueid':_0x222174[_0xe0b0('0x46')]['id'],'UserId':{'$or':[null,_0x222174[_0xe0b0('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x54cf7b,null))[_0xe0b0('0x23')](saveUpdates(_0x222174['body'],null))[_0xe0b0('0x23')](respondWithResult(_0x54cf7b,null))['catch'](handleError(_0x54cf7b,null));}; \ No newline at end of file +var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x4c184d,_0x4278ab){var _0x23d997=function(_0x22d068){while(--_0x22d068){_0x4c184d['push'](_0x4c184d['shift']());}};_0x23d997(++_0x4278ab);}(_0xadb5,0xad));var _0x5adb=function(_0x7666d0,_0xa89053){_0x7666d0=_0x7666d0-0x0;var _0xac2855=_0xadb5[_0x7666d0];return _0xac2855;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index a010073..5f03ac0 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 _0xf875=['moment','request-promise','path','./voiceCallReport.attributes','exports','report_call','lodash','../../config/logger','api'];(function(_0x548bc4,_0x576f0c){var _0x30653e=function(_0xf081e6){while(--_0xf081e6){_0x548bc4['push'](_0x548bc4['shift']());}};_0x30653e(++_0x576f0c);}(_0xf875,0x138));var _0x5f87=function(_0x3116be,_0x292a3b){_0x3116be=_0x3116be-0x0;var _0xc77ea4=_0xf875[_0x3116be];return _0xc77ea4;};'use strict';var _=require(_0x5f87('0x0'));var util=require('util');var logger=require(_0x5f87('0x1'))(_0x5f87('0x2'));var moment=require(_0x5f87('0x3'));var BPromise=require('bluebird');var rp=require(_0x5f87('0x4'));var fs=require('fs');var path=require(_0x5f87('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5f87('0x6'));module[_0x5f87('0x7')]=function(_0x2753a7,_0x1ae2d8){return _0x2753a7['define']('VoiceCallReport',attributes,{'tableName':_0x5f87('0x8'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0088=['moment','bluebird','request-promise','rimraf','exports','define','VoiceCallReport','report_call','lodash','../../config/logger','api'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x0088,0x1ec));var _0x8008=function(_0x17ac3d,_0x85e945){_0x17ac3d=_0x17ac3d-0x0;var _0x451afb=_0x0088[_0x17ac3d];return _0x451afb;};'use strict';var _=require(_0x8008('0x0'));var util=require('util');var logger=require(_0x8008('0x1'))(_0x8008('0x2'));var moment=require(_0x8008('0x3'));var BPromise=require(_0x8008('0x4'));var rp=require(_0x8008('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8008('0x6'));var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module[_0x8008('0x7')]=function(_0xbd66ce,_0x54f525){return _0xbd66ce[_0x8008('0x8')](_0x8008('0x9'),attributes,{'tableName':_0x8008('0xa'),'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 44d722a..b3a3314 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 _0xa0bc=['../../config/environment','jayson/promise','http','request','info','VoiceCallReport,\x20%s,\x20%s','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','limit','map','include','model','attributes','CreateVoiceCallReport','create','body','then','debug','catch','UpdateVoiceCallReport','where','lodash','util','moment','randomstring','ioredis'];(function(_0x49326a,_0x52f4a4){var _0x1bad8b=function(_0x2b666c){while(--_0x2b666c){_0x49326a['push'](_0x49326a['shift']());}};_0x1bad8b(++_0x52f4a4);}(_0xa0bc,0x1e5));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xca0b('0x0'));var util=require(_0xca0b('0x1'));var moment=require(_0xca0b('0x2'));var BPromise=require('bluebird');var rs=require(_0xca0b('0x3'));var fs=require('fs');var Redis=require(_0xca0b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xca0b('0x5'));var jayson=require(_0xca0b('0x6'));var client=jayson['client'][_0xca0b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xdd669d,_0x13341c,_0x39f1c5){return new BPromise(function(_0x1e9253,_0x431a8a){return client[_0xca0b('0x8')](_0xdd669d,_0x39f1c5)['then'](function(_0x4077a4){logger[_0xca0b('0x9')](_0xca0b('0xa'),_0x13341c,'request\x20sent');logger['debug'](_0xca0b('0xb'),_0x13341c,'request\x20sent',JSON[_0xca0b('0xc')](_0x4077a4));if(_0x4077a4[_0xca0b('0xd')]){if(_0x4077a4[_0xca0b('0xd')]['code']===0x1f4){logger[_0xca0b('0xd')](_0xca0b('0xa'),_0x13341c,_0x4077a4[_0xca0b('0xd')][_0xca0b('0xe')]);return _0x431a8a(_0x4077a4[_0xca0b('0xd')]['message']);}logger[_0xca0b('0xd')](_0xca0b('0xa'),_0x13341c,_0x4077a4['error'][_0xca0b('0xe')]);return _0x1e9253(_0x4077a4[_0xca0b('0xd')][_0xca0b('0xe')]);}else{logger[_0xca0b('0x9')](_0xca0b('0xa'),_0x13341c,_0xca0b('0xf'));_0x1e9253(_0x4077a4[_0xca0b('0x10')][_0xca0b('0xe')]);}})['catch'](function(_0x12c6cb){logger[_0xca0b('0xd')](_0xca0b('0xa'),_0x13341c,_0x12c6cb);_0x431a8a(_0x12c6cb);});});}exports[_0xca0b('0x11')]=function(_0x41fc0f){var _0x33853b=this;return new Promise(function(_0x13bd02,_0x7dbfc){return db[_0xca0b('0x12')][_0xca0b('0x13')]({'raw':_0x41fc0f[_0xca0b('0x14')]?_0x41fc0f[_0xca0b('0x14')][_0xca0b('0x15')]===undefined?!![]:![]:!![],'where':_0x41fc0f[_0xca0b('0x14')]?_0x41fc0f['options']['where']||null:null,'attributes':_0x41fc0f['options']?_0x41fc0f[_0xca0b('0x14')]['attributes']||null:null,'limit':_0x41fc0f[_0xca0b('0x14')]?_0x41fc0f[_0xca0b('0x14')][_0xca0b('0x16')]||null:null,'include':_0x41fc0f[_0xca0b('0x14')]?_0x41fc0f[_0xca0b('0x14')]['include']?_[_0xca0b('0x17')](_0x41fc0f[_0xca0b('0x14')][_0xca0b('0x18')],function(_0x12f62e){return{'model':db[_0x12f62e[_0xca0b('0x19')]],'as':_0x12f62e['as'],'attributes':_0x12f62e['attributes'],'include':_0x12f62e['include']?_[_0xca0b('0x17')](_0x12f62e[_0xca0b('0x18')],function(_0xb43511){return{'model':db[_0xb43511[_0xca0b('0x19')]],'as':_0xb43511['as'],'attributes':_0xb43511['attributes'],'include':_0xb43511[_0xca0b('0x18')]?_[_0xca0b('0x17')](_0xb43511['include'],function(_0x4126ee){return{'model':db[_0x4126ee[_0xca0b('0x19')]],'as':_0x4126ee['as'],'attributes':_0x4126ee[_0xca0b('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x372625){logger[_0xca0b('0x9')]('GetVoiceCallReport',_0x41fc0f);logger['debug'](_0xca0b('0x11'),_0x41fc0f,JSON[_0xca0b('0xc')](_0x372625));_0x13bd02(_0x372625);})['catch'](function(_0x34c462){logger['error'](_0xca0b('0x11'),_0x34c462[_0xca0b('0xe')],_0x41fc0f);_0x7dbfc(_0x33853b[_0xca0b('0xd')](0x1f4,_0x34c462['message']));});});};exports[_0xca0b('0x1b')]=function(_0x15ddab){var _0x53886d=this;return new Promise(function(_0x4650f8,_0x4b011f){return db[_0xca0b('0x12')][_0xca0b('0x1c')](_0x15ddab[_0xca0b('0x1d')],{'raw':_0x15ddab[_0xca0b('0x14')]?_0x15ddab[_0xca0b('0x14')][_0xca0b('0x15')]===undefined?!![]:![]:!![]})[_0xca0b('0x1e')](function(_0xf682e0){logger[_0xca0b('0x9')](_0xca0b('0x1b'),_0x15ddab);logger[_0xca0b('0x1f')](_0xca0b('0x1b'),_0x15ddab,JSON[_0xca0b('0xc')](_0xf682e0));_0x4650f8(_0xf682e0);})[_0xca0b('0x20')](function(_0x430773){logger[_0xca0b('0xd')](_0xca0b('0x1b'),_0x430773[_0xca0b('0xe')],_0x15ddab);_0x4b011f(_0x53886d['error'](0x1f4,_0x430773['message']));});});};exports[_0xca0b('0x21')]=function(_0x5a42d7){var _0x5cd139=this;return new Promise(function(_0x233b1d,_0x177c9a){return db['VoiceCallReport']['update'](_0x5a42d7['body'],{'raw':_0x5a42d7['options']?_0x5a42d7[_0xca0b('0x14')][_0xca0b('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a42d7['options']?_0x5a42d7['options'][_0xca0b('0x22')]||null:null,'attributes':_0x5a42d7[_0xca0b('0x14')]?_0x5a42d7[_0xca0b('0x14')]['attributes']||null:null,'limit':_0x5a42d7['options']?_0x5a42d7[_0xca0b('0x14')][_0xca0b('0x16')]||null:null})[_0xca0b('0x1e')](function(_0x2a901c){logger[_0xca0b('0x9')](_0xca0b('0x21'),_0x5a42d7);logger[_0xca0b('0x1f')](_0xca0b('0x21'),_0x5a42d7,JSON[_0xca0b('0xc')](_0x2a901c));_0x233b1d(_0x2a901c);})[_0xca0b('0x20')](function(_0x56be56){logger['error'](_0xca0b('0x21'),_0x56be56['message'],_0x5a42d7);_0x177c9a(_0x5cd139['error'](0x1f4,_0x56be56[_0xca0b('0xe')]));});});}; \ No newline at end of file +var _0x5d9b=['VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','limit','include','model','map','attributes','catch','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','where','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x20aadb,_0x5a607a){var _0x520018=function(_0x1d258a){while(--_0x1d258a){_0x20aadb['push'](_0x20aadb['shift']());}};_0x520018(++_0x5a607a);}(_0x5d9b,0x85));var _0xb5d9=function(_0x1c041b,_0x136a1d){_0x1c041b=_0x1c041b-0x0;var _0x1f90d0=_0x5d9b[_0x1c041b];return _0x1f90d0;};'use strict';var _=require(_0xb5d9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb5d9('0x1'));var fs=require('fs');var Redis=require(_0xb5d9('0x2'));var db=require(_0xb5d9('0x3'))['db'];var utils=require(_0xb5d9('0x4'));var logger=require(_0xb5d9('0x5'))(_0xb5d9('0x6'));var config=require(_0xb5d9('0x7'));var jayson=require(_0xb5d9('0x8'));var client=jayson[_0xb5d9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d1a3c,_0x182c42,_0x5f4a2d){return new BPromise(function(_0x21e9ff,_0xac042a){return client['request'](_0x5d1a3c,_0x5f4a2d)[_0xb5d9('0xa')](function(_0xfa4a01){logger[_0xb5d9('0xb')](_0xb5d9('0xc'),_0x182c42,_0xb5d9('0xd'));logger[_0xb5d9('0xe')](_0xb5d9('0xf'),_0x182c42,_0xb5d9('0xd'),JSON[_0xb5d9('0x10')](_0xfa4a01));if(_0xfa4a01['error']){if(_0xfa4a01['error']['code']===0x1f4){logger['error'](_0xb5d9('0xc'),_0x182c42,_0xfa4a01[_0xb5d9('0x11')][_0xb5d9('0x12')]);return _0xac042a(_0xfa4a01[_0xb5d9('0x11')][_0xb5d9('0x12')]);}logger[_0xb5d9('0x11')](_0xb5d9('0xc'),_0x182c42,_0xfa4a01[_0xb5d9('0x11')]['message']);return _0x21e9ff(_0xfa4a01[_0xb5d9('0x11')][_0xb5d9('0x12')]);}else{logger[_0xb5d9('0xb')](_0xb5d9('0xc'),_0x182c42,_0xb5d9('0xd'));_0x21e9ff(_0xfa4a01[_0xb5d9('0x13')]['message']);}})['catch'](function(_0xae572e){logger[_0xb5d9('0x11')](_0xb5d9('0xc'),_0x182c42,_0xae572e);_0xac042a(_0xae572e);});});}exports[_0xb5d9('0x14')]=function(_0x3099d1){var _0x41d9d6=this;return new Promise(function(_0x5ba082,_0x392617){return db[_0xb5d9('0x15')][_0xb5d9('0x16')]({'raw':_0x3099d1[_0xb5d9('0x17')]?_0x3099d1['options'][_0xb5d9('0x18')]===undefined?!![]:![]:!![],'where':_0x3099d1[_0xb5d9('0x17')]?_0x3099d1[_0xb5d9('0x17')]['where']||null:null,'attributes':_0x3099d1['options']?_0x3099d1[_0xb5d9('0x17')]['attributes']||null:null,'limit':_0x3099d1['options']?_0x3099d1[_0xb5d9('0x17')][_0xb5d9('0x19')]||null:null,'include':_0x3099d1[_0xb5d9('0x17')]?_0x3099d1[_0xb5d9('0x17')][_0xb5d9('0x1a')]?_['map'](_0x3099d1[_0xb5d9('0x17')][_0xb5d9('0x1a')],function(_0x29f180){return{'model':db[_0x29f180[_0xb5d9('0x1b')]],'as':_0x29f180['as'],'attributes':_0x29f180['attributes'],'include':_0x29f180[_0xb5d9('0x1a')]?_[_0xb5d9('0x1c')](_0x29f180[_0xb5d9('0x1a')],function(_0x30510e){return{'model':db[_0x30510e[_0xb5d9('0x1b')]],'as':_0x30510e['as'],'attributes':_0x30510e['attributes'],'include':_0x30510e[_0xb5d9('0x1a')]?_[_0xb5d9('0x1c')](_0x30510e[_0xb5d9('0x1a')],function(_0x1a1bbf){return{'model':db[_0x1a1bbf[_0xb5d9('0x1b')]],'as':_0x1a1bbf['as'],'attributes':_0x1a1bbf[_0xb5d9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb5d9('0xa')](function(_0xd0b72d){logger['info'](_0xb5d9('0x14'),_0x3099d1);logger[_0xb5d9('0xe')](_0xb5d9('0x14'),_0x3099d1,JSON[_0xb5d9('0x10')](_0xd0b72d));_0x5ba082(_0xd0b72d);})[_0xb5d9('0x1e')](function(_0x2cc4b9){logger[_0xb5d9('0x11')](_0xb5d9('0x14'),_0x2cc4b9[_0xb5d9('0x12')],_0x3099d1);_0x392617(_0x41d9d6[_0xb5d9('0x11')](0x1f4,_0x2cc4b9[_0xb5d9('0x12')]));});});};exports[_0xb5d9('0x1f')]=function(_0x4ea772){var _0x9533df=this;return new Promise(function(_0x4aefa5,_0xe4bd8a){return db[_0xb5d9('0x15')][_0xb5d9('0x20')](_0x4ea772[_0xb5d9('0x21')],{'raw':_0x4ea772[_0xb5d9('0x17')]?_0x4ea772[_0xb5d9('0x17')][_0xb5d9('0x18')]===undefined?!![]:![]:!![]})[_0xb5d9('0xa')](function(_0x586202){logger['info'](_0xb5d9('0x1f'),_0x4ea772);logger[_0xb5d9('0xe')]('CreateVoiceCallReport',_0x4ea772,JSON['stringify'](_0x586202));_0x4aefa5(_0x586202);})[_0xb5d9('0x1e')](function(_0x56386e){logger[_0xb5d9('0x11')](_0xb5d9('0x1f'),_0x56386e['message'],_0x4ea772);_0xe4bd8a(_0x9533df['error'](0x1f4,_0x56386e[_0xb5d9('0x12')]));});});};exports[_0xb5d9('0x22')]=function(_0x12c47c){var _0x181c8e=this;return new Promise(function(_0x266d83,_0x56b6e7){return db[_0xb5d9('0x15')][_0xb5d9('0x23')](_0x12c47c[_0xb5d9('0x21')],{'raw':_0x12c47c[_0xb5d9('0x17')]?_0x12c47c[_0xb5d9('0x17')][_0xb5d9('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12c47c[_0xb5d9('0x17')]?_0x12c47c['options'][_0xb5d9('0x24')]||null:null,'attributes':_0x12c47c[_0xb5d9('0x17')]?_0x12c47c['options']['attributes']||null:null,'limit':_0x12c47c[_0xb5d9('0x17')]?_0x12c47c['options']['limit']||null:null})[_0xb5d9('0xa')](function(_0x5391a4){logger[_0xb5d9('0xb')]('UpdateVoiceCallReport',_0x12c47c);logger['debug'](_0xb5d9('0x22'),_0x12c47c,JSON['stringify'](_0x5391a4));_0x266d83(_0x5391a4);})[_0xb5d9('0x1e')](function(_0x516032){logger[_0xb5d9('0x11')]('UpdateVoiceCallReport',_0x516032[_0xb5d9('0x12')],_0x12c47c);_0x56b6e7(_0x181c8e['error'](0x1f4,_0x516032['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index c5c8f38..1c447fa 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 _0x1280=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','index','/:id','isAuthenticated','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1fb8d6,_0x54f144){var _0x36df32=function(_0x966325){while(--_0x966325){_0x1fb8d6['push'](_0x1fb8d6['shift']());}};_0x36df32(++_0x54f144);}(_0x1280,0x189));var _0x0128=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0x1280[_0x349367];return _0x14179b;};'use strict';var multer=require(_0x0128('0x0'));var util=require(_0x0128('0x1'));var path=require(_0x0128('0x2'));var timeout=require(_0x0128('0x3'));var express=require(_0x0128('0x4'));var router=express[_0x0128('0x5')]();var fs_extra=require(_0x0128('0x6'));var auth=require(_0x0128('0x7'));var interaction=require(_0x0128('0x8'));var config=require(_0x0128('0x9'));var controller=require(_0x0128('0xa'));router[_0x0128('0xb')]('/',auth['isAuthenticated'](),controller[_0x0128('0xc')]);router['get'](_0x0128('0xd'),auth[_0x0128('0xe')](),controller[_0x0128('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0128('0x10')]);router[_0x0128('0x11')](_0x0128('0xd'),auth[_0x0128('0xe')](),controller[_0x0128('0x12')]);router['delete'](_0x0128('0xd'),auth[_0x0128('0xe')](),controller[_0x0128('0x13')]);module[_0x0128('0x14')]=router; \ No newline at end of file +var _0xc3e9=['create','/:id','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post'];(function(_0x24db5d,_0x34becb){var _0x303c44=function(_0x5674de){while(--_0x5674de){_0x24db5d['push'](_0x24db5d['shift']());}};_0x303c44(++_0x34becb);}(_0xc3e9,0x1c6));var _0x9c3e=function(_0x433b21,_0x1dad20){_0x433b21=_0x433b21-0x0;var _0x403212=_0xc3e9[_0x433b21];return _0x403212;};'use strict';var multer=require(_0x9c3e('0x0'));var util=require(_0x9c3e('0x1'));var path=require(_0x9c3e('0x2'));var timeout=require(_0x9c3e('0x3'));var express=require(_0x9c3e('0x4'));var router=express['Router']();var fs_extra=require(_0x9c3e('0x5'));var auth=require(_0x9c3e('0x6'));var interaction=require(_0x9c3e('0x7'));var config=require(_0x9c3e('0x8'));var controller=require('./voiceChanSpy.controller');router[_0x9c3e('0x9')]('/',auth[_0x9c3e('0xa')](),controller[_0x9c3e('0xb')]);router[_0x9c3e('0x9')]('/:id',auth[_0x9c3e('0xa')](),controller[_0x9c3e('0xc')]);router[_0x9c3e('0xd')]('/',auth[_0x9c3e('0xa')](),controller[_0x9c3e('0xe')]);router['put'](_0x9c3e('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x9c3e('0x10')]('/:id',auth[_0x9c3e('0xa')](),controller['destroy']);module[_0x9c3e('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 3036bbb..82e4c36 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 _0x3417=['exports','STRING','setDataValue','options','join','getDataValue','split','BOOLEAN','sequelize'];(function(_0x4d9f7f,_0x4b2cad){var _0x17ef3f=function(_0x4831d1){while(--_0x4831d1){_0x4d9f7f['push'](_0x4d9f7f['shift']());}};_0x17ef3f(++_0x4b2cad);}(_0x3417,0x6b));var _0x7341=function(_0xdc8491,_0x356ebd){_0xdc8491=_0xdc8491-0x0;var _0xf8195c=_0x3417[_0xdc8491];return _0xf8195c;};'use strict';var Sequelize=require(_0x7341('0x0'));module[_0x7341('0x1')]={'name':{'type':Sequelize[_0x7341('0x2')]},'prefix':{'type':Sequelize[_0x7341('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x7341('0x2')],'set':function(_0x5f3d15){this[_0x7341('0x3')](_0x7341('0x4'),_0x5f3d15?_0x5f3d15[_0x7341('0x5')](''):[]);},'get':function(){return this[_0x7341('0x6')](_0x7341('0x4'))?this[_0x7341('0x6')]('options')[_0x7341('0x7')](''):[];}},'auth':{'type':Sequelize[_0x7341('0x8')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x7341('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7341('0x2')]}}; \ No newline at end of file +var _0xe00f=['sequelize','name','options','join','getDataValue','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe00f,0x17a));var _0xfe00=function(_0x25662e,_0x4cec68){_0x25662e=_0x25662e-0x0;var _0x59b7bc=_0xe00f[_0x25662e];return _0x59b7bc;};'use strict';var Sequelize=require(_0xfe00('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':_0xfe00('0x1'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x3a1f13){this['setDataValue'](_0xfe00('0x2'),_0x3a1f13?_0x3a1f13[_0xfe00('0x3')](''):[]);},'get':function(){return this['getDataValue'](_0xfe00('0x2'))?this[_0xfe00('0x4')](_0xfe00('0x2'))['split'](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xfe00('0x5')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xfe00('0x5')]},'description':{'type':Sequelize[_0xfe00('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 96b5443..685aa95 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 _0xfd28=['include','findAll','catch','show','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','save','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','VoiceChanSpy','includeAll'];(function(_0x422bf5,_0x12274c){var _0x269d3c=function(_0x377dd3){while(--_0x377dd3){_0x422bf5['push'](_0x422bf5['shift']());}};_0x269d3c(++_0x12274c);}(_0xfd28,0x148));var _0x8fd2=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0xfd28[_0x1b4b23];return _0x2a325b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8fd2('0x0'));var zipdir=require(_0x8fd2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8fd2('0x2'));var moment=require('moment');var BPromise=require(_0x8fd2('0x3'));var Mustache=require(_0x8fd2('0x4'));var util=require(_0x8fd2('0x5'));var path=require('path');var sox=require(_0x8fd2('0x6'));var csv=require(_0x8fd2('0x7'));var ejs=require(_0x8fd2('0x8'));var fs=require('fs');var fs_extra=require(_0x8fd2('0x9'));var _=require(_0x8fd2('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8fd2('0xb'));var deskjs=require(_0x8fd2('0xc'));var toCsv=require(_0x8fd2('0x7'));var querystring=require('querystring');var Papa=require(_0x8fd2('0xd'));var Redis=require('ioredis');var authService=require(_0x8fd2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8fd2('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8fd2('0x10'))('api');var utils=require(_0x8fd2('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x8fd2('0x12'));var db=require(_0x8fd2('0x13'))['db'];function respondWithStatusCode(_0xfd78d,_0xa6d7ca){_0xa6d7ca=_0xa6d7ca||0xcc;return function(_0x17ad4c){if(_0x17ad4c){return _0xfd78d[_0x8fd2('0x14')](_0xa6d7ca);}return _0xfd78d[_0x8fd2('0x15')](_0xa6d7ca)[_0x8fd2('0x16')]();};}function respondWithResult(_0x2b152c,_0x2b4611){_0x2b4611=_0x2b4611||0xc8;return function(_0x118329){if(_0x118329){return _0x2b152c[_0x8fd2('0x15')](_0x2b4611)[_0x8fd2('0x17')](_0x118329);}};}function respondWithFilteredResult(_0x40712c,_0xa65b4){return function(_0x596639){if(_0x596639){var _0x20daca=typeof _0xa65b4['offset']==='undefined'&&typeof _0xa65b4['limit']===_0x8fd2('0x18');var _0x530866=_0x596639[_0x8fd2('0x19')];var _0x12e8a3=_0x20daca?0x0:_0xa65b4['offset'];var _0xabbeb4=_0x20daca?_0x596639[_0x8fd2('0x19')]:_0xa65b4[_0x8fd2('0x1a')]+_0xa65b4[_0x8fd2('0x1b')];var _0x14641a;if(_0xabbeb4>=_0x530866){_0xabbeb4=_0x530866;_0x14641a=0xc8;}else{_0x14641a=0xce;}_0x40712c['status'](_0x14641a);return _0x40712c['set'](_0x8fd2('0x1c'),_0x12e8a3+'-'+_0xabbeb4+'/'+_0x530866)['json'](_0x596639);}return null;};}function patchUpdates(_0x3c03de){return function(_0x490b39){try{jsonpatch[_0x8fd2('0x1d')](_0x490b39,_0x3c03de,!![]);}catch(_0x50f410){return BPromise['reject'](_0x50f410);}return _0x490b39[_0x8fd2('0x1e')]();};}function saveUpdates(_0x4c2be8,_0xd3981f){return function(_0x44ee7a){if(_0x44ee7a){return _0x44ee7a['update'](_0x4c2be8)[_0x8fd2('0x1f')](function(_0x2a9c3c){return _0x2a9c3c;});}return null;};}function removeEntity(_0x120285,_0x490ea5){return function(_0x299c1c){if(_0x299c1c){return _0x299c1c[_0x8fd2('0x20')]()[_0x8fd2('0x1f')](function(){var _0x4742cf=_0x299c1c[_0x8fd2('0x21')]({'plain':!![]});var _0x25db4e=_0x8fd2('0x22');return db[_0x8fd2('0x23')][_0x8fd2('0x20')]({'where':{'type':_0x25db4e,'resourceId':_0x4742cf['id']}})[_0x8fd2('0x1f')](function(){return _0x299c1c;});})[_0x8fd2('0x1f')](function(){_0x120285[_0x8fd2('0x15')](0xcc)[_0x8fd2('0x16')]();});}};}function handleEntityNotFound(_0x512e5a,_0x4c6af7){return function(_0x345bc3){if(!_0x345bc3){_0x512e5a[_0x8fd2('0x14')](0x194);}return _0x345bc3;};}function handleError(_0x288bcd,_0x56f294){_0x56f294=_0x56f294||0x1f4;return function(_0x2f26ae){logger[_0x8fd2('0x24')](_0x2f26ae[_0x8fd2('0x25')]);if(_0x2f26ae[_0x8fd2('0x26')]){delete _0x2f26ae[_0x8fd2('0x26')];}_0x288bcd[_0x8fd2('0x15')](_0x56f294)[_0x8fd2('0x27')](_0x2f26ae);};}exports['index']=function(_0xe76676,_0x13c9b9){var _0x818f61={},_0x446c7a={},_0x313902={'count':0x0,'rows':[]};var _0x3ea575=_[_0x8fd2('0x28')](db['VoiceChanSpy']['rawAttributes'],function(_0x5144ba){return{'name':_0x5144ba[_0x8fd2('0x29')],'type':_0x5144ba[_0x8fd2('0x2a')][_0x8fd2('0x2b')]};});_0x446c7a[_0x8fd2('0x2c')]=_['map'](_0x3ea575,'name');_0x446c7a[_0x8fd2('0x2d')]=_[_0x8fd2('0x2e')](_0xe76676[_0x8fd2('0x2d')]);_0x446c7a[_0x8fd2('0x2f')]=_[_0x8fd2('0x30')](_0x446c7a['model'],_0x446c7a[_0x8fd2('0x2d')]);_0x818f61['attributes']=_[_0x8fd2('0x30')](_0x446c7a['model'],qs[_0x8fd2('0x31')](_0xe76676['query'][_0x8fd2('0x31')]));_0x818f61[_0x8fd2('0x32')]=_0x818f61[_0x8fd2('0x32')]['length']?_0x818f61[_0x8fd2('0x32')]:_0x446c7a['model'];if(!_0xe76676[_0x8fd2('0x2d')][_0x8fd2('0x33')](_0x8fd2('0x34'))){_0x818f61['limit']=qs[_0x8fd2('0x1b')](_0xe76676[_0x8fd2('0x2d')][_0x8fd2('0x1b')]);_0x818f61['offset']=qs[_0x8fd2('0x1a')](_0xe76676[_0x8fd2('0x2d')][_0x8fd2('0x1a')]);}_0x818f61['order']=qs[_0x8fd2('0x35')](_0xe76676[_0x8fd2('0x2d')]['sort']);_0x818f61[_0x8fd2('0x36')]=qs[_0x8fd2('0x2f')](_[_0x8fd2('0x37')](_0xe76676[_0x8fd2('0x2d')],_0x446c7a[_0x8fd2('0x2f')]),_0x3ea575);if(_0xe76676[_0x8fd2('0x2d')][_0x8fd2('0x38')]){_0x818f61['where']=_[_0x8fd2('0x39')](_0x818f61['where'],{'$or':_['map'](_0x3ea575,function(_0x38fff9){if(_0x38fff9[_0x8fd2('0x2a')]!==_0x8fd2('0x3a')){var _0x2edcfd={};_0x2edcfd[_0x38fff9[_0x8fd2('0x26')]]={'$like':'%'+_0xe76676[_0x8fd2('0x2d')]['filter']+'%'};return _0x2edcfd;}})});}_0x818f61=_['merge']({},_0x818f61,_0xe76676[_0x8fd2('0x3b')]);var _0x4aff57={'where':_0x818f61['where']};return db[_0x8fd2('0x3c')][_0x8fd2('0x19')](_0x4aff57)[_0x8fd2('0x1f')](function(_0x28f927){_0x313902['count']=_0x28f927;if(_0xe76676[_0x8fd2('0x2d')][_0x8fd2('0x3d')]){_0x818f61[_0x8fd2('0x3e')]=[{'all':!![]}];}return db[_0x8fd2('0x3c')][_0x8fd2('0x3f')](_0x818f61);})[_0x8fd2('0x1f')](function(_0xb1938a){_0x313902['rows']=_0xb1938a;return _0x313902;})[_0x8fd2('0x1f')](respondWithFilteredResult(_0x13c9b9,_0x818f61))[_0x8fd2('0x40')](handleError(_0x13c9b9,null));};exports[_0x8fd2('0x41')]=function(_0x70404e,_0xde7e1){var _0x12b014={'raw':![],'where':{'id':_0x70404e['params']['id']}},_0x40a572={};_0x40a572[_0x8fd2('0x2c')]=_[_0x8fd2('0x2e')](db[_0x8fd2('0x3c')][_0x8fd2('0x42')]);_0x40a572[_0x8fd2('0x2d')]=_[_0x8fd2('0x2e')](_0x70404e[_0x8fd2('0x2d')]);_0x40a572['filters']=_[_0x8fd2('0x30')](_0x40a572['model'],_0x40a572[_0x8fd2('0x2d')]);_0x12b014['attributes']=_[_0x8fd2('0x30')](_0x40a572[_0x8fd2('0x2c')],qs[_0x8fd2('0x31')](_0x70404e['query'][_0x8fd2('0x31')]));_0x12b014[_0x8fd2('0x32')]=_0x12b014[_0x8fd2('0x32')]['length']?_0x12b014[_0x8fd2('0x32')]:_0x40a572['model'];if(_0x70404e[_0x8fd2('0x2d')][_0x8fd2('0x3d')]){_0x12b014[_0x8fd2('0x3e')]=[{'all':!![]}];}_0x12b014=_[_0x8fd2('0x39')]({},_0x12b014,_0x70404e[_0x8fd2('0x3b')]);return db[_0x8fd2('0x3c')][_0x8fd2('0x43')](_0x12b014)[_0x8fd2('0x1f')](handleEntityNotFound(_0xde7e1,null))[_0x8fd2('0x1f')](respondWithResult(_0xde7e1,null))[_0x8fd2('0x40')](handleError(_0xde7e1,null));};exports[_0x8fd2('0x44')]=function(_0x34f3a2,_0xd3d8cb){return db[_0x8fd2('0x3c')][_0x8fd2('0x44')](_0x34f3a2[_0x8fd2('0x45')],{})[_0x8fd2('0x1f')](function(_0x2a2c69){var _0x2fdbe5=_0x34f3a2['user']['get']({'plain':!![]});if(!_0x2fdbe5)throw new Error(_0x8fd2('0x46'));if(_0x2fdbe5[_0x8fd2('0x47')]===_0x8fd2('0x48')){var _0x5d79c3=_0x2a2c69['get']({'plain':!![]});var _0x177f04='ChanSpies';return db[_0x8fd2('0x49')][_0x8fd2('0x43')]({'where':{'name':_0x177f04,'userProfileId':_0x2fdbe5[_0x8fd2('0x4a')]},'raw':!![]})['then'](function(_0x2251d9){if(_0x2251d9&&_0x2251d9[_0x8fd2('0x4b')]===0x0){return db['UserProfileResource'][_0x8fd2('0x44')]({'name':_0x5d79c3[_0x8fd2('0x26')],'resourceId':_0x5d79c3['id'],'type':_0x2251d9[_0x8fd2('0x26')],'sectionId':_0x2251d9['id']},{})['then'](function(){return _0x2a2c69;});}else{return _0x2a2c69;}})[_0x8fd2('0x40')](function(_0x14cdc2){logger[_0x8fd2('0x24')](_0x8fd2('0x4c'),_0x14cdc2);throw _0x14cdc2;});}return _0x2a2c69;})[_0x8fd2('0x1f')](respondWithResult(_0xd3d8cb,0xc9))[_0x8fd2('0x40')](handleError(_0xd3d8cb,null));};exports['update']=function(_0x4d5340,_0x46a1a1){if(_0x4d5340[_0x8fd2('0x45')]['id']){delete _0x4d5340['body']['id'];}return db[_0x8fd2('0x3c')]['find']({'where':{'id':_0x4d5340['params']['id']}})[_0x8fd2('0x1f')](handleEntityNotFound(_0x46a1a1,null))[_0x8fd2('0x1f')](saveUpdates(_0x4d5340[_0x8fd2('0x45')],null))[_0x8fd2('0x1f')](respondWithResult(_0x46a1a1,null))[_0x8fd2('0x40')](handleError(_0x46a1a1,null));};exports[_0x8fd2('0x20')]=function(_0x52c912,_0x2f4759){return db[_0x8fd2('0x3c')][_0x8fd2('0x43')]({'where':{'id':_0x52c912[_0x8fd2('0x4d')]['id']}})[_0x8fd2('0x1f')](handleEntityNotFound(_0x2f4759,null))['then'](removeEntity(_0x2f4759,null))['catch'](handleError(_0x2f4759,null));}; \ No newline at end of file +var _0x67da=['json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','get','ChanSpies','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceChanSpy','include','findAll','catch','params','intersection','length','includeAll','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status'];(function(_0x1f97e8,_0x445a4a){var _0x1ed77c=function(_0x1c990d){while(--_0x1c990d){_0x1f97e8['push'](_0x1f97e8['shift']());}};_0x1ed77c(++_0x445a4a);}(_0x67da,0x192));var _0xa67d=function(_0x3ff7d6,_0x410834){_0x3ff7d6=_0x3ff7d6-0x0;var _0x166fed=_0x67da[_0x3ff7d6];return _0x166fed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa67d('0x0'));var zipdir=require(_0xa67d('0x1'));var jsonpatch=require(_0xa67d('0x2'));var rp=require(_0xa67d('0x3'));var moment=require(_0xa67d('0x4'));var BPromise=require(_0xa67d('0x5'));var Mustache=require(_0xa67d('0x6'));var util=require(_0xa67d('0x7'));var path=require(_0xa67d('0x8'));var sox=require(_0xa67d('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa67d('0xa'));var _=require('lodash');var squel=require(_0xa67d('0xb'));var crypto=require(_0xa67d('0xc'));var jsforce=require(_0xa67d('0xd'));var deskjs=require(_0xa67d('0xe'));var toCsv=require(_0xa67d('0xf'));var querystring=require(_0xa67d('0x10'));var Papa=require(_0xa67d('0x11'));var Redis=require(_0xa67d('0x12'));var authService=require(_0xa67d('0x13'));var qs=require(_0xa67d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa67d('0x15'));var logger=require(_0xa67d('0x16'))(_0xa67d('0x17'));var utils=require(_0xa67d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa67d('0x19'));var db=require(_0xa67d('0x1a'))['db'];function respondWithStatusCode(_0x560485,_0x4e86f6){_0x4e86f6=_0x4e86f6||0xcc;return function(_0x304ee2){if(_0x304ee2){return _0x560485['sendStatus'](_0x4e86f6);}return _0x560485[_0xa67d('0x1b')](_0x4e86f6)['end']();};}function respondWithResult(_0x5d757b,_0x22dcc7){_0x22dcc7=_0x22dcc7||0xc8;return function(_0x3b99e3){if(_0x3b99e3){return _0x5d757b['status'](_0x22dcc7)[_0xa67d('0x1c')](_0x3b99e3);}};}function respondWithFilteredResult(_0x267a67,_0x1cfe81){return function(_0x288e5f){if(_0x288e5f){var _0x5a47de=typeof _0x1cfe81['offset']==='undefined'&&typeof _0x1cfe81['limit']===_0xa67d('0x1d');var _0x553811=_0x288e5f[_0xa67d('0x1e')];var _0xf8422c=_0x5a47de?0x0:_0x1cfe81[_0xa67d('0x1f')];var _0x1b58c3=_0x5a47de?_0x288e5f[_0xa67d('0x1e')]:_0x1cfe81[_0xa67d('0x1f')]+_0x1cfe81[_0xa67d('0x20')];var _0x5538a5;if(_0x1b58c3>=_0x553811){_0x1b58c3=_0x553811;_0x5538a5=0xc8;}else{_0x5538a5=0xce;}_0x267a67[_0xa67d('0x1b')](_0x5538a5);return _0x267a67[_0xa67d('0x21')](_0xa67d('0x22'),_0xf8422c+'-'+_0x1b58c3+'/'+_0x553811)[_0xa67d('0x1c')](_0x288e5f);}return null;};}function patchUpdates(_0x28f38b){return function(_0x1c3498){try{jsonpatch['apply'](_0x1c3498,_0x28f38b,!![]);}catch(_0x3f1898){return BPromise[_0xa67d('0x23')](_0x3f1898);}return _0x1c3498[_0xa67d('0x24')]();};}function saveUpdates(_0xed6c3e,_0x48f240){return function(_0x276ef7){if(_0x276ef7){return _0x276ef7['update'](_0xed6c3e)[_0xa67d('0x25')](function(_0x415141){return _0x415141;});}return null;};}function removeEntity(_0x46bbc8,_0x9c2935){return function(_0x559009){if(_0x559009){return _0x559009[_0xa67d('0x26')]()[_0xa67d('0x25')](function(){var _0x5ed92a=_0x559009[_0xa67d('0x27')]({'plain':!![]});var _0x3dd0b9=_0xa67d('0x28');return db[_0xa67d('0x29')][_0xa67d('0x26')]({'where':{'type':_0x3dd0b9,'resourceId':_0x5ed92a['id']}})[_0xa67d('0x25')](function(){return _0x559009;});})['then'](function(){_0x46bbc8[_0xa67d('0x1b')](0xcc)[_0xa67d('0x2a')]();});}};}function handleEntityNotFound(_0x4e730e,_0x2ac61a){return function(_0x83b547){if(!_0x83b547){_0x4e730e[_0xa67d('0x2b')](0x194);}return _0x83b547;};}function handleError(_0x1e7f28,_0x40f829){_0x40f829=_0x40f829||0x1f4;return function(_0x8793cf){logger[_0xa67d('0x2c')](_0x8793cf[_0xa67d('0x2d')]);if(_0x8793cf[_0xa67d('0x2e')]){delete _0x8793cf[_0xa67d('0x2e')];}_0x1e7f28[_0xa67d('0x1b')](_0x40f829)[_0xa67d('0x2f')](_0x8793cf);};}exports[_0xa67d('0x30')]=function(_0x393269,_0x5e4f04){var _0x2998af={},_0x20c751={},_0x1fc18f={'count':0x0,'rows':[]};var _0x2703f5=_[_0xa67d('0x31')](db['VoiceChanSpy'][_0xa67d('0x32')],function(_0xc2b129){return{'name':_0xc2b129[_0xa67d('0x33')],'type':_0xc2b129[_0xa67d('0x34')][_0xa67d('0x35')]};});_0x20c751[_0xa67d('0x36')]=_[_0xa67d('0x31')](_0x2703f5,_0xa67d('0x2e'));_0x20c751[_0xa67d('0x37')]=_[_0xa67d('0x38')](_0x393269['query']);_0x20c751[_0xa67d('0x39')]=_['intersection'](_0x20c751[_0xa67d('0x36')],_0x20c751[_0xa67d('0x37')]);_0x2998af[_0xa67d('0x3a')]=_['intersection'](_0x20c751[_0xa67d('0x36')],qs[_0xa67d('0x3b')](_0x393269[_0xa67d('0x37')][_0xa67d('0x3b')]));_0x2998af[_0xa67d('0x3a')]=_0x2998af[_0xa67d('0x3a')]['length']?_0x2998af[_0xa67d('0x3a')]:_0x20c751[_0xa67d('0x36')];if(!_0x393269['query']['hasOwnProperty']('nolimit')){_0x2998af[_0xa67d('0x20')]=qs['limit'](_0x393269[_0xa67d('0x37')][_0xa67d('0x20')]);_0x2998af[_0xa67d('0x1f')]=qs[_0xa67d('0x1f')](_0x393269[_0xa67d('0x37')][_0xa67d('0x1f')]);}_0x2998af[_0xa67d('0x3c')]=qs[_0xa67d('0x3d')](_0x393269[_0xa67d('0x37')][_0xa67d('0x3d')]);_0x2998af[_0xa67d('0x3e')]=qs[_0xa67d('0x39')](_[_0xa67d('0x3f')](_0x393269['query'],_0x20c751['filters']),_0x2703f5);if(_0x393269['query'][_0xa67d('0x40')]){_0x2998af['where']=_[_0xa67d('0x41')](_0x2998af[_0xa67d('0x3e')],{'$or':_[_0xa67d('0x31')](_0x2703f5,function(_0x3777ae){if(_0x3777ae['type']!==_0xa67d('0x42')){var _0x46669f={};_0x46669f[_0x3777ae[_0xa67d('0x2e')]]={'$like':'%'+_0x393269[_0xa67d('0x37')][_0xa67d('0x40')]+'%'};return _0x46669f;}})});}_0x2998af=_[_0xa67d('0x41')]({},_0x2998af,_0x393269[_0xa67d('0x43')]);var _0x5b51dc={'where':_0x2998af['where']};return db[_0xa67d('0x44')][_0xa67d('0x1e')](_0x5b51dc)[_0xa67d('0x25')](function(_0x15b9b8){_0x1fc18f[_0xa67d('0x1e')]=_0x15b9b8;if(_0x393269[_0xa67d('0x37')]['includeAll']){_0x2998af[_0xa67d('0x45')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0xa67d('0x46')](_0x2998af);})[_0xa67d('0x25')](function(_0x2f698c){_0x1fc18f['rows']=_0x2f698c;return _0x1fc18f;})[_0xa67d('0x25')](respondWithFilteredResult(_0x5e4f04,_0x2998af))[_0xa67d('0x47')](handleError(_0x5e4f04,null));};exports['show']=function(_0x5765a8,_0xcd7852){var _0x5f0af2={'raw':![],'where':{'id':_0x5765a8[_0xa67d('0x48')]['id']}},_0x23f1e1={};_0x23f1e1[_0xa67d('0x36')]=_['keys'](db[_0xa67d('0x44')]['rawAttributes']);_0x23f1e1[_0xa67d('0x37')]=_[_0xa67d('0x38')](_0x5765a8['query']);_0x23f1e1[_0xa67d('0x39')]=_[_0xa67d('0x49')](_0x23f1e1[_0xa67d('0x36')],_0x23f1e1[_0xa67d('0x37')]);_0x5f0af2[_0xa67d('0x3a')]=_[_0xa67d('0x49')](_0x23f1e1[_0xa67d('0x36')],qs[_0xa67d('0x3b')](_0x5765a8['query'][_0xa67d('0x3b')]));_0x5f0af2[_0xa67d('0x3a')]=_0x5f0af2[_0xa67d('0x3a')][_0xa67d('0x4a')]?_0x5f0af2[_0xa67d('0x3a')]:_0x23f1e1['model'];if(_0x5765a8['query'][_0xa67d('0x4b')]){_0x5f0af2[_0xa67d('0x45')]=[{'all':!![]}];}_0x5f0af2=_[_0xa67d('0x41')]({},_0x5f0af2,_0x5765a8[_0xa67d('0x43')]);return db[_0xa67d('0x44')]['find'](_0x5f0af2)[_0xa67d('0x25')](handleEntityNotFound(_0xcd7852,null))['then'](respondWithResult(_0xcd7852,null))[_0xa67d('0x47')](handleError(_0xcd7852,null));};exports[_0xa67d('0x4c')]=function(_0x1c451f,_0x1dba18){return db[_0xa67d('0x44')]['create'](_0x1c451f[_0xa67d('0x4d')],{})[_0xa67d('0x25')](function(_0x348ebd){var _0x5833c2=_0x1c451f[_0xa67d('0x4e')][_0xa67d('0x27')]({'plain':!![]});if(!_0x5833c2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5833c2[_0xa67d('0x4f')]===_0xa67d('0x4e')){var _0x51c887=_0x348ebd['get']({'plain':!![]});var _0x21581d=_0xa67d('0x28');return db[_0xa67d('0x50')][_0xa67d('0x51')]({'where':{'name':_0x21581d,'userProfileId':_0x5833c2[_0xa67d('0x52')]},'raw':!![]})[_0xa67d('0x25')](function(_0x355ae2){if(_0x355ae2&&_0x355ae2[_0xa67d('0x53')]===0x0){return db[_0xa67d('0x29')]['create']({'name':_0x51c887[_0xa67d('0x2e')],'resourceId':_0x51c887['id'],'type':_0x355ae2[_0xa67d('0x2e')],'sectionId':_0x355ae2['id']},{})['then'](function(){return _0x348ebd;});}else{return _0x348ebd;}})[_0xa67d('0x47')](function(_0x18f99d){logger['error'](_0xa67d('0x54'),_0x18f99d);throw _0x18f99d;});}return _0x348ebd;})['then'](respondWithResult(_0x1dba18,0xc9))[_0xa67d('0x47')](handleError(_0x1dba18,null));};exports[_0xa67d('0x55')]=function(_0x503413,_0x1de1fb){if(_0x503413[_0xa67d('0x4d')]['id']){delete _0x503413[_0xa67d('0x4d')]['id'];}return db[_0xa67d('0x44')][_0xa67d('0x51')]({'where':{'id':_0x503413[_0xa67d('0x48')]['id']}})[_0xa67d('0x25')](handleEntityNotFound(_0x1de1fb,null))[_0xa67d('0x25')](saveUpdates(_0x503413['body'],null))[_0xa67d('0x25')](respondWithResult(_0x1de1fb,null))[_0xa67d('0x47')](handleError(_0x1de1fb,null));};exports[_0xa67d('0x26')]=function(_0x42fb68,_0x539307){return db[_0xa67d('0x44')][_0xa67d('0x51')]({'where':{'id':_0x42fb68[_0xa67d('0x48')]['id']}})[_0xa67d('0x25')](handleEntityNotFound(_0x539307,null))[_0xa67d('0x25')](removeEntity(_0x539307,null))[_0xa67d('0x47')](handleError(_0x539307,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index ab53d38..997e8f0 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 _0x834b=['VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','prefix','system','push','Set','CDR(type)=%s','chanspy','record','merge','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor','length','concat','internal','name','agent','then','catch','define','VoiceChanSpy','voice_chanspy'];(function(_0x190b14,_0x2d35e7){var _0x4d1a8f=function(_0x39dd91){while(--_0x39dd91){_0x190b14['push'](_0x190b14['shift']());}};_0x4d1a8f(++_0x2d35e7);}(_0x834b,0x78));var _0xb834=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x834b[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xb834('0x0'));var util=require(_0xb834('0x1'));var BPromise=require(_0xb834('0x2'));var attributes=require(_0xb834('0x3'));var getUserApplications=function(_0x2be599,_0x445422,_0x3384cc){var _0x23ea9d=0x1;var _0x33eac7=[];var _0x193990={'context':_0x445422[_0xb834('0x4')]||_0xb834('0x5'),'exten':util[_0xb834('0x6')]('%s%s',_0x2be599[_0xb834('0x7')],_0x3384cc),'type':_0xb834('0x8'),'isApp':![],'ChanSpyId':_0x2be599['id'],'UserId':_0x445422['id']};_0x33eac7[_0xb834('0x9')](_['merge']({'app':_0xb834('0xa'),'appdata':util[_0xb834('0x6')](_0xb834('0xb'),_0xb834('0xc')),'priority':_0x23ea9d++},_0x193990));if(_0x2be599[_0xb834('0xd')]){_0x33eac7[_0xb834('0x9')](_[_0xb834('0xe')]({'app':_0xb834('0xf'),'appdata':util[_0xb834('0x6')](_0xb834('0x10'),_0x2be599[_0xb834('0x11')]),'priority':_0x23ea9d++},_0x193990));}if(_0x2be599[_0xb834('0x12')]){_0x33eac7[_0xb834('0x9')](_[_0xb834('0xe')]({'app':_0xb834('0x13'),'appdata':_0x2be599[_0xb834('0x14')],'priority':_0x23ea9d++},_0x193990));}_0x33eac7[_0xb834('0x9')](_[_0xb834('0xe')]({'app':_0xb834('0x15'),'appdata':util[_0xb834('0x6')](_0xb834('0x16'),_0x445422['name'],_0x2be599['options']?_0x2be599[_0xb834('0x17')][_0xb834('0x18')](''):''),'priority':_0x23ea9d++},_0x193990));if(_0x2be599[_0xb834('0xd')]){_0x33eac7[_0xb834('0x9')](_['merge']({'app':_0xb834('0x19'),'priority':_0x23ea9d++},_0x193990));}return _0x33eac7;};var getChanSpyApplications=function(_0x30b3a1,_0x1b5ed3){var _0x53d809=[];for(var _0x5cf2ea=0x0,_0x1cc07f=0x1;_0x5cf2ea<_0x1b5ed3[_0xb834('0x1a')];_0x5cf2ea++,_0x1cc07f=0x1){_0x53d809=_0x53d809[_0xb834('0x1b')](getUserApplications(_0x30b3a1,_0x1b5ed3[_0x5cf2ea],_0x1b5ed3[_0x5cf2ea][_0xb834('0x1c')]));if(_0x1b5ed3[_0x5cf2ea][_0xb834('0x1c')]!=_0x1b5ed3[_0x5cf2ea][_0xb834('0x1d')]){_0x53d809=_0x53d809['concat'](getUserApplications(_0x30b3a1,_0x1b5ed3[_0x5cf2ea],_0x1b5ed3[_0x5cf2ea][_0xb834('0x1d')]));}}return _0x53d809;};var getChanSpyPromise=function(_0x30e104,_0x3888ee){return new BPromise(function(_0x93aec8,_0x47cee6){return _0x30e104['User']['findAll']({'attributes':['id',_0xb834('0x1d'),_0xb834('0x1c')],'where':{'role':_0xb834('0x1e'),'chanspy':!![]},'raw':!![]})[_0xb834('0x1f')](function(_0x446be9){if(_0x446be9){return _0x93aec8(getChanSpyApplications(_0x3888ee,_0x446be9));}return _0x93aec8([]);})[_0xb834('0x20')](function(_0x21922f){_0x47cee6(_0x21922f);});});};module['exports']=function(_0xc2f2e9,_0x1ca25b){var _0x520b6f=_0xc2f2e9['models'];return _0xc2f2e9[_0xb834('0x21')](_0xb834('0x22'),attributes,{'tableName':_0xb834('0x23'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x49c3d5,_0x1b01ab,_0x506d84){return getChanSpyPromise(_0x520b6f,_0x49c3d5)['then'](function(_0x5f3f52){if(_0x5f3f52&&_0x5f3f52[_0xb834('0x1a')]){return _0x520b6f[_0xb834('0x24')][_0xb834('0x25')](_0x5f3f52);}})['then'](function(){_0x506d84();})[_0xb834('0x20')](function(_0x345aa0){_0x506d84(_0x345aa0);});},'afterUpdate':function(_0x537765,_0x34c570,_0xc5bb59){return _0x520b6f[_0xb834('0x24')][_0xb834('0x26')]({'where':{'ChanSpyId':_0x537765['id']}})[_0xb834('0x1f')](function(){return getChanSpyPromise(_0x520b6f,_0x537765);})[_0xb834('0x1f')](function(_0x333c53){if(_0x333c53&&_0x333c53[_0xb834('0x1a')]){return _0x520b6f['VoiceExtension']['bulkCreate'](_0x333c53);}})[_0xb834('0x1f')](function(){_0xc5bb59();})[_0xb834('0x20')](function(_0x5f5b67){_0xc5bb59(_0x5f5b67);});},'afterDestroy':function(_0x546169,_0x21d774,_0x43f845){return _0x520b6f[_0xb834('0x24')][_0xb834('0x26')]({'where':{'ChanSpyId':_0x546169['id']}})[_0xb834('0x1f')](function(){_0x43f845();})[_0xb834('0x20')](function(_0x1f06e1){_0x43f845(_0x1f06e1);});}}});}; \ No newline at end of file +var _0x6ee5=['bulkCreate','lodash','bluebird','from-sip','format','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','SIP/%s,%s','name','options','StopMixMonitor','length','concat','internal','User','findAll','agent','then','exports','VoiceChanSpy','voice_chanspy','VoiceExtension','catch','destroy'];(function(_0x4522e0,_0x540b4b){var _0x482ecc=function(_0x237a88){while(--_0x237a88){_0x4522e0['push'](_0x4522e0['shift']());}};_0x482ecc(++_0x540b4b);}(_0x6ee5,0xb5));var _0x56ee=function(_0xd67f2,_0x323e58){_0xd67f2=_0xd67f2-0x0;var _0x4230b1=_0x6ee5[_0xd67f2];return _0x4230b1;};'use strict';var _=require(_0x56ee('0x0'));var util=require('util');var BPromise=require(_0x56ee('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x19a174,_0x5a6e4e,_0x457f1d){var _0x5d233b=0x1;var _0x3d19f8=[];var _0x8890c7={'context':_0x5a6e4e['context']||_0x56ee('0x2'),'exten':util[_0x56ee('0x3')]('%s%s',_0x19a174[_0x56ee('0x4')],_0x457f1d),'type':_0x56ee('0x5'),'isApp':![],'ChanSpyId':_0x19a174['id'],'UserId':_0x5a6e4e['id']};_0x3d19f8[_0x56ee('0x6')](_[_0x56ee('0x7')]({'app':_0x56ee('0x8'),'appdata':util['format'](_0x56ee('0x9'),_0x56ee('0xa')),'priority':_0x5d233b++},_0x8890c7));if(_0x19a174[_0x56ee('0xb')]){_0x3d19f8['push'](_[_0x56ee('0x7')]({'app':_0x56ee('0xc'),'appdata':util[_0x56ee('0x3')](_0x56ee('0xd'),_0x19a174[_0x56ee('0xe')]),'priority':_0x5d233b++},_0x8890c7));}if(_0x19a174[_0x56ee('0xf')]){_0x3d19f8[_0x56ee('0x6')](_[_0x56ee('0x7')]({'app':_0x56ee('0x10'),'appdata':_0x19a174[_0x56ee('0x11')],'priority':_0x5d233b++},_0x8890c7));}_0x3d19f8[_0x56ee('0x6')](_['merge']({'app':'ChanSpy','appdata':util['format'](_0x56ee('0x12'),_0x5a6e4e[_0x56ee('0x13')],_0x19a174[_0x56ee('0x14')]?_0x19a174[_0x56ee('0x14')]['join'](''):''),'priority':_0x5d233b++},_0x8890c7));if(_0x19a174['record']){_0x3d19f8[_0x56ee('0x6')](_[_0x56ee('0x7')]({'app':_0x56ee('0x15'),'priority':_0x5d233b++},_0x8890c7));}return _0x3d19f8;};var getChanSpyApplications=function(_0x33eb59,_0x180991){var _0x460728=[];for(var _0x53c23c=0x0,_0x247594=0x1;_0x53c23c<_0x180991[_0x56ee('0x16')];_0x53c23c++,_0x247594=0x1){_0x460728=_0x460728[_0x56ee('0x17')](getUserApplications(_0x33eb59,_0x180991[_0x53c23c],_0x180991[_0x53c23c][_0x56ee('0x18')]));if(_0x180991[_0x53c23c][_0x56ee('0x18')]!=_0x180991[_0x53c23c][_0x56ee('0x13')]){_0x460728=_0x460728['concat'](getUserApplications(_0x33eb59,_0x180991[_0x53c23c],_0x180991[_0x53c23c][_0x56ee('0x13')]));}}return _0x460728;};var getChanSpyPromise=function(_0x54af4e,_0x35f6a3){return new BPromise(function(_0x244cf6,_0x3c7858){return _0x54af4e[_0x56ee('0x19')][_0x56ee('0x1a')]({'attributes':['id',_0x56ee('0x13'),'internal'],'where':{'role':_0x56ee('0x1b'),'chanspy':!![]},'raw':!![]})[_0x56ee('0x1c')](function(_0x56f16f){if(_0x56f16f){return _0x244cf6(getChanSpyApplications(_0x35f6a3,_0x56f16f));}return _0x244cf6([]);})['catch'](function(_0x27c765){_0x3c7858(_0x27c765);});});};module[_0x56ee('0x1d')]=function(_0xf416c,_0x414a25){var _0x19eaf8=_0xf416c['models'];return _0xf416c['define'](_0x56ee('0x1e'),attributes,{'tableName':_0x56ee('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x567369,_0x171a14,_0x12ac8a){return getChanSpyPromise(_0x19eaf8,_0x567369)[_0x56ee('0x1c')](function(_0x47c092){if(_0x47c092&&_0x47c092[_0x56ee('0x16')]){return _0x19eaf8[_0x56ee('0x20')]['bulkCreate'](_0x47c092);}})[_0x56ee('0x1c')](function(){_0x12ac8a();})[_0x56ee('0x21')](function(_0x67c0b7){_0x12ac8a(_0x67c0b7);});},'afterUpdate':function(_0x508aea,_0x1c219e,_0x21fcdb){return _0x19eaf8[_0x56ee('0x20')][_0x56ee('0x22')]({'where':{'ChanSpyId':_0x508aea['id']}})[_0x56ee('0x1c')](function(){return getChanSpyPromise(_0x19eaf8,_0x508aea);})[_0x56ee('0x1c')](function(_0x2f2ed3){if(_0x2f2ed3&&_0x2f2ed3['length']){return _0x19eaf8[_0x56ee('0x20')][_0x56ee('0x23')](_0x2f2ed3);}})['then'](function(){_0x21fcdb();})[_0x56ee('0x21')](function(_0x3e6661){_0x21fcdb(_0x3e6661);});},'afterDestroy':function(_0x446bac,_0x4a3fa6,_0x554f9d){return _0x19eaf8[_0x56ee('0x20')][_0x56ee('0x22')]({'where':{'ChanSpyId':_0x446bac['id']}})[_0x56ee('0x1c')](function(){_0x554f9d();})['catch'](function(_0x4a2331){_0x554f9d(_0x4a2331);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 84b84dc..fe42ddd 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 _0x1152=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x17602f,_0x472ede){var _0x4adb25=function(_0x1636d1){while(--_0x1636d1){_0x17602f['push'](_0x17602f['shift']());}};_0x4adb25(++_0x472ede);}(_0x1152,0x182));var _0x2115=function(_0xb03f9,_0x588391){_0xb03f9=_0xb03f9-0x0;var _0x3ec30a=_0x1152[_0xb03f9];return _0x3ec30a;};'use strict';var _=require(_0x2115('0x0'));var util=require(_0x2115('0x1'));var moment=require(_0x2115('0x2'));var BPromise=require(_0x2115('0x3'));var rs=require(_0x2115('0x4'));var fs=require('fs');var Redis=require(_0x2115('0x5'));var db=require(_0x2115('0x6'))['db'];var utils=require(_0x2115('0x7'));var logger=require('../../config/logger')(_0x2115('0x8'));var config=require('../../config/environment');var jayson=require(_0x2115('0x9'));var client=jayson[_0x2115('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x564071,_0x54cdd0,_0x5dbb85){return new BPromise(function(_0x5df6db,_0x158711){return client[_0x2115('0xb')](_0x564071,_0x5dbb85)[_0x2115('0xc')](function(_0x5156f2){logger[_0x2115('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x54cdd0,'request\x20sent');logger[_0x2115('0xe')](_0x2115('0xf'),_0x54cdd0,_0x2115('0x10'),JSON['stringify'](_0x5156f2));if(_0x5156f2[_0x2115('0x11')]){if(_0x5156f2['error'][_0x2115('0x12')]===0x1f4){logger[_0x2115('0x11')](_0x2115('0x13'),_0x54cdd0,_0x5156f2[_0x2115('0x11')][_0x2115('0x14')]);return _0x158711(_0x5156f2['error'][_0x2115('0x14')]);}logger['error'](_0x2115('0x13'),_0x54cdd0,_0x5156f2[_0x2115('0x11')][_0x2115('0x14')]);return _0x5df6db(_0x5156f2[_0x2115('0x11')][_0x2115('0x14')]);}else{logger[_0x2115('0xd')](_0x2115('0x13'),_0x54cdd0,'request\x20sent');_0x5df6db(_0x5156f2[_0x2115('0x15')][_0x2115('0x14')]);}})[_0x2115('0x16')](function(_0x184c05){logger[_0x2115('0x11')](_0x2115('0x13'),_0x54cdd0,_0x184c05);_0x158711(_0x184c05);});});} \ No newline at end of file +var _0x878f=['../../config/logger','rpc','../../config/environment','jayson/promise','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x12c664,_0x25c58e){var _0x30961a=function(_0xa9576f){while(--_0xa9576f){_0x12c664['push'](_0x12c664['shift']());}};_0x30961a(++_0x25c58e);}(_0x878f,0x173));var _0xf878=function(_0x246f81,_0x2aaea8){_0x246f81=_0x246f81-0x0;var _0x285dc0=_0x878f[_0x246f81];return _0x285dc0;};'use strict';var _=require('lodash');var util=require(_0xf878('0x0'));var moment=require(_0xf878('0x1'));var BPromise=require(_0xf878('0x2'));var rs=require(_0xf878('0x3'));var fs=require('fs');var Redis=require(_0xf878('0x4'));var db=require(_0xf878('0x5'))['db'];var utils=require(_0xf878('0x6'));var logger=require(_0xf878('0x7'))(_0xf878('0x8'));var config=require(_0xf878('0x9'));var jayson=require(_0xf878('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c5f5c,_0x62b420,_0x59e564){return new BPromise(function(_0x52851e,_0x530767){return client[_0xf878('0xb')](_0x3c5f5c,_0x59e564)['then'](function(_0x4a9d79){logger[_0xf878('0xc')](_0xf878('0xd'),_0x62b420,_0xf878('0xe'));logger['debug'](_0xf878('0xf'),_0x62b420,_0xf878('0xe'),JSON['stringify'](_0x4a9d79));if(_0x4a9d79[_0xf878('0x10')]){if(_0x4a9d79['error'][_0xf878('0x11')]===0x1f4){logger[_0xf878('0x10')](_0xf878('0xd'),_0x62b420,_0x4a9d79['error'][_0xf878('0x12')]);return _0x530767(_0x4a9d79[_0xf878('0x10')][_0xf878('0x12')]);}logger['error'](_0xf878('0xd'),_0x62b420,_0x4a9d79[_0xf878('0x10')][_0xf878('0x12')]);return _0x52851e(_0x4a9d79['error']['message']);}else{logger[_0xf878('0xc')](_0xf878('0xd'),_0x62b420,_0xf878('0xe'));_0x52851e(_0x4a9d79[_0xf878('0x13')][_0xf878('0x12')]);}})[_0xf878('0x14')](function(_0x415056){logger[_0xf878('0x10')](_0xf878('0xd'),_0x62b420,_0x415056);_0x530767(_0x415056);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 133f322..a7ff310 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 _0x10a9=['destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./voiceContext.controller','get','isAuthenticated','/:id','show','post','put','update','delete'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x10a9,0x111));var _0x910a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x10a9[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x910a('0x0'));var util=require(_0x910a('0x1'));var path=require(_0x910a('0x2'));var timeout=require(_0x910a('0x3'));var express=require('express');var router=express[_0x910a('0x4')]();var fs_extra=require(_0x910a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x910a('0x6'));var config=require('../../config/environment');var controller=require(_0x910a('0x7'));router[_0x910a('0x8')]('/',auth[_0x910a('0x9')](),controller['index']);router['get'](_0x910a('0xa'),auth['isAuthenticated'](),controller[_0x910a('0xb')]);router[_0x910a('0xc')]('/',auth[_0x910a('0x9')](),controller['create']);router[_0x910a('0xd')](_0x910a('0xa'),auth[_0x910a('0x9')](),controller[_0x910a('0xe')]);router[_0x910a('0xf')]('/:id',auth[_0x910a('0x9')](),controller[_0x910a('0x10')]);module['exports']=router; \ No newline at end of file +var _0x5088=['exports','util','path','Router','../../components/auth/service','get','/:id','isAuthenticated','show','create','put','delete','destroy'];(function(_0x2831d3,_0x2b10fc){var _0x331ca7=function(_0x5df5f2){while(--_0x5df5f2){_0x2831d3['push'](_0x2831d3['shift']());}};_0x331ca7(++_0x2b10fc);}(_0x5088,0x76));var _0x8508=function(_0x531607,_0x73fa88){_0x531607=_0x531607-0x0;var _0x1b1fbb=_0x5088[_0x531607];return _0x1b1fbb;};'use strict';var multer=require('multer');var util=require(_0x8508('0x0'));var path=require(_0x8508('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8508('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x8508('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceContext.controller');router[_0x8508('0x4')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8508('0x4')](_0x8508('0x5'),auth[_0x8508('0x6')](),controller[_0x8508('0x7')]);router['post']('/',auth[_0x8508('0x6')](),controller[_0x8508('0x8')]);router[_0x8508('0x9')](_0x8508('0x5'),auth[_0x8508('0x6')](),controller['update']);router[_0x8508('0xa')](_0x8508('0x5'),auth[_0x8508('0x6')](),controller[_0x8508('0xb')]);module[_0x8508('0xc')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 243bdbd..5874223 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 _0xf386=['name','exports'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0xf386,0x105));var _0x6f38=function(_0x54ab1a,_0x46dfed){_0x54ab1a=_0x54ab1a-0x0;var _0xb5fd3d=_0xf386[_0x54ab1a];return _0xb5fd3d;};'use strict';var Sequelize=require('sequelize');module[_0x6f38('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x6f38('0x1')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xc3bd=['sequelize','exports','STRING','BOOLEAN'];(function(_0xb31f66,_0x2a0fa4){var _0x9634b0=function(_0x11d6ae){while(--_0x11d6ae){_0xb31f66['push'](_0xb31f66['shift']());}};_0x9634b0(++_0x2a0fa4);}(_0xc3bd,0xe4));var _0xdc3b=function(_0x245c23,_0x1d7066){_0x245c23=_0x245c23-0x0;var _0x3b1bb1=_0xc3bd[_0x245c23];return _0x3b1bb1;};'use strict';var Sequelize=require(_0xdc3b('0x0'));module[_0xdc3b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0xdc3b('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xdc3b('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 1acc513..a936c55 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 _0x1d3b=['apply','update','destroy','UserProfileResource','sendStatus','name','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','fields','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Contexts','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','render','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','then','info','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','VoiceContext,\x20%s,\x20%s','message','catch','status','end','json','offset','undefined','limit','count'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0x1d3b,0x15b));var _0xb1d3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1d3b[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xb1d3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb1d3('0x1'));var jsonpatch=require(_0xb1d3('0x2'));var rp=require(_0xb1d3('0x3'));var moment=require('moment');var BPromise=require(_0xb1d3('0x4'));var Mustache=require('mustache');var util=require(_0xb1d3('0x5'));var path=require('path');var sox=require(_0xb1d3('0x6'));var csv=require(_0xb1d3('0x7'));var ejs=require(_0xb1d3('0x8'));var fs=require('fs');var fs_extra=require(_0xb1d3('0x9'));var _=require(_0xb1d3('0xa'));var squel=require(_0xb1d3('0xb'));var crypto=require(_0xb1d3('0xc'));var jsforce=require(_0xb1d3('0xd'));var deskjs=require(_0xb1d3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb1d3('0xf'));var Papa=require(_0xb1d3('0x10'));var Redis=require(_0xb1d3('0x11'));var authService=require(_0xb1d3('0x12'));var qs=require(_0xb1d3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb1d3('0x14'))('api');var utils=require(_0xb1d3('0x15'));var config=require(_0xb1d3('0x16'));var licenseUtil=require(_0xb1d3('0x17'));var db=require(_0xb1d3('0x18'))['db'];var jayson=require(_0xb1d3('0x19'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5bebad,_0x40fe3e,_0x180fc5,_0x59d652){return new BPromise(function(_0x278cd1,_0x3e4b27){var _0x2069c0=_0x59d652||client;return _0x2069c0['request'](_0x5bebad,_0x180fc5)[_0xb1d3('0x1a')](function(_0x1da677){logger[_0xb1d3('0x1b')]('VoiceContext,\x20%s,\x20%s',_0x40fe3e,'request\x20sent');logger['debug'](_0xb1d3('0x1c'),_0x40fe3e,'request\x20sent',JSON[_0xb1d3('0x1d')](_0x1da677));if(_0x1da677['error']){if(_0x1da677[_0xb1d3('0x1e')]['code']===0x1f4){logger[_0xb1d3('0x1e')](_0xb1d3('0x1f'),_0x40fe3e,_0x1da677['error'][_0xb1d3('0x20')]);return _0x3e4b27(_0x1da677[_0xb1d3('0x1e')][_0xb1d3('0x20')]);}logger['error'](_0xb1d3('0x1f'),_0x40fe3e,_0x1da677[_0xb1d3('0x1e')][_0xb1d3('0x20')]);return _0x278cd1(_0x1da677[_0xb1d3('0x1e')][_0xb1d3('0x20')]);}else{logger[_0xb1d3('0x1b')]('VoiceContext,\x20%s,\x20%s',_0x40fe3e,'request\x20sent');_0x278cd1(_0x1da677['result'][_0xb1d3('0x20')]);}})[_0xb1d3('0x21')](function(_0x5d41e2){logger[_0xb1d3('0x1e')](_0xb1d3('0x1f'),_0x40fe3e,_0x5d41e2);_0x3e4b27(_0x5d41e2);});});}function respondWithStatusCode(_0x22fea6,_0x296f97){_0x296f97=_0x296f97||0xcc;return function(_0x148beb){if(_0x148beb){return _0x22fea6['sendStatus'](_0x296f97);}return _0x22fea6[_0xb1d3('0x22')](_0x296f97)[_0xb1d3('0x23')]();};}function respondWithResult(_0x53db59,_0x2c967e){_0x2c967e=_0x2c967e||0xc8;return function(_0xa3bc93){if(_0xa3bc93){return _0x53db59['status'](_0x2c967e)[_0xb1d3('0x24')](_0xa3bc93);}};}function respondWithFilteredResult(_0x1c3a02,_0x1e0734){return function(_0x162901){if(_0x162901){var _0x4402f0=typeof _0x1e0734[_0xb1d3('0x25')]===_0xb1d3('0x26')&&typeof _0x1e0734[_0xb1d3('0x27')]==='undefined';var _0x8d1fc1=_0x162901[_0xb1d3('0x28')];var _0x4a45d9=_0x4402f0?0x0:_0x1e0734[_0xb1d3('0x25')];var _0x4e5779=_0x4402f0?_0x162901[_0xb1d3('0x28')]:_0x1e0734[_0xb1d3('0x25')]+_0x1e0734[_0xb1d3('0x27')];var _0x7f9b3c;if(_0x4e5779>=_0x8d1fc1){_0x4e5779=_0x8d1fc1;_0x7f9b3c=0xc8;}else{_0x7f9b3c=0xce;}_0x1c3a02['status'](_0x7f9b3c);return _0x1c3a02['set']('Content-Range',_0x4a45d9+'-'+_0x4e5779+'/'+_0x8d1fc1)[_0xb1d3('0x24')](_0x162901);}return null;};}function patchUpdates(_0x477c61){return function(_0x41d273){try{jsonpatch[_0xb1d3('0x29')](_0x41d273,_0x477c61,!![]);}catch(_0x405d14){return BPromise['reject'](_0x405d14);}return _0x41d273['save']();};}function saveUpdates(_0x3b511b,_0x45ca7c){return function(_0x598349){if(_0x598349){return _0x598349[_0xb1d3('0x2a')](_0x3b511b)[_0xb1d3('0x1a')](function(_0x53c6d5){return _0x53c6d5;});}return null;};}function removeEntity(_0x7db5c4,_0x583c1e){return function(_0x3477d5){if(_0x3477d5){return _0x3477d5[_0xb1d3('0x2b')]()[_0xb1d3('0x1a')](function(){var _0x1b794d=_0x3477d5['get']({'plain':!![]});var _0xf04435='Contexts';return db[_0xb1d3('0x2c')][_0xb1d3('0x2b')]({'where':{'type':_0xf04435,'resourceId':_0x1b794d['id']}})[_0xb1d3('0x1a')](function(){return _0x3477d5;});})[_0xb1d3('0x1a')](function(){_0x7db5c4[_0xb1d3('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4285fa,_0x47daed){return function(_0x75516){if(!_0x75516){_0x4285fa[_0xb1d3('0x2d')](0x194);}return _0x75516;};}function handleError(_0x22c5f0,_0x1f9a46){_0x1f9a46=_0x1f9a46||0x1f4;return function(_0x402537){logger[_0xb1d3('0x1e')](_0x402537['stack']);if(_0x402537[_0xb1d3('0x2e')]){delete _0x402537['name'];}_0x22c5f0[_0xb1d3('0x22')](_0x1f9a46)['send'](_0x402537);};}exports['index']=function(_0x15cdc6,_0x536d4c){var _0xdbf484={},_0x3bfb60={},_0x14c849={'count':0x0,'rows':[]};var _0x1c46ed=_[_0xb1d3('0x2f')](db[_0xb1d3('0x30')][_0xb1d3('0x31')],function(_0x40eeb9){return{'name':_0x40eeb9[_0xb1d3('0x32')],'type':_0x40eeb9[_0xb1d3('0x33')][_0xb1d3('0x34')]};});_0x3bfb60[_0xb1d3('0x35')]=_[_0xb1d3('0x2f')](_0x1c46ed,_0xb1d3('0x2e'));_0x3bfb60[_0xb1d3('0x36')]=_[_0xb1d3('0x37')](_0x15cdc6[_0xb1d3('0x36')]);_0x3bfb60[_0xb1d3('0x38')]=_['intersection'](_0x3bfb60[_0xb1d3('0x35')],_0x3bfb60[_0xb1d3('0x36')]);_0xdbf484[_0xb1d3('0x39')]=_[_0xb1d3('0x3a')](_0x3bfb60[_0xb1d3('0x35')],qs['fields'](_0x15cdc6['query']['fields']));_0xdbf484['attributes']=_0xdbf484[_0xb1d3('0x39')][_0xb1d3('0x3b')]?_0xdbf484[_0xb1d3('0x39')]:_0x3bfb60[_0xb1d3('0x35')];if(!_0x15cdc6[_0xb1d3('0x36')][_0xb1d3('0x3c')](_0xb1d3('0x3d'))){_0xdbf484[_0xb1d3('0x27')]=qs[_0xb1d3('0x27')](_0x15cdc6[_0xb1d3('0x36')]['limit']);_0xdbf484[_0xb1d3('0x25')]=qs['offset'](_0x15cdc6[_0xb1d3('0x36')][_0xb1d3('0x25')]);}_0xdbf484[_0xb1d3('0x3e')]=qs[_0xb1d3('0x3f')](_0x15cdc6['query'][_0xb1d3('0x3f')]);_0xdbf484[_0xb1d3('0x40')]=qs[_0xb1d3('0x38')](_[_0xb1d3('0x41')](_0x15cdc6['query'],_0x3bfb60['filters']),_0x1c46ed);if(_0x15cdc6[_0xb1d3('0x36')][_0xb1d3('0x42')]){_0xdbf484[_0xb1d3('0x40')]=_[_0xb1d3('0x43')](_0xdbf484[_0xb1d3('0x40')],{'$or':_['map'](_0x1c46ed,function(_0x1dcbaf){if(_0x1dcbaf[_0xb1d3('0x33')]!==_0xb1d3('0x44')){var _0x30214e={};_0x30214e[_0x1dcbaf[_0xb1d3('0x2e')]]={'$like':'%'+_0x15cdc6[_0xb1d3('0x36')]['filter']+'%'};return _0x30214e;}})});}_0xdbf484=_[_0xb1d3('0x43')]({},_0xdbf484,_0x15cdc6[_0xb1d3('0x45')]);var _0x4fec33={'where':_0xdbf484[_0xb1d3('0x40')]};return db[_0xb1d3('0x30')]['count'](_0x4fec33)[_0xb1d3('0x1a')](function(_0x71ee79){_0x14c849['count']=_0x71ee79;if(_0x15cdc6['query'][_0xb1d3('0x46')]){_0xdbf484[_0xb1d3('0x47')]=[{'all':!![]}];}return db['VoiceContext'][_0xb1d3('0x48')](_0xdbf484);})[_0xb1d3('0x1a')](function(_0x2aee46){_0x14c849[_0xb1d3('0x49')]=_0x2aee46;return _0x14c849;})['then'](respondWithFilteredResult(_0x536d4c,_0xdbf484))[_0xb1d3('0x21')](handleError(_0x536d4c,null));};exports[_0xb1d3('0x4a')]=function(_0x528f51,_0x342476){var _0x46f82e={'raw':![],'where':{'id':_0x528f51[_0xb1d3('0x4b')]['id']}},_0x320fb8={};_0x320fb8[_0xb1d3('0x35')]=_[_0xb1d3('0x37')](db[_0xb1d3('0x30')][_0xb1d3('0x31')]);_0x320fb8[_0xb1d3('0x36')]=_[_0xb1d3('0x37')](_0x528f51[_0xb1d3('0x36')]);_0x320fb8[_0xb1d3('0x38')]=_[_0xb1d3('0x3a')](_0x320fb8[_0xb1d3('0x35')],_0x320fb8['query']);_0x46f82e['attributes']=_[_0xb1d3('0x3a')](_0x320fb8[_0xb1d3('0x35')],qs[_0xb1d3('0x4c')](_0x528f51[_0xb1d3('0x36')][_0xb1d3('0x4c')]));_0x46f82e[_0xb1d3('0x39')]=_0x46f82e['attributes'][_0xb1d3('0x3b')]?_0x46f82e[_0xb1d3('0x39')]:_0x320fb8[_0xb1d3('0x35')];if(_0x528f51[_0xb1d3('0x36')][_0xb1d3('0x46')]){_0x46f82e[_0xb1d3('0x47')]=[{'all':!![]}];}_0x46f82e=_[_0xb1d3('0x43')]({},_0x46f82e,_0x528f51[_0xb1d3('0x45')]);return db[_0xb1d3('0x30')][_0xb1d3('0x4d')](_0x46f82e)[_0xb1d3('0x1a')](handleEntityNotFound(_0x342476,null))[_0xb1d3('0x1a')](respondWithResult(_0x342476,null))[_0xb1d3('0x21')](handleError(_0x342476,null));};exports[_0xb1d3('0x4e')]=function(_0x39a803,_0x56edd6,_0x3cc5ca){var _0x3b0da7;return db[_0xb1d3('0x30')]['create'](_0x39a803[_0xb1d3('0x4f')],{'raw':!![]})[_0xb1d3('0x1a')](function(_0x22a639){_0x3b0da7=_0x22a639;return db[_0xb1d3('0x30')]['findAll']({'raw':!![]});})[_0xb1d3('0x1a')](function(_0x1d52cd){var _0x2e3ac9=fs[_0xb1d3('0x50')](path[_0xb1d3('0x51')](config[_0xb1d3('0x52')],_0xb1d3('0x53')),_0xb1d3('0x54'));var _0xa7ba55=ejs['render'](_0x2e3ac9,{'contexts':_0x1d52cd||[]});fs[_0xb1d3('0x55')](_0xb1d3('0x56'),_0xa7ba55);})[_0xb1d3('0x1a')](function(){return respondWithRpcPromise(_0xb1d3('0x57'),_0xb1d3('0x4e'),{'module':_0xb1d3('0x58')});})[_0xb1d3('0x1a')](function(){var _0x2b0904=_0x39a803[_0xb1d3('0x59')][_0xb1d3('0x5a')]({'plain':!![]});if(!_0x2b0904)throw new Error(_0xb1d3('0x5b'));if(_0x2b0904[_0xb1d3('0x5c')]==='user'){var _0x571fe0=_0x3b0da7[_0xb1d3('0x5a')]({'plain':!![]});return db['UserProfileSection'][_0xb1d3('0x4d')]({'where':{'name':_0xb1d3('0x5d'),'userProfileId':_0x2b0904[_0xb1d3('0x5e')]},'raw':!![]})[_0xb1d3('0x1a')](function(_0x5ddbe9){if(_0x5ddbe9&&_0x5ddbe9['autoAssociation']===0x0){return db[_0xb1d3('0x2c')][_0xb1d3('0x4e')]({'name':_0x571fe0['name'],'resourceId':_0x571fe0['id'],'type':_0x5ddbe9[_0xb1d3('0x2e')],'sectionId':_0x5ddbe9['id']},{})[_0xb1d3('0x1a')](function(){return _0x3b0da7;});}else{return _0x3b0da7;}})[_0xb1d3('0x21')](function(_0x45a86f){logger['error'](_0xb1d3('0x5f'),_0x45a86f);throw _0x45a86f;});}return _0x3b0da7;})[_0xb1d3('0x1a')](respondWithResult(_0x56edd6,0xc9))[_0xb1d3('0x21')](handleError(_0x56edd6,null));};exports[_0xb1d3('0x2a')]=function(_0x2d5e95,_0x117977,_0x5ddf75){var _0xf30577;return db[_0xb1d3('0x30')][_0xb1d3('0x4d')]({'where':{'id':_0x2d5e95[_0xb1d3('0x4b')]['id']}})[_0xb1d3('0x1a')](handleEntityNotFound(_0x117977,null))[_0xb1d3('0x1a')](saveUpdates(_0x2d5e95[_0xb1d3('0x4f')],null))[_0xb1d3('0x1a')](function(_0x147c6e){if(_0x147c6e){_0xf30577=_0x147c6e;return db['VoiceContext']['findAll']({'raw':!![]});}})[_0xb1d3('0x1a')](function(_0x58ab1e){var _0x38e419=fs[_0xb1d3('0x50')](path[_0xb1d3('0x51')](config[_0xb1d3('0x52')],_0xb1d3('0x53')),'utf8');var _0x165be8=ejs[_0xb1d3('0x60')](_0x38e419,{'contexts':_0x58ab1e||[]});fs[_0xb1d3('0x55')](_0xb1d3('0x56'),_0x165be8);})['then'](function(){return respondWithRpcPromise(_0xb1d3('0x57'),_0xb1d3('0x2a'),{'module':_0xb1d3('0x58')});})[_0xb1d3('0x1a')](function(){return _0xf30577;})[_0xb1d3('0x1a')](respondWithResult(_0x117977,null))['catch'](handleError(_0x117977,null));};exports[_0xb1d3('0x2b')]=function(_0x50e033,_0x5eb2c3,_0x31efa6){var _0x556db0;return db[_0xb1d3('0x30')][_0xb1d3('0x4d')]({'where':{'id':_0x50e033[_0xb1d3('0x4b')]['id']}})[_0xb1d3('0x1a')](handleEntityNotFound(_0x5eb2c3,null))['then'](removeEntity(_0x5eb2c3,null))[_0xb1d3('0x1a')](function(){return db['VoiceContext']['findAll']({'raw':!![]});})['then'](function(_0x136f31){var _0x1e3d69=fs['readFileSync'](path[_0xb1d3('0x51')](config[_0xb1d3('0x52')],_0xb1d3('0x53')),_0xb1d3('0x54'));var _0x253614=ejs[_0xb1d3('0x60')](_0x1e3d69,{'contexts':_0x136f31});fs[_0xb1d3('0x55')](_0xb1d3('0x56'),_0x253614);return respondWithRpcPromise('Reload','destroy',{'module':_0xb1d3('0x58')});})[_0xb1d3('0x21')](handleError(_0x5eb2c3,null));}; \ No newline at end of file +var _0x7256=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','root','join','eml-format','rimraf','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','sendStatus','status','end','limit','count','offset','set','Content-Range','json','apply','destroy','get','Contexts','UserProfileResource','stack','name','send','index','map','VoiceContext','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','show','params','merge','find','create','body','readFileSync','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x28edd9,_0x25d4c7){var _0x582a41=function(_0x307489){while(--_0x307489){_0x28edd9['push'](_0x28edd9['shift']());}};_0x582a41(++_0x25d4c7);}(_0x7256,0x6d));var _0x6725=function(_0x15f83a,_0x16c43c){_0x15f83a=_0x15f83a-0x0;var _0x3af215=_0x7256[_0x15f83a];return _0x3af215;};'use strict';var emlformat=require(_0x6725('0x0'));var rimraf=require(_0x6725('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6725('0x2'));var moment=require(_0x6725('0x3'));var BPromise=require(_0x6725('0x4'));var Mustache=require(_0x6725('0x5'));var util=require('util');var path=require('path');var sox=require(_0x6725('0x6'));var csv=require('to-csv');var ejs=require(_0x6725('0x7'));var fs=require('fs');var fs_extra=require(_0x6725('0x8'));var _=require('lodash');var squel=require(_0x6725('0x9'));var crypto=require('crypto');var jsforce=require(_0x6725('0xa'));var deskjs=require(_0x6725('0xb'));var toCsv=require(_0x6725('0xc'));var querystring=require(_0x6725('0xd'));var Papa=require('papaparse');var Redis=require(_0x6725('0xe'));var authService=require(_0x6725('0xf'));var qs=require(_0x6725('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6725('0x11'));var logger=require(_0x6725('0x12'))(_0x6725('0x13'));var utils=require('../../config/utils');var config=require(_0x6725('0x14'));var licenseUtil=require(_0x6725('0x15'));var db=require(_0x6725('0x16'))['db'];var jayson=require(_0x6725('0x17'));var client=jayson[_0x6725('0x18')][_0x6725('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x4d9b84,_0x5a9ad5,_0x2654f1,_0xbb3d00){return new BPromise(function(_0x54d67c,_0x158652){var _0x406398=_0xbb3d00||client;return _0x406398[_0x6725('0x1a')](_0x4d9b84,_0x2654f1)[_0x6725('0x1b')](function(_0x227535){logger['info'](_0x6725('0x1c'),_0x5a9ad5,'request\x20sent');logger[_0x6725('0x1d')](_0x6725('0x1e'),_0x5a9ad5,_0x6725('0x1f'),JSON['stringify'](_0x227535));if(_0x227535[_0x6725('0x20')]){if(_0x227535['error'][_0x6725('0x21')]===0x1f4){logger[_0x6725('0x20')](_0x6725('0x1c'),_0x5a9ad5,_0x227535[_0x6725('0x20')][_0x6725('0x22')]);return _0x158652(_0x227535[_0x6725('0x20')][_0x6725('0x22')]);}logger[_0x6725('0x20')]('VoiceContext,\x20%s,\x20%s',_0x5a9ad5,_0x227535['error'][_0x6725('0x22')]);return _0x54d67c(_0x227535[_0x6725('0x20')][_0x6725('0x22')]);}else{logger[_0x6725('0x23')](_0x6725('0x1c'),_0x5a9ad5,'request\x20sent');_0x54d67c(_0x227535[_0x6725('0x24')]['message']);}})[_0x6725('0x25')](function(_0x506ffa){logger[_0x6725('0x20')]('VoiceContext,\x20%s,\x20%s',_0x5a9ad5,_0x506ffa);_0x158652(_0x506ffa);});});}function respondWithStatusCode(_0x3edbd0,_0x45114a){_0x45114a=_0x45114a||0xcc;return function(_0x2bc99b){if(_0x2bc99b){return _0x3edbd0[_0x6725('0x26')](_0x45114a);}return _0x3edbd0[_0x6725('0x27')](_0x45114a)[_0x6725('0x28')]();};}function respondWithResult(_0x390d6c,_0x2cf071){_0x2cf071=_0x2cf071||0xc8;return function(_0xe37df4){if(_0xe37df4){return _0x390d6c[_0x6725('0x27')](_0x2cf071)['json'](_0xe37df4);}};}function respondWithFilteredResult(_0x2be500,_0x462052){return function(_0x15d136){if(_0x15d136){var _0x3e51e3=typeof _0x462052['offset']==='undefined'&&typeof _0x462052[_0x6725('0x29')]==='undefined';var _0x562779=_0x15d136[_0x6725('0x2a')];var _0x5ad43b=_0x3e51e3?0x0:_0x462052['offset'];var _0x2a0e13=_0x3e51e3?_0x15d136[_0x6725('0x2a')]:_0x462052[_0x6725('0x2b')]+_0x462052['limit'];var _0x4432a1;if(_0x2a0e13>=_0x562779){_0x2a0e13=_0x562779;_0x4432a1=0xc8;}else{_0x4432a1=0xce;}_0x2be500[_0x6725('0x27')](_0x4432a1);return _0x2be500[_0x6725('0x2c')](_0x6725('0x2d'),_0x5ad43b+'-'+_0x2a0e13+'/'+_0x562779)[_0x6725('0x2e')](_0x15d136);}return null;};}function patchUpdates(_0x1dce91){return function(_0x33675d){try{jsonpatch[_0x6725('0x2f')](_0x33675d,_0x1dce91,!![]);}catch(_0x3582e3){return BPromise['reject'](_0x3582e3);}return _0x33675d['save']();};}function saveUpdates(_0x4cd9df,_0x4aa0b6){return function(_0x53414e){if(_0x53414e){return _0x53414e['update'](_0x4cd9df)[_0x6725('0x1b')](function(_0x3ce4d0){return _0x3ce4d0;});}return null;};}function removeEntity(_0x374b1b,_0xbc8c64){return function(_0x486b97){if(_0x486b97){return _0x486b97[_0x6725('0x30')]()[_0x6725('0x1b')](function(){var _0x420713=_0x486b97[_0x6725('0x31')]({'plain':!![]});var _0x2ed50d=_0x6725('0x32');return db[_0x6725('0x33')][_0x6725('0x30')]({'where':{'type':_0x2ed50d,'resourceId':_0x420713['id']}})['then'](function(){return _0x486b97;});})['then'](function(){_0x374b1b[_0x6725('0x27')](0xcc)[_0x6725('0x28')]();});}};}function handleEntityNotFound(_0x95aee3,_0x1aa6be){return function(_0x588c18){if(!_0x588c18){_0x95aee3[_0x6725('0x26')](0x194);}return _0x588c18;};}function handleError(_0x55f82d,_0x27a060){_0x27a060=_0x27a060||0x1f4;return function(_0x5c23d2){logger[_0x6725('0x20')](_0x5c23d2[_0x6725('0x34')]);if(_0x5c23d2['name']){delete _0x5c23d2[_0x6725('0x35')];}_0x55f82d['status'](_0x27a060)[_0x6725('0x36')](_0x5c23d2);};}exports[_0x6725('0x37')]=function(_0x4c2d44,_0x3e3a6d){var _0x249671={},_0x375e45={},_0x1e9074={'count':0x0,'rows':[]};var _0x5af543=_[_0x6725('0x38')](db[_0x6725('0x39')][_0x6725('0x3a')],function(_0x224cbf){return{'name':_0x224cbf['fieldName'],'type':_0x224cbf[_0x6725('0x3b')]['key']};});_0x375e45[_0x6725('0x3c')]=_[_0x6725('0x38')](_0x5af543,_0x6725('0x35'));_0x375e45[_0x6725('0x3d')]=_[_0x6725('0x3e')](_0x4c2d44[_0x6725('0x3d')]);_0x375e45[_0x6725('0x3f')]=_['intersection'](_0x375e45['model'],_0x375e45[_0x6725('0x3d')]);_0x249671['attributes']=_[_0x6725('0x40')](_0x375e45[_0x6725('0x3c')],qs[_0x6725('0x41')](_0x4c2d44[_0x6725('0x3d')][_0x6725('0x41')]));_0x249671['attributes']=_0x249671[_0x6725('0x42')][_0x6725('0x43')]?_0x249671[_0x6725('0x42')]:_0x375e45[_0x6725('0x3c')];if(!_0x4c2d44[_0x6725('0x3d')][_0x6725('0x44')](_0x6725('0x45'))){_0x249671[_0x6725('0x29')]=qs['limit'](_0x4c2d44[_0x6725('0x3d')][_0x6725('0x29')]);_0x249671[_0x6725('0x2b')]=qs['offset'](_0x4c2d44[_0x6725('0x3d')][_0x6725('0x2b')]);}_0x249671[_0x6725('0x46')]=qs[_0x6725('0x47')](_0x4c2d44[_0x6725('0x3d')][_0x6725('0x47')]);_0x249671[_0x6725('0x48')]=qs['filters'](_[_0x6725('0x49')](_0x4c2d44[_0x6725('0x3d')],_0x375e45['filters']),_0x5af543);if(_0x4c2d44[_0x6725('0x3d')][_0x6725('0x4a')]){_0x249671[_0x6725('0x48')]=_['merge'](_0x249671[_0x6725('0x48')],{'$or':_[_0x6725('0x38')](_0x5af543,function(_0x4afc5f){if(_0x4afc5f[_0x6725('0x3b')]!==_0x6725('0x4b')){var _0x3be896={};_0x3be896[_0x4afc5f[_0x6725('0x35')]]={'$like':'%'+_0x4c2d44[_0x6725('0x3d')][_0x6725('0x4a')]+'%'};return _0x3be896;}})});}_0x249671=_['merge']({},_0x249671,_0x4c2d44[_0x6725('0x4c')]);var _0x53160f={'where':_0x249671[_0x6725('0x48')]};return db[_0x6725('0x39')][_0x6725('0x2a')](_0x53160f)[_0x6725('0x1b')](function(_0x54990c){_0x1e9074['count']=_0x54990c;if(_0x4c2d44['query']['includeAll']){_0x249671[_0x6725('0x4d')]=[{'all':!![]}];}return db[_0x6725('0x39')][_0x6725('0x4e')](_0x249671);})[_0x6725('0x1b')](function(_0x587aa2){_0x1e9074['rows']=_0x587aa2;return _0x1e9074;})[_0x6725('0x1b')](respondWithFilteredResult(_0x3e3a6d,_0x249671))[_0x6725('0x25')](handleError(_0x3e3a6d,null));};exports[_0x6725('0x4f')]=function(_0x3aea0b,_0x57f063){var _0x26bb60={'raw':![],'where':{'id':_0x3aea0b[_0x6725('0x50')]['id']}},_0x2eaf4b={};_0x2eaf4b['model']=_[_0x6725('0x3e')](db[_0x6725('0x39')][_0x6725('0x3a')]);_0x2eaf4b[_0x6725('0x3d')]=_[_0x6725('0x3e')](_0x3aea0b[_0x6725('0x3d')]);_0x2eaf4b[_0x6725('0x3f')]=_['intersection'](_0x2eaf4b['model'],_0x2eaf4b[_0x6725('0x3d')]);_0x26bb60[_0x6725('0x42')]=_[_0x6725('0x40')](_0x2eaf4b['model'],qs[_0x6725('0x41')](_0x3aea0b[_0x6725('0x3d')][_0x6725('0x41')]));_0x26bb60['attributes']=_0x26bb60[_0x6725('0x42')][_0x6725('0x43')]?_0x26bb60[_0x6725('0x42')]:_0x2eaf4b[_0x6725('0x3c')];if(_0x3aea0b[_0x6725('0x3d')]['includeAll']){_0x26bb60['include']=[{'all':!![]}];}_0x26bb60=_[_0x6725('0x51')]({},_0x26bb60,_0x3aea0b[_0x6725('0x4c')]);return db[_0x6725('0x39')][_0x6725('0x52')](_0x26bb60)[_0x6725('0x1b')](handleEntityNotFound(_0x57f063,null))[_0x6725('0x1b')](respondWithResult(_0x57f063,null))['catch'](handleError(_0x57f063,null));};exports[_0x6725('0x53')]=function(_0x477627,_0x14f5f1,_0x2a9800){var _0x335757;return db[_0x6725('0x39')][_0x6725('0x53')](_0x477627[_0x6725('0x54')],{'raw':!![]})[_0x6725('0x1b')](function(_0x4a7267){_0x335757=_0x4a7267;return db[_0x6725('0x39')][_0x6725('0x4e')]({'raw':!![]});})[_0x6725('0x1b')](function(_0x3224af){var _0x50fa0f=fs[_0x6725('0x55')](path['join'](config['root'],_0x6725('0x56')),_0x6725('0x57'));var _0x193d4d=ejs[_0x6725('0x58')](_0x50fa0f,{'contexts':_0x3224af||[]});fs[_0x6725('0x59')](_0x6725('0x5a'),_0x193d4d);})['then'](function(){return respondWithRpcPromise(_0x6725('0x5b'),'create',{'module':_0x6725('0x5c')});})[_0x6725('0x1b')](function(){var _0x194d46=_0x477627[_0x6725('0x5d')][_0x6725('0x31')]({'plain':!![]});if(!_0x194d46)throw new Error(_0x6725('0x5e'));if(_0x194d46[_0x6725('0x5f')]==='user'){var _0x1464a7=_0x335757[_0x6725('0x31')]({'plain':!![]});return db[_0x6725('0x60')][_0x6725('0x52')]({'where':{'name':_0x6725('0x32'),'userProfileId':_0x194d46[_0x6725('0x61')]},'raw':!![]})[_0x6725('0x1b')](function(_0x4b2771){if(_0x4b2771&&_0x4b2771[_0x6725('0x62')]===0x0){return db[_0x6725('0x33')][_0x6725('0x53')]({'name':_0x1464a7[_0x6725('0x35')],'resourceId':_0x1464a7['id'],'type':_0x4b2771[_0x6725('0x35')],'sectionId':_0x4b2771['id']},{})[_0x6725('0x1b')](function(){return _0x335757;});}else{return _0x335757;}})['catch'](function(_0x105531){logger[_0x6725('0x20')](_0x6725('0x63'),_0x105531);throw _0x105531;});}return _0x335757;})[_0x6725('0x1b')](respondWithResult(_0x14f5f1,0xc9))['catch'](handleError(_0x14f5f1,null));};exports[_0x6725('0x64')]=function(_0x44f4f0,_0x4b8d78,_0x226817){var _0x10b8ee;return db[_0x6725('0x39')][_0x6725('0x52')]({'where':{'id':_0x44f4f0[_0x6725('0x50')]['id']}})[_0x6725('0x1b')](handleEntityNotFound(_0x4b8d78,null))['then'](saveUpdates(_0x44f4f0[_0x6725('0x54')],null))[_0x6725('0x1b')](function(_0x4dfa37){if(_0x4dfa37){_0x10b8ee=_0x4dfa37;return db['VoiceContext']['findAll']({'raw':!![]});}})[_0x6725('0x1b')](function(_0x4fdda8){var _0x280e9b=fs['readFileSync'](path['join'](config[_0x6725('0x65')],_0x6725('0x56')),_0x6725('0x57'));var _0x24c285=ejs[_0x6725('0x58')](_0x280e9b,{'contexts':_0x4fdda8||[]});fs[_0x6725('0x59')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x24c285);})[_0x6725('0x1b')](function(){return respondWithRpcPromise(_0x6725('0x5b'),'update',{'module':_0x6725('0x5c')});})[_0x6725('0x1b')](function(){return _0x10b8ee;})[_0x6725('0x1b')](respondWithResult(_0x4b8d78,null))[_0x6725('0x25')](handleError(_0x4b8d78,null));};exports[_0x6725('0x30')]=function(_0x3c77ac,_0x54673a,_0x56b012){var _0x209672;return db['VoiceContext'][_0x6725('0x52')]({'where':{'id':_0x3c77ac[_0x6725('0x50')]['id']}})['then'](handleEntityNotFound(_0x54673a,null))[_0x6725('0x1b')](removeEntity(_0x54673a,null))[_0x6725('0x1b')](function(){return db[_0x6725('0x39')][_0x6725('0x4e')]({'raw':!![]});})['then'](function(_0x3bb5ed){var _0xd67ebd=fs[_0x6725('0x55')](path[_0x6725('0x66')](config[_0x6725('0x65')],_0x6725('0x56')),'utf8');var _0x4eca69=ejs[_0x6725('0x58')](_0xd67ebd,{'contexts':_0x3bb5ed});fs[_0x6725('0x59')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x4eca69);return respondWithRpcPromise('Reload',_0x6725('0x30'),{'module':_0x6725('0x5c')});})[_0x6725('0x25')](handleError(_0x54673a,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 01080a5..cda438d 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 _0xd7cc=['VoiceContext','voice_contexts','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x526f6f,_0x227427){var _0x55ad64=function(_0x26e621){while(--_0x26e621){_0x526f6f['push'](_0x526f6f['shift']());}};_0x55ad64(++_0x227427);}(_0xd7cc,0x9c));var _0xcd7c=function(_0x2942ea,_0x51d408){_0x2942ea=_0x2942ea-0x0;var _0x4429cb=_0xd7cc[_0x2942ea];return _0x4429cb;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xcd7c('0x0'));var moment=require(_0xcd7c('0x1'));var BPromise=require(_0xcd7c('0x2'));var rp=require(_0xcd7c('0x3'));var fs=require('fs');var path=require(_0xcd7c('0x4'));var rimraf=require(_0xcd7c('0x5'));var config=require(_0xcd7c('0x6'));var attributes=require('./voiceContext.attributes');module[_0xcd7c('0x7')]=function(_0x303bbf,_0x599dab){return _0x303bbf[_0xcd7c('0x8')](_0xcd7c('0x9'),attributes,{'tableName':_0xcd7c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0215=['bluebird','request-promise','path','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','util','../../config/logger','api','moment'];(function(_0x1f878e,_0x13047){var _0x59f9ba=function(_0x2e8b32){while(--_0x2e8b32){_0x1f878e['push'](_0x1f878e['shift']());}};_0x59f9ba(++_0x13047);}(_0x0215,0x140));var _0x5021=function(_0x2b45b5,_0x474458){_0x2b45b5=_0x2b45b5-0x0;var _0x1d9c06=_0x0215[_0x2b45b5];return _0x1d9c06;};'use strict';var _=require('lodash');var util=require(_0x5021('0x0'));var logger=require(_0x5021('0x1'))(_0x5021('0x2'));var moment=require(_0x5021('0x3'));var BPromise=require(_0x5021('0x4'));var rp=require(_0x5021('0x5'));var fs=require('fs');var path=require(_0x5021('0x6'));var rimraf=require('rimraf');var config=require(_0x5021('0x7'));var attributes=require(_0x5021('0x8'));module[_0x5021('0x9')]=function(_0xe04415,_0x3d2bd5){return _0xe04415[_0x5021('0xa')](_0x5021('0xb'),attributes,{'tableName':'voice_contexts','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 07d9063..c53f7ea 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 _0x7a4f=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a4f,0x17a));var _0xf7a4=function(_0x1090f8,_0xd83a11){_0x1090f8=_0x1090f8-0x0;var _0x180524=_0x7a4f[_0x1090f8];return _0x180524;};'use strict';var _=require('lodash');var util=require(_0xf7a4('0x0'));var moment=require(_0xf7a4('0x1'));var BPromise=require('bluebird');var rs=require(_0xf7a4('0x2'));var fs=require('fs');var Redis=require(_0xf7a4('0x3'));var db=require(_0xf7a4('0x4'))['db'];var utils=require(_0xf7a4('0x5'));var logger=require('../../config/logger')(_0xf7a4('0x6'));var config=require('../../config/environment');var jayson=require(_0xf7a4('0x7'));var client=jayson[_0xf7a4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28e789,_0x281e16,_0x1b919c){return new BPromise(function(_0x18e386,_0x166bdd){return client[_0xf7a4('0x9')](_0x28e789,_0x1b919c)[_0xf7a4('0xa')](function(_0x42dfb3){logger[_0xf7a4('0xb')](_0xf7a4('0xc'),_0x281e16,_0xf7a4('0xd'));logger[_0xf7a4('0xe')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x281e16,_0xf7a4('0xd'),JSON[_0xf7a4('0xf')](_0x42dfb3));if(_0x42dfb3['error']){if(_0x42dfb3[_0xf7a4('0x10')][_0xf7a4('0x11')]===0x1f4){logger['error'](_0xf7a4('0xc'),_0x281e16,_0x42dfb3[_0xf7a4('0x10')][_0xf7a4('0x12')]);return _0x166bdd(_0x42dfb3[_0xf7a4('0x10')][_0xf7a4('0x12')]);}logger[_0xf7a4('0x10')](_0xf7a4('0xc'),_0x281e16,_0x42dfb3[_0xf7a4('0x10')][_0xf7a4('0x12')]);return _0x18e386(_0x42dfb3['error'][_0xf7a4('0x12')]);}else{logger[_0xf7a4('0xb')]('VoiceContext,\x20%s,\x20%s',_0x281e16,_0xf7a4('0xd'));_0x18e386(_0x42dfb3['result'][_0xf7a4('0x12')]);}})[_0xf7a4('0x13')](function(_0x53faae){logger['error'](_0xf7a4('0xc'),_0x281e16,_0x53faae);_0x166bdd(_0x53faae);});});} \ No newline at end of file +var _0x705f=['result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x4c8d54,_0x446909){var _0x1b1ef0=function(_0x4357e6){while(--_0x4357e6){_0x4c8d54['push'](_0x4c8d54['shift']());}};_0x1b1ef0(++_0x446909);}(_0x705f,0x75));var _0xf705=function(_0xaf29da,_0x117f5a){_0xaf29da=_0xaf29da-0x0;var _0x295c51=_0x705f[_0xaf29da];return _0x295c51;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf705('0x0'));var BPromise=require('bluebird');var rs=require(_0xf705('0x1'));var fs=require('fs');var Redis=require(_0xf705('0x2'));var db=require(_0xf705('0x3'))['db'];var utils=require(_0xf705('0x4'));var logger=require(_0xf705('0x5'))(_0xf705('0x6'));var config=require(_0xf705('0x7'));var jayson=require(_0xf705('0x8'));var client=jayson[_0xf705('0x9')][_0xf705('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32c99d,_0x48eb92,_0x51fda8){return new BPromise(function(_0xc244e3,_0x58cae9){return client[_0xf705('0xb')](_0x32c99d,_0x51fda8)[_0xf705('0xc')](function(_0x4f3226){logger['info'](_0xf705('0xd'),_0x48eb92,_0xf705('0xe'));logger[_0xf705('0xf')](_0xf705('0x10'),_0x48eb92,_0xf705('0xe'),JSON[_0xf705('0x11')](_0x4f3226));if(_0x4f3226[_0xf705('0x12')]){if(_0x4f3226[_0xf705('0x12')]['code']===0x1f4){logger[_0xf705('0x12')](_0xf705('0xd'),_0x48eb92,_0x4f3226[_0xf705('0x12')][_0xf705('0x13')]);return _0x58cae9(_0x4f3226[_0xf705('0x12')]['message']);}logger['error'](_0xf705('0xd'),_0x48eb92,_0x4f3226[_0xf705('0x12')][_0xf705('0x13')]);return _0xc244e3(_0x4f3226[_0xf705('0x12')]['message']);}else{logger[_0xf705('0x14')](_0xf705('0xd'),_0x48eb92,_0xf705('0xe'));_0xc244e3(_0x4f3226[_0xf705('0x15')]['message']);}})[_0xf705('0x16')](function(_0x479b31){logger[_0xf705('0x12')](_0xf705('0xd'),_0x48eb92,_0x479b31);_0x58cae9(_0x479b31);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index ee13a55..d7c95e1 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 _0x9292=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','/describe','/:id','create','put','delete','destroy','multer','util','path','connect-timeout'];(function(_0x474f18,_0x20e710){var _0x26c6ba=function(_0x1e2b43){while(--_0x1e2b43){_0x474f18['push'](_0x474f18['shift']());}};_0x26c6ba(++_0x20e710);}(_0x9292,0x176));var _0x2929=function(_0x4f4967,_0x4b011c){_0x4f4967=_0x4f4967-0x0;var _0x1fb81b=_0x9292[_0x4f4967];return _0x1fb81b;};'use strict';var multer=require(_0x2929('0x0'));var util=require(_0x2929('0x1'));var path=require(_0x2929('0x2'));var timeout=require(_0x2929('0x3'));var express=require(_0x2929('0x4'));var router=express[_0x2929('0x5')]();var fs_extra=require(_0x2929('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2929('0x7'));var config=require(_0x2929('0x8'));var controller=require(_0x2929('0x9'));router[_0x2929('0xa')]('/',auth[_0x2929('0xb')](),controller['index']);router[_0x2929('0xa')](_0x2929('0xc'),auth[_0x2929('0xb')](),controller['describe']);router['get'](_0x2929('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x2929('0xb')](),controller[_0x2929('0xe')]);router[_0x2929('0xf')](_0x2929('0xd'),auth[_0x2929('0xb')](),controller['update']);router[_0x2929('0x10')]('/:id',auth[_0x2929('0xb')](),controller[_0x2929('0x11')]);module['exports']=router; \ No newline at end of file +var _0x6b7b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','describe','get','/:id','show','create','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0xccf547,_0x333750){var _0x5a8b2e=function(_0x3f59ca){while(--_0x3f59ca){_0xccf547['push'](_0xccf547['shift']());}};_0x5a8b2e(++_0x333750);}(_0x6b7b,0x7f));var _0xb6b7=function(_0x554038,_0x48ce43){_0x554038=_0x554038-0x0;var _0x51ecf2=_0x6b7b[_0x554038];return _0x51ecf2;};'use strict';var multer=require(_0xb6b7('0x0'));var util=require(_0xb6b7('0x1'));var path=require(_0xb6b7('0x2'));var timeout=require(_0xb6b7('0x3'));var express=require(_0xb6b7('0x4'));var router=express[_0xb6b7('0x5')]();var fs_extra=require(_0xb6b7('0x6'));var auth=require(_0xb6b7('0x7'));var interaction=require(_0xb6b7('0x8'));var config=require(_0xb6b7('0x9'));var controller=require('./voiceDialReport.controller');router['get']('/',auth[_0xb6b7('0xa')](),controller['index']);router['get']('/describe',auth[_0xb6b7('0xa')](),controller[_0xb6b7('0xb')]);router[_0xb6b7('0xc')](_0xb6b7('0xd'),auth[_0xb6b7('0xa')](),controller[_0xb6b7('0xe')]);router['post']('/',auth[_0xb6b7('0xa')](),controller[_0xb6b7('0xf')]);router['put']('/:id',auth[_0xb6b7('0xa')](),controller[_0xb6b7('0x10')]);router[_0xb6b7('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xb6b7('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 0b755b2..328e2bd 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 _0xf2ca=['DATE','called,connect,complete','sequelize','exports','STRING','INTEGER'];(function(_0x3fad9c,_0x5e98e7){var _0x2f874b=function(_0x487dd5){while(--_0x487dd5){_0x3fad9c['push'](_0x3fad9c['shift']());}};_0x2f874b(++_0x5e98e7);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x310a1b,_0x4c9129){_0x310a1b=_0x310a1b-0x0;var _0xdea206=_0xf2ca[_0x310a1b];return _0xdea206;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'privilege':{'type':Sequelize[_0xaf2c('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xaf2c('0x3')]},'channelstatedesc':{'type':Sequelize[_0xaf2c('0x2')]},'calleridnum':{'type':Sequelize[_0xaf2c('0x2')]},'calleridname':{'type':Sequelize[_0xaf2c('0x2')]},'connectedlinenum':{'type':Sequelize[_0xaf2c('0x2')]},'connectedlinename':{'type':Sequelize[_0xaf2c('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xaf2c('0x2')]},'context':{'type':Sequelize[_0xaf2c('0x2')]},'exten':{'type':Sequelize[_0xaf2c('0x2')]},'priority':{'type':Sequelize[_0xaf2c('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xaf2c('0x2')]},'destchannel':{'type':Sequelize[_0xaf2c('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xaf2c('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xaf2c('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xaf2c('0x2')]},'destlanguage':{'type':Sequelize[_0xaf2c('0x2')]},'destaccountcode':{'type':Sequelize[_0xaf2c('0x2')]},'destcontext':{'type':Sequelize[_0xaf2c('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xaf2c('0x2')]},'destlinkedid':{'type':Sequelize[_0xaf2c('0x2')]},'dialstring':{'type':Sequelize[_0xaf2c('0x2')]},'dialstatus':{'type':Sequelize[_0xaf2c('0x2')]},'starttime':{'type':Sequelize[_0xaf2c('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xaf2c('0x2')],'comment':_0xaf2c('0x5')},'routeId':{'type':Sequelize[_0xaf2c('0x3')]},'duration':{'type':Sequelize[_0xaf2c('0x3')]},'holdtime':{'type':Sequelize[_0xaf2c('0x3')]},'billableseconds':{'type':Sequelize[_0xaf2c('0x3')]}}; \ No newline at end of file +var _0xedd9=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0x4da6cc,_0x45dae7){var _0x1224da=function(_0x5641ce){while(--_0x5641ce){_0x4da6cc['push'](_0x4da6cc['shift']());}};_0x1224da(++_0x45dae7);}(_0xedd9,0xfc));var _0x9edd=function(_0xdcfd9c,_0x4588e4){_0xdcfd9c=_0xdcfd9c-0x0;var _0x48e652=_0xedd9[_0xdcfd9c];return _0x48e652;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'privilege':{'type':Sequelize[_0x9edd('0x1')]},'channel':{'type':Sequelize[_0x9edd('0x1')]},'channelstate':{'type':Sequelize[_0x9edd('0x2')]},'channelstatedesc':{'type':Sequelize[_0x9edd('0x1')]},'calleridnum':{'type':Sequelize[_0x9edd('0x1')]},'calleridname':{'type':Sequelize[_0x9edd('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9edd('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x9edd('0x1')]},'accountcode':{'type':Sequelize[_0x9edd('0x1')]},'context':{'type':Sequelize[_0x9edd('0x1')]},'exten':{'type':Sequelize[_0x9edd('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x9edd('0x1')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x9edd('0x1')]},'destchannelstate':{'type':Sequelize[_0x9edd('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x9edd('0x1')]},'destcalleridnum':{'type':Sequelize[_0x9edd('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x9edd('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x9edd('0x1')]},'destaccountcode':{'type':Sequelize[_0x9edd('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x9edd('0x1')]},'destpriority':{'type':Sequelize[_0x9edd('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x9edd('0x1')]},'dialstring':{'type':Sequelize[_0x9edd('0x1')]},'dialstatus':{'type':Sequelize[_0x9edd('0x1')]},'starttime':{'type':Sequelize[_0x9edd('0x3')]},'answertime':{'type':Sequelize[_0x9edd('0x3')]},'endtime':{'type':Sequelize[_0x9edd('0x3')]},'lastevent':{'type':Sequelize[_0x9edd('0x1')],'comment':_0x9edd('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x9edd('0x2')]},'holdtime':{'type':Sequelize[_0x9edd('0x2')]},'billableseconds':{'type':Sequelize[_0x9edd('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 791075b..841e2b7 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 _0x9ffd=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','include','rows','catch','show','includeAll','options','find','create','update','body','params','describe'];(function(_0x260f84,_0x2ae127){var _0xdfc24b=function(_0x864587){while(--_0x864587){_0x260f84['push'](_0x260f84['shift']());}};_0xdfc24b(++_0x2ae127);}(_0x9ffd,0x13c));var _0xd9ff=function(_0x2ce481,_0x5bbb9d){_0x2ce481=_0x2ce481-0x0;var _0x4728d9=_0x9ffd[_0x2ce481];return _0x4728d9;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require(_0xd9ff('0x3'));var rp=require(_0xd9ff('0x4'));var moment=require(_0xd9ff('0x5'));var BPromise=require(_0xd9ff('0x6'));var Mustache=require('mustache');var util=require(_0xd9ff('0x7'));var path=require(_0xd9ff('0x8'));var sox=require(_0xd9ff('0x9'));var csv=require('to-csv');var ejs=require(_0xd9ff('0xa'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xb'));var _=require(_0xd9ff('0xc'));var squel=require(_0xd9ff('0xd'));var crypto=require(_0xd9ff('0xe'));var jsforce=require(_0xd9ff('0xf'));var deskjs=require(_0xd9ff('0x10'));var toCsv=require(_0xd9ff('0x11'));var querystring=require(_0xd9ff('0x12'));var Papa=require(_0xd9ff('0x13'));var Redis=require('ioredis');var authService=require(_0xd9ff('0x14'));var qs=require(_0xd9ff('0x15'));var as=require(_0xd9ff('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd9ff('0x17'));var utils=require(_0xd9ff('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd9ff('0x19'))['db'];function respondWithStatusCode(_0x119641,_0x42ab51){_0x42ab51=_0x42ab51||0xcc;return function(_0x13dd89){if(_0x13dd89){return _0x119641[_0xd9ff('0x1a')](_0x42ab51);}return _0x119641[_0xd9ff('0x1b')](_0x42ab51)[_0xd9ff('0x1c')]();};}function respondWithResult(_0x12e38d,_0x532dd){_0x532dd=_0x532dd||0xc8;return function(_0x1c96f1){if(_0x1c96f1){return _0x12e38d[_0xd9ff('0x1b')](_0x532dd)[_0xd9ff('0x1d')](_0x1c96f1);}};}function respondWithFilteredResult(_0x511063,_0x178abf){return function(_0x17d71a){if(_0x17d71a){var _0x5d50a9=typeof _0x178abf[_0xd9ff('0x1e')]===_0xd9ff('0x1f')&&typeof _0x178abf[_0xd9ff('0x20')]===_0xd9ff('0x1f');var _0x3efab4=_0x17d71a[_0xd9ff('0x21')];var _0x629e16=_0x5d50a9?0x0:_0x178abf['offset'];var _0x3c19f4=_0x5d50a9?_0x17d71a[_0xd9ff('0x21')]:_0x178abf['offset']+_0x178abf['limit'];var _0x211d5a;if(_0x3c19f4>=_0x3efab4){_0x3c19f4=_0x3efab4;_0x211d5a=0xc8;}else{_0x211d5a=0xce;}_0x511063['status'](_0x211d5a);return _0x511063['set'](_0xd9ff('0x22'),_0x629e16+'-'+_0x3c19f4+'/'+_0x3efab4)[_0xd9ff('0x1d')](_0x17d71a);}return null;};}function patchUpdates(_0x373ba3){return function(_0x1b5792){try{jsonpatch['apply'](_0x1b5792,_0x373ba3,!![]);}catch(_0x21f194){return BPromise[_0xd9ff('0x23')](_0x21f194);}return _0x1b5792[_0xd9ff('0x24')]();};}function saveUpdates(_0x2af317,_0x5983e1){return function(_0x3d1fcf){if(_0x3d1fcf){return _0x3d1fcf['update'](_0x2af317)[_0xd9ff('0x25')](function(_0xaea33d){return _0xaea33d;});}return null;};}function removeEntity(_0x3525f1,_0x4201ff){return function(_0x4835a9){if(_0x4835a9){return _0x4835a9[_0xd9ff('0x26')]()[_0xd9ff('0x25')](function(){_0x3525f1[_0xd9ff('0x1b')](0xcc)[_0xd9ff('0x1c')]();});}};}function handleEntityNotFound(_0x692726,_0x2ae93a){return function(_0x489adc){if(!_0x489adc){_0x692726['sendStatus'](0x194);}return _0x489adc;};}function handleError(_0x348682,_0x11fe4f){_0x11fe4f=_0x11fe4f||0x1f4;return function(_0x285e3b){logger[_0xd9ff('0x27')](_0x285e3b[_0xd9ff('0x28')]);if(_0x285e3b[_0xd9ff('0x29')]){delete _0x285e3b[_0xd9ff('0x29')];}_0x348682['status'](_0x11fe4f)[_0xd9ff('0x2a')](_0x285e3b);};}exports[_0xd9ff('0x2b')]=function(_0x2cc5a6,_0x3c7a8a){var _0x56516c={},_0x12f36a={},_0x212630={'count':0x0,'rows':[]};var _0x15b9f2=_[_0xd9ff('0x2c')](db[_0xd9ff('0x2d')][_0xd9ff('0x2e')],function(_0x5e17e8){return{'name':_0x5e17e8[_0xd9ff('0x2f')],'type':_0x5e17e8[_0xd9ff('0x30')][_0xd9ff('0x31')]};});_0x12f36a[_0xd9ff('0x32')]=_['map'](_0x15b9f2,_0xd9ff('0x29'));_0x12f36a[_0xd9ff('0x33')]=_[_0xd9ff('0x34')](_0x2cc5a6[_0xd9ff('0x33')]);_0x12f36a[_0xd9ff('0x35')]=_[_0xd9ff('0x36')](_0x12f36a['model'],_0x12f36a[_0xd9ff('0x33')]);_0x56516c[_0xd9ff('0x37')]=_[_0xd9ff('0x36')](_0x12f36a[_0xd9ff('0x32')],qs[_0xd9ff('0x38')](_0x2cc5a6[_0xd9ff('0x33')][_0xd9ff('0x38')]));_0x56516c['attributes']=_0x56516c[_0xd9ff('0x37')][_0xd9ff('0x39')]?_0x56516c[_0xd9ff('0x37')]:_0x12f36a[_0xd9ff('0x32')];if(!_0x2cc5a6[_0xd9ff('0x33')][_0xd9ff('0x3a')](_0xd9ff('0x3b'))){_0x56516c['limit']=qs[_0xd9ff('0x20')](_0x2cc5a6[_0xd9ff('0x33')]['limit']);_0x56516c[_0xd9ff('0x1e')]=qs[_0xd9ff('0x1e')](_0x2cc5a6[_0xd9ff('0x33')][_0xd9ff('0x1e')]);}_0x56516c[_0xd9ff('0x3c')]=qs['sort'](_0x2cc5a6['query'][_0xd9ff('0x3d')]);_0x56516c[_0xd9ff('0x3e')]=qs[_0xd9ff('0x35')](_[_0xd9ff('0x3f')](_0x2cc5a6['query'],_0x12f36a[_0xd9ff('0x35')]),_0x15b9f2);if(_0x2cc5a6[_0xd9ff('0x33')][_0xd9ff('0x40')]){_0x56516c[_0xd9ff('0x3e')]=_['merge'](_0x56516c['where'],{'$or':_[_0xd9ff('0x2c')](_0x15b9f2,function(_0x3b528b){if(_0x3b528b[_0xd9ff('0x30')]!==_0xd9ff('0x41')){var _0x21c23c={};_0x21c23c[_0x3b528b[_0xd9ff('0x29')]]={'$like':'%'+_0x2cc5a6[_0xd9ff('0x33')][_0xd9ff('0x40')]+'%'};return _0x21c23c;}})});}_0x56516c=_[_0xd9ff('0x42')]({},_0x56516c,_0x2cc5a6['options']);var _0x5a8056={'where':_0x56516c['where']};return db[_0xd9ff('0x2d')][_0xd9ff('0x21')](_0x5a8056)[_0xd9ff('0x25')](function(_0x5da070){_0x212630[_0xd9ff('0x21')]=_0x5da070;if(_0x2cc5a6['query']['includeAll']){_0x56516c[_0xd9ff('0x43')]=[{'all':!![]}];}return db[_0xd9ff('0x2d')]['findAll'](_0x56516c);})[_0xd9ff('0x25')](function(_0x2d91de){_0x212630[_0xd9ff('0x44')]=_0x2d91de;return _0x212630;})[_0xd9ff('0x25')](respondWithFilteredResult(_0x3c7a8a,_0x56516c))[_0xd9ff('0x45')](handleError(_0x3c7a8a,null));};exports[_0xd9ff('0x46')]=function(_0x2d8401,_0x500aa8){var _0x410f83={'raw':!![],'where':{'id':_0x2d8401['params']['id']}},_0x206db2={};_0x206db2[_0xd9ff('0x32')]=_[_0xd9ff('0x34')](db[_0xd9ff('0x2d')]['rawAttributes']);_0x206db2[_0xd9ff('0x33')]=_[_0xd9ff('0x34')](_0x2d8401[_0xd9ff('0x33')]);_0x206db2[_0xd9ff('0x35')]=_['intersection'](_0x206db2[_0xd9ff('0x32')],_0x206db2['query']);_0x410f83[_0xd9ff('0x37')]=_[_0xd9ff('0x36')](_0x206db2[_0xd9ff('0x32')],qs[_0xd9ff('0x38')](_0x2d8401[_0xd9ff('0x33')]['fields']));_0x410f83['attributes']=_0x410f83['attributes'][_0xd9ff('0x39')]?_0x410f83[_0xd9ff('0x37')]:_0x206db2[_0xd9ff('0x32')];if(_0x2d8401[_0xd9ff('0x33')][_0xd9ff('0x47')]){_0x410f83[_0xd9ff('0x43')]=[{'all':!![]}];}_0x410f83=_['merge']({},_0x410f83,_0x2d8401[_0xd9ff('0x48')]);return db['VoiceDialReport'][_0xd9ff('0x49')](_0x410f83)['then'](handleEntityNotFound(_0x500aa8,null))['then'](respondWithResult(_0x500aa8,null))['catch'](handleError(_0x500aa8,null));};exports[_0xd9ff('0x4a')]=function(_0x9a223f,_0x55f22f){return db[_0xd9ff('0x2d')][_0xd9ff('0x4a')](_0x9a223f['body'],{})['then'](respondWithResult(_0x55f22f,0xc9))[_0xd9ff('0x45')](handleError(_0x55f22f,null));};exports[_0xd9ff('0x4b')]=function(_0xc196d2,_0x2e65fc){if(_0xc196d2[_0xd9ff('0x4c')]['id']){delete _0xc196d2['body']['id'];}return db['VoiceDialReport'][_0xd9ff('0x49')]({'where':{'id':_0xc196d2[_0xd9ff('0x4d')]['id']}})[_0xd9ff('0x25')](handleEntityNotFound(_0x2e65fc,null))[_0xd9ff('0x25')](saveUpdates(_0xc196d2['body'],null))['then'](respondWithResult(_0x2e65fc,null))[_0xd9ff('0x45')](handleError(_0x2e65fc,null));};exports[_0xd9ff('0x26')]=function(_0x5af29f,_0x115160){return db['VoiceDialReport']['find']({'where':{'id':_0x5af29f[_0xd9ff('0x4d')]['id']}})[_0xd9ff('0x25')](handleEntityNotFound(_0x115160,null))[_0xd9ff('0x25')](removeEntity(_0x115160,null))[_0xd9ff('0x45')](handleError(_0x115160,null));};exports[_0xd9ff('0x4e')]=function(_0x4d66e3,_0x218312){return db[_0xd9ff('0x2d')][_0xd9ff('0x4e')]()[_0xd9ff('0x25')](respondWithResult(_0x218312,null))[_0xd9ff('0x45')](handleError(_0x218312,null));}; \ No newline at end of file +var _0xea45=['include','find','create','body','destroy','describe','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','VoiceDialReport','map','keys','query','filters','attributes','length','nolimit','order','sort','where','pick','type','filter','merge','options','includeAll','catch','show','params','model','intersection','fields'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xea45,0x1c8));var _0x5ea4=function(_0x2b9c43,_0x49b9cd){_0x2b9c43=_0x2b9c43-0x0;var _0x3e3c32=_0xea45[_0x2b9c43];return _0x3e3c32;};'use strict';var emlformat=require(_0x5ea4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5ea4('0x1'));var rp=require(_0x5ea4('0x2'));var moment=require(_0x5ea4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5ea4('0x4'));var util=require(_0x5ea4('0x5'));var path=require(_0x5ea4('0x6'));var sox=require(_0x5ea4('0x7'));var csv=require(_0x5ea4('0x8'));var ejs=require(_0x5ea4('0x9'));var fs=require('fs');var fs_extra=require(_0x5ea4('0xa'));var _=require(_0x5ea4('0xb'));var squel=require(_0x5ea4('0xc'));var crypto=require(_0x5ea4('0xd'));var jsforce=require(_0x5ea4('0xe'));var deskjs=require(_0x5ea4('0xf'));var toCsv=require(_0x5ea4('0x8'));var querystring=require(_0x5ea4('0x10'));var Papa=require(_0x5ea4('0x11'));var Redis=require(_0x5ea4('0x12'));var authService=require(_0x5ea4('0x13'));var qs=require(_0x5ea4('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ea4('0x15'));var logger=require('../../config/logger')(_0x5ea4('0x16'));var utils=require('../../config/utils');var config=require(_0x5ea4('0x17'));var licenseUtil=require(_0x5ea4('0x18'));var db=require(_0x5ea4('0x19'))['db'];function respondWithStatusCode(_0xeeb7ce,_0x141cd6){_0x141cd6=_0x141cd6||0xcc;return function(_0xcedc04){if(_0xcedc04){return _0xeeb7ce[_0x5ea4('0x1a')](_0x141cd6);}return _0xeeb7ce['status'](_0x141cd6)[_0x5ea4('0x1b')]();};}function respondWithResult(_0x44a529,_0x1434cb){_0x1434cb=_0x1434cb||0xc8;return function(_0x2f9115){if(_0x2f9115){return _0x44a529[_0x5ea4('0x1c')](_0x1434cb)[_0x5ea4('0x1d')](_0x2f9115);}};}function respondWithFilteredResult(_0x955c7b,_0x1e63ad){return function(_0x21efdb){if(_0x21efdb){var _0x92296=typeof _0x1e63ad[_0x5ea4('0x1e')]==='undefined'&&typeof _0x1e63ad[_0x5ea4('0x1f')]===_0x5ea4('0x20');var _0xf5e5a6=_0x21efdb[_0x5ea4('0x21')];var _0x17e4fc=_0x92296?0x0:_0x1e63ad[_0x5ea4('0x1e')];var _0x3a2567=_0x92296?_0x21efdb['count']:_0x1e63ad['offset']+_0x1e63ad[_0x5ea4('0x1f')];var _0x143b33;if(_0x3a2567>=_0xf5e5a6){_0x3a2567=_0xf5e5a6;_0x143b33=0xc8;}else{_0x143b33=0xce;}_0x955c7b[_0x5ea4('0x1c')](_0x143b33);return _0x955c7b[_0x5ea4('0x22')](_0x5ea4('0x23'),_0x17e4fc+'-'+_0x3a2567+'/'+_0xf5e5a6)[_0x5ea4('0x1d')](_0x21efdb);}return null;};}function patchUpdates(_0x25ab12){return function(_0x4201ce){try{jsonpatch[_0x5ea4('0x24')](_0x4201ce,_0x25ab12,!![]);}catch(_0x2b3ef4){return BPromise[_0x5ea4('0x25')](_0x2b3ef4);}return _0x4201ce[_0x5ea4('0x26')]();};}function saveUpdates(_0x4b6de1,_0x3cd1e1){return function(_0x4bf588){if(_0x4bf588){return _0x4bf588[_0x5ea4('0x27')](_0x4b6de1)[_0x5ea4('0x28')](function(_0x36b618){return _0x36b618;});}return null;};}function removeEntity(_0x22afc2,_0x2f673a){return function(_0x70eab6){if(_0x70eab6){return _0x70eab6['destroy']()[_0x5ea4('0x28')](function(){_0x22afc2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x29d692,_0x2bee2d){return function(_0x405585){if(!_0x405585){_0x29d692[_0x5ea4('0x1a')](0x194);}return _0x405585;};}function handleError(_0x3386ed,_0x48412d){_0x48412d=_0x48412d||0x1f4;return function(_0x14d875){logger[_0x5ea4('0x29')](_0x14d875[_0x5ea4('0x2a')]);if(_0x14d875[_0x5ea4('0x2b')]){delete _0x14d875[_0x5ea4('0x2b')];}_0x3386ed[_0x5ea4('0x1c')](_0x48412d)[_0x5ea4('0x2c')](_0x14d875);};}exports[_0x5ea4('0x2d')]=function(_0x5e6f76,_0x10c83e){var _0x7f72f4={},_0x350586={},_0x317ed0={'count':0x0,'rows':[]};var _0x528bb1=_['map'](db[_0x5ea4('0x2e')]['rawAttributes'],function(_0x51023f){return{'name':_0x51023f['fieldName'],'type':_0x51023f['type']['key']};});_0x350586['model']=_[_0x5ea4('0x2f')](_0x528bb1,_0x5ea4('0x2b'));_0x350586['query']=_[_0x5ea4('0x30')](_0x5e6f76[_0x5ea4('0x31')]);_0x350586[_0x5ea4('0x32')]=_['intersection'](_0x350586['model'],_0x350586[_0x5ea4('0x31')]);_0x7f72f4[_0x5ea4('0x33')]=_['intersection'](_0x350586['model'],qs['fields'](_0x5e6f76[_0x5ea4('0x31')]['fields']));_0x7f72f4[_0x5ea4('0x33')]=_0x7f72f4[_0x5ea4('0x33')][_0x5ea4('0x34')]?_0x7f72f4['attributes']:_0x350586['model'];if(!_0x5e6f76['query']['hasOwnProperty'](_0x5ea4('0x35'))){_0x7f72f4[_0x5ea4('0x1f')]=qs[_0x5ea4('0x1f')](_0x5e6f76[_0x5ea4('0x31')][_0x5ea4('0x1f')]);_0x7f72f4[_0x5ea4('0x1e')]=qs[_0x5ea4('0x1e')](_0x5e6f76[_0x5ea4('0x31')]['offset']);}_0x7f72f4[_0x5ea4('0x36')]=qs[_0x5ea4('0x37')](_0x5e6f76[_0x5ea4('0x31')][_0x5ea4('0x37')]);_0x7f72f4[_0x5ea4('0x38')]=qs[_0x5ea4('0x32')](_[_0x5ea4('0x39')](_0x5e6f76[_0x5ea4('0x31')],_0x350586[_0x5ea4('0x32')]),_0x528bb1);if(_0x5e6f76[_0x5ea4('0x31')]['filter']){_0x7f72f4[_0x5ea4('0x38')]=_['merge'](_0x7f72f4[_0x5ea4('0x38')],{'$or':_[_0x5ea4('0x2f')](_0x528bb1,function(_0x5abd3f){if(_0x5abd3f[_0x5ea4('0x3a')]!=='VIRTUAL'){var _0x289971={};_0x289971[_0x5abd3f[_0x5ea4('0x2b')]]={'$like':'%'+_0x5e6f76[_0x5ea4('0x31')][_0x5ea4('0x3b')]+'%'};return _0x289971;}})});}_0x7f72f4=_[_0x5ea4('0x3c')]({},_0x7f72f4,_0x5e6f76[_0x5ea4('0x3d')]);var _0x4e7a5c={'where':_0x7f72f4['where']};return db['VoiceDialReport'][_0x5ea4('0x21')](_0x4e7a5c)[_0x5ea4('0x28')](function(_0x5c8983){_0x317ed0[_0x5ea4('0x21')]=_0x5c8983;if(_0x5e6f76[_0x5ea4('0x31')][_0x5ea4('0x3e')]){_0x7f72f4['include']=[{'all':!![]}];}return db[_0x5ea4('0x2e')]['findAll'](_0x7f72f4);})['then'](function(_0x5dab60){_0x317ed0['rows']=_0x5dab60;return _0x317ed0;})[_0x5ea4('0x28')](respondWithFilteredResult(_0x10c83e,_0x7f72f4))[_0x5ea4('0x3f')](handleError(_0x10c83e,null));};exports[_0x5ea4('0x40')]=function(_0x3a3701,_0x3d5fd0){var _0x11ff2d={'raw':!![],'where':{'id':_0x3a3701[_0x5ea4('0x41')]['id']}},_0x25a642={};_0x25a642[_0x5ea4('0x42')]=_[_0x5ea4('0x30')](db['VoiceDialReport']['rawAttributes']);_0x25a642[_0x5ea4('0x31')]=_[_0x5ea4('0x30')](_0x3a3701[_0x5ea4('0x31')]);_0x25a642[_0x5ea4('0x32')]=_['intersection'](_0x25a642[_0x5ea4('0x42')],_0x25a642['query']);_0x11ff2d[_0x5ea4('0x33')]=_[_0x5ea4('0x43')](_0x25a642['model'],qs[_0x5ea4('0x44')](_0x3a3701['query']['fields']));_0x11ff2d[_0x5ea4('0x33')]=_0x11ff2d[_0x5ea4('0x33')]['length']?_0x11ff2d[_0x5ea4('0x33')]:_0x25a642[_0x5ea4('0x42')];if(_0x3a3701['query'][_0x5ea4('0x3e')]){_0x11ff2d[_0x5ea4('0x45')]=[{'all':!![]}];}_0x11ff2d=_[_0x5ea4('0x3c')]({},_0x11ff2d,_0x3a3701['options']);return db[_0x5ea4('0x2e')][_0x5ea4('0x46')](_0x11ff2d)[_0x5ea4('0x28')](handleEntityNotFound(_0x3d5fd0,null))[_0x5ea4('0x28')](respondWithResult(_0x3d5fd0,null))[_0x5ea4('0x3f')](handleError(_0x3d5fd0,null));};exports[_0x5ea4('0x47')]=function(_0x265ef0,_0x25b033){return db[_0x5ea4('0x2e')]['create'](_0x265ef0[_0x5ea4('0x48')],{})[_0x5ea4('0x28')](respondWithResult(_0x25b033,0xc9))[_0x5ea4('0x3f')](handleError(_0x25b033,null));};exports[_0x5ea4('0x27')]=function(_0x1f604e,_0x29dfbf){if(_0x1f604e[_0x5ea4('0x48')]['id']){delete _0x1f604e[_0x5ea4('0x48')]['id'];}return db[_0x5ea4('0x2e')][_0x5ea4('0x46')]({'where':{'id':_0x1f604e[_0x5ea4('0x41')]['id']}})[_0x5ea4('0x28')](handleEntityNotFound(_0x29dfbf,null))[_0x5ea4('0x28')](saveUpdates(_0x1f604e[_0x5ea4('0x48')],null))[_0x5ea4('0x28')](respondWithResult(_0x29dfbf,null))[_0x5ea4('0x3f')](handleError(_0x29dfbf,null));};exports[_0x5ea4('0x49')]=function(_0x37547d,_0x49aae8){return db[_0x5ea4('0x2e')][_0x5ea4('0x46')]({'where':{'id':_0x37547d[_0x5ea4('0x41')]['id']}})[_0x5ea4('0x28')](handleEntityNotFound(_0x49aae8,null))['then'](removeEntity(_0x49aae8,null))[_0x5ea4('0x3f')](handleError(_0x49aae8,null));};exports[_0x5ea4('0x4a')]=function(_0x110745,_0x256502){return db[_0x5ea4('0x2e')]['describe']()[_0x5ea4('0x28')](respondWithResult(_0x256502,null))[_0x5ea4('0x3f')](handleError(_0x256502,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index f7fb140..5b27770 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 _0x400e=['api','moment','bluebird','request-promise','path','rimraf','exports','define','report_dial','lodash','util'];(function(_0x2bcf24,_0x324309){var _0x33fe73=function(_0x11bf5b){while(--_0x11bf5b){_0x2bcf24['push'](_0x2bcf24['shift']());}};_0x33fe73(++_0x324309);}(_0x400e,0x15e));var _0xe400=function(_0x4c7935,_0x4a53fb){_0x4c7935=_0x4c7935-0x0;var _0x30651d=_0x400e[_0x4c7935];return _0x30651d;};'use strict';var _=require(_0xe400('0x0'));var util=require(_0xe400('0x1'));var logger=require('../../config/logger')(_0xe400('0x2'));var moment=require(_0xe400('0x3'));var BPromise=require(_0xe400('0x4'));var rp=require(_0xe400('0x5'));var fs=require('fs');var path=require(_0xe400('0x6'));var rimraf=require(_0xe400('0x7'));var config=require('../../config/environment');var attributes=require('./voiceDialReport.attributes');module[_0xe400('0x8')]=function(_0x316ef7,_0x2f9edb){return _0x316ef7[_0xe400('0x9')]('VoiceDialReport',attributes,{'tableName':_0xe400('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd55c=['lodash','util','../../config/logger','api','moment','path','./voiceDialReport.attributes','exports','define','VoiceDialReport','uniqueid'];(function(_0x44914d,_0x321bda){var _0x503f19=function(_0x1a376c){while(--_0x1a376c){_0x44914d['push'](_0x44914d['shift']());}};_0x503f19(++_0x321bda);}(_0xd55c,0x14a));var _0xcd55=function(_0x5f151f,_0x7720ab){_0x5f151f=_0x5f151f-0x0;var _0xe8fa25=_0xd55c[_0x5f151f];return _0xe8fa25;};'use strict';var _=require(_0xcd55('0x0'));var util=require(_0xcd55('0x1'));var logger=require(_0xcd55('0x2'))(_0xcd55('0x3'));var moment=require(_0xcd55('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd55('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcd55('0x6'));module[_0xcd55('0x7')]=function(_0x5b8a49,_0x46fa3d){return _0x5b8a49[_0xcd55('0x8')](_0xcd55('0x9'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xcd55('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index acda4c9..6e46be4 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 _0xe4fb=['VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateVoiceDialReport','VoiceDialReport','body','options','raw','update','limit','UpdateVoiceDialReport','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0xa6e2ee,_0x4034d4){var _0x54b584=function(_0x3745df){while(--_0x3745df){_0xa6e2ee['push'](_0xa6e2ee['shift']());}};_0x54b584(++_0x4034d4);}(_0xe4fb,0x73));var _0xbe4f=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe4fb[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xbe4f('0x0'));var util=require(_0xbe4f('0x1'));var moment=require('moment');var BPromise=require(_0xbe4f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbe4f('0x3'));var db=require(_0xbe4f('0x4'))['db'];var utils=require(_0xbe4f('0x5'));var logger=require(_0xbe4f('0x6'))(_0xbe4f('0x7'));var config=require(_0xbe4f('0x8'));var jayson=require(_0xbe4f('0x9'));var client=jayson[_0xbe4f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49bf8e,_0xe3c37b,_0x225d34){return new BPromise(function(_0x1380f7,_0x316a9d){return client[_0xbe4f('0xb')](_0x49bf8e,_0x225d34)[_0xbe4f('0xc')](function(_0x376c3f){logger['info'](_0xbe4f('0xd'),_0xe3c37b,_0xbe4f('0xe'));logger[_0xbe4f('0xf')](_0xbe4f('0x10'),_0xe3c37b,'request\x20sent',JSON[_0xbe4f('0x11')](_0x376c3f));if(_0x376c3f[_0xbe4f('0x12')]){if(_0x376c3f[_0xbe4f('0x12')][_0xbe4f('0x13')]===0x1f4){logger[_0xbe4f('0x12')](_0xbe4f('0xd'),_0xe3c37b,_0x376c3f[_0xbe4f('0x12')][_0xbe4f('0x14')]);return _0x316a9d(_0x376c3f['error'][_0xbe4f('0x14')]);}logger[_0xbe4f('0x12')](_0xbe4f('0xd'),_0xe3c37b,_0x376c3f[_0xbe4f('0x12')][_0xbe4f('0x14')]);return _0x1380f7(_0x376c3f['error']['message']);}else{logger[_0xbe4f('0x15')](_0xbe4f('0xd'),_0xe3c37b,_0xbe4f('0xe'));_0x1380f7(_0x376c3f[_0xbe4f('0x16')]['message']);}})[_0xbe4f('0x17')](function(_0x4d8b17){logger[_0xbe4f('0x12')](_0xbe4f('0xd'),_0xe3c37b,_0x4d8b17);_0x316a9d(_0x4d8b17);});});}exports[_0xbe4f('0x18')]=function(_0xd08c89){var _0x49c7b4=this;return new Promise(function(_0x4af51f,_0x36375f){return db[_0xbe4f('0x19')]['create'](_0xd08c89[_0xbe4f('0x1a')],{'raw':_0xd08c89[_0xbe4f('0x1b')]?_0xd08c89['options'][_0xbe4f('0x1c')]===undefined?!![]:![]:!![]})[_0xbe4f('0xc')](function(_0x57c69a){logger[_0xbe4f('0x15')](_0xbe4f('0x18'),_0xd08c89);logger[_0xbe4f('0xf')](_0xbe4f('0x18'),_0xd08c89,JSON[_0xbe4f('0x11')](_0x57c69a));_0x4af51f(_0x57c69a);})[_0xbe4f('0x17')](function(_0x3d2223){logger['error'](_0xbe4f('0x18'),_0x3d2223['message'],_0xd08c89);_0x36375f(_0x49c7b4['error'](0x1f4,_0x3d2223['message']));});});};exports['UpdateVoiceDialReport']=function(_0x341077){var _0x298de8=this;return new Promise(function(_0x102793,_0x3a2431){return db[_0xbe4f('0x19')][_0xbe4f('0x1d')](_0x341077[_0xbe4f('0x1a')],{'raw':_0x341077[_0xbe4f('0x1b')]?_0x341077[_0xbe4f('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x341077['options']?_0x341077[_0xbe4f('0x1b')]['where']||null:null,'attributes':_0x341077[_0xbe4f('0x1b')]?_0x341077['options']['attributes']||null:null,'limit':_0x341077[_0xbe4f('0x1b')]?_0x341077['options'][_0xbe4f('0x1e')]||null:null})['then'](function(_0xaae681){logger[_0xbe4f('0x15')](_0xbe4f('0x1f'),_0x341077);logger[_0xbe4f('0xf')](_0xbe4f('0x1f'),_0x341077,JSON[_0xbe4f('0x11')](_0xaae681));_0x102793(_0xaae681);})['catch'](function(_0x30a62b){logger[_0xbe4f('0x12')](_0xbe4f('0x1f'),_0x30a62b[_0xbe4f('0x14')],_0x341077);_0x3a2431(_0x298de8[_0xbe4f('0x12')](0x1f4,_0x30a62b[_0xbe4f('0x14')]));});});}; \ No newline at end of file +var _0x1885=['jayson/promise','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','VoiceDialReport','create','body','options','raw','CreateVoiceDialReport','catch','UpdateVoiceDialReport','update','where','attributes','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x37dd5a,_0x4fc629){var _0x244812=function(_0x46211f){while(--_0x46211f){_0x37dd5a['push'](_0x37dd5a['shift']());}};_0x244812(++_0x4fc629);}(_0x1885,0x183));var _0x5188=function(_0x3daaf7,_0x4de0b4){_0x3daaf7=_0x3daaf7-0x0;var _0x14d95b=_0x1885[_0x3daaf7];return _0x14d95b;};'use strict';var _=require(_0x5188('0x0'));var util=require(_0x5188('0x1'));var moment=require(_0x5188('0x2'));var BPromise=require('bluebird');var rs=require(_0x5188('0x3'));var fs=require('fs');var Redis=require(_0x5188('0x4'));var db=require(_0x5188('0x5'))['db'];var utils=require(_0x5188('0x6'));var logger=require(_0x5188('0x7'))(_0x5188('0x8'));var config=require('../../config/environment');var jayson=require(_0x5188('0x9'));var client=jayson['client'][_0x5188('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x78224a,_0x213632,_0x404cb6){return new BPromise(function(_0x5eaf6c,_0xec449b){return client[_0x5188('0xb')](_0x78224a,_0x404cb6)[_0x5188('0xc')](function(_0x5e309a){logger[_0x5188('0xd')](_0x5188('0xe'),_0x213632,_0x5188('0xf'));logger[_0x5188('0x10')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x213632,_0x5188('0xf'),JSON[_0x5188('0x11')](_0x5e309a));if(_0x5e309a[_0x5188('0x12')]){if(_0x5e309a[_0x5188('0x12')][_0x5188('0x13')]===0x1f4){logger[_0x5188('0x12')](_0x5188('0xe'),_0x213632,_0x5e309a[_0x5188('0x12')]['message']);return _0xec449b(_0x5e309a[_0x5188('0x12')][_0x5188('0x14')]);}logger[_0x5188('0x12')](_0x5188('0xe'),_0x213632,_0x5e309a[_0x5188('0x12')][_0x5188('0x14')]);return _0x5eaf6c(_0x5e309a[_0x5188('0x12')]['message']);}else{logger[_0x5188('0xd')](_0x5188('0xe'),_0x213632,_0x5188('0xf'));_0x5eaf6c(_0x5e309a[_0x5188('0x15')]['message']);}})['catch'](function(_0x131c69){logger[_0x5188('0x12')](_0x5188('0xe'),_0x213632,_0x131c69);_0xec449b(_0x131c69);});});}exports['CreateVoiceDialReport']=function(_0x8faae5){var _0xcc1eec=this;return new Promise(function(_0x487e36,_0x5572a0){return db[_0x5188('0x16')][_0x5188('0x17')](_0x8faae5[_0x5188('0x18')],{'raw':_0x8faae5['options']?_0x8faae5[_0x5188('0x19')][_0x5188('0x1a')]===undefined?!![]:![]:!![]})[_0x5188('0xc')](function(_0xfbbc8d){logger[_0x5188('0xd')](_0x5188('0x1b'),_0x8faae5);logger['debug'](_0x5188('0x1b'),_0x8faae5,JSON[_0x5188('0x11')](_0xfbbc8d));_0x487e36(_0xfbbc8d);})[_0x5188('0x1c')](function(_0x3cfb1e){logger[_0x5188('0x12')](_0x5188('0x1b'),_0x3cfb1e[_0x5188('0x14')],_0x8faae5);_0x5572a0(_0xcc1eec[_0x5188('0x12')](0x1f4,_0x3cfb1e[_0x5188('0x14')]));});});};exports[_0x5188('0x1d')]=function(_0x2854a3){var _0x4e749f=this;return new Promise(function(_0x38b79a,_0x42f7e7){return db[_0x5188('0x16')][_0x5188('0x1e')](_0x2854a3[_0x5188('0x18')],{'raw':_0x2854a3[_0x5188('0x19')]?_0x2854a3[_0x5188('0x19')][_0x5188('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2854a3[_0x5188('0x19')]?_0x2854a3[_0x5188('0x19')][_0x5188('0x1f')]||null:null,'attributes':_0x2854a3[_0x5188('0x19')]?_0x2854a3[_0x5188('0x19')][_0x5188('0x20')]||null:null,'limit':_0x2854a3[_0x5188('0x19')]?_0x2854a3[_0x5188('0x19')]['limit']||null:null})[_0x5188('0xc')](function(_0x34d2ca){logger[_0x5188('0xd')](_0x5188('0x1d'),_0x2854a3);logger[_0x5188('0x10')]('UpdateVoiceDialReport',_0x2854a3,JSON[_0x5188('0x11')](_0x34d2ca));_0x38b79a(_0x34d2ca);})[_0x5188('0x1c')](function(_0x4c3a88){logger[_0x5188('0x12')]('UpdateVoiceDialReport',_0x4c3a88[_0x5188('0x14')],_0x2854a3);_0x42f7e7(_0x4e749f['error'](0x1f4,_0x4c3a88[_0x5188('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index de5c33c..67c1d09 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 _0x7bc1=['post','create','put','update','delete','destroy','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x7bc1,0x16e));var _0x17bc=function(_0x2e776e,_0x158737){_0x2e776e=_0x2e776e-0x0;var _0x33c626=_0x7bc1[_0x2e776e];return _0x33c626;};'use strict';var multer=require(_0x17bc('0x0'));var util=require(_0x17bc('0x1'));var path=require('path');var timeout=require(_0x17bc('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x17bc('0x3'));var interaction=require(_0x17bc('0x4'));var config=require(_0x17bc('0x5'));var controller=require(_0x17bc('0x6'));router[_0x17bc('0x7')]('/',auth[_0x17bc('0x8')](),controller[_0x17bc('0x9')]);router[_0x17bc('0x7')](_0x17bc('0xa'),auth[_0x17bc('0x8')](),controller[_0x17bc('0xb')]);router[_0x17bc('0xc')]('/',auth[_0x17bc('0x8')](),controller[_0x17bc('0xd')]);router[_0x17bc('0xc')]('/:id/applications',auth[_0x17bc('0x8')](),controller['addApplications']);router[_0x17bc('0xe')](_0x17bc('0xa'),auth[_0x17bc('0x8')](),controller[_0x17bc('0xf')]);router[_0x17bc('0x10')](_0x17bc('0xa'),auth[_0x17bc('0x8')](),controller[_0x17bc('0x11')]);module['exports']=router; \ No newline at end of file +var _0x889e=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','isAuthenticated','/:id','show','post','addApplications','put','delete','destroy','exports','util','connect-timeout'];(function(_0x312fca,_0xb8495b){var _0x36ccec=function(_0x1f4eed){while(--_0x1f4eed){_0x312fca['push'](_0x312fca['shift']());}};_0x36ccec(++_0xb8495b);}(_0x889e,0x1eb));var _0xe889=function(_0x30cb05,_0x2c8a67){_0x30cb05=_0x30cb05-0x0;var _0xd9a6e3=_0x889e[_0x30cb05];return _0xd9a6e3;};'use strict';var multer=require('multer');var util=require(_0xe889('0x0'));var path=require('path');var timeout=require(_0xe889('0x1'));var express=require(_0xe889('0x2'));var router=express['Router']();var fs_extra=require(_0xe889('0x3'));var auth=require(_0xe889('0x4'));var interaction=require(_0xe889('0x5'));var config=require(_0xe889('0x6'));var controller=require(_0xe889('0x7'));router['get']('/',auth[_0xe889('0x8')](),controller['index']);router['get'](_0xe889('0x9'),auth[_0xe889('0x8')](),controller[_0xe889('0xa')]);router[_0xe889('0xb')]('/',auth[_0xe889('0x8')](),controller['create']);router[_0xe889('0xb')]('/:id/applications',auth[_0xe889('0x8')](),controller[_0xe889('0xc')]);router[_0xe889('0xd')]('/:id',auth[_0xe889('0x8')](),controller['update']);router[_0xe889('0xe')](_0xe889('0x9'),auth[_0xe889('0x8')](),controller[_0xe889('0xf')]);module[_0xe889('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 4bfea54..89a95fb 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 _0x6115=['sequelize','exports','STRING','compositeIndex','ENUM','inbound','internal','inbound-fax','outbound-fax','system','any','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue'];(function(_0x449fa8,_0x1dba33){var _0x16141c=function(_0x41689d){while(--_0x41689d){_0x449fa8['push'](_0x449fa8['shift']());}};_0x16141c(++_0x1dba33);}(_0x6115,0x80));var _0x5611=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6115[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x5611('0x0'));module[_0x5611('0x1')]={'context':{'type':Sequelize[_0x5611('0x2')],'allowNull':![],'unique':_0x5611('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x5611('0x2')],'allowNull':![],'unique':_0x5611('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x5611('0x3')},'tag':{'type':Sequelize[_0x5611('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x5611('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0x5611('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x5611('0x4')](_0x5611('0x5'),'outbound',_0x5611('0x6'),_0x5611('0x7'),_0x5611('0x8'),_0x5611('0x9'),_0x5611('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x5611('0x2')]},'interval':{'type':Sequelize[_0x5611('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x5611('0xb')]},'isApp':{'type':Sequelize[_0x5611('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x5611('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x5611('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x5611('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x5611('0xb')]},'recordingFormat':{'type':Sequelize[_0x5611('0x2')],'defaultValue':_0x5611('0xd')},'answer':{'type':Sequelize[_0x5611('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x5611('0xe')],'get':function(_0x591f24){return this[_0x5611('0xf')]('exten');}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xde51=['any','*,*,*,*','INTEGER','BOOLEAN','wav','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','inbound-fax','outbound-fax','system'];(function(_0x5c0a44,_0x2874e6){var _0x3fe5b1=function(_0x33e1bd){while(--_0x33e1bd){_0x5c0a44['push'](_0x5c0a44['shift']());}};_0x3fe5b1(++_0x2874e6);}(_0xde51,0x1d6));var _0x1de5=function(_0x2a84d6,_0x538497){_0x2a84d6=_0x2a84d6-0x0;var _0x55c2ea=_0xde51[_0x2a84d6];return _0x55c2ea;};'use strict';var Sequelize=require('sequelize');module[_0x1de5('0x0')]={'context':{'type':Sequelize[_0x1de5('0x1')],'allowNull':![],'unique':_0x1de5('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x1de5('0x1')],'allowNull':![],'unique':_0x1de5('0x2')},'priority':{'type':Sequelize[_0x1de5('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x1de5('0x2')},'tag':{'type':Sequelize[_0x1de5('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x1de5('0x1')],'allowNull':![],'defaultValue':_0x1de5('0x3')},'appdata':{'type':Sequelize[_0x1de5('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x1de5('0x4'),_0x1de5('0x5'),_0x1de5('0x6'),_0x1de5('0x7'),_0x1de5('0x8'),_0x1de5('0x9'),_0x1de5('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x1de5('0x1')]},'interval':{'type':Sequelize[_0x1de5('0x1')],'allowNull':![],'defaultValue':_0x1de5('0xb')},'IntervalId':{'type':Sequelize[_0x1de5('0xc')]},'isApp':{'type':Sequelize[_0x1de5('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x1de5('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x1de5('0x1')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x1de5('0xc')]},'recordingFormat':{'type':Sequelize[_0x1de5('0x1')],'defaultValue':_0x1de5('0xe')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4cfb2b){return this['getDataValue']('exten');}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 1ef46bd..a7fd1e4 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 _0xdbd2=['merge','filter','options','include','findAll','rows','catch','show','params','includeAll','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','OutboundRoutes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat','alias','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','isApp','createRouting','bulkCreate','findAndCountAll','priority','stack','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','destroy','get','InboundRoutes','outbound','InternalRoutes','internal','ignore','map','value','includes','type','find','name','UserProfileResource','then','sendStatus','error','send','index','VoiceExtension','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0xdbd2,0xe8));var _0x2dbd=function(_0x13eaa3,_0x28faba){_0x13eaa3=_0x13eaa3-0x0;var _0x2bdb23=_0xdbd2[_0x13eaa3];return _0x2bdb23;};'use strict';var _=require(_0x2dbd('0x0'));var Redis=require(_0x2dbd('0x1'));var qs=require(_0x2dbd('0x2'));var logger=require(_0x2dbd('0x3'))(_0x2dbd('0x4'));var config=require(_0x2dbd('0x5'));var db=require(_0x2dbd('0x6'))['db'];config[_0x2dbd('0x7')]=_[_0x2dbd('0x8')](config[_0x2dbd('0x7')],{'host':_0x2dbd('0x9'),'port':0x18eb});var socket=require(_0x2dbd('0xa'))(new Redis(config[_0x2dbd('0x7')]));require(_0x2dbd('0xb'))[_0x2dbd('0xc')](socket);function respondWithStatusCode(_0x432ae1,_0x224f4e){_0x224f4e=_0x224f4e||0xcc;return function(_0x290210){if(_0x290210){return _0x432ae1['sendStatus'](_0x224f4e);}return _0x432ae1[_0x2dbd('0xd')](_0x224f4e)[_0x2dbd('0xe')]();};}function respondWithResult(_0x3ec74e,_0x51a495){_0x51a495=_0x51a495||0xc8;return function(_0x31c605){if(_0x31c605){return _0x3ec74e[_0x2dbd('0xd')](_0x51a495)[_0x2dbd('0xf')](_0x31c605);}};}function respondWithFilteredResult(_0xcf9004,_0x5991d7){return function(_0x373658){if(_0x373658){var _0x43f0eb=typeof _0x5991d7[_0x2dbd('0x10')]===_0x2dbd('0x11')&&typeof _0x5991d7[_0x2dbd('0x12')]===_0x2dbd('0x11');var _0x3d140a=_0x373658[_0x2dbd('0x13')];var _0x1b0bc7=_0x43f0eb?0x0:_0x5991d7['offset'];var _0x65ac23=_0x43f0eb?_0x373658[_0x2dbd('0x13')]:_0x5991d7[_0x2dbd('0x10')]+_0x5991d7['limit'];var _0x3c0362;if(_0x65ac23>=_0x3d140a){_0x65ac23=_0x3d140a;_0x3c0362=0xc8;}else{_0x3c0362=0xce;}_0xcf9004[_0x2dbd('0xd')](_0x3c0362);return _0xcf9004['set'](_0x2dbd('0x14'),_0x1b0bc7+'-'+_0x65ac23+'/'+_0x3d140a)['json'](_0x373658);}return null;};}function removeEntity(_0x200b59){return function(_0x1f8997){if(_0x1f8997){return _0x1f8997[_0x2dbd('0x15')]()['then'](function(){var _0x192135=_0x1f8997[_0x2dbd('0x16')]({'plain':!![]});var _0x4d32c7=[{'name':_0x2dbd('0x17'),'value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':_0x2dbd('0x18'),'ignore':![]},{'name':_0x2dbd('0x19'),'value':_0x2dbd('0x1a'),'ignore':![]}];var _0xabe19c=_(_0x4d32c7)['filter'](_0x2dbd('0x1b'))[_0x2dbd('0x1c')](_0x2dbd('0x1d'))[_0x2dbd('0x1d')]();if(_[_0x2dbd('0x1e')](_0xabe19c,_0x192135[_0x2dbd('0x1f')])){return;}var _0xae03d0=_[_0x2dbd('0x20')](_0x4d32c7,[_0x2dbd('0x1d'),_0x192135[_0x2dbd('0x1f')]])[_0x2dbd('0x21')];return db[_0x2dbd('0x22')][_0x2dbd('0x15')]({'where':{'type':_0xae03d0,'resourceId':_0x192135['id']}})[_0x2dbd('0x23')](function(){return _0x1f8997;});})['then'](function(){_0x200b59[_0x2dbd('0xd')](0xcc)[_0x2dbd('0xe')]();});}};}function handleEntityNotFound(_0x19e24f){return function(_0x5edc38){if(!_0x5edc38){_0x19e24f[_0x2dbd('0x24')](0x194);}return _0x5edc38;};}function handleError(_0x25ebbc,_0x4716b6){_0x4716b6=_0x4716b6||0x1f4;return function(_0x1d6fb2){logger[_0x2dbd('0x25')](_0x1d6fb2['stack']);if(_0x1d6fb2[_0x2dbd('0x21')]){delete _0x1d6fb2[_0x2dbd('0x21')];}_0x25ebbc[_0x2dbd('0xd')](_0x4716b6)[_0x2dbd('0x26')](_0x1d6fb2);};}exports[_0x2dbd('0x27')]=function(_0x5a1487,_0x24b87c){var _0xa8896e={},_0x5c2889={},_0x91772a={'count':0x0,'rows':[]};var _0x2fb9f=_[_0x2dbd('0x1c')](db[_0x2dbd('0x28')][_0x2dbd('0x29')],function(_0x2cff14){return{'name':_0x2cff14[_0x2dbd('0x2a')],'type':_0x2cff14['type'][_0x2dbd('0x2b')]};});_0x5c2889['model']=_[_0x2dbd('0x1c')](_0x2fb9f,'name');_0x5c2889[_0x2dbd('0x2c')]=_[_0x2dbd('0x2d')](_0x5a1487[_0x2dbd('0x2c')]);_0x5c2889[_0x2dbd('0x2e')]=_[_0x2dbd('0x2f')](_0x5c2889[_0x2dbd('0x30')],_0x5c2889['query']);_0xa8896e[_0x2dbd('0x31')]=_[_0x2dbd('0x2f')](_0x5c2889[_0x2dbd('0x30')],qs[_0x2dbd('0x32')](_0x5a1487[_0x2dbd('0x2c')]['fields']));_0xa8896e[_0x2dbd('0x31')]=_0xa8896e['attributes']['length']?_0xa8896e['attributes']:_0x5c2889[_0x2dbd('0x30')];if(!_0x5a1487[_0x2dbd('0x2c')][_0x2dbd('0x33')](_0x2dbd('0x34'))){_0xa8896e[_0x2dbd('0x12')]=qs['limit'](_0x5a1487['query']['limit']);_0xa8896e['offset']=qs[_0x2dbd('0x10')](_0x5a1487[_0x2dbd('0x2c')]['offset']);}_0xa8896e['order']=qs[_0x2dbd('0x35')](_0x5a1487[_0x2dbd('0x2c')][_0x2dbd('0x35')]);_0xa8896e[_0x2dbd('0x36')]=qs[_0x2dbd('0x2e')](_[_0x2dbd('0x37')](_0x5a1487['query'],_0x5c2889[_0x2dbd('0x2e')]),_0x2fb9f);if(_0x5a1487[_0x2dbd('0x2c')]['filter']){_0xa8896e[_0x2dbd('0x36')]=_[_0x2dbd('0x38')](_0xa8896e[_0x2dbd('0x36')],{'$or':_[_0x2dbd('0x1c')](_0x2fb9f,function(_0x1ccb2f){if(_0x1ccb2f[_0x2dbd('0x1f')]!=='VIRTUAL'){var _0x6f11ac={};_0x6f11ac[_0x1ccb2f[_0x2dbd('0x21')]]={'$like':'%'+_0x5a1487[_0x2dbd('0x2c')][_0x2dbd('0x39')]+'%'};return _0x6f11ac;}})});}_0xa8896e=_[_0x2dbd('0x38')]({},_0xa8896e,_0x5a1487[_0x2dbd('0x3a')]);var _0x38c92d={'where':_0xa8896e[_0x2dbd('0x36')]};return db[_0x2dbd('0x28')][_0x2dbd('0x13')](_0x38c92d)[_0x2dbd('0x23')](function(_0x380ab3){_0x91772a[_0x2dbd('0x13')]=_0x380ab3;if(_0x5a1487[_0x2dbd('0x2c')]['includeAll']){_0xa8896e[_0x2dbd('0x3b')]=[{'all':!![]}];}return db['VoiceExtension'][_0x2dbd('0x3c')](_0xa8896e);})[_0x2dbd('0x23')](function(_0x778ba0){_0x91772a[_0x2dbd('0x3d')]=_0x778ba0;return _0x91772a;})[_0x2dbd('0x23')](respondWithFilteredResult(_0x24b87c,_0xa8896e))[_0x2dbd('0x3e')](handleError(_0x24b87c,null));};exports[_0x2dbd('0x3f')]=function(_0x1948bc,_0x269ee5){var _0x4b5f63={'raw':![],'where':{'id':_0x1948bc[_0x2dbd('0x40')]['id']}},_0xcb954c={};_0xcb954c['model']=_[_0x2dbd('0x2d')](db['VoiceExtension'][_0x2dbd('0x29')]);_0xcb954c[_0x2dbd('0x2c')]=_[_0x2dbd('0x2d')](_0x1948bc[_0x2dbd('0x2c')]);_0xcb954c[_0x2dbd('0x2e')]=_[_0x2dbd('0x2f')](_0xcb954c[_0x2dbd('0x30')],_0xcb954c[_0x2dbd('0x2c')]);_0x4b5f63[_0x2dbd('0x31')]=_['intersection'](_0xcb954c['model'],qs[_0x2dbd('0x32')](_0x1948bc['query'][_0x2dbd('0x32')]));_0x4b5f63['attributes']=_0x4b5f63[_0x2dbd('0x31')]['length']?_0x4b5f63['attributes']:_0xcb954c[_0x2dbd('0x30')];if(_0x1948bc['query'][_0x2dbd('0x41')]){_0x4b5f63[_0x2dbd('0x3b')]=[{'all':!![]}];}_0x4b5f63=_['merge']({},_0x4b5f63,_0x1948bc[_0x2dbd('0x3a')]);return db[_0x2dbd('0x28')][_0x2dbd('0x20')](_0x4b5f63)[_0x2dbd('0x23')](handleEntityNotFound(_0x269ee5,null))[_0x2dbd('0x23')](respondWithResult(_0x269ee5,null))[_0x2dbd('0x3e')](handleError(_0x269ee5,null));};exports[_0x2dbd('0x15')]=function(_0x18869f,_0x1d5d1d){return db['VoiceExtension']['find']({'where':{'id':_0x18869f[_0x2dbd('0x40')]['id']}})['then'](handleEntityNotFound(_0x1d5d1d,null))[_0x2dbd('0x23')](removeEntity(_0x1d5d1d,null))[_0x2dbd('0x3e')](handleError(_0x1d5d1d,null));};exports[_0x2dbd('0x42')]=function(_0x5b946f,_0x1f44d8){if(_0x5b946f[_0x2dbd('0x43')][_0x2dbd('0x1f')]===_0x2dbd('0x18')&&!_[_0x2dbd('0x44')](_0x5b946f['body'][_0x2dbd('0x45')],'_')){_0x5b946f['body'][_0x2dbd('0x45')]='_'[_0x2dbd('0x46')](_0x5b946f['body'][_0x2dbd('0x45')]);}return db['VoiceExtension']['create'](_0x5b946f[_0x2dbd('0x43')],{'raw':![]})['then'](function(_0x424ab8){var _0x5a42d1=_0x5b946f[_0x2dbd('0x47')][_0x2dbd('0x16')]({'plain':!![]});if(!_0x5a42d1)throw new Error(_0x2dbd('0x48'));if(_0x5a42d1[_0x2dbd('0x49')]==='user'){var _0x420c83=_0x424ab8[_0x2dbd('0x16')]({'plain':!![]});var _0x5e0749=[{'name':_0x2dbd('0x17'),'value':_0x2dbd('0x4a')},{'name':_0x2dbd('0x4b'),'value':_0x2dbd('0x18')},{'name':_0x2dbd('0x19'),'value':_0x2dbd('0x1a')}];var _0x35c1e2=_['find'](_0x5e0749,[_0x2dbd('0x1d'),_0x420c83[_0x2dbd('0x1f')]])['name'];return db['UserProfileSection'][_0x2dbd('0x20')]({'where':{'name':_0x35c1e2,'userProfileId':_0x5a42d1[_0x2dbd('0x4c')]},'raw':!![]})['then'](function(_0x5d7b58){if(_0x5d7b58&&_0x5d7b58[_0x2dbd('0x4d')]===0x0){return db[_0x2dbd('0x22')]['create']({'name':_0x420c83[_0x2dbd('0x21')],'resourceId':_0x420c83['id'],'type':_0x5d7b58[_0x2dbd('0x21')],'sectionId':_0x5d7b58['id']},{})['then'](function(){return _0x424ab8;});}else{return _0x424ab8;}})[_0x2dbd('0x3e')](function(_0x1259bd){logger[_0x2dbd('0x25')](_0x2dbd('0x4e'),_0x1259bd);throw _0x1259bd;});}return _0x424ab8;})[_0x2dbd('0x23')](respondWithResult(_0x1f44d8,0xc9))['catch'](handleError(_0x1f44d8,null));};exports[_0x2dbd('0x4f')]=function(_0x2e4a08,_0xbefa5f){if(_0x2e4a08[_0x2dbd('0x43')]['id']){delete _0x2e4a08[_0x2dbd('0x43')]['id'];}return db[_0x2dbd('0x28')][_0x2dbd('0x20')]({'where':{'id':_0x2e4a08[_0x2dbd('0x40')]['id']}})[_0x2dbd('0x23')](handleEntityNotFound(_0xbefa5f,null))[_0x2dbd('0x23')](function(_0x373479){if(_0x373479){return db[_0x2dbd('0x28')]['update'](_[_0x2dbd('0x37')](_0x2e4a08[_0x2dbd('0x43')],[_0x2dbd('0x45'),_0x2dbd('0x50'),'description',_0x2dbd('0x51'),'cutdigits','mandatoryDisposition',_0x2dbd('0x52')]),{'where':{'context':_0x373479[_0x2dbd('0x50')],'exten':_0x373479[_0x2dbd('0x45')]},'individualHooks':!![]})['then'](function(_0x5ed135){return _0x5ed135;});}return null;})[_0x2dbd('0x23')](respondWithStatusCode(_0xbefa5f,null))['catch'](handleError(_0xbefa5f,null));};exports[_0x2dbd('0x53')]=function(_0x4bf57c,_0x24f3cf){var _0x55cd4b=_0x4bf57c['params']['id'];var _0x21ae18=_0x4bf57c[_0x2dbd('0x43')];var _0x2cf5e0=0xc8;var _0x5a4612=null;return db[_0x2dbd('0x54')]['transaction']({'isolationLevel':db[_0x2dbd('0x54')][_0x2dbd('0x55')][_0x2dbd('0x56')][_0x2dbd('0x57')]},function(_0x568fb4){return db[_0x2dbd('0x28')][_0x2dbd('0x58')]({'where':{'id':_0x55cd4b},'transaction':_0x568fb4})[_0x2dbd('0x23')](function(_0x258567){if(_0x258567){return db[_0x2dbd('0x28')][_0x2dbd('0x15')]({'where':{'VoiceExtensionId':_0x55cd4b},'transaction':_0x568fb4})[_0x2dbd('0x23')](function(){var _0x3cff98=_[_0x2dbd('0x1c')](_0x21ae18,function(_0x2206a5){_0x2206a5['VoiceExtensionId']=_0x55cd4b;_0x2206a5[_0x2dbd('0x59')]=!![];return _0x2206a5;});return _0x258567[_0x2dbd('0x5a')](_0x3cff98);})[_0x2dbd('0x23')](function(_0x49e844){return db[_0x2dbd('0x28')][_0x2dbd('0x5b')](_0x49e844,{'transaction':_0x568fb4});});}else{_0x2cf5e0=0x194;_0x5a4612=[];}});})[_0x2dbd('0x23')](function(){if(_0x2cf5e0!==0x194){return db['VoiceExtension'][_0x2dbd('0x5c')]({'where':{'isApp':!![],'VoiceExtensionId':_0x55cd4b},'order':_0x2dbd('0x5d')})[_0x2dbd('0x23')](function(_0x941f9b){_0x5a4612=_0x941f9b;});}})[_0x2dbd('0x3e')](function(_0x111373){_0x2cf5e0=0x1f4;logger['error'](_0x111373[_0x2dbd('0x5e')]);if(_0x111373[_0x2dbd('0x21')]){delete _0x111373[_0x2dbd('0x21')];}_0x5a4612=_0x111373;})[_0x2dbd('0x5f')](function(){if(_0x5a4612===null){_0x24f3cf[_0x2dbd('0x24')](_0x2cf5e0);}else{if(_0x2cf5e0===0x1f4){_0x24f3cf[_0x2dbd('0xd')](_0x2cf5e0)[_0x2dbd('0x26')](_0x5a4612);}else{_0x24f3cf[_0x2dbd('0xd')](_0x2cf5e0)[_0x2dbd('0xf')](_0x5a4612);}}});}; \ No newline at end of file +var _0x09ba=['startsWith','body','exten','concat','user','role','inbound','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','recordingFormat','alias','context','addApplications','sequelize','Transaction','READ_COMMITTED','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','priority','finally','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','get','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','value','find','type','name','destroy','then','error','stack','send','index','VoiceExtension','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','options','create'];(function(_0x5d31f3,_0x4239b0){var _0x1cc88c=function(_0x1be8fc){while(--_0x1be8fc){_0x5d31f3['push'](_0x5d31f3['shift']());}};_0x1cc88c(++_0x4239b0);}(_0x09ba,0xcf));var _0xa09b=function(_0x5bb736,_0x32c198){_0x5bb736=_0x5bb736-0x0;var _0x483aad=_0x09ba[_0x5bb736];return _0x483aad;};'use strict';var _=require(_0xa09b('0x0'));var Redis=require('ioredis');var qs=require(_0xa09b('0x1'));var logger=require('../../config/logger')(_0xa09b('0x2'));var config=require(_0xa09b('0x3'));var db=require(_0xa09b('0x4'))['db'];config['redis']=_[_0xa09b('0x5')](config[_0xa09b('0x6')],{'host':_0xa09b('0x7'),'port':0x18eb});var socket=require(_0xa09b('0x8'))(new Redis(config[_0xa09b('0x6')]));require(_0xa09b('0x9'))[_0xa09b('0xa')](socket);function respondWithStatusCode(_0xb36eb6,_0x52dc0f){_0x52dc0f=_0x52dc0f||0xcc;return function(_0x195e2a){if(_0x195e2a){return _0xb36eb6[_0xa09b('0xb')](_0x52dc0f);}return _0xb36eb6['status'](_0x52dc0f)[_0xa09b('0xc')]();};}function respondWithResult(_0x5dc646,_0x1e2f41){_0x1e2f41=_0x1e2f41||0xc8;return function(_0x5bf469){if(_0x5bf469){return _0x5dc646[_0xa09b('0xd')](_0x1e2f41)[_0xa09b('0xe')](_0x5bf469);}};}function respondWithFilteredResult(_0x51d50a,_0x2a0e96){return function(_0x38a9d1){if(_0x38a9d1){var _0x256458=typeof _0x2a0e96[_0xa09b('0xf')]==='undefined'&&typeof _0x2a0e96['limit']===_0xa09b('0x10');var _0x304d62=_0x38a9d1['count'];var _0x55bf9b=_0x256458?0x0:_0x2a0e96['offset'];var _0x573a59=_0x256458?_0x38a9d1[_0xa09b('0x11')]:_0x2a0e96[_0xa09b('0xf')]+_0x2a0e96['limit'];var _0x15b302;if(_0x573a59>=_0x304d62){_0x573a59=_0x304d62;_0x15b302=0xc8;}else{_0x15b302=0xce;}_0x51d50a[_0xa09b('0xd')](_0x15b302);return _0x51d50a[_0xa09b('0x12')](_0xa09b('0x13'),_0x55bf9b+'-'+_0x573a59+'/'+_0x304d62)[_0xa09b('0xe')](_0x38a9d1);}return null;};}function removeEntity(_0x50a32a){return function(_0x810368){if(_0x810368){return _0x810368['destroy']()['then'](function(){var _0x3f7ca0=_0x810368[_0xa09b('0x14')]({'plain':!![]});var _0x344739=[{'name':_0xa09b('0x15'),'value':'inbound','ignore':![]},{'name':_0xa09b('0x16'),'value':_0xa09b('0x17'),'ignore':![]},{'name':_0xa09b('0x18'),'value':_0xa09b('0x19'),'ignore':![]}];var _0x3ee38d=_(_0x344739)[_0xa09b('0x1a')](_0xa09b('0x1b'))['map'](_0xa09b('0x1c'))[_0xa09b('0x1c')]();if(_['includes'](_0x3ee38d,_0x3f7ca0['type'])){return;}var _0x4c926d=_[_0xa09b('0x1d')](_0x344739,['value',_0x3f7ca0[_0xa09b('0x1e')]])[_0xa09b('0x1f')];return db['UserProfileResource'][_0xa09b('0x20')]({'where':{'type':_0x4c926d,'resourceId':_0x3f7ca0['id']}})[_0xa09b('0x21')](function(){return _0x810368;});})[_0xa09b('0x21')](function(){_0x50a32a['status'](0xcc)[_0xa09b('0xc')]();});}};}function handleEntityNotFound(_0x5e7689){return function(_0x20f9a3){if(!_0x20f9a3){_0x5e7689['sendStatus'](0x194);}return _0x20f9a3;};}function handleError(_0x376310,_0x4b9cc6){_0x4b9cc6=_0x4b9cc6||0x1f4;return function(_0x223f50){logger[_0xa09b('0x22')](_0x223f50[_0xa09b('0x23')]);if(_0x223f50[_0xa09b('0x1f')]){delete _0x223f50[_0xa09b('0x1f')];}_0x376310[_0xa09b('0xd')](_0x4b9cc6)[_0xa09b('0x24')](_0x223f50);};}exports[_0xa09b('0x25')]=function(_0x57dfca,_0x3f360f){var _0x371671={},_0x34482b={},_0x35a96e={'count':0x0,'rows':[]};var _0x4e9310=_['map'](db[_0xa09b('0x26')][_0xa09b('0x27')],function(_0x4de27e){return{'name':_0x4de27e[_0xa09b('0x28')],'type':_0x4de27e['type']['key']};});_0x34482b[_0xa09b('0x29')]=_[_0xa09b('0x2a')](_0x4e9310,'name');_0x34482b[_0xa09b('0x2b')]=_[_0xa09b('0x2c')](_0x57dfca[_0xa09b('0x2b')]);_0x34482b[_0xa09b('0x2d')]=_[_0xa09b('0x2e')](_0x34482b[_0xa09b('0x29')],_0x34482b[_0xa09b('0x2b')]);_0x371671[_0xa09b('0x2f')]=_[_0xa09b('0x2e')](_0x34482b[_0xa09b('0x29')],qs['fields'](_0x57dfca[_0xa09b('0x2b')][_0xa09b('0x30')]));_0x371671[_0xa09b('0x2f')]=_0x371671[_0xa09b('0x2f')][_0xa09b('0x31')]?_0x371671[_0xa09b('0x2f')]:_0x34482b[_0xa09b('0x29')];if(!_0x57dfca[_0xa09b('0x2b')][_0xa09b('0x32')](_0xa09b('0x33'))){_0x371671[_0xa09b('0x34')]=qs['limit'](_0x57dfca[_0xa09b('0x2b')][_0xa09b('0x34')]);_0x371671['offset']=qs[_0xa09b('0xf')](_0x57dfca[_0xa09b('0x2b')][_0xa09b('0xf')]);}_0x371671[_0xa09b('0x35')]=qs[_0xa09b('0x36')](_0x57dfca[_0xa09b('0x2b')]['sort']);_0x371671['where']=qs[_0xa09b('0x2d')](_['pick'](_0x57dfca['query'],_0x34482b[_0xa09b('0x2d')]),_0x4e9310);if(_0x57dfca['query'][_0xa09b('0x1a')]){_0x371671['where']=_[_0xa09b('0x37')](_0x371671['where'],{'$or':_[_0xa09b('0x2a')](_0x4e9310,function(_0x45f482){if(_0x45f482[_0xa09b('0x1e')]!==_0xa09b('0x38')){var _0x1c8f9b={};_0x1c8f9b[_0x45f482[_0xa09b('0x1f')]]={'$like':'%'+_0x57dfca[_0xa09b('0x2b')][_0xa09b('0x1a')]+'%'};return _0x1c8f9b;}})});}_0x371671=_['merge']({},_0x371671,_0x57dfca['options']);var _0x165a3f={'where':_0x371671['where']};return db[_0xa09b('0x26')][_0xa09b('0x11')](_0x165a3f)['then'](function(_0x36bef1){_0x35a96e[_0xa09b('0x11')]=_0x36bef1;if(_0x57dfca['query']['includeAll']){_0x371671[_0xa09b('0x39')]=[{'all':!![]}];}return db[_0xa09b('0x26')][_0xa09b('0x3a')](_0x371671);})['then'](function(_0x4b6351){_0x35a96e[_0xa09b('0x3b')]=_0x4b6351;return _0x35a96e;})['then'](respondWithFilteredResult(_0x3f360f,_0x371671))[_0xa09b('0x3c')](handleError(_0x3f360f,null));};exports[_0xa09b('0x3d')]=function(_0x254aa3,_0x17ef27){var _0x27acbc={'raw':![],'where':{'id':_0x254aa3[_0xa09b('0x3e')]['id']}},_0x59e9b1={};_0x59e9b1[_0xa09b('0x29')]=_[_0xa09b('0x2c')](db[_0xa09b('0x26')][_0xa09b('0x27')]);_0x59e9b1['query']=_[_0xa09b('0x2c')](_0x254aa3[_0xa09b('0x2b')]);_0x59e9b1[_0xa09b('0x2d')]=_['intersection'](_0x59e9b1['model'],_0x59e9b1[_0xa09b('0x2b')]);_0x27acbc[_0xa09b('0x2f')]=_[_0xa09b('0x2e')](_0x59e9b1[_0xa09b('0x29')],qs['fields'](_0x254aa3[_0xa09b('0x2b')]['fields']));_0x27acbc[_0xa09b('0x2f')]=_0x27acbc['attributes'][_0xa09b('0x31')]?_0x27acbc[_0xa09b('0x2f')]:_0x59e9b1[_0xa09b('0x29')];if(_0x254aa3[_0xa09b('0x2b')][_0xa09b('0x3f')]){_0x27acbc[_0xa09b('0x39')]=[{'all':!![]}];}_0x27acbc=_[_0xa09b('0x37')]({},_0x27acbc,_0x254aa3[_0xa09b('0x40')]);return db[_0xa09b('0x26')][_0xa09b('0x1d')](_0x27acbc)[_0xa09b('0x21')](handleEntityNotFound(_0x17ef27,null))['then'](respondWithResult(_0x17ef27,null))[_0xa09b('0x3c')](handleError(_0x17ef27,null));};exports[_0xa09b('0x20')]=function(_0x316b65,_0x1816f1){return db[_0xa09b('0x26')][_0xa09b('0x1d')]({'where':{'id':_0x316b65[_0xa09b('0x3e')]['id']}})[_0xa09b('0x21')](handleEntityNotFound(_0x1816f1,null))[_0xa09b('0x21')](removeEntity(_0x1816f1,null))[_0xa09b('0x3c')](handleError(_0x1816f1,null));};exports[_0xa09b('0x41')]=function(_0x45f500,_0xfd8b26){if(_0x45f500['body'][_0xa09b('0x1e')]===_0xa09b('0x17')&&!_[_0xa09b('0x42')](_0x45f500[_0xa09b('0x43')]['exten'],'_')){_0x45f500[_0xa09b('0x43')][_0xa09b('0x44')]='_'[_0xa09b('0x45')](_0x45f500[_0xa09b('0x43')][_0xa09b('0x44')]);}return db[_0xa09b('0x26')][_0xa09b('0x41')](_0x45f500[_0xa09b('0x43')],{'raw':![]})['then'](function(_0x4997fe){var _0x2c4344=_0x45f500[_0xa09b('0x46')][_0xa09b('0x14')]({'plain':!![]});if(!_0x2c4344)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c4344[_0xa09b('0x47')]==='user'){var _0x935c7e=_0x4997fe[_0xa09b('0x14')]({'plain':!![]});var _0x288e52=[{'name':_0xa09b('0x15'),'value':_0xa09b('0x48')},{'name':_0xa09b('0x16'),'value':'outbound'},{'name':_0xa09b('0x18'),'value':_0xa09b('0x19')}];var _0x104491=_[_0xa09b('0x1d')](_0x288e52,[_0xa09b('0x1c'),_0x935c7e[_0xa09b('0x1e')]])[_0xa09b('0x1f')];return db['UserProfileSection'][_0xa09b('0x1d')]({'where':{'name':_0x104491,'userProfileId':_0x2c4344[_0xa09b('0x49')]},'raw':!![]})[_0xa09b('0x21')](function(_0x576b6f){if(_0x576b6f&&_0x576b6f['autoAssociation']===0x0){return db[_0xa09b('0x4a')][_0xa09b('0x41')]({'name':_0x935c7e[_0xa09b('0x1f')],'resourceId':_0x935c7e['id'],'type':_0x576b6f[_0xa09b('0x1f')],'sectionId':_0x576b6f['id']},{})[_0xa09b('0x21')](function(){return _0x4997fe;});}else{return _0x4997fe;}})['catch'](function(_0x23b804){logger['error'](_0xa09b('0x4b'),_0x23b804);throw _0x23b804;});}return _0x4997fe;})[_0xa09b('0x21')](respondWithResult(_0xfd8b26,0xc9))['catch'](handleError(_0xfd8b26,null));};exports[_0xa09b('0x4c')]=function(_0x16c18a,_0x39198a){if(_0x16c18a[_0xa09b('0x43')]['id']){delete _0x16c18a[_0xa09b('0x43')]['id'];}return db[_0xa09b('0x26')][_0xa09b('0x1d')]({'where':{'id':_0x16c18a[_0xa09b('0x3e')]['id']}})[_0xa09b('0x21')](handleEntityNotFound(_0x39198a,null))['then'](function(_0x4349d4){if(_0x4349d4){return db[_0xa09b('0x26')]['update'](_['pick'](_0x16c18a[_0xa09b('0x43')],[_0xa09b('0x44'),'context','description',_0xa09b('0x4d'),'cutdigits','mandatoryDisposition',_0xa09b('0x4e')]),{'where':{'context':_0x4349d4[_0xa09b('0x4f')],'exten':_0x4349d4['exten']},'individualHooks':!![]})[_0xa09b('0x21')](function(_0x267a87){return _0x267a87;});}return null;})[_0xa09b('0x21')](respondWithStatusCode(_0x39198a,null))[_0xa09b('0x3c')](handleError(_0x39198a,null));};exports[_0xa09b('0x50')]=function(_0x3b85fb,_0x552d03){var _0x3b5da3=_0x3b85fb[_0xa09b('0x3e')]['id'];var _0x33ccf0=_0x3b85fb[_0xa09b('0x43')];var _0x4905bc=0xc8;var _0x3cf7df=null;return db[_0xa09b('0x51')]['transaction']({'isolationLevel':db['sequelize'][_0xa09b('0x52')]['ISOLATION_LEVELS'][_0xa09b('0x53')]},function(_0x4e1c74){return db['VoiceExtension']['findOne']({'where':{'id':_0x3b5da3},'transaction':_0x4e1c74})[_0xa09b('0x21')](function(_0x53b7c0){if(_0x53b7c0){return db[_0xa09b('0x26')][_0xa09b('0x20')]({'where':{'VoiceExtensionId':_0x3b5da3},'transaction':_0x4e1c74})[_0xa09b('0x21')](function(){var _0x51c937=_[_0xa09b('0x2a')](_0x33ccf0,function(_0x2b590a){_0x2b590a[_0xa09b('0x54')]=_0x3b5da3;_0x2b590a[_0xa09b('0x55')]=!![];return _0x2b590a;});return _0x53b7c0[_0xa09b('0x56')](_0x51c937);})[_0xa09b('0x21')](function(_0x21ff5c){return db[_0xa09b('0x26')][_0xa09b('0x57')](_0x21ff5c,{'transaction':_0x4e1c74});});}else{_0x4905bc=0x194;_0x3cf7df=[];}});})[_0xa09b('0x21')](function(){if(_0x4905bc!==0x194){return db['VoiceExtension'][_0xa09b('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x3b5da3},'order':_0xa09b('0x59')})[_0xa09b('0x21')](function(_0x29db11){_0x3cf7df=_0x29db11;});}})[_0xa09b('0x3c')](function(_0x435a63){_0x4905bc=0x1f4;logger[_0xa09b('0x22')](_0x435a63[_0xa09b('0x23')]);if(_0x435a63['name']){delete _0x435a63[_0xa09b('0x1f')];}_0x3cf7df=_0x435a63;})[_0xa09b('0x5a')](function(){if(_0x3cf7df===null){_0x552d03[_0xa09b('0xb')](_0x4905bc);}else{if(_0x4905bc===0x1f4){_0x552d03[_0xa09b('0xd')](_0x4905bc)[_0xa09b('0x24')](_0x3cf7df);}else{_0x552d03[_0xa09b('0xd')](_0x4905bc)[_0xa09b('0xe')](_0x3cf7df);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index e2ed298..4f39307 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 _0x9050=['../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit','exports','events'];(function(_0x536844,_0x65851b){var _0x100bca=function(_0x48afa6){while(--_0x48afa6){_0x536844['push'](_0x536844['shift']());}};_0x100bca(++_0x65851b);}(_0x9050,0x1dc));var _0x0905=function(_0x4425b9,_0x20ab5c){_0x4425b9=_0x4425b9-0x0;var _0x46640f=_0x9050[_0x4425b9];return _0x46640f;};'use strict';var EventEmitter=require(_0x0905('0x0'));var VoiceExtension=require(_0x0905('0x1'))['db'][_0x0905('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x0905('0x3')](0x0);var events={'afterCreate':_0x0905('0x4'),'afterUpdate':_0x0905('0x5'),'afterDestroy':_0x0905('0x6')};function emitEvent(_0x299944){return function(_0x260330,_0x37d56c,_0x52e3a9){VoiceExtensionEvents[_0x0905('0x7')](_0x299944+':'+_0x260330['id'],_0x260330);VoiceExtensionEvents[_0x0905('0x7')](_0x299944,_0x260330);_0x52e3a9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x0905('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0x4a2a=['exports','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit'];(function(_0x481f4d,_0x3e1188){var _0x4e7f9e=function(_0x4176b0){while(--_0x4176b0){_0x481f4d['push'](_0x481f4d['shift']());}};_0x4e7f9e(++_0x3e1188);}(_0x4a2a,0x111));var _0xa4a2=function(_0x586629,_0x3d2073){_0x586629=_0x586629-0x0;var _0x101f8b=_0x4a2a[_0x586629];return _0x101f8b;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xa4a2('0x0'))['db'][_0xa4a2('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xa4a2('0x2')](0x0);var events={'afterCreate':_0xa4a2('0x3'),'afterUpdate':_0xa4a2('0x4'),'afterDestroy':_0xa4a2('0x5')};function emitEvent(_0x3013b7){return function(_0x1ba54a,_0x1350db,_0x1e6e18){VoiceExtensionEvents['emit'](_0x3013b7+':'+_0x1ba54a['id'],_0x1ba54a);VoiceExtensionEvents[_0xa4a2('0x6')](_0x3013b7,_0x1ba54a);_0x1e6e18(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xa4a2('0x7')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index e4d0048..deb96c1 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 _0xd90b=['interval','IntervalId','then','*,*,*,*','intervals','filter','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','playback','includes','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','ExecIf','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice',',${EXTEN},','outboundDial','appdata','last','priority','concat','define','VoiceExtension','get','Hangup','lodash','type','Set','CDR(type)=','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','context','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','cutdigits','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','options','split','length','name','trunk','param','phone','prefix','SIP','join','U(xcally-mixmonitor-context)','replace','findAll'];(function(_0x2b73e0,_0x3c09f2){var _0x1906a8=function(_0x22b9d6){while(--_0x22b9d6){_0x2b73e0['push'](_0x2b73e0['shift']());}};_0x1906a8(++_0x3c09f2);}(_0xd90b,0xbd));var _0xbd90=function(_0xab0e02,_0x28b4ea){_0xab0e02=_0xab0e02-0x0;var _0x5a1fe9=_0xd90b[_0xab0e02];return _0x5a1fe9;};'use strict';var _=require(_0xbd90('0x0'));var attributes=require('./voiceExtension.attributes');module['exports']=function(_0x2f8d43){var _0x5a9a50=_0x2f8d43['models'];function _0x40bb8c(_0x4a2e40){var _0x3d994c=0x2;var _0x1813c7=[{'type':_0x4a2e40[_0xbd90('0x1')],'app':_0xbd90('0x2'),'appdata':_0xbd90('0x3')+_0x4a2e40[_0xbd90('0x1')],'context':_0x4a2e40['context'],'exten':_0x4a2e40[_0xbd90('0x4')],'priority':_0x3d994c++,'VoiceExtensionId':_0x4a2e40['id']},{'type':_0x4a2e40[_0xbd90('0x1')],'app':_0x4a2e40[_0xbd90('0x5')]?_0xbd90('0x2'):_0xbd90('0x6'),'appdata':_0x4a2e40[_0xbd90('0x5')]?_0xbd90('0x7')+_0x4a2e40[_0xbd90('0x5')]:_0xbd90('0x8'),'context':_0x4a2e40[_0xbd90('0x9')],'exten':_0x4a2e40[_0xbd90('0x4')],'priority':_0x3d994c++,'VoiceExtensionId':_0x4a2e40['id']}];if(_0x4a2e40['type']===_0xbd90('0xa')){_0x1813c7[_0xbd90('0xb')]({'type':'inbound','app':'Set','appdata':_0xbd90('0xc')+_0x4a2e40['id'],'context':_0x4a2e40[_0xbd90('0x9')],'exten':_0x4a2e40[_0xbd90('0x4')],'priority':_0x3d994c++,'VoiceExtensionId':_0x4a2e40['id']});}_0x1813c7[_0xbd90('0xb')]({'type':_0x4a2e40['type'],'app':_0xbd90('0x2'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x4a2e40['context'],'exten':_0x4a2e40['exten'],'priority':_0x3d994c++,'VoiceExtensionId':_0x4a2e40['id']},{'type':_0x4a2e40[_0xbd90('0x1')],'app':_0xbd90('0x2'),'appdata':_0xbd90('0xd'),'context':_0x4a2e40[_0xbd90('0x9')],'exten':_0x4a2e40[_0xbd90('0x4')],'priority':_0x3d994c++,'VoiceExtensionId':_0x4a2e40['id']},{'type':_0x4a2e40[_0xbd90('0x1')],'app':'Set','appdata':_0xbd90('0xe'),'context':_0x4a2e40[_0xbd90('0x9')],'exten':_0x4a2e40['exten'],'priority':_0x3d994c++,'VoiceExtensionId':_0x4a2e40['id']});return _0x1813c7;}function _0x172871(_0x396b50){var _0x2f1e13=0x2;var _0x516f4b=[{'type':_0xbd90('0xf'),'app':_0xbd90('0x2'),'appdata':_0xbd90('0x10'),'context':_0x396b50[_0xbd90('0x9')],'exten':_0x396b50['exten'],'priority':_0x2f1e13++,'VoiceExtensionId':_0x396b50['id']},{'type':'outbound','app':_0x396b50[_0xbd90('0x5')]?'Set':_0xbd90('0x6'),'appdata':_0x396b50[_0xbd90('0x5')]?_0xbd90('0x7')+_0x396b50[_0xbd90('0x5')]:_0xbd90('0x8'),'context':_0x396b50[_0xbd90('0x9')],'exten':_0x396b50[_0xbd90('0x4')],'priority':_0x2f1e13++,'VoiceExtensionId':_0x396b50['id']},{'type':'outbound','app':'Set','appdata':_0xbd90('0x11')+(_0x396b50['cutdigits']?_0xbd90('0x12')+_0x396b50['cutdigits']+'}':_0xbd90('0x13')),'context':_0x396b50['context'],'exten':_0x396b50['exten'],'priority':_0x2f1e13++,'VoiceExtensionId':_0x396b50['id']},{'type':'outbound','app':_0xbd90('0x2'),'appdata':_0xbd90('0xc')+_0x396b50['id'],'context':_0x396b50['context'],'exten':_0x396b50['exten'],'priority':_0x2f1e13++,'VoiceExtensionId':_0x396b50['id']},{'type':_0xbd90('0xf'),'app':'ExecIf','appdata':_0xbd90('0x14')+(_0x2f1e13+0x2)+_0xbd90('0x15')+(_0x2f1e13+0x1)+')','context':_0x396b50['context'],'exten':_0x396b50[_0xbd90('0x4')],'priority':_0x2f1e13++,'VoiceExtensionId':_0x396b50['id']},{'type':_0xbd90('0xf'),'app':_0xbd90('0x2'),'appdata':_0x396b50[_0xbd90('0x16')]?_0xbd90('0x17')+_0x396b50[_0xbd90('0x16')]+'}':_0xbd90('0x18'),'context':_0x396b50[_0xbd90('0x9')],'exten':_0x396b50[_0xbd90('0x4')],'priority':_0x2f1e13++,'VoiceExtensionId':_0x396b50['id']},{'type':_0xbd90('0xf'),'app':_0xbd90('0x2'),'appdata':_0xbd90('0x19'),'context':_0x396b50[_0xbd90('0x9')],'exten':_0x396b50[_0xbd90('0x4')],'priority':_0x2f1e13++,'VoiceExtensionId':_0x396b50['id']},{'type':_0xbd90('0xf'),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x396b50['context'],'exten':_0x396b50['exten'],'priority':_0x2f1e13++,'VoiceExtensionId':_0x396b50['id']},{'type':_0xbd90('0xf'),'app':_0xbd90('0x2'),'appdata':'MONITOR_OPTIONS=ab','context':_0x396b50[_0xbd90('0x9')],'exten':_0x396b50[_0xbd90('0x4')],'priority':_0x2f1e13++,'VoiceExtensionId':_0x396b50['id']},{'type':_0xbd90('0xf'),'app':'Set','appdata':'outboundrouteid='+_0x396b50['id'],'context':_0x396b50[_0xbd90('0x9')],'exten':_0x396b50[_0xbd90('0x4')],'priority':_0x2f1e13++,'VoiceExtensionId':_0x396b50['id']}];if(_0x396b50[_0xbd90('0x1a')]('recordingFormat')&&_0x396b50[_0xbd90('0x1b')]!==_0xbd90('0x1c')){_0x516f4b[_0xbd90('0xb')]({'type':_0xbd90('0xf'),'app':_0xbd90('0x2'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x396b50[_0xbd90('0x9')],'exten':_0x396b50[_0xbd90('0x4')],'priority':_0x2f1e13++,'VoiceExtensionId':_0x396b50['id']},{'type':_0xbd90('0xf'),'app':_0xbd90('0x2'),'appdata':_0xbd90('0x1d')+_0x396b50['recordingFormat']||_0xbd90('0x1e'),'context':_0x396b50[_0xbd90('0x9')],'exten':_0x396b50[_0xbd90('0x4')],'priority':_0x2f1e13++,'VoiceExtensionId':_0x396b50['id']});}return _0x516f4b;}function _0x379156(_0x97b43e,_0x3f01d3){var _0x328bff=[{'name':'trunk','param':0x0},{'name':_0xbd90('0x1f'),'param':0x1},{'name':_0xbd90('0x20'),'param':0x2},{'name':'url','param':0x3}];var _0x58af7f={};var _0x3c3e75=_0x3f01d3[_0xbd90('0x21')](',');var _0x57973f=[];for(var _0x2bde49=0x0;_0x2bde49<_0x328bff[_0xbd90('0x22')];_0x2bde49++){switch(_0x328bff[_0x2bde49][_0xbd90('0x23')]){case _0xbd90('0x24'):_0x58af7f[_0xbd90('0x24')]=_0x3c3e75[_0x328bff[_0x2bde49][_0xbd90('0x25')]][_0xbd90('0x21')]('/')[0x1];_0x58af7f[_0xbd90('0x26')]=_0x3c3e75[_0x328bff[_0x2bde49][_0xbd90('0x25')]][_0xbd90('0x21')]('/')[0x2];_0x58af7f[_0xbd90('0x27')]=_0x58af7f[_0xbd90('0x26')]?_0x58af7f[_0xbd90('0x26')][_0xbd90('0x21')]('$')[0x0]:undefined;_0x58af7f[_0xbd90('0x26')]=_0x97b43e[_0xbd90('0x16')]?(_0x58af7f[_0xbd90('0x27')]||'')+_0xbd90('0x12')+_0x97b43e['cutdigits']+'}':(_0x58af7f[_0xbd90('0x27')]||'')+'${EXTEN}';_0x57973f[_0x328bff[_0x2bde49][_0xbd90('0x25')]]=[_0xbd90('0x28'),_0x58af7f['trunk'],_0x58af7f['phone']][_0xbd90('0x29')]('/');break;case _0xbd90('0x20'):_0x58af7f[_0xbd90('0x20')]=_0x3c3e75[_0x328bff[_0x2bde49][_0xbd90('0x25')]];if(_0x97b43e['recordingFormat']!==_0xbd90('0x1c')){if(_0x58af7f[_0xbd90('0x20')]['indexOf'](_0xbd90('0x2a'))<0x0){_0x58af7f[_0xbd90('0x20')]+='U(xcally-mixmonitor-context)';}}else{_0x58af7f['options']=_0x58af7f['options'][_0xbd90('0x2b')](_0xbd90('0x2a'),'');}_0x57973f[_0x328bff[_0x2bde49][_0xbd90('0x25')]]=_0x58af7f[_0xbd90('0x20')];break;default:_0x57973f[_0x328bff[_0x2bde49][_0xbd90('0x25')]]=_0x3c3e75[_0x328bff[_0x2bde49][_0xbd90('0x25')]];}}return _0x57973f[_0xbd90('0x29')](',');}function _0x38d4cc(_0x55b20b,_0x1d7ab1,_0x3ccfe9){return new Promise(function(_0x101da7,_0x4be952){var _0x4ea963=[];if(_['isEmpty'](_0x1d7ab1))return _0x101da7(_0x4ea963);_0x5a9a50['Interval'][_0xbd90('0x2c')]({'attributes':['id',_0xbd90('0x2d'),_0xbd90('0x2e')],'raw':!![]})[_0xbd90('0x2f')](function(_0x1cc904){for(var _0x572d83=0x0,_0xff8bc0=0x0;_0x572d83<_0x1d7ab1[_0xbd90('0x22')];_0x572d83++,_0xff8bc0=0x0){var _0x1c3ede=_0x1d7ab1[_0x572d83];var _0x1cf02a=[];var _0x31e0fe=[];delete _0x1c3ede['id'];if(_0x1c3ede[_0xbd90('0x2d')]!==_0xbd90('0x30')){_0x1c3ede[_0xbd90('0x31')]=[_0x1c3ede[_0xbd90('0x2d')]];}else{_0x1c3ede[_0xbd90('0x31')]=_0x1c3ede[_0xbd90('0x2e')]?_['map'](_[_0xbd90('0x32')](_0x1cc904,{'IntervalId':_0x1c3ede[_0xbd90('0x2e')]}),_0xbd90('0x2d')):[];}_0x1c3ede[_0xbd90('0x9')]=_0x55b20b[_0xbd90('0x9')];_0x1c3ede['exten']=_0x55b20b[_0xbd90('0x4')];if(_0x1c3ede[_0xbd90('0x1')])_0x1c3ede[_0xbd90('0x1')]=_0x1c3ede[_0xbd90('0x1')]['toLowerCase']();if(_0x55b20b[_0xbd90('0x1')]===_0xbd90('0xf')){if(_0x1c3ede[_0xbd90('0x1a')](_0xbd90('0x33'))&&_0x1c3ede[_0xbd90('0x33')]&&_0x1c3ede[_0xbd90('0x33')]!=='--'){_0x1cf02a[_0xbd90('0xb')]({'type':_0x1c3ede['type'][_0xbd90('0x34')](),'app':'Set','appdata':_0xbd90('0x35')+_0x1c3ede[_0xbd90('0x33')],'context':_0x55b20b[_0xbd90('0x9')],'exten':_0x55b20b[_0xbd90('0x4')],'priority':_0x1c3ede[_0xbd90('0x31')][_0xbd90('0x22')]+_0x3ccfe9+_0xff8bc0++,'VoiceExtensionId':_0x55b20b['id']});}_0x1cf02a[_0xbd90('0xb')]({'type':_0x1c3ede[_0xbd90('0x1')][_0xbd90('0x34')](),'app':'ExecIf','appdata':_0xbd90('0x36')+(_0x1c3ede[_0xbd90('0x37')]?_0xbd90('0x38')+_0x1c3ede['callerID']+')':_0xbd90('0x39')),'context':_0x55b20b['context'],'exten':_0x55b20b[_0xbd90('0x4')],'priority':_0x1c3ede[_0xbd90('0x31')][_0xbd90('0x22')]+_0x3ccfe9+_0xff8bc0++,'VoiceExtensionId':_0x55b20b['id']});}else{if(_0x1c3ede[_0xbd90('0x1a')](_0xbd90('0x3a'))){if(['queue',_0xbd90('0x3b')][_0xbd90('0x3c')](_0x1c3ede['app'][_0xbd90('0x34')]())&&_0x1c3ede[_0xbd90('0x3d')]!==_0xbd90('0x3e')){if(_0x1c3ede[_0xbd90('0x3a')]){_0x1cf02a['push']({'type':_0x1c3ede[_0xbd90('0x1')]['toLowerCase'](),'app':'ExecIf','appdata':_0xbd90('0x3f'),'context':_0x55b20b[_0xbd90('0x9')],'exten':_0x55b20b[_0xbd90('0x4')],'priority':_0x1c3ede[_0xbd90('0x31')][_0xbd90('0x22')]+_0x3ccfe9+_0xff8bc0++,'VoiceExtensionId':_0x55b20b['id']});_0x1cf02a[_0xbd90('0xb')]({'type':_0x1c3ede[_0xbd90('0x1')]['toLowerCase'](),'app':_0xbd90('0x2'),'appdata':_0xbd90('0x40'),'context':_0x55b20b[_0xbd90('0x9')],'exten':_0x55b20b['exten'],'priority':_0x1c3ede[_0xbd90('0x31')][_0xbd90('0x22')]+_0x3ccfe9+_0xff8bc0++,'VoiceExtensionId':_0x55b20b['id']});}else{_0x1cf02a[_0xbd90('0xb')]({'type':_0x1c3ede[_0xbd90('0x1')]['toLowerCase'](),'app':_0xbd90('0x41'),'appdata':_0xbd90('0x42'),'context':_0x55b20b['context'],'exten':_0x55b20b[_0xbd90('0x4')],'priority':_0x1c3ede[_0xbd90('0x31')][_0xbd90('0x22')]+_0x3ccfe9+_0xff8bc0++,'VoiceExtensionId':_0x55b20b['id']});_0x1cf02a[_0xbd90('0xb')]({'type':_0x1c3ede[_0xbd90('0x1')]['toLowerCase'](),'app':_0xbd90('0x2'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x55b20b[_0xbd90('0x9')],'exten':_0x55b20b[_0xbd90('0x4')],'priority':_0x1c3ede['intervals'][_0xbd90('0x22')]+_0x3ccfe9+_0xff8bc0++,'VoiceExtensionId':_0x55b20b['id']});}}}}for(var _0xec5387=0x0;_0xec5387<_0x1c3ede[_0xbd90('0x31')][_0xbd90('0x22')];_0xec5387++){var _0x49b069=_0x3ccfe9+_0x1c3ede['intervals'][_0xbd90('0x22')];var _0x53354f=_0xec5387===_0x1c3ede['intervals'][_0xbd90('0x22')]-0x1?_0x3ccfe9+_0x1cf02a[_0xbd90('0x22')]+_0x31e0fe[_0xbd90('0x22')]+0x2:_0x3ccfe9+_0xec5387+0x1;_0x1cf02a[_0xbd90('0x43')](_0xec5387,0x0,{'type':_0x55b20b[_0xbd90('0x1')],'app':'GotoIfTime','appdata':_0x1c3ede[_0xbd90('0x31')][_0xec5387]+'?'+_0x55b20b[_0xbd90('0x9')]+_0xbd90('0x44')+_0x49b069+':'+_0x55b20b[_0xbd90('0x9')]+_0xbd90('0x44')+_0x53354f,'exten':_0x55b20b[_0xbd90('0x4')],'context':_0x55b20b['context'],'priority':_0x3ccfe9+_0xec5387,'VoiceExtensionId':_0x55b20b['id']});}if(_0x1c3ede['appType']===_0xbd90('0x45'))_0x1c3ede[_0xbd90('0x46')]=_0x379156(_0x55b20b,_0x1c3ede['appdata']);_0x1c3ede['priority']=_0x1cf02a[_0xbd90('0x22')]?_[_0xbd90('0x47')](_0x1cf02a)[_0xbd90('0x48')]+0x1:_0x3ccfe9;_0x4ea963=_[_0xbd90('0x49')](_0x4ea963,_0x1cf02a,[_0x1c3ede],_0x31e0fe);_0x3ccfe9=_[_0xbd90('0x47')](_0x4ea963)['priority']+0x1;}return _0x101da7(_0x4ea963);})['catch'](function(_0x1cbed5){_0x4be952(_0x1cbed5);});});}return _0x2f8d43[_0xbd90('0x4a')](_0xbd90('0x4b'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x572089){var _0x87656b=this[_0xbd90('0x4c')]({'plain':!![]});var _0x4b17e8=_0x87656b['type']===_0xbd90('0xf')?_0x172871(_0x87656b):_0x40bb8c(_0x87656b);return _0x38d4cc(_0x87656b,_0x572089,_['last'](_0x4b17e8)[_0xbd90('0x48')]+0x1)['then'](function(_0x21c91c){var _0x5820bb=_[_0xbd90('0x49')](_0x4b17e8,_0x21c91c);_0x5820bb[_0xbd90('0xb')]({'type':_0x87656b[_0xbd90('0x1')],'app':_0xbd90('0x4d'),'exten':_0x87656b[_0xbd90('0x4')],'context':_0x87656b['context'],'priority':_[_0xbd90('0x47')](_0x5820bb)[_0xbd90('0x48')]+0x1,'VoiceExtensionId':_0x87656b['id']});return _0x5820bb;});}}});}; \ No newline at end of file +var _0xf380=['playback','includes','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','catch','define','VoiceExtension','voice_extensions','get','concat','Hangup','./voiceExtension.attributes','models','type','Set','CDR(type)=','exten','alias','context','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','NoOp','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','url','length','phone','prefix','split','SIP','join','options','param','U(xcally-mixmonitor-context)','replace','isEmpty','findAll','IntervalId','then','interval','intervals','map','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xf380,0xb9));var _0x0f38=function(_0x2ff752,_0x36ca9b){_0x2ff752=_0x2ff752-0x0;var _0xb3472e=_0xf380[_0x2ff752];return _0xb3472e;};'use strict';var _=require('lodash');var attributes=require(_0x0f38('0x0'));module['exports']=function(_0x45c305){var _0x5ce271=_0x45c305[_0x0f38('0x1')];function _0x1c3fba(_0x3bb0e3){var _0x38db31=0x2;var _0x2ad344=[{'type':_0x3bb0e3[_0x0f38('0x2')],'app':_0x0f38('0x3'),'appdata':_0x0f38('0x4')+_0x3bb0e3[_0x0f38('0x2')],'context':_0x3bb0e3['context'],'exten':_0x3bb0e3[_0x0f38('0x5')],'priority':_0x38db31++,'VoiceExtensionId':_0x3bb0e3['id']},{'type':_0x3bb0e3[_0x0f38('0x2')],'app':_0x3bb0e3[_0x0f38('0x6')]?_0x0f38('0x3'):'NoOp','appdata':_0x3bb0e3[_0x0f38('0x6')]?'CDR(routeAlias)='+_0x3bb0e3[_0x0f38('0x6')]:'No\x20alias\x20set','context':_0x3bb0e3[_0x0f38('0x7')],'exten':_0x3bb0e3[_0x0f38('0x5')],'priority':_0x38db31++,'VoiceExtensionId':_0x3bb0e3['id']}];if(_0x3bb0e3[_0x0f38('0x2')]===_0x0f38('0x8')){_0x2ad344[_0x0f38('0x9')]({'type':_0x0f38('0x8'),'app':_0x0f38('0x3'),'appdata':_0x0f38('0xa')+_0x3bb0e3['id'],'context':_0x3bb0e3[_0x0f38('0x7')],'exten':_0x3bb0e3['exten'],'priority':_0x38db31++,'VoiceExtensionId':_0x3bb0e3['id']});}_0x2ad344[_0x0f38('0x9')]({'type':_0x3bb0e3[_0x0f38('0x2')],'app':_0x0f38('0x3'),'appdata':_0x0f38('0xb'),'context':_0x3bb0e3['context'],'exten':_0x3bb0e3[_0x0f38('0x5')],'priority':_0x38db31++,'VoiceExtensionId':_0x3bb0e3['id']},{'type':_0x3bb0e3[_0x0f38('0x2')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x3bb0e3[_0x0f38('0x7')],'exten':_0x3bb0e3[_0x0f38('0x5')],'priority':_0x38db31++,'VoiceExtensionId':_0x3bb0e3['id']},{'type':_0x3bb0e3[_0x0f38('0x2')],'app':_0x0f38('0x3'),'appdata':_0x0f38('0xc'),'context':_0x3bb0e3[_0x0f38('0x7')],'exten':_0x3bb0e3[_0x0f38('0x5')],'priority':_0x38db31++,'VoiceExtensionId':_0x3bb0e3['id']});return _0x2ad344;}function _0x24dd33(_0x5c1c5d){var _0x23ec13=0x2;var _0xe27f6=[{'type':_0x0f38('0xd'),'app':'Set','appdata':_0x0f38('0xe'),'context':_0x5c1c5d[_0x0f38('0x7')],'exten':_0x5c1c5d[_0x0f38('0x5')],'priority':_0x23ec13++,'VoiceExtensionId':_0x5c1c5d['id']},{'type':_0x0f38('0xd'),'app':_0x5c1c5d[_0x0f38('0x6')]?_0x0f38('0x3'):_0x0f38('0xf'),'appdata':_0x5c1c5d['alias']?'CDR(routeAlias)='+_0x5c1c5d[_0x0f38('0x6')]:'No\x20alias\x20set','context':_0x5c1c5d[_0x0f38('0x7')],'exten':_0x5c1c5d[_0x0f38('0x5')],'priority':_0x23ec13++,'VoiceExtensionId':_0x5c1c5d['id']},{'type':_0x0f38('0xd'),'app':_0x0f38('0x3'),'appdata':_0x0f38('0x10')+(_0x5c1c5d['cutdigits']?_0x0f38('0x11')+_0x5c1c5d[_0x0f38('0x12')]+'}':_0x0f38('0x13')),'context':_0x5c1c5d[_0x0f38('0x7')],'exten':_0x5c1c5d['exten'],'priority':_0x23ec13++,'VoiceExtensionId':_0x5c1c5d['id']},{'type':_0x0f38('0xd'),'app':_0x0f38('0x3'),'appdata':_0x0f38('0xa')+_0x5c1c5d['id'],'context':_0x5c1c5d[_0x0f38('0x7')],'exten':_0x5c1c5d[_0x0f38('0x5')],'priority':_0x23ec13++,'VoiceExtensionId':_0x5c1c5d['id']},{'type':_0x0f38('0xd'),'app':_0x0f38('0x14'),'appdata':_0x0f38('0x15')+(_0x23ec13+0x2)+_0x0f38('0x16')+(_0x23ec13+0x1)+')','context':_0x5c1c5d[_0x0f38('0x7')],'exten':_0x5c1c5d[_0x0f38('0x5')],'priority':_0x23ec13++,'VoiceExtensionId':_0x5c1c5d['id']},{'type':_0x0f38('0xd'),'app':_0x0f38('0x3'),'appdata':_0x5c1c5d[_0x0f38('0x12')]?'CDR(prefix)=${EXTEN:0:'+_0x5c1c5d[_0x0f38('0x12')]+'}':_0x0f38('0x17'),'context':_0x5c1c5d[_0x0f38('0x7')],'exten':_0x5c1c5d[_0x0f38('0x5')],'priority':_0x23ec13++,'VoiceExtensionId':_0x5c1c5d['id']},{'type':_0x0f38('0xd'),'app':'Set','appdata':_0x0f38('0xb'),'context':_0x5c1c5d[_0x0f38('0x7')],'exten':_0x5c1c5d[_0x0f38('0x5')],'priority':_0x23ec13++,'VoiceExtensionId':_0x5c1c5d['id']},{'type':_0x0f38('0xd'),'app':'Set','appdata':_0x0f38('0x18'),'context':_0x5c1c5d[_0x0f38('0x7')],'exten':_0x5c1c5d[_0x0f38('0x5')],'priority':_0x23ec13++,'VoiceExtensionId':_0x5c1c5d['id']},{'type':_0x0f38('0xd'),'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x5c1c5d[_0x0f38('0x7')],'exten':_0x5c1c5d['exten'],'priority':_0x23ec13++,'VoiceExtensionId':_0x5c1c5d['id']},{'type':_0x0f38('0xd'),'app':_0x0f38('0x3'),'appdata':_0x0f38('0x19')+_0x5c1c5d['id'],'context':_0x5c1c5d[_0x0f38('0x7')],'exten':_0x5c1c5d['exten'],'priority':_0x23ec13++,'VoiceExtensionId':_0x5c1c5d['id']}];if(_0x5c1c5d[_0x0f38('0x1a')](_0x0f38('0x1b'))&&_0x5c1c5d[_0x0f38('0x1b')]!=='none'){_0xe27f6[_0x0f38('0x9')]({'type':'outbound','app':_0x0f38('0x3'),'appdata':_0x0f38('0x1c'),'context':_0x5c1c5d['context'],'exten':_0x5c1c5d[_0x0f38('0x5')],'priority':_0x23ec13++,'VoiceExtensionId':_0x5c1c5d['id']},{'type':_0x0f38('0xd'),'app':_0x0f38('0x3'),'appdata':_0x0f38('0x1d')+_0x5c1c5d[_0x0f38('0x1b')]||_0x0f38('0x1e'),'context':_0x5c1c5d[_0x0f38('0x7')],'exten':_0x5c1c5d[_0x0f38('0x5')],'priority':_0x23ec13++,'VoiceExtensionId':_0x5c1c5d['id']});}return _0xe27f6;}function _0x1a0d07(_0xd9d43d,_0x347f40){var _0x44a6a3=[{'name':_0x0f38('0x1f'),'param':0x0},{'name':'timeout','param':0x1},{'name':'options','param':0x2},{'name':_0x0f38('0x20'),'param':0x3}];var _0x22dbe2={};var _0x270465=_0x347f40['split'](',');var _0x4f83d4=[];for(var _0x1ca380=0x0;_0x1ca380<_0x44a6a3[_0x0f38('0x21')];_0x1ca380++){switch(_0x44a6a3[_0x1ca380]['name']){case'trunk':_0x22dbe2['trunk']=_0x270465[_0x44a6a3[_0x1ca380]['param']]['split']('/')[0x1];_0x22dbe2[_0x0f38('0x22')]=_0x270465[_0x44a6a3[_0x1ca380]['param']]['split']('/')[0x2];_0x22dbe2[_0x0f38('0x23')]=_0x22dbe2[_0x0f38('0x22')]?_0x22dbe2[_0x0f38('0x22')][_0x0f38('0x24')]('$')[0x0]:undefined;_0x22dbe2[_0x0f38('0x22')]=_0xd9d43d[_0x0f38('0x12')]?(_0x22dbe2[_0x0f38('0x23')]||'')+_0x0f38('0x11')+_0xd9d43d[_0x0f38('0x12')]+'}':(_0x22dbe2[_0x0f38('0x23')]||'')+'${EXTEN}';_0x4f83d4[_0x44a6a3[_0x1ca380]['param']]=[_0x0f38('0x25'),_0x22dbe2[_0x0f38('0x1f')],_0x22dbe2[_0x0f38('0x22')]][_0x0f38('0x26')]('/');break;case _0x0f38('0x27'):_0x22dbe2[_0x0f38('0x27')]=_0x270465[_0x44a6a3[_0x1ca380][_0x0f38('0x28')]];if(_0xd9d43d[_0x0f38('0x1b')]!=='none'){if(_0x22dbe2['options']['indexOf'](_0x0f38('0x29'))<0x0){_0x22dbe2[_0x0f38('0x27')]+=_0x0f38('0x29');}}else{_0x22dbe2[_0x0f38('0x27')]=_0x22dbe2[_0x0f38('0x27')][_0x0f38('0x2a')](_0x0f38('0x29'),'');}_0x4f83d4[_0x44a6a3[_0x1ca380][_0x0f38('0x28')]]=_0x22dbe2[_0x0f38('0x27')];break;default:_0x4f83d4[_0x44a6a3[_0x1ca380][_0x0f38('0x28')]]=_0x270465[_0x44a6a3[_0x1ca380][_0x0f38('0x28')]];}}return _0x4f83d4[_0x0f38('0x26')](',');}function _0x35e8f1(_0x4ade0d,_0x531ac5,_0x459713){return new Promise(function(_0xd1fb45,_0x1a837e){var _0x459867=[];if(_[_0x0f38('0x2b')](_0x531ac5))return _0xd1fb45(_0x459867);_0x5ce271['Interval'][_0x0f38('0x2c')]({'attributes':['id','interval',_0x0f38('0x2d')],'raw':!![]})[_0x0f38('0x2e')](function(_0x476a66){for(var _0x338c65=0x0,_0x1f1627=0x0;_0x338c65<_0x531ac5[_0x0f38('0x21')];_0x338c65++,_0x1f1627=0x0){var _0x1a529a=_0x531ac5[_0x338c65];var _0x14702c=[];var _0x11de74=[];delete _0x1a529a['id'];if(_0x1a529a[_0x0f38('0x2f')]!=='*,*,*,*'){_0x1a529a[_0x0f38('0x30')]=[_0x1a529a['interval']];}else{_0x1a529a[_0x0f38('0x30')]=_0x1a529a[_0x0f38('0x2d')]?_[_0x0f38('0x31')](_['filter'](_0x476a66,{'IntervalId':_0x1a529a[_0x0f38('0x2d')]}),_0x0f38('0x2f')):[];}_0x1a529a[_0x0f38('0x7')]=_0x4ade0d[_0x0f38('0x7')];_0x1a529a[_0x0f38('0x5')]=_0x4ade0d[_0x0f38('0x5')];if(_0x1a529a[_0x0f38('0x2')])_0x1a529a[_0x0f38('0x2')]=_0x1a529a[_0x0f38('0x2')][_0x0f38('0x32')]();if(_0x4ade0d['type']==='outbound'){if(_0x1a529a[_0x0f38('0x1a')](_0x0f38('0x33'))&&_0x1a529a[_0x0f38('0x33')]&&_0x1a529a['tag']!=='--'){_0x14702c['push']({'type':_0x1a529a[_0x0f38('0x2')][_0x0f38('0x32')](),'app':_0x0f38('0x3'),'appdata':_0x0f38('0x34')+_0x1a529a[_0x0f38('0x33')],'context':_0x4ade0d[_0x0f38('0x7')],'exten':_0x4ade0d['exten'],'priority':_0x1a529a[_0x0f38('0x30')][_0x0f38('0x21')]+_0x459713+_0x1f1627++,'VoiceExtensionId':_0x4ade0d['id']});}_0x14702c[_0x0f38('0x9')]({'type':_0x1a529a[_0x0f38('0x2')][_0x0f38('0x32')](),'app':_0x0f38('0x14'),'appdata':_0x0f38('0x35')+(_0x1a529a[_0x0f38('0x36')]?_0x0f38('0x37')+_0x1a529a[_0x0f38('0x36')]+')':_0x0f38('0x38')),'context':_0x4ade0d[_0x0f38('0x7')],'exten':_0x4ade0d[_0x0f38('0x5')],'priority':_0x1a529a[_0x0f38('0x30')][_0x0f38('0x21')]+_0x459713+_0x1f1627++,'VoiceExtensionId':_0x4ade0d['id']});}else{if(_0x1a529a[_0x0f38('0x1a')]('answer')){if([_0x0f38('0x39'),_0x0f38('0x3a')][_0x0f38('0x3b')](_0x1a529a[_0x0f38('0x3c')][_0x0f38('0x32')]())&&_0x1a529a[_0x0f38('0x3d')]!==_0x0f38('0x3e')){if(_0x1a529a[_0x0f38('0x3f')]){_0x14702c[_0x0f38('0x9')]({'type':_0x1a529a['type'][_0x0f38('0x32')](),'app':_0x0f38('0x14'),'appdata':_0x0f38('0x40'),'context':_0x4ade0d[_0x0f38('0x7')],'exten':_0x4ade0d['exten'],'priority':_0x1a529a[_0x0f38('0x30')]['length']+_0x459713+_0x1f1627++,'VoiceExtensionId':_0x4ade0d['id']});_0x14702c[_0x0f38('0x9')]({'type':_0x1a529a[_0x0f38('0x2')][_0x0f38('0x32')](),'app':'Set','appdata':_0x0f38('0x41'),'context':_0x4ade0d[_0x0f38('0x7')],'exten':_0x4ade0d[_0x0f38('0x5')],'priority':_0x1a529a[_0x0f38('0x30')][_0x0f38('0x21')]+_0x459713+_0x1f1627++,'VoiceExtensionId':_0x4ade0d['id']});}else{_0x14702c[_0x0f38('0x9')]({'type':_0x1a529a[_0x0f38('0x2')][_0x0f38('0x32')](),'app':_0x0f38('0x14'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x4ade0d[_0x0f38('0x7')],'exten':_0x4ade0d['exten'],'priority':_0x1a529a[_0x0f38('0x30')][_0x0f38('0x21')]+_0x459713+_0x1f1627++,'VoiceExtensionId':_0x4ade0d['id']});_0x14702c[_0x0f38('0x9')]({'type':_0x1a529a[_0x0f38('0x2')]['toLowerCase'](),'app':_0x0f38('0x3'),'appdata':_0x0f38('0x42'),'context':_0x4ade0d['context'],'exten':_0x4ade0d[_0x0f38('0x5')],'priority':_0x1a529a[_0x0f38('0x30')][_0x0f38('0x21')]+_0x459713+_0x1f1627++,'VoiceExtensionId':_0x4ade0d['id']});}}}}for(var _0xfc82a0=0x0;_0xfc82a0<_0x1a529a[_0x0f38('0x30')][_0x0f38('0x21')];_0xfc82a0++){var _0x3c4682=_0x459713+_0x1a529a[_0x0f38('0x30')][_0x0f38('0x21')];var _0x55eacf=_0xfc82a0===_0x1a529a[_0x0f38('0x30')][_0x0f38('0x21')]-0x1?_0x459713+_0x14702c[_0x0f38('0x21')]+_0x11de74[_0x0f38('0x21')]+0x2:_0x459713+_0xfc82a0+0x1;_0x14702c[_0x0f38('0x43')](_0xfc82a0,0x0,{'type':_0x4ade0d[_0x0f38('0x2')],'app':_0x0f38('0x44'),'appdata':_0x1a529a['intervals'][_0xfc82a0]+'?'+_0x4ade0d[_0x0f38('0x7')]+_0x0f38('0x45')+_0x3c4682+':'+_0x4ade0d[_0x0f38('0x7')]+',${EXTEN},'+_0x55eacf,'exten':_0x4ade0d[_0x0f38('0x5')],'context':_0x4ade0d['context'],'priority':_0x459713+_0xfc82a0,'VoiceExtensionId':_0x4ade0d['id']});}if(_0x1a529a[_0x0f38('0x3d')]===_0x0f38('0x46'))_0x1a529a[_0x0f38('0x47')]=_0x1a0d07(_0x4ade0d,_0x1a529a[_0x0f38('0x47')]);_0x1a529a[_0x0f38('0x48')]=_0x14702c[_0x0f38('0x21')]?_[_0x0f38('0x49')](_0x14702c)[_0x0f38('0x48')]+0x1:_0x459713;_0x459867=_['concat'](_0x459867,_0x14702c,[_0x1a529a],_0x11de74);_0x459713=_[_0x0f38('0x49')](_0x459867)[_0x0f38('0x48')]+0x1;}return _0xd1fb45(_0x459867);})[_0x0f38('0x4a')](function(_0x20f214){_0x1a837e(_0x20f214);});});}return _0x45c305[_0x0f38('0x4b')](_0x0f38('0x4c'),attributes,{'tableName':_0x0f38('0x4d'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x316380){var _0x24493e=this[_0x0f38('0x4e')]({'plain':!![]});var _0x5e399c=_0x24493e[_0x0f38('0x2')]===_0x0f38('0xd')?_0x24dd33(_0x24493e):_0x1c3fba(_0x24493e);return _0x35e8f1(_0x24493e,_0x316380,_['last'](_0x5e399c)[_0x0f38('0x48')]+0x1)[_0x0f38('0x2e')](function(_0x22a2a5){var _0x5b9d23=_[_0x0f38('0x4f')](_0x5e399c,_0x22a2a5);_0x5b9d23[_0x0f38('0x9')]({'type':_0x24493e[_0x0f38('0x2')],'app':_0x0f38('0x50'),'exten':_0x24493e[_0x0f38('0x5')],'context':_0x24493e[_0x0f38('0x7')],'priority':_[_0x0f38('0x49')](_0x5b9d23)[_0x0f38('0x48')]+0x1,'VoiceExtensionId':_0x24493e['id']});return _0x5b9d23;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 379a647..534ab40 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 _0x90b5=['redis','localhost','socket.io-emitter','./voiceExtension.socket','register','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetVoiceExtension','VoiceExtension','findAll','options','attributes','limit','include','model','map','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','defaults'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x90b5,0x139));var _0x590b=function(_0x24498d,_0x257699){_0x24498d=_0x24498d-0x0;var _0xc654e6=_0x90b5[_0x24498d];return _0xc654e6;};'use strict';var _=require(_0x590b('0x0'));var util=require('util');var moment=require(_0x590b('0x1'));var BPromise=require(_0x590b('0x2'));var rs=require(_0x590b('0x3'));var fs=require('fs');var Redis=require(_0x590b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x590b('0x5'))(_0x590b('0x6'));var config=require('../../config/environment');var jayson=require(_0x590b('0x7'));var client=jayson[_0x590b('0x8')][_0x590b('0x9')]({'port':0x232a});config['redis']=_[_0x590b('0xa')](config[_0x590b('0xb')],{'host':_0x590b('0xc'),'port':0x18eb});var socket=require(_0x590b('0xd'))(new Redis(config[_0x590b('0xb')]));require(_0x590b('0xe'))[_0x590b('0xf')](socket);function respondWithRpcPromise(_0xe0b13d,_0x137f11,_0x50a7b8){return new BPromise(function(_0x5e567,_0x381bfe){return client['request'](_0xe0b13d,_0x50a7b8)[_0x590b('0x10')](function(_0x4a5939){logger[_0x590b('0x11')](_0x590b('0x12'),_0x137f11,_0x590b('0x13'));logger[_0x590b('0x14')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x137f11,_0x590b('0x13'),JSON[_0x590b('0x15')](_0x4a5939));if(_0x4a5939[_0x590b('0x16')]){if(_0x4a5939[_0x590b('0x16')][_0x590b('0x17')]===0x1f4){logger[_0x590b('0x16')](_0x590b('0x12'),_0x137f11,_0x4a5939[_0x590b('0x16')][_0x590b('0x18')]);return _0x381bfe(_0x4a5939[_0x590b('0x16')][_0x590b('0x18')]);}logger[_0x590b('0x16')](_0x590b('0x12'),_0x137f11,_0x4a5939[_0x590b('0x16')][_0x590b('0x18')]);return _0x5e567(_0x4a5939['error'][_0x590b('0x18')]);}else{logger['info'](_0x590b('0x12'),_0x137f11,_0x590b('0x13'));_0x5e567(_0x4a5939[_0x590b('0x19')]['message']);}})['catch'](function(_0x466dcc){logger['error'](_0x590b('0x12'),_0x137f11,_0x466dcc);_0x381bfe(_0x466dcc);});});}exports[_0x590b('0x1a')]=function(_0x3fbeb2){var _0x4ff96d=this;return new Promise(function(_0x6d0a17,_0x8ab843){return db[_0x590b('0x1b')][_0x590b('0x1c')]({'raw':_0x3fbeb2['options']?_0x3fbeb2[_0x590b('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3fbeb2[_0x590b('0x1d')]?_0x3fbeb2[_0x590b('0x1d')]['where']||null:null,'attributes':_0x3fbeb2['options']?_0x3fbeb2[_0x590b('0x1d')][_0x590b('0x1e')]||null:null,'limit':_0x3fbeb2['options']?_0x3fbeb2[_0x590b('0x1d')][_0x590b('0x1f')]||null:null,'include':_0x3fbeb2['options']?_0x3fbeb2['options'][_0x590b('0x20')]?_['map'](_0x3fbeb2[_0x590b('0x1d')]['include'],function(_0x4d3ff9){return{'model':db[_0x4d3ff9[_0x590b('0x21')]],'as':_0x4d3ff9['as'],'attributes':_0x4d3ff9[_0x590b('0x1e')],'include':_0x4d3ff9['include']?_[_0x590b('0x22')](_0x4d3ff9[_0x590b('0x20')],function(_0x91e491){return{'model':db[_0x91e491[_0x590b('0x21')]],'as':_0x91e491['as'],'attributes':_0x91e491[_0x590b('0x1e')],'include':_0x91e491['include']?_[_0x590b('0x22')](_0x91e491[_0x590b('0x20')],function(_0x333af8){return{'model':db[_0x333af8[_0x590b('0x21')]],'as':_0x333af8['as'],'attributes':_0x333af8[_0x590b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x590b('0x10')](function(_0x5ee979){logger[_0x590b('0x11')]('GetVoiceExtension',_0x3fbeb2);logger[_0x590b('0x14')](_0x590b('0x1a'),_0x3fbeb2,JSON[_0x590b('0x15')](_0x5ee979));_0x6d0a17(_0x5ee979);})[_0x590b('0x23')](function(_0x53a751){logger[_0x590b('0x16')]('GetVoiceExtension',_0x53a751[_0x590b('0x18')],_0x3fbeb2);_0x8ab843(_0x4ff96d[_0x590b('0x16')](0x1f4,_0x53a751[_0x590b('0x18')]));});});}; \ No newline at end of file +var _0x56a4=['model','stringify','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./voiceExtension.socket','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','result','GetVoiceExtension','VoiceExtension','raw','options','limit','include','map','attributes'];(function(_0x22bc48,_0x59b5ee){var _0x545e3a=function(_0x2c07ec){while(--_0x2c07ec){_0x22bc48['push'](_0x22bc48['shift']());}};_0x545e3a(++_0x59b5ee);}(_0x56a4,0x11b));var _0x456a=function(_0x4f4c53,_0x58ba7b){_0x4f4c53=_0x4f4c53-0x0;var _0x568ff1=_0x56a4[_0x4f4c53];return _0x568ff1;};'use strict';var _=require(_0x456a('0x0'));var util=require(_0x456a('0x1'));var moment=require('moment');var BPromise=require(_0x456a('0x2'));var rs=require(_0x456a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x456a('0x4'));var logger=require(_0x456a('0x5'))(_0x456a('0x6'));var config=require(_0x456a('0x7'));var jayson=require(_0x456a('0x8'));var client=jayson['client'][_0x456a('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x456a('0xa')],{'host':_0x456a('0xb'),'port':0x18eb});var socket=require(_0x456a('0xc'))(new Redis(config['redis']));require(_0x456a('0xd'))['register'](socket);function respondWithRpcPromise(_0xb56df,_0x29073f,_0x3bb712){return new BPromise(function(_0x3b57ac,_0x2706a7){return client[_0x456a('0xe')](_0xb56df,_0x3bb712)[_0x456a('0xf')](function(_0xe60506){logger[_0x456a('0x10')](_0x456a('0x11'),_0x29073f,_0x456a('0x12'));logger['debug'](_0x456a('0x13'),_0x29073f,'request\x20sent',JSON['stringify'](_0xe60506));if(_0xe60506[_0x456a('0x14')]){if(_0xe60506[_0x456a('0x14')][_0x456a('0x15')]===0x1f4){logger[_0x456a('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x29073f,_0xe60506[_0x456a('0x14')][_0x456a('0x16')]);return _0x2706a7(_0xe60506[_0x456a('0x14')][_0x456a('0x16')]);}logger[_0x456a('0x14')](_0x456a('0x11'),_0x29073f,_0xe60506['error'][_0x456a('0x16')]);return _0x3b57ac(_0xe60506[_0x456a('0x14')][_0x456a('0x16')]);}else{logger[_0x456a('0x10')]('VoiceExtension,\x20%s,\x20%s',_0x29073f,_0x456a('0x12'));_0x3b57ac(_0xe60506[_0x456a('0x17')][_0x456a('0x16')]);}})['catch'](function(_0x3d06b4){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x29073f,_0x3d06b4);_0x2706a7(_0x3d06b4);});});}exports[_0x456a('0x18')]=function(_0x562cfa){var _0x44d79a=this;return new Promise(function(_0x4b48bf,_0x962b6d){return db[_0x456a('0x19')]['findAll']({'raw':_0x562cfa['options']?_0x562cfa['options'][_0x456a('0x1a')]===undefined?!![]:![]:!![],'where':_0x562cfa[_0x456a('0x1b')]?_0x562cfa[_0x456a('0x1b')]['where']||null:null,'attributes':_0x562cfa[_0x456a('0x1b')]?_0x562cfa['options']['attributes']||null:null,'limit':_0x562cfa['options']?_0x562cfa[_0x456a('0x1b')][_0x456a('0x1c')]||null:null,'include':_0x562cfa[_0x456a('0x1b')]?_0x562cfa['options'][_0x456a('0x1d')]?_[_0x456a('0x1e')](_0x562cfa['options'][_0x456a('0x1d')],function(_0x561097){return{'model':db[_0x561097['model']],'as':_0x561097['as'],'attributes':_0x561097[_0x456a('0x1f')],'include':_0x561097['include']?_[_0x456a('0x1e')](_0x561097['include'],function(_0x1ee212){return{'model':db[_0x1ee212[_0x456a('0x20')]],'as':_0x1ee212['as'],'attributes':_0x1ee212[_0x456a('0x1f')],'include':_0x1ee212[_0x456a('0x1d')]?_[_0x456a('0x1e')](_0x1ee212[_0x456a('0x1d')],function(_0x46f3b3){return{'model':db[_0x46f3b3[_0x456a('0x20')]],'as':_0x46f3b3['as'],'attributes':_0x46f3b3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x48205d){logger[_0x456a('0x10')](_0x456a('0x18'),_0x562cfa);logger['debug'](_0x456a('0x18'),_0x562cfa,JSON[_0x456a('0x21')](_0x48205d));_0x4b48bf(_0x48205d);})[_0x456a('0x22')](function(_0x336993){logger[_0x456a('0x14')]('GetVoiceExtension',_0x336993[_0x456a('0x16')],_0x562cfa);_0x962b6d(_0x44d79a[_0x456a('0x14')](0x1f4,_0x336993[_0x456a('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 178aee9..8f42caa 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 _0x5fab=['emit','removeListener','register','length','./voiceExtension.events','save','update'];(function(_0x542af7,_0x17ea2c){var _0x5740e9=function(_0x52f8c4){while(--_0x52f8c4){_0x542af7['push'](_0x542af7['shift']());}};_0x5740e9(++_0x17ea2c);}(_0x5fab,0x177));var _0xb5fa=function(_0x477cb9,_0x1f151b){_0x477cb9=_0x477cb9-0x0;var _0x59f8ec=_0x5fab[_0x477cb9];return _0x59f8ec;};'use strict';var VoiceExtensionEvents=require(_0xb5fa('0x0'));var events=[_0xb5fa('0x1'),'remove',_0xb5fa('0x2')];function createListener(_0x2e2a50,_0x3fc227){return function(_0x316ad0){_0x3fc227[_0xb5fa('0x3')](_0x2e2a50,_0x316ad0);};}function removeListener(_0x595d8b,_0x29390a){return function(){VoiceExtensionEvents[_0xb5fa('0x4')](_0x595d8b,_0x29390a);};}exports[_0xb5fa('0x5')]=function(_0x44df89){for(var _0x4a0249=0x0,_0x5d70f6=events[_0xb5fa('0x6')];_0x4a0249<_0x5d70f6;_0x4a0249++){var _0x1aec3e=events[_0x4a0249];var _0x9c7bce=createListener('voiceExtension:'+_0x1aec3e,_0x44df89);VoiceExtensionEvents['on'](_0x1aec3e,_0x9c7bce);}}; \ No newline at end of file +var _0x5fab=['emit','removeListener','register','length','./voiceExtension.events','save','update'];(function(_0x4c1c90,_0x5df03b){var _0xba124d=function(_0x4c76c9){while(--_0x4c76c9){_0x4c1c90['push'](_0x4c1c90['shift']());}};_0xba124d(++_0x5df03b);}(_0x5fab,0x177));var _0xb5fa=function(_0x7d62cb,_0x7622c){_0x7d62cb=_0x7d62cb-0x0;var _0x3a6266=_0x5fab[_0x7d62cb];return _0x3a6266;};'use strict';var VoiceExtensionEvents=require(_0xb5fa('0x0'));var events=[_0xb5fa('0x1'),'remove',_0xb5fa('0x2')];function createListener(_0x2e2a50,_0x3fc227){return function(_0x316ad0){_0x3fc227[_0xb5fa('0x3')](_0x2e2a50,_0x316ad0);};}function removeListener(_0x595d8b,_0x29390a){return function(){VoiceExtensionEvents[_0xb5fa('0x4')](_0x595d8b,_0x29390a);};}exports[_0xb5fa('0x5')]=function(_0x44df89){for(var _0x4a0249=0x0,_0x5d70f6=events[_0xb5fa('0x6')];_0x4a0249<_0x5d70f6;_0x4a0249++){var _0x1aec3e=events[_0x4a0249];var _0x9c7bce=createListener('voiceExtension:'+_0x1aec3e,_0x44df89);VoiceExtensionEvents['on'](_0x1aec3e,_0x9c7bce);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index a834a39..d4a38d8 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 _0xe5af=['show','create','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','/:id'];(function(_0x1e238c,_0x4d0d82){var _0x3dceb1=function(_0x2387ea){while(--_0x2387ea){_0x1e238c['push'](_0x1e238c['shift']());}};_0x3dceb1(++_0x4d0d82);}(_0xe5af,0x9c));var _0xfe5a=function(_0x57338e,_0x49889f){_0x57338e=_0x57338e-0x0;var _0x3da2b7=_0xe5af[_0x57338e];return _0x3da2b7;};'use strict';var multer=require('multer');var util=require(_0xfe5a('0x0'));var path=require(_0xfe5a('0x1'));var timeout=require('connect-timeout');var express=require(_0xfe5a('0x2'));var router=express[_0xfe5a('0x3')]();var fs_extra=require(_0xfe5a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfe5a('0x5'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0xfe5a('0x6')]('/',auth[_0xfe5a('0x7')](),controller['index']);router['get'](_0xfe5a('0x8'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x9')]);router[_0xfe5a('0x6')]('/:id/messages',auth[_0xfe5a('0x7')](),controller['getMessages']);router['post']('/',auth[_0xfe5a('0x7')](),controller[_0xfe5a('0xa')]);router['put'](_0xfe5a('0x8'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0xb')]);router[_0xfe5a('0xc')](_0xfe5a('0x8'),auth['isAuthenticated'](),controller[_0xfe5a('0xd')]);module[_0xfe5a('0xe')]=router; \ No newline at end of file +var _0x7b84=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x597e02,_0x44fa23){var _0x899e5b=function(_0x15e3c1){while(--_0x15e3c1){_0x597e02['push'](_0x597e02['shift']());}};_0x899e5b(++_0x44fa23);}(_0x7b84,0x17c));var _0x47b8=function(_0x37fe83,_0x4a8ce2){_0x37fe83=_0x37fe83-0x0;var _0xd06263=_0x7b84[_0x37fe83];return _0xd06263;};'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('0x11')]('/',auth[_0x47b8('0xb')](),controller[_0x47b8('0x12')]);router[_0x47b8('0x13')](_0x47b8('0xd'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x14')]);router[_0x47b8('0x15')](_0x47b8('0xd'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x16')]);module[_0x47b8('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 0cb7f09..69aae21 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 _0xb005=['INTEGER','VIRTUAL','getDataValue','fullname','mailbox','sequelize','STRING','from-voicemail','contest_mailbox','setDataValue','string','trim','central','ENUM','yes','TIMESTAMP'];(function(_0x10b861,_0x3cfa81){var _0x188d20=function(_0x2ba6a8){while(--_0x2ba6a8){_0x10b861['push'](_0x10b861['shift']());}};_0x188d20(++_0x3cfa81);}(_0xb005,0xe5));var _0x5b00=function(_0x37e7e8,_0x475c26){_0x37e7e8=_0x37e7e8-0x0;var _0x115ccd=_0xb005[_0x37e7e8];return _0x115ccd;};'use strict';var Sequelize=require(_0x5b00('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x5b00('0x1')]},'context':{'type':Sequelize[_0x5b00('0x1')],'defaultValue':_0x5b00('0x2'),'unique':_0x5b00('0x3')},'mailbox':{'type':Sequelize[_0x5b00('0x1')],'defaultValue':'','allowNull':![],'unique':_0x5b00('0x3')},'password':{'type':Sequelize[_0x5b00('0x1')]},'fullname':{'type':Sequelize[_0x5b00('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x35f7f6){this[_0x5b00('0x4')]('email',typeof _0x35f7f6===_0x5b00('0x5')&&_0x35f7f6[_0x5b00('0x6')]()?_0x35f7f6[_0x5b00('0x6')]():null);}},'pager':{'type':Sequelize[_0x5b00('0x1')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x5b00('0x7')},'attach':{'type':Sequelize[_0x5b00('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x5b00('0x8')](_0x5b00('0x9'),'no'),'defaultValue':_0x5b00('0x9'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x5b00('0x1')]},'review':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x5b00('0x8')](_0x5b00('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x5b00('0x8')](_0x5b00('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x5b00('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x5b00('0x8')](_0x5b00('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x5b00('0x8')](_0x5b00('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x5b00('0x8')](_0x5b00('0x9'),'no'),'defaultValue':_0x5b00('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x5b00('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x5b00('0x8')](_0x5b00('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x5b00('0x8')](_0x5b00('0x9'),'no'),'defaultValue':_0x5b00('0x9'),'allowNull':![]},'stamp':{'type':_0x5b00('0xa')},'emailsubject':{'type':Sequelize[_0x5b00('0x1')]},'emailbody':{'type':Sequelize[_0x5b00('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x5b00('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x5b00('0xc')],'get':function(){return this[_0x5b00('0xd')](_0x5b00('0xe'))+'\x20-\x20'+this['getDataValue'](_0x5b00('0xf'));}}}; \ No newline at end of file +var _0xa5ab=['yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','\x20-\x20','mailbox','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM'];(function(_0x17d56c,_0x5ef81f){var _0x2164e2=function(_0x3887fb){while(--_0x3887fb){_0x17d56c['push'](_0x17d56c['shift']());}};_0x2164e2(++_0x5ef81f);}(_0xa5ab,0xb7));var _0xba5a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5ab[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0xba5a('0x0')]},'context':{'type':Sequelize[_0xba5a('0x0')],'defaultValue':_0xba5a('0x1'),'unique':_0xba5a('0x2')},'mailbox':{'type':Sequelize[_0xba5a('0x0')],'defaultValue':'','allowNull':![],'unique':_0xba5a('0x2')},'password':{'type':Sequelize[_0xba5a('0x0')]},'fullname':{'type':Sequelize[_0xba5a('0x0')]},'email':{'type':Sequelize[_0xba5a('0x0')],'validate':{'isEmail':!![]},'set':function(_0x1e6d81){this[_0xba5a('0x3')](_0xba5a('0x4'),typeof _0x1e6d81===_0xba5a('0x5')&&_0x1e6d81[_0xba5a('0x6')]()?_0x1e6d81['trim']():null);}},'pager':{'type':Sequelize[_0xba5a('0x0')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0xba5a('0x7')},'attach':{'type':Sequelize[_0xba5a('0x8')]('yes','no'),'defaultValue':_0xba5a('0x9'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0xba5a('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xba5a('0x0')]},'callback':{'type':Sequelize[_0xba5a('0x0')]},'review':{'type':Sequelize[_0xba5a('0x8')](_0xba5a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0xba5a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xba5a('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xba5a('0x8')](_0xba5a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xba5a('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xba5a('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xba5a('0x8')](_0xba5a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xba5a('0x8')](_0xba5a('0x9'),'no'),'defaultValue':_0xba5a('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0xba5a('0x8')](_0xba5a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xba5a('0x8')](_0xba5a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xba5a('0x8')](_0xba5a('0x9'),'no'),'defaultValue':_0xba5a('0x9'),'allowNull':![]},'stamp':{'type':_0xba5a('0xb')},'emailsubject':{'type':Sequelize[_0xba5a('0x0')]},'emailbody':{'type':Sequelize[_0xba5a('0x0')]},'maxsecs':{'type':Sequelize[_0xba5a('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xba5a('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xba5a('0xd')],'get':function(){return this['getDataValue']('fullname')+_0xba5a('0xe')+this['getDataValue'](_0xba5a('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 948d77f..2bcc3de 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 _0xda3f=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','get','Voicemails','UserProfileResource','destroy','error','stack','name','send','map','VoiceMail','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','rows','show','params','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','length','mailbox','VoiceMailMessage','findAndCountAll','rimraf','zip-dir','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x552517,_0x261d1a){var _0xf46ece=function(_0x5b87fe){while(--_0x5b87fe){_0x552517['push'](_0x552517['shift']());}};_0xf46ece(++_0x261d1a);}(_0xda3f,0xec));var _0xfda3=function(_0x4fd656,_0x38f944){_0x4fd656=_0x4fd656-0x0;var _0x4c94ef=_0xda3f[_0x4fd656];return _0x4c94ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfda3('0x0'));var zipdir=require(_0xfda3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfda3('0x2'));var Mustache=require('mustache');var util=require(_0xfda3('0x3'));var path=require(_0xfda3('0x4'));var sox=require('sox');var csv=require(_0xfda3('0x5'));var ejs=require(_0xfda3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfda3('0x7'));var crypto=require(_0xfda3('0x8'));var jsforce=require(_0xfda3('0x9'));var deskjs=require(_0xfda3('0xa'));var toCsv=require(_0xfda3('0x5'));var querystring=require(_0xfda3('0xb'));var Papa=require(_0xfda3('0xc'));var Redis=require(_0xfda3('0xd'));var authService=require(_0xfda3('0xe'));var qs=require(_0xfda3('0xf'));var as=require(_0xfda3('0x10'));var hardwareService=require(_0xfda3('0x11'));var logger=require('../../config/logger')(_0xfda3('0x12'));var utils=require(_0xfda3('0x13'));var config=require(_0xfda3('0x14'));var licenseUtil=require(_0xfda3('0x15'));var db=require(_0xfda3('0x16'))['db'];function respondWithStatusCode(_0x4b77ea,_0x583125){_0x583125=_0x583125||0xcc;return function(_0x5d7d5b){if(_0x5d7d5b){return _0x4b77ea[_0xfda3('0x17')](_0x583125);}return _0x4b77ea[_0xfda3('0x18')](_0x583125)['end']();};}function respondWithResult(_0x501588,_0x587e9b){_0x587e9b=_0x587e9b||0xc8;return function(_0x227d72){if(_0x227d72){return _0x501588[_0xfda3('0x18')](_0x587e9b)['json'](_0x227d72);}};}function respondWithFilteredResult(_0x57a229,_0x533365){return function(_0x80ea80){if(_0x80ea80){var _0x474707=typeof _0x533365[_0xfda3('0x19')]===_0xfda3('0x1a')&&typeof _0x533365[_0xfda3('0x1b')]===_0xfda3('0x1a');var _0x2aadcb=_0x80ea80[_0xfda3('0x1c')];var _0x4680bf=_0x474707?0x0:_0x533365[_0xfda3('0x19')];var _0x54a7c6=_0x474707?_0x80ea80[_0xfda3('0x1c')]:_0x533365[_0xfda3('0x19')]+_0x533365[_0xfda3('0x1b')];var _0x32855a;if(_0x54a7c6>=_0x2aadcb){_0x54a7c6=_0x2aadcb;_0x32855a=0xc8;}else{_0x32855a=0xce;}_0x57a229['status'](_0x32855a);return _0x57a229[_0xfda3('0x1d')](_0xfda3('0x1e'),_0x4680bf+'-'+_0x54a7c6+'/'+_0x2aadcb)[_0xfda3('0x1f')](_0x80ea80);}return null;};}function patchUpdates(_0x51e731){return function(_0x5ad52a){try{jsonpatch[_0xfda3('0x20')](_0x5ad52a,_0x51e731,!![]);}catch(_0x38d428){return BPromise[_0xfda3('0x21')](_0x38d428);}return _0x5ad52a['save']();};}function saveUpdates(_0x3cf5a9,_0xef2535){return function(_0x1e15a8){if(_0x1e15a8){return _0x1e15a8[_0xfda3('0x22')](_0x3cf5a9)[_0xfda3('0x23')](function(_0x2b84b7){return _0x2b84b7;});}return null;};}function removeEntity(_0x2677f6,_0xc6fb9a){return function(_0x16eaa6){if(_0x16eaa6){return _0x16eaa6['destroy']()[_0xfda3('0x23')](function(){var _0x2d5b44=_0x16eaa6[_0xfda3('0x24')]({'plain':!![]});var _0x4ae9b9=_0xfda3('0x25');return db[_0xfda3('0x26')][_0xfda3('0x27')]({'where':{'type':_0x4ae9b9,'resourceId':_0x2d5b44['id']}})[_0xfda3('0x23')](function(){return _0x16eaa6;});})[_0xfda3('0x23')](function(){_0x2677f6[_0xfda3('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c6d7d,_0x1e87fe){return function(_0x2bef2b){if(!_0x2bef2b){_0x3c6d7d[_0xfda3('0x17')](0x194);}return _0x2bef2b;};}function handleError(_0x33ffd4,_0x5704c7){_0x5704c7=_0x5704c7||0x1f4;return function(_0x3c1549){logger[_0xfda3('0x28')](_0x3c1549[_0xfda3('0x29')]);if(_0x3c1549[_0xfda3('0x2a')]){delete _0x3c1549[_0xfda3('0x2a')];}_0x33ffd4[_0xfda3('0x18')](_0x5704c7)[_0xfda3('0x2b')](_0x3c1549);};}exports['index']=function(_0x56ca3a,_0x3aef3c){var _0x4fd277={},_0x4b9d90={},_0x16b4a2={'count':0x0,'rows':[]};var _0x2a5971=_[_0xfda3('0x2c')](db[_0xfda3('0x2d')][_0xfda3('0x2e')],function(_0x35ec7a){return{'name':_0x35ec7a[_0xfda3('0x2f')],'type':_0x35ec7a[_0xfda3('0x30')][_0xfda3('0x31')]};});_0x4b9d90['model']=_[_0xfda3('0x2c')](_0x2a5971,_0xfda3('0x2a'));_0x4b9d90[_0xfda3('0x32')]=_[_0xfda3('0x33')](_0x56ca3a[_0xfda3('0x32')]);_0x4b9d90[_0xfda3('0x34')]=_[_0xfda3('0x35')](_0x4b9d90[_0xfda3('0x36')],_0x4b9d90[_0xfda3('0x32')]);_0x4fd277['attributes']=_['intersection'](_0x4b9d90[_0xfda3('0x36')],qs[_0xfda3('0x37')](_0x56ca3a['query'][_0xfda3('0x37')]));_0x4fd277[_0xfda3('0x38')]=_0x4fd277[_0xfda3('0x38')]['length']?_0x4fd277[_0xfda3('0x38')]:_0x4b9d90[_0xfda3('0x36')];if(!_0x56ca3a[_0xfda3('0x32')][_0xfda3('0x39')](_0xfda3('0x3a'))){_0x4fd277['limit']=qs[_0xfda3('0x1b')](_0x56ca3a[_0xfda3('0x32')][_0xfda3('0x1b')]);_0x4fd277['offset']=qs[_0xfda3('0x19')](_0x56ca3a['query'][_0xfda3('0x19')]);}_0x4fd277[_0xfda3('0x3b')]=qs[_0xfda3('0x3c')](_0x56ca3a[_0xfda3('0x32')][_0xfda3('0x3c')]);_0x4fd277[_0xfda3('0x3d')]=qs[_0xfda3('0x34')](_[_0xfda3('0x3e')](_0x56ca3a['query'],_0x4b9d90[_0xfda3('0x34')]),_0x2a5971);if(_0x56ca3a[_0xfda3('0x32')][_0xfda3('0x3f')]){_0x4fd277[_0xfda3('0x3d')]=_['merge'](_0x4fd277[_0xfda3('0x3d')],{'$or':_[_0xfda3('0x2c')](_0x2a5971,function(_0x590ba5){if(_0x590ba5['type']!=='VIRTUAL'){var _0x31b173={};_0x31b173[_0x590ba5[_0xfda3('0x2a')]]={'$like':'%'+_0x56ca3a[_0xfda3('0x32')][_0xfda3('0x3f')]+'%'};return _0x31b173;}})});}_0x4fd277=_[_0xfda3('0x40')]({},_0x4fd277,_0x56ca3a[_0xfda3('0x41')]);var _0x40b814={'where':_0x4fd277[_0xfda3('0x3d')]};return db[_0xfda3('0x2d')][_0xfda3('0x1c')](_0x40b814)['then'](function(_0x27200f){_0x16b4a2[_0xfda3('0x1c')]=_0x27200f;if(_0x56ca3a['query'][_0xfda3('0x42')]){_0x4fd277['include']=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x4fd277);})[_0xfda3('0x23')](function(_0x107fb1){_0x16b4a2[_0xfda3('0x43')]=_0x107fb1;return _0x16b4a2;})[_0xfda3('0x23')](respondWithFilteredResult(_0x3aef3c,_0x4fd277))['catch'](handleError(_0x3aef3c,null));};exports[_0xfda3('0x44')]=function(_0x25b9a6,_0x154ae7){var _0x2ce504={'raw':!![],'where':{'id':_0x25b9a6[_0xfda3('0x45')]['id']}},_0x564ccd={};_0x564ccd[_0xfda3('0x36')]=_[_0xfda3('0x33')](db['VoiceMail']['rawAttributes']);_0x564ccd[_0xfda3('0x32')]=_[_0xfda3('0x33')](_0x25b9a6[_0xfda3('0x32')]);_0x564ccd[_0xfda3('0x34')]=_[_0xfda3('0x35')](_0x564ccd[_0xfda3('0x36')],_0x564ccd[_0xfda3('0x32')]);_0x2ce504[_0xfda3('0x38')]=_[_0xfda3('0x35')](_0x564ccd[_0xfda3('0x36')],qs[_0xfda3('0x37')](_0x25b9a6[_0xfda3('0x32')][_0xfda3('0x37')]));_0x2ce504[_0xfda3('0x38')]=_0x2ce504['attributes']['length']?_0x2ce504[_0xfda3('0x38')]:_0x564ccd[_0xfda3('0x36')];if(_0x25b9a6[_0xfda3('0x32')][_0xfda3('0x42')]){_0x2ce504[_0xfda3('0x46')]=[{'all':!![]}];}_0x2ce504=_[_0xfda3('0x40')]({},_0x2ce504,_0x25b9a6[_0xfda3('0x41')]);return db[_0xfda3('0x2d')][_0xfda3('0x47')](_0x2ce504)[_0xfda3('0x23')](handleEntityNotFound(_0x154ae7,null))['then'](respondWithResult(_0x154ae7,null))[_0xfda3('0x48')](handleError(_0x154ae7,null));};exports[_0xfda3('0x49')]=function(_0x481356,_0x36aa3a){return db[_0xfda3('0x2d')]['create'](_0x481356[_0xfda3('0x4a')],{})[_0xfda3('0x23')](function(_0x15eb87){var _0x4bcd2b=_0x481356[_0xfda3('0x4b')][_0xfda3('0x24')]({'plain':!![]});if(!_0x4bcd2b)throw new Error(_0xfda3('0x4c'));if(_0x4bcd2b['role']===_0xfda3('0x4b')){var _0x33565d=_0x15eb87[_0xfda3('0x24')]({'plain':!![]});var _0x2f6e62=_0xfda3('0x25');return db['UserProfileSection'][_0xfda3('0x47')]({'where':{'name':_0x2f6e62,'userProfileId':_0x4bcd2b['userProfileId']},'raw':!![]})[_0xfda3('0x23')](function(_0x587eef){if(_0x587eef&&_0x587eef[_0xfda3('0x4d')]===0x0){return db[_0xfda3('0x26')][_0xfda3('0x49')]({'name':_0x33565d[_0xfda3('0x2a')],'resourceId':_0x33565d['id'],'type':_0x587eef['name'],'sectionId':_0x587eef['id']},{})[_0xfda3('0x23')](function(){return _0x15eb87;});}else{return _0x15eb87;}})[_0xfda3('0x48')](function(_0x2f2c32){logger[_0xfda3('0x28')](_0xfda3('0x4e'),_0x2f2c32);throw _0x2f2c32;});}return _0x15eb87;})[_0xfda3('0x23')](respondWithResult(_0x36aa3a,0xc9))[_0xfda3('0x48')](handleError(_0x36aa3a,null));};exports['update']=function(_0x4b1410,_0x4fb214){if(_0x4b1410[_0xfda3('0x4a')]['id']){delete _0x4b1410[_0xfda3('0x4a')]['id'];}return db['VoiceMail']['find']({'where':{'id':_0x4b1410[_0xfda3('0x45')]['id']}})[_0xfda3('0x23')](handleEntityNotFound(_0x4fb214,null))[_0xfda3('0x23')](saveUpdates(_0x4b1410[_0xfda3('0x4a')],null))[_0xfda3('0x23')](respondWithResult(_0x4fb214,null))['catch'](handleError(_0x4fb214,null));};exports[_0xfda3('0x27')]=function(_0x2a30e8,_0x167424){return db[_0xfda3('0x2d')][_0xfda3('0x47')]({'where':{'id':_0x2a30e8[_0xfda3('0x45')]['id']}})[_0xfda3('0x23')](handleEntityNotFound(_0x167424,null))[_0xfda3('0x23')](removeEntity(_0x167424,null))[_0xfda3('0x48')](handleError(_0x167424,null));};exports[_0xfda3('0x4f')]=function(_0x3ed7c1,_0x1fa27a,_0x5b426b){return db[_0xfda3('0x2d')][_0xfda3('0x50')]({'where':{'id':_0x3ed7c1[_0xfda3('0x45')]['id']}})[_0xfda3('0x23')](handleEntityNotFound(_0x1fa27a,null))[_0xfda3('0x23')](function(_0x405d7e){var _0x42c7a1;var _0x4ce31c={},_0x5a3a6f={};_0x5a3a6f[_0xfda3('0x36')]=_[_0xfda3('0x33')](db['VoiceMailMessage'][_0xfda3('0x2e')]);_0x5a3a6f[_0xfda3('0x32')]=_[_0xfda3('0x33')](_0x3ed7c1[_0xfda3('0x32')]);_0x5a3a6f['filters']=_['intersection'](_0x5a3a6f[_0xfda3('0x36')],_0x5a3a6f[_0xfda3('0x32')]);_0x4ce31c[_0xfda3('0x38')]=_['intersection'](_0x5a3a6f[_0xfda3('0x36')],qs['fields'](_0x3ed7c1[_0xfda3('0x32')][_0xfda3('0x37')]));_0x4ce31c[_0xfda3('0x38')]=_0x4ce31c[_0xfda3('0x38')][_0xfda3('0x51')]?_0x4ce31c[_0xfda3('0x38')]:_0x5a3a6f['model'];if(!_0x3ed7c1[_0xfda3('0x32')][_0xfda3('0x39')](_0xfda3('0x3a'))){_0x4ce31c[_0xfda3('0x1b')]=qs[_0xfda3('0x1b')](_0x3ed7c1['query']['limit']);_0x4ce31c[_0xfda3('0x19')]=qs[_0xfda3('0x19')](_0x3ed7c1['query']['offset']);}_0x4ce31c['order']=qs[_0xfda3('0x3c')](_0x3ed7c1[_0xfda3('0x32')]['sort']);_0x4ce31c[_0xfda3('0x3d')]=qs[_0xfda3('0x34')](_[_0xfda3('0x3e')](_0x3ed7c1[_0xfda3('0x32')],_0x5a3a6f['filters']));if(_0x3ed7c1[_0xfda3('0x32')][_0xfda3('0x3f')]){_0x4ce31c[_0xfda3('0x3d')]=_[_0xfda3('0x40')](_0x4ce31c[_0xfda3('0x3d')],{'$or':_[_0xfda3('0x2c')](_0x4ce31c['attributes'],function(_0x4e312d){var _0x31d657={};_0x31d657[_0x4e312d]={'$like':'%'+_0x3ed7c1['query'][_0xfda3('0x3f')]+'%'};return _0x31d657;})});}_0x4ce31c[_0xfda3('0x3d')]=_[_0xfda3('0x40')](_0x4ce31c[_0xfda3('0x3d')],{'mailboxuser':_0x405d7e[_0xfda3('0x52')]});_0x4ce31c=_[_0xfda3('0x40')]({},_0x4ce31c,_0x3ed7c1[_0xfda3('0x41')]);return db[_0xfda3('0x53')][_0xfda3('0x54')](_0x4ce31c)[_0xfda3('0x23')](respondWithFilteredResult(_0x1fa27a,_0x4ce31c));})['catch'](handleError(_0x1fa27a,null));}; \ No newline at end of file +var _0x1775=['hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','include','params','includeAll','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','findOne','rawAttributes','mailbox','options','VoiceMailMessage','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','Voicemails','UserProfileResource','name','send','index','VoiceMail','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length'];(function(_0x9071b5,_0x221464){var _0x55dc51=function(_0x115ac4){while(--_0x115ac4){_0x9071b5['push'](_0x9071b5['shift']());}};_0x55dc51(++_0x221464);}(_0x1775,0x1db));var _0x5177=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1775[_0x432682];return _0x463d05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5177('0x0'));var zipdir=require(_0x5177('0x1'));var jsonpatch=require(_0x5177('0x2'));var rp=require(_0x5177('0x3'));var moment=require(_0x5177('0x4'));var BPromise=require(_0x5177('0x5'));var Mustache=require(_0x5177('0x6'));var util=require(_0x5177('0x7'));var path=require(_0x5177('0x8'));var sox=require(_0x5177('0x9'));var csv=require(_0x5177('0xa'));var ejs=require(_0x5177('0xb'));var fs=require('fs');var fs_extra=require(_0x5177('0xc'));var _=require(_0x5177('0xd'));var squel=require(_0x5177('0xe'));var crypto=require(_0x5177('0xf'));var jsforce=require(_0x5177('0x10'));var deskjs=require(_0x5177('0x11'));var toCsv=require(_0x5177('0xa'));var querystring=require(_0x5177('0x12'));var Papa=require(_0x5177('0x13'));var Redis=require(_0x5177('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5177('0x15'));var hardwareService=require(_0x5177('0x16'));var logger=require(_0x5177('0x17'))(_0x5177('0x18'));var utils=require(_0x5177('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x5177('0x1a'));var db=require(_0x5177('0x1b'))['db'];function respondWithStatusCode(_0xc613b9,_0x3c4ced){_0x3c4ced=_0x3c4ced||0xcc;return function(_0x111e99){if(_0x111e99){return _0xc613b9[_0x5177('0x1c')](_0x3c4ced);}return _0xc613b9[_0x5177('0x1d')](_0x3c4ced)[_0x5177('0x1e')]();};}function respondWithResult(_0x3e6224,_0x1eb9dd){_0x1eb9dd=_0x1eb9dd||0xc8;return function(_0x41bef4){if(_0x41bef4){return _0x3e6224[_0x5177('0x1d')](_0x1eb9dd)[_0x5177('0x1f')](_0x41bef4);}};}function respondWithFilteredResult(_0x31aff8,_0x1b32e6){return function(_0x175ca6){if(_0x175ca6){var _0x2ab5e5=typeof _0x1b32e6[_0x5177('0x20')]===_0x5177('0x21')&&typeof _0x1b32e6['limit']===_0x5177('0x21');var _0x41e687=_0x175ca6[_0x5177('0x22')];var _0x1b4102=_0x2ab5e5?0x0:_0x1b32e6['offset'];var _0x3e6944=_0x2ab5e5?_0x175ca6[_0x5177('0x22')]:_0x1b32e6[_0x5177('0x20')]+_0x1b32e6['limit'];var _0x86f5f8;if(_0x3e6944>=_0x41e687){_0x3e6944=_0x41e687;_0x86f5f8=0xc8;}else{_0x86f5f8=0xce;}_0x31aff8['status'](_0x86f5f8);return _0x31aff8[_0x5177('0x23')](_0x5177('0x24'),_0x1b4102+'-'+_0x3e6944+'/'+_0x41e687)[_0x5177('0x1f')](_0x175ca6);}return null;};}function patchUpdates(_0x27b732){return function(_0x451e5c){try{jsonpatch[_0x5177('0x25')](_0x451e5c,_0x27b732,!![]);}catch(_0x174c4f){return BPromise[_0x5177('0x26')](_0x174c4f);}return _0x451e5c[_0x5177('0x27')]();};}function saveUpdates(_0x2a95cc,_0x23dad2){return function(_0x3b0c37){if(_0x3b0c37){return _0x3b0c37['update'](_0x2a95cc)[_0x5177('0x28')](function(_0x556f96){return _0x556f96;});}return null;};}function removeEntity(_0x30b60f,_0x2c68d8){return function(_0x3b39b5){if(_0x3b39b5){return _0x3b39b5[_0x5177('0x29')]()['then'](function(){var _0x2503ef=_0x3b39b5['get']({'plain':!![]});var _0x564139=_0x5177('0x2a');return db[_0x5177('0x2b')]['destroy']({'where':{'type':_0x564139,'resourceId':_0x2503ef['id']}})[_0x5177('0x28')](function(){return _0x3b39b5;});})['then'](function(){_0x30b60f[_0x5177('0x1d')](0xcc)[_0x5177('0x1e')]();});}};}function handleEntityNotFound(_0x58846c,_0x3e021a){return function(_0x2554ec){if(!_0x2554ec){_0x58846c[_0x5177('0x1c')](0x194);}return _0x2554ec;};}function handleError(_0x7f86e,_0xe98ff1){_0xe98ff1=_0xe98ff1||0x1f4;return function(_0x1cef5d){logger['error'](_0x1cef5d['stack']);if(_0x1cef5d[_0x5177('0x2c')]){delete _0x1cef5d[_0x5177('0x2c')];}_0x7f86e[_0x5177('0x1d')](_0xe98ff1)[_0x5177('0x2d')](_0x1cef5d);};}exports[_0x5177('0x2e')]=function(_0x8134f9,_0x31eb9f){var _0x72dced={},_0x49f6f1={},_0x42e1db={'count':0x0,'rows':[]};var _0x2233a2=_['map'](db[_0x5177('0x2f')]['rawAttributes'],function(_0x172b36){return{'name':_0x172b36[_0x5177('0x30')],'type':_0x172b36[_0x5177('0x31')]['key']};});_0x49f6f1['model']=_[_0x5177('0x32')](_0x2233a2,_0x5177('0x2c'));_0x49f6f1[_0x5177('0x33')]=_[_0x5177('0x34')](_0x8134f9[_0x5177('0x33')]);_0x49f6f1[_0x5177('0x35')]=_[_0x5177('0x36')](_0x49f6f1[_0x5177('0x37')],_0x49f6f1['query']);_0x72dced[_0x5177('0x38')]=_[_0x5177('0x36')](_0x49f6f1['model'],qs[_0x5177('0x39')](_0x8134f9[_0x5177('0x33')][_0x5177('0x39')]));_0x72dced[_0x5177('0x38')]=_0x72dced[_0x5177('0x38')][_0x5177('0x3a')]?_0x72dced['attributes']:_0x49f6f1[_0x5177('0x37')];if(!_0x8134f9[_0x5177('0x33')][_0x5177('0x3b')](_0x5177('0x3c'))){_0x72dced[_0x5177('0x3d')]=qs[_0x5177('0x3d')](_0x8134f9[_0x5177('0x33')]['limit']);_0x72dced[_0x5177('0x20')]=qs[_0x5177('0x20')](_0x8134f9['query']['offset']);}_0x72dced[_0x5177('0x3e')]=qs[_0x5177('0x3f')](_0x8134f9[_0x5177('0x33')][_0x5177('0x3f')]);_0x72dced[_0x5177('0x40')]=qs[_0x5177('0x35')](_[_0x5177('0x41')](_0x8134f9[_0x5177('0x33')],_0x49f6f1[_0x5177('0x35')]),_0x2233a2);if(_0x8134f9[_0x5177('0x33')][_0x5177('0x42')]){_0x72dced[_0x5177('0x40')]=_[_0x5177('0x43')](_0x72dced['where'],{'$or':_[_0x5177('0x32')](_0x2233a2,function(_0x2a4db1){if(_0x2a4db1['type']!==_0x5177('0x44')){var _0x56f297={};_0x56f297[_0x2a4db1[_0x5177('0x2c')]]={'$like':'%'+_0x8134f9[_0x5177('0x33')][_0x5177('0x42')]+'%'};return _0x56f297;}})});}_0x72dced=_['merge']({},_0x72dced,_0x8134f9['options']);var _0x210510={'where':_0x72dced[_0x5177('0x40')]};return db[_0x5177('0x2f')][_0x5177('0x22')](_0x210510)[_0x5177('0x28')](function(_0x3e710d){_0x42e1db[_0x5177('0x22')]=_0x3e710d;if(_0x8134f9[_0x5177('0x33')]['includeAll']){_0x72dced[_0x5177('0x45')]=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x72dced);})[_0x5177('0x28')](function(_0x17dc98){_0x42e1db['rows']=_0x17dc98;return _0x42e1db;})[_0x5177('0x28')](respondWithFilteredResult(_0x31eb9f,_0x72dced))['catch'](handleError(_0x31eb9f,null));};exports['show']=function(_0x46c833,_0x1769cd){var _0x262c71={'raw':!![],'where':{'id':_0x46c833[_0x5177('0x46')]['id']}},_0x3776b8={};_0x3776b8[_0x5177('0x37')]=_[_0x5177('0x34')](db['VoiceMail']['rawAttributes']);_0x3776b8[_0x5177('0x33')]=_['keys'](_0x46c833[_0x5177('0x33')]);_0x3776b8[_0x5177('0x35')]=_[_0x5177('0x36')](_0x3776b8[_0x5177('0x37')],_0x3776b8['query']);_0x262c71[_0x5177('0x38')]=_[_0x5177('0x36')](_0x3776b8[_0x5177('0x37')],qs[_0x5177('0x39')](_0x46c833[_0x5177('0x33')][_0x5177('0x39')]));_0x262c71[_0x5177('0x38')]=_0x262c71[_0x5177('0x38')][_0x5177('0x3a')]?_0x262c71[_0x5177('0x38')]:_0x3776b8[_0x5177('0x37')];if(_0x46c833['query'][_0x5177('0x47')]){_0x262c71['include']=[{'all':!![]}];}_0x262c71=_['merge']({},_0x262c71,_0x46c833['options']);return db[_0x5177('0x2f')][_0x5177('0x48')](_0x262c71)['then'](handleEntityNotFound(_0x1769cd,null))[_0x5177('0x28')](respondWithResult(_0x1769cd,null))[_0x5177('0x49')](handleError(_0x1769cd,null));};exports[_0x5177('0x4a')]=function(_0x4891fe,_0x1d4ae4){return db['VoiceMail']['create'](_0x4891fe['body'],{})[_0x5177('0x28')](function(_0x37d5dd){var _0x1300d7=_0x4891fe['user']['get']({'plain':!![]});if(!_0x1300d7)throw new Error(_0x5177('0x4b'));if(_0x1300d7['role']===_0x5177('0x4c')){var _0x9dd7a2=_0x37d5dd[_0x5177('0x4d')]({'plain':!![]});var _0x31a6e1=_0x5177('0x2a');return db[_0x5177('0x4e')][_0x5177('0x48')]({'where':{'name':_0x31a6e1,'userProfileId':_0x1300d7[_0x5177('0x4f')]},'raw':!![]})[_0x5177('0x28')](function(_0x217aca){if(_0x217aca&&_0x217aca[_0x5177('0x50')]===0x0){return db[_0x5177('0x2b')][_0x5177('0x4a')]({'name':_0x9dd7a2['name'],'resourceId':_0x9dd7a2['id'],'type':_0x217aca['name'],'sectionId':_0x217aca['id']},{})[_0x5177('0x28')](function(){return _0x37d5dd;});}else{return _0x37d5dd;}})['catch'](function(_0x649c6f){logger['error'](_0x5177('0x51'),_0x649c6f);throw _0x649c6f;});}return _0x37d5dd;})[_0x5177('0x28')](respondWithResult(_0x1d4ae4,0xc9))[_0x5177('0x49')](handleError(_0x1d4ae4,null));};exports['update']=function(_0x5be224,_0x19884e){if(_0x5be224[_0x5177('0x52')]['id']){delete _0x5be224[_0x5177('0x52')]['id'];}return db[_0x5177('0x2f')]['find']({'where':{'id':_0x5be224['params']['id']}})[_0x5177('0x28')](handleEntityNotFound(_0x19884e,null))[_0x5177('0x28')](saveUpdates(_0x5be224[_0x5177('0x52')],null))[_0x5177('0x28')](respondWithResult(_0x19884e,null))['catch'](handleError(_0x19884e,null));};exports[_0x5177('0x29')]=function(_0x143aff,_0x3a18ad){return db['VoiceMail'][_0x5177('0x48')]({'where':{'id':_0x143aff[_0x5177('0x46')]['id']}})[_0x5177('0x28')](handleEntityNotFound(_0x3a18ad,null))['then'](removeEntity(_0x3a18ad,null))[_0x5177('0x49')](handleError(_0x3a18ad,null));};exports['getMessages']=function(_0x40dfd6,_0x39fb92,_0x3268bd){return db['VoiceMail'][_0x5177('0x53')]({'where':{'id':_0x40dfd6[_0x5177('0x46')]['id']}})[_0x5177('0x28')](handleEntityNotFound(_0x39fb92,null))[_0x5177('0x28')](function(_0xc7a59e){var _0x74589e;var _0x37380c={},_0x267599={};_0x267599['model']=_['keys'](db['VoiceMailMessage'][_0x5177('0x54')]);_0x267599[_0x5177('0x33')]=_[_0x5177('0x34')](_0x40dfd6[_0x5177('0x33')]);_0x267599[_0x5177('0x35')]=_[_0x5177('0x36')](_0x267599['model'],_0x267599['query']);_0x37380c[_0x5177('0x38')]=_[_0x5177('0x36')](_0x267599[_0x5177('0x37')],qs[_0x5177('0x39')](_0x40dfd6[_0x5177('0x33')][_0x5177('0x39')]));_0x37380c[_0x5177('0x38')]=_0x37380c[_0x5177('0x38')][_0x5177('0x3a')]?_0x37380c['attributes']:_0x267599[_0x5177('0x37')];if(!_0x40dfd6[_0x5177('0x33')]['hasOwnProperty'](_0x5177('0x3c'))){_0x37380c[_0x5177('0x3d')]=qs['limit'](_0x40dfd6[_0x5177('0x33')][_0x5177('0x3d')]);_0x37380c[_0x5177('0x20')]=qs['offset'](_0x40dfd6[_0x5177('0x33')][_0x5177('0x20')]);}_0x37380c['order']=qs['sort'](_0x40dfd6[_0x5177('0x33')]['sort']);_0x37380c[_0x5177('0x40')]=qs['filters'](_[_0x5177('0x41')](_0x40dfd6[_0x5177('0x33')],_0x267599['filters']));if(_0x40dfd6[_0x5177('0x33')][_0x5177('0x42')]){_0x37380c[_0x5177('0x40')]=_[_0x5177('0x43')](_0x37380c[_0x5177('0x40')],{'$or':_[_0x5177('0x32')](_0x37380c[_0x5177('0x38')],function(_0x58ebdd){var _0x26b733={};_0x26b733[_0x58ebdd]={'$like':'%'+_0x40dfd6['query']['filter']+'%'};return _0x26b733;})});}_0x37380c[_0x5177('0x40')]=_[_0x5177('0x43')](_0x37380c['where'],{'mailboxuser':_0xc7a59e[_0x5177('0x55')]});_0x37380c=_[_0x5177('0x43')]({},_0x37380c,_0x40dfd6[_0x5177('0x56')]);return db[_0x5177('0x57')][_0x5177('0x58')](_0x37380c)[_0x5177('0x28')](respondWithFilteredResult(_0x39fb92,_0x37380c));})[_0x5177('0x49')](handleError(_0x39fb92,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 220a7f9..4801f07 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 _0xe29a=['lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','voice_voicemail','mailbox_context','mailbox','context'];(function(_0x518753,_0x55dc6b){var _0xd90c12=function(_0x1cca2d){while(--_0x1cca2d){_0x518753['push'](_0x518753['shift']());}};_0xd90c12(++_0x55dc6b);}(_0xe29a,0x104));var _0xae29=function(_0x456d72,_0x2d6c85){_0x456d72=_0x456d72-0x0;var _0x183819=_0xe29a[_0x456d72];return _0x183819;};'use strict';var _=require(_0xae29('0x0'));var util=require('util');var logger=require(_0xae29('0x1'))('api');var moment=require('moment');var BPromise=require(_0xae29('0x2'));var rp=require(_0xae29('0x3'));var fs=require('fs');var path=require(_0xae29('0x4'));var rimraf=require(_0xae29('0x5'));var config=require(_0xae29('0x6'));var attributes=require(_0xae29('0x7'));module[_0xae29('0x8')]=function(_0x42bb72,_0x3ed58b){return _0x42bb72['define']('VoiceMail',attributes,{'tableName':_0xae29('0x9'),'paranoid':![],'indexes':[{'name':_0xae29('0xa'),'fields':[_0xae29('0xb'),_0xae29('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5cff=['api','moment','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','voice_voicemail','mailbox_context','context','lodash','util','../../config/logger'];(function(_0x5852ac,_0xe2ae4d){var _0x5f255d=function(_0x2f5489){while(--_0x2f5489){_0x5852ac['push'](_0x5852ac['shift']());}};_0x5f255d(++_0xe2ae4d);}(_0x5cff,0x185));var _0xf5cf=function(_0x33a97b,_0x291407){_0x33a97b=_0x33a97b-0x0;var _0x13d691=_0x5cff[_0x33a97b];return _0x13d691;};'use strict';var _=require(_0xf5cf('0x0'));var util=require(_0xf5cf('0x1'));var logger=require(_0xf5cf('0x2'))(_0xf5cf('0x3'));var moment=require(_0xf5cf('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf5cf('0x5'));var rimraf=require(_0xf5cf('0x6'));var config=require(_0xf5cf('0x7'));var attributes=require(_0xf5cf('0x8'));module[_0xf5cf('0x9')]=function(_0x3d8f28,_0x40b144){return _0x3d8f28[_0xf5cf('0xa')]('VoiceMail',attributes,{'tableName':_0xf5cf('0xb'),'paranoid':![],'indexes':[{'name':_0xf5cf('0xc'),'fields':['mailbox',_0xf5cf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index a09ab6d..dc4e946 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 _0x5622=['../../config/environment','jayson/promise','client','http','request','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x3c51a9,_0x5970a4){var _0x43146f=function(_0x34a748){while(--_0x34a748){_0x3c51a9['push'](_0x3c51a9['shift']());}};_0x43146f(++_0x5970a4);}(_0x5622,0x188));var _0x2562=function(_0x25d70d,_0x3d147c){_0x25d70d=_0x25d70d-0x0;var _0x50cd46=_0x5622[_0x25d70d];return _0x50cd46;};'use strict';var _=require(_0x2562('0x0'));var util=require('util');var moment=require(_0x2562('0x1'));var BPromise=require(_0x2562('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2562('0x3'));var db=require(_0x2562('0x4'))['db'];var utils=require(_0x2562('0x5'));var logger=require('../../config/logger')(_0x2562('0x6'));var config=require(_0x2562('0x7'));var jayson=require(_0x2562('0x8'));var client=jayson[_0x2562('0x9')][_0x2562('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39bb41,_0xd47022,_0x32e71c){return new BPromise(function(_0x20d9a8,_0x4bb361){return client[_0x2562('0xb')](_0x39bb41,_0x32e71c)['then'](function(_0x958c19){logger['info'](_0x2562('0xc'),_0xd47022,_0x2562('0xd'));logger[_0x2562('0xe')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0xd47022,'request\x20sent',JSON['stringify'](_0x958c19));if(_0x958c19[_0x2562('0xf')]){if(_0x958c19[_0x2562('0xf')][_0x2562('0x10')]===0x1f4){logger[_0x2562('0xf')](_0x2562('0xc'),_0xd47022,_0x958c19[_0x2562('0xf')][_0x2562('0x11')]);return _0x4bb361(_0x958c19[_0x2562('0xf')][_0x2562('0x11')]);}logger['error'](_0x2562('0xc'),_0xd47022,_0x958c19[_0x2562('0xf')][_0x2562('0x11')]);return _0x20d9a8(_0x958c19['error'][_0x2562('0x11')]);}else{logger[_0x2562('0x12')]('VoiceMail,\x20%s,\x20%s',_0xd47022,'request\x20sent');_0x20d9a8(_0x958c19[_0x2562('0x13')][_0x2562('0x11')]);}})[_0x2562('0x14')](function(_0x29edd8){logger['error']('VoiceMail,\x20%s,\x20%s',_0xd47022,_0x29edd8);_0x4bb361(_0x29edd8);});});} \ No newline at end of file +var _0x86cd=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0xc0f7fd,_0x9fdffc){var _0x46fa94=function(_0x951c97){while(--_0x951c97){_0xc0f7fd['push'](_0xc0f7fd['shift']());}};_0x46fa94(++_0x9fdffc);}(_0x86cd,0xa4));var _0xd86c=function(_0x43a37c,_0x25a567){_0x43a37c=_0x43a37c-0x0;var _0x5d1d40=_0x86cd[_0x43a37c];return _0x5d1d40;};'use strict';var _=require(_0xd86c('0x0'));var util=require(_0xd86c('0x1'));var moment=require(_0xd86c('0x2'));var BPromise=require(_0xd86c('0x3'));var rs=require(_0xd86c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd86c('0x5'));var logger=require(_0xd86c('0x6'))(_0xd86c('0x7'));var config=require(_0xd86c('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd86c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x312534,_0x936e56,_0x34213b){return new BPromise(function(_0x28ba5c,_0x28ab87){return client[_0xd86c('0xa')](_0x312534,_0x34213b)['then'](function(_0x906daa){logger[_0xd86c('0xb')](_0xd86c('0xc'),_0x936e56,_0xd86c('0xd'));logger[_0xd86c('0xe')](_0xd86c('0xf'),_0x936e56,_0xd86c('0xd'),JSON[_0xd86c('0x10')](_0x906daa));if(_0x906daa[_0xd86c('0x11')]){if(_0x906daa[_0xd86c('0x11')][_0xd86c('0x12')]===0x1f4){logger['error'](_0xd86c('0xc'),_0x936e56,_0x906daa[_0xd86c('0x11')][_0xd86c('0x13')]);return _0x28ab87(_0x906daa['error']['message']);}logger['error'](_0xd86c('0xc'),_0x936e56,_0x906daa[_0xd86c('0x11')][_0xd86c('0x13')]);return _0x28ba5c(_0x906daa[_0xd86c('0x11')]['message']);}else{logger['info'](_0xd86c('0xc'),_0x936e56,_0xd86c('0xd'));_0x28ba5c(_0x906daa['result'][_0xd86c('0x13')]);}})[_0xd86c('0x14')](function(_0x17f65f){logger[_0xd86c('0x11')](_0xd86c('0xc'),_0x936e56,_0x17f65f);_0x28ab87(_0x17f65f);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 3e092bb..b4e0b1c 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 _0x548f=['show','/:id/download','post','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','/:id'];(function(_0x390a81,_0x2d466d){var _0x3c2333=function(_0x32fd97){while(--_0x32fd97){_0x390a81['push'](_0x390a81['shift']());}};_0x3c2333(++_0x2d466d);}(_0x548f,0x6c));var _0xf548=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x548f[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0xf548('0x0'));var util=require('util');var path=require(_0xf548('0x1'));var timeout=require(_0xf548('0x2'));var express=require('express');var router=express[_0xf548('0x3')]();var fs_extra=require(_0xf548('0x4'));var auth=require(_0xf548('0x5'));var interaction=require(_0xf548('0x6'));var config=require(_0xf548('0x7'));var controller=require(_0xf548('0x8'));router[_0xf548('0x9')]('/',auth[_0xf548('0xa')](),controller['index']);router[_0xf548('0x9')](_0xf548('0xb'),auth[_0xf548('0xa')](),controller[_0xf548('0xc')]);router[_0xf548('0x9')](_0xf548('0xd'),auth[_0xf548('0xa')](),controller['download']);router[_0xf548('0xe')]('/',auth[_0xf548('0xa')](),controller['create']);router[_0xf548('0xf')](_0xf548('0xb'),auth[_0xf548('0xa')](),controller[_0xf548('0x10')]);router[_0xf548('0x11')](_0xf548('0xb'),auth[_0xf548('0xa')](),controller[_0xf548('0x12')]);module[_0xf548('0x13')]=router; \ No newline at end of file +var _0x1647=['/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','index','get','show','/:id/download','download','post','create','put'];(function(_0x39733b,_0x40e4f0){var _0x1e5113=function(_0x3f3aaa){while(--_0x3f3aaa){_0x39733b['push'](_0x39733b['shift']());}};_0x1e5113(++_0x40e4f0);}(_0x1647,0x123));var _0x7164=function(_0x132c29,_0x56c3a0){_0x132c29=_0x132c29-0x0;var _0x3940ed=_0x1647[_0x132c29];return _0x3940ed;};'use strict';var multer=require('multer');var util=require(_0x7164('0x0'));var path=require(_0x7164('0x1'));var timeout=require(_0x7164('0x2'));var express=require(_0x7164('0x3'));var router=express['Router']();var fs_extra=require(_0x7164('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7164('0x5'));var config=require(_0x7164('0x6'));var controller=require(_0x7164('0x7'));router['get']('/',auth[_0x7164('0x8')](),controller[_0x7164('0x9')]);router[_0x7164('0xa')]('/:id',auth[_0x7164('0x8')](),controller[_0x7164('0xb')]);router['get'](_0x7164('0xc'),auth[_0x7164('0x8')](),controller[_0x7164('0xd')]);router[_0x7164('0xe')]('/',auth[_0x7164('0x8')](),controller[_0x7164('0xf')]);router[_0x7164('0x10')](_0x7164('0x11'),auth[_0x7164('0x8')](),controller[_0x7164('0x12')]);router[_0x7164('0x13')](_0x7164('0x11'),auth[_0x7164('0x8')](),controller[_0x7164('0x14')]);module[_0x7164('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 588333e..a7ce5e8 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 _0x9978=['exports','VIRTUAL','getDataValue','INTEGER','STRING','long','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize'];(function(_0x430e4d,_0xda14b8){var _0x3d7a0a=function(_0x1da869){while(--_0x1da869){_0x430e4d['push'](_0x430e4d['shift']());}};_0x3d7a0a(++_0xda14b8);}(_0x9978,0x104));var _0x8997=function(_0x57e6ad,_0x255ffe){_0x57e6ad=_0x57e6ad-0x0;var _0x36a053=_0x9978[_0x57e6ad];return _0x36a053;};'use strict';var Sequelize=require(_0x8997('0x0'));module[_0x8997('0x1')]={'name':{'type':Sequelize[_0x8997('0x2')],'get':function(_0x593d41){return this[_0x8997('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x8997('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x8997('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x8997('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x8997('0x5')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x8997('0x5')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x8997('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x8997('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x8997('0x5')],'defaultValue':''},'stamp':{'type':_0x8997('0x7'),'defaultValue':Sequelize['literal'](_0x8997('0x8'))}}; \ No newline at end of file +var _0x92cf=['sequelize','exports','getDataValue','INTEGER','STRING','BLOB','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x92cf,0x1a8));var _0xf92c=function(_0x2741d1,_0x501426){_0x2741d1=_0x2741d1-0x0;var _0x521e37=_0x92cf[_0x2741d1];return _0x521e37;};'use strict';var Sequelize=require(_0xf92c('0x0'));module[_0xf92c('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x165e76){return this[_0xf92c('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xf92c('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xf92c('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xf92c('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xf92c('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xf92c('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xf92c('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xf92c('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xf92c('0x5')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0xf92c('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xf92c('0x6'),'defaultValue':Sequelize['literal'](_0xf92c('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index b7dd870..8dbca87 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 _0x48ed=['sendStatus','end','json','offset','undefined','limit','count','status','apply','reject','save','update','then','error','name','index','VoiceMailMessage','differenceBy','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','destroy','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','set','send','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x1fbc62,_0x4a4a34){var _0x35e9ad=function(_0x5d7062){while(--_0x5d7062){_0x1fbc62['push'](_0x1fbc62['shift']());}};_0x35e9ad(++_0x4a4a34);}(_0x48ed,0x1d5));var _0xd48e=function(_0x5e8295,_0x4fcee0){_0x5e8295=_0x5e8295-0x0;var _0x2b08aa=_0x48ed[_0x5e8295];return _0x2b08aa;};'use strict';var emlformat=require(_0xd48e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd48e('0x1'));var jsonpatch=require(_0xd48e('0x2'));var rp=require(_0xd48e('0x3'));var moment=require('moment');var BPromise=require(_0xd48e('0x4'));var Mustache=require(_0xd48e('0x5'));var util=require(_0xd48e('0x6'));var path=require(_0xd48e('0x7'));var sox=require(_0xd48e('0x8'));var csv=require(_0xd48e('0x9'));var ejs=require(_0xd48e('0xa'));var fs=require('fs');var fs_extra=require(_0xd48e('0xb'));var _=require(_0xd48e('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd48e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd48e('0x9'));var querystring=require(_0xd48e('0xe'));var Papa=require(_0xd48e('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd48e('0x10'));var as=require(_0xd48e('0x11'));var hardwareService=require(_0xd48e('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xd48e('0x13'));var config=require(_0xd48e('0x14'));var licenseUtil=require(_0xd48e('0x15'));var db=require(_0xd48e('0x16'))['db'];function respondWithStatusCode(_0x1a023d,_0x5ca366){_0x5ca366=_0x5ca366||0xcc;return function(_0x30dcda){if(_0x30dcda){return _0x1a023d[_0xd48e('0x17')](_0x5ca366);}return _0x1a023d['status'](_0x5ca366)[_0xd48e('0x18')]();};}function respondWithResult(_0x32e2ce,_0x599481){_0x599481=_0x599481||0xc8;return function(_0x2cdca2){if(_0x2cdca2){return _0x32e2ce['status'](_0x599481)[_0xd48e('0x19')](_0x2cdca2);}};}function respondWithFilteredResult(_0x10547c,_0x178d66){return function(_0x3f68c9){if(_0x3f68c9){var _0x3d1524=typeof _0x178d66[_0xd48e('0x1a')]===_0xd48e('0x1b')&&typeof _0x178d66[_0xd48e('0x1c')]===_0xd48e('0x1b');var _0xac8293=_0x3f68c9[_0xd48e('0x1d')];var _0x4e098a=_0x3d1524?0x0:_0x178d66[_0xd48e('0x1a')];var _0xd22511=_0x3d1524?_0x3f68c9['count']:_0x178d66[_0xd48e('0x1a')]+_0x178d66[_0xd48e('0x1c')];var _0x2959e8;if(_0xd22511>=_0xac8293){_0xd22511=_0xac8293;_0x2959e8=0xc8;}else{_0x2959e8=0xce;}_0x10547c[_0xd48e('0x1e')](_0x2959e8);return _0x10547c['set']('Content-Range',_0x4e098a+'-'+_0xd22511+'/'+_0xac8293)['json'](_0x3f68c9);}return null;};}function patchUpdates(_0x1b2c6b){return function(_0x1b52d3){try{jsonpatch[_0xd48e('0x1f')](_0x1b52d3,_0x1b2c6b,!![]);}catch(_0x198d43){return BPromise[_0xd48e('0x20')](_0x198d43);}return _0x1b52d3[_0xd48e('0x21')]();};}function saveUpdates(_0x781018,_0x3e5dc5){return function(_0x547e35){if(_0x547e35){return _0x547e35[_0xd48e('0x22')](_0x781018)[_0xd48e('0x23')](function(_0x3704be){return _0x3704be;});}return null;};}function removeEntity(_0x1755ed,_0x3e6434){return function(_0x1aa18a){if(_0x1aa18a){return _0x1aa18a['destroy']()['then'](function(){_0x1755ed[_0xd48e('0x1e')](0xcc)[_0xd48e('0x18')]();});}};}function handleEntityNotFound(_0x2999b7,_0x427bdb){return function(_0x1741a1){if(!_0x1741a1){_0x2999b7[_0xd48e('0x17')](0x194);}return _0x1741a1;};}function handleError(_0x1788b5,_0x23b441){_0x23b441=_0x23b441||0x1f4;return function(_0x5c4afa){logger[_0xd48e('0x24')](_0x5c4afa['stack']);if(_0x5c4afa['name']){delete _0x5c4afa[_0xd48e('0x25')];}_0x1788b5[_0xd48e('0x1e')](_0x23b441)['send'](_0x5c4afa);};}exports[_0xd48e('0x26')]=function(_0x295849,_0x527464){var _0x50de8b={},_0x3b3a1c={},_0x493637={'count':0x0,'rows':[]};var _0x1fbe24=_['map'](db[_0xd48e('0x27')]['rawAttributes'],function(_0xc1a7b1){return{'name':_0xc1a7b1['fieldName'],'type':_0xc1a7b1['type']['key']};});_0x3b3a1c['model']=_[_0xd48e('0x28')](_['map'](_0x1fbe24,_0xd48e('0x25')),[_0xd48e('0x25')]);_0x3b3a1c['query']=_[_0xd48e('0x29')](_0x295849[_0xd48e('0x2a')]);_0x3b3a1c[_0xd48e('0x2b')]=_[_0xd48e('0x2c')](_0x3b3a1c[_0xd48e('0x2d')],_0x3b3a1c[_0xd48e('0x2a')]);_0x50de8b['attributes']=_[_0xd48e('0x2c')](_0x3b3a1c[_0xd48e('0x2d')],qs['fields'](_0x295849[_0xd48e('0x2a')][_0xd48e('0x2e')]));_0x50de8b[_0xd48e('0x2f')]=_0x50de8b[_0xd48e('0x2f')][_0xd48e('0x30')]?_0x50de8b['attributes']:_0x3b3a1c[_0xd48e('0x2d')];if(!_0x295849['query'][_0xd48e('0x31')](_0xd48e('0x32'))){_0x50de8b['limit']=qs[_0xd48e('0x1c')](_0x295849[_0xd48e('0x2a')][_0xd48e('0x1c')]);_0x50de8b[_0xd48e('0x1a')]=qs[_0xd48e('0x1a')](_0x295849[_0xd48e('0x2a')]['offset']);}_0x50de8b[_0xd48e('0x33')]=qs[_0xd48e('0x34')](_0x295849['query'][_0xd48e('0x34')]);_0x50de8b[_0xd48e('0x35')]=qs[_0xd48e('0x2b')](_[_0xd48e('0x36')](_0x295849['query'],_0x3b3a1c['filters']),_0x1fbe24);if(_0x295849[_0xd48e('0x2a')]['filter']){_0x50de8b[_0xd48e('0x35')]=_[_0xd48e('0x37')](_0x50de8b[_0xd48e('0x35')],{'$or':_[_0xd48e('0x38')](_0x1fbe24,function(_0xe1c8f6){if(_0xe1c8f6[_0xd48e('0x39')]!==_0xd48e('0x3a')){var _0x3d346d={};_0x3d346d[_0xe1c8f6[_0xd48e('0x25')]]={'$like':'%'+_0x295849[_0xd48e('0x2a')]['filter']+'%'};return _0x3d346d;}})});}_0x50de8b=_[_0xd48e('0x37')]({},_0x50de8b,_0x295849[_0xd48e('0x3b')]);var _0x3456c4={'where':_0x50de8b['where']};return db['VoiceMailMessage'][_0xd48e('0x1d')](_0x3456c4)[_0xd48e('0x23')](function(_0x1296de){_0x493637[_0xd48e('0x1d')]=_0x1296de;if(_0x295849[_0xd48e('0x2a')][_0xd48e('0x3c')]){_0x50de8b[_0xd48e('0x3d')]=[{'all':!![]}];}return db[_0xd48e('0x27')][_0xd48e('0x3e')](_0x50de8b);})['then'](function(_0x4aa1e6){_0x493637[_0xd48e('0x3f')]=_0x4aa1e6;return _0x493637;})[_0xd48e('0x23')](respondWithFilteredResult(_0x527464,_0x50de8b))[_0xd48e('0x40')](handleError(_0x527464,null));};exports['show']=function(_0x5df9a4,_0x550579){var _0x5d00ba={'raw':!![],'where':{'id':_0x5df9a4[_0xd48e('0x41')]['id']}},_0x3ba71e={};_0x3ba71e[_0xd48e('0x2d')]=_[_0xd48e('0x29')](db[_0xd48e('0x27')][_0xd48e('0x42')]);_0x3ba71e[_0xd48e('0x2a')]=_[_0xd48e('0x29')](_0x5df9a4[_0xd48e('0x2a')]);_0x3ba71e['filters']=_['intersection'](_0x3ba71e['model'],_0x3ba71e['query']);_0x5d00ba[_0xd48e('0x2f')]=_[_0xd48e('0x2c')](_0x3ba71e['model'],qs[_0xd48e('0x2e')](_0x5df9a4[_0xd48e('0x2a')][_0xd48e('0x2e')]));_0x5d00ba[_0xd48e('0x2f')]=_0x5d00ba[_0xd48e('0x2f')]['length']?_0x5d00ba['attributes']:_0x3ba71e[_0xd48e('0x2d')];if(_0x5df9a4['query'][_0xd48e('0x3c')]){_0x5d00ba[_0xd48e('0x3d')]=[{'all':!![]}];}_0x5d00ba=_[_0xd48e('0x37')]({},_0x5d00ba,_0x5df9a4[_0xd48e('0x3b')]);return db[_0xd48e('0x27')][_0xd48e('0x43')](_0x5d00ba)[_0xd48e('0x23')](handleEntityNotFound(_0x550579,null))['then'](respondWithResult(_0x550579,null))[_0xd48e('0x40')](handleError(_0x550579,null));};exports['create']=function(_0x2d49f7,_0x30b6df){return db[_0xd48e('0x27')][_0xd48e('0x44')](_0x2d49f7['body'],{})[_0xd48e('0x23')](respondWithResult(_0x30b6df,0xc9))['catch'](handleError(_0x30b6df,null));};exports['update']=function(_0x221fbc,_0x1547cb){if(_0x221fbc[_0xd48e('0x45')]['id']){delete _0x221fbc[_0xd48e('0x45')]['id'];}return db[_0xd48e('0x27')][_0xd48e('0x43')]({'where':{'id':_0x221fbc['params']['id']}})[_0xd48e('0x23')](handleEntityNotFound(_0x1547cb,null))['then'](saveUpdates(_0x221fbc['body'],null))[_0xd48e('0x23')](respondWithResult(_0x1547cb,null))['catch'](handleError(_0x1547cb,null));};exports[_0xd48e('0x46')]=function(_0x5d3395,_0x285366){return db[_0xd48e('0x27')][_0xd48e('0x43')]({'where':{'id':_0x5d3395[_0xd48e('0x41')]['id']}})[_0xd48e('0x23')](handleEntityNotFound(_0x285366,null))['then'](removeEntity(_0x285366,null))[_0xd48e('0x40')](handleError(_0x285366,null));};exports['download']=function(_0x1564db,_0x4d536d,_0x2d43ed){return db['VoiceMailMessage'][_0xd48e('0x43')]({'where':{'id':_0x1564db[_0xd48e('0x41')]['id']},'attributes':['id',_0xd48e('0x47'),_0xd48e('0x48')]})[_0xd48e('0x23')](handleEntityNotFound(_0x4d536d,null))['then'](function(_0x573162){if(_0x573162){if(!_0x573162[_0xd48e('0x47')]){throw new db[(_0xd48e('0x49'))]['ValidationError'](_0xd48e('0x4a'));}var _0x503111={'Content-Type':_0xd48e('0x4b'),'Content-Disposition':_0xd48e('0x4c')};if(_0x573162[_0xd48e('0x48')]){_0x503111[_0xd48e('0x4d')]=_0xd48e('0x4e')+_0x573162['msg_id']+_0xd48e('0x4f');}_0x4d536d[_0xd48e('0x50')](_0x503111);return _0x4d536d[_0xd48e('0x51')](new Buffer(_0x573162['recording']));}})[_0xd48e('0x40')](handleError(_0x4d536d,null));}; \ No newline at end of file +var _0xa308=['merge','VIRTUAL','options','includeAll','findAll','catch','params','intersection','include','find','create','body','update','download','recording','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','destroy','then','sendStatus','error','stack','name','send','index','VoiceMailMessage','rawAttributes','fieldName','model','differenceBy','map','keys','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter'];(function(_0x4004a1,_0x3aa42a){var _0x1eac1c=function(_0x3480a3){while(--_0x3480a3){_0x4004a1['push'](_0x4004a1['shift']());}};_0x1eac1c(++_0x3aa42a);}(_0xa308,0x1ca));var _0x8a30=function(_0x138836,_0x229129){_0x138836=_0x138836-0x0;var _0x322688=_0xa308[_0x138836];return _0x322688;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8a30('0x0'));var zipdir=require(_0x8a30('0x1'));var jsonpatch=require(_0x8a30('0x2'));var rp=require(_0x8a30('0x3'));var moment=require(_0x8a30('0x4'));var BPromise=require(_0x8a30('0x5'));var Mustache=require(_0x8a30('0x6'));var util=require(_0x8a30('0x7'));var path=require('path');var sox=require(_0x8a30('0x8'));var csv=require(_0x8a30('0x9'));var ejs=require(_0x8a30('0xa'));var fs=require('fs');var fs_extra=require(_0x8a30('0xb'));var _=require(_0x8a30('0xc'));var squel=require(_0x8a30('0xd'));var crypto=require(_0x8a30('0xe'));var jsforce=require(_0x8a30('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8a30('0x9'));var querystring=require(_0x8a30('0x10'));var Papa=require(_0x8a30('0x11'));var Redis=require(_0x8a30('0x12'));var authService=require(_0x8a30('0x13'));var qs=require(_0x8a30('0x14'));var as=require(_0x8a30('0x15'));var hardwareService=require(_0x8a30('0x16'));var logger=require('../../config/logger')(_0x8a30('0x17'));var utils=require(_0x8a30('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8a30('0x19'));var db=require(_0x8a30('0x1a'))['db'];function respondWithStatusCode(_0x5369ff,_0x5b22d3){_0x5b22d3=_0x5b22d3||0xcc;return function(_0x3f1bc7){if(_0x3f1bc7){return _0x5369ff['sendStatus'](_0x5b22d3);}return _0x5369ff[_0x8a30('0x1b')](_0x5b22d3)[_0x8a30('0x1c')]();};}function respondWithResult(_0x304289,_0x1b8646){_0x1b8646=_0x1b8646||0xc8;return function(_0x4686b6){if(_0x4686b6){return _0x304289[_0x8a30('0x1b')](_0x1b8646)[_0x8a30('0x1d')](_0x4686b6);}};}function respondWithFilteredResult(_0x40205c,_0x5760b9){return function(_0xe24c47){if(_0xe24c47){var _0x5058ca=typeof _0x5760b9[_0x8a30('0x1e')]==='undefined'&&typeof _0x5760b9[_0x8a30('0x1f')]===_0x8a30('0x20');var _0x4238b8=_0xe24c47[_0x8a30('0x21')];var _0x46d9d1=_0x5058ca?0x0:_0x5760b9[_0x8a30('0x1e')];var _0x25905b=_0x5058ca?_0xe24c47[_0x8a30('0x21')]:_0x5760b9[_0x8a30('0x1e')]+_0x5760b9[_0x8a30('0x1f')];var _0x137bf0;if(_0x25905b>=_0x4238b8){_0x25905b=_0x4238b8;_0x137bf0=0xc8;}else{_0x137bf0=0xce;}_0x40205c[_0x8a30('0x1b')](_0x137bf0);return _0x40205c[_0x8a30('0x22')](_0x8a30('0x23'),_0x46d9d1+'-'+_0x25905b+'/'+_0x4238b8)[_0x8a30('0x1d')](_0xe24c47);}return null;};}function patchUpdates(_0x4e72f9){return function(_0xd6c109){try{jsonpatch[_0x8a30('0x24')](_0xd6c109,_0x4e72f9,!![]);}catch(_0x1d1dd5){return BPromise['reject'](_0x1d1dd5);}return _0xd6c109[_0x8a30('0x25')]();};}function saveUpdates(_0x42363f,_0x356d89){return function(_0x1a2b3f){if(_0x1a2b3f){return _0x1a2b3f['update'](_0x42363f)['then'](function(_0x46b62f){return _0x46b62f;});}return null;};}function removeEntity(_0x1b2e00,_0x2bd8a5){return function(_0x489eb5){if(_0x489eb5){return _0x489eb5[_0x8a30('0x26')]()[_0x8a30('0x27')](function(){_0x1b2e00[_0x8a30('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e55c9,_0x5e165c){return function(_0x416d8){if(!_0x416d8){_0x5e55c9[_0x8a30('0x28')](0x194);}return _0x416d8;};}function handleError(_0x464930,_0x950ec5){_0x950ec5=_0x950ec5||0x1f4;return function(_0x38ae7c){logger[_0x8a30('0x29')](_0x38ae7c[_0x8a30('0x2a')]);if(_0x38ae7c[_0x8a30('0x2b')]){delete _0x38ae7c[_0x8a30('0x2b')];}_0x464930[_0x8a30('0x1b')](_0x950ec5)[_0x8a30('0x2c')](_0x38ae7c);};}exports[_0x8a30('0x2d')]=function(_0x4a0889,_0x36fe6d){var _0x14634d={},_0x3be1b5={},_0x8e5a3c={'count':0x0,'rows':[]};var _0x3f6022=_['map'](db[_0x8a30('0x2e')][_0x8a30('0x2f')],function(_0x91d299){return{'name':_0x91d299[_0x8a30('0x30')],'type':_0x91d299['type']['key']};});_0x3be1b5[_0x8a30('0x31')]=_[_0x8a30('0x32')](_[_0x8a30('0x33')](_0x3f6022,_0x8a30('0x2b')),['name']);_0x3be1b5['query']=_[_0x8a30('0x34')](_0x4a0889[_0x8a30('0x35')]);_0x3be1b5[_0x8a30('0x36')]=_['intersection'](_0x3be1b5[_0x8a30('0x31')],_0x3be1b5[_0x8a30('0x35')]);_0x14634d[_0x8a30('0x37')]=_['intersection'](_0x3be1b5[_0x8a30('0x31')],qs[_0x8a30('0x38')](_0x4a0889[_0x8a30('0x35')]['fields']));_0x14634d['attributes']=_0x14634d[_0x8a30('0x37')][_0x8a30('0x39')]?_0x14634d[_0x8a30('0x37')]:_0x3be1b5[_0x8a30('0x31')];if(!_0x4a0889[_0x8a30('0x35')][_0x8a30('0x3a')]('nolimit')){_0x14634d[_0x8a30('0x1f')]=qs[_0x8a30('0x1f')](_0x4a0889[_0x8a30('0x35')][_0x8a30('0x1f')]);_0x14634d[_0x8a30('0x1e')]=qs[_0x8a30('0x1e')](_0x4a0889[_0x8a30('0x35')]['offset']);}_0x14634d[_0x8a30('0x3b')]=qs[_0x8a30('0x3c')](_0x4a0889['query']['sort']);_0x14634d[_0x8a30('0x3d')]=qs[_0x8a30('0x36')](_[_0x8a30('0x3e')](_0x4a0889[_0x8a30('0x35')],_0x3be1b5[_0x8a30('0x36')]),_0x3f6022);if(_0x4a0889[_0x8a30('0x35')][_0x8a30('0x3f')]){_0x14634d[_0x8a30('0x3d')]=_[_0x8a30('0x40')](_0x14634d[_0x8a30('0x3d')],{'$or':_[_0x8a30('0x33')](_0x3f6022,function(_0x35fec1){if(_0x35fec1['type']!==_0x8a30('0x41')){var _0x2aa710={};_0x2aa710[_0x35fec1[_0x8a30('0x2b')]]={'$like':'%'+_0x4a0889[_0x8a30('0x35')]['filter']+'%'};return _0x2aa710;}})});}_0x14634d=_[_0x8a30('0x40')]({},_0x14634d,_0x4a0889[_0x8a30('0x42')]);var _0xb473a9={'where':_0x14634d['where']};return db[_0x8a30('0x2e')][_0x8a30('0x21')](_0xb473a9)[_0x8a30('0x27')](function(_0x587648){_0x8e5a3c[_0x8a30('0x21')]=_0x587648;if(_0x4a0889['query'][_0x8a30('0x43')]){_0x14634d['include']=[{'all':!![]}];}return db[_0x8a30('0x2e')][_0x8a30('0x44')](_0x14634d);})[_0x8a30('0x27')](function(_0x5c091d){_0x8e5a3c['rows']=_0x5c091d;return _0x8e5a3c;})[_0x8a30('0x27')](respondWithFilteredResult(_0x36fe6d,_0x14634d))[_0x8a30('0x45')](handleError(_0x36fe6d,null));};exports['show']=function(_0x4dfbb6,_0xe51a3f){var _0x172541={'raw':!![],'where':{'id':_0x4dfbb6[_0x8a30('0x46')]['id']}},_0x28292a={};_0x28292a[_0x8a30('0x31')]=_[_0x8a30('0x34')](db[_0x8a30('0x2e')]['rawAttributes']);_0x28292a[_0x8a30('0x35')]=_[_0x8a30('0x34')](_0x4dfbb6[_0x8a30('0x35')]);_0x28292a[_0x8a30('0x36')]=_['intersection'](_0x28292a[_0x8a30('0x31')],_0x28292a[_0x8a30('0x35')]);_0x172541[_0x8a30('0x37')]=_[_0x8a30('0x47')](_0x28292a[_0x8a30('0x31')],qs[_0x8a30('0x38')](_0x4dfbb6[_0x8a30('0x35')][_0x8a30('0x38')]));_0x172541[_0x8a30('0x37')]=_0x172541['attributes'][_0x8a30('0x39')]?_0x172541[_0x8a30('0x37')]:_0x28292a[_0x8a30('0x31')];if(_0x4dfbb6[_0x8a30('0x35')][_0x8a30('0x43')]){_0x172541[_0x8a30('0x48')]=[{'all':!![]}];}_0x172541=_[_0x8a30('0x40')]({},_0x172541,_0x4dfbb6[_0x8a30('0x42')]);return db[_0x8a30('0x2e')][_0x8a30('0x49')](_0x172541)['then'](handleEntityNotFound(_0xe51a3f,null))[_0x8a30('0x27')](respondWithResult(_0xe51a3f,null))[_0x8a30('0x45')](handleError(_0xe51a3f,null));};exports['create']=function(_0x585f62,_0x1127c7){return db[_0x8a30('0x2e')][_0x8a30('0x4a')](_0x585f62[_0x8a30('0x4b')],{})[_0x8a30('0x27')](respondWithResult(_0x1127c7,0xc9))['catch'](handleError(_0x1127c7,null));};exports[_0x8a30('0x4c')]=function(_0x580775,_0x117391){if(_0x580775[_0x8a30('0x4b')]['id']){delete _0x580775[_0x8a30('0x4b')]['id'];}return db[_0x8a30('0x2e')]['find']({'where':{'id':_0x580775[_0x8a30('0x46')]['id']}})[_0x8a30('0x27')](handleEntityNotFound(_0x117391,null))['then'](saveUpdates(_0x580775[_0x8a30('0x4b')],null))[_0x8a30('0x27')](respondWithResult(_0x117391,null))[_0x8a30('0x45')](handleError(_0x117391,null));};exports[_0x8a30('0x26')]=function(_0x5943dc,_0x2bcea0){return db[_0x8a30('0x2e')][_0x8a30('0x49')]({'where':{'id':_0x5943dc[_0x8a30('0x46')]['id']}})[_0x8a30('0x27')](handleEntityNotFound(_0x2bcea0,null))[_0x8a30('0x27')](removeEntity(_0x2bcea0,null))[_0x8a30('0x45')](handleError(_0x2bcea0,null));};exports[_0x8a30('0x4d')]=function(_0x249ba9,_0x44f9c0,_0x4a279c){return db[_0x8a30('0x2e')][_0x8a30('0x49')]({'where':{'id':_0x249ba9['params']['id']},'attributes':['id',_0x8a30('0x4e'),'msg_id']})[_0x8a30('0x27')](handleEntityNotFound(_0x44f9c0,null))['then'](function(_0x268040){if(_0x268040){if(!_0x268040[_0x8a30('0x4e')]){throw new db['Sequelize'][(_0x8a30('0x4f'))](_0x8a30('0x50'));}var _0x1eaa55={'Content-Type':_0x8a30('0x51'),'Content-Disposition':_0x8a30('0x52')};if(_0x268040[_0x8a30('0x53')]){_0x1eaa55[_0x8a30('0x54')]=_0x8a30('0x55')+_0x268040[_0x8a30('0x53')]+_0x8a30('0x56');}_0x44f9c0[_0x8a30('0x22')](_0x1eaa55);return _0x44f9c0[_0x8a30('0x2c')](new Buffer(_0x268040['recording']));}})[_0x8a30('0x45')](handleError(_0x44f9c0,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index c2d956b..ffe1b6f 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 _0xcde1=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceMailMessage','dir','lodash','util'];(function(_0x4df17c,_0x2d2b61){var _0x4e79b5=function(_0x2134a5){while(--_0x2134a5){_0x4df17c['push'](_0x4df17c['shift']());}};_0x4e79b5(++_0x2d2b61);}(_0xcde1,0x16a));var _0x1cde=function(_0x52cb49,_0x3cf912){_0x52cb49=_0x52cb49-0x0;var _0xf337b4=_0xcde1[_0x52cb49];return _0xf337b4;};'use strict';var _=require(_0x1cde('0x0'));var util=require(_0x1cde('0x1'));var logger=require('../../config/logger')(_0x1cde('0x2'));var moment=require(_0x1cde('0x3'));var BPromise=require(_0x1cde('0x4'));var rp=require(_0x1cde('0x5'));var fs=require('fs');var path=require(_0x1cde('0x6'));var rimraf=require(_0x1cde('0x7'));var config=require(_0x1cde('0x8'));var attributes=require('./voiceMailMessage.attributes');module[_0x1cde('0x9')]=function(_0x496bff,_0x504fe9){return _0x496bff[_0x1cde('0xa')](_0x1cde('0xb'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x1cde('0xc'),'fields':[_0x1cde('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0xadd2=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir'];(function(_0x3dac71,_0x4dc62d){var _0x60d901=function(_0x2e4507){while(--_0x2e4507){_0x3dac71['push'](_0x3dac71['shift']());}};_0x60d901(++_0x4dc62d);}(_0xadd2,0x8c));var _0x2add=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xadd2[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x2add('0x0'));var util=require(_0x2add('0x1'));var logger=require('../../config/logger')(_0x2add('0x2'));var moment=require(_0x2add('0x3'));var BPromise=require(_0x2add('0x4'));var rp=require(_0x2add('0x5'));var fs=require('fs');var path=require(_0x2add('0x6'));var rimraf=require('rimraf');var config=require(_0x2add('0x7'));var attributes=require(_0x2add('0x8'));module[_0x2add('0x9')]=function(_0x532afd,_0x138f82){return _0x532afd[_0x2add('0xa')](_0x2add('0xb'),attributes,{'tableName':_0x2add('0xc'),'paranoid':![],'indexes':[{'name':_0x2add('0xd'),'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 f8beda7..203033e 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 _0xe0b3=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x4f14c5,_0x4a2ea9){var _0x477f1c=function(_0x431d2a){while(--_0x431d2a){_0x4f14c5['push'](_0x4f14c5['shift']());}};_0x477f1c(++_0x4a2ea9);}(_0xe0b3,0x1df));var _0x3e0b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe0b3[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x3e0b('0x0'));var moment=require(_0x3e0b('0x1'));var BPromise=require(_0x3e0b('0x2'));var rs=require(_0x3e0b('0x3'));var fs=require('fs');var Redis=require(_0x3e0b('0x4'));var db=require(_0x3e0b('0x5'))['db'];var utils=require(_0x3e0b('0x6'));var logger=require(_0x3e0b('0x7'))(_0x3e0b('0x8'));var config=require(_0x3e0b('0x9'));var jayson=require(_0x3e0b('0xa'));var client=jayson[_0x3e0b('0xb')][_0x3e0b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x37d93d,_0x2bfbaa,_0x788947){return new BPromise(function(_0x207e92,_0x590055){return client[_0x3e0b('0xd')](_0x37d93d,_0x788947)['then'](function(_0xaafe85){logger[_0x3e0b('0xe')](_0x3e0b('0xf'),_0x2bfbaa,_0x3e0b('0x10'));logger[_0x3e0b('0x11')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x2bfbaa,_0x3e0b('0x10'),JSON[_0x3e0b('0x12')](_0xaafe85));if(_0xaafe85[_0x3e0b('0x13')]){if(_0xaafe85[_0x3e0b('0x13')]['code']===0x1f4){logger['error'](_0x3e0b('0xf'),_0x2bfbaa,_0xaafe85[_0x3e0b('0x13')]['message']);return _0x590055(_0xaafe85[_0x3e0b('0x13')][_0x3e0b('0x14')]);}logger[_0x3e0b('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x2bfbaa,_0xaafe85['error'][_0x3e0b('0x14')]);return _0x207e92(_0xaafe85['error'][_0x3e0b('0x14')]);}else{logger[_0x3e0b('0xe')](_0x3e0b('0xf'),_0x2bfbaa,'request\x20sent');_0x207e92(_0xaafe85['result'][_0x3e0b('0x14')]);}})[_0x3e0b('0x15')](function(_0x8fa996){logger[_0x3e0b('0x13')](_0x3e0b('0xf'),_0x2bfbaa,_0x8fa996);_0x590055(_0x8fa996);});});} \ No newline at end of file +var _0x833d=['VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x2b4ecf,_0x58a97){var _0x34faa4=function(_0x10210e){while(--_0x10210e){_0x2b4ecf['push'](_0x2b4ecf['shift']());}};_0x34faa4(++_0x58a97);}(_0x833d,0xba));var _0xd833=function(_0x3d545c,_0x416d99){_0x3d545c=_0x3d545c-0x0;var _0x7f25c6=_0x833d[_0x3d545c];return _0x7f25c6;};'use strict';var _=require(_0xd833('0x0'));var util=require('util');var moment=require(_0xd833('0x1'));var BPromise=require(_0xd833('0x2'));var rs=require(_0xd833('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd833('0x4'));var logger=require(_0xd833('0x5'))('rpc');var config=require(_0xd833('0x6'));var jayson=require(_0xd833('0x7'));var client=jayson[_0xd833('0x8')][_0xd833('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8e93b6,_0x574305,_0x4c9456){return new BPromise(function(_0x4825ae,_0x48de62){return client['request'](_0x8e93b6,_0x4c9456)[_0xd833('0xa')](function(_0x5b35f4){logger[_0xd833('0xb')](_0xd833('0xc'),_0x574305,'request\x20sent');logger[_0xd833('0xd')](_0xd833('0xe'),_0x574305,_0xd833('0xf'),JSON[_0xd833('0x10')](_0x5b35f4));if(_0x5b35f4['error']){if(_0x5b35f4[_0xd833('0x11')][_0xd833('0x12')]===0x1f4){logger['error'](_0xd833('0xc'),_0x574305,_0x5b35f4[_0xd833('0x11')]['message']);return _0x48de62(_0x5b35f4[_0xd833('0x11')][_0xd833('0x13')]);}logger[_0xd833('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x574305,_0x5b35f4[_0xd833('0x11')]['message']);return _0x4825ae(_0x5b35f4['error'][_0xd833('0x13')]);}else{logger[_0xd833('0xb')](_0xd833('0xc'),_0x574305,_0xd833('0xf'));_0x4825ae(_0x5b35f4[_0xd833('0x14')][_0xd833('0x13')]);}})[_0xd833('0x15')](function(_0x1d1db2){logger[_0xd833('0x11')](_0xd833('0xc'),_0x574305,_0x1d1db2);_0x48de62(_0x1d1db2);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 6bf79fc..c4f48f8 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 _0x11e5=['index','/:id','show','getSounds','post','create','addSound','put','delete','destroy','/:id/sounds/:id2','removeSound','exports','util','path','express','Router','fs-extra','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated'];(function(_0x49c653,_0x390195){var _0x31e169=function(_0x3684ac){while(--_0x3684ac){_0x49c653['push'](_0x49c653['shift']());}};_0x31e169(++_0x390195);}(_0x11e5,0x7b));var _0x511e=function(_0x986fec,_0x5bd00f){_0x986fec=_0x986fec-0x0;var _0x50db2f=_0x11e5[_0x986fec];return _0x50db2f;};'use strict';var multer=require('multer');var util=require(_0x511e('0x0'));var path=require(_0x511e('0x1'));var timeout=require('connect-timeout');var express=require(_0x511e('0x2'));var router=express[_0x511e('0x3')]();var fs_extra=require(_0x511e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x511e('0x5'));var controller=require(_0x511e('0x6'));router[_0x511e('0x7')]('/',auth[_0x511e('0x8')](),controller[_0x511e('0x9')]);router['get'](_0x511e('0xa'),auth[_0x511e('0x8')](),controller[_0x511e('0xb')]);router[_0x511e('0x7')]('/:id/sounds',auth[_0x511e('0x8')](),controller[_0x511e('0xc')]);router[_0x511e('0xd')]('/',auth['isAuthenticated'](),controller[_0x511e('0xe')]);router[_0x511e('0xd')]('/:id/sounds',auth['isAuthenticated'](),controller[_0x511e('0xf')]);router[_0x511e('0x10')](_0x511e('0xa'),auth[_0x511e('0x8')](),controller['update']);router[_0x511e('0x11')](_0x511e('0xa'),auth[_0x511e('0x8')](),controller[_0x511e('0x12')]);router['delete'](_0x511e('0x13'),auth['isAuthenticated'](),controller[_0x511e('0x14')]);module[_0x511e('0x15')]=router; \ No newline at end of file +var _0x317d=['update','delete','/:id/sounds/:id2','removeSound','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','index','/:id','/:id/sounds','isAuthenticated','getSounds','post','addSound','put'];(function(_0x30417e,_0x33b3a1){var _0x549274=function(_0x45ac3f){while(--_0x45ac3f){_0x30417e['push'](_0x30417e['shift']());}};_0x549274(++_0x33b3a1);}(_0x317d,0x1cd));var _0xd317=function(_0x427bc2,_0x4e4334){_0x427bc2=_0x427bc2-0x0;var _0x36c8ce=_0x317d[_0x427bc2];return _0x36c8ce;};'use strict';var multer=require(_0xd317('0x0'));var util=require(_0xd317('0x1'));var path=require(_0xd317('0x2'));var timeout=require('connect-timeout');var express=require(_0xd317('0x3'));var router=express[_0xd317('0x4')]();var fs_extra=require(_0xd317('0x5'));var auth=require(_0xd317('0x6'));var interaction=require(_0xd317('0x7'));var config=require(_0xd317('0x8'));var controller=require(_0xd317('0x9'));router[_0xd317('0xa')]('/',auth['isAuthenticated'](),controller[_0xd317('0xb')]);router[_0xd317('0xa')](_0xd317('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0xd317('0xd'),auth[_0xd317('0xe')](),controller[_0xd317('0xf')]);router[_0xd317('0x10')]('/',auth[_0xd317('0xe')](),controller['create']);router[_0xd317('0x10')](_0xd317('0xd'),auth['isAuthenticated'](),controller[_0xd317('0x11')]);router[_0xd317('0x12')](_0xd317('0xc'),auth[_0xd317('0xe')](),controller[_0xd317('0x13')]);router['delete'](_0xd317('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0xd317('0x14')](_0xd317('0x15'),auth['isAuthenticated'](),controller[_0xd317('0x16')]);module[_0xd317('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index c1f042b..7b7b16b 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 _0x3f2f=['TIMESTAMP','BOOLEAN','sequelize','STRING','name','ENUM','files','mp3nb','quietmp3','mp3','alpha'];(function(_0x3b00ae,_0x4cde8d){var _0x167c71=function(_0x2ea02e){while(--_0x2ea02e){_0x3b00ae['push'](_0x3b00ae['shift']());}};_0x167c71(++_0x4cde8d);}(_0x3f2f,0x120));var _0xf3f2=function(_0x1e24d3,_0x48bba4){_0x1e24d3=_0x1e24d3-0x0;var _0x136f73=_0x3f2f[_0x1e24d3];return _0x136f73;};'use strict';var Sequelize=require(_0xf3f2('0x0'));module['exports']={'name':{'type':Sequelize[_0xf3f2('0x1')],'allowNull':![],'unique':_0xf3f2('0x2')},'mode':{'type':Sequelize[_0xf3f2('0x3')]('custom',_0xf3f2('0x4'),_0xf3f2('0x5'),'quietmp3nb',_0xf3f2('0x6'),_0xf3f2('0x7')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xf3f2('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0xf3f2('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0xf3f2('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0xf3f2('0x1')],'allowNull':!![],'defaultValue':_0xf3f2('0x8')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0xf3f2('0x9')},'defaultEntry':{'type':Sequelize[_0xf3f2('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0xdbae=['alpha','TIMESTAMP','BOOLEAN','sequelize','STRING','custom','files','mp3nb','quietmp3nb','quietmp3'];(function(_0x12f8c6,_0x54d2d8){var _0xe9ae4a=function(_0x2d5b63){while(--_0x2d5b63){_0x12f8c6['push'](_0x12f8c6['shift']());}};_0xe9ae4a(++_0x54d2d8);}(_0xdbae,0x67));var _0xedba=function(_0x3f3b02,_0x3870c2){_0x3f3b02=_0x3f3b02-0x0;var _0x1f42f1=_0xdbae[_0x3f3b02];return _0x1f42f1;};'use strict';var Sequelize=require(_0xedba('0x0'));module['exports']={'name':{'type':Sequelize[_0xedba('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM'](_0xedba('0x2'),_0xedba('0x3'),_0xedba('0x4'),_0xedba('0x5'),_0xedba('0x6'),'mp3'),'allowNull':!![],'defaultValue':_0xedba('0x3')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0xedba('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0xedba('0x1')],'allowNull':!![],'defaultValue':_0xedba('0x7')},'format':{'type':Sequelize[_0xedba('0x1')],'allowNull':!![]},'stamp':{'type':_0xedba('0x8')},'defaultEntry':{'type':Sequelize[_0xedba('0x9')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index b106be4..62a90d6 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 _0x64ac=['attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','filter','options','VoiceMusicOnHold','includeAll','findAll','rows','catch','show','rawAttributes','include','find','body','transaction','mode','files','join','root','create','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','sequelize','readdirSync','forEach','directory','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','server/files/moh','symlinkSync','Sequelize','removeSound','id2','unlinkSync','getSounds','sort','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','MusicOnHolds','UserProfileResource','end','error','stack','name','index','map','fieldName','type','key','query','keys','filters','intersection','model','fields'];(function(_0x51fe5f,_0x1d8632){var _0x4abce9=function(_0x34afb7){while(--_0x34afb7){_0x51fe5f['push'](_0x51fe5f['shift']());}};_0x4abce9(++_0x1d8632);}(_0x64ac,0x122));var _0xc64a=function(_0x55d0c9,_0x2bb1aa){_0x55d0c9=_0x55d0c9-0x0;var _0x748221=_0x64ac[_0x55d0c9];return _0x748221;};'use strict';var emlformat=require(_0xc64a('0x0'));var rimraf=require(_0xc64a('0x1'));var zipdir=require(_0xc64a('0x2'));var jsonpatch=require(_0xc64a('0x3'));var rp=require('request-promise');var moment=require(_0xc64a('0x4'));var BPromise=require(_0xc64a('0x5'));var Mustache=require(_0xc64a('0x6'));var util=require('util');var path=require('path');var sox=require(_0xc64a('0x7'));var csv=require(_0xc64a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc64a('0x9'));var _=require(_0xc64a('0xa'));var squel=require(_0xc64a('0xb'));var crypto=require(_0xc64a('0xc'));var jsforce=require(_0xc64a('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc64a('0xe'));var Redis=require('ioredis');var authService=require(_0xc64a('0xf'));var qs=require(_0xc64a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc64a('0x11'));var logger=require(_0xc64a('0x12'))(_0xc64a('0x13'));var utils=require(_0xc64a('0x14'));var config=require(_0xc64a('0x15'));var licenseUtil=require(_0xc64a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a1e5a,_0x392882){_0x392882=_0x392882||0xcc;return function(_0x3eb51b){if(_0x3eb51b){return _0x3a1e5a[_0xc64a('0x17')](_0x392882);}return _0x3a1e5a[_0xc64a('0x18')](_0x392882)['end']();};}function respondWithResult(_0x25840b,_0x5f38f6){_0x5f38f6=_0x5f38f6||0xc8;return function(_0x50683d){if(_0x50683d){return _0x25840b['status'](_0x5f38f6)[_0xc64a('0x19')](_0x50683d);}};}function respondWithFilteredResult(_0x4257ca,_0x35fb81){return function(_0x514865){if(_0x514865){var _0x3e6fa3=typeof _0x35fb81[_0xc64a('0x1a')]===_0xc64a('0x1b')&&typeof _0x35fb81[_0xc64a('0x1c')]===_0xc64a('0x1b');var _0x33fa92=_0x514865[_0xc64a('0x1d')];var _0x26db51=_0x3e6fa3?0x0:_0x35fb81[_0xc64a('0x1a')];var _0xbf9a43=_0x3e6fa3?_0x514865[_0xc64a('0x1d')]:_0x35fb81['offset']+_0x35fb81[_0xc64a('0x1c')];var _0x1aafcf;if(_0xbf9a43>=_0x33fa92){_0xbf9a43=_0x33fa92;_0x1aafcf=0xc8;}else{_0x1aafcf=0xce;}_0x4257ca[_0xc64a('0x18')](_0x1aafcf);return _0x4257ca[_0xc64a('0x1e')](_0xc64a('0x1f'),_0x26db51+'-'+_0xbf9a43+'/'+_0x33fa92)['json'](_0x514865);}return null;};}function patchUpdates(_0x583261){return function(_0x3eacc1){try{jsonpatch[_0xc64a('0x20')](_0x3eacc1,_0x583261,!![]);}catch(_0x423868){return BPromise[_0xc64a('0x21')](_0x423868);}return _0x3eacc1['save']();};}function saveUpdates(_0xe1dd4e,_0x468589){return function(_0x4fd0b9){if(_0x4fd0b9){return _0x4fd0b9[_0xc64a('0x22')](_0xe1dd4e)[_0xc64a('0x23')](function(_0x39e3a4){return _0x39e3a4;});}return null;};}function removeEntity(_0x331847,_0x3b2e24){return function(_0x3d733a){if(_0x3d733a){return _0x3d733a[_0xc64a('0x24')]()[_0xc64a('0x23')](function(){var _0xd6da7e=_0x3d733a[_0xc64a('0x25')]({'plain':!![]});var _0x3fe58e=_0xc64a('0x26');return db[_0xc64a('0x27')]['destroy']({'where':{'type':_0x3fe58e,'resourceId':_0xd6da7e['id']}})[_0xc64a('0x23')](function(){return _0x3d733a;});})[_0xc64a('0x23')](function(){_0x331847[_0xc64a('0x18')](0xcc)[_0xc64a('0x28')]();});}};}function handleEntityNotFound(_0x306105,_0x1227d2){return function(_0x389fc1){if(!_0x389fc1){_0x306105[_0xc64a('0x17')](0x194);}return _0x389fc1;};}function handleError(_0x3228d5,_0x1ce8ed){_0x1ce8ed=_0x1ce8ed||0x1f4;return function(_0x59a6e2){logger[_0xc64a('0x29')](_0x59a6e2[_0xc64a('0x2a')]);if(_0x59a6e2[_0xc64a('0x2b')]){delete _0x59a6e2[_0xc64a('0x2b')];}_0x3228d5[_0xc64a('0x18')](_0x1ce8ed)['send'](_0x59a6e2);};}exports[_0xc64a('0x2c')]=function(_0x1aa49b,_0x399cb5){var _0x15f55f={},_0x19fe6c={},_0x2256bf={'count':0x0,'rows':[]};var _0x533f61=_[_0xc64a('0x2d')](db['VoiceMusicOnHold']['rawAttributes'],function(_0x11df48){return{'name':_0x11df48[_0xc64a('0x2e')],'type':_0x11df48[_0xc64a('0x2f')][_0xc64a('0x30')]};});_0x19fe6c['model']=_[_0xc64a('0x2d')](_0x533f61,_0xc64a('0x2b'));_0x19fe6c[_0xc64a('0x31')]=_[_0xc64a('0x32')](_0x1aa49b[_0xc64a('0x31')]);_0x19fe6c[_0xc64a('0x33')]=_[_0xc64a('0x34')](_0x19fe6c['model'],_0x19fe6c[_0xc64a('0x31')]);_0x15f55f['attributes']=_[_0xc64a('0x34')](_0x19fe6c[_0xc64a('0x35')],qs[_0xc64a('0x36')](_0x1aa49b[_0xc64a('0x31')][_0xc64a('0x36')]));_0x15f55f[_0xc64a('0x37')]=_0x15f55f[_0xc64a('0x37')][_0xc64a('0x38')]?_0x15f55f[_0xc64a('0x37')]:_0x19fe6c['model'];if(!_0x1aa49b['query'][_0xc64a('0x39')](_0xc64a('0x3a'))){_0x15f55f['limit']=qs[_0xc64a('0x1c')](_0x1aa49b['query'][_0xc64a('0x1c')]);_0x15f55f[_0xc64a('0x1a')]=qs[_0xc64a('0x1a')](_0x1aa49b[_0xc64a('0x31')]['offset']);}_0x15f55f[_0xc64a('0x3b')]=qs['sort'](_0x1aa49b[_0xc64a('0x31')]['sort']);delete _0x1aa49b[_0xc64a('0x31')]['sort'];_0x15f55f[_0xc64a('0x3c')]=qs[_0xc64a('0x33')](_[_0xc64a('0x3d')](_0x1aa49b[_0xc64a('0x31')],_0x19fe6c[_0xc64a('0x33')]),_0x533f61);if(_0x1aa49b[_0xc64a('0x31')]['filter']){_0x15f55f[_0xc64a('0x3c')]=_[_0xc64a('0x3e')](_0x15f55f[_0xc64a('0x3c')],{'$or':_['map'](_0x533f61,function(_0x429977){if(_0x429977[_0xc64a('0x2f')]!=='VIRTUAL'){var _0x301791={};_0x301791[_0x429977[_0xc64a('0x2b')]]={'$like':'%'+_0x1aa49b[_0xc64a('0x31')][_0xc64a('0x3f')]+'%'};return _0x301791;}})});}_0x15f55f=_['merge']({},_0x15f55f,_0x1aa49b[_0xc64a('0x40')]);var _0x33d7bc={'where':_0x15f55f['where']};return db[_0xc64a('0x41')][_0xc64a('0x1d')](_0x33d7bc)[_0xc64a('0x23')](function(_0x48ebaf){_0x2256bf[_0xc64a('0x1d')]=_0x48ebaf;if(_0x1aa49b[_0xc64a('0x31')][_0xc64a('0x42')]){_0x15f55f['include']=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xc64a('0x43')](_0x15f55f);})['then'](function(_0x2c200f){_0x2256bf[_0xc64a('0x44')]=_0x2c200f;return _0x2256bf;})[_0xc64a('0x23')](respondWithFilteredResult(_0x399cb5,_0x15f55f))[_0xc64a('0x45')](handleError(_0x399cb5,null));};exports[_0xc64a('0x46')]=function(_0x1b3ac1,_0x44d090){var _0x1e8331={'raw':![],'where':{'id':_0x1b3ac1['params']['id']}},_0x3d9b05={};_0x3d9b05[_0xc64a('0x35')]=_[_0xc64a('0x32')](db[_0xc64a('0x41')][_0xc64a('0x47')]);_0x3d9b05[_0xc64a('0x31')]=_[_0xc64a('0x32')](_0x1b3ac1[_0xc64a('0x31')]);_0x3d9b05[_0xc64a('0x33')]=_['intersection'](_0x3d9b05[_0xc64a('0x35')],_0x3d9b05['query']);_0x1e8331[_0xc64a('0x37')]=_[_0xc64a('0x34')](_0x3d9b05[_0xc64a('0x35')],qs[_0xc64a('0x36')](_0x1b3ac1[_0xc64a('0x31')][_0xc64a('0x36')]));_0x1e8331[_0xc64a('0x37')]=_0x1e8331['attributes'][_0xc64a('0x38')]?_0x1e8331[_0xc64a('0x37')]:_0x3d9b05['model'];if(_0x1b3ac1[_0xc64a('0x31')]['includeAll']){_0x1e8331[_0xc64a('0x48')]=[{'all':!![]}];}_0x1e8331=_[_0xc64a('0x3e')]({},_0x1e8331,_0x1b3ac1[_0xc64a('0x40')]);return db['VoiceMusicOnHold'][_0xc64a('0x49')](_0x1e8331)[_0xc64a('0x23')](handleEntityNotFound(_0x44d090,null))[_0xc64a('0x23')](respondWithResult(_0x44d090,null))[_0xc64a('0x45')](handleError(_0x44d090,null));};exports[_0xc64a('0x22')]=function(_0x1f8987,_0x1911ea){if(_0x1f8987[_0xc64a('0x4a')]['id']){delete _0x1f8987['body']['id'];}return db['VoiceMusicOnHold']['find']({'where':{'id':_0x1f8987['params']['id']}})[_0xc64a('0x23')](handleEntityNotFound(_0x1911ea,null))[_0xc64a('0x23')](saveUpdates(_0x1f8987['body'],null))[_0xc64a('0x23')](respondWithResult(_0x1911ea,null))[_0xc64a('0x45')](handleError(_0x1911ea,null));};exports['create']=function(_0x4f02bb,_0x26d653,_0x1d7296){return db['sequelize'][_0xc64a('0x4b')](function(_0xe62c24){if(_0x4f02bb[_0xc64a('0x4a')][_0xc64a('0x4c')]===_0xc64a('0x4d')){_0x4f02bb[_0xc64a('0x4a')]['directory']=path[_0xc64a('0x4e')](config[_0xc64a('0x4f')],'server/files/moh',_0x4f02bb[_0xc64a('0x4a')][_0xc64a('0x2b')]);}return db['VoiceMusicOnHold'][_0xc64a('0x50')](_0x4f02bb[_0xc64a('0x4a')],{'transaction':_0xe62c24})[_0xc64a('0x23')](function(_0x3bede9){if(_0x4f02bb[_0xc64a('0x4a')][_0xc64a('0x4c')]===_0xc64a('0x4d')){fs['mkdirSync'](_0x3bede9['directory'],parseInt(_0xc64a('0x51'),0x8));}var _0x40fa56=_0x4f02bb[_0xc64a('0x52')][_0xc64a('0x25')]({'plain':!![]});if(!_0x40fa56)throw new Error(_0xc64a('0x53'));if(_0x40fa56[_0xc64a('0x54')]===_0xc64a('0x52')){var _0x2fc88e=_0x3bede9[_0xc64a('0x25')]({'plain':!![]});return db[_0xc64a('0x55')][_0xc64a('0x49')]({'where':{'name':_0xc64a('0x26'),'userProfileId':_0x40fa56[_0xc64a('0x56')]},'raw':!![]})[_0xc64a('0x23')](function(_0x45b448){if(_0x45b448&&_0x45b448[_0xc64a('0x57')]===0x0){return db[_0xc64a('0x27')]['create']({'name':_0x2fc88e[_0xc64a('0x2b')],'resourceId':_0x2fc88e['id'],'type':_0x45b448[_0xc64a('0x2b')],'sectionId':_0x45b448['id']},{})[_0xc64a('0x23')](function(){return _0x3bede9;});}else{return _0x3bede9;}})[_0xc64a('0x45')](function(_0x5bd653){logger[_0xc64a('0x29')](_0xc64a('0x58'),_0x5bd653);});}return _0x3bede9;});})['then'](respondWithResult(_0x26d653,0xc9))[_0xc64a('0x45')](handleError(_0x26d653,null));};exports[_0xc64a('0x24')]=function(_0x47fbbd,_0x9a17d7,_0x502117){var _0x3f9e63;return db['VoiceMusicOnHold'][_0xc64a('0x49')]({'where':{'id':_0x47fbbd[_0xc64a('0x59')]['id']}})[_0xc64a('0x23')](function(_0x34361a){if(_0x34361a){return db[_0xc64a('0x5a')][_0xc64a('0x4b')](function(_0x2f8499){return _0x34361a[_0xc64a('0x24')]({'transaction':_0x2f8499,'raw':!![]})[_0xc64a('0x23')](function(_0x3f541a){if(_0x3f541a['directory']){fs[_0xc64a('0x5b')](_0x3f541a['directory'])[_0xc64a('0x5c')](function(_0x3ca83e){fs['unlinkSync'](path[_0xc64a('0x4e')](_0x3f541a[_0xc64a('0x5d')],_0x3ca83e));});fs['rmdirSync'](_0x3f541a[_0xc64a('0x5d')]);}return _0x3f541a;});})[_0xc64a('0x45')](function(_0x595c75){throw new db['Sequelize'][(_0xc64a('0x5e'))](_0x595c75[_0xc64a('0x5f')]);});}})[_0xc64a('0x23')](handleEntityNotFound(_0x9a17d7,null))['then'](removeEntity(_0x9a17d7,null))[_0xc64a('0x45')](handleError(_0x9a17d7,null));};exports[_0xc64a('0x60')]=function(_0x1fcb69,_0x52c949,_0x42157b){return db[_0xc64a('0x5a')][_0xc64a('0x4b')](function(_0xfeb931){var _0x1c900f;return db[_0xc64a('0x41')][_0xc64a('0x49')]({'where':{'id':_0x1fcb69[_0xc64a('0x59')]['id']}})['then'](function(_0x2990e3){if(_0x2990e3){_0x1c900f=_0x2990e3;return _0x2990e3['addSound'](_0x1fcb69[_0xc64a('0x4a')]['id'],{'transaction':_0xfeb931});}})[_0xc64a('0x23')](function(_0x37e3f5){if(_0x37e3f5){return db[_0xc64a('0x61')][_0xc64a('0x62')]({'where':{'id':_0x1fcb69[_0xc64a('0x4a')]['id']},'attributes':['id',_0xc64a('0x2b'),_0xc64a('0x63'),_0xc64a('0x64'),_0xc64a('0x65')],'raw':!![]});}})[_0xc64a('0x23')](function(_0x21577b){if(_0x21577b){var _0x10a9f9=path[_0xc64a('0x4e')](config['root'],_0xc64a('0x66'),util[_0xc64a('0x67')](_0xc64a('0x68'),path[_0xc64a('0x69')](_0x21577b['save_name'],path[_0xc64a('0x6a')](_0x21577b['save_name'])),_0x21577b['converted_format']));var _0x5f1a30=path[_0xc64a('0x4e')](config[_0xc64a('0x4f')],_0xc64a('0x6b'),_0x1c900f[_0xc64a('0x2b')],util[_0xc64a('0x67')](_0xc64a('0x68'),_0x21577b[_0xc64a('0x2b')],_0x21577b[_0xc64a('0x64')]));fs[_0xc64a('0x6c')](_0x10a9f9,_0x5f1a30);return _0x21577b;}})['catch'](function(_0x4bd91f){throw new db[(_0xc64a('0x6d'))][(_0xc64a('0x5e'))](_0x4bd91f[_0xc64a('0x5f')]);});})[_0xc64a('0x23')](handleEntityNotFound(_0x52c949,null))[_0xc64a('0x23')](respondWithResult(_0x52c949,0xc9))[_0xc64a('0x45')](handleError(_0x52c949,null));};exports[_0xc64a('0x6e')]=function(_0x4ba175,_0x3b86cf,_0x2a0695){return db[_0xc64a('0x5a')][_0xc64a('0x4b')](function(_0x54c528){var _0x156784;return db[_0xc64a('0x41')]['findOne']({'where':{'id':_0x4ba175[_0xc64a('0x59')]['id']}})['then'](handleEntityNotFound(_0x3b86cf,null))[_0xc64a('0x23')](function(_0x40e126){if(_0x40e126){_0x156784=_0x40e126;return _0x40e126[_0xc64a('0x6e')](_0x4ba175['params'][_0xc64a('0x6f')]);}})[_0xc64a('0x23')](function(_0x179b25){if(_0x179b25){return db['Sound'][_0xc64a('0x62')]({'where':{'id':_0x4ba175[_0xc64a('0x59')][_0xc64a('0x6f')]},'attributes':['id','name',_0xc64a('0x63'),_0xc64a('0x64'),_0xc64a('0x65')],'raw':!![]});}})[_0xc64a('0x23')](function(_0xff9a5c){if(_0xff9a5c){fs[_0xc64a('0x70')](path[_0xc64a('0x4e')](_0x156784['directory'],util[_0xc64a('0x67')](_0xc64a('0x68'),_0xff9a5c[_0xc64a('0x2b')],_0xff9a5c[_0xc64a('0x64')])));return _0xff9a5c;}})[_0xc64a('0x45')](function(_0x4ade13){throw new db[(_0xc64a('0x6d'))][(_0xc64a('0x5e'))](_0x4ade13[_0xc64a('0x5f')]);});})[_0xc64a('0x23')](handleEntityNotFound(_0x3b86cf,null))[_0xc64a('0x23')](respondWithStatusCode(_0x3b86cf,0xcc))[_0xc64a('0x45')](handleError(_0x3b86cf,null));};exports[_0xc64a('0x71')]=function(_0x3efaa8,_0xdb42aa,_0x50cbde){var _0x3e4351={};var _0x3af6a8={};var _0x1fdc66;var _0x106c12;return db['VoiceMusicOnHold'][_0xc64a('0x62')]({'where':{'id':_0x3efaa8[_0xc64a('0x59')]['id']}})[_0xc64a('0x23')](handleEntityNotFound(_0xdb42aa,null))[_0xc64a('0x23')](function(_0x48841d){if(_0x48841d){_0x1fdc66=_0x48841d;_0x3af6a8[_0xc64a('0x35')]=_[_0xc64a('0x32')](db['Sound'][_0xc64a('0x47')]);_0x3af6a8[_0xc64a('0x31')]=_[_0xc64a('0x32')](_0x3efaa8['query']);_0x3af6a8['filters']=_[_0xc64a('0x34')](_0x3af6a8[_0xc64a('0x35')],_0x3af6a8[_0xc64a('0x31')]);_0x3e4351['attributes']=_[_0xc64a('0x34')](_0x3af6a8[_0xc64a('0x35')],qs[_0xc64a('0x36')](_0x3efaa8[_0xc64a('0x31')][_0xc64a('0x36')]));_0x3e4351[_0xc64a('0x37')]=_0x3e4351[_0xc64a('0x37')][_0xc64a('0x38')]?_0x3e4351[_0xc64a('0x37')]:_0x3af6a8['model'];_0x3e4351[_0xc64a('0x3b')]=qs[_0xc64a('0x72')](_0x3efaa8[_0xc64a('0x31')][_0xc64a('0x72')]);_0x3e4351[_0xc64a('0x3c')]=qs['filters'](_[_0xc64a('0x3d')](_0x3efaa8[_0xc64a('0x31')],_0x3af6a8[_0xc64a('0x33')]));if(_0x3efaa8[_0xc64a('0x31')]['filter']){_0x3e4351[_0xc64a('0x3c')]=_[_0xc64a('0x3e')](_0x3e4351[_0xc64a('0x3c')],{'$or':_[_0xc64a('0x2d')](_0x3e4351[_0xc64a('0x37')],function(_0x55f6c0){var _0x22f327={};_0x22f327[_0x55f6c0]={'$like':'%'+_0x3efaa8[_0xc64a('0x31')]['filter']+'%'};return _0x22f327;})});}_0x3e4351=_[_0xc64a('0x3e')]({},_0x3e4351,_0x3efaa8[_0xc64a('0x40')]);return _0x1fdc66[_0xc64a('0x71')](_0x3e4351);}})[_0xc64a('0x23')](function(_0x4a2a67){if(_0x4a2a67){_0x106c12=_0x4a2a67['length'];if(!_0x3efaa8[_0xc64a('0x31')][_0xc64a('0x39')]('nolimit')){_0x3e4351['limit']=qs['limit'](_0x3efaa8[_0xc64a('0x31')][_0xc64a('0x1c')]);_0x3e4351[_0xc64a('0x1a')]=qs[_0xc64a('0x1a')](_0x3efaa8[_0xc64a('0x31')][_0xc64a('0x1a')]);}return _0x1fdc66[_0xc64a('0x71')](_0x3e4351);}})[_0xc64a('0x23')](function(_0x44a3e6){if(_0x44a3e6){return _0x44a3e6?{'count':_0x106c12,'rows':_0x44a3e6}:null;}})[_0xc64a('0x23')](respondWithResult(_0xdb42aa,null))['catch'](handleError(_0xdb42aa,null));}; \ No newline at end of file +var _0xb40c=['0777','user','get','role','find','MusicOnHolds','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','unlinkSync','rmdirSync','ValidationError','addSound','Sound','findOne','save_name','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','converted_format','symlinkSync','Sequelize','message','removeSound','id2','getSounds','filter','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','includeAll','include','rows','show','intersection','length','options','catch','body','params','sequelize','transaction','join','root','server/files/moh','mode','mkdirSync','directory'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xb40c,0x93));var _0xcb40=function(_0x810c7d,_0x167fae){_0x810c7d=_0x810c7d-0x0;var _0x3111ad=_0xb40c[_0x810c7d];return _0x3111ad;};'use strict';var emlformat=require(_0xcb40('0x0'));var rimraf=require(_0xcb40('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcb40('0x2'));var rp=require(_0xcb40('0x3'));var moment=require(_0xcb40('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcb40('0x5'));var util=require(_0xcb40('0x6'));var path=require('path');var sox=require(_0xcb40('0x7'));var csv=require(_0xcb40('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcb40('0x9'));var _=require(_0xcb40('0xa'));var squel=require(_0xcb40('0xb'));var crypto=require(_0xcb40('0xc'));var jsforce=require(_0xcb40('0xd'));var deskjs=require(_0xcb40('0xe'));var toCsv=require('to-csv');var querystring=require(_0xcb40('0xf'));var Papa=require(_0xcb40('0x10'));var Redis=require(_0xcb40('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcb40('0x12'));var hardwareService=require(_0xcb40('0x13'));var logger=require(_0xcb40('0x14'))(_0xcb40('0x15'));var utils=require(_0xcb40('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xcb40('0x17'));var db=require(_0xcb40('0x18'))['db'];function respondWithStatusCode(_0x181a39,_0x5dbe0b){_0x5dbe0b=_0x5dbe0b||0xcc;return function(_0x1d9f8c){if(_0x1d9f8c){return _0x181a39[_0xcb40('0x19')](_0x5dbe0b);}return _0x181a39[_0xcb40('0x1a')](_0x5dbe0b)[_0xcb40('0x1b')]();};}function respondWithResult(_0x4239f3,_0x5911e0){_0x5911e0=_0x5911e0||0xc8;return function(_0x138c6e){if(_0x138c6e){return _0x4239f3[_0xcb40('0x1a')](_0x5911e0)['json'](_0x138c6e);}};}function respondWithFilteredResult(_0x285b02,_0x3ba3bb){return function(_0x5af057){if(_0x5af057){var _0x21f1b1=typeof _0x3ba3bb[_0xcb40('0x1c')]===_0xcb40('0x1d')&&typeof _0x3ba3bb['limit']===_0xcb40('0x1d');var _0x7f92ef=_0x5af057['count'];var _0xa5474d=_0x21f1b1?0x0:_0x3ba3bb[_0xcb40('0x1c')];var _0x5c0e22=_0x21f1b1?_0x5af057[_0xcb40('0x1e')]:_0x3ba3bb[_0xcb40('0x1c')]+_0x3ba3bb[_0xcb40('0x1f')];var _0x5cd96;if(_0x5c0e22>=_0x7f92ef){_0x5c0e22=_0x7f92ef;_0x5cd96=0xc8;}else{_0x5cd96=0xce;}_0x285b02['status'](_0x5cd96);return _0x285b02[_0xcb40('0x20')](_0xcb40('0x21'),_0xa5474d+'-'+_0x5c0e22+'/'+_0x7f92ef)[_0xcb40('0x22')](_0x5af057);}return null;};}function patchUpdates(_0x2c7f43){return function(_0x5d7d99){try{jsonpatch[_0xcb40('0x23')](_0x5d7d99,_0x2c7f43,!![]);}catch(_0x36054b){return BPromise[_0xcb40('0x24')](_0x36054b);}return _0x5d7d99[_0xcb40('0x25')]();};}function saveUpdates(_0x342daa,_0x4e4e28){return function(_0x56f648){if(_0x56f648){return _0x56f648[_0xcb40('0x26')](_0x342daa)[_0xcb40('0x27')](function(_0x2a1e17){return _0x2a1e17;});}return null;};}function removeEntity(_0x50ac32,_0x119547){return function(_0x4cc78d){if(_0x4cc78d){return _0x4cc78d['destroy']()[_0xcb40('0x27')](function(){var _0x57785d=_0x4cc78d['get']({'plain':!![]});var _0x14fda7='MusicOnHolds';return db['UserProfileResource'][_0xcb40('0x28')]({'where':{'type':_0x14fda7,'resourceId':_0x57785d['id']}})[_0xcb40('0x27')](function(){return _0x4cc78d;});})[_0xcb40('0x27')](function(){_0x50ac32['status'](0xcc)[_0xcb40('0x1b')]();});}};}function handleEntityNotFound(_0x34ecec,_0x5290f7){return function(_0x2e7fed){if(!_0x2e7fed){_0x34ecec[_0xcb40('0x19')](0x194);}return _0x2e7fed;};}function handleError(_0x4797a3,_0x561898){_0x561898=_0x561898||0x1f4;return function(_0x596f59){logger[_0xcb40('0x29')](_0x596f59['stack']);if(_0x596f59[_0xcb40('0x2a')]){delete _0x596f59[_0xcb40('0x2a')];}_0x4797a3[_0xcb40('0x1a')](_0x561898)[_0xcb40('0x2b')](_0x596f59);};}exports[_0xcb40('0x2c')]=function(_0x2ec26b,_0x5612d1){var _0x58210b={},_0x3ab3fe={},_0x38efc3={'count':0x0,'rows':[]};var _0x37b943=_[_0xcb40('0x2d')](db[_0xcb40('0x2e')][_0xcb40('0x2f')],function(_0x97b0b){return{'name':_0x97b0b[_0xcb40('0x30')],'type':_0x97b0b[_0xcb40('0x31')][_0xcb40('0x32')]};});_0x3ab3fe[_0xcb40('0x33')]=_['map'](_0x37b943,_0xcb40('0x2a'));_0x3ab3fe[_0xcb40('0x34')]=_[_0xcb40('0x35')](_0x2ec26b[_0xcb40('0x34')]);_0x3ab3fe[_0xcb40('0x36')]=_['intersection'](_0x3ab3fe[_0xcb40('0x33')],_0x3ab3fe[_0xcb40('0x34')]);_0x58210b[_0xcb40('0x37')]=_['intersection'](_0x3ab3fe['model'],qs['fields'](_0x2ec26b[_0xcb40('0x34')][_0xcb40('0x38')]));_0x58210b[_0xcb40('0x37')]=_0x58210b['attributes']['length']?_0x58210b[_0xcb40('0x37')]:_0x3ab3fe[_0xcb40('0x33')];if(!_0x2ec26b[_0xcb40('0x34')][_0xcb40('0x39')](_0xcb40('0x3a'))){_0x58210b[_0xcb40('0x1f')]=qs[_0xcb40('0x1f')](_0x2ec26b[_0xcb40('0x34')][_0xcb40('0x1f')]);_0x58210b[_0xcb40('0x1c')]=qs[_0xcb40('0x1c')](_0x2ec26b['query'][_0xcb40('0x1c')]);}_0x58210b[_0xcb40('0x3b')]=qs[_0xcb40('0x3c')](_0x2ec26b['query'][_0xcb40('0x3c')]);delete _0x2ec26b[_0xcb40('0x34')][_0xcb40('0x3c')];_0x58210b[_0xcb40('0x3d')]=qs['filters'](_[_0xcb40('0x3e')](_0x2ec26b[_0xcb40('0x34')],_0x3ab3fe[_0xcb40('0x36')]),_0x37b943);if(_0x2ec26b[_0xcb40('0x34')]['filter']){_0x58210b['where']=_['merge'](_0x58210b[_0xcb40('0x3d')],{'$or':_[_0xcb40('0x2d')](_0x37b943,function(_0x39cf98){if(_0x39cf98[_0xcb40('0x31')]!==_0xcb40('0x3f')){var _0x1c2313={};_0x1c2313[_0x39cf98[_0xcb40('0x2a')]]={'$like':'%'+_0x2ec26b[_0xcb40('0x34')]['filter']+'%'};return _0x1c2313;}})});}_0x58210b=_[_0xcb40('0x40')]({},_0x58210b,_0x2ec26b['options']);var _0x29e2ea={'where':_0x58210b[_0xcb40('0x3d')]};return db[_0xcb40('0x2e')][_0xcb40('0x1e')](_0x29e2ea)[_0xcb40('0x27')](function(_0x2f5ef4){_0x38efc3[_0xcb40('0x1e')]=_0x2f5ef4;if(_0x2ec26b[_0xcb40('0x34')][_0xcb40('0x41')]){_0x58210b[_0xcb40('0x42')]=[{'all':!![]}];}return db[_0xcb40('0x2e')]['findAll'](_0x58210b);})[_0xcb40('0x27')](function(_0x1bcbfa){_0x38efc3[_0xcb40('0x43')]=_0x1bcbfa;return _0x38efc3;})['then'](respondWithFilteredResult(_0x5612d1,_0x58210b))['catch'](handleError(_0x5612d1,null));};exports[_0xcb40('0x44')]=function(_0x2127c4,_0x4d9fda){var _0x5b1026={'raw':![],'where':{'id':_0x2127c4['params']['id']}},_0x4d98c9={};_0x4d98c9['model']=_[_0xcb40('0x35')](db[_0xcb40('0x2e')][_0xcb40('0x2f')]);_0x4d98c9[_0xcb40('0x34')]=_[_0xcb40('0x35')](_0x2127c4[_0xcb40('0x34')]);_0x4d98c9[_0xcb40('0x36')]=_[_0xcb40('0x45')](_0x4d98c9[_0xcb40('0x33')],_0x4d98c9[_0xcb40('0x34')]);_0x5b1026[_0xcb40('0x37')]=_[_0xcb40('0x45')](_0x4d98c9[_0xcb40('0x33')],qs['fields'](_0x2127c4[_0xcb40('0x34')][_0xcb40('0x38')]));_0x5b1026[_0xcb40('0x37')]=_0x5b1026['attributes'][_0xcb40('0x46')]?_0x5b1026[_0xcb40('0x37')]:_0x4d98c9[_0xcb40('0x33')];if(_0x2127c4[_0xcb40('0x34')][_0xcb40('0x41')]){_0x5b1026['include']=[{'all':!![]}];}_0x5b1026=_['merge']({},_0x5b1026,_0x2127c4[_0xcb40('0x47')]);return db[_0xcb40('0x2e')]['find'](_0x5b1026)[_0xcb40('0x27')](handleEntityNotFound(_0x4d9fda,null))['then'](respondWithResult(_0x4d9fda,null))[_0xcb40('0x48')](handleError(_0x4d9fda,null));};exports['update']=function(_0x3cac32,_0x4135ef){if(_0x3cac32[_0xcb40('0x49')]['id']){delete _0x3cac32[_0xcb40('0x49')]['id'];}return db[_0xcb40('0x2e')]['find']({'where':{'id':_0x3cac32[_0xcb40('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4135ef,null))[_0xcb40('0x27')](saveUpdates(_0x3cac32[_0xcb40('0x49')],null))[_0xcb40('0x27')](respondWithResult(_0x4135ef,null))[_0xcb40('0x48')](handleError(_0x4135ef,null));};exports['create']=function(_0x2b20bb,_0x36bfae,_0x3b1164){return db[_0xcb40('0x4b')][_0xcb40('0x4c')](function(_0x366f9a){if(_0x2b20bb[_0xcb40('0x49')]['mode']==='files'){_0x2b20bb[_0xcb40('0x49')]['directory']=path[_0xcb40('0x4d')](config[_0xcb40('0x4e')],_0xcb40('0x4f'),_0x2b20bb['body'][_0xcb40('0x2a')]);}return db['VoiceMusicOnHold']['create'](_0x2b20bb[_0xcb40('0x49')],{'transaction':_0x366f9a})[_0xcb40('0x27')](function(_0x20b1e5){if(_0x2b20bb[_0xcb40('0x49')][_0xcb40('0x50')]==='files'){fs[_0xcb40('0x51')](_0x20b1e5[_0xcb40('0x52')],parseInt(_0xcb40('0x53'),0x8));}var _0x142702=_0x2b20bb[_0xcb40('0x54')][_0xcb40('0x55')]({'plain':!![]});if(!_0x142702)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x142702[_0xcb40('0x56')]===_0xcb40('0x54')){var _0x293e50=_0x20b1e5[_0xcb40('0x55')]({'plain':!![]});return db['UserProfileSection'][_0xcb40('0x57')]({'where':{'name':_0xcb40('0x58'),'userProfileId':_0x142702[_0xcb40('0x59')]},'raw':!![]})['then'](function(_0x3b587c){if(_0x3b587c&&_0x3b587c[_0xcb40('0x5a')]===0x0){return db[_0xcb40('0x5b')]['create']({'name':_0x293e50['name'],'resourceId':_0x293e50['id'],'type':_0x3b587c[_0xcb40('0x2a')],'sectionId':_0x3b587c['id']},{})[_0xcb40('0x27')](function(){return _0x20b1e5;});}else{return _0x20b1e5;}})['catch'](function(_0x3648d7){logger[_0xcb40('0x29')](_0xcb40('0x5c'),_0x3648d7);});}return _0x20b1e5;});})[_0xcb40('0x27')](respondWithResult(_0x36bfae,0xc9))[_0xcb40('0x48')](handleError(_0x36bfae,null));};exports[_0xcb40('0x28')]=function(_0x4794bd,_0x2886ec,_0x2bf508){var _0x1bc124;return db[_0xcb40('0x2e')][_0xcb40('0x57')]({'where':{'id':_0x4794bd['params']['id']}})[_0xcb40('0x27')](function(_0x37e9d5){if(_0x37e9d5){return db['sequelize'][_0xcb40('0x4c')](function(_0x31561b){return _0x37e9d5[_0xcb40('0x28')]({'transaction':_0x31561b,'raw':!![]})[_0xcb40('0x27')](function(_0x855977){if(_0x855977[_0xcb40('0x52')]){fs['readdirSync'](_0x855977[_0xcb40('0x52')])[_0xcb40('0x5d')](function(_0x199da0){fs[_0xcb40('0x5e')](path[_0xcb40('0x4d')](_0x855977[_0xcb40('0x52')],_0x199da0));});fs[_0xcb40('0x5f')](_0x855977[_0xcb40('0x52')]);}return _0x855977;});})[_0xcb40('0x48')](function(_0x42e428){throw new db['Sequelize'][(_0xcb40('0x60'))](_0x42e428['message']);});}})[_0xcb40('0x27')](handleEntityNotFound(_0x2886ec,null))[_0xcb40('0x27')](removeEntity(_0x2886ec,null))[_0xcb40('0x48')](handleError(_0x2886ec,null));};exports['addSound']=function(_0x16f302,_0x5da830,_0x2341b4){return db[_0xcb40('0x4b')][_0xcb40('0x4c')](function(_0x444c3){var _0x39cf54;return db[_0xcb40('0x2e')][_0xcb40('0x57')]({'where':{'id':_0x16f302[_0xcb40('0x4a')]['id']}})[_0xcb40('0x27')](function(_0x57fde5){if(_0x57fde5){_0x39cf54=_0x57fde5;return _0x57fde5[_0xcb40('0x61')](_0x16f302[_0xcb40('0x49')]['id'],{'transaction':_0x444c3});}})[_0xcb40('0x27')](function(_0x5315d8){if(_0x5315d8){return db[_0xcb40('0x62')][_0xcb40('0x63')]({'where':{'id':_0x16f302[_0xcb40('0x49')]['id']},'attributes':['id','name',_0xcb40('0x64'),'converted_format',_0xcb40('0x65')],'raw':!![]});}})[_0xcb40('0x27')](function(_0x342ef3){if(_0x342ef3){var _0x31e28e=path['join'](config[_0xcb40('0x4e')],_0xcb40('0x66'),util[_0xcb40('0x67')](_0xcb40('0x68'),path[_0xcb40('0x69')](_0x342ef3[_0xcb40('0x64')],path[_0xcb40('0x6a')](_0x342ef3[_0xcb40('0x64')])),_0x342ef3[_0xcb40('0x6b')]));var _0x462e93=path[_0xcb40('0x4d')](config[_0xcb40('0x4e')],_0xcb40('0x4f'),_0x39cf54[_0xcb40('0x2a')],util[_0xcb40('0x67')]('%s.%s',_0x342ef3[_0xcb40('0x2a')],_0x342ef3['converted_format']));fs[_0xcb40('0x6c')](_0x31e28e,_0x462e93);return _0x342ef3;}})[_0xcb40('0x48')](function(_0x2cb771){throw new db[(_0xcb40('0x6d'))][(_0xcb40('0x60'))](_0x2cb771[_0xcb40('0x6e')]);});})[_0xcb40('0x27')](handleEntityNotFound(_0x5da830,null))[_0xcb40('0x27')](respondWithResult(_0x5da830,0xc9))[_0xcb40('0x48')](handleError(_0x5da830,null));};exports[_0xcb40('0x6f')]=function(_0x3568be,_0x1d3b1d,_0x20b48e){return db['sequelize'][_0xcb40('0x4c')](function(_0x1af0e6){var _0x3cb3d7;return db[_0xcb40('0x2e')][_0xcb40('0x63')]({'where':{'id':_0x3568be[_0xcb40('0x4a')]['id']}})[_0xcb40('0x27')](handleEntityNotFound(_0x1d3b1d,null))[_0xcb40('0x27')](function(_0x456107){if(_0x456107){_0x3cb3d7=_0x456107;return _0x456107[_0xcb40('0x6f')](_0x3568be[_0xcb40('0x4a')][_0xcb40('0x70')]);}})[_0xcb40('0x27')](function(_0x544311){if(_0x544311){return db[_0xcb40('0x62')][_0xcb40('0x63')]({'where':{'id':_0x3568be['params']['id2']},'attributes':['id','name',_0xcb40('0x64'),_0xcb40('0x6b'),_0xcb40('0x65')],'raw':!![]});}})[_0xcb40('0x27')](function(_0x5f1733){if(_0x5f1733){fs[_0xcb40('0x5e')](path['join'](_0x3cb3d7[_0xcb40('0x52')],util[_0xcb40('0x67')](_0xcb40('0x68'),_0x5f1733[_0xcb40('0x2a')],_0x5f1733['converted_format'])));return _0x5f1733;}})[_0xcb40('0x48')](function(_0x2cb694){throw new db[(_0xcb40('0x6d'))][(_0xcb40('0x60'))](_0x2cb694[_0xcb40('0x6e')]);});})[_0xcb40('0x27')](handleEntityNotFound(_0x1d3b1d,null))[_0xcb40('0x27')](respondWithStatusCode(_0x1d3b1d,0xcc))[_0xcb40('0x48')](handleError(_0x1d3b1d,null));};exports[_0xcb40('0x71')]=function(_0x53a70d,_0x42c4aa,_0x586c78){var _0xc4320c={};var _0x616c53={};var _0x3b5b4a;var _0x2bbe53;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x53a70d[_0xcb40('0x4a')]['id']}})[_0xcb40('0x27')](handleEntityNotFound(_0x42c4aa,null))[_0xcb40('0x27')](function(_0x52c135){if(_0x52c135){_0x3b5b4a=_0x52c135;_0x616c53[_0xcb40('0x33')]=_['keys'](db[_0xcb40('0x62')][_0xcb40('0x2f')]);_0x616c53['query']=_['keys'](_0x53a70d[_0xcb40('0x34')]);_0x616c53[_0xcb40('0x36')]=_['intersection'](_0x616c53['model'],_0x616c53[_0xcb40('0x34')]);_0xc4320c[_0xcb40('0x37')]=_[_0xcb40('0x45')](_0x616c53[_0xcb40('0x33')],qs['fields'](_0x53a70d['query'][_0xcb40('0x38')]));_0xc4320c[_0xcb40('0x37')]=_0xc4320c['attributes'][_0xcb40('0x46')]?_0xc4320c[_0xcb40('0x37')]:_0x616c53[_0xcb40('0x33')];_0xc4320c[_0xcb40('0x3b')]=qs[_0xcb40('0x3c')](_0x53a70d[_0xcb40('0x34')][_0xcb40('0x3c')]);_0xc4320c[_0xcb40('0x3d')]=qs['filters'](_[_0xcb40('0x3e')](_0x53a70d['query'],_0x616c53[_0xcb40('0x36')]));if(_0x53a70d['query'][_0xcb40('0x72')]){_0xc4320c[_0xcb40('0x3d')]=_[_0xcb40('0x40')](_0xc4320c['where'],{'$or':_[_0xcb40('0x2d')](_0xc4320c[_0xcb40('0x37')],function(_0x27463){var _0x26cb48={};_0x26cb48[_0x27463]={'$like':'%'+_0x53a70d[_0xcb40('0x34')][_0xcb40('0x72')]+'%'};return _0x26cb48;})});}_0xc4320c=_[_0xcb40('0x40')]({},_0xc4320c,_0x53a70d[_0xcb40('0x47')]);return _0x3b5b4a['getSounds'](_0xc4320c);}})[_0xcb40('0x27')](function(_0x2424bf){if(_0x2424bf){_0x2bbe53=_0x2424bf['length'];if(!_0x53a70d[_0xcb40('0x34')][_0xcb40('0x39')](_0xcb40('0x3a'))){_0xc4320c[_0xcb40('0x1f')]=qs[_0xcb40('0x1f')](_0x53a70d[_0xcb40('0x34')][_0xcb40('0x1f')]);_0xc4320c[_0xcb40('0x1c')]=qs[_0xcb40('0x1c')](_0x53a70d[_0xcb40('0x34')][_0xcb40('0x1c')]);}return _0x3b5b4a[_0xcb40('0x71')](_0xc4320c);}})[_0xcb40('0x27')](function(_0x168822){if(_0x168822){return _0x168822?{'count':_0x2bbe53,'rows':_0x168822}:null;}})[_0xcb40('0x27')](respondWithResult(_0x42c4aa,null))[_0xcb40('0x48')](handleError(_0x42c4aa,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index e83c985..59d2800 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 _0xf7cb=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','voice_musiconhold','lodash','util'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf7cb,0xc1));var _0xbf7c=function(_0x113ad0,_0x5615ce){_0x113ad0=_0x113ad0-0x0;var _0x534e62=_0xf7cb[_0x113ad0];return _0x534e62;};'use strict';var _=require(_0xbf7c('0x0'));var util=require(_0xbf7c('0x1'));var logger=require(_0xbf7c('0x2'))(_0xbf7c('0x3'));var moment=require(_0xbf7c('0x4'));var BPromise=require(_0xbf7c('0x5'));var rp=require(_0xbf7c('0x6'));var fs=require('fs');var path=require(_0xbf7c('0x7'));var rimraf=require(_0xbf7c('0x8'));var config=require('../../config/environment');var attributes=require(_0xbf7c('0x9'));module['exports']=function(_0x378995,_0x2c9427){return _0x378995[_0xbf7c('0xa')](_0xbf7c('0xb'),attributes,{'tableName':_0xbf7c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5cf1=['VoiceMusicOnHold','voice_musiconhold','api','moment','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5cf1,0x1c4));var _0x15cf=function(_0x2483f6,_0x70bc75){_0x2483f6=_0x2483f6-0x0;var _0x44f7b9=_0x5cf1[_0x2483f6];return _0x44f7b9;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x15cf('0x0'));var moment=require(_0x15cf('0x1'));var BPromise=require('bluebird');var rp=require(_0x15cf('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x15cf('0x3'));var config=require(_0x15cf('0x4'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x15cf('0x5')]=function(_0x74c465,_0x33b312){return _0x74c465[_0x15cf('0x6')](_0x15cf('0x7'),attributes,{'tableName':_0x15cf('0x8'),'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 90b2a8c..647adbe 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(_0x2ce835,_0x323bbb){var _0x53807a=function(_0x3ed150){while(--_0x3ed150){_0x2ce835['push'](_0x2ce835['shift']());}};_0x53807a(++_0x323bbb);}(_0xedd9,0xfc));var _0x9edd=function(_0x4608b3,_0x25997c){_0x4608b3=_0x4608b3-0x0;var _0x272708=_0xedd9[_0x4608b3];return _0x272708;};'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 _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(_0x5dbdaf,_0x3754d9){var _0x11ed1e=function(_0x229684){while(--_0x229684){_0x5dbdaf['push'](_0x5dbdaf['shift']());}};_0x11ed1e(++_0x3754d9);}(_0xedd9,0xfc));var _0x9edd=function(_0x2fd93c,_0x3d8354){_0x2fd93c=_0x2fd93c-0x0;var _0x127a71=_0xedd9[_0x2fd93c];return _0x127a71;};'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 diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 9f3f44e..874e243 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 _0xbcbe=['Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','show','/:id/users','getAgents','post','addAgents','/:id/teams','addTeams','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbcbe,0x1bd));var _0xebcb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbcbe[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xebcb('0x0'));var util=require(_0xebcb('0x1'));var path=require(_0xebcb('0x2'));var timeout=require(_0xebcb('0x3'));var express=require(_0xebcb('0x4'));var router=express[_0xebcb('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xebcb('0x6'));var config=require(_0xebcb('0x7'));var controller=require('./voicePrefix.controller');router['get']('/',auth[_0xebcb('0x8')](),controller[_0xebcb('0x9')]);router[_0xebcb('0xa')](_0xebcb('0xb'),auth[_0xebcb('0x8')](),controller['describe']);router[_0xebcb('0xa')](_0xebcb('0xc'),auth[_0xebcb('0x8')](),controller[_0xebcb('0xd')]);router[_0xebcb('0xa')](_0xebcb('0xe'),auth[_0xebcb('0x8')](),controller[_0xebcb('0xf')]);router[_0xebcb('0xa')]('/:id/teams',auth[_0xebcb('0x8')](),controller['getTeams']);router[_0xebcb('0x10')]('/',auth[_0xebcb('0x8')](),controller['create']);router[_0xebcb('0x10')](_0xebcb('0xe'),auth['isAuthenticated'](),controller[_0xebcb('0x11')]);router[_0xebcb('0x10')](_0xebcb('0x12'),auth[_0xebcb('0x8')](),controller[_0xebcb('0x13')]);router[_0xebcb('0x14')](_0xebcb('0xc'),auth[_0xebcb('0x8')](),controller[_0xebcb('0x15')]);router[_0xebcb('0x16')](_0xebcb('0xc'),auth[_0xebcb('0x8')](),controller[_0xebcb('0x17')]);router[_0xebcb('0x16')](_0xebcb('0xe'),auth[_0xebcb('0x8')](),controller['removeAgents']);router[_0xebcb('0x16')](_0xebcb('0x12'),auth[_0xebcb('0x8')](),controller['removeTeams']);module[_0xebcb('0x18')]=router; \ No newline at end of file +var _0x925e=['delete','destroy','removeAgents','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','create','post','addAgents','put','update'];(function(_0x3d16d7,_0x461674){var _0x757c0f=function(_0xfa9391){while(--_0xfa9391){_0x3d16d7['push'](_0x3d16d7['shift']());}};_0x757c0f(++_0x461674);}(_0x925e,0x199));var _0xe925=function(_0x316061,_0x1f9f53){_0x316061=_0x316061-0x0;var _0x443672=_0x925e[_0x316061];return _0x443672;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe925('0x0'));var timeout=require(_0xe925('0x1'));var express=require(_0xe925('0x2'));var router=express['Router']();var fs_extra=require(_0xe925('0x3'));var auth=require(_0xe925('0x4'));var interaction=require(_0xe925('0x5'));var config=require(_0xe925('0x6'));var controller=require(_0xe925('0x7'));router[_0xe925('0x8')]('/',auth[_0xe925('0x9')](),controller[_0xe925('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xe925('0xb')]);router['get'](_0xe925('0xc'),auth['isAuthenticated'](),controller[_0xe925('0xd')]);router[_0xe925('0x8')](_0xe925('0xe'),auth[_0xe925('0x9')](),controller[_0xe925('0xf')]);router[_0xe925('0x8')](_0xe925('0x10'),auth[_0xe925('0x9')](),controller[_0xe925('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe925('0x12')]);router[_0xe925('0x13')]('/:id/users',auth[_0xe925('0x9')](),controller[_0xe925('0x14')]);router[_0xe925('0x13')](_0xe925('0x10'),auth[_0xe925('0x9')](),controller['addTeams']);router[_0xe925('0x15')](_0xe925('0xc'),auth[_0xe925('0x9')](),controller[_0xe925('0x16')]);router[_0xe925('0x17')](_0xe925('0xc'),auth[_0xe925('0x9')](),controller[_0xe925('0x18')]);router[_0xe925('0x17')](_0xe925('0xe'),auth[_0xe925('0x9')](),controller[_0xe925('0x19')]);router['delete'](_0xe925('0x10'),auth[_0xe925('0x9')](),controller['removeTeams']);module[_0xe925('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index a8b238a..c3eb5bf 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 _0x2b15=['getDataValue','STRING','INTEGER','sequelize','exports','name','VIRTUAL'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x2b15,0x129));var _0x52b1=function(_0x431ac5,_0x5e319f){_0x431ac5=_0x431ac5-0x0;var _0x235779=_0x2b15[_0x431ac5];return _0x235779;};'use strict';var Sequelize=require(_0x52b1('0x0'));module[_0x52b1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x52b1('0x2')},'prefix':{'type':Sequelize[_0x52b1('0x3')],'get':function(_0x2ffa64){return'system-'+this[_0x52b1('0x4')]('name')+'-';}},'description':{'type':Sequelize[_0x52b1('0x5')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x52b1('0x6')]}}; \ No newline at end of file +var _0x2938=['sequelize','exports','STRING','name','VIRTUAL','system-','INTEGER'];(function(_0x363e32,_0xd85826){var _0x3b762c=function(_0x1a7e3b){while(--_0x1a7e3b){_0x363e32['push'](_0x363e32['shift']());}};_0x3b762c(++_0xd85826);}(_0x2938,0x69));var _0x8293=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x2938[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x8293('0x0'));module[_0x8293('0x1')]={'name':{'type':Sequelize[_0x8293('0x2')],'allowNull':![],'unique':_0x8293('0x3')},'prefix':{'type':Sequelize[_0x8293('0x4')],'get':function(_0x3435b4){return _0x8293('0x5')+this['getDataValue'](_0x8293('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x8293('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x8293('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 54acc8f..4234713 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 _0x8952=['rawAttributes','fieldName','type','map','keys','filters','intersection','query','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','rows','catch','params','find','describe','create','sequelize','transaction','body','get','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','context','from-sip','exten','system','Voice\x20Prefix\x20Extension','prefix','Voice\x20Prefix','VoicePrefixId','push','Set','CDR(prefix)=','callerIdAll','NoOp','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','getTeams','Team','findAll','Agents','online','interface','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','forEach','select','field','from','team_has_voice_prefixes','join','user_has_teams','VoicePrefixId\x20=\x20?','every','includes','all','union','compact','value','removeTeams','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','VoicePrefixes','error','stack','name','send','index','VoicePrefix'];(function(_0x4817f9,_0x4070d1){var _0x2dcfa6=function(_0x408973){while(--_0x408973){_0x4817f9['push'](_0x4817f9['shift']());}};_0x2dcfa6(++_0x4070d1);}(_0x8952,0x17e));var _0x2895=function(_0xf54c5e,_0xd7f386){_0xf54c5e=_0xf54c5e-0x0;var _0x2f44af=_0x8952[_0xf54c5e];return _0x2f44af;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2895('0x0'));var zipdir=require(_0x2895('0x1'));var jsonpatch=require(_0x2895('0x2'));var rp=require(_0x2895('0x3'));var moment=require(_0x2895('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2895('0x5'));var util=require(_0x2895('0x6'));var path=require(_0x2895('0x7'));var sox=require('sox');var csv=require(_0x2895('0x8'));var ejs=require(_0x2895('0x9'));var fs=require('fs');var fs_extra=require(_0x2895('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2895('0xb'));var jsforce=require(_0x2895('0xc'));var deskjs=require(_0x2895('0xd'));var toCsv=require(_0x2895('0x8'));var querystring=require(_0x2895('0xe'));var Papa=require('papaparse');var Redis=require(_0x2895('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2895('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2895('0x11'));var utils=require(_0x2895('0x12'));var config=require(_0x2895('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2895('0x14'))['db'];config[_0x2895('0x15')]=_['defaults'](config[_0x2895('0x15')],{'host':_0x2895('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2895('0x17'))[_0x2895('0x18')](socket);function respondWithStatusCode(_0x5777a0,_0x2198c3){_0x2198c3=_0x2198c3||0xcc;return function(_0xd8192e){if(_0xd8192e){return _0x5777a0[_0x2895('0x19')](_0x2198c3);}return _0x5777a0[_0x2895('0x1a')](_0x2198c3)[_0x2895('0x1b')]();};}function respondWithResult(_0x2627e6,_0x6a5c7e){_0x6a5c7e=_0x6a5c7e||0xc8;return function(_0x31bb7f){if(_0x31bb7f){return _0x2627e6[_0x2895('0x1a')](_0x6a5c7e)[_0x2895('0x1c')](_0x31bb7f);}};}function respondWithFilteredResult(_0x10a1bf,_0x183b05){return function(_0xbf8b63){if(_0xbf8b63){var _0x2cb505=typeof _0x183b05[_0x2895('0x1d')]===_0x2895('0x1e')&&typeof _0x183b05[_0x2895('0x1f')]===_0x2895('0x1e');var _0x5a8eab=_0xbf8b63['count'];var _0x493851=_0x2cb505?0x0:_0x183b05[_0x2895('0x1d')];var _0x12c2fb=_0x2cb505?_0xbf8b63[_0x2895('0x20')]:_0x183b05['offset']+_0x183b05[_0x2895('0x1f')];var _0x190b79;if(_0x12c2fb>=_0x5a8eab){_0x12c2fb=_0x5a8eab;_0x190b79=0xc8;}else{_0x190b79=0xce;}_0x10a1bf[_0x2895('0x1a')](_0x190b79);return _0x10a1bf[_0x2895('0x21')](_0x2895('0x22'),_0x493851+'-'+_0x12c2fb+'/'+_0x5a8eab)['json'](_0xbf8b63);}return null;};}function patchUpdates(_0x30c6c3){return function(_0x5e93a4){try{jsonpatch['apply'](_0x5e93a4,_0x30c6c3,!![]);}catch(_0x142e58){return BPromise[_0x2895('0x23')](_0x142e58);}return _0x5e93a4[_0x2895('0x24')]();};}function saveUpdates(_0x511286,_0x4e884f){return function(_0x3a72fa){if(_0x3a72fa){return _0x3a72fa[_0x2895('0x25')](_0x511286)[_0x2895('0x26')](function(_0x4a21cf){return _0x4a21cf;});}return null;};}function removeEntity(_0x3d3320,_0x3690ce){return function(_0x480604){if(_0x480604){return _0x480604[_0x2895('0x27')]()[_0x2895('0x26')](function(){var _0x2cd4df=_0x480604['get']({'plain':!![]});var _0x320661=_0x2895('0x28');return db['UserProfileResource'][_0x2895('0x27')]({'where':{'type':_0x320661,'resourceId':_0x2cd4df['id']}})['then'](function(){return _0x480604;});})['then'](function(){_0x3d3320[_0x2895('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfa4f85,_0x381538){return function(_0x4fdd94){if(!_0x4fdd94){_0xfa4f85['sendStatus'](0x194);}return _0x4fdd94;};}function handleError(_0x32db49,_0x30dc2f){_0x30dc2f=_0x30dc2f||0x1f4;return function(_0x190e07){logger[_0x2895('0x29')](_0x190e07[_0x2895('0x2a')]);if(_0x190e07[_0x2895('0x2b')]){delete _0x190e07[_0x2895('0x2b')];}_0x32db49['status'](_0x30dc2f)[_0x2895('0x2c')](_0x190e07);};}exports[_0x2895('0x2d')]=function(_0x3625ba,_0x5546eb){var _0x1e9c13={},_0x458a55={},_0x31ab90={'count':0x0,'rows':[]};var _0x35a2e8=_['map'](db[_0x2895('0x2e')][_0x2895('0x2f')],function(_0x4765c9){return{'name':_0x4765c9[_0x2895('0x30')],'type':_0x4765c9[_0x2895('0x31')]['key']};});_0x458a55['model']=_[_0x2895('0x32')](_0x35a2e8,_0x2895('0x2b'));_0x458a55['query']=_[_0x2895('0x33')](_0x3625ba['query']);_0x458a55[_0x2895('0x34')]=_[_0x2895('0x35')](_0x458a55['model'],_0x458a55[_0x2895('0x36')]);_0x1e9c13['attributes']=_[_0x2895('0x35')](_0x458a55['model'],qs['fields'](_0x3625ba[_0x2895('0x36')][_0x2895('0x37')]));_0x1e9c13[_0x2895('0x38')]=_0x1e9c13['attributes'][_0x2895('0x39')]?_0x1e9c13[_0x2895('0x38')]:_0x458a55[_0x2895('0x3a')];if(!_0x3625ba[_0x2895('0x36')][_0x2895('0x3b')](_0x2895('0x3c'))){_0x1e9c13[_0x2895('0x1f')]=qs[_0x2895('0x1f')](_0x3625ba[_0x2895('0x36')][_0x2895('0x1f')]);_0x1e9c13['offset']=qs[_0x2895('0x1d')](_0x3625ba[_0x2895('0x36')][_0x2895('0x1d')]);}_0x1e9c13[_0x2895('0x3d')]=qs[_0x2895('0x3e')](_0x3625ba[_0x2895('0x36')][_0x2895('0x3e')]);_0x1e9c13['where']=qs['filters'](_[_0x2895('0x3f')](_0x3625ba[_0x2895('0x36')],_0x458a55[_0x2895('0x34')]),_0x35a2e8);if(_0x3625ba[_0x2895('0x36')][_0x2895('0x40')]){_0x1e9c13[_0x2895('0x41')]=_['merge'](_0x1e9c13['where'],{'$or':_[_0x2895('0x32')](_0x35a2e8,function(_0x20208f){if(_0x20208f['type']!=='VIRTUAL'){var _0x2a0eaf={};_0x2a0eaf[_0x20208f[_0x2895('0x2b')]]={'$like':'%'+_0x3625ba[_0x2895('0x36')][_0x2895('0x40')]+'%'};return _0x2a0eaf;}})});}_0x1e9c13=_[_0x2895('0x42')]({},_0x1e9c13,_0x3625ba[_0x2895('0x43')]);var _0x5d4e23={'where':_0x1e9c13[_0x2895('0x41')]};return db[_0x2895('0x2e')][_0x2895('0x20')](_0x5d4e23)[_0x2895('0x26')](function(_0x4af6d6){_0x31ab90[_0x2895('0x20')]=_0x4af6d6;if(_0x3625ba[_0x2895('0x36')][_0x2895('0x44')]){_0x1e9c13[_0x2895('0x45')]=[{'all':!![]}];}return db['VoicePrefix']['findAll'](_0x1e9c13);})[_0x2895('0x26')](function(_0x19ce85){_0x31ab90[_0x2895('0x46')]=_0x19ce85;return _0x31ab90;})[_0x2895('0x26')](respondWithFilteredResult(_0x5546eb,_0x1e9c13))[_0x2895('0x47')](handleError(_0x5546eb,null));};exports['show']=function(_0x5bd425,_0x4b336c){var _0x28dd37={'raw':![],'where':{'id':_0x5bd425[_0x2895('0x48')]['id']}},_0x2130b2={};_0x2130b2[_0x2895('0x3a')]=_[_0x2895('0x33')](db[_0x2895('0x2e')]['rawAttributes']);_0x2130b2[_0x2895('0x36')]=_[_0x2895('0x33')](_0x5bd425[_0x2895('0x36')]);_0x2130b2[_0x2895('0x34')]=_[_0x2895('0x35')](_0x2130b2[_0x2895('0x3a')],_0x2130b2[_0x2895('0x36')]);_0x28dd37[_0x2895('0x38')]=_['intersection'](_0x2130b2[_0x2895('0x3a')],qs[_0x2895('0x37')](_0x5bd425[_0x2895('0x36')]['fields']));_0x28dd37[_0x2895('0x38')]=_0x28dd37[_0x2895('0x38')]['length']?_0x28dd37[_0x2895('0x38')]:_0x2130b2[_0x2895('0x3a')];if(_0x5bd425[_0x2895('0x36')][_0x2895('0x44')]){_0x28dd37[_0x2895('0x45')]=[{'all':!![]}];}_0x28dd37=_[_0x2895('0x42')]({},_0x28dd37,_0x5bd425[_0x2895('0x43')]);return db['VoicePrefix'][_0x2895('0x49')](_0x28dd37)[_0x2895('0x26')](handleEntityNotFound(_0x4b336c,null))['then'](respondWithResult(_0x4b336c,null))['catch'](handleError(_0x4b336c,null));};exports['destroy']=function(_0x212a1f,_0xe552b6){return db[_0x2895('0x2e')][_0x2895('0x49')]({'where':{'id':_0x212a1f[_0x2895('0x48')]['id']}})[_0x2895('0x26')](handleEntityNotFound(_0xe552b6,null))[_0x2895('0x26')](removeEntity(_0xe552b6,null))[_0x2895('0x47')](handleError(_0xe552b6,null));};exports[_0x2895('0x4a')]=function(_0x3d043c,_0x45302c){return db[_0x2895('0x2e')][_0x2895('0x4a')]()[_0x2895('0x26')](respondWithResult(_0x45302c,null))[_0x2895('0x47')](handleError(_0x45302c,null));};exports[_0x2895('0x4b')]=function(_0x2116a6,_0x3e0fde){var _0xbcf98;return db[_0x2895('0x4c')][_0x2895('0x4d')](function(_0x90ed5d){return db[_0x2895('0x2e')][_0x2895('0x4b')](_0x2116a6[_0x2895('0x4e')],{'transaction':_0x90ed5d})[_0x2895('0x26')](function(_0x16ff3d){_0xbcf98=_0x16ff3d[_0x2895('0x4f')]({'plain':!![]});return db[_0x2895('0x50')][_0x2895('0x49')]({'where':{'id':_0xbcf98[_0x2895('0x51')]},'raw':!![]})['then'](function(_0xbc538a){return createVoicePrefixExtensions(_0xbcf98,_0xbc538a,_0x90ed5d);});});})[_0x2895('0x26')](function(){var _0x2bc573=_0x2116a6[_0x2895('0x52')][_0x2895('0x4f')]({'plain':!![]});if(!_0x2bc573)throw new Error(_0x2895('0x53'));if(_0x2bc573['role']===_0x2895('0x52')){var _0x5579b3=_0xbcf98;return db[_0x2895('0x54')][_0x2895('0x49')]({'where':{'name':_0x2895('0x28'),'userProfileId':_0x2bc573[_0x2895('0x55')]},'raw':!![]})[_0x2895('0x26')](function(_0x56a2c0){if(_0x56a2c0&&_0x56a2c0['autoAssociation']===0x0){return db[_0x2895('0x56')][_0x2895('0x4b')]({'name':_0x5579b3[_0x2895('0x2b')],'resourceId':_0x5579b3['id'],'type':_0x56a2c0['name'],'sectionId':_0x56a2c0['id']},{})[_0x2895('0x26')](function(){return _0xbcf98;});}else{return _0xbcf98;}})['catch'](function(_0x3c1f50){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c1f50);throw _0x3c1f50;});}return _0xbcf98;})['then'](respondWithResult(_0x3e0fde,null))['catch'](handleError(_0x3e0fde,null));};function Extension(_0x36177d,_0x2ff725,_0x402e00,_0x4336c){this[_0x2895('0x57')]=_0x2895('0x58');this[_0x2895('0x59')]=_0x36177d;this['app']=_0x402e00;this[_0x2895('0x31')]=_0x2895('0x5a');this['description']=_0x2895('0x5b');this['priority']=_0x2ff725;this['appdata']=_0x4336c;}function createVoicePrefixExtensions(_0x2a9194,_0x14d7f9,_0x50299a){return new BPromise(function(_0xf5be,_0x3c5e32){var _0x35d979=new Extension(formatPrefixName(_0x2a9194[_0x2895('0x5c')]),0x1,'NoOp',_0x2895('0x5d'));_0x35d979['VoicePrefixId']=_0x2a9194['id'];return db[_0x2895('0x50')]['create'](_0x35d979,{'transaction':_0x50299a})['then'](function(_0x1af031){var _0x58f96a=_0x1af031[_0x2895('0x4f')]({'plain':!![]});var _0x39a28b=_[_0x2895('0x32')](addVoicePrefixExtensions(_0x2a9194,_0x14d7f9),function(_0x559ef3){_0x559ef3[_0x2895('0x51')]=_0x58f96a['id'];_0x559ef3[_0x2895('0x5e')]=_0x2a9194['id'];return _0x559ef3;});return db['VoiceExtension']['bulkCreate'](_0x39a28b,{'transaction':_0x50299a})[_0x2895('0x26')](function(_0x347445){if(!_0x347445){return _0x3c5e32('Extensions\x20creation\x20failed');}else{return _0xf5be(_0x347445);}})[_0x2895('0x47')](function(_0x53f9d8){return _0x3c5e32(_0x53f9d8);});});;});};function addVoicePrefixExtensions(_0x567520,_0x98b64d){var _0x3241cb=[];var _0x16b39c=formatPrefixName(_0x567520['prefix']);_0x3241cb[_0x2895('0x5f')](new Extension(_0x16b39c,0x2,_0x2895('0x60'),_0x2895('0x61')+_0x567520[_0x2895('0x2b')]));if(_0x567520[_0x2895('0x62')]){_0x3241cb[_0x2895('0x5f')](new Extension(_0x16b39c,0x3,_0x2895('0x60'),'PREFIX-CALLERIDALL='+_0x567520[_0x2895('0x62')]));}else{_0x3241cb[_0x2895('0x5f')](new Extension(_0x16b39c,0x3,_0x2895('0x63'),_0x2895('0x64')));}_0x3241cb[_0x2895('0x5f')](new Extension(_0x16b39c,0x4,_0x2895('0x65'),_0x98b64d[_0x2895('0x57')]+','+_0x2895('0x66')+(0x8+_0x567520['name'][_0x2895('0x39')])+'}'+','+0x1));return _0x3241cb;}function formatPrefixName(_0x354718){var _0x16f369='_';for(var _0x2288ff=0x0;_0x2288ff<_0x354718[_0x2895('0x39')];_0x2288ff++){if(_0x354718[_0x2895('0x67')](_0x2288ff)=='-'){_0x16f369+=_0x354718[_0x2895('0x67')](_0x2288ff);}else{_0x16f369+='['+_0x354718[_0x2895('0x67')](_0x2288ff)+']';}}_0x16f369+='.';return _0x16f369;}exports[_0x2895('0x25')]=function(_0x2862aa,_0x53a270,_0x477385){var _0x1a2045=_0x2862aa[_0x2895('0x4e')];_0x1a2045[_0x2895('0x5c')]=_0x2895('0x68')+_0x1a2045[_0x2895('0x2b')]+'-';return db[_0x2895('0x4c')][_0x2895('0x4d')](function(_0x203609){return db[_0x2895('0x2e')]['update'](_0x1a2045,{'where':{'id':_0x1a2045['id']},'transaction':_0x203609})[_0x2895('0x26')](function(){return db[_0x2895('0x50')][_0x2895('0x27')]({'where':{'VoicePrefixId':_0x1a2045['id']},'transaction':_0x203609})[_0x2895('0x26')](function(){return db[_0x2895('0x50')]['find']({'where':{'id':_0x1a2045[_0x2895('0x51')]},'raw':!![]})[_0x2895('0x26')](function(_0x4c569e){return createVoicePrefixExtensions(_0x1a2045,_0x4c569e,_0x203609);});});});})['then'](function(){return db['VoicePrefix'][_0x2895('0x69')](_0x1a2045['id']);})[_0x2895('0x26')](respondWithResult(_0x53a270,null))[_0x2895('0x47')](handleError(_0x53a270,null));};exports[_0x2895('0x6a')]=function(_0x31e21a,_0x48c014,_0x5e6a1f){return db[_0x2895('0x2e')]['find']({'where':{'id':_0x31e21a[_0x2895('0x48')]['id']}})['then'](handleEntityNotFound(_0x48c014,null))[_0x2895('0x26')](function(_0x3de634){if(_0x3de634){return _0x3de634['addAgents'](_0x31e21a[_0x2895('0x4e')][_0x2895('0x6b')],_[_0x2895('0x6c')](_0x31e21a[_0x2895('0x4e')],['ids','id'])||{})['spread'](function(_0x10ca0f){for(var _0x5dde20=0x0;_0x5dde20<_0x31e21a['body'][_0x2895('0x6b')][_0x2895('0x39')];_0x5dde20+=0x1){socket[_0x2895('0x6d')](_0x2895('0x6e'),{'UserId':Number(_0x31e21a['body'][_0x2895('0x6b')][_0x5dde20]),'VoicePrefixId':Number(_0x31e21a[_0x2895('0x48')]['id'])});}return _0x10ca0f;});}})[_0x2895('0x26')](respondWithResult(_0x48c014,null))[_0x2895('0x47')](handleError(_0x48c014,null));};exports[_0x2895('0x6f')]=function(_0x45e80c,_0x21d3dd,_0x3346c2){return db[_0x2895('0x2e')][_0x2895('0x49')]({'where':{'id':_0x45e80c[_0x2895('0x48')]['id']}})[_0x2895('0x26')](handleEntityNotFound(_0x21d3dd,null))['then'](function(_0x1a9c84){if(_0x1a9c84){return _0x1a9c84[_0x2895('0x6f')](_0x45e80c[_0x2895('0x36')]['ids'])[_0x2895('0x26')](function(){if(_[_0x2895('0x70')](_0x45e80c['query'][_0x2895('0x6b')])){for(var _0x1693b6=0x0;_0x1693b6<_0x45e80c[_0x2895('0x36')]['ids'][_0x2895('0x39')];_0x1693b6+=0x1){socket[_0x2895('0x6d')](_0x2895('0x71'),{'UserId':Number(_0x45e80c[_0x2895('0x36')]['ids'][_0x1693b6]),'VoicePrefixId':Number(_0x45e80c[_0x2895('0x48')]['id'])});}}else{socket[_0x2895('0x6d')](_0x2895('0x71'),{'UserId':Number(_0x45e80c['query'][_0x2895('0x6b')]),'VoicePrefixId':Number(_0x45e80c['params']['id'])});}});}})[_0x2895('0x26')](respondWithStatusCode(_0x21d3dd,null))[_0x2895('0x47')](handleError(_0x21d3dd,null));};exports[_0x2895('0x72')]=function(_0x253e07,_0x570dd9,_0x6eef86){var _0x46bbca={};var _0x413aa4={};var _0x5e892a;var _0x34898e;return db['VoicePrefix'][_0x2895('0x73')]({'where':{'id':_0x253e07[_0x2895('0x48')]['id']}})['then'](handleEntityNotFound(_0x570dd9,null))['then'](function(_0x3bd07c){if(_0x3bd07c){_0x5e892a=_0x3bd07c;_0x413aa4[_0x2895('0x3a')]=_['keys'](db[_0x2895('0x74')][_0x2895('0x2f')]);_0x413aa4['query']=_[_0x2895('0x33')](_0x253e07[_0x2895('0x36')]);_0x413aa4[_0x2895('0x34')]=_[_0x2895('0x35')](_0x413aa4[_0x2895('0x3a')],_0x413aa4['query']);_0x46bbca[_0x2895('0x38')]=_[_0x2895('0x35')](_0x413aa4[_0x2895('0x3a')],qs[_0x2895('0x37')](_0x253e07[_0x2895('0x36')]['fields']));_0x46bbca[_0x2895('0x38')]=_0x46bbca[_0x2895('0x38')][_0x2895('0x39')]?_0x46bbca[_0x2895('0x38')]:_0x413aa4['model'];_0x46bbca[_0x2895('0x3d')]=qs[_0x2895('0x3e')](_0x253e07[_0x2895('0x36')][_0x2895('0x3e')]);_0x46bbca['where']=qs[_0x2895('0x34')](_[_0x2895('0x3f')](_0x253e07[_0x2895('0x36')],_0x413aa4[_0x2895('0x34')]));if(_0x253e07[_0x2895('0x36')][_0x2895('0x40')]){_0x46bbca['where']=_[_0x2895('0x42')](_0x46bbca[_0x2895('0x41')],{'$or':_[_0x2895('0x32')](_0x46bbca['attributes'],function(_0x553af0){var _0x1ff21e={};_0x1ff21e[_0x553af0]={'$like':'%'+_0x253e07[_0x2895('0x36')][_0x2895('0x40')]+'%'};return _0x1ff21e;})});}_0x46bbca=_[_0x2895('0x42')]({},_0x46bbca,_0x253e07[_0x2895('0x43')]);return _0x5e892a['getAgents'](_0x46bbca);}})[_0x2895('0x26')](function(_0x837eef){if(_0x837eef){_0x34898e=_0x837eef[_0x2895('0x39')];if(!_0x253e07['query']['hasOwnProperty'](_0x2895('0x3c'))){_0x46bbca[_0x2895('0x1f')]=qs[_0x2895('0x1f')](_0x253e07['query'][_0x2895('0x1f')]);_0x46bbca[_0x2895('0x1d')]=qs[_0x2895('0x1d')](_0x253e07[_0x2895('0x36')]['offset']);}return _0x5e892a[_0x2895('0x72')](_0x46bbca);}})[_0x2895('0x26')](function(_0x71d436){if(_0x71d436){return _0x71d436?{'count':_0x34898e,'rows':_0x71d436}:null;}})[_0x2895('0x26')](respondWithResult(_0x570dd9,null))[_0x2895('0x47')](handleError(_0x570dd9,null));};exports[_0x2895('0x75')]=function(_0x3ae81f,_0x25f5c9,_0x2d6167){var _0x265c7a={};var _0x32baef={};var _0x3d2996;var _0x3d47d0;return db[_0x2895('0x2e')]['findOne']({'where':{'id':_0x3ae81f['params']['id']}})['then'](handleEntityNotFound(_0x25f5c9,null))['then'](function(_0x440fbf){if(_0x440fbf){_0x3d2996=_0x440fbf;_0x32baef[_0x2895('0x3a')]=_[_0x2895('0x33')](db[_0x2895('0x76')][_0x2895('0x2f')]);_0x32baef[_0x2895('0x36')]=_[_0x2895('0x33')](_0x3ae81f[_0x2895('0x36')]);_0x32baef[_0x2895('0x34')]=_[_0x2895('0x35')](_0x32baef[_0x2895('0x3a')],_0x32baef[_0x2895('0x36')]);_0x265c7a[_0x2895('0x38')]=_[_0x2895('0x35')](_0x32baef['model'],qs[_0x2895('0x37')](_0x3ae81f[_0x2895('0x36')][_0x2895('0x37')]));_0x265c7a['attributes']=_0x265c7a['attributes'][_0x2895('0x39')]?_0x265c7a[_0x2895('0x38')]:_0x32baef['model'];_0x265c7a[_0x2895('0x3d')]=qs['sort'](_0x3ae81f[_0x2895('0x36')][_0x2895('0x3e')]);_0x265c7a[_0x2895('0x41')]=qs[_0x2895('0x34')](_[_0x2895('0x3f')](_0x3ae81f[_0x2895('0x36')],_0x32baef[_0x2895('0x34')]));if(_0x3ae81f['query'][_0x2895('0x40')]){_0x265c7a[_0x2895('0x41')]=_['merge'](_0x265c7a[_0x2895('0x41')],{'$or':_[_0x2895('0x32')](_0x265c7a['attributes'],function(_0x1cf787){var _0x3c8ea2={};_0x3c8ea2[_0x1cf787]={'$like':'%'+_0x3ae81f[_0x2895('0x36')][_0x2895('0x40')]+'%'};return _0x3c8ea2;})});}_0x265c7a=_[_0x2895('0x42')]({},_0x265c7a,_0x3ae81f[_0x2895('0x43')]);return _0x3d2996[_0x2895('0x75')](_0x265c7a);}})[_0x2895('0x26')](function(_0xdbd16a){if(_0xdbd16a){_0x3d47d0=_0xdbd16a[_0x2895('0x39')];if(!_0x3ae81f[_0x2895('0x36')][_0x2895('0x3b')](_0x2895('0x3c'))){_0x265c7a[_0x2895('0x1f')]=qs['limit'](_0x3ae81f[_0x2895('0x36')][_0x2895('0x1f')]);_0x265c7a[_0x2895('0x1d')]=qs[_0x2895('0x1d')](_0x3ae81f[_0x2895('0x36')][_0x2895('0x1d')]);}return _0x3d2996[_0x2895('0x75')](_0x265c7a);}})['then'](function(_0x17055a){if(_0x17055a){return _0x17055a?{'count':_0x3d47d0,'rows':_0x17055a}:null;}})['then'](respondWithResult(_0x25f5c9,null))[_0x2895('0x47')](handleError(_0x25f5c9,null));};exports['addTeams']=function(_0x204af3,_0x3e2994,_0x1e85d9){var _0x53ccff=_0x204af3[_0x2895('0x4e')]['ids'];var _0x3f024f;return db[_0x2895('0x76')][_0x2895('0x77')]({'where':{'id':_0x53ccff},'attributes':['id'],'include':[{'model':db[_0x2895('0x74')],'as':_0x2895('0x78'),'attributes':['id',_0x2895('0x2b'),_0x2895('0x79'),'voicePause',_0x2895('0x7a')],'raw':!![]}]})[_0x2895('0x26')](function(_0x1b8f32){if(_0x1b8f32){_0x3f024f=_0x1b8f32;var _0x4b7c11=_['flatMap'](_0x1b8f32,function(_0x335da0){var _0x13e113=_0x335da0[_0x2895('0x4f')]({'plain':!![]});return _0x13e113['Agents'];});return db[_0x2895('0x2e')][_0x2895('0x49')]({'where':{'id':_0x204af3[_0x2895('0x48')]['id']}})[_0x2895('0x26')](function(_0x1dcc85){return db[_0x2895('0x4c')][_0x2895('0x4d')](function(_0x2d6109){return _0x1dcc85[_0x2895('0x7b')](_0x53ccff,{'transaction':_0x2d6109})[_0x2895('0x26')](function(){return BPromise[_0x2895('0x7c')](_0x3f024f,function(_0x16ec29){return db[_0x2895('0x7d')][_0x2895('0x7e')]({'TeamId':_0x16ec29['id'],'VoicePrefixId':_0x204af3[_0x2895('0x48')]['id']},{'transaction':_0x2d6109});});})[_0x2895('0x26')](function(){return BPromise[_0x2895('0x7c')](_0x4b7c11,function(_0x2c6df4){return db[_0x2895('0x7f')]['findOrCreate']({'where':{'UserId':_0x2c6df4['id'],'VoicePrefixId':_0x204af3['params']['id']},'transaction':_0x2d6109});});})[_0x2895('0x26')](function(){_0x4b7c11[_0x2895('0x80')](function(_0x366ca5){socket[_0x2895('0x6d')](_0x2895('0x6e'),{'UserId':_0x366ca5['id'],'VoicePrefixId':_0x1dcc85['id']});});});});});}})[_0x2895('0x26')](respondWithStatusCode(_0x3e2994,null))['catch'](handleError(_0x3e2994,null));};exports['removeTeams']=function(_0x51b96a,_0x40d48c,_0x4f0b85){return db[_0x2895('0x76')][_0x2895('0x77')]({'where':{'id':_0x51b96a[_0x2895('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x2895('0x74')],'as':_0x2895('0x78'),'attributes':['id'],'raw':!![]}]})[_0x2895('0x26')](handleEntityNotFound(_0x40d48c,null))['then'](function(_0x340cb7){var _0x2458f1=_[_0x2895('0x32')](_0x340cb7,'id');var _0x2e3651=[];var _0x2187ce=[];var _0x175202=squel[_0x2895('0x81')]();_0x175202[_0x2895('0x82')]('tq.TeamId')[_0x2895('0x83')](_0x2895('0x84'),'tq')[_0x2895('0x85')](_0x2895('0x86'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x2895('0x87'),_0x51b96a[_0x2895('0x48')]['id']);for(var _0x53eef2=0x0;_0x53eef2<_0x340cb7[_0x2895('0x39')];_0x53eef2+=0x1){let _0x1e2311=_0x340cb7[_0x53eef2];for(var _0x368a30=0x0;_0x368a30<_0x1e2311['Agents'][_0x2895('0x39')];_0x368a30+=0x1){let _0x2dd3d9=_0x1e2311[_0x2895('0x78')][_0x368a30];var _0x233136=_0x175202['clone']();_0x233136[_0x2895('0x41')]('ut.UserId\x20=\x20?',_0x2dd3d9['id']);_0x2187ce['push'](db['sequelize'][_0x2895('0x36')](_0x233136['toString'](),{'type':db['sequelize']['QueryTypes']['SELECT']})['then'](function(_0x2bbb3e){if(_0x2bbb3e[_0x2895('0x39')]===0x1){return _0x2dd3d9['id'];}else{var _0x25969b=_[_0x2895('0x88')](_['map'](_0x2bbb3e,'TeamId'),function(_0x5cc9fc){return _[_0x2895('0x89')](_0x2458f1,_0x5cc9fc);});if(_0x25969b){return _0x2dd3d9['id'];}}}));}}return BPromise[_0x2895('0x8a')](_0x2187ce)[_0x2895('0x26')](function(_0x2ccc9f){_0x2e3651=_(_0x2e3651)[_0x2895('0x8b')](_0x2ccc9f)[_0x2895('0x8c')]()[_0x2895('0x8d')]();return db[_0x2895('0x2e')]['find']({'where':{'id':_0x51b96a[_0x2895('0x48')]['id']}})[_0x2895('0x26')](function(_0x16f74a){return db['sequelize'][_0x2895('0x4d')](function(_0x5d05d3){return _0x16f74a[_0x2895('0x8e')](_0x51b96a[_0x2895('0x36')][_0x2895('0x6b')],{'transaction':_0x5d05d3})[_0x2895('0x26')](function(){if(!_['isEmpty'](_0x2e3651)){return _0x16f74a[_0x2895('0x6f')](_0x2e3651,{'transaction':_0x5d05d3});}})[_0x2895('0x26')](function(){_0x2e3651[_0x2895('0x80')](function(_0x3fb18a){socket[_0x2895('0x6d')]('userVoicePrefix:remove',{'UserId':_0x3fb18a,'VoicePrefixId':_0x16f74a['id']});});});});});});})[_0x2895('0x26')](respondWithStatusCode(_0x40d48c,null))[_0x2895('0x47')](handleError(_0x40d48c,null));}; \ No newline at end of file +var _0xcf66=['error','stack','name','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','describe','create','sequelize','body','get','VoiceExtension','VoiceExtensionId','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','${EXTEN:','charAt','system-','transaction','findById','addAgents','ids','spread','userVoicePrefix:save','emit','userVoicePrefix:remove','findOne','User','getAgents','Team','getTeams','online','voicePause','interface','flatMap','Agents','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','select','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','compact','isEmpty','removeAgents','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','VoicePrefixes','UserProfileResource','sendStatus'];(function(_0x28f2a1,_0x5d5c8f){var _0x3cb633=function(_0x339240){while(--_0x339240){_0x28f2a1['push'](_0x28f2a1['shift']());}};_0x3cb633(++_0x5d5c8f);}(_0xcf66,0x71));var _0x6cf6=function(_0x441e59,_0x2a5d7b){_0x441e59=_0x441e59-0x0;var _0x432918=_0xcf66[_0x441e59];return _0x432918;};'use strict';var emlformat=require(_0x6cf6('0x0'));var rimraf=require(_0x6cf6('0x1'));var zipdir=require(_0x6cf6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6cf6('0x3'));var moment=require(_0x6cf6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6cf6('0x5'));var path=require(_0x6cf6('0x6'));var sox=require('sox');var csv=require(_0x6cf6('0x7'));var ejs=require(_0x6cf6('0x8'));var fs=require('fs');var fs_extra=require(_0x6cf6('0x9'));var _=require('lodash');var squel=require(_0x6cf6('0xa'));var crypto=require(_0x6cf6('0xb'));var jsforce=require(_0x6cf6('0xc'));var deskjs=require(_0x6cf6('0xd'));var toCsv=require(_0x6cf6('0x7'));var querystring=require(_0x6cf6('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6cf6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6cf6('0x10'));var logger=require(_0x6cf6('0x11'))(_0x6cf6('0x12'));var utils=require(_0x6cf6('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x6cf6('0x14')]=_[_0x6cf6('0x15')](config[_0x6cf6('0x14')],{'host':_0x6cf6('0x16'),'port':0x18eb});var socket=require(_0x6cf6('0x17'))(new Redis(config[_0x6cf6('0x14')]));require('./voicePrefix.socket')[_0x6cf6('0x18')](socket);function respondWithStatusCode(_0x494ece,_0x4dbae8){_0x4dbae8=_0x4dbae8||0xcc;return function(_0x18360e){if(_0x18360e){return _0x494ece['sendStatus'](_0x4dbae8);}return _0x494ece[_0x6cf6('0x19')](_0x4dbae8)[_0x6cf6('0x1a')]();};}function respondWithResult(_0x2d23ab,_0x74486a){_0x74486a=_0x74486a||0xc8;return function(_0x2b6d7b){if(_0x2b6d7b){return _0x2d23ab[_0x6cf6('0x19')](_0x74486a)[_0x6cf6('0x1b')](_0x2b6d7b);}};}function respondWithFilteredResult(_0x39ec25,_0x18c2f9){return function(_0x2ca2b1){if(_0x2ca2b1){var _0x5e8b11=typeof _0x18c2f9[_0x6cf6('0x1c')]===_0x6cf6('0x1d')&&typeof _0x18c2f9[_0x6cf6('0x1e')]==='undefined';var _0x18abd9=_0x2ca2b1[_0x6cf6('0x1f')];var _0x101e39=_0x5e8b11?0x0:_0x18c2f9[_0x6cf6('0x1c')];var _0x440634=_0x5e8b11?_0x2ca2b1[_0x6cf6('0x1f')]:_0x18c2f9[_0x6cf6('0x1c')]+_0x18c2f9['limit'];var _0x19f2cd;if(_0x440634>=_0x18abd9){_0x440634=_0x18abd9;_0x19f2cd=0xc8;}else{_0x19f2cd=0xce;}_0x39ec25[_0x6cf6('0x19')](_0x19f2cd);return _0x39ec25[_0x6cf6('0x20')](_0x6cf6('0x21'),_0x101e39+'-'+_0x440634+'/'+_0x18abd9)[_0x6cf6('0x1b')](_0x2ca2b1);}return null;};}function patchUpdates(_0x470ea4){return function(_0x41344f){try{jsonpatch[_0x6cf6('0x22')](_0x41344f,_0x470ea4,!![]);}catch(_0x5b2767){return BPromise['reject'](_0x5b2767);}return _0x41344f[_0x6cf6('0x23')]();};}function saveUpdates(_0x59f838,_0x45ce6e){return function(_0x18c8cd){if(_0x18c8cd){return _0x18c8cd[_0x6cf6('0x24')](_0x59f838)[_0x6cf6('0x25')](function(_0x3f9871){return _0x3f9871;});}return null;};}function removeEntity(_0x565fad,_0x1c966e){return function(_0x4e0e85){if(_0x4e0e85){return _0x4e0e85[_0x6cf6('0x26')]()[_0x6cf6('0x25')](function(){var _0x3eaa31=_0x4e0e85['get']({'plain':!![]});var _0xf4eec5=_0x6cf6('0x27');return db[_0x6cf6('0x28')][_0x6cf6('0x26')]({'where':{'type':_0xf4eec5,'resourceId':_0x3eaa31['id']}})['then'](function(){return _0x4e0e85;});})['then'](function(){_0x565fad[_0x6cf6('0x19')](0xcc)[_0x6cf6('0x1a')]();});}};}function handleEntityNotFound(_0x57099f,_0x5869e9){return function(_0x5ccc8f){if(!_0x5ccc8f){_0x57099f[_0x6cf6('0x29')](0x194);}return _0x5ccc8f;};}function handleError(_0x52717d,_0x4ceeb9){_0x4ceeb9=_0x4ceeb9||0x1f4;return function(_0x519a70){logger[_0x6cf6('0x2a')](_0x519a70[_0x6cf6('0x2b')]);if(_0x519a70[_0x6cf6('0x2c')]){delete _0x519a70[_0x6cf6('0x2c')];}_0x52717d[_0x6cf6('0x19')](_0x4ceeb9)['send'](_0x519a70);};}exports[_0x6cf6('0x2d')]=function(_0x2ae422,_0x356340){var _0x535b28={},_0x3c4b7a={},_0x145363={'count':0x0,'rows':[]};var _0xfcb0e5=_[_0x6cf6('0x2e')](db[_0x6cf6('0x2f')][_0x6cf6('0x30')],function(_0x11f66d){return{'name':_0x11f66d[_0x6cf6('0x31')],'type':_0x11f66d[_0x6cf6('0x32')][_0x6cf6('0x33')]};});_0x3c4b7a[_0x6cf6('0x34')]=_[_0x6cf6('0x2e')](_0xfcb0e5,_0x6cf6('0x2c'));_0x3c4b7a[_0x6cf6('0x35')]=_[_0x6cf6('0x36')](_0x2ae422[_0x6cf6('0x35')]);_0x3c4b7a[_0x6cf6('0x37')]=_[_0x6cf6('0x38')](_0x3c4b7a['model'],_0x3c4b7a[_0x6cf6('0x35')]);_0x535b28[_0x6cf6('0x39')]=_[_0x6cf6('0x38')](_0x3c4b7a[_0x6cf6('0x34')],qs[_0x6cf6('0x3a')](_0x2ae422[_0x6cf6('0x35')][_0x6cf6('0x3a')]));_0x535b28[_0x6cf6('0x39')]=_0x535b28[_0x6cf6('0x39')][_0x6cf6('0x3b')]?_0x535b28[_0x6cf6('0x39')]:_0x3c4b7a['model'];if(!_0x2ae422[_0x6cf6('0x35')][_0x6cf6('0x3c')](_0x6cf6('0x3d'))){_0x535b28[_0x6cf6('0x1e')]=qs[_0x6cf6('0x1e')](_0x2ae422[_0x6cf6('0x35')][_0x6cf6('0x1e')]);_0x535b28[_0x6cf6('0x1c')]=qs[_0x6cf6('0x1c')](_0x2ae422['query'][_0x6cf6('0x1c')]);}_0x535b28[_0x6cf6('0x3e')]=qs[_0x6cf6('0x3f')](_0x2ae422[_0x6cf6('0x35')][_0x6cf6('0x3f')]);_0x535b28[_0x6cf6('0x40')]=qs[_0x6cf6('0x37')](_[_0x6cf6('0x41')](_0x2ae422[_0x6cf6('0x35')],_0x3c4b7a['filters']),_0xfcb0e5);if(_0x2ae422[_0x6cf6('0x35')]['filter']){_0x535b28[_0x6cf6('0x40')]=_[_0x6cf6('0x42')](_0x535b28[_0x6cf6('0x40')],{'$or':_[_0x6cf6('0x2e')](_0xfcb0e5,function(_0x2cf96b){if(_0x2cf96b[_0x6cf6('0x32')]!==_0x6cf6('0x43')){var _0x26b817={};_0x26b817[_0x2cf96b['name']]={'$like':'%'+_0x2ae422[_0x6cf6('0x35')][_0x6cf6('0x44')]+'%'};return _0x26b817;}})});}_0x535b28=_['merge']({},_0x535b28,_0x2ae422[_0x6cf6('0x45')]);var _0x41c16a={'where':_0x535b28[_0x6cf6('0x40')]};return db['VoicePrefix'][_0x6cf6('0x1f')](_0x41c16a)[_0x6cf6('0x25')](function(_0x51d915){_0x145363[_0x6cf6('0x1f')]=_0x51d915;if(_0x2ae422[_0x6cf6('0x35')][_0x6cf6('0x46')]){_0x535b28[_0x6cf6('0x47')]=[{'all':!![]}];}return db[_0x6cf6('0x2f')][_0x6cf6('0x48')](_0x535b28);})[_0x6cf6('0x25')](function(_0x5a2ef8){_0x145363[_0x6cf6('0x49')]=_0x5a2ef8;return _0x145363;})['then'](respondWithFilteredResult(_0x356340,_0x535b28))[_0x6cf6('0x4a')](handleError(_0x356340,null));};exports[_0x6cf6('0x4b')]=function(_0x4927d4,_0x18efca){var _0x14dd21={'raw':![],'where':{'id':_0x4927d4[_0x6cf6('0x4c')]['id']}},_0x235f37={};_0x235f37[_0x6cf6('0x34')]=_['keys'](db[_0x6cf6('0x2f')][_0x6cf6('0x30')]);_0x235f37[_0x6cf6('0x35')]=_['keys'](_0x4927d4[_0x6cf6('0x35')]);_0x235f37[_0x6cf6('0x37')]=_[_0x6cf6('0x38')](_0x235f37['model'],_0x235f37[_0x6cf6('0x35')]);_0x14dd21['attributes']=_['intersection'](_0x235f37[_0x6cf6('0x34')],qs[_0x6cf6('0x3a')](_0x4927d4[_0x6cf6('0x35')][_0x6cf6('0x3a')]));_0x14dd21[_0x6cf6('0x39')]=_0x14dd21[_0x6cf6('0x39')][_0x6cf6('0x3b')]?_0x14dd21[_0x6cf6('0x39')]:_0x235f37[_0x6cf6('0x34')];if(_0x4927d4[_0x6cf6('0x35')][_0x6cf6('0x46')]){_0x14dd21[_0x6cf6('0x47')]=[{'all':!![]}];}_0x14dd21=_[_0x6cf6('0x42')]({},_0x14dd21,_0x4927d4['options']);return db[_0x6cf6('0x2f')][_0x6cf6('0x4d')](_0x14dd21)['then'](handleEntityNotFound(_0x18efca,null))['then'](respondWithResult(_0x18efca,null))[_0x6cf6('0x4a')](handleError(_0x18efca,null));};exports[_0x6cf6('0x26')]=function(_0x1db524,_0x20a106){return db[_0x6cf6('0x2f')][_0x6cf6('0x4d')]({'where':{'id':_0x1db524['params']['id']}})[_0x6cf6('0x25')](handleEntityNotFound(_0x20a106,null))[_0x6cf6('0x25')](removeEntity(_0x20a106,null))[_0x6cf6('0x4a')](handleError(_0x20a106,null));};exports['describe']=function(_0x5df6d3,_0x211b89){return db[_0x6cf6('0x2f')][_0x6cf6('0x4e')]()[_0x6cf6('0x25')](respondWithResult(_0x211b89,null))[_0x6cf6('0x4a')](handleError(_0x211b89,null));};exports[_0x6cf6('0x4f')]=function(_0x2cb470,_0x3e8aee){var _0x3800fe;return db[_0x6cf6('0x50')]['transaction'](function(_0x217072){return db[_0x6cf6('0x2f')][_0x6cf6('0x4f')](_0x2cb470[_0x6cf6('0x51')],{'transaction':_0x217072})[_0x6cf6('0x25')](function(_0x31947d){_0x3800fe=_0x31947d[_0x6cf6('0x52')]({'plain':!![]});return db[_0x6cf6('0x53')][_0x6cf6('0x4d')]({'where':{'id':_0x3800fe[_0x6cf6('0x54')]},'raw':!![]})[_0x6cf6('0x25')](function(_0x4fb831){return createVoicePrefixExtensions(_0x3800fe,_0x4fb831,_0x217072);});});})[_0x6cf6('0x25')](function(){var _0x4ec56b=_0x2cb470[_0x6cf6('0x55')][_0x6cf6('0x52')]({'plain':!![]});if(!_0x4ec56b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ec56b[_0x6cf6('0x56')]===_0x6cf6('0x55')){var _0x4699d5=_0x3800fe;return db[_0x6cf6('0x57')][_0x6cf6('0x4d')]({'where':{'name':_0x6cf6('0x27'),'userProfileId':_0x4ec56b['userProfileId']},'raw':!![]})[_0x6cf6('0x25')](function(_0x167356){if(_0x167356&&_0x167356[_0x6cf6('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x4699d5[_0x6cf6('0x2c')],'resourceId':_0x4699d5['id'],'type':_0x167356[_0x6cf6('0x2c')],'sectionId':_0x167356['id']},{})['then'](function(){return _0x3800fe;});}else{return _0x3800fe;}})[_0x6cf6('0x4a')](function(_0x3559ab){logger[_0x6cf6('0x2a')](_0x6cf6('0x59'),_0x3559ab);throw _0x3559ab;});}return _0x3800fe;})[_0x6cf6('0x25')](respondWithResult(_0x3e8aee,null))['catch'](handleError(_0x3e8aee,null));};function Extension(_0x3e7e5b,_0x40b31f,_0x57f26b,_0x4cd6fe){this[_0x6cf6('0x5a')]=_0x6cf6('0x5b');this[_0x6cf6('0x5c')]=_0x3e7e5b;this[_0x6cf6('0x5d')]=_0x57f26b;this[_0x6cf6('0x32')]='system';this['description']=_0x6cf6('0x5e');this[_0x6cf6('0x5f')]=_0x40b31f;this[_0x6cf6('0x60')]=_0x4cd6fe;}function createVoicePrefixExtensions(_0x238002,_0xf8c052,_0x591a24){return new BPromise(function(_0x51dfcf,_0x52df24){var _0x39c857=new Extension(formatPrefixName(_0x238002[_0x6cf6('0x61')]),0x1,_0x6cf6('0x62'),_0x6cf6('0x63'));_0x39c857['VoicePrefixId']=_0x238002['id'];return db[_0x6cf6('0x53')]['create'](_0x39c857,{'transaction':_0x591a24})[_0x6cf6('0x25')](function(_0x54ef08){var _0x3842ff=_0x54ef08[_0x6cf6('0x52')]({'plain':!![]});var _0x2f2ee3=_[_0x6cf6('0x2e')](addVoicePrefixExtensions(_0x238002,_0xf8c052),function(_0x38ebcc){_0x38ebcc['VoiceExtensionId']=_0x3842ff['id'];_0x38ebcc[_0x6cf6('0x64')]=_0x238002['id'];return _0x38ebcc;});return db['VoiceExtension'][_0x6cf6('0x65')](_0x2f2ee3,{'transaction':_0x591a24})['then'](function(_0x4363f7){if(!_0x4363f7){return _0x52df24('Extensions\x20creation\x20failed');}else{return _0x51dfcf(_0x4363f7);}})[_0x6cf6('0x4a')](function(_0x42daab){return _0x52df24(_0x42daab);});});;});};function addVoicePrefixExtensions(_0x5df21f,_0x3b4cb){var _0x15ae6c=[];var _0x1c98c2=formatPrefixName(_0x5df21f[_0x6cf6('0x61')]);_0x15ae6c[_0x6cf6('0x66')](new Extension(_0x1c98c2,0x2,_0x6cf6('0x67'),_0x6cf6('0x68')+_0x5df21f['name']));if(_0x5df21f['callerIdAll']){_0x15ae6c[_0x6cf6('0x66')](new Extension(_0x1c98c2,0x3,_0x6cf6('0x67'),'PREFIX-CALLERIDALL='+_0x5df21f[_0x6cf6('0x69')]));}else{_0x15ae6c['push'](new Extension(_0x1c98c2,0x3,'NoOp',_0x6cf6('0x6a')));}_0x15ae6c['push'](new Extension(_0x1c98c2,0x4,'goto',_0x3b4cb[_0x6cf6('0x5a')]+','+_0x6cf6('0x6b')+(0x8+_0x5df21f[_0x6cf6('0x2c')]['length'])+'}'+','+0x1));return _0x15ae6c;}function formatPrefixName(_0x18b60c){var _0x4a2451='_';for(var _0x2dedba=0x0;_0x2dedba<_0x18b60c[_0x6cf6('0x3b')];_0x2dedba++){if(_0x18b60c['charAt'](_0x2dedba)=='-'){_0x4a2451+=_0x18b60c[_0x6cf6('0x6c')](_0x2dedba);}else{_0x4a2451+='['+_0x18b60c[_0x6cf6('0x6c')](_0x2dedba)+']';}}_0x4a2451+='.';return _0x4a2451;}exports[_0x6cf6('0x24')]=function(_0x421819,_0xa36ee1,_0x40ea5e){var _0x59180d=_0x421819[_0x6cf6('0x51')];_0x59180d[_0x6cf6('0x61')]=_0x6cf6('0x6d')+_0x59180d[_0x6cf6('0x2c')]+'-';return db[_0x6cf6('0x50')][_0x6cf6('0x6e')](function(_0x55ea84){return db['VoicePrefix']['update'](_0x59180d,{'where':{'id':_0x59180d['id']},'transaction':_0x55ea84})[_0x6cf6('0x25')](function(){return db['VoiceExtension'][_0x6cf6('0x26')]({'where':{'VoicePrefixId':_0x59180d['id']},'transaction':_0x55ea84})['then'](function(){return db[_0x6cf6('0x53')][_0x6cf6('0x4d')]({'where':{'id':_0x59180d['VoiceExtensionId']},'raw':!![]})[_0x6cf6('0x25')](function(_0xd11d4b){return createVoicePrefixExtensions(_0x59180d,_0xd11d4b,_0x55ea84);});});});})[_0x6cf6('0x25')](function(){return db['VoicePrefix'][_0x6cf6('0x6f')](_0x59180d['id']);})['then'](respondWithResult(_0xa36ee1,null))[_0x6cf6('0x4a')](handleError(_0xa36ee1,null));};exports[_0x6cf6('0x70')]=function(_0x1635dc,_0x308076,_0x33b436){return db[_0x6cf6('0x2f')][_0x6cf6('0x4d')]({'where':{'id':_0x1635dc['params']['id']}})[_0x6cf6('0x25')](handleEntityNotFound(_0x308076,null))['then'](function(_0x3f3d67){if(_0x3f3d67){return _0x3f3d67[_0x6cf6('0x70')](_0x1635dc[_0x6cf6('0x51')][_0x6cf6('0x71')],_['omit'](_0x1635dc['body'],[_0x6cf6('0x71'),'id'])||{})[_0x6cf6('0x72')](function(_0x1a0c49){for(var _0x3060d=0x0;_0x3060d<_0x1635dc[_0x6cf6('0x51')][_0x6cf6('0x71')]['length'];_0x3060d+=0x1){socket['emit'](_0x6cf6('0x73'),{'UserId':Number(_0x1635dc['body'][_0x6cf6('0x71')][_0x3060d]),'VoicePrefixId':Number(_0x1635dc[_0x6cf6('0x4c')]['id'])});}return _0x1a0c49;});}})[_0x6cf6('0x25')](respondWithResult(_0x308076,null))[_0x6cf6('0x4a')](handleError(_0x308076,null));};exports['removeAgents']=function(_0x4435bc,_0x4c5f0d,_0x49cf03){return db[_0x6cf6('0x2f')][_0x6cf6('0x4d')]({'where':{'id':_0x4435bc['params']['id']}})[_0x6cf6('0x25')](handleEntityNotFound(_0x4c5f0d,null))[_0x6cf6('0x25')](function(_0x37fa59){if(_0x37fa59){return _0x37fa59['removeAgents'](_0x4435bc[_0x6cf6('0x35')][_0x6cf6('0x71')])[_0x6cf6('0x25')](function(){if(_['isArray'](_0x4435bc['query'][_0x6cf6('0x71')])){for(var _0x5189b6=0x0;_0x5189b6<_0x4435bc['query'][_0x6cf6('0x71')][_0x6cf6('0x3b')];_0x5189b6+=0x1){socket[_0x6cf6('0x74')](_0x6cf6('0x75'),{'UserId':Number(_0x4435bc[_0x6cf6('0x35')][_0x6cf6('0x71')][_0x5189b6]),'VoicePrefixId':Number(_0x4435bc[_0x6cf6('0x4c')]['id'])});}}else{socket[_0x6cf6('0x74')](_0x6cf6('0x75'),{'UserId':Number(_0x4435bc['query'][_0x6cf6('0x71')]),'VoicePrefixId':Number(_0x4435bc[_0x6cf6('0x4c')]['id'])});}});}})[_0x6cf6('0x25')](respondWithStatusCode(_0x4c5f0d,null))['catch'](handleError(_0x4c5f0d,null));};exports['getAgents']=function(_0x38b830,_0x169a33,_0x204f3d){var _0x1c254d={};var _0x38652f={};var _0x1fee93;var _0x5e953e;return db[_0x6cf6('0x2f')][_0x6cf6('0x76')]({'where':{'id':_0x38b830[_0x6cf6('0x4c')]['id']}})[_0x6cf6('0x25')](handleEntityNotFound(_0x169a33,null))[_0x6cf6('0x25')](function(_0x260a62){if(_0x260a62){_0x1fee93=_0x260a62;_0x38652f[_0x6cf6('0x34')]=_['keys'](db[_0x6cf6('0x77')][_0x6cf6('0x30')]);_0x38652f['query']=_[_0x6cf6('0x36')](_0x38b830[_0x6cf6('0x35')]);_0x38652f[_0x6cf6('0x37')]=_['intersection'](_0x38652f[_0x6cf6('0x34')],_0x38652f[_0x6cf6('0x35')]);_0x1c254d[_0x6cf6('0x39')]=_[_0x6cf6('0x38')](_0x38652f[_0x6cf6('0x34')],qs[_0x6cf6('0x3a')](_0x38b830['query']['fields']));_0x1c254d['attributes']=_0x1c254d[_0x6cf6('0x39')]['length']?_0x1c254d[_0x6cf6('0x39')]:_0x38652f[_0x6cf6('0x34')];_0x1c254d['order']=qs[_0x6cf6('0x3f')](_0x38b830[_0x6cf6('0x35')][_0x6cf6('0x3f')]);_0x1c254d[_0x6cf6('0x40')]=qs[_0x6cf6('0x37')](_['pick'](_0x38b830[_0x6cf6('0x35')],_0x38652f[_0x6cf6('0x37')]));if(_0x38b830[_0x6cf6('0x35')]['filter']){_0x1c254d['where']=_[_0x6cf6('0x42')](_0x1c254d[_0x6cf6('0x40')],{'$or':_[_0x6cf6('0x2e')](_0x1c254d[_0x6cf6('0x39')],function(_0x296664){var _0x1841b5={};_0x1841b5[_0x296664]={'$like':'%'+_0x38b830[_0x6cf6('0x35')]['filter']+'%'};return _0x1841b5;})});}_0x1c254d=_[_0x6cf6('0x42')]({},_0x1c254d,_0x38b830[_0x6cf6('0x45')]);return _0x1fee93[_0x6cf6('0x78')](_0x1c254d);}})['then'](function(_0x27c0cb){if(_0x27c0cb){_0x5e953e=_0x27c0cb[_0x6cf6('0x3b')];if(!_0x38b830[_0x6cf6('0x35')][_0x6cf6('0x3c')]('nolimit')){_0x1c254d[_0x6cf6('0x1e')]=qs[_0x6cf6('0x1e')](_0x38b830[_0x6cf6('0x35')][_0x6cf6('0x1e')]);_0x1c254d[_0x6cf6('0x1c')]=qs[_0x6cf6('0x1c')](_0x38b830[_0x6cf6('0x35')]['offset']);}return _0x1fee93['getAgents'](_0x1c254d);}})['then'](function(_0x5b1385){if(_0x5b1385){return _0x5b1385?{'count':_0x5e953e,'rows':_0x5b1385}:null;}})[_0x6cf6('0x25')](respondWithResult(_0x169a33,null))[_0x6cf6('0x4a')](handleError(_0x169a33,null));};exports['getTeams']=function(_0x165121,_0x16f407,_0x558601){var _0x41b355={};var _0x4fb1d9={};var _0x5b4b7c;var _0x267856;return db[_0x6cf6('0x2f')][_0x6cf6('0x76')]({'where':{'id':_0x165121[_0x6cf6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x16f407,null))[_0x6cf6('0x25')](function(_0x12196d){if(_0x12196d){_0x5b4b7c=_0x12196d;_0x4fb1d9['model']=_[_0x6cf6('0x36')](db[_0x6cf6('0x79')]['rawAttributes']);_0x4fb1d9[_0x6cf6('0x35')]=_['keys'](_0x165121[_0x6cf6('0x35')]);_0x4fb1d9['filters']=_[_0x6cf6('0x38')](_0x4fb1d9[_0x6cf6('0x34')],_0x4fb1d9['query']);_0x41b355[_0x6cf6('0x39')]=_['intersection'](_0x4fb1d9['model'],qs[_0x6cf6('0x3a')](_0x165121[_0x6cf6('0x35')][_0x6cf6('0x3a')]));_0x41b355[_0x6cf6('0x39')]=_0x41b355['attributes'][_0x6cf6('0x3b')]?_0x41b355[_0x6cf6('0x39')]:_0x4fb1d9[_0x6cf6('0x34')];_0x41b355[_0x6cf6('0x3e')]=qs[_0x6cf6('0x3f')](_0x165121[_0x6cf6('0x35')][_0x6cf6('0x3f')]);_0x41b355[_0x6cf6('0x40')]=qs[_0x6cf6('0x37')](_[_0x6cf6('0x41')](_0x165121[_0x6cf6('0x35')],_0x4fb1d9[_0x6cf6('0x37')]));if(_0x165121[_0x6cf6('0x35')][_0x6cf6('0x44')]){_0x41b355[_0x6cf6('0x40')]=_[_0x6cf6('0x42')](_0x41b355[_0x6cf6('0x40')],{'$or':_[_0x6cf6('0x2e')](_0x41b355[_0x6cf6('0x39')],function(_0x44ec79){var _0x506275={};_0x506275[_0x44ec79]={'$like':'%'+_0x165121[_0x6cf6('0x35')][_0x6cf6('0x44')]+'%'};return _0x506275;})});}_0x41b355=_[_0x6cf6('0x42')]({},_0x41b355,_0x165121[_0x6cf6('0x45')]);return _0x5b4b7c[_0x6cf6('0x7a')](_0x41b355);}})[_0x6cf6('0x25')](function(_0x1013cb){if(_0x1013cb){_0x267856=_0x1013cb['length'];if(!_0x165121['query']['hasOwnProperty'](_0x6cf6('0x3d'))){_0x41b355['limit']=qs[_0x6cf6('0x1e')](_0x165121[_0x6cf6('0x35')]['limit']);_0x41b355['offset']=qs[_0x6cf6('0x1c')](_0x165121['query'][_0x6cf6('0x1c')]);}return _0x5b4b7c[_0x6cf6('0x7a')](_0x41b355);}})[_0x6cf6('0x25')](function(_0x1ff190){if(_0x1ff190){return _0x1ff190?{'count':_0x267856,'rows':_0x1ff190}:null;}})[_0x6cf6('0x25')](respondWithResult(_0x16f407,null))[_0x6cf6('0x4a')](handleError(_0x16f407,null));};exports['addTeams']=function(_0x14cafd,_0x43e3ff,_0x5bf895){var _0x42098b=_0x14cafd[_0x6cf6('0x51')]['ids'];var _0x200234;return db[_0x6cf6('0x79')][_0x6cf6('0x48')]({'where':{'id':_0x42098b},'attributes':['id'],'include':[{'model':db[_0x6cf6('0x77')],'as':'Agents','attributes':['id',_0x6cf6('0x2c'),_0x6cf6('0x7b'),_0x6cf6('0x7c'),_0x6cf6('0x7d')],'raw':!![]}]})['then'](function(_0xc0ecf4){if(_0xc0ecf4){_0x200234=_0xc0ecf4;var _0x17b193=_[_0x6cf6('0x7e')](_0xc0ecf4,function(_0x2b083f){var _0x54422f=_0x2b083f['get']({'plain':!![]});return _0x54422f[_0x6cf6('0x7f')];});return db[_0x6cf6('0x2f')][_0x6cf6('0x4d')]({'where':{'id':_0x14cafd[_0x6cf6('0x4c')]['id']}})['then'](function(_0x4a5e51){return db[_0x6cf6('0x50')][_0x6cf6('0x6e')](function(_0xb9cbc3){return _0x4a5e51[_0x6cf6('0x80')](_0x42098b,{'transaction':_0xb9cbc3})[_0x6cf6('0x25')](function(){return BPromise[_0x6cf6('0x81')](_0x200234,function(_0x53f0a3){return db[_0x6cf6('0x82')][_0x6cf6('0x83')]({'TeamId':_0x53f0a3['id'],'VoicePrefixId':_0x14cafd[_0x6cf6('0x4c')]['id']},{'transaction':_0xb9cbc3});});})[_0x6cf6('0x25')](function(){return BPromise[_0x6cf6('0x81')](_0x17b193,function(_0x450ffb){return db[_0x6cf6('0x84')][_0x6cf6('0x85')]({'where':{'UserId':_0x450ffb['id'],'VoicePrefixId':_0x14cafd[_0x6cf6('0x4c')]['id']},'transaction':_0xb9cbc3});});})[_0x6cf6('0x25')](function(){_0x17b193[_0x6cf6('0x86')](function(_0x476abd){socket[_0x6cf6('0x74')](_0x6cf6('0x73'),{'UserId':_0x476abd['id'],'VoicePrefixId':_0x4a5e51['id']});});});});});}})[_0x6cf6('0x25')](respondWithStatusCode(_0x43e3ff,null))[_0x6cf6('0x4a')](handleError(_0x43e3ff,null));};exports['removeTeams']=function(_0x17b497,_0x1f5c50,_0x46ecdb){return db['Team']['findAll']({'where':{'id':_0x17b497['query'][_0x6cf6('0x71')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x6cf6('0x25')](handleEntityNotFound(_0x1f5c50,null))[_0x6cf6('0x25')](function(_0x41aae0){var _0x208719=_['map'](_0x41aae0,'id');var _0x395343=[];var _0x4669b2=[];var _0x91f143=squel[_0x6cf6('0x87')]();_0x91f143[_0x6cf6('0x88')](_0x6cf6('0x89'))[_0x6cf6('0x8a')](_0x6cf6('0x8b'),'tq')[_0x6cf6('0x8c')](_0x6cf6('0x8d'),'ut',_0x6cf6('0x8e'))[_0x6cf6('0x40')](_0x6cf6('0x8f'),_0x17b497['params']['id']);for(var _0x210578=0x0;_0x210578<_0x41aae0['length'];_0x210578+=0x1){let _0xeff7c=_0x41aae0[_0x210578];for(var _0x5e90f0=0x0;_0x5e90f0<_0xeff7c[_0x6cf6('0x7f')][_0x6cf6('0x3b')];_0x5e90f0+=0x1){let _0x193ad7=_0xeff7c['Agents'][_0x5e90f0];var _0x50def2=_0x91f143[_0x6cf6('0x90')]();_0x50def2[_0x6cf6('0x40')](_0x6cf6('0x91'),_0x193ad7['id']);_0x4669b2[_0x6cf6('0x66')](db['sequelize']['query'](_0x50def2[_0x6cf6('0x92')](),{'type':db['sequelize'][_0x6cf6('0x93')][_0x6cf6('0x94')]})[_0x6cf6('0x25')](function(_0x279675){if(_0x279675[_0x6cf6('0x3b')]===0x1){return _0x193ad7['id'];}else{var _0x3e0d2d=_[_0x6cf6('0x95')](_[_0x6cf6('0x2e')](_0x279675,'TeamId'),function(_0x414e9e){return _[_0x6cf6('0x96')](_0x208719,_0x414e9e);});if(_0x3e0d2d){return _0x193ad7['id'];}}}));}}return BPromise[_0x6cf6('0x97')](_0x4669b2)[_0x6cf6('0x25')](function(_0x1b32e6){_0x395343=_(_0x395343)['union'](_0x1b32e6)[_0x6cf6('0x98')]()['value']();return db['VoicePrefix'][_0x6cf6('0x4d')]({'where':{'id':_0x17b497['params']['id']}})['then'](function(_0x2ca336){return db[_0x6cf6('0x50')][_0x6cf6('0x6e')](function(_0x3a1d61){return _0x2ca336['removeTeams'](_0x17b497[_0x6cf6('0x35')]['ids'],{'transaction':_0x3a1d61})[_0x6cf6('0x25')](function(){if(!_[_0x6cf6('0x99')](_0x395343)){return _0x2ca336[_0x6cf6('0x9a')](_0x395343,{'transaction':_0x3a1d61});}})[_0x6cf6('0x25')](function(){_0x395343[_0x6cf6('0x86')](function(_0x48e595){socket[_0x6cf6('0x74')](_0x6cf6('0x75'),{'UserId':_0x48e595,'VoicePrefixId':_0x2ca336['id']});});});});});});})[_0x6cf6('0x25')](respondWithStatusCode(_0x1f5c50,null))[_0x6cf6('0x4a')](handleError(_0x1f5c50,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index e27f98a..b945dc0 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 _0x855e=['hook','exports','events','../../mysqldb','VoicePrefix','save','update','emit','hasOwnProperty'];(function(_0x3882a2,_0x1a24a3){var _0x3b56cb=function(_0x5890c4){while(--_0x5890c4){_0x3882a2['push'](_0x3882a2['shift']());}};_0x3b56cb(++_0x1a24a3);}(_0x855e,0x122));var _0xe855=function(_0x596174,_0x1cd426){_0x596174=_0x596174-0x0;var _0x56431c=_0x855e[_0x596174];return _0x56431c;};'use strict';var EventEmitter=require(_0xe855('0x0'));var VoicePrefix=require(_0xe855('0x1'))['db'][_0xe855('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe855('0x3'),'afterUpdate':_0xe855('0x4'),'afterDestroy':'remove'};function emitEvent(_0x46af14){return function(_0xdb6aea,_0x8d7bd1,_0x16b5b9){VoicePrefixEvents['emit'](_0x46af14+':'+_0xdb6aea['id'],_0xdb6aea);VoicePrefixEvents[_0xe855('0x5')](_0x46af14,_0xdb6aea);_0x16b5b9(null);};}for(var e in events){if(events[_0xe855('0x6')](e)){var event=events[e];VoicePrefix[_0xe855('0x7')](e,emitEvent(event));}}module[_0xe855('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0xd3de=['exports','events','../../mysqldb','VoicePrefix','setMaxListeners','update','emit','hook'];(function(_0x48a05d,_0x219867){var _0x4f365e=function(_0x8ac7bf){while(--_0x8ac7bf){_0x48a05d['push'](_0x48a05d['shift']());}};_0x4f365e(++_0x219867);}(_0xd3de,0x131));var _0xed3d=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd3de[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0xed3d('0x0'));var VoicePrefix=require(_0xed3d('0x1'))['db'][_0xed3d('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xed3d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xed3d('0x4'),'afterDestroy':'remove'};function emitEvent(_0xd9eb01){return function(_0x4fb756,_0x3aad07,_0x2e5201){VoicePrefixEvents[_0xed3d('0x5')](_0xd9eb01+':'+_0x4fb756['id'],_0x4fb756);VoicePrefixEvents['emit'](_0xd9eb01,_0x4fb756);_0x2e5201(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0xed3d('0x6')](e,emitEvent(event));}}module[_0xed3d('0x7')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 2d827b2..07a74ca 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 _0x9406=['request-promise','path','../../config/environment','./voicePrefix.attributes','exports','VoicePrefix','lodash','util','moment','bluebird'];(function(_0xb149bf,_0x349446){var _0xab868=function(_0x3fcb0c){while(--_0x3fcb0c){_0xb149bf['push'](_0xb149bf['shift']());}};_0xab868(++_0x349446);}(_0x9406,0xe2));var _0x6940=function(_0x299028,_0x4d7e9f){_0x299028=_0x299028-0x0;var _0x12154e=_0x9406[_0x299028];return _0x12154e;};'use strict';var _=require(_0x6940('0x0'));var util=require(_0x6940('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6940('0x2'));var BPromise=require(_0x6940('0x3'));var rp=require(_0x6940('0x4'));var fs=require('fs');var path=require(_0x6940('0x5'));var rimraf=require('rimraf');var config=require(_0x6940('0x6'));var attributes=require(_0x6940('0x7'));module[_0x6940('0x8')]=function(_0x2ec31f,_0x3eb078){return _0x2ec31f['define'](_0x6940('0x9'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0adc=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','define','VoicePrefix','lodash','../../config/logger','api'];(function(_0x1e1020,_0xd64a27){var _0x464719=function(_0x376ffa){while(--_0x376ffa){_0x1e1020['push'](_0x1e1020['shift']());}};_0x464719(++_0xd64a27);}(_0x0adc,0xf9));var _0xc0ad=function(_0x12ccd7,_0x3d33fe){_0x12ccd7=_0x12ccd7-0x0;var _0x175aff=_0x0adc[_0x12ccd7];return _0x175aff;};'use strict';var _=require(_0xc0ad('0x0'));var util=require('util');var logger=require(_0xc0ad('0x1'))(_0xc0ad('0x2'));var moment=require(_0xc0ad('0x3'));var BPromise=require(_0xc0ad('0x4'));var rp=require(_0xc0ad('0x5'));var fs=require('fs');var path=require(_0xc0ad('0x6'));var rimraf=require(_0xc0ad('0x7'));var config=require(_0xc0ad('0x8'));var attributes=require(_0xc0ad('0x9'));module['exports']=function(_0x3b1011,_0x1573d2){return _0x3b1011[_0xc0ad('0xa')](_0xc0ad('0xb'),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 271101f..755d046 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 _0xef0a=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','then','VoicePrefix,\x20%s,\x20%s','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment'];(function(_0x58e915,_0xef4b38){var _0x2ccb80=function(_0x353824){while(--_0x353824){_0x58e915['push'](_0x58e915['shift']());}};_0x2ccb80(++_0xef4b38);}(_0xef0a,0xdd));var _0xaef0=function(_0x15aeff,_0x28b59b){_0x15aeff=_0x15aeff-0x0;var _0x38a1a6=_0xef0a[_0x15aeff];return _0x38a1a6;};'use strict';var _=require(_0xaef0('0x0'));var util=require(_0xaef0('0x1'));var moment=require(_0xaef0('0x2'));var BPromise=require(_0xaef0('0x3'));var rs=require(_0xaef0('0x4'));var fs=require('fs');var Redis=require(_0xaef0('0x5'));var db=require(_0xaef0('0x6'))['db'];var utils=require(_0xaef0('0x7'));var logger=require(_0xaef0('0x8'))(_0xaef0('0x9'));var config=require(_0xaef0('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xaef0('0xb')][_0xaef0('0xc')]({'port':0x232a});config[_0xaef0('0xd')]=_[_0xaef0('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xaef0('0xf'))(new Redis(config[_0xaef0('0xd')]));require(_0xaef0('0x10'))[_0xaef0('0x11')](socket);function respondWithRpcPromise(_0x2ab0b1,_0x329590,_0x4a0c6f){return new BPromise(function(_0x481978,_0x742021){return client['request'](_0x2ab0b1,_0x4a0c6f)[_0xaef0('0x12')](function(_0xb8556a){logger['info'](_0xaef0('0x13'),_0x329590,'request\x20sent');logger['debug'](_0xaef0('0x14'),_0x329590,_0xaef0('0x15'),JSON[_0xaef0('0x16')](_0xb8556a));if(_0xb8556a[_0xaef0('0x17')]){if(_0xb8556a[_0xaef0('0x17')][_0xaef0('0x18')]===0x1f4){logger[_0xaef0('0x17')](_0xaef0('0x13'),_0x329590,_0xb8556a[_0xaef0('0x17')][_0xaef0('0x19')]);return _0x742021(_0xb8556a[_0xaef0('0x17')][_0xaef0('0x19')]);}logger[_0xaef0('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x329590,_0xb8556a[_0xaef0('0x17')][_0xaef0('0x19')]);return _0x481978(_0xb8556a['error'][_0xaef0('0x19')]);}else{logger[_0xaef0('0x1a')]('VoicePrefix,\x20%s,\x20%s',_0x329590,_0xaef0('0x15'));_0x481978(_0xb8556a[_0xaef0('0x1b')]['message']);}})['catch'](function(_0x1a9ebc){logger[_0xaef0('0x17')](_0xaef0('0x13'),_0x329590,_0x1a9ebc);_0x742021(_0x1a9ebc);});});} \ No newline at end of file +var _0x02ca=['then','info','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voicePrefix.socket','register'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x02ca,0x97));var _0xa02c=function(_0x14d1f2,_0x4e1ebb){_0x14d1f2=_0x14d1f2-0x0;var _0x32dc59=_0x02ca[_0x14d1f2];return _0x32dc59;};'use strict';var _=require(_0xa02c('0x0'));var util=require('util');var moment=require(_0xa02c('0x1'));var BPromise=require(_0xa02c('0x2'));var rs=require(_0xa02c('0x3'));var fs=require('fs');var Redis=require(_0xa02c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa02c('0x5'));var logger=require(_0xa02c('0x6'))(_0xa02c('0x7'));var config=require(_0xa02c('0x8'));var jayson=require(_0xa02c('0x9'));var client=jayson[_0xa02c('0xa')][_0xa02c('0xb')]({'port':0x232a});config[_0xa02c('0xc')]=_[_0xa02c('0xd')](config[_0xa02c('0xc')],{'host':_0xa02c('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa02c('0xc')]));require(_0xa02c('0xf'))[_0xa02c('0x10')](socket);function respondWithRpcPromise(_0x30e1aa,_0x14ffc2,_0x565373){return new BPromise(function(_0x5c553f,_0x50df17){return client['request'](_0x30e1aa,_0x565373)[_0xa02c('0x11')](function(_0x14c96f){logger[_0xa02c('0x12')](_0xa02c('0x13'),_0x14ffc2,'request\x20sent');logger[_0xa02c('0x14')](_0xa02c('0x15'),_0x14ffc2,_0xa02c('0x16'),JSON[_0xa02c('0x17')](_0x14c96f));if(_0x14c96f['error']){if(_0x14c96f[_0xa02c('0x18')][_0xa02c('0x19')]===0x1f4){logger[_0xa02c('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x14ffc2,_0x14c96f[_0xa02c('0x18')][_0xa02c('0x1a')]);return _0x50df17(_0x14c96f['error'][_0xa02c('0x1a')]);}logger[_0xa02c('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x14ffc2,_0x14c96f[_0xa02c('0x18')][_0xa02c('0x1a')]);return _0x5c553f(_0x14c96f[_0xa02c('0x18')]['message']);}else{logger[_0xa02c('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x14ffc2,'request\x20sent');_0x5c553f(_0x14c96f['result'][_0xa02c('0x1a')]);}})[_0xa02c('0x1b')](function(_0x16ac46){logger['error'](_0xa02c('0x13'),_0x14ffc2,_0x16ac46);_0x50df17(_0x16ac46);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index c1b0552..b7da6ce 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 _0xc368=['removeListener','register','length','voicePrefix:','save','update','emit'];(function(_0x58f57f,_0x23028c){var _0x318b7f=function(_0x1f239b){while(--_0x1f239b){_0x58f57f['push'](_0x58f57f['shift']());}};_0x318b7f(++_0x23028c);}(_0xc368,0x7b));var _0x8c36=function(_0x4d546b,_0x1ef0a1){_0x4d546b=_0x4d546b-0x0;var _0x165383=_0xc368[_0x4d546b];return _0x165383;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x8c36('0x0'),'remove',_0x8c36('0x1')];function createListener(_0x17fa33,_0x20e697){return function(_0x2640c5){_0x20e697[_0x8c36('0x2')](_0x17fa33,_0x2640c5);};}function removeListener(_0x5d3b27,_0x3e9034){return function(){VoicePrefixEvents[_0x8c36('0x3')](_0x5d3b27,_0x3e9034);};}exports[_0x8c36('0x4')]=function(_0x1d3660){for(var _0x5ebfc1=0x0,_0x554022=events[_0x8c36('0x5')];_0x5ebfc1<_0x554022;_0x5ebfc1++){var _0x384867=events[_0x5ebfc1];var _0x3e76be=createListener(_0x8c36('0x6')+_0x384867,_0x1d3660);VoicePrefixEvents['on'](_0x384867,_0x3e76be);}}; \ No newline at end of file +var _0xc112=['removeListener','register','length','voicePrefix:','./voicePrefix.events','save','remove','emit'];(function(_0x5db841,_0x4715de){var _0x4ae4b1=function(_0x222963){while(--_0x222963){_0x5db841['push'](_0x5db841['shift']());}};_0x4ae4b1(++_0x4715de);}(_0xc112,0xec));var _0x2c11=function(_0x1cbb16,_0x341dce){_0x1cbb16=_0x1cbb16-0x0;var _0x2899d8=_0xc112[_0x1cbb16];return _0x2899d8;};'use strict';var VoicePrefixEvents=require(_0x2c11('0x0'));var events=[_0x2c11('0x1'),_0x2c11('0x2'),'update'];function createListener(_0x8542d8,_0x40da2e){return function(_0x26e2a3){_0x40da2e[_0x2c11('0x3')](_0x8542d8,_0x26e2a3);};}function removeListener(_0xaa8492,_0x3a1cda){return function(){VoicePrefixEvents[_0x2c11('0x4')](_0xaa8492,_0x3a1cda);};}exports[_0x2c11('0x5')]=function(_0x2337d0){for(var _0x5c4748=0x0,_0x5c2399=events[_0x2c11('0x6')];_0x5c4748<_0x5c2399;_0x5c4748++){var _0x1fada4=events[_0x5c4748];var _0x29dfcf=createListener(_0x2c11('0x7')+_0x1fada4,_0x2337d0);VoicePrefixEvents['on'](_0x1fada4,_0x29dfcf);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index c3982ab..3c1f6e7 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(_0x4f75b5,_0x4db76d){var _0x5c263b=function(_0x31e622){while(--_0x31e622){_0x4f75b5['push'](_0x4f75b5['shift']());}};_0x5c263b(++_0x4db76d);}(_0xb10b,0x12a));var _0xbb10=function(_0xcad01d,_0xef9abc){_0xcad01d=_0xcad01d-0x0;var _0x76a4a6=_0xb10b[_0xcad01d];return _0x76a4a6;};'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(_0x1526a9,_0x48fb64){var _0x9f4049=function(_0x13271a){while(--_0x13271a){_0x1526a9['push'](_0x1526a9['shift']());}};_0x9f4049(++_0x48fb64);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 3b96f9a..afa87b6 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 _0x96dd=['Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','ENUM','inbound','outbound','ringall','leastrecent','fewestcalls','linear','wrandom','rrordered','setDataValue','rrmemory','getDataValue','type','dialMethod','roundrobin','progressive','predictive','power','INTEGER','all','yes','once','TEXT','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','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)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)'];(function(_0x5ec6f8,_0x34353d){var _0x1cc3fa=function(_0x44e1bb){while(--_0x44e1bb){_0x5ec6f8['push'](_0x5ec6f8['shift']());}};_0x1cc3fa(++_0x34353d);}(_0x96dd,0x192));var _0xd96d=function(_0x44c5ad,_0x2a68b0){_0x44c5ad=_0x44c5ad-0x0;var _0x2886fc=_0x96dd[_0x44c5ad];return _0x2886fc;};'use strict';var Sequelize=require('sequelize');module[_0xd96d('0x0')]={'name':{'type':Sequelize[_0xd96d('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xd96d('0x2')](_0xd96d('0x3'),_0xd96d('0x4')),'allowNull':![],'defaultValue':_0xd96d('0x3')},'musiconhold':{'type':Sequelize[_0xd96d('0x1')],'defaultValue':'default'},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0xd96d('0x2')]('rr',_0xd96d('0x5'),_0xd96d('0x6'),_0xd96d('0x7'),'random','rrmemory',_0xd96d('0x8'),_0xd96d('0x9'),_0xd96d('0xa')),'allowNull':![],'defaultValue':_0xd96d('0x5'),'set':function(_0x18c35d){this[_0xd96d('0xb')]('strategy',_0x18c35d?_0x18c35d:_0xd96d('0xc'));},'get':function(){var _0x19e714=this[_0xd96d('0xd')](_0xd96d('0xe'));var _0x1c4d59=this[_0xd96d('0xd')](_0xd96d('0xf'));var _0x5a413a=this[_0xd96d('0xd')]('strategy');if(_0x19e714===_0xd96d('0x3')){return _0x5a413a;}if(_0x1c4d59==='booked'&&_0x5a413a===_0xd96d('0xc')||_0x1c4d59==='booked'&&_0x5a413a===_0xd96d('0x10')){return _0x5a413a;}if(_0x1c4d59===_0xd96d('0x11')||_0x1c4d59===_0xd96d('0x12')||_0x1c4d59===_0xd96d('0x13')){return _0x5a413a;}return null;}},'servicelevel':{'type':Sequelize[_0xd96d('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xd96d('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0xd96d('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xd96d('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xd96d('0x1')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xd96d('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xd96d('0x2')]('yes','no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0xd96d('0x2')]('yes','no',_0xd96d('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xd96d('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0xd96d('0x2')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xd96d('0x2')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xd96d('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xd96d('0x2')](_0xd96d('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xd96d('0x2')](_0xd96d('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xd96d('0x2')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xd96d('0x2')](_0xd96d('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xd96d('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xd96d('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xd96d('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xd96d('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xd96d('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xd96d('0x2')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xd96d('0x2')](_0xd96d('0x16'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0xd96d('0x2')](_0xd96d('0x16'),'no',_0xd96d('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xd96d('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM']('yes','no')},'announce_position_limit':{'type':Sequelize[_0xd96d('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xd96d('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xd96d('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0xd96d('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xd96d('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xd96d('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xd96d('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xd96d('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xd96d('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xd96d('0x1')]},'queue_quantity1':{'type':Sequelize[_0xd96d('0x1')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xd96d('0x1')]},'queue_less_than':{'type':Sequelize[_0xd96d('0x1')]},'periodic_announce':{'type':Sequelize[_0xd96d('0x18')],'set':function(_0x1fa8ae){this[_0xd96d('0xb')](_0xd96d('0x19'),_0x1fa8ae?_0x1fa8ae['join'](','):[]);},'get':function(){return this[_0xd96d('0xd')]('periodic_announce')?this[_0xd96d('0xd')](_0xd96d('0x19'))[_0xd96d('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0xd96d('0x1')],'defaultValue':_0xd96d('0x16'),'set':function(_0x31ed7a){this['setDataValue'](_0xd96d('0x1b'),_0x31ed7a?_0x31ed7a[_0xd96d('0x1c')](','):undefined);},'get':function(){return this['getDataValue'](_0xd96d('0x1b'))?this[_0xd96d('0xd')](_0xd96d('0x1b'))[_0xd96d('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x3a54ac){this['setDataValue'](_0xd96d('0x1d'),_0x3a54ac?_0x3a54ac['join'](','):undefined);},'get':function(){return this[_0xd96d('0xd')](_0xd96d('0x1d'))?this[_0xd96d('0xd')]('leavewhenempty')[_0xd96d('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0xd96d('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xd96d('0x2')](_0xd96d('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0xd96d('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0xd96d('0x1e')],'defaultValue':0x0,'set':function(_0x558348){this[_0xd96d('0xb')]('acw',_0x558348);if(_0x558348){if(this[_0xd96d('0xd')]('wrapuptime')<0x2){this[_0xd96d('0xb')](_0xd96d('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xd96d('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xd96d('0x20')},'dialMethod':{'type':Sequelize['ENUM'](_0xd96d('0x21'),_0xd96d('0x11'),_0xd96d('0x13'),_0xd96d('0x12'),'booked'),'defaultValue':'progressive','comment':_0xd96d('0x22')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0xd96d('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xd96d('0x24')},'dialLimitQueue':{'type':Sequelize[_0xd96d('0x14')](0x4)[_0xd96d('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xd96d('0x25')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0xd96d('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xd96d('0x2')](_0xd96d('0x26'),_0xd96d('0x27')),'defaultValue':_0xd96d('0x27'),'comment':_0xd96d('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xd96d('0x29')](0x2)[_0xd96d('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xd96d('0x2a')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0xd96d('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xd96d('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd96d('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd96d('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xd96d('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd96d('0x2c')},'dialQueueOptions':{'type':Sequelize[_0xd96d('0x1')],'defaultValue':_0xd96d('0x2d'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xd96d('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd96d('0x2e')},'dialQueueProject':{'type':Sequelize[_0xd96d('0x1')],'comment':_0xd96d('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd96d('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd96d('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd96d('0x31')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd96d('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xd96d('0x14')](0x5)[_0xd96d('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd96d('0x14')](0x3)[_0xd96d('0x23')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd96d('0x14')](0x5)[_0xd96d('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd96d('0x32')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd96d('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd96d('0x33')},'dialTimezone':{'type':Sequelize[_0xd96d('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd96d('0x1')],'defaultValue':_0xd96d('0x34')},'dialPrefix':{'type':Sequelize[_0xd96d('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xd96d('0x35'),'never','onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xd96d('0x36')},'dialAMDInitialSilence':{'type':Sequelize[_0xd96d('0x14')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xd96d('0x14')](0x9)[_0xd96d('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd96d('0x14')](0x9)[_0xd96d('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd96d('0x37')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd96d('0x14')](0x9)[_0xd96d('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd96d('0x38')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd96d('0x39')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd96d('0x14')](0x9)[_0xd96d('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd96d('0x3a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd96d('0x14')](0x5)[_0xd96d('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd96d('0x3b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd96d('0x14')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd96d('0x3c')},'dialRecallMeTimeout':{'type':Sequelize[_0xd96d('0x14')](0x5)[_0xd96d('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xd96d('0x3d')},'dialRecallInQueue':{'type':Sequelize[_0xd96d('0x1e')],'defaultValue':0x0,'comment':_0xd96d('0x3e')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd96d('0x2')]('DESC',_0xd96d('0x3f')),'defaultValue':_0xd96d('0x40')},'dialQueueProject2':{'type':Sequelize[_0xd96d('0x1')],'comment':_0xd96d('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd96d('0x14')](0x3)[_0xd96d('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd96d('0x41')},'dialCutDigit':{'type':Sequelize[_0xd96d('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd96d('0x42')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd96d('0x14')](0x3)[_0xd96d('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd96d('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd96d('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xd96d('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd96d('0x44')},'dialDropRetryFrequency':{'type':Sequelize[_0xd96d('0x14')](0x5)[_0xd96d('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd96d('0x45')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xd96d('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd96d('0x46')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd96d('0x14')](0x5)[_0xd96d('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd96d('0x47')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd96d('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd96d('0x48')},'dialMachineRetryFrequency':{'type':Sequelize[_0xd96d('0x14')](0x5)[_0xd96d('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd96d('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd96d('0x49')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd96d('0x14')](0x5)[_0xd96d('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd96d('0x4a')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd96d('0x14')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xd96d('0x1e')],'defaultValue':![],'comment':_0xd96d('0x4b'),'set':function(_0x43026b){if(!_0x43026b)this['setDataValue'](_0xd96d('0x4c'),null);this[_0xd96d('0xb')](_0xd96d('0x4d'),_0x43026b);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xd96d('0x14')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xd96d('0x14')](0x3)[_0xd96d('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x436d=['#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','exports','STRING','name','ENUM','inbound','outbound','default','ringall','fewestcalls','random','rrmemory','linear','wrandom','rrordered','getDataValue','dialMethod','booked','roundrobin','progressive','power','INTEGER','yes','all','once','TEXT','setDataValue','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','preview','predictive','UNSIGNED','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\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)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence'];(function(_0x1e633e,_0x6f47e1){var _0x4c6d74=function(_0x3a6a2d){while(--_0x3a6a2d){_0x1e633e['push'](_0x1e633e['shift']());}};_0x4c6d74(++_0x6f47e1);}(_0x436d,0x1b9));var _0xd436=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x436d[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0xd436('0x0')]={'name':{'type':Sequelize[_0xd436('0x1')],'allowNull':![],'unique':_0xd436('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xd436('0x3')](_0xd436('0x4'),_0xd436('0x5')),'allowNull':![],'defaultValue':_0xd436('0x4')},'musiconhold':{'type':Sequelize[_0xd436('0x1')],'defaultValue':_0xd436('0x6')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0xd436('0x3')]('rr',_0xd436('0x7'),'leastrecent',_0xd436('0x8'),_0xd436('0x9'),_0xd436('0xa'),_0xd436('0xb'),_0xd436('0xc'),_0xd436('0xd')),'allowNull':![],'defaultValue':_0xd436('0x7'),'set':function(_0x27c40e){this['setDataValue']('strategy',_0x27c40e?_0x27c40e:_0xd436('0xa'));},'get':function(){var _0xba074c=this['getDataValue']('type');var _0x25bf89=this[_0xd436('0xe')](_0xd436('0xf'));var _0x2e8bc8=this[_0xd436('0xe')]('strategy');if(_0xba074c===_0xd436('0x4')){return _0x2e8bc8;}if(_0x25bf89===_0xd436('0x10')&&_0x2e8bc8===_0xd436('0xa')||_0x25bf89===_0xd436('0x10')&&_0x2e8bc8===_0xd436('0x11')){return _0x2e8bc8;}if(_0x25bf89===_0xd436('0x12')||_0x25bf89==='predictive'||_0x25bf89===_0xd436('0x13')){return _0x2e8bc8;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xd436('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xd436('0x14')](0xb)},'timeout':{'type':Sequelize[_0xd436('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xd436('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xd436('0x1')]},'weight':{'type':Sequelize[_0xd436('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xd436('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xd436('0x15'),'no'),'defaultValue':_0xd436('0x15')},'autopause':{'type':Sequelize['ENUM'](_0xd436('0x15'),'no',_0xd436('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xd436('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0xd436('0x3')](_0xd436('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xd436('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xd436('0x3')](_0xd436('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xd436('0x3')](_0xd436('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xd436('0x3')](_0xd436('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xd436('0x3')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xd436('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xd436('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xd436('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xd436('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xd436('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xd436('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xd436('0x3')](_0xd436('0x15'),'no'),'defaultValue':_0xd436('0x15')},'announce_holdtime':{'type':Sequelize[_0xd436('0x3')]('yes','no',_0xd436('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xd436('0x3')](_0xd436('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0xd436('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xd436('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xd436('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xd436('0x1')]},'queue_youarenext':{'type':Sequelize[_0xd436('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xd436('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xd436('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xd436('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xd436('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xd436('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xd436('0x1')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0xd436('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0xd436('0x1')]},'queue_less_than':{'type':Sequelize[_0xd436('0x1')]},'periodic_announce':{'type':Sequelize[_0xd436('0x18')],'set':function(_0x351ec2){this[_0xd436('0x19')](_0xd436('0x1a'),_0x351ec2?_0x351ec2[_0xd436('0x1b')](','):[]);},'get':function(){return this['getDataValue'](_0xd436('0x1a'))?this['getDataValue']('periodic_announce')[_0xd436('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0xd436('0x1')],'defaultValue':_0xd436('0x15'),'set':function(_0x3c9030){this[_0xd436('0x19')](_0xd436('0x1d'),_0x3c9030?_0x3c9030[_0xd436('0x1b')](','):undefined);},'get':function(){return this[_0xd436('0xe')](_0xd436('0x1d'))?this['getDataValue'](_0xd436('0x1d'))[_0xd436('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xd436('0x1')],'defaultValue':'no','set':function(_0x4f4fdf){this[_0xd436('0x19')](_0xd436('0x1e'),_0x4f4fdf?_0x4f4fdf['join'](','):undefined);},'get':function(){return this[_0xd436('0xe')]('leavewhenempty')?this[_0xd436('0xe')](_0xd436('0x1e'))[_0xd436('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xd436('0x3')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xd436('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xd436('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xd436('0x3')](_0xd436('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd436('0x1')]},'acw':{'type':Sequelize[_0xd436('0x1f')],'defaultValue':0x0,'set':function(_0x4d9ca5){this[_0xd436('0x19')](_0xd436('0x20'),_0x4d9ca5);if(_0x4d9ca5){if(this[_0xd436('0xe')](_0xd436('0x21'))<0x2){this['setDataValue'](_0xd436('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xd436('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xd436('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xd436('0x3')](_0xd436('0x22'),_0xd436('0x12'),'power',_0xd436('0x23'),_0xd436('0x10')),'defaultValue':_0xd436('0x12'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0xd436('0x14')](0x4)[_0xd436('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0xd436('0x14')](0x4)[_0xd436('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0xd436('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xd436('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0xd436('0x3')](_0xd436('0x26'),_0xd436('0x27')),'defaultValue':'dropRate','comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xd436('0x28')](0x2)[_0xd436('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xd436('0x29')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0xd436('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xd436('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd436('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xd436('0x14')](0x3)[_0xd436('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0xd436('0x1')],'defaultValue':_0xd436('0x2b'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xd436('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd436('0x2c')},'dialQueueProject':{'type':Sequelize[_0xd436('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xd436('0x14')](0x3)[_0xd436('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd436('0x14')](0x5)[_0xd436('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd436('0x2d')},'dialBusyMaxRetry':{'type':Sequelize[_0xd436('0x14')](0x3)[_0xd436('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd436('0x2e')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd436('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd436('0x2f')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd436('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xd436('0x30')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd436('0x14')](0x5)[_0xd436('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd436('0x31')},'dialGlobalMaxRetry':{'type':Sequelize[_0xd436('0x14')](0x3)[_0xd436('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xd436('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xd436('0x32')},'dialPrefix':{'type':Sequelize[_0xd436('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xd436('0x33'),_0xd436('0x34'),_0xd436('0x35')),'defaultValue':_0xd436('0x33')},'dialAMDActive':{'type':Sequelize[_0xd436('0x1f')],'defaultValue':0x0,'comment':_0xd436('0x36')},'dialAMDInitialSilence':{'type':Sequelize[_0xd436('0x14')](0x9)[_0xd436('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd436('0x37')},'dialAMDGreeting':{'type':Sequelize[_0xd436('0x14')](0x9)[_0xd436('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd436('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd436('0x14')](0x9)[_0xd436('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd436('0x39')},'dialAMDMinWordLength':{'type':Sequelize[_0xd436('0x14')](0x9)[_0xd436('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd436('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xd436('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd436('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xd436('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd436('0x14')](0x5)[_0xd436('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd436('0x3c')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xd436('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd436('0x3d')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0xd436('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xd436('0x3e')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xd436('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd436('0x3')](_0xd436('0x40'),'ASC'),'defaultValue':_0xd436('0x40')},'dialQueueProject2':{'type':Sequelize[_0xd436('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0xd436('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xd436('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xd436('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xd436('0x14')](0x3)[_0xd436('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd436('0x14')](0x3)[_0xd436('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd436('0x14')](0x5)[_0xd436('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd436('0x41')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd436('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xd436('0x14')](0x5)[_0xd436('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd436('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd436('0x42')},'dialMachineMaxRetry':{'type':Sequelize[_0xd436('0x14')](0x3)[_0xd436('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd436('0x43')},'dialMachineRetryFrequency':{'type':Sequelize[_0xd436('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd436('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd436('0x14')](0x5)[_0xd436('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd436('0x14')],'allowNull':!![],'comment':_0xd436('0x44')},'mandatoryDisposition':{'type':Sequelize[_0xd436('0x1f')],'defaultValue':![],'comment':_0xd436('0x45'),'set':function(_0xdcaa9){if(!_0xdcaa9)this[_0xd436('0x19')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xd436('0x46'),_0xdcaa9);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xd436('0x14')](0x3)[_0xd436('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xd436('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xd436('0x1f')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index bffdc72..84e3fbd 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 _0x3fd1=['NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','phone\x20NOT\x20IN\x20(?)','cm_hopper','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','sendStatus','status','end','json','offset','undefined','count','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','find','type','name','UserProfileResource','error','send','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','VoiceQueue','includeAll','include','findAll','catch','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','findOne','pick','VoiceQueueId','CmHopper','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','ids','field','tq.TeamId','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','all','union','compact','removeTeams','removeAgents','addAgents','spread','isEmpty','online','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','fromQuery','phone','ContactId','select','scheduledAt','CmListId','ListId'];(function(_0x2fbcc0,_0x5ba4d8){var _0xce70bd=function(_0x458d3a){while(--_0x458d3a){_0x2fbcc0['push'](_0x2fbcc0['shift']());}};_0xce70bd(++_0x5ba4d8);}(_0x3fd1,0x182));var _0x13fd=function(_0x256371,_0x41daa7){_0x256371=_0x256371-0x0;var _0x3911be=_0x3fd1[_0x256371];return _0x3911be;};'use strict';var emlformat=require(_0x13fd('0x0'));var rimraf=require(_0x13fd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x13fd('0x2'));var rp=require(_0x13fd('0x3'));var moment=require(_0x13fd('0x4'));var BPromise=require(_0x13fd('0x5'));var Mustache=require(_0x13fd('0x6'));var util=require(_0x13fd('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x13fd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x13fd('0x9'));var _=require(_0x13fd('0xa'));var squel=require('squel');var crypto=require(_0x13fd('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x13fd('0xc'));var toCsv=require(_0x13fd('0x8'));var querystring=require(_0x13fd('0xd'));var Papa=require(_0x13fd('0xe'));var Redis=require(_0x13fd('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x13fd('0x10'));var as=require(_0x13fd('0x11'));var hardwareService=require(_0x13fd('0x12'));var logger=require('../../config/logger')(_0x13fd('0x13'));var utils=require(_0x13fd('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x13fd('0x15'));var db=require(_0x13fd('0x16'))['db'];config['redis']=_[_0x13fd('0x17')](config[_0x13fd('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x13fd('0x19'))(new Redis(config[_0x13fd('0x18')]));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x5be7bc,_0x2cd5ba){_0x2cd5ba=_0x2cd5ba||0xcc;return function(_0x3ea837){if(_0x3ea837){return _0x5be7bc[_0x13fd('0x1a')](_0x2cd5ba);}return _0x5be7bc[_0x13fd('0x1b')](_0x2cd5ba)[_0x13fd('0x1c')]();};}function respondWithResult(_0x55e165,_0x588ad8){_0x588ad8=_0x588ad8||0xc8;return function(_0x2781a3){if(_0x2781a3){return _0x55e165[_0x13fd('0x1b')](_0x588ad8)[_0x13fd('0x1d')](_0x2781a3);}};}function respondWithFilteredResult(_0x435555,_0x289f69){return function(_0x188b0e){if(_0x188b0e){var _0x395ed7=typeof _0x289f69[_0x13fd('0x1e')]===_0x13fd('0x1f')&&typeof _0x289f69['limit']===_0x13fd('0x1f');var _0x1656f9=_0x188b0e[_0x13fd('0x20')];var _0x45de97=_0x395ed7?0x0:_0x289f69[_0x13fd('0x1e')];var _0x413984=_0x395ed7?_0x188b0e['count']:_0x289f69[_0x13fd('0x1e')]+_0x289f69['limit'];var _0x3c0943;if(_0x413984>=_0x1656f9){_0x413984=_0x1656f9;_0x3c0943=0xc8;}else{_0x3c0943=0xce;}_0x435555[_0x13fd('0x1b')](_0x3c0943);return _0x435555['set']('Content-Range',_0x45de97+'-'+_0x413984+'/'+_0x1656f9)[_0x13fd('0x1d')](_0x188b0e);}return null;};}function patchUpdates(_0x4f01ee){return function(_0x5aea79){try{jsonpatch['apply'](_0x5aea79,_0x4f01ee,!![]);}catch(_0x4250e5){return BPromise[_0x13fd('0x21')](_0x4250e5);}return _0x5aea79[_0x13fd('0x22')]();};}function saveUpdates(_0x38abc9,_0xbbb4e1){return function(_0x33efbc){if(_0x33efbc){return _0x33efbc[_0x13fd('0x23')](_0x38abc9)[_0x13fd('0x24')](function(_0x477dc6){return _0x477dc6;});}return null;};}function removeEntity(_0x1fed23,_0x5beb98){return function(_0x235369){if(_0x235369){return _0x235369[_0x13fd('0x25')]()['then'](function(){var _0x317a05=_0x235369[_0x13fd('0x26')]({'plain':!![]});var _0x18e1c7=[{'name':_0x13fd('0x27'),'value':_0x13fd('0x28'),'ignore':![]},{'name':_0x13fd('0x29'),'value':_0x13fd('0x2a'),'ignore':![]}];var _0x31c5ea=_(_0x18e1c7)[_0x13fd('0x2b')](_0x13fd('0x2c'))[_0x13fd('0x2d')](_0x13fd('0x2e'))['value']();if(_[_0x13fd('0x2f')](_0x31c5ea,_0x317a05['type'])){return;}var _0x42e0f6=_[_0x13fd('0x30')](_0x18e1c7,[_0x13fd('0x2e'),_0x317a05[_0x13fd('0x31')]])[_0x13fd('0x32')];return db[_0x13fd('0x33')][_0x13fd('0x25')]({'where':{'type':_0x42e0f6,'resourceId':_0x317a05['id']}})['then'](function(){return _0x235369;});})[_0x13fd('0x24')](function(){_0x1fed23[_0x13fd('0x1b')](0xcc)[_0x13fd('0x1c')]();});}};}function handleEntityNotFound(_0x4b8baa,_0x100258){return function(_0x342cd2){if(!_0x342cd2){_0x4b8baa[_0x13fd('0x1a')](0x194);}return _0x342cd2;};}function handleError(_0x5beb2d,_0x4177a6){_0x4177a6=_0x4177a6||0x1f4;return function(_0x4c2152){logger[_0x13fd('0x34')](_0x4c2152['stack']);if(_0x4c2152['name']){delete _0x4c2152[_0x13fd('0x32')];}_0x5beb2d[_0x13fd('0x1b')](_0x4177a6)[_0x13fd('0x35')](_0x4c2152);};}exports[_0x13fd('0x36')]=function(_0x19893b,_0x19b6e9){var _0x4c0832={},_0x44202a={},_0x100061={'count':0x0,'rows':[]};var _0x5c5ee7=_[_0x13fd('0x2d')](db['VoiceQueue'][_0x13fd('0x37')],function(_0x41fce9){return{'name':_0x41fce9[_0x13fd('0x38')],'type':_0x41fce9[_0x13fd('0x31')][_0x13fd('0x39')]};});_0x44202a[_0x13fd('0x3a')]=_['map'](_0x5c5ee7,_0x13fd('0x32'));_0x44202a[_0x13fd('0x3b')]=_[_0x13fd('0x3c')](_0x19893b[_0x13fd('0x3b')]);_0x44202a[_0x13fd('0x3d')]=_[_0x13fd('0x3e')](_0x44202a['model'],_0x44202a[_0x13fd('0x3b')]);_0x4c0832[_0x13fd('0x3f')]=_[_0x13fd('0x3e')](_0x44202a['model'],qs[_0x13fd('0x40')](_0x19893b[_0x13fd('0x3b')][_0x13fd('0x40')]));_0x4c0832[_0x13fd('0x3f')]=_0x4c0832[_0x13fd('0x3f')][_0x13fd('0x41')]?_0x4c0832[_0x13fd('0x3f')]:_0x44202a[_0x13fd('0x3a')];if(!_0x19893b[_0x13fd('0x3b')][_0x13fd('0x42')](_0x13fd('0x43'))){_0x4c0832[_0x13fd('0x44')]=qs[_0x13fd('0x44')](_0x19893b[_0x13fd('0x3b')][_0x13fd('0x44')]);_0x4c0832[_0x13fd('0x1e')]=qs['offset'](_0x19893b[_0x13fd('0x3b')][_0x13fd('0x1e')]);}_0x4c0832[_0x13fd('0x45')]=qs[_0x13fd('0x46')](_0x19893b[_0x13fd('0x3b')][_0x13fd('0x46')]);_0x4c0832[_0x13fd('0x47')]=qs['filters'](_['pick'](_0x19893b[_0x13fd('0x3b')],_0x44202a['filters']),_0x5c5ee7);if(_0x19893b[_0x13fd('0x3b')]['filter']){_0x4c0832[_0x13fd('0x47')]=_[_0x13fd('0x48')](_0x4c0832[_0x13fd('0x47')],{'$or':_['map'](_0x5c5ee7,function(_0x16a8a7){if(_0x16a8a7[_0x13fd('0x31')]!==_0x13fd('0x49')){var _0x16bea9={};_0x16bea9[_0x16a8a7[_0x13fd('0x32')]]={'$like':'%'+_0x19893b[_0x13fd('0x3b')][_0x13fd('0x2b')]+'%'};return _0x16bea9;}})});}_0x4c0832=_['merge']({},_0x4c0832,_0x19893b['options']);var _0x2ddc82={'where':_0x4c0832[_0x13fd('0x47')]};return db[_0x13fd('0x4a')][_0x13fd('0x20')](_0x2ddc82)['then'](function(_0x1fd498){_0x100061[_0x13fd('0x20')]=_0x1fd498;if(_0x19893b[_0x13fd('0x3b')][_0x13fd('0x4b')]){_0x4c0832[_0x13fd('0x4c')]=[{'all':!![]}];}return db[_0x13fd('0x4a')][_0x13fd('0x4d')](_0x4c0832);})[_0x13fd('0x24')](function(_0x375120){_0x100061['rows']=_0x375120;return _0x100061;})['then'](respondWithFilteredResult(_0x19b6e9,_0x4c0832))[_0x13fd('0x4e')](handleError(_0x19b6e9,null));};exports[_0x13fd('0x4f')]=function(_0x51946f,_0x5f01e6){var _0x6f6279={'raw':![],'where':{'id':_0x51946f[_0x13fd('0x50')]['id']}},_0x3088e0={};_0x3088e0[_0x13fd('0x3a')]=_['keys'](db[_0x13fd('0x4a')][_0x13fd('0x37')]);_0x3088e0[_0x13fd('0x3b')]=_[_0x13fd('0x3c')](_0x51946f['query']);_0x3088e0[_0x13fd('0x3d')]=_[_0x13fd('0x3e')](_0x3088e0[_0x13fd('0x3a')],_0x3088e0[_0x13fd('0x3b')]);_0x6f6279['attributes']=_[_0x13fd('0x3e')](_0x3088e0[_0x13fd('0x3a')],qs['fields'](_0x51946f[_0x13fd('0x3b')]['fields']));_0x6f6279[_0x13fd('0x3f')]=_0x6f6279[_0x13fd('0x3f')][_0x13fd('0x41')]?_0x6f6279[_0x13fd('0x3f')]:_0x3088e0[_0x13fd('0x3a')];if(_0x51946f[_0x13fd('0x3b')][_0x13fd('0x4b')]){_0x6f6279[_0x13fd('0x4c')]=[{'all':!![]}];}_0x6f6279=_[_0x13fd('0x48')]({},_0x6f6279,_0x51946f[_0x13fd('0x51')]);return db[_0x13fd('0x4a')][_0x13fd('0x30')](_0x6f6279)[_0x13fd('0x24')](handleEntityNotFound(_0x5f01e6,null))[_0x13fd('0x24')](respondWithResult(_0x5f01e6,null))[_0x13fd('0x4e')](handleError(_0x5f01e6,null));};exports[_0x13fd('0x52')]=function(_0x3fac34,_0x490846){return db['VoiceQueue'][_0x13fd('0x52')](_0x3fac34[_0x13fd('0x53')],{})[_0x13fd('0x24')](function(_0x13b3f3){var _0x23c768=_0x3fac34[_0x13fd('0x54')][_0x13fd('0x26')]({'plain':!![]});if(!_0x23c768)throw new Error(_0x13fd('0x55'));if(_0x23c768['role']===_0x13fd('0x54')){var _0x1369ae=_0x13b3f3[_0x13fd('0x26')]({'plain':!![]});var _0x59f1b9=[{'name':'VoiceQueues','value':'inbound'},{'name':_0x13fd('0x29'),'value':_0x13fd('0x2a')}];var _0x18db06=_[_0x13fd('0x30')](_0x59f1b9,['value',_0x1369ae[_0x13fd('0x31')]])['name'];return db[_0x13fd('0x56')]['find']({'where':{'name':_0x18db06,'userProfileId':_0x23c768[_0x13fd('0x57')]},'raw':!![]})[_0x13fd('0x24')](function(_0x5653a1){if(_0x5653a1&&_0x5653a1[_0x13fd('0x58')]===0x0){return db['UserProfileResource'][_0x13fd('0x52')]({'name':_0x1369ae['name'],'resourceId':_0x1369ae['id'],'type':_0x5653a1[_0x13fd('0x32')],'sectionId':_0x5653a1['id']},{})[_0x13fd('0x24')](function(){return _0x13b3f3;});}else{return _0x13b3f3;}})[_0x13fd('0x4e')](function(_0x24aa25){logger['error'](_0x13fd('0x59'),_0x24aa25);throw _0x24aa25;});}return _0x13b3f3;})['then'](respondWithResult(_0x490846,0xc9))[_0x13fd('0x4e')](handleError(_0x490846,null));};exports[_0x13fd('0x5a')]=function(_0x58603c,_0x3a8811){var _0x3d2c48={'where':{'id':_0x58603c[_0x13fd('0x50')]['id']}},_0x3c8fb7={};_0x3c8fb7[_0x13fd('0x3a')]=_[_0x13fd('0x3c')](db[_0x13fd('0x4a')][_0x13fd('0x37')]);_0x3d2c48[_0x13fd('0x3f')]=_[_0x13fd('0x3e')](_0x3c8fb7['model'],qs[_0x13fd('0x40')](_0x58603c[_0x13fd('0x3b')][_0x13fd('0x40')]));_0x3d2c48[_0x13fd('0x3f')]=_0x3d2c48['attributes'][_0x13fd('0x41')]?_0x3d2c48[_0x13fd('0x3f')]:_0x3c8fb7[_0x13fd('0x3a')];if(_0x58603c['query'][_0x13fd('0x4b')]){_0x3d2c48[_0x13fd('0x4c')]=[{'all':!![]}];}_0x3d2c48=_[_0x13fd('0x48')]({},_0x3d2c48,_0x58603c[_0x13fd('0x51')]);return db[_0x13fd('0x4a')]['find'](_0x3d2c48)[_0x13fd('0x24')](handleEntityNotFound(_0x3a8811,null))['then'](function(_0xa6e19f){if(_0xa6e19f){var _0xbd8217=_0xa6e19f[_0x13fd('0x26')]({'plain':!![]});_0xbd8217=qs[_0x13fd('0x5b')](_0xbd8217,['id',_0x13fd('0x5c'),_0x13fd('0x5d')]);_0x58603c['body']=_[_0x13fd('0x5b')](_0x58603c[_0x13fd('0x53')],['id','createdAt',_0x13fd('0x5d')]);return db['VoiceQueue'][_0x13fd('0x52')](_[_0x13fd('0x48')](_0xbd8217,_0x58603c[_0x13fd('0x53')]),{'include':_0x58603c['query']['includeAll']?[{'all':!![]}]:undefined})[_0x13fd('0x24')](function(_0x587b55){var _0x5b536a=_0x58603c['user'][_0x13fd('0x26')]({'plain':!![]});if(!_0x5b536a)throw new Error(_0x13fd('0x55'));if(_0x5b536a[_0x13fd('0x5e')]===_0x13fd('0x54')){var _0x30bcd8=_0x587b55[_0x13fd('0x26')]({'plain':!![]});var _0x3e7116=[{'name':_0x13fd('0x27'),'value':'inbound'},{'name':_0x13fd('0x29'),'value':_0x13fd('0x2a')}];var _0x552da3=_[_0x13fd('0x30')](_0x3e7116,[_0x13fd('0x2e'),_0x30bcd8[_0x13fd('0x31')]])[_0x13fd('0x32')];return db['UserProfileSection'][_0x13fd('0x30')]({'where':{'name':_0x552da3,'userProfileId':_0x5b536a[_0x13fd('0x57')]},'raw':!![]})[_0x13fd('0x24')](function(_0x47afb4){if(_0x47afb4&&_0x47afb4[_0x13fd('0x58')]===0x0){return db['UserProfileResource'][_0x13fd('0x52')]({'name':_0x30bcd8[_0x13fd('0x32')],'resourceId':_0x30bcd8['id'],'type':_0x47afb4[_0x13fd('0x32')],'sectionId':_0x47afb4['id']},{})[_0x13fd('0x24')](function(){return _0x587b55;});}else{return _0x587b55;}})[_0x13fd('0x4e')](function(_0x46b1cc){logger['error'](_0x13fd('0x59'),_0x46b1cc);throw _0x46b1cc;});}return _0x587b55;});}})[_0x13fd('0x24')](respondWithResult(_0x3a8811,0xc9))[_0x13fd('0x4e')](handleError(_0x3a8811,null));};exports[_0x13fd('0x23')]=function(_0x1c9392,_0x4e1ee7){if(_0x1c9392['body']['id']){delete _0x1c9392[_0x13fd('0x53')]['id'];}return db['VoiceQueue'][_0x13fd('0x30')]({'where':{'id':_0x1c9392[_0x13fd('0x50')]['id']}})['then'](handleEntityNotFound(_0x4e1ee7,null))[_0x13fd('0x24')](saveUpdates(_0x1c9392['body'],null))['then'](respondWithResult(_0x4e1ee7,null))[_0x13fd('0x4e')](handleError(_0x4e1ee7,null));};exports[_0x13fd('0x25')]=function(_0x4ec71a,_0x3bdfef){return db[_0x13fd('0x4a')]['find']({'where':{'id':_0x4ec71a[_0x13fd('0x50')]['id']}})['then'](handleEntityNotFound(_0x3bdfef,null))['then'](removeEntity(_0x3bdfef,null))[_0x13fd('0x4e')](handleError(_0x3bdfef,null));};exports['getHoppers']=function(_0x249324,_0x537709,_0x28b8c3){var _0xcc71a4={'raw':![],'where':{}};var _0x3b5883={};var _0x5c8269={'count':0x0,'rows':[]};return db[_0x13fd('0x4a')][_0x13fd('0x5f')]({'where':{'id':_0x249324[_0x13fd('0x50')]['id']}})[_0x13fd('0x24')](handleEntityNotFound(_0x537709,null))['then'](function(_0x2c95b7){if(_0x2c95b7){_0x3b5883[_0x13fd('0x3a')]=_[_0x13fd('0x3c')](db['CmHopper'][_0x13fd('0x37')]);_0x3b5883[_0x13fd('0x3b')]=_[_0x13fd('0x3c')](_0x249324[_0x13fd('0x3b')]);_0x3b5883[_0x13fd('0x3d')]=_[_0x13fd('0x3e')](_0x3b5883[_0x13fd('0x3a')],_0x3b5883['query']);_0xcc71a4[_0x13fd('0x3f')]=_['intersection'](_0x3b5883[_0x13fd('0x3a')],qs[_0x13fd('0x40')](_0x249324[_0x13fd('0x3b')][_0x13fd('0x40')]));_0xcc71a4[_0x13fd('0x3f')]=_0xcc71a4['attributes'][_0x13fd('0x41')]?_0xcc71a4[_0x13fd('0x3f')]:_0x3b5883[_0x13fd('0x3a')];if(!_0x249324[_0x13fd('0x3b')][_0x13fd('0x42')](_0x13fd('0x43'))){_0xcc71a4[_0x13fd('0x44')]=qs[_0x13fd('0x44')](_0x249324['query']['limit']);_0xcc71a4[_0x13fd('0x1e')]=qs['offset'](_0x249324[_0x13fd('0x3b')][_0x13fd('0x1e')]);}_0xcc71a4[_0x13fd('0x45')]=qs[_0x13fd('0x46')](_0x249324[_0x13fd('0x3b')][_0x13fd('0x46')]);_0xcc71a4['where']=qs[_0x13fd('0x3d')](_[_0x13fd('0x60')](_0x249324['query'],_0x3b5883[_0x13fd('0x3d')]));_0xcc71a4[_0x13fd('0x47')][_0x13fd('0x61')]=_0x2c95b7['id'];if(_0x249324[_0x13fd('0x3b')][_0x13fd('0x2b')]){_0xcc71a4[_0x13fd('0x47')]=_['merge'](_0xcc71a4[_0x13fd('0x47')],{'$or':_[_0x13fd('0x2d')](_0xcc71a4[_0x13fd('0x3f')],function(_0x6fba02){var _0x4990d8={};_0x4990d8[_0x6fba02]={'$like':'%'+_0x249324[_0x13fd('0x3b')][_0x13fd('0x2b')]+'%'};return _0x4990d8;})});}_0xcc71a4=_[_0x13fd('0x48')]({},_0xcc71a4,_0x249324[_0x13fd('0x51')]);return db[_0x13fd('0x62')][_0x13fd('0x20')]({'where':_0xcc71a4['where']})[_0x13fd('0x24')](function(_0x1d9394){_0x5c8269[_0x13fd('0x20')]=_0x1d9394;if(_0x249324['query'][_0x13fd('0x4b')]){_0xcc71a4[_0x13fd('0x4c')]=[{'all':!![]}];}return db[_0x13fd('0x62')][_0x13fd('0x4d')](_0xcc71a4);})['then'](function(_0x1afc75){_0x5c8269[_0x13fd('0x63')]=_0x1afc75;return _0x5c8269;});}})['then'](respondWithFilteredResult(_0x537709,_0xcc71a4))[_0x13fd('0x4e')](handleError(_0x537709,null));};exports[_0x13fd('0x64')]=function(_0x2c043a,_0x15cbf2,_0x435e3a){var _0x185f06={'raw':!![],'where':{}};var _0x56293a={};var _0x2bf11a={'count':0x0,'rows':[]};return db[_0x13fd('0x4a')][_0x13fd('0x5f')]({'where':{'id':_0x2c043a[_0x13fd('0x50')]['id']}})[_0x13fd('0x24')](handleEntityNotFound(_0x15cbf2,null))[_0x13fd('0x24')](function(_0x1ce6db){if(_0x1ce6db){_0x56293a['model']=_[_0x13fd('0x3c')](db[_0x13fd('0x65')][_0x13fd('0x37')]);_0x56293a[_0x13fd('0x3b')]=_[_0x13fd('0x3c')](_0x2c043a['query']);_0x56293a[_0x13fd('0x3d')]=_['intersection'](_0x56293a['model'],_0x56293a[_0x13fd('0x3b')]);_0x185f06[_0x13fd('0x3f')]=_[_0x13fd('0x3e')](_0x56293a['model'],qs[_0x13fd('0x40')](_0x2c043a['query'][_0x13fd('0x40')]));_0x185f06[_0x13fd('0x3f')]=_0x185f06['attributes'][_0x13fd('0x41')]?_0x185f06['attributes']:_0x56293a[_0x13fd('0x3a')];if(!_0x2c043a[_0x13fd('0x3b')][_0x13fd('0x42')](_0x13fd('0x43'))){_0x185f06[_0x13fd('0x44')]=qs['limit'](_0x2c043a[_0x13fd('0x3b')][_0x13fd('0x44')]);_0x185f06[_0x13fd('0x1e')]=qs['offset'](_0x2c043a[_0x13fd('0x3b')][_0x13fd('0x1e')]);}_0x185f06['order']=qs[_0x13fd('0x46')](_0x2c043a[_0x13fd('0x3b')]['sort']);_0x185f06[_0x13fd('0x47')]=qs[_0x13fd('0x3d')](_[_0x13fd('0x60')](_0x2c043a[_0x13fd('0x3b')],_0x56293a[_0x13fd('0x3d')]));_0x185f06[_0x13fd('0x47')][_0x13fd('0x61')]=_0x1ce6db['id'];if(_0x2c043a[_0x13fd('0x3b')][_0x13fd('0x2b')]){_0x185f06['where']=_[_0x13fd('0x48')](_0x185f06[_0x13fd('0x47')],{'$or':_[_0x13fd('0x2d')](_0x185f06['attributes'],function(_0x1d5e39){var _0x27d3f7={};_0x27d3f7[_0x1d5e39]={'$like':'%'+_0x2c043a[_0x13fd('0x3b')][_0x13fd('0x2b')]+'%'};return _0x27d3f7;})});}_0x185f06=_[_0x13fd('0x48')]({},_0x185f06,_0x2c043a[_0x13fd('0x51')]);return db[_0x13fd('0x65')]['count']({'where':_0x185f06[_0x13fd('0x47')]})[_0x13fd('0x24')](function(_0x4c1c40){_0x2bf11a[_0x13fd('0x20')]=_0x4c1c40;if(_0x2c043a[_0x13fd('0x3b')][_0x13fd('0x4b')]){_0x185f06['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x13fd('0x4d')](_0x185f06);})['then'](function(_0x42925a){_0x2bf11a[_0x13fd('0x63')]=_0x42925a;return _0x2bf11a;});}})['then'](respondWithFilteredResult(_0x15cbf2,_0x185f06))[_0x13fd('0x4e')](handleError(_0x15cbf2,null));};exports['getHopperFinals']=function(_0x8fdd3c,_0x11d657,_0x17a826){var _0x31266f={'raw':!![],'where':{}};var _0x115afe={};var _0x2da091={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x13fd('0x5f')]({'where':{'id':_0x8fdd3c[_0x13fd('0x50')]['id']}})[_0x13fd('0x24')](handleEntityNotFound(_0x11d657,null))[_0x13fd('0x24')](function(_0x521cba){if(_0x521cba){_0x115afe[_0x13fd('0x3a')]=_['keys'](db[_0x13fd('0x66')][_0x13fd('0x37')]);_0x115afe[_0x13fd('0x3b')]=_[_0x13fd('0x3c')](_0x8fdd3c[_0x13fd('0x3b')]);_0x115afe['filters']=_['intersection'](_0x115afe[_0x13fd('0x3a')],_0x115afe['query']);_0x31266f[_0x13fd('0x3f')]=_[_0x13fd('0x3e')](_0x115afe['model'],qs[_0x13fd('0x40')](_0x8fdd3c[_0x13fd('0x3b')][_0x13fd('0x40')]));_0x31266f[_0x13fd('0x3f')]=_0x31266f[_0x13fd('0x3f')][_0x13fd('0x41')]?_0x31266f[_0x13fd('0x3f')]:_0x115afe[_0x13fd('0x3a')];if(!_0x8fdd3c[_0x13fd('0x3b')][_0x13fd('0x42')](_0x13fd('0x43'))){_0x31266f[_0x13fd('0x44')]=qs[_0x13fd('0x44')](_0x8fdd3c[_0x13fd('0x3b')][_0x13fd('0x44')]);_0x31266f[_0x13fd('0x1e')]=qs['offset'](_0x8fdd3c[_0x13fd('0x3b')]['offset']);}_0x31266f[_0x13fd('0x45')]=qs['sort'](_0x8fdd3c[_0x13fd('0x3b')][_0x13fd('0x46')]);_0x31266f[_0x13fd('0x47')]=qs['filters'](_[_0x13fd('0x60')](_0x8fdd3c['query'],_0x115afe[_0x13fd('0x3d')]));_0x31266f['where'][_0x13fd('0x61')]=_0x521cba['id'];if(_0x8fdd3c[_0x13fd('0x3b')][_0x13fd('0x2b')]){_0x31266f[_0x13fd('0x47')]=_[_0x13fd('0x48')](_0x31266f[_0x13fd('0x47')],{'$or':_[_0x13fd('0x2d')](_0x31266f[_0x13fd('0x3f')],function(_0xded782){var _0x7a9a04={};_0x7a9a04[_0xded782]={'$like':'%'+_0x8fdd3c[_0x13fd('0x3b')][_0x13fd('0x2b')]+'%'};return _0x7a9a04;})});}_0x31266f=_[_0x13fd('0x48')]({},_0x31266f,_0x8fdd3c['options']);return db[_0x13fd('0x66')][_0x13fd('0x20')]({'where':_0x31266f[_0x13fd('0x47')]})['then'](function(_0x1ce421){_0x2da091[_0x13fd('0x20')]=_0x1ce421;if(_0x8fdd3c['query'][_0x13fd('0x4b')]){_0x31266f[_0x13fd('0x4c')]=[{'all':!![]}];}return db[_0x13fd('0x66')]['findAll'](_0x31266f);})['then'](function(_0x3f6917){_0x2da091[_0x13fd('0x63')]=_0x3f6917;return _0x2da091;});}})[_0x13fd('0x24')](respondWithFilteredResult(_0x11d657,_0x31266f))['catch'](handleError(_0x11d657,null));};exports[_0x13fd('0x67')]=function(_0x15b3b6,_0x4d1bf8,_0x31c903){var _0x537bd4={'raw':!![],'where':{}};var _0x573a3a={};var _0x48bf35={'count':0x0,'rows':[]};return db[_0x13fd('0x4a')][_0x13fd('0x5f')]({'where':{'id':_0x15b3b6[_0x13fd('0x50')]['id']}})[_0x13fd('0x24')](handleEntityNotFound(_0x4d1bf8,null))['then'](function(_0x17e7c9){if(_0x17e7c9){_0x573a3a[_0x13fd('0x3a')]=_['keys'](db[_0x13fd('0x68')][_0x13fd('0x37')]);_0x573a3a['query']=_['keys'](_0x15b3b6[_0x13fd('0x3b')]);_0x573a3a[_0x13fd('0x3d')]=_[_0x13fd('0x3e')](_0x573a3a[_0x13fd('0x3a')],_0x573a3a[_0x13fd('0x3b')]);_0x537bd4[_0x13fd('0x3f')]=_['intersection'](_0x573a3a[_0x13fd('0x3a')],qs['fields'](_0x15b3b6[_0x13fd('0x3b')]['fields']));_0x537bd4[_0x13fd('0x3f')]=_0x537bd4[_0x13fd('0x3f')][_0x13fd('0x41')]?_0x537bd4['attributes']:_0x573a3a[_0x13fd('0x3a')];if(!_0x15b3b6[_0x13fd('0x3b')]['hasOwnProperty'](_0x13fd('0x43'))){_0x537bd4[_0x13fd('0x44')]=qs[_0x13fd('0x44')](_0x15b3b6[_0x13fd('0x3b')][_0x13fd('0x44')]);_0x537bd4[_0x13fd('0x1e')]=qs[_0x13fd('0x1e')](_0x15b3b6[_0x13fd('0x3b')][_0x13fd('0x1e')]);}_0x537bd4[_0x13fd('0x45')]=qs[_0x13fd('0x46')](_0x15b3b6[_0x13fd('0x3b')]['sort']);_0x537bd4[_0x13fd('0x47')]=qs[_0x13fd('0x3d')](_[_0x13fd('0x60')](_0x15b3b6[_0x13fd('0x3b')],_0x573a3a['filters']));_0x537bd4['where'][_0x13fd('0x61')]=_0x17e7c9['id'];if(_0x15b3b6['query'][_0x13fd('0x2b')]){_0x537bd4['where']=_[_0x13fd('0x48')](_0x537bd4[_0x13fd('0x47')],{'$or':_[_0x13fd('0x2d')](_0x537bd4[_0x13fd('0x3f')],function(_0x1e36fa){var _0x2e242d={};_0x2e242d[_0x1e36fa]={'$like':'%'+_0x15b3b6[_0x13fd('0x3b')][_0x13fd('0x2b')]+'%'};return _0x2e242d;})});}_0x537bd4=_[_0x13fd('0x48')]({},_0x537bd4,_0x15b3b6['options']);return db[_0x13fd('0x68')][_0x13fd('0x20')]({'where':_0x537bd4[_0x13fd('0x47')]})[_0x13fd('0x24')](function(_0x53a6e3){_0x48bf35[_0x13fd('0x20')]=_0x53a6e3;if(_0x15b3b6[_0x13fd('0x3b')][_0x13fd('0x4b')]){_0x537bd4[_0x13fd('0x4c')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x13fd('0x4d')](_0x537bd4);})[_0x13fd('0x24')](function(_0x595360){_0x48bf35['rows']=_0x595360;return _0x48bf35;});}})[_0x13fd('0x24')](respondWithFilteredResult(_0x4d1bf8,_0x537bd4))[_0x13fd('0x4e')](handleError(_0x4d1bf8,null));};exports[_0x13fd('0x69')]=function(_0x3cec5f,_0x59873f,_0x4e96db){var _0x41d68c={};var _0x5230c2={};var _0x385459;var _0xe0921a;return db['VoiceQueue'][_0x13fd('0x5f')]({'where':{'id':_0x3cec5f[_0x13fd('0x50')]['id']}})[_0x13fd('0x24')](handleEntityNotFound(_0x59873f,null))[_0x13fd('0x24')](function(_0x1b7bcb){if(_0x1b7bcb){_0x385459=_0x1b7bcb;_0x5230c2['model']=_[_0x13fd('0x3c')](db[_0x13fd('0x6a')][_0x13fd('0x37')]);_0x5230c2[_0x13fd('0x3b')]=_[_0x13fd('0x3c')](_0x3cec5f[_0x13fd('0x3b')]);_0x5230c2['filters']=_[_0x13fd('0x3e')](_0x5230c2['model'],_0x5230c2[_0x13fd('0x3b')]);_0x41d68c[_0x13fd('0x3f')]=_[_0x13fd('0x3e')](_0x5230c2[_0x13fd('0x3a')],qs[_0x13fd('0x40')](_0x3cec5f[_0x13fd('0x3b')][_0x13fd('0x40')]));_0x41d68c[_0x13fd('0x3f')]=_0x41d68c[_0x13fd('0x3f')]['length']?_0x41d68c['attributes']:_0x5230c2[_0x13fd('0x3a')];_0x41d68c[_0x13fd('0x45')]=qs[_0x13fd('0x46')](_0x3cec5f[_0x13fd('0x3b')][_0x13fd('0x46')]);_0x41d68c[_0x13fd('0x47')]=qs[_0x13fd('0x3d')](_[_0x13fd('0x60')](_0x3cec5f[_0x13fd('0x3b')],_0x5230c2[_0x13fd('0x3d')]));if(_0x3cec5f[_0x13fd('0x3b')][_0x13fd('0x2b')]){_0x41d68c[_0x13fd('0x47')]=_[_0x13fd('0x48')](_0x41d68c['where'],{'$or':_[_0x13fd('0x2d')](_0x41d68c['attributes'],function(_0x494962){var _0x590ca0={};_0x590ca0[_0x494962]={'$like':'%'+_0x3cec5f['query'][_0x13fd('0x2b')]+'%'};return _0x590ca0;})});}_0x41d68c=_['merge']({},_0x41d68c,_0x3cec5f[_0x13fd('0x51')]);return _0x385459['getTeams'](_0x41d68c);}})[_0x13fd('0x24')](function(_0x27b2f4){if(_0x27b2f4){_0xe0921a=_0x27b2f4['length'];if(!_0x3cec5f['query'][_0x13fd('0x42')](_0x13fd('0x43'))){_0x41d68c['limit']=qs['limit'](_0x3cec5f[_0x13fd('0x3b')][_0x13fd('0x44')]);_0x41d68c[_0x13fd('0x1e')]=qs['offset'](_0x3cec5f[_0x13fd('0x3b')][_0x13fd('0x1e')]);}return _0x385459[_0x13fd('0x69')](_0x41d68c);}})['then'](function(_0x47e6be){if(_0x47e6be){return _0x47e6be?{'count':_0xe0921a,'rows':_0x47e6be}:null;}})[_0x13fd('0x24')](respondWithResult(_0x59873f,null))[_0x13fd('0x4e')](handleError(_0x59873f,null));};exports[_0x13fd('0x6b')]=function(_0x34ffb7,_0x5dc7e5,_0x4add40){var _0x34067c=_0x34ffb7[_0x13fd('0x53')][_0x13fd('0x6c')];var _0x4bd87c=_[_0x13fd('0x2d')](_0x34067c,'id');return db[_0x13fd('0x6a')][_0x13fd('0x4d')]({'where':{'id':_0x4bd87c},'attributes':['id'],'include':[{'model':db[_0x13fd('0x6d')],'as':_0x13fd('0x6e'),'attributes':['id',_0x13fd('0x32'),'online',_0x13fd('0x6f'),_0x13fd('0x70')],'raw':!![]}]})[_0x13fd('0x24')](function(_0x98bb4d){if(_0x98bb4d){var _0x6c8e5f=_[_0x13fd('0x71')](_0x98bb4d,function(_0x5850e9){var _0x136dc0=_0x5850e9['get']({'plain':!![]});_0x136dc0['Agents'][_0x13fd('0x72')](function(_0x5217d4){_0x5217d4[_0x13fd('0x73')]=_[_0x13fd('0x30')](_0x34067c,{'id':_0x136dc0['id']})[_0x13fd('0x73')];});return _0x136dc0['Agents'];});return db['VoiceQueue']['find']({'where':{'id':_0x34ffb7[_0x13fd('0x50')]['id']}})['then'](function(_0x928063){return db[_0x13fd('0x74')][_0x13fd('0x75')](function(_0x56d258){return _0x928063[_0x13fd('0x6b')](_0x4bd87c,{'transaction':_0x56d258})[_0x13fd('0x24')](function(){return BPromise[_0x13fd('0x76')](_0x34067c,function(_0x48c4c5){return db[_0x13fd('0x77')][_0x13fd('0x78')]({'TeamId':_0x48c4c5['id'],'VoiceQueueId':_0x34ffb7[_0x13fd('0x50')]['id'],'penalty':_0x48c4c5[_0x13fd('0x73')]},{'transaction':_0x56d258});});})[_0x13fd('0x24')](function(){return BPromise[_0x13fd('0x76')](_0x6c8e5f,function(_0x504e21){return db[_0x13fd('0x79')][_0x13fd('0x7a')]({'where':{'UserId':_0x504e21['id'],'VoiceQueueId':_0x34ffb7[_0x13fd('0x50')]['id']},'defaults':{'penalty':_0x504e21['penalty']},'transaction':_0x56d258});});})[_0x13fd('0x24')](function(){return BPromise[_0x13fd('0x76')](_['filter'](_0x6c8e5f,{'online':!![]}),function(_0x12ab2a){return db[_0x13fd('0x7b')][_0x13fd('0x78')]({'membername':_0x12ab2a[_0x13fd('0x32')],'UserId':_0x12ab2a['id'],'queue_name':_0x928063['name'],'VoiceQueueId':_0x928063['id'],'interface':_[_0x13fd('0x7c')](_0x12ab2a['interface'])?util[_0x13fd('0x7d')](_0x13fd('0x7e'),_0x12ab2a[_0x13fd('0x32')]):_0x12ab2a[_0x13fd('0x70')],'paused':_0x12ab2a[_0x13fd('0x6f')]||![],'penalty':_0x12ab2a['penalty']},{'transaction':_0x56d258});});})[_0x13fd('0x24')](function(){_0x6c8e5f['forEach'](function(_0x162aac){socket[_0x13fd('0x7f')](_0x13fd('0x80'),{'UserId':_0x162aac['id'],'VoiceQueueId':_0x928063['id']});});});});});}})['then'](respondWithStatusCode(_0x5dc7e5,null))['catch'](handleError(_0x5dc7e5,null));};exports['removeTeams']=function(_0x200068,_0x27529d,_0x37b373){return db['Team'][_0x13fd('0x4d')]({'where':{'id':_0x200068['query'][_0x13fd('0x81')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x13fd('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x13fd('0x24')](handleEntityNotFound(_0x27529d,null))[_0x13fd('0x24')](function(_0x4a9d78){var _0x2bd212=_['map'](_0x4a9d78,'id');var _0x49f5e6=[];var _0x5b222f=[];var _0x5223c2=squel['select']();_0x5223c2[_0x13fd('0x82')](_0x13fd('0x83'))['from'](_0x13fd('0x84'),'tq')['join'](_0x13fd('0x85'),'ut',_0x13fd('0x86'))[_0x13fd('0x47')](_0x13fd('0x87'),_0x200068[_0x13fd('0x50')]['id']);for(var _0x27ca01=0x0;_0x27ca01<_0x4a9d78[_0x13fd('0x41')];_0x27ca01+=0x1){let _0x30b6bc=_0x4a9d78[_0x27ca01];for(var _0x3ea2ec=0x0;_0x3ea2ec<_0x30b6bc['Agents'][_0x13fd('0x41')];_0x3ea2ec+=0x1){let _0x27e381=_0x30b6bc[_0x13fd('0x6e')][_0x3ea2ec];var _0x3669c4=_0x5223c2[_0x13fd('0x5a')]();_0x3669c4[_0x13fd('0x47')](_0x13fd('0x88'),_0x27e381['id']);_0x5b222f[_0x13fd('0x89')](db[_0x13fd('0x74')][_0x13fd('0x3b')](_0x3669c4[_0x13fd('0x8a')](),{'type':db[_0x13fd('0x74')][_0x13fd('0x8b')][_0x13fd('0x8c')]})[_0x13fd('0x24')](function(_0x4a29bc){if(_0x4a29bc[_0x13fd('0x41')]===0x1){return _0x27e381['id'];}else{var _0x5d791e=_['every'](_[_0x13fd('0x2d')](_0x4a29bc,_0x13fd('0x8d')),function(_0xdc487d){return _[_0x13fd('0x2f')](_0x2bd212,_0xdc487d);});if(_0x5d791e){return _0x27e381['id'];}}}));}}return BPromise[_0x13fd('0x8e')](_0x5b222f)[_0x13fd('0x24')](function(_0x3a42a7){_0x49f5e6=_(_0x49f5e6)[_0x13fd('0x8f')](_0x3a42a7)[_0x13fd('0x90')]()[_0x13fd('0x2e')]();return db['VoiceQueue'][_0x13fd('0x30')]({'where':{'id':_0x200068[_0x13fd('0x50')]['id']}})[_0x13fd('0x24')](function(_0xcd163b){return db[_0x13fd('0x74')][_0x13fd('0x75')](function(_0x1c751f){return _0xcd163b[_0x13fd('0x91')](_0x200068['query'][_0x13fd('0x81')],{'transaction':_0x1c751f})[_0x13fd('0x24')](function(){if(!_['isEmpty'](_0x49f5e6)){return _0xcd163b[_0x13fd('0x92')](_0x49f5e6,{'transaction':_0x1c751f})[_0x13fd('0x24')](function(){return db[_0x13fd('0x7b')]['destroy']({'where':{'VoiceQueueId':_0x200068[_0x13fd('0x50')]['id'],'UserId':_0x49f5e6},'transaction':_0x1c751f});});}})['then'](function(){_0x49f5e6[_0x13fd('0x72')](function(_0x3b2b4b){socket[_0x13fd('0x7f')]('userVoiceQueue:remove',{'UserId':_0x3b2b4b,'VoiceQueueId':_0xcd163b['id']});});});});});});})[_0x13fd('0x24')](respondWithStatusCode(_0x27529d,null))[_0x13fd('0x4e')](handleError(_0x27529d,null));};exports[_0x13fd('0x93')]=function(_0x453f5c,_0x24fe00,_0x27e8ca){var _0x2c2593,_0x14fd40;return db['VoiceQueue']['find']({'where':{'id':_0x453f5c[_0x13fd('0x50')]['id']}})[_0x13fd('0x24')](handleEntityNotFound(_0x24fe00,null))['then'](function(_0x3faa1d){if(_0x3faa1d){_0x14fd40=_0x3faa1d;return _0x3faa1d[_0x13fd('0x93')](_0x453f5c['body']['ids'],_[_0x13fd('0x5b')](_0x453f5c[_0x13fd('0x53')],['ids','id'])||{})[_0x13fd('0x94')](function(_0x23e045){for(var _0x46b463=0x0;_0x46b463<_0x453f5c['body']['ids'][_0x13fd('0x41')];_0x46b463+=0x1){socket[_0x13fd('0x7f')]('userVoiceQueue:save',{'UserId':Number(_0x453f5c[_0x13fd('0x53')][_0x13fd('0x81')][_0x46b463]),'VoiceQueueId':Number(_0x453f5c[_0x13fd('0x50')]['id'])});}return _0x23e045;});}})[_0x13fd('0x24')](function(_0x21d34a){_0x2c2593=_0x21d34a||[];if(_0x14fd40){return db[_0x13fd('0x6d')][_0x13fd('0x4d')]({'where':{'id':_0x453f5c['body'][_0x13fd('0x81')]},'attributes':['id',_0x13fd('0x32'),'online',_0x13fd('0x6f'),'interface'],'raw':!![]});}})[_0x13fd('0x24')](function(_0x5b567d){if(!_[_0x13fd('0x95')](_0x5b567d)){var _0x348bb6=[];for(var _0xf660c6=0x0;_0xf660c6<_0x5b567d['length'];_0xf660c6++){if(_0x5b567d[_0xf660c6][_0x13fd('0x96')]){_0x348bb6[_0x13fd('0x89')](db[_0x13fd('0x7b')][_0x13fd('0x78')]({'membername':_0x5b567d[_0xf660c6]['name'],'UserId':_0x5b567d[_0xf660c6]['id'],'queue_name':_0x14fd40[_0x13fd('0x32')],'VoiceQueueId':_0x14fd40['id'],'interface':_[_0x13fd('0x7c')](_0x5b567d[_0xf660c6]['interface'])?util[_0x13fd('0x7d')](_0x13fd('0x7e'),_0x5b567d[_0xf660c6][_0x13fd('0x32')]):_0x5b567d[_0xf660c6][_0x13fd('0x70')],'paused':_0x5b567d[_0xf660c6][_0x13fd('0x6f')]||![],'penalty':_0x453f5c[_0x13fd('0x53')][_0x13fd('0x73')]||0x0}));}}return BPromise[_0x13fd('0x8e')](_0x348bb6);}})[_0x13fd('0x24')](function(){return _0x2c2593;})['then'](respondWithResult(_0x24fe00,null))['catch'](handleError(_0x24fe00,null));};exports[_0x13fd('0x92')]=function(_0x15612e,_0x41dbd2,_0x213a96){return db[_0x13fd('0x4a')]['find']({'where':{'id':_0x15612e[_0x13fd('0x50')]['id']}})['then'](handleEntityNotFound(_0x41dbd2,null))[_0x13fd('0x24')](function(_0x48dfae){if(_0x48dfae){return _0x48dfae['removeAgents'](_0x15612e[_0x13fd('0x3b')][_0x13fd('0x81')])[_0x13fd('0x24')](function(){if(_[_0x13fd('0x97')](_0x15612e[_0x13fd('0x3b')][_0x13fd('0x81')])){for(var _0x1de564=0x0;_0x1de564<_0x15612e['query'][_0x13fd('0x81')]['length'];_0x1de564+=0x1){socket['emit'](_0x13fd('0x98'),{'UserId':Number(_0x15612e[_0x13fd('0x3b')][_0x13fd('0x81')][_0x1de564]),'VoiceQueueId':Number(_0x15612e[_0x13fd('0x50')]['id'])});}}else{socket[_0x13fd('0x7f')](_0x13fd('0x98'),{'UserId':Number(_0x15612e[_0x13fd('0x3b')][_0x13fd('0x81')]),'VoiceQueueId':Number(_0x15612e[_0x13fd('0x50')]['id'])});}});}})['then'](function(_0x4a329a){return db[_0x13fd('0x7b')][_0x13fd('0x25')]({'where':{'VoiceQueueId':_0x15612e[_0x13fd('0x50')]['id'],'UserId':_0x15612e[_0x13fd('0x3b')][_0x13fd('0x81')]}})['then'](function(){return _0x4a329a;});})[_0x13fd('0x24')](respondWithStatusCode(_0x41dbd2,null))[_0x13fd('0x4e')](handleError(_0x41dbd2,null));};exports[_0x13fd('0x99')]=function(_0x4793a7,_0x3570c6,_0x44970b){var _0x48bcbd={};var _0x2c9a58={};var _0x480ced;var _0x41b755;return db['VoiceQueue'][_0x13fd('0x5f')]({'where':{'id':_0x4793a7[_0x13fd('0x50')]['id']}})[_0x13fd('0x24')](handleEntityNotFound(_0x3570c6,null))[_0x13fd('0x24')](function(_0x56bfcd){if(_0x56bfcd){_0x480ced=_0x56bfcd;_0x2c9a58[_0x13fd('0x3a')]=_[_0x13fd('0x3c')](db[_0x13fd('0x6d')][_0x13fd('0x37')]);_0x2c9a58['query']=_[_0x13fd('0x3c')](_0x4793a7[_0x13fd('0x3b')]);_0x2c9a58[_0x13fd('0x3d')]=_[_0x13fd('0x3e')](_0x2c9a58[_0x13fd('0x3a')],_0x2c9a58[_0x13fd('0x3b')]);_0x48bcbd[_0x13fd('0x3f')]=_[_0x13fd('0x3e')](_0x2c9a58[_0x13fd('0x3a')],qs[_0x13fd('0x40')](_0x4793a7[_0x13fd('0x3b')][_0x13fd('0x40')]));_0x48bcbd[_0x13fd('0x3f')]=_0x48bcbd[_0x13fd('0x3f')]['length']?_0x48bcbd[_0x13fd('0x3f')]:_0x2c9a58[_0x13fd('0x3a')];_0x48bcbd[_0x13fd('0x45')]=qs[_0x13fd('0x46')](_0x4793a7['query']['sort']);_0x48bcbd[_0x13fd('0x47')]=qs[_0x13fd('0x3d')](_[_0x13fd('0x60')](_0x4793a7['query'],_0x2c9a58[_0x13fd('0x3d')]));if(_0x4793a7[_0x13fd('0x3b')][_0x13fd('0x2b')]){_0x48bcbd[_0x13fd('0x47')]=_['merge'](_0x48bcbd[_0x13fd('0x47')],{'$or':_[_0x13fd('0x2d')](_0x48bcbd[_0x13fd('0x3f')],function(_0xa70079){var _0x297954={};_0x297954[_0xa70079]={'$like':'%'+_0x4793a7['query'][_0x13fd('0x2b')]+'%'};return _0x297954;})});}_0x48bcbd=_[_0x13fd('0x48')]({},_0x48bcbd,_0x4793a7['options']);return _0x480ced[_0x13fd('0x99')](_0x48bcbd);}})[_0x13fd('0x24')](function(_0x2ec2ef){if(_0x2ec2ef){_0x41b755=_0x2ec2ef[_0x13fd('0x41')];if(!_0x4793a7['query'][_0x13fd('0x42')](_0x13fd('0x43'))){_0x48bcbd[_0x13fd('0x44')]=qs[_0x13fd('0x44')](_0x4793a7[_0x13fd('0x3b')][_0x13fd('0x44')]);_0x48bcbd[_0x13fd('0x1e')]=qs['offset'](_0x4793a7[_0x13fd('0x3b')][_0x13fd('0x1e')]);}return _0x480ced['getAgents'](_0x48bcbd);}})[_0x13fd('0x24')](function(_0x3b259c){if(_0x3b259c){return _0x3b259c?{'count':_0x41b755,'rows':_0x3b259c}:null;}})['then'](respondWithResult(_0x3570c6,null))[_0x13fd('0x4e')](handleError(_0x3570c6,null));};exports[_0x13fd('0x9a')]=function(_0x5289c2,_0x1b3d70,_0x3bc428){var _0x3d7005={};var _0x17bdc5={};var _0x5bd8a4;var _0x2cae46;return db['VoiceQueue'][_0x13fd('0x5f')]({'where':{'id':_0x5289c2[_0x13fd('0x50')]['id']}})['then'](handleEntityNotFound(_0x1b3d70,null))['then'](function(_0x39d796){if(_0x39d796){_0x5bd8a4=_0x39d796;_0x17bdc5[_0x13fd('0x3a')]=_['keys'](db[_0x13fd('0x7b')][_0x13fd('0x37')]);_0x17bdc5[_0x13fd('0x3b')]=_[_0x13fd('0x3c')](_0x5289c2[_0x13fd('0x3b')]);_0x17bdc5[_0x13fd('0x3d')]=_['intersection'](_0x17bdc5[_0x13fd('0x3a')],_0x17bdc5['query']);_0x3d7005[_0x13fd('0x3f')]=_[_0x13fd('0x3e')](_0x17bdc5[_0x13fd('0x3a')],qs[_0x13fd('0x40')](_0x5289c2[_0x13fd('0x3b')][_0x13fd('0x40')]));_0x3d7005[_0x13fd('0x3f')]=_0x3d7005[_0x13fd('0x3f')][_0x13fd('0x41')]?_0x3d7005['attributes']:_0x17bdc5['model'];_0x3d7005['order']=qs['sort'](_0x5289c2['query'][_0x13fd('0x46')]);_0x3d7005[_0x13fd('0x47')]=qs[_0x13fd('0x3d')](_[_0x13fd('0x60')](_0x5289c2[_0x13fd('0x3b')],_0x17bdc5[_0x13fd('0x3d')]));if(_0x5289c2[_0x13fd('0x3b')]['filter']){_0x3d7005[_0x13fd('0x47')]=_[_0x13fd('0x48')](_0x3d7005['where'],{'$or':_[_0x13fd('0x2d')](_0x3d7005[_0x13fd('0x3f')],function(_0x655f12){var _0x579457={};_0x579457[_0x655f12]={'$like':'%'+_0x5289c2[_0x13fd('0x3b')][_0x13fd('0x2b')]+'%'};return _0x579457;})});}_0x3d7005=_[_0x13fd('0x48')]({},_0x3d7005,_0x5289c2[_0x13fd('0x51')]);return _0x5bd8a4[_0x13fd('0x9a')](_0x3d7005);}})[_0x13fd('0x24')](function(_0x342338){if(_0x342338){_0x2cae46=_0x342338['length'];if(!_0x5289c2[_0x13fd('0x3b')][_0x13fd('0x42')](_0x13fd('0x43'))){_0x3d7005[_0x13fd('0x44')]=qs[_0x13fd('0x44')](_0x5289c2['query']['limit']);_0x3d7005['offset']=qs[_0x13fd('0x1e')](_0x5289c2[_0x13fd('0x3b')][_0x13fd('0x1e')]);}return _0x5bd8a4[_0x13fd('0x9a')](_0x3d7005);}})[_0x13fd('0x24')](function(_0x359915){return _0x359915?{'count':_0x2cae46,'rows':_0x359915}:null;})[_0x13fd('0x24')](respondWithResult(_0x1b3d70,null))[_0x13fd('0x4e')](handleError(_0x1b3d70,null));};exports[_0x13fd('0x9b')]=function(_0x1de3fc,_0x5a7532,_0x1ed40a){var _0x3030fb={};var _0x3f3cb7={};var _0x425d6f;var _0x5aa073;return db[_0x13fd('0x4a')][_0x13fd('0x5f')]({'where':{'id':_0x1de3fc[_0x13fd('0x50')]['id']}})[_0x13fd('0x24')](handleEntityNotFound(_0x5a7532,null))[_0x13fd('0x24')](function(_0x5ee923){if(_0x5ee923){_0x425d6f=_0x5ee923;_0x3f3cb7[_0x13fd('0x3a')]=_['keys'](db[_0x13fd('0x9c')][_0x13fd('0x37')]);_0x3f3cb7[_0x13fd('0x3b')]=_['keys'](_0x1de3fc[_0x13fd('0x3b')]);_0x3f3cb7[_0x13fd('0x3d')]=_[_0x13fd('0x3e')](_0x3f3cb7[_0x13fd('0x3a')],_0x3f3cb7[_0x13fd('0x3b')]);_0x3030fb[_0x13fd('0x3f')]=_[_0x13fd('0x3e')](_0x3f3cb7[_0x13fd('0x3a')],qs[_0x13fd('0x40')](_0x1de3fc[_0x13fd('0x3b')][_0x13fd('0x40')]));_0x3030fb['attributes']=_0x3030fb[_0x13fd('0x3f')][_0x13fd('0x41')]?_0x3030fb[_0x13fd('0x3f')]:_0x3f3cb7[_0x13fd('0x3a')];_0x3030fb[_0x13fd('0x45')]=qs['sort'](_0x1de3fc[_0x13fd('0x3b')][_0x13fd('0x46')]);_0x3030fb[_0x13fd('0x47')]=qs['filters'](_[_0x13fd('0x60')](_0x1de3fc[_0x13fd('0x3b')],_0x3f3cb7['filters']));if(_0x1de3fc[_0x13fd('0x3b')][_0x13fd('0x2b')]){_0x3030fb[_0x13fd('0x47')]=_[_0x13fd('0x48')](_0x3030fb['where'],{'$or':_[_0x13fd('0x2d')](_0x3030fb['attributes'],function(_0x479f20){var _0x3e16cf={};_0x3e16cf[_0x479f20]={'$like':'%'+_0x1de3fc[_0x13fd('0x3b')][_0x13fd('0x2b')]+'%'};return _0x3e16cf;})});}_0x3030fb=_[_0x13fd('0x48')]({},_0x3030fb,_0x1de3fc[_0x13fd('0x51')]);return _0x425d6f[_0x13fd('0x9b')](_0x3030fb);}})[_0x13fd('0x24')](function(_0x1b4d67){if(_0x1b4d67){_0x5aa073=_0x1b4d67['length'];if(!_0x1de3fc['query'][_0x13fd('0x42')](_0x13fd('0x43'))){_0x3030fb[_0x13fd('0x44')]=qs['limit'](_0x1de3fc[_0x13fd('0x3b')]['limit']);_0x3030fb['offset']=qs['offset'](_0x1de3fc[_0x13fd('0x3b')][_0x13fd('0x1e')]);}return _0x425d6f[_0x13fd('0x9b')](_0x3030fb);}})['then'](function(_0x1b7654){if(_0x1b7654){return _0x1b7654?{'count':_0x5aa073,'rows':_0x1b7654}:null;}})[_0x13fd('0x24')](respondWithResult(_0x5a7532,null))[_0x13fd('0x4e')](handleError(_0x5a7532,null));};exports[_0x13fd('0x9d')]=function(_0x4c129d,_0x3421b1,_0x1e93dc){var _0x2d8e6b,_0x59a971;return db['VoiceQueue'][_0x13fd('0x30')]({'where':{'id':_0x4c129d[_0x13fd('0x50')]['id']}})[_0x13fd('0x24')](handleEntityNotFound(_0x3421b1,null))[_0x13fd('0x24')](function(_0x4e36bd){if(_0x4e36bd){_0x59a971=_0x4e36bd;return _0x4e36bd[_0x13fd('0x9d')](_0x4c129d[_0x13fd('0x53')][_0x13fd('0x81')],_['omit'](_0x4c129d['body'],[_0x13fd('0x81'),'id'])||{});}return null;})[_0x13fd('0x94')](function(_0x312d7f){var _0x5cbee5;_0x2d8e6b=_0x312d7f||[];var _0x14e5ad=[];if(_0x312d7f){for(var _0x5390a0=0x0;_0x5390a0<_0x312d7f[_0x13fd('0x41')];_0x5390a0+=0x1){var _0x473537=_0x312d7f[_0x5390a0]['get']({'plain':!![]});_0x59a971[_0x13fd('0x9e')]=_0x4c129d[_0x13fd('0x53')][_0x13fd('0x9e')]?_0x4c129d[_0x13fd('0x53')][_0x13fd('0x9e')]:_0x59a971[_0x13fd('0x9e')];switch(_0x59a971[_0x13fd('0x9e')]){case _0x13fd('0x9f'):_0x5cbee5=squel[_0x13fd('0xa0')]()[_0x13fd('0xa1')]('cm_hopper')[_0x13fd('0xa2')]([_0x13fd('0xa3'),'scheduledAt',_0x13fd('0xa4'),'ListId','VoiceQueueId','createdAt',_0x13fd('0x5d')],squel[_0x13fd('0xa5')]()[_0x13fd('0x82')](_0x13fd('0xa3'),'phone')[_0x13fd('0x82')]('NOW()',_0x13fd('0xa6'))[_0x13fd('0x82')]('id',_0x13fd('0xa4'))[_0x13fd('0x82')](_0x473537[_0x13fd('0xa7')]['toString'](),_0x13fd('0xa8'))[_0x13fd('0x82')](_0x4c129d[_0x13fd('0x50')]['id'][_0x13fd('0x8a')](),_0x13fd('0x61'))['field'](_0x13fd('0xa9'),_0x13fd('0x5c'))['field'](_0x13fd('0xa9'),_0x13fd('0x5d'))[_0x13fd('0xaa')](_0x13fd('0xab'))[_0x13fd('0x47')](_0x13fd('0xac'))[_0x13fd('0x47')](_0x13fd('0xad'),_0x473537[_0x13fd('0xa7')][_0x13fd('0x8a')]())[_0x13fd('0x47')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x13fd('0xa5')]()['field'](_0x13fd('0xae'))[_0x13fd('0xaa')]('cm_hopper_final')[_0x13fd('0x47')]('VoiceQueueId\x20=\x20?',_0x4c129d[_0x13fd('0x50')]['id']['toString']()))[_0x13fd('0x47')](_0x13fd('0xaf'),squel[_0x13fd('0xa5')]()[_0x13fd('0x82')]('COALESCE(phone,\x27\x27)')[_0x13fd('0xaa')](_0x13fd('0xb0'))[_0x13fd('0x47')](_0x13fd('0x87'),_0x4c129d['params']['id'][_0x13fd('0x8a')]())))['toString']();break;case _0x13fd('0xb1'):_0x5cbee5=squel[_0x13fd('0xa0')]()[_0x13fd('0xa1')](_0x13fd('0xb0'))[_0x13fd('0xa2')]([_0x13fd('0xa3'),_0x13fd('0xa6'),_0x13fd('0xa4'),_0x13fd('0xa8'),_0x13fd('0x61'),_0x13fd('0x5c'),_0x13fd('0x5d')],squel[_0x13fd('0xa5')]()[_0x13fd('0x82')](_0x13fd('0xa3'),_0x13fd('0xa3'))[_0x13fd('0x82')]('NOW()','scheduledAt')[_0x13fd('0x82')]('id','ContactId')['field'](_0x473537[_0x13fd('0xa7')][_0x13fd('0x8a')](),_0x13fd('0xa8'))[_0x13fd('0x82')](_0x4c129d[_0x13fd('0x50')]['id'][_0x13fd('0x8a')](),_0x13fd('0x61'))[_0x13fd('0x82')]('NOW()',_0x13fd('0x5c'))[_0x13fd('0x82')]('NOW()',_0x13fd('0x5d'))['from'](_0x13fd('0xab'))['where'](_0x13fd('0xac'))[_0x13fd('0x47')](_0x13fd('0xad'),_0x473537[_0x13fd('0xa7')]['toString']())[_0x13fd('0x47')](_0x13fd('0xb2'))[_0x13fd('0x47')](_0x13fd('0xaf'),squel[_0x13fd('0xa5')]()['field'](_0x13fd('0xb3'))[_0x13fd('0xaa')](_0x13fd('0xb0'))[_0x13fd('0x47')](_0x13fd('0x87'),_0x4c129d[_0x13fd('0x50')]['id'][_0x13fd('0x8a')]())))[_0x13fd('0x8a')]();break;default:_0x5cbee5=squel[_0x13fd('0xa0')]()[_0x13fd('0xa1')](_0x13fd('0xb0'))[_0x13fd('0xa2')](['phone','scheduledAt','ContactId',_0x13fd('0xa8'),'VoiceQueueId',_0x13fd('0x5c'),'updatedAt'],squel['select']()[_0x13fd('0x82')](_0x13fd('0xa3'),_0x13fd('0xa3'))[_0x13fd('0x82')](_0x13fd('0xa9'),'scheduledAt')[_0x13fd('0x82')]('id',_0x13fd('0xa4'))[_0x13fd('0x82')](_0x473537[_0x13fd('0xa7')]['toString'](),_0x13fd('0xa8'))[_0x13fd('0x82')](_0x4c129d['params']['id']['toString'](),_0x13fd('0x61'))['field'](_0x13fd('0xa9'),_0x13fd('0x5c'))[_0x13fd('0x82')](_0x13fd('0xa9'),'updatedAt')[_0x13fd('0xaa')](_0x13fd('0xab'))['where'](_0x13fd('0xac'))[_0x13fd('0x47')](_0x13fd('0xad'),_0x473537[_0x13fd('0xa7')][_0x13fd('0x8a')]())[_0x13fd('0x47')](_0x13fd('0xb2')))[_0x13fd('0x8a')]();}_0x14e5ad[_0x13fd('0x89')](db[_0x13fd('0x74')][_0x13fd('0x3b')](_0x5cbee5));}return BPromise[_0x13fd('0x8e')](_0x14e5ad);}})[_0x13fd('0x24')](function(){return _0x2d8e6b;})['then'](respondWithResult(_0x3421b1,null))[_0x13fd('0x4e')](handleError(_0x3421b1,null));};exports[_0x13fd('0xb4')]=function(_0x580b19,_0x128f04,_0x3d88b3){return db[_0x13fd('0x4a')]['find']({'where':{'id':_0x580b19['params']['id']}})[_0x13fd('0x24')](handleEntityNotFound(_0x128f04,null))[_0x13fd('0x24')](function(_0x4ef2e9){if(_0x4ef2e9){return _0x4ef2e9[_0x13fd('0xb4')](_0x580b19[_0x13fd('0x3b')]['ids']);}})['then'](function(_0xe41eee){if(_0xe41eee){return db[_0x13fd('0x62')][_0x13fd('0x25')]({'where':{'ListId':_0x580b19[_0x13fd('0x3b')][_0x13fd('0x81')],'VoiceQueueId':_0x580b19[_0x13fd('0x50')]['id']}})[_0x13fd('0x24')](function(){return _0xe41eee;});}})[_0x13fd('0x24')](respondWithStatusCode(_0x128f04,null))['catch'](handleError(_0x128f04,null));};exports[_0x13fd('0xb5')]=function(_0x2ee7e4,_0x19d1ec,_0x185a00){var _0x140472={};var _0x52aa35={};var _0x3f44cc;var _0x3a1508;return db[_0x13fd('0x4a')]['findOne']({'where':{'id':_0x2ee7e4[_0x13fd('0x50')]['id']}})['then'](handleEntityNotFound(_0x19d1ec,null))[_0x13fd('0x24')](function(_0x283654){if(_0x283654){_0x3f44cc=_0x283654;_0x52aa35[_0x13fd('0x3a')]=_[_0x13fd('0x3c')](db[_0x13fd('0x9c')][_0x13fd('0x37')]);_0x52aa35[_0x13fd('0x3b')]=_['keys'](_0x2ee7e4[_0x13fd('0x3b')]);_0x52aa35['filters']=_['intersection'](_0x52aa35[_0x13fd('0x3a')],_0x52aa35[_0x13fd('0x3b')]);_0x140472['attributes']=_[_0x13fd('0x3e')](_0x52aa35[_0x13fd('0x3a')],qs['fields'](_0x2ee7e4[_0x13fd('0x3b')][_0x13fd('0x40')]));_0x140472[_0x13fd('0x3f')]=_0x140472[_0x13fd('0x3f')][_0x13fd('0x41')]?_0x140472[_0x13fd('0x3f')]:_0x52aa35[_0x13fd('0x3a')];_0x140472[_0x13fd('0x45')]=qs[_0x13fd('0x46')](_0x2ee7e4[_0x13fd('0x3b')][_0x13fd('0x46')]);_0x140472[_0x13fd('0x47')]=qs[_0x13fd('0x3d')](_['pick'](_0x2ee7e4[_0x13fd('0x3b')],_0x52aa35[_0x13fd('0x3d')]));if(_0x2ee7e4[_0x13fd('0x3b')]['filter']){_0x140472[_0x13fd('0x47')]=_[_0x13fd('0x48')](_0x140472[_0x13fd('0x47')],{'$or':_['map'](_0x140472[_0x13fd('0x3f')],function(_0x3540c4){var _0x49ac10={};_0x49ac10[_0x3540c4]={'$like':'%'+_0x2ee7e4[_0x13fd('0x3b')]['filter']+'%'};return _0x49ac10;})});}_0x140472=_[_0x13fd('0x48')]({},_0x140472,_0x2ee7e4[_0x13fd('0x51')]);return _0x3f44cc[_0x13fd('0xb5')](_0x140472);}})['then'](function(_0x47990d){if(_0x47990d){_0x3a1508=_0x47990d[_0x13fd('0x41')];if(!_0x2ee7e4[_0x13fd('0x3b')]['hasOwnProperty'](_0x13fd('0x43'))){_0x140472['limit']=qs['limit'](_0x2ee7e4['query'][_0x13fd('0x44')]);_0x140472[_0x13fd('0x1e')]=qs['offset'](_0x2ee7e4[_0x13fd('0x3b')][_0x13fd('0x1e')]);}return _0x3f44cc[_0x13fd('0xb5')](_0x140472);}})[_0x13fd('0x24')](function(_0x158eb1){if(_0x158eb1){return _0x158eb1?{'count':_0x3a1508,'rows':_0x158eb1}:null;}})[_0x13fd('0x24')](respondWithResult(_0x19d1ec,null))['catch'](handleError(_0x19d1ec,null));};exports[_0x13fd('0xb6')]=function(_0x2bcfab,_0x5121e0,_0x5476de){var _0x45acb5,_0x3b6047;return db[_0x13fd('0x4a')][_0x13fd('0x30')]({'where':{'id':_0x2bcfab[_0x13fd('0x50')]['id']}})[_0x13fd('0x24')](handleEntityNotFound(_0x5121e0,null))[_0x13fd('0x24')](function(_0x1c919a){if(_0x1c919a){_0x3b6047=_0x1c919a;return _0x1c919a['addBlackLists'](_0x2bcfab['body'][_0x13fd('0x81')],_[_0x13fd('0x5b')](_0x2bcfab['body'],['ids','id'])||{});}return null;})[_0x13fd('0x94')](function(_0x485a68){var _0x5a542a;_0x45acb5=_0x485a68||[];var _0x65ecf6=[];if(_0x485a68){for(var _0xb02c7d=0x0;_0xb02c7d<_0x485a68[_0x13fd('0x41')];_0xb02c7d+=0x1){var _0x7282a4=_0x485a68[_0xb02c7d]['get']({'plain':!![]});_0x5a542a=squel[_0x13fd('0xa0')]()[_0x13fd('0xa1')](_0x13fd('0xb7'))[_0x13fd('0xa2')]([_0x13fd('0xa3'),'ContactId',_0x13fd('0xa8'),'VoiceQueueId',_0x13fd('0x5c'),_0x13fd('0x5d')],squel[_0x13fd('0xa5')]()[_0x13fd('0x82')](_0x13fd('0xa3'),_0x13fd('0xa3'))['field']('id',_0x13fd('0xa4'))[_0x13fd('0x82')](_0x7282a4[_0x13fd('0xa7')][_0x13fd('0x8a')](),_0x13fd('0xa8'))[_0x13fd('0x82')](_0x2bcfab['params']['id'][_0x13fd('0x8a')](),_0x13fd('0x61'))[_0x13fd('0x82')](_0x13fd('0xa9'),'createdAt')['field'](_0x13fd('0xa9'),'updatedAt')[_0x13fd('0xaa')](_0x13fd('0xab'))[_0x13fd('0x47')](_0x13fd('0xac'))[_0x13fd('0x47')](_0x13fd('0xad'),_0x7282a4[_0x13fd('0xa7')][_0x13fd('0x8a')]())['where'](_0x13fd('0xb2')))[_0x13fd('0x8a')]();_0x65ecf6[_0x13fd('0x89')](db[_0x13fd('0x74')][_0x13fd('0x3b')](_0x5a542a));}return BPromise[_0x13fd('0x8e')](_0x65ecf6);}})[_0x13fd('0x24')](function(){return _0x45acb5;})[_0x13fd('0x24')](respondWithResult(_0x5121e0,null))[_0x13fd('0x4e')](handleError(_0x5121e0,null));};exports[_0x13fd('0xb8')]=function(_0x2f6f0f,_0x3332fb,_0x4e9c76){return db['VoiceQueue']['find']({'where':{'id':_0x2f6f0f['params']['id']}})['then'](handleEntityNotFound(_0x3332fb,null))['then'](function(_0x6dfbd0){if(_0x6dfbd0){return _0x6dfbd0[_0x13fd('0xb8')](_0x2f6f0f[_0x13fd('0x3b')]['ids']);}})[_0x13fd('0x24')](function(_0x372046){if(_0x372046){return db[_0x13fd('0x68')]['destroy']({'where':{'ListId':_0x2f6f0f['query'][_0x13fd('0x81')],'VoiceQueueId':_0x2f6f0f[_0x13fd('0x50')]['id']}})[_0x13fd('0x24')](function(){return _0x372046;});}})['then'](respondWithStatusCode(_0x3332fb,null))[_0x13fd('0x4e')](handleError(_0x3332fb,null));}; \ No newline at end of file +var _0x5b55=['util','sox','to-csv','ejs','fs-extra','lodash','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./voiceQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','get','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','find','type','UserProfileResource','stack','name','VoiceQueue','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','includeAll','include','catch','show','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','createdAt','updatedAt','omit','user','UserProfileSection','userProfileId','getHoppers','CmHopper','findAll','rows','getHopperHistories','findOne','CmHopperHistory','CmHopperFinal','VoiceQueueId','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','User','online','interface','flatMap','Agents','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','ids','select','field','from','join','user_has_teams','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','all','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','format','isArray','getAgents','getMembers','getLists','CmList','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','phone','NOW()','CmListId','ListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','ContactId','ListId\x20=\x20?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x5b55,0xb0));var _0x55b5=function(_0x4005fe,_0x1fc3c1){_0x4005fe=_0x4005fe-0x0;var _0x50022d=_0x5b55[_0x4005fe];return _0x50022d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x55b5('0x0'));var zipdir=require(_0x55b5('0x1'));var jsonpatch=require(_0x55b5('0x2'));var rp=require(_0x55b5('0x3'));var moment=require('moment');var BPromise=require(_0x55b5('0x4'));var Mustache=require(_0x55b5('0x5'));var util=require(_0x55b5('0x6'));var path=require('path');var sox=require(_0x55b5('0x7'));var csv=require(_0x55b5('0x8'));var ejs=require(_0x55b5('0x9'));var fs=require('fs');var fs_extra=require(_0x55b5('0xa'));var _=require(_0x55b5('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x55b5('0x8'));var querystring=require(_0x55b5('0xc'));var Papa=require(_0x55b5('0xd'));var Redis=require('ioredis');var authService=require(_0x55b5('0xe'));var qs=require(_0x55b5('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x55b5('0x10'));var logger=require(_0x55b5('0x11'))(_0x55b5('0x12'));var utils=require(_0x55b5('0x13'));var config=require(_0x55b5('0x14'));var licenseUtil=require(_0x55b5('0x15'));var db=require(_0x55b5('0x16'))['db'];config[_0x55b5('0x17')]=_[_0x55b5('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x55b5('0x17')]));require(_0x55b5('0x19'))[_0x55b5('0x1a')](socket);function respondWithStatusCode(_0x24985b,_0x10a2b3){_0x10a2b3=_0x10a2b3||0xcc;return function(_0x1e7c51){if(_0x1e7c51){return _0x24985b[_0x55b5('0x1b')](_0x10a2b3);}return _0x24985b[_0x55b5('0x1c')](_0x10a2b3)[_0x55b5('0x1d')]();};}function respondWithResult(_0x216e23,_0x11ab95){_0x11ab95=_0x11ab95||0xc8;return function(_0x400300){if(_0x400300){return _0x216e23[_0x55b5('0x1c')](_0x11ab95)[_0x55b5('0x1e')](_0x400300);}};}function respondWithFilteredResult(_0x588784,_0xe1a176){return function(_0x3d66b6){if(_0x3d66b6){var _0x2c323f=typeof _0xe1a176[_0x55b5('0x1f')]==='undefined'&&typeof _0xe1a176[_0x55b5('0x20')]===_0x55b5('0x21');var _0x45ec8c=_0x3d66b6[_0x55b5('0x22')];var _0x3bf8c6=_0x2c323f?0x0:_0xe1a176[_0x55b5('0x1f')];var _0xc0dc48=_0x2c323f?_0x3d66b6['count']:_0xe1a176[_0x55b5('0x1f')]+_0xe1a176[_0x55b5('0x20')];var _0x148a96;if(_0xc0dc48>=_0x45ec8c){_0xc0dc48=_0x45ec8c;_0x148a96=0xc8;}else{_0x148a96=0xce;}_0x588784[_0x55b5('0x1c')](_0x148a96);return _0x588784[_0x55b5('0x23')](_0x55b5('0x24'),_0x3bf8c6+'-'+_0xc0dc48+'/'+_0x45ec8c)[_0x55b5('0x1e')](_0x3d66b6);}return null;};}function patchUpdates(_0x5237ba){return function(_0xd2e2b7){try{jsonpatch[_0x55b5('0x25')](_0xd2e2b7,_0x5237ba,!![]);}catch(_0xf77938){return BPromise[_0x55b5('0x26')](_0xf77938);}return _0xd2e2b7[_0x55b5('0x27')]();};}function saveUpdates(_0x3ab2ec,_0x1e18eb){return function(_0x5d09e4){if(_0x5d09e4){return _0x5d09e4[_0x55b5('0x28')](_0x3ab2ec)['then'](function(_0x1dcb67){return _0x1dcb67;});}return null;};}function removeEntity(_0x560782,_0x4a7099){return function(_0x4686b5){if(_0x4686b5){return _0x4686b5[_0x55b5('0x29')]()[_0x55b5('0x2a')](function(){var _0x5d92c3=_0x4686b5[_0x55b5('0x2b')]({'plain':!![]});var _0x34938f=[{'name':'VoiceQueues','value':_0x55b5('0x2c'),'ignore':![]},{'name':_0x55b5('0x2d'),'value':_0x55b5('0x2e'),'ignore':![]}];var _0x2cab37=_(_0x34938f)[_0x55b5('0x2f')](_0x55b5('0x30'))[_0x55b5('0x31')](_0x55b5('0x32'))[_0x55b5('0x32')]();if(_[_0x55b5('0x33')](_0x2cab37,_0x5d92c3['type'])){return;}var _0x3efc8b=_[_0x55b5('0x34')](_0x34938f,[_0x55b5('0x32'),_0x5d92c3[_0x55b5('0x35')]])['name'];return db[_0x55b5('0x36')][_0x55b5('0x29')]({'where':{'type':_0x3efc8b,'resourceId':_0x5d92c3['id']}})[_0x55b5('0x2a')](function(){return _0x4686b5;});})[_0x55b5('0x2a')](function(){_0x560782[_0x55b5('0x1c')](0xcc)[_0x55b5('0x1d')]();});}};}function handleEntityNotFound(_0x17aeb8,_0x41780e){return function(_0x528689){if(!_0x528689){_0x17aeb8[_0x55b5('0x1b')](0x194);}return _0x528689;};}function handleError(_0x531a13,_0x2c9289){_0x2c9289=_0x2c9289||0x1f4;return function(_0x1c2514){logger['error'](_0x1c2514[_0x55b5('0x37')]);if(_0x1c2514[_0x55b5('0x38')]){delete _0x1c2514['name'];}_0x531a13[_0x55b5('0x1c')](_0x2c9289)['send'](_0x1c2514);};}exports['index']=function(_0x4b6341,_0x3e0c4c){var _0x20b738={},_0x2e4796={},_0x2c14d2={'count':0x0,'rows':[]};var _0x23de79=_['map'](db[_0x55b5('0x39')][_0x55b5('0x3a')],function(_0x18a36c){return{'name':_0x18a36c[_0x55b5('0x3b')],'type':_0x18a36c[_0x55b5('0x35')][_0x55b5('0x3c')]};});_0x2e4796['model']=_[_0x55b5('0x31')](_0x23de79,_0x55b5('0x38'));_0x2e4796[_0x55b5('0x3d')]=_[_0x55b5('0x3e')](_0x4b6341['query']);_0x2e4796[_0x55b5('0x3f')]=_[_0x55b5('0x40')](_0x2e4796[_0x55b5('0x41')],_0x2e4796['query']);_0x20b738['attributes']=_[_0x55b5('0x40')](_0x2e4796['model'],qs[_0x55b5('0x42')](_0x4b6341[_0x55b5('0x3d')][_0x55b5('0x42')]));_0x20b738[_0x55b5('0x43')]=_0x20b738['attributes'][_0x55b5('0x44')]?_0x20b738[_0x55b5('0x43')]:_0x2e4796[_0x55b5('0x41')];if(!_0x4b6341[_0x55b5('0x3d')][_0x55b5('0x45')](_0x55b5('0x46'))){_0x20b738[_0x55b5('0x20')]=qs['limit'](_0x4b6341['query'][_0x55b5('0x20')]);_0x20b738[_0x55b5('0x1f')]=qs[_0x55b5('0x1f')](_0x4b6341[_0x55b5('0x3d')][_0x55b5('0x1f')]);}_0x20b738[_0x55b5('0x47')]=qs[_0x55b5('0x48')](_0x4b6341[_0x55b5('0x3d')]['sort']);_0x20b738[_0x55b5('0x49')]=qs[_0x55b5('0x3f')](_[_0x55b5('0x4a')](_0x4b6341[_0x55b5('0x3d')],_0x2e4796[_0x55b5('0x3f')]),_0x23de79);if(_0x4b6341[_0x55b5('0x3d')][_0x55b5('0x2f')]){_0x20b738[_0x55b5('0x49')]=_[_0x55b5('0x4b')](_0x20b738[_0x55b5('0x49')],{'$or':_[_0x55b5('0x31')](_0x23de79,function(_0x2ddff9){if(_0x2ddff9[_0x55b5('0x35')]!=='VIRTUAL'){var _0x1e77c4={};_0x1e77c4[_0x2ddff9['name']]={'$like':'%'+_0x4b6341[_0x55b5('0x3d')][_0x55b5('0x2f')]+'%'};return _0x1e77c4;}})});}_0x20b738=_['merge']({},_0x20b738,_0x4b6341['options']);var _0x2ccd84={'where':_0x20b738[_0x55b5('0x49')]};return db[_0x55b5('0x39')]['count'](_0x2ccd84)[_0x55b5('0x2a')](function(_0x3b7b19){_0x2c14d2[_0x55b5('0x22')]=_0x3b7b19;if(_0x4b6341['query'][_0x55b5('0x4c')]){_0x20b738[_0x55b5('0x4d')]=[{'all':!![]}];}return db[_0x55b5('0x39')]['findAll'](_0x20b738);})[_0x55b5('0x2a')](function(_0x377cac){_0x2c14d2['rows']=_0x377cac;return _0x2c14d2;})[_0x55b5('0x2a')](respondWithFilteredResult(_0x3e0c4c,_0x20b738))[_0x55b5('0x4e')](handleError(_0x3e0c4c,null));};exports[_0x55b5('0x4f')]=function(_0x17376e,_0x3b5d53){var _0x167064={'raw':![],'where':{'id':_0x17376e['params']['id']}},_0x186698={};_0x186698[_0x55b5('0x41')]=_[_0x55b5('0x3e')](db['VoiceQueue'][_0x55b5('0x3a')]);_0x186698[_0x55b5('0x3d')]=_[_0x55b5('0x3e')](_0x17376e[_0x55b5('0x3d')]);_0x186698[_0x55b5('0x3f')]=_[_0x55b5('0x40')](_0x186698[_0x55b5('0x41')],_0x186698['query']);_0x167064[_0x55b5('0x43')]=_[_0x55b5('0x40')](_0x186698[_0x55b5('0x41')],qs[_0x55b5('0x42')](_0x17376e['query'][_0x55b5('0x42')]));_0x167064[_0x55b5('0x43')]=_0x167064[_0x55b5('0x43')][_0x55b5('0x44')]?_0x167064[_0x55b5('0x43')]:_0x186698[_0x55b5('0x41')];if(_0x17376e['query']['includeAll']){_0x167064[_0x55b5('0x4d')]=[{'all':!![]}];}_0x167064=_[_0x55b5('0x4b')]({},_0x167064,_0x17376e[_0x55b5('0x50')]);return db[_0x55b5('0x39')][_0x55b5('0x34')](_0x167064)[_0x55b5('0x2a')](handleEntityNotFound(_0x3b5d53,null))[_0x55b5('0x2a')](respondWithResult(_0x3b5d53,null))[_0x55b5('0x4e')](handleError(_0x3b5d53,null));};exports[_0x55b5('0x51')]=function(_0x5bdafa,_0x104421){return db[_0x55b5('0x39')][_0x55b5('0x51')](_0x5bdafa[_0x55b5('0x52')],{})[_0x55b5('0x2a')](function(_0xf95079){var _0x1b70ad=_0x5bdafa['user'][_0x55b5('0x2b')]({'plain':!![]});if(!_0x1b70ad)throw new Error(_0x55b5('0x53'));if(_0x1b70ad[_0x55b5('0x54')]==='user'){var _0x117eb7=_0xf95079[_0x55b5('0x2b')]({'plain':!![]});var _0x15f89e=[{'name':_0x55b5('0x55'),'value':_0x55b5('0x2c')},{'name':_0x55b5('0x2d'),'value':_0x55b5('0x2e')}];var _0x2f2210=_[_0x55b5('0x34')](_0x15f89e,[_0x55b5('0x32'),_0x117eb7[_0x55b5('0x35')]])[_0x55b5('0x38')];return db['UserProfileSection'][_0x55b5('0x34')]({'where':{'name':_0x2f2210,'userProfileId':_0x1b70ad['userProfileId']},'raw':!![]})[_0x55b5('0x2a')](function(_0x37ad4d){if(_0x37ad4d&&_0x37ad4d[_0x55b5('0x56')]===0x0){return db[_0x55b5('0x36')][_0x55b5('0x51')]({'name':_0x117eb7['name'],'resourceId':_0x117eb7['id'],'type':_0x37ad4d[_0x55b5('0x38')],'sectionId':_0x37ad4d['id']},{})['then'](function(){return _0xf95079;});}else{return _0xf95079;}})['catch'](function(_0x28aea5){logger[_0x55b5('0x57')](_0x55b5('0x58'),_0x28aea5);throw _0x28aea5;});}return _0xf95079;})['then'](respondWithResult(_0x104421,0xc9))['catch'](handleError(_0x104421,null));};exports['clone']=function(_0x15323b,_0x14ec7c){var _0x55eda9={'where':{'id':_0x15323b[_0x55b5('0x59')]['id']}},_0x841ead={};_0x841ead[_0x55b5('0x41')]=_[_0x55b5('0x3e')](db['VoiceQueue']['rawAttributes']);_0x55eda9['attributes']=_['intersection'](_0x841ead[_0x55b5('0x41')],qs[_0x55b5('0x42')](_0x15323b[_0x55b5('0x3d')][_0x55b5('0x42')]));_0x55eda9[_0x55b5('0x43')]=_0x55eda9[_0x55b5('0x43')]['length']?_0x55eda9[_0x55b5('0x43')]:_0x841ead[_0x55b5('0x41')];if(_0x15323b[_0x55b5('0x3d')][_0x55b5('0x4c')]){_0x55eda9[_0x55b5('0x4d')]=[{'all':!![]}];}_0x55eda9=_[_0x55b5('0x4b')]({},_0x55eda9,_0x15323b[_0x55b5('0x50')]);return db[_0x55b5('0x39')][_0x55b5('0x34')](_0x55eda9)[_0x55b5('0x2a')](handleEntityNotFound(_0x14ec7c,null))['then'](function(_0x23f76d){if(_0x23f76d){var _0x59da2d=_0x23f76d[_0x55b5('0x2b')]({'plain':!![]});_0x59da2d=qs['omit'](_0x59da2d,['id',_0x55b5('0x5a'),_0x55b5('0x5b')]);_0x15323b[_0x55b5('0x52')]=_[_0x55b5('0x5c')](_0x15323b['body'],['id',_0x55b5('0x5a'),_0x55b5('0x5b')]);return db[_0x55b5('0x39')][_0x55b5('0x51')](_[_0x55b5('0x4b')](_0x59da2d,_0x15323b[_0x55b5('0x52')]),{'include':_0x15323b[_0x55b5('0x3d')][_0x55b5('0x4c')]?[{'all':!![]}]:undefined})[_0x55b5('0x2a')](function(_0x374c57){var _0x578514=_0x15323b[_0x55b5('0x5d')][_0x55b5('0x2b')]({'plain':!![]});if(!_0x578514)throw new Error(_0x55b5('0x53'));if(_0x578514[_0x55b5('0x54')]===_0x55b5('0x5d')){var _0x529e09=_0x374c57[_0x55b5('0x2b')]({'plain':!![]});var _0x1b602f=[{'name':_0x55b5('0x55'),'value':_0x55b5('0x2c')},{'name':_0x55b5('0x2d'),'value':_0x55b5('0x2e')}];var _0x5eca85=_[_0x55b5('0x34')](_0x1b602f,['value',_0x529e09[_0x55b5('0x35')]])['name'];return db[_0x55b5('0x5e')][_0x55b5('0x34')]({'where':{'name':_0x5eca85,'userProfileId':_0x578514[_0x55b5('0x5f')]},'raw':!![]})[_0x55b5('0x2a')](function(_0x343344){if(_0x343344&&_0x343344[_0x55b5('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x529e09[_0x55b5('0x38')],'resourceId':_0x529e09['id'],'type':_0x343344[_0x55b5('0x38')],'sectionId':_0x343344['id']},{})['then'](function(){return _0x374c57;});}else{return _0x374c57;}})['catch'](function(_0x202387){logger['error'](_0x55b5('0x58'),_0x202387);throw _0x202387;});}return _0x374c57;});}})['then'](respondWithResult(_0x14ec7c,0xc9))['catch'](handleError(_0x14ec7c,null));};exports[_0x55b5('0x28')]=function(_0x3a5e83,_0x425e05){if(_0x3a5e83[_0x55b5('0x52')]['id']){delete _0x3a5e83['body']['id'];}return db[_0x55b5('0x39')]['find']({'where':{'id':_0x3a5e83[_0x55b5('0x59')]['id']}})[_0x55b5('0x2a')](handleEntityNotFound(_0x425e05,null))[_0x55b5('0x2a')](saveUpdates(_0x3a5e83['body'],null))[_0x55b5('0x2a')](respondWithResult(_0x425e05,null))[_0x55b5('0x4e')](handleError(_0x425e05,null));};exports[_0x55b5('0x29')]=function(_0x4a63bc,_0x4a4ad6){return db['VoiceQueue']['find']({'where':{'id':_0x4a63bc[_0x55b5('0x59')]['id']}})[_0x55b5('0x2a')](handleEntityNotFound(_0x4a4ad6,null))[_0x55b5('0x2a')](removeEntity(_0x4a4ad6,null))[_0x55b5('0x4e')](handleError(_0x4a4ad6,null));};exports[_0x55b5('0x60')]=function(_0x1a66f3,_0x46a183,_0x155394){var _0x1bc482={'raw':![],'where':{}};var _0x425330={};var _0x1a3146={'count':0x0,'rows':[]};return db[_0x55b5('0x39')]['findOne']({'where':{'id':_0x1a66f3[_0x55b5('0x59')]['id']}})[_0x55b5('0x2a')](handleEntityNotFound(_0x46a183,null))['then'](function(_0x1a73c7){if(_0x1a73c7){_0x425330[_0x55b5('0x41')]=_['keys'](db['CmHopper'][_0x55b5('0x3a')]);_0x425330[_0x55b5('0x3d')]=_[_0x55b5('0x3e')](_0x1a66f3[_0x55b5('0x3d')]);_0x425330[_0x55b5('0x3f')]=_[_0x55b5('0x40')](_0x425330[_0x55b5('0x41')],_0x425330[_0x55b5('0x3d')]);_0x1bc482[_0x55b5('0x43')]=_[_0x55b5('0x40')](_0x425330[_0x55b5('0x41')],qs[_0x55b5('0x42')](_0x1a66f3['query']['fields']));_0x1bc482[_0x55b5('0x43')]=_0x1bc482[_0x55b5('0x43')]['length']?_0x1bc482['attributes']:_0x425330['model'];if(!_0x1a66f3['query']['hasOwnProperty']('nolimit')){_0x1bc482[_0x55b5('0x20')]=qs[_0x55b5('0x20')](_0x1a66f3['query'][_0x55b5('0x20')]);_0x1bc482[_0x55b5('0x1f')]=qs[_0x55b5('0x1f')](_0x1a66f3[_0x55b5('0x3d')]['offset']);}_0x1bc482[_0x55b5('0x47')]=qs[_0x55b5('0x48')](_0x1a66f3[_0x55b5('0x3d')][_0x55b5('0x48')]);_0x1bc482['where']=qs[_0x55b5('0x3f')](_[_0x55b5('0x4a')](_0x1a66f3[_0x55b5('0x3d')],_0x425330[_0x55b5('0x3f')]));_0x1bc482['where']['VoiceQueueId']=_0x1a73c7['id'];if(_0x1a66f3['query']['filter']){_0x1bc482[_0x55b5('0x49')]=_[_0x55b5('0x4b')](_0x1bc482[_0x55b5('0x49')],{'$or':_['map'](_0x1bc482[_0x55b5('0x43')],function(_0x14cc29){var _0x2dda67={};_0x2dda67[_0x14cc29]={'$like':'%'+_0x1a66f3['query'][_0x55b5('0x2f')]+'%'};return _0x2dda67;})});}_0x1bc482=_['merge']({},_0x1bc482,_0x1a66f3[_0x55b5('0x50')]);return db[_0x55b5('0x61')][_0x55b5('0x22')]({'where':_0x1bc482[_0x55b5('0x49')]})[_0x55b5('0x2a')](function(_0x5b8576){_0x1a3146[_0x55b5('0x22')]=_0x5b8576;if(_0x1a66f3[_0x55b5('0x3d')][_0x55b5('0x4c')]){_0x1bc482[_0x55b5('0x4d')]=[{'all':!![]}];}return db['CmHopper'][_0x55b5('0x62')](_0x1bc482);})[_0x55b5('0x2a')](function(_0x285a63){_0x1a3146[_0x55b5('0x63')]=_0x285a63;return _0x1a3146;});}})[_0x55b5('0x2a')](respondWithFilteredResult(_0x46a183,_0x1bc482))['catch'](handleError(_0x46a183,null));};exports[_0x55b5('0x64')]=function(_0x384c6e,_0x5bffd5,_0xfc50ff){var _0x4e1559={'raw':!![],'where':{}};var _0x349e12={};var _0x374c2f={'count':0x0,'rows':[]};return db[_0x55b5('0x39')][_0x55b5('0x65')]({'where':{'id':_0x384c6e[_0x55b5('0x59')]['id']}})[_0x55b5('0x2a')](handleEntityNotFound(_0x5bffd5,null))['then'](function(_0x510441){if(_0x510441){_0x349e12[_0x55b5('0x41')]=_[_0x55b5('0x3e')](db['CmHopperHistory'][_0x55b5('0x3a')]);_0x349e12[_0x55b5('0x3d')]=_[_0x55b5('0x3e')](_0x384c6e[_0x55b5('0x3d')]);_0x349e12[_0x55b5('0x3f')]=_[_0x55b5('0x40')](_0x349e12[_0x55b5('0x41')],_0x349e12[_0x55b5('0x3d')]);_0x4e1559[_0x55b5('0x43')]=_['intersection'](_0x349e12[_0x55b5('0x41')],qs['fields'](_0x384c6e['query'][_0x55b5('0x42')]));_0x4e1559[_0x55b5('0x43')]=_0x4e1559[_0x55b5('0x43')]['length']?_0x4e1559[_0x55b5('0x43')]:_0x349e12[_0x55b5('0x41')];if(!_0x384c6e[_0x55b5('0x3d')]['hasOwnProperty'](_0x55b5('0x46'))){_0x4e1559[_0x55b5('0x20')]=qs['limit'](_0x384c6e['query'][_0x55b5('0x20')]);_0x4e1559[_0x55b5('0x1f')]=qs[_0x55b5('0x1f')](_0x384c6e[_0x55b5('0x3d')][_0x55b5('0x1f')]);}_0x4e1559['order']=qs['sort'](_0x384c6e[_0x55b5('0x3d')]['sort']);_0x4e1559[_0x55b5('0x49')]=qs[_0x55b5('0x3f')](_[_0x55b5('0x4a')](_0x384c6e[_0x55b5('0x3d')],_0x349e12[_0x55b5('0x3f')]));_0x4e1559[_0x55b5('0x49')]['VoiceQueueId']=_0x510441['id'];if(_0x384c6e[_0x55b5('0x3d')][_0x55b5('0x2f')]){_0x4e1559[_0x55b5('0x49')]=_['merge'](_0x4e1559[_0x55b5('0x49')],{'$or':_['map'](_0x4e1559[_0x55b5('0x43')],function(_0x3b0f76){var _0x2b72fb={};_0x2b72fb[_0x3b0f76]={'$like':'%'+_0x384c6e['query'][_0x55b5('0x2f')]+'%'};return _0x2b72fb;})});}_0x4e1559=_[_0x55b5('0x4b')]({},_0x4e1559,_0x384c6e[_0x55b5('0x50')]);return db[_0x55b5('0x66')][_0x55b5('0x22')]({'where':_0x4e1559[_0x55b5('0x49')]})[_0x55b5('0x2a')](function(_0x5c2b43){_0x374c2f[_0x55b5('0x22')]=_0x5c2b43;if(_0x384c6e[_0x55b5('0x3d')][_0x55b5('0x4c')]){_0x4e1559[_0x55b5('0x4d')]=[{'all':!![]}];}return db[_0x55b5('0x66')][_0x55b5('0x62')](_0x4e1559);})[_0x55b5('0x2a')](function(_0x51cf53){_0x374c2f[_0x55b5('0x63')]=_0x51cf53;return _0x374c2f;});}})[_0x55b5('0x2a')](respondWithFilteredResult(_0x5bffd5,_0x4e1559))[_0x55b5('0x4e')](handleError(_0x5bffd5,null));};exports['getHopperFinals']=function(_0x5c5977,_0x245c42,_0x40769f){var _0x40028c={'raw':!![],'where':{}};var _0xe6c2e6={};var _0x4d07db={'count':0x0,'rows':[]};return db[_0x55b5('0x39')][_0x55b5('0x65')]({'where':{'id':_0x5c5977[_0x55b5('0x59')]['id']}})[_0x55b5('0x2a')](handleEntityNotFound(_0x245c42,null))[_0x55b5('0x2a')](function(_0xbc65b2){if(_0xbc65b2){_0xe6c2e6[_0x55b5('0x41')]=_['keys'](db[_0x55b5('0x67')]['rawAttributes']);_0xe6c2e6[_0x55b5('0x3d')]=_[_0x55b5('0x3e')](_0x5c5977[_0x55b5('0x3d')]);_0xe6c2e6[_0x55b5('0x3f')]=_[_0x55b5('0x40')](_0xe6c2e6['model'],_0xe6c2e6[_0x55b5('0x3d')]);_0x40028c[_0x55b5('0x43')]=_[_0x55b5('0x40')](_0xe6c2e6[_0x55b5('0x41')],qs['fields'](_0x5c5977[_0x55b5('0x3d')][_0x55b5('0x42')]));_0x40028c[_0x55b5('0x43')]=_0x40028c[_0x55b5('0x43')][_0x55b5('0x44')]?_0x40028c[_0x55b5('0x43')]:_0xe6c2e6['model'];if(!_0x5c5977[_0x55b5('0x3d')][_0x55b5('0x45')](_0x55b5('0x46'))){_0x40028c[_0x55b5('0x20')]=qs[_0x55b5('0x20')](_0x5c5977['query'][_0x55b5('0x20')]);_0x40028c[_0x55b5('0x1f')]=qs['offset'](_0x5c5977[_0x55b5('0x3d')][_0x55b5('0x1f')]);}_0x40028c[_0x55b5('0x47')]=qs[_0x55b5('0x48')](_0x5c5977['query'][_0x55b5('0x48')]);_0x40028c[_0x55b5('0x49')]=qs['filters'](_['pick'](_0x5c5977['query'],_0xe6c2e6[_0x55b5('0x3f')]));_0x40028c[_0x55b5('0x49')][_0x55b5('0x68')]=_0xbc65b2['id'];if(_0x5c5977[_0x55b5('0x3d')][_0x55b5('0x2f')]){_0x40028c[_0x55b5('0x49')]=_[_0x55b5('0x4b')](_0x40028c[_0x55b5('0x49')],{'$or':_[_0x55b5('0x31')](_0x40028c[_0x55b5('0x43')],function(_0xc7cc98){var _0x8255b1={};_0x8255b1[_0xc7cc98]={'$like':'%'+_0x5c5977['query'][_0x55b5('0x2f')]+'%'};return _0x8255b1;})});}_0x40028c=_[_0x55b5('0x4b')]({},_0x40028c,_0x5c5977['options']);return db[_0x55b5('0x67')][_0x55b5('0x22')]({'where':_0x40028c[_0x55b5('0x49')]})['then'](function(_0x306cf9){_0x4d07db[_0x55b5('0x22')]=_0x306cf9;if(_0x5c5977[_0x55b5('0x3d')][_0x55b5('0x4c')]){_0x40028c['include']=[{'all':!![]}];}return db[_0x55b5('0x67')][_0x55b5('0x62')](_0x40028c);})[_0x55b5('0x2a')](function(_0x29da56){_0x4d07db['rows']=_0x29da56;return _0x4d07db;});}})[_0x55b5('0x2a')](respondWithFilteredResult(_0x245c42,_0x40028c))[_0x55b5('0x4e')](handleError(_0x245c42,null));};exports[_0x55b5('0x69')]=function(_0x3ac6cc,_0x5f472f,_0x3815ab){var _0x18680f={'raw':!![],'where':{}};var _0x1f3609={};var _0x2a20e6={'count':0x0,'rows':[]};return db[_0x55b5('0x39')]['findOne']({'where':{'id':_0x3ac6cc[_0x55b5('0x59')]['id']}})[_0x55b5('0x2a')](handleEntityNotFound(_0x5f472f,null))['then'](function(_0x54ca47){if(_0x54ca47){_0x1f3609[_0x55b5('0x41')]=_[_0x55b5('0x3e')](db['CmHopperBlack']['rawAttributes']);_0x1f3609[_0x55b5('0x3d')]=_[_0x55b5('0x3e')](_0x3ac6cc['query']);_0x1f3609[_0x55b5('0x3f')]=_[_0x55b5('0x40')](_0x1f3609[_0x55b5('0x41')],_0x1f3609['query']);_0x18680f[_0x55b5('0x43')]=_[_0x55b5('0x40')](_0x1f3609[_0x55b5('0x41')],qs['fields'](_0x3ac6cc[_0x55b5('0x3d')]['fields']));_0x18680f[_0x55b5('0x43')]=_0x18680f['attributes'][_0x55b5('0x44')]?_0x18680f[_0x55b5('0x43')]:_0x1f3609[_0x55b5('0x41')];if(!_0x3ac6cc[_0x55b5('0x3d')][_0x55b5('0x45')]('nolimit')){_0x18680f[_0x55b5('0x20')]=qs[_0x55b5('0x20')](_0x3ac6cc[_0x55b5('0x3d')][_0x55b5('0x20')]);_0x18680f[_0x55b5('0x1f')]=qs[_0x55b5('0x1f')](_0x3ac6cc[_0x55b5('0x3d')]['offset']);}_0x18680f['order']=qs[_0x55b5('0x48')](_0x3ac6cc[_0x55b5('0x3d')][_0x55b5('0x48')]);_0x18680f[_0x55b5('0x49')]=qs[_0x55b5('0x3f')](_['pick'](_0x3ac6cc[_0x55b5('0x3d')],_0x1f3609[_0x55b5('0x3f')]));_0x18680f[_0x55b5('0x49')][_0x55b5('0x68')]=_0x54ca47['id'];if(_0x3ac6cc[_0x55b5('0x3d')][_0x55b5('0x2f')]){_0x18680f[_0x55b5('0x49')]=_[_0x55b5('0x4b')](_0x18680f[_0x55b5('0x49')],{'$or':_[_0x55b5('0x31')](_0x18680f[_0x55b5('0x43')],function(_0x386164){var _0x38b2f4={};_0x38b2f4[_0x386164]={'$like':'%'+_0x3ac6cc[_0x55b5('0x3d')][_0x55b5('0x2f')]+'%'};return _0x38b2f4;})});}_0x18680f=_['merge']({},_0x18680f,_0x3ac6cc[_0x55b5('0x50')]);return db[_0x55b5('0x6a')][_0x55b5('0x22')]({'where':_0x18680f[_0x55b5('0x49')]})[_0x55b5('0x2a')](function(_0x55a015){_0x2a20e6[_0x55b5('0x22')]=_0x55a015;if(_0x3ac6cc[_0x55b5('0x3d')]['includeAll']){_0x18680f[_0x55b5('0x4d')]=[{'all':!![]}];}return db[_0x55b5('0x6a')]['findAll'](_0x18680f);})[_0x55b5('0x2a')](function(_0x2ca335){_0x2a20e6['rows']=_0x2ca335;return _0x2a20e6;});}})[_0x55b5('0x2a')](respondWithFilteredResult(_0x5f472f,_0x18680f))[_0x55b5('0x4e')](handleError(_0x5f472f,null));};exports[_0x55b5('0x6b')]=function(_0x3fcaca,_0x2134e2,_0xea2326){var _0x438b91={};var _0x5ce459={};var _0x6195f6;var _0xcc2f0b;return db[_0x55b5('0x39')]['findOne']({'where':{'id':_0x3fcaca[_0x55b5('0x59')]['id']}})['then'](handleEntityNotFound(_0x2134e2,null))['then'](function(_0x4d87cb){if(_0x4d87cb){_0x6195f6=_0x4d87cb;_0x5ce459[_0x55b5('0x41')]=_[_0x55b5('0x3e')](db[_0x55b5('0x6c')]['rawAttributes']);_0x5ce459[_0x55b5('0x3d')]=_['keys'](_0x3fcaca[_0x55b5('0x3d')]);_0x5ce459[_0x55b5('0x3f')]=_[_0x55b5('0x40')](_0x5ce459['model'],_0x5ce459[_0x55b5('0x3d')]);_0x438b91[_0x55b5('0x43')]=_['intersection'](_0x5ce459[_0x55b5('0x41')],qs['fields'](_0x3fcaca[_0x55b5('0x3d')][_0x55b5('0x42')]));_0x438b91[_0x55b5('0x43')]=_0x438b91[_0x55b5('0x43')][_0x55b5('0x44')]?_0x438b91[_0x55b5('0x43')]:_0x5ce459[_0x55b5('0x41')];_0x438b91[_0x55b5('0x47')]=qs['sort'](_0x3fcaca['query'][_0x55b5('0x48')]);_0x438b91[_0x55b5('0x49')]=qs['filters'](_[_0x55b5('0x4a')](_0x3fcaca[_0x55b5('0x3d')],_0x5ce459[_0x55b5('0x3f')]));if(_0x3fcaca['query'][_0x55b5('0x2f')]){_0x438b91[_0x55b5('0x49')]=_[_0x55b5('0x4b')](_0x438b91['where'],{'$or':_[_0x55b5('0x31')](_0x438b91[_0x55b5('0x43')],function(_0x38477c){var _0x4ef365={};_0x4ef365[_0x38477c]={'$like':'%'+_0x3fcaca['query'][_0x55b5('0x2f')]+'%'};return _0x4ef365;})});}_0x438b91=_[_0x55b5('0x4b')]({},_0x438b91,_0x3fcaca[_0x55b5('0x50')]);return _0x6195f6[_0x55b5('0x6b')](_0x438b91);}})[_0x55b5('0x2a')](function(_0x2b9b08){if(_0x2b9b08){_0xcc2f0b=_0x2b9b08[_0x55b5('0x44')];if(!_0x3fcaca[_0x55b5('0x3d')][_0x55b5('0x45')](_0x55b5('0x46'))){_0x438b91['limit']=qs['limit'](_0x3fcaca[_0x55b5('0x3d')][_0x55b5('0x20')]);_0x438b91[_0x55b5('0x1f')]=qs['offset'](_0x3fcaca[_0x55b5('0x3d')][_0x55b5('0x1f')]);}return _0x6195f6[_0x55b5('0x6b')](_0x438b91);}})[_0x55b5('0x2a')](function(_0x596559){if(_0x596559){return _0x596559?{'count':_0xcc2f0b,'rows':_0x596559}:null;}})[_0x55b5('0x2a')](respondWithResult(_0x2134e2,null))['catch'](handleError(_0x2134e2,null));};exports[_0x55b5('0x6d')]=function(_0x3d38b8,_0x148c97,_0x9d18cc){var _0x57115a=_0x3d38b8[_0x55b5('0x52')]['teams'];var _0x536e95=_[_0x55b5('0x31')](_0x57115a,'id');return db['Team'][_0x55b5('0x62')]({'where':{'id':_0x536e95},'attributes':['id'],'include':[{'model':db[_0x55b5('0x6e')],'as':'Agents','attributes':['id',_0x55b5('0x38'),_0x55b5('0x6f'),'voicePause',_0x55b5('0x70')],'raw':!![]}]})[_0x55b5('0x2a')](function(_0x119210){if(_0x119210){var _0x36551f=_[_0x55b5('0x71')](_0x119210,function(_0x1ebe67){var _0x4b2393=_0x1ebe67[_0x55b5('0x2b')]({'plain':!![]});_0x4b2393[_0x55b5('0x72')][_0x55b5('0x73')](function(_0x2f616a){_0x2f616a['penalty']=_[_0x55b5('0x34')](_0x57115a,{'id':_0x4b2393['id']})[_0x55b5('0x74')];});return _0x4b2393[_0x55b5('0x72')];});return db['VoiceQueue'][_0x55b5('0x34')]({'where':{'id':_0x3d38b8[_0x55b5('0x59')]['id']}})[_0x55b5('0x2a')](function(_0x67917b){return db[_0x55b5('0x75')][_0x55b5('0x76')](function(_0x4bd08a){return _0x67917b['addTeams'](_0x536e95,{'transaction':_0x4bd08a})[_0x55b5('0x2a')](function(){return BPromise[_0x55b5('0x77')](_0x57115a,function(_0x14ccc6){return db[_0x55b5('0x78')][_0x55b5('0x79')]({'TeamId':_0x14ccc6['id'],'VoiceQueueId':_0x3d38b8[_0x55b5('0x59')]['id'],'penalty':_0x14ccc6[_0x55b5('0x74')]},{'transaction':_0x4bd08a});});})[_0x55b5('0x2a')](function(){return BPromise[_0x55b5('0x77')](_0x36551f,function(_0x217f64){return db[_0x55b5('0x7a')][_0x55b5('0x7b')]({'where':{'UserId':_0x217f64['id'],'VoiceQueueId':_0x3d38b8[_0x55b5('0x59')]['id']},'defaults':{'penalty':_0x217f64['penalty']},'transaction':_0x4bd08a});});})['then'](function(){return BPromise[_0x55b5('0x77')](_[_0x55b5('0x2f')](_0x36551f,{'online':!![]}),function(_0x45f307){return db[_0x55b5('0x7c')][_0x55b5('0x79')]({'membername':_0x45f307[_0x55b5('0x38')],'UserId':_0x45f307['id'],'queue_name':_0x67917b[_0x55b5('0x38')],'VoiceQueueId':_0x67917b['id'],'interface':_[_0x55b5('0x7d')](_0x45f307[_0x55b5('0x70')])?util['format'](_0x55b5('0x7e'),_0x45f307['name']):_0x45f307[_0x55b5('0x70')],'paused':_0x45f307[_0x55b5('0x7f')]||![],'penalty':_0x45f307['penalty']},{'transaction':_0x4bd08a});});})[_0x55b5('0x2a')](function(){_0x36551f['forEach'](function(_0x324edd){socket[_0x55b5('0x80')](_0x55b5('0x81'),{'UserId':_0x324edd['id'],'VoiceQueueId':_0x67917b['id']});});});});});}})[_0x55b5('0x2a')](respondWithStatusCode(_0x148c97,null))[_0x55b5('0x4e')](handleError(_0x148c97,null));};exports[_0x55b5('0x82')]=function(_0x3f237c,_0x2d9a42,_0x1bee85){return db['Team'][_0x55b5('0x62')]({'where':{'id':_0x3f237c[_0x55b5('0x3d')][_0x55b5('0x83')]},'attributes':['id'],'include':[{'model':db[_0x55b5('0x6e')],'as':_0x55b5('0x72'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2d9a42,null))[_0x55b5('0x2a')](function(_0x4718d7){var _0x362748=_[_0x55b5('0x31')](_0x4718d7,'id');var _0xbbfa9e=[];var _0x2392b7=[];var _0x17103b=squel[_0x55b5('0x84')]();_0x17103b[_0x55b5('0x85')]('tq.TeamId')[_0x55b5('0x86')]('team_has_voice_queues','tq')[_0x55b5('0x87')](_0x55b5('0x88'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x55b5('0x49')](_0x55b5('0x89'),_0x3f237c['params']['id']);for(var _0x566bda=0x0;_0x566bda<_0x4718d7[_0x55b5('0x44')];_0x566bda+=0x1){let _0x25b8d2=_0x4718d7[_0x566bda];for(var _0x574538=0x0;_0x574538<_0x25b8d2[_0x55b5('0x72')]['length'];_0x574538+=0x1){let _0x3a1a35=_0x25b8d2[_0x55b5('0x72')][_0x574538];var _0x3dfeec=_0x17103b[_0x55b5('0x8a')]();_0x3dfeec['where'](_0x55b5('0x8b'),_0x3a1a35['id']);_0x2392b7[_0x55b5('0x8c')](db[_0x55b5('0x75')][_0x55b5('0x3d')](_0x3dfeec[_0x55b5('0x8d')](),{'type':db['sequelize'][_0x55b5('0x8e')][_0x55b5('0x8f')]})[_0x55b5('0x2a')](function(_0x219248){if(_0x219248[_0x55b5('0x44')]===0x1){return _0x3a1a35['id'];}else{var _0x2d72e9=_['every'](_['map'](_0x219248,_0x55b5('0x90')),function(_0x109a8b){return _[_0x55b5('0x33')](_0x362748,_0x109a8b);});if(_0x2d72e9){return _0x3a1a35['id'];}}}));}}return BPromise[_0x55b5('0x91')](_0x2392b7)[_0x55b5('0x2a')](function(_0x2fa6ff){_0xbbfa9e=_(_0xbbfa9e)['union'](_0x2fa6ff)[_0x55b5('0x92')]()[_0x55b5('0x32')]();return db[_0x55b5('0x39')][_0x55b5('0x34')]({'where':{'id':_0x3f237c[_0x55b5('0x59')]['id']}})[_0x55b5('0x2a')](function(_0x43b292){return db[_0x55b5('0x75')][_0x55b5('0x76')](function(_0xffd4d){return _0x43b292['removeTeams'](_0x3f237c['query'][_0x55b5('0x83')],{'transaction':_0xffd4d})[_0x55b5('0x2a')](function(){if(!_[_0x55b5('0x93')](_0xbbfa9e)){return _0x43b292[_0x55b5('0x94')](_0xbbfa9e,{'transaction':_0xffd4d})[_0x55b5('0x2a')](function(){return db[_0x55b5('0x7c')][_0x55b5('0x29')]({'where':{'VoiceQueueId':_0x3f237c[_0x55b5('0x59')]['id'],'UserId':_0xbbfa9e},'transaction':_0xffd4d});});}})['then'](function(){_0xbbfa9e[_0x55b5('0x73')](function(_0x7619e1){socket[_0x55b5('0x80')](_0x55b5('0x95'),{'UserId':_0x7619e1,'VoiceQueueId':_0x43b292['id']});});});});});});})[_0x55b5('0x2a')](respondWithStatusCode(_0x2d9a42,null))[_0x55b5('0x4e')](handleError(_0x2d9a42,null));};exports[_0x55b5('0x96')]=function(_0x78534b,_0x3f36cf,_0x2134b8){var _0x491ead,_0x162765;return db[_0x55b5('0x39')][_0x55b5('0x34')]({'where':{'id':_0x78534b[_0x55b5('0x59')]['id']}})[_0x55b5('0x2a')](handleEntityNotFound(_0x3f36cf,null))[_0x55b5('0x2a')](function(_0x41e65e){if(_0x41e65e){_0x162765=_0x41e65e;return _0x41e65e[_0x55b5('0x96')](_0x78534b['body'][_0x55b5('0x83')],_[_0x55b5('0x5c')](_0x78534b[_0x55b5('0x52')],[_0x55b5('0x83'),'id'])||{})[_0x55b5('0x97')](function(_0x217de6){for(var _0x567983=0x0;_0x567983<_0x78534b[_0x55b5('0x52')][_0x55b5('0x83')][_0x55b5('0x44')];_0x567983+=0x1){socket[_0x55b5('0x80')](_0x55b5('0x81'),{'UserId':Number(_0x78534b['body'][_0x55b5('0x83')][_0x567983]),'VoiceQueueId':Number(_0x78534b[_0x55b5('0x59')]['id'])});}return _0x217de6;});}})[_0x55b5('0x2a')](function(_0xb91170){_0x491ead=_0xb91170||[];if(_0x162765){return db[_0x55b5('0x6e')][_0x55b5('0x62')]({'where':{'id':_0x78534b[_0x55b5('0x52')][_0x55b5('0x83')]},'attributes':['id',_0x55b5('0x38'),'online',_0x55b5('0x7f'),_0x55b5('0x70')],'raw':!![]});}})[_0x55b5('0x2a')](function(_0x175492){if(!_[_0x55b5('0x93')](_0x175492)){var _0x111d65=[];for(var _0x1f06f3=0x0;_0x1f06f3<_0x175492[_0x55b5('0x44')];_0x1f06f3++){if(_0x175492[_0x1f06f3]['online']){_0x111d65[_0x55b5('0x8c')](db[_0x55b5('0x7c')][_0x55b5('0x79')]({'membername':_0x175492[_0x1f06f3][_0x55b5('0x38')],'UserId':_0x175492[_0x1f06f3]['id'],'queue_name':_0x162765[_0x55b5('0x38')],'VoiceQueueId':_0x162765['id'],'interface':_[_0x55b5('0x7d')](_0x175492[_0x1f06f3][_0x55b5('0x70')])?util[_0x55b5('0x98')](_0x55b5('0x7e'),_0x175492[_0x1f06f3][_0x55b5('0x38')]):_0x175492[_0x1f06f3]['interface'],'paused':_0x175492[_0x1f06f3][_0x55b5('0x7f')]||![],'penalty':_0x78534b[_0x55b5('0x52')][_0x55b5('0x74')]||0x0}));}}return BPromise[_0x55b5('0x91')](_0x111d65);}})['then'](function(){return _0x491ead;})[_0x55b5('0x2a')](respondWithResult(_0x3f36cf,null))[_0x55b5('0x4e')](handleError(_0x3f36cf,null));};exports[_0x55b5('0x94')]=function(_0x500736,_0x24925b,_0x722b65){return db[_0x55b5('0x39')]['find']({'where':{'id':_0x500736[_0x55b5('0x59')]['id']}})[_0x55b5('0x2a')](handleEntityNotFound(_0x24925b,null))[_0x55b5('0x2a')](function(_0x39fd2f){if(_0x39fd2f){return _0x39fd2f[_0x55b5('0x94')](_0x500736['query']['ids'])['then'](function(){if(_[_0x55b5('0x99')](_0x500736[_0x55b5('0x3d')][_0x55b5('0x83')])){for(var _0x4b8cbc=0x0;_0x4b8cbc<_0x500736['query'][_0x55b5('0x83')][_0x55b5('0x44')];_0x4b8cbc+=0x1){socket['emit'](_0x55b5('0x95'),{'UserId':Number(_0x500736[_0x55b5('0x3d')]['ids'][_0x4b8cbc]),'VoiceQueueId':Number(_0x500736['params']['id'])});}}else{socket[_0x55b5('0x80')](_0x55b5('0x95'),{'UserId':Number(_0x500736[_0x55b5('0x3d')]['ids']),'VoiceQueueId':Number(_0x500736[_0x55b5('0x59')]['id'])});}});}})[_0x55b5('0x2a')](function(_0x46bf51){return db[_0x55b5('0x7c')][_0x55b5('0x29')]({'where':{'VoiceQueueId':_0x500736[_0x55b5('0x59')]['id'],'UserId':_0x500736[_0x55b5('0x3d')][_0x55b5('0x83')]}})[_0x55b5('0x2a')](function(){return _0x46bf51;});})[_0x55b5('0x2a')](respondWithStatusCode(_0x24925b,null))[_0x55b5('0x4e')](handleError(_0x24925b,null));};exports[_0x55b5('0x9a')]=function(_0x29103f,_0x252bd3,_0x1d62b2){var _0x35b621={};var _0x170fd6={};var _0xeb4dfc;var _0x245619;return db[_0x55b5('0x39')][_0x55b5('0x65')]({'where':{'id':_0x29103f[_0x55b5('0x59')]['id']}})[_0x55b5('0x2a')](handleEntityNotFound(_0x252bd3,null))[_0x55b5('0x2a')](function(_0x9174ee){if(_0x9174ee){_0xeb4dfc=_0x9174ee;_0x170fd6['model']=_['keys'](db[_0x55b5('0x6e')][_0x55b5('0x3a')]);_0x170fd6[_0x55b5('0x3d')]=_[_0x55b5('0x3e')](_0x29103f[_0x55b5('0x3d')]);_0x170fd6[_0x55b5('0x3f')]=_[_0x55b5('0x40')](_0x170fd6[_0x55b5('0x41')],_0x170fd6['query']);_0x35b621[_0x55b5('0x43')]=_[_0x55b5('0x40')](_0x170fd6[_0x55b5('0x41')],qs[_0x55b5('0x42')](_0x29103f['query'][_0x55b5('0x42')]));_0x35b621[_0x55b5('0x43')]=_0x35b621['attributes'][_0x55b5('0x44')]?_0x35b621['attributes']:_0x170fd6[_0x55b5('0x41')];_0x35b621['order']=qs[_0x55b5('0x48')](_0x29103f[_0x55b5('0x3d')]['sort']);_0x35b621[_0x55b5('0x49')]=qs[_0x55b5('0x3f')](_[_0x55b5('0x4a')](_0x29103f['query'],_0x170fd6[_0x55b5('0x3f')]));if(_0x29103f[_0x55b5('0x3d')][_0x55b5('0x2f')]){_0x35b621[_0x55b5('0x49')]=_['merge'](_0x35b621[_0x55b5('0x49')],{'$or':_[_0x55b5('0x31')](_0x35b621[_0x55b5('0x43')],function(_0x3e49bc){var _0x42fc3f={};_0x42fc3f[_0x3e49bc]={'$like':'%'+_0x29103f[_0x55b5('0x3d')][_0x55b5('0x2f')]+'%'};return _0x42fc3f;})});}_0x35b621=_['merge']({},_0x35b621,_0x29103f['options']);return _0xeb4dfc['getAgents'](_0x35b621);}})[_0x55b5('0x2a')](function(_0x1910bd){if(_0x1910bd){_0x245619=_0x1910bd[_0x55b5('0x44')];if(!_0x29103f[_0x55b5('0x3d')][_0x55b5('0x45')](_0x55b5('0x46'))){_0x35b621[_0x55b5('0x20')]=qs['limit'](_0x29103f[_0x55b5('0x3d')][_0x55b5('0x20')]);_0x35b621['offset']=qs[_0x55b5('0x1f')](_0x29103f[_0x55b5('0x3d')]['offset']);}return _0xeb4dfc[_0x55b5('0x9a')](_0x35b621);}})['then'](function(_0x27e799){if(_0x27e799){return _0x27e799?{'count':_0x245619,'rows':_0x27e799}:null;}})[_0x55b5('0x2a')](respondWithResult(_0x252bd3,null))[_0x55b5('0x4e')](handleError(_0x252bd3,null));};exports[_0x55b5('0x9b')]=function(_0x4a959c,_0x23fa65,_0x184514){var _0x7c3108={};var _0x3cfdeb={};var _0x3a9163;var _0x54b942;return db[_0x55b5('0x39')]['findOne']({'where':{'id':_0x4a959c['params']['id']}})[_0x55b5('0x2a')](handleEntityNotFound(_0x23fa65,null))[_0x55b5('0x2a')](function(_0x375989){if(_0x375989){_0x3a9163=_0x375989;_0x3cfdeb[_0x55b5('0x41')]=_['keys'](db['UserVoiceQueueRt'][_0x55b5('0x3a')]);_0x3cfdeb[_0x55b5('0x3d')]=_[_0x55b5('0x3e')](_0x4a959c[_0x55b5('0x3d')]);_0x3cfdeb[_0x55b5('0x3f')]=_[_0x55b5('0x40')](_0x3cfdeb['model'],_0x3cfdeb['query']);_0x7c3108[_0x55b5('0x43')]=_['intersection'](_0x3cfdeb[_0x55b5('0x41')],qs['fields'](_0x4a959c[_0x55b5('0x3d')][_0x55b5('0x42')]));_0x7c3108[_0x55b5('0x43')]=_0x7c3108[_0x55b5('0x43')]['length']?_0x7c3108[_0x55b5('0x43')]:_0x3cfdeb[_0x55b5('0x41')];_0x7c3108[_0x55b5('0x47')]=qs[_0x55b5('0x48')](_0x4a959c[_0x55b5('0x3d')][_0x55b5('0x48')]);_0x7c3108[_0x55b5('0x49')]=qs['filters'](_[_0x55b5('0x4a')](_0x4a959c['query'],_0x3cfdeb[_0x55b5('0x3f')]));if(_0x4a959c[_0x55b5('0x3d')]['filter']){_0x7c3108[_0x55b5('0x49')]=_[_0x55b5('0x4b')](_0x7c3108['where'],{'$or':_[_0x55b5('0x31')](_0x7c3108[_0x55b5('0x43')],function(_0x245254){var _0x2cb78f={};_0x2cb78f[_0x245254]={'$like':'%'+_0x4a959c[_0x55b5('0x3d')][_0x55b5('0x2f')]+'%'};return _0x2cb78f;})});}_0x7c3108=_[_0x55b5('0x4b')]({},_0x7c3108,_0x4a959c[_0x55b5('0x50')]);return _0x3a9163[_0x55b5('0x9b')](_0x7c3108);}})[_0x55b5('0x2a')](function(_0x25fab5){if(_0x25fab5){_0x54b942=_0x25fab5['length'];if(!_0x4a959c[_0x55b5('0x3d')][_0x55b5('0x45')](_0x55b5('0x46'))){_0x7c3108[_0x55b5('0x20')]=qs['limit'](_0x4a959c[_0x55b5('0x3d')][_0x55b5('0x20')]);_0x7c3108[_0x55b5('0x1f')]=qs[_0x55b5('0x1f')](_0x4a959c[_0x55b5('0x3d')][_0x55b5('0x1f')]);}return _0x3a9163[_0x55b5('0x9b')](_0x7c3108);}})[_0x55b5('0x2a')](function(_0x263688){return _0x263688?{'count':_0x54b942,'rows':_0x263688}:null;})[_0x55b5('0x2a')](respondWithResult(_0x23fa65,null))['catch'](handleError(_0x23fa65,null));};exports[_0x55b5('0x9c')]=function(_0x2e6924,_0x481e21,_0x2193ad){var _0x166cf3={};var _0x4631e5={};var _0x2b9e66;var _0x297e15;return db['VoiceQueue'][_0x55b5('0x65')]({'where':{'id':_0x2e6924[_0x55b5('0x59')]['id']}})[_0x55b5('0x2a')](handleEntityNotFound(_0x481e21,null))[_0x55b5('0x2a')](function(_0x37ea57){if(_0x37ea57){_0x2b9e66=_0x37ea57;_0x4631e5[_0x55b5('0x41')]=_['keys'](db[_0x55b5('0x9d')][_0x55b5('0x3a')]);_0x4631e5[_0x55b5('0x3d')]=_[_0x55b5('0x3e')](_0x2e6924[_0x55b5('0x3d')]);_0x4631e5[_0x55b5('0x3f')]=_[_0x55b5('0x40')](_0x4631e5[_0x55b5('0x41')],_0x4631e5[_0x55b5('0x3d')]);_0x166cf3[_0x55b5('0x43')]=_[_0x55b5('0x40')](_0x4631e5['model'],qs['fields'](_0x2e6924[_0x55b5('0x3d')][_0x55b5('0x42')]));_0x166cf3[_0x55b5('0x43')]=_0x166cf3[_0x55b5('0x43')][_0x55b5('0x44')]?_0x166cf3['attributes']:_0x4631e5['model'];_0x166cf3[_0x55b5('0x47')]=qs[_0x55b5('0x48')](_0x2e6924[_0x55b5('0x3d')][_0x55b5('0x48')]);_0x166cf3[_0x55b5('0x49')]=qs[_0x55b5('0x3f')](_[_0x55b5('0x4a')](_0x2e6924['query'],_0x4631e5[_0x55b5('0x3f')]));if(_0x2e6924[_0x55b5('0x3d')]['filter']){_0x166cf3[_0x55b5('0x49')]=_['merge'](_0x166cf3[_0x55b5('0x49')],{'$or':_[_0x55b5('0x31')](_0x166cf3[_0x55b5('0x43')],function(_0x19921b){var _0x31ff7e={};_0x31ff7e[_0x19921b]={'$like':'%'+_0x2e6924['query'][_0x55b5('0x2f')]+'%'};return _0x31ff7e;})});}_0x166cf3=_[_0x55b5('0x4b')]({},_0x166cf3,_0x2e6924[_0x55b5('0x50')]);return _0x2b9e66[_0x55b5('0x9c')](_0x166cf3);}})[_0x55b5('0x2a')](function(_0x2d6e5d){if(_0x2d6e5d){_0x297e15=_0x2d6e5d[_0x55b5('0x44')];if(!_0x2e6924[_0x55b5('0x3d')][_0x55b5('0x45')](_0x55b5('0x46'))){_0x166cf3[_0x55b5('0x20')]=qs[_0x55b5('0x20')](_0x2e6924[_0x55b5('0x3d')][_0x55b5('0x20')]);_0x166cf3['offset']=qs[_0x55b5('0x1f')](_0x2e6924[_0x55b5('0x3d')][_0x55b5('0x1f')]);}return _0x2b9e66['getLists'](_0x166cf3);}})['then'](function(_0x20b0b1){if(_0x20b0b1){return _0x20b0b1?{'count':_0x297e15,'rows':_0x20b0b1}:null;}})[_0x55b5('0x2a')](respondWithResult(_0x481e21,null))[_0x55b5('0x4e')](handleError(_0x481e21,null));};exports['addLists']=function(_0x499ed8,_0xf2d388,_0x50ed70){var _0xe80150,_0x47450d;return db['VoiceQueue'][_0x55b5('0x34')]({'where':{'id':_0x499ed8[_0x55b5('0x59')]['id']}})['then'](handleEntityNotFound(_0xf2d388,null))['then'](function(_0x976fdb){if(_0x976fdb){_0x47450d=_0x976fdb;return _0x976fdb['addLists'](_0x499ed8[_0x55b5('0x52')][_0x55b5('0x83')],_[_0x55b5('0x5c')](_0x499ed8[_0x55b5('0x52')],[_0x55b5('0x83'),'id'])||{});}return null;})[_0x55b5('0x97')](function(_0x431fcf){var _0xb79281;_0xe80150=_0x431fcf||[];var _0x3f7ae8=[];if(_0x431fcf){for(var _0x30ccea=0x0;_0x30ccea<_0x431fcf[_0x55b5('0x44')];_0x30ccea+=0x1){var _0x4ef487=_0x431fcf[_0x30ccea][_0x55b5('0x2b')]({'plain':!![]});_0x47450d[_0x55b5('0x9e')]=_0x499ed8[_0x55b5('0x52')][_0x55b5('0x9e')]?_0x499ed8['body'][_0x55b5('0x9e')]:_0x47450d['dialCheckDuplicateType'];switch(_0x47450d[_0x55b5('0x9e')]){case _0x55b5('0x9f'):_0xb79281=squel[_0x55b5('0xa0')]()[_0x55b5('0xa1')](_0x55b5('0xa2'))[_0x55b5('0xa3')](['phone',_0x55b5('0xa4'),'ContactId','ListId',_0x55b5('0x68'),_0x55b5('0x5a'),_0x55b5('0x5b')],squel[_0x55b5('0x84')]()['field']('phone',_0x55b5('0xa5'))['field'](_0x55b5('0xa6'),'scheduledAt')['field']('id','ContactId')[_0x55b5('0x85')](_0x4ef487[_0x55b5('0xa7')][_0x55b5('0x8d')](),_0x55b5('0xa8'))[_0x55b5('0x85')](_0x499ed8['params']['id'][_0x55b5('0x8d')](),'VoiceQueueId')[_0x55b5('0x85')](_0x55b5('0xa6'),_0x55b5('0x5a'))[_0x55b5('0x85')](_0x55b5('0xa6'),_0x55b5('0x5b'))[_0x55b5('0x86')](_0x55b5('0xa9'))[_0x55b5('0x49')](_0x55b5('0xaa'))[_0x55b5('0x49')]('ListId\x20=\x20?',_0x4ef487[_0x55b5('0xa7')][_0x55b5('0x8d')]())[_0x55b5('0x49')](_0x55b5('0xab'))[_0x55b5('0x49')]('phone\x20NOT\x20IN\x20(?)',squel[_0x55b5('0x84')]()[_0x55b5('0x85')]('COALESCE(calleridnum,\x27\x27)')[_0x55b5('0x86')](_0x55b5('0xac'))['where']('VoiceQueueId\x20=\x20?',_0x499ed8[_0x55b5('0x59')]['id'][_0x55b5('0x8d')]()))[_0x55b5('0x49')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x55b5('0x85')](_0x55b5('0xad'))[_0x55b5('0x86')](_0x55b5('0xa2'))[_0x55b5('0x49')]('VoiceQueueId\x20=\x20?',_0x499ed8[_0x55b5('0x59')]['id'][_0x55b5('0x8d')]())))[_0x55b5('0x8d')]();break;case _0x55b5('0xae'):_0xb79281=squel[_0x55b5('0xa0')]()[_0x55b5('0xa1')]('cm_hopper')[_0x55b5('0xa3')]([_0x55b5('0xa5'),_0x55b5('0xa4'),'ContactId','ListId',_0x55b5('0x68'),_0x55b5('0x5a'),'updatedAt'],squel[_0x55b5('0x84')]()[_0x55b5('0x85')](_0x55b5('0xa5'),_0x55b5('0xa5'))['field'](_0x55b5('0xa6'),_0x55b5('0xa4'))[_0x55b5('0x85')]('id',_0x55b5('0xaf'))[_0x55b5('0x85')](_0x4ef487[_0x55b5('0xa7')]['toString'](),'ListId')[_0x55b5('0x85')](_0x499ed8[_0x55b5('0x59')]['id'][_0x55b5('0x8d')](),'VoiceQueueId')[_0x55b5('0x85')](_0x55b5('0xa6'),'createdAt')['field'](_0x55b5('0xa6'),'updatedAt')[_0x55b5('0x86')]('cm_contacts')[_0x55b5('0x49')](_0x55b5('0xaa'))[_0x55b5('0x49')](_0x55b5('0xb0'),_0x4ef487[_0x55b5('0xa7')][_0x55b5('0x8d')]())[_0x55b5('0x49')]('phone\x20IS\x20NOT\x20NULL')[_0x55b5('0x49')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x55b5('0x85')](_0x55b5('0xad'))[_0x55b5('0x86')](_0x55b5('0xa2'))['where'](_0x55b5('0x89'),_0x499ed8[_0x55b5('0x59')]['id'][_0x55b5('0x8d')]())))[_0x55b5('0x8d')]();break;default:_0xb79281=squel['insert']()['into'](_0x55b5('0xa2'))[_0x55b5('0xa3')]([_0x55b5('0xa5'),'scheduledAt','ContactId',_0x55b5('0xa8'),_0x55b5('0x68'),'createdAt',_0x55b5('0x5b')],squel[_0x55b5('0x84')]()['field'](_0x55b5('0xa5'),_0x55b5('0xa5'))[_0x55b5('0x85')]('NOW()',_0x55b5('0xa4'))[_0x55b5('0x85')]('id',_0x55b5('0xaf'))[_0x55b5('0x85')](_0x4ef487['CmListId'][_0x55b5('0x8d')](),_0x55b5('0xa8'))[_0x55b5('0x85')](_0x499ed8[_0x55b5('0x59')]['id'][_0x55b5('0x8d')](),_0x55b5('0x68'))[_0x55b5('0x85')](_0x55b5('0xa6'),_0x55b5('0x5a'))['field'](_0x55b5('0xa6'),'updatedAt')[_0x55b5('0x86')](_0x55b5('0xa9'))[_0x55b5('0x49')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x4ef487[_0x55b5('0xa7')]['toString']())[_0x55b5('0x49')]('phone\x20IS\x20NOT\x20NULL'))[_0x55b5('0x8d')]();}_0x3f7ae8[_0x55b5('0x8c')](db[_0x55b5('0x75')][_0x55b5('0x3d')](_0xb79281));}return BPromise[_0x55b5('0x91')](_0x3f7ae8);}})[_0x55b5('0x2a')](function(){return _0xe80150;})['then'](respondWithResult(_0xf2d388,null))[_0x55b5('0x4e')](handleError(_0xf2d388,null));};exports['removeLists']=function(_0x57ab32,_0x20589c,_0x116ab2){return db[_0x55b5('0x39')][_0x55b5('0x34')]({'where':{'id':_0x57ab32[_0x55b5('0x59')]['id']}})[_0x55b5('0x2a')](handleEntityNotFound(_0x20589c,null))[_0x55b5('0x2a')](function(_0x225ba5){if(_0x225ba5){return _0x225ba5[_0x55b5('0xb1')](_0x57ab32[_0x55b5('0x3d')][_0x55b5('0x83')]);}})[_0x55b5('0x2a')](function(_0x5d744b){if(_0x5d744b){return db['CmHopper'][_0x55b5('0x29')]({'where':{'ListId':_0x57ab32[_0x55b5('0x3d')]['ids'],'VoiceQueueId':_0x57ab32[_0x55b5('0x59')]['id']}})[_0x55b5('0x2a')](function(){return _0x5d744b;});}})[_0x55b5('0x2a')](respondWithStatusCode(_0x20589c,null))[_0x55b5('0x4e')](handleError(_0x20589c,null));};exports['getBlackLists']=function(_0x315ae6,_0x50c197,_0x3e9852){var _0x36b97d={};var _0x1fb72a={};var _0x4fdd9e;var _0x91c7d3;return db[_0x55b5('0x39')][_0x55b5('0x65')]({'where':{'id':_0x315ae6['params']['id']}})[_0x55b5('0x2a')](handleEntityNotFound(_0x50c197,null))[_0x55b5('0x2a')](function(_0x1c65d1){if(_0x1c65d1){_0x4fdd9e=_0x1c65d1;_0x1fb72a[_0x55b5('0x41')]=_[_0x55b5('0x3e')](db[_0x55b5('0x9d')]['rawAttributes']);_0x1fb72a['query']=_[_0x55b5('0x3e')](_0x315ae6[_0x55b5('0x3d')]);_0x1fb72a[_0x55b5('0x3f')]=_[_0x55b5('0x40')](_0x1fb72a[_0x55b5('0x41')],_0x1fb72a[_0x55b5('0x3d')]);_0x36b97d[_0x55b5('0x43')]=_[_0x55b5('0x40')](_0x1fb72a['model'],qs[_0x55b5('0x42')](_0x315ae6[_0x55b5('0x3d')][_0x55b5('0x42')]));_0x36b97d[_0x55b5('0x43')]=_0x36b97d[_0x55b5('0x43')]['length']?_0x36b97d['attributes']:_0x1fb72a['model'];_0x36b97d[_0x55b5('0x47')]=qs[_0x55b5('0x48')](_0x315ae6[_0x55b5('0x3d')]['sort']);_0x36b97d[_0x55b5('0x49')]=qs[_0x55b5('0x3f')](_[_0x55b5('0x4a')](_0x315ae6['query'],_0x1fb72a['filters']));if(_0x315ae6[_0x55b5('0x3d')][_0x55b5('0x2f')]){_0x36b97d[_0x55b5('0x49')]=_['merge'](_0x36b97d['where'],{'$or':_[_0x55b5('0x31')](_0x36b97d[_0x55b5('0x43')],function(_0x426510){var _0x52b278={};_0x52b278[_0x426510]={'$like':'%'+_0x315ae6[_0x55b5('0x3d')]['filter']+'%'};return _0x52b278;})});}_0x36b97d=_[_0x55b5('0x4b')]({},_0x36b97d,_0x315ae6[_0x55b5('0x50')]);return _0x4fdd9e[_0x55b5('0xb2')](_0x36b97d);}})[_0x55b5('0x2a')](function(_0x5921ee){if(_0x5921ee){_0x91c7d3=_0x5921ee['length'];if(!_0x315ae6[_0x55b5('0x3d')][_0x55b5('0x45')](_0x55b5('0x46'))){_0x36b97d[_0x55b5('0x20')]=qs[_0x55b5('0x20')](_0x315ae6['query'][_0x55b5('0x20')]);_0x36b97d[_0x55b5('0x1f')]=qs[_0x55b5('0x1f')](_0x315ae6['query'][_0x55b5('0x1f')]);}return _0x4fdd9e[_0x55b5('0xb2')](_0x36b97d);}})[_0x55b5('0x2a')](function(_0x361b50){if(_0x361b50){return _0x361b50?{'count':_0x91c7d3,'rows':_0x361b50}:null;}})[_0x55b5('0x2a')](respondWithResult(_0x50c197,null))[_0x55b5('0x4e')](handleError(_0x50c197,null));};exports[_0x55b5('0xb3')]=function(_0x38b56c,_0x4519eb,_0x52110c){var _0x28e8fb,_0x1de179;return db[_0x55b5('0x39')]['find']({'where':{'id':_0x38b56c[_0x55b5('0x59')]['id']}})[_0x55b5('0x2a')](handleEntityNotFound(_0x4519eb,null))[_0x55b5('0x2a')](function(_0x5e1c85){if(_0x5e1c85){_0x1de179=_0x5e1c85;return _0x5e1c85[_0x55b5('0xb3')](_0x38b56c[_0x55b5('0x52')][_0x55b5('0x83')],_[_0x55b5('0x5c')](_0x38b56c['body'],[_0x55b5('0x83'),'id'])||{});}return null;})[_0x55b5('0x97')](function(_0x614022){var _0x50efc6;_0x28e8fb=_0x614022||[];var _0x3c3592=[];if(_0x614022){for(var _0x21c553=0x0;_0x21c553<_0x614022[_0x55b5('0x44')];_0x21c553+=0x1){var _0x2528b5=_0x614022[_0x21c553]['get']({'plain':!![]});_0x50efc6=squel[_0x55b5('0xa0')]()[_0x55b5('0xa1')](_0x55b5('0xb4'))[_0x55b5('0xa3')]([_0x55b5('0xa5'),_0x55b5('0xaf'),_0x55b5('0xa8'),_0x55b5('0x68'),_0x55b5('0x5a'),_0x55b5('0x5b')],squel[_0x55b5('0x84')]()[_0x55b5('0x85')](_0x55b5('0xa5'),'phone')['field']('id',_0x55b5('0xaf'))[_0x55b5('0x85')](_0x2528b5[_0x55b5('0xa7')]['toString'](),'ListId')[_0x55b5('0x85')](_0x38b56c[_0x55b5('0x59')]['id'][_0x55b5('0x8d')](),_0x55b5('0x68'))['field'](_0x55b5('0xa6'),'createdAt')[_0x55b5('0x85')]('NOW()',_0x55b5('0x5b'))[_0x55b5('0x86')](_0x55b5('0xa9'))[_0x55b5('0x49')](_0x55b5('0xaa'))[_0x55b5('0x49')](_0x55b5('0xb0'),_0x2528b5[_0x55b5('0xa7')][_0x55b5('0x8d')]())[_0x55b5('0x49')](_0x55b5('0xab')))[_0x55b5('0x8d')]();_0x3c3592[_0x55b5('0x8c')](db['sequelize'][_0x55b5('0x3d')](_0x50efc6));}return BPromise[_0x55b5('0x91')](_0x3c3592);}})[_0x55b5('0x2a')](function(){return _0x28e8fb;})[_0x55b5('0x2a')](respondWithResult(_0x4519eb,null))[_0x55b5('0x4e')](handleError(_0x4519eb,null));};exports[_0x55b5('0xb5')]=function(_0x32eaa5,_0xa65cf2,_0x2c9e9a){return db[_0x55b5('0x39')]['find']({'where':{'id':_0x32eaa5[_0x55b5('0x59')]['id']}})[_0x55b5('0x2a')](handleEntityNotFound(_0xa65cf2,null))['then'](function(_0x11c621){if(_0x11c621){return _0x11c621[_0x55b5('0xb5')](_0x32eaa5[_0x55b5('0x3d')]['ids']);}})[_0x55b5('0x2a')](function(_0x3d28f5){if(_0x3d28f5){return db[_0x55b5('0x6a')][_0x55b5('0x29')]({'where':{'ListId':_0x32eaa5[_0x55b5('0x3d')]['ids'],'VoiceQueueId':_0x32eaa5[_0x55b5('0x59')]['id']}})[_0x55b5('0x2a')](function(){return _0x3d28f5;});}})[_0x55b5('0x2a')](respondWithStatusCode(_0xa65cf2,null))[_0x55b5('0x4e')](handleError(_0xa65cf2,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 10af9cd..f824158 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 _0xb509=['VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5cd812,_0x27935e){var _0x166b90=function(_0x1ca929){while(--_0x1ca929){_0x5cd812['push'](_0x5cd812['shift']());}};_0x166b90(++_0x27935e);}(_0xb509,0x156));var _0x9b50=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0xb509[_0x28d18d];return _0x470640;};'use strict';var EventEmitter=require('events');var VoiceQueue=require('../../mysqldb')['db'][_0x9b50('0x0')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x9b50('0x1')](0x0);var events={'afterCreate':_0x9b50('0x2'),'afterUpdate':_0x9b50('0x3'),'afterDestroy':_0x9b50('0x4')};function emitEvent(_0x407467){return function(_0x30d2a5,_0x411733,_0x5cd8e7){VoiceQueueEvents[_0x9b50('0x5')](_0x407467+':'+_0x30d2a5['id'],_0x30d2a5);VoiceQueueEvents['emit'](_0x407467,_0x30d2a5);_0x5cd8e7(null);};}for(var e in events){if(events[_0x9b50('0x6')](e)){var event=events[e];VoiceQueue[_0x9b50('0x7')](e,emitEvent(event));}}module[_0x9b50('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0xf706=['hasOwnProperty','exports','events','../../mysqldb','VoiceQueue','save','update','remove','emit'];(function(_0x3e319e,_0x199f33){var _0xcc04b=function(_0x5c1b50){while(--_0x5c1b50){_0x3e319e['push'](_0x3e319e['shift']());}};_0xcc04b(++_0x199f33);}(_0xf706,0x185));var _0x6f70=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xf706[_0x1c8c28];return _0x1f59b4;};'use strict';var EventEmitter=require(_0x6f70('0x0'));var VoiceQueue=require(_0x6f70('0x1'))['db'][_0x6f70('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6f70('0x3'),'afterUpdate':_0x6f70('0x4'),'afterDestroy':_0x6f70('0x5')};function emitEvent(_0x5e888f){return function(_0x15ce6c,_0x1af61b,_0x1c93af){VoiceQueueEvents[_0x6f70('0x6')](_0x5e888f+':'+_0x15ce6c['id'],_0x15ce6c);VoiceQueueEvents[_0x6f70('0x6')](_0x5e888f,_0x15ce6c);_0x1c93af(null);};}for(var e in events){if(events[_0x6f70('0x7')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x6f70('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 b1f3a3a..2589374 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x5f2fea,_0x9fde07){var _0x198a0c=function(_0x2bb11a){while(--_0x2bb11a){_0x5f2fea['push'](_0x5f2fea['shift']());}};_0x198a0c(++_0x9fde07);}(_0x3e74,0x175));var _0x43e7=function(_0xd88911,_0x478a6c){_0xd88911=_0xd88911-0x0;var _0x5eb926=_0x3e74[_0xd88911];return _0x5eb926;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x552cb3,_0x2b0216){var _0x1cac5f=function(_0x4adf7c){while(--_0x4adf7c){_0x552cb3['push'](_0x552cb3['shift']());}};_0x1cac5f(++_0x2b0216);}(_0xedd9,0xfc));var _0x9edd=function(_0x2c3ba5,_0x4a8ee9){_0x2c3ba5=_0x2c3ba5-0x0;var _0x100b9f=_0xedd9[_0x2c3ba5];return _0x100b9f;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index e6ab47f..a35673a 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 _0x610e=['rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','VoiceQueue','findAll','options','attributes','include','map','model','catch','GetVoiceQueue','ShowVoiceQueue','find','raw','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x509e29,_0x5cad69){var _0x1a31c1=function(_0x2806a7){while(--_0x2806a7){_0x509e29['push'](_0x509e29['shift']());}};_0x1a31c1(++_0x5cad69);}(_0x610e,0x7b));var _0xe610=function(_0x251d58,_0x19475e){_0x251d58=_0x251d58-0x0;var _0x53bd8c=_0x610e[_0x251d58];return _0x53bd8c;};'use strict';var _=require(_0xe610('0x0'));var util=require(_0xe610('0x1'));var moment=require(_0xe610('0x2'));var BPromise=require(_0xe610('0x3'));var rs=require(_0xe610('0x4'));var fs=require('fs');var Redis=require(_0xe610('0x5'));var db=require(_0xe610('0x6'))['db'];var utils=require(_0xe610('0x7'));var logger=require(_0xe610('0x8'))(_0xe610('0x9'));var config=require(_0xe610('0xa'));var jayson=require(_0xe610('0xb'));var client=jayson['client'][_0xe610('0xc')]({'port':0x232a});config[_0xe610('0xd')]=_[_0xe610('0xe')](config[_0xe610('0xd')],{'host':_0xe610('0xf'),'port':0x18eb});var socket=require(_0xe610('0x10'))(new Redis(config[_0xe610('0xd')]));require(_0xe610('0x11'))[_0xe610('0x12')](socket);function respondWithRpcPromise(_0xc98d94,_0x1a1dbc,_0x53739f){return new BPromise(function(_0x1d1e89,_0x10bf05){return client[_0xe610('0x13')](_0xc98d94,_0x53739f)[_0xe610('0x14')](function(_0x11e8e9){logger[_0xe610('0x15')](_0xe610('0x16'),_0x1a1dbc,_0xe610('0x17'));logger[_0xe610('0x18')](_0xe610('0x19'),_0x1a1dbc,_0xe610('0x17'),JSON[_0xe610('0x1a')](_0x11e8e9));if(_0x11e8e9[_0xe610('0x1b')]){if(_0x11e8e9['error'][_0xe610('0x1c')]===0x1f4){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x1a1dbc,_0x11e8e9[_0xe610('0x1b')]['message']);return _0x10bf05(_0x11e8e9[_0xe610('0x1b')][_0xe610('0x1d')]);}logger[_0xe610('0x1b')](_0xe610('0x16'),_0x1a1dbc,_0x11e8e9[_0xe610('0x1b')][_0xe610('0x1d')]);return _0x1d1e89(_0x11e8e9[_0xe610('0x1b')][_0xe610('0x1d')]);}else{logger[_0xe610('0x15')](_0xe610('0x16'),_0x1a1dbc,'request\x20sent');_0x1d1e89(_0x11e8e9[_0xe610('0x1e')][_0xe610('0x1d')]);}})['catch'](function(_0x2b1d87){logger['error'](_0xe610('0x16'),_0x1a1dbc,_0x2b1d87);_0x10bf05(_0x2b1d87);});});}exports['GetVoiceQueue']=function(_0x419e48){var _0x1a99ff=this;return new Promise(function(_0x5485d7,_0x484c6f){return db[_0xe610('0x1f')][_0xe610('0x20')]({'raw':_0x419e48['options']?_0x419e48[_0xe610('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x419e48[_0xe610('0x21')]?_0x419e48[_0xe610('0x21')]['where']||null:null,'attributes':_0x419e48[_0xe610('0x21')]?_0x419e48[_0xe610('0x21')][_0xe610('0x22')]||null:null,'limit':_0x419e48[_0xe610('0x21')]?_0x419e48[_0xe610('0x21')]['limit']||null:null,'include':_0x419e48['options']?_0x419e48[_0xe610('0x21')][_0xe610('0x23')]?_[_0xe610('0x24')](_0x419e48['options'][_0xe610('0x23')],function(_0x23016a){return{'model':db[_0x23016a[_0xe610('0x25')]],'as':_0x23016a['as'],'attributes':_0x23016a[_0xe610('0x22')],'include':_0x23016a[_0xe610('0x23')]?_[_0xe610('0x24')](_0x23016a[_0xe610('0x23')],function(_0x11ccd9){return{'model':db[_0x11ccd9[_0xe610('0x25')]],'as':_0x11ccd9['as'],'attributes':_0x11ccd9[_0xe610('0x22')],'include':_0x11ccd9[_0xe610('0x23')]?_[_0xe610('0x24')](_0x11ccd9[_0xe610('0x23')],function(_0x5e7d7e){return{'model':db[_0x5e7d7e[_0xe610('0x25')]],'as':_0x5e7d7e['as'],'attributes':_0x5e7d7e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3996b8){logger[_0xe610('0x15')]('GetVoiceQueue',_0x419e48);logger[_0xe610('0x18')]('GetVoiceQueue',_0x419e48,JSON[_0xe610('0x1a')](_0x3996b8));_0x5485d7(_0x3996b8);})[_0xe610('0x26')](function(_0x125295){logger['error'](_0xe610('0x27'),_0x125295['message'],_0x419e48);_0x484c6f(_0x1a99ff['error'](0x1f4,_0x125295[_0xe610('0x1d')]));});});};exports[_0xe610('0x28')]=function(_0x1675b0){var _0x2d3672=this;return new Promise(function(_0x365b3d,_0x4eab73){return db[_0xe610('0x1f')][_0xe610('0x29')]({'raw':_0x1675b0[_0xe610('0x21')]?_0x1675b0[_0xe610('0x21')][_0xe610('0x2a')]===undefined?!![]:![]:!![],'where':_0x1675b0[_0xe610('0x21')]?_0x1675b0['options'][_0xe610('0x2b')]||null:null,'attributes':_0x1675b0[_0xe610('0x21')]?_0x1675b0[_0xe610('0x21')][_0xe610('0x22')]||null:null,'include':_0x1675b0[_0xe610('0x21')]?_0x1675b0['options']['include']?_[_0xe610('0x24')](_0x1675b0['options'][_0xe610('0x23')],function(_0x50470e){return{'model':db[_0x50470e[_0xe610('0x25')]],'as':_0x50470e['as'],'attributes':_0x50470e[_0xe610('0x22')],'include':_0x50470e['include']?_[_0xe610('0x24')](_0x50470e['include'],function(_0x1aface){return{'model':db[_0x1aface[_0xe610('0x25')]],'as':_0x1aface['as'],'attributes':_0x1aface[_0xe610('0x22')],'include':_0x1aface[_0xe610('0x23')]?_[_0xe610('0x24')](_0x1aface[_0xe610('0x23')],function(_0x5275f1){return{'model':db[_0x5275f1[_0xe610('0x25')]],'as':_0x5275f1['as'],'attributes':_0x5275f1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x55d39b){logger[_0xe610('0x15')](_0xe610('0x28'),_0x1675b0);logger[_0xe610('0x18')](_0xe610('0x28'),_0x1675b0,JSON[_0xe610('0x1a')](_0x55d39b));_0x365b3d(_0x55d39b);})['catch'](function(_0xd480ea){logger[_0xe610('0x1b')](_0xe610('0x28'),_0xd480ea['message'],_0x1675b0);_0x4eab73(_0x2d3672['error'](0x1f4,_0xd480ea[_0xe610('0x1d')]));});});}; \ No newline at end of file +var _0x9172=['attributes','limit','map','include','model','stringify','ShowVoiceQueue','lodash','util','moment','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0x9172,0x197));var _0x2917=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x9172[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0x2917('0x0'));var util=require(_0x2917('0x1'));var moment=require(_0x2917('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2917('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2917('0x4'));var config=require(_0x2917('0x5'));var jayson=require(_0x2917('0x6'));var client=jayson[_0x2917('0x7')][_0x2917('0x8')]({'port':0x232a});config[_0x2917('0x9')]=_[_0x2917('0xa')](config[_0x2917('0x9')],{'host':_0x2917('0xb'),'port':0x18eb});var socket=require(_0x2917('0xc'))(new Redis(config[_0x2917('0x9')]));require(_0x2917('0xd'))[_0x2917('0xe')](socket);function respondWithRpcPromise(_0x51fd27,_0x4ca97b,_0x2633b9){return new BPromise(function(_0x2578de,_0x9cc9b7){return client[_0x2917('0xf')](_0x51fd27,_0x2633b9)[_0x2917('0x10')](function(_0x343057){logger[_0x2917('0x11')](_0x2917('0x12'),_0x4ca97b,_0x2917('0x13'));logger[_0x2917('0x14')](_0x2917('0x15'),_0x4ca97b,_0x2917('0x13'),JSON['stringify'](_0x343057));if(_0x343057[_0x2917('0x16')]){if(_0x343057['error'][_0x2917('0x17')]===0x1f4){logger[_0x2917('0x16')](_0x2917('0x12'),_0x4ca97b,_0x343057[_0x2917('0x16')]['message']);return _0x9cc9b7(_0x343057[_0x2917('0x16')][_0x2917('0x18')]);}logger[_0x2917('0x16')](_0x2917('0x12'),_0x4ca97b,_0x343057[_0x2917('0x16')][_0x2917('0x18')]);return _0x2578de(_0x343057[_0x2917('0x16')]['message']);}else{logger[_0x2917('0x11')](_0x2917('0x12'),_0x4ca97b,'request\x20sent');_0x2578de(_0x343057[_0x2917('0x19')][_0x2917('0x18')]);}})[_0x2917('0x1a')](function(_0x4cf61f){logger[_0x2917('0x16')](_0x2917('0x12'),_0x4ca97b,_0x4cf61f);_0x9cc9b7(_0x4cf61f);});});}exports[_0x2917('0x1b')]=function(_0x34a04b){var _0x2391b7=this;return new Promise(function(_0x1b256c,_0x47cb87){return db[_0x2917('0x1c')][_0x2917('0x1d')]({'raw':_0x34a04b[_0x2917('0x1e')]?_0x34a04b[_0x2917('0x1e')][_0x2917('0x1f')]===undefined?!![]:![]:!![],'where':_0x34a04b['options']?_0x34a04b[_0x2917('0x1e')][_0x2917('0x20')]||null:null,'attributes':_0x34a04b[_0x2917('0x1e')]?_0x34a04b[_0x2917('0x1e')][_0x2917('0x21')]||null:null,'limit':_0x34a04b[_0x2917('0x1e')]?_0x34a04b[_0x2917('0x1e')][_0x2917('0x22')]||null:null,'include':_0x34a04b[_0x2917('0x1e')]?_0x34a04b[_0x2917('0x1e')]['include']?_[_0x2917('0x23')](_0x34a04b[_0x2917('0x1e')][_0x2917('0x24')],function(_0x2fb815){return{'model':db[_0x2fb815[_0x2917('0x25')]],'as':_0x2fb815['as'],'attributes':_0x2fb815[_0x2917('0x21')],'include':_0x2fb815[_0x2917('0x24')]?_[_0x2917('0x23')](_0x2fb815[_0x2917('0x24')],function(_0xc7a0a4){return{'model':db[_0xc7a0a4['model']],'as':_0xc7a0a4['as'],'attributes':_0xc7a0a4[_0x2917('0x21')],'include':_0xc7a0a4[_0x2917('0x24')]?_[_0x2917('0x23')](_0xc7a0a4['include'],function(_0x2b79a7){return{'model':db[_0x2b79a7['model']],'as':_0x2b79a7['as'],'attributes':_0x2b79a7['attributes']};}):[]};}):[]};}):[]:[]})[_0x2917('0x10')](function(_0xc91189){logger['info'](_0x2917('0x1b'),_0x34a04b);logger[_0x2917('0x14')](_0x2917('0x1b'),_0x34a04b,JSON[_0x2917('0x26')](_0xc91189));_0x1b256c(_0xc91189);})['catch'](function(_0x4b5cc0){logger[_0x2917('0x16')](_0x2917('0x1b'),_0x4b5cc0[_0x2917('0x18')],_0x34a04b);_0x47cb87(_0x2391b7['error'](0x1f4,_0x4b5cc0[_0x2917('0x18')]));});});};exports[_0x2917('0x27')]=function(_0x46c9c2){var _0x42e5f8=this;return new Promise(function(_0x41bbdf,_0x28b5be){return db[_0x2917('0x1c')]['find']({'raw':_0x46c9c2[_0x2917('0x1e')]?_0x46c9c2[_0x2917('0x1e')][_0x2917('0x1f')]===undefined?!![]:![]:!![],'where':_0x46c9c2['options']?_0x46c9c2['options'][_0x2917('0x20')]||null:null,'attributes':_0x46c9c2[_0x2917('0x1e')]?_0x46c9c2[_0x2917('0x1e')]['attributes']||null:null,'include':_0x46c9c2[_0x2917('0x1e')]?_0x46c9c2[_0x2917('0x1e')][_0x2917('0x24')]?_['map'](_0x46c9c2[_0x2917('0x1e')][_0x2917('0x24')],function(_0x4225e6){return{'model':db[_0x4225e6['model']],'as':_0x4225e6['as'],'attributes':_0x4225e6['attributes'],'include':_0x4225e6['include']?_[_0x2917('0x23')](_0x4225e6['include'],function(_0x3419db){return{'model':db[_0x3419db[_0x2917('0x25')]],'as':_0x3419db['as'],'attributes':_0x3419db[_0x2917('0x21')],'include':_0x3419db[_0x2917('0x24')]?_[_0x2917('0x23')](_0x3419db['include'],function(_0x32e3f9){return{'model':db[_0x32e3f9['model']],'as':_0x32e3f9['as'],'attributes':_0x32e3f9[_0x2917('0x21')]};}):[]};}):[]};}):[]:[]})[_0x2917('0x10')](function(_0x21d4f6){logger[_0x2917('0x11')]('ShowVoiceQueue',_0x46c9c2);logger[_0x2917('0x14')](_0x2917('0x27'),_0x46c9c2,JSON[_0x2917('0x26')](_0x21d4f6));_0x41bbdf(_0x21d4f6);})['catch'](function(_0x1b2e71){logger[_0x2917('0x16')]('ShowVoiceQueue',_0x1b2e71['message'],_0x46c9c2);_0x28b5be(_0x42e5f8[_0x2917('0x16')](0x1f4,_0x1b2e71[_0x2917('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index dbba872..8dab64d 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 _0x4086=['removeListener','register','length','voiceQueue:','./voiceQueue.events','save','remove','update','emit'];(function(_0x5dd351,_0x19ebc5){var _0x1fbdba=function(_0x58297e){while(--_0x58297e){_0x5dd351['push'](_0x5dd351['shift']());}};_0x1fbdba(++_0x19ebc5);}(_0x4086,0x79));var _0x6408=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4086[_0x122ef9];return _0x42fba0;};'use strict';var VoiceQueueEvents=require(_0x6408('0x0'));var events=[_0x6408('0x1'),_0x6408('0x2'),_0x6408('0x3')];function createListener(_0x490184,_0x974f8d){return function(_0x268e20){_0x974f8d[_0x6408('0x4')](_0x490184,_0x268e20);};}function removeListener(_0x3ad65b,_0x1c7e2b){return function(){VoiceQueueEvents[_0x6408('0x5')](_0x3ad65b,_0x1c7e2b);};}exports[_0x6408('0x6')]=function(_0x39d9bf){for(var _0x4db1d4=0x0,_0x4370bb=events[_0x6408('0x7')];_0x4db1d4<_0x4370bb;_0x4db1d4++){var _0x7e2f0f=events[_0x4db1d4];var _0x35e67c=createListener(_0x6408('0x8')+_0x7e2f0f,_0x39d9bf);VoiceQueueEvents['on'](_0x7e2f0f,_0x35e67c);}}; \ No newline at end of file +var _0x2342=['update','removeListener','register','voiceQueue:','./voiceQueue.events','save','remove'];(function(_0x361937,_0x5e46f7){var _0x4905a=function(_0x10123c){while(--_0x10123c){_0x361937['push'](_0x361937['shift']());}};_0x4905a(++_0x5e46f7);}(_0x2342,0x1c4));var _0x2234=function(_0x27fd5a,_0x3ce111){_0x27fd5a=_0x27fd5a-0x0;var _0x362f9a=_0x2342[_0x27fd5a];return _0x362f9a;};'use strict';var VoiceQueueEvents=require(_0x2234('0x0'));var events=[_0x2234('0x1'),_0x2234('0x2'),_0x2234('0x3')];function createListener(_0x4fe69c,_0x5ae55c){return function(_0x8d882f){_0x5ae55c['emit'](_0x4fe69c,_0x8d882f);};}function removeListener(_0x1d8553,_0x52f91b){return function(){VoiceQueueEvents[_0x2234('0x4')](_0x1d8553,_0x52f91b);};}exports[_0x2234('0x5')]=function(_0x51b192){for(var _0x449881=0x0,_0x205e11=events['length'];_0x449881<_0x205e11;_0x449881++){var _0x59d71b=events[_0x449881];var _0x91a6d9=createListener(_0x2234('0x6')+_0x59d71b,_0x51b192);VoiceQueueEvents['on'](_0x59d71b,_0x91a6d9);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 566e2a6..bbec0f4 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 _0x578e=['get','index','/describe','describe','/index','isAuthenticated','getVoiceQueuesReport','post','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueueReport.controller'];(function(_0x8173a3,_0x23c0ac){var _0x5b0483=function(_0x1b6c93){while(--_0x1b6c93){_0x8173a3['push'](_0x8173a3['shift']());}};_0x5b0483(++_0x23c0ac);}(_0x578e,0x12b));var _0xe578=function(_0x189cdd,_0x31b2aa){_0x189cdd=_0x189cdd-0x0;var _0x2d4f8c=_0x578e[_0x189cdd];return _0x2d4f8c;};'use strict';var multer=require(_0xe578('0x0'));var util=require(_0xe578('0x1'));var path=require('path');var timeout=require(_0xe578('0x2'));var express=require(_0xe578('0x3'));var router=express[_0xe578('0x4')]();var fs_extra=require(_0xe578('0x5'));var auth=require(_0xe578('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe578('0x7'));var controller=require(_0xe578('0x8'));router[_0xe578('0x9')]('/',auth['isAuthenticated'](),controller[_0xe578('0xa')]);router['get'](_0xe578('0xb'),auth['isAuthenticated'](),controller[_0xe578('0xc')]);router[_0xe578('0x9')](_0xe578('0xd'),auth[_0xe578('0xe')](),controller[_0xe578('0xf')]);router[_0xe578('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xe578('0x10')]('/',auth[_0xe578('0xe')](),controller['create']);router['put'](_0xe578('0x11'),auth[_0xe578('0xe')](),controller[_0xe578('0x12')]);router[_0xe578('0x13')](_0xe578('0x11'),auth[_0xe578('0xe')](),controller[_0xe578('0x14')]);module[_0xe578('0x15')]=router; \ No newline at end of file +var _0xe441=['post','create','/:id','update','destroy','exports','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport'];(function(_0x41f682,_0x167520){var _0x13f69c=function(_0x469f2e){while(--_0x469f2e){_0x41f682['push'](_0x41f682['shift']());}};_0x13f69c(++_0x167520);}(_0xe441,0x110));var _0x1e44=function(_0x205ff8,_0x4a84df){_0x205ff8=_0x205ff8-0x0;var _0x3c302c=_0xe441[_0x205ff8];return _0x3c302c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1e44('0x0'));var timeout=require(_0x1e44('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1e44('0x2'));var auth=require(_0x1e44('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x1e44('0x4'));var controller=require(_0x1e44('0x5'));router[_0x1e44('0x6')]('/',auth[_0x1e44('0x7')](),controller[_0x1e44('0x8')]);router[_0x1e44('0x6')](_0x1e44('0x9'),auth[_0x1e44('0x7')](),controller[_0x1e44('0xa')]);router[_0x1e44('0x6')](_0x1e44('0xb'),auth[_0x1e44('0x7')](),controller[_0x1e44('0xc')]);router[_0x1e44('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1e44('0xd')]('/',auth['isAuthenticated'](),controller[_0x1e44('0xe')]);router['put'](_0x1e44('0xf'),auth['isAuthenticated'](),controller[_0x1e44('0x10')]);router['delete'](_0x1e44('0xf'),auth['isAuthenticated'](),controller[_0x1e44('0x11')]);module[_0x1e44('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 0ccdd7f..fe8dc8f 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 _0xb4b0=['queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0xb4b0,0x82));var _0x0b4b=function(_0xd83ee,_0x414b13){_0xd83ee=_0xd83ee-0x0;var _0x2e7ac2=_0xb4b0[_0xd83ee];return _0x2e7ac2;};'use strict';var Sequelize=require(_0x0b4b('0x0'));var moment=require(_0x0b4b('0x1'));module['exports']={'type':{'type':Sequelize[_0x0b4b('0x2')]},'uniqueid':{'type':Sequelize[_0x0b4b('0x2')]},'calleridnum':{'type':Sequelize[_0x0b4b('0x2')]},'calleridname':{'type':Sequelize[_0x0b4b('0x2')]},'queue':{'type':Sequelize[_0x0b4b('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x0b4b('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x31c72a){var _0x382cb1=moment(_0x31c72a);var _0x4931bc=moment(this[_0x0b4b('0x4')](_0x0b4b('0x5')))[_0x0b4b('0x6')](_0x0b4b('0x7'));var _0x482720=_0x382cb1[_0x0b4b('0x8')](_0x4931bc,_0x0b4b('0x9'));this['setDataValue']('queuecallerleaveAt',_0x31c72a);this[_0x0b4b('0xa')](_0x0b4b('0xb'),_0x482720||null);}},'position':{'type':Sequelize[_0x0b4b('0xc')]},'count':{'type':Sequelize[_0x0b4b('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x0b4b('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x0b4b('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x0b4b('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x0b4b('0x3')]},'queuecallerexit':{'type':Sequelize[_0x0b4b('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x0b4b('0xc')]},'channel':{'type':Sequelize[_0x0b4b('0x2')]},'connectedlinenum':{'type':Sequelize[_0x0b4b('0x2')]},'connectedlinename':{'type':Sequelize[_0x0b4b('0x2')]},'accountcode':{'type':Sequelize[_0x0b4b('0x2')]},'context':{'type':Sequelize[_0x0b4b('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x0b4b('0x2')]},'holdtime':{'type':Sequelize[_0x0b4b('0xc')]},'mohtime':{'type':Sequelize[_0x0b4b('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x0b4b('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x0b4b('0x2')]},'transfer':{'type':Sequelize[_0x0b4b('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x0b4b('0x2')],'comment':_0x0b4b('0xe')},'transferexten':{'type':Sequelize[_0x0b4b('0x2')]},'transferuniqueid':{'type':Sequelize[_0x0b4b('0x2')]},'disposition':{'type':Sequelize[_0x0b4b('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x0b4b('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x8636=['getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE'];(function(_0x272abb,_0x26f0f0){var _0x4b70fd=function(_0x18a196){while(--_0x18a196){_0x272abb['push'](_0x272abb['shift']());}};_0x4b70fd(++_0x26f0f0);}(_0x8636,0x190));var _0x6863=function(_0x4baf82,_0x4e05f3){_0x4baf82=_0x4baf82-0x0;var _0x3985bd=_0x8636[_0x4baf82];return _0x3985bd;};'use strict';var Sequelize=require(_0x6863('0x0'));var moment=require(_0x6863('0x1'));module[_0x6863('0x2')]={'type':{'type':Sequelize[_0x6863('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x6863('0x3')]},'queue':{'type':Sequelize[_0x6863('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x6863('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x6863('0x4')],'set':function(_0x4debd8){var _0x554ff6=moment(_0x4debd8);var _0x1a2f9c=moment(this[_0x6863('0x5')](_0x6863('0x6')))[_0x6863('0x7')](_0x6863('0x8'));var _0x1fe330=_0x554ff6['diff'](_0x1a2f9c,'seconds');this['setDataValue']('queuecallerleaveAt',_0x4debd8);this[_0x6863('0x9')](_0x6863('0xa'),_0x1fe330||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x6863('0xb')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x6863('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x6863('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x6863('0x4')]},'queuecallerexit':{'type':Sequelize[_0x6863('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x6863('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x6863('0x3')],'comment':_0x6863('0xd')},'originalposition':{'type':Sequelize[_0x6863('0xb')]},'channel':{'type':Sequelize[_0x6863('0x3')]},'connectedlinenum':{'type':Sequelize[_0x6863('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x6863('0x3')]},'context':{'type':Sequelize[_0x6863('0x3')]},'exten':{'type':Sequelize[_0x6863('0x3')]},'priority':{'type':Sequelize[_0x6863('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x6863('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x6863('0x3')]},'transfer':{'type':Sequelize[_0x6863('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x6863('0xe')},'transferexten':{'type':Sequelize[_0x6863('0x3')]},'transferuniqueid':{'type':Sequelize[_0x6863('0x3')]},'disposition':{'type':Sequelize[_0x6863('0x3')]},'secondDisposition':{'type':Sequelize[_0x6863('0x3')]},'thirdDisposition':{'type':Sequelize[_0x6863('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x6863('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 02e347a..3463cfa 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 _0xf5f0=['update','then','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceQueueReport','includeAll','include','rows','show','fields','length','find','catch','create','body','params','describe','findAll','getVoiceQueuesReport','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save'];(function(_0x216563,_0x50eacf){var _0x4f18d5=function(_0x25441a){while(--_0x25441a){_0x216563['push'](_0x216563['shift']());}};_0x4f18d5(++_0x50eacf);}(_0xf5f0,0x1af));var _0x0f5f=function(_0x2605d1,_0xd6ec27){_0x2605d1=_0x2605d1-0x0;var _0xacc9d=_0xf5f0[_0x2605d1];return _0xacc9d;};'use strict';var emlformat=require(_0x0f5f('0x0'));var rimraf=require(_0x0f5f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f5f('0x2'));var rp=require(_0x0f5f('0x3'));var moment=require('moment');var BPromise=require(_0x0f5f('0x4'));var Mustache=require(_0x0f5f('0x5'));var util=require(_0x0f5f('0x6'));var path=require(_0x0f5f('0x7'));var sox=require(_0x0f5f('0x8'));var csv=require(_0x0f5f('0x9'));var ejs=require(_0x0f5f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0f5f('0xb'));var squel=require(_0x0f5f('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0f5f('0xd'));var toCsv=require(_0x0f5f('0x9'));var querystring=require(_0x0f5f('0xe'));var Papa=require('papaparse');var Redis=require(_0x0f5f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0f5f('0x10'));var as=require(_0x0f5f('0x11'));var hardwareService=require(_0x0f5f('0x12'));var logger=require(_0x0f5f('0x13'))(_0x0f5f('0x14'));var utils=require(_0x0f5f('0x15'));var config=require(_0x0f5f('0x16'));var licenseUtil=require(_0x0f5f('0x17'));var db=require('../../mysqldb')['db'];config[_0x0f5f('0x18')]=_['defaults'](config[_0x0f5f('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0f5f('0x18')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x2121d2,_0x21b26c){_0x21b26c=_0x21b26c||0xcc;return function(_0x367913){if(_0x367913){return _0x2121d2[_0x0f5f('0x19')](_0x21b26c);}return _0x2121d2[_0x0f5f('0x1a')](_0x21b26c)[_0x0f5f('0x1b')]();};}function respondWithResult(_0x54958c,_0x1ce981){_0x1ce981=_0x1ce981||0xc8;return function(_0x3a19e0){if(_0x3a19e0){return _0x54958c['status'](_0x1ce981)[_0x0f5f('0x1c')](_0x3a19e0);}};}function respondWithFilteredResult(_0x25e6a6,_0x2ef74e){return function(_0x4a384a){if(_0x4a384a){var _0x3f6a3b=typeof _0x2ef74e[_0x0f5f('0x1d')]===_0x0f5f('0x1e')&&typeof _0x2ef74e[_0x0f5f('0x1f')]===_0x0f5f('0x1e');var _0xbdc6c1=_0x4a384a[_0x0f5f('0x20')];var _0x2618d2=_0x3f6a3b?0x0:_0x2ef74e[_0x0f5f('0x1d')];var _0x4d075e=_0x3f6a3b?_0x4a384a[_0x0f5f('0x20')]:_0x2ef74e[_0x0f5f('0x1d')]+_0x2ef74e[_0x0f5f('0x1f')];var _0x31cb22;if(_0x4d075e>=_0xbdc6c1){_0x4d075e=_0xbdc6c1;_0x31cb22=0xc8;}else{_0x31cb22=0xce;}_0x25e6a6[_0x0f5f('0x1a')](_0x31cb22);return _0x25e6a6[_0x0f5f('0x21')]('Content-Range',_0x2618d2+'-'+_0x4d075e+'/'+_0xbdc6c1)['json'](_0x4a384a);}return null;};}function patchUpdates(_0x4f7014){return function(_0x431c32){try{jsonpatch[_0x0f5f('0x22')](_0x431c32,_0x4f7014,!![]);}catch(_0x5a099f){return BPromise[_0x0f5f('0x23')](_0x5a099f);}return _0x431c32[_0x0f5f('0x24')]();};}function saveUpdates(_0x34aebf,_0x50bf2e){return function(_0x199e59){if(_0x199e59){return _0x199e59[_0x0f5f('0x25')](_0x34aebf)[_0x0f5f('0x26')](function(_0x169f57){return _0x169f57;});}return null;};}function removeEntity(_0x340ce3,_0xd0c2d4){return function(_0x1be5e6){if(_0x1be5e6){return _0x1be5e6[_0x0f5f('0x27')]()[_0x0f5f('0x26')](function(){_0x340ce3[_0x0f5f('0x1a')](0xcc)[_0x0f5f('0x1b')]();});}};}function handleEntityNotFound(_0x4f697b,_0x32c047){return function(_0x1adfec){if(!_0x1adfec){_0x4f697b[_0x0f5f('0x19')](0x194);}return _0x1adfec;};}function handleError(_0x3e545b,_0x33d961){_0x33d961=_0x33d961||0x1f4;return function(_0x5ccedd){logger['error'](_0x5ccedd[_0x0f5f('0x28')]);if(_0x5ccedd[_0x0f5f('0x29')]){delete _0x5ccedd[_0x0f5f('0x29')];}_0x3e545b['status'](_0x33d961)[_0x0f5f('0x2a')](_0x5ccedd);};}exports[_0x0f5f('0x2b')]=function(_0x55266c,_0x31e3d5){var _0x51842e={},_0x426fd3={},_0x4cd746={'count':0x0,'rows':[]};var _0x15edb8=_['map'](db['VoiceQueueReport'][_0x0f5f('0x2c')],function(_0x55b05e){return{'name':_0x55b05e[_0x0f5f('0x2d')],'type':_0x55b05e['type'][_0x0f5f('0x2e')]};});_0x426fd3[_0x0f5f('0x2f')]=_[_0x0f5f('0x30')](_0x15edb8,_0x0f5f('0x29'));_0x426fd3[_0x0f5f('0x31')]=_['keys'](_0x55266c[_0x0f5f('0x31')]);_0x426fd3[_0x0f5f('0x32')]=_['intersection'](_0x426fd3[_0x0f5f('0x2f')],_0x426fd3[_0x0f5f('0x31')]);_0x51842e['attributes']=_[_0x0f5f('0x33')](_0x426fd3['model'],qs['fields'](_0x55266c[_0x0f5f('0x31')]['fields']));_0x51842e[_0x0f5f('0x34')]=_0x51842e['attributes']['length']?_0x51842e[_0x0f5f('0x34')]:_0x426fd3[_0x0f5f('0x2f')];if(!_0x55266c[_0x0f5f('0x31')][_0x0f5f('0x35')](_0x0f5f('0x36'))){_0x51842e[_0x0f5f('0x1f')]=qs[_0x0f5f('0x1f')](_0x55266c[_0x0f5f('0x31')][_0x0f5f('0x1f')]);_0x51842e[_0x0f5f('0x1d')]=qs['offset'](_0x55266c['query'][_0x0f5f('0x1d')]);}_0x51842e[_0x0f5f('0x37')]=qs[_0x0f5f('0x38')](_0x55266c[_0x0f5f('0x31')][_0x0f5f('0x38')]);_0x51842e[_0x0f5f('0x39')]=qs[_0x0f5f('0x32')](_[_0x0f5f('0x3a')](_0x55266c[_0x0f5f('0x31')],_0x426fd3[_0x0f5f('0x32')]),_0x15edb8);if(_0x55266c[_0x0f5f('0x31')][_0x0f5f('0x3b')]){_0x51842e[_0x0f5f('0x39')]=_[_0x0f5f('0x3c')](_0x51842e[_0x0f5f('0x39')],{'$or':_[_0x0f5f('0x30')](_0x15edb8,function(_0x48ba28){if(_0x48ba28['type']!==_0x0f5f('0x3d')){var _0x5b22c5={};_0x5b22c5[_0x48ba28['name']]={'$like':'%'+_0x55266c[_0x0f5f('0x31')]['filter']+'%'};return _0x5b22c5;}})});}_0x51842e=_[_0x0f5f('0x3c')]({},_0x51842e,_0x55266c[_0x0f5f('0x3e')]);var _0xac91d9={'where':_0x51842e[_0x0f5f('0x39')]};return db[_0x0f5f('0x3f')][_0x0f5f('0x20')](_0xac91d9)[_0x0f5f('0x26')](function(_0x579bca){_0x4cd746[_0x0f5f('0x20')]=_0x579bca;if(_0x55266c['query'][_0x0f5f('0x40')]){_0x51842e[_0x0f5f('0x41')]=[{'all':!![]}];}return db[_0x0f5f('0x3f')]['findAll'](_0x51842e);})[_0x0f5f('0x26')](function(_0x399f9c){_0x4cd746[_0x0f5f('0x42')]=_0x399f9c;return _0x4cd746;})[_0x0f5f('0x26')](respondWithFilteredResult(_0x31e3d5,_0x51842e))['catch'](handleError(_0x31e3d5,null));};exports[_0x0f5f('0x43')]=function(_0x5e0fe7,_0x42e82d){var _0x4107ef={'raw':![],'where':{'id':_0x5e0fe7['params']['id']}},_0x10524d={};_0x10524d[_0x0f5f('0x2f')]=_['keys'](db['VoiceQueueReport']['rawAttributes']);_0x10524d[_0x0f5f('0x31')]=_['keys'](_0x5e0fe7[_0x0f5f('0x31')]);_0x10524d['filters']=_[_0x0f5f('0x33')](_0x10524d[_0x0f5f('0x2f')],_0x10524d[_0x0f5f('0x31')]);_0x4107ef[_0x0f5f('0x34')]=_[_0x0f5f('0x33')](_0x10524d[_0x0f5f('0x2f')],qs[_0x0f5f('0x44')](_0x5e0fe7[_0x0f5f('0x31')][_0x0f5f('0x44')]));_0x4107ef[_0x0f5f('0x34')]=_0x4107ef[_0x0f5f('0x34')][_0x0f5f('0x45')]?_0x4107ef[_0x0f5f('0x34')]:_0x10524d['model'];if(_0x5e0fe7[_0x0f5f('0x31')][_0x0f5f('0x40')]){_0x4107ef[_0x0f5f('0x41')]=[{'all':!![]}];}_0x4107ef=_[_0x0f5f('0x3c')]({},_0x4107ef,_0x5e0fe7[_0x0f5f('0x3e')]);return db['VoiceQueueReport'][_0x0f5f('0x46')](_0x4107ef)['then'](handleEntityNotFound(_0x42e82d,null))[_0x0f5f('0x26')](respondWithResult(_0x42e82d,null))[_0x0f5f('0x47')](handleError(_0x42e82d,null));};exports[_0x0f5f('0x48')]=function(_0x325498,_0x3a6430){return db[_0x0f5f('0x3f')]['create'](_0x325498[_0x0f5f('0x49')],{})[_0x0f5f('0x26')](respondWithResult(_0x3a6430,0xc9))[_0x0f5f('0x47')](handleError(_0x3a6430,null));};exports['update']=function(_0x4267d8,_0x1c4a6f){if(_0x4267d8[_0x0f5f('0x49')]['id']){delete _0x4267d8[_0x0f5f('0x49')]['id'];}return db[_0x0f5f('0x3f')][_0x0f5f('0x46')]({'where':{'id':_0x4267d8[_0x0f5f('0x4a')]['id']}})[_0x0f5f('0x26')](handleEntityNotFound(_0x1c4a6f,null))['then'](saveUpdates(_0x4267d8[_0x0f5f('0x49')],null))[_0x0f5f('0x26')](respondWithResult(_0x1c4a6f,null))['catch'](handleError(_0x1c4a6f,null));};exports[_0x0f5f('0x27')]=function(_0x4eb76d,_0x5d4ed6){return db['VoiceQueueReport']['find']({'where':{'id':_0x4eb76d[_0x0f5f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5d4ed6,null))[_0x0f5f('0x26')](removeEntity(_0x5d4ed6,null))[_0x0f5f('0x47')](handleError(_0x5d4ed6,null));};exports[_0x0f5f('0x4b')]=function(_0x1ec0c3,_0x12fbcd){return db[_0x0f5f('0x3f')][_0x0f5f('0x4b')]()[_0x0f5f('0x26')](respondWithResult(_0x12fbcd,null))[_0x0f5f('0x47')](handleError(_0x12fbcd,null));};exports['getVoiceQueuesReport']=function(_0x4b6e17,_0x3ab85d){var _0x5e92fc={},_0x41ee8b={},_0x1f366c={'count':0x0,'rows':[]};_0x41ee8b[_0x0f5f('0x2f')]=_['keys'](db[_0x0f5f('0x3f')][_0x0f5f('0x2c')]);_0x41ee8b[_0x0f5f('0x31')]=_['keys'](_0x4b6e17[_0x0f5f('0x31')]);_0x41ee8b[_0x0f5f('0x32')]=_[_0x0f5f('0x33')](_0x41ee8b[_0x0f5f('0x2f')],_0x41ee8b[_0x0f5f('0x31')]);_0x5e92fc['attributes']=_['intersection'](_0x41ee8b[_0x0f5f('0x2f')],qs[_0x0f5f('0x44')](_0x4b6e17[_0x0f5f('0x31')][_0x0f5f('0x44')]));_0x5e92fc[_0x0f5f('0x34')]=_0x5e92fc[_0x0f5f('0x34')][_0x0f5f('0x45')]?_0x5e92fc[_0x0f5f('0x34')]:_0x41ee8b[_0x0f5f('0x2f')];if(!_0x4b6e17[_0x0f5f('0x31')][_0x0f5f('0x35')](_0x0f5f('0x36'))){_0x5e92fc[_0x0f5f('0x1f')]=qs[_0x0f5f('0x1f')](_0x4b6e17['query'][_0x0f5f('0x1f')]);_0x5e92fc[_0x0f5f('0x1d')]=qs['offset'](_0x4b6e17[_0x0f5f('0x31')]['offset']);}_0x5e92fc[_0x0f5f('0x37')]=qs[_0x0f5f('0x38')](_0x4b6e17[_0x0f5f('0x31')][_0x0f5f('0x38')]);_0x5e92fc['where']=qs['filters'](_[_0x0f5f('0x3a')](_0x4b6e17[_0x0f5f('0x31')],_0x41ee8b[_0x0f5f('0x32')]));if(_0x4b6e17[_0x0f5f('0x31')]['filter']){_0x5e92fc[_0x0f5f('0x39')]=_[_0x0f5f('0x3c')](_0x5e92fc[_0x0f5f('0x39')],{'$or':_[_0x0f5f('0x30')](_0x5e92fc['attributes'],function(_0x3a0fd8){var _0x6a9366={};_0x6a9366[_0x3a0fd8]={'$like':'%'+_0x4b6e17[_0x0f5f('0x31')][_0x0f5f('0x3b')]+'%'};return _0x6a9366;})});}_0x5e92fc=_[_0x0f5f('0x3c')]({},_0x5e92fc,_0x4b6e17['options']);var _0x378701={'where':_0x5e92fc[_0x0f5f('0x39')]};return db[_0x0f5f('0x3f')][_0x0f5f('0x20')](_0x378701)['then'](function(_0x4c7842){_0x1f366c[_0x0f5f('0x20')]=_0x4c7842;if(_0x4b6e17['query'][_0x0f5f('0x40')]){_0x5e92fc[_0x0f5f('0x41')]=[{'all':!![]}];}return db[_0x0f5f('0x3f')][_0x0f5f('0x4c')](_0x5e92fc);})[_0x0f5f('0x26')](function(_0x479a38){_0x1f366c[_0x0f5f('0x42')]=_0x479a38;return _0x1f366c;})[_0x0f5f('0x26')](respondWithFilteredResult(_0x3ab85d,_0x5e92fc,'getVoiceQueuesReport'))[_0x0f5f('0x47')](handleError(_0x3ab85d,null,_0x0f5f('0x4d')));}; \ No newline at end of file +var _0x07c7=['../../config/license/util','../../mysqldb','redis','socket.io-emitter','./voiceQueueReport.socket','register','end','status','json','undefined','limit','count','offset','set','save','update','then','sendStatus','error','name','send','index','VoiceQueueReport','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rawAttributes','getVoiceQueuesReport','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x1d69bc,_0x3fb317){var _0x1482ae=function(_0x23519f){while(--_0x23519f){_0x1d69bc['push'](_0x1d69bc['shift']());}};_0x1482ae(++_0x3fb317);}(_0x07c7,0x12a));var _0x707c=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x07c7[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x707c('0x0'));var rimraf=require(_0x707c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x707c('0x2'));var rp=require(_0x707c('0x3'));var moment=require(_0x707c('0x4'));var BPromise=require(_0x707c('0x5'));var Mustache=require(_0x707c('0x6'));var util=require(_0x707c('0x7'));var path=require(_0x707c('0x8'));var sox=require(_0x707c('0x9'));var csv=require(_0x707c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x707c('0xb'));var _=require(_0x707c('0xc'));var squel=require(_0x707c('0xd'));var crypto=require(_0x707c('0xe'));var jsforce=require(_0x707c('0xf'));var deskjs=require(_0x707c('0x10'));var toCsv=require(_0x707c('0xa'));var querystring=require('querystring');var Papa=require(_0x707c('0x11'));var Redis=require(_0x707c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x707c('0x13'));var as=require(_0x707c('0x14'));var hardwareService=require(_0x707c('0x15'));var logger=require(_0x707c('0x16'))(_0x707c('0x17'));var utils=require(_0x707c('0x18'));var config=require(_0x707c('0x19'));var licenseUtil=require(_0x707c('0x1a'));var db=require(_0x707c('0x1b'))['db'];config['redis']=_['defaults'](config[_0x707c('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x707c('0x1d'))(new Redis(config[_0x707c('0x1c')]));require(_0x707c('0x1e'))[_0x707c('0x1f')](socket);function respondWithStatusCode(_0x500859,_0x2211bc){_0x2211bc=_0x2211bc||0xcc;return function(_0x76f042){if(_0x76f042){return _0x500859['sendStatus'](_0x2211bc);}return _0x500859['status'](_0x2211bc)[_0x707c('0x20')]();};}function respondWithResult(_0x38de0c,_0x59e55f){_0x59e55f=_0x59e55f||0xc8;return function(_0x4aaf4f){if(_0x4aaf4f){return _0x38de0c[_0x707c('0x21')](_0x59e55f)[_0x707c('0x22')](_0x4aaf4f);}};}function respondWithFilteredResult(_0x47a792,_0x32bba4){return function(_0x4d01b9){if(_0x4d01b9){var _0x22a84d=typeof _0x32bba4['offset']===_0x707c('0x23')&&typeof _0x32bba4[_0x707c('0x24')]===_0x707c('0x23');var _0x321096=_0x4d01b9[_0x707c('0x25')];var _0x552f65=_0x22a84d?0x0:_0x32bba4[_0x707c('0x26')];var _0x3a99c5=_0x22a84d?_0x4d01b9['count']:_0x32bba4[_0x707c('0x26')]+_0x32bba4[_0x707c('0x24')];var _0x3d82bb;if(_0x3a99c5>=_0x321096){_0x3a99c5=_0x321096;_0x3d82bb=0xc8;}else{_0x3d82bb=0xce;}_0x47a792[_0x707c('0x21')](_0x3d82bb);return _0x47a792[_0x707c('0x27')]('Content-Range',_0x552f65+'-'+_0x3a99c5+'/'+_0x321096)[_0x707c('0x22')](_0x4d01b9);}return null;};}function patchUpdates(_0x1cd32f){return function(_0x15a180){try{jsonpatch['apply'](_0x15a180,_0x1cd32f,!![]);}catch(_0x5e2191){return BPromise['reject'](_0x5e2191);}return _0x15a180[_0x707c('0x28')]();};}function saveUpdates(_0x480df0,_0x4f749c){return function(_0x46bce1){if(_0x46bce1){return _0x46bce1[_0x707c('0x29')](_0x480df0)[_0x707c('0x2a')](function(_0x3b9f92){return _0x3b9f92;});}return null;};}function removeEntity(_0xe01f1c,_0x58957e){return function(_0x7d61df){if(_0x7d61df){return _0x7d61df['destroy']()[_0x707c('0x2a')](function(){_0xe01f1c[_0x707c('0x21')](0xcc)[_0x707c('0x20')]();});}};}function handleEntityNotFound(_0x42003f,_0x3b5885){return function(_0x148ab5){if(!_0x148ab5){_0x42003f[_0x707c('0x2b')](0x194);}return _0x148ab5;};}function handleError(_0x5988d7,_0x4607c8){_0x4607c8=_0x4607c8||0x1f4;return function(_0x3b4dac){logger[_0x707c('0x2c')](_0x3b4dac['stack']);if(_0x3b4dac['name']){delete _0x3b4dac[_0x707c('0x2d')];}_0x5988d7[_0x707c('0x21')](_0x4607c8)[_0x707c('0x2e')](_0x3b4dac);};}exports[_0x707c('0x2f')]=function(_0x581592,_0x376571){var _0x5cecc5={},_0x4ab6e1={},_0x5368c9={'count':0x0,'rows':[]};var _0x1cb44c=_['map'](db[_0x707c('0x30')]['rawAttributes'],function(_0x342014){return{'name':_0x342014[_0x707c('0x31')],'type':_0x342014[_0x707c('0x32')]['key']};});_0x4ab6e1[_0x707c('0x33')]=_[_0x707c('0x34')](_0x1cb44c,_0x707c('0x2d'));_0x4ab6e1[_0x707c('0x35')]=_[_0x707c('0x36')](_0x581592[_0x707c('0x35')]);_0x4ab6e1[_0x707c('0x37')]=_[_0x707c('0x38')](_0x4ab6e1[_0x707c('0x33')],_0x4ab6e1['query']);_0x5cecc5[_0x707c('0x39')]=_[_0x707c('0x38')](_0x4ab6e1['model'],qs[_0x707c('0x3a')](_0x581592[_0x707c('0x35')][_0x707c('0x3a')]));_0x5cecc5[_0x707c('0x39')]=_0x5cecc5[_0x707c('0x39')][_0x707c('0x3b')]?_0x5cecc5[_0x707c('0x39')]:_0x4ab6e1['model'];if(!_0x581592['query'][_0x707c('0x3c')](_0x707c('0x3d'))){_0x5cecc5[_0x707c('0x24')]=qs[_0x707c('0x24')](_0x581592[_0x707c('0x35')][_0x707c('0x24')]);_0x5cecc5[_0x707c('0x26')]=qs[_0x707c('0x26')](_0x581592[_0x707c('0x35')][_0x707c('0x26')]);}_0x5cecc5[_0x707c('0x3e')]=qs['sort'](_0x581592[_0x707c('0x35')][_0x707c('0x3f')]);_0x5cecc5['where']=qs['filters'](_['pick'](_0x581592[_0x707c('0x35')],_0x4ab6e1[_0x707c('0x37')]),_0x1cb44c);if(_0x581592[_0x707c('0x35')]['filter']){_0x5cecc5[_0x707c('0x40')]=_['merge'](_0x5cecc5[_0x707c('0x40')],{'$or':_[_0x707c('0x34')](_0x1cb44c,function(_0x4da5dc){if(_0x4da5dc[_0x707c('0x32')]!=='VIRTUAL'){var _0x33f099={};_0x33f099[_0x4da5dc[_0x707c('0x2d')]]={'$like':'%'+_0x581592[_0x707c('0x35')][_0x707c('0x41')]+'%'};return _0x33f099;}})});}_0x5cecc5=_[_0x707c('0x42')]({},_0x5cecc5,_0x581592[_0x707c('0x43')]);var _0xab429={'where':_0x5cecc5[_0x707c('0x40')]};return db[_0x707c('0x30')][_0x707c('0x25')](_0xab429)[_0x707c('0x2a')](function(_0x2c01fd){_0x5368c9[_0x707c('0x25')]=_0x2c01fd;if(_0x581592[_0x707c('0x35')][_0x707c('0x44')]){_0x5cecc5[_0x707c('0x45')]=[{'all':!![]}];}return db[_0x707c('0x30')][_0x707c('0x46')](_0x5cecc5);})[_0x707c('0x2a')](function(_0xe242c3){_0x5368c9[_0x707c('0x47')]=_0xe242c3;return _0x5368c9;})[_0x707c('0x2a')](respondWithFilteredResult(_0x376571,_0x5cecc5))[_0x707c('0x48')](handleError(_0x376571,null));};exports[_0x707c('0x49')]=function(_0x286253,_0x4e9b66){var _0x2ff968={'raw':![],'where':{'id':_0x286253[_0x707c('0x4a')]['id']}},_0x394819={};_0x394819[_0x707c('0x33')]=_['keys'](db[_0x707c('0x30')]['rawAttributes']);_0x394819[_0x707c('0x35')]=_[_0x707c('0x36')](_0x286253[_0x707c('0x35')]);_0x394819[_0x707c('0x37')]=_[_0x707c('0x38')](_0x394819[_0x707c('0x33')],_0x394819['query']);_0x2ff968[_0x707c('0x39')]=_['intersection'](_0x394819['model'],qs[_0x707c('0x3a')](_0x286253[_0x707c('0x35')][_0x707c('0x3a')]));_0x2ff968[_0x707c('0x39')]=_0x2ff968[_0x707c('0x39')]['length']?_0x2ff968[_0x707c('0x39')]:_0x394819[_0x707c('0x33')];if(_0x286253[_0x707c('0x35')]['includeAll']){_0x2ff968[_0x707c('0x45')]=[{'all':!![]}];}_0x2ff968=_[_0x707c('0x42')]({},_0x2ff968,_0x286253[_0x707c('0x43')]);return db[_0x707c('0x30')][_0x707c('0x4b')](_0x2ff968)[_0x707c('0x2a')](handleEntityNotFound(_0x4e9b66,null))['then'](respondWithResult(_0x4e9b66,null))[_0x707c('0x48')](handleError(_0x4e9b66,null));};exports[_0x707c('0x4c')]=function(_0x919493,_0x195cc2){return db[_0x707c('0x30')][_0x707c('0x4c')](_0x919493['body'],{})[_0x707c('0x2a')](respondWithResult(_0x195cc2,0xc9))[_0x707c('0x48')](handleError(_0x195cc2,null));};exports[_0x707c('0x29')]=function(_0x544338,_0x1d55a5){if(_0x544338[_0x707c('0x4d')]['id']){delete _0x544338['body']['id'];}return db['VoiceQueueReport'][_0x707c('0x4b')]({'where':{'id':_0x544338['params']['id']}})['then'](handleEntityNotFound(_0x1d55a5,null))[_0x707c('0x2a')](saveUpdates(_0x544338[_0x707c('0x4d')],null))[_0x707c('0x2a')](respondWithResult(_0x1d55a5,null))['catch'](handleError(_0x1d55a5,null));};exports['destroy']=function(_0x1e5a7f,_0x27edcf){return db[_0x707c('0x30')][_0x707c('0x4b')]({'where':{'id':_0x1e5a7f[_0x707c('0x4a')]['id']}})[_0x707c('0x2a')](handleEntityNotFound(_0x27edcf,null))[_0x707c('0x2a')](removeEntity(_0x27edcf,null))[_0x707c('0x48')](handleError(_0x27edcf,null));};exports[_0x707c('0x4e')]=function(_0x374c53,_0x15a941){return db['VoiceQueueReport'][_0x707c('0x4e')]()['then'](respondWithResult(_0x15a941,null))[_0x707c('0x48')](handleError(_0x15a941,null));};exports['getVoiceQueuesReport']=function(_0x35a598,_0x2a8256){var _0x5179f2={},_0x37b5ad={},_0x1ff0ed={'count':0x0,'rows':[]};_0x37b5ad[_0x707c('0x33')]=_[_0x707c('0x36')](db['VoiceQueueReport'][_0x707c('0x4f')]);_0x37b5ad[_0x707c('0x35')]=_['keys'](_0x35a598[_0x707c('0x35')]);_0x37b5ad[_0x707c('0x37')]=_[_0x707c('0x38')](_0x37b5ad[_0x707c('0x33')],_0x37b5ad[_0x707c('0x35')]);_0x5179f2[_0x707c('0x39')]=_[_0x707c('0x38')](_0x37b5ad[_0x707c('0x33')],qs['fields'](_0x35a598[_0x707c('0x35')][_0x707c('0x3a')]));_0x5179f2['attributes']=_0x5179f2['attributes'][_0x707c('0x3b')]?_0x5179f2[_0x707c('0x39')]:_0x37b5ad[_0x707c('0x33')];if(!_0x35a598['query'][_0x707c('0x3c')](_0x707c('0x3d'))){_0x5179f2[_0x707c('0x24')]=qs['limit'](_0x35a598['query'][_0x707c('0x24')]);_0x5179f2[_0x707c('0x26')]=qs[_0x707c('0x26')](_0x35a598[_0x707c('0x35')][_0x707c('0x26')]);}_0x5179f2[_0x707c('0x3e')]=qs[_0x707c('0x3f')](_0x35a598['query'][_0x707c('0x3f')]);_0x5179f2[_0x707c('0x40')]=qs['filters'](_['pick'](_0x35a598[_0x707c('0x35')],_0x37b5ad['filters']));if(_0x35a598[_0x707c('0x35')][_0x707c('0x41')]){_0x5179f2[_0x707c('0x40')]=_[_0x707c('0x42')](_0x5179f2['where'],{'$or':_[_0x707c('0x34')](_0x5179f2[_0x707c('0x39')],function(_0x22b7e8){var _0xd427a7={};_0xd427a7[_0x22b7e8]={'$like':'%'+_0x35a598[_0x707c('0x35')][_0x707c('0x41')]+'%'};return _0xd427a7;})});}_0x5179f2=_[_0x707c('0x42')]({},_0x5179f2,_0x35a598[_0x707c('0x43')]);var _0x10ae9e={'where':_0x5179f2[_0x707c('0x40')]};return db['VoiceQueueReport'][_0x707c('0x25')](_0x10ae9e)[_0x707c('0x2a')](function(_0x566d15){_0x1ff0ed[_0x707c('0x25')]=_0x566d15;if(_0x35a598[_0x707c('0x35')][_0x707c('0x44')]){_0x5179f2[_0x707c('0x45')]=[{'all':!![]}];}return db[_0x707c('0x30')][_0x707c('0x46')](_0x5179f2);})[_0x707c('0x2a')](function(_0x3ebda7){_0x1ff0ed['rows']=_0x3ebda7;return _0x1ff0ed;})[_0x707c('0x2a')](respondWithFilteredResult(_0x2a8256,_0x5179f2,_0x707c('0x50')))[_0x707c('0x48')](handleError(_0x2a8256,null,_0x707c('0x50')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 86a3e3a..fd68c2f 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 _0x4b21=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport'];(function(_0x48a928,_0x430727){var _0x11c1e9=function(_0x338805){while(--_0x338805){_0x48a928['push'](_0x48a928['shift']());}};_0x11c1e9(++_0x430727);}(_0x4b21,0xad));var _0x14b2=function(_0x2f25de,_0x2dc814){_0x2f25de=_0x2f25de-0x0;var _0x81d43e=_0x4b21[_0x2f25de];return _0x81d43e;};'use strict';var EventEmitter=require(_0x14b2('0x0'));var VoiceQueueReport=require(_0x14b2('0x1'))['db'][_0x14b2('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x14b2('0x3')](0x0);var events={'afterCreate':_0x14b2('0x4'),'afterUpdate':_0x14b2('0x5'),'afterDestroy':_0x14b2('0x6')};function emitEvent(_0x4acb67){return function(_0x1ff7f6,_0x5249bc,_0x13f296){VoiceQueueReportEvents['emit'](_0x4acb67+':'+_0x1ff7f6['id'],_0x1ff7f6);VoiceQueueReportEvents[_0x14b2('0x7')](_0x4acb67,_0x1ff7f6);_0x13f296(null);};}for(var e in events){if(events[_0x14b2('0x8')](e)){var event=events[e];VoiceQueueReport[_0x14b2('0x9')](e,emitEvent(event));}}module[_0x14b2('0xa')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xfbd1=['VoiceQueueReport','setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xfbd1,0x1a7));var _0x1fbd=function(_0x330939,_0x52dac5){_0x330939=_0x330939-0x0;var _0x4b5b43=_0xfbd1[_0x330939];return _0x4b5b43;};'use strict';var EventEmitter=require(_0x1fbd('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0x1fbd('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x1fbd('0x2')](0x0);var events={'afterCreate':_0x1fbd('0x3'),'afterUpdate':_0x1fbd('0x4'),'afterDestroy':'remove'};function emitEvent(_0x7311a){return function(_0x16fbab,_0x372365,_0x412b11){VoiceQueueReportEvents[_0x1fbd('0x5')](_0x7311a+':'+_0x16fbab['id'],_0x16fbab);VoiceQueueReportEvents[_0x1fbd('0x5')](_0x7311a,_0x16fbab);_0x412b11(null);};}for(var e in events){if(events[_0x1fbd('0x6')](e)){var event=events[e];VoiceQueueReport[_0x1fbd('0x7')](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 51b1006..c405a7a 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 _0xc0bc=['request-promise','path','rimraf','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','util','../../config/logger','api','moment'];(function(_0x2a9bd7,_0x4b6066){var _0x58ba5a=function(_0x1ecca2){while(--_0x1ecca2){_0x2a9bd7['push'](_0x2a9bd7['shift']());}};_0x58ba5a(++_0x4b6066);}(_0xc0bc,0x176));var _0xcc0b=function(_0x10472a,_0x33262f){_0x10472a=_0x10472a-0x0;var _0x208c8a=_0xc0bc[_0x10472a];return _0x208c8a;};'use strict';var _=require('lodash');var util=require(_0xcc0b('0x0'));var logger=require(_0xcc0b('0x1'))(_0xcc0b('0x2'));var moment=require(_0xcc0b('0x3'));var BPromise=require('bluebird');var rp=require(_0xcc0b('0x4'));var fs=require('fs');var path=require(_0xcc0b('0x5'));var rimraf=require(_0xcc0b('0x6'));var config=require('../../config/environment');var attributes=require(_0xcc0b('0x7'));module[_0xcc0b('0x8')]=function(_0x526a0d,_0x5b427c){return _0x526a0d[_0xcc0b('0x9')](_0xcc0b('0xa'),attributes,{'tableName':_0xcc0b('0xb'),'paranoid':![],'indexes':[{'fields':[_0xcc0b('0xc')]},{'fields':[_0xcc0b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf498=['api','bluebird','request-promise','path','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','uniqueid','calleridnum','util','../../config/logger'];(function(_0x2c8265,_0x328583){var _0x1246ed=function(_0x51a26d){while(--_0x51a26d){_0x2c8265['push'](_0x2c8265['shift']());}};_0x1246ed(++_0x328583);}(_0xf498,0x16a));var _0x8f49=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xf498[_0x1d24eb];return _0x1dc576;};'use strict';var _=require('lodash');var util=require(_0x8f49('0x0'));var logger=require(_0x8f49('0x1'))(_0x8f49('0x2'));var moment=require('moment');var BPromise=require(_0x8f49('0x3'));var rp=require(_0x8f49('0x4'));var fs=require('fs');var path=require(_0x8f49('0x5'));var rimraf=require('rimraf');var config=require(_0x8f49('0x6'));var attributes=require(_0x8f49('0x7'));module[_0x8f49('0x8')]=function(_0x51145e,_0x4ef60f){return _0x51145e[_0x8f49('0x9')](_0x8f49('0xa'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x8f49('0xb')]},{'fields':[_0x8f49('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index d987d47..fcd4dde 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 _0xd549=['error','message','info','GetVoiceQueueReport','findAll','options','raw','where','attributes','limit','map','include','model','then','catch','CreateVoiceQueueReport','VoiceQueueReport','create','body','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5d85,_0x51d81a){var _0x1754d0=function(_0xada2c6){while(--_0xada2c6){_0x5d85['push'](_0x5d85['shift']());}};_0x1754d0(++_0x51d81a);}(_0xd549,0x185));var _0x9d54=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xd549[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x9d54('0x0'));var util=require(_0x9d54('0x1'));var moment=require(_0x9d54('0x2'));var BPromise=require(_0x9d54('0x3'));var rs=require(_0x9d54('0x4'));var fs=require('fs');var Redis=require(_0x9d54('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9d54('0x6'));var logger=require(_0x9d54('0x7'))(_0x9d54('0x8'));var config=require(_0x9d54('0x9'));var jayson=require(_0x9d54('0xa'));var client=jayson[_0x9d54('0xb')][_0x9d54('0xc')]({'port':0x232a});config[_0x9d54('0xd')]=_[_0x9d54('0xe')](config[_0x9d54('0xd')],{'host':_0x9d54('0xf'),'port':0x18eb});var socket=require(_0x9d54('0x10'))(new Redis(config['redis']));require(_0x9d54('0x11'))[_0x9d54('0x12')](socket);function respondWithRpcPromise(_0x3c9cba,_0x4f9b9b,_0x44e9b6){return new BPromise(function(_0x2f9dea,_0x13849b){return client[_0x9d54('0x13')](_0x3c9cba,_0x44e9b6)['then'](function(_0x4d9383){logger['info'](_0x9d54('0x14'),_0x4f9b9b,_0x9d54('0x15'));logger[_0x9d54('0x16')](_0x9d54('0x17'),_0x4f9b9b,_0x9d54('0x15'),JSON[_0x9d54('0x18')](_0x4d9383));if(_0x4d9383[_0x9d54('0x19')]){if(_0x4d9383['error']['code']===0x1f4){logger['error'](_0x9d54('0x14'),_0x4f9b9b,_0x4d9383[_0x9d54('0x19')][_0x9d54('0x1a')]);return _0x13849b(_0x4d9383[_0x9d54('0x19')]['message']);}logger['error'](_0x9d54('0x14'),_0x4f9b9b,_0x4d9383['error']['message']);return _0x2f9dea(_0x4d9383['error'][_0x9d54('0x1a')]);}else{logger[_0x9d54('0x1b')](_0x9d54('0x14'),_0x4f9b9b,_0x9d54('0x15'));_0x2f9dea(_0x4d9383['result'][_0x9d54('0x1a')]);}})['catch'](function(_0x2bae5e){logger['error'](_0x9d54('0x14'),_0x4f9b9b,_0x2bae5e);_0x13849b(_0x2bae5e);});});}exports[_0x9d54('0x1c')]=function(_0x55da03){var _0x70eca9=this;return new Promise(function(_0x111ef0,_0x283cdf){return db['VoiceQueueReport'][_0x9d54('0x1d')]({'raw':_0x55da03['options']?_0x55da03[_0x9d54('0x1e')][_0x9d54('0x1f')]===undefined?!![]:![]:!![],'where':_0x55da03[_0x9d54('0x1e')]?_0x55da03[_0x9d54('0x1e')][_0x9d54('0x20')]||null:null,'attributes':_0x55da03[_0x9d54('0x1e')]?_0x55da03[_0x9d54('0x1e')][_0x9d54('0x21')]||null:null,'limit':_0x55da03['options']?_0x55da03[_0x9d54('0x1e')][_0x9d54('0x22')]||null:null,'include':_0x55da03['options']?_0x55da03[_0x9d54('0x1e')]['include']?_[_0x9d54('0x23')](_0x55da03['options'][_0x9d54('0x24')],function(_0x3cd658){return{'model':db[_0x3cd658[_0x9d54('0x25')]],'as':_0x3cd658['as'],'attributes':_0x3cd658[_0x9d54('0x21')],'include':_0x3cd658[_0x9d54('0x24')]?_['map'](_0x3cd658[_0x9d54('0x24')],function(_0x4e4c46){return{'model':db[_0x4e4c46[_0x9d54('0x25')]],'as':_0x4e4c46['as'],'attributes':_0x4e4c46[_0x9d54('0x21')],'include':_0x4e4c46[_0x9d54('0x24')]?_[_0x9d54('0x23')](_0x4e4c46[_0x9d54('0x24')],function(_0x3bc42e){return{'model':db[_0x3bc42e[_0x9d54('0x25')]],'as':_0x3bc42e['as'],'attributes':_0x3bc42e[_0x9d54('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9d54('0x26')](function(_0x2d0a05){logger[_0x9d54('0x1b')](_0x9d54('0x1c'),_0x55da03);logger[_0x9d54('0x16')]('GetVoiceQueueReport',_0x55da03,JSON[_0x9d54('0x18')](_0x2d0a05));_0x111ef0(_0x2d0a05);})[_0x9d54('0x27')](function(_0x27460c){logger[_0x9d54('0x19')](_0x9d54('0x1c'),_0x27460c['message'],_0x55da03);_0x283cdf(_0x70eca9[_0x9d54('0x19')](0x1f4,_0x27460c[_0x9d54('0x1a')]));});});};exports[_0x9d54('0x28')]=function(_0x1e6c18){var _0x3535e8=this;return new Promise(function(_0x3e7949,_0x4e6fdb){return db[_0x9d54('0x29')][_0x9d54('0x2a')](_0x1e6c18[_0x9d54('0x2b')],{'raw':_0x1e6c18[_0x9d54('0x1e')]?_0x1e6c18[_0x9d54('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x9d54('0x26')](function(_0xc672b3){logger[_0x9d54('0x1b')](_0x9d54('0x28'),_0x1e6c18);logger[_0x9d54('0x16')](_0x9d54('0x28'),_0x1e6c18,JSON[_0x9d54('0x18')](_0xc672b3));_0x3e7949(_0xc672b3);})[_0x9d54('0x27')](function(_0xce7cf){logger[_0x9d54('0x19')](_0x9d54('0x28'),_0xce7cf[_0x9d54('0x1a')],_0x1e6c18);_0x4e6fdb(_0x3535e8[_0x9d54('0x19')](0x1f4,_0xce7cf[_0x9d54('0x1a')]));});});};exports[_0x9d54('0x2c')]=function(_0xd8bd55){var _0x22626b=this;return new Promise(function(_0xc657e0,_0xd92ad2){return db[_0x9d54('0x29')][_0x9d54('0x2d')](_0xd8bd55[_0x9d54('0x2b')],{'raw':_0xd8bd55[_0x9d54('0x1e')]?_0xd8bd55[_0x9d54('0x1e')][_0x9d54('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd8bd55['options']?_0xd8bd55[_0x9d54('0x1e')][_0x9d54('0x20')]||null:null,'attributes':_0xd8bd55[_0x9d54('0x1e')]?_0xd8bd55['options'][_0x9d54('0x21')]||null:null,'limit':_0xd8bd55[_0x9d54('0x1e')]?_0xd8bd55['options']['limit']||null:null})['then'](function(_0x35665a){logger[_0x9d54('0x1b')](_0x9d54('0x2c'),_0xd8bd55);logger[_0x9d54('0x16')](_0x9d54('0x2c'),_0xd8bd55,JSON[_0x9d54('0x18')](_0x35665a));_0xc657e0(_0x35665a);})['catch'](function(_0x4478ae){logger[_0x9d54('0x19')](_0x9d54('0x2c'),_0x4478ae[_0x9d54('0x1a')],_0xd8bd55);_0xd92ad2(_0x22626b[_0x9d54('0x19')](0x1f4,_0x4478ae[_0x9d54('0x1a')]));});});}; \ No newline at end of file +var _0x2630=['redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','attributes','limit','include','map','model','body','CreateVoiceQueueReport','debug','stringify','UpdateVoiceQueueReport','update','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x570d11,_0x3d0c5b){var _0x57e786=function(_0x3f8ffa){while(--_0x3f8ffa){_0x570d11['push'](_0x570d11['shift']());}};_0x57e786(++_0x3d0c5b);}(_0x2630,0xa4));var _0x0263=function(_0x227dc1,_0x24eb83){_0x227dc1=_0x227dc1-0x0;var _0x19ac83=_0x2630[_0x227dc1];return _0x19ac83;};'use strict';var _=require(_0x0263('0x0'));var util=require(_0x0263('0x1'));var moment=require(_0x0263('0x2'));var BPromise=require(_0x0263('0x3'));var rs=require(_0x0263('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0263('0x5'))['db'];var utils=require(_0x0263('0x6'));var logger=require(_0x0263('0x7'))('rpc');var config=require(_0x0263('0x8'));var jayson=require(_0x0263('0x9'));var client=jayson[_0x0263('0xa')][_0x0263('0xb')]({'port':0x232a});config[_0x0263('0xc')]=_[_0x0263('0xd')](config[_0x0263('0xc')],{'host':_0x0263('0xe'),'port':0x18eb});var socket=require(_0x0263('0xf'))(new Redis(config[_0x0263('0xc')]));require(_0x0263('0x10'))['register'](socket);function respondWithRpcPromise(_0xb069d2,_0x4baa83,_0x45c78b){return new BPromise(function(_0x188568,_0xb71090){return client['request'](_0xb069d2,_0x45c78b)[_0x0263('0x11')](function(_0x3952eb){logger[_0x0263('0x12')](_0x0263('0x13'),_0x4baa83,_0x0263('0x14'));logger['debug'](_0x0263('0x15'),_0x4baa83,_0x0263('0x14'),JSON['stringify'](_0x3952eb));if(_0x3952eb['error']){if(_0x3952eb[_0x0263('0x16')][_0x0263('0x17')]===0x1f4){logger[_0x0263('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x4baa83,_0x3952eb['error'][_0x0263('0x18')]);return _0xb71090(_0x3952eb[_0x0263('0x16')][_0x0263('0x18')]);}logger['error'](_0x0263('0x13'),_0x4baa83,_0x3952eb['error']['message']);return _0x188568(_0x3952eb[_0x0263('0x16')][_0x0263('0x18')]);}else{logger['info'](_0x0263('0x13'),_0x4baa83,_0x0263('0x14'));_0x188568(_0x3952eb[_0x0263('0x19')][_0x0263('0x18')]);}})[_0x0263('0x1a')](function(_0x57d22c){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x4baa83,_0x57d22c);_0xb71090(_0x57d22c);});});}exports[_0x0263('0x1b')]=function(_0x3e7779){var _0x13352c=this;return new Promise(function(_0x1d2892,_0x4dc52f){return db[_0x0263('0x1c')][_0x0263('0x1d')]({'raw':_0x3e7779[_0x0263('0x1e')]?_0x3e7779[_0x0263('0x1e')][_0x0263('0x1f')]===undefined?!![]:![]:!![],'where':_0x3e7779[_0x0263('0x1e')]?_0x3e7779['options']['where']||null:null,'attributes':_0x3e7779[_0x0263('0x1e')]?_0x3e7779[_0x0263('0x1e')][_0x0263('0x20')]||null:null,'limit':_0x3e7779[_0x0263('0x1e')]?_0x3e7779['options'][_0x0263('0x21')]||null:null,'include':_0x3e7779[_0x0263('0x1e')]?_0x3e7779[_0x0263('0x1e')][_0x0263('0x22')]?_[_0x0263('0x23')](_0x3e7779[_0x0263('0x1e')]['include'],function(_0x4acf1f){return{'model':db[_0x4acf1f[_0x0263('0x24')]],'as':_0x4acf1f['as'],'attributes':_0x4acf1f[_0x0263('0x20')],'include':_0x4acf1f[_0x0263('0x22')]?_[_0x0263('0x23')](_0x4acf1f[_0x0263('0x22')],function(_0x204fc0){return{'model':db[_0x204fc0[_0x0263('0x24')]],'as':_0x204fc0['as'],'attributes':_0x204fc0[_0x0263('0x20')],'include':_0x204fc0['include']?_[_0x0263('0x23')](_0x204fc0[_0x0263('0x22')],function(_0x17f464){return{'model':db[_0x17f464[_0x0263('0x24')]],'as':_0x17f464['as'],'attributes':_0x17f464[_0x0263('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0263('0x11')](function(_0x8b4083){logger[_0x0263('0x12')]('GetVoiceQueueReport',_0x3e7779);logger['debug']('GetVoiceQueueReport',_0x3e7779,JSON['stringify'](_0x8b4083));_0x1d2892(_0x8b4083);})[_0x0263('0x1a')](function(_0x55b89c){logger[_0x0263('0x16')](_0x0263('0x1b'),_0x55b89c[_0x0263('0x18')],_0x3e7779);_0x4dc52f(_0x13352c[_0x0263('0x16')](0x1f4,_0x55b89c['message']));});});};exports['CreateVoiceQueueReport']=function(_0x121cbc){var _0x226a1e=this;return new Promise(function(_0x25c5f5,_0x734a81){return db[_0x0263('0x1c')]['create'](_0x121cbc[_0x0263('0x25')],{'raw':_0x121cbc[_0x0263('0x1e')]?_0x121cbc[_0x0263('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x0263('0x11')](function(_0x53978a){logger[_0x0263('0x12')](_0x0263('0x26'),_0x121cbc);logger[_0x0263('0x27')]('CreateVoiceQueueReport',_0x121cbc,JSON[_0x0263('0x28')](_0x53978a));_0x25c5f5(_0x53978a);})[_0x0263('0x1a')](function(_0x5634ca){logger['error'](_0x0263('0x26'),_0x5634ca[_0x0263('0x18')],_0x121cbc);_0x734a81(_0x226a1e[_0x0263('0x16')](0x1f4,_0x5634ca[_0x0263('0x18')]));});});};exports[_0x0263('0x29')]=function(_0x254235){var _0x3d3f0c=this;return new Promise(function(_0x56ddd7,_0x955107){return db[_0x0263('0x1c')][_0x0263('0x2a')](_0x254235[_0x0263('0x25')],{'raw':_0x254235['options']?_0x254235[_0x0263('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x254235['options']?_0x254235['options'][_0x0263('0x2b')]||null:null,'attributes':_0x254235['options']?_0x254235[_0x0263('0x1e')][_0x0263('0x20')]||null:null,'limit':_0x254235['options']?_0x254235[_0x0263('0x1e')]['limit']||null:null})[_0x0263('0x11')](function(_0x2d98b7){logger['info'](_0x0263('0x29'),_0x254235);logger[_0x0263('0x27')]('UpdateVoiceQueueReport',_0x254235,JSON['stringify'](_0x2d98b7));_0x56ddd7(_0x2d98b7);})[_0x0263('0x1a')](function(_0x290e2c){logger['error'](_0x0263('0x29'),_0x290e2c['message'],_0x254235);_0x955107(_0x3d3f0c[_0x0263('0x16')](0x1f4,_0x290e2c['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index d811d9c..fb9e261 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 _0x5bb7=['update','emit','removeListener','register','./voiceQueueReport.events','save','remove'];(function(_0x230ecb,_0x252a4f){var _0x455336=function(_0x2bca98){while(--_0x2bca98){_0x230ecb['push'](_0x230ecb['shift']());}};_0x455336(++_0x252a4f);}(_0x5bb7,0x1ee));var _0x75bb=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x5bb7[_0x521929];return _0x632436;};'use strict';var VoiceQueueReportEvents=require(_0x75bb('0x0'));var events=[_0x75bb('0x1'),_0x75bb('0x2'),_0x75bb('0x3')];function createListener(_0x1ac6a2,_0x8cb0e0){return function(_0x384031){_0x8cb0e0[_0x75bb('0x4')](_0x1ac6a2,_0x384031);};}function removeListener(_0x5eee14,_0xc37a01){return function(){VoiceQueueReportEvents[_0x75bb('0x5')](_0x5eee14,_0xc37a01);};}exports[_0x75bb('0x6')]=function(_0x16d98f){for(var _0x2b5abd=0x0,_0x581208=events['length'];_0x2b5abd<_0x581208;_0x2b5abd++){var _0x4ce4af=events[_0x2b5abd];var _0x372ade=createListener('voiceQueueReport:'+_0x4ce4af,_0x16d98f);VoiceQueueReportEvents['on'](_0x4ce4af,_0x372ade);}}; \ No newline at end of file +var _0xfb15=['save','remove','update','emit','removeListener','register','voiceQueueReport:','./voiceQueueReport.events'];(function(_0x1f4564,_0x4cf78a){var _0x9554bd=function(_0x326871){while(--_0x326871){_0x1f4564['push'](_0x1f4564['shift']());}};_0x9554bd(++_0x4cf78a);}(_0xfb15,0x12f));var _0x5fb1=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xfb15[_0x432682];return _0x463d05;};'use strict';var VoiceQueueReportEvents=require(_0x5fb1('0x0'));var events=[_0x5fb1('0x1'),_0x5fb1('0x2'),_0x5fb1('0x3')];function createListener(_0x3024e7,_0x307c96){return function(_0x5323db){_0x307c96[_0x5fb1('0x4')](_0x3024e7,_0x5323db);};}function removeListener(_0x253775,_0x3a82a1){return function(){VoiceQueueReportEvents[_0x5fb1('0x5')](_0x253775,_0x3a82a1);};}exports[_0x5fb1('0x6')]=function(_0x23e770){for(var _0x51a96b=0x0,_0x2e68c9=events['length'];_0x51a96b<_0x2e68c9;_0x51a96b++){var _0x55b282=events[_0x51a96b];var _0x267223=createListener(_0x5fb1('0x7')+_0x55b282,_0x23e770);VoiceQueueReportEvents['on'](_0x55b282,_0x267223);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 8510373..4cb6e17 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 _0x3583=['../../config/environment','./voiceQueuesLog.controller','isAuthenticated','index','get','/:id','show','post','put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x19269c,_0x1b8542){var _0x43a835=function(_0x40b177){while(--_0x40b177){_0x19269c['push'](_0x19269c['shift']());}};_0x43a835(++_0x1b8542);}(_0x3583,0xa4));var _0x3358=function(_0x1cde96,_0xa4902f){_0x1cde96=_0x1cde96-0x0;var _0x5d9777=_0x3583[_0x1cde96];return _0x5d9777;};'use strict';var multer=require(_0x3358('0x0'));var util=require('util');var path=require(_0x3358('0x1'));var timeout=require('connect-timeout');var express=require(_0x3358('0x2'));var router=express[_0x3358('0x3')]();var fs_extra=require(_0x3358('0x4'));var auth=require(_0x3358('0x5'));var interaction=require(_0x3358('0x6'));var config=require(_0x3358('0x7'));var controller=require(_0x3358('0x8'));router['get']('/',auth[_0x3358('0x9')](),controller[_0x3358('0xa')]);router[_0x3358('0xb')](_0x3358('0xc'),auth[_0x3358('0x9')](),controller[_0x3358('0xd')]);router[_0x3358('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3358('0xf')](_0x3358('0xc'),auth[_0x3358('0x9')](),controller[_0x3358('0x10')]);router[_0x3358('0x11')]('/:id',auth[_0x3358('0x9')](),controller[_0x3358('0x12')]);module['exports']=router; \ No newline at end of file +var _0x2904=['update','delete','destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','create','put'];(function(_0x5cca33,_0x1a1607){var _0x1fbc89=function(_0x22312e){while(--_0x22312e){_0x5cca33['push'](_0x5cca33['shift']());}};_0x1fbc89(++_0x1a1607);}(_0x2904,0x16b));var _0x4290=function(_0x23037e,_0x223914){_0x23037e=_0x23037e-0x0;var _0x4c5cf7=_0x2904[_0x23037e];return _0x4c5cf7;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x4290('0x0'));var express=require(_0x4290('0x1'));var router=express[_0x4290('0x2')]();var fs_extra=require(_0x4290('0x3'));var auth=require(_0x4290('0x4'));var interaction=require(_0x4290('0x5'));var config=require(_0x4290('0x6'));var controller=require(_0x4290('0x7'));router[_0x4290('0x8')]('/',auth[_0x4290('0x9')](),controller[_0x4290('0xa')]);router['get'](_0x4290('0xb'),auth[_0x4290('0x9')](),controller[_0x4290('0xc')]);router['post']('/',auth[_0x4290('0x9')](),controller[_0x4290('0xd')]);router[_0x4290('0xe')](_0x4290('0xb'),auth[_0x4290('0x9')](),controller[_0x4290('0xf')]);router[_0x4290('0x10')](_0x4290('0xb'),auth[_0x4290('0x9')](),controller[_0x4290('0x11')]);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 fe9ecbe..dde96f9 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 _0x22f2=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x22f2,0xd6));var _0x222f=function(_0x3e6ded,_0x2fb910){_0x3e6ded=_0x3e6ded-0x0;var _0x80aa9a=_0x22f2[_0x3e6ded];return _0x80aa9a;};'use strict';var Sequelize=require(_0x222f('0x0'));var moment=require(_0x222f('0x1'));module[_0x222f('0x2')]={'time':{'type':Sequelize[_0x222f('0x3')]},'callid':{'type':Sequelize[_0x222f('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x222f('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x222f('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x222f('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x222f('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x222f('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x222f('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x222f('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x222f('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x222f('0x4')],'allowNull':![],'defaultValue':moment()[_0x222f('0x5')](_0x222f('0x6'))}}; \ No newline at end of file +var _0xa9c7=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9c7,0x148));var _0x7a9c=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xa9c7[_0x25e7cb];return _0x375d92;};'use strict';var Sequelize=require(_0x7a9c('0x0'));var moment=require('moment');module['exports']={'time':{'type':Sequelize[_0x7a9c('0x1')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x7a9c('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x7a9c('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x7a9c('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x7a9c('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x7a9c('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x7a9c('0x2')],'allowNull':![],'defaultValue':moment()[_0x7a9c('0x3')](_0x7a9c('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 2ac25cf..3e86aa9 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 _0x567c=['mustache','util','path','sox','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','stack','name','send','index','VoiceQueuesLog','rawAttributes','type','key','model','map','filters','intersection','query','attributes','fields','length','nolimit','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x1a2ef3,_0x21186c){var _0x34f4a4=function(_0x277126){while(--_0x277126){_0x1a2ef3['push'](_0x1a2ef3['shift']());}};_0x34f4a4(++_0x21186c);}(_0x567c,0x161));var _0xc567=function(_0x369bb7,_0xc64de6){_0x369bb7=_0x369bb7-0x0;var _0x359971=_0x567c[_0x369bb7];return _0x359971;};'use strict';var emlformat=require(_0xc567('0x0'));var rimraf=require(_0xc567('0x1'));var zipdir=require(_0xc567('0x2'));var jsonpatch=require(_0xc567('0x3'));var rp=require(_0xc567('0x4'));var moment=require(_0xc567('0x5'));var BPromise=require(_0xc567('0x6'));var Mustache=require(_0xc567('0x7'));var util=require(_0xc567('0x8'));var path=require(_0xc567('0x9'));var sox=require(_0xc567('0xa'));var csv=require('to-csv');var ejs=require(_0xc567('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc567('0xc'));var crypto=require(_0xc567('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc567('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc567('0xf'));var Papa=require(_0xc567('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc567('0x11'));var as=require(_0xc567('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc567('0x13'))(_0xc567('0x14'));var utils=require('../../config/utils');var config=require(_0xc567('0x15'));var licenseUtil=require(_0xc567('0x16'));var db=require(_0xc567('0x17'))['db'];function respondWithStatusCode(_0x14203b,_0x25deca){_0x25deca=_0x25deca||0xcc;return function(_0x5ec762){if(_0x5ec762){return _0x14203b[_0xc567('0x18')](_0x25deca);}return _0x14203b[_0xc567('0x19')](_0x25deca)[_0xc567('0x1a')]();};}function respondWithResult(_0x1c342b,_0x242f92){_0x242f92=_0x242f92||0xc8;return function(_0x19b006){if(_0x19b006){return _0x1c342b['status'](_0x242f92)[_0xc567('0x1b')](_0x19b006);}};}function respondWithFilteredResult(_0x51bbac,_0x47c2a3){return function(_0x4f13ef){if(_0x4f13ef){var _0x17c80f=typeof _0x47c2a3[_0xc567('0x1c')]===_0xc567('0x1d')&&typeof _0x47c2a3[_0xc567('0x1e')]==='undefined';var _0x1b59b0=_0x4f13ef[_0xc567('0x1f')];var _0xa4f29b=_0x17c80f?0x0:_0x47c2a3[_0xc567('0x1c')];var _0x2f65b9=_0x17c80f?_0x4f13ef[_0xc567('0x1f')]:_0x47c2a3[_0xc567('0x1c')]+_0x47c2a3[_0xc567('0x1e')];var _0x128ea4;if(_0x2f65b9>=_0x1b59b0){_0x2f65b9=_0x1b59b0;_0x128ea4=0xc8;}else{_0x128ea4=0xce;}_0x51bbac['status'](_0x128ea4);return _0x51bbac['set']('Content-Range',_0xa4f29b+'-'+_0x2f65b9+'/'+_0x1b59b0)[_0xc567('0x1b')](_0x4f13ef);}return null;};}function patchUpdates(_0x445f8e){return function(_0xf79778){try{jsonpatch[_0xc567('0x20')](_0xf79778,_0x445f8e,!![]);}catch(_0x157273){return BPromise[_0xc567('0x21')](_0x157273);}return _0xf79778[_0xc567('0x22')]();};}function saveUpdates(_0x59627f,_0x3aedff){return function(_0xca6be6){if(_0xca6be6){return _0xca6be6[_0xc567('0x23')](_0x59627f)['then'](function(_0x347639){return _0x347639;});}return null;};}function removeEntity(_0x2bf6f3,_0x3db3e8){return function(_0x352d22){if(_0x352d22){return _0x352d22[_0xc567('0x24')]()[_0xc567('0x25')](function(){_0x2bf6f3[_0xc567('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51538f,_0x1b79e3){return function(_0x12436c){if(!_0x12436c){_0x51538f[_0xc567('0x18')](0x194);}return _0x12436c;};}function handleError(_0x55e1c1,_0x2c89aa){_0x2c89aa=_0x2c89aa||0x1f4;return function(_0x1128f0){logger['error'](_0x1128f0[_0xc567('0x26')]);if(_0x1128f0[_0xc567('0x27')]){delete _0x1128f0[_0xc567('0x27')];}_0x55e1c1[_0xc567('0x19')](_0x2c89aa)[_0xc567('0x28')](_0x1128f0);};}exports[_0xc567('0x29')]=function(_0x31a290,_0x4c6e38){var _0x386e4d={},_0x33235b={},_0x217bf8={'count':0x0,'rows':[]};var _0x4bcbdf=_['map'](db[_0xc567('0x2a')][_0xc567('0x2b')],function(_0x106b2b){return{'name':_0x106b2b['fieldName'],'type':_0x106b2b[_0xc567('0x2c')][_0xc567('0x2d')]};});_0x33235b[_0xc567('0x2e')]=_[_0xc567('0x2f')](_0x4bcbdf,_0xc567('0x27'));_0x33235b['query']=_['keys'](_0x31a290['query']);_0x33235b[_0xc567('0x30')]=_[_0xc567('0x31')](_0x33235b['model'],_0x33235b[_0xc567('0x32')]);_0x386e4d[_0xc567('0x33')]=_['intersection'](_0x33235b[_0xc567('0x2e')],qs[_0xc567('0x34')](_0x31a290[_0xc567('0x32')][_0xc567('0x34')]));_0x386e4d[_0xc567('0x33')]=_0x386e4d['attributes'][_0xc567('0x35')]?_0x386e4d[_0xc567('0x33')]:_0x33235b[_0xc567('0x2e')];if(!_0x31a290[_0xc567('0x32')]['hasOwnProperty'](_0xc567('0x36'))){_0x386e4d[_0xc567('0x1e')]=qs[_0xc567('0x1e')](_0x31a290[_0xc567('0x32')]['limit']);_0x386e4d[_0xc567('0x1c')]=qs[_0xc567('0x1c')](_0x31a290[_0xc567('0x32')][_0xc567('0x1c')]);}_0x386e4d['order']=qs[_0xc567('0x37')](_0x31a290[_0xc567('0x32')][_0xc567('0x37')]);_0x386e4d['where']=qs['filters'](_[_0xc567('0x38')](_0x31a290['query'],_0x33235b[_0xc567('0x30')]),_0x4bcbdf);if(_0x31a290['query']['filter']){_0x386e4d[_0xc567('0x39')]=_['merge'](_0x386e4d[_0xc567('0x39')],{'$or':_[_0xc567('0x2f')](_0x4bcbdf,function(_0x56dfff){if(_0x56dfff[_0xc567('0x2c')]!==_0xc567('0x3a')){var _0x4350fd={};_0x4350fd[_0x56dfff[_0xc567('0x27')]]={'$like':'%'+_0x31a290[_0xc567('0x32')][_0xc567('0x3b')]+'%'};return _0x4350fd;}})});}_0x386e4d=_[_0xc567('0x3c')]({},_0x386e4d,_0x31a290[_0xc567('0x3d')]);var _0x256309={'where':_0x386e4d[_0xc567('0x39')]};return db[_0xc567('0x2a')]['count'](_0x256309)[_0xc567('0x25')](function(_0x1880e9){_0x217bf8[_0xc567('0x1f')]=_0x1880e9;if(_0x31a290[_0xc567('0x32')][_0xc567('0x3e')]){_0x386e4d[_0xc567('0x3f')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xc567('0x40')](_0x386e4d);})['then'](function(_0x2f6c1c){_0x217bf8['rows']=_0x2f6c1c;return _0x217bf8;})[_0xc567('0x25')](respondWithFilteredResult(_0x4c6e38,_0x386e4d))[_0xc567('0x41')](handleError(_0x4c6e38,null));};exports[_0xc567('0x42')]=function(_0x23c63c,_0x5c43ce){var _0x6e6638={'raw':!![],'where':{'id':_0x23c63c[_0xc567('0x43')]['id']}},_0x5043ce={};_0x5043ce[_0xc567('0x2e')]=_[_0xc567('0x44')](db[_0xc567('0x2a')][_0xc567('0x2b')]);_0x5043ce['query']=_[_0xc567('0x44')](_0x23c63c[_0xc567('0x32')]);_0x5043ce['filters']=_[_0xc567('0x31')](_0x5043ce[_0xc567('0x2e')],_0x5043ce[_0xc567('0x32')]);_0x6e6638[_0xc567('0x33')]=_[_0xc567('0x31')](_0x5043ce[_0xc567('0x2e')],qs[_0xc567('0x34')](_0x23c63c['query']['fields']));_0x6e6638['attributes']=_0x6e6638[_0xc567('0x33')][_0xc567('0x35')]?_0x6e6638[_0xc567('0x33')]:_0x5043ce[_0xc567('0x2e')];if(_0x23c63c[_0xc567('0x32')]['includeAll']){_0x6e6638[_0xc567('0x3f')]=[{'all':!![]}];}_0x6e6638=_[_0xc567('0x3c')]({},_0x6e6638,_0x23c63c[_0xc567('0x3d')]);return db[_0xc567('0x2a')][_0xc567('0x45')](_0x6e6638)[_0xc567('0x25')](handleEntityNotFound(_0x5c43ce,null))[_0xc567('0x25')](respondWithResult(_0x5c43ce,null))[_0xc567('0x41')](handleError(_0x5c43ce,null));};exports['create']=function(_0x347921,_0x45d36a){return db[_0xc567('0x2a')][_0xc567('0x46')](_0x347921[_0xc567('0x47')],{})[_0xc567('0x25')](respondWithResult(_0x45d36a,0xc9))['catch'](handleError(_0x45d36a,null));};exports['update']=function(_0x1d676e,_0x46b26){if(_0x1d676e[_0xc567('0x47')]['id']){delete _0x1d676e['body']['id'];}return db[_0xc567('0x2a')]['find']({'where':{'id':_0x1d676e[_0xc567('0x43')]['id']}})[_0xc567('0x25')](handleEntityNotFound(_0x46b26,null))[_0xc567('0x25')](saveUpdates(_0x1d676e[_0xc567('0x47')],null))[_0xc567('0x25')](respondWithResult(_0x46b26,null))[_0xc567('0x41')](handleError(_0x46b26,null));};exports[_0xc567('0x24')]=function(_0x33fb83,_0x937779){return db[_0xc567('0x2a')]['find']({'where':{'id':_0x33fb83[_0xc567('0x43')]['id']}})[_0xc567('0x25')](handleEntityNotFound(_0x937779,null))[_0xc567('0x25')](removeEntity(_0x937779,null))['catch'](handleError(_0x937779,null));}; \ No newline at end of file +var _0x295d=['destroy','error','stack','name','send','index','map','VoiceQueuesLog','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','include','rows','catch','show','params','rawAttributes','includeAll','find','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then'];(function(_0x7e6630,_0x4a374d){var _0x4c9398=function(_0x20e5be){while(--_0x20e5be){_0x7e6630['push'](_0x7e6630['shift']());}};_0x4c9398(++_0x4a374d);}(_0x295d,0x6e));var _0xd295=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x295d[_0xa1e3e3];return _0xc980e9;};'use strict';var emlformat=require(_0xd295('0x0'));var rimraf=require(_0xd295('0x1'));var zipdir=require(_0xd295('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd295('0x3'));var moment=require('moment');var BPromise=require(_0xd295('0x4'));var Mustache=require(_0xd295('0x5'));var util=require('util');var path=require(_0xd295('0x6'));var sox=require(_0xd295('0x7'));var csv=require(_0xd295('0x8'));var ejs=require(_0xd295('0x9'));var fs=require('fs');var fs_extra=require(_0xd295('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd295('0xb'));var deskjs=require(_0xd295('0xc'));var toCsv=require(_0xd295('0x8'));var querystring=require(_0xd295('0xd'));var Papa=require(_0xd295('0xe'));var Redis=require(_0xd295('0xf'));var authService=require(_0xd295('0x10'));var qs=require(_0xd295('0x11'));var as=require(_0xd295('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd295('0x13'))(_0xd295('0x14'));var utils=require(_0xd295('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bc1cf,_0x415bd3){_0x415bd3=_0x415bd3||0xcc;return function(_0x1c2172){if(_0x1c2172){return _0x2bc1cf[_0xd295('0x16')](_0x415bd3);}return _0x2bc1cf[_0xd295('0x17')](_0x415bd3)[_0xd295('0x18')]();};}function respondWithResult(_0x191442,_0x58fd82){_0x58fd82=_0x58fd82||0xc8;return function(_0x227cfb){if(_0x227cfb){return _0x191442['status'](_0x58fd82)[_0xd295('0x19')](_0x227cfb);}};}function respondWithFilteredResult(_0x1fdf74,_0x522366){return function(_0x790412){if(_0x790412){var _0x2558bb=typeof _0x522366[_0xd295('0x1a')]===_0xd295('0x1b')&&typeof _0x522366[_0xd295('0x1c')]===_0xd295('0x1b');var _0x35b46e=_0x790412[_0xd295('0x1d')];var _0x150550=_0x2558bb?0x0:_0x522366['offset'];var _0x1e698f=_0x2558bb?_0x790412['count']:_0x522366['offset']+_0x522366[_0xd295('0x1c')];var _0x2d1c7a;if(_0x1e698f>=_0x35b46e){_0x1e698f=_0x35b46e;_0x2d1c7a=0xc8;}else{_0x2d1c7a=0xce;}_0x1fdf74[_0xd295('0x17')](_0x2d1c7a);return _0x1fdf74[_0xd295('0x1e')](_0xd295('0x1f'),_0x150550+'-'+_0x1e698f+'/'+_0x35b46e)[_0xd295('0x19')](_0x790412);}return null;};}function patchUpdates(_0x38081e){return function(_0x49d645){try{jsonpatch[_0xd295('0x20')](_0x49d645,_0x38081e,!![]);}catch(_0x743fae){return BPromise['reject'](_0x743fae);}return _0x49d645[_0xd295('0x21')]();};}function saveUpdates(_0x10159a,_0x2a25cc){return function(_0x5e0573){if(_0x5e0573){return _0x5e0573[_0xd295('0x22')](_0x10159a)[_0xd295('0x23')](function(_0x456684){return _0x456684;});}return null;};}function removeEntity(_0x4d9cca,_0x56de86){return function(_0x5bc8b4){if(_0x5bc8b4){return _0x5bc8b4[_0xd295('0x24')]()[_0xd295('0x23')](function(){_0x4d9cca[_0xd295('0x17')](0xcc)[_0xd295('0x18')]();});}};}function handleEntityNotFound(_0x3f8d69,_0x186ece){return function(_0x3a500e){if(!_0x3a500e){_0x3f8d69[_0xd295('0x16')](0x194);}return _0x3a500e;};}function handleError(_0x2c2e98,_0x4b8233){_0x4b8233=_0x4b8233||0x1f4;return function(_0x1eeefa){logger[_0xd295('0x25')](_0x1eeefa[_0xd295('0x26')]);if(_0x1eeefa[_0xd295('0x27')]){delete _0x1eeefa[_0xd295('0x27')];}_0x2c2e98['status'](_0x4b8233)[_0xd295('0x28')](_0x1eeefa);};}exports[_0xd295('0x29')]=function(_0x40f5b9,_0x15b137){var _0x403e32={},_0x3978c2={},_0xbe9f08={'count':0x0,'rows':[]};var _0x1044be=_[_0xd295('0x2a')](db[_0xd295('0x2b')]['rawAttributes'],function(_0x24555e){return{'name':_0x24555e[_0xd295('0x2c')],'type':_0x24555e[_0xd295('0x2d')][_0xd295('0x2e')]};});_0x3978c2[_0xd295('0x2f')]=_[_0xd295('0x2a')](_0x1044be,_0xd295('0x27'));_0x3978c2[_0xd295('0x30')]=_[_0xd295('0x31')](_0x40f5b9[_0xd295('0x30')]);_0x3978c2[_0xd295('0x32')]=_[_0xd295('0x33')](_0x3978c2['model'],_0x3978c2[_0xd295('0x30')]);_0x403e32[_0xd295('0x34')]=_['intersection'](_0x3978c2[_0xd295('0x2f')],qs[_0xd295('0x35')](_0x40f5b9[_0xd295('0x30')]['fields']));_0x403e32[_0xd295('0x34')]=_0x403e32[_0xd295('0x34')][_0xd295('0x36')]?_0x403e32[_0xd295('0x34')]:_0x3978c2[_0xd295('0x2f')];if(!_0x40f5b9[_0xd295('0x30')][_0xd295('0x37')](_0xd295('0x38'))){_0x403e32[_0xd295('0x1c')]=qs[_0xd295('0x1c')](_0x40f5b9[_0xd295('0x30')][_0xd295('0x1c')]);_0x403e32[_0xd295('0x1a')]=qs[_0xd295('0x1a')](_0x40f5b9['query'][_0xd295('0x1a')]);}_0x403e32[_0xd295('0x39')]=qs[_0xd295('0x3a')](_0x40f5b9[_0xd295('0x30')][_0xd295('0x3a')]);_0x403e32['where']=qs[_0xd295('0x32')](_['pick'](_0x40f5b9[_0xd295('0x30')],_0x3978c2['filters']),_0x1044be);if(_0x40f5b9[_0xd295('0x30')][_0xd295('0x3b')]){_0x403e32[_0xd295('0x3c')]=_[_0xd295('0x3d')](_0x403e32[_0xd295('0x3c')],{'$or':_['map'](_0x1044be,function(_0x4c95d7){if(_0x4c95d7[_0xd295('0x2d')]!==_0xd295('0x3e')){var _0x3d655e={};_0x3d655e[_0x4c95d7[_0xd295('0x27')]]={'$like':'%'+_0x40f5b9[_0xd295('0x30')]['filter']+'%'};return _0x3d655e;}})});}_0x403e32=_[_0xd295('0x3d')]({},_0x403e32,_0x40f5b9['options']);var _0xb9a426={'where':_0x403e32[_0xd295('0x3c')]};return db[_0xd295('0x2b')][_0xd295('0x1d')](_0xb9a426)[_0xd295('0x23')](function(_0x3daf6){_0xbe9f08['count']=_0x3daf6;if(_0x40f5b9[_0xd295('0x30')]['includeAll']){_0x403e32[_0xd295('0x3f')]=[{'all':!![]}];}return db[_0xd295('0x2b')]['findAll'](_0x403e32);})[_0xd295('0x23')](function(_0x2ad597){_0xbe9f08[_0xd295('0x40')]=_0x2ad597;return _0xbe9f08;})[_0xd295('0x23')](respondWithFilteredResult(_0x15b137,_0x403e32))[_0xd295('0x41')](handleError(_0x15b137,null));};exports[_0xd295('0x42')]=function(_0x3ac105,_0x44a607){var _0x4addeb={'raw':!![],'where':{'id':_0x3ac105[_0xd295('0x43')]['id']}},_0x7e4d83={};_0x7e4d83[_0xd295('0x2f')]=_['keys'](db[_0xd295('0x2b')][_0xd295('0x44')]);_0x7e4d83[_0xd295('0x30')]=_[_0xd295('0x31')](_0x3ac105[_0xd295('0x30')]);_0x7e4d83[_0xd295('0x32')]=_[_0xd295('0x33')](_0x7e4d83[_0xd295('0x2f')],_0x7e4d83['query']);_0x4addeb['attributes']=_['intersection'](_0x7e4d83[_0xd295('0x2f')],qs[_0xd295('0x35')](_0x3ac105[_0xd295('0x30')][_0xd295('0x35')]));_0x4addeb[_0xd295('0x34')]=_0x4addeb[_0xd295('0x34')][_0xd295('0x36')]?_0x4addeb[_0xd295('0x34')]:_0x7e4d83['model'];if(_0x3ac105[_0xd295('0x30')][_0xd295('0x45')]){_0x4addeb['include']=[{'all':!![]}];}_0x4addeb=_['merge']({},_0x4addeb,_0x3ac105['options']);return db['VoiceQueuesLog'][_0xd295('0x46')](_0x4addeb)[_0xd295('0x23')](handleEntityNotFound(_0x44a607,null))[_0xd295('0x23')](respondWithResult(_0x44a607,null))[_0xd295('0x41')](handleError(_0x44a607,null));};exports[_0xd295('0x47')]=function(_0x58dda2,_0x370cbb){return db[_0xd295('0x2b')][_0xd295('0x47')](_0x58dda2['body'],{})['then'](respondWithResult(_0x370cbb,0xc9))[_0xd295('0x41')](handleError(_0x370cbb,null));};exports[_0xd295('0x22')]=function(_0xfaa970,_0x143579){if(_0xfaa970[_0xd295('0x48')]['id']){delete _0xfaa970[_0xd295('0x48')]['id'];}return db[_0xd295('0x2b')][_0xd295('0x46')]({'where':{'id':_0xfaa970['params']['id']}})[_0xd295('0x23')](handleEntityNotFound(_0x143579,null))['then'](saveUpdates(_0xfaa970[_0xd295('0x48')],null))[_0xd295('0x23')](respondWithResult(_0x143579,null))[_0xd295('0x41')](handleError(_0x143579,null));};exports[_0xd295('0x24')]=function(_0x34428b,_0x3931d2){return db[_0xd295('0x2b')][_0xd295('0x46')]({'where':{'id':_0x34428b['params']['id']}})[_0xd295('0x23')](handleEntityNotFound(_0x3931d2,null))[_0xd295('0x23')](removeEntity(_0x3931d2,null))['catch'](handleError(_0x3931d2,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 4c8c1b4..1485831 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 _0x2bf4=['event_dtm','event','dtm','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log'];(function(_0x161f03,_0x5d141b){var _0x2f396f=function(_0x2c1b7a){while(--_0x2c1b7a){_0x161f03['push'](_0x161f03['shift']());}};_0x2f396f(++_0x5d141b);}(_0x2bf4,0x193));var _0x42bf=function(_0x1fe559,_0x25fba7){_0x1fe559=_0x1fe559-0x0;var _0xb5b18c=_0x2bf4[_0x1fe559];return _0xb5b18c;};'use strict';var _=require(_0x42bf('0x0'));var util=require(_0x42bf('0x1'));var logger=require(_0x42bf('0x2'))(_0x42bf('0x3'));var moment=require(_0x42bf('0x4'));var BPromise=require(_0x42bf('0x5'));var rp=require(_0x42bf('0x6'));var fs=require('fs');var path=require(_0x42bf('0x7'));var rimraf=require(_0x42bf('0x8'));var config=require('../../config/environment');var attributes=require(_0x42bf('0x9'));module['exports']=function(_0x27a11d,_0x4fbbad){return _0x27a11d[_0x42bf('0xa')](_0x42bf('0xb'),attributes,{'tableName':_0x42bf('0xc'),'paranoid':![],'indexes':[{'name':_0x42bf('0xd'),'fields':[_0x42bf('0xe'),_0x42bf('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0x09c1=['bluebird','request-promise','path','../../config/environment','./voiceQueuesLog.attributes','define','voice_queues_log','event','dtm','util','../../config/logger','moment'];(function(_0x4503f6,_0x3babaf){var _0x2277d1=function(_0x1c005a){while(--_0x1c005a){_0x4503f6['push'](_0x4503f6['shift']());}};_0x2277d1(++_0x3babaf);}(_0x09c1,0xb1));var _0x109c=function(_0x37b729,_0x8f10af){_0x37b729=_0x37b729-0x0;var _0x40cd25=_0x09c1[_0x37b729];return _0x40cd25;};'use strict';var _=require('lodash');var util=require(_0x109c('0x0'));var logger=require(_0x109c('0x1'))('api');var moment=require(_0x109c('0x2'));var BPromise=require(_0x109c('0x3'));var rp=require(_0x109c('0x4'));var fs=require('fs');var path=require(_0x109c('0x5'));var rimraf=require('rimraf');var config=require(_0x109c('0x6'));var attributes=require(_0x109c('0x7'));module['exports']=function(_0x369c4e,_0x17a333){return _0x369c4e[_0x109c('0x8')]('VoiceQueuesLog',attributes,{'tableName':_0x109c('0x9'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x109c('0xa'),_0x109c('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index a0b0d9c..c38f4cb 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 _0x8535=['ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','randomstring'];(function(_0x1b4a7b,_0x4f63dd){var _0x5ef74f=function(_0x5b83fc){while(--_0x5b83fc){_0x1b4a7b['push'](_0x1b4a7b['shift']());}};_0x5ef74f(++_0x4f63dd);}(_0x8535,0x66));var _0x5853=function(_0x561a21,_0x2bb72e){_0x561a21=_0x561a21-0x0;var _0x4c874e=_0x8535[_0x561a21];return _0x4c874e;};'use strict';var _=require('lodash');var util=require(_0x5853('0x0'));var moment=require('moment');var BPromise=require(_0x5853('0x1'));var rs=require(_0x5853('0x2'));var fs=require('fs');var Redis=require(_0x5853('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5853('0x4'));var logger=require(_0x5853('0x5'))('rpc');var config=require(_0x5853('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5853('0x7')][_0x5853('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5298b9,_0x303225,_0x21a787){return new BPromise(function(_0x327734,_0x151058){return client[_0x5853('0x9')](_0x5298b9,_0x21a787)[_0x5853('0xa')](function(_0x4ecd44){logger[_0x5853('0xb')](_0x5853('0xc'),_0x303225,_0x5853('0xd'));logger[_0x5853('0xe')](_0x5853('0xf'),_0x303225,_0x5853('0xd'),JSON[_0x5853('0x10')](_0x4ecd44));if(_0x4ecd44[_0x5853('0x11')]){if(_0x4ecd44['error'][_0x5853('0x12')]===0x1f4){logger[_0x5853('0x11')](_0x5853('0xc'),_0x303225,_0x4ecd44[_0x5853('0x11')][_0x5853('0x13')]);return _0x151058(_0x4ecd44[_0x5853('0x11')][_0x5853('0x13')]);}logger[_0x5853('0x11')](_0x5853('0xc'),_0x303225,_0x4ecd44[_0x5853('0x11')][_0x5853('0x13')]);return _0x327734(_0x4ecd44[_0x5853('0x11')][_0x5853('0x13')]);}else{logger[_0x5853('0xb')](_0x5853('0xc'),_0x303225,'request\x20sent');_0x327734(_0x4ecd44['result']['message']);}})[_0x5853('0x14')](function(_0x3d4c63){logger[_0x5853('0x11')](_0x5853('0xc'),_0x303225,_0x3d4c63);_0x151058(_0x3d4c63);});});} \ No newline at end of file +var _0xe3db=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','info','result','catch'];(function(_0x37b3e5,_0x33b516){var _0x207f20=function(_0x5237fa){while(--_0x5237fa){_0x37b3e5['push'](_0x37b3e5['shift']());}};_0x207f20(++_0x33b516);}(_0xe3db,0xc8));var _0xbe3d=function(_0x5e7875,_0x4dcc49){_0x5e7875=_0x5e7875-0x0;var _0x3d3f3d=_0xe3db[_0x5e7875];return _0x3d3f3d;};'use strict';var _=require(_0xbe3d('0x0'));var util=require(_0xbe3d('0x1'));var moment=require('moment');var BPromise=require(_0xbe3d('0x2'));var rs=require(_0xbe3d('0x3'));var fs=require('fs');var Redis=require(_0xbe3d('0x4'));var db=require(_0xbe3d('0x5'))['db'];var utils=require(_0xbe3d('0x6'));var logger=require(_0xbe3d('0x7'))(_0xbe3d('0x8'));var config=require(_0xbe3d('0x9'));var jayson=require(_0xbe3d('0xa'));var client=jayson[_0xbe3d('0xb')][_0xbe3d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c255b,_0x314709,_0x90d1ab){return new BPromise(function(_0x24136a,_0x37e7c0){return client['request'](_0x4c255b,_0x90d1ab)[_0xbe3d('0xd')](function(_0x2aa8ff){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x314709,_0xbe3d('0xe'));logger[_0xbe3d('0xf')](_0xbe3d('0x10'),_0x314709,_0xbe3d('0xe'),JSON[_0xbe3d('0x11')](_0x2aa8ff));if(_0x2aa8ff[_0xbe3d('0x12')]){if(_0x2aa8ff[_0xbe3d('0x12')][_0xbe3d('0x13')]===0x1f4){logger[_0xbe3d('0x12')](_0xbe3d('0x14'),_0x314709,_0x2aa8ff[_0xbe3d('0x12')][_0xbe3d('0x15')]);return _0x37e7c0(_0x2aa8ff['error'][_0xbe3d('0x15')]);}logger[_0xbe3d('0x12')](_0xbe3d('0x14'),_0x314709,_0x2aa8ff[_0xbe3d('0x12')][_0xbe3d('0x15')]);return _0x24136a(_0x2aa8ff[_0xbe3d('0x12')][_0xbe3d('0x15')]);}else{logger[_0xbe3d('0x16')](_0xbe3d('0x14'),_0x314709,_0xbe3d('0xe'));_0x24136a(_0x2aa8ff[_0xbe3d('0x17')][_0xbe3d('0x15')]);}})[_0xbe3d('0x18')](function(_0x3f8630){logger['error'](_0xbe3d('0x14'),_0x314709,_0x3f8630);_0x37e7c0(_0x3f8630);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index a88ad5e..de63720 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 _0x4b21=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','put','update','delete','destroy','exports','util','path'];(function(_0x542ba1,_0x485092){var _0x203d7e=function(_0x11be61){while(--_0x11be61){_0x542ba1['push'](_0x542ba1['shift']());}};_0x203d7e(++_0x485092);}(_0x4b21,0xc6));var _0x14b2=function(_0xa8181d,_0x3ac761){_0xa8181d=_0xa8181d-0x0;var _0x4eaf6c=_0x4b21[_0xa8181d];return _0x4eaf6c;};'use strict';var multer=require('multer');var util=require(_0x14b2('0x0'));var path=require(_0x14b2('0x1'));var timeout=require(_0x14b2('0x2'));var express=require(_0x14b2('0x3'));var router=express[_0x14b2('0x4')]();var fs_extra=require(_0x14b2('0x5'));var auth=require(_0x14b2('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x14b2('0x7'));router[_0x14b2('0x8')]('/',auth[_0x14b2('0x9')](),controller[_0x14b2('0xa')]);router['get']('/describe',auth[_0x14b2('0x9')](),controller['describe']);router[_0x14b2('0x8')](_0x14b2('0xb'),auth[_0x14b2('0x9')](),controller[_0x14b2('0xc')]);router[_0x14b2('0x8')](_0x14b2('0xd'),auth[_0x14b2('0x9')](),controller[_0x14b2('0xe')]);router[_0x14b2('0x8')]('/:id/downloads',controller['downloads']);router[_0x14b2('0x8')]('/:id/transcribe',auth['isAuthenticated'](),controller[_0x14b2('0xf')]);router[_0x14b2('0x10')]('/',auth[_0x14b2('0x9')](),controller[_0x14b2('0x11')]);router[_0x14b2('0x10')](_0x14b2('0x12'),auth[_0x14b2('0x9')](),controller[_0x14b2('0x13')]);router[_0x14b2('0x14')](_0x14b2('0xb'),auth[_0x14b2('0x9')](),controller[_0x14b2('0x15')]);router[_0x14b2('0x16')](_0x14b2('0xb'),auth[_0x14b2('0x9')](),controller[_0x14b2('0x17')]);module[_0x14b2('0x18')]=router; \ No newline at end of file +var _0x8e36=['/:id','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','put'];(function(_0x531ad0,_0x273edc){var _0xb9a696=function(_0x5c2fa4){while(--_0x5c2fa4){_0x531ad0['push'](_0x531ad0['shift']());}};_0xb9a696(++_0x273edc);}(_0x8e36,0x9f));var _0x68e3=function(_0x20caa3,_0xb9358f){_0x20caa3=_0x20caa3-0x0;var _0x4d02cc=_0x8e36[_0x20caa3];return _0x4d02cc;};'use strict';var multer=require(_0x68e3('0x0'));var util=require(_0x68e3('0x1'));var path=require('path');var timeout=require(_0x68e3('0x2'));var express=require(_0x68e3('0x3'));var router=express[_0x68e3('0x4')]();var fs_extra=require(_0x68e3('0x5'));var auth=require(_0x68e3('0x6'));var interaction=require(_0x68e3('0x7'));var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router[_0x68e3('0x8')]('/',auth[_0x68e3('0x9')](),controller[_0x68e3('0xa')]);router[_0x68e3('0x8')](_0x68e3('0xb'),auth[_0x68e3('0x9')](),controller[_0x68e3('0xc')]);router[_0x68e3('0x8')]('/:id',auth[_0x68e3('0x9')](),controller[_0x68e3('0xd')]);router[_0x68e3('0x8')](_0x68e3('0xe'),auth['isAuthenticated'](),controller[_0x68e3('0xf')]);router[_0x68e3('0x8')](_0x68e3('0x10'),controller[_0x68e3('0x11')]);router[_0x68e3('0x8')](_0x68e3('0x12'),auth['isAuthenticated'](),controller[_0x68e3('0x13')]);router[_0x68e3('0x14')]('/',auth[_0x68e3('0x9')](),controller['create']);router[_0x68e3('0x14')]('/:id/transcribe',auth[_0x68e3('0x9')](),controller[_0x68e3('0x15')]);router[_0x68e3('0x16')](_0x68e3('0x17'),auth[_0x68e3('0x9')](),controller['update']);router[_0x68e3('0x18')]('/:id',auth[_0x68e3('0x9')](),controller['destroy']);module[_0x68e3('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 8f8695e..cceedb8 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(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 4b2a72d..41e6495 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 _0x4e0f=['transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','aws-sdk','uuid/v4','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','VoiceRecording','fieldName','type','key','differenceBy','format','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','find','create','body','describe','../../components/encryptor','uniqueid','value','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','download','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','.cypher','unlinkSync','listBuckets','createBucket','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','Voice\x20Recording\x20not\x20found','Setting','findOne'];(function(_0x365dcd,_0x10b325){var _0x3baf84=function(_0x45a621){while(--_0x45a621){_0x365dcd['push'](_0x365dcd['shift']());}};_0x3baf84(++_0x10b325);}(_0x4e0f,0x158));var _0xf4e0=function(_0x4c00ea,_0x1cf606){_0x4c00ea=_0x4c00ea-0x0;var _0x2754b6=_0x4e0f[_0x4c00ea];return _0x2754b6;};'use strict';var emlformat=require(_0xf4e0('0x0'));var rimraf=require(_0xf4e0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf4e0('0x2'));var rp=require('request-promise');var moment=require(_0xf4e0('0x3'));var BPromise=require(_0xf4e0('0x4'));var Mustache=require(_0xf4e0('0x5'));var util=require(_0xf4e0('0x6'));var path=require('path');var sox=require(_0xf4e0('0x7'));var csv=require(_0xf4e0('0x8'));var ejs=require(_0xf4e0('0x9'));var fs=require('fs');var fs_extra=require(_0xf4e0('0xa'));var _=require(_0xf4e0('0xb'));var squel=require(_0xf4e0('0xc'));var crypto=require('crypto');var jsforce=require(_0xf4e0('0xd'));var deskjs=require(_0xf4e0('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf4e0('0xf'));var AWS=require(_0xf4e0('0x10'));var uuidv4=require(_0xf4e0('0x11'));var Redis=require(_0xf4e0('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf4e0('0x13'));var hardwareService=require(_0xf4e0('0x14'));var logger=require(_0xf4e0('0x15'))(_0xf4e0('0x16'));var utils=require('../../config/utils');var config=require(_0xf4e0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf4e0('0x18'))['db'];function respondWithStatusCode(_0x1556e2,_0x9af1da){_0x9af1da=_0x9af1da||0xcc;return function(_0x6c20d7){if(_0x6c20d7){return _0x1556e2[_0xf4e0('0x19')](_0x9af1da);}return _0x1556e2['status'](_0x9af1da)[_0xf4e0('0x1a')]();};}function respondWithResult(_0x11b29b,_0x374855){_0x374855=_0x374855||0xc8;return function(_0xf9c95){if(_0xf9c95){return _0x11b29b['status'](_0x374855)[_0xf4e0('0x1b')](_0xf9c95);}};}function respondWithFilteredResult(_0xb4f101,_0x37b7fe){return function(_0x4ec3ef){if(_0x4ec3ef){var _0x689b04=typeof _0x37b7fe[_0xf4e0('0x1c')]===_0xf4e0('0x1d')&&typeof _0x37b7fe['limit']==='undefined';var _0x5b1a9a=_0x4ec3ef[_0xf4e0('0x1e')];var _0x448b0d=_0x689b04?0x0:_0x37b7fe[_0xf4e0('0x1c')];var _0x87d03d=_0x689b04?_0x4ec3ef[_0xf4e0('0x1e')]:_0x37b7fe['offset']+_0x37b7fe[_0xf4e0('0x1f')];var _0x1fe90a;if(_0x87d03d>=_0x5b1a9a){_0x87d03d=_0x5b1a9a;_0x1fe90a=0xc8;}else{_0x1fe90a=0xce;}_0xb4f101[_0xf4e0('0x20')](_0x1fe90a);return _0xb4f101[_0xf4e0('0x21')](_0xf4e0('0x22'),_0x448b0d+'-'+_0x87d03d+'/'+_0x5b1a9a)[_0xf4e0('0x1b')](_0x4ec3ef);}return null;};}function patchUpdates(_0x2c203c){return function(_0x30b2da){try{jsonpatch[_0xf4e0('0x23')](_0x30b2da,_0x2c203c,!![]);}catch(_0x10d603){return BPromise[_0xf4e0('0x24')](_0x10d603);}return _0x30b2da[_0xf4e0('0x25')]();};}function saveUpdates(_0x1e3683,_0x5d9c41){return function(_0x5a6b01){if(_0x5a6b01){return _0x5a6b01[_0xf4e0('0x26')](_0x1e3683)['then'](function(_0x4be566){return _0x4be566;});}return null;};}function removeEntity(_0x55a561,_0x5d9968){return function(_0x5389aa){if(_0x5389aa){return _0x5389aa[_0xf4e0('0x27')]()[_0xf4e0('0x28')](function(){_0x55a561[_0xf4e0('0x20')](0xcc)[_0xf4e0('0x1a')]();});}};}function handleEntityNotFound(_0x57b087,_0x4c4288){return function(_0x2529b8){if(!_0x2529b8){_0x57b087[_0xf4e0('0x19')](0x194);}return _0x2529b8;};}function handleError(_0x2a6f47,_0x204731){_0x204731=_0x204731||0x1f4;return function(_0x4239e5){logger[_0xf4e0('0x29')](_0x4239e5[_0xf4e0('0x2a')]);if(_0x4239e5[_0xf4e0('0x2b')]){delete _0x4239e5[_0xf4e0('0x2b')];}_0x2a6f47['status'](_0x204731)[_0xf4e0('0x2c')](_0x4239e5);};}exports[_0xf4e0('0x2d')]=function(_0x55e01e,_0x338cd5){var _0x40c6b0={},_0x410896={},_0x37aeba={'count':0x0,'rows':[]};var _0x39211d=_[_0xf4e0('0x2e')](db[_0xf4e0('0x2f')]['rawAttributes'],function(_0x55b8fc){return{'name':_0x55b8fc[_0xf4e0('0x30')],'type':_0x55b8fc[_0xf4e0('0x31')][_0xf4e0('0x32')]};});_0x410896['model']=_[_0xf4e0('0x33')](_[_0xf4e0('0x2e')](_0x39211d,_0xf4e0('0x2b')),[_0xf4e0('0x34')]);_0x410896[_0xf4e0('0x35')]=_[_0xf4e0('0x36')](_0x55e01e[_0xf4e0('0x35')]);_0x410896[_0xf4e0('0x37')]=_['intersection'](_0x410896[_0xf4e0('0x38')],_0x410896['query']);_0x40c6b0[_0xf4e0('0x39')]=_[_0xf4e0('0x3a')](_0x410896['model'],qs['fields'](_0x55e01e[_0xf4e0('0x35')][_0xf4e0('0x3b')]));_0x40c6b0['attributes']=_0x40c6b0[_0xf4e0('0x39')]['length']?_0x40c6b0[_0xf4e0('0x39')]:_0x410896['model'];if(!_0x55e01e[_0xf4e0('0x35')][_0xf4e0('0x3c')](_0xf4e0('0x3d'))){_0x40c6b0[_0xf4e0('0x1f')]=qs[_0xf4e0('0x1f')](_0x55e01e[_0xf4e0('0x35')][_0xf4e0('0x1f')]);_0x40c6b0[_0xf4e0('0x1c')]=qs[_0xf4e0('0x1c')](_0x55e01e[_0xf4e0('0x35')][_0xf4e0('0x1c')]);}_0x40c6b0[_0xf4e0('0x3e')]=qs[_0xf4e0('0x3f')](_0x55e01e[_0xf4e0('0x35')][_0xf4e0('0x3f')]);_0x40c6b0[_0xf4e0('0x40')]=qs[_0xf4e0('0x37')](_[_0xf4e0('0x41')](_0x55e01e[_0xf4e0('0x35')],_0x410896[_0xf4e0('0x37')]),_0x39211d);if(_0x55e01e[_0xf4e0('0x35')][_0xf4e0('0x42')]){_0x40c6b0[_0xf4e0('0x40')]=_[_0xf4e0('0x43')](_0x40c6b0[_0xf4e0('0x40')],{'$or':_[_0xf4e0('0x2e')](_0x39211d,function(_0xf4f1ec){if(_0xf4f1ec[_0xf4e0('0x31')]!==_0xf4e0('0x44')){var _0x2f4ba2={};_0x2f4ba2[_0xf4f1ec[_0xf4e0('0x2b')]]={'$like':'%'+_0x55e01e[_0xf4e0('0x35')][_0xf4e0('0x42')]+'%'};return _0x2f4ba2;}})});}_0x40c6b0=_['merge']({},_0x40c6b0,_0x55e01e[_0xf4e0('0x45')]);var _0x11f9f6={'where':_0x40c6b0[_0xf4e0('0x40')]};return db['VoiceRecording'][_0xf4e0('0x1e')](_0x11f9f6)['then'](function(_0x3d6f5f){_0x37aeba[_0xf4e0('0x1e')]=_0x3d6f5f;if(_0x55e01e[_0xf4e0('0x35')][_0xf4e0('0x46')]){_0x40c6b0['include']=[{'all':!![]}];}return db[_0xf4e0('0x2f')][_0xf4e0('0x47')](_0x40c6b0);})[_0xf4e0('0x28')](function(_0xb1ec58){_0x37aeba[_0xf4e0('0x48')]=_0xb1ec58;return _0x37aeba;})[_0xf4e0('0x28')](respondWithFilteredResult(_0x338cd5,_0x40c6b0))[_0xf4e0('0x49')](handleError(_0x338cd5,null));};exports[_0xf4e0('0x4a')]=function(_0x46f715,_0x3e297a){var _0x1c1957={'raw':![],'where':{'id':_0x46f715[_0xf4e0('0x4b')]['id']}},_0x3cfe09={};_0x3cfe09[_0xf4e0('0x38')]=_[_0xf4e0('0x36')](db[_0xf4e0('0x2f')][_0xf4e0('0x4c')]);_0x3cfe09[_0xf4e0('0x35')]=_[_0xf4e0('0x36')](_0x46f715[_0xf4e0('0x35')]);_0x3cfe09['filters']=_['intersection'](_0x3cfe09[_0xf4e0('0x38')],_0x3cfe09[_0xf4e0('0x35')]);_0x1c1957[_0xf4e0('0x39')]=_[_0xf4e0('0x3a')](_0x3cfe09['model'],qs[_0xf4e0('0x3b')](_0x46f715[_0xf4e0('0x35')][_0xf4e0('0x3b')]));_0x1c1957[_0xf4e0('0x39')]=_0x1c1957[_0xf4e0('0x39')][_0xf4e0('0x4d')]?_0x1c1957[_0xf4e0('0x39')]:_0x3cfe09['model'];if(_0x46f715[_0xf4e0('0x35')][_0xf4e0('0x46')]){_0x1c1957[_0xf4e0('0x4e')]=[{'all':!![]}];}_0x1c1957=_[_0xf4e0('0x43')]({},_0x1c1957,_0x46f715['options']);return db['VoiceRecording'][_0xf4e0('0x4f')](_0x1c1957)[_0xf4e0('0x28')](handleEntityNotFound(_0x3e297a,null))[_0xf4e0('0x28')](respondWithResult(_0x3e297a,null))['catch'](handleError(_0x3e297a,null));};exports[_0xf4e0('0x50')]=function(_0x343eca,_0x1c65ac){return db[_0xf4e0('0x2f')][_0xf4e0('0x50')](_0x343eca[_0xf4e0('0x51')],{})[_0xf4e0('0x28')](respondWithResult(_0x1c65ac,0xc9))[_0xf4e0('0x49')](handleError(_0x1c65ac,null));};exports[_0xf4e0('0x26')]=function(_0x1d02a1,_0x4ae99e){if(_0x1d02a1[_0xf4e0('0x51')]['id']){delete _0x1d02a1[_0xf4e0('0x51')]['id'];}return db[_0xf4e0('0x2f')][_0xf4e0('0x4f')]({'where':{'id':_0x1d02a1['params']['id']}})[_0xf4e0('0x28')](handleEntityNotFound(_0x4ae99e,null))[_0xf4e0('0x28')](saveUpdates(_0x1d02a1['body'],null))[_0xf4e0('0x28')](respondWithResult(_0x4ae99e,null))[_0xf4e0('0x49')](handleError(_0x4ae99e,null));};exports[_0xf4e0('0x52')]=function(_0x211494,_0x4a7a15){return db[_0xf4e0('0x2f')]['describe']()[_0xf4e0('0x28')](respondWithResult(_0x4a7a15,null))[_0xf4e0('0x49')](handleError(_0x4a7a15,null));};exports['download']=function(_0x229a67,_0x4d30fb,_0x3054e3){var _0x299eaa=require(_0xf4e0('0x53'));var _0x437797=![];var _0x3aa3e8={};if(_0x229a67[_0xf4e0('0x35')][_0xf4e0('0x31')]&&_0x229a67[_0xf4e0('0x35')][_0xf4e0('0x31')]==='uniqueid'){_0x3aa3e8[_0xf4e0('0x54')]=_0x229a67[_0xf4e0('0x4b')]['id'];}else{_0x3aa3e8['id']=_0x229a67['params']['id'];}return db[_0xf4e0('0x2f')][_0xf4e0('0x4f')]({'where':_0x3aa3e8,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x4d30fb,null))['then'](function(_0x12334e){if(_0x12334e){var _0x55ddba=_0x12334e[_0xf4e0('0x55')];var _0x37628c=util['format'](_0xf4e0('0x56'),_0x55ddba);if(fs['existsSync'](_0x37628c)){_0x437797=!![];return _0x299eaa[_0xf4e0('0x57')](_0x37628c,_0x55ddba,config[_0xf4e0('0x58')][_0xf4e0('0x59')])[_0xf4e0('0x28')](function(){return _0x12334e;});}return _0x12334e;}})[_0xf4e0('0x28')](function(_0x277aea){if(_0x277aea){var _0x1a9910=_0x277aea[_0xf4e0('0x55')];if(!fs[_0xf4e0('0x5a')](_0x1a9910)){throw new db[(_0xf4e0('0x5b'))][(_0xf4e0('0x5c'))](_0xf4e0('0x5d'));}if(_0x277aea['filename']){return _0x4d30fb[_0xf4e0('0x5e')](_0x1a9910,_0x277aea[_0xf4e0('0x5f')]+path[_0xf4e0('0x60')](_0x1a9910),function(){if(_0x437797){fs['unlink'](_0x1a9910);}});}else{return _0x4d30fb[_0xf4e0('0x5e')](_0x1a9910,function(_0xd7ca30){if(_0x437797){fs[_0xf4e0('0x61')](_0x1a9910);}});}}})[_0xf4e0('0x49')](function(_0x2c9e46){if(_0x2c9e46[_0xf4e0('0x62')]===_0xf4e0('0x5d')){_0x4d30fb[_0xf4e0('0x20')](0x194)[_0xf4e0('0x2c')](_0xf4e0('0x63'));}else{return handleError(_0x4d30fb,null);}});};exports[_0xf4e0('0x64')]=function(_0x527d2b,_0x2ed7c3,_0x49cb5e){var _0x2b9b98=require(_0xf4e0('0x53'));var _0x4f7177=![];var _0x2a52bd={'$and':[db[_0xf4e0('0x65')]['where'](db['sequelize']['fn'](_0xf4e0('0x66'),db[_0xf4e0('0x65')][_0xf4e0('0x67')](_0xf4e0('0x54'))),_0x527d2b[_0xf4e0('0x35')][_0xf4e0('0x68')])]};if(_0x527d2b[_0xf4e0('0x35')][_0xf4e0('0x31')]&&_0x527d2b[_0xf4e0('0x35')][_0xf4e0('0x31')]===_0xf4e0('0x54')){_0x2a52bd[_0xf4e0('0x69')][_0xf4e0('0x6a')]({'uniqueid':_0x527d2b[_0xf4e0('0x4b')]['id']});}else{_0x2a52bd[_0xf4e0('0x69')][_0xf4e0('0x6a')]({'id':_0x527d2b[_0xf4e0('0x4b')]['id']});}return db['VoiceRecording'][_0xf4e0('0x4f')]({'where':_0x2a52bd,'attributes':['id','value'],'raw':!![]})[_0xf4e0('0x28')](handleEntityNotFound(_0x2ed7c3,null))[_0xf4e0('0x28')](function(_0x114594){if(_0x114594){var _0xe5e4d5=util['format']('%s.cypher',_0x114594['value']);if(fs['existsSync'](_0xe5e4d5)){_0x4f7177=!![];return _0x2b9b98[_0xf4e0('0x57')](_0xe5e4d5,_0x114594['value'],config['secrets'][_0xf4e0('0x59')])['then'](function(){return _0x114594;});}return _0x114594;}})[_0xf4e0('0x28')](function(_0x141575){if(_0x141575){if(!fs[_0xf4e0('0x5a')](_0x141575[_0xf4e0('0x55')])){throw new db[(_0xf4e0('0x5b'))][(_0xf4e0('0x5c'))](_0xf4e0('0x5d'));}if(_0x141575[_0xf4e0('0x5f')]){return _0x2ed7c3[_0xf4e0('0x5e')](_0x141575['value'],_0x141575['filename']+path[_0xf4e0('0x60')](_0x141575[_0xf4e0('0x55')]),function(){if(_0x4f7177){fs[_0xf4e0('0x61')](_0x141575[_0xf4e0('0x55')]);}});}else{return _0x2ed7c3[_0xf4e0('0x5e')](_0x141575[_0xf4e0('0x55')],function(_0x4aa900){if(_0x4f7177){fs[_0xf4e0('0x61')](_0x141575[_0xf4e0('0x55')]);}});}}})[_0xf4e0('0x49')](handleError(_0x2ed7c3,null));};exports[_0xf4e0('0x27')]=function(_0x1ed2e3,_0x1ef748){return db['VoiceRecording']['find']({'where':{'id':_0x1ed2e3['params']['id']}})[_0xf4e0('0x28')](function(_0x5bd30f){if(_[_0xf4e0('0x6b')](_0x5bd30f)){throw new ReferenceError(_0xf4e0('0x6c'));}return _0x5bd30f;})[_0xf4e0('0x28')](function(_0x35d4f5){var _0x42fffc=_0x35d4f5['value'];logger[_0xf4e0('0x6d')](_0xf4e0('0x6e'),_0x42fffc);if(!_['isNil'](_0x35d4f5['value'])&&fs[_0xf4e0('0x5a')](_0x42fffc)){logger['info'](_0xf4e0('0x6f')+_0x42fffc+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x42fffc);}_0x42fffc=_0x42fffc+_0xf4e0('0x70');if(!_[_0xf4e0('0x6b')](_0x35d4f5['value'])&&fs[_0xf4e0('0x5a')](_0x42fffc)){logger[_0xf4e0('0x6d')](_0xf4e0('0x6f')+_0x42fffc+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xf4e0('0x71')](_0x42fffc);}return _0x35d4f5;})[_0xf4e0('0x28')](function(_0x7b3834){if(!_0x7b3834)throw new InternalError();return _0x7b3834[_0xf4e0('0x27')]();})['then'](function(){_0x1ef748[_0xf4e0('0x20')](0xcc)[_0xf4e0('0x1a')]();})[_0xf4e0('0x49')](handleError(_0x1ef748,null));};function getBucketslist(_0x4a4889,_0x5a83a2,_0x5d9de8){return new Promise(function(_0x6699f5,_0x5aeb1a){var _0x3c49bd=new AWS['S3']({'accessKeyId':_0x5a83a2,'secretAccessKey':_0x4a4889,'region':_0x5d9de8});_0x3c49bd[_0xf4e0('0x72')]({},function(_0x11acac,_0x2b50bb){if(_0x11acac){return _0x5aeb1a(_0x11acac);}else{return _0x6699f5(_0x2b50bb);}});});}function createBucket(_0x454b3f,_0x590347,_0x479feb,_0x4f7a0f){return new Promise(function(_0x283614,_0x7a36e4){var _0x13e60d=new AWS['S3']({'accessKeyId':_0x590347,'secretAccessKey':_0x454b3f,'region':_0x479feb});_0x13e60d[_0xf4e0('0x73')]({'Bucket':_0x4f7a0f},function(_0x120621,_0x24de16){if(_0x120621){return _0x7a36e4(_0x120621);}else{return _0x283614(_0x24de16);}});});}function uploadFile(_0xe6bec4,_0x50d68b,_0x4b91d4,_0x5e5799,_0x4f2eb5,_0x5bf2d5){return new Promise(function(_0x438466,_0x218c0c){var _0x1253cc=new AWS['S3']({'accessKeyId':_0x50d68b,'secretAccessKey':_0xe6bec4,'region':_0x4b91d4});_0x1253cc[_0xf4e0('0x74')]({'Bucket':_0x5e5799,'Key':_0x4f2eb5,'Body':_0x5bf2d5},function(_0x19a0f5,_0xadb09e){if(_0x19a0f5){return _0x218c0c(_0x19a0f5);}else{return _0x438466(_0xadb09e);}});});}function startTranscribe(_0x2dc723,_0x233e66,_0x59bf9b,_0x54cc40,_0x1ed7ba,_0x26bc9b){return new Promise(function(_0x4fbfb6,_0x7655b1){var _0x331134=new AWS[(_0xf4e0('0x75'))]({'accessKeyId':_0x233e66,'secretAccessKey':_0x2dc723,'region':_0x59bf9b});_0x331134['startTranscriptionJob']({'TranscriptionJobName':_0x54cc40,'LanguageCode':_0x1ed7ba,'Media':{'MediaFileUri':_0x26bc9b}},function(_0x95d5e2,_0x281f00){if(_0x95d5e2){return _0x7655b1(_0x95d5e2);}else{return _0x4fbfb6(_0x281f00);}});});}function transcribe(_0x1c40c5,_0x52d63b,_0x15b43e,_0xa2b97f,_0x51692e,_0x4eb6d5,_0xb3365f){return new Promise(function(_0x19ba02,_0x33c5d5){var _0x5bf970={};logger[_0xf4e0('0x6d')](util['format'](_0xf4e0('0x76'),_0x1c40c5,_0x51692e));return uploadFile(_0x52d63b,_0x15b43e,_0xa2b97f,_0x51692e,path[_0xf4e0('0x77')](_0x4eb6d5),fs[_0xf4e0('0x78')](_0x4eb6d5))[_0xf4e0('0x28')](function(_0x3091ce){logger[_0xf4e0('0x6d')](util[_0xf4e0('0x34')](_0xf4e0('0x79'),_0x1c40c5,_0x51692e,_0x3091ce[_0xf4e0('0x7a')]));_0x5bf970[_0xf4e0('0x7b')]=_0x3091ce['Bucket'];_0x5bf970['location']=_0x3091ce['Location'];logger[_0xf4e0('0x6d')](util[_0xf4e0('0x34')](_0xf4e0('0x7c'),_0x1c40c5));return startTranscribe(_0x52d63b,_0x15b43e,_0xa2b97f,uuidv4(),_0xb3365f,_0x3091ce[_0xf4e0('0x7a')]);})[_0xf4e0('0x28')](function(_0x562297){logger[_0xf4e0('0x6d')](util[_0xf4e0('0x34')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x1c40c5,_0x562297[_0xf4e0('0x7d')]['TranscriptionJobName']));_0x5bf970['transcribeName']=_0x562297[_0xf4e0('0x7d')][_0xf4e0('0x7e')];_0x5bf970[_0xf4e0('0x7f')]=_0x562297[_0xf4e0('0x7d')][_0xf4e0('0x80')];return _0x19ba02(_0x5bf970);})['catch'](function(_0x50d3c1){return _0x33c5d5(_0x50d3c1);});});}exports[_0xf4e0('0x81')]=function(_0xd684d5,_0x38f120,_0x1bdf5a){var _0x12208c;var _0x5dd146;var _0x11681c;var _0x25c862=require(_0xf4e0('0x53'));return db[_0xf4e0('0x2f')]['findOne']({'where':{'id':_0xd684d5[_0xf4e0('0x4b')]['id']}})['then'](function(_0x46c9b0){if(_0x46c9b0){var _0x2258fb=util[_0xf4e0('0x34')](_0xf4e0('0x56'),_0x46c9b0['value']);if(fs['existsSync'](_0x2258fb)){cypher=!![];return _0x25c862['decryptFile'](_0x2258fb,_0x46c9b0[_0xf4e0('0x55')],config['secrets'][_0xf4e0('0x59')])['then'](function(){return _0x46c9b0;});}return _0x46c9b0;}})[_0xf4e0('0x28')](function(_0x697aa3){if(!_0x697aa3){throw new db[(_0xf4e0('0x5b'))][(_0xf4e0('0x5c'))](_0xf4e0('0x82'));}_0x5dd146=_0x697aa3;return db[_0xf4e0('0x83')][_0xf4e0('0x84')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x38f120,null))['then'](function(_0x6fed43){if(_0x6fed43){_0x12208c=_0x6fed43;if(!_0x12208c[_0xf4e0('0x85')]||!_0x12208c[_0xf4e0('0x86')]||!_0x12208c[_0xf4e0('0x87')]||!_0x12208c[_0xf4e0('0x88')]||!_0x12208c[_0xf4e0('0x7b')]){throw new db[(_0xf4e0('0x5b'))][(_0xf4e0('0x5c'))](_0xf4e0('0x89'));}if(_0xd684d5['body'][_0xf4e0('0x8a')]&&(!_0x12208c[_0xf4e0('0x8b')]||!_0x12208c['sentimentAccountId']||!_0x12208c['sentimentRegion']||!_0x12208c[_0xf4e0('0x88')]||!_0x12208c[_0xf4e0('0x7b')])){throw new db[(_0xf4e0('0x5b'))][(_0xf4e0('0x5c'))](_0xf4e0('0x8c'));}return db[_0xf4e0('0x8d')]['findOne']({'where':{'id':_0x12208c[_0xf4e0('0x86')]}});}})['then'](function(_0x2d9b0e){if(!_0x2d9b0e){throw new db[(_0xf4e0('0x5b'))][(_0xf4e0('0x5c'))](_0xf4e0('0x8e'));}if(!_0x2d9b0e[_0xf4e0('0x8f')]||!_0x2d9b0e[_0xf4e0('0x90')]){throw new db['Sequelize'][(_0xf4e0('0x5c'))](_0xf4e0('0x91'));}_0x11681c=_0x2d9b0e;return getBucketslist(_0x11681c[_0xf4e0('0x8f')],_0x11681c[_0xf4e0('0x90')],_0x12208c[_0xf4e0('0x87')]);})[_0xf4e0('0x28')](function(_0x444465){if(_0x444465&&_0x444465[_0xf4e0('0x92')]){var _0x20ed8f=_[_0xf4e0('0x4f')](_0x444465[_0xf4e0('0x92')],function(_0x525f70){return _0x525f70[_0xf4e0('0x93')]===_0x12208c[_0xf4e0('0x7b')];});if(!_0x20ed8f){logger[_0xf4e0('0x6d')](util[_0xf4e0('0x34')](_0xf4e0('0x94'),_0xd684d5[_0xf4e0('0x4b')]['id'],_0x12208c[_0xf4e0('0x7b')]));return createBucket(_0x11681c['data1'],_0x11681c[_0xf4e0('0x90')],_0x12208c[_0xf4e0('0x87')],_0x12208c[_0xf4e0('0x7b')]);}logger[_0xf4e0('0x6d')](util[_0xf4e0('0x34')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0xd684d5[_0xf4e0('0x4b')]['id'],_0x12208c[_0xf4e0('0x7b')]));return;}})[_0xf4e0('0x28')](function(_0x239e19){if(_0x5dd146['transcribeStatus']===_0xf4e0('0x95')){return transcribe(_0xd684d5['params']['id'],_0x11681c[_0xf4e0('0x8f')],_0x11681c[_0xf4e0('0x90')],_0x12208c[_0xf4e0('0x87')],_0x12208c[_0xf4e0('0x7b')],_0x5dd146[_0xf4e0('0x55')],_0x12208c[_0xf4e0('0x88')]);}else{logger[_0xf4e0('0x6d')](util[_0xf4e0('0x34')](_0xf4e0('0x96'),_0xd684d5['params']['id']));return{'transcribeStatus':_0xf4e0('0x97')};}})['then'](function(_0x2959d7){if(_0x2959d7){_0x2959d7[_0xf4e0('0x98')]=_0xd684d5[_0xf4e0('0x51')][_0xf4e0('0x8a')];return _0x5dd146[_0xf4e0('0x99')](_0x2959d7);}})['then'](respondWithResult(_0x38f120,null))['catch'](handleError(_0x38f120,null));};function writeFile(_0x2dacf4,_0x4f63ea){return new Promise(function(_0x227492,_0x5c2d5e){fs[_0xf4e0('0x9a')](_0x4f63ea,_0x2dacf4,function(_0x1bd0a3,_0x37992b){if(_0x1bd0a3){return _0x5c2d5e(_0x1bd0a3);}else{return _0x227492(_0x37992b);}});});}exports[_0xf4e0('0x9b')]=function(_0x57150e,_0x14ae17,_0x54c9e0){return db[_0xf4e0('0x2f')]['findOne']({'where':{'id':_0x57150e[_0xf4e0('0x4b')]['id']}})[_0xf4e0('0x28')](handleEntityNotFound(_0x14ae17))['then'](function(_0x138c16){if(_0x138c16&&_0x138c16[_0xf4e0('0x9c')]){var _0x2552ab=_0x138c16[_0xf4e0('0x9c')];var _0x439140=config['root']+_0xf4e0('0x9d')+_0x138c16['id']+_0xf4e0('0x9e');if(fs[_0xf4e0('0x5a')](_0x439140)){return _0x439140;}return writeFile(_0x2552ab,_0x439140)['then'](function(){return _0x439140;});}else{throw new db['Sequelize']['ValidationError']('Transcript\x20not\x20available');}})[_0xf4e0('0x28')](function(_0x7cf0e9){return _0x14ae17[_0xf4e0('0x5e')](_0x7cf0e9);})[_0xf4e0('0x49')](handleError(_0x14ae17));}; \ No newline at end of file +var _0xb851=['error','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','differenceBy','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','create','body','find','describe','download','../../components/encryptor','value','format','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','sequelize','MD5','col','uniqueid','token','$and','push','recording','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','Voice\x20Recording\x20not\x20found','findOne','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','squel','desk.js','to-csv','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','end'];(function(_0x1151eb,_0x187715){var _0x2c661c=function(_0x2e0a61){while(--_0x2e0a61){_0x1151eb['push'](_0x1151eb['shift']());}};_0x2c661c(++_0x187715);}(_0xb851,0x75));var _0x1b85=function(_0x2d2286,_0x3ad0cc){_0x2d2286=_0x2d2286-0x0;var _0x3ca923=_0xb851[_0x2d2286];return _0x3ca923;};'use strict';var emlformat=require(_0x1b85('0x0'));var rimraf=require(_0x1b85('0x1'));var zipdir=require(_0x1b85('0x2'));var jsonpatch=require(_0x1b85('0x3'));var rp=require(_0x1b85('0x4'));var moment=require(_0x1b85('0x5'));var BPromise=require(_0x1b85('0x6'));var Mustache=require(_0x1b85('0x7'));var util=require('util');var path=require('path');var sox=require(_0x1b85('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1b85('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1b85('0xa'));var toCsv=require(_0x1b85('0xb'));var querystring=require('querystring');var Papa=require(_0x1b85('0xc'));var AWS=require(_0x1b85('0xd'));var uuidv4=require(_0x1b85('0xe'));var Redis=require('ioredis');var authService=require(_0x1b85('0xf'));var qs=require(_0x1b85('0x10'));var as=require(_0x1b85('0x11'));var hardwareService=require(_0x1b85('0x12'));var logger=require(_0x1b85('0x13'))(_0x1b85('0x14'));var utils=require(_0x1b85('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1b85('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe0f8e1,_0xe0551e){_0xe0551e=_0xe0551e||0xcc;return function(_0x5bf331){if(_0x5bf331){return _0xe0f8e1[_0x1b85('0x17')](_0xe0551e);}return _0xe0f8e1[_0x1b85('0x18')](_0xe0551e)['end']();};}function respondWithResult(_0x38086d,_0x577c7c){_0x577c7c=_0x577c7c||0xc8;return function(_0x1d5477){if(_0x1d5477){return _0x38086d[_0x1b85('0x18')](_0x577c7c)[_0x1b85('0x19')](_0x1d5477);}};}function respondWithFilteredResult(_0x271417,_0x962152){return function(_0x4af5ee){if(_0x4af5ee){var _0x467ddf=typeof _0x962152[_0x1b85('0x1a')]===_0x1b85('0x1b')&&typeof _0x962152[_0x1b85('0x1c')]===_0x1b85('0x1b');var _0x5ae4a8=_0x4af5ee['count'];var _0x56cc36=_0x467ddf?0x0:_0x962152['offset'];var _0x4c6b24=_0x467ddf?_0x4af5ee[_0x1b85('0x1d')]:_0x962152[_0x1b85('0x1a')]+_0x962152['limit'];var _0xaf8130;if(_0x4c6b24>=_0x5ae4a8){_0x4c6b24=_0x5ae4a8;_0xaf8130=0xc8;}else{_0xaf8130=0xce;}_0x271417[_0x1b85('0x18')](_0xaf8130);return _0x271417[_0x1b85('0x1e')]('Content-Range',_0x56cc36+'-'+_0x4c6b24+'/'+_0x5ae4a8)[_0x1b85('0x19')](_0x4af5ee);}return null;};}function patchUpdates(_0x5b367a){return function(_0x4805f5){try{jsonpatch[_0x1b85('0x1f')](_0x4805f5,_0x5b367a,!![]);}catch(_0x1bed0c){return BPromise['reject'](_0x1bed0c);}return _0x4805f5[_0x1b85('0x20')]();};}function saveUpdates(_0x4bfadd,_0x557d8b){return function(_0x25f51a){if(_0x25f51a){return _0x25f51a[_0x1b85('0x21')](_0x4bfadd)[_0x1b85('0x22')](function(_0x3ffea0){return _0x3ffea0;});}return null;};}function removeEntity(_0x330269,_0x286918){return function(_0x104b8a){if(_0x104b8a){return _0x104b8a['destroy']()['then'](function(){_0x330269[_0x1b85('0x18')](0xcc)[_0x1b85('0x23')]();});}};}function handleEntityNotFound(_0x3e08b6,_0x376d67){return function(_0x50aa7c){if(!_0x50aa7c){_0x3e08b6[_0x1b85('0x17')](0x194);}return _0x50aa7c;};}function handleError(_0x130ca8,_0xa8b051){_0xa8b051=_0xa8b051||0x1f4;return function(_0x4bcb81){logger[_0x1b85('0x24')](_0x4bcb81[_0x1b85('0x25')]);if(_0x4bcb81[_0x1b85('0x26')]){delete _0x4bcb81[_0x1b85('0x26')];}_0x130ca8[_0x1b85('0x18')](_0xa8b051)[_0x1b85('0x27')](_0x4bcb81);};}exports[_0x1b85('0x28')]=function(_0x293886,_0x39b202){var _0x3770b5={},_0xe6bc59={},_0x2c033b={'count':0x0,'rows':[]};var _0x344dec=_[_0x1b85('0x29')](db[_0x1b85('0x2a')][_0x1b85('0x2b')],function(_0x175718){return{'name':_0x175718[_0x1b85('0x2c')],'type':_0x175718[_0x1b85('0x2d')][_0x1b85('0x2e')]};});_0xe6bc59['model']=_[_0x1b85('0x2f')](_['map'](_0x344dec,'name'),['format']);_0xe6bc59['query']=_['keys'](_0x293886[_0x1b85('0x30')]);_0xe6bc59[_0x1b85('0x31')]=_[_0x1b85('0x32')](_0xe6bc59[_0x1b85('0x33')],_0xe6bc59[_0x1b85('0x30')]);_0x3770b5[_0x1b85('0x34')]=_[_0x1b85('0x32')](_0xe6bc59[_0x1b85('0x33')],qs[_0x1b85('0x35')](_0x293886[_0x1b85('0x30')][_0x1b85('0x35')]));_0x3770b5['attributes']=_0x3770b5[_0x1b85('0x34')][_0x1b85('0x36')]?_0x3770b5[_0x1b85('0x34')]:_0xe6bc59['model'];if(!_0x293886[_0x1b85('0x30')][_0x1b85('0x37')]('nolimit')){_0x3770b5[_0x1b85('0x1c')]=qs[_0x1b85('0x1c')](_0x293886['query'][_0x1b85('0x1c')]);_0x3770b5[_0x1b85('0x1a')]=qs[_0x1b85('0x1a')](_0x293886[_0x1b85('0x30')][_0x1b85('0x1a')]);}_0x3770b5['order']=qs['sort'](_0x293886['query']['sort']);_0x3770b5[_0x1b85('0x38')]=qs[_0x1b85('0x31')](_['pick'](_0x293886[_0x1b85('0x30')],_0xe6bc59[_0x1b85('0x31')]),_0x344dec);if(_0x293886[_0x1b85('0x30')][_0x1b85('0x39')]){_0x3770b5[_0x1b85('0x38')]=_[_0x1b85('0x3a')](_0x3770b5[_0x1b85('0x38')],{'$or':_['map'](_0x344dec,function(_0x46d3a9){if(_0x46d3a9[_0x1b85('0x2d')]!==_0x1b85('0x3b')){var _0x2d77c8={};_0x2d77c8[_0x46d3a9['name']]={'$like':'%'+_0x293886[_0x1b85('0x30')][_0x1b85('0x39')]+'%'};return _0x2d77c8;}})});}_0x3770b5=_[_0x1b85('0x3a')]({},_0x3770b5,_0x293886['options']);var _0x372c43={'where':_0x3770b5[_0x1b85('0x38')]};return db[_0x1b85('0x2a')]['count'](_0x372c43)['then'](function(_0x4d0af0){_0x2c033b[_0x1b85('0x1d')]=_0x4d0af0;if(_0x293886['query'][_0x1b85('0x3c')]){_0x3770b5[_0x1b85('0x3d')]=[{'all':!![]}];}return db['VoiceRecording'][_0x1b85('0x3e')](_0x3770b5);})[_0x1b85('0x22')](function(_0x27975d){_0x2c033b[_0x1b85('0x3f')]=_0x27975d;return _0x2c033b;})[_0x1b85('0x22')](respondWithFilteredResult(_0x39b202,_0x3770b5))[_0x1b85('0x40')](handleError(_0x39b202,null));};exports[_0x1b85('0x41')]=function(_0x4e1b9e,_0x51c573){var _0x2c573d={'raw':![],'where':{'id':_0x4e1b9e[_0x1b85('0x42')]['id']}},_0xdff732={};_0xdff732['model']=_[_0x1b85('0x43')](db['VoiceRecording'][_0x1b85('0x2b')]);_0xdff732[_0x1b85('0x30')]=_[_0x1b85('0x43')](_0x4e1b9e['query']);_0xdff732['filters']=_[_0x1b85('0x32')](_0xdff732['model'],_0xdff732[_0x1b85('0x30')]);_0x2c573d[_0x1b85('0x34')]=_[_0x1b85('0x32')](_0xdff732[_0x1b85('0x33')],qs[_0x1b85('0x35')](_0x4e1b9e['query']['fields']));_0x2c573d[_0x1b85('0x34')]=_0x2c573d['attributes'][_0x1b85('0x36')]?_0x2c573d[_0x1b85('0x34')]:_0xdff732['model'];if(_0x4e1b9e[_0x1b85('0x30')]['includeAll']){_0x2c573d[_0x1b85('0x3d')]=[{'all':!![]}];}_0x2c573d=_[_0x1b85('0x3a')]({},_0x2c573d,_0x4e1b9e[_0x1b85('0x44')]);return db[_0x1b85('0x2a')]['find'](_0x2c573d)[_0x1b85('0x22')](handleEntityNotFound(_0x51c573,null))[_0x1b85('0x22')](respondWithResult(_0x51c573,null))['catch'](handleError(_0x51c573,null));};exports[_0x1b85('0x45')]=function(_0x4ba8c2,_0x2f10a7){return db[_0x1b85('0x2a')]['create'](_0x4ba8c2[_0x1b85('0x46')],{})[_0x1b85('0x22')](respondWithResult(_0x2f10a7,0xc9))[_0x1b85('0x40')](handleError(_0x2f10a7,null));};exports[_0x1b85('0x21')]=function(_0x3a41a3,_0x1d52bf){if(_0x3a41a3[_0x1b85('0x46')]['id']){delete _0x3a41a3[_0x1b85('0x46')]['id'];}return db['VoiceRecording'][_0x1b85('0x47')]({'where':{'id':_0x3a41a3[_0x1b85('0x42')]['id']}})['then'](handleEntityNotFound(_0x1d52bf,null))[_0x1b85('0x22')](saveUpdates(_0x3a41a3[_0x1b85('0x46')],null))[_0x1b85('0x22')](respondWithResult(_0x1d52bf,null))[_0x1b85('0x40')](handleError(_0x1d52bf,null));};exports[_0x1b85('0x48')]=function(_0x2f6485,_0x69d084){return db[_0x1b85('0x2a')][_0x1b85('0x48')]()[_0x1b85('0x22')](respondWithResult(_0x69d084,null))[_0x1b85('0x40')](handleError(_0x69d084,null));};exports[_0x1b85('0x49')]=function(_0x5e6179,_0x5382c1,_0x187f60){var _0x494588=require(_0x1b85('0x4a'));var _0x4c16ab=![];var _0x52ae55={};if(_0x5e6179['query'][_0x1b85('0x2d')]&&_0x5e6179['query'][_0x1b85('0x2d')]==='uniqueid'){_0x52ae55['uniqueid']=_0x5e6179[_0x1b85('0x42')]['id'];}else{_0x52ae55['id']=_0x5e6179[_0x1b85('0x42')]['id'];}return db[_0x1b85('0x2a')][_0x1b85('0x47')]({'where':_0x52ae55,'attributes':['id','value'],'raw':!![]})[_0x1b85('0x22')](handleEntityNotFound(_0x5382c1,null))[_0x1b85('0x22')](function(_0xb0bdd1){if(_0xb0bdd1){var _0x2a9d1e=_0xb0bdd1[_0x1b85('0x4b')];var _0x478fb6=util[_0x1b85('0x4c')](_0x1b85('0x4d'),_0x2a9d1e);if(fs[_0x1b85('0x4e')](_0x478fb6)){_0x4c16ab=!![];return _0x494588[_0x1b85('0x4f')](_0x478fb6,_0x2a9d1e,config[_0x1b85('0x50')]['recording'])[_0x1b85('0x22')](function(){return _0xb0bdd1;});}return _0xb0bdd1;}})['then'](function(_0xda23f4){if(_0xda23f4){var _0x4e315c=_0xda23f4[_0x1b85('0x4b')];if(!fs[_0x1b85('0x4e')](_0x4e315c)){throw new db[(_0x1b85('0x51'))][(_0x1b85('0x52'))](_0x1b85('0x53'));}if(_0xda23f4[_0x1b85('0x54')]){return _0x5382c1['download'](_0x4e315c,_0xda23f4[_0x1b85('0x54')]+path[_0x1b85('0x55')](_0x4e315c),function(){if(_0x4c16ab){fs[_0x1b85('0x56')](_0x4e315c);}});}else{return _0x5382c1['download'](_0x4e315c,function(_0x33f000){if(_0x4c16ab){fs[_0x1b85('0x56')](_0x4e315c);}});}}})['catch'](function(_0x14549f){if(_0x14549f[_0x1b85('0x57')]===_0x1b85('0x53')){_0x5382c1[_0x1b85('0x18')](0x194)[_0x1b85('0x27')](_0x1b85('0x58'));}else{return handleError(_0x5382c1,null);}});};exports['downloads']=function(_0x57d653,_0x3dda63,_0x241b1f){var _0x14cb60=require(_0x1b85('0x4a'));var _0x3553ca=![];var _0x230dca={'$and':[db[_0x1b85('0x59')][_0x1b85('0x38')](db[_0x1b85('0x59')]['fn'](_0x1b85('0x5a'),db[_0x1b85('0x59')][_0x1b85('0x5b')](_0x1b85('0x5c'))),_0x57d653[_0x1b85('0x30')][_0x1b85('0x5d')])]};if(_0x57d653[_0x1b85('0x30')][_0x1b85('0x2d')]&&_0x57d653[_0x1b85('0x30')][_0x1b85('0x2d')]==='uniqueid'){_0x230dca[_0x1b85('0x5e')]['push']({'uniqueid':_0x57d653[_0x1b85('0x42')]['id']});}else{_0x230dca['$and'][_0x1b85('0x5f')]({'id':_0x57d653[_0x1b85('0x42')]['id']});}return db['VoiceRecording'][_0x1b85('0x47')]({'where':_0x230dca,'attributes':['id',_0x1b85('0x4b')],'raw':!![]})[_0x1b85('0x22')](handleEntityNotFound(_0x3dda63,null))[_0x1b85('0x22')](function(_0x293562){if(_0x293562){var _0x59f304=util[_0x1b85('0x4c')](_0x1b85('0x4d'),_0x293562[_0x1b85('0x4b')]);if(fs['existsSync'](_0x59f304)){_0x3553ca=!![];return _0x14cb60[_0x1b85('0x4f')](_0x59f304,_0x293562[_0x1b85('0x4b')],config[_0x1b85('0x50')][_0x1b85('0x60')])[_0x1b85('0x22')](function(){return _0x293562;});}return _0x293562;}})[_0x1b85('0x22')](function(_0x49f986){if(_0x49f986){if(!fs[_0x1b85('0x4e')](_0x49f986[_0x1b85('0x4b')])){throw new db[(_0x1b85('0x51'))][(_0x1b85('0x52'))](_0x1b85('0x53'));}if(_0x49f986[_0x1b85('0x54')]){return _0x3dda63[_0x1b85('0x49')](_0x49f986['value'],_0x49f986['filename']+path[_0x1b85('0x55')](_0x49f986[_0x1b85('0x4b')]),function(){if(_0x3553ca){fs[_0x1b85('0x56')](_0x49f986[_0x1b85('0x4b')]);}});}else{return _0x3dda63['download'](_0x49f986['value'],function(_0x28442b){if(_0x3553ca){fs[_0x1b85('0x56')](_0x49f986[_0x1b85('0x4b')]);}});}}})['catch'](handleError(_0x3dda63,null));};exports[_0x1b85('0x61')]=function(_0x18d856,_0x1fb694){return db['VoiceRecording']['find']({'where':{'id':_0x18d856[_0x1b85('0x42')]['id']}})[_0x1b85('0x22')](function(_0x3750d8){if(_[_0x1b85('0x62')](_0x3750d8)){throw new ReferenceError(_0x1b85('0x63'));}return _0x3750d8;})['then'](function(_0x980bfe){var _0x4f19b1=_0x980bfe[_0x1b85('0x4b')];logger[_0x1b85('0x64')](_0x1b85('0x65'),_0x4f19b1);if(!_[_0x1b85('0x62')](_0x980bfe['value'])&&fs[_0x1b85('0x4e')](_0x4f19b1)){logger[_0x1b85('0x64')](_0x1b85('0x66')+_0x4f19b1+_0x1b85('0x67'));fs[_0x1b85('0x68')](_0x4f19b1);}_0x4f19b1=_0x4f19b1+'.cypher';if(!_[_0x1b85('0x62')](_0x980bfe[_0x1b85('0x4b')])&&fs[_0x1b85('0x4e')](_0x4f19b1)){logger[_0x1b85('0x64')]('File:\x20\x22'+_0x4f19b1+_0x1b85('0x67'));fs['unlinkSync'](_0x4f19b1);}return _0x980bfe;})[_0x1b85('0x22')](function(_0xce3311){if(!_0xce3311)throw new InternalError();return _0xce3311[_0x1b85('0x61')]();})[_0x1b85('0x22')](function(){_0x1fb694['status'](0xcc)[_0x1b85('0x23')]();})[_0x1b85('0x40')](handleError(_0x1fb694,null));};function getBucketslist(_0x5e8a83,_0x3a8e87,_0x6deabc){return new Promise(function(_0x10fd83,_0x53f3a4){var _0x53721f=new AWS['S3']({'accessKeyId':_0x3a8e87,'secretAccessKey':_0x5e8a83,'region':_0x6deabc});_0x53721f[_0x1b85('0x69')]({},function(_0x251a59,_0x6cbc9c){if(_0x251a59){return _0x53f3a4(_0x251a59);}else{return _0x10fd83(_0x6cbc9c);}});});}function createBucket(_0x561bb7,_0x218dd6,_0x473f84,_0x5b04ea){return new Promise(function(_0x464bf5,_0x2eb92c){var _0x3dad6a=new AWS['S3']({'accessKeyId':_0x218dd6,'secretAccessKey':_0x561bb7,'region':_0x473f84});_0x3dad6a[_0x1b85('0x6a')]({'Bucket':_0x5b04ea},function(_0x58295d,_0x4c39c5){if(_0x58295d){return _0x2eb92c(_0x58295d);}else{return _0x464bf5(_0x4c39c5);}});});}function uploadFile(_0xb887d0,_0x2f06d2,_0x553c49,_0x3009f0,_0x39a205,_0x4d26fe){return new Promise(function(_0x3cd7e6,_0x250672){var _0x15b7d3=new AWS['S3']({'accessKeyId':_0x2f06d2,'secretAccessKey':_0xb887d0,'region':_0x553c49});_0x15b7d3['upload']({'Bucket':_0x3009f0,'Key':_0x39a205,'Body':_0x4d26fe},function(_0x14756a,_0x5a6481){if(_0x14756a){return _0x250672(_0x14756a);}else{return _0x3cd7e6(_0x5a6481);}});});}function startTranscribe(_0x2b9779,_0x48a036,_0x420efb,_0x389df6,_0x5be468,_0x46394b){return new Promise(function(_0x457722,_0x3d9172){var _0x5cb7f5=new AWS[(_0x1b85('0x6b'))]({'accessKeyId':_0x48a036,'secretAccessKey':_0x2b9779,'region':_0x420efb});_0x5cb7f5[_0x1b85('0x6c')]({'TranscriptionJobName':_0x389df6,'LanguageCode':_0x5be468,'Media':{'MediaFileUri':_0x46394b}},function(_0x87baf3,_0x19663f){if(_0x87baf3){return _0x3d9172(_0x87baf3);}else{return _0x457722(_0x19663f);}});});}function transcribe(_0x18fa16,_0x170534,_0xe4a1cc,_0x24e838,_0x2f19b7,_0x2e9563,_0x4de1ce){return new Promise(function(_0x4311d9,_0x60be41){var _0x4e434a={};logger[_0x1b85('0x64')](util['format'](_0x1b85('0x6d'),_0x18fa16,_0x2f19b7));return uploadFile(_0x170534,_0xe4a1cc,_0x24e838,_0x2f19b7,path[_0x1b85('0x6e')](_0x2e9563),fs[_0x1b85('0x6f')](_0x2e9563))[_0x1b85('0x22')](function(_0x5c9308){logger[_0x1b85('0x64')](util[_0x1b85('0x4c')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x18fa16,_0x2f19b7,_0x5c9308[_0x1b85('0x70')]));_0x4e434a['bucket']=_0x5c9308[_0x1b85('0x71')];_0x4e434a[_0x1b85('0x72')]=_0x5c9308[_0x1b85('0x70')];logger[_0x1b85('0x64')](util[_0x1b85('0x4c')](_0x1b85('0x73'),_0x18fa16));return startTranscribe(_0x170534,_0xe4a1cc,_0x24e838,uuidv4(),_0x4de1ce,_0x5c9308[_0x1b85('0x70')]);})[_0x1b85('0x22')](function(_0x1552a0){logger[_0x1b85('0x64')](util[_0x1b85('0x4c')](_0x1b85('0x74'),_0x18fa16,_0x1552a0['TranscriptionJob'][_0x1b85('0x75')]));_0x4e434a[_0x1b85('0x76')]=_0x1552a0[_0x1b85('0x77')]['TranscriptionJobName'];_0x4e434a[_0x1b85('0x78')]=_0x1552a0[_0x1b85('0x77')][_0x1b85('0x79')];return _0x4311d9(_0x4e434a);})['catch'](function(_0x4b25d2){return _0x60be41(_0x4b25d2);});});}exports[_0x1b85('0x7a')]=function(_0x37c73c,_0x2ac26e,_0x5e6d1d){var _0x3ae591;var _0x5d4769;var _0x15145e;var _0x458bad=require(_0x1b85('0x4a'));return db[_0x1b85('0x2a')]['findOne']({'where':{'id':_0x37c73c[_0x1b85('0x42')]['id']}})[_0x1b85('0x22')](function(_0x106ea5){if(_0x106ea5){var _0x347100=util[_0x1b85('0x4c')](_0x1b85('0x4d'),_0x106ea5[_0x1b85('0x4b')]);if(fs['existsSync'](_0x347100)){cypher=!![];return _0x458bad['decryptFile'](_0x347100,_0x106ea5[_0x1b85('0x4b')],config[_0x1b85('0x50')][_0x1b85('0x60')])[_0x1b85('0x22')](function(){return _0x106ea5;});}return _0x106ea5;}})[_0x1b85('0x22')](function(_0x526561){if(!_0x526561){throw new db[(_0x1b85('0x51'))][(_0x1b85('0x52'))](_0x1b85('0x7b'));}_0x5d4769=_0x526561;return db['Setting'][_0x1b85('0x7c')]({'where':{'id':0x1}});})[_0x1b85('0x22')](handleEntityNotFound(_0x2ac26e,null))['then'](function(_0x10f9d2){if(_0x10f9d2){_0x3ae591=_0x10f9d2;if(!_0x3ae591['transcribe']||!_0x3ae591[_0x1b85('0x7d')]||!_0x3ae591[_0x1b85('0x7e')]||!_0x3ae591[_0x1b85('0x7f')]||!_0x3ae591['bucket']){throw new db[(_0x1b85('0x51'))][(_0x1b85('0x52'))](_0x1b85('0x80'));}if(_0x37c73c[_0x1b85('0x46')][_0x1b85('0x81')]&&(!_0x3ae591[_0x1b85('0x82')]||!_0x3ae591[_0x1b85('0x83')]||!_0x3ae591[_0x1b85('0x84')]||!_0x3ae591['language']||!_0x3ae591[_0x1b85('0x85')])){throw new db['Sequelize'][(_0x1b85('0x52'))](_0x1b85('0x86'));}return db[_0x1b85('0x87')][_0x1b85('0x7c')]({'where':{'id':_0x3ae591['transcribeAccountId']}});}})['then'](function(_0x6736b8){if(!_0x6736b8){throw new db[(_0x1b85('0x51'))][(_0x1b85('0x52'))](_0x1b85('0x88'));}if(!_0x6736b8[_0x1b85('0x89')]||!_0x6736b8[_0x1b85('0x8a')]){throw new db['Sequelize']['ValidationError'](_0x1b85('0x8b'));}_0x15145e=_0x6736b8;return getBucketslist(_0x15145e[_0x1b85('0x89')],_0x15145e[_0x1b85('0x8a')],_0x3ae591[_0x1b85('0x7e')]);})[_0x1b85('0x22')](function(_0xa6cbc){if(_0xa6cbc&&_0xa6cbc['Buckets']){var _0x2eb4ea=_[_0x1b85('0x47')](_0xa6cbc[_0x1b85('0x8c')],function(_0x479182){return _0x479182[_0x1b85('0x8d')]===_0x3ae591[_0x1b85('0x85')];});if(!_0x2eb4ea){logger[_0x1b85('0x64')](util[_0x1b85('0x4c')](_0x1b85('0x8e'),_0x37c73c[_0x1b85('0x42')]['id'],_0x3ae591[_0x1b85('0x85')]));return createBucket(_0x15145e[_0x1b85('0x89')],_0x15145e[_0x1b85('0x8a')],_0x3ae591[_0x1b85('0x7e')],_0x3ae591['bucket']);}logger[_0x1b85('0x64')](util[_0x1b85('0x4c')](_0x1b85('0x8f'),_0x37c73c[_0x1b85('0x42')]['id'],_0x3ae591['bucket']));return;}})[_0x1b85('0x22')](function(_0x50a5b0){if(_0x5d4769[_0x1b85('0x78')]===_0x1b85('0x90')){return transcribe(_0x37c73c[_0x1b85('0x42')]['id'],_0x15145e['data1'],_0x15145e[_0x1b85('0x8a')],_0x3ae591[_0x1b85('0x7e')],_0x3ae591[_0x1b85('0x85')],_0x5d4769[_0x1b85('0x4b')],_0x3ae591[_0x1b85('0x7f')]);}else{logger[_0x1b85('0x64')](util[_0x1b85('0x4c')](_0x1b85('0x91'),_0x37c73c[_0x1b85('0x42')]['id']));return{'transcribeStatus':_0x1b85('0x92')};}})[_0x1b85('0x22')](function(_0x12a7c4){if(_0x12a7c4){_0x12a7c4[_0x1b85('0x93')]=_0x37c73c[_0x1b85('0x46')][_0x1b85('0x81')];return _0x5d4769[_0x1b85('0x94')](_0x12a7c4);}})[_0x1b85('0x22')](respondWithResult(_0x2ac26e,null))['catch'](handleError(_0x2ac26e,null));};function writeFile(_0x2d3eea,_0x3a01f7){return new Promise(function(_0x1184f8,_0x191e5b){fs['writeFile'](_0x3a01f7,_0x2d3eea,function(_0x18d7a8,_0x15db0e){if(_0x18d7a8){return _0x191e5b(_0x18d7a8);}else{return _0x1184f8(_0x15db0e);}});});}exports['downloadTranscribe']=function(_0x592b1b,_0x457099,_0x16a634){return db[_0x1b85('0x2a')][_0x1b85('0x7c')]({'where':{'id':_0x592b1b['params']['id']}})[_0x1b85('0x22')](handleEntityNotFound(_0x457099))[_0x1b85('0x22')](function(_0x2bdc00){if(_0x2bdc00&&_0x2bdc00[_0x1b85('0x95')]){var _0x425167=_0x2bdc00[_0x1b85('0x95')];var _0x50b6b5=config[_0x1b85('0x96')]+_0x1b85('0x97')+_0x2bdc00['id']+'.txt';if(fs['existsSync'](_0x50b6b5)){return _0x50b6b5;}return writeFile(_0x425167,_0x50b6b5)[_0x1b85('0x22')](function(){return _0x50b6b5;});}else{throw new db[(_0x1b85('0x51'))][(_0x1b85('0x52'))](_0x1b85('0x98'));}})[_0x1b85('0x22')](function(_0x431f1b){return _0x457099[_0x1b85('0x49')](_0x431f1b);})[_0x1b85('0x40')](handleError(_0x457099));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index feec3e7..2f2a60b 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 _0xc7da=['VoiceRecording','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./voiceRecording.attributes','exports','define'];(function(_0x3bab09,_0x217c29){var _0x164376=function(_0x277730){while(--_0x277730){_0x3bab09['push'](_0x3bab09['shift']());}};_0x164376(++_0x217c29);}(_0xc7da,0xf2));var _0xac7d=function(_0x3b2e0a,_0x2d674f){_0x3b2e0a=_0x3b2e0a-0x0;var _0x521790=_0xc7da[_0x3b2e0a];return _0x521790;};'use strict';var _=require(_0xac7d('0x0'));var util=require(_0xac7d('0x1'));var logger=require(_0xac7d('0x2'))('api');var moment=require(_0xac7d('0x3'));var BPromise=require(_0xac7d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xac7d('0x5'));var rimraf=require(_0xac7d('0x6'));var config=require('../../config/environment');var attributes=require(_0xac7d('0x7'));module[_0xac7d('0x8')]=function(_0x263268,_0x2265e7){return _0x263268[_0xac7d('0x9')](_0xac7d('0xa'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0xac7d('0xb'),'fields':[_0xac7d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcff2=['rimraf','../../config/environment','define','VoiceRecording','voice_recordings','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x4c10fe,_0x19e0b2){var _0x5d4ffe=function(_0x219ac8){while(--_0x219ac8){_0x4c10fe['push'](_0x4c10fe['shift']());}};_0x5d4ffe(++_0x19e0b2);}(_0xcff2,0x172));var _0x2cff=function(_0x4191af,_0x5783da){_0x4191af=_0x4191af-0x0;var _0x27bebf=_0xcff2[_0x4191af];return _0x27bebf;};'use strict';var _=require(_0x2cff('0x0'));var util=require(_0x2cff('0x1'));var logger=require(_0x2cff('0x2'))('api');var moment=require(_0x2cff('0x3'));var BPromise=require(_0x2cff('0x4'));var rp=require(_0x2cff('0x5'));var fs=require('fs');var path=require(_0x2cff('0x6'));var rimraf=require(_0x2cff('0x7'));var config=require(_0x2cff('0x8'));var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x4904b5,_0x28f429){return _0x4904b5[_0x2cff('0x9')](_0x2cff('0xa'),attributes,{'tableName':_0x2cff('0xb'),'paranoid':![],'indexes':[{'name':_0x2cff('0xc'),'fields':[_0x2cff('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index c2a67ec..6e38ff5 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 _0xef0f=['CreateVoiceRecording','Setting','findOne','callRecordingEncryption','create','body','value','%s.cypher','unlink','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','options','raw','attributes'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xef0f,0x168));var _0xfef0=function(_0x251c27,_0x281517){_0x251c27=_0x251c27-0x0;var _0x593170=_0xef0f[_0x251c27];return _0x593170;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var moment=require(_0xfef0('0x1'));var BPromise=require(_0xfef0('0x2'));var rs=require(_0xfef0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfef0('0x4'))['db'];var utils=require(_0xfef0('0x5'));var logger=require(_0xfef0('0x6'))('rpc');var config=require(_0xfef0('0x7'));var jayson=require(_0xfef0('0x8'));var client=jayson[_0xfef0('0x9')][_0xfef0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xad43e,_0x11dfd7,_0x5130bd){return new BPromise(function(_0x41ec94,_0x58cf6d){return client[_0xfef0('0xb')](_0xad43e,_0x5130bd)[_0xfef0('0xc')](function(_0x3a81cc){logger[_0xfef0('0xd')](_0xfef0('0xe'),_0x11dfd7,_0xfef0('0xf'));logger[_0xfef0('0x10')](_0xfef0('0x11'),_0x11dfd7,_0xfef0('0xf'),JSON[_0xfef0('0x12')](_0x3a81cc));if(_0x3a81cc[_0xfef0('0x13')]){if(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x14')]===0x1f4){logger[_0xfef0('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x11dfd7,_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);return _0x58cf6d(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);}logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x3a81cc[_0xfef0('0x13')]['message']);return _0x41ec94(_0x3a81cc[_0xfef0('0x13')]['message']);}else{logger['info']('VoiceRecording,\x20%s,\x20%s',_0x11dfd7,_0xfef0('0xf'));_0x41ec94(_0x3a81cc[_0xfef0('0x16')][_0xfef0('0x15')]);}})[_0xfef0('0x17')](function(_0x2a96d9){logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x2a96d9);_0x58cf6d(_0x2a96d9);});});}exports[_0xfef0('0x18')]=function(_0x581459){var _0xd60678=this;return new Promise(function(_0x1642cd,_0x1577fa){return db[_0xfef0('0x19')][_0xfef0('0x1a')](_0x581459['body'],{'raw':_0x581459[_0xfef0('0x1b')]?_0x581459['options'][_0xfef0('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x581459[_0xfef0('0x1b')]?_0x581459[_0xfef0('0x1b')]['where']||null:null,'attributes':_0x581459[_0xfef0('0x1b')]?_0x581459['options'][_0xfef0('0x1d')]||null:null,'limit':_0x581459[_0xfef0('0x1b')]?_0x581459['options']['limit']||null:null})['then'](function(_0x19fde8){logger['info'](_0xfef0('0x18'),_0x581459);logger[_0xfef0('0x10')](_0xfef0('0x18'),_0x581459,JSON[_0xfef0('0x12')](_0x19fde8));_0x1642cd(_0x19fde8);})[_0xfef0('0x17')](function(_0xd687ed){logger['error']('UpdateVoiceRecording',_0xd687ed[_0xfef0('0x15')],_0x581459);_0x1577fa(_0xd60678[_0xfef0('0x13')](0x1f4,_0xd687ed[_0xfef0('0x15')]));});});};exports[_0xfef0('0x1e')]=function(_0xab231c){var _0xf60f2=this;return new Promise(function(_0x5df04f,_0x168b98){var _0x391279=require('../../components/encryptor');var _0x1a6758;return db[_0xfef0('0x1f')][_0xfef0('0x20')]({'attributes':['id',_0xfef0('0x21')],'where':{'id':0x1},'raw':!![]})[_0xfef0('0xc')](function(_0x1ac4a3){_0x1a6758=_0x1ac4a3;return db[_0xfef0('0x19')][_0xfef0('0x22')](_0xab231c[_0xfef0('0x23')]);})[_0xfef0('0xc')](function(_0x3ee42f){if(_0x1a6758[_0xfef0('0x21')]&&fs['existsSync'](_0x3ee42f[_0xfef0('0x24')])){var _0x5806bd=util['format'](_0xfef0('0x25'),_0x3ee42f[_0xfef0('0x24')]);return _0x391279['encryptFile'](_0x3ee42f['value'],_0x5806bd,config['secrets']['recording'])['then'](function(){fs[_0xfef0('0x26')](_0x3ee42f[_0xfef0('0x24')]);logger[_0xfef0('0xd')]('CreateVoiceRecording\x20file\x20encrypted');return _0x3ee42f;});}return _0x3ee42f;})['then'](function(_0x50430e){logger[_0xfef0('0xd')]('CreateVoiceRecording',_0xab231c);logger[_0xfef0('0x10')](_0xfef0('0x1e'),_0xab231c,JSON[_0xfef0('0x12')](_0x50430e));_0x5df04f(_0x50430e);})['catch'](function(_0x3cad13){logger['error'](_0xfef0('0x1e'),_0x3cad13[_0xfef0('0x15')],_0xab231c);_0x168b98(_0xf60f2[_0xfef0('0x13')](0x1f4,_0x3cad13[_0xfef0('0x15')]));});});}; \ No newline at end of file +var _0xed1c=['jayson/promise','client','http','request','then','info','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceRecording,\x20%s,\x20%s','catch','UpdateVoiceRecording','VoiceRecording','body','options','where','attributes','debug','CreateVoiceRecording','../../components/encryptor','Setting','findOne','create','existsSync','value','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0xed1c,0xe4));var _0xced1=function(_0x54ac58,_0x574cc0){_0x54ac58=_0x54ac58-0x0;var _0x958bd0=_0xed1c[_0x54ac58];return _0x958bd0;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xced1('0x2'))['db'];var utils=require(_0xced1('0x3'));var logger=require(_0xced1('0x4'))('rpc');var config=require(_0xced1('0x5'));var jayson=require(_0xced1('0x6'));var client=jayson[_0xced1('0x7')][_0xced1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x59399e,_0x2bcf42,_0x38bca8){return new BPromise(function(_0x39d5df,_0x1fb40b){return client[_0xced1('0x9')](_0x59399e,_0x38bca8)[_0xced1('0xa')](function(_0x325dd2){logger[_0xced1('0xb')]('VoiceRecording,\x20%s,\x20%s',_0x2bcf42,_0xced1('0xc'));logger['debug'](_0xced1('0xd'),_0x2bcf42,_0xced1('0xc'),JSON[_0xced1('0xe')](_0x325dd2));if(_0x325dd2[_0xced1('0xf')]){if(_0x325dd2[_0xced1('0xf')][_0xced1('0x10')]===0x1f4){logger[_0xced1('0xf')]('VoiceRecording,\x20%s,\x20%s',_0x2bcf42,_0x325dd2[_0xced1('0xf')][_0xced1('0x11')]);return _0x1fb40b(_0x325dd2[_0xced1('0xf')][_0xced1('0x11')]);}logger['error'](_0xced1('0x12'),_0x2bcf42,_0x325dd2[_0xced1('0xf')]['message']);return _0x39d5df(_0x325dd2[_0xced1('0xf')][_0xced1('0x11')]);}else{logger[_0xced1('0xb')](_0xced1('0x12'),_0x2bcf42,'request\x20sent');_0x39d5df(_0x325dd2['result'][_0xced1('0x11')]);}})[_0xced1('0x13')](function(_0x236473){logger[_0xced1('0xf')](_0xced1('0x12'),_0x2bcf42,_0x236473);_0x1fb40b(_0x236473);});});}exports[_0xced1('0x14')]=function(_0x5a563a){var _0x56fc50=this;return new Promise(function(_0x2a92c8,_0x111fb0){return db[_0xced1('0x15')]['update'](_0x5a563a[_0xced1('0x16')],{'raw':_0x5a563a[_0xced1('0x17')]?_0x5a563a[_0xced1('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a563a[_0xced1('0x17')]?_0x5a563a[_0xced1('0x17')][_0xced1('0x18')]||null:null,'attributes':_0x5a563a['options']?_0x5a563a[_0xced1('0x17')][_0xced1('0x19')]||null:null,'limit':_0x5a563a[_0xced1('0x17')]?_0x5a563a['options']['limit']||null:null})[_0xced1('0xa')](function(_0x41ee91){logger[_0xced1('0xb')](_0xced1('0x14'),_0x5a563a);logger[_0xced1('0x1a')]('UpdateVoiceRecording',_0x5a563a,JSON[_0xced1('0xe')](_0x41ee91));_0x2a92c8(_0x41ee91);})[_0xced1('0x13')](function(_0x4ea85e){logger['error'](_0xced1('0x14'),_0x4ea85e[_0xced1('0x11')],_0x5a563a);_0x111fb0(_0x56fc50[_0xced1('0xf')](0x1f4,_0x4ea85e[_0xced1('0x11')]));});});};exports[_0xced1('0x1b')]=function(_0x25b6e7){var _0x50c543=this;return new Promise(function(_0x181f6e,_0xf51411){var _0x43cdec=require(_0xced1('0x1c'));var _0x34dd2e;return db[_0xced1('0x1d')][_0xced1('0x1e')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0xced1('0xa')](function(_0x4ef64e){_0x34dd2e=_0x4ef64e;return db[_0xced1('0x15')][_0xced1('0x1f')](_0x25b6e7[_0xced1('0x16')]);})[_0xced1('0xa')](function(_0x5f03cc){if(_0x34dd2e['callRecordingEncryption']&&fs[_0xced1('0x20')](_0x5f03cc[_0xced1('0x21')])){var _0x2bc785=util['format']('%s.cypher',_0x5f03cc['value']);return _0x43cdec[_0xced1('0x22')](_0x5f03cc[_0xced1('0x21')],_0x2bc785,config[_0xced1('0x23')][_0xced1('0x24')])['then'](function(){fs[_0xced1('0x25')](_0x5f03cc[_0xced1('0x21')]);logger[_0xced1('0xb')](_0xced1('0x26'));return _0x5f03cc;});}return _0x5f03cc;})[_0xced1('0xa')](function(_0x33ac43){logger[_0xced1('0xb')]('CreateVoiceRecording',_0x25b6e7);logger['debug'](_0xced1('0x1b'),_0x25b6e7,JSON[_0xced1('0xe')](_0x33ac43));_0x181f6e(_0x33ac43);})[_0xced1('0x13')](function(_0x7ebeb3){logger[_0xced1('0xf')](_0xced1('0x1b'),_0x7ebeb3['message'],_0x25b6e7);_0xf51411(_0x50c543['error'](0x1f4,_0x7ebeb3['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 3f268b4..88676c4 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 _0x5493=['update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','isAuthenticated','index','get','/describe','describe','post','create','put'];(function(_0x2528aa,_0x46c656){var _0x5798af=function(_0x2a7c6e){while(--_0x2a7c6e){_0x2528aa['push'](_0x2528aa['shift']());}};_0x5798af(++_0x46c656);}(_0x5493,0x119));var _0x3549=function(_0x1d18ee,_0x483ecc){_0x1d18ee=_0x1d18ee-0x0;var _0xc07118=_0x5493[_0x1d18ee];return _0xc07118;};'use strict';var multer=require(_0x3549('0x0'));var util=require(_0x3549('0x1'));var path=require(_0x3549('0x2'));var timeout=require(_0x3549('0x3'));var express=require(_0x3549('0x4'));var router=express[_0x3549('0x5')]();var fs_extra=require(_0x3549('0x6'));var auth=require(_0x3549('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3549('0x8'));var controller=require(_0x3549('0x9'));router['get']('/',auth[_0x3549('0xa')](),controller[_0x3549('0xb')]);router[_0x3549('0xc')](_0x3549('0xd'),auth[_0x3549('0xa')](),controller[_0x3549('0xe')]);router[_0x3549('0xc')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3549('0xf')]('/',auth[_0x3549('0xa')](),controller[_0x3549('0x10')]);router[_0x3549('0x11')]('/:id',auth[_0x3549('0xa')](),controller[_0x3549('0x12')]);router[_0x3549('0x13')](_0x3549('0x14'),auth[_0x3549('0xa')](),controller[_0x3549('0x15')]);module[_0x3549('0x16')]=router; \ No newline at end of file +var _0x785c=['put','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create'];(function(_0x347edc,_0x22555c){var _0x5cd71c=function(_0x5c0cdf){while(--_0x5c0cdf){_0x347edc['push'](_0x347edc['shift']());}};_0x5cd71c(++_0x22555c);}(_0x785c,0xf3));var _0xc785=function(_0x1ac683,_0x53858e){_0x1ac683=_0x1ac683-0x0;var _0x45eb42=_0x785c[_0x1ac683];return _0x45eb42;};'use strict';var multer=require(_0xc785('0x0'));var util=require('util');var path=require(_0xc785('0x1'));var timeout=require(_0xc785('0x2'));var express=require(_0xc785('0x3'));var router=express[_0xc785('0x4')]();var fs_extra=require(_0xc785('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc785('0x6'));var config=require(_0xc785('0x7'));var controller=require(_0xc785('0x8'));router[_0xc785('0x9')]('/',auth[_0xc785('0xa')](),controller[_0xc785('0xb')]);router[_0xc785('0x9')]('/describe',auth[_0xc785('0xa')](),controller[_0xc785('0xc')]);router[_0xc785('0x9')](_0xc785('0xd'),auth[_0xc785('0xa')](),controller[_0xc785('0xe')]);router[_0xc785('0xf')]('/',auth[_0xc785('0xa')](),controller[_0xc785('0x10')]);router[_0xc785('0x11')](_0xc785('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xc785('0xa')](),controller[_0xc785('0x12')]);module[_0xc785('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index a19d7d0..30fb827 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 _0x156a=['exports','ENUM','blind','STRING','Yes','sequelize'];(function(_0xbe6968,_0x2d5094){var _0x53d936=function(_0x1d4171){while(--_0x1d4171){_0xbe6968['push'](_0xbe6968['shift']());}};_0x53d936(++_0x2d5094);}(_0x156a,0x101));var _0xa156=function(_0x438319,_0x51389c){_0x438319=_0x438319-0x0;var _0x141703=_0x156a[_0x438319];return _0x141703;};'use strict';var Sequelize=require(_0xa156('0x0'));var moment=require('moment');module[_0xa156('0x1')]={'type':{'type':Sequelize[_0xa156('0x2')](_0xa156('0x3'),'attended')},'result':{'type':Sequelize[_0xa156('0x4')]},'transfererchannel':{'type':Sequelize[_0xa156('0x4')]},'transferercalleridnum':{'type':Sequelize[_0xa156('0x4')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xa156('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xa156('0x4')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0xa156('0x4')]},'transfererexten':{'type':Sequelize[_0xa156('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xa156('0x4')]},'transfereechannel':{'type':Sequelize[_0xa156('0x4')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xa156('0x4')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0xa156('0x4')]},'transfereeexten':{'type':Sequelize[_0xa156('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xa156('0x4')]},'isexternal':{'type':Sequelize[_0xa156('0x2')](_0xa156('0x5'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xa156('0x4')]}}; \ No newline at end of file +var _0xcb9f=['moment','exports','attended','STRING','ENUM','Yes','sequelize'];(function(_0x5b9a30,_0x2b3667){var _0x35f722=function(_0xfb962b){while(--_0xfb962b){_0x5b9a30['push'](_0x5b9a30['shift']());}};_0x35f722(++_0x2b3667);}(_0xcb9f,0xbc));var _0xfcb9=function(_0x4bdb33,_0x3a66dc){_0x4bdb33=_0x4bdb33-0x0;var _0x46c6a8=_0xcb9f[_0x4bdb33];return _0x46c6a8;};'use strict';var Sequelize=require(_0xfcb9('0x0'));var moment=require(_0xfcb9('0x1'));module[_0xfcb9('0x2')]={'type':{'type':Sequelize['ENUM']('blind',_0xfcb9('0x3'))},'result':{'type':Sequelize[_0xfcb9('0x4')]},'transfererchannel':{'type':Sequelize[_0xfcb9('0x4')]},'transferercalleridnum':{'type':Sequelize[_0xfcb9('0x4')]},'transferercalleridname':{'type':Sequelize[_0xfcb9('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0xfcb9('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xfcb9('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xfcb9('0x4')]},'transferercontext':{'type':Sequelize[_0xfcb9('0x4')]},'transfererexten':{'type':Sequelize[_0xfcb9('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xfcb9('0x4')]},'transfereechannel':{'type':Sequelize[_0xfcb9('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xfcb9('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xfcb9('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xfcb9('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0xfcb9('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0xfcb9('0x4')]},'transfereecontext':{'type':Sequelize[_0xfcb9('0x4')]},'transfereeexten':{'type':Sequelize[_0xfcb9('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xfcb9('0x4')]},'isexternal':{'type':Sequelize[_0xfcb9('0x5')](_0xfcb9('0x6'),'No')},'context':{'type':Sequelize[_0xfcb9('0x4')]},'extension':{'type':Sequelize[_0xfcb9('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index d4b3ff7..839a550 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 _0xe490=['sendStatus','end','status','json','offset','undefined','count','apply','reject','update','then','destroy','error','stack','name','send','index','map','VoiceTransferReport','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','rows','catch','show','params','rawAttributes','include','find','create','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x1e5de7,_0x43cf47){var _0x1fcccc=function(_0x5c0c42){while(--_0x5c0c42){_0x1e5de7['push'](_0x1e5de7['shift']());}};_0x1fcccc(++_0x43cf47);}(_0xe490,0x1e2));var _0x0e49=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xe490[_0x4709c0];return _0x13348b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0e49('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e49('0x1'));var rp=require('request-promise');var moment=require(_0x0e49('0x2'));var BPromise=require(_0x0e49('0x3'));var Mustache=require(_0x0e49('0x4'));var util=require('util');var path=require(_0x0e49('0x5'));var sox=require('sox');var csv=require(_0x0e49('0x6'));var ejs=require(_0x0e49('0x7'));var fs=require('fs');var fs_extra=require(_0x0e49('0x8'));var _=require(_0x0e49('0x9'));var squel=require(_0x0e49('0xa'));var crypto=require(_0x0e49('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0e49('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0e49('0xd'));var Papa=require(_0x0e49('0xe'));var Redis=require(_0x0e49('0xf'));var authService=require(_0x0e49('0x10'));var qs=require(_0x0e49('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e49('0x12'));var logger=require(_0x0e49('0x13'))(_0x0e49('0x14'));var utils=require(_0x0e49('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37f9e2,_0x33406f){_0x33406f=_0x33406f||0xcc;return function(_0x35576d){if(_0x35576d){return _0x37f9e2[_0x0e49('0x16')](_0x33406f);}return _0x37f9e2['status'](_0x33406f)[_0x0e49('0x17')]();};}function respondWithResult(_0xb76591,_0x22aa0f){_0x22aa0f=_0x22aa0f||0xc8;return function(_0x216ef9){if(_0x216ef9){return _0xb76591[_0x0e49('0x18')](_0x22aa0f)[_0x0e49('0x19')](_0x216ef9);}};}function respondWithFilteredResult(_0x2c2536,_0x1e0cb3){return function(_0x22a505){if(_0x22a505){var _0x383bea=typeof _0x1e0cb3[_0x0e49('0x1a')]==='undefined'&&typeof _0x1e0cb3['limit']===_0x0e49('0x1b');var _0xc4dc5b=_0x22a505[_0x0e49('0x1c')];var _0x5b7d96=_0x383bea?0x0:_0x1e0cb3[_0x0e49('0x1a')];var _0x12e816=_0x383bea?_0x22a505[_0x0e49('0x1c')]:_0x1e0cb3[_0x0e49('0x1a')]+_0x1e0cb3['limit'];var _0x3cbfa9;if(_0x12e816>=_0xc4dc5b){_0x12e816=_0xc4dc5b;_0x3cbfa9=0xc8;}else{_0x3cbfa9=0xce;}_0x2c2536[_0x0e49('0x18')](_0x3cbfa9);return _0x2c2536['set']('Content-Range',_0x5b7d96+'-'+_0x12e816+'/'+_0xc4dc5b)[_0x0e49('0x19')](_0x22a505);}return null;};}function patchUpdates(_0x2407ea){return function(_0x24b483){try{jsonpatch[_0x0e49('0x1d')](_0x24b483,_0x2407ea,!![]);}catch(_0x5cd4d0){return BPromise[_0x0e49('0x1e')](_0x5cd4d0);}return _0x24b483['save']();};}function saveUpdates(_0x5901fd,_0x2ca952){return function(_0x22a695){if(_0x22a695){return _0x22a695[_0x0e49('0x1f')](_0x5901fd)[_0x0e49('0x20')](function(_0x5cc839){return _0x5cc839;});}return null;};}function removeEntity(_0x3a5db4,_0x1d0816){return function(_0x480388){if(_0x480388){return _0x480388[_0x0e49('0x21')]()[_0x0e49('0x20')](function(){_0x3a5db4[_0x0e49('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5886d0,_0x361304){return function(_0x3f4547){if(!_0x3f4547){_0x5886d0[_0x0e49('0x16')](0x194);}return _0x3f4547;};}function handleError(_0x58ce99,_0x586768){_0x586768=_0x586768||0x1f4;return function(_0x317ad8){logger[_0x0e49('0x22')](_0x317ad8[_0x0e49('0x23')]);if(_0x317ad8[_0x0e49('0x24')]){delete _0x317ad8[_0x0e49('0x24')];}_0x58ce99[_0x0e49('0x18')](_0x586768)[_0x0e49('0x25')](_0x317ad8);};}exports[_0x0e49('0x26')]=function(_0xa267ca,_0x3e4089){var _0x4dab82={},_0x5bc565={},_0x22d087={'count':0x0,'rows':[]};var _0x4e9d7b=_[_0x0e49('0x27')](db[_0x0e49('0x28')]['rawAttributes'],function(_0x32dfff){return{'name':_0x32dfff[_0x0e49('0x29')],'type':_0x32dfff['type'][_0x0e49('0x2a')]};});_0x5bc565['model']=_[_0x0e49('0x27')](_0x4e9d7b,'name');_0x5bc565[_0x0e49('0x2b')]=_[_0x0e49('0x2c')](_0xa267ca[_0x0e49('0x2b')]);_0x5bc565[_0x0e49('0x2d')]=_['intersection'](_0x5bc565[_0x0e49('0x2e')],_0x5bc565[_0x0e49('0x2b')]);_0x4dab82[_0x0e49('0x2f')]=_[_0x0e49('0x30')](_0x5bc565[_0x0e49('0x2e')],qs[_0x0e49('0x31')](_0xa267ca[_0x0e49('0x2b')]['fields']));_0x4dab82[_0x0e49('0x2f')]=_0x4dab82[_0x0e49('0x2f')][_0x0e49('0x32')]?_0x4dab82['attributes']:_0x5bc565[_0x0e49('0x2e')];if(!_0xa267ca[_0x0e49('0x2b')][_0x0e49('0x33')](_0x0e49('0x34'))){_0x4dab82[_0x0e49('0x35')]=qs['limit'](_0xa267ca[_0x0e49('0x2b')]['limit']);_0x4dab82[_0x0e49('0x1a')]=qs[_0x0e49('0x1a')](_0xa267ca[_0x0e49('0x2b')][_0x0e49('0x1a')]);}_0x4dab82[_0x0e49('0x36')]=qs[_0x0e49('0x37')](_0xa267ca['query']['sort']);_0x4dab82[_0x0e49('0x38')]=qs[_0x0e49('0x2d')](_[_0x0e49('0x39')](_0xa267ca[_0x0e49('0x2b')],_0x5bc565[_0x0e49('0x2d')]),_0x4e9d7b);if(_0xa267ca['query'][_0x0e49('0x3a')]){_0x4dab82['where']=_[_0x0e49('0x3b')](_0x4dab82['where'],{'$or':_['map'](_0x4e9d7b,function(_0xf711c1){if(_0xf711c1['type']!=='VIRTUAL'){var _0x51c8c6={};_0x51c8c6[_0xf711c1[_0x0e49('0x24')]]={'$like':'%'+_0xa267ca[_0x0e49('0x2b')][_0x0e49('0x3a')]+'%'};return _0x51c8c6;}})});}_0x4dab82=_[_0x0e49('0x3b')]({},_0x4dab82,_0xa267ca[_0x0e49('0x3c')]);var _0x1fb6b3={'where':_0x4dab82['where']};return db[_0x0e49('0x28')][_0x0e49('0x1c')](_0x1fb6b3)[_0x0e49('0x20')](function(_0x4a3431){_0x22d087[_0x0e49('0x1c')]=_0x4a3431;if(_0xa267ca[_0x0e49('0x2b')][_0x0e49('0x3d')]){_0x4dab82['include']=[{'all':!![]}];}return db[_0x0e49('0x28')]['findAll'](_0x4dab82);})['then'](function(_0x465635){_0x22d087[_0x0e49('0x3e')]=_0x465635;return _0x22d087;})[_0x0e49('0x20')](respondWithFilteredResult(_0x3e4089,_0x4dab82))[_0x0e49('0x3f')](handleError(_0x3e4089,null));};exports[_0x0e49('0x40')]=function(_0x28131c,_0x4f6b60){var _0x5a938d={'raw':!![],'where':{'id':_0x28131c[_0x0e49('0x41')]['id']}},_0x297237={};_0x297237[_0x0e49('0x2e')]=_[_0x0e49('0x2c')](db['VoiceTransferReport'][_0x0e49('0x42')]);_0x297237[_0x0e49('0x2b')]=_['keys'](_0x28131c[_0x0e49('0x2b')]);_0x297237[_0x0e49('0x2d')]=_['intersection'](_0x297237[_0x0e49('0x2e')],_0x297237[_0x0e49('0x2b')]);_0x5a938d['attributes']=_[_0x0e49('0x30')](_0x297237[_0x0e49('0x2e')],qs[_0x0e49('0x31')](_0x28131c[_0x0e49('0x2b')][_0x0e49('0x31')]));_0x5a938d[_0x0e49('0x2f')]=_0x5a938d[_0x0e49('0x2f')]['length']?_0x5a938d[_0x0e49('0x2f')]:_0x297237[_0x0e49('0x2e')];if(_0x28131c[_0x0e49('0x2b')][_0x0e49('0x3d')]){_0x5a938d[_0x0e49('0x43')]=[{'all':!![]}];}_0x5a938d=_[_0x0e49('0x3b')]({},_0x5a938d,_0x28131c[_0x0e49('0x3c')]);return db[_0x0e49('0x28')][_0x0e49('0x44')](_0x5a938d)[_0x0e49('0x20')](handleEntityNotFound(_0x4f6b60,null))[_0x0e49('0x20')](respondWithResult(_0x4f6b60,null))[_0x0e49('0x3f')](handleError(_0x4f6b60,null));};exports[_0x0e49('0x45')]=function(_0x52592b,_0x150460){return db[_0x0e49('0x28')]['create'](_0x52592b[_0x0e49('0x46')],{})[_0x0e49('0x20')](respondWithResult(_0x150460,0xc9))['catch'](handleError(_0x150460,null));};exports[_0x0e49('0x1f')]=function(_0x17cca8,_0x8303bb){if(_0x17cca8[_0x0e49('0x46')]['id']){delete _0x17cca8[_0x0e49('0x46')]['id'];}return db[_0x0e49('0x28')]['find']({'where':{'id':_0x17cca8[_0x0e49('0x41')]['id']}})[_0x0e49('0x20')](handleEntityNotFound(_0x8303bb,null))['then'](saveUpdates(_0x17cca8[_0x0e49('0x46')],null))[_0x0e49('0x20')](respondWithResult(_0x8303bb,null))['catch'](handleError(_0x8303bb,null));};exports[_0x0e49('0x21')]=function(_0x9b2d3c,_0x5d2c93){return db['VoiceTransferReport'][_0x0e49('0x44')]({'where':{'id':_0x9b2d3c[_0x0e49('0x41')]['id']}})[_0x0e49('0x20')](handleEntityNotFound(_0x5d2c93,null))[_0x0e49('0x20')](removeEntity(_0x5d2c93,null))[_0x0e49('0x3f')](handleError(_0x5d2c93,null));};exports[_0x0e49('0x47')]=function(_0x620a68,_0x12376a){return db[_0x0e49('0x28')][_0x0e49('0x47')]()['then'](respondWithResult(_0x12376a,null))['catch'](handleError(_0x12376a,null));}; \ No newline at end of file +var _0xc74d=['keys','find','create','body','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','status','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','VoiceTransferReport','includeAll','include','findAll','rows','catch','params'];(function(_0xbe48a,_0x4d3ec5){var _0x3eeda0=function(_0x2d758d){while(--_0x2d758d){_0xbe48a['push'](_0xbe48a['shift']());}};_0x3eeda0(++_0x4d3ec5);}(_0xc74d,0x1df));var _0xdc74=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xc74d[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdc74('0x0'));var jsonpatch=require(_0xdc74('0x1'));var rp=require('request-promise');var moment=require(_0xdc74('0x2'));var BPromise=require(_0xdc74('0x3'));var Mustache=require(_0xdc74('0x4'));var util=require(_0xdc74('0x5'));var path=require(_0xdc74('0x6'));var sox=require(_0xdc74('0x7'));var csv=require('to-csv');var ejs=require(_0xdc74('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdc74('0x9'));var squel=require(_0xdc74('0xa'));var crypto=require(_0xdc74('0xb'));var jsforce=require(_0xdc74('0xc'));var deskjs=require(_0xdc74('0xd'));var toCsv=require(_0xdc74('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdc74('0xf'));var qs=require(_0xdc74('0x10'));var as=require(_0xdc74('0x11'));var hardwareService=require(_0xdc74('0x12'));var logger=require(_0xdc74('0x13'))(_0xdc74('0x14'));var utils=require(_0xdc74('0x15'));var config=require(_0xdc74('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xdc74('0x17'))['db'];function respondWithStatusCode(_0x3abe27,_0xfd58f7){_0xfd58f7=_0xfd58f7||0xcc;return function(_0x4922e0){if(_0x4922e0){return _0x3abe27[_0xdc74('0x18')](_0xfd58f7);}return _0x3abe27['status'](_0xfd58f7)[_0xdc74('0x19')]();};}function respondWithResult(_0x2a5904,_0x34863b){_0x34863b=_0x34863b||0xc8;return function(_0x593482){if(_0x593482){return _0x2a5904['status'](_0x34863b)[_0xdc74('0x1a')](_0x593482);}};}function respondWithFilteredResult(_0x39ed6e,_0x5e613c){return function(_0x13f02e){if(_0x13f02e){var _0xb8a54b=typeof _0x5e613c[_0xdc74('0x1b')]===_0xdc74('0x1c')&&typeof _0x5e613c['limit']===_0xdc74('0x1c');var _0x3beab4=_0x13f02e[_0xdc74('0x1d')];var _0x5a40ed=_0xb8a54b?0x0:_0x5e613c[_0xdc74('0x1b')];var _0x5da561=_0xb8a54b?_0x13f02e[_0xdc74('0x1d')]:_0x5e613c[_0xdc74('0x1b')]+_0x5e613c[_0xdc74('0x1e')];var _0xf13ab4;if(_0x5da561>=_0x3beab4){_0x5da561=_0x3beab4;_0xf13ab4=0xc8;}else{_0xf13ab4=0xce;}_0x39ed6e['status'](_0xf13ab4);return _0x39ed6e[_0xdc74('0x1f')](_0xdc74('0x20'),_0x5a40ed+'-'+_0x5da561+'/'+_0x3beab4)[_0xdc74('0x1a')](_0x13f02e);}return null;};}function patchUpdates(_0x14421e){return function(_0xaf8bc3){try{jsonpatch[_0xdc74('0x21')](_0xaf8bc3,_0x14421e,!![]);}catch(_0x1a1b24){return BPromise[_0xdc74('0x22')](_0x1a1b24);}return _0xaf8bc3[_0xdc74('0x23')]();};}function saveUpdates(_0x27d8d8,_0x4cc17c){return function(_0x11c581){if(_0x11c581){return _0x11c581[_0xdc74('0x24')](_0x27d8d8)[_0xdc74('0x25')](function(_0xa7e995){return _0xa7e995;});}return null;};}function removeEntity(_0x5ac616,_0x376555){return function(_0x48f2a5){if(_0x48f2a5){return _0x48f2a5[_0xdc74('0x26')]()[_0xdc74('0x25')](function(){_0x5ac616['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cfb01,_0x4b5912){return function(_0x150db9){if(!_0x150db9){_0x3cfb01[_0xdc74('0x18')](0x194);}return _0x150db9;};}function handleError(_0x37a152,_0x13075d){_0x13075d=_0x13075d||0x1f4;return function(_0x5b85b8){logger[_0xdc74('0x27')](_0x5b85b8[_0xdc74('0x28')]);if(_0x5b85b8[_0xdc74('0x29')]){delete _0x5b85b8['name'];}_0x37a152[_0xdc74('0x2a')](_0x13075d)[_0xdc74('0x2b')](_0x5b85b8);};}exports[_0xdc74('0x2c')]=function(_0x3c20a1,_0x45845f){var _0x3f818c={},_0x124e38={},_0x416319={'count':0x0,'rows':[]};var _0x5597f9=_[_0xdc74('0x2d')](db['VoiceTransferReport'][_0xdc74('0x2e')],function(_0x584d31){return{'name':_0x584d31[_0xdc74('0x2f')],'type':_0x584d31[_0xdc74('0x30')][_0xdc74('0x31')]};});_0x124e38[_0xdc74('0x32')]=_[_0xdc74('0x2d')](_0x5597f9,_0xdc74('0x29'));_0x124e38[_0xdc74('0x33')]=_['keys'](_0x3c20a1['query']);_0x124e38['filters']=_[_0xdc74('0x34')](_0x124e38[_0xdc74('0x32')],_0x124e38[_0xdc74('0x33')]);_0x3f818c['attributes']=_[_0xdc74('0x34')](_0x124e38[_0xdc74('0x32')],qs[_0xdc74('0x35')](_0x3c20a1['query'][_0xdc74('0x35')]));_0x3f818c[_0xdc74('0x36')]=_0x3f818c[_0xdc74('0x36')][_0xdc74('0x37')]?_0x3f818c['attributes']:_0x124e38['model'];if(!_0x3c20a1[_0xdc74('0x33')][_0xdc74('0x38')](_0xdc74('0x39'))){_0x3f818c['limit']=qs[_0xdc74('0x1e')](_0x3c20a1[_0xdc74('0x33')][_0xdc74('0x1e')]);_0x3f818c[_0xdc74('0x1b')]=qs[_0xdc74('0x1b')](_0x3c20a1['query'][_0xdc74('0x1b')]);}_0x3f818c[_0xdc74('0x3a')]=qs[_0xdc74('0x3b')](_0x3c20a1[_0xdc74('0x33')][_0xdc74('0x3b')]);_0x3f818c[_0xdc74('0x3c')]=qs[_0xdc74('0x3d')](_[_0xdc74('0x3e')](_0x3c20a1['query'],_0x124e38[_0xdc74('0x3d')]),_0x5597f9);if(_0x3c20a1[_0xdc74('0x33')][_0xdc74('0x3f')]){_0x3f818c[_0xdc74('0x3c')]=_[_0xdc74('0x40')](_0x3f818c[_0xdc74('0x3c')],{'$or':_[_0xdc74('0x2d')](_0x5597f9,function(_0x5137ef){if(_0x5137ef[_0xdc74('0x30')]!==_0xdc74('0x41')){var _0x584209={};_0x584209[_0x5137ef['name']]={'$like':'%'+_0x3c20a1[_0xdc74('0x33')]['filter']+'%'};return _0x584209;}})});}_0x3f818c=_[_0xdc74('0x40')]({},_0x3f818c,_0x3c20a1[_0xdc74('0x42')]);var _0x21bb0d={'where':_0x3f818c[_0xdc74('0x3c')]};return db[_0xdc74('0x43')]['count'](_0x21bb0d)[_0xdc74('0x25')](function(_0x15d0eb){_0x416319[_0xdc74('0x1d')]=_0x15d0eb;if(_0x3c20a1[_0xdc74('0x33')][_0xdc74('0x44')]){_0x3f818c[_0xdc74('0x45')]=[{'all':!![]}];}return db[_0xdc74('0x43')][_0xdc74('0x46')](_0x3f818c);})[_0xdc74('0x25')](function(_0x45d352){_0x416319[_0xdc74('0x47')]=_0x45d352;return _0x416319;})[_0xdc74('0x25')](respondWithFilteredResult(_0x45845f,_0x3f818c))[_0xdc74('0x48')](handleError(_0x45845f,null));};exports['show']=function(_0x5b4e15,_0x48314b){var _0xf7eea7={'raw':!![],'where':{'id':_0x5b4e15[_0xdc74('0x49')]['id']}},_0x6c896d={};_0x6c896d[_0xdc74('0x32')]=_[_0xdc74('0x4a')](db[_0xdc74('0x43')][_0xdc74('0x2e')]);_0x6c896d[_0xdc74('0x33')]=_[_0xdc74('0x4a')](_0x5b4e15['query']);_0x6c896d[_0xdc74('0x3d')]=_['intersection'](_0x6c896d['model'],_0x6c896d['query']);_0xf7eea7['attributes']=_[_0xdc74('0x34')](_0x6c896d[_0xdc74('0x32')],qs['fields'](_0x5b4e15[_0xdc74('0x33')]['fields']));_0xf7eea7[_0xdc74('0x36')]=_0xf7eea7['attributes'][_0xdc74('0x37')]?_0xf7eea7['attributes']:_0x6c896d[_0xdc74('0x32')];if(_0x5b4e15[_0xdc74('0x33')][_0xdc74('0x44')]){_0xf7eea7[_0xdc74('0x45')]=[{'all':!![]}];}_0xf7eea7=_[_0xdc74('0x40')]({},_0xf7eea7,_0x5b4e15[_0xdc74('0x42')]);return db[_0xdc74('0x43')][_0xdc74('0x4b')](_0xf7eea7)[_0xdc74('0x25')](handleEntityNotFound(_0x48314b,null))[_0xdc74('0x25')](respondWithResult(_0x48314b,null))[_0xdc74('0x48')](handleError(_0x48314b,null));};exports[_0xdc74('0x4c')]=function(_0x4d6d37,_0x34ad79){return db[_0xdc74('0x43')][_0xdc74('0x4c')](_0x4d6d37[_0xdc74('0x4d')],{})[_0xdc74('0x25')](respondWithResult(_0x34ad79,0xc9))[_0xdc74('0x48')](handleError(_0x34ad79,null));};exports[_0xdc74('0x24')]=function(_0x28ee4a,_0x2ad3b7){if(_0x28ee4a['body']['id']){delete _0x28ee4a['body']['id'];}return db[_0xdc74('0x43')]['find']({'where':{'id':_0x28ee4a[_0xdc74('0x49')]['id']}})['then'](handleEntityNotFound(_0x2ad3b7,null))[_0xdc74('0x25')](saveUpdates(_0x28ee4a[_0xdc74('0x4d')],null))['then'](respondWithResult(_0x2ad3b7,null))['catch'](handleError(_0x2ad3b7,null));};exports[_0xdc74('0x26')]=function(_0x4a7aa6,_0x12fdb6){return db[_0xdc74('0x43')][_0xdc74('0x4b')]({'where':{'id':_0x4a7aa6[_0xdc74('0x49')]['id']}})['then'](handleEntityNotFound(_0x12fdb6,null))[_0xdc74('0x25')](removeEntity(_0x12fdb6,null))[_0xdc74('0x48')](handleError(_0x12fdb6,null));};exports[_0xdc74('0x4e')]=function(_0x153134,_0x28085c){return db[_0xdc74('0x43')][_0xdc74('0x4e')]()[_0xdc74('0x25')](respondWithResult(_0x28085c,null))[_0xdc74('0x48')](handleError(_0x28085c,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 7b3365d..b360e85 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 _0x0170=['./voiceTransferReport.attributes','exports','define','VoiceTransferReport','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x0170,0x1a4));var _0x0017=function(_0xbc2c27,_0x4a2d32){_0xbc2c27=_0xbc2c27-0x0;var _0x1c1c8c=_0x0170[_0xbc2c27];return _0x1c1c8c;};'use strict';var _=require('lodash');var util=require(_0x0017('0x0'));var logger=require(_0x0017('0x1'))(_0x0017('0x2'));var moment=require(_0x0017('0x3'));var BPromise=require(_0x0017('0x4'));var rp=require(_0x0017('0x5'));var fs=require('fs');var path=require(_0x0017('0x6'));var rimraf=require(_0x0017('0x7'));var config=require(_0x0017('0x8'));var attributes=require(_0x0017('0x9'));module[_0x0017('0xa')]=function(_0x1c52e9,_0x58cb89){return _0x1c52e9[_0x0017('0xb')](_0x0017('0xc'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe24e=['report_call_transfer','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceTransferReport.attributes','exports','VoiceTransferReport'];(function(_0x25a013,_0x327e08){var _0x1bac05=function(_0x39c52c){while(--_0x39c52c){_0x25a013['push'](_0x25a013['shift']());}};_0x1bac05(++_0x327e08);}(_0xe24e,0x121));var _0xee24=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xe24e[_0x26462c];return _0x509a42;};'use strict';var _=require('lodash');var util=require(_0xee24('0x0'));var logger=require(_0xee24('0x1'))(_0xee24('0x2'));var moment=require(_0xee24('0x3'));var BPromise=require(_0xee24('0x4'));var rp=require(_0xee24('0x5'));var fs=require('fs');var path=require(_0xee24('0x6'));var rimraf=require('rimraf');var config=require(_0xee24('0x7'));var attributes=require(_0xee24('0x8'));module[_0xee24('0x9')]=function(_0x234a4b,_0xc35102){return _0x234a4b['define'](_0xee24('0xa'),attributes,{'tableName':_0xee24('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 df01b3a..c4ef2d1 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 _0x65c9=['VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x65c9,0x65));var _0x965c=function(_0x1d279a,_0x550c4e){_0x1d279a=_0x1d279a-0x0;var _0x35af61=_0x65c9[_0x1d279a];return _0x35af61;};'use strict';var _=require('lodash');var util=require(_0x965c('0x0'));var moment=require(_0x965c('0x1'));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['client'][_0x965c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x298804,_0x51da6a,_0x2b3397){return new BPromise(function(_0x295422,_0x228184){return client[_0x965c('0xc')](_0x298804,_0x2b3397)[_0x965c('0xd')](function(_0x19b512){logger[_0x965c('0xe')](_0x965c('0xf'),_0x51da6a,'request\x20sent');logger[_0x965c('0x10')](_0x965c('0x11'),_0x51da6a,_0x965c('0x12'),JSON[_0x965c('0x13')](_0x19b512));if(_0x19b512[_0x965c('0x14')]){if(_0x19b512[_0x965c('0x14')][_0x965c('0x15')]===0x1f4){logger[_0x965c('0x14')]('VoiceTransferReport,\x20%s,\x20%s',_0x51da6a,_0x19b512['error'][_0x965c('0x16')]);return _0x228184(_0x19b512[_0x965c('0x14')][_0x965c('0x16')]);}logger[_0x965c('0x14')]('VoiceTransferReport,\x20%s,\x20%s',_0x51da6a,_0x19b512[_0x965c('0x14')][_0x965c('0x16')]);return _0x295422(_0x19b512[_0x965c('0x14')][_0x965c('0x16')]);}else{logger[_0x965c('0xe')](_0x965c('0xf'),_0x51da6a,_0x965c('0x12'));_0x295422(_0x19b512[_0x965c('0x17')][_0x965c('0x16')]);}})['catch'](function(_0x41e4e6){logger[_0x965c('0x14')](_0x965c('0xf'),_0x51da6a,_0x41e4e6);_0x228184(_0x41e4e6);});});}exports[_0x965c('0x18')]=function(_0x1ee2a9){var _0x2827f2=this;return new Promise(function(_0xc62a0c,_0x49b036){return db[_0x965c('0x19')][_0x965c('0x1a')](_0x1ee2a9[_0x965c('0x1b')],{'raw':_0x1ee2a9[_0x965c('0x1c')]?_0x1ee2a9['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x18b23d){logger[_0x965c('0xe')](_0x965c('0x18'),_0x1ee2a9);logger['debug'](_0x965c('0x18'),_0x1ee2a9,JSON['stringify'](_0x18b23d));_0xc62a0c(_0x18b23d);})['catch'](function(_0x2ee2ea){logger[_0x965c('0x14')](_0x965c('0x18'),_0x2ee2ea[_0x965c('0x16')],_0x1ee2a9);_0x49b036(_0x2827f2[_0x965c('0x14')](0x1f4,_0x2ee2ea[_0x965c('0x16')]));});});}; \ No newline at end of file +var _0x50e2=['CreateVoiceTransferReport','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','create','body','options','raw'];(function(_0x54ca21,_0x589f57){var _0x4b248a=function(_0x3dac56){while(--_0x3dac56){_0x54ca21['push'](_0x54ca21['shift']());}};_0x4b248a(++_0x589f57);}(_0x50e2,0x152));var _0x250e=function(_0x45dd0e,_0x28e603){_0x45dd0e=_0x45dd0e-0x0;var _0x50e5ca=_0x50e2[_0x45dd0e];return _0x50e5ca;};'use strict';var _=require('lodash');var util=require(_0x250e('0x0'));var moment=require(_0x250e('0x1'));var BPromise=require(_0x250e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x250e('0x3'));var db=require(_0x250e('0x4'))['db'];var utils=require(_0x250e('0x5'));var logger=require(_0x250e('0x6'))(_0x250e('0x7'));var config=require(_0x250e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x250e('0x9')][_0x250e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xedeff5,_0x4d7ac0,_0x5450d3){return new BPromise(function(_0x2bb2a0,_0xafb0e7){return client['request'](_0xedeff5,_0x5450d3)[_0x250e('0xb')](function(_0x277e0e){logger[_0x250e('0xc')](_0x250e('0xd'),_0x4d7ac0,_0x250e('0xe'));logger[_0x250e('0xf')](_0x250e('0x10'),_0x4d7ac0,_0x250e('0xe'),JSON[_0x250e('0x11')](_0x277e0e));if(_0x277e0e[_0x250e('0x12')]){if(_0x277e0e['error'][_0x250e('0x13')]===0x1f4){logger[_0x250e('0x12')](_0x250e('0xd'),_0x4d7ac0,_0x277e0e['error']['message']);return _0xafb0e7(_0x277e0e[_0x250e('0x12')][_0x250e('0x14')]);}logger[_0x250e('0x12')](_0x250e('0xd'),_0x4d7ac0,_0x277e0e[_0x250e('0x12')][_0x250e('0x14')]);return _0x2bb2a0(_0x277e0e['error'][_0x250e('0x14')]);}else{logger[_0x250e('0xc')](_0x250e('0xd'),_0x4d7ac0,_0x250e('0xe'));_0x2bb2a0(_0x277e0e[_0x250e('0x15')][_0x250e('0x14')]);}})['catch'](function(_0x57bf93){logger[_0x250e('0x12')](_0x250e('0xd'),_0x4d7ac0,_0x57bf93);_0xafb0e7(_0x57bf93);});});}exports['CreateVoiceTransferReport']=function(_0x44bef1){var _0x546e88=this;return new Promise(function(_0x295817,_0x2194e7){return db['VoiceTransferReport'][_0x250e('0x16')](_0x44bef1[_0x250e('0x17')],{'raw':_0x44bef1[_0x250e('0x18')]?_0x44bef1[_0x250e('0x18')][_0x250e('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x383946){logger[_0x250e('0xc')](_0x250e('0x1a'),_0x44bef1);logger[_0x250e('0xf')](_0x250e('0x1a'),_0x44bef1,JSON[_0x250e('0x11')](_0x383946));_0x295817(_0x383946);})[_0x250e('0x1b')](function(_0x6eb68c){logger[_0x250e('0x12')](_0x250e('0x1a'),_0x6eb68c['message'],_0x44bef1);_0x2194e7(_0x546e88[_0x250e('0x12')](0x1f4,_0x6eb68c['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index dfcadce..8ebd5d0 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 _0x153f=['hold','/unhold','unhold','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','originate','/hangup','isWebrtcLicence','hangup','answer','/hold'];(function(_0x2d335f,_0x16aacd){var _0x2294c6=function(_0x288c7e){while(--_0x288c7e){_0x2d335f['push'](_0x2d335f['shift']());}};_0x2294c6(++_0x16aacd);}(_0x153f,0x15b));var _0xf153=function(_0x54d162,_0x27c38d){_0x54d162=_0x54d162-0x0;var _0x2bced5=_0x153f[_0x54d162];return _0x2bced5;};'use strict';var express=require(_0xf153('0x0'));var router=express[_0xf153('0x1')]();var auth=require(_0xf153('0x2'));var controller=require(_0xf153('0x3'));router[_0xf153('0x4')](_0xf153('0x5'),auth[_0xf153('0x6')](),auth['isWebrtcLicence'](),controller[_0xf153('0x7')]);router['post'](_0xf153('0x8'),auth[_0xf153('0x6')](),auth[_0xf153('0x9')](),controller[_0xf153('0xa')]);router[_0xf153('0x4')]('/answer',auth[_0xf153('0x6')](),auth[_0xf153('0x9')](),controller[_0xf153('0xb')]);router[_0xf153('0x4')](_0xf153('0xc'),auth[_0xf153('0x6')](),auth[_0xf153('0x9')](),controller[_0xf153('0xd')]);router[_0xf153('0x4')](_0xf153('0xe'),auth['isAuthenticated'](),auth[_0xf153('0x9')](),controller[_0xf153('0xf')]);router[_0xf153('0x4')]('/calls',auth[_0xf153('0x6')](),auth[_0xf153('0x9')](),controller[_0xf153('0x10')]);router[_0xf153('0x4')](_0xf153('0x11'),auth[_0xf153('0x6')](),auth[_0xf153('0x9')](),controller[_0xf153('0x12')]);module[_0xf153('0x13')]=router; \ No newline at end of file +var _0x6f0d=['isAuthenticated','isWebrtcLicence','originate','/hangup','/answer','/hold','hold','unhold','calls','/transfer','transfer','exports','Router','../../components/auth/service','./webbar.controller','post'];(function(_0x199fcb,_0x4590e0){var _0x17a868=function(_0x1f5344){while(--_0x1f5344){_0x199fcb['push'](_0x199fcb['shift']());}};_0x17a868(++_0x4590e0);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x520748,_0xb83b9c){_0x520748=_0x520748-0x0;var _0x3c53a6=_0x6f0d[_0x520748];return _0x3c53a6;};'use strict';var express=require('express');var router=express[_0xd6f0('0x0')]();var auth=require(_0xd6f0('0x1'));var controller=require(_0xd6f0('0x2'));router[_0xd6f0('0x3')]('/originate',auth[_0xd6f0('0x4')](),auth[_0xd6f0('0x5')](),controller[_0xd6f0('0x6')]);router[_0xd6f0('0x3')](_0xd6f0('0x7'),auth['isAuthenticated'](),auth[_0xd6f0('0x5')](),controller['hangup']);router[_0xd6f0('0x3')](_0xd6f0('0x8'),auth[_0xd6f0('0x4')](),auth[_0xd6f0('0x5')](),controller['answer']);router['post'](_0xd6f0('0x9'),auth[_0xd6f0('0x4')](),auth[_0xd6f0('0x5')](),controller[_0xd6f0('0xa')]);router[_0xd6f0('0x3')]('/unhold',auth[_0xd6f0('0x4')](),auth[_0xd6f0('0x5')](),controller[_0xd6f0('0xb')]);router[_0xd6f0('0x3')]('/calls',auth[_0xd6f0('0x4')](),auth[_0xd6f0('0x5')](),controller[_0xd6f0('0xc')]);router[_0xd6f0('0x3')](_0xd6f0('0xd'),auth[_0xd6f0('0x4')](),auth[_0xd6f0('0x5')](),controller[_0xd6f0('0xe')]);module[_0xd6f0('0xf')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index f36bfdf..e2a9b83 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 _0xaf80=['../../mysqldb','../../config/environment','client','http','../../config/logger','webbarapi','ioredis','redis','localhost','validate','number','string','callNumber\x20is\x20required','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','emit','log','handleError:','error','status','send','name','NotFound','request','then','code','message','result','catch','agent','all','filter','rows','UserId','length','\x20not\x20found!','originate\x20fired:','body','userId','callNumber','callerId','callbackUrl','info','entityFound:','format','user:%s','webbar:originate','json','originate\x20executed!','hangup','hangup\x20fired:','sessionId','webbar:hangup','hangup\x20executed!','answer','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','calls','VoiceChannels','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','webbar:transfer','path','lodash'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xaf80,0x1ef));var _0x0af8=function(_0x3e913d,_0x4349eb){_0x3e913d=_0x3e913d-0x0;var _0x7fd023=_0xaf80[_0x3e913d];return _0x7fd023;};'use strict';var path=require(_0x0af8('0x0'));var fs=require('fs');var _=require(_0x0af8('0x1'));var db=require(_0x0af8('0x2'))['db'];var config=require(_0x0af8('0x3'));var util=require('util');var BPromise=require('bluebird');var jayson=require('jayson/promise');var amiClient=jayson[_0x0af8('0x4')][_0x0af8('0x5')]({'port':0x232a});var logger=require(_0x0af8('0x6'))(_0x0af8('0x7'));var Redis=require(_0x0af8('0x8'));config[_0x0af8('0x9')]=_['defaults'](config['redis'],{'host':_0x0af8('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0af8('0x9')]));var Schema=require(_0x0af8('0xb'));var originateValidation=new Schema({'userId':{'type':_0x0af8('0xc'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x0af8('0xd'),'required':[!![],_0x0af8('0xe')]},'callerId':{'type':_0x0af8('0xd')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0x0af8('0xf')]},'sessionId':{'type':_0x0af8('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x0af8('0xc'),'required':[!![],_0x0af8('0xf')]},'sessionId':{'type':_0x0af8('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x0af8('0xf')]},'sessionId':{'type':_0x0af8('0xd'),'required':[!![],_0x0af8('0x10')]},'transferNumber':{'type':_0x0af8('0xd'),'required':[!![],_0x0af8('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0x0af8('0xc'),'required':[!![],_0x0af8('0xf')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x0af8('0xf')]},'sessionId':{'type':_0x0af8('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x0af8('0xc'),'required':[!![],_0x0af8('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0x0af8('0xc'),'required':[!![],_0x0af8('0xf')]}});function emit(_0x4755cb,_0x325b4c,_0x50d5ba){logger['info'](_0x4755cb,_0x325b4c,JSON['stringify'](_0x50d5ba));io['to'](_0x4755cb)[_0x0af8('0x12')](_0x325b4c,_0x50d5ba);}function handleError(_0x465161){return function(_0x54e946){console[_0x0af8('0x13')](_0x0af8('0x14'),_0x54e946,_0x54e946 instanceof RangeError);logger[_0x0af8('0x15')](_0x54e946['stack']);if(_0x54e946 instanceof RangeError){if(_0x54e946['name']){delete _0x54e946['name'];}_0x465161[_0x0af8('0x16')](0x194)[_0x0af8('0x17')](_0x54e946);}else{if(_0x54e946['name']){delete _0x54e946[_0x0af8('0x18')];}_0x465161['status'](0x1f4)['send'](_0x54e946);}};}function checkError(){return function(_0x40384f){if(!_0x40384f){throw new RangeError(_0x0af8('0x19'));}return _0x40384f;};}function respondWithRpcPromise(_0x29cd4a,_0x5c0dd1){return new BPromise(function(_0x162e95,_0x52778f){var _0x592523=amiClient;return _0x592523[_0x0af8('0x1a')](_0x29cd4a,_0x5c0dd1)[_0x0af8('0x1b')](function(_0x4b0492){if(_0x4b0492[_0x0af8('0x15')]){if(_0x4b0492[_0x0af8('0x15')][_0x0af8('0x1c')]===0x1f4){return _0x52778f(_0x4b0492[_0x0af8('0x15')][_0x0af8('0x1d')]);}return _0x162e95(_0x4b0492['error']['message']);}else{_0x162e95(_0x4b0492[_0x0af8('0x1e')]);}})[_0x0af8('0x1f')](function(_0x359583){_0x52778f(_0x359583);});});}function getAgent(_0xb43164){return db['User']['findOne']({'where':{'id':_0xb43164,'role':_0x0af8('0x20')}})[_0x0af8('0x1b')](checkError());}function getAgentCheckSession(_0x23a102,_0x140104){return new BPromise(function(_0x2e8853,_0x410216){var _0x318476=respondWithRpcPromise('VoiceChannels');var _0x34aa8b=getAgent(_0x23a102);Promise[_0x0af8('0x21')]([_0x318476,_0x34aa8b])[_0x0af8('0x1b')](function(_0x20eab4){var _0x1b94cf=_0x20eab4[0x0];var _0x231230=_0x20eab4[0x1];var _0x4575b0=_[_0x0af8('0x22')](_0x1b94cf[_0x0af8('0x23')],function(_0x270b49){return _0x270b49[_0x0af8('0x24')]==_0x231230['id']&&_0x270b49['sessionId']==_0x140104;});if(_0x4575b0[_0x0af8('0x25')]==0x1){_0x2e8853(_0x231230);}else{_0x410216(new RangeError('sessionId\x20'+_0x140104+_0x0af8('0x26')));}});});}exports['originate']=function(_0x318ca7,_0x1d2d4f){logger['info'](_0x0af8('0x27'),_0x318ca7[_0x0af8('0x28')]);var _0x34b3e5=originateValidation['validate'](_0x318ca7[_0x0af8('0x28')]);if(_0x34b3e5[_0x0af8('0x25')]>0x0){return _0x1d2d4f[_0x0af8('0x16')](0x190)['json'](_0x34b3e5);}var _0x3c4657=_0x318ca7[_0x0af8('0x28')][_0x0af8('0x29')];var _0x1aded0=_0x318ca7[_0x0af8('0x28')][_0x0af8('0x2a')];var _0x4dcdbc=_0x318ca7[_0x0af8('0x28')][_0x0af8('0x2b')];var _0x73d193=_0x318ca7[_0x0af8('0x28')][_0x0af8('0x2c')];return getAgent(_0x3c4657)[_0x0af8('0x1b')](function(_0x13991a){logger[_0x0af8('0x2d')](_0x0af8('0x2e'),_0x13991a[_0x0af8('0x18')]);emit(util[_0x0af8('0x2f')](_0x0af8('0x30'),_0x13991a['name']),_0x0af8('0x31'),{'callNumber':_0x1aded0,'callerId':_0x4dcdbc,'callbackUrl':_0x73d193});return _0x1d2d4f[_0x0af8('0x16')](0xc8)[_0x0af8('0x32')]({'error':![],'message':_0x0af8('0x33')});})[_0x0af8('0x1f')](handleError(_0x1d2d4f));};exports[_0x0af8('0x34')]=function(_0x114ef3,_0x5e971f){logger[_0x0af8('0x2d')](_0x0af8('0x35'),_0x114ef3[_0x0af8('0x28')]);var _0x4d7e1f=hangupValidation[_0x0af8('0xb')](_0x114ef3[_0x0af8('0x28')]);if(_0x4d7e1f[_0x0af8('0x25')]>0x0){return _0x5e971f['status'](0x190)[_0x0af8('0x32')](_0x4d7e1f);}var _0x122382=_0x114ef3[_0x0af8('0x28')][_0x0af8('0x29')];var _0x44c198=_0x114ef3[_0x0af8('0x28')][_0x0af8('0x36')];return getAgent(_0x122382)['then'](function(_0x586924){logger[_0x0af8('0x2d')](_0x0af8('0x2e'),_0x586924['name']);emit(util[_0x0af8('0x2f')](_0x0af8('0x30'),_0x586924['name']),_0x0af8('0x37'),{'sessionId':_0x44c198});return _0x5e971f['status'](0xc8)[_0x0af8('0x32')]({'error':![],'message':_0x0af8('0x38')});})['catch'](handleError(_0x5e971f));};exports[_0x0af8('0x39')]=function(_0x3fefbc,_0x497695){logger[_0x0af8('0x2d')]('answer\x20fired:',_0x3fefbc[_0x0af8('0x28')]);var _0x423eee=answerValidation[_0x0af8('0xb')](_0x3fefbc['body']);if(_0x423eee['length']>0x0){return _0x497695[_0x0af8('0x16')](0x190)[_0x0af8('0x32')](_0x423eee);}var _0x37e54e=_0x3fefbc[_0x0af8('0x28')]['userId'];var _0x1293d8=_0x3fefbc[_0x0af8('0x28')][_0x0af8('0x36')];return getAgent(_0x37e54e)['then'](function(_0x15aa0c){logger[_0x0af8('0x2d')]('entityFound:',_0x15aa0c[_0x0af8('0x18')]);emit(util['format'](_0x0af8('0x30'),_0x15aa0c['name']),'webbar:answer',{'sessionId':_0x1293d8});return _0x497695['status'](0xc8)[_0x0af8('0x32')]({'error':![],'message':'answer\x20executed!'});})[_0x0af8('0x1f')](handleError(_0x497695));};exports['hold']=function(_0x226292,_0x38515e){logger[_0x0af8('0x2d')](_0x0af8('0x3a'),_0x226292[_0x0af8('0x28')]);var _0x562f09=holdValidation['validate'](_0x226292[_0x0af8('0x28')]);if(_0x562f09[_0x0af8('0x25')]>0x0){return _0x38515e[_0x0af8('0x16')](0x190)[_0x0af8('0x32')](_0x562f09);}var _0x3d86e2=_0x226292[_0x0af8('0x28')][_0x0af8('0x29')];var _0x578e52=_0x226292['body'][_0x0af8('0x36')];return getAgent(_0x3d86e2)[_0x0af8('0x1b')](function(_0x394525){logger[_0x0af8('0x2d')]('entityFound:',_0x394525[_0x0af8('0x18')]);emit(util[_0x0af8('0x2f')](_0x0af8('0x30'),_0x394525[_0x0af8('0x18')]),_0x0af8('0x3b'),{'sessionId':_0x578e52});return _0x38515e[_0x0af8('0x16')](0xc8)['json']({'error':![],'message':_0x0af8('0x3c')});})['catch'](handleError(_0x38515e));};exports[_0x0af8('0x3d')]=function(_0x4a43e3,_0xeddce9){logger[_0x0af8('0x2d')](_0x0af8('0x3e'),_0x4a43e3['body']);var _0x1400eb=unholdValidation[_0x0af8('0xb')](_0x4a43e3['body']);if(_0x1400eb[_0x0af8('0x25')]>0x0){return _0xeddce9[_0x0af8('0x16')](0x190)[_0x0af8('0x32')](_0x1400eb);}var _0x2a3db=_0x4a43e3[_0x0af8('0x28')][_0x0af8('0x29')];var _0x26bdc7=_0x4a43e3['body'][_0x0af8('0x36')];return getAgent(_0x2a3db)[_0x0af8('0x1b')](function(_0x49bd57){logger['info'](_0x0af8('0x2e'),_0x49bd57[_0x0af8('0x18')]);emit(util['format'](_0x0af8('0x30'),_0x49bd57[_0x0af8('0x18')]),'webbar:unhold',{'sessionId':_0x26bdc7});return _0xeddce9[_0x0af8('0x16')](0xc8)['json']({'error':![],'message':'unhold\x20executed!'});})[_0x0af8('0x1f')](handleError(_0xeddce9));};exports[_0x0af8('0x3f')]=function(_0x553625,_0x1cbc96){logger[_0x0af8('0x2d')]('calls\x20fired:',_0x1cbc96[_0x0af8('0x28')]);var _0x47d16c=callsValidation[_0x0af8('0xb')](_0x553625[_0x0af8('0x28')]);if(_0x47d16c['length']>0x0){return _0x1cbc96['status'](0x190)[_0x0af8('0x32')](_0x47d16c);}var _0x18da9c=_0x553625[_0x0af8('0x28')][_0x0af8('0x29')];var _0x524f79=respondWithRpcPromise(_0x0af8('0x40'));var _0x3910fb=getAgent(_0x18da9c);return Promise[_0x0af8('0x21')]([_0x524f79,_0x3910fb])['then'](function(_0x292f6c){var _0xff0eed=_0x292f6c[0x0];var _0x48879c=_0x292f6c[0x1];var _0x521e35=_[_0x0af8('0x22')](_0xff0eed[_0x0af8('0x23')],function(_0x2c2b10){return _0x2c2b10['UserId']==_0x48879c['id'];});return _0x1cbc96[_0x0af8('0x16')](0xc8)[_0x0af8('0x32')]({'count':_0x521e35[_0x0af8('0x25')],'rows':_0x521e35});})[_0x0af8('0x1f')](handleError(_0x1cbc96));};exports[_0x0af8('0x41')]=function(_0x5c3ab9,_0x143cf){logger['info'](_0x0af8('0x42'),_0x5c3ab9['body']);var _0x2d434a=conferenceValidation[_0x0af8('0xb')](_0x5c3ab9[_0x0af8('0x28')]);if(_0x2d434a[_0x0af8('0x25')]>0x0){return _0x143cf[_0x0af8('0x16')](0x190)[_0x0af8('0x32')](_0x2d434a);}var _0x7c1b83=_0x5c3ab9[_0x0af8('0x28')][_0x0af8('0x29')];return getAgent(_0x7c1b83)['then'](function(_0x3ff94a){logger[_0x0af8('0x2d')](_0x0af8('0x2e'),_0x3ff94a['name']);emit(util['format'](_0x0af8('0x30'),_0x3ff94a[_0x0af8('0x18')]),_0x0af8('0x43'));return _0x143cf[_0x0af8('0x16')](0xc8)[_0x0af8('0x32')]({'error':![],'message':_0x0af8('0x44')});})['catch'](handleError(_0x143cf));};exports[_0x0af8('0x45')]=function(_0x5b1c3a,_0x1d496d){logger[_0x0af8('0x2d')]('transfer\x20fired:',_0x5b1c3a['body']);var _0x563d0d=transferValidation[_0x0af8('0xb')](_0x5b1c3a[_0x0af8('0x28')]);if(_0x563d0d[_0x0af8('0x25')]>0x0){return _0x1d496d[_0x0af8('0x16')](0x190)[_0x0af8('0x32')](_0x563d0d);}var _0x2ee73e=_0x5b1c3a['body'][_0x0af8('0x29')];var _0x4ba986=_0x5b1c3a[_0x0af8('0x28')]['sessionId'];var _0x27cd1c=_0x5b1c3a[_0x0af8('0x28')]['transferNumber'];return getAgent(_0x2ee73e)[_0x0af8('0x1b')](function(_0x1b06fa){logger[_0x0af8('0x2d')](_0x0af8('0x2e'),_0x1b06fa[_0x0af8('0x18')]);emit(util['format'](_0x0af8('0x30'),_0x1b06fa[_0x0af8('0x18')]),_0x0af8('0x46'),{'sessionId':_0x4ba986,'transferNumber':_0x27cd1c});return _0x1d496d[_0x0af8('0x16')](0xc8)['json']({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x1d496d));}; \ No newline at end of file +var _0xf2cb=['all','filter','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','info','originate\x20fired:','body','json','userId','callerId','callbackUrl','entityFound:','format','webbar:originate','originate\x20executed!','user:%s','webbar:hangup','hangup\x20executed!','answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','unhold','webbar:unhold','unhold\x20executed!','calls','rows','conference','conference\x20executed!','transferNumber','webbar:transfer','lodash','../../config/environment','bluebird','client','http','ioredis','redis','defaults','socket.io-emitter','validate','string','callNumber\x20is\x20required','number','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','stringify','log','handleError:','error','name','status','send','NotFound','then','message','result','catch','findOne','agent','VoiceChannels'];(function(_0x5895ff,_0x3e4a2a){var _0x132438=function(_0x40f153){while(--_0x40f153){_0x5895ff['push'](_0x5895ff['shift']());}};_0x132438(++_0x3e4a2a);}(_0xf2cb,0x130));var _0xbf2c=function(_0x5adc28,_0x32bf5b){_0x5adc28=_0x5adc28-0x0;var _0xf5b85e=_0xf2cb[_0x5adc28];return _0xf5b85e;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0xbf2c('0x0'));var db=require('../../mysqldb')['db'];var config=require(_0xbf2c('0x1'));var util=require('util');var BPromise=require(_0xbf2c('0x2'));var jayson=require('jayson/promise');var amiClient=jayson[_0xbf2c('0x3')][_0xbf2c('0x4')]({'port':0x232a});var logger=require('../../config/logger')('webbarapi');var Redis=require(_0xbf2c('0x5'));config[_0xbf2c('0x6')]=_[_0xbf2c('0x7')](config[_0xbf2c('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xbf2c('0x8'))(new Redis(config['redis']));var Schema=require(_0xbf2c('0x9'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xbf2c('0xa'),'required':[!![],_0xbf2c('0xb')]},'callerId':{'type':_0xbf2c('0xa')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xbf2c('0xc'),'required':[!![],_0xbf2c('0xd')]},'sessionId':{'type':_0xbf2c('0xa'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xbf2c('0xc'),'required':[!![],_0xbf2c('0xd')]},'sessionId':{'type':_0xbf2c('0xa'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xbf2c('0xc'),'required':[!![],_0xbf2c('0xd')]},'sessionId':{'type':'string','required':[!![],_0xbf2c('0xe')]},'transferNumber':{'type':_0xbf2c('0xa'),'required':[!![],_0xbf2c('0xf')]}});var holdValidation=new Schema({'userId':{'type':_0xbf2c('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xbf2c('0xa'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xbf2c('0xa'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xbf2c('0xc'),'required':[!![],_0xbf2c('0xd')]}});function emit(_0x2dc80e,_0x334900,_0x2af371){logger['info'](_0x2dc80e,_0x334900,JSON[_0xbf2c('0x10')](_0x2af371));io['to'](_0x2dc80e)['emit'](_0x334900,_0x2af371);}function handleError(_0x4ced7f){return function(_0x1df2ab){console[_0xbf2c('0x11')](_0xbf2c('0x12'),_0x1df2ab,_0x1df2ab instanceof RangeError);logger[_0xbf2c('0x13')](_0x1df2ab['stack']);if(_0x1df2ab instanceof RangeError){if(_0x1df2ab[_0xbf2c('0x14')]){delete _0x1df2ab[_0xbf2c('0x14')];}_0x4ced7f[_0xbf2c('0x15')](0x194)[_0xbf2c('0x16')](_0x1df2ab);}else{if(_0x1df2ab[_0xbf2c('0x14')]){delete _0x1df2ab[_0xbf2c('0x14')];}_0x4ced7f[_0xbf2c('0x15')](0x1f4)['send'](_0x1df2ab);}};}function checkError(){return function(_0x61248b){if(!_0x61248b){throw new RangeError(_0xbf2c('0x17'));}return _0x61248b;};}function respondWithRpcPromise(_0x96a759,_0xe6dad9){return new BPromise(function(_0x57873c,_0x2bc2ad){var _0x1f5515=amiClient;return _0x1f5515['request'](_0x96a759,_0xe6dad9)[_0xbf2c('0x18')](function(_0x356f26){if(_0x356f26[_0xbf2c('0x13')]){if(_0x356f26['error']['code']===0x1f4){return _0x2bc2ad(_0x356f26[_0xbf2c('0x13')][_0xbf2c('0x19')]);}return _0x57873c(_0x356f26[_0xbf2c('0x13')][_0xbf2c('0x19')]);}else{_0x57873c(_0x356f26[_0xbf2c('0x1a')]);}})[_0xbf2c('0x1b')](function(_0x11ffbe){_0x2bc2ad(_0x11ffbe);});});}function getAgent(_0x4df358){return db['User'][_0xbf2c('0x1c')]({'where':{'id':_0x4df358,'role':_0xbf2c('0x1d')}})[_0xbf2c('0x18')](checkError());}function getAgentCheckSession(_0x4314d6,_0x3ed68d){return new BPromise(function(_0x4a0257,_0x30ca){var _0x2976fa=respondWithRpcPromise(_0xbf2c('0x1e'));var _0x4f3191=getAgent(_0x4314d6);Promise[_0xbf2c('0x1f')]([_0x2976fa,_0x4f3191])['then'](function(_0x3a9130){var _0x3442fa=_0x3a9130[0x0];var _0x40e866=_0x3a9130[0x1];var _0x17238f=_[_0xbf2c('0x20')](_0x3442fa['rows'],function(_0x1e946c){return _0x1e946c[_0xbf2c('0x21')]==_0x40e866['id']&&_0x1e946c[_0xbf2c('0x22')]==_0x3ed68d;});if(_0x17238f[_0xbf2c('0x23')]==0x1){_0x4a0257(_0x40e866);}else{_0x30ca(new RangeError(_0xbf2c('0x24')+_0x3ed68d+_0xbf2c('0x25')));}});});}exports[_0xbf2c('0x26')]=function(_0x3462dd,_0x4d731d){logger[_0xbf2c('0x27')](_0xbf2c('0x28'),_0x3462dd[_0xbf2c('0x29')]);var _0x5b93aa=originateValidation['validate'](_0x3462dd[_0xbf2c('0x29')]);if(_0x5b93aa[_0xbf2c('0x23')]>0x0){return _0x4d731d[_0xbf2c('0x15')](0x190)[_0xbf2c('0x2a')](_0x5b93aa);}var _0x286634=_0x3462dd[_0xbf2c('0x29')][_0xbf2c('0x2b')];var _0x255cbc=_0x3462dd[_0xbf2c('0x29')]['callNumber'];var _0x218363=_0x3462dd[_0xbf2c('0x29')][_0xbf2c('0x2c')];var _0x3a0134=_0x3462dd[_0xbf2c('0x29')][_0xbf2c('0x2d')];return getAgent(_0x286634)[_0xbf2c('0x18')](function(_0x4722b3){logger['info'](_0xbf2c('0x2e'),_0x4722b3[_0xbf2c('0x14')]);emit(util[_0xbf2c('0x2f')]('user:%s',_0x4722b3[_0xbf2c('0x14')]),_0xbf2c('0x30'),{'callNumber':_0x255cbc,'callerId':_0x218363,'callbackUrl':_0x3a0134});return _0x4d731d[_0xbf2c('0x15')](0xc8)['json']({'error':![],'message':_0xbf2c('0x31')});})[_0xbf2c('0x1b')](handleError(_0x4d731d));};exports['hangup']=function(_0x5d683d,_0x47ab9a){logger['info']('hangup\x20fired:',_0x5d683d[_0xbf2c('0x29')]);var _0x13652a=hangupValidation[_0xbf2c('0x9')](_0x5d683d[_0xbf2c('0x29')]);if(_0x13652a[_0xbf2c('0x23')]>0x0){return _0x47ab9a[_0xbf2c('0x15')](0x190)[_0xbf2c('0x2a')](_0x13652a);}var _0x325581=_0x5d683d[_0xbf2c('0x29')][_0xbf2c('0x2b')];var _0x245eaf=_0x5d683d[_0xbf2c('0x29')][_0xbf2c('0x22')];return getAgent(_0x325581)[_0xbf2c('0x18')](function(_0x4776e0){logger[_0xbf2c('0x27')]('entityFound:',_0x4776e0[_0xbf2c('0x14')]);emit(util[_0xbf2c('0x2f')](_0xbf2c('0x32'),_0x4776e0[_0xbf2c('0x14')]),_0xbf2c('0x33'),{'sessionId':_0x245eaf});return _0x47ab9a[_0xbf2c('0x15')](0xc8)[_0xbf2c('0x2a')]({'error':![],'message':_0xbf2c('0x34')});})['catch'](handleError(_0x47ab9a));};exports[_0xbf2c('0x35')]=function(_0x2bccc2,_0x652066){logger[_0xbf2c('0x27')]('answer\x20fired:',_0x2bccc2[_0xbf2c('0x29')]);var _0x5067d2=answerValidation[_0xbf2c('0x9')](_0x2bccc2[_0xbf2c('0x29')]);if(_0x5067d2[_0xbf2c('0x23')]>0x0){return _0x652066[_0xbf2c('0x15')](0x190)[_0xbf2c('0x2a')](_0x5067d2);}var _0x14107c=_0x2bccc2['body'][_0xbf2c('0x2b')];var _0x55c3d7=_0x2bccc2['body'][_0xbf2c('0x22')];return getAgent(_0x14107c)['then'](function(_0x57ddb9){logger[_0xbf2c('0x27')](_0xbf2c('0x2e'),_0x57ddb9['name']);emit(util[_0xbf2c('0x2f')]('user:%s',_0x57ddb9[_0xbf2c('0x14')]),'webbar:answer',{'sessionId':_0x55c3d7});return _0x652066[_0xbf2c('0x15')](0xc8)[_0xbf2c('0x2a')]({'error':![],'message':_0xbf2c('0x36')});})[_0xbf2c('0x1b')](handleError(_0x652066));};exports[_0xbf2c('0x37')]=function(_0x4187cf,_0x54ce68){logger[_0xbf2c('0x27')](_0xbf2c('0x38'),_0x4187cf[_0xbf2c('0x29')]);var _0x1b50a6=holdValidation[_0xbf2c('0x9')](_0x4187cf['body']);if(_0x1b50a6['length']>0x0){return _0x54ce68[_0xbf2c('0x15')](0x190)['json'](_0x1b50a6);}var _0xa08482=_0x4187cf[_0xbf2c('0x29')][_0xbf2c('0x2b')];var _0x1750ec=_0x4187cf[_0xbf2c('0x29')][_0xbf2c('0x22')];return getAgent(_0xa08482)[_0xbf2c('0x18')](function(_0x1c3b78){logger[_0xbf2c('0x27')](_0xbf2c('0x2e'),_0x1c3b78[_0xbf2c('0x14')]);emit(util['format'](_0xbf2c('0x32'),_0x1c3b78[_0xbf2c('0x14')]),_0xbf2c('0x39'),{'sessionId':_0x1750ec});return _0x54ce68[_0xbf2c('0x15')](0xc8)['json']({'error':![],'message':'hold\x20executed!'});})['catch'](handleError(_0x54ce68));};exports[_0xbf2c('0x3a')]=function(_0x2451ba,_0x56c470){logger['info']('unhold\x20fired:',_0x2451ba[_0xbf2c('0x29')]);var _0x314f7b=unholdValidation[_0xbf2c('0x9')](_0x2451ba[_0xbf2c('0x29')]);if(_0x314f7b[_0xbf2c('0x23')]>0x0){return _0x56c470[_0xbf2c('0x15')](0x190)['json'](_0x314f7b);}var _0xfff73d=_0x2451ba[_0xbf2c('0x29')][_0xbf2c('0x2b')];var _0x3fa07e=_0x2451ba[_0xbf2c('0x29')][_0xbf2c('0x22')];return getAgent(_0xfff73d)[_0xbf2c('0x18')](function(_0x180aad){logger['info']('entityFound:',_0x180aad['name']);emit(util[_0xbf2c('0x2f')](_0xbf2c('0x32'),_0x180aad[_0xbf2c('0x14')]),_0xbf2c('0x3b'),{'sessionId':_0x3fa07e});return _0x56c470['status'](0xc8)[_0xbf2c('0x2a')]({'error':![],'message':_0xbf2c('0x3c')});})['catch'](handleError(_0x56c470));};exports[_0xbf2c('0x3d')]=function(_0xcbe3be,_0x20229f){logger['info']('calls\x20fired:',_0x20229f['body']);var _0x49cae6=callsValidation[_0xbf2c('0x9')](_0xcbe3be[_0xbf2c('0x29')]);if(_0x49cae6[_0xbf2c('0x23')]>0x0){return _0x20229f[_0xbf2c('0x15')](0x190)[_0xbf2c('0x2a')](_0x49cae6);}var _0x5c7321=_0xcbe3be[_0xbf2c('0x29')][_0xbf2c('0x2b')];var _0x58b66a=respondWithRpcPromise(_0xbf2c('0x1e'));var _0x3f0129=getAgent(_0x5c7321);return Promise['all']([_0x58b66a,_0x3f0129])['then'](function(_0x5062a3){var _0x363f77=_0x5062a3[0x0];var _0x5df133=_0x5062a3[0x1];var _0x5cf1df=_[_0xbf2c('0x20')](_0x363f77[_0xbf2c('0x3e')],function(_0x2b84c6){return _0x2b84c6[_0xbf2c('0x21')]==_0x5df133['id'];});return _0x20229f['status'](0xc8)['json']({'count':_0x5cf1df[_0xbf2c('0x23')],'rows':_0x5cf1df});})[_0xbf2c('0x1b')](handleError(_0x20229f));};exports[_0xbf2c('0x3f')]=function(_0x2960fc,_0x151341){logger['info']('conference\x20fired:',_0x2960fc[_0xbf2c('0x29')]);var _0x1a4bf7=conferenceValidation[_0xbf2c('0x9')](_0x2960fc[_0xbf2c('0x29')]);if(_0x1a4bf7[_0xbf2c('0x23')]>0x0){return _0x151341[_0xbf2c('0x15')](0x190)['json'](_0x1a4bf7);}var _0x5b37b1=_0x2960fc[_0xbf2c('0x29')][_0xbf2c('0x2b')];return getAgent(_0x5b37b1)[_0xbf2c('0x18')](function(_0x1b9f8d){logger[_0xbf2c('0x27')](_0xbf2c('0x2e'),_0x1b9f8d[_0xbf2c('0x14')]);emit(util[_0xbf2c('0x2f')](_0xbf2c('0x32'),_0x1b9f8d['name']),'webbar:conference');return _0x151341[_0xbf2c('0x15')](0xc8)[_0xbf2c('0x2a')]({'error':![],'message':_0xbf2c('0x40')});})[_0xbf2c('0x1b')](handleError(_0x151341));};exports['transfer']=function(_0x436c4d,_0x2a1816){logger[_0xbf2c('0x27')]('transfer\x20fired:',_0x436c4d[_0xbf2c('0x29')]);var _0x1aa7c3=transferValidation[_0xbf2c('0x9')](_0x436c4d[_0xbf2c('0x29')]);if(_0x1aa7c3['length']>0x0){return _0x2a1816[_0xbf2c('0x15')](0x190)[_0xbf2c('0x2a')](_0x1aa7c3);}var _0x425a46=_0x436c4d['body']['userId'];var _0x295790=_0x436c4d['body']['sessionId'];var _0x1e2d67=_0x436c4d[_0xbf2c('0x29')][_0xbf2c('0x41')];return getAgent(_0x425a46)[_0xbf2c('0x18')](function(_0x1d7bf8){logger['info']('entityFound:',_0x1d7bf8[_0xbf2c('0x14')]);emit(util[_0xbf2c('0x2f')]('user:%s',_0x1d7bf8[_0xbf2c('0x14')]),_0xbf2c('0x42'),{'sessionId':_0x295790,'transferNumber':_0x1e2d67});return _0x2a1816['status'](0xc8)[_0xbf2c('0x2a')]({'error':![],'message':'transfer\x20executed!'});})[_0xbf2c('0x1b')](handleError(_0x2a1816));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 17fe521..ce57376 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 _0x0598=['put','update','delete','destroy','/:id/canned_answers','removeAgents','multer','util','connect-timeout','fs-extra','../../components/auth/service','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','getAgents','/:id/applications','getApplications','post','addDisposition','/:id/users','addAgents','addApplications','/:id/notify'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0598,0x92));var _0x8059=function(_0x549124,_0x2edf4c){_0x549124=_0x549124-0x0;var _0x94949=_0x0598[_0x549124];return _0x94949;};'use strict';var multer=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var path=require('path');var timeout=require(_0x8059('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8059('0x3'));var auth=require(_0x8059('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappAccount.controller');router[_0x8059('0x5')]('/',auth[_0x8059('0x6')](),controller['index']);router['get'](_0x8059('0x7'),auth[_0x8059('0x6')](),controller[_0x8059('0x8')]);router[_0x8059('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x8059('0x9')]);router[_0x8059('0x5')](_0x8059('0xa'),auth[_0x8059('0x6')](),controller[_0x8059('0xb')]);router['get']('/:id/canned_answers',auth[_0x8059('0x6')](),controller[_0x8059('0xc')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x8059('0xd')]);router[_0x8059('0x5')](_0x8059('0xe'),auth[_0x8059('0x6')](),controller[_0x8059('0xf')]);router['post']('/',auth[_0x8059('0x6')](),controller['create']);router[_0x8059('0x10')]('/:id/dispositions',auth[_0x8059('0x6')](),controller[_0x8059('0x11')]);router[_0x8059('0x10')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);router[_0x8059('0x10')](_0x8059('0x12'),auth[_0x8059('0x6')](),controller[_0x8059('0x13')]);router[_0x8059('0x10')]('/:id/applications',auth[_0x8059('0x6')](),controller[_0x8059('0x14')]);router[_0x8059('0x10')](_0x8059('0x15'),controller['notify']);router[_0x8059('0x10')]('/:id/send',auth[_0x8059('0x6')](),controller['send']);router[_0x8059('0x16')]('/:id',auth[_0x8059('0x6')](),controller[_0x8059('0x17')]);router[_0x8059('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x8059('0x19')]);router[_0x8059('0x18')](_0x8059('0xa'),auth[_0x8059('0x6')](),controller['removeDispositions']);router[_0x8059('0x18')](_0x8059('0x1a'),auth[_0x8059('0x6')](),controller['removeAnswers']);router[_0x8059('0x18')](_0x8059('0x12'),auth[_0x8059('0x6')](),controller[_0x8059('0x1b')]);module['exports']=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(_0x506172,_0xbc3a3){var _0x2723c0=function(_0x57c3d9){while(--_0x57c3d9){_0x506172['push'](_0x506172['shift']());}};_0x2723c0(++_0xbc3a3);}(_0x93e9,0xcc));var _0x993e=function(_0x175196,_0x4bfaa0){_0x175196=_0x175196-0x0;var _0x3540db=_0x93e9[_0x175196];return _0x3540db;};'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 bae7b65..491b123 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 _0xcd50=['generate','ENUM','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','exports','STRING'];(function(_0xf1af27,_0x598bb1){var _0x46b274=function(_0x1dba43){while(--_0x1dba43){_0xf1af27['push'](_0xf1af27['shift']());}};_0x46b274(++_0x598bb1);}(_0xcd50,0x19e));var _0x0cd5=function(_0x51c3dc,_0x50f79e){_0x51c3dc=_0x51c3dc-0x0;var _0x4751ed=_0xcd50[_0x51c3dc];return _0x4751ed;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x0cd5('0x0')]={'name':{'type':Sequelize[_0x0cd5('0x1')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x0cd5('0x1')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x0cd5('0x1')],'defaultValue':function(){return rs[_0x0cd5('0x2')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0cd5('0x3')]('twilio',_0x0cd5('0x4'))},'accountSid':{'type':Sequelize[_0x0cd5('0x1')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x0cd5('0x1')]},'notificationTemplate':{'type':Sequelize[_0x0cd5('0x5')],'defaultValue':function(){return _0x0cd5('0x6');}},'notificationSound':{'type':Sequelize[_0x0cd5('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x0cd5('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0cd5('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0cd5('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0cd5('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0cd5('0x8')],'comment':_0x0cd5('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x0cd5('0x7')],'defaultValue':![],'comment':_0x0cd5('0xa'),'set':function(_0x2c3f37){if(!_0x2c3f37){this[_0x0cd5('0xb')]('mandatoryDispositionPauseId',null);}this[_0x0cd5('0xb')](_0x0cd5('0xc'),_0x2c3f37);}},'description':{'type':Sequelize[_0x0cd5('0x1')]}}; \ No newline at end of file +var _0x50ba=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','randomstring','exports','STRING','name','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x117842,_0x1b5654){var _0x41c64a=function(_0x50a526){while(--_0x50a526){_0x117842['push'](_0x117842['shift']());}};_0x41c64a(++_0x1b5654);}(_0x50ba,0x1cc));var _0xa50b=function(_0x1663ae,_0x10484a){_0x1663ae=_0x1663ae-0x0;var _0x30ffb8=_0x50ba[_0x1663ae];return _0x30ffb8;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xa50b('0x0'));module[_0xa50b('0x1')]={'name':{'type':Sequelize[_0xa50b('0x2')],'unique':_0xa50b('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xa50b('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xa50b('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xa50b('0x4'),_0xa50b('0x5'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xa50b('0x2')]},'notificationTemplate':{'type':Sequelize[_0xa50b('0x6')],'defaultValue':function(){return _0xa50b('0x7');}},'notificationSound':{'type':Sequelize[_0xa50b('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xa50b('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa50b('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa50b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa50b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa50b('0x9')],'comment':_0xa50b('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4d67da){if(!_0x4d67da){this[_0xa50b('0xb')]('mandatoryDispositionPauseId',null);}this[_0xa50b('0xb')]('mandatoryDisposition',_0x4d67da);}},'description':{'type':Sequelize[_0xa50b('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 4d0eba2..8e583f4 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 _0x20a6=['zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./whatsappAccount.socket','register','jayson/promise','request','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','WhatsappAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','then','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','type','key','model','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','show','keys','rawAttributes','intersection','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','WhatsappAccountId','Disposition','findOne','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addAgents','omit','emit','removeAgents','userWhatsappAccount:remove','User','getAgents','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','findAndCountAll','finally','send','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','twilio','From','replace','whatsapp:','messageId','MessageSid','from','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','contact','WhatsappInteraction','spread','interaction','created','autoclose','push','close','*,*,*,*','AttachmentId','UserId','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','stringify','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','CmList','List','Messages','dataValues','rimraf'];(function(_0x5ed9a6,_0x2ff6d4){var _0x15b6c2=function(_0x582719){while(--_0x582719){_0x5ed9a6['push'](_0x5ed9a6['shift']());}};_0x15b6c2(++_0x2ff6d4);}(_0x20a6,0xc2));var _0x620a=function(_0x3070a4,_0x296ff7){_0x3070a4=_0x3070a4-0x0;var _0x3c1103=_0x20a6[_0x3070a4];return _0x3c1103;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x620a('0x0'));var zipdir=require(_0x620a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x620a('0x2'));var moment=require('moment');var BPromise=require(_0x620a('0x3'));var Mustache=require(_0x620a('0x4'));var util=require(_0x620a('0x5'));var path=require(_0x620a('0x6'));var sox=require(_0x620a('0x7'));var csv=require(_0x620a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x620a('0x9'));var _=require(_0x620a('0xa'));var squel=require(_0x620a('0xb'));var crypto=require(_0x620a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x620a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x620a('0xe'));var Papa=require(_0x620a('0xf'));var Redis=require(_0x620a('0x10'));var authService=require(_0x620a('0x11'));var qs=require(_0x620a('0x12'));var as=require(_0x620a('0x13'));var hardwareService=require(_0x620a('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x620a('0x15'));var config=require(_0x620a('0x16'));var licenseUtil=require(_0x620a('0x17'));var db=require(_0x620a('0x18'))['db'];config['redis']=_[_0x620a('0x19')](config[_0x620a('0x1a')],{'host':_0x620a('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x620a('0x1c'))[_0x620a('0x1d')](socket);var jayson=require(_0x620a('0x1e'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x2615d5,_0x5efb5c,_0x332d17,_0x509495){return new BPromise(function(_0x4fc58c,_0x3e8a7a){var _0x415544=_0x509495||client;return _0x415544[_0x620a('0x1f')](_0x2615d5,_0x332d17)['then'](function(_0x2e22e6){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x5efb5c,_0x620a('0x20'));logger[_0x620a('0x21')](_0x620a('0x22'),_0x5efb5c,_0x620a('0x20'),JSON['stringify'](_0x2e22e6));if(_0x2e22e6[_0x620a('0x23')]){if(_0x2e22e6[_0x620a('0x23')][_0x620a('0x24')]===0x1f4){logger['error'](_0x620a('0x25'),_0x5efb5c,_0x2e22e6[_0x620a('0x23')][_0x620a('0x26')]);return _0x3e8a7a(_0x2e22e6[_0x620a('0x23')][_0x620a('0x26')]);}logger[_0x620a('0x23')](_0x620a('0x25'),_0x5efb5c,_0x2e22e6[_0x620a('0x23')][_0x620a('0x26')]);return _0x4fc58c(_0x2e22e6[_0x620a('0x23')][_0x620a('0x26')]);}else{logger[_0x620a('0x27')](_0x620a('0x25'),_0x5efb5c,'request\x20sent');_0x4fc58c(_0x2e22e6[_0x620a('0x28')][_0x620a('0x26')]);}})[_0x620a('0x29')](function(_0x230d0b){logger['error'](_0x620a('0x25'),_0x5efb5c,_0x230d0b);_0x3e8a7a(_0x230d0b);});});}function respondWithStatusCode(_0x47a5f5,_0x44db38){_0x44db38=_0x44db38||0xcc;return function(_0x5e927a){if(_0x5e927a){return _0x47a5f5[_0x620a('0x2a')](_0x44db38);}return _0x47a5f5[_0x620a('0x2b')](_0x44db38)[_0x620a('0x2c')]();};}function respondWithResult(_0x235e02,_0x19f2b4){_0x19f2b4=_0x19f2b4||0xc8;return function(_0x2907bd){if(_0x2907bd){return _0x235e02['status'](_0x19f2b4)[_0x620a('0x2d')](_0x2907bd);}};}function respondWithFilteredResult(_0x369511,_0x3adabd){return function(_0x21be79){if(_0x21be79){var _0x3d4e37=typeof _0x3adabd[_0x620a('0x2e')]===_0x620a('0x2f')&&typeof _0x3adabd['limit']===_0x620a('0x2f');var _0x416f04=_0x21be79['count'];var _0x16d994=_0x3d4e37?0x0:_0x3adabd[_0x620a('0x2e')];var _0x4f8d1a=_0x3d4e37?_0x21be79[_0x620a('0x30')]:_0x3adabd[_0x620a('0x2e')]+_0x3adabd['limit'];var _0x392094;if(_0x4f8d1a>=_0x416f04){_0x4f8d1a=_0x416f04;_0x392094=0xc8;}else{_0x392094=0xce;}_0x369511[_0x620a('0x2b')](_0x392094);return _0x369511[_0x620a('0x31')](_0x620a('0x32'),_0x16d994+'-'+_0x4f8d1a+'/'+_0x416f04)[_0x620a('0x2d')](_0x21be79);}return null;};}function patchUpdates(_0x23a539){return function(_0x2b4564){try{jsonpatch['apply'](_0x2b4564,_0x23a539,!![]);}catch(_0x4dde5c){return BPromise[_0x620a('0x33')](_0x4dde5c);}return _0x2b4564[_0x620a('0x34')]();};}function saveUpdates(_0x181aa0,_0x3a7557){return function(_0x50ed03){if(_0x50ed03){return _0x50ed03['update'](_0x181aa0)[_0x620a('0x35')](function(_0xf17967){return _0xf17967;});}return null;};}function removeEntity(_0x45840e,_0x27508e){return function(_0x39314c){if(_0x39314c){return _0x39314c[_0x620a('0x36')]()[_0x620a('0x35')](function(){var _0x272a09=_0x39314c[_0x620a('0x37')]({'plain':!![]});var _0x220f8f=_0x620a('0x38');return db[_0x620a('0x39')][_0x620a('0x36')]({'where':{'type':_0x220f8f,'resourceId':_0x272a09['id']}})[_0x620a('0x35')](function(){return _0x39314c;});})[_0x620a('0x35')](function(){_0x45840e[_0x620a('0x2b')](0xcc)[_0x620a('0x2c')]();});}};}function handleEntityNotFound(_0x2364fe,_0x57fc0c){return function(_0x1077d2){if(!_0x1077d2){_0x2364fe['sendStatus'](0x194);}return _0x1077d2;};}function handleError(_0x57a1bb,_0x407bec){_0x407bec=_0x407bec||0x1f4;return function(_0x81e4a4){logger['error'](_0x81e4a4[_0x620a('0x3a')]);if(_0x81e4a4[_0x620a('0x3b')]){delete _0x81e4a4[_0x620a('0x3b')];}_0x57a1bb['status'](_0x407bec)['send'](_0x81e4a4);};}exports[_0x620a('0x3c')]=function(_0x3fd5ef,_0x4bff1e){var _0x43ee31={'include':[{'model':db[_0x620a('0x3d')],'as':_0x620a('0x3e')}]},_0xb45e18={},_0x5df5d7={'count':0x0,'rows':[]};var _0x18b981=_[_0x620a('0x3f')](db[_0x620a('0x40')]['rawAttributes'],function(_0x394b92){return{'name':_0x394b92['fieldName'],'type':_0x394b92[_0x620a('0x41')][_0x620a('0x42')]};});_0xb45e18[_0x620a('0x43')]=_['map'](_0x18b981,_0x620a('0x3b'));_0xb45e18['query']=_['keys'](_0x3fd5ef[_0x620a('0x44')]);_0xb45e18['filters']=_['intersection'](_0xb45e18['model'],_0xb45e18[_0x620a('0x44')]);_0x43ee31[_0x620a('0x45')]=_['intersection'](_0xb45e18['model'],qs[_0x620a('0x46')](_0x3fd5ef['query'][_0x620a('0x46')]));_0x43ee31[_0x620a('0x45')]=_0x43ee31[_0x620a('0x45')][_0x620a('0x47')]?_0x43ee31[_0x620a('0x45')]:_0xb45e18['model'];if(!_0x3fd5ef['query'][_0x620a('0x48')](_0x620a('0x49'))){_0x43ee31[_0x620a('0x4a')]=qs[_0x620a('0x4a')](_0x3fd5ef[_0x620a('0x44')][_0x620a('0x4a')]);_0x43ee31[_0x620a('0x2e')]=qs[_0x620a('0x2e')](_0x3fd5ef[_0x620a('0x44')][_0x620a('0x2e')]);}_0x43ee31[_0x620a('0x4b')]=qs[_0x620a('0x4c')](_0x3fd5ef[_0x620a('0x44')][_0x620a('0x4c')]);_0x43ee31[_0x620a('0x4d')]=qs[_0x620a('0x4e')](_[_0x620a('0x4f')](_0x3fd5ef[_0x620a('0x44')],_0xb45e18[_0x620a('0x4e')]),_0x18b981);if(_0x3fd5ef['query'][_0x620a('0x50')]){_0x43ee31[_0x620a('0x4d')]=_['merge'](_0x43ee31['where'],{'$or':_[_0x620a('0x3f')](_0x18b981,function(_0x1d1809){if(_0x1d1809['type']!=='VIRTUAL'){var _0x14eca8={};_0x14eca8[_0x1d1809['name']]={'$like':'%'+_0x3fd5ef['query'][_0x620a('0x50')]+'%'};return _0x14eca8;}})});}_0x43ee31=_[_0x620a('0x51')]({},_0x43ee31,_0x3fd5ef['options']);var _0x37debb={'where':_0x43ee31[_0x620a('0x4d')]};return db[_0x620a('0x40')][_0x620a('0x30')](_0x37debb)[_0x620a('0x35')](function(_0x58f816){_0x5df5d7['count']=_0x58f816;if(_0x3fd5ef[_0x620a('0x44')][_0x620a('0x52')]){_0x43ee31[_0x620a('0x53')]=[{'all':!![]}];}return db['WhatsappAccount'][_0x620a('0x54')](_0x43ee31);})['then'](function(_0x4632d5){_0x5df5d7[_0x620a('0x55')]=_0x4632d5;return _0x5df5d7;})['then'](respondWithFilteredResult(_0x4bff1e,_0x43ee31))[_0x620a('0x29')](handleError(_0x4bff1e,null));};exports[_0x620a('0x56')]=function(_0x52fbf0,_0x360cd2){var _0x225c91={'raw':![],'where':{'id':_0x52fbf0['params']['id']},'include':[{'model':db['Pause'],'as':_0x620a('0x3e')}]},_0x52833d={};_0x52833d[_0x620a('0x43')]=_[_0x620a('0x57')](db[_0x620a('0x40')][_0x620a('0x58')]);_0x52833d[_0x620a('0x44')]=_['keys'](_0x52fbf0[_0x620a('0x44')]);_0x52833d[_0x620a('0x4e')]=_['intersection'](_0x52833d[_0x620a('0x43')],_0x52833d[_0x620a('0x44')]);_0x225c91['attributes']=_[_0x620a('0x59')](_0x52833d[_0x620a('0x43')],qs[_0x620a('0x46')](_0x52fbf0[_0x620a('0x44')][_0x620a('0x46')]));_0x225c91[_0x620a('0x45')]=_0x225c91['attributes'][_0x620a('0x47')]?_0x225c91['attributes']:_0x52833d[_0x620a('0x43')];if(_0x52fbf0[_0x620a('0x44')][_0x620a('0x52')]){_0x225c91[_0x620a('0x53')]=[{'all':!![]}];}_0x225c91=_[_0x620a('0x51')]({},_0x225c91,_0x52fbf0[_0x620a('0x5a')]);return db[_0x620a('0x40')][_0x620a('0x5b')](_0x225c91)[_0x620a('0x35')](handleEntityNotFound(_0x360cd2,null))[_0x620a('0x35')](respondWithResult(_0x360cd2,null))[_0x620a('0x29')](handleError(_0x360cd2,null));};exports[_0x620a('0x5c')]=function(_0x241b96,_0x4bcac0){return db[_0x620a('0x40')]['create'](_0x241b96[_0x620a('0x5d')],{})[_0x620a('0x35')](function(_0x2b7de5){var _0x4fae30=_0x241b96[_0x620a('0x5e')]['get']({'plain':!![]});if(!_0x4fae30)throw new Error(_0x620a('0x5f'));if(_0x4fae30[_0x620a('0x60')]===_0x620a('0x5e')){var _0x4ba390=_0x2b7de5['get']({'plain':!![]});var _0x44ad2f=_0x620a('0x38');return db[_0x620a('0x61')][_0x620a('0x5b')]({'where':{'name':_0x44ad2f,'userProfileId':_0x4fae30[_0x620a('0x62')]},'raw':!![]})['then'](function(_0x3c0e9b){if(_0x3c0e9b&&_0x3c0e9b[_0x620a('0x63')]===0x0){return db[_0x620a('0x39')][_0x620a('0x5c')]({'name':_0x4ba390[_0x620a('0x3b')],'resourceId':_0x4ba390['id'],'type':_0x3c0e9b[_0x620a('0x3b')],'sectionId':_0x3c0e9b['id']},{})[_0x620a('0x35')](function(){return _0x2b7de5;});}else{return _0x2b7de5;}})['catch'](function(_0x3abbd4){logger['error'](_0x620a('0x64'),_0x3abbd4);throw _0x3abbd4;});}return _0x2b7de5;})['then'](respondWithResult(_0x4bcac0,0xc9))['catch'](handleError(_0x4bcac0,null));};exports['update']=function(_0x3e7060,_0xff446){if(_0x3e7060['body']['id']){delete _0x3e7060[_0x620a('0x5d')]['id'];}return db[_0x620a('0x40')]['find']({'where':{'id':_0x3e7060[_0x620a('0x65')]['id']},'include':[{'model':db[_0x620a('0x3d')],'as':_0x620a('0x3e')}]})['then'](handleEntityNotFound(_0xff446,null))['then'](saveUpdates(_0x3e7060[_0x620a('0x5d')],null))[_0x620a('0x35')](respondWithResult(_0xff446,null))[_0x620a('0x29')](handleError(_0xff446,null));};exports[_0x620a('0x36')]=function(_0x30cbec,_0x1bb9a3){return db['WhatsappAccount'][_0x620a('0x5b')]({'where':{'id':_0x30cbec[_0x620a('0x65')]['id']}})['then'](handleEntityNotFound(_0x1bb9a3,null))[_0x620a('0x35')](removeEntity(_0x1bb9a3,null))[_0x620a('0x29')](handleError(_0x1bb9a3,null));};exports[_0x620a('0x66')]=function(_0x48fb5d,_0x2eba2d){return db[_0x620a('0x40')][_0x620a('0x66')]()[_0x620a('0x35')](respondWithResult(_0x2eba2d,null))[_0x620a('0x29')](handleError(_0x2eba2d,null));};exports[_0x620a('0x67')]=function(_0x114290,_0x58f2dc,_0x2fa34f){if(_0x114290[_0x620a('0x5d')]['id']){delete _0x114290[_0x620a('0x5d')]['id'];}return db[_0x620a('0x40')][_0x620a('0x5b')]({'where':{'id':_0x114290[_0x620a('0x65')]['id']}})[_0x620a('0x35')](handleEntityNotFound(_0x58f2dc,null))[_0x620a('0x35')](function(_0x49cbce){if(_0x49cbce){_0x114290[_0x620a('0x5d')][_0x620a('0x68')]=_0x49cbce['id'];return db[_0x620a('0x69')][_0x620a('0x5c')](_0x114290[_0x620a('0x5d')]);}})[_0x620a('0x35')](respondWithResult(_0x58f2dc,null))[_0x620a('0x29')](handleError(_0x58f2dc,null));};exports['getDispositions']=function(_0x1d92a9,_0x239b8d,_0x472f33){var _0xe028e0={'raw':![],'where':{}};var _0x1ef49a={};var _0x399898={'count':0x0,'rows':[]};return db[_0x620a('0x40')][_0x620a('0x6a')]({'where':{'id':_0x1d92a9[_0x620a('0x65')]['id']}})[_0x620a('0x35')](handleEntityNotFound(_0x239b8d,null))[_0x620a('0x35')](function(_0x377356){if(_0x377356){_0x1ef49a[_0x620a('0x43')]=_[_0x620a('0x57')](db['Disposition'][_0x620a('0x58')]);_0x1ef49a[_0x620a('0x44')]=_[_0x620a('0x57')](_0x1d92a9['query']);_0x1ef49a['filters']=_['intersection'](_0x1ef49a[_0x620a('0x43')],_0x1ef49a[_0x620a('0x44')]);_0xe028e0[_0x620a('0x45')]=_['intersection'](_0x1ef49a[_0x620a('0x43')],qs[_0x620a('0x46')](_0x1d92a9[_0x620a('0x44')]['fields']));_0xe028e0['attributes']=_0xe028e0[_0x620a('0x45')][_0x620a('0x47')]?_0xe028e0['attributes']:_0x1ef49a[_0x620a('0x43')];if(!_0x1d92a9[_0x620a('0x44')][_0x620a('0x48')]('nolimit')){_0xe028e0[_0x620a('0x4a')]=qs[_0x620a('0x4a')](_0x1d92a9[_0x620a('0x44')][_0x620a('0x4a')]);_0xe028e0[_0x620a('0x2e')]=qs[_0x620a('0x2e')](_0x1d92a9[_0x620a('0x44')][_0x620a('0x2e')]);}_0xe028e0['order']=qs['sort'](_0x1d92a9[_0x620a('0x44')][_0x620a('0x4c')]);_0xe028e0[_0x620a('0x4d')]=qs[_0x620a('0x4e')](_[_0x620a('0x4f')](_0x1d92a9['query'],_0x1ef49a['filters']));_0xe028e0[_0x620a('0x4d')]['WhatsappAccountId']=_0x377356['id'];if(_0x1d92a9['query']['filter']){_0xe028e0['where']=_['merge'](_0xe028e0[_0x620a('0x4d')],{'$or':_['map'](_0xe028e0[_0x620a('0x45')],function(_0x3f2822){var _0x59f164={};_0x59f164[_0x3f2822]={'$like':'%'+_0x1d92a9[_0x620a('0x44')][_0x620a('0x50')]+'%'};return _0x59f164;})});}_0xe028e0=_['merge']({},_0xe028e0,_0x1d92a9[_0x620a('0x5a')]);return db[_0x620a('0x69')][_0x620a('0x30')]({'where':_0xe028e0[_0x620a('0x4d')]})[_0x620a('0x35')](function(_0x59367a){_0x399898[_0x620a('0x30')]=_0x59367a;if(_0x1d92a9['query'][_0x620a('0x52')]){_0xe028e0[_0x620a('0x53')]=[{'all':!![]}];}return db[_0x620a('0x69')][_0x620a('0x54')](_0xe028e0);})[_0x620a('0x35')](function(_0x5167d5){_0x399898[_0x620a('0x55')]=_0x5167d5;return _0x399898;});}})['then'](respondWithFilteredResult(_0x239b8d,_0xe028e0))['catch'](handleError(_0x239b8d,null));};exports[_0x620a('0x6b')]=function(_0xc91269,_0x3dcbaa,_0x1cc61d){return db[_0x620a('0x40')][_0x620a('0x5b')]({'where':{'id':_0xc91269[_0x620a('0x65')]['id']}})[_0x620a('0x35')](handleEntityNotFound(_0x3dcbaa,null))['then'](function(_0x593cda){if(_0x593cda){return _0x593cda[_0x620a('0x6b')](_0xc91269[_0x620a('0x44')][_0x620a('0x6c')]);}})[_0x620a('0x35')](respondWithStatusCode(_0x3dcbaa,null))[_0x620a('0x29')](handleError(_0x3dcbaa,null));};exports[_0x620a('0x6d')]=function(_0x3a687c,_0x5df031,_0x2a9dc7){if(_0x3a687c['body']['id']){delete _0x3a687c['body']['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x3a687c[_0x620a('0x65')]['id']}})[_0x620a('0x35')](handleEntityNotFound(_0x5df031,null))['then'](function(_0x296231){if(_0x296231){_0x3a687c[_0x620a('0x5d')]['WhatsappAccountId']=_0x296231['id'];return db['CannedAnswer'][_0x620a('0x5c')](_0x3a687c[_0x620a('0x5d')]);}})[_0x620a('0x35')](respondWithResult(_0x5df031,null))[_0x620a('0x29')](handleError(_0x5df031,null));};exports[_0x620a('0x6e')]=function(_0x42ec23,_0x258d31,_0xe3b970){var _0x43c6f9={'raw':![],'where':{}};var _0x2b52fa={};var _0x94bef2={'count':0x0,'rows':[]};return db[_0x620a('0x40')]['findOne']({'where':{'id':_0x42ec23[_0x620a('0x65')]['id']}})[_0x620a('0x35')](handleEntityNotFound(_0x258d31,null))['then'](function(_0x12086b){if(_0x12086b){_0x2b52fa[_0x620a('0x43')]=_[_0x620a('0x57')](db[_0x620a('0x6f')][_0x620a('0x58')]);_0x2b52fa[_0x620a('0x44')]=_[_0x620a('0x57')](_0x42ec23[_0x620a('0x44')]);_0x2b52fa['filters']=_['intersection'](_0x2b52fa[_0x620a('0x43')],_0x2b52fa[_0x620a('0x44')]);_0x43c6f9['attributes']=_['intersection'](_0x2b52fa[_0x620a('0x43')],qs[_0x620a('0x46')](_0x42ec23[_0x620a('0x44')]['fields']));_0x43c6f9[_0x620a('0x45')]=_0x43c6f9[_0x620a('0x45')][_0x620a('0x47')]?_0x43c6f9['attributes']:_0x2b52fa[_0x620a('0x43')];if(!_0x42ec23['query']['hasOwnProperty'](_0x620a('0x49'))){_0x43c6f9[_0x620a('0x4a')]=qs[_0x620a('0x4a')](_0x42ec23['query'][_0x620a('0x4a')]);_0x43c6f9['offset']=qs[_0x620a('0x2e')](_0x42ec23[_0x620a('0x44')][_0x620a('0x2e')]);}_0x43c6f9[_0x620a('0x4b')]=qs[_0x620a('0x4c')](_0x42ec23['query']['sort']);_0x43c6f9[_0x620a('0x4d')]=qs[_0x620a('0x4e')](_[_0x620a('0x4f')](_0x42ec23[_0x620a('0x44')],_0x2b52fa['filters']));_0x43c6f9[_0x620a('0x4d')][_0x620a('0x68')]=_0x12086b['id'];if(_0x42ec23[_0x620a('0x44')][_0x620a('0x50')]){_0x43c6f9['where']=_[_0x620a('0x51')](_0x43c6f9[_0x620a('0x4d')],{'$or':_[_0x620a('0x3f')](_0x43c6f9['attributes'],function(_0x183de0){var _0x37368a={};_0x37368a[_0x183de0]={'$like':'%'+_0x42ec23[_0x620a('0x44')]['filter']+'%'};return _0x37368a;})});}_0x43c6f9=_['merge']({},_0x43c6f9,_0x42ec23[_0x620a('0x5a')]);return db[_0x620a('0x6f')][_0x620a('0x30')]({'where':_0x43c6f9[_0x620a('0x4d')]})[_0x620a('0x35')](function(_0x2e441c){_0x94bef2['count']=_0x2e441c;if(_0x42ec23['query'][_0x620a('0x52')]){_0x43c6f9[_0x620a('0x53')]=[{'all':!![]}];}return db['CannedAnswer'][_0x620a('0x54')](_0x43c6f9);})[_0x620a('0x35')](function(_0x2f2014){_0x94bef2['rows']=_0x2f2014;return _0x94bef2;});}})['then'](respondWithFilteredResult(_0x258d31,_0x43c6f9))[_0x620a('0x29')](handleError(_0x258d31,null));};exports[_0x620a('0x70')]=function(_0x33a45c,_0x350843,_0x4875f0){return db[_0x620a('0x40')][_0x620a('0x5b')]({'where':{'id':_0x33a45c[_0x620a('0x65')]['id']}})[_0x620a('0x35')](handleEntityNotFound(_0x350843,null))[_0x620a('0x35')](function(_0x1dddbc){if(_0x1dddbc){return _0x1dddbc['removeAnswers'](_0x33a45c[_0x620a('0x44')][_0x620a('0x6c')]);}})[_0x620a('0x35')](respondWithStatusCode(_0x350843,null))['catch'](handleError(_0x350843,null));};exports[_0x620a('0x71')]=function(_0x27e4fa,_0x220aaf,_0x2a8b3a){return db[_0x620a('0x40')][_0x620a('0x5b')]({'where':{'id':_0x27e4fa[_0x620a('0x65')]['id']}})[_0x620a('0x35')](handleEntityNotFound(_0x220aaf,null))[_0x620a('0x35')](function(_0x31e88f){if(_0x31e88f){return _0x31e88f[_0x620a('0x71')](_0x27e4fa[_0x620a('0x5d')][_0x620a('0x6c')],_[_0x620a('0x72')](_0x27e4fa['body'],[_0x620a('0x6c'),'id'])||{})['spread'](function(_0x4fff9a){for(var _0x4e7c14=0x0;_0x4e7c14<_0x27e4fa[_0x620a('0x5d')]['ids'][_0x620a('0x47')];_0x4e7c14+=0x1){socket[_0x620a('0x73')]('userWhatsappAccount:save',{'UserId':Number(_0x27e4fa[_0x620a('0x5d')][_0x620a('0x6c')][_0x4e7c14]),'WhatsappAccountId':Number(_0x27e4fa[_0x620a('0x65')]['id'])});}return _0x4fff9a;});}})[_0x620a('0x35')](respondWithResult(_0x220aaf,null))[_0x620a('0x29')](handleError(_0x220aaf,null));};exports[_0x620a('0x74')]=function(_0x454693,_0x35ca48,_0x3ec31e){return db[_0x620a('0x40')]['find']({'where':{'id':_0x454693['params']['id']}})[_0x620a('0x35')](handleEntityNotFound(_0x35ca48,null))[_0x620a('0x35')](function(_0x29e87e){if(_0x29e87e){return _0x29e87e[_0x620a('0x74')](_0x454693['query']['ids'])[_0x620a('0x35')](function(){if(_['isArray'](_0x454693['query'][_0x620a('0x6c')])){for(var _0x5e429d=0x0;_0x5e429d<_0x454693[_0x620a('0x44')][_0x620a('0x6c')][_0x620a('0x47')];_0x5e429d+=0x1){socket[_0x620a('0x73')](_0x620a('0x75'),{'UserId':Number(_0x454693[_0x620a('0x44')][_0x620a('0x6c')][_0x5e429d]),'WhatsappAccountId':Number(_0x454693[_0x620a('0x65')]['id'])});}}else{socket[_0x620a('0x73')](_0x620a('0x75'),{'UserId':Number(_0x454693[_0x620a('0x44')][_0x620a('0x6c')]),'WhatsappAccountId':Number(_0x454693['params']['id'])});}});}})[_0x620a('0x35')](respondWithStatusCode(_0x35ca48,null))[_0x620a('0x29')](handleError(_0x35ca48,null));};exports['getAgents']=function(_0x990537,_0x36f2a2,_0x1a3375){var _0x46ca19={};var _0x337597={};var _0x1bceb3;var _0x5569b4;return db[_0x620a('0x40')][_0x620a('0x6a')]({'where':{'id':_0x990537[_0x620a('0x65')]['id']}})[_0x620a('0x35')](handleEntityNotFound(_0x36f2a2,null))[_0x620a('0x35')](function(_0x569eb9){if(_0x569eb9){_0x1bceb3=_0x569eb9;_0x337597['model']=_[_0x620a('0x57')](db[_0x620a('0x76')][_0x620a('0x58')]);_0x337597[_0x620a('0x44')]=_[_0x620a('0x57')](_0x990537[_0x620a('0x44')]);_0x337597[_0x620a('0x4e')]=_[_0x620a('0x59')](_0x337597[_0x620a('0x43')],_0x337597[_0x620a('0x44')]);_0x46ca19[_0x620a('0x45')]=_[_0x620a('0x59')](_0x337597[_0x620a('0x43')],qs[_0x620a('0x46')](_0x990537[_0x620a('0x44')][_0x620a('0x46')]));_0x46ca19['attributes']=_0x46ca19[_0x620a('0x45')][_0x620a('0x47')]?_0x46ca19[_0x620a('0x45')]:_0x337597['model'];_0x46ca19[_0x620a('0x4b')]=qs[_0x620a('0x4c')](_0x990537[_0x620a('0x44')][_0x620a('0x4c')]);_0x46ca19[_0x620a('0x4d')]=qs[_0x620a('0x4e')](_['pick'](_0x990537['query'],_0x337597[_0x620a('0x4e')]));if(_0x990537['query'][_0x620a('0x50')]){_0x46ca19[_0x620a('0x4d')]=_[_0x620a('0x51')](_0x46ca19[_0x620a('0x4d')],{'$or':_[_0x620a('0x3f')](_0x46ca19['attributes'],function(_0x55f1ec){var _0x3001af={};_0x3001af[_0x55f1ec]={'$like':'%'+_0x990537[_0x620a('0x44')][_0x620a('0x50')]+'%'};return _0x3001af;})});}_0x46ca19=_['merge']({},_0x46ca19,_0x990537['options']);return _0x1bceb3[_0x620a('0x77')](_0x46ca19);}})[_0x620a('0x35')](function(_0x53a2c6){if(_0x53a2c6){_0x5569b4=_0x53a2c6['length'];if(!_0x990537[_0x620a('0x44')]['hasOwnProperty']('nolimit')){_0x46ca19['limit']=qs[_0x620a('0x4a')](_0x990537[_0x620a('0x44')][_0x620a('0x4a')]);_0x46ca19[_0x620a('0x2e')]=qs['offset'](_0x990537['query'][_0x620a('0x2e')]);}return _0x1bceb3[_0x620a('0x77')](_0x46ca19);}})[_0x620a('0x35')](function(_0x406de6){if(_0x406de6){return _0x406de6?{'count':_0x5569b4,'rows':_0x406de6}:null;}})['then'](respondWithResult(_0x36f2a2,null))[_0x620a('0x29')](handleError(_0x36f2a2,null));};exports[_0x620a('0x78')]=function(_0x91ba04,_0x5cb9fe){var _0x5690a9=_0x91ba04[_0x620a('0x65')]['id'];var _0xd3da21=_0x91ba04[_0x620a('0x5d')];var _0x157aa8=0xc8;var _0x3de87b=null;return db[_0x620a('0x79')][_0x620a('0x7a')]({'isolationLevel':db[_0x620a('0x79')][_0x620a('0x7b')][_0x620a('0x7c')][_0x620a('0x7d')]},function(_0x410351){return db['WhatsappAccount'][_0x620a('0x6a')]({'where':{'id':_0x5690a9},'transaction':_0x410351})[_0x620a('0x35')](function(_0x20015d){if(_0x20015d){return db[_0x620a('0x7e')]['destroy']({'where':{'WhatsappAccountId':_0x5690a9},'transaction':_0x410351})[_0x620a('0x35')](function(){var _0x33d68e=_['map'](_0xd3da21,function(_0x372172){_0x372172[_0x620a('0x68')]=_0x5690a9;return _0x372172;});return db[_0x620a('0x7e')]['bulkCreate'](_0x33d68e,{'transaction':_0x410351});});}else{_0x157aa8=0x194;_0x3de87b=[];}});})['then'](function(){if(_0x157aa8!==0x194){return db[_0x620a('0x7e')][_0x620a('0x7f')]({'where':{'WhatsappAccountId':_0x5690a9},'order':'priority'})[_0x620a('0x35')](function(_0x5ea814){_0x3de87b=_0x5ea814;});}})[_0x620a('0x29')](function(_0x4453c4){_0x157aa8=0x1f4;logger['error'](_0x4453c4[_0x620a('0x3a')]);if(_0x4453c4[_0x620a('0x3b')]){delete _0x4453c4[_0x620a('0x3b')];}_0x3de87b=_0x4453c4;})[_0x620a('0x80')](function(){if(_0x3de87b===null){_0x5cb9fe['sendStatus'](_0x157aa8);}else{if(_0x157aa8===0x1f4){_0x5cb9fe[_0x620a('0x2b')](_0x157aa8)[_0x620a('0x81')](_0x3de87b);}else{_0x5cb9fe[_0x620a('0x2b')](_0x157aa8)['json'](_0x3de87b);}}});};exports[_0x620a('0x82')]=function(_0x1b89f0,_0x2a6923,_0x3a0e7e){var _0xa07439={};var _0x43ebe9={};var _0x40a0af;var _0x46236b;return db['WhatsappAccount']['findOne']({'where':{'id':_0x1b89f0['params']['id']}})['then'](handleEntityNotFound(_0x2a6923,null))[_0x620a('0x35')](function(_0x515751){if(_0x515751){_0x40a0af=_0x515751;_0x43ebe9[_0x620a('0x43')]=_[_0x620a('0x57')](db[_0x620a('0x7e')][_0x620a('0x58')]);_0x43ebe9[_0x620a('0x44')]=_[_0x620a('0x57')](_0x1b89f0[_0x620a('0x44')]);_0x43ebe9[_0x620a('0x4e')]=_[_0x620a('0x59')](_0x43ebe9['model'],_0x43ebe9[_0x620a('0x44')]);_0xa07439[_0x620a('0x45')]=_[_0x620a('0x59')](_0x43ebe9[_0x620a('0x43')],qs[_0x620a('0x46')](_0x1b89f0[_0x620a('0x44')][_0x620a('0x46')]));_0xa07439['attributes']=_0xa07439['attributes']['length']?_0xa07439[_0x620a('0x45')]:_0x43ebe9['model'];_0xa07439[_0x620a('0x4b')]=qs[_0x620a('0x4c')](_0x1b89f0['query']['sort']);_0xa07439[_0x620a('0x4d')]=qs[_0x620a('0x4e')](_[_0x620a('0x4f')](_0x1b89f0[_0x620a('0x44')],_0x43ebe9[_0x620a('0x4e')]));if(_0x1b89f0[_0x620a('0x44')][_0x620a('0x50')]){_0xa07439[_0x620a('0x4d')]=_[_0x620a('0x51')](_0xa07439[_0x620a('0x4d')],{'$or':_[_0x620a('0x3f')](_0xa07439[_0x620a('0x45')],function(_0x4f79f8){var _0x2c1943={};_0x2c1943[_0x4f79f8]={'$like':'%'+_0x1b89f0[_0x620a('0x44')][_0x620a('0x50')]+'%'};return _0x2c1943;})});}_0xa07439=_[_0x620a('0x51')]({},_0xa07439,_0x1b89f0[_0x620a('0x5a')]);return _0x40a0af[_0x620a('0x82')](_0xa07439);}})[_0x620a('0x35')](function(_0x544908){if(_0x544908){_0x46236b=_0x544908['length'];if(!_0x1b89f0[_0x620a('0x44')][_0x620a('0x48')]('nolimit')){_0xa07439[_0x620a('0x4a')]=qs[_0x620a('0x4a')](_0x1b89f0[_0x620a('0x44')][_0x620a('0x4a')]);_0xa07439[_0x620a('0x2e')]=qs[_0x620a('0x2e')](_0x1b89f0[_0x620a('0x44')][_0x620a('0x2e')]);}return _0x40a0af[_0x620a('0x82')](_0xa07439);}})[_0x620a('0x35')](function(_0x7aa96b){if(_0x7aa96b){return _0x7aa96b?{'count':_0x46236b,'rows':_0x7aa96b}:null;}})[_0x620a('0x35')](respondWithResult(_0x2a6923,null))[_0x620a('0x29')](handleError(_0x2a6923,null));};exports[_0x620a('0x83')]=function(_0x326e06,_0x1f16db,_0xf5f2db){var _0x3e5ea1={'channel':_0x620a('0x84')};var _0x33536a=[];var _0x1c0b57=[];var _0x22d17f={};return db[_0x620a('0x40')][_0x620a('0x5b')]({'where':{'id':_0x326e06[_0x620a('0x65')]['id']},'include':[{'model':db[_0x620a('0x7e')],'as':_0x620a('0x85')}]})[_0x620a('0x35')](handleEntityNotFound(_0x1f16db,null))[_0x620a('0x35')](function(_0x20670c){_0x3e5ea1[_0x620a('0x86')]=_0x20670c;if(_0x3e5ea1['account']&&_0x3e5ea1[_0x620a('0x86')][_0x620a('0x41')]===_0x620a('0x87')&&_0x326e06[_0x620a('0x5d')]['statuses']){if(_0x326e06[_0x620a('0x5d')][_0x620a('0x88')][_0x620a('0x47')]===0x0)return;if(_0x326e06['body'][_0x620a('0x88')][0x0][_0x620a('0x89')]!==_0x620a('0x8a'))return;return db[_0x620a('0x8b')]['update']({'read':!![],'readAt':_0x326e06[_0x620a('0x5d')]['statuses'][0x0][_0x620a('0x8c')]},{'where':{'messageId':_0x326e06[_0x620a('0x5d')]['statuses'][0x0][_0x620a('0x8d')]},'individualHooks':!![]})[_0x620a('0x35')](function(_0x61eb7){return _0x1f16db['status'](0xc8)[_0x620a('0x2d')](_0x61eb7);});}_0x3e5ea1[_0x620a('0x8e')]=_['orderBy'](_0x20670c['Applications'],[_0x620a('0x8f')],[_0x620a('0x90')]);if(_0x3e5ea1[_0x620a('0x86')][_0x620a('0x85')]){delete _0x3e5ea1[_0x620a('0x86')][_0x620a('0x85')];}return db[_0x620a('0x91')][_0x620a('0x66')]()['then'](function(_0x45c6b2){if(!_0x45c6b2){throw new db[(_0x620a('0x92'))][(_0x620a('0x93'))](_0x620a('0x94'));}_0x33536a=_[_0x620a('0x95')](_[_0x620a('0x57')](_0x45c6b2),[_0x620a('0x96'),'updatedAt']);_0x1c0b57=_['difference'](_['keys'](_0x45c6b2),[_0x620a('0x96'),_0x620a('0x97'),'CompanyId',_0x620a('0x98')]);_0x3e5ea1[_0x620a('0x5d')]={'mapKey':'mobile'};if(_0x3e5ea1[_0x620a('0x86')]&&_0x3e5ea1[_0x620a('0x86')][_0x620a('0x41')]===_0x620a('0x99')){_0x3e5ea1[_0x620a('0x5d')]['from']=_0x326e06[_0x620a('0x5d')][_0x620a('0x9a')][_0x620a('0x9b')](_0x620a('0x9c'),'');_0x3e5ea1['body'][_0x620a('0x5d')]=_0x326e06[_0x620a('0x5d')]['Body'];_0x3e5ea1[_0x620a('0x5d')][_0x620a('0x9d')]=_0x326e06['body'][_0x620a('0x9e')];}if(_0x3e5ea1[_0x620a('0x86')]&&_0x3e5ea1[_0x620a('0x86')][_0x620a('0x41')]===_0x620a('0x87')){_0x3e5ea1['body']['from']=_0x326e06['body']['notifications'][0x0][_0x620a('0x9f')];_0x3e5ea1['body'][_0x620a('0x5d')]=_0x326e06['body'][_0x620a('0xa0')][0x0][_0x620a('0x26')][_0x620a('0x5d')];_0x3e5ea1[_0x620a('0x5d')][_0x620a('0x9d')]=_0x326e06[_0x620a('0x5d')]['notifications'][0x0]['message_id'];}if(_0x3e5ea1['body']['id']){delete _0x3e5ea1[_0x620a('0x5d')]['id'];}if(_[_0x620a('0xa1')](_0x3e5ea1[_0x620a('0x5d')][_0x620a('0x9f')])){throw new db[(_0x620a('0x92'))]['ValidationError'](_0x620a('0xa2'));}if(_[_0x620a('0xa1')](_0x3e5ea1['body']['body'])||_0x3e5ea1[_0x620a('0x5d')][_0x620a('0x5d')]===''){throw new db['Sequelize'][(_0x620a('0x93'))](_0x620a('0xa3'));}if(_[_0x620a('0xa1')](_0x3e5ea1[_0x620a('0x5d')][_0x620a('0xa4')])){throw new db[(_0x620a('0x92'))][(_0x620a('0x93'))](_0x620a('0xa5')+_0x1c0b57);}if(!_[_0x620a('0xa6')](_0x1c0b57,_0x3e5ea1[_0x620a('0x5d')][_0x620a('0xa4')])){throw new db[(_0x620a('0x92'))]['ValidationError'](_0x620a('0xa7')+_0x1c0b57);}_0x22d17f[_0x3e5ea1[_0x620a('0x5d')][_0x620a('0xa4')]]=_0x3e5ea1['body']['from'];return db['CmList'][_0x620a('0x5b')]({'where':{'id':_0x3e5ea1[_0x620a('0x86')]['ListId']},'include':[{'model':db[_0x620a('0x91')],'as':_0x620a('0xa8'),'where':_0x22d17f,'limit':0x1,'order':[[_0x620a('0x97'),_0x620a('0xa9')]]}]});})[_0x620a('0x35')](handleEntityNotFound(_0x1f16db,null))[_0x620a('0x35')](function(_0x1bdb48){if(_0x1bdb48){_0x3e5ea1['list']=_['omit'](_0x1bdb48,['Contacts']);if(_0x1bdb48['Contacts'][_0x620a('0x47')]){return _0x1bdb48['Contacts'][0x0];}var _0x588535=_[_0x620a('0x19')](_0x3e5ea1['body'],{'firstName':_0x3e5ea1['body'][_0x620a('0x9f')],'ListId':_0x1bdb48['id']});_0x588535[_0x3e5ea1[_0x620a('0x5d')][_0x620a('0xa4')]]=_0x3e5ea1[_0x620a('0x5d')]['from'];return db[_0x620a('0x91')][_0x620a('0x5c')](_0x588535,{'fields':_0x33536a,'raw':!![]});}})['then'](handleEntityNotFound(_0x1f16db,null))['then'](function(_0x1df495){if(_0x1df495){_0x3e5ea1[_0x620a('0xaa')]=_0x1df495;var _0x2b63a2={'ContactId':_0x1df495['id'],'phone':_0x3e5ea1[_0x620a('0x5d')][_0x620a('0x9f')],'WhatsappAccountId':_0x326e06[_0x620a('0x65')]['id']};var _0x1137e1={'ContactId':_0x1df495['id'],'WhatsappAccountId':_0x326e06[_0x620a('0x65')]['id'],'closed':![]};return db[_0x620a('0xab')][_0x620a('0x5b')]({'where':_0x1137e1})[_0x620a('0x35')](function(_0x23a49f){if(_0x23a49f){return[_0x23a49f,![]];}return db[_0x620a('0xab')][_0x620a('0x5c')](_0x2b63a2)[_0x620a('0x35')](function(_0x56560e){return[_0x56560e,!![]];});});}})[_0x620a('0xac')](function(_0x3ddffa,_0x3433fa){_0x3e5ea1[_0x620a('0xad')]=_0x3ddffa[_0x620a('0x37')]({'plain':!![]});_0x3e5ea1[_0x620a('0xad')][_0x620a('0xae')]=![];if(_0x3433fa){if(_0x3e5ea1[_0x620a('0x86')][_0x620a('0xaf')]){_0x3e5ea1[_0x620a('0x8e')][_0x620a('0xb0')]({'id':0x0,'priority':_0x3e5ea1[_0x620a('0x8e')]['length']+0x1,'app':_0x620a('0xb1'),'appdata':'unmanaged','interval':_0x620a('0xb2')});}_0x3e5ea1[_0x620a('0xad')]['created']=!![];}return db['WhatsappMessage']['create']({'phone':_0x3e5ea1[_0x620a('0x5d')][_0x620a('0x9f')],'messageId':_0x3e5ea1[_0x620a('0x5d')][_0x620a('0x9d')],'body':_0x3e5ea1[_0x620a('0x5d')][_0x620a('0x5d')],'WhatsappAccountId':_0x326e06[_0x620a('0x65')]['id'],'WhatsappInteractionId':_0x3ddffa['id'],'direction':'in','ContactId':_0x3ddffa['ContactId'],'AttachmentId':_0x3e5ea1[_0x620a('0x5d')][_0x620a('0xb3')]});})[_0x620a('0x35')](function(_0x3dc30c){_0x3e5ea1['message']=_0x3dc30c;if(_0x3e5ea1[_0x620a('0xad')][_0x620a('0xb4')]){return db['User']['find']({'attributes':['id',_0x620a('0x3b')],'where':{'id':_0x3e5ea1[_0x620a('0xad')][_0x620a('0xb4')]}})[_0x620a('0x35')](function(_0x536069){if(_0x536069){_0x3e5ea1[_0x620a('0x8e')]['unshift']({'id':0x0,'priority':0x0,'app':_0x620a('0xb5'),'appdata':_0x536069[_0x620a('0x3b')]+','+(_0x3e5ea1[_0x620a('0x86')][_0x620a('0xb6')]||0xa),'interval':_0x620a('0xb2')});}return respondWithRpcPromise(_0x620a('0xb7'),_0x620a('0xb8'),_0x3e5ea1);});}return respondWithRpcPromise(_0x620a('0xb7'),'startRouting',_0x3e5ea1);})[_0x620a('0x35')](function(_0x4706e2){if(_0x4706e2){var _0xa43c25=0xc8;var _0x221809='receiveMessage';logger[_0x620a('0x27')](_0x620a('0x22'),_0x221809,_0xa43c25,_0x620a('0xb9'));logger[_0x620a('0x21')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x221809,_0xa43c25,_0x620a('0xb9'),JSON[_0x620a('0xba')](_0x4706e2));if(_0x3e5ea1[_0x620a('0x86')][_0x620a('0x41')]===_0x620a('0x99')){return _0x1f16db[_0x620a('0x2b')](_0xa43c25)[_0x620a('0x31')](_0x620a('0xbb'),_0x620a('0xbc'))[_0x620a('0x81')](_0x620a('0xbd'));}else{return _0x1f16db[_0x620a('0x2b')](_0xa43c25)[_0x620a('0x2d')](_0x4706e2);}}});})['catch'](handleError(_0x1f16db,null));};exports[_0x620a('0x81')]=function(_0xf9c29d,_0x2d80bc,_0x13e2c0){var _0x458537,_0x5f30ce,_0x1b38a5;if(_[_0x620a('0xa1')](_0xf9c29d[_0x620a('0x5d')][_0x620a('0x5d')])||_0xf9c29d[_0x620a('0x5d')]['body']===''){throw new db['Sequelize']['ValidationError'](_0x620a('0xa3'));}if(_[_0x620a('0xa1')](_0xf9c29d[_0x620a('0x5d')]['to'])){throw new db[(_0x620a('0x92'))][(_0x620a('0x93'))](_0x620a('0xbe'));}_0x458537=_0xf9c29d[_0x620a('0x5d')]['to'];return db[_0x620a('0x40')]['find']({'where':{'id':_0xf9c29d[_0x620a('0x65')]['id']},'include':[{'model':db[_0x620a('0xbf')],'as':_0x620a('0xc0'),'include':[{'model':db[_0x620a('0x91')],'as':'Contacts','where':{'mobile':_0x458537},'limit':0x1,'order':[[_0x620a('0x97'),_0x620a('0xa9')]]}]}]})[_0x620a('0x35')](handleEntityNotFound(_0x2d80bc,null))['then'](function(_0x45e237){if(_0x45e237&&_0x45e237[_0x620a('0xc0')]){_0x5f30ce=_0x45e237['get']({'plain':!![]});if(_0x5f30ce['List']&&_0x5f30ce[_0x620a('0xc0')][_0x620a('0xa8')][_0x620a('0x47')]){return _0x5f30ce[_0x620a('0xc0')]['Contacts'][0x0];}return db[_0x620a('0x91')][_0x620a('0x5c')](_['defaults'](_0xf9c29d['body'],{'firstName':_0x458537,'mobile':_0x458537,'phone':_0x458537,'ListId':_0x5f30ce[_0x620a('0x98')]}));}})[_0x620a('0x35')](handleEntityNotFound(_0x2d80bc,null))['then'](function(_0x41d256){if(_0x41d256){_0x1b38a5=_0x41d256;return db[_0x620a('0xab')][_0x620a('0x5b')]({'where':{'ContactId':_0x1b38a5['id'],'closed':![],'WhatsappAccountId':_0x5f30ce['id']}})[_0x620a('0x35')](function(_0x52ebe9){if(_0x52ebe9){return[_0x52ebe9,![]];}return db['WhatsappInteraction'][_0x620a('0x5c')]({'UserId':_0xf9c29d[_0x620a('0x5e')]['id'],'ContactId':_0x1b38a5['id'],'WhatsappAccountId':_0x5f30ce['id'],'phone':_0x458537,'firstMsgDirection':'out','Messages':[_[_0x620a('0x51')](_0xf9c29d[_0x620a('0x5d')],{'read':![],'body':_0xf9c29d[_0x620a('0x5d')][_0x620a('0x5d')],'phone':_0x458537,'WhatsappAccountId':_0x5f30ce['id'],'UserId':_0xf9c29d[_0x620a('0x5e')]['id'],'ContactId':_0x1b38a5['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x620a('0xc1')}]})[_0x620a('0x35')](function(_0x3cd8e3){return[_0x3cd8e3,!![]];});});}})['spread'](function(_0x893935,_0x476f16){if(_0x476f16){return _0x893935;}return db[_0x620a('0x8b')][_0x620a('0x5c')](_[_0x620a('0x51')](_0xf9c29d[_0x620a('0x5d')],{'read':![],'body':_0xf9c29d[_0x620a('0x5d')]['body'],'phone':_0x458537,'WhatsappAccountId':_0x5f30ce['id'],'WhatsappInteractionId':_0x893935['id'],'UserId':_0xf9c29d[_0x620a('0x5e')]['id'],'ContactId':_0x1b38a5['id']}))[_0x620a('0x35')](function(_0x2d7b4a){_0x893935[_0x620a('0xc2')][_0x620a('0xc1')]=[];_0x893935['dataValues'][_0x620a('0xc1')][_0x620a('0xb0')](_0x2d7b4a['dataValues']);return _0x893935;});})[_0x620a('0x35')](respondWithResult(_0x2d80bc,null))[_0x620a('0x29')](handleError(_0x2d80bc,null));}; \ No newline at end of file +var _0xead0=['startRouting','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','text/xml','body\x20is\x20mandatory\x20and\x20not\x20empty','List','WhatsappInteraction','out','Messages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','get','WhatsappAccounts','destroy','name','send','index','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','mandatoryDispositionPause','find','create','body','user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','Pause','describe','addDisposition','WhatsappAccountId','getDispositions','Disposition','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','findOne','getAgents','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','notify','whatsapp','Applications','account','statuses','state','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','from','replace','whatsapp:','Body','messageId','sinch','notifications','isNil','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','ListId','CmContact','Contacts','DESC','defaults','interaction','autoclose','push','close','unmanaged','*,*,*,*','created','ContactId','UserId','unshift','agent','waitForTheAssignedAgent','Start'];(function(_0x54e69e,_0x583266){var _0xbb7ed7=function(_0x339a6a){while(--_0x339a6a){_0x54e69e['push'](_0x54e69e['shift']());}};_0xbb7ed7(++_0x583266);}(_0xead0,0x18f));var _0x0ead=function(_0x15a8fa,_0x4652b2){_0x15a8fa=_0x15a8fa-0x0;var _0x1355c2=_0xead0[_0x15a8fa];return _0x1355c2;};'use strict';var emlformat=require(_0x0ead('0x0'));var rimraf=require(_0x0ead('0x1'));var zipdir=require(_0x0ead('0x2'));var jsonpatch=require(_0x0ead('0x3'));var rp=require(_0x0ead('0x4'));var moment=require(_0x0ead('0x5'));var BPromise=require(_0x0ead('0x6'));var Mustache=require('mustache');var util=require(_0x0ead('0x7'));var path=require(_0x0ead('0x8'));var sox=require('sox');var csv=require(_0x0ead('0x9'));var ejs=require(_0x0ead('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ead('0xb'));var squel=require(_0x0ead('0xc'));var crypto=require(_0x0ead('0xd'));var jsforce=require(_0x0ead('0xe'));var deskjs=require(_0x0ead('0xf'));var toCsv=require(_0x0ead('0x9'));var querystring=require(_0x0ead('0x10'));var Papa=require(_0x0ead('0x11'));var Redis=require(_0x0ead('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0ead('0x13'));var as=require(_0x0ead('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ead('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x0ead('0x16'));var licenseUtil=require(_0x0ead('0x17'));var db=require(_0x0ead('0x18'))['db'];config[_0x0ead('0x19')]=_['defaults'](config['redis'],{'host':_0x0ead('0x1a'),'port':0x18eb});var socket=require(_0x0ead('0x1b'))(new Redis(config[_0x0ead('0x19')]));require(_0x0ead('0x1c'))[_0x0ead('0x1d')](socket);var jayson=require(_0x0ead('0x1e'));var client=jayson[_0x0ead('0x1f')]['http']({'port':0x232c});function respondWithRpcPromise(_0x411e87,_0xdd64d7,_0x38bdc3,_0x11d4f7){return new BPromise(function(_0x116bde,_0x56de9f){var _0x13a136=_0x11d4f7||client;return _0x13a136[_0x0ead('0x20')](_0x411e87,_0x38bdc3)[_0x0ead('0x21')](function(_0x34a050){logger[_0x0ead('0x22')](_0x0ead('0x23'),_0xdd64d7,_0x0ead('0x24'));logger[_0x0ead('0x25')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xdd64d7,_0x0ead('0x24'),JSON[_0x0ead('0x26')](_0x34a050));if(_0x34a050[_0x0ead('0x27')]){if(_0x34a050[_0x0ead('0x27')][_0x0ead('0x28')]===0x1f4){logger['error'](_0x0ead('0x23'),_0xdd64d7,_0x34a050[_0x0ead('0x27')][_0x0ead('0x29')]);return _0x56de9f(_0x34a050[_0x0ead('0x27')][_0x0ead('0x29')]);}logger[_0x0ead('0x27')](_0x0ead('0x23'),_0xdd64d7,_0x34a050[_0x0ead('0x27')][_0x0ead('0x29')]);return _0x116bde(_0x34a050['error'][_0x0ead('0x29')]);}else{logger['info'](_0x0ead('0x23'),_0xdd64d7,'request\x20sent');_0x116bde(_0x34a050[_0x0ead('0x2a')][_0x0ead('0x29')]);}})[_0x0ead('0x2b')](function(_0x205ad1){logger[_0x0ead('0x27')](_0x0ead('0x23'),_0xdd64d7,_0x205ad1);_0x56de9f(_0x205ad1);});});}function respondWithStatusCode(_0x2efbe4,_0x3e0629){_0x3e0629=_0x3e0629||0xcc;return function(_0x532be8){if(_0x532be8){return _0x2efbe4[_0x0ead('0x2c')](_0x3e0629);}return _0x2efbe4[_0x0ead('0x2d')](_0x3e0629)[_0x0ead('0x2e')]();};}function respondWithResult(_0x1f082d,_0x4ead92){_0x4ead92=_0x4ead92||0xc8;return function(_0x3772aa){if(_0x3772aa){return _0x1f082d[_0x0ead('0x2d')](_0x4ead92)[_0x0ead('0x2f')](_0x3772aa);}};}function respondWithFilteredResult(_0x113404,_0x2b7569){return function(_0x2c8d4b){if(_0x2c8d4b){var _0x8c2f4b=typeof _0x2b7569[_0x0ead('0x30')]===_0x0ead('0x31')&&typeof _0x2b7569[_0x0ead('0x32')]===_0x0ead('0x31');var _0x28a814=_0x2c8d4b[_0x0ead('0x33')];var _0x3f4714=_0x8c2f4b?0x0:_0x2b7569[_0x0ead('0x30')];var _0x2286e3=_0x8c2f4b?_0x2c8d4b[_0x0ead('0x33')]:_0x2b7569[_0x0ead('0x30')]+_0x2b7569[_0x0ead('0x32')];var _0x35d1f4;if(_0x2286e3>=_0x28a814){_0x2286e3=_0x28a814;_0x35d1f4=0xc8;}else{_0x35d1f4=0xce;}_0x113404[_0x0ead('0x2d')](_0x35d1f4);return _0x113404[_0x0ead('0x34')]('Content-Range',_0x3f4714+'-'+_0x2286e3+'/'+_0x28a814)[_0x0ead('0x2f')](_0x2c8d4b);}return null;};}function patchUpdates(_0x2b0812){return function(_0x41b158){try{jsonpatch[_0x0ead('0x35')](_0x41b158,_0x2b0812,!![]);}catch(_0x1018a9){return BPromise['reject'](_0x1018a9);}return _0x41b158[_0x0ead('0x36')]();};}function saveUpdates(_0x3c77ab,_0x12b3a2){return function(_0x1feaf1){if(_0x1feaf1){return _0x1feaf1[_0x0ead('0x37')](_0x3c77ab)[_0x0ead('0x21')](function(_0x40ad96){return _0x40ad96;});}return null;};}function removeEntity(_0x3cf8d4,_0x3ecb5){return function(_0x52738a){if(_0x52738a){return _0x52738a['destroy']()[_0x0ead('0x21')](function(){var _0x3116fe=_0x52738a[_0x0ead('0x38')]({'plain':!![]});var _0x4fc770=_0x0ead('0x39');return db['UserProfileResource'][_0x0ead('0x3a')]({'where':{'type':_0x4fc770,'resourceId':_0x3116fe['id']}})[_0x0ead('0x21')](function(){return _0x52738a;});})[_0x0ead('0x21')](function(){_0x3cf8d4[_0x0ead('0x2d')](0xcc)[_0x0ead('0x2e')]();});}};}function handleEntityNotFound(_0x499a59,_0x17a884){return function(_0x33804b){if(!_0x33804b){_0x499a59[_0x0ead('0x2c')](0x194);}return _0x33804b;};}function handleError(_0xf497fc,_0x13885f){_0x13885f=_0x13885f||0x1f4;return function(_0xd8ba42){logger[_0x0ead('0x27')](_0xd8ba42['stack']);if(_0xd8ba42['name']){delete _0xd8ba42[_0x0ead('0x3b')];}_0xf497fc[_0x0ead('0x2d')](_0x13885f)[_0x0ead('0x3c')](_0xd8ba42);};}exports[_0x0ead('0x3d')]=function(_0x386c95,_0x3a1e33){var _0x3f4a37={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0xd345d9={},_0x3b3942={'count':0x0,'rows':[]};var _0x168c20=_[_0x0ead('0x3e')](db[_0x0ead('0x3f')][_0x0ead('0x40')],function(_0x572b3e){return{'name':_0x572b3e[_0x0ead('0x41')],'type':_0x572b3e[_0x0ead('0x42')][_0x0ead('0x43')]};});_0xd345d9[_0x0ead('0x44')]=_[_0x0ead('0x3e')](_0x168c20,'name');_0xd345d9[_0x0ead('0x45')]=_[_0x0ead('0x46')](_0x386c95['query']);_0xd345d9[_0x0ead('0x47')]=_[_0x0ead('0x48')](_0xd345d9[_0x0ead('0x44')],_0xd345d9[_0x0ead('0x45')]);_0x3f4a37[_0x0ead('0x49')]=_[_0x0ead('0x48')](_0xd345d9[_0x0ead('0x44')],qs[_0x0ead('0x4a')](_0x386c95[_0x0ead('0x45')][_0x0ead('0x4a')]));_0x3f4a37[_0x0ead('0x49')]=_0x3f4a37[_0x0ead('0x49')][_0x0ead('0x4b')]?_0x3f4a37[_0x0ead('0x49')]:_0xd345d9[_0x0ead('0x44')];if(!_0x386c95[_0x0ead('0x45')][_0x0ead('0x4c')](_0x0ead('0x4d'))){_0x3f4a37[_0x0ead('0x32')]=qs[_0x0ead('0x32')](_0x386c95['query'][_0x0ead('0x32')]);_0x3f4a37[_0x0ead('0x30')]=qs[_0x0ead('0x30')](_0x386c95[_0x0ead('0x45')][_0x0ead('0x30')]);}_0x3f4a37[_0x0ead('0x4e')]=qs[_0x0ead('0x4f')](_0x386c95[_0x0ead('0x45')][_0x0ead('0x4f')]);_0x3f4a37['where']=qs['filters'](_[_0x0ead('0x50')](_0x386c95[_0x0ead('0x45')],_0xd345d9[_0x0ead('0x47')]),_0x168c20);if(_0x386c95['query']['filter']){_0x3f4a37[_0x0ead('0x51')]=_[_0x0ead('0x52')](_0x3f4a37['where'],{'$or':_[_0x0ead('0x3e')](_0x168c20,function(_0x57002b){if(_0x57002b[_0x0ead('0x42')]!==_0x0ead('0x53')){var _0x33f983={};_0x33f983[_0x57002b[_0x0ead('0x3b')]]={'$like':'%'+_0x386c95['query'][_0x0ead('0x54')]+'%'};return _0x33f983;}})});}_0x3f4a37=_['merge']({},_0x3f4a37,_0x386c95[_0x0ead('0x55')]);var _0x278973={'where':_0x3f4a37[_0x0ead('0x51')]};return db['WhatsappAccount'][_0x0ead('0x33')](_0x278973)[_0x0ead('0x21')](function(_0x28d773){_0x3b3942['count']=_0x28d773;if(_0x386c95[_0x0ead('0x45')][_0x0ead('0x56')]){_0x3f4a37[_0x0ead('0x57')]=[{'all':!![]}];}return db[_0x0ead('0x3f')][_0x0ead('0x58')](_0x3f4a37);})[_0x0ead('0x21')](function(_0x3d5e75){_0x3b3942[_0x0ead('0x59')]=_0x3d5e75;return _0x3b3942;})[_0x0ead('0x21')](respondWithFilteredResult(_0x3a1e33,_0x3f4a37))[_0x0ead('0x2b')](handleError(_0x3a1e33,null));};exports[_0x0ead('0x5a')]=function(_0x5cf0f8,_0x427238){var _0x55dab7={'raw':![],'where':{'id':_0x5cf0f8['params']['id']},'include':[{'model':db['Pause'],'as':_0x0ead('0x5b')}]},_0x396587={};_0x396587['model']=_[_0x0ead('0x46')](db[_0x0ead('0x3f')]['rawAttributes']);_0x396587[_0x0ead('0x45')]=_[_0x0ead('0x46')](_0x5cf0f8[_0x0ead('0x45')]);_0x396587[_0x0ead('0x47')]=_['intersection'](_0x396587[_0x0ead('0x44')],_0x396587[_0x0ead('0x45')]);_0x55dab7[_0x0ead('0x49')]=_[_0x0ead('0x48')](_0x396587[_0x0ead('0x44')],qs[_0x0ead('0x4a')](_0x5cf0f8[_0x0ead('0x45')]['fields']));_0x55dab7['attributes']=_0x55dab7['attributes'][_0x0ead('0x4b')]?_0x55dab7[_0x0ead('0x49')]:_0x396587[_0x0ead('0x44')];if(_0x5cf0f8[_0x0ead('0x45')][_0x0ead('0x56')]){_0x55dab7[_0x0ead('0x57')]=[{'all':!![]}];}_0x55dab7=_[_0x0ead('0x52')]({},_0x55dab7,_0x5cf0f8[_0x0ead('0x55')]);return db[_0x0ead('0x3f')][_0x0ead('0x5c')](_0x55dab7)['then'](handleEntityNotFound(_0x427238,null))[_0x0ead('0x21')](respondWithResult(_0x427238,null))[_0x0ead('0x2b')](handleError(_0x427238,null));};exports[_0x0ead('0x5d')]=function(_0x83264,_0x1829cd){return db[_0x0ead('0x3f')][_0x0ead('0x5d')](_0x83264[_0x0ead('0x5e')],{})[_0x0ead('0x21')](function(_0x494f34){var _0x33dcaa=_0x83264[_0x0ead('0x5f')]['get']({'plain':!![]});if(!_0x33dcaa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x33dcaa[_0x0ead('0x60')]===_0x0ead('0x5f')){var _0x56ffbf=_0x494f34[_0x0ead('0x38')]({'plain':!![]});var _0x4bcb16='WhatsappAccounts';return db['UserProfileSection'][_0x0ead('0x5c')]({'where':{'name':_0x4bcb16,'userProfileId':_0x33dcaa[_0x0ead('0x61')]},'raw':!![]})[_0x0ead('0x21')](function(_0x5d1641){if(_0x5d1641&&_0x5d1641['autoAssociation']===0x0){return db[_0x0ead('0x62')]['create']({'name':_0x56ffbf[_0x0ead('0x3b')],'resourceId':_0x56ffbf['id'],'type':_0x5d1641[_0x0ead('0x3b')],'sectionId':_0x5d1641['id']},{})[_0x0ead('0x21')](function(){return _0x494f34;});}else{return _0x494f34;}})[_0x0ead('0x2b')](function(_0x609e08){logger[_0x0ead('0x27')](_0x0ead('0x63'),_0x609e08);throw _0x609e08;});}return _0x494f34;})[_0x0ead('0x21')](respondWithResult(_0x1829cd,0xc9))[_0x0ead('0x2b')](handleError(_0x1829cd,null));};exports['update']=function(_0xa617cb,_0x294226){if(_0xa617cb[_0x0ead('0x5e')]['id']){delete _0xa617cb[_0x0ead('0x5e')]['id'];}return db[_0x0ead('0x3f')][_0x0ead('0x5c')]({'where':{'id':_0xa617cb[_0x0ead('0x64')]['id']},'include':[{'model':db[_0x0ead('0x65')],'as':_0x0ead('0x5b')}]})[_0x0ead('0x21')](handleEntityNotFound(_0x294226,null))[_0x0ead('0x21')](saveUpdates(_0xa617cb[_0x0ead('0x5e')],null))['then'](respondWithResult(_0x294226,null))[_0x0ead('0x2b')](handleError(_0x294226,null));};exports[_0x0ead('0x3a')]=function(_0x2e42fe,_0x59f32f){return db[_0x0ead('0x3f')][_0x0ead('0x5c')]({'where':{'id':_0x2e42fe[_0x0ead('0x64')]['id']}})[_0x0ead('0x21')](handleEntityNotFound(_0x59f32f,null))[_0x0ead('0x21')](removeEntity(_0x59f32f,null))[_0x0ead('0x2b')](handleError(_0x59f32f,null));};exports[_0x0ead('0x66')]=function(_0x2b94b1,_0x113bed){return db[_0x0ead('0x3f')][_0x0ead('0x66')]()[_0x0ead('0x21')](respondWithResult(_0x113bed,null))[_0x0ead('0x2b')](handleError(_0x113bed,null));};exports[_0x0ead('0x67')]=function(_0x1664cd,_0x3b7df0,_0x21617c){if(_0x1664cd['body']['id']){delete _0x1664cd[_0x0ead('0x5e')]['id'];}return db[_0x0ead('0x3f')][_0x0ead('0x5c')]({'where':{'id':_0x1664cd['params']['id']}})['then'](handleEntityNotFound(_0x3b7df0,null))[_0x0ead('0x21')](function(_0x443397){if(_0x443397){_0x1664cd[_0x0ead('0x5e')][_0x0ead('0x68')]=_0x443397['id'];return db['Disposition'][_0x0ead('0x5d')](_0x1664cd['body']);}})['then'](respondWithResult(_0x3b7df0,null))['catch'](handleError(_0x3b7df0,null));};exports[_0x0ead('0x69')]=function(_0x9e4990,_0x2d0d39,_0x922736){var _0x4659b4={'raw':![],'where':{}};var _0x57f02c={};var _0x588110={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x9e4990[_0x0ead('0x64')]['id']}})[_0x0ead('0x21')](handleEntityNotFound(_0x2d0d39,null))[_0x0ead('0x21')](function(_0x4817d1){if(_0x4817d1){_0x57f02c[_0x0ead('0x44')]=_[_0x0ead('0x46')](db[_0x0ead('0x6a')]['rawAttributes']);_0x57f02c['query']=_[_0x0ead('0x46')](_0x9e4990[_0x0ead('0x45')]);_0x57f02c[_0x0ead('0x47')]=_[_0x0ead('0x48')](_0x57f02c[_0x0ead('0x44')],_0x57f02c[_0x0ead('0x45')]);_0x4659b4[_0x0ead('0x49')]=_[_0x0ead('0x48')](_0x57f02c[_0x0ead('0x44')],qs['fields'](_0x9e4990[_0x0ead('0x45')]['fields']));_0x4659b4[_0x0ead('0x49')]=_0x4659b4[_0x0ead('0x49')][_0x0ead('0x4b')]?_0x4659b4[_0x0ead('0x49')]:_0x57f02c['model'];if(!_0x9e4990[_0x0ead('0x45')][_0x0ead('0x4c')](_0x0ead('0x4d'))){_0x4659b4[_0x0ead('0x32')]=qs['limit'](_0x9e4990['query'][_0x0ead('0x32')]);_0x4659b4[_0x0ead('0x30')]=qs[_0x0ead('0x30')](_0x9e4990['query'][_0x0ead('0x30')]);}_0x4659b4['order']=qs[_0x0ead('0x4f')](_0x9e4990[_0x0ead('0x45')][_0x0ead('0x4f')]);_0x4659b4[_0x0ead('0x51')]=qs[_0x0ead('0x47')](_[_0x0ead('0x50')](_0x9e4990[_0x0ead('0x45')],_0x57f02c[_0x0ead('0x47')]));_0x4659b4[_0x0ead('0x51')][_0x0ead('0x68')]=_0x4817d1['id'];if(_0x9e4990[_0x0ead('0x45')][_0x0ead('0x54')]){_0x4659b4[_0x0ead('0x51')]=_[_0x0ead('0x52')](_0x4659b4[_0x0ead('0x51')],{'$or':_[_0x0ead('0x3e')](_0x4659b4['attributes'],function(_0x26f31b){var _0x8c353f={};_0x8c353f[_0x26f31b]={'$like':'%'+_0x9e4990['query'][_0x0ead('0x54')]+'%'};return _0x8c353f;})});}_0x4659b4=_['merge']({},_0x4659b4,_0x9e4990[_0x0ead('0x55')]);return db[_0x0ead('0x6a')][_0x0ead('0x33')]({'where':_0x4659b4['where']})[_0x0ead('0x21')](function(_0x45931f){_0x588110[_0x0ead('0x33')]=_0x45931f;if(_0x9e4990['query'][_0x0ead('0x56')]){_0x4659b4['include']=[{'all':!![]}];}return db[_0x0ead('0x6a')][_0x0ead('0x58')](_0x4659b4);})[_0x0ead('0x21')](function(_0x424d78){_0x588110[_0x0ead('0x59')]=_0x424d78;return _0x588110;});}})['then'](respondWithFilteredResult(_0x2d0d39,_0x4659b4))[_0x0ead('0x2b')](handleError(_0x2d0d39,null));};exports[_0x0ead('0x6b')]=function(_0x4402c3,_0x5b29c4,_0x40bac6){return db[_0x0ead('0x3f')][_0x0ead('0x5c')]({'where':{'id':_0x4402c3[_0x0ead('0x64')]['id']}})['then'](handleEntityNotFound(_0x5b29c4,null))[_0x0ead('0x21')](function(_0x13d870){if(_0x13d870){return _0x13d870[_0x0ead('0x6b')](_0x4402c3['query'][_0x0ead('0x6c')]);}})[_0x0ead('0x21')](respondWithStatusCode(_0x5b29c4,null))[_0x0ead('0x2b')](handleError(_0x5b29c4,null));};exports['addAnswer']=function(_0xb2e40c,_0x172962,_0x4d9608){if(_0xb2e40c[_0x0ead('0x5e')]['id']){delete _0xb2e40c[_0x0ead('0x5e')]['id'];}return db[_0x0ead('0x3f')][_0x0ead('0x5c')]({'where':{'id':_0xb2e40c['params']['id']}})[_0x0ead('0x21')](handleEntityNotFound(_0x172962,null))[_0x0ead('0x21')](function(_0x475380){if(_0x475380){_0xb2e40c[_0x0ead('0x5e')][_0x0ead('0x68')]=_0x475380['id'];return db[_0x0ead('0x6d')][_0x0ead('0x5d')](_0xb2e40c[_0x0ead('0x5e')]);}})['then'](respondWithResult(_0x172962,null))['catch'](handleError(_0x172962,null));};exports[_0x0ead('0x6e')]=function(_0x57279e,_0x43f7a6,_0x51c8a5){var _0x137e69={'raw':![],'where':{}};var _0xd628a9={};var _0x255e47={'count':0x0,'rows':[]};return db[_0x0ead('0x3f')]['findOne']({'where':{'id':_0x57279e[_0x0ead('0x64')]['id']}})[_0x0ead('0x21')](handleEntityNotFound(_0x43f7a6,null))['then'](function(_0x3f37bc){if(_0x3f37bc){_0xd628a9[_0x0ead('0x44')]=_[_0x0ead('0x46')](db[_0x0ead('0x6d')][_0x0ead('0x40')]);_0xd628a9[_0x0ead('0x45')]=_[_0x0ead('0x46')](_0x57279e['query']);_0xd628a9[_0x0ead('0x47')]=_[_0x0ead('0x48')](_0xd628a9['model'],_0xd628a9[_0x0ead('0x45')]);_0x137e69[_0x0ead('0x49')]=_['intersection'](_0xd628a9[_0x0ead('0x44')],qs[_0x0ead('0x4a')](_0x57279e[_0x0ead('0x45')][_0x0ead('0x4a')]));_0x137e69[_0x0ead('0x49')]=_0x137e69[_0x0ead('0x49')]['length']?_0x137e69[_0x0ead('0x49')]:_0xd628a9[_0x0ead('0x44')];if(!_0x57279e[_0x0ead('0x45')][_0x0ead('0x4c')](_0x0ead('0x4d'))){_0x137e69[_0x0ead('0x32')]=qs[_0x0ead('0x32')](_0x57279e[_0x0ead('0x45')]['limit']);_0x137e69[_0x0ead('0x30')]=qs['offset'](_0x57279e['query'][_0x0ead('0x30')]);}_0x137e69[_0x0ead('0x4e')]=qs['sort'](_0x57279e[_0x0ead('0x45')]['sort']);_0x137e69[_0x0ead('0x51')]=qs['filters'](_[_0x0ead('0x50')](_0x57279e[_0x0ead('0x45')],_0xd628a9['filters']));_0x137e69['where'][_0x0ead('0x68')]=_0x3f37bc['id'];if(_0x57279e['query'][_0x0ead('0x54')]){_0x137e69[_0x0ead('0x51')]=_[_0x0ead('0x52')](_0x137e69['where'],{'$or':_['map'](_0x137e69['attributes'],function(_0x28ba46){var _0x52ef78={};_0x52ef78[_0x28ba46]={'$like':'%'+_0x57279e[_0x0ead('0x45')][_0x0ead('0x54')]+'%'};return _0x52ef78;})});}_0x137e69=_[_0x0ead('0x52')]({},_0x137e69,_0x57279e[_0x0ead('0x55')]);return db[_0x0ead('0x6d')][_0x0ead('0x33')]({'where':_0x137e69['where']})['then'](function(_0x51ed6a){_0x255e47[_0x0ead('0x33')]=_0x51ed6a;if(_0x57279e[_0x0ead('0x45')]['includeAll']){_0x137e69[_0x0ead('0x57')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x137e69);})[_0x0ead('0x21')](function(_0x38c8eb){_0x255e47['rows']=_0x38c8eb;return _0x255e47;});}})[_0x0ead('0x21')](respondWithFilteredResult(_0x43f7a6,_0x137e69))[_0x0ead('0x2b')](handleError(_0x43f7a6,null));};exports[_0x0ead('0x6f')]=function(_0x510a64,_0x3d0dee,_0x2efc16){return db[_0x0ead('0x3f')][_0x0ead('0x5c')]({'where':{'id':_0x510a64[_0x0ead('0x64')]['id']}})['then'](handleEntityNotFound(_0x3d0dee,null))['then'](function(_0x51d3f3){if(_0x51d3f3){return _0x51d3f3['removeAnswers'](_0x510a64['query'][_0x0ead('0x6c')]);}})[_0x0ead('0x21')](respondWithStatusCode(_0x3d0dee,null))[_0x0ead('0x2b')](handleError(_0x3d0dee,null));};exports['addAgents']=function(_0x897320,_0x2e645f,_0x44aafc){return db[_0x0ead('0x3f')][_0x0ead('0x5c')]({'where':{'id':_0x897320[_0x0ead('0x64')]['id']}})['then'](handleEntityNotFound(_0x2e645f,null))[_0x0ead('0x21')](function(_0x2a71b5){if(_0x2a71b5){return _0x2a71b5[_0x0ead('0x70')](_0x897320[_0x0ead('0x5e')]['ids'],_[_0x0ead('0x71')](_0x897320[_0x0ead('0x5e')],['ids','id'])||{})[_0x0ead('0x72')](function(_0x4e32fe){for(var _0x127d0a=0x0;_0x127d0a<_0x897320[_0x0ead('0x5e')][_0x0ead('0x6c')][_0x0ead('0x4b')];_0x127d0a+=0x1){socket['emit'](_0x0ead('0x73'),{'UserId':Number(_0x897320[_0x0ead('0x5e')][_0x0ead('0x6c')][_0x127d0a]),'WhatsappAccountId':Number(_0x897320[_0x0ead('0x64')]['id'])});}return _0x4e32fe;});}})['then'](respondWithResult(_0x2e645f,null))[_0x0ead('0x2b')](handleError(_0x2e645f,null));};exports['removeAgents']=function(_0xb26005,_0x2c8b54,_0x319f86){return db[_0x0ead('0x3f')][_0x0ead('0x5c')]({'where':{'id':_0xb26005['params']['id']}})[_0x0ead('0x21')](handleEntityNotFound(_0x2c8b54,null))[_0x0ead('0x21')](function(_0x65fc76){if(_0x65fc76){return _0x65fc76[_0x0ead('0x74')](_0xb26005[_0x0ead('0x45')]['ids'])[_0x0ead('0x21')](function(){if(_[_0x0ead('0x75')](_0xb26005[_0x0ead('0x45')][_0x0ead('0x6c')])){for(var _0x2dac2b=0x0;_0x2dac2b<_0xb26005[_0x0ead('0x45')][_0x0ead('0x6c')][_0x0ead('0x4b')];_0x2dac2b+=0x1){socket[_0x0ead('0x76')](_0x0ead('0x77'),{'UserId':Number(_0xb26005['query']['ids'][_0x2dac2b]),'WhatsappAccountId':Number(_0xb26005[_0x0ead('0x64')]['id'])});}}else{socket[_0x0ead('0x76')](_0x0ead('0x77'),{'UserId':Number(_0xb26005[_0x0ead('0x45')][_0x0ead('0x6c')]),'WhatsappAccountId':Number(_0xb26005[_0x0ead('0x64')]['id'])});}});}})['then'](respondWithStatusCode(_0x2c8b54,null))[_0x0ead('0x2b')](handleError(_0x2c8b54,null));};exports['getAgents']=function(_0x1479ff,_0x4dcfcc,_0x25fe4c){var _0x2b7b44={};var _0x3cfa3b={};var _0x3eb660;var _0x36ef15;return db[_0x0ead('0x3f')][_0x0ead('0x78')]({'where':{'id':_0x1479ff[_0x0ead('0x64')]['id']}})[_0x0ead('0x21')](handleEntityNotFound(_0x4dcfcc,null))[_0x0ead('0x21')](function(_0x122f50){if(_0x122f50){_0x3eb660=_0x122f50;_0x3cfa3b[_0x0ead('0x44')]=_[_0x0ead('0x46')](db['User'][_0x0ead('0x40')]);_0x3cfa3b['query']=_[_0x0ead('0x46')](_0x1479ff[_0x0ead('0x45')]);_0x3cfa3b['filters']=_[_0x0ead('0x48')](_0x3cfa3b[_0x0ead('0x44')],_0x3cfa3b[_0x0ead('0x45')]);_0x2b7b44[_0x0ead('0x49')]=_[_0x0ead('0x48')](_0x3cfa3b[_0x0ead('0x44')],qs[_0x0ead('0x4a')](_0x1479ff['query'][_0x0ead('0x4a')]));_0x2b7b44[_0x0ead('0x49')]=_0x2b7b44[_0x0ead('0x49')]['length']?_0x2b7b44[_0x0ead('0x49')]:_0x3cfa3b[_0x0ead('0x44')];_0x2b7b44[_0x0ead('0x4e')]=qs[_0x0ead('0x4f')](_0x1479ff[_0x0ead('0x45')][_0x0ead('0x4f')]);_0x2b7b44[_0x0ead('0x51')]=qs[_0x0ead('0x47')](_[_0x0ead('0x50')](_0x1479ff[_0x0ead('0x45')],_0x3cfa3b[_0x0ead('0x47')]));if(_0x1479ff[_0x0ead('0x45')][_0x0ead('0x54')]){_0x2b7b44[_0x0ead('0x51')]=_[_0x0ead('0x52')](_0x2b7b44[_0x0ead('0x51')],{'$or':_[_0x0ead('0x3e')](_0x2b7b44[_0x0ead('0x49')],function(_0x3a960f){var _0x552f98={};_0x552f98[_0x3a960f]={'$like':'%'+_0x1479ff['query'][_0x0ead('0x54')]+'%'};return _0x552f98;})});}_0x2b7b44=_['merge']({},_0x2b7b44,_0x1479ff[_0x0ead('0x55')]);return _0x3eb660[_0x0ead('0x79')](_0x2b7b44);}})['then'](function(_0x3b8528){if(_0x3b8528){_0x36ef15=_0x3b8528[_0x0ead('0x4b')];if(!_0x1479ff[_0x0ead('0x45')][_0x0ead('0x4c')]('nolimit')){_0x2b7b44[_0x0ead('0x32')]=qs[_0x0ead('0x32')](_0x1479ff[_0x0ead('0x45')][_0x0ead('0x32')]);_0x2b7b44['offset']=qs[_0x0ead('0x30')](_0x1479ff[_0x0ead('0x45')][_0x0ead('0x30')]);}return _0x3eb660[_0x0ead('0x79')](_0x2b7b44);}})[_0x0ead('0x21')](function(_0x2c862e){if(_0x2c862e){return _0x2c862e?{'count':_0x36ef15,'rows':_0x2c862e}:null;}})[_0x0ead('0x21')](respondWithResult(_0x4dcfcc,null))[_0x0ead('0x2b')](handleError(_0x4dcfcc,null));};exports[_0x0ead('0x7a')]=function(_0x56724f,_0x3d3c5e){var _0x37c0aa=_0x56724f[_0x0ead('0x64')]['id'];var _0x6ab158=_0x56724f[_0x0ead('0x5e')];var _0x161102=0xc8;var _0x192111=null;return db[_0x0ead('0x7b')][_0x0ead('0x7c')]({'isolationLevel':db['sequelize'][_0x0ead('0x7d')]['ISOLATION_LEVELS'][_0x0ead('0x7e')]},function(_0x5ab48a){return db[_0x0ead('0x3f')][_0x0ead('0x78')]({'where':{'id':_0x37c0aa},'transaction':_0x5ab48a})[_0x0ead('0x21')](function(_0x522160){if(_0x522160){return db[_0x0ead('0x7f')][_0x0ead('0x3a')]({'where':{'WhatsappAccountId':_0x37c0aa},'transaction':_0x5ab48a})[_0x0ead('0x21')](function(){var _0x569c95=_[_0x0ead('0x3e')](_0x6ab158,function(_0x199eb3){_0x199eb3['WhatsappAccountId']=_0x37c0aa;return _0x199eb3;});return db[_0x0ead('0x7f')][_0x0ead('0x80')](_0x569c95,{'transaction':_0x5ab48a});});}else{_0x161102=0x194;_0x192111=[];}});})[_0x0ead('0x21')](function(){if(_0x161102!==0x194){return db[_0x0ead('0x7f')][_0x0ead('0x81')]({'where':{'WhatsappAccountId':_0x37c0aa},'order':_0x0ead('0x82')})['then'](function(_0x5ac5fb){_0x192111=_0x5ac5fb;});}})[_0x0ead('0x2b')](function(_0xf374f5){_0x161102=0x1f4;logger[_0x0ead('0x27')](_0xf374f5['stack']);if(_0xf374f5[_0x0ead('0x3b')]){delete _0xf374f5[_0x0ead('0x3b')];}_0x192111=_0xf374f5;})[_0x0ead('0x83')](function(){if(_0x192111===null){_0x3d3c5e[_0x0ead('0x2c')](_0x161102);}else{if(_0x161102===0x1f4){_0x3d3c5e[_0x0ead('0x2d')](_0x161102)[_0x0ead('0x3c')](_0x192111);}else{_0x3d3c5e[_0x0ead('0x2d')](_0x161102)['json'](_0x192111);}}});};exports[_0x0ead('0x84')]=function(_0x5ce75c,_0x4284bd,_0x3c407d){var _0x5eecb2={};var _0x42852a={};var _0x3cc75c;var _0x3d11d2;return db['WhatsappAccount'][_0x0ead('0x78')]({'where':{'id':_0x5ce75c[_0x0ead('0x64')]['id']}})[_0x0ead('0x21')](handleEntityNotFound(_0x4284bd,null))['then'](function(_0x4be04d){if(_0x4be04d){_0x3cc75c=_0x4be04d;_0x42852a[_0x0ead('0x44')]=_['keys'](db[_0x0ead('0x7f')]['rawAttributes']);_0x42852a[_0x0ead('0x45')]=_[_0x0ead('0x46')](_0x5ce75c[_0x0ead('0x45')]);_0x42852a[_0x0ead('0x47')]=_['intersection'](_0x42852a[_0x0ead('0x44')],_0x42852a[_0x0ead('0x45')]);_0x5eecb2[_0x0ead('0x49')]=_[_0x0ead('0x48')](_0x42852a[_0x0ead('0x44')],qs[_0x0ead('0x4a')](_0x5ce75c[_0x0ead('0x45')][_0x0ead('0x4a')]));_0x5eecb2[_0x0ead('0x49')]=_0x5eecb2[_0x0ead('0x49')][_0x0ead('0x4b')]?_0x5eecb2[_0x0ead('0x49')]:_0x42852a[_0x0ead('0x44')];_0x5eecb2[_0x0ead('0x4e')]=qs[_0x0ead('0x4f')](_0x5ce75c[_0x0ead('0x45')][_0x0ead('0x4f')]);_0x5eecb2[_0x0ead('0x51')]=qs[_0x0ead('0x47')](_[_0x0ead('0x50')](_0x5ce75c[_0x0ead('0x45')],_0x42852a['filters']));if(_0x5ce75c[_0x0ead('0x45')][_0x0ead('0x54')]){_0x5eecb2['where']=_[_0x0ead('0x52')](_0x5eecb2[_0x0ead('0x51')],{'$or':_[_0x0ead('0x3e')](_0x5eecb2['attributes'],function(_0x453229){var _0x2e1903={};_0x2e1903[_0x453229]={'$like':'%'+_0x5ce75c[_0x0ead('0x45')]['filter']+'%'};return _0x2e1903;})});}_0x5eecb2=_[_0x0ead('0x52')]({},_0x5eecb2,_0x5ce75c['options']);return _0x3cc75c[_0x0ead('0x84')](_0x5eecb2);}})[_0x0ead('0x21')](function(_0x77f09a){if(_0x77f09a){_0x3d11d2=_0x77f09a['length'];if(!_0x5ce75c[_0x0ead('0x45')][_0x0ead('0x4c')](_0x0ead('0x4d'))){_0x5eecb2[_0x0ead('0x32')]=qs[_0x0ead('0x32')](_0x5ce75c[_0x0ead('0x45')][_0x0ead('0x32')]);_0x5eecb2[_0x0ead('0x30')]=qs[_0x0ead('0x30')](_0x5ce75c[_0x0ead('0x45')][_0x0ead('0x30')]);}return _0x3cc75c['getApplications'](_0x5eecb2);}})[_0x0ead('0x21')](function(_0x119a26){if(_0x119a26){return _0x119a26?{'count':_0x3d11d2,'rows':_0x119a26}:null;}})[_0x0ead('0x21')](respondWithResult(_0x4284bd,null))['catch'](handleError(_0x4284bd,null));};exports[_0x0ead('0x85')]=function(_0x5b2a00,_0x2a8fe2,_0x433d55){var _0x20abac={'channel':_0x0ead('0x86')};var _0x5b06bf=[];var _0x390c48=[];var _0x169025={};return db['WhatsappAccount'][_0x0ead('0x5c')]({'where':{'id':_0x5b2a00['params']['id']},'include':[{'model':db[_0x0ead('0x7f')],'as':_0x0ead('0x87')}]})[_0x0ead('0x21')](handleEntityNotFound(_0x2a8fe2,null))[_0x0ead('0x21')](function(_0x4bc1ae){_0x20abac['account']=_0x4bc1ae;if(_0x20abac[_0x0ead('0x88')]&&_0x20abac['account']['type']==='sinch'&&_0x5b2a00[_0x0ead('0x5e')][_0x0ead('0x89')]){if(_0x5b2a00[_0x0ead('0x5e')][_0x0ead('0x89')][_0x0ead('0x4b')]===0x0)return;if(_0x5b2a00[_0x0ead('0x5e')][_0x0ead('0x89')][0x0][_0x0ead('0x8a')]!=='read')return;return db[_0x0ead('0x8b')][_0x0ead('0x37')]({'read':!![],'readAt':_0x5b2a00[_0x0ead('0x5e')]['statuses'][0x0][_0x0ead('0x8c')]},{'where':{'messageId':_0x5b2a00[_0x0ead('0x5e')][_0x0ead('0x89')][0x0][_0x0ead('0x8d')]},'individualHooks':!![]})['then'](function(_0x3eb706){return _0x2a8fe2[_0x0ead('0x2d')](0xc8)['json'](_0x3eb706);});}_0x20abac[_0x0ead('0x8e')]=_[_0x0ead('0x8f')](_0x4bc1ae[_0x0ead('0x87')],[_0x0ead('0x82')],[_0x0ead('0x90')]);if(_0x20abac['account'][_0x0ead('0x87')]){delete _0x20abac['account'][_0x0ead('0x87')];}return db['CmContact'][_0x0ead('0x66')]()[_0x0ead('0x21')](function(_0x59adc1){if(!_0x59adc1){throw new db[(_0x0ead('0x91'))][(_0x0ead('0x92'))](_0x0ead('0x93'));}_0x5b06bf=_[_0x0ead('0x94')](_[_0x0ead('0x46')](_0x59adc1),[_0x0ead('0x95'),_0x0ead('0x96')]);_0x390c48=_[_0x0ead('0x94')](_[_0x0ead('0x46')](_0x59adc1),[_0x0ead('0x95'),_0x0ead('0x96'),_0x0ead('0x97'),'ListId']);_0x20abac[_0x0ead('0x5e')]={'mapKey':_0x0ead('0x98')};if(_0x20abac['account']&&_0x20abac[_0x0ead('0x88')]['type']==='twilio'){_0x20abac[_0x0ead('0x5e')][_0x0ead('0x99')]=_0x5b2a00['body']['From'][_0x0ead('0x9a')](_0x0ead('0x9b'),'');_0x20abac['body']['body']=_0x5b2a00['body'][_0x0ead('0x9c')];_0x20abac['body'][_0x0ead('0x9d')]=_0x5b2a00[_0x0ead('0x5e')]['MessageSid'];}if(_0x20abac['account']&&_0x20abac['account']['type']===_0x0ead('0x9e')){_0x20abac[_0x0ead('0x5e')][_0x0ead('0x99')]=_0x5b2a00[_0x0ead('0x5e')][_0x0ead('0x9f')][0x0]['from'];_0x20abac[_0x0ead('0x5e')][_0x0ead('0x5e')]=_0x5b2a00[_0x0ead('0x5e')]['notifications'][0x0][_0x0ead('0x29')][_0x0ead('0x5e')];_0x20abac[_0x0ead('0x5e')][_0x0ead('0x9d')]=_0x5b2a00[_0x0ead('0x5e')]['notifications'][0x0][_0x0ead('0x8d')];}if(_0x20abac['body']['id']){delete _0x20abac[_0x0ead('0x5e')]['id'];}if(_[_0x0ead('0xa0')](_0x20abac[_0x0ead('0x5e')]['from'])){throw new db[(_0x0ead('0x91'))][(_0x0ead('0x92'))](_0x0ead('0xa1'));}if(_['isNil'](_0x20abac[_0x0ead('0x5e')][_0x0ead('0x5e')])||_0x20abac['body'][_0x0ead('0x5e')]===''){throw new db[(_0x0ead('0x91'))][(_0x0ead('0x92'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x0ead('0xa0')](_0x20abac['body']['mapKey'])){throw new db['Sequelize'][(_0x0ead('0x92'))](_0x0ead('0xa2')+_0x390c48);}if(!_[_0x0ead('0xa3')](_0x390c48,_0x20abac['body'][_0x0ead('0xa4')])){throw new db[(_0x0ead('0x91'))][(_0x0ead('0x92'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x390c48);}_0x169025[_0x20abac[_0x0ead('0x5e')][_0x0ead('0xa4')]]=_0x20abac[_0x0ead('0x5e')][_0x0ead('0x99')];return db['CmList']['find']({'where':{'id':_0x20abac[_0x0ead('0x88')][_0x0ead('0xa5')]},'include':[{'model':db[_0x0ead('0xa6')],'as':_0x0ead('0xa7'),'where':_0x169025,'limit':0x1,'order':[[_0x0ead('0x96'),_0x0ead('0xa8')]]}]});})[_0x0ead('0x21')](handleEntityNotFound(_0x2a8fe2,null))['then'](function(_0xc0d195){if(_0xc0d195){_0x20abac['list']=_['omit'](_0xc0d195,[_0x0ead('0xa7')]);if(_0xc0d195[_0x0ead('0xa7')][_0x0ead('0x4b')]){return _0xc0d195[_0x0ead('0xa7')][0x0];}var _0x242a79=_[_0x0ead('0xa9')](_0x20abac[_0x0ead('0x5e')],{'firstName':_0x20abac[_0x0ead('0x5e')][_0x0ead('0x99')],'ListId':_0xc0d195['id']});_0x242a79[_0x20abac[_0x0ead('0x5e')]['mapKey']]=_0x20abac['body'][_0x0ead('0x99')];return db[_0x0ead('0xa6')][_0x0ead('0x5d')](_0x242a79,{'fields':_0x5b06bf,'raw':!![]});}})[_0x0ead('0x21')](handleEntityNotFound(_0x2a8fe2,null))[_0x0ead('0x21')](function(_0x2279e0){if(_0x2279e0){_0x20abac['contact']=_0x2279e0;var _0x287855={'ContactId':_0x2279e0['id'],'phone':_0x20abac[_0x0ead('0x5e')]['from'],'WhatsappAccountId':_0x5b2a00[_0x0ead('0x64')]['id']};var _0x2c72c7={'ContactId':_0x2279e0['id'],'WhatsappAccountId':_0x5b2a00['params']['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0x2c72c7})[_0x0ead('0x21')](function(_0x3d9706){if(_0x3d9706){return[_0x3d9706,![]];}return db['WhatsappInteraction']['create'](_0x287855)[_0x0ead('0x21')](function(_0x1c71fb){return[_0x1c71fb,!![]];});});}})[_0x0ead('0x72')](function(_0x456bf5,_0x5209a6){_0x20abac[_0x0ead('0xaa')]=_0x456bf5[_0x0ead('0x38')]({'plain':!![]});_0x20abac['interaction']['created']=![];if(_0x5209a6){if(_0x20abac[_0x0ead('0x88')][_0x0ead('0xab')]){_0x20abac[_0x0ead('0x8e')][_0x0ead('0xac')]({'id':0x0,'priority':_0x20abac[_0x0ead('0x8e')][_0x0ead('0x4b')]+0x1,'app':_0x0ead('0xad'),'appdata':_0x0ead('0xae'),'interval':_0x0ead('0xaf')});}_0x20abac[_0x0ead('0xaa')][_0x0ead('0xb0')]=!![];}return db[_0x0ead('0x8b')][_0x0ead('0x5d')]({'phone':_0x20abac[_0x0ead('0x5e')][_0x0ead('0x99')],'messageId':_0x20abac[_0x0ead('0x5e')]['messageId'],'body':_0x20abac[_0x0ead('0x5e')][_0x0ead('0x5e')],'WhatsappAccountId':_0x5b2a00[_0x0ead('0x64')]['id'],'WhatsappInteractionId':_0x456bf5['id'],'direction':'in','ContactId':_0x456bf5[_0x0ead('0xb1')],'AttachmentId':_0x20abac[_0x0ead('0x5e')]['AttachmentId']});})[_0x0ead('0x21')](function(_0x510a2f){_0x20abac[_0x0ead('0x29')]=_0x510a2f;if(_0x20abac[_0x0ead('0xaa')][_0x0ead('0xb2')]){return db['User'][_0x0ead('0x5c')]({'attributes':['id',_0x0ead('0x3b')],'where':{'id':_0x20abac['interaction']['UserId']}})['then'](function(_0x6b0da6){if(_0x6b0da6){_0x20abac[_0x0ead('0x8e')][_0x0ead('0xb3')]({'id':0x0,'priority':0x0,'app':_0x0ead('0xb4'),'appdata':_0x6b0da6[_0x0ead('0x3b')]+','+(_0x20abac[_0x0ead('0x88')][_0x0ead('0xb5')]||0xa),'interval':_0x0ead('0xaf')});}return respondWithRpcPromise(_0x0ead('0xb6'),_0x0ead('0xb7'),_0x20abac);});}return respondWithRpcPromise(_0x0ead('0xb6'),_0x0ead('0xb7'),_0x20abac);})[_0x0ead('0x21')](function(_0x286778){if(_0x286778){var _0x3f6909=0xc8;var _0x28da60='receiveMessage';logger[_0x0ead('0x22')](_0x0ead('0xb8'),_0x28da60,_0x3f6909,_0x0ead('0xb9'));logger['debug'](_0x0ead('0xba'),_0x28da60,_0x3f6909,_0x0ead('0xb9'),JSON['stringify'](_0x286778));if(_0x20abac[_0x0ead('0x88')][_0x0ead('0x42')]===_0x0ead('0xbb')){return _0x2a8fe2[_0x0ead('0x2d')](_0x3f6909)[_0x0ead('0x34')]('Content-Type',_0x0ead('0xbc'))['send']('\x0a');}else{return _0x2a8fe2[_0x0ead('0x2d')](_0x3f6909)[_0x0ead('0x2f')](_0x286778);}}});})[_0x0ead('0x2b')](handleError(_0x2a8fe2,null));};exports[_0x0ead('0x3c')]=function(_0x107e1b,_0x10fc4e,_0x47799b){var _0x5709c5,_0x2ea6ff,_0x491291;if(_[_0x0ead('0xa0')](_0x107e1b[_0x0ead('0x5e')][_0x0ead('0x5e')])||_0x107e1b[_0x0ead('0x5e')][_0x0ead('0x5e')]===''){throw new db[(_0x0ead('0x91'))][(_0x0ead('0x92'))](_0x0ead('0xbd'));}if(_[_0x0ead('0xa0')](_0x107e1b[_0x0ead('0x5e')]['to'])){throw new db[(_0x0ead('0x91'))][(_0x0ead('0x92'))]('to\x20is\x20mandatory');}_0x5709c5=_0x107e1b[_0x0ead('0x5e')]['to'];return db[_0x0ead('0x3f')]['find']({'where':{'id':_0x107e1b['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x0ead('0xa6')],'as':'Contacts','where':{'mobile':_0x5709c5},'limit':0x1,'order':[['updatedAt',_0x0ead('0xa8')]]}]}]})['then'](handleEntityNotFound(_0x10fc4e,null))[_0x0ead('0x21')](function(_0x2e8362){if(_0x2e8362&&_0x2e8362['List']){_0x2ea6ff=_0x2e8362[_0x0ead('0x38')]({'plain':!![]});if(_0x2ea6ff[_0x0ead('0xbe')]&&_0x2ea6ff['List'][_0x0ead('0xa7')][_0x0ead('0x4b')]){return _0x2ea6ff[_0x0ead('0xbe')][_0x0ead('0xa7')][0x0];}return db[_0x0ead('0xa6')][_0x0ead('0x5d')](_['defaults'](_0x107e1b['body'],{'firstName':_0x5709c5,'mobile':_0x5709c5,'phone':_0x5709c5,'ListId':_0x2ea6ff['ListId']}));}})[_0x0ead('0x21')](handleEntityNotFound(_0x10fc4e,null))[_0x0ead('0x21')](function(_0x307e0c){if(_0x307e0c){_0x491291=_0x307e0c;return db[_0x0ead('0xbf')]['find']({'where':{'ContactId':_0x491291['id'],'closed':![],'WhatsappAccountId':_0x2ea6ff['id']}})[_0x0ead('0x21')](function(_0x3bfb14){if(_0x3bfb14){return[_0x3bfb14,![]];}return db['WhatsappInteraction'][_0x0ead('0x5d')]({'UserId':_0x107e1b[_0x0ead('0x5f')]['id'],'ContactId':_0x491291['id'],'WhatsappAccountId':_0x2ea6ff['id'],'phone':_0x5709c5,'firstMsgDirection':_0x0ead('0xc0'),'Messages':[_[_0x0ead('0x52')](_0x107e1b[_0x0ead('0x5e')],{'read':![],'body':_0x107e1b[_0x0ead('0x5e')][_0x0ead('0x5e')],'phone':_0x5709c5,'WhatsappAccountId':_0x2ea6ff['id'],'UserId':_0x107e1b['user']['id'],'ContactId':_0x491291['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x0ead('0xc1')}]})['then'](function(_0x37b4ad){return[_0x37b4ad,!![]];});});}})['spread'](function(_0x25e048,_0x6d6bb1){if(_0x6d6bb1){return _0x25e048;}return db[_0x0ead('0x8b')][_0x0ead('0x5d')](_[_0x0ead('0x52')](_0x107e1b[_0x0ead('0x5e')],{'read':![],'body':_0x107e1b[_0x0ead('0x5e')][_0x0ead('0x5e')],'phone':_0x5709c5,'WhatsappAccountId':_0x2ea6ff['id'],'WhatsappInteractionId':_0x25e048['id'],'UserId':_0x107e1b['user']['id'],'ContactId':_0x491291['id']}))[_0x0ead('0x21')](function(_0x44ec7f){_0x25e048['dataValues'][_0x0ead('0xc1')]=[];_0x25e048['dataValues']['Messages'][_0x0ead('0xac')](_0x44ec7f['dataValues']);return _0x25e048;});})[_0x0ead('0x21')](respondWithResult(_0x10fc4e,null))[_0x0ead('0x2b')](handleError(_0x10fc4e,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index b1892cd..50cb94b 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 _0x06e8=['remove','emit','hook','exports','events','WhatsappAccount','setMaxListeners','save','update'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x06e8,0x12d));var _0x806e=function(_0x406217,_0x2d7ea9){_0x406217=_0x406217-0x0;var _0x967426=_0x06e8[_0x406217];return _0x967426;};'use strict';var EventEmitter=require(_0x806e('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0x806e('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x806e('0x2')](0x0);var events={'afterCreate':_0x806e('0x3'),'afterUpdate':_0x806e('0x4'),'afterDestroy':_0x806e('0x5')};function emitEvent(_0x7b3a5c){return function(_0x3dda93,_0x37128e,_0xb9138a){WhatsappAccountEvents['emit'](_0x7b3a5c+':'+_0x3dda93['id'],_0x3dda93);WhatsappAccountEvents[_0x806e('0x6')](_0x7b3a5c,_0x3dda93);_0xb9138a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x806e('0x7')](e,emitEvent(event));}}module[_0x806e('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0x97b6=['save','remove','emit','hook','events','../../mysqldb','WhatsappAccount','setMaxListeners'];(function(_0x1e11c2,_0x1bcbca){var _0x4faa44=function(_0x4c3bf3){while(--_0x4c3bf3){_0x1e11c2['push'](_0x1e11c2['shift']());}};_0x4faa44(++_0x1bcbca);}(_0x97b6,0x1e4));var _0x697b=function(_0x3f4568,_0x9eb0ee){_0x3f4568=_0x3f4568-0x0;var _0xee2340=_0x97b6[_0x3f4568];return _0xee2340;};'use strict';var EventEmitter=require(_0x697b('0x0'));var WhatsappAccount=require(_0x697b('0x1'))['db'][_0x697b('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x697b('0x3')](0x0);var events={'afterCreate':_0x697b('0x4'),'afterUpdate':'update','afterDestroy':_0x697b('0x5')};function emitEvent(_0x51cbf7){return function(_0x2d6a24,_0x158d8e,_0x423422){WhatsappAccountEvents[_0x697b('0x6')](_0x51cbf7+':'+_0x2d6a24['id'],_0x2d6a24);WhatsappAccountEvents[_0x697b('0x6')](_0x51cbf7,_0x2d6a24);_0x423422(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x697b('0x7')](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 0538180..0cafa45 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 _0xafcb=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./whatsappAccount.attributes','exports','WhatsappAccount','whatsapp_accounts'];(function(_0x4a235c,_0x3c1c67){var _0x2bf0c8=function(_0x1b990c){while(--_0x1b990c){_0x4a235c['push'](_0x4a235c['shift']());}};_0x2bf0c8(++_0x3c1c67);}(_0xafcb,0x15e));var _0xbafc=function(_0x2a03ac,_0x23e891){_0x2a03ac=_0x2a03ac-0x0;var _0x1cc7b8=_0xafcb[_0x2a03ac];return _0x1cc7b8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbafc('0x0'))(_0xbafc('0x1'));var moment=require(_0xbafc('0x2'));var BPromise=require(_0xbafc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbafc('0x4'));var config=require(_0xbafc('0x5'));var attributes=require(_0xbafc('0x6'));module[_0xbafc('0x7')]=function(_0x27630e,_0x3918d2){return _0x27630e['define'](_0xbafc('0x8'),attributes,{'tableName':_0xbafc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa8fd=['request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','lodash','../../config/logger','api','moment','bluebird'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa8fd,0x1c9));var _0xda8f=function(_0x1f41bc,_0x1e5d00){_0x1f41bc=_0x1f41bc-0x0;var _0x492c61=_0xa8fd[_0x1f41bc];return _0x492c61;};'use strict';var _=require(_0xda8f('0x0'));var util=require('util');var logger=require(_0xda8f('0x1'))(_0xda8f('0x2'));var moment=require(_0xda8f('0x3'));var BPromise=require(_0xda8f('0x4'));var rp=require(_0xda8f('0x5'));var fs=require('fs');var path=require(_0xda8f('0x6'));var rimraf=require(_0xda8f('0x7'));var config=require(_0xda8f('0x8'));var attributes=require(_0xda8f('0x9'));module[_0xda8f('0xa')]=function(_0x569085,_0x3675b3){return _0x569085['define']('WhatsappAccount',attributes,{'tableName':'whatsapp_accounts','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 d151283..9fb116d 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 _0x781e=['model','debug','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where','attributes','map'];(function(_0x4612df,_0x37a8f7){var _0x2804c6=function(_0x2b1979){while(--_0x2b1979){_0x4612df['push'](_0x4612df['shift']());}};_0x2804c6(++_0x37a8f7);}(_0x781e,0xda));var _0xe781=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x781e[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xe781('0x0'));var util=require(_0xe781('0x1'));var moment=require('moment');var BPromise=require(_0xe781('0x2'));var rs=require(_0xe781('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe781('0x4'))['db'];var utils=require(_0xe781('0x5'));var logger=require('../../config/logger')(_0xe781('0x6'));var config=require(_0xe781('0x7'));var jayson=require(_0xe781('0x8'));var client=jayson[_0xe781('0x9')][_0xe781('0xa')]({'port':0x232a});config['redis']=_[_0xe781('0xb')](config[_0xe781('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xe781('0xd'))(new Redis(config[_0xe781('0xc')]));require('./whatsappAccount.socket')[_0xe781('0xe')](socket);function respondWithRpcPromise(_0x1c3fe0,_0x453c04,_0x3bd40b){return new BPromise(function(_0x2485c8,_0x3fac34){return client[_0xe781('0xf')](_0x1c3fe0,_0x3bd40b)[_0xe781('0x10')](function(_0x5b7c5d){logger[_0xe781('0x11')](_0xe781('0x12'),_0x453c04,'request\x20sent');logger['debug'](_0xe781('0x13'),_0x453c04,_0xe781('0x14'),JSON[_0xe781('0x15')](_0x5b7c5d));if(_0x5b7c5d[_0xe781('0x16')]){if(_0x5b7c5d[_0xe781('0x16')][_0xe781('0x17')]===0x1f4){logger['error'](_0xe781('0x12'),_0x453c04,_0x5b7c5d['error']['message']);return _0x3fac34(_0x5b7c5d[_0xe781('0x16')][_0xe781('0x18')]);}logger[_0xe781('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x453c04,_0x5b7c5d['error'][_0xe781('0x18')]);return _0x2485c8(_0x5b7c5d[_0xe781('0x16')][_0xe781('0x18')]);}else{logger[_0xe781('0x11')](_0xe781('0x12'),_0x453c04,_0xe781('0x14'));_0x2485c8(_0x5b7c5d[_0xe781('0x19')][_0xe781('0x18')]);}})[_0xe781('0x1a')](function(_0x47c98e){logger[_0xe781('0x16')](_0xe781('0x12'),_0x453c04,_0x47c98e);_0x3fac34(_0x47c98e);});});}exports[_0xe781('0x1b')]=function(_0x3f7269){var _0x170ad3=this;return new Promise(function(_0x406503,_0x19e1ed){return db[_0xe781('0x1c')][_0xe781('0x1d')]({'raw':_0x3f7269['options']?_0x3f7269[_0xe781('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x3f7269['options']?_0x3f7269[_0xe781('0x1e')][_0xe781('0x1f')]||null:null,'attributes':_0x3f7269[_0xe781('0x1e')]?_0x3f7269[_0xe781('0x1e')][_0xe781('0x20')]||null:null,'include':_0x3f7269[_0xe781('0x1e')]?_0x3f7269['options']['include']?_[_0xe781('0x21')](_0x3f7269[_0xe781('0x1e')]['include'],function(_0x10b57a){return{'model':db[_0x10b57a[_0xe781('0x22')]],'as':_0x10b57a['as'],'attributes':_0x10b57a[_0xe781('0x20')],'include':_0x10b57a['include']?_[_0xe781('0x21')](_0x10b57a['include'],function(_0x5ea9b8){return{'model':db[_0x5ea9b8['model']],'as':_0x5ea9b8['as'],'attributes':_0x5ea9b8[_0xe781('0x20')],'include':_0x5ea9b8['include']?_[_0xe781('0x21')](_0x5ea9b8['include'],function(_0x188a44){return{'model':db[_0x188a44[_0xe781('0x22')]],'as':_0x188a44['as'],'attributes':_0x188a44['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5f13f8){logger[_0xe781('0x11')](_0xe781('0x1b'),_0x3f7269);logger[_0xe781('0x23')](_0xe781('0x1b'),_0x3f7269,JSON['stringify'](_0x5f13f8));_0x406503(_0x5f13f8);})['catch'](function(_0x366f6f){logger[_0xe781('0x16')](_0xe781('0x1b'),_0x366f6f['message'],_0x3f7269);_0x19e1ed(_0x170ad3[_0xe781('0x16')](0x1f4,_0x366f6f[_0xe781('0x18')]));});});}; \ No newline at end of file +var _0x036e=['attributes','include','map','model','then','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappAccount.socket','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where'];(function(_0x208af5,_0x1b1b24){var _0xe45b18=function(_0x35d0ad){while(--_0x35d0ad){_0x208af5['push'](_0x208af5['shift']());}};_0xe45b18(++_0x1b1b24);}(_0x036e,0x182));var _0xe036=function(_0x1c57ec,_0x4891b2){_0x1c57ec=_0x1c57ec-0x0;var _0x5beb4d=_0x036e[_0x1c57ec];return _0x5beb4d;};'use strict';var _=require(_0xe036('0x0'));var util=require(_0xe036('0x1'));var moment=require('moment');var BPromise=require(_0xe036('0x2'));var rs=require(_0xe036('0x3'));var fs=require('fs');var Redis=require(_0xe036('0x4'));var db=require(_0xe036('0x5'))['db'];var utils=require(_0xe036('0x6'));var logger=require('../../config/logger')(_0xe036('0x7'));var config=require(_0xe036('0x8'));var jayson=require(_0xe036('0x9'));var client=jayson[_0xe036('0xa')][_0xe036('0xb')]({'port':0x232a});config[_0xe036('0xc')]=_['defaults'](config[_0xe036('0xc')],{'host':_0xe036('0xd'),'port':0x18eb});var socket=require(_0xe036('0xe'))(new Redis(config['redis']));require(_0xe036('0xf'))['register'](socket);function respondWithRpcPromise(_0x264aba,_0x39eba9,_0x4b1a4f){return new BPromise(function(_0x5c6201,_0x3773cc){return client[_0xe036('0x10')](_0x264aba,_0x4b1a4f)['then'](function(_0x463a61){logger[_0xe036('0x11')](_0xe036('0x12'),_0x39eba9,_0xe036('0x13'));logger[_0xe036('0x14')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x39eba9,_0xe036('0x13'),JSON['stringify'](_0x463a61));if(_0x463a61[_0xe036('0x15')]){if(_0x463a61[_0xe036('0x15')][_0xe036('0x16')]===0x1f4){logger[_0xe036('0x15')](_0xe036('0x12'),_0x39eba9,_0x463a61[_0xe036('0x15')][_0xe036('0x17')]);return _0x3773cc(_0x463a61['error'][_0xe036('0x17')]);}logger[_0xe036('0x15')](_0xe036('0x12'),_0x39eba9,_0x463a61[_0xe036('0x15')][_0xe036('0x17')]);return _0x5c6201(_0x463a61[_0xe036('0x15')][_0xe036('0x17')]);}else{logger[_0xe036('0x11')](_0xe036('0x12'),_0x39eba9,_0xe036('0x13'));_0x5c6201(_0x463a61[_0xe036('0x18')][_0xe036('0x17')]);}})[_0xe036('0x19')](function(_0x506ba0){logger[_0xe036('0x15')](_0xe036('0x12'),_0x39eba9,_0x506ba0);_0x3773cc(_0x506ba0);});});}exports[_0xe036('0x1a')]=function(_0x2df1ca){var _0x2622b7=this;return new Promise(function(_0x59d84a,_0x28a292){return db[_0xe036('0x1b')][_0xe036('0x1c')]({'raw':_0x2df1ca[_0xe036('0x1d')]?_0x2df1ca[_0xe036('0x1d')][_0xe036('0x1e')]===undefined?!![]:![]:!![],'where':_0x2df1ca[_0xe036('0x1d')]?_0x2df1ca[_0xe036('0x1d')][_0xe036('0x1f')]||null:null,'attributes':_0x2df1ca[_0xe036('0x1d')]?_0x2df1ca['options'][_0xe036('0x20')]||null:null,'include':_0x2df1ca[_0xe036('0x1d')]?_0x2df1ca['options'][_0xe036('0x21')]?_[_0xe036('0x22')](_0x2df1ca[_0xe036('0x1d')][_0xe036('0x21')],function(_0x5457ec){return{'model':db[_0x5457ec[_0xe036('0x23')]],'as':_0x5457ec['as'],'attributes':_0x5457ec[_0xe036('0x20')],'include':_0x5457ec[_0xe036('0x21')]?_[_0xe036('0x22')](_0x5457ec[_0xe036('0x21')],function(_0x32cc24){return{'model':db[_0x32cc24[_0xe036('0x23')]],'as':_0x32cc24['as'],'attributes':_0x32cc24[_0xe036('0x20')],'include':_0x32cc24['include']?_[_0xe036('0x22')](_0x32cc24[_0xe036('0x21')],function(_0x386d9f){return{'model':db[_0x386d9f['model']],'as':_0x386d9f['as'],'attributes':_0x386d9f[_0xe036('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe036('0x24')](function(_0x277653){logger['info'](_0xe036('0x1a'),_0x2df1ca);logger[_0xe036('0x14')](_0xe036('0x1a'),_0x2df1ca,JSON[_0xe036('0x25')](_0x277653));_0x59d84a(_0x277653);})[_0xe036('0x19')](function(_0x3cd833){logger[_0xe036('0x15')](_0xe036('0x1a'),_0x3cd833[_0xe036('0x17')],_0x2df1ca);_0x28a292(_0x2622b7['error'](0x1f4,_0x3cd833[_0xe036('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 1b8ae91..d9ead80 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 _0x86ec=['remove','update','emit','removeListener','register','length','whatsappAccount:','./whatsappAccount.events','save'];(function(_0x5e2ac5,_0x1b7100){var _0x12c88f=function(_0x5b83cf){while(--_0x5b83cf){_0x5e2ac5['push'](_0x5e2ac5['shift']());}};_0x12c88f(++_0x1b7100);}(_0x86ec,0x166));var _0xc86e=function(_0x87af8b,_0x168845){_0x87af8b=_0x87af8b-0x0;var _0xf9a7c9=_0x86ec[_0x87af8b];return _0xf9a7c9;};'use strict';var WhatsappAccountEvents=require(_0xc86e('0x0'));var events=[_0xc86e('0x1'),_0xc86e('0x2'),_0xc86e('0x3')];function createListener(_0xe2102d,_0x5a79e2){return function(_0x36b758){_0x5a79e2[_0xc86e('0x4')](_0xe2102d,_0x36b758);};}function removeListener(_0x2fe609,_0x1bef28){return function(){WhatsappAccountEvents[_0xc86e('0x5')](_0x2fe609,_0x1bef28);};}exports[_0xc86e('0x6')]=function(_0x13be2f){for(var _0x458a3d=0x0,_0x55dd28=events[_0xc86e('0x7')];_0x458a3d<_0x55dd28;_0x458a3d++){var _0x12e1fa=events[_0x458a3d];var _0x427a57=createListener(_0xc86e('0x8')+_0x12e1fa,_0x13be2f);WhatsappAccountEvents['on'](_0x12e1fa,_0x427a57);}}; \ No newline at end of file +var _0x2196=['save','remove','update','emit','removeListener','register','length','./whatsappAccount.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2196,0xb7));var _0x6219=function(_0x52c8e1,_0x596b96){_0x52c8e1=_0x52c8e1-0x0;var _0x4d3a7f=_0x2196[_0x52c8e1];return _0x4d3a7f;};'use strict';var WhatsappAccountEvents=require(_0x6219('0x0'));var events=[_0x6219('0x1'),_0x6219('0x2'),_0x6219('0x3')];function createListener(_0xf3d61a,_0x2ee8fc){return function(_0x2db52c){_0x2ee8fc[_0x6219('0x4')](_0xf3d61a,_0x2db52c);};}function removeListener(_0x3e1253,_0xaf3d97){return function(){WhatsappAccountEvents[_0x6219('0x5')](_0x3e1253,_0xaf3d97);};}exports[_0x6219('0x6')]=function(_0x28291e){for(var _0x5ca123=0x0,_0x56e51c=events[_0x6219('0x7')];_0x5ca123<_0x56e51c;_0x5ca123++){var _0x34e648=events[_0x5ca123];var _0x2b12eb=createListener('whatsappAccount:'+_0x34e648,_0x28291e);WhatsappAccountEvents['on'](_0x34e648,_0x2b12eb);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index f02e42c..00a91ab 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 _0xcaaf=['update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','isAuthenticated','index','get','/:id','show','put'];(function(_0x1d7d0c,_0x3ef4fd){var _0x18705d=function(_0x1d7049){while(--_0x1d7049){_0x1d7d0c['push'](_0x1d7d0c['shift']());}};_0x18705d(++_0x3ef4fd);}(_0xcaaf,0x1b4));var _0xfcaa=function(_0x3931ec,_0x497c29){_0x3931ec=_0x3931ec-0x0;var _0x24d5b1=_0xcaaf[_0x3931ec];return _0x24d5b1;};'use strict';var multer=require(_0xfcaa('0x0'));var util=require(_0xfcaa('0x1'));var path=require(_0xfcaa('0x2'));var timeout=require('connect-timeout');var express=require(_0xfcaa('0x3'));var router=express[_0xfcaa('0x4')]();var fs_extra=require(_0xfcaa('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappApplication.controller');router['get']('/',auth[_0xfcaa('0x6')](),controller[_0xfcaa('0x7')]);router[_0xfcaa('0x8')](_0xfcaa('0x9'),auth['isAuthenticated'](),controller[_0xfcaa('0xa')]);router['post']('/',auth[_0xfcaa('0x6')](),controller['create']);router[_0xfcaa('0xb')](_0xfcaa('0x9'),auth[_0xfcaa('0x6')](),controller[_0xfcaa('0xc')]);router[_0xfcaa('0xd')](_0xfcaa('0x9'),auth[_0xfcaa('0x6')](),controller[_0xfcaa('0xe')]);module[_0xfcaa('0xf')]=router; \ No newline at end of file +var _0xb3a7=['isAuthenticated','index','show','post','create','delete','/:id','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get'];(function(_0x5c418a,_0x5392ac){var _0x20f968=function(_0x4891b9){while(--_0x4891b9){_0x5c418a['push'](_0x5c418a['shift']());}};_0x20f968(++_0x5392ac);}(_0xb3a7,0x1d1));var _0x7b3a=function(_0x3dee4d,_0x48f262){_0x3dee4d=_0x3dee4d-0x0;var _0x23c10d=_0xb3a7[_0x3dee4d];return _0x23c10d;};'use strict';var multer=require(_0x7b3a('0x0'));var util=require(_0x7b3a('0x1'));var path=require('path');var timeout=require(_0x7b3a('0x2'));var express=require(_0x7b3a('0x3'));var router=express['Router']();var fs_extra=require(_0x7b3a('0x4'));var auth=require(_0x7b3a('0x5'));var interaction=require(_0x7b3a('0x6'));var config=require(_0x7b3a('0x7'));var controller=require(_0x7b3a('0x8'));router[_0x7b3a('0x9')]('/',auth[_0x7b3a('0xa')](),controller[_0x7b3a('0xb')]);router['get']('/:id',auth[_0x7b3a('0xa')](),controller[_0x7b3a('0xc')]);router[_0x7b3a('0xd')]('/',auth[_0x7b3a('0xa')](),controller[_0x7b3a('0xe')]);router['put']('/:id',auth[_0x7b3a('0xa')](),controller['update']);router[_0x7b3a('0xf')](_0x7b3a('0x10'),auth['isAuthenticated'](),controller[_0x7b3a('0x11')]);module[_0x7b3a('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 37b2268..68bb36a 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 _0xb0e3=['sequelize','INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x2a0eb,_0x5417f7){var _0x38a255=function(_0x1b79d1){while(--_0x1b79d1){_0x2a0eb['push'](_0x2a0eb['shift']());}};_0x38a255(++_0x5417f7);}(_0xb0e3,0x18c));var _0x3b0e=function(_0x5b1a83,_0x16c5fd){_0x5b1a83=_0x5b1a83-0x0;var _0x3961f5=_0xb0e3[_0x5b1a83];return _0x3961f5;};'use strict';var Sequelize=require(_0x3b0e('0x0'));module['exports']={'priority':{'type':Sequelize[_0x3b0e('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3b0e('0x2')},'appdata':{'type':Sequelize[_0x3b0e('0x3')]()},'description':{'type':Sequelize[_0x3b0e('0x4')]},'interval':{'type':Sequelize[_0x3b0e('0x4')],'defaultValue':_0x3b0e('0x5')}}; \ No newline at end of file +var _0xd98d=['*,*,*,*','sequelize','STRING','noop','TEXT'];(function(_0x19babc,_0x15ee62){var _0x31ccc8=function(_0x3fc7cd){while(--_0x3fc7cd){_0x19babc['push'](_0x19babc['shift']());}};_0x31ccc8(++_0x15ee62);}(_0xd98d,0x123));var _0xdd98=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd98d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xdd98('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xdd98('0x1')],'allowNull':![],'defaultValue':_0xdd98('0x2')},'appdata':{'type':Sequelize[_0xdd98('0x3')]()},'description':{'type':Sequelize[_0xdd98('0x1')]},'interval':{'type':Sequelize[_0xdd98('0x1')],'defaultValue':_0xdd98('0x4')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 2b4cddb..7783d00 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 _0xba38=['intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','params','includeAll','create','body','find','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','WhatsappApplication','rawAttributes','type','key','model','map','query','keys','filters','attributes'];(function(_0x5676df,_0x14d122){var _0x1fb878=function(_0x84c80a){while(--_0x84c80a){_0x5676df['push'](_0x5676df['shift']());}};_0x1fb878(++_0x14d122);}(_0xba38,0x190));var _0x8ba3=function(_0x227081,_0x19709b){_0x227081=_0x227081-0x0;var _0x9dbe68=_0xba38[_0x227081];return _0x9dbe68;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ba3('0x0'));var zipdir=require(_0x8ba3('0x1'));var jsonpatch=require(_0x8ba3('0x2'));var rp=require('request-promise');var moment=require(_0x8ba3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8ba3('0x4'));var util=require(_0x8ba3('0x5'));var path=require(_0x8ba3('0x6'));var sox=require(_0x8ba3('0x7'));var csv=require(_0x8ba3('0x8'));var ejs=require(_0x8ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x8ba3('0xa'));var _=require(_0x8ba3('0xb'));var squel=require(_0x8ba3('0xc'));var crypto=require(_0x8ba3('0xd'));var jsforce=require(_0x8ba3('0xe'));var deskjs=require(_0x8ba3('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8ba3('0x10'));var Papa=require(_0x8ba3('0x11'));var Redis=require('ioredis');var authService=require(_0x8ba3('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8ba3('0x13'));var hardwareService=require(_0x8ba3('0x14'));var logger=require(_0x8ba3('0x15'))(_0x8ba3('0x16'));var utils=require(_0x8ba3('0x17'));var config=require(_0x8ba3('0x18'));var licenseUtil=require(_0x8ba3('0x19'));var db=require(_0x8ba3('0x1a'))['db'];function respondWithStatusCode(_0x923aa5,_0x5c8f5b){_0x5c8f5b=_0x5c8f5b||0xcc;return function(_0x1abd6e){if(_0x1abd6e){return _0x923aa5[_0x8ba3('0x1b')](_0x5c8f5b);}return _0x923aa5['status'](_0x5c8f5b)[_0x8ba3('0x1c')]();};}function respondWithResult(_0x4ef1d5,_0x859934){_0x859934=_0x859934||0xc8;return function(_0x59764d){if(_0x59764d){return _0x4ef1d5[_0x8ba3('0x1d')](_0x859934)[_0x8ba3('0x1e')](_0x59764d);}};}function respondWithFilteredResult(_0x57f76d,_0x2842b9){return function(_0x417960){if(_0x417960){var _0x48577c=typeof _0x2842b9[_0x8ba3('0x1f')]===_0x8ba3('0x20')&&typeof _0x2842b9['limit']==='undefined';var _0x47020f=_0x417960['count'];var _0x5a8f04=_0x48577c?0x0:_0x2842b9[_0x8ba3('0x1f')];var _0x563d61=_0x48577c?_0x417960['count']:_0x2842b9[_0x8ba3('0x1f')]+_0x2842b9['limit'];var _0x118c50;if(_0x563d61>=_0x47020f){_0x563d61=_0x47020f;_0x118c50=0xc8;}else{_0x118c50=0xce;}_0x57f76d['status'](_0x118c50);return _0x57f76d[_0x8ba3('0x21')](_0x8ba3('0x22'),_0x5a8f04+'-'+_0x563d61+'/'+_0x47020f)[_0x8ba3('0x1e')](_0x417960);}return null;};}function patchUpdates(_0x5bd852){return function(_0x1a8d6b){try{jsonpatch[_0x8ba3('0x23')](_0x1a8d6b,_0x5bd852,!![]);}catch(_0x2f264d){return BPromise[_0x8ba3('0x24')](_0x2f264d);}return _0x1a8d6b[_0x8ba3('0x25')]();};}function saveUpdates(_0x4a3a50,_0x581daa){return function(_0xb15432){if(_0xb15432){return _0xb15432[_0x8ba3('0x26')](_0x4a3a50)[_0x8ba3('0x27')](function(_0x11e3e7){return _0x11e3e7;});}return null;};}function removeEntity(_0x57f037,_0x543021){return function(_0x10f3e2){if(_0x10f3e2){return _0x10f3e2[_0x8ba3('0x28')]()[_0x8ba3('0x27')](function(){_0x57f037[_0x8ba3('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x199ad6,_0x56a391){return function(_0x2f253f){if(!_0x2f253f){_0x199ad6[_0x8ba3('0x1b')](0x194);}return _0x2f253f;};}function handleError(_0x80347a,_0x8b2237){_0x8b2237=_0x8b2237||0x1f4;return function(_0x43e306){logger[_0x8ba3('0x29')](_0x43e306[_0x8ba3('0x2a')]);if(_0x43e306[_0x8ba3('0x2b')]){delete _0x43e306[_0x8ba3('0x2b')];}_0x80347a[_0x8ba3('0x1d')](_0x8b2237)[_0x8ba3('0x2c')](_0x43e306);};}exports[_0x8ba3('0x2d')]=function(_0x16d189,_0x2df77c){var _0x309a89={},_0xee2109={},_0x148aac={'count':0x0,'rows':[]};var _0x4570d3=_['map'](db[_0x8ba3('0x2e')][_0x8ba3('0x2f')],function(_0x4f3b2b){return{'name':_0x4f3b2b['fieldName'],'type':_0x4f3b2b[_0x8ba3('0x30')][_0x8ba3('0x31')]};});_0xee2109[_0x8ba3('0x32')]=_[_0x8ba3('0x33')](_0x4570d3,_0x8ba3('0x2b'));_0xee2109[_0x8ba3('0x34')]=_[_0x8ba3('0x35')](_0x16d189[_0x8ba3('0x34')]);_0xee2109[_0x8ba3('0x36')]=_['intersection'](_0xee2109[_0x8ba3('0x32')],_0xee2109[_0x8ba3('0x34')]);_0x309a89[_0x8ba3('0x37')]=_[_0x8ba3('0x38')](_0xee2109[_0x8ba3('0x32')],qs[_0x8ba3('0x39')](_0x16d189[_0x8ba3('0x34')]['fields']));_0x309a89['attributes']=_0x309a89[_0x8ba3('0x37')][_0x8ba3('0x3a')]?_0x309a89[_0x8ba3('0x37')]:_0xee2109[_0x8ba3('0x32')];if(!_0x16d189['query']['hasOwnProperty'](_0x8ba3('0x3b'))){_0x309a89['limit']=qs['limit'](_0x16d189[_0x8ba3('0x34')]['limit']);_0x309a89[_0x8ba3('0x1f')]=qs[_0x8ba3('0x1f')](_0x16d189['query'][_0x8ba3('0x1f')]);}_0x309a89[_0x8ba3('0x3c')]=qs[_0x8ba3('0x3d')](_0x16d189[_0x8ba3('0x34')][_0x8ba3('0x3d')]);_0x309a89[_0x8ba3('0x3e')]=qs[_0x8ba3('0x36')](_[_0x8ba3('0x3f')](_0x16d189[_0x8ba3('0x34')],_0xee2109[_0x8ba3('0x36')]),_0x4570d3);if(_0x16d189[_0x8ba3('0x34')][_0x8ba3('0x40')]){_0x309a89['where']=_[_0x8ba3('0x41')](_0x309a89[_0x8ba3('0x3e')],{'$or':_[_0x8ba3('0x33')](_0x4570d3,function(_0x2ae0ae){if(_0x2ae0ae[_0x8ba3('0x30')]!==_0x8ba3('0x42')){var _0x3d1b84={};_0x3d1b84[_0x2ae0ae[_0x8ba3('0x2b')]]={'$like':'%'+_0x16d189[_0x8ba3('0x34')][_0x8ba3('0x40')]+'%'};return _0x3d1b84;}})});}_0x309a89=_[_0x8ba3('0x41')]({},_0x309a89,_0x16d189[_0x8ba3('0x43')]);var _0x497d1f={'where':_0x309a89[_0x8ba3('0x3e')]};return db['WhatsappApplication']['count'](_0x497d1f)[_0x8ba3('0x27')](function(_0x47870b){_0x148aac['count']=_0x47870b;if(_0x16d189['query']['includeAll']){_0x309a89[_0x8ba3('0x44')]=[{'all':!![]}];}return db['WhatsappApplication']['findAll'](_0x309a89);})[_0x8ba3('0x27')](function(_0x4883b7){_0x148aac[_0x8ba3('0x45')]=_0x4883b7;return _0x148aac;})[_0x8ba3('0x27')](respondWithFilteredResult(_0x2df77c,_0x309a89))[_0x8ba3('0x46')](handleError(_0x2df77c,null));};exports['show']=function(_0x5d979d,_0x5cb74a){var _0x4f524d={'raw':!![],'where':{'id':_0x5d979d[_0x8ba3('0x47')]['id']}},_0x31f5c8={};_0x31f5c8[_0x8ba3('0x32')]=_['keys'](db[_0x8ba3('0x2e')][_0x8ba3('0x2f')]);_0x31f5c8['query']=_[_0x8ba3('0x35')](_0x5d979d[_0x8ba3('0x34')]);_0x31f5c8[_0x8ba3('0x36')]=_['intersection'](_0x31f5c8[_0x8ba3('0x32')],_0x31f5c8[_0x8ba3('0x34')]);_0x4f524d[_0x8ba3('0x37')]=_['intersection'](_0x31f5c8[_0x8ba3('0x32')],qs['fields'](_0x5d979d[_0x8ba3('0x34')][_0x8ba3('0x39')]));_0x4f524d[_0x8ba3('0x37')]=_0x4f524d[_0x8ba3('0x37')][_0x8ba3('0x3a')]?_0x4f524d['attributes']:_0x31f5c8[_0x8ba3('0x32')];if(_0x5d979d['query'][_0x8ba3('0x48')]){_0x4f524d['include']=[{'all':!![]}];}_0x4f524d=_['merge']({},_0x4f524d,_0x5d979d['options']);return db[_0x8ba3('0x2e')]['find'](_0x4f524d)[_0x8ba3('0x27')](handleEntityNotFound(_0x5cb74a,null))[_0x8ba3('0x27')](respondWithResult(_0x5cb74a,null))[_0x8ba3('0x46')](handleError(_0x5cb74a,null));};exports[_0x8ba3('0x49')]=function(_0x2620cd,_0x211933){return db[_0x8ba3('0x2e')][_0x8ba3('0x49')](_0x2620cd['body'],{})[_0x8ba3('0x27')](respondWithResult(_0x211933,0xc9))[_0x8ba3('0x46')](handleError(_0x211933,null));};exports[_0x8ba3('0x26')]=function(_0x4c5571,_0x5b7671){if(_0x4c5571[_0x8ba3('0x4a')]['id']){delete _0x4c5571[_0x8ba3('0x4a')]['id'];}return db[_0x8ba3('0x2e')][_0x8ba3('0x4b')]({'where':{'id':_0x4c5571['params']['id']}})[_0x8ba3('0x27')](handleEntityNotFound(_0x5b7671,null))[_0x8ba3('0x27')](saveUpdates(_0x4c5571[_0x8ba3('0x4a')],null))['then'](respondWithResult(_0x5b7671,null))[_0x8ba3('0x46')](handleError(_0x5b7671,null));};exports[_0x8ba3('0x28')]=function(_0x30d962,_0x2ab289){return db[_0x8ba3('0x2e')][_0x8ba3('0x4b')]({'where':{'id':_0x30d962[_0x8ba3('0x47')]['id']}})['then'](handleEntityNotFound(_0x2ab289,null))[_0x8ba3('0x27')](removeEntity(_0x2ab289,null))[_0x8ba3('0x46')](handleError(_0x2ab289,null));}; \ No newline at end of file +var _0x6afc=['rows','show','params','rawAttributes','find','catch','create','body','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','send','index','map','WhatsappApplication','type','key','query','intersection','model','attributes','fields','length','nolimit','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','include','findAll'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x6afc,0x16b));var _0xc6af=function(_0x56ea6d,_0x5306ca){_0x56ea6d=_0x56ea6d-0x0;var _0x5f4239=_0x6afc[_0x56ea6d];return _0x5f4239;};'use strict';var emlformat=require(_0xc6af('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc6af('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc6af('0x2'));var moment=require(_0xc6af('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc6af('0x4'));var util=require(_0xc6af('0x5'));var path=require(_0xc6af('0x6'));var sox=require(_0xc6af('0x7'));var csv=require('to-csv');var ejs=require(_0xc6af('0x8'));var fs=require('fs');var fs_extra=require(_0xc6af('0x9'));var _=require(_0xc6af('0xa'));var squel=require(_0xc6af('0xb'));var crypto=require(_0xc6af('0xc'));var jsforce=require(_0xc6af('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc6af('0xe'));var querystring=require(_0xc6af('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc6af('0x10'));var qs=require(_0xc6af('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc6af('0x12'));var logger=require(_0xc6af('0x13'))(_0xc6af('0x14'));var utils=require('../../config/utils');var config=require(_0xc6af('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc6af('0x16'))['db'];function respondWithStatusCode(_0x73a18b,_0x249554){_0x249554=_0x249554||0xcc;return function(_0x34c2f8){if(_0x34c2f8){return _0x73a18b[_0xc6af('0x17')](_0x249554);}return _0x73a18b[_0xc6af('0x18')](_0x249554)[_0xc6af('0x19')]();};}function respondWithResult(_0x2c8d30,_0x48be31){_0x48be31=_0x48be31||0xc8;return function(_0xb2f967){if(_0xb2f967){return _0x2c8d30[_0xc6af('0x18')](_0x48be31)[_0xc6af('0x1a')](_0xb2f967);}};}function respondWithFilteredResult(_0x2ef663,_0x12087d){return function(_0x165fea){if(_0x165fea){var _0x2a4b88=typeof _0x12087d[_0xc6af('0x1b')]===_0xc6af('0x1c')&&typeof _0x12087d[_0xc6af('0x1d')]===_0xc6af('0x1c');var _0x22366d=_0x165fea[_0xc6af('0x1e')];var _0x5dde9d=_0x2a4b88?0x0:_0x12087d[_0xc6af('0x1b')];var _0x3d75b8=_0x2a4b88?_0x165fea['count']:_0x12087d[_0xc6af('0x1b')]+_0x12087d[_0xc6af('0x1d')];var _0x28f9a9;if(_0x3d75b8>=_0x22366d){_0x3d75b8=_0x22366d;_0x28f9a9=0xc8;}else{_0x28f9a9=0xce;}_0x2ef663['status'](_0x28f9a9);return _0x2ef663[_0xc6af('0x1f')]('Content-Range',_0x5dde9d+'-'+_0x3d75b8+'/'+_0x22366d)[_0xc6af('0x1a')](_0x165fea);}return null;};}function patchUpdates(_0x488ca4){return function(_0xdd5f5b){try{jsonpatch[_0xc6af('0x20')](_0xdd5f5b,_0x488ca4,!![]);}catch(_0x1085b2){return BPromise[_0xc6af('0x21')](_0x1085b2);}return _0xdd5f5b[_0xc6af('0x22')]();};}function saveUpdates(_0x1e1ae,_0x85cc2c){return function(_0x1e0e37){if(_0x1e0e37){return _0x1e0e37[_0xc6af('0x23')](_0x1e1ae)[_0xc6af('0x24')](function(_0x3438aa){return _0x3438aa;});}return null;};}function removeEntity(_0x4bf7bf,_0x128933){return function(_0x4b1b68){if(_0x4b1b68){return _0x4b1b68[_0xc6af('0x25')]()[_0xc6af('0x24')](function(){_0x4bf7bf[_0xc6af('0x18')](0xcc)[_0xc6af('0x19')]();});}};}function handleEntityNotFound(_0x2f24c0,_0x5c844a){return function(_0x430795){if(!_0x430795){_0x2f24c0[_0xc6af('0x17')](0x194);}return _0x430795;};}function handleError(_0x35bb97,_0x38d134){_0x38d134=_0x38d134||0x1f4;return function(_0x4f931c){logger[_0xc6af('0x26')](_0x4f931c['stack']);if(_0x4f931c[_0xc6af('0x27')]){delete _0x4f931c[_0xc6af('0x27')];}_0x35bb97[_0xc6af('0x18')](_0x38d134)[_0xc6af('0x28')](_0x4f931c);};}exports[_0xc6af('0x29')]=function(_0x16c169,_0x4b98c8){var _0x1eabaa={},_0xf09541={},_0x173abf={'count':0x0,'rows':[]};var _0x165b64=_[_0xc6af('0x2a')](db[_0xc6af('0x2b')]['rawAttributes'],function(_0x3d8f1d){return{'name':_0x3d8f1d['fieldName'],'type':_0x3d8f1d[_0xc6af('0x2c')][_0xc6af('0x2d')]};});_0xf09541['model']=_[_0xc6af('0x2a')](_0x165b64,_0xc6af('0x27'));_0xf09541[_0xc6af('0x2e')]=_['keys'](_0x16c169[_0xc6af('0x2e')]);_0xf09541['filters']=_[_0xc6af('0x2f')](_0xf09541[_0xc6af('0x30')],_0xf09541['query']);_0x1eabaa[_0xc6af('0x31')]=_[_0xc6af('0x2f')](_0xf09541[_0xc6af('0x30')],qs['fields'](_0x16c169[_0xc6af('0x2e')][_0xc6af('0x32')]));_0x1eabaa['attributes']=_0x1eabaa[_0xc6af('0x31')][_0xc6af('0x33')]?_0x1eabaa[_0xc6af('0x31')]:_0xf09541[_0xc6af('0x30')];if(!_0x16c169[_0xc6af('0x2e')]['hasOwnProperty'](_0xc6af('0x34'))){_0x1eabaa['limit']=qs[_0xc6af('0x1d')](_0x16c169[_0xc6af('0x2e')][_0xc6af('0x1d')]);_0x1eabaa[_0xc6af('0x1b')]=qs[_0xc6af('0x1b')](_0x16c169['query'][_0xc6af('0x1b')]);}_0x1eabaa['order']=qs[_0xc6af('0x35')](_0x16c169[_0xc6af('0x2e')][_0xc6af('0x35')]);_0x1eabaa['where']=qs[_0xc6af('0x36')](_['pick'](_0x16c169[_0xc6af('0x2e')],_0xf09541['filters']),_0x165b64);if(_0x16c169[_0xc6af('0x2e')][_0xc6af('0x37')]){_0x1eabaa[_0xc6af('0x38')]=_['merge'](_0x1eabaa[_0xc6af('0x38')],{'$or':_[_0xc6af('0x2a')](_0x165b64,function(_0xf683ee){if(_0xf683ee[_0xc6af('0x2c')]!==_0xc6af('0x39')){var _0x257fd4={};_0x257fd4[_0xf683ee[_0xc6af('0x27')]]={'$like':'%'+_0x16c169[_0xc6af('0x2e')][_0xc6af('0x37')]+'%'};return _0x257fd4;}})});}_0x1eabaa=_[_0xc6af('0x3a')]({},_0x1eabaa,_0x16c169[_0xc6af('0x3b')]);var _0xf6098f={'where':_0x1eabaa[_0xc6af('0x38')]};return db[_0xc6af('0x2b')]['count'](_0xf6098f)[_0xc6af('0x24')](function(_0x51d257){_0x173abf[_0xc6af('0x1e')]=_0x51d257;if(_0x16c169[_0xc6af('0x2e')][_0xc6af('0x3c')]){_0x1eabaa[_0xc6af('0x3d')]=[{'all':!![]}];}return db[_0xc6af('0x2b')][_0xc6af('0x3e')](_0x1eabaa);})[_0xc6af('0x24')](function(_0x143e39){_0x173abf[_0xc6af('0x3f')]=_0x143e39;return _0x173abf;})[_0xc6af('0x24')](respondWithFilteredResult(_0x4b98c8,_0x1eabaa))['catch'](handleError(_0x4b98c8,null));};exports[_0xc6af('0x40')]=function(_0x1057ce,_0x46897d){var _0x365b48={'raw':!![],'where':{'id':_0x1057ce[_0xc6af('0x41')]['id']}},_0xcac00f={};_0xcac00f[_0xc6af('0x30')]=_['keys'](db['WhatsappApplication'][_0xc6af('0x42')]);_0xcac00f[_0xc6af('0x2e')]=_['keys'](_0x1057ce[_0xc6af('0x2e')]);_0xcac00f[_0xc6af('0x36')]=_['intersection'](_0xcac00f[_0xc6af('0x30')],_0xcac00f[_0xc6af('0x2e')]);_0x365b48[_0xc6af('0x31')]=_['intersection'](_0xcac00f['model'],qs['fields'](_0x1057ce['query'][_0xc6af('0x32')]));_0x365b48[_0xc6af('0x31')]=_0x365b48[_0xc6af('0x31')]['length']?_0x365b48[_0xc6af('0x31')]:_0xcac00f[_0xc6af('0x30')];if(_0x1057ce[_0xc6af('0x2e')][_0xc6af('0x3c')]){_0x365b48['include']=[{'all':!![]}];}_0x365b48=_['merge']({},_0x365b48,_0x1057ce['options']);return db[_0xc6af('0x2b')][_0xc6af('0x43')](_0x365b48)[_0xc6af('0x24')](handleEntityNotFound(_0x46897d,null))[_0xc6af('0x24')](respondWithResult(_0x46897d,null))[_0xc6af('0x44')](handleError(_0x46897d,null));};exports[_0xc6af('0x45')]=function(_0x15ffb2,_0x251311){return db['WhatsappApplication'][_0xc6af('0x45')](_0x15ffb2[_0xc6af('0x46')],{})['then'](respondWithResult(_0x251311,0xc9))[_0xc6af('0x44')](handleError(_0x251311,null));};exports[_0xc6af('0x23')]=function(_0x1696b3,_0x50c1b0){if(_0x1696b3[_0xc6af('0x46')]['id']){delete _0x1696b3['body']['id'];}return db[_0xc6af('0x2b')][_0xc6af('0x43')]({'where':{'id':_0x1696b3[_0xc6af('0x41')]['id']}})[_0xc6af('0x24')](handleEntityNotFound(_0x50c1b0,null))[_0xc6af('0x24')](saveUpdates(_0x1696b3[_0xc6af('0x46')],null))[_0xc6af('0x24')](respondWithResult(_0x50c1b0,null))[_0xc6af('0x44')](handleError(_0x50c1b0,null));};exports[_0xc6af('0x25')]=function(_0x47e83c,_0xc2219f){return db[_0xc6af('0x2b')][_0xc6af('0x43')]({'where':{'id':_0x47e83c[_0xc6af('0x41')]['id']}})['then'](handleEntityNotFound(_0xc2219f,null))[_0xc6af('0x24')](removeEntity(_0xc2219f,null))[_0xc6af('0x44')](handleError(_0xc2219f,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index ce57a20..2a55aa7 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(_0x4ec515,_0x171854){var _0xd562b6=function(_0xeda938){while(--_0xeda938){_0x4ec515['push'](_0x4ec515['shift']());}};_0xd562b6(++_0x171854);}(_0xe2cc,0x69));var _0xce2c=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xe2cc[_0x3947c9];return _0x2e7871;};'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 _0xd2bb=['util','api','moment','bluebird','request-promise','path','rimraf','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0xfd08e7,_0x57ccc3){var _0xa187cf=function(_0x4f3292){while(--_0x4f3292){_0xfd08e7['push'](_0xfd08e7['shift']());}};_0xa187cf(++_0x57ccc3);}(_0xd2bb,0x9a));var _0xbd2b=function(_0x5cebf2,_0x18288d){_0x5cebf2=_0x5cebf2-0x0;var _0x1cdf42=_0xd2bb[_0x5cebf2];return _0x1cdf42;};'use strict';var _=require('lodash');var util=require(_0xbd2b('0x0'));var logger=require('../../config/logger')(_0xbd2b('0x1'));var moment=require(_0xbd2b('0x2'));var BPromise=require(_0xbd2b('0x3'));var rp=require(_0xbd2b('0x4'));var fs=require('fs');var path=require(_0xbd2b('0x5'));var rimraf=require(_0xbd2b('0x6'));var config=require('../../config/environment');var attributes=require(_0xbd2b('0x7'));module[_0xbd2b('0x8')]=function(_0xdcd8bd,_0x2f64a8){return _0xdcd8bd[_0xbd2b('0x9')](_0xbd2b('0xa'),attributes,{'tableName':_0xbd2b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbd2b('0xc'),'collate':_0xbd2b('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 160fa64..bfc11e3 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 _0xfd28=['error','code','message','info','result','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','WhatsappApplication,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x5ca21e,_0x4e9bd1){var _0x2ad0d1=function(_0x26c9ed){while(--_0x26c9ed){_0x5ca21e['push'](_0x5ca21e['shift']());}};_0x2ad0d1(++_0x4e9bd1);}(_0xfd28,0x148));var _0x8fd2=function(_0x5a6961,_0xd41ca6){_0x5a6961=_0x5a6961-0x0;var _0x4af0a6=_0xfd28[_0x5a6961];return _0x4af0a6;};'use strict';var _=require('lodash');var util=require(_0x8fd2('0x0'));var moment=require(_0x8fd2('0x1'));var BPromise=require('bluebird');var rs=require(_0x8fd2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fd2('0x3'))['db'];var utils=require(_0x8fd2('0x4'));var logger=require(_0x8fd2('0x5'))('rpc');var config=require(_0x8fd2('0x6'));var jayson=require(_0x8fd2('0x7'));var client=jayson[_0x8fd2('0x8')][_0x8fd2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f0afc,_0x4bdc1a,_0x53d938){return new BPromise(function(_0x10fccf,_0x466c3d){return client[_0x8fd2('0xa')](_0x2f0afc,_0x53d938)['then'](function(_0x13cc69){logger['info'](_0x8fd2('0xb'),_0x4bdc1a,'request\x20sent');logger[_0x8fd2('0xc')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x4bdc1a,_0x8fd2('0xd'),JSON['stringify'](_0x13cc69));if(_0x13cc69[_0x8fd2('0xe')]){if(_0x13cc69['error'][_0x8fd2('0xf')]===0x1f4){logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);return _0x466c3d(_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);}logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);return _0x10fccf(_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);}else{logger[_0x8fd2('0x11')](_0x8fd2('0xb'),_0x4bdc1a,'request\x20sent');_0x10fccf(_0x13cc69[_0x8fd2('0x12')]['message']);}})['catch'](function(_0x56f75d){logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x56f75d);_0x466c3d(_0x56f75d);});});} \ No newline at end of file +var _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s'];(function(_0x19cb0c,_0x5bd971){var _0x5d6a46=function(_0x3060ad){while(--_0x3060ad){_0x19cb0c['push'](_0x19cb0c['shift']());}};_0x5d6a46(++_0x5bd971);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x00bb[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index bddb31f..6692dff 100644 --- a/server/api/whatsappInteraction/index.js +++ b/server/api/whatsappInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02a7=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','get','/describe','describe','/:id','getMessages','/:id/download','post','create','/:id/messages','addMessage','tracked','delete','whatsapp','destroy','removeTags','exports','util','express','Router'];(function(_0x5993de,_0x1e902f){var _0x481faf=function(_0x11dea1){while(--_0x11dea1){_0x5993de['push'](_0x5993de['shift']());}};_0x481faf(++_0x1e902f);}(_0x02a7,0x7a));var _0x702a=function(_0x415c0d,_0x467c9){_0x415c0d=_0x415c0d-0x0;var _0x1ecc03=_0x02a7[_0x415c0d];return _0x1ecc03;};'use strict';var multer=require('multer');var util=require(_0x702a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x702a('0x1'));var router=express[_0x702a('0x2')]();var fs_extra=require(_0x702a('0x3'));var auth=require(_0x702a('0x4'));var interaction=require(_0x702a('0x5'));var config=require(_0x702a('0x6'));var controller=require(_0x702a('0x7'));router['get']('/',auth[_0x702a('0x8')](),controller['index']);router[_0x702a('0x9')](_0x702a('0xa'),auth[_0x702a('0x8')](),controller[_0x702a('0xb')]);router[_0x702a('0x9')](_0x702a('0xc'),auth[_0x702a('0x8')](),controller['show']);router[_0x702a('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0x702a('0xd')]);router[_0x702a('0x9')](_0x702a('0xe'),auth[_0x702a('0x8')](),controller['download']);router[_0x702a('0xf')]('/',auth[_0x702a('0x8')](),controller[_0x702a('0x10')]);router[_0x702a('0xf')](_0x702a('0x11'),auth[_0x702a('0x8')](),controller[_0x702a('0x12')]);router['post']('/:id/tags',auth[_0x702a('0x8')](),interaction['tracked']('whatsapp','whatsappinteraction:addtags'),controller['addTags']);router['put'](_0x702a('0xc'),auth[_0x702a('0x8')](),interaction[_0x702a('0x13')]('whatsapp','whatsappinteraction:update'),controller['update']);router[_0x702a('0x14')](_0x702a('0xc'),auth[_0x702a('0x8')](),interaction['tracked'](_0x702a('0x15'),'whatsappinteraction:destroy'),controller[_0x702a('0x16')]);router[_0x702a('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x702a('0x17')]);module[_0x702a('0x18')]=router; \ No newline at end of file +var _0x4c60=['update','delete','destroy','/:id/tags','multer','util','path','connect-timeout','Router','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','getMessages','/:id/download','post','create','addMessage','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update'];(function(_0xc4c142,_0x392430){var _0x2c825e=function(_0xa91e6){while(--_0xa91e6){_0xc4c142['push'](_0xc4c142['shift']());}};_0x2c825e(++_0x392430);}(_0x4c60,0xc1));var _0x04c6=function(_0xe29be0,_0x21d5f8){_0xe29be0=_0xe29be0-0x0;var _0xf3214d=_0x4c60[_0xe29be0];return _0xf3214d;};'use strict';var multer=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var path=require(_0x04c6('0x2'));var timeout=require(_0x04c6('0x3'));var express=require('express');var router=express[_0x04c6('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x04c6('0x5'));router[_0x04c6('0x6')]('/',auth[_0x04c6('0x7')](),controller[_0x04c6('0x8')]);router[_0x04c6('0x6')](_0x04c6('0x9'),auth[_0x04c6('0x7')](),controller['describe']);router[_0x04c6('0x6')](_0x04c6('0xa'),auth[_0x04c6('0x7')](),controller[_0x04c6('0xb')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x04c6('0xc')]);router['get'](_0x04c6('0xd'),auth[_0x04c6('0x7')](),controller['download']);router[_0x04c6('0xe')]('/',auth[_0x04c6('0x7')](),controller[_0x04c6('0xf')]);router[_0x04c6('0xe')]('/:id/messages',auth[_0x04c6('0x7')](),controller[_0x04c6('0x10')]);router[_0x04c6('0xe')]('/:id/tags',auth[_0x04c6('0x7')](),interaction[_0x04c6('0x11')](_0x04c6('0x12'),_0x04c6('0x13')),controller[_0x04c6('0x14')]);router[_0x04c6('0x15')](_0x04c6('0xa'),auth[_0x04c6('0x7')](),interaction['tracked'](_0x04c6('0x12'),_0x04c6('0x16')),controller[_0x04c6('0x17')]);router[_0x04c6('0x18')](_0x04c6('0xa'),auth[_0x04c6('0x7')](),interaction[_0x04c6('0x11')](_0x04c6('0x12'),'whatsappinteraction:destroy'),controller[_0x04c6('0x19')]);router[_0x04c6('0x18')](_0x04c6('0x1a'),auth['isAuthenticated'](),controller['removeTags']);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 b1c443b..ec4027f 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 _0xdcc4=['ENUM','out','sequelize','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x4eebcf,_0x5a49f3){var _0x1612a5=function(_0x5d4264){while(--_0x5d4264){_0x4eebcf['push'](_0x4eebcf['shift']());}};_0x1612a5(++_0x5a49f3);}(_0xdcc4,0xea));var _0x4dcc=function(_0xae0321,_0x45bb49){_0xae0321=_0xae0321-0x0;var _0x134496=_0xdcc4[_0xae0321];return _0x134496;};'use strict';var Sequelize=require(_0x4dcc('0x0'));var moment=require(_0x4dcc('0x1'));module[_0x4dcc('0x2')]={'closed':{'type':Sequelize[_0x4dcc('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4dcc('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x4dcc('0x5')]},'thirdDisposition':{'type':Sequelize[_0x4dcc('0x5')]},'note':{'type':Sequelize[_0x4dcc('0x5')]},'phone':{'type':Sequelize[_0x4dcc('0x5')]},'read1stAt':{'type':Sequelize[_0x4dcc('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x4dcc('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4dcc('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4dcc('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4dcc('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x0619=['sequelize','moment','exports','BOOLEAN','STRING','DATE','ENUM','out'];(function(_0x36bf46,_0x3d8db9){var _0x1d0a72=function(_0x328e8d){while(--_0x328e8d){_0x36bf46['push'](_0x36bf46['shift']());}};_0x1d0a72(++_0x3d8db9);}(_0x0619,0x90));var _0x9061=function(_0x574f7c,_0x9292dd){_0x574f7c=_0x574f7c-0x0;var _0x2ac0eb=_0x0619[_0x574f7c];return _0x2ac0eb;};'use strict';var Sequelize=require(_0x9061('0x0'));var moment=require(_0x9061('0x1'));module[_0x9061('0x2')]={'closed':{'type':Sequelize[_0x9061('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x9061('0x4')]},'secondDisposition':{'type':Sequelize[_0x9061('0x4')]},'thirdDisposition':{'type':Sequelize[_0x9061('0x4')]},'note':{'type':Sequelize[_0x9061('0x4')]},'phone':{'type':Sequelize[_0x9061('0x4')]},'read1stAt':{'type':Sequelize[_0x9061('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x9061('0x6')]('in',_0x9061('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9061('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x9061('0x6')]('in',_0x9061('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 4f2f200..1f371f6 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 _0x1e69=['having','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','start','end','body','some','compact','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$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','Sequelize','QueryTypes','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','isEmpty','sequelize','toString','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','c.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','WhatsappInteractionId','all','rows','show','params','include','options','create','describe','addMessage','WhatsappMessage','omit','ids','findOne','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','findAll','emit','whatsappInteractionTags:save','removeTags','unix','join','root','server','files','attachments','push','fullname','firstName','lastName','Attachment','secret','Account','Owner','get','Whatsapp','closed','basename','existsSync','createReadStream','direction','out','System','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','download','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','Users','TagIds','Tags','split','forEach','catch','index','map','WhatsappInteraction','rawAttributes','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','from','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200'];(function(_0x54a6bf,_0x5f52bf){var _0x37c0e4=function(_0x42490f){while(--_0x42490f){_0x54a6bf['push'](_0x54a6bf['shift']());}};_0x37c0e4(++_0x5f52bf);}(_0x1e69,0x85));var _0x91e6=function(_0xbd7690,_0x3fa1dd){_0xbd7690=_0xbd7690-0x0;var _0x2d16cf=_0x1e69[_0xbd7690];return _0x2d16cf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x91e6('0x0'));var zipdir=require(_0x91e6('0x1'));var jsonpatch=require(_0x91e6('0x2'));var rp=require(_0x91e6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x91e6('0x4'));var util=require(_0x91e6('0x5'));var path=require(_0x91e6('0x6'));var sox=require(_0x91e6('0x7'));var csv=require(_0x91e6('0x8'));var ejs=require(_0x91e6('0x9'));var fs=require('fs');var fs_extra=require(_0x91e6('0xa'));var _=require(_0x91e6('0xb'));var squel=require(_0x91e6('0xc'));var crypto=require(_0x91e6('0xd'));var jsforce=require(_0x91e6('0xe'));var deskjs=require(_0x91e6('0xf'));var toCsv=require(_0x91e6('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x91e6('0x10'));var authService=require(_0x91e6('0x11'));var qs=require(_0x91e6('0x12'));var as=require(_0x91e6('0x13'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x91e6('0x14'));var logger=require(_0x91e6('0x15'))(_0x91e6('0x16'));var utils=require(_0x91e6('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x91e6('0x18'));var db=require(_0x91e6('0x19'))['db'];config[_0x91e6('0x1a')]=_[_0x91e6('0x1b')](config[_0x91e6('0x1a')],{'host':_0x91e6('0x1c'),'port':0x18eb});var socket=require(_0x91e6('0x1d'))(new Redis(config['redis']));require(_0x91e6('0x1e'))[_0x91e6('0x1f')](socket);function respondWithStatusCode(_0x332a26,_0x1af659){_0x1af659=_0x1af659||0xcc;return function(_0x5df579){if(_0x5df579){return _0x332a26[_0x91e6('0x20')](_0x1af659);}return _0x332a26[_0x91e6('0x21')](_0x1af659)['end']();};}function respondWithResult(_0xf214f9,_0x4a7219){_0x4a7219=_0x4a7219||0xc8;return function(_0x57d30d){if(_0x57d30d){return _0xf214f9['status'](_0x4a7219)['json'](_0x57d30d);}};}function respondWithFilteredResult(_0x38ff1a,_0xdc9327){return function(_0x4b53b0){if(_0x4b53b0){var _0x5bda45=typeof _0xdc9327[_0x91e6('0x22')]===_0x91e6('0x23')&&typeof _0xdc9327[_0x91e6('0x24')]===_0x91e6('0x23');var _0x1c78e9=_0x4b53b0[_0x91e6('0x25')];var _0x163e9a=_0x5bda45?0x0:_0xdc9327[_0x91e6('0x22')];var _0x604e03=_0x5bda45?_0x4b53b0[_0x91e6('0x25')]:_0xdc9327['offset']+_0xdc9327[_0x91e6('0x24')];var _0x330073;if(_0x604e03>=_0x1c78e9){_0x604e03=_0x1c78e9;_0x330073=0xc8;}else{_0x330073=0xce;}_0x38ff1a[_0x91e6('0x21')](_0x330073);return _0x38ff1a[_0x91e6('0x26')](_0x91e6('0x27'),_0x163e9a+'-'+_0x604e03+'/'+_0x1c78e9)[_0x91e6('0x28')](_0x4b53b0);}return null;};}function patchUpdates(_0x4bdfe8){return function(_0x500f1f){try{jsonpatch[_0x91e6('0x29')](_0x500f1f,_0x4bdfe8,!![]);}catch(_0xc1333b){return BPromise[_0x91e6('0x2a')](_0xc1333b);}return _0x500f1f[_0x91e6('0x2b')]();};}function saveUpdates(_0x5e2d8d,_0x125880){return function(_0x19ab19){if(_0x19ab19){return _0x19ab19[_0x91e6('0x2c')](_0x5e2d8d)[_0x91e6('0x2d')](function(_0x3f46f7){return _0x3f46f7;});}return null;};}function removeEntity(_0x3f9c9f,_0x296ce9){return function(_0x21f642){if(_0x21f642){return _0x21f642[_0x91e6('0x2e')]()[_0x91e6('0x2d')](function(){_0x3f9c9f[_0x91e6('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x64644e,_0x360f21){return function(_0x3c0f65){if(!_0x3c0f65){_0x64644e[_0x91e6('0x20')](0x194);}return _0x3c0f65;};}function handleError(_0x3dcb03,_0x5e2d0d){_0x5e2d0d=_0x5e2d0d||0x1f4;return function(_0x468e67){logger[_0x91e6('0x2f')](_0x468e67['stack']);if(_0x468e67[_0x91e6('0x30')]){delete _0x468e67[_0x91e6('0x30')];}_0x3dcb03[_0x91e6('0x21')](_0x5e2d0d)['send'](_0x468e67);};}function getInteractionUsers(_0x2a08e0,_0xb9098c){return new BPromise(function(_0x5cb4ce,_0x315b4e){try{if(_0xb9098c[_0x2a08e0['id']]){_0x2a08e0[_0x91e6('0x31')]=_['map'](_0xb9098c[_0x2a08e0['id']],function(_0x3e699f){return{'id':_0x3e699f['id'],'fullname':_0x3e699f['fullname']};});}}catch(_0x3f074a){_0x315b4e(_0x3f074a);}_0x5cb4ce(_0x2a08e0);});}function getInteractionTags(_0x11f94a,_0x4aec86){return new BPromise(function(_0x24414f,_0x4b534c){try{if(_0x11f94a[_0x91e6('0x32')]){_0x11f94a[_0x91e6('0x33')]=[];_0x11f94a[_0x91e6('0x32')][_0x91e6('0x34')](',')[_0x91e6('0x35')](function(_0x17c57d){_0x11f94a[_0x91e6('0x33')]['push'](_0x4aec86[_0x17c57d]);});}delete _0x11f94a[_0x91e6('0x32')];}catch(_0x5e7814){_0x4b534c(_0x5e7814);}_0x24414f(_0x11f94a);});}function updateWhatsappInteraction(_0x1d3dc5,_0x2762a7,_0x469b43){return new BPromise(function(_0x390297,_0x23f263){return getInteractionUsers(_0x1d3dc5,_0x469b43)['then'](function(_0xa22bf8){return getInteractionTags(_0xa22bf8,_0x2762a7);})[_0x91e6('0x2d')](function(_0x5bbc13){_0x390297(_0x5bbc13);})[_0x91e6('0x36')](function(_0x5f3a3f){_0x23f263(_0x5f3a3f);});});}exports[_0x91e6('0x37')]=function(_0x4a80cb,_0x2358dc){var _0x47a129={},_0x543a65={},_0x5976cc={'count':0x0,'rows':[]};var _0x308ea7=_[_0x91e6('0x38')](db[_0x91e6('0x39')][_0x91e6('0x3a')],function(_0x323918){return{'name':_0x323918['fieldName'],'type':_0x323918['type'][_0x91e6('0x3b')]};});_0x543a65[_0x91e6('0x3c')]=_[_0x91e6('0x38')](_0x308ea7,_0x91e6('0x30'));_0x543a65['query']=_[_0x91e6('0x3d')](_0x4a80cb[_0x91e6('0x3e')]);_0x543a65['filters']=_['intersection'](_0x543a65[_0x91e6('0x3c')],_0x543a65[_0x91e6('0x3e')]);_0x47a129['attributes']=_[_0x91e6('0x3f')](_0x543a65[_0x91e6('0x3c')],qs[_0x91e6('0x40')](_0x4a80cb[_0x91e6('0x3e')][_0x91e6('0x40')]));_0x47a129[_0x91e6('0x41')]=_0x47a129[_0x91e6('0x41')][_0x91e6('0x42')]?_0x47a129[_0x91e6('0x41')]:_0x543a65[_0x91e6('0x3c')];if(!_0x4a80cb['query'][_0x91e6('0x43')](_0x91e6('0x44'))){_0x47a129[_0x91e6('0x24')]=qs[_0x91e6('0x24')](_0x4a80cb[_0x91e6('0x3e')][_0x91e6('0x24')]);_0x47a129['offset']=qs[_0x91e6('0x22')](_0x4a80cb[_0x91e6('0x3e')]['offset']);}_0x47a129[_0x91e6('0x45')]=qs['sort'](_0x4a80cb[_0x91e6('0x3e')][_0x91e6('0x46')]);_0x47a129[_0x91e6('0x47')]=qs[_0x91e6('0x48')](_[_0x91e6('0x49')](_0x4a80cb['query'],_0x543a65[_0x91e6('0x48')]),_0x308ea7);var _0x58896f=[];var _0x3fa8a2=squel[_0x91e6('0x4a')]()[_0x91e6('0x4b')]('id')[_0x91e6('0x4b')](_0x91e6('0x30'))[_0x91e6('0x4b')](_0x91e6('0x4c'))[_0x91e6('0x4d')]('tools_tags');var _0x30d708=squel[_0x91e6('0x4a')]()[_0x91e6('0x4b')](_0x91e6('0x4e'))[_0x91e6('0x4b')](_0x91e6('0x4f'))[_0x91e6('0x4b')](_0x91e6('0x50'))['from'](_0x91e6('0x51'),'ui')[_0x91e6('0x52')](_0x91e6('0x53'),'u','u.id\x20=\x20ui.UserId');var _0x55efd8=squel['select']()['from'](_0x91e6('0x54'),'i')[_0x91e6('0x52')](_0x91e6('0x55'),'c',_0x91e6('0x56'))[_0x91e6('0x52')](_0x91e6('0x53'),'o',_0x91e6('0x57'))[_0x91e6('0x52')]('whatsapp_accounts','a',_0x91e6('0x58'))[_0x91e6('0x52')](_0x91e6('0x59'),'me',_0x91e6('0x5a'))[_0x91e6('0x52')](_0x91e6('0x5b'),'it',_0x91e6('0x5c'))[_0x91e6('0x52')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x405254=squel[_0x91e6('0x5d')]();var _0x559d10=[];var _0x1f3b6a=squel[_0x91e6('0x5d')]();var _0x526ffc;if(_0x4a80cb[_0x91e6('0x3e')][_0x91e6('0x5e')]){_0x526ffc=as[_0x91e6('0x5f')](_0x4a80cb['query'][_0x91e6('0x5e')]);var _0x5d41bd=_0x526ffc[_0x91e6('0x60')];for(var _0x754836=0x0;_0x754836<_0x526ffc[_0x91e6('0x61')][_0x91e6('0x42')];_0x754836++){var _0x21eab7=_0x526ffc[_0x91e6('0x61')][_0x754836];var _0x40c26a='i';var _0xcc4efc=_[_0x91e6('0x62')](_0x308ea7,['name',_0x21eab7[_0x91e6('0x4b')]]);if(!_0xcc4efc){switch(_0x21eab7['field']){case _0x91e6('0x63'):if(_0x21eab7[_0x91e6('0x64')]==0x1){_0x55efd8['having']('`'+_0x21eab7['field']+_0x91e6('0x65'));}else{_0x55efd8[_0x91e6('0x66')]('`'+_0x21eab7[_0x91e6('0x4b')]+_0x91e6('0x67'));}break;case _0x91e6('0x68'):if(_0x21eab7[_0x91e6('0x69')]===_0x91e6('0x6a')){if(_0x21eab7[_0x91e6('0x64')][_0x91e6('0x34')]('\x20')['length']>0x1){_0x405254[_0x5d41bd]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x91e6('0x6b')](_0x21eab7[_0x91e6('0x64')]),null);}else{var _0x2707dc='%'+_0x21eab7['value']+'%';_0x405254[_0x5d41bd](_0x91e6('0x6c'),_0x2707dc,_0x2707dc,_0x2707dc);}}else{_0xcc4efc=_[_0x91e6('0x62')](_0x308ea7,['name',_0x91e6('0x6d')]);_0x21eab7[_0x91e6('0x4b')]='ContactId';_0xce2fe0=as[_0x91e6('0x6e')](_0x40c26a,_0xcc4efc[_0x91e6('0x6f')],_0x21eab7);_0x405254[_0x5d41bd](_0xce2fe0['text'],_0xce2fe0[_0x91e6('0x64')]['start'],_0xce2fe0[_0x91e6('0x64')]['end']);}break;case _0x91e6('0x70'):var _0xbfce4e=_0x21eab7[_0x91e6('0x64')]['split'](',')[_0x91e6('0x38')](function(_0x145e8f){return Number(_0x145e8f);});_0xbfce4e['forEach'](function(_0x3bc789){_0x1f3b6a['or'](_0x91e6('0x71'),'%,'+_0x3bc789+',%');});_0x559d10=_[_0x91e6('0x72')](_0x559d10,_0xbfce4e);break;case _0x91e6('0x73'):if(_0x21eab7[_0x91e6('0x69')]===_0x91e6('0x6a')){_0x405254[_0x5d41bd](_0x91e6('0x74'),'%'+_0x21eab7[_0x91e6('0x64')]+'%',null);}else{_0xcc4efc=_[_0x91e6('0x62')](_0x308ea7,['name','UserId']);_0x21eab7['field']=_0x91e6('0x75');_0xce2fe0=as[_0x91e6('0x6e')](_0x40c26a,_0xcc4efc[_0x91e6('0x6f')],_0x21eab7);_0x405254[_0x5d41bd](_0xce2fe0[_0x91e6('0x76')],_0xce2fe0[_0x91e6('0x64')][_0x91e6('0x77')],_0xce2fe0[_0x91e6('0x64')][_0x91e6('0x78')]);}break;case _0x91e6('0x79'):_0xce2fe0=as[_0x91e6('0x6e')]('me',null,_0x21eab7);_0x405254[_0x5d41bd](_0xce2fe0['text'],_0xce2fe0[_0x91e6('0x64')][_0x91e6('0x77')],_0xce2fe0[_0x91e6('0x64')][_0x91e6('0x78')]);break;}}else{var _0xce2fe0=as['buildExpression'](_0x40c26a,_0xcc4efc['type'],_0x21eab7);_0x405254[_0x5d41bd](_0xce2fe0[_0x91e6('0x76')],_0xce2fe0['value'][_0x91e6('0x77')],_0xce2fe0[_0x91e6('0x64')]['end']);}}}else{var _0x597bc2=_(_0x4a80cb['query'])[_0x91e6('0x3d')]()[_0x91e6('0x38')](function(_0xd1ba39){return _[_0x91e6('0x7a')](_0x308ea7,[_0x91e6('0x30'),_0xd1ba39])?_0xd1ba39:undefined;})[_0x91e6('0x7b')]()[_0x91e6('0x64')]();if(!_['isEmpty'](_0x597bc2)){_0x597bc2[_0x91e6('0x35')](function(_0x4f85fe){if(_0x4f85fe===_0x91e6('0x7c')){_0x55efd8[_0x91e6('0x47')](_0x91e6('0x7d'),[][_0x91e6('0x7e')](_0x4a80cb[_0x91e6('0x3e')][_0x4f85fe]));}else if(_0x4f85fe===_0x91e6('0x7f')){var _0x17515a=JSON[_0x91e6('0x80')](_0x4a80cb[_0x91e6('0x3e')][_0x4f85fe])[_0x91e6('0x81')];var _0x314b69=JSON[_0x91e6('0x80')](_0x4a80cb[_0x91e6('0x3e')][_0x4f85fe])[_0x91e6('0x82')];_0x55efd8[_0x91e6('0x47')](_0x91e6('0x83'),_0x17515a,_0x314b69);}else{if(_0x4a80cb[_0x91e6('0x3e')][_0x4f85fe]===_0x91e6('0x84')){_0x55efd8[_0x91e6('0x47')]('i.'+_0x4f85fe+_0x91e6('0x85'));}else{_0x55efd8[_0x91e6('0x47')]('i.'+_0x4f85fe+_0x91e6('0x86'),_0x4a80cb['query'][_0x4f85fe]);}}});}if(_0x4a80cb[_0x91e6('0x3e')][_0x91e6('0x87')]){if(_0x4a80cb[_0x91e6('0x3e')][_0x91e6('0x87')]==0x1){_0x55efd8[_0x91e6('0x66')]('`unreadMessages`\x20=\x200');}else{_0x55efd8[_0x91e6('0x66')](_0x91e6('0x88'));}}if(_0x4a80cb['query'][_0x91e6('0x89')]){_0x559d10=_[_0x91e6('0x8a')](_0x4a80cb['query'][_0x91e6('0x89')])?_0x4a80cb[_0x91e6('0x3e')]['tag']:new Array(_0x4a80cb['query'][_0x91e6('0x89')]);_0x559d10[_0x91e6('0x35')](function(_0x3f2b0e){_0x1f3b6a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3f2b0e+',%');});}if(_0x4a80cb[_0x91e6('0x3e')][_0x91e6('0x8b')]){var _0x5d4098=_0x4a80cb['query']['filter'][_0x91e6('0x8c')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x5d4098)){_0x405254['or'](_0x91e6('0x8d'),_0x5d4098+'%')['or']('i.phone\x20LIKE\x20?',_0x5d4098+'%');}else{_0x405254['or'](_0x91e6('0x8e'),qs[_0x91e6('0x6b')](_0x5d4098))['or'](_0x91e6('0x8f'),_0x5d4098+'%');}}}_0x55efd8[_0x91e6('0x47')](_0x405254);_0x55efd8[_0x91e6('0x90')]('i.id');var _0x204dc9={'type':db[_0x91e6('0x91')][_0x91e6('0x92')]['SELECT'],'raw':!![]};var _0x7a32b9=_0x55efd8[_0x91e6('0x93')]();_0x7a32b9[_0x91e6('0x4b')](_0x91e6('0x94'));_0x7a32b9[_0x91e6('0x4b')](_0x91e6('0x95'),_0x91e6('0x63'));if(_0x47a129[_0x91e6('0x45')]){_0x47a129['order'][_0x91e6('0x35')](function(_0x1fcb23){var _0x1d4ce3=_0x1fcb23[0x0]===_0x91e6('0x96')?_0x1fcb23[0x0]:'i.'+_0x1fcb23[0x0];_0x55efd8[_0x91e6('0x45')](_0x1d4ce3,_0x1fcb23[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x559d10)){_0x55efd8['having'](_0x1f3b6a);_0x7a32b9[_0x91e6('0x47')](_0x91e6('0x97'),_0x559d10);}BPromise[_0x91e6('0x98')]()[_0x91e6('0x2d')](function(){if(!_0x526ffc){if(_0x4a80cb[_0x91e6('0x3e')][_0x91e6('0x7c')])return;_0x7a32b9[_0x91e6('0x47')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x55efd8[_0x91e6('0x47')](_0x91e6('0x99'));return;}if(_0x4a80cb[_0x91e6('0x9a')][_0x91e6('0x9b')]!==_0x91e6('0x9c'))return;return _0x4a80cb[_0x91e6('0x9a')][_0x91e6('0x9d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2ff2e0){if(_[_0x91e6('0x9e')](_0x2ff2e0)){_0x7a32b9[_0x91e6('0x47')]('i.WhatsappAccountId\x20IS\x20NULL');_0x55efd8[_0x91e6('0x47')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x7a32b9[_0x91e6('0x47')](_0x91e6('0x7d'),_[_0x91e6('0x38')](_0x2ff2e0,'id'));_0x55efd8[_0x91e6('0x47')](_0x91e6('0x7d'),_[_0x91e6('0x38')](_0x2ff2e0,'id'));}});})[_0x91e6('0x2d')](function(){if(_0x4a80cb[_0x91e6('0x9a')][_0x91e6('0x9b')]===_0x91e6('0x9c')&&!_0x526ffc&&!_0x4a80cb['query'][_0x91e6('0x7c')])return[];return db[_0x91e6('0x9f')][_0x91e6('0x3e')](_0x7a32b9[_0x91e6('0xa0')](),_0x204dc9);})[_0x91e6('0x2d')](function(_0x9d9bdb){_0x5976cc['count']=_0x9d9bdb[_0x91e6('0x42')];if(_0x5976cc[_0x91e6('0x25')]===0x0)return[];return db[_0x91e6('0x9f')][_0x91e6('0x3e')](_0x3fa8a2[_0x91e6('0xa0')](),_0x204dc9)[_0x91e6('0x2d')](function(_0x4a6d65){_0x58896f=_['keyBy'](_0x4a6d65,'id');_0x204dc9=_[_0x91e6('0xa1')](_0x204dc9,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4a80cb[_0x91e6('0x3e')]['fields']){_0x47a129['attributes'][_0x91e6('0x35')](function(_0x3e0b4b){_0x55efd8[_0x91e6('0x4b')]('i.'+_0x3e0b4b);});}else{_0x55efd8[_0x91e6('0x4b')](_0x91e6('0x95'),_0x91e6('0x63'));_0x55efd8[_0x91e6('0x4b')](_0x91e6('0xa2'),_0x91e6('0xa3'));_0x55efd8[_0x91e6('0x4b')](_0x91e6('0xa4'),'Account.mandatoryDisposition');_0x55efd8[_0x91e6('0x4b')](_0x91e6('0xa5'),'contactName');_0x55efd8[_0x91e6('0x4b')](_0x91e6('0xa6'));_0x55efd8[_0x91e6('0x4b')](_0x91e6('0xa7'),_0x91e6('0xa8'));_0x55efd8['field'](_0x91e6('0xa9'),_0x91e6('0xaa'));_0x55efd8[_0x91e6('0x4b')](_0x91e6('0xab'),_0x91e6('0xac'));_0x55efd8[_0x91e6('0x4b')](_0x91e6('0xad'),'Contact.phone');_0x55efd8[_0x91e6('0x4b')](_0x91e6('0xae'),_0x91e6('0xaf'));_0x55efd8[_0x91e6('0x4b')]('c.fax',_0x91e6('0xb0'));_0x55efd8[_0x91e6('0x4b')](_0x91e6('0xb1'),'Owner.fullname');_0x55efd8[_0x91e6('0x4b')]('o.internal',_0x91e6('0xb2'));_0x55efd8[_0x91e6('0x4b')](_0x91e6('0xb3'),_0x91e6('0x32'));}if(_0x47a129[_0x91e6('0x24')])_0x55efd8[_0x91e6('0x24')](_0x47a129['limit']);if(_0x47a129[_0x91e6('0x22')])_0x55efd8[_0x91e6('0x22')](_0x47a129['offset']);return db['sequelize']['query'](_0x55efd8[_0x91e6('0xa0')](),_0x204dc9);})[_0x91e6('0x2d')](function(_0x239bb5){if(_0x239bb5[_0x91e6('0x42')]>0x0)_0x30d708[_0x91e6('0x47')]('ui.WhatsappInteractionId\x20IN\x20?',_[_0x91e6('0x38')](_0x239bb5,'id'));return db[_0x91e6('0x9f')]['query'](_0x30d708[_0x91e6('0xa0')](),_0x204dc9)[_0x91e6('0x2d')](function(_0x3e55f1){var _0x211cde=_[_0x91e6('0xb4')](_0x3e55f1,_0x91e6('0xb5'));var _0x4873ec=[];_0x239bb5[_0x91e6('0x35')](function(_0x5e12ef){_0x4873ec['push'](updateWhatsappInteraction(_0x5e12ef,_0x58896f,_0x211cde));});return BPromise[_0x91e6('0xb6')](_0x4873ec);});});})['then'](function(_0x4f780c){_0x5976cc[_0x91e6('0xb7')]=_0x4f780c;return _0x5976cc;})[_0x91e6('0x2d')](respondWithFilteredResult(_0x2358dc,_0x47a129))['catch'](handleError(_0x2358dc,null));};exports[_0x91e6('0xb8')]=function(_0x4d91f9,_0x3c258d){var _0x4565f8={'raw':![],'where':{'id':_0x4d91f9[_0x91e6('0xb9')]['id']}},_0x2b734f={};_0x2b734f['model']=_[_0x91e6('0x3d')](db[_0x91e6('0x39')][_0x91e6('0x3a')]);_0x2b734f[_0x91e6('0x3e')]=_['keys'](_0x4d91f9[_0x91e6('0x3e')]);_0x2b734f[_0x91e6('0x48')]=_['intersection'](_0x2b734f['model'],_0x2b734f[_0x91e6('0x3e')]);_0x4565f8['attributes']=_['intersection'](_0x2b734f[_0x91e6('0x3c')],qs['fields'](_0x4d91f9[_0x91e6('0x3e')][_0x91e6('0x40')]));_0x4565f8[_0x91e6('0x41')]=_0x4565f8[_0x91e6('0x41')][_0x91e6('0x42')]?_0x4565f8[_0x91e6('0x41')]:_0x2b734f[_0x91e6('0x3c')];if(_0x4d91f9[_0x91e6('0x3e')]['includeAll']){_0x4565f8[_0x91e6('0xba')]=[{'all':!![]}];}_0x4565f8=_[_0x91e6('0xa1')]({},_0x4565f8,_0x4d91f9[_0x91e6('0xbb')]);return db[_0x91e6('0x39')][_0x91e6('0x62')](_0x4565f8)[_0x91e6('0x2d')](handleEntityNotFound(_0x3c258d,null))[_0x91e6('0x2d')](respondWithResult(_0x3c258d,null))[_0x91e6('0x36')](handleError(_0x3c258d,null));};exports[_0x91e6('0xbc')]=function(_0x2ca989,_0x353faf){return db[_0x91e6('0x39')][_0x91e6('0xbc')](_0x2ca989[_0x91e6('0x79')],{})[_0x91e6('0x2d')](respondWithResult(_0x353faf,0xc9))['catch'](handleError(_0x353faf,null));};exports['update']=function(_0x51b6f9,_0x5491f8){if(_0x51b6f9[_0x91e6('0x79')]['id']){delete _0x51b6f9[_0x91e6('0x79')]['id'];}return db[_0x91e6('0x39')][_0x91e6('0x62')]({'where':{'id':_0x51b6f9[_0x91e6('0xb9')]['id']}})[_0x91e6('0x2d')](handleEntityNotFound(_0x5491f8,null))[_0x91e6('0x2d')](saveUpdates(_0x51b6f9[_0x91e6('0x79')],null))[_0x91e6('0x2d')](respondWithResult(_0x5491f8,null))[_0x91e6('0x36')](handleError(_0x5491f8,null));};exports[_0x91e6('0x2e')]=function(_0x3a1c6b,_0x5ae6c2){return db[_0x91e6('0x39')][_0x91e6('0x62')]({'where':{'id':_0x3a1c6b[_0x91e6('0xb9')]['id']}})[_0x91e6('0x2d')](handleEntityNotFound(_0x5ae6c2,null))['then'](removeEntity(_0x5ae6c2,null))['catch'](handleError(_0x5ae6c2,null));};exports['describe']=function(_0x55e744,_0xba8e11){return db[_0x91e6('0x39')][_0x91e6('0xbd')]()['then'](respondWithResult(_0xba8e11,null))[_0x91e6('0x36')](handleError(_0xba8e11,null));};exports[_0x91e6('0xbe')]=function(_0x316db6,_0x3dac20,_0x35ec1e){return db[_0x91e6('0xbf')][_0x91e6('0x62')]({'where':{'id':_0x316db6[_0x91e6('0xb9')]['id']}})['then'](handleEntityNotFound(_0x3dac20,null))[_0x91e6('0x2d')](function(_0x5ab858){if(_0x5ab858){return _0x5ab858['addMessage'](_0x316db6['body']['ids'],_[_0x91e6('0xc0')](_0x316db6[_0x91e6('0x79')],[_0x91e6('0xc1'),'id'])||{});}})[_0x91e6('0x2d')](respondWithResult(_0x3dac20,null))['catch'](handleError(_0x3dac20,null));};exports['getMessages']=function(_0x5dcb40,_0x12af90,_0x32a742){var _0x2f0379={'raw':![],'where':{}};var _0x49e1fc={};var _0x19541b={'count':0x0,'rows':[]};return db[_0x91e6('0x39')][_0x91e6('0xc2')]({'where':{'id':_0x5dcb40[_0x91e6('0xb9')]['id']}})[_0x91e6('0x2d')](handleEntityNotFound(_0x12af90,null))[_0x91e6('0x2d')](function(_0x524c1c){if(_0x524c1c){_0x49e1fc[_0x91e6('0x3c')]=_[_0x91e6('0x3d')](db[_0x91e6('0xbf')][_0x91e6('0x3a')]);_0x49e1fc['query']=_[_0x91e6('0x3d')](_0x5dcb40['query']);_0x49e1fc[_0x91e6('0x48')]=_['intersection'](_0x49e1fc[_0x91e6('0x3c')],_0x49e1fc['query']);_0x2f0379[_0x91e6('0x41')]=_[_0x91e6('0x3f')](_0x49e1fc[_0x91e6('0x3c')],qs[_0x91e6('0x40')](_0x5dcb40[_0x91e6('0x3e')][_0x91e6('0x40')]));_0x2f0379[_0x91e6('0x41')]=_0x2f0379[_0x91e6('0x41')][_0x91e6('0x42')]?_0x2f0379['attributes']:_0x49e1fc[_0x91e6('0x3c')];if(!_0x5dcb40['query'][_0x91e6('0x43')](_0x91e6('0x44'))){_0x2f0379[_0x91e6('0x24')]=qs[_0x91e6('0x24')](_0x5dcb40[_0x91e6('0x3e')][_0x91e6('0x24')]);_0x2f0379[_0x91e6('0x22')]=qs[_0x91e6('0x22')](_0x5dcb40['query'][_0x91e6('0x22')]);}_0x2f0379[_0x91e6('0x45')]=qs[_0x91e6('0x46')](_0x5dcb40[_0x91e6('0x3e')][_0x91e6('0x46')]);_0x2f0379['where']=qs[_0x91e6('0x48')](_[_0x91e6('0x49')](_0x5dcb40[_0x91e6('0x3e')],_0x49e1fc[_0x91e6('0x48')]));_0x2f0379[_0x91e6('0x47')]['WhatsappInteractionId']=_0x524c1c['id'];if(_0x5dcb40[_0x91e6('0x3e')][_0x91e6('0x8b')]){_0x2f0379[_0x91e6('0x47')]=_['merge'](_0x2f0379[_0x91e6('0x47')],{'$or':_['map'](_0x2f0379['attributes'],function(_0x3f8c00){var _0x4aefe2={};_0x4aefe2[_0x3f8c00]={'$like':'%'+_0x5dcb40[_0x91e6('0x3e')][_0x91e6('0x8b')]+'%'};return _0x4aefe2;})});}if(_0x5dcb40[_0x91e6('0x3e')][_0x91e6('0x81')]){var _0x3dcd51=_0x5dcb40[_0x91e6('0x3e')][_0x91e6('0x81')][_0x91e6('0x34')](',');var _0x230c21={};_0x230c21[_0x3dcd51[0x0]]={'$gte':moment(_0x3dcd51[0x1])[_0x91e6('0xc3')](_0x91e6('0xc4'))};_0x2f0379[_0x91e6('0x47')]=_['merge'](_0x2f0379[_0x91e6('0x47')],_0x230c21);}_0x2f0379=_[_0x91e6('0xa1')]({},_0x2f0379,_0x5dcb40[_0x91e6('0xbb')]);return db[_0x91e6('0xbf')][_0x91e6('0x25')]({'where':_0x2f0379[_0x91e6('0x47')]})[_0x91e6('0x2d')](function(_0x12c674){_0x19541b[_0x91e6('0x25')]=_0x12c674;if(_0x5dcb40['query']['includeAll']){_0x2f0379[_0x91e6('0xba')]=[{'all':!![]}];}return db[_0x91e6('0xbf')]['findAll'](_0x2f0379);})[_0x91e6('0x2d')](function(_0x5d43d9){_0x19541b[_0x91e6('0xb7')]=_0x5d43d9;return _0x19541b;});}})[_0x91e6('0x2d')](respondWithFilteredResult(_0x12af90,_0x2f0379))[_0x91e6('0x36')](handleError(_0x12af90,null));};exports[_0x91e6('0xc5')]=function(_0x581476,_0x7c4b35,_0x512fd7){return db[_0x91e6('0x39')]['find']({'where':{'id':_0x581476['params']['id']}})[_0x91e6('0x2d')](handleEntityNotFound(_0x7c4b35,null))[_0x91e6('0x2d')](function(_0x5eca38){if(_0x5eca38){return _0x5eca38[_0x91e6('0xc6')](_0x581476['body'][_0x91e6('0xc1')],_[_0x91e6('0xc0')](_0x581476[_0x91e6('0x79')],[_0x91e6('0xc1'),'id'])||{})[_0x91e6('0xc7')](function(){return db['Tag'][_0x91e6('0xc8')]({'attributes':['id',_0x91e6('0x30'),_0x91e6('0x4c')],'where':{'id':_0x581476[_0x91e6('0x79')][_0x91e6('0xc1')]}});})[_0x91e6('0x2d')](function(_0xa5ded3){socket[_0x91e6('0xc9')](_0x91e6('0xca'),{'id':Number(_0x581476[_0x91e6('0xb9')]['id']),'tags':_0xa5ded3||[]});return{'id':Number(_0x581476[_0x91e6('0xb9')]['id']),'tags':_0xa5ded3||[]};});}})['then'](respondWithResult(_0x7c4b35,null))[_0x91e6('0x36')](handleError(_0x7c4b35,null));};exports['removeTags']=function(_0x103e73,_0x363d57,_0x34e2f1){return db[_0x91e6('0x39')][_0x91e6('0x62')]({'where':{'id':_0x103e73['params']['id']}})[_0x91e6('0x2d')](handleEntityNotFound(_0x363d57,null))[_0x91e6('0x2d')](function(_0xd50e0b){if(_0xd50e0b){return _0xd50e0b[_0x91e6('0xcb')](_0x103e73[_0x91e6('0x3e')][_0x91e6('0xc1')]);}})[_0x91e6('0x2d')](respondWithStatusCode(_0x363d57,null))['catch'](handleError(_0x363d57,null));};exports['download']=function(_0x148cbb,_0x521c13){var _0x56bfe0=moment()[_0x91e6('0xcc')]()[_0x91e6('0xa0')]();var _0x57799d=path[_0x91e6('0xcd')](config[_0x91e6('0xce')],_0x91e6('0xcf'),_0x91e6('0xd0'),'tmp');var _0x496314=path['join'](config[_0x91e6('0xce')],_0x91e6('0xcf'),_0x91e6('0xd0'),_0x91e6('0xd1'));var _0x11ee7d=path[_0x91e6('0xcd')](_0x57799d,_0x56bfe0);var _0x1ea676=util['format']('transcript-%d-%s.zip',_0x148cbb['params']['id'],_0x56bfe0);var _0x2cba96=path[_0x91e6('0xcd')](_0x57799d,_0x1ea676);var _0x35c16f=[];_0x35c16f[_0x91e6('0xd2')]({'model':db[_0x91e6('0x73')],'as':_0x91e6('0x73'),'attributes':['id',_0x91e6('0xd3')],'raw':!![]});_0x35c16f[_0x91e6('0xd2')]({'model':db['CmContact'],'as':_0x91e6('0x68'),'attributes':['id',_0x91e6('0xd4'),_0x91e6('0xd5')],'raw':!![]});if(_0x148cbb[_0x91e6('0x3e')]['attachments']){_0x35c16f[_0x91e6('0xd2')]({'model':db['Attachment'],'as':_0x91e6('0xd6'),'raw':!![]});}var _0x3771d5=[{'model':db[_0x91e6('0xbf')],'as':'Messages','attributes':['id',_0x91e6('0x79'),_0x91e6('0x7f'),'direction',_0x91e6('0xd7'),_0x91e6('0x87')],'include':_0x35c16f}];_0x3771d5[_0x91e6('0xd2')]({'model':db['WhatsappAccount'],'as':_0x91e6('0xd8'),'attributes':['id',_0x91e6('0x30')]});_0x3771d5['push']({'model':db[_0x91e6('0x73')],'as':_0x91e6('0xd9'),'attributes':['id',_0x91e6('0xd3')]});return db[_0x91e6('0x39')]['find']({'where':{'id':_0x148cbb[_0x91e6('0xb9')]['id']},'include':_0x3771d5})[_0x91e6('0x2d')](handleEntityNotFound(_0x521c13,null))[_0x91e6('0x2d')](function(_0x5a82cc){if(_0x5a82cc){var _0x3d45fd=_0x5a82cc[_0x91e6('0xda')]({'plain':!![]});fs['mkdirSync'](_0x11ee7d);var _0x59e651={'channel':_0x91e6('0xdb'),'account':_0x3d45fd[_0x91e6('0xd8')][_0x91e6('0x30')],'agent':_0x3d45fd[_0x91e6('0xd9')]?_0x3d45fd[_0x91e6('0xd9')][_0x91e6('0xd3')]:'N.A.','createdAt':moment(_0x3d45fd[_0x91e6('0x7f')])['format'](_0x91e6('0xc4'))['toString'](),'closedAt':_0x3d45fd[_0x91e6('0xdc')]?moment(_0x3d45fd['closedAt'])[_0x91e6('0xc3')](_0x91e6('0xc4'))['toString']():'','disposition':_0x3d45fd['disposition'],'messages':_(_0x3d45fd['Messages'])[_0x91e6('0x8b')]({'secret':![]})['map'](function(_0x36484e){if(_0x36484e[_0x91e6('0xd6')]){var _0x4cb1de=path[_0x91e6('0xcd')](_0x496314,_0x36484e[_0x91e6('0xd6')][_0x91e6('0xdd')]);if(fs[_0x91e6('0xde')](_0x4cb1de)){fs[_0x91e6('0xdf')](_0x4cb1de)['pipe'](fs['createWriteStream'](path[_0x91e6('0xcd')](_0x11ee7d,_0x36484e[_0x91e6('0xd6')][_0x91e6('0xdd')])));}}return{'date':moment(_0x36484e[_0x91e6('0x7f')])[_0x91e6('0xc3')](_0x91e6('0xc4'))['toString'](),'sender':_0x36484e[_0x91e6('0xe0')]===_0x91e6('0xe1')?_0x36484e[_0x91e6('0x73')]?_0x36484e['User'][_0x91e6('0xd3')]:_0x91e6('0xe2'):_0x36484e[_0x91e6('0x68')][_0x91e6('0xd4')]+(_0x36484e[_0x91e6('0x68')][_0x91e6('0xd5')]?'\x20'+_0x36484e[_0x91e6('0x68')][_0x91e6('0xd5')]:''),'body':_0x36484e['Attachment']?_0x36484e[_0x91e6('0xd6')][_0x91e6('0xdd')]:_0x36484e[_0x91e6('0x79')],'direction':_0x36484e['direction']===_0x91e6('0xe1')?'A':'C','secret':_0x36484e[_0x91e6('0xd7')],'read':_0x36484e['read'],'attachment':_0x36484e[_0x91e6('0xd6')]};})[_0x91e6('0x64')]()};return ejs[_0x91e6('0xe3')](path[_0x91e6('0xcd')](config[_0x91e6('0xce')],_0x91e6('0xcf'),'views',_0x91e6('0xe4')),{'interaction':_0x59e651})[_0x91e6('0x2d')](function(_0x2e8bb2){var _0x5c0b1f=path['join'](_0x11ee7d,'transcript-'+_0x3d45fd['id']+'-'+_0x56bfe0+_0x91e6('0xe5'));var _0x595f9e={'path':_0x5c0b1f,'channel':'Whatsapp','interactionId':_0x3d45fd['id']};return pdf[_0x91e6('0xe6')](_0x2e8bb2,_0x595f9e);})[_0x91e6('0x2d')](function(){return new BPromise(function(_0x5cbb88,_0x2a9694){zipdir(_0x11ee7d,{'saveTo':_0x2cba96},function(_0x504d7f,_0x3799f0){if(_0x504d7f)return _0x2a9694(_0x504d7f);return _0x5cbb88(_0x3799f0);});})[_0x91e6('0x2d')](function(){return new BPromise(function(_0x7183b6,_0x65b01e){rimraf(_0x11ee7d,function(_0x5521e3){if(_0x5521e3)_0x65b01e(_0x5521e3);return _0x7183b6();});});})[_0x91e6('0x2d')](function(){return _0x521c13[_0x91e6('0xe7')](_0x2cba96,_0x1ea676,function(_0x148cb4){if(_0x148cb4){console[_0x91e6('0xe8')](_0x91e6('0xe9'),_0x148cb4);}else{fs[_0x91e6('0xea')](_0x2cba96);}});});});}else{return _0x521c13['sendStatus'](0xc8);}})['catch'](handleError(_0x521c13,null));}; \ No newline at end of file +var _0x3de0=['QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','WhatsappInteraction','a.key','Account.key','Account.mandatoryDisposition','i.*','c.lastName','c.email','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','show','rawAttributes','options','create','params','destroy','describe','addMessage','WhatsappMessage','ids','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','findAll','addTags','omit','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','direction','secret','read','Account','Owner','fullname','get','Whatsapp','closed','existsSync','createReadStream','pipe','createWriteStream','out','basename','renderFile','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','stack','name','Users','map','TagIds','split','Tags','push','catch','index','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.WhatsappInteractionId','user_has_whatsapp_interactions','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','o.id\x20=\x20i.UserId','whatsapp_accounts','whatsapp_messages','whatsapp_interaction_has_tags','tools_tags','expr','search','conditions','find','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','UserId','body','start','some','compact','isEmpty','WhatsappAccountId','concat','createdAt','$lte','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','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'];(function(_0x4f3242,_0x391954){var _0x49844f=function(_0x5ee033){while(--_0x5ee033){_0x4f3242['push'](_0x4f3242['shift']());}};_0x49844f(++_0x391954);}(_0x3de0,0x143));var _0x03de=function(_0x36f957,_0x2eadf7){_0x36f957=_0x36f957-0x0;var _0x266b0c=_0x3de0[_0x36f957];return _0x266b0c;};'use strict';var emlformat=require(_0x03de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x03de('0x1'));var jsonpatch=require(_0x03de('0x2'));var rp=require('request-promise');var moment=require(_0x03de('0x3'));var BPromise=require(_0x03de('0x4'));var Mustache=require('mustache');var util=require(_0x03de('0x5'));var path=require(_0x03de('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x03de('0x7'));var fs=require('fs');var fs_extra=require(_0x03de('0x8'));var _=require(_0x03de('0x9'));var squel=require(_0x03de('0xa'));var crypto=require(_0x03de('0xb'));var jsforce=require(_0x03de('0xc'));var deskjs=require(_0x03de('0xd'));var toCsv=require(_0x03de('0xe'));var querystring=require('querystring');var Papa=require(_0x03de('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x03de('0x10'));var as=require(_0x03de('0x11'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x03de('0x12'));var logger=require(_0x03de('0x13'))('api');var utils=require(_0x03de('0x14'));var config=require(_0x03de('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x03de('0x16'))['db'];config[_0x03de('0x17')]=_[_0x03de('0x18')](config[_0x03de('0x17')],{'host':_0x03de('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x03de('0x17')]));require(_0x03de('0x1a'))[_0x03de('0x1b')](socket);function respondWithStatusCode(_0x4064a8,_0x5dcade){_0x5dcade=_0x5dcade||0xcc;return function(_0x453564){if(_0x453564){return _0x4064a8[_0x03de('0x1c')](_0x5dcade);}return _0x4064a8[_0x03de('0x1d')](_0x5dcade)[_0x03de('0x1e')]();};}function respondWithResult(_0x45fe9e,_0x2828f0){_0x2828f0=_0x2828f0||0xc8;return function(_0x9285c0){if(_0x9285c0){return _0x45fe9e[_0x03de('0x1d')](_0x2828f0)[_0x03de('0x1f')](_0x9285c0);}};}function respondWithFilteredResult(_0x54556d,_0x4835c0){return function(_0x3e9198){if(_0x3e9198){var _0x42962e=typeof _0x4835c0[_0x03de('0x20')]==='undefined'&&typeof _0x4835c0[_0x03de('0x21')]===_0x03de('0x22');var _0x32cb0e=_0x3e9198[_0x03de('0x23')];var _0x148725=_0x42962e?0x0:_0x4835c0[_0x03de('0x20')];var _0x3cb6ff=_0x42962e?_0x3e9198['count']:_0x4835c0['offset']+_0x4835c0['limit'];var _0x29686b;if(_0x3cb6ff>=_0x32cb0e){_0x3cb6ff=_0x32cb0e;_0x29686b=0xc8;}else{_0x29686b=0xce;}_0x54556d[_0x03de('0x1d')](_0x29686b);return _0x54556d['set'](_0x03de('0x24'),_0x148725+'-'+_0x3cb6ff+'/'+_0x32cb0e)[_0x03de('0x1f')](_0x3e9198);}return null;};}function patchUpdates(_0xebbd43){return function(_0x4bc6c8){try{jsonpatch[_0x03de('0x25')](_0x4bc6c8,_0xebbd43,!![]);}catch(_0x396a57){return BPromise['reject'](_0x396a57);}return _0x4bc6c8[_0x03de('0x26')]();};}function saveUpdates(_0x37b44f,_0x8c74aa){return function(_0xf03160){if(_0xf03160){return _0xf03160[_0x03de('0x27')](_0x37b44f)['then'](function(_0xf54687){return _0xf54687;});}return null;};}function removeEntity(_0x13ab64,_0x20bea7){return function(_0x1ed415){if(_0x1ed415){return _0x1ed415['destroy']()[_0x03de('0x28')](function(){_0x13ab64[_0x03de('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c371f,_0xb3fed8){return function(_0x2147b3){if(!_0x2147b3){_0x5c371f['sendStatus'](0x194);}return _0x2147b3;};}function handleError(_0x5d4fea,_0x261b19){_0x261b19=_0x261b19||0x1f4;return function(_0x17463b){logger['error'](_0x17463b[_0x03de('0x29')]);if(_0x17463b[_0x03de('0x2a')]){delete _0x17463b[_0x03de('0x2a')];}_0x5d4fea[_0x03de('0x1d')](_0x261b19)['send'](_0x17463b);};}function getInteractionUsers(_0x5bfae1,_0x191534){return new BPromise(function(_0xfe302d,_0x338ae1){try{if(_0x191534[_0x5bfae1['id']]){_0x5bfae1[_0x03de('0x2b')]=_[_0x03de('0x2c')](_0x191534[_0x5bfae1['id']],function(_0x7d35de){return{'id':_0x7d35de['id'],'fullname':_0x7d35de['fullname']};});}}catch(_0x2b4fea){_0x338ae1(_0x2b4fea);}_0xfe302d(_0x5bfae1);});}function getInteractionTags(_0x11289f,_0xab59a2){return new BPromise(function(_0x4399ed,_0x424262){try{if(_0x11289f[_0x03de('0x2d')]){_0x11289f['Tags']=[];_0x11289f[_0x03de('0x2d')][_0x03de('0x2e')](',')['forEach'](function(_0x422076){_0x11289f[_0x03de('0x2f')][_0x03de('0x30')](_0xab59a2[_0x422076]);});}delete _0x11289f[_0x03de('0x2d')];}catch(_0x4a1819){_0x424262(_0x4a1819);}_0x4399ed(_0x11289f);});}function updateWhatsappInteraction(_0x40a6dc,_0x2971a0,_0x38d968){return new BPromise(function(_0x147ac6,_0x54b182){return getInteractionUsers(_0x40a6dc,_0x38d968)[_0x03de('0x28')](function(_0xcaf5cf){return getInteractionTags(_0xcaf5cf,_0x2971a0);})[_0x03de('0x28')](function(_0x4930a6){_0x147ac6(_0x4930a6);})[_0x03de('0x31')](function(_0x39fa92){_0x54b182(_0x39fa92);});});}exports[_0x03de('0x32')]=function(_0x1c96a7,_0x46aa12){var _0x6290da={},_0xdb21c3={},_0x5bc7dd={'count':0x0,'rows':[]};var _0x10d0c8=_[_0x03de('0x2c')](db['WhatsappInteraction']['rawAttributes'],function(_0x2c13e9){return{'name':_0x2c13e9[_0x03de('0x33')],'type':_0x2c13e9[_0x03de('0x34')][_0x03de('0x35')]};});_0xdb21c3[_0x03de('0x36')]=_[_0x03de('0x2c')](_0x10d0c8,_0x03de('0x2a'));_0xdb21c3[_0x03de('0x37')]=_[_0x03de('0x38')](_0x1c96a7[_0x03de('0x37')]);_0xdb21c3[_0x03de('0x39')]=_[_0x03de('0x3a')](_0xdb21c3[_0x03de('0x36')],_0xdb21c3[_0x03de('0x37')]);_0x6290da[_0x03de('0x3b')]=_[_0x03de('0x3a')](_0xdb21c3[_0x03de('0x36')],qs[_0x03de('0x3c')](_0x1c96a7[_0x03de('0x37')][_0x03de('0x3c')]));_0x6290da['attributes']=_0x6290da[_0x03de('0x3b')][_0x03de('0x3d')]?_0x6290da['attributes']:_0xdb21c3[_0x03de('0x36')];if(!_0x1c96a7[_0x03de('0x37')][_0x03de('0x3e')](_0x03de('0x3f'))){_0x6290da[_0x03de('0x21')]=qs[_0x03de('0x21')](_0x1c96a7[_0x03de('0x37')][_0x03de('0x21')]);_0x6290da['offset']=qs[_0x03de('0x20')](_0x1c96a7[_0x03de('0x37')][_0x03de('0x20')]);}_0x6290da[_0x03de('0x40')]=qs[_0x03de('0x41')](_0x1c96a7[_0x03de('0x37')][_0x03de('0x41')]);_0x6290da[_0x03de('0x42')]=qs['filters'](_[_0x03de('0x43')](_0x1c96a7['query'],_0xdb21c3['filters']),_0x10d0c8);var _0x1e850a=[];var _0x447b23=squel[_0x03de('0x44')]()['field']('id')['field'](_0x03de('0x2a'))[_0x03de('0x45')](_0x03de('0x46'))[_0x03de('0x47')]('tools_tags');var _0x99b1a1=squel['select']()[_0x03de('0x45')](_0x03de('0x48'))[_0x03de('0x45')](_0x03de('0x49'))[_0x03de('0x45')](_0x03de('0x4a'))['from'](_0x03de('0x4b'),'ui')['left_join'](_0x03de('0x4c'),'u','u.id\x20=\x20ui.UserId');var _0x13d15c=squel[_0x03de('0x44')]()[_0x03de('0x47')]('whatsapp_interactions','i')['left_join'](_0x03de('0x4d'),'c',_0x03de('0x4e'))[_0x03de('0x4f')](_0x03de('0x4c'),'o',_0x03de('0x50'))[_0x03de('0x4f')](_0x03de('0x51'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0x03de('0x4f')](_0x03de('0x52'),'me','me.WhatsappInteractionId\x20=\x20i.id')[_0x03de('0x4f')](_0x03de('0x53'),'it','it.WhatsappInteractionId\x20=\x20i.id')[_0x03de('0x4f')](_0x03de('0x54'),'t','t.id\x20=\x20it.TagId');var _0x2eef5b=squel['expr']();var _0x4b29b0=[];var _0x3f00b1=squel[_0x03de('0x55')]();var _0x2434bd;if(_0x1c96a7[_0x03de('0x37')][_0x03de('0x56')]){_0x2434bd=as['parseSearch'](_0x1c96a7['query'][_0x03de('0x56')]);var _0x536a9d=_0x2434bd['sqlOperator'];for(var _0x154cc6=0x0;_0x154cc6<_0x2434bd['conditions'][_0x03de('0x3d')];_0x154cc6++){var _0x237d50=_0x2434bd[_0x03de('0x57')][_0x154cc6];var _0x5c0a29='i';var _0x24edb2=_[_0x03de('0x58')](_0x10d0c8,['name',_0x237d50[_0x03de('0x45')]]);if(!_0x24edb2){switch(_0x237d50[_0x03de('0x45')]){case'unreadMessages':if(_0x237d50[_0x03de('0x59')]==0x1){_0x13d15c['having']('`'+_0x237d50[_0x03de('0x45')]+_0x03de('0x5a'));}else{_0x13d15c[_0x03de('0x5b')]('`'+_0x237d50[_0x03de('0x45')]+_0x03de('0x5c'));}break;case _0x03de('0x5d'):if(_0x237d50[_0x03de('0x5e')]===_0x03de('0x5f')){if(_0x237d50['value']['split']('\x20')[_0x03de('0x3d')]>0x1){_0x2eef5b[_0x536a9d](_0x03de('0x60'),qs[_0x03de('0x61')](_0x237d50['value']),null);}else{var _0x2dfed6='%'+_0x237d50[_0x03de('0x59')]+'%';_0x2eef5b[_0x536a9d]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2dfed6,_0x2dfed6,_0x2dfed6);}}else{_0x24edb2=_['find'](_0x10d0c8,[_0x03de('0x2a'),'ContactId']);_0x237d50[_0x03de('0x45')]=_0x03de('0x62');_0x349fa1=as[_0x03de('0x63')](_0x5c0a29,_0x24edb2['type'],_0x237d50);_0x2eef5b[_0x536a9d](_0x349fa1[_0x03de('0x64')],_0x349fa1[_0x03de('0x59')]['start'],_0x349fa1[_0x03de('0x59')][_0x03de('0x1e')]);}break;case _0x03de('0x65'):var _0x58465e=_0x237d50[_0x03de('0x59')]['split'](',')[_0x03de('0x2c')](function(_0x2b2f42){return Number(_0x2b2f42);});_0x58465e[_0x03de('0x66')](function(_0x3d2274){_0x3f00b1['or'](_0x03de('0x67'),'%,'+_0x3d2274+',%');});_0x4b29b0=_['union'](_0x4b29b0,_0x58465e);break;case _0x03de('0x68'):if(_0x237d50['operator']===_0x03de('0x5f')){_0x2eef5b[_0x536a9d]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x237d50[_0x03de('0x59')]+'%',null);}else{_0x24edb2=_['find'](_0x10d0c8,[_0x03de('0x2a'),_0x03de('0x69')]);_0x237d50[_0x03de('0x45')]='UserId';_0x349fa1=as[_0x03de('0x63')](_0x5c0a29,_0x24edb2[_0x03de('0x34')],_0x237d50);_0x2eef5b[_0x536a9d](_0x349fa1['text'],_0x349fa1[_0x03de('0x59')]['start'],_0x349fa1[_0x03de('0x59')][_0x03de('0x1e')]);}break;case _0x03de('0x6a'):_0x349fa1=as['buildExpression']('me',null,_0x237d50);_0x2eef5b[_0x536a9d](_0x349fa1['text'],_0x349fa1[_0x03de('0x59')][_0x03de('0x6b')],_0x349fa1[_0x03de('0x59')][_0x03de('0x1e')]);break;}}else{var _0x349fa1=as[_0x03de('0x63')](_0x5c0a29,_0x24edb2[_0x03de('0x34')],_0x237d50);_0x2eef5b[_0x536a9d](_0x349fa1[_0x03de('0x64')],_0x349fa1['value']['start'],_0x349fa1[_0x03de('0x59')][_0x03de('0x1e')]);}}}else{var _0x59d80d=_(_0x1c96a7[_0x03de('0x37')])[_0x03de('0x38')]()[_0x03de('0x2c')](function(_0x480890){return _[_0x03de('0x6c')](_0x10d0c8,[_0x03de('0x2a'),_0x480890])?_0x480890:undefined;})[_0x03de('0x6d')]()['value']();if(!_[_0x03de('0x6e')](_0x59d80d)){_0x59d80d[_0x03de('0x66')](function(_0x462970){if(_0x462970===_0x03de('0x6f')){_0x13d15c[_0x03de('0x42')]('i.WhatsappAccountId\x20IN\x20?',[][_0x03de('0x70')](_0x1c96a7[_0x03de('0x37')][_0x462970]));}else if(_0x462970===_0x03de('0x71')){var _0x2520fb=JSON['parse'](_0x1c96a7['query'][_0x462970])['$gte'];var _0x1735db=JSON['parse'](_0x1c96a7[_0x03de('0x37')][_0x462970])[_0x03de('0x72')];_0x13d15c[_0x03de('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2520fb,_0x1735db);}else{if(_0x1c96a7[_0x03de('0x37')][_0x462970]===_0x03de('0x73')){_0x13d15c[_0x03de('0x42')]('i.'+_0x462970+_0x03de('0x74'));}else{_0x13d15c['where']('i.'+_0x462970+_0x03de('0x75'),_0x1c96a7[_0x03de('0x37')][_0x462970]);}}});}if(_0x1c96a7['query']['read']){if(_0x1c96a7['query']['read']==0x1){_0x13d15c[_0x03de('0x5b')](_0x03de('0x76'));}else{_0x13d15c['having'](_0x03de('0x77'));}}if(_0x1c96a7[_0x03de('0x37')]['tag']){_0x4b29b0=_[_0x03de('0x78')](_0x1c96a7[_0x03de('0x37')]['tag'])?_0x1c96a7['query'][_0x03de('0x79')]:new Array(_0x1c96a7[_0x03de('0x37')][_0x03de('0x79')]);_0x4b29b0['forEach'](function(_0x4bcb3b){_0x3f00b1['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4bcb3b+',%');});}if(_0x1c96a7[_0x03de('0x37')][_0x03de('0x7a')]){var _0x1ad5db=_0x1c96a7[_0x03de('0x37')][_0x03de('0x7a')][_0x03de('0x7b')]('\x5c','\x5c\x5c')[_0x03de('0x7b')](/'/g,'\x27\x27');if(qs[_0x03de('0x7c')](_0x1ad5db)){_0x2eef5b['or']('i.id\x20LIKE\x20?',_0x1ad5db+'%')['or'](_0x03de('0x7d'),_0x1ad5db+'%');}else{_0x2eef5b['or'](_0x03de('0x7e'),qs[_0x03de('0x61')](_0x1ad5db))['or'](_0x03de('0x7f'),_0x1ad5db+'%');}}}_0x13d15c[_0x03de('0x42')](_0x2eef5b);_0x13d15c[_0x03de('0x80')](_0x03de('0x81'));var _0x3d0968={'type':db[_0x03de('0x82')][_0x03de('0x83')]['SELECT'],'raw':!![]};var _0x143be2=_0x13d15c['clone']();_0x143be2[_0x03de('0x45')](_0x03de('0x81'));_0x143be2[_0x03de('0x45')](_0x03de('0x84'),'unreadMessages');if(_0x6290da[_0x03de('0x40')]){_0x6290da['order'][_0x03de('0x66')](function(_0x328412){var _0x323d24=_0x328412[0x0]===_0x03de('0x85')?_0x328412[0x0]:'i.'+_0x328412[0x0];_0x13d15c[_0x03de('0x40')](_0x323d24,_0x328412[0x1]===_0x03de('0x86')?![]:!![]);});}if(!_[_0x03de('0x6e')](_0x4b29b0)){_0x13d15c[_0x03de('0x5b')](_0x3f00b1);_0x143be2['where'](_0x03de('0x87'),_0x4b29b0);}BPromise[_0x03de('0x88')]()[_0x03de('0x28')](function(){if(!_0x2434bd){if(_0x1c96a7['query'][_0x03de('0x6f')])return;_0x143be2[_0x03de('0x42')](_0x03de('0x89'));_0x13d15c['where'](_0x03de('0x89'));return;}if(_0x1c96a7[_0x03de('0x8a')][_0x03de('0x8b')]!==_0x03de('0x8c'))return;return _0x1c96a7[_0x03de('0x8a')][_0x03de('0x8d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x30daf8){if(_['isEmpty'](_0x30daf8)){_0x143be2['where'](_0x03de('0x8e'));_0x13d15c[_0x03de('0x42')](_0x03de('0x8e'));}else{_0x143be2[_0x03de('0x42')]('i.WhatsappAccountId\x20IN\x20?',_[_0x03de('0x2c')](_0x30daf8,'id'));_0x13d15c['where']('i.WhatsappAccountId\x20IN\x20?',_[_0x03de('0x2c')](_0x30daf8,'id'));}});})[_0x03de('0x28')](function(){if(_0x1c96a7[_0x03de('0x8a')][_0x03de('0x8b')]===_0x03de('0x8c')&&!_0x2434bd&&!_0x1c96a7[_0x03de('0x37')]['WhatsappAccountId'])return[];return db[_0x03de('0x8f')][_0x03de('0x37')](_0x143be2['toString'](),_0x3d0968);})['then'](function(_0x146eb3){_0x5bc7dd[_0x03de('0x23')]=_0x146eb3[_0x03de('0x3d')];if(_0x5bc7dd[_0x03de('0x23')]===0x0)return[];return db[_0x03de('0x8f')]['query'](_0x447b23[_0x03de('0x90')](),_0x3d0968)[_0x03de('0x28')](function(_0x292dee){_0x1e850a=_[_0x03de('0x91')](_0x292dee,'id');_0x3d0968=_[_0x03de('0x92')](_0x3d0968,{'model':db[_0x03de('0x93')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1c96a7[_0x03de('0x37')][_0x03de('0x3c')]){_0x6290da[_0x03de('0x3b')][_0x03de('0x66')](function(_0x1c3184){_0x13d15c[_0x03de('0x45')]('i.'+_0x1c3184);});}else{_0x13d15c['field'](_0x03de('0x84'),'unreadMessages');_0x13d15c[_0x03de('0x45')](_0x03de('0x94'),_0x03de('0x95'));_0x13d15c[_0x03de('0x45')]('a.mandatoryDisposition',_0x03de('0x96'));_0x13d15c[_0x03de('0x45')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x03de('0x85'));_0x13d15c[_0x03de('0x45')](_0x03de('0x97'));_0x13d15c[_0x03de('0x45')]('c.firstName','Contact.firstName');_0x13d15c['field'](_0x03de('0x98'),'Contact.lastName');_0x13d15c[_0x03de('0x45')](_0x03de('0x99'),'Contact.email');_0x13d15c[_0x03de('0x45')]('c.phone',_0x03de('0x9a'));_0x13d15c[_0x03de('0x45')](_0x03de('0x9b'),'Contact.mobile');_0x13d15c[_0x03de('0x45')](_0x03de('0x9c'),_0x03de('0x9d'));_0x13d15c[_0x03de('0x45')](_0x03de('0x9e'),_0x03de('0x9f'));_0x13d15c[_0x03de('0x45')](_0x03de('0xa0'),_0x03de('0xa1'));_0x13d15c[_0x03de('0x45')](_0x03de('0xa2'),'TagIds');}if(_0x6290da[_0x03de('0x21')])_0x13d15c[_0x03de('0x21')](_0x6290da[_0x03de('0x21')]);if(_0x6290da[_0x03de('0x20')])_0x13d15c['offset'](_0x6290da[_0x03de('0x20')]);return db[_0x03de('0x8f')][_0x03de('0x37')](_0x13d15c[_0x03de('0x90')](),_0x3d0968);})[_0x03de('0x28')](function(_0x4eeb0b){if(_0x4eeb0b[_0x03de('0x3d')]>0x0)_0x99b1a1[_0x03de('0x42')](_0x03de('0xa3'),_['map'](_0x4eeb0b,'id'));return db[_0x03de('0x8f')][_0x03de('0x37')](_0x99b1a1[_0x03de('0x90')](),_0x3d0968)['then'](function(_0x677818){var _0x439617=_[_0x03de('0xa4')](_0x677818,_0x03de('0xa5'));var _0x41ecf6=[];_0x4eeb0b[_0x03de('0x66')](function(_0x3baf68){_0x41ecf6[_0x03de('0x30')](updateWhatsappInteraction(_0x3baf68,_0x1e850a,_0x439617));});return BPromise[_0x03de('0xa6')](_0x41ecf6);});});})[_0x03de('0x28')](function(_0x1fb1c3){_0x5bc7dd[_0x03de('0xa7')]=_0x1fb1c3;return _0x5bc7dd;})[_0x03de('0x28')](respondWithFilteredResult(_0x46aa12,_0x6290da))[_0x03de('0x31')](handleError(_0x46aa12,null));};exports[_0x03de('0xa8')]=function(_0xfa03ad,_0x2171e4){var _0x47fdf8={'raw':![],'where':{'id':_0xfa03ad['params']['id']}},_0x1e847a={};_0x1e847a[_0x03de('0x36')]=_['keys'](db[_0x03de('0x93')][_0x03de('0xa9')]);_0x1e847a[_0x03de('0x37')]=_[_0x03de('0x38')](_0xfa03ad['query']);_0x1e847a[_0x03de('0x39')]=_['intersection'](_0x1e847a[_0x03de('0x36')],_0x1e847a['query']);_0x47fdf8['attributes']=_[_0x03de('0x3a')](_0x1e847a[_0x03de('0x36')],qs[_0x03de('0x3c')](_0xfa03ad['query'][_0x03de('0x3c')]));_0x47fdf8[_0x03de('0x3b')]=_0x47fdf8[_0x03de('0x3b')][_0x03de('0x3d')]?_0x47fdf8['attributes']:_0x1e847a['model'];if(_0xfa03ad[_0x03de('0x37')]['includeAll']){_0x47fdf8['include']=[{'all':!![]}];}_0x47fdf8=_[_0x03de('0x92')]({},_0x47fdf8,_0xfa03ad[_0x03de('0xaa')]);return db[_0x03de('0x93')]['find'](_0x47fdf8)[_0x03de('0x28')](handleEntityNotFound(_0x2171e4,null))[_0x03de('0x28')](respondWithResult(_0x2171e4,null))[_0x03de('0x31')](handleError(_0x2171e4,null));};exports[_0x03de('0xab')]=function(_0x475c57,_0x980882){return db['WhatsappInteraction'][_0x03de('0xab')](_0x475c57[_0x03de('0x6a')],{})[_0x03de('0x28')](respondWithResult(_0x980882,0xc9))['catch'](handleError(_0x980882,null));};exports[_0x03de('0x27')]=function(_0xe36ac8,_0x1734ab){if(_0xe36ac8[_0x03de('0x6a')]['id']){delete _0xe36ac8[_0x03de('0x6a')]['id'];}return db[_0x03de('0x93')]['find']({'where':{'id':_0xe36ac8[_0x03de('0xac')]['id']}})[_0x03de('0x28')](handleEntityNotFound(_0x1734ab,null))[_0x03de('0x28')](saveUpdates(_0xe36ac8[_0x03de('0x6a')],null))[_0x03de('0x28')](respondWithResult(_0x1734ab,null))[_0x03de('0x31')](handleError(_0x1734ab,null));};exports[_0x03de('0xad')]=function(_0x1b51de,_0x150031){return db[_0x03de('0x93')][_0x03de('0x58')]({'where':{'id':_0x1b51de[_0x03de('0xac')]['id']}})[_0x03de('0x28')](handleEntityNotFound(_0x150031,null))[_0x03de('0x28')](removeEntity(_0x150031,null))[_0x03de('0x31')](handleError(_0x150031,null));};exports[_0x03de('0xae')]=function(_0x22c201,_0x4760a4){return db[_0x03de('0x93')][_0x03de('0xae')]()[_0x03de('0x28')](respondWithResult(_0x4760a4,null))[_0x03de('0x31')](handleError(_0x4760a4,null));};exports[_0x03de('0xaf')]=function(_0x40fea2,_0x112a0a,_0x3256e8){return db[_0x03de('0xb0')]['find']({'where':{'id':_0x40fea2[_0x03de('0xac')]['id']}})[_0x03de('0x28')](handleEntityNotFound(_0x112a0a,null))[_0x03de('0x28')](function(_0x7d147c){if(_0x7d147c){return _0x7d147c[_0x03de('0xaf')](_0x40fea2[_0x03de('0x6a')][_0x03de('0xb1')],_['omit'](_0x40fea2[_0x03de('0x6a')],[_0x03de('0xb1'),'id'])||{});}})['then'](respondWithResult(_0x112a0a,null))[_0x03de('0x31')](handleError(_0x112a0a,null));};exports['getMessages']=function(_0x1e39e0,_0x2e51ba,_0x2b31f7){var _0x157dde={'raw':![],'where':{}};var _0x4ef9f9={};var _0x6412b7={'count':0x0,'rows':[]};return db[_0x03de('0x93')][_0x03de('0xb2')]({'where':{'id':_0x1e39e0['params']['id']}})[_0x03de('0x28')](handleEntityNotFound(_0x2e51ba,null))[_0x03de('0x28')](function(_0x1153dc){if(_0x1153dc){_0x4ef9f9[_0x03de('0x36')]=_[_0x03de('0x38')](db[_0x03de('0xb0')][_0x03de('0xa9')]);_0x4ef9f9[_0x03de('0x37')]=_[_0x03de('0x38')](_0x1e39e0[_0x03de('0x37')]);_0x4ef9f9[_0x03de('0x39')]=_[_0x03de('0x3a')](_0x4ef9f9['model'],_0x4ef9f9[_0x03de('0x37')]);_0x157dde[_0x03de('0x3b')]=_[_0x03de('0x3a')](_0x4ef9f9['model'],qs[_0x03de('0x3c')](_0x1e39e0[_0x03de('0x37')][_0x03de('0x3c')]));_0x157dde[_0x03de('0x3b')]=_0x157dde[_0x03de('0x3b')]['length']?_0x157dde[_0x03de('0x3b')]:_0x4ef9f9['model'];if(!_0x1e39e0['query'][_0x03de('0x3e')](_0x03de('0x3f'))){_0x157dde[_0x03de('0x21')]=qs[_0x03de('0x21')](_0x1e39e0[_0x03de('0x37')][_0x03de('0x21')]);_0x157dde[_0x03de('0x20')]=qs[_0x03de('0x20')](_0x1e39e0['query'][_0x03de('0x20')]);}_0x157dde[_0x03de('0x40')]=qs[_0x03de('0x41')](_0x1e39e0['query'][_0x03de('0x41')]);_0x157dde['where']=qs[_0x03de('0x39')](_[_0x03de('0x43')](_0x1e39e0[_0x03de('0x37')],_0x4ef9f9[_0x03de('0x39')]));_0x157dde[_0x03de('0x42')][_0x03de('0xa5')]=_0x1153dc['id'];if(_0x1e39e0[_0x03de('0x37')]['filter']){_0x157dde['where']=_[_0x03de('0x92')](_0x157dde[_0x03de('0x42')],{'$or':_[_0x03de('0x2c')](_0x157dde['attributes'],function(_0x3c7eb1){var _0x126e9f={};_0x126e9f[_0x3c7eb1]={'$like':'%'+_0x1e39e0[_0x03de('0x37')][_0x03de('0x7a')]+'%'};return _0x126e9f;})});}if(_0x1e39e0[_0x03de('0x37')][_0x03de('0xb3')]){var _0x171298=_0x1e39e0['query'][_0x03de('0xb3')][_0x03de('0x2e')](',');var _0xdb494={};_0xdb494[_0x171298[0x0]]={'$gte':moment(_0x171298[0x1])[_0x03de('0xb4')](_0x03de('0xb5'))};_0x157dde[_0x03de('0x42')]=_[_0x03de('0x92')](_0x157dde['where'],_0xdb494);}_0x157dde=_[_0x03de('0x92')]({},_0x157dde,_0x1e39e0[_0x03de('0xaa')]);return db['WhatsappMessage'][_0x03de('0x23')]({'where':_0x157dde['where']})[_0x03de('0x28')](function(_0x91b0b){_0x6412b7['count']=_0x91b0b;if(_0x1e39e0['query'][_0x03de('0xb6')]){_0x157dde[_0x03de('0xb7')]=[{'all':!![]}];}return db[_0x03de('0xb0')][_0x03de('0xb8')](_0x157dde);})['then'](function(_0x49ebbd){_0x6412b7[_0x03de('0xa7')]=_0x49ebbd;return _0x6412b7;});}})[_0x03de('0x28')](respondWithFilteredResult(_0x2e51ba,_0x157dde))[_0x03de('0x31')](handleError(_0x2e51ba,null));};exports[_0x03de('0xb9')]=function(_0x12cc15,_0x51cfe1,_0x447723){return db[_0x03de('0x93')]['find']({'where':{'id':_0x12cc15[_0x03de('0xac')]['id']}})[_0x03de('0x28')](handleEntityNotFound(_0x51cfe1,null))[_0x03de('0x28')](function(_0x4c8cab){if(_0x4c8cab){return _0x4c8cab['setTags'](_0x12cc15['body'][_0x03de('0xb1')],_[_0x03de('0xba')](_0x12cc15[_0x03de('0x6a')],[_0x03de('0xb1'),'id'])||{})[_0x03de('0xbb')](function(){return db[_0x03de('0x65')]['findAll']({'attributes':['id',_0x03de('0x2a'),_0x03de('0x46')],'where':{'id':_0x12cc15[_0x03de('0x6a')]['ids']}});})['then'](function(_0x497b1a){socket[_0x03de('0xbc')](_0x03de('0xbd'),{'id':Number(_0x12cc15[_0x03de('0xac')]['id']),'tags':_0x497b1a||[]});return{'id':Number(_0x12cc15[_0x03de('0xac')]['id']),'tags':_0x497b1a||[]};});}})['then'](respondWithResult(_0x51cfe1,null))[_0x03de('0x31')](handleError(_0x51cfe1,null));};exports[_0x03de('0xbe')]=function(_0x355d38,_0x123b9a,_0x252327){return db['WhatsappInteraction'][_0x03de('0x58')]({'where':{'id':_0x355d38[_0x03de('0xac')]['id']}})[_0x03de('0x28')](handleEntityNotFound(_0x123b9a,null))[_0x03de('0x28')](function(_0x3fa5a7){if(_0x3fa5a7){return _0x3fa5a7[_0x03de('0xbe')](_0x355d38[_0x03de('0x37')][_0x03de('0xb1')]);}})[_0x03de('0x28')](respondWithStatusCode(_0x123b9a,null))[_0x03de('0x31')](handleError(_0x123b9a,null));};exports[_0x03de('0xbf')]=function(_0x1ddf3a,_0x28793b){var _0x5c8429=moment()[_0x03de('0xc0')]()[_0x03de('0x90')]();var _0x2ba61d=path[_0x03de('0xc1')](config[_0x03de('0xc2')],'server',_0x03de('0xc3'),_0x03de('0xc4'));var _0x12f478=path[_0x03de('0xc1')](config[_0x03de('0xc2')],_0x03de('0xc5'),'files',_0x03de('0xc6'));var _0x777f48=path[_0x03de('0xc1')](_0x2ba61d,_0x5c8429);var _0x208ff6=util['format'](_0x03de('0xc7'),_0x1ddf3a['params']['id'],_0x5c8429);var _0x3a60c7=path[_0x03de('0xc1')](_0x2ba61d,_0x208ff6);var _0x26c5c7=[];_0x26c5c7[_0x03de('0x30')]({'model':db['User'],'as':_0x03de('0x68'),'attributes':['id','fullname'],'raw':!![]});_0x26c5c7['push']({'model':db[_0x03de('0xc8')],'as':_0x03de('0x5d'),'attributes':['id',_0x03de('0xc9'),_0x03de('0xca')],'raw':!![]});if(_0x1ddf3a[_0x03de('0x37')][_0x03de('0xc6')]){_0x26c5c7['push']({'model':db[_0x03de('0xcb')],'as':_0x03de('0xcb'),'raw':!![]});}var _0x2a5599=[{'model':db[_0x03de('0xb0')],'as':_0x03de('0xcc'),'attributes':['id',_0x03de('0x6a'),_0x03de('0x71'),_0x03de('0xcd'),_0x03de('0xce'),_0x03de('0xcf')],'include':_0x26c5c7}];_0x2a5599['push']({'model':db['WhatsappAccount'],'as':_0x03de('0xd0'),'attributes':['id',_0x03de('0x2a')]});_0x2a5599[_0x03de('0x30')]({'model':db[_0x03de('0x68')],'as':_0x03de('0xd1'),'attributes':['id',_0x03de('0xd2')]});return db[_0x03de('0x93')]['find']({'where':{'id':_0x1ddf3a['params']['id']},'include':_0x2a5599})[_0x03de('0x28')](handleEntityNotFound(_0x28793b,null))[_0x03de('0x28')](function(_0x4f65ec){if(_0x4f65ec){var _0xd33c04=_0x4f65ec[_0x03de('0xd3')]({'plain':!![]});fs['mkdirSync'](_0x777f48);var _0x173f5b={'channel':_0x03de('0xd4'),'account':_0xd33c04['Account']['name'],'agent':_0xd33c04[_0x03de('0xd1')]?_0xd33c04[_0x03de('0xd1')]['fullname']:'N.A.','createdAt':moment(_0xd33c04['createdAt'])[_0x03de('0xb4')]('YYYY-MM-DD\x20HH:mm:ss')[_0x03de('0x90')](),'closedAt':_0xd33c04[_0x03de('0xd5')]?moment(_0xd33c04['closedAt'])['format'](_0x03de('0xb5'))['toString']():'','disposition':_0xd33c04['disposition'],'messages':_(_0xd33c04[_0x03de('0xcc')])['filter']({'secret':![]})[_0x03de('0x2c')](function(_0x24fb0a){if(_0x24fb0a[_0x03de('0xcb')]){var _0x27927a=path[_0x03de('0xc1')](_0x12f478,_0x24fb0a[_0x03de('0xcb')]['basename']);if(fs[_0x03de('0xd6')](_0x27927a)){fs[_0x03de('0xd7')](_0x27927a)[_0x03de('0xd8')](fs[_0x03de('0xd9')](path[_0x03de('0xc1')](_0x777f48,_0x24fb0a['Attachment']['basename'])));}}return{'date':moment(_0x24fb0a[_0x03de('0x71')])[_0x03de('0xb4')](_0x03de('0xb5'))[_0x03de('0x90')](),'sender':_0x24fb0a[_0x03de('0xcd')]===_0x03de('0xda')?_0x24fb0a[_0x03de('0x68')]?_0x24fb0a[_0x03de('0x68')][_0x03de('0xd2')]:'System':_0x24fb0a[_0x03de('0x5d')][_0x03de('0xc9')]+(_0x24fb0a[_0x03de('0x5d')][_0x03de('0xca')]?'\x20'+_0x24fb0a[_0x03de('0x5d')][_0x03de('0xca')]:''),'body':_0x24fb0a[_0x03de('0xcb')]?_0x24fb0a[_0x03de('0xcb')][_0x03de('0xdb')]:_0x24fb0a[_0x03de('0x6a')],'direction':_0x24fb0a[_0x03de('0xcd')]===_0x03de('0xda')?'A':'C','secret':_0x24fb0a[_0x03de('0xce')],'read':_0x24fb0a[_0x03de('0xcf')],'attachment':_0x24fb0a[_0x03de('0xcb')]};})['value']()};return ejs[_0x03de('0xdc')](path[_0x03de('0xc1')](config[_0x03de('0xc2')],_0x03de('0xc5'),'views','downloadInteraction.ejs'),{'interaction':_0x173f5b})[_0x03de('0x28')](function(_0x475707){var _0x4a345b=path[_0x03de('0xc1')](_0x777f48,_0x03de('0xdd')+_0xd33c04['id']+'-'+_0x5c8429+_0x03de('0xde'));var _0x29fcec={'path':_0x4a345b,'channel':_0x03de('0xd4'),'interactionId':_0xd33c04['id']};return pdf[_0x03de('0xdf')](_0x475707,_0x29fcec);})[_0x03de('0x28')](function(){return new BPromise(function(_0xd51221,_0x5e1cd1){zipdir(_0x777f48,{'saveTo':_0x3a60c7},function(_0x3fa11a,_0x17203e){if(_0x3fa11a)return _0x5e1cd1(_0x3fa11a);return _0xd51221(_0x17203e);});})[_0x03de('0x28')](function(){return new BPromise(function(_0x44ffd6,_0x1e9a2d){rimraf(_0x777f48,function(_0x1841c4){if(_0x1841c4)_0x1e9a2d(_0x1841c4);return _0x44ffd6();});});})[_0x03de('0x28')](function(){return _0x28793b[_0x03de('0xbf')](_0x3a60c7,_0x208ff6,function(_0x5aa93c){if(_0x5aa93c){console[_0x03de('0xe0')](_0x03de('0xe1'),_0x5aa93c);}else{fs[_0x03de('0xe2')](_0x3a60c7);}});});});}else{return _0x28793b[_0x03de('0x1c')](0xc8);}})[_0x03de('0x31')](handleError(_0x28793b,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 80be827..0cbec37 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 _0x1be1=['hook','exports','WhatsappInteraction','../../mysqldb','setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','length','emit','catch'];(function(_0x3e8543,_0x540696){var _0x6da8e2=function(_0x152bb5){while(--_0x152bb5){_0x3e8543['push'](_0x3e8543['shift']());}};_0x6da8e2(++_0x540696);}(_0x1be1,0x192));var _0x11be=function(_0x23ada4,_0x347d61){_0x23ada4=_0x23ada4-0x0;var _0x580bf0=_0x1be1[_0x23ada4];return _0x580bf0;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db'][_0x11be('0x0')];var WhatsappMessage=require(_0x11be('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x11be('0x2')](0x0);var events={'afterCreate':_0x11be('0x3'),'afterUpdate':_0x11be('0x4'),'afterDestroy':_0x11be('0x5')};function emitEvent(_0x504d3a){return function(_0x3ce56d,_0xdc7b97,_0x11f793){_0x3ce56d['getUsers']({'attributes':['id'],'raw':!![]})[_0x11be('0x6')](function(_0x497730){_0x3ce56d[_0x11be('0x7')](_0x11be('0x8'),_0x497730[_0x11be('0x9')](function(_0x461e17){return{'id':_0x461e17['id']};}));return WhatsappMessage[_0x11be('0xa')]({'where':{'WhatsappInteractionId':_0x3ce56d['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2bf6db){_0x3ce56d[_0x11be('0x7')]('unreadMessages',_0x2bf6db[_0x11be('0xb')]);WhatsappInteractionEvents[_0x11be('0xc')](_0x504d3a+':'+_0x3ce56d['id'],_0x3ce56d);WhatsappInteractionEvents[_0x11be('0xc')](_0x504d3a,_0x3ce56d);_0x11f793(null);})[_0x11be('0xd')](_0x11f793(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x11be('0xe')](e,emitEvent(event));}}module[_0x11be('0xf')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x9348=['WhatsappMessage','save','update','getUsers','then','setDataValue','Users','map','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction'];(function(_0x31d788,_0x47acde){var _0x220984=function(_0x31cffa){while(--_0x31cffa){_0x31d788['push'](_0x31d788['shift']());}};_0x220984(++_0x47acde);}(_0x9348,0x10d));var _0x8934=function(_0x53838e,_0x5c3cd2){_0x53838e=_0x53838e-0x0;var _0x38e8ee=_0x9348[_0x53838e];return _0x38e8ee;};'use strict';var EventEmitter=require(_0x8934('0x0'));var WhatsappInteraction=require(_0x8934('0x1'))['db'][_0x8934('0x2')];var WhatsappMessage=require(_0x8934('0x1'))['db'][_0x8934('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8934('0x4'),'afterUpdate':_0x8934('0x5'),'afterDestroy':'remove'};function emitEvent(_0x34f94c){return function(_0x923aa3,_0xefbef9,_0x2bce03){_0x923aa3[_0x8934('0x6')]({'attributes':['id'],'raw':!![]})[_0x8934('0x7')](function(_0x512f30){_0x923aa3[_0x8934('0x8')](_0x8934('0x9'),_0x512f30[_0x8934('0xa')](function(_0x53cbdf){return{'id':_0x53cbdf['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x923aa3['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5336f0){_0x923aa3[_0x8934('0x8')]('unreadMessages',_0x5336f0[_0x8934('0xb')]);WhatsappInteractionEvents[_0x8934('0xc')](_0x34f94c+':'+_0x923aa3['id'],_0x923aa3);WhatsappInteractionEvents[_0x8934('0xc')](_0x34f94c,_0x923aa3);_0x2bce03(null);})[_0x8934('0xd')](_0x2bce03(null));};}for(var e in events){if(events[_0x8934('0xe')](e)){var event=events[e];WhatsappInteraction[_0x8934('0xf')](e,emitEvent(event));}}module[_0x8934('0x10')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 8dd2898..367acd0 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 _0x2458=['../../config/environment','./whatsappInteraction.attributes','exports','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x2458,0x167));var _0x8245=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x2458[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x8245('0x0'));var util=require(_0x8245('0x1'));var logger=require(_0x8245('0x2'))(_0x8245('0x3'));var moment=require(_0x8245('0x4'));var BPromise=require(_0x8245('0x5'));var rp=require(_0x8245('0x6'));var fs=require('fs');var path=require(_0x8245('0x7'));var rimraf=require(_0x8245('0x8'));var config=require(_0x8245('0x9'));var attributes=require(_0x8245('0xa'));module[_0x8245('0xb')]=function(_0xd7f101,_0x2b9d09){return _0xd7f101['define']('WhatsappInteraction',attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x23c92f,_0x2704ab,_0x2110ed){if(_0x23c92f[_0x8245('0xc')](_0x8245('0xd'))){_0x23c92f['closedAt']=moment()[_0x8245('0xe')](_0x8245('0xf'));}_0x2110ed(null,_0x23c92f);}}});}; \ No newline at end of file +var _0x8946=['../../config/logger','api','path','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x8946,0x193));var _0x6894=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x8946[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0x6894('0x0'));var util=require(_0x6894('0x1'));var logger=require(_0x6894('0x2'))(_0x6894('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6894('0x4'));var rimraf=require('rimraf');var config=require(_0x6894('0x5'));var attributes=require(_0x6894('0x6'));module[_0x6894('0x7')]=function(_0x1a6c56,_0x14a518){return _0x1a6c56[_0x6894('0x8')](_0x6894('0x9'),attributes,{'tableName':_0x6894('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4486fc,_0x5b2556,_0x1e71e8){if(_0x4486fc[_0x6894('0xb')](_0x6894('0xc'))){_0x4486fc[_0x6894('0xd')]=moment()['format'](_0x6894('0xe'));}_0x1e71e8(null,_0x4486fc);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 7d5b0f5..ea83011 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 _0xe551=['request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','attributes','limit','find','where','addTags','ids','omit','spread','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register'];(function(_0x4a0c93,_0x3514ef){var _0x2b794b=function(_0x4d215d){while(--_0x4d215d){_0x4a0c93['push'](_0x4a0c93['shift']());}};_0x2b794b(++_0x3514ef);}(_0xe551,0x6c));var _0x1e55=function(_0x3608fd,_0x1c392a){_0x3608fd=_0x3608fd-0x0;var _0x347f06=_0xe551[_0x3608fd];return _0x347f06;};'use strict';var _=require('lodash');var util=require(_0x1e55('0x0'));var moment=require(_0x1e55('0x1'));var BPromise=require(_0x1e55('0x2'));var rs=require(_0x1e55('0x3'));var fs=require('fs');var Redis=require(_0x1e55('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1e55('0x5'));var logger=require(_0x1e55('0x6'))('rpc');var config=require(_0x1e55('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1e55('0x8')][_0x1e55('0x9')]({'port':0x232a});config[_0x1e55('0xa')]=_[_0x1e55('0xb')](config[_0x1e55('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x1e55('0xc'))(new Redis(config[_0x1e55('0xa')]));require(_0x1e55('0xd'))[_0x1e55('0xe')](socket);function respondWithRpcPromise(_0x4f2732,_0x427792,_0x43a4bd){return new BPromise(function(_0x4f7179,_0x1afb34){return client[_0x1e55('0xf')](_0x4f2732,_0x43a4bd)[_0x1e55('0x10')](function(_0xfb27c5){logger[_0x1e55('0x11')](_0x1e55('0x12'),_0x427792,_0x1e55('0x13'));logger[_0x1e55('0x14')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x427792,_0x1e55('0x13'),JSON[_0x1e55('0x15')](_0xfb27c5));if(_0xfb27c5[_0x1e55('0x16')]){if(_0xfb27c5['error'][_0x1e55('0x17')]===0x1f4){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x427792,_0xfb27c5['error'][_0x1e55('0x18')]);return _0x1afb34(_0xfb27c5[_0x1e55('0x16')][_0x1e55('0x18')]);}logger[_0x1e55('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x427792,_0xfb27c5[_0x1e55('0x16')][_0x1e55('0x18')]);return _0x4f7179(_0xfb27c5[_0x1e55('0x16')][_0x1e55('0x18')]);}else{logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x427792,'request\x20sent');_0x4f7179(_0xfb27c5[_0x1e55('0x19')][_0x1e55('0x18')]);}})[_0x1e55('0x1a')](function(_0x7d99c0){logger[_0x1e55('0x16')](_0x1e55('0x12'),_0x427792,_0x7d99c0);_0x1afb34(_0x7d99c0);});});}exports[_0x1e55('0x1b')]=function(_0x5542da){var _0x5b752e=this;return new Promise(function(_0x4f1bc6,_0x1071b7){return db[_0x1e55('0x1c')][_0x1e55('0x1d')](_0x5542da[_0x1e55('0x1e')],{'raw':_0x5542da[_0x1e55('0x1f')]?_0x5542da[_0x1e55('0x1f')][_0x1e55('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5542da[_0x1e55('0x1f')]?_0x5542da[_0x1e55('0x1f')]['where']||null:null,'attributes':_0x5542da[_0x1e55('0x1f')]?_0x5542da[_0x1e55('0x1f')][_0x1e55('0x21')]||null:null,'limit':_0x5542da[_0x1e55('0x1f')]?_0x5542da[_0x1e55('0x1f')][_0x1e55('0x22')]||null:null})[_0x1e55('0x10')](function(_0x2b8cdc){logger[_0x1e55('0x11')]('UpdateWhatsappInteraction',_0x5542da);logger[_0x1e55('0x14')]('UpdateWhatsappInteraction',_0x5542da,JSON[_0x1e55('0x15')](_0x2b8cdc));_0x4f1bc6(_0x2b8cdc);})[_0x1e55('0x1a')](function(_0x334b55){logger[_0x1e55('0x16')]('UpdateWhatsappInteraction',_0x334b55[_0x1e55('0x18')],_0x5542da);_0x1071b7(_0x5b752e[_0x1e55('0x16')](0x1f4,_0x334b55['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x34400a){return new Promise(function(_0x559b8f,_0x49375a){return db[_0x1e55('0x1c')][_0x1e55('0x23')]({'where':_0x34400a['options']?_0x34400a['options'][_0x1e55('0x24')]||null:null})[_0x1e55('0x10')](function(_0x4246bf){if(_0x4246bf){return _0x4246bf[_0x1e55('0x25')](_0x34400a[_0x1e55('0x1e')][_0x1e55('0x26')],_[_0x1e55('0x27')](_0x34400a[_0x1e55('0x1e')],[_0x1e55('0x26'),'id'])||{});}})[_0x1e55('0x28')](function(_0x228a86){logger[_0x1e55('0x11')]('AddTags',_0x34400a);logger[_0x1e55('0x14')]('AddTags',_0x34400a,JSON[_0x1e55('0x15')](_0x228a86));_0x559b8f(_0x228a86);})[_0x1e55('0x1a')](function(_0x47c160){logger[_0x1e55('0x16')]('AddTags',_0x47c160[_0x1e55('0x18')],_0x34400a);_0x49375a(_this[_0x1e55('0x16')](0x1f4,_0x47c160['message']));});});}; \ No newline at end of file +var _0x2b33=['AddTags','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter','register','request','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','WhatsappInteraction','options','raw','where','attributes','limit','then','UpdateWhatsappInteraction','find','body','ids','omit'];(function(_0x743d3c,_0x830baf){var _0x365acd=function(_0x7539b9){while(--_0x7539b9){_0x743d3c['push'](_0x743d3c['shift']());}};_0x365acd(++_0x830baf);}(_0x2b33,0xba));var _0x32b3=function(_0x12d0ed,_0x54f3f6){_0x12d0ed=_0x12d0ed-0x0;var _0x1bea4e=_0x2b33[_0x12d0ed];return _0x1bea4e;};'use strict';var _=require(_0x32b3('0x0'));var util=require('util');var moment=require(_0x32b3('0x1'));var BPromise=require(_0x32b3('0x2'));var rs=require(_0x32b3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x32b3('0x4'));var logger=require(_0x32b3('0x5'))(_0x32b3('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x32b3('0x7')][_0x32b3('0x8')]({'port':0x232a});config[_0x32b3('0x9')]=_['defaults'](config[_0x32b3('0x9')],{'host':_0x32b3('0xa'),'port':0x18eb});var socket=require(_0x32b3('0xb'))(new Redis(config[_0x32b3('0x9')]));require('./whatsappInteraction.socket')[_0x32b3('0xc')](socket);function respondWithRpcPromise(_0x44b69f,_0x2539ed,_0x334ebc){return new BPromise(function(_0x3f1b21,_0x1cd33a){return client[_0x32b3('0xd')](_0x44b69f,_0x334ebc)['then'](function(_0x1ec088){logger['info'](_0x32b3('0xe'),_0x2539ed,_0x32b3('0xf'));logger[_0x32b3('0x10')](_0x32b3('0x11'),_0x2539ed,_0x32b3('0xf'),JSON[_0x32b3('0x12')](_0x1ec088));if(_0x1ec088[_0x32b3('0x13')]){if(_0x1ec088['error']['code']===0x1f4){logger[_0x32b3('0x13')](_0x32b3('0xe'),_0x2539ed,_0x1ec088[_0x32b3('0x13')][_0x32b3('0x14')]);return _0x1cd33a(_0x1ec088[_0x32b3('0x13')][_0x32b3('0x14')]);}logger[_0x32b3('0x13')](_0x32b3('0xe'),_0x2539ed,_0x1ec088[_0x32b3('0x13')]['message']);return _0x3f1b21(_0x1ec088['error'][_0x32b3('0x14')]);}else{logger[_0x32b3('0x15')]('WhatsappInteraction,\x20%s,\x20%s',_0x2539ed,'request\x20sent');_0x3f1b21(_0x1ec088[_0x32b3('0x16')]['message']);}})[_0x32b3('0x17')](function(_0x3fb613){logger[_0x32b3('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x2539ed,_0x3fb613);_0x1cd33a(_0x3fb613);});});}exports['UpdateWhatsappInteraction']=function(_0x4020df){var _0x31c818=this;return new Promise(function(_0x5508c5,_0x4e3db1){return db[_0x32b3('0x18')]['update'](_0x4020df['body'],{'raw':_0x4020df[_0x32b3('0x19')]?_0x4020df[_0x32b3('0x19')][_0x32b3('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4020df[_0x32b3('0x19')]?_0x4020df[_0x32b3('0x19')][_0x32b3('0x1b')]||null:null,'attributes':_0x4020df[_0x32b3('0x19')]?_0x4020df[_0x32b3('0x19')][_0x32b3('0x1c')]||null:null,'limit':_0x4020df[_0x32b3('0x19')]?_0x4020df[_0x32b3('0x19')][_0x32b3('0x1d')]||null:null})[_0x32b3('0x1e')](function(_0x11c1b3){logger[_0x32b3('0x15')]('UpdateWhatsappInteraction',_0x4020df);logger[_0x32b3('0x10')](_0x32b3('0x1f'),_0x4020df,JSON[_0x32b3('0x12')](_0x11c1b3));_0x5508c5(_0x11c1b3);})[_0x32b3('0x17')](function(_0x3b92c9){logger[_0x32b3('0x13')](_0x32b3('0x1f'),_0x3b92c9[_0x32b3('0x14')],_0x4020df);_0x4e3db1(_0x31c818[_0x32b3('0x13')](0x1f4,_0x3b92c9['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x288071){return new Promise(function(_0x1f2d5c,_0x4757e3){return db[_0x32b3('0x18')][_0x32b3('0x20')]({'where':_0x288071[_0x32b3('0x19')]?_0x288071['options'][_0x32b3('0x1b')]||null:null})[_0x32b3('0x1e')](function(_0x1ddc8b){if(_0x1ddc8b){return _0x1ddc8b['addTags'](_0x288071[_0x32b3('0x21')][_0x32b3('0x22')],_[_0x32b3('0x23')](_0x288071[_0x32b3('0x21')],[_0x32b3('0x22'),'id'])||{});}})['spread'](function(_0x200fa8){logger[_0x32b3('0x15')](_0x32b3('0x24'),_0x288071);logger[_0x32b3('0x10')]('AddTags',_0x288071,JSON['stringify'](_0x200fa8));_0x1f2d5c(_0x200fa8);})[_0x32b3('0x17')](function(_0x54c6ed){logger[_0x32b3('0x13')](_0x32b3('0x24'),_0x54c6ed[_0x32b3('0x14')],_0x288071);_0x4757e3(_this[_0x32b3('0x13')](0x1f4,_0x54c6ed[_0x32b3('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 210e7b2..1f6f6a9 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 _0x2ab1=['emit','removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x1c4e8f,_0x4808c9){var _0x5861ab=function(_0x52f8c0){while(--_0x52f8c0){_0x1c4e8f['push'](_0x1c4e8f['shift']());}};_0x5861ab(++_0x4808c9);}(_0x2ab1,0xb4));var _0x12ab=function(_0x502291,_0x21bfdb){_0x502291=_0x502291-0x0;var _0x9c734e=_0x2ab1[_0x502291];return _0x9c734e;};'use strict';var WhatsappInteractionEvents=require(_0x12ab('0x0'));var events=[_0x12ab('0x1'),'remove','update'];function createListener(_0x33c945,_0x547b8c){return function(_0x4513b9){_0x547b8c[_0x12ab('0x2')](_0x33c945,_0x4513b9);};}function removeListener(_0x5d7996,_0x1a38e4){return function(){WhatsappInteractionEvents[_0x12ab('0x3')](_0x5d7996,_0x1a38e4);};}exports[_0x12ab('0x4')]=function(_0x2cd0ae){for(var _0x4fd721=0x0,_0x33700e=events[_0x12ab('0x5')];_0x4fd721<_0x33700e;_0x4fd721++){var _0x547a10=events[_0x4fd721];var _0x35083a=createListener(_0x12ab('0x6')+_0x547a10,_0x2cd0ae);WhatsappInteractionEvents['on'](_0x547a10,_0x35083a);}}; \ No newline at end of file +var _0xe7b6=['update','emit','removeListener','register','length','whatsappInteraction:','save','remove'];(function(_0x1f4333,_0x4c7f3d){var _0x2b0005=function(_0x573f51){while(--_0x573f51){_0x1f4333['push'](_0x1f4333['shift']());}};_0x2b0005(++_0x4c7f3d);}(_0xe7b6,0x15e));var _0x6e7b=function(_0x2a0db9,_0x3240d1){_0x2a0db9=_0x2a0db9-0x0;var _0x42dd01=_0xe7b6[_0x2a0db9];return _0x42dd01;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x6e7b('0x0'),_0x6e7b('0x1'),_0x6e7b('0x2')];function createListener(_0x4b346e,_0x16f880){return function(_0x301b02){_0x16f880[_0x6e7b('0x3')](_0x4b346e,_0x301b02);};}function removeListener(_0x590820,_0x4c4938){return function(){WhatsappInteractionEvents[_0x6e7b('0x4')](_0x590820,_0x4c4938);};}exports[_0x6e7b('0x5')]=function(_0x1a5a56){for(var _0x4fe210=0x0,_0x270a9e=events[_0x6e7b('0x6')];_0x4fe210<_0x270a9e;_0x4fe210++){var _0x63af1=events[_0x4fe210];var _0x2570ca=createListener(_0x6e7b('0x7')+_0x63af1,_0x1a5a56);WhatsappInteractionEvents['on'](_0x63af1,_0x2570ca);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 09d1e8c..f913002 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 _0x7432=['../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','tracked','whatsapp','create','/:id/status','status','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3835f1,_0x1f2fa6){var _0x1a7807=function(_0x3d54e2){while(--_0x3d54e2){_0x3835f1['push'](_0x3835f1['shift']());}};_0x1a7807(++_0x1f2fa6);}(_0x7432,0xf0));var _0x2743=function(_0x27ece9,_0x3c62a0){_0x27ece9=_0x27ece9-0x0;var _0x321d58=_0x7432[_0x27ece9];return _0x321d58;};'use strict';var multer=require(_0x2743('0x0'));var util=require(_0x2743('0x1'));var path=require(_0x2743('0x2'));var timeout=require(_0x2743('0x3'));var express=require(_0x2743('0x4'));var router=express[_0x2743('0x5')]();var fs_extra=require(_0x2743('0x6'));var auth=require(_0x2743('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x2743('0x8'));var controller=require('./whatsappMessage.controller');router[_0x2743('0x9')]('/',auth[_0x2743('0xa')](),controller[_0x2743('0xb')]);router['get'](_0x2743('0xc'),auth[_0x2743('0xa')](),controller[_0x2743('0xd')]);router[_0x2743('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x2743('0xe')]);router[_0x2743('0xf')]('/',auth['isAuthenticated'](),interaction[_0x2743('0x10')](_0x2743('0x11'),'whatsappmessage:create'),controller[_0x2743('0x12')]);router['post'](_0x2743('0x13'),controller[_0x2743('0x14')]);router[_0x2743('0x15')](_0x2743('0x16'),auth[_0x2743('0xa')](),controller[_0x2743('0x17')]);router['put'](_0x2743('0x18'),auth[_0x2743('0xa')](),controller[_0x2743('0x19')]);router[_0x2743('0x15')](_0x2743('0x1a'),auth[_0x2743('0xa')](),controller[_0x2743('0x1b')]);router[_0x2743('0x1c')](_0x2743('0x16'),auth['isAuthenticated'](),controller[_0x2743('0x1d')]);module[_0x2743('0x1e')]=router; \ No newline at end of file +var _0x0a7a=['tracked','whatsappmessage:create','/:id/status','status','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','get','/describe','/:id','post'];(function(_0x1d0456,_0x353c0b){var _0x1f4fbf=function(_0x21c62c){while(--_0x21c62c){_0x1d0456['push'](_0x1d0456['shift']());}};_0x1f4fbf(++_0x353c0b);}(_0x0a7a,0x1ad));var _0xa0a7=function(_0x2e5e9f,_0x17e27a){_0x2e5e9f=_0x2e5e9f-0x0;var _0x180d35=_0x0a7a[_0x2e5e9f];return _0x180d35;};'use strict';var multer=require(_0xa0a7('0x0'));var util=require(_0xa0a7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa0a7('0x2')]();var fs_extra=require(_0xa0a7('0x3'));var auth=require(_0xa0a7('0x4'));var interaction=require(_0xa0a7('0x5'));var config=require(_0xa0a7('0x6'));var controller=require(_0xa0a7('0x7'));router['get']('/',auth[_0xa0a7('0x8')](),controller['index']);router[_0xa0a7('0x9')](_0xa0a7('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xa0a7('0x9')](_0xa0a7('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xa0a7('0xc')]('/',auth[_0xa0a7('0x8')](),interaction[_0xa0a7('0xd')]('whatsapp',_0xa0a7('0xe')),controller['create']);router[_0xa0a7('0xc')](_0xa0a7('0xf'),controller[_0xa0a7('0x10')]);router['put'](_0xa0a7('0xb'),auth['isAuthenticated'](),controller[_0xa0a7('0x11')]);router[_0xa0a7('0x12')](_0xa0a7('0x13'),auth['isAuthenticated'](),controller[_0xa0a7('0x14')]);router[_0xa0a7('0x12')](_0xa0a7('0x15'),auth[_0xa0a7('0x8')](),controller[_0xa0a7('0x16')]);router[_0xa0a7('0x17')](_0xa0a7('0xb'),auth[_0xa0a7('0x8')](),controller[_0xa0a7('0x18')]);module[_0xa0a7('0x19')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index f6493e1..528a83d 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 _0x1239=['BOOLEAN','out','STRING','DATE','sequelize','exports','TEXT','medium'];(function(_0x5dc03e,_0x54e60c){var _0x466a07=function(_0x2ce0cd){while(--_0x2ce0cd){_0x5dc03e['push'](_0x5dc03e['shift']());}};_0x466a07(++_0x54e60c);}(_0x1239,0x114));var _0x9123=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1239[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x9123('0x0'));module[_0x9123('0x1')]={'body':{'type':Sequelize[_0x9123('0x2')](_0x9123('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9123('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x9123('0x5')),'defaultValue':_0x9123('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x9123('0x6')](0xbe)},'phone':{'type':Sequelize[_0x9123('0x6')]},'readAt':{'type':Sequelize[_0x9123('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x9123('0x2')]}}; \ No newline at end of file +var _0x2dee=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x5f41ac,_0x3e4c64){var _0x396554=function(_0x15861b){while(--_0x15861b){_0x5f41ac['push'](_0x5f41ac['shift']());}};_0x396554(++_0x3e4c64);}(_0x2dee,0x1c0));var _0xe2de=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x2dee[_0xb0f7c3];return _0x28ea68;};'use strict';var Sequelize=require(_0xe2de('0x0'));module[_0xe2de('0x1')]={'body':{'type':Sequelize[_0xe2de('0x2')](_0xe2de('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xe2de('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe2de('0x5')]('in',_0xe2de('0x6')),'defaultValue':_0xe2de('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xe2de('0x7')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xe2de('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xe2de('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 392477b..b69440c 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 _0x9037=['show','params','rawAttributes','intersection','find','create','body','describe','../../config/logger','whatsapp-interactions','accept','read','readAt','format','UserId','user','agent','WhatsappInteraction','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','get','info','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','channel','motionChannel','event','acceptmessage','reject','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','Sequelize','interface','SIP/%s','EventManager','rejectmessage','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','request','WhatsappMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','stack','name','send','index','map','WhatsappMessage','fieldName','type','model','keys','filters','attributes','query','fields','length','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','rows'];(function(_0x20f870,_0x416d01){var _0x617453=function(_0x7b6810){while(--_0x7b6810){_0x20f870['push'](_0x20f870['shift']());}};_0x617453(++_0x416d01);}(_0x9037,0xc2));var _0x7903=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9037[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7903('0x0'));var rimraf=require(_0x7903('0x1'));var zipdir=require(_0x7903('0x2'));var jsonpatch=require(_0x7903('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7903('0x4'));var Mustache=require('mustache');var util=require(_0x7903('0x5'));var path=require('path');var sox=require(_0x7903('0x6'));var csv=require(_0x7903('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7903('0x8'));var _=require(_0x7903('0x9'));var squel=require('squel');var crypto=require(_0x7903('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7903('0xb'));var toCsv=require(_0x7903('0x7'));var querystring=require(_0x7903('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7903('0xd'));var qs=require(_0x7903('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7903('0xf'));var logger=require('../../config/logger')(_0x7903('0x10'));var utils=require(_0x7903('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x7903('0x12'));var db=require('../../mysqldb')['db'];config[_0x7903('0x13')]=_[_0x7903('0x14')](config['redis'],{'host':_0x7903('0x15'),'port':0x18eb});var socket=require(_0x7903('0x16'))(new Redis(config['redis']));require(_0x7903('0x17'))[_0x7903('0x18')](socket);var jayson=require(_0x7903('0x19'));var client=jayson[_0x7903('0x1a')]['http']({'port':0x232c});var client9002=jayson[_0x7903('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x506f63,_0x422943,_0x31b320,_0x5b7e0f){return new BPromise(function(_0x16b120,_0x2f4182){var _0x2b138c=_0x5b7e0f||client;return _0x2b138c[_0x7903('0x1b')](_0x506f63,_0x31b320)['then'](function(_0x471815){logger['info'](_0x7903('0x1c'),_0x422943,'request\x20sent');logger[_0x7903('0x1d')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x422943,_0x7903('0x1e'),JSON['stringify'](_0x471815));if(_0x471815[_0x7903('0x1f')]){if(_0x471815['error'][_0x7903('0x20')]===0x1f4){logger['error'](_0x7903('0x1c'),_0x422943,_0x471815[_0x7903('0x1f')][_0x7903('0x21')]);return _0x2f4182(_0x471815[_0x7903('0x1f')][_0x7903('0x21')]);}logger['error'](_0x7903('0x1c'),_0x422943,_0x471815[_0x7903('0x1f')][_0x7903('0x21')]);return _0x16b120(_0x471815[_0x7903('0x1f')][_0x7903('0x21')]);}else{logger['info'](_0x7903('0x1c'),_0x422943,'request\x20sent');_0x16b120(_0x471815['result'][_0x7903('0x21')]);}})[_0x7903('0x22')](function(_0x378f83){logger[_0x7903('0x1f')](_0x7903('0x1c'),_0x422943,_0x378f83);_0x2f4182(_0x378f83);});});}function respondWithStatusCode(_0x343ddd,_0x37c5cb){_0x37c5cb=_0x37c5cb||0xcc;return function(_0x2001cd){if(_0x2001cd){return _0x343ddd[_0x7903('0x23')](_0x37c5cb);}return _0x343ddd[_0x7903('0x24')](_0x37c5cb)[_0x7903('0x25')]();};}function respondWithResult(_0x3a02b9,_0x248ae5){_0x248ae5=_0x248ae5||0xc8;return function(_0x4f171d){if(_0x4f171d){return _0x3a02b9[_0x7903('0x24')](_0x248ae5)[_0x7903('0x26')](_0x4f171d);}};}function respondWithFilteredResult(_0x575530,_0xec506c){return function(_0x45b898){if(_0x45b898){var _0x2af7ec=typeof _0xec506c[_0x7903('0x27')]===_0x7903('0x28')&&typeof _0xec506c[_0x7903('0x29')]===_0x7903('0x28');var _0x58bec8=_0x45b898[_0x7903('0x2a')];var _0x40e852=_0x2af7ec?0x0:_0xec506c[_0x7903('0x27')];var _0xa3edd5=_0x2af7ec?_0x45b898[_0x7903('0x2a')]:_0xec506c[_0x7903('0x27')]+_0xec506c[_0x7903('0x29')];var _0x49a520;if(_0xa3edd5>=_0x58bec8){_0xa3edd5=_0x58bec8;_0x49a520=0xc8;}else{_0x49a520=0xce;}_0x575530[_0x7903('0x24')](_0x49a520);return _0x575530['set'](_0x7903('0x2b'),_0x40e852+'-'+_0xa3edd5+'/'+_0x58bec8)[_0x7903('0x26')](_0x45b898);}return null;};}function patchUpdates(_0x16c731){return function(_0x3b81c6){try{jsonpatch['apply'](_0x3b81c6,_0x16c731,!![]);}catch(_0xae7748){return BPromise['reject'](_0xae7748);}return _0x3b81c6['save']();};}function saveUpdates(_0x43e025,_0x35dd19){return function(_0xfad2a1){if(_0xfad2a1){return _0xfad2a1[_0x7903('0x2c')](_0x43e025)[_0x7903('0x2d')](function(_0x1467e8){return _0x1467e8;});}return null;};}function removeEntity(_0x4e83f0,_0x2025fa){return function(_0x2e2a93){if(_0x2e2a93){return _0x2e2a93[_0x7903('0x2e')]()[_0x7903('0x2d')](function(){_0x4e83f0[_0x7903('0x24')](0xcc)[_0x7903('0x25')]();});}};}function handleEntityNotFound(_0x2cafed,_0x384e47){return function(_0x3c03e2){if(!_0x3c03e2){_0x2cafed[_0x7903('0x23')](0x194);}return _0x3c03e2;};}function handleError(_0xbfb11d,_0x48b4d9){_0x48b4d9=_0x48b4d9||0x1f4;return function(_0x1b9cb0){logger['error'](_0x1b9cb0[_0x7903('0x2f')]);if(_0x1b9cb0['name']){delete _0x1b9cb0[_0x7903('0x30')];}_0xbfb11d[_0x7903('0x24')](_0x48b4d9)[_0x7903('0x31')](_0x1b9cb0);};}exports[_0x7903('0x32')]=function(_0x2565fa,_0x2a163d){var _0x37e514={},_0x4fb004={},_0x3c8027={'count':0x0,'rows':[]};var _0x45246c=_[_0x7903('0x33')](db[_0x7903('0x34')]['rawAttributes'],function(_0x615cf6){return{'name':_0x615cf6[_0x7903('0x35')],'type':_0x615cf6[_0x7903('0x36')]['key']};});_0x4fb004[_0x7903('0x37')]=_[_0x7903('0x33')](_0x45246c,_0x7903('0x30'));_0x4fb004['query']=_[_0x7903('0x38')](_0x2565fa['query']);_0x4fb004[_0x7903('0x39')]=_['intersection'](_0x4fb004[_0x7903('0x37')],_0x4fb004['query']);_0x37e514[_0x7903('0x3a')]=_['intersection'](_0x4fb004['model'],qs['fields'](_0x2565fa[_0x7903('0x3b')][_0x7903('0x3c')]));_0x37e514[_0x7903('0x3a')]=_0x37e514[_0x7903('0x3a')][_0x7903('0x3d')]?_0x37e514[_0x7903('0x3a')]:_0x4fb004[_0x7903('0x37')];if(!_0x2565fa[_0x7903('0x3b')]['hasOwnProperty'](_0x7903('0x3e'))){_0x37e514[_0x7903('0x29')]=qs[_0x7903('0x29')](_0x2565fa['query']['limit']);_0x37e514[_0x7903('0x27')]=qs[_0x7903('0x27')](_0x2565fa[_0x7903('0x3b')][_0x7903('0x27')]);}_0x37e514['order']=qs[_0x7903('0x3f')](_0x2565fa['query']['sort']);_0x37e514[_0x7903('0x40')]=qs[_0x7903('0x39')](_['pick'](_0x2565fa['query'],_0x4fb004[_0x7903('0x39')]),_0x45246c);if(_0x2565fa[_0x7903('0x3b')][_0x7903('0x41')]){_0x37e514[_0x7903('0x40')]=_['merge'](_0x37e514[_0x7903('0x40')],{'$or':_[_0x7903('0x33')](_0x45246c,function(_0x49f1d7){if(_0x49f1d7[_0x7903('0x36')]!=='VIRTUAL'){var _0x4150fa={};_0x4150fa[_0x49f1d7['name']]={'$like':'%'+_0x2565fa[_0x7903('0x3b')][_0x7903('0x41')]+'%'};return _0x4150fa;}})});}_0x37e514=_[_0x7903('0x42')]({},_0x37e514,_0x2565fa[_0x7903('0x43')]);var _0x453b7a={'where':_0x37e514[_0x7903('0x40')]};return db[_0x7903('0x34')][_0x7903('0x2a')](_0x453b7a)[_0x7903('0x2d')](function(_0x4dfe2a){_0x3c8027[_0x7903('0x2a')]=_0x4dfe2a;if(_0x2565fa['query'][_0x7903('0x44')]){_0x37e514[_0x7903('0x45')]=[{'all':!![]}];}return db[_0x7903('0x34')][_0x7903('0x46')](_0x37e514);})['then'](function(_0x22a61a){_0x3c8027[_0x7903('0x47')]=_0x22a61a;return _0x3c8027;})['then'](respondWithFilteredResult(_0x2a163d,_0x37e514))['catch'](handleError(_0x2a163d,null));};exports[_0x7903('0x48')]=function(_0x454472,_0x20ebca){var _0x45e011={'raw':!![],'where':{'id':_0x454472[_0x7903('0x49')]['id']}},_0x221f54={};_0x221f54['model']=_[_0x7903('0x38')](db[_0x7903('0x34')][_0x7903('0x4a')]);_0x221f54[_0x7903('0x3b')]=_[_0x7903('0x38')](_0x454472[_0x7903('0x3b')]);_0x221f54[_0x7903('0x39')]=_['intersection'](_0x221f54[_0x7903('0x37')],_0x221f54[_0x7903('0x3b')]);_0x45e011[_0x7903('0x3a')]=_[_0x7903('0x4b')](_0x221f54[_0x7903('0x37')],qs['fields'](_0x454472['query'][_0x7903('0x3c')]));_0x45e011['attributes']=_0x45e011[_0x7903('0x3a')][_0x7903('0x3d')]?_0x45e011[_0x7903('0x3a')]:_0x221f54['model'];if(_0x454472[_0x7903('0x3b')][_0x7903('0x44')]){_0x45e011[_0x7903('0x45')]=[{'all':!![]}];}_0x45e011=_[_0x7903('0x42')]({},_0x45e011,_0x454472[_0x7903('0x43')]);return db[_0x7903('0x34')][_0x7903('0x4c')](_0x45e011)[_0x7903('0x2d')](handleEntityNotFound(_0x20ebca,null))[_0x7903('0x2d')](respondWithResult(_0x20ebca,null))[_0x7903('0x22')](handleError(_0x20ebca,null));};exports[_0x7903('0x4d')]=function(_0x364902,_0x577a0a){return db[_0x7903('0x34')][_0x7903('0x4d')](_0x364902[_0x7903('0x4e')],{})[_0x7903('0x2d')](respondWithResult(_0x577a0a,0xc9))[_0x7903('0x22')](handleError(_0x577a0a,null));};exports[_0x7903('0x2c')]=function(_0x6908eb,_0x253b99){if(_0x6908eb[_0x7903('0x4e')]['id']){delete _0x6908eb[_0x7903('0x4e')]['id'];}return db[_0x7903('0x34')][_0x7903('0x4c')]({'where':{'id':_0x6908eb[_0x7903('0x49')]['id']}})[_0x7903('0x2d')](handleEntityNotFound(_0x253b99,null))[_0x7903('0x2d')](saveUpdates(_0x6908eb['body'],null))['then'](respondWithResult(_0x253b99,null))['catch'](handleError(_0x253b99,null));};exports[_0x7903('0x2e')]=function(_0x597672,_0x4318e8){return db[_0x7903('0x34')][_0x7903('0x4c')]({'where':{'id':_0x597672[_0x7903('0x49')]['id']}})[_0x7903('0x2d')](handleEntityNotFound(_0x4318e8,null))[_0x7903('0x2d')](removeEntity(_0x4318e8,null))[_0x7903('0x22')](handleError(_0x4318e8,null));};exports[_0x7903('0x4f')]=function(_0x5df2b6,_0x15bab9){return db['WhatsappMessage'][_0x7903('0x4f')]()[_0x7903('0x2d')](respondWithResult(_0x15bab9,null))['catch'](handleError(_0x15bab9,null));};var interaction_log=require(_0x7903('0x50'))(_0x7903('0x51'));exports[_0x7903('0x52')]=function(_0x4a1c10,_0x16fd18,_0x54df18){var _0x522abe={'agent':{},'channel':'whatsapp'};if(_0x4a1c10[_0x7903('0x4e')]['id']){delete _0x4a1c10['body']['id'];}_0x4a1c10['body'][_0x7903('0x53')]=!![];_0x4a1c10[_0x7903('0x4e')][_0x7903('0x54')]=moment()[_0x7903('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x4a1c10[_0x7903('0x4e')]['UserId']=_0x4a1c10[_0x7903('0x4e')][_0x7903('0x56')]||_0x4a1c10[_0x7903('0x57')]['id'];_0x522abe[_0x7903('0x58')]['id']=_0x4a1c10[_0x7903('0x4e')][_0x7903('0x56')];return db[_0x7903('0x34')][_0x7903('0x4c')]({'where':{'id':_0x4a1c10['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x16fd18,null))[_0x7903('0x2d')](saveUpdates(_0x4a1c10[_0x7903('0x4e')],null))[_0x7903('0x2d')](function(_0x5cdf01){if(_0x5cdf01){_0x522abe[_0x7903('0x21')]=_0x5cdf01['get']({'plain':!![]});return db[_0x7903('0x59')]['find']({'where':{'id':_0x5cdf01['WhatsappInteractionId']}});}return null;})[_0x7903('0x2d')](handleEntityNotFound(_0x16fd18,null))[_0x7903('0x2d')](function(_0x1cae7c){if(_0x1cae7c){return _0x1cae7c[_0x7903('0x2c')]({'UserId':_0x4a1c10[_0x7903('0x4e')][_0x7903('0x56')],'read1stAt':_[_0x7903('0x5a')](_0x1cae7c[_0x7903('0x5b')])?moment()[_0x7903('0x55')](_0x7903('0x5c')):undefined});}return null;})[_0x7903('0x2d')](function(_0x49154c){if(_0x49154c){_0x522abe[_0x7903('0x5d')]=_0x49154c[_0x7903('0x5e')]({'plain':!![]});interaction_log[_0x7903('0x5f')](_0x7903('0x60'),_0x4a1c10[_0x7903('0x57')]['id'],_0x4a1c10[_0x7903('0x57')][_0x7903('0x30')],_0x4a1c10['user'][_0x7903('0x61')],_0x522abe[_0x7903('0x5d')]['id'],_0x4a1c10[_0x7903('0x4e')]?JSON[_0x7903('0x62')](_0x4a1c10[_0x7903('0x4e')]):_0x7903('0x63'));return respondWithRpcPromise('AcceptMessage',_0x7903('0x64'),_0x522abe);}return null;})[_0x7903('0x2d')](function(_0x3b48b7){var _0x2eaa55=_0x7903('0x65')+_0x3b48b7['message']['ContactId'];return db[_0x7903('0x66')][_0x7903('0x3b')](_0x2eaa55,{'type':db['Sequelize'][_0x7903('0x67')][_0x7903('0x68')],'raw':!![]})[_0x7903('0x2d')](function(_0x3e8195){return _0x3e8195;});})[_0x7903('0x2d')](function(_0x50ac7a){if(_0x50ac7a){_0x522abe[_0x7903('0x21')][_0x7903('0x69')]=_0x50ac7a[0x0];if(!_0x4a1c10[_0x7903('0x4e')][_0x7903('0x56')])return;return db['User'][_0x7903('0x4c')]({'where':{'id':_0x4a1c10['body'][_0x7903('0x56')],'role':'agent'},'attributes':['id',_0x7903('0x30'),_0x7903('0x6a'),_0x7903('0x6b'),_0x7903('0x6c')],'raw':!![]});}return null;})[_0x7903('0x2d')](function(_0x69db61){if(!_0x69db61)return null;_0x522abe[_0x7903('0x21')][_0x7903('0x58')]=_0x69db61;return _0x522abe;})[_0x7903('0x2d')](function(_0xb6bde2){if(_0xb6bde2){if(_0x4a1c10[_0x7903('0x4e')][_0x7903('0x6d')]){_0x522abe[_0x7903('0x21')]['interface']=util[_0x7903('0x55')]('SIP/%s',_0x4a1c10[_0x7903('0x57')][_0x7903('0x30')]);_0x522abe['message'][_0x7903('0x6e')]=_0x522abe['channel'];_0x522abe[_0x7903('0x21')][_0x7903('0x6f')]=_0x522abe[_0x7903('0x6e')];_0x522abe['message'][_0x7903('0x70')]=_0x7903('0x52');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x7903('0x71'),'message':_0x522abe[_0x7903('0x21')]},client9002)[_0x7903('0x2d')](function(){return _0x522abe;});}return _0x522abe;}return null;})['then'](respondWithResult(_0x16fd18,null))[_0x7903('0x22')](handleError(_0x16fd18,null));};var interaction_log=require(_0x7903('0x50'))(_0x7903('0x51'));exports[_0x7903('0x72')]=function(_0x2654a3,_0x26aac9,_0x2d4243){var _0x235b93={'agent':{},'channel':'whatsapp'};if(_0x2654a3[_0x7903('0x4e')]['id']){delete _0x2654a3[_0x7903('0x4e')]['id'];}_0x2654a3[_0x7903('0x4e')]['UserId']=_0x2654a3[_0x7903('0x4e')]['UserId']||_0x2654a3[_0x7903('0x57')]['id'];_0x235b93['agent']['id']=_0x2654a3[_0x7903('0x4e')][_0x7903('0x56')];return db[_0x7903('0x34')][_0x7903('0x4c')]({'where':{'id':_0x2654a3[_0x7903('0x49')]['id'],'UserId':null}})[_0x7903('0x2d')](handleEntityNotFound(_0x26aac9,null))[_0x7903('0x2d')](function(_0x70f10d){if(_0x70f10d){_0x235b93[_0x7903('0x21')]=_0x70f10d[_0x7903('0x5e')]({'plain':!![]});return db[_0x7903('0x59')]['find']({'where':{'id':_0x70f10d[_0x7903('0x73')]}});}return null;})[_0x7903('0x2d')](handleEntityNotFound(_0x26aac9,null))[_0x7903('0x2d')](function(_0x3cda6c){if(_0x3cda6c){_0x235b93[_0x7903('0x5d')]=_0x3cda6c[_0x7903('0x5e')]({'plain':!![]});interaction_log[_0x7903('0x5f')](_0x7903('0x74'),_0x2654a3['user']['id'],_0x2654a3['user'][_0x7903('0x30')],_0x2654a3[_0x7903('0x57')]['role'],_0x235b93['interaction']['id'],_0x2654a3[_0x7903('0x4e')]?JSON[_0x7903('0x62')](_0x2654a3['body']):_0x7903('0x63'));return respondWithRpcPromise(_0x7903('0x75'),_0x7903('0x76'),_0x235b93);}return null;})[_0x7903('0x2d')](function(_0x457971){var _0x7a2f22=_0x7903('0x65')+_0x457971[_0x7903('0x21')][_0x7903('0x77')];return db['sequelize'][_0x7903('0x3b')](_0x7a2f22,{'type':db[_0x7903('0x78')]['QueryTypes'][_0x7903('0x68')],'raw':!![]})[_0x7903('0x2d')](function(_0x4e12cc){return _0x4e12cc;});})['then'](function(_0x43e01c){if(_0x43e01c){_0x235b93[_0x7903('0x21')]['contact']=_0x43e01c[0x0];if(!_0x2654a3[_0x7903('0x4e')][_0x7903('0x56')])return;return db['User'][_0x7903('0x4c')]({'where':{'id':_0x2654a3[_0x7903('0x4e')][_0x7903('0x56')],'role':_0x7903('0x58')},'attributes':['id',_0x7903('0x30'),'fullname','email',_0x7903('0x6c')],'raw':!![]});}return null;})[_0x7903('0x2d')](function(_0x2bc9e4){if(!_0x2bc9e4)return null;_0x235b93['message']['agent']=_0x2bc9e4;return _0x235b93;})[_0x7903('0x2d')](function(_0x33f6e1){if(_0x33f6e1){_0x33f6e1[_0x7903('0x21')][_0x7903('0x79')]=util[_0x7903('0x55')](_0x7903('0x7a'),_0x2654a3[_0x7903('0x57')][_0x7903('0x30')]);_0x33f6e1[_0x7903('0x21')][_0x7903('0x6e')]=_0x235b93['channel'];_0x33f6e1[_0x7903('0x21')][_0x7903('0x6f')]=_0x235b93[_0x7903('0x6e')];_0x33f6e1[_0x7903('0x21')]['event']='reject';respondWithRpcPromise(_0x7903('0x7b'),_0x7903('0x7b'),{'event':_0x7903('0x7c'),'message':_0x33f6e1['message']},client9002);return _0x235b93;}return null;})[_0x7903('0x2d')](respondWithResult(_0x26aac9,null))[_0x7903('0x22')](handleError(_0x26aac9,null));};exports[_0x7903('0x24')]=function(_0x20c0aa,_0x497f01,_0x2ccc6c){if(_0x20c0aa[_0x7903('0x4e')]['id']){delete _0x20c0aa[_0x7903('0x4e')]['id'];}var _0x4703f5;return db[_0x7903('0x34')][_0x7903('0x4c')]({'where':{'id':_0x20c0aa[_0x7903('0x49')]['id']}})[_0x7903('0x2d')](handleEntityNotFound(_0x497f01,null))['then'](function(_0x308955){if(_0x308955){_0x4703f5=_0x308955;return db['WhatsappAccount'][_0x7903('0x4c')]({'where':{'id':_0x308955['WhatsappAccountId']}});}})[_0x7903('0x2d')](handleEntityNotFound(_0x497f01,null))['then'](function(_0x217a26){if(_0x217a26){logger[_0x7903('0x1d')](_0x7903('0x7d'),_0x7903('0x24'),_0x7903('0x7e'),_0x217a26[_0x7903('0x36')],util['inspect'](_0x20c0aa[_0x7903('0x4e')],{'showHidden':![],'depth':null}));switch(_0x217a26[_0x7903('0x36')]){case _0x7903('0x7f'):if(_0x20c0aa['body']['MessageSid']&&_0x20c0aa[_0x7903('0x4e')][_0x7903('0x80')]===_0x4703f5[_0x7903('0x81')]&&_0x20c0aa['body']['MessageStatus']&&_0x20c0aa['body'][_0x7903('0x82')]===_0x7903('0x53')){return _0x4703f5['update']({'read':!![]});}else{logger[_0x7903('0x1f')](_0x7903('0x83'),_0x7903('0x24'),_0x7903('0x7f'),util[_0x7903('0x84')](_0x20c0aa[_0x7903('0x4e')],{'showHidden':![],'depth':null}));}break;}return _0x4703f5;}})[_0x7903('0x2d')](respondWithResult(_0x497f01,null))['catch'](handleError(_0x497f01,null));}; \ No newline at end of file +var _0xf946=['null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT','rejectmessage','WhatsappAccount','WhatsappAccountId','received\x20delivery\x20report\x20from','type','inspect','twilio','MessageSid','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','name','send','WhatsappMessage','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','options','includeAll','rows','show','params','include','find','create','body','describe','whatsapp-interactions','whatsapp','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','update','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role'];(function(_0x539533,_0x59b89b){var _0x3942f3=function(_0x3b386c){while(--_0x3b386c){_0x539533['push'](_0x539533['shift']());}};_0x3942f3(++_0x59b89b);}(_0xf946,0xae));var _0x6f94=function(_0x472619,_0x369fcc){_0x472619=_0x472619-0x0;var _0x14a669=_0xf946[_0x472619];return _0x14a669;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6f94('0x0'));var jsonpatch=require(_0x6f94('0x1'));var rp=require('request-promise');var moment=require(_0x6f94('0x2'));var BPromise=require(_0x6f94('0x3'));var Mustache=require(_0x6f94('0x4'));var util=require('util');var path=require(_0x6f94('0x5'));var sox=require(_0x6f94('0x6'));var csv=require(_0x6f94('0x7'));var ejs=require(_0x6f94('0x8'));var fs=require('fs');var fs_extra=require(_0x6f94('0x9'));var _=require(_0x6f94('0xa'));var squel=require(_0x6f94('0xb'));var crypto=require('crypto');var jsforce=require(_0x6f94('0xc'));var deskjs=require(_0x6f94('0xd'));var toCsv=require(_0x6f94('0x7'));var querystring=require('querystring');var Papa=require(_0x6f94('0xe'));var Redis=require('ioredis');var authService=require(_0x6f94('0xf'));var qs=require(_0x6f94('0x10'));var as=require(_0x6f94('0x11'));var hardwareService=require(_0x6f94('0x12'));var logger=require(_0x6f94('0x13'))(_0x6f94('0x14'));var utils=require(_0x6f94('0x15'));var config=require(_0x6f94('0x16'));var licenseUtil=require(_0x6f94('0x17'));var db=require(_0x6f94('0x18'))['db'];config[_0x6f94('0x19')]=_['defaults'](config['redis'],{'host':_0x6f94('0x1a'),'port':0x18eb});var socket=require(_0x6f94('0x1b'))(new Redis(config['redis']));require(_0x6f94('0x1c'))['register'](socket);var jayson=require(_0x6f94('0x1d'));var client=jayson[_0x6f94('0x1e')][_0x6f94('0x1f')]({'port':0x232c});var client9002=jayson[_0x6f94('0x1e')][_0x6f94('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x554c66,_0x2e918b,_0xf5ba72,_0x7049ba){return new BPromise(function(_0x5c5256,_0x4a0428){var _0x26736b=_0x7049ba||client;return _0x26736b[_0x6f94('0x20')](_0x554c66,_0xf5ba72)[_0x6f94('0x21')](function(_0xc443c){logger[_0x6f94('0x22')](_0x6f94('0x23'),_0x2e918b,'request\x20sent');logger[_0x6f94('0x24')](_0x6f94('0x25'),_0x2e918b,_0x6f94('0x26'),JSON[_0x6f94('0x27')](_0xc443c));if(_0xc443c[_0x6f94('0x28')]){if(_0xc443c[_0x6f94('0x28')][_0x6f94('0x29')]===0x1f4){logger[_0x6f94('0x28')]('WhatsappMessage,\x20%s,\x20%s',_0x2e918b,_0xc443c['error'][_0x6f94('0x2a')]);return _0x4a0428(_0xc443c[_0x6f94('0x28')][_0x6f94('0x2a')]);}logger[_0x6f94('0x28')](_0x6f94('0x23'),_0x2e918b,_0xc443c[_0x6f94('0x28')][_0x6f94('0x2a')]);return _0x5c5256(_0xc443c[_0x6f94('0x28')]['message']);}else{logger[_0x6f94('0x22')](_0x6f94('0x23'),_0x2e918b,_0x6f94('0x26'));_0x5c5256(_0xc443c[_0x6f94('0x2b')]['message']);}})[_0x6f94('0x2c')](function(_0x3c6997){logger[_0x6f94('0x28')]('WhatsappMessage,\x20%s,\x20%s',_0x2e918b,_0x3c6997);_0x4a0428(_0x3c6997);});});}function respondWithStatusCode(_0x2400f9,_0x2450e3){_0x2450e3=_0x2450e3||0xcc;return function(_0x38efcf){if(_0x38efcf){return _0x2400f9[_0x6f94('0x2d')](_0x2450e3);}return _0x2400f9[_0x6f94('0x2e')](_0x2450e3)[_0x6f94('0x2f')]();};}function respondWithResult(_0x41dd96,_0x2c3301){_0x2c3301=_0x2c3301||0xc8;return function(_0xb99dfa){if(_0xb99dfa){return _0x41dd96[_0x6f94('0x2e')](_0x2c3301)[_0x6f94('0x30')](_0xb99dfa);}};}function respondWithFilteredResult(_0x4dbb67,_0x48ad2b){return function(_0x5b61ef){if(_0x5b61ef){var _0x10d934=typeof _0x48ad2b[_0x6f94('0x31')]===_0x6f94('0x32')&&typeof _0x48ad2b[_0x6f94('0x33')]==='undefined';var _0x432073=_0x5b61ef[_0x6f94('0x34')];var _0x13514c=_0x10d934?0x0:_0x48ad2b[_0x6f94('0x31')];var _0x5eb488=_0x10d934?_0x5b61ef[_0x6f94('0x34')]:_0x48ad2b[_0x6f94('0x31')]+_0x48ad2b['limit'];var _0x3d00fd;if(_0x5eb488>=_0x432073){_0x5eb488=_0x432073;_0x3d00fd=0xc8;}else{_0x3d00fd=0xce;}_0x4dbb67[_0x6f94('0x2e')](_0x3d00fd);return _0x4dbb67[_0x6f94('0x35')](_0x6f94('0x36'),_0x13514c+'-'+_0x5eb488+'/'+_0x432073)[_0x6f94('0x30')](_0x5b61ef);}return null;};}function patchUpdates(_0x3d9db4){return function(_0x4b4e22){try{jsonpatch[_0x6f94('0x37')](_0x4b4e22,_0x3d9db4,!![]);}catch(_0x3e0659){return BPromise['reject'](_0x3e0659);}return _0x4b4e22[_0x6f94('0x38')]();};}function saveUpdates(_0x2261d0,_0x3b6427){return function(_0x23e2d1){if(_0x23e2d1){return _0x23e2d1['update'](_0x2261d0)[_0x6f94('0x21')](function(_0x56cbad){return _0x56cbad;});}return null;};}function removeEntity(_0x4a3531,_0x461dfc){return function(_0x1770b9){if(_0x1770b9){return _0x1770b9[_0x6f94('0x39')]()[_0x6f94('0x21')](function(){_0x4a3531[_0x6f94('0x2e')](0xcc)[_0x6f94('0x2f')]();});}};}function handleEntityNotFound(_0x37da11,_0x2ef7d6){return function(_0x20919e){if(!_0x20919e){_0x37da11[_0x6f94('0x2d')](0x194);}return _0x20919e;};}function handleError(_0xfe65a8,_0x237203){_0x237203=_0x237203||0x1f4;return function(_0x4d08bc){logger[_0x6f94('0x28')](_0x4d08bc['stack']);if(_0x4d08bc[_0x6f94('0x3a')]){delete _0x4d08bc[_0x6f94('0x3a')];}_0xfe65a8['status'](_0x237203)[_0x6f94('0x3b')](_0x4d08bc);};}exports['index']=function(_0x1213b8,_0x39ffa4){var _0x2c9ba9={},_0x2cf46d={},_0x2b3af0={'count':0x0,'rows':[]};var _0x1f612c=_['map'](db[_0x6f94('0x3c')][_0x6f94('0x3d')],function(_0x290d82){return{'name':_0x290d82['fieldName'],'type':_0x290d82['type']['key']};});_0x2cf46d[_0x6f94('0x3e')]=_['map'](_0x1f612c,_0x6f94('0x3a'));_0x2cf46d[_0x6f94('0x3f')]=_[_0x6f94('0x40')](_0x1213b8['query']);_0x2cf46d[_0x6f94('0x41')]=_['intersection'](_0x2cf46d['model'],_0x2cf46d[_0x6f94('0x3f')]);_0x2c9ba9[_0x6f94('0x42')]=_[_0x6f94('0x43')](_0x2cf46d['model'],qs[_0x6f94('0x44')](_0x1213b8[_0x6f94('0x3f')][_0x6f94('0x44')]));_0x2c9ba9['attributes']=_0x2c9ba9[_0x6f94('0x42')][_0x6f94('0x45')]?_0x2c9ba9['attributes']:_0x2cf46d[_0x6f94('0x3e')];if(!_0x1213b8['query'][_0x6f94('0x46')](_0x6f94('0x47'))){_0x2c9ba9['limit']=qs[_0x6f94('0x33')](_0x1213b8[_0x6f94('0x3f')]['limit']);_0x2c9ba9[_0x6f94('0x31')]=qs['offset'](_0x1213b8[_0x6f94('0x3f')]['offset']);}_0x2c9ba9[_0x6f94('0x48')]=qs[_0x6f94('0x49')](_0x1213b8[_0x6f94('0x3f')]['sort']);_0x2c9ba9[_0x6f94('0x4a')]=qs[_0x6f94('0x41')](_[_0x6f94('0x4b')](_0x1213b8[_0x6f94('0x3f')],_0x2cf46d[_0x6f94('0x41')]),_0x1f612c);if(_0x1213b8['query'][_0x6f94('0x4c')]){_0x2c9ba9[_0x6f94('0x4a')]=_['merge'](_0x2c9ba9[_0x6f94('0x4a')],{'$or':_[_0x6f94('0x4d')](_0x1f612c,function(_0x1068fc){if(_0x1068fc['type']!==_0x6f94('0x4e')){var _0x5878f7={};_0x5878f7[_0x1068fc[_0x6f94('0x3a')]]={'$like':'%'+_0x1213b8[_0x6f94('0x3f')]['filter']+'%'};return _0x5878f7;}})});}_0x2c9ba9=_['merge']({},_0x2c9ba9,_0x1213b8[_0x6f94('0x4f')]);var _0x5b7653={'where':_0x2c9ba9[_0x6f94('0x4a')]};return db[_0x6f94('0x3c')][_0x6f94('0x34')](_0x5b7653)[_0x6f94('0x21')](function(_0x4d7e0b){_0x2b3af0['count']=_0x4d7e0b;if(_0x1213b8[_0x6f94('0x3f')][_0x6f94('0x50')]){_0x2c9ba9['include']=[{'all':!![]}];}return db[_0x6f94('0x3c')]['findAll'](_0x2c9ba9);})['then'](function(_0x1acdc5){_0x2b3af0[_0x6f94('0x51')]=_0x1acdc5;return _0x2b3af0;})[_0x6f94('0x21')](respondWithFilteredResult(_0x39ffa4,_0x2c9ba9))[_0x6f94('0x2c')](handleError(_0x39ffa4,null));};exports[_0x6f94('0x52')]=function(_0x33e106,_0x5cefe7){var _0x56386f={'raw':!![],'where':{'id':_0x33e106[_0x6f94('0x53')]['id']}},_0x1ed4ca={};_0x1ed4ca[_0x6f94('0x3e')]=_[_0x6f94('0x40')](db[_0x6f94('0x3c')][_0x6f94('0x3d')]);_0x1ed4ca[_0x6f94('0x3f')]=_[_0x6f94('0x40')](_0x33e106['query']);_0x1ed4ca['filters']=_[_0x6f94('0x43')](_0x1ed4ca[_0x6f94('0x3e')],_0x1ed4ca[_0x6f94('0x3f')]);_0x56386f[_0x6f94('0x42')]=_[_0x6f94('0x43')](_0x1ed4ca[_0x6f94('0x3e')],qs[_0x6f94('0x44')](_0x33e106[_0x6f94('0x3f')][_0x6f94('0x44')]));_0x56386f[_0x6f94('0x42')]=_0x56386f[_0x6f94('0x42')][_0x6f94('0x45')]?_0x56386f['attributes']:_0x1ed4ca[_0x6f94('0x3e')];if(_0x33e106[_0x6f94('0x3f')][_0x6f94('0x50')]){_0x56386f[_0x6f94('0x54')]=[{'all':!![]}];}_0x56386f=_['merge']({},_0x56386f,_0x33e106[_0x6f94('0x4f')]);return db['WhatsappMessage'][_0x6f94('0x55')](_0x56386f)['then'](handleEntityNotFound(_0x5cefe7,null))[_0x6f94('0x21')](respondWithResult(_0x5cefe7,null))[_0x6f94('0x2c')](handleError(_0x5cefe7,null));};exports[_0x6f94('0x56')]=function(_0x4d8b04,_0xd7ae0e){return db[_0x6f94('0x3c')]['create'](_0x4d8b04[_0x6f94('0x57')],{})[_0x6f94('0x21')](respondWithResult(_0xd7ae0e,0xc9))[_0x6f94('0x2c')](handleError(_0xd7ae0e,null));};exports['update']=function(_0x5abcce,_0x55c523){if(_0x5abcce[_0x6f94('0x57')]['id']){delete _0x5abcce[_0x6f94('0x57')]['id'];}return db[_0x6f94('0x3c')][_0x6f94('0x55')]({'where':{'id':_0x5abcce['params']['id']}})[_0x6f94('0x21')](handleEntityNotFound(_0x55c523,null))['then'](saveUpdates(_0x5abcce[_0x6f94('0x57')],null))[_0x6f94('0x21')](respondWithResult(_0x55c523,null))[_0x6f94('0x2c')](handleError(_0x55c523,null));};exports[_0x6f94('0x39')]=function(_0x315112,_0x12500b){return db[_0x6f94('0x3c')][_0x6f94('0x55')]({'where':{'id':_0x315112['params']['id']}})[_0x6f94('0x21')](handleEntityNotFound(_0x12500b,null))[_0x6f94('0x21')](removeEntity(_0x12500b,null))[_0x6f94('0x2c')](handleError(_0x12500b,null));};exports[_0x6f94('0x58')]=function(_0x43ff7f,_0x116c5e){return db[_0x6f94('0x3c')][_0x6f94('0x58')]()[_0x6f94('0x21')](respondWithResult(_0x116c5e,null))[_0x6f94('0x2c')](handleError(_0x116c5e,null));};var interaction_log=require('../../config/logger')(_0x6f94('0x59'));exports['accept']=function(_0x27f9c6,_0x22dd23,_0x553030){var _0x416baf={'agent':{},'channel':_0x6f94('0x5a')};if(_0x27f9c6[_0x6f94('0x57')]['id']){delete _0x27f9c6[_0x6f94('0x57')]['id'];}_0x27f9c6['body']['read']=!![];_0x27f9c6[_0x6f94('0x57')][_0x6f94('0x5b')]=moment()[_0x6f94('0x5c')](_0x6f94('0x5d'));_0x27f9c6[_0x6f94('0x57')][_0x6f94('0x5e')]=_0x27f9c6['body'][_0x6f94('0x5e')]||_0x27f9c6[_0x6f94('0x5f')]['id'];_0x416baf[_0x6f94('0x60')]['id']=_0x27f9c6[_0x6f94('0x57')][_0x6f94('0x5e')];return db[_0x6f94('0x3c')][_0x6f94('0x55')]({'where':{'id':_0x27f9c6[_0x6f94('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x22dd23,null))[_0x6f94('0x21')](saveUpdates(_0x27f9c6[_0x6f94('0x57')],null))[_0x6f94('0x21')](function(_0xc5e01){if(_0xc5e01){_0x416baf[_0x6f94('0x2a')]=_0xc5e01[_0x6f94('0x61')]({'plain':!![]});return db[_0x6f94('0x62')][_0x6f94('0x55')]({'where':{'id':_0xc5e01[_0x6f94('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x22dd23,null))[_0x6f94('0x21')](function(_0x3fbd9a){if(_0x3fbd9a){return _0x3fbd9a[_0x6f94('0x64')]({'UserId':_0x27f9c6[_0x6f94('0x57')][_0x6f94('0x5e')],'read1stAt':_[_0x6f94('0x65')](_0x3fbd9a[_0x6f94('0x66')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6f94('0x21')](function(_0x948976){if(_0x948976){_0x416baf[_0x6f94('0x67')]=_0x948976[_0x6f94('0x61')]({'plain':!![]});interaction_log[_0x6f94('0x22')](_0x6f94('0x68'),_0x27f9c6[_0x6f94('0x5f')]['id'],_0x27f9c6['user'][_0x6f94('0x3a')],_0x27f9c6['user'][_0x6f94('0x69')],_0x416baf[_0x6f94('0x67')]['id'],_0x27f9c6[_0x6f94('0x57')]?JSON[_0x6f94('0x27')](_0x27f9c6[_0x6f94('0x57')]):_0x6f94('0x6a'));return respondWithRpcPromise(_0x6f94('0x6b'),'acceptMessage',_0x416baf);}return null;})[_0x6f94('0x21')](function(_0x19a798){var _0x4b4b0d=_0x6f94('0x6c')+_0x19a798[_0x6f94('0x2a')][_0x6f94('0x6d')];return db['sequelize']['query'](_0x4b4b0d,{'type':db[_0x6f94('0x6e')][_0x6f94('0x6f')]['SELECT'],'raw':!![]})[_0x6f94('0x21')](function(_0x29a143){return _0x29a143;});})[_0x6f94('0x21')](function(_0x496df1){if(_0x496df1){_0x416baf[_0x6f94('0x2a')][_0x6f94('0x70')]=_0x496df1[0x0];if(!_0x27f9c6['body'][_0x6f94('0x5e')])return;return db[_0x6f94('0x71')]['find']({'where':{'id':_0x27f9c6[_0x6f94('0x57')][_0x6f94('0x5e')],'role':_0x6f94('0x60')},'attributes':['id',_0x6f94('0x3a'),_0x6f94('0x72'),_0x6f94('0x73'),_0x6f94('0x74')],'raw':!![]});}return null;})[_0x6f94('0x21')](function(_0x3e53e9){if(!_0x3e53e9)return null;_0x416baf[_0x6f94('0x2a')]['agent']=_0x3e53e9;return _0x416baf;})[_0x6f94('0x21')](function(_0x163879){if(_0x163879){if(_0x27f9c6[_0x6f94('0x57')][_0x6f94('0x75')]){_0x416baf['message'][_0x6f94('0x76')]=util[_0x6f94('0x5c')](_0x6f94('0x77'),_0x27f9c6[_0x6f94('0x5f')][_0x6f94('0x3a')]);_0x416baf[_0x6f94('0x2a')][_0x6f94('0x78')]=_0x416baf['channel'];_0x416baf[_0x6f94('0x2a')][_0x6f94('0x79')]=_0x416baf[_0x6f94('0x78')];_0x416baf[_0x6f94('0x2a')][_0x6f94('0x7a')]='accept';return respondWithRpcPromise(_0x6f94('0x7b'),_0x6f94('0x7b'),{'event':_0x6f94('0x7c'),'message':_0x416baf[_0x6f94('0x2a')]},client9002)[_0x6f94('0x21')](function(){return _0x416baf;});}return _0x416baf;}return null;})[_0x6f94('0x21')](respondWithResult(_0x22dd23,null))[_0x6f94('0x2c')](handleError(_0x22dd23,null));};var interaction_log=require(_0x6f94('0x13'))('whatsapp-interactions');exports['reject']=function(_0x117569,_0x36e0a0,_0x1ed770){var _0x14d6aa={'agent':{},'channel':_0x6f94('0x5a')};if(_0x117569[_0x6f94('0x57')]['id']){delete _0x117569['body']['id'];}_0x117569[_0x6f94('0x57')][_0x6f94('0x5e')]=_0x117569[_0x6f94('0x57')][_0x6f94('0x5e')]||_0x117569[_0x6f94('0x5f')]['id'];_0x14d6aa[_0x6f94('0x60')]['id']=_0x117569[_0x6f94('0x57')][_0x6f94('0x5e')];return db[_0x6f94('0x3c')][_0x6f94('0x55')]({'where':{'id':_0x117569['params']['id'],'UserId':null}})[_0x6f94('0x21')](handleEntityNotFound(_0x36e0a0,null))[_0x6f94('0x21')](function(_0x177f8){if(_0x177f8){_0x14d6aa[_0x6f94('0x2a')]=_0x177f8[_0x6f94('0x61')]({'plain':!![]});return db[_0x6f94('0x62')]['find']({'where':{'id':_0x177f8['WhatsappInteractionId']}});}return null;})[_0x6f94('0x21')](handleEntityNotFound(_0x36e0a0,null))[_0x6f94('0x21')](function(_0x3eb8f3){if(_0x3eb8f3){_0x14d6aa[_0x6f94('0x67')]=_0x3eb8f3[_0x6f94('0x61')]({'plain':!![]});interaction_log[_0x6f94('0x22')](_0x6f94('0x7d'),_0x117569[_0x6f94('0x5f')]['id'],_0x117569[_0x6f94('0x5f')]['name'],_0x117569[_0x6f94('0x5f')][_0x6f94('0x69')],_0x14d6aa['interaction']['id'],_0x117569[_0x6f94('0x57')]?JSON['stringify'](_0x117569[_0x6f94('0x57')]):_0x6f94('0x6a'));return respondWithRpcPromise('RejectMessage',_0x6f94('0x7e'),_0x14d6aa);}return null;})[_0x6f94('0x21')](function(_0x499224){var _0x45b46b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x499224[_0x6f94('0x2a')][_0x6f94('0x6d')];return db['sequelize'][_0x6f94('0x3f')](_0x45b46b,{'type':db['Sequelize']['QueryTypes'][_0x6f94('0x7f')],'raw':!![]})[_0x6f94('0x21')](function(_0x30f5ce){return _0x30f5ce;});})[_0x6f94('0x21')](function(_0x444067){if(_0x444067){_0x14d6aa[_0x6f94('0x2a')][_0x6f94('0x70')]=_0x444067[0x0];if(!_0x117569[_0x6f94('0x57')][_0x6f94('0x5e')])return;return db[_0x6f94('0x71')][_0x6f94('0x55')]({'where':{'id':_0x117569[_0x6f94('0x57')][_0x6f94('0x5e')],'role':_0x6f94('0x60')},'attributes':['id',_0x6f94('0x3a'),'fullname',_0x6f94('0x73'),_0x6f94('0x74')],'raw':!![]});}return null;})[_0x6f94('0x21')](function(_0x40d857){if(!_0x40d857)return null;_0x14d6aa[_0x6f94('0x2a')][_0x6f94('0x60')]=_0x40d857;return _0x14d6aa;})[_0x6f94('0x21')](function(_0x38eac0){if(_0x38eac0){_0x38eac0[_0x6f94('0x2a')][_0x6f94('0x76')]=util[_0x6f94('0x5c')](_0x6f94('0x77'),_0x117569['user'][_0x6f94('0x3a')]);_0x38eac0['message']['channel']=_0x14d6aa[_0x6f94('0x78')];_0x38eac0['message'][_0x6f94('0x79')]=_0x14d6aa['channel'];_0x38eac0[_0x6f94('0x2a')][_0x6f94('0x7a')]='reject';respondWithRpcPromise(_0x6f94('0x7b'),_0x6f94('0x7b'),{'event':_0x6f94('0x80'),'message':_0x38eac0[_0x6f94('0x2a')]},client9002);return _0x14d6aa;}return null;})['then'](respondWithResult(_0x36e0a0,null))[_0x6f94('0x2c')](handleError(_0x36e0a0,null));};exports[_0x6f94('0x2e')]=function(_0x15936f,_0x54cb12,_0x2cc2ae){if(_0x15936f[_0x6f94('0x57')]['id']){delete _0x15936f[_0x6f94('0x57')]['id'];}var _0x2fdd77;return db['WhatsappMessage'][_0x6f94('0x55')]({'where':{'id':_0x15936f[_0x6f94('0x53')]['id']}})[_0x6f94('0x21')](handleEntityNotFound(_0x54cb12,null))[_0x6f94('0x21')](function(_0x5c7b4a){if(_0x5c7b4a){_0x2fdd77=_0x5c7b4a;return db[_0x6f94('0x81')][_0x6f94('0x55')]({'where':{'id':_0x5c7b4a[_0x6f94('0x82')]}});}})['then'](handleEntityNotFound(_0x54cb12,null))[_0x6f94('0x21')](function(_0x34ea21){if(_0x34ea21){logger[_0x6f94('0x24')]('WhatsppMessage,\x20%s,\x20%s,\x20%s','status',_0x6f94('0x83'),_0x34ea21[_0x6f94('0x84')],util[_0x6f94('0x85')](_0x15936f[_0x6f94('0x57')],{'showHidden':![],'depth':null}));switch(_0x34ea21['type']){case _0x6f94('0x86'):if(_0x15936f[_0x6f94('0x57')][_0x6f94('0x87')]&&_0x15936f['body'][_0x6f94('0x87')]===_0x2fdd77[_0x6f94('0x88')]&&_0x15936f['body']['MessageStatus']&&_0x15936f[_0x6f94('0x57')][_0x6f94('0x89')]===_0x6f94('0x8a')){return _0x2fdd77[_0x6f94('0x64')]({'read':!![]});}else{logger[_0x6f94('0x28')](_0x6f94('0x8b'),_0x6f94('0x2e'),_0x6f94('0x86'),util[_0x6f94('0x85')](_0x15936f[_0x6f94('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x2fdd77;}})[_0x6f94('0x21')](respondWithResult(_0x54cb12,null))['catch'](handleError(_0x54cb12,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 52aa5da..3f11a92 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 _0xaaa2=['hook','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0xc5a1a2,_0x49df81){var _0x5d3fe6=function(_0x3d443d){while(--_0x3d443d){_0xc5a1a2['push'](_0xc5a1a2['shift']());}};_0x5d3fe6(++_0x49df81);}(_0xaaa2,0xac));var _0x2aaa=function(_0x3c1471,_0x6cddc7){_0x3c1471=_0x3c1471-0x0;var _0x20d40f=_0xaaa2[_0x3c1471];return _0x20d40f;};'use strict';var EventEmitter=require(_0x2aaa('0x0'));var WhatsappMessage=require(_0x2aaa('0x1'))['db'][_0x2aaa('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x2aaa('0x3')](0x0);var events={'afterCreate':_0x2aaa('0x4'),'afterUpdate':_0x2aaa('0x5'),'afterDestroy':'remove'};function emitEvent(_0xfc076){return function(_0x482489,_0x35b5c8,_0x340071){WhatsappMessageEvents[_0x2aaa('0x6')](_0xfc076+':'+_0x482489['id'],_0x482489);WhatsappMessageEvents[_0x2aaa('0x6')](_0xfc076,_0x482489);_0x340071(null);};}for(var e in events){if(events[_0x2aaa('0x7')](e)){var event=events[e];WhatsappMessage[_0x2aaa('0x8')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x76dc=['emit','hasOwnProperty','events','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove'];(function(_0x2c84a6,_0x2bd40b){var _0x33297f=function(_0x304619){while(--_0x304619){_0x2c84a6['push'](_0x2c84a6['shift']());}};_0x33297f(++_0x2bd40b);}(_0x76dc,0x1f2));var _0xc76d=function(_0x471613,_0x3c5254){_0x471613=_0x471613-0x0;var _0x274eb9=_0x76dc[_0x471613];return _0x274eb9;};'use strict';var EventEmitter=require(_0xc76d('0x0'));var WhatsappMessage=require(_0xc76d('0x1'))['db'][_0xc76d('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xc76d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc76d('0x4'),'afterDestroy':_0xc76d('0x5')};function emitEvent(_0x5cff74){return function(_0x300f11,_0x50ed3a,_0x507ea7){WhatsappMessageEvents[_0xc76d('0x6')](_0x5cff74+':'+_0x300f11['id'],_0x300f11);WhatsappMessageEvents[_0xc76d('0x6')](_0x5cff74,_0x300f11);_0x507ea7(null);};}for(var e in events){if(events[_0xc76d('0x7')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 88feb9a..4c1a13e 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 _0x77f3=['error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','baseUrl','/whatsapp/v1/','text','POST','application/json','message_id','statuses','finally','utf8mb4_unicode_ci','lodash','util','moment','request-promise','node-fetch','path','rimraf','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','fti_whatsapp_messages','FULLTEXT','models','direction','toLowerCase','out','secret','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','WhatsappAccount','WhatsappAccountId','type','twilio','accountSid','authToken','phone','body','whatsapp:','/status?token=','token','sid','catch'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x77f3,0x146));var _0x377f=function(_0x1b057e,_0x562e55){_0x1b057e=_0x1b057e-0x0;var _0x47cce5=_0x77f3[_0x1b057e];return _0x47cce5;};'use strict';var _=require(_0x377f('0x0'));var util=require(_0x377f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x377f('0x2'));var BPromise=require('bluebird');var rp=require(_0x377f('0x3'));var fetch=require(_0x377f('0x4'));var fs=require('fs');var path=require(_0x377f('0x5'));var rimraf=require(_0x377f('0x6'));var config=require('../../config/environment');var attributes=require(_0x377f('0x7'));module[_0x377f('0x8')]=function(_0x3ec0c7,_0x42f11d){return _0x3ec0c7[_0x377f('0x9')](_0x377f('0xa'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x377f('0xb'),'fields':[_0x377f('0xb')]},{'name':_0x377f('0xc'),'fields':['body'],'type':_0x377f('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x511cb0,_0xdb40ff,_0x28870f){var _0x410db4=_0x3ec0c7[_0x377f('0xe')];var _0x44c32d=_0x511cb0['get']({'plain':!![]});if(_0x44c32d[_0x377f('0xf')][_0x377f('0x10')]()==='in'||_0x44c32d[_0x377f('0xf')]['toLowerCase']()===_0x377f('0x11')&&!_0x44c32d[_0x377f('0x12')]&&!_['isNil'](_0x44c32d['UserId'])){_0x410db4[_0x377f('0x13')][_0x377f('0x14')]({'where':{'id':_0x44c32d[_0x377f('0x15')]}})[_0x377f('0x16')](function(_0x5cfa3a){if(_0x5cfa3a){_0x5cfa3a[_0x377f('0x17')]({'lastMsgAt':_0x44c32d[_0x377f('0x18')],'lastMsgDirection':_0x44c32d[_0x377f('0xf')]['toLowerCase']()});}})['catch'](function(_0x373484){console['error'](_0x373484);});}if(_0x44c32d[_0x377f('0xf')]===_0x377f('0x11')&&!_0x44c32d[_0x377f('0x12')]){var _0x5d0701;_0x410db4[_0x377f('0x19')]['find']({'where':{'id':_0x44c32d[_0x377f('0x1a')]},'raw':!![]})[_0x377f('0x16')](function(_0x5d1111){_0x5d0701=_0x5d1111;if(_0x5d0701&&_0x5d0701[_0x377f('0x1b')]){switch(_0x5d0701[_0x377f('0x1b')]){case'twilio':var _0x49ba8d=require(_0x377f('0x1c'));if(_0x5d0701[_0x377f('0x1d')]&&_0x5d0701[_0x377f('0x1e')]&&_0x5d0701[_0x377f('0x1f')]){var _0x5eb591=new _0x49ba8d(_0x5d0701[_0x377f('0x1d')],_0x5d0701[_0x377f('0x1e')]);_0x5eb591['messages']['create']({'body':_0x44c32d[_0x377f('0x20')],'to':'whatsapp:'+_0x44c32d['phone'],'from':_0x377f('0x21')+_0x5d0701[_0x377f('0x1f')],'statusCallback':_0x5d0701['remote']+'/api/whatsapp/messages/'+_0x44c32d['id']+_0x377f('0x22')+_0x5d0701[_0x377f('0x23')]})['then'](function(_0x195908){if(_0x195908[_0x377f('0x24')]){return _0x511cb0[_0x377f('0x17')]({'messageId':_0x195908[_0x377f('0x24')]});}})[_0x377f('0x25')](function(_0x46305c){logger[_0x377f('0x26')](_0x377f('0x27'),_0x377f('0x28'),_0x377f('0x1c'),util[_0x377f('0x29')](_0x46305c,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x377f('0x27'),_0x377f('0x28'),_0x377f('0x1c'),_0x377f('0x2a'));}break;case'sinch':var _0x4f7950=_0x5d0701[_0x377f('0x1d')];var _0x2bd3f3=_0x5d0701['authToken'];var _0xfd5374=_0x5d0701[_0x377f('0x2b')]+_0x377f('0x2c')+_0x4f7950+'/messages/';var _0x258dd7={'to':[_0x44c32d[_0x377f('0x1f')]],'message':{'type':_0x377f('0x2d'),'text':_0x44c32d['body']}};var _0x7f98d2={'method':_0x377f('0x2e'),'uri':_0xfd5374,'headers':{'Authorization':'Bearer\x20'+_0x2bd3f3,'Content-Type':_0x377f('0x2f')},'body':_0x258dd7,'json':!![]};rp(_0x7f98d2)['then'](function(_0x1af738){if(_0x1af738['statuses'][0x0][_0x377f('0x30')]){return _0x511cb0[_0x377f('0x17')]({'messageId':_0x1af738[_0x377f('0x31')][0x0][_0x377f('0x30')]});}})[_0x377f('0x25')](function(_0x32890b){logger['err']('WhatsappMessage,\x20%s',_0x32890b);});break;}}})[_0x377f('0x32')](function(){_0x28870f();});}else{_0x28870f();}}},'charset':'utf8mb4','collate':_0x377f('0x33')});}; \ No newline at end of file +var _0xd2d6=['/messages/','text','POST','Bearer\x20','statuses','message_id','utf8mb4','lodash','util','../../config/logger','moment','bluebird','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','whatsapp_messages','messageId','body','models','direction','secret','isNil','UserId','findOne','WhatsappInteractionId','update','createdAt','toLowerCase','error','out','WhatsappAccountId','type','twilio','accountSid','authToken','phone','create','whatsapp:','/api/whatsapp/messages/','/status?token=','token','then','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd2d6,0xa3));var _0x6d2d=function(_0x202499,_0x17f225){_0x202499=_0x202499-0x0;var _0x21da7c=_0xd2d6[_0x202499];return _0x21da7c;};'use strict';var _=require(_0x6d2d('0x0'));var util=require(_0x6d2d('0x1'));var logger=require(_0x6d2d('0x2'))('api');var moment=require(_0x6d2d('0x3'));var BPromise=require(_0x6d2d('0x4'));var rp=require('request-promise');var fetch=require(_0x6d2d('0x5'));var fs=require('fs');var path=require(_0x6d2d('0x6'));var rimraf=require(_0x6d2d('0x7'));var config=require(_0x6d2d('0x8'));var attributes=require(_0x6d2d('0x9'));module[_0x6d2d('0xa')]=function(_0x3575eb,_0x462b1e){return _0x3575eb['define']('WhatsappMessage',attributes,{'tableName':_0x6d2d('0xb'),'paranoid':![],'indexes':[{'name':_0x6d2d('0xc'),'fields':[_0x6d2d('0xc')]},{'name':'fti_whatsapp_messages','fields':[_0x6d2d('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3be0a1,_0xe8381f,_0x44ed8f){var _0x4ee984=_0x3575eb[_0x6d2d('0xe')];var _0x1402c=_0x3be0a1['get']({'plain':!![]});if(_0x1402c['direction']['toLowerCase']()==='in'||_0x1402c[_0x6d2d('0xf')]['toLowerCase']()==='out'&&!_0x1402c[_0x6d2d('0x10')]&&!_[_0x6d2d('0x11')](_0x1402c[_0x6d2d('0x12')])){_0x4ee984['WhatsappInteraction'][_0x6d2d('0x13')]({'where':{'id':_0x1402c[_0x6d2d('0x14')]}})['then'](function(_0x192086){if(_0x192086){_0x192086[_0x6d2d('0x15')]({'lastMsgAt':_0x1402c[_0x6d2d('0x16')],'lastMsgDirection':_0x1402c[_0x6d2d('0xf')][_0x6d2d('0x17')]()});}})['catch'](function(_0x667698){console[_0x6d2d('0x18')](_0x667698);});}if(_0x1402c[_0x6d2d('0xf')]===_0x6d2d('0x19')&&!_0x1402c[_0x6d2d('0x10')]){var _0x44d4e8;_0x4ee984['WhatsappAccount']['find']({'where':{'id':_0x1402c[_0x6d2d('0x1a')]},'raw':!![]})['then'](function(_0x35886d){_0x44d4e8=_0x35886d;if(_0x44d4e8&&_0x44d4e8['type']){switch(_0x44d4e8[_0x6d2d('0x1b')]){case _0x6d2d('0x1c'):var _0x52aebc=require(_0x6d2d('0x1c'));if(_0x44d4e8[_0x6d2d('0x1d')]&&_0x44d4e8[_0x6d2d('0x1e')]&&_0x44d4e8[_0x6d2d('0x1f')]){var _0x3d8751=new _0x52aebc(_0x44d4e8['accountSid'],_0x44d4e8[_0x6d2d('0x1e')]);_0x3d8751['messages'][_0x6d2d('0x20')]({'body':_0x1402c[_0x6d2d('0xd')],'to':_0x6d2d('0x21')+_0x1402c['phone'],'from':_0x6d2d('0x21')+_0x44d4e8[_0x6d2d('0x1f')],'statusCallback':_0x44d4e8['remote']+_0x6d2d('0x22')+_0x1402c['id']+_0x6d2d('0x23')+_0x44d4e8[_0x6d2d('0x24')]})[_0x6d2d('0x25')](function(_0x173bec){if(_0x173bec['sid']){return _0x3be0a1[_0x6d2d('0x15')]({'messageId':_0x173bec['sid']});}})[_0x6d2d('0x26')](function(_0x753623){logger['error'](_0x6d2d('0x27'),_0x6d2d('0x28'),_0x6d2d('0x1c'),util[_0x6d2d('0x29')](_0x753623,{'showHidden':![],'depth':null}));});}else{logger[_0x6d2d('0x18')](_0x6d2d('0x27'),_0x6d2d('0x28'),_0x6d2d('0x1c'),_0x6d2d('0x2a'));}break;case _0x6d2d('0x2b'):var _0x1d656d=_0x44d4e8[_0x6d2d('0x1d')];var _0x3e1e7a=_0x44d4e8[_0x6d2d('0x1e')];var _0x2dd275=_0x44d4e8[_0x6d2d('0x2c')]+'/whatsapp/v1/'+_0x1d656d+_0x6d2d('0x2d');var _0x2e14b5={'to':[_0x1402c['phone']],'message':{'type':_0x6d2d('0x2e'),'text':_0x1402c[_0x6d2d('0xd')]}};var _0x559a9b={'method':_0x6d2d('0x2f'),'uri':_0x2dd275,'headers':{'Authorization':_0x6d2d('0x30')+_0x3e1e7a,'Content-Type':'application/json'},'body':_0x2e14b5,'json':!![]};rp(_0x559a9b)[_0x6d2d('0x25')](function(_0xc376dc){if(_0xc376dc[_0x6d2d('0x31')][0x0][_0x6d2d('0x32')]){return _0x3be0a1[_0x6d2d('0x15')]({'messageId':_0xc376dc[_0x6d2d('0x31')][0x0][_0x6d2d('0x32')]});}})[_0x6d2d('0x26')](function(_0x3508fb){logger['err']('WhatsappMessage,\x20%s',_0x3508fb);});break;}}})['finally'](function(){_0x44ed8f();});}else{_0x44ed8f();}}},'charset':_0x6d2d('0x33'),'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 815655a..0d75705 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 _0x5fd3=['WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','then','info'];(function(_0x11db88,_0x4e71b2){var _0x9a3658=function(_0x3bdc08){while(--_0x3bdc08){_0x11db88['push'](_0x11db88['shift']());}};_0x9a3658(++_0x4e71b2);}(_0x5fd3,0x11c));var _0x35fd=function(_0x3d144b,_0x37af1b){_0x3d144b=_0x3d144b-0x0;var _0x1c6d49=_0x5fd3[_0x3d144b];return _0x1c6d49;};'use strict';var _=require(_0x35fd('0x0'));var util=require('util');var moment=require(_0x35fd('0x1'));var BPromise=require('bluebird');var rs=require(_0x35fd('0x2'));var fs=require('fs');var Redis=require(_0x35fd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x35fd('0x4'));var logger=require(_0x35fd('0x5'))(_0x35fd('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x35fd('0x7')]['http']({'port':0x232a});config[_0x35fd('0x8')]=_[_0x35fd('0x9')](config[_0x35fd('0x8')],{'host':_0x35fd('0xa'),'port':0x18eb});var socket=require(_0x35fd('0xb'))(new Redis(config['redis']));require(_0x35fd('0xc'))[_0x35fd('0xd')](socket);function respondWithRpcPromise(_0xa9b295,_0x536da5,_0x634de9){return new BPromise(function(_0x235d3f,_0x229538){return client['request'](_0xa9b295,_0x634de9)[_0x35fd('0xe')](function(_0x21b7e2){logger[_0x35fd('0xf')](_0x35fd('0x10'),_0x536da5,_0x35fd('0x11'));logger[_0x35fd('0x12')](_0x35fd('0x13'),_0x536da5,_0x35fd('0x11'),JSON['stringify'](_0x21b7e2));if(_0x21b7e2[_0x35fd('0x14')]){if(_0x21b7e2[_0x35fd('0x14')][_0x35fd('0x15')]===0x1f4){logger[_0x35fd('0x14')](_0x35fd('0x10'),_0x536da5,_0x21b7e2[_0x35fd('0x14')][_0x35fd('0x16')]);return _0x229538(_0x21b7e2[_0x35fd('0x14')]['message']);}logger[_0x35fd('0x14')](_0x35fd('0x10'),_0x536da5,_0x21b7e2[_0x35fd('0x14')]['message']);return _0x235d3f(_0x21b7e2[_0x35fd('0x14')][_0x35fd('0x16')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x536da5,_0x35fd('0x11'));_0x235d3f(_0x21b7e2[_0x35fd('0x17')]['message']);}})['catch'](function(_0x252658){logger[_0x35fd('0x14')](_0x35fd('0x10'),_0x536da5,_0x252658);_0x229538(_0x252658);});});}exports[_0x35fd('0x18')]=function(_0x35f6d9){var _0x2619a5=this;return new Promise(function(_0x52cde4,_0x94655a){return db[_0x35fd('0x19')][_0x35fd('0x1a')](_0x35f6d9[_0x35fd('0x1b')],{'raw':_0x35f6d9[_0x35fd('0x1c')]?_0x35f6d9[_0x35fd('0x1c')][_0x35fd('0x1d')]===undefined?!![]:![]:!![]})[_0x35fd('0xe')](function(_0x40f19d){logger[_0x35fd('0xf')](_0x35fd('0x18'),_0x35f6d9);logger['debug'](_0x35fd('0x18'),_0x35f6d9,JSON['stringify'](_0x40f19d));_0x52cde4(_0x40f19d);})['catch'](function(_0x2a28e8){logger[_0x35fd('0x14')](_0x35fd('0x18'),_0x2a28e8[_0x35fd('0x16')],_0x35f6d9);_0x94655a(_0x2619a5['error'](0x1f4,_0x2a28e8['message']));});});}; \ No newline at end of file +var _0xcd7e=['create','body','options','raw','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','./whatsappMessage.socket','register','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateWhatsappMessage','WhatsappMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd7e,0xcb));var _0xecd7=function(_0x2dacca,_0x3b55a5){_0x2dacca=_0x2dacca-0x0;var _0x4e8745=_0xcd7e[_0x2dacca];return _0x4e8745;};'use strict';var _=require('lodash');var util=require(_0xecd7('0x0'));var moment=require(_0xecd7('0x1'));var BPromise=require('bluebird');var rs=require(_0xecd7('0x2'));var fs=require('fs');var Redis=require(_0xecd7('0x3'));var db=require(_0xecd7('0x4'))['db'];var utils=require(_0xecd7('0x5'));var logger=require(_0xecd7('0x6'))(_0xecd7('0x7'));var config=require(_0xecd7('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xecd7('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xecd7('0xa')],{'host':_0xecd7('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xecd7('0xa')]));require(_0xecd7('0xc'))[_0xecd7('0xd')](socket);function respondWithRpcPromise(_0x31e1a2,_0x36a803,_0x384881){return new BPromise(function(_0x3a1688,_0xf5e80a){return client[_0xecd7('0xe')](_0x31e1a2,_0x384881)[_0xecd7('0xf')](function(_0x3f5361){logger['info'](_0xecd7('0x10'),_0x36a803,_0xecd7('0x11'));logger[_0xecd7('0x12')](_0xecd7('0x13'),_0x36a803,_0xecd7('0x11'),JSON[_0xecd7('0x14')](_0x3f5361));if(_0x3f5361[_0xecd7('0x15')]){if(_0x3f5361['error'][_0xecd7('0x16')]===0x1f4){logger[_0xecd7('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x36a803,_0x3f5361[_0xecd7('0x15')][_0xecd7('0x17')]);return _0xf5e80a(_0x3f5361['error']['message']);}logger[_0xecd7('0x15')](_0xecd7('0x10'),_0x36a803,_0x3f5361[_0xecd7('0x15')][_0xecd7('0x17')]);return _0x3a1688(_0x3f5361['error'][_0xecd7('0x17')]);}else{logger[_0xecd7('0x18')](_0xecd7('0x10'),_0x36a803,_0xecd7('0x11'));_0x3a1688(_0x3f5361[_0xecd7('0x19')][_0xecd7('0x17')]);}})['catch'](function(_0x2f05fa){logger[_0xecd7('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x36a803,_0x2f05fa);_0xf5e80a(_0x2f05fa);});});}exports[_0xecd7('0x1a')]=function(_0x4fbe0d){var _0x224615=this;return new Promise(function(_0xc1d9e0,_0x3f08d1){return db[_0xecd7('0x1b')][_0xecd7('0x1c')](_0x4fbe0d[_0xecd7('0x1d')],{'raw':_0x4fbe0d[_0xecd7('0x1e')]?_0x4fbe0d[_0xecd7('0x1e')][_0xecd7('0x1f')]===undefined?!![]:![]:!![]})[_0xecd7('0xf')](function(_0x4c86f2){logger[_0xecd7('0x18')](_0xecd7('0x1a'),_0x4fbe0d);logger[_0xecd7('0x12')](_0xecd7('0x1a'),_0x4fbe0d,JSON['stringify'](_0x4c86f2));_0xc1d9e0(_0x4c86f2);})[_0xecd7('0x20')](function(_0x1e5db6){logger[_0xecd7('0x15')]('CreateWhatsappMessage',_0x1e5db6[_0xecd7('0x17')],_0x4fbe0d);_0x3f08d1(_0x224615['error'](0x1f4,_0x1e5db6[_0xecd7('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 35e25ef..666736e 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 _0x5f2c=['emit','removeListener','length','whatsappMessage:','./whatsappMessage.events','save','remove','update'];(function(_0x42ef4a,_0x54acba){var _0xe80023=function(_0x26da1f){while(--_0x26da1f){_0x42ef4a['push'](_0x42ef4a['shift']());}};_0xe80023(++_0x54acba);}(_0x5f2c,0x64));var _0xc5f2=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f2c[_0x19e35c];return _0x3e1fe8;};'use strict';var WhatsappMessageEvents=require(_0xc5f2('0x0'));var events=[_0xc5f2('0x1'),_0xc5f2('0x2'),_0xc5f2('0x3')];function createListener(_0x2f2ede,_0x4673a8){return function(_0x1dbe56){_0x4673a8[_0xc5f2('0x4')](_0x2f2ede,_0x1dbe56);};}function removeListener(_0x28f2d7,_0x3335d8){return function(){WhatsappMessageEvents[_0xc5f2('0x5')](_0x28f2d7,_0x3335d8);};}exports['register']=function(_0x3faffe){for(var _0x2bbb75=0x0,_0x570e5c=events[_0xc5f2('0x6')];_0x2bbb75<_0x570e5c;_0x2bbb75++){var _0x41340a=events[_0x2bbb75];var _0x4ecd4a=createListener(_0xc5f2('0x7')+_0x41340a,_0x3faffe);WhatsappMessageEvents['on'](_0x41340a,_0x4ecd4a);}}; \ No newline at end of file +var _0xa3e9=['emit','removeListener','register','length','whatsappMessage:','./whatsappMessage.events','remove','update'];(function(_0x13376c,_0x5e2168){var _0x513d72=function(_0x156b94){while(--_0x156b94){_0x13376c['push'](_0x13376c['shift']());}};_0x513d72(++_0x5e2168);}(_0xa3e9,0x8d));var _0x9a3e=function(_0x4edd45,_0x185604){_0x4edd45=_0x4edd45-0x0;var _0x3ad247=_0xa3e9[_0x4edd45];return _0x3ad247;};'use strict';var WhatsappMessageEvents=require(_0x9a3e('0x0'));var events=['save',_0x9a3e('0x1'),_0x9a3e('0x2')];function createListener(_0x383e06,_0x1aa873){return function(_0x589fd4){_0x1aa873[_0x9a3e('0x3')](_0x383e06,_0x589fd4);};}function removeListener(_0x5a055c,_0x136cd1){return function(){WhatsappMessageEvents[_0x9a3e('0x4')](_0x5a055c,_0x136cd1);};}exports[_0x9a3e('0x5')]=function(_0x271d10){for(var _0x349c03=0x0,_0x518e7d=events[_0x9a3e('0x6')];_0x349c03<_0x518e7d;_0x349c03++){var _0x5bb5cb=events[_0x349c03];var _0x193f0d=createListener(_0x9a3e('0x7')+_0x5bb5cb,_0x271d10);WhatsappMessageEvents['on'](_0x5bb5cb,_0x193f0d);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 98e077f..93a2353 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 _0x86be=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','/:id','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','destroy','delete','removeTeams','removeAgents','multer','path','connect-timeout'];(function(_0x1bb22c,_0x422534){var _0x57678d=function(_0x4bd099){while(--_0x4bd099){_0x1bb22c['push'](_0x1bb22c['shift']());}};_0x57678d(++_0x422534);}(_0x86be,0x176));var _0xe86b=function(_0x1302aa,_0x20312d){_0x1302aa=_0x1302aa-0x0;var _0x1aa25a=_0x86be[_0x1302aa];return _0x1aa25a;};'use strict';var multer=require(_0xe86b('0x0'));var util=require('util');var path=require(_0xe86b('0x1'));var timeout=require(_0xe86b('0x2'));var express=require(_0xe86b('0x3'));var router=express[_0xe86b('0x4')]();var fs_extra=require(_0xe86b('0x5'));var auth=require(_0xe86b('0x6'));var interaction=require(_0xe86b('0x7'));var config=require(_0xe86b('0x8'));var controller=require('./whatsappQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe86b('0x9')]);router[_0xe86b('0xa')](_0xe86b('0xb'),auth[_0xe86b('0xc')](),controller['describe']);router[_0xe86b('0xa')](_0xe86b('0xd'),auth[_0xe86b('0xc')](),controller['show']);router[_0xe86b('0xa')](_0xe86b('0xe'),auth[_0xe86b('0xc')](),controller['getMembers']);router[_0xe86b('0xa')](_0xe86b('0xf'),auth[_0xe86b('0xc')](),controller[_0xe86b('0x10')]);router[_0xe86b('0xa')](_0xe86b('0x11'),auth[_0xe86b('0xc')](),controller[_0xe86b('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe86b('0x13')]);router[_0xe86b('0x14')](_0xe86b('0xf'),auth[_0xe86b('0xc')](),controller[_0xe86b('0x15')]);router[_0xe86b('0x14')](_0xe86b('0x11'),auth[_0xe86b('0xc')](),controller[_0xe86b('0x16')]);router[_0xe86b('0x17')](_0xe86b('0xd'),auth['isAuthenticated'](),controller[_0xe86b('0x18')]);router['delete'](_0xe86b('0xd'),auth[_0xe86b('0xc')](),controller[_0xe86b('0x19')]);router[_0xe86b('0x1a')](_0xe86b('0xf'),auth[_0xe86b('0xc')](),controller[_0xe86b('0x1b')]);router['delete'](_0xe86b('0x11'),auth['isAuthenticated'](),controller[_0xe86b('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xe6b3=['/:id','update','delete','destroy','removeTeams','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','describe','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents'];(function(_0x420a41,_0x18f72a){var _0x328bed=function(_0x3139d8){while(--_0x3139d8){_0x420a41['push'](_0x420a41['shift']());}};_0x328bed(++_0x18f72a);}(_0xe6b3,0x1aa));var _0x3e6b=function(_0x53a285,_0x16a64f){_0x53a285=_0x53a285-0x0;var _0x5f20e9=_0xe6b3[_0x53a285];return _0x5f20e9;};'use strict';var multer=require(_0x3e6b('0x0'));var util=require(_0x3e6b('0x1'));var path=require('path');var timeout=require(_0x3e6b('0x2'));var express=require(_0x3e6b('0x3'));var router=express[_0x3e6b('0x4')]();var fs_extra=require(_0x3e6b('0x5'));var auth=require(_0x3e6b('0x6'));var interaction=require(_0x3e6b('0x7'));var config=require(_0x3e6b('0x8'));var controller=require(_0x3e6b('0x9'));router[_0x3e6b('0xa')]('/',auth[_0x3e6b('0xb')](),controller['index']);router[_0x3e6b('0xa')]('/describe',auth[_0x3e6b('0xb')](),controller[_0x3e6b('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3e6b('0xa')](_0x3e6b('0xd'),auth[_0x3e6b('0xb')](),controller['getMembers']);router[_0x3e6b('0xa')](_0x3e6b('0xe'),auth[_0x3e6b('0xb')](),controller[_0x3e6b('0xf')]);router[_0x3e6b('0xa')](_0x3e6b('0x10'),auth['isAuthenticated'](),controller[_0x3e6b('0x11')]);router[_0x3e6b('0x12')]('/',auth[_0x3e6b('0xb')](),controller[_0x3e6b('0x13')]);router[_0x3e6b('0x12')](_0x3e6b('0xe'),auth[_0x3e6b('0xb')](),controller[_0x3e6b('0x14')]);router[_0x3e6b('0x12')](_0x3e6b('0x10'),auth[_0x3e6b('0xb')](),controller[_0x3e6b('0x15')]);router['put'](_0x3e6b('0x16'),auth[_0x3e6b('0xb')](),controller[_0x3e6b('0x17')]);router[_0x3e6b('0x18')]('/:id',auth[_0x3e6b('0xb')](),controller[_0x3e6b('0x19')]);router[_0x3e6b('0x18')]('/:id/teams',auth[_0x3e6b('0xb')](),controller[_0x3e6b('0x1a')]);router[_0x3e6b('0x18')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x3e6b('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 0282b96..5bd67df 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 _0x1ee2=['name','INTEGER','rrmemory','beepall','sequelize','exports','STRING'];(function(_0x4e8705,_0x1fcefb){var _0x3b2b16=function(_0x5a13ee){while(--_0x5a13ee){_0x4e8705['push'](_0x4e8705['shift']());}};_0x3b2b16(++_0x1fcefb);}(_0x1ee2,0x11c));var _0x21ee=function(_0x89183,_0x197c61){_0x89183=_0x89183-0x0;var _0x6a83a=_0x1ee2[_0x89183];return _0x6a83a;};'use strict';var Sequelize=require(_0x21ee('0x0'));module[_0x21ee('0x1')]={'name':{'type':Sequelize[_0x21ee('0x2')],'unique':_0x21ee('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x21ee('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x21ee('0x5'),_0x21ee('0x6'),'roundrobin')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa902=['name','INTEGER','rrmemory','sequelize','exports','STRING'];(function(_0x364774,_0x4cc655){var _0x2541a5=function(_0x2db975){while(--_0x2db975){_0x364774['push'](_0x364774['shift']());}};_0x2541a5(++_0x4cc655);}(_0xa902,0x8d));var _0x2a90=function(_0x296ae2,_0x3fcea5){_0x296ae2=_0x296ae2-0x0;var _0x2b251b=_0xa902[_0x296ae2];return _0x2b251b;};'use strict';var Sequelize=require(_0x2a90('0x0'));module[_0x2a90('0x1')]={'name':{'type':Sequelize[_0x2a90('0x2')],'unique':_0x2a90('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x2a90('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x2a90('0x5'),'beepall','roundrobin')},'description':{'type':Sequelize[_0x2a90('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 615dfb3..795967c 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 _0x8f24=['order','pick','WhatsappQueueId','User','findAndCountAll','UserId','updatedAt','createdAt','rows','SIP','whatsappPause','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','forEach','emit','userWhatsappQueue:save','field','from','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','push','sequelize','SELECT','TeamId','includes','union','compact','removeTeams','removeAgents','addAgents','omit','spread','isArray','userWhatsappQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','WhatsappQueues','UserProfileResource','destroy','error','stack','name','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue'];(function(_0x2aee1e,_0x25b184){var _0x30ae95=function(_0x483e71){while(--_0x483e71){_0x2aee1e['push'](_0x2aee1e['shift']());}};_0x30ae95(++_0x25b184);}(_0x8f24,0x147));var _0x48f2=function(_0x3ecaed,_0x6a02f6){_0x3ecaed=_0x3ecaed-0x0;var _0x5906b7=_0x8f24[_0x3ecaed];return _0x5906b7;};'use strict';var emlformat=require(_0x48f2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x48f2('0x1'));var jsonpatch=require(_0x48f2('0x2'));var rp=require(_0x48f2('0x3'));var moment=require(_0x48f2('0x4'));var BPromise=require(_0x48f2('0x5'));var Mustache=require(_0x48f2('0x6'));var util=require(_0x48f2('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x48f2('0x8'));var ejs=require(_0x48f2('0x9'));var fs=require('fs');var fs_extra=require(_0x48f2('0xa'));var _=require(_0x48f2('0xb'));var squel=require(_0x48f2('0xc'));var crypto=require(_0x48f2('0xd'));var jsforce=require(_0x48f2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x48f2('0x8'));var querystring=require(_0x48f2('0xf'));var Papa=require(_0x48f2('0x10'));var Redis=require(_0x48f2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x48f2('0x12'));var as=require(_0x48f2('0x13'));var hardwareService=require(_0x48f2('0x14'));var logger=require(_0x48f2('0x15'))(_0x48f2('0x16'));var utils=require(_0x48f2('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x48f2('0x18'));var db=require(_0x48f2('0x19'))['db'];config[_0x48f2('0x1a')]=_[_0x48f2('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x48f2('0x1c'))(new Redis(config[_0x48f2('0x1a')]));require('./whatsappQueue.socket')['register'](socket);function respondWithStatusCode(_0x1138fc,_0x2a76c1){_0x2a76c1=_0x2a76c1||0xcc;return function(_0x5d3eba){if(_0x5d3eba){return _0x1138fc[_0x48f2('0x1d')](_0x2a76c1);}return _0x1138fc[_0x48f2('0x1e')](_0x2a76c1)[_0x48f2('0x1f')]();};}function respondWithResult(_0x1da5c9,_0x2e155a){_0x2e155a=_0x2e155a||0xc8;return function(_0x2c4d04){if(_0x2c4d04){return _0x1da5c9[_0x48f2('0x1e')](_0x2e155a)[_0x48f2('0x20')](_0x2c4d04);}};}function respondWithFilteredResult(_0x5e48cb,_0x57e064){return function(_0x1feb53){if(_0x1feb53){var _0x501001=typeof _0x57e064[_0x48f2('0x21')]==='undefined'&&typeof _0x57e064[_0x48f2('0x22')]===_0x48f2('0x23');var _0x50964d=_0x1feb53[_0x48f2('0x24')];var _0x28c419=_0x501001?0x0:_0x57e064[_0x48f2('0x21')];var _0x47db93=_0x501001?_0x1feb53['count']:_0x57e064['offset']+_0x57e064[_0x48f2('0x22')];var _0xcc6235;if(_0x47db93>=_0x50964d){_0x47db93=_0x50964d;_0xcc6235=0xc8;}else{_0xcc6235=0xce;}_0x5e48cb[_0x48f2('0x1e')](_0xcc6235);return _0x5e48cb[_0x48f2('0x25')](_0x48f2('0x26'),_0x28c419+'-'+_0x47db93+'/'+_0x50964d)[_0x48f2('0x20')](_0x1feb53);}return null;};}function patchUpdates(_0x462b0c){return function(_0x2aaf04){try{jsonpatch[_0x48f2('0x27')](_0x2aaf04,_0x462b0c,!![]);}catch(_0x208ae4){return BPromise[_0x48f2('0x28')](_0x208ae4);}return _0x2aaf04[_0x48f2('0x29')]();};}function saveUpdates(_0x638e1a,_0x3457b2){return function(_0xe0651b){if(_0xe0651b){return _0xe0651b[_0x48f2('0x2a')](_0x638e1a)[_0x48f2('0x2b')](function(_0x536f04){return _0x536f04;});}return null;};}function removeEntity(_0xdea8ec,_0x450835){return function(_0x2147dd){if(_0x2147dd){return _0x2147dd['destroy']()['then'](function(){var _0x4b4106=_0x2147dd[_0x48f2('0x2c')]({'plain':!![]});var _0x4d6e89=_0x48f2('0x2d');return db[_0x48f2('0x2e')][_0x48f2('0x2f')]({'where':{'type':_0x4d6e89,'resourceId':_0x4b4106['id']}})[_0x48f2('0x2b')](function(){return _0x2147dd;});})[_0x48f2('0x2b')](function(){_0xdea8ec[_0x48f2('0x1e')](0xcc)[_0x48f2('0x1f')]();});}};}function handleEntityNotFound(_0x3f6aae,_0xf8167e){return function(_0x257bb7){if(!_0x257bb7){_0x3f6aae[_0x48f2('0x1d')](0x194);}return _0x257bb7;};}function handleError(_0x2ac5f8,_0x267984){_0x267984=_0x267984||0x1f4;return function(_0x3bde7f){logger[_0x48f2('0x30')](_0x3bde7f[_0x48f2('0x31')]);if(_0x3bde7f['name']){delete _0x3bde7f[_0x48f2('0x32')];}_0x2ac5f8[_0x48f2('0x1e')](_0x267984)['send'](_0x3bde7f);};}exports[_0x48f2('0x33')]=function(_0x4be31e,_0x574fa8){var _0x49f7e7={},_0x364520={},_0x217038={'count':0x0,'rows':[]};var _0xf6bfdc=_[_0x48f2('0x34')](db[_0x48f2('0x35')][_0x48f2('0x36')],function(_0x354f9a){return{'name':_0x354f9a[_0x48f2('0x37')],'type':_0x354f9a[_0x48f2('0x38')][_0x48f2('0x39')]};});_0x364520[_0x48f2('0x3a')]=_['map'](_0xf6bfdc,_0x48f2('0x32'));_0x364520[_0x48f2('0x3b')]=_[_0x48f2('0x3c')](_0x4be31e['query']);_0x364520['filters']=_[_0x48f2('0x3d')](_0x364520[_0x48f2('0x3a')],_0x364520[_0x48f2('0x3b')]);_0x49f7e7['attributes']=_[_0x48f2('0x3d')](_0x364520[_0x48f2('0x3a')],qs['fields'](_0x4be31e[_0x48f2('0x3b')][_0x48f2('0x3e')]));_0x49f7e7[_0x48f2('0x3f')]=_0x49f7e7[_0x48f2('0x3f')][_0x48f2('0x40')]?_0x49f7e7[_0x48f2('0x3f')]:_0x364520[_0x48f2('0x3a')];if(!_0x4be31e[_0x48f2('0x3b')][_0x48f2('0x41')](_0x48f2('0x42'))){_0x49f7e7[_0x48f2('0x22')]=qs['limit'](_0x4be31e[_0x48f2('0x3b')][_0x48f2('0x22')]);_0x49f7e7[_0x48f2('0x21')]=qs[_0x48f2('0x21')](_0x4be31e[_0x48f2('0x3b')]['offset']);}_0x49f7e7['order']=qs[_0x48f2('0x43')](_0x4be31e[_0x48f2('0x3b')][_0x48f2('0x43')]);_0x49f7e7[_0x48f2('0x44')]=qs['filters'](_['pick'](_0x4be31e[_0x48f2('0x3b')],_0x364520[_0x48f2('0x45')]),_0xf6bfdc);if(_0x4be31e['query'][_0x48f2('0x46')]){_0x49f7e7[_0x48f2('0x44')]=_['merge'](_0x49f7e7[_0x48f2('0x44')],{'$or':_['map'](_0xf6bfdc,function(_0x590cf1){if(_0x590cf1['type']!==_0x48f2('0x47')){var _0x46ea84={};_0x46ea84[_0x590cf1[_0x48f2('0x32')]]={'$like':'%'+_0x4be31e['query'][_0x48f2('0x46')]+'%'};return _0x46ea84;}})});}_0x49f7e7=_[_0x48f2('0x48')]({},_0x49f7e7,_0x4be31e[_0x48f2('0x49')]);var _0x43cf69={'where':_0x49f7e7['where']};return db[_0x48f2('0x35')][_0x48f2('0x24')](_0x43cf69)[_0x48f2('0x2b')](function(_0x931325){_0x217038[_0x48f2('0x24')]=_0x931325;if(_0x4be31e[_0x48f2('0x3b')][_0x48f2('0x4a')]){_0x49f7e7[_0x48f2('0x4b')]=[{'all':!![]}];}return db[_0x48f2('0x35')][_0x48f2('0x4c')](_0x49f7e7);})[_0x48f2('0x2b')](function(_0x2aa301){_0x217038['rows']=_0x2aa301;return _0x217038;})[_0x48f2('0x2b')](respondWithFilteredResult(_0x574fa8,_0x49f7e7))[_0x48f2('0x4d')](handleError(_0x574fa8,null));};exports[_0x48f2('0x4e')]=function(_0x2b9d69,_0x5825e5){var _0x489d7a={'raw':!![],'where':{'id':_0x2b9d69[_0x48f2('0x4f')]['id']}},_0x4f74eb={};_0x4f74eb[_0x48f2('0x3a')]=_[_0x48f2('0x3c')](db[_0x48f2('0x35')][_0x48f2('0x36')]);_0x4f74eb[_0x48f2('0x3b')]=_[_0x48f2('0x3c')](_0x2b9d69[_0x48f2('0x3b')]);_0x4f74eb[_0x48f2('0x45')]=_[_0x48f2('0x3d')](_0x4f74eb[_0x48f2('0x3a')],_0x4f74eb[_0x48f2('0x3b')]);_0x489d7a[_0x48f2('0x3f')]=_[_0x48f2('0x3d')](_0x4f74eb['model'],qs['fields'](_0x2b9d69[_0x48f2('0x3b')][_0x48f2('0x3e')]));_0x489d7a[_0x48f2('0x3f')]=_0x489d7a[_0x48f2('0x3f')]['length']?_0x489d7a[_0x48f2('0x3f')]:_0x4f74eb[_0x48f2('0x3a')];if(_0x2b9d69[_0x48f2('0x3b')]['includeAll']){_0x489d7a['include']=[{'all':!![]}];}_0x489d7a=_['merge']({},_0x489d7a,_0x2b9d69['options']);return db[_0x48f2('0x35')][_0x48f2('0x50')](_0x489d7a)[_0x48f2('0x2b')](handleEntityNotFound(_0x5825e5,null))[_0x48f2('0x2b')](respondWithResult(_0x5825e5,null))['catch'](handleError(_0x5825e5,null));};exports['create']=function(_0x519d43,_0x457ffe){return db['WhatsappQueue']['create'](_0x519d43[_0x48f2('0x51')],{})[_0x48f2('0x2b')](function(_0x218fa9){var _0x407880=_0x519d43[_0x48f2('0x52')][_0x48f2('0x2c')]({'plain':!![]});if(!_0x407880)throw new Error(_0x48f2('0x53'));if(_0x407880[_0x48f2('0x54')]===_0x48f2('0x52')){var _0x2cf15f=_0x218fa9[_0x48f2('0x2c')]({'plain':!![]});var _0x75aaa8=_0x48f2('0x2d');return db[_0x48f2('0x55')][_0x48f2('0x50')]({'where':{'name':_0x75aaa8,'userProfileId':_0x407880['userProfileId']},'raw':!![]})[_0x48f2('0x2b')](function(_0x249437){if(_0x249437&&_0x249437[_0x48f2('0x56')]===0x0){return db[_0x48f2('0x2e')][_0x48f2('0x57')]({'name':_0x2cf15f[_0x48f2('0x32')],'resourceId':_0x2cf15f['id'],'type':_0x249437[_0x48f2('0x32')],'sectionId':_0x249437['id']},{})[_0x48f2('0x2b')](function(){return _0x218fa9;});}else{return _0x218fa9;}})[_0x48f2('0x4d')](function(_0x22cc13){logger[_0x48f2('0x30')](_0x48f2('0x58'),_0x22cc13);throw _0x22cc13;});}return _0x218fa9;})['then'](respondWithResult(_0x457ffe,0xc9))[_0x48f2('0x4d')](handleError(_0x457ffe,null));};exports['update']=function(_0x28d1ef,_0x4f0892){if(_0x28d1ef['body']['id']){delete _0x28d1ef['body']['id'];}return db[_0x48f2('0x35')][_0x48f2('0x50')]({'where':{'id':_0x28d1ef['params']['id']}})['then'](handleEntityNotFound(_0x4f0892,null))['then'](saveUpdates(_0x28d1ef['body'],null))[_0x48f2('0x2b')](respondWithResult(_0x4f0892,null))[_0x48f2('0x4d')](handleError(_0x4f0892,null));};exports['destroy']=function(_0x9cb4dd,_0x93c948){return db[_0x48f2('0x35')][_0x48f2('0x50')]({'where':{'id':_0x9cb4dd['params']['id']}})[_0x48f2('0x2b')](handleEntityNotFound(_0x93c948,null))['then'](removeEntity(_0x93c948,null))[_0x48f2('0x4d')](handleError(_0x93c948,null));};exports[_0x48f2('0x59')]=function(_0x567217,_0x1fe05f){return db[_0x48f2('0x35')][_0x48f2('0x59')]()[_0x48f2('0x2b')](respondWithResult(_0x1fe05f,null))['catch'](handleError(_0x1fe05f,null));};exports[_0x48f2('0x5a')]=function(_0xcf8ef,_0x55d3b4,_0x35c385){var _0x28e4f3={'raw':!![],'where':{}},_0x1321d4={},_0x1ac35f;return db[_0x48f2('0x35')][_0x48f2('0x5b')]({'where':{'id':_0xcf8ef[_0x48f2('0x4f')]['id']}})['then'](handleEntityNotFound(_0x55d3b4,null))[_0x48f2('0x2b')](function(_0x29649a){if(_0x29649a){_0x1ac35f=_0x29649a[_0x48f2('0x2c')]({'plain':!![]});_0x1321d4['model']=_[_0x48f2('0x3c')](db[_0x48f2('0x5c')][_0x48f2('0x36')]);_0x1321d4[_0x48f2('0x3b')]=_[_0x48f2('0x3c')](_0xcf8ef[_0x48f2('0x3b')]);_0x1321d4['filters']=_[_0x48f2('0x3d')](_0x1321d4[_0x48f2('0x3a')],_0x1321d4[_0x48f2('0x3b')]);_0x28e4f3[_0x48f2('0x3f')]=_[_0x48f2('0x3d')](_0x1321d4[_0x48f2('0x3a')],qs[_0x48f2('0x3e')](_0xcf8ef['query'][_0x48f2('0x3e')]));_0x28e4f3[_0x48f2('0x3f')]=_0x28e4f3['attributes'][_0x48f2('0x40')]?_0x28e4f3['attributes']:_0x1321d4[_0x48f2('0x3a')];if(!_0xcf8ef[_0x48f2('0x3b')][_0x48f2('0x41')](_0x48f2('0x42'))){_0x28e4f3[_0x48f2('0x22')]=qs['limit'](_0xcf8ef[_0x48f2('0x3b')][_0x48f2('0x22')]);_0x28e4f3[_0x48f2('0x21')]=qs['offset'](_0xcf8ef[_0x48f2('0x3b')][_0x48f2('0x21')]);}_0x28e4f3[_0x48f2('0x5d')]=qs[_0x48f2('0x43')](_0xcf8ef[_0x48f2('0x3b')][_0x48f2('0x43')]);_0x28e4f3[_0x48f2('0x44')]=qs[_0x48f2('0x45')](_[_0x48f2('0x5e')](_0xcf8ef['query'],_0x1321d4[_0x48f2('0x45')]));_0x28e4f3[_0x48f2('0x44')][_0x48f2('0x5f')]=_0x29649a['id'];if(_0xcf8ef[_0x48f2('0x3b')][_0x48f2('0x46')]){_0x28e4f3[_0x48f2('0x44')]=_[_0x48f2('0x48')](_0x28e4f3[_0x48f2('0x44')],{'$or':_[_0x48f2('0x34')](_0x28e4f3[_0x48f2('0x3f')],function(_0x220fb8){var _0x3215c9={};_0x3215c9[_0x220fb8]={'$like':'%'+_0xcf8ef[_0x48f2('0x3b')][_0x48f2('0x46')]+'%'};return _0x3215c9;})});}_0x28e4f3=_[_0x48f2('0x48')]({},_0x28e4f3,_0xcf8ef[_0x48f2('0x49')]);return db[_0x48f2('0x5c')][_0x48f2('0x4c')](_0x28e4f3);}})[_0x48f2('0x2b')](function(_0x46a5ac){if(_0x46a5ac){return db[_0x48f2('0x60')][_0x48f2('0x61')]({'where':{'id':_[_0x48f2('0x34')](_0x46a5ac,_0x48f2('0x62')),'role':'agent'},'attributes':['id',_0x48f2('0x32'),'whatsappPause',_0x48f2('0x63'),_0x48f2('0x64')]});}})[_0x48f2('0x2b')](function(_0x2446d2){if(_0x2446d2){return{'count':_0x2446d2['count'],'rows':_[_0x48f2('0x34')](_0x2446d2[_0x48f2('0x65')],function(_0xeba7d2){return{'membername':_0xeba7d2[_0x48f2('0x32')],'UserId':_0xeba7d2['id'],'queue_name':_0x1ac35f[_0x48f2('0x32')],'WhatsappQueueId':_0x1ac35f['id'],'interface':util['format']('%s/%s',_0x48f2('0x66'),_0xeba7d2[_0x48f2('0x32')]),'penalty':0x0,'paused':_0xeba7d2[_0x48f2('0x67')],'createdAt':_0xeba7d2['createdAt'],'updatedAt':_0xeba7d2[_0x48f2('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x48f2('0x2b')](respondWithFilteredResult(_0x55d3b4,_0x28e4f3))['catch'](handleError(_0x55d3b4,null));};exports[_0x48f2('0x68')]=function(_0x91e9d7,_0x2aeea8,_0x2a3ef4){var _0x11b3b6={};var _0x2f04ee={};var _0x3c4ec6;var _0x5d1391;return db['WhatsappQueue'][_0x48f2('0x5b')]({'where':{'id':_0x91e9d7[_0x48f2('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2aeea8,null))[_0x48f2('0x2b')](function(_0x3c0a9f){if(_0x3c0a9f){_0x3c4ec6=_0x3c0a9f;_0x2f04ee[_0x48f2('0x3a')]=_[_0x48f2('0x3c')](db[_0x48f2('0x69')][_0x48f2('0x36')]);_0x2f04ee[_0x48f2('0x3b')]=_[_0x48f2('0x3c')](_0x91e9d7[_0x48f2('0x3b')]);_0x2f04ee[_0x48f2('0x45')]=_[_0x48f2('0x3d')](_0x2f04ee[_0x48f2('0x3a')],_0x2f04ee[_0x48f2('0x3b')]);_0x11b3b6[_0x48f2('0x3f')]=_[_0x48f2('0x3d')](_0x2f04ee[_0x48f2('0x3a')],qs['fields'](_0x91e9d7[_0x48f2('0x3b')][_0x48f2('0x3e')]));_0x11b3b6[_0x48f2('0x3f')]=_0x11b3b6[_0x48f2('0x3f')][_0x48f2('0x40')]?_0x11b3b6[_0x48f2('0x3f')]:_0x2f04ee['model'];_0x11b3b6[_0x48f2('0x5d')]=qs[_0x48f2('0x43')](_0x91e9d7[_0x48f2('0x3b')][_0x48f2('0x43')]);_0x11b3b6[_0x48f2('0x44')]=qs[_0x48f2('0x45')](_[_0x48f2('0x5e')](_0x91e9d7[_0x48f2('0x3b')],_0x2f04ee[_0x48f2('0x45')]));if(_0x91e9d7['query']['filter']){_0x11b3b6['where']=_[_0x48f2('0x48')](_0x11b3b6[_0x48f2('0x44')],{'$or':_[_0x48f2('0x34')](_0x11b3b6['attributes'],function(_0x2ee802){var _0x4c6abf={};_0x4c6abf[_0x2ee802]={'$like':'%'+_0x91e9d7['query']['filter']+'%'};return _0x4c6abf;})});}_0x11b3b6=_[_0x48f2('0x48')]({},_0x11b3b6,_0x91e9d7['options']);return _0x3c4ec6[_0x48f2('0x68')](_0x11b3b6);}})['then'](function(_0x5e94b1){if(_0x5e94b1){_0x5d1391=_0x5e94b1[_0x48f2('0x40')];if(!_0x91e9d7[_0x48f2('0x3b')][_0x48f2('0x41')](_0x48f2('0x42'))){_0x11b3b6[_0x48f2('0x22')]=qs[_0x48f2('0x22')](_0x91e9d7['query']['limit']);_0x11b3b6['offset']=qs[_0x48f2('0x21')](_0x91e9d7[_0x48f2('0x3b')]['offset']);}return _0x3c4ec6[_0x48f2('0x68')](_0x11b3b6);}})['then'](function(_0x108c8d){if(_0x108c8d){return _0x108c8d?{'count':_0x5d1391,'rows':_0x108c8d}:null;}})[_0x48f2('0x2b')](respondWithResult(_0x2aeea8,null))[_0x48f2('0x4d')](handleError(_0x2aeea8,null));};exports[_0x48f2('0x6a')]=function(_0x19043c,_0x1a349e,_0x1d23b5){var _0x35a146=_0x19043c['body'][_0x48f2('0x6b')];return db[_0x48f2('0x69')][_0x48f2('0x4c')]({'where':{'id':_0x35a146},'attributes':['id'],'include':[{'model':db[_0x48f2('0x60')],'as':_0x48f2('0x6c'),'attributes':['id',_0x48f2('0x32'),_0x48f2('0x6d'),_0x48f2('0x6e'),_0x48f2('0x6f')],'raw':!![]}]})[_0x48f2('0x2b')](function(_0x372bbc){if(_0x372bbc){var _0x4c0120=_[_0x48f2('0x70')](_0x372bbc,function(_0x19ac50){var _0x2ce4d7=_0x19ac50[_0x48f2('0x2c')]({'plain':!![]});return _0x2ce4d7[_0x48f2('0x6c')];});return db[_0x48f2('0x35')]['find']({'where':{'id':_0x19043c[_0x48f2('0x4f')]['id']}})[_0x48f2('0x2b')](function(_0x5e782b){return db['sequelize'][_0x48f2('0x71')](function(_0x135c7e){return _0x5e782b[_0x48f2('0x6a')](_0x35a146,{'transaction':_0x135c7e})[_0x48f2('0x2b')](function(){return BPromise[_0x48f2('0x72')](_0x4c0120,function(_0x50bae7){return db[_0x48f2('0x5c')]['findOrCreate']({'where':{'UserId':_0x50bae7['id'],'WhatsappQueueId':_0x19043c[_0x48f2('0x4f')]['id']},'transaction':_0x135c7e});});})[_0x48f2('0x2b')](function(){_0x4c0120[_0x48f2('0x73')](function(_0x24833a){socket[_0x48f2('0x74')](_0x48f2('0x75'),{'UserId':_0x24833a['id'],'WhatsappQueueId':_0x5e782b['id']});});});});});}})[_0x48f2('0x2b')](respondWithStatusCode(_0x1a349e,null))[_0x48f2('0x4d')](handleError(_0x1a349e,null));};exports['removeTeams']=function(_0x103cf5,_0x4b8ae7,_0x507c5b){return db[_0x48f2('0x69')][_0x48f2('0x4c')]({'where':{'id':_0x103cf5['query'][_0x48f2('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x48f2('0x60')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x48f2('0x2b')](handleEntityNotFound(_0x4b8ae7,null))[_0x48f2('0x2b')](function(_0x3e0aee){var _0x4f77ff=_['map'](_0x3e0aee,'id');var _0x234c4b=[];var _0xe7d0c6=[];var _0x432386=squel['select']();_0x432386[_0x48f2('0x76')]('tq.TeamId')[_0x48f2('0x77')](_0x48f2('0x78'),'tq')['join'](_0x48f2('0x79'),'ut',_0x48f2('0x7a'))[_0x48f2('0x44')](_0x48f2('0x7b'),_0x103cf5['params']['id']);for(var _0x19b15c=0x0;_0x19b15c<_0x3e0aee['length'];_0x19b15c+=0x1){let _0x44a35b=_0x3e0aee[_0x19b15c];for(var _0x3521ce=0x0;_0x3521ce<_0x44a35b[_0x48f2('0x6c')][_0x48f2('0x40')];_0x3521ce+=0x1){let _0x13ddac=_0x44a35b[_0x48f2('0x6c')][_0x3521ce];var _0x2dc38b=_0x432386[_0x48f2('0x7c')]();_0x2dc38b[_0x48f2('0x44')]('ut.UserId\x20=\x20?',_0x13ddac['id']);_0xe7d0c6[_0x48f2('0x7d')](db[_0x48f2('0x7e')][_0x48f2('0x3b')](_0x2dc38b['toString'](),{'type':db[_0x48f2('0x7e')]['QueryTypes'][_0x48f2('0x7f')]})['then'](function(_0x2acfca){if(_0x2acfca[_0x48f2('0x40')]===0x1){return _0x13ddac['id'];}else{var _0x414768=_['every'](_[_0x48f2('0x34')](_0x2acfca,_0x48f2('0x80')),function(_0x2c1001){return _[_0x48f2('0x81')](_0x4f77ff,_0x2c1001);});if(_0x414768){return _0x13ddac['id'];}}}));}}return BPromise['all'](_0xe7d0c6)[_0x48f2('0x2b')](function(_0x22f908){_0x234c4b=_(_0x234c4b)[_0x48f2('0x82')](_0x22f908)[_0x48f2('0x83')]()['value']();return db[_0x48f2('0x35')]['find']({'where':{'id':_0x103cf5[_0x48f2('0x4f')]['id']}})[_0x48f2('0x2b')](function(_0x445837){return db[_0x48f2('0x7e')][_0x48f2('0x71')](function(_0xa051f2){return _0x445837[_0x48f2('0x84')](_0x103cf5[_0x48f2('0x3b')]['ids'],{'transaction':_0xa051f2})[_0x48f2('0x2b')](function(){if(!_['isEmpty'](_0x234c4b)){return _0x445837[_0x48f2('0x85')](_0x234c4b,{'transaction':_0xa051f2});}})['then'](function(){_0x234c4b[_0x48f2('0x73')](function(_0xe8ebb1){socket[_0x48f2('0x74')]('userWhatsappQueue:remove',{'UserId':_0xe8ebb1,'WhatsappQueueId':_0x445837['id']});});});});});});})[_0x48f2('0x2b')](respondWithStatusCode(_0x4b8ae7,null))[_0x48f2('0x4d')](handleError(_0x4b8ae7,null));};exports[_0x48f2('0x86')]=function(_0x197314,_0x39344a,_0xbfbd4d){return db[_0x48f2('0x35')][_0x48f2('0x50')]({'where':{'id':_0x197314[_0x48f2('0x4f')]['id']}})[_0x48f2('0x2b')](handleEntityNotFound(_0x39344a,null))['then'](function(_0x1b0983){if(_0x1b0983){return _0x1b0983[_0x48f2('0x86')](_0x197314[_0x48f2('0x51')][_0x48f2('0x6b')],_[_0x48f2('0x87')](_0x197314[_0x48f2('0x51')],[_0x48f2('0x6b'),'id'])||{})[_0x48f2('0x88')](function(_0x5ec95c){for(var _0x357b8a=0x0;_0x357b8a<_0x197314['body']['ids'][_0x48f2('0x40')];_0x357b8a+=0x1){socket[_0x48f2('0x74')](_0x48f2('0x75'),{'UserId':Number(_0x197314[_0x48f2('0x51')]['ids'][_0x357b8a]),'WhatsappQueueId':Number(_0x197314[_0x48f2('0x4f')]['id'])});}return _0x5ec95c;});}})[_0x48f2('0x2b')](respondWithResult(_0x39344a,null))[_0x48f2('0x4d')](handleError(_0x39344a,null));};exports[_0x48f2('0x85')]=function(_0x105629,_0x595b67,_0x13443c){return db[_0x48f2('0x35')]['find']({'where':{'id':_0x105629['params']['id']}})[_0x48f2('0x2b')](handleEntityNotFound(_0x595b67,null))[_0x48f2('0x2b')](function(_0x191733){if(_0x191733){return _0x191733[_0x48f2('0x85')](_0x105629[_0x48f2('0x3b')][_0x48f2('0x6b')])[_0x48f2('0x2b')](function(){if(_[_0x48f2('0x89')](_0x105629[_0x48f2('0x3b')][_0x48f2('0x6b')])){for(var _0x762e38=0x0;_0x762e38<_0x105629['query'][_0x48f2('0x6b')][_0x48f2('0x40')];_0x762e38+=0x1){socket[_0x48f2('0x74')](_0x48f2('0x8a'),{'UserId':Number(_0x105629[_0x48f2('0x3b')][_0x48f2('0x6b')][_0x762e38]),'WhatsappQueueId':Number(_0x105629[_0x48f2('0x4f')]['id'])});}}else{socket[_0x48f2('0x74')](_0x48f2('0x8a'),{'UserId':Number(_0x105629['query'][_0x48f2('0x6b')]),'WhatsappQueueId':Number(_0x105629[_0x48f2('0x4f')]['id'])});}});}})[_0x48f2('0x2b')](respondWithStatusCode(_0x595b67,null))[_0x48f2('0x4d')](handleError(_0x595b67,null));};exports[_0x48f2('0x8b')]=function(_0x32b3d9,_0x267be7,_0x37522b){var _0x546d0f={};var _0x5d94fd={};var _0x5b878c;var _0x401871;return db[_0x48f2('0x35')][_0x48f2('0x5b')]({'where':{'id':_0x32b3d9[_0x48f2('0x4f')]['id']}})[_0x48f2('0x2b')](handleEntityNotFound(_0x267be7,null))[_0x48f2('0x2b')](function(_0x550ce){if(_0x550ce){_0x5b878c=_0x550ce;_0x5d94fd[_0x48f2('0x3a')]=_[_0x48f2('0x3c')](db['User'][_0x48f2('0x36')]);_0x5d94fd[_0x48f2('0x3b')]=_[_0x48f2('0x3c')](_0x32b3d9[_0x48f2('0x3b')]);_0x5d94fd[_0x48f2('0x45')]=_[_0x48f2('0x3d')](_0x5d94fd[_0x48f2('0x3a')],_0x5d94fd['query']);_0x546d0f[_0x48f2('0x3f')]=_[_0x48f2('0x3d')](_0x5d94fd[_0x48f2('0x3a')],qs[_0x48f2('0x3e')](_0x32b3d9[_0x48f2('0x3b')][_0x48f2('0x3e')]));_0x546d0f[_0x48f2('0x3f')]=_0x546d0f['attributes'][_0x48f2('0x40')]?_0x546d0f[_0x48f2('0x3f')]:_0x5d94fd['model'];_0x546d0f[_0x48f2('0x5d')]=qs['sort'](_0x32b3d9[_0x48f2('0x3b')][_0x48f2('0x43')]);_0x546d0f[_0x48f2('0x44')]=qs[_0x48f2('0x45')](_[_0x48f2('0x5e')](_0x32b3d9['query'],_0x5d94fd[_0x48f2('0x45')]));if(_0x32b3d9[_0x48f2('0x3b')][_0x48f2('0x46')]){_0x546d0f[_0x48f2('0x44')]=_['merge'](_0x546d0f['where'],{'$or':_[_0x48f2('0x34')](_0x546d0f['attributes'],function(_0x3a367c){var _0xbcae31={};_0xbcae31[_0x3a367c]={'$like':'%'+_0x32b3d9[_0x48f2('0x3b')][_0x48f2('0x46')]+'%'};return _0xbcae31;})});}_0x546d0f=_[_0x48f2('0x48')]({},_0x546d0f,_0x32b3d9[_0x48f2('0x49')]);return _0x5b878c[_0x48f2('0x8b')](_0x546d0f);}})['then'](function(_0x512265){if(_0x512265){_0x401871=_0x512265['length'];if(!_0x32b3d9[_0x48f2('0x3b')]['hasOwnProperty'](_0x48f2('0x42'))){_0x546d0f['limit']=qs[_0x48f2('0x22')](_0x32b3d9[_0x48f2('0x3b')][_0x48f2('0x22')]);_0x546d0f[_0x48f2('0x21')]=qs[_0x48f2('0x21')](_0x32b3d9[_0x48f2('0x3b')][_0x48f2('0x21')]);}return _0x5b878c[_0x48f2('0x8b')](_0x546d0f);}})['then'](function(_0x26899a){if(_0x26899a){return _0x26899a?{'count':_0x401871,'rows':_0x26899a}:null;}})[_0x48f2('0x2b')](respondWithResult(_0x267be7,null))[_0x48f2('0x4d')](handleError(_0x267be7,null));}; \ No newline at end of file +var _0x0ca1=['set','Content-Range','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','WhatsappQueue','fields','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','WhatsappQueueId','UserId','agent','format','%s/%s','whatsappPause','updatedAt','getTeams','addTeams','Team','User','Agents','voicePause','flatMap','each','UserWhatsappQueue','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','ids','select','field','from','team_has_whatsapp_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','redis','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','limit','count'];(function(_0x2d6d41,_0x42728d){var _0x4e36f0=function(_0x27ed30){while(--_0x27ed30){_0x2d6d41['push'](_0x2d6d41['shift']());}};_0x4e36f0(++_0x42728d);}(_0x0ca1,0x65));var _0x10ca=function(_0x14cc29,_0x18eabe){_0x14cc29=_0x14cc29-0x0;var _0x4f2cf3=_0x0ca1[_0x14cc29];return _0x4f2cf3;};'use strict';var emlformat=require(_0x10ca('0x0'));var rimraf=require(_0x10ca('0x1'));var zipdir=require(_0x10ca('0x2'));var jsonpatch=require(_0x10ca('0x3'));var rp=require(_0x10ca('0x4'));var moment=require(_0x10ca('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x10ca('0x6'));var path=require('path');var sox=require(_0x10ca('0x7'));var csv=require(_0x10ca('0x8'));var ejs=require(_0x10ca('0x9'));var fs=require('fs');var fs_extra=require(_0x10ca('0xa'));var _=require(_0x10ca('0xb'));var squel=require(_0x10ca('0xc'));var crypto=require(_0x10ca('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x10ca('0xe'));var toCsv=require(_0x10ca('0x8'));var querystring=require(_0x10ca('0xf'));var Papa=require('papaparse');var Redis=require(_0x10ca('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x10ca('0x11'));var as=require(_0x10ca('0x12'));var hardwareService=require(_0x10ca('0x13'));var logger=require('../../config/logger')(_0x10ca('0x14'));var utils=require(_0x10ca('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x10ca('0x16'));var db=require(_0x10ca('0x17'))['db'];config['redis']=_[_0x10ca('0x18')](config['redis'],{'host':_0x10ca('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x10ca('0x1a')]));require(_0x10ca('0x1b'))[_0x10ca('0x1c')](socket);function respondWithStatusCode(_0x241e32,_0x4d4449){_0x4d4449=_0x4d4449||0xcc;return function(_0x29ebcd){if(_0x29ebcd){return _0x241e32[_0x10ca('0x1d')](_0x4d4449);}return _0x241e32[_0x10ca('0x1e')](_0x4d4449)[_0x10ca('0x1f')]();};}function respondWithResult(_0x38e49e,_0x5cf328){_0x5cf328=_0x5cf328||0xc8;return function(_0x27fc78){if(_0x27fc78){return _0x38e49e[_0x10ca('0x1e')](_0x5cf328)[_0x10ca('0x20')](_0x27fc78);}};}function respondWithFilteredResult(_0x509110,_0x71142a){return function(_0x2d0b1e){if(_0x2d0b1e){var _0x39f155=typeof _0x71142a[_0x10ca('0x21')]==='undefined'&&typeof _0x71142a[_0x10ca('0x22')]==='undefined';var _0x31f749=_0x2d0b1e[_0x10ca('0x23')];var _0x5a34c7=_0x39f155?0x0:_0x71142a[_0x10ca('0x21')];var _0x383c06=_0x39f155?_0x2d0b1e[_0x10ca('0x23')]:_0x71142a[_0x10ca('0x21')]+_0x71142a['limit'];var _0x3d0cbe;if(_0x383c06>=_0x31f749){_0x383c06=_0x31f749;_0x3d0cbe=0xc8;}else{_0x3d0cbe=0xce;}_0x509110[_0x10ca('0x1e')](_0x3d0cbe);return _0x509110[_0x10ca('0x24')](_0x10ca('0x25'),_0x5a34c7+'-'+_0x383c06+'/'+_0x31f749)[_0x10ca('0x20')](_0x2d0b1e);}return null;};}function patchUpdates(_0x443d6d){return function(_0x5731cb){try{jsonpatch['apply'](_0x5731cb,_0x443d6d,!![]);}catch(_0xe07f59){return BPromise[_0x10ca('0x26')](_0xe07f59);}return _0x5731cb[_0x10ca('0x27')]();};}function saveUpdates(_0x4f7b4a,_0x3808b5){return function(_0x112cc2){if(_0x112cc2){return _0x112cc2[_0x10ca('0x28')](_0x4f7b4a)[_0x10ca('0x29')](function(_0x191a39){return _0x191a39;});}return null;};}function removeEntity(_0x2b7e44,_0x3163e2){return function(_0xa854b){if(_0xa854b){return _0xa854b[_0x10ca('0x2a')]()[_0x10ca('0x29')](function(){var _0x276dd0=_0xa854b[_0x10ca('0x2b')]({'plain':!![]});var _0x5c7818=_0x10ca('0x2c');return db[_0x10ca('0x2d')]['destroy']({'where':{'type':_0x5c7818,'resourceId':_0x276dd0['id']}})[_0x10ca('0x29')](function(){return _0xa854b;});})[_0x10ca('0x29')](function(){_0x2b7e44[_0x10ca('0x1e')](0xcc)[_0x10ca('0x1f')]();});}};}function handleEntityNotFound(_0x51fcb2,_0x85a7d0){return function(_0x213be4){if(!_0x213be4){_0x51fcb2[_0x10ca('0x1d')](0x194);}return _0x213be4;};}function handleError(_0x5669d6,_0x262826){_0x262826=_0x262826||0x1f4;return function(_0x562c13){logger['error'](_0x562c13[_0x10ca('0x2e')]);if(_0x562c13[_0x10ca('0x2f')]){delete _0x562c13[_0x10ca('0x2f')];}_0x5669d6[_0x10ca('0x1e')](_0x262826)[_0x10ca('0x30')](_0x562c13);};}exports[_0x10ca('0x31')]=function(_0x4f5e3f,_0x59a8e4){var _0x233088={},_0x46d43f={},_0x5a7e46={'count':0x0,'rows':[]};var _0x2d5184=_[_0x10ca('0x32')](db['WhatsappQueue'][_0x10ca('0x33')],function(_0x2a89a3){return{'name':_0x2a89a3['fieldName'],'type':_0x2a89a3[_0x10ca('0x34')][_0x10ca('0x35')]};});_0x46d43f[_0x10ca('0x36')]=_['map'](_0x2d5184,_0x10ca('0x2f'));_0x46d43f[_0x10ca('0x37')]=_[_0x10ca('0x38')](_0x4f5e3f[_0x10ca('0x37')]);_0x46d43f['filters']=_[_0x10ca('0x39')](_0x46d43f[_0x10ca('0x36')],_0x46d43f[_0x10ca('0x37')]);_0x233088[_0x10ca('0x3a')]=_['intersection'](_0x46d43f[_0x10ca('0x36')],qs['fields'](_0x4f5e3f[_0x10ca('0x37')]['fields']));_0x233088[_0x10ca('0x3a')]=_0x233088[_0x10ca('0x3a')][_0x10ca('0x3b')]?_0x233088[_0x10ca('0x3a')]:_0x46d43f['model'];if(!_0x4f5e3f['query'][_0x10ca('0x3c')](_0x10ca('0x3d'))){_0x233088['limit']=qs[_0x10ca('0x22')](_0x4f5e3f['query'][_0x10ca('0x22')]);_0x233088[_0x10ca('0x21')]=qs[_0x10ca('0x21')](_0x4f5e3f['query']['offset']);}_0x233088[_0x10ca('0x3e')]=qs[_0x10ca('0x3f')](_0x4f5e3f[_0x10ca('0x37')][_0x10ca('0x3f')]);_0x233088[_0x10ca('0x40')]=qs[_0x10ca('0x41')](_[_0x10ca('0x42')](_0x4f5e3f[_0x10ca('0x37')],_0x46d43f['filters']),_0x2d5184);if(_0x4f5e3f[_0x10ca('0x37')][_0x10ca('0x43')]){_0x233088[_0x10ca('0x40')]=_[_0x10ca('0x44')](_0x233088[_0x10ca('0x40')],{'$or':_[_0x10ca('0x32')](_0x2d5184,function(_0x353e46){if(_0x353e46[_0x10ca('0x34')]!=='VIRTUAL'){var _0x1a5ed4={};_0x1a5ed4[_0x353e46[_0x10ca('0x2f')]]={'$like':'%'+_0x4f5e3f[_0x10ca('0x37')][_0x10ca('0x43')]+'%'};return _0x1a5ed4;}})});}_0x233088=_[_0x10ca('0x44')]({},_0x233088,_0x4f5e3f[_0x10ca('0x45')]);var _0x24a02d={'where':_0x233088[_0x10ca('0x40')]};return db['WhatsappQueue'][_0x10ca('0x23')](_0x24a02d)[_0x10ca('0x29')](function(_0x355c89){_0x5a7e46[_0x10ca('0x23')]=_0x355c89;if(_0x4f5e3f['query'][_0x10ca('0x46')]){_0x233088['include']=[{'all':!![]}];}return db['WhatsappQueue'][_0x10ca('0x47')](_0x233088);})[_0x10ca('0x29')](function(_0x105db5){_0x5a7e46[_0x10ca('0x48')]=_0x105db5;return _0x5a7e46;})[_0x10ca('0x29')](respondWithFilteredResult(_0x59a8e4,_0x233088))[_0x10ca('0x49')](handleError(_0x59a8e4,null));};exports[_0x10ca('0x4a')]=function(_0x2890bf,_0x5ca9bd){var _0x43e9df={'raw':!![],'where':{'id':_0x2890bf[_0x10ca('0x4b')]['id']}},_0x1524dd={};_0x1524dd[_0x10ca('0x36')]=_[_0x10ca('0x38')](db[_0x10ca('0x4c')][_0x10ca('0x33')]);_0x1524dd['query']=_['keys'](_0x2890bf['query']);_0x1524dd[_0x10ca('0x41')]=_[_0x10ca('0x39')](_0x1524dd['model'],_0x1524dd[_0x10ca('0x37')]);_0x43e9df[_0x10ca('0x3a')]=_[_0x10ca('0x39')](_0x1524dd[_0x10ca('0x36')],qs[_0x10ca('0x4d')](_0x2890bf['query'][_0x10ca('0x4d')]));_0x43e9df['attributes']=_0x43e9df[_0x10ca('0x3a')][_0x10ca('0x3b')]?_0x43e9df['attributes']:_0x1524dd[_0x10ca('0x36')];if(_0x2890bf[_0x10ca('0x37')]['includeAll']){_0x43e9df[_0x10ca('0x4e')]=[{'all':!![]}];}_0x43e9df=_[_0x10ca('0x44')]({},_0x43e9df,_0x2890bf[_0x10ca('0x45')]);return db[_0x10ca('0x4c')][_0x10ca('0x4f')](_0x43e9df)[_0x10ca('0x29')](handleEntityNotFound(_0x5ca9bd,null))[_0x10ca('0x29')](respondWithResult(_0x5ca9bd,null))['catch'](handleError(_0x5ca9bd,null));};exports[_0x10ca('0x50')]=function(_0x1dce6b,_0x1395c0){return db['WhatsappQueue']['create'](_0x1dce6b[_0x10ca('0x51')],{})['then'](function(_0x20c51f){var _0x2fe7cb=_0x1dce6b['user'][_0x10ca('0x2b')]({'plain':!![]});if(!_0x2fe7cb)throw new Error(_0x10ca('0x52'));if(_0x2fe7cb['role']==='user'){var _0xc5bacd=_0x20c51f['get']({'plain':!![]});var _0x19a156=_0x10ca('0x2c');return db[_0x10ca('0x53')][_0x10ca('0x4f')]({'where':{'name':_0x19a156,'userProfileId':_0x2fe7cb['userProfileId']},'raw':!![]})[_0x10ca('0x29')](function(_0x287f4d){if(_0x287f4d&&_0x287f4d[_0x10ca('0x54')]===0x0){return db[_0x10ca('0x2d')]['create']({'name':_0xc5bacd[_0x10ca('0x2f')],'resourceId':_0xc5bacd['id'],'type':_0x287f4d[_0x10ca('0x2f')],'sectionId':_0x287f4d['id']},{})[_0x10ca('0x29')](function(){return _0x20c51f;});}else{return _0x20c51f;}})[_0x10ca('0x49')](function(_0x30df06){logger[_0x10ca('0x55')](_0x10ca('0x56'),_0x30df06);throw _0x30df06;});}return _0x20c51f;})[_0x10ca('0x29')](respondWithResult(_0x1395c0,0xc9))[_0x10ca('0x49')](handleError(_0x1395c0,null));};exports[_0x10ca('0x28')]=function(_0x3313fe,_0x4f6531){if(_0x3313fe[_0x10ca('0x51')]['id']){delete _0x3313fe[_0x10ca('0x51')]['id'];}return db[_0x10ca('0x4c')]['find']({'where':{'id':_0x3313fe[_0x10ca('0x4b')]['id']}})[_0x10ca('0x29')](handleEntityNotFound(_0x4f6531,null))[_0x10ca('0x29')](saveUpdates(_0x3313fe[_0x10ca('0x51')],null))['then'](respondWithResult(_0x4f6531,null))[_0x10ca('0x49')](handleError(_0x4f6531,null));};exports[_0x10ca('0x2a')]=function(_0x37bad5,_0x208b3d){return db[_0x10ca('0x4c')][_0x10ca('0x4f')]({'where':{'id':_0x37bad5[_0x10ca('0x4b')]['id']}})[_0x10ca('0x29')](handleEntityNotFound(_0x208b3d,null))[_0x10ca('0x29')](removeEntity(_0x208b3d,null))['catch'](handleError(_0x208b3d,null));};exports[_0x10ca('0x57')]=function(_0xb33b1b,_0x2f0e96){return db[_0x10ca('0x4c')][_0x10ca('0x57')]()[_0x10ca('0x29')](respondWithResult(_0x2f0e96,null))[_0x10ca('0x49')](handleError(_0x2f0e96,null));};exports[_0x10ca('0x58')]=function(_0x185c25,_0x46223a,_0x26a907){var _0x4bbc4b={'raw':!![],'where':{}},_0x53ecc4={},_0x208308;return db[_0x10ca('0x4c')][_0x10ca('0x59')]({'where':{'id':_0x185c25['params']['id']}})[_0x10ca('0x29')](handleEntityNotFound(_0x46223a,null))[_0x10ca('0x29')](function(_0x56453f){if(_0x56453f){_0x208308=_0x56453f[_0x10ca('0x2b')]({'plain':!![]});_0x53ecc4[_0x10ca('0x36')]=_[_0x10ca('0x38')](db['UserWhatsappQueue'][_0x10ca('0x33')]);_0x53ecc4[_0x10ca('0x37')]=_[_0x10ca('0x38')](_0x185c25[_0x10ca('0x37')]);_0x53ecc4['filters']=_[_0x10ca('0x39')](_0x53ecc4['model'],_0x53ecc4[_0x10ca('0x37')]);_0x4bbc4b[_0x10ca('0x3a')]=_[_0x10ca('0x39')](_0x53ecc4[_0x10ca('0x36')],qs[_0x10ca('0x4d')](_0x185c25[_0x10ca('0x37')][_0x10ca('0x4d')]));_0x4bbc4b[_0x10ca('0x3a')]=_0x4bbc4b[_0x10ca('0x3a')][_0x10ca('0x3b')]?_0x4bbc4b[_0x10ca('0x3a')]:_0x53ecc4[_0x10ca('0x36')];if(!_0x185c25[_0x10ca('0x37')]['hasOwnProperty']('nolimit')){_0x4bbc4b[_0x10ca('0x22')]=qs['limit'](_0x185c25['query'][_0x10ca('0x22')]);_0x4bbc4b[_0x10ca('0x21')]=qs[_0x10ca('0x21')](_0x185c25[_0x10ca('0x37')][_0x10ca('0x21')]);}_0x4bbc4b[_0x10ca('0x3e')]=qs[_0x10ca('0x3f')](_0x185c25[_0x10ca('0x37')][_0x10ca('0x3f')]);_0x4bbc4b[_0x10ca('0x40')]=qs[_0x10ca('0x41')](_['pick'](_0x185c25[_0x10ca('0x37')],_0x53ecc4['filters']));_0x4bbc4b[_0x10ca('0x40')][_0x10ca('0x5a')]=_0x56453f['id'];if(_0x185c25[_0x10ca('0x37')][_0x10ca('0x43')]){_0x4bbc4b[_0x10ca('0x40')]=_['merge'](_0x4bbc4b[_0x10ca('0x40')],{'$or':_[_0x10ca('0x32')](_0x4bbc4b[_0x10ca('0x3a')],function(_0x959cd3){var _0x40ba46={};_0x40ba46[_0x959cd3]={'$like':'%'+_0x185c25[_0x10ca('0x37')]['filter']+'%'};return _0x40ba46;})});}_0x4bbc4b=_[_0x10ca('0x44')]({},_0x4bbc4b,_0x185c25[_0x10ca('0x45')]);return db['UserWhatsappQueue'][_0x10ca('0x47')](_0x4bbc4b);}})[_0x10ca('0x29')](function(_0x129817){if(_0x129817){return db['User']['findAndCountAll']({'where':{'id':_[_0x10ca('0x32')](_0x129817,_0x10ca('0x5b')),'role':_0x10ca('0x5c')},'attributes':['id',_0x10ca('0x2f'),'whatsappPause','updatedAt','createdAt']});}})[_0x10ca('0x29')](function(_0x551834){if(_0x551834){return{'count':_0x551834['count'],'rows':_[_0x10ca('0x32')](_0x551834[_0x10ca('0x48')],function(_0x1b9fc5){return{'membername':_0x1b9fc5['name'],'UserId':_0x1b9fc5['id'],'queue_name':_0x208308[_0x10ca('0x2f')],'WhatsappQueueId':_0x208308['id'],'interface':util[_0x10ca('0x5d')](_0x10ca('0x5e'),'SIP',_0x1b9fc5[_0x10ca('0x2f')]),'penalty':0x0,'paused':_0x1b9fc5[_0x10ca('0x5f')],'createdAt':_0x1b9fc5['createdAt'],'updatedAt':_0x1b9fc5[_0x10ca('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x10ca('0x29')](respondWithFilteredResult(_0x46223a,_0x4bbc4b))[_0x10ca('0x49')](handleError(_0x46223a,null));};exports[_0x10ca('0x61')]=function(_0x2c866e,_0x2a6ec1,_0x504f6e){var _0x22305d={};var _0x7d3a7f={};var _0x38c331;var _0x4fde95;return db[_0x10ca('0x4c')]['findOne']({'where':{'id':_0x2c866e['params']['id']}})[_0x10ca('0x29')](handleEntityNotFound(_0x2a6ec1,null))[_0x10ca('0x29')](function(_0x407fcb){if(_0x407fcb){_0x38c331=_0x407fcb;_0x7d3a7f['model']=_[_0x10ca('0x38')](db['Team'][_0x10ca('0x33')]);_0x7d3a7f[_0x10ca('0x37')]=_[_0x10ca('0x38')](_0x2c866e[_0x10ca('0x37')]);_0x7d3a7f[_0x10ca('0x41')]=_['intersection'](_0x7d3a7f[_0x10ca('0x36')],_0x7d3a7f[_0x10ca('0x37')]);_0x22305d['attributes']=_[_0x10ca('0x39')](_0x7d3a7f[_0x10ca('0x36')],qs['fields'](_0x2c866e[_0x10ca('0x37')][_0x10ca('0x4d')]));_0x22305d[_0x10ca('0x3a')]=_0x22305d['attributes'][_0x10ca('0x3b')]?_0x22305d['attributes']:_0x7d3a7f[_0x10ca('0x36')];_0x22305d['order']=qs[_0x10ca('0x3f')](_0x2c866e['query'][_0x10ca('0x3f')]);_0x22305d[_0x10ca('0x40')]=qs[_0x10ca('0x41')](_['pick'](_0x2c866e[_0x10ca('0x37')],_0x7d3a7f[_0x10ca('0x41')]));if(_0x2c866e[_0x10ca('0x37')][_0x10ca('0x43')]){_0x22305d[_0x10ca('0x40')]=_[_0x10ca('0x44')](_0x22305d['where'],{'$or':_['map'](_0x22305d[_0x10ca('0x3a')],function(_0x109ac2){var _0x1cb38a={};_0x1cb38a[_0x109ac2]={'$like':'%'+_0x2c866e[_0x10ca('0x37')]['filter']+'%'};return _0x1cb38a;})});}_0x22305d=_[_0x10ca('0x44')]({},_0x22305d,_0x2c866e['options']);return _0x38c331[_0x10ca('0x61')](_0x22305d);}})[_0x10ca('0x29')](function(_0x3bf082){if(_0x3bf082){_0x4fde95=_0x3bf082['length'];if(!_0x2c866e['query'][_0x10ca('0x3c')](_0x10ca('0x3d'))){_0x22305d['limit']=qs[_0x10ca('0x22')](_0x2c866e[_0x10ca('0x37')][_0x10ca('0x22')]);_0x22305d['offset']=qs[_0x10ca('0x21')](_0x2c866e[_0x10ca('0x37')][_0x10ca('0x21')]);}return _0x38c331[_0x10ca('0x61')](_0x22305d);}})['then'](function(_0x4354c7){if(_0x4354c7){return _0x4354c7?{'count':_0x4fde95,'rows':_0x4354c7}:null;}})[_0x10ca('0x29')](respondWithResult(_0x2a6ec1,null))[_0x10ca('0x49')](handleError(_0x2a6ec1,null));};exports[_0x10ca('0x62')]=function(_0x14b1bd,_0x5a77a1,_0x1b63e1){var _0x2e9c93=_0x14b1bd['body']['ids'];return db[_0x10ca('0x63')][_0x10ca('0x47')]({'where':{'id':_0x2e9c93},'attributes':['id'],'include':[{'model':db[_0x10ca('0x64')],'as':_0x10ca('0x65'),'attributes':['id',_0x10ca('0x2f'),'online',_0x10ca('0x66'),'interface'],'raw':!![]}]})[_0x10ca('0x29')](function(_0x2e245c){if(_0x2e245c){var _0x577cf9=_[_0x10ca('0x67')](_0x2e245c,function(_0x3bc868){var _0xfed0eb=_0x3bc868['get']({'plain':!![]});return _0xfed0eb[_0x10ca('0x65')];});return db['WhatsappQueue']['find']({'where':{'id':_0x14b1bd[_0x10ca('0x4b')]['id']}})['then'](function(_0x268a0a){return db['sequelize']['transaction'](function(_0xf1db29){return _0x268a0a['addTeams'](_0x2e9c93,{'transaction':_0xf1db29})['then'](function(){return BPromise[_0x10ca('0x68')](_0x577cf9,function(_0x245627){return db[_0x10ca('0x69')][_0x10ca('0x6a')]({'where':{'UserId':_0x245627['id'],'WhatsappQueueId':_0x14b1bd[_0x10ca('0x4b')]['id']},'transaction':_0xf1db29});});})['then'](function(){_0x577cf9[_0x10ca('0x6b')](function(_0xd6baa3){socket[_0x10ca('0x6c')](_0x10ca('0x6d'),{'UserId':_0xd6baa3['id'],'WhatsappQueueId':_0x268a0a['id']});});});});});}})['then'](respondWithStatusCode(_0x5a77a1,null))[_0x10ca('0x49')](handleError(_0x5a77a1,null));};exports[_0x10ca('0x6e')]=function(_0x590ef2,_0x190153,_0x573b5d){return db['Team'][_0x10ca('0x47')]({'where':{'id':_0x590ef2[_0x10ca('0x37')][_0x10ca('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x10ca('0x64')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x10ca('0x29')](handleEntityNotFound(_0x190153,null))[_0x10ca('0x29')](function(_0x340c5a){var _0x5366cd=_[_0x10ca('0x32')](_0x340c5a,'id');var _0x4538a1=[];var _0x355b12=[];var _0xbf764b=squel[_0x10ca('0x70')]();_0xbf764b[_0x10ca('0x71')]('tq.TeamId')[_0x10ca('0x72')](_0x10ca('0x73'),'tq')[_0x10ca('0x74')](_0x10ca('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x10ca('0x40')]('WhatsappQueueId\x20=\x20?',_0x590ef2['params']['id']);for(var _0x49d57c=0x0;_0x49d57c<_0x340c5a[_0x10ca('0x3b')];_0x49d57c+=0x1){let _0x47895d=_0x340c5a[_0x49d57c];for(var _0x1b7a01=0x0;_0x1b7a01<_0x47895d[_0x10ca('0x65')][_0x10ca('0x3b')];_0x1b7a01+=0x1){let _0x1ff0be=_0x47895d[_0x10ca('0x65')][_0x1b7a01];var _0x24bb45=_0xbf764b[_0x10ca('0x76')]();_0x24bb45[_0x10ca('0x40')](_0x10ca('0x77'),_0x1ff0be['id']);_0x355b12[_0x10ca('0x78')](db[_0x10ca('0x79')][_0x10ca('0x37')](_0x24bb45[_0x10ca('0x7a')](),{'type':db[_0x10ca('0x79')][_0x10ca('0x7b')][_0x10ca('0x7c')]})['then'](function(_0x2073b7){if(_0x2073b7[_0x10ca('0x3b')]===0x1){return _0x1ff0be['id'];}else{var _0x197b5b=_[_0x10ca('0x7d')](_[_0x10ca('0x32')](_0x2073b7,_0x10ca('0x7e')),function(_0x39038e){return _['includes'](_0x5366cd,_0x39038e);});if(_0x197b5b){return _0x1ff0be['id'];}}}));}}return BPromise[_0x10ca('0x7f')](_0x355b12)['then'](function(_0x2f4426){_0x4538a1=_(_0x4538a1)[_0x10ca('0x80')](_0x2f4426)[_0x10ca('0x81')]()[_0x10ca('0x82')]();return db['WhatsappQueue'][_0x10ca('0x4f')]({'where':{'id':_0x590ef2[_0x10ca('0x4b')]['id']}})[_0x10ca('0x29')](function(_0x85cb6c){return db[_0x10ca('0x79')]['transaction'](function(_0x552230){return _0x85cb6c[_0x10ca('0x6e')](_0x590ef2['query'][_0x10ca('0x6f')],{'transaction':_0x552230})['then'](function(){if(!_[_0x10ca('0x83')](_0x4538a1)){return _0x85cb6c[_0x10ca('0x84')](_0x4538a1,{'transaction':_0x552230});}})[_0x10ca('0x29')](function(){_0x4538a1[_0x10ca('0x6b')](function(_0x5e1a00){socket[_0x10ca('0x6c')](_0x10ca('0x85'),{'UserId':_0x5e1a00,'WhatsappQueueId':_0x85cb6c['id']});});});});});});})[_0x10ca('0x29')](respondWithStatusCode(_0x190153,null))[_0x10ca('0x49')](handleError(_0x190153,null));};exports[_0x10ca('0x86')]=function(_0x1346a6,_0x19d067,_0x96e979){return db[_0x10ca('0x4c')][_0x10ca('0x4f')]({'where':{'id':_0x1346a6['params']['id']}})[_0x10ca('0x29')](handleEntityNotFound(_0x19d067,null))['then'](function(_0x4745b4){if(_0x4745b4){return _0x4745b4[_0x10ca('0x86')](_0x1346a6['body'][_0x10ca('0x6f')],_['omit'](_0x1346a6[_0x10ca('0x51')],[_0x10ca('0x6f'),'id'])||{})['spread'](function(_0x4a5e70){for(var _0x236357=0x0;_0x236357<_0x1346a6[_0x10ca('0x51')][_0x10ca('0x6f')][_0x10ca('0x3b')];_0x236357+=0x1){socket[_0x10ca('0x6c')](_0x10ca('0x6d'),{'UserId':Number(_0x1346a6['body'][_0x10ca('0x6f')][_0x236357]),'WhatsappQueueId':Number(_0x1346a6[_0x10ca('0x4b')]['id'])});}return _0x4a5e70;});}})[_0x10ca('0x29')](respondWithResult(_0x19d067,null))[_0x10ca('0x49')](handleError(_0x19d067,null));};exports[_0x10ca('0x84')]=function(_0x2a6a6c,_0x45572e,_0xeb498b){return db[_0x10ca('0x4c')][_0x10ca('0x4f')]({'where':{'id':_0x2a6a6c[_0x10ca('0x4b')]['id']}})[_0x10ca('0x29')](handleEntityNotFound(_0x45572e,null))['then'](function(_0x3a0d44){if(_0x3a0d44){return _0x3a0d44['removeAgents'](_0x2a6a6c['query'][_0x10ca('0x6f')])[_0x10ca('0x29')](function(){if(_[_0x10ca('0x87')](_0x2a6a6c[_0x10ca('0x37')]['ids'])){for(var _0x25c49f=0x0;_0x25c49f<_0x2a6a6c[_0x10ca('0x37')][_0x10ca('0x6f')][_0x10ca('0x3b')];_0x25c49f+=0x1){socket['emit'](_0x10ca('0x85'),{'UserId':Number(_0x2a6a6c['query'][_0x10ca('0x6f')][_0x25c49f]),'WhatsappQueueId':Number(_0x2a6a6c[_0x10ca('0x4b')]['id'])});}}else{socket['emit'](_0x10ca('0x85'),{'UserId':Number(_0x2a6a6c[_0x10ca('0x37')][_0x10ca('0x6f')]),'WhatsappQueueId':Number(_0x2a6a6c[_0x10ca('0x4b')]['id'])});}});}})[_0x10ca('0x29')](respondWithStatusCode(_0x45572e,null))['catch'](handleError(_0x45572e,null));};exports['getAgents']=function(_0x23f179,_0x29601f,_0x1be80f){var _0x5db6fc={};var _0x9a0ad2={};var _0x427a73;var _0x2a7fbb;return db['WhatsappQueue'][_0x10ca('0x59')]({'where':{'id':_0x23f179[_0x10ca('0x4b')]['id']}})['then'](handleEntityNotFound(_0x29601f,null))[_0x10ca('0x29')](function(_0x563e9f){if(_0x563e9f){_0x427a73=_0x563e9f;_0x9a0ad2[_0x10ca('0x36')]=_[_0x10ca('0x38')](db[_0x10ca('0x64')][_0x10ca('0x33')]);_0x9a0ad2[_0x10ca('0x37')]=_['keys'](_0x23f179['query']);_0x9a0ad2[_0x10ca('0x41')]=_['intersection'](_0x9a0ad2[_0x10ca('0x36')],_0x9a0ad2[_0x10ca('0x37')]);_0x5db6fc[_0x10ca('0x3a')]=_[_0x10ca('0x39')](_0x9a0ad2[_0x10ca('0x36')],qs[_0x10ca('0x4d')](_0x23f179[_0x10ca('0x37')][_0x10ca('0x4d')]));_0x5db6fc[_0x10ca('0x3a')]=_0x5db6fc[_0x10ca('0x3a')][_0x10ca('0x3b')]?_0x5db6fc['attributes']:_0x9a0ad2['model'];_0x5db6fc[_0x10ca('0x3e')]=qs[_0x10ca('0x3f')](_0x23f179[_0x10ca('0x37')][_0x10ca('0x3f')]);_0x5db6fc[_0x10ca('0x40')]=qs[_0x10ca('0x41')](_[_0x10ca('0x42')](_0x23f179[_0x10ca('0x37')],_0x9a0ad2[_0x10ca('0x41')]));if(_0x23f179[_0x10ca('0x37')][_0x10ca('0x43')]){_0x5db6fc[_0x10ca('0x40')]=_[_0x10ca('0x44')](_0x5db6fc[_0x10ca('0x40')],{'$or':_['map'](_0x5db6fc[_0x10ca('0x3a')],function(_0x40f38c){var _0x3a2df8={};_0x3a2df8[_0x40f38c]={'$like':'%'+_0x23f179[_0x10ca('0x37')][_0x10ca('0x43')]+'%'};return _0x3a2df8;})});}_0x5db6fc=_['merge']({},_0x5db6fc,_0x23f179[_0x10ca('0x45')]);return _0x427a73['getAgents'](_0x5db6fc);}})[_0x10ca('0x29')](function(_0x3876b5){if(_0x3876b5){_0x2a7fbb=_0x3876b5[_0x10ca('0x3b')];if(!_0x23f179['query'][_0x10ca('0x3c')](_0x10ca('0x3d'))){_0x5db6fc[_0x10ca('0x22')]=qs[_0x10ca('0x22')](_0x23f179[_0x10ca('0x37')][_0x10ca('0x22')]);_0x5db6fc[_0x10ca('0x21')]=qs[_0x10ca('0x21')](_0x23f179[_0x10ca('0x37')][_0x10ca('0x21')]);}return _0x427a73[_0x10ca('0x88')](_0x5db6fc);}})[_0x10ca('0x29')](function(_0x3d4ffe){if(_0x3d4ffe){return _0x3d4ffe?{'count':_0x2a7fbb,'rows':_0x3d4ffe}:null;}})[_0x10ca('0x29')](respondWithResult(_0x29601f,null))[_0x10ca('0x49')](handleError(_0x29601f,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 7270eb7..897ce09 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 _0x4f81=['events','../../mysqldb','WhatsappQueue','setMaxListeners','update','remove','emit','exports'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x4f81,0x88));var _0x14f8=function(_0x58fe25,_0x39c5b5){_0x58fe25=_0x58fe25-0x0;var _0x1f53cb=_0x4f81[_0x58fe25];return _0x1f53cb;};'use strict';var EventEmitter=require(_0x14f8('0x0'));var WhatsappQueue=require(_0x14f8('0x1'))['db'][_0x14f8('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x14f8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x14f8('0x4'),'afterDestroy':_0x14f8('0x5')};function emitEvent(_0x5e7535){return function(_0x15af8d,_0x8baa8d,_0x227eed){WhatsappQueueEvents[_0x14f8('0x6')](_0x5e7535+':'+_0x15af8d['id'],_0x15af8d);WhatsappQueueEvents[_0x14f8('0x6')](_0x5e7535,_0x15af8d);_0x227eed(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x14f8('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0x16a4=['save','remove','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3e9499,_0x24e13d){var _0x40a138=function(_0x54292d){while(--_0x54292d){_0x3e9499['push'](_0x3e9499['shift']());}};_0x40a138(++_0x24e13d);}(_0x16a4,0x186));var _0x416a=function(_0x3aef50,_0x8914d){_0x3aef50=_0x3aef50-0x0;var _0xfa6cc7=_0x16a4[_0x3aef50];return _0xfa6cc7;};'use strict';var EventEmitter=require(_0x416a('0x0'));var WhatsappQueue=require(_0x416a('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x416a('0x2'),'afterUpdate':'update','afterDestroy':_0x416a('0x3')};function emitEvent(_0x7f369f){return function(_0x47cb4e,_0x11c705,_0x43ab20){WhatsappQueueEvents['emit'](_0x7f369f+':'+_0x47cb4e['id'],_0x47cb4e);WhatsappQueueEvents['emit'](_0x7f369f,_0x47cb4e);_0x43ab20(null);};}for(var e in events){if(events[_0x416a('0x4')](e)){var event=events[e];WhatsappQueue[_0x416a('0x5')](e,emitEvent(event));}}module[_0x416a('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 e7d03d5..818a73d 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 _0x047d=['moment','bluebird','request-promise','path','../../config/environment','./whatsappQueue.attributes','exports','define','whatsapp_queues','lodash','util','../../config/logger','api'];(function(_0x3f1cba,_0x1a890c){var _0x430ab2=function(_0x4bf586){while(--_0x4bf586){_0x3f1cba['push'](_0x3f1cba['shift']());}};_0x430ab2(++_0x1a890c);}(_0x047d,0x175));var _0xd047=function(_0x242674,_0x3be9e5){_0x242674=_0x242674-0x0;var _0x86ce64=_0x047d[_0x242674];return _0x86ce64;};'use strict';var _=require(_0xd047('0x0'));var util=require(_0xd047('0x1'));var logger=require(_0xd047('0x2'))(_0xd047('0x3'));var moment=require(_0xd047('0x4'));var BPromise=require(_0xd047('0x5'));var rp=require(_0xd047('0x6'));var fs=require('fs');var path=require(_0xd047('0x7'));var rimraf=require('rimraf');var config=require(_0xd047('0x8'));var attributes=require(_0xd047('0x9'));module[_0xd047('0xa')]=function(_0x584b18,_0x5e2cfc){return _0x584b18[_0xd047('0xb')]('WhatsappQueue',attributes,{'tableName':_0xd047('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x403a=['bluebird','request-promise','rimraf','../../config/environment','./whatsappQueue.attributes','WhatsappQueue','whatsapp_queues','util','../../config/logger','api','moment'];(function(_0x3e72da,_0x7909e3){var _0x20a27d=function(_0x2ce453){while(--_0x2ce453){_0x3e72da['push'](_0x3e72da['shift']());}};_0x20a27d(++_0x7909e3);}(_0x403a,0xc2));var _0xa403=function(_0x1a014b,_0x48acae){_0x1a014b=_0x1a014b-0x0;var _0x462258=_0x403a[_0x1a014b];return _0x462258;};'use strict';var _=require('lodash');var util=require(_0xa403('0x0'));var logger=require(_0xa403('0x1'))(_0xa403('0x2'));var moment=require(_0xa403('0x3'));var BPromise=require(_0xa403('0x4'));var rp=require(_0xa403('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa403('0x6'));var config=require(_0xa403('0x7'));var attributes=require(_0xa403('0x8'));module['exports']=function(_0x2bd287,_0x472e91){return _0x2bd287['define'](_0xa403('0x9'),attributes,{'tableName':_0xa403('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 527e9d1..9a4c073 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 _0xbd5a=['message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','limit','include','model','attributes','map','ShowWhatsappQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x22f62a,_0x57f90c){var _0x1f4f66=function(_0x2c8490){while(--_0x2c8490){_0x22f62a['push'](_0x22f62a['shift']());}};_0x1f4f66(++_0x57f90c);}(_0xbd5a,0x1e9));var _0xabd5=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xbd5a[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0xabd5('0x0'));var util=require(_0xabd5('0x1'));var moment=require(_0xabd5('0x2'));var BPromise=require(_0xabd5('0x3'));var rs=require(_0xabd5('0x4'));var fs=require('fs');var Redis=require(_0xabd5('0x5'));var db=require(_0xabd5('0x6'))['db'];var utils=require(_0xabd5('0x7'));var logger=require(_0xabd5('0x8'))(_0xabd5('0x9'));var config=require(_0xabd5('0xa'));var jayson=require(_0xabd5('0xb'));var client=jayson[_0xabd5('0xc')]['http']({'port':0x232a});config[_0xabd5('0xd')]=_[_0xabd5('0xe')](config[_0xabd5('0xd')],{'host':_0xabd5('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xabd5('0xd')]));require(_0xabd5('0x10'))[_0xabd5('0x11')](socket);function respondWithRpcPromise(_0x404625,_0x555cd4,_0x48e739){return new BPromise(function(_0x2d7213,_0x2fcbda){return client[_0xabd5('0x12')](_0x404625,_0x48e739)[_0xabd5('0x13')](function(_0x3ecd3b){logger[_0xabd5('0x14')](_0xabd5('0x15'),_0x555cd4,_0xabd5('0x16'));logger[_0xabd5('0x17')](_0xabd5('0x18'),_0x555cd4,_0xabd5('0x16'),JSON[_0xabd5('0x19')](_0x3ecd3b));if(_0x3ecd3b[_0xabd5('0x1a')]){if(_0x3ecd3b[_0xabd5('0x1a')]['code']===0x1f4){logger[_0xabd5('0x1a')](_0xabd5('0x15'),_0x555cd4,_0x3ecd3b[_0xabd5('0x1a')][_0xabd5('0x1b')]);return _0x2fcbda(_0x3ecd3b[_0xabd5('0x1a')]['message']);}logger[_0xabd5('0x1a')](_0xabd5('0x15'),_0x555cd4,_0x3ecd3b[_0xabd5('0x1a')][_0xabd5('0x1b')]);return _0x2d7213(_0x3ecd3b['error'][_0xabd5('0x1b')]);}else{logger[_0xabd5('0x14')](_0xabd5('0x15'),_0x555cd4,_0xabd5('0x16'));_0x2d7213(_0x3ecd3b[_0xabd5('0x1c')][_0xabd5('0x1b')]);}})[_0xabd5('0x1d')](function(_0x12dbb8){logger[_0xabd5('0x1a')](_0xabd5('0x15'),_0x555cd4,_0x12dbb8);_0x2fcbda(_0x12dbb8);});});}exports[_0xabd5('0x1e')]=function(_0x2bd803){var _0x424c11=this;return new Promise(function(_0x365970,_0x1ee15f){return db[_0xabd5('0x1f')][_0xabd5('0x20')]({'raw':_0x2bd803[_0xabd5('0x21')]?_0x2bd803['options'][_0xabd5('0x22')]===undefined?!![]:![]:!![],'where':_0x2bd803[_0xabd5('0x21')]?_0x2bd803[_0xabd5('0x21')][_0xabd5('0x23')]||null:null,'attributes':_0x2bd803[_0xabd5('0x21')]?_0x2bd803[_0xabd5('0x21')]['attributes']||null:null,'limit':_0x2bd803[_0xabd5('0x21')]?_0x2bd803[_0xabd5('0x21')][_0xabd5('0x24')]||null:null,'include':_0x2bd803['options']?_0x2bd803[_0xabd5('0x21')]['include']?_['map'](_0x2bd803[_0xabd5('0x21')][_0xabd5('0x25')],function(_0x416757){return{'model':db[_0x416757[_0xabd5('0x26')]],'as':_0x416757['as'],'attributes':_0x416757[_0xabd5('0x27')],'include':_0x416757[_0xabd5('0x25')]?_[_0xabd5('0x28')](_0x416757[_0xabd5('0x25')],function(_0x3a591f){return{'model':db[_0x3a591f[_0xabd5('0x26')]],'as':_0x3a591f['as'],'attributes':_0x3a591f['attributes'],'include':_0x3a591f[_0xabd5('0x25')]?_[_0xabd5('0x28')](_0x3a591f['include'],function(_0xe64d84){return{'model':db[_0xe64d84[_0xabd5('0x26')]],'as':_0xe64d84['as'],'attributes':_0xe64d84[_0xabd5('0x27')]};}):[]};}):[]};}):[]:[]})[_0xabd5('0x13')](function(_0x587321){logger[_0xabd5('0x14')]('GetWhatsappQueue',_0x2bd803);logger['debug']('GetWhatsappQueue',_0x2bd803,JSON['stringify'](_0x587321));_0x365970(_0x587321);})[_0xabd5('0x1d')](function(_0x170265){logger[_0xabd5('0x1a')](_0xabd5('0x1e'),_0x170265['message'],_0x2bd803);_0x1ee15f(_0x424c11[_0xabd5('0x1a')](0x1f4,_0x170265[_0xabd5('0x1b')]));});});};exports[_0xabd5('0x29')]=function(_0x199d0a){var _0x55438f=this;return new Promise(function(_0x5db7f7,_0x23d2fe){return db[_0xabd5('0x1f')][_0xabd5('0x2a')]({'raw':_0x199d0a['options']?_0x199d0a['options'][_0xabd5('0x22')]===undefined?!![]:![]:!![],'where':_0x199d0a[_0xabd5('0x21')]?_0x199d0a['options'][_0xabd5('0x23')]||null:null,'attributes':_0x199d0a[_0xabd5('0x21')]?_0x199d0a['options'][_0xabd5('0x27')]||null:null,'include':_0x199d0a['options']?_0x199d0a[_0xabd5('0x21')][_0xabd5('0x25')]?_[_0xabd5('0x28')](_0x199d0a[_0xabd5('0x21')][_0xabd5('0x25')],function(_0x34832e){return{'model':db[_0x34832e[_0xabd5('0x26')]],'as':_0x34832e['as'],'attributes':_0x34832e[_0xabd5('0x27')],'include':_0x34832e[_0xabd5('0x25')]?_[_0xabd5('0x28')](_0x34832e[_0xabd5('0x25')],function(_0x5651a8){return{'model':db[_0x5651a8[_0xabd5('0x26')]],'as':_0x5651a8['as'],'attributes':_0x5651a8['attributes'],'include':_0x5651a8[_0xabd5('0x25')]?_[_0xabd5('0x28')](_0x5651a8['include'],function(_0x4f7a2f){return{'model':db[_0x4f7a2f['model']],'as':_0x4f7a2f['as'],'attributes':_0x4f7a2f[_0xabd5('0x27')]};}):[]};}):[]};}):[]:[]})[_0xabd5('0x13')](function(_0x2d3817){logger[_0xabd5('0x14')](_0xabd5('0x29'),_0x199d0a);logger[_0xabd5('0x17')](_0xabd5('0x29'),_0x199d0a,JSON[_0xabd5('0x19')](_0x2d3817));_0x5db7f7(_0x2d3817);})[_0xabd5('0x1d')](function(_0x14c20b){logger['error'](_0xabd5('0x29'),_0x14c20b['message'],_0x199d0a);_0x23d2fe(_0x55438f[_0xabd5('0x1a')](0x1f4,_0x14c20b[_0xabd5('0x1b')]));});});}; \ No newline at end of file +var _0x285a=['../../mysqldb','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','limit','include','map','model','attributes','catch','ShowWhatsappQueue','find','moment','ioredis'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x285a,0x1ba));var _0xa285=function(_0xdcf4dd,_0x438aab){_0xdcf4dd=_0xdcf4dd-0x0;var _0x6f0c70=_0x285a[_0xdcf4dd];return _0x6f0c70;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa285('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa285('0x1'));var db=require(_0xa285('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xa285('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa285('0x4'));var client=jayson[_0xa285('0x5')][_0xa285('0x6')]({'port':0x232a});config['redis']=_[_0xa285('0x7')](config[_0xa285('0x8')],{'host':_0xa285('0x9'),'port':0x18eb});var socket=require(_0xa285('0xa'))(new Redis(config[_0xa285('0x8')]));require('./whatsappQueue.socket')[_0xa285('0xb')](socket);function respondWithRpcPromise(_0x225c5a,_0x33a5e6,_0x457621){return new BPromise(function(_0x3541e5,_0x38455b){return client[_0xa285('0xc')](_0x225c5a,_0x457621)[_0xa285('0xd')](function(_0x5d8df4){logger[_0xa285('0xe')](_0xa285('0xf'),_0x33a5e6,_0xa285('0x10'));logger[_0xa285('0x11')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x33a5e6,_0xa285('0x10'),JSON[_0xa285('0x12')](_0x5d8df4));if(_0x5d8df4['error']){if(_0x5d8df4[_0xa285('0x13')][_0xa285('0x14')]===0x1f4){logger[_0xa285('0x13')](_0xa285('0xf'),_0x33a5e6,_0x5d8df4[_0xa285('0x13')][_0xa285('0x15')]);return _0x38455b(_0x5d8df4['error'][_0xa285('0x15')]);}logger[_0xa285('0x13')](_0xa285('0xf'),_0x33a5e6,_0x5d8df4[_0xa285('0x13')][_0xa285('0x15')]);return _0x3541e5(_0x5d8df4['error'][_0xa285('0x15')]);}else{logger[_0xa285('0xe')](_0xa285('0xf'),_0x33a5e6,_0xa285('0x10'));_0x3541e5(_0x5d8df4[_0xa285('0x16')][_0xa285('0x15')]);}})['catch'](function(_0x18cd37){logger[_0xa285('0x13')](_0xa285('0xf'),_0x33a5e6,_0x18cd37);_0x38455b(_0x18cd37);});});}exports[_0xa285('0x17')]=function(_0x511c04){var _0xe0fcb0=this;return new Promise(function(_0x350548,_0xab0ec7){return db[_0xa285('0x18')][_0xa285('0x19')]({'raw':_0x511c04[_0xa285('0x1a')]?_0x511c04[_0xa285('0x1a')][_0xa285('0x1b')]===undefined?!![]:![]:!![],'where':_0x511c04[_0xa285('0x1a')]?_0x511c04['options'][_0xa285('0x1c')]||null:null,'attributes':_0x511c04[_0xa285('0x1a')]?_0x511c04['options']['attributes']||null:null,'limit':_0x511c04[_0xa285('0x1a')]?_0x511c04[_0xa285('0x1a')][_0xa285('0x1d')]||null:null,'include':_0x511c04['options']?_0x511c04[_0xa285('0x1a')][_0xa285('0x1e')]?_[_0xa285('0x1f')](_0x511c04[_0xa285('0x1a')][_0xa285('0x1e')],function(_0x1cad96){return{'model':db[_0x1cad96[_0xa285('0x20')]],'as':_0x1cad96['as'],'attributes':_0x1cad96[_0xa285('0x21')],'include':_0x1cad96['include']?_[_0xa285('0x1f')](_0x1cad96[_0xa285('0x1e')],function(_0x20bdd8){return{'model':db[_0x20bdd8[_0xa285('0x20')]],'as':_0x20bdd8['as'],'attributes':_0x20bdd8['attributes'],'include':_0x20bdd8[_0xa285('0x1e')]?_[_0xa285('0x1f')](_0x20bdd8[_0xa285('0x1e')],function(_0x431f8e){return{'model':db[_0x431f8e['model']],'as':_0x431f8e['as'],'attributes':_0x431f8e['attributes']};}):[]};}):[]};}):[]:[]})[_0xa285('0xd')](function(_0xbf9525){logger['info'](_0xa285('0x17'),_0x511c04);logger[_0xa285('0x11')](_0xa285('0x17'),_0x511c04,JSON['stringify'](_0xbf9525));_0x350548(_0xbf9525);})[_0xa285('0x22')](function(_0x1b9397){logger[_0xa285('0x13')]('GetWhatsappQueue',_0x1b9397['message'],_0x511c04);_0xab0ec7(_0xe0fcb0[_0xa285('0x13')](0x1f4,_0x1b9397[_0xa285('0x15')]));});});};exports[_0xa285('0x23')]=function(_0xf87d7e){var _0xe53f62=this;return new Promise(function(_0x29066d,_0x119c1a){return db['WhatsappQueue'][_0xa285('0x24')]({'raw':_0xf87d7e[_0xa285('0x1a')]?_0xf87d7e[_0xa285('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xf87d7e['options']?_0xf87d7e[_0xa285('0x1a')]['where']||null:null,'attributes':_0xf87d7e['options']?_0xf87d7e[_0xa285('0x1a')][_0xa285('0x21')]||null:null,'include':_0xf87d7e[_0xa285('0x1a')]?_0xf87d7e[_0xa285('0x1a')][_0xa285('0x1e')]?_[_0xa285('0x1f')](_0xf87d7e[_0xa285('0x1a')]['include'],function(_0x19aefb){return{'model':db[_0x19aefb['model']],'as':_0x19aefb['as'],'attributes':_0x19aefb[_0xa285('0x21')],'include':_0x19aefb[_0xa285('0x1e')]?_['map'](_0x19aefb[_0xa285('0x1e')],function(_0x22ecd1){return{'model':db[_0x22ecd1[_0xa285('0x20')]],'as':_0x22ecd1['as'],'attributes':_0x22ecd1['attributes'],'include':_0x22ecd1[_0xa285('0x1e')]?_[_0xa285('0x1f')](_0x22ecd1[_0xa285('0x1e')],function(_0xfcd0b2){return{'model':db[_0xfcd0b2[_0xa285('0x20')]],'as':_0xfcd0b2['as'],'attributes':_0xfcd0b2[_0xa285('0x21')]};}):[]};}):[]};}):[]:[]})[_0xa285('0xd')](function(_0x94c430){logger[_0xa285('0xe')](_0xa285('0x23'),_0xf87d7e);logger[_0xa285('0x11')]('ShowWhatsappQueue',_0xf87d7e,JSON['stringify'](_0x94c430));_0x29066d(_0x94c430);})[_0xa285('0x22')](function(_0x1e88a1){logger[_0xa285('0x13')](_0xa285('0x23'),_0x1e88a1[_0xa285('0x15')],_0xf87d7e);_0x119c1a(_0xe53f62['error'](0x1f4,_0x1e88a1['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index f9d3e45..15cc71a 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 _0x113c=['update','emit','removeListener','length','whatsappQueue:','./whatsappQueue.events','save','remove'];(function(_0xb17bab,_0x318edc){var _0x5cb2c6=function(_0x263e1d){while(--_0x263e1d){_0xb17bab['push'](_0xb17bab['shift']());}};_0x5cb2c6(++_0x318edc);}(_0x113c,0xd5));var _0xc113=function(_0x22414d,_0x97c83){_0x22414d=_0x22414d-0x0;var _0x3de18f=_0x113c[_0x22414d];return _0x3de18f;};'use strict';var WhatsappQueueEvents=require(_0xc113('0x0'));var events=[_0xc113('0x1'),_0xc113('0x2'),_0xc113('0x3')];function createListener(_0x1ab56d,_0x23b78d){return function(_0x24c23f){_0x23b78d[_0xc113('0x4')](_0x1ab56d,_0x24c23f);};}function removeListener(_0x5d668e,_0x4ad85e){return function(){WhatsappQueueEvents[_0xc113('0x5')](_0x5d668e,_0x4ad85e);};}exports['register']=function(_0x2f6cb5){for(var _0x3ffad7=0x0,_0x1bcac8=events[_0xc113('0x6')];_0x3ffad7<_0x1bcac8;_0x3ffad7++){var _0x23522e=events[_0x3ffad7];var _0x3658bb=createListener(_0xc113('0x7')+_0x23522e,_0x2f6cb5);WhatsappQueueEvents['on'](_0x23522e,_0x3658bb);}}; \ No newline at end of file +var _0x7682=['save','remove','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events'];(function(_0x4e9a22,_0x65e645){var _0x364420=function(_0x4ecb09){while(--_0x4ecb09){_0x4e9a22['push'](_0x4e9a22['shift']());}};_0x364420(++_0x65e645);}(_0x7682,0xef));var _0x2768=function(_0x215b3a,_0x7d37cc){_0x215b3a=_0x215b3a-0x0;var _0x5fbbd=_0x7682[_0x215b3a];return _0x5fbbd;};'use strict';var WhatsappQueueEvents=require(_0x2768('0x0'));var events=[_0x2768('0x1'),_0x2768('0x2'),'update'];function createListener(_0x13427e,_0xca1302){return function(_0x2db91c){_0xca1302[_0x2768('0x3')](_0x13427e,_0x2db91c);};}function removeListener(_0x4f111d,_0x2f954b){return function(){WhatsappQueueEvents[_0x2768('0x4')](_0x4f111d,_0x2f954b);};}exports[_0x2768('0x5')]=function(_0x4b8b44){for(var _0x3f4847=0x0,_0x498a25=events[_0x2768('0x6')];_0x3f4847<_0x498a25;_0x3f4847++){var _0x21ab31=events[_0x3f4847];var _0x4426d4=createListener(_0x2768('0x7')+_0x21ab31,_0x4b8b44);WhatsappQueueEvents['on'](_0x21ab31,_0x4426d4);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index e45b035..b295b0e 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 _0xaded=['fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0xf973b7,_0x46699f){var _0x499087=function(_0x45b42f){while(--_0x45b42f){_0xf973b7['push'](_0xf973b7['shift']());}};_0x499087(++_0x46699f);}(_0xaded,0x7a));var _0xdade=function(_0x1ea894,_0x124b2f){_0x1ea894=_0x1ea894-0x0;var _0x59449f=_0xaded[_0x1ea894];return _0x59449f;};'use strict';var multer=require(_0xdade('0x0'));var util=require('util');var path=require(_0xdade('0x1'));var timeout=require(_0xdade('0x2'));var express=require(_0xdade('0x3'));var router=express['Router']();var fs_extra=require(_0xdade('0x4'));var auth=require(_0xdade('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdade('0x6'));var controller=require(_0xdade('0x7'));router[_0xdade('0x8')]('/',auth[_0xdade('0x9')](),controller[_0xdade('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xdade('0xb')]);router[_0xdade('0x8')](_0xdade('0xc'),auth[_0xdade('0x9')](),controller[_0xdade('0xd')]);router[_0xdade('0xe')]('/',auth['isAuthenticated'](),controller[_0xdade('0xf')]);router[_0xdade('0x10')](_0xdade('0xc'),auth[_0xdade('0x9')](),controller[_0xdade('0x11')]);router[_0xdade('0x12')](_0xdade('0xc'),auth[_0xdade('0x9')](),controller[_0xdade('0x13')]);module[_0xdade('0x14')]=router; \ No newline at end of file +var _0x36c5=['util','path','connect-timeout','fs-extra','../../config/environment','./whatsappQueueReport.controller','get','index','/describe','describe','/:id','isAuthenticated','create','put','destroy','multer'];(function(_0x19f695,_0x10e171){var _0x4307d0=function(_0x412dce){while(--_0x412dce){_0x19f695['push'](_0x19f695['shift']());}};_0x4307d0(++_0x10e171);}(_0x36c5,0xcf));var _0x536c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36c5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x536c('0x0'));var util=require(_0x536c('0x1'));var path=require(_0x536c('0x2'));var timeout=require(_0x536c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x536c('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x536c('0x5'));var controller=require(_0x536c('0x6'));router[_0x536c('0x7')]('/',auth['isAuthenticated'](),controller[_0x536c('0x8')]);router['get'](_0x536c('0x9'),auth['isAuthenticated'](),controller[_0x536c('0xa')]);router[_0x536c('0x7')](_0x536c('0xb'),auth[_0x536c('0xc')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x536c('0xd')]);router[_0x536c('0xe')]('/:id',auth[_0x536c('0xc')](),controller['update']);router['delete']('/:id',auth[_0x536c('0xc')](),controller[_0x536c('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 3bbd80f..36135ce 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(_0x10d4c2,_0x193f61){var _0x28b780=function(_0x22a6b9){while(--_0x22a6b9){_0x10d4c2['push'](_0x10d4c2['shift']());}};_0x28b780(++_0x193f61);}(_0x7a54,0x106));var _0x47a5=function(_0x4d4940,_0x3dd69d){_0x4d4940=_0x4d4940-0x0;var _0x42f795=_0x7a54[_0x4d4940];return _0x42f795;};'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 _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x3a3cf7,_0x2a3dbc){var _0x426054=function(_0x3e5e70){while(--_0x3e5e70){_0x3a3cf7['push'](_0x3a3cf7['shift']());}};_0x426054(++_0x2a3dbc);}(_0x7a54,0x106));var _0x47a5=function(_0xc3cf,_0x451b6e){_0xc3cf=_0xc3cf-0x0;var _0x33af03=_0x7a54[_0xc3cf];return _0x33af03;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index feca93e..05ddb41 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 _0xae60=['../../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','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','index','WhatsappQueueReport','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x5d8e02,_0x468242){var _0x22bf80=function(_0x295abb){while(--_0x295abb){_0x5d8e02['push'](_0x5d8e02['shift']());}};_0x22bf80(++_0x468242);}(_0xae60,0x1c7));var _0x0ae6=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0xae60[_0x476bf4];return _0x788ffe;};'use strict';var emlformat=require(_0x0ae6('0x0'));var rimraf=require(_0x0ae6('0x1'));var zipdir=require(_0x0ae6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ae6('0x3'));var moment=require(_0x0ae6('0x4'));var BPromise=require(_0x0ae6('0x5'));var Mustache=require('mustache');var util=require(_0x0ae6('0x6'));var path=require(_0x0ae6('0x7'));var sox=require('sox');var csv=require(_0x0ae6('0x8'));var ejs=require(_0x0ae6('0x9'));var fs=require('fs');var fs_extra=require(_0x0ae6('0xa'));var _=require(_0x0ae6('0xb'));var squel=require(_0x0ae6('0xc'));var crypto=require(_0x0ae6('0xd'));var jsforce=require(_0x0ae6('0xe'));var deskjs=require(_0x0ae6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0ae6('0x10'));var Papa=require(_0x0ae6('0x11'));var Redis=require(_0x0ae6('0x12'));var authService=require(_0x0ae6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0ae6('0x14'));var hardwareService=require(_0x0ae6('0x15'));var logger=require(_0x0ae6('0x16'))(_0x0ae6('0x17'));var utils=require(_0x0ae6('0x18'));var config=require(_0x0ae6('0x19'));var licenseUtil=require(_0x0ae6('0x1a'));var db=require(_0x0ae6('0x1b'))['db'];function respondWithStatusCode(_0x3b05a4,_0x30f8f9){_0x30f8f9=_0x30f8f9||0xcc;return function(_0x1aefd5){if(_0x1aefd5){return _0x3b05a4[_0x0ae6('0x1c')](_0x30f8f9);}return _0x3b05a4[_0x0ae6('0x1d')](_0x30f8f9)[_0x0ae6('0x1e')]();};}function respondWithResult(_0x4d2da8,_0x3809c6){_0x3809c6=_0x3809c6||0xc8;return function(_0x10c3bc){if(_0x10c3bc){return _0x4d2da8[_0x0ae6('0x1d')](_0x3809c6)[_0x0ae6('0x1f')](_0x10c3bc);}};}function respondWithFilteredResult(_0xce3e23,_0x3a1e26){return function(_0x151144){if(_0x151144){var _0x3b64ac=typeof _0x3a1e26[_0x0ae6('0x20')]===_0x0ae6('0x21')&&typeof _0x3a1e26[_0x0ae6('0x22')]===_0x0ae6('0x21');var _0xa97151=_0x151144[_0x0ae6('0x23')];var _0xda4f01=_0x3b64ac?0x0:_0x3a1e26[_0x0ae6('0x20')];var _0x2fdf25=_0x3b64ac?_0x151144[_0x0ae6('0x23')]:_0x3a1e26[_0x0ae6('0x20')]+_0x3a1e26[_0x0ae6('0x22')];var _0x26b369;if(_0x2fdf25>=_0xa97151){_0x2fdf25=_0xa97151;_0x26b369=0xc8;}else{_0x26b369=0xce;}_0xce3e23[_0x0ae6('0x1d')](_0x26b369);return _0xce3e23['set'](_0x0ae6('0x24'),_0xda4f01+'-'+_0x2fdf25+'/'+_0xa97151)[_0x0ae6('0x1f')](_0x151144);}return null;};}function patchUpdates(_0x140a3b){return function(_0x1027c2){try{jsonpatch[_0x0ae6('0x25')](_0x1027c2,_0x140a3b,!![]);}catch(_0xb4e6af){return BPromise[_0x0ae6('0x26')](_0xb4e6af);}return _0x1027c2[_0x0ae6('0x27')]();};}function saveUpdates(_0x515f3d,_0x39b22e){return function(_0x2a6484){if(_0x2a6484){return _0x2a6484[_0x0ae6('0x28')](_0x515f3d)[_0x0ae6('0x29')](function(_0x31ad85){return _0x31ad85;});}return null;};}function removeEntity(_0x4eba72,_0x296a9d){return function(_0x4e1242){if(_0x4e1242){return _0x4e1242[_0x0ae6('0x2a')]()[_0x0ae6('0x29')](function(){_0x4eba72[_0x0ae6('0x1d')](0xcc)[_0x0ae6('0x1e')]();});}};}function handleEntityNotFound(_0x5b86fe,_0x3630e6){return function(_0x2dcdb7){if(!_0x2dcdb7){_0x5b86fe['sendStatus'](0x194);}return _0x2dcdb7;};}function handleError(_0x55dbe1,_0x44eb95){_0x44eb95=_0x44eb95||0x1f4;return function(_0x3255a7){logger[_0x0ae6('0x2b')](_0x3255a7['stack']);if(_0x3255a7[_0x0ae6('0x2c')]){delete _0x3255a7[_0x0ae6('0x2c')];}_0x55dbe1[_0x0ae6('0x1d')](_0x44eb95)['send'](_0x3255a7);};}exports[_0x0ae6('0x2d')]=function(_0x29fef3,_0x449c33){var _0x232fbd={},_0x14eed5={},_0x257af5={'count':0x0,'rows':[]};var _0x4fc7bd=_['map'](db[_0x0ae6('0x2e')][_0x0ae6('0x2f')],function(_0x4e6df8){return{'name':_0x4e6df8['fieldName'],'type':_0x4e6df8[_0x0ae6('0x30')][_0x0ae6('0x31')]};});_0x14eed5[_0x0ae6('0x32')]=_[_0x0ae6('0x33')](_0x4fc7bd,'name');_0x14eed5[_0x0ae6('0x34')]=_[_0x0ae6('0x35')](_0x29fef3[_0x0ae6('0x34')]);_0x14eed5['filters']=_[_0x0ae6('0x36')](_0x14eed5[_0x0ae6('0x32')],_0x14eed5[_0x0ae6('0x34')]);_0x232fbd[_0x0ae6('0x37')]=_[_0x0ae6('0x36')](_0x14eed5[_0x0ae6('0x32')],qs[_0x0ae6('0x38')](_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x38')]));_0x232fbd[_0x0ae6('0x37')]=_0x232fbd['attributes'][_0x0ae6('0x39')]?_0x232fbd[_0x0ae6('0x37')]:_0x14eed5['model'];if(!_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x3a')](_0x0ae6('0x3b'))){_0x232fbd['limit']=qs[_0x0ae6('0x22')](_0x29fef3['query']['limit']);_0x232fbd[_0x0ae6('0x20')]=qs[_0x0ae6('0x20')](_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x20')]);}_0x232fbd[_0x0ae6('0x3c')]=qs['sort'](_0x29fef3['query'][_0x0ae6('0x3d')]);_0x232fbd['where']=qs[_0x0ae6('0x3e')](_['pick'](_0x29fef3[_0x0ae6('0x34')],_0x14eed5['filters']),_0x4fc7bd);if(_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x3f')]){_0x232fbd[_0x0ae6('0x40')]=_[_0x0ae6('0x41')](_0x232fbd['where'],{'$or':_['map'](_0x4fc7bd,function(_0x43414c){if(_0x43414c[_0x0ae6('0x30')]!==_0x0ae6('0x42')){var _0x59480a={};_0x59480a[_0x43414c[_0x0ae6('0x2c')]]={'$like':'%'+_0x29fef3['query'][_0x0ae6('0x3f')]+'%'};return _0x59480a;}})});}_0x232fbd=_[_0x0ae6('0x41')]({},_0x232fbd,_0x29fef3[_0x0ae6('0x43')]);var _0x19403c={'where':_0x232fbd[_0x0ae6('0x40')]};return db[_0x0ae6('0x2e')]['count'](_0x19403c)[_0x0ae6('0x29')](function(_0x601ef9){_0x257af5[_0x0ae6('0x23')]=_0x601ef9;if(_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x44')]){_0x232fbd[_0x0ae6('0x45')]=[{'all':!![]}];}return db[_0x0ae6('0x2e')][_0x0ae6('0x46')](_0x232fbd);})['then'](function(_0x38faeb){_0x257af5[_0x0ae6('0x47')]=_0x38faeb;return _0x257af5;})[_0x0ae6('0x29')](respondWithFilteredResult(_0x449c33,_0x232fbd))[_0x0ae6('0x48')](handleError(_0x449c33,null));};exports[_0x0ae6('0x49')]=function(_0x167ed1,_0x24c021){var _0x21431e={'raw':!![],'where':{'id':_0x167ed1[_0x0ae6('0x4a')]['id']}},_0xb38cbb={};_0xb38cbb[_0x0ae6('0x32')]=_[_0x0ae6('0x35')](db[_0x0ae6('0x2e')][_0x0ae6('0x2f')]);_0xb38cbb[_0x0ae6('0x34')]=_[_0x0ae6('0x35')](_0x167ed1[_0x0ae6('0x34')]);_0xb38cbb[_0x0ae6('0x3e')]=_['intersection'](_0xb38cbb[_0x0ae6('0x32')],_0xb38cbb[_0x0ae6('0x34')]);_0x21431e[_0x0ae6('0x37')]=_[_0x0ae6('0x36')](_0xb38cbb[_0x0ae6('0x32')],qs[_0x0ae6('0x38')](_0x167ed1['query'][_0x0ae6('0x38')]));_0x21431e[_0x0ae6('0x37')]=_0x21431e[_0x0ae6('0x37')][_0x0ae6('0x39')]?_0x21431e['attributes']:_0xb38cbb['model'];if(_0x167ed1['query'][_0x0ae6('0x44')]){_0x21431e[_0x0ae6('0x45')]=[{'all':!![]}];}_0x21431e=_[_0x0ae6('0x41')]({},_0x21431e,_0x167ed1['options']);return db[_0x0ae6('0x2e')][_0x0ae6('0x4b')](_0x21431e)['then'](handleEntityNotFound(_0x24c021,null))[_0x0ae6('0x29')](respondWithResult(_0x24c021,null))[_0x0ae6('0x48')](handleError(_0x24c021,null));};exports['create']=function(_0x354efd,_0x3d1e75){return db['WhatsappQueueReport'][_0x0ae6('0x4c')](_0x354efd[_0x0ae6('0x4d')],{})[_0x0ae6('0x29')](respondWithResult(_0x3d1e75,0xc9))['catch'](handleError(_0x3d1e75,null));};exports[_0x0ae6('0x28')]=function(_0x21de54,_0x46075a){if(_0x21de54[_0x0ae6('0x4d')]['id']){delete _0x21de54[_0x0ae6('0x4d')]['id'];}return db[_0x0ae6('0x2e')][_0x0ae6('0x4b')]({'where':{'id':_0x21de54['params']['id']}})['then'](handleEntityNotFound(_0x46075a,null))[_0x0ae6('0x29')](saveUpdates(_0x21de54[_0x0ae6('0x4d')],null))[_0x0ae6('0x29')](respondWithResult(_0x46075a,null))['catch'](handleError(_0x46075a,null));};exports[_0x0ae6('0x2a')]=function(_0x51df5c,_0x582a5e){return db[_0x0ae6('0x2e')][_0x0ae6('0x4b')]({'where':{'id':_0x51df5c[_0x0ae6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x582a5e,null))[_0x0ae6('0x29')](removeEntity(_0x582a5e,null))[_0x0ae6('0x48')](handleError(_0x582a5e,null));};exports[_0x0ae6('0x4e')]=function(_0x327b55,_0x173acd){return db[_0x0ae6('0x2e')][_0x0ae6('0x4e')]()[_0x0ae6('0x29')](respondWithResult(_0x173acd,null))[_0x0ae6('0x48')](handleError(_0x173acd,null));}; \ No newline at end of file +var _0xd914=['util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','options','WhatsappQueueReport','include','rows','catch','show','params','keys','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x174a2f,_0x34a39c){var _0xec53c1=function(_0x3e67d0){while(--_0x3e67d0){_0x174a2f['push'](_0x174a2f['shift']());}};_0xec53c1(++_0x34a39c);}(_0xd914,0x17f));var _0x4d91=function(_0xacb1e2,_0x55e0ab){_0xacb1e2=_0xacb1e2-0x0;var _0x463815=_0xd914[_0xacb1e2];return _0x463815;};'use strict';var emlformat=require(_0x4d91('0x0'));var rimraf=require(_0x4d91('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d91('0x2'));var rp=require(_0x4d91('0x3'));var moment=require(_0x4d91('0x4'));var BPromise=require(_0x4d91('0x5'));var Mustache=require(_0x4d91('0x6'));var util=require(_0x4d91('0x7'));var path=require('path');var sox=require(_0x4d91('0x8'));var csv=require('to-csv');var ejs=require(_0x4d91('0x9'));var fs=require('fs');var fs_extra=require(_0x4d91('0xa'));var _=require(_0x4d91('0xb'));var squel=require(_0x4d91('0xc'));var crypto=require(_0x4d91('0xd'));var jsforce=require(_0x4d91('0xe'));var deskjs=require(_0x4d91('0xf'));var toCsv=require(_0x4d91('0x10'));var querystring=require('querystring');var Papa=require(_0x4d91('0x11'));var Redis=require(_0x4d91('0x12'));var authService=require(_0x4d91('0x13'));var qs=require(_0x4d91('0x14'));var as=require(_0x4d91('0x15'));var hardwareService=require(_0x4d91('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x4d91('0x17'));var config=require(_0x4d91('0x18'));var licenseUtil=require(_0x4d91('0x19'));var db=require(_0x4d91('0x1a'))['db'];function respondWithStatusCode(_0x1c15b7,_0x318e0c){_0x318e0c=_0x318e0c||0xcc;return function(_0x4ea591){if(_0x4ea591){return _0x1c15b7['sendStatus'](_0x318e0c);}return _0x1c15b7[_0x4d91('0x1b')](_0x318e0c)[_0x4d91('0x1c')]();};}function respondWithResult(_0xb6590d,_0x3c9fd6){_0x3c9fd6=_0x3c9fd6||0xc8;return function(_0x33fbd4){if(_0x33fbd4){return _0xb6590d[_0x4d91('0x1b')](_0x3c9fd6)[_0x4d91('0x1d')](_0x33fbd4);}};}function respondWithFilteredResult(_0x4f5aef,_0x3a8ec9){return function(_0x42631a){if(_0x42631a){var _0x1e2ef7=typeof _0x3a8ec9[_0x4d91('0x1e')]===_0x4d91('0x1f')&&typeof _0x3a8ec9['limit']===_0x4d91('0x1f');var _0xb75abf=_0x42631a[_0x4d91('0x20')];var _0x44b9a7=_0x1e2ef7?0x0:_0x3a8ec9['offset'];var _0x350e23=_0x1e2ef7?_0x42631a[_0x4d91('0x20')]:_0x3a8ec9[_0x4d91('0x1e')]+_0x3a8ec9['limit'];var _0x13ef2c;if(_0x350e23>=_0xb75abf){_0x350e23=_0xb75abf;_0x13ef2c=0xc8;}else{_0x13ef2c=0xce;}_0x4f5aef[_0x4d91('0x1b')](_0x13ef2c);return _0x4f5aef[_0x4d91('0x21')](_0x4d91('0x22'),_0x44b9a7+'-'+_0x350e23+'/'+_0xb75abf)[_0x4d91('0x1d')](_0x42631a);}return null;};}function patchUpdates(_0x40cde4){return function(_0xc1d44f){try{jsonpatch[_0x4d91('0x23')](_0xc1d44f,_0x40cde4,!![]);}catch(_0x30d911){return BPromise[_0x4d91('0x24')](_0x30d911);}return _0xc1d44f['save']();};}function saveUpdates(_0x4493da,_0x5f5236){return function(_0x57913e){if(_0x57913e){return _0x57913e[_0x4d91('0x25')](_0x4493da)[_0x4d91('0x26')](function(_0x341d18){return _0x341d18;});}return null;};}function removeEntity(_0x9cb864,_0x7d8cbf){return function(_0x12b722){if(_0x12b722){return _0x12b722[_0x4d91('0x27')]()[_0x4d91('0x26')](function(){_0x9cb864['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ee6b3,_0x112923){return function(_0x3bed98){if(!_0x3bed98){_0x1ee6b3[_0x4d91('0x28')](0x194);}return _0x3bed98;};}function handleError(_0x472f3a,_0x2c7d7a){_0x2c7d7a=_0x2c7d7a||0x1f4;return function(_0x14bdb4){logger['error'](_0x14bdb4[_0x4d91('0x29')]);if(_0x14bdb4[_0x4d91('0x2a')]){delete _0x14bdb4[_0x4d91('0x2a')];}_0x472f3a['status'](_0x2c7d7a)['send'](_0x14bdb4);};}exports[_0x4d91('0x2b')]=function(_0x470079,_0x5ed948){var _0x50fe76={},_0x42d5a0={},_0x2d6981={'count':0x0,'rows':[]};var _0x43371e=_[_0x4d91('0x2c')](db['WhatsappQueueReport'][_0x4d91('0x2d')],function(_0x31bbf8){return{'name':_0x31bbf8[_0x4d91('0x2e')],'type':_0x31bbf8[_0x4d91('0x2f')][_0x4d91('0x30')]};});_0x42d5a0[_0x4d91('0x31')]=_[_0x4d91('0x2c')](_0x43371e,'name');_0x42d5a0[_0x4d91('0x32')]=_['keys'](_0x470079['query']);_0x42d5a0[_0x4d91('0x33')]=_[_0x4d91('0x34')](_0x42d5a0['model'],_0x42d5a0[_0x4d91('0x32')]);_0x50fe76[_0x4d91('0x35')]=_[_0x4d91('0x34')](_0x42d5a0[_0x4d91('0x31')],qs[_0x4d91('0x36')](_0x470079['query'][_0x4d91('0x36')]));_0x50fe76[_0x4d91('0x35')]=_0x50fe76[_0x4d91('0x35')][_0x4d91('0x37')]?_0x50fe76[_0x4d91('0x35')]:_0x42d5a0[_0x4d91('0x31')];if(!_0x470079['query'][_0x4d91('0x38')](_0x4d91('0x39'))){_0x50fe76['limit']=qs[_0x4d91('0x3a')](_0x470079[_0x4d91('0x32')][_0x4d91('0x3a')]);_0x50fe76['offset']=qs[_0x4d91('0x1e')](_0x470079[_0x4d91('0x32')][_0x4d91('0x1e')]);}_0x50fe76[_0x4d91('0x3b')]=qs['sort'](_0x470079[_0x4d91('0x32')][_0x4d91('0x3c')]);_0x50fe76[_0x4d91('0x3d')]=qs[_0x4d91('0x33')](_['pick'](_0x470079['query'],_0x42d5a0[_0x4d91('0x33')]),_0x43371e);if(_0x470079[_0x4d91('0x32')]['filter']){_0x50fe76[_0x4d91('0x3d')]=_[_0x4d91('0x3e')](_0x50fe76[_0x4d91('0x3d')],{'$or':_[_0x4d91('0x2c')](_0x43371e,function(_0x5d93c1){if(_0x5d93c1[_0x4d91('0x2f')]!==_0x4d91('0x3f')){var _0x571a0c={};_0x571a0c[_0x5d93c1[_0x4d91('0x2a')]]={'$like':'%'+_0x470079['query'][_0x4d91('0x40')]+'%'};return _0x571a0c;}})});}_0x50fe76=_['merge']({},_0x50fe76,_0x470079[_0x4d91('0x41')]);var _0x49742b={'where':_0x50fe76[_0x4d91('0x3d')]};return db[_0x4d91('0x42')][_0x4d91('0x20')](_0x49742b)[_0x4d91('0x26')](function(_0x4f6576){_0x2d6981['count']=_0x4f6576;if(_0x470079[_0x4d91('0x32')]['includeAll']){_0x50fe76[_0x4d91('0x43')]=[{'all':!![]}];}return db[_0x4d91('0x42')]['findAll'](_0x50fe76);})[_0x4d91('0x26')](function(_0x2ae356){_0x2d6981[_0x4d91('0x44')]=_0x2ae356;return _0x2d6981;})[_0x4d91('0x26')](respondWithFilteredResult(_0x5ed948,_0x50fe76))[_0x4d91('0x45')](handleError(_0x5ed948,null));};exports[_0x4d91('0x46')]=function(_0x23902f,_0x4f6254){var _0x1e4c6d={'raw':!![],'where':{'id':_0x23902f[_0x4d91('0x47')]['id']}},_0x4c70af={};_0x4c70af[_0x4d91('0x31')]=_[_0x4d91('0x48')](db[_0x4d91('0x42')][_0x4d91('0x2d')]);_0x4c70af[_0x4d91('0x32')]=_['keys'](_0x23902f['query']);_0x4c70af[_0x4d91('0x33')]=_[_0x4d91('0x34')](_0x4c70af['model'],_0x4c70af[_0x4d91('0x32')]);_0x1e4c6d[_0x4d91('0x35')]=_[_0x4d91('0x34')](_0x4c70af[_0x4d91('0x31')],qs[_0x4d91('0x36')](_0x23902f[_0x4d91('0x32')][_0x4d91('0x36')]));_0x1e4c6d[_0x4d91('0x35')]=_0x1e4c6d[_0x4d91('0x35')]['length']?_0x1e4c6d['attributes']:_0x4c70af[_0x4d91('0x31')];if(_0x23902f['query'][_0x4d91('0x49')]){_0x1e4c6d[_0x4d91('0x43')]=[{'all':!![]}];}_0x1e4c6d=_[_0x4d91('0x3e')]({},_0x1e4c6d,_0x23902f[_0x4d91('0x41')]);return db['WhatsappQueueReport'][_0x4d91('0x4a')](_0x1e4c6d)['then'](handleEntityNotFound(_0x4f6254,null))['then'](respondWithResult(_0x4f6254,null))[_0x4d91('0x45')](handleError(_0x4f6254,null));};exports[_0x4d91('0x4b')]=function(_0x18073d,_0xa03d75){return db[_0x4d91('0x42')][_0x4d91('0x4b')](_0x18073d['body'],{})[_0x4d91('0x26')](respondWithResult(_0xa03d75,0xc9))[_0x4d91('0x45')](handleError(_0xa03d75,null));};exports[_0x4d91('0x25')]=function(_0x449dd8,_0x106e5b){if(_0x449dd8[_0x4d91('0x4c')]['id']){delete _0x449dd8[_0x4d91('0x4c')]['id'];}return db[_0x4d91('0x42')][_0x4d91('0x4a')]({'where':{'id':_0x449dd8[_0x4d91('0x47')]['id']}})[_0x4d91('0x26')](handleEntityNotFound(_0x106e5b,null))['then'](saveUpdates(_0x449dd8[_0x4d91('0x4c')],null))['then'](respondWithResult(_0x106e5b,null))[_0x4d91('0x45')](handleError(_0x106e5b,null));};exports[_0x4d91('0x27')]=function(_0x195e65,_0x386935){return db[_0x4d91('0x42')][_0x4d91('0x4a')]({'where':{'id':_0x195e65[_0x4d91('0x47')]['id']}})[_0x4d91('0x26')](handleEntityNotFound(_0x386935,null))['then'](removeEntity(_0x386935,null))[_0x4d91('0x45')](handleError(_0x386935,null));};exports[_0x4d91('0x4d')]=function(_0x3fe9ee,_0x2bba43){return db[_0x4d91('0x42')][_0x4d91('0x4d')]()[_0x4d91('0x26')](respondWithResult(_0x2bba43,null))['catch'](handleError(_0x2bba43,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 455517f..691e479 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 _0x6098=['../../config/logger','moment','bluebird','path','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util'];(function(_0x1f2aed,_0x5cbaa8){var _0xccab30=function(_0x17bfc3){while(--_0x17bfc3){_0x1f2aed['push'](_0x1f2aed['shift']());}};_0xccab30(++_0x5cbaa8);}(_0x6098,0x12a));var _0x8609=function(_0x58779c,_0xe8471b){_0x58779c=_0x58779c-0x0;var _0x5e1897=_0x6098[_0x58779c];return _0x5e1897;};'use strict';var _=require(_0x8609('0x0'));var util=require(_0x8609('0x1'));var logger=require(_0x8609('0x2'))('api');var moment=require(_0x8609('0x3'));var BPromise=require(_0x8609('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8609('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8609('0x6'));module[_0x8609('0x7')]=function(_0x1757c6,_0x33aa07){return _0x1757c6[_0x8609('0x8')](_0x8609('0x9'),attributes,{'tableName':_0x8609('0xa'),'paranoid':![],'indexes':[{'name':_0x8609('0xb'),'fields':[_0x8609('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x25e7=['path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','api','moment','request-promise'];(function(_0x27fc24,_0xe3def5){var _0x361788=function(_0xcd606a){while(--_0xcd606a){_0x27fc24['push'](_0x27fc24['shift']());}};_0x361788(++_0xe3def5);}(_0x25e7,0x126));var _0x725e=function(_0x2856c6,_0x745fd1){_0x2856c6=_0x2856c6-0x0;var _0x5f23a1=_0x25e7[_0x2856c6];return _0x5f23a1;};'use strict';var _=require(_0x725e('0x0'));var util=require(_0x725e('0x1'));var logger=require('../../config/logger')(_0x725e('0x2'));var moment=require(_0x725e('0x3'));var BPromise=require('bluebird');var rp=require(_0x725e('0x4'));var fs=require('fs');var path=require(_0x725e('0x5'));var rimraf=require(_0x725e('0x6'));var config=require(_0x725e('0x7'));var attributes=require(_0x725e('0x8'));module[_0x725e('0x9')]=function(_0x3f1cd3,_0xa01322){return _0x3f1cd3['define'](_0x725e('0xa'),attributes,{'tableName':_0x725e('0xb'),'paranoid':![],'indexes':[{'name':_0x725e('0xc'),'fields':[_0x725e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 9614f79..de9858f 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 _0x5ec3=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','CreateWhatsappQueueReport','WhatsappQueueReport','body','options','stringify','catch','UpdateWhatsappQueueReport','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x16de68,_0x33d7ff){var _0x1c277e=function(_0x1d8549){while(--_0x1d8549){_0x16de68['push'](_0x16de68['shift']());}};_0x1c277e(++_0x33d7ff);}(_0x5ec3,0x1da));var _0x35ec=function(_0x8e77d1,_0x5acb1){_0x8e77d1=_0x8e77d1-0x0;var _0xacfa2=_0x5ec3[_0x8e77d1];return _0xacfa2;};'use strict';var _=require(_0x35ec('0x0'));var util=require(_0x35ec('0x1'));var moment=require(_0x35ec('0x2'));var BPromise=require(_0x35ec('0x3'));var rs=require(_0x35ec('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x35ec('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x35ec('0x6'))(_0x35ec('0x7'));var config=require(_0x35ec('0x8'));var jayson=require(_0x35ec('0x9'));var client=jayson[_0x35ec('0xa')][_0x35ec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c1316,_0x49e4b8,_0x44b417){return new BPromise(function(_0x3c571d,_0x5cab8e){return client[_0x35ec('0xc')](_0x3c1316,_0x44b417)[_0x35ec('0xd')](function(_0x522f0d){logger[_0x35ec('0xe')](_0x35ec('0xf'),_0x49e4b8,'request\x20sent');logger[_0x35ec('0x10')](_0x35ec('0x11'),_0x49e4b8,_0x35ec('0x12'),JSON['stringify'](_0x522f0d));if(_0x522f0d['error']){if(_0x522f0d[_0x35ec('0x13')]['code']===0x1f4){logger['error'](_0x35ec('0xf'),_0x49e4b8,_0x522f0d['error'][_0x35ec('0x14')]);return _0x5cab8e(_0x522f0d[_0x35ec('0x13')]['message']);}logger[_0x35ec('0x13')](_0x35ec('0xf'),_0x49e4b8,_0x522f0d[_0x35ec('0x13')][_0x35ec('0x14')]);return _0x3c571d(_0x522f0d['error'][_0x35ec('0x14')]);}else{logger[_0x35ec('0xe')](_0x35ec('0xf'),_0x49e4b8,_0x35ec('0x12'));_0x3c571d(_0x522f0d['result']['message']);}})['catch'](function(_0x1b6e91){logger[_0x35ec('0x13')](_0x35ec('0xf'),_0x49e4b8,_0x1b6e91);_0x5cab8e(_0x1b6e91);});});}exports[_0x35ec('0x15')]=function(_0x41d9fb){var _0x3a81cc=this;return new Promise(function(_0x5653b1,_0x3a7f07){return db[_0x35ec('0x16')]['create'](_0x41d9fb[_0x35ec('0x17')],{'raw':_0x41d9fb[_0x35ec('0x18')]?_0x41d9fb['options']['raw']===undefined?!![]:![]:!![]})[_0x35ec('0xd')](function(_0x37f64e){logger[_0x35ec('0xe')]('CreateWhatsappQueueReport',_0x41d9fb);logger['debug'](_0x35ec('0x15'),_0x41d9fb,JSON[_0x35ec('0x19')](_0x37f64e));_0x5653b1(_0x37f64e);})[_0x35ec('0x1a')](function(_0x2eb1d8){logger[_0x35ec('0x13')](_0x35ec('0x15'),_0x2eb1d8['message'],_0x41d9fb);_0x3a7f07(_0x3a81cc['error'](0x1f4,_0x2eb1d8[_0x35ec('0x14')]));});});};exports[_0x35ec('0x1b')]=function(_0x5da7a1){var _0x19ef30=this;return new Promise(function(_0x4eecab,_0x2624fb){return db[_0x35ec('0x16')]['update'](_0x5da7a1[_0x35ec('0x17')],{'raw':_0x5da7a1[_0x35ec('0x18')]?_0x5da7a1['options'][_0x35ec('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5da7a1[_0x35ec('0x18')]?_0x5da7a1[_0x35ec('0x18')][_0x35ec('0x1d')]||null:null,'attributes':_0x5da7a1[_0x35ec('0x18')]?_0x5da7a1[_0x35ec('0x18')][_0x35ec('0x1e')]||null:null,'limit':_0x5da7a1['options']?_0x5da7a1[_0x35ec('0x18')][_0x35ec('0x1f')]||null:null})[_0x35ec('0xd')](function(_0x12812e){logger[_0x35ec('0xe')](_0x35ec('0x1b'),_0x5da7a1);logger[_0x35ec('0x10')](_0x35ec('0x1b'),_0x5da7a1,JSON['stringify'](_0x12812e));_0x4eecab(_0x12812e);})[_0x35ec('0x1a')](function(_0xcd21d1){logger[_0x35ec('0x13')]('UpdateWhatsappQueueReport',_0xcd21d1['message'],_0x5da7a1);_0x2624fb(_0x19ef30[_0x35ec('0x13')](0x1f4,_0xcd21d1['message']));});});}; \ No newline at end of file +var _0x019f=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','WhatsappQueueReport,\x20%s,\x20%s','info','result','WhatsappQueueReport','body','CreateWhatsappQueueReport','catch','message','UpdateWhatsappQueueReport','update','options','raw','attributes','limit','lodash','moment','randomstring'];(function(_0x1847fd,_0x48bb28){var _0x426713=function(_0x5e3e35){while(--_0x5e3e35){_0x1847fd['push'](_0x1847fd['shift']());}};_0x426713(++_0x48bb28);}(_0x019f,0xcf));var _0xf019=function(_0x2bcc8d,_0x5691d1){_0x2bcc8d=_0x2bcc8d-0x0;var _0x123b6a=_0x019f[_0x2bcc8d];return _0x123b6a;};'use strict';var _=require(_0xf019('0x0'));var util=require('util');var moment=require(_0xf019('0x1'));var BPromise=require('bluebird');var rs=require(_0xf019('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf019('0x3'))['db'];var utils=require(_0xf019('0x4'));var logger=require(_0xf019('0x5'))(_0xf019('0x6'));var config=require(_0xf019('0x7'));var jayson=require(_0xf019('0x8'));var client=jayson['client'][_0xf019('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a6572,_0x26b3e1,_0x190632){return new BPromise(function(_0x2226ac,_0x2a6e60){return client[_0xf019('0xa')](_0x5a6572,_0x190632)[_0xf019('0xb')](function(_0x4043a3){logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x26b3e1,_0xf019('0xc'));logger[_0xf019('0xd')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x26b3e1,_0xf019('0xc'),JSON[_0xf019('0xe')](_0x4043a3));if(_0x4043a3[_0xf019('0xf')]){if(_0x4043a3['error']['code']===0x1f4){logger[_0xf019('0xf')](_0xf019('0x10'),_0x26b3e1,_0x4043a3['error']['message']);return _0x2a6e60(_0x4043a3[_0xf019('0xf')]['message']);}logger[_0xf019('0xf')](_0xf019('0x10'),_0x26b3e1,_0x4043a3[_0xf019('0xf')]['message']);return _0x2226ac(_0x4043a3[_0xf019('0xf')]['message']);}else{logger[_0xf019('0x11')](_0xf019('0x10'),_0x26b3e1,_0xf019('0xc'));_0x2226ac(_0x4043a3[_0xf019('0x12')]['message']);}})['catch'](function(_0xe0d30){logger[_0xf019('0xf')](_0xf019('0x10'),_0x26b3e1,_0xe0d30);_0x2a6e60(_0xe0d30);});});}exports['CreateWhatsappQueueReport']=function(_0x12c64c){var _0x30c906=this;return new Promise(function(_0x1930c6,_0x103c0f){return db[_0xf019('0x13')]['create'](_0x12c64c[_0xf019('0x14')],{'raw':_0x12c64c['options']?_0x12c64c['options']['raw']===undefined?!![]:![]:!![]})[_0xf019('0xb')](function(_0x5b5c79){logger['info'](_0xf019('0x15'),_0x12c64c);logger[_0xf019('0xd')](_0xf019('0x15'),_0x12c64c,JSON['stringify'](_0x5b5c79));_0x1930c6(_0x5b5c79);})[_0xf019('0x16')](function(_0x50c833){logger[_0xf019('0xf')](_0xf019('0x15'),_0x50c833[_0xf019('0x17')],_0x12c64c);_0x103c0f(_0x30c906[_0xf019('0xf')](0x1f4,_0x50c833[_0xf019('0x17')]));});});};exports[_0xf019('0x18')]=function(_0x880074){var _0x3969ea=this;return new Promise(function(_0x1f9a45,_0x58ba07){return db[_0xf019('0x13')][_0xf019('0x19')](_0x880074[_0xf019('0x14')],{'raw':_0x880074[_0xf019('0x1a')]?_0x880074[_0xf019('0x1a')][_0xf019('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x880074['options']?_0x880074['options']['where']||null:null,'attributes':_0x880074['options']?_0x880074[_0xf019('0x1a')][_0xf019('0x1c')]||null:null,'limit':_0x880074[_0xf019('0x1a')]?_0x880074['options'][_0xf019('0x1d')]||null:null})[_0xf019('0xb')](function(_0x274d7d){logger['info'](_0xf019('0x18'),_0x880074);logger[_0xf019('0xd')](_0xf019('0x18'),_0x880074,JSON[_0xf019('0xe')](_0x274d7d));_0x1f9a45(_0x274d7d);})[_0xf019('0x16')](function(_0x4124d8){logger[_0xf019('0xf')]('UpdateWhatsappQueueReport',_0x4124d8['message'],_0x880074);_0x58ba07(_0x3969ea[_0xf019('0xf')](0x1f4,_0x4124d8['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 0aa7578..b8f5d66 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 _0x0f79=['get','index','/describe','describe','/:id','isAuthenticated','post','put','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller'];(function(_0x15315e,_0x4dfe65){var _0x4a7615=function(_0x537827){while(--_0x537827){_0x15315e['push'](_0x15315e['shift']());}};_0x4a7615(++_0x4dfe65);}(_0x0f79,0xf5));var _0x90f7=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x0f79[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x90f7('0x0'));var util=require(_0x90f7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x90f7('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x90f7('0x3'));var interaction=require(_0x90f7('0x4'));var config=require(_0x90f7('0x5'));var controller=require(_0x90f7('0x6'));router[_0x90f7('0x7')]('/',auth['isAuthenticated'](),controller[_0x90f7('0x8')]);router[_0x90f7('0x7')](_0x90f7('0x9'),auth['isAuthenticated'](),controller[_0x90f7('0xa')]);router['get'](_0x90f7('0xb'),auth[_0x90f7('0xc')](),controller['show']);router[_0x90f7('0xd')]('/',auth[_0x90f7('0xc')](),controller['create']);router[_0x90f7('0xe')](_0x90f7('0xb'),auth[_0x90f7('0xc')](),controller['update']);router[_0x90f7('0xf')]('/:id',auth[_0x90f7('0xc')](),controller[_0x90f7('0x10')]);module[_0x90f7('0x11')]=router; \ No newline at end of file +var _0x3f6d=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','describe','show','post','create','put','update','delete','destroy','exports','multer','path'];(function(_0x4c14c6,_0x1dfd37){var _0x4ca810=function(_0xb795f4){while(--_0xb795f4){_0x4c14c6['push'](_0x4c14c6['shift']());}};_0x4ca810(++_0x1dfd37);}(_0x3f6d,0x1b3));var _0xd3f6=function(_0x26c364,_0x4226c3){_0x26c364=_0x26c364-0x0;var _0x565bf4=_0x3f6d[_0x26c364];return _0x565bf4;};'use strict';var multer=require(_0xd3f6('0x0'));var util=require('util');var path=require(_0xd3f6('0x1'));var timeout=require(_0xd3f6('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd3f6('0x3'));var auth=require(_0xd3f6('0x4'));var interaction=require(_0xd3f6('0x5'));var config=require(_0xd3f6('0x6'));var controller=require(_0xd3f6('0x7'));router[_0xd3f6('0x8')]('/',auth[_0xd3f6('0x9')](),controller['index']);router['get']('/describe',auth[_0xd3f6('0x9')](),controller[_0xd3f6('0xa')]);router[_0xd3f6('0x8')]('/:id',auth[_0xd3f6('0x9')](),controller[_0xd3f6('0xb')]);router[_0xd3f6('0xc')]('/',auth[_0xd3f6('0x9')](),controller[_0xd3f6('0xd')]);router[_0xd3f6('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xd3f6('0xf')]);router[_0xd3f6('0x10')]('/:id',auth[_0xd3f6('0x9')](),controller[_0xd3f6('0x11')]);module[_0xd3f6('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 fe4e9ad..ec02d7f 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 _0x4ca7=['STRING','account','agent','sequelize','exports'];(function(_0x3bc1a8,_0x96c78d){var _0x6076ac=function(_0x3a4283){while(--_0x3a4283){_0x3bc1a8['push'](_0x3bc1a8['shift']());}};_0x6076ac(++_0x96c78d);}(_0x4ca7,0x1e3));var _0x74ca=function(_0x10fae3,_0x104831){_0x10fae3=_0x10fae3-0x0;var _0xf270c3=_0x4ca7[_0x10fae3];return _0xf270c3;};'use strict';var Sequelize=require(_0x74ca('0x0'));module[_0x74ca('0x1')]={'uniqueid':{'type':Sequelize[_0x74ca('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x74ca('0x3'),_0x74ca('0x4'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x288a=['account','DATE','exports','STRING','ENUM'];(function(_0x128056,_0x4f314b){var _0x47da14=function(_0xf6f119){while(--_0xf6f119){_0x128056['push'](_0x128056['shift']());}};_0x47da14(++_0x4f314b);}(_0x288a,0x188));var _0xa288=function(_0x5e9c24,_0x404202){_0x5e9c24=_0x5e9c24-0x0;var _0x25c338=_0x288a[_0x5e9c24];return _0x25c338;};'use strict';var Sequelize=require('sequelize');module[_0xa288('0x0')]={'uniqueid':{'type':Sequelize[_0xa288('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xa288('0x2')](_0xa288('0x3'),'agent','queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xa288('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index b81f4c6..f521f5c 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 _0x917d=['fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','filters','pick','filter','where','merge','options','WhatsappTransferReport','includeAll','include','findAll','rows','show','params','catch','create','update','find','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs'];(function(_0x347f41,_0x539dbe){var _0x4d7cef=function(_0x1f2c06){while(--_0x1f2c06){_0x347f41['push'](_0x347f41['shift']());}};_0x4d7cef(++_0x539dbe);}(_0x917d,0x17c));var _0xd917=function(_0x35fda8,_0x27134a){_0x35fda8=_0x35fda8-0x0;var _0x4a3e09=_0x917d[_0x35fda8];return _0x4a3e09;};'use strict';var emlformat=require(_0xd917('0x0'));var rimraf=require(_0xd917('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd917('0x2'));var rp=require(_0xd917('0x3'));var moment=require(_0xd917('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd917('0x5'));var util=require(_0xd917('0x6'));var path=require('path');var sox=require(_0xd917('0x7'));var csv=require(_0xd917('0x8'));var ejs=require(_0xd917('0x9'));var fs=require('fs');var fs_extra=require(_0xd917('0xa'));var _=require(_0xd917('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd917('0xc'));var deskjs=require(_0xd917('0xd'));var toCsv=require(_0xd917('0x8'));var querystring=require(_0xd917('0xe'));var Papa=require(_0xd917('0xf'));var Redis=require(_0xd917('0x10'));var authService=require(_0xd917('0x11'));var qs=require(_0xd917('0x12'));var as=require(_0xd917('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd917('0x14'))(_0xd917('0x15'));var utils=require('../../config/utils');var config=require(_0xd917('0x16'));var licenseUtil=require(_0xd917('0x17'));var db=require(_0xd917('0x18'))['db'];function respondWithStatusCode(_0x3bd54b,_0x5ce552){_0x5ce552=_0x5ce552||0xcc;return function(_0x342ddb){if(_0x342ddb){return _0x3bd54b['sendStatus'](_0x5ce552);}return _0x3bd54b[_0xd917('0x19')](_0x5ce552)[_0xd917('0x1a')]();};}function respondWithResult(_0x6cdfa7,_0x5b8eda){_0x5b8eda=_0x5b8eda||0xc8;return function(_0x17b81e){if(_0x17b81e){return _0x6cdfa7[_0xd917('0x19')](_0x5b8eda)[_0xd917('0x1b')](_0x17b81e);}};}function respondWithFilteredResult(_0x193ec0,_0x4d4f8b){return function(_0x5d05b7){if(_0x5d05b7){var _0x5e9c8d=typeof _0x4d4f8b[_0xd917('0x1c')]==='undefined'&&typeof _0x4d4f8b[_0xd917('0x1d')]===_0xd917('0x1e');var _0x4ce3a7=_0x5d05b7[_0xd917('0x1f')];var _0x1cfb52=_0x5e9c8d?0x0:_0x4d4f8b[_0xd917('0x1c')];var _0x18e7cf=_0x5e9c8d?_0x5d05b7[_0xd917('0x1f')]:_0x4d4f8b[_0xd917('0x1c')]+_0x4d4f8b['limit'];var _0xe50f2e;if(_0x18e7cf>=_0x4ce3a7){_0x18e7cf=_0x4ce3a7;_0xe50f2e=0xc8;}else{_0xe50f2e=0xce;}_0x193ec0[_0xd917('0x19')](_0xe50f2e);return _0x193ec0[_0xd917('0x20')](_0xd917('0x21'),_0x1cfb52+'-'+_0x18e7cf+'/'+_0x4ce3a7)['json'](_0x5d05b7);}return null;};}function patchUpdates(_0x2eab97){return function(_0x53c693){try{jsonpatch[_0xd917('0x22')](_0x53c693,_0x2eab97,!![]);}catch(_0x3c10d3){return BPromise[_0xd917('0x23')](_0x3c10d3);}return _0x53c693[_0xd917('0x24')]();};}function saveUpdates(_0x44d518,_0x352a7c){return function(_0x363d7c){if(_0x363d7c){return _0x363d7c['update'](_0x44d518)['then'](function(_0x5748c2){return _0x5748c2;});}return null;};}function removeEntity(_0x16a45a,_0x4628b5){return function(_0x585971){if(_0x585971){return _0x585971['destroy']()[_0xd917('0x25')](function(){_0x16a45a['status'](0xcc)[_0xd917('0x1a')]();});}};}function handleEntityNotFound(_0x505d5e,_0x14b025){return function(_0x1f146a){if(!_0x1f146a){_0x505d5e[_0xd917('0x26')](0x194);}return _0x1f146a;};}function handleError(_0x3d3709,_0x866ed4){_0x866ed4=_0x866ed4||0x1f4;return function(_0x37fe27){logger[_0xd917('0x27')](_0x37fe27[_0xd917('0x28')]);if(_0x37fe27[_0xd917('0x29')]){delete _0x37fe27[_0xd917('0x29')];}_0x3d3709[_0xd917('0x19')](_0x866ed4)[_0xd917('0x2a')](_0x37fe27);};}exports[_0xd917('0x2b')]=function(_0x2f4939,_0x151655){var _0x2632cf={},_0x554322={},_0x46bb6d={'count':0x0,'rows':[]};var _0x28d802=_[_0xd917('0x2c')](db['WhatsappTransferReport'][_0xd917('0x2d')],function(_0x1dee51){return{'name':_0x1dee51[_0xd917('0x2e')],'type':_0x1dee51[_0xd917('0x2f')][_0xd917('0x30')]};});_0x554322[_0xd917('0x31')]=_[_0xd917('0x2c')](_0x28d802,_0xd917('0x29'));_0x554322['query']=_[_0xd917('0x32')](_0x2f4939[_0xd917('0x33')]);_0x554322['filters']=_[_0xd917('0x34')](_0x554322[_0xd917('0x31')],_0x554322[_0xd917('0x33')]);_0x2632cf['attributes']=_[_0xd917('0x34')](_0x554322[_0xd917('0x31')],qs[_0xd917('0x35')](_0x2f4939[_0xd917('0x33')][_0xd917('0x35')]));_0x2632cf[_0xd917('0x36')]=_0x2632cf[_0xd917('0x36')][_0xd917('0x37')]?_0x2632cf[_0xd917('0x36')]:_0x554322[_0xd917('0x31')];if(!_0x2f4939[_0xd917('0x33')]['hasOwnProperty'](_0xd917('0x38'))){_0x2632cf[_0xd917('0x1d')]=qs['limit'](_0x2f4939[_0xd917('0x33')][_0xd917('0x1d')]);_0x2632cf[_0xd917('0x1c')]=qs['offset'](_0x2f4939[_0xd917('0x33')][_0xd917('0x1c')]);}_0x2632cf[_0xd917('0x39')]=qs[_0xd917('0x3a')](_0x2f4939[_0xd917('0x33')][_0xd917('0x3a')]);_0x2632cf['where']=qs[_0xd917('0x3b')](_[_0xd917('0x3c')](_0x2f4939[_0xd917('0x33')],_0x554322[_0xd917('0x3b')]),_0x28d802);if(_0x2f4939['query'][_0xd917('0x3d')]){_0x2632cf[_0xd917('0x3e')]=_['merge'](_0x2632cf[_0xd917('0x3e')],{'$or':_[_0xd917('0x2c')](_0x28d802,function(_0x1cc5e5){if(_0x1cc5e5[_0xd917('0x2f')]!=='VIRTUAL'){var _0x129f0b={};_0x129f0b[_0x1cc5e5['name']]={'$like':'%'+_0x2f4939[_0xd917('0x33')][_0xd917('0x3d')]+'%'};return _0x129f0b;}})});}_0x2632cf=_[_0xd917('0x3f')]({},_0x2632cf,_0x2f4939[_0xd917('0x40')]);var _0x4ca586={'where':_0x2632cf[_0xd917('0x3e')]};return db[_0xd917('0x41')][_0xd917('0x1f')](_0x4ca586)[_0xd917('0x25')](function(_0x45e0d8){_0x46bb6d[_0xd917('0x1f')]=_0x45e0d8;if(_0x2f4939[_0xd917('0x33')][_0xd917('0x42')]){_0x2632cf[_0xd917('0x43')]=[{'all':!![]}];}return db[_0xd917('0x41')][_0xd917('0x44')](_0x2632cf);})[_0xd917('0x25')](function(_0x15c211){_0x46bb6d[_0xd917('0x45')]=_0x15c211;return _0x46bb6d;})[_0xd917('0x25')](respondWithFilteredResult(_0x151655,_0x2632cf))['catch'](handleError(_0x151655,null));};exports[_0xd917('0x46')]=function(_0x463b45,_0x3d980b){var _0x59495b={'raw':!![],'where':{'id':_0x463b45[_0xd917('0x47')]['id']}},_0xb7c939={};_0xb7c939[_0xd917('0x31')]=_[_0xd917('0x32')](db[_0xd917('0x41')][_0xd917('0x2d')]);_0xb7c939[_0xd917('0x33')]=_[_0xd917('0x32')](_0x463b45[_0xd917('0x33')]);_0xb7c939[_0xd917('0x3b')]=_[_0xd917('0x34')](_0xb7c939[_0xd917('0x31')],_0xb7c939[_0xd917('0x33')]);_0x59495b[_0xd917('0x36')]=_[_0xd917('0x34')](_0xb7c939[_0xd917('0x31')],qs['fields'](_0x463b45[_0xd917('0x33')][_0xd917('0x35')]));_0x59495b[_0xd917('0x36')]=_0x59495b[_0xd917('0x36')][_0xd917('0x37')]?_0x59495b[_0xd917('0x36')]:_0xb7c939[_0xd917('0x31')];if(_0x463b45[_0xd917('0x33')]['includeAll']){_0x59495b[_0xd917('0x43')]=[{'all':!![]}];}_0x59495b=_[_0xd917('0x3f')]({},_0x59495b,_0x463b45[_0xd917('0x40')]);return db['WhatsappTransferReport']['find'](_0x59495b)[_0xd917('0x25')](handleEntityNotFound(_0x3d980b,null))['then'](respondWithResult(_0x3d980b,null))[_0xd917('0x48')](handleError(_0x3d980b,null));};exports[_0xd917('0x49')]=function(_0x4495db,_0x2c1d21){return db[_0xd917('0x41')]['create'](_0x4495db['body'],{})['then'](respondWithResult(_0x2c1d21,0xc9))[_0xd917('0x48')](handleError(_0x2c1d21,null));};exports[_0xd917('0x4a')]=function(_0x520afe,_0x17d3dc){if(_0x520afe['body']['id']){delete _0x520afe['body']['id'];}return db[_0xd917('0x41')][_0xd917('0x4b')]({'where':{'id':_0x520afe['params']['id']}})[_0xd917('0x25')](handleEntityNotFound(_0x17d3dc,null))[_0xd917('0x25')](saveUpdates(_0x520afe[_0xd917('0x4c')],null))[_0xd917('0x25')](respondWithResult(_0x17d3dc,null))[_0xd917('0x48')](handleError(_0x17d3dc,null));};exports['destroy']=function(_0x268a4e,_0x5290fa){return db[_0xd917('0x41')][_0xd917('0x4b')]({'where':{'id':_0x268a4e['params']['id']}})[_0xd917('0x25')](handleEntityNotFound(_0x5290fa,null))[_0xd917('0x25')](removeEntity(_0x5290fa,null))[_0xd917('0x48')](handleError(_0x5290fa,null));};exports[_0xd917('0x4d')]=function(_0x5ca86c,_0x3a4abf){return db[_0xd917('0x41')][_0xd917('0x4d')]()[_0xd917('0x25')](respondWithResult(_0x3a4abf,null))['catch'](handleError(_0x3a4abf,null));}; \ No newline at end of file +var _0x6017=['length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','findAll','rows','show','keys','find','catch','create','body','destroy','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','error','stack','name','index','map','WhatsappTransferReport','rawAttributes','type','key','model','query','filters','intersection','fields','attributes'];(function(_0x2a1035,_0x407a8b){var _0x3713a1=function(_0x2f8e82){while(--_0x2f8e82){_0x2a1035['push'](_0x2a1035['shift']());}};_0x3713a1(++_0x407a8b);}(_0x6017,0xae));var _0x7601=function(_0xdabf39,_0xac872f){_0xdabf39=_0xdabf39-0x0;var _0x191b8f=_0x6017[_0xdabf39];return _0x191b8f;};'use strict';var emlformat=require(_0x7601('0x0'));var rimraf=require(_0x7601('0x1'));var zipdir=require(_0x7601('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7601('0x3'));var moment=require(_0x7601('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7601('0x5'));var util=require('util');var path=require(_0x7601('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7601('0x7'));var fs=require('fs');var fs_extra=require(_0x7601('0x8'));var _=require(_0x7601('0x9'));var squel=require(_0x7601('0xa'));var crypto=require(_0x7601('0xb'));var jsforce=require(_0x7601('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7601('0xd'));var querystring=require(_0x7601('0xe'));var Papa=require(_0x7601('0xf'));var Redis=require('ioredis');var authService=require(_0x7601('0x10'));var qs=require(_0x7601('0x11'));var as=require(_0x7601('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7601('0x13'))(_0x7601('0x14'));var utils=require(_0x7601('0x15'));var config=require(_0x7601('0x16'));var licenseUtil=require(_0x7601('0x17'));var db=require(_0x7601('0x18'))['db'];function respondWithStatusCode(_0x4001af,_0x1e2027){_0x1e2027=_0x1e2027||0xcc;return function(_0x2f5dbf){if(_0x2f5dbf){return _0x4001af[_0x7601('0x19')](_0x1e2027);}return _0x4001af['status'](_0x1e2027)[_0x7601('0x1a')]();};}function respondWithResult(_0x5ee63a,_0x4be36a){_0x4be36a=_0x4be36a||0xc8;return function(_0x2b8cbc){if(_0x2b8cbc){return _0x5ee63a[_0x7601('0x1b')](_0x4be36a)[_0x7601('0x1c')](_0x2b8cbc);}};}function respondWithFilteredResult(_0x33452d,_0x30b86d){return function(_0x3a1706){if(_0x3a1706){var _0xdd9b16=typeof _0x30b86d[_0x7601('0x1d')]==='undefined'&&typeof _0x30b86d[_0x7601('0x1e')]===_0x7601('0x1f');var _0x5329e6=_0x3a1706[_0x7601('0x20')];var _0x5c3fb7=_0xdd9b16?0x0:_0x30b86d['offset'];var _0x22520e=_0xdd9b16?_0x3a1706[_0x7601('0x20')]:_0x30b86d[_0x7601('0x1d')]+_0x30b86d[_0x7601('0x1e')];var _0x26f1b8;if(_0x22520e>=_0x5329e6){_0x22520e=_0x5329e6;_0x26f1b8=0xc8;}else{_0x26f1b8=0xce;}_0x33452d[_0x7601('0x1b')](_0x26f1b8);return _0x33452d[_0x7601('0x21')]('Content-Range',_0x5c3fb7+'-'+_0x22520e+'/'+_0x5329e6)[_0x7601('0x1c')](_0x3a1706);}return null;};}function patchUpdates(_0x1d58c0){return function(_0x4ed321){try{jsonpatch[_0x7601('0x22')](_0x4ed321,_0x1d58c0,!![]);}catch(_0x5169c9){return BPromise[_0x7601('0x23')](_0x5169c9);}return _0x4ed321[_0x7601('0x24')]();};}function saveUpdates(_0x99ab5b,_0x12f3f6){return function(_0x4cbf1e){if(_0x4cbf1e){return _0x4cbf1e[_0x7601('0x25')](_0x99ab5b)[_0x7601('0x26')](function(_0x140547){return _0x140547;});}return null;};}function removeEntity(_0x3a3629,_0x57e7a6){return function(_0x2b9bd){if(_0x2b9bd){return _0x2b9bd['destroy']()[_0x7601('0x26')](function(){_0x3a3629['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x326f8f,_0x1eb68c){return function(_0x5277d0){if(!_0x5277d0){_0x326f8f['sendStatus'](0x194);}return _0x5277d0;};}function handleError(_0x47644a,_0x519e47){_0x519e47=_0x519e47||0x1f4;return function(_0x57f6e9){logger[_0x7601('0x27')](_0x57f6e9[_0x7601('0x28')]);if(_0x57f6e9[_0x7601('0x29')]){delete _0x57f6e9['name'];}_0x47644a[_0x7601('0x1b')](_0x519e47)['send'](_0x57f6e9);};}exports[_0x7601('0x2a')]=function(_0xa05dda,_0x58fd92){var _0x4ab32d={},_0x44d765={},_0x13e8a7={'count':0x0,'rows':[]};var _0x1a2b2f=_[_0x7601('0x2b')](db[_0x7601('0x2c')][_0x7601('0x2d')],function(_0x5b961c){return{'name':_0x5b961c['fieldName'],'type':_0x5b961c[_0x7601('0x2e')][_0x7601('0x2f')]};});_0x44d765[_0x7601('0x30')]=_[_0x7601('0x2b')](_0x1a2b2f,_0x7601('0x29'));_0x44d765['query']=_['keys'](_0xa05dda[_0x7601('0x31')]);_0x44d765[_0x7601('0x32')]=_[_0x7601('0x33')](_0x44d765[_0x7601('0x30')],_0x44d765[_0x7601('0x31')]);_0x4ab32d['attributes']=_[_0x7601('0x33')](_0x44d765[_0x7601('0x30')],qs['fields'](_0xa05dda[_0x7601('0x31')][_0x7601('0x34')]));_0x4ab32d[_0x7601('0x35')]=_0x4ab32d[_0x7601('0x35')][_0x7601('0x36')]?_0x4ab32d['attributes']:_0x44d765[_0x7601('0x30')];if(!_0xa05dda[_0x7601('0x31')][_0x7601('0x37')](_0x7601('0x38'))){_0x4ab32d['limit']=qs[_0x7601('0x1e')](_0xa05dda['query']['limit']);_0x4ab32d[_0x7601('0x1d')]=qs[_0x7601('0x1d')](_0xa05dda[_0x7601('0x31')][_0x7601('0x1d')]);}_0x4ab32d[_0x7601('0x39')]=qs[_0x7601('0x3a')](_0xa05dda[_0x7601('0x31')][_0x7601('0x3a')]);_0x4ab32d[_0x7601('0x3b')]=qs[_0x7601('0x32')](_[_0x7601('0x3c')](_0xa05dda[_0x7601('0x31')],_0x44d765[_0x7601('0x32')]),_0x1a2b2f);if(_0xa05dda[_0x7601('0x31')]['filter']){_0x4ab32d[_0x7601('0x3b')]=_[_0x7601('0x3d')](_0x4ab32d[_0x7601('0x3b')],{'$or':_[_0x7601('0x2b')](_0x1a2b2f,function(_0x1bc502){if(_0x1bc502[_0x7601('0x2e')]!=='VIRTUAL'){var _0x3f32a2={};_0x3f32a2[_0x1bc502[_0x7601('0x29')]]={'$like':'%'+_0xa05dda['query'][_0x7601('0x3e')]+'%'};return _0x3f32a2;}})});}_0x4ab32d=_['merge']({},_0x4ab32d,_0xa05dda[_0x7601('0x3f')]);var _0x56e78b={'where':_0x4ab32d['where']};return db['WhatsappTransferReport'][_0x7601('0x20')](_0x56e78b)[_0x7601('0x26')](function(_0x434b90){_0x13e8a7[_0x7601('0x20')]=_0x434b90;if(_0xa05dda['query'][_0x7601('0x40')]){_0x4ab32d['include']=[{'all':!![]}];}return db[_0x7601('0x2c')][_0x7601('0x41')](_0x4ab32d);})[_0x7601('0x26')](function(_0xdf4ed){_0x13e8a7[_0x7601('0x42')]=_0xdf4ed;return _0x13e8a7;})[_0x7601('0x26')](respondWithFilteredResult(_0x58fd92,_0x4ab32d))['catch'](handleError(_0x58fd92,null));};exports[_0x7601('0x43')]=function(_0x5c2f8e,_0x81b852){var _0xa5fa08={'raw':!![],'where':{'id':_0x5c2f8e['params']['id']}},_0x58fd23={};_0x58fd23['model']=_['keys'](db[_0x7601('0x2c')][_0x7601('0x2d')]);_0x58fd23[_0x7601('0x31')]=_[_0x7601('0x44')](_0x5c2f8e[_0x7601('0x31')]);_0x58fd23[_0x7601('0x32')]=_[_0x7601('0x33')](_0x58fd23[_0x7601('0x30')],_0x58fd23[_0x7601('0x31')]);_0xa5fa08[_0x7601('0x35')]=_[_0x7601('0x33')](_0x58fd23[_0x7601('0x30')],qs[_0x7601('0x34')](_0x5c2f8e[_0x7601('0x31')][_0x7601('0x34')]));_0xa5fa08[_0x7601('0x35')]=_0xa5fa08['attributes'][_0x7601('0x36')]?_0xa5fa08[_0x7601('0x35')]:_0x58fd23[_0x7601('0x30')];if(_0x5c2f8e[_0x7601('0x31')][_0x7601('0x40')]){_0xa5fa08['include']=[{'all':!![]}];}_0xa5fa08=_[_0x7601('0x3d')]({},_0xa5fa08,_0x5c2f8e['options']);return db[_0x7601('0x2c')][_0x7601('0x45')](_0xa5fa08)['then'](handleEntityNotFound(_0x81b852,null))['then'](respondWithResult(_0x81b852,null))[_0x7601('0x46')](handleError(_0x81b852,null));};exports[_0x7601('0x47')]=function(_0x29aafa,_0x2b8ec1){return db[_0x7601('0x2c')][_0x7601('0x47')](_0x29aafa['body'],{})[_0x7601('0x26')](respondWithResult(_0x2b8ec1,0xc9))['catch'](handleError(_0x2b8ec1,null));};exports['update']=function(_0x2c3b10,_0x16c01c){if(_0x2c3b10[_0x7601('0x48')]['id']){delete _0x2c3b10['body']['id'];}return db[_0x7601('0x2c')][_0x7601('0x45')]({'where':{'id':_0x2c3b10['params']['id']}})[_0x7601('0x26')](handleEntityNotFound(_0x16c01c,null))[_0x7601('0x26')](saveUpdates(_0x2c3b10[_0x7601('0x48')],null))[_0x7601('0x26')](respondWithResult(_0x16c01c,null))[_0x7601('0x46')](handleError(_0x16c01c,null));};exports[_0x7601('0x49')]=function(_0x25582b,_0x5e6f25){return db[_0x7601('0x2c')][_0x7601('0x45')]({'where':{'id':_0x25582b[_0x7601('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5e6f25,null))[_0x7601('0x26')](removeEntity(_0x5e6f25,null))[_0x7601('0x46')](handleError(_0x5e6f25,null));};exports[_0x7601('0x4b')]=function(_0x8a5747,_0x3df2c2){return db['WhatsappTransferReport'][_0x7601('0x4b')]()[_0x7601('0x26')](respondWithResult(_0x3df2c2,null))[_0x7601('0x46')](handleError(_0x3df2c2,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index b69508f..cb0c05d 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 _0x00ba=['define','WhatsappTransferReport','uniqueid','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x00ba,0x1d7));var _0xa00b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x00ba[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xa00b('0x0'));var logger=require(_0xa00b('0x1'))(_0xa00b('0x2'));var moment=require(_0xa00b('0x3'));var BPromise=require('bluebird');var rp=require(_0xa00b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa00b('0x5'));var config=require(_0xa00b('0x6'));var attributes=require(_0xa00b('0x7'));module[_0xa00b('0x8')]=function(_0x1e717c,_0x35cded){return _0x1e717c[_0xa00b('0x9')](_0xa00b('0xa'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0xa00b('0xb'),'fields':[_0xa00b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe22e=['api','moment','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x14d99c,_0xa1b029){var _0x2a8f65=function(_0xc51369){while(--_0xc51369){_0x14d99c['push'](_0x14d99c['shift']());}};_0x2a8f65(++_0xa1b029);}(_0xe22e,0x138));var _0xee22=function(_0x3bd2c8,_0x395b96){_0x3bd2c8=_0x3bd2c8-0x0;var _0x25374f=_0xe22e[_0x3bd2c8];return _0x25374f;};'use strict';var _=require(_0xee22('0x0'));var util=require(_0xee22('0x1'));var logger=require(_0xee22('0x2'))(_0xee22('0x3'));var moment=require(_0xee22('0x4'));var BPromise=require('bluebird');var rp=require(_0xee22('0x5'));var fs=require('fs');var path=require(_0xee22('0x6'));var rimraf=require(_0xee22('0x7'));var config=require(_0xee22('0x8'));var attributes=require(_0xee22('0x9'));module[_0xee22('0xa')]=function(_0x3a525b,_0x2e989b){return _0x3a525b[_0xee22('0xb')](_0xee22('0xc'),attributes,{'tableName':_0xee22('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xee22('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index ba88efa..8b43e3c 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 _0x8824=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1e6e4e,_0x2b1b09){var _0x3d746b=function(_0x4483dd){while(--_0x4483dd){_0x1e6e4e['push'](_0x1e6e4e['shift']());}};_0x3d746b(++_0x2b1b09);}(_0x8824,0xe0));var _0x4882=function(_0x140d70,_0x3874f3){_0x140d70=_0x140d70-0x0;var _0x9c325f=_0x8824[_0x140d70];return _0x9c325f;};'use strict';var _=require(_0x4882('0x0'));var util=require(_0x4882('0x1'));var moment=require(_0x4882('0x2'));var BPromise=require(_0x4882('0x3'));var rs=require(_0x4882('0x4'));var fs=require('fs');var Redis=require(_0x4882('0x5'));var db=require(_0x4882('0x6'))['db'];var utils=require(_0x4882('0x7'));var logger=require(_0x4882('0x8'))(_0x4882('0x9'));var config=require(_0x4882('0xa'));var jayson=require(_0x4882('0xb'));var client=jayson[_0x4882('0xc')][_0x4882('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x41814c,_0x43e4b4,_0x1df15a){return new BPromise(function(_0x732d46,_0x46ea31){return client[_0x4882('0xe')](_0x41814c,_0x1df15a)[_0x4882('0xf')](function(_0x391a49){logger['info'](_0x4882('0x10'),_0x43e4b4,_0x4882('0x11'));logger[_0x4882('0x12')](_0x4882('0x13'),_0x43e4b4,_0x4882('0x11'),JSON[_0x4882('0x14')](_0x391a49));if(_0x391a49['error']){if(_0x391a49[_0x4882('0x15')]['code']===0x1f4){logger[_0x4882('0x15')](_0x4882('0x10'),_0x43e4b4,_0x391a49[_0x4882('0x15')]['message']);return _0x46ea31(_0x391a49[_0x4882('0x15')][_0x4882('0x16')]);}logger[_0x4882('0x15')](_0x4882('0x10'),_0x43e4b4,_0x391a49['error'][_0x4882('0x16')]);return _0x732d46(_0x391a49[_0x4882('0x15')][_0x4882('0x16')]);}else{logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x43e4b4,_0x4882('0x11'));_0x732d46(_0x391a49['result'][_0x4882('0x16')]);}})['catch'](function(_0x9a053){logger[_0x4882('0x15')](_0x4882('0x10'),_0x43e4b4,_0x9a053);_0x46ea31(_0x9a053);});});} \ No newline at end of file +var _0x051b=['rpc','../../config/environment','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x530ef4,_0x4a1d40){var _0x56e14c=function(_0x4a39b7){while(--_0x4a39b7){_0x530ef4['push'](_0x530ef4['shift']());}};_0x56e14c(++_0x4a1d40);}(_0x051b,0x15a));var _0xb051=function(_0x2a4e8c,_0x59e704){_0x2a4e8c=_0x2a4e8c-0x0;var _0x4dc512=_0x051b[_0x2a4e8c];return _0x4dc512;};'use strict';var _=require(_0xb051('0x0'));var util=require(_0xb051('0x1'));var moment=require('moment');var BPromise=require(_0xb051('0x2'));var rs=require(_0xb051('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb051('0x4'))['db'];var utils=require(_0xb051('0x5'));var logger=require('../../config/logger')(_0xb051('0x6'));var config=require(_0xb051('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb051('0x8')][_0xb051('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfbb55d,_0x1b0725,_0x37354a){return new BPromise(function(_0x3dd668,_0x3edd7f){return client[_0xb051('0xa')](_0xfbb55d,_0x37354a)[_0xb051('0xb')](function(_0x1d21cc){logger[_0xb051('0xc')](_0xb051('0xd'),_0x1b0725,_0xb051('0xe'));logger[_0xb051('0xf')](_0xb051('0x10'),_0x1b0725,_0xb051('0xe'),JSON[_0xb051('0x11')](_0x1d21cc));if(_0x1d21cc['error']){if(_0x1d21cc[_0xb051('0x12')]['code']===0x1f4){logger[_0xb051('0x12')](_0xb051('0xd'),_0x1b0725,_0x1d21cc[_0xb051('0x12')][_0xb051('0x13')]);return _0x3edd7f(_0x1d21cc[_0xb051('0x12')][_0xb051('0x13')]);}logger[_0xb051('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1b0725,_0x1d21cc[_0xb051('0x12')]['message']);return _0x3dd668(_0x1d21cc['error'][_0xb051('0x13')]);}else{logger[_0xb051('0xc')](_0xb051('0xd'),_0x1b0725,'request\x20sent');_0x3dd668(_0x1d21cc[_0xb051('0x14')][_0xb051('0x13')]);}})[_0xb051('0x15')](function(_0x514634){logger['error'](_0xb051('0xd'),_0x1b0725,_0x514634);_0x3edd7f(_0x514634);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 04214cf..67c858c 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd95c=['online','name','status','join','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','sequelize','sync','then','info','start','Online\x20apps:','map','filter'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xd95c,0x1dc));var _0xcd95=function(_0x261e4d,_0x562df4){_0x261e4d=_0x261e4d-0x0;var _0x44eeb9=_0xd95c[_0x261e4d];return _0x44eeb9;};'use strict';var _=require(_0xcd95('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0xcd95('0x1'));var config=require(_0xcd95('0x2'));var logger=require(_0xcd95('0x3'))(_0xcd95('0x4'));var pm2=require(_0xcd95('0x5'));var pm2Config=require(_0xcd95('0x6'));var schedule=require(_0xcd95('0x7'));var chat=require('./config/schedule/chat');var whatsapp=require(_0xcd95('0x8'));var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0xcd95('0x9')][_0xcd95('0xa')]()[_0xcd95('0xb')](function(){return rpc['listen']();})[_0xcd95('0xb')](function(_0x36ed4a){logger[_0xcd95('0xc')](_0x36ed4a);return chat['start']();})[_0xcd95('0xb')](function(){return whatsapp['start']();})[_0xcd95('0xb')](function(){return schedule[_0xcd95('0xd')]();})['then'](function(){return transcribe[_0xcd95('0xd')]();})['then'](function(_0xf80155){logger[_0xcd95('0xc')](_0xf80155);return pm2[_0xcd95('0xd')](pm2Config);})[_0xcd95('0xb')](function(_0x1a2cda){logger[_0xcd95('0xc')](_0xcd95('0xe'),_[_0xcd95('0xf')](_[_0xcd95('0x10')](_0x1a2cda,{'status':_0xcd95('0x11')}),_0xcd95('0x12'))['join']());logger[_0xcd95('0xc')]('Offline\x20apps:',_['map'](_[_0xcd95('0x10')](_0x1a2cda,function(_0x1c359d){return _0x1c359d[_0xcd95('0x13')]!==_0xcd95('0x11');}),'name')[_0xcd95('0x14')]()||'None');config[_0xcd95('0x15')]&&require(_0xcd95('0x16'))[_0xcd95('0x17')]();require(_0xcd95('0x18'))[_0xcd95('0x17')]();})[_0xcd95('0x19')](function(_0x3787ec){logger[_0xcd95('0x1a')](_0xcd95('0x1b'),_0x3787ec);process[_0xcd95('0x1c')](0x1);});}main(); \ No newline at end of file +var _0x9769=['./config/schedule/chat','./config/schedule/whatsapp','sequelize','sync','then','listen','info','start','Online\x20apps:','filter','join','Offline\x20apps:','map','status','online','name','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2/config'];(function(_0x224b23,_0x481a79){var _0x52b348=function(_0x5a76d9){while(--_0x5a76d9){_0x224b23['push'](_0x224b23['shift']());}};_0x52b348(++_0x481a79);}(_0x9769,0x143));var _0x9976=function(_0x1d7566,_0x4298a4){_0x1d7566=_0x1d7566-0x0;var _0x1c5946=_0x9769[_0x1d7566];return _0x1c5946;};'use strict';var _=require(_0x9976('0x0'));var mysqldb=require(_0x9976('0x1'));var rpc=require(_0x9976('0x2'));var config=require(_0x9976('0x3'));var logger=require(_0x9976('0x4'))(_0x9976('0x5'));var pm2=require('./config/pm2');var pm2Config=require(_0x9976('0x6'));var schedule=require('./config/schedule');var chat=require(_0x9976('0x7'));var whatsapp=require(_0x9976('0x8'));var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0x9976('0x9')][_0x9976('0xa')]()[_0x9976('0xb')](function(){return rpc[_0x9976('0xc')]();})[_0x9976('0xb')](function(_0x443ea1){logger[_0x9976('0xd')](_0x443ea1);return chat[_0x9976('0xe')]();})['then'](function(){return whatsapp[_0x9976('0xe')]();})[_0x9976('0xb')](function(){return schedule[_0x9976('0xe')]();})['then'](function(){return transcribe['start']();})[_0x9976('0xb')](function(_0x25d740){logger['info'](_0x25d740);return pm2['start'](pm2Config);})[_0x9976('0xb')](function(_0x342239){logger[_0x9976('0xd')](_0x9976('0xf'),_['map'](_[_0x9976('0x10')](_0x342239,{'status':'online'}),'name')[_0x9976('0x11')]());logger[_0x9976('0xd')](_0x9976('0x12'),_[_0x9976('0x13')](_['filter'](_0x342239,function(_0x28dedc){return _0x28dedc[_0x9976('0x14')]!==_0x9976('0x15');}),_0x9976('0x16'))[_0x9976('0x11')]()||'None');config[_0x9976('0x17')]&&require(_0x9976('0x18'))[_0x9976('0x19')]();require(_0x9976('0x1a'))['default']();})[_0x9976('0x1b')](function(_0x2ea54e){logger[_0x9976('0x1c')](_0x9976('0x1d'),_0x2ea54e);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 7303e2b..577bed7 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 _0x3446=['selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','unmanaged','Forbidden.','catch','headers','authorization','startsWith','User','find','pass','json','Wrong\x20credentials.','Bearer','status','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','isNil','generateApiKey','regenerateApiKey','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','ValidationError','splice','unshift','encryptString','join','sign','secret','payload','options','promisify','randomBytes','toString','hex','floor','now','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','crypto','bluebird','util','moment','secrets','session','role','fullname','name','internal','email','userpic','md5secret','voicePause','mailPause','faxPause','smsPause','showWebBar','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','hotdesk','interface','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','ignorePauseForPreviewCalls'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x3446,0x14c));var _0x6344=function(_0x39c24f,_0x5b64af){_0x39c24f=_0x39c24f-0x0;var _0x37316e=_0x3446[_0x39c24f];return _0x37316e;};'use strict';var db=require(_0x6344('0x0'))['db'];var config=require(_0x6344('0x1'));var hardwareConf=require(_0x6344('0x2'));var licenseUtil=require(_0x6344('0x3'));var encryptor=require(_0x6344('0x4'));var _=require(_0x6344('0x5'));var jwt=require(_0x6344('0x6'));var expressJwt=require(_0x6344('0x7'));var compose=require(_0x6344('0x8'));var basicAuth=require('basic-auth');var crypto=require(_0x6344('0x9'));var BPromise=require(_0x6344('0xa'));var util=require(_0x6344('0xb'));var moment=require(_0x6344('0xc'));var validateJwt=expressJwt({'secret':config[_0x6344('0xd')][_0x6344('0xe')]});var userAttributes=['id',_0x6344('0xf'),_0x6344('0x10'),_0x6344('0x11'),_0x6344('0x12'),_0x6344('0x13'),_0x6344('0x14'),'permissions',_0x6344('0x15'),_0x6344('0x16'),'chatPause',_0x6344('0x17'),_0x6344('0x18'),_0x6344('0x19'),'openchannelPause','pauseType',_0x6344('0x1a'),'lastLoginAt','lastPauseAt','crudPermissions',_0x6344('0x1b'),_0x6344('0x1c'),_0x6344('0x1d'),_0x6344('0x1e'),_0x6344('0x1f'),'phoneBarDnd',_0x6344('0x20'),'phoneBarEnableDtmfTone',_0x6344('0x21'),_0x6344('0x22'),'phoneBarPrefixRequired',_0x6344('0x23'),'phoneBarRemoteControlPort',_0x6344('0x24'),_0x6344('0x25'),'userProfileId',_0x6344('0x26'),_0x6344('0x27'),'wssPort',_0x6344('0x28'),_0x6344('0x29'),'downloadAttachments',_0x6344('0x2a'),_0x6344('0x2b')];exports[_0x6344('0x2c')]=function(){return this[_0x6344('0x2d')](!![])[_0x6344('0x2e')](function(_0x408493,_0x140860,_0x101a2f){if(_0x408493[_0x6344('0x2f')]){_0x101a2f();}else{return db[_0x6344('0x30')][_0x6344('0x31')]({'where':{'id':_0x408493[_0x6344('0x32')]['id']},'attributes':['id',_0x6344('0x33'),_0x6344('0x34')],'raw':!![]})[_0x6344('0x35')](function(_0x43da05){if(_0x43da05&&_0x43da05[_0x6344('0x33')]){return _0x140860['status'](_0x43da05[_0x6344('0x34')]===_0x6344('0x36')?0x195:0x193)['json']({'message':_0x43da05[_0x6344('0x34')]===_0x6344('0x36')?'Unmanaged.':_0x6344('0x37')});}else{_0x101a2f();}})[_0x6344('0x38')](function(_0xb95551){_0x101a2f(_0xb95551);});}});};exports[_0x6344('0x2d')]=function isAuthenticated(_0x20bfbb){return compose()[_0x6344('0x2e')](function(_0x38cfea,_0x2d9096,_0x52af7d){var _0x333e04;if(_0x38cfea[_0x6344('0x39')][_0x6344('0x3a')]){if(_[_0x6344('0x3b')](_0x38cfea[_0x6344('0x39')][_0x6344('0x3a')],'Basic')){var _0x24020a=basicAuth(_0x38cfea);db[_0x6344('0x3c')][_0x6344('0x3d')]({'where':{'name':_0x24020a[_0x6344('0x11')]}})[_0x6344('0x35')](function(_0x129b0f){if(!_0x129b0f||!_0x129b0f['authenticate'](_0x24020a[_0x6344('0x3e')])){return _0x2d9096['status'](0x191)[_0x6344('0x3f')]({'message':_0x6344('0x40')});}_0x38cfea[_0x6344('0x2f')]={'id':_0x129b0f['id']};_0x52af7d();})[_0x6344('0x38')](function(_0x2a1fd1){_0x52af7d(_0x2a1fd1);});}else if(_[_0x6344('0x3b')](_0x38cfea['headers'][_0x6344('0x3a')],_0x6344('0x41'))){validateJwt(_0x38cfea,_0x2d9096,_0x52af7d);}else{if(_0x20bfbb){_0x52af7d();}else{return _0x2d9096[_0x6344('0x42')](0x193)[_0x6344('0x3f')]({'message':_0x6344('0x43')});}}}else if(_0x38cfea[_0x6344('0x44')][_0x6344('0x45')]){try{var _0x5bd8bb={'audience':hardwareConf[_0x6344('0x46')](),'issuer':hardwareConf[_0x6344('0x46')]()};verifyJwt(_0x38cfea[_0x6344('0x44')][_0x6344('0x45')],_0x5bd8bb)[_0x6344('0x35')](function(_0x110665){return db[_0x6344('0x3c')][_0x6344('0x3d')]({'where':{'id':_0x110665[_0x6344('0x47')]}})[_0x6344('0x35')](function(_0x318aaf){_0x333e04=_0x318aaf;return db[_0x6344('0x48')][_0x6344('0x31')]({'where':{'id':0x1},'attributes':[_0x6344('0x49'),_0x6344('0x4a')],'raw':!![]});})[_0x6344('0x35')](function(_0x22204b){if(!_0x333e04||!_[_0x6344('0x4b')](_0x333e04[_0x6344('0x4c')],_0x110665['nonce'])){return _0x2d9096[_0x6344('0x42')](0x191)[_0x6344('0x3f')]({'message':_0x6344('0x4d')});}if(_0x333e04[_0x6344('0x4e')]){return _0x2d9096['status'](0x191)[_0x6344('0x3f')]({'message':_0x6344('0x4f')});}if(_0x333e04[_0x6344('0x50')]){if(_0x22204b[_0x6344('0x4a')]>0x0){if(moment(_0x333e04[_0x6344('0x51')])['add'](_0x22204b[_0x6344('0x4a')],_0x6344('0x52'))>moment()){return _0x2d9096[_0x6344('0x42')](0x191)[_0x6344('0x3f')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x2d9096['status'](0x191)[_0x6344('0x3f')]({'message':_0x6344('0x4f')});}}_0x38cfea[_0x6344('0x2f')]={'id':_0x333e04['id']};_0x52af7d();});})[_0x6344('0x38')](function(){return _0x2d9096[_0x6344('0x42')](0x191)[_0x6344('0x3f')]({'message':_0x6344('0x4f')});});}catch(_0x5f5613){_0x52af7d(_0x5f5613);}}else if(_0x20bfbb){_0x52af7d();}else{return _0x2d9096[_0x6344('0x42')](0x193)[_0x6344('0x3f')]({'message':_0x6344('0x43')});}})['use'](function(_0x5d9d37,_0x28d7cf,_0x32dd47){if(_0x5d9d37[_0x6344('0x2f')]){db[_0x6344('0x3c')]['find']({'where':{'id':_0x5d9d37['user']['id']},'attributes':userAttributes})['then'](function(_0x4fb53f){if(!_0x4fb53f){return _0x28d7cf['status'](0x194)[_0x6344('0x3f')]({'message':_0x6344('0x53')});}_0x5d9d37[_0x6344('0x2f')]=_0x4fb53f;_0x32dd47();})[_0x6344('0x38')](function(_0x4e7898){_0x32dd47(_0x4e7898);});}else if(_0x20bfbb){_0x32dd47();}else{return _0x28d7cf[_0x6344('0x42')](0x194)[_0x6344('0x3f')]({'message':_0x6344('0x54')});}});};exports[_0x6344('0x55')]=function canUpdate(){return compose()[_0x6344('0x2e')](function(_0x36b079,_0x57a534,_0x119553){return licenseUtil[_0x6344('0x56')]()[_0x6344('0x35')](function(_0x7fc5c1){if(_0x7fc5c1['update']){_0x119553();}else{return _0x57a534['status'](0x193)[_0x6344('0x3f')]({'message':_0x6344('0x57')});}})[_0x6344('0x38')](function(_0x308138){_0x119553(_0x308138);});});};exports[_0x6344('0x58')]=function isWebrtcLicence(){return compose()[_0x6344('0x2e')](function(_0x487563,_0x470d2d,_0xdaa8d5){return licenseUtil['getLicense']()[_0x6344('0x35')](function(_0x3e89a7){if(_0x3e89a7[_0x6344('0x59')]){_0xdaa8d5();}else{return _0x470d2d['status'](0x193)[_0x6344('0x3f')]({'message':_0x6344('0x57')});}})[_0x6344('0x38')](function(_0x1563e5){_0xdaa8d5(_0x1563e5);});});};exports[_0x6344('0x5a')]=function(_0x51586f,_0x551e1,_0x1502dc){_0x51586f[_0x6344('0x5a')]=!![];return _0x1502dc();};exports[_0x6344('0x5b')]=function signToken(_0x5b0142){return signJwt(_0x5b0142);};exports[_0x6344('0x5c')]=function(_0x3f6334,_0x4e240b){if(!_0x3f6334[_0x6344('0x2f')]){return _0x4e240b['status'](0x194)['json']({'message':_0x6344('0x5d')});}var _0x4625b5={'payload':{'id':_0x3f6334['user']['id'],'role':_0x3f6334[_0x6344('0x2f')][_0x6344('0xf')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4625b5)[_0x6344('0x35')](function(_0x2d5edc){_0x4e240b[_0x6344('0x5e')](_0x6344('0x5f'),_0x2d5edc);_0x4e240b[_0x6344('0x60')]('/dashboards/general');})[_0x6344('0x38')](function(_0x478a92){return _0x4e240b['status'](0x1f4)['send'](_0x478a92);});};exports['retrieveApiKey']=function(_0x4b34c7){if(_[_0x6344('0x61')](_0x4b34c7['apiKeyNonce'])||_[_0x6344('0x61')](_0x4b34c7['apiKeyIat'])){return null;}else{return createJwt(_0x4b34c7);}};exports[_0x6344('0x62')]=function(_0x1e4529){_0x1e4529[_0x6344('0x4c')]=generateNonce();_0x1e4529['apiKeyIat']=generateIssuedAt();return createJwt(_0x1e4529);};exports[_0x6344('0x63')]=function(_0x47cff1,_0x3da52e){var _0x5f0193=_0x47cff1[_0x6344('0x44')][_0x6344('0x45')];if(_0x5f0193){var _0x1fb4d8={'nonce':_0x3da52e[_0x6344('0x4c')],'iat':_0x3da52e[_0x6344('0x64')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x5f0193,_0x1fb4d8)[_0x6344('0x35')](function(){return generateApiKey(_0x3da52e);});}else{throw{'message':_0x6344('0x65')};}};exports[_0x6344('0x66')]=function(_0xbf959d){var _0x42081f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x42081f['test'](_0xbf959d))throw new db['Sequelize']['ValidationError'](_0x6344('0x67'));return;};exports['validatePasswordHistory']=function(_0x5184c7,_0x3eff5e,_0x2dc76c){var _0x4b5e1b=encryptor[_0x6344('0x68')](_0x3eff5e)[_0x6344('0x69')](',');for(var _0x10e41c=0x0;_0x10e41c<_0x2dc76c;_0x10e41c++){if(!_0x4b5e1b[_0x10e41c])break;if(_0x5184c7[_0x6344('0x6a')]()===_0x4b5e1b[_0x10e41c]['toLowerCase']()){var _0x1d1a46=util[_0x6344('0x6b')](_0x6344('0x6c'),_0x2dc76c);if(_0x2dc76c===0x1){_0x1d1a46=_0x6344('0x6d');}throw new db['Sequelize'][(_0x6344('0x6e'))](_0x1d1a46);}}return;};exports['updatePasswordsHistory']=function(_0x3ed9b5,_0x2354fc){var _0xebeae=_0x2354fc?encryptor['decryptString'](_0x2354fc)[_0x6344('0x69')](','):[];if(_0xebeae['length']===0x5){_0xebeae[_0x6344('0x6f')](-0x1,0x1);}_0xebeae[_0x6344('0x70')](_0x3ed9b5);return encryptor[_0x6344('0x71')](_0xebeae[_0x6344('0x72')](','));};function signJwt(_0x5ddf83){var _0x14c0cb=BPromise['promisify'](jwt[_0x6344('0x73')],{'context':jwt});var _0x5a6060=_0x5ddf83[_0x6344('0x74')]||config[_0x6344('0xd')]['session'];return new BPromise(function(_0x2783ac,_0x28d488){_0x14c0cb(_0x5ddf83[_0x6344('0x75')],_0x5a6060,_0x5ddf83[_0x6344('0x76')])[_0x6344('0x35')](function(_0x332e5d){_0x2783ac(_0x332e5d);})['catch'](function(_0x2cdfa1){_0x28d488(_0x2cdfa1);});});}function verifyJwt(_0xd4c8a2,_0x49fa62,_0x2e2e4a){var _0x57c442=BPromise[_0x6344('0x77')](jwt['verify'],{'context':jwt});var _0x56d665=_0x2e2e4a||config[_0x6344('0xd')][_0x6344('0xe')];return new BPromise(function(_0x316561,_0x381293){_0x57c442(_0xd4c8a2,_0x56d665,_0x49fa62)[_0x6344('0x35')](function(_0x2f191d){_0x316561(_0x2f191d);})['catch'](function(_0xf7d0e6){_0x381293(_0xf7d0e6);});});}function generateNonce(){return crypto[_0x6344('0x78')](0x10)[_0x6344('0x79')](_0x6344('0x7a'));}function generateIssuedAt(){return Math[_0x6344('0x7b')](Date[_0x6344('0x7c')]()/0x3e8)['toString']();}function createJwt(_0x5a5dc7){var _0x2cbe40={'payload':{'iat':_0x5a5dc7['apiKeyIat'],'nonce':_0x5a5dc7[_0x6344('0x4c')]},'options':{'algorithm':'HS512','subject':_0x5a5dc7['id']['toString'](),'issuer':hardwareConf[_0x6344('0x46')](),'audience':hardwareConf[_0x6344('0x46')]()}};return signJwt(_0x2cbe40)[_0x6344('0x35')](function(_0x12ae34){return{'iat':_0x5a5dc7[_0x6344('0x64')],'nonce':_0x5a5dc7[_0x6344('0x4c')],'token':_0x12ae34};});} \ No newline at end of file +var _0x2d57=['unshift','promisify','sign','secret','payload','options','verify','randomBytes','toString','hex','now','HS512','../../config/environment','../../config/license/util','../encryptor','lodash','jsonwebtoken','composable-middleware','basic-auth','bluebird','util','moment','secrets','role','fullname','internal','email','userpic','permissions','md5secret','voicePause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','use','user','findOne','params','closed','disposition','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','find','name','then','authenticate','pass','status','json','Wrong\x20credentials.','startsWith','Bearer','query','apikey','getUuid','User','sub','Setting','allowedLoginAttempts','blockDuration','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blockedAt','add','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','isNil','apiKeyNonce','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','Sequelize','ValidationError','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','length'];(function(_0x2dbce7,_0x57cb8d){var _0x3a3ed0=function(_0x28c8c6){while(--_0x28c8c6){_0x2dbce7['push'](_0x2dbce7['shift']());}};_0x3a3ed0(++_0x57cb8d);}(_0x2d57,0x17a));var _0x72d5=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0x2d57[_0x256b72];return _0x2183e3;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x72d5('0x0'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x72d5('0x1'));var encryptor=require(_0x72d5('0x2'));var _=require(_0x72d5('0x3'));var jwt=require(_0x72d5('0x4'));var expressJwt=require('express-jwt');var compose=require(_0x72d5('0x5'));var basicAuth=require(_0x72d5('0x6'));var crypto=require('crypto');var BPromise=require(_0x72d5('0x7'));var util=require(_0x72d5('0x8'));var moment=require(_0x72d5('0x9'));var validateJwt=expressJwt({'secret':config[_0x72d5('0xa')]['session']});var userAttributes=['id',_0x72d5('0xb'),_0x72d5('0xc'),'name',_0x72d5('0xd'),_0x72d5('0xe'),_0x72d5('0xf'),_0x72d5('0x10'),_0x72d5('0x11'),_0x72d5('0x12'),'chatPause','mailPause',_0x72d5('0x13'),_0x72d5('0x14'),_0x72d5('0x15'),_0x72d5('0x16'),_0x72d5('0x17'),_0x72d5('0x18'),'lastPauseAt','crudPermissions',_0x72d5('0x19'),_0x72d5('0x1a'),'alias',_0x72d5('0x1b'),'phoneBarAutoAnswerDelay',_0x72d5('0x1c'),'phoneBarEnableRecording',_0x72d5('0x1d'),_0x72d5('0x1e'),_0x72d5('0x1f'),_0x72d5('0x20'),_0x72d5('0x21'),_0x72d5('0x22'),_0x72d5('0x23'),_0x72d5('0x24'),_0x72d5('0x25'),_0x72d5('0x26'),_0x72d5('0x27'),'wssPort',_0x72d5('0x28'),_0x72d5('0x29'),_0x72d5('0x2a'),_0x72d5('0x2b'),_0x72d5('0x2c')];exports[_0x72d5('0x2d')]=function(){return this[_0x72d5('0x2e')](!![])[_0x72d5('0x2f')](function(_0x472e5a,_0x5005f4,_0x461db3){if(_0x472e5a[_0x72d5('0x30')]){_0x461db3();}else{return db['ChatInteraction'][_0x72d5('0x31')]({'where':{'id':_0x472e5a[_0x72d5('0x32')]['id']},'attributes':['id',_0x72d5('0x33'),_0x72d5('0x34')],'raw':!![]})['then'](function(_0x31f418){if(_0x31f418&&_0x31f418[_0x72d5('0x33')]){return _0x5005f4['status'](_0x31f418[_0x72d5('0x34')]==='unmanaged'?0x195:0x193)['json']({'message':_0x31f418['disposition']===_0x72d5('0x35')?_0x72d5('0x36'):_0x72d5('0x37')});}else{_0x461db3();}})[_0x72d5('0x38')](function(_0x3808e6){_0x461db3(_0x3808e6);});}});};exports[_0x72d5('0x2e')]=function isAuthenticated(_0x3d9544){return compose()['use'](function(_0x4f7337,_0x380b6b,_0x8c55e3){var _0x1d083f;if(_0x4f7337[_0x72d5('0x39')][_0x72d5('0x3a')]){if(_['startsWith'](_0x4f7337[_0x72d5('0x39')][_0x72d5('0x3a')],'Basic')){var _0x55a93f=basicAuth(_0x4f7337);db['User'][_0x72d5('0x3b')]({'where':{'name':_0x55a93f[_0x72d5('0x3c')]}})[_0x72d5('0x3d')](function(_0x103502){if(!_0x103502||!_0x103502[_0x72d5('0x3e')](_0x55a93f[_0x72d5('0x3f')])){return _0x380b6b[_0x72d5('0x40')](0x191)[_0x72d5('0x41')]({'message':_0x72d5('0x42')});}_0x4f7337[_0x72d5('0x30')]={'id':_0x103502['id']};_0x8c55e3();})[_0x72d5('0x38')](function(_0x2d2684){_0x8c55e3(_0x2d2684);});}else if(_[_0x72d5('0x43')](_0x4f7337[_0x72d5('0x39')][_0x72d5('0x3a')],_0x72d5('0x44'))){validateJwt(_0x4f7337,_0x380b6b,_0x8c55e3);}else{if(_0x3d9544){_0x8c55e3();}else{return _0x380b6b[_0x72d5('0x40')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x4f7337[_0x72d5('0x45')][_0x72d5('0x46')]){try{var _0x31494d={'audience':hardwareConf[_0x72d5('0x47')](),'issuer':hardwareConf[_0x72d5('0x47')]()};verifyJwt(_0x4f7337[_0x72d5('0x45')][_0x72d5('0x46')],_0x31494d)['then'](function(_0x23d15e){return db[_0x72d5('0x48')][_0x72d5('0x3b')]({'where':{'id':_0x23d15e[_0x72d5('0x49')]}})[_0x72d5('0x3d')](function(_0x543d08){_0x1d083f=_0x543d08;return db[_0x72d5('0x4a')][_0x72d5('0x31')]({'where':{'id':0x1},'attributes':[_0x72d5('0x4b'),_0x72d5('0x4c')],'raw':!![]});})['then'](function(_0x21ee1b){if(!_0x1d083f||!_['isEqual'](_0x1d083f['apiKeyNonce'],_0x23d15e[_0x72d5('0x4d')])){return _0x380b6b[_0x72d5('0x40')](0x191)[_0x72d5('0x41')]({'message':_0x72d5('0x4e')});}if(_0x1d083f['disabled']){return _0x380b6b[_0x72d5('0x40')](0x191)['json']({'message':_0x72d5('0x4f')});}if(_0x1d083f['blocked']){if(_0x21ee1b[_0x72d5('0x4c')]>0x0){if(moment(_0x1d083f[_0x72d5('0x50')])[_0x72d5('0x51')](_0x21ee1b[_0x72d5('0x4c')],_0x72d5('0x52'))>moment()){return _0x380b6b[_0x72d5('0x40')](0x191)[_0x72d5('0x41')]({'message':_0x72d5('0x4f')});}}else{return _0x380b6b[_0x72d5('0x40')](0x191)['json']({'message':_0x72d5('0x4f')});}}_0x4f7337[_0x72d5('0x30')]={'id':_0x1d083f['id']};_0x8c55e3();});})[_0x72d5('0x38')](function(){return _0x380b6b['status'](0x191)[_0x72d5('0x41')]({'message':_0x72d5('0x4f')});});}catch(_0x209a16){_0x8c55e3(_0x209a16);}}else if(_0x3d9544){_0x8c55e3();}else{return _0x380b6b[_0x72d5('0x40')](0x193)['json']({'message':_0x72d5('0x53')});}})[_0x72d5('0x2f')](function(_0x426eae,_0x1e57ad,_0xd2a8c3){if(_0x426eae[_0x72d5('0x30')]){db[_0x72d5('0x48')][_0x72d5('0x3b')]({'where':{'id':_0x426eae[_0x72d5('0x30')]['id']},'attributes':userAttributes})['then'](function(_0x662765){if(!_0x662765){return _0x1e57ad['status'](0x194)[_0x72d5('0x41')]({'message':_0x72d5('0x54')});}_0x426eae[_0x72d5('0x30')]=_0x662765;_0xd2a8c3();})[_0x72d5('0x38')](function(_0x365903){_0xd2a8c3(_0x365903);});}else if(_0x3d9544){_0xd2a8c3();}else{return _0x1e57ad[_0x72d5('0x40')](0x194)[_0x72d5('0x41')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x72d5('0x55')]=function canUpdate(){return compose()[_0x72d5('0x2f')](function(_0x1fe88c,_0x2944e6,_0x591a0e){return licenseUtil[_0x72d5('0x56')]()[_0x72d5('0x3d')](function(_0x4bab51){if(_0x4bab51['update']){_0x591a0e();}else{return _0x2944e6[_0x72d5('0x40')](0x193)['json']({'message':_0x72d5('0x57')});}})[_0x72d5('0x38')](function(_0x134090){_0x591a0e(_0x134090);});});};exports[_0x72d5('0x58')]=function isWebrtcLicence(){return compose()[_0x72d5('0x2f')](function(_0x2706f5,_0x582a86,_0x4ac459){return licenseUtil['getLicense']()[_0x72d5('0x3d')](function(_0x514476){if(_0x514476[_0x72d5('0x59')]){_0x4ac459();}else{return _0x582a86[_0x72d5('0x40')](0x193)[_0x72d5('0x41')]({'message':_0x72d5('0x57')});}})[_0x72d5('0x38')](function(_0xe79804){_0x4ac459(_0xe79804);});});};exports[_0x72d5('0x5a')]=function(_0x42d536,_0x996a45,_0x2d02dd){_0x42d536[_0x72d5('0x5a')]=!![];return _0x2d02dd();};exports[_0x72d5('0x5b')]=function signToken(_0x2ead56){return signJwt(_0x2ead56);};exports[_0x72d5('0x5c')]=function(_0x62de0d,_0x134556){if(!_0x62de0d[_0x72d5('0x30')]){return _0x134556[_0x72d5('0x40')](0x194)['json']({'message':_0x72d5('0x5d')});}var _0x521bb1={'payload':{'id':_0x62de0d[_0x72d5('0x30')]['id'],'role':_0x62de0d[_0x72d5('0x30')][_0x72d5('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x521bb1)[_0x72d5('0x3d')](function(_0x2a5838){_0x134556['cookie'](_0x72d5('0x5e'),_0x2a5838);_0x134556[_0x72d5('0x5f')]('/dashboards/general');})[_0x72d5('0x38')](function(_0x3d08ea){return _0x134556['status'](0x1f4)['send'](_0x3d08ea);});};exports['retrieveApiKey']=function(_0x3df383){if(_[_0x72d5('0x60')](_0x3df383[_0x72d5('0x61')])||_[_0x72d5('0x60')](_0x3df383[_0x72d5('0x62')])){return null;}else{return createJwt(_0x3df383);}};exports[_0x72d5('0x63')]=function(_0x5a0e41){_0x5a0e41[_0x72d5('0x61')]=generateNonce();_0x5a0e41[_0x72d5('0x62')]=generateIssuedAt();return createJwt(_0x5a0e41);};exports[_0x72d5('0x64')]=function(_0x4e82c4,_0x16c16a){var _0x3a4a1b=_0x4e82c4[_0x72d5('0x45')]['apikey'];if(_0x3a4a1b){var _0x9f3aa={'nonce':_0x16c16a[_0x72d5('0x61')],'iat':_0x16c16a[_0x72d5('0x62')],'audience':hardwareConf[_0x72d5('0x47')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x3a4a1b,_0x9f3aa)[_0x72d5('0x3d')](function(){return generateApiKey(_0x16c16a);});}else{throw{'message':_0x72d5('0x65')};}};exports['validatePasswordPattern']=function(_0x21dbfa){var _0x25e5e1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x25e5e1['test'](_0x21dbfa))throw new db[(_0x72d5('0x66'))][(_0x72d5('0x67'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports['validatePasswordHistory']=function(_0x4fbce7,_0x4a3aee,_0x1820b7){var _0x398555=encryptor[_0x72d5('0x68')](_0x4a3aee)[_0x72d5('0x69')](',');for(var _0x37bd0a=0x0;_0x37bd0a<_0x1820b7;_0x37bd0a++){if(!_0x398555[_0x37bd0a])break;if(_0x4fbce7[_0x72d5('0x6a')]()===_0x398555[_0x37bd0a][_0x72d5('0x6a')]()){var _0x335bee=util[_0x72d5('0x6b')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x1820b7);if(_0x1820b7===0x1){_0x335bee=_0x72d5('0x6c');}throw new db[(_0x72d5('0x66'))][(_0x72d5('0x67'))](_0x335bee);}}return;};exports['updatePasswordsHistory']=function(_0xe9bfc4,_0x5d2cab){var _0x1b660d=_0x5d2cab?encryptor[_0x72d5('0x68')](_0x5d2cab)[_0x72d5('0x69')](','):[];if(_0x1b660d[_0x72d5('0x6d')]===0x5){_0x1b660d['splice'](-0x1,0x1);}_0x1b660d[_0x72d5('0x6e')](_0xe9bfc4);return encryptor['encryptString'](_0x1b660d['join'](','));};function signJwt(_0x4562e1){var _0x17b9c4=BPromise[_0x72d5('0x6f')](jwt[_0x72d5('0x70')],{'context':jwt});var _0x3e9e34=_0x4562e1[_0x72d5('0x71')]||config['secrets']['session'];return new BPromise(function(_0x43a05c,_0x4627d6){_0x17b9c4(_0x4562e1[_0x72d5('0x72')],_0x3e9e34,_0x4562e1[_0x72d5('0x73')])['then'](function(_0x25962e){_0x43a05c(_0x25962e);})[_0x72d5('0x38')](function(_0x47c738){_0x4627d6(_0x47c738);});});}function verifyJwt(_0x3a2e61,_0x2e9573,_0x34c20d){var _0x5b59b8=BPromise[_0x72d5('0x6f')](jwt[_0x72d5('0x74')],{'context':jwt});var _0x2b20b4=_0x34c20d||config[_0x72d5('0xa')]['session'];return new BPromise(function(_0x5034e7,_0x284964){_0x5b59b8(_0x3a2e61,_0x2b20b4,_0x2e9573)[_0x72d5('0x3d')](function(_0x3de33f){_0x5034e7(_0x3de33f);})[_0x72d5('0x38')](function(_0x22e89e){_0x284964(_0x22e89e);});});}function generateNonce(){return crypto[_0x72d5('0x75')](0x10)[_0x72d5('0x76')](_0x72d5('0x77'));}function generateIssuedAt(){return Math['floor'](Date[_0x72d5('0x78')]()/0x3e8)[_0x72d5('0x76')]();}function createJwt(_0x3aca5e){var _0x240a17={'payload':{'iat':_0x3aca5e[_0x72d5('0x62')],'nonce':_0x3aca5e[_0x72d5('0x61')]},'options':{'algorithm':_0x72d5('0x79'),'subject':_0x3aca5e['id']['toString'](),'issuer':hardwareConf[_0x72d5('0x47')](),'audience':hardwareConf[_0x72d5('0x47')]()}};return signJwt(_0x240a17)[_0x72d5('0x3d')](function(_0x450120){return{'iat':_0x3aca5e[_0x72d5('0x62')],'nonce':_0x3aca5e[_0x72d5('0x61')],'token':_0x450120};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 765a1cd..e7e6360 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 _0xff43=['utf8','base64','decryptString','secret','crypto','lodash','../../config/environment','../../config/logger','app','secrets','aes-256-ctr','aes192','encrypt','algorithm','error','test','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createCipher','data','binary','write','end','close','decryptFile','createWriteStream','createDecipher','update','final','unlink','encryptString'];(function(_0x5d697c,_0x324474){var _0x39e581=function(_0x546e9c){while(--_0x546e9c){_0x5d697c['push'](_0x5d697c['shift']());}};_0x39e581(++_0x324474);}(_0xff43,0x136));var _0x3ff4=function(_0x2cd4b0,_0x1d377d){_0x2cd4b0=_0x2cd4b0-0x0;var _0x455c3f=_0xff43[_0x2cd4b0];return _0x455c3f;};'use strict';var crypto=require(_0x3ff4('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x3ff4('0x1'));var config=require(_0x3ff4('0x2'));var logger=require(_0x3ff4('0x3'))(_0x3ff4('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x3ff4('0x5')]['session'],'algorithm':_0x3ff4('0x6')};const fileOptions={'algorithm':_0x3ff4('0x7')};if(config[_0x3ff4('0x8')]&&config['encrypt']['algorithm']){var isSupported=isAlgorithmSupported(config[_0x3ff4('0x8')][_0x3ff4('0x9')]);if(isSupported){fileOptions[_0x3ff4('0x9')]=config['encrypt'][_0x3ff4('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x3ff4('0xa')](config['encrypt']['algorithm'],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x4761bc){return AES_SUPPORTED_RX[_0x3ff4('0xb')](_0x4761bc);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x3ff4('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x58c379){return getSupportedCiphers()[_0x3ff4('0xd')](_0x58c379)>-0x1;}function combineOptions(_0x5c1177){var _0x35e08c={};for(var _0x50a181 in fileOptions){if(fileOptions[_0x3ff4('0xe')](_0x50a181)){_0x35e08c[_0x50a181]=fileOptions[_0x50a181];}}if(_0x5c1177){for(var _0xc868a8 in _0x5c1177){if(_0x5c1177[_0x3ff4('0xe')](_0xc868a8)){_0x35e08c[_0xc868a8]=_0x5c1177[_0xc868a8];}}}return _0x35e08c;}exports[_0x3ff4('0xf')]=function(_0x4c3566,_0x3ce2f3,_0x3f961f,_0x3e306c){return new BPromise(function(_0x41958a,_0x14f2b4){_0x3e306c=combineOptions(_0x3e306c);var _0x27c0ba=new Buffer(_0x3f961f);var _0x4745ba=fs[_0x3ff4('0x10')](_0x4c3566);var _0x4691df=fs['createWriteStream'](_0x3ce2f3);var _0x4c6e65=crypto[_0x3ff4('0x11')](_0x3e306c[_0x3ff4('0x9')],_0x27c0ba);_0x4745ba['on'](_0x3ff4('0x12'),function(_0x20ae74){var _0x59de6e=new Buffer(_0x4c6e65['update'](_0x20ae74),_0x3ff4('0x13'));_0x4691df[_0x3ff4('0x14')](_0x59de6e);});_0x4745ba['on']('end',function(){try{var _0x164b1d=new Buffer(_0x4c6e65['final']('binary'),_0x3ff4('0x13'));_0x4691df['write'](_0x164b1d);_0x4691df[_0x3ff4('0x15')]();_0x4691df['on'](_0x3ff4('0x16'),function(){return _0x41958a(_0x3ce2f3);});}catch(_0x109d51){fs['unlink'](_0x3ce2f3);return _0x14f2b4(_0x109d51);}});});};exports[_0x3ff4('0x17')]=function(_0xa7373b,_0xcf76ae,_0x32cd26,_0x8308f1){return new BPromise(function(_0x4eecf0,_0x210394){_0x8308f1=combineOptions(_0x8308f1);var _0x5dffbf=new Buffer(_0x32cd26);var _0x4c0cbd=fs['createReadStream'](_0xa7373b);var _0x39758a=fs[_0x3ff4('0x18')](_0xcf76ae);var _0x44c075=crypto[_0x3ff4('0x19')](_0x8308f1[_0x3ff4('0x9')],_0x5dffbf);_0x4c0cbd['on'](_0x3ff4('0x12'),function(_0x1eb99d){var _0x134c3a=new Buffer(_0x44c075[_0x3ff4('0x1a')](_0x1eb99d),_0x3ff4('0x13'));_0x39758a[_0x3ff4('0x14')](_0x134c3a);});_0x4c0cbd['on'](_0x3ff4('0x15'),function(){try{var _0x1d119f=new Buffer(_0x44c075[_0x3ff4('0x1b')](_0x3ff4('0x13')),'binary');_0x39758a[_0x3ff4('0x14')](_0x1d119f);_0x39758a[_0x3ff4('0x15')]();_0x39758a['on'](_0x3ff4('0x16'),function(){return _0x4eecf0(_0xcf76ae);});}catch(_0x120fe4){fs[_0x3ff4('0x1c')](_0xcf76ae);return _0x210394(_0x120fe4);}});});};exports[_0x3ff4('0x1d')]=function(_0x1a54bd,_0x4bb3b3,_0x322ef1){var _0x2878d0=_0x322ef1||stringOptions[_0x3ff4('0x9')];var _0x179677=_0x4bb3b3||stringOptions['secret'];var _0x2ed3f7=crypto[_0x3ff4('0x11')](_0x2878d0,_0x179677);var _0x6a8b8b=_0x2ed3f7[_0x3ff4('0x1a')](_0x1a54bd,_0x3ff4('0x1e'),_0x3ff4('0x1f'));_0x6a8b8b+=_0x2ed3f7[_0x3ff4('0x1b')](_0x3ff4('0x1f'));return _0x6a8b8b;};exports[_0x3ff4('0x20')]=function(_0x2375ec,_0x5f2d91,_0x5c758d){var _0x37704d=_0x5c758d||stringOptions[_0x3ff4('0x9')];var _0x3f0d06=_0x5f2d91||stringOptions[_0x3ff4('0x21')];var _0x10f6b5=crypto[_0x3ff4('0x19')](_0x37704d,_0x3f0d06);var _0x5beffb=_0x10f6b5[_0x3ff4('0x1a')](_0x2375ec,_0x3ff4('0x1f'),_0x3ff4('0x1e'));_0x5beffb+=_0x10f6b5[_0x3ff4('0x1b')](_0x3ff4('0x1e'));return _0x5beffb;}; \ No newline at end of file +var _0xdb68=['decryptFile','createDecipher','encryptString','base64','decryptString','secret','utf8','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','aes-256-ctr','aes192','encrypt','algorithm','join','error','test','getCiphers','indexOf','hasOwnProperty','encryptFile','createReadStream','createCipher','data','update','write','end','final','binary','close','unlink'];(function(_0xd99de2,_0x38b972){var _0x11a4e7=function(_0x15301a){while(--_0x15301a){_0xd99de2['push'](_0xd99de2['shift']());}};_0x11a4e7(++_0x38b972);}(_0xdb68,0x6d));var _0x8db6=function(_0x1034ca,_0x14ecd6){_0x1034ca=_0x1034ca-0x0;var _0x1a023a=_0xdb68[_0x1034ca];return _0x1a023a;};'use strict';var crypto=require(_0x8db6('0x0'));var fs=require('fs');var BPromise=require(_0x8db6('0x1'));var _=require(_0x8db6('0x2'));var config=require(_0x8db6('0x3'));var logger=require(_0x8db6('0x4'))(_0x8db6('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets']['session'],'algorithm':_0x8db6('0x6')};const fileOptions={'algorithm':_0x8db6('0x7')};if(config[_0x8db6('0x8')]&&config[_0x8db6('0x8')][_0x8db6('0x9')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x8db6('0x9')]);if(isSupported){fileOptions[_0x8db6('0x9')]=config[_0x8db6('0x8')][_0x8db6('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x8db6('0xa')](',\x20');logger[_0x8db6('0xb')](config[_0x8db6('0x8')]['algorithm'],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x739201){return AES_SUPPORTED_RX[_0x8db6('0xc')](_0x739201);}function getSupportedCiphers(){return crypto[_0x8db6('0xd')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x32b872){return getSupportedCiphers()[_0x8db6('0xe')](_0x32b872)>-0x1;}function combineOptions(_0x49f2ba){var _0x5d4d2a={};for(var _0x290471 in fileOptions){if(fileOptions['hasOwnProperty'](_0x290471)){_0x5d4d2a[_0x290471]=fileOptions[_0x290471];}}if(_0x49f2ba){for(var _0x320f63 in _0x49f2ba){if(_0x49f2ba[_0x8db6('0xf')](_0x320f63)){_0x5d4d2a[_0x320f63]=_0x49f2ba[_0x320f63];}}}return _0x5d4d2a;}exports[_0x8db6('0x10')]=function(_0x5441e8,_0x15d4e2,_0xf7ab60,_0x1acf7c){return new BPromise(function(_0xc95b1d,_0x41bfd5){_0x1acf7c=combineOptions(_0x1acf7c);var _0x4f780e=new Buffer(_0xf7ab60);var _0x4bb44d=fs[_0x8db6('0x11')](_0x5441e8);var _0x2dd999=fs['createWriteStream'](_0x15d4e2);var _0x554cf0=crypto[_0x8db6('0x12')](_0x1acf7c[_0x8db6('0x9')],_0x4f780e);_0x4bb44d['on'](_0x8db6('0x13'),function(_0x193fd0){var _0x35bcef=new Buffer(_0x554cf0[_0x8db6('0x14')](_0x193fd0),'binary');_0x2dd999[_0x8db6('0x15')](_0x35bcef);});_0x4bb44d['on'](_0x8db6('0x16'),function(){try{var _0x5f68ee=new Buffer(_0x554cf0[_0x8db6('0x17')]('binary'),_0x8db6('0x18'));_0x2dd999['write'](_0x5f68ee);_0x2dd999['end']();_0x2dd999['on'](_0x8db6('0x19'),function(){return _0xc95b1d(_0x15d4e2);});}catch(_0x5aee09){fs[_0x8db6('0x1a')](_0x15d4e2);return _0x41bfd5(_0x5aee09);}});});};exports[_0x8db6('0x1b')]=function(_0x13fb08,_0x113247,_0x36d0c1,_0x5405dd){return new BPromise(function(_0x498371,_0x559fc4){_0x5405dd=combineOptions(_0x5405dd);var _0x44ea0a=new Buffer(_0x36d0c1);var _0x2b104d=fs[_0x8db6('0x11')](_0x13fb08);var _0x498ec0=fs['createWriteStream'](_0x113247);var _0x58ea81=crypto[_0x8db6('0x1c')](_0x5405dd['algorithm'],_0x44ea0a);_0x2b104d['on']('data',function(_0x2b9315){var _0x4fd3e3=new Buffer(_0x58ea81['update'](_0x2b9315),_0x8db6('0x18'));_0x498ec0[_0x8db6('0x15')](_0x4fd3e3);});_0x2b104d['on'](_0x8db6('0x16'),function(){try{var _0x1d2fcf=new Buffer(_0x58ea81[_0x8db6('0x17')](_0x8db6('0x18')),_0x8db6('0x18'));_0x498ec0[_0x8db6('0x15')](_0x1d2fcf);_0x498ec0[_0x8db6('0x16')]();_0x498ec0['on'](_0x8db6('0x19'),function(){return _0x498371(_0x113247);});}catch(_0x26322a){fs[_0x8db6('0x1a')](_0x113247);return _0x559fc4(_0x26322a);}});});};exports[_0x8db6('0x1d')]=function(_0x3b13ed,_0x3fdec0,_0x1f8252){var _0x26b9bc=_0x1f8252||stringOptions['algorithm'];var _0x552be1=_0x3fdec0||stringOptions['secret'];var _0x13fe7c=crypto[_0x8db6('0x12')](_0x26b9bc,_0x552be1);var _0x3ede15=_0x13fe7c['update'](_0x3b13ed,'utf8',_0x8db6('0x1e'));_0x3ede15+=_0x13fe7c[_0x8db6('0x17')](_0x8db6('0x1e'));return _0x3ede15;};exports[_0x8db6('0x1f')]=function(_0x596cdd,_0x5d20d1,_0x1f8f94){var _0xcacd4e=_0x1f8f94||stringOptions[_0x8db6('0x9')];var _0x3037bf=_0x5d20d1||stringOptions[_0x8db6('0x20')];var _0x2f6def=crypto['createDecipher'](_0xcacd4e,_0x3037bf);var _0x2c6851=_0x2f6def[_0x8db6('0x14')](_0x596cdd,_0x8db6('0x1e'),_0x8db6('0x21'));_0x2c6851+=_0x2f6def[_0x8db6('0x17')](_0x8db6('0x21'));return _0x2c6851;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 41e036f..f1bf747 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 _0x9af3=['num','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','.csv','existsSync','mkdirSync','each','join','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','util','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','length','range'];(function(_0x5b8d89,_0x495947){var _0x287d5f=function(_0x488788){while(--_0x488788){_0x5b8d89['push'](_0x5b8d89['shift']());}};_0x287d5f(++_0x495947);}(_0x9af3,0x1c5));var _0x39af=function(_0x3ec257,_0x122ab4){_0x3ec257=_0x3ec257-0x0;var _0x5c989a=_0x9af3[_0x3ec257];return _0x5c989a;};'use strict';var util=require(_0x39af('0x0'));var path=require('path');var _=require(_0x39af('0x1'));var csv=require(_0x39af('0x2'));var fs=require('fs');var BPromise=require(_0x39af('0x3'));var zipdir=require(_0x39af('0x4'));var rimraf=require(_0x39af('0x5'));var db=require(_0x39af('0x6'))['db'];var dbH=require(_0x39af('0x6'))[_0x39af('0x7')];var logger=require(_0x39af('0x8'))(_0x39af('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x39af('0xa')][0x2]);var QUERY=process[_0x39af('0xa')][0x3];var PATH=process[_0x39af('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x7aa44a,_0x4ae092){var _0x2ecbd1={'status':_0x7aa44a};var _0x30d1a0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4ae092){_0x2ecbd1[_0x39af('0xb')]=_0x4ae092;}return db['AnalyticExtractedReport'][_0x39af('0xc')](_0x2ecbd1,_0x30d1a0);}function main(){var _0x395243=0x1388;var _0x3363d9;logger[_0x39af('0xd')](util[_0x39af('0xe')](_0x39af('0xf'),EXTRACTED_REPORT_ID,_0x39af('0x10')));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x39af('0x11'),_0x39af('0x12')]})['then'](function(_0x3aa433){if(_0x3aa433){_0x3363d9=_0x3aa433;_0x395243=_0x3363d9['splitSizeCsv']||0x1388;}})[_0x39af('0x13')](function(){return dbH[_0x39af('0x14')][_0x39af('0x15')](util[_0x39af('0xe')](_0x39af('0x16'),QUERY),{'type':dbH[_0x39af('0x14')][_0x39af('0x17')][_0x39af('0x18')]});})['then'](function(_0x25d1c1){if(!_0x25d1c1[0x0]['num']){return analyticExtractedReport('Empty');}var _0x4fc40f=[];var _0x1e2a65=0x0;if(_0x3363d9[_0x39af('0x11')]){if(_0x25d1c1&&_0x25d1c1[_0x39af('0x19')]){var _0xc7a8d0=_[_0x39af('0x1a')](_0x25d1c1[0x0][_0x39af('0x1b')]/_0x395243);var _0x5728e3=Number['isInteger'](_0x25d1c1[0x0]['num']/_0x395243)?_0x25d1c1[0x0][_0x39af('0x1b')]%_0x395243:0x0;_0xc7a8d0['forEach'](function(_0x211a55){if(_0x211a55>0x0){_0x1e2a65+=_0x395243;}_0x4fc40f['push'](dbH[_0x39af('0x14')]['query'](util[_0x39af('0xe')](_0x39af('0x1c'),QUERY,_0x395243,_0x1e2a65),{'type':dbH[_0x39af('0x14')][_0x39af('0x17')][_0x39af('0x18')]}));});if(_0x5728e3>0x0){_0x1e2a65+=_0x395243;_0x4fc40f['push'](dbH[_0x39af('0x14')][_0x39af('0x15')](util[_0x39af('0xe')](_0x39af('0x1c'),QUERY,_0x5728e3,_0x1e2a65),{'type':dbH[_0x39af('0x14')][_0x39af('0x17')][_0x39af('0x18')]}));}}}else{_0x4fc40f[_0x39af('0x1d')](dbH[_0x39af('0x14')][_0x39af('0x15')](QUERY,{'type':dbH[_0x39af('0x14')][_0x39af('0x17')][_0x39af('0x18')]}));}var _0x14bb46=path[_0x39af('0x1e')](PATH);var _0x2a9361=path['basename'](PATH,_0x39af('0x1f'));var _0x5caa0b=_0x3363d9[_0x39af('0x11')]&&_0x4fc40f[_0x39af('0x19')]>0x1;var _0x3e5e40=[];if(!fs[_0x39af('0x20')](path['join'](_0x14bb46,_0x2a9361))&&_0x5caa0b){fs[_0x39af('0x21')](path['join'](_0x14bb46,_0x2a9361));}return BPromise[_0x39af('0x22')](_0x4fc40f,function(_0x4e53a3){_0x3e5e40[_0x39af('0x1d')](_0x4e53a3);})[_0x39af('0x13')](function(){for(var _0x12bb67=0x0;_0x12bb67<_0x3e5e40[_0x39af('0x19')];_0x12bb67+=0x1){var _0x49ca5f;var _0x3438a1=_0x3e5e40[_0x12bb67];if(_0x5caa0b){_0x49ca5f=path[_0x39af('0x23')](_0x14bb46,_0x2a9361,util[_0x39af('0xe')](_0x39af('0x24'),_0x2a9361,_0x12bb67,_0x39af('0x25')));}else{_0x49ca5f=path['join'](_0x14bb46,util[_0x39af('0xe')](_0x39af('0x26'),_0x2a9361,_0x39af('0x25')));}fs[_0x39af('0x27')](_0x49ca5f,csv(_0x3438a1));}})[_0x39af('0x13')](function(){if(_0x5caa0b){return new Promise(function(_0xc2342e){zipdir(path[_0x39af('0x23')](_0x14bb46,_0x2a9361),{'saveTo':path[_0x39af('0x23')](_0x14bb46,util[_0x39af('0xe')](_0x39af('0x26'),_0x2a9361,_0x39af('0x28')))},function(_0x7a2c67,_0x1ec8a4){rimraf(path['join'](_0x14bb46,_0x2a9361),function(){});_0xc2342e(_0x39af('0x29'));});});}})['then'](function(){logger['info'](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x39af('0x2a'),_0x5caa0b?util[_0x39af('0xe')](_0x39af('0x26'),_0x2a9361,_0x5caa0b?_0x39af('0x28'):_0x39af('0x25')):null);});})[_0x39af('0x2b')](function(_0x1cb4fb){logger[_0x39af('0xd')](util[_0x39af('0xe')](_0x39af('0x2c'),EXTRACTED_REPORT_ID,_0x39af('0x10')),util[_0x39af('0x2d')](_0x1cb4fb,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x39af('0x2e'));})['finally'](function(){process[_0x39af('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xcf90=['query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','range','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','.csv','existsSync','join','mkdirSync','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','util','path','lodash','to-csv','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','split','then','splitSizeCsv','sequelize'];(function(_0x28278a,_0x145796){var _0x38c6f7=function(_0x4e19e3){while(--_0x4e19e3){_0x28278a['push'](_0x28278a['shift']());}};_0x38c6f7(++_0x145796);}(_0xcf90,0x1ac));var _0x0cf9=function(_0x5b42b7,_0x293eb0){_0x5b42b7=_0x5b42b7-0x0;var _0x279239=_0xcf90[_0x5b42b7];return _0x279239;};'use strict';var util=require(_0x0cf9('0x0'));var path=require(_0x0cf9('0x1'));var _=require(_0x0cf9('0x2'));var csv=require(_0x0cf9('0x3'));var fs=require('fs');var BPromise=require(_0x0cf9('0x4'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x0cf9('0x5'))['db'];var dbH=require('../../mysqldb')[_0x0cf9('0x6')];var logger=require(_0x0cf9('0x7'))(_0x0cf9('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x0cf9('0x9')][0x2]);var QUERY=process[_0x0cf9('0x9')][0x3];var PATH=process[_0x0cf9('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2966dd,_0x2f1c7a){var _0x304f79={'status':_0x2966dd};var _0x911a20={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2f1c7a){_0x304f79[_0x0cf9('0xa')]=_0x2f1c7a;}return db[_0x0cf9('0xb')][_0x0cf9('0xc')](_0x304f79,_0x911a20);}function main(){var _0xf6d0d1=0x1388;var _0x23658c;logger[_0x0cf9('0xd')](util[_0x0cf9('0xe')](_0x0cf9('0xf'),EXTRACTED_REPORT_ID,_0x0cf9('0x10')));return db[_0x0cf9('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0cf9('0x12'),'splitSizeCsv']})[_0x0cf9('0x13')](function(_0x1510f9){if(_0x1510f9){_0x23658c=_0x1510f9;_0xf6d0d1=_0x23658c[_0x0cf9('0x14')]||0x1388;}})[_0x0cf9('0x13')](function(){return dbH[_0x0cf9('0x15')][_0x0cf9('0x16')](util[_0x0cf9('0xe')](_0x0cf9('0x17'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x0cf9('0x18')]});})[_0x0cf9('0x13')](function(_0x2b744a){if(!_0x2b744a[0x0][_0x0cf9('0x19')]){return analyticExtractedReport(_0x0cf9('0x1a'));}var _0x5180d6=[];var _0x6e9dd5=0x0;if(_0x23658c[_0x0cf9('0x12')]){if(_0x2b744a&&_0x2b744a[_0x0cf9('0x1b')]){var _0x4aa4c7=_[_0x0cf9('0x1c')](_0x2b744a[0x0][_0x0cf9('0x19')]/_0xf6d0d1);var _0x4283b6=Number[_0x0cf9('0x1d')](_0x2b744a[0x0]['num']/_0xf6d0d1)?_0x2b744a[0x0][_0x0cf9('0x19')]%_0xf6d0d1:0x0;_0x4aa4c7[_0x0cf9('0x1e')](function(_0x252ad2){if(_0x252ad2>0x0){_0x6e9dd5+=_0xf6d0d1;}_0x5180d6['push'](dbH['sequelize']['query'](util[_0x0cf9('0xe')](_0x0cf9('0x1f'),QUERY,_0xf6d0d1,_0x6e9dd5),{'type':dbH[_0x0cf9('0x15')][_0x0cf9('0x20')][_0x0cf9('0x18')]}));});if(_0x4283b6>0x0){_0x6e9dd5+=_0xf6d0d1;_0x5180d6['push'](dbH[_0x0cf9('0x15')][_0x0cf9('0x16')](util[_0x0cf9('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4283b6,_0x6e9dd5),{'type':dbH[_0x0cf9('0x15')]['QueryTypes'][_0x0cf9('0x18')]}));}}}else{_0x5180d6['push'](dbH['sequelize']['query'](QUERY,{'type':dbH['sequelize'][_0x0cf9('0x20')][_0x0cf9('0x18')]}));}var _0x291ce4=path[_0x0cf9('0x21')](PATH);var _0x593d4=path['basename'](PATH,_0x0cf9('0x22'));var _0x47e99c=_0x23658c[_0x0cf9('0x12')]&&_0x5180d6[_0x0cf9('0x1b')]>0x1;var _0xfd19e1=[];if(!fs[_0x0cf9('0x23')](path[_0x0cf9('0x24')](_0x291ce4,_0x593d4))&&_0x47e99c){fs[_0x0cf9('0x25')](path[_0x0cf9('0x24')](_0x291ce4,_0x593d4));}return BPromise['each'](_0x5180d6,function(_0x26041b){_0xfd19e1['push'](_0x26041b);})[_0x0cf9('0x13')](function(){for(var _0x38bd7e=0x0;_0x38bd7e<_0xfd19e1[_0x0cf9('0x1b')];_0x38bd7e+=0x1){var _0x36b697;var _0x5c8992=_0xfd19e1[_0x38bd7e];if(_0x47e99c){_0x36b697=path[_0x0cf9('0x24')](_0x291ce4,_0x593d4,util[_0x0cf9('0xe')](_0x0cf9('0x26'),_0x593d4,_0x38bd7e,_0x0cf9('0x27')));}else{_0x36b697=path[_0x0cf9('0x24')](_0x291ce4,util[_0x0cf9('0xe')](_0x0cf9('0x28'),_0x593d4,_0x0cf9('0x27')));}fs[_0x0cf9('0x29')](_0x36b697,csv(_0x5c8992));}})[_0x0cf9('0x13')](function(){if(_0x47e99c){return new Promise(function(_0x542405){zipdir(path[_0x0cf9('0x24')](_0x291ce4,_0x593d4),{'saveTo':path[_0x0cf9('0x24')](_0x291ce4,util[_0x0cf9('0xe')]('%s.%s',_0x593d4,_0x0cf9('0x2a')))},function(_0x21d1c8,_0x5e59d0){rimraf(path['join'](_0x291ce4,_0x593d4),function(){});_0x542405(_0x0cf9('0x2b'));});});}})[_0x0cf9('0x13')](function(){logger['info'](util[_0x0cf9('0xe')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x0cf9('0x10')));return analyticExtractedReport(_0x0cf9('0x2c'),_0x47e99c?util[_0x0cf9('0xe')](_0x0cf9('0x28'),_0x593d4,_0x47e99c?_0x0cf9('0x2a'):'csv'):null);});})[_0x0cf9('0x2d')](function(_0x4eb75c){logger['info'](util[_0x0cf9('0xe')](_0x0cf9('0x2e'),EXTRACTED_REPORT_ID,'CSV'),util[_0x0cf9('0x2f')](_0x4eb75c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x0cf9('0x30')](function(){process[_0x0cf9('0x31')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 13ad6f6..23e12b1 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=['JSDOM','window','bluebird','../../mysqldb','dbH','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','pick','toString','value','length','body','chunk','keys','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','pageBreak','margin','landscape','footer','Arial','black','right','num','Empty','Setting','find','split','splitSizePdf','then','range','isInteger','query','sequelize','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.pdf','join','mkdirSync','flatten','createPdfKitDocument','pdf','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','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','createPdfFromHTML','path','lodash','util','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom'];(function(_0x4be687,_0xe630cc){var _0x42156f=function(_0x5ae44b){while(--_0x5ae44b){_0x4be687['push'](_0x4be687['shift']());}};_0x42156f(++_0xe630cc);}(_0xab63,0xad));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(_0x3ab6('0x1'));var path=require('path');var moment=require('moment');var htmlToPdfmake=require(_0x3ab6('0x2'));var PdfPrinter=require(_0x3ab6('0x3'));var zipdir=require(_0x3ab6('0x4'));var rimraf=require(_0x3ab6('0x5'));var JSDOM=require(_0x3ab6('0x6'))[_0x3ab6('0x7')];var window=new JSDOM('')[_0x3ab6('0x8')];var BPromise=require(_0x3ab6('0x9'));var db=require(_0x3ab6('0xa'))['db'];var dbH=require(_0x3ab6('0xa'))[_0x3ab6('0xb')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x3ab6('0xc')][0x3];var PATH=process[_0x3ab6('0xc')][0x4];var NAME=process[_0x3ab6('0xc')][0x5];var FORMAT=_0x3ab6('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0xa39ec7,_0xd5e573){var _0x39c44e={'status':_0xa39ec7};var _0x37a4fb={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xd5e573){_0x39c44e[_0x3ab6('0xe')]=_0xd5e573;}return db[_0x3ab6('0xf')][_0x3ab6('0x10')](_0x39c44e,_0x37a4fb);}function getHeaders(_0x544e7b){return _[_0x3ab6('0x11')](_0x544e7b,function(_0x12d073){return{'text':_0x12d073,'style':'tableHeader'};});}function getRows(_0x4a71a3,_0x5466b8){return _[_0x3ab6('0x11')](_0x5466b8,function(_0x27e17b){return _(_0x27e17b)[_0x3ab6('0x12')](_0x4a71a3)[_0x3ab6('0x11')](function(_0x55818c){return _0x55818c?_[_0x3ab6('0x13')](_0x55818c):'';})[_0x3ab6('0x14')]();});}function createTable(_0x5dc373,_0x558e29){var _0x4333fc={'widths':_['fill'](Array(_0x5dc373[_0x3ab6('0x15')]),0x91),'heights':function(_0x7ddb85){return _0x7ddb85===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x4a212e=getHeaders(_0x5dc373);_0x4333fc[_0x3ab6('0x16')]['push'](_0x4a212e);var _0x14a09f=getRows(_0x5dc373,_0x558e29);_0x4333fc['body']=_0x4333fc[_0x3ab6('0x16')]['concat'](_0x14a09f);return _0x4333fc;}function createTables(_0x2b953b){var _0x26749d=[];var _0x4bdf1b=_[_0x3ab6('0x17')](Object[_0x3ab6('0x18')](_0x2b953b[0x0]),0x5);_0x4bdf1b[_0x3ab6('0x19')](function(_0x3d932){_0x26749d[_0x3ab6('0x1a')](createTable(_0x3d932,_0x2b953b));});return _0x26749d;}function getPDFDocDefinition(_0x1eb0b3){var _0x830513=util[_0x3ab6('0x1b')](_0x3ab6('0x1c'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x3ab6('0x1d')])[_0x3ab6('0x1b')](FORMAT),moment(EXTRACTED_REPORT[_0x3ab6('0x1e')])['format'](FORMAT));var _0x2e8b89=[];for(var _0x23d0bd=0x0;_0x23d0bd<_0x1eb0b3[_0x3ab6('0x15')];_0x23d0bd++){var _0x2df41c=[];if(_0x23d0bd===0x0){_0x2df41c['push']({'text':_0x830513,'style':'header'});}var _0x267b51={'table':_0x1eb0b3[_0x23d0bd]};if(_0x23d0bd>0x0){_0x267b51[_0x3ab6('0x1f')]='before';_0x267b51[_0x3ab6('0x20')]=[0x0,0x46,0x0,0x0];}_0x2df41c[_0x3ab6('0x1a')](_0x267b51);_0x2e8b89[_0x3ab6('0x1a')](_0x2df41c);}return{'pageSize':'A4','pageOrientation':_0x3ab6('0x21'),'content':_0x2e8b89,'footer':function(_0x4bb932,_0x3e63c5){return{'text':_0x4bb932['toString']()+'\x20/\x20'+_0x3e63c5,'style':_0x3ab6('0x22')};},'defaultStyle':{'font':_0x3ab6('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x3ab6('0x24')},'footer':{'alignment':_0x3ab6('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x312e52){var _0x3758f2=0x1388;var _0x1ceb4f;if(!_0x312e52[0x0][_0x3ab6('0x26')]){return analyticExtractedReport(_0x3ab6('0x27'));}return db[_0x3ab6('0x28')][_0x3ab6('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3ab6('0x2a'),_0x3ab6('0x2b')]})[_0x3ab6('0x2c')](function(_0x4e18e5){if(_0x4e18e5){_0x1ceb4f=_0x4e18e5;_0x3758f2=_0x1ceb4f['splitSizePdf']||0x3e8;}})[_0x3ab6('0x2c')](function(){var _0x16f2bf=[];var _0x451f0e=0x0;if(_0x1ceb4f[_0x3ab6('0x2a')]){if(_0x312e52&&_0x312e52['length']){var _0x30fbc7=_[_0x3ab6('0x2d')](_0x312e52[0x0][_0x3ab6('0x26')]/_0x3758f2);var _0xe047ce=Number[_0x3ab6('0x2e')](_0x312e52[0x0]['num']/_0x3758f2)?_0x312e52[0x0][_0x3ab6('0x26')]%_0x3758f2:0x0;_0x30fbc7['forEach'](function(_0x300250){if(_0x300250>0x0){_0x451f0e+=_0x3758f2;}_0x16f2bf[_0x3ab6('0x1a')](dbH['sequelize'][_0x3ab6('0x2f')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3758f2,_0x451f0e),{'type':dbH[_0x3ab6('0x30')][_0x3ab6('0x31')][_0x3ab6('0x32')]}));});if(_0xe047ce>0x0){_0x451f0e+=_0x3758f2;_0x16f2bf[_0x3ab6('0x1a')](dbH[_0x3ab6('0x30')][_0x3ab6('0x2f')](util[_0x3ab6('0x1b')](_0x3ab6('0x33'),QUERY,_0xe047ce,_0x451f0e),{'type':dbH[_0x3ab6('0x30')][_0x3ab6('0x31')][_0x3ab6('0x32')]}));}}}else{_0x16f2bf['push'](dbH[_0x3ab6('0x30')]['query'](QUERY,{'type':dbH['sequelize'][_0x3ab6('0x31')][_0x3ab6('0x32')]}));}var _0x575115=path[_0x3ab6('0x34')](PATH);var _0x4b8e06=path['basename'](PATH,_0x3ab6('0x35'));var _0x429f12=_0x1ceb4f['split']&&_0x16f2bf[_0x3ab6('0x15')]>0x1;var _0x3b1b7a=[];if(!fs['existsSync'](path[_0x3ab6('0x36')](_0x575115,_0x4b8e06))&&_0x429f12){fs[_0x3ab6('0x37')](path[_0x3ab6('0x36')](_0x575115,_0x4b8e06));}return BPromise['each'](_0x16f2bf,function(_0x174c06){_0x3b1b7a[_0x3ab6('0x1a')](_0x174c06);})[_0x3ab6('0x2c')](function(){var _0x4c5389=[];for(var _0x3704fc=0x0;_0x3704fc<_0x3b1b7a['length'];_0x3704fc+=0x1){var _0x187181=_0x3b1b7a[_0x3704fc];var _0x37175a=createTables(_[_0x3ab6('0x38')](_0x187181));var _0x2e36ed;var _0x3f22e2=getPDFDocDefinition(_0x37175a);var _0x4febbe=getPDFPrinter();var _0x3a30e=_0x4febbe[_0x3ab6('0x39')](_0x3f22e2);if(_0x429f12){_0x2e36ed=path[_0x3ab6('0x36')](_0x575115,_0x4b8e06,util[_0x3ab6('0x1b')]('%s%d.%s',_0x4b8e06,_0x3704fc,_0x3ab6('0x3a')));}else{_0x2e36ed=path['join'](_0x575115,util[_0x3ab6('0x1b')](_0x3ab6('0x3b'),_0x4b8e06,_0x3ab6('0x3a')));}_0x4c5389[_0x3ab6('0x1a')](writePDFDocument(_0x3a30e,_0x2e36ed));}return Promise['all'](_0x4c5389);})[_0x3ab6('0x2c')](function(){if(_0x429f12){return new Promise(function(_0x26443f){zipdir(path[_0x3ab6('0x36')](_0x575115,_0x4b8e06),{'saveTo':path[_0x3ab6('0x36')](_0x575115,util['format']('%s.%s',_0x4b8e06,_0x3ab6('0x3c')))},function(){rimraf(path[_0x3ab6('0x36')](_0x575115,_0x4b8e06),function(){});_0x26443f(_0x3ab6('0x3d'));});});}})[_0x3ab6('0x2c')](function(){if(!_0x429f12)return;rimraf(path[_0x3ab6('0x36')](_0x575115,_0x4b8e06),function(){});})[_0x3ab6('0x2c')](function(){logger[_0x3ab6('0x3e')](util[_0x3ab6('0x1b')](_0x3ab6('0x3f'),EXTRACTED_REPORT_ID,_0x3ab6('0x40')));return analyticExtractedReport(_0x3ab6('0x41'),_0x429f12?util[_0x3ab6('0x1b')]('%s.%s',_0x4b8e06,_0x429f12?_0x3ab6('0x3c'):_0x3ab6('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x3ab6('0x3e')](util[_0x3ab6('0x1b')](_0x3ab6('0x42'),EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport']['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x3ab6('0x2c')](function(_0x44ae09){EXTRACTED_REPORT=_0x44ae09;return dbH[_0x3ab6('0x30')][_0x3ab6('0x2f')](util[_0x3ab6('0x1b')](_0x3ab6('0x43'),QUERY),{'type':dbH[_0x3ab6('0x30')][_0x3ab6('0x31')][_0x3ab6('0x32')]});})[_0x3ab6('0x2c')](extractReport)[_0x3ab6('0x44')](function(_0x2317a4){logger[_0x3ab6('0x3e')](util[_0x3ab6('0x1b')](_0x3ab6('0x45'),EXTRACTED_REPORT_ID,_0x3ab6('0x40')),util[_0x3ab6('0x46')](_0x2317a4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x3ab6('0x47'));})[_0x3ab6('0x48')](function(){process[_0x3ab6('0x49')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1e0c6c=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x3ab6('0x4a'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x3ab6('0x4b')}});return _0x1e0c6c;}function getPDFDocDefinitionFromHTML(_0xc746fb,_0x4bc6b5){var _0x46b52c=util[_0x3ab6('0x1b')](_0x3ab6('0x4c'),_0x4bc6b5[_0x3ab6('0x4d')],_0x4bc6b5[_0x3ab6('0x4e')]);var _0x380426=moment()[_0x3ab6('0x1b')](_0x3ab6('0x4f'))[_0x3ab6('0x13')]();var _0x1964a9=htmlToPdfmake(_0xc746fb,{'window':window,'tableAutoSize':!![]});return{'content':[_0x1964a9],'defaultStyle':{'font':_0x3ab6('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x3ab6('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x3ab6('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x3ab6('0x50')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x3ab6('0x51')}];},'footer':function(_0x54e404,_0x2b7d5c){return[{'text':util[_0x3ab6('0x1b')](_0x3ab6('0x52'),_0x46b52c,_0x54e404,_0x2b7d5c,_0x380426),'style':'footer'}];}};}function writePDFDocument(_0x53561c,_0x2b0f91){return new Promise(function(_0x1b845d,_0x587e46){var _0x2f84cd=_0x53561c[_0x3ab6('0x53')](fs[_0x3ab6('0x54')](_0x2b0f91));_0x2f84cd['on'](_0x3ab6('0x55'),function(){_0x1b845d(_0x3ab6('0x55'));});_0x2f84cd['on'](_0x3ab6('0x56'),function(_0x5e9c4d){_0x587e46(_0x5e9c4d);});_0x53561c[_0x3ab6('0x57')]();});}exports[_0x3ab6('0x58')]=function(_0x4be954,_0x30fc26){var _0x12e661=getPDFPrinter();var _0x90d355=getPDFDocDefinitionFromHTML(_0x4be954,_0x30fc26);var _0x4bd830=_0x12e661['createPdfKitDocument'](_0x90d355);return writePDFDocument(_0x4bd830,_0x30fc26[_0x3ab6('0x59')])[_0x3ab6('0x44')](function(_0x48a3a7){throw _0x48a3a7;});}; \ No newline at end of file +var _0x87a5=['mkdirSync','each','createPdfKitDocument','%s%d.%s','%s.%s','pdf','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','createWriteStream','finish','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','tableHeader','map','pick','toString','value','length','auto','push','body','chunk','keys','forEach','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','endDate','format','before','landscape','footer','Arial','black','right','num','Empty','Setting','find','then','splitSizePdf','split','range','sequelize','query','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.pdf','existsSync','join'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x87a5,0x1d0));var _0x587a=function(_0x484c03,_0x13c1d2){_0x484c03=_0x484c03-0x0;var _0x294127=_0x87a5[_0x484c03];return _0x294127;};'use strict';var _=require(_0x587a('0x0'));var fs=require('fs');var util=require(_0x587a('0x1'));var path=require(_0x587a('0x2'));var moment=require(_0x587a('0x3'));var htmlToPdfmake=require(_0x587a('0x4'));var PdfPrinter=require(_0x587a('0x5'));var zipdir=require('zip-dir');var rimraf=require(_0x587a('0x6'));var JSDOM=require(_0x587a('0x7'))[_0x587a('0x8')];var window=new JSDOM('')[_0x587a('0x9')];var BPromise=require(_0x587a('0xa'));var db=require(_0x587a('0xb'))['db'];var dbH=require(_0x587a('0xb'))[_0x587a('0xc')];var logger=require(_0x587a('0xd'))(_0x587a('0xe'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x587a('0xf')][0x4];var NAME=process[_0x587a('0xf')][0x5];var FORMAT=_0x587a('0x10');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x22f4a9,_0x3f841f){var _0x1a227a={'status':_0x22f4a9};var _0x587a20={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3f841f){_0x1a227a[_0x587a('0x11')]=_0x3f841f;}return db[_0x587a('0x12')][_0x587a('0x13')](_0x1a227a,_0x587a20);}function getHeaders(_0x114a6b){return _['map'](_0x114a6b,function(_0x4b018f){return{'text':_0x4b018f,'style':_0x587a('0x14')};});}function getRows(_0xa08c8,_0x460707){return _[_0x587a('0x15')](_0x460707,function(_0x3101fd){return _(_0x3101fd)[_0x587a('0x16')](_0xa08c8)[_0x587a('0x15')](function(_0x369677){return _0x369677?_[_0x587a('0x17')](_0x369677):'';})[_0x587a('0x18')]();});}function createTable(_0x196166,_0x56dc84){var _0x231160={'widths':_['fill'](Array(_0x196166[_0x587a('0x19')]),0x91),'heights':function(_0x34ce7f){return _0x34ce7f===0x0?_0x587a('0x1a'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x156c27=getHeaders(_0x196166);_0x231160['body'][_0x587a('0x1b')](_0x156c27);var _0x323e30=getRows(_0x196166,_0x56dc84);_0x231160[_0x587a('0x1c')]=_0x231160['body']['concat'](_0x323e30);return _0x231160;}function createTables(_0x2caf76){var _0xf78dbd=[];var _0x2861aa=_[_0x587a('0x1d')](Object[_0x587a('0x1e')](_0x2caf76[0x0]),0x5);_0x2861aa[_0x587a('0x1f')](function(_0x312803){_0xf78dbd[_0x587a('0x1b')](createTable(_0x312803,_0x2caf76));});return _0xf78dbd;}function getPDFDocDefinition(_0x55ab49){var _0x1414a6=util['format'](_0x587a('0x20'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x587a('0x21')])[_0x587a('0x22')](FORMAT));var _0x24373e=[];for(var _0x430014=0x0;_0x430014<_0x55ab49['length'];_0x430014++){var _0x16a181=[];if(_0x430014===0x0){_0x16a181['push']({'text':_0x1414a6,'style':'header'});}var _0xe1bbc5={'table':_0x55ab49[_0x430014]};if(_0x430014>0x0){_0xe1bbc5['pageBreak']=_0x587a('0x23');_0xe1bbc5['margin']=[0x0,0x46,0x0,0x0];}_0x16a181[_0x587a('0x1b')](_0xe1bbc5);_0x24373e[_0x587a('0x1b')](_0x16a181);}return{'pageSize':'A4','pageOrientation':_0x587a('0x24'),'content':_0x24373e,'footer':function(_0x4f5cbb,_0x5a030a){return{'text':_0x4f5cbb[_0x587a('0x17')]()+'\x20/\x20'+_0x5a030a,'style':_0x587a('0x25')};},'defaultStyle':{'font':_0x587a('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x587a('0x27')},'footer':{'alignment':_0x587a('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x127341){var _0x22f8e8=0x1388;var _0x33e085;if(!_0x127341[0x0][_0x587a('0x29')]){return analyticExtractedReport(_0x587a('0x2a'));}return db[_0x587a('0x2b')][_0x587a('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})[_0x587a('0x2d')](function(_0x1a325a){if(_0x1a325a){_0x33e085=_0x1a325a;_0x22f8e8=_0x33e085[_0x587a('0x2e')]||0x3e8;}})['then'](function(){var _0x202067=[];var _0x45a965=0x0;if(_0x33e085[_0x587a('0x2f')]){if(_0x127341&&_0x127341['length']){var _0x5058a2=_[_0x587a('0x30')](_0x127341[0x0][_0x587a('0x29')]/_0x22f8e8);var _0x1e868d=Number['isInteger'](_0x127341[0x0][_0x587a('0x29')]/_0x22f8e8)?_0x127341[0x0][_0x587a('0x29')]%_0x22f8e8:0x0;_0x5058a2[_0x587a('0x1f')](function(_0x253f85){if(_0x253f85>0x0){_0x45a965+=_0x22f8e8;}_0x202067[_0x587a('0x1b')](dbH[_0x587a('0x31')][_0x587a('0x32')](util[_0x587a('0x22')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x22f8e8,_0x45a965),{'type':dbH[_0x587a('0x31')][_0x587a('0x33')][_0x587a('0x34')]}));});if(_0x1e868d>0x0){_0x45a965+=_0x22f8e8;_0x202067[_0x587a('0x1b')](dbH[_0x587a('0x31')][_0x587a('0x32')](util['format'](_0x587a('0x35'),QUERY,_0x1e868d,_0x45a965),{'type':dbH[_0x587a('0x31')]['QueryTypes'][_0x587a('0x34')]}));}}}else{_0x202067['push'](dbH[_0x587a('0x31')][_0x587a('0x32')](QUERY,{'type':dbH[_0x587a('0x31')][_0x587a('0x33')][_0x587a('0x34')]}));}var _0x4ed9b1=path[_0x587a('0x36')](PATH);var _0x48471f=path['basename'](PATH,_0x587a('0x37'));var _0x5aec7e=_0x33e085['split']&&_0x202067[_0x587a('0x19')]>0x1;var _0x330aeb=[];if(!fs[_0x587a('0x38')](path[_0x587a('0x39')](_0x4ed9b1,_0x48471f))&&_0x5aec7e){fs[_0x587a('0x3a')](path[_0x587a('0x39')](_0x4ed9b1,_0x48471f));}return BPromise[_0x587a('0x3b')](_0x202067,function(_0x2b7fc0){_0x330aeb[_0x587a('0x1b')](_0x2b7fc0);})[_0x587a('0x2d')](function(){var _0x5dd04c=[];for(var _0x637bbf=0x0;_0x637bbf<_0x330aeb[_0x587a('0x19')];_0x637bbf+=0x1){var _0x53375d=_0x330aeb[_0x637bbf];var _0x2e80b3=createTables(_['flatten'](_0x53375d));var _0x17847e;var _0x3c6486=getPDFDocDefinition(_0x2e80b3);var _0xdd13e7=getPDFPrinter();var _0x31fa46=_0xdd13e7[_0x587a('0x3c')](_0x3c6486);if(_0x5aec7e){_0x17847e=path[_0x587a('0x39')](_0x4ed9b1,_0x48471f,util[_0x587a('0x22')](_0x587a('0x3d'),_0x48471f,_0x637bbf,'pdf'));}else{_0x17847e=path[_0x587a('0x39')](_0x4ed9b1,util['format'](_0x587a('0x3e'),_0x48471f,_0x587a('0x3f')));}_0x5dd04c[_0x587a('0x1b')](writePDFDocument(_0x31fa46,_0x17847e));}return Promise['all'](_0x5dd04c);})[_0x587a('0x2d')](function(){if(_0x5aec7e){return new Promise(function(_0x1d528b){zipdir(path[_0x587a('0x39')](_0x4ed9b1,_0x48471f),{'saveTo':path[_0x587a('0x39')](_0x4ed9b1,util[_0x587a('0x22')](_0x587a('0x3e'),_0x48471f,_0x587a('0x40')))},function(){rimraf(path[_0x587a('0x39')](_0x4ed9b1,_0x48471f),function(){});_0x1d528b(_0x587a('0x41'));});});}})[_0x587a('0x2d')](function(){if(!_0x5aec7e)return;rimraf(path['join'](_0x4ed9b1,_0x48471f),function(){});})[_0x587a('0x2d')](function(){logger[_0x587a('0x42')](util['format'](_0x587a('0x43'),EXTRACTED_REPORT_ID,_0x587a('0x44')));return analyticExtractedReport(_0x587a('0x45'),_0x5aec7e?util[_0x587a('0x22')](_0x587a('0x3e'),_0x48471f,_0x5aec7e?'zip':_0x587a('0x3f')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x587a('0x22')](_0x587a('0x46'),EXTRACTED_REPORT_ID,_0x587a('0x44')));return db[_0x587a('0x12')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x4a96e6){EXTRACTED_REPORT=_0x4a96e6;return dbH[_0x587a('0x31')][_0x587a('0x32')](util[_0x587a('0x22')](_0x587a('0x47'),QUERY),{'type':dbH[_0x587a('0x31')][_0x587a('0x33')]['SELECT']});})[_0x587a('0x2d')](extractReport)[_0x587a('0x48')](function(_0x2422d0){logger[_0x587a('0x42')](util['format'](_0x587a('0x49'),EXTRACTED_REPORT_ID,_0x587a('0x44')),util[_0x587a('0x4a')](_0x2422d0,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x587a('0x4b'));})[_0x587a('0x4c')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0xdcd540=new PdfPrinter({'Arial':{'normal':__dirname+_0x587a('0x4d'),'bold':__dirname+_0x587a('0x4e'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x587a('0x4f')}});return _0xdcd540;}function getPDFDocDefinitionFromHTML(_0x1f83c3,_0x36167d){var _0x2b260e=util[_0x587a('0x22')]('%s\x20#%d',_0x36167d[_0x587a('0x50')],_0x36167d[_0x587a('0x51')]);var _0x1611e2=moment()[_0x587a('0x22')](_0x587a('0x52'))['toString']();var _0x4365d1=htmlToPdfmake(_0x1f83c3,{'window':window,'tableAutoSize':!![]});return{'content':[_0x4365d1],'defaultStyle':{'font':_0x587a('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x587a('0x53'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x587a('0x53')}},'header':function(){return[{'text':_0x587a('0x54'),'style':'header'}];},'footer':function(_0x242ce2,_0x4dec24){return[{'text':util[_0x587a('0x22')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x2b260e,_0x242ce2,_0x4dec24,_0x1611e2),'style':'footer'}];}};}function writePDFDocument(_0x46c524,_0x50de59){return new Promise(function(_0x220fa5,_0x5bf4fa){var _0x2b1498=_0x46c524['pipe'](fs[_0x587a('0x55')](_0x50de59));_0x2b1498['on'](_0x587a('0x56'),function(){_0x220fa5(_0x587a('0x56'));});_0x2b1498['on']('error',function(_0x3ad5ea){_0x5bf4fa(_0x3ad5ea);});_0x46c524['end']();});}exports['createPdfFromHTML']=function(_0xbe65ae,_0x5506ec){var _0x5d1ee6=getPDFPrinter();var _0x3a178b=getPDFDocDefinitionFromHTML(_0xbe65ae,_0x5506ec);var _0x5535ef=_0x5d1ee6[_0x587a('0x3c')](_0x3a178b);return writePDFDocument(_0x5535ef,_0x5506ec[_0x587a('0x2')])[_0x587a('0x48')](function(_0x16ed33){throw _0x16ed33;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index c8f1a56..568a276 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 _0xa30a=['%s.%s','binary','zip\x20finished','info','XLSX','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','then','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','range','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','length','existsSync','mkdirSync','join','each','%s%d.%s','xlsx'];(function(_0x236d94,_0x5b7bb8){var _0xe52db9=function(_0x10f50e){while(--_0x10f50e){_0x236d94['push'](_0x236d94['shift']());}};_0xe52db9(++_0x5b7bb8);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xaa30('0x0'));var path=require(_0xaa30('0x1'));var _=require(_0xaa30('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xaa30('0x3'));var zipdir=require(_0xaa30('0x4'));var rimraf=require(_0xaa30('0x5'));var db=require(_0xaa30('0x6'))['db'];var dbH=require(_0xaa30('0x6'))[_0xaa30('0x7')];var logger=require(_0xaa30('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xaa30('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xaa30('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x14fe09,_0x42dc22){var _0x5d076a={'status':_0x14fe09};var _0xedbc45={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x42dc22){_0x5d076a[_0xaa30('0xa')]=_0x42dc22;}return db[_0xaa30('0xb')][_0xaa30('0xc')](_0x5d076a,_0xedbc45);}function main(){var _0x14a6a6=0x1388;var _0x45419f;logger['info'](util['format'](_0xaa30('0xd'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xaa30('0xe')][_0xaa30('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xaa30('0x10'),_0xaa30('0x11')]})['then'](function(_0xec992f){if(_0xec992f){_0x45419f=_0xec992f;_0x14a6a6=_0x45419f[_0xaa30('0x11')]||0x1388;}})[_0xaa30('0x12')](function(){return dbH['sequelize'][_0xaa30('0x13')](util[_0xaa30('0x14')](_0xaa30('0x15'),QUERY),{'type':dbH[_0xaa30('0x16')][_0xaa30('0x17')][_0xaa30('0x18')]});})[_0xaa30('0x12')](function(_0x3b8095){if(!_0x3b8095[0x0][_0xaa30('0x19')]){return analyticExtractedReport(_0xaa30('0x1a'));}var _0x519518=[];var _0x91839d=0x0;if(_0x45419f['split']){if(_0x3b8095&&_0x3b8095['length']){var _0x3247ea=_[_0xaa30('0x1b')](_0x3b8095[0x0][_0xaa30('0x19')]/_0x14a6a6);var _0x540e36=Number['isInteger'](_0x3b8095[0x0]['num']/_0x14a6a6)?_0x3b8095[0x0][_0xaa30('0x19')]%_0x14a6a6:0x0;_0x3247ea['forEach'](function(_0xfb02ab){if(_0xfb02ab>0x0){_0x91839d+=_0x14a6a6;}_0x519518[_0xaa30('0x1c')](dbH['sequelize']['query'](util['format'](_0xaa30('0x1d'),QUERY,_0x14a6a6,_0x91839d),{'type':dbH[_0xaa30('0x16')][_0xaa30('0x17')][_0xaa30('0x18')]}));});if(_0x540e36>0x0){_0x91839d+=_0x14a6a6;_0x519518[_0xaa30('0x1c')](dbH['sequelize'][_0xaa30('0x13')](util[_0xaa30('0x14')](_0xaa30('0x1d'),QUERY,_0x540e36,_0x91839d),{'type':dbH[_0xaa30('0x16')][_0xaa30('0x17')]['SELECT']}));}}}else{_0x519518[_0xaa30('0x1c')](dbH[_0xaa30('0x16')][_0xaa30('0x13')](QUERY,{'type':dbH[_0xaa30('0x16')]['QueryTypes'][_0xaa30('0x18')]}));}var _0x1be54c=path[_0xaa30('0x1e')](PATH);var _0x12da2f=path[_0xaa30('0x1f')](PATH,_0xaa30('0x20'));var _0x55cccb=_0x45419f[_0xaa30('0x10')]&&_0x519518[_0xaa30('0x21')]>0x1;var _0x5d4da8=[];if(!fs[_0xaa30('0x22')](path['join'](_0x1be54c,_0x12da2f))&&_0x55cccb){fs[_0xaa30('0x23')](path[_0xaa30('0x24')](_0x1be54c,_0x12da2f));}return BPromise[_0xaa30('0x25')](_0x519518,function(_0xd1eb3a){_0x5d4da8[_0xaa30('0x1c')](_0xd1eb3a);})[_0xaa30('0x12')](function(){for(var _0x6ff09a=0x0;_0x6ff09a<_0x5d4da8[_0xaa30('0x21')];_0x6ff09a+=0x1){var _0x1f288c;var _0x43fb30=_0x5d4da8[_0x6ff09a];if(_0x55cccb){_0x1f288c=path[_0xaa30('0x24')](_0x1be54c,_0x12da2f,util[_0xaa30('0x14')](_0xaa30('0x26'),_0x12da2f,_0x6ff09a,_0xaa30('0x27')));}else{_0x1f288c=path[_0xaa30('0x24')](_0x1be54c,util[_0xaa30('0x14')](_0xaa30('0x28'),_0x12da2f,_0xaa30('0x27')));}fs['writeFileSync'](_0x1f288c,json2xls(_0x43fb30),_0xaa30('0x29'));}})[_0xaa30('0x12')](function(){if(_0x55cccb){return new Promise(function(_0x3bc22f){zipdir(path[_0xaa30('0x24')](_0x1be54c,_0x12da2f),{'saveTo':path[_0xaa30('0x24')](_0x1be54c,util[_0xaa30('0x14')]('%s.%s',_0x12da2f,'zip'))},function(_0x5b99ca,_0x30909a){rimraf(path[_0xaa30('0x24')](_0x1be54c,_0x12da2f),function(){});_0x3bc22f(_0xaa30('0x2a'));});});}})[_0xaa30('0x12')](function(){logger[_0xaa30('0x2b')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xaa30('0x2c')));return analyticExtractedReport(_0xaa30('0x2d'),_0x55cccb?util['format'](_0xaa30('0x28'),_0x12da2f,_0x55cccb?'zip':_0xaa30('0x27')):null);});})['catch'](function(_0x2ae4ed){logger[_0xaa30('0x2b')](util['format'](_0xaa30('0x2e'),EXTRACTED_REPORT_ID,_0xaa30('0x2c')),util[_0xaa30('0x2f')](_0x2ae4ed,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xaa30('0x30'));})[_0xaa30('0x31')](function(){process[_0xaa30('0x32')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x4a95=['binary','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','finally','exit','path','lodash','json2xls','bluebird','rimraf','../../mysqldb','argv','savename','AnalyticExtractedReport','info','format','XLSX','Setting','find','split','then','splitSizeXlsx','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.xlsx','join','mkdirSync','%s%d.%s','xlsx'];(function(_0x1f1641,_0x42ad9d){var _0x9660b4=function(_0x545ff2){while(--_0x545ff2){_0x1f1641['push'](_0x1f1641['shift']());}};_0x9660b4(++_0x42ad9d);}(_0x4a95,0x91));var _0x54a9=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x4a95[_0x3947c9];return _0x2e7871;};'use strict';var util=require('util');var path=require(_0x54a9('0x0'));var _=require(_0x54a9('0x1'));var fs=require('fs');var json2xls=require(_0x54a9('0x2'));var BPromise=require(_0x54a9('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x54a9('0x4'));var db=require(_0x54a9('0x5'))['db'];var dbH=require(_0x54a9('0x5'))['dbH'];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x54a9('0x6')][0x2]);var QUERY=process[_0x54a9('0x6')][0x3];var PATH=process[_0x54a9('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3a2d15,_0x501b01){var _0x20b903={'status':_0x3a2d15};var _0x2c9c30={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x501b01){_0x20b903[_0x54a9('0x7')]=_0x501b01;}return db[_0x54a9('0x8')]['update'](_0x20b903,_0x2c9c30);}function main(){var _0x4b5aeb=0x1388;var _0x1186fb;logger[_0x54a9('0x9')](util[_0x54a9('0xa')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x54a9('0xb')));return db[_0x54a9('0xc')][_0x54a9('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x54a9('0xe'),'splitSizeXlsx']})[_0x54a9('0xf')](function(_0x28ecf9){if(_0x28ecf9){_0x1186fb=_0x28ecf9;_0x4b5aeb=_0x1186fb[_0x54a9('0x10')]||0x1388;}})[_0x54a9('0xf')](function(){return dbH[_0x54a9('0x11')]['query'](util[_0x54a9('0xa')](_0x54a9('0x12'),QUERY),{'type':dbH['sequelize'][_0x54a9('0x13')][_0x54a9('0x14')]});})['then'](function(_0x123909){if(!_0x123909[0x0][_0x54a9('0x15')]){return analyticExtractedReport(_0x54a9('0x16'));}var _0x1723e2=[];var _0x41c843=0x0;if(_0x1186fb['split']){if(_0x123909&&_0x123909[_0x54a9('0x17')]){var _0x59fc1e=_[_0x54a9('0x18')](_0x123909[0x0]['num']/_0x4b5aeb);var _0x24036b=Number['isInteger'](_0x123909[0x0]['num']/_0x4b5aeb)?_0x123909[0x0][_0x54a9('0x15')]%_0x4b5aeb:0x0;_0x59fc1e[_0x54a9('0x19')](function(_0x21de34){if(_0x21de34>0x0){_0x41c843+=_0x4b5aeb;}_0x1723e2[_0x54a9('0x1a')](dbH[_0x54a9('0x11')][_0x54a9('0x1b')](util[_0x54a9('0xa')](_0x54a9('0x1c'),QUERY,_0x4b5aeb,_0x41c843),{'type':dbH[_0x54a9('0x11')][_0x54a9('0x13')][_0x54a9('0x14')]}));});if(_0x24036b>0x0){_0x41c843+=_0x4b5aeb;_0x1723e2[_0x54a9('0x1a')](dbH[_0x54a9('0x11')][_0x54a9('0x1b')](util[_0x54a9('0xa')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x24036b,_0x41c843),{'type':dbH['sequelize'][_0x54a9('0x13')][_0x54a9('0x14')]}));}}}else{_0x1723e2[_0x54a9('0x1a')](dbH[_0x54a9('0x11')]['query'](QUERY,{'type':dbH[_0x54a9('0x11')][_0x54a9('0x13')][_0x54a9('0x14')]}));}var _0x2723a8=path[_0x54a9('0x1d')](PATH);var _0x4d129a=path['basename'](PATH,_0x54a9('0x1e'));var _0x93c451=_0x1186fb[_0x54a9('0xe')]&&_0x1723e2['length']>0x1;var _0x4007f2=[];if(!fs['existsSync'](path[_0x54a9('0x1f')](_0x2723a8,_0x4d129a))&&_0x93c451){fs[_0x54a9('0x20')](path[_0x54a9('0x1f')](_0x2723a8,_0x4d129a));}return BPromise['each'](_0x1723e2,function(_0x36c013){_0x4007f2[_0x54a9('0x1a')](_0x36c013);})[_0x54a9('0xf')](function(){for(var _0x3c0c18=0x0;_0x3c0c18<_0x4007f2[_0x54a9('0x17')];_0x3c0c18+=0x1){var _0x4515bb;var _0xd229ac=_0x4007f2[_0x3c0c18];if(_0x93c451){_0x4515bb=path[_0x54a9('0x1f')](_0x2723a8,_0x4d129a,util['format'](_0x54a9('0x21'),_0x4d129a,_0x3c0c18,_0x54a9('0x22')));}else{_0x4515bb=path[_0x54a9('0x1f')](_0x2723a8,util[_0x54a9('0xa')]('%s.%s',_0x4d129a,'xlsx'));}fs['writeFileSync'](_0x4515bb,json2xls(_0xd229ac),_0x54a9('0x23'));}})[_0x54a9('0xf')](function(){if(_0x93c451){return new Promise(function(_0x234640){zipdir(path[_0x54a9('0x1f')](_0x2723a8,_0x4d129a),{'saveTo':path[_0x54a9('0x1f')](_0x2723a8,util[_0x54a9('0xa')](_0x54a9('0x24'),_0x4d129a,_0x54a9('0x25')))},function(_0x4e56d5,_0x1fe7d6){rimraf(path[_0x54a9('0x1f')](_0x2723a8,_0x4d129a),function(){});_0x234640(_0x54a9('0x26'));});});}})[_0x54a9('0xf')](function(){logger['info'](util[_0x54a9('0xa')](_0x54a9('0x27'),EXTRACTED_REPORT_ID,_0x54a9('0xb')));return analyticExtractedReport(_0x54a9('0x28'),_0x93c451?util[_0x54a9('0xa')](_0x54a9('0x24'),_0x4d129a,_0x93c451?'zip':_0x54a9('0x22')):null);});})[_0x54a9('0x29')](function(_0x54b1c0){logger['info'](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x54a9('0xb')),util[_0x54a9('0x2a')](_0x54b1c0,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x54a9('0x2b')](function(){process[_0x54a9('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index f67d187..15d5c84 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 _0xd41b=['GotoIfTime',',${EXTEN},','last','concat','destroy','lodash','util','models','findAll','then','intervals','VoiceExtension','uniq','map','exten','filter','groupBy','queue','hasOwnProperty','priority','extensions','extension','push','format','CDR(type)=%s','type','context','VoiceExtensionId','inbound','Set','CDR(routeid)=','outbound','CDR(destination)=','${EXTEN:','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','IntervalId','tag','CDR(tag)=','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0xd41b,0x197));var _0xbd41=function(_0x56446e,_0x11a94d){_0x56446e=_0x56446e-0x0;var _0x431c00=_0xd41b[_0x56446e];return _0x431c00;};'use strict';var _=require(_0xbd41('0x0'));var util=require(_0xbd41('0x1'));function rewrite(_0x124878,_0x400bd7){var _0x5ce775=this;return _0x124878[_0xbd41('0x2')]['Interval'][_0xbd41('0x3')]({'raw':!![]})[_0xbd41('0x4')](function(_0x21290){_0x5ce775[_0xbd41('0x5')]=_0x21290;return _0x124878[_0xbd41('0x2')]['VoiceExtension'][_0xbd41('0x3')]({'where':{'IntervalId':_0x400bd7['IntervalId']},'raw':!![]});})[_0xbd41('0x4')](function(_0x38bed2){return _0x124878[_0xbd41('0x2')][_0xbd41('0x6')][_0xbd41('0x3')]({'where':{'exten':{'$in':_[_0xbd41('0x7')](_[_0xbd41('0x8')](_0x38bed2,_0xbd41('0x9')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xbd41('0x4')](function(_0x3f020c){var _0x492baf=_['filter'](_0x3f020c,{'priority':'1'});var _0x13520e=_[_0xbd41('0xa')](_0x3f020c,{'isApp':0x1});var _0x292b6c=_[_0xbd41('0xb')](_0x13520e,_0xbd41('0x9'));var _0x21e4e9=[_0xbd41('0xc'),'playback'];var _0x2f9114=[];var _0x22289e=[];for(var _0x2736b8 in _0x292b6c){if(_0x292b6c[_0xbd41('0xd')](_0x2736b8)){_0x5ce775[_0xbd41('0xe')]=0x2;_0x5ce775[_0xbd41('0xf')]=[];_0x5ce775[_0xbd41('0x10')]=_['find'](_0x492baf,{'exten':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x9')]});_0x5ce775['extensions'][_0xbd41('0x11')]({'type':_0x292b6c[_0x2736b8][0x0]['type'],'app':'Set','appdata':util[_0xbd41('0x12')](_0xbd41('0x13'),_0x292b6c[_0x2736b8][0x0][_0xbd41('0x14')]),'context':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x15')],'exten':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x9')],'priority':_0x5ce775[_0xbd41('0xe')]++,'VoiceExtensionId':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x16')]});if(_0x292b6c[_0x2736b8][0x0][_0xbd41('0x14')]===_0xbd41('0x17')){_0x5ce775[_0xbd41('0xf')]['push']({'type':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x14')],'app':_0xbd41('0x18'),'appdata':_0xbd41('0x19')+_0x292b6c[_0x2736b8][0x0][_0xbd41('0x16')],'context':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x15')],'exten':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x9')],'priority':_0x5ce775['priority']++,'VoiceExtensionId':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x16')]});}else if(_0x292b6c[_0x2736b8][0x0][_0xbd41('0x14')]===_0xbd41('0x1a')){if(_0x5ce775[_0xbd41('0x10')]){_0x5ce775[_0xbd41('0xf')][_0xbd41('0x11')]({'type':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x14')],'app':'Set','appdata':_0xbd41('0x1b')+(_0x5ce775[_0xbd41('0x10')]['cutdigits']?_0xbd41('0x1c')+_0x5ce775[_0xbd41('0x10')][_0xbd41('0x1d')]+'}':'${EXTEN}'),'context':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x15')],'exten':_0x292b6c[_0x2736b8][0x0]['exten'],'priority':_0x5ce775['priority']++,'VoiceExtensionId':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x16')]});}_0x5ce775['extensions'][_0xbd41('0x11')]({'type':_0x292b6c[_0x2736b8][0x0]['type'],'app':_0xbd41('0x18'),'appdata':'CDR(routeid)='+_0x292b6c[_0x2736b8][0x0]['VoiceExtensionId'],'context':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x15')],'exten':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x9')],'priority':_0x5ce775[_0xbd41('0xe')]++,'VoiceExtensionId':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x16')]});var _0x1daeb6=_0x5ce775[_0xbd41('0xe')]++;_0x5ce775['extensions'][_0xbd41('0x11')]({'type':_0x292b6c[_0x2736b8][0x0]['type'],'app':_0xbd41('0x1e'),'appdata':_0xbd41('0x1f')+(_0x1daeb6+0x2)+_0xbd41('0x20')+(_0x1daeb6+0x1)+')','context':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x15')],'exten':_0x292b6c[_0x2736b8][0x0]['exten'],'priority':_0x1daeb6,'VoiceExtensionId':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x16')]});if(_0x5ce775[_0xbd41('0x10')]){_0x5ce775[_0xbd41('0xf')][_0xbd41('0x11')]({'type':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x14')],'app':_0xbd41('0x18'),'appdata':_0x5ce775[_0xbd41('0x10')][_0xbd41('0x1d')]?_0xbd41('0x21')+_0x5ce775[_0xbd41('0x10')][_0xbd41('0x1d')]+'}':_0xbd41('0x22'),'context':_0x292b6c[_0x2736b8][0x0]['context'],'exten':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x9')],'priority':_0x5ce775[_0xbd41('0xe')]++,'VoiceExtensionId':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x16')]});}_0x5ce775['extensions'][_0xbd41('0x11')]({'type':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x14')],'app':_0xbd41('0x18'),'appdata':_0xbd41('0x23')+_0x292b6c[_0x2736b8][0x0][_0xbd41('0x16')],'context':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x15')],'exten':_0x292b6c[_0x2736b8][0x0]['exten'],'priority':_0x5ce775['priority']++,'VoiceExtensionId':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x16')]});if(_0x5ce775[_0xbd41('0x10')]&&_0x5ce775[_0xbd41('0x10')][_0xbd41('0xd')](_0xbd41('0x24'))&&_0x5ce775[_0xbd41('0x10')][_0xbd41('0x24')]!==_0xbd41('0x25')){_0x5ce775[_0xbd41('0xf')][_0xbd41('0x11')]({'type':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x14')],'app':_0xbd41('0x18'),'appdata':_0xbd41('0x26'),'context':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x15')],'exten':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x9')],'priority':_0x5ce775[_0xbd41('0xe')]++,'VoiceExtensionId':_0x292b6c[_0x2736b8][0x0]['VoiceExtensionId']});_0x5ce775['extensions'][_0xbd41('0x11')]({'type':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x14')],'app':'Set','appdata':_0xbd41('0x27')+_0x5ce775[_0xbd41('0x10')][_0xbd41('0x24')]||_0xbd41('0x28'),'context':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x15')],'exten':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x9')],'priority':_0x5ce775[_0xbd41('0xe')]++,'VoiceExtensionId':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x16')]});}}_0x5ce775[_0xbd41('0xf')][_0xbd41('0x11')]({'type':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x14')],'app':_0xbd41('0x18'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x15')],'exten':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x9')],'priority':_0x5ce775[_0xbd41('0xe')]++,'VoiceExtensionId':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x16')]});_0x5ce775[_0xbd41('0xf')][_0xbd41('0x11')]({'type':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x14')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x292b6c[_0x2736b8][0x0]['context'],'exten':_0x292b6c[_0x2736b8][0x0]['exten'],'priority':_0x5ce775[_0xbd41('0xe')]++,'VoiceExtensionId':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x16')]});_0x5ce775['extensions'][_0xbd41('0x11')]({'type':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x14')],'app':_0xbd41('0x18'),'appdata':'MONITOR_OPTIONS=ab','context':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x15')],'exten':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x9')],'priority':_0x5ce775[_0xbd41('0xe')]++,'VoiceExtensionId':_0x292b6c[_0x2736b8][0x0]['VoiceExtensionId']});for(var _0x407330=0x0,_0x1efd07=0x0;_0x407330<_0x292b6c[_0x2736b8]['length'];_0x407330+=0x1,_0x1efd07=0x0){var _0x45885c=_0x292b6c[_0x2736b8][_0x407330];if(_0x45885c['type']){_0x45885c[_0xbd41('0x14')]=_0x45885c[_0xbd41('0x14')][_0xbd41('0x29')]();}var _0x5690ff=[];var _0x137289=[];delete _0x45885c['id'];delete _0x45885c[_0xbd41('0x2a')];delete _0x45885c[_0xbd41('0x2b')];var _0x26ce8a=_0x45885c[_0xbd41('0x2c')]!==_0xbd41('0x2d')?[_0x45885c[_0xbd41('0x2c')]]:_0x45885c[_0xbd41('0x2e')]?_[_0xbd41('0x8')](_[_0xbd41('0xa')](_0x5ce775[_0xbd41('0x5')],{'IntervalId':_0x45885c[_0xbd41('0x2e')]}),_0xbd41('0x2c')):[];if(_0x45885c[_0xbd41('0xd')](_0xbd41('0x2f'))){if(_0x45885c[_0xbd41('0x2f')]&&_0x45885c[_0xbd41('0x2f')]!=='--'){_0x5690ff[_0xbd41('0x11')]({'type':_0x45885c[_0xbd41('0x14')],'app':_0xbd41('0x18'),'appdata':_0xbd41('0x30')+_0x45885c[_0xbd41('0x2f')],'context':_0x45885c[_0xbd41('0x15')],'exten':_0x45885c[_0xbd41('0x9')],'priority':_0x26ce8a[_0xbd41('0x31')]+_0x5ce775[_0xbd41('0xe')]+_0x1efd07++,'VoiceExtensionId':_0x45885c[_0xbd41('0x16')]});}}if(_0x45885c[_0xbd41('0x14')]===_0xbd41('0x1a')&&_0x45885c[_0xbd41('0xd')](_0xbd41('0x32'))){if(_0x45885c['callerID']){_0x5690ff[_0xbd41('0x11')]({'type':_0x45885c[_0xbd41('0x14')],'app':_0xbd41('0x1e'),'appdata':_0xbd41('0x33')+_0x45885c[_0xbd41('0x32')]+')','context':_0x45885c[_0xbd41('0x15')],'exten':_0x45885c[_0xbd41('0x9')],'priority':_0x26ce8a[_0xbd41('0x31')]+_0x5ce775[_0xbd41('0xe')]+_0x1efd07++,'VoiceExtensionId':_0x45885c[_0xbd41('0x16')]});}else{_0x5690ff[_0xbd41('0x11')]({'type':_0x45885c[_0xbd41('0x14')],'app':_0xbd41('0x1e'),'appdata':_0xbd41('0x34'),'context':_0x45885c[_0xbd41('0x15')],'exten':_0x45885c['exten'],'priority':_0x26ce8a['length']+_0x5ce775[_0xbd41('0xe')]+_0x1efd07++,'VoiceExtensionId':_0x45885c[_0xbd41('0x16')]});}}if(_0x45885c[_0xbd41('0xd')](_0xbd41('0x35'))){if(_0x21e4e9[_0xbd41('0x36')](_0x45885c[_0xbd41('0x37')][_0xbd41('0x29')]())>=0x0&&_0x45885c[_0xbd41('0x38')]!==_0xbd41('0x39')){if(_0x45885c[_0xbd41('0x35')]){_0x5690ff['push']({'type':_0x45885c[_0xbd41('0x14')],'app':'ExecIf','appdata':_0xbd41('0x3a'),'context':_0x45885c[_0xbd41('0x15')],'exten':_0x45885c[_0xbd41('0x9')],'priority':_0x26ce8a[_0xbd41('0x31')]+_0x5ce775['priority']+_0x1efd07++,'VoiceExtensionId':_0x45885c[_0xbd41('0x16')]});_0x5690ff[_0xbd41('0x11')]({'type':_0x45885c[_0xbd41('0x14')],'app':_0xbd41('0x18'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x45885c[_0xbd41('0x15')],'exten':_0x45885c['exten'],'priority':_0x26ce8a[_0xbd41('0x31')]+_0x5ce775['priority']+_0x1efd07++,'VoiceExtensionId':_0x45885c['VoiceExtensionId']});}else{_0x5690ff['push']({'type':_0x45885c[_0xbd41('0x14')],'app':_0xbd41('0x1e'),'appdata':_0xbd41('0x3b'),'context':_0x45885c[_0xbd41('0x15')],'exten':_0x45885c[_0xbd41('0x9')],'priority':_0x26ce8a[_0xbd41('0x31')]+_0x5ce775[_0xbd41('0xe')]+_0x1efd07++,'VoiceExtensionId':_0x45885c[_0xbd41('0x16')]});_0x5690ff[_0xbd41('0x11')]({'type':_0x45885c[_0xbd41('0x14')],'app':_0xbd41('0x18'),'appdata':_0xbd41('0x3c'),'context':_0x45885c['context'],'exten':_0x45885c[_0xbd41('0x9')],'priority':_0x26ce8a['length']+_0x5ce775['priority']+_0x1efd07++,'VoiceExtensionId':_0x45885c[_0xbd41('0x16')]});}}}for(var _0x36e42c=0x0;_0x36e42c<_0x26ce8a[_0xbd41('0x31')];_0x36e42c+=0x1){var _0x48a432=_0x5ce775[_0xbd41('0xe')]+_0x26ce8a[_0xbd41('0x31')];var _0x234e77=_0x36e42c===_0x26ce8a[_0xbd41('0x31')]-0x1?_0x5ce775['priority']+_0x5690ff[_0xbd41('0x31')]+_0x137289[_0xbd41('0x31')]+0x2:_0x5ce775[_0xbd41('0xe')]+_0x36e42c+0x1;_0x5690ff[_0xbd41('0x3d')](_0x36e42c,0x0,{'type':_0x45885c['type'],'app':_0xbd41('0x3e'),'appdata':_0x26ce8a[_0x36e42c]+'?'+_0x45885c[_0xbd41('0x15')]+_0xbd41('0x3f')+_0x48a432+':'+_0x45885c[_0xbd41('0x15')]+_0xbd41('0x3f')+_0x234e77,'exten':_0x45885c[_0xbd41('0x9')],'context':_0x45885c['context'],'priority':_0x5ce775[_0xbd41('0xe')]+_0x36e42c,'VoiceExtensionId':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x16')]});}_0x45885c[_0xbd41('0xe')]=_0x5690ff[_0xbd41('0x31')]?_[_0xbd41('0x40')](_0x5690ff)[_0xbd41('0xe')]+0x1:_0x5ce775[_0xbd41('0xe')];_0x5ce775[_0xbd41('0xe')]=(_0x137289[_0xbd41('0x31')]?_['last'](_0x137289)[_0xbd41('0xe')]:_0x45885c[_0xbd41('0xe')])+0x1;_0x5ce775['extensions']=_[_0xbd41('0x41')](_0x5ce775[_0xbd41('0xf')],_0x5690ff,[_0x45885c],_0x137289);}_0x5ce775[_0xbd41('0xf')][_0xbd41('0x11')]({'type':_0x292b6c[_0x2736b8][0x0]['type'],'app':'Hangup','exten':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x9')],'context':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x15')],'priority':_0x5ce775[_0xbd41('0xe')],'VoiceExtensionId':_0x292b6c[_0x2736b8][0x0][_0xbd41('0x16')]});_0x2f9114[_0xbd41('0x11')](_0x292b6c[_0x2736b8][0x0][_0xbd41('0x16')]);_0x22289e=_[_0xbd41('0x41')](_0x22289e,_0x5ce775[_0xbd41('0xf')]);}}return _0x124878['transaction'](function(_0x29a9fb){return _0x124878[_0xbd41('0x2')][_0xbd41('0x6')][_0xbd41('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x2f9114}},'transaction':_0x29a9fb})[_0xbd41('0x4')](function(_0x115dfe){return _0x124878[_0xbd41('0x2')]['VoiceExtension']['bulkCreate'](_['sortBy'](_0x22289e,_0xbd41('0xe')),{'transaction':_0x29a9fb});});});})['catch'](function(_0xa3f8a7){console['error'](_0xa3f8a7);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0xa24f=['VoiceExtensionId','inbound','context','outbound','CDR(destination)=','cutdigits','${EXTEN:','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','createdAt','updatedAt','*,*,*,*','IntervalId','interval','tag','CDR(tag)=','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','destroy','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','intervals','VoiceExtension','then','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','groupBy','queue','playback','hasOwnProperty','priority','extension','find','extensions','push','type','Set','format','CDR(type)=%s'];(function(_0x2e3097,_0x457ec2){var _0x5c19bb=function(_0xdc924a){while(--_0xdc924a){_0x2e3097['push'](_0x2e3097['shift']());}};_0x5c19bb(++_0x457ec2);}(_0xa24f,0xc8));var _0xfa24=function(_0x2e092e,_0x1bbef3){_0x2e092e=_0x2e092e-0x0;var _0x4d4f52=_0xa24f[_0x2e092e];return _0x4d4f52;};'use strict';var _=require(_0xfa24('0x0'));var util=require(_0xfa24('0x1'));function rewrite(_0x4cfd69,_0x5893e7){var _0x3bc07a=this;return _0x4cfd69[_0xfa24('0x2')][_0xfa24('0x3')][_0xfa24('0x4')]({'raw':!![]})['then'](function(_0x2d3cf5){_0x3bc07a[_0xfa24('0x5')]=_0x2d3cf5;return _0x4cfd69['models'][_0xfa24('0x6')][_0xfa24('0x4')]({'where':{'IntervalId':_0x5893e7['IntervalId']},'raw':!![]});})[_0xfa24('0x7')](function(_0x4044b7){return _0x4cfd69[_0xfa24('0x2')]['VoiceExtension'][_0xfa24('0x4')]({'where':{'exten':{'$in':_[_0xfa24('0x8')](_[_0xfa24('0x9')](_0x4044b7,_0xfa24('0xa')))}},'order':[{'raw':_0xfa24('0xb')}],'raw':!![]});})[_0xfa24('0x7')](function(_0x271a1b){var _0x54f310=_['filter'](_0x271a1b,{'priority':'1'});var _0x2607b2=_['filter'](_0x271a1b,{'isApp':0x1});var _0x265d1c=_[_0xfa24('0xc')](_0x2607b2,'exten');var _0x4898dd=[_0xfa24('0xd'),_0xfa24('0xe')];var _0x3d5522=[];var _0xe44d4e=[];for(var _0x52d536 in _0x265d1c){if(_0x265d1c[_0xfa24('0xf')](_0x52d536)){_0x3bc07a[_0xfa24('0x10')]=0x2;_0x3bc07a['extensions']=[];_0x3bc07a[_0xfa24('0x11')]=_[_0xfa24('0x12')](_0x54f310,{'exten':_0x265d1c[_0x52d536][0x0][_0xfa24('0xa')]});_0x3bc07a[_0xfa24('0x13')][_0xfa24('0x14')]({'type':_0x265d1c[_0x52d536][0x0][_0xfa24('0x15')],'app':_0xfa24('0x16'),'appdata':util[_0xfa24('0x17')](_0xfa24('0x18'),_0x265d1c[_0x52d536][0x0][_0xfa24('0x15')]),'context':_0x265d1c[_0x52d536][0x0]['context'],'exten':_0x265d1c[_0x52d536][0x0][_0xfa24('0xa')],'priority':_0x3bc07a['priority']++,'VoiceExtensionId':_0x265d1c[_0x52d536][0x0][_0xfa24('0x19')]});if(_0x265d1c[_0x52d536][0x0][_0xfa24('0x15')]===_0xfa24('0x1a')){_0x3bc07a[_0xfa24('0x13')][_0xfa24('0x14')]({'type':_0x265d1c[_0x52d536][0x0][_0xfa24('0x15')],'app':_0xfa24('0x16'),'appdata':'CDR(routeid)='+_0x265d1c[_0x52d536][0x0][_0xfa24('0x19')],'context':_0x265d1c[_0x52d536][0x0][_0xfa24('0x1b')],'exten':_0x265d1c[_0x52d536][0x0][_0xfa24('0xa')],'priority':_0x3bc07a[_0xfa24('0x10')]++,'VoiceExtensionId':_0x265d1c[_0x52d536][0x0][_0xfa24('0x19')]});}else if(_0x265d1c[_0x52d536][0x0][_0xfa24('0x15')]===_0xfa24('0x1c')){if(_0x3bc07a[_0xfa24('0x11')]){_0x3bc07a[_0xfa24('0x13')][_0xfa24('0x14')]({'type':_0x265d1c[_0x52d536][0x0][_0xfa24('0x15')],'app':'Set','appdata':_0xfa24('0x1d')+(_0x3bc07a[_0xfa24('0x11')][_0xfa24('0x1e')]?_0xfa24('0x1f')+_0x3bc07a['extension'][_0xfa24('0x1e')]+'}':'${EXTEN}'),'context':_0x265d1c[_0x52d536][0x0][_0xfa24('0x1b')],'exten':_0x265d1c[_0x52d536][0x0][_0xfa24('0xa')],'priority':_0x3bc07a[_0xfa24('0x10')]++,'VoiceExtensionId':_0x265d1c[_0x52d536][0x0][_0xfa24('0x19')]});}_0x3bc07a[_0xfa24('0x13')][_0xfa24('0x14')]({'type':_0x265d1c[_0x52d536][0x0][_0xfa24('0x15')],'app':_0xfa24('0x16'),'appdata':_0xfa24('0x20')+_0x265d1c[_0x52d536][0x0]['VoiceExtensionId'],'context':_0x265d1c[_0x52d536][0x0][_0xfa24('0x1b')],'exten':_0x265d1c[_0x52d536][0x0][_0xfa24('0xa')],'priority':_0x3bc07a[_0xfa24('0x10')]++,'VoiceExtensionId':_0x265d1c[_0x52d536][0x0][_0xfa24('0x19')]});var _0x261789=_0x3bc07a['priority']++;_0x3bc07a[_0xfa24('0x13')]['push']({'type':_0x265d1c[_0x52d536][0x0][_0xfa24('0x15')],'app':_0xfa24('0x21'),'appdata':_0xfa24('0x22')+(_0x261789+0x2)+_0xfa24('0x23')+(_0x261789+0x1)+')','context':_0x265d1c[_0x52d536][0x0]['context'],'exten':_0x265d1c[_0x52d536][0x0]['exten'],'priority':_0x261789,'VoiceExtensionId':_0x265d1c[_0x52d536][0x0][_0xfa24('0x19')]});if(_0x3bc07a['extension']){_0x3bc07a[_0xfa24('0x13')]['push']({'type':_0x265d1c[_0x52d536][0x0][_0xfa24('0x15')],'app':_0xfa24('0x16'),'appdata':_0x3bc07a[_0xfa24('0x11')][_0xfa24('0x1e')]?'CDR(prefix)=${EXTEN:0:'+_0x3bc07a[_0xfa24('0x11')]['cutdigits']+'}':_0xfa24('0x24'),'context':_0x265d1c[_0x52d536][0x0]['context'],'exten':_0x265d1c[_0x52d536][0x0][_0xfa24('0xa')],'priority':_0x3bc07a[_0xfa24('0x10')]++,'VoiceExtensionId':_0x265d1c[_0x52d536][0x0]['VoiceExtensionId']});}_0x3bc07a[_0xfa24('0x13')][_0xfa24('0x14')]({'type':_0x265d1c[_0x52d536][0x0][_0xfa24('0x15')],'app':_0xfa24('0x16'),'appdata':_0xfa24('0x25')+_0x265d1c[_0x52d536][0x0][_0xfa24('0x19')],'context':_0x265d1c[_0x52d536][0x0][_0xfa24('0x1b')],'exten':_0x265d1c[_0x52d536][0x0]['exten'],'priority':_0x3bc07a[_0xfa24('0x10')]++,'VoiceExtensionId':_0x265d1c[_0x52d536][0x0][_0xfa24('0x19')]});if(_0x3bc07a['extension']&&_0x3bc07a[_0xfa24('0x11')]['hasOwnProperty']('recordingFormat')&&_0x3bc07a[_0xfa24('0x11')][_0xfa24('0x26')]!=='none'){_0x3bc07a[_0xfa24('0x13')][_0xfa24('0x14')]({'type':_0x265d1c[_0x52d536][0x0]['type'],'app':_0xfa24('0x16'),'appdata':_0xfa24('0x27'),'context':_0x265d1c[_0x52d536][0x0][_0xfa24('0x1b')],'exten':_0x265d1c[_0x52d536][0x0]['exten'],'priority':_0x3bc07a[_0xfa24('0x10')]++,'VoiceExtensionId':_0x265d1c[_0x52d536][0x0]['VoiceExtensionId']});_0x3bc07a[_0xfa24('0x13')]['push']({'type':_0x265d1c[_0x52d536][0x0][_0xfa24('0x15')],'app':_0xfa24('0x16'),'appdata':_0xfa24('0x28')+_0x3bc07a['extension'][_0xfa24('0x26')]||_0xfa24('0x29'),'context':_0x265d1c[_0x52d536][0x0][_0xfa24('0x1b')],'exten':_0x265d1c[_0x52d536][0x0]['exten'],'priority':_0x3bc07a['priority']++,'VoiceExtensionId':_0x265d1c[_0x52d536][0x0]['VoiceExtensionId']});}}_0x3bc07a['extensions'][_0xfa24('0x14')]({'type':_0x265d1c[_0x52d536][0x0][_0xfa24('0x15')],'app':_0xfa24('0x16'),'appdata':_0xfa24('0x2a'),'context':_0x265d1c[_0x52d536][0x0][_0xfa24('0x1b')],'exten':_0x265d1c[_0x52d536][0x0][_0xfa24('0xa')],'priority':_0x3bc07a[_0xfa24('0x10')]++,'VoiceExtensionId':_0x265d1c[_0x52d536][0x0]['VoiceExtensionId']});_0x3bc07a[_0xfa24('0x13')][_0xfa24('0x14')]({'type':_0x265d1c[_0x52d536][0x0][_0xfa24('0x15')],'app':_0xfa24('0x16'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x265d1c[_0x52d536][0x0][_0xfa24('0x1b')],'exten':_0x265d1c[_0x52d536][0x0][_0xfa24('0xa')],'priority':_0x3bc07a[_0xfa24('0x10')]++,'VoiceExtensionId':_0x265d1c[_0x52d536][0x0][_0xfa24('0x19')]});_0x3bc07a[_0xfa24('0x13')]['push']({'type':_0x265d1c[_0x52d536][0x0]['type'],'app':_0xfa24('0x16'),'appdata':_0xfa24('0x2b'),'context':_0x265d1c[_0x52d536][0x0][_0xfa24('0x1b')],'exten':_0x265d1c[_0x52d536][0x0][_0xfa24('0xa')],'priority':_0x3bc07a[_0xfa24('0x10')]++,'VoiceExtensionId':_0x265d1c[_0x52d536][0x0]['VoiceExtensionId']});for(var _0x9355e9=0x0,_0xa38d16=0x0;_0x9355e9<_0x265d1c[_0x52d536]['length'];_0x9355e9+=0x1,_0xa38d16=0x0){var _0x3c2641=_0x265d1c[_0x52d536][_0x9355e9];if(_0x3c2641['type']){_0x3c2641[_0xfa24('0x15')]=_0x3c2641['type']['toLowerCase']();}var _0x299147=[];var _0x3b9a35=[];delete _0x3c2641['id'];delete _0x3c2641[_0xfa24('0x2c')];delete _0x3c2641[_0xfa24('0x2d')];var _0x582a2e=_0x3c2641['interval']!==_0xfa24('0x2e')?[_0x3c2641['interval']]:_0x3c2641[_0xfa24('0x2f')]?_[_0xfa24('0x9')](_['filter'](_0x3bc07a[_0xfa24('0x5')],{'IntervalId':_0x3c2641['IntervalId']}),_0xfa24('0x30')):[];if(_0x3c2641[_0xfa24('0xf')](_0xfa24('0x31'))){if(_0x3c2641[_0xfa24('0x31')]&&_0x3c2641[_0xfa24('0x31')]!=='--'){_0x299147[_0xfa24('0x14')]({'type':_0x3c2641['type'],'app':_0xfa24('0x16'),'appdata':_0xfa24('0x32')+_0x3c2641[_0xfa24('0x31')],'context':_0x3c2641[_0xfa24('0x1b')],'exten':_0x3c2641['exten'],'priority':_0x582a2e[_0xfa24('0x33')]+_0x3bc07a[_0xfa24('0x10')]+_0xa38d16++,'VoiceExtensionId':_0x3c2641['VoiceExtensionId']});}}if(_0x3c2641[_0xfa24('0x15')]==='outbound'&&_0x3c2641[_0xfa24('0xf')](_0xfa24('0x34'))){if(_0x3c2641[_0xfa24('0x34')]){_0x299147[_0xfa24('0x14')]({'type':_0x3c2641[_0xfa24('0x15')],'app':_0xfa24('0x21'),'appdata':_0xfa24('0x35')+_0x3c2641[_0xfa24('0x34')]+')','context':_0x3c2641[_0xfa24('0x1b')],'exten':_0x3c2641[_0xfa24('0xa')],'priority':_0x582a2e[_0xfa24('0x33')]+_0x3bc07a[_0xfa24('0x10')]+_0xa38d16++,'VoiceExtensionId':_0x3c2641['VoiceExtensionId']});}else{_0x299147['push']({'type':_0x3c2641[_0xfa24('0x15')],'app':_0xfa24('0x21'),'appdata':_0xfa24('0x36'),'context':_0x3c2641['context'],'exten':_0x3c2641[_0xfa24('0xa')],'priority':_0x582a2e[_0xfa24('0x33')]+_0x3bc07a[_0xfa24('0x10')]+_0xa38d16++,'VoiceExtensionId':_0x3c2641[_0xfa24('0x19')]});}}if(_0x3c2641[_0xfa24('0xf')](_0xfa24('0x37'))){if(_0x4898dd[_0xfa24('0x38')](_0x3c2641[_0xfa24('0x39')][_0xfa24('0x3a')]())>=0x0&&_0x3c2641[_0xfa24('0x3b')]!==_0xfa24('0x3c')){if(_0x3c2641[_0xfa24('0x37')]){_0x299147[_0xfa24('0x14')]({'type':_0x3c2641[_0xfa24('0x15')],'app':_0xfa24('0x21'),'appdata':_0xfa24('0x3d'),'context':_0x3c2641['context'],'exten':_0x3c2641[_0xfa24('0xa')],'priority':_0x582a2e[_0xfa24('0x33')]+_0x3bc07a[_0xfa24('0x10')]+_0xa38d16++,'VoiceExtensionId':_0x3c2641[_0xfa24('0x19')]});_0x299147[_0xfa24('0x14')]({'type':_0x3c2641[_0xfa24('0x15')],'app':'Set','appdata':_0xfa24('0x3e'),'context':_0x3c2641[_0xfa24('0x1b')],'exten':_0x3c2641[_0xfa24('0xa')],'priority':_0x582a2e['length']+_0x3bc07a['priority']+_0xa38d16++,'VoiceExtensionId':_0x3c2641[_0xfa24('0x19')]});}else{_0x299147[_0xfa24('0x14')]({'type':_0x3c2641[_0xfa24('0x15')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x3c2641[_0xfa24('0x1b')],'exten':_0x3c2641[_0xfa24('0xa')],'priority':_0x582a2e[_0xfa24('0x33')]+_0x3bc07a['priority']+_0xa38d16++,'VoiceExtensionId':_0x3c2641[_0xfa24('0x19')]});_0x299147[_0xfa24('0x14')]({'type':_0x3c2641[_0xfa24('0x15')],'app':_0xfa24('0x16'),'appdata':_0xfa24('0x3f'),'context':_0x3c2641[_0xfa24('0x1b')],'exten':_0x3c2641[_0xfa24('0xa')],'priority':_0x582a2e[_0xfa24('0x33')]+_0x3bc07a[_0xfa24('0x10')]+_0xa38d16++,'VoiceExtensionId':_0x3c2641[_0xfa24('0x19')]});}}}for(var _0x3d3866=0x0;_0x3d3866<_0x582a2e[_0xfa24('0x33')];_0x3d3866+=0x1){var _0x530ba0=_0x3bc07a[_0xfa24('0x10')]+_0x582a2e['length'];var _0x504352=_0x3d3866===_0x582a2e[_0xfa24('0x33')]-0x1?_0x3bc07a[_0xfa24('0x10')]+_0x299147[_0xfa24('0x33')]+_0x3b9a35[_0xfa24('0x33')]+0x2:_0x3bc07a[_0xfa24('0x10')]+_0x3d3866+0x1;_0x299147[_0xfa24('0x40')](_0x3d3866,0x0,{'type':_0x3c2641[_0xfa24('0x15')],'app':_0xfa24('0x41'),'appdata':_0x582a2e[_0x3d3866]+'?'+_0x3c2641[_0xfa24('0x1b')]+_0xfa24('0x42')+_0x530ba0+':'+_0x3c2641[_0xfa24('0x1b')]+_0xfa24('0x42')+_0x504352,'exten':_0x3c2641[_0xfa24('0xa')],'context':_0x3c2641[_0xfa24('0x1b')],'priority':_0x3bc07a[_0xfa24('0x10')]+_0x3d3866,'VoiceExtensionId':_0x265d1c[_0x52d536][0x0][_0xfa24('0x19')]});}_0x3c2641[_0xfa24('0x10')]=_0x299147[_0xfa24('0x33')]?_[_0xfa24('0x43')](_0x299147)['priority']+0x1:_0x3bc07a[_0xfa24('0x10')];_0x3bc07a[_0xfa24('0x10')]=(_0x3b9a35['length']?_['last'](_0x3b9a35)['priority']:_0x3c2641[_0xfa24('0x10')])+0x1;_0x3bc07a[_0xfa24('0x13')]=_[_0xfa24('0x44')](_0x3bc07a['extensions'],_0x299147,[_0x3c2641],_0x3b9a35);}_0x3bc07a[_0xfa24('0x13')][_0xfa24('0x14')]({'type':_0x265d1c[_0x52d536][0x0][_0xfa24('0x15')],'app':_0xfa24('0x45'),'exten':_0x265d1c[_0x52d536][0x0][_0xfa24('0xa')],'context':_0x265d1c[_0x52d536][0x0][_0xfa24('0x1b')],'priority':_0x3bc07a[_0xfa24('0x10')],'VoiceExtensionId':_0x265d1c[_0x52d536][0x0][_0xfa24('0x19')]});_0x3d5522['push'](_0x265d1c[_0x52d536][0x0][_0xfa24('0x19')]);_0xe44d4e=_[_0xfa24('0x44')](_0xe44d4e,_0x3bc07a['extensions']);}}return _0x4cfd69['transaction'](function(_0x2faa16){return _0x4cfd69[_0xfa24('0x2')][_0xfa24('0x6')][_0xfa24('0x46')]({'where':{'VoiceExtensionId':{'$in':_0x3d5522}},'transaction':_0x2faa16})[_0xfa24('0x7')](function(_0x1598d9){return _0x4cfd69[_0xfa24('0x2')][_0xfa24('0x6')]['bulkCreate'](_[_0xfa24('0x47')](_0xe44d4e,'priority'),{'transaction':_0x2faa16});});});})[_0xfa24('0x48')](function(_0x584d06){console[_0xfa24('0x49')](_0x584d06);});}exports[_0xfa24('0x4a')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 850f49d..4b12127 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 _0x9f27=['data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','find','Duplicate\x20Contact','create','keys','then','pick','stringify','cmContact','checkHopper','inspect','insert','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_contacts','id\x20IN\x20?','str','calleridnum','cm_hopper_final','\x20=\x20?','into','deletedAt\x20IS\x20NULL','cm_hopper_black','ListId\x20=\x20?','VoiceQueue','dialCheckDuplicateType','CmList','Lists','get','push','sequelize','query','VoiceQueueId','onlyIfOpen','catch','findAll','outbound','BlackLists','Campaign','always','CampaignId','all','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','CmContact','parse','duplicate','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','../../../mysqldb','../../../config/logger','api','redis','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join'];(function(_0x54f8b0,_0x200f54){var _0x53394f=function(_0x1048ac){while(--_0x1048ac){_0x54f8b0['push'](_0x54f8b0['shift']());}};_0x53394f(++_0x200f54);}(_0x9f27,0x1a1));var _0x79f2=function(_0x1ffe76,_0x4ebdfd){_0x1ffe76=_0x1ffe76-0x0;var _0x279a53=_0x9f27[_0x1ffe76];return _0x279a53;};'use strict';var BPromise=require(_0x79f2('0x0'));var util=require(_0x79f2('0x1'));var _=require(_0x79f2('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require('ioredis');var db=require(_0x79f2('0x3'))['db'];var config=require('../../../config/environment');var logger=require(_0x79f2('0x4'))(_0x79f2('0x5'));config[_0x79f2('0x6')]=_['defaults'](config[_0x79f2('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x79f2('0x7'))(new Redis(config['redis']));require(_0x79f2('0x8'))[_0x79f2('0x9')](socket);try{if(!process['argv'][0x2]||process[_0x79f2('0xa')][0x2]===_0x79f2('0xb')||process['argv'][0x2]===_0x79f2('0xc')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x79f2('0xa')][0x2];if(!process[_0x79f2('0xa')][0x3]||process[_0x79f2('0xa')][0x3]==='undefined'||process[_0x79f2('0xa')][0x3]===_0x79f2('0xc')||!process['argv'][0x4]||process['argv'][0x4]===_0x79f2('0xb')||process[_0x79f2('0xa')][0x4]==='null'){throw new Error(_0x79f2('0xd'));}var FIELDS=_[_0x79f2('0xe')](process[_0x79f2('0xa')][0x3][_0x79f2('0xf')](','),process[_0x79f2('0xa')][0x4]['split'](','));if(!process[_0x79f2('0xa')][0x5]||process[_0x79f2('0xa')][0x5]===_0x79f2('0xb')||process[_0x79f2('0xa')][0x5]===_0x79f2('0xc')){throw new Error(_0x79f2('0x10'));}var LISTID=process[_0x79f2('0xa')][0x5];var COMPANYID=process[_0x79f2('0xa')][0x6]&&process[_0x79f2('0xa')][0x6]!==_0x79f2('0xb')&&process['argv'][0x6]!==_0x79f2('0xc')?process[_0x79f2('0xa')][0x6]:null;var DUPLICATES=process[_0x79f2('0xa')][0x7]&&process[_0x79f2('0xa')][0x7]!==_0x79f2('0xb')&&process[_0x79f2('0xa')][0x7]!==_0x79f2('0xc')?process[_0x79f2('0xa')][0x7]:null;if(!process[_0x79f2('0xa')][0x8]||process[_0x79f2('0xa')][0x8]==='undefined'||process['argv'][0x8]===_0x79f2('0xc')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x79f2('0xa')][0x8];}catch(_0x4223fb){logger[_0x79f2('0x11')](_0x4223fb);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(_0x1c5e17,_0x1392b1,_0x4193a9,_0x8e5b0a){var _0x341f8f={'message':_0x1392b1};_0x341f8f[_0x1c5e17]=!![];if(_0x4193a9){_0x341f8f[_0x79f2('0x12')]=_0x4193a9;}if(_0x8e5b0a){_0x341f8f[_0x79f2('0x13')]=_0x8e5b0a;}return _0x341f8f;}function isEmail(_0x5b4f54){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'](_0x5b4f54);}function checkRow(_0x36efa3,_0x6d5ccf,_0x3e642e){return new BPromise(function(_0x3012eb,_0x58ce43){if(_[_0x79f2('0x14')](_0x36efa3)){return _0x58ce43(handleCheckRowError(_0x79f2('0x11'),_0x79f2('0x15'),null,_0x3e642e));}if(_0x36efa3['errors']&&_0x36efa3[_0x79f2('0x16')][_0x79f2('0x17')]){var _0x21800e=_[_0x79f2('0x18')](_0x36efa3[_0x79f2('0x16')],_0x79f2('0x19'))[_0x79f2('0x1a')](';');return _0x58ce43(handleCheckRowError(_0x79f2('0x11'),_0x21800e,null,_0x3e642e));}var _0xebc60={};for(var _0x9d7fcf in FIELDS){if(FIELDS['hasOwnProperty'](_0x9d7fcf)&&FIELDS[_0x9d7fcf]){_0xebc60[_0x9d7fcf]=_0x36efa3[_0x79f2('0x1b')][0x0][FIELDS[_0x9d7fcf]]||_0x36efa3[_0x79f2('0x1b')][0x0]['\ufeff'+FIELDS[_0x9d7fcf]];}}if(!_0xebc60[_0x79f2('0x1c')]){return _0x58ce43(handleCheckRowError(_0x79f2('0x11'),_0x79f2('0x1d'),null,_0x3e642e));}if(!_0xebc60[_0x79f2('0x1e')]){return _0x58ce43(handleCheckRowError(_0x79f2('0x11'),_0x79f2('0x1f'),null,_0x3e642e));}if(_0xebc60['birthDate']){var _0x13d47e=moment(_0xebc60[_0x79f2('0x20')],_0x79f2('0x21'));if(!_0x13d47e[_0x79f2('0x22')]()){return _0x58ce43(handleCheckRowError(_0x79f2('0x11'),_0x79f2('0x23'),null,_0x3e642e));}}if(_0xebc60[_0x79f2('0x24')]){if(!isEmail(_0xebc60['email'])){return _0x58ce43(handleCheckRowError(_0x79f2('0x11'),'email\x20format\x20is\x20not\x20valid!',null,_0x3e642e));}}_0xebc60[_0x79f2('0x25')]=LISTID;_0xebc60[_0x79f2('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x6d5ccf){var _0x39767f={};for(var _0x222c99=0x0,_0x266135=DUPLICATES['length'];_0x222c99<_0x266135;_0x222c99+=0x1){_0x39767f[DUPLICATES[_0x222c99]]=_0xebc60[DUPLICATES[_0x222c99]];}var _0x3f6709=_[_0x79f2('0x27')](_0x6d5ccf,_0x39767f);if(_0x3f6709){return _0x58ce43(handleCheckRowError('duplicate',_0x79f2('0x28'),_0x3f6709,_0x3e642e));}}return db['CmContact'][_0x79f2('0x29')](_0xebc60,{'raw':!![],'hooks':![],'fields':_[_0x79f2('0x2a')](_0xebc60)})[_0x79f2('0x2b')](function(_0x9a67df){if(DUPLICATES&&DUPLICATES[_0x79f2('0x17')]&&_0x6d5ccf){_0x6d5ccf['push'](_[_0x79f2('0x2c')](_0xebc60,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x9a67df['id'];return _0x3012eb();})['catch'](function(_0xab67f7){return _0x58ce43(handleCheckRowError('error','Error\x20while\x20creating\x20contact:\x20'+(_0xab67f7[_0x79f2('0x19')]||JSON[_0x79f2('0x2d')](_0xab67f7)),null,_0x3e642e));});});}function checkHopper(){function _0xf95fa6(){return function(_0x4b2616){logger[_0x79f2('0x11')](_0x79f2('0x2e'),_0x79f2('0x2f'),util[_0x79f2('0x30')](_0x4b2616,{'showHidden':![],'depth':null}));};}var _0x192c5d=function(_0x28cfeb,_0x5e4eed){var _0xd02f3a=squel[_0x79f2('0x31')]()['into'](_0x79f2('0x32'))[_0x79f2('0x33')]([_0x79f2('0x1e'),_0x79f2('0x34'),_0x79f2('0x35'),'ListId',_0x5e4eed,_0x79f2('0x36'),_0x79f2('0x37')],squel[_0x79f2('0x38')]()[_0x79f2('0x39')](_0x79f2('0x1e'),_0x79f2('0x1e'))[_0x79f2('0x39')](_0x79f2('0x3a'),'scheduledAt')['field']('id','ContactId')[_0x79f2('0x39')](LISTID['toString'](),_0x79f2('0x25'))[_0x79f2('0x39')](_0x28cfeb['id'][_0x79f2('0x3b')](),_0x5e4eed)[_0x79f2('0x39')](_0x79f2('0x3a'),_0x79f2('0x36'))[_0x79f2('0x39')](_0x79f2('0x3a'),_0x79f2('0x37'))[_0x79f2('0x3c')]('cm_contacts')[_0x79f2('0x3d')]('deletedAt\x20IS\x20NULL')[_0x79f2('0x3d')]('ListId\x20=\x20?',LISTID[_0x79f2('0x3b')]())[_0x79f2('0x3d')](_0x79f2('0x3e'))[_0x79f2('0x3d')](_0x79f2('0x3f'),squel[_0x79f2('0x38')]()['field'](_0x79f2('0x1e'))[_0x79f2('0x3c')]('cm_hopper')[_0x79f2('0x3d')](_0x5e4eed+'\x20=\x20?',_0x28cfeb['id'][_0x79f2('0x3b')]())))[_0x79f2('0x3b')]();return _0xd02f3a;};var _0x37948b=function(_0x5cd658,_0x5f4c48){var _0x1ffffb=squel['insert']()['into'](_0x79f2('0x32'))['fromQuery']([_0x79f2('0x1e'),_0x79f2('0x34'),_0x79f2('0x35'),'ListId',_0x5f4c48,_0x79f2('0x36'),_0x79f2('0x37')],squel[_0x79f2('0x38')]()[_0x79f2('0x39')]('phone',_0x79f2('0x1e'))[_0x79f2('0x39')](_0x79f2('0x3a'),'scheduledAt')['field']('id',_0x79f2('0x35'))[_0x79f2('0x39')](LISTID['toString'](),_0x79f2('0x25'))[_0x79f2('0x39')](_0x5cd658['id']['toString'](),_0x5f4c48)[_0x79f2('0x39')](_0x79f2('0x3a'),_0x79f2('0x36'))[_0x79f2('0x39')]('NOW()',_0x79f2('0x37'))[_0x79f2('0x3c')](_0x79f2('0x40'))[_0x79f2('0x3d')]('deletedAt\x20IS\x20NULL')[_0x79f2('0x3d')]('ListId\x20=\x20?',LISTID['toString']())[_0x79f2('0x3d')](_0x79f2('0x41'),squel[_0x79f2('0x42')](hopperContacts))[_0x79f2('0x3d')](_0x79f2('0x3e'))[_0x79f2('0x3d')](_0x79f2('0x3f'),squel[_0x79f2('0x38')]()[_0x79f2('0x39')](_0x79f2('0x43'))[_0x79f2('0x3c')](_0x79f2('0x44'))[_0x79f2('0x3d')](_0x5f4c48+_0x79f2('0x45'),_0x5cd658['id'][_0x79f2('0x3b')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x79f2('0x39')](_0x79f2('0x1e'))[_0x79f2('0x3c')]('cm_hopper')[_0x79f2('0x3d')](_0x5f4c48+_0x79f2('0x45'),_0x5cd658['id'][_0x79f2('0x3b')]())))[_0x79f2('0x3b')]();return _0x1ffffb;};function _0x2e26cd(_0x457a02,_0xc7697c){var _0x4ac30c=squel[_0x79f2('0x31')]()[_0x79f2('0x46')](_0x79f2('0x32'))[_0x79f2('0x33')]([_0x79f2('0x1e'),'scheduledAt','ContactId',_0x79f2('0x25'),_0xc7697c,_0x79f2('0x36'),_0x79f2('0x37')],squel[_0x79f2('0x38')]()['field'](_0x79f2('0x1e'),_0x79f2('0x1e'))[_0x79f2('0x39')]('NOW()','scheduledAt')[_0x79f2('0x39')]('id',_0x79f2('0x35'))[_0x79f2('0x39')](LISTID[_0x79f2('0x3b')](),'ListId')[_0x79f2('0x39')](_0x457a02['id'][_0x79f2('0x3b')](),_0xc7697c)['field'](_0x79f2('0x3a'),'createdAt')[_0x79f2('0x39')](_0x79f2('0x3a'),_0x79f2('0x37'))[_0x79f2('0x3c')](_0x79f2('0x40'))['where'](_0x79f2('0x47'))[_0x79f2('0x3d')]('ListId\x20=\x20?',LISTID['toString']())[_0x79f2('0x3d')]('id\x20IN\x20?',squel[_0x79f2('0x42')](hopperContacts))[_0x79f2('0x3d')](_0x79f2('0x3e')))[_0x79f2('0x3b')]();return _0x4ac30c;}function _0x4f027f(_0x31c8b5,_0x1abc05){var _0x4efa8e=squel[_0x79f2('0x31')]()[_0x79f2('0x46')](_0x79f2('0x48'))[_0x79f2('0x33')]([_0x79f2('0x1e'),_0x79f2('0x35'),_0x79f2('0x25'),_0x1abc05,_0x79f2('0x36'),_0x79f2('0x37')],squel['select']()[_0x79f2('0x39')](_0x79f2('0x1e'),'phone')['field']('id',_0x79f2('0x35'))[_0x79f2('0x39')](LISTID[_0x79f2('0x3b')](),_0x79f2('0x25'))['field'](_0x31c8b5['id'][_0x79f2('0x3b')](),_0x1abc05)[_0x79f2('0x39')](_0x79f2('0x3a'),_0x79f2('0x36'))[_0x79f2('0x39')]('NOW()','updatedAt')[_0x79f2('0x3c')](_0x79f2('0x40'))[_0x79f2('0x3d')](_0x79f2('0x47'))['where'](_0x79f2('0x49'),LISTID[_0x79f2('0x3b')]())[_0x79f2('0x3d')](_0x79f2('0x41'),squel[_0x79f2('0x42')](hopperContacts))[_0x79f2('0x3d')](_0x79f2('0x3e')))[_0x79f2('0x3b')]();return _0x4efa8e;}return db[_0x79f2('0x4a')]['findAll']({'where':{'type':'outbound'},'attributes':['id',_0x79f2('0x4b')],'include':[{'model':db[_0x79f2('0x4c')],'as':_0x79f2('0x4d'),'where':{'id':LISTID}}]})[_0x79f2('0x2b')](function(_0x4f288a){var _0x21629a=[];if(_0x4f288a){var _0x4a35d6;for(var _0x1ee1b2=0x0,_0x1b6efe;_0x1ee1b2<_0x4f288a[_0x79f2('0x17')];_0x1ee1b2+=0x1){_0x1b6efe=_0x4f288a[_0x1ee1b2][_0x79f2('0x4e')]({'plain':!![]});switch(_0x1b6efe[_0x79f2('0x4b')]){case'always':_0x21629a[_0x79f2('0x4f')](db[_0x79f2('0x50')][_0x79f2('0x51')](_0x37948b(_0x1b6efe,_0x79f2('0x52')))['then'](function(){})['catch'](_0xf95fa6()));break;case _0x79f2('0x53'):_0x21629a[_0x79f2('0x4f')](db['sequelize']['query'](_0x192c5d(_0x1b6efe,_0x79f2('0x52')))[_0x79f2('0x2b')](function(){})['catch'](_0xf95fa6()));break;default:_0x21629a[_0x79f2('0x4f')](db['sequelize'][_0x79f2('0x51')](_0x2e26cd(_0x1b6efe,_0x79f2('0x52')))[_0x79f2('0x2b')](function(){})[_0x79f2('0x54')](_0xf95fa6()));}}}return _0x21629a;})['all']()['then'](function(){return db[_0x79f2('0x4a')][_0x79f2('0x55')]({'where':{'type':_0x79f2('0x56')},'attributes':['id'],'include':[{'model':db[_0x79f2('0x4c')],'as':_0x79f2('0x57'),'where':{'id':LISTID}}]})[_0x79f2('0x2b')](function(_0x3f1376){var _0x1baf79=[];if(_0x3f1376){var _0x44fe25;for(var _0x58e37c=0x0,_0x3d5c97;_0x58e37c<_0x3f1376[_0x79f2('0x17')];_0x58e37c+=0x1){_0x3d5c97=_0x3f1376[_0x58e37c][_0x79f2('0x4e')]({'plain':!![]});_0x1baf79[_0x79f2('0x4f')](db[_0x79f2('0x50')][_0x79f2('0x51')](_0x4f027f(_0x3d5c97,_0x79f2('0x52')))[_0x79f2('0x2b')](function(){})[_0x79f2('0x54')](_0xf95fa6()));}}return _0x1baf79;})['all']();})[_0x79f2('0x2b')](function(){return db[_0x79f2('0x58')][_0x79f2('0x55')]({'attributes':['id',_0x79f2('0x4b')],'include':[{'model':db[_0x79f2('0x4c')],'as':_0x79f2('0x4d'),'where':{'id':LISTID}}]})[_0x79f2('0x2b')](function(_0x4a8c9e){var _0x292d73=[];if(_0x4a8c9e){for(var _0x5f2791=0x0,_0x10245d;_0x5f2791<_0x4a8c9e[_0x79f2('0x17')];_0x5f2791+=0x1){_0x10245d=_0x4a8c9e[_0x5f2791][_0x79f2('0x4e')]({'plain':!![]});switch(_0x10245d[_0x79f2('0x4b')]){case _0x79f2('0x59'):_0x292d73[_0x79f2('0x4f')](db['sequelize'][_0x79f2('0x51')](_0x37948b(_0x10245d,'CampaignId'))[_0x79f2('0x2b')](function(){})[_0x79f2('0x54')](_0xf95fa6()));break;case _0x79f2('0x53'):_0x292d73[_0x79f2('0x4f')](db[_0x79f2('0x50')][_0x79f2('0x51')](_0x192c5d(_0x10245d,_0x79f2('0x5a')))['then'](function(){})[_0x79f2('0x54')](_0xf95fa6()));break;default:_0x292d73[_0x79f2('0x4f')](db[_0x79f2('0x50')]['query'](_0x2e26cd(_0x10245d,_0x79f2('0x5a')))['then'](function(){})[_0x79f2('0x54')](_0xf95fa6()));}}}return _0x292d73;})['all']();})[_0x79f2('0x2b')](function(){return db[_0x79f2('0x58')][_0x79f2('0x55')]({'attributes':['id'],'include':[{'model':db[_0x79f2('0x4c')],'as':_0x79f2('0x57'),'where':{'id':LISTID}}]})[_0x79f2('0x2b')](function(_0x4511a6){var _0x54ec10=[];if(_0x4511a6){for(var _0x5c72b6=0x0,_0x127db2;_0x5c72b6<_0x4511a6['length'];_0x5c72b6+=0x1){_0x127db2=_0x4511a6[_0x5c72b6][_0x79f2('0x4e')]({'plain':!![]});_0x54ec10[_0x79f2('0x4f')](db[_0x79f2('0x50')][_0x79f2('0x51')](_0x4f027f(_0x127db2,_0x79f2('0x5a')))[_0x79f2('0x2b')](function(){})['catch'](_0xf95fa6()));}}return _0x54ec10;})[_0x79f2('0x5b')]();})[_0x79f2('0x54')](function(_0x58be57){logger[_0x79f2('0x11')](_0x79f2('0x5c'),_0x79f2('0x5d'),_0x58be57[_0x79f2('0x19')]);});}var processPromises=function(_0x225bc4){return BPromise[_0x79f2('0x5b')](promises)['then'](function(_0x3ba175){})[_0x79f2('0x54')](function(_0x4510c0){logger[_0x79f2('0x11')](_0x79f2('0x5e'),JSON[_0x79f2('0x2d')](_0x4510c0));})[_0x79f2('0x5f')](function(){socket[_0x79f2('0x60')](_0x79f2('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x225bc4){return _0x225bc4[_0x79f2('0x62')]();}});};var endCsv=function(){return BPromise[_0x79f2('0x63')]()[_0x79f2('0x2b')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x79f2('0x60')](_0x79f2('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x53342c){logger['error'](_0x79f2('0x64'),JSON['stringify'](_0x53342c));}finally{process[_0x79f2('0x65')](0x0);}});};process['on'](_0x79f2('0x66'),function(){logger[_0x79f2('0x67')](_0x79f2('0x68'));endCsv();});function main(){return BPromise[_0x79f2('0x63')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x79f2('0xf')](',');return db[_0x79f2('0x69')][_0x79f2('0x55')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x5a1d9b){var _0x339ff3=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x79f2('0x6a')](_0x339ff3,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5daa25,_0x1880c9){total+=0x1;var _0x548fc8=total;promises[_0x79f2('0x4f')](checkRow(_0x5daa25,_0x5a1d9b,_0x548fc8)[_0x79f2('0x2b')](function(){success+=0x1;})[_0x79f2('0x54')](function(_0xa7ed52){if(_0xa7ed52[_0x79f2('0x11')]){errors+=0x1;delete _0xa7ed52[_0x79f2('0x11')];}else if(_0xa7ed52[_0x79f2('0x6b')]){duplicates+=0x1;delete _0xa7ed52['duplicate'];}rows[_0x79f2('0x4f')](_0xa7ed52);}));if(total%0xc8===0x0){_0x1880c9['pause']();return processPromises(_0x1880c9);}},'complete':function(){return processPromises()[_0x79f2('0x2b')](function(){logger[_0x79f2('0x67')](_0x79f2('0x6c'));endCsv();});},'error':function(_0x4f0c68,_0x201ac7){logger[_0x79f2('0x67')](_0x79f2('0x6d'),JSON['stringify'](_0x4f0c68));endCsv();}});})[_0x79f2('0x54')](function(_0x71718b){logger[_0x79f2('0x11')](_0x79f2('0x6e'),JSON['stringify'](_0x71718b));});}main(); \ No newline at end of file +var _0xf682=['firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','duplicate','Duplicate\x20Contact','CmContact','keys','push','pick','Error\x20while\x20creating\x20contact:\x20','message','stringify','checkHopper','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','\x20=\x20?','str','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','then','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','catch','all','BlackLists','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parse\x20error','bluebird','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','errors','length','join','hasOwnProperty','data'];(function(_0x251698,_0x287c70){var _0x19901f=function(_0x53ef18){while(--_0x53ef18){_0x251698['push'](_0x251698['shift']());}};_0x19901f(++_0x287c70);}(_0xf682,0x198));var _0x2f68=function(_0x59a229,_0x24f866){_0x59a229=_0x59a229-0x0;var _0x3eadcc=_0xf682[_0x59a229];return _0x3eadcc;};'use strict';var BPromise=require(_0x2f68('0x0'));var util=require(_0x2f68('0x1'));var _=require(_0x2f68('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x2f68('0x3'));var Redis=require(_0x2f68('0x4'));var db=require(_0x2f68('0x5'))['db'];var config=require(_0x2f68('0x6'));var logger=require(_0x2f68('0x7'))(_0x2f68('0x8'));config[_0x2f68('0x9')]=_[_0x2f68('0xa')](config[_0x2f68('0x9')],{'host':_0x2f68('0xb'),'port':0x18eb});var socket=require(_0x2f68('0xc'))(new Redis(config[_0x2f68('0x9')]));require('../../../api/cmContact/cmContact.socket')[_0x2f68('0xd')](socket);try{if(!process[_0x2f68('0xe')][0x2]||process[_0x2f68('0xe')][0x2]===_0x2f68('0xf')||process[_0x2f68('0xe')][0x2]===_0x2f68('0x10')){throw new Error(_0x2f68('0x11'));}var FILEPATH=process[_0x2f68('0xe')][0x2];if(!process['argv'][0x3]||process['argv'][0x3]===_0x2f68('0xf')||process['argv'][0x3]===_0x2f68('0x10')||!process[_0x2f68('0xe')][0x4]||process[_0x2f68('0xe')][0x4]==='undefined'||process[_0x2f68('0xe')][0x4]==='null'){throw new Error(_0x2f68('0x12'));}var FIELDS=_[_0x2f68('0x13')](process['argv'][0x3][_0x2f68('0x14')](','),process['argv'][0x4][_0x2f68('0x14')](','));if(!process[_0x2f68('0xe')][0x5]||process[_0x2f68('0xe')][0x5]===_0x2f68('0xf')||process['argv'][0x5]==='null'){throw new Error(_0x2f68('0x15'));}var LISTID=process[_0x2f68('0xe')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x2f68('0xe')][0x6]!==_0x2f68('0xf')&&process[_0x2f68('0xe')][0x6]!=='null'?process[_0x2f68('0xe')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process['argv'][0x7]!==_0x2f68('0xf')&&process[_0x2f68('0xe')][0x7]!==_0x2f68('0x10')?process[_0x2f68('0xe')][0x7]:null;if(!process['argv'][0x8]||process[_0x2f68('0xe')][0x8]==='undefined'||process['argv'][0x8]===_0x2f68('0x10')){throw new Error(_0x2f68('0x16'));}var SOCKET_TIMESTAMP=process[_0x2f68('0xe')][0x8];}catch(_0x319f2a){logger[_0x2f68('0x17')](_0x319f2a);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(_0x41128d,_0x470cee,_0x1250b0,_0x4d19e6){var _0x1a847={'message':_0x470cee};_0x1a847[_0x41128d]=!![];if(_0x1250b0){_0x1a847[_0x2f68('0x18')]=_0x1250b0;}if(_0x4d19e6){_0x1a847[_0x2f68('0x19')]=_0x4d19e6;}return _0x1a847;}function isEmail(_0x127140){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'](_0x127140);}function checkRow(_0x1a80bc,_0x579c63,_0x501511){return new BPromise(function(_0x5c44b4,_0x2202bd){if(_[_0x2f68('0x1a')](_0x1a80bc)){return _0x2202bd(handleCheckRowError(_0x2f68('0x17'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x501511));}if(_0x1a80bc[_0x2f68('0x1b')]&&_0x1a80bc[_0x2f68('0x1b')][_0x2f68('0x1c')]){var _0xdc95f2=_['map'](_0x1a80bc[_0x2f68('0x1b')],'message')[_0x2f68('0x1d')](';');return _0x2202bd(handleCheckRowError(_0x2f68('0x17'),_0xdc95f2,null,_0x501511));}var _0x5a3a7c={};for(var _0x15b403 in FIELDS){if(FIELDS[_0x2f68('0x1e')](_0x15b403)&&FIELDS[_0x15b403]){_0x5a3a7c[_0x15b403]=_0x1a80bc[_0x2f68('0x1f')][0x0][FIELDS[_0x15b403]]||_0x1a80bc[_0x2f68('0x1f')][0x0]['\ufeff'+FIELDS[_0x15b403]];}}if(!_0x5a3a7c[_0x2f68('0x20')]){return _0x2202bd(handleCheckRowError(_0x2f68('0x17'),_0x2f68('0x21'),null,_0x501511));}if(!_0x5a3a7c[_0x2f68('0x22')]){return _0x2202bd(handleCheckRowError('error',_0x2f68('0x23'),null,_0x501511));}if(_0x5a3a7c[_0x2f68('0x24')]){var _0x134eee=moment(_0x5a3a7c[_0x2f68('0x24')],'YYYY-MM-DD');if(!_0x134eee[_0x2f68('0x25')]()){return _0x2202bd(handleCheckRowError('error',_0x2f68('0x26'),null,_0x501511));}}if(_0x5a3a7c['email']){if(!isEmail(_0x5a3a7c[_0x2f68('0x27')])){return _0x2202bd(handleCheckRowError(_0x2f68('0x17'),'email\x20format\x20is\x20not\x20valid!',null,_0x501511));}}_0x5a3a7c[_0x2f68('0x28')]=LISTID;_0x5a3a7c[_0x2f68('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x2f68('0x1c')]&&_0x579c63){var _0xf30ffe={};for(var _0x3f4ea6=0x0,_0x5c1713=DUPLICATES['length'];_0x3f4ea6<_0x5c1713;_0x3f4ea6+=0x1){_0xf30ffe[DUPLICATES[_0x3f4ea6]]=_0x5a3a7c[DUPLICATES[_0x3f4ea6]];}var _0x275b58=_['find'](_0x579c63,_0xf30ffe);if(_0x275b58){return _0x2202bd(handleCheckRowError(_0x2f68('0x2a'),_0x2f68('0x2b'),_0x275b58,_0x501511));}}return db[_0x2f68('0x2c')]['create'](_0x5a3a7c,{'raw':!![],'hooks':![],'fields':_[_0x2f68('0x2d')](_0x5a3a7c)})['then'](function(_0x1c4ca0){if(DUPLICATES&&DUPLICATES['length']&&_0x579c63){_0x579c63[_0x2f68('0x2e')](_[_0x2f68('0x2f')](_0x5a3a7c,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1c4ca0['id'];return _0x5c44b4();})['catch'](function(_0x45d592){return _0x2202bd(handleCheckRowError(_0x2f68('0x17'),_0x2f68('0x30')+(_0x45d592[_0x2f68('0x31')]||JSON[_0x2f68('0x32')](_0x45d592)),null,_0x501511));});});}function checkHopper(){function _0x415651(){return function(_0xea3e84){logger[_0x2f68('0x17')]('cmContact',_0x2f68('0x33'),util['inspect'](_0xea3e84,{'showHidden':![],'depth':null}));};}var _0x9b5b09=function(_0x3c3936,_0x3b7dfa){var _0x333892=squel[_0x2f68('0x34')]()[_0x2f68('0x35')](_0x2f68('0x36'))[_0x2f68('0x37')]([_0x2f68('0x22'),_0x2f68('0x38'),_0x2f68('0x39'),_0x2f68('0x28'),_0x3b7dfa,_0x2f68('0x3a'),_0x2f68('0x3b')],squel[_0x2f68('0x3c')]()[_0x2f68('0x3d')](_0x2f68('0x22'),_0x2f68('0x22'))[_0x2f68('0x3d')](_0x2f68('0x3e'),_0x2f68('0x38'))['field']('id',_0x2f68('0x39'))['field'](LISTID[_0x2f68('0x3f')](),_0x2f68('0x28'))[_0x2f68('0x3d')](_0x3c3936['id'][_0x2f68('0x3f')](),_0x3b7dfa)[_0x2f68('0x3d')](_0x2f68('0x3e'),'createdAt')[_0x2f68('0x3d')](_0x2f68('0x3e'),_0x2f68('0x3b'))[_0x2f68('0x40')](_0x2f68('0x41'))[_0x2f68('0x42')](_0x2f68('0x43'))[_0x2f68('0x42')](_0x2f68('0x44'),LISTID['toString']())[_0x2f68('0x42')](_0x2f68('0x45'))[_0x2f68('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0x2f68('0x3c')]()[_0x2f68('0x3d')]('phone')[_0x2f68('0x40')](_0x2f68('0x36'))['where'](_0x3b7dfa+_0x2f68('0x46'),_0x3c3936['id']['toString']())))[_0x2f68('0x3f')]();return _0x333892;};var _0x4dc863=function(_0x1f5a1d,_0x3a0cba){var _0x1eaa1d=squel[_0x2f68('0x34')]()[_0x2f68('0x35')](_0x2f68('0x36'))[_0x2f68('0x37')]([_0x2f68('0x22'),_0x2f68('0x38'),_0x2f68('0x39'),_0x2f68('0x28'),_0x3a0cba,_0x2f68('0x3a'),_0x2f68('0x3b')],squel[_0x2f68('0x3c')]()[_0x2f68('0x3d')](_0x2f68('0x22'),_0x2f68('0x22'))['field'](_0x2f68('0x3e'),'scheduledAt')[_0x2f68('0x3d')]('id','ContactId')['field'](LISTID[_0x2f68('0x3f')](),_0x2f68('0x28'))[_0x2f68('0x3d')](_0x1f5a1d['id']['toString'](),_0x3a0cba)[_0x2f68('0x3d')]('NOW()',_0x2f68('0x3a'))['field'](_0x2f68('0x3e'),_0x2f68('0x3b'))[_0x2f68('0x40')](_0x2f68('0x41'))[_0x2f68('0x42')](_0x2f68('0x43'))[_0x2f68('0x42')](_0x2f68('0x44'),LISTID[_0x2f68('0x3f')]())[_0x2f68('0x42')]('id\x20IN\x20?',squel[_0x2f68('0x47')](hopperContacts))[_0x2f68('0x42')](_0x2f68('0x45'))[_0x2f68('0x42')](_0x2f68('0x48'),squel[_0x2f68('0x3c')]()['field'](_0x2f68('0x49'))[_0x2f68('0x40')](_0x2f68('0x4a'))[_0x2f68('0x42')](_0x3a0cba+_0x2f68('0x46'),_0x1f5a1d['id']['toString']()))['where'](_0x2f68('0x48'),squel[_0x2f68('0x3c')]()[_0x2f68('0x3d')](_0x2f68('0x22'))[_0x2f68('0x40')](_0x2f68('0x36'))[_0x2f68('0x42')](_0x3a0cba+_0x2f68('0x46'),_0x1f5a1d['id']['toString']())))[_0x2f68('0x3f')]();return _0x1eaa1d;};function _0x15ef55(_0x584de6,_0x1d0110){var _0x414bb2=squel[_0x2f68('0x34')]()[_0x2f68('0x35')](_0x2f68('0x36'))[_0x2f68('0x37')](['phone',_0x2f68('0x38'),_0x2f68('0x39'),_0x2f68('0x28'),_0x1d0110,'createdAt','updatedAt'],squel['select']()[_0x2f68('0x3d')](_0x2f68('0x22'),_0x2f68('0x22'))[_0x2f68('0x3d')]('NOW()',_0x2f68('0x38'))[_0x2f68('0x3d')]('id',_0x2f68('0x39'))['field'](LISTID[_0x2f68('0x3f')](),_0x2f68('0x28'))[_0x2f68('0x3d')](_0x584de6['id'][_0x2f68('0x3f')](),_0x1d0110)[_0x2f68('0x3d')](_0x2f68('0x3e'),_0x2f68('0x3a'))[_0x2f68('0x3d')](_0x2f68('0x3e'),'updatedAt')[_0x2f68('0x40')](_0x2f68('0x41'))[_0x2f68('0x42')](_0x2f68('0x43'))[_0x2f68('0x42')](_0x2f68('0x44'),LISTID['toString']())[_0x2f68('0x42')](_0x2f68('0x4b'),squel[_0x2f68('0x47')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x2f68('0x3f')]();return _0x414bb2;}function _0x52e43e(_0x5ae582,_0x133228){var _0x484513=squel[_0x2f68('0x34')]()['into'](_0x2f68('0x4c'))[_0x2f68('0x37')]([_0x2f68('0x22'),_0x2f68('0x39'),_0x2f68('0x28'),_0x133228,_0x2f68('0x3a'),_0x2f68('0x3b')],squel[_0x2f68('0x3c')]()[_0x2f68('0x3d')](_0x2f68('0x22'),_0x2f68('0x22'))[_0x2f68('0x3d')]('id',_0x2f68('0x39'))[_0x2f68('0x3d')](LISTID['toString'](),_0x2f68('0x28'))[_0x2f68('0x3d')](_0x5ae582['id'][_0x2f68('0x3f')](),_0x133228)[_0x2f68('0x3d')](_0x2f68('0x3e'),_0x2f68('0x3a'))[_0x2f68('0x3d')](_0x2f68('0x3e'),_0x2f68('0x3b'))[_0x2f68('0x40')](_0x2f68('0x41'))[_0x2f68('0x42')](_0x2f68('0x43'))['where']('ListId\x20=\x20?',LISTID[_0x2f68('0x3f')]())[_0x2f68('0x42')]('id\x20IN\x20?',squel[_0x2f68('0x47')](hopperContacts))[_0x2f68('0x42')](_0x2f68('0x45')))[_0x2f68('0x3f')]();return _0x484513;}return db[_0x2f68('0x4d')][_0x2f68('0x4e')]({'where':{'type':_0x2f68('0x4f')},'attributes':['id',_0x2f68('0x50')],'include':[{'model':db[_0x2f68('0x51')],'as':_0x2f68('0x52'),'where':{'id':LISTID}}]})[_0x2f68('0x53')](function(_0xff1a4e){var _0x4f088c=[];if(_0xff1a4e){var _0x1abc30;for(var _0x534179=0x0,_0x13c829;_0x534179<_0xff1a4e[_0x2f68('0x1c')];_0x534179+=0x1){_0x13c829=_0xff1a4e[_0x534179][_0x2f68('0x54')]({'plain':!![]});switch(_0x13c829[_0x2f68('0x50')]){case _0x2f68('0x55'):_0x4f088c['push'](db[_0x2f68('0x56')][_0x2f68('0x57')](_0x4dc863(_0x13c829,_0x2f68('0x58')))[_0x2f68('0x53')](function(){})['catch'](_0x415651()));break;case _0x2f68('0x59'):_0x4f088c['push'](db['sequelize'][_0x2f68('0x57')](_0x9b5b09(_0x13c829,_0x2f68('0x58')))[_0x2f68('0x53')](function(){})[_0x2f68('0x5a')](_0x415651()));break;default:_0x4f088c['push'](db['sequelize']['query'](_0x15ef55(_0x13c829,_0x2f68('0x58')))['then'](function(){})['catch'](_0x415651()));}}}return _0x4f088c;})[_0x2f68('0x5b')]()['then'](function(){return db['VoiceQueue']['findAll']({'where':{'type':_0x2f68('0x4f')},'attributes':['id'],'include':[{'model':db[_0x2f68('0x51')],'as':_0x2f68('0x5c'),'where':{'id':LISTID}}]})[_0x2f68('0x53')](function(_0x24164f){var _0x1022b1=[];if(_0x24164f){var _0x864515;for(var _0x165d4a=0x0,_0x28011c;_0x165d4a<_0x24164f[_0x2f68('0x1c')];_0x165d4a+=0x1){_0x28011c=_0x24164f[_0x165d4a][_0x2f68('0x54')]({'plain':!![]});_0x1022b1[_0x2f68('0x2e')](db['sequelize']['query'](_0x52e43e(_0x28011c,_0x2f68('0x58')))[_0x2f68('0x53')](function(){})[_0x2f68('0x5a')](_0x415651()));}}return _0x1022b1;})['all']();})[_0x2f68('0x53')](function(){return db['Campaign'][_0x2f68('0x4e')]({'attributes':['id',_0x2f68('0x50')],'include':[{'model':db[_0x2f68('0x51')],'as':_0x2f68('0x52'),'where':{'id':LISTID}}]})[_0x2f68('0x53')](function(_0x893533){var _0x2649ca=[];if(_0x893533){for(var _0x3bb56e=0x0,_0x5e3725;_0x3bb56e<_0x893533['length'];_0x3bb56e+=0x1){_0x5e3725=_0x893533[_0x3bb56e][_0x2f68('0x54')]({'plain':!![]});switch(_0x5e3725['dialCheckDuplicateType']){case _0x2f68('0x55'):_0x2649ca[_0x2f68('0x2e')](db[_0x2f68('0x56')][_0x2f68('0x57')](_0x4dc863(_0x5e3725,'CampaignId'))['then'](function(){})[_0x2f68('0x5a')](_0x415651()));break;case _0x2f68('0x59'):_0x2649ca[_0x2f68('0x2e')](db[_0x2f68('0x56')]['query'](_0x9b5b09(_0x5e3725,_0x2f68('0x5d')))['then'](function(){})[_0x2f68('0x5a')](_0x415651()));break;default:_0x2649ca[_0x2f68('0x2e')](db[_0x2f68('0x56')][_0x2f68('0x57')](_0x15ef55(_0x5e3725,_0x2f68('0x5d')))[_0x2f68('0x53')](function(){})[_0x2f68('0x5a')](_0x415651()));}}}return _0x2649ca;})['all']();})[_0x2f68('0x53')](function(){return db['Campaign'][_0x2f68('0x4e')]({'attributes':['id'],'include':[{'model':db[_0x2f68('0x51')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x2f68('0x53')](function(_0x29fb99){var _0x3283b8=[];if(_0x29fb99){for(var _0x3e02ac=0x0,_0x4a9720;_0x3e02ac<_0x29fb99[_0x2f68('0x1c')];_0x3e02ac+=0x1){_0x4a9720=_0x29fb99[_0x3e02ac][_0x2f68('0x54')]({'plain':!![]});_0x3283b8[_0x2f68('0x2e')](db[_0x2f68('0x56')]['query'](_0x52e43e(_0x4a9720,'CampaignId'))[_0x2f68('0x53')](function(){})['catch'](_0x415651()));}}return _0x3283b8;})[_0x2f68('0x5b')]();})[_0x2f68('0x5a')](function(_0x58a5a4){logger['error'](_0x2f68('0x5e'),_0x2f68('0x5f'),_0x58a5a4[_0x2f68('0x31')]);});}var processPromises=function(_0x233a2a){return BPromise['all'](promises)[_0x2f68('0x53')](function(_0x2be674){})[_0x2f68('0x5a')](function(_0x130405){logger[_0x2f68('0x17')](_0x2f68('0x60'),JSON[_0x2f68('0x32')](_0x130405));})[_0x2f68('0x61')](function(){socket[_0x2f68('0x62')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x233a2a){return _0x233a2a[_0x2f68('0x63')]();}});};var endCsv=function(){return BPromise[_0x2f68('0x64')]()[_0x2f68('0x53')](function(){if(hopperContacts){return checkHopper();}})[_0x2f68('0x53')](function(){socket[_0x2f68('0x62')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x2f68('0x65')](FILEPATH);}catch(_0x5b9488){logger['error'](_0x2f68('0x66'),JSON[_0x2f68('0x32')](_0x5b9488));}finally{process[_0x2f68('0x67')](0x0);}});};process['on'](_0x2f68('0x68'),function(){logger['info'](_0x2f68('0x69'));endCsv();});function main(){return BPromise[_0x2f68('0x64')]()[_0x2f68('0x53')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x2f68('0x14')](',');return db['CmContact'][_0x2f68('0x4e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x2f68('0x53')](function(_0x570c3b){var _0x3c02df=fs[_0x2f68('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x2f68('0x6b')](_0x3c02df,{'header':!![],'skipEmptyLines':!![],'step':function(_0x572904,_0x55f138){total+=0x1;var _0x1cb654=total;promises[_0x2f68('0x2e')](checkRow(_0x572904,_0x570c3b,_0x1cb654)[_0x2f68('0x53')](function(){success+=0x1;})[_0x2f68('0x5a')](function(_0x1450ab){if(_0x1450ab[_0x2f68('0x17')]){errors+=0x1;delete _0x1450ab['error'];}else if(_0x1450ab[_0x2f68('0x2a')]){duplicates+=0x1;delete _0x1450ab[_0x2f68('0x2a')];}rows[_0x2f68('0x2e')](_0x1450ab);}));if(total%0xc8===0x0){_0x55f138[_0x2f68('0x6c')]();return processPromises(_0x55f138);}},'complete':function(){return processPromises()[_0x2f68('0x53')](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x4dded8,_0x33b0a4){logger['info'](_0x2f68('0x6d'),JSON[_0x2f68('0x32')](_0x4dded8));endCsv();}});})['catch'](function(_0x2a4aad){logger['error']('Error\x20executing\x20contact\x20csv\x20import:',JSON['stringify'](_0x2a4aad));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index c534f47..a6d199f 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 _0xec04=['cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper_black','fromQuery','createdAt','field','toString','concat','keys',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','info','Received\x20SIGINT','message','exit','errors','code','sequelize','spread','push','catch','main','stringify','send','start','binding','root','server/files/tmp','.csv','parse','createReadStream','data','length','rows','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','abort','SystemError','error','step','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CompanyId','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','phone','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','scheduledat','ContactId','ListId','updatedAt','priority','UserId','recallme','fields','from'];(function(_0x2685b2,_0x513f32){var _0x54b54e=function(_0x57ff7e){while(--_0x57ff7e){_0x2685b2['push'](_0x2685b2['shift']());}};_0x54b54e(++_0x513f32);}(_0xec04,0x1e1));var _0x4ec0=function(_0x29d840,_0x586ea){_0x29d840=_0x29d840-0x0;var _0x2afada=_0xec04[_0x29d840];return _0x2afada;};'use strict';var fs=require('fs');var path=require(_0x4ec0('0x0'));var _=require(_0x4ec0('0x1'));var Papa=require(_0x4ec0('0x2'));var util=require(_0x4ec0('0x3'));var BPromise=require(_0x4ec0('0x4'));var moment=require(_0x4ec0('0x5'));var squel=require(_0x4ec0('0x6'));var Redis=require(_0x4ec0('0x7'));var db=require(_0x4ec0('0x8'))['db'];var config=require(_0x4ec0('0x9'));var logger=require(_0x4ec0('0xa'))('import');config[_0x4ec0('0xb')]=_[_0x4ec0('0xc')](config[_0x4ec0('0xb')],{'host':_0x4ec0('0xd'),'port':0x18eb});var socket=require(_0x4ec0('0xe'))(new Redis(config[_0x4ec0('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x4ec0('0xf')](_0x4ec0('0x10'));function isEmail(_0x19ac6f){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))*$/[_0x4ec0('0x11')](_0x19ac6f);}function selectNotIn(_0x545559,_0x2f3a71,_0x5760da,_0x5550ba,_0x11727d){return squel[_0x4ec0('0x12')]()['field'](_0x4ec0('0x13'))['from'](_0x5550ba)[_0x4ec0('0x14')](_0x2f3a71,null,_0x2f3a71+_0x4ec0('0x15')+_0x5550ba+'.'+_0x5760da)[_0x4ec0('0x16')](_0x5550ba+'.'+_0x5760da+_0x4ec0('0x17')+_0x545559+'.'+_0x5760da)['where'](_0x2f3a71+_0x4ec0('0x18')+_0x11727d['join']()+')');}function insertCmHopper(_0x5e4e53,_0x142c3c,_0x187368,_0x31607b,_0x2dd677){var _0x2fa8e8=[_0x4ec0('0x19'),'cm_contacts.scheduledat',_0x4ec0('0x1a'),_0x4ec0('0x1b'),_0x142c3c+'.'+_0x31607b,_0x4ec0('0x1c'),_0x4ec0('0x1d'),_0x4ec0('0x1e'),'cm_contacts.UserId','\x22'+_0x2dd677+'\x22'];return squel[_0x4ec0('0x1f')]()[_0x4ec0('0x20')](_0x4ec0('0x21'))['fromQuery']([_0x4ec0('0x13'),_0x4ec0('0x22'),_0x4ec0('0x23'),_0x4ec0('0x24'),_0x31607b,'createdAt',_0x4ec0('0x25'),_0x4ec0('0x26'),_0x4ec0('0x27'),_0x4ec0('0x28')],squel['select']()[_0x4ec0('0x29')](_0x2fa8e8)[_0x4ec0('0x2a')](_0x142c3c)['join'](_0x4ec0('0x2b'),null,_0x4ec0('0x2c')+_0x142c3c+_0x4ec0('0x2d'))[_0x4ec0('0x14')](_0x187368,null,_0x187368+_0x4ec0('0x15')+_0x142c3c+'.'+_0x31607b)[_0x4ec0('0x16')](_0x142c3c+_0x4ec0('0x2e'),_0x5e4e53)[_0x4ec0('0x16')](_0x4ec0('0x2f'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x142c3c,_0x187368,_0x31607b,_0x4ec0('0x21'),[_0x4ec0('0x30'),'\x22onlyIfOpen\x22']))[_0x4ec0('0x16')](_0x4ec0('0x31'),selectNotIn(_0x142c3c,_0x187368,_0x31607b,_0x4ec0('0x21'),['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x17b254,_0x34f2d9,_0x2dc7c7,_0x1d7cb2){var _0x54a530=[_0x4ec0('0x19'),'cm_contacts.id',_0x4ec0('0x1b'),_0x34f2d9+'.'+_0x1d7cb2,_0x4ec0('0x1c'),_0x4ec0('0x1d')];return squel[_0x4ec0('0x1f')]()['into'](_0x4ec0('0x32'))[_0x4ec0('0x33')](['phone',_0x4ec0('0x23'),_0x4ec0('0x24'),_0x1d7cb2,_0x4ec0('0x34'),_0x4ec0('0x25')],squel[_0x4ec0('0x12')]()[_0x4ec0('0x29')](_0x54a530)['from'](_0x34f2d9)[_0x4ec0('0x14')](_0x4ec0('0x2b'),null,_0x4ec0('0x2c')+_0x34f2d9+_0x4ec0('0x2d'))[_0x4ec0('0x14')](_0x2dc7c7,null,_0x2dc7c7+_0x4ec0('0x15')+_0x34f2d9+'.'+_0x1d7cb2)[_0x4ec0('0x16')](_0x34f2d9+_0x4ec0('0x2e'),_0x17b254)[_0x4ec0('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x4ec0('0x31'),squel['select']()[_0x4ec0('0x35')]('phone')['from']('cm_hopper_black')['where']('ListId\x20=\x20?',_0x17b254)[_0x4ec0('0x16')](_0x1d7cb2+'\x20=\x20?',_0x34f2d9+'.'+_0x1d7cb2)))[_0x4ec0('0x36')]();}function insertCmContact(_0x464b6a,_0x5e6f8c,_0x259828,_0x428447){var _0x21d29b=_[_0x4ec0('0x37')](_[_0x4ec0('0x38')](_0x428447),[_0x4ec0('0x24'),'CompanyId','createdAt','updatedAt']);return squel[_0x4ec0('0x1f')]()['into']('cm_contacts')['fromQuery'](_0x21d29b,squel[_0x4ec0('0x12')]()['fields'](_0x21d29b)['from'](_0x5e6f8c)[_0x4ec0('0x16')]('('+_0x259828[_0x4ec0('0x14')](',')+_0x4ec0('0x39'),squel['select']()[_0x4ec0('0x29')](_0x259828)[_0x4ec0('0x2a')](_0x4ec0('0x2b'))[_0x4ec0('0x16')]('ListId\x20=\x20?',_0x464b6a)[_0x4ec0('0x16')](_0x4ec0('0x3a')))[_0x4ec0('0x16')]('id\x20IN\x20?',squel['select']()[_0x4ec0('0x35')](_0x4ec0('0x3b'),_0x4ec0('0x3c'))[_0x4ec0('0x2a')](_0x5e6f8c)['group'](_0x259828[_0x4ec0('0x14')](','))))[_0x4ec0('0x36')]();}function handleStop(){logger[_0x4ec0('0x3d')](_0x4ec0('0x3e'));stopped=!![];}function handleUncaughtException(_0x11a89){logger['error'](_0x11a89[_0x4ec0('0x3f')]);process[_0x4ec0('0x40')](0x1);}function handleError(_0x25cb5b,_0x2835cd){stats[_0x4ec0('0x41')]['push']({'name':_0x2835cd[_0x4ec0('0x42')],'message':_0x2835cd[_0x4ec0('0x3f')],'row':_0x25cb5b});}function handleQuery(_0x272fb9){logger[_0x4ec0('0x3d')](_0x272fb9);return db[_0x4ec0('0x43')]['query'](_0x272fb9)[_0x4ec0('0x44')](function(_0x1c127e){results[_0x4ec0('0x45')](_0x1c127e);})[_0x4ec0('0x46')](function(_0x51fa5d){logger['error'](_0x51fa5d[_0x4ec0('0x3f')]);});}function main(_0x37b4df,_0xc81069,_0x3c5dd8,_0x4ce7d6){logger[_0x4ec0('0x3d')](_0x4ec0('0x47'),_0x37b4df,JSON[_0x4ec0('0x48')](_0xc81069));process[_0x4ec0('0x49')](_0x4ec0('0x4a'));var _0x960e20=_0xc81069[_0x4ec0('0x4b')];var _0x4859fa=_0xc81069['socket_timestamp'];var _0x1a9d27=path[_0x4ec0('0x14')](config[_0x4ec0('0x4c')],_0x4ec0('0x4d'),_0x4859fa+_0x4ec0('0x4e'));var _0x6d7bba=_['keys'](_0x960e20)[_0x4ec0('0x14')]();logger[_0x4ec0('0x3d')]('header',_0x6d7bba);fs['writeFileSync'](_0x1a9d27,_0x6d7bba+'\x0a');Papa[_0x4ec0('0x4f')](fs[_0x4ec0('0x50')](_0x37b4df),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2bb136,_0x249293){try{for(var _0x3f8592=0x0,_0x102241=[];_0x3f8592<_0x2bb136[_0x4ec0('0x51')][_0x4ec0('0x52')];_0x3f8592++){stats[_0x4ec0('0x53')]+=0x1;if(_0x2bb136['errors'][_0x3f8592]){handleError(_0x2bb136['data'][_0x3f8592],_0x2bb136[_0x4ec0('0x41')][_0x3f8592]);}else{var _0x1f7e81=[];for(var _0x26d8b8 in _0x960e20){if(_0x960e20['hasOwnProperty'](_0x26d8b8)){if(_0x2bb136['data'][_0x3f8592][_0x960e20[_0x26d8b8]]){var _0x3956ca=_[_0x4ec0('0x54')](_0x2bb136['data'][_0x3f8592][_0x960e20[_0x26d8b8]][_0x4ec0('0x55')](/"/g,'\x27'));switch(_0x26d8b8){case'scheduledat':var _0xab920=moment(_0x3956ca,_0x4ec0('0x10'),!![]);if(_0xab920[_0x4ec0('0x56')]()){_0x102241[_0x4ec0('0x45')]('\x22'+_0x3956ca+'\x22');}else{_0x1f7e81[_0x4ec0('0x45')](_0x4ec0('0x57'));}break;case'priority':var _0x356e6f=parseInt(_0x3956ca);_0x3956ca=_[_0x4ec0('0x58')](_0x356e6f)||_0x356e6f<0x0||_0x356e6f>0x4?_0x4ce7d6?0x3:0x2:_0x356e6f;_0x102241[_0x4ec0('0x45')]('\x22'+_0x3956ca+'\x22');break;case'UserId':var _0xe69915=parseInt(_0x3956ca);if(_[_0x4ec0('0x59')](_0xe69915)&&_['includes'](_0x3c5dd8,_0xe69915)){_0x102241[_0x4ec0('0x45')]('\x22'+_0xe69915+'\x22');}else{_0x1f7e81[_0x4ec0('0x45')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x3956ca)){_0x102241['push']('\x22'+_0x3956ca+'\x22');}else{_0x1f7e81[_0x4ec0('0x45')](_0x4ec0('0x5a'));}break;case _0x4ec0('0x5b'):var _0x1984cb=moment(_0x3956ca,'YYYY-MM-DD',!![]);if(_0x1984cb[_0x4ec0('0x56')]()){_0x102241['push']('\x22'+_0x3956ca+'\x22');}else{_0x1f7e81[_0x4ec0('0x45')](_0x4ec0('0x5c'));}break;default:_0x102241[_0x4ec0('0x45')]('\x22'+_0x3956ca+'\x22');}}else{switch(_0x26d8b8){case _0x4ec0('0x5d'):case'phone':_0x1f7e81[_0x4ec0('0x45')](_0x26d8b8+_0x4ec0('0x5e'));break;default:_0x102241[_0x4ec0('0x45')]('\x22\x22');}}}}if(_0x1f7e81[_0x4ec0('0x52')]){handleError(_0x2bb136[_0x4ec0('0x51')][_0x3f8592],{'code':_0x4ec0('0x5f'),'message':_0x1f7e81['join']()});}else{fs[_0x4ec0('0x60')](_0x1a9d27,_0x102241[_0x4ec0('0x14')]()+'\x0a');}_0x102241=[];}if(!(stats[_0x4ec0('0x53')]%0xc8)){socket[_0x4ec0('0x61')](_0x4ec0('0x62')+_0x4859fa,stats);stats[_0x4ec0('0x41')]=[];}}if(stopped){logger[_0x4ec0('0x3d')]('Abort\x20parser');_0x249293[_0x4ec0('0x63')]();}}catch(_0x217fec){handleError(_0x2bb136[_0x4ec0('0x51')][_0x3f8592],{'code':_0x4ec0('0x64'),'message':_0x217fec[_0x4ec0('0x3f')]});logger[_0x4ec0('0x65')](_0x4ec0('0x66'),_0x217fec[_0x4ec0('0x3f')]);}},'complete':function(){try{var _0x2e0b8f=[];var _0x3be63b=_0x4ec0('0x2b');if(_0xc81069['duplicates']&&_0xc81069[_0x4ec0('0x67')][_0x4ec0('0x52')]){_0x3be63b='cm_contacts_'+_0x4859fa;_0x2e0b8f[_0x4ec0('0x45')](_0x4ec0('0x68')+_0x3be63b+_0x4ec0('0x69'));}var _0x454a73=util[_0x4ec0('0xf')]('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',_0x1a9d27,_0x3be63b,_0x6d7bba,_0xc81069['ListId'],_0xc81069[_0x4ec0('0x6a')]||null,NOW,NOW);if(_['isNil'](_0x960e20[_0x4ec0('0x22')])){_0x454a73+=',\x20scheduledAt\x20=\x20NOW()';}_0x2e0b8f[_0x4ec0('0x45')](_0x454a73);if(_0xc81069[_0x4ec0('0x67')]&&_0xc81069[_0x4ec0('0x67')][_0x4ec0('0x52')]){_0x2e0b8f[_0x4ec0('0x45')](insertCmContact(_0xc81069[_0x4ec0('0x24')],_0x3be63b,_0xc81069[_0x4ec0('0x67')],_0x960e20));_0x2e0b8f[_0x4ec0('0x45')](_0x4ec0('0x6b')+_0x3be63b+';');}_0x2e0b8f[_0x4ec0('0x45')](insertCmHopper(_0xc81069[_0x4ec0('0x24')],_0x4ec0('0x6c'),_0x4ec0('0x6d'),_0x4ec0('0x6e'),_0x4ce7d6));_0x2e0b8f[_0x4ec0('0x45')](insertCmHopperBlack(_0xc81069['ListId'],_0x4ec0('0x6f'),_0x4ec0('0x6d'),_0x4ec0('0x6e')));_0x2e0b8f[_0x4ec0('0x45')](insertCmHopper(_0xc81069[_0x4ec0('0x24')],_0x4ec0('0x70'),_0x4ec0('0x71'),_0x4ec0('0x72'),_0x4ce7d6));_0x2e0b8f[_0x4ec0('0x45')](insertCmHopperBlack(_0xc81069['ListId'],_0x4ec0('0x73'),_0x4ec0('0x71'),_0x4ec0('0x72')));BPromise[_0x4ec0('0x74')](_0x2e0b8f,handleQuery)[_0x4ec0('0x75')](function(_0x1a9a13){stats[_0x4ec0('0x76')]=!![];stats[_0x4ec0('0x77')]=_0xc81069[_0x4ec0('0x67')]&&_0xc81069[_0x4ec0('0x67')][_0x4ec0('0x52')]?results[0x2][_0x4ec0('0x77')]:results[0x0]['affectedRows'];socket[_0x4ec0('0x61')](_0x4ec0('0x62')+_0x4859fa,stats);fs[_0x4ec0('0x78')](_0x37b4df);fs['unlink'](_0x1a9d27);process['exit'](0x0);})[_0x4ec0('0x46')](function(_0x260fa9){logger[_0x4ec0('0x65')](_0x260fa9[_0x4ec0('0x3f')]);process[_0x4ec0('0x40')](0x1);});}catch(_0x19f82d){logger[_0x4ec0('0x65')](_0x4ec0('0x79'),_0x19f82d['message']);process[_0x4ec0('0x40')](0x1);}},'error':function(_0x417c2a,_0x1fdabb,_0x220675,_0x2a2bb0){throw new Error(_0x2a2bb0);}});}function validate(){if(process['argv']&&process[_0x4ec0('0x7a')][_0x4ec0('0x52')]<0x4){throw new Error(_0x4ec0('0x7b'));}var _0x4a0679=path[_0x4ec0('0x14')](config[_0x4ec0('0x4c')],_0x4ec0('0x4d'),process[_0x4ec0('0x7a')][0x2]);if(!fs['existsSync'](_0x4a0679)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x41c3de={};try{_0x41c3de=JSON[_0x4ec0('0x4f')](process['argv'][0x3]);if(!_0x41c3de[_0x4ec0('0x4b')]){throw new Error(_0x4ec0('0x7c'));}if(!_0x41c3de['binding'][_0x4ec0('0x13')]){throw new Error(_0x4ec0('0x7d'));}if(!_0x41c3de[_0x4ec0('0x4b')][_0x4ec0('0x5d')]){throw new Error(_0x4ec0('0x7e'));}var _0x6d1d02=0x0;if(_0x41c3de[_0x4ec0('0x4b')][_0x4ec0('0x27')]){_0x6d1d02=0x1;}if(!_0x41c3de[_0x4ec0('0x24')]){throw new Error(_0x4ec0('0x7f'));}}catch(_0x5de109){throw new Error('body\x20id\x20mandatory');}var _0x50ca38=[];try{_0x50ca38=_['map'](JSON['parse'](process['argv'][0x4]),'id');}catch(_0x5d0191){logger['info'](_0x4ec0('0x80'));}main(_0x4a0679,_0x41c3de,_0x50ca38,_0x6d1d02);}validate();process['on'](_0x4ec0('0x81'),handleStop);process['on'](_0x4ec0('0x82'),handleUncaughtException); \ No newline at end of file +var _0xca83=['campaigns_has_cm_blacklists','each','then','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','util','bluebird','moment','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','select','field','phone','from','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','concat','keys',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','info','error','message','exit','errors','code','sequelize','query','spread','catch','main','stringify','send','start','socket_timestamp','root','server/files/tmp','header','writeFileSync','parse','createReadStream','rows','data','hasOwnProperty','trim','replace','isValid','push','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','agent\x20not\x20exists','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','appendFileSync','contact:import:','abort','SystemError','step','duplicates','length','cm_contacts_','\x20LIKE\x20cm_contacts;','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xca83,0x99));var _0x3ca8=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xca83[_0x1e4360];return _0x31e6b4;};'use strict';var fs=require('fs');var path=require(_0x3ca8('0x0'));var _=require('lodash');var Papa=require(_0x3ca8('0x1'));var util=require(_0x3ca8('0x2'));var BPromise=require(_0x3ca8('0x3'));var moment=require(_0x3ca8('0x4'));var squel=require('squel');var Redis=require(_0x3ca8('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0x3ca8('0x6'));var logger=require(_0x3ca8('0x7'))('import');config[_0x3ca8('0x8')]=_[_0x3ca8('0x9')](config['redis'],{'host':_0x3ca8('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3ca8('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x3ca8('0xb')](_0x3ca8('0xc'));function isEmail(_0x4a0bd7){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'](_0x4a0bd7);}function selectNotIn(_0x384124,_0x51fd7a,_0x15550b,_0x251089,_0x29b1e7){return squel[_0x3ca8('0xd')]()[_0x3ca8('0xe')](_0x3ca8('0xf'))[_0x3ca8('0x10')](_0x251089)[_0x3ca8('0x11')](_0x51fd7a,null,_0x51fd7a+'.id\x20=\x20'+_0x251089+'.'+_0x15550b)[_0x3ca8('0x12')](_0x251089+'.'+_0x15550b+_0x3ca8('0x13')+_0x384124+'.'+_0x15550b)[_0x3ca8('0x12')](_0x51fd7a+_0x3ca8('0x14')+_0x29b1e7[_0x3ca8('0x11')]()+')');}function insertCmHopper(_0x214a00,_0x30f53a,_0xc69de9,_0x150fc1,_0xa17e6b){var _0x4110a6=[_0x3ca8('0x15'),'cm_contacts.scheduledat',_0x3ca8('0x16'),_0x3ca8('0x17'),_0x30f53a+'.'+_0x150fc1,_0x3ca8('0x18'),_0x3ca8('0x19'),_0x3ca8('0x1a'),_0x3ca8('0x1b'),'\x22'+_0xa17e6b+'\x22'];return squel[_0x3ca8('0x1c')]()[_0x3ca8('0x1d')](_0x3ca8('0x1e'))[_0x3ca8('0x1f')]([_0x3ca8('0xf'),_0x3ca8('0x20'),_0x3ca8('0x21'),_0x3ca8('0x22'),_0x150fc1,_0x3ca8('0x23'),_0x3ca8('0x24'),_0x3ca8('0x25'),_0x3ca8('0x26'),_0x3ca8('0x27')],squel[_0x3ca8('0xd')]()[_0x3ca8('0x28')](_0x4110a6)[_0x3ca8('0x10')](_0x30f53a)[_0x3ca8('0x11')](_0x3ca8('0x29'),null,_0x3ca8('0x2a')+_0x30f53a+_0x3ca8('0x2b'))[_0x3ca8('0x11')](_0xc69de9,null,_0xc69de9+_0x3ca8('0x2c')+_0x30f53a+'.'+_0x150fc1)[_0x3ca8('0x12')](_0x30f53a+_0x3ca8('0x2d'),_0x214a00)['where'](_0x3ca8('0x2e'),NOW)['where'](_0x3ca8('0x2f'),selectNotIn(_0x30f53a,_0xc69de9,_0x150fc1,_0x3ca8('0x1e'),[_0x3ca8('0x30'),_0x3ca8('0x31')]))[_0x3ca8('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x30f53a,_0xc69de9,_0x150fc1,_0x3ca8('0x1e'),[_0x3ca8('0x30')])))[_0x3ca8('0x32')]();}function insertCmHopperBlack(_0x1d28a0,_0x4fcca3,_0x1efc1a,_0x27c12f){var _0x4d2899=[_0x3ca8('0x15'),'cm_contacts.id',_0x3ca8('0x17'),_0x4fcca3+'.'+_0x27c12f,_0x3ca8('0x18'),'cm_contacts.updatedAt'];return squel[_0x3ca8('0x1c')]()[_0x3ca8('0x1d')]('cm_hopper_black')[_0x3ca8('0x1f')]([_0x3ca8('0xf'),_0x3ca8('0x21'),'ListId',_0x27c12f,'createdAt','updatedAt'],squel[_0x3ca8('0xd')]()[_0x3ca8('0x28')](_0x4d2899)['from'](_0x4fcca3)[_0x3ca8('0x11')](_0x3ca8('0x29'),null,'cm_contacts.ListId\x20=\x20'+_0x4fcca3+_0x3ca8('0x2b'))['join'](_0x1efc1a,null,_0x1efc1a+_0x3ca8('0x2c')+_0x4fcca3+'.'+_0x27c12f)[_0x3ca8('0x12')](_0x4fcca3+_0x3ca8('0x2d'),_0x1d28a0)[_0x3ca8('0x12')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x3ca8('0x2f'),squel[_0x3ca8('0xd')]()[_0x3ca8('0xe')]('phone')['from'](_0x3ca8('0x33'))['where'](_0x3ca8('0x34'),_0x1d28a0)[_0x3ca8('0x12')](_0x27c12f+_0x3ca8('0x35'),_0x4fcca3+'.'+_0x27c12f)))[_0x3ca8('0x32')]();}function insertCmContact(_0x982241,_0x4823a4,_0x1db0ca,_0x209016){var _0x3ae88f=_[_0x3ca8('0x36')](_[_0x3ca8('0x37')](_0x209016),[_0x3ca8('0x22'),'CompanyId',_0x3ca8('0x23'),_0x3ca8('0x24')]);return squel[_0x3ca8('0x1c')]()[_0x3ca8('0x1d')](_0x3ca8('0x29'))[_0x3ca8('0x1f')](_0x3ae88f,squel[_0x3ca8('0xd')]()[_0x3ca8('0x28')](_0x3ae88f)[_0x3ca8('0x10')](_0x4823a4)[_0x3ca8('0x12')]('('+_0x1db0ca[_0x3ca8('0x11')](',')+_0x3ca8('0x38'),squel[_0x3ca8('0xd')]()[_0x3ca8('0x28')](_0x1db0ca)[_0x3ca8('0x10')](_0x3ca8('0x29'))[_0x3ca8('0x12')](_0x3ca8('0x34'),_0x982241)[_0x3ca8('0x12')]('deletedAt\x20IS\x20NULL'))['where'](_0x3ca8('0x39'),squel[_0x3ca8('0xd')]()[_0x3ca8('0xe')](_0x3ca8('0x3a'),_0x3ca8('0x3b'))[_0x3ca8('0x10')](_0x4823a4)['group'](_0x1db0ca[_0x3ca8('0x11')](','))))[_0x3ca8('0x32')]();}function handleStop(){logger[_0x3ca8('0x3c')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x333afa){logger[_0x3ca8('0x3d')](_0x333afa[_0x3ca8('0x3e')]);process[_0x3ca8('0x3f')](0x1);}function handleError(_0x58f1ee,_0x445127){stats[_0x3ca8('0x40')]['push']({'name':_0x445127[_0x3ca8('0x41')],'message':_0x445127['message'],'row':_0x58f1ee});}function handleQuery(_0x3ee3b5){logger[_0x3ca8('0x3c')](_0x3ee3b5);return db[_0x3ca8('0x42')][_0x3ca8('0x43')](_0x3ee3b5)[_0x3ca8('0x44')](function(_0x4c6823){results['push'](_0x4c6823);})[_0x3ca8('0x45')](function(_0x1e6997){logger[_0x3ca8('0x3d')](_0x1e6997[_0x3ca8('0x3e')]);});}function main(_0xa67141,_0xd694f1,_0x5ec4e2,_0x156067){logger[_0x3ca8('0x3c')](_0x3ca8('0x46'),_0xa67141,JSON[_0x3ca8('0x47')](_0xd694f1));process[_0x3ca8('0x48')](_0x3ca8('0x49'));var _0x3c76e8=_0xd694f1['binding'];var _0x39c7a8=_0xd694f1[_0x3ca8('0x4a')];var _0x4e4bc0=path['join'](config[_0x3ca8('0x4b')],_0x3ca8('0x4c'),_0x39c7a8+'.csv');var _0x59caf3=_[_0x3ca8('0x37')](_0x3c76e8)[_0x3ca8('0x11')]();logger[_0x3ca8('0x3c')](_0x3ca8('0x4d'),_0x59caf3);fs[_0x3ca8('0x4e')](_0x4e4bc0,_0x59caf3+'\x0a');Papa[_0x3ca8('0x4f')](fs[_0x3ca8('0x50')](_0xa67141),{'header':!![],'skipEmptyLines':!![],'step':function(_0x352d30,_0x57159b){try{for(var _0x1cc18f=0x0,_0x5ae957=[];_0x1cc18f<_0x352d30['data']['length'];_0x1cc18f++){stats[_0x3ca8('0x51')]+=0x1;if(_0x352d30['errors'][_0x1cc18f]){handleError(_0x352d30[_0x3ca8('0x52')][_0x1cc18f],_0x352d30[_0x3ca8('0x40')][_0x1cc18f]);}else{var _0x2d59f4=[];for(var _0x3bfef6 in _0x3c76e8){if(_0x3c76e8[_0x3ca8('0x53')](_0x3bfef6)){if(_0x352d30[_0x3ca8('0x52')][_0x1cc18f][_0x3c76e8[_0x3bfef6]]){var _0x6228dd=_[_0x3ca8('0x54')](_0x352d30[_0x3ca8('0x52')][_0x1cc18f][_0x3c76e8[_0x3bfef6]][_0x3ca8('0x55')](/"/g,'\x27'));switch(_0x3bfef6){case _0x3ca8('0x20'):var _0x6a2ce2=moment(_0x6228dd,_0x3ca8('0xc'),!![]);if(_0x6a2ce2[_0x3ca8('0x56')]()){_0x5ae957[_0x3ca8('0x57')]('\x22'+_0x6228dd+'\x22');}else{_0x2d59f4['push'](_0x3ca8('0x58'));}break;case _0x3ca8('0x25'):var _0x592dac=parseInt(_0x6228dd);_0x6228dd=_[_0x3ca8('0x59')](_0x592dac)||_0x592dac<0x0||_0x592dac>0x4?_0x156067?0x3:0x2:_0x592dac;_0x5ae957[_0x3ca8('0x57')]('\x22'+_0x6228dd+'\x22');break;case _0x3ca8('0x26'):var _0x51d12e=parseInt(_0x6228dd);if(_['isNumber'](_0x51d12e)&&_['includes'](_0x5ec4e2,_0x51d12e)){_0x5ae957['push']('\x22'+_0x51d12e+'\x22');}else{_0x2d59f4[_0x3ca8('0x57')](_0x3ca8('0x5a'));}break;case'email':if(isEmail(_0x6228dd)){_0x5ae957[_0x3ca8('0x57')]('\x22'+_0x6228dd+'\x22');}else{_0x2d59f4[_0x3ca8('0x57')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x420c48=moment(_0x6228dd,_0x3ca8('0x5b'),!![]);if(_0x420c48[_0x3ca8('0x56')]()){_0x5ae957[_0x3ca8('0x57')]('\x22'+_0x6228dd+'\x22');}else{_0x2d59f4[_0x3ca8('0x57')](_0x3ca8('0x5c'));}break;default:_0x5ae957[_0x3ca8('0x57')]('\x22'+_0x6228dd+'\x22');}}else{switch(_0x3bfef6){case'firstName':case _0x3ca8('0xf'):_0x2d59f4['push'](_0x3bfef6+_0x3ca8('0x5d'));break;default:_0x5ae957[_0x3ca8('0x57')]('\x22\x22');}}}}if(_0x2d59f4['length']){handleError(_0x352d30[_0x3ca8('0x52')][_0x1cc18f],{'code':'SystemRow','message':_0x2d59f4[_0x3ca8('0x11')]()});}else{fs[_0x3ca8('0x5e')](_0x4e4bc0,_0x5ae957['join']()+'\x0a');}_0x5ae957=[];}if(!(stats[_0x3ca8('0x51')]%0xc8)){socket['emit'](_0x3ca8('0x5f')+_0x39c7a8,stats);stats[_0x3ca8('0x40')]=[];}}if(stopped){logger[_0x3ca8('0x3c')]('Abort\x20parser');_0x57159b[_0x3ca8('0x60')]();}}catch(_0x289cd7){handleError(_0x352d30['data'][_0x1cc18f],{'code':_0x3ca8('0x61'),'message':_0x289cd7[_0x3ca8('0x3e')]});logger[_0x3ca8('0x3d')](_0x3ca8('0x62'),_0x289cd7[_0x3ca8('0x3e')]);}},'complete':function(){try{var _0x484ae0=[];var _0x288ac2='cm_contacts';if(_0xd694f1['duplicates']&&_0xd694f1[_0x3ca8('0x63')][_0x3ca8('0x64')]){_0x288ac2=_0x3ca8('0x65')+_0x39c7a8;_0x484ae0[_0x3ca8('0x57')]('CREATE\x20TABLE\x20'+_0x288ac2+_0x3ca8('0x66'));}var _0x42123a=util[_0x3ca8('0xb')]('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',_0x4e4bc0,_0x288ac2,_0x59caf3,_0xd694f1['ListId'],_0xd694f1['CompanyId']||null,NOW,NOW);if(_[_0x3ca8('0x67')](_0x3c76e8[_0x3ca8('0x20')])){_0x42123a+=_0x3ca8('0x68');}_0x484ae0[_0x3ca8('0x57')](_0x42123a);if(_0xd694f1[_0x3ca8('0x63')]&&_0xd694f1['duplicates'][_0x3ca8('0x64')]){_0x484ae0['push'](insertCmContact(_0xd694f1[_0x3ca8('0x22')],_0x288ac2,_0xd694f1[_0x3ca8('0x63')],_0x3c76e8));_0x484ae0[_0x3ca8('0x57')](_0x3ca8('0x69')+_0x288ac2+';');}_0x484ae0['push'](insertCmHopper(_0xd694f1[_0x3ca8('0x22')],'voice_queues_has_cm_lists',_0x3ca8('0x6a'),_0x3ca8('0x6b'),_0x156067));_0x484ae0['push'](insertCmHopperBlack(_0xd694f1[_0x3ca8('0x22')],_0x3ca8('0x6c'),_0x3ca8('0x6a'),_0x3ca8('0x6b')));_0x484ae0[_0x3ca8('0x57')](insertCmHopper(_0xd694f1['ListId'],_0x3ca8('0x6d'),_0x3ca8('0x6e'),'CampaignId',_0x156067));_0x484ae0['push'](insertCmHopperBlack(_0xd694f1['ListId'],_0x3ca8('0x6f'),'campaigns','CampaignId'));BPromise[_0x3ca8('0x70')](_0x484ae0,handleQuery)[_0x3ca8('0x71')](function(_0x4088d5){stats[_0x3ca8('0x72')]=!![];stats[_0x3ca8('0x73')]=_0xd694f1[_0x3ca8('0x63')]&&_0xd694f1[_0x3ca8('0x63')]['length']?results[0x2][_0x3ca8('0x73')]:results[0x0]['affectedRows'];socket['emit'](_0x3ca8('0x5f')+_0x39c7a8,stats);fs[_0x3ca8('0x74')](_0xa67141);fs[_0x3ca8('0x74')](_0x4e4bc0);process[_0x3ca8('0x3f')](0x0);})[_0x3ca8('0x45')](function(_0x729276){logger[_0x3ca8('0x3d')](_0x729276['message']);process['exit'](0x1);});}catch(_0x4c14c7){logger[_0x3ca8('0x3d')](_0x3ca8('0x75'),_0x4c14c7[_0x3ca8('0x3e')]);process[_0x3ca8('0x3f')](0x1);}},'error':function(_0xc39542,_0x495e99,_0x27685e,_0x159bb5){throw new Error(_0x159bb5);}});}function validate(){if(process[_0x3ca8('0x76')]&&process[_0x3ca8('0x76')][_0x3ca8('0x64')]<0x4){throw new Error(_0x3ca8('0x77'));}var _0x17d475=path[_0x3ca8('0x11')](config[_0x3ca8('0x4b')],_0x3ca8('0x4c'),process[_0x3ca8('0x76')][0x2]);if(!fs[_0x3ca8('0x78')](_0x17d475)){throw new Error(_0x3ca8('0x79'));}var _0x20ad6b={};try{_0x20ad6b=JSON['parse'](process[_0x3ca8('0x76')][0x3]);if(!_0x20ad6b[_0x3ca8('0x7a')]){throw new Error(_0x3ca8('0x7b'));}if(!_0x20ad6b['binding']['phone']){throw new Error(_0x3ca8('0x7c'));}if(!_0x20ad6b[_0x3ca8('0x7a')][_0x3ca8('0x7d')]){throw new Error(_0x3ca8('0x7e'));}var _0x399d77=0x0;if(_0x20ad6b[_0x3ca8('0x7a')][_0x3ca8('0x26')]){_0x399d77=0x1;}if(!_0x20ad6b['ListId']){throw new Error(_0x3ca8('0x7f'));}}catch(_0x3fb4bf){throw new Error('body\x20id\x20mandatory');}var _0x1814b5=[];try{_0x1814b5=_[_0x3ca8('0x80')](JSON['parse'](process[_0x3ca8('0x76')][0x4]),'id');}catch(_0x31676e){logger[_0x3ca8('0x3c')](_0x3ca8('0x81'));}main(_0x17d475,_0x20ad6b,_0x1814b5,_0x399d77);}validate();process['on'](_0x3ca8('0x82'),handleStop);process['on'](_0x3ca8('0x83'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 3d0f92c..a592cc1 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 _0x101b=['calleridnum','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','Caller\x20Number','keyValue','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','outbound','Called\x20Number','Member\x20Name','membername','Date','answertime','Complete\x20Time','endtime','Duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','queue','push','variable'];(function(_0x3d85b2,_0x546af8){var _0x482cc8=function(_0x4f7ca3){while(--_0x4f7ca3){_0x3d85b2['push'](_0x3d85b2['shift']());}};_0x482cc8(++_0x546af8);}(_0x101b,0x7e));var _0xb101=function(_0x4f4ca5,_0x4c02b8){_0x4f4ca5=_0x4f4ca5-0x0;var _0x4a2021=_0x101b[_0x4f4ca5];return _0x4a2021;};'use strict';exports[_0xb101('0x0')]=function(_0x5ae605,_0x5a9b5d){var _0x4ff9f4=[{'type':_0xb101('0x1'),'content':_0xb101('0x2'),'variableName':null}];switch(_0x5ae605[_0xb101('0x3')]()){case _0xb101('0x4'):switch(_0x5a9b5d['toLowerCase']()){case _0xb101('0x5'):_0x4ff9f4['push']({'type':'variable','content':'','variableName':_0xb101('0x6')});_0x4ff9f4[_0xb101('0x7')]({'type':_0xb101('0x8'),'content':'','variableName':_0xb101('0x9')});break;case'outbound':_0x4ff9f4[_0xb101('0x7')]({'type':'string','content':_0xb101('0xa'),'variableName':null});_0x4ff9f4[_0xb101('0x7')]({'type':_0xb101('0x8'),'content':'','variableName':_0xb101('0xb')});break;}}return _0x4ff9f4;};exports[_0xb101('0xc')]=function(_0x40a9aa,_0x5ba373){var _0x1d2ab0=[];switch(_0x40a9aa[_0xb101('0x3')]()){case'voice':switch(_0x5ba373[_0xb101('0x3')]()){case _0xb101('0x5'):_0x1d2ab0=[{'type':_0xb101('0x1'),'content':_0xb101('0xd'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xb101('0xe'),'keyType':'variable','variableName':_0xb101('0x9')},{'type':_0xb101('0xf'),'content':'','key':'Caller\x20Name','keyType':_0xb101('0x8'),'variableName':_0xb101('0x10')},{'type':'keyValue','content':'','key':_0xb101('0x11'),'keyType':_0xb101('0x8'),'variableName':_0xb101('0x12')},{'type':_0xb101('0xf'),'content':'','key':_0xb101('0x13'),'keyType':_0xb101('0x8'),'variableName':_0xb101('0x6')},{'type':_0xb101('0xf'),'content':'','key':_0xb101('0x14'),'keyType':'variable','variableName':_0xb101('0x15')},{'type':_0xb101('0xf'),'content':'','key':'Date','keyType':_0xb101('0x8'),'variableName':_0xb101('0x16')},{'type':'string','content':_0xb101('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0xb101('0xf'),'content':'','key':_0xb101('0x18'),'keyType':_0xb101('0x8'),'variableName':'destcalleridname'},{'type':_0xb101('0xf'),'content':'','key':_0xb101('0x19'),'keyType':_0xb101('0x8'),'variableName':_0xb101('0xb')},{'type':_0xb101('0x1'),'content':_0xb101('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0xb101('0xf'),'content':'','key':_0xb101('0x1b'),'keyType':'variable','variableName':_0xb101('0x16')},{'type':_0xb101('0xf'),'content':'','key':_0xb101('0x1c'),'keyType':_0xb101('0x8'),'variableName':_0xb101('0x1d')},{'type':_0xb101('0xf'),'content':'','key':'Agent\x20Complete','keyType':_0xb101('0x8'),'variableName':'agentcompleteAt'},{'type':_0xb101('0xf'),'content':'','key':_0xb101('0x1e'),'keyType':'variable','variableName':_0xb101('0x1f')},{'type':_0xb101('0xf'),'content':'','key':_0xb101('0x20'),'keyType':_0xb101('0x8'),'variableName':_0xb101('0x21')}];break;case _0xb101('0x22'):_0x1d2ab0=[{'type':'string','content':_0xb101('0xd'),'variableName':null},{'type':_0xb101('0xf'),'content':'','key':_0xb101('0x23'),'keyType':_0xb101('0x8'),'keyContent':'','variableName':_0xb101('0xb')},{'type':_0xb101('0xf'),'content':'','key':_0xb101('0x24'),'keyType':_0xb101('0x8'),'keyContent':'','variableName':_0xb101('0x25')},{'type':_0xb101('0xf'),'content':'','key':_0xb101('0x14'),'keyType':_0xb101('0x8'),'keyContent':'','variableName':_0xb101('0x15')},{'type':_0xb101('0xf'),'content':'','key':_0xb101('0x26'),'keyType':_0xb101('0x8'),'keyContent':'','variableName':'starttime'},{'type':_0xb101('0x1'),'content':_0xb101('0x1a')},{'type':'keyValue','content':'','key':'Answer\x20Time','keyType':_0xb101('0x8'),'keyContent':'','variableName':_0xb101('0x27')},{'type':_0xb101('0xf'),'content':'','key':_0xb101('0x28'),'keyType':_0xb101('0x8'),'keyContent':'','variableName':_0xb101('0x29')},{'type':'keyValue','content':'','key':_0xb101('0x2a'),'keyType':_0xb101('0x8'),'keyContent':'','variableName':'duration'},{'type':_0xb101('0xf'),'content':'','key':_0xb101('0x2b'),'keyType':_0xb101('0x8'),'keyContent':'','variableName':_0xb101('0x2c')}];break;}}return _0x1d2ab0;}; \ No newline at end of file +var _0x9250=['getDescriptions','inbound','string','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','calleridname','destexten','Queue','UniqueId','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Number','destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','Agent\x20Complete','Hold\x20Time','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','uniqueid','starttime','answertime','Duration','duration','Billable\x20Time','getSubjects','[xCALLY\x20Ticket]','toLowerCase','voice','push','queue','calleridnum','variable'];(function(_0x539fb2,_0x5b6718){var _0x4d583d=function(_0x55fa69){while(--_0x55fa69){_0x539fb2['push'](_0x539fb2['shift']());}};_0x4d583d(++_0x5b6718);}(_0x9250,0x94));var _0x0925=function(_0x1699e6,_0x20af61){_0x1699e6=_0x1699e6-0x0;var _0x56cc52=_0x9250[_0x1699e6];return _0x56cc52;};'use strict';exports[_0x0925('0x0')]=function(_0x799c4c,_0xe7669c){var _0x42339a=[{'type':'string','content':_0x0925('0x1'),'variableName':null}];switch(_0x799c4c[_0x0925('0x2')]()){case _0x0925('0x3'):switch(_0xe7669c['toLowerCase']()){case'inbound':_0x42339a[_0x0925('0x4')]({'type':'variable','content':'','variableName':_0x0925('0x5')});_0x42339a[_0x0925('0x4')]({'type':'variable','content':'','variableName':_0x0925('0x6')});break;case'outbound':_0x42339a[_0x0925('0x4')]({'type':'string','content':'Outbound\x20Call','variableName':null});_0x42339a[_0x0925('0x4')]({'type':_0x0925('0x7'),'content':'','variableName':'destcalleridnum'});break;}}return _0x42339a;};exports[_0x0925('0x8')]=function(_0x310b4f,_0x3363d1){var _0x2dae95=[];switch(_0x310b4f[_0x0925('0x2')]()){case _0x0925('0x3'):switch(_0x3363d1['toLowerCase']()){case _0x0925('0x9'):_0x2dae95=[{'type':_0x0925('0xa'),'content':_0x0925('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0x0925('0xc'),'content':'','key':'Caller\x20Number','keyType':_0x0925('0x7'),'variableName':_0x0925('0x6')},{'type':_0x0925('0xc'),'content':'','key':_0x0925('0xd'),'keyType':_0x0925('0x7'),'variableName':_0x0925('0xe')},{'type':_0x0925('0xc'),'content':'','key':'Call\x20To','keyType':'variable','variableName':_0x0925('0xf')},{'type':'keyValue','content':'','key':_0x0925('0x10'),'keyType':_0x0925('0x7'),'variableName':_0x0925('0x5')},{'type':_0x0925('0xc'),'content':'','key':_0x0925('0x11'),'keyType':_0x0925('0x7'),'variableName':'uniqueid'},{'type':_0x0925('0xc'),'content':'','key':_0x0925('0x12'),'keyType':'variable','variableName':_0x0925('0x13')},{'type':_0x0925('0xa'),'content':_0x0925('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0x0925('0xc'),'content':'','key':'Agent\x20Name','keyType':'variable','variableName':'destcalleridname'},{'type':_0x0925('0xc'),'content':'','key':_0x0925('0x15'),'keyType':_0x0925('0x7'),'variableName':_0x0925('0x16')},{'type':_0x0925('0xa'),'content':_0x0925('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x0925('0xc'),'content':'','key':_0x0925('0x18'),'keyType':'variable','variableName':_0x0925('0x13')},{'type':_0x0925('0xc'),'content':'','key':_0x0925('0x19'),'keyType':_0x0925('0x7'),'variableName':'agentconnectAt'},{'type':'keyValue','content':'','key':_0x0925('0x1a'),'keyType':_0x0925('0x7'),'variableName':'agentcompleteAt'},{'type':'keyValue','content':'','key':_0x0925('0x1b'),'keyType':_0x0925('0x7'),'variableName':'holdtime'},{'type':_0x0925('0xc'),'content':'','key':_0x0925('0x1c'),'keyType':_0x0925('0x7'),'variableName':_0x0925('0x1d')}];break;case'outbound':_0x2dae95=[{'type':_0x0925('0xa'),'content':_0x0925('0xb'),'variableName':null},{'type':'keyValue','content':'','key':_0x0925('0x1e'),'keyType':_0x0925('0x7'),'keyContent':'','variableName':_0x0925('0x16')},{'type':'keyValue','content':'','key':_0x0925('0x1f'),'keyType':_0x0925('0x7'),'keyContent':'','variableName':_0x0925('0x20')},{'type':_0x0925('0xc'),'content':'','key':_0x0925('0x11'),'keyType':_0x0925('0x7'),'keyContent':'','variableName':_0x0925('0x21')},{'type':'keyValue','content':'','key':_0x0925('0x12'),'keyType':_0x0925('0x7'),'keyContent':'','variableName':_0x0925('0x22')},{'type':'string','content':_0x0925('0x17')},{'type':'keyValue','content':'','key':'Answer\x20Time','keyType':_0x0925('0x7'),'keyContent':'','variableName':_0x0925('0x23')},{'type':'keyValue','content':'','key':'Complete\x20Time','keyType':_0x0925('0x7'),'keyContent':'','variableName':'endtime'},{'type':_0x0925('0xc'),'content':'','key':_0x0925('0x24'),'keyType':_0x0925('0x7'),'keyContent':'','variableName':_0x0925('0x25')},{'type':_0x0925('0xc'),'content':'','key':_0x0925('0x26'),'keyType':_0x0925('0x7'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x2dae95;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 5ed39a8..7c20680 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 _0x74b9=['body','html','phone','fax','mobile','lodash','../../config/logger','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','null','Interaction','then','info','catch','user','clone','omit'];(function(_0x477627,_0x329718){var _0x105546=function(_0xc5178f){while(--_0xc5178f){_0x477627['push'](_0x477627['shift']());}};_0x105546(++_0x329718);}(_0x74b9,0xdd));var _0x974b=function(_0x306c2f,_0x5e9f92){_0x306c2f=_0x306c2f-0x0;var _0x484c31=_0x74b9[_0x306c2f];return _0x484c31;};'use strict';var _=require(_0x974b('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x974b('0x1'))('openchannel-interactions'),'mail':require(_0x974b('0x1'))('mail-interactions'),'fax':require('../../config/logger')(_0x974b('0x2')),'sms':require(_0x974b('0x1'))(_0x974b('0x3')),'chat':require(_0x974b('0x1'))(_0x974b('0x4')),'whatsapp':require(_0x974b('0x1'))(_0x974b('0x5'))};function getInteractionId(_0xbe968e,_0x13e30b,_0x2a0ae9){if(_0xbe968e&&_0xbe968e[_[_0x974b('0x6')](_0x2a0ae9)+_0x974b('0x7')]){return _0xbe968e[_[_0x974b('0x6')](_0x2a0ae9)+_0x974b('0x7')];}else if(_0xbe968e&&_0xbe968e['id']){return _0xbe968e['id'];}else if(_0x13e30b&&_0x13e30b['id']){return _0x13e30b['id'];}else{return _0x974b('0x8');}}function log(_0xae56cb,_0x293314,_0x10c03e,_0x187666,_0x1b550f,_0xc8bc74){loggers[_0x1b550f[_0x974b('0x9')]()][_0xae56cb](_0x974b('0xa'),_0xc8bc74[_0x974b('0xb')](),_0x293314?_0x293314['id']:null,_0x293314?_0x293314[_0x974b('0xc')]:null,_0x293314?_0x293314[_0x974b('0xd')]:null,getInteractionId(_0x10c03e,_0x187666,_0x1b550f),_0x10c03e?JSON['stringify'](_0x10c03e):_0x974b('0xe'));}function updateUser(_0x181401,_0x42f4c5,_0x55600c,_0x585e39,_0xdd0927){db[_[_0x974b('0x6')](_0x585e39)+_0x974b('0xf')]['findOne']({'where':{'id':getInteractionId(_0x42f4c5,_0x55600c,_0x585e39)}})[_0x974b('0x10')](function(_0x152a15){if(_0x152a15){return _0x152a15['update']({'UserId':_0x181401?_0x181401['id']:null});}})[_0x974b('0x10')](function(_0x36b463){if(_0x36b463){log(_0x974b('0x11'),_0x181401,_0x42f4c5,_0x55600c,_0x585e39,_0xdd0927);}})[_0x974b('0x12')](function(){log('error',_0x181401,_0x42f4c5,_0x55600c,_0x585e39,_0xdd0927);});}exports['tracked']=function(_0x44c124,_0x4805b3){return function(_0x23af5d,_0x25f56a,_0x30a736){var _0x35ccdd=_0x23af5d[_0x974b('0x13')];var _0x118660={};var _0x4c18e6=_0x23af5d['query'];if(_0x118660){_0x118660=_[_0x974b('0x14')](_0x23af5d['body']);_0x118660=_[_0x974b('0x15')](_0x118660,[_0x974b('0x16'),_0x974b('0x17'),_0x974b('0x18'),_0x974b('0x19'),_0x974b('0x1a')]);}updateUser(_0x35ccdd,_0x118660,_0x4c18e6,_0x44c124,_0x4805b3);_0x30a736(null);};}; \ No newline at end of file +var _0x4fc4=['user','query','clone','body','phone','fax','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','stringify','findOne','then','update','info','error','tracked'];(function(_0x56920e,_0x55fd10){var _0x2804ad=function(_0x472f25){while(--_0x472f25){_0x56920e['push'](_0x56920e['shift']());}};_0x2804ad(++_0x55fd10);}(_0x4fc4,0x8d));var _0x44fc=function(_0xb33d24,_0x5a7117){_0xb33d24=_0xb33d24-0x0;var _0x668c4a=_0x4fc4[_0xb33d24];return _0x668c4a;};'use strict';var _=require(_0x44fc('0x0'));var db=require(_0x44fc('0x1'))['db'];var loggers={'openchannel':require(_0x44fc('0x2'))(_0x44fc('0x3')),'mail':require(_0x44fc('0x2'))(_0x44fc('0x4')),'fax':require(_0x44fc('0x2'))(_0x44fc('0x5')),'sms':require('../../config/logger')(_0x44fc('0x6')),'chat':require(_0x44fc('0x2'))(_0x44fc('0x7')),'whatsapp':require(_0x44fc('0x2'))(_0x44fc('0x8'))};function getInteractionId(_0xa4922,_0x1d17ac,_0x378be0){if(_0xa4922&&_0xa4922[_['upperFirst'](_0x378be0)+'InteractionId']){return _0xa4922[_[_0x44fc('0x9')](_0x378be0)+_0x44fc('0xa')];}else if(_0xa4922&&_0xa4922['id']){return _0xa4922['id'];}else if(_0x1d17ac&&_0x1d17ac['id']){return _0x1d17ac['id'];}else{return'unknown';}}function log(_0x26cda9,_0xa955de,_0x522f22,_0x1fd52e,_0x278d31,_0x28bd91){loggers[_0x278d31[_0x44fc('0xb')]()][_0x26cda9](_0x44fc('0xc'),_0x28bd91['toUpperCase'](),_0xa955de?_0xa955de['id']:null,_0xa955de?_0xa955de[_0x44fc('0xd')]:null,_0xa955de?_0xa955de['role']:null,getInteractionId(_0x522f22,_0x1fd52e,_0x278d31),_0x522f22?JSON[_0x44fc('0xe')](_0x522f22):'null');}function updateUser(_0x356f84,_0x32a6d0,_0x7fc6d1,_0x1b9ce0,_0x59b7fa){db[_['upperFirst'](_0x1b9ce0)+'Interaction'][_0x44fc('0xf')]({'where':{'id':getInteractionId(_0x32a6d0,_0x7fc6d1,_0x1b9ce0)}})[_0x44fc('0x10')](function(_0x44aaa8){if(_0x44aaa8){return _0x44aaa8[_0x44fc('0x11')]({'UserId':_0x356f84?_0x356f84['id']:null});}})[_0x44fc('0x10')](function(_0xf4e321){if(_0xf4e321){log(_0x44fc('0x12'),_0x356f84,_0x32a6d0,_0x7fc6d1,_0x1b9ce0,_0x59b7fa);}})['catch'](function(){log(_0x44fc('0x13'),_0x356f84,_0x32a6d0,_0x7fc6d1,_0x1b9ce0,_0x59b7fa);});}exports[_0x44fc('0x14')]=function(_0xfa1304,_0x16aaa2){return function(_0x1ac498,_0x500223,_0x548df6){var _0x14f221=_0x1ac498[_0x44fc('0x15')];var _0x57e9c5={};var _0x3b7767=_0x1ac498[_0x44fc('0x16')];if(_0x57e9c5){_0x57e9c5=_[_0x44fc('0x17')](_0x1ac498[_0x44fc('0x18')]);_0x57e9c5=_['omit'](_0x57e9c5,[_0x44fc('0x18'),'html',_0x44fc('0x19'),_0x44fc('0x1a'),'mobile']);}updateUser(_0x14f221,_0x57e9c5,_0x3b7767,_0xfa1304,_0x16aaa2);_0x548df6(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 16c9af7..669a280 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 _0xcabb=['json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','user','isUserLimit','composable-middleware','../../mysqldb','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','parse','hasOwnProperty','use','then'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xcabb,0xed));var _0xbcab=function(_0x2ccda8,_0x2117c6){_0x2ccda8=_0x2ccda8-0x0;var _0x40cb1f=_0xcabb[_0x2ccda8];return _0x40cb1f;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require(_0xbcab('0x0'));var db=require(_0xbcab('0x1'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x3f3ebb,_0x5e60bb){if(_0x3f3ebb&&_0x5e60bb){if(_0x5e60bb[_0xbcab('0x2')]&&_0x5e60bb[_0xbcab('0x3')]){var _0x899804=_0x5e60bb['data1'];var _0x4c2d09=_0x5e60bb['license'];var _0x17a6a1=_0x899804[_0xbcab('0x4')]('-')[0x4];var _0x4330a5=_0x899804[_0xbcab('0x4')]('-')[0x0];var _0x561ca3=crypto[_0xbcab('0x5')](_0xbcab('0x6'),util[_0xbcab('0x7')](_0xbcab('0x8'),_0x17a6a1,_0x899804,_0x4330a5));var _0x42fd0e=_0x561ca3[_0xbcab('0x9')](_0x4c2d09,_0xbcab('0xa'),_0xbcab('0xb'));_0x42fd0e+=_0x561ca3['final'](_0xbcab('0xb'));var _0x1a2986=JSON[_0xbcab('0xc')](_0x42fd0e);return _0x1a2986[_0xbcab('0xd')](_0x3f3ebb)?_0x1a2986[_0x3f3ebb]:null;}}return null;}function isLimit(_0x4d806e,_0x2c9827,_0x113262,_0x16c53f){var _0x34f02d=_0x2c9827;return compose()[_0xbcab('0xe')](function(_0x2ab732,_0x2303fd,_0x51c1f6){return db['License']['findOne']({'where':{'id':0x1},'raw':!![]})[_0xbcab('0xf')](function(_0x1acec6){var _0x3e5131=getValueFromLicense(_0x4d806e,_0x1acec6);return _0x3e5131?_0x3e5131:_0x34f02d;})[_0xbcab('0xf')](function(_0x50f79b){_0x34f02d=_0x50f79b;return _0x113262['count'](_0x16c53f);})['then'](function(_0x105ebc){if(_0x105ebc>=_0x34f02d){return _0x2303fd['status'](0x193)[_0xbcab('0x10')]({'message':util[_0xbcab('0x7')](_0xbcab('0x11'),_0x4d806e)});}_0x51c1f6();})[_0xbcab('0x12')](function(_0x25fe77){_0x51c1f6(_0x25fe77);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xbcab('0x13')],{'where':{'$or':[{'role':_0xbcab('0x14')},{'role':_0xbcab('0x15')}]}});}exports[_0xbcab('0x16')]=isUserLimit; \ No newline at end of file +var _0x88e5=['format','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','aes-256-ctr','update','base64','utf8','final','parse','hasOwnProperty','License','then','count','json'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x88e5,0x19e));var _0x588e=function(_0x35cb68,_0x9be5c5){_0x35cb68=_0x35cb68-0x0;var _0xee0f0e=_0x88e5[_0x35cb68];return _0xee0f0e;};'use strict';var crypto=require(_0x588e('0x0'));var util=require(_0x588e('0x1'));var compose=require(_0x588e('0x2'));var db=require(_0x588e('0x3'))['db'];var config=require(_0x588e('0x4'));function getValueFromLicense(_0x16a1f9,_0x237c36){if(_0x16a1f9&&_0x237c36){if(_0x237c36[_0x588e('0x5')]&&_0x237c36[_0x588e('0x6')]){var _0x30b92a=_0x237c36[_0x588e('0x5')];var _0x3a939f=_0x237c36[_0x588e('0x6')];var _0x5aff96=_0x30b92a['split']('-')[0x4];var _0x55fbd2=_0x30b92a['split']('-')[0x0];var _0x24de5c=crypto['createDecipher'](_0x588e('0x7'),util['format']('%s:%s:%s',_0x5aff96,_0x30b92a,_0x55fbd2));var _0x17be64=_0x24de5c[_0x588e('0x8')](_0x3a939f,_0x588e('0x9'),_0x588e('0xa'));_0x17be64+=_0x24de5c[_0x588e('0xb')](_0x588e('0xa'));var _0x27000d=JSON[_0x588e('0xc')](_0x17be64);return _0x27000d[_0x588e('0xd')](_0x16a1f9)?_0x27000d[_0x16a1f9]:null;}}return null;}function isLimit(_0x2100e6,_0x5749b1,_0x167cbe,_0x16bd51){var _0x28f71e=_0x5749b1;return compose()['use'](function(_0x1ab0e5,_0x1124fb,_0x3c525f){return db[_0x588e('0xe')]['findOne']({'where':{'id':0x1},'raw':!![]})['then'](function(_0xc2b275){var _0x3943f8=getValueFromLicense(_0x2100e6,_0xc2b275);return _0x3943f8?_0x3943f8:_0x28f71e;})[_0x588e('0xf')](function(_0x2bbf39){_0x28f71e=_0x2bbf39;return _0x167cbe[_0x588e('0x10')](_0x16bd51);})[_0x588e('0xf')](function(_0x2eee19){if(_0x2eee19>=_0x28f71e){return _0x1124fb['status'](0x193)[_0x588e('0x11')]({'message':util[_0x588e('0x12')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x2100e6)});}_0x3c525f();})['catch'](function(_0x512e97){_0x3c525f(_0x512e97);});});}function isUserLimit(){return isLimit(_0x588e('0x13'),0x1,db[_0x588e('0x14')],{'where':{'$or':[{'role':_0x588e('0x15')},{'role':_0x588e('0x16')}]}});}exports[_0x588e('0x17')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index bf6b40f..8f55077 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 _0xc6ee=['map','conditions','push','DATE','operator','$between','value','$gt','add','days','format','YYYY-MM-DD','castTo','text','CAST(','\x20AS\x20','field','includes','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','$substring','$lt','<\x20?','>\x20?','<=\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$startsWith','pop','utcOffset','minutes','seconds','lodash','moment','parseSearch','startsWith','[$or]','and','[$and]','replace','split','length','slice','shift','match','forEach','filter'];(function(_0x34de0f,_0x424220){var _0x388ca0=function(_0x33f894){while(--_0x33f894){_0x34de0f['push'](_0x34de0f['shift']());}};_0x388ca0(++_0x424220);}(_0xc6ee,0x13b));var _0xec6e=function(_0x59f0ff,_0x2b9d67){_0x59f0ff=_0x59f0ff-0x0;var _0x28e782=_0xc6ee[_0x59f0ff];return _0x28e782;};'use strict';var _=require(_0xec6e('0x0'));var moment=require(_0xec6e('0x1'));exports[_0xec6e('0x2')]=function(_0x2eb9a2){var _0x11af46={'conditions':[]};_0x11af46['sqlOperator']=_[_0xec6e('0x3')](_0x2eb9a2,_0xec6e('0x4'))?'or':_0xec6e('0x5');var _0x31bebe=_0x2eb9a2['replace'](_0xec6e('0x6'),'')[_0xec6e('0x7')](_0xec6e('0x4'),'')[_0xec6e('0x8')]('||');for(var _0x3c0903=0x0;_0x3c0903<_0x31bebe[_0xec6e('0x9')];_0x3c0903++){var _0x2275c5=_0x31bebe[_0x3c0903][_0xec6e('0x8')](':=');var _0x1a6388=_0x2275c5[0x0];var _0x3a376c=_0x2275c5[_0xec6e('0xa')](0x1);_0x3a376c['forEach'](function(_0x2934ac){var _0x170b8d=_0x2934ac[_0xec6e('0x8')]('[')[_0xec6e('0xb')]();var _0x550df4=_0x2934ac[_0xec6e('0xc')](/\[(.*?)\]/g);_0x550df4[_0xec6e('0xd')](function(_0x3e834c){var _0x341711=_0x3e834c[_0xec6e('0x8')]('[')[_0xec6e('0xe')](function(_0x49cfd6){return _0x49cfd6['indexOf'](']')>-0x1;})[_0xec6e('0xf')](function(_0x143542){return _0x143542[_0xec6e('0x8')](']')[0x0];})[0x0];_0x11af46[_0xec6e('0x10')][_0xec6e('0x11')]({'field':_0x1a6388,'operator':_0x170b8d,'value':_0x341711});});});}return _0x11af46;};exports['buildExpression']=function(_0x49c7e6,_0x10ffb1,_0x2f03dc){var _0x24a5d5={};if(_0x10ffb1===_0xec6e('0x12')){if(_0x2f03dc[_0xec6e('0x13')]==='$eq'){_0x2f03dc[_0xec6e('0x13')]=_0xec6e('0x14');_0x2f03dc[_0xec6e('0x15')]+=','+_0x2f03dc[_0xec6e('0x15')];}else if(_['includes']([_0xec6e('0x16'),'$lte'],_0x2f03dc['operator'])){_0x2f03dc['value']=moment(_0x2f03dc[_0xec6e('0x15')])[_0xec6e('0x17')](0x1,_0xec6e('0x18'))[_0xec6e('0x19')](_0xec6e('0x1a'));}}if(_0x2f03dc['castTo']){_0x10ffb1=_0x2f03dc[_0xec6e('0x1b')];_0x24a5d5[_0xec6e('0x1c')]=_0xec6e('0x1d')+_0x49c7e6+'.'+_0x2f03dc['field']+_0xec6e('0x1e')+_0x2f03dc[_0xec6e('0x1b')]+')\x20'+parseOperator(_0x2f03dc[_0xec6e('0x13')]);}else{_0x24a5d5[_0xec6e('0x1c')]=_0x49c7e6+'.'+_0x2f03dc[_0xec6e('0x1f')]+'\x20'+parseOperator(_0x2f03dc[_0xec6e('0x13')]);}if(_[_0xec6e('0x20')]([_0xec6e('0x21'),_0xec6e('0x22')],_0x2f03dc['operator']))_0x24a5d5['text']='('+_0x24a5d5[_0xec6e('0x1c')]+_0xec6e('0x23')+_0x49c7e6+'.'+_0x2f03dc[_0xec6e('0x1f')]+_0xec6e('0x24');_0x24a5d5[_0xec6e('0x15')]=parseValue(_0x10ffb1,_0x2f03dc[_0xec6e('0x13')],_0x2f03dc[_0xec6e('0x15')]);return _0x24a5d5;};function parseOperator(_0x3d31f8){var _0x3a5e23;switch(_0x3d31f8){case _0xec6e('0x25'):_0x3a5e23=_0xec6e('0x26');break;case'$notIn':_0x3a5e23=_0xec6e('0x27');break;case _0xec6e('0x28'):_0x3a5e23=_0xec6e('0x29');break;case _0xec6e('0x21'):_0x3a5e23='<>\x20?';break;case _0xec6e('0x2a'):case'$startsWith':case'$endsWith':_0x3a5e23='LIKE\x20?';break;case _0xec6e('0x2b'):_0x3a5e23=_0xec6e('0x2c');break;case _0xec6e('0x16'):_0x3a5e23=_0xec6e('0x2d');break;case'$lte':_0x3a5e23=_0xec6e('0x2e');break;case'$gte':_0x3a5e23=_0xec6e('0x2f');break;case _0xec6e('0x14'):_0x3a5e23=_0xec6e('0x30');break;}return _0x3a5e23;}function parseValue(_0x2447f2,_0x2f495e,_0x2133f8){var _0x53a3e8={'start':undefined,'end':undefined};switch(_0x2f495e){case'$in':case _0xec6e('0x22'):_0x53a3e8[_0xec6e('0x31')]=_0x2133f8[_0xec6e('0x8')](',');break;case'$substring':_0x53a3e8[_0xec6e('0x31')]='%'+_0x2133f8+'%';break;case _0xec6e('0x32'):_0x53a3e8[_0xec6e('0x31')]=_0x2133f8+'%';break;case'$endsWith':_0x53a3e8[_0xec6e('0x31')]='%'+_0x2133f8;break;case _0xec6e('0x14'):var _0x5367e3=_0x2133f8[_0xec6e('0x8')](',');var _0x2133f8=_0x5367e3[_0xec6e('0xb')]();var _0x43fd49=_0x5367e3[_0xec6e('0x33')]();if(_0x2447f2===_0xec6e('0x12')){_0x2133f8=moment(_0x2133f8)[_0xec6e('0x34')](0x0,!![])[_0xec6e('0x19')]();_0x43fd49=moment(_0x43fd49)[_0xec6e('0x34')](0x0,!![])[_0xec6e('0x17')](0x17,'hours')[_0xec6e('0x17')](0x3b,_0xec6e('0x35'))[_0xec6e('0x17')](0x3b,_0xec6e('0x36'))[_0xec6e('0x19')]();}_0x53a3e8={'start':_0x2133f8,'end':_0x43fd49};break;default:_0x53a3e8['start']=_0x2133f8;break;}return _0x53a3e8;} \ No newline at end of file +var _0x0c30=['seconds','moment','parseSearch','startsWith','[$or]','replace','[$and]','length','split','slice','shift','match','forEach','filter','indexOf','conditions','DATE','operator','$eq','$between','value','$gt','$lte','days','format','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','$in','IN\x20?','NOT\x20IN\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','add','hours','minutes'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0c30,0x1d5));var _0x00c3=function(_0x3cb30b,_0x504b3e){_0x3cb30b=_0x3cb30b-0x0;var _0x2ca717=_0x0c30[_0x3cb30b];return _0x2ca717;};'use strict';var _=require('lodash');var moment=require(_0x00c3('0x0'));exports[_0x00c3('0x1')]=function(_0x1e5fd9){var _0x454529={'conditions':[]};_0x454529['sqlOperator']=_[_0x00c3('0x2')](_0x1e5fd9,_0x00c3('0x3'))?'or':'and';var _0x2d3b40=_0x1e5fd9[_0x00c3('0x4')](_0x00c3('0x5'),'')['replace']('[$or]','')['split']('||');for(var _0x5c8972=0x0;_0x5c8972<_0x2d3b40[_0x00c3('0x6')];_0x5c8972++){var _0x2a98b9=_0x2d3b40[_0x5c8972][_0x00c3('0x7')](':=');var _0x456fb2=_0x2a98b9[0x0];var _0x5cc754=_0x2a98b9[_0x00c3('0x8')](0x1);_0x5cc754['forEach'](function(_0x3910a0){var _0x213eed=_0x3910a0['split']('[')[_0x00c3('0x9')]();var _0x33981f=_0x3910a0[_0x00c3('0xa')](/\[(.*?)\]/g);_0x33981f[_0x00c3('0xb')](function(_0x37fbb7){var _0x442651=_0x37fbb7['split']('[')[_0x00c3('0xc')](function(_0x3e8e3f){return _0x3e8e3f[_0x00c3('0xd')](']')>-0x1;})['map'](function(_0xa0ec8c){return _0xa0ec8c[_0x00c3('0x7')](']')[0x0];})[0x0];_0x454529[_0x00c3('0xe')]['push']({'field':_0x456fb2,'operator':_0x213eed,'value':_0x442651});});});}return _0x454529;};exports['buildExpression']=function(_0x1adce5,_0x2be8f8,_0x3ea147){var _0x3a30aa={};if(_0x2be8f8===_0x00c3('0xf')){if(_0x3ea147[_0x00c3('0x10')]===_0x00c3('0x11')){_0x3ea147[_0x00c3('0x10')]=_0x00c3('0x12');_0x3ea147[_0x00c3('0x13')]+=','+_0x3ea147['value'];}else if(_['includes']([_0x00c3('0x14'),_0x00c3('0x15')],_0x3ea147[_0x00c3('0x10')])){_0x3ea147[_0x00c3('0x13')]=moment(_0x3ea147[_0x00c3('0x13')])['add'](0x1,_0x00c3('0x16'))[_0x00c3('0x17')]('YYYY-MM-DD');}}if(_0x3ea147['castTo']){_0x2be8f8=_0x3ea147[_0x00c3('0x18')];_0x3a30aa[_0x00c3('0x19')]=_0x00c3('0x1a')+_0x1adce5+'.'+_0x3ea147[_0x00c3('0x1b')]+_0x00c3('0x1c')+_0x3ea147[_0x00c3('0x18')]+')\x20'+parseOperator(_0x3ea147[_0x00c3('0x10')]);}else{_0x3a30aa[_0x00c3('0x19')]=_0x1adce5+'.'+_0x3ea147[_0x00c3('0x1b')]+'\x20'+parseOperator(_0x3ea147[_0x00c3('0x10')]);}if(_['includes']([_0x00c3('0x1d'),_0x00c3('0x1e')],_0x3ea147[_0x00c3('0x10')]))_0x3a30aa['text']='('+_0x3a30aa[_0x00c3('0x19')]+'\x20OR\x20'+_0x1adce5+'.'+_0x3ea147['field']+'\x20IS\x20NULL)';_0x3a30aa['value']=parseValue(_0x2be8f8,_0x3ea147['operator'],_0x3ea147['value']);return _0x3a30aa;};function parseOperator(_0x79543b){var _0x3d2673;switch(_0x79543b){case _0x00c3('0x1f'):_0x3d2673=_0x00c3('0x20');break;case'$notIn':_0x3d2673=_0x00c3('0x21');break;case _0x00c3('0x11'):_0x3d2673='=\x20?';break;case _0x00c3('0x1d'):_0x3d2673=_0x00c3('0x22');break;case _0x00c3('0x23'):case _0x00c3('0x24'):case _0x00c3('0x25'):_0x3d2673=_0x00c3('0x26');break;case _0x00c3('0x27'):_0x3d2673=_0x00c3('0x28');break;case _0x00c3('0x14'):_0x3d2673=_0x00c3('0x29');break;case _0x00c3('0x15'):_0x3d2673=_0x00c3('0x2a');break;case _0x00c3('0x2b'):_0x3d2673='>=\x20?';break;case _0x00c3('0x12'):_0x3d2673=_0x00c3('0x2c');break;}return _0x3d2673;}function parseValue(_0x5005b1,_0x43273d,_0x36bb5e){var _0x1110dd={'start':undefined,'end':undefined};switch(_0x43273d){case _0x00c3('0x1f'):case _0x00c3('0x1e'):_0x1110dd[_0x00c3('0x2d')]=_0x36bb5e[_0x00c3('0x7')](',');break;case'$substring':_0x1110dd[_0x00c3('0x2d')]='%'+_0x36bb5e+'%';break;case _0x00c3('0x24'):_0x1110dd[_0x00c3('0x2d')]=_0x36bb5e+'%';break;case _0x00c3('0x25'):_0x1110dd[_0x00c3('0x2d')]='%'+_0x36bb5e;break;case _0x00c3('0x12'):var _0x478490=_0x36bb5e[_0x00c3('0x7')](',');var _0x36bb5e=_0x478490[_0x00c3('0x9')]();var _0x348856=_0x478490[_0x00c3('0x2e')]();if(_0x5005b1===_0x00c3('0xf')){_0x36bb5e=moment(_0x36bb5e)[_0x00c3('0x2f')](0x0,!![])['format']();_0x348856=moment(_0x348856)[_0x00c3('0x2f')](0x0,!![])[_0x00c3('0x30')](0x17,_0x00c3('0x31'))[_0x00c3('0x30')](0x3b,_0x00c3('0x32'))[_0x00c3('0x30')](0x3b,_0x00c3('0x33'))[_0x00c3('0x17')]();}_0x1110dd={'start':_0x36bb5e,'end':_0x348856};break;default:_0x1110dd[_0x00c3('0x2d')]=_0x36bb5e;break;}return _0x1110dd;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index ff556cf..10eb522 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 _0xec30=['join','getOptions','query','$id','filters','model','fields','attributes','nolimit','limit','order','where','filter','object','columns','name','VIRTUAL','lower','col','merge','options','sequelize','parse','keys','includes','isEmpty','find','type','isPlainObject','format','YYYY-MM-DD','$lte','utc','subtract','isArray','offset','sort','map','cast','priority','unsigned','substr','DESC','ASC','omit','isObject','length','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','split','replace','push'];(function(_0x560f2b,_0x40a89e){var _0x41a22f=function(_0x3d19c1){while(--_0x3d19c1){_0x560f2b['push'](_0x560f2b['shift']());}};_0x41a22f(++_0x40a89e);}(_0xec30,0xf9));var _0x0ec3=function(_0x3fc5ca,_0x575782){_0x3fc5ca=_0x3fc5ca-0x0;var _0x33b644=_0xec30[_0x3fc5ca];return _0x33b644;};'use strict';var _=require('lodash');var sequelize=require(_0x0ec3('0x0'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x36d1e7){var _0x496b07=['ne'];try{var _0x1d42c1=JSON[_0x0ec3('0x1')](_0x36d1e7);var _0x5bb22d=Object[_0x0ec3('0x2')](_0x1d42c1)[0x0];return _0x496b07[_0x0ec3('0x3')](_0x5bb22d);}catch(_0x28e2dc){return![];}}function getOperatorValue(_0x34a1fe){var _0x1214f2=JSON[_0x0ec3('0x1')](_0x34a1fe);var _0x434677=Object[_0x0ec3('0x2')](_0x1214f2)[0x0];var _0x5eda72=_0x1214f2[_0x434677];return{['$'+_0x434677]:_0x5eda72};}exports['fields']=function(_0x541e6c){var _0x2e34d3=null;if(_0x541e6c){_0x2e34d3=_0x541e6c['split'](',');}return _0x2e34d3;};exports['filters']=function(_0x4f69e8,_0x31ddf9){var _0xab6481={};if(!_[_0x0ec3('0x4')](_0x4f69e8)){_['forOwn'](_0x4f69e8,function(_0x2a2b2a,_0x56734a){try{if(_0x31ddf9){var _0xf8f684=_[_0x0ec3('0x5')](_0x31ddf9,{'name':_0x56734a})||{};if(hasSequelizeOperator(_0x2a2b2a)){_0xab6481[_0x56734a]=getOperatorValue(_0x2a2b2a);}else if(_0xf8f684[_0x0ec3('0x6')]==='DATE'&&_[_0x0ec3('0x7')](_0x2a2b2a)){var _0x5b83ca=JSON[_0x0ec3('0x1')](_0x2a2b2a);var _0x4ddc77={'$gte':moment(moment(_0x5b83ca['$gte'])[_0x0ec3('0x8')](_0x0ec3('0x9')))['utc']()[_0x0ec3('0x8')](),'$lte':moment(moment(_0x5b83ca[_0x0ec3('0xa')])[_0x0ec3('0x8')](_0x0ec3('0x9')))[_0x0ec3('0xb')]()[_0x0ec3('0xc')](0x1,'s')[_0x0ec3('0x8')]()};_0xab6481[_0x56734a]=_0x4ddc77;}else if(_0xf8f684['name']==='uniqueid'){_0xab6481[_0x56734a]=_0x2a2b2a;}else{_0xab6481[_0x56734a]=_[_0x0ec3('0xd')](_0x2a2b2a)?_0x2a2b2a:JSON['parse'](_0x2a2b2a);}}else{_0xab6481[_0x56734a]=_[_0x0ec3('0xd')](_0x2a2b2a)?_0x2a2b2a:JSON[_0x0ec3('0x1')](_0x2a2b2a);}}catch(_0x35bc1a){_0xab6481[_0x56734a]=_0x2a2b2a['split'](',');}});}return _0xab6481;};exports['limit']=function(_0x288369){_0x288369=parseInt(_0x288369,0xa);if(!_0x288369||_0x288369<0x0){_0x288369=LIMIT_VALUE;}return _0x288369;};exports[_0x0ec3('0xe')]=function(_0x20f687){_0x20f687=parseInt(_0x20f687,0xa);if(!_0x20f687||_0x20f687<0x0){_0x20f687=0x0;}return _0x20f687;};exports[_0x0ec3('0xf')]=function(_0x520458){var _0x40f899,_0x19226=null;if(_0x520458){_0x40f899=_0x520458['split'](',');_0x19226=_[_0x0ec3('0x10')](_0x40f899,function(_0x45ab45){if(_0x45ab45['indexOf']('-')===0x0){return[_0x45ab45==='priority'?sequelize[_0x0ec3('0x11')](sequelize['col'](_0x0ec3('0x12')),_0x0ec3('0x13')):_0x45ab45[_0x0ec3('0x14')](0x1),_0x0ec3('0x15')];}else{return[_0x45ab45===_0x0ec3('0x12')?sequelize[_0x0ec3('0x11')](sequelize['col'](_0x0ec3('0x12')),_0x0ec3('0x13')):_0x45ab45,_0x0ec3('0x16')];}});}return _0x19226;};exports[_0x0ec3('0x17')]=function(_0x78a803,_0xdaf1ad){if(_[_0x0ec3('0x4')](_0x78a803)){return _0x78a803;}if(_['isArray'](_0x78a803)){for(var _0x351741=0x0;_0x351741<_0x78a803['length'];_0x351741+=0x1){_0x78a803[_0x351741]=this['omit'](_0x78a803[_0x351741],_0xdaf1ad);}return _0x78a803;}if(!_[_0x0ec3('0x18')](_0x78a803)){return _0x78a803;}if(_['isString'](_0xdaf1ad)){_0xdaf1ad=[_0xdaf1ad];}if(!_[_0x0ec3('0xd')](_0xdaf1ad)){return _0x78a803;}for(var _0x53cef5=0x0;_0x53cef5<_0xdaf1ad[_0x0ec3('0x19')];_0x53cef5+=0x1){_[_0x0ec3('0x1a')](_0x78a803,_0xdaf1ad[_0x53cef5]);}for(var _0x2d499c in _0x78a803){if(_0x78a803[_0x0ec3('0x1b')](_0x2d499c)){_0x78a803[_0x2d499c]=this['omit'](_0x78a803[_0x2d499c],_0xdaf1ad);}}return _0x78a803;};exports[_0x0ec3('0x1c')]=function(_0xa0be75){return _0xa0be75[_0x0ec3('0x1d')](RegExp(_0x0ec3('0x1e')))?!![]:![];};exports[_0x0ec3('0x1f')]=function(_0x33329f){return _0x33329f[_0x0ec3('0x1d')](/^\S+@\S+$/)?!![]:![];};exports[_0x0ec3('0x20')]=function(_0x1ef362){var _0x592e99=[];_0x1ef362[_0x0ec3('0x21')](/[ ,]+/)['forEach'](function(_0x111d1b){_0x111d1b=_0x111d1b[_0x0ec3('0x22')](/([^:]")"+/g,'$1');_0x111d1b='+'+_0x111d1b+'*';if(_0x111d1b['includes']('@'))_0x111d1b='\x22'+_0x111d1b+'\x22';_0x592e99[_0x0ec3('0x23')](_0x111d1b);});return _0x592e99[_0x0ec3('0x24')]('\x20');};exports[_0x0ec3('0x25')]=function(_0x38fd9e,_0x30a549,_0xa90420){var _0x404545={},_0x35648f={};if(_0x30a549[_0x0ec3('0x26')][_0x0ec3('0x27')]){_0x30a549[_0x0ec3('0x26')]['id']=_0x30a549[_0x0ec3('0x26')][_0x0ec3('0x27')];delete _0x30a549[_0x0ec3('0x26')]['$id'];}_0x404545['model']=_[_0x0ec3('0x10')](_0x38fd9e,'name');_0x404545['query']=_[_0x0ec3('0x2')](_0x30a549['query']);_0x404545[_0x0ec3('0x28')]=_['intersection'](_0x404545['model'],_0x404545[_0x0ec3('0x26')]);_0x35648f['attributes']=_['intersection'](_0x404545[_0x0ec3('0x29')],this[_0x0ec3('0x2a')](_0x30a549['query']['fields']));_0x35648f[_0x0ec3('0x2b')]=_0x35648f[_0x0ec3('0x2b')][_0x0ec3('0x19')]?_0x35648f[_0x0ec3('0x2b')]:_0x404545['model'];if(!_0x30a549[_0x0ec3('0x26')][_0x0ec3('0x1b')](_0x0ec3('0x2c'))){_0x35648f[_0x0ec3('0x2d')]=this['limit'](_0x30a549['query'][_0x0ec3('0x2d')]);_0x35648f['offset']=this[_0x0ec3('0xe')](_0x30a549[_0x0ec3('0x26')][_0x0ec3('0xe')]);}_0x35648f[_0x0ec3('0x2e')]=this[_0x0ec3('0xf')](_0x30a549[_0x0ec3('0x26')][_0x0ec3('0xf')]);_0x35648f[_0x0ec3('0x2f')]=this[_0x0ec3('0x28')](_['pick'](_0x30a549['query'],_0x404545[_0x0ec3('0x28')]),_0x38fd9e);if(_0x30a549[_0x0ec3('0x26')][_0x0ec3('0x30')]){var _0x3a2d4d=_0x38fd9e;var _0x158795=_0x30a549[_0x0ec3('0x26')][_0x0ec3('0x30')];if(typeof _0x158795===_0x0ec3('0x31')){_0x3a2d4d=_[_0x0ec3('0x30')](_0x38fd9e,function(_0x46fa29){return _[_0x0ec3('0x3')](_0x158795[_0x0ec3('0x32')],_0x46fa29[_0x0ec3('0x33')]);});_0x158795=_0x158795['value'];}_0x35648f[_0x0ec3('0x2f')]=_['merge'](_0x35648f['where'],{'$or':_[_0x0ec3('0x10')](_0x3a2d4d,function(_0x27bd43){if(_0x27bd43[_0x0ec3('0x6')]!==_0x0ec3('0x34')){if(_0xa90420){return sequelize[_0x0ec3('0x2f')](sequelize['fn'](_0x0ec3('0x35'),sequelize[_0x0ec3('0x36')](_0x27bd43['name'])),{'$like':sequelize['fn'](_0x0ec3('0x35'),'%'+_0x30a549[_0x0ec3('0x26')][_0x0ec3('0x30')]+'%')});}else{var _0x40994c={};_0x40994c[_0x27bd43[_0x0ec3('0x33')]]={'$like':'%'+_0x30a549[_0x0ec3('0x26')]['filter']+'%'};return _0x40994c;}}})});}_0x35648f=_[_0x0ec3('0x37')]({},_0x35648f,_0x30a549[_0x0ec3('0x38')]);return _0x35648f;}; \ No newline at end of file +var _0x7780=['merge','lower','options','lodash','sequelize','moment','parse','keys','includes','fields','filters','isEmpty','forOwn','find','type','isPlainObject','$gte','YYYY-MM-DD','utc','format','subtract','name','uniqueid','isArray','split','limit','offset','sort','map','priority','cast','col','substr','omit','isObject','isString','length','unset','hasOwnProperty','isNumeric','isEmail','match','forEach','replace','push','join','getOptions','query','$id','model','attributes','intersection','nolimit','order','where','pick','filter','columns','value'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x7780,0xef));var _0x0778=function(_0x5dcae8,_0x14040a){_0x5dcae8=_0x5dcae8-0x0;var _0xa7a0c6=_0x7780[_0x5dcae8];return _0xa7a0c6;};'use strict';var _=require(_0x0778('0x0'));var sequelize=require(_0x0778('0x1'));var moment=require(_0x0778('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x236ead){var _0x3d8273=['ne'];try{var _0x4a2ab1=JSON[_0x0778('0x3')](_0x236ead);var _0x53e87b=Object[_0x0778('0x4')](_0x4a2ab1)[0x0];return _0x3d8273[_0x0778('0x5')](_0x53e87b);}catch(_0x5f51c3){return![];}}function getOperatorValue(_0x1544cf){var _0x31bb98=JSON[_0x0778('0x3')](_0x1544cf);var _0x1142b9=Object[_0x0778('0x4')](_0x31bb98)[0x0];var _0x2f74ae=_0x31bb98[_0x1142b9];return{['$'+_0x1142b9]:_0x2f74ae};}exports[_0x0778('0x6')]=function(_0x231d11){var _0x5c5266=null;if(_0x231d11){_0x5c5266=_0x231d11['split'](',');}return _0x5c5266;};exports[_0x0778('0x7')]=function(_0x2e9812,_0x543874){var _0x1ad8a4={};if(!_[_0x0778('0x8')](_0x2e9812)){_[_0x0778('0x9')](_0x2e9812,function(_0x1ccb86,_0x5b482b){try{if(_0x543874){var _0x50ccce=_[_0x0778('0xa')](_0x543874,{'name':_0x5b482b})||{};if(hasSequelizeOperator(_0x1ccb86)){_0x1ad8a4[_0x5b482b]=getOperatorValue(_0x1ccb86);}else if(_0x50ccce[_0x0778('0xb')]==='DATE'&&_[_0x0778('0xc')](_0x1ccb86)){var _0x1b0411=JSON[_0x0778('0x3')](_0x1ccb86);var _0x350fe2={'$gte':moment(moment(_0x1b0411[_0x0778('0xd')])['format'](_0x0778('0xe')))[_0x0778('0xf')]()[_0x0778('0x10')](),'$lte':moment(moment(_0x1b0411['$lte'])[_0x0778('0x10')](_0x0778('0xe')))['utc']()[_0x0778('0x11')](0x1,'s')[_0x0778('0x10')]()};_0x1ad8a4[_0x5b482b]=_0x350fe2;}else if(_0x50ccce[_0x0778('0x12')]===_0x0778('0x13')){_0x1ad8a4[_0x5b482b]=_0x1ccb86;}else{_0x1ad8a4[_0x5b482b]=_[_0x0778('0x14')](_0x1ccb86)?_0x1ccb86:JSON[_0x0778('0x3')](_0x1ccb86);}}else{_0x1ad8a4[_0x5b482b]=_['isArray'](_0x1ccb86)?_0x1ccb86:JSON[_0x0778('0x3')](_0x1ccb86);}}catch(_0x525955){_0x1ad8a4[_0x5b482b]=_0x1ccb86[_0x0778('0x15')](',');}});}return _0x1ad8a4;};exports[_0x0778('0x16')]=function(_0x34191a){_0x34191a=parseInt(_0x34191a,0xa);if(!_0x34191a||_0x34191a<0x0){_0x34191a=LIMIT_VALUE;}return _0x34191a;};exports[_0x0778('0x17')]=function(_0x5a0cb6){_0x5a0cb6=parseInt(_0x5a0cb6,0xa);if(!_0x5a0cb6||_0x5a0cb6<0x0){_0x5a0cb6=0x0;}return _0x5a0cb6;};exports[_0x0778('0x18')]=function(_0x5a77b5){var _0x17c817,_0x5a0d55=null;if(_0x5a77b5){_0x17c817=_0x5a77b5[_0x0778('0x15')](',');_0x5a0d55=_[_0x0778('0x19')](_0x17c817,function(_0x95cc34){if(_0x95cc34['indexOf']('-')===0x0){return[_0x95cc34===_0x0778('0x1a')?sequelize[_0x0778('0x1b')](sequelize[_0x0778('0x1c')]('priority'),'unsigned'):_0x95cc34[_0x0778('0x1d')](0x1),'DESC'];}else{return[_0x95cc34===_0x0778('0x1a')?sequelize[_0x0778('0x1b')](sequelize[_0x0778('0x1c')](_0x0778('0x1a')),'unsigned'):_0x95cc34,'ASC'];}});}return _0x5a0d55;};exports[_0x0778('0x1e')]=function(_0x2ed913,_0x2ce9b3){if(_[_0x0778('0x8')](_0x2ed913)){return _0x2ed913;}if(_[_0x0778('0x14')](_0x2ed913)){for(var _0x1079d8=0x0;_0x1079d8<_0x2ed913['length'];_0x1079d8+=0x1){_0x2ed913[_0x1079d8]=this[_0x0778('0x1e')](_0x2ed913[_0x1079d8],_0x2ce9b3);}return _0x2ed913;}if(!_[_0x0778('0x1f')](_0x2ed913)){return _0x2ed913;}if(_[_0x0778('0x20')](_0x2ce9b3)){_0x2ce9b3=[_0x2ce9b3];}if(!_[_0x0778('0x14')](_0x2ce9b3)){return _0x2ed913;}for(var _0x207031=0x0;_0x207031<_0x2ce9b3[_0x0778('0x21')];_0x207031+=0x1){_[_0x0778('0x22')](_0x2ed913,_0x2ce9b3[_0x207031]);}for(var _0x59b889 in _0x2ed913){if(_0x2ed913[_0x0778('0x23')](_0x59b889)){_0x2ed913[_0x59b889]=this['omit'](_0x2ed913[_0x59b889],_0x2ce9b3);}}return _0x2ed913;};exports[_0x0778('0x24')]=function(_0x540998){return _0x540998['match'](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0x0778('0x25')]=function(_0x2ceb6f){return _0x2ceb6f[_0x0778('0x26')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0xa7d003){var _0x15c56c=[];_0xa7d003[_0x0778('0x15')](/[ ,]+/)[_0x0778('0x27')](function(_0x1c58f2){_0x1c58f2=_0x1c58f2[_0x0778('0x28')](/([^:]")"+/g,'$1');_0x1c58f2='+'+_0x1c58f2+'*';if(_0x1c58f2[_0x0778('0x5')]('@'))_0x1c58f2='\x22'+_0x1c58f2+'\x22';_0x15c56c[_0x0778('0x29')](_0x1c58f2);});return _0x15c56c[_0x0778('0x2a')]('\x20');};exports[_0x0778('0x2b')]=function(_0x5a3048,_0x4c7688,_0x5b489b){var _0x4a09ce={},_0x67d1c4={};if(_0x4c7688[_0x0778('0x2c')][_0x0778('0x2d')]){_0x4c7688[_0x0778('0x2c')]['id']=_0x4c7688['query'][_0x0778('0x2d')];delete _0x4c7688['query']['$id'];}_0x4a09ce[_0x0778('0x2e')]=_[_0x0778('0x19')](_0x5a3048,_0x0778('0x12'));_0x4a09ce['query']=_[_0x0778('0x4')](_0x4c7688[_0x0778('0x2c')]);_0x4a09ce[_0x0778('0x7')]=_['intersection'](_0x4a09ce[_0x0778('0x2e')],_0x4a09ce['query']);_0x67d1c4[_0x0778('0x2f')]=_[_0x0778('0x30')](_0x4a09ce['model'],this[_0x0778('0x6')](_0x4c7688[_0x0778('0x2c')][_0x0778('0x6')]));_0x67d1c4['attributes']=_0x67d1c4[_0x0778('0x2f')][_0x0778('0x21')]?_0x67d1c4['attributes']:_0x4a09ce['model'];if(!_0x4c7688[_0x0778('0x2c')][_0x0778('0x23')](_0x0778('0x31'))){_0x67d1c4[_0x0778('0x16')]=this['limit'](_0x4c7688['query'][_0x0778('0x16')]);_0x67d1c4['offset']=this[_0x0778('0x17')](_0x4c7688[_0x0778('0x2c')][_0x0778('0x17')]);}_0x67d1c4[_0x0778('0x32')]=this[_0x0778('0x18')](_0x4c7688[_0x0778('0x2c')][_0x0778('0x18')]);_0x67d1c4[_0x0778('0x33')]=this[_0x0778('0x7')](_[_0x0778('0x34')](_0x4c7688[_0x0778('0x2c')],_0x4a09ce[_0x0778('0x7')]),_0x5a3048);if(_0x4c7688[_0x0778('0x2c')][_0x0778('0x35')]){var _0x495c47=_0x5a3048;var _0x4566d2=_0x4c7688[_0x0778('0x2c')]['filter'];if(typeof _0x4566d2==='object'){_0x495c47=_[_0x0778('0x35')](_0x5a3048,function(_0x12c0b5){return _[_0x0778('0x5')](_0x4566d2[_0x0778('0x36')],_0x12c0b5[_0x0778('0x12')]);});_0x4566d2=_0x4566d2[_0x0778('0x37')];}_0x67d1c4[_0x0778('0x33')]=_[_0x0778('0x38')](_0x67d1c4['where'],{'$or':_[_0x0778('0x19')](_0x495c47,function(_0x58a1b4){if(_0x58a1b4['type']!=='VIRTUAL'){if(_0x5b489b){return sequelize[_0x0778('0x33')](sequelize['fn'](_0x0778('0x39'),sequelize[_0x0778('0x1c')](_0x58a1b4[_0x0778('0x12')])),{'$like':sequelize['fn'](_0x0778('0x39'),'%'+_0x4c7688[_0x0778('0x2c')][_0x0778('0x35')]+'%')});}else{var _0x4d5a16={};_0x4d5a16[_0x58a1b4[_0x0778('0x12')]]={'$like':'%'+_0x4c7688[_0x0778('0x2c')]['filter']+'%'};return _0x4d5a16;}}})});}_0x67d1c4=_['merge']({},_0x67d1c4,_0x4c7688[_0x0778('0x3a')]);return _0x67d1c4;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 1fa0c93..2bb2159 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe05a=['json','initialize','express','serve-favicon','method-override','errorhandler','path','passport','cors','moment','./environment','../mysqldb','get','env','production','join','development','test','set','appPath','client','use','json\x20replacer','root','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb'];(function(_0x14cfca,_0x2b5806){var _0x44cd9d=function(_0x3b63f2){while(--_0x3b63f2){_0x14cfca['push'](_0x14cfca['shift']());}};_0x44cd9d(++_0x2b5806);}(_0xe05a,0x9d));var _0xae05=function(_0x591993,_0x27ef71){_0x591993=_0x591993-0x0;var _0x2890f5=_0xe05a[_0x591993];return _0x2890f5;};'use strict';var express=require(_0xae05('0x0'));var favicon=require(_0xae05('0x1'));var bodyParser=require('body-parser');var methodOverride=require(_0xae05('0x2'));var cookieParser=require('cookie-parser');var errorHandler=require(_0xae05('0x3'));var path=require(_0xae05('0x4'));var passport=require(_0xae05('0x5'));var cors=require(_0xae05('0x6'));var moment=require(_0xae05('0x7'));var config=require(_0xae05('0x8'));var db=require(_0xae05('0x9'))['db'];exports['default']=function(_0x3caffd){var _0x531dbd=_0x3caffd[_0xae05('0xa')](_0xae05('0xb'));if(_0x531dbd===_0xae05('0xc')){_0x3caffd['set']('appPath',path[_0xae05('0xd')](config['root'],'public'));}if(_0x531dbd===_0xae05('0xe')||_0x531dbd===_0xae05('0xf')){_0x3caffd[_0xae05('0x10')](_0xae05('0x11'),path['join'](config['root'],_0xae05('0x12')));_0x3caffd[_0xae05('0x13')](errorHandler());}_0x3caffd['set'](_0xae05('0x14'),function(_0x23a695,_0x54caad){if(this[_0x23a695]instanceof Date){_0x54caad=this[_0x23a695]['toISOString']()['split']('.')[0x0]+'Z';}return _0x54caad;});_0x3caffd[_0xae05('0x13')](express['static'](_0x3caffd[_0xae05('0xa')](_0xae05('0x11'))));_0x3caffd[_0xae05('0x10')]('views',config[_0xae05('0x15')]+'/server/views');_0x3caffd[_0xae05('0x16')](_0xae05('0x17'),require(_0xae05('0x18'))[_0xae05('0x19')]);_0x3caffd[_0xae05('0x10')](_0xae05('0x1a'),_0xae05('0x17'));_0x3caffd[_0xae05('0x13')](bodyParser[_0xae05('0x1b')]({'limit':_0xae05('0x1c'),'extended':!![]}));_0x3caffd[_0xae05('0x13')](bodyParser[_0xae05('0x1d')]({'limit':_0xae05('0x1c')}));_0x3caffd[_0xae05('0x13')](cors());_0x3caffd['use'](methodOverride());_0x3caffd['use'](cookieParser());_0x3caffd[_0xae05('0x13')](passport[_0xae05('0x1e')]());}; \ No newline at end of file +var _0x28c0=['./environment','default','get','env','production','set','join','root','public','test','appPath','client','use','json\x20replacer','split','views','/server/views','engine','html','view\x20engine','urlencoded','50mb','json','initialize','express','serve-favicon','body-parser','cookie-parser','errorhandler','path','cors','moment'];(function(_0x4a7062,_0x244139){var _0x1b55a4=function(_0x33194c){while(--_0x33194c){_0x4a7062['push'](_0x4a7062['shift']());}};_0x1b55a4(++_0x244139);}(_0x28c0,0x178));var _0x028c=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x28c0[_0x53ccf2];return _0x5a2964;};'use strict';var express=require(_0x028c('0x0'));var favicon=require(_0x028c('0x1'));var bodyParser=require(_0x028c('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0x028c('0x3'));var errorHandler=require(_0x028c('0x4'));var path=require(_0x028c('0x5'));var passport=require('passport');var cors=require(_0x028c('0x6'));var moment=require(_0x028c('0x7'));var config=require(_0x028c('0x8'));var db=require('../mysqldb')['db'];exports[_0x028c('0x9')]=function(_0x493b8f){var _0x1b0e33=_0x493b8f[_0x028c('0xa')](_0x028c('0xb'));if(_0x1b0e33===_0x028c('0xc')){_0x493b8f[_0x028c('0xd')]('appPath',path[_0x028c('0xe')](config[_0x028c('0xf')],_0x028c('0x10')));}if(_0x1b0e33==='development'||_0x1b0e33===_0x028c('0x11')){_0x493b8f[_0x028c('0xd')](_0x028c('0x12'),path[_0x028c('0xe')](config['root'],_0x028c('0x13')));_0x493b8f[_0x028c('0x14')](errorHandler());}_0x493b8f[_0x028c('0xd')](_0x028c('0x15'),function(_0x4542d3,_0x1c578e){if(this[_0x4542d3]instanceof Date){_0x1c578e=this[_0x4542d3]['toISOString']()[_0x028c('0x16')]('.')[0x0]+'Z';}return _0x1c578e;});_0x493b8f[_0x028c('0x14')](express['static'](_0x493b8f[_0x028c('0xa')](_0x028c('0x12'))));_0x493b8f['set'](_0x028c('0x17'),config[_0x028c('0xf')]+_0x028c('0x18'));_0x493b8f[_0x028c('0x19')](_0x028c('0x1a'),require('ejs')['renderFile']);_0x493b8f[_0x028c('0xd')](_0x028c('0x1b'),'html');_0x493b8f[_0x028c('0x14')](bodyParser[_0x028c('0x1c')]({'limit':_0x028c('0x1d'),'extended':!![]}));_0x493b8f[_0x028c('0x14')](bodyParser[_0x028c('0x1e')]({'limit':_0x028c('0x1d')}));_0x493b8f[_0x028c('0x14')](cors());_0x493b8f[_0x028c('0x14')](methodOverride());_0x493b8f[_0x028c('0x14')](cookieParser());_0x493b8f[_0x028c('0x14')](passport[_0x028c('0x1f')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 614955d..0dd3955 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 _0xdc67=['cpus','model','createHash','update','digest','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','ipAddress','md5','substring','lodash','crypto','child_process','execSync','../environment','networkInterfaces','length','filter','family','IPv4','internal','mac','address','127.0.0.1','getFirstInterface','orderBy'];(function(_0x5d8987,_0x14d054){var _0x2997eb=function(_0x56f92a){while(--_0x56f92a){_0x5d8987['push'](_0x5d8987['shift']());}};_0x2997eb(++_0x14d054);}(_0xdc67,0xf0));var _0x7dc6=function(_0x568a61,_0x2124f8){_0x568a61=_0x568a61-0x0;var _0x334c3b=_0xdc67[_0x568a61];return _0x334c3b;};'use strict';var _=require(_0x7dc6('0x0'));var os=require('os');var crypto=require(_0x7dc6('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x7dc6('0x2'))[_0x7dc6('0x3')];var config=require(_0x7dc6('0x4'));function getInterfaces(){var _0x1eebfa=[];var _0x1fdb1b=os[_0x7dc6('0x5')]();var _0x48c9db=_['orderBy'](_['keys'](_0x1fdb1b));for(var _0x3a3669=0x0;_0x3a3669<_0x48c9db[_0x7dc6('0x6')];_0x3a3669++){var _0x1a17d2=_0x1fdb1b[_0x48c9db[_0x3a3669]][_0x7dc6('0x7')](function(_0x12678f){return _0x12678f[_0x7dc6('0x8')]===_0x7dc6('0x9')&&_0x12678f[_0x7dc6('0xa')]===![];});_0x1eebfa=_0x1eebfa['concat'](_0x1a17d2);}return _0x1eebfa;}function getFirstInterface(){var _0x4f385d=_['head'](getInterfaces());return{'macAddress':_0x4f385d&&_0x4f385d[_0x7dc6('0xb')]?_0x4f385d[_0x7dc6('0xb')]:'00:00:00:00:00:00','ipAddress':_0x4f385d&&_0x4f385d[_0x7dc6('0xc')]?_0x4f385d[_0x7dc6('0xc')]:_0x7dc6('0xd')};}exports[_0x7dc6('0xe')]=getFirstInterface;function getCPUhash(){var _0xec6d90=_[_0x7dc6('0xf')](os[_0x7dc6('0x10')]()['map'](function(_0x5f03f2){return _0x5f03f2[_0x7dc6('0x11')];}))['join'](':');return crypto[_0x7dc6('0x12')]('md5')[_0x7dc6('0x13')](_0xec6d90)[_0x7dc6('0x14')]('hex');}exports[_0x7dc6('0x15')]=function(){var _0x264b97=os[_0x7dc6('0x16')]();var _0xc89116=/[0-9a-f-]{36}/;if(config[_0x7dc6('0x17')]&&_0xc89116[_0x7dc6('0x18')](config[_0x7dc6('0x17')])){return config[_0x7dc6('0x17')];}else if(_0x264b97===_0x7dc6('0x19')){return exec(_0x7dc6('0x1a'),{'encoding':_0x7dc6('0x1b')})[_0x7dc6('0x1c')]('\x0d\x0a','');}else{var _0x59796d=getFirstInterface();var _0x29d852=getCPUhash();var _0x241443=_0x29d852+'|'+os['hostname']()+'|'+_0x59796d['macAddress']+'|'+_0x59796d[_0x7dc6('0x1d')];var _0x538786=crypto[_0x7dc6('0x12')](_0x7dc6('0x1e'))[_0x7dc6('0x13')](_0x241443)[_0x7dc6('0x14')]('hex');return _0x538786[_0x7dc6('0x1f')](0x0,0x8)+'-'+_0x538786[_0x7dc6('0x1f')](0x8,0xc)+'-'+_0x538786[_0x7dc6('0x1f')](0xc,0x10)+'-'+_0x538786[_0x7dc6('0x1f')](0x10,0x14)+'-'+_0x538786[_0x7dc6('0x1f')](0x14);}}; \ No newline at end of file +var _0x6600=['dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','ipAddress','substring','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','model','createHash','md5','update','digest','hex','platform','licenseToken'];(function(_0x5a1119,_0x4552fa){var _0x1d9835=function(_0x150e6f){while(--_0x150e6f){_0x5a1119['push'](_0x5a1119['shift']());}};_0x1d9835(++_0x4552fa);}(_0x6600,0x146));var _0x0660=function(_0x256817,_0x4f71a1){_0x256817=_0x256817-0x0;var _0x4e89f1=_0x6600[_0x256817];return _0x4e89f1;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require(_0x0660('0x0'));var exec=require(_0x0660('0x1'))[_0x0660('0x2')];var config=require(_0x0660('0x3'));function getInterfaces(){var _0x340f5d=[];var _0x5ca4f7=os[_0x0660('0x4')]();var _0x5d6199=_[_0x0660('0x5')](_['keys'](_0x5ca4f7));for(var _0x31f1e1=0x0;_0x31f1e1<_0x5d6199['length'];_0x31f1e1++){var _0x5c83ed=_0x5ca4f7[_0x5d6199[_0x31f1e1]][_0x0660('0x6')](function(_0x1c3977){return _0x1c3977[_0x0660('0x7')]===_0x0660('0x8')&&_0x1c3977[_0x0660('0x9')]===![];});_0x340f5d=_0x340f5d[_0x0660('0xa')](_0x5c83ed);}return _0x340f5d;}function getFirstInterface(){var _0x2ef192=_[_0x0660('0xb')](getInterfaces());return{'macAddress':_0x2ef192&&_0x2ef192['mac']?_0x2ef192[_0x0660('0xc')]:_0x0660('0xd'),'ipAddress':_0x2ef192&&_0x2ef192[_0x0660('0xe')]?_0x2ef192[_0x0660('0xe')]:_0x0660('0xf')};}exports[_0x0660('0x10')]=getFirstInterface;function getCPUhash(){var _0x3bf338=_[_0x0660('0x5')](os['cpus']()[_0x0660('0x11')](function(_0x8c77f9){return _0x8c77f9[_0x0660('0x12')];}))['join'](':');return crypto[_0x0660('0x13')](_0x0660('0x14'))[_0x0660('0x15')](_0x3bf338)[_0x0660('0x16')](_0x0660('0x17'));}exports['getUuid']=function(){var _0x142bb7=os[_0x0660('0x18')]();var _0x573c0e=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x573c0e['test'](config['licenseToken'])){return config[_0x0660('0x19')];}else if(_0x142bb7==='win32'){return exec(_0x0660('0x1a'),{'encoding':_0x0660('0x1b')})['replace']('\x0d\x0a','');}else{var _0x460f78=getFirstInterface();var _0x6c6c7b=getCPUhash();var _0x40acc0=_0x6c6c7b+'|'+os[_0x0660('0x1c')]()+'|'+_0x460f78[_0x0660('0x1d')]+'|'+_0x460f78[_0x0660('0x1e')];var _0x391ec0=crypto['createHash'](_0x0660('0x14'))['update'](_0x40acc0)[_0x0660('0x16')](_0x0660('0x17'));return _0x391ec0[_0x0660('0x1f')](0x0,0x8)+'-'+_0x391ec0[_0x0660('0x1f')](0x8,0xc)+'-'+_0x391ec0[_0x0660('0x1f')](0xc,0x10)+'-'+_0x391ec0[_0x0660('0x1f')](0x10,0x14)+'-'+_0x391ec0[_0x0660('0x1f')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index a1199dc..5c427c8 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 _0xd622=['./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','version','exports','GET','then','catch','get','data1','active','info','data2','update','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','decryptString','days','message','getUuid','License','findOrCreate','spread','error','default','util','moment','request-promise','bluebird','pkginfo','../../mysqldb','../../components/encryptor'];(function(_0x3f2b6e,_0xd48d0e){var _0x2a6f4b=function(_0x5f0070){while(--_0x5f0070){_0x3f2b6e['push'](_0x3f2b6e['shift']());}};_0x2a6f4b(++_0xd48d0e);}(_0xd622,0x6b));var _0x2d62=function(_0x2b2dbd,_0x12a368){_0x2b2dbd=_0x2b2dbd-0x0;var _0x56d017=_0xd622[_0x2b2dbd];return _0x56d017;};'use strict';var util=require(_0x2d62('0x0'));var moment=require(_0x2d62('0x1'));var rp=require(_0x2d62('0x2'));var BPromise=require(_0x2d62('0x3'));var pkginfo=require(_0x2d62('0x4'))(module,'version');var db=require(_0x2d62('0x5'))['db'];var encryptor=require(_0x2d62('0x6'));var hardware=require(_0x2d62('0x7'));var logger=require(_0x2d62('0x8'))(_0x2d62('0x9'));var HOST=_0x2d62('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4416c1){return new BPromise(function(_0x235ae9,_0x18f013){var _0x17e09e=util[_0x2d62('0xb')](_0x2d62('0xc'),HOST,_0x4416c1,module['exports'][_0x2d62('0xd')]);if(oldToken){_0x17e09e=util['format']('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x4416c1,module[_0x2d62('0xe')][_0x2d62('0xd')],oldToken);}var _0x59b5a1={'uri':_0x17e09e,'method':_0x2d62('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x59b5a1)[_0x2d62('0x10')](function(_0x2dde2f){_0x235ae9(_0x2dde2f);})[_0x2d62('0x11')](function(_0x3444cf){_0x18f013(_0x3444cf);});});}function manageLicense(_0x4063c0,_0x1575c3){var _0x5cc628=_0x1575c3[_0x2d62('0x12')]({'plain':!![]});if(!isOldTokenSent&&_0x5cc628[_0x2d62('0x13')]!==_0x4063c0&&!_0x5cc628['data2']){oldToken=_0x5cc628[_0x2d62('0x13')];}httpRequest(_0x4063c0)[_0x2d62('0x10')](function(_0x3d5397){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3d5397[_0x2d62('0x14')]){isOldTokenSent=![];if(!_0x5cc628[_0x2d62('0x9')]&&_0x5cc628['license']!=_0x3d5397[_0x2d62('0x9')]||_0x5cc628[_0x2d62('0x9')]&&_0x5cc628['data2']){logger[_0x2d62('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x5cc628['license']&&!_0x5cc628['data2']&&_0x5cc628[_0x2d62('0x9')]!=_0x3d5397[_0x2d62('0x9')]){logger[_0x2d62('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x5cc628['license']&&!_0x5cc628[_0x2d62('0x16')]&&_0x5cc628[_0x2d62('0x9')]==_0x3d5397['license']){return _0x1575c3;}return _0x1575c3[_0x2d62('0x17')]({'data1':_0x4063c0,'data2':null,'license':_0x3d5397[_0x2d62('0x9')]});}else{if(_0x3d5397['license']||_0x5cc628[_0x2d62('0x9')]){if(!_0x5cc628['data2']){if(_0x5cc628[_0x2d62('0x13')]==_0x4063c0){GRAY_PERIOD_REASON='Disabled';logger[_0x2d62('0x15')](_0x2d62('0x18'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x2d62('0x15')](_0x2d62('0x19'),_0x5cc628[_0x2d62('0x13')],_0x4063c0);}logger[_0x2d62('0x15')](_0x2d62('0x1a'),GRAY_PERIOD_REASON[_0x2d62('0x1b')](),moment()[_0x2d62('0xb')](_0x2d62('0x1c')));return _0x1575c3[_0x2d62('0x17')]({'data2':encryptor['encryptString'](moment()['format'](_0x2d62('0x1c')))});}else{if(moment()['diff'](encryptor[_0x2d62('0x1d')](_0x5cc628['data2']),_0x2d62('0x1e'))>DAYS){logger[_0x2d62('0x15')]('DEMO\x20START\x20AT\x20%s',moment()[_0x2d62('0xb')](_0x2d62('0x1c')));isOldTokenSent=![];return _0x1575c3[_0x2d62('0x17')]({'data1':_0x4063c0,'data2':null,'license':null});}}}else{if(_0x5cc628[_0x2d62('0x13')]!=_0x4063c0){logger[_0x2d62('0x15')](_0x2d62('0x19'),_0x5cc628[_0x2d62('0x13')],_0x4063c0);return _0x1575c3[_0x2d62('0x17')]({'data1':_0x4063c0,'data2':null,'license':null});}}}return _0x1575c3;})[_0x2d62('0x10')](function(_0x2fc0f2){_0x1575c3=_0x2fc0f2;})['catch'](function(_0x2f00f8){logger['error'](_0x2f00f8[_0x2d62('0x1f')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x2d62('0x20')](),_0x1575c3);},TIME);});}function defaultLicense(){var _0x2840cd=hardware[_0x2d62('0x20')]();if(_0x2840cd){return db[_0x2d62('0x21')][_0x2d62('0x22')]({'where':{'id':0x1},'defaults':{'data1':_0x2840cd}})[_0x2d62('0x23')](function(_0x2044f1,_0x4b45f6){logger[_0x2d62('0x15')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x2840cd);manageLicense(_0x2840cd,_0x2044f1);})[_0x2d62('0x11')](function(_0x438a41){logger[_0x2d62('0x24')](_0x438a41[_0x2d62('0x1f')]);});}}exports[_0x2d62('0x25')]=defaultLicense; \ No newline at end of file +var _0xcbf2=['SERVICE\x20LICENSE\x20STARTED\x20%s','catch','default','util','moment','version','../../mysqldb','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','GET','then','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','days','update','error','message','getUuid','License'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcbf2,0xad));var _0x2cbf=function(_0xa0057f,_0x5b1918){_0xa0057f=_0xa0057f-0x0;var _0xfd9f8f=_0xcbf2[_0xa0057f];return _0xfd9f8f;};'use strict';var util=require(_0x2cbf('0x0'));var moment=require(_0x2cbf('0x1'));var rp=require('request-promise');var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,_0x2cbf('0x2'));var db=require(_0x2cbf('0x3'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x2cbf('0x4'));var logger=require(_0x2cbf('0x5'))(_0x2cbf('0x6'));var HOST=_0x2cbf('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x29c6c5){return new BPromise(function(_0x1b4502,_0x3e74fe){var _0x24beec=util[_0x2cbf('0x8')](_0x2cbf('0x9'),HOST,_0x29c6c5,module[_0x2cbf('0xa')][_0x2cbf('0x2')]);if(oldToken){_0x24beec=util[_0x2cbf('0x8')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x29c6c5,module['exports'][_0x2cbf('0x2')],oldToken);}var _0x439b56={'uri':_0x24beec,'method':_0x2cbf('0xb'),'timeout':0xea60,'json':!![]};return rp(_0x439b56)[_0x2cbf('0xc')](function(_0xd5142){_0x1b4502(_0xd5142);})['catch'](function(_0x46d63b){_0x3e74fe(_0x46d63b);});});}function manageLicense(_0x14e95a,_0x34b858){var _0x1ccebf=_0x34b858[_0x2cbf('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x1ccebf[_0x2cbf('0xe')]!==_0x14e95a&&!_0x1ccebf[_0x2cbf('0xf')]){oldToken=_0x1ccebf[_0x2cbf('0xe')];}httpRequest(_0x14e95a)[_0x2cbf('0xc')](function(_0x1495de){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1495de[_0x2cbf('0x10')]){isOldTokenSent=![];if(!_0x1ccebf[_0x2cbf('0x6')]&&_0x1ccebf[_0x2cbf('0x6')]!=_0x1495de[_0x2cbf('0x6')]||_0x1ccebf[_0x2cbf('0x6')]&&_0x1ccebf[_0x2cbf('0xf')]){logger[_0x2cbf('0x11')](_0x2cbf('0x12'));}if(_0x1ccebf[_0x2cbf('0x6')]&&!_0x1ccebf['data2']&&_0x1ccebf['license']!=_0x1495de[_0x2cbf('0x6')]){logger[_0x2cbf('0x11')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x1ccebf[_0x2cbf('0x6')]&&!_0x1ccebf[_0x2cbf('0xf')]&&_0x1ccebf[_0x2cbf('0x6')]==_0x1495de['license']){return _0x34b858;}return _0x34b858['update']({'data1':_0x14e95a,'data2':null,'license':_0x1495de['license']});}else{if(_0x1495de[_0x2cbf('0x6')]||_0x1ccebf[_0x2cbf('0x6')]){if(!_0x1ccebf[_0x2cbf('0xf')]){if(_0x1ccebf[_0x2cbf('0xe')]==_0x14e95a){GRAY_PERIOD_REASON=_0x2cbf('0x13');logger['info'](_0x2cbf('0x14'));}else{GRAY_PERIOD_REASON=_0x2cbf('0x15');logger[_0x2cbf('0x11')](_0x2cbf('0x16'),_0x1ccebf[_0x2cbf('0xe')],_0x14e95a);}logger[_0x2cbf('0x11')](_0x2cbf('0x17'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x2cbf('0x8')](_0x2cbf('0x18')));return _0x34b858['update']({'data2':encryptor['encryptString'](moment()[_0x2cbf('0x8')](_0x2cbf('0x18')))});}else{if(moment()['diff'](encryptor['decryptString'](_0x1ccebf[_0x2cbf('0xf')]),_0x2cbf('0x19'))>DAYS){logger[_0x2cbf('0x11')]('DEMO\x20START\x20AT\x20%s',moment()[_0x2cbf('0x8')](_0x2cbf('0x18')));isOldTokenSent=![];return _0x34b858[_0x2cbf('0x1a')]({'data1':_0x14e95a,'data2':null,'license':null});}}}else{if(_0x1ccebf['data1']!=_0x14e95a){logger['info'](_0x2cbf('0x16'),_0x1ccebf[_0x2cbf('0xe')],_0x14e95a);return _0x34b858['update']({'data1':_0x14e95a,'data2':null,'license':null});}}}return _0x34b858;})['then'](function(_0x5278d7){_0x34b858=_0x5278d7;})['catch'](function(_0x2fbe61){logger[_0x2cbf('0x1b')](_0x2fbe61[_0x2cbf('0x1c')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x2cbf('0x1d')](),_0x34b858);},TIME);});}function defaultLicense(){var _0x3c95a6=hardware['getUuid']();if(_0x3c95a6){return db[_0x2cbf('0x1e')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x3c95a6}})['spread'](function(_0x258c5d,_0x2f5f9d){logger[_0x2cbf('0x11')](_0x2cbf('0x1f'),_0x3c95a6);manageLicense(_0x3c95a6,_0x258c5d);})[_0x2cbf('0x20')](function(_0x24416a){logger[_0x2cbf('0x1b')](_0x24416a[_0x2cbf('0x1c')]);});}}exports[_0x2cbf('0x21')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 386ce0d..f65fe6b 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 _0x8213=['License','find','defaults','then','catch','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','uuid','machineUuid','gray','deadline','add','days','grayReason','changed','disabled','message','User','role','sequelize','COUNT','col','count','admin','user','telephone','users','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','Breaking\x20license','getUuid'];(function(_0x2a7ca0,_0xead3a){var _0x51e111=function(_0x47b3dc){while(--_0x47b3dc){_0x2a7ca0['push'](_0x2a7ca0['shift']());}};_0x51e111(++_0xead3a);}(_0x8213,0x1b1));var _0x3821=function(_0x5191a3,_0x1e8482){_0x5191a3=_0x5191a3-0x0;var _0x59d9bb=_0x8213[_0x5191a3];return _0x59d9bb;};'use strict';var util=require('util');var _=require(_0x3821('0x0'));var moment=require(_0x3821('0x1'));var BPromise=require(_0x3821('0x2'));var hardware=require(_0x3821('0x3'));var encryptor=require(_0x3821('0x4'));var db=require(_0x3821('0x5'))['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':'Demo\x20license','machineUuid':hardware['getUuid'](),'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':_0x3821('0x6'),'machineUuid':hardware[_0x3821('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x569b93){return new BPromise(function(_0x2058f9,_0x3db29b){return db[_0x3821('0x8')][_0x3821('0x9')](_[_0x3821('0xa')](_0x569b93,{'raw':!![],'where':{'id':0x1}}))[_0x3821('0xb')](function(_0x569483){return checkLicense(_0x569483,null);})[_0x3821('0xb')](function(_0x5663a5){_0x2058f9(_0x5663a5);return;})[_0x3821('0xc')](function(_0x511fc6){_0x3db29b(_0x511fc6);});});}function checkLicense(_0x53d06a,_0x2c1593){if(!_0x53d06a){demoLicense['uuid']=_0x53d06a[_0x3821('0xd')];return demoLicense;}try{var _0x3820f1=_0x2c1593||_0x53d06a[_0x3821('0xe')];if(_[_0x3821('0xf')](_0x3820f1)){throw new Error(_0x3821('0x10'));}var _0x1a646d=_0x53d06a[_0x3821('0xd')];var _0x2a6dcf=_0x53d06a[_0x3821('0x11')];var _0x635a18=_0x1a646d[_0x3821('0x12')]('-')[0x4];var _0x2e228f=_0x1a646d[_0x3821('0x12')]('-')[0x0];var _0x20cd5c=encryptor[_0x3821('0x13')](_0x3820f1,util[_0x3821('0x14')](_0x3821('0x15'),_0x635a18,_0x1a646d,_0x2e228f));var _0x55336d=JSON[_0x3821('0x16')](_0x20cd5c);_0x55336d['demo']=![];_0x55336d[_0x3821('0x17')]=_0x1a646d;_0x55336d[_0x3821('0x18')]=hardware[_0x3821('0x7')]();if(_0x2a6dcf){var _0x572f67=encryptor['decryptString'](_0x2a6dcf);_0x55336d[_0x3821('0x19')]=_0x572f67;_0x55336d[_0x3821('0x1a')]=moment(_0x572f67)[_0x3821('0x1b')](0x7,_0x3821('0x1c'))['format']();_0x55336d[_0x3821('0x1d')]=_0x55336d[_0x3821('0x17')]!=_0x55336d[_0x3821('0x18')]?_0x3821('0x1e'):_0x3821('0x1f');}return _0x55336d;}catch(_0x2937fe){breakingLicense[_0x3821('0x17')]=_0x53d06a['data1'];breakingLicense[_0x3821('0x20')]=_0x2937fe[_0x3821('0x20')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3745c8,_0x190c35){getLicense()['then'](function(_0x289fc0){return db[_0x3821('0x21')]['findAll']({'attributes':[_0x3821('0x22'),[db[_0x3821('0x23')]['fn'](_0x3821('0x24'),db[_0x3821('0x23')][_0x3821('0x25')]('role')),_0x3821('0x26')]],'group':_0x3821('0x22'),'where':{'role':{'$or':[_0x3821('0x27'),_0x3821('0x28'),_0x3821('0x29')]}},'raw':!![]})[_0x3821('0xb')](function(_0x485251){var _0x55f801={'user':_0x289fc0[_0x3821('0x2a')]||0x0,'telephone':_0x289fc0['telephones']||0x0};_0x485251[_0x3821('0x2b')](function(_0x3117da){var _0x578c97=_0x3117da[_0x3821('0x22')]==='admin'?_0x3821('0x28'):_0x3117da['role'];_0x55f801[_0x578c97]-=_0x3117da[_0x3821('0x26')];if(_0x55f801[_0x578c97]<0x0)_0x55f801[_0x578c97]=0x0;});_0x3745c8(_0x55f801);return;});})[_0x3821('0xc')](function(_0x5c7ebb){_0x190c35(_0x5c7ebb);});});}function checkUserLimits(_0x23dd56){return new BPromise(function(_0x360e30,_0x164478){getLimits()[_0x3821('0xb')](function(_0x3ef4bd){var _0x1f4131=_[_0x3821('0x2c')](_[_0x3821('0x2d')](_0x23dd56,'role'),[_0x3821('0x27'),_0x3821('0x28'),_0x3821('0x29')]);var _0x3a9777=(_0x1f4131['admin']||0x0)+(_0x1f4131[_0x3821('0x28')]||0x0);var _0x2c6c9e=_0x1f4131[_0x3821('0x29')]||0x0;if(_0x3a9777>_0x3ef4bd[_0x3821('0x28')])return _0x164478(_0x3821('0x2e'));if(_0x2c6c9e>_0x3ef4bd[_0x3821('0x29')])return _0x164478(_0x3821('0x2f'));return _0x360e30();})['catch'](function(_0x32634d){_0x164478(_0x32634d);});});}module[_0x3821('0x30')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xc376=['then','catch','uuid','license','data1','data2','split','decryptString','format','%s:%s:%s','parse','deadline','grayReason','changed','disabled','message','User','findAll','sequelize','role','count','admin','user','users','telephones','forEach','telephone','License\x20limit\x20reached\x20for\x20users','util','lodash','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults'];(function(_0x2c9062,_0x525a88){var _0x48fa9f=function(_0x2d2731){while(--_0x2d2731){_0x2c9062['push'](_0x2c9062['shift']());}};_0x48fa9f(++_0x525a88);}(_0xc376,0x18d));var _0x6c37=function(_0x2f2cb8,_0x417d38){_0x2f2cb8=_0x2f2cb8-0x0;var _0x5a7add=_0xc376[_0x2f2cb8];return _0x5a7add;};'use strict';var util=require(_0x6c37('0x0'));var _=require(_0x6c37('0x1'));var moment=require('moment');var BPromise=require(_0x6c37('0x2'));var hardware=require(_0x6c37('0x3'));var encryptor=require(_0x6c37('0x4'));var db=require(_0x6c37('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x6c37('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x6c37('0x7'),'machineUuid':hardware[_0x6c37('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x6c37('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x6c37('0x9'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x358e5d){return new BPromise(function(_0x3160eb,_0x137692){return db[_0x6c37('0xa')][_0x6c37('0xb')](_[_0x6c37('0xc')](_0x358e5d,{'raw':!![],'where':{'id':0x1}}))[_0x6c37('0xd')](function(_0x1cf78c){return checkLicense(_0x1cf78c,null);})['then'](function(_0x1f4411){_0x3160eb(_0x1f4411);return;})[_0x6c37('0xe')](function(_0x2132af){_0x137692(_0x2132af);});});}function checkLicense(_0x5b6955,_0x211e75){if(!_0x5b6955){demoLicense[_0x6c37('0xf')]=_0x5b6955['data1'];return demoLicense;}try{var _0x37561a=_0x211e75||_0x5b6955[_0x6c37('0x10')];if(_['isEmpty'](_0x37561a)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x3cbe68=_0x5b6955[_0x6c37('0x11')];var _0xf340=_0x5b6955[_0x6c37('0x12')];var _0x575c5d=_0x3cbe68[_0x6c37('0x13')]('-')[0x4];var _0x2b6c5e=_0x3cbe68[_0x6c37('0x13')]('-')[0x0];var _0x35ef9a=encryptor[_0x6c37('0x14')](_0x37561a,util[_0x6c37('0x15')](_0x6c37('0x16'),_0x575c5d,_0x3cbe68,_0x2b6c5e));var _0x40dc9c=JSON[_0x6c37('0x17')](_0x35ef9a);_0x40dc9c['demo']=![];_0x40dc9c['uuid']=_0x3cbe68;_0x40dc9c['machineUuid']=hardware[_0x6c37('0x8')]();if(_0xf340){var _0x34664b=encryptor['decryptString'](_0xf340);_0x40dc9c['gray']=_0x34664b;_0x40dc9c[_0x6c37('0x18')]=moment(_0x34664b)['add'](0x7,'days')[_0x6c37('0x15')]();_0x40dc9c[_0x6c37('0x19')]=_0x40dc9c[_0x6c37('0xf')]!=_0x40dc9c['machineUuid']?_0x6c37('0x1a'):_0x6c37('0x1b');}return _0x40dc9c;}catch(_0xe47a4c){breakingLicense[_0x6c37('0xf')]=_0x5b6955['data1'];breakingLicense[_0x6c37('0x1c')]=_0xe47a4c[_0x6c37('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x318d47,_0x3e40ca){getLicense()[_0x6c37('0xd')](function(_0xfcf59b){return db[_0x6c37('0x1d')][_0x6c37('0x1e')]({'attributes':['role',[db[_0x6c37('0x1f')]['fn']('COUNT',db['sequelize']['col'](_0x6c37('0x20'))),_0x6c37('0x21')]],'group':_0x6c37('0x20'),'where':{'role':{'$or':[_0x6c37('0x22'),_0x6c37('0x23'),'telephone']}},'raw':!![]})[_0x6c37('0xd')](function(_0x3e1643){var _0xff2e78={'user':_0xfcf59b[_0x6c37('0x24')]||0x0,'telephone':_0xfcf59b[_0x6c37('0x25')]||0x0};_0x3e1643[_0x6c37('0x26')](function(_0x1a9ea8){var _0x17ee99=_0x1a9ea8[_0x6c37('0x20')]===_0x6c37('0x22')?_0x6c37('0x23'):_0x1a9ea8[_0x6c37('0x20')];_0xff2e78[_0x17ee99]-=_0x1a9ea8[_0x6c37('0x21')];if(_0xff2e78[_0x17ee99]<0x0)_0xff2e78[_0x17ee99]=0x0;});_0x318d47(_0xff2e78);return;});})[_0x6c37('0xe')](function(_0x5df8d1){_0x3e40ca(_0x5df8d1);});});}function checkUserLimits(_0x5b068f){return new BPromise(function(_0x3d8d93,_0x321e9d){getLimits()[_0x6c37('0xd')](function(_0x16f465){var _0x26a69f=_['pick'](_['countBy'](_0x5b068f,_0x6c37('0x20')),[_0x6c37('0x22'),_0x6c37('0x23'),_0x6c37('0x27')]);var _0x4f2162=(_0x26a69f[_0x6c37('0x22')]||0x0)+(_0x26a69f[_0x6c37('0x23')]||0x0);var _0x591b43=_0x26a69f[_0x6c37('0x27')]||0x0;if(_0x4f2162>_0x16f465[_0x6c37('0x23')])return _0x321e9d(_0x6c37('0x28'));if(_0x591b43>_0x16f465['telephone'])return _0x321e9d('License\x20limit\x20reached\x20for\x20telephones');return _0x3d8d93();})['catch'](function(_0x161ab6){_0x321e9d(_0x161ab6);});});}module['exports']={'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 daf9537..595236d 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 _0xc2c7=['http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x3736f7,_0x37673f){var _0x1ca8ca=function(_0x9b575c){while(--_0x9b575c){_0x3736f7['push'](_0x3736f7['shift']());}};_0x1ca8ca(++_0x37673f);}(_0xc2c7,0x134));var _0x7c2c=function(_0x4e8df0,_0x4fb214){_0x4e8df0=_0x4e8df0-0x0;var _0x361ec0=_0xc2c7[_0x4e8df0];return _0x361ec0;};'use strict';module['exports']={'DOMAIN':_0x7c2c('0x0'),'SESSION_SECRET':_0x7c2c('0x1'),'GOOGLE_ID':_0x7c2c('0x2'),'GOOGLE_SECRET':_0x7c2c('0x3'),'DEBUG':''}; \ No newline at end of file +var _0xfb11=['exports','myappanuglar-secret','app-id'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xfb11[_0x5608a3];return _0x1ed50a;};'use strict';module[_0x1fb1('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x1fb1('0x1'),'GOOGLE_ID':_0x1fb1('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 4ac1cdf..928749c 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc472=['toUpperCase','exports','Logger','File','%s-%s','error','transports','info','Console','env','debugLevel','moment','winston','util','path','INFO','join','/var','log','format','%s-%s.log','message','replace','level'];(function(_0x5930b0,_0x7226bf){var _0x332a3c=function(_0x1897a5){while(--_0x1897a5){_0x5930b0['push'](_0x5930b0['shift']());}};_0x332a3c(++_0x7226bf);}(_0xc472,0x173));var _0x2c47=function(_0x37ae26,_0x2ecd70){_0x37ae26=_0x37ae26-0x0;var _0x1b1902=_0xc472[_0x37ae26];return _0x1b1902;};'use strict';var moment=require(_0x2c47('0x0'));var winston=require(_0x2c47('0x1'));var util=require(_0x2c47('0x2'));var path=require(_0x2c47('0x3'));var debugLevel=_0x2c47('0x4');function filename(_0x1d49ab,_0x50aa47){return path[_0x2c47('0x5')](_0x2c47('0x6'),_0x2c47('0x7'),'xcally',util[_0x2c47('0x8')](_0x2c47('0x9'),_0x1d49ab,_0x50aa47));}function formatter(_0x502b48,_0x554750){_0x554750[_0x2c47('0xa')]=_0x554750['message'][_0x2c47('0xb')](/@@{/g,'{{{')[_0x2c47('0xb')](/}@@/g,'}}}')['replace'](/@{/g,'{{')[_0x2c47('0xb')](/}@/g,'}}');return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x554750[_0x2c47('0xc')][_0x2c47('0xd')](),_0x502b48,_0x554750[_0x2c47('0xa')]);}module[_0x2c47('0xe')]=function(_0x4e2bb5){return new winston[(_0x2c47('0xf'))]({'transports':[new winston['transports'][(_0x2c47('0x10'))]({'name':util[_0x2c47('0x8')](_0x2c47('0x11'),_0x4e2bb5,_0x2c47('0x12')),'filename':filename(_0x4e2bb5,_0x2c47('0x12')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x8a318f){return formatter(_0x4e2bb5,_0x8a318f);}}),new winston[(_0x2c47('0x13'))][(_0x2c47('0x10'))]({'name':util[_0x2c47('0x8')](_0x2c47('0x11'),_0x4e2bb5,_0x2c47('0x14')),'filename':filename(_0x4e2bb5,_0x2c47('0x14')),'level':_0x2c47('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x55706e){return formatter(_0x4e2bb5,_0x55706e);}}),new winston['transports'][(_0x2c47('0x15'))]({'level':process[_0x2c47('0x16')][_0x2c47('0x17')]||debugLevel,'json':![],'formatter':function(_0x498730){return formatter(_0x4e2bb5,_0x498730);}})]});}; \ No newline at end of file +var _0x323c=['message','replace','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','Logger','File','%s-%s','error','info','moment','winston','path','INFO','join','log','xcally','%s-%s.log'];(function(_0x3d2e4b,_0x1f6653){var _0x509e78=function(_0x307037){while(--_0x307037){_0x3d2e4b['push'](_0x3d2e4b['shift']());}};_0x509e78(++_0x1f6653);}(_0x323c,0x1de));var _0xc323=function(_0x3d11ed,_0x47a4b8){_0x3d11ed=_0x3d11ed-0x0;var _0xbbd56c=_0x323c[_0x3d11ed];return _0xbbd56c;};'use strict';var moment=require(_0xc323('0x0'));var winston=require(_0xc323('0x1'));var util=require('util');var path=require(_0xc323('0x2'));var debugLevel=_0xc323('0x3');function filename(_0x48bbee,_0x1e1454){return path[_0xc323('0x4')]('/var',_0xc323('0x5'),_0xc323('0x6'),util['format'](_0xc323('0x7'),_0x48bbee,_0x1e1454));}function formatter(_0x1a55a7,_0x2d67f4){_0x2d67f4[_0xc323('0x8')]=_0x2d67f4[_0xc323('0x8')][_0xc323('0x9')](/@@{/g,'{{{')[_0xc323('0x9')](/}@@/g,_0xc323('0xa'))[_0xc323('0x9')](/@{/g,'{{')[_0xc323('0x9')](/}@/g,'}}');return util[_0xc323('0xb')](_0xc323('0xc'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x2d67f4['level']['toUpperCase'](),_0x1a55a7,_0x2d67f4[_0xc323('0x8')]);}module['exports']=function(_0x4df3e4){return new winston[(_0xc323('0xd'))]({'transports':[new winston['transports'][(_0xc323('0xe'))]({'name':util[_0xc323('0xb')](_0xc323('0xf'),_0x4df3e4,'error'),'filename':filename(_0x4df3e4,_0xc323('0x10')),'level':_0xc323('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x21b569){return formatter(_0x4df3e4,_0x21b569);}}),new winston['transports']['File']({'name':util[_0xc323('0xb')](_0xc323('0xf'),_0x4df3e4,'info'),'filename':filename(_0x4df3e4,_0xc323('0x11')),'level':_0xc323('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xb6cb9){return formatter(_0x4df3e4,_0xb6cb9);}}),new winston['transports']['Console']({'level':process['env']['debugLevel']||debugLevel,'json':![],'formatter':function(_0x2f1183){return formatter(_0x4df3e4,_0x2f1183);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 16cf431..d93f1fc 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 _0xc00c=['../../services/agi/index.js','email','../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','path','express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi'];(function(_0x1a4dee,_0x337f87){var _0x160b9e=function(_0x496a96){while(--_0x496a96){_0x1a4dee['push'](_0x1a4dee['shift']());}};_0x160b9e(++_0x337f87);}(_0xc00c,0x95));var _0xcc00=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xc00c[_0x4dc7b9];return _0x3ab114;};'use strict';var path=require(_0xcc00('0x0'));var os=require('os');var config={'apps':[{'name':_0xcc00('0x1'),'script':path[_0xcc00('0x2')](__dirname,_0xcc00('0x3'))},{'name':_0xcc00('0x4'),'script':path[_0xcc00('0x2')](__dirname,_0xcc00('0x5'))},{'name':_0xcc00('0x6'),'script':path[_0xcc00('0x2')](__dirname,_0xcc00('0x7'))},{'name':_0xcc00('0x8'),'script':path[_0xcc00('0x2')](__dirname,_0xcc00('0x9'))},{'name':'routing','script':path[_0xcc00('0x2')](__dirname,_0xcc00('0xa'))},{'name':_0xcc00('0xb'),'script':path['join'](__dirname,_0xcc00('0xc'))}]};module['exports']=config; \ No newline at end of file +var _0x80fb=['ami','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','../../services/xdr/index.js','exports','express','join'];(function(_0x2591a0,_0x22913e){var _0x315f2c=function(_0x3a54ac){while(--_0x3a54ac){_0x2591a0['push'](_0x2591a0['shift']());}};_0x315f2c(++_0x22913e);}(_0x80fb,0x169));var _0xb80f=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x80fb[_0x164eca];return _0x2ce562;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0xb80f('0x0'),'script':path[_0xb80f('0x1')](__dirname,'../../services/express/index.js')},{'name':_0xb80f('0x2'),'script':path[_0xb80f('0x1')](__dirname,'../../services/ami/index.js')},{'name':_0xb80f('0x3'),'script':path[_0xb80f('0x1')](__dirname,_0xb80f('0x4'))},{'name':_0xb80f('0x5'),'script':path['join'](__dirname,_0xb80f('0x6'))},{'name':_0xb80f('0x7'),'script':path['join'](__dirname,_0xb80f('0x8'))},{'name':'xdr','script':path[_0xb80f('0x1')](__dirname,_0xb80f('0x9'))}]};module[_0xb80f('0xa')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 8e0a36d..6c274fc 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 _0x42d4=['connect','connected','start','then','disconnect','stop','restart','list','describe','delete','dump','saved','pm2','bluebird','./config'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x42d4,0x192));var _0x442d=function(_0x8b2fb6,_0x502806){_0x8b2fb6=_0x8b2fb6-0x0;var _0x408679=_0x42d4[_0x8b2fb6];return _0x408679;};'use strict';var pm2=require(_0x442d('0x0'));var BPromise=require(_0x442d('0x1'));var config=require(_0x442d('0x2'));function connect(){return new BPromise(function(_0x8f4436,_0x21882d){return pm2[_0x442d('0x3')](function(_0x59a836){if(_0x59a836){return _0x21882d(_0x59a836);}return _0x8f4436(_0x442d('0x4'));});});};exports[_0x442d('0x5')]=function(_0x111dcb){return connect()[_0x442d('0x6')](function(){return new BPromise(function(_0x4fd13e,_0x18fa0){return pm2[_0x442d('0x5')](_0x111dcb,function(_0x2bd077,_0x41dc49){if(_0x2bd077){return _0x18fa0(_0x2bd077);}pm2[_0x442d('0x7')]();return _0x4fd13e(_0x41dc49);});});});};exports['stop']=function(_0x240566){return connect()[_0x442d('0x6')](function(){return new BPromise(function(_0x4657c5,_0x42781a){return pm2[_0x442d('0x8')](_0x240566,function(_0x38990b,_0x1ee98b){if(_0x38990b){return _0x42781a(_0x38990b);}pm2['disconnect']();return _0x4657c5(_0x1ee98b);});});});};exports['restart']=function(_0xb470e1){return connect()[_0x442d('0x6')](function(){return new BPromise(function(_0x46a417,_0x387194){return pm2[_0x442d('0x9')](_0xb470e1,function(_0x4e5252,_0x2bb036){if(_0x4e5252){return _0x387194(_0x4e5252);}pm2[_0x442d('0x7')]();return _0x46a417(_0x2bb036);});});});};exports[_0x442d('0xa')]=function(){return connect()[_0x442d('0x6')](function(){return new BPromise(function(_0x122e7f,_0x697533){return pm2[_0x442d('0xa')](function(_0x4ae19d,_0x4d3fe5){if(_0x4ae19d){return _0x697533(_0x4ae19d);}pm2[_0x442d('0x7')]();return _0x122e7f(_0x4d3fe5);});});});};exports['describe']=function(_0x4a9c5f){return connect()['then'](function(){return new BPromise(function(_0x267d8c,_0x40ebdd){return pm2[_0x442d('0xb')](_0x4a9c5f,function(_0x3c1334,_0x17c5c4){if(_0x3c1334){return _0x40ebdd(_0x3c1334);}pm2[_0x442d('0x7')]();return _0x267d8c(_0x17c5c4);});});});};exports[_0x442d('0xc')]=function(_0x1c153b){return connect()[_0x442d('0x6')](function(){return new BPromise(function(_0x3c7b73,_0x5a3d4f){return pm2[_0x442d('0xc')](_0x1c153b,function(_0x4eead6,_0x2a5b58){if(_0x4eead6){return _0x5a3d4f(_0x4eead6);}pm2[_0x442d('0x7')]();return _0x3c7b73(_0x2a5b58);});});});};exports[_0x442d('0xd')]=function(){return connect()[_0x442d('0x6')](function(){return new BPromise(function(_0x43cfe1,_0x1aa9f7){return pm2[_0x442d('0xd')](function(_0x11022a){if(_0x11022a){return _0x1aa9f7(_0x11022a);}return _0x43cfe1(_0x442d('0xe'));});});});}; \ No newline at end of file +var _0x1ae3=['then','disconnect','stop','restart','describe','delete','dump','saved','pm2','bluebird','./config','connected','start'];(function(_0x224f65,_0x4750bf){var _0x3f921c=function(_0x1b5f64){while(--_0x1b5f64){_0x224f65['push'](_0x224f65['shift']());}};_0x3f921c(++_0x4750bf);}(_0x1ae3,0x18e));var _0x31ae=function(_0x23b3e1,_0x1e966f){_0x23b3e1=_0x23b3e1-0x0;var _0x148fef=_0x1ae3[_0x23b3e1];return _0x148fef;};'use strict';var pm2=require(_0x31ae('0x0'));var BPromise=require(_0x31ae('0x1'));var config=require(_0x31ae('0x2'));function connect(){return new BPromise(function(_0x5c1194,_0x5d4b02){return pm2['connect'](function(_0x383c72){if(_0x383c72){return _0x5d4b02(_0x383c72);}return _0x5c1194(_0x31ae('0x3'));});});};exports[_0x31ae('0x4')]=function(_0x104589){return connect()[_0x31ae('0x5')](function(){return new BPromise(function(_0x14f9b0,_0x3a989b){return pm2[_0x31ae('0x4')](_0x104589,function(_0x1c3743,_0x533e8f){if(_0x1c3743){return _0x3a989b(_0x1c3743);}pm2[_0x31ae('0x6')]();return _0x14f9b0(_0x533e8f);});});});};exports[_0x31ae('0x7')]=function(_0x4fe483){return connect()[_0x31ae('0x5')](function(){return new BPromise(function(_0x559b4b,_0x2480ec){return pm2[_0x31ae('0x7')](_0x4fe483,function(_0x123ed7,_0x4fb222){if(_0x123ed7){return _0x2480ec(_0x123ed7);}pm2[_0x31ae('0x6')]();return _0x559b4b(_0x4fb222);});});});};exports[_0x31ae('0x8')]=function(_0x1a3dc4){return connect()[_0x31ae('0x5')](function(){return new BPromise(function(_0x3a9eef,_0x391b81){return pm2[_0x31ae('0x8')](_0x1a3dc4,function(_0x36bd54,_0x138bf9){if(_0x36bd54){return _0x391b81(_0x36bd54);}pm2[_0x31ae('0x6')]();return _0x3a9eef(_0x138bf9);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0x502f38,_0x42dbc7){return pm2['list'](function(_0x52f635,_0x1f4d55){if(_0x52f635){return _0x42dbc7(_0x52f635);}pm2['disconnect']();return _0x502f38(_0x1f4d55);});});});};exports['describe']=function(_0x41ab0e){return connect()['then'](function(){return new BPromise(function(_0x479c27,_0x194e5e){return pm2[_0x31ae('0x9')](_0x41ab0e,function(_0x5521ca,_0x1d105c){if(_0x5521ca){return _0x194e5e(_0x5521ca);}pm2['disconnect']();return _0x479c27(_0x1d105c);});});});};exports['delete']=function(_0x272f17){return connect()['then'](function(){return new BPromise(function(_0x5e9f5c,_0x190d5b){return pm2[_0x31ae('0xa')](_0x272f17,function(_0x2316b3,_0x1d8401){if(_0x2316b3){return _0x190d5b(_0x2316b3);}pm2[_0x31ae('0x6')]();return _0x5e9f5c(_0x1d8401);});});});};exports[_0x31ae('0xb')]=function(){return connect()[_0x31ae('0x5')](function(){return new BPromise(function(_0x1ac34c,_0x485b9c){return pm2[_0x31ae('0xb')](function(_0x324665){if(_0x324665){return _0x485b9c(_0x324665);}return _0x1ac34c(_0x31ae('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 8f62c75..9d15987 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 _0xe884=['YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','ioredis','util','../logger','redis','localhost','Setting','find','chatTimeout','then','ChatInteraction','findAll','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format'];(function(_0x15b2b0,_0x4b1aa6){var _0x38974d=function(_0xfe2936){while(--_0xfe2936){_0x15b2b0['push'](_0x15b2b0['shift']());}};_0x38974d(++_0x4b1aa6);}(_0xe884,0x11f));var _0x4e88=function(_0x45c90a,_0x12b70d){_0x45c90a=_0x45c90a-0x0;var _0x3bc48e=_0xe884[_0x45c90a];return _0x3bc48e;};'use strict';var _=require(_0x4e88('0x0'));var moment=require('moment');var Redis=require(_0x4e88('0x1'));var util=require(_0x4e88('0x2'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0x4e88('0x3'))('schedule');config[_0x4e88('0x4')]=_['defaults'](config[_0x4e88('0x4')],{'host':_0x4e88('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4e88('0x4')]));function closeInteractions(){var _0x259da7=0x0;var _0x53eff7=[];return db[_0x4e88('0x6')][_0x4e88('0x7')]({'raw':!![],'attributes':['id',_0x4e88('0x8')],'where':{'id':0x1}})[_0x4e88('0x9')](function(_0x41d7e8){_0x259da7=_0x41d7e8['chatTimeout'];if(_0x259da7){return db[_0x4e88('0xa')][_0x4e88('0xb')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x4e88('0xc')](_0x41d7e8[_0x4e88('0x8')],_0x4e88('0xd'))}}});}else{return[];}})[_0x4e88('0x9')](function(_0x4283b4){if(_0x4283b4&&_0x4283b4[_0x4e88('0xe')]){_0x53eff7=_[_0x4e88('0xf')](_0x4283b4||[],'id');logger[_0x4e88('0x10')](_0x4e88('0x11'),_0x53eff7[_0x4e88('0x12')]());return db[_0x4e88('0xa')][_0x4e88('0x13')]({'closeReason':_0x4e88('0x14'),'disposition':_0x4e88('0x15'),'closed':!![],'closedAt':moment()[_0x4e88('0x16')](_0x4e88('0x17'))},{'where':{'id':_0x53eff7}});}})[_0x4e88('0x9')](function(){if(_0x53eff7&&_0x53eff7['length']){logger[_0x4e88('0x10')](_0x4e88('0x18'),_0x53eff7[_0x4e88('0x12')]());for(var _0x243137=0x0;_0x243137<_0x53eff7['length'];_0x243137++){io[_0x4e88('0x19')](_0x4e88('0x1a'),{'id':_0x53eff7[_0x243137],'closed':!![]});}}})[_0x4e88('0x1b')](function(_0x235758){logger[_0x4e88('0x1c')](_0x4e88('0x1d'),_0x235758?util['inspect'](_0x235758,{'showHidden':![],'depth':null}):'');});}exports[_0x4e88('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xbb99=['../logger','schedule','redis','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','length','map','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','start','lodash','moment','ioredis','util'];(function(_0x1e2080,_0x53283b){var _0x260111=function(_0x15da5e){while(--_0x15da5e){_0x1e2080['push'](_0x1e2080['shift']());}};_0x260111(++_0x53283b);}(_0xbb99,0x128));var _0x9bb9=function(_0x4e5552,_0x19ec4e){_0x4e5552=_0x4e5552-0x0;var _0x60a338=_0xbb99[_0x4e5552];return _0x60a338;};'use strict';var _=require(_0x9bb9('0x0'));var moment=require(_0x9bb9('0x1'));var Redis=require(_0x9bb9('0x2'));var util=require(_0x9bb9('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0x9bb9('0x4'))(_0x9bb9('0x5'));config[_0x9bb9('0x6')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9bb9('0x6')]));function closeInteractions(){var _0x4a1855=0x0;var _0x1d47aa=[];return db[_0x9bb9('0x7')][_0x9bb9('0x8')]({'raw':!![],'attributes':['id',_0x9bb9('0x9')],'where':{'id':0x1}})[_0x9bb9('0xa')](function(_0x43ab14){_0x4a1855=_0x43ab14[_0x9bb9('0x9')];if(_0x4a1855){return db[_0x9bb9('0xb')][_0x9bb9('0xc')]({'raw':!![],'attributes':['id',_0x9bb9('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x9bb9('0xe')](_0x43ab14['chatTimeout'],_0x9bb9('0xf'))}}});}else{return[];}})[_0x9bb9('0xa')](function(_0x4e989c){if(_0x4e989c&&_0x4e989c[_0x9bb9('0x10')]){_0x1d47aa=_[_0x9bb9('0x11')](_0x4e989c||[],'id');logger['info'](_0x9bb9('0x12'),_0x1d47aa[_0x9bb9('0x13')]());return db[_0x9bb9('0xb')][_0x9bb9('0x14')]({'closeReason':_0x9bb9('0x15'),'disposition':_0x9bb9('0x16'),'closed':!![],'closedAt':moment()['format'](_0x9bb9('0x17'))},{'where':{'id':_0x1d47aa}});}})['then'](function(){if(_0x1d47aa&&_0x1d47aa[_0x9bb9('0x10')]){logger['info'](_0x9bb9('0x18'),_0x1d47aa[_0x9bb9('0x13')]());for(var _0x36b4c8=0x0;_0x36b4c8<_0x1d47aa[_0x9bb9('0x10')];_0x36b4c8++){io[_0x9bb9('0x19')](_0x9bb9('0x1a'),{'id':_0x1d47aa[_0x36b4c8],'closed':!![]});}}})[_0x9bb9('0x1b')](function(_0x41e53e){logger[_0x9bb9('0x1c')]('[CHAT]\x20Error\x20closing\x20interactions',_0x41e53e?util['inspect'](_0x41e53e,{'showHidden':![],'depth':null}):'');});}exports[_0x9bb9('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 529229e..869a6e9 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 _0x9447=['MailAccount','host','port','authentication','auth','pass','format','\x22%s\x22\x20<%s>','user','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','savename','%s.%s','basename','extname','zip','join','existsSync','Sent','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','status','message','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','error\x20mail','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','subtractUnit','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','runReport','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map','toString','intersection','length','exists','stop','deleteJob','toRun','index','resolve','run\x20job','cron','active','isBetween','startAt','add','stop\x20cron','endAt','update\x20cron','start','util','path','lodash','cron-job-manager','jayson/promise','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','email','Smtp','service'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0x9447,0x1a4));var _0x7944=function(_0x11448d,_0x46363c){_0x11448d=_0x11448d-0x0;var _0x2c0d7a=_0x9447[_0x11448d];return _0x2c0d7a;};'use strict';var fs=require('fs');var util=require(_0x7944('0x0'));var path=require(_0x7944('0x1'));var _=require(_0x7944('0x2'));var moment=require('moment');var CronJobManager=require(_0x7944('0x3'));var jayson=require(_0x7944('0x4'));var BPromise=require(_0x7944('0x5'));var logger=require(_0x7944('0x6'))('schedule');var db=require(_0x7944('0x7'))['db'];var analyticCustomReportController=require(_0x7944('0x8'));var analyticDefaultReportController=require(_0x7944('0x9'));var client=jayson[_0x7944('0xa')][_0x7944('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x583a45,_0x3ecf08){return function(){logger['info']('Try\x20to\x20send\x20a\x20mail\x20to',_0x583a45[_0x7944('0xc')]);var _0x1f7052=!![];var _0x5129c8={'tls':{'rejectUnauthorized':![]}};if(_0x583a45['MailAccount'][_0x7944('0xd')][_0x7944('0xe')]){_0x5129c8[_0x7944('0xe')]=_0x583a45[_0x7944('0xf')]['Smtp'][_0x7944('0xe')];}else{_0x5129c8[_0x7944('0x10')]=_0x583a45[_0x7944('0xf')][_0x7944('0xd')][_0x7944('0x10')];_0x5129c8[_0x7944('0x11')]=_0x583a45[_0x7944('0xf')][_0x7944('0xd')][_0x7944('0x11')];_0x5129c8['secure']=_0x583a45[_0x7944('0xf')][_0x7944('0xd')]['secure'];}if(_0x583a45[_0x7944('0xf')][_0x7944('0xd')][_0x7944('0x12')]){_0x5129c8[_0x7944('0x13')]={'user':_0x583a45[_0x7944('0xf')]['Smtp']['user'],'pass':_0x583a45['MailAccount'][_0x7944('0xd')][_0x7944('0x14')]};}var _0x56ac22={'account':_0x5129c8,'message':{'from':util[_0x7944('0x15')](_0x7944('0x16'),_0x583a45[_0x7944('0xf')]['name'],_0x583a45['MailAccount'][_0x7944('0xc')]||_0x583a45['MailAccount']['Smtp'][_0x7944('0x17')]),'to':_0x583a45[_0x7944('0xc')],'cc':_0x583a45['cc'],'bcc':_0x583a45[_0x7944('0x18')],'subject':util[_0x7944('0x15')](_0x7944('0x19'),_0x3ecf08[_0x7944('0x1a')],_0x583a45[_0x7944('0x1b')],_0x583a45['subtractUnit'])}};var _0x26fe38=path['join'](__dirname,'../../files/reports');var _0x3eb0ab=_0x3ecf08[_0x7944('0x1c')];var _0x313715=util['format'](_0x7944('0x1d'),path[_0x7944('0x1e')](_0x3ecf08[_0x7944('0x1c')],path[_0x7944('0x1f')](_0x3ecf08[_0x7944('0x1c')])),_0x7944('0x20'));var _0x217f6e=path[_0x7944('0x21')](_0x26fe38,_0x3eb0ab);var _0x6382ee=path[_0x7944('0x21')](_0x26fe38,_0x313715);if(fs[_0x7944('0x22')](_0x217f6e)){_0x3ecf08['status']=_0x7944('0x23');_0x56ac22['message'][_0x7944('0x24')]=[{'filename':_0x3eb0ab,'path':_0x217f6e}];_0x56ac22['message'][_0x7944('0x25')]=util[_0x7944('0x15')](_0x7944('0x26'),JSON[_0x7944('0x27')](_0x3ecf08,null,0x2));}else if(fs[_0x7944('0x22')](_0x6382ee)){_0x3ecf08[_0x7944('0x28')]='Sent';_0x56ac22['message'][_0x7944('0x24')]=[{'filename':_0x313715,'path':_0x6382ee}];}else{_0x56ac22[_0x7944('0x29')][_0x7944('0x25')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x583a45[_0x7944('0x2a')]){_0x1f7052=![];logger[_0x7944('0x2b')](_0x7944('0x2c'));}}if(_0x1f7052){return client['request'](_0x7944('0x2d'),_0x56ac22)[_0x7944('0x2e')](function(_0x3f61a3){if(_0x3f61a3[_0x7944('0x2f')]){return logger[_0x7944('0x2f')](_0x7944('0x30'),JSON[_0x7944('0x27')](_0x3f61a3));}return logger[_0x7944('0x2b')]('email\x20sent');})[_0x7944('0x31')](function(_0x3c587c){return logger['error']('error\x20mail',JSON[_0x7944('0x27')](_0x3c587c));});}};}function handleError(){return function(_0x4b485a){return logger['error'](JSON[_0x7944('0x27')](_0x4b485a));};}function handleResult(_0x371e2f){return function(_0x49a949){logger[_0x7944('0x2b')](_0x7944('0x32'),JSON[_0x7944('0x27')](_0x49a949));if(_0x371e2f[_0x7944('0xf')]&&_0x371e2f[_0x7944('0xf')][_0x7944('0xd')]&&!_[_0x7944('0x33')](_0x371e2f[_0x7944('0xc')])){setTimeout(handleSendEmail(_0x371e2f,_0x49a949),0x3c*0x3e8);}};}function handleJob(_0x583559){return function(){try{if(_[_0x7944('0x33')](_0x583559['subtractNumber'])){return logger['info'](_0x7944('0x34'));}if(_[_0x7944('0x33')](_0x583559['subtractUnit'])){return logger[_0x7944('0x2b')]('subtractUnit\x20null\x20or\x20undefined');}var _0x444837={'startDate':moment()[_0x7944('0x35')](_0x583559[_0x7944('0x1b')],_0x583559[_0x7944('0x36')])[_0x7944('0x15')](_0x7944('0x37')),'endDate':moment()[_0x7944('0x15')](_0x7944('0x37')),'type':_0x7944('0x38'),'output':_0x583559['output'],'name':_0x583559[_0x7944('0x1a')]};if(!_[_0x7944('0x33')](_0x583559[_0x7944('0x39')])){logger[_0x7944('0x2b')](_0x7944('0x3a'),_0x583559[_0x7944('0x39')]);return analyticDefaultReportController['runReport']({'id':_0x583559[_0x7944('0x39')]},_0x444837)[_0x7944('0x2e')](handleResult(_0x583559))[_0x7944('0x31')](handleError());}if(!_[_0x7944('0x33')](_0x583559[_0x7944('0x3b')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x583559[_0x7944('0x3b')]);return analyticCustomReportController[_0x7944('0x3c')]({'id':_0x583559[_0x7944('0x3b')]},_0x444837)[_0x7944('0x2e')](handleResult(_0x583559))[_0x7944('0x31')](handleError());}}catch(_0x4c6943){logger[_0x7944('0x2f')](JSON[_0x7944('0x27')](_0x4c6943));}return logger[_0x7944('0x2b')](_0x7944('0x3d'));};}function getJobs(_0x55133a){var _0x12af0d={};if(_0x55133a){_0x12af0d['id']=_0x55133a;}return db[_0x7944('0x3e')][_0x7944('0x3f')]({'where':_0x12af0d,'include':[{'model':db[_0x7944('0xf')],'attributes':['id','name',_0x7944('0xc')],'include':[{'model':db[_0x7944('0x40')],'as':_0x7944('0xd')}]}]})[_0x7944('0x2e')](function(_0x5f3949){var _0x5a08b0=_[_0x7944('0x41')](manager[_0x7944('0x42')]);var _0xfe6db7=_[_0x7944('0x43')](_0x5f3949,function(_0xd93da){return _0xd93da['id']['toString']();});var _0x2bf122=_['keyBy'](_0x5f3949,function(_0x466efc){return _0x466efc['id'][_0x7944('0x44')]();});var _0x43535a=_0x55133a?_0xfe6db7:_['difference'](_0xfe6db7,_0x5a08b0);var _0xdec0c=_[_0x7944('0x45')](_0xfe6db7,_0x5a08b0);var _0x27a2e3=_['difference'](_0x5a08b0,_0xfe6db7);var _0x437788;var _0xd8ee5c;for(_0x437788=0x0;_0x437788<_0x27a2e3[_0x7944('0x46')]&&!_0x55133a;_0x437788+=0x1){_0xd8ee5c=_0x27a2e3[_0x437788][_0x7944('0x44')]();if(manager[_0x7944('0x47')](_0xd8ee5c)){manager[_0x7944('0x48')](_0xd8ee5c);manager[_0x7944('0x49')](_0xd8ee5c);logger[_0x7944('0x2b')]('delete\x20cron',_0xd8ee5c);}}logger[_0x7944('0x2b')](_0x7944('0x4a'),JSON[_0x7944('0x27')](_0x43535a));for(_0x437788=0x0;_0x437788<_0x43535a[_0x7944('0x46')];_0x437788+=0x1){_0xd8ee5c=_0x43535a[_0x437788][_0x7944('0x44')]();logger[_0x7944('0x2b')](_0x7944('0x4b'),_0xd8ee5c);if(_0x55133a){logger[_0x7944('0x2b')]('my\x20id',_0x55133a);logger[_0x7944('0x2b')](JSON[_0x7944('0x27')](_0x2bf122[_0xd8ee5c]));BPromise[_0x7944('0x4c')]()[_0x7944('0x2e')](handleJob(_0x2bf122[_0xd8ee5c]));logger['info'](_0x7944('0x4d'),_0x2bf122[_0xd8ee5c][_0x7944('0x1a')],_0x2bf122[_0xd8ee5c]['cron']);}else if(_0x2bf122[_0xd8ee5c][_0x7944('0x4e')]&&_0x2bf122[_0xd8ee5c][_0x7944('0x4f')]&&moment()[_0x7944('0x50')](_0x2bf122[_0xd8ee5c][_0x7944('0x51')],_0x2bf122[_0xd8ee5c]['endAt'])){manager[_0x7944('0x52')](_0xd8ee5c,_0x2bf122[_0xd8ee5c][_0x7944('0x4e')],handleJob(_0x2bf122[_0xd8ee5c]));manager['start'](_0xd8ee5c);logger[_0x7944('0x2b')]('add\x20cron',_0x2bf122[_0xd8ee5c]['name'],_0x2bf122[_0xd8ee5c][_0x7944('0x4e')]);}else if(manager[_0x7944('0x47')](_0xd8ee5c)){manager['stop'](_0xd8ee5c);manager[_0x7944('0x49')](_0xd8ee5c);logger['info'](_0x7944('0x53'),_0x2bf122[_0xd8ee5c][_0x7944('0x1a')],_0x2bf122[_0xd8ee5c][_0x7944('0x4e')]);}}for(_0x437788=0x0,_0xd8ee5c;_0x437788<_0xdec0c[_0x7944('0x46')]&&!_0x55133a;_0x437788+=0x1){_0xd8ee5c=_0xdec0c[_0x437788]['toString']();if(manager[_0x7944('0x47')](_0xd8ee5c)){if(_0x2bf122[_0xd8ee5c]['cron']&&_0x2bf122[_0xd8ee5c][_0x7944('0x4f')]&&moment()['isBetween'](_0x2bf122[_0xd8ee5c][_0x7944('0x51')],_0x2bf122[_0xd8ee5c][_0x7944('0x54')])){manager['update'](_0xd8ee5c,_0x2bf122[_0xd8ee5c][_0x7944('0x4e')],handleJob(_0x2bf122[_0xd8ee5c]));logger['info'](_0x7944('0x55'),_0x2bf122[_0xd8ee5c][_0x7944('0x1a')],_0x2bf122[_0xd8ee5c][_0x7944('0x4e')]);}else{manager[_0x7944('0x48')](_0xd8ee5c);manager[_0x7944('0x49')](_0xd8ee5c);logger[_0x7944('0x2b')](_0x7944('0x53'),_0x2bf122[_0xd8ee5c][_0x7944('0x1a')],_0x2bf122[_0xd8ee5c][_0x7944('0x4e')]);}}}})[_0x7944('0x31')](function(_0x3377a0){logger['error'](JSON[_0x7944('0x27')](_0x3377a0));});}exports['run']=function(_0x47c3bd){return getJobs(_0x47c3bd);};exports[_0x7944('0x56')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xb163=['../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','info','MailAccount','Smtp','service','host','port','secure','authentication','user','pass','format','name','email','bcc','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','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','existsSync','Sent','attachments','sendIfEmpty','request','SendMail','error','error\x20mail','email\x20sent','catch','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','subtractNumber','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','then','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','stop\x20cron','update','update\x20cron','run','util','path','lodash','moment','jayson/promise','bluebird','../logger','schedule'];(function(_0x1496a9,_0x39186c){var _0x329342=function(_0x1329d6){while(--_0x1329d6){_0x1496a9['push'](_0x1496a9['shift']());}};_0x329342(++_0x39186c);}(_0xb163,0x1b5));var _0x3b16=function(_0x46f6a4,_0xc4e42b){_0x46f6a4=_0x46f6a4-0x0;var _0x3e64c6=_0xb163[_0x46f6a4];return _0x3e64c6;};'use strict';var fs=require('fs');var util=require(_0x3b16('0x0'));var path=require(_0x3b16('0x1'));var _=require(_0x3b16('0x2'));var moment=require(_0x3b16('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x3b16('0x4'));var BPromise=require(_0x3b16('0x5'));var logger=require(_0x3b16('0x6'))(_0x3b16('0x7'));var db=require(_0x3b16('0x8'))['db'];var analyticCustomReportController=require(_0x3b16('0x9'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x3b16('0xa')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x17b507,_0x48a85a){return function(){logger[_0x3b16('0xb')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x17b507['email']);var _0x38f8ba=!![];var _0x2a7e97={'tls':{'rejectUnauthorized':![]}};if(_0x17b507[_0x3b16('0xc')][_0x3b16('0xd')]['service']){_0x2a7e97[_0x3b16('0xe')]=_0x17b507[_0x3b16('0xc')][_0x3b16('0xd')][_0x3b16('0xe')];}else{_0x2a7e97['host']=_0x17b507[_0x3b16('0xc')]['Smtp'][_0x3b16('0xf')];_0x2a7e97[_0x3b16('0x10')]=_0x17b507[_0x3b16('0xc')]['Smtp'][_0x3b16('0x10')];_0x2a7e97[_0x3b16('0x11')]=_0x17b507['MailAccount'][_0x3b16('0xd')][_0x3b16('0x11')];}if(_0x17b507['MailAccount'][_0x3b16('0xd')][_0x3b16('0x12')]){_0x2a7e97['auth']={'user':_0x17b507['MailAccount'][_0x3b16('0xd')][_0x3b16('0x13')],'pass':_0x17b507[_0x3b16('0xc')][_0x3b16('0xd')][_0x3b16('0x14')]};}var _0x457bd6={'account':_0x2a7e97,'message':{'from':util[_0x3b16('0x15')]('\x22%s\x22\x20<%s>',_0x17b507[_0x3b16('0xc')][_0x3b16('0x16')],_0x17b507[_0x3b16('0xc')][_0x3b16('0x17')]||_0x17b507[_0x3b16('0xc')]['Smtp'][_0x3b16('0x13')]),'to':_0x17b507[_0x3b16('0x17')],'cc':_0x17b507['cc'],'bcc':_0x17b507[_0x3b16('0x18')],'subject':util['format']('Report\x20%s\x20last\x20%s\x20%s',_0x48a85a[_0x3b16('0x16')],_0x17b507['subtractNumber'],_0x17b507[_0x3b16('0x19')])}};var _0x4d8c19=path[_0x3b16('0x1a')](__dirname,_0x3b16('0x1b'));var _0x54dab0=_0x48a85a[_0x3b16('0x1c')];var _0xfb6d87=util['format'](_0x3b16('0x1d'),path[_0x3b16('0x1e')](_0x48a85a[_0x3b16('0x1c')],path[_0x3b16('0x1f')](_0x48a85a[_0x3b16('0x1c')])),_0x3b16('0x20'));var _0x255076=path['join'](_0x4d8c19,_0x54dab0);var _0x5c7ca1=path[_0x3b16('0x1a')](_0x4d8c19,_0xfb6d87);if(fs['existsSync'](_0x255076)){_0x48a85a[_0x3b16('0x21')]='Sent';_0x457bd6[_0x3b16('0x22')]['attachments']=[{'filename':_0x54dab0,'path':_0x255076}];_0x457bd6['message'][_0x3b16('0x23')]=util[_0x3b16('0x15')](_0x3b16('0x24'),JSON[_0x3b16('0x25')](_0x48a85a,null,0x2));}else if(fs[_0x3b16('0x26')](_0x5c7ca1)){_0x48a85a['status']=_0x3b16('0x27');_0x457bd6[_0x3b16('0x22')][_0x3b16('0x28')]=[{'filename':_0xfb6d87,'path':_0x5c7ca1}];}else{_0x457bd6['message'][_0x3b16('0x23')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x17b507[_0x3b16('0x29')]){_0x38f8ba=![];logger[_0x3b16('0xb')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x38f8ba){return client[_0x3b16('0x2a')](_0x3b16('0x2b'),_0x457bd6)['then'](function(_0x4794ea){if(_0x4794ea[_0x3b16('0x2c')]){return logger[_0x3b16('0x2c')](_0x3b16('0x2d'),JSON[_0x3b16('0x25')](_0x4794ea));}return logger[_0x3b16('0xb')](_0x3b16('0x2e'));})[_0x3b16('0x2f')](function(_0x1aab60){return logger[_0x3b16('0x2c')](_0x3b16('0x2d'),JSON[_0x3b16('0x25')](_0x1aab60));});}};}function handleError(){return function(_0x351637){return logger[_0x3b16('0x2c')](JSON[_0x3b16('0x25')](_0x351637));};}function handleResult(_0x34f375){return function(_0xc68dd9){logger[_0x3b16('0xb')](_0x3b16('0x30'),JSON[_0x3b16('0x25')](_0xc68dd9));if(_0x34f375[_0x3b16('0xc')]&&_0x34f375['MailAccount'][_0x3b16('0xd')]&&!_[_0x3b16('0x31')](_0x34f375[_0x3b16('0x17')])){setTimeout(handleSendEmail(_0x34f375,_0xc68dd9),0x3c*0x3e8);}};}function handleJob(_0x5182b5){return function(){try{if(_[_0x3b16('0x31')](_0x5182b5['subtractNumber'])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x3b16('0x31')](_0x5182b5['subtractUnit'])){return logger[_0x3b16('0xb')](_0x3b16('0x32'));}var _0x493368={'startDate':moment()[_0x3b16('0x33')](_0x5182b5[_0x3b16('0x34')],_0x5182b5[_0x3b16('0x19')])[_0x3b16('0x15')](_0x3b16('0x35')),'endDate':moment()[_0x3b16('0x15')](_0x3b16('0x35')),'type':_0x3b16('0x36'),'output':_0x5182b5[_0x3b16('0x37')],'name':_0x5182b5[_0x3b16('0x16')]};if(!_[_0x3b16('0x31')](_0x5182b5[_0x3b16('0x38')])){logger[_0x3b16('0xb')]('exec\x20defaul\x20report\x20id:%s',_0x5182b5[_0x3b16('0x38')]);return analyticDefaultReportController['runReport']({'id':_0x5182b5[_0x3b16('0x38')]},_0x493368)[_0x3b16('0x39')](handleResult(_0x5182b5))[_0x3b16('0x2f')](handleError());}if(!_[_0x3b16('0x31')](_0x5182b5['CustomReportId'])){logger[_0x3b16('0xb')](_0x3b16('0x3a'),_0x5182b5[_0x3b16('0x3b')]);return analyticCustomReportController['runReport']({'id':_0x5182b5['CustomReportId']},_0x493368)[_0x3b16('0x39')](handleResult(_0x5182b5))[_0x3b16('0x2f')](handleError());}}catch(_0x36a470){logger[_0x3b16('0x2c')](JSON[_0x3b16('0x25')](_0x36a470));}return logger[_0x3b16('0xb')](_0x3b16('0x3c'));};}function getJobs(_0x5b1c47){var _0x4a0cc6={};if(_0x5b1c47){_0x4a0cc6['id']=_0x5b1c47;}return db[_0x3b16('0x3d')][_0x3b16('0x3e')]({'where':_0x4a0cc6,'include':[{'model':db['MailAccount'],'attributes':['id','name',_0x3b16('0x17')],'include':[{'model':db[_0x3b16('0x3f')],'as':_0x3b16('0xd')}]}]})['then'](function(_0x23879d){var _0x8d86b3=_['keys'](manager[_0x3b16('0x40')]);var _0x3b0b7c=_[_0x3b16('0x41')](_0x23879d,function(_0x12b97b){return _0x12b97b['id'][_0x3b16('0x42')]();});var _0x1dbfe7=_[_0x3b16('0x43')](_0x23879d,function(_0x1be8df){return _0x1be8df['id'][_0x3b16('0x42')]();});var _0x3b6576=_0x5b1c47?_0x3b0b7c:_[_0x3b16('0x44')](_0x3b0b7c,_0x8d86b3);var _0x14b20b=_[_0x3b16('0x45')](_0x3b0b7c,_0x8d86b3);var _0x1a249e=_[_0x3b16('0x44')](_0x8d86b3,_0x3b0b7c);var _0x532701;var _0x41fc6e;for(_0x532701=0x0;_0x532701<_0x1a249e[_0x3b16('0x46')]&&!_0x5b1c47;_0x532701+=0x1){_0x41fc6e=_0x1a249e[_0x532701][_0x3b16('0x42')]();if(manager[_0x3b16('0x47')](_0x41fc6e)){manager[_0x3b16('0x48')](_0x41fc6e);manager[_0x3b16('0x49')](_0x41fc6e);logger[_0x3b16('0xb')](_0x3b16('0x4a'),_0x41fc6e);}}logger[_0x3b16('0xb')]('toRun',JSON[_0x3b16('0x25')](_0x3b6576));for(_0x532701=0x0;_0x532701<_0x3b6576[_0x3b16('0x46')];_0x532701+=0x1){_0x41fc6e=_0x3b6576[_0x532701][_0x3b16('0x42')]();logger[_0x3b16('0xb')]('index',_0x41fc6e);if(_0x5b1c47){logger[_0x3b16('0xb')](_0x3b16('0x4b'),_0x5b1c47);logger['info'](JSON[_0x3b16('0x25')](_0x1dbfe7[_0x41fc6e]));BPromise[_0x3b16('0x4c')]()['then'](handleJob(_0x1dbfe7[_0x41fc6e]));logger['info'](_0x3b16('0x4d'),_0x1dbfe7[_0x41fc6e][_0x3b16('0x16')],_0x1dbfe7[_0x41fc6e][_0x3b16('0x4e')]);}else if(_0x1dbfe7[_0x41fc6e]['cron']&&_0x1dbfe7[_0x41fc6e][_0x3b16('0x4f')]&&moment()[_0x3b16('0x50')](_0x1dbfe7[_0x41fc6e][_0x3b16('0x51')],_0x1dbfe7[_0x41fc6e][_0x3b16('0x52')])){manager[_0x3b16('0x53')](_0x41fc6e,_0x1dbfe7[_0x41fc6e]['cron'],handleJob(_0x1dbfe7[_0x41fc6e]));manager[_0x3b16('0x54')](_0x41fc6e);logger[_0x3b16('0xb')]('add\x20cron',_0x1dbfe7[_0x41fc6e][_0x3b16('0x16')],_0x1dbfe7[_0x41fc6e][_0x3b16('0x4e')]);}else if(manager['exists'](_0x41fc6e)){manager[_0x3b16('0x48')](_0x41fc6e);manager[_0x3b16('0x49')](_0x41fc6e);logger[_0x3b16('0xb')](_0x3b16('0x55'),_0x1dbfe7[_0x41fc6e]['name'],_0x1dbfe7[_0x41fc6e][_0x3b16('0x4e')]);}}for(_0x532701=0x0,_0x41fc6e;_0x532701<_0x14b20b['length']&&!_0x5b1c47;_0x532701+=0x1){_0x41fc6e=_0x14b20b[_0x532701][_0x3b16('0x42')]();if(manager[_0x3b16('0x47')](_0x41fc6e)){if(_0x1dbfe7[_0x41fc6e]['cron']&&_0x1dbfe7[_0x41fc6e][_0x3b16('0x4f')]&&moment()['isBetween'](_0x1dbfe7[_0x41fc6e][_0x3b16('0x51')],_0x1dbfe7[_0x41fc6e][_0x3b16('0x52')])){manager[_0x3b16('0x56')](_0x41fc6e,_0x1dbfe7[_0x41fc6e][_0x3b16('0x4e')],handleJob(_0x1dbfe7[_0x41fc6e]));logger[_0x3b16('0xb')](_0x3b16('0x57'),_0x1dbfe7[_0x41fc6e][_0x3b16('0x16')],_0x1dbfe7[_0x41fc6e][_0x3b16('0x4e')]);}else{manager[_0x3b16('0x48')](_0x41fc6e);manager[_0x3b16('0x49')](_0x41fc6e);logger[_0x3b16('0xb')](_0x3b16('0x55'),_0x1dbfe7[_0x41fc6e][_0x3b16('0x16')],_0x1dbfe7[_0x41fc6e]['cron']);}}}})['catch'](function(_0x21dad9){logger[_0x3b16('0x2c')](JSON[_0x3b16('0x25')](_0x21dad9));});}exports[_0x3b16('0x58')]=function(_0x4d6df6){return getJobs(_0x4d6df6);};exports[_0x3b16('0x54')]=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 e52ddf9..013e491 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 _0x566f=['lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data2','transcribeRegion','then','format','transcribeName','TranscriptionJobStatus','fileText','COMPLETED','TranscriptionJob','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','bucket','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','sentiment','CloudProvider','catch','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','push','all','SequelizeValidationError','start'];(function(_0x424584,_0x515733){var _0x3e7ded=function(_0x6c72b8){while(--_0x6c72b8){_0x424584['push'](_0x424584['shift']());}};_0x3e7ded(++_0x515733);}(_0x566f,0x124));var _0xf566=function(_0x228541,_0x284d39){_0x228541=_0x228541-0x0;var _0xe48b2f=_0x566f[_0x228541];return _0xe48b2f;};var _=require(_0xf566('0x0'));var AWS=require(_0xf566('0x1'));var rp=require(_0xf566('0x2'));var util=require(_0xf566('0x3'));var BPromise=require(_0xf566('0x4'));var db=require(_0xf566('0x5'))['db'];var logger=require(_0xf566('0x6'))(_0xf566('0x7'));function getTranscriptionJob(_0x5eef34,_0xae69b5,_0x41a6be,_0x1a6dbc){return new Promise(function(_0x117398,_0x5898ea){var _0xacfc48=new AWS[(_0xf566('0x8'))]({'accessKeyId':_0xae69b5,'secretAccessKey':_0x5eef34,'region':_0x41a6be});_0xacfc48[_0xf566('0x9')]({'TranscriptionJobName':_0x1a6dbc},function(_0x1e33fa,_0x588e82){if(_0x1e33fa){return _0x5898ea(_0x1e33fa);}else{return _0x117398(_0x588e82);}});});}function sentiment(_0x2dd9f6,_0x5bf147,_0x112610,_0x18c2cc,_0x20c0bd){return new Promise(function(_0x357b9e,_0x537530){var _0x26ab55=new AWS[(_0xf566('0xa'))]({'accessKeyId':_0x5bf147,'secretAccessKey':_0x2dd9f6,'region':_0x112610});_0x26ab55[_0xf566('0xb')]({'Text':_0x18c2cc,'LanguageCode':_0x20c0bd[_0xf566('0xc')](0x0,0x2)},function(_0x3efa0d,_0x19408f){if(_0x3efa0d){return _0x537530(_0x3efa0d);}else{return _0x357b9e(_0x19408f);}});});}function checkTranscribeJob(_0x4aec5b,_0x3f15a6,_0x5d6937){var _0x1c1e09;return new BPromise(function(_0x272691,_0x1ed8ab){logger[_0xf566('0xd')](util['format'](_0xf566('0xe'),_0x4aec5b['id'],_0x4aec5b['transcribeName']));return getTranscriptionJob(_0x5d6937['data1'],_0x5d6937[_0xf566('0xf')],_0x3f15a6[_0xf566('0x10')],_0x4aec5b['transcribeName'])[_0xf566('0x11')](function(_0x312f10){logger['info'](util[_0xf566('0x12')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x4aec5b['id'],_0x4aec5b[_0xf566('0x13')],_0x312f10['TranscriptionJob'][_0xf566('0x14')]));if(!_0x4aec5b[_0xf566('0x15')]){switch(_0x312f10['TranscriptionJob'][_0xf566('0x14')]){case _0xf566('0x16'):var _0x21b2d0={'transcribeStatus':_0x312f10[_0xf566('0x17')]['TranscriptionJobStatus'],'fileUri':_0x312f10[_0xf566('0x17')][_0xf566('0x18')][_0xf566('0x19')]};logger['info'](util[_0xf566('0x12')](_0xf566('0x1a'),_0x4aec5b['id']));return rp({'uri':_0x312f10[_0xf566('0x17')][_0xf566('0x18')][_0xf566('0x19')],'json':!![]})[_0xf566('0x11')](function(_0x2ff105){logger[_0xf566('0xd')](util[_0xf566('0x12')](_0xf566('0x1b'),_0x4aec5b['id']));if(_0x2ff105&&_0x2ff105[_0xf566('0x1c')]&&_0x2ff105['results'][_0xf566('0x1d')]&&_0x2ff105[_0xf566('0x1c')]['transcripts'][_0xf566('0x1e')]){_0x21b2d0[_0xf566('0x15')]='';for(var _0x2e1b4f=0x0;_0x2e1b4f<_0x2ff105[_0xf566('0x1c')][_0xf566('0x1d')][_0xf566('0x1e')];_0x2e1b4f++){_0x21b2d0[_0xf566('0x15')]+=_0x2ff105['results']['transcripts'][_0x2e1b4f][_0xf566('0x1f')]+'';}}return _0x4aec5b[_0xf566('0x20')](_0x21b2d0);})[_0xf566('0x11')](function(){logger[_0xf566('0xd')](util[_0xf566('0x12')](_0xf566('0x21'),_0x4aec5b['id']));if(!_0x4aec5b['tempSentiment']){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))](_0xf566('0x24'));}if(!_0x3f15a6['sentiment']||!_0x3f15a6[_0xf566('0x25')]||!_0x3f15a6[_0xf566('0x26')]||!_0x3f15a6['language']||!_0x3f15a6[_0xf566('0x27')]){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x21b2d0[_0xf566('0x15')]){throw new Error(_0xf566('0x28'));}if(_0x3f15a6[_0xf566('0x25')]===_0x5d6937['id']){return _0x5d6937;}else{return db['CloudProvider'][_0xf566('0x29')]({'where':{'id':_settings[_0xf566('0x25')]}});}})['then'](function(_0x577d6a){if(!_0x577d6a){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))](_0xf566('0x2a'));}if(!_0x577d6a[_0xf566('0x2b')]||!_0x577d6a[_0xf566('0xf')]){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))](_0xf566('0x2c'));}_0x1c1e09=_0x577d6a;logger[_0xf566('0xd')](util[_0xf566('0x12')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x4aec5b['id']));return sentiment(_0x1c1e09[_0xf566('0x2b')],_0x1c1e09['data2'],_0x3f15a6[_0xf566('0x26')],_0x21b2d0[_0xf566('0x15')],_0x3f15a6[_0xf566('0x2d')]);})[_0xf566('0x11')](function(_0x477492){logger[_0xf566('0xd')](util[_0xf566('0x12')](_0xf566('0x2e'),_0x4aec5b['id']));return _0x4aec5b[_0xf566('0x20')]({'sentiment':_0x477492[_0xf566('0x2f')],'sPositive':_0x477492[_0xf566('0x30')][_0xf566('0x31')],'sNegative':_0x477492[_0xf566('0x30')][_0xf566('0x32')],'sMixed':_0x477492[_0xf566('0x30')][_0xf566('0x33')],'sNeutral':_0x477492[_0xf566('0x30')][_0xf566('0x34')]});})[_0xf566('0x11')](function(){logger[_0xf566('0xd')](util[_0xf566('0x12')](_0xf566('0x21'),_0x4aec5b['id']));_0x272691();});case _0xf566('0x35'):return _0x4aec5b['update']({'transcribeStatus':_0xf566('0x35'),'failureReason':_0x312f10['TranscriptionJob']['FailureReason']})['then'](function(){logger[_0xf566('0xd')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4aec5b['id']));_0x272691();});default:logger[_0xf566('0xd')](util['format'](_0xf566('0x36'),_0x4aec5b['id']));break;}}else{return BPromise['resolve']()[_0xf566('0x11')](function(){if(!_0x4aec5b['tempSentiment']){throw new db['Sequelize'][(_0xf566('0x23'))](_0xf566('0x24'));}if(!_0x3f15a6[_0xf566('0x37')]||!_0x3f15a6['sentimentAccountId']||!_0x3f15a6[_0xf566('0x26')]||!_0x3f15a6['language']||!_0x3f15a6['bucket']){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x4aec5b[_0xf566('0x15')]){throw new Error(_0xf566('0x28'));}if(_0x3f15a6[_0xf566('0x25')]===_0x5d6937['id']){return _0x5d6937;}else{return db[_0xf566('0x38')][_0xf566('0x29')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x1444f5){if(!_0x1444f5){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))](_0xf566('0x2a'));}if(!_0x1444f5['data1']||!_0x1444f5[_0xf566('0xf')]){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))](_0xf566('0x2c'));}_0x1c1e09=_0x1444f5;logger[_0xf566('0xd')](util[_0xf566('0x12')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x4aec5b['id']));return sentiment(_0x1c1e09[_0xf566('0x2b')],_0x1c1e09[_0xf566('0xf')],_0x3f15a6['sentimentRegion'],_0x4aec5b['fileText'],_0x3f15a6['language']);})[_0xf566('0x11')](function(_0x393d51){logger[_0xf566('0xd')](util[_0xf566('0x12')](_0xf566('0x2e'),_0x4aec5b['id']));return _0x4aec5b[_0xf566('0x20')]({'sentiment':_0x393d51['Sentiment'],'sPositive':_0x393d51[_0xf566('0x30')]['Positive'],'sNegative':_0x393d51[_0xf566('0x30')]['Negative'],'sMixed':_0x393d51[_0xf566('0x30')][_0xf566('0x33')],'sNeutral':_0x393d51[_0xf566('0x30')]['Neutral'],'transcribeStatus':_0xf566('0x16')});})[_0xf566('0x11')](function(){logger['info'](util[_0xf566('0x12')](_0xf566('0x21'),_0x4aec5b['id']));_0x272691();});}})[_0xf566('0x39')](function(_0x49c462){if(_0x49c462){if(!_0x49c462['name']||_0x49c462[_0xf566('0x3a')]!=='SequelizeValidationError'){logger[_0xf566('0x3b')](util['format'](_0xf566('0x3c'),_0x4aec5b['id']),util[_0xf566('0x3d')](_0x49c462,{'showHidden':![],'depth':null}));}}_0x272691();});});}function checkTranscribe(){var _0x53973a;var _0x31288d;var _0x4aa16f;return db[_0xf566('0x3e')][_0xf566('0x3f')]({'where':{'transcribeStatus':_0xf566('0x40')}})[_0xf566('0x11')](function(_0x5b731c){if(!_0x5b731c||!_0x5b731c[_0xf566('0x1e')]){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))](_0xf566('0x41'));}_0x53973a=_0x5b731c;return db['Setting'][_0xf566('0x29')]({'where':{'id':0x1}});})[_0xf566('0x11')](function(_0x253736){if(!_0x253736){throw new db['Sequelize'][(_0xf566('0x23'))](_0xf566('0x42'));}_0x31288d=_0x253736;if(!_0x31288d[_0xf566('0x7')]||!_0x31288d[_0xf566('0x43')]||!_0x31288d['transcribeRegion']||!_0x31288d[_0xf566('0x2d')]||!_0x31288d[_0xf566('0x27')]){throw new db['Sequelize'][(_0xf566('0x23'))](_0xf566('0x44'));}return db['CloudProvider'][_0xf566('0x29')]({'where':{'id':_0x31288d['transcribeAccountId']}});})[_0xf566('0x11')](function(_0xb50a2){if(!_0xb50a2){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))](_0xf566('0x2a'));}if(!_0xb50a2[_0xf566('0x2b')]||!_0xb50a2[_0xf566('0xf')]){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))]('Cloud\x20Provider\x20not\x20configured');}_0x4aa16f=_0xb50a2;var _0x6d24d3=[];_0x53973a['forEach'](function(_0x345530){_0x6d24d3[_0xf566('0x45')](checkTranscribeJob(_0x345530,_0x31288d,_0x4aa16f));});return BPromise[_0xf566('0x46')](_0x6d24d3);})[_0xf566('0x39')](function(_0x33f5ef){if(_0x33f5ef){if(!_0x33f5ef['name']||_0x33f5ef['name']!==_0xf566('0x47')){logger['error'](util['inspect'](_0x33f5ef,{'showHidden':![],'depth':null}));}}});}exports[_0xf566('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xea28=['findOne','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Positive','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribeAccountId','forEach','push','all','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','info','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','[RECORDING:%d]\x20Get\x20transcript','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','bucket','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Negative','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','sentiment','CloudProvider'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xea28,0x13a));var _0x8ea2=function(_0x1cb185,_0xd39063){_0x1cb185=_0x1cb185-0x0;var _0x48d0cf=_0xea28[_0x1cb185];return _0x48d0cf;};var _=require(_0x8ea2('0x0'));var AWS=require(_0x8ea2('0x1'));var rp=require(_0x8ea2('0x2'));var util=require(_0x8ea2('0x3'));var BPromise=require(_0x8ea2('0x4'));var db=require(_0x8ea2('0x5'))['db'];var logger=require(_0x8ea2('0x6'))(_0x8ea2('0x7'));function getTranscriptionJob(_0x4b7cda,_0x9b45ab,_0x23aaf1,_0x1ccf12){return new Promise(function(_0x513a0d,_0x29b82b){var _0x435d78=new AWS[(_0x8ea2('0x8'))]({'accessKeyId':_0x9b45ab,'secretAccessKey':_0x4b7cda,'region':_0x23aaf1});_0x435d78[_0x8ea2('0x9')]({'TranscriptionJobName':_0x1ccf12},function(_0x28b5b8,_0x929304){if(_0x28b5b8){return _0x29b82b(_0x28b5b8);}else{return _0x513a0d(_0x929304);}});});}function sentiment(_0x19bd6c,_0x320750,_0x3de4a1,_0x3000f9,_0x3d0b35){return new Promise(function(_0x21ae3d,_0x500b82){var _0x4da3b1=new AWS[(_0x8ea2('0xa'))]({'accessKeyId':_0x320750,'secretAccessKey':_0x19bd6c,'region':_0x3de4a1});_0x4da3b1[_0x8ea2('0xb')]({'Text':_0x3000f9,'LanguageCode':_0x3d0b35[_0x8ea2('0xc')](0x0,0x2)},function(_0x59d628,_0x32b97d){if(_0x59d628){return _0x500b82(_0x59d628);}else{return _0x21ae3d(_0x32b97d);}});});}function checkTranscribeJob(_0x101a15,_0x1dfb6e,_0x10aead){var _0xe47c0e;return new BPromise(function(_0x5e662e,_0x2879d6){logger['info'](util['format'](_0x8ea2('0xd'),_0x101a15['id'],_0x101a15[_0x8ea2('0xe')]));return getTranscriptionJob(_0x10aead[_0x8ea2('0xf')],_0x10aead[_0x8ea2('0x10')],_0x1dfb6e[_0x8ea2('0x11')],_0x101a15[_0x8ea2('0xe')])[_0x8ea2('0x12')](function(_0x11f5e8){logger[_0x8ea2('0x13')](util[_0x8ea2('0x14')](_0x8ea2('0x15'),_0x101a15['id'],_0x101a15[_0x8ea2('0xe')],_0x11f5e8[_0x8ea2('0x16')][_0x8ea2('0x17')]));if(!_0x101a15[_0x8ea2('0x18')]){switch(_0x11f5e8[_0x8ea2('0x16')][_0x8ea2('0x17')]){case _0x8ea2('0x19'):var _0x1068b6={'transcribeStatus':_0x11f5e8[_0x8ea2('0x16')][_0x8ea2('0x17')],'fileUri':_0x11f5e8[_0x8ea2('0x16')]['Transcript']['TranscriptFileUri']};logger[_0x8ea2('0x13')](util[_0x8ea2('0x14')](_0x8ea2('0x1a'),_0x101a15['id']));return rp({'uri':_0x11f5e8['TranscriptionJob'][_0x8ea2('0x1b')][_0x8ea2('0x1c')],'json':!![]})['then'](function(_0x3d593b){logger[_0x8ea2('0x13')](util[_0x8ea2('0x14')](_0x8ea2('0x1d'),_0x101a15['id']));if(_0x3d593b&&_0x3d593b[_0x8ea2('0x1e')]&&_0x3d593b[_0x8ea2('0x1e')][_0x8ea2('0x1f')]&&_0x3d593b[_0x8ea2('0x1e')][_0x8ea2('0x1f')]['length']){_0x1068b6[_0x8ea2('0x18')]='';for(var _0x4f48bd=0x0;_0x4f48bd<_0x3d593b[_0x8ea2('0x1e')][_0x8ea2('0x1f')][_0x8ea2('0x20')];_0x4f48bd++){_0x1068b6['fileText']+=_0x3d593b['results'][_0x8ea2('0x1f')][_0x4f48bd]['transcript']+'';}}return _0x101a15[_0x8ea2('0x21')](_0x1068b6);})['then'](function(){logger[_0x8ea2('0x13')](util[_0x8ea2('0x14')](_0x8ea2('0x22'),_0x101a15['id']));if(!_0x101a15[_0x8ea2('0x23')]){throw new db['Sequelize']['ValidationError'](_0x8ea2('0x24'));}if(!_0x1dfb6e['sentiment']||!_0x1dfb6e[_0x8ea2('0x25')]||!_0x1dfb6e[_0x8ea2('0x26')]||!_0x1dfb6e[_0x8ea2('0x27')]||!_0x1dfb6e[_0x8ea2('0x28')]){throw new db[(_0x8ea2('0x29'))][(_0x8ea2('0x2a'))](_0x8ea2('0x2b'));}if(!_0x1068b6[_0x8ea2('0x18')]){throw new Error(_0x8ea2('0x2c'));}if(_0x1dfb6e[_0x8ea2('0x25')]===_0x10aead['id']){return _0x10aead;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings[_0x8ea2('0x25')]}});}})[_0x8ea2('0x12')](function(_0x53d71c){if(!_0x53d71c){throw new db['Sequelize'][(_0x8ea2('0x2a'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x53d71c[_0x8ea2('0xf')]||!_0x53d71c[_0x8ea2('0x10')]){throw new db['Sequelize'][(_0x8ea2('0x2a'))](_0x8ea2('0x2d'));}_0xe47c0e=_0x53d71c;logger[_0x8ea2('0x13')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x101a15['id']));return sentiment(_0xe47c0e['data1'],_0xe47c0e[_0x8ea2('0x10')],_0x1dfb6e[_0x8ea2('0x26')],_0x1068b6[_0x8ea2('0x18')],_0x1dfb6e['language']);})[_0x8ea2('0x12')](function(_0x391b08){logger[_0x8ea2('0x13')](util[_0x8ea2('0x14')](_0x8ea2('0x2e'),_0x101a15['id']));return _0x101a15[_0x8ea2('0x21')]({'sentiment':_0x391b08[_0x8ea2('0x2f')],'sPositive':_0x391b08[_0x8ea2('0x30')]['Positive'],'sNegative':_0x391b08[_0x8ea2('0x30')][_0x8ea2('0x31')],'sMixed':_0x391b08[_0x8ea2('0x30')][_0x8ea2('0x32')],'sNeutral':_0x391b08['SentimentScore'][_0x8ea2('0x33')]});})['then'](function(){logger[_0x8ea2('0x13')](util[_0x8ea2('0x14')](_0x8ea2('0x22'),_0x101a15['id']));_0x5e662e();});case _0x8ea2('0x34'):return _0x101a15['update']({'transcribeStatus':_0x8ea2('0x34'),'failureReason':_0x11f5e8['TranscriptionJob']['FailureReason']})[_0x8ea2('0x12')](function(){logger['info'](util[_0x8ea2('0x14')](_0x8ea2('0x22'),_0x101a15['id']));_0x5e662e();});default:logger[_0x8ea2('0x13')](util[_0x8ea2('0x14')](_0x8ea2('0x35'),_0x101a15['id']));break;}}else{return BPromise['resolve']()[_0x8ea2('0x12')](function(){if(!_0x101a15['tempSentiment']){throw new db[(_0x8ea2('0x29'))][(_0x8ea2('0x2a'))](_0x8ea2('0x24'));}if(!_0x1dfb6e[_0x8ea2('0x36')]||!_0x1dfb6e['sentimentAccountId']||!_0x1dfb6e[_0x8ea2('0x26')]||!_0x1dfb6e['language']||!_0x1dfb6e[_0x8ea2('0x28')]){throw new db['Sequelize'][(_0x8ea2('0x2a'))](_0x8ea2('0x2b'));}if(!_0x101a15[_0x8ea2('0x18')]){throw new Error(_0x8ea2('0x2c'));}if(_0x1dfb6e[_0x8ea2('0x25')]===_0x10aead['id']){return _0x10aead;}else{return db[_0x8ea2('0x37')][_0x8ea2('0x38')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x1d7496){if(!_0x1d7496){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x1d7496[_0x8ea2('0xf')]||!_0x1d7496['data2']){throw new db[(_0x8ea2('0x29'))][(_0x8ea2('0x2a'))](_0x8ea2('0x2d'));}_0xe47c0e=_0x1d7496;logger[_0x8ea2('0x13')](util[_0x8ea2('0x14')](_0x8ea2('0x39'),_0x101a15['id']));return sentiment(_0xe47c0e[_0x8ea2('0xf')],_0xe47c0e[_0x8ea2('0x10')],_0x1dfb6e['sentimentRegion'],_0x101a15[_0x8ea2('0x18')],_0x1dfb6e[_0x8ea2('0x27')]);})[_0x8ea2('0x12')](function(_0x5cb6ad){logger[_0x8ea2('0x13')](util[_0x8ea2('0x14')](_0x8ea2('0x2e'),_0x101a15['id']));return _0x101a15[_0x8ea2('0x21')]({'sentiment':_0x5cb6ad[_0x8ea2('0x2f')],'sPositive':_0x5cb6ad['SentimentScore'][_0x8ea2('0x3a')],'sNegative':_0x5cb6ad[_0x8ea2('0x30')][_0x8ea2('0x31')],'sMixed':_0x5cb6ad['SentimentScore'][_0x8ea2('0x32')],'sNeutral':_0x5cb6ad[_0x8ea2('0x30')][_0x8ea2('0x33')],'transcribeStatus':_0x8ea2('0x19')});})[_0x8ea2('0x12')](function(){logger[_0x8ea2('0x13')](util[_0x8ea2('0x14')](_0x8ea2('0x22'),_0x101a15['id']));_0x5e662e();});}})[_0x8ea2('0x3b')](function(_0x302eef){if(_0x302eef){if(!_0x302eef[_0x8ea2('0x3c')]||_0x302eef[_0x8ea2('0x3c')]!==_0x8ea2('0x3d')){logger[_0x8ea2('0x3e')](util['format'](_0x8ea2('0x3f'),_0x101a15['id']),util[_0x8ea2('0x40')](_0x302eef,{'showHidden':![],'depth':null}));}}_0x5e662e();});});}function checkTranscribe(){var _0x216c37;var _0x6ed85a;var _0x182a46;return db[_0x8ea2('0x41')][_0x8ea2('0x42')]({'where':{'transcribeStatus':_0x8ea2('0x43')}})['then'](function(_0x12688a){if(!_0x12688a||!_0x12688a[_0x8ea2('0x20')]){throw new db[(_0x8ea2('0x29'))]['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x216c37=_0x12688a;return db[_0x8ea2('0x44')][_0x8ea2('0x38')]({'where':{'id':0x1}});})[_0x8ea2('0x12')](function(_0x5e5c37){if(!_0x5e5c37){throw new db[(_0x8ea2('0x29'))][(_0x8ea2('0x2a'))](_0x8ea2('0x45'));}_0x6ed85a=_0x5e5c37;if(!_0x6ed85a[_0x8ea2('0x7')]||!_0x6ed85a[_0x8ea2('0x46')]||!_0x6ed85a['transcribeRegion']||!_0x6ed85a['language']||!_0x6ed85a[_0x8ea2('0x28')]){throw new db[(_0x8ea2('0x29'))][(_0x8ea2('0x2a'))]('Transcribe\x20not\x20configured');}return db[_0x8ea2('0x37')][_0x8ea2('0x38')]({'where':{'id':_0x6ed85a[_0x8ea2('0x46')]}});})['then'](function(_0x5c6524){if(!_0x5c6524){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x5c6524[_0x8ea2('0xf')]||!_0x5c6524[_0x8ea2('0x10')]){throw new db['Sequelize']['ValidationError'](_0x8ea2('0x2d'));}_0x182a46=_0x5c6524;var _0x12c0db=[];_0x216c37[_0x8ea2('0x47')](function(_0x5eea45){_0x12c0db[_0x8ea2('0x48')](checkTranscribeJob(_0x5eea45,_0x6ed85a,_0x182a46));});return BPromise[_0x8ea2('0x49')](_0x12c0db);})['catch'](function(_0x8f0598){if(_0x8f0598){if(!_0x8f0598[_0x8ea2('0x3c')]||_0x8f0598[_0x8ea2('0x3c')]!==_0x8ea2('0x3d')){logger[_0x8ea2('0x3e')](util['inspect'](_0x8f0598,{'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 772965a..49cde9e 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 _0x1c2b=['map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','defaults','redis','localhost','lastMsgAt','subtract'];(function(_0x1642b9,_0x358772){var _0x4fae39=function(_0x80dfec){while(--_0x80dfec){_0x1642b9['push'](_0x1642b9['shift']());}};_0x4fae39(++_0x358772);}(_0x1c2b,0x1d0));var _0xb1c2=function(_0x5c081f,_0x1a0afe){_0x5c081f=_0x5c081f-0x0;var _0x51a830=_0x1c2b[_0x5c081f];return _0x51a830;};'use strict';var _=require(_0xb1c2('0x0'));var moment=require('moment');var Redis=require(_0xb1c2('0x1'));var util=require(_0xb1c2('0x2'));var config=require(_0xb1c2('0x3'));var db=require(_0xb1c2('0x4'))['db'];var logger=require(_0xb1c2('0x5'))(_0xb1c2('0x6'));config['redis']=_[_0xb1c2('0x7')](config[_0xb1c2('0x8')],{'host':_0xb1c2('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb1c2('0x8')]));function closeInteractions(){var _0xc21d64=[];return db['WhatsappInteraction']['findAll']({'raw':!![],'attributes':['id',_0xb1c2('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xb1c2('0xb')](0x18,'hours')}}})['then'](function(_0x3a604f){if(_0x3a604f&&_0x3a604f['length']){_0xc21d64=_[_0xb1c2('0xc')](_0x3a604f||[],'id');logger[_0xb1c2('0xd')](_0xb1c2('0xe'),_0xc21d64[_0xb1c2('0xf')]());return db['WhatsappInteraction'][_0xb1c2('0x10')]({'closeReason':'system','disposition':_0xb1c2('0x11'),'closed':!![],'closedAt':moment()[_0xb1c2('0x12')](_0xb1c2('0x13'))},{'where':{'id':_0xc21d64}});}})[_0xb1c2('0x14')](function(){if(_0xc21d64&&_0xc21d64[_0xb1c2('0x15')]){logger[_0xb1c2('0xd')](_0xb1c2('0x16'),_0xc21d64[_0xb1c2('0xf')]());for(var _0x7904=0x0;_0x7904<_0xc21d64[_0xb1c2('0x15')];_0x7904++){io[_0xb1c2('0x17')]('whatsappInteraction:update',{'id':_0xc21d64[_0x7904],'closed':!![]});}}})[_0xb1c2('0x18')](function(_0x1c5579){logger[_0xb1c2('0x19')](_0xb1c2('0x1a'),_0x1c5579?util[_0xb1c2('0x1b')](_0x1c5579,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x726f=['WhatsappInteraction','subtract','hours','then','length','map','info','join','system','timeout','format','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults'];(function(_0x442430,_0x1b3577){var _0x2440c1=function(_0x3033a6){while(--_0x3033a6){_0x442430['push'](_0x442430['shift']());}};_0x2440c1(++_0x1b3577);}(_0x726f,0x1ca));var _0xf726=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x726f[_0x46698a];return _0x356db0;};'use strict';var _=require(_0xf726('0x0'));var moment=require(_0xf726('0x1'));var Redis=require(_0xf726('0x2'));var util=require(_0xf726('0x3'));var config=require(_0xf726('0x4'));var db=require(_0xf726('0x5'))['db'];var logger=require(_0xf726('0x6'))(_0xf726('0x7'));config[_0xf726('0x8')]=_[_0xf726('0x9')](config[_0xf726('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf726('0x8')]));function closeInteractions(){var _0x58cf39=[];return db[_0xf726('0xa')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xf726('0xb')](0x18,_0xf726('0xc'))}}})[_0xf726('0xd')](function(_0x5ae23a){if(_0x5ae23a&&_0x5ae23a[_0xf726('0xe')]){_0x58cf39=_[_0xf726('0xf')](_0x5ae23a||[],'id');logger[_0xf726('0x10')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x58cf39[_0xf726('0x11')]());return db[_0xf726('0xa')]['update']({'closeReason':_0xf726('0x12'),'disposition':_0xf726('0x13'),'closed':!![],'closedAt':moment()[_0xf726('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x58cf39}});}})[_0xf726('0xd')](function(){if(_0x58cf39&&_0x58cf39[_0xf726('0xe')]){logger[_0xf726('0x10')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x58cf39[_0xf726('0x11')]());for(var _0x1c231e=0x0;_0x1c231e<_0x58cf39[_0xf726('0xe')];_0x1c231e++){io['emit'](_0xf726('0x15'),{'id':_0x58cf39[_0x1c231e],'closed':!![]});}}})[_0xf726('0x16')](function(_0x43a4e1){logger[_0xf726('0x17')](_0xf726('0x18'),_0x43a4e1?util['inspect'](_0x43a4e1,{'showHidden':![],'depth':null}):'');});}exports[_0xf726('0x19')]=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 9d91900..a047261 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['now','CmContact','bulkCreate','then','finished\x20populating','CmHopper','destroy','log','hopper1','contacts2','hopper2','util','../mysqldb','push','Innocenzo','Biondo','@xcally.com'];(function(_0x31880d,_0x4f0ff3){var _0x423823=function(_0x57cc92){while(--_0x57cc92){_0x31880d['push'](_0x31880d['shift']());}};_0x423823(++_0x4f0ff3);}(_0x9c44,0x13d));var _0x49c4=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9c44[_0x2b7764];return _0x848dcb;};'use strict';var util=require(_0x49c4('0x0'));var db=require(_0x49c4('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x49c4('0x2')]({'id':i,'firstName':_0x49c4('0x3')+i,'lastName':_0x49c4('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x49c4('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x49c4('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x49c4('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x49c4('0x6')](),'updatedAt':Date[_0x49c4('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x49c4('0x3')+i,'lastName':_0x49c4('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x49c4('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x49c4('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x49c4('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x49c4('0x6')](),'updatedAt':Date[_0x49c4('0x6')]()});}db[_0x49c4('0x7')]['destroy']({'where':{}})['then'](function(){return db[_0x49c4('0x7')][_0x49c4('0x8')](contacts);})[_0x49c4('0x9')](function(){console['log'](_0x49c4('0xa'),'contacts1');return db[_0x49c4('0xb')][_0x49c4('0xc')]({'where':{}});})['then'](function(){return db['CmHopper'][_0x49c4('0x8')](hopper);})[_0x49c4('0x9')](function(){console[_0x49c4('0xd')](_0x49c4('0xa'),_0x49c4('0xe'));return db['CmContact'][_0x49c4('0x8')](contacts2);})[_0x49c4('0x9')](function(){console['log']('finished\x20populating',_0x49c4('0xf'));return db[_0x49c4('0xb')]['bulkCreate'](hopper2);})[_0x49c4('0x9')](function(){console['log']('finished\x20populating',_0x49c4('0x10'));})['catch'](function(_0x357a23){console[_0x49c4('0xd')](_0x357a23);}); \ No newline at end of file +var _0xe46c=['then','finished\x20populating','contacts1','CmHopper','bulkCreate','hopper1','log','contacts2','hopper2','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy'];(function(_0x27d2aa,_0x5a595c){var _0x46c5ab=function(_0x306bb1){while(--_0x306bb1){_0x27d2aa['push'](_0x27d2aa['shift']());}};_0x46c5ab(++_0x5a595c);}(_0xe46c,0xbd));var _0xce46=function(_0x1c4cef,_0x391ad0){_0x1c4cef=_0x1c4cef-0x0;var _0xe2316a=_0xe46c[_0x1c4cef];return _0xe2316a;};'use strict';var util=require('util');var db=require(_0xce46('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xce46('0x1')]({'id':i,'firstName':_0xce46('0x2')+i,'lastName':_0xce46('0x3')+i,'phone':0xf879fb460+i,'email':_0xce46('0x4')+i+_0xce46('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xce46('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xce46('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xce46('0x6')](),'updatedAt':Date[_0xce46('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xce46('0x1')]({'id':i,'firstName':_0xce46('0x2')+i,'lastName':_0xce46('0x3')+i,'phone':0xf879fb460+i,'email':_0xce46('0x4')+i+_0xce46('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xce46('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xce46('0x6')](),'updatedAt':Date[_0xce46('0x6')]()});}db[_0xce46('0x7')][_0xce46('0x8')]({'where':{}})[_0xce46('0x9')](function(){return db[_0xce46('0x7')]['bulkCreate'](contacts);})[_0xce46('0x9')](function(){console['log'](_0xce46('0xa'),_0xce46('0xb'));return db[_0xce46('0xc')][_0xce46('0x8')]({'where':{}});})[_0xce46('0x9')](function(){return db[_0xce46('0xc')][_0xce46('0xd')](hopper);})['then'](function(){console['log'](_0xce46('0xa'),_0xce46('0xe'));return db[_0xce46('0x7')][_0xce46('0xd')](contacts2);})[_0xce46('0x9')](function(){console[_0xce46('0xf')](_0xce46('0xa'),_0xce46('0x10'));return db[_0xce46('0xc')]['bulkCreate'](hopper2);})['then'](function(){console[_0xce46('0xf')]('finished\x20populating',_0xce46('0x11'));})['catch'](function(_0x5af582){console[_0xce46('0xf')](_0x5af582);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 5a398bf..8cb267a 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6bf8=['\x22%s\x22\x20<%s>','User','bulkCreate','then','catch','log','util','../mysqldb','format','%s%s','agent','password','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass'];(function(_0x3a2334,_0x4c393f){var _0x4b66ea=function(_0x19e871){while(--_0x19e871){_0x3a2334['push'](_0x3a2334['shift']());}};_0x4b66ea(++_0x4c393f);}(_0x6bf8,0xea));var _0x86bf=function(_0x477c0c,_0x48b400){_0x477c0c=_0x477c0c-0x0;var _0x37d540=_0x6bf8[_0x477c0c];return _0x37d540;};'use strict';var util=require(_0x86bf('0x0'));var db=require(_0x86bf('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x86bf('0x2')](_0x86bf('0x3'),'agent',i),'fullname':util[_0x86bf('0x2')]('%s%s',_0x86bf('0x4'),i),'email':util['format']('%s%s@xcally.com',_0x86bf('0x4'),i),'role':_0x86bf('0x4'),'password':_0x86bf('0x5'),'internal':0xfa0+i,'type':'friend','transport':[_0x86bf('0x6'),'ws',_0x86bf('0x7')],'disallow':[_0x86bf('0x8')],'allow':[_0x86bf('0x9')],'defaultuser':util['format']('%s%s',_0x86bf('0x4'),i),'encryption':'yes','avpf':'yes','force_avp':_0x86bf('0xa'),'icesupport':_0x86bf('0xa'),'dtlsenable':_0x86bf('0xa'),'dtlsverify':'no','dtlscertfile':_0x86bf('0xb'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x86bf('0xc'),'callerid':util[_0x86bf('0x2')](_0x86bf('0xd'),util[_0x86bf('0x2')](_0x86bf('0x3'),_0x86bf('0x4'),i),0xfa0+i)});}db[_0x86bf('0xe')][_0x86bf('0xf')](users)[_0x86bf('0x10')](function(){console['log']('add\x20user');})[_0x86bf('0x11')](function(_0x4bde26){console[_0x86bf('0x12')](_0x4bde26);}); \ No newline at end of file +var _0xaa1d=['%s%s@xcally.com','password','friend','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','bulkCreate','log','add\x20user','util','../mysqldb','push','format','%s%s','agent'];(function(_0x58f8b5,_0x3d0aad){var _0x513d41=function(_0x4331b6){while(--_0x4331b6){_0x58f8b5['push'](_0x58f8b5['shift']());}};_0x513d41(++_0x3d0aad);}(_0xaa1d,0xcb));var _0xdaa1=function(_0x54e348,_0xc1f87f){_0x54e348=_0x54e348-0x0;var _0x21f143=_0xaa1d[_0x54e348];return _0x21f143;};'use strict';var util=require(_0xdaa1('0x0'));var db=require(_0xdaa1('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xdaa1('0x2')]({'name':util[_0xdaa1('0x3')](_0xdaa1('0x4'),_0xdaa1('0x5'),i),'fullname':util[_0xdaa1('0x3')](_0xdaa1('0x4'),_0xdaa1('0x5'),i),'email':util[_0xdaa1('0x3')](_0xdaa1('0x6'),_0xdaa1('0x5'),i),'role':_0xdaa1('0x5'),'password':_0xdaa1('0x7'),'internal':0xfa0+i,'type':_0xdaa1('0x8'),'transport':['udp','ws',_0xdaa1('0x9')],'disallow':[_0xdaa1('0xa')],'allow':[_0xdaa1('0xb')],'defaultuser':util[_0xdaa1('0x3')](_0xdaa1('0x4'),'agent',i),'encryption':_0xdaa1('0xc'),'avpf':_0xdaa1('0xc'),'force_avp':'yes','icesupport':_0xdaa1('0xc'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0xdaa1('0xd'),'dtlsprivatekey':_0xdaa1('0xe'),'dtlssetup':'actpass','callerid':util['format'](_0xdaa1('0xf'),util['format'](_0xdaa1('0x4'),_0xdaa1('0x5'),i),0xfa0+i)});}db['User'][_0xdaa1('0x10')](users)['then'](function(){console[_0xdaa1('0x11')](_0xdaa1('0x12'));})['catch'](function(_0x2561ba){console[_0xdaa1('0x11')](_0x2561ba);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index bb5e0bb..b027545 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbcae=['Campaign','type','format','%s:queue:%s','length','user:%s','handshake','find','userProfileId','query','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','then','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','OpenchannelQueues','getVoiceQueues','getChatQueues','getSmsQueues','getWhatsappQueues','voice','chat','fax','sms','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','removeChatInteractions','user_has_chat_interactions:remove','leave','removeMailInteractions','emit','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_whatsapp_interactions:remove','log','join','default','setMaxListeners','address','request','remoteAddress','connection','SocketIO\x20','disconnect','DISCONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','telephone','agent','ivr','UserProfileSection','findOne','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','map','where'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xbcae,0xa9));var _0xebca=function(_0x5ee3ff,_0x1a014a){_0x5ee3ff=_0x5ee3ff-0x0;var _0x2aab9e=_0xbcae[_0x5ee3ff];return _0x2aab9e;};'use strict';var _=require(_0xebca('0x0'));var util=require(_0xebca('0x1'));var BPromise=require(_0xebca('0x2'));var db=require(_0xebca('0x3'))['db'];var config=require(_0xebca('0x4'));var queryQueues={'attributes':['id',_0xebca('0x5')],'include':[{'as':_0xebca('0x6'),'model':db[_0xebca('0x7')],'attributes':['id',_0xebca('0x5'),_0xebca('0x8')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xebca('0x5')],'where':{'role':_0xebca('0x9')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0xebca('0x5')],'where':{'role':_0xebca('0xa')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xebca('0x5'),'type'],'where':{'type':_0xebca('0xb')}};function getAssociatedResources(_0x2bcced,_0x1fa41a,_0x1a371f){return db[_0xebca('0xc')][_0xebca('0xd')]({'where':{'name':_0x2bcced,'userProfileId':_0x1fa41a},'raw':!![]})['then'](function(_0x525679){if(_0x525679){if(_0x525679['autoAssociation']){switch(_0x2bcced){case _0xebca('0xe'):case _0xebca('0xf'):case _0xebca('0x10'):case _0xebca('0x11'):case _0xebca('0x12'):case'OpenchannelQueues':case _0xebca('0x13'):return db[_0x1a371f][_0xebca('0x14')](queryQueues);case _0xebca('0x15'):return db[_0x1a371f][_0xebca('0x14')](queryTelephones);case _0xebca('0x16'):return db[_0x1a371f][_0xebca('0x14')](queryTrunks);case _0xebca('0x17'):return db[_0x1a371f][_0xebca('0x14')](queryCampaigns);}}else{return db['UserProfileResource']['findAll']({'attributes':[_0xebca('0x18')],'where':{'sectionId':_0x525679['id']},'raw':!![]})['then'](function(_0x1f74f1){if(_0x1f74f1){var _0x35091f={'where':{'id':_[_0xebca('0x19')](_0x1f74f1,_0xebca('0x18'))},'raw':!![]};switch(_0x1a371f){case'User':_0x35091f[_0xebca('0x1a')][_0xebca('0x8')]=_0xebca('0x9');break;case _0xebca('0x1b'):_0x35091f['where'][_0xebca('0x1c')]=_0xebca('0xb');break;}return db[_0x1a371f][_0xebca('0x14')](_0x35091f);}else{return[];}});}}else{return[];}})['then'](function(_0x168448){return _0x168448;});}function joinOrLeaveQueues(_0x93e7b9,_0x5ae277,_0x2c0546,_0x1a7cc0){_0x93e7b9[_0x5ae277](util[_0xebca('0x1d')](_0xebca('0x1e'),_0x2c0546,_0x1a7cc0[_0xebca('0x5')]));if(_0x1a7cc0[_0xebca('0x6')]){for(var _0x186096=0x0;_0x186096<_0x1a7cc0[_0xebca('0x6')][_0xebca('0x1f')];_0x186096+=0x1){_0x93e7b9[_0x5ae277](util[_0xebca('0x1d')](_0xebca('0x20'),_0x1a7cc0[_0xebca('0x6')][_0x186096][_0xebca('0x5')]));}}}function joinOrLeave(_0x12758f,_0x5a4de4,_0x952255){var _0x41d17e;if(_0x12758f[_0xebca('0x21')]['query']['id']){db['User'][_0xebca('0x22')]({'attributes':['id',_0xebca('0x5'),'role',_0xebca('0x23')],'where':{'id':_0x12758f[_0xebca('0x21')][_0xebca('0x24')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0xebca('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xebca('0x26')],'as':_0xebca('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xebca('0x28')],'as':_0xebca('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xebca('0x2a')],'as':_0xebca('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0xebca('0x2c')],'as':_0xebca('0x2d'),'attributes':['id'],'raw':!![]},{'model':db[_0xebca('0x2e')],'as':_0xebca('0x2f'),'attributes':['id'],'raw':!![]}]})[_0xebca('0x30')](function(_0xf66ad3){if(_0xf66ad3){_0x41d17e=_0xf66ad3;_0x12758f[_0x5a4de4](util[_0xebca('0x1d')](_0xebca('0x20'),_0xf66ad3[_0xebca('0x5')]));var _0x30f48c=[];switch(_0xf66ad3[_0xebca('0x8')]){case _0xebca('0x31'):_0x12758f[_0x5a4de4](_0xebca('0x32'));_0x12758f[_0x5a4de4](_0xebca('0x33'));if(queryQueues[_0xebca('0x34')](_0xebca('0x35'))){delete queryQueues[_0xebca('0x35')];}_0x30f48c[_0xebca('0x36')](db[_0xebca('0x37')]['findAll'](queryQueues));_0x30f48c[_0xebca('0x36')](db[_0xebca('0x38')][_0xebca('0x14')](queryQueues));_0x30f48c['push'](db['FaxQueue'][_0xebca('0x14')](queryQueues));_0x30f48c[_0xebca('0x36')](db[_0xebca('0x39')][_0xebca('0x14')](queryQueues));_0x30f48c[_0xebca('0x36')](db[_0xebca('0x3a')][_0xebca('0x14')](queryQueues));_0x30f48c[_0xebca('0x36')](db[_0xebca('0x3b')][_0xebca('0x14')](queryQueues));_0x30f48c['push'](db[_0xebca('0x3c')][_0xebca('0x14')](queryQueues));_0x30f48c[_0xebca('0x36')](db[_0xebca('0x7')]['findAll'](queryTelephones));_0x30f48c[_0xebca('0x36')](db[_0xebca('0x3d')][_0xebca('0x14')](queryTrunks));_0x30f48c[_0xebca('0x36')](db[_0xebca('0x1b')][_0xebca('0x14')](queryCampaigns));_0x30f48c[_0xebca('0x36')](db[_0xebca('0x7')][_0xebca('0x14')](queryAgents));break;case _0xebca('0x3e'):_0x12758f[_0x5a4de4](_0xebca('0x32'));_0x12758f[_0x5a4de4](_0xebca('0x33'));_0x30f48c[_0xebca('0x36')](getAssociatedResources(_0xebca('0xe'),_0xf66ad3[_0xebca('0x23')],'VoiceQueue'));_0x30f48c[_0xebca('0x36')](getAssociatedResources('ChatQueues',_0xf66ad3[_0xebca('0x23')],_0xebca('0x38')));_0x30f48c['push'](getAssociatedResources(_0xebca('0x10'),_0xf66ad3[_0xebca('0x23')],'FaxQueue'));_0x30f48c[_0xebca('0x36')](getAssociatedResources(_0xebca('0x11'),_0xf66ad3[_0xebca('0x23')],'SmsQueue'));_0x30f48c[_0xebca('0x36')](getAssociatedResources(_0xebca('0x12'),_0xf66ad3[_0xebca('0x23')],_0xebca('0x3a')));_0x30f48c['push'](getAssociatedResources(_0xebca('0x3f'),_0xf66ad3[_0xebca('0x23')],_0xebca('0x3b')));_0x30f48c[_0xebca('0x36')](getAssociatedResources(_0xebca('0x13'),_0xf66ad3[_0xebca('0x23')],'WhatsappQueue'));_0x30f48c[_0xebca('0x36')](getAssociatedResources(_0xebca('0x15'),_0xf66ad3[_0xebca('0x23')],'User'));_0x30f48c[_0xebca('0x36')](getAssociatedResources(_0xebca('0x16'),_0xf66ad3[_0xebca('0x23')],'Trunk'));_0x30f48c[_0xebca('0x36')](getAssociatedResources('IvrCampaigns',_0xf66ad3[_0xebca('0x23')],_0xebca('0x1b')));_0x30f48c[_0xebca('0x36')](db[_0xebca('0x7')][_0xebca('0x14')](queryAgents));break;case _0xebca('0xa'):_0x12758f[_0x5a4de4](_0xebca('0x32'));_0x12758f[_0x5a4de4](_0xebca('0x33'));_0x30f48c[_0xebca('0x36')](_0xf66ad3[_0xebca('0x40')]({'attributes':['id',_0xebca('0x5')]}));_0x30f48c[_0xebca('0x36')](_0xf66ad3[_0xebca('0x41')]({'attributes':['id',_0xebca('0x5')]}));_0x30f48c[_0xebca('0x36')](_0xf66ad3['getFaxQueues']({'attributes':['id',_0xebca('0x5')]}));_0x30f48c[_0xebca('0x36')](_0xf66ad3[_0xebca('0x42')]({'attributes':['id',_0xebca('0x5')]}));_0x30f48c['push'](_0xf66ad3['getMailQueues']({'attributes':['id',_0xebca('0x5')]}));_0x30f48c[_0xebca('0x36')](_0xf66ad3['getOpenchannelQueues']({'attributes':['id','name']}));_0x30f48c[_0xebca('0x36')](_0xf66ad3[_0xebca('0x43')]({'attributes':['id',_0xebca('0x5')]}));break;}return BPromise['all'](_0x30f48c);}})['then'](function(_0x4a84e0){if(_0x4a84e0&&_0x4a84e0[_0xebca('0x1f')]){for(var _0x4af55c=0x0;_0x4af55c<_0x4a84e0[_0xebca('0x1f')];_0x4af55c+=0x1){for(var _0x242477=0x0;_0x242477<_0x4a84e0[_0x4af55c]['length'];_0x242477+=0x1){switch(_0x4af55c){case 0x0:joinOrLeaveQueues(_0x12758f,_0x5a4de4,_0xebca('0x44'),_0x4a84e0[_0x4af55c][_0x242477]);break;case 0x1:joinOrLeaveQueues(_0x12758f,_0x5a4de4,_0xebca('0x45'),_0x4a84e0[_0x4af55c][_0x242477]);break;case 0x2:joinOrLeaveQueues(_0x12758f,_0x5a4de4,_0xebca('0x46'),_0x4a84e0[_0x4af55c][_0x242477]);break;case 0x3:joinOrLeaveQueues(_0x12758f,_0x5a4de4,_0xebca('0x47'),_0x4a84e0[_0x4af55c][_0x242477]);break;case 0x4:joinOrLeaveQueues(_0x12758f,_0x5a4de4,'mail',_0x4a84e0[_0x4af55c][_0x242477]);break;case 0x5:joinOrLeaveQueues(_0x12758f,_0x5a4de4,_0xebca('0x48'),_0x4a84e0[_0x4af55c][_0x242477]);break;case 0x6:joinOrLeaveQueues(_0x12758f,_0x5a4de4,'whatsapp',_0x4a84e0[_0x4af55c][_0x242477]);break;case 0x7:if(_0x41d17e[_0xebca('0x8')]!==_0xebca('0xa'))_0x12758f[_0x5a4de4](util['format'](_0xebca('0x49'),_0x4a84e0[_0x4af55c][_0x242477]['name']));break;case 0x8:if(_0x41d17e[_0xebca('0x8')]!==_0xebca('0xa'))_0x12758f[_0x5a4de4](util[_0xebca('0x1d')](_0xebca('0x4a'),_0x4a84e0[_0x4af55c][_0x242477][_0xebca('0x5')]));break;case 0x9:if(_0x41d17e[_0xebca('0x8')]!=='agent')_0x12758f[_0x5a4de4](util[_0xebca('0x1d')](_0xebca('0x4b'),_0x4a84e0[_0x4af55c][_0x242477][_0xebca('0x1c')],_0x4a84e0[_0x4af55c][_0x242477]['name']));break;case 0xa:_0x12758f[_0x5a4de4](util[_0xebca('0x1d')](_0xebca('0x20'),_0x4a84e0[_0x4af55c][_0x242477][_0xebca('0x5')]));break;}}}}})[_0xebca('0x30')](function(){if(_0x5a4de4==='leave'){var _0x4a8919=_[_0xebca('0x19')](_0x41d17e['ChatInteractions'],'id');return _0x41d17e[_0xebca('0x4c')](_0x4a8919)[_0xebca('0x30')](function(){for(var _0x45d5c7=0x0;_0x45d5c7<_0x4a8919[_0xebca('0x1f')];_0x45d5c7+=0x1){_0x952255['emit'](_0xebca('0x4d'),{'ChatInteractionId':Number(_0x4a8919[_0x45d5c7]),'UserId':Number(_0x41d17e['id'])});}});}})[_0xebca('0x30')](function(){if(_0x5a4de4===_0xebca('0x4e')){var _0x46485a=_[_0xebca('0x19')](_0x41d17e['MailInteractions'],'id');return _0x41d17e[_0xebca('0x4f')](_0x46485a)['then'](function(){for(var _0x3a4a11=0x0;_0x3a4a11<_0x46485a[_0xebca('0x1f')];_0x3a4a11+=0x1){_0x952255[_0xebca('0x50')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x46485a[_0x3a4a11]),'UserId':Number(_0x41d17e['id'])});}});}})[_0xebca('0x30')](function(){if(_0x5a4de4==='leave'){var _0x1c7004=_[_0xebca('0x19')](_0x41d17e[_0xebca('0x29')],'id');return _0x41d17e[_0xebca('0x51')](_0x1c7004)['then'](function(){for(var _0xee108c=0x0;_0xee108c<_0x1c7004[_0xebca('0x1f')];_0xee108c+=0x1){_0x952255[_0xebca('0x50')](_0xebca('0x52'),{'FaxInteractionId':Number(_0x1c7004[_0xee108c]),'UserId':Number(_0x41d17e['id'])});}});}})[_0xebca('0x30')](function(){if(_0x5a4de4===_0xebca('0x4e')){var _0x450abe=_[_0xebca('0x19')](_0x41d17e[_0xebca('0x2b')],'id');return _0x41d17e[_0xebca('0x53')](_0x450abe)[_0xebca('0x30')](function(){for(var _0x13a1ee=0x0;_0x13a1ee<_0x450abe['length'];_0x13a1ee+=0x1){_0x952255[_0xebca('0x50')](_0xebca('0x54'),{'SmsInteractionId':Number(_0x450abe[_0x13a1ee]),'UserId':Number(_0x41d17e['id'])});}});}})['then'](function(){if(_0x5a4de4===_0xebca('0x4e')){var _0x13e5b8=_[_0xebca('0x19')](_0x41d17e[_0xebca('0x2d')],'id');return _0x41d17e[_0xebca('0x55')](_0x13e5b8)[_0xebca('0x30')](function(){for(var _0xff679=0x0;_0xff679<_0x13e5b8['length'];_0xff679+=0x1){_0x952255[_0xebca('0x50')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x13e5b8[_0xff679]),'UserId':Number(_0x41d17e['id'])});}});}})['then'](function(){if(_0x5a4de4==='leave'){var _0x2658f6=_[_0xebca('0x19')](_0x41d17e[_0xebca('0x2f')],'id');return _0x41d17e['removeWhatsappInteractions'](_0x2658f6)[_0xebca('0x30')](function(){for(var _0x4be757=0x0;_0x4be757<_0x2658f6[_0xebca('0x1f')];_0x4be757+=0x1){_0x952255['emit'](_0xebca('0x56'),{'WhatsappInteractionId':Number(_0x2658f6[_0x4be757]),'UserId':Number(_0x41d17e['id'])});}});}})['catch'](function(_0x1ede0a){_0x12758f[_0xebca('0x57')](_0x1ede0a);});}}function onDisconnect(_0x5cb46e,_0xa7ffcf){joinOrLeave(_0x5cb46e,_0xebca('0x4e'),_0xa7ffcf);}function onConnect(_0x23946a){joinOrLeave(_0x23946a,_0xebca('0x58'));}exports[_0xebca('0x59')]=function(_0x54062d){_0x54062d['on']('connection',function(_0x15fb36){_0x15fb36[_0xebca('0x5a')](0x0);_0x15fb36[_0xebca('0x5b')]=_0x15fb36[_0xebca('0x5c')]['connection'][_0xebca('0x5d')]+':'+_0x15fb36[_0xebca('0x5c')][_0xebca('0x5e')]['remotePort'];_0x15fb36['connectedAt']=new Date();_0x15fb36['log']=function(_0x1843ce){console[_0xebca('0x57')](_0xebca('0x5f')+_0x15fb36['nsp'][_0xebca('0x5')]+'['+_0x15fb36[_0xebca('0x5b')]+']',_0x1843ce);};_0x15fb36['on'](_0xebca('0x60'),function(){onDisconnect(_0x15fb36,_0x54062d);_0x15fb36['log'](_0xebca('0x61'));});onConnect(_0x15fb36);_0x15fb36[_0xebca('0x57')]('CONNECTED');});}; \ No newline at end of file +var _0x81c6=['format','%s:queue:%s','user:%s','handshake','query','find','userProfileId','ChatInteraction','MailInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','hasOwnProperty','include','VoiceQueue','ChatQueue','push','SmsQueue','voice:outbound','FaxQueues','FaxQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','all','length','voice','chat','sms','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','ChatInteractions','removeChatInteractions','emit','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','leave','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','catch','log','join','default','connection','setMaxListeners','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','address','DISCONNECTED','CONNECTED','util','name','Agents','User','role','agent','telephone','ivr','findOne','autoAssociation','VoiceQueues','ChatQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Telephones','Trunks','IvrCampaigns','findAll','UserProfileResource','resourceId','then','map','where','Campaign','type'];(function(_0x372412,_0x564753){var _0x392a05=function(_0x25778a){while(--_0x25778a){_0x372412['push'](_0x372412['shift']());}};_0x392a05(++_0x564753);}(_0x81c6,0x1d5));var _0x681c=function(_0x14477e,_0x44d4da){_0x14477e=_0x14477e-0x0;var _0x5d4a05=_0x81c6[_0x14477e];return _0x5d4a05;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x681c('0x1')],'include':[{'as':_0x681c('0x2'),'model':db[_0x681c('0x3')],'attributes':['id','name',_0x681c('0x4')],'raw':!![],'where':{'role':_0x681c('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x681c('0x1')],'where':{'role':_0x681c('0x6')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x681c('0x1')],'where':{'role':_0x681c('0x5')}};var queryCampaigns={'raw':!![],'attributes':['id','name','type'],'where':{'type':_0x681c('0x7')}};function getAssociatedResources(_0x3fac39,_0x7f090a,_0x5de78e){return db['UserProfileSection'][_0x681c('0x8')]({'where':{'name':_0x3fac39,'userProfileId':_0x7f090a},'raw':!![]})['then'](function(_0x82b6ad){if(_0x82b6ad){if(_0x82b6ad[_0x681c('0x9')]){switch(_0x3fac39){case _0x681c('0xa'):case _0x681c('0xb'):case'FaxQueues':case'SmsQueues':case _0x681c('0xc'):case _0x681c('0xd'):case _0x681c('0xe'):return db[_0x5de78e]['findAll'](queryQueues);case _0x681c('0xf'):return db[_0x5de78e]['findAll'](queryTelephones);case _0x681c('0x10'):return db[_0x5de78e]['findAll'](queryTrunks);case _0x681c('0x11'):return db[_0x5de78e][_0x681c('0x12')](queryCampaigns);}}else{return db[_0x681c('0x13')][_0x681c('0x12')]({'attributes':[_0x681c('0x14')],'where':{'sectionId':_0x82b6ad['id']},'raw':!![]})[_0x681c('0x15')](function(_0x50a4ec){if(_0x50a4ec){var _0x2b0939={'where':{'id':_[_0x681c('0x16')](_0x50a4ec,_0x681c('0x14'))},'raw':!![]};switch(_0x5de78e){case _0x681c('0x3'):_0x2b0939[_0x681c('0x17')][_0x681c('0x4')]='telephone';break;case _0x681c('0x18'):_0x2b0939[_0x681c('0x17')][_0x681c('0x19')]=_0x681c('0x7');break;}return db[_0x5de78e]['findAll'](_0x2b0939);}else{return[];}});}}else{return[];}})[_0x681c('0x15')](function(_0x24a0ce){return _0x24a0ce;});}function joinOrLeaveQueues(_0x54d27f,_0x161948,_0x4c22c7,_0x46cafc){_0x54d27f[_0x161948](util[_0x681c('0x1a')](_0x681c('0x1b'),_0x4c22c7,_0x46cafc[_0x681c('0x1')]));if(_0x46cafc[_0x681c('0x2')]){for(var _0x51d626=0x0;_0x51d626<_0x46cafc['Agents']['length'];_0x51d626+=0x1){_0x54d27f[_0x161948](util[_0x681c('0x1a')](_0x681c('0x1c'),_0x46cafc[_0x681c('0x2')][_0x51d626][_0x681c('0x1')]));}}}function joinOrLeave(_0x2ec29f,_0x29f3fa,_0x415a0a){var _0x3d0297;if(_0x2ec29f[_0x681c('0x1d')][_0x681c('0x1e')]['id']){db[_0x681c('0x3')][_0x681c('0x1f')]({'attributes':['id',_0x681c('0x1'),_0x681c('0x4'),_0x681c('0x20')],'where':{'id':_0x2ec29f[_0x681c('0x1d')]['query']['id']},'include':[{'model':db[_0x681c('0x21')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x681c('0x22')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x681c('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x681c('0x24')],'as':_0x681c('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x681c('0x26')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x681c('0x27')],'as':_0x681c('0x28'),'attributes':['id'],'raw':!![]}]})[_0x681c('0x15')](function(_0x936fce){if(_0x936fce){_0x3d0297=_0x936fce;_0x2ec29f[_0x29f3fa](util[_0x681c('0x1a')](_0x681c('0x1c'),_0x936fce[_0x681c('0x1')]));var _0x50e6d2=[];switch(_0x936fce[_0x681c('0x4')]){case _0x681c('0x29'):_0x2ec29f[_0x29f3fa](_0x681c('0x2a'));_0x2ec29f[_0x29f3fa]('voice:outbound');if(queryQueues[_0x681c('0x2b')](_0x681c('0x2c'))){delete queryQueues[_0x681c('0x2c')];}_0x50e6d2['push'](db[_0x681c('0x2d')]['findAll'](queryQueues));_0x50e6d2['push'](db[_0x681c('0x2e')][_0x681c('0x12')](queryQueues));_0x50e6d2[_0x681c('0x2f')](db['FaxQueue'][_0x681c('0x12')](queryQueues));_0x50e6d2['push'](db[_0x681c('0x30')]['findAll'](queryQueues));_0x50e6d2['push'](db['MailQueue'][_0x681c('0x12')](queryQueues));_0x50e6d2[_0x681c('0x2f')](db['OpenchannelQueue'][_0x681c('0x12')](queryQueues));_0x50e6d2['push'](db['WhatsappQueue'][_0x681c('0x12')](queryQueues));_0x50e6d2['push'](db[_0x681c('0x3')][_0x681c('0x12')](queryTelephones));_0x50e6d2[_0x681c('0x2f')](db['Trunk']['findAll'](queryTrunks));_0x50e6d2[_0x681c('0x2f')](db[_0x681c('0x18')]['findAll'](queryCampaigns));_0x50e6d2[_0x681c('0x2f')](db[_0x681c('0x3')][_0x681c('0x12')](queryAgents));break;case'user':_0x2ec29f[_0x29f3fa](_0x681c('0x2a'));_0x2ec29f[_0x29f3fa](_0x681c('0x31'));_0x50e6d2['push'](getAssociatedResources(_0x681c('0xa'),_0x936fce[_0x681c('0x20')],_0x681c('0x2d')));_0x50e6d2[_0x681c('0x2f')](getAssociatedResources(_0x681c('0xb'),_0x936fce['userProfileId'],'ChatQueue'));_0x50e6d2[_0x681c('0x2f')](getAssociatedResources(_0x681c('0x32'),_0x936fce['userProfileId'],_0x681c('0x33')));_0x50e6d2[_0x681c('0x2f')](getAssociatedResources('SmsQueues',_0x936fce[_0x681c('0x20')],_0x681c('0x30')));_0x50e6d2[_0x681c('0x2f')](getAssociatedResources(_0x681c('0xc'),_0x936fce[_0x681c('0x20')],_0x681c('0x34')));_0x50e6d2[_0x681c('0x2f')](getAssociatedResources(_0x681c('0xd'),_0x936fce[_0x681c('0x20')],_0x681c('0x35')));_0x50e6d2['push'](getAssociatedResources(_0x681c('0xe'),_0x936fce[_0x681c('0x20')],_0x681c('0x36')));_0x50e6d2[_0x681c('0x2f')](getAssociatedResources(_0x681c('0xf'),_0x936fce[_0x681c('0x20')],_0x681c('0x3')));_0x50e6d2[_0x681c('0x2f')](getAssociatedResources(_0x681c('0x10'),_0x936fce[_0x681c('0x20')],_0x681c('0x37')));_0x50e6d2[_0x681c('0x2f')](getAssociatedResources('IvrCampaigns',_0x936fce[_0x681c('0x20')],'Campaign'));_0x50e6d2['push'](db[_0x681c('0x3')][_0x681c('0x12')](queryAgents));break;case _0x681c('0x5'):_0x2ec29f[_0x29f3fa](_0x681c('0x2a'));_0x2ec29f[_0x29f3fa]('voice:outbound');_0x50e6d2[_0x681c('0x2f')](_0x936fce['getVoiceQueues']({'attributes':['id','name']}));_0x50e6d2[_0x681c('0x2f')](_0x936fce[_0x681c('0x38')]({'attributes':['id',_0x681c('0x1')]}));_0x50e6d2[_0x681c('0x2f')](_0x936fce[_0x681c('0x39')]({'attributes':['id',_0x681c('0x1')]}));_0x50e6d2['push'](_0x936fce[_0x681c('0x3a')]({'attributes':['id',_0x681c('0x1')]}));_0x50e6d2['push'](_0x936fce['getMailQueues']({'attributes':['id',_0x681c('0x1')]}));_0x50e6d2['push'](_0x936fce[_0x681c('0x3b')]({'attributes':['id','name']}));_0x50e6d2['push'](_0x936fce['getWhatsappQueues']({'attributes':['id',_0x681c('0x1')]}));break;}return BPromise[_0x681c('0x3c')](_0x50e6d2);}})[_0x681c('0x15')](function(_0x573250){if(_0x573250&&_0x573250[_0x681c('0x3d')]){for(var _0x2e940b=0x0;_0x2e940b<_0x573250['length'];_0x2e940b+=0x1){for(var _0x449c8b=0x0;_0x449c8b<_0x573250[_0x2e940b][_0x681c('0x3d')];_0x449c8b+=0x1){switch(_0x2e940b){case 0x0:joinOrLeaveQueues(_0x2ec29f,_0x29f3fa,_0x681c('0x3e'),_0x573250[_0x2e940b][_0x449c8b]);break;case 0x1:joinOrLeaveQueues(_0x2ec29f,_0x29f3fa,_0x681c('0x3f'),_0x573250[_0x2e940b][_0x449c8b]);break;case 0x2:joinOrLeaveQueues(_0x2ec29f,_0x29f3fa,'fax',_0x573250[_0x2e940b][_0x449c8b]);break;case 0x3:joinOrLeaveQueues(_0x2ec29f,_0x29f3fa,_0x681c('0x40'),_0x573250[_0x2e940b][_0x449c8b]);break;case 0x4:joinOrLeaveQueues(_0x2ec29f,_0x29f3fa,'mail',_0x573250[_0x2e940b][_0x449c8b]);break;case 0x5:joinOrLeaveQueues(_0x2ec29f,_0x29f3fa,_0x681c('0x41'),_0x573250[_0x2e940b][_0x449c8b]);break;case 0x6:joinOrLeaveQueues(_0x2ec29f,_0x29f3fa,_0x681c('0x42'),_0x573250[_0x2e940b][_0x449c8b]);break;case 0x7:if(_0x3d0297[_0x681c('0x4')]!=='agent')_0x2ec29f[_0x29f3fa](util[_0x681c('0x1a')](_0x681c('0x43'),_0x573250[_0x2e940b][_0x449c8b][_0x681c('0x1')]));break;case 0x8:if(_0x3d0297[_0x681c('0x4')]!==_0x681c('0x5'))_0x2ec29f[_0x29f3fa](util[_0x681c('0x1a')](_0x681c('0x44'),_0x573250[_0x2e940b][_0x449c8b][_0x681c('0x1')]));break;case 0x9:if(_0x3d0297[_0x681c('0x4')]!==_0x681c('0x5'))_0x2ec29f[_0x29f3fa](util[_0x681c('0x1a')](_0x681c('0x45'),_0x573250[_0x2e940b][_0x449c8b][_0x681c('0x19')],_0x573250[_0x2e940b][_0x449c8b][_0x681c('0x1')]));break;case 0xa:_0x2ec29f[_0x29f3fa](util[_0x681c('0x1a')]('user:%s',_0x573250[_0x2e940b][_0x449c8b][_0x681c('0x1')]));break;}}}}})[_0x681c('0x15')](function(){if(_0x29f3fa==='leave'){var _0x340307=_['map'](_0x3d0297[_0x681c('0x46')],'id');return _0x3d0297[_0x681c('0x47')](_0x340307)[_0x681c('0x15')](function(){for(var _0x48ca34=0x0;_0x48ca34<_0x340307[_0x681c('0x3d')];_0x48ca34+=0x1){_0x415a0a[_0x681c('0x48')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x340307[_0x48ca34]),'UserId':Number(_0x3d0297['id'])});}});}})[_0x681c('0x15')](function(){if(_0x29f3fa==='leave'){var _0x208c91=_['map'](_0x3d0297[_0x681c('0x49')],'id');return _0x3d0297[_0x681c('0x4a')](_0x208c91)['then'](function(){for(var _0x34b6be=0x0;_0x34b6be<_0x208c91['length'];_0x34b6be+=0x1){_0x415a0a['emit'](_0x681c('0x4b'),{'MailInteractionId':Number(_0x208c91[_0x34b6be]),'UserId':Number(_0x3d0297['id'])});}});}})[_0x681c('0x15')](function(){if(_0x29f3fa===_0x681c('0x4c')){var _0x538b19=_[_0x681c('0x16')](_0x3d0297['FaxInteractions'],'id');return _0x3d0297[_0x681c('0x4d')](_0x538b19)['then'](function(){for(var _0x563b65=0x0;_0x563b65<_0x538b19[_0x681c('0x3d')];_0x563b65+=0x1){_0x415a0a[_0x681c('0x48')](_0x681c('0x4e'),{'FaxInteractionId':Number(_0x538b19[_0x563b65]),'UserId':Number(_0x3d0297['id'])});}});}})[_0x681c('0x15')](function(){if(_0x29f3fa==='leave'){var _0x2465b2=_[_0x681c('0x16')](_0x3d0297[_0x681c('0x25')],'id');return _0x3d0297[_0x681c('0x4f')](_0x2465b2)[_0x681c('0x15')](function(){for(var _0x5db1f4=0x0;_0x5db1f4<_0x2465b2[_0x681c('0x3d')];_0x5db1f4+=0x1){_0x415a0a[_0x681c('0x48')](_0x681c('0x50'),{'SmsInteractionId':Number(_0x2465b2[_0x5db1f4]),'UserId':Number(_0x3d0297['id'])});}});}})[_0x681c('0x15')](function(){if(_0x29f3fa===_0x681c('0x4c')){var _0x2d4876=_[_0x681c('0x16')](_0x3d0297[_0x681c('0x51')],'id');return _0x3d0297[_0x681c('0x52')](_0x2d4876)[_0x681c('0x15')](function(){for(var _0x67fbbd=0x0;_0x67fbbd<_0x2d4876[_0x681c('0x3d')];_0x67fbbd+=0x1){_0x415a0a['emit'](_0x681c('0x53'),{'OpenchannelInteractionId':Number(_0x2d4876[_0x67fbbd]),'UserId':Number(_0x3d0297['id'])});}});}})[_0x681c('0x15')](function(){if(_0x29f3fa===_0x681c('0x4c')){var _0x2fae66=_[_0x681c('0x16')](_0x3d0297['WhatsappInteractions'],'id');return _0x3d0297[_0x681c('0x54')](_0x2fae66)['then'](function(){for(var _0x4837e5=0x0;_0x4837e5<_0x2fae66[_0x681c('0x3d')];_0x4837e5+=0x1){_0x415a0a[_0x681c('0x48')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x2fae66[_0x4837e5]),'UserId':Number(_0x3d0297['id'])});}});}})[_0x681c('0x55')](function(_0xe07d4){_0x2ec29f[_0x681c('0x56')](_0xe07d4);});}}function onDisconnect(_0x3ec7fe,_0x4904c3){joinOrLeave(_0x3ec7fe,_0x681c('0x4c'),_0x4904c3);}function onConnect(_0x1f8bb4){joinOrLeave(_0x1f8bb4,_0x681c('0x57'));}exports[_0x681c('0x58')]=function(_0x5d3b42){_0x5d3b42['on'](_0x681c('0x59'),function(_0x145441){_0x145441[_0x681c('0x5a')](0x0);_0x145441['address']=_0x145441['request'][_0x681c('0x59')][_0x681c('0x5b')]+':'+_0x145441['request'][_0x681c('0x59')][_0x681c('0x5c')];_0x145441[_0x681c('0x5d')]=new Date();_0x145441[_0x681c('0x56')]=function(_0xde562e){console['log'](_0x681c('0x5e')+_0x145441[_0x681c('0x5f')][_0x681c('0x1')]+'['+_0x145441[_0x681c('0x60')]+']',_0xde562e);};_0x145441['on']('disconnect',function(){onDisconnect(_0x145441,_0x5d3b42);_0x145441[_0x681c('0x56')](_0x681c('0x61'));});onConnect(_0x145441);_0x145441[_0x681c('0x56')](_0x681c('0x62'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 634638e..03bca81 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 _0xb77b=['Mail','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','then','info','Trigger,\x20%s','error','code','EventManager','get','channel','motionChannel','event','direction','resolve','ContactId','sequelize','query','Sequelize','QueryTypes','SELECT','contact','UserId','undefined','interface','SIP/%s','name','agent','incomingmessage','outgoingmessage','catch','AfterCreateMessage','opened','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','format','AfterCreate','changed','closed','substatus','AfterUpdate','User','fullname','length','hasOwnProperty','model','hook','condition','util','../../mysqldb','jayson/promise','../logger','triggers','client','Chat','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','MailInteraction'];(function(_0x38ff70,_0xb72f46){var _0x1c9cf3=function(_0x526e9c){while(--_0x526e9c){_0x38ff70['push'](_0x38ff70['shift']());}};_0x1c9cf3(++_0xb72f46);}(_0xb77b,0x152));var _0xbb77=function(_0x5ca353,_0x21eb37){_0x5ca353=_0x5ca353-0x0;var _0x4f2fe5=_0xb77b[_0x5ca353];return _0x4f2fe5;};'use strict';var util=require(_0xbb77('0x0'));var db=require(_0xbb77('0x1'))['db'];var jayson=require(_0xbb77('0x2'));var logger=require(_0xbb77('0x3'))(_0xbb77('0x4'));var client=jayson[_0xbb77('0x5')]['http']({'port':0x232a});var triggers=[{'channel':_0xbb77('0x6'),'model':'ChatInteraction','event':_0xbb77('0x7'),'condition':_0xbb77('0x8'),'callback':afterCreate},{'channel':_0xbb77('0x6'),'model':'ChatInteraction','event':_0xbb77('0x9'),'condition':_0xbb77('0xa'),'callback':afterUpdate},{'channel':_0xbb77('0x6'),'model':_0xbb77('0xb'),'event':_0xbb77('0x7'),'condition':_0xbb77('0xc'),'callback':afterCreateMessage},{'channel':_0xbb77('0xd'),'model':'SmsInteraction','event':_0xbb77('0x7'),'condition':_0xbb77('0x8'),'callback':afterCreate},{'channel':'Sms','model':_0xbb77('0xe'),'event':_0xbb77('0x9'),'condition':_0xbb77('0xa'),'callback':afterUpdate},{'channel':_0xbb77('0xd'),'model':'SmsMessage','event':'afterCreate','condition':_0xbb77('0xc'),'callback':afterCreateMessage},{'channel':_0xbb77('0xf'),'model':_0xbb77('0x10'),'event':_0xbb77('0x7'),'condition':_0xbb77('0x8'),'callback':afterCreate},{'channel':_0xbb77('0xf'),'model':_0xbb77('0x10'),'event':'afterUpdate','condition':_0xbb77('0xa'),'callback':afterUpdate},{'channel':_0xbb77('0xf'),'model':_0xbb77('0x11'),'event':_0xbb77('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xbb77('0x12'),'model':_0xbb77('0x13'),'event':'afterCreate','condition':_0xbb77('0x8'),'callback':afterCreate},{'channel':_0xbb77('0x12'),'model':_0xbb77('0x13'),'event':_0xbb77('0x9'),'condition':_0xbb77('0xa'),'callback':afterUpdate},{'channel':_0xbb77('0x12'),'model':_0xbb77('0x14'),'event':_0xbb77('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Mail','model':_0xbb77('0x15'),'event':'afterCreate','condition':_0xbb77('0x8'),'callback':afterCreate},{'channel':'Mail','model':_0xbb77('0x15'),'event':'afterUpdate','condition':_0xbb77('0xa'),'callback':afterUpdate},{'channel':_0xbb77('0x16'),'model':_0xbb77('0x17'),'event':'afterCreate','condition':_0xbb77('0xc'),'callback':afterCreateMessage},{'channel':_0xbb77('0x18'),'model':_0xbb77('0x19'),'event':_0xbb77('0x7'),'condition':_0xbb77('0x8'),'callback':afterCreate},{'channel':_0xbb77('0x18'),'model':_0xbb77('0x19'),'event':'afterUpdate','condition':_0xbb77('0xa'),'callback':afterUpdate},{'channel':_0xbb77('0x18'),'model':_0xbb77('0x1a'),'event':_0xbb77('0x7'),'condition':_0xbb77('0xc'),'callback':afterCreateMessage}];function request(_0x26ad3a){return client[_0xbb77('0x1b')]('EventManager',_0x26ad3a)[_0xbb77('0x1c')](function(_0x2682ef){logger[_0xbb77('0x1d')](_0xbb77('0x1e'),'EventManager',_0x2682ef);if(_0x2682ef[_0xbb77('0x1f')]){if(_0x2682ef[_0xbb77('0x1f')][_0xbb77('0x20')]===0x1f4){logger[_0xbb77('0x1f')](_0xbb77('0x1e'),_0xbb77('0x21'),_0x2682ef['error']);}}})['catch'](function(_0x46211f){logger['error'](_0xbb77('0x1e'),_0xbb77('0x21'),_0x46211f);});}function afterCreateMessage(_0xac4ed){return function(_0xcc96be){_0xcc96be=_0xcc96be[_0xbb77('0x22')]({'plain':!![]});_0xcc96be[_0xbb77('0x23')]=_0xac4ed;_0xcc96be[_0xbb77('0x24')]=_0xac4ed;_0xcc96be[_0xbb77('0x25')]=_0xcc96be[_0xbb77('0x26')];Promise[_0xbb77('0x27')]()[_0xbb77('0x1c')](function(){if(typeof _0xcc96be[_0xbb77('0x28')]==='undefined')return null;var _0x5d0bb7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xcc96be['ContactId'];return db[_0xbb77('0x29')][_0xbb77('0x2a')](_0x5d0bb7,{'type':db[_0xbb77('0x2b')][_0xbb77('0x2c')][_0xbb77('0x2d')],'raw':!![]});})[_0xbb77('0x1c')](function(_0x4e77f5){if(_0x4e77f5){_0xcc96be[_0xbb77('0x2e')]=_0x4e77f5[0x0];}if(typeof _0xcc96be[_0xbb77('0x2f')]===_0xbb77('0x30'))return;return getAgent(_0xcc96be[_0xbb77('0x2f')]);})[_0xbb77('0x1c')](function(_0x178f92){if(_0x178f92){_0xcc96be[_0xbb77('0x31')]=util['format'](_0xbb77('0x32'),_0x178f92[_0xbb77('0x33')]);_0xcc96be[_0xbb77('0x34')]=_0x178f92;_0xcc96be['channel']=_0xac4ed;return request({'event':_0xbb77('0x35'),'message':_0xcc96be});}else{return request({'event':_0xbb77('0x36'),'message':_0xcc96be});}})[_0xbb77('0x37')](function(_0x1767e2){logger['error']('Trigger,\x20%s',_0xbb77('0x38'),_0x1767e2);});};}function afterCreate(_0x2248fd,_0x49c951){return function(_0x123942){_0x123942=_0x123942['get']({'plain':!![]});_0x123942['channel']=_0x2248fd;_0x123942['motionChannel']=_0x2248fd;_0x123942['event']=_0xbb77('0x39');Promise[_0xbb77('0x27')]()[_0xbb77('0x1c')](function(){var _0x294a4e=_0xbb77('0x3a')+_0x123942[_0xbb77('0x28')];return db[_0xbb77('0x29')]['query'](_0x294a4e,{'type':db['Sequelize']['QueryTypes'][_0xbb77('0x2d')],'raw':!![]});})[_0xbb77('0x1c')](function(_0x87e54c){if(_0x87e54c){_0x123942[_0xbb77('0x2e')]=_0x87e54c[0x0];}if(typeof _0x123942['UserId']===_0xbb77('0x30'))return;return getAgent(_0x123942[_0xbb77('0x2f')]);})['then'](function(_0x161e57){if(_0x161e57){_0x123942[_0xbb77('0x31')]=util[_0xbb77('0x3b')](_0xbb77('0x32'),_0x161e57['name']);_0x123942[_0xbb77('0x34')]=_0x161e57;}return request({'event':_0x49c951,'message':_0x123942});})[_0xbb77('0x37')](function(_0x1e647c){logger[_0xbb77('0x1f')](_0xbb77('0x1e'),_0xbb77('0x3c'),_0x1e647c);});};}function afterUpdate(_0x5928d6){return function(_0x5a5e5a){var _0x416f06=_0x5a5e5a[_0xbb77('0x3d')](_0xbb77('0x3e'))&&_0x5a5e5a[_0xbb77('0x3e')];var _0x444e0e=_0x5a5e5a[_0xbb77('0x3d')](_0xbb77('0x3f'));if(_0x416f06||_0x444e0e){var _0x3df483=_0x416f06?_0xbb77('0xa'):_0xbb77('0x3f');var _0x57a5dd=_0x5a5e5a[_0xbb77('0x22')]({'plain':!![]});_0x57a5dd['channel']=_0x5928d6;_0x57a5dd['motionChannel']=_0x5928d6;_0x57a5dd['event']=_0x416f06?'closed':'substatus';var _0xffa1e4=_0xbb77('0x3a')+_0x57a5dd[_0xbb77('0x28')];return db[_0xbb77('0x29')]['query'](_0xffa1e4,{'type':db[_0xbb77('0x2b')]['QueryTypes']['SELECT'],'raw':!![]})[_0xbb77('0x1c')](function(_0x98715b){if(_0x98715b){_0x57a5dd[_0xbb77('0x2e')]=_0x98715b[0x0];}if(typeof _0x57a5dd[_0xbb77('0x2f')]==='undefined')return;return getAgent(_0x57a5dd['UserId']);})[_0xbb77('0x1c')](function(_0x281ff5){if(_0x281ff5){_0x57a5dd[_0xbb77('0x31')]=util['format']('SIP/%s',_0x281ff5['name']);_0x57a5dd[_0xbb77('0x34')]=_0x281ff5;}return request({'event':_0x3df483,'message':_0x57a5dd});})[_0xbb77('0x37')](function(_0x5af250){logger[_0xbb77('0x1f')](_0xbb77('0x1e'),_0xbb77('0x40'),_0x5af250);});}};}function getAgent(_0x55a182){return db[_0xbb77('0x41')]['find']({'where':{'id':_0x55a182},'attributes':['id',_0xbb77('0x33'),_0xbb77('0x42'),'email','internal'],'raw':!![]})[_0xbb77('0x1c')](function(_0x2bc094){return _0x2bc094;});}exports['default']=function(){for(var _0x5afb6c=0x0;_0x5afb6c=_0x36445d[_0xa2a7('0x17')]){throw Error(_0xa2a7('0x18'));}_0x2d17ef(_0x86d641);})['catch'](function(_0x187f94){_0x37d1dc(_0x187f94);});});}; \ No newline at end of file +var _0x1271=['role','agent','User','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','bluebird','../mysqldb','./license/util','voice','mail','chat','fax','sms','whatsapp','getChannels','isValidChannel','includes','clearBlockUser','isUndefined','blockedAt','getLicense'];(function(_0x3fa55e,_0x22e09e){var _0xc1c5bc=function(_0x5476a2){while(--_0x5476a2){_0x3fa55e['push'](_0x3fa55e['shift']());}};_0xc1c5bc(++_0x22e09e);}(_0x1271,0xbf));var _0x1127=function(_0x5ad5fe,_0x3c71d8){_0x5ad5fe=_0x5ad5fe-0x0;var _0x42cdb5=_0x1271[_0x5ad5fe];return _0x42cdb5;};'use strict';var _=require('lodash');var BPromise=require(_0x1127('0x0'));var db=require(_0x1127('0x1'))['db'];var util=require(_0x1127('0x2'));var channels=[_0x1127('0x3'),_0x1127('0x4'),_0x1127('0x5'),_0x1127('0x6'),_0x1127('0x7'),_0x1127('0x8'),'openchannel'];exports[_0x1127('0x9')]=function(){return channels;};exports[_0x1127('0xa')]=function(_0x29858b){_0x29858b=_0x29858b['toLowerCase']();return _[_0x1127('0xb')](channels,_0x29858b);};exports[_0x1127('0xc')]=function(_0x4a5922,_0x1c9899,_0x5e2e6b,_0x469546){var _0x243dbf={'loginAttempts':_0x1c9899,'blocked':_0x5e2e6b};if(!_[_0x1127('0xd')](_0x469546)){_0x243dbf[_0x1127('0xe')]=_0x469546;}return _0x4a5922['updateAttributes'](_0x243dbf);};exports[_0x1127('0xf')]=function(_0x34c0d5){return new BPromise(function(_0x27880e,_0x1c7b34){var _0x145eb1=0x0;if(_0x34c0d5[_0x1127('0x10')]!==_0x1127('0x11')){_0x27880e(_0x34c0d5);}db[_0x1127('0x12')]['count']({'where':{'role':_0x1127('0x11'),'online':!![],'id':{'$ne':_0x34c0d5['id']}}})[_0x1127('0x13')](function(_0x11c69f){_0x145eb1=_0x11c69f;return util[_0x1127('0xf')]();})[_0x1127('0x13')](function(_0x1f97be){if(_0x1f97be&&_0x1f97be[_0x1127('0x14')]&&_0x145eb1>=_0x1f97be[_0x1127('0x14')]){throw Error(_0x1127('0x15'));}_0x27880e(_0x34c0d5);})[_0x1127('0x16')](function(_0x28d3ef){_0x1c7b34(_0x28d3ef);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 96a57c4..6b34739 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf1b1=['status','render','json','404'];(function(_0x57168a,_0x49c3ae){var _0x5b82b9=function(_0x1270a1){while(--_0x1270a1){_0x57168a['push'](_0x57168a['shift']());}};_0x5b82b9(++_0x49c3ae);}(_0xf1b1,0x197));var _0x1f1b=function(_0x5e93f3,_0x57e9c3){_0x5e93f3=_0x5e93f3-0x0;var _0x183e24=_0xf1b1[_0x5e93f3];return _0x183e24;};'use strict';module['exports'][0x194]=function pageNotFound(_0x36c6b6,_0x38ba22){var _0x26cf0a=_0x1f1b('0x0');var _0x391573=0x194;var _0x4ac963={'status':_0x391573};_0x38ba22['status'](_0x4ac963[_0x1f1b('0x1')]);_0x38ba22[_0x1f1b('0x2')](_0x26cf0a,{},function(_0x4d01d2,_0xde109f){if(_0x4d01d2){return _0x38ba22[_0x1f1b('0x1')](_0x4ac963[_0x1f1b('0x1')])[_0x1f1b('0x3')](_0x4ac963);}_0x38ba22['send'](_0xde109f);});}; \ No newline at end of file +var _0xc57d=['status','404'];(function(_0x21fded,_0x203183){var _0x5927de=function(_0x1e5762){while(--_0x1e5762){_0x21fded['push'](_0x21fded['shift']());}};_0x5927de(++_0x203183);}(_0xc57d,0x1c1));var _0xdc57=function(_0xc10f8a,_0x3b4864){_0xc10f8a=_0xc10f8a-0x0;var _0x236343=_0xc57d[_0xc10f8a];return _0x236343;};'use strict';module['exports'][0x194]=function pageNotFound(_0x5b66cf,_0x8753fc){var _0x251aba=_0xdc57('0x0');var _0x1ba3ac=0x194;var _0x482425={'status':_0x1ba3ac};_0x8753fc[_0xdc57('0x1')](_0x482425[_0xdc57('0x1')]);_0x8753fc['render'](_0x251aba,{},function(_0x27ffdc,_0x486019){if(_0x27ffdc){return _0x8753fc[_0xdc57('0x1')](_0x482425[_0xdc57('0x1')])['json'](_0x482425);}_0x8753fc['send'](_0x486019);});}; \ No newline at end of file diff --git a/server/migrations/2.5.37.js b/server/migrations/2.5.37.js index be0c0fb..0dea0f6 100644 --- a/server/migrations/2.5.37.js +++ b/server/migrations/2.5.37.js @@ -163,20 +163,8 @@ module.exports = { type: Sequelize.BOOLEAN, defaultValue: true }); - - migration.addColumn('settings', 'adSsoEnabled', { - type: Sequelize.BOOLEAN, - defaultValue: false - }); // END settings - // START users - migration.addColumn('users', 'adSsoEnabled', { - type: Sequelize.BOOLEAN, - defaultValue: false - }); - // END users - // START whatsapp_accounts migration.addColumn('whatsapp_accounts', 'baseUrl', { type: Sequelize.STRING diff --git a/server/migrations/2.5.38.js b/server/migrations/2.5.38.js new file mode 100644 index 0000000..56f9d73 --- /dev/null +++ b/server/migrations/2.5.38.js @@ -0,0 +1,179 @@ +'use strict'; + +var BPromise = require('bluebird'); +var util = require('util'); + +var logger = require('../config/logger')('migration'); + +var Sequence = function() {}; + +Sequence.prototype.enqueue = function(fn) { + this.tail = this.tail ? this.tail.finally(fn) : fn(); +}; + +var Migration = function(queryInterface) { + this.queryInterface = queryInterface; + this.sequence = new Sequence(); +}; + +Migration.prototype.changeColumn = function(table, column, type) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .changeColumn(table, column, type) + .then(function() { + logger.info('Changed column %s in table %s', column, table); + }) + .catch(function(err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.addColumn = function(table, column, type) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .addColumn(table, column, type) + .then(function() { + logger.info('Added column %s to %s', column, table); + }) + .catch(function(err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.dropTable = function(table) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .dropTable(table, { + force: true + }) + .then(function() { + logger.info('table dropped %s', table); + }) + .catch(function(err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.addIndex = function(table, column, indexName) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .addIndex(table, column, { + indexName: indexName + }) + .then(function() { + logger.info('addIndex %s %s %s', table, column.join(','), indexName); + }) + .catch(function(err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.removeIndex = function(table, indexName) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .removeIndex(table, indexName) + .then(function() { + logger.info('removeIndex %s %s', table, indexName); + }) + .catch(function(err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.query = function(sql) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface.sequelize + .query(sql) + .then(function() { + logger.info('query %s', sql); + }) + .catch(function(err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.removeColumn = function(table, column) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .removeColumn(table, column) + .then(function() { + logger.info('Removed column %s from %s', column, table); + }) + .catch(function(err) { + logger.info( + util.inspect(err, { + showHidden: false, + depth: null + }) + ); + }); + }); +}; + +Migration.prototype.renameColumn = function(table, oldColumn, newColumn) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .renameColumn(table, oldColumn, newColumn) + .then(function() { + logger.info('Renamed column from %s to %s on %s', oldColumn, newColumn, table); + }) + .catch(function(err) { + logger.info( + util.inspect(err, { + showHidden: false, + depth: null + }) + ); + }); + }); +}; + +Migration.prototype.final = function(resolve) { + this.sequence.enqueue(function() { + return resolve(); + }); +}; + +module.exports = { + up: function(queryInterface, Sequelize) { + return new BPromise(function(resolve) { + var migration = new Migration(queryInterface); + + // START settings + migration.addColumn('settings', 'adSsoEnabled', { + type: Sequelize.BOOLEAN, + defaultValue: false + }); + // END settings + + // START users + migration.addColumn('users', 'adSsoEnabled', { + type: Sequelize.BOOLEAN, + defaultValue: false + }); + // END users + + // START FINAL + migration.final(resolve); + // END FINAL + }); + }, + + down: function(queryInterface, Sequelize) { + // var migration = new Migration(queryInterface); + } +}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 6056d79..914bad0 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa75b=['../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/tag/tag.model','Template','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticExtractedReport','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskField','../api/intZohoAccount/intZohoAccount.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Integration','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.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','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','hasMany','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','UserNotifications','SenderId','UserProfile','belongsToMany','Groups','Contacts','Lists','user_has_teams','MailInteraction','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','UserVoicePrefix','MailQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','user_has_chat_websites','FaxAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','user_has_square_projects','VoiceChanSpy','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sound','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','QueueCalls','VoiceAgentReport','AgentReports','uniqueid','Contact','ContactId','MailAccount','MailAccountId','Imap','Smtp','Dispositions','Answers','Interactions','MailApplication','List','mandatoryDispositionPauseId','Teams','MailInteractionId','Account','Owner','Tag','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachment','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','MailQueueReport','ListId','Items','FaxAccountId','Exntensions','Agents','user_has_fax_accounts','FaxQueue','FaxInteractionId','fax_interaction_has_tags','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','OpenchannelAccountId','OpenchannelMessage','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','AttachmentId','OpenchannelQueueId','team_has_openchannel_queues','ChatProactiveAction','OpenchannelQueueReport','Agent','Queue','ChatQueueId','ChatMessage','ChatInteractionId','ChatGroupId','chat_group_has_users','CompanyId','JscriptySessionReport','Company','cm_user_has_contacts','cm_contact_has_tags','Condition','All','OneAll','AutomationAllId','Any','OneAny','Action','Actions','AutomationId','MailApplications','ChatApplications','FaxApplications','AnalyticDefaultReport','Mohs','chat_interaction_has_tags','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','CustomReportId','Fields','DefaultReportId','AnalyticMetric','MetricId','AccountId','Subjects','SubjectId','Descriptions','FieldId','Subject','Description','Field','SugarcrmAccount','Configurations','DescriptionId','VariableId','DeskAccount','DeskConfiguration','int_desk_configuration_has_tags','ZohoAccount','ZohoConfiguration','ZendeskConfiguration','int_zendesk_configuration_has_tags','VtigerAccount','VtigerField','ServicenowConfiguration','FreshsalesField','FromId','ToId','SessionId','ProjectId','JscriptyQuestionReport','SquareProject','team_has_mail_queues','team_has_sms_queues','team_has_whatsapp_queues','CampaignId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToAgent','ToQueue','ToAccount','FromChatWebsiteId','ToChatWebsiteId','FromFaxAccountId','FromAccount','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','CustomFields','Queues','cm_user_has_lists','userProfileId','UserProfileSections','UserProfileResource','Resources','WhatsappAccountId','WhatsappInteractionId','ToWhatsappAccountId','exports','../config/environment','jstz','determine','sequelize','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','database','username','password','sequelizeHistory','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','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','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition'];(function(_0x561771,_0x554760){var _0x54d16e=function(_0x381c1f){while(--_0x381c1f){_0x561771['push'](_0x561771['shift']());}};_0x54d16e(++_0x554760);}(_0xa75b,0x170));var _0xba75=function(_0x362940,_0x99c77d){_0x362940=_0x362940-0x0;var _0x38ae36=_0xa75b[_0x362940];return _0x38ae36;};'use strict';var config=require(_0xba75('0x0'));var Sequelize=require('sequelize');var _=require('lodash');var jstz=require(_0xba75('0x1'));var timezone=jstz[_0xba75('0x2')]();config[_0xba75('0x3')]=_[_0xba75('0x4')](config[_0xba75('0x3')],{'database':_0xba75('0x5'),'username':_0xba75('0x6'),'password':_0xba75('0x7'),'options':{'host':_0xba75('0x8'),'port':0xcea,'dialect':_0xba75('0x9'),'dialectOptions':{'charset':_0xba75('0xa')},'logging':![],'timezone':timezone[_0xba75('0xb')](),'define':{'charset':_0xba75('0xc'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0xba75('0x4')](config['sequelizeHistory'],{'database':'motion2','username':_0xba75('0x6'),'password':'xC@LL1234','options':{'host':_0xba75('0x8'),'port':0xcea,'dialect':_0xba75('0x9'),'dialectOptions':{'charset':_0xba75('0xa')},'logging':![],'timezone':timezone[_0xba75('0xb')](),'define':{'charset':_0xba75('0xc'),'collate':_0xba75('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xba75('0x3')][_0xba75('0xe')],config[_0xba75('0x3')][_0xba75('0xf')],config[_0xba75('0x3')][_0xba75('0x10')],config['sequelize']['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xba75('0x11')]['database'],config[_0xba75('0x11')][_0xba75('0xf')],config[_0xba75('0x11')][_0xba75('0x10')],config['sequelizeHistory'][_0xba75('0x12')])};db[_0xba75('0x13')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x15'));db['VoiceChanSpy']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x16'));db['VoiceContext']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x17'));db[_0xba75('0x18')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/voiceExtension/voiceExtension.model');db[_0xba75('0x19')]=db[_0xba75('0x3')]['import']('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0xba75('0x1a')]=db[_0xba75('0x3')]['import']('../api/voiceQueue/voiceQueue.model');db[_0xba75('0x1b')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x1c'));db[_0xba75('0x1d')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x1e'));db[_0xba75('0x1f')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x20'));db['VoiceMailMessage']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x21'));db[_0xba75('0x22')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x23'));db[_0xba75('0x24')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/voiceDialReport/voiceDialReport.model');db['VoiceAgentReport']=db['sequelize'][_0xba75('0x14')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0xba75('0x25')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x26'));db[_0xba75('0x27')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x28'));db[_0xba75('0x29')]=db[_0xba75('0x3')]['import']('../api/trunk/trunk.model');db[_0xba75('0x2a')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x2b'));db[_0xba75('0x2c')]=db[_0xba75('0x3')]['import'](_0xba75('0x2d'));db[_0xba75('0x2e')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x2f'));db[_0xba75('0x30')]=db[_0xba75('0x3')]['import'](_0xba75('0x31'));db[_0xba75('0x32')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x33'));db[_0xba75('0x34')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x35'));db[_0xba75('0x36')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x37'));db[_0xba75('0x38')]=db['sequelize']['import'](_0xba75('0x39'));db[_0xba75('0x3a')]=db[_0xba75('0x3')]['import'](_0xba75('0x3b'));db[_0xba75('0x3c')]=db['sequelize']['import'](_0xba75('0x3d'));db[_0xba75('0x3e')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x3f'));db['MailAccount']=db['sequelize'][_0xba75('0x14')](_0xba75('0x40'));db[_0xba75('0x41')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x42'));db[_0xba75('0x43')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x44'));db['MailInteraction']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x45'));db[_0xba75('0x46')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x47'));db['MailApplication']=db[_0xba75('0x3')]['import'](_0xba75('0x48'));db['MailQueueReport']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x49'));db[_0xba75('0x4a')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x4b'));db[_0xba75('0x4c')]=db[_0xba75('0x3')]['import'](_0xba75('0x4d'));db[_0xba75('0x4e')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x4f'));db[_0xba75('0x50')]=db['sequelize']['import']('../api/faxApplication/faxApplication.model');db['FaxInteraction']=db[_0xba75('0x3')]['import'](_0xba75('0x51'));db[_0xba75('0x52')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x53'));db['FaxQueue']=db['sequelize'][_0xba75('0x14')]('../api/faxQueue/faxQueue.model');db[_0xba75('0x54')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x55'));db[_0xba75('0x56')]=db[_0xba75('0x3')]['import'](_0xba75('0x57'));db[_0xba75('0x58')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x59'));db[_0xba75('0x5a')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/smsInteraction/smsInteraction.model');db[_0xba75('0x5b')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x5c'));db[_0xba75('0x5d')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x5e'));db[_0xba75('0x5f')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x60'));db[_0xba75('0x61')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x62'));db[_0xba75('0x63')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x64'));db['OpenchannelMessage']=db['sequelize'][_0xba75('0x14')]('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0xba75('0x3')]['import'](_0xba75('0x65'));db[_0xba75('0x66')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x67'));db['OpenchannelQueueReport']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xba75('0x68')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x69'));db[_0xba75('0x6a')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x6b'));db['ChatMessage']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x6c'));db[_0xba75('0x6d')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0xba75('0x6e')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x6f'));db[_0xba75('0x70')]=db[_0xba75('0x3')]['import']('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db['sequelize'][_0xba75('0x14')](_0xba75('0x71'));db[_0xba75('0x72')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x73'));db[_0xba75('0x74')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x75'));db[_0xba75('0x76')]=db[_0xba75('0x3')]['import'](_0xba75('0x77'));db[_0xba75('0x78')]=db['sequelize'][_0xba75('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xba75('0x79')]=db[_0xba75('0x3')]['import'](_0xba75('0x7a'));db[_0xba75('0x7b')]=db['sequelize']['import'](_0xba75('0x7c'));db['ReportAgentPreview']=db[_0xba75('0x3')]['import'](_0xba75('0x7d'));db[_0xba75('0x7e')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x7f'));db['Action']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/action/action.model');db[_0xba75('0x80')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x81'));db[_0xba75('0x82')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x83'));db[_0xba75('0x84')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x85'));db['Condition']=db['sequelize'][_0xba75('0x14')](_0xba75('0x86'));db[_0xba75('0x87')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x88'));db[_0xba75('0x89')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x8a'));db[_0xba75('0x8b')]=db['sequelize'][_0xba75('0x14')]('../api/cdr/cdr.model');db[_0xba75('0x8c')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x8d'));db[_0xba75('0x8e')]=db[_0xba75('0x3')]['import'](_0xba75('0x8f'));db['Sound']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/sound/sound.model');db['Tag']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x90'));db[_0xba75('0x91')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/template/template.model');db[_0xba75('0x92')]=db[_0xba75('0x3')]['import'](_0xba75('0x93'));db[_0xba75('0x94')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x95'));db['Integration']=db[_0xba75('0x3')]['import'](_0xba75('0x96'));db[_0xba75('0x97')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x98'));db[_0xba75('0x99')]=db['sequelize']['import'](_0xba75('0x9a'));db['AnalyticDefaultReport']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xba75('0x9b')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/analyticExtractedReport/analyticExtractedReport.model');db['AnalyticMetric']=db['sequelize']['import']('../api/analyticMetric/analyticMetric.model');db[_0xba75('0x9c')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x9d'));db[_0xba75('0x9e')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x9f'));db[_0xba75('0xa0')]=db['sequelize']['import'](_0xba75('0xa1'));db[_0xba75('0xa2')]=db['sequelize'][_0xba75('0x14')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xba75('0xa3')]=db[_0xba75('0x3')]['import'](_0xba75('0xa4'));db['SugarcrmAccount']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xba75('0xa5')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xa6'));db[_0xba75('0xa7')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xa8'));db['DeskAccount']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/intDeskAccount/intDeskAccount.model');db['DeskConfiguration']=db['sequelize'][_0xba75('0x14')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xba75('0xa9')]=db['sequelize'][_0xba75('0x14')]('../api/intDeskField/intDeskField.model');db['ZohoAccount']=db[_0xba75('0x3')]['import'](_0xba75('0xaa'));db['ZohoConfiguration']=db['sequelize'][_0xba75('0x14')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xba75('0xab')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xac'));db[_0xba75('0xad')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xae'));db['ZendeskConfiguration']=db[_0xba75('0x3')]['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xba75('0xaf')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xb0'));db[_0xba75('0xb1')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xb2'));db[_0xba75('0xb3')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xb4'));db[_0xba75('0xb5')]=db['sequelize']['import'](_0xba75('0xb6'));db['VtigerAccount']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xb7'));db[_0xba75('0xb8')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db['VtigerField']=db[_0xba75('0x3')]['import'](_0xba75('0xb9'));db[_0xba75('0xba')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xbb'));db['ServicenowConfiguration']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xbc'));db[_0xba75('0xbd')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xbe'));db[_0xba75('0xbf')]=db[_0xba75('0x3')]['import'](_0xba75('0xc0'));db[_0xba75('0xc1')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xc2'));db[_0xba75('0xc3')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0xba75('0xc4')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xc5'));db[_0xba75('0xc6')]=db[_0xba75('0x3')]['import'](_0xba75('0xc7'));db['FreshsalesField']=db[_0xba75('0x3')]['import'](_0xba75('0xc8'));db[_0xba75('0xc9')]=db[_0xba75('0x3')]['import']('../api/integration/integration.model');db['Network']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xca'));db[_0xba75('0xcb')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xcc'));db[_0xba75('0xcd')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xce'));db[_0xba75('0xcf')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xd0'));db['JscriptyQuestionReport']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xd1'));db['JscriptySessionReport']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xd2'));db[_0xba75('0xd3')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xd4'));db['SquareReport']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xd5'));db[_0xba75('0xd6')]=db[_0xba75('0x3')]['import']('../api/squareReportDetail/squareReportDetail.model');db[_0xba75('0xd7')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xd8'));db[_0xba75('0xd9')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xda'));db[_0xba75('0xdb')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/squareOdbc/squareOdbc.model');db['SquareProject']=db['sequelize'][_0xba75('0x14')]('../api/squareProject/squareProject.model');db[_0xba75('0xdc')]=db['sequelize'][_0xba75('0x14')]('../api/squareRecording/squareRecording.model');db[_0xba75('0xdd')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xde'));db[_0xba75('0xdf')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xe0'));db['License']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xe1'));db[_0xba75('0xe2')]=db[_0xba75('0x3')]['import'](_0xba75('0xe3'));db[_0xba75('0xe4')]=db[_0xba75('0x3')]['import'](_0xba75('0xe5'));db['Attachment']=db['sequelize'][_0xba75('0x14')](_0xba75('0xe6'));db[_0xba75('0xe7')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xe8'));db[_0xba75('0xe9')]=db['sequelize'][_0xba75('0x14')]('../api/mailTransferReport/mailTransferReport.model');db[_0xba75('0xea')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xeb'));db[_0xba75('0xec')]=db[_0xba75('0x3')]['import'](_0xba75('0xed'));db[_0xba75('0xee')]=db[_0xba75('0x3')]['import'](_0xba75('0xef'));db[_0xba75('0xf0')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xf1'));db[_0xba75('0xf2')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xf3'));db[_0xba75('0xf4')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xf5'));db['UserProfile']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/userProfile/userProfile.model');db[_0xba75('0xf6')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xf7'));db['UserProfileResource']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xf8'));db[_0xba75('0xf9')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xfa'));db['WhatsappAccount']=db['sequelize']['import'](_0xba75('0xfb'));db[_0xba75('0xfc')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xfd'));db[_0xba75('0xfe')]=db[_0xba75('0x3')]['import']('../api/whatsappInteraction/whatsappInteraction.model');db[_0xba75('0xff')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x100'));db[_0xba75('0x101')]=db['sequelize'][_0xba75('0x14')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0xba75('0x102')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x103'));db[_0xba75('0x104')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x105'));db[_0xba75('0x106')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x107'));db[_0xba75('0x108')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x109'));db[_0xba75('0x10a')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x10b'));db['UserVoicePrefix']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x10c'));db[_0xba75('0x13')][_0xba75('0x10d')](db[_0xba75('0x1f')],{'as':'VoiceMail','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x1b')],{'as':'Recordings','foreignKey':'UserId'});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x2c')],{'as':_0xba75('0x111'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x18')],{'as':_0xba75('0x112'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x13')][_0xba75('0x110')](db['CmHopperFinal'],{'as':_0xba75('0x113'),'foreignKey':_0xba75('0x10f')});db['User'][_0xba75('0x110')](db['CmHopperHistory'],{'as':_0xba75('0x114'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db['ReportAgentPreview'],{'as':_0xba75('0x115'),'foreignKey':'UserId'});db[_0xba75('0x13')][_0xba75('0x110')](db['OpenchannelInteraction'],{'as':_0xba75('0x116'),'foreignKey':'UserId'});db[_0xba75('0x13')][_0xba75('0x110')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x5a')],{'as':_0xba75('0x117'),'foreignKey':'UserId'});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x118')],{'as':_0xba75('0x119'),'foreignKey':_0xba75('0x10f')});db['User'][_0xba75('0x110')](db['MailInteraction'],{'as':_0xba75('0x11a'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','foreignKey':'UserId'});db[_0xba75('0x13')]['hasMany'](db[_0xba75('0xf9')],{'as':_0xba75('0x11b'),'foreignKey':_0xba75('0x11c')});db[_0xba75('0x13')]['belongsTo'](db[_0xba75('0x11d')],{'as':_0xba75('0x11d'),'foreignKey':'userProfileId'});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0x70')],{'as':_0xba75('0x11f'),'through':'chat_group_has_users'});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0x74')],{'as':_0xba75('0x120'),'through':'cm_user_has_contacts'});db['User']['belongsToMany'](db['CmList'],{'as':_0xba75('0x121'),'through':'cm_user_has_lists'});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':_0xba75('0x122')});db['User']['belongsToMany'](db[_0xba75('0x123')],{'as':'MailInteractions','through':_0xba75('0x124')});db['User'][_0xba75('0x11e')](db[_0xba75('0x6a')],{'as':_0xba75('0x125'),'through':_0xba75('0x126')});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0x118')],{'as':_0xba75('0x119'),'through':_0xba75('0x127')});db['User'][_0xba75('0x11e')](db[_0xba75('0x5a')],{'as':_0xba75('0x117'),'through':_0xba75('0x128')});db['User'][_0xba75('0x11e')](db[_0xba75('0x63')],{'as':_0xba75('0x116'),'through':'user_has_openchannel_interactions'});db[_0xba75('0x13')][_0xba75('0x11e')](db['WhatsappInteraction'],{'as':_0xba75('0x129'),'through':_0xba75('0x12a')});db['User']['belongsToMany'](db[_0xba75('0x1a')],{'as':_0xba75('0x12b'),'through':'UserVoiceQueue','required':![]});db[_0xba75('0x13')][_0xba75('0x11e')](db['VoicePrefix'],{'as':_0xba75('0x12c'),'through':_0xba75('0x12d'),'required':![]});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0x41')],{'as':_0xba75('0x12e'),'through':_0xba75('0x32'),'required':![]});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0x6e')],{'as':_0xba75('0x12f'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User'][_0xba75('0x11e')](db['FaxQueue'],{'as':_0xba75('0x130'),'through':'UserFaxQueue','required':![]});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0x5d')],{'as':_0xba75('0x131'),'through':_0xba75('0x36'),'required':![]});db['User'][_0xba75('0x11e')](db[_0xba75('0x132')],{'as':_0xba75('0x133'),'through':_0xba75('0x38'),'required':![]});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0x104')],{'as':_0xba75('0x134'),'through':_0xba75('0x3a'),'required':![]});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0xf2')],{'through':'cm_user_has_lists'});db['User'][_0xba75('0x11e')](db['ChatWebsite'],{'as':'ChatWebsites','through':_0xba75('0x135')});db[_0xba75('0x13')][_0xba75('0x11e')](db['FaxAccount'],{'as':_0xba75('0x136'),'through':'user_has_fax_accounts'});db[_0xba75('0x13')][_0xba75('0x11e')](db['MailAccount'],{'as':'MailAccounts','through':_0xba75('0x137')});db['User'][_0xba75('0x11e')](db[_0xba75('0x5f')],{'as':_0xba75('0x138'),'through':'user_has_openchannel_accounts'});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0x56')],{'as':'SmsAccounts','through':_0xba75('0x139')});db['User'][_0xba75('0x11e')](db[_0xba75('0x13a')],{'as':_0xba75('0x13b'),'through':_0xba75('0x13c')});db[_0xba75('0x13')][_0xba75('0x11e')](db['SquareProject'],{'as':'SquareProjects','through':_0xba75('0x13d')});db[_0xba75('0x13e')][_0xba75('0x110')](db[_0xba75('0x18')],{'as':_0xba75('0x13f'),'onDelete':'cascade','foreignKey':_0xba75('0x140')});db[_0xba75('0x141')][_0xba75('0x110')](db[_0xba75('0x18')],{'onDelete':'cascade'});db['VoiceExtension'][_0xba75('0x110')](db[_0xba75('0x18')],{'as':_0xba75('0x142'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x19')][_0xba75('0x11e')](db[_0xba75('0x143')],{'as':_0xba75('0x144'),'through':_0xba75('0x145')});db['VoiceQueue'][_0xba75('0x110')](db['UserVoiceQueueRt'],{'as':_0xba75('0x146'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x110')](db['CmHopper'],{'as':_0xba75('0x148'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')]['hasMany'](db[_0xba75('0x79')],{'as':_0xba75('0x113'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x110')](db[_0xba75('0x7b')],{'as':_0xba75('0x149'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x110')](db['ReportAgentPreview'],{'as':_0xba75('0x115'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x110')](db[_0xba75('0x78')],{'as':'HopperBlacks','foreignKey':_0xba75('0x147')});db['VoiceQueue'][_0xba75('0x110')](db['JscriptySessionReport'],{'as':_0xba75('0x14a'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x14b')](db[_0xba75('0x29')],{'as':'Trunk','foreignKey':_0xba75('0x14c')});db[_0xba75('0x1a')][_0xba75('0x14b')](db['Trunk'],{'as':_0xba75('0x14d'),'foreignKey':_0xba75('0x14e')});db[_0xba75('0x1a')][_0xba75('0x14b')](db['Interval'],{'as':_0xba75('0x87'),'foreignKey':_0xba75('0x14f')});db['VoiceQueue'][_0xba75('0x14b')](db['Pause'],{'as':_0xba75('0x150'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xba75('0x1a')]['belongsToMany'](db[_0xba75('0xf2')],{'as':'Lists','through':_0xba75('0x151')});db[_0xba75('0x1a')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':'UserVoiceQueue'});db[_0xba75('0x1a')][_0xba75('0x11e')](db[_0xba75('0xdf')],{'as':'Teams','through':_0xba75('0x108')});db[_0xba75('0x1a')]['belongsToMany'](db[_0xba75('0xf2')],{'as':'BlackLists','through':_0xba75('0x152')});db['VoiceRecording'][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x13'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x1d')][_0xba75('0x14b')](db['User'],{'as':_0xba75('0x13'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x1f')]['hasMany'](db[_0xba75('0x153')],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x155'),'sourceKey':_0xba75('0x156')});db['VoiceMailMessage'][_0xba75('0x14b')](db[_0xba75('0x1f')],{'foreignKey':_0xba75('0x155'),'targetKey':_0xba75('0x156')});db[_0xba75('0x22')]['hasMany'](db['VoiceQueueReport'],{'as':_0xba75('0x157'),'foreignKey':'uniqueid','constraints':![]});db[_0xba75('0x22')][_0xba75('0x110')](db[_0xba75('0x158')],{'as':_0xba75('0x159'),'foreignKey':_0xba75('0x15a'),'constraints':![]});db[_0xba75('0x22')]['belongsTo'](db[_0xba75('0x13')],{'as':_0xba75('0x13'),'foreignKey':'UserId'});db[_0xba75('0x22')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x3c')][_0xba75('0x14b')](db[_0xba75('0x15d')],{'as':_0xba75('0x15d'),'foreignKey':_0xba75('0x15e')});db[_0xba75('0x3e')]['belongsTo'](db[_0xba75('0x15d')],{'as':'MailAccount','foreignKey':_0xba75('0x15e')});db[_0xba75('0x15d')]['hasOne'](db[_0xba75('0x3c')],{'as':_0xba75('0x15f'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x15d')][_0xba75('0x10d')](db['MailServerOut'],{'as':_0xba75('0x160'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x15d')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':_0xba75('0x15e'),'onDelete':_0xba75('0x10e')});db['MailAccount'][_0xba75('0x110')](db[_0xba75('0x82')],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x15e')});db[_0xba75('0x15d')]['hasMany'](db[_0xba75('0x46')],{'as':_0xba75('0x154'),'foreignKey':'MailAccountId'});db[_0xba75('0x15d')][_0xba75('0x110')](db['MailInteraction'],{'as':_0xba75('0x163')});db[_0xba75('0x15d')]['hasMany'](db[_0xba75('0x164')],{'as':'Applications'});db[_0xba75('0x15d')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':'ListId'});db['MailAccount'][_0xba75('0x14b')](db[_0xba75('0x91')],{'as':_0xba75('0x91'),'foreignKey':'TemplateId'});db[_0xba75('0x15d')][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':'mandatoryDispositionPause','foreignKey':_0xba75('0x166')});db[_0xba75('0x15d')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':_0xba75('0x137')});db['MailQueue']['belongsToMany'](db[_0xba75('0x13')],{'as':'Agents','through':_0xba75('0x32')});db[_0xba75('0x41')][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':'team_has_mail_queues','as':_0xba75('0x167')});db[_0xba75('0x123')]['hasMany'](db[_0xba75('0x46')],{'as':_0xba75('0x154'),'onDelete':'cascade','foreignKey':_0xba75('0x168')});db[_0xba75('0x123')][_0xba75('0x14b')](db[_0xba75('0x15d')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x15e')});db[_0xba75('0x123')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x123')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x16a'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x123')]['belongsToMany'](db[_0xba75('0x16b')],{'through':_0xba75('0x16c'),'as':_0xba75('0x16d')});db['MailInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x16c'),'as':_0xba75('0x16e')});db[_0xba75('0x123')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':'user_has_mail_interactions','foreignKey':_0xba75('0x168')});db[_0xba75('0x46')][_0xba75('0x110')](db[_0xba75('0x170')],{'as':_0xba75('0x171'),'onDelete':'cascade'});db[_0xba75('0x46')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x13')});db[_0xba75('0x46')]['belongsTo'](db[_0xba75('0x74')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b')});db[_0xba75('0x46')]['belongsTo'](db['MailInteraction'],{'as':_0xba75('0x172'),'foreignKey':_0xba75('0x168')});db[_0xba75('0x46')][_0xba75('0x14b')](db[_0xba75('0x15d')],{'as':'Account','foreignKey':'MailAccountId'});db[_0xba75('0x46')][_0xba75('0x14b')](db[_0xba75('0x66')],{'as':'ChatWebsite','foreignKey':_0xba75('0x173')});db[_0xba75('0x46')][_0xba75('0x14b')](db[_0xba75('0x6d')],{'as':_0xba75('0x6d'),'foreignKey':_0xba75('0x174')});db['MailApplication'][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x164')][_0xba75('0x14b')](db['MailQueue'],{'onDelete':_0xba75('0x175')});db['MailApplication']['belongsTo'](db[_0xba75('0x15d')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x164')]['belongsTo'](db['Interval'],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0x164')][_0xba75('0x14b')](db[_0xba75('0x16b')],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x176')});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0x15d')],{});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db['MailQueueReport'][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0x123')],{});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0x46')],{});db['MailQueueReport']['belongsTo'](db[_0xba75('0x13')],{});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0x41')],{});db[_0xba75('0x4a')][_0xba75('0x110')](db[_0xba75('0x4c')],{'as':_0xba75('0x179'),'onDelete':'cascade'});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':'FaxAccountId','onDelete':_0xba75('0x10e')});db['FaxAccount'][_0xba75('0x110')](db[_0xba75('0x82')],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x17a')});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x118')],{'as':_0xba75('0x163')});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x50')],{'as':_0xba75('0x142')});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x18')],{'as':_0xba75('0x17b'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x52')],{'as':_0xba75('0x154')});db[_0xba75('0x4e')][_0xba75('0x14b')](db['Trunk'],{'as':_0xba75('0x29')});db[_0xba75('0x4e')][_0xba75('0x14b')](db['CmList'],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x4e')][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':_0xba75('0x150'),'foreignKey':_0xba75('0x166')});db[_0xba75('0x4e')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x17d')});db[_0xba75('0x50')][_0xba75('0x14b')](db['User'],{'onDelete':'restrict'});db[_0xba75('0x50')][_0xba75('0x14b')](db[_0xba75('0x17e')],{'onDelete':_0xba75('0x175')});db['FaxApplication'][_0xba75('0x14b')](db[_0xba75('0x4e')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x50')][_0xba75('0x14b')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xba75('0x176')});db['FaxInteraction']['hasMany'](db['FaxMessage'],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x17f')});db[_0xba75('0x118')][_0xba75('0x14b')](db[_0xba75('0x4e')],{'as':_0xba75('0x169'),'foreignKey':'FaxAccountId'});db[_0xba75('0x118')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x118')]['belongsTo'](db[_0xba75('0x13')],{'as':_0xba75('0x16a'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x118')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x180'),'as':_0xba75('0x16d')});db['FaxInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x180'),'as':_0xba75('0x16e')});db[_0xba75('0x118')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Users','through':_0xba75('0x127'),'foreignKey':_0xba75('0x17f')});db[_0xba75('0x52')][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x13')});db[_0xba75('0x52')][_0xba75('0x14b')](db['FaxInteraction'],{'as':_0xba75('0x172'),'foreignKey':_0xba75('0x17f')});db['FaxMessage'][_0xba75('0x14b')](db[_0xba75('0x74')],{'onDelete':'cascade','as':'Contact'});db['FaxMessage']['belongsTo'](db[_0xba75('0x170')],{'as':_0xba75('0x170'),'foreignKey':'AttachmentId'});db[_0xba75('0x52')][_0xba75('0x14b')](db[_0xba75('0x4e')],{'as':'Account','foreignKey':_0xba75('0x17a')});db['FaxQueue']['belongsToMany'](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x34')});db['FaxQueue'][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':'team_has_fax_queues','as':'Teams'});db[_0xba75('0x54')][_0xba75('0x14b')](db['FaxAccount'],{});db[_0xba75('0x54')]['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x54')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x54')][_0xba75('0x14b')](db[_0xba75('0x118')],{});db[_0xba75('0x54')]['belongsTo'](db[_0xba75('0x52')],{});db['FaxQueueReport'][_0xba75('0x14b')](db['User'],{});db[_0xba75('0x54')][_0xba75('0x14b')](db['FaxQueue'],{});db[_0xba75('0x56')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':_0xba75('0x181'),'onDelete':'cascade'});db['SmsAccount']['hasMany'](db[_0xba75('0x82')],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x181')});db[_0xba75('0x56')][_0xba75('0x110')](db[_0xba75('0x5b')],{'as':_0xba75('0x154'),'foreignKey':_0xba75('0x181')});db[_0xba75('0x56')]['hasMany'](db['SmsInteraction'],{'as':_0xba75('0x163')});db[_0xba75('0x56')]['hasMany'](db[_0xba75('0x58')],{'as':_0xba75('0x142')});db['SmsAccount'][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x56')][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':'mandatoryDispositionPause','foreignKey':_0xba75('0x166')});db['SmsAccount']['belongsToMany'](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x139')});db[_0xba75('0x58')]['belongsTo'](db[_0xba75('0x13')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x58')][_0xba75('0x14b')](db[_0xba75('0x5d')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x58')][_0xba75('0x14b')](db[_0xba75('0x56')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x58')]['belongsTo'](db[_0xba75('0x87')],{'onDelete':_0xba75('0x175'),'foreignKey':'IntervalId'});db[_0xba75('0x58')][_0xba75('0x14b')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xba75('0x176')});db[_0xba75('0x5a')][_0xba75('0x110')](db[_0xba75('0x5b')],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x182')});db[_0xba75('0x5a')][_0xba75('0x14b')](db['SmsAccount'],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x181')});db[_0xba75('0x5a')]['belongsTo'](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':'ContactId'});db['SmsInteraction']['belongsTo'](db['User'],{'as':_0xba75('0x16a'),'foreignKey':_0xba75('0x10f')});db['SmsInteraction'][_0xba75('0x11e')](db['Tag'],{'through':'sms_interaction_has_tags','as':'Tags'});db['SmsInteraction']['belongsToMany'](db[_0xba75('0x16b')],{'through':_0xba75('0x183'),'as':'ThroughTags'});db[_0xba75('0x5a')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':_0xba75('0x128'),'foreignKey':_0xba75('0x182')});db[_0xba75('0x5b')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':'User'});db['SmsMessage'][_0xba75('0x14b')](db[_0xba75('0x74')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b')});db[_0xba75('0x5b')][_0xba75('0x14b')](db[_0xba75('0x5a')],{'onDelete':'cascade','as':_0xba75('0x172'),'foreignKey':'SmsInteractionId'});db[_0xba75('0x5b')][_0xba75('0x14b')](db[_0xba75('0x56')],{'as':_0xba75('0x169'),'foreignKey':'SmsAccountId'});db[_0xba75('0x5d')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':_0xba75('0x36'),'foreignKey':_0xba75('0x184')});db['SmsQueue'][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':'team_has_sms_queues','as':'Teams'});db[_0xba75('0x5f')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':'OpenchannelAccountId','onDelete':_0xba75('0x10e')});db[_0xba75('0x5f')][_0xba75('0x110')](db[_0xba75('0x82')],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x185')});db['OpenchannelAccount'][_0xba75('0x110')](db[_0xba75('0x63')],{'as':_0xba75('0x163'),'foreignKey':'OpenchannelAccountId'});db[_0xba75('0x5f')][_0xba75('0x110')](db['OpenchannelMessage'],{'as':'Messages','foreignKey':_0xba75('0x185')});db[_0xba75('0x5f')][_0xba75('0x110')](db[_0xba75('0x61')],{'as':_0xba75('0x142'),'foreignKey':_0xba75('0x185')});db[_0xba75('0x5f')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x5f')]['belongsTo'](db[_0xba75('0x89')],{'as':_0xba75('0x150'),'foreignKey':_0xba75('0x166')});db[_0xba75('0x5f')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':'user_has_openchannel_accounts'});db[_0xba75('0x61')]['belongsTo'](db[_0xba75('0x13')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x61')][_0xba75('0x14b')](db['OpenchannelQueue'],{'onDelete':_0xba75('0x175'),'foreignKey':'OpenchannelQueueId'});db[_0xba75('0x61')][_0xba75('0x14b')](db[_0xba75('0x5f')],{'onDelete':'restrict','foreignKey':_0xba75('0x185')});db['OpenchannelApplication'][_0xba75('0x14b')](db[_0xba75('0x87')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0xba75('0x61')][_0xba75('0x14b')](db[_0xba75('0x16b')],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x176')});db[_0xba75('0x63')][_0xba75('0x110')](db[_0xba75('0x186')],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x187')});db['OpenchannelInteraction'][_0xba75('0x14b')](db[_0xba75('0x5f')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x185')});db[_0xba75('0x63')][_0xba75('0x14b')](db['CmContact'],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db['OpenchannelInteraction'][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x16a'),'foreignKey':_0xba75('0x10f')});db['OpenchannelInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x188'),'as':'Tags'});db['OpenchannelInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x188'),'as':_0xba75('0x16e')});db[_0xba75('0x63')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':_0xba75('0x189'),'foreignKey':_0xba75('0x187')});db[_0xba75('0x186')][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':'cascade','as':'User'});db[_0xba75('0x186')]['belongsTo'](db['CmContact'],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b')});db['OpenchannelMessage'][_0xba75('0x14b')](db[_0xba75('0x63')],{'onDelete':_0xba75('0x10e'),'as':'Interaction','foreignKey':_0xba75('0x187')});db[_0xba75('0x186')][_0xba75('0x14b')](db['Attachment'],{'as':_0xba75('0x170'),'foreignKey':_0xba75('0x18a')});db['OpenchannelMessage'][_0xba75('0x14b')](db[_0xba75('0x5f')],{'as':'Account','foreignKey':_0xba75('0x185')});db['OpenchannelQueue'][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x38'),'foreignKey':_0xba75('0x18b')});db['OpenchannelQueue'][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':_0xba75('0x18c'),'as':_0xba75('0x167')});db['ChatWebsite'][_0xba75('0x110')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xba75('0x173'),'onDelete':'cascade'});db['ChatWebsite'][_0xba75('0x110')](db['CannedAnswer'],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x173')});db[_0xba75('0x66')][_0xba75('0x110')](db[_0xba75('0x18d')],{'as':'ProactiveActions'});db[_0xba75('0x66')][_0xba75('0x110')](db['ChatInteraction'],{'as':_0xba75('0x163')});db[_0xba75('0x66')][_0xba75('0x110')](db[_0xba75('0x68')],{'as':_0xba75('0x142')});db[_0xba75('0x66')]['hasMany'](db['ChatMessage'],{'as':_0xba75('0x154')});db[_0xba75('0x66')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x66')][_0xba75('0x14b')](db[_0xba75('0x87')],{'as':'Interval','foreignKey':_0xba75('0x14f')});db['ChatWebsite'][_0xba75('0x14b')](db[_0xba75('0x15d')],{'as':'MailAccount','foreignKey':_0xba75('0x15e')});db['ChatWebsite'][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':_0xba75('0x150'),'foreignKey':_0xba75('0x166')});db[_0xba75('0x66')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x135')});db[_0xba75('0x18e')][_0xba75('0x14b')](db[_0xba75('0x5f')],{});db[_0xba75('0x18e')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x18e')][_0xba75('0x14b')](db['CmContact'],{'as':'Contact','foreignKey':_0xba75('0x15c')});db[_0xba75('0x18e')]['belongsTo'](db[_0xba75('0x63')],{});db[_0xba75('0x18e')]['belongsTo'](db[_0xba75('0x186')],{});db[_0xba75('0x18e')][_0xba75('0x14b')](db[_0xba75('0x13')],{});db[_0xba75('0x18e')][_0xba75('0x14b')](db[_0xba75('0x132')],{});db[_0xba75('0x68')][_0xba75('0x14b')](db['User'],{'as':_0xba75('0x18f'),'foreignKey':_0xba75('0x10f'),'onDelete':'restrict'});db['ChatApplication']['belongsTo'](db[_0xba75('0x6e')],{'as':_0xba75('0x190'),'foreignKey':_0xba75('0x191'),'onDelete':'restrict'});db['ChatApplication'][_0xba75('0x14b')](db[_0xba75('0x66')],{'as':'Website','foreignKey':_0xba75('0x173'),'onDelete':'restrict'});db[_0xba75('0x68')]['belongsTo'](db[_0xba75('0x16b')],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x176')});db['ChatInteraction'][_0xba75('0x110')](db[_0xba75('0x192')],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x193')});db[_0xba75('0x6a')][_0xba75('0x14b')](db[_0xba75('0x66')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x173')});db[_0xba75('0x6a')][_0xba75('0x14b')](db['CmContact'],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x6a')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0xba75('0x10f')});db['ChatInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':'chat_interaction_has_tags','as':'Tags'});db[_0xba75('0x6a')][_0xba75('0x11e')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0xba75('0x16e')});db[_0xba75('0x6a')]['belongsToMany'](db[_0xba75('0x13')],{'as':'Users','through':_0xba75('0x126'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x13')});db[_0xba75('0x192')][_0xba75('0x14b')](db['CmContact'],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b'),'foreignKey':'ContactId'});db[_0xba75('0x192')]['belongsTo'](db['ChatInteraction'],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x172'),'foreignKey':_0xba75('0x193')});db['ChatMessage'][_0xba75('0x14b')](db[_0xba75('0x170')],{'as':_0xba75('0x170'),'foreignKey':_0xba75('0x18a')});db[_0xba75('0x192')][_0xba75('0x14b')](db[_0xba75('0x66')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x173')});db[_0xba75('0x6d')][_0xba75('0x110')](db[_0xba75('0x170')],{'as':'Attachments','foreignKey':_0xba75('0x174'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x6d')][_0xba75('0x14b')](db[_0xba75('0x74')],{'onDelete':'cascade','as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x6d')][_0xba75('0x14b')](db['ChatWebsite'],{'as':'Account','foreignKey':_0xba75('0x173')});db[_0xba75('0x6e')]['belongsToMany'](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x30'),'hooks':!![]});db['ChatQueue'][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':'team_has_chat_queues','as':'Teams'});db[_0xba75('0x70')][_0xba75('0x110')](db[_0xba75('0xcd')],{'as':'Messages','foreignKey':_0xba75('0x194'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x70')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x146'),'through':_0xba75('0x195')});db[_0xba75('0x18d')]['belongsTo'](db[_0xba75('0x66')],{'as':'Website','foreignKey':_0xba75('0x173')});db['CmCompany'][_0xba75('0x110')](db[_0xba75('0x74')],{'as':_0xba75('0x120'),'foreignKey':_0xba75('0x196')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x76')],{'as':_0xba75('0x148'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x74')][_0xba75('0x110')](db[_0xba75('0x79')],{'as':'HopperFinals','foreignKey':'ContactId'});db[_0xba75('0x74')][_0xba75('0x110')](db['CmHopperHistory'],{'as':_0xba75('0x149'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x115')],{'as':_0xba75('0x115'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x197')],{'as':_0xba75('0x14a'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x74')][_0xba75('0x110')](db[_0xba75('0x63')],{'as':'OpenchannelInteractions','foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x175')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x6a')],{'as':_0xba75('0x125'),'foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x175')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x5a')],{'as':_0xba75('0x117'),'foreignKey':'ContactId','onDelete':_0xba75('0x175')});db[_0xba75('0x74')][_0xba75('0x110')](db[_0xba75('0x118')],{'as':'FaxInteractions','foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x175')});db['CmContact'][_0xba75('0x110')](db['MailInteraction'],{'as':_0xba75('0x11a'),'foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x175')});db[_0xba75('0x74')][_0xba75('0x14b')](db[_0xba75('0x72')],{'as':_0xba75('0x198'),'foreignKey':_0xba75('0x196')});db[_0xba75('0x74')]['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':'ListId','onDelete':_0xba75('0x10e')});db[_0xba75('0x74')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':_0xba75('0x199')});db[_0xba75('0x74')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'as':'Tags','through':_0xba75('0x19a')});db[_0xba75('0x74')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x19a'),'as':_0xba75('0x16e')});db[_0xba75('0x76')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':'Contact','foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x76')]['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x76')]['belongsTo'](db['User'],{'as':'Agent','foreignKey':_0xba75('0x10f')});db['CmHopper'][_0xba75('0x14b')](db[_0xba75('0x1a')],{'as':_0xba75('0x190'),'foreignKey':'VoiceQueueId','onDelete':_0xba75('0x10e')});db['CmHopper'][_0xba75('0x14b')](db[_0xba75('0xe2')],{'as':_0xba75('0xe2'),'foreignKey':'CampaignId','onDelete':_0xba75('0x10e')});db[_0xba75('0x76')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x16a'),'foreignKey':'OwnerId'});db[_0xba75('0x78')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x10e')});db['CmHopperBlack'][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178'),'onDelete':'cascade'});db[_0xba75('0x78')][_0xba75('0x14b')](db[_0xba75('0x1a')],{'as':_0xba75('0x190'),'foreignKey':'VoiceQueueId','onDelete':_0xba75('0x10e')});db[_0xba75('0x78')]['belongsTo'](db['Campaign'],{'as':_0xba75('0xe2'),'foreignKey':'CampaignId','onDelete':_0xba75('0x10e')});db['Automation'][_0xba75('0x110')](db[_0xba75('0x19b')],{'as':{'plural':_0xba75('0x19c'),'singular':_0xba75('0x19d')},'foreignKey':_0xba75('0x19e'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x80')]['hasMany'](db[_0xba75('0x19b')],{'as':{'plural':_0xba75('0x19f'),'singular':_0xba75('0x1a0')},'foreignKey':'AutomationAnyId','onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x80')]['hasMany'](db[_0xba75('0x1a1')],{'as':_0xba75('0x1a2'),'foreignKey':_0xba75('0x1a3'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x84')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':'ParentId','onDelete':'cascade'});db['Interval'][_0xba75('0x110')](db[_0xba75('0x87')],{'as':'Intervals','foreignKey':_0xba75('0x14f'),'onDelete':_0xba75('0x10e'),'hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0xba75('0x18')],{'as':'Extensions','foreignKey':_0xba75('0x14f'),'onDelete':_0xba75('0x175')});db[_0xba75('0x87')][_0xba75('0x110')](db[_0xba75('0x164')],{'as':_0xba75('0x1a4'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0x87')][_0xba75('0x110')](db[_0xba75('0x68')],{'as':_0xba75('0x1a5'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0x87')][_0xba75('0x110')](db['FaxApplication'],{'as':_0xba75('0x1a6'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0x87')][_0xba75('0x110')](db[_0xba75('0x58')],{'as':'SmsApplications','foreignKey':_0xba75('0x14f')});db[_0xba75('0x8e')][_0xba75('0x14b')](db[_0xba75('0x15d')],{});db[_0xba75('0x8e')][_0xba75('0x14b')](db[_0xba75('0x1a7')],{'foreignKey':'DefaultReportId'});db[_0xba75('0x8e')]['belongsTo'](db[_0xba75('0x99')],{'foreignKey':'CustomReportId'});db[_0xba75('0x143')]['belongsToMany'](db[_0xba75('0x19')],{'as':_0xba75('0x1a8'),'through':_0xba75('0x145'),'onDelete':_0xba75('0x175')});db[_0xba75('0x16b')][_0xba75('0x11e')](db[_0xba75('0x74')],{'through':_0xba75('0x19a')});db[_0xba75('0x16b')]['belongsToMany'](db['ChatInteraction'],{'through':_0xba75('0x1a9')});db[_0xba75('0x16b')][_0xba75('0x11e')](db[_0xba75('0x123')],{'through':_0xba75('0x16c')});db['Tag'][_0xba75('0x11e')](db[_0xba75('0x5a')],{'through':_0xba75('0x183')});db['Tag']['belongsToMany'](db[_0xba75('0x118')],{'through':_0xba75('0x180')});db[_0xba75('0x16b')][_0xba75('0x11e')](db[_0xba75('0x63')],{'through':'openchannel_interaction_has_tags'});db[_0xba75('0x16b')][_0xba75('0x11e')](db[_0xba75('0xfe')],{'through':_0xba75('0x1aa')});db['Trigger']['hasMany'](db[_0xba75('0x19b')],{'as':{'plural':_0xba75('0x1ab'),'singular':_0xba75('0x1ac')},'foreignKey':_0xba75('0x1ad'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x92')][_0xba75('0x110')](db[_0xba75('0x19b')],{'as':{'plural':_0xba75('0x1ae'),'singular':'AnyCondition'},'foreignKey':_0xba75('0x1af'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db['Trigger']['hasMany'](db['Action'],{'as':'Actions','foreignKey':'TriggerId','onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x99')][_0xba75('0x110')](db[_0xba75('0x9c')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xba75('0x1b0'),'hooks':!![]});db[_0xba75('0x1a7')][_0xba75('0x110')](db[_0xba75('0x9c')],{'as':_0xba75('0x1b1'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b2')});db[_0xba75('0x1b3')][_0xba75('0x110')](db['AnalyticFieldReport'],{'as':_0xba75('0x1b1'),'onDelete':'cascade','foreignKey':_0xba75('0x1b4')});db[_0xba75('0x9c')]['belongsTo'](db[_0xba75('0x1b3')],{'foreignKey':_0xba75('0x1b4')});db[_0xba75('0xa0')][_0xba75('0x110')](db[_0xba75('0xa2')],{'as':'Configurations','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xa2')][_0xba75('0x110')](db[_0xba75('0xa3')],{'as':_0xba75('0x1b6'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db['SalesforceConfiguration']['hasMany'](db[_0xba75('0xa3')],{'as':_0xba75('0x1b8'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['SalesforceConfiguration'][_0xba75('0x110')](db[_0xba75('0xa3')],{'as':_0xba75('0x1b1'),'onDelete':'cascade','foreignKey':_0xba75('0x1b9')});db[_0xba75('0xa2')]['belongsTo'](db[_0xba75('0xa0')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db['SalesforceField'][_0xba75('0x110')](db[_0xba75('0xa3')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xa3')][_0xba75('0x110')](db['SalesforceField'],{'as':_0xba75('0x1bb'),'foreignKey':'DescriptionId'});db[_0xba75('0xa3')][_0xba75('0x110')](db[_0xba75('0xa3')],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0xa3')][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':'VariableId'});db[_0xba75('0x1bd')]['hasMany'](db['SugarcrmConfiguration'],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xa5')]['hasMany'](db[_0xba75('0xa7')],{'as':_0xba75('0x1b6'),'onDelete':'cascade','foreignKey':_0xba75('0x1b7')});db[_0xba75('0xa5')][_0xba75('0x110')](db['SugarcrmField'],{'as':'Descriptions','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xa5')][_0xba75('0x110')](db[_0xba75('0xa7')],{'as':'Fields','onDelete':_0xba75('0x10e'),'foreignKey':'FieldId'});db['SugarcrmConfiguration'][_0xba75('0x14b')](db[_0xba75('0x1bd')],{'as':'Account','foreignKey':_0xba75('0x1b5')});db[_0xba75('0xa7')]['hasMany'](db['SugarcrmField'],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db['SugarcrmField'][_0xba75('0x110')](db[_0xba75('0xa7')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xa7')][_0xba75('0x110')](db[_0xba75('0xa7')],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0xa7')][_0xba75('0x14b')](db['Variable'],{'as':'Variable','foreignKey':_0xba75('0x1c0')});db[_0xba75('0x1c1')]['hasMany'](db[_0xba75('0x1c2')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':'AccountId'});db[_0xba75('0x1c2')]['hasMany'](db[_0xba75('0xa9')],{'as':_0xba75('0x1b6'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0x1c2')][_0xba75('0x110')](db[_0xba75('0xa9')],{'as':_0xba75('0x1b8'),'onDelete':'cascade','foreignKey':_0xba75('0x1bf')});db[_0xba75('0x1c2')]['hasMany'](db[_0xba75('0xa9')],{'as':'Fields','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b9')});db['DeskConfiguration'][_0xba75('0x14b')](db['DeskAccount'],{'as':_0xba75('0x169'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x1c3')});db[_0xba75('0xa9')][_0xba75('0x110')](db[_0xba75('0xa9')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xa9')][_0xba75('0x110')](db[_0xba75('0xa9')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xa9')][_0xba75('0x110')](db[_0xba75('0xa9')],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0xa9')][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':'Variable','foreignKey':'VariableId'});db[_0xba75('0x1c4')]['hasMany'](db[_0xba75('0x1c5')],{'as':_0xba75('0x1be'),'onDelete':'cascade','foreignKey':_0xba75('0x1b5')});db[_0xba75('0x1c5')][_0xba75('0x110')](db[_0xba75('0xab')],{'as':_0xba75('0x1b6'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db['ZohoConfiguration']['hasMany'](db[_0xba75('0xab')],{'as':_0xba75('0x1b8'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1bf')});db['ZohoConfiguration'][_0xba75('0x110')](db[_0xba75('0xab')],{'as':_0xba75('0x1b1'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0x1c5')]['belongsTo'](db[_0xba75('0x1c4')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xab')]['hasMany'](db[_0xba75('0xab')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xab')][_0xba75('0x110')](db[_0xba75('0xab')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xab')][_0xba75('0x110')](db[_0xba75('0xab')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db['ZohoField'][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db[_0xba75('0xad')][_0xba75('0x110')](db[_0xba75('0x1c6')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':'AccountId'});db[_0xba75('0x1c6')][_0xba75('0x110')](db[_0xba75('0xaf')],{'as':_0xba75('0x1b6'),'foreignKey':'SubjectId'});db[_0xba75('0x1c6')][_0xba75('0x110')](db['ZendeskField'],{'as':_0xba75('0x1b8'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0x1c6')][_0xba75('0x110')](db['ZendeskField'],{'as':_0xba75('0x1b1'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0x1c6')][_0xba75('0x14b')](db[_0xba75('0xad')],{'as':'Account','foreignKey':_0xba75('0x1b5')});db[_0xba75('0x1c6')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x1c7')});db[_0xba75('0xaf')][_0xba75('0x110')](db[_0xba75('0xaf')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db['ZendeskField'][_0xba75('0x110')](db[_0xba75('0xaf')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xaf')]['hasMany'](db[_0xba75('0xaf')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db['ZendeskField'][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':'Variable','foreignKey':_0xba75('0x1c0')});db[_0xba75('0xb1')]['hasMany'](db['FreshdeskConfiguration'],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xb3')]['hasMany'](db[_0xba75('0xb5')],{'as':_0xba75('0x1b6'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xb3')][_0xba75('0x110')](db['FreshdeskField'],{'as':_0xba75('0x1b8'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xb3')][_0xba75('0x110')](db[_0xba75('0xb5')],{'as':_0xba75('0x1b1'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0xba75('0xb3')][_0xba75('0x14b')](db['FreshdeskAccount'],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xb3')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':'int_freshdesk_configuration_has_tags'});db[_0xba75('0xb5')]['hasMany'](db[_0xba75('0xb5')],{'as':'Subject','foreignKey':'SubjectId'});db['FreshdeskField'][_0xba75('0x110')](db[_0xba75('0xb5')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xb5')][_0xba75('0x110')](db[_0xba75('0xb5')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db[_0xba75('0xb5')]['belongsTo'](db['Variable'],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db[_0xba75('0x1c8')][_0xba75('0x110')](db[_0xba75('0xb8')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xb8')][_0xba75('0x110')](db[_0xba75('0x1c9')],{'as':'Subjects','foreignKey':_0xba75('0x1b7')});db[_0xba75('0xb8')]['hasMany'](db[_0xba75('0x1c9')],{'as':_0xba75('0x1b8'),'foreignKey':_0xba75('0x1bf')});db['VtigerConfiguration']['hasMany'](db[_0xba75('0x1c9')],{'as':_0xba75('0x1b1'),'foreignKey':_0xba75('0x1b9')});db['VtigerConfiguration'][_0xba75('0x14b')](db['VtigerAccount'],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db['VtigerField']['hasMany'](db[_0xba75('0x1c9')],{'as':_0xba75('0x1ba'),'foreignKey':'SubjectId'});db['VtigerField']['hasMany'](db['VtigerField'],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db['VtigerField'][_0xba75('0x110')](db[_0xba75('0x1c9')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db[_0xba75('0x1c9')][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db['ServicenowAccount'][_0xba75('0x110')](db[_0xba75('0x1ca')],{'as':'Configurations','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db['ServicenowConfiguration']['hasMany'](db[_0xba75('0xbd')],{'as':_0xba75('0x1b6'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0x1ca')][_0xba75('0x110')](db[_0xba75('0xbd')],{'as':_0xba75('0x1b8'),'foreignKey':_0xba75('0x1bf')});db['ServicenowConfiguration']['hasMany'](db[_0xba75('0xbd')],{'as':'Fields','foreignKey':_0xba75('0x1b9')});db[_0xba75('0x1ca')][_0xba75('0x14b')](db[_0xba75('0xba')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xbd')][_0xba75('0x110')](db[_0xba75('0xbd')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xbd')][_0xba75('0x110')](db['ServicenowField'],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db['ServicenowField'][_0xba75('0x110')](db[_0xba75('0xbd')],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0xbd')]['belongsTo'](db[_0xba75('0x94')],{'as':'Variable','foreignKey':_0xba75('0x1c0')});db['Dynamics365Account'][_0xba75('0x110')](db[_0xba75('0xc1')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':'AccountId'});db[_0xba75('0xc1')][_0xba75('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db['Dynamics365Configuration'][_0xba75('0x110')](db[_0xba75('0xc3')],{'as':_0xba75('0x1b8'),'onDelete':'cascade','foreignKey':_0xba75('0x1bf')});db[_0xba75('0xc1')][_0xba75('0x110')](db[_0xba75('0xc3')],{'as':'Fields','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b9')});db['Dynamics365Configuration'][_0xba75('0x14b')](db['Dynamics365Account'],{'as':'Account','foreignKey':_0xba75('0x1b5')});db['Dynamics365Field'][_0xba75('0x110')](db[_0xba75('0xc3')],{'as':_0xba75('0x1ba'),'foreignKey':'SubjectId'});db[_0xba75('0xc3')]['hasMany'](db['Dynamics365Field'],{'as':_0xba75('0x1bb'),'foreignKey':'DescriptionId'});db[_0xba75('0xc3')][_0xba75('0x110')](db[_0xba75('0xc3')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db['Dynamics365Field'][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db[_0xba75('0xc4')][_0xba75('0x110')](db[_0xba75('0xc6')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db['FreshsalesConfiguration'][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':'Subjects','foreignKey':_0xba75('0x1b7')});db[_0xba75('0xc6')][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':'Descriptions','foreignKey':_0xba75('0x1bf')});db[_0xba75('0xc6')][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':'Fields','foreignKey':_0xba75('0x1b9')});db[_0xba75('0xc6')][_0xba75('0x14b')](db[_0xba75('0xc4')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db['FreshsalesField'][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':'Subject','foreignKey':_0xba75('0x1b7')});db['FreshsalesField'][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0x1cb')][_0xba75('0x110')](db['FreshsalesField'],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0x1cb')][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db['ChatQueueReport'][_0xba75('0x14b')](db[_0xba75('0x66')],{});db[_0xba75('0xcb')]['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0xcb')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':'Contact','foreignKey':_0xba75('0x15c')});db[_0xba75('0xcb')]['belongsTo'](db[_0xba75('0x6a')],{});db[_0xba75('0xcb')][_0xba75('0x14b')](db[_0xba75('0x192')],{});db[_0xba75('0xcb')]['belongsTo'](db['User'],{});db[_0xba75('0xcb')][_0xba75('0x14b')](db[_0xba75('0x6e')],{});db['ChatInternalMessage'][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1cc')});db[_0xba75('0xcd')][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1cd')});db[_0xba75('0x197')][_0xba75('0x110')](db['JscriptyQuestionReport'],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xba75('0x197')][_0xba75('0x110')](db[_0xba75('0xcf')],{'foreignKey':_0xba75('0x1ce'),'onDelete':'cascade'});db[_0xba75('0xd3')]['belongsTo'](db[_0xba75('0x56')],{});db[_0xba75('0xd3')][_0xba75('0x14b')](db['CmList'],{'as':_0xba75('0x165'),'foreignKey':'ListId'});db[_0xba75('0xd3')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0xd3')][_0xba75('0x14b')](db[_0xba75('0x5a')],{});db[_0xba75('0xd3')][_0xba75('0x14b')](db['SmsMessage'],{});db[_0xba75('0xd3')][_0xba75('0x14b')](db[_0xba75('0x13')],{});db['SmsQueueReport']['belongsTo'](db[_0xba75('0x5d')],{});db[_0xba75('0xd7')][_0xba75('0x110')](db['JscriptySessionReport'],{'foreignKey':_0xba75('0x1cf')});db[_0xba75('0xd7')][_0xba75('0x110')](db[_0xba75('0x1d0')],{'foreignKey':_0xba75('0x1cf')});db[_0xba75('0xd7')][_0xba75('0x110')](db['JscriptyAnswerReport'],{'foreignKey':_0xba75('0x1cf')});db[_0xba75('0x1d1')]['belongsToMany'](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':_0xba75('0x13d')});db['Team'][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':_0xba75('0x122')});db[_0xba75('0xdf')]['belongsToMany'](db['VoiceQueue'],{'through':_0xba75('0x108'),'as':_0xba75('0x12b')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x41')],{'through':_0xba75('0x1d2'),'as':'MailQueues'});db[_0xba75('0xdf')][_0xba75('0x11e')](db['ChatQueue'],{'through':'team_has_chat_queues','as':_0xba75('0x12f')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x17e')],{'through':'team_has_fax_queues','as':_0xba75('0x130')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x5d')],{'through':_0xba75('0x1d3'),'as':_0xba75('0x131')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x132')],{'through':_0xba75('0x18c'),'as':_0xba75('0x133')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x104')],{'through':_0xba75('0x1d4'),'as':_0xba75('0x134')});db['Team']['belongsToMany'](db[_0xba75('0xf4')],{'through':_0xba75('0x10a'),'as':_0xba75('0x12c')});db[_0xba75('0xe2')][_0xba75('0x110')](db[_0xba75('0x76')],{'as':_0xba75('0x148'),'foreignKey':_0xba75('0x1d5')});db[_0xba75('0xe2')][_0xba75('0x110')](db[_0xba75('0x79')],{'as':'HopperFinals','foreignKey':_0xba75('0x1d5')});db[_0xba75('0xe2')][_0xba75('0x110')](db[_0xba75('0x7b')],{'as':'HopperHistories','foreignKey':'CampaignId'});db[_0xba75('0xe2')]['hasMany'](db[_0xba75('0x78')],{'as':'HopperBlacks','foreignKey':_0xba75('0x1d5')});db['Campaign']['belongsTo'](db[_0xba75('0x29')],{'as':_0xba75('0x29'),'foreignKey':_0xba75('0x14c')});db[_0xba75('0xe2')]['belongsTo'](db[_0xba75('0x29')],{'as':_0xba75('0x14d'),'foreignKey':'TrunkBackupId'});db[_0xba75('0xe2')][_0xba75('0x14b')](db[_0xba75('0x87')],{'as':_0xba75('0x87'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0xe2')][_0xba75('0x14b')](db[_0xba75('0x1d1')],{'as':_0xba75('0x1d1'),'foreignKey':_0xba75('0x1d6')});db[_0xba75('0xe2')]['belongsToMany'](db[_0xba75('0xf2')],{'as':_0xba75('0x121'),'through':_0xba75('0x1d7')});db[_0xba75('0xe2')][_0xba75('0x11e')](db[_0xba75('0xf2')],{'as':'BlackLists','through':_0xba75('0x1d8')});db[_0xba75('0x170')]['belongsTo'](db[_0xba75('0x6d')],{'as':_0xba75('0x6d'),'foreignKey':_0xba75('0x174')});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x46')],{});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x123')],{});db['MailTransferReport'][_0xba75('0x14b')](db[_0xba75('0x15d')],{'foreignKey':_0xba75('0x1d9'),'as':'FromAccount'});db[_0xba75('0xe9')][_0xba75('0x14b')](db['User'],{'foreignKey':_0xba75('0x1da'),'as':_0xba75('0x1db')});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x41')],{'foreignKey':'ToMailQueueId','as':_0xba75('0x1de')});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x15d')],{'foreignKey':'ToMailAccountId','as':_0xba75('0x1df')});db[_0xba75('0xea')][_0xba75('0x14b')](db[_0xba75('0x192')],{});db[_0xba75('0xea')]['belongsTo'](db[_0xba75('0x6a')],{});db['ChatTransferReport'][_0xba75('0x14b')](db[_0xba75('0x66')],{'foreignKey':_0xba75('0x1e0'),'as':'FromAccount'});db[_0xba75('0xea')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1da'),'as':'FromAgent'});db['ChatTransferReport'][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db[_0xba75('0xea')][_0xba75('0x14b')](db[_0xba75('0x6e')],{'foreignKey':'ToChatQueueId','as':_0xba75('0x1de')});db[_0xba75('0xea')][_0xba75('0x14b')](db[_0xba75('0x66')],{'foreignKey':_0xba75('0x1e1'),'as':'ToAccount'});db['FaxTransferReport'][_0xba75('0x14b')](db[_0xba75('0x52')],{});db[_0xba75('0xec')][_0xba75('0x14b')](db[_0xba75('0x118')],{});db[_0xba75('0xec')][_0xba75('0x14b')](db[_0xba75('0x4e')],{'foreignKey':_0xba75('0x1e2'),'as':_0xba75('0x1e3')});db[_0xba75('0xec')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':'FromUserId','as':_0xba75('0x1db')});db[_0xba75('0xec')][_0xba75('0x14b')](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db['FaxTransferReport'][_0xba75('0x14b')](db[_0xba75('0x17e')],{'foreignKey':_0xba75('0x1e4'),'as':_0xba75('0x1de')});db[_0xba75('0xec')][_0xba75('0x14b')](db['FaxAccount'],{'foreignKey':_0xba75('0x1e5'),'as':'ToAccount'});db[_0xba75('0xee')][_0xba75('0x14b')](db['OpenchannelMessage'],{});db[_0xba75('0xee')][_0xba75('0x14b')](db['OpenchannelInteraction'],{});db[_0xba75('0xee')]['belongsTo'](db[_0xba75('0x5f')],{'foreignKey':_0xba75('0x1e6'),'as':_0xba75('0x1e3')});db['OpenchannelTransferReport'][_0xba75('0x14b')](db['User'],{'foreignKey':_0xba75('0x1da'),'as':_0xba75('0x1db')});db[_0xba75('0xee')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db['OpenchannelTransferReport'][_0xba75('0x14b')](db[_0xba75('0x132')],{'foreignKey':_0xba75('0x1e7'),'as':_0xba75('0x1de')});db[_0xba75('0xee')][_0xba75('0x14b')](db['OpenchannelAccount'],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport'][_0xba75('0x14b')](db['SmsMessage'],{});db[_0xba75('0xf0')][_0xba75('0x14b')](db[_0xba75('0x5a')],{});db['SmsTransferReport'][_0xba75('0x14b')](db[_0xba75('0x56')],{'foreignKey':_0xba75('0x1e8'),'as':_0xba75('0x1e3')});db[_0xba75('0xf0')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1da'),'as':_0xba75('0x1db')});db[_0xba75('0xf0')][_0xba75('0x14b')](db['User'],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db[_0xba75('0xf0')][_0xba75('0x14b')](db['SmsQueue'],{'foreignKey':_0xba75('0x1e9'),'as':_0xba75('0x1de')});db[_0xba75('0xf0')][_0xba75('0x14b')](db[_0xba75('0x56')],{'foreignKey':'ToSmsAccountId','as':_0xba75('0x1df')});db[_0xba75('0xf2')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':'ListId','onDelete':_0xba75('0x10e')});db[_0xba75('0xf2')][_0xba75('0x110')](db['CmCustomField'],{'as':_0xba75('0x1ea'),'foreignKey':'ListId'});db['CmList'][_0xba75('0x110')](db[_0xba75('0x74')],{'as':'Contacts','onDelete':_0xba75('0x10e'),'foreignKey':'ListId'});db[_0xba75('0xf2')][_0xba75('0x110')](db[_0xba75('0x79')],{'as':_0xba75('0x113'),'foreignKey':'ListId'});db['CmList'][_0xba75('0x110')](db[_0xba75('0x7b')],{'as':'HopperHistory','foreignKey':_0xba75('0x178')});db[_0xba75('0xf2')][_0xba75('0x110')](db[_0xba75('0x115')],{'as':_0xba75('0x115'),'foreignKey':'ListId'});db[_0xba75('0xf2')]['belongsToMany'](db[_0xba75('0x1a')],{'as':_0xba75('0x1eb'),'through':_0xba75('0x151')});db[_0xba75('0xf2')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x1ec')});db[_0xba75('0xf4')][_0xba75('0x110')](db[_0xba75('0x18')],{'as':'Extensions','onDelete':_0xba75('0x10e')});db[_0xba75('0xf4')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':'UserVoicePrefix'});db[_0xba75('0xf4')][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':_0xba75('0x10a'),'as':'Teams'});db[_0xba75('0x11d')]['hasMany'](db['User'],{'as':_0xba75('0x16f'),'foreignKey':_0xba75('0x1ed')});db[_0xba75('0x11d')][_0xba75('0x110')](db[_0xba75('0xf6')],{'as':_0xba75('0x1ee'),'foreignKey':_0xba75('0x1ed'),'onDelete':_0xba75('0x10e')});db[_0xba75('0xf6')][_0xba75('0x110')](db[_0xba75('0x1ef')],{'as':_0xba75('0x1f0'),'foreignKey':'sectionId','onDelete':_0xba75('0x10e')});db[_0xba75('0x13a')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':'Dispositions','foreignKey':_0xba75('0x1f1'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x13a')]['hasMany'](db[_0xba75('0x82')],{'as':'Answers','foreignKey':_0xba75('0x1f1')});db['WhatsappAccount'][_0xba75('0x110')](db[_0xba75('0xff')],{'as':_0xba75('0x154'),'foreignKey':_0xba75('0x1f1')});db[_0xba75('0x13a')][_0xba75('0x110')](db['WhatsappInteraction'],{'as':_0xba75('0x163')});db[_0xba75('0x13a')][_0xba75('0x110')](db['WhatsappApplication'],{'as':'Applications'});db[_0xba75('0x13a')]['belongsTo'](db['CmList'],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x13a')][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':_0xba75('0x150'),'foreignKey':_0xba75('0x166')});db[_0xba75('0x13a')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x13c')});db[_0xba75('0xfc')][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x175')});db[_0xba75('0xfc')][_0xba75('0x14b')](db['WhatsappQueue'],{'onDelete':_0xba75('0x175')});db['WhatsappApplication'][_0xba75('0x14b')](db[_0xba75('0x13a')],{'onDelete':_0xba75('0x175')});db[_0xba75('0xfc')][_0xba75('0x14b')](db['Interval'],{'onDelete':_0xba75('0x175'),'foreignKey':'IntervalId'});db[_0xba75('0xfc')][_0xba75('0x14b')](db[_0xba75('0x16b')],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x176')});db['WhatsappInteraction'][_0xba75('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1f2')});db[_0xba75('0xfe')][_0xba75('0x14b')](db[_0xba75('0x13a')],{'as':'Account','foreignKey':_0xba75('0x1f1')});db['WhatsappInteraction'][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':'ContactId'});db['WhatsappInteraction'][_0xba75('0x14b')](db['User'],{'as':'Owner','foreignKey':_0xba75('0x10f')});db[_0xba75('0xfe')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':'whatsapp_interaction_has_tags','as':_0xba75('0x16d')});db[_0xba75('0xfe')][_0xba75('0x11e')](db['Tag'],{'through':_0xba75('0x1aa'),'as':_0xba75('0x16e')});db[_0xba75('0xfe')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Users','through':_0xba75('0x12a'),'foreignKey':_0xba75('0x1f2')});db[_0xba75('0xff')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x13')});db['WhatsappMessage']['belongsTo'](db[_0xba75('0x74')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b')});db[_0xba75('0xff')][_0xba75('0x14b')](db[_0xba75('0xfe')],{'onDelete':'cascade','as':_0xba75('0x172'),'foreignKey':_0xba75('0x1f2')});db[_0xba75('0xff')][_0xba75('0x14b')](db[_0xba75('0x13a')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1f1')});db[_0xba75('0x101')][_0xba75('0x14b')](db[_0xba75('0x13a')],{});db['WhatsappQueueReport']['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x101')][_0xba75('0x14b')](db['CmContact'],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db['WhatsappQueueReport'][_0xba75('0x14b')](db[_0xba75('0xfe')],{});db[_0xba75('0x101')][_0xba75('0x14b')](db[_0xba75('0x104')],{});db[_0xba75('0x101')]['belongsTo'](db[_0xba75('0xff')],{});db['WhatsappQueueReport'][_0xba75('0x14b')](db[_0xba75('0x13')],{});db[_0xba75('0x102')][_0xba75('0x14b')](db[_0xba75('0xff')],{});db[_0xba75('0x102')]['belongsTo'](db[_0xba75('0xfe')],{});db[_0xba75('0x102')][_0xba75('0x14b')](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db['WhatsappTransferReport'][_0xba75('0x14b')](db['WhatsappAccount'],{'foreignKey':_0xba75('0x1f3'),'as':_0xba75('0x1df')});db[_0xba75('0x102')][_0xba75('0x14b')](db[_0xba75('0x104')],{'foreignKey':'ToQueueId','as':_0xba75('0x1de')});db['WhatsappTransferReport'][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xba75('0x102')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db['WhatsappQueue']['belongsToMany'](db[_0xba75('0x13')],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':'WhatsappQueueId'});db[_0xba75('0x104')][_0xba75('0x11e')](db['Team'],{'through':_0xba75('0x1d4'),'as':_0xba75('0x167')});module[_0xba75('0x1f4')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa74f=['MailAccountId','Imap','hasOne','Smtp','Dispositions','Answers','Interactions','List','ListId','TemplateId','mandatoryDispositionPause','mandatoryDispositionPauseId','Team','team_has_mail_queues','MailInteractionId','Account','mail_interaction_has_tags','Tags','Interaction','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','restrict','IntervalId','TagId','DashboardItem','Exntensions','FaxAccountId','fax_interaction_has_tags','ThroughTags','Users','FaxInteractionId','Attachment','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteraction','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','Pause','OpenchannelQueueId','OpenchannelInteractionId','Owner','openchannel_interaction_has_tags','ProactiveActions','ChatMessage','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','Attachments','team_has_chat_queues','ChatGroupId','CompanyId','Company','cm_contact_has_tags','CampaignId','OwnerId','All','OneAll','AutomationAllId','Any','AutomationAnyId','Actions','ParentId','ChatApplications','FaxApplications','SmsApplications','Schedule','CustomReportId','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','Trigger','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','DefaultReportId','Fields','MetricId','SalesforceAccount','Configurations','AccountId','SalesforceField','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Subjects','Field','VariableId','DeskAccount','DeskField','int_desk_configuration_has_tags','ZendeskAccount','ZendeskField','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerConfiguration','FromId','SessionId','SmsQueueReport','ProjectId','MailQueues','ChatQueues','FaxQueues','SmsQueues','team_has_openchannel_queues','team_has_whatsapp_queues','TrunkId','TrunkBackupId','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','FromUserId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','CustomFields','Queues','userProfileId','UserProfileSections','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappMessage','WhatsappInteractionId','ToWhatsappAccountId','ToQueueId','exports','lodash','sequelize','defaultsDeep','motion2','xC@LL1234','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','xcall','127.0.0.1','database','password','options','username','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','Condition','../api/condition/condition.model','Interval','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../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','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','SmsTransferReport','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','VoiceMail','cascade','UserId','hasMany','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','SmsInteractions','FaxInteractions','MailInteraction','WhatsappInteractions','UserNotifications','SenderId','belongsTo','belongsToMany','chat_group_has_users','Contacts','cm_user_has_contacts','cm_user_has_lists','user_has_teams','MailInteractions','user_has_mail_interactions','ChatInteractions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','UserMailQueue','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','ChatWebsite','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','SquareProjects','user_has_square_projects','ChanSpyId','Applications','Sounds','Members','VoiceQueueId','Hoppers','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessions','Trunk','TrunkBackup','Lists','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceQueueReport','QueueCalls','uniqueid','AgentReports','Contact','ContactId'];(function(_0x4bd611,_0x23855a){var _0x5d5606=function(_0x56b564){while(--_0x56b564){_0x4bd611['push'](_0x4bd611['shift']());}};_0x5d5606(++_0x23855a);}(_0xa74f,0x9a));var _0xfa74=function(_0x11f226,_0x491e30){_0x11f226=_0x11f226-0x0;var _0x30be77=_0xa74f[_0x11f226];return _0x30be77;};'use strict';var config=require('../config/environment');var Sequelize=require('sequelize');var _=require(_0xfa74('0x0'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0xfa74('0x1')]=_[_0xfa74('0x2')](config[_0xfa74('0x1')],{'database':_0xfa74('0x3'),'username':'xcall','password':_0xfa74('0x4'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xfa74('0x5')},'logging':![],'timezone':timezone[_0xfa74('0x6')](),'define':{'charset':_0xfa74('0x7'),'collate':_0xfa74('0x8')}}});config[_0xfa74('0x9')]=_[_0xfa74('0x2')](config['sequelizeHistory'],{'database':_0xfa74('0x3'),'username':_0xfa74('0xa'),'password':_0xfa74('0x4'),'options':{'host':_0xfa74('0xb'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xfa74('0x5')},'logging':![],'timezone':timezone[_0xfa74('0x6')](),'define':{'charset':'utf8','collate':_0xfa74('0x8')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xfa74('0x1')][_0xfa74('0xc')],config[_0xfa74('0x1')]['username'],config[_0xfa74('0x1')][_0xfa74('0xd')],config[_0xfa74('0x1')][_0xfa74('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0xfa74('0xc')],config[_0xfa74('0x9')][_0xfa74('0xf')],config[_0xfa74('0x9')][_0xfa74('0xd')],config['sequelizeHistory'][_0xfa74('0xe')])};db[_0xfa74('0x10')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x12'));db[_0xfa74('0x13')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x14'));db[_0xfa74('0x15')]=db['sequelize']['import'](_0xfa74('0x16'));db[_0xfa74('0x17')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x18'));db[_0xfa74('0x19')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x1a'));db[_0xfa74('0x1b')]=db[_0xfa74('0x1')]['import']('../api/voiceQueue/voiceQueue.model');db[_0xfa74('0x1c')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x1d'));db[_0xfa74('0x1e')]=db['sequelize']['import'](_0xfa74('0x1f'));db['VoiceMail']=db['sequelize']['import'](_0xfa74('0x20'));db[_0xfa74('0x21')]=db[_0xfa74('0x1')]['import']('../api/voiceMailMessage/voiceMailMessage.model');db[_0xfa74('0x22')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x23'));db['VoiceDialReport']=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/voiceDialReport/voiceDialReport.model');db[_0xfa74('0x24')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x25'));db['VoiceQueueReport']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x26'));db['MemberReport']=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x27'));db['Trunk']=db['sequelize'][_0xfa74('0x11')]('../api/trunk/trunk.model');db[_0xfa74('0x28')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x29'));db[_0xfa74('0x2a')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x2b'));db[_0xfa74('0x2c')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x2d'));db[_0xfa74('0x2e')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x2f'));db['UserMailQueue']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x30'));db[_0xfa74('0x31')]=db['sequelize']['import'](_0xfa74('0x32'));db[_0xfa74('0x33')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/userSmsQueue/userSmsQueue.model');db[_0xfa74('0x34')]=db[_0xfa74('0x1')]['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db['UserWhatsappQueue']=db['sequelize']['import'](_0xfa74('0x35'));db[_0xfa74('0x36')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x37'));db[_0xfa74('0x38')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x39'));db['MailAccount']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x3a'));db[_0xfa74('0x3b')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/mailQueue/mailQueue.model');db[_0xfa74('0x3c')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x3d'));db['MailInteraction']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x3e'));db[_0xfa74('0x3f')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x40'));db[_0xfa74('0x41')]=db['sequelize']['import'](_0xfa74('0x42'));db[_0xfa74('0x43')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/mailQueueReport/mailQueueReport.model');db[_0xfa74('0x44')]=db[_0xfa74('0x1')]['import']('../api/dashboard/dashboard.model');db['DashboardItem']=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x45'));db[_0xfa74('0x46')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x47'));db[_0xfa74('0x48')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x49'));db[_0xfa74('0x4a')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/faxInteraction/faxInteraction.model');db[_0xfa74('0x4b')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x4c'));db[_0xfa74('0x4d')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x4e'));db[_0xfa74('0x4f')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x50'));db['SmsAccount']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x51'));db[_0xfa74('0x52')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x53'));db['SmsInteraction']=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/smsInteraction/smsInteraction.model');db[_0xfa74('0x54')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x55'));db[_0xfa74('0x56')]=db['sequelize']['import'](_0xfa74('0x57'));db[_0xfa74('0x58')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x59'));db[_0xfa74('0x5a')]=db['sequelize']['import'](_0xfa74('0x5b'));db[_0xfa74('0x5c')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x5d'));db[_0xfa74('0x5e')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/openchannelMessage/openchannelMessage.model');db[_0xfa74('0x5f')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x60'));db['ChatWebsite']=db['sequelize'][_0xfa74('0x11')]('../api/chatWebsite/chatWebsite.model');db[_0xfa74('0x61')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x62'));db[_0xfa74('0x63')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/chatApplication/chatApplication.model');db[_0xfa74('0x64')]=db['sequelize'][_0xfa74('0x11')]('../api/chatInteraction/chatInteraction.model');db['ChatMessage']=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x65'));db[_0xfa74('0x66')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x67'));db[_0xfa74('0x68')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/chatGroup/chatGroup.model');db[_0xfa74('0x69')]=db[_0xfa74('0x1')]['import']('../api/chatProactiveAction/chatProactiveAction.model');db[_0xfa74('0x6a')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x6b'));db[_0xfa74('0x6c')]=db['sequelize'][_0xfa74('0x11')]('../api/cmContact/cmContact.model');db[_0xfa74('0x6d')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/cmHopper/cmHopper.model');db['CmHopperBlack']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x6e'));db[_0xfa74('0x6f')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x70'));db['CmHopperHistory']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x71'));db[_0xfa74('0x72')]=db['sequelize'][_0xfa74('0x11')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0xfa74('0x73')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x74'));db[_0xfa74('0x75')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x76'));db[_0xfa74('0x77')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x78'));db[_0xfa74('0x79')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/cannedAnswer/cannedAnswer.model');db[_0xfa74('0x7a')]=db[_0xfa74('0x1')]['import']('../api/disposition/disposition.model');db[_0xfa74('0x7b')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x7c'));db[_0xfa74('0x7d')]=db['sequelize'][_0xfa74('0x11')]('../api/interval/interval.model');db['Pause']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x7e'));db[_0xfa74('0x7f')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x80'));db[_0xfa74('0x81')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x82'));db['Schedule']=db[_0xfa74('0x1')]['import'](_0xfa74('0x83'));db[_0xfa74('0x84')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x85'));db[_0xfa74('0x86')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x87'));db[_0xfa74('0x88')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x89'));db['Trigger']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x8a'));db[_0xfa74('0x8b')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x8c'));db[_0xfa74('0x8d')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x8e'));db[_0xfa74('0x8f')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x90'));db[_0xfa74('0x91')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x92'));db[_0xfa74('0x93')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x94'));db[_0xfa74('0x95')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xfa74('0x96')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x97'));db['AnalyticFieldReport']=db[_0xfa74('0x1')]['import']('../api/analyticFieldReport/analyticFieldReport.model');db[_0xfa74('0x98')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x99'));db['SalesforceAccount']=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x9a'));db[_0xfa74('0x9b')]=db[_0xfa74('0x1')]['import']('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db['SalesforceField']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x9c'));db[_0xfa74('0x9d')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x9e'));db[_0xfa74('0x9f')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xa0'));db[_0xfa74('0xa1')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xa2'));db['DeskAccount']=db['sequelize']['import'](_0xfa74('0xa3'));db[_0xfa74('0xa4')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xa5'));db['DeskField']=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/intDeskField/intDeskField.model');db[_0xfa74('0xa6')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0xa7'));db[_0xfa74('0xa8')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xa9'));db[_0xfa74('0xaa')]=db[_0xfa74('0x1')]['import']('../api/intZohoField/intZohoField.model');db['ZendeskAccount']=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0xfa74('0xab')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xac'));db['ZendeskField']=db[_0xfa74('0x1')]['import']('../api/intZendeskField/intZendeskField.model');db[_0xfa74('0xad')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xfa74('0xae')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xaf'));db['FreshdeskField']=db['sequelize']['import'](_0xfa74('0xb0'));db[_0xfa74('0xb1')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xb2'));db['VtigerConfiguration']=db['sequelize'][_0xfa74('0x11')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0xfa74('0xb3')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xb4'));db[_0xfa74('0xb5')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xb6'));db[_0xfa74('0xb7')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0xb8'));db[_0xfa74('0xb9')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xba'));db[_0xfa74('0xbb')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xbc'));db[_0xfa74('0xbd')]=db['sequelize']['import'](_0xfa74('0xbe'));db[_0xfa74('0xbf')]=db[_0xfa74('0x1')]['import']('../api/intDynamics365Field/intDynamics365Field.model');db[_0xfa74('0xc0')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xc1'));db[_0xfa74('0xc2')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0xfa74('0xc3')]=db['sequelize']['import'](_0xfa74('0xc4'));db[_0xfa74('0x8d')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x8e'));db['Network']=db['sequelize'][_0xfa74('0x11')](_0xfa74('0xc5'));db[_0xfa74('0xc6')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xc7'));db['ChatInternalMessage']=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0xfa74('0xc8')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xfa74('0xc9')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xca'));db[_0xfa74('0xcb')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xcc'));db['SmsQueueReport']=db['sequelize'][_0xfa74('0x11')]('../api/smsQueueReport/smsQueueReport.model');db[_0xfa74('0xcd')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xce'));db[_0xfa74('0xcf')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xd0'));db[_0xfa74('0xd1')]=db[_0xfa74('0x1')]['import']('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db['sequelize'][_0xfa74('0x11')](_0xfa74('0xd2'));db['SquareOdbc']=db[_0xfa74('0x1')]['import'](_0xfa74('0xd3'));db[_0xfa74('0xd4')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xd5'));db[_0xfa74('0xd6')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xd7'));db[_0xfa74('0xd8')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xd9'));db['Team']=db[_0xfa74('0x1')]['import'](_0xfa74('0xda'));db[_0xfa74('0xdb')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xdc'));db[_0xfa74('0xdd')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xde'));db['Migration']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xdf'));db['Attachment']=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/attachment/attachment.model');db[_0xfa74('0xe0')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xe1'));db[_0xfa74('0xe2')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xe3'));db[_0xfa74('0xe4')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xe5'));db[_0xfa74('0xe6')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/faxTransferReport/faxTransferReport.model');db[_0xfa74('0xe7')]=db['sequelize'][_0xfa74('0x11')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0xfa74('0xe8')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/smsTransferReport/smsTransferReport.model');db[_0xfa74('0xe9')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0xea'));db[_0xfa74('0xeb')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xec'));db[_0xfa74('0xed')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xee'));db[_0xfa74('0xef')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xf0'));db[_0xfa74('0xf1')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xf2'));db[_0xfa74('0xf3')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xf4'));db[_0xfa74('0xf5')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0xf6'));db[_0xfa74('0xf7')]=db['sequelize']['import'](_0xfa74('0xf8'));db[_0xfa74('0xf9')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xfa'));db['WhatsappMessage']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xfb'));db[_0xfa74('0xfc')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xfd'));db[_0xfa74('0xfe')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0xfa74('0xff')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x100'));db[_0xfa74('0x101')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x102'));db[_0xfa74('0x103')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x104'));db[_0xfa74('0x105')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x106'));db[_0xfa74('0x107')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x108'));db[_0xfa74('0x10')]['hasOne'](db[_0xfa74('0x109')],{'as':'VoiceMail','onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x10')][_0xfa74('0x10c')](db[_0xfa74('0x1c')],{'as':'Recordings','foreignKey':'UserId'});db[_0xfa74('0x10')][_0xfa74('0x10c')](db[_0xfa74('0x2a')],{'as':_0xfa74('0x10d'),'foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x10')][_0xfa74('0x10c')](db[_0xfa74('0x17')],{'as':_0xfa74('0x10e'),'onDelete':'cascade','hooks':!![]});db['User'][_0xfa74('0x10c')](db[_0xfa74('0x6f')],{'as':_0xfa74('0x10f'),'foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x10')][_0xfa74('0x10c')](db['CmHopperHistory'],{'as':_0xfa74('0x110'),'foreignKey':_0xfa74('0x10b')});db['User'][_0xfa74('0x10c')](db[_0xfa74('0x72')],{'as':_0xfa74('0x72'),'foreignKey':_0xfa74('0x10b')});db['User'][_0xfa74('0x10c')](db[_0xfa74('0x5c')],{'as':_0xfa74('0x111'),'foreignKey':'UserId'});db[_0xfa74('0x10')][_0xfa74('0x10c')](db[_0xfa74('0x64')],{'as':'ChatInteractions','foreignKey':_0xfa74('0x10b')});db['User'][_0xfa74('0x10c')](db['SmsInteraction'],{'as':_0xfa74('0x112'),'foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x10')][_0xfa74('0x10c')](db[_0xfa74('0x4a')],{'as':_0xfa74('0x113'),'foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x10')][_0xfa74('0x10c')](db[_0xfa74('0x114')],{'as':'MailInteractions','foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x10')][_0xfa74('0x10c')](db[_0xfa74('0xf9')],{'as':_0xfa74('0x115'),'foreignKey':'UserId'});db[_0xfa74('0x10')][_0xfa74('0x10c')](db['UserNotification'],{'as':_0xfa74('0x116'),'foreignKey':_0xfa74('0x117')});db['User'][_0xfa74('0x118')](db[_0xfa74('0xed')],{'as':'UserProfile','foreignKey':'userProfileId'});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0x68')],{'as':'Groups','through':_0xfa74('0x11a')});db[_0xfa74('0x10')][_0xfa74('0x119')](db['CmContact'],{'as':_0xfa74('0x11b'),'through':_0xfa74('0x11c')});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0xe9')],{'as':'Lists','through':_0xfa74('0x11d')});db[_0xfa74('0x10')][_0xfa74('0x119')](db['Team'],{'through':_0xfa74('0x11e')});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0x114')],{'as':_0xfa74('0x11f'),'through':_0xfa74('0x120')});db['User'][_0xfa74('0x119')](db[_0xfa74('0x64')],{'as':_0xfa74('0x121'),'through':'user_has_chat_interactions'});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0x4a')],{'as':'FaxInteractions','through':'user_has_fax_interactions'});db['User'][_0xfa74('0x119')](db['SmsInteraction'],{'as':_0xfa74('0x112'),'through':_0xfa74('0x122')});db['User'][_0xfa74('0x119')](db[_0xfa74('0x5c')],{'as':_0xfa74('0x111'),'through':_0xfa74('0x123')});db[_0xfa74('0x10')][_0xfa74('0x119')](db['WhatsappInteraction'],{'as':_0xfa74('0x115'),'through':_0xfa74('0x124')});db['User'][_0xfa74('0x119')](db['VoiceQueue'],{'as':_0xfa74('0x125'),'through':_0xfa74('0x2c'),'required':![]});db['User'][_0xfa74('0x119')](db[_0xfa74('0xeb')],{'as':_0xfa74('0x126'),'through':_0xfa74('0x107'),'required':![]});db['User'][_0xfa74('0x119')](db[_0xfa74('0x3b')],{'as':'MailQueues','through':_0xfa74('0x127'),'required':![]});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0x66')],{'as':'ChatQueues','through':'UserChatQueue','required':![],'hooks':!![]});db[_0xfa74('0x10')]['belongsToMany'](db[_0xfa74('0x4d')],{'as':'FaxQueues','through':_0xfa74('0x31'),'required':![]});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0x56')],{'as':'SmsQueues','through':_0xfa74('0x33'),'required':![]});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0x5f')],{'as':_0xfa74('0x128'),'through':_0xfa74('0x34'),'required':![]});db[_0xfa74('0x10')]['belongsToMany'](db[_0xfa74('0xff')],{'as':_0xfa74('0x129'),'through':_0xfa74('0x12a'),'required':![]});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0xe9')],{'through':_0xfa74('0x11d')});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0x12b')],{'as':_0xfa74('0x12c'),'through':_0xfa74('0x12d')});db[_0xfa74('0x10')]['belongsToMany'](db[_0xfa74('0x46')],{'as':'FaxAccounts','through':_0xfa74('0x12e')});db[_0xfa74('0x10')]['belongsToMany'](db[_0xfa74('0x12f')],{'as':_0xfa74('0x130'),'through':_0xfa74('0x131')});db['User'][_0xfa74('0x119')](db[_0xfa74('0x58')],{'as':_0xfa74('0x132'),'through':_0xfa74('0x133')});db[_0xfa74('0x10')]['belongsToMany'](db[_0xfa74('0x134')],{'as':'SmsAccounts','through':'user_has_sms_accounts'});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0xf5')],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0xd4')],{'as':_0xfa74('0x135'),'through':_0xfa74('0x136')});db['VoiceChanSpy'][_0xfa74('0x10c')](db[_0xfa74('0x17')],{'as':'SpiedAgents','onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x137')});db['VoiceContext'][_0xfa74('0x10c')](db['VoiceExtension'],{'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x17')][_0xfa74('0x10c')](db[_0xfa74('0x17')],{'as':_0xfa74('0x138'),'onDelete':'cascade'});db[_0xfa74('0x19')][_0xfa74('0x119')](db[_0xfa74('0x84')],{'as':_0xfa74('0x139'),'through':'moh_has_sounds'});db['VoiceQueue'][_0xfa74('0x10c')](db['UserVoiceQueueRt'],{'as':_0xfa74('0x13a'),'foreignKey':_0xfa74('0x13b')});db[_0xfa74('0x1b')][_0xfa74('0x10c')](db['CmHopper'],{'as':_0xfa74('0x13c'),'foreignKey':'VoiceQueueId'});db[_0xfa74('0x1b')][_0xfa74('0x10c')](db[_0xfa74('0x6f')],{'as':_0xfa74('0x10f'),'foreignKey':_0xfa74('0x13b')});db['VoiceQueue'][_0xfa74('0x10c')](db['CmHopperHistory'],{'as':_0xfa74('0x13d'),'foreignKey':'VoiceQueueId'});db[_0xfa74('0x1b')]['hasMany'](db[_0xfa74('0x72')],{'as':'ReportAgentPreview','foreignKey':_0xfa74('0x13b')});db['VoiceQueue'][_0xfa74('0x10c')](db[_0xfa74('0x13e')],{'as':_0xfa74('0x13f'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xfa74('0x10c')](db[_0xfa74('0xcb')],{'as':_0xfa74('0x140'),'foreignKey':_0xfa74('0x13b')});db['VoiceQueue'][_0xfa74('0x118')](db[_0xfa74('0x141')],{'as':_0xfa74('0x141'),'foreignKey':'TrunkId'});db[_0xfa74('0x1b')][_0xfa74('0x118')](db[_0xfa74('0x141')],{'as':_0xfa74('0x142'),'foreignKey':'TrunkBackupId'});db[_0xfa74('0x1b')][_0xfa74('0x118')](db[_0xfa74('0x7d')],{'as':_0xfa74('0x7d'),'foreignKey':'IntervalId'});db['VoiceQueue'][_0xfa74('0x118')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['VoiceQueue'][_0xfa74('0x119')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x143'),'through':_0xfa74('0x144')});db[_0xfa74('0x1b')][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x145'),'through':_0xfa74('0x2c')});db[_0xfa74('0x1b')][_0xfa74('0x119')](db['Team'],{'as':_0xfa74('0x146'),'through':_0xfa74('0x103')});db[_0xfa74('0x1b')]['belongsToMany'](db[_0xfa74('0xe9')],{'as':_0xfa74('0x147'),'through':_0xfa74('0x148')});db[_0xfa74('0x1c')][_0xfa74('0x118')](db['User'],{'as':'User','foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x1e')]['belongsTo'](db[_0xfa74('0x10')],{'as':_0xfa74('0x10'),'foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x109')][_0xfa74('0x10c')](db['VoiceMailMessage'],{'as':_0xfa74('0x149'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x14a'),'sourceKey':_0xfa74('0x14b')});db[_0xfa74('0x21')]['belongsTo'](db['VoiceMail'],{'foreignKey':_0xfa74('0x14a'),'targetKey':_0xfa74('0x14b')});db['VoiceCallReport'][_0xfa74('0x10c')](db[_0xfa74('0x14c')],{'as':_0xfa74('0x14d'),'foreignKey':_0xfa74('0x14e'),'constraints':![]});db[_0xfa74('0x22')][_0xfa74('0x10c')](db['VoiceAgentReport'],{'as':_0xfa74('0x14f'),'foreignKey':'uniqueid','constraints':![]});db[_0xfa74('0x22')]['belongsTo'](db['User'],{'as':_0xfa74('0x10'),'foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x22')][_0xfa74('0x118')](db['CmContact'],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151')});db[_0xfa74('0x36')][_0xfa74('0x118')](db[_0xfa74('0x12f')],{'as':_0xfa74('0x12f'),'foreignKey':_0xfa74('0x152')});db[_0xfa74('0x38')][_0xfa74('0x118')](db[_0xfa74('0x12f')],{'as':_0xfa74('0x12f'),'foreignKey':_0xfa74('0x152')});db[_0xfa74('0x12f')]['hasOne'](db[_0xfa74('0x36')],{'as':_0xfa74('0x153'),'onDelete':'cascade'});db[_0xfa74('0x12f')][_0xfa74('0x154')](db[_0xfa74('0x38')],{'as':_0xfa74('0x155'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x12f')][_0xfa74('0x10c')](db[_0xfa74('0x7a')],{'as':_0xfa74('0x156'),'foreignKey':_0xfa74('0x152'),'onDelete':'cascade'});db[_0xfa74('0x12f')][_0xfa74('0x10c')](db[_0xfa74('0x79')],{'as':_0xfa74('0x157'),'foreignKey':_0xfa74('0x152')});db[_0xfa74('0x12f')][_0xfa74('0x10c')](db[_0xfa74('0x3f')],{'as':_0xfa74('0x149'),'foreignKey':_0xfa74('0x152')});db[_0xfa74('0x12f')][_0xfa74('0x10c')](db[_0xfa74('0x114')],{'as':_0xfa74('0x158')});db[_0xfa74('0x12f')]['hasMany'](db[_0xfa74('0x41')],{'as':_0xfa74('0x138')});db['MailAccount'][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0x12f')][_0xfa74('0x118')](db[_0xfa74('0x88')],{'as':_0xfa74('0x88'),'foreignKey':_0xfa74('0x15b')});db[_0xfa74('0x12f')][_0xfa74('0x118')](db['Pause'],{'as':_0xfa74('0x15c'),'foreignKey':_0xfa74('0x15d')});db[_0xfa74('0x12f')][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x145'),'through':_0xfa74('0x131')});db[_0xfa74('0x3b')][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x145'),'through':_0xfa74('0x127')});db[_0xfa74('0x3b')][_0xfa74('0x119')](db[_0xfa74('0x15e')],{'through':_0xfa74('0x15f'),'as':_0xfa74('0x146')});db[_0xfa74('0x114')][_0xfa74('0x10c')](db['MailMessage'],{'as':_0xfa74('0x149'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x160')});db[_0xfa74('0x114')]['belongsTo'](db[_0xfa74('0x12f')],{'as':_0xfa74('0x161'),'foreignKey':'MailAccountId'});db[_0xfa74('0x114')][_0xfa74('0x118')](db['CmContact'],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151')});db[_0xfa74('0x114')][_0xfa74('0x118')](db['User'],{'as':'Owner','foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x114')]['belongsToMany'](db[_0xfa74('0x86')],{'through':_0xfa74('0x162'),'as':_0xfa74('0x163')});db[_0xfa74('0x114')][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':_0xfa74('0x162'),'as':'ThroughTags'});db['MailInteraction'][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':'Users','through':_0xfa74('0x120'),'foreignKey':_0xfa74('0x160')});db[_0xfa74('0x3f')][_0xfa74('0x10c')](db['Attachment'],{'as':'Attachments','onDelete':_0xfa74('0x10a')});db[_0xfa74('0x3f')][_0xfa74('0x118')](db['User'],{'as':_0xfa74('0x10')});db[_0xfa74('0x3f')][_0xfa74('0x118')](db[_0xfa74('0x6c')],{'onDelete':_0xfa74('0x10a'),'as':_0xfa74('0x150')});db[_0xfa74('0x3f')][_0xfa74('0x118')](db[_0xfa74('0x114')],{'as':_0xfa74('0x164'),'foreignKey':_0xfa74('0x160')});db[_0xfa74('0x3f')][_0xfa74('0x118')](db[_0xfa74('0x12f')],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x152')});db[_0xfa74('0x3f')][_0xfa74('0x118')](db[_0xfa74('0x12b')],{'as':_0xfa74('0x12b'),'foreignKey':_0xfa74('0x165')});db[_0xfa74('0x3f')][_0xfa74('0x118')](db[_0xfa74('0x166')],{'as':_0xfa74('0x166'),'foreignKey':_0xfa74('0x167')});db[_0xfa74('0x41')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'onDelete':_0xfa74('0x168')});db['MailApplication']['belongsTo'](db[_0xfa74('0x3b')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0x41')]['belongsTo'](db[_0xfa74('0x12f')],{'onDelete':_0xfa74('0x168')});db['MailApplication']['belongsTo'](db['Interval'],{'onDelete':'restrict','foreignKey':_0xfa74('0x169')});db[_0xfa74('0x41')]['belongsTo'](db[_0xfa74('0x86')],{'onDelete':_0xfa74('0x168'),'foreignKey':_0xfa74('0x16a')});db[_0xfa74('0x43')][_0xfa74('0x118')](db[_0xfa74('0x12f')],{});db[_0xfa74('0x43')][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db['MailQueueReport'][_0xfa74('0x118')](db[_0xfa74('0x6c')],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151')});db[_0xfa74('0x43')]['belongsTo'](db[_0xfa74('0x114')],{});db[_0xfa74('0x43')][_0xfa74('0x118')](db[_0xfa74('0x3f')],{});db[_0xfa74('0x43')]['belongsTo'](db[_0xfa74('0x10')],{});db[_0xfa74('0x43')]['belongsTo'](db[_0xfa74('0x3b')],{});db[_0xfa74('0x44')][_0xfa74('0x10c')](db[_0xfa74('0x16b')],{'as':'Items','onDelete':_0xfa74('0x10a')});db[_0xfa74('0x46')]['hasMany'](db[_0xfa74('0x7a')],{'as':_0xfa74('0x156'),'foreignKey':'FaxAccountId','onDelete':_0xfa74('0x10a')});db['FaxAccount'][_0xfa74('0x10c')](db[_0xfa74('0x79')],{'as':'Answers','foreignKey':'FaxAccountId'});db[_0xfa74('0x46')][_0xfa74('0x10c')](db['FaxInteraction'],{'as':_0xfa74('0x158')});db['FaxAccount']['hasMany'](db[_0xfa74('0x48')],{'as':_0xfa74('0x138')});db[_0xfa74('0x46')][_0xfa74('0x10c')](db[_0xfa74('0x17')],{'as':_0xfa74('0x16c'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x46')]['hasMany'](db['FaxMessage'],{'as':_0xfa74('0x149')});db[_0xfa74('0x46')][_0xfa74('0x118')](db[_0xfa74('0x141')],{'as':_0xfa74('0x141')});db[_0xfa74('0x46')][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0x46')][_0xfa74('0x118')](db['Pause'],{'as':_0xfa74('0x15c'),'foreignKey':_0xfa74('0x15d')});db[_0xfa74('0x46')][_0xfa74('0x119')](db['User'],{'as':'Agents','through':_0xfa74('0x12e')});db['FaxApplication']['belongsTo'](db[_0xfa74('0x10')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0x48')][_0xfa74('0x118')](db[_0xfa74('0x4d')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0x48')][_0xfa74('0x118')](db[_0xfa74('0x46')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0x48')][_0xfa74('0x118')](db[_0xfa74('0x86')],{'onDelete':_0xfa74('0x168'),'foreignKey':_0xfa74('0x16a')});db['FaxInteraction'][_0xfa74('0x10c')](db[_0xfa74('0x4b')],{'as':_0xfa74('0x149'),'onDelete':_0xfa74('0x10a'),'foreignKey':'FaxInteractionId'});db[_0xfa74('0x4a')]['belongsTo'](db[_0xfa74('0x46')],{'as':'Account','foreignKey':_0xfa74('0x16d')});db[_0xfa74('0x4a')][_0xfa74('0x118')](db['CmContact'],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151')});db[_0xfa74('0x4a')][_0xfa74('0x118')](db['User'],{'as':'Owner','foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x4a')][_0xfa74('0x119')](db['Tag'],{'through':_0xfa74('0x16e'),'as':'Tags'});db[_0xfa74('0x4a')]['belongsToMany'](db[_0xfa74('0x86')],{'through':'fax_interaction_has_tags','as':_0xfa74('0x16f')});db[_0xfa74('0x4a')]['belongsToMany'](db[_0xfa74('0x10')],{'as':_0xfa74('0x170'),'through':'user_has_fax_interactions','foreignKey':'FaxInteractionId'});db[_0xfa74('0x4b')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'onDelete':'cascade','as':'User'});db[_0xfa74('0x4b')][_0xfa74('0x118')](db[_0xfa74('0x4a')],{'as':_0xfa74('0x164'),'foreignKey':_0xfa74('0x171')});db['FaxMessage']['belongsTo'](db[_0xfa74('0x6c')],{'onDelete':_0xfa74('0x10a'),'as':_0xfa74('0x150')});db['FaxMessage'][_0xfa74('0x118')](db['Attachment'],{'as':_0xfa74('0x172'),'foreignKey':_0xfa74('0x173')});db[_0xfa74('0x4b')][_0xfa74('0x118')](db['FaxAccount'],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x16d')});db['FaxQueue']['belongsToMany'](db[_0xfa74('0x10')],{'as':'Agents','through':_0xfa74('0x31')});db[_0xfa74('0x4d')][_0xfa74('0x119')](db[_0xfa74('0x15e')],{'through':_0xfa74('0x174'),'as':_0xfa74('0x146')});db[_0xfa74('0x4f')][_0xfa74('0x118')](db[_0xfa74('0x46')],{});db[_0xfa74('0x4f')][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0x4f')][_0xfa74('0x118')](db['CmContact'],{'as':_0xfa74('0x150'),'foreignKey':'ContactId'});db[_0xfa74('0x4f')][_0xfa74('0x118')](db['FaxInteraction'],{});db['FaxQueueReport'][_0xfa74('0x118')](db[_0xfa74('0x4b')],{});db['FaxQueueReport'][_0xfa74('0x118')](db[_0xfa74('0x10')],{});db['FaxQueueReport'][_0xfa74('0x118')](db['FaxQueue'],{});db[_0xfa74('0x134')][_0xfa74('0x10c')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xfa74('0x175'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x134')][_0xfa74('0x10c')](db['CannedAnswer'],{'as':_0xfa74('0x157'),'foreignKey':_0xfa74('0x175')});db[_0xfa74('0x134')][_0xfa74('0x10c')](db[_0xfa74('0x54')],{'as':_0xfa74('0x149'),'foreignKey':_0xfa74('0x175')});db[_0xfa74('0x134')][_0xfa74('0x10c')](db[_0xfa74('0x176')],{'as':_0xfa74('0x158')});db['SmsAccount'][_0xfa74('0x10c')](db[_0xfa74('0x52')],{'as':_0xfa74('0x138')});db['SmsAccount'][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0x134')][_0xfa74('0x118')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xfa74('0x15d')});db[_0xfa74('0x134')][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x145'),'through':'user_has_sms_accounts'});db[_0xfa74('0x52')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0x52')]['belongsTo'](db[_0xfa74('0x56')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0x52')]['belongsTo'](db[_0xfa74('0x134')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0x52')][_0xfa74('0x118')](db[_0xfa74('0x7d')],{'onDelete':_0xfa74('0x168'),'foreignKey':_0xfa74('0x169')});db[_0xfa74('0x52')][_0xfa74('0x118')](db[_0xfa74('0x86')],{'onDelete':_0xfa74('0x168'),'foreignKey':_0xfa74('0x16a')});db[_0xfa74('0x176')][_0xfa74('0x10c')](db[_0xfa74('0x54')],{'as':_0xfa74('0x149'),'onDelete':'cascade','foreignKey':'SmsInteractionId'});db[_0xfa74('0x176')][_0xfa74('0x118')](db['SmsAccount'],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x175')});db[_0xfa74('0x176')][_0xfa74('0x118')](db['CmContact'],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151')});db[_0xfa74('0x176')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'as':'Owner','foreignKey':'UserId'});db[_0xfa74('0x176')][_0xfa74('0x119')](db['Tag'],{'through':_0xfa74('0x177'),'as':_0xfa74('0x163')});db[_0xfa74('0x176')][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':'sms_interaction_has_tags','as':_0xfa74('0x16f')});db[_0xfa74('0x176')]['belongsToMany'](db[_0xfa74('0x10')],{'as':_0xfa74('0x170'),'through':_0xfa74('0x122'),'foreignKey':_0xfa74('0x178')});db[_0xfa74('0x54')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'as':'User'});db['SmsMessage']['belongsTo'](db[_0xfa74('0x6c')],{'onDelete':'cascade','as':'Contact'});db['SmsMessage'][_0xfa74('0x118')](db['SmsInteraction'],{'onDelete':_0xfa74('0x10a'),'as':_0xfa74('0x164'),'foreignKey':'SmsInteractionId'});db[_0xfa74('0x54')][_0xfa74('0x118')](db[_0xfa74('0x134')],{'as':'Account','foreignKey':_0xfa74('0x175')});db[_0xfa74('0x56')][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x145'),'through':_0xfa74('0x33'),'foreignKey':_0xfa74('0x179')});db[_0xfa74('0x56')][_0xfa74('0x119')](db[_0xfa74('0x15e')],{'through':_0xfa74('0x17a'),'as':_0xfa74('0x146')});db[_0xfa74('0x58')][_0xfa74('0x10c')](db[_0xfa74('0x7a')],{'as':'Dispositions','foreignKey':_0xfa74('0x17b'),'onDelete':'cascade'});db[_0xfa74('0x58')][_0xfa74('0x10c')](db[_0xfa74('0x79')],{'as':_0xfa74('0x157'),'foreignKey':_0xfa74('0x17b')});db[_0xfa74('0x58')][_0xfa74('0x10c')](db[_0xfa74('0x5c')],{'as':_0xfa74('0x158'),'foreignKey':_0xfa74('0x17b')});db[_0xfa74('0x58')][_0xfa74('0x10c')](db[_0xfa74('0x5e')],{'as':'Messages','foreignKey':_0xfa74('0x17b')});db[_0xfa74('0x58')][_0xfa74('0x10c')](db[_0xfa74('0x5a')],{'as':_0xfa74('0x138'),'foreignKey':_0xfa74('0x17b')});db[_0xfa74('0x58')][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0x58')]['belongsTo'](db[_0xfa74('0x17c')],{'as':_0xfa74('0x15c'),'foreignKey':_0xfa74('0x15d')});db[_0xfa74('0x58')]['belongsToMany'](db[_0xfa74('0x10')],{'as':_0xfa74('0x145'),'through':_0xfa74('0x133')});db['OpenchannelApplication'][_0xfa74('0x118')](db[_0xfa74('0x10')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0x5a')]['belongsTo'](db['OpenchannelQueue'],{'onDelete':_0xfa74('0x168'),'foreignKey':_0xfa74('0x17d')});db[_0xfa74('0x5a')][_0xfa74('0x118')](db[_0xfa74('0x58')],{'onDelete':'restrict','foreignKey':_0xfa74('0x17b')});db['OpenchannelApplication']['belongsTo'](db[_0xfa74('0x7d')],{'onDelete':'restrict','foreignKey':_0xfa74('0x169')});db[_0xfa74('0x5a')][_0xfa74('0x118')](db[_0xfa74('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xfa74('0x5c')][_0xfa74('0x10c')](db['OpenchannelMessage'],{'as':_0xfa74('0x149'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x17e')});db[_0xfa74('0x5c')][_0xfa74('0x118')](db['OpenchannelAccount'],{'as':_0xfa74('0x161'),'foreignKey':'OpenchannelAccountId'});db[_0xfa74('0x5c')][_0xfa74('0x118')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0xfa74('0x5c')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'as':_0xfa74('0x17f'),'foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x5c')][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':_0xfa74('0x180'),'as':_0xfa74('0x163')});db[_0xfa74('0x5c')][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':'openchannel_interaction_has_tags','as':'ThroughTags'});db['OpenchannelInteraction']['belongsToMany'](db[_0xfa74('0x10')],{'as':_0xfa74('0x170'),'through':'user_has_openchannel_interactions','foreignKey':_0xfa74('0x17e')});db[_0xfa74('0x5e')]['belongsTo'](db[_0xfa74('0x10')],{'onDelete':'cascade','as':_0xfa74('0x10')});db[_0xfa74('0x5e')][_0xfa74('0x118')](db['CmContact'],{'onDelete':_0xfa74('0x10a'),'as':_0xfa74('0x150')});db[_0xfa74('0x5e')][_0xfa74('0x118')](db[_0xfa74('0x5c')],{'onDelete':_0xfa74('0x10a'),'as':'Interaction','foreignKey':_0xfa74('0x17e')});db[_0xfa74('0x5e')][_0xfa74('0x118')](db[_0xfa74('0x172')],{'as':_0xfa74('0x172'),'foreignKey':_0xfa74('0x173')});db[_0xfa74('0x5e')]['belongsTo'](db[_0xfa74('0x58')],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x17b')});db[_0xfa74('0x5f')][_0xfa74('0x119')](db['User'],{'as':_0xfa74('0x145'),'through':_0xfa74('0x34'),'foreignKey':_0xfa74('0x17d')});db[_0xfa74('0x5f')][_0xfa74('0x119')](db['Team'],{'through':'team_has_openchannel_queues','as':_0xfa74('0x146')});db[_0xfa74('0x12b')][_0xfa74('0x10c')](db['Disposition'],{'as':_0xfa74('0x156'),'foreignKey':_0xfa74('0x165'),'onDelete':'cascade'});db[_0xfa74('0x12b')]['hasMany'](db[_0xfa74('0x79')],{'as':_0xfa74('0x157'),'foreignKey':_0xfa74('0x165')});db[_0xfa74('0x12b')][_0xfa74('0x10c')](db[_0xfa74('0x69')],{'as':_0xfa74('0x181')});db['ChatWebsite'][_0xfa74('0x10c')](db['ChatInteraction'],{'as':_0xfa74('0x158')});db[_0xfa74('0x12b')][_0xfa74('0x10c')](db[_0xfa74('0x63')],{'as':_0xfa74('0x138')});db[_0xfa74('0x12b')][_0xfa74('0x10c')](db[_0xfa74('0x182')],{'as':_0xfa74('0x149')});db[_0xfa74('0x12b')]['belongsTo'](db[_0xfa74('0xe9')],{'as':'List','foreignKey':_0xfa74('0x15a')});db[_0xfa74('0x12b')][_0xfa74('0x118')](db[_0xfa74('0x7d')],{'as':_0xfa74('0x7d'),'foreignKey':'IntervalId'});db[_0xfa74('0x12b')][_0xfa74('0x118')](db[_0xfa74('0x12f')],{'as':'MailAccount','foreignKey':_0xfa74('0x152')});db[_0xfa74('0x12b')]['belongsTo'](db[_0xfa74('0x17c')],{'as':_0xfa74('0x15c'),'foreignKey':_0xfa74('0x15d')});db['ChatWebsite'][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':'Agents','through':_0xfa74('0x12d')});db['OpenchannelQueueReport'][_0xfa74('0x118')](db[_0xfa74('0x58')],{});db[_0xfa74('0x61')][_0xfa74('0x118')](db['CmList'],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0x61')][_0xfa74('0x118')](db[_0xfa74('0x6c')],{'as':_0xfa74('0x150'),'foreignKey':'ContactId'});db[_0xfa74('0x61')][_0xfa74('0x118')](db[_0xfa74('0x5c')],{});db[_0xfa74('0x61')][_0xfa74('0x118')](db[_0xfa74('0x5e')],{});db['OpenchannelQueueReport'][_0xfa74('0x118')](db[_0xfa74('0x10')],{});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelQueue'],{});db[_0xfa74('0x63')]['belongsTo'](db[_0xfa74('0x10')],{'as':'Agent','foreignKey':'UserId','onDelete':_0xfa74('0x168')});db[_0xfa74('0x63')]['belongsTo'](db['ChatQueue'],{'as':_0xfa74('0x183'),'foreignKey':_0xfa74('0x184'),'onDelete':_0xfa74('0x168')});db['ChatApplication']['belongsTo'](db[_0xfa74('0x12b')],{'as':_0xfa74('0x185'),'foreignKey':_0xfa74('0x165'),'onDelete':_0xfa74('0x168')});db[_0xfa74('0x63')][_0xfa74('0x118')](db[_0xfa74('0x86')],{'onDelete':_0xfa74('0x168'),'foreignKey':'TagId'});db[_0xfa74('0x64')][_0xfa74('0x10c')](db[_0xfa74('0x182')],{'as':_0xfa74('0x149'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x186')});db[_0xfa74('0x64')][_0xfa74('0x118')](db[_0xfa74('0x12b')],{'as':_0xfa74('0x161'),'foreignKey':'ChatWebsiteId'});db[_0xfa74('0x64')][_0xfa74('0x118')](db['CmContact'],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151')});db['ChatInteraction'][_0xfa74('0x118')](db['User'],{'as':_0xfa74('0x17f'),'foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x64')][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':_0xfa74('0x187'),'as':_0xfa74('0x163')});db[_0xfa74('0x64')][_0xfa74('0x119')](db['Tag'],{'through':_0xfa74('0x187'),'as':'ThroughTags'});db['ChatInteraction'][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x170'),'through':_0xfa74('0x188'),'foreignKey':_0xfa74('0x186')});db[_0xfa74('0x182')][_0xfa74('0x118')](db['User'],{'onDelete':'cascade','as':_0xfa74('0x10')});db['ChatMessage'][_0xfa74('0x118')](db[_0xfa74('0x6c')],{'onDelete':'cascade','as':'Contact','foreignKey':_0xfa74('0x151')});db[_0xfa74('0x182')][_0xfa74('0x118')](db['ChatInteraction'],{'onDelete':'cascade','as':_0xfa74('0x164'),'foreignKey':_0xfa74('0x186')});db[_0xfa74('0x182')][_0xfa74('0x118')](db[_0xfa74('0x172')],{'as':_0xfa74('0x172'),'foreignKey':_0xfa74('0x173')});db[_0xfa74('0x182')][_0xfa74('0x118')](db[_0xfa74('0x12b')],{'as':_0xfa74('0x161'),'foreignKey':'ChatWebsiteId'});db['ChatOfflineMessage'][_0xfa74('0x10c')](db[_0xfa74('0x172')],{'as':_0xfa74('0x189'),'foreignKey':'ChatOfflineMessageId','onDelete':_0xfa74('0x10a'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':'Contact','foreignKey':'ContactId'});db[_0xfa74('0x166')]['belongsTo'](db['ChatWebsite'],{'as':'Account','foreignKey':'ChatWebsiteId'});db['ChatQueue'][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x145'),'through':'UserChatQueue','hooks':!![]});db[_0xfa74('0x66')][_0xfa74('0x119')](db['Team'],{'through':_0xfa74('0x18a'),'as':'Teams'});db[_0xfa74('0x68')][_0xfa74('0x10c')](db['ChatInternalMessage'],{'as':'Messages','foreignKey':_0xfa74('0x18b'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x68')][_0xfa74('0x119')](db['User'],{'as':'Members','through':_0xfa74('0x11a')});db[_0xfa74('0x69')][_0xfa74('0x118')](db[_0xfa74('0x12b')],{'as':_0xfa74('0x185'),'foreignKey':_0xfa74('0x165')});db[_0xfa74('0x6a')]['hasMany'](db[_0xfa74('0x6c')],{'as':'Contacts','foreignKey':_0xfa74('0x18c')});db[_0xfa74('0x6c')][_0xfa74('0x10c')](db['CmHopper'],{'as':_0xfa74('0x13c'),'foreignKey':_0xfa74('0x151')});db[_0xfa74('0x6c')][_0xfa74('0x10c')](db['CmHopperFinal'],{'as':_0xfa74('0x10f'),'foreignKey':'ContactId'});db[_0xfa74('0x6c')]['hasMany'](db['CmHopperHistory'],{'as':_0xfa74('0x13d'),'foreignKey':_0xfa74('0x151')});db[_0xfa74('0x6c')]['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xfa74('0x151')});db['CmContact']['hasMany'](db[_0xfa74('0xcb')],{'as':'JscriptySessions','foreignKey':_0xfa74('0x151')});db['CmContact'][_0xfa74('0x10c')](db[_0xfa74('0x5c')],{'as':_0xfa74('0x111'),'foreignKey':'ContactId','onDelete':_0xfa74('0x168')});db['CmContact'][_0xfa74('0x10c')](db['ChatInteraction'],{'as':_0xfa74('0x121'),'foreignKey':_0xfa74('0x151'),'onDelete':_0xfa74('0x168')});db[_0xfa74('0x6c')][_0xfa74('0x10c')](db[_0xfa74('0x176')],{'as':_0xfa74('0x112'),'foreignKey':_0xfa74('0x151'),'onDelete':_0xfa74('0x168')});db[_0xfa74('0x6c')]['hasMany'](db[_0xfa74('0x4a')],{'as':'FaxInteractions','foreignKey':_0xfa74('0x151'),'onDelete':_0xfa74('0x168')});db[_0xfa74('0x6c')][_0xfa74('0x10c')](db['MailInteraction'],{'as':_0xfa74('0x11f'),'foreignKey':'ContactId','onDelete':_0xfa74('0x168')});db[_0xfa74('0x6c')][_0xfa74('0x118')](db[_0xfa74('0x6a')],{'as':_0xfa74('0x18d'),'foreignKey':_0xfa74('0x18c')});db['CmContact'][_0xfa74('0x118')](db['CmList'],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x6c')][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x170'),'through':_0xfa74('0x11c')});db['CmContact'][_0xfa74('0x119')](db[_0xfa74('0x86')],{'as':_0xfa74('0x163'),'through':_0xfa74('0x18e')});db[_0xfa74('0x6c')][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':'cm_contact_has_tags','as':'ThroughTags'});db[_0xfa74('0x6d')][_0xfa74('0x118')](db['CmContact'],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x6d')]['belongsTo'](db[_0xfa74('0xe9')],{'as':'List','foreignKey':_0xfa74('0x15a'),'onDelete':_0xfa74('0x10a')});db['CmHopper'][_0xfa74('0x118')](db[_0xfa74('0x10')],{'as':'Agent','foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x6d')][_0xfa74('0x118')](db[_0xfa74('0x1b')],{'as':_0xfa74('0x183'),'foreignKey':_0xfa74('0x13b'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x6d')][_0xfa74('0x118')](db[_0xfa74('0xdd')],{'as':_0xfa74('0xdd'),'foreignKey':_0xfa74('0x18f'),'onDelete':_0xfa74('0x10a')});db['CmHopper'][_0xfa74('0x118')](db[_0xfa74('0x10')],{'as':_0xfa74('0x17f'),'foreignKey':_0xfa74('0x190')});db[_0xfa74('0x13e')]['belongsTo'](db[_0xfa74('0x6c')],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151'),'onDelete':'cascade'});db[_0xfa74('0x13e')][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x13e')][_0xfa74('0x118')](db[_0xfa74('0x1b')],{'as':_0xfa74('0x183'),'foreignKey':'VoiceQueueId','onDelete':_0xfa74('0x10a')});db[_0xfa74('0x13e')]['belongsTo'](db['Campaign'],{'as':_0xfa74('0xdd'),'foreignKey':_0xfa74('0x18f'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x77')][_0xfa74('0x10c')](db[_0xfa74('0x7b')],{'as':{'plural':_0xfa74('0x191'),'singular':_0xfa74('0x192')},'foreignKey':_0xfa74('0x193'),'onDelete':_0xfa74('0x10a'),'hooks':!![]});db['Automation'][_0xfa74('0x10c')](db[_0xfa74('0x7b')],{'as':{'plural':_0xfa74('0x194'),'singular':'OneAny'},'foreignKey':_0xfa74('0x195'),'onDelete':'cascade','hooks':!![]});db[_0xfa74('0x77')][_0xfa74('0x10c')](db[_0xfa74('0x75')],{'as':_0xfa74('0x196'),'foreignKey':'AutomationId','onDelete':_0xfa74('0x10a'),'hooks':!![]});db[_0xfa74('0x7a')][_0xfa74('0x10c')](db[_0xfa74('0x7a')],{'as':_0xfa74('0x156'),'foreignKey':_0xfa74('0x197'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x7d')][_0xfa74('0x10c')](db[_0xfa74('0x7d')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':'cascade','hooks':!![],'required':![]});db[_0xfa74('0x7d')][_0xfa74('0x10c')](db[_0xfa74('0x17')],{'as':_0xfa74('0x10e'),'foreignKey':_0xfa74('0x169'),'onDelete':_0xfa74('0x168')});db[_0xfa74('0x7d')][_0xfa74('0x10c')](db['MailApplication'],{'as':'MailApplications','foreignKey':_0xfa74('0x169')});db[_0xfa74('0x7d')][_0xfa74('0x10c')](db[_0xfa74('0x63')],{'as':_0xfa74('0x198'),'foreignKey':_0xfa74('0x169')});db[_0xfa74('0x7d')][_0xfa74('0x10c')](db['FaxApplication'],{'as':_0xfa74('0x199'),'foreignKey':_0xfa74('0x169')});db[_0xfa74('0x7d')][_0xfa74('0x10c')](db[_0xfa74('0x52')],{'as':_0xfa74('0x19a'),'foreignKey':'IntervalId'});db[_0xfa74('0x19b')][_0xfa74('0x118')](db[_0xfa74('0x12f')],{});db['Schedule'][_0xfa74('0x118')](db[_0xfa74('0x93')],{'foreignKey':'DefaultReportId'});db['Schedule'][_0xfa74('0x118')](db[_0xfa74('0x91')],{'foreignKey':_0xfa74('0x19c')});db[_0xfa74('0x84')][_0xfa74('0x119')](db[_0xfa74('0x19')],{'as':'Mohs','through':'moh_has_sounds','onDelete':_0xfa74('0x168')});db['Tag'][_0xfa74('0x119')](db[_0xfa74('0x6c')],{'through':'cm_contact_has_tags'});db[_0xfa74('0x86')][_0xfa74('0x119')](db[_0xfa74('0x64')],{'through':_0xfa74('0x187')});db[_0xfa74('0x86')][_0xfa74('0x119')](db[_0xfa74('0x114')],{'through':_0xfa74('0x162')});db['Tag'][_0xfa74('0x119')](db[_0xfa74('0x176')],{'through':_0xfa74('0x177')});db[_0xfa74('0x86')]['belongsToMany'](db['FaxInteraction'],{'through':_0xfa74('0x16e')});db['Tag']['belongsToMany'](db[_0xfa74('0x5c')],{'through':'openchannel_interaction_has_tags'});db[_0xfa74('0x86')]['belongsToMany'](db['WhatsappInteraction'],{'through':_0xfa74('0x19d')});db['Trigger'][_0xfa74('0x10c')](db[_0xfa74('0x7b')],{'as':{'plural':_0xfa74('0x19e'),'singular':_0xfa74('0x19f')},'foreignKey':_0xfa74('0x1a0'),'onDelete':_0xfa74('0x10a'),'hooks':!![]});db[_0xfa74('0x1a1')]['hasMany'](db[_0xfa74('0x7b')],{'as':{'plural':'AnyConditions','singular':_0xfa74('0x1a2')},'foreignKey':_0xfa74('0x1a3'),'onDelete':_0xfa74('0x10a'),'hooks':!![]});db['Trigger']['hasMany'](db['Action'],{'as':_0xfa74('0x196'),'foreignKey':_0xfa74('0x1a4'),'onDelete':_0xfa74('0x10a'),'hooks':!![]});db[_0xfa74('0x91')][_0xfa74('0x10c')](db[_0xfa74('0x1a5')],{'as':'Fields','onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x19c'),'hooks':!![]});db[_0xfa74('0x93')][_0xfa74('0x10c')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1a6')});db[_0xfa74('0x96')][_0xfa74('0x10c')](db['AnalyticFieldReport'],{'as':_0xfa74('0x1a7'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1a8')});db[_0xfa74('0x1a5')][_0xfa74('0x118')](db['AnalyticMetric'],{'foreignKey':'MetricId'});db[_0xfa74('0x1a9')][_0xfa74('0x10c')](db[_0xfa74('0x9b')],{'as':_0xfa74('0x1aa'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1ab')});db[_0xfa74('0x9b')]['hasMany'](db[_0xfa74('0x1ac')],{'as':'Subjects','onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1ad')});db[_0xfa74('0x9b')]['hasMany'](db[_0xfa74('0x1ac')],{'as':_0xfa74('0x1ae'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1af')});db['SalesforceConfiguration'][_0xfa74('0x10c')](db['SalesforceField'],{'as':_0xfa74('0x1a7'),'onDelete':'cascade','foreignKey':_0xfa74('0x1b0')});db['SalesforceConfiguration']['belongsTo'](db[_0xfa74('0x1a9')],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x1ab')});db[_0xfa74('0x1ac')][_0xfa74('0x10c')](db[_0xfa74('0x1ac')],{'as':_0xfa74('0x1b1'),'foreignKey':'SubjectId'});db[_0xfa74('0x1ac')]['hasMany'](db[_0xfa74('0x1ac')],{'as':_0xfa74('0x1b2'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0x1ac')]['hasMany'](db['SalesforceField'],{'as':'Field','foreignKey':_0xfa74('0x1b0')});db[_0xfa74('0x1ac')][_0xfa74('0x118')](db[_0xfa74('0x8b')],{'as':'Variable','foreignKey':'VariableId'});db[_0xfa74('0x9d')][_0xfa74('0x10c')](db[_0xfa74('0x9f')],{'as':'Configurations','onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1ab')});db['SugarcrmConfiguration'][_0xfa74('0x10c')](db[_0xfa74('0xa1')],{'as':_0xfa74('0x1b3'),'onDelete':'cascade','foreignKey':_0xfa74('0x1ad')});db[_0xfa74('0x9f')][_0xfa74('0x10c')](db[_0xfa74('0xa1')],{'as':_0xfa74('0x1ae'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0x9f')][_0xfa74('0x10c')](db[_0xfa74('0xa1')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0xfa74('0x9f')][_0xfa74('0x118')](db[_0xfa74('0x9d')],{'as':_0xfa74('0x161'),'foreignKey':'AccountId'});db[_0xfa74('0xa1')][_0xfa74('0x10c')](db['SugarcrmField'],{'as':_0xfa74('0x1b1'),'foreignKey':_0xfa74('0x1ad')});db[_0xfa74('0xa1')]['hasMany'](db['SugarcrmField'],{'as':_0xfa74('0x1b2'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0xa1')][_0xfa74('0x10c')](db[_0xfa74('0xa1')],{'as':_0xfa74('0x1b4'),'foreignKey':_0xfa74('0x1b0')});db[_0xfa74('0xa1')][_0xfa74('0x118')](db[_0xfa74('0x8b')],{'as':_0xfa74('0x8b'),'foreignKey':_0xfa74('0x1b5')});db[_0xfa74('0x1b6')]['hasMany'](db[_0xfa74('0xa4')],{'as':_0xfa74('0x1aa'),'onDelete':'cascade','foreignKey':_0xfa74('0x1ab')});db[_0xfa74('0xa4')][_0xfa74('0x10c')](db['DeskField'],{'as':_0xfa74('0x1b3'),'onDelete':_0xfa74('0x10a'),'foreignKey':'SubjectId'});db[_0xfa74('0xa4')][_0xfa74('0x10c')](db[_0xfa74('0x1b7')],{'as':_0xfa74('0x1ae'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['DeskConfiguration'][_0xfa74('0x10c')](db[_0xfa74('0x1b7')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xfa74('0x1b0')});db[_0xfa74('0xa4')][_0xfa74('0x118')](db[_0xfa74('0x1b6')],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x1ab')});db['DeskConfiguration'][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':_0xfa74('0x1b8')});db[_0xfa74('0x1b7')][_0xfa74('0x10c')](db[_0xfa74('0x1b7')],{'as':_0xfa74('0x1b1'),'foreignKey':'SubjectId'});db[_0xfa74('0x1b7')][_0xfa74('0x10c')](db['DeskField'],{'as':'Description','foreignKey':_0xfa74('0x1af')});db['DeskField']['hasMany'](db[_0xfa74('0x1b7')],{'as':_0xfa74('0x1b4'),'foreignKey':_0xfa74('0x1b0')});db[_0xfa74('0x1b7')][_0xfa74('0x118')](db[_0xfa74('0x8b')],{'as':_0xfa74('0x8b'),'foreignKey':'VariableId'});db[_0xfa74('0xa6')][_0xfa74('0x10c')](db[_0xfa74('0xa8')],{'as':_0xfa74('0x1aa'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1ab')});db[_0xfa74('0xa8')][_0xfa74('0x10c')](db['ZohoField'],{'as':_0xfa74('0x1b3'),'onDelete':_0xfa74('0x10a'),'foreignKey':'SubjectId'});db['ZohoConfiguration'][_0xfa74('0x10c')](db[_0xfa74('0xaa')],{'as':_0xfa74('0x1ae'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xfa74('0xa8')][_0xfa74('0x10c')](db[_0xfa74('0xaa')],{'as':_0xfa74('0x1a7'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1b0')});db['ZohoConfiguration'][_0xfa74('0x118')](db[_0xfa74('0xa6')],{'as':_0xfa74('0x161'),'foreignKey':'AccountId'});db['ZohoField']['hasMany'](db[_0xfa74('0xaa')],{'as':_0xfa74('0x1b1'),'foreignKey':_0xfa74('0x1ad')});db[_0xfa74('0xaa')][_0xfa74('0x10c')](db['ZohoField'],{'as':_0xfa74('0x1b2'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0xaa')]['hasMany'](db[_0xfa74('0xaa')],{'as':'Field','foreignKey':'FieldId'});db[_0xfa74('0xaa')][_0xfa74('0x118')](db[_0xfa74('0x8b')],{'as':_0xfa74('0x8b'),'foreignKey':_0xfa74('0x1b5')});db[_0xfa74('0x1b9')][_0xfa74('0x10c')](db[_0xfa74('0xab')],{'as':_0xfa74('0x1aa'),'onDelete':_0xfa74('0x10a'),'foreignKey':'AccountId'});db[_0xfa74('0xab')][_0xfa74('0x10c')](db[_0xfa74('0x1ba')],{'as':_0xfa74('0x1b3'),'foreignKey':'SubjectId'});db[_0xfa74('0xab')][_0xfa74('0x10c')](db[_0xfa74('0x1ba')],{'as':_0xfa74('0x1ae'),'foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0xfa74('0x10c')](db[_0xfa74('0x1ba')],{'as':_0xfa74('0x1a7'),'foreignKey':_0xfa74('0x1b0')});db[_0xfa74('0xab')][_0xfa74('0x118')](db['ZendeskAccount'],{'as':_0xfa74('0x161'),'foreignKey':'AccountId'});db[_0xfa74('0xab')][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':'int_zendesk_configuration_has_tags'});db['ZendeskField']['hasMany'](db['ZendeskField'],{'as':_0xfa74('0x1b1'),'foreignKey':'SubjectId'});db[_0xfa74('0x1ba')][_0xfa74('0x10c')](db[_0xfa74('0x1ba')],{'as':_0xfa74('0x1b2'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0x1ba')][_0xfa74('0x10c')](db[_0xfa74('0x1ba')],{'as':'Field','foreignKey':'FieldId'});db['ZendeskField']['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0xfa74('0x1b5')});db['FreshdeskAccount'][_0xfa74('0x10c')](db['FreshdeskConfiguration'],{'as':_0xfa74('0x1aa'),'onDelete':_0xfa74('0x10a'),'foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0xfa74('0x10c')](db['FreshdeskField'],{'as':_0xfa74('0x1b3'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xfa74('0xae')][_0xfa74('0x10c')](db[_0xfa74('0x1bb')],{'as':_0xfa74('0x1ae'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xfa74('0xae')][_0xfa74('0x10c')](db[_0xfa74('0x1bb')],{'as':_0xfa74('0x1a7'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1b0')});db['FreshdeskConfiguration'][_0xfa74('0x118')](db['FreshdeskAccount'],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x1ab')});db['FreshdeskConfiguration'][_0xfa74('0x119')](db['Tag'],{'through':_0xfa74('0x1bc')});db['FreshdeskField'][_0xfa74('0x10c')](db['FreshdeskField'],{'as':_0xfa74('0x1b1'),'foreignKey':'SubjectId'});db['FreshdeskField'][_0xfa74('0x10c')](db[_0xfa74('0x1bb')],{'as':'Description','foreignKey':_0xfa74('0x1af')});db['FreshdeskField'][_0xfa74('0x10c')](db[_0xfa74('0x1bb')],{'as':_0xfa74('0x1b4'),'foreignKey':_0xfa74('0x1b0')});db['FreshdeskField']['belongsTo'](db[_0xfa74('0x8b')],{'as':'Variable','foreignKey':_0xfa74('0x1b5')});db[_0xfa74('0xb1')][_0xfa74('0x10c')](db[_0xfa74('0x1bd')],{'as':_0xfa74('0x1aa'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1ab')});db[_0xfa74('0x1bd')][_0xfa74('0x10c')](db[_0xfa74('0xb3')],{'as':_0xfa74('0x1b3'),'foreignKey':_0xfa74('0x1ad')});db[_0xfa74('0x1bd')][_0xfa74('0x10c')](db[_0xfa74('0xb3')],{'as':_0xfa74('0x1ae'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0x1bd')][_0xfa74('0x10c')](db['VtigerField'],{'as':_0xfa74('0x1a7'),'foreignKey':_0xfa74('0x1b0')});db['VtigerConfiguration'][_0xfa74('0x118')](db[_0xfa74('0xb1')],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x1ab')});db[_0xfa74('0xb3')]['hasMany'](db[_0xfa74('0xb3')],{'as':_0xfa74('0x1b1'),'foreignKey':'SubjectId'});db[_0xfa74('0xb3')][_0xfa74('0x10c')](db[_0xfa74('0xb3')],{'as':_0xfa74('0x1b2'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0xb3')][_0xfa74('0x10c')](db[_0xfa74('0xb3')],{'as':_0xfa74('0x1b4'),'foreignKey':_0xfa74('0x1b0')});db[_0xfa74('0xb3')][_0xfa74('0x118')](db['Variable'],{'as':'Variable','foreignKey':_0xfa74('0x1b5')});db[_0xfa74('0xb5')]['hasMany'](db['ServicenowConfiguration'],{'as':'Configurations','onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1ab')});db['ServicenowConfiguration'][_0xfa74('0x10c')](db[_0xfa74('0xb9')],{'as':_0xfa74('0x1b3'),'foreignKey':_0xfa74('0x1ad')});db[_0xfa74('0xb7')][_0xfa74('0x10c')](db['ServicenowField'],{'as':_0xfa74('0x1ae'),'foreignKey':'DescriptionId'});db[_0xfa74('0xb7')][_0xfa74('0x10c')](db[_0xfa74('0xb9')],{'as':_0xfa74('0x1a7'),'foreignKey':_0xfa74('0x1b0')});db[_0xfa74('0xb7')][_0xfa74('0x118')](db['ServicenowAccount'],{'as':'Account','foreignKey':_0xfa74('0x1ab')});db[_0xfa74('0xb9')][_0xfa74('0x10c')](db[_0xfa74('0xb9')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xfa74('0xb9')][_0xfa74('0x10c')](db[_0xfa74('0xb9')],{'as':_0xfa74('0x1b2'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0xb9')]['hasMany'](db[_0xfa74('0xb9')],{'as':_0xfa74('0x1b4'),'foreignKey':_0xfa74('0x1b0')});db[_0xfa74('0xb9')][_0xfa74('0x118')](db[_0xfa74('0x8b')],{'as':'Variable','foreignKey':_0xfa74('0x1b5')});db[_0xfa74('0xbb')]['hasMany'](db[_0xfa74('0xbd')],{'as':_0xfa74('0x1aa'),'onDelete':_0xfa74('0x10a'),'foreignKey':'AccountId'});db['Dynamics365Configuration'][_0xfa74('0x10c')](db['Dynamics365Field'],{'as':_0xfa74('0x1b3'),'onDelete':_0xfa74('0x10a'),'foreignKey':'SubjectId'});db[_0xfa74('0xbd')][_0xfa74('0x10c')](db[_0xfa74('0xbf')],{'as':_0xfa74('0x1ae'),'onDelete':'cascade','foreignKey':_0xfa74('0x1af')});db['Dynamics365Configuration'][_0xfa74('0x10c')](db[_0xfa74('0xbf')],{'as':_0xfa74('0x1a7'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1b0')});db['Dynamics365Configuration'][_0xfa74('0x118')](db['Dynamics365Account'],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x1ab')});db[_0xfa74('0xbf')]['hasMany'](db[_0xfa74('0xbf')],{'as':_0xfa74('0x1b1'),'foreignKey':_0xfa74('0x1ad')});db[_0xfa74('0xbf')][_0xfa74('0x10c')](db['Dynamics365Field'],{'as':_0xfa74('0x1b2'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0xbf')]['hasMany'](db[_0xfa74('0xbf')],{'as':_0xfa74('0x1b4'),'foreignKey':_0xfa74('0x1b0')});db[_0xfa74('0xbf')]['belongsTo'](db[_0xfa74('0x8b')],{'as':_0xfa74('0x8b'),'foreignKey':_0xfa74('0x1b5')});db[_0xfa74('0xc0')][_0xfa74('0x10c')](db['FreshsalesConfiguration'],{'as':_0xfa74('0x1aa'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1ab')});db[_0xfa74('0xc2')]['hasMany'](db['FreshsalesField'],{'as':_0xfa74('0x1b3'),'foreignKey':_0xfa74('0x1ad')});db[_0xfa74('0xc2')][_0xfa74('0x10c')](db[_0xfa74('0xc3')],{'as':_0xfa74('0x1ae'),'foreignKey':'DescriptionId'});db[_0xfa74('0xc2')]['hasMany'](db[_0xfa74('0xc3')],{'as':_0xfa74('0x1a7'),'foreignKey':_0xfa74('0x1b0')});db['FreshsalesConfiguration'][_0xfa74('0x118')](db[_0xfa74('0xc0')],{'as':'Account','foreignKey':_0xfa74('0x1ab')});db['FreshsalesField'][_0xfa74('0x10c')](db[_0xfa74('0xc3')],{'as':_0xfa74('0x1b1'),'foreignKey':'SubjectId'});db[_0xfa74('0xc3')][_0xfa74('0x10c')](db[_0xfa74('0xc3')],{'as':_0xfa74('0x1b2'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0xc3')][_0xfa74('0x10c')](db[_0xfa74('0xc3')],{'as':_0xfa74('0x1b4'),'foreignKey':'FieldId'});db[_0xfa74('0xc3')]['belongsTo'](db[_0xfa74('0x8b')],{'as':_0xfa74('0x8b'),'foreignKey':_0xfa74('0x1b5')});db['ChatQueueReport'][_0xfa74('0x118')](db[_0xfa74('0x12b')],{});db['ChatQueueReport'][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0xc6')]['belongsTo'](db[_0xfa74('0x6c')],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151')});db['ChatQueueReport'][_0xfa74('0x118')](db['ChatInteraction'],{});db[_0xfa74('0xc6')][_0xfa74('0x118')](db[_0xfa74('0x182')],{});db[_0xfa74('0xc6')]['belongsTo'](db[_0xfa74('0x10')],{});db['ChatQueueReport']['belongsTo'](db[_0xfa74('0x66')],{});db['ChatInternalMessage'][_0xfa74('0x118')](db[_0xfa74('0x10')],{'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1be')});db['ChatInternalMessage'][_0xfa74('0x118')](db[_0xfa74('0x10')],{'onDelete':_0xfa74('0x10a'),'foreignKey':'ToId'});db[_0xfa74('0xcb')][_0xfa74('0x10c')](db[_0xfa74('0xc9')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xfa74('0xcb')][_0xfa74('0x10c')](db[_0xfa74('0xc8')],{'foreignKey':_0xfa74('0x1bf'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x1c0')][_0xfa74('0x118')](db[_0xfa74('0x134')],{});db[_0xfa74('0x1c0')][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0x1c0')]['belongsTo'](db[_0xfa74('0x6c')],{'as':_0xfa74('0x150'),'foreignKey':'ContactId'});db['SmsQueueReport'][_0xfa74('0x118')](db[_0xfa74('0x176')],{});db[_0xfa74('0x1c0')][_0xfa74('0x118')](db['SmsMessage'],{});db[_0xfa74('0x1c0')][_0xfa74('0x118')](db['User'],{});db[_0xfa74('0x1c0')]['belongsTo'](db[_0xfa74('0x56')],{});db[_0xfa74('0xd1')][_0xfa74('0x10c')](db[_0xfa74('0xcb')],{'foreignKey':_0xfa74('0x1c1')});db[_0xfa74('0xd1')][_0xfa74('0x10c')](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db[_0xfa74('0xd1')]['hasMany'](db[_0xfa74('0xc8')],{'foreignKey':_0xfa74('0x1c1')});db[_0xfa74('0xd4')]['belongsToMany'](db[_0xfa74('0x10')],{'as':_0xfa74('0x170'),'through':_0xfa74('0x136')});db['Team']['belongsToMany'](db['User'],{'as':_0xfa74('0x145'),'through':_0xfa74('0x11e')});db[_0xfa74('0x15e')][_0xfa74('0x119')](db['VoiceQueue'],{'through':_0xfa74('0x103'),'as':_0xfa74('0x125')});db[_0xfa74('0x15e')]['belongsToMany'](db[_0xfa74('0x3b')],{'through':_0xfa74('0x15f'),'as':_0xfa74('0x1c2')});db[_0xfa74('0x15e')]['belongsToMany'](db[_0xfa74('0x66')],{'through':'team_has_chat_queues','as':_0xfa74('0x1c3')});db['Team']['belongsToMany'](db[_0xfa74('0x4d')],{'through':_0xfa74('0x174'),'as':_0xfa74('0x1c4')});db[_0xfa74('0x15e')][_0xfa74('0x119')](db[_0xfa74('0x56')],{'through':_0xfa74('0x17a'),'as':_0xfa74('0x1c5')});db['Team'][_0xfa74('0x119')](db['OpenchannelQueue'],{'through':_0xfa74('0x1c6'),'as':_0xfa74('0x128')});db['Team'][_0xfa74('0x119')](db[_0xfa74('0xff')],{'through':_0xfa74('0x1c7'),'as':'WhatsappQueues'});db[_0xfa74('0x15e')][_0xfa74('0x119')](db[_0xfa74('0xeb')],{'through':'TeamVoicePrefix','as':_0xfa74('0x126')});db[_0xfa74('0xdd')]['hasMany'](db['CmHopper'],{'as':'Hoppers','foreignKey':_0xfa74('0x18f')});db[_0xfa74('0xdd')][_0xfa74('0x10c')](db[_0xfa74('0x6f')],{'as':_0xfa74('0x10f'),'foreignKey':'CampaignId'});db[_0xfa74('0xdd')][_0xfa74('0x10c')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':'CampaignId'});db[_0xfa74('0xdd')][_0xfa74('0x10c')](db[_0xfa74('0x13e')],{'as':_0xfa74('0x13f'),'foreignKey':_0xfa74('0x18f')});db[_0xfa74('0xdd')][_0xfa74('0x118')](db[_0xfa74('0x141')],{'as':_0xfa74('0x141'),'foreignKey':_0xfa74('0x1c8')});db['Campaign'][_0xfa74('0x118')](db[_0xfa74('0x141')],{'as':_0xfa74('0x142'),'foreignKey':_0xfa74('0x1c9')});db[_0xfa74('0xdd')][_0xfa74('0x118')](db[_0xfa74('0x7d')],{'as':_0xfa74('0x7d'),'foreignKey':_0xfa74('0x169')});db[_0xfa74('0xdd')][_0xfa74('0x118')](db[_0xfa74('0xd4')],{'as':_0xfa74('0xd4'),'foreignKey':_0xfa74('0x1ca')});db[_0xfa74('0xdd')][_0xfa74('0x119')](db[_0xfa74('0xe9')],{'as':'Lists','through':'campaigns_has_cm_lists'});db[_0xfa74('0xdd')][_0xfa74('0x119')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x147'),'through':_0xfa74('0x1cb')});db[_0xfa74('0x172')]['belongsTo'](db['ChatOfflineMessage'],{'as':_0xfa74('0x166'),'foreignKey':_0xfa74('0x167')});db['MailTransferReport'][_0xfa74('0x118')](db[_0xfa74('0x3f')],{});db[_0xfa74('0xe2')][_0xfa74('0x118')](db[_0xfa74('0x114')],{});db[_0xfa74('0xe2')][_0xfa74('0x118')](db[_0xfa74('0x12f')],{'foreignKey':_0xfa74('0x1cc'),'as':_0xfa74('0x1cd')});db[_0xfa74('0xe2')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'foreignKey':'FromUserId','as':_0xfa74('0x1ce')});db[_0xfa74('0xe2')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'foreignKey':'ToUserId','as':_0xfa74('0x1cf')});db['MailTransferReport'][_0xfa74('0x118')](db[_0xfa74('0x3b')],{'foreignKey':_0xfa74('0x1d0'),'as':_0xfa74('0x1d1')});db[_0xfa74('0xe2')][_0xfa74('0x118')](db[_0xfa74('0x12f')],{'foreignKey':_0xfa74('0x1d2'),'as':_0xfa74('0x1d3')});db[_0xfa74('0xe4')][_0xfa74('0x118')](db[_0xfa74('0x182')],{});db[_0xfa74('0xe4')][_0xfa74('0x118')](db[_0xfa74('0x64')],{});db[_0xfa74('0xe4')]['belongsTo'](db[_0xfa74('0x12b')],{'foreignKey':_0xfa74('0x1d4'),'as':_0xfa74('0x1cd')});db[_0xfa74('0xe4')][_0xfa74('0x118')](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xfa74('0xe4')]['belongsTo'](db[_0xfa74('0x10')],{'foreignKey':_0xfa74('0x1d5'),'as':'ToAgent'});db['ChatTransferReport'][_0xfa74('0x118')](db[_0xfa74('0x66')],{'foreignKey':_0xfa74('0x1d6'),'as':_0xfa74('0x1d1')});db[_0xfa74('0xe4')][_0xfa74('0x118')](db['ChatWebsite'],{'foreignKey':_0xfa74('0x1d7'),'as':_0xfa74('0x1d3')});db[_0xfa74('0xe6')]['belongsTo'](db[_0xfa74('0x4b')],{});db[_0xfa74('0xe6')][_0xfa74('0x118')](db[_0xfa74('0x4a')],{});db[_0xfa74('0xe6')][_0xfa74('0x118')](db[_0xfa74('0x46')],{'foreignKey':_0xfa74('0x1d8'),'as':_0xfa74('0x1cd')});db[_0xfa74('0xe6')][_0xfa74('0x118')](db['User'],{'foreignKey':_0xfa74('0x1d9'),'as':_0xfa74('0x1ce')});db[_0xfa74('0xe6')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'foreignKey':'ToUserId','as':_0xfa74('0x1cf')});db['FaxTransferReport'][_0xfa74('0x118')](db[_0xfa74('0x4d')],{'foreignKey':'ToFaxQueueId','as':_0xfa74('0x1d1')});db[_0xfa74('0xe6')]['belongsTo'](db[_0xfa74('0x46')],{'foreignKey':_0xfa74('0x1da'),'as':'ToAccount'});db[_0xfa74('0xe7')]['belongsTo'](db[_0xfa74('0x5e')],{});db[_0xfa74('0xe7')][_0xfa74('0x118')](db[_0xfa74('0x5c')],{});db[_0xfa74('0xe7')][_0xfa74('0x118')](db[_0xfa74('0x58')],{'foreignKey':_0xfa74('0x1db'),'as':'FromAccount'});db[_0xfa74('0xe7')][_0xfa74('0x118')](db['User'],{'foreignKey':_0xfa74('0x1d9'),'as':_0xfa74('0x1ce')});db[_0xfa74('0xe7')]['belongsTo'](db[_0xfa74('0x10')],{'foreignKey':_0xfa74('0x1d5'),'as':_0xfa74('0x1cf')});db[_0xfa74('0xe7')][_0xfa74('0x118')](db[_0xfa74('0x5f')],{'foreignKey':_0xfa74('0x1dc'),'as':'ToQueue'});db['OpenchannelTransferReport'][_0xfa74('0x118')](db['OpenchannelAccount'],{'foreignKey':_0xfa74('0x1dd'),'as':_0xfa74('0x1d3')});db[_0xfa74('0xe8')]['belongsTo'](db[_0xfa74('0x54')],{});db[_0xfa74('0xe8')][_0xfa74('0x118')](db[_0xfa74('0x176')],{});db[_0xfa74('0xe8')][_0xfa74('0x118')](db[_0xfa74('0x134')],{'foreignKey':_0xfa74('0x1de'),'as':_0xfa74('0x1cd')});db[_0xfa74('0xe8')][_0xfa74('0x118')](db['User'],{'foreignKey':_0xfa74('0x1d9'),'as':_0xfa74('0x1ce')});db[_0xfa74('0xe8')]['belongsTo'](db[_0xfa74('0x10')],{'foreignKey':'ToUserId','as':_0xfa74('0x1cf')});db[_0xfa74('0xe8')]['belongsTo'](db[_0xfa74('0x56')],{'foreignKey':_0xfa74('0x1df'),'as':'ToQueue'});db[_0xfa74('0xe8')][_0xfa74('0x118')](db[_0xfa74('0x134')],{'foreignKey':'ToSmsAccountId','as':_0xfa74('0x1d3')});db['CmList'][_0xfa74('0x10c')](db['Disposition'],{'as':_0xfa74('0x156'),'foreignKey':_0xfa74('0x15a'),'onDelete':'cascade'});db[_0xfa74('0xe9')][_0xfa74('0x10c')](db[_0xfa74('0x73')],{'as':_0xfa74('0x1e0'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0xe9')][_0xfa74('0x10c')](db['CmContact'],{'as':'Contacts','onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x15a')});db['CmList'][_0xfa74('0x10c')](db[_0xfa74('0x6f')],{'as':'HopperFinals','foreignKey':_0xfa74('0x15a')});db[_0xfa74('0xe9')][_0xfa74('0x10c')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0xfa74('0x15a')});db[_0xfa74('0xe9')][_0xfa74('0x10c')](db['ReportAgentPreview'],{'as':_0xfa74('0x72'),'foreignKey':_0xfa74('0x15a')});db['CmList'][_0xfa74('0x119')](db['VoiceQueue'],{'as':_0xfa74('0x1e1'),'through':'voice_queues_has_cm_lists'});db['CmList']['belongsToMany'](db[_0xfa74('0x10')],{'as':_0xfa74('0x145'),'through':_0xfa74('0x11d')});db[_0xfa74('0xeb')][_0xfa74('0x10c')](db[_0xfa74('0x17')],{'as':_0xfa74('0x10e'),'onDelete':'cascade'});db[_0xfa74('0xeb')][_0xfa74('0x119')](db['User'],{'as':_0xfa74('0x145'),'through':_0xfa74('0x107')});db[_0xfa74('0xeb')]['belongsToMany'](db[_0xfa74('0x15e')],{'through':_0xfa74('0x105'),'as':_0xfa74('0x146')});db[_0xfa74('0xed')][_0xfa74('0x10c')](db[_0xfa74('0x10')],{'as':'Users','foreignKey':_0xfa74('0x1e2')});db['UserProfile'][_0xfa74('0x10c')](db[_0xfa74('0xef')],{'as':_0xfa74('0x1e3'),'foreignKey':'userProfileId','onDelete':_0xfa74('0x10a')});db['UserProfileSection'][_0xfa74('0x10c')](db[_0xfa74('0xf1')],{'as':'Resources','foreignKey':_0xfa74('0x1e4'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0xf5')][_0xfa74('0x10c')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xfa74('0x1e5'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0xf5')][_0xfa74('0x10c')](db[_0xfa74('0x79')],{'as':'Answers','foreignKey':'WhatsappAccountId'});db[_0xfa74('0xf5')][_0xfa74('0x10c')](db['WhatsappMessage'],{'as':_0xfa74('0x149'),'foreignKey':_0xfa74('0x1e5')});db[_0xfa74('0xf5')][_0xfa74('0x10c')](db[_0xfa74('0xf9')],{'as':'Interactions'});db[_0xfa74('0xf5')][_0xfa74('0x10c')](db[_0xfa74('0xf7')],{'as':'Applications'});db[_0xfa74('0xf5')][_0xfa74('0x118')](db['CmList'],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0xf5')][_0xfa74('0x118')](db['Pause'],{'as':_0xfa74('0x15c'),'foreignKey':_0xfa74('0x15d')});db['WhatsappAccount'][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x145'),'through':_0xfa74('0x1e6')});db['WhatsappApplication'][_0xfa74('0x118')](db[_0xfa74('0x10')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0xf7')][_0xfa74('0x118')](db[_0xfa74('0xff')],{'onDelete':'restrict'});db[_0xfa74('0xf7')][_0xfa74('0x118')](db[_0xfa74('0xf5')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0xf7')][_0xfa74('0x118')](db[_0xfa74('0x7d')],{'onDelete':_0xfa74('0x168'),'foreignKey':_0xfa74('0x169')});db[_0xfa74('0xf7')]['belongsTo'](db[_0xfa74('0x86')],{'onDelete':_0xfa74('0x168'),'foreignKey':_0xfa74('0x16a')});db['WhatsappInteraction'][_0xfa74('0x10c')](db[_0xfa74('0x1e7')],{'as':_0xfa74('0x149'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1e8')});db[_0xfa74('0xf9')][_0xfa74('0x118')](db['WhatsappAccount'],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x1e5')});db[_0xfa74('0xf9')][_0xfa74('0x118')](db[_0xfa74('0x6c')],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151')});db[_0xfa74('0xf9')]['belongsTo'](db[_0xfa74('0x10')],{'as':_0xfa74('0x17f'),'foreignKey':_0xfa74('0x10b')});db['WhatsappInteraction'][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':_0xfa74('0x19d'),'as':_0xfa74('0x163')});db[_0xfa74('0xf9')][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':'whatsapp_interaction_has_tags','as':'ThroughTags'});db[_0xfa74('0xf9')][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x170'),'through':_0xfa74('0x124'),'foreignKey':_0xfa74('0x1e8')});db[_0xfa74('0x1e7')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'as':_0xfa74('0x10')});db[_0xfa74('0x1e7')][_0xfa74('0x118')](db[_0xfa74('0x6c')],{'onDelete':'cascade','as':_0xfa74('0x150')});db[_0xfa74('0x1e7')][_0xfa74('0x118')](db[_0xfa74('0xf9')],{'onDelete':_0xfa74('0x10a'),'as':_0xfa74('0x164'),'foreignKey':_0xfa74('0x1e8')});db['WhatsappMessage']['belongsTo'](db[_0xfa74('0xf5')],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x1e5')});db[_0xfa74('0xfc')][_0xfa74('0x118')](db[_0xfa74('0xf5')],{});db['WhatsappQueueReport'][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':'List','foreignKey':_0xfa74('0x15a')});db[_0xfa74('0xfc')]['belongsTo'](db[_0xfa74('0x6c')],{'as':'Contact','foreignKey':_0xfa74('0x151')});db[_0xfa74('0xfc')][_0xfa74('0x118')](db[_0xfa74('0xf9')],{});db[_0xfa74('0xfc')][_0xfa74('0x118')](db['WhatsappQueue'],{});db[_0xfa74('0xfc')][_0xfa74('0x118')](db[_0xfa74('0x1e7')],{});db[_0xfa74('0xfc')][_0xfa74('0x118')](db[_0xfa74('0x10')],{});db[_0xfa74('0xfe')][_0xfa74('0x118')](db[_0xfa74('0x1e7')],{});db[_0xfa74('0xfe')][_0xfa74('0x118')](db[_0xfa74('0xf9')],{});db['WhatsappTransferReport'][_0xfa74('0x118')](db[_0xfa74('0xf5')],{'foreignKey':'FromWhatsappAccountId','as':_0xfa74('0x1cd')});db[_0xfa74('0xfe')][_0xfa74('0x118')](db[_0xfa74('0xf5')],{'foreignKey':_0xfa74('0x1e9'),'as':'ToAccount'});db[_0xfa74('0xfe')][_0xfa74('0x118')](db[_0xfa74('0xff')],{'foreignKey':_0xfa74('0x1ea'),'as':_0xfa74('0x1d1')});db[_0xfa74('0xfe')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0xfa74('0x1ce')});db[_0xfa74('0xfe')]['belongsTo'](db['User'],{'foreignKey':_0xfa74('0x1d5'),'as':_0xfa74('0x1cf')});db[_0xfa74('0xff')][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':'WhatsappQueueId'});db['WhatsappQueue']['belongsToMany'](db[_0xfa74('0x15e')],{'through':_0xfa74('0x1c7'),'as':_0xfa74('0x146')});module[_0xfa74('0x1eb')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 4f55523..d82fe6d 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0628=['tenantId','token','accessTokenSecret','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','pass','secret','registry','oldPassword','isPlainObject','isArray','length','isString','@@{','}@@','includes','replace','lodash','path','express-winston','util','./errors','./config/environment','./config/logger','./safe-template','safeTemplate','default','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','headers','x-forwarded-for','connection','statusCode','responseTime','user','name','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','method','remoteAddress','role','other','agent_id','agent_name','/api/users','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/square/projects','./api/squareProject','/api/square/recordings','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','./api/campaign','/api/migrations','./api/migration','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','./api/cloudProvider','/api/realtime','/api/auth/local','/api/auth/google','./api/authGoogle','./api/authActiveDirectory','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','static','join','/apidoc','/www','root','/demo','snippet','3.0.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','password','lastName','phone','mobile','fax','email','clientId','clientSecret','securityToken','accessKey'];(function(_0x19f8a3,_0x34ba71){var _0x1b6ee8=function(_0x581b4f){while(--_0x581b4f){_0x19f8a3['push'](_0x19f8a3['shift']());}};_0x1b6ee8(++_0x34ba71);}(_0x0628,0x15c));var _0x8062=function(_0x8aa686,_0x3c7b74){_0x8aa686=_0x8aa686-0x0;var _0x5d73f7=_0x0628[_0x8aa686];return _0x5d73f7;};'use strict';var _=require(_0x8062('0x0'));var path=require(_0x8062('0x1'));var express=require('express');var ewinston=require(_0x8062('0x2'));var util=require(_0x8062('0x3'));var errors=require(_0x8062('0x4'));var config=require(_0x8062('0x5'));var logger=require(_0x8062('0x6'))('api');var authLogger=require(_0x8062('0x6'))('auth');var safeTemplate=require(_0x8062('0x7'))[_0x8062('0x8')];exports[_0x8062('0x9')]=function(_0x337f7d){_0x337f7d['use'](ewinston[_0x8062('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x5c5d10,_0x16e0de){var _0x3c2a55=_0x8062('0xb');if(!_[_0x8062('0xc')](_0x5c5d10[_0x8062('0xd')])){_0x3c2a55+='\x20body=%s';var _0x319369=_0x5c5d10[_0x8062('0xd')];maskSensitiveData(_0x319369);}return safeTemplate(util[_0x8062('0xe')](_0x3c2a55,_0x5c5d10['method'],_0x5c5d10[_0x8062('0xf')][_0x8062('0x10')]?_0x5c5d10['headers'][_0x8062('0x10')]:_0x5c5d10[_0x8062('0x11')]['remoteAddress']||_0x5c5d10['ip'],_0x5c5d10['url'],_0x16e0de[_0x8062('0x12')],_0x16e0de[_0x8062('0x13')],_0x5c5d10[_0x8062('0x14')]?_0x5c5d10['user']['id']:null,_0x5c5d10[_0x8062('0x14')]?_0x5c5d10[_0x8062('0x14')][_0x8062('0x15')]:null,_0x5c5d10[_0x8062('0x14')]?_0x5c5d10[_0x8062('0x14')]['role']:null,_0x319369?util[_0x8062('0x16')](_0x319369,![],null):''));}}));_0x337f7d[_0x8062('0x17')](ewinston[_0x8062('0xa')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x610875,_0x38e0f8){var _0x409aed=_0x8062('0x18');if(_0x610875[_0x8062('0xd')]&&_0x610875[_0x8062('0xd')][_0x8062('0x19')]&&_0x610875[_0x8062('0xd')]['agent_id']){_0x409aed='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x8062('0xe')](_0x409aed,_0x610875[_0x8062('0x1a')],_0x610875[_0x8062('0xf')][_0x8062('0x10')]?_0x610875['headers'][_0x8062('0x10')]:_0x610875[_0x8062('0x11')][_0x8062('0x1b')]||_0x610875['ip'],_0x610875['url'],_0x38e0f8[_0x8062('0x12')],_0x38e0f8[_0x8062('0x13')],_0x610875['user']?_0x610875['user']['id']:null,_0x610875[_0x8062('0x14')]?_0x610875[_0x8062('0x14')][_0x8062('0x15')]:null,_0x610875['user']?_0x610875[_0x8062('0x14')][_0x8062('0x1c')]:null,_0x610875['body']&&_0x610875[_0x8062('0xd')][_0x8062('0x19')]?_0x610875['body'][_0x8062('0x19')]:_0x8062('0x1d'),_0x610875[_0x8062('0xd')]&&_0x610875['body'][_0x8062('0x1e')]?_0x610875['body'][_0x8062('0x1e')]:'',_0x610875['body']&&_0x610875[_0x8062('0xd')][_0x8062('0x1f')]?_0x610875[_0x8062('0xd')][_0x8062('0x1f')]:'');},'ignoreRoute':function(_0x3da566){var _0x41deef=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x41deef['test'](_0x3da566['url']);}}));_0x337f7d['use'](_0x8062('0x20'),require(_0x8062('0x21')));_0x337f7d[_0x8062('0x17')](_0x8062('0x22'),require('./api/voiceChanSpy'));_0x337f7d[_0x8062('0x17')](_0x8062('0x23'),require(_0x8062('0x24')));_0x337f7d[_0x8062('0x17')](_0x8062('0x25'),require(_0x8062('0x26')));_0x337f7d[_0x8062('0x17')]('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x337f7d[_0x8062('0x17')](_0x8062('0x27'),require(_0x8062('0x28')));_0x337f7d[_0x8062('0x17')](_0x8062('0x29'),require(_0x8062('0x2a')));_0x337f7d[_0x8062('0x17')]('/api/screen/recordings',require('./api/screenRecording'));_0x337f7d['use'](_0x8062('0x2b'),require(_0x8062('0x2c')));_0x337f7d[_0x8062('0x17')](_0x8062('0x2d'),require(_0x8062('0x2e')));_0x337f7d[_0x8062('0x17')](_0x8062('0x2f'),require('./api/voiceCallReport'));_0x337f7d['use']('/api/voice/dials/reports',require(_0x8062('0x30')));_0x337f7d['use'](_0x8062('0x31'),require('./api/voiceAgentReport'));_0x337f7d[_0x8062('0x17')](_0x8062('0x32'),require(_0x8062('0x33')));_0x337f7d[_0x8062('0x17')]('/api/members/reports',require(_0x8062('0x34')));_0x337f7d[_0x8062('0x17')]('/api/trunks',require(_0x8062('0x35')));_0x337f7d[_0x8062('0x17')](_0x8062('0x36'),require(_0x8062('0x37')));_0x337f7d[_0x8062('0x17')]('/api/mail/out_servers',require('./api/mailServerOut'));_0x337f7d[_0x8062('0x17')]('/api/mail/accounts',require('./api/mailAccount'));_0x337f7d[_0x8062('0x17')](_0x8062('0x38'),require(_0x8062('0x39')));_0x337f7d[_0x8062('0x17')](_0x8062('0x3a'),require(_0x8062('0x3b')));_0x337f7d[_0x8062('0x17')](_0x8062('0x3c'),require(_0x8062('0x3d')));_0x337f7d['use'](_0x8062('0x3e'),require('./api/mailMessage'));_0x337f7d['use']('/api/mail/applications',require(_0x8062('0x3f')));_0x337f7d['use'](_0x8062('0x40'),require(_0x8062('0x41')));_0x337f7d[_0x8062('0x17')](_0x8062('0x42'),require(_0x8062('0x43')));_0x337f7d[_0x8062('0x17')](_0x8062('0x44'),require(_0x8062('0x45')));_0x337f7d[_0x8062('0x17')](_0x8062('0x46'),require(_0x8062('0x47')));_0x337f7d[_0x8062('0x17')](_0x8062('0x48'),require('./api/faxApplication'));_0x337f7d[_0x8062('0x17')](_0x8062('0x49'),require('./api/faxInteraction'));_0x337f7d[_0x8062('0x17')]('/api/fax/messages',require('./api/faxMessage'));_0x337f7d[_0x8062('0x17')](_0x8062('0x4a'),require(_0x8062('0x4b')));_0x337f7d[_0x8062('0x17')](_0x8062('0x4c'),require(_0x8062('0x4d')));_0x337f7d['use'](_0x8062('0x4e'),require('./api/smsAccount'));_0x337f7d[_0x8062('0x17')](_0x8062('0x4f'),require(_0x8062('0x50')));_0x337f7d[_0x8062('0x17')](_0x8062('0x51'),require('./api/smsInteraction'));_0x337f7d['use'](_0x8062('0x52'),require(_0x8062('0x53')));_0x337f7d[_0x8062('0x17')](_0x8062('0x54'),require(_0x8062('0x55')));_0x337f7d[_0x8062('0x17')](_0x8062('0x56'),require(_0x8062('0x57')));_0x337f7d[_0x8062('0x17')](_0x8062('0x58'),require(_0x8062('0x59')));_0x337f7d[_0x8062('0x17')](_0x8062('0x5a'),require(_0x8062('0x5b')));_0x337f7d[_0x8062('0x17')](_0x8062('0x5c'),require('./api/openchannelMessage'));_0x337f7d['use'](_0x8062('0x5d'),require(_0x8062('0x5e')));_0x337f7d['use'](_0x8062('0x5f'),require('./api/chatWebsite'));_0x337f7d['use'](_0x8062('0x60'),require('./api/openchannelQueueReport'));_0x337f7d[_0x8062('0x17')](_0x8062('0x61'),require(_0x8062('0x62')));_0x337f7d[_0x8062('0x17')]('/api/chat/interactions',require(_0x8062('0x63')));_0x337f7d[_0x8062('0x17')](_0x8062('0x64'),require('./api/chatMessage'));_0x337f7d[_0x8062('0x17')](_0x8062('0x65'),require(_0x8062('0x66')));_0x337f7d[_0x8062('0x17')](_0x8062('0x67'),require(_0x8062('0x68')));_0x337f7d[_0x8062('0x17')](_0x8062('0x69'),require(_0x8062('0x6a')));_0x337f7d[_0x8062('0x17')](_0x8062('0x6b'),require('./api/chatProactiveAction'));_0x337f7d['use']('/api/cm/companies',require('./api/cmCompany'));_0x337f7d[_0x8062('0x17')](_0x8062('0x6c'),require(_0x8062('0x6d')));_0x337f7d[_0x8062('0x17')](_0x8062('0x6e'),require('./api/cmHopper'));_0x337f7d['use'](_0x8062('0x6f'),require(_0x8062('0x70')));_0x337f7d[_0x8062('0x17')](_0x8062('0x71'),require('./api/cmHopperFinal'));_0x337f7d['use'](_0x8062('0x72'),require(_0x8062('0x73')));_0x337f7d['use'](_0x8062('0x74'),require(_0x8062('0x75')));_0x337f7d[_0x8062('0x17')](_0x8062('0x76'),require(_0x8062('0x77')));_0x337f7d['use']('/api/automations',require(_0x8062('0x78')));_0x337f7d[_0x8062('0x17')](_0x8062('0x79'),require(_0x8062('0x7a')));_0x337f7d[_0x8062('0x17')](_0x8062('0x7b'),require(_0x8062('0x7c')));_0x337f7d[_0x8062('0x17')](_0x8062('0x7d'),require(_0x8062('0x7e')));_0x337f7d['use'](_0x8062('0x7f'),require(_0x8062('0x80')));_0x337f7d[_0x8062('0x17')](_0x8062('0x81'),require(_0x8062('0x82')));_0x337f7d[_0x8062('0x17')](_0x8062('0x83'),require('./api/cdr'));_0x337f7d[_0x8062('0x17')](_0x8062('0x84'),require(_0x8062('0x85')));_0x337f7d[_0x8062('0x17')](_0x8062('0x86'),require('./api/schedule'));_0x337f7d['use'](_0x8062('0x87'),require(_0x8062('0x88')));_0x337f7d[_0x8062('0x17')](_0x8062('0x89'),require(_0x8062('0x8a')));_0x337f7d[_0x8062('0x17')](_0x8062('0x8b'),require('./api/template'));_0x337f7d[_0x8062('0x17')]('/api/triggers',require(_0x8062('0x8c')));_0x337f7d[_0x8062('0x17')](_0x8062('0x8d'),require(_0x8062('0x8e')));_0x337f7d['use'](_0x8062('0x8f'),require(_0x8062('0x90')));_0x337f7d[_0x8062('0x17')](_0x8062('0x91'),require(_0x8062('0x92')));_0x337f7d['use'](_0x8062('0x93'),require(_0x8062('0x94')));_0x337f7d[_0x8062('0x17')](_0x8062('0x95'),require(_0x8062('0x96')));_0x337f7d[_0x8062('0x17')](_0x8062('0x97'),require(_0x8062('0x98')));_0x337f7d[_0x8062('0x17')](_0x8062('0x99'),require(_0x8062('0x9a')));_0x337f7d[_0x8062('0x17')](_0x8062('0x9b'),require(_0x8062('0x9c')));_0x337f7d[_0x8062('0x17')]('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0x337f7d[_0x8062('0x17')](_0x8062('0x9d'),require(_0x8062('0x9e')));_0x337f7d[_0x8062('0x17')](_0x8062('0x9f'),require(_0x8062('0xa0')));_0x337f7d['use'](_0x8062('0xa1'),require('./api/intSalesforceField'));_0x337f7d[_0x8062('0x17')]('/api/integrations/sugarcrm/accounts',require(_0x8062('0xa2')));_0x337f7d[_0x8062('0x17')](_0x8062('0xa3'),require(_0x8062('0xa4')));_0x337f7d[_0x8062('0x17')](_0x8062('0xa5'),require('./api/intSugarcrmField'));_0x337f7d['use']('/api/integrations/desk/accounts',require(_0x8062('0xa6')));_0x337f7d[_0x8062('0x17')]('/api/integrations/desk/configurations',require(_0x8062('0xa7')));_0x337f7d[_0x8062('0x17')](_0x8062('0xa8'),require(_0x8062('0xa9')));_0x337f7d[_0x8062('0x17')]('/api/integrations/zoho/accounts',require(_0x8062('0xaa')));_0x337f7d[_0x8062('0x17')](_0x8062('0xab'),require('./api/intZohoConfiguration'));_0x337f7d[_0x8062('0x17')]('/api/integrations/zoho/fields',require(_0x8062('0xac')));_0x337f7d[_0x8062('0x17')](_0x8062('0xad'),require('./api/intZendeskAccount'));_0x337f7d[_0x8062('0x17')](_0x8062('0xae'),require(_0x8062('0xaf')));_0x337f7d[_0x8062('0x17')](_0x8062('0xb0'),require(_0x8062('0xb1')));_0x337f7d[_0x8062('0x17')](_0x8062('0xb2'),require('./api/intFreshdeskAccount'));_0x337f7d['use'](_0x8062('0xb3'),require('./api/intFreshdeskConfiguration'));_0x337f7d[_0x8062('0x17')](_0x8062('0xb4'),require('./api/intFreshdeskField'));_0x337f7d[_0x8062('0x17')]('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0x337f7d['use']('/api/integrations/vtiger/configurations',require(_0x8062('0xb5')));_0x337f7d['use'](_0x8062('0xb6'),require(_0x8062('0xb7')));_0x337f7d[_0x8062('0x17')](_0x8062('0xb8'),require(_0x8062('0xb9')));_0x337f7d['use'](_0x8062('0xba'),require(_0x8062('0xbb')));_0x337f7d['use'](_0x8062('0xbc'),require(_0x8062('0xbd')));_0x337f7d[_0x8062('0x17')](_0x8062('0xbe'),require('./api/intDynamics365Account'));_0x337f7d[_0x8062('0x17')]('/api/integrations/dynamics365/configurations',require(_0x8062('0xbf')));_0x337f7d[_0x8062('0x17')](_0x8062('0xc0'),require(_0x8062('0xc1')));_0x337f7d[_0x8062('0x17')](_0x8062('0xc2'),require(_0x8062('0xc3')));_0x337f7d['use']('/api/integrations/freshsales/configurations',require(_0x8062('0xc4')));_0x337f7d[_0x8062('0x17')](_0x8062('0xc5'),require(_0x8062('0xc6')));_0x337f7d[_0x8062('0x17')](_0x8062('0xc7'),require(_0x8062('0xc8')));_0x337f7d[_0x8062('0x17')](_0x8062('0xc9'),require(_0x8062('0xca')));_0x337f7d[_0x8062('0x17')]('/api/chat/internal/messages',require(_0x8062('0xcb')));_0x337f7d[_0x8062('0x17')]('/api/jscripty/answers/reports',require('./api/jscriptyAnswerReport'));_0x337f7d[_0x8062('0x17')](_0x8062('0xcc'),require(_0x8062('0xcd')));_0x337f7d[_0x8062('0x17')](_0x8062('0xce'),require(_0x8062('0xcf')));_0x337f7d[_0x8062('0x17')](_0x8062('0xd0'),require(_0x8062('0xd1')));_0x337f7d['use'](_0x8062('0xd2'),require(_0x8062('0xd3')));_0x337f7d[_0x8062('0x17')](_0x8062('0xd4'),require(_0x8062('0xd5')));_0x337f7d['use'](_0x8062('0xd6'),require(_0x8062('0xd7')));_0x337f7d[_0x8062('0x17')]('/api/settings',require('./api/setting'));_0x337f7d['use']('/api/square/odbc',require('./api/squareOdbc'));_0x337f7d[_0x8062('0x17')](_0x8062('0xd8'),require(_0x8062('0xd9')));_0x337f7d[_0x8062('0x17')](_0x8062('0xda'),require('./api/squareRecording'));_0x337f7d[_0x8062('0x17')](_0x8062('0xdb'),require(_0x8062('0xdc')));_0x337f7d[_0x8062('0x17')](_0x8062('0xdd'),require(_0x8062('0xde')));_0x337f7d[_0x8062('0x17')](_0x8062('0xdf'),require(_0x8062('0xe0')));_0x337f7d['use']('/api/campaigns',require(_0x8062('0xe1')));_0x337f7d['use'](_0x8062('0xe2'),require(_0x8062('0xe3')));_0x337f7d[_0x8062('0x17')]('/api/attachments',require('./api/attachment'));_0x337f7d['use'](_0x8062('0xe4'),require(_0x8062('0xe5')));_0x337f7d[_0x8062('0x17')]('/api/mail/reports/transfer',require(_0x8062('0xe6')));_0x337f7d[_0x8062('0x17')](_0x8062('0xe7'),require(_0x8062('0xe8')));_0x337f7d['use'](_0x8062('0xe9'),require(_0x8062('0xea')));_0x337f7d[_0x8062('0x17')]('/api/openchannel/reports/transfer',require(_0x8062('0xeb')));_0x337f7d[_0x8062('0x17')](_0x8062('0xec'),require('./api/smsTransferReport'));_0x337f7d['use'](_0x8062('0xed'),require(_0x8062('0xee')));_0x337f7d[_0x8062('0x17')](_0x8062('0xef'),require(_0x8062('0xf0')));_0x337f7d[_0x8062('0x17')]('/api/userProfiles',require(_0x8062('0xf1')));_0x337f7d['use']('/api/userProfile/sections',require(_0x8062('0xf2')));_0x337f7d[_0x8062('0x17')](_0x8062('0xf3'),require(_0x8062('0xf4')));_0x337f7d[_0x8062('0x17')](_0x8062('0xf5'),require(_0x8062('0xf6')));_0x337f7d[_0x8062('0x17')]('/api/whatsapp/accounts',require(_0x8062('0xf7')));_0x337f7d[_0x8062('0x17')](_0x8062('0xf8'),require('./api/whatsappApplication'));_0x337f7d[_0x8062('0x17')](_0x8062('0xf9'),require('./api/whatsappInteraction'));_0x337f7d[_0x8062('0x17')]('/api/whatsapp/messages',require(_0x8062('0xfa')));_0x337f7d[_0x8062('0x17')](_0x8062('0xfb'),require(_0x8062('0xfc')));_0x337f7d[_0x8062('0x17')]('/api/whatsapp/reports/transfer',require(_0x8062('0xfd')));_0x337f7d[_0x8062('0x17')](_0x8062('0xfe'),require('./api/whatsappQueue'));_0x337f7d['use']('/api/cloudProviders',require(_0x8062('0xff')));_0x337f7d[_0x8062('0x17')](_0x8062('0x100'),require('./api/realtime'));_0x337f7d[_0x8062('0x17')](_0x8062('0x101'),require('./api/authLocal'));_0x337f7d[_0x8062('0x17')](_0x8062('0x102'),require(_0x8062('0x103')));_0x337f7d['use']('/api/auth/activedirectory',require(_0x8062('0x104')));_0x337f7d[_0x8062('0x17')]('/api/jira',require(_0x8062('0x105')));_0x337f7d[_0x8062('0x17')](_0x8062('0x106'),require(_0x8062('0x107')));_0x337f7d[_0x8062('0x17')](_0x8062('0x108'),require(_0x8062('0x109')));_0x337f7d[_0x8062('0x17')](_0x8062('0x10a'),require(_0x8062('0x10b')));_0x337f7d[_0x8062('0x17')](_0x8062('0x10c'),require(_0x8062('0x10d')));_0x337f7d['use'](_0x8062('0x10e'),require(_0x8062('0x10f')));_0x337f7d['use']('/apidoc',express[_0x8062('0x110')](path[_0x8062('0x111')](config['root'],_0x8062('0x112'))));_0x337f7d[_0x8062('0x17')](_0x8062('0x113'),express[_0x8062('0x110')](path['join'](config[_0x8062('0x114')],_0x8062('0x113'))));_0x337f7d[_0x8062('0x17')]('/demo',express[_0x8062('0x110')](path[_0x8062('0x111')](config[_0x8062('0x114')],_0x8062('0x115'))));_0x337f7d['use']('/snippet',express[_0x8062('0x110')](path[_0x8062('0x111')](config[_0x8062('0x114')],_0x8062('0x116'),_0x8062('0x117'))));_0x337f7d[_0x8062('0x17')]('/plugins',express[_0x8062('0x110')](path[_0x8062('0x111')](config[_0x8062('0x114')],_0x8062('0x118'))));_0x337f7d[_0x8062('0x119')](_0x8062('0x11a'))[_0x8062('0x11b')](errors[0x194]);_0x337f7d[_0x8062('0x119')]('/*')['get'](function(_0x5686ff,_0x5e785c){_0x5e785c[_0x8062('0x11c')](path[_0x8062('0x11d')](_0x337f7d[_0x8062('0x11b')](_0x8062('0x11e'))+_0x8062('0x11f')));});};var sensitiveFields=['username',_0x8062('0x120'),'newPassword','apiKey','firstName',_0x8062('0x121'),'street',_0x8062('0x122'),_0x8062('0x123'),_0x8062('0x124'),_0x8062('0x125'),_0x8062('0x126'),_0x8062('0x127'),_0x8062('0x128'),'code',_0x8062('0x129'),_0x8062('0x12a'),_0x8062('0x12b'),'channelSecret','accessToken',_0x8062('0x12c'),'authToken',_0x8062('0x12d'),_0x8062('0x12e'),_0x8062('0x12f'),_0x8062('0x130'),_0x8062('0x131'),_0x8062('0x132'),_0x8062('0x133'),_0x8062('0x134'),_0x8062('0x135'),_0x8062('0x136'),'secretaccesskey','key',_0x8062('0x14'),_0x8062('0x137'),'accountSid','localstationid','dsn',_0x8062('0x138'),_0x8062('0x139'),_0x8062('0x13a')];function maskSensitiveData(_0x56e652){var _0x297b06=/(?!^)[\s\S](?!$)/g;if(!_[_0x8062('0x13b')](_0x56e652))return;for(var _0xb455f6 in _0x56e652){if(_[_0x8062('0x13c')](_0x56e652[_0xb455f6])){for(var _0x545fa8=0x0;_0x545fa8<_0x56e652[_0xb455f6][_0x8062('0x13d')];_0x545fa8++){maskSensitiveData(_0x56e652[_0xb455f6][_0x545fa8]);}}else if(_[_0x8062('0x13b')](_0x56e652[_0xb455f6])){maskSensitiveData(_0x56e652[_0xb455f6]);}else if(_[_0x8062('0x13e')](_0x56e652[_0xb455f6])){_0x56e652[_0xb455f6]=_0x56e652[_0xb455f6]['replace'](/{{{/g,_0x8062('0x13f'))['replace'](/}}}/g,_0x8062('0x140'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x8062('0x141')](sensitiveFields,_0xb455f6)){_0x56e652[_0xb455f6]=_0x56e652[_0xb455f6][_0x8062('0x142')](_0x297b06,'*');}}}} \ No newline at end of file +var _0xed0b=['3.0.0','/plugins','route','get','resolve','appPath','password','phone','mobile','fax','email','clientSecret','accessKey','tenantId','token','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','pass','localstationid','secret','registry','oldPassword','isPlainObject','length','isString','replace','@@{','}@@','includes','lodash','express','express-winston','util','api','auth','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','headers','role','device','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/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/mailServerOut','/api/mail/accounts','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','/api/mail/messages','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','./api/openchannelMessage','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/chatApplication','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','./api/intDynamics365Configuration','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/setting','/api/square/odbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfileSection','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','/api/auth/activedirectory','/api/jira','./api/jira','./api/rpc','/api/version','./api/version','/api/system','/api/pm2','./api/webbar','/apidoc','static','join','root','/www','/demo'];(function(_0x5ea4b9,_0x1a62b6){var _0x3d375f=function(_0x2341bd){while(--_0x2341bd){_0x5ea4b9['push'](_0x5ea4b9['shift']());}};_0x3d375f(++_0x1a62b6);}(_0xed0b,0x15f));var _0xbed0=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0xed0b[_0x485b5a];return _0xd2b34d;};'use strict';var _=require(_0xbed0('0x0'));var path=require('path');var express=require(_0xbed0('0x1'));var ewinston=require(_0xbed0('0x2'));var util=require(_0xbed0('0x3'));var errors=require('./errors');var config=require('./config/environment');var logger=require('./config/logger')(_0xbed0('0x4'));var authLogger=require('./config/logger')(_0xbed0('0x5'));var safeTemplate=require('./safe-template')['safeTemplate'];exports[_0xbed0('0x6')]=function(_0x15508e){_0x15508e[_0xbed0('0x7')](ewinston[_0xbed0('0x8')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0xf85e12,_0x4ca3a0){var _0x23398d=_0xbed0('0x9');if(!_[_0xbed0('0xa')](_0xf85e12[_0xbed0('0xb')])){_0x23398d+=_0xbed0('0xc');var _0x499b7c=_0xf85e12[_0xbed0('0xb')];maskSensitiveData(_0x499b7c);}return safeTemplate(util[_0xbed0('0xd')](_0x23398d,_0xf85e12[_0xbed0('0xe')],_0xf85e12['headers'][_0xbed0('0xf')]?_0xf85e12['headers'][_0xbed0('0xf')]:_0xf85e12[_0xbed0('0x10')][_0xbed0('0x11')]||_0xf85e12['ip'],_0xf85e12[_0xbed0('0x12')],_0x4ca3a0[_0xbed0('0x13')],_0x4ca3a0[_0xbed0('0x14')],_0xf85e12['user']?_0xf85e12[_0xbed0('0x15')]['id']:null,_0xf85e12[_0xbed0('0x15')]?_0xf85e12['user'][_0xbed0('0x16')]:null,_0xf85e12[_0xbed0('0x15')]?_0xf85e12[_0xbed0('0x15')]['role']:null,_0x499b7c?util['inspect'](_0x499b7c,![],null):''));}}));_0x15508e[_0xbed0('0x7')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x59deeb,_0x599044){var _0xf2c2a3=_0xbed0('0x17');if(_0x59deeb['body']&&_0x59deeb[_0xbed0('0xb')]['device']&&_0x59deeb[_0xbed0('0xb')][_0xbed0('0x18')]){_0xf2c2a3='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0xbed0('0xd')](_0xf2c2a3,_0x59deeb['method'],_0x59deeb[_0xbed0('0x19')][_0xbed0('0xf')]?_0x59deeb[_0xbed0('0x19')][_0xbed0('0xf')]:_0x59deeb[_0xbed0('0x10')][_0xbed0('0x11')]||_0x59deeb['ip'],_0x59deeb[_0xbed0('0x12')],_0x599044[_0xbed0('0x13')],_0x599044['responseTime'],_0x59deeb['user']?_0x59deeb[_0xbed0('0x15')]['id']:null,_0x59deeb[_0xbed0('0x15')]?_0x59deeb['user'][_0xbed0('0x16')]:null,_0x59deeb['user']?_0x59deeb[_0xbed0('0x15')][_0xbed0('0x1a')]:null,_0x59deeb[_0xbed0('0xb')]&&_0x59deeb['body'][_0xbed0('0x1b')]?_0x59deeb['body'][_0xbed0('0x1b')]:_0xbed0('0x1c'),_0x59deeb['body']&&_0x59deeb[_0xbed0('0xb')][_0xbed0('0x18')]?_0x59deeb[_0xbed0('0xb')][_0xbed0('0x18')]:'',_0x59deeb[_0xbed0('0xb')]&&_0x59deeb[_0xbed0('0xb')][_0xbed0('0x1d')]?_0x59deeb[_0xbed0('0xb')]['agent_name']:'');},'ignoreRoute':function(_0x5cbf6b){var _0x2cd94b=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2cd94b[_0xbed0('0x1e')](_0x5cbf6b['url']);}}));_0x15508e[_0xbed0('0x7')](_0xbed0('0x1f'),require(_0xbed0('0x20')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x21'),require(_0xbed0('0x22')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x23'),require(_0xbed0('0x24')));_0x15508e['use'](_0xbed0('0x25'),require(_0xbed0('0x26')));_0x15508e[_0xbed0('0x7')]('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x15508e['use'](_0xbed0('0x27'),require(_0xbed0('0x28')));_0x15508e['use'](_0xbed0('0x29'),require(_0xbed0('0x2a')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x2b'),require(_0xbed0('0x2c')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x2d'),require(_0xbed0('0x2e')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x2f'),require(_0xbed0('0x30')));_0x15508e['use'](_0xbed0('0x31'),require(_0xbed0('0x32')));_0x15508e['use'](_0xbed0('0x33'),require('./api/voiceDialReport'));_0x15508e['use'](_0xbed0('0x34'),require(_0xbed0('0x35')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x36'),require(_0xbed0('0x37')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x38'),require(_0xbed0('0x39')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x3a'),require(_0xbed0('0x3b')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x3c'),require(_0xbed0('0x3d')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x3e'),require(_0xbed0('0x3f')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x40'),require('./api/mailAccount'));_0x15508e[_0xbed0('0x7')](_0xbed0('0x41'),require(_0xbed0('0x42')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x43'),require('./api/mailSubstatus'));_0x15508e[_0xbed0('0x7')](_0xbed0('0x44'),require('./api/mailInteraction'));_0x15508e['use'](_0xbed0('0x45'),require(_0xbed0('0x46')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x47'),require('./api/mailApplication'));_0x15508e[_0xbed0('0x7')](_0xbed0('0x48'),require(_0xbed0('0x49')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x4a'),require('./api/dashboard'));_0x15508e[_0xbed0('0x7')]('/api/dashboards/items',require(_0xbed0('0x4b')));_0x15508e[_0xbed0('0x7')]('/api/fax/accounts',require(_0xbed0('0x4c')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x4d'),require(_0xbed0('0x4e')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x4f'),require('./api/faxInteraction'));_0x15508e[_0xbed0('0x7')]('/api/fax/messages',require(_0xbed0('0x50')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x51'),require(_0xbed0('0x52')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x53'),require(_0xbed0('0x54')));_0x15508e['use']('/api/sms/accounts',require(_0xbed0('0x55')));_0x15508e['use'](_0xbed0('0x56'),require('./api/smsApplication'));_0x15508e[_0xbed0('0x7')](_0xbed0('0x57'),require(_0xbed0('0x58')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x59'),require(_0xbed0('0x5a')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x5b'),require(_0xbed0('0x5c')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x5d'),require(_0xbed0('0x5e')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x5f'),require(_0xbed0('0x60')));_0x15508e[_0xbed0('0x7')]('/api/openchannel/interactions',require(_0xbed0('0x61')));_0x15508e[_0xbed0('0x7')]('/api/openchannel/messages',require(_0xbed0('0x62')));_0x15508e[_0xbed0('0x7')]('/api/openchannel/queues',require('./api/openchannelQueue'));_0x15508e[_0xbed0('0x7')](_0xbed0('0x63'),require(_0xbed0('0x64')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x65'),require('./api/openchannelQueueReport'));_0x15508e[_0xbed0('0x7')]('/api/chat/applications',require(_0xbed0('0x66')));_0x15508e[_0xbed0('0x7')]('/api/chat/interactions',require(_0xbed0('0x67')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x68'),require('./api/chatMessage'));_0x15508e[_0xbed0('0x7')](_0xbed0('0x69'),require(_0xbed0('0x6a')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x6b'),require(_0xbed0('0x6c')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x6d'),require('./api/chatGroup'));_0x15508e[_0xbed0('0x7')](_0xbed0('0x6e'),require('./api/chatProactiveAction'));_0x15508e[_0xbed0('0x7')](_0xbed0('0x6f'),require(_0xbed0('0x70')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x71'),require('./api/cmContact'));_0x15508e[_0xbed0('0x7')](_0xbed0('0x72'),require('./api/cmHopper'));_0x15508e['use'](_0xbed0('0x73'),require(_0xbed0('0x74')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x75'),require(_0xbed0('0x76')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x77'),require(_0xbed0('0x78')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x79'),require(_0xbed0('0x7a')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x7b'),require(_0xbed0('0x7c')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x7d'),require(_0xbed0('0x7e')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x7f'),require(_0xbed0('0x80')));_0x15508e[_0xbed0('0x7')]('/api/dispositions',require('./api/disposition'));_0x15508e[_0xbed0('0x7')]('/api/conditions',require(_0xbed0('0x81')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x82'),require('./api/interval'));_0x15508e[_0xbed0('0x7')](_0xbed0('0x83'),require(_0xbed0('0x84')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x85'),require(_0xbed0('0x86')));_0x15508e[_0xbed0('0x7')]('/api/voiceQueuesLog',require(_0xbed0('0x87')));_0x15508e['use'](_0xbed0('0x88'),require('./api/schedule'));_0x15508e[_0xbed0('0x7')]('/api/sounds',require(_0xbed0('0x89')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x8a'),require(_0xbed0('0x8b')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x8c'),require(_0xbed0('0x8d')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x8e'),require(_0xbed0('0x8f')));_0x15508e['use'](_0xbed0('0x90'),require(_0xbed0('0x91')));_0x15508e['use']('/api/integrations',require('./api/integration'));_0x15508e['use'](_0xbed0('0x92'),require('./api/integrationReport'));_0x15508e[_0xbed0('0x7')](_0xbed0('0x93'),require(_0xbed0('0x94')));_0x15508e['use'](_0xbed0('0x95'),require(_0xbed0('0x96')));_0x15508e['use'](_0xbed0('0x97'),require(_0xbed0('0x98')));_0x15508e['use'](_0xbed0('0x99'),require(_0xbed0('0x9a')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x9b'),require(_0xbed0('0x9c')));_0x15508e[_0xbed0('0x7')]('/api/analytics/tree_reports',require(_0xbed0('0x9d')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x9e'),require('./api/intSalesforceAccount'));_0x15508e[_0xbed0('0x7')](_0xbed0('0x9f'),require(_0xbed0('0xa0')));_0x15508e[_0xbed0('0x7')](_0xbed0('0xa1'),require(_0xbed0('0xa2')));_0x15508e[_0xbed0('0x7')](_0xbed0('0xa3'),require(_0xbed0('0xa4')));_0x15508e[_0xbed0('0x7')](_0xbed0('0xa5'),require(_0xbed0('0xa6')));_0x15508e['use'](_0xbed0('0xa7'),require(_0xbed0('0xa8')));_0x15508e[_0xbed0('0x7')](_0xbed0('0xa9'),require(_0xbed0('0xaa')));_0x15508e[_0xbed0('0x7')](_0xbed0('0xab'),require(_0xbed0('0xac')));_0x15508e[_0xbed0('0x7')](_0xbed0('0xad'),require('./api/intDeskField'));_0x15508e[_0xbed0('0x7')](_0xbed0('0xae'),require(_0xbed0('0xaf')));_0x15508e[_0xbed0('0x7')](_0xbed0('0xb0'),require(_0xbed0('0xb1')));_0x15508e['use'](_0xbed0('0xb2'),require(_0xbed0('0xb3')));_0x15508e['use'](_0xbed0('0xb4'),require(_0xbed0('0xb5')));_0x15508e[_0xbed0('0x7')](_0xbed0('0xb6'),require('./api/intZendeskConfiguration'));_0x15508e[_0xbed0('0x7')](_0xbed0('0xb7'),require('./api/intZendeskField'));_0x15508e[_0xbed0('0x7')]('/api/integrations/freshdesk/accounts',require('./api/intFreshdeskAccount'));_0x15508e[_0xbed0('0x7')](_0xbed0('0xb8'),require(_0xbed0('0xb9')));_0x15508e[_0xbed0('0x7')](_0xbed0('0xba'),require(_0xbed0('0xbb')));_0x15508e[_0xbed0('0x7')](_0xbed0('0xbc'),require('./api/intVtigerAccount'));_0x15508e[_0xbed0('0x7')](_0xbed0('0xbd'),require('./api/intVtigerConfiguration'));_0x15508e[_0xbed0('0x7')]('/api/integrations/vtiger/fields',require(_0xbed0('0xbe')));_0x15508e['use'](_0xbed0('0xbf'),require(_0xbed0('0xc0')));_0x15508e[_0xbed0('0x7')]('/api/integrations/servicenow/configurations',require(_0xbed0('0xc1')));_0x15508e[_0xbed0('0x7')](_0xbed0('0xc2'),require(_0xbed0('0xc3')));_0x15508e['use']('/api/integrations/dynamics365/accounts',require(_0xbed0('0xc4')));_0x15508e[_0xbed0('0x7')]('/api/integrations/dynamics365/configurations',require(_0xbed0('0xc5')));_0x15508e[_0xbed0('0x7')]('/api/integrations/dynamics365/fields',require(_0xbed0('0xc6')));_0x15508e['use']('/api/integrations/freshsales/accounts',require(_0xbed0('0xc7')));_0x15508e['use'](_0xbed0('0xc8'),require('./api/intFreshsalesConfiguration'));_0x15508e[_0xbed0('0x7')](_0xbed0('0xc9'),require('./api/intFreshsalesField'));_0x15508e[_0xbed0('0x7')](_0xbed0('0xca'),require(_0xbed0('0xcb')));_0x15508e[_0xbed0('0x7')](_0xbed0('0xcc'),require(_0xbed0('0xcd')));_0x15508e['use'](_0xbed0('0xce'),require('./api/chatInternalMessage'));_0x15508e[_0xbed0('0x7')]('/api/jscripty/answers/reports',require(_0xbed0('0xcf')));_0x15508e[_0xbed0('0x7')](_0xbed0('0xd0'),require('./api/jscriptyQuestionReport'));_0x15508e[_0xbed0('0x7')]('/api/jscripty/sessions/reports',require('./api/jscriptySessionReport'));_0x15508e['use'](_0xbed0('0xd1'),require(_0xbed0('0xd2')));_0x15508e['use'](_0xbed0('0xd3'),require(_0xbed0('0xd4')));_0x15508e[_0xbed0('0x7')](_0xbed0('0xd5'),require(_0xbed0('0xd6')));_0x15508e['use'](_0xbed0('0xd7'),require('./api/jscriptyProject'));_0x15508e['use']('/api/settings',require(_0xbed0('0xd8')));_0x15508e[_0xbed0('0x7')](_0xbed0('0xd9'),require('./api/squareOdbc'));_0x15508e[_0xbed0('0x7')](_0xbed0('0xda'),require('./api/squareProject'));_0x15508e[_0xbed0('0x7')](_0xbed0('0xdb'),require(_0xbed0('0xdc')));_0x15508e['use'](_0xbed0('0xdd'),require(_0xbed0('0xde')));_0x15508e['use'](_0xbed0('0xdf'),require('./api/team'));_0x15508e[_0xbed0('0x7')]('/api/license',require(_0xbed0('0xe0')));_0x15508e['use'](_0xbed0('0xe1'),require(_0xbed0('0xe2')));_0x15508e[_0xbed0('0x7')](_0xbed0('0xe3'),require(_0xbed0('0xe4')));_0x15508e[_0xbed0('0x7')](_0xbed0('0xe5'),require('./api/attachment'));_0x15508e[_0xbed0('0x7')](_0xbed0('0xe6'),require(_0xbed0('0xe7')));_0x15508e[_0xbed0('0x7')](_0xbed0('0xe8'),require(_0xbed0('0xe9')));_0x15508e[_0xbed0('0x7')](_0xbed0('0xea'),require(_0xbed0('0xeb')));_0x15508e[_0xbed0('0x7')]('/api/fax/reports/transfer',require(_0xbed0('0xec')));_0x15508e['use'](_0xbed0('0xed'),require(_0xbed0('0xee')));_0x15508e[_0xbed0('0x7')](_0xbed0('0xef'),require('./api/smsTransferReport'));_0x15508e[_0xbed0('0x7')](_0xbed0('0xf0'),require(_0xbed0('0xf1')));_0x15508e[_0xbed0('0x7')](_0xbed0('0xf2'),require(_0xbed0('0xf3')));_0x15508e[_0xbed0('0x7')](_0xbed0('0xf4'),require('./api/userProfile'));_0x15508e[_0xbed0('0x7')]('/api/userProfile/sections',require(_0xbed0('0xf5')));_0x15508e[_0xbed0('0x7')]('/api/userProfile/resources',require(_0xbed0('0xf6')));_0x15508e[_0xbed0('0x7')]('/api/userNotifications',require(_0xbed0('0xf7')));_0x15508e[_0xbed0('0x7')](_0xbed0('0xf8'),require(_0xbed0('0xf9')));_0x15508e[_0xbed0('0x7')](_0xbed0('0xfa'),require(_0xbed0('0xfb')));_0x15508e[_0xbed0('0x7')]('/api/whatsapp/interactions',require(_0xbed0('0xfc')));_0x15508e[_0xbed0('0x7')](_0xbed0('0xfd'),require(_0xbed0('0xfe')));_0x15508e['use'](_0xbed0('0xff'),require('./api/whatsappQueueReport'));_0x15508e[_0xbed0('0x7')]('/api/whatsapp/reports/transfer',require('./api/whatsappTransferReport'));_0x15508e[_0xbed0('0x7')](_0xbed0('0x100'),require(_0xbed0('0x101')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x102'),require(_0xbed0('0x103')));_0x15508e[_0xbed0('0x7')]('/api/realtime',require(_0xbed0('0x104')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x105'),require(_0xbed0('0x106')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x107'),require('./api/authGoogle'));_0x15508e[_0xbed0('0x7')](_0xbed0('0x108'),require('./api/authActiveDirectory'));_0x15508e[_0xbed0('0x7')](_0xbed0('0x109'),require(_0xbed0('0x10a')));_0x15508e[_0xbed0('0x7')]('/api/rpc',require(_0xbed0('0x10b')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x10c'),require(_0xbed0('0x10d')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x10e'),require('./api/system'));_0x15508e[_0xbed0('0x7')](_0xbed0('0x10f'),require('./api/pm2'));_0x15508e['use']('/api/webbar',require(_0xbed0('0x110')));_0x15508e[_0xbed0('0x7')](_0xbed0('0x111'),express[_0xbed0('0x112')](path[_0xbed0('0x113')](config[_0xbed0('0x114')],_0xbed0('0x111'))));_0x15508e[_0xbed0('0x7')]('/www',express['static'](path[_0xbed0('0x113')](config['root'],_0xbed0('0x115'))));_0x15508e[_0xbed0('0x7')](_0xbed0('0x116'),express[_0xbed0('0x112')](path[_0xbed0('0x113')](config[_0xbed0('0x114')],_0xbed0('0x116'))));_0x15508e[_0xbed0('0x7')]('/snippet',express[_0xbed0('0x112')](path[_0xbed0('0x113')](config[_0xbed0('0x114')],'snippet',_0xbed0('0x117'))));_0x15508e[_0xbed0('0x7')](_0xbed0('0x118'),express['static'](path[_0xbed0('0x113')](config[_0xbed0('0x114')],'/server/files/plugins')));_0x15508e[_0xbed0('0x119')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0xbed0('0x11a')](errors[0x194]);_0x15508e['route']('/*')[_0xbed0('0x11a')](function(_0x3e9531,_0x430311){_0x430311['sendFile'](path[_0xbed0('0x11b')](_0x15508e[_0xbed0('0x11a')](_0xbed0('0x11c'))+'/index.html'));});};var sensitiveFields=['username',_0xbed0('0x11d'),'newPassword','apiKey','firstName','lastName','street',_0xbed0('0x11e'),_0xbed0('0x11f'),_0xbed0('0x120'),_0xbed0('0x121'),'clientId',_0xbed0('0x122'),'securityToken','code',_0xbed0('0x123'),_0xbed0('0x124'),_0xbed0('0x125'),'channelSecret','accessToken',_0xbed0('0x126'),_0xbed0('0x127'),_0xbed0('0x128'),_0xbed0('0x129'),'membername','calleridname',_0xbed0('0x12a'),_0xbed0('0x12b'),_0xbed0('0x12c'),_0xbed0('0x12d'),_0xbed0('0x12e'),'accesskeyid','secretaccesskey','key',_0xbed0('0x15'),_0xbed0('0x12f'),'accountSid',_0xbed0('0x130'),'dsn',_0xbed0('0x131'),_0xbed0('0x132'),_0xbed0('0x133')];function maskSensitiveData(_0x3084a5){var _0x1b4977=/(?!^)[\s\S](?!$)/g;if(!_[_0xbed0('0x134')](_0x3084a5))return;for(var _0x548f1d in _0x3084a5){if(_['isArray'](_0x3084a5[_0x548f1d])){for(var _0x11f59e=0x0;_0x11f59e<_0x3084a5[_0x548f1d][_0xbed0('0x135')];_0x11f59e++){maskSensitiveData(_0x3084a5[_0x548f1d][_0x11f59e]);}}else if(_[_0xbed0('0x134')](_0x3084a5[_0x548f1d])){maskSensitiveData(_0x3084a5[_0x548f1d]);}else if(_[_0xbed0('0x136')](_0x3084a5[_0x548f1d])){_0x3084a5[_0x548f1d]=_0x3084a5[_0x548f1d][_0xbed0('0x137')](/{{{/g,_0xbed0('0x138'))[_0xbed0('0x137')](/}}}/g,_0xbed0('0x139'))[_0xbed0('0x137')](/{{/g,'@{')[_0xbed0('0x137')](/}}/g,'}@');if(_[_0xbed0('0x13a')](sensitiveFields,_0x548f1d)){_0x3084a5[_0x548f1d]=_0x3084a5[_0x548f1d][_0xbed0('0x137')](_0x1b4977,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index f96ceb1..69c65a1 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe006=['../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.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/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','bluebird','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc'];(function(_0xe591a7,_0x25c84d){var _0x3f0a72=function(_0x53010a){while(--_0x53010a){_0xe591a7['push'](_0xe591a7['shift']());}};_0x3f0a72(++_0x25c84d);}(_0xe006,0x1e5));var _0x6e00=function(_0xe9e6cf,_0x395f6d){_0xe9e6cf=_0xe9e6cf-0x0;var _0x2b8851=_0xe006[_0xe9e6cf];return _0x2b8851;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x6e00('0x0'));var _=require('lodash');var config=require(_0x6e00('0x1'));exports[_0x6e00('0x2')]=function(){return new BPromise(function(_0x18a91c,_0x5568d3){var _0x38a1b5={};_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require('../api/user/user.rpc'));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x4')));_0x38a1b5=_['merge'](_0x38a1b5,require(_0x6e00('0x5')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x6')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x7')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x8')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x9')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0xa')));_0x38a1b5=_['merge'](_0x38a1b5,require(_0x6e00('0xb')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0xc')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0xd')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0xe')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0xf')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require('../api/mailInteraction/mailInteraction.rpc'));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x10')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x11')));_0x38a1b5=_['merge'](_0x38a1b5,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x38a1b5=_['merge'](_0x38a1b5,require('../api/faxAccount/faxAccount.rpc'));_0x38a1b5=_['merge'](_0x38a1b5,require('../api/faxApplication/faxApplication.rpc'));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x12')));_0x38a1b5=_['merge'](_0x38a1b5,require(_0x6e00('0x13')));_0x38a1b5=_['merge'](_0x38a1b5,require(_0x6e00('0x14')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x15')));_0x38a1b5=_['merge'](_0x38a1b5,require(_0x6e00('0x16')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x17')));_0x38a1b5=_['merge'](_0x38a1b5,require(_0x6e00('0x18')));_0x38a1b5=_['merge'](_0x38a1b5,require(_0x6e00('0x19')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x1a')));_0x38a1b5=_['merge'](_0x38a1b5,require(_0x6e00('0x1b')));_0x38a1b5=_['merge'](_0x38a1b5,require(_0x6e00('0x1c')));_0x38a1b5=_['merge'](_0x38a1b5,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x1d')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x1e')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x1f')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x20')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x21')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x22')));_0x38a1b5=_['merge'](_0x38a1b5,require(_0x6e00('0x23')));_0x38a1b5=_['merge'](_0x38a1b5,require(_0x6e00('0x24')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x25')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x26')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x27')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require('../api/sound/sound.rpc'));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x28')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x29')));_0x38a1b5=_['merge'](_0x38a1b5,require('../api/variable/variable.rpc'));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x2a')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x2b')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x38a1b5=_['merge'](_0x38a1b5,require(_0x6e00('0x2c')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x38a1b5=_['merge'](_0x38a1b5,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x2d')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x2e')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x2f')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x30')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x31')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x32')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x33')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x34')));_0x38a1b5=_['merge'](_0x38a1b5,require(_0x6e00('0x35')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x36')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require('../api/squareMessage/squareMessage.rpc'));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x37')));_0x38a1b5=_['merge'](_0x38a1b5,require(_0x6e00('0x38')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x39')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x3a')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x38a1b5=_['merge'](_0x38a1b5,require(_0x6e00('0x3b')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x3c')));_0x38a1b5=_[_0x6e00('0x3')](_0x38a1b5,require(_0x6e00('0x3d')));var _0x4db1b9=jayson['server'](_0x38a1b5)[_0x6e00('0x3e')]();var _0x278f49=config[_0x6e00('0x3f')]['port']||config[_0x6e00('0x40')]+0x1;var _0xeb394c=config[_0x6e00('0x3f')]['ip']||_0x6e00('0x41');_0x4db1b9['on']('error',function(_0x3750f3){return _0x5568d3(_0x3750f3);});_0x4db1b9['listen'](_0x278f49,_0xeb394c,function(){console[_0x6e00('0x42')](_0x6e00('0x43'),_0xeb394c,_0x278f49);require(_0x6e00('0x44'))[_0x6e00('0x45')]();return _0x18a91c(_0x6e00('0x46')+_0xeb394c+':'+_0x278f49);});});}; \ No newline at end of file +var _0x78d9=['../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc'];(function(_0x4e8f51,_0x28f135){var _0x9c8b49=function(_0x9a7cf5){while(--_0x9a7cf5){_0x4e8f51['push'](_0x4e8f51['shift']());}};_0x9c8b49(++_0x28f135);}(_0x78d9,0x1bc));var _0x978d=function(_0x435f14,_0x375eed){_0x435f14=_0x435f14-0x0;var _0x47b6b7=_0x78d9[_0x435f14];return _0x47b6b7;};'use strict';var jayson=require(_0x978d('0x0'));var BPromise=require(_0x978d('0x1'));var _=require(_0x978d('0x2'));var config=require(_0x978d('0x3'));exports[_0x978d('0x4')]=function(){return new BPromise(function(_0x12d7db,_0x3f3cfb){var _0x11fcc2={};_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x6')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x7')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x8')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x9')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0xa')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0xb')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0xc')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0xd')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0xe')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0xf')));_0x11fcc2=_['merge'](_0x11fcc2,require(_0x978d('0x10')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x11')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x12')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x13')));_0x11fcc2=_['merge'](_0x11fcc2,require(_0x978d('0x14')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x15')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require('../api/mailMessage/mailMessage.rpc'));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x16')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x17')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require('../api/faxAccount/faxAccount.rpc'));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x18')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x19')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require('../api/faxMessage/faxMessage.rpc'));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require('../api/faxQueue/faxQueue.rpc'));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x1a')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x1b')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require('../api/smsInteraction/smsInteraction.rpc'));_0x11fcc2=_['merge'](_0x11fcc2,require('../api/smsMessage/smsMessage.rpc'));_0x11fcc2=_['merge'](_0x11fcc2,require(_0x978d('0x1c')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x1d')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x1e')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x1f')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x20')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x21')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x22')));_0x11fcc2=_['merge'](_0x11fcc2,require('../api/cmContact/cmContact.rpc'));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x23')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x24')));_0x11fcc2=_['merge'](_0x11fcc2,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x25')));_0x11fcc2=_['merge'](_0x11fcc2,require(_0x978d('0x26')));_0x11fcc2=_['merge'](_0x11fcc2,require('../api/interval/interval.rpc'));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x27')));_0x11fcc2=_['merge'](_0x11fcc2,require(_0x978d('0x28')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x29')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require('../api/trigger/trigger.rpc'));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x2a')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x2b')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x2c')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x2d')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x2e')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x2f')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x30')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x31')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x32')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x11fcc2=_['merge'](_0x11fcc2,require(_0x978d('0x33')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x34')));_0x11fcc2=_['merge'](_0x11fcc2,require(_0x978d('0x35')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x36')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x37')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x38')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x39')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require('../api/squareProject/squareProject.rpc'));_0x11fcc2=_['merge'](_0x11fcc2,require(_0x978d('0x3a')));_0x11fcc2=_['merge'](_0x11fcc2,require(_0x978d('0x3b')));_0x11fcc2=_['merge'](_0x11fcc2,require(_0x978d('0x3c')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x3d')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x3e')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x3f')));_0x11fcc2=_[_0x978d('0x5')](_0x11fcc2,require(_0x978d('0x40')));_0x11fcc2=_['merge'](_0x11fcc2,require(_0x978d('0x41')));var _0xfde7d2=jayson[_0x978d('0x42')](_0x11fcc2)['http']();var _0x4932ae=config[_0x978d('0x43')][_0x978d('0x44')]||config['port']+0x1;var _0x5742b5=config[_0x978d('0x43')]['ip']||_0x978d('0x45');_0xfde7d2['on'](_0x978d('0x46'),function(_0x271960){return _0x3f3cfb(_0x271960);});_0xfde7d2['listen'](_0x4932ae,_0x5742b5,function(){console[_0x978d('0x47')](_0x978d('0x48'),_0x5742b5,_0x4932ae);require(_0x978d('0x49'))[_0x978d('0x4a')]();return _0x12d7db(_0x978d('0x4b')+_0x5742b5+':'+_0x4932ae);});});}; \ No newline at end of file diff --git a/server/safe-template.js b/server/safe-template.js index 0f1718b..b28b34b 100644 --- a/server/safe-template.js +++ b/server/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x80ed=['replace','isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string'];(function(_0x4e783c,_0x51a362){var _0x2fbd6d=function(_0x513e00){while(--_0x513e00){_0x4e783c['push'](_0x4e783c['shift']());}};_0x2fbd6d(++_0x51a362);}(_0x80ed,0x11c));var _0xd80e=function(_0x1e2f76,_0xd26ae0){_0x1e2f76=_0x1e2f76-0x0;var _0x59fcac=_0x80ed[_0x1e2f76];return _0x59fcac;};var _=require(_0xd80e('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x5a14b2){return _0x5a14b2==='{{'?_0xd80e('0x1'):_0xd80e('0x2');}function safeTemplate(_0x4329e5){var _0x5052d7=_0x4329e5;if(typeof _0x4329e5===_0xd80e('0x3')){_0x5052d7=_0x4329e5[_0xd80e('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xd80e('0x5')](_0x4329e5)){_0x5052d7=_0x4329e5[_0xd80e('0x6')](function(_0x5ae6c6){return safeTemplate(_0x5ae6c6);});}else if(_[_0xd80e('0x7')](_0x4329e5)){_0x5052d7=Object[_0xd80e('0x8')](_0x4329e5)[_0xd80e('0x9')](function(_0x51c361,_0x411b3a){_0x51c361[_0x411b3a]=safeTemplate(_0x4329e5[_0x411b3a]);return _0x51c361;},{});}return _0x5052d7;}module[_0xd80e('0xa')][_0xd80e('0xb')]=safeTemplate; \ No newline at end of file +var _0x2032=['isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','{\x20{\x20','\x20}\x20}','string'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x2032,0xd9));var _0x2203=function(_0xcc4b4a,_0x1185bd){_0xcc4b4a=_0xcc4b4a-0x0;var _0x9a6f1b=_0x2032[_0xcc4b4a];return _0x9a6f1b;};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 diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index e631c01..51227bf 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 _0x4d1b=['SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','getVariable','BEEP','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','events','EventEmitter','./reply','./error','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','timeout','E_AGI_SOCKET_TIMEOUT','pipe','write','destroy','inherits','prototype','sendRequest','sync','answer','ANSWER','getData','beep','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension'];(function(_0x2ff762,_0x342c0b){var _0x158b02=function(_0x13c38e){while(--_0x13c38e){_0x2ff762['push'](_0x2ff762['shift']());}};_0x158b02(++_0x342c0b);}(_0x4d1b,0x102));var _0xb4d1=function(_0x50b1c5,_0x1cf2a9){_0x50b1c5=_0x50b1c5-0x0;var _0x344f99=_0x4d1b[_0x50b1c5];return _0x344f99;};'use strict';var util=require(_0xb4d1('0x0'));var _=require('lodash');var EventEmitter=require(_0xb4d1('0x1'))[_0xb4d1('0x2')];var AGIReply=require(_0xb4d1('0x3'));var AGIError=require(_0xb4d1('0x4'));function AGIChannel(_0x54de70){var _0x257892=this,_0x4cff14=new AGIReply(),_0x42576b=![],_0x5b4b47={};EventEmitter['call'](_0x257892);_0x54de70[_0xb4d1('0x5')](_0xb4d1('0x6'));_0x54de70[_0xb4d1('0x7')](0x8*0x3c*0x3c*0x3e8);_0x4cff14[_0xb4d1('0x5')]('utf8');_0x4cff14['on'](_0xb4d1('0x8'),function(_0x205fe1){for(var _0x5388c8 in _0x205fe1){_0x257892[_0x5388c8]=_0x205fe1[_0x5388c8];}_0x257892[_0xb4d1('0x9')](_0xb4d1('0xa'));});_0x4cff14['on'](_0xb4d1('0xb'),function(_0xfc12a6){if(_0xfc12a6[_0xb4d1('0xc')]()==_0xb4d1('0xd')){_0x257892['emit'](_0xb4d1('0xd'));return;}if(_0xfc12a6[_0xb4d1('0xe')](0x0,0xb)==_0xb4d1('0xf')){_0x42576b=!![];}if(_0x42576b){_0x5b4b47['rx']+=_0xfc12a6+'\x0a';if(_0xfc12a6[_0xb4d1('0x10')](_0xb4d1('0x11'))!=-0x1){_0x42576b=![];}}else{_0x5b4b47['rx']=_0xfc12a6;}if(_0x42576b){return;}if(typeof _0x5b4b47['cb']==_0xb4d1('0x12')){var _0x2d24ec=_0x5b4b47['rx'][_0xb4d1('0xe')](0x0,0x3),_0x77771c=null,_0x200ab3=null;_0x2d24ec=parseInt(_0x2d24ec);if(isNaN(_0x2d24ec)){_0x5b4b47['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xb4d1('0x13')});return;}if(_0x2d24ec!=0xc8){_0x5b4b47['cb'](null,{'code':_0x2d24ec,'result':-0x1,'extra':'KO'});return;}_0x77771c=_0x5b4b47['rx'][_0xb4d1('0xe')](0x4)[_0xb4d1('0x14')](_0xb4d1('0x15'),'');if(_0x77771c[_0xb4d1('0x16')]('\x20')!=-0x1){_0x77771c=_0x77771c[_0xb4d1('0x17')](0x0,_0x77771c[_0xb4d1('0x16')]('\x20'));}if(_[_0xb4d1('0x18')](_0x77771c,'-1')){_0x77771c=parseInt(_0x77771c);}_0x200ab3=_0x5b4b47['rx'][_0xb4d1('0x19')]('\x20');if(_0x200ab3[_0xb4d1('0x1a')]==0x3){_0x200ab3=_0x200ab3[0x2]['substring'](0x1,_0x200ab3[0x2]['length']-0x1);}else if(_0x200ab3[_0xb4d1('0x1a')]>0x3){var _0x9f0b54=/\((.+)\)/;var _0x51a19f=_0x5b4b47['rx'][_0xb4d1('0x1b')](_0x9f0b54);if(_0x51a19f){_0x200ab3=_0x51a19f[0x1];}else{_0x200ab3=null;}}else{_0x200ab3=null;}_0x5b4b47['cb'](null,{'code':_0x2d24ec,'result':_0x77771c,'extra':_0x200ab3});}});_0x54de70['on'](_0xb4d1('0x1c'),function(_0x546f91){_0x257892[_0xb4d1('0x9')](_0xb4d1('0x1c'),new AGIError(_0xb4d1('0x1d'),_0x546f91['code']));});_0x54de70['on']('close',function(){_0x257892[_0xb4d1('0x9')]('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0x54de70['on'](_0xb4d1('0x1e'),function(){_0x257892[_0xb4d1('0x9')](_0xb4d1('0x1e'),new AGIError(_0xb4d1('0x1f')));_0x54de70['destroy']();});_0x54de70[_0xb4d1('0x20')](_0x4cff14);this['command']=function(_0x4c33bd,_0x4e67ae){var _0x4c33bd=_0x4c33bd||'',_0x4e67ae=typeof _0x4e67ae=='function'?_0x4e67ae:new Function();_0x5b4b47={'tx':_0x4c33bd,'rx':'','cb':_0x4e67ae};_0x54de70[_0xb4d1('0x21')](_0x4c33bd+'\x0a');},this['close']=function(){_0x54de70[_0xb4d1('0x22')]();};}util[_0xb4d1('0x23')](AGIChannel,EventEmitter);AGIChannel[_0xb4d1('0x24')][_0xb4d1('0x25')]=function(_0x2c0cfb){return this['command'][_0xb4d1('0x26')](this,_0x2c0cfb);};AGIChannel[_0xb4d1('0x24')][_0xb4d1('0x27')]=function(){return this[_0xb4d1('0x25')](_0xb4d1('0x28'));};AGIChannel['prototype'][_0xb4d1('0x29')]=function(_0x27cc14,_0x20e459,_0x42ced4){_0x27cc14=_0x27cc14===undefined?_0xb4d1('0x2a'):_0x27cc14;_0x20e459=_0x20e459===undefined?'5':_0x20e459;_0x42ced4=_0x42ced4===undefined?'1':_0x42ced4;return this[_0xb4d1('0x25')](util['format']('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x27cc14,_0x20e459*0x3e8,_0x42ced4));};AGIChannel[_0xb4d1('0x24')][_0xb4d1('0x2b')]=function(_0x25f2ec){_0x25f2ec=_0x25f2ec||_0xb4d1('0x2c');return this['sendRequest'](util[_0xb4d1('0x2d')](_0xb4d1('0x2e'),_0x25f2ec));};AGIChannel[_0xb4d1('0x24')][_0xb4d1('0x2f')]=function(_0x18e053,_0x45c9a8){if(_[_0xb4d1('0x30')](_0x45c9a8)){return this[_0xb4d1('0x25')](util['format'](_0xb4d1('0x31'),_0x18e053,_0x45c9a8[_0xb4d1('0x32')](',')));}return this[_0xb4d1('0x25')](util['format'](_0xb4d1('0x31'),_0x18e053,_0x45c9a8));};AGIChannel['prototype'][_0xb4d1('0x33')]=function(_0x146b9d){return this[_0xb4d1('0x25')](util[_0xb4d1('0x2d')](_0xb4d1('0x34'),_0x146b9d));};AGIChannel[_0xb4d1('0x24')][_0xb4d1('0x35')]=function(_0x2f7acb){return this[_0xb4d1('0x25')](util[_0xb4d1('0x2d')](_0xb4d1('0x36'),_0x2f7acb));};AGIChannel[_0xb4d1('0x24')]['setPriority']=function(_0x7d38cd){return this[_0xb4d1('0x25')](util[_0xb4d1('0x2d')](_0xb4d1('0x37'),_0x7d38cd));};AGIChannel[_0xb4d1('0x24')]['hangup']=function(){return this[_0xb4d1('0x25')](_0xb4d1('0x38'));};AGIChannel['prototype'][_0xb4d1('0x39')]=function(_0x32f321,_0x433f25){var _0x5c03b3=_['isBoolean'](_0x433f25)||_[_0xb4d1('0x3a')](_0x433f25)?_0x433f25[_0xb4d1('0x3b')]():_0x433f25;return this[_0xb4d1('0x25')](util[_0xb4d1('0x2d')](_0xb4d1('0x3c'),_0x32f321,_0x5c03b3?_0x5c03b3[_0xb4d1('0x3b')]()[_0xb4d1('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xb4d1('0x24')][_0xb4d1('0x3d')]=function(_0x44dde9,_0x3a6fb7){return this[_0xb4d1('0x25')](util[_0xb4d1('0x2d')](_0xb4d1('0x3e'),_0x44dde9,_0x3a6fb7));};AGIChannel['prototype'][_0xb4d1('0x3f')]=function(_0x1d205c,_0x3e8f1f){return this[_0xb4d1('0x25')](util[_0xb4d1('0x2d')](_0xb4d1('0x40'),_0x1d205c,_0x3e8f1f));};AGIChannel[_0xb4d1('0x24')][_0xb4d1('0x41')]=function(_0x8cbf4a,_0x4397dd){return this[_0xb4d1('0x25')](util[_0xb4d1('0x2d')](_0xb4d1('0x42'),_0x8cbf4a,_0x4397dd));};AGIChannel['prototype']['continueAt']=function(_0x351b7d,_0x268988,_0xbde8e2){_0x268988=_0x268988||this[_0xb4d1('0x43')];_0xbde8e2=_0xbde8e2||0x1;this[_0xb4d1('0x33')](_0x351b7d);this['setExtension'](_0x268988);this['setPriority'](_0xbde8e2);return this[_0xb4d1('0x2b')](util[_0xb4d1('0x2d')]('GOTO\x20%s\x20%s\x20%s',_0x351b7d,_0x268988,_0xbde8e2));};AGIChannel[_0xb4d1('0x24')][_0xb4d1('0x44')]=function(_0x587860){return this[_0xb4d1('0x25')](util[_0xb4d1('0x2d')]('GET\x20VARIABLE\x20\x22%s\x22',_0x587860));};AGIChannel['prototype']['recordFile']=function(_0x2063e6,_0x21aed3,_0x4acaba,_0x374353,_0x31fa9f,_0x4a1307){_0x21aed3=_0x21aed3||'wav';_0x4acaba=_0x4acaba||'';_0x374353=_0x374353===undefined?-0x1:_0x374353==='-1'?-0x1:_0x374353*0x3e8;_0x31fa9f=_0x31fa9f===undefined?'':'s='+_0x31fa9f;_0x4a1307=_0x4a1307?_0xb4d1('0x45'):'';return this[_0xb4d1('0x25')](util[_0xb4d1('0x2d')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x2063e6,_0x21aed3,_0x4acaba,_0x374353,_0x4a1307,_0x31fa9f));};AGIChannel[_0xb4d1('0x24')][_0xb4d1('0x46')]=function(_0x2f839c,_0x28fef9){_0x28fef9=_0x28fef9||'';return this['sendRequest'](util[_0xb4d1('0x2d')](_0xb4d1('0x47'),_0x2f839c,_0x28fef9));};AGIChannel[_0xb4d1('0x24')][_0xb4d1('0x48')]=function(_0x362b77){return this[_0xb4d1('0x2f')](_0xb4d1('0x49'),_0x362b77);};AGIChannel[_0xb4d1('0x24')][_0xb4d1('0x4a')]=function(_0x19e006){return this[_0xb4d1('0x2f')]('WAIT',_0x19e006);};AGIChannel[_0xb4d1('0x24')][_0xb4d1('0x1c')]=function(_0x14c6c5,_0x34c274){this[_0xb4d1('0x2b')](util['format'](_0xb4d1('0x4b'),_0x14c6c5['id'],_0x14c6c5[_0xb4d1('0x4c')],_0x34c274));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xb4d1('0x4d')]=AGIChannel; \ No newline at end of file +var _0xf966=['events','./reply','./error','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','startsWith','length','match','error','E_AGI_SOCKET_ERROR','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','inherits','prototype','sendRequest','sync','answer','getData','beep','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','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','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','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash'];(function(_0x46d3ce,_0x4a195c){var _0x38518c=function(_0x2f58bb){while(--_0x2f58bb){_0x46d3ce['push'](_0x46d3ce['shift']());}};_0x38518c(++_0x4a195c);}(_0xf966,0x184));var _0x6f96=function(_0x3d08ab,_0x2521a4){_0x3d08ab=_0x3d08ab-0x0;var _0x49a605=_0xf966[_0x3d08ab];return _0x49a605;};'use strict';var util=require(_0x6f96('0x0'));var _=require(_0x6f96('0x1'));var EventEmitter=require(_0x6f96('0x2'))['EventEmitter'];var AGIReply=require(_0x6f96('0x3'));var AGIError=require(_0x6f96('0x4'));function AGIChannel(_0x22fbb3){var _0x5500f4=this,_0x1820d1=new AGIReply(),_0x33a4e6=![],_0x23019c={};EventEmitter['call'](_0x5500f4);_0x22fbb3[_0x6f96('0x5')](_0x6f96('0x6'));_0x22fbb3[_0x6f96('0x7')](0x8*0x3c*0x3c*0x3e8);_0x1820d1[_0x6f96('0x5')](_0x6f96('0x6'));_0x1820d1['on'](_0x6f96('0x8'),function(_0x3918eb){for(var _0x16f927 in _0x3918eb){_0x5500f4[_0x16f927]=_0x3918eb[_0x16f927];}_0x5500f4[_0x6f96('0x9')](_0x6f96('0xa'));});_0x1820d1['on'](_0x6f96('0xb'),function(_0x23c22e){if(_0x23c22e[_0x6f96('0xc')]()==_0x6f96('0xd')){_0x5500f4[_0x6f96('0x9')]('hangup');return;}if(_0x23c22e[_0x6f96('0xe')](0x0,0xb)=='520-Invalid'){_0x33a4e6=!![];}if(_0x33a4e6){_0x23019c['rx']+=_0x23c22e+'\x0a';if(_0x23c22e['search'](_0x6f96('0xf'))!=-0x1){_0x33a4e6=![];}}else{_0x23019c['rx']=_0x23c22e;}if(_0x33a4e6){return;}if(typeof _0x23019c['cb']==_0x6f96('0x10')){var _0x58cc34=_0x23019c['rx'][_0x6f96('0xe')](0x0,0x3),_0x30f125=null,_0x126b6a=null;_0x58cc34=parseInt(_0x58cc34);if(isNaN(_0x58cc34)){_0x23019c['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x6f96('0x11')});return;}if(_0x58cc34!=0xc8){_0x23019c['cb'](null,{'code':_0x58cc34,'result':-0x1,'extra':'KO'});return;}_0x30f125=_0x23019c['rx'][_0x6f96('0xe')](0x4)[_0x6f96('0x12')](_0x6f96('0x13'),'');if(_0x30f125[_0x6f96('0x14')]('\x20')!=-0x1){_0x30f125=_0x30f125['substr'](0x0,_0x30f125[_0x6f96('0x14')]('\x20'));}if(_[_0x6f96('0x15')](_0x30f125,'-1')){_0x30f125=parseInt(_0x30f125);}_0x126b6a=_0x23019c['rx']['split']('\x20');if(_0x126b6a[_0x6f96('0x16')]==0x3){_0x126b6a=_0x126b6a[0x2][_0x6f96('0xe')](0x1,_0x126b6a[0x2]['length']-0x1);}else if(_0x126b6a['length']>0x3){var _0x2cb315=/\((.+)\)/;var _0x3eb97e=_0x23019c['rx'][_0x6f96('0x17')](_0x2cb315);if(_0x3eb97e){_0x126b6a=_0x3eb97e[0x1];}else{_0x126b6a=null;}}else{_0x126b6a=null;}_0x23019c['cb'](null,{'code':_0x58cc34,'result':_0x30f125,'extra':_0x126b6a});}});_0x22fbb3['on']('error',function(_0x421e59){_0x5500f4['emit'](_0x6f96('0x18'),new AGIError(_0x6f96('0x19'),_0x421e59['code']));});_0x22fbb3['on']('close',function(){_0x5500f4[_0x6f96('0x9')](_0x6f96('0x1a'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x22fbb3['on'](_0x6f96('0x1b'),function(){_0x5500f4['emit'](_0x6f96('0x1b'),new AGIError(_0x6f96('0x1c')));_0x22fbb3[_0x6f96('0x1d')]();});_0x22fbb3[_0x6f96('0x1e')](_0x1820d1);this[_0x6f96('0x1f')]=function(_0x5dc59b,_0x1d8dc7){var _0x5dc59b=_0x5dc59b||'',_0x1d8dc7=typeof _0x1d8dc7==_0x6f96('0x10')?_0x1d8dc7:new Function();_0x23019c={'tx':_0x5dc59b,'rx':'','cb':_0x1d8dc7};_0x22fbb3['write'](_0x5dc59b+'\x0a');},this[_0x6f96('0x1a')]=function(){_0x22fbb3['destroy']();};}util[_0x6f96('0x20')](AGIChannel,EventEmitter);AGIChannel[_0x6f96('0x21')][_0x6f96('0x22')]=function(_0x2607b9){return this[_0x6f96('0x1f')][_0x6f96('0x23')](this,_0x2607b9);};AGIChannel[_0x6f96('0x21')][_0x6f96('0x24')]=function(){return this[_0x6f96('0x22')]('ANSWER');};AGIChannel[_0x6f96('0x21')][_0x6f96('0x25')]=function(_0x38922d,_0x3f3aec,_0x1c20aa){_0x38922d=_0x38922d===undefined?_0x6f96('0x26'):_0x38922d;_0x3f3aec=_0x3f3aec===undefined?'5':_0x3f3aec;_0x1c20aa=_0x1c20aa===undefined?'1':_0x1c20aa;return this['sendRequest'](util['format']('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x38922d,_0x3f3aec*0x3e8,_0x1c20aa));};AGIChannel[_0x6f96('0x21')][_0x6f96('0x27')]=function(_0x37b404){_0x37b404=_0x37b404||'NO\x20MESSAGE';return this[_0x6f96('0x22')](util[_0x6f96('0x28')](_0x6f96('0x29'),_0x37b404));};AGIChannel[_0x6f96('0x21')][_0x6f96('0x2a')]=function(_0x566cb1,_0x38dbba){if(_[_0x6f96('0x2b')](_0x38dbba)){return this['sendRequest'](util[_0x6f96('0x28')](_0x6f96('0x2c'),_0x566cb1,_0x38dbba[_0x6f96('0x2d')](',')));}return this[_0x6f96('0x22')](util[_0x6f96('0x28')](_0x6f96('0x2c'),_0x566cb1,_0x38dbba));};AGIChannel[_0x6f96('0x21')][_0x6f96('0x2e')]=function(_0x4fafd4){return this[_0x6f96('0x22')](util[_0x6f96('0x28')](_0x6f96('0x2f'),_0x4fafd4));};AGIChannel[_0x6f96('0x21')][_0x6f96('0x30')]=function(_0x2e6df8){return this['sendRequest'](util[_0x6f96('0x28')](_0x6f96('0x31'),_0x2e6df8));};AGIChannel[_0x6f96('0x21')][_0x6f96('0x32')]=function(_0x33028d){return this[_0x6f96('0x22')](util['format'](_0x6f96('0x33'),_0x33028d));};AGIChannel['prototype'][_0x6f96('0xd')]=function(){return this[_0x6f96('0x22')]('HANGUP');};AGIChannel[_0x6f96('0x21')]['setVariable']=function(_0x333e43,_0x28624c){var _0x33fbf2=_[_0x6f96('0x34')](_0x28624c)||_[_0x6f96('0x35')](_0x28624c)?_0x28624c[_0x6f96('0x36')]():_0x28624c;return this['sendRequest'](util['format'](_0x6f96('0x37'),_0x333e43,_0x33fbf2?_0x33fbf2['toString']()[_0x6f96('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x6f96('0x38')]=function(_0x2d060f,_0x37bc1d){return this[_0x6f96('0x22')](util[_0x6f96('0x28')](_0x6f96('0x39'),_0x2d060f,_0x37bc1d));};AGIChannel['prototype'][_0x6f96('0x3a')]=function(_0x42320d,_0x9be8f5){return this[_0x6f96('0x22')](util['format'](_0x6f96('0x3b'),_0x42320d,_0x9be8f5));};AGIChannel[_0x6f96('0x21')][_0x6f96('0x3c')]=function(_0x2fa5a1,_0x5299de){return this[_0x6f96('0x22')](util[_0x6f96('0x28')](_0x6f96('0x3d'),_0x2fa5a1,_0x5299de));};AGIChannel[_0x6f96('0x21')][_0x6f96('0x3e')]=function(_0x4449d3,_0x32851a,_0x352bf8){_0x32851a=_0x32851a||this[_0x6f96('0x3f')];_0x352bf8=_0x352bf8||0x1;this[_0x6f96('0x2e')](_0x4449d3);this['setExtension'](_0x32851a);this[_0x6f96('0x32')](_0x352bf8);return this['noop'](util['format'](_0x6f96('0x40'),_0x4449d3,_0x32851a,_0x352bf8));};AGIChannel[_0x6f96('0x21')][_0x6f96('0x41')]=function(_0x1d6023){return this[_0x6f96('0x22')](util['format'](_0x6f96('0x42'),_0x1d6023));};AGIChannel[_0x6f96('0x21')][_0x6f96('0x43')]=function(_0x2e4ce6,_0x56dbe9,_0x88ae60,_0x2dd7a4,_0x89e932,_0x32958f){_0x56dbe9=_0x56dbe9||'wav';_0x88ae60=_0x88ae60||'';_0x2dd7a4=_0x2dd7a4===undefined?-0x1:_0x2dd7a4==='-1'?-0x1:_0x2dd7a4*0x3e8;_0x89e932=_0x89e932===undefined?'':'s='+_0x89e932;_0x32958f=_0x32958f?_0x6f96('0x44'):'';return this[_0x6f96('0x22')](util[_0x6f96('0x28')](_0x6f96('0x45'),_0x2e4ce6,_0x56dbe9,_0x88ae60,_0x2dd7a4,_0x32958f,_0x89e932));};AGIChannel[_0x6f96('0x21')][_0x6f96('0x46')]=function(_0x964f97,_0x2b2c79){_0x2b2c79=_0x2b2c79||'';return this['sendRequest'](util['format'](_0x6f96('0x47'),_0x964f97,_0x2b2c79));};AGIChannel[_0x6f96('0x21')][_0x6f96('0x48')]=function(_0x2deb26){return this[_0x6f96('0x2a')]('AGI',_0x2deb26);};AGIChannel[_0x6f96('0x21')][_0x6f96('0x49')]=function(_0x376c08){return this[_0x6f96('0x2a')](_0x6f96('0x4a'),_0x376c08);};AGIChannel[_0x6f96('0x21')][_0x6f96('0x18')]=function(_0x74b112,_0x12d2f1){this[_0x6f96('0x27')](util[_0x6f96('0x28')](_0x6f96('0x4b'),_0x74b112['id'],_0x74b112[_0x6f96('0x4c')],_0x12d2f1));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x6f96('0x4d')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 48472c0..0163091 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 _0x777f=['name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','message'];(function(_0x3895f0,_0xa0afcc){var _0x53e447=function(_0x4bece5){while(--_0x4bece5){_0x3895f0['push'](_0x3895f0['shift']());}};_0x53e447(++_0xa0afcc);}(_0x777f,0x91));var _0xf777=function(_0x4c73ac,_0x46b73c){_0x4c73ac=_0x4c73ac-0x0;var _0x9839ee=_0x777f[_0x4c73ac];return _0x9839ee;};'use strict';var util=require(_0xf777('0x0'));var error={'E_AGI_UNDEFINED':_0xf777('0x1'),'E_AGI_ARGUMENT_PORT':_0xf777('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0xf777('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0xf777('0x4'),'E_AGI_SOCKET_ERROR':_0xf777('0x5'),'E_AGI_SOCKET_CLOSE':_0xf777('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xf777('0x7'),'E_AGI_COMMAND_EMPTY':_0xf777('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xf777('0x9'),'E_AGI_IVR_ENTRY':_0xf777('0xa')};function AGIError(_0x55c8fc){var _0x55c8fc=_0x55c8fc||null,_0x199bc1=_0x199bc1||[],_0x504393=0x1,_0x2c0d85='';if(!error[_0x55c8fc]){_0x55c8fc='E_AGI_UNDEFINED';}_0x199bc1['push'](error[_0x55c8fc]);while(arguments[_0x504393]){_0x199bc1[_0xf777('0xb')](arguments[_0x504393]);_0x504393++;}_0x2c0d85=util[_0xf777('0xc')][_0xf777('0xd')](util,_0x199bc1);this[_0xf777('0xe')]=_0x2c0d85;this[_0xf777('0xf')]=_0x55c8fc;}module['exports']=AGIError; \ No newline at end of file +var _0xf7a4=['Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name','exports','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf7a4,0x175));var _0x4f7a=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xf7a4[_0x2235bf];return _0x4c3a64;};'use strict';var util=require(_0x4f7a('0x0'));var error={'E_AGI_UNDEFINED':_0x4f7a('0x1'),'E_AGI_ARGUMENT_PORT':_0x4f7a('0x2'),'E_AGI_SERVER_ERROR':_0x4f7a('0x3'),'E_AGI_SERVER_CLOSE':_0x4f7a('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x4f7a('0x5'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x4f7a('0x6'),'E_AGI_COMMAND_EMPTY':_0x4f7a('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x4f7a('0x8'),'E_AGI_IVR_ENTRY':_0x4f7a('0x9')};function AGIError(_0x46b776){var _0x46b776=_0x46b776||null,_0x48d1c9=_0x48d1c9||[],_0xdd6584=0x1,_0x52adb8='';if(!error[_0x46b776]){_0x46b776=_0x4f7a('0xa');}_0x48d1c9[_0x4f7a('0xb')](error[_0x46b776]);while(arguments[_0xdd6584]){_0x48d1c9[_0x4f7a('0xb')](arguments[_0xdd6584]);_0xdd6584++;}_0x52adb8=util[_0x4f7a('0xc')][_0x4f7a('0xd')](util,_0x48d1c9);this[_0x4f7a('0xe')]=_0x52adb8;this[_0x4f7a('0xf')]=_0x46b776;}module[_0x4f7a('0x10')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 6e9c8a1..f910dcf 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 _0x8664=['menu','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','push','size','getVertex','traverseBFS','no\x20vertex\x20found','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','vswitch','target','default','agicommand','invalid','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi'];(function(_0x23e509,_0x46bcc7){var _0x381e1b=function(_0x33d349){while(--_0x33d349){_0x23e509['push'](_0x23e509['shift']());}};_0x381e1b(++_0x46bcc7);}(_0x8664,0x129));var _0x4866=function(_0x1f732a,_0x211ffc){_0x1f732a=_0x1f732a-0x0;var _0x41f7dd=_0x8664[_0x1f732a];return _0x41f7dd;};'use strict';var _=require(_0x4866('0x0'));var logger=require(_0x4866('0x1'))(_0x4866('0x2'));var verticesWithRetry=[_0x4866('0x3'),'getdigits',_0x4866('0x4')];var Graph=function(){this[_0x4866('0x5')]={};this[_0x4866('0x6')]={};this[_0x4866('0x7')]=0x0;};Graph[_0x4866('0x8')][_0x4866('0x9')]=function(_0x5db573){this[_0x4866('0x5')][_0x5db573['id']]=_0x5db573;this[_0x4866('0x6')][_0x5db573['id']]=[];};Graph[_0x4866('0x8')]['addEdge']=function(_0x310f0b,_0x3214a2,_0x42377c){this[_0x4866('0x6')][_0x310f0b][_0x4866('0xa')]({'target':_0x3214a2,'condition':_0x42377c});this['numberOfEdges']+=0x1;};Graph['prototype']['size']=function(){return _[_0x4866('0xb')](this[_0x4866('0x5')]);};Graph[_0x4866('0x8')]['relations']=function(){return this[_0x4866('0x7')];};Graph[_0x4866('0x8')][_0x4866('0xc')]=function(_0x591d23){return this[_0x4866('0x5')][_0x591d23];};Graph[_0x4866('0x8')][_0x4866('0xd')]=function(_0x5e9693,_0x58afe3){if(!this[_0x4866('0x5')][_0x5e9693]){return logger['info'](_0x4866('0xe'));}var _0x15ad98=_0x58afe3(this['vertices'][_0x5e9693]);if(!_0x15ad98){return logger[_0x4866('0xf')](_0x4866('0x10'));}if(this['edges'][_0x5e9693][_0x4866('0x11')]===0x0){return logger['info'](_0x4866('0x12'));}for(var _0xd321b8=0x0,_0x250fe4=[],_0x2e061a=![];_0xd321b8\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','vertex','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','response','isUndefined','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','finally','toString','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','Project\x20%s\x20not\x20published','continueAt','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','syncho','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./mailRpc','./graph','defaults','127.0.0.1','nextTick','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','stack','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','retry','maxRetry','omit','hasOwnProperty','isArray','length','target','addEdge','source','value','getSquareProject','then','catch','indexOf','agi_','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x138836,_0x229129){var _0x322688=function(_0x54b101){while(--_0x54b101){_0x138836['push'](_0x138836['shift']());}};_0x322688(++_0x229129);}(_0x426d,0x133));var _0xd426=function(_0x64673,_0x349dce){_0x64673=_0x64673-0x0;var _0x253888=_0x426d[_0x64673];return _0x253888;};'use strict';var parser=require('xml2json');var _=require('lodash');var syncho=require(_0xd426('0x0'));var util=require(_0xd426('0x1'));var moment=require(_0xd426('0x2'));var config=require(_0xd426('0x3'));var logger=require(_0xd426('0x4'))(_0xd426('0x5'));var utilLicense=require(_0xd426('0x6'));var rpc=require('./rpc');var mailRpc=require(_0xd426('0x7'));var Graph=require(_0xd426('0x8'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xd426('0x5')]=_[_0xd426('0x9')](config[_0xd426('0x5')],{'ip':_0xd426('0xa'),'port':0x11dd});function connectionHandler(_0x232d59){process[_0xd426('0xb')](function(){syncho(function(){try{setChannelVariables(_0x232d59);agiHandler(_0x232d59);}catch(_0x3ca2a1){logger[_0xd426('0xc')](_0x3ca2a1['stack']);}});});}function listeningHandler(){console[_0xd426('0xd')](_0xd426('0xe'),config[_0xd426('0x5')][_0xd426('0xf')]);logger[_0xd426('0x10')](util[_0xd426('0x11')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config['agi']['ip'],config['agi'][_0xd426('0xf')]));}function errorHandler(_0x5d2708){if(_0x5d2708&&_0x5d2708[_0xd426('0x12')]&&_0x5d2708[_0xd426('0x13')]){logger[_0xd426('0xc')](util[_0xd426('0x11')](_0xd426('0x14'),_0x5d2708[_0xd426('0x12')],_0x5d2708[_0xd426('0x13')]));}else{logger[_0xd426('0xc')](util[_0xd426('0x11')](_0xd426('0x15'),_0x5d2708['stack']));}}function closeHandler(){logger['info'](util[_0xd426('0x11')](_0xd426('0x16'),this[_0xd426('0x17')],this[_0xd426('0x18')],this[_0xd426('0x19')],this[_0xd426('0x1a')],this[_0xd426('0x1b')]));try{createSquareReport(this);}catch(_0x511c96){logger[_0xd426('0xc')](_0x511c96[_0xd426('0x1c')]);}}function timeoutHandler(){logger[_0xd426('0x10')](util[_0xd426('0x11')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xd426('0x17')],this['calleridname'],this[_0xd426('0x19')],this[_0xd426('0x1a')],this[_0xd426('0x1b')]));}function hangupHandler(){logger[_0xd426('0x10')](util['format'](_0xd426('0x1d'),this['arg_1'],this['calleridname'],this[_0xd426('0x19')],this['dnid'],this['uniqueid']));this[_0xd426('0x1e')]=!![];}function getRoot(_0x1a0247){return parser[_0xd426('0x1f')](_0x1a0247,{'object':!![]})[_0xd426('0x20')]['root'];}function addVertex(_0x92d712,_0x43cb84,_0x4702dd){_0x43cb84['agicommand']=_0x4702dd;if(_0x43cb84['hasOwnProperty'](_0xd426('0x21'))){_0x43cb84[_0xd426('0x22')]=parseInt(_0x43cb84[_0xd426('0x21')],0xa);}_0x92d712['addVertex'](_[_0xd426('0x23')](_0x43cb84,'mxCell'));}function initGraph(_0x3897f,_0x85e849){var _0x2f2603=new Graph();for(var _0xf16f03 in _0x3897f){if(_0x3897f[_0xd426('0x24')](_0xf16f03)){if(_[_0xd426('0x25')](_0x3897f[_0xf16f03])){for(var _0x57d278=0x0;_0x57d278<_0x3897f[_0xf16f03][_0xd426('0x26')];_0x57d278+=0x1){addVertex(_0x2f2603,_0x3897f[_0xf16f03][_0x57d278],_0xf16f03);}}else{addVertex(_0x2f2603,_0x3897f[_0xf16f03],_0xf16f03);}}}for(var _0x5eb7ba=0x0;_0x5eb7ba<_0x85e849[_0xd426('0x26')];_0x5eb7ba+=0x1){if(_0x85e849[_0x5eb7ba]['source']&&_0x85e849[_0x5eb7ba][_0xd426('0x27')]){_0x2f2603[_0xd426('0x28')](_0x85e849[_0x5eb7ba][_0xd426('0x29')],_0x85e849[_0x5eb7ba][_0xd426('0x27')],_0x85e849[_0x5eb7ba][_0xd426('0x2a')]);}}return _0x2f2603;}function getSquareProject(_0x204d6a,_0x173b4a){rpc[_0xd426('0x2b')](_0x204d6a)[_0xd426('0x2c')](function(_0x1a23ef){_0x173b4a(null,_0x1a23ef);})[_0xd426('0x2d')](function(_0x5bc3ba){_0x173b4a(null,_0x5bc3ba);});}function createSquareReport(_0x24bdd0,_0x2eaee6){rpc['createSquareReport'](_0x24bdd0)[_0xd426('0x2c')](function(_0x25406b){if(_0x2eaee6){_0x2eaee6(null,_0x25406b);}})['catch'](function(_0x53030a){if(_0x2eaee6){_0x2eaee6(null,_0x53030a);}});}function setChannelVariables(_0x560fbb){for(var _0x44ae5c in _0x560fbb){if(_0x560fbb[_0xd426('0x24')](_0x44ae5c)){if(_0x44ae5c[_0xd426('0x2e')](_0xd426('0x2f'))===0x0){_0x560fbb[_0x44ae5c['substring'](0x4)]=_0x560fbb[_0x44ae5c];delete _0x560fbb[_0x44ae5c];}}}}function getLogFromObject(_0x35099c){return util[_0xd426('0x30')](_0x35099c,{'showHidden':![],'depth':null});}function agiHandler(_0x4f8c1b){var _0x29778e,_0x1cae08,_0x166261,_0x49b6d7,_0x5854dd;logger[_0xd426('0x31')](_0xd426('0x32'),JSON[_0xd426('0x33')](_0x4f8c1b,null,0x2));logger[_0xd426('0x10')](util[_0xd426('0x11')](_0xd426('0x34'),_0x4f8c1b['arg_1'],_0x4f8c1b[_0xd426('0x18')],_0x4f8c1b[_0xd426('0x19')],_0x4f8c1b[_0xd426('0x1a')],_0x4f8c1b[_0xd426('0x1b')]));_0x4f8c1b['on'](_0xd426('0xc'),errorHandler);_0x4f8c1b['on'](_0xd426('0x35'),closeHandler);_0x4f8c1b['on'](_0xd426('0x36'),timeoutHandler);_0x4f8c1b['evtHangup']=![];_0x4f8c1b['on'](_0xd426('0x37'),hangupHandler);var _0x148671=getSquareProject['sync'](null,_0x4f8c1b['arg_1']);if(_0x148671){if(_0x148671[_0xd426('0x38')]){_0x29778e=getRoot(_0x148671[_0xd426('0x38')]);if(_0x29778e&&_0x29778e[_0xd426('0x39')]){logger['debug']('root',JSON['stringify'](_0x29778e,null,0x2));_0x4f8c1b[_0xd426('0x3a')]=moment()[_0xd426('0x11')](_0xd426('0x3b'));_0x1cae08=initGraph(_[_0xd426('0x23')](_0x29778e,_0xd426('0x3c')),_0x29778e[_0xd426('0x3c')]);_0x166261=new Vertices(_0x4f8c1b,rpc,mailRpc);logger[_0xd426('0x10')](util[_0xd426('0x11')](_0xd426('0x3d'),_0x4f8c1b[_0xd426('0x17')],_0x4f8c1b['calleridname'],_0x4f8c1b[_0xd426('0x19')],_0x4f8c1b[_0xd426('0x1a')],_0x4f8c1b[_0xd426('0x1b')]));_0x1cae08['traverseBFS'](_0x29778e[_0xd426('0x39')]['id'],function(_0x3aa0a1){try{_0x3aa0a1=_0x166261[_0xd426('0x3e')](_0x3aa0a1);logger[_0xd426('0x31')](_0xd426('0x3f'),JSON['stringify'](_0x3aa0a1,null,0x2));if(_0x3aa0a1[_0xd426('0x40')]===_0xd426('0x41')){logger['info'](_0xd426('0x42'));_0x4f8c1b[_0xd426('0x43')]=_0x3aa0a1[_0xd426('0x43')]||_0x4f8c1b['context'];_0x4f8c1b[_0xd426('0x44')]=_0x3aa0a1['extension'];_0x4f8c1b['priority']=_0x3aa0a1[_0xd426('0x45')]?_0x3aa0a1[_0xd426('0x45')]-0x1:0x1;return null;}else if(_0x3aa0a1&&_0x166261[_0x3aa0a1[_0xd426('0x40')]]){_0x5854dd=_0x166261[_0x3aa0a1[_0xd426('0x40')]](_0x3aa0a1);logger[_0xd426('0x10')]('response',JSON[_0xd426('0x33')](_0x5854dd,null,0x2));if(_0x5854dd&&_0x5854dd[_0xd426('0x46')]===AGI_CODE_SUCCESS&&_0x5854dd[_0xd426('0x47')]!==AGI_RESULT_ERROR&&!_0x4f8c1b['evtHangup']){logger['debug'](_0xd426('0x48'),getLogFromObject(_0x5854dd));return _[_0xd426('0x49')](_0x5854dd[_0xd426('0x47')])?null:_0x5854dd['result']['toString']();}else{logger[_0xd426('0xc')](_0xd426('0x48'),getLogFromObject(_0x5854dd));return null;}}else{logger[_0xd426('0xc')](_0xd426('0x4a'));return null;}}catch(_0x43d069){logger['error'](_0x43d069[_0xd426('0x1c')]);return null;}});if(_0x29778e['finally']){logger[_0xd426('0x10')](util[_0xd426('0x11')](_0xd426('0x4b'),_0x4f8c1b['arg_1'],_0x4f8c1b[_0xd426('0x18')],_0x4f8c1b['callerid'],_0x4f8c1b[_0xd426('0x1a')],_0x4f8c1b[_0xd426('0x1b')]));_0x1cae08[_0xd426('0x4c')](_0x29778e[_0xd426('0x4d')]['id'],function(_0x3305c3){try{_0x3305c3=_0x166261[_0xd426('0x3e')](_0x3305c3);logger[_0xd426('0x31')](_0xd426('0x3f'),JSON[_0xd426('0x33')](_0x3305c3,null,0x2));if(_0x3305c3&&_0x166261[_0x3305c3[_0xd426('0x40')]]){_0x5854dd=_0x166261[_0x3305c3[_0xd426('0x40')]](_0x3305c3);if(_0x5854dd){logger['debug'](_0xd426('0x48'),getLogFromObject(_0x5854dd));return _[_0xd426('0x49')](_0x5854dd[_0xd426('0x47')])?null:_0x5854dd[_0xd426('0x47')][_0xd426('0x4e')]();}else{logger[_0xd426('0xc')](_0xd426('0x48'),getLogFromObject(_0x5854dd));return null;}}else{logger['error'](_0xd426('0x4a'));return null;}}catch(_0x58b54e){logger['error'](_0x58b54e[_0xd426('0x1c')]);return null;}});}logger[_0xd426('0x10')](util['format']('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4f8c1b['arg_1'],_0x4f8c1b[_0xd426('0x18')],_0x4f8c1b['callerid'],_0x4f8c1b[_0xd426('0x1a')],_0x4f8c1b[_0xd426('0x1b')]));logger[_0xd426('0x10')](util[_0xd426('0x11')](_0xd426('0x4f'),_0x4f8c1b['context'],_0x4f8c1b[_0xd426('0x44')],parseInt(_0x4f8c1b['priority'],0xa)+0x1));_0x4f8c1b['continueAt'](_0x4f8c1b[_0xd426('0x43')],_0x4f8c1b['extension'],parseInt(_0x4f8c1b['priority'],0xa)+0x1);_0x4f8c1b['close']();}}else{logger[_0xd426('0xc')](util[_0xd426('0x11')](_0xd426('0x50'),_0x4f8c1b[_0xd426('0x17')]));_0x4f8c1b[_0xd426('0x51')](_0x4f8c1b[_0xd426('0x43')],_0x4f8c1b['extension'],parseInt(_0x4f8c1b[_0xd426('0x45')],0xa)+0x1);_0x4f8c1b[_0xd426('0x35')]();}}else{logger[_0xd426('0xc')](util[_0xd426('0x11')](_0xd426('0x52'),_0x4f8c1b[_0xd426('0x17')]));_0x4f8c1b[_0xd426('0x51')](_0x4f8c1b[_0xd426('0x43')],_0x4f8c1b[_0xd426('0x44')],parseInt(_0x4f8c1b[_0xd426('0x45')],0xa)+0x1);_0x4f8c1b['close']();}}function main(){var _0x4f7ad4;return utilLicense['getLicense']()[_0xd426('0x2c')](function(_0x43f45f){if(_0x43f45f){if(_0x43f45f[_0xd426('0x53')]){if(_0x43f45f['callysquare']&&_0x43f45f[_0xd426('0x54')]>0x0){logger['info'](util[_0xd426('0x11')](_0xd426('0x55'),_0x43f45f[_0xd426('0x54')]));_0x4f7ad4=_0x43f45f[_0xd426('0x54')];}else{logger[_0xd426('0x10')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xd426('0x10')](_0xd426('0x56'));_0x4f7ad4=-0x1;}}})['catch'](function(_0x4e6350){logger[_0xd426('0xc')](_0xd426('0x57'),_0x4e6350[_0xd426('0x1c')]);})[_0xd426('0x4d')](function(){var _0x5ad7a7=require(_0xd426('0x58'))(config[_0xd426('0x5')][_0xd426('0xf')],config['agi']['ip'],_0x4f7ad4);_0x5ad7a7['on'](_0xd426('0xc'),errorHandler);_0x5ad7a7['on'](_0xd426('0x59'),listeningHandler);_0x5ad7a7['on']('connection',connectionHandler);_0x5ad7a7['on'](_0xd426('0x35'),closeHandler);});}main(); \ No newline at end of file +var _0x6071=['value','getSquareProject','then','catch','createSquareReport','agi_','substring','inspect','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','hangup','sync','production','start','debug','joinAt','mxCell','calleridname','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','result','response','isUndefined','toString','agicommand\x20not\x20found','finally','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','listening','xml2json','util','moment','../../config/logger','../../config/license/util','./rpc','./mailRpc','agi','defaults','127.0.0.1','nextTick','error','stack','log','port','info','format','name','message','arg_1','dnid','uniqueid','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','agicommand','omit','hasOwnProperty','isArray','length','source','target','addEdge'];(function(_0x3e5d7c,_0x3f1efd){var _0x39457b=function(_0x354943){while(--_0x354943){_0x3e5d7c['push'](_0x3e5d7c['shift']());}};_0x39457b(++_0x3f1efd);}(_0x6071,0x1bc));var _0x1607=function(_0x275621,_0x524302){_0x275621=_0x275621-0x0;var _0x2ad056=_0x6071[_0x275621];return _0x2ad056;};'use strict';var parser=require(_0x1607('0x0'));var _=require('lodash');var syncho=require('syncho');var util=require(_0x1607('0x1'));var moment=require(_0x1607('0x2'));var config=require('../../config/environment');var logger=require(_0x1607('0x3'))('agi');var utilLicense=require(_0x1607('0x4'));var rpc=require(_0x1607('0x5'));var mailRpc=require(_0x1607('0x6'));var Graph=require('./graph');var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x1607('0x7')]=_[_0x1607('0x8')](config[_0x1607('0x7')],{'ip':_0x1607('0x9'),'port':0x11dd});function connectionHandler(_0x534209){process[_0x1607('0xa')](function(){syncho(function(){try{setChannelVariables(_0x534209);agiHandler(_0x534209);}catch(_0x219f03){logger[_0x1607('0xb')](_0x219f03[_0x1607('0xc')]);}});});}function listeningHandler(){console[_0x1607('0xd')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config['agi'][_0x1607('0xe')]);logger[_0x1607('0xf')](util[_0x1607('0x10')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x1607('0x7')]['ip'],config[_0x1607('0x7')]['port']));}function errorHandler(_0x5ecd05){if(_0x5ecd05&&_0x5ecd05[_0x1607('0x11')]&&_0x5ecd05[_0x1607('0x12')]){logger[_0x1607('0xb')](util[_0x1607('0x10')]('[%s]\x20%s',_0x5ecd05[_0x1607('0x11')],_0x5ecd05[_0x1607('0x12')]));}else{logger[_0x1607('0xb')](util[_0x1607('0x10')]('[ERROR]\x20%s',_0x5ecd05[_0x1607('0xc')]));}}function closeHandler(){logger[_0x1607('0xf')](util[_0x1607('0x10')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x1607('0x13')],this['calleridname'],this['callerid'],this[_0x1607('0x14')],this[_0x1607('0x15')]));try{createSquareReport(this);}catch(_0x5b2ca7){logger[_0x1607('0xb')](_0x5b2ca7[_0x1607('0xc')]);}}function timeoutHandler(){logger[_0x1607('0xf')](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x1607('0x13')],this['calleridname'],this[_0x1607('0x16')],this[_0x1607('0x14')],this['uniqueid']));}function hangupHandler(){logger['info'](util[_0x1607('0x10')](_0x1607('0x17'),this[_0x1607('0x13')],this['calleridname'],this['callerid'],this[_0x1607('0x14')],this[_0x1607('0x15')]));this[_0x1607('0x18')]=!![];}function getRoot(_0x32b8f0){return parser[_0x1607('0x19')](_0x32b8f0,{'object':!![]})[_0x1607('0x1a')][_0x1607('0x1b')];}function addVertex(_0x191f05,_0x30f4f7,_0x5247bc){_0x30f4f7[_0x1607('0x1c')]=_0x5247bc;if(_0x30f4f7['hasOwnProperty']('retry')){_0x30f4f7['maxRetry']=parseInt(_0x30f4f7['retry'],0xa);}_0x191f05['addVertex'](_[_0x1607('0x1d')](_0x30f4f7,'mxCell'));}function initGraph(_0x3d2f7b,_0x217c12){var _0x2499a2=new Graph();for(var _0x25c900 in _0x3d2f7b){if(_0x3d2f7b[_0x1607('0x1e')](_0x25c900)){if(_[_0x1607('0x1f')](_0x3d2f7b[_0x25c900])){for(var _0x2eb091=0x0;_0x2eb091<_0x3d2f7b[_0x25c900][_0x1607('0x20')];_0x2eb091+=0x1){addVertex(_0x2499a2,_0x3d2f7b[_0x25c900][_0x2eb091],_0x25c900);}}else{addVertex(_0x2499a2,_0x3d2f7b[_0x25c900],_0x25c900);}}}for(var _0x552308=0x0;_0x552308<_0x217c12[_0x1607('0x20')];_0x552308+=0x1){if(_0x217c12[_0x552308][_0x1607('0x21')]&&_0x217c12[_0x552308][_0x1607('0x22')]){_0x2499a2[_0x1607('0x23')](_0x217c12[_0x552308]['source'],_0x217c12[_0x552308][_0x1607('0x22')],_0x217c12[_0x552308][_0x1607('0x24')]);}}return _0x2499a2;}function getSquareProject(_0x4761db,_0x2e1470){rpc[_0x1607('0x25')](_0x4761db)[_0x1607('0x26')](function(_0x4f587f){_0x2e1470(null,_0x4f587f);})[_0x1607('0x27')](function(_0x11e119){_0x2e1470(null,_0x11e119);});}function createSquareReport(_0x38179d,_0x220ea8){rpc[_0x1607('0x28')](_0x38179d)[_0x1607('0x26')](function(_0x51a943){if(_0x220ea8){_0x220ea8(null,_0x51a943);}})['catch'](function(_0x5169ff){if(_0x220ea8){_0x220ea8(null,_0x5169ff);}});}function setChannelVariables(_0x3c8c60){for(var _0x4cf160 in _0x3c8c60){if(_0x3c8c60[_0x1607('0x1e')](_0x4cf160)){if(_0x4cf160['indexOf'](_0x1607('0x29'))===0x0){_0x3c8c60[_0x4cf160[_0x1607('0x2a')](0x4)]=_0x3c8c60[_0x4cf160];delete _0x3c8c60[_0x4cf160];}}}}function getLogFromObject(_0x463bf5){return util[_0x1607('0x2b')](_0x463bf5,{'showHidden':![],'depth':null});}function agiHandler(_0x5399ab){var _0xfd4f64,_0x4a9316,_0x4563eb,_0x2f1a52,_0x4c5a13;logger['debug']('variables',JSON[_0x1607('0x2c')](_0x5399ab,null,0x2));logger[_0x1607('0xf')](util[_0x1607('0x10')](_0x1607('0x2d'),_0x5399ab['arg_1'],_0x5399ab['calleridname'],_0x5399ab['callerid'],_0x5399ab[_0x1607('0x14')],_0x5399ab['uniqueid']));_0x5399ab['on'](_0x1607('0xb'),errorHandler);_0x5399ab['on'](_0x1607('0x2e'),closeHandler);_0x5399ab['on']('timeout',timeoutHandler);_0x5399ab[_0x1607('0x18')]=![];_0x5399ab['on'](_0x1607('0x2f'),hangupHandler);var _0x406cc6=getSquareProject[_0x1607('0x30')](null,_0x5399ab[_0x1607('0x13')]);if(_0x406cc6){if(_0x406cc6[_0x1607('0x31')]){_0xfd4f64=getRoot(_0x406cc6[_0x1607('0x31')]);if(_0xfd4f64&&_0xfd4f64[_0x1607('0x32')]){logger[_0x1607('0x33')](_0x1607('0x1b'),JSON[_0x1607('0x2c')](_0xfd4f64,null,0x2));_0x5399ab[_0x1607('0x34')]=moment()[_0x1607('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x4a9316=initGraph(_['omit'](_0xfd4f64,_0x1607('0x35')),_0xfd4f64[_0x1607('0x35')]);_0x4563eb=new Vertices(_0x5399ab,rpc,mailRpc);logger[_0x1607('0xf')](util[_0x1607('0x10')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5399ab[_0x1607('0x13')],_0x5399ab[_0x1607('0x36')],_0x5399ab[_0x1607('0x16')],_0x5399ab['dnid'],_0x5399ab[_0x1607('0x15')]));_0x4a9316[_0x1607('0x37')](_0xfd4f64[_0x1607('0x32')]['id'],function(_0x260841){try{_0x260841=_0x4563eb[_0x1607('0x38')](_0x260841);logger[_0x1607('0x33')](_0x1607('0x39'),JSON[_0x1607('0x2c')](_0x260841,null,0x2));if(_0x260841['agicommand']===_0x1607('0x3a')){logger[_0x1607('0xf')](_0x1607('0x3b'));_0x5399ab[_0x1607('0x3c')]=_0x260841[_0x1607('0x3c')]||_0x5399ab[_0x1607('0x3c')];_0x5399ab[_0x1607('0x3d')]=_0x260841[_0x1607('0x3d')];_0x5399ab[_0x1607('0x3e')]=_0x260841[_0x1607('0x3e')]?_0x260841[_0x1607('0x3e')]-0x1:0x1;return null;}else if(_0x260841&&_0x4563eb[_0x260841[_0x1607('0x1c')]]){_0x4c5a13=_0x4563eb[_0x260841[_0x1607('0x1c')]](_0x260841);logger['info']('response',JSON[_0x1607('0x2c')](_0x4c5a13,null,0x2));if(_0x4c5a13&&_0x4c5a13['code']===AGI_CODE_SUCCESS&&_0x4c5a13[_0x1607('0x3f')]!==AGI_RESULT_ERROR&&!_0x5399ab[_0x1607('0x18')]){logger[_0x1607('0x33')](_0x1607('0x40'),getLogFromObject(_0x4c5a13));return _[_0x1607('0x41')](_0x4c5a13[_0x1607('0x3f')])?null:_0x4c5a13[_0x1607('0x3f')][_0x1607('0x42')]();}else{logger[_0x1607('0xb')](_0x1607('0x40'),getLogFromObject(_0x4c5a13));return null;}}else{logger[_0x1607('0xb')](_0x1607('0x43'));return null;}}catch(_0xa0889){logger[_0x1607('0xb')](_0xa0889['stack']);return null;}});if(_0xfd4f64['finally']){logger[_0x1607('0xf')](util[_0x1607('0x10')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5399ab['arg_1'],_0x5399ab[_0x1607('0x36')],_0x5399ab['callerid'],_0x5399ab[_0x1607('0x14')],_0x5399ab[_0x1607('0x15')]));_0x4a9316[_0x1607('0x37')](_0xfd4f64[_0x1607('0x44')]['id'],function(_0x3af30c){try{_0x3af30c=_0x4563eb[_0x1607('0x38')](_0x3af30c);logger[_0x1607('0x33')]('vertex',JSON[_0x1607('0x2c')](_0x3af30c,null,0x2));if(_0x3af30c&&_0x4563eb[_0x3af30c[_0x1607('0x1c')]]){_0x4c5a13=_0x4563eb[_0x3af30c[_0x1607('0x1c')]](_0x3af30c);if(_0x4c5a13){logger[_0x1607('0x33')](_0x1607('0x40'),getLogFromObject(_0x4c5a13));return _['isUndefined'](_0x4c5a13[_0x1607('0x3f')])?null:_0x4c5a13[_0x1607('0x3f')][_0x1607('0x42')]();}else{logger[_0x1607('0xb')](_0x1607('0x40'),getLogFromObject(_0x4c5a13));return null;}}else{logger[_0x1607('0xb')](_0x1607('0x43'));return null;}}catch(_0x2dc40c){logger['error'](_0x2dc40c[_0x1607('0xc')]);return null;}});}logger[_0x1607('0xf')](util['format']('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5399ab[_0x1607('0x13')],_0x5399ab['calleridname'],_0x5399ab[_0x1607('0x16')],_0x5399ab[_0x1607('0x14')],_0x5399ab[_0x1607('0x15')]));logger[_0x1607('0xf')](util[_0x1607('0x10')](_0x1607('0x45'),_0x5399ab['context'],_0x5399ab[_0x1607('0x3d')],parseInt(_0x5399ab[_0x1607('0x3e')],0xa)+0x1));_0x5399ab[_0x1607('0x46')](_0x5399ab[_0x1607('0x3c')],_0x5399ab['extension'],parseInt(_0x5399ab[_0x1607('0x3e')],0xa)+0x1);_0x5399ab[_0x1607('0x2e')]();}}else{logger['error'](util[_0x1607('0x10')]('Project\x20%s\x20not\x20published',_0x5399ab[_0x1607('0x13')]));_0x5399ab[_0x1607('0x46')](_0x5399ab['context'],_0x5399ab[_0x1607('0x3d')],parseInt(_0x5399ab[_0x1607('0x3e')],0xa)+0x1);_0x5399ab['close']();}}else{logger[_0x1607('0xb')](util[_0x1607('0x10')](_0x1607('0x47'),_0x5399ab[_0x1607('0x13')]));_0x5399ab['continueAt'](_0x5399ab[_0x1607('0x3c')],_0x5399ab[_0x1607('0x3d')],parseInt(_0x5399ab[_0x1607('0x3e')],0xa)+0x1);_0x5399ab[_0x1607('0x2e')]();}}function main(){var _0x488e5b;return utilLicense[_0x1607('0x48')]()[_0x1607('0x26')](function(_0x23551d){if(_0x23551d){if(_0x23551d[_0x1607('0x49')]){if(_0x23551d[_0x1607('0x4a')]&&_0x23551d[_0x1607('0x4a')]>0x0){logger[_0x1607('0xf')](util['format'](_0x1607('0x4b'),_0x23551d[_0x1607('0x4a')]));_0x488e5b=_0x23551d[_0x1607('0x4a')];}else{logger['info'](_0x1607('0x4c'));}}else{logger['info'](_0x1607('0x4d'));_0x488e5b=-0x1;}}})['catch'](function(_0x45f4f2){logger[_0x1607('0xb')](_0x1607('0x4e'),_0x45f4f2['stack']);})[_0x1607('0x44')](function(){var _0x16a2ba=require('./server')(config[_0x1607('0x7')]['port'],config[_0x1607('0x7')]['ip'],_0x488e5b);_0x16a2ba['on'](_0x1607('0xb'),errorHandler);_0x16a2ba['on'](_0x1607('0x4f'),listeningHandler);_0x16a2ba['on']('connection',connectionHandler);_0x16a2ba['on'](_0x1607('0x2e'),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 6557fbc..cb6ebd6 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 _0x8b06=['SendMail','bluebird','jayson/promise','client','http','request','error','result','catch'];(function(_0x3f146c,_0x42e0dc){var _0x407f72=function(_0x42ada8){while(--_0x42ada8){_0x3f146c['push'](_0x3f146c['shift']());}};_0x407f72(++_0x42e0dc);}(_0x8b06,0x18d));var _0x68b0=function(_0x1d865c,_0x15e7d3){_0x1d865c=_0x1d865c-0x0;var _0x910b6a=_0x8b06[_0x1d865c];return _0x910b6a;};'use strict';var BPromise=require(_0x68b0('0x0'));var jayson=require(_0x68b0('0x1'));var client=jayson[_0x68b0('0x2')][_0x68b0('0x3')]({'port':0x232b});function request(_0x49d5a6,_0x2f368f){return new BPromise(function(_0x28e81f,_0x30e372){return client[_0x68b0('0x4')](_0x49d5a6,_0x2f368f)['then'](function(_0xc78b04){if(_0xc78b04[_0x68b0('0x5')]){return _0x30e372(_0xc78b04[_0x68b0('0x5')]['message']);}else{return _0x28e81f(_0xc78b04[_0x68b0('0x6')]);}})[_0x68b0('0x7')](function(_0x2c10bd){return _0x30e372(_0x2c10bd);});});}exports['sendMailMessage']=function(_0x11ff7a,_0x19cf39){return request(_0x68b0('0x8'),{'account':_0x11ff7a,'message':_0x19cf39});}; \ No newline at end of file +var _0xc0f3=['error','result','catch','sendMailMessage','SendMail','jayson/promise','client','http','request','then'];(function(_0x422641,_0x46b4ce){var _0xd1c3af=function(_0x15d391){while(--_0x15d391){_0x422641['push'](_0x422641['shift']());}};_0xd1c3af(++_0x46b4ce);}(_0xc0f3,0x1e5));var _0x3c0f=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xc0f3[_0x19e35c];return _0x3e1fe8;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x3c0f('0x0'));var client=jayson[_0x3c0f('0x1')][_0x3c0f('0x2')]({'port':0x232b});function request(_0x39e472,_0x115558){return new BPromise(function(_0x297e93,_0x4e30f0){return client[_0x3c0f('0x3')](_0x39e472,_0x115558)[_0x3c0f('0x4')](function(_0x30dfc8){if(_0x30dfc8[_0x3c0f('0x5')]){return _0x4e30f0(_0x30dfc8[_0x3c0f('0x5')]['message']);}else{return _0x297e93(_0x30dfc8[_0x3c0f('0x6')]);}})[_0x3c0f('0x7')](function(_0x2b5572){return _0x4e30f0(_0x2b5572);});});}exports[_0x3c0f('0x8')]=function(_0x3998f8,_0x32baa7){return request(_0x3c0f('0x9'),{'account':_0x3998f8,'message':_0x32baa7});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 01b8f13..d220979 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 _0xf07a=['call','_localBuffer','_inBody','_transform','toString','indexOf','substring','length','split','slice','trim','emit','headers','line','exports','util','stream'];(function(_0x369e5d,_0x54e3f3){var _0x3b09eb=function(_0x283f6b){while(--_0x283f6b){_0x369e5d['push'](_0x369e5d['shift']());}};_0x3b09eb(++_0x54e3f3);}(_0xf07a,0x86));var _0xaf07=function(_0x2e891a,_0xb5a3b5){_0x2e891a=_0x2e891a-0x0;var _0x39f989=_0xf07a[_0x2e891a];return _0x39f989;};'use strict';var util=require(_0xaf07('0x0'));var Transform=require(_0xaf07('0x1'))['Transform'];function AGIReply(_0xdf034b){Transform[_0xaf07('0x2')](this,_0xdf034b);this[_0xaf07('0x3')]='';this[_0xaf07('0x4')]=![];}util['inherits'](AGIReply,Transform);AGIReply['prototype'][_0xaf07('0x5')]=function(_0x5cba18,_0x2e15ef,_0x53d90e){var _0x2ae16d='\x0a',_0x5b864c=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x18e050=-0x1,_0x378834=-0x1,_0x132995='',_0x33fda4=0x0,_0x38704e='',_0x241c7d='';this[_0xaf07('0x3')]+=_0x5cba18[_0xaf07('0x6')]();_0x38704e=this[_0xaf07('0x3')];if(!this[_0xaf07('0x4')]){_0x33fda4=0x0;while(_0x5b864c[_0x33fda4]){while((_0x378834=_0x38704e[_0xaf07('0x7')](_0x5b864c[_0x33fda4]))!=-0x1){_0x132995=_0x5b864c[_0x33fda4];_0x241c7d=_0x38704e['substring'](0x0,_0x378834);_0x38704e=_0x38704e[_0xaf07('0x8')](_0x378834+_0x132995[_0xaf07('0x9')]);var _0x293837=_0x241c7d[_0xaf07('0xa')](_0x2ae16d),_0x31862d=0x0,_0x24223f={},_0x198a94='',_0x5bf030='',_0x5b50dc=-0x1;while(_0x293837[_0x31862d]){_0x5b50dc=_0x293837[_0x31862d][_0xaf07('0x7')](':');if(_0x5b50dc!=-0x1){_0x198a94=_0x293837[_0x31862d]['slice'](0x0,_0x5b50dc)['trim']();_0x5bf030=_0x293837[_0x31862d][_0xaf07('0xb')](_0x5b50dc+0x1)[_0xaf07('0xc')]();if(_0x198a94[_0xaf07('0x9')]>0x0){_0x24223f[_0x198a94]=_0x5bf030;}}else{}_0x31862d++;}this[_0xaf07('0xd')](_0xaf07('0xe'),_0x24223f);this[_0xaf07('0x4')]=!![];}_0x33fda4++;}this['_localBuffer']=_0x38704e;}else{while((_0x18e050=_0x38704e[_0xaf07('0x7')](_0x2ae16d))!=-0x1){_0x241c7d=_0x38704e[_0xaf07('0x8')](0x0,_0x18e050);this[_0xaf07('0xd')](_0xaf07('0xf'),_0x241c7d);_0x38704e=_0x38704e['substring'](_0x18e050+_0x2ae16d[_0xaf07('0x9')]);}this['_localBuffer']=_0x38704e;}_0x53d90e();};module[_0xaf07('0x10')]=AGIReply; \ No newline at end of file +var _0xa883=['trim','length','emit','line','exports','util','stream','Transform','call','_localBuffer','_inBody','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','slice'];(function(_0x2bbc07,_0x1e2168){var _0x6879e4=function(_0x290fa1){while(--_0x290fa1){_0x2bbc07['push'](_0x2bbc07['shift']());}};_0x6879e4(++_0x1e2168);}(_0xa883,0x1f2));var _0x3a88=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa883[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x3a88('0x0'));var Transform=require(_0x3a88('0x1'))[_0x3a88('0x2')];function AGIReply(_0x1cc724){Transform[_0x3a88('0x3')](this,_0x1cc724);this[_0x3a88('0x4')]='';this[_0x3a88('0x5')]=![];}util['inherits'](AGIReply,Transform);AGIReply['prototype'][_0x3a88('0x6')]=function(_0x30e6bc,_0x5b4e04,_0x21f120){var _0x23a4c0='\x0a',_0x12d2bc=['\x0a\x0a',_0x3a88('0x7')],_0x41496b=-0x1,_0x37ca80=-0x1,_0x132a5a='',_0x51d6cb=0x0,_0xc2ff5a='',_0xc7797b='';this[_0x3a88('0x4')]+=_0x30e6bc[_0x3a88('0x8')]();_0xc2ff5a=this['_localBuffer'];if(!this[_0x3a88('0x5')]){_0x51d6cb=0x0;while(_0x12d2bc[_0x51d6cb]){while((_0x37ca80=_0xc2ff5a[_0x3a88('0x9')](_0x12d2bc[_0x51d6cb]))!=-0x1){_0x132a5a=_0x12d2bc[_0x51d6cb];_0xc7797b=_0xc2ff5a[_0x3a88('0xa')](0x0,_0x37ca80);_0xc2ff5a=_0xc2ff5a[_0x3a88('0xa')](_0x37ca80+_0x132a5a['length']);var _0x4b255f=_0xc7797b['split'](_0x23a4c0),_0x3864dd=0x0,_0x59a97c={},_0x5d142a='',_0x14a4b0='',_0x1b3b6f=-0x1;while(_0x4b255f[_0x3864dd]){_0x1b3b6f=_0x4b255f[_0x3864dd][_0x3a88('0x9')](':');if(_0x1b3b6f!=-0x1){_0x5d142a=_0x4b255f[_0x3864dd][_0x3a88('0xb')](0x0,_0x1b3b6f)[_0x3a88('0xc')]();_0x14a4b0=_0x4b255f[_0x3864dd][_0x3a88('0xb')](_0x1b3b6f+0x1)[_0x3a88('0xc')]();if(_0x5d142a[_0x3a88('0xd')]>0x0){_0x59a97c[_0x5d142a]=_0x14a4b0;}}else{}_0x3864dd++;}this[_0x3a88('0xe')]('headers',_0x59a97c);this[_0x3a88('0x5')]=!![];}_0x51d6cb++;}this[_0x3a88('0x4')]=_0xc2ff5a;}else{while((_0x41496b=_0xc2ff5a[_0x3a88('0x9')](_0x23a4c0))!=-0x1){_0xc7797b=_0xc2ff5a[_0x3a88('0xa')](0x0,_0x41496b);this['emit'](_0x3a88('0xf'),_0xc7797b);_0xc2ff5a=_0xc2ff5a[_0x3a88('0xa')](_0x41496b+_0x23a4c0[_0x3a88('0xd')]);}this[_0x3a88('0x4')]=_0xc2ff5a;}_0x21f120();};module[_0x3a88('0x10')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 324da81..d9c74e3 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 _0xf21b=['ShowInterval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','then','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','jayson/promise','client','http','request','error','message','catch','getSquareProject','production','getMailAccountById','ShowMailAccount','Smtp','name','email','getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','getTrunkById','ShowTrunk','ShowSound'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xf21b,0x10a));var _0xbf21=function(_0x334d6d,_0x567864){_0x334d6d=_0x334d6d-0x0;var _0xb532a6=_0xf21b[_0x334d6d];return _0xb532a6;};'use strict';var BPromise=require(_0xbf21('0x0'));var moment=require(_0xbf21('0x1'));var _=require(_0xbf21('0x2'));var util=require('util');var jayson=require(_0xbf21('0x3'));var client=jayson[_0xbf21('0x4')][_0xbf21('0x5')]({'port':0x2329});function request(_0x5c7269,_0xf39049){return new BPromise(function(_0x3112af,_0x2a252e){return client[_0xbf21('0x6')](_0x5c7269,_0xf39049)['then'](function(_0x585783){if(_0x585783[_0xbf21('0x7')]){return _0x2a252e(_0x585783['error'][_0xbf21('0x8')]);}else{return _0x3112af(_0x585783['result']);}})[_0xbf21('0x9')](function(_0x3decae){return _0x2a252e(_0x3decae);});});}exports[_0xbf21('0xa')]=function(_0x3ec292){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x3ec292},'attributes':[_0xbf21('0xb')]}});};exports[_0xbf21('0xc')]=function(_0x19249a){return request(_0xbf21('0xd'),{'options':{'raw':![],'where':{'id':_0x19249a},'include':[{'model':'MailServerOut','as':_0xbf21('0xe')}],'attributes':['id',_0xbf21('0xf'),_0xbf21('0x10')]}});};exports[_0xbf21('0x11')]=function(_0x56771f){return request(_0xbf21('0x12'),{'options':{'where':{'id':_0x56771f},'attributes':['name']}});};exports[_0xbf21('0x13')]=function(_0x5b548d){return request(_0xbf21('0x14'),{'options':{'where':{'id':_0x5b548d},'attributes':[_0xbf21('0xf')]}});};exports['getVariableById']=function(_0xe5d959){return request(_0xbf21('0x15'),{'options':{'where':{'id':_0xe5d959},'attributes':['name']}});};exports[_0xbf21('0x16')]=function(_0x467a21){return request(_0xbf21('0x17'),{'options':{'where':{'id':_0x467a21},'attributes':['dsn']}});};exports[_0xbf21('0x18')]=function(_0xda2bab){return request(_0xbf21('0x19'),{'options':{'where':{'id':_0xda2bab},'attributes':['name']}});};exports[_0xbf21('0x1a')]=function(_0x11720d){return request(_0xbf21('0x1b'),{'options':{'where':{'id':_0x11720d},'attributes':[_0xbf21('0xf')]}});};exports['getSoundById']=function(_0x29ec3e){return request(_0xbf21('0x1c'),{'options':{'where':{'id':_0x29ec3e},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x44550a){return request(_0xbf21('0x1d'),{'options':{'raw':![],'where':{'id':_0x44550a},'include':[{'model':'Interval','as':_0xbf21('0x1e')}]}});};exports[_0xbf21('0x1f')]=function(_0x37081e){return request('ShowSmsAccount',{'options':{'where':{'id':_0x37081e},'attributes':['id',_0xbf21('0xf')]}});};exports[_0xbf21('0x20')]=function(_0x237a26){return request(_0xbf21('0x21'),{'body':_0x237a26});};exports[_0xbf21('0x22')]=function(_0x21e5b9){return request(_0xbf21('0x23'),{'body':_0x21e5b9});};exports['createSquareReport']=function(_0x1a5758){return request(_0xbf21('0x24'),{'body':_['merge'](_0x1a5758,{'project_name':_0x1a5758[_0xbf21('0x25')],'prev_project_name':_0x1a5758[_0xbf21('0x26')]||'','is_subproject':_0x1a5758[_0xbf21('0x26')]?!![]:![],'leaveAt':moment()[_0xbf21('0x27')](_0xbf21('0x28'))})});};exports[_0xbf21('0x29')]=function(_0x5255f2){return request(_0xbf21('0x2a'),{'body':_0x5255f2});};exports[_0xbf21('0x2b')]=function(_0x25f026){return request(_0xbf21('0x2c'),{'body':_0x25f026});};exports[_0xbf21('0x2d')]=function(_0x503116){return request(_0xbf21('0x2e'),{'options':{'raw':![],'where':{'phone':_0x503116['phone'],'ListId':_0x503116[_0xbf21('0x2f')]}}})[_0xbf21('0x30')](function(_0x4519c5){if(_0x4519c5){return _0x4519c5;}return request(_0xbf21('0x31'),{'body':_0x503116});});};exports[_0xbf21('0x32')]=function(_0x450616){return request(_0xbf21('0x33'),{'options':{'where':{'id':_0x450616},'attributes':[_0xbf21('0xf')]}});};exports[_0xbf21('0x34')]=function(_0x10f3cb,_0x341214){return request(_0xbf21('0x35'),{'body':{'interface':_0x341214},'options':{'where':_0x10f3cb}});};exports[_0xbf21('0x36')]=function(_0x2099e6,_0x42b523,_0x2f4927){return request(_0xbf21('0x37'),{'body':{'type':_0x42b523,'uniqueid':_0x2f4927},'options':{'where':_0x2099e6}});};exports['agentUnpause']=function(_0x5b29f2){return request(_0xbf21('0x38'),{'body':{},'options':{'where':_0x5b29f2}});};exports[_0xbf21('0x39')]=function(_0x11e3a2){return request(_0xbf21('0x3a'),{'body':{},'options':{'where':_0x11e3a2}});}; \ No newline at end of file +var _0xd9d2=['ShowTrunk','save_name','getIntervalById','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','phone','CreateCmContact','getPauseById','ShowPause','agentLogin','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','lodash','util','jayson/promise','client','http','request','then','error','result','catch','getSquareProject','getMailAccountById','MailServerOut','Smtp','name','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc','dsn','getUserById','ShowUser'];(function(_0x3789cb,_0x1c79c8){var _0x202624=function(_0x177c30){while(--_0x177c30){_0x3789cb['push'](_0x3789cb['shift']());}};_0x202624(++_0x1c79c8);}(_0xd9d2,0xf1));var _0x2d9d=function(_0x433a5c,_0x3aed4){_0x433a5c=_0x433a5c-0x0;var _0x346a70=_0xd9d2[_0x433a5c];return _0x346a70;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0x2d9d('0x0'));var util=require(_0x2d9d('0x1'));var jayson=require(_0x2d9d('0x2'));var client=jayson[_0x2d9d('0x3')][_0x2d9d('0x4')]({'port':0x2329});function request(_0x53c794,_0x31d1ee){return new BPromise(function(_0xefc39f,_0xec9440){return client[_0x2d9d('0x5')](_0x53c794,_0x31d1ee)[_0x2d9d('0x6')](function(_0x26ff05){if(_0x26ff05['error']){return _0xec9440(_0x26ff05[_0x2d9d('0x7')]['message']);}else{return _0xefc39f(_0x26ff05[_0x2d9d('0x8')]);}})[_0x2d9d('0x9')](function(_0x34944e){return _0xec9440(_0x34944e);});});}exports[_0x2d9d('0xa')]=function(_0xcc0541){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0xcc0541},'attributes':['production']}});};exports[_0x2d9d('0xb')]=function(_0x46056c){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x46056c},'include':[{'model':_0x2d9d('0xc'),'as':_0x2d9d('0xd')}],'attributes':['id',_0x2d9d('0xe'),'email']}});};exports['getSquareProjectById']=function(_0x3b2386){return request(_0x2d9d('0xf'),{'options':{'where':{'id':_0x3b2386},'attributes':['name']}});};exports[_0x2d9d('0x10')]=function(_0x473da3){return request(_0x2d9d('0x11'),{'options':{'where':{'id':_0x473da3},'attributes':['name']}});};exports[_0x2d9d('0x12')]=function(_0x228942){return request(_0x2d9d('0x13'),{'options':{'where':{'id':_0x228942},'attributes':[_0x2d9d('0xe')]}});};exports['getSquareOdbcById']=function(_0x47fab2){return request(_0x2d9d('0x14'),{'options':{'where':{'id':_0x47fab2},'attributes':[_0x2d9d('0x15')]}});};exports[_0x2d9d('0x16')]=function(_0x70bd53){return request(_0x2d9d('0x17'),{'options':{'where':{'id':_0x70bd53},'attributes':[_0x2d9d('0xe')]}});};exports['getTrunkById']=function(_0x5e3d36){return request(_0x2d9d('0x18'),{'options':{'where':{'id':_0x5e3d36},'attributes':[_0x2d9d('0xe')]}});};exports['getSoundById']=function(_0x54f1a6){return request('ShowSound',{'options':{'where':{'id':_0x54f1a6},'attributes':[_0x2d9d('0x19')]}});};exports[_0x2d9d('0x1a')]=function(_0x2a11ce){return request(_0x2d9d('0x1b'),{'options':{'raw':![],'where':{'id':_0x2a11ce},'include':[{'model':_0x2d9d('0x1c'),'as':'Intervals'}]}});};exports[_0x2d9d('0x1d')]=function(_0x5890d2){return request(_0x2d9d('0x1e'),{'options':{'where':{'id':_0x5890d2},'attributes':['id',_0x2d9d('0xe')]}});};exports['createSmsMessage']=function(_0x394144){return request(_0x2d9d('0x1f'),{'body':_0x394144});};exports[_0x2d9d('0x20')]=function(_0x41fda0){return request('CreateSquareDetailsReport',{'body':_0x41fda0});};exports['createSquareReport']=function(_0x4ee3ce){return request('CreateSquareReport',{'body':_[_0x2d9d('0x21')](_0x4ee3ce,{'project_name':_0x4ee3ce[_0x2d9d('0x22')],'prev_project_name':_0x4ee3ce['arg_2']||'','is_subproject':_0x4ee3ce[_0x2d9d('0x23')]?!![]:![],'leaveAt':moment()[_0x2d9d('0x24')](_0x2d9d('0x25'))})});};exports[_0x2d9d('0x26')]=function(_0x3c5491){return request(_0x2d9d('0x27'),{'body':_0x3c5491});};exports[_0x2d9d('0x28')]=function(_0x3f8314){return request('CreateSquareMessage',{'body':_0x3f8314});};exports[_0x2d9d('0x29')]=function(_0x279b38){return request(_0x2d9d('0x2a'),{'options':{'raw':![],'where':{'phone':_0x279b38[_0x2d9d('0x2b')],'ListId':_0x279b38['ListId']}}})[_0x2d9d('0x6')](function(_0x812d4c){if(_0x812d4c){return _0x812d4c;}return request(_0x2d9d('0x2c'),{'body':_0x279b38});});};exports[_0x2d9d('0x2d')]=function(_0x2557fa){return request(_0x2d9d('0x2e'),{'options':{'where':{'id':_0x2557fa},'attributes':[_0x2d9d('0xe')]}});};exports[_0x2d9d('0x2f')]=function(_0x90c02c,_0x2362b3){return request('LoginUser',{'body':{'interface':_0x2362b3},'options':{'where':_0x90c02c}});};exports[_0x2d9d('0x30')]=function(_0x3abe21,_0x42dd75,_0x5d679f){return request(_0x2d9d('0x31'),{'body':{'type':_0x42dd75,'uniqueid':_0x5d679f},'options':{'where':_0x3abe21}});};exports[_0x2d9d('0x32')]=function(_0x188f8c){return request(_0x2d9d('0x33'),{'body':{},'options':{'where':_0x188f8c}});};exports[_0x2d9d('0x34')]=function(_0x4a98a0){return request('LogoutUser',{'body':{},'options':{'where':_0x4a98a0}});}; \ 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 c17fd4a..e9f36f9 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 _0xcedf=['./polly','./lex','exports'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xcedf,0x1b6));var _0xfced=function(_0x2c5c1b,_0x259a2c){_0x2c5c1b=_0x2c5c1b-0x0;var _0x2d7a31=_0xcedf[_0x2c5c1b];return _0x2d7a31;};var polly=require(_0xfced('0x0'));var lex=require(_0xfced('0x1'));module[_0xfced('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x9865=['exports','./polly','./lex'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x9865,0x1ba));var _0x5986=function(_0x35a5cd,_0x497d7b){_0x35a5cd=_0x35a5cd-0x0;var _0x5e1c9c=_0x9865[_0x35a5cd];return _0x5e1c9c;};var polly=require(_0x5986('0x0'));var lex=require(_0x5986('0x1'));module[_0x5986('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 bbb0dd1..ce4f133 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa75b=['./lib/api'];(function(_0x2a4c5e,_0x4064f3){var _0xd1c07c=function(_0x50d4c4){while(--_0x50d4c4){_0x2a4c5e['push'](_0x2a4c5e['shift']());}};_0xd1c07c(++_0x4064f3);}(_0xa75b,0x170));var _0xba75=function(_0x3d35fc,_0x190e7c){_0x3d35fc=_0x3d35fc-0x0;var _0x7e3bf1=_0xa75b[_0x3d35fc];return _0x7e3bf1;};'use strict';var lex=require(_0xba75('0x0'));module['exports']=function(_0x546e14,_0x10c0dd,_0x39dc19,_0x17b666,_0x3cde96,_0x1760c0){return lex(_0x546e14,_0x10c0dd,_0x39dc19,_0x17b666,_0x3cde96,_0x1760c0);}; \ No newline at end of file +var _0x55e0=['./lib/api','exports'];(function(_0x534c57,_0x466ed9){var _0x437808=function(_0x4d2859){while(--_0x4d2859){_0x534c57['push'](_0x534c57['shift']());}};_0x437808(++_0x466ed9);}(_0x55e0,0xdc));var _0x055e=function(_0x420f5e,_0x1c2810){_0x420f5e=_0x420f5e-0x0;var _0x18d1c7=_0x55e0[_0x420f5e];return _0x18d1c7;};'use strict';var lex=require(_0x055e('0x0'));module[_0x055e('0x1')]=function(_0x2e09a6,_0x414740,_0x5b82b9,_0x578882,_0x3a2ee6,_0x2d9bd5){return lex(_0x2e09a6,_0x414740,_0x5b82b9,_0x578882,_0x3a2ee6,_0x2d9bd5);}; \ 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 d567e16..4acd689 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(_0x231a4c,_0x26894f){var _0x3aaea8=function(_0x236de4){while(--_0x236de4){_0x231a4c['push'](_0x231a4c['shift']());}};_0x3aaea8(++_0x26894f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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(_0xde3989,_0x2115a1){var _0x1a4a2f=function(_0x329b18){while(--_0x329b18){_0xde3989['push'](_0xde3989['shift']());}};_0x1a4a2f(++_0x2115a1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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 e444610..60531e7 100644 --- a/server/services/agi/scripts/aws/polly/index.js +++ b/server/services/agi/scripts/aws/polly/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02ef=['./lib/api'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x02ef,0x106));var _0xf02e=function(_0x475aa9,_0x439aab){_0x475aa9=_0x475aa9-0x0;var _0x360bbc=_0x02ef[_0x475aa9];return _0x360bbc;};'use strict';var polly=require(_0xf02e('0x0'));module['exports']=function(_0x21c9fe,_0x2cb93d,_0x4e34c7,_0x451c3c,_0x569f0a,_0x5edbfa,_0x55ab25){return polly(_0x21c9fe,_0x2cb93d,_0x4e34c7,_0x451c3c,_0x569f0a,_0x5edbfa,_0x55ab25);}; \ No newline at end of file +var _0x8e60=['./lib/api','exports'];(function(_0x3778ec,_0x447da3){var _0x59ccd8=function(_0x4a796f){while(--_0x4a796f){_0x3778ec['push'](_0x3778ec['shift']());}};_0x59ccd8(++_0x447da3);}(_0x8e60,0x176));var _0x08e6=function(_0x35f78d,_0x91ac69){_0x35f78d=_0x35f78d-0x0;var _0x2e6772=_0x8e60[_0x35f78d];return _0x2e6772;};'use strict';var polly=require(_0x08e6('0x0'));module[_0x08e6('0x1')]=function(_0x56e73b,_0x3b8fe1,_0x7ae8cf,_0x7c6ea3,_0x4356b3,_0x4b2bd0,_0x43373e){return polly(_0x56e73b,_0x3b8fe1,_0x7ae8cf,_0x7c6ea3,_0x4356b3,_0x4b2bd0,_0x43373e);}; \ 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 991b8ad..cfbde48 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 _0xb5b0=['AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','bluebird','randomstring'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb5b0,0x15e));var _0x0b5b=function(_0xf4ab25,_0x13b833){_0xf4ab25=_0xf4ab25-0x0;var _0x4a9343=_0xb5b0[_0xf4ab25];return _0x4a9343;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x0b5b('0x0'));var rs=require(_0x0b5b('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x3c0901,_0x15f81a,_0xa080bf){return new BPromise(function(_0x9c1eac,_0x3f57f5){_0x3c0901['synthesizeSpeech'](_0x15f81a,function(_0x219042,_0x2af792){if(_0x219042){_0x3f57f5(_0x219042);}else if(_0x2af792){if(_0x2af792[_0x0b5b('0x2')]instanceof Buffer){fs[_0x0b5b('0x3')](_0xa080bf,_0x2af792['AudioStream'],function(_0x1655d3){if(_0x1655d3){_0x3f57f5(_0x1655d3);}else{_0x9c1eac();}});}else{_0x3f57f5(new Error(_0x0b5b('0x4')));}}else{_0x3f57f5(new Error(_0x0b5b('0x5')));}});});}module['exports']=function(_0x39ceaf,_0x3866e7,_0x218eec,_0x469478,_0x44ed7b,_0x55e752,_0x163067){var _0x29efed=new AWS[(_0x0b5b('0x6'))]({'accessKeyId':_0x39ceaf,'secretAccessKey':_0x3866e7,'region':_0x218eec});var _0x3634da={'Text':_0x44ed7b,'TextType':_0x55e752||_0x0b5b('0x7'),'OutputFormat':'mp3','VoiceId':_0x469478};return pollyResult(_0x29efed,_0x3634da,_0x163067);}; \ No newline at end of file +var _0x95fb=['Polly','text','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports'];(function(_0x461ae5,_0xd92bcb){var _0xf28a90=function(_0x320e19){while(--_0x320e19){_0x461ae5['push'](_0x461ae5['shift']());}};_0xf28a90(++_0xd92bcb);}(_0x95fb,0x1d7));var _0xb95f=function(_0x49d010,_0x5982){_0x49d010=_0x49d010-0x0;var _0x1acbf6=_0x95fb[_0x49d010];return _0x1acbf6;};'use strict';var fs=require('fs');var path=require(_0xb95f('0x0'));var BPromise=require(_0xb95f('0x1'));var rs=require(_0xb95f('0x2'));var AWS=require(_0xb95f('0x3'));function pollyResult(_0x47a88a,_0x133eff,_0xe78b12){return new BPromise(function(_0x1dbefe,_0x3b2bea){_0x47a88a[_0xb95f('0x4')](_0x133eff,function(_0x2cc2fb,_0x5bb7fc){if(_0x2cc2fb){_0x3b2bea(_0x2cc2fb);}else if(_0x5bb7fc){if(_0x5bb7fc[_0xb95f('0x5')]instanceof Buffer){fs[_0xb95f('0x6')](_0xe78b12,_0x5bb7fc[_0xb95f('0x5')],function(_0x3d6a6b){if(_0x3d6a6b){_0x3b2bea(_0x3d6a6b);}else{_0x1dbefe();}});}else{_0x3b2bea(new Error(_0xb95f('0x7')));}}else{_0x3b2bea(new Error(_0xb95f('0x8')));}});});}module[_0xb95f('0x9')]=function(_0x3bb767,_0x1ce8bd,_0x1068f2,_0x399dfb,_0x2efc52,_0x403284,_0x439c5a){var _0x134643=new AWS[(_0xb95f('0xa'))]({'accessKeyId':_0x3bb767,'secretAccessKey':_0x1ce8bd,'region':_0x1068f2});var _0x1a9eae={'Text':_0x2efc52,'TextType':_0x403284||_0xb95f('0xb'),'OutputFormat':_0xb95f('0xc'),'VoiceId':_0x399dfb};return pollyResult(_0x134643,_0x1a9eae,_0x439c5a);}; \ 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 12c886f..534fcd0 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 _0x20f4=['./lib/api'];(function(_0xfb71e3,_0x456c79){var _0x45c956=function(_0x51adf2){while(--_0x51adf2){_0xfb71e3['push'](_0xfb71e3['shift']());}};_0x45c956(++_0x456c79);}(_0x20f4,0x11a));var _0x420f=function(_0x1f39ed,_0x33ac87){_0x1f39ed=_0x1f39ed-0x0;var _0x2fa7b5=_0x20f4[_0x1f39ed];return _0x2fa7b5;};'use strict';var asr=require(_0x420f('0x0'));module['exports']=function(_0xb78117,_0x17b880,_0x3a0e27,_0x5220b7){return asr(_0xb78117,_0x17b880,_0x3a0e27);}; \ No newline at end of file +var _0xf9cd=['exports','./lib/api'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0xf9cd,0x16b));var _0xdf9c=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xf9cd[_0x1b2ff7];return _0x31656a;};'use strict';var asr=require(_0xdf9c('0x0'));module[_0xdf9c('0x1')]=function(_0x3bc854,_0x2609da,_0x2c13c1,_0x22a41c){return asr(_0x3bc854,_0x2609da,_0x2c13c1);}; \ 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 db77cdb..f7c4dd3 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 _0x7a72=['/v1/speech:recognize?key=','8000','bluebird','https://speech.googleapis.com','string','filepath\x20should\x20be\x20a\x20string','undefined','length','lang\x20should\x20be\x20a\x20string','readFileSync','toString','POST'];(function(_0x31ff76,_0x4ef2bf){var _0x1e0a68=function(_0x536033){while(--_0x536033){_0x31ff76['push'](_0x31ff76['shift']());}};_0x1e0a68(++_0x4ef2bf);}(_0x7a72,0x1be));var _0x27a7=function(_0x4dbcb7,_0x24408b){_0x4dbcb7=_0x4dbcb7-0x0;var _0x39fd02=_0x7a72[_0x4dbcb7];return _0x39fd02;};'use strict';var url=require('url');var BPromise=require(_0x27a7('0x0'));var fs=require('fs');var host=_0x27a7('0x1');module['exports']=function(_0x316bd3,_0x4b4ed5,_0x15d71f){return new BPromise(function(_0x4e68c6,_0x30a1a8){var _0x502521;if(typeof _0x316bd3!==_0x27a7('0x2')||_0x316bd3['length']===0x0){return _0x30a1a8(_0x27a7('0x3'));}if(typeof _0x4b4ed5!==_0x27a7('0x2')||_0x4b4ed5['length']===0x0){return _0x30a1a8('key\x20should\x20be\x20a\x20string');}if(typeof _0x15d71f!==_0x27a7('0x4')&&(typeof _0x15d71f!=='string'||_0x15d71f[_0x27a7('0x5')]===0x0)){return _0x30a1a8(_0x27a7('0x6'));}try{_0x502521=fs[_0x27a7('0x7')](_0x316bd3)[_0x27a7('0x8')]('base64');}catch(_0x1ce909){return _0x30a1a8(_0x1ce909);}return _0x4e68c6({'method':_0x27a7('0x9'),'uri':host+_0x27a7('0xa')+_0x4b4ed5,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x27a7('0xb'),'languageCode':_0x15d71f},'audio':{'content':_0x502521}},'json':!![]});});}; \ No newline at end of file +var _0x2209=['bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64','POST','LINEAR16','8000','url'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x2209,0x95));var _0x9220=function(_0xbb5203,_0x25d527){_0xbb5203=_0xbb5203-0x0;var _0x5ef134=_0x2209[_0xbb5203];return _0x5ef134;};'use strict';var url=require(_0x9220('0x0'));var BPromise=require(_0x9220('0x1'));var fs=require('fs');var host=_0x9220('0x2');module[_0x9220('0x3')]=function(_0x29dc9b,_0x5d3fe2,_0x2b23aa){return new BPromise(function(_0x5cc72c,_0x348220){var _0x2fddae;if(typeof _0x29dc9b!==_0x9220('0x4')||_0x29dc9b[_0x9220('0x5')]===0x0){return _0x348220(_0x9220('0x6'));}if(typeof _0x5d3fe2!==_0x9220('0x4')||_0x5d3fe2[_0x9220('0x5')]===0x0){return _0x348220(_0x9220('0x7'));}if(typeof _0x2b23aa!==_0x9220('0x8')&&(typeof _0x2b23aa!=='string'||_0x2b23aa[_0x9220('0x5')]===0x0)){return _0x348220(_0x9220('0x9'));}try{_0x2fddae=fs['readFileSync'](_0x29dc9b)[_0x9220('0xa')](_0x9220('0xb'));}catch(_0x18550a){return _0x348220(_0x18550a);}return _0x5cc72c({'method':_0x9220('0xc'),'uri':host+'/v1/speech:recognize?key='+_0x5d3fe2,'body':{'config':{'encoding':_0x9220('0xd'),'sampleRateHertz':_0x9220('0xe'),'languageCode':_0x2b23aa},'audio':{'content':_0x2fddae}},'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 7e9729f..9b357bd 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 _0xcdea=['./asr','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xcdea,0x14e));var _0xacde=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xcdea[_0x24061a];return _0x82054e;};var asr=require(_0xacde('0x0'));module[_0xacde('0x1')]={'asr':asr}; \ No newline at end of file +var _0x0c5b=['exports','./asr'];(function(_0x3c5cc8,_0x336027){var _0x44675c=function(_0xf9543e){while(--_0xf9543e){_0x3c5cc8['push'](_0x3c5cc8['shift']());}};_0x44675c(++_0x336027);}(_0x0c5b,0x141));var _0xb0c5=function(_0x62aa7b,_0x447c94){_0x62aa7b=_0x62aa7b-0x0;var _0x13ff8b=_0x0c5b[_0x62aa7b];return _0x13ff8b;};var asr=require(_0xb0c5('0x0'));module[_0xb0c5('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 38de922..dcd9cc7 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 _0x0113=['close','error','unlink','download\x20error','end','WHAT_EVER','transcode','wav','error\x20convert','finish\x20to\x20convert','resolve','tmp','generate','writeFileSync','base64','then','chmodSync','777','split','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','MP3','POST','.mp3','from','audioContent','writeFile','.wav','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','parse\x20response\x20failed:\x0a','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','name','message','googleDialogflow','textRequest','source','result','actionIncomplete','fulfillment','speech','status','code','metadata','isFallbackIntent','googleDialogflowV2','detectIntent','length','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','queryText','responseId','intentDetectionConfidence','tildeASR','asr','Tilde\x20ASR\x20transcription','awsPolly','awsLex','lex','ispeechTTS','format','ispeechASR','model=%s','freeform=3','sestekNDA','nda','channelData','http','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','https:','host','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file'];(function(_0x5158b3,_0x1060e1){var _0x1ef449=function(_0x1f0c7f){while(--_0x1f0c7f){_0x5158b3['push'](_0x5158b3['shift']());}};_0x1ef449(++_0x1060e1);}(_0x0113,0x166));var _0x3011=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0113[_0x14add3];return _0x4a174f;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x3011('0x0'));var https=require(_0x3011('0x1'));var md5=require(_0x3011('0x2'));var path=require(_0x3011('0x3'));var querystring=require(_0x3011('0x4'));var rp=require(_0x3011('0x5'));var rs=require(_0x3011('0x6'));var sox=require(_0x3011('0x7'));var tts=require(_0x3011('0x8'));var urlParse=require(_0x3011('0x9'))[_0x3011('0xa')];var util=require(_0x3011('0xb'));var aws=require('./aws');var google=require(_0x3011('0xc'));var sestek=require(_0x3011('0xd'));var tilde=require(_0x3011('0xe'));var logger=require(_0x3011('0xf'))(_0x3011('0x10'));var ISPEECH_API=_0x3011('0x11');function downloadFile(_0x2c90a7,_0x3b1953){return new BPromise(function(_0x1717d3,_0x3594dc){var _0x2d9c62=urlParse(_0x2c90a7);var _0x4bfc65=_0x2d9c62['protocol']===_0x3011('0x12')?https:http;var _0xc59c94={'host':_0x2d9c62[_0x3011('0x13')],'path':_0x2d9c62[_0x3011('0x3')],'headers':{'user-agent':'WHAT_EVER'}};_0x4bfc65[_0x3011('0x14')](_0xc59c94,function(_0x2734b3){if(_0x2734b3[_0x3011('0x15')]!==0xc8){logger['error'](_0x3011('0x16')+_0x2c90a7+_0x3011('0x17')+_0x2734b3[_0x3011('0x15')]+'\x20('+_0x2734b3[_0x3011('0x18')]+')');_0x3594dc(new Error(_0x3011('0x16')+_0x2c90a7+_0x3011('0x17')+_0x2734b3[_0x3011('0x15')]+'\x20('+_0x2734b3['statusMessage']+')'));return;}var _0x5c893a=fs[_0x3011('0x19')](_0x3b1953);_0x5c893a['on'](_0x3011('0x1a'),function(){logger[_0x3011('0x1b')](_0x3011('0x1c'));_0x5c893a[_0x3011('0x1d')](_0x1717d3);});_0x5c893a['on'](_0x3011('0x1e'),function(_0x17cd37){fs[_0x3011('0x1f')](_0x3b1953);logger[_0x3011('0x1e')](_0x3011('0x20'),_0x17cd37);_0x3594dc(_0x17cd37);});_0x2734b3['pipe'](_0x5c893a);})['on'](_0x3011('0x1e'),function(_0x2c3a12){logger[_0x3011('0x1e')](_0x2c3a12);_0x3594dc(_0x2c3a12);})[_0x3011('0x21')]();});}function uploadFile(_0x26420b){return new BPromise(function(_0x464326,_0x13f3b7){var _0x5433fe=urlParse(_0x26420b);var _0x25b789=_0x5433fe['protocol']===_0x3011('0x12')?https:http;var _0x4dd1b4={'host':_0x5433fe[_0x3011('0x13')],'path':_0x5433fe['path'],'headers':{'user-agent':_0x3011('0x22')}};_0x25b789[_0x3011('0x14')](_0x4dd1b4,function(_0x5248b8){if(_0x5248b8[_0x3011('0x15')]!==0xc8){_0x13f3b7(new Error(_0x3011('0x16')+_0x26420b+'\x20failed,\x20status\x20code\x20=\x20'+_0x5248b8[_0x3011('0x15')]+'\x20('+_0x5248b8['statusMessage']+')'));return;}var _0x5387bf='';_0x5248b8['on']('data',function(_0x488fed){_0x5387bf+=_0x488fed;});_0x5248b8['on'](_0x3011('0x21'),function(){_0x464326(_0x5387bf);});})['on'](_0x3011('0x1e'),function(_0x568abb){_0x13f3b7(_0x568abb);})['end']();});}function convertFile(_0x1aeb63,_0x2ce447){return new BPromise(function(_0x4d9ef1,_0x19c52b){var _0x2ff5ee=sox[_0x3011('0x23')](_0x1aeb63,_0x2ce447,{'sampleRate':0x1f40,'format':_0x3011('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2ff5ee['on']('error',function(_0x50d6cc){logger[_0x3011('0x1e')](_0x3011('0x25'),_0x50d6cc);_0x19c52b(_0x50d6cc);});_0x2ff5ee['on'](_0x3011('0x21'),function(){logger['info'](_0x3011('0x26'));_0x4d9ef1();});_0x2ff5ee['start']();});}function base64Decode(_0x471128,_0x414493){var _0x3e1e1b=path[_0x3011('0x27')](__dirname,_0x3011('0x28'),rs[_0x3011('0x29')](0x4)+'.wav');fs[_0x3011('0x2a')](_0x3e1e1b,_0x471128,_0x3011('0x2b'));return convertFile(_0x3e1e1b,_0x414493)[_0x3011('0x2c')](function(){try{fs[_0x3011('0x1f')](_0x3e1e1b);fs[_0x3011('0x2d')](_0x414493,_0x3011('0x2e'));}catch(_0x2b06b9){logger[_0x3011('0x1e')](_0x2b06b9);}return _0x414493[_0x3011('0x2f')]('.')[0x0];});}function base64Encode(_0x2906ef){var _0x3b1ad=fs['readFileSync'](_0x2906ef);return new Buffer(_0x3b1ad)[_0x3011('0x30')]('base64');}exports[_0x3011('0x31')]=function(_0xcb88f3,_0x2059f5,_0x38ddda,_0x2913f2,_0x105674,_0x3e6a24){var _0x5cd9a6,_0x40322d;var _0x5588de=_0x3011('0x32');var _0x4aaa7e=_0x3011('0x33')+_0xcb88f3;var _0x312eb4={};if(_0x2059f5===_0x3011('0x34')){_0x312eb4[_0x3011('0x35')]={'ssml':_0x38ddda};}else{_0x312eb4[_0x3011('0x35')]={'text':_0x38ddda};};_0x312eb4[_0x3011('0x36')]={'languageCode':_0x2913f2,'ssmlGender':_0x105674};_0x312eb4['audioConfig']={'audioEncoding':_0x3011('0x37'),'sampleRateHertz':0x1f40};var _0x2df44d={'url':_0x5588de+'text:synthesize'+_0x4aaa7e,'method':_0x3011('0x38'),'json':!![],'body':_0x312eb4};return rp(_0x2df44d)['then'](function(_0x2a93fb){return new BPromise(function(_0x2c6d5b,_0xc119c){_0x5cd9a6=path[_0x3011('0x27')](__dirname,_0x3011('0x28'),rs[_0x3011('0x29')](0x4)+_0x3011('0x39'));var _0x299e3d=Buffer[_0x3011('0x3a')](_0x2a93fb[_0x3011('0x3b')],_0x3011('0x2b'));return fs[_0x3011('0x3c')](_0x5cd9a6,_0x299e3d,function(_0x1a8bd8){_0xc119c(_0x1a8bd8);},function(_0x49e59a){fs[_0x3011('0x2d')](_0x5cd9a6,_0x3011('0x2e'));_0x2c6d5b(_0x49e59a);});});})[_0x3011('0x2c')](function(_0x4054d3){_0x40322d=path[_0x3011('0x27')](__dirname,_0x3011('0x28'),rs['generate'](0x4)+_0x3011('0x3d'));return convertFile(_0x5cd9a6,_0x40322d);})[_0x3011('0x2c')](function(){try{fs[_0x3011('0x1f')](_0x5cd9a6);fs[_0x3011('0x2d')](_0x40322d,_0x3011('0x2e'));}catch(_0xb6d4f7){logger[_0x3011('0x1e')](_0xb6d4f7);}logger[_0x3011('0x1b')](_0x3011('0x3e'),_0x40322d[_0x3011('0x2f')]('.')[0x0]);return _0x40322d['split']('.')[0x0];});};exports[_0x3011('0x3f')]=function(_0x529521,_0x40c172){var _0x5df979=_0x3011('0x40');var _0x39347b,_0x4aa896;var _0x59b35c;var _0x125ccd={'encoding':_0x3011('0x41'),'method':'POST','timeout':0x2710,'url':_0x5df979,'headers':{'Content-Type':_0x3011('0x42')},'body':_0x3011('0x43')+encodeURIComponent(JSON['stringify']([[[_0x3011('0x44'),JSON[_0x3011('0x45')]([_0x529521,_0x40c172||'en',![],'null']),null,'generic']]]))};return rp(_0x125ccd)[_0x3011('0x2c')](function(_0xde1341){try{_0x59b35c=eval(_0xde1341['slice'](0x5))[0x0][0x2];}catch(_0x29d6b4){throw new Error(_0x3011('0x46')+_0xde1341['data']);}if(!_0x59b35c){if(_0x529521['length']>0xc8){throw new Error(_0x3011('0x47'));}else{throw new Error(_0x3011('0x48')+_0x40c172+_0x3011('0x49'));}}try{_0x59b35c=eval(_0x59b35c)[0x0];}catch(_0x3ab8b1){throw new Error('parse\x20response\x20failed:\x0a'+res['data']);}const _0x45413a=_0x59b35c;_0x39347b=path[_0x3011('0x27')](__dirname,_0x3011('0x28'),rs[_0x3011('0x29')](0x4)+_0x3011('0x39'));fs[_0x3011('0x2a')](_0x39347b,_0x59b35c,{'encoding':_0x3011('0x2b')});_0x4aa896=path[_0x3011('0x27')](__dirname,_0x3011('0x28'),rs[_0x3011('0x29')](0x4)+_0x3011('0x3d'));return convertFile(_0x39347b,_0x4aa896);})[_0x3011('0x2c')](function(){try{fs[_0x3011('0x1f')](_0x39347b);fs['chmodSync'](_0x4aa896,'777');}catch(_0x2c2b6b){logger['error'](_0x2c2b6b);}logger[_0x3011('0x1b')](_0x3011('0x4a'),_0x4aa896[_0x3011('0x2f')]('.')[0x0]);return _0x4aa896['split']('.')[0x0];});};exports[_0x3011('0x4b')]=function(_0x44803b,_0x155659,_0x3eb7c1){return google['asr'](_0x44803b,_0x155659,_0x3eb7c1)[_0x3011('0x2c')](function(_0x236f94){logger[_0x3011('0x1b')](_0x236f94[_0x3011('0x4c')]);return rp(_0x236f94);})[_0x3011('0x2c')](function(_0x4c2cb8){var _0x52c420='';var _0x3d47c7=0x0;try{fs[_0x3011('0x1f')](_0x44803b);}catch(_0x4ee97c){logger['error'](_0x4ee97c);}if(_0x4c2cb8&&_0x4c2cb8['results']){_0x52c420=_0x4c2cb8[_0x3011('0x4d')][_0x3011('0x4e')](function(_0x10beaa){return _0x10beaa&&_0x10beaa['alternatives'][0x0]&&_0x10beaa[_0x3011('0x4f')][0x0][_0x3011('0x50')]?_0x10beaa[_0x3011('0x4f')][0x0][_0x3011('0x50')]:'';})[_0x3011('0x51')]('\x0a');_0x3d47c7=_0x4c2cb8[_0x3011('0x4d')][_0x3011('0x4e')](function(_0x205d28){return _0x205d28&&_0x205d28[_0x3011('0x4f')][0x0]&&_0x205d28['alternatives'][0x0][_0x3011('0x52')]?_0x205d28[_0x3011('0x4f')][0x0]['confidence']:0x0;})[_0x3011('0x51')]('\x0a');}logger[_0x3011('0x1b')](_0x3011('0x53'),_0x52c420);logger[_0x3011('0x1b')](_0x3011('0x54'),_0x3d47c7);return{'transcript':_0x52c420,'confidence':_0x3d47c7};})['catch'](function(_0x5dee79){logger[_0x3011('0x1e')]('[%s]\x20%s:%s',_0x5dee79[_0x3011('0x15')],_0x5dee79[_0x3011('0x55')],_0x5dee79[_0x3011('0x56')]);});};exports[_0x3011('0x57')]=function(_0x2633e3,_0x2ab3fe,_0x5f4a4e,_0x4f2ba6){var _0x55ddc1=apiai(_0x2ab3fe,{'language':_0x4f2ba6||'en'});return _0x55ddc1[_0x3011('0x58')](_0x5f4a4e,{'sessionId':md5(_0x2633e3)})[_0x3011('0x2c')](function(_0x4f7cbc){logger[_0x3011('0x1b')](JSON[_0x3011('0x45')](_0x4f7cbc));return{'source':_0x4f7cbc['result'][_0x3011('0x59')],'resolvedQuery':_0x4f7cbc[_0x3011('0x5a')]['resolvedQuery'],'action':_0x4f7cbc['result']['action'],'actionIncomplete':_0x4f7cbc[_0x3011('0x5a')][_0x3011('0x5b')],'speech':_0x4f7cbc[_0x3011('0x5a')][_0x3011('0x5c')][_0x3011('0x5d')],'score':_0x4f7cbc['result']['score'],'statusCode':_0x4f7cbc[_0x3011('0x5e')][_0x3011('0x5f')],'endConversation':_0x4f7cbc[_0x3011('0x5a')][_0x3011('0x60')]['endConversation']||![],'isFallbackIntent':_0x4f7cbc[_0x3011('0x5a')][_0x3011('0x60')][_0x3011('0x61')]};});};exports[_0x3011('0x62')]=function(_0x2c6def,_0x42f6b9,_0x23ea6b,_0x3f8256,_0x45f5b4,_0x1b1d6a){var _0x9fa669=_0x3f8256['replace'](/\\n/g,'\x0a');var _0xc89eb5={'credentials':{'private_key':_0x9fa669,'client_email':_0x23ea6b}};var _0x41dc73=new dialogflow['SessionsClient'](_0xc89eb5);var _0x40587c=_0x41dc73['sessionPath'](_0x42f6b9,md5(_0x2c6def));var _0x238c9c={'session':_0x40587c,'queryInput':{'text':{'text':_0x45f5b4,'languageCode':_0x1b1d6a}}};return _0x41dc73[_0x3011('0x63')](_0x238c9c)[_0x3011('0x2c')](function(_0x5b1f09){if(_0x5b1f09&&_0x5b1f09[_0x3011('0x64')]){logger[_0x3011('0x1b')](_0x3011('0x65'),JSON[_0x3011('0x45')](_0x5b1f09));var _0x20c226=_0x5b1f09[0x0];if(_0x20c226){var _0xb2d78={'action':_0x20c226[_0x3011('0x66')]['action'],'allRequiredParamsPresent':_0x20c226[_0x3011('0x66')][_0x3011('0x67')],'endConversation':_0x20c226['queryResult'][_0x3011('0x68')]&&_0x20c226['queryResult']['diagnosticInfo'][_0x3011('0x69')]?_0x20c226[_0x3011('0x66')][_0x3011('0x68')][_0x3011('0x69')][_0x3011('0x6a')][_0x3011('0x6b')]:![],'fulfillmentText':_0x20c226[_0x3011('0x66')][_0x3011('0x6c')],'intentName':_0x20c226['queryResult']['intent'][_0x3011('0x55')],'intentDisplayName':_0x20c226[_0x3011('0x66')][_0x3011('0x6d')][_0x3011('0x6e')],'isFallbackIntent':_0x20c226[_0x3011('0x66')][_0x3011('0x6d')][_0x3011('0x6f')],'languageCode':_0x20c226[_0x3011('0x66')]['languageCode'],'queryText':_0x20c226[_0x3011('0x66')][_0x3011('0x70')],'responseId':_0x20c226[_0x3011('0x71')],'score':_0x20c226[_0x3011('0x66')][_0x3011('0x72')],'speech':_0x20c226[_0x3011('0x66')][_0x3011('0x6c')],'providerResponse':JSON[_0x3011('0x45')](_0x5b1f09)};return _0xb2d78;}}});};exports[_0x3011('0x73')]=function(_0x21e8ac,_0x4ec173,_0x267ff9,_0x598508){return tilde[_0x3011('0x74')](_0x21e8ac,_0x4ec173,_0x267ff9,_0x598508)[_0x3011('0x2c')](function(_0x3ff32b){try{fs[_0x3011('0x1f')](_0x21e8ac);}catch(_0x87a8b3){logger['error'](_0x87a8b3);}logger[_0x3011('0x1b')](_0x3011('0x75'),_0x3ff32b[_0x3011('0x50')]);logger[_0x3011('0x1b')]('Tilde\x20ASR\x20confidence',_0x3ff32b[_0x3011('0x52')]);return _0x3ff32b;});};exports[_0x3011('0x76')]=function(_0x2ef6a1,_0xd75aca,_0x18630b,_0x2b83e8,_0x52255a,_0x1622b0){var _0x580d9c=path[_0x3011('0x27')](__dirname,_0x3011('0x28'),rs[_0x3011('0x29')](0x4)+_0x3011('0x39'));var _0x431c74;return aws['polly'](_0x2ef6a1,_0xd75aca,_0x18630b,_0x2b83e8,_0x52255a,_0x1622b0,_0x580d9c)[_0x3011('0x2c')](function(){_0x431c74=path['resolve'](__dirname,'tmp',rs[_0x3011('0x29')](0x4)+_0x3011('0x3d'));return convertFile(_0x580d9c,_0x431c74);})[_0x3011('0x2c')](function(){try{fs[_0x3011('0x1f')](_0x580d9c);fs[_0x3011('0x2d')](_0x431c74,_0x3011('0x2e'));}catch(_0x267e9e){logger['error'](_0x267e9e);}return _0x431c74[_0x3011('0x2f')]('.')[0x0];});};exports[_0x3011('0x77')]=function(_0x2ee856,_0x2c739d,_0xf13638,_0xf681dd,_0x595c57,_0xb1c2fa){return aws[_0x3011('0x78')](_0x2ee856,_0x2c739d,_0xf13638,_0xf681dd,_0x595c57,_0xb1c2fa)[_0x3011('0x2c')](function(_0x264e26){logger[_0x3011('0x1b')](JSON[_0x3011('0x45')](_0x264e26));return _0x264e26;});};exports[_0x3011('0x79')]=function(_0x8f4745,_0x221586,_0x469603,_0x4a5549){var _0x4c3e27=util[_0x3011('0x7a')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x8f4745,encodeURIComponent(_0x221586),_0x469603,_0x4a5549);var _0x3cb535=path[_0x3011('0x27')](__dirname,_0x3011('0x28'),rs[_0x3011('0x29')](0x4)+_0x3011('0x39'));var _0x402068;return downloadFile(_0x4c3e27,_0x3cb535)['then'](function(){_0x402068=path[_0x3011('0x27')](__dirname,'tmp',rs[_0x3011('0x29')](0x4)+_0x3011('0x3d'));return convertFile(_0x3cb535,_0x402068);})['then'](function(){try{fs['unlink'](_0x3cb535);fs[_0x3011('0x2d')](_0x402068,_0x3011('0x2e'));}catch(_0x5b95b7){logger[_0x3011('0x1e')](_0x5b95b7);}return _0x402068['split']('.')[0x0];});};exports[_0x3011('0x7b')]=function(_0x51172f,_0x2ca8a5,_0x1261e2,_0x22f66c){var _0x5e07ac=util[_0x3011('0x7a')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x2ca8a5,_0x1261e2,base64Encode(_0x51172f),_0x22f66c?util[_0x3011('0x7a')](_0x3011('0x7c'),encodeURIComponent(_0x22f66c)):_0x3011('0x7d'));return uploadFile(_0x5e07ac)[_0x3011('0x2c')](function(_0x280bb5){return querystring[_0x3011('0xa')](_0x280bb5);});};exports[_0x3011('0x7e')]=function(_0x486e5a,_0x3be215){return sestek[_0x3011('0x7f')](_0x486e5a,_0x3be215)[_0x3011('0x2c')](function(_0x1a2189){logger[_0x3011('0x1b')](JSON[_0x3011('0x45')](_0x1a2189));var _0x24bf89={'speech':_0x1a2189['text'],'action':_0x1a2189[_0x3011('0x80')]?_0x1a2189['channelData']['CustomAction']:undefined,'actiondata':_0x1a2189[_0x3011('0x80')]?_0x1a2189[_0x3011('0x80')]['CustomActionData']:undefined};if(_0x1a2189[_0x3011('0x80')]&&_0x1a2189['channelData']['AudioFromTts']){return base64Decode(_0x1a2189[_0x3011('0x80')]['AudioFromTts']['Data'],path[_0x3011('0x27')](__dirname,'tmp',rs[_0x3011('0x29')](0x4)+'.wav'))[_0x3011('0x2c')](function(_0x369255){_0x24bf89['audiofile']=_0x369255;return _0x24bf89;});}return _0x24bf89;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0x1990=['googleDialogflow','textRequest','result','source','resolvedQuery','action','fulfillment','speech','score','status','metadata','endConversation','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','displayName','intent','isFallback','languageCode','responseId','intentDetectionConfidence','fulfillmentText','Tilde\x20ASR\x20confidence','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','freeform=3','sestekNDA','text','channelData','CustomActionData','AudioFromTts','Data','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','google-tts-api','url','parse','util','./aws','./sestek','./tilde','agi','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','info','finish\x20download\x20file','unlink','download\x20error','pipe','end','data','error\x20convert','resolve','tmp','writeFileSync','base64','then','chmodSync','777','split','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','generate','.mp3','audioContent','writeFile','.wav','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','length','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message'];(function(_0x3ec594,_0x448834){var _0x21f286=function(_0x537497){while(--_0x537497){_0x3ec594['push'](_0x3ec594['shift']());}};_0x21f286(++_0x448834);}(_0x1990,0xb6));var _0x0199=function(_0x10bba8,_0x592e15){_0x10bba8=_0x10bba8-0x0;var _0x523408=_0x1990[_0x10bba8];return _0x523408;};'use strict';var apiai=require(_0x0199('0x0'));var BPromise=require(_0x0199('0x1'));var dialogflow=require(_0x0199('0x2'));var fs=require('fs');var http=require(_0x0199('0x3'));var https=require(_0x0199('0x4'));var md5=require(_0x0199('0x5'));var path=require(_0x0199('0x6'));var querystring=require(_0x0199('0x7'));var rp=require(_0x0199('0x8'));var rs=require(_0x0199('0x9'));var sox=require('sox');var tts=require(_0x0199('0xa'));var urlParse=require(_0x0199('0xb'))[_0x0199('0xc')];var util=require(_0x0199('0xd'));var aws=require(_0x0199('0xe'));var google=require('./google');var sestek=require(_0x0199('0xf'));var tilde=require(_0x0199('0x10'));var logger=require('../../../config/logger')(_0x0199('0x11'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x2ccad8,_0x1be117){return new BPromise(function(_0x526e27,_0x1c80a6){var _0x95444c=urlParse(_0x2ccad8);var _0x4ddbd4=_0x95444c[_0x0199('0x12')]===_0x0199('0x13')?https:http;var _0x311ec8={'host':_0x95444c[_0x0199('0x14')],'path':_0x95444c[_0x0199('0x6')],'headers':{'user-agent':_0x0199('0x15')}};_0x4ddbd4[_0x0199('0x16')](_0x311ec8,function(_0x491bc6){if(_0x491bc6[_0x0199('0x17')]!==0xc8){logger[_0x0199('0x18')](_0x0199('0x19')+_0x2ccad8+_0x0199('0x1a')+_0x491bc6[_0x0199('0x17')]+'\x20('+_0x491bc6[_0x0199('0x1b')]+')');_0x1c80a6(new Error('request\x20to\x20'+_0x2ccad8+_0x0199('0x1a')+_0x491bc6[_0x0199('0x17')]+'\x20('+_0x491bc6[_0x0199('0x1b')]+')'));return;}var _0x54c930=fs['createWriteStream'](_0x1be117);_0x54c930['on'](_0x0199('0x1c'),function(){logger[_0x0199('0x1d')](_0x0199('0x1e'));_0x54c930['close'](_0x526e27);});_0x54c930['on'](_0x0199('0x18'),function(_0x191d22){fs[_0x0199('0x1f')](_0x1be117);logger[_0x0199('0x18')](_0x0199('0x20'),_0x191d22);_0x1c80a6(_0x191d22);});_0x491bc6[_0x0199('0x21')](_0x54c930);})['on'](_0x0199('0x18'),function(_0x52cf51){logger[_0x0199('0x18')](_0x52cf51);_0x1c80a6(_0x52cf51);})[_0x0199('0x22')]();});}function uploadFile(_0xd969e6){return new BPromise(function(_0x8bea8e,_0x7e8e22){var _0x531be4=urlParse(_0xd969e6);var _0x5ecd9e=_0x531be4['protocol']===_0x0199('0x13')?https:http;var _0x43035e={'host':_0x531be4[_0x0199('0x14')],'path':_0x531be4[_0x0199('0x6')],'headers':{'user-agent':'WHAT_EVER'}};_0x5ecd9e[_0x0199('0x16')](_0x43035e,function(_0x46aec3){if(_0x46aec3[_0x0199('0x17')]!==0xc8){_0x7e8e22(new Error('request\x20to\x20'+_0xd969e6+_0x0199('0x1a')+_0x46aec3[_0x0199('0x17')]+'\x20('+_0x46aec3[_0x0199('0x1b')]+')'));return;}var _0x591b40='';_0x46aec3['on'](_0x0199('0x23'),function(_0x9cd1af){_0x591b40+=_0x9cd1af;});_0x46aec3['on']('end',function(){_0x8bea8e(_0x591b40);});})['on'](_0x0199('0x18'),function(_0x2c19a1){_0x7e8e22(_0x2c19a1);})['end']();});}function convertFile(_0x315096,_0x9865c0){return new BPromise(function(_0x42a656,_0x448814){var _0x3742be=sox['transcode'](_0x315096,_0x9865c0,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3742be['on'](_0x0199('0x18'),function(_0x5dc9c7){logger[_0x0199('0x18')](_0x0199('0x24'),_0x5dc9c7);_0x448814(_0x5dc9c7);});_0x3742be['on'](_0x0199('0x22'),function(){logger[_0x0199('0x1d')]('finish\x20to\x20convert');_0x42a656();});_0x3742be['start']();});}function base64Decode(_0x4b3d81,_0x171a88){var _0x448755=path[_0x0199('0x25')](__dirname,_0x0199('0x26'),rs['generate'](0x4)+'.wav');fs[_0x0199('0x27')](_0x448755,_0x4b3d81,_0x0199('0x28'));return convertFile(_0x448755,_0x171a88)[_0x0199('0x29')](function(){try{fs['unlink'](_0x448755);fs[_0x0199('0x2a')](_0x171a88,_0x0199('0x2b'));}catch(_0x2a54eb){logger[_0x0199('0x18')](_0x2a54eb);}return _0x171a88[_0x0199('0x2c')]('.')[0x0];});}function base64Encode(_0x467ba3){var _0x24db21=fs[_0x0199('0x2d')](_0x467ba3);return new Buffer(_0x24db21)['toString'](_0x0199('0x28'));}exports[_0x0199('0x2e')]=function(_0x3c675e,_0x33dd4b,_0x48c316,_0xb807a9,_0x20039d,_0x560984){var _0x2f8cc6,_0x39ae88;var _0x3caf77=_0x0199('0x2f');var _0x31361e=_0x0199('0x30')+_0x3c675e;var _0x3e6f99={};if(_0x33dd4b===_0x0199('0x31')){_0x3e6f99[_0x0199('0x32')]={'ssml':_0x48c316};}else{_0x3e6f99['input']={'text':_0x48c316};};_0x3e6f99[_0x0199('0x33')]={'languageCode':_0xb807a9,'ssmlGender':_0x20039d};_0x3e6f99[_0x0199('0x34')]={'audioEncoding':_0x0199('0x35'),'sampleRateHertz':0x1f40};var _0x123380={'url':_0x3caf77+_0x0199('0x36')+_0x31361e,'method':_0x0199('0x37'),'json':!![],'body':_0x3e6f99};return rp(_0x123380)[_0x0199('0x29')](function(_0x42f5c6){return new BPromise(function(_0x43e23a,_0x49f2c8){_0x2f8cc6=path['resolve'](__dirname,_0x0199('0x26'),rs[_0x0199('0x38')](0x4)+_0x0199('0x39'));var _0x446162=Buffer['from'](_0x42f5c6[_0x0199('0x3a')],_0x0199('0x28'));return fs[_0x0199('0x3b')](_0x2f8cc6,_0x446162,function(_0xf7d708){_0x49f2c8(_0xf7d708);},function(_0x212ce8){fs[_0x0199('0x2a')](_0x2f8cc6,_0x0199('0x2b'));_0x43e23a(_0x212ce8);});});})['then'](function(_0x121ee2){_0x39ae88=path[_0x0199('0x25')](__dirname,_0x0199('0x26'),rs[_0x0199('0x38')](0x4)+_0x0199('0x3c'));return convertFile(_0x2f8cc6,_0x39ae88);})[_0x0199('0x29')](function(){try{fs['unlink'](_0x2f8cc6);fs[_0x0199('0x2a')](_0x39ae88,_0x0199('0x2b'));}catch(_0x23ddbc){logger[_0x0199('0x18')](_0x23ddbc);}logger[_0x0199('0x1d')]('googleCloudTTS\x20path',_0x39ae88[_0x0199('0x2c')]('.')[0x0]);return _0x39ae88[_0x0199('0x2c')]('.')[0x0];});};exports[_0x0199('0x3d')]=function(_0xb16ffa,_0x337398){var _0x3e326b=_0x0199('0x3e');var _0x1f342c,_0x4d16e8;var _0x31fa9e;var _0x42377f={'encoding':_0x0199('0x3f'),'method':_0x0199('0x37'),'timeout':0x2710,'url':_0x3e326b,'headers':{'Content-Type':_0x0199('0x40')},'body':_0x0199('0x41')+encodeURIComponent(JSON['stringify']([[[_0x0199('0x42'),JSON[_0x0199('0x43')]([_0xb16ffa,_0x337398||'en',![],_0x0199('0x44')]),null,_0x0199('0x45')]]]))};return rp(_0x42377f)[_0x0199('0x29')](function(_0x278a18){try{_0x31fa9e=eval(_0x278a18[_0x0199('0x46')](0x5))[0x0][0x2];}catch(_0x1eb707){throw new Error(_0x0199('0x47')+_0x278a18[_0x0199('0x23')]);}if(!_0x31fa9e){if(_0xb16ffa[_0x0199('0x48')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x0199('0x49')+_0x337398+_0x0199('0x4a'));}}try{_0x31fa9e=eval(_0x31fa9e)[0x0];}catch(_0x2bd80c){throw new Error(_0x0199('0x47')+res[_0x0199('0x23')]);}const _0x2f1a05=_0x31fa9e;_0x1f342c=path[_0x0199('0x25')](__dirname,_0x0199('0x26'),rs[_0x0199('0x38')](0x4)+_0x0199('0x39'));fs[_0x0199('0x27')](_0x1f342c,_0x31fa9e,{'encoding':_0x0199('0x28')});_0x4d16e8=path[_0x0199('0x25')](__dirname,_0x0199('0x26'),rs['generate'](0x4)+_0x0199('0x3c'));return convertFile(_0x1f342c,_0x4d16e8);})[_0x0199('0x29')](function(){try{fs[_0x0199('0x1f')](_0x1f342c);fs[_0x0199('0x2a')](_0x4d16e8,_0x0199('0x2b'));}catch(_0x49ffba){logger[_0x0199('0x18')](_0x49ffba);}logger[_0x0199('0x1d')](_0x0199('0x4b'),_0x4d16e8[_0x0199('0x2c')]('.')[0x0]);return _0x4d16e8[_0x0199('0x2c')]('.')[0x0];});};exports[_0x0199('0x4c')]=function(_0x369a7b,_0x401f3f,_0x3fb838){return google[_0x0199('0x4d')](_0x369a7b,_0x401f3f,_0x3fb838)[_0x0199('0x29')](function(_0x3f3870){logger[_0x0199('0x1d')](_0x3f3870[_0x0199('0x4e')]);return rp(_0x3f3870);})[_0x0199('0x29')](function(_0x32bcf9){var _0x7676d4='';var _0x41ea4f=0x0;try{fs[_0x0199('0x1f')](_0x369a7b);}catch(_0x2b5d16){logger[_0x0199('0x18')](_0x2b5d16);}if(_0x32bcf9&&_0x32bcf9[_0x0199('0x4f')]){_0x7676d4=_0x32bcf9[_0x0199('0x4f')][_0x0199('0x50')](function(_0x457403){return _0x457403&&_0x457403[_0x0199('0x51')][0x0]&&_0x457403['alternatives'][0x0][_0x0199('0x52')]?_0x457403[_0x0199('0x51')][0x0]['transcript']:'';})[_0x0199('0x53')]('\x0a');_0x41ea4f=_0x32bcf9['results'][_0x0199('0x50')](function(_0xfb1cc5){return _0xfb1cc5&&_0xfb1cc5['alternatives'][0x0]&&_0xfb1cc5[_0x0199('0x51')][0x0][_0x0199('0x54')]?_0xfb1cc5[_0x0199('0x51')][0x0][_0x0199('0x54')]:0x0;})[_0x0199('0x53')]('\x0a');}logger[_0x0199('0x1d')]('googleASR\x20transcription',_0x7676d4);logger[_0x0199('0x1d')](_0x0199('0x55'),_0x41ea4f);return{'transcript':_0x7676d4,'confidence':_0x41ea4f};})[_0x0199('0x56')](function(_0x332ba8){logger[_0x0199('0x18')](_0x0199('0x57'),_0x332ba8[_0x0199('0x17')],_0x332ba8[_0x0199('0x58')],_0x332ba8[_0x0199('0x59')]);});};exports[_0x0199('0x5a')]=function(_0x4bfd59,_0x2d8154,_0x112ad9,_0x252a67){var _0x4864e7=apiai(_0x2d8154,{'language':_0x252a67||'en'});return _0x4864e7[_0x0199('0x5b')](_0x112ad9,{'sessionId':md5(_0x4bfd59)})[_0x0199('0x29')](function(_0x3bd421){logger[_0x0199('0x1d')](JSON[_0x0199('0x43')](_0x3bd421));return{'source':_0x3bd421[_0x0199('0x5c')][_0x0199('0x5d')],'resolvedQuery':_0x3bd421['result'][_0x0199('0x5e')],'action':_0x3bd421[_0x0199('0x5c')][_0x0199('0x5f')],'actionIncomplete':_0x3bd421[_0x0199('0x5c')]['actionIncomplete'],'speech':_0x3bd421[_0x0199('0x5c')][_0x0199('0x60')][_0x0199('0x61')],'score':_0x3bd421[_0x0199('0x5c')][_0x0199('0x62')],'statusCode':_0x3bd421[_0x0199('0x63')]['code'],'endConversation':_0x3bd421[_0x0199('0x5c')][_0x0199('0x64')][_0x0199('0x65')]||![],'isFallbackIntent':_0x3bd421['result']['metadata']['isFallbackIntent']};});};exports[_0x0199('0x66')]=function(_0x60a4cb,_0x42204c,_0xc7a451,_0x4ec806,_0x197795,_0x753b98){var _0x121881=_0x4ec806[_0x0199('0x67')](/\\n/g,'\x0a');var _0x457bf2={'credentials':{'private_key':_0x121881,'client_email':_0xc7a451}};var _0x26dc3d=new dialogflow[(_0x0199('0x68'))](_0x457bf2);var _0x3ba01=_0x26dc3d[_0x0199('0x69')](_0x42204c,md5(_0x60a4cb));var _0x2eac23={'session':_0x3ba01,'queryInput':{'text':{'text':_0x197795,'languageCode':_0x753b98}}};return _0x26dc3d[_0x0199('0x6a')](_0x2eac23)[_0x0199('0x29')](function(_0x13ac65){if(_0x13ac65&&_0x13ac65[_0x0199('0x48')]){logger[_0x0199('0x1d')](_0x0199('0x6b'),JSON[_0x0199('0x43')](_0x13ac65));var _0x54700b=_0x13ac65[0x0];if(_0x54700b){var _0x43194c={'action':_0x54700b[_0x0199('0x6c')][_0x0199('0x5f')],'allRequiredParamsPresent':_0x54700b[_0x0199('0x6c')][_0x0199('0x6d')],'endConversation':_0x54700b[_0x0199('0x6c')]['diagnosticInfo']&&_0x54700b[_0x0199('0x6c')][_0x0199('0x6e')]['fields']?_0x54700b['queryResult'][_0x0199('0x6e')][_0x0199('0x6f')][_0x0199('0x70')]['boolValue']:![],'fulfillmentText':_0x54700b[_0x0199('0x6c')]['fulfillmentText'],'intentName':_0x54700b['queryResult']['intent']['name'],'intentDisplayName':_0x54700b[_0x0199('0x6c')]['intent'][_0x0199('0x71')],'isFallbackIntent':_0x54700b['queryResult'][_0x0199('0x72')][_0x0199('0x73')],'languageCode':_0x54700b[_0x0199('0x6c')][_0x0199('0x74')],'queryText':_0x54700b[_0x0199('0x6c')]['queryText'],'responseId':_0x54700b[_0x0199('0x75')],'score':_0x54700b[_0x0199('0x6c')][_0x0199('0x76')],'speech':_0x54700b[_0x0199('0x6c')][_0x0199('0x77')],'providerResponse':JSON[_0x0199('0x43')](_0x13ac65)};return _0x43194c;}}});};exports['tildeASR']=function(_0x2e24a7,_0x1e0641,_0x53ee4e,_0x36a961){return tilde['asr'](_0x2e24a7,_0x1e0641,_0x53ee4e,_0x36a961)[_0x0199('0x29')](function(_0x291bc5){try{fs[_0x0199('0x1f')](_0x2e24a7);}catch(_0x2bf8f4){logger['error'](_0x2bf8f4);}logger[_0x0199('0x1d')]('Tilde\x20ASR\x20transcription',_0x291bc5[_0x0199('0x52')]);logger[_0x0199('0x1d')](_0x0199('0x78'),_0x291bc5[_0x0199('0x54')]);return _0x291bc5;});};exports['awsPolly']=function(_0xe28edf,_0x3dd829,_0x573d45,_0x1ca6ce,_0x588394,_0x54c44d){var _0x50184a=path[_0x0199('0x25')](__dirname,_0x0199('0x26'),rs[_0x0199('0x38')](0x4)+_0x0199('0x39'));var _0x44eb4e;return aws['polly'](_0xe28edf,_0x3dd829,_0x573d45,_0x1ca6ce,_0x588394,_0x54c44d,_0x50184a)['then'](function(){_0x44eb4e=path[_0x0199('0x25')](__dirname,'tmp',rs[_0x0199('0x38')](0x4)+_0x0199('0x3c'));return convertFile(_0x50184a,_0x44eb4e);})[_0x0199('0x29')](function(){try{fs[_0x0199('0x1f')](_0x50184a);fs[_0x0199('0x2a')](_0x44eb4e,_0x0199('0x2b'));}catch(_0x2d2872){logger['error'](_0x2d2872);}return _0x44eb4e[_0x0199('0x2c')]('.')[0x0];});};exports[_0x0199('0x79')]=function(_0x1760b5,_0x3f105a,_0x20fbe1,_0x5f4fc9,_0x850516,_0x526f28){return aws[_0x0199('0x7a')](_0x1760b5,_0x3f105a,_0x20fbe1,_0x5f4fc9,_0x850516,_0x526f28)[_0x0199('0x29')](function(_0x1cfded){logger['info'](JSON[_0x0199('0x43')](_0x1cfded));return _0x1cfded;});};exports[_0x0199('0x7b')]=function(_0x3091c6,_0x23e721,_0x12c232,_0x32e19b){var _0x455eeb=util[_0x0199('0x7c')](_0x0199('0x7d'),ISPEECH_API,_0x3091c6,encodeURIComponent(_0x23e721),_0x12c232,_0x32e19b);var _0x100ad4=path[_0x0199('0x25')](__dirname,_0x0199('0x26'),rs['generate'](0x4)+'.mp3');var _0x156297;return downloadFile(_0x455eeb,_0x100ad4)[_0x0199('0x29')](function(){_0x156297=path[_0x0199('0x25')](__dirname,'tmp',rs[_0x0199('0x38')](0x4)+'.wav');return convertFile(_0x100ad4,_0x156297);})[_0x0199('0x29')](function(){try{fs[_0x0199('0x1f')](_0x100ad4);fs[_0x0199('0x2a')](_0x156297,_0x0199('0x2b'));}catch(_0x58459b){logger[_0x0199('0x18')](_0x58459b);}return _0x156297['split']('.')[0x0];});};exports[_0x0199('0x7e')]=function(_0x2ae4bd,_0x582158,_0x4fc76d,_0x560d24){var _0x1f3d81=util[_0x0199('0x7c')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x582158,_0x4fc76d,base64Encode(_0x2ae4bd),_0x560d24?util[_0x0199('0x7c')](_0x0199('0x7f'),encodeURIComponent(_0x560d24)):_0x0199('0x80'));return uploadFile(_0x1f3d81)[_0x0199('0x29')](function(_0x5ee45a){return querystring['parse'](_0x5ee45a);});};exports[_0x0199('0x81')]=function(_0x4494a3,_0x6476f8){return sestek['nda'](_0x4494a3,_0x6476f8)[_0x0199('0x29')](function(_0x3dfa37){logger[_0x0199('0x1d')](JSON['stringify'](_0x3dfa37));var _0xab84d9={'speech':_0x3dfa37[_0x0199('0x82')],'action':_0x3dfa37[_0x0199('0x83')]?_0x3dfa37[_0x0199('0x83')]['CustomAction']:undefined,'actiondata':_0x3dfa37[_0x0199('0x83')]?_0x3dfa37['channelData'][_0x0199('0x84')]:undefined};if(_0x3dfa37[_0x0199('0x83')]&&_0x3dfa37[_0x0199('0x83')][_0x0199('0x85')]){return base64Decode(_0x3dfa37[_0x0199('0x83')]['AudioFromTts'][_0x0199('0x86')],path[_0x0199('0x25')](__dirname,_0x0199('0x26'),rs[_0x0199('0x38')](0x4)+'.wav'))[_0x0199('0x29')](function(_0x1fbebe){_0xab84d9['audiofile']=_0x1fbebe;return _0xab84d9;});}return _0xab84d9;});};exports[_0x0199('0x87')]=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index a623756..949a5ae 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 _0xfdfd=['exports','./nda'];(function(_0x2cc137,_0x3962f5){var _0x154c3e=function(_0x565903){while(--_0x565903){_0x2cc137['push'](_0x2cc137['shift']());}};_0x154c3e(++_0x3962f5);}(_0xfdfd,0xd3));var _0xdfdf=function(_0x4e53a2,_0x5282b9){_0x4e53a2=_0x4e53a2-0x0;var _0x575ab6=_0xfdfd[_0x4e53a2];return _0x575ab6;};var nda=require(_0xdfdf('0x0'));module[_0xdfdf('0x1')]={'nda':nda}; \ No newline at end of file +var _0x322d=['./nda','exports'];(function(_0x221a00,_0x22795b){var _0x12e2d6=function(_0x155118){while(--_0x155118){_0x221a00['push'](_0x221a00['shift']());}};_0x12e2d6(++_0x22795b);}(_0x322d,0xde));var _0xd322=function(_0x4cd2aa,_0x19a600){_0x4cd2aa=_0x4cd2aa-0x0;var _0x2c2c7e=_0x322d[_0x4cd2aa];return _0x2c2c7e;};var nda=require(_0xd322('0x0'));module[_0xd322('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index d750709..5f70162 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 _0xadcc=['agi','exports','resolve','ndauth_url','/token','password','username','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','uniqueid','callerid','dnid','extension','text','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomActionData','custom_action_data','info','request-promise','../../../../../config/logger'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xadcc,0x76));var _0xcadc=function(_0x57d2e8,_0x1cc4ce){_0x57d2e8=_0x57d2e8-0x0;var _0x2f1314=_0xadcc[_0x57d2e8];return _0x2f1314;};'use strict';var rp=require(_0xcadc('0x0'));var url=require('url');var logger=require(_0xcadc('0x1'))(_0xcadc('0x2'));module[_0xcadc('0x3')]=function(_0x359d33,_0x2c174f){var _0x4d0dc0={'method':'POST','uri':url[_0xcadc('0x4')](_0x2c174f[_0xcadc('0x5')],_0xcadc('0x6')),'form':{'grant_type':_0xcadc('0x7'),'username':_0x2c174f[_0xcadc('0x8')],'password':_0x2c174f[_0xcadc('0x7')]},'json':!![]};return rp(_0x4d0dc0)[_0xcadc('0x9')](function(_0x346f54){var _0x1d3edf={'method':_0xcadc('0xa'),'uri':url[_0xcadc('0x4')](_0x2c174f[_0xcadc('0xb')],_0xcadc('0xc')),'body':{'type':_0x2c174f[_0xcadc('0xd')]||'message','channelId':'Nda','conversation':{'id':_0x359d33[_0xcadc('0xe')]},'from':{'id':_0x359d33[_0xcadc('0xf')],'name':_0x359d33['calleridname']},'recipient':{'id':_0x359d33[_0xcadc('0x10')],'name':_0x359d33[_0xcadc('0x11')]},'text':_0x2c174f[_0xcadc('0x12')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x346f54['access_token']},'json':!![]};if(_0x2c174f[_0xcadc('0x13')]){_0x1d3edf[_0xcadc('0x14')][_0xcadc('0x15')][_0xcadc('0x16')]=_0x2c174f['project'];}if(_0x2c174f[_0xcadc('0x17')]=='1'){_0x1d3edf['body'][_0xcadc('0x15')][_0xcadc('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xcadc('0x19')};}if(_0x2c174f['custom_action']){_0x1d3edf[_0xcadc('0x14')][_0xcadc('0x15')]['CustomAction']=_0x2c174f[_0xcadc('0x1a')];if(_0x2c174f['custom_action_data']){_0x1d3edf[_0xcadc('0x14')][_0xcadc('0x15')][_0xcadc('0x1b')]=_0x2c174f[_0xcadc('0x1c')];}}logger[_0xcadc('0x1d')](JSON['stringify'](_0x1d3edf));return rp(_0x1d3edf);});}; \ No newline at end of file +var _0x26bc=['ndauth_url','password','username','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','calleridname','dnid','extension','text','Bearer\x20','access_token','body','project','ndagenerate_audio','channelData','audio/wav','custom_action','CustomAction','custom_action_data','request-promise','url','../../../../../config/logger','agi','exports','POST'];(function(_0x4bf2e0,_0x4eb0e5){var _0x121a8b=function(_0x1586b8){while(--_0x1586b8){_0x4bf2e0['push'](_0x4bf2e0['shift']());}};_0x121a8b(++_0x4eb0e5);}(_0x26bc,0x162));var _0xc26b=function(_0x45542a,_0xf0fe05){_0x45542a=_0x45542a-0x0;var _0x49f515=_0x26bc[_0x45542a];return _0x49f515;};'use strict';var rp=require(_0xc26b('0x0'));var url=require(_0xc26b('0x1'));var logger=require(_0xc26b('0x2'))(_0xc26b('0x3'));module[_0xc26b('0x4')]=function(_0x4eda53,_0x21c373){var _0x1bb460={'method':_0xc26b('0x5'),'uri':url['resolve'](_0x21c373[_0xc26b('0x6')],'/token'),'form':{'grant_type':_0xc26b('0x7'),'username':_0x21c373[_0xc26b('0x8')],'password':_0x21c373[_0xc26b('0x7')]},'json':!![]};return rp(_0x1bb460)['then'](function(_0x11c6f5){var _0x453491={'method':_0xc26b('0x5'),'uri':url[_0xc26b('0x9')](_0x21c373[_0xc26b('0xa')],_0xc26b('0xb')),'body':{'type':_0x21c373[_0xc26b('0xc')]||_0xc26b('0xd'),'channelId':_0xc26b('0xe'),'conversation':{'id':_0x4eda53[_0xc26b('0xf')]},'from':{'id':_0x4eda53['callerid'],'name':_0x4eda53[_0xc26b('0x10')]},'recipient':{'id':_0x4eda53[_0xc26b('0x11')],'name':_0x4eda53[_0xc26b('0x12')]},'text':_0x21c373[_0xc26b('0x13')],'channelData':{}},'headers':{'Authorization':_0xc26b('0x14')+_0x11c6f5[_0xc26b('0x15')]},'json':!![]};if(_0x21c373['project']){_0x453491[_0xc26b('0x16')]['channelData']['ProjectName']=_0x21c373[_0xc26b('0x17')];}if(_0x21c373[_0xc26b('0x18')]=='1'){_0x453491[_0xc26b('0x16')][_0xc26b('0x19')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xc26b('0x1a')};}if(_0x21c373[_0xc26b('0x1b')]){_0x453491[_0xc26b('0x16')][_0xc26b('0x19')][_0xc26b('0x1c')]=_0x21c373[_0xc26b('0x1b')];if(_0x21c373['custom_action_data']){_0x453491[_0xc26b('0x16')][_0xc26b('0x19')]['CustomActionData']=_0x21c373[_0xc26b('0x1d')];}}logger['info'](JSON['stringify'](_0x453491));return rp(_0x453491);});}; \ 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 e37534f..a07af0f 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 _0xbad4=['exports','./lib/api'];(function(_0x3a2432,_0x568c73){var _0x249f86=function(_0x17c73c){while(--_0x17c73c){_0x3a2432['push'](_0x3a2432['shift']());}};_0x249f86(++_0x568c73);}(_0xbad4,0x175));var _0x4bad=function(_0x14eacd,_0x184347){_0x14eacd=_0x14eacd-0x0;var _0x299df5=_0xbad4[_0x14eacd];return _0x299df5;};'use strict';var asr=require(_0x4bad('0x0'));module[_0x4bad('0x1')]=function(_0x258ea9,_0x3e197c,_0x41f886,_0x15b2a3){return asr(_0x258ea9,_0x3e197c,_0x41f886,_0x15b2a3);}; \ No newline at end of file +var _0x7ba7=['exports','./lib/api'];(function(_0x326d35,_0x4f65b3){var _0xd3f8f3=function(_0x1fbbaf){while(--_0x1fbbaf){_0x326d35['push'](_0x326d35['shift']());}};_0xd3f8f3(++_0x4f65b3);}(_0x7ba7,0xf3));var _0x77ba=function(_0xce3a0b,_0x5b271b){_0xce3a0b=_0xce3a0b-0x0;var _0x1ca1b9=_0x7ba7[_0xce3a0b];return _0x1ca1b9;};'use strict';var asr=require(_0x77ba('0x0'));module[_0x77ba('0x1')]=function(_0xa47b58,_0xc83a53,_0x340e98,_0x306444){return asr(_0xa47b58,_0xc83a53,_0x340e98,_0x306444);}; \ 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 c15e631..7aa75d1 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 _0xd15e=['Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','error','terminate','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','../../../../../../config/logger','agi','exports','info'];(function(_0x30043d,_0x3f11e2){var _0x47d8c3=function(_0x338f38){while(--_0x338f38){_0x30043d['push'](_0x30043d['shift']());}};_0x47d8c3(++_0x3f11e2);}(_0xd15e,0x158));var _0xed15=function(_0x19f239,_0x2e23c7){_0x19f239=_0x19f239-0x0;var _0x502543=_0xd15e[_0x19f239];return _0x502543;};'use strict';var BPromise=require(_0xed15('0x0'));var _=require(_0xed15('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xed15('0x2'));var crypto=require('crypto');var logger=require(_0xed15('0x3'))(_0xed15('0x4'));module[_0xed15('0x5')]=function(_0x4e3037,_0x4c0fe9,_0x3de764,_0x24b78f){return new BPromise(function(_0x3c0f38,_0xa28e15){logger[_0xed15('0x6')](_0xed15('0x7'),_0x24b78f||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x410c52=new WebSocket(_0x24b78f||_0xed15('0x8'),{'perMessageDeflate':![]});var _0xa5cdad='';var _0x4d8701='0';var _0x1c3d18='1';var _0x59bbc9='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x45879d(_0x4524f6){var _0x20d57e=crypto[_0xed15('0x9')](_0xed15('0xa'));_0x20d57e[_0xed15('0xb')](_0x4524f6);return _0x20d57e['digest'](_0xed15('0xc'));}function _0x5d7b36(){try{logger[_0xed15('0x6')](_0xed15('0xd'));var _0x401441=moment()[_0xed15('0xe')]();var _0x1e13f2=_0x45879d(_0x401441+_0x4c0fe9+_0x3de764);_0x410c52[_0xed15('0xf')](JSON[_0xed15('0x10')]({'appID':_0x4c0fe9,'timestamp':_0x401441,'appKey':_0x1e13f2}));var _0x43cee5=fs[_0xed15('0x11')](_0x4e3037);_0x43cee5['on'](_0xed15('0x12'),function(_0x12aecc){_0x410c52[_0xed15('0xf')](_0x12aecc);});_0x43cee5['on'](_0xed15('0x13'),function(){_0x410c52[_0xed15('0xf')](_0xed15('0x14'));});}catch(_0x476be8){logger[_0xed15('0x15')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x476be8));_0x410c52[_0xed15('0x16')]();}}function _0x129f1f(_0x622341){try{if(_0x622341){var _0x19b3bc=JSON['parse'](_0x622341);switch(_0x19b3bc[_0xed15('0x17')]){case 0x0:if(_0x19b3bc[_0xed15('0x18')]){if(_0x19b3bc['result'][_0xed15('0x19')]){logger[_0xed15('0x6')](_0xed15('0x1a'),JSON[_0xed15('0x10')](_0x19b3bc[_0xed15('0x18')][_0xed15('0x1b')]));_0xa5cdad=_0x19b3bc[_0xed15('0x18')][_0xed15('0x1b')][0x0]['transcript'];_0x4d8701=_0x19b3bc['result'][_0xed15('0x1b')][0x0]['likelihood'];_0x1c3d18='0';_0x59bbc9=_0xed15('0x1c');_0x410c52['terminate']();}}break;case 0x1:logger[_0xed15('0x6')](_0xed15('0x1d'));_0x1c3d18='1';_0x59bbc9=_0xed15('0x1d');break;case 0x2:logger[_0xed15('0x6')](_0xed15('0x1e'));_0x1c3d18='2';_0x59bbc9=_0xed15('0x1e');break;case 0x9:logger[_0xed15('0x6')](_0xed15('0x1f'));_0x1c3d18='9';_0x59bbc9='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0xed15('0x6')](_0xed15('0x20'));_0x1c3d18='10';_0x59bbc9='Authentication\x20failed.';break;case 0xb:logger[_0xed15('0x6')](_0xed15('0x21'));_0x1c3d18='11';_0x59bbc9=_0xed15('0x21');}}}catch(_0x2b6d94){logger[_0xed15('0x15')]('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x2b6d94));_0x410c52[_0xed15('0x16')]();}}function _0x3046aa(){logger[_0xed15('0x6')](_0xed15('0x22'));_0x3c0f38({'transcript':_0xa5cdad,'confidence':_0x4d8701,'status':_0x1c3d18,'status_message':_0x59bbc9});}function _0x329684(_0x10ffb5){logger[_0xed15('0x15')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xed15('0x23')](_0x10ffb5)){logger[_0xed15('0x15')](_[_0xed15('0x24')](_0x10ffb5)?JSON[_0xed15('0x10')](_0x10ffb5):_0x10ffb5);}}_0x410c52['on'](_0xed15('0x25'),_0x5d7b36);_0x410c52['on'](_0xed15('0x26'),_0x129f1f);_0x410c52['on'](_0xed15('0x13'),_0x3046aa);_0x410c52['on'](_0xed15('0x15'),_0x329684);});}; \ No newline at end of file +var _0x842c=['Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','crypto','../../../../../../config/logger','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','createHash','sha1','hex','Open\x20Tilde\x20ASR\x20socket','unix','createReadStream','data','send','close','EOS','Tilde\x20ASR\x20send\x20error','stringify','terminate','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.'];(function(_0x2429ee,_0x207a39){var _0x2851bd=function(_0x1f38d7){while(--_0x1f38d7){_0x2429ee['push'](_0x2429ee['shift']());}};_0x2851bd(++_0x207a39);}(_0x842c,0x120));var _0xc842=function(_0x328335,_0x1d68bb){_0x328335=_0x328335-0x0;var _0x95bfd=_0x842c[_0x328335];return _0x95bfd;};'use strict';var BPromise=require(_0xc842('0x0'));var _=require(_0xc842('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xc842('0x2'));var logger=require(_0xc842('0x3'))('agi');module['exports']=function(_0x3a73d0,_0x1a2c94,_0x316532,_0xd7ea1f){return new BPromise(function(_0x2af466,_0x2b3cfe){logger[_0xc842('0x4')]('Tilde\x20URI',_0xd7ea1f||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x476bf7=new WebSocket(_0xd7ea1f||_0xc842('0x5'),{'perMessageDeflate':![]});var _0x1d5961='';var _0xea7d54='0';var _0x1c86a9='1';var _0x538d1e=_0xc842('0x6');function _0x2b040c(_0xb06f6b){var _0x2f1cac=crypto[_0xc842('0x7')](_0xc842('0x8'));_0x2f1cac['update'](_0xb06f6b);return _0x2f1cac['digest'](_0xc842('0x9'));}function _0x22ad66(){try{logger['info'](_0xc842('0xa'));var _0x17b0df=moment()[_0xc842('0xb')]();var _0x5327d0=_0x2b040c(_0x17b0df+_0x1a2c94+_0x316532);_0x476bf7['send'](JSON['stringify']({'appID':_0x1a2c94,'timestamp':_0x17b0df,'appKey':_0x5327d0}));var _0x320ca7=fs[_0xc842('0xc')](_0x3a73d0);_0x320ca7['on'](_0xc842('0xd'),function(_0x2a462e){_0x476bf7[_0xc842('0xe')](_0x2a462e);});_0x320ca7['on'](_0xc842('0xf'),function(){_0x476bf7[_0xc842('0xe')](_0xc842('0x10'));});}catch(_0x5805f5){logger['error'](_0xc842('0x11'),JSON[_0xc842('0x12')](_0x5805f5));_0x476bf7[_0xc842('0x13')]();}}function _0x2b46c0(_0x43b29d){try{if(_0x43b29d){var _0x3af8c0=JSON['parse'](_0x43b29d);switch(_0x3af8c0['status']){case 0x0:if(_0x3af8c0[_0xc842('0x14')]){if(_0x3af8c0[_0xc842('0x14')][_0xc842('0x15')]){logger[_0xc842('0x4')](_0xc842('0x16'),JSON[_0xc842('0x12')](_0x3af8c0['result'][_0xc842('0x17')]));_0x1d5961=_0x3af8c0[_0xc842('0x14')][_0xc842('0x17')][0x0][_0xc842('0x18')];_0xea7d54=_0x3af8c0[_0xc842('0x14')][_0xc842('0x17')][0x0]['likelihood'];_0x1c86a9='0';_0x538d1e='Success.';_0x476bf7[_0xc842('0x13')]();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x1c86a9='1';_0x538d1e=_0xc842('0x6');break;case 0x2:logger[_0xc842('0x4')](_0xc842('0x19'));_0x1c86a9='2';_0x538d1e=_0xc842('0x19');break;case 0x9:logger[_0xc842('0x4')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x1c86a9='9';_0x538d1e=_0xc842('0x1a');break;case 0xa:logger['info'](_0xc842('0x1b'));_0x1c86a9='10';_0x538d1e='Authentication\x20failed.';break;case 0xb:logger[_0xc842('0x4')](_0xc842('0x1c'));_0x1c86a9='11';_0x538d1e=_0xc842('0x1c');}}}catch(_0x34ec81){logger[_0xc842('0x1d')]('Tilde\x20ASR\x20parse\x20error',JSON[_0xc842('0x12')](_0x34ec81));_0x476bf7[_0xc842('0x13')]();}}function _0x815f8(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x2af466({'transcript':_0x1d5961,'confidence':_0xea7d54,'status':_0x1c86a9,'status_message':_0x538d1e});}function _0x12acb1(_0x39bea1){logger[_0xc842('0x1d')](_0xc842('0x1e'));if(!_[_0xc842('0x1f')](_0x39bea1)){logger[_0xc842('0x1d')](_[_0xc842('0x20')](_0x39bea1)?JSON[_0xc842('0x12')](_0x39bea1):_0x39bea1);}}_0x476bf7['on'](_0xc842('0x21'),_0x22ad66);_0x476bf7['on'](_0xc842('0x22'),_0x2b46c0);_0x476bf7['on'](_0xc842('0xf'),_0x815f8);_0x476bf7['on'](_0xc842('0x1d'),_0x12acb1);});}; \ 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 8e57c20..8ffc9ce 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 _0xba33=['exports','./asr'];(function(_0x12aaee,_0x5bf50c){var _0x37c350=function(_0x182775){while(--_0x182775){_0x12aaee['push'](_0x12aaee['shift']());}};_0x37c350(++_0x5bf50c);}(_0xba33,0x1c3));var _0x3ba3=function(_0x472a7c,_0x15d532){_0x472a7c=_0x472a7c-0x0;var _0x3f8a7f=_0xba33[_0x472a7c];return _0x3f8a7f;};var asr=require(_0x3ba3('0x0'));module[_0x3ba3('0x1')]={'asr':asr}; \ No newline at end of file +var _0x56ca=['exports','./asr'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x56ca,0xff));var _0xa56c=function(_0x1a4b85,_0x15495a){_0x1a4b85=_0x1a4b85-0x0;var _0x549c6b=_0x56ca[_0x1a4b85];return _0x549c6b;};var asr=require(_0xa56c('0x0'));module[_0xa56c('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 98c6b64..e7c7428 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 _0xeb31=['net','EventEmitter','./channel','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util'];(function(_0x3775c1,_0x5cdb06){var _0x1bf932=function(_0x4e4a5f){while(--_0x4e4a5f){_0x3775c1['push'](_0x3775c1['shift']());}};_0x1bf932(++_0x5cdb06);}(_0xeb31,0x18e));var _0x1eb3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeb31[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x1eb3('0x0'));var net=require(_0x1eb3('0x1'));var EventEmitter=require('events')[_0x1eb3('0x2')];var AGIError=require('./error');var AGIChannel=require(_0x1eb3('0x3'));var AGIServer=function(_0x1cd80d,_0x4de635,_0x18f863){var _0x190a77=this,_0x1cd80d=_0x1cd80d||0x11dd,_0x4de635=_0x4de635||'127.0.0.1',_0x4561ec=null,_0x336a9a=0x0;EventEmitter[_0x1eb3('0x4')](_0x190a77);function _0x5d24d5(){if(!_0x1cd80d){_0x190a77[_0x1eb3('0x5')](_0x1eb3('0x6'),new AGIError(_0x1eb3('0x7')));return![];}_0x4561ec=net[_0x1eb3('0x8')]();_0x4561ec[_0x1eb3('0x9')](_0x1cd80d,_0x4de635);_0x4561ec['on'](_0x1eb3('0xa'),function(){_0x190a77[_0x1eb3('0x5')]('listening');});_0x4561ec['on'](_0x1eb3('0xb'),function(_0x534d1e){_0x4561ec['getConnections'](function(_0x29cd10,_0x4c9232){if(_0x29cd10){_0x190a77['emit'](_0x1eb3('0x6'),new AGIError(_0x1eb3('0xc'),_0x29cd10));}else if(_0x18f863&&_0x18f863<0x0){_0x190a77[_0x1eb3('0x5')]('error',new AGIError(_0x1eb3('0xd')));_0x534d1e[_0x1eb3('0xe')]();}else if(_0x18f863&&_0x18f863>0x0&&_0x18f863<_0x4c9232){_0x336a9a+=0x1;_0x190a77[_0x1eb3('0x5')]('error',new AGIError(_0x1eb3('0xf'),_0x336a9a));_0x534d1e[_0x1eb3('0xe')]();}else{var _0x20fb00=new AGIChannel(_0x534d1e);_0x20fb00['on']('ready',function(){_0x190a77[_0x1eb3('0x5')](_0x1eb3('0xb'),_0x20fb00);});}});});_0x4561ec['on'](_0x1eb3('0x6'),function(_0x4e6ee8){_0x190a77['emit']('error',new AGIError(_0x1eb3('0xc'),_0x4e6ee8['code']));});_0x4561ec['on'](_0x1eb3('0x10'),function(){_0x190a77[_0x1eb3('0x5')]('close',new AGIError(_0x1eb3('0x11')));});}process[_0x1eb3('0x12')](function(){_0x5d24d5();});};util[_0x1eb3('0x13')](AGIServer,EventEmitter);module[_0x1eb3('0x14')]=function(_0x442519,_0x9f457f,_0x433b60){return new AGIServer(_0x442519,_0x9f457f,_0x433b60);}; \ No newline at end of file +var _0xf3d7=['listen','listening','emit','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','inherits','exports','net','EventEmitter','./error','./channel','127.0.0.1','call','E_AGI_ARGUMENT_PORT'];(function(_0x2534ba,_0x4792a4){var _0x456ce6=function(_0x2234ce){while(--_0x2234ce){_0x2534ba['push'](_0x2534ba['shift']());}};_0x456ce6(++_0x4792a4);}(_0xf3d7,0x19d));var _0x7f3d=function(_0xd06a8b,_0x3ce43e){_0xd06a8b=_0xd06a8b-0x0;var _0xe9b203=_0xf3d7[_0xd06a8b];return _0xe9b203;};'use strict';var util=require('util');var net=require(_0x7f3d('0x0'));var EventEmitter=require('events')[_0x7f3d('0x1')];var AGIError=require(_0x7f3d('0x2'));var AGIChannel=require(_0x7f3d('0x3'));var AGIServer=function(_0x2993dc,_0x3f7e65,_0x3ab912){var _0x3f76ad=this,_0x2993dc=_0x2993dc||0x11dd,_0x3f7e65=_0x3f7e65||_0x7f3d('0x4'),_0x4c2f84=null,_0x214ece=0x0;EventEmitter[_0x7f3d('0x5')](_0x3f76ad);function _0x5c4a24(){if(!_0x2993dc){_0x3f76ad['emit']('error',new AGIError(_0x7f3d('0x6')));return![];}_0x4c2f84=net['createServer']();_0x4c2f84[_0x7f3d('0x7')](_0x2993dc,_0x3f7e65);_0x4c2f84['on'](_0x7f3d('0x8'),function(){_0x3f76ad[_0x7f3d('0x9')](_0x7f3d('0x8'));});_0x4c2f84['on']('connection',function(_0x365791){_0x4c2f84[_0x7f3d('0xa')](function(_0x38b03a,_0x1499e8){if(_0x38b03a){_0x3f76ad[_0x7f3d('0x9')](_0x7f3d('0xb'),new AGIError('E_AGI_SERVER_ERROR',_0x38b03a));}else if(_0x3ab912&&_0x3ab912<0x0){_0x3f76ad['emit'](_0x7f3d('0xb'),new AGIError(_0x7f3d('0xc')));_0x365791['destroy']();}else if(_0x3ab912&&_0x3ab912>0x0&&_0x3ab912<_0x1499e8){_0x214ece+=0x1;_0x3f76ad[_0x7f3d('0x9')](_0x7f3d('0xb'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x214ece));_0x365791[_0x7f3d('0xd')]();}else{var _0x23ee52=new AGIChannel(_0x365791);_0x23ee52['on']('ready',function(){_0x3f76ad[_0x7f3d('0x9')]('connection',_0x23ee52);});}});});_0x4c2f84['on'](_0x7f3d('0xb'),function(_0x59b113){_0x3f76ad[_0x7f3d('0x9')]('error',new AGIError(_0x7f3d('0xe'),_0x59b113[_0x7f3d('0xf')]));});_0x4c2f84['on'](_0x7f3d('0x10'),function(){_0x3f76ad[_0x7f3d('0x9')](_0x7f3d('0x10'),new AGIError(_0x7f3d('0x11')));});}process['nextTick'](function(){_0x5c4a24();});};util[_0x7f3d('0x12')](AGIServer,EventEmitter);module[_0x7f3d('0x13')]=function(_0x2e7b3d,_0x124746,_0x14e392){return new AGIServer(_0x2e7b3d,_0x124746,_0x14e392);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 86fa7e5..4be8a8e 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 _0x8e6d=['Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','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','intKey','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeechTTS','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','Enter\x20in\x20LOGOUT\x20(%s)\x20block','failure','operation','math\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable\x20%s[key]\x20set','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','getSound','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','%s_STATUS_CODE','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','account_id','no\x20mail\x20account\x20configured','Smtp','bcc','subject','service','host','secure','authentication','user','pass','template_id','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/environment','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','channel','rpc','mailRpc','prototype','getVariableById','then','getVoiceQueueById','name','catch','getSquareProject','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','interval','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','toUpperCase','body','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','sestekNDA','key','ispeech_tts_language','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','Amy','aws_lex_region','aws_bot_name','google_asr_language','tildeASR','appsecret','clear','isString','replaceObjectAllVariables','hasOwnProperty','isPlainObject','isArray','length','recursiveNodeIndex','replaceAllVariables','saveRestApiResult','%s.%s','setVariable','replaceAll','getAndSetVariable','getVariable','result','extra','maxRetry','retry','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','agi','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','add','minutes','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20found','forEach','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','opts','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','DIALOGFLOW_%s','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20private_key\x20configured','dialogflowV2_language','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','mindigit','hiddendigitsnum','substr','generate','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','awspolly','aws_secret_access_key','aws\x20Polly\x20%s\x20file\x20created','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','awsLex','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','NOBEEP','google\x20%s\x20file\x20created','googleASR','GoogleASR\x20Result\x20%s','tildeasr','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','beep','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s'];(function(_0x31557d,_0x18bba7){var _0x31d555=function(_0x1b4742){while(--_0x1b4742){_0x31557d['push'](_0x31557d['shift']());}};_0x31d555(++_0x18bba7);}(_0x8e6d,0x92));var _0xd8e6=function(_0x24f35f,_0x3d8629){_0x24f35f=_0x24f35f-0x0;var _0x5b8737=_0x8e6d[_0x24f35f];return _0x5b8737;};'use strict';var fs=require('fs');var path=require(_0xd8e6('0x0'));var util=require(_0xd8e6('0x1'));var _=require(_0xd8e6('0x2'));var sh=require(_0xd8e6('0x3'));var odbc=require(_0xd8e6('0x4'))();var rs=require(_0xd8e6('0x5'));var moment=require(_0xd8e6('0x6'));var Mustache=require(_0xd8e6('0x7'));var rp=require(_0xd8e6('0x8'));var logger=require('../../config/logger')('agi');var config=require(_0xd8e6('0x9'));var scripts=require('./scripts');var FILES_PATH=_0xd8e6('0xa');var recursiveMapAttributes=[_0xd8e6('0xb'),'rawBody'];var verticesWithRetry=[_0xd8e6('0xc'),_0xd8e6('0xd'),'getsecretdigits'];var AGIVertices=function(_0x3415bc,_0x4ba14b,_0x49bf99){this[_0xd8e6('0xe')]=_0x3415bc;this[_0xd8e6('0xf')]=_0x4ba14b;this[_0xd8e6('0x10')]=_0x49bf99;};AGIVertices[_0xd8e6('0x11')]['getVariable']=function(_0x5e09e7,_0x2eb114){this['rpc'][_0xd8e6('0x12')](_0x5e09e7)[_0xd8e6('0x13')](function(_0x5e29be){_0x2eb114(null,_0x5e29be?_0x5e29be['name']:![]);})['catch'](function(_0x150a5c){_0x2eb114(_0x150a5c);});};AGIVertices[_0xd8e6('0x11')]['getVoiceQueue']=function(_0x2ded9a,_0x137775){this[_0xd8e6('0xf')][_0xd8e6('0x14')](_0x2ded9a)[_0xd8e6('0x13')](function(_0x20eeb9){_0x137775(null,_0x20eeb9?_0x20eeb9[_0xd8e6('0x15')]:![]);})[_0xd8e6('0x16')](function(_0xd848f7){_0x137775(_0xd848f7);});};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x17')]=function(_0x12919a,_0x5030e3){this['rpc']['getSquareProjectById'](_0x12919a)['then'](function(_0x9f2bf0){_0x5030e3(null,_0x9f2bf0?_0x9f2bf0[_0xd8e6('0x15')]:![]);})[_0xd8e6('0x16')](function(_0x19d378){_0x5030e3(_0x19d378);});};AGIVertices['prototype']['getSquareOdbc']=function(_0x47f56b,_0x5a9663){this[_0xd8e6('0xf')][_0xd8e6('0x18')](_0x47f56b)['then'](function(_0x207b6c){_0x5a9663(null,_0x207b6c?_0x207b6c[_0xd8e6('0x19')]:![]);})['catch'](function(_0x1fe371){_0x5a9663(_0x1fe371);});};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x1a')]=function(_0x2dae56,_0x3039c7){this['rpc'][_0xd8e6('0x1b')](_0x2dae56)[_0xd8e6('0x13')](function(_0x5974a9){_0x3039c7(null,_0x5974a9?_0x5974a9[_0xd8e6('0x15')]:![]);})[_0xd8e6('0x16')](function(_0x25cd16){_0x3039c7(_0x25cd16);});};AGIVertices['prototype'][_0xd8e6('0x1c')]=function(_0x5557f7,_0x37078d){this['rpc'][_0xd8e6('0x1d')](_0x5557f7)[_0xd8e6('0x13')](function(_0x11cb53){_0x37078d(null,_0x11cb53?_0x11cb53['name']:![]);})['catch'](function(_0x14f62f){_0x37078d(_0x14f62f);});};AGIVertices['prototype']['getSound']=function(_0x470267,_0x2723b0){var _0x34d1b9=this;this[_0xd8e6('0xf')][_0xd8e6('0x1e')](_0x470267)[_0xd8e6('0x13')](function(_0x1596c7){_0x2723b0(null,_0x1596c7?_0x34d1b9[_0xd8e6('0x1f')](_0x1596c7[_0xd8e6('0x20')]):![]);})[_0xd8e6('0x16')](function(_0x1a0463){_0x2723b0(_0x1a0463);});};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x21')]=function(_0x2b3124,_0x373d89){this[_0xd8e6('0xf')][_0xd8e6('0x22')](_0x2b3124)[_0xd8e6('0x13')](function(_0x457f0b){_0x373d89(null,_0x457f0b?_0x457f0b:![]);})[_0xd8e6('0x16')](function(_0x5a0bb6){_0x373d89(_0x5a0bb6);});};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x23')]=function(_0x17a577,_0x4a60a4,_0x1308a0){this[_0xd8e6('0x10')][_0xd8e6('0x23')](_0x17a577,_0x4a60a4)[_0xd8e6('0x13')](function(){_0x1308a0(null);})['catch'](function(_0x255ca4){_0x1308a0(_0x255ca4);});};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x24')]=function(_0x8e3c74,_0x22ae0a){this[_0xd8e6('0xf')][_0xd8e6('0x25')](_0x8e3c74)['then'](function(_0x18fc81){if(_0x18fc81){if(_0x18fc81['IntervalId']){_0x22ae0a(null,[_0x18fc81[_0xd8e6('0x26')]]);}else{_0x22ae0a(null,_['map'](_0x18fc81['Intervals'],'interval'));}}else{_0x22ae0a(null,![]);}})['catch'](function(_0x439917){_0x22ae0a(_0x439917);});};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x1f')]=function(_0x405e0f){return util[_0xd8e6('0x27')](_0xd8e6('0x28'),FILES_PATH,_0x405e0f);};AGIVertices['prototype'][_0xd8e6('0x29')]=function(_0x1baa9b,_0x299a5b,_0x1293b3){odbc['open'](_0x1baa9b,function(_0x188024){if(_0x188024){logger[_0xd8e6('0x2a')](_0xd8e6('0x2b'),_0x188024);_0x1293b3(_0x188024);}else{logger[_0xd8e6('0x2c')](_0xd8e6('0x2d'));odbc['query'](_0x299a5b,function(_0x4085b2,_0x23b6d5){if(_0x4085b2){logger[_0xd8e6('0x2c')](_0xd8e6('0x2e'),_0x299a5b);_0x1293b3(_0x4085b2);}else{logger[_0xd8e6('0x2c')]('Query\x20executed\x20correctly\x20%s',_0x299a5b);odbc[_0xd8e6('0x2f')](function(_0x9814cc){if(_0x9814cc){logger[_0xd8e6('0x2a')](_0xd8e6('0x30'),_0x9814cc);}_0x1293b3(null,_0x23b6d5);});}});}});};AGIVertices['prototype'][_0xd8e6('0x31')]=function(_0x32bf95,_0x2a58a7){this[_0xd8e6('0xf')][_0xd8e6('0x32')](_0x32bf95)[_0xd8e6('0x13')](function(_0x15af62){_0x2a58a7(null,_0x15af62?_0x15af62:![]);})[_0xd8e6('0x16')](function(_0x1f9776){_0x2a58a7(_0x1f9776);});};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x33')]=function(_0x3b4f09,_0x5c0314){this[_0xd8e6('0xf')][_0xd8e6('0x33')](_0x3b4f09)[_0xd8e6('0x13')](function(_0x3474b6){_0x5c0314(null,_0x3474b6);})['catch'](function(_0x32d851){_0x5c0314(_0x32d851);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x9dce9e,_0x1045f2,_0xa18ca2){this[_0xd8e6('0xf')][_0xd8e6('0x34')]({'uniqueid':this[_0xd8e6('0xe')][_0xd8e6('0x35')],'node':_0x9dce9e[_0xd8e6('0x36')],'application':_0x9dce9e[_0xd8e6('0x37')],'data':_0x1045f2||null,'project_name':this[_0xd8e6('0xe')][_0xd8e6('0x38')],'callerid':this['channel'][_0xd8e6('0x39')]})[_0xd8e6('0x13')](function(_0x1a9619){if(_0xa18ca2){_0xa18ca2(null,_0x1a9619);}})[_0xd8e6('0x16')](function(_0x5743bc){if(_0xa18ca2){_0xa18ca2(_0x5743bc);}});};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x3a')]=function(_0x1f7e35,_0x463dc8,_0x4a7ad6,_0x508001){this['rpc'][_0xd8e6('0x3a')]({'uniqueid':this[_0xd8e6('0xe')]['uniqueid'],'callerid':this[_0xd8e6('0xe')][_0xd8e6('0x39')],'calleridname':this[_0xd8e6('0xe')][_0xd8e6('0x3b')],'context':this[_0xd8e6('0xe')][_0xd8e6('0x3c')],'extension':this[_0xd8e6('0xe')][_0xd8e6('0x3d')],'priority':this[_0xd8e6('0xe')][_0xd8e6('0x3e')],'accountcode':this['channel'][_0xd8e6('0x3f')],'dnid':this[_0xd8e6('0xe')][_0xd8e6('0x40')],'projectName':this[_0xd8e6('0xe')][_0xd8e6('0x38')],'saveName':_0x463dc8,'filename':_0x1f7e35[_0xd8e6('0x41')]||_0x463dc8,'savePath':_0x4a7ad6})[_0xd8e6('0x13')](function(_0x2905a9){_0x508001(null,_0x2905a9);})[_0xd8e6('0x16')](function(_0x29cb82){_0x508001(_0x29cb82);});};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x42')]=function(_0x252bb0,_0x313c34,_0xa728d7,_0x3c24f4,_0x3e99a5){this[_0xd8e6('0xf')][_0xd8e6('0x42')]({'uniqueid':this['channel'][_0xd8e6('0x35')],'body':_0x252bb0,'direction':_0x313c34,'providerName':_0xa728d7,'providerResponse':_0x3c24f4})['then'](function(_0x1ecf8e){if(_0x3e99a5){_0x3e99a5(null,_0x1ecf8e);}})[_0xd8e6('0x16')](function(_0x41c8b5){if(_0x3e99a5){_0x3e99a5(_0x41c8b5);}});};AGIVertices[_0xd8e6('0x11')]['createCmContact']=function(_0x28fc15,_0x2fd8c5){this[_0xd8e6('0xf')][_0xd8e6('0x43')]({'firstName':_[_0xd8e6('0x44')](_0x28fc15[_0xd8e6('0x15')])||_[_0xd8e6('0x45')](_0x28fc15[_0xd8e6('0x15')])?_0xd8e6('0x46')+Math[_0xd8e6('0x47')]():_0x28fc15[_0xd8e6('0x15')],'lastName':_[_0xd8e6('0x44')](_0x28fc15[_0xd8e6('0x48')])||_[_0xd8e6('0x45')](_0x28fc15[_0xd8e6('0x48')])?null:_0x28fc15[_0xd8e6('0x48')],'phone':_0x28fc15[_0xd8e6('0x49')],'ListId':_0x28fc15[_0xd8e6('0x4a')],'scheduledat':_0x28fc15['scheduledAt'],'callbackUniqueid':this[_0xd8e6('0xe')][_0xd8e6('0x35')],'tags':_0xd8e6('0x4b'),'description':_0xd8e6('0x4c')+_0x28fc15[_0xd8e6('0x4d')][_0xd8e6('0x4e')](),'priority':_0x28fc15[_0xd8e6('0x4f')]})[_0xd8e6('0x13')](function(_0x432a7a){_0x2fd8c5(null,_0x432a7a);})[_0xd8e6('0x16')](function(_0x16e865){_0x2fd8c5(_0x16e865);});};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x50')]=function(_0x38184b,_0x37db13){this['rpc'][_0xd8e6('0x51')](_0x38184b)[_0xd8e6('0x13')](function(_0x51fb97){_0x37db13(null,_0x51fb97?_0x51fb97[_0xd8e6('0x15')]:![]);})[_0xd8e6('0x16')](function(_0x25f014){_0x37db13(_0x25f014);});};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x52')]=function(_0x4623d7,_0x238d7c,_0x41607a){var _0xe27cc3={'role':_0xd8e6('0x53')};_0xe27cc3[_0x4623d7]=this[_0xd8e6('0xe')][_0xd8e6('0x39')];this[_0xd8e6('0xf')][_0xd8e6('0x52')](_0xe27cc3,_0x238d7c,this['channel'][_0xd8e6('0x35')])[_0xd8e6('0x13')](function(_0x28435d){_0x41607a(null,_[_0xd8e6('0x45')](_0x28435d)?![]:!![]);})['catch'](function(_0x5cc8d2){logger[_0xd8e6('0x2a')](_0x5cc8d2);_0x41607a(null,![]);});};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x54')]=function(_0x289fe1,_0x352030){var _0x2abc02={'role':_0xd8e6('0x53')};_0x2abc02[_0x289fe1]=this['channel'][_0xd8e6('0x39')];this[_0xd8e6('0xf')]['agentUnpause'](_0x2abc02)['then'](function(_0x436871){_0x352030(null,_[_0xd8e6('0x45')](_0x436871)?![]:!![]);})[_0xd8e6('0x16')](function(_0x24ad77){logger[_0xd8e6('0x2a')](_0x24ad77);_0x352030(null,![]);});};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x55')]=function(_0xb8c804,_0x5a1572){var _0x24205f={'role':'agent'};_0x24205f[_0xb8c804]=this[_0xd8e6('0xe')][_0xd8e6('0x39')];this[_0xd8e6('0xf')]['agentLogout'](_0x24205f)['then'](function(_0x5d3325){_0x5a1572(null,_['isNil'](_0x5d3325)?![]:!![]);})[_0xd8e6('0x16')](function(_0x404635){logger[_0xd8e6('0x2a')](_0x404635);_0x5a1572(null,![]);});};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x56')]=function(_0x3a8a2e,_0x417fcf){var _0x1532d2={'role':_0xd8e6('0x53')};_0x1532d2[_0x3a8a2e]=this[_0xd8e6('0xe')][_0xd8e6('0x39')];var _0x4622c6=_0x3a8a2e!=_0xd8e6('0x57')?util[_0xd8e6('0x27')](_0xd8e6('0x58'),_0xd8e6('0x59'),this[_0xd8e6('0xe')][_0xd8e6('0x39')]):undefined;this[_0xd8e6('0xf')][_0xd8e6('0x56')](_0x1532d2,_0x4622c6)[_0xd8e6('0x13')](function(_0x59c587){_0x417fcf(null,_['isNil'](_0x59c587)?![]:!![]);})[_0xd8e6('0x16')](function(_0x270d87){logger[_0xd8e6('0x2a')](_0x270d87);_0x417fcf(null,![]);});};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x5a')]=function(_0x9d26f7,_0x32fd74){sh[_0xd8e6('0x5b')](_[_0xd8e6('0x5c')](_0x9d26f7),function(_0x385761,_0x523a04){var _0x2d78df=_0x523a04[_0xd8e6('0x5d')](/(\r\n|\n|\r)/gm,'');_0x32fd74(null,_0x2d78df);});};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x5e')]=function(_0x41ecd9,_0x824a72){scripts['googleCloudTTS'](_0x41ecd9[_0xd8e6('0x5f')],_0x41ecd9[_0xd8e6('0x60')]||_0xd8e6('0x61'),_0x41ecd9[_0xd8e6('0x61')],_0x41ecd9['languageCode']||_0xd8e6('0x62'),_0x41ecd9[_0xd8e6('0x63')]||_0xd8e6('0x64'),_0x41ecd9[_0xd8e6('0x65')]||_0xd8e6('0x66'))[_0xd8e6('0x13')](function(_0x579d91){_0x824a72(null,_0x579d91);})[_0xd8e6('0x16')](function(_0x191cf9){_0x824a72(_0x191cf9);});};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x67')]=function(_0x544c7e,_0x316dfe){scripts[_0xd8e6('0x67')](_0x544c7e[_0xd8e6('0x61')],_0x544c7e[_0xd8e6('0x68')]||'en',0x1)[_0xd8e6('0x13')](function(_0x4154e8){_0x316dfe(null,_0x4154e8);})[_0xd8e6('0x16')](function(_0x585462){_0x316dfe(_0x585462);});};AGIVertices['prototype'][_0xd8e6('0x69')]=function(_0x4850fd,_0x32793d){var _0x23ff83={'uri':_0x4850fd[_0xd8e6('0x6a')],'method':_0x4850fd[_0xd8e6('0x6b')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x4850fd[_0xd8e6('0x6c')])===_0xd8e6('0x6d')&&parseInt(_0x4850fd[_0xd8e6('0x6c')])>=0x1?parseInt(_0x4850fd['timeout'])*0x3e8:0x5*0x3e8};if(_[_0xd8e6('0x6e')](['POST','PUT'],_0x23ff83['method'][_0xd8e6('0x6f')]())){try{_0x23ff83[_0xd8e6('0x70')]=_0x4850fd[_0xd8e6('0x71')]?JSON['parse'](_0x4850fd[_0xd8e6('0x71')]):{};}catch(_0x26c32d){logger['error'](_0xd8e6('0x72'),_0x26c32d);}}try{_0x23ff83[_0xd8e6('0x73')]=_0x4850fd[_0xd8e6('0xb')]?JSON[_0xd8e6('0x74')](_0x4850fd[_0xd8e6('0xb')]):{};}catch(_0x52bd48){logger[_0xd8e6('0x2a')](_0xd8e6('0x75'),_0x52bd48);}if(_0x4850fd[_0xd8e6('0x76')]){try{var _0x22648b=require(_0x4850fd['computedVariables'])[_0xd8e6('0x77')](this,_0x23ff83);_0x23ff83[_0xd8e6('0x78')]=Mustache[_0xd8e6('0x79')](_0x4850fd['url'],_0x22648b,{},['$$','$$']);if(_0x23ff83['headers']){_0x23ff83[_0xd8e6('0x73')]=JSON[_0xd8e6('0x74')](Mustache[_0xd8e6('0x79')](JSON[_0xd8e6('0x7a')](_0x23ff83[_0xd8e6('0x73')]),_0x22648b,{},['$$','$$']));}if(_0x23ff83[_0xd8e6('0x70')]){_0x23ff83[_0xd8e6('0x70')]=JSON[_0xd8e6('0x74')](Mustache[_0xd8e6('0x79')](JSON['stringify'](_0x23ff83[_0xd8e6('0x70')]),_0x22648b,{},['$$','$$']));}}catch(_0xca7175){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0xca7175);}}rp(_0x23ff83)[_0xd8e6('0x13')](function(_0x5421a9){var _0x38cceb={'statusCode':_0x5421a9[_0xd8e6('0x7b')]||0xc8,'statusMessage':_0x5421a9[_0xd8e6('0x7c')]||'OK','headers':_0x5421a9[_0xd8e6('0x73')]||{},'body':_0x5421a9[_0xd8e6('0x70')]||{}};_0x32793d(null,_0x38cceb);})['catch'](function(_0x4e82b7){var _0x21cba5={'statusCode':_0x4e82b7[_0xd8e6('0x7b')]||0x1f4,'statusMessage':_0x4e82b7[_0xd8e6('0x7d')]||_0xd8e6('0x7e'),'headers':_0x4e82b7[_0xd8e6('0x7f')][_0xd8e6('0x73')]||{},'body':_0x4e82b7[_0xd8e6('0x7f')][_0xd8e6('0x70')]||{}};_0x32793d(null,_0x21cba5);});};AGIVertices['prototype'][_0xd8e6('0x80')]=function(_0x2f6822,_0x45001c){scripts[_0xd8e6('0x80')](this[_0xd8e6('0xe')][_0xd8e6('0x35')],_0x2f6822['key'],_0x2f6822['text'],_0x2f6822[_0xd8e6('0x81')]||'en')[_0xd8e6('0x13')](function(_0x1a0617){_0x45001c(null,_0x1a0617);})[_0xd8e6('0x16')](function(_0x53a04e){_0x45001c(_0x53a04e);});};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x82')]=function(_0x52de43,_0xe83579){scripts[_0xd8e6('0x82')](this['channel'][_0xd8e6('0x35')],_0x52de43[_0xd8e6('0x83')],_0x52de43[_0xd8e6('0x84')],_0x52de43[_0xd8e6('0x85')],_0x52de43[_0xd8e6('0x61')],_0x52de43['dialogflowV2_language']||'en')['then'](function(_0x4cb18e){_0xe83579(null,_0x4cb18e);})[_0xd8e6('0x16')](function(_0x60c547){_0xe83579(_0x60c547);});};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x86')]=function(_0x1ca0c9,_0x27fe7d){scripts['sestekNDA'](this[_0xd8e6('0xe')],_0x1ca0c9)[_0xd8e6('0x13')](function(_0x5e0e62){_0x27fe7d(null,_0x5e0e62);})[_0xd8e6('0x16')](function(_0x2aa72d){_0x27fe7d(_0x2aa72d);});};AGIVertices[_0xd8e6('0x11')]['ispeechTTS']=function(_0x32b6ac,_0xff1752){scripts['ispeechTTS'](_0x32b6ac[_0xd8e6('0x87')],_0x32b6ac['text'],_0x32b6ac[_0xd8e6('0x88')]||'en-US',_0x32b6ac['speed'])[_0xd8e6('0x13')](function(_0x13468d){_0xff1752(null,_0x13468d);})['catch'](function(_0x33d907){_0xff1752(_0x33d907);});};AGIVertices['prototype'][_0xd8e6('0x89')]=function(_0x1fdda5,_0x1c3bac,_0xe78728){scripts[_0xd8e6('0x89')](_0x1c3bac,_0x1fdda5[_0xd8e6('0x87')],_0x1fdda5[_0xd8e6('0x8a')]||_0xd8e6('0x62'),this[_0xd8e6('0x8b')](_0x1fdda5[_0xd8e6('0x8c')])?_0x1fdda5[_0xd8e6('0x8c')]:undefined)[_0xd8e6('0x13')](function(_0x1908d6){_0xe78728(null,_0x1908d6);})[_0xd8e6('0x16')](function(_0x5dd3ef){_0xe78728(_0x5dd3ef);});};AGIVertices['prototype'][_0xd8e6('0x8d')]=function(_0x466c18,_0x36081d){scripts['awsPolly'](_0x466c18[_0xd8e6('0x8e')],_0x466c18['aws_secret_access_key'],_0x466c18[_0xd8e6('0x8f')],_0x466c18['aws_polly_voice']||_0xd8e6('0x90'),_0x466c18[_0xd8e6('0x61')],_0x466c18['aws_text_type']||_0xd8e6('0x61'))[_0xd8e6('0x13')](function(_0x34a71d){_0x36081d(null,_0x34a71d);})[_0xd8e6('0x16')](function(_0x4969e5){_0x36081d(_0x4969e5);});};AGIVertices[_0xd8e6('0x11')]['awsLex']=function(_0x457d21,_0x677de){scripts['awsLex'](this['channel'][_0xd8e6('0x35')],_0x457d21[_0xd8e6('0x8e')],_0x457d21['aws_secret_access_key'],_0x457d21[_0xd8e6('0x91')],_0x457d21[_0xd8e6('0x61')],_0x457d21[_0xd8e6('0x92')])[_0xd8e6('0x13')](function(_0x43e020){_0x677de(null,_0x43e020);})['catch'](function(_0x3b1447){_0x677de(_0x3b1447);});};AGIVertices['prototype']['googleASR']=function(_0x3f7e05,_0x4e1c7f,_0x19822a){scripts['googleASR'](_0x4e1c7f,_0x3f7e05[_0xd8e6('0x87')],_0x3f7e05[_0xd8e6('0x93')]||_0xd8e6('0x62'))[_0xd8e6('0x13')](function(_0x3801e4){_0x19822a(null,_0x3801e4);})['catch'](function(_0x3bfa5c){_0x19822a(_0x3bfa5c);});};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x94')]=function(_0x1d070f,_0x3521db,_0x5f04bd){scripts['tildeASR'](_0x3521db,_0x1d070f['appid'],_0x1d070f[_0xd8e6('0x95')],_0x1d070f[_0xd8e6('0x78')])[_0xd8e6('0x13')](function(_0x4e988f){_0x5f04bd(null,_0x4e988f);})[_0xd8e6('0x16')](function(_0x5b4dd9){_0x5f04bd(_0x5b4dd9);});};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x96')]=function(_0x1aa13e){var _0x5cd667=_[_0xd8e6('0x6e')](verticesWithRetry,_0x1aa13e['agicommand'])?_0x1aa13e:_['clone'](_0x1aa13e);for(var _0x5b9387 in _0x5cd667){if(_0x5cd667['hasOwnProperty'](_0x5b9387)){if(_0x5cd667[_0x5b9387]&&_[_0xd8e6('0x97')](_0x5cd667[_0x5b9387])){if(_['includes'](recursiveMapAttributes,_0x5b9387)){_0x5cd667[_0x5b9387]=this[_0xd8e6('0x98')](_0x5cd667[_0x5b9387]);}else{_0x5cd667[_0x5b9387]=this['replaceAllVariables'](_0x5cd667[_0x5b9387]);}}}}return _0x5cd667;};AGIVertices[_0xd8e6('0x11')]['recursiveNodeIndex']=function(_0xa28017){for(var _0x41efce in _0xa28017){if(_0xa28017[_0xd8e6('0x99')](_0x41efce)){if(_[_0xd8e6('0x9a')](_0xa28017[_0x41efce])){this['recursiveNodeIndex'](_0xa28017[_0x41efce]);}else if(_[_0xd8e6('0x9b')](_0xa28017[_0x41efce])){for(var _0x29fdfc=0x0;_0x29fdfc<_0xa28017[_0x41efce][_0xd8e6('0x9c')];_0x29fdfc++){this[_0xd8e6('0x9d')](_0xa28017[_0x41efce][_0x29fdfc]);}}else if(_[_0xd8e6('0x97')](_0xa28017[_0x41efce])){_0xa28017[_0x41efce]=this[_0xd8e6('0x9e')](_0xa28017[_0x41efce]);}}}};AGIVertices[_0xd8e6('0x11')]['saveRestApiResult']=function(_0x2f245c,_0x172b59){for(var _0x1cd654 in _0x2f245c){if(_0x2f245c['hasOwnProperty'](_0x1cd654)){if(_[_0xd8e6('0x9a')](_0x2f245c[_0x1cd654])){if(!_[_0xd8e6('0x44')](_0x2f245c[_0x1cd654])){this[_0xd8e6('0x9f')](_0x2f245c[_0x1cd654],util[_0xd8e6('0x27')](_0xd8e6('0xa0'),_0x172b59,_0x1cd654));}}else if(_[_0xd8e6('0x9b')](_0x2f245c[_0x1cd654])){for(var _0xceb7a3=0x0;_0xceb7a3<_0x2f245c[_0x1cd654][_0xd8e6('0x9c')];_0xceb7a3++){this[_0xd8e6('0x9f')](_0x2f245c[_0x1cd654][_0xceb7a3],util['format'](_0xd8e6('0xa0'),_0x172b59,_0x1cd654+'['+_0xceb7a3+']'));}}else{if(!_[_0xd8e6('0x45')](_0x2f245c[_0x1cd654])){this[_0xd8e6('0xe')][_0xd8e6('0xa1')](util[_0xd8e6('0x27')](_0xd8e6('0xa0'),_0x172b59,_0x1cd654),_0x2f245c[_0x1cd654]);}}}}};AGIVertices['prototype'][_0xd8e6('0x98')]=function(_0x26f5f1){try{var _0x26886d=JSON[_0xd8e6('0x74')](_0x26f5f1);this[_0xd8e6('0x9d')](_0x26886d);return JSON[_0xd8e6('0x7a')](_0x26886d);}catch(_0x36287d){return this['replaceAllVariables'](_0x26f5f1);}};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x9e')]=function(_0x236569){var _0x2ac7df=_0x236569['split']('{');for(var _0x472d37=0x1;_0x472d37<_0x2ac7df[_0xd8e6('0x9c')];_0x472d37+=0x1){var _0x132dbe=_0x2ac7df[_0x472d37]['split']('}');if(_0x132dbe['length']>0x1){_0x236569=_0x236569[_0xd8e6('0xa2')]('{'+_0x132dbe[0x0]+'}',this[_0xd8e6('0xe')]['getVariable'](_0x132dbe[0x0])['extra']||_0x132dbe[0x0]);}}if(_0x2ac7df['length']===0x1){return _0x236569[_0xd8e6('0x4e')]();}return this[_0xd8e6('0x9e')](_0x236569);};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0xa3')]=function(_0x143f4c,_0x36728e){var _0x3c1f78=this[_0xd8e6('0xe')][_0xd8e6('0xa4')](_0x143f4c);if(_0x3c1f78[_0xd8e6('0xa5')]===-0x1){return _0x3c1f78;}logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x36728e,_0x3c1f78[_0xd8e6('0xa6')]));return this['channel'][_0xd8e6('0xa1')](_0x36728e,_0x3c1f78[_0xd8e6('0xa6')]);};AGIVertices['prototype'][_0xd8e6('0x8b')]=function(_0x459b75){return _0x459b75&&_0x459b75!=='0'&&_0x459b75!=='-1'&&_0x459b75!=='';};AGIVertices['prototype'][_0xd8e6('0xa7')]=function(_0x3f8b96){this[_0xd8e6('0x34')]['sync'](this,_0x3f8b96,'-');_0x3f8b96[_0xd8e6('0xa8')]=_0x3f8b96[_0xd8e6('0xa7')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xd8e6('0x11')]['mrcpsynth']=function(_0x123578){logger[_0xd8e6('0x2c')](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x123578[_0xd8e6('0x36')]));if(!this[_0xd8e6('0x8b')](_0x123578[_0xd8e6('0x61')])){return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](_0xd8e6('0xaa'));}var _0x4aa52c='\x22'+_0x123578[_0xd8e6('0x61')]+'\x22';if(this[_0xd8e6('0x8b')](_0x123578[_0xd8e6('0x7f')])){_0x4aa52c+=','+_0x123578[_0xd8e6('0x7f')];}var _0x3347f8=this[_0xd8e6('0xe')][_0xd8e6('0x5b')](_0xd8e6('0xab'),_0x4aa52c);if(_0x3347f8['result']===-0x1){return _0x3347f8;}return this['channel']['noop'](util[_0xd8e6('0x27')](_0xd8e6('0xac'),_0x4aa52c));};AGIVertices[_0xd8e6('0x11')]['mrcprecog']=function(_0x148f89){logger['info'](util[_0xd8e6('0x27')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x148f89[_0xd8e6('0x36')]));if(!this[_0xd8e6('0x8b')](_0x148f89[_0xd8e6('0xad')])){return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](_0xd8e6('0xae'));}var _0x518672=_0x148f89['grammar'];if(this[_0xd8e6('0x8b')](_0x148f89[_0xd8e6('0x7f')])){_0x518672+=','+_0x148f89['options'];}var _0x468f23=this[_0xd8e6('0xe')][_0xd8e6('0x5b')](_0xd8e6('0xaf'),_0x518672);if(_0x468f23['result']===-0x1){return _0x468f23;}var _0x770d=this[_0xd8e6('0xa3')](_0xd8e6('0xb0'),'MRCP_RECOG_CONFIDENCE');if(_0x770d[_0xd8e6('0xa5')]===-0x1){return _0x770d;}var _0x940e7f=this[_0xd8e6('0xa3')](_0xd8e6('0xb1'),_0xd8e6('0xb2'));if(_0x940e7f[_0xd8e6('0xa5')]===-0x1){return _0x940e7f;}var _0x1e3506=this[_0xd8e6('0xa3')](_0xd8e6('0xb3'),'MRCP_RECOG_INSTANCE');if(_0x1e3506[_0xd8e6('0xa5')]===-0x1){return _0x1e3506;}return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util[_0xd8e6('0x27')](_0xd8e6('0xb4'),_0x518672));};AGIVertices[_0xd8e6('0x11')]['agi']=function(_0x9bd26c){logger[_0xd8e6('0x2c')](util['format']('Enter\x20in\x20AGI\x20(%s)\x20block',_0x9bd26c[_0xd8e6('0x36')]));return this[_0xd8e6('0xe')][_0xd8e6('0xb5')]([_0x9bd26c['command'],_0x9bd26c['args']]);};AGIVertices['prototype'][_0xd8e6('0xb6')]=function(_0x1779a9){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0xb7'),_0x1779a9['label']));if(this[_0xd8e6('0x8b')](_0x1779a9[_0xd8e6('0x6c')])){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0xb8'),_0x1779a9[_0xd8e6('0x6c')]));var _0x63ee53=this['channel'][_0xd8e6('0xb9')](_0x1779a9[_0xd8e6('0x6c')]);if(_0x63ee53[_0xd8e6('0xa5')]===-0x1){return _0x63ee53;}}return this[_0xd8e6('0xe')]['answer']();};AGIVertices['prototype'][_0xd8e6('0x4b')]=function(_0x50b7fc){logger['info'](util['format'](_0xd8e6('0xba'),_0x50b7fc['label']));if(!this[_0xd8e6('0x8b')](_0x50b7fc['list_id'])){return this['channel'][_0xd8e6('0x2a')](_0x50b7fc,'no\x20list\x20selected');}_0x50b7fc[_0xd8e6('0x4d')]=moment();if(this[_0xd8e6('0x8b')](_0x50b7fc[_0xd8e6('0xbb')])){_0x50b7fc[_0xd8e6('0x4d')]=moment()[_0xd8e6('0xbc')](_0x50b7fc[_0xd8e6('0xbb')],_0xd8e6('0xbd'));}if(!this[_0xd8e6('0x8b')](_0x50b7fc[_0xd8e6('0x4f')])){_0x50b7fc[_0xd8e6('0x4f')]=0x2;}this[_0xd8e6('0x43')]['sync'](this,_0x50b7fc);return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util[_0xd8e6('0x27')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x50b7fc[_0xd8e6('0x49')],_0x50b7fc[_0xd8e6('0x4a')],_0x50b7fc[_0xd8e6('0x4d')]));};AGIVertices[_0xd8e6('0x11')]['custom_app']=function(_0x5e0798){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0xbe'),_0x5e0798['label']));var _0x3edf0f=this['channel'][_0xd8e6('0x5b')](_0x5e0798[_0xd8e6('0xbf')],_0x5e0798[_0xd8e6('0x7f')]);if(_0x3edf0f[_0xd8e6('0xa5')]===-0x1){return _0x3edf0f;}return this['channel'][_0xd8e6('0xa9')](util['format'](_0xd8e6('0xc0'),_0x5e0798['application'],_0x5e0798[_0xd8e6('0x7f')]));};AGIVertices['prototype'][_0xd8e6('0xc1')]=function(_0x296ac1){logger[_0xd8e6('0x2c')](util['format'](_0xd8e6('0xc2'),_0x296ac1['label']));if(!this['isConfigured'](_0x296ac1[_0xd8e6('0x61')])){return this['channel'][_0xd8e6('0xa9')](_0xd8e6('0xaa'));}var _0x434606='\x22'+_0x296ac1['text']+'\x22';if(this[_0xd8e6('0x8b')](_0x296ac1[_0xd8e6('0x7f')])){_0x434606+=','+_0x296ac1['options'];}var _0x58aec3=this[_0xd8e6('0xe')][_0xd8e6('0x5b')](_0xd8e6('0xab'),_0x434606);if(_0x58aec3['result']===-0x1){return _0x58aec3;}return this[_0xd8e6('0xe')]['noop'](util[_0xd8e6('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0x434606));};AGIVertices[_0xd8e6('0x11')]['sestektts']=function(_0x11a6f6){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0xc3'),_0x11a6f6[_0xd8e6('0x36')]));if(!this[_0xd8e6('0x8b')](_0x11a6f6[_0xd8e6('0x61')])){return this['channel'][_0xd8e6('0xa9')](_0xd8e6('0xaa'));}var _0x2cfcc8='\x22'+_0x11a6f6['text']+'\x22';if(this[_0xd8e6('0x8b')](_0x11a6f6['options'])){_0x2cfcc8+=','+_0x11a6f6['options'];}var _0x3d2aea=this['channel'][_0xd8e6('0x5b')](_0xd8e6('0xab'),_0x2cfcc8);if(_0x3d2aea['result']===-0x1){return _0x3d2aea;}return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util[_0xd8e6('0x27')](_0xd8e6('0xac'),_0x2cfcc8));};AGIVertices[_0xd8e6('0x11')]['lumenvoxasr']=function(_0x822d81){logger['info'](util[_0xd8e6('0x27')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x822d81[_0xd8e6('0x36')]));if(!this['isConfigured'](_0x822d81['grammar'])){return this[_0xd8e6('0xe')][_0xd8e6('0xa9')]('no\x20grammar\x20configured');}var _0x42fabb=_0x822d81[_0xd8e6('0xad')];if(this[_0xd8e6('0x8b')](_0x822d81[_0xd8e6('0x7f')])){_0x42fabb+=','+_0x822d81[_0xd8e6('0x7f')];}var _0x29ee46=this['channel'][_0xd8e6('0x5b')](_0xd8e6('0xaf'),_0x42fabb);if(_0x29ee46['result']===-0x1){return _0x29ee46;}var _0x527dd9=this[_0xd8e6('0xa3')]('RECOG_CONFIDENCE()',_0xd8e6('0xc4'));if(_0x527dd9[_0xd8e6('0xa5')]===-0x1){return _0x527dd9;}var _0x519384=this[_0xd8e6('0xa3')]('RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT');if(_0x519384[_0xd8e6('0xa5')]===-0x1){return _0x519384;}var _0x4d0c78=this[_0xd8e6('0xa3')](_0xd8e6('0xb3'),'LUMENVOX_ASR_INSTANCE');if(_0x4d0c78[_0xd8e6('0xa5')]===-0x1){return _0x4d0c78;}return this[_0xd8e6('0xe')]['noop'](util[_0xd8e6('0x27')](_0xd8e6('0xb4'),_0x42fabb));};AGIVertices['prototype']['sestekasr']=function(_0x199edd){logger[_0xd8e6('0x2c')](util['format'](_0xd8e6('0xc5'),_0x199edd[_0xd8e6('0x36')]));if(!this[_0xd8e6('0x8b')](_0x199edd[_0xd8e6('0xad')])){return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](_0xd8e6('0xae'));}var _0x2d9015=_0x199edd['grammar'];if(this[_0xd8e6('0x8b')](_0x199edd[_0xd8e6('0x7f')])){_0x2d9015+=','+_0x199edd[_0xd8e6('0x7f')];}var _0xeab783=this[_0xd8e6('0xe')]['exec'](_0xd8e6('0xaf'),_0x2d9015);if(_0xeab783[_0xd8e6('0xa5')]===-0x1){return _0xeab783;}var _0x5e0543=this[_0xd8e6('0xa3')]('RECOG_CONFIDENCE()',_0xd8e6('0xc6'));if(_0x5e0543[_0xd8e6('0xa5')]===-0x1){return _0x5e0543;}var _0x13cf00=this['getAndSetVariable']('RECOG_INPUT()',_0xd8e6('0xc7'));if(_0x13cf00[_0xd8e6('0xa5')]===-0x1){return _0x13cf00;}var _0x23ac13=this['getAndSetVariable'](_0xd8e6('0xb3'),_0xd8e6('0xc8'));if(_0x23ac13[_0xd8e6('0xa5')]===-0x1){return _0x23ac13;}return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x2d9015));};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0xc9')]=function(_0x3a7432){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0xca'),_0x3a7432[_0xd8e6('0x36')]));if(!this['isConfigured'](_0x3a7432[_0xd8e6('0xcb')])){return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x3a7432,_0xd8e6('0xcc'));}var _0x5d66f7=this[_0xd8e6('0xcd')][_0xd8e6('0x77')](this,_0x3a7432['odbc_id']);if(!_0x5d66f7){return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x3a7432,_0xd8e6('0xce'));}if(!this['isConfigured'](_0x3a7432[_0xd8e6('0xcf')])){return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x3a7432,_0xd8e6('0xd0'));}var _0x8cd955=_0x3a7432[_0xd8e6('0xcf')][_0xd8e6('0x5d')](/(\r\n|\n|\r)/gm,'\x20');this[_0xd8e6('0xe')]['noop'](util[_0xd8e6('0x27')](_0xd8e6('0xd1'),_0x8cd955));var _0x3a5b83=this[_0xd8e6('0x29')][_0xd8e6('0x77')](this,_0x5d66f7,_0x8cd955);this[_0xd8e6('0x34')][_0xd8e6('0x77')](this,_0x3a7432,_0x8cd955);if(!this[_0xd8e6('0x8b')](_0x3a7432['variable_id'])){return this[_0xd8e6('0xe')][_0xd8e6('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x38d15f=this[_0xd8e6('0xa4')][_0xd8e6('0x77')](this,_0x3a7432[_0xd8e6('0xd2')]);if(!_0x38d15f){return this[_0xd8e6('0xe')]['error'](_0x3a7432,_0xd8e6('0xd3'));}var _0x8bc89a=this;_0x3a5b83[_0xd8e6('0xd4')](function(_0x374871,_0x578b8b){Object['keys'](_0x374871)[_0xd8e6('0xd4')](function(_0x457023){_0x8bc89a['channel'][_0xd8e6('0xa1')](util['format']('%s[%s][%s]',_0x38d15f,_0x578b8b,_0x457023),_0x374871[_0x457023]);});});this[_0xd8e6('0xe')][_0xd8e6('0xa1')](util[_0xd8e6('0x27')](_0xd8e6('0xd5'),_0x38d15f),_0x3a5b83[_0xd8e6('0x9c')]);return this['channel']['noop'](util[_0xd8e6('0x27')](_0xd8e6('0xd6'),_0x38d15f));};AGIVertices[_0xd8e6('0x11')]['dial']=function(_0x186942){logger[_0xd8e6('0xd7')](util['format'](_0xd8e6('0xd8'),_0x186942[_0xd8e6('0x36')]));if(!this['isConfigured'](_0x186942['sip_id'])){return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x186942,_0xd8e6('0xd9'));}var _0x44d6fe=this['getUser'][_0xd8e6('0x77')](this,_0x186942[_0xd8e6('0xda')]);if(!_0x44d6fe){return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x186942,'no\x20user\x20found');}var _0x292c57=this['channel'][_0xd8e6('0x5b')]('DIAL',[util[_0xd8e6('0x27')]('SIP/%s',_0x44d6fe),_0x186942[_0xd8e6('0x6c')],_0x186942[_0xd8e6('0xdb')],_0x186942[_0xd8e6('0x6a')]]);if(_0x292c57[_0xd8e6('0xa5')]===-0x1){return _0x292c57;}return this[_0xd8e6('0xe')]['noop'](util[_0xd8e6('0x27')](_0xd8e6('0xdc'),_0xd8e6('0xdd')));};AGIVertices['prototype'][_0xd8e6('0xde')]=function(_0x21fbc2){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0xdf'),_0x21fbc2[_0xd8e6('0x36')]));if(!this[_0xd8e6('0x8b')](_0x21fbc2[_0xd8e6('0x87')])){return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](_0xd8e6('0xe0'));}if(!this[_0xd8e6('0x8b')](_0x21fbc2[_0xd8e6('0x61')])){return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](_0xd8e6('0xaa'));}this[_0xd8e6('0xe')]['bot']=!![];this[_0xd8e6('0x34')](_0x21fbc2);this[_0xd8e6('0x42')](_0x21fbc2[_0xd8e6('0x61')],'in','','');this['channel'][_0xd8e6('0xa9')](util['format']('Trying\x20Dialogflow:\x20%s',_0x21fbc2[_0xd8e6('0x61')]));var _0x438da9=this['googleDialogflow'][_0xd8e6('0x77')](this,_0x21fbc2);if(_0x438da9){for(var _0x3791e2 in _0x438da9){if(_0x438da9[_0xd8e6('0x99')](_0x3791e2)){this[_0xd8e6('0xe')][_0xd8e6('0xa1')](util[_0xd8e6('0x27')](_0xd8e6('0xe1'),_0x3791e2[_0xd8e6('0x6f')]()),_0x438da9[_0x3791e2]);}}this[_0xd8e6('0x42')](_0x438da9['speech'],_0xd8e6('0xe2'),_0xd8e6('0xde'),'');return this['channel'][_0xd8e6('0xa9')](util[_0xd8e6('0x27')](_0xd8e6('0xe3'),_0x438da9[_0xd8e6('0xe4')]));}return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x21fbc2,_0xd8e6('0xe5'));};AGIVertices[_0xd8e6('0x11')]['dialogflowV2']=function(_0x562e29){logger['info'](util[_0xd8e6('0x27')](_0xd8e6('0xe6'),_0x562e29['label']));if(!this['isConfigured'](_0x562e29['dialogflowV2_project_id'])){return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](_0xd8e6('0xe7'));}if(!this['isConfigured'](_0x562e29[_0xd8e6('0x84')])){return this[_0xd8e6('0xe')][_0xd8e6('0xa9')]('no\x20client_email\x20configured');}if(!this[_0xd8e6('0x8b')](_0x562e29[_0xd8e6('0x85')])){return this[_0xd8e6('0xe')]['noop'](_0xd8e6('0xe8'));}if(!this[_0xd8e6('0x8b')](_0x562e29[_0xd8e6('0xe9')])){return this['channel']['noop']('no\x20anguage\x20configured');}if(!this['isConfigured'](_0x562e29['text'])){return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](_0xd8e6('0xaa'));}this[_0xd8e6('0xe')][_0xd8e6('0xea')]=!![];this[_0xd8e6('0x34')](_0x562e29);this[_0xd8e6('0x42')](_0x562e29[_0xd8e6('0x61')],'in','','');this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util['format'](_0xd8e6('0xeb'),_0x562e29[_0xd8e6('0x61')]));var _0x240aa6=this[_0xd8e6('0x82')]['sync'](this,_0x562e29);if(_0x240aa6){for(var _0x510687 in _0x240aa6){if(_0x240aa6[_0xd8e6('0x99')](_0x510687)){if(_0x510687!=='providerResponse'){this[_0xd8e6('0xe')]['setVariable'](util[_0xd8e6('0x27')](_0xd8e6('0xe1'),_0x510687['toUpperCase']()),_0x240aa6[_0x510687]);}}}this[_0xd8e6('0x42')](_0x240aa6['speech'],_0xd8e6('0xe2'),'dialogflowV2',_0x240aa6[_0xd8e6('0xec')]);return this[_0xd8e6('0xe')]['noop'](util[_0xd8e6('0x27')]('DialogflowV2\x20Result\x20%s',_0x240aa6['speech']));}return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x562e29,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0xd8e6('0x11')]['sesteknda']=function(_0x189cfa){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0xed'),_0x189cfa[_0xd8e6('0x36')]));if(!this['isConfigured'](_0x189cfa[_0xd8e6('0xee')])){return this[_0xd8e6('0xe')][_0xd8e6('0xa9')]('no\x20ndauth\x20url\x20configured');}if(!this[_0xd8e6('0x8b')](_0x189cfa[_0xd8e6('0xef')])){return this['channel'][_0xd8e6('0xa9')](_0xd8e6('0xf0'));}if(!this['isConfigured'](_0x189cfa[_0xd8e6('0xf1')])){return this['channel'][_0xd8e6('0xa9')]('no\x20password\x20configured');}if(!this['isConfigured'](_0x189cfa[_0xd8e6('0xf2')])){return this['channel'][_0xd8e6('0xa9')](_0xd8e6('0xaa'));}this[_0xd8e6('0xe')][_0xd8e6('0xea')]=!![];this[_0xd8e6('0x34')](_0x189cfa);this['createSquareMessage'](_0x189cfa['text'],'in','','');this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util[_0xd8e6('0x27')](_0xd8e6('0xf3'),_0x189cfa[_0xd8e6('0x61')]));var _0x4ca7bf=this[_0xd8e6('0x86')]['sync'](this,_0x189cfa);if(_0x4ca7bf){for(var _0x2235e8 in _0x4ca7bf){if(_0x4ca7bf[_0xd8e6('0x99')](_0x2235e8)){this[_0xd8e6('0xe')]['setVariable'](util[_0xd8e6('0x27')](_0xd8e6('0xf4'),_0x2235e8[_0xd8e6('0x6f')]()),_0x4ca7bf[_0x2235e8]);}}this[_0xd8e6('0x42')](_0x4ca7bf['speech'],_0xd8e6('0xe2'),_0xd8e6('0xf5'),'');if(_0x4ca7bf[_0xd8e6('0xf6')]){this[_0xd8e6('0xe')]['noop'](util['format'](_0xd8e6('0xf7'),_0x4ca7bf[_0xd8e6('0xf6')]));var _0x382b7e=this['channel'][_0xd8e6('0xf8')](_0x4ca7bf['audiofile']);try{fs[_0xd8e6('0xf9')](_0x4ca7bf['audiofile']+_0xd8e6('0xfa'));}catch(_0x5dc097){logger[_0xd8e6('0x2a')](_0x5dc097);}return _0x382b7e;}else{return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util['format'](_0xd8e6('0xfb'),_0x4ca7bf[_0xd8e6('0xe4')]));}}return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x189cfa,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype'][_0xd8e6('0xfc')]=function(_0x39d82c){logger['info'](util[_0xd8e6('0x27')](_0xd8e6('0xfd'),_0x39d82c[_0xd8e6('0x36')]));return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](_0xd8e6('0xfc'));};AGIVertices['prototype'][_0xd8e6('0xfe')]=function(_0x5099d7){logger['info'](util[_0xd8e6('0x27')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x5099d7['label']));var _0xdff5d2='';if(_0x5099d7['trunk_id']){if(!this['isConfigured'](_0x5099d7[_0xd8e6('0xff')])){return this[_0xd8e6('0xe')]['error'](_0x5099d7,_0xd8e6('0x100'));}else{var _0xf6d4a4=parseInt(_0x5099d7[_0xd8e6('0xff')],0xa);if(isNaN(_0xf6d4a4)){_0xdff5d2=_0x5099d7[_0xd8e6('0xff')];}else{_0xdff5d2=this[_0xd8e6('0x1c')][_0xd8e6('0x77')](this,_0x5099d7[_0xd8e6('0xff')]);if(!_0xdff5d2){return this['channel'][_0xd8e6('0x2a')](_0x5099d7,'no\x20trunk\x20found');}}}}else if(_0x5099d7[_0xd8e6('0x101')]){_0xdff5d2=_0x5099d7[_0xd8e6('0x101')];}else{return this['channel'][_0xd8e6('0x2a')](_0x5099d7,_0xd8e6('0x100'));}var _0x3631cb=this['channel'][_0xd8e6('0x5b')](_0xd8e6('0xdd'),[util[_0xd8e6('0x27')](_0xd8e6('0x102'),_0xdff5d2,_0x5099d7[_0xd8e6('0x49')]),_0x5099d7['timeout'],_0x5099d7[_0xd8e6('0xdb')],_0x5099d7[_0xd8e6('0x6a')]]);if(_0x3631cb[_0xd8e6('0xa5')]===-0x1){return _0x3631cb;}return this['channel'][_0xd8e6('0xa9')](util[_0xd8e6('0x27')](_0xd8e6('0xdc'),_0xd8e6('0xdd')));};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x103')]=function(_0x596622){logger['info'](util[_0xd8e6('0x27')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x596622[_0xd8e6('0x36')]));return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](_0xd8e6('0x103'));};AGIVertices[_0xd8e6('0x11')]['getdigits']=function(_0x581855){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0x104'),_0x581855['label']));if(_0x581855[_0xd8e6('0xa8')]===0x0){return this[_0xd8e6('0xa7')](_0x581855);}_0x581855[_0xd8e6('0xa8')]-=0x1;if(!this[_0xd8e6('0x8b')](_0x581855['file_id'])){return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x581855,_0xd8e6('0x105'));}var _0x2ffa95=this['getSound'][_0xd8e6('0x77')](this,_0x581855[_0xd8e6('0x106')]);if(!_0x2ffa95){return this['channel'][_0xd8e6('0x2a')](_0x581855,_0xd8e6('0x107'));}if(!this['isConfigured'](_0x581855[_0xd8e6('0xd2')])){return this[_0xd8e6('0xe')]['error']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x5a0512=this[_0xd8e6('0xe')][_0xd8e6('0x108')](_0x2ffa95,_0x581855[_0xd8e6('0x109')],_0x581855[_0xd8e6('0x10a')]);var _0x5913f9=_0x5a0512[_0xd8e6('0xa5')]?_0x5a0512[_0xd8e6('0xa5')]['toString']():'';logger[_0xd8e6('0x2c')]('test',JSON[_0xd8e6('0x7a')](_0x5a0512));if(_0x5a0512['result']===-0x1){this['createSquareDetailsReport'][_0xd8e6('0x77')](this,_0x581855,_0x5913f9);return _0x5a0512;}else if(_0x5a0512[_0xd8e6('0xa6')]==='timeout'){_0x5a0512['result']=_0x5913f9[_0xd8e6('0x9c')]>=parseInt(_0x581855[_0xd8e6('0x10b')])?'x':'i';}else{_0x5a0512['result']=_0x5913f9[_0xd8e6('0x9c')]>=parseInt(_0x581855[_0xd8e6('0x10b')])&&_0x5913f9[_0xd8e6('0x9c')]<=parseInt(_0x581855[_0xd8e6('0x10a')])?'x':'i';}var _0x171afb=this[_0xd8e6('0xa4')][_0xd8e6('0x77')](this,_0x581855['variable_id']);if(!_0x171afb){return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x581855,_0xd8e6('0xd3'));}this[_0xd8e6('0xe')][_0xd8e6('0xa1')](_0x171afb,_0x5913f9);if(this[_0xd8e6('0x8b')](_0x581855[_0xd8e6('0x10c')])){var _0x15eafc=parseInt(_0x581855[_0xd8e6('0x10c')],0xa);var _0x534e88=rs['generate']({'charset':'*','length':_0x15eafc});var _0x17f39b=_0x5913f9[_0xd8e6('0x9c')];if(_0x17f39b>0x0){if(_0x17f39b>_0x15eafc){this[_0xd8e6('0x34')]['sync'](this,_0x581855,_0x581855['hiddendigitspos']==='first'?_0x534e88+_0x5913f9[_0xd8e6('0x10d')](_0x15eafc):_0x5913f9[_0xd8e6('0x10d')](0x0,_0x17f39b-_0x15eafc)+_0x534e88);}else{this[_0xd8e6('0x34')][_0xd8e6('0x77')](this,_0x581855,rs[_0xd8e6('0x10e')]({'charset':'*','length':_0x17f39b}));}}else{this[_0xd8e6('0x34')]['sync'](this,_0x581855,'');}}else{this[_0xd8e6('0x34')]['sync'](this,_0x581855,_0x5913f9);}return _0x5a0512;};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x10f')]=function(_0x3d70cd){logger['info'](util[_0xd8e6('0x27')](_0xd8e6('0x110'),_0x3d70cd[_0xd8e6('0x36')]));return this[_0xd8e6('0xd')](_0x3d70cd);};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x111')]=function(_0x394112){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x394112[_0xd8e6('0x36')]));this[_0xd8e6('0x34')][_0xd8e6('0x77')](this,_0x394112,_0x394112[_0xd8e6('0x112')]);return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util[_0xd8e6('0x27')](_0xd8e6('0x113'),_0x394112[_0xd8e6('0x112')]));};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x114')]=function(_0x5a8f60){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x5a8f60[_0xd8e6('0x36')]));if(!this['isConfigured'](_0x5a8f60[_0xd8e6('0x8e')])||!this[_0xd8e6('0x8b')](_0x5a8f60[_0xd8e6('0x115')])){return this['channel'][_0xd8e6('0xa9')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xd8e6('0x8b')](_0x5a8f60[_0xd8e6('0x61')])){return this['channel']['noop'](_0xd8e6('0xaa'));}this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util[_0xd8e6('0x27')]('Trying\x20aws\x20Polly\x20%s',_0x5a8f60['text']));var _0x1fdbcc=this['awsPolly'][_0xd8e6('0x77')](this,_0x5a8f60);if(_0x1fdbcc){this['channel'][_0xd8e6('0xa9')](util[_0xd8e6('0x27')](_0xd8e6('0x116'),_0x1fdbcc));var _0x3c9e76=this[_0xd8e6('0xe')][_0xd8e6('0xf8')](_0x1fdbcc);try{fs[_0xd8e6('0xf9')](_0x1fdbcc+'.wav');}catch(_0x47d3ad){logger[_0xd8e6('0x2a')](_0x47d3ad);}return _0x3c9e76;}return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x5a8f60,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xd8e6('0x11')]['awslex']=function(_0x48de0e){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0x117'),_0x48de0e[_0xd8e6('0x36')]));if(!this[_0xd8e6('0x8b')](_0x48de0e['aws_access_key_id'])||!this['isConfigured'](_0x48de0e['aws_secret_access_key'])){return this[_0xd8e6('0xe')]['noop'](_0xd8e6('0x118'));}if(!this['isConfigured'](_0x48de0e[_0xd8e6('0x92')])){return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](_0xd8e6('0x119'));}if(!this[_0xd8e6('0x8b')](_0x48de0e[_0xd8e6('0x61')])){return this['channel'][_0xd8e6('0xa9')](_0xd8e6('0xaa'));}this[_0xd8e6('0xe')][_0xd8e6('0xea')]=!![];this[_0xd8e6('0x34')](_0x48de0e);this[_0xd8e6('0x42')](_0x48de0e[_0xd8e6('0x61')],'in','','');this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0x48de0e['text']));var _0x27e28f=this[_0xd8e6('0x11a')][_0xd8e6('0x77')](this,_0x48de0e);if(_0x27e28f){for(var _0x1a29b8 in _0x27e28f){if(_0x27e28f[_0xd8e6('0x99')](_0x1a29b8)&&_[_0xd8e6('0x97')](_0x27e28f[_0x1a29b8])){this['channel'][_0xd8e6('0xa1')](util['format'](_0xd8e6('0x11b'),_0x1a29b8[_0xd8e6('0x6f')]()),_0x27e28f[_0x1a29b8]);}}if(_[_0xd8e6('0x45')](_0x27e28f[_0xd8e6('0x7d')])){return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](_0xd8e6('0x11c'));}else{this[_0xd8e6('0x42')](_0x27e28f[_0xd8e6('0x7d')],_0xd8e6('0xe2'),'amazonlex','');return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util['format'](_0xd8e6('0x11d'),_0x27e28f['message']));}}return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x48de0e,_0xd8e6('0x11e'));};AGIVertices['prototype']['googleasr']=function(_0x2a9457){logger[_0xd8e6('0x2c')](util['format'](_0xd8e6('0x11f'),_0x2a9457[_0xd8e6('0x36')],_0x2a9457['timeout']));if(!this[_0xd8e6('0x8b')](_0x2a9457[_0xd8e6('0x87')])){return this['channel'][_0xd8e6('0xa9')](_0xd8e6('0xe0'));}var _0x57b9a2=_0xd8e6('0x120');var _0x7c97c9=util['format'](_0xd8e6('0x121'),FILES_PATH,rs[_0xd8e6('0x10e')](0x4));var _0x21f9db=util['format'](_0xd8e6('0xa0'),_0x7c97c9,_0x57b9a2);var _0xe393b6=!![];if(_0x2a9457['beep']===_0xd8e6('0x122')){_0xe393b6=![];}var _0x1b3258=this[_0xd8e6('0xe')]['recordFile'](_0x7c97c9,_0x57b9a2,_0x2a9457['intKey'],_0x2a9457[_0xd8e6('0x6c')],undefined,_0xe393b6);if(_0x1b3258['result']!==-0x1){this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util[_0xd8e6('0x27')](_0xd8e6('0x123'),_0x21f9db));var _0x219b43=this[_0xd8e6('0x124')][_0xd8e6('0x77')](this,_0x2a9457,_0x21f9db);if(_0x219b43){for(var _0x3cc8d8 in _0x219b43){if(_0x219b43[_0xd8e6('0x99')](_0x3cc8d8)){this[_0xd8e6('0xe')]['setVariable'](util[_0xd8e6('0x27')]('GOOGLE_ASR_%s',_0x3cc8d8[_0xd8e6('0x6f')]()),_0x219b43[_0x3cc8d8]);}}return this[_0xd8e6('0xe')]['noop'](util['format'](_0xd8e6('0x125'),JSON['stringify'](_0x219b43)));}}return _0x1b3258;};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x126')]=function(_0x360ebf){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x360ebf['label']));if(!this[_0xd8e6('0x8b')](_0x360ebf[_0xd8e6('0x127')])){return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](_0xd8e6('0x128'));}if(!this['isConfigured'](_0x360ebf['appsecret'])){return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](_0xd8e6('0x129'));}var _0x2228d2=_0xd8e6('0x120');var _0x594c13=util['format']('%s/recordings/%s',FILES_PATH,rs[_0xd8e6('0x10e')](0x4));var _0x4832c2=util[_0xd8e6('0x27')]('%s.%s',_0x594c13,_0x2228d2);var _0x32437d=!![];if(_0x360ebf[_0xd8e6('0x12a')]===_0xd8e6('0x122')){_0x32437d=![];}var _0x5c07ef=this['channel'][_0xd8e6('0x12b')](_0x594c13,_0x2228d2,_0x360ebf['intKey'],_0x360ebf[_0xd8e6('0x6c')],undefined,_0x32437d);if(_0x5c07ef[_0xd8e6('0xa5')]!==-0x1){this['channel'][_0xd8e6('0xa9')](util[_0xd8e6('0x27')](_0xd8e6('0x12c'),_0x4832c2));var _0x5ca610=this['tildeASR']['sync'](this,_0x360ebf,_0x4832c2);if(_0x5ca610){for(var _0xa20d50 in _0x5ca610){if(_0x5ca610['hasOwnProperty'](_0xa20d50)){this[_0xd8e6('0xe')][_0xd8e6('0xa1')](util[_0xd8e6('0x27')](_0xd8e6('0x12d'),_0xa20d50[_0xd8e6('0x6f')]()),_0x5ca610[_0xa20d50]);}}return this['channel'][_0xd8e6('0xa9')](util['format'](_0xd8e6('0x12e'),JSON[_0xd8e6('0x7a')](_0x5ca610)));}}return _0x5c07ef;};AGIVertices[_0xd8e6('0x11')]['gotoc']=function(_0x848a6f){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0x12f'),_0x848a6f[_0xd8e6('0x36')]));return this[_0xd8e6('0xe')][_0xd8e6('0x130')](_0x848a6f['context'],_0x848a6f[_0xd8e6('0x3d')],_0x848a6f[_0xd8e6('0x3e')]);};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x131')]=function(_0x69bd63){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x69bd63[_0xd8e6('0x36')]));if(!this[_0xd8e6('0x8b')](_0x69bd63[_0xd8e6('0x132')])){return this[_0xd8e6('0xe')]['error'](_0x69bd63,_0xd8e6('0x133'));}try{var _0x17ba7b=eval(_0x69bd63[_0xd8e6('0x132')])?'true':_0xd8e6('0x134');this['channel'][_0xd8e6('0xa9')](util[_0xd8e6('0x27')](_0xd8e6('0x135'),_0x69bd63[_0xd8e6('0x132')],_0x17ba7b));return{'code':0xc8,'result':_0x17ba7b};}catch(_0x5547f3){return{'code':0xc8,'result':_0xd8e6('0x134')};}};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x136')]=function(_0x40dfc9){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0x137'),_0x40dfc9['label']));if(!this['isConfigured'](_0x40dfc9[_0xd8e6('0x138')])){return this['channel'][_0xd8e6('0x2a')](_0x40dfc9,_0xd8e6('0x139'));}var _0x846d66=this[_0xd8e6('0x24')][_0xd8e6('0x77')](this,_0x40dfc9[_0xd8e6('0x138')]);if(!_0x846d66){return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x40dfc9,_0xd8e6('0x13a'));}for(var _0x45aaba=0x0;_0x45aaba<_0x846d66[_0xd8e6('0x9c')];_0x45aaba+=0x1){var _0x50ef39=this[_0xd8e6('0xe')][_0xd8e6('0xa4')](util[_0xd8e6('0x27')](_0xd8e6('0x13b'),_0x846d66[_0x45aaba]));if(_0x50ef39['result']===-0x1){return _0x50ef39;}logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0x13c'),_0x846d66[_0x45aaba],_0x50ef39['extra']));if(_0x50ef39[_0xd8e6('0xa6')]==='true'){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0x13c'),_0x846d66[_0x45aaba],_0xd8e6('0x13d')));this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util[_0xd8e6('0x27')](_0xd8e6('0x13c'),_0x846d66[_0x45aaba],_0xd8e6('0x13d')));return{'code':0xc8,'result':_0xd8e6('0x13d')};}else{logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0x13c'),_0x846d66[_0x45aaba],_0xd8e6('0x134')));this[_0xd8e6('0xe')]['noop'](util[_0xd8e6('0x27')](_0xd8e6('0x13c'),_0x846d66[_0x45aaba],'false'));}}return{'code':0xc8,'result':_0xd8e6('0x134')};};AGIVertices[_0xd8e6('0x11')]['hangup']=function(_0x17ff53){logger[_0xd8e6('0x2c')](util['format'](_0xd8e6('0x13e'),_0x17ff53[_0xd8e6('0x36')]));return this['channel'][_0xd8e6('0x13f')]();};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x140')]=function(_0x3c1fc9){logger[_0xd8e6('0x2c')](util['format'](_0xd8e6('0x141'),_0x3c1fc9[_0xd8e6('0x36')]));if(!this[_0xd8e6('0x8b')](_0x3c1fc9[_0xd8e6('0x87')])){return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](_0xd8e6('0xe0'));}var _0xcc3974=_0xd8e6('0x120');var _0x41d24e=util[_0xd8e6('0x27')](_0xd8e6('0x121'),FILES_PATH,rs[_0xd8e6('0x10e')](0x4));var _0x43fe72=util['format'](_0xd8e6('0xa0'),_0x41d24e,_0xcc3974);var _0x441c3b=!![];if(_0x3c1fc9[_0xd8e6('0x12a')]===_0xd8e6('0x122')){_0x441c3b=![];}var _0x5835c0=this[_0xd8e6('0xe')][_0xd8e6('0x12b')](_0x41d24e,_0xcc3974,_0x3c1fc9[_0xd8e6('0x142')],_0x3c1fc9[_0xd8e6('0x6c')],undefined,_0x441c3b);if(_0x5835c0['result']!==-0x1){this[_0xd8e6('0xe')]['noop'](util[_0xd8e6('0x27')](_0xd8e6('0x143'),_0x43fe72));var _0x2893e8=this[_0xd8e6('0x89')]['sync'](this,_0x3c1fc9,_0x43fe72);if(_0x2893e8){for(var _0x528ef3 in _0x2893e8){if(_0x2893e8['hasOwnProperty'](_0x528ef3)){this[_0xd8e6('0xe')]['setVariable'](util[_0xd8e6('0x27')](_0xd8e6('0x144'),_0x528ef3[_0xd8e6('0x6f')]()),_0x2893e8[_0x528ef3]);}}return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util[_0xd8e6('0x27')]('IspeechASR\x20Result\x20%s',JSON[_0xd8e6('0x7a')](_0x2893e8)));}}return _0x5835c0;};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x145')]=function(_0x1a6094){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0x146'),_0x1a6094['label']));if(!this[_0xd8e6('0x8b')](_0x1a6094['key'])){return this['channel'][_0xd8e6('0xa9')](_0xd8e6('0xe0'));}if(!this[_0xd8e6('0x8b')](_0x1a6094[_0xd8e6('0x61')])){return this['channel'][_0xd8e6('0xa9')]('no\x20text\x20configured');}this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util[_0xd8e6('0x27')](_0xd8e6('0x147'),_0x1a6094[_0xd8e6('0x61')]));var _0x47898c=this[_0xd8e6('0x148')]['sync'](this,_0x1a6094);if(_0x47898c){this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util[_0xd8e6('0x27')]('ispeech\x20%s\x20file\x20created',_0x47898c));var _0x36eb61=this[_0xd8e6('0xe')]['streamFile'](_0x47898c,_0x1a6094[_0xd8e6('0x142')]);try{fs[_0xd8e6('0xf9')](_0x47898c+_0xd8e6('0xfa'));}catch(_0xc5590e){logger[_0xd8e6('0x2a')](_0xc5590e);}return _0x36eb61;}return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x1a6094,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x149')]=function(_0x2f7012){logger[_0xd8e6('0x2c')](util['format'](_0xd8e6('0x14a'),_0x2f7012[_0xd8e6('0x36')]));if(!this[_0xd8e6('0x8b')](_0x2f7012[_0xd8e6('0x14b')])){return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x2f7012,_0xd8e6('0x14c'));}logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0x14d'),this[_0xd8e6('0xe')][_0xd8e6('0x39')],_0x2f7012[_0xd8e6('0x14b')]));var _0x3b41df=this['agentLogin'][_0xd8e6('0x77')](this,_0x2f7012['findBy']);if(_0x3b41df){logger['info'](util[_0xd8e6('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xd8e6('0x39')],_0x2f7012[_0xd8e6('0x14b')]));this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util[_0xd8e6('0x27')](_0xd8e6('0x14e'),this['channel'][_0xd8e6('0x39')],_0x2f7012[_0xd8e6('0x14b')]));return{'code':0xc8,'result':_0xd8e6('0x14f')};}else{logger['info'](util[_0xd8e6('0x27')](_0xd8e6('0x150'),this[_0xd8e6('0xe')][_0xd8e6('0x39')],_0x2f7012[_0xd8e6('0x14b')]));this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util[_0xd8e6('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xd8e6('0xe')][_0xd8e6('0x39')],_0x2f7012[_0xd8e6('0x14b')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xd8e6('0x11')]['logout']=function(_0x4480a1){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0x151'),_0x4480a1[_0xd8e6('0x36')]));if(!this['isConfigured'](_0x4480a1[_0xd8e6('0x14b')])){return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x4480a1,_0xd8e6('0x14c'));}logger[_0xd8e6('0x2c')](util['format'](_0xd8e6('0x14d'),this[_0xd8e6('0xe')]['callerid'],_0x4480a1[_0xd8e6('0x14b')]));var _0x5e6c41=this['agentLogout'][_0xd8e6('0x77')](this,_0x4480a1[_0xd8e6('0x14b')]);if(_0x5e6c41){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xd8e6('0xe')]['callerid'],_0x4480a1[_0xd8e6('0x14b')]));this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util[_0xd8e6('0x27')](_0xd8e6('0x14e'),this[_0xd8e6('0xe')][_0xd8e6('0x39')],_0x4480a1['findBy']));return{'code':0xc8,'result':_0xd8e6('0x14f')};}else{logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xd8e6('0x39')],_0x4480a1[_0xd8e6('0x14b')]));this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util['format'](_0xd8e6('0x150'),this[_0xd8e6('0xe')][_0xd8e6('0x39')],_0x4480a1[_0xd8e6('0x14b')]));return{'code':0xc8,'result':_0xd8e6('0x152')};}};AGIVertices[_0xd8e6('0x11')]['math']=function(_0x5ea267){logger['info'](util[_0xd8e6('0x27')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x5ea267[_0xd8e6('0x36')]));if(!this[_0xd8e6('0x8b')](_0x5ea267[_0xd8e6('0x153')])){return this['channel'][_0xd8e6('0x2a')](_0x5ea267,'no\x20operation\x20configured');}this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util['format'](_0xd8e6('0x154'),_0x5ea267[_0xd8e6('0x153')]));var _0x3bf75a=eval(_0x5ea267[_0xd8e6('0x153')]);if(!this[_0xd8e6('0x8b')](_0x5ea267[_0xd8e6('0xd2')])){return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](_0xd8e6('0x155'));}var _0x5119f2=this['getVariable'][_0xd8e6('0x77')](this,_0x5ea267[_0xd8e6('0xd2')]);if(!_0x5119f2){return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x5ea267,_0xd8e6('0xd3'));}if(_[_0xd8e6('0x9b')](_0x3bf75a)){var _0x44356a=this;_0x3bf75a['forEach'](function(_0x1f84f5,_0xc13e77){_0x44356a[_0xd8e6('0xe')][_0xd8e6('0xa1')](util[_0xd8e6('0x27')]('%s[%s]',_0x5119f2,_0xc13e77),_0x1f84f5);});return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util[_0xd8e6('0x27')](_0xd8e6('0x156'),_0x5119f2));}else{return this[_0xd8e6('0xe')]['setVariable'](_0x5119f2,_0x3bf75a);}};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0xc')]=function(_0x1473e3){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x1473e3['label']));if(_0x1473e3[_0xd8e6('0xa8')]===0x0){return this['maxRetry'](_0x1473e3);}_0x1473e3[_0xd8e6('0xa8')]-=0x1;if(!this[_0xd8e6('0x8b')](_0x1473e3[_0xd8e6('0x106')])){return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x1473e3,_0xd8e6('0x105'));}var _0x5d467c=this['getSound'][_0xd8e6('0x77')](this,_0x1473e3[_0xd8e6('0x106')]);if(!_0x5d467c){return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x1473e3,_0xd8e6('0x107'));}var _0x29b28b=this[_0xd8e6('0xe')][_0xd8e6('0x108')](_0x5d467c,_0x1473e3['response'],_0x1473e3[_0xd8e6('0x157')]);var _0xb1c14=_0x29b28b[_0xd8e6('0xa5')];if(_0x29b28b['result']===-0x1){this['createSquareDetailsReport'][_0xd8e6('0x77')](this,_0x1473e3,'-1');return _0x29b28b;}else if(_0x29b28b[_0xd8e6('0xa6')]===_0xd8e6('0x6c')){_0x29b28b[_0xd8e6('0xa5')]=_0x29b28b[_0xd8e6('0xa5')][_0xd8e6('0x9c')]>0x0?_0x29b28b[_0xd8e6('0xa5')]:'t';}else if(_['isEmpty'](_0x29b28b['result'])){_0x29b28b[_0xd8e6('0xa5')]='#';_0xb1c14='#';}if(!this[_0xd8e6('0x8b')](_0x1473e3[_0xd8e6('0xd2')])){this['channel'][_0xd8e6('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0xf9e33c=this[_0xd8e6('0xa4')][_0xd8e6('0x77')](this,_0x1473e3[_0xd8e6('0xd2')]);if(!_0xf9e33c){return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x1473e3,_0xd8e6('0xd3'));}this[_0xd8e6('0xe')]['setVariable'](_0xf9e33c,_0xb1c14);}this[_0xd8e6('0x34')]['sync'](this,_0x1473e3,_0xb1c14);return _0x29b28b;};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0xa9')]=function(_0x5bafe7){logger['info'](util[_0xd8e6('0x27')](_0xd8e6('0x158'),_0x5bafe7['label']));return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](_0x5bafe7[_0xd8e6('0x159')]||_0x5bafe7[_0xd8e6('0x36')]);};AGIVertices['prototype'][_0xd8e6('0x15a')]=function(_0x122a78){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0x15b'),_0x122a78[_0xd8e6('0x36')]));if(!this['isConfigured'](_0x122a78[_0xd8e6('0x14b')])){return this['channel'][_0xd8e6('0x2a')](_0x122a78,_0xd8e6('0x14c'));}logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0x14d'),this[_0xd8e6('0xe')][_0xd8e6('0x39')],_0x122a78['findBy']));var _0x52ba18=this[_0xd8e6('0x50')][_0xd8e6('0x77')](this,_0x122a78[_0xd8e6('0x15c')]);var _0x314acc=this[_0xd8e6('0x52')][_0xd8e6('0x77')](this,_0x122a78[_0xd8e6('0x14b')],_0x52ba18);if(_0x314acc){logger[_0xd8e6('0x2c')](util['format'](_0xd8e6('0x14e'),this[_0xd8e6('0xe')]['callerid'],_0x122a78['findBy']));this['channel']['noop'](util['format'](_0xd8e6('0x14e'),this['channel'][_0xd8e6('0x39')],_0x122a78[_0xd8e6('0x14b')]));return{'code':0xc8,'result':_0xd8e6('0x14f')};}else{logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0x150'),this[_0xd8e6('0xe')]['callerid'],_0x122a78[_0xd8e6('0x14b')]));this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util['format'](_0xd8e6('0x14e'),this[_0xd8e6('0xe')]['callerid'],_0x122a78[_0xd8e6('0x14b')]));return{'code':0xc8,'result':_0xd8e6('0x152')};}};AGIVertices['prototype']['playback']=function(_0x53636e){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x53636e[_0xd8e6('0x36')]));if(!this[_0xd8e6('0x8b')](_0x53636e[_0xd8e6('0x106')])){return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x53636e,_0xd8e6('0x105'));}var _0x6e36db=this[_0xd8e6('0x15d')][_0xd8e6('0x77')](this,_0x53636e['file_id']);if(!_0x6e36db){return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x53636e,'no\x20file\x20audio\x20found');}var _0x5801f6=this['channel'][_0xd8e6('0x5b')]('PLAYBACK',[_0x6e36db,_0x53636e[_0xd8e6('0xdb')]]);if(_0x5801f6[_0xd8e6('0xa5')]===-0x1){return _0x5801f6;}return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util[_0xd8e6('0x27')](_0xd8e6('0xc0'),_0xd8e6('0x15e'),_0x6e36db));};AGIVertices['prototype'][_0xd8e6('0x15f')]=function(_0x5d24fc){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0x160'),_0x5d24fc[_0xd8e6('0x36')]));if(!this['isConfigured'](_0x5d24fc[_0xd8e6('0x161')])){return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x5d24fc,_0xd8e6('0x162'));}var _0x192f81='';var _0x594dc7=parseInt(_0x5d24fc['queue_id'],0xa);if(isNaN(_0x594dc7)){_0x192f81=_0x5d24fc['queue_id'];}else{_0x192f81=this[_0xd8e6('0x163')][_0xd8e6('0x77')](this,_0x5d24fc['queue_id']);if(!_0x192f81){return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x5d24fc,_0xd8e6('0x164'));}}var _0x29f001='';if(this[_0xd8e6('0x8b')](_0x5d24fc[_0xd8e6('0x106')])){var _0x1f6313=this[_0xd8e6('0x15d')][_0xd8e6('0x77')](this,_0x5d24fc[_0xd8e6('0x106')]);if(_0x1f6313){_0x29f001=_0x1f6313;}}this[_0xd8e6('0x34')]['sync'](this,_0x5d24fc,_0x192f81);if(_0x5d24fc['opts']['indexOf']('x')<0x0){_0x5d24fc[_0xd8e6('0xdb')]+='x';}if(_0x5d24fc['opts'][_0xd8e6('0x165')]('X')<0x0){_0x5d24fc['opts']+='X';}this[_0xd8e6('0xe')][_0xd8e6('0xa1')](_0xd8e6('0x166'),_0x192f81?_0x192f81[_0xd8e6('0x167')]():'');var _0x26b29e=this[_0xd8e6('0xe')][_0xd8e6('0x5b')](_0xd8e6('0x168'),[_0x192f81,_0x5d24fc['opts'],_0x5d24fc[_0xd8e6('0x6a')],_0x29f001,_0x5d24fc[_0xd8e6('0x6c')],_0x5d24fc[_0xd8e6('0xb5')],_0x5d24fc[_0xd8e6('0x169')],_0x5d24fc['gosub'],'',_0x5d24fc[_0xd8e6('0x16a')]]);if(_0x26b29e[_0xd8e6('0xa5')]===-0x1){return _0x26b29e;}return this[_0xd8e6('0xe')]['noop'](util[_0xd8e6('0x27')](_0xd8e6('0xc0'),_0xd8e6('0x168'),_0x192f81));};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x16b')]=function(_0x339124){logger[_0xd8e6('0x2c')](util['format'](_0xd8e6('0x16c'),_0x339124[_0xd8e6('0x36')]));var _0x1c6c5a=_0x339124[_0xd8e6('0x16d')]||_0xd8e6('0x120');var _0x163512=util['format'](_0xd8e6('0x16e'),this[_0xd8e6('0xe')]['uniqueid'],rs[_0xd8e6('0x10e')](0x5));var _0x31cbce=util[_0xd8e6('0x27')](_0xd8e6('0x16f'),FILES_PATH,_0x163512,_0x1c6c5a);var _0x84d938=util[_0xd8e6('0x27')](_0xd8e6('0x121'),FILES_PATH,_0x163512);this[_0xd8e6('0x3a')]['sync'](this,_0x339124,_0x163512,_0x31cbce);this[_0xd8e6('0xe')][_0xd8e6('0xa1')]('RECORDING_SAVENAME',_0x163512);logger['info']('Recording\x20%s\x20%s\x20%s\x20%s',_0x84d938,_0x1c6c5a,_0x339124[_0xd8e6('0x170')],_0x339124[_0xd8e6('0x6c')]);return this[_0xd8e6('0xe')]['recordFile'](_0x84d938,_0x1c6c5a,_0x339124['escape_digits'],_0x339124[_0xd8e6('0x6c')],undefined,!![]);};AGIVertices[_0xd8e6('0x11')]['restapi']=function(_0x53d5df){logger['info'](util[_0xd8e6('0x27')](_0xd8e6('0x171'),_0x53d5df[_0xd8e6('0x36')]));if(!this[_0xd8e6('0x8b')](_0x53d5df[_0xd8e6('0x6a')])){return this[_0xd8e6('0xe')]['noop'](_0xd8e6('0x172'));}var _0x486a44=this[_0xd8e6('0x69')][_0xd8e6('0x77')](this,_0x53d5df);logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')]('Response:',util['inspect'](_0x486a44,{'showHidden':![],'depth':null})));if(!this[_0xd8e6('0x8b')](_0x53d5df[_0xd8e6('0xd2')])){return this[_0xd8e6('0xe')]['noop']('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x316159=this[_0xd8e6('0xa4')]['sync'](this,_0x53d5df[_0xd8e6('0xd2')]);if(!_0x316159){return this['channel'][_0xd8e6('0x2a')](_0x53d5df,_0xd8e6('0xd3'));}this[_0xd8e6('0xe')]['setVariable'](util[_0xd8e6('0x27')](_0xd8e6('0x173'),_0x316159),_0x486a44['statusCode']?_0x486a44[_0xd8e6('0x7b')]:_0xd8e6('0x174'));this[_0xd8e6('0xe')][_0xd8e6('0xa1')](util[_0xd8e6('0x27')](_0xd8e6('0x175'),_0x316159),_0x486a44[_0xd8e6('0x7c')]?_0x486a44[_0xd8e6('0x7c')]:'OK');if(_0x486a44[_0xd8e6('0x70')]){try{this[_0xd8e6('0x9f')](_0x486a44['body'],_0x316159);}catch(_0x2de3a3){logger['error'](util[_0xd8e6('0x27')](_0xd8e6('0x176'),_0x316159));}}return this['channel']['noop'](util[_0xd8e6('0x27')](_0xd8e6('0xd6'),_0x316159));};AGIVertices['prototype'][_0xd8e6('0x177')]=function(_0x1931d6){logger[_0xd8e6('0x2c')](util['format']('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x1931d6[_0xd8e6('0x36')]));return this[_0xd8e6('0xe')][_0xd8e6('0x178')](_0x1931d6[_0xd8e6('0x179')][_0xd8e6('0x5d')](/\s+/g,''),_0x1931d6[_0xd8e6('0x170')]);};AGIVertices['prototype'][_0xd8e6('0x17a')]=function(_0x719643){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0x17b'),_0x719643[_0xd8e6('0x36')]));return this[_0xd8e6('0xe')][_0xd8e6('0x17c')](_0x719643[_0xd8e6('0x6d')][_0xd8e6('0x5d')](/\s+/g,''),_0x719643[_0xd8e6('0x170')]);};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x17d')]=function(_0x2ff48b){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x2ff48b[_0xd8e6('0x36')]));return this['channel'][_0xd8e6('0x17e')](_0x2ff48b[_0xd8e6('0x61')],_0x2ff48b[_0xd8e6('0x170')]);};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x17f')]=function(_0x152d15){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0x180'),_0x152d15[_0xd8e6('0x36')]));if(!this['isConfigured'](_0x152d15[_0xd8e6('0x181')])){return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](_0xd8e6('0x182'));}var _0x5b006d=this[_0xd8e6('0x21')]['sync'](this,_0x152d15[_0xd8e6('0x181')]);if(!_0x5b006d||!_0x5b006d[_0xd8e6('0x183')]){return this['channel'][_0xd8e6('0x2a')](_0x152d15,'no\x20mail\x20account\x20found');}var _0x2a5580={'from':util[_0xd8e6('0x27')]('\x22%s\x22\x20<%s>',_0x5b006d[_0xd8e6('0x15')],_0x5b006d['email']||_0x5b006d[_0xd8e6('0x183')]['user']),'to':_0x152d15['to']||'','cc':_0x152d15['cc']||'','bcc':_0x152d15[_0xd8e6('0x184')]||'','subject':_0x152d15[_0xd8e6('0x185')],'html':_0x152d15[_0xd8e6('0x61')],'text':_0x152d15['text']};var _0x1ab5b7={'tls':{'rejectUnauthorized':![]}};if(_0x5b006d[_0xd8e6('0x183')]['service']){_0x1ab5b7[_0xd8e6('0x186')]=_0x5b006d[_0xd8e6('0x183')][_0xd8e6('0x186')];}else{_0x1ab5b7['host']=_0x5b006d[_0xd8e6('0x183')][_0xd8e6('0x187')];_0x1ab5b7['port']=_0x5b006d['Smtp']['port'];_0x1ab5b7['secure']=_0x5b006d['Smtp'][_0xd8e6('0x188')];}if(_0x5b006d['Smtp'][_0xd8e6('0x189')]){_0x1ab5b7['auth']={'user':_0x5b006d[_0xd8e6('0x183')][_0xd8e6('0x18a')],'pass':_0x5b006d[_0xd8e6('0x183')][_0xd8e6('0x18b')]};}if(this['isConfigured'](_0x152d15[_0xd8e6('0x18c')])){}logger[_0xd8e6('0xd7')]('sendMail\x20message',JSON[_0xd8e6('0x7a')](_0x2a5580));this['createSquareDetailsReport'][_0xd8e6('0x77')](this,_0x152d15,_0x152d15[_0xd8e6('0x181')]);this['channel'][_0xd8e6('0xa9')](util[_0xd8e6('0x27')](_0xd8e6('0x18d'),_0x5b006d[_0xd8e6('0x15')]));this[_0xd8e6('0x23')][_0xd8e6('0x77')](this,_0x1ab5b7,_0x2a5580);return this['channel'][_0xd8e6('0xa9')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0xd8e6('0x18e')]=function(_0x355ba8){logger[_0xd8e6('0x2c')](util['format'](_0xd8e6('0x18f'),_0x355ba8[_0xd8e6('0x36')]));return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](_0xd8e6('0x190'));};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x191')]=function(_0x734c26){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0x192'),_0x734c26[_0xd8e6('0x36')]));if(!this[_0xd8e6('0x8b')](_0x734c26[_0xd8e6('0x193')])){return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](_0xd8e6('0x194'));}var _0x242d76=this['getSmsAccount'][_0xd8e6('0x77')](this,_0x734c26[_0xd8e6('0x193')]);if(!_0x242d76){return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x734c26,_0xd8e6('0x195'));}var _0x23768d={'body':_0x734c26[_0xd8e6('0x196')],'phone':_0x734c26['to']||'','SmsAccountId':_0x242d76['id']};logger[_0xd8e6('0xd7')](_0xd8e6('0x197'),JSON[_0xd8e6('0x7a')](_0x23768d));this[_0xd8e6('0x34')][_0xd8e6('0x77')](this,_0x734c26,_0x734c26[_0xd8e6('0x193')]);this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util[_0xd8e6('0x27')](_0xd8e6('0x198'),_0x242d76[_0xd8e6('0x15')]));this[_0xd8e6('0x33')]['sync'](this,_0x23768d);return this['channel'][_0xd8e6('0xa9')](_0xd8e6('0x199'));};AGIVertices['prototype'][_0xd8e6('0x19a')]=function(_0x57e012){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0x19b'),_0x57e012['label']));if(!this[_0xd8e6('0x8b')](_0x57e012[_0xd8e6('0xd2')])){return this[_0xd8e6('0xe')]['error'](_0x57e012,_0xd8e6('0x19c'));}var _0x147bfc=this['getVariable'][_0xd8e6('0x77')](this,_0x57e012[_0xd8e6('0xd2')]);if(!_0x147bfc){return this['channel']['error'](_0x57e012,'no\x20variable\x20found');}return this[_0xd8e6('0xe')][_0xd8e6('0xa1')](_0x147bfc,_0x57e012[_0xd8e6('0x19d')]);};AGIVertices['prototype'][_0xd8e6('0x19e')]=function(_0x2b1b03){logger['info'](util[_0xd8e6('0x27')](_0xd8e6('0x19f'),_0x2b1b03[_0xd8e6('0x36')]));this['channel'][_0xd8e6('0xa9')](_0xd8e6('0x1a0'));if(_0x2b1b03[_0xd8e6('0xb6')]==='yes'){this[_0xd8e6('0xe')][_0xd8e6('0xa9')](_0xd8e6('0x1a1'));return this[_0xd8e6('0xe')][_0xd8e6('0xb6')]();}return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](_0xd8e6('0x1a2'));};AGIVertices[_0xd8e6('0x11')]['subproject']=function(_0x11fe59){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0x1a3'),_0x11fe59[_0xd8e6('0x36')]));if(!this[_0xd8e6('0x8b')](_0x11fe59['project_id'])){return this['channel'][_0xd8e6('0x2a')](_0x11fe59,_0xd8e6('0x1a4'));}var _0x4c1443=this[_0xd8e6('0x17')][_0xd8e6('0x77')](this,_0x11fe59[_0xd8e6('0x1a5')]);if(!this[_0xd8e6('0x8b')](_0x4c1443)){return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x11fe59,util[_0xd8e6('0x27')](_0xd8e6('0x1a6'),_0x11fe59[_0xd8e6('0x1a5')]));}if(_0x4c1443===this['channel'][_0xd8e6('0x38')]){return this[_0xd8e6('0xe')]['error'](_0x11fe59,_0xd8e6('0x1a7'));}this['createSquareDetailsReport']['sync'](this,_0x11fe59,_0x4c1443);var _0x4675ba=this[_0xd8e6('0xe')]['exec'](_0xd8e6('0x1a8'),util[_0xd8e6('0x27')](_0xd8e6('0x1a9'),config[_0xd8e6('0xb5')][_0xd8e6('0x187')]||_0xd8e6('0x1aa'),_0x4c1443,this[_0xd8e6('0xe')][_0xd8e6('0x38')]));if(_0x4675ba['result']===-0x1){return _0x4675ba;}return this['channel'][_0xd8e6('0xa9')](util['format']('Executed\x20command\x20%s\x20%s',_0xd8e6('0x1a8'),_0x4c1443));};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x1ab')]=function(_0x19dd36){logger[_0xd8e6('0x2c')](util['format'](_0xd8e6('0x1ac'),_0x19dd36[_0xd8e6('0x36')]));var _0x4251ff=this[_0xd8e6('0x5a')][_0xd8e6('0x77')](this,_0x19dd36[_0xd8e6('0x1ad')]);this[_0xd8e6('0x34')][_0xd8e6('0x77')](this,_0x19dd36,_0x19dd36[_0xd8e6('0x1ad')]);if(this[_0xd8e6('0x8b')](_0x19dd36[_0xd8e6('0xd2')])){var _0x415b89=this[_0xd8e6('0xa4')][_0xd8e6('0x77')](this,_0x19dd36[_0xd8e6('0xd2')]);if(_0x415b89){this[_0xd8e6('0xe')][_0xd8e6('0xa1')](_0x415b89,_0x4251ff);return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util[_0xd8e6('0x27')](_0xd8e6('0x1ae'),_0x19dd36[_0xd8e6('0x1ad')],_0x415b89));}}return this['channel'][_0xd8e6('0xa9')](util['format'](_0xd8e6('0x1af'),_0x19dd36[_0xd8e6('0x1ad')]));};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x1b0')]=function(_0x2d25e5){logger[_0xd8e6('0x2c')](util['format'](_0xd8e6('0x1b1'),_0x2d25e5[_0xd8e6('0x36')]));_0x2d25e5[_0xd8e6('0x61')]=_0x2d25e5[_0xd8e6('0x61')][_0xd8e6('0x5d')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xd8e6('0x8b')](_0x2d25e5[_0xd8e6('0x5f')])){return this[_0xd8e6('0xe')]['noop'](_0xd8e6('0x1b2'));}if(!this[_0xd8e6('0x8b')](_0x2d25e5[_0xd8e6('0x61')])){return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](_0xd8e6('0xaa'));}this['channel']['noop'](util[_0xd8e6('0x27')](_0xd8e6('0x1b3'),_0x2d25e5['text']));var _0xb30e9=this['googleCloudTTS']['sync'](this,_0x2d25e5);if(_0xb30e9){this['channel'][_0xd8e6('0xa9')](util[_0xd8e6('0x27')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0xb30e9));var _0x2315bf=this['channel'][_0xd8e6('0xf8')](_0xb30e9);try{fs[_0xd8e6('0xf9')](_0xb30e9+_0xd8e6('0xfa'));}catch(_0x381d8e){logger[_0xd8e6('0x2a')](_0x381d8e);}return _0x2315bf;}return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x2d25e5,_0xd8e6('0x1b4'));};AGIVertices['prototype'][_0xd8e6('0x1b5')]=function(_0x3c4e4){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0x1b6'),_0x3c4e4[_0xd8e6('0x36')]));_0x3c4e4['text']=_0x3c4e4[_0xd8e6('0x61')][_0xd8e6('0x5d')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xd8e6('0x8b')](_0x3c4e4[_0xd8e6('0x61')])){return this['channel'][_0xd8e6('0xa9')](_0xd8e6('0xaa'));}this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util[_0xd8e6('0x27')]('Trying\x20Google\x20TTS\x20%s',_0x3c4e4[_0xd8e6('0x61')]));var _0x537435=this[_0xd8e6('0x67')][_0xd8e6('0x77')](this,_0x3c4e4);if(_0x537435){this[_0xd8e6('0xe')]['noop'](util['format'](_0xd8e6('0x1b7'),_0x537435));var _0x1e7b4f=this[_0xd8e6('0xe')][_0xd8e6('0xf8')](_0x537435);try{fs[_0xd8e6('0xf9')](_0x537435+_0xd8e6('0xfa'));}catch(_0x18ff1c){logger[_0xd8e6('0x2a')](_0x18ff1c);}return _0x1e7b4f;}return this['channel'][_0xd8e6('0x2a')](_0x3c4e4,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x1b8')]=function(_0x14e8bf){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0x1b9'),_0x14e8bf['label']));if(!this[_0xd8e6('0x8b')](_0x14e8bf[_0xd8e6('0x14b')])){return this['channel']['error'](_0x14e8bf,_0xd8e6('0x14c'));}logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xd8e6('0xe')][_0xd8e6('0x39')],_0x14e8bf[_0xd8e6('0x14b')]));var _0x574834=this[_0xd8e6('0x54')]['sync'](this,_0x14e8bf[_0xd8e6('0x14b')]);if(_0x574834){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0x14e'),this['channel']['callerid'],_0x14e8bf[_0xd8e6('0x14b')]));this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util[_0xd8e6('0x27')](_0xd8e6('0x14e'),this[_0xd8e6('0xe')][_0xd8e6('0x39')],_0x14e8bf[_0xd8e6('0x14b')]));return{'code':0xc8,'result':_0xd8e6('0x14f')};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xd8e6('0x39')],_0x14e8bf[_0xd8e6('0x14b')]));this['channel'][_0xd8e6('0xa9')](util[_0xd8e6('0x27')](_0xd8e6('0x150'),this[_0xd8e6('0xe')][_0xd8e6('0x39')],_0x14e8bf['findBy']));return{'code':0xc8,'result':_0xd8e6('0x152')};}};AGIVertices['prototype']['voicemail']=function(_0x5f1e59){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0x1ba'),_0x5f1e59[_0xd8e6('0x36')]));var _0x21422b=this[_0xd8e6('0xe')][_0xd8e6('0x5b')](_0xd8e6('0x1bb'),[_0x5f1e59[_0xd8e6('0x1bc')],_0x5f1e59[_0xd8e6('0x7f')]]);if(_0x21422b[_0xd8e6('0xa5')]===-0x1){return _0x21422b;}return this[_0xd8e6('0xe')][_0xd8e6('0xa9')](util['format'](_0xd8e6('0xc0'),_0xd8e6('0x1bb'),_0x5f1e59['mailbox']));};AGIVertices[_0xd8e6('0x11')][_0xd8e6('0x1bd')]=function(_0x35f75f){logger[_0xd8e6('0x2c')](util[_0xd8e6('0x27')](_0xd8e6('0x1be'),_0x35f75f[_0xd8e6('0x36')]));if(!this['isConfigured'](_0x35f75f['variable_id'])){return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x35f75f,_0xd8e6('0x19c'));}var _0x3dfc65=this['getVariable'][_0xd8e6('0x77')](this,_0x35f75f[_0xd8e6('0xd2')]);if(!_0x3dfc65){return this[_0xd8e6('0xe')][_0xd8e6('0x2a')](_0x35f75f,_0xd8e6('0xd3'));}var _0x1b003f=this[_0xd8e6('0xe')]['getVariable'](_0x3dfc65);return{'code':0xc8,'result':_0x1b003f[_0xd8e6('0xa6')]?_0x1b003f['extra']:'-'};};String[_0xd8e6('0x11')][_0xd8e6('0xa2')]=function(_0x11197c,_0x408ab3){return this['split'](_0x11197c)[_0xd8e6('0x1bf')](_0x408ab3);};module[_0xd8e6('0x1c0')]=AGIVertices; \ No newline at end of file +var _0x5924=['no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','intKey','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','continueAt','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','recordFile','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','AGENT\x20%s\x20FOUND\x20BY','failure','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','restAPI','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','statusMessage','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','auth','pass','template_id','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','subproject','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\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','no\x20variable\x20selected','util','lodash','shelljs','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','then','name','catch','getVoiceQueueById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','arg_1','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','shellCommand','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language','url','method','timeout','number','includes','POST','PUT','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','en-US','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','google_asr_language','tildeASR','appid','appsecret','clone','hasOwnProperty','isString','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','replaceAllVariables','saveRestApiResult','%s.%s','setVariable','split','extra','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','isConfigured','exec','MRCPSynth','result','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','getAndSetVariable','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','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','MRCPRecog','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','replace','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','DIALOGFLOW_%s','toUpperCase','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','out','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','bot','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s'];(function(_0x2ffd40,_0x66e6e){var _0x2d13b2=function(_0x4db30b){while(--_0x4db30b){_0x2ffd40['push'](_0x2ffd40['shift']());}};_0x2d13b2(++_0x66e6e);}(_0x5924,0xa2));var _0x4592=function(_0x3dc6f4,_0x362e2a){_0x3dc6f4=_0x3dc6f4-0x0;var _0x3b18e9=_0x5924[_0x3dc6f4];return _0x3b18e9;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x4592('0x0'));var _=require(_0x4592('0x1'));var sh=require(_0x4592('0x2'));var odbc=require('odbc')();var rs=require(_0x4592('0x3'));var moment=require(_0x4592('0x4'));var Mustache=require(_0x4592('0x5'));var rp=require(_0x4592('0x6'));var logger=require(_0x4592('0x7'))(_0x4592('0x8'));var config=require(_0x4592('0x9'));var scripts=require(_0x4592('0xa'));var FILES_PATH=_0x4592('0xb');var recursiveMapAttributes=[_0x4592('0xc'),_0x4592('0xd')];var verticesWithRetry=[_0x4592('0xe'),_0x4592('0xf'),_0x4592('0x10')];var AGIVertices=function(_0x5da366,_0x2e58e6,_0x1a7300){this[_0x4592('0x11')]=_0x5da366;this[_0x4592('0x12')]=_0x2e58e6;this[_0x4592('0x13')]=_0x1a7300;};AGIVertices[_0x4592('0x14')][_0x4592('0x15')]=function(_0x1d3455,_0x3cebdd){this[_0x4592('0x12')]['getVariableById'](_0x1d3455)[_0x4592('0x16')](function(_0x2bab91){_0x3cebdd(null,_0x2bab91?_0x2bab91[_0x4592('0x17')]:![]);})[_0x4592('0x18')](function(_0x250fe9){_0x3cebdd(_0x250fe9);});};AGIVertices[_0x4592('0x14')]['getVoiceQueue']=function(_0x407edf,_0x20f04f){this[_0x4592('0x12')][_0x4592('0x19')](_0x407edf)[_0x4592('0x16')](function(_0x324b1d){_0x20f04f(null,_0x324b1d?_0x324b1d[_0x4592('0x17')]:![]);})[_0x4592('0x18')](function(_0x1c67b5){_0x20f04f(_0x1c67b5);});};AGIVertices[_0x4592('0x14')]['getSquareProject']=function(_0x457fe7,_0x2fef18){this[_0x4592('0x12')]['getSquareProjectById'](_0x457fe7)[_0x4592('0x16')](function(_0x450b4b){_0x2fef18(null,_0x450b4b?_0x450b4b[_0x4592('0x17')]:![]);})['catch'](function(_0x4a0fa7){_0x2fef18(_0x4a0fa7);});};AGIVertices[_0x4592('0x14')]['getSquareOdbc']=function(_0xc8ab70,_0xe8a31b){this['rpc']['getSquareOdbcById'](_0xc8ab70)[_0x4592('0x16')](function(_0x11c0b7){_0xe8a31b(null,_0x11c0b7?_0x11c0b7[_0x4592('0x1a')]:![]);})[_0x4592('0x18')](function(_0x5262e9){_0xe8a31b(_0x5262e9);});};AGIVertices[_0x4592('0x14')][_0x4592('0x1b')]=function(_0x50ee5d,_0x4cac48){this[_0x4592('0x12')][_0x4592('0x1c')](_0x50ee5d)[_0x4592('0x16')](function(_0x404ec6){_0x4cac48(null,_0x404ec6?_0x404ec6[_0x4592('0x17')]:![]);})[_0x4592('0x18')](function(_0x33521b){_0x4cac48(_0x33521b);});};AGIVertices['prototype'][_0x4592('0x1d')]=function(_0x201d6e,_0x2e6296){this[_0x4592('0x12')][_0x4592('0x1e')](_0x201d6e)['then'](function(_0x4180c5){_0x2e6296(null,_0x4180c5?_0x4180c5[_0x4592('0x17')]:![]);})[_0x4592('0x18')](function(_0x5ab7fe){_0x2e6296(_0x5ab7fe);});};AGIVertices[_0x4592('0x14')][_0x4592('0x1f')]=function(_0x35719e,_0x36c8fa){var _0x187222=this;this[_0x4592('0x12')][_0x4592('0x20')](_0x35719e)[_0x4592('0x16')](function(_0x5a4d80){_0x36c8fa(null,_0x5a4d80?_0x187222[_0x4592('0x21')](_0x5a4d80['save_name']):![]);})['catch'](function(_0x4ecbcc){_0x36c8fa(_0x4ecbcc);});};AGIVertices['prototype'][_0x4592('0x22')]=function(_0x140fdf,_0x10eda7){this['rpc'][_0x4592('0x23')](_0x140fdf)[_0x4592('0x16')](function(_0x3013b5){_0x10eda7(null,_0x3013b5?_0x3013b5:![]);})[_0x4592('0x18')](function(_0x59cb0a){_0x10eda7(_0x59cb0a);});};AGIVertices[_0x4592('0x14')][_0x4592('0x24')]=function(_0x224264,_0x8d483b,_0x4c8042){this[_0x4592('0x13')]['sendMailMessage'](_0x224264,_0x8d483b)[_0x4592('0x16')](function(){_0x4c8042(null);})[_0x4592('0x18')](function(_0x11a7c4){_0x4c8042(_0x11a7c4);});};AGIVertices[_0x4592('0x14')][_0x4592('0x25')]=function(_0xb1f98e,_0x25b969){this[_0x4592('0x12')][_0x4592('0x26')](_0xb1f98e)['then'](function(_0x3947ca){if(_0x3947ca){if(_0x3947ca[_0x4592('0x27')]){_0x25b969(null,[_0x3947ca[_0x4592('0x28')]]);}else{_0x25b969(null,_[_0x4592('0x29')](_0x3947ca[_0x4592('0x2a')],_0x4592('0x28')));}}else{_0x25b969(null,![]);}})[_0x4592('0x18')](function(_0x2cfeff){_0x25b969(_0x2cfeff);});};AGIVertices[_0x4592('0x14')]['getSoundPath']=function(_0x353aad){return util[_0x4592('0x2b')]('%s/sounds/converted/%s',FILES_PATH,_0x353aad);};AGIVertices[_0x4592('0x14')][_0x4592('0x2c')]=function(_0x2e5a6b,_0x1f318a,_0x439c67){odbc[_0x4592('0x2d')](_0x2e5a6b,function(_0x717000){if(_0x717000){logger['error'](_0x4592('0x2e'),_0x717000);_0x439c67(_0x717000);}else{logger['info'](_0x4592('0x2f'));odbc[_0x4592('0x30')](_0x1f318a,function(_0x396a6b,_0xcff94a){if(_0x396a6b){logger[_0x4592('0x31')](_0x4592('0x32'),_0x1f318a);_0x439c67(_0x396a6b);}else{logger[_0x4592('0x31')](_0x4592('0x33'),_0x1f318a);odbc['close'](function(_0x21fff3){if(_0x21fff3){logger[_0x4592('0x34')](_0x4592('0x35'),_0x21fff3);}_0x439c67(null,_0xcff94a);});}});}});};AGIVertices[_0x4592('0x14')][_0x4592('0x36')]=function(_0x492adc,_0x493452){this[_0x4592('0x12')][_0x4592('0x37')](_0x492adc)[_0x4592('0x16')](function(_0x438987){_0x493452(null,_0x438987?_0x438987:![]);})[_0x4592('0x18')](function(_0x10baf0){_0x493452(_0x10baf0);});};AGIVertices[_0x4592('0x14')]['createSmsMessage']=function(_0x4571e1,_0x55f3b4){this[_0x4592('0x12')][_0x4592('0x38')](_0x4571e1)[_0x4592('0x16')](function(_0x2e2e9f){_0x55f3b4(null,_0x2e2e9f);})[_0x4592('0x18')](function(_0x1cf8ce){_0x55f3b4(_0x1cf8ce);});};AGIVertices[_0x4592('0x14')][_0x4592('0x39')]=function(_0x3da1d0,_0x4db3c4,_0x41b864){this[_0x4592('0x12')][_0x4592('0x39')]({'uniqueid':this['channel'][_0x4592('0x3a')],'node':_0x3da1d0[_0x4592('0x3b')],'application':_0x3da1d0[_0x4592('0x3c')],'data':_0x4db3c4||null,'project_name':this['channel']['arg_1'],'callerid':this['channel'][_0x4592('0x3d')]})[_0x4592('0x16')](function(_0x7eac1b){if(_0x41b864){_0x41b864(null,_0x7eac1b);}})[_0x4592('0x18')](function(_0x2ffb81){if(_0x41b864){_0x41b864(_0x2ffb81);}});};AGIVertices[_0x4592('0x14')]['createSquareRecording']=function(_0x4ddd87,_0xac7b10,_0x3afd78,_0x5999a0){this['rpc'][_0x4592('0x3e')]({'uniqueid':this[_0x4592('0x11')]['uniqueid'],'callerid':this['channel']['callerid'],'calleridname':this[_0x4592('0x11')][_0x4592('0x3f')],'context':this[_0x4592('0x11')][_0x4592('0x40')],'extension':this[_0x4592('0x11')][_0x4592('0x41')],'priority':this[_0x4592('0x11')][_0x4592('0x42')],'accountcode':this[_0x4592('0x11')][_0x4592('0x43')],'dnid':this['channel'][_0x4592('0x44')],'projectName':this['channel'][_0x4592('0x45')],'saveName':_0xac7b10,'filename':_0x4ddd87[_0x4592('0x46')]||_0xac7b10,'savePath':_0x3afd78})['then'](function(_0xf01410){_0x5999a0(null,_0xf01410);})['catch'](function(_0x5ed9f5){_0x5999a0(_0x5ed9f5);});};AGIVertices['prototype']['createSquareMessage']=function(_0xea49e0,_0x563a7f,_0x44ad7a,_0x418364,_0xffd6b8){this[_0x4592('0x12')][_0x4592('0x47')]({'uniqueid':this[_0x4592('0x11')]['uniqueid'],'body':_0xea49e0,'direction':_0x563a7f,'providerName':_0x44ad7a,'providerResponse':_0x418364})[_0x4592('0x16')](function(_0x4f7382){if(_0xffd6b8){_0xffd6b8(null,_0x4f7382);}})[_0x4592('0x18')](function(_0x89ec6a){if(_0xffd6b8){_0xffd6b8(_0x89ec6a);}});};AGIVertices[_0x4592('0x14')][_0x4592('0x48')]=function(_0x28d500,_0x302a18){this[_0x4592('0x12')][_0x4592('0x48')]({'firstName':_[_0x4592('0x49')](_0x28d500[_0x4592('0x17')])||_[_0x4592('0x4a')](_0x28d500[_0x4592('0x17')])?_0x4592('0x4b')+Math[_0x4592('0x4c')]():_0x28d500[_0x4592('0x17')],'lastName':_[_0x4592('0x49')](_0x28d500[_0x4592('0x4d')])||_[_0x4592('0x4a')](_0x28d500[_0x4592('0x4d')])?null:_0x28d500[_0x4592('0x4d')],'phone':_0x28d500[_0x4592('0x4e')],'ListId':_0x28d500[_0x4592('0x4f')],'scheduledat':_0x28d500['scheduledAt'],'callbackUniqueid':this[_0x4592('0x11')][_0x4592('0x3a')],'tags':'callback','description':_0x4592('0x50')+_0x28d500[_0x4592('0x51')][_0x4592('0x52')](),'priority':_0x28d500[_0x4592('0x53')]})['then'](function(_0x35f82b){_0x302a18(null,_0x35f82b);})['catch'](function(_0x4ddadf){_0x302a18(_0x4ddadf);});};AGIVertices[_0x4592('0x14')][_0x4592('0x54')]=function(_0x587aa9,_0xec8f7f){this[_0x4592('0x12')][_0x4592('0x55')](_0x587aa9)[_0x4592('0x16')](function(_0x2e082c){_0xec8f7f(null,_0x2e082c?_0x2e082c['name']:![]);})[_0x4592('0x18')](function(_0x48dead){_0xec8f7f(_0x48dead);});};AGIVertices['prototype'][_0x4592('0x56')]=function(_0x218d3a,_0x157c65,_0x2fd2dd){var _0x48f66a={'role':_0x4592('0x57')};_0x48f66a[_0x218d3a]=this[_0x4592('0x11')][_0x4592('0x3d')];this[_0x4592('0x12')][_0x4592('0x56')](_0x48f66a,_0x157c65,this[_0x4592('0x11')]['uniqueid'])[_0x4592('0x16')](function(_0x38bac7){_0x2fd2dd(null,_[_0x4592('0x4a')](_0x38bac7)?![]:!![]);})[_0x4592('0x18')](function(_0x158331){logger[_0x4592('0x34')](_0x158331);_0x2fd2dd(null,![]);});};AGIVertices[_0x4592('0x14')][_0x4592('0x58')]=function(_0x4e4821,_0x436be0){var _0x105080={'role':_0x4592('0x57')};_0x105080[_0x4e4821]=this['channel'][_0x4592('0x3d')];this[_0x4592('0x12')][_0x4592('0x58')](_0x105080)['then'](function(_0x17c746){_0x436be0(null,_[_0x4592('0x4a')](_0x17c746)?![]:!![]);})[_0x4592('0x18')](function(_0x154c0f){logger['error'](_0x154c0f);_0x436be0(null,![]);});};AGIVertices['prototype'][_0x4592('0x59')]=function(_0x3f9a0d,_0x2f08d9){var _0x5a77cf={'role':_0x4592('0x57')};_0x5a77cf[_0x3f9a0d]=this['channel']['callerid'];this[_0x4592('0x12')][_0x4592('0x59')](_0x5a77cf)['then'](function(_0x494e55){_0x2f08d9(null,_[_0x4592('0x4a')](_0x494e55)?![]:!![]);})['catch'](function(_0x17e90f){logger[_0x4592('0x34')](_0x17e90f);_0x2f08d9(null,![]);});};AGIVertices[_0x4592('0x14')][_0x4592('0x5a')]=function(_0x195ad3,_0x2178c8){var _0x4f927d={'role':_0x4592('0x57')};_0x4f927d[_0x195ad3]=this[_0x4592('0x11')][_0x4592('0x3d')];var _0xc6141=_0x195ad3!=_0x4592('0x5b')?util[_0x4592('0x2b')]('%s/%s@from-sip/n','LOCAL',this[_0x4592('0x11')][_0x4592('0x3d')]):undefined;this[_0x4592('0x12')][_0x4592('0x5a')](_0x4f927d,_0xc6141)[_0x4592('0x16')](function(_0xef3f30){_0x2178c8(null,_[_0x4592('0x4a')](_0xef3f30)?![]:!![]);})['catch'](function(_0x378f58){logger['error'](_0x378f58);_0x2178c8(null,![]);});};AGIVertices[_0x4592('0x14')][_0x4592('0x5c')]=function(_0x20220b,_0x448e81){sh['exec'](_[_0x4592('0x5d')](_0x20220b),function(_0x58b226,_0x5ac09b){var _0x12fb8f=_0x5ac09b['replace'](/(\r\n|\n|\r)/gm,'');_0x448e81(null,_0x12fb8f);});};AGIVertices[_0x4592('0x14')][_0x4592('0x5e')]=function(_0x52fff3,_0x2e2970){scripts[_0x4592('0x5e')](_0x52fff3[_0x4592('0x5f')],_0x52fff3[_0x4592('0x60')]||'text',_0x52fff3[_0x4592('0x61')],_0x52fff3[_0x4592('0x62')]||'en-US',_0x52fff3[_0x4592('0x63')]||'MALE',_0x52fff3[_0x4592('0x64')]||_0x4592('0x65'))[_0x4592('0x16')](function(_0x38aa7d){_0x2e2970(null,_0x38aa7d);})[_0x4592('0x18')](function(_0x5db34d){_0x2e2970(_0x5db34d);});};AGIVertices[_0x4592('0x14')][_0x4592('0x66')]=function(_0x1b6eee,_0x16e35c){scripts['googleTTS'](_0x1b6eee[_0x4592('0x61')],_0x1b6eee[_0x4592('0x67')]||'en',0x1)[_0x4592('0x16')](function(_0x5c2271){_0x16e35c(null,_0x5c2271);})[_0x4592('0x18')](function(_0x2da330){_0x16e35c(_0x2da330);});};AGIVertices[_0x4592('0x14')]['restAPI']=function(_0x43e74d,_0x4e59bc){var _0x47d4b2={'uri':_0x43e74d[_0x4592('0x68')],'method':_0x43e74d[_0x4592('0x69')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x43e74d[_0x4592('0x6a')])===_0x4592('0x6b')&&parseInt(_0x43e74d['timeout'])>=0x1?parseInt(_0x43e74d['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x4592('0x6c')]([_0x4592('0x6d'),_0x4592('0x6e')],_0x47d4b2[_0x4592('0x69')]['toUpperCase']())){try{_0x47d4b2[_0x4592('0x6f')]=_0x43e74d[_0x4592('0xd')]?JSON[_0x4592('0x70')](_0x43e74d[_0x4592('0xd')]):{};}catch(_0x14ae0c){logger[_0x4592('0x34')](_0x4592('0x71'),_0x14ae0c);}}try{_0x47d4b2[_0x4592('0x72')]=_0x43e74d[_0x4592('0xc')]?JSON[_0x4592('0x70')](_0x43e74d['rawHeaders']):{};}catch(_0x1e7f97){logger['error'](_0x4592('0x73'),_0x1e7f97);}if(_0x43e74d[_0x4592('0x74')]){try{var _0x2efc76=require(_0x43e74d[_0x4592('0x74')])[_0x4592('0x75')](this,_0x47d4b2);_0x47d4b2[_0x4592('0x76')]=Mustache['render'](_0x43e74d['url'],_0x2efc76,{},['$$','$$']);if(_0x47d4b2[_0x4592('0x72')]){_0x47d4b2[_0x4592('0x72')]=JSON[_0x4592('0x70')](Mustache[_0x4592('0x77')](JSON[_0x4592('0x78')](_0x47d4b2['headers']),_0x2efc76,{},['$$','$$']));}if(_0x47d4b2['body']){_0x47d4b2[_0x4592('0x6f')]=JSON[_0x4592('0x70')](Mustache['render'](JSON[_0x4592('0x78')](_0x47d4b2[_0x4592('0x6f')]),_0x2efc76,{},['$$','$$']));}}catch(_0x473c41){logger[_0x4592('0x34')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x473c41);}}rp(_0x47d4b2)[_0x4592('0x16')](function(_0x110f55){var _0x57c12d={'statusCode':_0x110f55['statusCode']||0xc8,'statusMessage':_0x110f55['statusMessage']||'OK','headers':_0x110f55['headers']||{},'body':_0x110f55[_0x4592('0x6f')]||{}};_0x4e59bc(null,_0x57c12d);})['catch'](function(_0x2299f3){var _0x1e6ae4={'statusCode':_0x2299f3[_0x4592('0x79')]||0x1f4,'statusMessage':_0x2299f3[_0x4592('0x7a')]||_0x4592('0x7b'),'headers':_0x2299f3[_0x4592('0x7c')][_0x4592('0x72')]||{},'body':_0x2299f3[_0x4592('0x7c')][_0x4592('0x6f')]||{}};_0x4e59bc(null,_0x1e6ae4);});};AGIVertices[_0x4592('0x14')][_0x4592('0x7d')]=function(_0x4700bf,_0x37dd52){scripts[_0x4592('0x7d')](this[_0x4592('0x11')][_0x4592('0x3a')],_0x4700bf[_0x4592('0x7e')],_0x4700bf[_0x4592('0x61')],_0x4700bf[_0x4592('0x7f')]||'en')[_0x4592('0x16')](function(_0x3837e7){_0x37dd52(null,_0x3837e7);})[_0x4592('0x18')](function(_0x494483){_0x37dd52(_0x494483);});};AGIVertices['prototype'][_0x4592('0x80')]=function(_0xdf2c87,_0xa38565){scripts[_0x4592('0x80')](this[_0x4592('0x11')][_0x4592('0x3a')],_0xdf2c87[_0x4592('0x81')],_0xdf2c87['client_email'],_0xdf2c87[_0x4592('0x82')],_0xdf2c87['text'],_0xdf2c87[_0x4592('0x83')]||'en')[_0x4592('0x16')](function(_0xfdd19c){_0xa38565(null,_0xfdd19c);})['catch'](function(_0x24f217){_0xa38565(_0x24f217);});};AGIVertices[_0x4592('0x14')][_0x4592('0x84')]=function(_0x236775,_0x5771e4){scripts[_0x4592('0x84')](this[_0x4592('0x11')],_0x236775)[_0x4592('0x16')](function(_0x3645c9){_0x5771e4(null,_0x3645c9);})['catch'](function(_0x5f4eed){_0x5771e4(_0x5f4eed);});};AGIVertices[_0x4592('0x14')][_0x4592('0x85')]=function(_0x27e163,_0x3596eb){scripts[_0x4592('0x85')](_0x27e163[_0x4592('0x7e')],_0x27e163[_0x4592('0x61')],_0x27e163[_0x4592('0x86')]||'en-US',_0x27e163[_0x4592('0x87')])[_0x4592('0x16')](function(_0x1080b6){_0x3596eb(null,_0x1080b6);})[_0x4592('0x18')](function(_0x34b6c6){_0x3596eb(_0x34b6c6);});};AGIVertices[_0x4592('0x14')][_0x4592('0x88')]=function(_0x24f600,_0x3d205a,_0x2509c4){scripts['ispeechASR'](_0x3d205a,_0x24f600[_0x4592('0x7e')],_0x24f600[_0x4592('0x89')]||_0x4592('0x8a'),this['isConfigured'](_0x24f600[_0x4592('0x8b')])?_0x24f600[_0x4592('0x8b')]:undefined)['then'](function(_0x39afae){_0x2509c4(null,_0x39afae);})['catch'](function(_0x32afcb){_0x2509c4(_0x32afcb);});};AGIVertices[_0x4592('0x14')][_0x4592('0x8c')]=function(_0x3ea03a,_0x3da05b){scripts[_0x4592('0x8c')](_0x3ea03a[_0x4592('0x8d')],_0x3ea03a['aws_secret_access_key'],_0x3ea03a[_0x4592('0x8e')],_0x3ea03a[_0x4592('0x8f')]||_0x4592('0x90'),_0x3ea03a[_0x4592('0x61')],_0x3ea03a[_0x4592('0x91')]||_0x4592('0x61'))[_0x4592('0x16')](function(_0x5d3806){_0x3da05b(null,_0x5d3806);})['catch'](function(_0x301dcc){_0x3da05b(_0x301dcc);});};AGIVertices['prototype'][_0x4592('0x92')]=function(_0x374f87,_0x875338){scripts[_0x4592('0x92')](this[_0x4592('0x11')][_0x4592('0x3a')],_0x374f87['aws_access_key_id'],_0x374f87[_0x4592('0x93')],_0x374f87[_0x4592('0x94')],_0x374f87[_0x4592('0x61')],_0x374f87[_0x4592('0x95')])[_0x4592('0x16')](function(_0x2c8fd0){_0x875338(null,_0x2c8fd0);})[_0x4592('0x18')](function(_0x21a35a){_0x875338(_0x21a35a);});};AGIVertices[_0x4592('0x14')]['googleASR']=function(_0x3a0864,_0x4756c4,_0x1b980d){scripts['googleASR'](_0x4756c4,_0x3a0864[_0x4592('0x7e')],_0x3a0864[_0x4592('0x96')]||_0x4592('0x8a'))[_0x4592('0x16')](function(_0x324673){_0x1b980d(null,_0x324673);})[_0x4592('0x18')](function(_0x15e2a6){_0x1b980d(_0x15e2a6);});};AGIVertices[_0x4592('0x14')]['tildeASR']=function(_0x236eee,_0x22656f,_0x219e2a){scripts[_0x4592('0x97')](_0x22656f,_0x236eee[_0x4592('0x98')],_0x236eee[_0x4592('0x99')],_0x236eee[_0x4592('0x76')])[_0x4592('0x16')](function(_0x3f2eb9){_0x219e2a(null,_0x3f2eb9);})['catch'](function(_0x2d7f43){_0x219e2a(_0x2d7f43);});};AGIVertices[_0x4592('0x14')]['clear']=function(_0x3dff5c){var _0x303c51=_[_0x4592('0x6c')](verticesWithRetry,_0x3dff5c[_0x4592('0x3c')])?_0x3dff5c:_[_0x4592('0x9a')](_0x3dff5c);for(var _0x431a4b in _0x303c51){if(_0x303c51[_0x4592('0x9b')](_0x431a4b)){if(_0x303c51[_0x431a4b]&&_[_0x4592('0x9c')](_0x303c51[_0x431a4b])){if(_['includes'](recursiveMapAttributes,_0x431a4b)){_0x303c51[_0x431a4b]=this[_0x4592('0x9d')](_0x303c51[_0x431a4b]);}else{_0x303c51[_0x431a4b]=this['replaceAllVariables'](_0x303c51[_0x431a4b]);}}}}return _0x303c51;};AGIVertices['prototype'][_0x4592('0x9e')]=function(_0x49637b){for(var _0x5966f1 in _0x49637b){if(_0x49637b['hasOwnProperty'](_0x5966f1)){if(_[_0x4592('0x9f')](_0x49637b[_0x5966f1])){this[_0x4592('0x9e')](_0x49637b[_0x5966f1]);}else if(_[_0x4592('0xa0')](_0x49637b[_0x5966f1])){for(var _0x69622e=0x0;_0x69622e<_0x49637b[_0x5966f1][_0x4592('0xa1')];_0x69622e++){this[_0x4592('0x9e')](_0x49637b[_0x5966f1][_0x69622e]);}}else if(_[_0x4592('0x9c')](_0x49637b[_0x5966f1])){_0x49637b[_0x5966f1]=this[_0x4592('0xa2')](_0x49637b[_0x5966f1]);}}}};AGIVertices[_0x4592('0x14')][_0x4592('0xa3')]=function(_0xfc2ffc,_0x207eae){for(var _0x4870f8 in _0xfc2ffc){if(_0xfc2ffc[_0x4592('0x9b')](_0x4870f8)){if(_[_0x4592('0x9f')](_0xfc2ffc[_0x4870f8])){if(!_['isEmpty'](_0xfc2ffc[_0x4870f8])){this[_0x4592('0xa3')](_0xfc2ffc[_0x4870f8],util['format']('%s.%s',_0x207eae,_0x4870f8));}}else if(_[_0x4592('0xa0')](_0xfc2ffc[_0x4870f8])){for(var _0x29fffb=0x0;_0x29fffb<_0xfc2ffc[_0x4870f8]['length'];_0x29fffb++){this['saveRestApiResult'](_0xfc2ffc[_0x4870f8][_0x29fffb],util['format'](_0x4592('0xa4'),_0x207eae,_0x4870f8+'['+_0x29fffb+']'));}}else{if(!_['isNil'](_0xfc2ffc[_0x4870f8])){this[_0x4592('0x11')][_0x4592('0xa5')](util[_0x4592('0x2b')](_0x4592('0xa4'),_0x207eae,_0x4870f8),_0xfc2ffc[_0x4870f8]);}}}}};AGIVertices[_0x4592('0x14')][_0x4592('0x9d')]=function(_0x3d2421){try{var _0x592c81=JSON[_0x4592('0x70')](_0x3d2421);this['recursiveNodeIndex'](_0x592c81);return JSON[_0x4592('0x78')](_0x592c81);}catch(_0x5d0ddb){return this[_0x4592('0xa2')](_0x3d2421);}};AGIVertices[_0x4592('0x14')][_0x4592('0xa2')]=function(_0x5845b3){var _0x26d5b=_0x5845b3[_0x4592('0xa6')]('{');for(var _0x3db068=0x1;_0x3db068<_0x26d5b['length'];_0x3db068+=0x1){var _0x106905=_0x26d5b[_0x3db068][_0x4592('0xa6')]('}');if(_0x106905['length']>0x1){_0x5845b3=_0x5845b3['replaceAll']('{'+_0x106905[0x0]+'}',this['channel'][_0x4592('0x15')](_0x106905[0x0])[_0x4592('0xa7')]||_0x106905[0x0]);}}if(_0x26d5b['length']===0x1){return _0x5845b3['toString']();}return this[_0x4592('0xa2')](_0x5845b3);};AGIVertices[_0x4592('0x14')]['getAndSetVariable']=function(_0x46ce65,_0x5b6414){var _0x36dc79=this[_0x4592('0x11')][_0x4592('0x15')](_0x46ce65);if(_0x36dc79['result']===-0x1){return _0x36dc79;}logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0xa8'),_0x5b6414,_0x36dc79[_0x4592('0xa7')]));return this['channel'][_0x4592('0xa5')](_0x5b6414,_0x36dc79[_0x4592('0xa7')]);};AGIVertices[_0x4592('0x14')]['isConfigured']=function(_0x1d4417){return _0x1d4417&&_0x1d4417!=='0'&&_0x1d4417!=='-1'&&_0x1d4417!=='';};AGIVertices[_0x4592('0x14')][_0x4592('0xa9')]=function(_0x1a970b){this[_0x4592('0x39')][_0x4592('0x75')](this,_0x1a970b,'-');_0x1a970b[_0x4592('0xaa')]=_0x1a970b[_0x4592('0xa9')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x4592('0x14')]['mrcpsynth']=function(_0x1b44a2){logger[_0x4592('0x31')](util['format'](_0x4592('0xab'),_0x1b44a2[_0x4592('0x3b')]));if(!this['isConfigured'](_0x1b44a2[_0x4592('0x61')])){return this[_0x4592('0x11')][_0x4592('0xac')]('no\x20text\x20configured');}var _0x57a32d='\x22'+_0x1b44a2[_0x4592('0x61')]+'\x22';if(this[_0x4592('0xad')](_0x1b44a2[_0x4592('0x7c')])){_0x57a32d+=','+_0x1b44a2['options'];}var _0x21f8a8=this[_0x4592('0x11')][_0x4592('0xae')](_0x4592('0xaf'),_0x57a32d);if(_0x21f8a8[_0x4592('0xb0')]===-0x1){return _0x21f8a8;}return this[_0x4592('0x11')][_0x4592('0xac')](util[_0x4592('0x2b')]('Executed\x20command\x20MRCPSynth\x20%s',_0x57a32d));};AGIVertices[_0x4592('0x14')]['mrcprecog']=function(_0x2cd823){logger[_0x4592('0x31')](util['format'](_0x4592('0xb1'),_0x2cd823[_0x4592('0x3b')]));if(!this['isConfigured'](_0x2cd823['grammar'])){return this[_0x4592('0x11')]['noop']('no\x20grammar\x20configured');}var _0x3e59c3=_0x2cd823[_0x4592('0xb2')];if(this['isConfigured'](_0x2cd823[_0x4592('0x7c')])){_0x3e59c3+=','+_0x2cd823[_0x4592('0x7c')];}var _0x2c4c46=this['channel'][_0x4592('0xae')]('MRCPRecog',_0x3e59c3);if(_0x2c4c46[_0x4592('0xb0')]===-0x1){return _0x2c4c46;}var _0x5bce9a=this[_0x4592('0xb3')](_0x4592('0xb4'),_0x4592('0xb5'));if(_0x5bce9a['result']===-0x1){return _0x5bce9a;}var _0x21f3ed=this[_0x4592('0xb3')](_0x4592('0xb6'),_0x4592('0xb7'));if(_0x21f3ed[_0x4592('0xb0')]===-0x1){return _0x21f3ed;}var _0x18ab35=this[_0x4592('0xb3')](_0x4592('0xb8'),_0x4592('0xb9'));if(_0x18ab35['result']===-0x1){return _0x18ab35;}return this[_0x4592('0x11')]['noop'](util[_0x4592('0x2b')](_0x4592('0xba'),_0x3e59c3));};AGIVertices[_0x4592('0x14')][_0x4592('0x8')]=function(_0x4cae0c){logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0xbb'),_0x4cae0c[_0x4592('0x3b')]));return this['channel']['agi']([_0x4cae0c['command'],_0x4cae0c[_0x4592('0xbc')]]);};AGIVertices['prototype'][_0x4592('0xbd')]=function(_0x4e06ff){logger[_0x4592('0x31')](util['format'](_0x4592('0xbe'),_0x4e06ff['label']));if(this[_0x4592('0xad')](_0x4e06ff[_0x4592('0x6a')])){logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0xbf'),_0x4e06ff[_0x4592('0x6a')]));var _0x41df76=this[_0x4592('0x11')][_0x4592('0xc0')](_0x4e06ff[_0x4592('0x6a')]);if(_0x41df76['result']===-0x1){return _0x41df76;}}return this[_0x4592('0x11')]['answer']();};AGIVertices[_0x4592('0x14')][_0x4592('0xc1')]=function(_0x8a09a8){logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0xc2'),_0x8a09a8[_0x4592('0x3b')]));if(!this[_0x4592('0xad')](_0x8a09a8['list_id'])){return this['channel'][_0x4592('0x34')](_0x8a09a8,_0x4592('0xc3'));}_0x8a09a8[_0x4592('0x51')]=moment();if(this[_0x4592('0xad')](_0x8a09a8[_0x4592('0xc4')])){_0x8a09a8[_0x4592('0x51')]=moment()[_0x4592('0xc5')](_0x8a09a8[_0x4592('0xc4')],_0x4592('0xc6'));}if(!this[_0x4592('0xad')](_0x8a09a8['callback_priority'])){_0x8a09a8['callback_priority']=0x2;}this[_0x4592('0x48')][_0x4592('0x75')](this,_0x8a09a8);return this[_0x4592('0x11')][_0x4592('0xac')](util[_0x4592('0x2b')](_0x4592('0xc7'),_0x8a09a8['phone'],_0x8a09a8[_0x4592('0x4f')],_0x8a09a8['scheduledAt']));};AGIVertices['prototype'][_0x4592('0xc8')]=function(_0x1f5c89){logger[_0x4592('0x31')](util['format'](_0x4592('0xc9'),_0x1f5c89[_0x4592('0x3b')]));var _0x237dc3=this[_0x4592('0x11')]['exec'](_0x1f5c89[_0x4592('0xca')],_0x1f5c89[_0x4592('0x7c')]);if(_0x237dc3[_0x4592('0xb0')]===-0x1){return _0x237dc3;}return this['channel']['noop'](util[_0x4592('0x2b')](_0x4592('0xcb'),_0x1f5c89[_0x4592('0xca')],_0x1f5c89[_0x4592('0x7c')]));};AGIVertices[_0x4592('0x14')]['lumenvoxtts']=function(_0x425904){logger['info'](util[_0x4592('0x2b')](_0x4592('0xcc'),_0x425904[_0x4592('0x3b')]));if(!this['isConfigured'](_0x425904[_0x4592('0x61')])){return this[_0x4592('0x11')][_0x4592('0xac')](_0x4592('0xcd'));}var _0x55238c='\x22'+_0x425904[_0x4592('0x61')]+'\x22';if(this[_0x4592('0xad')](_0x425904['options'])){_0x55238c+=','+_0x425904[_0x4592('0x7c')];}var _0x46aeb0=this['channel'][_0x4592('0xae')](_0x4592('0xaf'),_0x55238c);if(_0x46aeb0[_0x4592('0xb0')]===-0x1){return _0x46aeb0;}return this['channel']['noop'](util['format'](_0x4592('0xce'),_0x55238c));};AGIVertices['prototype'][_0x4592('0xcf')]=function(_0xdef876){logger['info'](util[_0x4592('0x2b')](_0x4592('0xd0'),_0xdef876[_0x4592('0x3b')]));if(!this['isConfigured'](_0xdef876[_0x4592('0x61')])){return this[_0x4592('0x11')][_0x4592('0xac')](_0x4592('0xcd'));}var _0x3eca0e='\x22'+_0xdef876[_0x4592('0x61')]+'\x22';if(this[_0x4592('0xad')](_0xdef876[_0x4592('0x7c')])){_0x3eca0e+=','+_0xdef876[_0x4592('0x7c')];}var _0x43796c=this[_0x4592('0x11')]['exec'](_0x4592('0xaf'),_0x3eca0e);if(_0x43796c[_0x4592('0xb0')]===-0x1){return _0x43796c;}return this['channel'][_0x4592('0xac')](util[_0x4592('0x2b')](_0x4592('0xce'),_0x3eca0e));};AGIVertices[_0x4592('0x14')]['lumenvoxasr']=function(_0x299fe4){logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0xd1'),_0x299fe4[_0x4592('0x3b')]));if(!this[_0x4592('0xad')](_0x299fe4[_0x4592('0xb2')])){return this['channel'][_0x4592('0xac')](_0x4592('0xd2'));}var _0x2769f2=_0x299fe4[_0x4592('0xb2')];if(this[_0x4592('0xad')](_0x299fe4[_0x4592('0x7c')])){_0x2769f2+=','+_0x299fe4['options'];}var _0x45650d=this[_0x4592('0x11')]['exec'](_0x4592('0xd3'),_0x2769f2);if(_0x45650d[_0x4592('0xb0')]===-0x1){return _0x45650d;}var _0x4f2cbe=this[_0x4592('0xb3')](_0x4592('0xb4'),'LUMENVOX_ASR_CONFIDENCE');if(_0x4f2cbe['result']===-0x1){return _0x4f2cbe;}var _0x1d44d2=this[_0x4592('0xb3')](_0x4592('0xb6'),_0x4592('0xd4'));if(_0x1d44d2[_0x4592('0xb0')]===-0x1){return _0x1d44d2;}var _0x322563=this['getAndSetVariable'](_0x4592('0xb8'),_0x4592('0xd5'));if(_0x322563['result']===-0x1){return _0x322563;}return this[_0x4592('0x11')][_0x4592('0xac')](util[_0x4592('0x2b')](_0x4592('0xba'),_0x2769f2));};AGIVertices[_0x4592('0x14')][_0x4592('0xd6')]=function(_0x176400){logger['info'](util['format'](_0x4592('0xd7'),_0x176400[_0x4592('0x3b')]));if(!this[_0x4592('0xad')](_0x176400[_0x4592('0xb2')])){return this[_0x4592('0x11')][_0x4592('0xac')]('no\x20grammar\x20configured');}var _0x1bb269=_0x176400[_0x4592('0xb2')];if(this[_0x4592('0xad')](_0x176400[_0x4592('0x7c')])){_0x1bb269+=','+_0x176400[_0x4592('0x7c')];}var _0x452775=this['channel'][_0x4592('0xae')]('MRCPRecog',_0x1bb269);if(_0x452775[_0x4592('0xb0')]===-0x1){return _0x452775;}var _0x31cf72=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x4592('0xd8'));if(_0x31cf72[_0x4592('0xb0')]===-0x1){return _0x31cf72;}var _0x45a9d3=this[_0x4592('0xb3')](_0x4592('0xb6'),_0x4592('0xd9'));if(_0x45a9d3[_0x4592('0xb0')]===-0x1){return _0x45a9d3;}var _0x283a51=this['getAndSetVariable'](_0x4592('0xb8'),_0x4592('0xda'));if(_0x283a51[_0x4592('0xb0')]===-0x1){return _0x283a51;}return this[_0x4592('0x11')][_0x4592('0xac')](util[_0x4592('0x2b')](_0x4592('0xba'),_0x1bb269));};AGIVertices[_0x4592('0x14')]['database']=function(_0x51fb07){logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0xdb'),_0x51fb07[_0x4592('0x3b')]));if(!this[_0x4592('0xad')](_0x51fb07[_0x4592('0xdc')])){return this[_0x4592('0x11')]['error'](_0x51fb07,'no\x20database\x20selected');}var _0x5d8aaa=this['getSquareOdbc']['sync'](this,_0x51fb07['odbc_id']);if(!_0x5d8aaa){return this[_0x4592('0x11')][_0x4592('0x34')](_0x51fb07,_0x4592('0xdd'));}if(!this[_0x4592('0xad')](_0x51fb07[_0x4592('0x30')])){return this['channel'][_0x4592('0x34')](_0x51fb07,'no\x20query\x20configured');}var _0x232f53=_0x51fb07[_0x4592('0x30')][_0x4592('0xde')](/(\r\n|\n|\r)/gm,'\x20');this[_0x4592('0x11')][_0x4592('0xac')](util['format'](_0x4592('0xdf'),_0x232f53));var _0x10e787=this[_0x4592('0x2c')][_0x4592('0x75')](this,_0x5d8aaa,_0x232f53);this[_0x4592('0x39')][_0x4592('0x75')](this,_0x51fb07,_0x232f53);if(!this[_0x4592('0xad')](_0x51fb07[_0x4592('0xe0')])){return this[_0x4592('0x11')][_0x4592('0xac')](_0x4592('0xe1'));}var _0x1be7e8=this[_0x4592('0x15')][_0x4592('0x75')](this,_0x51fb07[_0x4592('0xe0')]);if(!_0x1be7e8){return this['channel'][_0x4592('0x34')](_0x51fb07,_0x4592('0xe2'));}var _0x2bfa49=this;_0x10e787[_0x4592('0xe3')](function(_0x24b9fc,_0x385d45){Object[_0x4592('0xe4')](_0x24b9fc)['forEach'](function(_0x161ba6){_0x2bfa49[_0x4592('0x11')][_0x4592('0xa5')](util[_0x4592('0x2b')]('%s[%s][%s]',_0x1be7e8,_0x385d45,_0x161ba6),_0x24b9fc[_0x161ba6]);});});this['channel'][_0x4592('0xa5')](util[_0x4592('0x2b')](_0x4592('0xe5'),_0x1be7e8),_0x10e787[_0x4592('0xa1')]);return this[_0x4592('0x11')][_0x4592('0xac')](util[_0x4592('0x2b')](_0x4592('0xe6'),_0x1be7e8));};AGIVertices[_0x4592('0x14')][_0x4592('0xe7')]=function(_0x6d6b3a){logger[_0x4592('0xe8')](util[_0x4592('0x2b')](_0x4592('0xe9'),_0x6d6b3a[_0x4592('0x3b')]));if(!this[_0x4592('0xad')](_0x6d6b3a[_0x4592('0xea')])){return this[_0x4592('0x11')][_0x4592('0x34')](_0x6d6b3a,'no\x20user\x20selected');}var _0x5123bd=this[_0x4592('0x1b')]['sync'](this,_0x6d6b3a[_0x4592('0xea')]);if(!_0x5123bd){return this[_0x4592('0x11')][_0x4592('0x34')](_0x6d6b3a,_0x4592('0xeb'));}var _0x575d76=this[_0x4592('0x11')][_0x4592('0xae')]('DIAL',[util[_0x4592('0x2b')](_0x4592('0xec'),_0x5123bd),_0x6d6b3a[_0x4592('0x6a')],_0x6d6b3a[_0x4592('0xed')],_0x6d6b3a['url']]);if(_0x575d76[_0x4592('0xb0')]===-0x1){return _0x575d76;}return this['channel'][_0x4592('0xac')](util[_0x4592('0x2b')](_0x4592('0xee'),_0x4592('0xef')));};AGIVertices['prototype']['dialogflow']=function(_0x541671){logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0xf0'),_0x541671[_0x4592('0x3b')]));if(!this[_0x4592('0xad')](_0x541671[_0x4592('0x7e')])){return this[_0x4592('0x11')][_0x4592('0xac')]('no\x20key\x20configured');}if(!this[_0x4592('0xad')](_0x541671[_0x4592('0x61')])){return this[_0x4592('0x11')][_0x4592('0xac')](_0x4592('0xcd'));}this[_0x4592('0x11')]['bot']=!![];this[_0x4592('0x39')](_0x541671);this[_0x4592('0x47')](_0x541671[_0x4592('0x61')],'in','','');this[_0x4592('0x11')][_0x4592('0xac')](util[_0x4592('0x2b')]('Trying\x20Dialogflow:\x20%s',_0x541671['text']));var _0x4bfa5e=this['googleDialogflow'][_0x4592('0x75')](this,_0x541671);if(_0x4bfa5e){for(var _0x4128ca in _0x4bfa5e){if(_0x4bfa5e['hasOwnProperty'](_0x4128ca)){this[_0x4592('0x11')]['setVariable'](util[_0x4592('0x2b')](_0x4592('0xf1'),_0x4128ca[_0x4592('0xf2')]()),_0x4bfa5e[_0x4128ca]);}}this['createSquareMessage'](_0x4bfa5e[_0x4592('0xf3')],'out','dialogflow','');return this['channel']['noop'](util['format'](_0x4592('0xf4'),_0x4bfa5e['speech']));}return this['channel'][_0x4592('0x34')](_0x541671,_0x4592('0xf5'));};AGIVertices[_0x4592('0x14')]['dialogflowV2']=function(_0x5601f4){logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0xf6'),_0x5601f4[_0x4592('0x3b')]));if(!this[_0x4592('0xad')](_0x5601f4[_0x4592('0x81')])){return this[_0x4592('0x11')][_0x4592('0xac')](_0x4592('0xf7'));}if(!this['isConfigured'](_0x5601f4[_0x4592('0xf8')])){return this[_0x4592('0x11')][_0x4592('0xac')](_0x4592('0xf9'));}if(!this[_0x4592('0xad')](_0x5601f4[_0x4592('0x82')])){return this[_0x4592('0x11')][_0x4592('0xac')](_0x4592('0xfa'));}if(!this[_0x4592('0xad')](_0x5601f4[_0x4592('0x83')])){return this[_0x4592('0x11')]['noop'](_0x4592('0xfb'));}if(!this['isConfigured'](_0x5601f4[_0x4592('0x61')])){return this['channel'][_0x4592('0xac')](_0x4592('0xcd'));}this[_0x4592('0x11')]['bot']=!![];this[_0x4592('0x39')](_0x5601f4);this[_0x4592('0x47')](_0x5601f4['text'],'in','','');this[_0x4592('0x11')][_0x4592('0xac')](util['format'](_0x4592('0xfc'),_0x5601f4[_0x4592('0x61')]));var _0x3a123b=this[_0x4592('0x80')][_0x4592('0x75')](this,_0x5601f4);if(_0x3a123b){for(var _0x53dee9 in _0x3a123b){if(_0x3a123b[_0x4592('0x9b')](_0x53dee9)){if(_0x53dee9!=='providerResponse'){this['channel']['setVariable'](util[_0x4592('0x2b')](_0x4592('0xf1'),_0x53dee9[_0x4592('0xf2')]()),_0x3a123b[_0x53dee9]);}}}this[_0x4592('0x47')](_0x3a123b[_0x4592('0xf3')],_0x4592('0xfd'),_0x4592('0xfe'),_0x3a123b['providerResponse']);return this[_0x4592('0x11')][_0x4592('0xac')](util[_0x4592('0x2b')](_0x4592('0xff'),_0x3a123b[_0x4592('0xf3')]));}return this[_0x4592('0x11')][_0x4592('0x34')](_0x5601f4,_0x4592('0x100'));};AGIVertices[_0x4592('0x14')][_0x4592('0x101')]=function(_0x149b03){logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0x102'),_0x149b03[_0x4592('0x3b')]));if(!this[_0x4592('0xad')](_0x149b03[_0x4592('0x103')])){return this[_0x4592('0x11')][_0x4592('0xac')](_0x4592('0x104'));}if(!this[_0x4592('0xad')](_0x149b03[_0x4592('0x105')])){return this[_0x4592('0x11')][_0x4592('0xac')]('no\x20username\x20configured');}if(!this[_0x4592('0xad')](_0x149b03[_0x4592('0x106')])){return this[_0x4592('0x11')][_0x4592('0xac')](_0x4592('0x107'));}if(!this['isConfigured'](_0x149b03[_0x4592('0x108')])){return this[_0x4592('0x11')][_0x4592('0xac')](_0x4592('0xcd'));}this[_0x4592('0x11')][_0x4592('0x109')]=!![];this[_0x4592('0x39')](_0x149b03);this[_0x4592('0x47')](_0x149b03[_0x4592('0x61')],'in','','');this[_0x4592('0x11')][_0x4592('0xac')](util[_0x4592('0x2b')](_0x4592('0x10a'),_0x149b03[_0x4592('0x61')]));var _0x1a5b6a=this[_0x4592('0x84')][_0x4592('0x75')](this,_0x149b03);if(_0x1a5b6a){for(var _0x247721 in _0x1a5b6a){if(_0x1a5b6a[_0x4592('0x9b')](_0x247721)){this['channel'][_0x4592('0xa5')](util[_0x4592('0x2b')]('SESTEK_NDA_%s',_0x247721[_0x4592('0xf2')]()),_0x1a5b6a[_0x247721]);}}this[_0x4592('0x47')](_0x1a5b6a[_0x4592('0xf3')],_0x4592('0xfd'),_0x4592('0x101'),'');if(_0x1a5b6a[_0x4592('0x10b')]){this['channel'][_0x4592('0xac')](util[_0x4592('0x2b')](_0x4592('0x10c'),_0x1a5b6a[_0x4592('0x10b')]));var _0x2afb9a=this[_0x4592('0x11')][_0x4592('0x10d')](_0x1a5b6a[_0x4592('0x10b')]);try{fs[_0x4592('0x10e')](_0x1a5b6a[_0x4592('0x10b')]+_0x4592('0x10f'));}catch(_0x1cda0a){logger[_0x4592('0x34')](_0x1cda0a);}return _0x2afb9a;}else{return this['channel']['noop'](util[_0x4592('0x2b')](_0x4592('0x110'),_0x1a5b6a[_0x4592('0xf3')]));}}return this[_0x4592('0x11')][_0x4592('0x34')](_0x149b03,_0x4592('0x111'));};AGIVertices[_0x4592('0x14')]['end']=function(_0x9516c7){logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0x112'),_0x9516c7[_0x4592('0x3b')]));return this[_0x4592('0x11')][_0x4592('0xac')](_0x4592('0x113'));};AGIVertices[_0x4592('0x14')][_0x4592('0x114')]=function(_0x23083f){logger[_0x4592('0x31')](util['format'](_0x4592('0x115'),_0x23083f[_0x4592('0x3b')]));var _0x18d64a='';if(_0x23083f[_0x4592('0x116')]){if(!this[_0x4592('0xad')](_0x23083f[_0x4592('0x116')])){return this[_0x4592('0x11')][_0x4592('0x34')](_0x23083f,'no\x20trunk\x20selected');}else{var _0x441876=parseInt(_0x23083f[_0x4592('0x116')],0xa);if(isNaN(_0x441876)){_0x18d64a=_0x23083f[_0x4592('0x116')];}else{_0x18d64a=this['getTrunk'][_0x4592('0x75')](this,_0x23083f[_0x4592('0x116')]);if(!_0x18d64a){return this[_0x4592('0x11')][_0x4592('0x34')](_0x23083f,_0x4592('0x117'));}}}}else if(_0x23083f[_0x4592('0x118')]){_0x18d64a=_0x23083f[_0x4592('0x118')];}else{return this[_0x4592('0x11')][_0x4592('0x34')](_0x23083f,_0x4592('0x119'));}var _0x4f9832=this[_0x4592('0x11')][_0x4592('0xae')](_0x4592('0xef'),[util[_0x4592('0x2b')](_0x4592('0x11a'),_0x18d64a,_0x23083f[_0x4592('0x4e')]),_0x23083f['timeout'],_0x23083f[_0x4592('0xed')],_0x23083f[_0x4592('0x68')]]);if(_0x4f9832[_0x4592('0xb0')]===-0x1){return _0x4f9832;}return this[_0x4592('0x11')][_0x4592('0xac')](util[_0x4592('0x2b')](_0x4592('0xee'),_0x4592('0xef')));};AGIVertices['prototype']['finally']=function(_0x5b27e2){logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0x11b'),_0x5b27e2[_0x4592('0x3b')]));return this[_0x4592('0x11')][_0x4592('0xac')](_0x4592('0x11c'));};AGIVertices[_0x4592('0x14')][_0x4592('0xf')]=function(_0x1abbb0){logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0x11d'),_0x1abbb0[_0x4592('0x3b')]));if(_0x1abbb0[_0x4592('0xaa')]===0x0){return this[_0x4592('0xa9')](_0x1abbb0);}_0x1abbb0[_0x4592('0xaa')]-=0x1;if(!this[_0x4592('0xad')](_0x1abbb0[_0x4592('0x11e')])){return this['channel']['error'](_0x1abbb0,_0x4592('0x11f'));}var _0x54be65=this[_0x4592('0x1f')][_0x4592('0x75')](this,_0x1abbb0[_0x4592('0x11e')]);if(!_0x54be65){return this[_0x4592('0x11')][_0x4592('0x34')](_0x1abbb0,_0x4592('0x120'));}if(!this[_0x4592('0xad')](_0x1abbb0['variable_id'])){return this[_0x4592('0x11')][_0x4592('0x34')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x24d71b=this['channel'][_0x4592('0x121')](_0x54be65,_0x1abbb0[_0x4592('0x122')],_0x1abbb0[_0x4592('0x123')]);var _0x2f6443=_0x24d71b['result']?_0x24d71b[_0x4592('0xb0')][_0x4592('0x52')]():'';logger['info'](_0x4592('0x124'),JSON[_0x4592('0x78')](_0x24d71b));if(_0x24d71b['result']===-0x1){this['createSquareDetailsReport']['sync'](this,_0x1abbb0,_0x2f6443);return _0x24d71b;}else if(_0x24d71b[_0x4592('0xa7')]==='timeout'){_0x24d71b['result']=_0x2f6443[_0x4592('0xa1')]>=parseInt(_0x1abbb0[_0x4592('0x125')])?'x':'i';}else{_0x24d71b[_0x4592('0xb0')]=_0x2f6443[_0x4592('0xa1')]>=parseInt(_0x1abbb0[_0x4592('0x125')])&&_0x2f6443[_0x4592('0xa1')]<=parseInt(_0x1abbb0[_0x4592('0x123')])?'x':'i';}var _0x171d5d=this[_0x4592('0x15')]['sync'](this,_0x1abbb0[_0x4592('0xe0')]);if(!_0x171d5d){return this[_0x4592('0x11')][_0x4592('0x34')](_0x1abbb0,_0x4592('0xe2'));}this[_0x4592('0x11')][_0x4592('0xa5')](_0x171d5d,_0x2f6443);if(this[_0x4592('0xad')](_0x1abbb0[_0x4592('0x126')])){var _0x3e3220=parseInt(_0x1abbb0[_0x4592('0x126')],0xa);var _0x24cd9d=rs[_0x4592('0x127')]({'charset':'*','length':_0x3e3220});var _0x1b86af=_0x2f6443[_0x4592('0xa1')];if(_0x1b86af>0x0){if(_0x1b86af>_0x3e3220){this['createSquareDetailsReport'][_0x4592('0x75')](this,_0x1abbb0,_0x1abbb0[_0x4592('0x128')]===_0x4592('0x129')?_0x24cd9d+_0x2f6443[_0x4592('0x12a')](_0x3e3220):_0x2f6443['substr'](0x0,_0x1b86af-_0x3e3220)+_0x24cd9d);}else{this[_0x4592('0x39')][_0x4592('0x75')](this,_0x1abbb0,rs[_0x4592('0x127')]({'charset':'*','length':_0x1b86af}));}}else{this[_0x4592('0x39')][_0x4592('0x75')](this,_0x1abbb0,'');}}else{this[_0x4592('0x39')]['sync'](this,_0x1abbb0,_0x2f6443);}return _0x24d71b;};AGIVertices[_0x4592('0x14')][_0x4592('0x10')]=function(_0x1398d5){logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0x12b'),_0x1398d5[_0x4592('0x3b')]));return this[_0x4592('0xf')](_0x1398d5);};AGIVertices[_0x4592('0x14')][_0x4592('0x12c')]=function(_0x1bb1c8){logger[_0x4592('0x31')](util[_0x4592('0x2b')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x1bb1c8[_0x4592('0x3b')]));this[_0x4592('0x39')][_0x4592('0x75')](this,_0x1bb1c8,_0x1bb1c8[_0x4592('0x12d')]);return this[_0x4592('0x11')][_0x4592('0xac')](util[_0x4592('0x2b')]('GOAL\x20%s',_0x1bb1c8[_0x4592('0x12d')]));};AGIVertices['prototype'][_0x4592('0x12e')]=function(_0x4d3b9a){logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0x12f'),_0x4d3b9a['label']));if(!this[_0x4592('0xad')](_0x4d3b9a[_0x4592('0x8d')])||!this[_0x4592('0xad')](_0x4d3b9a[_0x4592('0x93')])){return this[_0x4592('0x11')][_0x4592('0xac')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x4592('0xad')](_0x4d3b9a[_0x4592('0x61')])){return this[_0x4592('0x11')][_0x4592('0xac')](_0x4592('0xcd'));}this['channel'][_0x4592('0xac')](util['format'](_0x4592('0x130'),_0x4d3b9a[_0x4592('0x61')]));var _0x38880e=this[_0x4592('0x8c')]['sync'](this,_0x4d3b9a);if(_0x38880e){this['channel'][_0x4592('0xac')](util['format'](_0x4592('0x131'),_0x38880e));var _0x590ddd=this[_0x4592('0x11')]['streamFile'](_0x38880e);try{fs[_0x4592('0x10e')](_0x38880e+_0x4592('0x10f'));}catch(_0x490f9b){logger['error'](_0x490f9b);}return _0x590ddd;}return this[_0x4592('0x11')]['error'](_0x4d3b9a,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype'][_0x4592('0x132')]=function(_0x35cd06){logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0x133'),_0x35cd06[_0x4592('0x3b')]));if(!this['isConfigured'](_0x35cd06[_0x4592('0x8d')])||!this[_0x4592('0xad')](_0x35cd06[_0x4592('0x93')])){return this[_0x4592('0x11')][_0x4592('0xac')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x4592('0xad')](_0x35cd06[_0x4592('0x95')])){return this['channel'][_0x4592('0xac')](_0x4592('0x134'));}if(!this['isConfigured'](_0x35cd06[_0x4592('0x61')])){return this[_0x4592('0x11')]['noop'](_0x4592('0xcd'));}this[_0x4592('0x11')][_0x4592('0x109')]=!![];this['createSquareDetailsReport'](_0x35cd06);this[_0x4592('0x47')](_0x35cd06[_0x4592('0x61')],'in','','');this[_0x4592('0x11')]['noop'](util[_0x4592('0x2b')](_0x4592('0x135'),_0x35cd06[_0x4592('0x61')]));var _0x27a463=this[_0x4592('0x92')][_0x4592('0x75')](this,_0x35cd06);if(_0x27a463){for(var _0x1b7c28 in _0x27a463){if(_0x27a463[_0x4592('0x9b')](_0x1b7c28)&&_[_0x4592('0x9c')](_0x27a463[_0x1b7c28])){this['channel'][_0x4592('0xa5')](util[_0x4592('0x2b')](_0x4592('0x136'),_0x1b7c28['toUpperCase']()),_0x27a463[_0x1b7c28]);}}if(_[_0x4592('0x4a')](_0x27a463[_0x4592('0x7a')])){return this[_0x4592('0x11')][_0x4592('0xac')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x4592('0x47')](_0x27a463[_0x4592('0x7a')],_0x4592('0xfd'),_0x4592('0x137'),'');return this[_0x4592('0x11')][_0x4592('0xac')](util[_0x4592('0x2b')](_0x4592('0x138'),_0x27a463[_0x4592('0x7a')]));}}return this[_0x4592('0x11')][_0x4592('0x34')](_0x35cd06,_0x4592('0x139'));};AGIVertices[_0x4592('0x14')][_0x4592('0x13a')]=function(_0x482935){logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0x13b'),_0x482935[_0x4592('0x3b')],_0x482935[_0x4592('0x6a')]));if(!this[_0x4592('0xad')](_0x482935[_0x4592('0x7e')])){return this[_0x4592('0x11')][_0x4592('0xac')](_0x4592('0x13c'));}var _0x5f2e55=_0x4592('0x13d');var _0x4e4ad4=util[_0x4592('0x2b')](_0x4592('0x13e'),FILES_PATH,rs[_0x4592('0x127')](0x4));var _0x1b5b4f=util[_0x4592('0x2b')](_0x4592('0xa4'),_0x4e4ad4,_0x5f2e55);var _0x188724=!![];if(_0x482935[_0x4592('0x13f')]===_0x4592('0x140')){_0x188724=![];}var _0x34a92a=this['channel']['recordFile'](_0x4e4ad4,_0x5f2e55,_0x482935['intKey'],_0x482935[_0x4592('0x6a')],undefined,_0x188724);if(_0x34a92a[_0x4592('0xb0')]!==-0x1){this[_0x4592('0x11')][_0x4592('0xac')](util['format']('google\x20%s\x20file\x20created',_0x1b5b4f));var _0x51e0bc=this['googleASR'][_0x4592('0x75')](this,_0x482935,_0x1b5b4f);if(_0x51e0bc){for(var _0x59f53e in _0x51e0bc){if(_0x51e0bc['hasOwnProperty'](_0x59f53e)){this[_0x4592('0x11')]['setVariable'](util[_0x4592('0x2b')](_0x4592('0x141'),_0x59f53e[_0x4592('0xf2')]()),_0x51e0bc[_0x59f53e]);}}return this['channel'][_0x4592('0xac')](util[_0x4592('0x2b')](_0x4592('0x142'),JSON[_0x4592('0x78')](_0x51e0bc)));}}return _0x34a92a;};AGIVertices[_0x4592('0x14')][_0x4592('0x143')]=function(_0x30a30f){logger[_0x4592('0x31')](util['format'](_0x4592('0x144'),_0x30a30f['label']));if(!this[_0x4592('0xad')](_0x30a30f[_0x4592('0x98')])){return this['channel'][_0x4592('0xac')](_0x4592('0x145'));}if(!this[_0x4592('0xad')](_0x30a30f['appsecret'])){return this[_0x4592('0x11')]['noop'](_0x4592('0x146'));}var _0x5491d2=_0x4592('0x13d');var _0xffd336=util[_0x4592('0x2b')](_0x4592('0x13e'),FILES_PATH,rs[_0x4592('0x127')](0x4));var _0x56c680=util[_0x4592('0x2b')](_0x4592('0xa4'),_0xffd336,_0x5491d2);var _0x47366d=!![];if(_0x30a30f[_0x4592('0x13f')]===_0x4592('0x140')){_0x47366d=![];}var _0x8c3854=this['channel']['recordFile'](_0xffd336,_0x5491d2,_0x30a30f[_0x4592('0x147')],_0x30a30f[_0x4592('0x6a')],undefined,_0x47366d);if(_0x8c3854[_0x4592('0xb0')]!==-0x1){this[_0x4592('0x11')][_0x4592('0xac')](util[_0x4592('0x2b')](_0x4592('0x148'),_0x56c680));var _0x47c4e2=this[_0x4592('0x97')][_0x4592('0x75')](this,_0x30a30f,_0x56c680);if(_0x47c4e2){for(var _0x1d58b7 in _0x47c4e2){if(_0x47c4e2[_0x4592('0x9b')](_0x1d58b7)){this['channel'][_0x4592('0xa5')](util['format']('TILDE_ASR_%s',_0x1d58b7[_0x4592('0xf2')]()),_0x47c4e2[_0x1d58b7]);}}return this[_0x4592('0x11')]['noop'](util[_0x4592('0x2b')](_0x4592('0x149'),JSON[_0x4592('0x78')](_0x47c4e2)));}}return _0x8c3854;};AGIVertices[_0x4592('0x14')][_0x4592('0x14a')]=function(_0x5b7506){logger[_0x4592('0x31')](util['format']('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x5b7506[_0x4592('0x3b')]));return this['channel'][_0x4592('0x14b')](_0x5b7506[_0x4592('0x40')],_0x5b7506[_0x4592('0x41')],_0x5b7506[_0x4592('0x42')]);};AGIVertices[_0x4592('0x14')]['gotoif']=function(_0x31c286){logger[_0x4592('0x31')](util['format'](_0x4592('0x14c'),_0x31c286[_0x4592('0x3b')]));if(!this[_0x4592('0xad')](_0x31c286['condition'])){return this['channel'][_0x4592('0x34')](_0x31c286,_0x4592('0x14d'));}try{var _0xed6ac=eval(_0x31c286['condition'])?_0x4592('0x14e'):_0x4592('0x14f');this['channel'][_0x4592('0xac')](util[_0x4592('0x2b')](_0x4592('0x150'),_0x31c286['condition'],_0xed6ac));return{'code':0xc8,'result':_0xed6ac};}catch(_0x235933){return{'code':0xc8,'result':_0x4592('0x14f')};}};AGIVertices[_0x4592('0x14')][_0x4592('0x151')]=function(_0x38ef81){logger[_0x4592('0x31')](util[_0x4592('0x2b')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x38ef81[_0x4592('0x3b')]));if(!this[_0x4592('0xad')](_0x38ef81[_0x4592('0x152')])){return this[_0x4592('0x11')][_0x4592('0x34')](_0x38ef81,_0x4592('0x153'));}var _0x5376e6=this[_0x4592('0x25')]['sync'](this,_0x38ef81[_0x4592('0x152')]);if(!_0x5376e6){return this['channel'][_0x4592('0x34')](_0x38ef81,_0x4592('0x154'));}for(var _0x313369=0x0;_0x313369<_0x5376e6[_0x4592('0xa1')];_0x313369+=0x1){var _0x1ac8cf=this[_0x4592('0x11')][_0x4592('0x15')](util['format'](_0x4592('0x155'),_0x5376e6[_0x313369]));if(_0x1ac8cf[_0x4592('0xb0')]===-0x1){return _0x1ac8cf;}logger['info'](util['format'](_0x4592('0x156'),_0x5376e6[_0x313369],_0x1ac8cf[_0x4592('0xa7')]));if(_0x1ac8cf[_0x4592('0xa7')]==='true'){logger[_0x4592('0x31')](util['format'](_0x4592('0x156'),_0x5376e6[_0x313369],_0x4592('0x14e')));this[_0x4592('0x11')][_0x4592('0xac')](util[_0x4592('0x2b')](_0x4592('0x156'),_0x5376e6[_0x313369],'true'));return{'code':0xc8,'result':_0x4592('0x14e')};}else{logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0x156'),_0x5376e6[_0x313369],'false'));this['channel']['noop'](util[_0x4592('0x2b')](_0x4592('0x156'),_0x5376e6[_0x313369],_0x4592('0x14f')));}}return{'code':0xc8,'result':_0x4592('0x14f')};};AGIVertices['prototype'][_0x4592('0x157')]=function(_0x37b7f6){logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0x158'),_0x37b7f6[_0x4592('0x3b')]));return this[_0x4592('0x11')][_0x4592('0x157')]();};AGIVertices[_0x4592('0x14')][_0x4592('0x159')]=function(_0xedc1a3){logger[_0x4592('0x31')](util[_0x4592('0x2b')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0xedc1a3[_0x4592('0x3b')]));if(!this[_0x4592('0xad')](_0xedc1a3[_0x4592('0x7e')])){return this[_0x4592('0x11')][_0x4592('0xac')](_0x4592('0x13c'));}var _0x2750b4='wav';var _0x1b97ae=util['format'](_0x4592('0x13e'),FILES_PATH,rs['generate'](0x4));var _0x413f1b=util['format'](_0x4592('0xa4'),_0x1b97ae,_0x2750b4);var _0x322c00=!![];if(_0xedc1a3['beep']===_0x4592('0x140')){_0x322c00=![];}var _0x4f668e=this[_0x4592('0x11')][_0x4592('0x15a')](_0x1b97ae,_0x2750b4,_0xedc1a3['intKey'],_0xedc1a3[_0x4592('0x6a')],undefined,_0x322c00);if(_0x4f668e[_0x4592('0xb0')]!==-0x1){this[_0x4592('0x11')]['noop'](util[_0x4592('0x2b')](_0x4592('0x15b'),_0x413f1b));var _0x42bbb8=this[_0x4592('0x88')]['sync'](this,_0xedc1a3,_0x413f1b);if(_0x42bbb8){for(var _0x44ec7b in _0x42bbb8){if(_0x42bbb8[_0x4592('0x9b')](_0x44ec7b)){this[_0x4592('0x11')][_0x4592('0xa5')](util[_0x4592('0x2b')](_0x4592('0x15c'),_0x44ec7b['toUpperCase']()),_0x42bbb8[_0x44ec7b]);}}return this[_0x4592('0x11')][_0x4592('0xac')](util['format'](_0x4592('0x15d'),JSON[_0x4592('0x78')](_0x42bbb8)));}}return _0x4f668e;};AGIVertices['prototype'][_0x4592('0x15e')]=function(_0x3a4bf1){logger['info'](util[_0x4592('0x2b')](_0x4592('0x15f'),_0x3a4bf1[_0x4592('0x3b')]));if(!this[_0x4592('0xad')](_0x3a4bf1[_0x4592('0x7e')])){return this[_0x4592('0x11')][_0x4592('0xac')](_0x4592('0x13c'));}if(!this['isConfigured'](_0x3a4bf1[_0x4592('0x61')])){return this[_0x4592('0x11')][_0x4592('0xac')]('no\x20text\x20configured');}this[_0x4592('0x11')][_0x4592('0xac')](util[_0x4592('0x2b')](_0x4592('0x160'),_0x3a4bf1[_0x4592('0x61')]));var _0x4faeae=this['ispeechTTS'][_0x4592('0x75')](this,_0x3a4bf1);if(_0x4faeae){this['channel'][_0x4592('0xac')](util[_0x4592('0x2b')](_0x4592('0x15b'),_0x4faeae));var _0x20903e=this['channel'][_0x4592('0x10d')](_0x4faeae,_0x3a4bf1[_0x4592('0x147')]);try{fs[_0x4592('0x10e')](_0x4faeae+_0x4592('0x10f'));}catch(_0x42bc30){logger[_0x4592('0x34')](_0x42bc30);}return _0x20903e;}return this[_0x4592('0x11')]['error'](_0x3a4bf1,_0x4592('0x161'));};AGIVertices[_0x4592('0x14')][_0x4592('0x162')]=function(_0x3db4e8){logger[_0x4592('0x31')](util[_0x4592('0x2b')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x3db4e8['label']));if(!this['isConfigured'](_0x3db4e8[_0x4592('0x163')])){return this[_0x4592('0x11')][_0x4592('0x34')](_0x3db4e8,_0x4592('0x164'));}logger[_0x4592('0x31')](util['format'](_0x4592('0x165'),this['channel']['callerid'],_0x3db4e8[_0x4592('0x163')]));var _0x33119c=this[_0x4592('0x5a')][_0x4592('0x75')](this,_0x3db4e8[_0x4592('0x163')]);if(_0x33119c){logger[_0x4592('0x31')](util[_0x4592('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4592('0x11')]['callerid'],_0x3db4e8['findBy']));this[_0x4592('0x11')][_0x4592('0xac')](util[_0x4592('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4592('0x11')]['callerid'],_0x3db4e8[_0x4592('0x163')]));return{'code':0xc8,'result':_0x4592('0x166')};}else{logger['info'](util[_0x4592('0x2b')](_0x4592('0x167'),this[_0x4592('0x11')][_0x4592('0x3d')],_0x3db4e8['findBy']));this[_0x4592('0x11')][_0x4592('0xac')](util[_0x4592('0x2b')](_0x4592('0x167'),this[_0x4592('0x11')][_0x4592('0x3d')],_0x3db4e8[_0x4592('0x163')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x4592('0x168')]=function(_0x4a616c){logger['info'](util[_0x4592('0x2b')](_0x4592('0x169'),_0x4a616c[_0x4592('0x3b')]));if(!this[_0x4592('0xad')](_0x4a616c[_0x4592('0x163')])){return this['channel'][_0x4592('0x34')](_0x4a616c,_0x4592('0x164'));}logger['info'](util[_0x4592('0x2b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x4592('0x11')][_0x4592('0x3d')],_0x4a616c[_0x4592('0x163')]));var _0x8e72f4=this[_0x4592('0x59')][_0x4592('0x75')](this,_0x4a616c[_0x4592('0x163')]);if(_0x8e72f4){logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0x16a'),this[_0x4592('0x11')][_0x4592('0x3d')],_0x4a616c[_0x4592('0x163')]));this[_0x4592('0x11')][_0x4592('0xac')](util[_0x4592('0x2b')](_0x4592('0x16a'),this[_0x4592('0x11')][_0x4592('0x3d')],_0x4a616c['findBy']));return{'code':0xc8,'result':_0x4592('0x166')};}else{logger[_0x4592('0x31')](util[_0x4592('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x4592('0x3d')],_0x4a616c['findBy']));this[_0x4592('0x11')][_0x4592('0xac')](util[_0x4592('0x2b')](_0x4592('0x167'),this[_0x4592('0x11')][_0x4592('0x3d')],_0x4a616c[_0x4592('0x163')]));return{'code':0xc8,'result':_0x4592('0x16b')};}};AGIVertices[_0x4592('0x14')]['math']=function(_0x127e66){logger[_0x4592('0x31')](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x127e66[_0x4592('0x3b')]));if(!this[_0x4592('0xad')](_0x127e66[_0x4592('0x16c')])){return this[_0x4592('0x11')]['error'](_0x127e66,_0x4592('0x16d'));}this[_0x4592('0x11')][_0x4592('0xac')](util['format'](_0x4592('0x16e'),_0x127e66['operation']));var _0x5253ae=eval(_0x127e66[_0x4592('0x16c')]);if(!this['isConfigured'](_0x127e66[_0x4592('0xe0')])){return this[_0x4592('0x11')][_0x4592('0xac')](_0x4592('0xe1'));}var _0x32f7a9=this[_0x4592('0x15')][_0x4592('0x75')](this,_0x127e66['variable_id']);if(!_0x32f7a9){return this[_0x4592('0x11')][_0x4592('0x34')](_0x127e66,'no\x20variable\x20found');}if(_[_0x4592('0xa0')](_0x5253ae)){var _0x141706=this;_0x5253ae[_0x4592('0xe3')](function(_0x8c0cbb,_0x4df937){_0x141706[_0x4592('0x11')][_0x4592('0xa5')](util[_0x4592('0x2b')](_0x4592('0x16f'),_0x32f7a9,_0x4df937),_0x8c0cbb);});return this[_0x4592('0x11')][_0x4592('0xac')](util[_0x4592('0x2b')]('variable\x20%s[key]\x20set',_0x32f7a9));}else{return this[_0x4592('0x11')][_0x4592('0xa5')](_0x32f7a9,_0x5253ae);}};AGIVertices['prototype'][_0x4592('0xe')]=function(_0x18170a){logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0x170'),_0x18170a[_0x4592('0x3b')]));if(_0x18170a[_0x4592('0xaa')]===0x0){return this[_0x4592('0xa9')](_0x18170a);}_0x18170a[_0x4592('0xaa')]-=0x1;if(!this[_0x4592('0xad')](_0x18170a[_0x4592('0x11e')])){return this[_0x4592('0x11')][_0x4592('0x34')](_0x18170a,_0x4592('0x11f'));}var _0x2cd402=this[_0x4592('0x1f')][_0x4592('0x75')](this,_0x18170a['file_id']);if(!_0x2cd402){return this[_0x4592('0x11')][_0x4592('0x34')](_0x18170a,_0x4592('0x120'));}var _0x20d3bb=this['channel']['getData'](_0x2cd402,_0x18170a[_0x4592('0x122')],_0x18170a[_0x4592('0x171')]);var _0x1aada9=_0x20d3bb['result'];if(_0x20d3bb[_0x4592('0xb0')]===-0x1){this[_0x4592('0x39')][_0x4592('0x75')](this,_0x18170a,'-1');return _0x20d3bb;}else if(_0x20d3bb[_0x4592('0xa7')]===_0x4592('0x6a')){_0x20d3bb['result']=_0x20d3bb['result'][_0x4592('0xa1')]>0x0?_0x20d3bb[_0x4592('0xb0')]:'t';}else if(_[_0x4592('0x49')](_0x20d3bb[_0x4592('0xb0')])){_0x20d3bb[_0x4592('0xb0')]='#';_0x1aada9='#';}if(!this['isConfigured'](_0x18170a[_0x4592('0xe0')])){this[_0x4592('0x11')]['noop'](_0x4592('0xe1'));}else{var _0x10b73d=this[_0x4592('0x15')][_0x4592('0x75')](this,_0x18170a[_0x4592('0xe0')]);if(!_0x10b73d){return this['channel'][_0x4592('0x34')](_0x18170a,'no\x20variable\x20found');}this[_0x4592('0x11')][_0x4592('0xa5')](_0x10b73d,_0x1aada9);}this[_0x4592('0x39')][_0x4592('0x75')](this,_0x18170a,_0x1aada9);return _0x20d3bb;};AGIVertices[_0x4592('0x14')][_0x4592('0xac')]=function(_0x3bf6a7){logger['info'](util['format'](_0x4592('0x172'),_0x3bf6a7[_0x4592('0x3b')]));return this[_0x4592('0x11')][_0x4592('0xac')](_0x3bf6a7[_0x4592('0x173')]||_0x3bf6a7[_0x4592('0x3b')]);};AGIVertices[_0x4592('0x14')][_0x4592('0x174')]=function(_0x9d0684){logger['info'](util[_0x4592('0x2b')](_0x4592('0x175'),_0x9d0684['label']));if(!this['isConfigured'](_0x9d0684[_0x4592('0x163')])){return this['channel'][_0x4592('0x34')](_0x9d0684,_0x4592('0x164'));}logger['info'](util[_0x4592('0x2b')](_0x4592('0x165'),this['channel']['callerid'],_0x9d0684[_0x4592('0x163')]));var _0x3cd38e=this[_0x4592('0x54')][_0x4592('0x75')](this,_0x9d0684['pause_id']);var _0x31c67d=this[_0x4592('0x56')][_0x4592('0x75')](this,_0x9d0684[_0x4592('0x163')],_0x3cd38e);if(_0x31c67d){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x4592('0x11')][_0x4592('0x3d')],_0x9d0684[_0x4592('0x163')]));this[_0x4592('0x11')][_0x4592('0xac')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x4592('0x11')]['callerid'],_0x9d0684['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0x167'),this['channel'][_0x4592('0x3d')],_0x9d0684['findBy']));this[_0x4592('0x11')][_0x4592('0xac')](util[_0x4592('0x2b')](_0x4592('0x16a'),this['channel'][_0x4592('0x3d')],_0x9d0684[_0x4592('0x163')]));return{'code':0xc8,'result':_0x4592('0x16b')};}};AGIVertices[_0x4592('0x14')][_0x4592('0x176')]=function(_0x4c0948){logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0x177'),_0x4c0948['label']));if(!this[_0x4592('0xad')](_0x4c0948[_0x4592('0x11e')])){return this[_0x4592('0x11')][_0x4592('0x34')](_0x4c0948,_0x4592('0x11f'));}var _0x9dcb=this[_0x4592('0x1f')][_0x4592('0x75')](this,_0x4c0948['file_id']);if(!_0x9dcb){return this[_0x4592('0x11')][_0x4592('0x34')](_0x4c0948,'no\x20file\x20audio\x20found');}var _0x3944e7=this[_0x4592('0x11')][_0x4592('0xae')](_0x4592('0x178'),[_0x9dcb,_0x4c0948[_0x4592('0xed')]]);if(_0x3944e7[_0x4592('0xb0')]===-0x1){return _0x3944e7;}return this[_0x4592('0x11')][_0x4592('0xac')](util['format'](_0x4592('0xcb'),_0x4592('0x178'),_0x9dcb));};AGIVertices['prototype'][_0x4592('0x179')]=function(_0x4f67ff){logger['info'](util[_0x4592('0x2b')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x4f67ff[_0x4592('0x3b')]));if(!this[_0x4592('0xad')](_0x4f67ff[_0x4592('0x17a')])){return this[_0x4592('0x11')][_0x4592('0x34')](_0x4f67ff,'no\x20queue\x20selected');}var _0x1c7cdd='';var _0xfa4b41=parseInt(_0x4f67ff['queue_id'],0xa);if(isNaN(_0xfa4b41)){_0x1c7cdd=_0x4f67ff[_0x4592('0x17a')];}else{_0x1c7cdd=this[_0x4592('0x17b')][_0x4592('0x75')](this,_0x4f67ff[_0x4592('0x17a')]);if(!_0x1c7cdd){return this[_0x4592('0x11')][_0x4592('0x34')](_0x4f67ff,_0x4592('0x17c'));}}var _0x593689='';if(this[_0x4592('0xad')](_0x4f67ff[_0x4592('0x11e')])){var _0x5d5b26=this[_0x4592('0x1f')]['sync'](this,_0x4f67ff[_0x4592('0x11e')]);if(_0x5d5b26){_0x593689=_0x5d5b26;}}this[_0x4592('0x39')][_0x4592('0x75')](this,_0x4f67ff,_0x1c7cdd);if(_0x4f67ff[_0x4592('0xed')][_0x4592('0x17d')]('x')<0x0){_0x4f67ff[_0x4592('0xed')]+='x';}if(_0x4f67ff[_0x4592('0xed')]['indexOf']('X')<0x0){_0x4f67ff['opts']+='X';}this[_0x4592('0x11')][_0x4592('0xa5')](_0x4592('0x17e'),_0x1c7cdd?_0x1c7cdd[_0x4592('0x17f')]():'');var _0x3eab8a=this[_0x4592('0x11')]['exec'](_0x4592('0x180'),[_0x1c7cdd,_0x4f67ff[_0x4592('0xed')],_0x4f67ff['url'],_0x593689,_0x4f67ff[_0x4592('0x6a')],_0x4f67ff['agi'],_0x4f67ff[_0x4592('0x181')],_0x4f67ff[_0x4592('0x182')],'',_0x4f67ff[_0x4592('0x183')]]);if(_0x3eab8a[_0x4592('0xb0')]===-0x1){return _0x3eab8a;}return this[_0x4592('0x11')][_0x4592('0xac')](util['format'](_0x4592('0xcb'),_0x4592('0x180'),_0x1c7cdd));};AGIVertices[_0x4592('0x14')][_0x4592('0x184')]=function(_0x5adc50){logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0x185'),_0x5adc50[_0x4592('0x3b')]));var _0x39d498=_0x5adc50[_0x4592('0x186')]||_0x4592('0x13d');var _0x34a492=util[_0x4592('0x2b')](_0x4592('0x187'),this[_0x4592('0x11')][_0x4592('0x3a')],rs['generate'](0x5));var _0x3496a9=util['format'](_0x4592('0x188'),FILES_PATH,_0x34a492,_0x39d498);var _0x4941cf=util[_0x4592('0x2b')](_0x4592('0x13e'),FILES_PATH,_0x34a492);this['createSquareRecording'][_0x4592('0x75')](this,_0x5adc50,_0x34a492,_0x3496a9);this[_0x4592('0x11')][_0x4592('0xa5')](_0x4592('0x189'),_0x34a492);logger[_0x4592('0x31')](_0x4592('0x18a'),_0x4941cf,_0x39d498,_0x5adc50[_0x4592('0x18b')],_0x5adc50[_0x4592('0x6a')]);return this[_0x4592('0x11')][_0x4592('0x15a')](_0x4941cf,_0x39d498,_0x5adc50[_0x4592('0x18b')],_0x5adc50[_0x4592('0x6a')],undefined,!![]);};AGIVertices[_0x4592('0x14')][_0x4592('0x18c')]=function(_0x19772a){logger[_0x4592('0x31')](util[_0x4592('0x2b')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x19772a['label']));if(!this[_0x4592('0xad')](_0x19772a[_0x4592('0x68')])){return this[_0x4592('0x11')][_0x4592('0xac')]('no\x20url\x20configured');}var _0x488709=this[_0x4592('0x18d')][_0x4592('0x75')](this,_0x19772a);logger['info'](util[_0x4592('0x2b')](_0x4592('0x18e'),util[_0x4592('0x18f')](_0x488709,{'showHidden':![],'depth':null})));if(!this[_0x4592('0xad')](_0x19772a[_0x4592('0xe0')])){return this[_0x4592('0x11')]['noop'](_0x4592('0x190'));}var _0x2f1337=this['getVariable']['sync'](this,_0x19772a['variable_id']);if(!_0x2f1337){return this[_0x4592('0x11')]['error'](_0x19772a,'no\x20variable\x20found');}this['channel'][_0x4592('0xa5')](util[_0x4592('0x2b')](_0x4592('0x191'),_0x2f1337),_0x488709[_0x4592('0x79')]?_0x488709[_0x4592('0x79')]:_0x4592('0x192'));this[_0x4592('0x11')][_0x4592('0xa5')](util[_0x4592('0x2b')](_0x4592('0x193'),_0x2f1337),_0x488709[_0x4592('0x194')]?_0x488709[_0x4592('0x194')]:'OK');if(_0x488709[_0x4592('0x6f')]){try{this[_0x4592('0xa3')](_0x488709['body'],_0x2f1337);}catch(_0x326bc1){logger[_0x4592('0x34')](util[_0x4592('0x2b')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x2f1337));}}return this[_0x4592('0x11')][_0x4592('0xac')](util[_0x4592('0x2b')](_0x4592('0xe6'),_0x2f1337));};AGIVertices['prototype'][_0x4592('0x195')]=function(_0x188553){logger['info'](util[_0x4592('0x2b')](_0x4592('0x196'),_0x188553[_0x4592('0x3b')]));return this[_0x4592('0x11')][_0x4592('0x197')](_0x188553[_0x4592('0x198')][_0x4592('0xde')](/\s+/g,''),_0x188553[_0x4592('0x18b')]);};AGIVertices['prototype'][_0x4592('0x199')]=function(_0x1d77c3){logger[_0x4592('0x31')](util['format'](_0x4592('0x19a'),_0x1d77c3['label']));return this[_0x4592('0x11')][_0x4592('0x19b')](_0x1d77c3[_0x4592('0x6b')][_0x4592('0xde')](/\s+/g,''),_0x1d77c3[_0x4592('0x18b')]);};AGIVertices[_0x4592('0x14')][_0x4592('0x19c')]=function(_0x4233b3){logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0x19d'),_0x4233b3[_0x4592('0x3b')]));return this[_0x4592('0x11')][_0x4592('0x19e')](_0x4233b3[_0x4592('0x61')],_0x4233b3[_0x4592('0x18b')]);};AGIVertices[_0x4592('0x14')][_0x4592('0x19f')]=function(_0x4eb7a4){logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0x1a0'),_0x4eb7a4[_0x4592('0x3b')]));if(!this[_0x4592('0xad')](_0x4eb7a4[_0x4592('0x1a1')])){return this[_0x4592('0x11')][_0x4592('0xac')](_0x4592('0x1a2'));}var _0x841407=this[_0x4592('0x22')][_0x4592('0x75')](this,_0x4eb7a4[_0x4592('0x1a1')]);if(!_0x841407||!_0x841407[_0x4592('0x1a3')]){return this[_0x4592('0x11')]['error'](_0x4eb7a4,_0x4592('0x1a4'));}var _0x35ab0b={'from':util[_0x4592('0x2b')](_0x4592('0x1a5'),_0x841407[_0x4592('0x17')],_0x841407[_0x4592('0x1a6')]||_0x841407['Smtp'][_0x4592('0x1a7')]),'to':_0x4eb7a4['to']||'','cc':_0x4eb7a4['cc']||'','bcc':_0x4eb7a4[_0x4592('0x1a8')]||'','subject':_0x4eb7a4[_0x4592('0x1a9')],'html':_0x4eb7a4[_0x4592('0x61')],'text':_0x4eb7a4[_0x4592('0x61')]};var _0x185516={'tls':{'rejectUnauthorized':![]}};if(_0x841407[_0x4592('0x1a3')][_0x4592('0x1aa')]){_0x185516['service']=_0x841407['Smtp'][_0x4592('0x1aa')];}else{_0x185516[_0x4592('0x1ab')]=_0x841407[_0x4592('0x1a3')]['host'];_0x185516[_0x4592('0x1ac')]=_0x841407['Smtp'][_0x4592('0x1ac')];_0x185516[_0x4592('0x1ad')]=_0x841407[_0x4592('0x1a3')][_0x4592('0x1ad')];}if(_0x841407['Smtp']['authentication']){_0x185516[_0x4592('0x1ae')]={'user':_0x841407[_0x4592('0x1a3')][_0x4592('0x1a7')],'pass':_0x841407['Smtp'][_0x4592('0x1af')]};}if(this[_0x4592('0xad')](_0x4eb7a4[_0x4592('0x1b0')])){}logger[_0x4592('0xe8')]('sendMail\x20message',JSON[_0x4592('0x78')](_0x35ab0b));this[_0x4592('0x39')]['sync'](this,_0x4eb7a4,_0x4eb7a4[_0x4592('0x1a1')]);this[_0x4592('0x11')]['noop'](util['format'](_0x4592('0x1b1'),_0x841407[_0x4592('0x17')]));this[_0x4592('0x24')][_0x4592('0x75')](this,_0x185516,_0x35ab0b);return this[_0x4592('0x11')][_0x4592('0xac')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x4592('0x14')][_0x4592('0x1b2')]=function(_0x549bd3){logger['info'](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x549bd3[_0x4592('0x3b')]));return this[_0x4592('0x11')][_0x4592('0xac')](_0x4592('0x1b3'));};AGIVertices['prototype'][_0x4592('0x1b4')]=function(_0xd1086b){logger['info'](util[_0x4592('0x2b')](_0x4592('0x1b5'),_0xd1086b[_0x4592('0x3b')]));if(!this[_0x4592('0xad')](_0xd1086b[_0x4592('0x1b6')])){return this['channel'][_0x4592('0xac')]('no\x20sms\x20account\x20configured');}var _0xe061c8=this[_0x4592('0x36')]['sync'](this,_0xd1086b['sms_account_id']);if(!_0xe061c8){return this[_0x4592('0x11')][_0x4592('0x34')](_0xd1086b,_0x4592('0x1b7'));}var _0x27ce31={'body':_0xd1086b[_0x4592('0x1b8')],'phone':_0xd1086b['to']||'','SmsAccountId':_0xe061c8['id']};logger[_0x4592('0xe8')](_0x4592('0x1b9'),JSON[_0x4592('0x78')](_0x27ce31));this[_0x4592('0x39')][_0x4592('0x75')](this,_0xd1086b,_0xd1086b[_0x4592('0x1b6')]);this[_0x4592('0x11')]['noop'](util[_0x4592('0x2b')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0xe061c8[_0x4592('0x17')]));this[_0x4592('0x38')]['sync'](this,_0x27ce31);return this[_0x4592('0x11')][_0x4592('0xac')](_0x4592('0x1ba'));};AGIVertices[_0x4592('0x14')][_0x4592('0x1bb')]=function(_0x224fda){logger['info'](util[_0x4592('0x2b')](_0x4592('0x1bc'),_0x224fda[_0x4592('0x3b')]));if(!this[_0x4592('0xad')](_0x224fda[_0x4592('0xe0')])){return this[_0x4592('0x11')][_0x4592('0x34')](_0x224fda,'no\x20variable\x20selected');}var _0x15020a=this[_0x4592('0x15')]['sync'](this,_0x224fda[_0x4592('0xe0')]);if(!_0x15020a){return this[_0x4592('0x11')][_0x4592('0x34')](_0x224fda,_0x4592('0xe2'));}return this['channel'][_0x4592('0xa5')](_0x15020a,_0x224fda[_0x4592('0x1bd')]);};AGIVertices[_0x4592('0x14')]['start']=function(_0x4c61f6){logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0x1be'),_0x4c61f6['label']));this[_0x4592('0x11')][_0x4592('0xac')](_0x4592('0x1bf'));if(_0x4c61f6[_0x4592('0xbd')]===_0x4592('0x1c0')){this['channel'][_0x4592('0xac')]('Answer');return this['channel'][_0x4592('0xbd')]();}return this[_0x4592('0x11')][_0x4592('0xac')]('Skipped\x20Answer');};AGIVertices[_0x4592('0x14')][_0x4592('0x1c1')]=function(_0x58907a){logger[_0x4592('0x31')](util[_0x4592('0x2b')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x58907a[_0x4592('0x3b')]));if(!this[_0x4592('0xad')](_0x58907a[_0x4592('0x1c2')])){return this['channel'][_0x4592('0x34')](_0x58907a,_0x4592('0x1c3'));}var _0x4b4814=this['getSquareProject'][_0x4592('0x75')](this,_0x58907a['project_id']);if(!this[_0x4592('0xad')](_0x4b4814)){return this[_0x4592('0x11')][_0x4592('0x34')](_0x58907a,util[_0x4592('0x2b')](_0x4592('0x1c4'),_0x58907a[_0x4592('0x1c2')]));}if(_0x4b4814===this[_0x4592('0x11')][_0x4592('0x45')]){return this['channel'][_0x4592('0x34')](_0x58907a,_0x4592('0x1c5'));}this[_0x4592('0x39')]['sync'](this,_0x58907a,_0x4b4814);var _0x38e5bf=this[_0x4592('0x11')][_0x4592('0xae')](_0x4592('0x1c6'),util[_0x4592('0x2b')](_0x4592('0x1c7'),config[_0x4592('0x8')][_0x4592('0x1ab')]||_0x4592('0x1c8'),_0x4b4814,this['channel']['arg_1']));if(_0x38e5bf[_0x4592('0xb0')]===-0x1){return _0x38e5bf;}return this[_0x4592('0x11')][_0x4592('0xac')](util[_0x4592('0x2b')](_0x4592('0xcb'),_0x4592('0x1c6'),_0x4b4814));};AGIVertices[_0x4592('0x14')]['system']=function(_0x255da6){logger[_0x4592('0x31')](util['format'](_0x4592('0x1c9'),_0x255da6[_0x4592('0x3b')]));var _0x350013=this[_0x4592('0x5c')][_0x4592('0x75')](this,_0x255da6[_0x4592('0x1ca')]);this['createSquareDetailsReport'][_0x4592('0x75')](this,_0x255da6,_0x255da6['command']);if(this[_0x4592('0xad')](_0x255da6[_0x4592('0xe0')])){var _0x2d9edf=this[_0x4592('0x15')][_0x4592('0x75')](this,_0x255da6[_0x4592('0xe0')]);if(_0x2d9edf){this[_0x4592('0x11')][_0x4592('0xa5')](_0x2d9edf,_0x350013);return this[_0x4592('0x11')][_0x4592('0xac')](util['format'](_0x4592('0x1cb'),_0x255da6['command'],_0x2d9edf));}}return this[_0x4592('0x11')]['noop'](util[_0x4592('0x2b')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x255da6[_0x4592('0x1ca')]));};AGIVertices[_0x4592('0x14')][_0x4592('0x1cc')]=function(_0x323cb8){logger['info'](util[_0x4592('0x2b')](_0x4592('0x1cd'),_0x323cb8[_0x4592('0x3b')]));_0x323cb8['text']=_0x323cb8[_0x4592('0x61')][_0x4592('0xde')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x4592('0xad')](_0x323cb8[_0x4592('0x5f')])){return this[_0x4592('0x11')]['noop'](_0x4592('0x1ce'));}if(!this['isConfigured'](_0x323cb8[_0x4592('0x61')])){return this[_0x4592('0x11')][_0x4592('0xac')]('no\x20text\x20configured');}this['channel'][_0x4592('0xac')](util['format'](_0x4592('0x1cf'),_0x323cb8[_0x4592('0x61')]));var _0x47ff7d=this[_0x4592('0x5e')][_0x4592('0x75')](this,_0x323cb8);if(_0x47ff7d){this[_0x4592('0x11')][_0x4592('0xac')](util[_0x4592('0x2b')](_0x4592('0x1d0'),_0x47ff7d));var _0x491b72=this[_0x4592('0x11')]['streamFile'](_0x47ff7d);try{fs[_0x4592('0x10e')](_0x47ff7d+'.wav');}catch(_0x475660){logger[_0x4592('0x34')](_0x475660);}return _0x491b72;}return this['channel'][_0x4592('0x34')](_0x323cb8,_0x4592('0x1d1'));};AGIVertices[_0x4592('0x14')][_0x4592('0x1d2')]=function(_0x2a5db5){logger[_0x4592('0x31')](util['format'](_0x4592('0x1d3'),_0x2a5db5[_0x4592('0x3b')]));_0x2a5db5[_0x4592('0x61')]=_0x2a5db5[_0x4592('0x61')][_0x4592('0xde')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x4592('0xad')](_0x2a5db5[_0x4592('0x61')])){return this['channel'][_0x4592('0xac')]('no\x20text\x20configured');}this[_0x4592('0x11')][_0x4592('0xac')](util['format']('Trying\x20Google\x20TTS\x20%s',_0x2a5db5[_0x4592('0x61')]));var _0x1e7dc8=this[_0x4592('0x66')]['sync'](this,_0x2a5db5);if(_0x1e7dc8){this[_0x4592('0x11')][_0x4592('0xac')](util['format']('Google\x20TTS\x20%s\x20file\x20created',_0x1e7dc8));var _0x30b44e=this[_0x4592('0x11')][_0x4592('0x10d')](_0x1e7dc8);try{fs['unlink'](_0x1e7dc8+_0x4592('0x10f'));}catch(_0x5e3d61){logger[_0x4592('0x34')](_0x5e3d61);}return _0x30b44e;}return this['channel'][_0x4592('0x34')](_0x2a5db5,_0x4592('0x1d4'));};AGIVertices['prototype'][_0x4592('0x1d5')]=function(_0x57c863){logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0x1d6'),_0x57c863[_0x4592('0x3b')]));if(!this[_0x4592('0xad')](_0x57c863[_0x4592('0x163')])){return this[_0x4592('0x11')][_0x4592('0x34')](_0x57c863,'no\x20find\x20by\x20configured');}logger[_0x4592('0x31')](util['format'](_0x4592('0x165'),this[_0x4592('0x11')][_0x4592('0x3d')],_0x57c863[_0x4592('0x163')]));var _0x4e6b81=this['agentUnpause']['sync'](this,_0x57c863['findBy']);if(_0x4e6b81){logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0x16a'),this[_0x4592('0x11')][_0x4592('0x3d')],_0x57c863[_0x4592('0x163')]));this['channel'][_0x4592('0xac')](util[_0x4592('0x2b')](_0x4592('0x16a'),this['channel'][_0x4592('0x3d')],_0x57c863[_0x4592('0x163')]));return{'code':0xc8,'result':_0x4592('0x166')};}else{logger['info'](util[_0x4592('0x2b')](_0x4592('0x167'),this['channel']['callerid'],_0x57c863[_0x4592('0x163')]));this[_0x4592('0x11')][_0x4592('0xac')](util[_0x4592('0x2b')](_0x4592('0x167'),this[_0x4592('0x11')]['callerid'],_0x57c863[_0x4592('0x163')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x4592('0x1d7')]=function(_0x3e363e){logger[_0x4592('0x31')](util[_0x4592('0x2b')](_0x4592('0x1d8'),_0x3e363e[_0x4592('0x3b')]));var _0x5771d5=this['channel']['exec'](_0x4592('0x1d9'),[_0x3e363e[_0x4592('0x1da')],_0x3e363e[_0x4592('0x7c')]]);if(_0x5771d5['result']===-0x1){return _0x5771d5;}return this['channel']['noop'](util[_0x4592('0x2b')](_0x4592('0xcb'),_0x4592('0x1d9'),_0x3e363e[_0x4592('0x1da')]));};AGIVertices['prototype'][_0x4592('0x1db')]=function(_0x2482e1){logger[_0x4592('0x31')](util['format'](_0x4592('0x1dc'),_0x2482e1[_0x4592('0x3b')]));if(!this[_0x4592('0xad')](_0x2482e1[_0x4592('0xe0')])){return this['channel'][_0x4592('0x34')](_0x2482e1,_0x4592('0x1dd'));}var _0x401e21=this[_0x4592('0x15')]['sync'](this,_0x2482e1[_0x4592('0xe0')]);if(!_0x401e21){return this[_0x4592('0x11')][_0x4592('0x34')](_0x2482e1,_0x4592('0xe2'));}var _0x4d4e27=this[_0x4592('0x11')]['getVariable'](_0x401e21);return{'code':0xc8,'result':_0x4d4e27[_0x4592('0xa7')]?_0x4d4e27['extra']:'-'};};String['prototype']['replaceAll']=function(_0x4fcfe6,_0x1fcdd3){return this['split'](_0x4fcfe6)['join'](_0x1fcdd3);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 129a944..3152fef 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 _0x54d8=['error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','acw','[ACW][syncAgentConnect]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../rpc/user','voiceQueues','agents','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','channels','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','getAgent','then','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','timers','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','catch'];(function(_0x258fb0,_0x5362dc){var _0x4d1afe=function(_0x1c8f24){while(--_0x1c8f24){_0x258fb0['push'](_0x258fb0['shift']());}};_0x4d1afe(++_0x5362dc);}(_0x54d8,0xd3));var _0x854d=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x54d8[_0xaa1b3e];return _0x454d7d;};'use strict';var util=require(_0x854d('0x0'));var _=require(_0x854d('0x1'));var moment=require(_0x854d('0x2'));var ami=require(_0x854d('0x3'));var logger=require('../../../config/logger')('acw');var RpcUser=require(_0x854d('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x33605e){this['voiceQueues']=_0x33605e[_0x854d('0x5')];this[_0x854d('0x6')]=_0x33605e['agents'];this['timers']=_0x33605e['timers'];this['channels']={};ami['on']('agentconnect',this[_0x854d('0x7')][_0x854d('0x8')](this));ami['on'](_0x854d('0x9'),this[_0x854d('0xa')][_0x854d('0x8')](this));ami['on'](_0x854d('0xb'),this[_0x854d('0xc')][_0x854d('0x8')](this));ami['on'](_0x854d('0xd'),this[_0x854d('0xe')][_0x854d('0x8')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x854d('0x8')](this));ami['on'](_0x854d('0xf'),this[_0x854d('0x10')]['bind'](this));ami['on'](_0x854d('0x11'),this[_0x854d('0x12')]['bind'](this));}function getDiff(_0x5b8b44){var _0x36ea9b=moment()[_0x854d('0x13')](0x0);var _0x52d553=moment(_0x5b8b44)[_0x854d('0x13')](0x0);return _0x36ea9b[_0x854d('0x14')](_0x52d553,_0x854d('0x15'));}Acw[_0x854d('0x16')][_0x854d('0x17')]=function(_0x12005f){try{var _0x2d63b5=this;var _0x293bff=this['channels'][_0x12005f][_0x854d('0x18')];var _0x2f40a0=this[_0x854d('0x19')][_0x12005f][_0x854d('0x1a')];var _0x3f0f28=this[_0x854d('0x5')][_0x2f40a0];var _0x1d9966=![];var _0xea92ac=_0x854d('0x1b');if(_0x3f0f28[_0x854d('0x1c')]){if(_0x3f0f28[_0x854d('0x1d')][_0x854d('0x1e')]){_0x1d9966=!![];_0xea92ac=_0x3f0f28[_0x854d('0x1d')][_0x854d('0x1e')];}}ami[_0x854d('0x1f')]({'action':'QueuePause','interface':_0x293bff,'paused':!![],'reason':_0xea92ac})['then'](function(_0x31edad){if(_0x2d63b5['agents'][_0x293bff]){return RpcUser[_0x854d('0x20')](_0x2d63b5[_0x854d('0x6')][_0x293bff]['id'])[_0x854d('0x21')](function(_0x534d21){if(_0x534d21&&!_0x534d21['voicePause']){logger[_0x854d('0x22')](_0x854d('0x23'),_0x12005f,_0x293bff,_0x2f40a0);var _0x84fb0a=_0x2d63b5[_0x854d('0x19')][_0x12005f]['attended']&&_0x2d63b5[_0x854d('0x19')][_0x12005f][_0x854d('0x24')]?_0x2d63b5[_0x854d('0x19')][_0x12005f]['destlinkedid']:_0x12005f;return RpcUser[_0x854d('0x25')](_0x2d63b5[_0x854d('0x6')][_0x293bff],_0xea92ac,_0x84fb0a)['then'](function(_0x1d05ba){if(!_0x1d9966){_0x2d63b5[_0x854d('0x26')][_0x293bff]={};logger[_0x854d('0x22')](_0x854d('0x27'),_0x12005f,_0x2d63b5[_0x854d('0x5')][_0x2f40a0][_0x854d('0x28')],_0x293bff,_0x2f40a0);_0x2d63b5[_0x854d('0x26')][_0x293bff][_0x854d('0x29')]=setTimeout(_0x2d63b5[_0x854d('0x2a')][_0x854d('0x8')](_0x2d63b5,_0x293bff),_0x2d63b5[_0x854d('0x5')][_0x2f40a0]['acwTimeout']*0x3e8);_0x2d63b5[_0x854d('0x26')][_0x293bff][_0x854d('0x2b')]=moment()[_0x854d('0x2c')](_0x854d('0x2d'));_0x2d63b5[_0x854d('0x26')][_0x293bff][_0x854d('0x2e')]=_0x12005f;_0x2d63b5[_0x854d('0x26')][_0x293bff]['queue']=_0x2f40a0;_0x2d63b5[_0x854d('0x26')][_0x293bff][_0x854d('0x2f')]=function(){var _0x5e3b65=getDiff(_0x2d63b5[_0x854d('0x26')][_0x293bff]['lastPauseAt']);clearTimeout(_0x2d63b5[_0x854d('0x26')][_0x293bff][_0x854d('0x29')]);_0x2d63b5['timers'][_0x293bff][_0x854d('0x29')]=![];RpcVoiceAgentReport[_0x854d('0x30')]({'acwtime':_0x5e3b65},_0x2d63b5[_0x854d('0x26')][_0x293bff][_0x854d('0x2e')],_0x293bff)['then'](function(_0x19ab67){logger[_0x854d('0x22')]('[%s][UPDATE][ACWTIME:%s]',_0x12005f,_0x5e3b65,_0x19ab67);})[_0x854d('0x31')](function(_0x4c0d5b){logger[_0x854d('0x32')](_0x854d('0x33'),_0x12005f,_0x4c0d5b);});delete _0x2d63b5[_0x854d('0x26')][_0x293bff];};}});}else{logger[_0x854d('0x22')](_0x854d('0x34'),_0x12005f,_0x293bff,_0x2f40a0);}});}})[_0x854d('0x31')](function(_0x1e56f2){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x12005f,_0x2d63b5[_0x854d('0x5')][_0x2f40a0][_0x854d('0x28')],_0x293bff,_0x2f40a0);})[_0x854d('0x35')](function(){delete _0x2d63b5[_0x854d('0x19')][_0x12005f];});}catch(_0x1ba94b){logger[_0x854d('0x32')](_0x854d('0x36'),_0x1ba94b[_0x854d('0x37')]);}};Acw['prototype']['stopAcw']=function(_0x5ef5a1){try{var _0x33b60c=this;if(_0x33b60c[_0x854d('0x26')][_0x5ef5a1]){_0x33b60c['timers'][_0x5ef5a1][_0x854d('0x29')]=![];var _0x298866=_0x33b60c['timers'][_0x5ef5a1][_0x854d('0x2e')];var _0x5b9a4f=_0x33b60c['timers'][_0x5ef5a1][_0x854d('0x1a')];var _0x5936b7=_0x33b60c[_0x854d('0x5')][_0x5b9a4f][_0x854d('0x28')];logger[_0x854d('0x22')]('[%s][TIMER][STOP][AGENT:%s]',_0x298866,_0x5ef5a1);RpcUser['saveUnpause'](this['agents'][_0x5ef5a1]);RpcVoiceAgentReport[_0x854d('0x30')]({'acwtime':_0x5936b7,'agentacw':!![]},_0x298866,_0x5ef5a1)[_0x854d('0x21')](function(_0x3509ab){logger[_0x854d('0x22')](_0x854d('0x38'),_0x298866,_0x5936b7,_0x3509ab);})[_0x854d('0x31')](function(_0x28517d){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x298866,_0x28517d);});}else{logger[_0x854d('0x32')](_0x854d('0x39'),_0x5ef5a1);if(_0x33b60c[_0x854d('0x26')]){logger[_0x854d('0x22')]('[ACW][TIMERS]',JSON[_0x854d('0x3a')](_0x33b60c[_0x854d('0x26')]));}}}catch(_0x45a2c7){logger[_0x854d('0x32')](_0x854d('0x3b'),_0x45a2c7[_0x854d('0x37')]);}};Acw[_0x854d('0x16')][_0x854d('0x7')]=function(_0x5ad079){try{if(this[_0x854d('0x5')][_0x5ad079['queue']]&&(this[_0x854d('0x5')][_0x5ad079[_0x854d('0x1a')]][_0x854d('0x3c')]||this[_0x854d('0x5')][_0x5ad079['queue']][_0x854d('0x1c')])){if(this['agents'][_0x5ad079[_0x854d('0x18')]]){this['channels'][_0x5ad079[_0x854d('0x2e')]]={'queue':_0x5ad079[_0x854d('0x1a')],'interface':_0x5ad079[_0x854d('0x18')],'destlinkedid':_0x5ad079[_0x854d('0x24')]};}}}catch(_0x41c454){logger[_0x854d('0x32')](_0x854d('0x3d'),_0x41c454[_0x854d('0x37')]);}};Acw[_0x854d('0x16')][_0x854d('0x12')]=function(_0x354f82){try{if(this[_0x854d('0x5')][_0x354f82[_0x854d('0x1a')]]&&(this[_0x854d('0x5')][_0x354f82[_0x854d('0x1a')]][_0x854d('0x3c')]||this['voiceQueues'][_0x354f82['queue']]['mandatoryDisposition'])){if(this[_0x854d('0x6')][_0x354f82[_0x854d('0x18')]]){this[_0x854d('0x19')][_0x354f82[_0x854d('0x2e')]]={'queue':_0x354f82[_0x854d('0x1a')],'interface':_0x354f82[_0x854d('0x18')]};}}}catch(_0x5ba557){logger[_0x854d('0x32')]('[ACW][syncAgentConnectPreview]\x20%s',_0x5ba557[_0x854d('0x37')]);}};Acw[_0x854d('0x16')]['syncHangupRequest']=function(_0x18c730){try{if(this[_0x854d('0x19')][_0x18c730['uniqueid']]&&_[_0x854d('0x3e')](this[_0x854d('0x19')][_0x18c730[_0x854d('0x2e')]][_0x854d('0x3f')])){logger[_0x854d('0x22')](_0x854d('0x40'),_0x18c730['uniqueid']);this[_0x854d('0x17')](_0x18c730[_0x854d('0x2e')]);}else if(this['channels'][_0x18c730[_0x854d('0x41')]]&&_['isUndefined'](this[_0x854d('0x19')][_0x18c730[_0x854d('0x41')]][_0x854d('0x3f')])){logger['info'](_0x854d('0x42'),_0x18c730[_0x854d('0x41')]);this[_0x854d('0x17')](_0x18c730[_0x854d('0x41')]);}}catch(_0x4ad086){logger[_0x854d('0x32')](_0x854d('0x43'),_0x4ad086[_0x854d('0x37')]);}};Acw['prototype'][_0x854d('0xc')]=function(_0x5a7b1a){try{if(this[_0x854d('0x19')][_0x5a7b1a['uniqueid']]&&this[_0x854d('0x19')][_0x5a7b1a[_0x854d('0x2e')]][_0x854d('0x3f')]){logger['info'](_0x854d('0x44'),_0x5a7b1a[_0x854d('0x2e')]);this[_0x854d('0x17')](_0x5a7b1a[_0x854d('0x2e')]);}else if(this[_0x854d('0x19')][_0x5a7b1a['linkedid']]&&this['channels'][_0x5a7b1a[_0x854d('0x41')]][_0x854d('0x3f')]){logger[_0x854d('0x22')](_0x854d('0x45'),_0x5a7b1a[_0x854d('0x41')]);this[_0x854d('0x17')](_0x5a7b1a[_0x854d('0x41')]);}}catch(_0x56e59e){logger[_0x854d('0x32')](_0x854d('0x46'),_0x56e59e['message']);}};Acw[_0x854d('0x16')][_0x854d('0x47')]=function(_0x1fe7c9){try{if(!_[_0x854d('0x48')](this[_0x854d('0x19')][_0x1fe7c9[_0x854d('0x49')]])){this['startAcw'](_0x1fe7c9[_0x854d('0x49')]);if(this[_0x854d('0x19')][_0x1fe7c9[_0x854d('0x4a')]]){this[_0x854d('0x19')][_0x1fe7c9[_0x854d('0x4a')]]['attended']=!![];this[_0x854d('0x19')][_0x1fe7c9[_0x854d('0x4b')]]=this[_0x854d('0x19')][_0x1fe7c9[_0x854d('0x4a')]];delete this[_0x854d('0x19')][_0x1fe7c9[_0x854d('0x4a')]];}}else if(!_[_0x854d('0x48')](this[_0x854d('0x19')][_0x1fe7c9['transfertargetuniqueid']])){this[_0x854d('0x17')](_0x1fe7c9[_0x854d('0x4b')]);if(this[_0x854d('0x19')][_0x1fe7c9[_0x854d('0x4c')]]){this[_0x854d('0x19')][_0x1fe7c9['origtransfereruniqueid']][_0x854d('0x3f')]=!![];this[_0x854d('0x19')][_0x1fe7c9[_0x854d('0x49')]]=this[_0x854d('0x19')][_0x1fe7c9['origtransfereruniqueid']];delete this[_0x854d('0x19')][_0x1fe7c9[_0x854d('0x4c')]];}}}catch(_0x1cac82){logger[_0x854d('0x32')](_0x854d('0x4d'),_0x1cac82[_0x854d('0x37')]);}};Acw[_0x854d('0x16')][_0x854d('0x10')]=function(_0x4cd5bf){try{if(this[_0x854d('0x19')][_0x4cd5bf[_0x854d('0x4e')]]){logger[_0x854d('0x22')](_0x854d('0x4f'),JSON[_0x854d('0x3a')](_0x4cd5bf[_0x854d('0x4e')]));this['startAcw'](_0x4cd5bf['transfereruniqueid']);}else if(this[_0x854d('0x19')][_0x4cd5bf[_0x854d('0x50')]]){logger[_0x854d('0x22')](_0x854d('0x51'),JSON[_0x854d('0x3a')](_0x4cd5bf['transfererlinkedid']));this[_0x854d('0x17')](_0x4cd5bf['transfererlinkedid']);}}catch(_0x25c2a4){logger[_0x854d('0x32')](_0x854d('0x52'),_0x25c2a4['message']);}};Acw[_0x854d('0x16')][_0x854d('0xe')]=function(_0xd79c21){try{if(this['voiceQueues'][_0xd79c21[_0x854d('0x1a')]]&&this[_0x854d('0x5')][_0xd79c21[_0x854d('0x1a')]][_0x854d('0x53')]==='all'){if(this['agents'][_0xd79c21[_0x854d('0x18')]]){logger[_0x854d('0x22')](_0x854d('0x54'),_0xd79c21[_0x854d('0x2e')],_0xd79c21['interface'],_0xd79c21['queue']);return RpcUser[_0x854d('0x25')](this['agents'][_0xd79c21[_0x854d('0x18')]],'Auto-Pause',_0xd79c21[_0x854d('0x2e')]);}}}catch(_0x3b2702){logger[_0x854d('0x32')](_0x854d('0x55'),_0x3b2702[_0x854d('0x37')]);}};module[_0x854d('0x56')]=Acw; \ No newline at end of file +var _0x6d0f=['origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','prototype','startAcw','channels','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','acw','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid'];(function(_0x3dc7c2,_0x59abef){var _0x34d166=function(_0x4e9978){while(--_0x4e9978){_0x3dc7c2['push'](_0x3dc7c2['shift']());}};_0x34d166(++_0x59abef);}(_0x6d0f,0x169));var _0xf6d0=function(_0x3fe225,_0x235b34){_0x3fe225=_0x3fe225-0x0;var _0x951873=_0x6d0f[_0x3fe225];return _0x951873;};'use strict';var util=require('util');var _=require(_0xf6d0('0x0'));var moment=require(_0xf6d0('0x1'));var ami=require(_0xf6d0('0x2'));var logger=require(_0xf6d0('0x3'))('acw');var RpcUser=require(_0xf6d0('0x4'));var RpcVoiceAgentReport=require(_0xf6d0('0x5'));function Acw(_0x3ab8b1){this[_0xf6d0('0x6')]=_0x3ab8b1['voiceQueues'];this[_0xf6d0('0x7')]=_0x3ab8b1[_0xf6d0('0x7')];this[_0xf6d0('0x8')]=_0x3ab8b1['timers'];this['channels']={};ami['on'](_0xf6d0('0x9'),this[_0xf6d0('0xa')][_0xf6d0('0xb')](this));ami['on'](_0xf6d0('0xc'),this[_0xf6d0('0xd')][_0xf6d0('0xb')](this));ami['on'](_0xf6d0('0xe'),this[_0xf6d0('0xf')][_0xf6d0('0xb')](this));ami['on'](_0xf6d0('0x10'),this[_0xf6d0('0x11')][_0xf6d0('0xb')](this));ami['on']('attendedtransfer',this[_0xf6d0('0x12')]['bind'](this));ami['on'](_0xf6d0('0x13'),this[_0xf6d0('0x14')][_0xf6d0('0xb')](this));ami['on']('custom:agentConnectPreview',this[_0xf6d0('0x15')][_0xf6d0('0xb')](this));}function getDiff(_0x40ae14){var _0x39973b=moment()['milliseconds'](0x0);var _0x103f22=moment(_0x40ae14)[_0xf6d0('0x16')](0x0);return _0x39973b[_0xf6d0('0x17')](_0x103f22,'seconds');}Acw[_0xf6d0('0x18')][_0xf6d0('0x19')]=function(_0x447123){try{var _0x25fdda=this;var _0x5ed461=this[_0xf6d0('0x1a')][_0x447123][_0xf6d0('0x1b')];var _0x4ade57=this['channels'][_0x447123]['queue'];var _0x3927c1=this['voiceQueues'][_0x4ade57];var _0xc00a95=![];var _0x2429ce=_0xf6d0('0x1c');if(_0x3927c1[_0xf6d0('0x1d')]){if(_0x3927c1[_0xf6d0('0x1e')][_0xf6d0('0x1f')]){_0xc00a95=!![];_0x2429ce=_0x3927c1[_0xf6d0('0x1e')]['name'];}}ami[_0xf6d0('0x20')]({'action':'QueuePause','interface':_0x5ed461,'paused':!![],'reason':_0x2429ce})[_0xf6d0('0x21')](function(_0x2154a5){if(_0x25fdda['agents'][_0x5ed461]){return RpcUser[_0xf6d0('0x22')](_0x25fdda[_0xf6d0('0x7')][_0x5ed461]['id'])['then'](function(_0x131d12){if(_0x131d12&&!_0x131d12[_0xf6d0('0x23')]){logger[_0xf6d0('0x24')](_0xf6d0('0x25'),_0x447123,_0x5ed461,_0x4ade57);var _0x2f41fe=_0x25fdda[_0xf6d0('0x1a')][_0x447123][_0xf6d0('0x26')]&&_0x25fdda[_0xf6d0('0x1a')][_0x447123][_0xf6d0('0x27')]?_0x25fdda[_0xf6d0('0x1a')][_0x447123][_0xf6d0('0x27')]:_0x447123;return RpcUser[_0xf6d0('0x28')](_0x25fdda[_0xf6d0('0x7')][_0x5ed461],_0x2429ce,_0x2f41fe)[_0xf6d0('0x21')](function(_0xcc09f6){if(!_0xc00a95){_0x25fdda[_0xf6d0('0x8')][_0x5ed461]={};logger[_0xf6d0('0x24')](_0xf6d0('0x29'),_0x447123,_0x25fdda['voiceQueues'][_0x4ade57][_0xf6d0('0x2a')],_0x5ed461,_0x4ade57);_0x25fdda[_0xf6d0('0x8')][_0x5ed461][_0xf6d0('0x2b')]=setTimeout(_0x25fdda[_0xf6d0('0x2c')][_0xf6d0('0xb')](_0x25fdda,_0x5ed461),_0x25fdda[_0xf6d0('0x6')][_0x4ade57][_0xf6d0('0x2a')]*0x3e8);_0x25fdda[_0xf6d0('0x8')][_0x5ed461][_0xf6d0('0x2d')]=moment()[_0xf6d0('0x2e')](_0xf6d0('0x2f'));_0x25fdda[_0xf6d0('0x8')][_0x5ed461][_0xf6d0('0x30')]=_0x447123;_0x25fdda[_0xf6d0('0x8')][_0x5ed461][_0xf6d0('0x31')]=_0x4ade57;_0x25fdda['timers'][_0x5ed461][_0xf6d0('0x32')]=function(){var _0x5316ba=getDiff(_0x25fdda[_0xf6d0('0x8')][_0x5ed461][_0xf6d0('0x2d')]);clearTimeout(_0x25fdda[_0xf6d0('0x8')][_0x5ed461][_0xf6d0('0x2b')]);_0x25fdda[_0xf6d0('0x8')][_0x5ed461][_0xf6d0('0x2b')]=![];RpcVoiceAgentReport[_0xf6d0('0x33')]({'acwtime':_0x5316ba},_0x25fdda[_0xf6d0('0x8')][_0x5ed461][_0xf6d0('0x30')],_0x5ed461)[_0xf6d0('0x21')](function(_0x53ee05){logger['info'](_0xf6d0('0x34'),_0x447123,_0x5316ba,_0x53ee05);})[_0xf6d0('0x35')](function(_0x33125d){logger['error'](_0xf6d0('0x36'),_0x447123,_0x33125d);});delete _0x25fdda[_0xf6d0('0x8')][_0x5ed461];};}});}else{logger[_0xf6d0('0x24')](_0xf6d0('0x37'),_0x447123,_0x5ed461,_0x4ade57);}});}})['catch'](function(_0x3f0d7f){logger[_0xf6d0('0x38')](_0xf6d0('0x29'),_0x447123,_0x25fdda[_0xf6d0('0x6')][_0x4ade57][_0xf6d0('0x2a')],_0x5ed461,_0x4ade57);})['finally'](function(){delete _0x25fdda['channels'][_0x447123];});}catch(_0x4c2d5e){logger[_0xf6d0('0x38')]('[ACW][START]\x20%s',_0x4c2d5e[_0xf6d0('0x39')]);}};Acw[_0xf6d0('0x18')][_0xf6d0('0x2c')]=function(_0x13da72){try{var _0x58036f=this;if(_0x58036f[_0xf6d0('0x8')][_0x13da72]){_0x58036f[_0xf6d0('0x8')][_0x13da72][_0xf6d0('0x2b')]=![];var _0x53dfe6=_0x58036f['timers'][_0x13da72][_0xf6d0('0x30')];var _0x21daa1=_0x58036f[_0xf6d0('0x8')][_0x13da72][_0xf6d0('0x31')];var _0x35e969=_0x58036f[_0xf6d0('0x6')][_0x21daa1][_0xf6d0('0x2a')];logger[_0xf6d0('0x24')](_0xf6d0('0x3a'),_0x53dfe6,_0x13da72);RpcUser[_0xf6d0('0x3b')](this[_0xf6d0('0x7')][_0x13da72]);RpcVoiceAgentReport[_0xf6d0('0x33')]({'acwtime':_0x35e969,'agentacw':!![]},_0x53dfe6,_0x13da72)[_0xf6d0('0x21')](function(_0x4def91){logger[_0xf6d0('0x24')](_0xf6d0('0x34'),_0x53dfe6,_0x35e969,_0x4def91);})['catch'](function(_0x3b84cf){logger[_0xf6d0('0x38')](_0xf6d0('0x36'),_0x53dfe6,_0x3b84cf);});}else{logger[_0xf6d0('0x38')](_0xf6d0('0x3c'),_0x13da72);if(_0x58036f[_0xf6d0('0x8')]){logger[_0xf6d0('0x24')](_0xf6d0('0x3d'),JSON[_0xf6d0('0x3e')](_0x58036f[_0xf6d0('0x8')]));}}}catch(_0x777a87){logger[_0xf6d0('0x38')]('[ACW][STOP]\x20%s',_0x777a87[_0xf6d0('0x39')]);}};Acw[_0xf6d0('0x18')][_0xf6d0('0xa')]=function(_0x4da77e){try{if(this[_0xf6d0('0x6')][_0x4da77e['queue']]&&(this['voiceQueues'][_0x4da77e[_0xf6d0('0x31')]]['acw']||this['voiceQueues'][_0x4da77e[_0xf6d0('0x31')]][_0xf6d0('0x1d')])){if(this[_0xf6d0('0x7')][_0x4da77e[_0xf6d0('0x1b')]]){this[_0xf6d0('0x1a')][_0x4da77e[_0xf6d0('0x30')]]={'queue':_0x4da77e['queue'],'interface':_0x4da77e[_0xf6d0('0x1b')],'destlinkedid':_0x4da77e[_0xf6d0('0x27')]};}}}catch(_0x70f896){logger[_0xf6d0('0x38')]('[ACW][syncAgentConnect]\x20%s',_0x70f896[_0xf6d0('0x39')]);}};Acw[_0xf6d0('0x18')]['syncAgentConnectPreview']=function(_0x434f3e){try{if(this[_0xf6d0('0x6')][_0x434f3e['queue']]&&(this[_0xf6d0('0x6')][_0x434f3e[_0xf6d0('0x31')]][_0xf6d0('0x3f')]||this[_0xf6d0('0x6')][_0x434f3e[_0xf6d0('0x31')]]['mandatoryDisposition'])){if(this[_0xf6d0('0x7')][_0x434f3e['interface']]){this[_0xf6d0('0x1a')][_0x434f3e[_0xf6d0('0x30')]]={'queue':_0x434f3e[_0xf6d0('0x31')],'interface':_0x434f3e[_0xf6d0('0x1b')]};}}}catch(_0x2b393d){logger['error'](_0xf6d0('0x40'),_0x2b393d['message']);}};Acw[_0xf6d0('0x18')]['syncHangupRequest']=function(_0x38dcc7){try{if(this[_0xf6d0('0x1a')][_0x38dcc7[_0xf6d0('0x30')]]&&_[_0xf6d0('0x41')](this[_0xf6d0('0x1a')][_0x38dcc7[_0xf6d0('0x30')]][_0xf6d0('0x26')])){logger['info']('[%s][HANGUP:UNIQUEID]',_0x38dcc7[_0xf6d0('0x30')]);this['startAcw'](_0x38dcc7['uniqueid']);}else if(this['channels'][_0x38dcc7[_0xf6d0('0x42')]]&&_['isUndefined'](this['channels'][_0x38dcc7[_0xf6d0('0x42')]][_0xf6d0('0x26')])){logger[_0xf6d0('0x24')](_0xf6d0('0x43'),_0x38dcc7[_0xf6d0('0x42')]);this['startAcw'](_0x38dcc7[_0xf6d0('0x42')]);}}catch(_0x1b11d0){logger[_0xf6d0('0x38')](_0xf6d0('0x44'),_0x1b11d0['message']);}};Acw[_0xf6d0('0x18')][_0xf6d0('0xf')]=function(_0xf48027){try{if(this[_0xf6d0('0x1a')][_0xf48027['uniqueid']]&&this[_0xf6d0('0x1a')][_0xf48027['uniqueid']][_0xf6d0('0x26')]){logger[_0xf6d0('0x24')](_0xf6d0('0x45'),_0xf48027[_0xf6d0('0x30')]);this[_0xf6d0('0x19')](_0xf48027['uniqueid']);}else if(this[_0xf6d0('0x1a')][_0xf48027[_0xf6d0('0x42')]]&&this[_0xf6d0('0x1a')][_0xf48027['linkedid']][_0xf6d0('0x26')]){logger[_0xf6d0('0x24')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0xf48027[_0xf6d0('0x42')]);this[_0xf6d0('0x19')](_0xf48027[_0xf6d0('0x42')]);}}catch(_0x52a2ed){logger[_0xf6d0('0x38')]('[ACW][syncHangup]\x20%s',_0x52a2ed[_0xf6d0('0x39')]);}};Acw['prototype'][_0xf6d0('0x12')]=function(_0x25b032){try{if(!_[_0xf6d0('0x46')](this[_0xf6d0('0x1a')][_0x25b032[_0xf6d0('0x47')]])){this[_0xf6d0('0x19')](_0x25b032[_0xf6d0('0x47')]);if(this[_0xf6d0('0x1a')][_0x25b032[_0xf6d0('0x48')]]){this[_0xf6d0('0x1a')][_0x25b032[_0xf6d0('0x48')]][_0xf6d0('0x26')]=!![];this[_0xf6d0('0x1a')][_0x25b032[_0xf6d0('0x49')]]=this[_0xf6d0('0x1a')][_0x25b032[_0xf6d0('0x48')]];delete this[_0xf6d0('0x1a')][_0x25b032[_0xf6d0('0x48')]];}}else if(!_['isNil'](this['channels'][_0x25b032[_0xf6d0('0x49')]])){this[_0xf6d0('0x19')](_0x25b032[_0xf6d0('0x49')]);if(this['channels'][_0x25b032[_0xf6d0('0x4a')]]){this[_0xf6d0('0x1a')][_0x25b032[_0xf6d0('0x4a')]][_0xf6d0('0x26')]=!![];this['channels'][_0x25b032[_0xf6d0('0x47')]]=this[_0xf6d0('0x1a')][_0x25b032['origtransfereruniqueid']];delete this[_0xf6d0('0x1a')][_0x25b032['origtransfereruniqueid']];}}}catch(_0x45dad7){logger[_0xf6d0('0x38')](_0xf6d0('0x4b'),_0x45dad7['message']);}};Acw[_0xf6d0('0x18')][_0xf6d0('0x14')]=function(_0x79052f){try{if(this[_0xf6d0('0x1a')][_0x79052f[_0xf6d0('0x4c')]]){logger[_0xf6d0('0x24')](_0xf6d0('0x4d'),JSON['stringify'](_0x79052f[_0xf6d0('0x4c')]));this[_0xf6d0('0x19')](_0x79052f[_0xf6d0('0x4c')]);}else if(this[_0xf6d0('0x1a')][_0x79052f[_0xf6d0('0x4e')]]){logger[_0xf6d0('0x24')](_0xf6d0('0x4f'),JSON[_0xf6d0('0x3e')](_0x79052f[_0xf6d0('0x4e')]));this[_0xf6d0('0x19')](_0x79052f[_0xf6d0('0x4e')]);}}catch(_0x50936e){logger['error'](_0xf6d0('0x50'),_0x50936e[_0xf6d0('0x39')]);}};Acw[_0xf6d0('0x18')][_0xf6d0('0x11')]=function(_0x28eed4){try{if(this[_0xf6d0('0x6')][_0x28eed4['queue']]&&this['voiceQueues'][_0x28eed4['queue']][_0xf6d0('0x51')]===_0xf6d0('0x52')){if(this[_0xf6d0('0x7')][_0x28eed4['interface']]){logger['info'](_0xf6d0('0x53'),_0x28eed4[_0xf6d0('0x30')],_0x28eed4['interface'],_0x28eed4[_0xf6d0('0x31')]);return RpcUser[_0xf6d0('0x28')](this[_0xf6d0('0x7')][_0x28eed4[_0xf6d0('0x1b')]],_0xf6d0('0x54'),_0x28eed4[_0xf6d0('0x30')]);}}}catch(_0x5ae468){logger[_0xf6d0('0x38')](_0xf6d0('0x55'),_0x5ae468[_0xf6d0('0x39')]);}};module[_0xf6d0('0x56')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index f01968b..18482cf 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 _0xb10b=['asterisk','port','password','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','username','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionCoreShowChannels','[ami.js][fullybooted]','asterisk-manager','moment','util','lodash','ami','../../config/environment'];(function(_0x4602e4,_0x3d549c){var _0x289924=function(_0xdcecc9){while(--_0xdcecc9){_0x4602e4['push'](_0x4602e4['shift']());}};_0x289924(++_0x3d549c);}(_0xb10b,0x12a));var _0xbb10=function(_0x4c34d8,_0x383073){_0x4c34d8=_0x4c34d8-0x0;var _0x4c21df=_0xb10b[_0x4c34d8];return _0x4c21df;};'use strict';var Manager=require(_0xbb10('0x0'));var BPromise=require('bluebird');var moment=require(_0xbb10('0x1'));var util=require(_0xbb10('0x2'));var _=require(_0xbb10('0x3'));var logger=require('../../config/logger')(_0xbb10('0x4'));var config=require(_0xbb10('0x5'));var ami=new Manager(config[_0xbb10('0x6')][_0xbb10('0x7')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')]['username'],config[_0xbb10('0x6')][_0xbb10('0x8')],!![]);ami['keepConnected']();ami[_0xbb10('0x9')]=BPromise[_0xbb10('0xa')](ami[_0xbb10('0xb')]);function error(_0x1c3ee5){logger[_0xbb10('0xc')](util[_0xbb10('0xd')](_0xbb10('0xe'),config[_0xbb10('0x6')]['username'],config['asterisk']['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')],util[_0xbb10('0xf')](_0x1c3ee5,![],null)));}function close(){logger['error'](util[_0xbb10('0xd')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xbb10('0x6')][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')]));}ami[_0xbb10('0x11')]=function(){return function(){return ami['Action']({'action':_0xbb10('0x12')});};};ami[_0xbb10('0x13')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x14')});};};ami[_0xbb10('0x15')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x16')});};};ami[_0xbb10('0x17')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x18')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x19')});};};function connect(_0x133ac2){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')](_0xbb10('0x1b'),config[_0xbb10('0x6')][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')]['port']));ami[_0xbb10('0x1c')](_0xbb10('0xc'),error);ami[_0xbb10('0x1c')](_0xbb10('0x1d'),close);}ami['on'](_0xbb10('0x1e'),connect);ami['on'](_0xbb10('0x1f'),function(_0x4deb49){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')],util[_0xbb10('0xf')](_0x4deb49,![],null)));});ami['on'](_0xbb10('0x20'),function(_0x407cb4){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')](_0xbb10('0x21'),config[_0xbb10('0x6')][_0xbb10('0x10')],config['asterisk']['ip'],config['asterisk']['port']));return BPromise[_0xbb10('0x22')]()[_0xbb10('0x23')](ami[_0xbb10('0x11')]())['then'](ami[_0xbb10('0x13')]())[_0xbb10('0x23')](ami[_0xbb10('0x15')]())[_0xbb10('0x23')](ami[_0xbb10('0x17')]())[_0xbb10('0x23')](ami[_0xbb10('0x24')]())['catch'](function(_0x3796c7){logger[_0xbb10('0xc')](_0xbb10('0x25'),util[_0xbb10('0xf')](_0x3796c7,{'showHidden':![],'depth':null}));});});ami[_0xbb10('0x1c')](_0xbb10('0xc'),error);ami['once'](_0xbb10('0x1d'),close);module['exports']=ami; \ No newline at end of file +var _0x0b0e=['../../config/environment','asterisk','port','username','password','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionQueueSummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','close','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipPeerStatus','catch','[ami.js][fullybooted]','once','asterisk-manager','moment','lodash','../../config/logger','ami'];(function(_0x42c54f,_0x40023a){var _0x4c5e40=function(_0xc3b704){while(--_0xc3b704){_0x42c54f['push'](_0x42c54f['shift']());}};_0x4c5e40(++_0x40023a);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2aa48b,_0x5a4446){_0x2aa48b=_0x2aa48b-0x0;var _0x48caf8=_0x0b0e[_0x2aa48b];return _0x48caf8;};'use strict';var Manager=require(_0xe0b0('0x0'));var BPromise=require('bluebird');var moment=require(_0xe0b0('0x1'));var util=require('util');var _=require(_0xe0b0('0x2'));var logger=require(_0xe0b0('0x3'))(_0xe0b0('0x4'));var config=require(_0xe0b0('0x5'));var ami=new Manager(config[_0xe0b0('0x6')][_0xe0b0('0x7')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')][_0xe0b0('0x9')],!![]);ami['keepConnected']();ami['Action']=BPromise[_0xe0b0('0xa')](ami[_0xe0b0('0xb')]);function error(_0xc4a085){logger[_0xe0b0('0xc')](util['format'](_0xe0b0('0xd'),config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')]['port'],util[_0xe0b0('0xe')](_0xc4a085,![],null)));}function close(){logger[_0xe0b0('0xc')](util[_0xe0b0('0xf')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x11')});};};ami[_0xe0b0('0x12')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'sippeerstatus'});};};ami[_0xe0b0('0x14')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'queuesummary'});};};ami[_0xe0b0('0x15')]=function(){return function(){return ami['Action']({'action':_0xe0b0('0x16')});};};function connect(_0x100204){logger['info'](util['format'](_0xe0b0('0x17'),config['asterisk']['username'],config['asterisk']['ip'],config[_0xe0b0('0x6')]['port']));ami['once'](_0xe0b0('0xc'),error);ami['once'](_0xe0b0('0x18'),close);}ami['on']('connect',connect);ami['on'](_0xe0b0('0x19'),function(_0x1cd7c4){logger[_0xe0b0('0x1a')](util[_0xe0b0('0xf')](_0xe0b0('0x1b'),config['asterisk']['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')],util[_0xe0b0('0xe')](_0x1cd7c4,![],null)));});ami['on']('fullybooted',function(_0x170ad8){logger['info'](util[_0xe0b0('0xf')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')]));return BPromise['resolve']()[_0xe0b0('0x1c')](ami['actionSipShowRegistry']())[_0xe0b0('0x1c')](ami[_0xe0b0('0x12')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x1d')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x14')]())['then'](ami[_0xe0b0('0x15')]())[_0xe0b0('0x1e')](function(_0x5b7a64){logger[_0xe0b0('0xc')](_0xe0b0('0x1f'),util[_0xe0b0('0xe')](_0x5b7a64,{'showHidden':![],'depth':null}));});});ami[_0xe0b0('0x20')](_0xe0b0('0xc'),error);ami[_0xe0b0('0x20')](_0xe0b0('0x18'),close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 7c6f75f..80b3ab6 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(_0x4d9d54,_0x1b9bcf){var _0x489b1b=function(_0x50bf0c){while(--_0x50bf0c){_0x4d9d54['push'](_0x4d9d54['shift']());}};_0x489b1b(++_0x1b9bcf);}(_0xb43b,0x1b2));var _0xbb43=function(_0x9c893e,_0x2603b6){_0x9c893e=_0x9c893e-0x0;var _0x411288=_0xb43b[_0x9c893e];return _0x411288;};'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 _0x9c44=['ami','client','http','Request','then','debug','rpc','memberReport','error','message','result','exports','../../config/logger'];(function(_0x342af3,_0x25396f){var _0x4ac2b8=function(_0x58a3ad){while(--_0x58a3ad){_0x342af3['push'](_0x342af3['shift']());}};_0x4ac2b8(++_0x25396f);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var client=jayson[_0x49c4('0x2')][_0x49c4('0x3')]({'port':0x2329});client[_0x49c4('0x4')]=function(_0x2ad237,_0x4e0313){return new BPromise(function(_0x4941f1,_0x41a183){return client['request'](_0x2ad237,_0x4e0313)[_0x49c4('0x5')](function(_0x6030ae){logger[_0x49c4('0x6')](_0x49c4('0x7'),_0x49c4('0x8'),_0x2ad237,_0x4e0313,_0x6030ae);if(_0x6030ae['error']){logger[_0x49c4('0x9')](_0x49c4('0x7'),_0x49c4('0x8'),_0x2ad237,_0x6030ae[_0x49c4('0x9')]['message'],_0x4e0313);return _0x41a183(_0x6030ae['error'][_0x49c4('0xa')]);}else{return _0x4941f1(_0x6030ae[_0x49c4('0xb')]);}})['catch'](function(_0xb611a1){logger[_0x49c4('0x9')]('rpc','memberReport',_0x2ad237,_0xb611a1,_0x4e0313);return _0x41a183(_0xb611a1);});});};module[_0x49c4('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index e39179a..a39c5f6 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 _0xd1b7=['firstName','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','dialCutDigit','substring','prototype','getQueue','exports','util','isNil','string','voiceQueue','uniqueid','Contact'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0xd1b7,0x1b2));var _0x7d1b=function(_0x1c3a2c,_0x38e370){_0x1c3a2c=_0x1c3a2c-0x0;var _0x3b38bb=_0xd1b7[_0x1c3a2c];return _0x3b38bb;};'use strict';var util=require(_0x7d1b('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x1b69c6,_0xda8bd0,_0x561892){var _0x715887='';if(!_[_0x7d1b('0x1')](_0xda8bd0)&&_0x7d1b('0x2')===typeof _0xda8bd0){_0x715887+=_0xda8bd0;}if(!_[_0x7d1b('0x1')](_0x561892)&&'string'===typeof _0x561892){_0x715887+='\x20'+_0x561892;}if(_0x715887!==''){return _0x715887;}return _0x1b69c6;}function Action(_0xfc5ea9,_0x4064a6,_0xcca76d){this[_0x7d1b('0x3')]=_0xfc5ea9;this[_0x7d1b('0x4')]=_0xcca76d||undefined;this['name']=checkNameSurname(_0x4064a6[_0x7d1b('0x5')]['phone'],_0x4064a6[_0x7d1b('0x5')][_0x7d1b('0x6')],_0x4064a6['Contact']['lastName']);this[_0x7d1b('0x7')]=_0x4064a6[_0x7d1b('0x5')][_0x7d1b('0x8')];this[_0x7d1b('0x9')]=_0xfc5ea9['name'];this[_0x7d1b('0xa')]=_0x4064a6[_0x7d1b('0xa')]||![];this[_0x7d1b('0xb')]=_0xfc5ea9[_0x7d1b('0xb')];this[_0x7d1b('0xc')]=_0xfc5ea9[_0x7d1b('0xc')]||0x3;this['scheduledat']=_0x4064a6[_0x7d1b('0xd')];this[_0x7d1b('0xe')]=_0x4064a6[_0x7d1b('0xe')];this[_0x7d1b('0xf')]=_0x4064a6[_0x7d1b('0xf')];this[_0x7d1b('0x10')]=_0x4064a6[_0x7d1b('0x10')];this[_0x7d1b('0x11')]=_0x4064a6['countnosuchnumberretry'];this['countdropretry']=_0x4064a6[_0x7d1b('0x12')];this[_0x7d1b('0x13')]=_0x4064a6[_0x7d1b('0x13')];this['countmachineretry']=_0x4064a6[_0x7d1b('0x14')];this[_0x7d1b('0x15')]=_0x4064a6[_0x7d1b('0x15')];this[_0x7d1b('0x16')]=_0x4064a6[_0x7d1b('0x16')];this[_0x7d1b('0x17')]=_0x4064a6[_0x7d1b('0x17')];this['UserId']=_0x4064a6[_0x7d1b('0x18')];this[_0x7d1b('0x19')]=_0x4064a6[_0x7d1b('0x19')];this[_0x7d1b('0x1a')]=_0x4064a6[_0x7d1b('0x1a')];this['idHopper']=_0x4064a6['id'];this[_0x7d1b('0x1b')]=_0x4064a6[_0x7d1b('0x5')]['firstName']||'';this[_0x7d1b('0x1c')]=moment()['format'](_0x7d1b('0x1d'));this['callback']=_0x4064a6['callback'];this['callbackuniqueid']=_0x4064a6['callbackuniqueid'];this['callbackat']=_0x4064a6[_0x7d1b('0x1e')];this[_0x7d1b('0x1f')]=_0x4064a6[_0x7d1b('0x1f')];this[_0x7d1b('0x20')]='';this[_0x7d1b('0x21')]='';}Action['prototype'][_0x7d1b('0x22')]=function(){return util['format']('\x22%s\x22\x20<%s>',this['name'],this['voiceQueue'][_0x7d1b('0x23')]>0x0?this['number'][_0x7d1b('0x24')](this[_0x7d1b('0x3')][_0x7d1b('0x23')]):this['number']);};Action[_0x7d1b('0x25')][_0x7d1b('0x26')]=function(){return this[_0x7d1b('0x9')];};module[_0x7d1b('0x27')]=Action; \ No newline at end of file +var _0xaa0e=['idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','phone','Contact','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x3d1397,_0x57b729){var _0x5a5015=function(_0x301802){while(--_0x301802){_0x3d1397['push'](_0x3d1397['shift']());}};_0x5a5015(++_0x57b729);}(_0xaa0e,0x66));var _0xeaa0=function(_0x55daf2,_0x1b48de){_0x55daf2=_0x55daf2-0x0;var _0x1c8500=_0xaa0e[_0x55daf2];return _0x1c8500;};'use strict';var util=require(_0xeaa0('0x0'));var _=require(_0xeaa0('0x1'));var moment=require(_0xeaa0('0x2'));function checkNameSurname(_0x156369,_0x379b6c,_0x207cb9){var _0x2bbb28='';if(!_[_0xeaa0('0x3')](_0x379b6c)&&_0xeaa0('0x4')===typeof _0x379b6c){_0x2bbb28+=_0x379b6c;}if(!_[_0xeaa0('0x3')](_0x207cb9)&&'string'===typeof _0x207cb9){_0x2bbb28+='\x20'+_0x207cb9;}if(_0x2bbb28!==''){return _0x2bbb28;}return _0x156369;}function Action(_0x4d058f,_0x48d8ec,_0x2a1f97){this[_0xeaa0('0x5')]=_0x4d058f;this[_0xeaa0('0x6')]=_0x2a1f97||undefined;this[_0xeaa0('0x7')]=checkNameSurname(_0x48d8ec['Contact'][_0xeaa0('0x8')],_0x48d8ec['Contact']['firstName'],_0x48d8ec[_0xeaa0('0x9')][_0xeaa0('0xa')]);this[_0xeaa0('0xb')]=_0x48d8ec[_0xeaa0('0x9')][_0xeaa0('0x8')];this[_0xeaa0('0xc')]=_0x4d058f[_0xeaa0('0x7')];this[_0xeaa0('0xd')]=_0x48d8ec[_0xeaa0('0xd')]||![];this['type']=_0x4d058f[_0xeaa0('0xe')];this['dialQueueTimeout']=_0x4d058f[_0xeaa0('0xf')]||0x3;this[_0xeaa0('0x10')]=_0x48d8ec[_0xeaa0('0x10')];this['countbusyretry']=_0x48d8ec[_0xeaa0('0x11')];this['countcongestionretry']=_0x48d8ec[_0xeaa0('0x12')];this['countnoanswerretry']=_0x48d8ec[_0xeaa0('0x13')];this[_0xeaa0('0x14')]=_0x48d8ec[_0xeaa0('0x14')];this[_0xeaa0('0x15')]=_0x48d8ec[_0xeaa0('0x15')];this[_0xeaa0('0x16')]=_0x48d8ec[_0xeaa0('0x16')];this[_0xeaa0('0x17')]=_0x48d8ec[_0xeaa0('0x17')];this['countagentrejectretry']=_0x48d8ec[_0xeaa0('0x18')];this[_0xeaa0('0x19')]=_0x48d8ec[_0xeaa0('0x19')];this[_0xeaa0('0x1a')]=_0x48d8ec[_0xeaa0('0x1a')];this[_0xeaa0('0x1b')]=_0x48d8ec['UserId'];this[_0xeaa0('0x1c')]=_0x48d8ec[_0xeaa0('0x1c')];this[_0xeaa0('0x1d')]=_0x48d8ec[_0xeaa0('0x1d')];this[_0xeaa0('0x1e')]=_0x48d8ec['id'];this['ContactFirstName']=_0x48d8ec['Contact']['firstName']||'';this[_0xeaa0('0x1f')]=moment()[_0xeaa0('0x20')](_0xeaa0('0x21'));this['callback']=_0x48d8ec[_0xeaa0('0x22')];this[_0xeaa0('0x23')]=_0x48d8ec[_0xeaa0('0x23')];this[_0xeaa0('0x24')]=_0x48d8ec[_0xeaa0('0x24')];this['recallme']=_0x48d8ec['recallme'];this[_0xeaa0('0x25')]='';this[_0xeaa0('0x26')]='';}Action[_0xeaa0('0x27')][_0xeaa0('0x28')]=function(){return util['format'](_0xeaa0('0x29'),this['name'],this[_0xeaa0('0x5')][_0xeaa0('0x2a')]>0x0?this['number'][_0xeaa0('0x2b')](this[_0xeaa0('0x5')]['dialCutDigit']):this[_0xeaa0('0xb')]);};Action[_0xeaa0('0x27')]['getQueue']=function(){return this[_0xeaa0('0xc')];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index d5b0e12..b3b82c5 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 _0x3d72=['state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','seconds'];(function(_0x28ef69,_0x423790){var _0x58b5c1=function(_0x5283ae){while(--_0x5283ae){_0x28ef69['push'](_0x28ef69['shift']());}};_0x58b5c1(++_0x423790);}(_0x3d72,0x82));var _0x23d7=function(_0x1801c8,_0x23b2e1){_0x1801c8=_0x1801c8-0x0;var _0x2336f2=_0x3d72[_0x1801c8];return _0x2336f2;};'use strict';var util=require(_0x23d7('0x0'));var _=require('lodash');var moment=require(_0x23d7('0x1'));function getSeconds(_0x5014ed,_0x3e53fa){var _0x15a113=moment(_0x5014ed)[_0x23d7('0x2')](0x0);var _0x34492d=moment(_0x3e53fa)[_0x23d7('0x2')](0x0);return _0x15a113[_0x23d7('0x3')](_0x34492d,_0x23d7('0x4'));}function AgentComplete(_0x5ad864,_0x37c6bd){this[_0x23d7('0x5')]=0x4;this[_0x23d7('0x6')]='Answer';this[_0x23d7('0x7')]=_0x5ad864[_0x23d7('0x7')];this['type']=_0x5ad864[_0x23d7('0x8')];this[_0x23d7('0x9')]=_0x5ad864[_0x23d7('0x8')]===_0x23d7('0xa')?_0x23d7('0xb'):_0x5ad864[_0x23d7('0x8')];this['countbusyretry']=_0x5ad864[_0x23d7('0xc')];this['countcongestionretry']=_0x5ad864[_0x23d7('0xd')];this[_0x23d7('0xe')]=_0x5ad864[_0x23d7('0xe')];this[_0x23d7('0xf')]=_0x5ad864[_0x23d7('0xc')]+_0x5ad864[_0x23d7('0xd')]+_0x5ad864[_0x23d7('0xe')]+_0x5ad864[_0x23d7('0x10')]+_0x5ad864[_0x23d7('0x11')]+_0x5ad864[_0x23d7('0x12')]+_0x5ad864[_0x23d7('0x13')]+_0x5ad864[_0x23d7('0x14')];this[_0x23d7('0x10')]=_0x5ad864[_0x23d7('0x10')];this[_0x23d7('0x11')]=_0x5ad864[_0x23d7('0x11')];this['countabandonedretry']=_0x5ad864[_0x23d7('0x12')];this[_0x23d7('0x13')]=_0x5ad864['countmachineretry'];this[_0x23d7('0x14')]=_0x5ad864['countagentrejectretry'];this[_0x23d7('0x15')]=_0x37c6bd[_0x23d7('0x15')];this[_0x23d7('0x16')]=_0x5ad864[_0x23d7('0x17')];this[_0x23d7('0x18')]=_0x5ad864[_0x23d7('0x19')];this[_0x23d7('0x1a')]=_0x5ad864['starttime'];this['responsetime']=_0x5ad864[_0x23d7('0x1b')];this[_0x23d7('0x1c')]=_0x5ad864[_0x23d7('0x1c')];this['endtime']=moment()['format'](_0x23d7('0x1d'));this[_0x23d7('0x1e')]=getSeconds(_0x5ad864[_0x23d7('0x1b')],_0x5ad864[_0x23d7('0x1a')]);this[_0x23d7('0x1f')]=getSeconds(_0x5ad864[_0x23d7('0x1c')],_0x5ad864[_0x23d7('0x1b')]);this['talktime']=getSeconds(this[_0x23d7('0x20')],_0x5ad864[_0x23d7('0x1c')]);this['queue']=_0x37c6bd[_0x23d7('0xb')];this[_0x23d7('0x21')]=_0x37c6bd['membername'];this[_0x23d7('0x22')]=_0x37c6bd['reason'];this[_0x23d7('0x23')]=_0x5ad864['callback'];this[_0x23d7('0x24')]=_0x5ad864[_0x23d7('0x24')];this[_0x23d7('0x25')]=_0x5ad864[_0x23d7('0x25')];this[_0x23d7('0x26')]=_0x5ad864['recallme'];this[_0x23d7('0x27')]=_0x5ad864[_0x23d7('0x27')];this[_0x23d7('0x28')]=_0x5ad864['ListId'];this[_0x23d7('0x29')]=_0x5ad864[_0x23d7('0x29')];this['VoiceQueueId']=_0x5ad864['VoiceQueueId'];this[_0x23d7('0x2a')]=_0x5ad864[_0x23d7('0x2a')];this[_0x23d7('0x2b')]=_0x5ad864[_0x23d7('0x2b')]||'';this[_0x23d7('0x2c')]=_0x5ad864['originatecalleridname']||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0xd487=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','name','number','starttime','responsetime','answertime','format','ringtime','holdtime','talktime','endtime','membername','reason','callback'];(function(_0x505895,_0x1cc8e6){var _0xb85fe7=function(_0xa301fe){while(--_0xa301fe){_0x505895['push'](_0x505895['shift']());}};_0xb85fe7(++_0x1cc8e6);}(_0xd487,0xec));var _0x7d48=function(_0x4f1af9,_0xc95c63){_0x4f1af9=_0x4f1af9-0x0;var _0x11a60e=_0xd487[_0x4f1af9];return _0x11a60e;};'use strict';var util=require(_0x7d48('0x0'));var _=require(_0x7d48('0x1'));var moment=require(_0x7d48('0x2'));function getSeconds(_0x512944,_0x4ca873){var _0x1a96d4=moment(_0x512944)['milliseconds'](0x0);var _0x2c6b36=moment(_0x4ca873)[_0x7d48('0x3')](0x0);return _0x1a96d4[_0x7d48('0x4')](_0x2c6b36,_0x7d48('0x5'));}function AgentComplete(_0x1cc003,_0x55e90d){this[_0x7d48('0x6')]=0x4;this[_0x7d48('0x7')]='Answer';this['scheduledat']=_0x1cc003[_0x7d48('0x8')];this[_0x7d48('0x9')]=_0x1cc003[_0x7d48('0x9')];this[_0x7d48('0xa')]=_0x1cc003['type']==='outbound'?_0x7d48('0xb'):_0x1cc003[_0x7d48('0x9')];this[_0x7d48('0xc')]=_0x1cc003[_0x7d48('0xc')];this[_0x7d48('0xd')]=_0x1cc003['countcongestionretry'];this[_0x7d48('0xe')]=_0x1cc003[_0x7d48('0xe')];this['countglobal']=_0x1cc003['countbusyretry']+_0x1cc003['countcongestionretry']+_0x1cc003['countnoanswerretry']+_0x1cc003[_0x7d48('0xf')]+_0x1cc003[_0x7d48('0x10')]+_0x1cc003['countabandonedretry']+_0x1cc003[_0x7d48('0x11')]+_0x1cc003[_0x7d48('0x12')];this[_0x7d48('0xf')]=_0x1cc003['countnosuchnumberretry'];this['countdropretry']=_0x1cc003[_0x7d48('0x10')];this[_0x7d48('0x13')]=_0x1cc003['countabandonedretry'];this[_0x7d48('0x11')]=_0x1cc003[_0x7d48('0x11')];this[_0x7d48('0x12')]=_0x1cc003[_0x7d48('0x12')];this[_0x7d48('0x14')]=_0x55e90d[_0x7d48('0x14')];this['calleridname']=_0x1cc003[_0x7d48('0x15')];this['calleridnum']=_0x1cc003[_0x7d48('0x16')];this[_0x7d48('0x17')]=_0x1cc003[_0x7d48('0x17')];this[_0x7d48('0x18')]=_0x1cc003[_0x7d48('0x18')];this['answertime']=_0x1cc003[_0x7d48('0x19')];this['endtime']=moment()[_0x7d48('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7d48('0x1b')]=getSeconds(_0x1cc003['responsetime'],_0x1cc003['starttime']);this[_0x7d48('0x1c')]=getSeconds(_0x1cc003[_0x7d48('0x19')],_0x1cc003[_0x7d48('0x18')]);this[_0x7d48('0x1d')]=getSeconds(this[_0x7d48('0x1e')],_0x1cc003[_0x7d48('0x19')]);this[_0x7d48('0xb')]=_0x55e90d[_0x7d48('0xb')];this['membername']=_0x55e90d[_0x7d48('0x1f')];this[_0x7d48('0x20')]=_0x55e90d[_0x7d48('0x20')];this[_0x7d48('0x21')]=_0x1cc003['callback'];this[_0x7d48('0x22')]=_0x1cc003[_0x7d48('0x22')];this['callbackat']=_0x1cc003[_0x7d48('0x23')];this['recallme']=_0x1cc003[_0x7d48('0x24')];this[_0x7d48('0x25')]=_0x1cc003['ContactId'];this[_0x7d48('0x26')]=_0x1cc003[_0x7d48('0x26')];this[_0x7d48('0x27')]=_0x1cc003['UserId'];this[_0x7d48('0x28')]=_0x1cc003[_0x7d48('0x28')];this[_0x7d48('0x29')]=_0x1cc003['CampaignId'];this[_0x7d48('0x2a')]=_0x1cc003[_0x7d48('0x2a')]||'';this[_0x7d48('0x2b')]=_0x1cc003[_0x7d48('0x2b')]||'';}module[_0x7d48('0x2c')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 7b6420a..8f822df 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 _0xabce=['calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname'];(function(_0x138270,_0x632ed4){var _0x5c769f=function(_0x49956b){while(--_0x49956b){_0x138270['push'](_0x138270['shift']());}};_0x5c769f(++_0x632ed4);}(_0xabce,0x103));var _0xeabc=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xabce[_0xbe200f];return _0x192597;};'use strict';var util=require(_0xeabc('0x0'));var _=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));function getSeconds(_0x572221,_0x49dbcc){var _0x5bd1a4=moment(_0x572221)['milliseconds'](0x0);var _0x2e01eb=moment(_0x49dbcc)[_0xeabc('0x3')](0x0);return _0x5bd1a4[_0xeabc('0x4')](_0x2e01eb,'seconds');}function Final(_0x54e4a8){this[_0xeabc('0x5')]=_0x54e4a8['uniqueid'];this[_0xeabc('0x6')]=_0x54e4a8['scheduledat'];this[_0xeabc('0x7')]=_0x54e4a8[_0xeabc('0x7')];this[_0xeabc('0x8')]=_0x54e4a8['type']===_0xeabc('0x9')?_0xeabc('0xa'):_0x54e4a8[_0xeabc('0x7')];this[_0xeabc('0xb')]=_0x54e4a8[_0xeabc('0xb')];this[_0xeabc('0xc')]=_0x54e4a8[_0xeabc('0xc')];this[_0xeabc('0xd')]=_0x54e4a8[_0xeabc('0xd')];this[_0xeabc('0xe')]=_0x54e4a8[_0xeabc('0xb')]+_0x54e4a8[_0xeabc('0xc')]+_0x54e4a8[_0xeabc('0xd')]+_0x54e4a8[_0xeabc('0xf')]+_0x54e4a8[_0xeabc('0x10')]+_0x54e4a8[_0xeabc('0x11')]+_0x54e4a8['countmachineretry']+_0x54e4a8[_0xeabc('0x12')];this[_0xeabc('0xf')]=_0x54e4a8[_0xeabc('0xf')];this['countdropretry']=_0x54e4a8['countdropretry'];this[_0xeabc('0x11')]=_0x54e4a8[_0xeabc('0x11')];this[_0xeabc('0x13')]=_0x54e4a8['countmachineretry'];this[_0xeabc('0x12')]=_0x54e4a8[_0xeabc('0x12')];this['queue']=_0x54e4a8['queue'];this[_0xeabc('0x14')]=_0x54e4a8['calleridname'];this[_0xeabc('0x15')]=_0x54e4a8[_0xeabc('0x15')];this[_0xeabc('0x16')]=_0x54e4a8[_0xeabc('0x16')];this[_0xeabc('0x17')]=_0x54e4a8[_0xeabc('0x17')];this[_0xeabc('0x18')]=_0x54e4a8[_0xeabc('0x17')];this['ringtime']=_0x54e4a8[_0xeabc('0x19')]||0x0;this['holdtime']=_0x54e4a8[_0xeabc('0x1a')]||0x0;this[_0xeabc('0x1b')]=_0x54e4a8['talktime']||0x0;this[_0xeabc('0x1c')]=_0x54e4a8[_0xeabc('0x1c')];this[_0xeabc('0x1d')]=_0x54e4a8[_0xeabc('0x1d')];this[_0xeabc('0x1e')]=_0x54e4a8['callbackat'];this[_0xeabc('0x1f')]=_0x54e4a8[_0xeabc('0x1f')];this[_0xeabc('0x20')]=_0x54e4a8['ContactId'];this[_0xeabc('0x21')]=_0x54e4a8[_0xeabc('0x21')];this[_0xeabc('0x22')]=_0x54e4a8[_0xeabc('0x22')];this['VoiceQueueId']=_0x54e4a8[_0xeabc('0x23')];this['CampaignId']=_0x54e4a8[_0xeabc('0x24')];this['originatecalleridnum']=_0x54e4a8[_0xeabc('0x25')]||'';this[_0xeabc('0x26')]=_0x54e4a8[_0xeabc('0x26')]||'';}module[_0xeabc('0x27')]=Final; \ No newline at end of file +var _0x5178=['queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry'];(function(_0x47a40b,_0x443ecf){var _0x19610c=function(_0x4b8ce1){while(--_0x4b8ce1){_0x47a40b['push'](_0x47a40b['shift']());}};_0x19610c(++_0x443ecf);}(_0x5178,0x171));var _0x8517=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x5178[_0x1ac595];return _0x455fff;};'use strict';var util=require('util');var _=require(_0x8517('0x0'));var moment=require(_0x8517('0x1'));function getSeconds(_0x27662b,_0x2dc28f){var _0x38d5b3=moment(_0x27662b)['milliseconds'](0x0);var _0x483381=moment(_0x2dc28f)[_0x8517('0x2')](0x0);return _0x38d5b3[_0x8517('0x3')](_0x483381,'seconds');}function Final(_0xd4b0){this['uniqueid']=_0xd4b0[_0x8517('0x4')];this[_0x8517('0x5')]=_0xd4b0[_0x8517('0x5')];this[_0x8517('0x6')]=_0xd4b0[_0x8517('0x6')];this['campaigntype']=_0xd4b0[_0x8517('0x6')]==='outbound'?'queue':_0xd4b0[_0x8517('0x6')];this[_0x8517('0x7')]=_0xd4b0['countbusyretry'];this[_0x8517('0x8')]=_0xd4b0[_0x8517('0x8')];this[_0x8517('0x9')]=_0xd4b0[_0x8517('0x9')];this[_0x8517('0xa')]=_0xd4b0[_0x8517('0x7')]+_0xd4b0[_0x8517('0x8')]+_0xd4b0[_0x8517('0x9')]+_0xd4b0['countnosuchnumberretry']+_0xd4b0[_0x8517('0xb')]+_0xd4b0[_0x8517('0xc')]+_0xd4b0[_0x8517('0xd')]+_0xd4b0[_0x8517('0xe')];this[_0x8517('0xf')]=_0xd4b0['countnosuchnumberretry'];this[_0x8517('0xb')]=_0xd4b0[_0x8517('0xb')];this[_0x8517('0xc')]=_0xd4b0[_0x8517('0xc')];this[_0x8517('0xd')]=_0xd4b0[_0x8517('0xd')];this[_0x8517('0xe')]=_0xd4b0[_0x8517('0xe')];this[_0x8517('0x10')]=_0xd4b0[_0x8517('0x10')];this[_0x8517('0x11')]=_0xd4b0[_0x8517('0x11')];this['calleridnum']=_0xd4b0[_0x8517('0x12')];this[_0x8517('0x13')]=_0xd4b0[_0x8517('0x13')];this[_0x8517('0x14')]=_0xd4b0[_0x8517('0x14')];this[_0x8517('0x15')]=_0xd4b0[_0x8517('0x14')];this['ringtime']=_0xd4b0[_0x8517('0x16')]||0x0;this['holdtime']=_0xd4b0['holdtime']||0x0;this[_0x8517('0x17')]=_0xd4b0[_0x8517('0x17')]||0x0;this[_0x8517('0x18')]=_0xd4b0[_0x8517('0x18')];this[_0x8517('0x19')]=_0xd4b0[_0x8517('0x19')];this['callbackat']=_0xd4b0['callbackat'];this[_0x8517('0x1a')]=_0xd4b0[_0x8517('0x1a')];this[_0x8517('0x1b')]=_0xd4b0[_0x8517('0x1b')];this[_0x8517('0x1c')]=_0xd4b0[_0x8517('0x1c')];this['UserId']=_0xd4b0[_0x8517('0x1d')];this[_0x8517('0x1e')]=_0xd4b0['VoiceQueueId'];this[_0x8517('0x1f')]=_0xd4b0[_0x8517('0x1f')];this[_0x8517('0x20')]=_0xd4b0['originatecalleridnum']||'';this[_0x8517('0x21')]=_0xd4b0['originatecalleridname']||'';}module[_0x8517('0x22')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 3cfa7b8..025f154 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 _0xf6cb=['uniqueid','calleridnum','number','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','responsetime','membername','IVR','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','util','lodash','moment','diff','seconds','state','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x113c43,_0x171537){var _0x25a1ac=function(_0x5544b2){while(--_0x5544b2){_0x113c43['push'](_0x113c43['shift']());}};_0x25a1ac(++_0x171537);}(_0xf6cb,0x105));var _0xbf6c=function(_0x23e4aa,_0x554490){_0x23e4aa=_0x23e4aa-0x0;var _0x5becfe=_0xf6cb[_0x23e4aa];return _0x5becfe;};'use strict';var util=require(_0xbf6c('0x0'));var _=require(_0xbf6c('0x1'));var moment=require(_0xbf6c('0x2'));function getSeconds(_0x4a06ff,_0x460bdc){var _0x3af5b6=moment(_0x4a06ff)['milliseconds'](0x0);var _0x788b8=moment(_0x460bdc)['milliseconds'](0x0);return _0x3af5b6[_0xbf6c('0x3')](_0x788b8,_0xbf6c('0x4'));}function Hangup(_0x474834,_0x21a77c){this[_0xbf6c('0x5')]=0x4;this['statedesc']='Answer';this[_0xbf6c('0x6')]=_0x474834[_0xbf6c('0x6')];this[_0xbf6c('0x7')]=_0x474834[_0xbf6c('0x7')];this[_0xbf6c('0x8')]=_0x474834[_0xbf6c('0x7')]===_0xbf6c('0x9')?_0xbf6c('0xa'):_0x474834['type'];this[_0xbf6c('0xb')]=_0x474834[_0xbf6c('0xb')];this[_0xbf6c('0xc')]=_0x474834[_0xbf6c('0xc')];this['countnoanswerretry']=_0x474834[_0xbf6c('0xd')];this[_0xbf6c('0xe')]=_0x474834[_0xbf6c('0xb')]+_0x474834['countcongestionretry']+_0x474834[_0xbf6c('0xd')]+_0x474834['countnosuchnumberretry']+_0x474834[_0xbf6c('0xf')]+_0x474834[_0xbf6c('0x10')]+_0x474834[_0xbf6c('0x11')]+_0x474834[_0xbf6c('0x12')];this['countnosuchnumberretry']=_0x474834['countnosuchnumberretry'];this[_0xbf6c('0xf')]=_0x474834['countdropretry'];this[_0xbf6c('0x10')]=_0x474834['countabandonedretry'];this[_0xbf6c('0x11')]=_0x474834[_0xbf6c('0x11')];this[_0xbf6c('0x12')]=_0x474834[_0xbf6c('0x12')];this[_0xbf6c('0x13')]=_0x21a77c['uniqueid'];this['calleridname']=_0x474834['name'];this[_0xbf6c('0x14')]=_0x474834[_0xbf6c('0x15')];this[_0xbf6c('0x16')]=_0x474834[_0xbf6c('0x16')];this['responsetime']=_0x474834['responsetime'];this[_0xbf6c('0x17')]=moment()[_0xbf6c('0x18')](_0xbf6c('0x19'));this[_0xbf6c('0x1a')]=getSeconds(_0x474834['responsetime'],_0x474834[_0xbf6c('0x16')]);this[_0xbf6c('0x1b')]=0x0;this[_0xbf6c('0x1c')]=getSeconds(this[_0xbf6c('0x17')],_0x474834[_0xbf6c('0x1d')]);this[_0xbf6c('0xa')]=_0x474834[_0xbf6c('0xa')];this[_0xbf6c('0x1e')]=_0xbf6c('0x1f');this['reason']=_0x21a77c['cause-txt'];this[_0xbf6c('0x20')]=_0x474834[_0xbf6c('0x20')];this['callbackuniqueid']=_0x474834[_0xbf6c('0x21')];this['callbackat']=_0x474834[_0xbf6c('0x22')];this[_0xbf6c('0x23')]=_0x474834['recallme'];this['ContactId']=_0x474834[_0xbf6c('0x24')];this['ListId']=_0x474834['ListId'];this[_0xbf6c('0x25')]=_0x474834[_0xbf6c('0x25')];this[_0xbf6c('0x26')]=_0x474834[_0xbf6c('0x26')];this[_0xbf6c('0x27')]=_0x474834['CampaignId'];}module['exports']=Hangup; \ No newline at end of file +var _0x096d=['countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','endtime','format','ringtime','holdtime','talktime','queue','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','state','statedesc','scheduledat','type','campaigntype','outbound','countbusyretry'];(function(_0x12e1a4,_0x381f75){var _0x185c62=function(_0x149b96){while(--_0x149b96){_0x12e1a4['push'](_0x12e1a4['shift']());}};_0x185c62(++_0x381f75);}(_0x096d,0x191));var _0xd096=function(_0xc465f5,_0xa9c358){_0xc465f5=_0xc465f5-0x0;var _0x3dd839=_0x096d[_0xc465f5];return _0x3dd839;};'use strict';var util=require(_0xd096('0x0'));var _=require(_0xd096('0x1'));var moment=require('moment');function getSeconds(_0x57379d,_0x580518){var _0x42432e=moment(_0x57379d)['milliseconds'](0x0);var _0x69b36b=moment(_0x580518)['milliseconds'](0x0);return _0x42432e['diff'](_0x69b36b,'seconds');}function Hangup(_0x3d8244,_0x23e1cd){this[_0xd096('0x2')]=0x4;this[_0xd096('0x3')]='Answer';this[_0xd096('0x4')]=_0x3d8244[_0xd096('0x4')];this[_0xd096('0x5')]=_0x3d8244[_0xd096('0x5')];this[_0xd096('0x6')]=_0x3d8244[_0xd096('0x5')]===_0xd096('0x7')?'queue':_0x3d8244[_0xd096('0x5')];this[_0xd096('0x8')]=_0x3d8244['countbusyretry'];this['countcongestionretry']=_0x3d8244[_0xd096('0x9')];this[_0xd096('0xa')]=_0x3d8244['countnoanswerretry'];this['countglobal']=_0x3d8244[_0xd096('0x8')]+_0x3d8244['countcongestionretry']+_0x3d8244['countnoanswerretry']+_0x3d8244[_0xd096('0xb')]+_0x3d8244[_0xd096('0xc')]+_0x3d8244[_0xd096('0xd')]+_0x3d8244[_0xd096('0xe')]+_0x3d8244['countagentrejectretry'];this[_0xd096('0xb')]=_0x3d8244['countnosuchnumberretry'];this[_0xd096('0xc')]=_0x3d8244[_0xd096('0xc')];this[_0xd096('0xd')]=_0x3d8244[_0xd096('0xd')];this[_0xd096('0xe')]=_0x3d8244['countmachineretry'];this[_0xd096('0xf')]=_0x3d8244[_0xd096('0xf')];this[_0xd096('0x10')]=_0x23e1cd[_0xd096('0x10')];this[_0xd096('0x11')]=_0x3d8244[_0xd096('0x12')];this[_0xd096('0x13')]=_0x3d8244['number'];this['starttime']=_0x3d8244[_0xd096('0x14')];this[_0xd096('0x15')]=_0x3d8244[_0xd096('0x15')];this[_0xd096('0x16')]=moment()[_0xd096('0x17')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xd096('0x18')]=getSeconds(_0x3d8244[_0xd096('0x15')],_0x3d8244[_0xd096('0x14')]);this[_0xd096('0x19')]=0x0;this[_0xd096('0x1a')]=getSeconds(this[_0xd096('0x16')],_0x3d8244['responsetime']);this['queue']=_0x3d8244[_0xd096('0x1b')];this['membername']=_0xd096('0x1c');this[_0xd096('0x1d')]=_0x23e1cd[_0xd096('0x1e')];this[_0xd096('0x1f')]=_0x3d8244[_0xd096('0x1f')];this[_0xd096('0x20')]=_0x3d8244['callbackuniqueid'];this[_0xd096('0x21')]=_0x3d8244[_0xd096('0x21')];this[_0xd096('0x22')]=_0x3d8244['recallme'];this[_0xd096('0x23')]=_0x3d8244[_0xd096('0x23')];this[_0xd096('0x24')]=_0x3d8244[_0xd096('0x24')];this['UserId']=_0x3d8244[_0xd096('0x25')];this['VoiceQueueId']=_0x3d8244[_0xd096('0x26')];this[_0xd096('0x27')]=_0x3d8244[_0xd096('0x27')];}module[_0xd096('0x28')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 003afcd..dc66861 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 _0x709a=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x4f833c,_0x429d96){var _0x4f43e2=function(_0x11ea09){while(--_0x11ea09){_0x4f833c['push'](_0x4f833c['shift']());}};_0x4f43e2(++_0x429d96);}(_0x709a,0xd8));var _0xa709=function(_0x9e9623,_0x1e111d){_0x9e9623=_0x9e9623-0x0;var _0x4f9a86=_0x709a[_0x9e9623];return _0x4f9a86;};'use strict';var util=require(_0xa709('0x0'));var _=require(_0xa709('0x1'));var moment=require(_0xa709('0x2'));function getSeconds(_0xfa7beb,_0x5c5beb){var _0x32a06d=moment(_0xfa7beb)['milliseconds'](0x0);var _0x5806d=moment(_0x5c5beb)[_0xa709('0x3')](0x0);return _0x32a06d[_0xa709('0x4')](_0x5806d,_0xa709('0x5'));}function History(_0x39bbc8){this[_0xa709('0x6')]=_0x39bbc8[_0xa709('0x6')];this[_0xa709('0x7')]=_0x39bbc8[_0xa709('0x7')]||undefined;this['type']=_0x39bbc8[_0xa709('0x8')];this[_0xa709('0x9')]=_0x39bbc8[_0xa709('0x8')]===_0xa709('0xa')?_0xa709('0xb'):_0x39bbc8[_0xa709('0x8')];this[_0xa709('0xc')]=_0x39bbc8['countbusyretry'];this[_0xa709('0xd')]=_0x39bbc8[_0xa709('0xd')];this[_0xa709('0xe')]=_0x39bbc8[_0xa709('0xe')];this['countglobal']=_0x39bbc8[_0xa709('0xc')]+_0x39bbc8[_0xa709('0xd')]+_0x39bbc8[_0xa709('0xe')]+_0x39bbc8[_0xa709('0xf')]+_0x39bbc8[_0xa709('0x10')]+_0x39bbc8[_0xa709('0x11')]+_0x39bbc8[_0xa709('0x12')]+_0x39bbc8['countagentrejectretry'];this['countnosuchnumberretry']=_0x39bbc8[_0xa709('0xf')];this[_0xa709('0x10')]=_0x39bbc8[_0xa709('0x10')];this[_0xa709('0x11')]=_0x39bbc8[_0xa709('0x11')];this[_0xa709('0x12')]=_0x39bbc8[_0xa709('0x12')];this[_0xa709('0x13')]=_0x39bbc8[_0xa709('0x13')];this[_0xa709('0xb')]=_0x39bbc8['queue'];this[_0xa709('0x14')]=_0x39bbc8[_0xa709('0x15')];this[_0xa709('0x16')]=_0x39bbc8[_0xa709('0x17')];this[_0xa709('0x18')]=_0x39bbc8[_0xa709('0x18')];this[_0xa709('0x19')]=_0x39bbc8[_0xa709('0x19')];this[_0xa709('0x1a')]=_0x39bbc8['responsetime'];this[_0xa709('0x1b')]=getSeconds(_0x39bbc8['responsetime'],_0x39bbc8[_0xa709('0x18')]);this[_0xa709('0x1c')]=0x0;this[_0xa709('0x1d')]=0x0;this['callback']=_0x39bbc8[_0xa709('0x1e')];this['callbackuniqueid']=_0x39bbc8[_0xa709('0x1f')];this['callbackat']=_0x39bbc8[_0xa709('0x20')];this[_0xa709('0x21')]=_0x39bbc8[_0xa709('0x21')];this[_0xa709('0x22')]=_0x39bbc8[_0xa709('0x22')];this[_0xa709('0x23')]=_0x39bbc8[_0xa709('0x23')];this['UserId']=_0x39bbc8[_0xa709('0x24')];this[_0xa709('0x25')]=_0x39bbc8[_0xa709('0x25')];this[_0xa709('0x26')]=_0x39bbc8['CampaignId'];this['originatecalleridnum']=_0x39bbc8[_0xa709('0x27')]||'';this[_0xa709('0x28')]=_0x39bbc8[_0xa709('0x28')]||'';}module[_0xa709('0x29')]=History; \ No newline at end of file +var _0x42d5=['moment','milliseconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','number','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x42d5,0x1c5));var _0x542d=function(_0x53353c,_0x1dd8f3){_0x53353c=_0x53353c-0x0;var _0x232a1d=_0x42d5[_0x53353c];return _0x232a1d;};'use strict';var util=require(_0x542d('0x0'));var _=require(_0x542d('0x1'));var moment=require(_0x542d('0x2'));function getSeconds(_0x140ed9,_0x1f0cec){var _0x11dcc9=moment(_0x140ed9)[_0x542d('0x3')](0x0);var _0x534aeb=moment(_0x1f0cec)[_0x542d('0x3')](0x0);return _0x11dcc9['diff'](_0x534aeb,'seconds');}function History(_0x101720){this[_0x542d('0x4')]=_0x101720[_0x542d('0x4')];this[_0x542d('0x5')]=_0x101720['scheduledat']||undefined;this[_0x542d('0x6')]=_0x101720[_0x542d('0x6')];this['campaigntype']=_0x101720[_0x542d('0x6')]===_0x542d('0x7')?_0x542d('0x8'):_0x101720[_0x542d('0x6')];this[_0x542d('0x9')]=_0x101720['countbusyretry'];this[_0x542d('0xa')]=_0x101720[_0x542d('0xa')];this[_0x542d('0xb')]=_0x101720['countnoanswerretry'];this[_0x542d('0xc')]=_0x101720[_0x542d('0x9')]+_0x101720[_0x542d('0xa')]+_0x101720[_0x542d('0xb')]+_0x101720[_0x542d('0xd')]+_0x101720[_0x542d('0xe')]+_0x101720[_0x542d('0xf')]+_0x101720[_0x542d('0x10')]+_0x101720['countagentrejectretry'];this['countnosuchnumberretry']=_0x101720[_0x542d('0xd')];this[_0x542d('0xe')]=_0x101720[_0x542d('0xe')];this[_0x542d('0xf')]=_0x101720['countabandonedretry'];this[_0x542d('0x10')]=_0x101720[_0x542d('0x10')];this[_0x542d('0x11')]=_0x101720['countagentrejectretry'];this[_0x542d('0x8')]=_0x101720[_0x542d('0x8')];this['calleridname']=_0x101720['name'];this['calleridnum']=_0x101720[_0x542d('0x12')];this['starttime']=_0x101720[_0x542d('0x13')];this['responsetime']=_0x101720[_0x542d('0x14')];this['endtime']=_0x101720[_0x542d('0x14')];this[_0x542d('0x15')]=getSeconds(_0x101720[_0x542d('0x14')],_0x101720['starttime']);this[_0x542d('0x16')]=0x0;this[_0x542d('0x17')]=0x0;this['callback']=_0x101720[_0x542d('0x18')];this[_0x542d('0x19')]=_0x101720[_0x542d('0x19')];this[_0x542d('0x1a')]=_0x101720[_0x542d('0x1a')];this[_0x542d('0x1b')]=_0x101720[_0x542d('0x1b')];this['ContactId']=_0x101720['ContactId'];this[_0x542d('0x1c')]=_0x101720['ListId'];this['UserId']=_0x101720[_0x542d('0x1d')];this[_0x542d('0x1e')]=_0x101720[_0x542d('0x1e')];this[_0x542d('0x1f')]=_0x101720[_0x542d('0x1f')];this[_0x542d('0x20')]=_0x101720[_0x542d('0x20')]||'';this[_0x542d('0x21')]=_0x101720[_0x542d('0x21')]||'';}module[_0x542d('0x22')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 144b2f9..83cb642 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 _0xcde7=['SIP/%s','reachable','saveInDb','uniqueid','variable','ivr','dialAMDActive','value','HANGUP','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD]','MACHINE','countglobal','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','Machine','[syncAgentComplete][createHistory][0]','countabandonedretry','stateGlobal','dialMachineRetryFrequency','CampaignId','syncHangup','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','Unknow','[syncHangupIvr]','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','predictiveIntervalDroppedCallsCallersExit','Abandoned','dropreason','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','syncNewExten','syncQueueMember','actionid','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','Action','command','iftime\x20%s,%s','indexOf','true','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialer','getCaller','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-CAMPAIGNID','tags','createdAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originate][error]','getQueue','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','Congestion','custom:agentcongestion','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','reason\x2020\x20agentreject','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','erlangCalls','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','Predictive\x20after\x20first\x20interval','startMethodPredictive','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','abandonmentRate','agentBusyFactor','[CatchErlangB]','check\x20failure','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','checkContactBlack','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[getContactDialer2]','tryOriginatePredictive','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','Amax\x20=\x20','busyFactor','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','Umin\x20=\x20','exports','lodash','uuid','moment','md5','ioredis','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','defaults','redis','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','newexten','varset','syncVarSet','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','Interval','\x20INTERVAL_IS_NULL','Intervals','isEmpty','INTERVAL_IS_NULL','Error','milliseconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','diff','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','state','statedesc','endtime','starttime','clearZombieChannels','actions','[actions]','undefined','sequence','isNil','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','then','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','pick','ContactId','ListId','UserId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','Success','isTrunkReachable'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xcde7,0x146));var _0x7cde=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xcde7[_0x46e363];return _0x3fb059;};'use strict';var util=require('util');var _=require(_0x7cde('0x0'));var BPromise=require('bluebird');var uuid=require(_0x7cde('0x1'));var moment=require(_0x7cde('0x2'));var rr=require('rr');var md5=require(_0x7cde('0x3'));var Redis=require(_0x7cde('0x4'));var ut=require('../preview/util/util');var config=require(_0x7cde('0x5'));var logger=require(_0x7cde('0x6'))('dialer');var loggerBooked=require(_0x7cde('0x6'))(_0x7cde('0x7'));var loggerPredictive=require(_0x7cde('0x6'))(_0x7cde('0x8'));var loggerPredictiveCalls=require('../../../config/logger')(_0x7cde('0x9'));var loggerSyncQueueSummary=require(_0x7cde('0x6'))(_0x7cde('0xa'));var ami=require(_0x7cde('0xb'));config['redis']=_[_0x7cde('0xc')](config[_0x7cde('0xd')],{'host':_0x7cde('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7cde('0xd')]));var cmHopper=require(_0x7cde('0xf'));var cmHopperHistory=require(_0x7cde('0x10'));var cmHopperBlack=require(_0x7cde('0x11'));var voiceQueueRt=require(_0x7cde('0x12'));var Action=require(_0x7cde('0x13'));var History=require('./history');var Final=require(_0x7cde('0x14'));var AgentComplete=require(_0x7cde('0x15'));var QueueCallerAbandon=require(_0x7cde('0x16'));var Hangup=require(_0x7cde('0x17'));var ipAgi=process[_0x7cde('0x18')][_0x7cde('0x19')]||_0x7cde('0x1a');var strategy={'rrmemory':_0x7cde('0x1b'),'roundrobin':_0x7cde('0x1c')};var Sequence=function(){};Sequence[_0x7cde('0x1d')][_0x7cde('0x1e')]=function(_0x77a22b){this[_0x7cde('0x1f')]=this[_0x7cde('0x1f')]?this[_0x7cde('0x1f')][_0x7cde('0x20')](_0x77a22b):_0x77a22b();};function Dialer(_0x2057f8,_0x3e5a9f){this['sequence']=new Sequence();this[_0x7cde('0x21')]=_0x3e5a9f;this[_0x7cde('0x22')]=_0x2057f8[_0x7cde('0x22')];this[_0x7cde('0x23')]=_0x2057f8[_0x7cde('0x23')];this[_0x7cde('0x24')]=_0x2057f8[_0x7cde('0x24')];this[_0x7cde('0x25')]=_0x2057f8[_0x7cde('0x25')];this[_0x7cde('0x26')]=config[_0x7cde('0x26')]||0x2;this[_0x7cde('0x27')]={};this['actions']={};this[_0x7cde('0x28')]={};this[_0x7cde('0x29')]={};this[_0x7cde('0x2a')]={};this['startPredictive']={};this[_0x7cde('0x2b')]={};this[_0x7cde('0x2c')]={};this[_0x7cde('0x2d')]={};this[_0x7cde('0x2e')]={};ami['on'](_0x7cde('0x2f'),this['syncAgentConnect'][_0x7cde('0x30')](this));ami['on']('queuecallerabandon',this[_0x7cde('0x31')][_0x7cde('0x30')](this));ami['on'](_0x7cde('0x32'),this[_0x7cde('0x33')]['bind'](this));ami['on'](_0x7cde('0x34'),this[_0x7cde('0x35')]['bind'](this));ami['on'](_0x7cde('0x36'),this[_0x7cde('0xa')][_0x7cde('0x30')](this));ami['on']('hangup',this['syncHangup'][_0x7cde('0x30')](this));ami['on'](_0x7cde('0x37'),this['syncNewExten'][_0x7cde('0x30')](this));ami['on'](_0x7cde('0x38'),this[_0x7cde('0x39')][_0x7cde('0x30')](this));ami['on']('queuemember',this['syncQueueMember'][_0x7cde('0x30')](this));ami['on']('queuestatuscomplete',this[_0x7cde('0x3a')][_0x7cde('0x30')](this));this[_0x7cde('0x3b')]();this[_0x7cde('0x3c')]();}function isNotNull(_0x4a7e5b){return _0x4a7e5b!==null&&!_[_0x7cde('0x3d')](_0x4a7e5b);}function checkIsLoggedIn(_0x2f3bcb,_0x1d1074){return function(){if(_0x1d1074<=0x0){_0x2f3bcb[_0x7cde('0x3e')]=_0x7cde('0x3f');throw _0x2f3bcb[_0x7cde('0x40')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x531d35){return _0x531d35;}function checkIsActive(_0x1ea234,_0x474555){return function(){if(!isActive(_0x474555)){_0x1ea234[_0x7cde('0x3e')]='NOT_ACTIVE';throw _0x1ea234[_0x7cde('0x40')]+'\x20NOT\x20Active';}};}function checkInterval(_0x30fea2){return function(){if(!isNotNull(_0x30fea2[_0x7cde('0x41')])){_0x30fea2[_0x7cde('0x3e')]='INTERVAL_IS_NULL';throw _0x30fea2['name']+_0x7cde('0x42');}if(!isNotNull(_0x30fea2[_0x7cde('0x41')][_0x7cde('0x43')])){_0x30fea2[_0x7cde('0x3e')]='INTERVAL_IS_NULL';throw _0x30fea2[_0x7cde('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x7cde('0x44')](_0x30fea2['Interval'][_0x7cde('0x43')]))){_0x30fea2['message']=_0x7cde('0x45');throw _0x30fea2[_0x7cde('0x40')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x4c504a,_0x4b94b7,_0x104d74){return{'action':_0x4c504a,'response':_0x4b94b7,'message':_0x104d74,'stack':_0x104d74};}function myreject(_0x2e944b){return function(_0x53b9b8){return _0x2e944b(msgResponse('[ifTime][Action]',_0x7cde('0x46'),JSON['stringify'](_0x53b9b8)));};}function getSeconds(_0x2377ec,_0x47214a){var _0x10901f=moment(_0x2377ec)['milliseconds'](0x0);var _0x1ad70d=moment(_0x47214a)[_0x7cde('0x47')](0x0);return _0x10901f['diff'](_0x1ad70d,'seconds');}function emit(_0x1564f2,_0x4e9ab0,_0x295c54){io['to'](_0x1564f2)[_0x7cde('0x48')](_0x4e9ab0,_0x295c54);}function emitVoiceQueueSummary(_0x19b6f9){if(_0x19b6f9[_0x7cde('0x49')]===_0x7cde('0x4a')){var _0x4aceeb={'id':_0x19b6f9['id'],'name':_0x19b6f9[_0x7cde('0x40')],'strategy':_0x19b6f9[_0x7cde('0x4b')],'answered':_0x19b6f9[_0x7cde('0x4c')],'available':_0x19b6f9[_0x7cde('0x4d')],'loggedIn':_0x19b6f9[_0x7cde('0x4e')],'pTalking':_0x19b6f9[_0x7cde('0x4f')],'sumBillable':_0x19b6f9[_0x7cde('0x50')],'sumDuration':_0x19b6f9[_0x7cde('0x51')],'sumHoldTime':_0x19b6f9[_0x7cde('0x52')]||0x0,'talking':_0x19b6f9[_0x7cde('0x53')],'total':_0x19b6f9['total'],'type':_0x19b6f9[_0x7cde('0x49')],'unmanaged':_0x19b6f9[_0x7cde('0x54')],'abandoned':_0x19b6f9[_0x7cde('0x55')],'waiting':_0x19b6f9[_0x7cde('0x56')],'loggedInDb':_0x19b6f9[_0x7cde('0x57')],'dialActive':_0x19b6f9[_0x7cde('0x58')],'dialMethod':_0x19b6f9[_0x7cde('0x59')],'dialOriginateCallerIdName':_0x19b6f9[_0x7cde('0x5a')],'dialOriginateCallerIdNumber':_0x19b6f9['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x19b6f9[_0x7cde('0x5b')],'dialPrefix':_0x19b6f9[_0x7cde('0x5c')],'outboundAnswerAgiCallsDay':_0x19b6f9[_0x7cde('0x5d')],'outboundAnswerCallsDay':_0x19b6f9[_0x7cde('0x5e')],'outboundBlacklistCallsDay':_0x19b6f9[_0x7cde('0x5f')],'outboundBusyCallsDay':_0x19b6f9[_0x7cde('0x60')],'outboundCongestionCallsDay':_0x19b6f9[_0x7cde('0x61')],'outboundDropCallsDayACS':_0x19b6f9['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x19b6f9[_0x7cde('0x62')],'outboundDropCallsDayTimeout':_0x19b6f9[_0x7cde('0x63')],'outboundNoAnswerCallsDay':_0x19b6f9[_0x7cde('0x64')],'outboundNoSuchCallsDay':_0x19b6f9[_0x7cde('0x65')],'outboundOriginateFailureCallsDay':_0x19b6f9['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x19b6f9['outboundReCallsDay'],'outboundRejectCallsDay':_0x19b6f9[_0x7cde('0x66')],'outboundUnknownCallsDay':_0x19b6f9[_0x7cde('0x67')],'predictiveIntervalAnsweredCalls':_0x19b6f9[_0x7cde('0x68')],'predictiveIntervalAvgHoldtime':_0x19b6f9[_0x7cde('0x69')],'predictiveIntervalAvgTalktime':_0x19b6f9['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x19b6f9['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x19b6f9[_0x7cde('0x6a')],'predictiveIntervalErlangCalls':_0x19b6f9[_0x7cde('0x6b')],'predictiveIntervalErlangCallsDroppedCalls':_0x19b6f9['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x19b6f9[_0x7cde('0x6c')],'predictiveIntervalMultiplicativeFactor':_0x19b6f9['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x19b6f9['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x19b6f9[_0x7cde('0x6d')],'predictiveIntervalTotalCalls':_0x19b6f9[_0x7cde('0x6e')],'message':_0x19b6f9[_0x7cde('0x3e')],'originated':_0x19b6f9['originated'],'erlangCalls':_0x19b6f9['erlangCalls'],'erlangCallToSecond':_0x19b6f9[_0x7cde('0x6f')],'erlangAbandonmentRate':_0x19b6f9[_0x7cde('0x70')],'erlangBusyFactor':_0x19b6f9[_0x7cde('0x71')],'startPredictive':_0x19b6f9[_0x7cde('0x72')],'startProgressive':_0x19b6f9['startProgressive']};if(_0x19b6f9['Trunk']){_0x4aceeb[_0x7cde('0x73')]={'id':_0x19b6f9[_0x7cde('0x73')]['id'],'name':_0x19b6f9[_0x7cde('0x73')][_0x7cde('0x40')],'active':_0x19b6f9[_0x7cde('0x73')][_0x7cde('0x74')],'callerid':_0x19b6f9[_0x7cde('0x73')][_0x7cde('0x75')]};}if(_0x19b6f9[_0x7cde('0x41')]){_0x4aceeb['Interval']={'id':_0x19b6f9[_0x7cde('0x41')]['id'],'name':_0x19b6f9[_0x7cde('0x41')][_0x7cde('0x40')]};}var _0x214c94=md5(JSON['stringify'](_0x4aceeb));if(_0x19b6f9['md5']!==_0x214c94){_0x19b6f9[_0x7cde('0x3')]=_0x214c94;emit(util[_0x7cde('0x76')](_0x7cde('0x77'),_0x4aceeb[_0x7cde('0x40')]),_0x7cde('0x78'),_0x4aceeb);}}}function emitCampaignSummary(_0x24d028){if(_0x24d028[_0x7cde('0x49')]==='ivr'){emit(util[_0x7cde('0x76')](_0x7cde('0x79'),_0x24d028[_0x7cde('0x40')]),_0x7cde('0x7a'),_0x24d028);}}function checkGetDataPredictive(_0x9d263e){if(isNotNull(_0x9d263e)&&!_['isEmpty'](_0x9d263e)){loggerPredictive[_0x7cde('0x7b')](_0x7cde('0x7c'));loggerPredictive[_0x7cde('0x7b')](_0x7cde('0x7d'),_0x9d263e['predictiveIntervalTotalCalls']);loggerPredictive[_0x7cde('0x7b')](_0x7cde('0x7e'),_0x9d263e[_0x7cde('0x68')]);loggerPredictive[_0x7cde('0x7b')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x9d263e[_0x7cde('0x6a')]);loggerPredictive[_0x7cde('0x7b')](_0x7cde('0x7f'),_0x9d263e['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x7cde('0x7b')](_0x7cde('0x80'),_0x9d263e[_0x7cde('0x69')]);loggerPredictive[_0x7cde('0x7b')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x9d263e[_0x7cde('0x81')]);loggerPredictive[_0x7cde('0x7b')](_0x7cde('0x82'));if(_0x9d263e[_0x7cde('0x6e')]>0x0){if(!_['isUndefined'](_0x9d263e[_0x7cde('0x81')])&&_0x9d263e[_0x7cde('0x81')]>0x0){return!![];}loggerPredictive[_0x7cde('0x7b')](_0x7cde('0x83'));if(!_['isUndefined'](_0x9d263e['predictiveIntervalAvgHoldtime'])&&_0x9d263e[_0x7cde('0x69')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive['info'](_0x7cde('0x84'));}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x1b2cd7){return function(_0x433923){loggerPredictive[_0x7cde('0x7b')](_0x7cde('0x85'));loggerPredictive['info'](_0x7cde('0x86'),_0x433923['erlangCalls']);loggerPredictive[_0x7cde('0x7b')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x433923[_0x7cde('0x6f')]);loggerPredictive[_0x7cde('0x7b')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x433923['erlangAbandonmentRate']);loggerPredictive[_0x7cde('0x7b')](_0x7cde('0x87'),_0x433923[_0x7cde('0x71')]);loggerPredictive['info'](_0x7cde('0x88'),_0x433923[_0x7cde('0x70')]);loggerPredictive[_0x7cde('0x7b')](_0x7cde('0x82'));_[_0x7cde('0x89')](_0x1b2cd7,_0x433923);};}function getDiff(_0x350b53){var _0x551e44=moment()['milliseconds'](0x0);var _0x5973c8=moment(_0x350b53)[_0x7cde('0x47')](0x0);return _0x551e44[_0x7cde('0x8a')](_0x5973c8,'seconds');}function ifInterval(_0x33693d,_0x2c6bcb){if(_[_0x7cde('0x3d')](_0x2c6bcb)){return![];}return getDiff(_0x2c6bcb)<_0x33693d*0x3c;}function freeVariablesPredictive(_0xb320e4){if(isNotNull(_0xb320e4)){if(!_[_0x7cde('0x3d')](_0xb320e4['startProgressive'])){_0xb320e4[_0x7cde('0x2b')]=undefined;loggerPredictive['info'](_0xb320e4[_0x7cde('0x40')],_0x7cde('0x8b'));}if(!_[_0x7cde('0x3d')](_0xb320e4[_0x7cde('0x72')])){_0xb320e4['startPredictive']=undefined;loggerPredictive[_0x7cde('0x7b')](_0xb320e4[_0x7cde('0x40')],_0x7cde('0x8c'));}if(!_[_0x7cde('0x3d')](_0xb320e4[_0x7cde('0x8d')])){clearInterval(_0xb320e4[_0x7cde('0x8d')]);_0xb320e4['handlePredictive']=undefined;loggerPredictive[_0x7cde('0x7b')](_0xb320e4[_0x7cde('0x40')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x53f548,_0x3604aa){if(_0x3604aa===0x0){return 0x0;}var _0x18d839=0x1;for(var _0x20eaf6=0x1;_0x20eaf6<=_0x3604aa;_0x20eaf6+=0x1){_0x18d839=0x1+_0x18d839*_0x20eaf6/_0x53f548;}return 0x1/_0x18d839;}function isVoiceQueueOutbound(_0x4885d1){return _0x4885d1===_0x7cde('0x4a');}function isNotPreview(_0x5357b9){return _0x5357b9!=='preview';}function isCampaignIvr(_0x55d2cd){return _0x55d2cd==='ivr';}function getCallerId(_0x250633,_0x2a4a5f,_0x113381){if(!_[_0x7cde('0x3d')](_0x113381)&&typeof _0x113381===_0x7cde('0x8e')&&!_[_0x7cde('0x44')](_0x113381)){if(!_[_0x7cde('0x3d')](_0x2a4a5f)&&typeof _0x2a4a5f===_0x7cde('0x8e')&&!_[_0x7cde('0x44')](_0x2a4a5f)){return util[_0x7cde('0x76')](_0x7cde('0x8f'),_0x2a4a5f,_0x113381);}return util[_0x7cde('0x76')](_0x7cde('0x8f'),_0x113381,_0x113381);}if(!_[_0x7cde('0x3d')](_0x250633)&&typeof _0x250633===_0x7cde('0x8e')&&!_['isEmpty'](_0x250633)){return _0x250633;}return _0x7cde('0x90');}function loggerCatchQueueSummary(_0x2552d8,_0x171cb7){return function(_0x2f2979){freeVariablesPredictive(_0x171cb7);emitVoiceQueueSummary(_0x171cb7);emitCampaignSummary(_0x171cb7);loggerSyncQueueSummary[_0x7cde('0x91')](_0x2552d8,util[_0x7cde('0x92')](_0x2f2979,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x24b6c9,_0x371fe5){return function(_0x16092c){loggerPredictive[_0x7cde('0x91')](_0x371fe5[_0x7cde('0x40')],_0x24b6c9);loggerPredictive[_0x7cde('0x91')](_0x16092c[_0x7cde('0x93')]);freeVariablesPredictive(_0x371fe5);};}function loggerCatch(_0x14cc45){return function(_0x2f6fb0){logger[_0x7cde('0x91')](_0x14cc45,util[_0x7cde('0x92')](_0x2f6fb0,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x1b4fab){return _0x1b4fab&&!_[_0x7cde('0x3d')](_0x1b4fab)&&_0x1b4fab[_0x7cde('0x94')]>0x0;}function decremetOriginate(_0x31ef8f){if(!_[_0x7cde('0x3d')](_0x31ef8f)&&_0x31ef8f!==null){if(typeof _0x31ef8f[_0x7cde('0x95')]!=='undefined'){if(_0x31ef8f[_0x7cde('0x95')]>0x0){_0x31ef8f['originated']-=0x1;}else{logger[_0x7cde('0x91')](_0x7cde('0x96'));}}}else{logger[_0x7cde('0x91')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x580fb8,_0x582044,_0x54b6fc){if(_0x582044>_0x54b6fc){for(var _0x5892cb=0x0;_0x5892cb<_0x582044-_0x54b6fc;_0x5892cb+=0x1){decremetOriginate(_0x580fb8);}}}function loggerGetContactDialer(_0x3eaeb0,_0x3c6f27,_0xcebfda){return function(_0x1becbb){checkContactLowerLimitOriginate(_0x3c6f27,_0xcebfda,0x0);logger[_0x7cde('0x91')](_0x3eaeb0,util[_0x7cde('0x92')](_0x1becbb,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x50d602){return function(_0x313e16){if(isNotNull(_0x313e16)&&isNotNull(_0x313e16[0x0])){if(_0x313e16[0x0][_0x7cde('0x97')]>0x0){_0x50d602[_0x7cde('0x3e')]=_0x7cde('0x98');logger[_0x7cde('0x7b')](_0x7cde('0x99')+_0x50d602[_0x7cde('0x40')],_0x313e16[0x0][_0x7cde('0x97')],_0x7cde('0x9a'));}else{_0x50d602[_0x7cde('0x3e')]=_0x7cde('0x9b');logger['info']('[getContactDialer2][Empty]'+_0x50d602[_0x7cde('0x40')]);}}};}function notSendMessagesQueue(_0x504725){if(_0x504725[_0x7cde('0x9c')]){freeVariablesPredictive(_0x504725);if(_0x504725[_0x7cde('0x95')]===0x0&&_0x504725[_0x7cde('0x53')]===0x0&&_0x504725[_0x7cde('0x56')]===0x0&&(_0x504725[_0x7cde('0x4f')]||0x0)===0x0){_0x504725['sendMessageOneNotActive']=![];_0x504725[_0x7cde('0x4d')]=0x0;_0x504725[_0x7cde('0x3e')]=_0x7cde('0x9d');loggerSyncQueueSummary[_0x7cde('0x91')](_0x7cde('0x9e'),_0x504725['name'],_0x7cde('0x9f'));}else{_0x504725[_0x7cde('0x3e')]=_0x7cde('0xa0');loggerSyncQueueSummary[_0x7cde('0x91')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x504725[_0x7cde('0x40')],'is\x20disactive');}emitVoiceQueueSummary(_0x504725);}}function notSendMessagesCampaign(_0x55ea8a){if(_0x55ea8a[_0x7cde('0x9c')]){if(_0x55ea8a['originated']===0x0){_0x55ea8a['sendMessageOneNotActive']=![];_0x55ea8a['message']=_0x7cde('0x9d');loggerSyncQueueSummary[_0x7cde('0x91')](_0x7cde('0xa1'),_0x55ea8a[_0x7cde('0x40')],'is\x20not\x20active');}else{_0x55ea8a[_0x7cde('0x3e')]=_0x7cde('0xa0');loggerSyncQueueSummary[_0x7cde('0x91')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x55ea8a[_0x7cde('0x40')],_0x7cde('0xa2'));}emitCampaignSummary(_0x55ea8a);}}function createObjHistory(_0x38fdf3,_0x2818f3,_0x5926f2,_0x1fe097,_0xfb1e8e){_0x38fdf3['message']=_0x5926f2;var _0x371bdf=new Action(_0x38fdf3,_0x2818f3);var _0x1ea82a=new History(_0x371bdf);_0x1ea82a[_0x7cde('0xa3')]=_0x1fe097;_0x1ea82a[_0x7cde('0xa4')]=_0xfb1e8e;_0x1ea82a[_0x7cde('0xa5')]=_0x371bdf[_0x7cde('0xa6')];return _0x1ea82a;}Dialer[_0x7cde('0x1d')]['loopClearZombieChannels']=function(){var _0x21106a=this;setInterval(function(){_0x21106a['clearZombieChannels'](_0x21106a['uniqueId'],'[uniqueid]');_0x21106a[_0x7cde('0xa7')](_0x21106a[_0x7cde('0xa8')],_0x7cde('0xa9'));},0x32c8);};Dialer[_0x7cde('0x1d')][_0x7cde('0xa7')]=function(_0x1b8d27,_0x542eaa){var _0x210c56=this;for(var _0x245fbc in _0x1b8d27){if(typeof _0x1b8d27[_0x245fbc]!==_0x7cde('0xaa')){this[_0x7cde('0xab')]['enqueue'](function(){if(!_[_0x7cde('0xac')](_0x1b8d27[_0x245fbc])){return ami['Action']({'action':_0x7cde('0xad'),'channel':_0x1b8d27[_0x245fbc][_0x7cde('0xae')]})[_0x7cde('0xaf')](function(_0x594e74){if(_0x594e74[_0x7cde('0x3e')]===_0x7cde('0xb0')){setTimeout(function(){if(_0x1b8d27[_0x245fbc]&&_0x1b8d27[_0x245fbc][_0x7cde('0x49')]!=='ivr'){_0x210c56[_0x7cde('0xb1')](_0x210c56[_0x7cde('0x22')][_0x1b8d27[_0x245fbc][_0x7cde('0xb2')]]);logger['error'](_0x7cde('0xb3'),_0x542eaa,_0x245fbc,_0x1b8d27[_0x245fbc]['queue']);delete _0x1b8d27[_0x245fbc];}if(_0x1b8d27[_0x245fbc]&&_0x1b8d27[_0x245fbc]['type']==='ivr'){_0x210c56[_0x7cde('0xb1')](_0x210c56[_0x7cde('0x23')][_0x1b8d27[_0x245fbc][_0x7cde('0xb2')]]);logger['error']('[Dialer][checkChannel][ivr]',_0x542eaa,_0x245fbc,_0x1b8d27[_0x245fbc][_0x7cde('0xb2')]);delete _0x1b8d27[_0x245fbc];}},0x2328);}});}});}}};Dialer['prototype'][_0x7cde('0xb4')]=function(_0x191323){return BPromise[_0x7cde('0xb5')]()['then'](cmHopper[_0x7cde('0xb4')](_0x191323))[_0x7cde('0xaf')](loggerCatch(_0x7cde('0xb6')));};Dialer['prototype'][_0x7cde('0xb7')]=function(_0x493498){return BPromise[_0x7cde('0xb5')]()['then'](cmHopperBlack[_0x7cde('0xb7')](_0x493498))['catch'](loggerCatch(_0x7cde('0xb8')));};Dialer[_0x7cde('0x1d')][_0x7cde('0xb9')]=function(_0x4a1606){return BPromise[_0x7cde('0xb5')]()['then'](cmHopperBlack['checkIsBlackListIvr'](_0x4a1606))[_0x7cde('0xaf')](loggerCatch(_0x7cde('0xba')));};Dialer[_0x7cde('0x1d')][_0x7cde('0xbb')]=function(_0x1e1407){return BPromise['resolve']()[_0x7cde('0xbc')](cmHopperHistory[_0x7cde('0xbd')](_0x1e1407))[_0x7cde('0xaf')](loggerCatch(_0x7cde('0xbe')));};Dialer[_0x7cde('0x1d')][_0x7cde('0xbf')]=function(_0x317f01){return BPromise[_0x7cde('0xb5')]()[_0x7cde('0xbc')](cmHopper[_0x7cde('0xbf')](_0x317f01))[_0x7cde('0xaf')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0x7cde('0x1d')]['unlockContact']=function(_0x293bbb,_0x5536f9,_0x109200){return BPromise[_0x7cde('0xb5')]()['then'](cmHopper[_0x7cde('0xc0')](_0x293bbb,_0x5536f9,_0x109200))[_0x7cde('0xaf')](loggerCatch(_0x7cde('0xc1')));};Dialer[_0x7cde('0x1d')][_0x7cde('0xc2')]=function(_0x294b64,_0x16bcbd,_0x2dadad,_0x11d1cb,_0x357133){return BPromise[_0x7cde('0xb5')]()[_0x7cde('0xbc')](cmHopper['getContactDialer'](_0x294b64,_0x16bcbd,_0x2dadad,_0x11d1cb))[_0x7cde('0xaf')](function(_0x667ee6){_0x357133['temp']-=_0x2dadad;_0x357133[_0x7cde('0xc3')]=_0x357133[_0x7cde('0xc3')]>0x0?_0x357133[_0x7cde('0xc3')]:0x0;loggerCatch(_0x7cde('0xc4'))(_0x667ee6);});};Dialer['prototype'][_0x7cde('0xc5')]=function(_0x112bcf,_0x3ca16f,_0x1297b1,_0x34c0d1){return BPromise[_0x7cde('0xb5')]()['then'](cmHopper[_0x7cde('0xc5')](_0x112bcf,_0x3ca16f,_0x1297b1))['catch'](function(_0x12dc7d){_0x34c0d1['temp']-=_0x3ca16f;_0x34c0d1[_0x7cde('0xc3')]=_0x34c0d1[_0x7cde('0xc3')]>0x0?_0x34c0d1[_0x7cde('0xc3')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x12dc7d);});};Dialer[_0x7cde('0x1d')][_0x7cde('0xc6')]=function(_0x1a5ec5){return BPromise[_0x7cde('0xb5')]()['then'](voiceQueueRt[_0x7cde('0xc6')](_0x1a5ec5))[_0x7cde('0xaf')](loggerCatch(_0x7cde('0xc7')));};Dialer[_0x7cde('0x1d')][_0x7cde('0xc8')]=function(_0x50f632){return BPromise[_0x7cde('0xb5')]()['then'](cmHopper[_0x7cde('0xc8')](_0x50f632))['catch'](loggerCatch(_0x7cde('0xc9')));};Dialer['prototype'][_0x7cde('0xca')]=function(_0x233ffe){return BPromise[_0x7cde('0xb5')]()['then'](cmHopperHistory[_0x7cde('0xca')](_0x233ffe))[_0x7cde('0xaf')](loggerCatch(_0x7cde('0xcb')));};Dialer[_0x7cde('0x1d')][_0x7cde('0xb1')]=function(_0xeb532e){if(!_[_0x7cde('0x3d')](_0xeb532e)&&_0xeb532e!==null){if(typeof _0xeb532e['originated']!==_0x7cde('0xaa')){if(_0xeb532e[_0x7cde('0x95')]>0x0){_0xeb532e[_0x7cde('0x95')]-=0x1;}else{logger[_0x7cde('0x91')](_0x7cde('0xcc'));}}}else{logger[_0x7cde('0x91')](_0x7cde('0xcd'));}};Dialer[_0x7cde('0x1d')][_0x7cde('0xce')]=function(_0x561be9,_0x4ffd8c){var _0x58ccc3=this;return function(_0x2b59fd){_0x58ccc3[_0x7cde('0xb1')](_0x4ffd8c);logger[_0x7cde('0x91')](_0x561be9,util[_0x7cde('0x92')](_0x2b59fd,{'showHidden':![],'depth':null}));};};Dialer[_0x7cde('0x1d')][_0x7cde('0xcf')]=function(_0x5e09fa,_0x1af99a,_0xca4dfd){var _0x4b006f={'state':0x19,'statedesc':_0x7cde('0xd0')};this[_0x7cde('0xb1')](_0x1af99a);this['saveInDb'](_[_0x7cde('0x89')](_0x4b006f,_[_0x7cde('0xd1')](_0xca4dfd,[_0x7cde('0xd2'),_0x7cde('0xd3'),_0x7cde('0xd4'),_0x7cde('0xd5'),'CampaignId'])),_0x7cde('0xd6'),_0x7cde('0xd7'));logger[_0x7cde('0x91')](_0x5e09fa);};Dialer['prototype']['isSuccess']=function(_0x5e906a){return _0x5e906a===_0x7cde('0xd8');};Dialer[_0x7cde('0x1d')][_0x7cde('0xd9')]=function(_0x75078d){return!_['isUndefined'](_0x75078d)&&_0x75078d&&!_[_0x7cde('0x3d')](_0x75078d['name'])&&!_[_0x7cde('0x3d')](_0x75078d[_0x7cde('0x74')])&&_0x75078d[_0x7cde('0x74')]&&(this[_0x7cde('0x25')][util[_0x7cde('0x76')](_0x7cde('0xda'),_0x75078d[_0x7cde('0x40')])]['status']===_0x7cde('0xdb')||this[_0x7cde('0x25')][util['format'](_0x7cde('0xda'),_0x75078d[_0x7cde('0x40')])][_0x7cde('0xad')]==='unmonitored');};Dialer[_0x7cde('0x1d')][_0x7cde('0xdc')]=function(_0x5912f2,_0x3f5a08,_0x3a6b57){this[_0x7cde('0xca')](_0x5912f2)['catch'](loggerCatch(_0x3f5a08));this['moveContactManagedDialer'](_0x5912f2)[_0x7cde('0xaf')](loggerCatch(_0x3a6b57));};Dialer[_0x7cde('0x1d')][_0x7cde('0x39')]=function(_0xea6a78){var _0x1e95a2=this[_0x7cde('0x29')][_0xea6a78[_0x7cde('0xdd')]];var _0x3a24ea;if(!_[_0x7cde('0xac')](_0xea6a78)&&!_['isNil'](_0xea6a78['variable'])&&!_[_0x7cde('0xac')](_0xea6a78[_0x7cde('0xde')]['amdstatus'])&&_0xea6a78['exten']==='xcally-motion-dialer'&&_0x1e95a2){if(_0x1e95a2[_0x7cde('0x49')]!==_0x7cde('0xdf')&&this[_0x7cde('0x22')][_0x1e95a2['queue']][_0x7cde('0xe0')]&&_0xea6a78[_0x7cde('0xe1')]===_0x7cde('0xe2')){delete this[_0x7cde('0x29')][_0xea6a78[_0x7cde('0xdd')]];this[_0x7cde('0xb1')](this[_0x7cde('0x22')][_0x1e95a2[_0x7cde('0xb2')]]);this[_0x7cde('0x22')][_0x1e95a2[_0x7cde('0xb2')]][_0x7cde('0x5e')]+=0x1;this[_0x7cde('0x22')][_0x1e95a2[_0x7cde('0xb2')]][_0x7cde('0x5d')]+=0x1;_0x3a24ea=new Hangup(_0x1e95a2,_0xea6a78);_0x3a24ea[_0x7cde('0xa3')]=0x12;_0x3a24ea['statedesc']=_0x7cde('0xe3');_0x3a24ea[_0x7cde('0xe4')]=_0x7cde('0xe5');ami['emit'](_0x7cde('0xe6'),ut[_0x7cde('0xe7')](_0x3a24ea,_0x7cde('0xe8')));this[_0x7cde('0xdc')](_0x3a24ea,'[syncHangupInAMD][createHistory]',_0x7cde('0xe9'));}if(_0x1e95a2[_0x7cde('0x49')]!==_0x7cde('0xdf')&&this[_0x7cde('0x22')][_0x1e95a2[_0x7cde('0xb2')]][_0x7cde('0xe0')]&&_0xea6a78[_0x7cde('0xe1')]===_0x7cde('0xea')){var _0x2f01db=this;return new BPromise(function(_0x31f4ac,_0x557944){delete _0x2f01db['uniqueId'][_0xea6a78['uniqueid']];_0x2f01db['updateOriginated'](_0x2f01db[_0x7cde('0x22')][_0x1e95a2[_0x7cde('0xb2')]]);_0x2f01db[_0x7cde('0x22')][_0x1e95a2[_0x7cde('0xb2')]][_0x7cde('0x5e')]+=0x1;_0x2f01db[_0x7cde('0x22')][_0x1e95a2[_0x7cde('0xb2')]][_0x7cde('0x5d')]+=0x1;var _0x88e227=_0x2f01db['voiceQueues'][_0x1e95a2[_0x7cde('0xb2')]];var _0x55e5fb=new Hangup(_0x1e95a2,_0xea6a78);_0x55e5fb[_0x7cde('0xa3')]=0x13;_0x55e5fb[_0x7cde('0xa4')]='Machine';_0x55e5fb['membername']='AMD';_0x55e5fb['countmachineretry']+=0x1;_0x55e5fb[_0x7cde('0xeb')]+=0x1;_0x55e5fb[_0x7cde('0xe8')]=!![];ami[_0x7cde('0x48')](_0x7cde('0xe6'),ut[_0x7cde('0xe7')](_0x55e5fb,_0x7cde('0xe8')));_0x2f01db[_0x7cde('0xca')](_0x55e5fb)[_0x7cde('0xaf')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x55e5fb[_0x7cde('0xec')]+_0x55e5fb[_0x7cde('0xed')]+_0x55e5fb[_0x7cde('0xee')]+_0x55e5fb[_0x7cde('0xef')]+_0x55e5fb[_0x7cde('0xf0')]+_0x55e5fb['countabandonedretry']+_0x55e5fb[_0x7cde('0xf1')]+_0x55e5fb[_0x7cde('0xf2')]>=_0x88e227[_0x7cde('0xf3')]){_0x2f01db['stateGlobal'](_0x55e5fb,_0x31f4ac,_0x557944,_0x7cde('0xf4'));}else{if(_0x55e5fb['countmachineretry']>=_0x88e227[_0x7cde('0xf5')]){_0x2f01db[_0x7cde('0xf6')](_0x55e5fb,_0x31f4ac,_0x557944,_0x7cde('0xf7'));}else{_0x2f01db[_0x7cde('0xbf')]({'active':![],'countmachineretry':_0x55e5fb['countmachineretry'],'scheduledat':moment()[_0x7cde('0xf8')](_0x88e227['dialMachineRetryFrequency'],_0x7cde('0xf9'))[_0x7cde('0x76')](_0x7cde('0xfa')),'ContactId':_0x55e5fb[_0x7cde('0xd2')],'ListId':_0x55e5fb[_0x7cde('0xd3')],'VoiceQueueId':_0x55e5fb[_0x7cde('0xd5')]||undefined,'CampaignId':_0x55e5fb['CampaignId']||undefined})[_0x7cde('0xaf')](loggerCatch(_0x7cde('0xfb')));_0x31f4ac({'reschedule':0x1});}}});}if(_0x1e95a2[_0x7cde('0x49')]==='ivr'&&this[_0x7cde('0x23')][_0x1e95a2[_0x7cde('0xb2')]]['dialAMDActive']&&_0xea6a78['value']===_0x7cde('0xe2')){delete this[_0x7cde('0x29')][_0xea6a78[_0x7cde('0xdd')]];this[_0x7cde('0xb1')](this[_0x7cde('0x23')][_0x1e95a2['queue']]);_0x3a24ea=new Hangup(_0x1e95a2,_0xea6a78);_0x3a24ea[_0x7cde('0xa3')]=0x12;_0x3a24ea[_0x7cde('0xa4')]=_0x7cde('0xe3');_0x3a24ea[_0x7cde('0xe4')]=_0x7cde('0xe5');ami[_0x7cde('0x48')](_0x7cde('0xe6'),ut[_0x7cde('0xe7')](_0x3a24ea,_0x7cde('0xe8')));this['saveInDb'](_0x3a24ea,_0x7cde('0xfc'),_0x7cde('0xfd'));}if(_0x1e95a2['type']===_0x7cde('0xdf')&&this[_0x7cde('0x23')][_0x1e95a2[_0x7cde('0xb2')]]['dialAMDActive']&&_0xea6a78[_0x7cde('0xe1')]===_0x7cde('0xea')){var _0x2f01db=this;return new BPromise(function(_0x215d80,_0xd5416b){delete _0x2f01db['uniqueId'][_0xea6a78[_0x7cde('0xdd')]];_0x2f01db[_0x7cde('0xb1')](_0x2f01db[_0x7cde('0x23')][_0x1e95a2[_0x7cde('0xb2')]]);_0x2f01db[_0x7cde('0x23')][_0x1e95a2[_0x7cde('0xb2')]][_0x7cde('0x5e')]+=0x1;_0x2f01db[_0x7cde('0x23')][_0x1e95a2[_0x7cde('0xb2')]][_0x7cde('0x5d')]+=0x1;var _0x3a0fe1=_0x2f01db[_0x7cde('0x23')][_0x1e95a2[_0x7cde('0xb2')]];var _0x4890ad=new Hangup(_0x1e95a2,_0xea6a78);_0x4890ad['state']=0x13;_0x4890ad[_0x7cde('0xa4')]=_0x7cde('0xfe');_0x4890ad[_0x7cde('0xe4')]=_0x7cde('0xe5');_0x4890ad[_0x7cde('0xf1')]+=0x1;_0x4890ad['countglobal']+=0x1;_0x4890ad['amd']=!![];ami[_0x7cde('0x48')](_0x7cde('0xe6'),ut[_0x7cde('0xe7')](_0x4890ad,_0x7cde('0xe8')));_0x2f01db[_0x7cde('0xca')](_0x4890ad)['catch'](loggerCatch(_0x7cde('0xff')));if(_0x4890ad[_0x7cde('0xec')]+_0x4890ad[_0x7cde('0xed')]+_0x4890ad[_0x7cde('0xee')]+_0x4890ad[_0x7cde('0xef')]+_0x4890ad[_0x7cde('0xf0')]+_0x4890ad[_0x7cde('0x100')]+_0x4890ad[_0x7cde('0xf1')]+_0x4890ad[_0x7cde('0xf2')]>=_0x3a0fe1[_0x7cde('0xf3')]){_0x2f01db[_0x7cde('0x101')](_0x4890ad,_0x215d80,_0xd5416b,_0x7cde('0xf4'));}else{if(_0x4890ad[_0x7cde('0xf1')]>=_0x3a0fe1[_0x7cde('0xf5')]){_0x2f01db[_0x7cde('0xf6')](_0x4890ad,_0x215d80,_0xd5416b,_0x7cde('0xf7'));}else{_0x2f01db[_0x7cde('0xbf')]({'active':![],'countmachineretry':_0x4890ad[_0x7cde('0xf1')],'scheduledat':moment()[_0x7cde('0xf8')](_0x3a0fe1[_0x7cde('0x102')],'minutes')[_0x7cde('0x76')](_0x7cde('0xfa')),'ContactId':_0x4890ad[_0x7cde('0xd2')],'ListId':_0x4890ad[_0x7cde('0xd3')],'VoiceQueueId':_0x4890ad['VoiceQueueId']||undefined,'CampaignId':_0x4890ad[_0x7cde('0x103')]||undefined})[_0x7cde('0xaf')](loggerCatch(_0x7cde('0xfb')));_0x215d80({'reschedule':0x1});}}});}}};Dialer[_0x7cde('0x1d')][_0x7cde('0x104')]=function(_0x2afb6c){var _0x4bac04=this[_0x7cde('0x29')][_0x2afb6c[_0x7cde('0xdd')]];var _0x1114a4=this;var _0xcfc7df;if(_0x4bac04&&_0x4bac04['type']===_0x7cde('0xdf')){delete this[_0x7cde('0x29')][_0x2afb6c[_0x7cde('0xdd')]];this[_0x7cde('0xb1')](this['campaigns'][_0x4bac04[_0x7cde('0xb2')]]);this[_0x7cde('0x23')][_0x4bac04[_0x7cde('0xb2')]]['ivrAnswerCallsDay']+=0x1;_0xcfc7df=new Hangup(_0x4bac04,_0x2afb6c);this[_0x7cde('0xca')](_0xcfc7df)['catch'](loggerCatch(_0x7cde('0x105')));this[_0x7cde('0xc8')](_0xcfc7df)[_0x7cde('0xaf')](loggerCatch('[syncHangupIvr]'));}if(_0x4bac04&&_0x4bac04['type']!==_0x7cde('0xdf')&&isNotNull(this[_0x7cde('0x22')][_0x4bac04[_0x7cde('0xb2')]][_0x7cde('0x106')])){delete this[_0x7cde('0x29')][_0x2afb6c['uniqueid']];this[_0x7cde('0xb1')](this[_0x7cde('0x22')][_0x4bac04['queue']]);this[_0x7cde('0x22')][_0x4bac04[_0x7cde('0xb2')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x4bac04[_0x7cde('0xb2')]][_0x7cde('0x5d')]+=0x1;_0xcfc7df=new Hangup(_0x4bac04,_0x2afb6c);_0xcfc7df[_0x7cde('0xa3')]=0x10;_0xcfc7df['statedesc']=_0x7cde('0x107');_0xcfc7df[_0x7cde('0xe4')]=_0x7cde('0x108');this['createHistory'](_0xcfc7df)[_0x7cde('0xaf')](loggerCatch(_0x7cde('0x105')));this[_0x7cde('0xc8')](_0xcfc7df)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x4bac04&&_0x4bac04[_0x7cde('0x49')]!=='ivr'&&!isNotNull(this[_0x7cde('0x22')][_0x4bac04[_0x7cde('0xb2')]]['dialQueueProject'])){delete this['uniqueId'][_0x2afb6c[_0x7cde('0xdd')]];this[_0x7cde('0xb1')](this[_0x7cde('0x22')][_0x4bac04[_0x7cde('0xb2')]]);this[_0x7cde('0x22')][_0x4bac04[_0x7cde('0xb2')]][_0x7cde('0x67')]+=0x1;_0xcfc7df=new Hangup(_0x4bac04,_0x2afb6c);_0xcfc7df[_0x7cde('0xa3')]=0xc;_0xcfc7df[_0x7cde('0xa4')]=_0x2afb6c['cause-txt'];_0xcfc7df['membername']=_0x7cde('0x109');this[_0x7cde('0xca')](_0xcfc7df)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x7cde('0xc8')](_0xcfc7df)[_0x7cde('0xaf')](loggerCatch(_0x7cde('0x10a')));}};Dialer[_0x7cde('0x1d')][_0x7cde('0x35')]=function(_0x46f73c){var _0x46f4dc=this['uniqueId'][_0x46f73c['uniqueid']];var _0x59b6c6=this;if(this[_0x7cde('0x22')][_0x46f73c[_0x7cde('0xb2')]]){if(_0x46f4dc&&_0x46f4dc[_0x7cde('0x49')]!=='ivr'){delete this[_0x7cde('0x29')][_0x46f73c[_0x7cde('0xdd')]];this[_0x7cde('0x22')][_0x46f73c[_0x7cde('0xb2')]][_0x7cde('0x5e')]+=0x1;var _0xe45ac6=new AgentComplete(_0x46f4dc,_0x46f73c);if(_0x46f73c[_0x7cde('0x10b')]===_0x7cde('0x10c')){_0xe45ac6['agiafterat']=this[_0x7cde('0x22')][_0x46f73c[_0x7cde('0xb2')]][_0x7cde('0x10d')]&&this[_0x7cde('0x22')][_0x46f73c[_0x7cde('0xb2')]][_0x7cde('0x10e')]?moment()[_0x7cde('0x76')](_0x7cde('0xfa')):undefined;}this[_0x7cde('0xca')](_0xe45ac6)[_0x7cde('0xaf')](loggerCatch(_0x7cde('0x10f')));this[_0x7cde('0xc8')](_0xe45ac6)[_0x7cde('0xaf')](loggerCatch(_0x7cde('0x110')));}}};Dialer[_0x7cde('0x1d')][_0x7cde('0x111')]=function(_0x2a4bfa){if(this[_0x7cde('0x22')][_0x2a4bfa['queue']]){if(this[_0x7cde('0x29')][_0x2a4bfa[_0x7cde('0xdd')]]&&this['uniqueId'][_0x2a4bfa[_0x7cde('0xdd')]][_0x7cde('0x49')]!==_0x7cde('0xdf')){this[_0x7cde('0xb1')](this['voiceQueues'][_0x2a4bfa[_0x7cde('0xb2')]]);this[_0x7cde('0x29')][_0x2a4bfa['uniqueid']][_0x7cde('0x112')]=moment()['format'](_0x7cde('0xfa'));}}};Dialer[_0x7cde('0x1d')][_0x7cde('0x113')]=function(_0x41db4c){this['createHistory'](_0x41db4c)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x41db4c)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer['prototype'][_0x7cde('0x31')]=function(_0x5da787){var _0x31cd88=this[_0x7cde('0x29')][_0x5da787['uniqueid']];var _0x17a759=this;if(this[_0x7cde('0x22')][_0x5da787[_0x7cde('0xb2')]]){if(_0x31cd88&&_0x31cd88[_0x7cde('0x49')]!==_0x7cde('0xdf')){delete this['uniqueId'][_0x5da787[_0x7cde('0xdd')]];this[_0x7cde('0xb1')](this[_0x7cde('0x22')][_0x5da787['queue']]);_0x31cd88['droptime']=moment()[_0x7cde('0x76')](_0x7cde('0xfa'));var _0x5bc2a2=new QueueCallerAbandon(_0x31cd88,_0x5da787);if(getSeconds(_0x31cd88[_0x7cde('0x114')],_0x31cd88[_0x7cde('0x115')])>=_0x31cd88[_0x7cde('0x116')]){this[_0x7cde('0x22')][_0x5da787[_0x7cde('0xb2')]][_0x7cde('0x6a')]+=0x1;this['voiceQueues'][_0x5da787[_0x7cde('0xb2')]][_0x7cde('0x63')]+=0x1;this[_0x7cde('0x22')][_0x5da787[_0x7cde('0xb2')]][_0x7cde('0x117')]+=0x1;_0x5bc2a2[_0x7cde('0xa3')]=0xa;_0x5bc2a2['statedesc']='Drop';_0x5bc2a2['dropreason']=_0x7cde('0x118');_0x5bc2a2['agiafterat']=this[_0x7cde('0x22')][_0x5da787['queue']]['dialQueueProject2']?moment()[_0x7cde('0x76')](_0x7cde('0xfa')):undefined;_0x5bc2a2[_0x7cde('0xf0')]+=0x1;_0x5bc2a2['countglobal']+=0x1;if(_0x5bc2a2[_0x7cde('0xf0')]>=this[_0x7cde('0x22')][_0x5da787[_0x7cde('0xb2')]][_0x7cde('0x119')]){this[_0x7cde('0x113')](_0x5bc2a2);}else{this[_0x7cde('0xbf')]({'active':![],'countdropretry':_0x5bc2a2['countdropretry'],'scheduledat':moment()[_0x7cde('0xf8')](this[_0x7cde('0x22')][_0x5da787[_0x7cde('0xb2')]][_0x7cde('0x11a')],_0x7cde('0xf9'))[_0x7cde('0x76')](_0x7cde('0xfa')),'ContactId':_0x31cd88['ContactId'],'ListId':_0x31cd88['ListId'],'VoiceQueueId':_0x31cd88[_0x7cde('0xd5')]||undefined,'CampaignId':_0x31cd88[_0x7cde('0x103')]||undefined})[_0x7cde('0xaf')](loggerCatch('[rescheduleContact][Drop]'));var _0x17b3f1=new History(_0x5bc2a2);_0x17b3f1[_0x7cde('0xa3')]=0xa;_0x17b3f1[_0x7cde('0xa4')]=_0x7cde('0x11b');_0x17b3f1[_0x7cde('0xa6')]=moment()[_0x7cde('0x76')]('YYYY-MM-DD\x20HH:mm:ss');_0x17b3f1['endtime']=_0x17b3f1[_0x7cde('0xa6')];_0x17b3f1['calleridname']=_0x5bc2a2[_0x7cde('0x11c')];_0x17b3f1[_0x7cde('0x11d')]=_0x5bc2a2[_0x7cde('0x11d')];this['createHistory'](_0x17b3f1)[_0x7cde('0xaf')](loggerCatch(_0x7cde('0x11e')));}}else{this[_0x7cde('0x22')][_0x5da787[_0x7cde('0xb2')]][_0x7cde('0x11f')]+=0x1;this[_0x7cde('0x22')][_0x5da787['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0x5bc2a2[_0x7cde('0xa3')]=0xb;_0x5bc2a2[_0x7cde('0xa4')]=_0x7cde('0x120');_0x5bc2a2[_0x7cde('0x121')]=_0x7cde('0x122');_0x5bc2a2[_0x7cde('0x100')]+=0x1;_0x5bc2a2[_0x7cde('0xeb')]+=0x1;if(_0x5bc2a2[_0x7cde('0x100')]>=this[_0x7cde('0x22')][_0x5da787[_0x7cde('0xb2')]][_0x7cde('0x123')]){this[_0x7cde('0x113')](_0x5bc2a2);}else{this[_0x7cde('0xbf')]({'active':![],'countabandonedretry':_0x5bc2a2[_0x7cde('0x100')],'scheduledat':moment()[_0x7cde('0xf8')](this[_0x7cde('0x22')][_0x5da787[_0x7cde('0xb2')]][_0x7cde('0x124')],'minutes')[_0x7cde('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x31cd88[_0x7cde('0xd2')],'ListId':_0x31cd88[_0x7cde('0xd3')],'VoiceQueueId':_0x31cd88['VoiceQueueId']||undefined,'CampaignId':_0x31cd88[_0x7cde('0x103')]||undefined})[_0x7cde('0xaf')](loggerCatch(_0x7cde('0x125')));var _0x17b3f1=new History(_0x5bc2a2);_0x17b3f1[_0x7cde('0xa3')]=0xb;_0x17b3f1[_0x7cde('0xa4')]='Abandoned';_0x17b3f1['starttime']=moment()[_0x7cde('0x76')]('YYYY-MM-DD\x20HH:mm:ss');_0x17b3f1['endtime']=_0x17b3f1[_0x7cde('0xa6')];_0x17b3f1[_0x7cde('0x11c')]=_0x5bc2a2[_0x7cde('0x11c')];_0x17b3f1[_0x7cde('0x11d')]=_0x5bc2a2[_0x7cde('0x11d')];this[_0x7cde('0xca')](_0x17b3f1)[_0x7cde('0xaf')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer['prototype'][_0x7cde('0x126')]=function(_0x2409fe){if(this['actions'][_0x2409fe[_0x7cde('0xdd')]]){this[_0x7cde('0xa8')][_0x2409fe['uniqueid']][_0x7cde('0xae')]=_0x2409fe[_0x7cde('0xae')];}if(this[_0x7cde('0x29')][_0x2409fe[_0x7cde('0xdd')]]){this[_0x7cde('0x29')][_0x2409fe['uniqueid']]['channel']=_0x2409fe[_0x7cde('0xae')];}};Dialer[_0x7cde('0x1d')][_0x7cde('0x127')]=function(_0x556134){if(strategy[this[_0x7cde('0x22')][this[_0x7cde('0xa8')][_0x556134[_0x7cde('0x128')]][_0x7cde('0xb2')]][_0x7cde('0x4b')]]===_0x7cde('0x1c')){if(this[_0x7cde('0xa8')][_0x556134[_0x7cde('0x128')]]&&_[_0x7cde('0xac')](this[_0x7cde('0xa8')][_0x556134[_0x7cde('0x128')]][_0x7cde('0x129')])&&_0x556134[_0x7cde('0xad')]==='1'&&_0x556134[_0x7cde('0x12a')]==='0'){if(this[_0x7cde('0x24')][_0x556134[_0x7cde('0x12b')]]){if(!this[_0x7cde('0x24')][_0x556134['stateinterface']][_0x7cde('0x129')]){this[_0x7cde('0x24')][_0x556134['stateinterface']][_0x7cde('0x129')]=!![];this[_0x7cde('0xa8')][_0x556134['actionid']][_0x7cde('0x129')]=!![];this['actions'][_0x556134['actionid']][_0x7cde('0x12b')]=_0x556134[_0x7cde('0x12b')];}}}}else if((strategy[this['voiceQueues'][this['actions'][_0x556134[_0x7cde('0x128')]][_0x7cde('0xb2')]]['strategy']]||_0x7cde('0x1b'))==='rrmemory'){if(this[_0x7cde('0xa8')][_0x556134[_0x7cde('0x128')]]){if(this[_0x7cde('0x24')][_0x556134['stateinterface']]){this[_0x7cde('0xa8')][_0x556134['actionid']][_0x7cde('0x12b')]=_0x556134[_0x7cde('0x12b')];if(_[_0x7cde('0xac')](this[_0x7cde('0x2d')][this['actions'][_0x556134[_0x7cde('0x128')]][_0x7cde('0xb2')]])){this[_0x7cde('0x2d')][this[_0x7cde('0xa8')][_0x556134[_0x7cde('0x128')]][_0x7cde('0xb2')]]=[];}this[_0x7cde('0x2d')][this['actions'][_0x556134[_0x7cde('0x128')]][_0x7cde('0xb2')]][_0x7cde('0x12c')](_[_0x7cde('0x89')](_[_0x7cde('0xd1')](this[_0x7cde('0xa8')][_0x556134[_0x7cde('0x128')]],[_0x7cde('0x12d'),_0x7cde('0x12b')]),{'status':_0x556134[_0x7cde('0xad')],'paused':_0x556134[_0x7cde('0x12a')]}));}}}};function unlockQueueStatus(_0x1c68da,_0x4d2458){setTimeout(function(){if(_[_0x7cde('0x3d')](_0x1c68da[_0x7cde('0x12e')])){loggerBooked[_0x7cde('0x91')](_0x7cde('0x12f'),_0x4d2458);}_0x1c68da['queueStatusComplete']=!![];loggerBooked[_0x7cde('0x7b')](_0x7cde('0x130'),_0x4d2458,JSON[_0x7cde('0x131')](_['pick'](_0x1c68da,[_0x7cde('0x40'),_0x7cde('0x12e')])));},0x1f3);}Dialer[_0x7cde('0x1d')][_0x7cde('0x3a')]=function(_0x28d555){var _0x2a902b=this;var _0x4838f1=_0x2a902b[_0x7cde('0x22')][_0x2a902b['actions'][_0x28d555[_0x7cde('0x128')]][_0x7cde('0xb2')]];if(strategy[this['voiceQueues'][this['actions'][_0x28d555[_0x7cde('0x128')]]['queue']][_0x7cde('0x4b')]]===_0x7cde('0x1c')){if(this[_0x7cde('0xa8')][_0x28d555[_0x7cde('0x128')]]&&this['actions'][_0x28d555[_0x7cde('0x128')]][_0x7cde('0x12b')]){this['preview'][_0x7cde('0x132')](this[_0x7cde('0xa8')][_0x28d555[_0x7cde('0x128')]]['idHopper'],this[_0x7cde('0xa8')][_0x28d555[_0x7cde('0x128')]][_0x7cde('0x12b')])[_0x7cde('0xaf')](function(_0x229132){logger[_0x7cde('0x91')](_0x7cde('0x133'),util[_0x7cde('0x92')](_0x229132,{'showHidden':![],'depth':null}));})[_0x7cde('0x20')](function(){_0x2a902b[_0x7cde('0xb1')](_0x2a902b[_0x7cde('0x22')][_0x2a902b[_0x7cde('0xa8')][_0x28d555[_0x7cde('0x128')]][_0x7cde('0xb2')]]);_0x2a902b[_0x7cde('0x24')][_0x2a902b['actions'][_0x28d555[_0x7cde('0x128')]][_0x7cde('0x12b')]]['locked']=![];delete _0x2a902b[_0x7cde('0xa8')][_0x28d555[_0x7cde('0x128')]];unlockQueueStatus(_0x4838f1);});}else{this['updateOriginated'](this[_0x7cde('0x22')][this[_0x7cde('0xa8')][_0x28d555['actionid']][_0x7cde('0xb2')]]);this[_0x7cde('0xbf')]({'active':![],'ContactId':this[_0x7cde('0xa8')][_0x28d555[_0x7cde('0x128')]][_0x7cde('0xd2')],'ListId':this[_0x7cde('0xa8')][_0x28d555['actionid']][_0x7cde('0xd3')],'VoiceQueueId':this['actions'][_0x28d555[_0x7cde('0x128')]][_0x7cde('0xd5')]||undefined,'CampaignId':this[_0x7cde('0xa8')][_0x28d555['actionid']]['CampaignId']||undefined})[_0x7cde('0xaf')](loggerCatch(_0x7cde('0x134')));delete this[_0x7cde('0xa8')][_0x28d555[_0x7cde('0x128')]];unlockQueueStatus(_0x4838f1);}}else if((strategy[this['voiceQueues'][this[_0x7cde('0xa8')][_0x28d555[_0x7cde('0x128')]][_0x7cde('0xb2')]][_0x7cde('0x4b')]]||'rrmemory')===_0x7cde('0x1b')){var _0x4c8264;if(this['actions'][_0x28d555[_0x7cde('0x128')]]&&!_[_0x7cde('0x44')](this[_0x7cde('0x2d')][this[_0x7cde('0xa8')][_0x28d555[_0x7cde('0x128')]][_0x7cde('0xb2')]])){if(this[_0x7cde('0x2e')][_0x2a902b[_0x7cde('0xa8')][_0x28d555[_0x7cde('0x128')]][_0x7cde('0xb2')]]){this['queueBookedRR'][_0x2a902b[_0x7cde('0xa8')][_0x28d555['actionid']]['queue']]=this[_0x7cde('0x2e')][this['actions'][_0x28d555[_0x7cde('0x128')]][_0x7cde('0xb2')]]?this['queueBookedRR'][this['actions'][_0x28d555[_0x7cde('0x128')]][_0x7cde('0xb2')]]:this[_0x7cde('0x2d')][this[_0x7cde('0xa8')][_0x28d555['actionid']]['queue']]?this['queueBooked'][this[_0x7cde('0xa8')][_0x28d555[_0x7cde('0x128')]][_0x7cde('0xb2')]][_0x7cde('0x135')]||0x0:0x0;}this[_0x7cde('0x2d')][this[_0x7cde('0xa8')][_0x28d555['actionid']]['queue']]['_rr']=this[_0x7cde('0x2e')][this[_0x7cde('0xa8')][_0x28d555[_0x7cde('0x128')]][_0x7cde('0xb2')]];for(var _0x1c003e=0x0;_0x1c003e=0x0;})[_0x7cde('0xaf')](myreject(_0x3a1c13)));}}else{_0x581a8c['push'](ami[_0x7cde('0x14e')]({'action':_0x7cde('0x14f'),'command':util[_0x7cde('0x76')]('iftime\x20%s,%s',_0x3933e8,!_['isUndefined'](config[_0x7cde('0x14a')][_0x251e36])?_0x251e36:'')})['then'](function(_0x1041c7){return _0x1041c7['content']['indexOf'](_0x7cde('0x152'))>=0x0;})['catch'](myreject(_0x3a1c13)));}BPromise['all'](_0x581a8c)[_0x7cde('0xbc')](function(_0x1f975a){var _0x49f90d=_[_0x7cde('0x153')](_0x1f975a);if(_0x49f90d){return _0x26386f(_0x49f90d);}else{_0x11b31f[_0x7cde('0x3e')]=_0xd0cc7c?'GLOBAL_INTERVAL_IS_OVERTIME':_0x7cde('0x154');return _0x3a1c13(msgResponse(_0x7cde('0x155'),_0x7cde('0x146'),_0x7cde('0x156')+_0xd0cc7c+'\x20'+_0x6981e9+_0x7cde('0x157')+util['inspect'](_0x3933e8,{'showHidden':![],'depth':null})+_0x7cde('0x158')+_0x251e36));}})['catch'](function(_0x542eac){return _0x3a1c13(msgResponse(_0x7cde('0x145'),_0x7cde('0x146'),JSON[_0x7cde('0x131')](_0x542eac)));});});};Dialer[_0x7cde('0x1d')][_0x7cde('0x159')]=function(_0xb9309d){var _0x4cb405=this;return function(){switch(_0xb9309d[_0x7cde('0x59')]){case'progressive':freeVariablesPredictive(_0xb9309d);_0x4cb405[_0x7cde('0x15a')](_0xb9309d,0x1);break;case _0x7cde('0x15b'):freeVariablesPredictive(_0xb9309d);_0x4cb405[_0x7cde('0x15a')](_0xb9309d,_0xb9309d[_0x7cde('0x15c')]);break;case'predictive':_0x4cb405[_0x7cde('0x8')](_0xb9309d);break;case _0x7cde('0x7'):freeVariablesPredictive(_0xb9309d);_0x4cb405[_0x7cde('0x15a')](_0xb9309d,0x1);break;default:freeVariablesPredictive(_0xb9309d);logger[_0x7cde('0x91')](_0x7cde('0x15d'),_0xb9309d['name'],_0x7cde('0x15e'));}};};Dialer[_0x7cde('0x1d')][_0x7cde('0x15f')]=function(_0x51a029){var _0x174a31=this;return function(){_0x174a31[_0x7cde('0x160')](_0x51a029);};};Dialer['prototype']['syncQueueSummary']=function(_0x59e363){var _0x3cca4e=this;if(isNotPreview(_0x59e363['dialMethod'])){if(isVoiceQueueOutbound(_0x59e363['type'])&&isActive(_0x59e363[_0x7cde('0x58')])){_0x59e363[_0x7cde('0x9c')]=!![];BPromise['resolve']()[_0x7cde('0xbc')](checkIsLoggedIn(_0x59e363,_0x59e363[_0x7cde('0x4e')]))[_0x7cde('0xbc')](checkIsActive(_0x59e363,_0x59e363[_0x7cde('0x58')]))[_0x7cde('0xbc')](checkInterval(_0x59e363))[_0x7cde('0xbc')](_0x3cca4e[_0x7cde('0x161')](_0x59e363))[_0x7cde('0xbc')](_0x3cca4e[_0x7cde('0x144')](_0x59e363[_0x7cde('0x162')],_0x59e363[_0x7cde('0x163')],_0x59e363[_0x7cde('0x40')],_0x59e363))[_0x7cde('0xbc')](_0x3cca4e[_0x7cde('0x164')](_0x59e363['Interval'],_0x59e363[_0x7cde('0x163')],_0x59e363[_0x7cde('0x40')],_0x59e363))['then'](_0x3cca4e[_0x7cde('0x159')](_0x59e363))[_0x7cde('0xaf')](loggerCatchQueueSummary(_0x7cde('0x165'),_0x59e363));}else{notSendMessagesQueue(_0x59e363);}}else{freeVariablesPredictive(_0x59e363);}};Dialer[_0x7cde('0x1d')]['syncCampaigns']=function(){var _0x5131d6=this;var _0x4a09e9;for(var _0xc9c768 in this[_0x7cde('0x23')]){if(typeof this['campaigns'][_0xc9c768]!==_0x7cde('0xaa')){_0x4a09e9=this['campaigns'][_0xc9c768];if(isCampaignIvr(_0x4a09e9[_0x7cde('0x49')])&&isActive(_0x4a09e9[_0x7cde('0x74')])){_0x4a09e9['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0x7cde('0xbc')](checkIsActive(_0x4a09e9,_0x4a09e9[_0x7cde('0x74')]))['then'](checkInterval(_0x4a09e9))[_0x7cde('0xbc')](_0x5131d6['checkIsTrunkReachable'](_0x4a09e9))[_0x7cde('0xbc')](_0x5131d6[_0x7cde('0x144')](_0x4a09e9['dialGlobalInterval'],_0x4a09e9['dialTimezone'],_0x4a09e9[_0x7cde('0x40')],_0x4a09e9))['then'](_0x5131d6[_0x7cde('0x164')](_0x4a09e9[_0x7cde('0x41')],_0x4a09e9['dialTimezone'],_0x4a09e9['name'],_0x4a09e9))[_0x7cde('0xbc')](_0x5131d6[_0x7cde('0x15f')](_0x4a09e9))[_0x7cde('0xaf')](loggerCatchQueueSummary(_0x7cde('0x166'),_0x4a09e9));}else{notSendMessagesCampaign(_0x4a09e9);}}}};function getCallerIdRandom(_0x6d1990,_0x20d5bd){var _0x4f7713;var _0x3475d7;var _0x7ac35b;if(_0x20d5bd<=0x0){_0x20d5bd=0x1;}_0x4f7713=new RegExp(_0x7cde('0x167')+_0x20d5bd+'}$');_0x3475d7=Math[_0x7cde('0x168')](0xa,_0x20d5bd-0x1);_0x7ac35b=Math['pow'](0xa,_0x20d5bd)-0x1;return util[_0x7cde('0x76')]('%s',_[_0x7cde('0x169')](_0x6d1990,_0x4f7713,_[_0x7cde('0x16a')](_0x3475d7,_0x7ac35b)));}function extractCalleridName(_0x4a4b8b){var _0xf728c0=_0x4a4b8b['match'](/"(.*?)"/);return _0xf728c0?_0xf728c0[0x1]:_0x4a4b8b;}function extractCalleridNumber(_0x4a7a37){var _0x38241f=_0x4a7a37[_0x7cde('0x16b')](/<(.*?)>/);return _0x38241f?_0x38241f[0x1]:_0x4a7a37;}Dialer['prototype'][_0x7cde('0x16c')]=function(_0x91ec87,_0x3a4d19){var _0x158437=this;var _0x542ca6=uuid['v4']();this[_0x7cde('0xa8')][_0x542ca6]=new Action(_0x91ec87,_0x3a4d19,_0x542ca6);return new BPromise(function(_0x226f54,_0x3bf44c){if(_[_0x7cde('0x3d')](_0x91ec87)&&typeof _0x91ec87!==_0x7cde('0x16d')){return _0x3bf44c(msgResponse(_0x7cde('0x16e'),'Failure',_0x7cde('0x16f')));}if(_['isUndefined'](_0x3a4d19[_0x7cde('0x170')][_0x7cde('0x171')])||_0x3a4d19[_0x7cde('0x170')][_0x7cde('0x171')]===null){return _0x3bf44c(msgResponse(_0x7cde('0x16e'),_0x7cde('0x146'),_0x7cde('0x172')));}var _0x57fec3={'XMD-CALLERID':_0x158437['actions'][_0x542ca6]['getCaller'](),'XMD-AGI':_0x91ec87[_0x7cde('0x106')]?util[_0x7cde('0x76')](_0x7cde('0x173'),ipAgi,_0x91ec87['dialQueueProject']):_0x7cde('0x174'),'XMD-AGIAFTER':_0x91ec87[_0x7cde('0x10d')]?util['format'](_0x7cde('0x173'),ipAgi,_0x91ec87['dialQueueProject2']):'NONE','XMD-QUEUE':_0x91ec87[_0x7cde('0x49')]===_0x7cde('0x4a')?util[_0x7cde('0x76')](_0x7cde('0x175'),_0x91ec87[_0x7cde('0x40')],_0x91ec87['dialQueueOptions']||'',_0x91ec87[_0x7cde('0x10e')]?'c':'',_0x91ec87[_0x7cde('0x116')]||0x3):_0x7cde('0x174'),'XMD-CONTACTID':_0x3a4d19[_0x7cde('0xd2')],'XMD-CDRTYPE':_0x7cde('0x176'),'CALLERID(all)':_0x158437[_0x7cde('0xa8')][_0x542ca6][_0x7cde('0x177')](),'XMD-AMD':_0x91ec87['dialAMDActive']?_0x7cde('0x178'):_0x7cde('0x174'),'XMD-DESTINATION':_0x7cde('0x179')};if(_0x91ec87['dialAMDActive']){_0x57fec3[_0x7cde('0x17a')]=_0x91ec87[_0x7cde('0x17b')]||0x9c4;_0x57fec3[_0x7cde('0x17c')]=_0x91ec87['dialAMDGreeting']||0x5dc;_0x57fec3['XMD-AMDAFTERGREETINGSILENCE']=_0x91ec87[_0x7cde('0x17d')]||0x320;_0x57fec3[_0x7cde('0x17e')]=_0x91ec87[_0x7cde('0x17f')]||0x1388;_0x57fec3[_0x7cde('0x180')]=_0x91ec87[_0x7cde('0x181')]||0x64;_0x57fec3[_0x7cde('0x182')]=_0x91ec87[_0x7cde('0x183')]||0x32;_0x57fec3[_0x7cde('0x184')]=_0x91ec87[_0x7cde('0x185')]||0x3;_0x57fec3[_0x7cde('0x186')]=_0x91ec87[_0x7cde('0x187')]||0x100;_0x57fec3['XMD-AMDMAXIMUMWORDLENGTH']=_0x91ec87[_0x7cde('0x188')]||0x1388;}if(_0x91ec87['type']===_0x7cde('0x4a')){_0x57fec3['XMD-VOICEQUEUEID']=_0x3a4d19[_0x7cde('0xd5')];}else{_0x57fec3[_0x7cde('0x189')]=_0x3a4d19['CampaignId'];}for(var _0x416e41 in _0x3a4d19[_0x7cde('0x170')]){if(typeof _0x3a4d19[_0x7cde('0x170')][_0x416e41]!==_0x7cde('0xaa')){if(isNotNull(_0x3a4d19['Contact'][_0x416e41])&&_0x416e41!=='id'&&_0x416e41!==_0x7cde('0x18a')&&_0x416e41!==_0x7cde('0x18b')&&_0x416e41!=='updatedAt'){_0x57fec3[util[_0x7cde('0x76')](_0x7cde('0x18c'),_0x7cde('0x18d'),_[_0x7cde('0x18e')](_0x416e41))]=_0x3a4d19[_0x7cde('0x170')][_0x416e41];}}}var _0x4812de=_0x158437[_0x7cde('0xd9')](_0x91ec87[_0x7cde('0x73')])?getCallerId(_0x91ec87[_0x7cde('0x73')][_0x7cde('0x75')],_0x91ec87[_0x7cde('0x5a')],_0x91ec87[_0x7cde('0x18f')]>0x0?getCallerIdRandom(_0x91ec87[_0x7cde('0x190')],_0x91ec87[_0x7cde('0x18f')]):_0x91ec87['dialOriginateCallerIdNumber']):getCallerId(_[_0x7cde('0xac')](_0x91ec87[_0x7cde('0x142')])?_0x91ec87[_0x7cde('0x73')][_0x7cde('0x75')]:_0x91ec87[_0x7cde('0x142')][_0x7cde('0x75')],_0x91ec87[_0x7cde('0x5a')],_0x91ec87[_0x7cde('0x18f')]>0x0?getCallerIdRandom(_0x91ec87[_0x7cde('0x190')],_0x91ec87['dialRandomLastDigitCallerIdNumber']):_0x91ec87[_0x7cde('0x190')]);if(_0x4812de){_0x57fec3[_0x7cde('0x191')]=_0x158437['actions'][_0x542ca6][_0x7cde('0x192')]=extractCalleridName(_0x4812de);_0x57fec3[_0x7cde('0x193')]=_0x158437[_0x7cde('0xa8')][_0x542ca6][_0x7cde('0x194')]=extractCalleridNumber(_0x4812de);}return ami[_0x7cde('0x14e')]({'actionid':_0x542ca6,'action':_0x7cde('0x16e'),'channel':_0x158437['isTrunkReachable'](_0x91ec87[_0x7cde('0x73')])?util[_0x7cde('0x76')](_0x7cde('0x195'),_0x91ec87[_0x7cde('0x73')][_0x7cde('0x40')],isNotNull(_0x91ec87[_0x7cde('0x5c')])?_0x91ec87[_0x7cde('0x5c')][_0x7cde('0x196')]()||'':'',_0x91ec87[_0x7cde('0x197')]>0x0?_0x3a4d19['Contact'][_0x7cde('0x171')][_0x7cde('0x198')](_0x91ec87[_0x7cde('0x197')]):_0x3a4d19[_0x7cde('0x170')][_0x7cde('0x171')]):util[_0x7cde('0x76')](_0x7cde('0x195'),_['isNil'](_0x91ec87[_0x7cde('0x142')])?_0x91ec87[_0x7cde('0x73')]['name']:_0x91ec87[_0x7cde('0x142')]['name'],isNotNull(_0x91ec87[_0x7cde('0x5c')])?_0x91ec87['dialPrefix']['trim']()||'':'',_0x91ec87['dialCutDigit']>0x0?_0x3a4d19[_0x7cde('0x170')][_0x7cde('0x171')][_0x7cde('0x198')](_0x91ec87['dialCutDigit']):_0x3a4d19['Contact']['phone']),'callerid':_0x4812de,'Exten':_0x7cde('0x179'),'Context':_0x7cde('0x199'),'Priority':'1','variable':_0x57fec3,'timeout':(_0x91ec87['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x542ca6})['then'](function(_0x147d06){return _0x226f54(_0x147d06);})[_0x7cde('0xaf')](function(_0x36a2e8){_0x91ec87['outboundOriginateFailureCallsDay']+=0x1;var _0x555b2b=new History(_0x158437[_0x7cde('0xa8')][_0x542ca6]);logger[_0x7cde('0x91')](util[_0x7cde('0x76')]('[originateError]:\x20%s',JSON[_0x7cde('0x131')](_0x36a2e8)));_0x555b2b['state']=0xe;_0x555b2b[_0x7cde('0xa4')]='OriginateError';_0x555b2b['starttime']=moment()[_0x7cde('0x76')](_0x7cde('0xfa'));_0x555b2b[_0x7cde('0xa5')]=_0x555b2b[_0x7cde('0xa6')];_0x158437[_0x7cde('0xca')](_0x555b2b)[_0x7cde('0xaf')](loggerCatch(_0x7cde('0x19a')));_0x158437[_0x7cde('0xc8')](_0x555b2b)['catch'](loggerCatch(_0x7cde('0x19a')))[_0x7cde('0x20')](function(){delete _0x158437[_0x7cde('0xa8')][_0x542ca6];return _0x3bf44c(msgResponse(_0x7cde('0x16e'),_0x7cde('0x46'),'originate\x20action\x20Error'));});});});};Dialer[_0x7cde('0x1d')]['syncOriginateResponse']=function(_0x37761d){var _0x387039=this[_0x7cde('0xa8')][_0x37761d[_0x7cde('0x128')]];if(_0x387039){delete this[_0x7cde('0xa8')][_0x37761d[_0x7cde('0x128')]];_0x387039[_0x7cde('0x115')]=moment()['format'](_0x7cde('0xfa'));var _0x6f11fd=_0x387039['type']===_0x7cde('0xdf')?this[_0x7cde('0x23')][_0x387039[_0x7cde('0xb2')]]:this[_0x7cde('0x22')][_0x387039[_0x7cde('0x19b')]()];if(!this[_0x7cde('0x19c')](_0x37761d[_0x7cde('0x19d')])){this[_0x7cde('0xb1')](_0x6f11fd);return this[_0x7cde('0x19e')](_0x387039,_0x6f11fd,_0x37761d)['catch'](loggerCatch(_0x7cde('0x19f')));}this[_0x7cde('0x29')][_0x37761d[_0x7cde('0xdd')]]=_0x387039;}};Dialer[_0x7cde('0x1d')][_0x7cde('0x1a0')]=function(_0xf2a8dd,_0x3025af,_0x4bddd4){var _0x36b5cb=new History(_0x3025af);if(_0x36b5cb[_0x7cde('0xec')]+_0x36b5cb['countcongestionretry']+_0x36b5cb[_0x7cde('0xee')]+_0x36b5cb[_0x7cde('0xef')]+_0x36b5cb[_0x7cde('0xf0')]+_0x36b5cb[_0x7cde('0x100')]+_0x36b5cb[_0x7cde('0xf1')]+_0x36b5cb[_0x7cde('0xf2')]>=_0x4bddd4[_0x7cde('0xf3')]-0x1){return!![];}switch(_0xf2a8dd){case 0x3:if(_0x36b5cb[_0x7cde('0xee')]>=_0x4bddd4['dialNoAnswerMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x36b5cb[_0x7cde('0xee')]+=0x1,'scheduledat':moment()['add'](_0x4bddd4[_0x7cde('0x1a1')],_0x7cde('0xf9'))['format'](_0x7cde('0xfa')),'ContactId':_0x36b5cb[_0x7cde('0xd2')],'ListId':_0x36b5cb[_0x7cde('0xd3')],'VoiceQueueId':_0x36b5cb[_0x7cde('0xd5')]||undefined,'CampaignId':_0x36b5cb[_0x7cde('0x103')]||undefined})['catch'](loggerCatch(_0x7cde('0x1a2')));break;case 0x5:if(_0x36b5cb[_0x7cde('0xec')]>=_0x4bddd4[_0x7cde('0x1a3')]-0x1){return!![];}this[_0x7cde('0xbf')]({'active':![],'countbusyretry':_0x36b5cb[_0x7cde('0xec')]+=0x1,'scheduledat':moment()[_0x7cde('0xf8')](_0x4bddd4[_0x7cde('0x1a4')],_0x7cde('0xf9'))[_0x7cde('0x76')](_0x7cde('0xfa')),'ContactId':_0x36b5cb[_0x7cde('0xd2')],'ListId':_0x36b5cb[_0x7cde('0xd3')],'VoiceQueueId':_0x36b5cb[_0x7cde('0xd5')]||undefined,'CampaignId':_0x36b5cb['CampaignId']||undefined})[_0x7cde('0xaf')](loggerCatch(_0x7cde('0x1a5')));break;case 0x8:if(_0x36b5cb['countcongestionretry']>=_0x4bddd4[_0x7cde('0x1a6')]-0x1){return!![];}this[_0x7cde('0xbf')]({'active':![],'countcongestionretry':_0x36b5cb[_0x7cde('0xed')]+=0x1,'scheduledat':moment()[_0x7cde('0xf8')](_0x4bddd4[_0x7cde('0x1a7')],_0x7cde('0xf9'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x36b5cb['ContactId'],'ListId':_0x36b5cb[_0x7cde('0xd3')],'VoiceQueueId':_0x36b5cb[_0x7cde('0xd5')]||undefined,'CampaignId':_0x36b5cb[_0x7cde('0x103')]||undefined})[_0x7cde('0xaf')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x36b5cb['countnosuchnumberretry']>=_0x4bddd4['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x7cde('0xbf')]({'active':![],'countnosuchnumberretry':_0x36b5cb['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x7cde('0xf8')](_0x4bddd4[_0x7cde('0x1a8')],_0x7cde('0xf9'))[_0x7cde('0x76')](_0x7cde('0xfa')),'ContactId':_0x36b5cb[_0x7cde('0xd2')],'ListId':_0x36b5cb[_0x7cde('0xd3')],'VoiceQueueId':_0x36b5cb[_0x7cde('0xd5')]||undefined,'CampaignId':_0x36b5cb['CampaignId']||undefined})[_0x7cde('0xaf')](loggerCatch(_0x7cde('0x1a9')));}break;case 0xa:if(_0x36b5cb['countdropretry']>=_0x4bddd4[_0x7cde('0x119')]-0x1){return!![];}this[_0x7cde('0xbf')]({'active':![],'countdropretry':_0x36b5cb['countdropretry']+=0x1,'scheduledat':moment()[_0x7cde('0xf8')](_0x4bddd4[_0x7cde('0x11a')],_0x7cde('0xf9'))[_0x7cde('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x36b5cb[_0x7cde('0xd2')],'ListId':_0x36b5cb[_0x7cde('0xd3')],'VoiceQueueId':_0x36b5cb[_0x7cde('0xd5')]||undefined,'CampaignId':_0x36b5cb[_0x7cde('0x103')]||undefined})[_0x7cde('0xaf')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x36b5cb[_0x7cde('0x100')]>=_0x4bddd4[_0x7cde('0x123')]-0x1){return!![];}this[_0x7cde('0xbf')]({'active':![],'countabandonedretry':_0x36b5cb['countabandonedretry']+=0x1,'scheduledat':moment()[_0x7cde('0xf8')](_0x4bddd4['dialAbandonedRetryFrequency'],_0x7cde('0xf9'))[_0x7cde('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x36b5cb[_0x7cde('0xd2')],'ListId':_0x36b5cb[_0x7cde('0xd3')],'VoiceQueueId':_0x36b5cb[_0x7cde('0xd5')]||undefined,'CampaignId':_0x36b5cb[_0x7cde('0x103')]||undefined})['catch'](loggerCatch(_0x7cde('0x125')));break;case 0x13:if(_0x36b5cb['countmachineretry']>=_0x4bddd4[_0x7cde('0xf5')]-0x1){return!![];}this[_0x7cde('0xbf')]({'active':![],'countmachineretry':_0x36b5cb[_0x7cde('0xf1')]+=0x1,'scheduledat':moment()[_0x7cde('0xf8')](_0x4bddd4[_0x7cde('0x102')],_0x7cde('0xf9'))[_0x7cde('0x76')](_0x7cde('0xfa')),'ContactId':_0x36b5cb['ContactId'],'ListId':_0x36b5cb['ListId'],'VoiceQueueId':_0x36b5cb[_0x7cde('0xd5')]||undefined,'CampaignId':_0x36b5cb[_0x7cde('0x103')]||undefined})['catch'](loggerCatch(_0x7cde('0xfb')));break;case 0x14:if(_0x36b5cb[_0x7cde('0xf2')]>=_0x4bddd4[_0x7cde('0x1aa')]-0x1){return!![];}this[_0x7cde('0xbf')]({'active':![],'countagentrejectretry':_0x36b5cb[_0x7cde('0xf2')]+=0x1,'scheduledat':moment()[_0x7cde('0xf8')](_0x4bddd4[_0x7cde('0x1ab')],_0x7cde('0xf9'))[_0x7cde('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x36b5cb[_0x7cde('0xd2')],'ListId':_0x36b5cb[_0x7cde('0xd3')],'VoiceQueueId':_0x36b5cb[_0x7cde('0xd5')]||undefined,'CampaignId':_0x36b5cb[_0x7cde('0x103')]||undefined})[_0x7cde('0xaf')](loggerCatch(_0x7cde('0x1ac')));break;default:return!![];}};Dialer[_0x7cde('0x1d')][_0x7cde('0x19e')]=function(_0x359567,_0x4c2ab6,_0x390d01){var _0x19dfb3=this;var _0x3c399b=new History(_0x359567);return new BPromise(function(_0x48dd30,_0x177c5c){if(_[_0x7cde('0x3d')](_0x4c2ab6)&&typeof _0x4c2ab6!==_0x7cde('0x16d')){return _0x177c5c(msgResponse(_0x7cde('0x1ad'),_0x7cde('0x146'),_0x7cde('0x1ae')));}if(_['isUndefined'](_0x390d01)&&typeof _0x390d01!==_0x7cde('0x16d')){return _0x177c5c(msgResponse('[callProgressDetecting]','Failure',_0x7cde('0x1af')));}switch(_0x390d01[_0x7cde('0x10b')]){case'0':_0x4c2ab6['outboundNoSuchCallsDay']+=0x1;_0x3c399b[_0x7cde('0xa3')]=0x0;_0x3c399b[_0x7cde('0xa4')]=_0x7cde('0x1b0');_0x3c399b['countnosuchnumberretry']+=0x1;_0x3c399b[_0x7cde('0xeb')]+=0x1;ami[_0x7cde('0x48')](_0x7cde('0x1b1'),ut[_0x7cde('0xe7')](_0x359567,_0x7cde('0x1b2')));_0x19dfb3[_0x7cde('0xca')](_0x3c399b)[_0x7cde('0xaf')](loggerCatch(_0x7cde('0xff')));if(_0x19dfb3[_0x7cde('0x1a0')](0x0,_0x359567,_0x4c2ab6)){if(_0x3c399b[_0x7cde('0xef')]>=_0x4c2ab6[_0x7cde('0x1b3')]){_0x19dfb3[_0x7cde('0xf6')](_0x3c399b,_0x48dd30,_0x177c5c,_0x7cde('0x1b4'));}else{_0x19dfb3['stateGlobal'](_0x3c399b,_0x48dd30,_0x177c5c,_0x7cde('0x1b4'));}}break;case'3':_0x4c2ab6['outboundNoAnswerCallsDay']+=0x1;_0x3c399b[_0x7cde('0xa3')]=0x3;_0x3c399b['statedesc']=_0x7cde('0x1b5');_0x3c399b[_0x7cde('0xee')]+=0x1;_0x3c399b[_0x7cde('0xeb')]+=0x1;ami['emit'](_0x7cde('0x1b6'),ut['buildObj'](_0x359567,'noanswer'));_0x19dfb3['createHistory'](_0x3c399b)[_0x7cde('0xaf')](loggerCatch(_0x7cde('0x1b7')));if(_0x19dfb3[_0x7cde('0x1a0')](0x3,_0x359567,_0x4c2ab6)){if(_0x3c399b[_0x7cde('0xee')]>=_0x4c2ab6[_0x7cde('0x1b8')]){_0x19dfb3['createStateFinal'](_0x3c399b,_0x48dd30,_0x177c5c,'reason\x203\x20ringing\x20no\x20answer');}else{_0x19dfb3[_0x7cde('0x101')](_0x3c399b,_0x48dd30,_0x177c5c,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x4c2ab6[_0x7cde('0x60')]+=0x1;_0x3c399b[_0x7cde('0xa3')]=0x5;_0x3c399b[_0x7cde('0xa4')]=_0x7cde('0x1b9');_0x3c399b['countbusyretry']+=0x1;_0x3c399b['countglobal']+=0x1;ami[_0x7cde('0x48')](_0x7cde('0x1ba'),ut[_0x7cde('0xe7')](_0x359567,_0x7cde('0x1bb')));_0x19dfb3[_0x7cde('0xca')](_0x3c399b)['catch'](loggerCatch(_0x7cde('0x1bc')));if(_0x19dfb3[_0x7cde('0x1a0')](0x5,_0x359567,_0x4c2ab6)){if(_0x3c399b[_0x7cde('0xec')]>=_0x4c2ab6[_0x7cde('0x1a3')]){_0x19dfb3[_0x7cde('0xf6')](_0x3c399b,_0x48dd30,_0x177c5c,'reason\x205\x20busy');}else{_0x19dfb3[_0x7cde('0x101')](_0x3c399b,_0x48dd30,_0x177c5c,'reason\x205\x20busy');}}break;case'8':_0x4c2ab6[_0x7cde('0x61')]+=0x1;_0x3c399b[_0x7cde('0xa3')]=0x8;_0x3c399b[_0x7cde('0xa4')]=_0x7cde('0x1bd');_0x3c399b[_0x7cde('0xed')]+=0x1;_0x3c399b[_0x7cde('0xeb')]+=0x1;ami['emit'](_0x7cde('0x1be'),ut['buildObj'](_0x359567,'congestion'));_0x19dfb3[_0x7cde('0xca')](_0x3c399b)['catch'](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x19dfb3[_0x7cde('0x1a0')](0x8,_0x359567,_0x4c2ab6)){if(_0x3c399b[_0x7cde('0xed')]>=_0x4c2ab6[_0x7cde('0x1a6')]){_0x19dfb3['createStateFinal'](_0x3c399b,_0x48dd30,_0x177c5c,_0x7cde('0x1bf'));}else{_0x19dfb3[_0x7cde('0x101')](_0x3c399b,_0x48dd30,_0x177c5c,'reason\x208\x20congestion');}}break;case'11':_0x4c2ab6[_0x7cde('0x1c0')]+=0x1;_0x3c399b['state']=0xb;_0x3c399b[_0x7cde('0xa4')]=_0x7cde('0x120');_0x3c399b['countabandonedretry']+=0x1;_0x3c399b[_0x7cde('0xeb')]+=0x1;_0x19dfb3['createHistory'](_0x3c399b)[_0x7cde('0xaf')](loggerCatch(_0x7cde('0x1c1')));if(_0x19dfb3[_0x7cde('0x1a0')](0xb,_0x359567,_0x4c2ab6)){if(_0x3c399b[_0x7cde('0x100')]>=_0x4c2ab6[_0x7cde('0x123')]){_0x19dfb3[_0x7cde('0xf6')](_0x3c399b,_0x48dd30,_0x177c5c,_0x7cde('0x1c2'));}else{_0x19dfb3[_0x7cde('0x101')](_0x3c399b,_0x48dd30,_0x177c5c,'reason\x2011\x20abandoned');}}break;case'20':_0x4c2ab6['outboundRejectCallsDay']+=0x1;_0x3c399b[_0x7cde('0xa3')]=0x14;_0x3c399b['statedesc']=_0x7cde('0x1c3');_0x3c399b[_0x7cde('0xf2')]+=0x1;_0x3c399b['countglobal']+=0x1;ami[_0x7cde('0x48')](_0x7cde('0x1c4'),ut[_0x7cde('0xe7')](_0x359567,_0x7cde('0x1c5')));_0x19dfb3[_0x7cde('0xca')](_0x3c399b)['catch'](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x19dfb3[_0x7cde('0x1a0')](0x14,_0x359567,_0x4c2ab6)){if(_0x3c399b[_0x7cde('0xf2')]>=_0x4c2ab6[_0x7cde('0x1aa')]){_0x19dfb3[_0x7cde('0xf6')](_0x3c399b,_0x48dd30,_0x177c5c,_0x7cde('0x1c6'));}else{_0x19dfb3[_0x7cde('0x101')](_0x3c399b,_0x48dd30,_0x177c5c,_0x7cde('0x1c6'));}}break;default:_0x4c2ab6[_0x7cde('0x67')]+=0x1;_0x3c399b[_0x7cde('0xa3')]=0xc;_0x3c399b['statedesc']=_0x390d01[_0x7cde('0x10b')];_0x19dfb3[_0x7cde('0xca')](_0x3c399b)[_0x7cde('0xaf')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x19dfb3[_0x7cde('0x1a0')](_0x390d01['reason'],_0x359567,_0x4c2ab6)){if(_0x3c399b[_0x7cde('0xec')]+_0x3c399b[_0x7cde('0xed')]+_0x3c399b[_0x7cde('0xee')]+_0x3c399b[_0x7cde('0xef')]+_0x3c399b[_0x7cde('0xf0')]+_0x3c399b['countabandonedretry']+_0x3c399b[_0x7cde('0xf1')]+_0x3c399b[_0x7cde('0xf2')]>=_0x4c2ab6[_0x7cde('0xf3')]){_0x19dfb3[_0x7cde('0x101')](_0x3c399b,_0x48dd30,_0x177c5c,_0x390d01['reason']);}else{_0x19dfb3[_0x7cde('0xf6')](_0x3c399b,_0x48dd30,_0x177c5c,_0x390d01[_0x7cde('0x10b')]);}}}});};Dialer[_0x7cde('0x1d')][_0x7cde('0x101')]=function(_0x134345,_0x4aaf92,_0x2d8cba,_0x4fd133){var _0x2fd3ca=new Final(_0x134345);_0x2fd3ca['state']=0xf;_0x2fd3ca['statedesc']='Global';this[_0x7cde('0xf6')](_0x2fd3ca,_0x4aaf92,_0x2d8cba,_0x4fd133);};Dialer[_0x7cde('0x1d')][_0x7cde('0xf6')]=function(_0x397f5b,_0x2b6614,_0x2f19fc,_0x1277f9){this[_0x7cde('0xc8')](_0x397f5b)[_0x7cde('0xbc')](function(){return _0x2b6614(msgResponse(_0x7cde('0x1ad'),_0x7cde('0xd8'),_0x1277f9));})[_0x7cde('0xaf')](function(){return _0x2f19fc(msgResponse(_0x7cde('0x1c7'),'Failure','contact\x20not\x20moved'));});};Dialer[_0x7cde('0x1d')][_0x7cde('0x8')]=function(_0x1b8698){var _0x27889a=_0x1b8698[_0x7cde('0x1c8')]/0x64;var _0xfb3934=_0x1b8698[_0x7cde('0x63')]/(_0x1b8698[_0x7cde('0x63')]+_0x1b8698[_0x7cde('0x5e')]);var _0x21c691=Math[_0x7cde('0x1c9')](_0x1b8698[_0x7cde('0x6d')]*(_0x1b8698[_0x7cde('0x1ca')]/0x64));var _0x18be0c=Math['round'](_0x1b8698[_0x7cde('0x6d')]*(_0x1b8698[_0x7cde('0x1cb')]/0x64));var _0x1ee8bc=_0x1b8698[_0x7cde('0x4d')]+_0x1b8698[_0x7cde('0x53')];var _0x30c28b=Math[_0x7cde('0x1cc')](_0x1b8698['erlangCalls']*_0x1b8698['erlangAbandonmentRate']*_0x1b8698[_0x7cde('0x6c')]*_0x1b8698['predictiveIntervalMultiplicativeFactor']);if(_['isUndefined'](_0x1b8698[_0x7cde('0x2b')])){if(!_[_0x7cde('0x3d')](_0x1b8698[_0x7cde('0x72')])){_0x1b8698['startPredictive']=undefined;loggerPredictive[_0x7cde('0x91')]('[startMethodPredictive][StartProgressive]',_0x7cde('0x1cd'));}if(!_['isUndefined'](_0x1b8698[_0x7cde('0x8d')])){loggerPredictive['error'](_0x7cde('0x1ce'),_0x7cde('0x1cf'));clearInterval(_0x1b8698[_0x7cde('0x8d')]);_0x1b8698[_0x7cde('0x8d')]=undefined;}_0x1b8698['startProgressive']=moment()[_0x7cde('0x76')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x7cde('0x7b')](_0x1b8698['name'],_0x7cde('0x1d0'),_0x1b8698[_0x7cde('0x2b')]);this[_0x7cde('0x15a')](_0x1b8698,0x1);}else if(ifInterval(_0x1b8698[_0x7cde('0x1d1')],_0x1b8698[_0x7cde('0x2b')])){this[_0x7cde('0x15a')](_0x1b8698,0x1);loggerPredictiveCalls[_0x7cde('0x7b')](_0x7cde('0x1d2'),_0x1b8698[_0x7cde('0x2b')],_0x1b8698[_0x7cde('0x40')]);_0x1b8698[_0x7cde('0x1d3')]=0x0;_0x1b8698[_0x7cde('0x117')]=0x0;}else if(_0x27889a<_0xfb3934&&_0x1b8698[_0x7cde('0x1d4')]===_0x7cde('0x1d5')){freeVariablesPredictive(_0x1b8698);loggerPredictive[_0x7cde('0x7b')](_0x7cde('0x1d6'),_0x7cde('0x1d7'),_0xfb3934,'startProgressive',_0x1b8698['name']);}else if(_0x30c28b<_0x1b8698[_0x7cde('0x117')]&&_0x1b8698[_0x7cde('0x1d4')]===_0x7cde('0x1d5')){freeVariablesPredictive(_0x1b8698);loggerPredictive['info'](_0x7cde('0x1d8'),_0x7cde('0x1d9'),_0x30c28b,'Drop\x20in\x20this\x20interval',_0x1b8698['predictiveIntervalErlangCallsDroppedCalls'],_0x7cde('0x2b'),_0x1b8698[_0x7cde('0x40')]);}else if(!ifInterval(_0x1b8698[_0x7cde('0x1d1')],_0x1b8698[_0x7cde('0x2b')])&&_[_0x7cde('0x3d')](_0x1b8698[_0x7cde('0x72')])&&!_[_0x7cde('0x3d')](_0x1b8698[_0x7cde('0x2b')])){_0x1b8698[_0x7cde('0x72')]=moment()[_0x7cde('0x76')](_0x7cde('0xfa'));loggerPredictive[_0x7cde('0x7b')](_0x1b8698['name'],_0x7cde('0x1da'),_0x1b8698[_0x7cde('0x72')]);this[_0x7cde('0xbb')](_0x1b8698[_0x7cde('0x1d1')])[_0x7cde('0xbc')](this[_0x7cde('0x1db')](_0x1b8698))[_0x7cde('0xbc')](mergeDataErlangB(_0x1b8698))['then'](this['startMethodPredictive'](_0x1b8698))[_0x7cde('0xaf')](loggerCatchPredictive(_0x7cde('0x1dc'),_0x1b8698));}else if(!ifInterval(_0x1b8698['dialPredictiveInterval'],_0x1b8698[_0x7cde('0x72')])){_0x1b8698[_0x7cde('0x117')]=0x0;_0x1b8698[_0x7cde('0x72')]=moment()[_0x7cde('0x76')](_0x7cde('0xfa'));loggerPredictive[_0x7cde('0x7b')](_0x1b8698['name'],'recalculate\x20predictive\x20at',_0x1b8698[_0x7cde('0x72')]);clearInterval(_0x1b8698[_0x7cde('0x8d')]);_0x1b8698[_0x7cde('0x8d')]=undefined;this[_0x7cde('0xbb')](_0x1b8698['dialPredictiveInterval'])[_0x7cde('0xbc')](this[_0x7cde('0x1db')](_0x1b8698))[_0x7cde('0xbc')](mergeDataErlangB(_0x1b8698))[_0x7cde('0xbc')](this[_0x7cde('0x1dd')](_0x1b8698))[_0x7cde('0xaf')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x1b8698));}else if(_0x1b8698['predictiveIntervalAvailable']&&_0x1ee8bc<_0x1b8698[_0x7cde('0x6d')]-_0x18be0c){freeVariablesPredictive(_0x1b8698);loggerPredictive[_0x7cde('0x7b')](_0x1b8698[_0x7cde('0x40')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x1ee8bc,')\x20are\x20less\x20than\x20threshold\x20(',_0x1b8698[_0x7cde('0x6d')],'-',_0x18be0c,'=',_0x1b8698[_0x7cde('0x6d')]-_0x18be0c,')');}else if(_0x1b8698[_0x7cde('0x6d')]&&_0x1ee8bc>_0x1b8698['predictiveIntervalAvailable']+_0x21c691){freeVariablesPredictive(_0x1b8698);loggerPredictive['info'](_0x1b8698[_0x7cde('0x40')],_0x7cde('0x1de'),_0x1ee8bc,_0x7cde('0x1df'),_0x1b8698[_0x7cde('0x6d')],'+',_0x21c691,'=',_0x1b8698[_0x7cde('0x6d')]+_0x21c691,')');}};Dialer[_0x7cde('0x1d')]['getDataPredictive']=function(_0x44df16){var _0x1c33ae=this;return function(_0x502b4a){return new BPromise(function(_0x525e74,_0x4a2213){_[_0x7cde('0x89')](_0x44df16,_0x502b4a[0x0]);if(checkGetDataPredictive(_0x502b4a[0x0])){var _0x15fe3b=_0x44df16[_0x7cde('0x6d')]=_0x44df16[_0x7cde('0x53')]+_0x44df16['available'];var _0xcafa41=_0x44df16[_0x7cde('0x1d1')]*0x3c;var _0x2c18fa=_0x502b4a[0x0]['predictiveIntervalAvgTalktime']+_0x502b4a[0x0][_0x7cde('0x69')];var _0xf558c5=(_0x502b4a[0x0][_0x7cde('0x68')]+_0x502b4a[0x0][_0x7cde('0x6a')]+_0x502b4a[0x0][_0x7cde('0x11f')])/_0x502b4a[0x0][_0x7cde('0x6e')];_0x44df16[_0x7cde('0x6c')]=_0xf558c5>0x0?_0xf558c5:0x1;switch(_0x44df16[_0x7cde('0x1d4')]){case'dropRate':var _0x534fef=_0x44df16[_0x7cde('0x1c8')]/0x64;return _0x1c33ae['abandonmentRate'](_0x15fe3b,_0xcafa41,_0x2c18fa,_0xf558c5,_0x534fef)[_0x7cde('0xbc')](function(_0x103b9a){return _0x525e74(_0x103b9a);});case'agentBusyFactor':var _0x35bdc6=_0x44df16[_0x7cde('0x1c8')]/0x64;return _0x1c33ae['busyFactor'](_0x15fe3b,_0xcafa41,_0x2c18fa,_0xf558c5,_0x35bdc6)[_0x7cde('0xbc')](function(_0xad9cfd){return _0x525e74(_0xad9cfd);});default:return _0x4a2213(msgResponse(_0x7cde('0x1e0'),_0x7cde('0x146'),_0x7cde('0x1e1')));}}else{return _0x4a2213(msgResponse(_0x7cde('0x1e0'),'Failure','check\x20failure'));}});};};Dialer[_0x7cde('0x1d')][_0x7cde('0x1e2')]=function(_0x26b8a0){var _0x132c0d=this;return function(_0x5bf8f6){return new BPromise(function(_0x22da5e,_0x964b34){_['merge'](_0x26b8a0,_0x5bf8f6[0x0]);if(checkGetDataPredictive(_0x5bf8f6[0x0])){loggerPredictive[_0x7cde('0x7b')](JSON[_0x7cde('0x131')](_0x5bf8f6[0x0]));if(_0x26b8a0[_0x7cde('0x1d4')]===_0x7cde('0x1d5')){return _0x132c0d['getVoiceQueueRtPauses'](_0x26b8a0['id'])['then'](function(_0x490cf4){var _0x49ea13=_0x26b8a0[_0x7cde('0x4e')]-_0x490cf4[0x0][_0x7cde('0x1e3')];var _0x3c5830=_0x26b8a0[_0x7cde('0x1d1')]*0x3c;var _0x47fd48=_0x5bf8f6[0x0][_0x7cde('0x81')]+_0x5bf8f6[0x0][_0x7cde('0x69')];var _0x2b18c3=(_0x5bf8f6[0x0][_0x7cde('0x68')]+_0x5bf8f6[0x0][_0x7cde('0x6a')]+_0x5bf8f6[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x5bf8f6[0x0][_0x7cde('0x6e')];var _0xdcff2a=_0x26b8a0[_0x7cde('0x1c8')]/0x64;_0x26b8a0[_0x7cde('0x1e4')]=_0x490cf4[0x0][_0x7cde('0x1e3')]||0x0;_0x26b8a0[_0x7cde('0x6c')]=_0x2b18c3>0x0?_0x2b18c3:0x1;return _0x132c0d[_0x7cde('0x1e5')](_0x49ea13,_0x3c5830,_0x47fd48,_0x2b18c3,_0xdcff2a);})[_0x7cde('0xbc')](function(_0x49b15b){return _0x22da5e(_0x49b15b);})[_0x7cde('0xaf')](function(_0x2f0ed6){return _0x964b34(msgResponse('[CatchErlangB]',_0x7cde('0x146'),JSON['stringify'](_0x2f0ed6)));});}if(_0x26b8a0[_0x7cde('0x1d4')]===_0x7cde('0x1e6')){return _0x132c0d[_0x7cde('0xc6')](_0x26b8a0['id'])[_0x7cde('0xbc')](function(_0x54ae79){var _0x1fd4e0=_0x26b8a0[_0x7cde('0x4e')]-_0x54ae79[0x0]['outboundQueuePauses'];var _0x4dabfe=_0x26b8a0['dialPredictiveInterval']*0x3c;var _0x33acde=_0x5bf8f6[0x0][_0x7cde('0x81')]+_0x5bf8f6[0x0][_0x7cde('0x69')];var _0x2dca68=(_0x5bf8f6[0x0][_0x7cde('0x68')]+_0x5bf8f6[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x5bf8f6[0x0][_0x7cde('0x11f')])/_0x5bf8f6[0x0]['predictiveIntervalTotalCalls'];var _0x1ae81e=_0x26b8a0['dialPredictiveOptimizationPercentage']/0x64;_0x26b8a0[_0x7cde('0x1e4')]=_0x54ae79[0x0]['outboundQueuePauses']||0x0;_0x26b8a0[_0x7cde('0x6c')]=_0x2dca68>0x0?_0x2dca68:0x1;return _0x132c0d['busyFactor'](_0x1fd4e0,_0x4dabfe,_0x33acde,_0x2dca68,_0x1ae81e);})[_0x7cde('0xbc')](function(_0x2e8f59){return _0x22da5e(_0x2e8f59);})[_0x7cde('0xaf')](function(_0x1ca8a9){return _0x964b34(msgResponse(_0x7cde('0x1e7'),_0x7cde('0x146'),JSON[_0x7cde('0x131')](_0x1ca8a9)));});}}else{return _0x964b34(msgResponse(_0x7cde('0x1e0'),_0x7cde('0x146'),_0x7cde('0x1e8')));}});};};Dialer[_0x7cde('0x1d')]['startMethodPredictive']=function(_0x1fecdc){var _0xf54f56=this;return function(){var _0x137e6d=0x0;var _0x3f7596=Math[_0x7cde('0x1cc')](_0x1fecdc[_0x7cde('0x6f')]*0x3e8);if(_0x3f7596>0x0){_0x3f7596=_0x3f7596<0x64?0x64:_0x3f7596;loggerPredictive[_0x7cde('0x7b')](_0x1fecdc[_0x7cde('0x40')],_0x7cde('0x1e9'),_0x3f7596,_0x7cde('0x47'));_0x1fecdc[_0x7cde('0x8d')]=setInterval(function(){_0xf54f56[_0x7cde('0x8d')](_0x1fecdc);loggerPredictiveCalls[_0x7cde('0x7b')](_0x7cde('0x1ea'),_0x137e6d+=0x1);},_0x3f7596);}else{loggerPredictive[_0x7cde('0x7b')](_0x1fecdc[_0x7cde('0x40')],_0x7cde('0x1eb'));}};};Dialer[_0x7cde('0x1d')]['checkContactBlack']=function(_0x1b4776,_0x576eb7){var _0x28ed67=this;return function(_0x3919b7){if(_['isEmpty'](_0x3919b7)){if(_[_0x7cde('0xac')](_0x576eb7[_0x7cde('0xd4')])||!_0x576eb7[_0x7cde('0x1ec')]){if(_0x1b4776['dialMethod']===_0x7cde('0x7')){_0x1b4776[_0x7cde('0x12e')]=_[_0x7cde('0x3d')](_0x1b4776[_0x7cde('0x12e')])?!![]:_0x1b4776[_0x7cde('0x12e')];var _0x19775f=uuid['v4']();_0x28ed67['actions'][_0x19775f]=new Action(_0x1b4776,_0x576eb7,_0x19775f);loggerBooked['info'](_0x7cde('0x1ed'),_0x19775f,_0x7cde('0x1ee'),JSON[_0x7cde('0x131')](_0x1b4776[_0x7cde('0x12e')]),_0x7cde('0x1ef'),_0x1b4776['name']);if(_0x1b4776[_0x7cde('0x12e')]){_0x1b4776[_0x7cde('0x12e')]=![];_0x28ed67['queueBooked'][_0x28ed67[_0x7cde('0xa8')][_0x19775f][_0x7cde('0xb2')]]=[];ami[_0x7cde('0x14e')]({'actionid':_0x19775f,'action':'queuestatus','queue':_0x1b4776[_0x7cde('0x40')]})[_0x7cde('0xaf')](function(){_0x28ed67['updateOriginated'](_0x1b4776);_0x28ed67[_0x7cde('0xbf')]({'active':![],'ContactId':_0x28ed67[_0x7cde('0xa8')][_0x19775f][_0x7cde('0xd2')],'ListId':_0x28ed67['actions'][_0x19775f][_0x7cde('0xd3')],'VoiceQueueId':_0x28ed67[_0x7cde('0xa8')][_0x19775f][_0x7cde('0xd5')]||undefined,'CampaignId':_0x28ed67[_0x7cde('0xa8')][_0x19775f][_0x7cde('0x103')]||undefined})[_0x7cde('0xaf')](loggerCatch(_0x7cde('0x1f0')));delete _0x28ed67[_0x7cde('0xa8')][_0x19775f];});}else{loggerBooked[_0x7cde('0x7b')](_0x7cde('0x1f1'),JSON[_0x7cde('0x131')](_0x1b4776[_0x7cde('0x12e')]),_0x7cde('0x1ef'),_0x1b4776[_0x7cde('0x40')]);_0x28ed67[_0x7cde('0xb1')](_0x1b4776);_0x28ed67[_0x7cde('0xbf')]({'active':![],'ContactId':_0x28ed67['actions'][_0x19775f][_0x7cde('0xd2')],'ListId':_0x28ed67[_0x7cde('0xa8')][_0x19775f]['ListId'],'VoiceQueueId':_0x28ed67[_0x7cde('0xa8')][_0x19775f]['VoiceQueueId']||undefined,'CampaignId':_0x28ed67[_0x7cde('0xa8')][_0x19775f][_0x7cde('0x103')]||undefined})[_0x7cde('0xaf')](loggerCatch(_0x7cde('0x1f0')));delete _0x28ed67['actions'][_0x19775f];}}else{return _0x28ed67[_0x7cde('0x16c')](_0x1b4776,_0x576eb7);}}else{if(getDiff(_0x576eb7[_0x7cde('0x1f2')])<_0x1b4776[_0x7cde('0x1f3')]*0x3c){if(_0x576eb7[_0x7cde('0x1f4')]&&!_0x576eb7[_0x7cde('0x1f4')]['voicePause']){_0x28ed67['preview'][_0x7cde('0x132')](_0x576eb7['id'])['finally'](function(){_0x28ed67[_0x7cde('0xb1')](_0x1b4776);});}else{_0x28ed67['unlockContact']({'active':![]},_0x576eb7['id'],0x1)[_0x7cde('0x20')](function(){_0x28ed67['updateOriginated'](_0x1b4776);});}}else{_0x1b4776['outboundReCallsDay']+=0x1;_0x28ed67[_0x7cde('0xb1')](_0x1b4776);if(_0x1b4776['dialRecallInQueue']){_0x28ed67['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x576eb7[_0x7cde('0xd2')],'ListId':_0x576eb7[_0x7cde('0xd3')],'VoiceQueueId':_0x576eb7[_0x7cde('0xd5')]||undefined,'CampaignId':_0x576eb7['CampaignId']||undefined})[_0x7cde('0xaf')](loggerCatch(_0x7cde('0x1f5')));_0x28ed67[_0x7cde('0xca')](createObjHistory(_0x1b4776,_0x576eb7,_0x7cde('0x1f6'),0x17,_0x7cde('0x1f7')))[_0x7cde('0xaf')](loggerCatch(_0x7cde('0x1f8')));}else{_0x28ed67[_0x7cde('0xdc')](createObjHistory(_0x1b4776,_0x576eb7,_0x7cde('0x1f9'),0x16,'RecallFailedTimeout'),_0x7cde('0x1fa'),_0x7cde('0x1fb'));}}}}else{_0x1b4776[_0x7cde('0x5f')]+=0x1;_0x28ed67[_0x7cde('0xdc')](createObjHistory(_0x1b4776,_0x576eb7,_0x7cde('0x1fc'),0xd,_0x7cde('0x1fd')),_0x7cde('0x1fe'),_0x7cde('0x1ff'));throw _0x7cde('0x200');}};};Dialer[_0x7cde('0x1d')][_0x7cde('0x160')]=function(_0x3bd075){var _0x2ff578=this;var _0x521770=_0x3bd075['limitCalls']-_0x3bd075[_0x7cde('0x95')]-_0x3bd075['temp'];emitCampaignSummary(_0x3bd075);if(_0x521770>0x0){if(_0x521770>this['maxNumberOriginate']){_0x521770=this[_0x7cde('0x26')];}_0x3bd075['temp']+=_0x521770;this['getContactDialerIvr'](_0x3bd075['id'],_0x521770,_0x3bd075[_0x7cde('0x201')],_0x3bd075)[_0x7cde('0xbc')](function(_0xdee8c1){_0x3bd075[_0x7cde('0xc3')]-=_0x521770;_0x3bd075['temp']=_0x3bd075[_0x7cde('0xc3')]>0x0?_0x3bd075[_0x7cde('0xc3')]:0x0;if(!checkContactEmpty(_0xdee8c1)){_0x3bd075[_0x7cde('0x3e')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x7cde('0x7b')](_0x7cde('0x202')+_0x3bd075[_0x7cde('0x40')]);}else{_0x3bd075['originated']+=_0xdee8c1[_0x7cde('0x94')];_0x3bd075['message']=_0x7cde('0x203');for(var _0xf81ec6=0x0;_0xf81ec6<_0xdee8c1['length'];_0xf81ec6+=0x1){_0x3bd075[_0x7cde('0x204')]+=0x1;if(_[_0x7cde('0xac')](_0xdee8c1[_0xf81ec6])||_[_0x7cde('0xac')](_0xdee8c1[_0xf81ec6][_0x7cde('0x170')])||_[_0x7cde('0xac')](_0xdee8c1[_0xf81ec6][_0x7cde('0x170')][_0x7cde('0x171')])){_0x2ff578[_0x7cde('0xcf')](_0x7cde('0x205'),_0x3bd075,_0xdee8c1[_0xf81ec6]);}else{_0x2ff578[_0x7cde('0xb9')](_['pick'](_0xdee8c1[_0xf81ec6],[_0x7cde('0x103'),_0x7cde('0x206')]))[_0x7cde('0xbc')](_0x2ff578[_0x7cde('0x207')](_0x3bd075,_0xdee8c1[_0xf81ec6]))[_0x7cde('0xaf')](_0x2ff578['loggerHandler'](_0x7cde('0x208'),_0x3bd075));}}}})[_0x7cde('0xaf')](loggerGetContactDialer(_0x7cde('0x209'),_0x3bd075,_0x521770));}};Dialer[_0x7cde('0x1d')]['handlePower']=function(_0x4cfb34,_0x1b2cf2){var _0x3d25e3=this;var _0x36d467=[];var _0x47f35c=_0x1b2cf2>=0x1?_0x1b2cf2:0x1;if(_0x4cfb34[_0x7cde('0x59')]===_0x7cde('0x7')){_0x47f35c=0x1;}var _0x32501c=Math[_0x7cde('0x1cc')](_0x4cfb34['available']*_0x47f35c)-_0x4cfb34[_0x7cde('0x95')]-_0x4cfb34['temp'];emitVoiceQueueSummary(_0x4cfb34);if(_0x4cfb34['dialLimitQueue']>0x0){var _0x105609=_0x4cfb34[_0x7cde('0x20a')]-_0x4cfb34[_0x7cde('0x95')]-_0x4cfb34['talking']-_0x4cfb34[_0x7cde('0xc3')]-_0x4cfb34['pTalking'];if(_0x32501c>_0x105609){_0x32501c=_0x105609;}}if(_0x32501c>0x0){if(_0x4cfb34['dialMethod']==='booked'){_0x32501c=0x1;}if(_0x32501c>this[_0x7cde('0x26')]){_0x32501c=this['maxNumberOriginate'];}_0x4cfb34[_0x7cde('0xc3')]+=_0x32501c;for(var _0x43f142 in this[_0x7cde('0x24')]){if(typeof this[_0x7cde('0x24')][_0x43f142]!=='undefined'){if(this['agents'][_0x43f142]['state']===_0x7cde('0x20b')&&this[_0x7cde('0x24')][_0x43f142][_0x7cde('0xad')]===_0x7cde('0xdb')){_0x36d467['push'](this[_0x7cde('0x24')][_0x43f142]['id']);}}}this[_0x7cde('0xc2')](_0x4cfb34['id'],_0x36d467,_0x32501c,_0x4cfb34[_0x7cde('0x201')],_0x4cfb34)[_0x7cde('0xbc')](function(_0x30685b){_0x4cfb34[_0x7cde('0xc3')]-=_0x32501c;_0x4cfb34['temp']=_0x4cfb34['temp']>0x0?_0x4cfb34[_0x7cde('0xc3')]:0x0;if(!checkContactEmpty(_0x30685b)){_0x3d25e3['countReScheduled'](_0x4cfb34)[_0x7cde('0xbc')](sendMessageReschedule(_0x4cfb34))[_0x7cde('0xaf')](loggerCatch(_0x7cde('0xb6')));}else{_0x4cfb34[_0x7cde('0x95')]+=_0x30685b[_0x7cde('0x94')];_0x4cfb34['message']=_0x4cfb34[_0x7cde('0x59')]===_0x7cde('0x7')?'ACTIVE':'RUNNING';for(var _0x1ea8f7=0x0;_0x1ea8f7<_0x30685b['length'];_0x1ea8f7+=0x1){if(_[_0x7cde('0xac')](_0x30685b[_0x1ea8f7])||_[_0x7cde('0xac')](_0x30685b[_0x1ea8f7][_0x7cde('0x170')])||_[_0x7cde('0xac')](_0x30685b[_0x1ea8f7][_0x7cde('0x170')][_0x7cde('0x171')])){_0x3d25e3['emptyContact']('[actionOriginate]\x20',_0x4cfb34,_0x30685b[_0x1ea8f7]);}else{_0x3d25e3[_0x7cde('0xb7')](_[_0x7cde('0xd1')](_0x30685b[_0x1ea8f7],['VoiceQueueId',_0x7cde('0x206')]))[_0x7cde('0xbc')](_0x3d25e3[_0x7cde('0x207')](_0x4cfb34,_0x30685b[_0x1ea8f7]))[_0x7cde('0xaf')](_0x3d25e3[_0x7cde('0xce')](_0x7cde('0x205'),_0x4cfb34));}}}})[_0x7cde('0xaf')](loggerGetContactDialer(_0x7cde('0x20c'),_0x4cfb34,_0x32501c));}};Dialer[_0x7cde('0x1d')][_0x7cde('0x8d')]=function(_0x2905ab){if(_0x2905ab[_0x7cde('0x20a')]>0x0){var _0x951d03=_0x2905ab['dialLimitQueue']-_0x2905ab[_0x7cde('0x95')]-_0x2905ab[_0x7cde('0x53')];if(_0x951d03>0x0){this[_0x7cde('0x20d')](_0x2905ab);}else{loggerPredictiveCalls[_0x7cde('0x7b')]('[handlePredictive][limitChannel]');}}else{this[_0x7cde('0x20d')](_0x2905ab);}};Dialer[_0x7cde('0x1d')]['tryOriginatePredictive']=function(_0x5a1161){var _0x1a22f1=this;var _0x3e364f=[];_0x5a1161[_0x7cde('0x95')]+=0x1;for(var _0x208065 in this[_0x7cde('0x24')]){if(typeof this[_0x7cde('0x24')][_0x208065]!==_0x7cde('0xaa')){if(this['agents'][_0x208065][_0x7cde('0xa3')]==='not_inuse'&&this['agents'][_0x208065][_0x7cde('0xad')]==='reachable'){_0x3e364f[_0x7cde('0x12c')](this['agents'][_0x208065]['id']);}}}this['getContactDialer'](_0x5a1161['id'],_0x3e364f,0x1,_0x5a1161[_0x7cde('0x201')],_0x5a1161)[_0x7cde('0xbc')](function(_0x5e8213){if(!checkContactEmpty(_0x5e8213)){checkContactLowerLimitOriginate(_0x5a1161,0x1,0x0);_0x1a22f1[_0x7cde('0xb4')](_0x5a1161)['then'](sendMessageReschedule(_0x5a1161))[_0x7cde('0xaf')](loggerCatch('[countReScheduled]\x20'));}else{_0x5a1161[_0x7cde('0x3e')]=_0x7cde('0x203');if(_[_0x7cde('0xac')](_0x5e8213[0x0])||_[_0x7cde('0xac')](_0x5e8213[0x0][_0x7cde('0x170')])||_[_0x7cde('0xac')](_0x5e8213[0x0][_0x7cde('0x170')][_0x7cde('0x171')])){_0x1a22f1[_0x7cde('0xcf')](_0x7cde('0x205'),_0x5a1161,_0x5e8213[0x0]);}else{_0x1a22f1['checkIsBlackList'](_[_0x7cde('0xd1')](_0x5e8213[0x0],[_0x7cde('0xd5'),_0x7cde('0x206')]))['then'](_0x1a22f1[_0x7cde('0x207')](_0x5a1161,_0x5e8213[0x0]))['catch'](_0x1a22f1[_0x7cde('0xce')]('[actionOriginatePredictive]\x20',_0x5a1161));}}})[_0x7cde('0xaf')](loggerGetContactDialer(_0x7cde('0x20e'),_0x5a1161,0x1));emitVoiceQueueSummary(_0x5a1161);};Dialer[_0x7cde('0x1d')][_0x7cde('0x1e5')]=function(_0x25adfc,_0x198a61,_0xa40da7,_0x5b058a,_0x6ac5e4,_0x601a57){loggerPredictive[_0x7cde('0x7b')](_0x7cde('0x20f'));loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x25adfc);loggerPredictive[_0x7cde('0x7b')](_0x7cde('0x210'),_0x198a61);loggerPredictive['info']('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xa40da7);loggerPredictive[_0x7cde('0x7b')](_0x7cde('0x211'),_0x5b058a);loggerPredictive[_0x7cde('0x7b')](_0x7cde('0x212'),_0x6ac5e4);loggerPredictive[_0x7cde('0x7b')]('---------------------------');return new BPromise(function(_0x2f2c12,_0x3dc6a5){if(_0x25adfc<=0x0||isNaN(_0x25adfc)){return _0x3dc6a5(msgResponse(_0x7cde('0x213'),'Error',_0x7cde('0x214')+_0x25adfc));}if(_0xa40da7<=0x0||isNaN(_0xa40da7)){return _0x3dc6a5(msgResponse(_0x7cde('0x213'),_0x7cde('0x46'),'Ts\x20=\x20'+_0xa40da7));}if(_0x5b058a<=0x0||isNaN(_0x5b058a)){return _0x3dc6a5(msgResponse(_0x7cde('0x213'),_0x7cde('0x46'),_0x7cde('0x215')+_0x5b058a));}if(_0x198a61<=0x0||isNaN(_0x198a61)){return _0x3dc6a5(msgResponse('[abandonmentRate]',_0x7cde('0x46'),'interval\x20=\x20'+_0x198a61));}if(_0x6ac5e4<=0x0||isNaN(_0x6ac5e4)){return _0x3dc6a5(msgResponse(_0x7cde('0x213'),_0x7cde('0x46'),_0x7cde('0x216')+_0x6ac5e4));}_0x601a57=_0x601a57||0x0;var _0x327a81=0x1/_0xa40da7;var _0x352e90=0x0;var _0xbc62e7=0x0;var _0xc07cec=0x0;var _0x477c97=0x0;for(var _0x28116d=0x0;_0xc07cec<_0x6ac5e4;_0x28116d+=0x1){_0xbc62e7=_0x28116d/_0x198a61;_0x352e90=(_0x5b058a*_0xbc62e7+_0x601a57)/_0x327a81;_0xc07cec=erlangb(_0x352e90,_0x25adfc);_0x477c97=_0x352e90/_0x25adfc*(0x1-erlangb(_0x352e90,_0x25adfc));}return _0x2f2c12({'erlangCalls':_0x28116d,'erlangCallToSecond':_0x198a61/_0x28116d,'erlangAbandonmentRate':_0xc07cec,'erlangBusyFactor':_0x477c97});});};Dialer['prototype'][_0x7cde('0x217')]=function(_0x1878b4,_0x4fa855,_0x5ac76d,_0x597cb2,_0x512078,_0x51cf15){loggerPredictive[_0x7cde('0x7b')](_0x7cde('0x218'));loggerPredictive[_0x7cde('0x7b')](_0x7cde('0x219'),_0x1878b4);loggerPredictive[_0x7cde('0x7b')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4fa855);loggerPredictive[_0x7cde('0x7b')](_0x7cde('0x21a'),_0x5ac76d);loggerPredictive[_0x7cde('0x7b')](_0x7cde('0x211'),_0x597cb2);loggerPredictive['info'](_0x7cde('0x21b'),_0x512078);loggerPredictive[_0x7cde('0x7b')](_0x7cde('0x82'));return new BPromise(function(_0x40b6ae,_0x4b91ac){if(_0x1878b4<=0x0||isNaN(_0x1878b4)){return _0x4b91ac(msgResponse(_0x7cde('0x21c'),_0x7cde('0x46'),'m\x20=\x20'+_0x1878b4));}if(_0x5ac76d<=0x0||isNaN(_0x5ac76d)){return _0x4b91ac(msgResponse(_0x7cde('0x21c'),_0x7cde('0x46'),_0x7cde('0x21d')+_0x5ac76d));}if(_0x597cb2<=0x0||isNaN(_0x597cb2)){return _0x4b91ac(msgResponse('[busyFactor]',_0x7cde('0x46'),_0x7cde('0x215')+_0x597cb2));}if(_0x4fa855<=0x0||isNaN(_0x4fa855)){return _0x4b91ac(msgResponse('[busyFactor]',_0x7cde('0x46'),'interval\x20=\x20'+_0x4fa855));}if(_0x512078<=0x0||isNaN(_0x512078)){return _0x4b91ac(msgResponse(_0x7cde('0x21c'),_0x7cde('0x46'),_0x7cde('0x21e')+_0x512078));}_0x51cf15=_0x51cf15||0x0;var _0x34cdce=0x1/_0x5ac76d;var _0x25b9a1=0x0;var _0x412385=0x0;var _0x5ac396=0x0;var _0x4b2804=0x0;for(var _0x3615bd=0x0;_0x4b2804<_0x512078;_0x3615bd+=0x1){_0x412385=_0x3615bd/_0x4fa855;_0x25b9a1=(_0x597cb2*_0x412385+_0x51cf15)/_0x34cdce;_0x5ac396=erlangb(_0x25b9a1,_0x1878b4);_0x4b2804=_0x25b9a1/_0x1878b4*(0x1-erlangb(_0x25b9a1,_0x1878b4));}return _0x40b6ae({'erlangCalls':_0x3615bd,'erlangCallToSecond':_0x4fa855/_0x3615bd,'erlangAbandonmentRate':_0x5ac396,'erlangBusyFactor':_0x4b2804});});};module[_0x7cde('0x21f')]=Dialer; \ No newline at end of file +var _0x9c8f=['Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','merge','startProgressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','available','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','endtime','clearZombieChannels','[uniqueid]','enqueue','isNil','Action','status','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','then','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','active','SIP/%s','unmonitored','uniqueid','variable','amdstatus','exten','dialAMDActive','value','HANGUP','statedesc','HangupInAMD','membername','buildObj','amd','[syncHangupInAMD]','MACHINE','AMD','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','add','[rescheduleContact][Machine]','custom:amd','Machine','countglobal','[syncAgentComplete][createHistory][0]','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ivrAnswerCallsDay','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','cause-txt','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','strategy','stateinterface','locked','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','run','[Catch][Preview][syncQueueStatusComplete]','queueBookedRR','_rr','paused','[booked][RR]','unlockRR','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','resetActiveCalls','syncCampaigns','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','iftime\x20%s,%s','interval','timezones','content','indexOf','true','command','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','power','handlePower','dialPowerLevel','handleIvr','dialActive','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncQueueSummary]','\x5cw{0,','pow','replace','random','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','dialer','getCaller','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','%s%s','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','substring','dialCutDigit','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','[rescheduleContact]\x20[Congestion]','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberMaxRetry','createStateFinal','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','reason\x205\x20busy','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalMaxThreshold','round','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','erlangCalls','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','dialPredictiveInterval','started\x20in\x20predictive\x20at','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','getDataPredictive','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','floor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','booked','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','Queue:\x20','scheduledat','dialRecallMeTimeout','Agent','voicePause','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','ACTIVE','[getContactDialer2]','dialLimitQueue','tryOriginatePredictive','not_inuse','reachable','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\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----','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','[busyFactor]','Umin\x20=\x20','exports','lodash','bluebird','uuid','moment','md5','../preview/util/util','../../../config/logger','predictive','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','uniqueId','optionPredictive','startPredictive','queueBooked','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','syncAgentComplete','custom:queuesummary','hangup','syncHangup','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopClearZombieChannels','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangBusyFactor','Trunk','format','voice:queue:%s','ivr','campaign:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','isUndefined','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c8f,0x199));var _0xf9c8=function(_0x367336,_0x18c229){_0x367336=_0x367336-0x0;var _0x3423a7=_0x9c8f[_0x367336];return _0x3423a7;};'use strict';var util=require('util');var _=require(_0xf9c8('0x0'));var BPromise=require(_0xf9c8('0x1'));var uuid=require(_0xf9c8('0x2'));var moment=require(_0xf9c8('0x3'));var rr=require('rr');var md5=require(_0xf9c8('0x4'));var Redis=require('ioredis');var ut=require(_0xf9c8('0x5'));var config=require('../../../config/environment/');var logger=require('../../../config/logger')('dialer');var loggerBooked=require(_0xf9c8('0x6'))('booked');var loggerPredictive=require(_0xf9c8('0x6'))(_0xf9c8('0x7'));var loggerPredictiveCalls=require(_0xf9c8('0x6'))('predictiveCalls');var loggerSyncQueueSummary=require('../../../config/logger')(_0xf9c8('0x8'));var ami=require(_0xf9c8('0x9'));config[_0xf9c8('0xa')]=_[_0xf9c8('0xb')](config[_0xf9c8('0xa')],{'host':_0xf9c8('0xc'),'port':0x18eb});var io=require(_0xf9c8('0xd'))(new Redis(config[_0xf9c8('0xa')]));var cmHopper=require(_0xf9c8('0xe'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xf9c8('0xf'));var voiceQueueRt=require(_0xf9c8('0x10'));var Action=require(_0xf9c8('0x11'));var History=require(_0xf9c8('0x12'));var Final=require(_0xf9c8('0x13'));var AgentComplete=require(_0xf9c8('0x14'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require('./hangup');var ipAgi=process['env']['XCALLY_IP_AGI']||_0xf9c8('0x15');var strategy={'rrmemory':_0xf9c8('0x16'),'roundrobin':_0xf9c8('0x17')};var Sequence=function(){};Sequence[_0xf9c8('0x18')]['enqueue']=function(_0x1a51c0){this['tail']=this[_0xf9c8('0x19')]?this[_0xf9c8('0x19')][_0xf9c8('0x1a')](_0x1a51c0):_0x1a51c0();};function Dialer(_0x589b23,_0x3cb182){this[_0xf9c8('0x1b')]=new Sequence();this[_0xf9c8('0x1c')]=_0x3cb182;this[_0xf9c8('0x1d')]=_0x589b23[_0xf9c8('0x1d')];this[_0xf9c8('0x1e')]=_0x589b23['campaigns'];this[_0xf9c8('0x1f')]=_0x589b23[_0xf9c8('0x1f')];this[_0xf9c8('0x20')]=_0x589b23[_0xf9c8('0x20')];this[_0xf9c8('0x21')]=config[_0xf9c8('0x21')]||0x2;this['channels']={};this[_0xf9c8('0x22')]={};this['contactsId']={};this[_0xf9c8('0x23')]={};this[_0xf9c8('0x24')]={};this[_0xf9c8('0x25')]={};this['startProgressive']={};this['ivrOriginated']={};this[_0xf9c8('0x26')]={};this['queueBookedRR']={};ami['on'](_0xf9c8('0x27'),this[_0xf9c8('0x28')]['bind'](this));ami['on'](_0xf9c8('0x29'),this[_0xf9c8('0x2a')][_0xf9c8('0x2b')](this));ami['on'](_0xf9c8('0x2c'),this[_0xf9c8('0x2d')][_0xf9c8('0x2b')](this));ami['on']('agentcomplete',this[_0xf9c8('0x2e')][_0xf9c8('0x2b')](this));ami['on'](_0xf9c8('0x2f'),this[_0xf9c8('0x8')]['bind'](this));ami['on'](_0xf9c8('0x30'),this[_0xf9c8('0x31')][_0xf9c8('0x2b')](this));ami['on']('newexten',this[_0xf9c8('0x32')][_0xf9c8('0x2b')](this));ami['on'](_0xf9c8('0x33'),this[_0xf9c8('0x34')][_0xf9c8('0x2b')](this));ami['on'](_0xf9c8('0x35'),this[_0xf9c8('0x36')]['bind'](this));ami['on']('queuestatuscomplete',this[_0xf9c8('0x37')][_0xf9c8('0x2b')](this));this['loopCampaigns']();this[_0xf9c8('0x38')]();}function isNotNull(_0x6d2039){return _0x6d2039!==null&&!_['isUndefined'](_0x6d2039);}function checkIsLoggedIn(_0x2eab0b,_0x556cb4){return function(){if(_0x556cb4<=0x0){_0x2eab0b[_0xf9c8('0x39')]=_0xf9c8('0x3a');throw _0x2eab0b[_0xf9c8('0x3b')]+_0xf9c8('0x3c');}};}function isActive(_0x5cebb6){return _0x5cebb6;}function checkIsActive(_0x12f5c1,_0x38f7ae){return function(){if(!isActive(_0x38f7ae)){_0x12f5c1[_0xf9c8('0x39')]=_0xf9c8('0x3d');throw _0x12f5c1[_0xf9c8('0x3b')]+_0xf9c8('0x3e');}};}function checkInterval(_0x4d4f38){return function(){if(!isNotNull(_0x4d4f38['Interval'])){_0x4d4f38[_0xf9c8('0x39')]=_0xf9c8('0x3f');throw _0x4d4f38[_0xf9c8('0x3b')]+_0xf9c8('0x40');}if(!isNotNull(_0x4d4f38[_0xf9c8('0x41')][_0xf9c8('0x42')])){_0x4d4f38['message']=_0xf9c8('0x3f');throw _0x4d4f38[_0xf9c8('0x3b')]+_0xf9c8('0x40');}if(!isNotNull(_['isEmpty'](_0x4d4f38[_0xf9c8('0x41')][_0xf9c8('0x42')]))){_0x4d4f38[_0xf9c8('0x39')]=_0xf9c8('0x3f');throw _0x4d4f38[_0xf9c8('0x3b')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x248f80,_0x485e87,_0x5e578f){return{'action':_0x248f80,'response':_0x485e87,'message':_0x5e578f,'stack':_0x5e578f};}function myreject(_0x2f0e89){return function(_0x19b17a){return _0x2f0e89(msgResponse(_0xf9c8('0x43'),_0xf9c8('0x44'),JSON[_0xf9c8('0x45')](_0x19b17a)));};}function getSeconds(_0x2d37b4,_0x116149){var _0x2c9654=moment(_0x2d37b4)[_0xf9c8('0x46')](0x0);var _0x479d21=moment(_0x116149)[_0xf9c8('0x46')](0x0);return _0x2c9654[_0xf9c8('0x47')](_0x479d21,_0xf9c8('0x48'));}function emit(_0x2ee2dd,_0x57d674,_0x3a1993){io['to'](_0x2ee2dd)[_0xf9c8('0x49')](_0x57d674,_0x3a1993);}function emitVoiceQueueSummary(_0x37c8c3){if(_0x37c8c3[_0xf9c8('0x4a')]===_0xf9c8('0x4b')){var _0x59f974={'id':_0x37c8c3['id'],'name':_0x37c8c3[_0xf9c8('0x3b')],'strategy':_0x37c8c3['strategy'],'answered':_0x37c8c3['answered'],'available':_0x37c8c3['available'],'loggedIn':_0x37c8c3[_0xf9c8('0x4c')],'pTalking':_0x37c8c3[_0xf9c8('0x4d')],'sumBillable':_0x37c8c3[_0xf9c8('0x4e')],'sumDuration':_0x37c8c3[_0xf9c8('0x4f')],'sumHoldTime':_0x37c8c3[_0xf9c8('0x50')]||0x0,'talking':_0x37c8c3[_0xf9c8('0x51')],'total':_0x37c8c3[_0xf9c8('0x52')],'type':_0x37c8c3['type'],'unmanaged':_0x37c8c3[_0xf9c8('0x53')],'abandoned':_0x37c8c3[_0xf9c8('0x54')],'waiting':_0x37c8c3[_0xf9c8('0x55')],'loggedInDb':_0x37c8c3[_0xf9c8('0x56')],'dialActive':_0x37c8c3['dialActive'],'dialMethod':_0x37c8c3[_0xf9c8('0x57')],'dialOriginateCallerIdName':_0x37c8c3['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x37c8c3[_0xf9c8('0x58')],'dialOriginateTimeout':_0x37c8c3[_0xf9c8('0x59')],'dialPrefix':_0x37c8c3[_0xf9c8('0x5a')],'outboundAnswerAgiCallsDay':_0x37c8c3[_0xf9c8('0x5b')],'outboundAnswerCallsDay':_0x37c8c3[_0xf9c8('0x5c')],'outboundBlacklistCallsDay':_0x37c8c3[_0xf9c8('0x5d')],'outboundBusyCallsDay':_0x37c8c3[_0xf9c8('0x5e')],'outboundCongestionCallsDay':_0x37c8c3[_0xf9c8('0x5f')],'outboundDropCallsDayACS':_0x37c8c3['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x37c8c3[_0xf9c8('0x60')],'outboundDropCallsDayTimeout':_0x37c8c3[_0xf9c8('0x61')],'outboundNoAnswerCallsDay':_0x37c8c3[_0xf9c8('0x62')],'outboundNoSuchCallsDay':_0x37c8c3[_0xf9c8('0x63')],'outboundOriginateFailureCallsDay':_0x37c8c3[_0xf9c8('0x64')],'outboundReCallsDay':_0x37c8c3['outboundReCallsDay'],'outboundRejectCallsDay':_0x37c8c3[_0xf9c8('0x65')],'outboundUnknownCallsDay':_0x37c8c3[_0xf9c8('0x66')],'predictiveIntervalAnsweredCalls':_0x37c8c3[_0xf9c8('0x67')],'predictiveIntervalAvgHoldtime':_0x37c8c3[_0xf9c8('0x68')],'predictiveIntervalAvgTalktime':_0x37c8c3[_0xf9c8('0x69')],'predictiveIntervalDroppedCallsCallersExit':_0x37c8c3[_0xf9c8('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0x37c8c3[_0xf9c8('0x6b')],'predictiveIntervalErlangCalls':_0x37c8c3['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x37c8c3['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x37c8c3['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x37c8c3['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x37c8c3['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x37c8c3[_0xf9c8('0x6c')],'predictiveIntervalTotalCalls':_0x37c8c3[_0xf9c8('0x6d')],'message':_0x37c8c3[_0xf9c8('0x39')],'originated':_0x37c8c3[_0xf9c8('0x6e')],'erlangCalls':_0x37c8c3['erlangCalls'],'erlangCallToSecond':_0x37c8c3['erlangCallToSecond'],'erlangAbandonmentRate':_0x37c8c3['erlangAbandonmentRate'],'erlangBusyFactor':_0x37c8c3[_0xf9c8('0x6f')],'startPredictive':_0x37c8c3[_0xf9c8('0x25')],'startProgressive':_0x37c8c3['startProgressive']};if(_0x37c8c3[_0xf9c8('0x70')]){_0x59f974[_0xf9c8('0x70')]={'id':_0x37c8c3[_0xf9c8('0x70')]['id'],'name':_0x37c8c3['Trunk'][_0xf9c8('0x3b')],'active':_0x37c8c3[_0xf9c8('0x70')]['active'],'callerid':_0x37c8c3[_0xf9c8('0x70')]['callerid']};}if(_0x37c8c3['Interval']){_0x59f974['Interval']={'id':_0x37c8c3[_0xf9c8('0x41')]['id'],'name':_0x37c8c3[_0xf9c8('0x41')]['name']};}var _0x53dbee=md5(JSON[_0xf9c8('0x45')](_0x59f974));if(_0x37c8c3['md5']!==_0x53dbee){_0x37c8c3['md5']=_0x53dbee;emit(util[_0xf9c8('0x71')](_0xf9c8('0x72'),_0x59f974[_0xf9c8('0x3b')]),'voice_queue:save',_0x59f974);}}}function emitCampaignSummary(_0x339501){if(_0x339501[_0xf9c8('0x4a')]===_0xf9c8('0x73')){emit(util[_0xf9c8('0x71')]('campaign:ivr:%s',_0x339501[_0xf9c8('0x3b')]),_0xf9c8('0x74'),_0x339501);}}function checkGetDataPredictive(_0x13552a){if(isNotNull(_0x13552a)&&!_[_0xf9c8('0x75')](_0x13552a)){loggerPredictive[_0xf9c8('0x76')](_0xf9c8('0x77'));loggerPredictive[_0xf9c8('0x76')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x13552a['predictiveIntervalTotalCalls']);loggerPredictive[_0xf9c8('0x76')](_0xf9c8('0x78'),_0x13552a[_0xf9c8('0x67')]);loggerPredictive['info'](_0xf9c8('0x79'),_0x13552a[_0xf9c8('0x6b')]);loggerPredictive[_0xf9c8('0x76')](_0xf9c8('0x7a'),_0x13552a[_0xf9c8('0x6a')]);loggerPredictive[_0xf9c8('0x76')](_0xf9c8('0x7b'),_0x13552a[_0xf9c8('0x68')]);loggerPredictive[_0xf9c8('0x76')](_0xf9c8('0x7c'),_0x13552a[_0xf9c8('0x69')]);loggerPredictive['info'](_0xf9c8('0x7d'));if(_0x13552a[_0xf9c8('0x6d')]>0x0){if(!_['isUndefined'](_0x13552a[_0xf9c8('0x69')])&&_0x13552a[_0xf9c8('0x69')]>0x0){return!![];}loggerPredictive[_0xf9c8('0x76')](_0xf9c8('0x7e'));if(!_[_0xf9c8('0x7f')](_0x13552a[_0xf9c8('0x68')])&&_0x13552a[_0xf9c8('0x68')]>0x0){return!![];}loggerPredictive[_0xf9c8('0x76')](_0xf9c8('0x80'));}else{loggerPredictive['info'](_0xf9c8('0x81'));}}else{loggerPredictive['info'](_0xf9c8('0x82'));}return![];}function mergeDataErlangB(_0x27a79b){return function(_0x44bf28){loggerPredictive['info'](_0xf9c8('0x83'));loggerPredictive['info'](_0xf9c8('0x84'),_0x44bf28['erlangCalls']);loggerPredictive[_0xf9c8('0x76')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x44bf28[_0xf9c8('0x85')]);loggerPredictive[_0xf9c8('0x76')](_0xf9c8('0x86'),_0x44bf28['erlangAbandonmentRate']);loggerPredictive[_0xf9c8('0x76')](_0xf9c8('0x87'),_0x44bf28[_0xf9c8('0x6f')]);loggerPredictive[_0xf9c8('0x76')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x44bf28[_0xf9c8('0x88')]);loggerPredictive[_0xf9c8('0x76')](_0xf9c8('0x7d'));_[_0xf9c8('0x89')](_0x27a79b,_0x44bf28);};}function getDiff(_0x2a1f62){var _0x36a1f6=moment()['milliseconds'](0x0);var _0x4f4b7e=moment(_0x2a1f62)[_0xf9c8('0x46')](0x0);return _0x36a1f6[_0xf9c8('0x47')](_0x4f4b7e,_0xf9c8('0x48'));}function ifInterval(_0x3e266e,_0x54ac59){if(_[_0xf9c8('0x7f')](_0x54ac59)){return![];}return getDiff(_0x54ac59)<_0x3e266e*0x3c;}function freeVariablesPredictive(_0x1327f7){if(isNotNull(_0x1327f7)){if(!_[_0xf9c8('0x7f')](_0x1327f7[_0xf9c8('0x8a')])){_0x1327f7[_0xf9c8('0x8a')]=undefined;loggerPredictive[_0xf9c8('0x76')](_0x1327f7[_0xf9c8('0x3b')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0xf9c8('0x7f')](_0x1327f7[_0xf9c8('0x25')])){_0x1327f7['startPredictive']=undefined;loggerPredictive['info'](_0x1327f7[_0xf9c8('0x3b')],_0xf9c8('0x8b'));}if(!_['isUndefined'](_0x1327f7[_0xf9c8('0x8c')])){clearInterval(_0x1327f7[_0xf9c8('0x8c')]);_0x1327f7[_0xf9c8('0x8c')]=undefined;loggerPredictive[_0xf9c8('0x76')](_0x1327f7[_0xf9c8('0x3b')],_0xf9c8('0x8d'));}}}function erlangb(_0x3c7f75,_0x541789){if(_0x541789===0x0){return 0x0;}var _0x244175=0x1;for(var _0x261247=0x1;_0x261247<=_0x541789;_0x261247+=0x1){_0x244175=0x1+_0x244175*_0x261247/_0x3c7f75;}return 0x1/_0x244175;}function isVoiceQueueOutbound(_0x69072){return _0x69072===_0xf9c8('0x4b');}function isNotPreview(_0x163194){return _0x163194!==_0xf9c8('0x1c');}function isCampaignIvr(_0x419ed6){return _0x419ed6===_0xf9c8('0x73');}function getCallerId(_0x2787ec,_0x15aa9c,_0x271313){if(!_[_0xf9c8('0x7f')](_0x271313)&&typeof _0x271313===_0xf9c8('0x8e')&&!_[_0xf9c8('0x75')](_0x271313)){if(!_[_0xf9c8('0x7f')](_0x15aa9c)&&typeof _0x15aa9c==='string'&&!_[_0xf9c8('0x75')](_0x15aa9c)){return util[_0xf9c8('0x71')]('\x22%s\x22\x20<%s>',_0x15aa9c,_0x271313);}return util['format'](_0xf9c8('0x8f'),_0x271313,_0x271313);}if(!_[_0xf9c8('0x7f')](_0x2787ec)&&typeof _0x2787ec===_0xf9c8('0x8e')&&!_['isEmpty'](_0x2787ec)){return _0x2787ec;}return _0xf9c8('0x90');}function loggerCatchQueueSummary(_0x2dcff8,_0x4dca87){return function(_0x2892ba){freeVariablesPredictive(_0x4dca87);emitVoiceQueueSummary(_0x4dca87);emitCampaignSummary(_0x4dca87);loggerSyncQueueSummary[_0xf9c8('0x91')](_0x2dcff8,util[_0xf9c8('0x92')](_0x2892ba,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x52593a,_0x10f577){return function(_0x3797ad){loggerPredictive['error'](_0x10f577[_0xf9c8('0x3b')],_0x52593a);loggerPredictive[_0xf9c8('0x91')](_0x3797ad[_0xf9c8('0x93')]);freeVariablesPredictive(_0x10f577);};}function loggerCatch(_0x18984e){return function(_0x4d773a){logger[_0xf9c8('0x91')](_0x18984e,util[_0xf9c8('0x92')](_0x4d773a,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x1dc468){return _0x1dc468&&!_['isUndefined'](_0x1dc468)&&_0x1dc468[_0xf9c8('0x94')]>0x0;}function decremetOriginate(_0x1ddaad){if(!_[_0xf9c8('0x7f')](_0x1ddaad)&&_0x1ddaad!==null){if(typeof _0x1ddaad[_0xf9c8('0x6e')]!==_0xf9c8('0x95')){if(_0x1ddaad[_0xf9c8('0x6e')]>0x0){_0x1ddaad['originated']-=0x1;}else{logger['error']('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xf9c8('0x91')](_0xf9c8('0x96'));}}function checkContactLowerLimitOriginate(_0x21e32a,_0x1a0175,_0x2e0336){if(_0x1a0175>_0x2e0336){for(var _0x461b4b=0x0;_0x461b4b<_0x1a0175-_0x2e0336;_0x461b4b+=0x1){decremetOriginate(_0x21e32a);}}}function loggerGetContactDialer(_0x47d61c,_0x2d84ef,_0x14aace){return function(_0x4c192a){checkContactLowerLimitOriginate(_0x2d84ef,_0x14aace,0x0);logger[_0xf9c8('0x91')](_0x47d61c,util['inspect'](_0x4c192a,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x123737){return function(_0x184f0f){if(isNotNull(_0x184f0f)&&isNotNull(_0x184f0f[0x0])){if(_0x184f0f[0x0][_0xf9c8('0x97')]>0x0){_0x123737[_0xf9c8('0x39')]=_0xf9c8('0x98');logger[_0xf9c8('0x76')]('[getContactDialer2][ReScheduled]'+_0x123737[_0xf9c8('0x3b')],_0x184f0f[0x0][_0xf9c8('0x97')],'contacts');}else{_0x123737[_0xf9c8('0x39')]=_0xf9c8('0x99');logger['info'](_0xf9c8('0x9a')+_0x123737['name']);}}};}function notSendMessagesQueue(_0x5dfb39){if(_0x5dfb39['sendMessageOneNotActive']){freeVariablesPredictive(_0x5dfb39);if(_0x5dfb39[_0xf9c8('0x6e')]===0x0&&_0x5dfb39[_0xf9c8('0x51')]===0x0&&_0x5dfb39[_0xf9c8('0x55')]===0x0&&(_0x5dfb39[_0xf9c8('0x4d')]||0x0)===0x0){_0x5dfb39[_0xf9c8('0x9b')]=![];_0x5dfb39[_0xf9c8('0x9c')]=0x0;_0x5dfb39[_0xf9c8('0x39')]=_0xf9c8('0x3d');loggerSyncQueueSummary[_0xf9c8('0x91')](_0xf9c8('0x9d'),_0x5dfb39[_0xf9c8('0x3b')],_0xf9c8('0x9e'));}else{_0x5dfb39[_0xf9c8('0x39')]=_0xf9c8('0x9f');loggerSyncQueueSummary[_0xf9c8('0x91')](_0xf9c8('0x9d'),_0x5dfb39[_0xf9c8('0x3b')],_0xf9c8('0xa0'));}emitVoiceQueueSummary(_0x5dfb39);}}function notSendMessagesCampaign(_0x58f809){if(_0x58f809[_0xf9c8('0x9b')]){if(_0x58f809[_0xf9c8('0x6e')]===0x0){_0x58f809[_0xf9c8('0x9b')]=![];_0x58f809[_0xf9c8('0x39')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xf9c8('0x91')](_0xf9c8('0xa1'),_0x58f809[_0xf9c8('0x3b')],'is\x20not\x20active');}else{_0x58f809[_0xf9c8('0x39')]=_0xf9c8('0x9f');loggerSyncQueueSummary['error'](_0xf9c8('0xa1'),_0x58f809[_0xf9c8('0x3b')],'is\x20disactive');}emitCampaignSummary(_0x58f809);}}function createObjHistory(_0x5e8658,_0x3779cf,_0x2089a2,_0x45b1b0,_0x3c90b8){_0x5e8658[_0xf9c8('0x39')]=_0x2089a2;var _0x52ace4=new Action(_0x5e8658,_0x3779cf);var _0x2d03e7=new History(_0x52ace4);_0x2d03e7[_0xf9c8('0xa2')]=_0x45b1b0;_0x2d03e7['statedesc']=_0x3c90b8;_0x2d03e7[_0xf9c8('0xa3')]=_0x52ace4['starttime'];return _0x2d03e7;}Dialer['prototype'][_0xf9c8('0x38')]=function(){var _0x34c62f=this;setInterval(function(){_0x34c62f[_0xf9c8('0xa4')](_0x34c62f[_0xf9c8('0x23')],_0xf9c8('0xa5'));_0x34c62f[_0xf9c8('0xa4')](_0x34c62f[_0xf9c8('0x22')],'[actions]');},0x32c8);};Dialer[_0xf9c8('0x18')]['clearZombieChannels']=function(_0x17cdf8,_0x5cf501){var _0x67cf76=this;for(var _0xe1de03 in _0x17cdf8){if(typeof _0x17cdf8[_0xe1de03]!=='undefined'){this[_0xf9c8('0x1b')][_0xf9c8('0xa6')](function(){if(!_[_0xf9c8('0xa7')](_0x17cdf8[_0xe1de03])){return ami[_0xf9c8('0xa8')]({'action':_0xf9c8('0xa9'),'channel':_0x17cdf8[_0xe1de03]['channel']})[_0xf9c8('0xaa')](function(_0x513f51){if(_0x513f51[_0xf9c8('0x39')]===_0xf9c8('0xab')){setTimeout(function(){if(_0x17cdf8[_0xe1de03]&&_0x17cdf8[_0xe1de03]['type']!==_0xf9c8('0x73')){_0x67cf76[_0xf9c8('0xac')](_0x67cf76[_0xf9c8('0x1d')][_0x17cdf8[_0xe1de03][_0xf9c8('0xad')]]);logger['error'](_0xf9c8('0xae'),_0x5cf501,_0xe1de03,_0x17cdf8[_0xe1de03][_0xf9c8('0xad')]);delete _0x17cdf8[_0xe1de03];}if(_0x17cdf8[_0xe1de03]&&_0x17cdf8[_0xe1de03]['type']===_0xf9c8('0x73')){_0x67cf76[_0xf9c8('0xac')](_0x67cf76[_0xf9c8('0x1e')][_0x17cdf8[_0xe1de03][_0xf9c8('0xad')]]);logger[_0xf9c8('0x91')](_0xf9c8('0xaf'),_0x5cf501,_0xe1de03,_0x17cdf8[_0xe1de03][_0xf9c8('0xad')]);delete _0x17cdf8[_0xe1de03];}},0x2328);}});}});}}};Dialer[_0xf9c8('0x18')][_0xf9c8('0xb0')]=function(_0x232fb5){return BPromise[_0xf9c8('0xb1')]()['then'](cmHopper['countReScheduled'](_0x232fb5))[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0xb2')));};Dialer['prototype'][_0xf9c8('0xb3')]=function(_0x58ffc7){return BPromise[_0xf9c8('0xb1')]()[_0xf9c8('0xb4')](cmHopperBlack[_0xf9c8('0xb3')](_0x58ffc7))[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0xb5')));};Dialer['prototype'][_0xf9c8('0xb6')]=function(_0x43382b){return BPromise[_0xf9c8('0xb1')]()[_0xf9c8('0xb4')](cmHopperBlack[_0xf9c8('0xb6')](_0x43382b))[_0xf9c8('0xaa')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0xf9c8('0x18')][_0xf9c8('0xb7')]=function(_0x48015f){return BPromise[_0xf9c8('0xb1')]()[_0xf9c8('0xb4')](cmHopperHistory[_0xf9c8('0xb8')](_0x48015f))[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0xb9')));};Dialer[_0xf9c8('0x18')][_0xf9c8('0xba')]=function(_0x5d950f){return BPromise[_0xf9c8('0xb1')]()['then'](cmHopper[_0xf9c8('0xba')](_0x5d950f))[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0xbb')));};Dialer['prototype'][_0xf9c8('0xbc')]=function(_0x411984,_0x281c92,_0x167df8){return BPromise[_0xf9c8('0xb1')]()[_0xf9c8('0xb4')](cmHopper['unlockContact'](_0x411984,_0x281c92,_0x167df8))[_0xf9c8('0xaa')](loggerCatch('[unlockContact]\x20'));};Dialer['prototype'][_0xf9c8('0xbd')]=function(_0x2dd5df,_0x43e0fe,_0x226201,_0x23f819,_0x2f2797){return BPromise['resolve']()[_0xf9c8('0xb4')](cmHopper[_0xf9c8('0xbd')](_0x2dd5df,_0x43e0fe,_0x226201,_0x23f819))[_0xf9c8('0xaa')](function(_0x577680){_0x2f2797[_0xf9c8('0xbe')]-=_0x226201;_0x2f2797[_0xf9c8('0xbe')]=_0x2f2797[_0xf9c8('0xbe')]>0x0?_0x2f2797[_0xf9c8('0xbe')]:0x0;loggerCatch(_0xf9c8('0xbf'))(_0x577680);});};Dialer[_0xf9c8('0x18')][_0xf9c8('0xc0')]=function(_0x4a144b,_0x72ec14,_0x4da04c,_0x567065){return BPromise[_0xf9c8('0xb1')]()[_0xf9c8('0xb4')](cmHopper[_0xf9c8('0xc0')](_0x4a144b,_0x72ec14,_0x4da04c))['catch'](function(_0x108f3d){_0x567065[_0xf9c8('0xbe')]-=_0x72ec14;_0x567065[_0xf9c8('0xbe')]=_0x567065[_0xf9c8('0xbe')]>0x0?_0x567065[_0xf9c8('0xbe')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x108f3d);});};Dialer[_0xf9c8('0x18')][_0xf9c8('0xc1')]=function(_0x2e1a6a){return BPromise[_0xf9c8('0xb1')]()[_0xf9c8('0xb4')](voiceQueueRt[_0xf9c8('0xc1')](_0x2e1a6a))['catch'](loggerCatch(_0xf9c8('0xc2')));};Dialer[_0xf9c8('0x18')][_0xf9c8('0xc3')]=function(_0x4b589f){return BPromise[_0xf9c8('0xb1')]()['then'](cmHopper[_0xf9c8('0xc3')](_0x4b589f))[_0xf9c8('0xaa')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer['prototype'][_0xf9c8('0xc4')]=function(_0x29d4c7){return BPromise[_0xf9c8('0xb1')]()[_0xf9c8('0xb4')](cmHopperHistory[_0xf9c8('0xc4')](_0x29d4c7))[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0xc5')));};Dialer[_0xf9c8('0x18')][_0xf9c8('0xac')]=function(_0x24cfe3){if(!_[_0xf9c8('0x7f')](_0x24cfe3)&&_0x24cfe3!==null){if(typeof _0x24cfe3[_0xf9c8('0x6e')]!==_0xf9c8('0x95')){if(_0x24cfe3[_0xf9c8('0x6e')]>0x0){_0x24cfe3[_0xf9c8('0x6e')]-=0x1;}else{logger[_0xf9c8('0x91')](_0xf9c8('0xc6'));}}}else{logger[_0xf9c8('0x91')](_0xf9c8('0xc7'));}};Dialer[_0xf9c8('0x18')][_0xf9c8('0xc8')]=function(_0x15fb65,_0x492990){var _0x1e90a1=this;return function(_0x10ba23){_0x1e90a1[_0xf9c8('0xac')](_0x492990);logger[_0xf9c8('0x91')](_0x15fb65,util[_0xf9c8('0x92')](_0x10ba23,{'showHidden':![],'depth':null}));};};Dialer[_0xf9c8('0x18')][_0xf9c8('0xc9')]=function(_0x168305,_0x36ce85,_0x569796){var _0x29678a={'state':0x19,'statedesc':_0xf9c8('0xca')};this[_0xf9c8('0xac')](_0x36ce85);this[_0xf9c8('0xcb')](_[_0xf9c8('0x89')](_0x29678a,_[_0xf9c8('0xcc')](_0x569796,[_0xf9c8('0xcd'),_0xf9c8('0xce'),_0xf9c8('0xcf'),_0xf9c8('0xd0'),_0xf9c8('0xd1')])),_0xf9c8('0xd2'),_0xf9c8('0xd3'));logger[_0xf9c8('0x91')](_0x168305);};Dialer[_0xf9c8('0x18')][_0xf9c8('0xd4')]=function(_0x32d860){return _0x32d860===_0xf9c8('0xd5');};Dialer[_0xf9c8('0x18')][_0xf9c8('0xd6')]=function(_0x444e18){return!_[_0xf9c8('0x7f')](_0x444e18)&&_0x444e18&&!_[_0xf9c8('0x7f')](_0x444e18[_0xf9c8('0x3b')])&&!_[_0xf9c8('0x7f')](_0x444e18['active'])&&_0x444e18[_0xf9c8('0xd7')]&&(this[_0xf9c8('0x20')][util[_0xf9c8('0x71')]('SIP/%s',_0x444e18['name'])][_0xf9c8('0xa9')]==='reachable'||this[_0xf9c8('0x20')][util[_0xf9c8('0x71')](_0xf9c8('0xd8'),_0x444e18['name'])][_0xf9c8('0xa9')]===_0xf9c8('0xd9'));};Dialer[_0xf9c8('0x18')][_0xf9c8('0xcb')]=function(_0x147eec,_0x3440b3,_0x267cd1){this['createHistory'](_0x147eec)['catch'](loggerCatch(_0x3440b3));this['moveContactManagedDialer'](_0x147eec)[_0xf9c8('0xaa')](loggerCatch(_0x267cd1));};Dialer[_0xf9c8('0x18')][_0xf9c8('0x34')]=function(_0x5180e4){var _0x46f6f6=this[_0xf9c8('0x23')][_0x5180e4[_0xf9c8('0xda')]];var _0x37ac98;if(!_[_0xf9c8('0xa7')](_0x5180e4)&&!_[_0xf9c8('0xa7')](_0x5180e4[_0xf9c8('0xdb')])&&!_[_0xf9c8('0xa7')](_0x5180e4[_0xf9c8('0xdb')][_0xf9c8('0xdc')])&&_0x5180e4[_0xf9c8('0xdd')]==='xcally-motion-dialer'&&_0x46f6f6){if(_0x46f6f6[_0xf9c8('0x4a')]!==_0xf9c8('0x73')&&this[_0xf9c8('0x1d')][_0x46f6f6[_0xf9c8('0xad')]][_0xf9c8('0xde')]&&_0x5180e4[_0xf9c8('0xdf')]===_0xf9c8('0xe0')){delete this[_0xf9c8('0x23')][_0x5180e4[_0xf9c8('0xda')]];this['updateOriginated'](this['voiceQueues'][_0x46f6f6[_0xf9c8('0xad')]]);this[_0xf9c8('0x1d')][_0x46f6f6['queue']][_0xf9c8('0x5c')]+=0x1;this['voiceQueues'][_0x46f6f6[_0xf9c8('0xad')]][_0xf9c8('0x5b')]+=0x1;_0x37ac98=new Hangup(_0x46f6f6,_0x5180e4);_0x37ac98[_0xf9c8('0xa2')]=0x12;_0x37ac98[_0xf9c8('0xe1')]=_0xf9c8('0xe2');_0x37ac98[_0xf9c8('0xe3')]='AMD';ami[_0xf9c8('0x49')]('custom:amd',ut[_0xf9c8('0xe4')](_0x37ac98,_0xf9c8('0xe5')));this[_0xf9c8('0xcb')](_0x37ac98,'[syncHangupInAMD][createHistory]',_0xf9c8('0xe6'));}if(_0x46f6f6[_0xf9c8('0x4a')]!==_0xf9c8('0x73')&&this[_0xf9c8('0x1d')][_0x46f6f6[_0xf9c8('0xad')]][_0xf9c8('0xde')]&&_0x5180e4[_0xf9c8('0xdf')]===_0xf9c8('0xe7')){var _0x5e84eb=this;return new BPromise(function(_0x2404bf,_0x35a73e){delete _0x5e84eb[_0xf9c8('0x23')][_0x5180e4[_0xf9c8('0xda')]];_0x5e84eb[_0xf9c8('0xac')](_0x5e84eb[_0xf9c8('0x1d')][_0x46f6f6[_0xf9c8('0xad')]]);_0x5e84eb[_0xf9c8('0x1d')][_0x46f6f6['queue']][_0xf9c8('0x5c')]+=0x1;_0x5e84eb[_0xf9c8('0x1d')][_0x46f6f6[_0xf9c8('0xad')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x1c2f26=_0x5e84eb['voiceQueues'][_0x46f6f6[_0xf9c8('0xad')]];var _0x4e00a1=new Hangup(_0x46f6f6,_0x5180e4);_0x4e00a1[_0xf9c8('0xa2')]=0x13;_0x4e00a1[_0xf9c8('0xe1')]='Machine';_0x4e00a1['membername']=_0xf9c8('0xe8');_0x4e00a1['countmachineretry']+=0x1;_0x4e00a1['countglobal']+=0x1;_0x4e00a1[_0xf9c8('0xe5')]=!![];ami['emit']('custom:amd',ut['buildObj'](_0x4e00a1,'amd'));_0x5e84eb[_0xf9c8('0xc4')](_0x4e00a1)[_0xf9c8('0xaa')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x4e00a1[_0xf9c8('0xe9')]+_0x4e00a1[_0xf9c8('0xea')]+_0x4e00a1[_0xf9c8('0xeb')]+_0x4e00a1[_0xf9c8('0xec')]+_0x4e00a1[_0xf9c8('0xed')]+_0x4e00a1[_0xf9c8('0xee')]+_0x4e00a1[_0xf9c8('0xef')]+_0x4e00a1[_0xf9c8('0xf0')]>=_0x1c2f26[_0xf9c8('0xf1')]){_0x5e84eb[_0xf9c8('0xf2')](_0x4e00a1,_0x2404bf,_0x35a73e,_0xf9c8('0xf3'));}else{if(_0x4e00a1[_0xf9c8('0xef')]>=_0x1c2f26[_0xf9c8('0xf4')]){_0x5e84eb['createStateFinal'](_0x4e00a1,_0x2404bf,_0x35a73e,'reason\x2019\x20machine....');}else{_0x5e84eb[_0xf9c8('0xba')]({'active':![],'countmachineretry':_0x4e00a1[_0xf9c8('0xef')],'scheduledat':moment()[_0xf9c8('0xf5')](_0x1c2f26['dialMachineRetryFrequency'],'minutes')[_0xf9c8('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4e00a1[_0xf9c8('0xcd')],'ListId':_0x4e00a1[_0xf9c8('0xce')],'VoiceQueueId':_0x4e00a1[_0xf9c8('0xd0')]||undefined,'CampaignId':_0x4e00a1[_0xf9c8('0xd1')]||undefined})['catch'](loggerCatch(_0xf9c8('0xf6')));_0x2404bf({'reschedule':0x1});}}});}if(_0x46f6f6['type']===_0xf9c8('0x73')&&this['campaigns'][_0x46f6f6[_0xf9c8('0xad')]][_0xf9c8('0xde')]&&_0x5180e4[_0xf9c8('0xdf')]==='HANGUP'){delete this['uniqueId'][_0x5180e4[_0xf9c8('0xda')]];this[_0xf9c8('0xac')](this[_0xf9c8('0x1e')][_0x46f6f6[_0xf9c8('0xad')]]);_0x37ac98=new Hangup(_0x46f6f6,_0x5180e4);_0x37ac98[_0xf9c8('0xa2')]=0x12;_0x37ac98[_0xf9c8('0xe1')]=_0xf9c8('0xe2');_0x37ac98[_0xf9c8('0xe3')]='AMD';ami['emit'](_0xf9c8('0xf7'),ut[_0xf9c8('0xe4')](_0x37ac98,_0xf9c8('0xe5')));this[_0xf9c8('0xcb')](_0x37ac98,'[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]');}if(_0x46f6f6[_0xf9c8('0x4a')]===_0xf9c8('0x73')&&this[_0xf9c8('0x1e')][_0x46f6f6[_0xf9c8('0xad')]][_0xf9c8('0xde')]&&_0x5180e4[_0xf9c8('0xdf')]===_0xf9c8('0xe7')){var _0x5e84eb=this;return new BPromise(function(_0x204265,_0x5f069e){delete _0x5e84eb['uniqueId'][_0x5180e4[_0xf9c8('0xda')]];_0x5e84eb[_0xf9c8('0xac')](_0x5e84eb[_0xf9c8('0x1e')][_0x46f6f6[_0xf9c8('0xad')]]);_0x5e84eb[_0xf9c8('0x1e')][_0x46f6f6[_0xf9c8('0xad')]]['outboundAnswerCallsDay']+=0x1;_0x5e84eb[_0xf9c8('0x1e')][_0x46f6f6[_0xf9c8('0xad')]][_0xf9c8('0x5b')]+=0x1;var _0x237058=_0x5e84eb['campaigns'][_0x46f6f6[_0xf9c8('0xad')]];var _0x3f4f9a=new Hangup(_0x46f6f6,_0x5180e4);_0x3f4f9a[_0xf9c8('0xa2')]=0x13;_0x3f4f9a[_0xf9c8('0xe1')]=_0xf9c8('0xf8');_0x3f4f9a[_0xf9c8('0xe3')]=_0xf9c8('0xe8');_0x3f4f9a['countmachineretry']+=0x1;_0x3f4f9a[_0xf9c8('0xf9')]+=0x1;_0x3f4f9a[_0xf9c8('0xe5')]=!![];ami[_0xf9c8('0x49')]('custom:amd',ut[_0xf9c8('0xe4')](_0x3f4f9a,_0xf9c8('0xe5')));_0x5e84eb[_0xf9c8('0xc4')](_0x3f4f9a)[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0xfa')));if(_0x3f4f9a[_0xf9c8('0xe9')]+_0x3f4f9a[_0xf9c8('0xea')]+_0x3f4f9a[_0xf9c8('0xeb')]+_0x3f4f9a['countnosuchnumberretry']+_0x3f4f9a[_0xf9c8('0xed')]+_0x3f4f9a[_0xf9c8('0xee')]+_0x3f4f9a[_0xf9c8('0xef')]+_0x3f4f9a[_0xf9c8('0xf0')]>=_0x237058[_0xf9c8('0xf1')]){_0x5e84eb[_0xf9c8('0xf2')](_0x3f4f9a,_0x204265,_0x5f069e,_0xf9c8('0xf3'));}else{if(_0x3f4f9a['countmachineretry']>=_0x237058[_0xf9c8('0xf4')]){_0x5e84eb['createStateFinal'](_0x3f4f9a,_0x204265,_0x5f069e,_0xf9c8('0xfb'));}else{_0x5e84eb[_0xf9c8('0xba')]({'active':![],'countmachineretry':_0x3f4f9a[_0xf9c8('0xef')],'scheduledat':moment()['add'](_0x237058[_0xf9c8('0xfc')],_0xf9c8('0xfd'))[_0xf9c8('0x71')](_0xf9c8('0xfe')),'ContactId':_0x3f4f9a[_0xf9c8('0xcd')],'ListId':_0x3f4f9a[_0xf9c8('0xce')],'VoiceQueueId':_0x3f4f9a[_0xf9c8('0xd0')]||undefined,'CampaignId':_0x3f4f9a[_0xf9c8('0xd1')]||undefined})['catch'](loggerCatch(_0xf9c8('0xf6')));_0x204265({'reschedule':0x1});}}});}}};Dialer['prototype'][_0xf9c8('0x31')]=function(_0x42ceed){var _0x412d4d=this[_0xf9c8('0x23')][_0x42ceed['uniqueid']];var _0x5aebc2=this;var _0x27ed3d;if(_0x412d4d&&_0x412d4d['type']===_0xf9c8('0x73')){delete this[_0xf9c8('0x23')][_0x42ceed[_0xf9c8('0xda')]];this['updateOriginated'](this[_0xf9c8('0x1e')][_0x412d4d[_0xf9c8('0xad')]]);this[_0xf9c8('0x1e')][_0x412d4d[_0xf9c8('0xad')]][_0xf9c8('0xff')]+=0x1;_0x27ed3d=new Hangup(_0x412d4d,_0x42ceed);this[_0xf9c8('0xc4')](_0x27ed3d)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x27ed3d)[_0xf9c8('0xaa')](loggerCatch('[syncHangupIvr]'));}if(_0x412d4d&&_0x412d4d['type']!==_0xf9c8('0x73')&&isNotNull(this[_0xf9c8('0x1d')][_0x412d4d[_0xf9c8('0xad')]][_0xf9c8('0x100')])){delete this[_0xf9c8('0x23')][_0x42ceed[_0xf9c8('0xda')]];this[_0xf9c8('0xac')](this['voiceQueues'][_0x412d4d[_0xf9c8('0xad')]]);this[_0xf9c8('0x1d')][_0x412d4d['queue']][_0xf9c8('0x5c')]+=0x1;this[_0xf9c8('0x1d')][_0x412d4d[_0xf9c8('0xad')]][_0xf9c8('0x5b')]+=0x1;_0x27ed3d=new Hangup(_0x412d4d,_0x42ceed);_0x27ed3d['state']=0x10;_0x27ed3d['statedesc']=_0xf9c8('0x101');_0x27ed3d[_0xf9c8('0xe3')]=_0xf9c8('0x102');this[_0xf9c8('0xc4')](_0x27ed3d)[_0xf9c8('0xaa')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xf9c8('0xc3')](_0x27ed3d)[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0x103')));}if(_0x412d4d&&_0x412d4d[_0xf9c8('0x4a')]!==_0xf9c8('0x73')&&!isNotNull(this[_0xf9c8('0x1d')][_0x412d4d[_0xf9c8('0xad')]][_0xf9c8('0x100')])){delete this['uniqueId'][_0x42ceed['uniqueid']];this[_0xf9c8('0xac')](this[_0xf9c8('0x1d')][_0x412d4d[_0xf9c8('0xad')]]);this['voiceQueues'][_0x412d4d[_0xf9c8('0xad')]][_0xf9c8('0x66')]+=0x1;_0x27ed3d=new Hangup(_0x412d4d,_0x42ceed);_0x27ed3d[_0xf9c8('0xa2')]=0xc;_0x27ed3d['statedesc']=_0x42ceed[_0xf9c8('0x104')];_0x27ed3d[_0xf9c8('0xe3')]='Unknow';this[_0xf9c8('0xc4')](_0x27ed3d)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xf9c8('0xc3')](_0x27ed3d)['catch'](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xf9c8('0x18')]['syncAgentComplete']=function(_0x4dc652){var _0x2bcc25=this['uniqueId'][_0x4dc652[_0xf9c8('0xda')]];var _0x48ab7f=this;if(this['voiceQueues'][_0x4dc652[_0xf9c8('0xad')]]){if(_0x2bcc25&&_0x2bcc25['type']!==_0xf9c8('0x73')){delete this[_0xf9c8('0x23')][_0x4dc652[_0xf9c8('0xda')]];this[_0xf9c8('0x1d')][_0x4dc652[_0xf9c8('0xad')]][_0xf9c8('0x5c')]+=0x1;var _0x3b36dd=new AgentComplete(_0x2bcc25,_0x4dc652);if(_0x4dc652[_0xf9c8('0x105')]===_0xf9c8('0x106')){_0x3b36dd[_0xf9c8('0x107')]=this[_0xf9c8('0x1d')][_0x4dc652['queue']][_0xf9c8('0x108')]&&this[_0xf9c8('0x1d')][_0x4dc652[_0xf9c8('0xad')]][_0xf9c8('0x109')]?moment()[_0xf9c8('0x71')](_0xf9c8('0xfe')):undefined;}this[_0xf9c8('0xc4')](_0x3b36dd)[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0x10a')));this[_0xf9c8('0xc3')](_0x3b36dd)[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0x10b')));}}};Dialer[_0xf9c8('0x18')][_0xf9c8('0x28')]=function(_0x55c2b5){if(this['voiceQueues'][_0x55c2b5[_0xf9c8('0xad')]]){if(this[_0xf9c8('0x23')][_0x55c2b5[_0xf9c8('0xda')]]&&this['uniqueId'][_0x55c2b5[_0xf9c8('0xda')]][_0xf9c8('0x4a')]!=='ivr'){this[_0xf9c8('0xac')](this[_0xf9c8('0x1d')][_0x55c2b5[_0xf9c8('0xad')]]);this[_0xf9c8('0x23')][_0x55c2b5['uniqueid']]['answertime']=moment()[_0xf9c8('0x71')](_0xf9c8('0xfe'));}}};Dialer[_0xf9c8('0x18')][_0xf9c8('0x10c')]=function(_0x3cfecd){this[_0xf9c8('0xc4')](_0x3cfecd)[_0xf9c8('0xaa')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xf9c8('0xc3')](_0x3cfecd)['catch'](loggerCatch(_0xf9c8('0x10d')));};Dialer[_0xf9c8('0x18')]['syncQueueCallerAbandon']=function(_0x1f0a1e){var _0x20f8e8=this['uniqueId'][_0x1f0a1e[_0xf9c8('0xda')]];var _0x2762b4=this;if(this[_0xf9c8('0x1d')][_0x1f0a1e[_0xf9c8('0xad')]]){if(_0x20f8e8&&_0x20f8e8[_0xf9c8('0x4a')]!==_0xf9c8('0x73')){delete this[_0xf9c8('0x23')][_0x1f0a1e[_0xf9c8('0xda')]];this['updateOriginated'](this['voiceQueues'][_0x1f0a1e[_0xf9c8('0xad')]]);_0x20f8e8['droptime']=moment()[_0xf9c8('0x71')](_0xf9c8('0xfe'));var _0x587d12=new QueueCallerAbandon(_0x20f8e8,_0x1f0a1e);if(getSeconds(_0x20f8e8[_0xf9c8('0x10e')],_0x20f8e8[_0xf9c8('0x10f')])>=_0x20f8e8['dialQueueTimeout']){this['voiceQueues'][_0x1f0a1e[_0xf9c8('0xad')]][_0xf9c8('0x6b')]+=0x1;this[_0xf9c8('0x1d')][_0x1f0a1e[_0xf9c8('0xad')]][_0xf9c8('0x61')]+=0x1;this[_0xf9c8('0x1d')][_0x1f0a1e[_0xf9c8('0xad')]][_0xf9c8('0x110')]+=0x1;_0x587d12['state']=0xa;_0x587d12[_0xf9c8('0xe1')]=_0xf9c8('0x111');_0x587d12[_0xf9c8('0x112')]=_0xf9c8('0x113');_0x587d12[_0xf9c8('0x107')]=this[_0xf9c8('0x1d')][_0x1f0a1e[_0xf9c8('0xad')]]['dialQueueProject2']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x587d12[_0xf9c8('0xed')]+=0x1;_0x587d12[_0xf9c8('0xf9')]+=0x1;if(_0x587d12[_0xf9c8('0xed')]>=this[_0xf9c8('0x1d')][_0x1f0a1e[_0xf9c8('0xad')]][_0xf9c8('0x114')]){this[_0xf9c8('0x10c')](_0x587d12);}else{this[_0xf9c8('0xba')]({'active':![],'countdropretry':_0x587d12[_0xf9c8('0xed')],'scheduledat':moment()['add'](this['voiceQueues'][_0x1f0a1e[_0xf9c8('0xad')]][_0xf9c8('0x115')],_0xf9c8('0xfd'))[_0xf9c8('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x20f8e8['ContactId'],'ListId':_0x20f8e8[_0xf9c8('0xce')],'VoiceQueueId':_0x20f8e8[_0xf9c8('0xd0')]||undefined,'CampaignId':_0x20f8e8[_0xf9c8('0xd1')]||undefined})['catch'](loggerCatch(_0xf9c8('0x116')));var _0x51fc47=new History(_0x587d12);_0x51fc47[_0xf9c8('0xa2')]=0xa;_0x51fc47['statedesc']='Drop';_0x51fc47[_0xf9c8('0x117')]=moment()[_0xf9c8('0x71')]('YYYY-MM-DD\x20HH:mm:ss');_0x51fc47['endtime']=_0x51fc47[_0xf9c8('0x117')];_0x51fc47[_0xf9c8('0x118')]=_0x587d12[_0xf9c8('0x118')];_0x51fc47[_0xf9c8('0x119')]=_0x587d12[_0xf9c8('0x119')];this['createHistory'](_0x51fc47)['catch'](loggerCatch(_0xf9c8('0x11a')));}}else{this[_0xf9c8('0x1d')][_0x1f0a1e[_0xf9c8('0xad')]][_0xf9c8('0x6a')]+=0x1;this[_0xf9c8('0x1d')][_0x1f0a1e[_0xf9c8('0xad')]][_0xf9c8('0x60')]+=0x1;_0x587d12[_0xf9c8('0xa2')]=0xb;_0x587d12[_0xf9c8('0xe1')]=_0xf9c8('0x11b');_0x587d12[_0xf9c8('0x112')]='CALLEREXIT';_0x587d12[_0xf9c8('0xee')]+=0x1;_0x587d12[_0xf9c8('0xf9')]+=0x1;if(_0x587d12[_0xf9c8('0xee')]>=this['voiceQueues'][_0x1f0a1e['queue']]['dialAbandonedMaxRetry']){this[_0xf9c8('0x10c')](_0x587d12);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x587d12[_0xf9c8('0xee')],'scheduledat':moment()[_0xf9c8('0xf5')](this['voiceQueues'][_0x1f0a1e['queue']][_0xf9c8('0x11c')],_0xf9c8('0xfd'))[_0xf9c8('0x71')](_0xf9c8('0xfe')),'ContactId':_0x20f8e8[_0xf9c8('0xcd')],'ListId':_0x20f8e8[_0xf9c8('0xce')],'VoiceQueueId':_0x20f8e8[_0xf9c8('0xd0')]||undefined,'CampaignId':_0x20f8e8[_0xf9c8('0xd1')]||undefined})[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0x11d')));var _0x51fc47=new History(_0x587d12);_0x51fc47[_0xf9c8('0xa2')]=0xb;_0x51fc47[_0xf9c8('0xe1')]=_0xf9c8('0x11b');_0x51fc47[_0xf9c8('0x117')]=moment()[_0xf9c8('0x71')](_0xf9c8('0xfe'));_0x51fc47[_0xf9c8('0xa3')]=_0x51fc47['starttime'];_0x51fc47['calleridname']=_0x587d12['calleridname'];_0x51fc47[_0xf9c8('0x119')]=_0x587d12['calleridnum'];this[_0xf9c8('0xc4')](_0x51fc47)[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0x11e')));}}}}};Dialer[_0xf9c8('0x18')][_0xf9c8('0x32')]=function(_0x135c82){if(this['actions'][_0x135c82[_0xf9c8('0xda')]]){this['actions'][_0x135c82[_0xf9c8('0xda')]]['channel']=_0x135c82['channel'];}if(this[_0xf9c8('0x23')][_0x135c82[_0xf9c8('0xda')]]){this['uniqueId'][_0x135c82[_0xf9c8('0xda')]]['channel']=_0x135c82['channel'];}};Dialer[_0xf9c8('0x18')]['syncQueueMember']=function(_0x380e00){if(strategy[this[_0xf9c8('0x1d')][this[_0xf9c8('0x22')][_0x380e00[_0xf9c8('0x11f')]][_0xf9c8('0xad')]][_0xf9c8('0x120')]]==='roundrobin'){if(this[_0xf9c8('0x22')][_0x380e00[_0xf9c8('0x11f')]]&&_['isNil'](this[_0xf9c8('0x22')][_0x380e00['actionid']]['locked'])&&_0x380e00[_0xf9c8('0xa9')]==='1'&&_0x380e00['paused']==='0'){if(this[_0xf9c8('0x1f')][_0x380e00[_0xf9c8('0x121')]]){if(!this['agents'][_0x380e00[_0xf9c8('0x121')]][_0xf9c8('0x122')]){this[_0xf9c8('0x1f')][_0x380e00['stateinterface']][_0xf9c8('0x122')]=!![];this[_0xf9c8('0x22')][_0x380e00[_0xf9c8('0x11f')]][_0xf9c8('0x122')]=!![];this[_0xf9c8('0x22')][_0x380e00['actionid']]['stateinterface']=_0x380e00[_0xf9c8('0x121')];}}}}else if((strategy[this[_0xf9c8('0x1d')][this[_0xf9c8('0x22')][_0x380e00[_0xf9c8('0x11f')]]['queue']]['strategy']]||_0xf9c8('0x16'))==='rrmemory'){if(this[_0xf9c8('0x22')][_0x380e00[_0xf9c8('0x11f')]]){if(this[_0xf9c8('0x1f')][_0x380e00['stateinterface']]){this[_0xf9c8('0x22')][_0x380e00[_0xf9c8('0x11f')]][_0xf9c8('0x121')]=_0x380e00[_0xf9c8('0x121')];if(_['isNil'](this['queueBooked'][this[_0xf9c8('0x22')][_0x380e00[_0xf9c8('0x11f')]]['queue']])){this[_0xf9c8('0x26')][this['actions'][_0x380e00[_0xf9c8('0x11f')]][_0xf9c8('0xad')]]=[];}this['queueBooked'][this['actions'][_0x380e00[_0xf9c8('0x11f')]][_0xf9c8('0xad')]][_0xf9c8('0x123')](_[_0xf9c8('0x89')](_[_0xf9c8('0xcc')](this[_0xf9c8('0x22')][_0x380e00[_0xf9c8('0x11f')]],[_0xf9c8('0x124'),_0xf9c8('0x121')]),{'status':_0x380e00[_0xf9c8('0xa9')],'paused':_0x380e00['paused']}));}}}};function unlockQueueStatus(_0x4f1680,_0xfc517b){setTimeout(function(){if(_[_0xf9c8('0x7f')](_0x4f1680[_0xf9c8('0x125')])){loggerBooked[_0xf9c8('0x91')](_0xf9c8('0x126'),_0xfc517b);}_0x4f1680[_0xf9c8('0x125')]=!![];loggerBooked['info']('[booked][unlockQueueStatus]',_0xfc517b,JSON['stringify'](_[_0xf9c8('0xcc')](_0x4f1680,['name',_0xf9c8('0x125')])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0x498d98){var _0x2146d2=this;var _0x57ddee=_0x2146d2[_0xf9c8('0x1d')][_0x2146d2['actions'][_0x498d98[_0xf9c8('0x11f')]]['queue']];if(strategy[this[_0xf9c8('0x1d')][this['actions'][_0x498d98[_0xf9c8('0x11f')]][_0xf9c8('0xad')]][_0xf9c8('0x120')]]===_0xf9c8('0x17')){if(this[_0xf9c8('0x22')][_0x498d98['actionid']]&&this[_0xf9c8('0x22')][_0x498d98[_0xf9c8('0x11f')]][_0xf9c8('0x121')]){this['preview'][_0xf9c8('0x127')](this[_0xf9c8('0x22')][_0x498d98['actionid']]['idHopper'],this[_0xf9c8('0x22')][_0x498d98['actionid']][_0xf9c8('0x121')])[_0xf9c8('0xaa')](function(_0xdd4ff5){logger[_0xf9c8('0x91')](_0xf9c8('0x128'),util[_0xf9c8('0x92')](_0xdd4ff5,{'showHidden':![],'depth':null}));})[_0xf9c8('0x1a')](function(){_0x2146d2['updateOriginated'](_0x2146d2['voiceQueues'][_0x2146d2['actions'][_0x498d98['actionid']][_0xf9c8('0xad')]]);_0x2146d2[_0xf9c8('0x1f')][_0x2146d2[_0xf9c8('0x22')][_0x498d98[_0xf9c8('0x11f')]][_0xf9c8('0x121')]]['locked']=![];delete _0x2146d2['actions'][_0x498d98['actionid']];unlockQueueStatus(_0x57ddee);});}else{this[_0xf9c8('0xac')](this[_0xf9c8('0x1d')][this[_0xf9c8('0x22')][_0x498d98['actionid']][_0xf9c8('0xad')]]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x498d98['actionid']][_0xf9c8('0xcd')],'ListId':this[_0xf9c8('0x22')][_0x498d98[_0xf9c8('0x11f')]][_0xf9c8('0xce')],'VoiceQueueId':this['actions'][_0x498d98[_0xf9c8('0x11f')]][_0xf9c8('0xd0')]||undefined,'CampaignId':this['actions'][_0x498d98[_0xf9c8('0x11f')]][_0xf9c8('0xd1')]||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x498d98[_0xf9c8('0x11f')]];unlockQueueStatus(_0x57ddee);}}else if((strategy[this[_0xf9c8('0x1d')][this[_0xf9c8('0x22')][_0x498d98['actionid']][_0xf9c8('0xad')]]['strategy']]||_0xf9c8('0x16'))===_0xf9c8('0x16')){var _0x4e5c0a;if(this[_0xf9c8('0x22')][_0x498d98[_0xf9c8('0x11f')]]&&!_[_0xf9c8('0x75')](this[_0xf9c8('0x26')][this[_0xf9c8('0x22')][_0x498d98[_0xf9c8('0x11f')]][_0xf9c8('0xad')]])){if(this[_0xf9c8('0x129')][_0x2146d2[_0xf9c8('0x22')][_0x498d98[_0xf9c8('0x11f')]][_0xf9c8('0xad')]]){this[_0xf9c8('0x129')][_0x2146d2[_0xf9c8('0x22')][_0x498d98[_0xf9c8('0x11f')]][_0xf9c8('0xad')]]=this[_0xf9c8('0x129')][this['actions'][_0x498d98['actionid']]['queue']]?this[_0xf9c8('0x129')][this['actions'][_0x498d98['actionid']]['queue']]:this[_0xf9c8('0x26')][this['actions'][_0x498d98[_0xf9c8('0x11f')]][_0xf9c8('0xad')]]?this[_0xf9c8('0x26')][this[_0xf9c8('0x22')][_0x498d98[_0xf9c8('0x11f')]][_0xf9c8('0xad')]][_0xf9c8('0x12a')]||0x0:0x0;}this[_0xf9c8('0x26')][this[_0xf9c8('0x22')][_0x498d98['actionid']][_0xf9c8('0xad')]][_0xf9c8('0x12a')]=this['queueBookedRR'][this[_0xf9c8('0x22')][_0x498d98[_0xf9c8('0x11f')]]['queue']];for(var _0x481ab2=0x0;_0x481ab2=0x0;})[_0xf9c8('0xaa')](myreject(_0x38f3b5)));}}else{_0x892778[_0xf9c8('0x123')](ami[_0xf9c8('0xa8')]({'action':_0xf9c8('0x149'),'command':util['format'](_0xf9c8('0x143'),_0x1d5788,!_[_0xf9c8('0x7f')](config[_0xf9c8('0x145')][_0x199f3c])?_0x199f3c:'')})[_0xf9c8('0xb4')](function(_0x187d0c){return _0x187d0c[_0xf9c8('0x146')]['indexOf'](_0xf9c8('0x148'))>=0x0;})['catch'](myreject(_0x38f3b5)));}BPromise[_0xf9c8('0x14a')](_0x892778)[_0xf9c8('0xb4')](function(_0x2264e3){var _0x586fcf=_['some'](_0x2264e3);if(_0x586fcf){return _0x15a2bd(_0x586fcf);}else{_0x262b43[_0xf9c8('0x39')]=_0x5eecf3?_0xf9c8('0x14b'):_0xf9c8('0x14c');return _0x38f3b5(msgResponse(_0xf9c8('0x14d'),_0xf9c8('0x13d'),_0xf9c8('0x14e')+_0x5eecf3+'\x20'+_0x25543c+_0xf9c8('0x14f')+util[_0xf9c8('0x92')](_0x1d5788,{'showHidden':![],'depth':null})+_0xf9c8('0x150')+_0x199f3c));}})['catch'](function(_0x5ebe14){return _0x38f3b5(msgResponse(_0xf9c8('0x13b'),_0xf9c8('0x13d'),JSON[_0xf9c8('0x45')](_0x5ebe14)));});});};Dialer[_0xf9c8('0x18')][_0xf9c8('0x151')]=function(_0x569c7a){var _0x3c1292=this;return function(){switch(_0x569c7a[_0xf9c8('0x57')]){case _0xf9c8('0x152'):freeVariablesPredictive(_0x569c7a);_0x3c1292['handlePower'](_0x569c7a,0x1);break;case _0xf9c8('0x153'):freeVariablesPredictive(_0x569c7a);_0x3c1292[_0xf9c8('0x154')](_0x569c7a,_0x569c7a[_0xf9c8('0x155')]);break;case _0xf9c8('0x7'):_0x3c1292[_0xf9c8('0x7')](_0x569c7a);break;case'booked':freeVariablesPredictive(_0x569c7a);_0x3c1292[_0xf9c8('0x154')](_0x569c7a,0x1);break;default:freeVariablesPredictive(_0x569c7a);logger['error']('Queue',_0x569c7a['name'],'method\x20not\x20recognized');}};};Dialer[_0xf9c8('0x18')]['launchHandleIvr']=function(_0x5229cf){var _0x51ebf0=this;return function(){_0x51ebf0[_0xf9c8('0x156')](_0x5229cf);};};Dialer['prototype']['syncQueueSummary']=function(_0x4c1972){var _0xb5d8f7=this;if(isNotPreview(_0x4c1972[_0xf9c8('0x57')])){if(isVoiceQueueOutbound(_0x4c1972[_0xf9c8('0x4a')])&&isActive(_0x4c1972['dialActive'])){_0x4c1972[_0xf9c8('0x9b')]=!![];BPromise[_0xf9c8('0xb1')]()[_0xf9c8('0xb4')](checkIsLoggedIn(_0x4c1972,_0x4c1972[_0xf9c8('0x4c')]))[_0xf9c8('0xb4')](checkIsActive(_0x4c1972,_0x4c1972[_0xf9c8('0x157')]))[_0xf9c8('0xb4')](checkInterval(_0x4c1972))[_0xf9c8('0xb4')](_0xb5d8f7[_0xf9c8('0x158')](_0x4c1972))[_0xf9c8('0xb4')](_0xb5d8f7[_0xf9c8('0x13a')](_0x4c1972[_0xf9c8('0x159')],_0x4c1972[_0xf9c8('0x15a')],_0x4c1972[_0xf9c8('0x3b')],_0x4c1972))[_0xf9c8('0xb4')](_0xb5d8f7['checkIfTimeIntervals'](_0x4c1972[_0xf9c8('0x41')],_0x4c1972[_0xf9c8('0x15a')],_0x4c1972[_0xf9c8('0x3b')],_0x4c1972))[_0xf9c8('0xb4')](_0xb5d8f7[_0xf9c8('0x151')](_0x4c1972))[_0xf9c8('0xaa')](loggerCatchQueueSummary(_0xf9c8('0x15b'),_0x4c1972));}else{notSendMessagesQueue(_0x4c1972);}}else{freeVariablesPredictive(_0x4c1972);}};Dialer[_0xf9c8('0x18')][_0xf9c8('0x137')]=function(){var _0x14f0d5=this;var _0xb65ed9;for(var _0x1e1828 in this[_0xf9c8('0x1e')]){if(typeof this[_0xf9c8('0x1e')][_0x1e1828]!=='undefined'){_0xb65ed9=this[_0xf9c8('0x1e')][_0x1e1828];if(isCampaignIvr(_0xb65ed9[_0xf9c8('0x4a')])&&isActive(_0xb65ed9[_0xf9c8('0xd7')])){_0xb65ed9[_0xf9c8('0x9b')]=!![];BPromise[_0xf9c8('0xb1')]()[_0xf9c8('0xb4')](checkIsActive(_0xb65ed9,_0xb65ed9[_0xf9c8('0xd7')]))[_0xf9c8('0xb4')](checkInterval(_0xb65ed9))[_0xf9c8('0xb4')](_0x14f0d5[_0xf9c8('0x158')](_0xb65ed9))[_0xf9c8('0xb4')](_0x14f0d5['checkIfTime'](_0xb65ed9['dialGlobalInterval'],_0xb65ed9[_0xf9c8('0x15a')],_0xb65ed9[_0xf9c8('0x3b')],_0xb65ed9))[_0xf9c8('0xb4')](_0x14f0d5['checkIfTimeIntervals'](_0xb65ed9[_0xf9c8('0x41')],_0xb65ed9[_0xf9c8('0x15a')],_0xb65ed9[_0xf9c8('0x3b')],_0xb65ed9))[_0xf9c8('0xb4')](_0x14f0d5['launchHandleIvr'](_0xb65ed9))[_0xf9c8('0xaa')](loggerCatchQueueSummary('[syncCampaigns]',_0xb65ed9));}else{notSendMessagesCampaign(_0xb65ed9);}}}};function getCallerIdRandom(_0x33102f,_0x15c77e){var _0x361496;var _0x50e948;var _0x56712f;if(_0x15c77e<=0x0){_0x15c77e=0x1;}_0x361496=new RegExp(_0xf9c8('0x15c')+_0x15c77e+'}$');_0x50e948=Math[_0xf9c8('0x15d')](0xa,_0x15c77e-0x1);_0x56712f=Math[_0xf9c8('0x15d')](0xa,_0x15c77e)-0x1;return util[_0xf9c8('0x71')]('%s',_[_0xf9c8('0x15e')](_0x33102f,_0x361496,_[_0xf9c8('0x15f')](_0x50e948,_0x56712f)));}function extractCalleridName(_0x73f7f2){var _0x133260=_0x73f7f2['match'](/"(.*?)"/);return _0x133260?_0x133260[0x1]:_0x73f7f2;}function extractCalleridNumber(_0x34cf04){var _0x1fd17a=_0x34cf04['match'](/<(.*?)>/);return _0x1fd17a?_0x1fd17a[0x1]:_0x34cf04;}Dialer[_0xf9c8('0x18')][_0xf9c8('0x160')]=function(_0x1a98df,_0x1ed0c4){var _0x5d402c=this;var _0x4625e9=uuid['v4']();this['actions'][_0x4625e9]=new Action(_0x1a98df,_0x1ed0c4,_0x4625e9);return new BPromise(function(_0x31fdee,_0xb506bc){if(_['isUndefined'](_0x1a98df)&&typeof _0x1a98df!==_0xf9c8('0x161')){return _0xb506bc(msgResponse(_0xf9c8('0x162'),'Failure',_0xf9c8('0x163')));}if(_[_0xf9c8('0x7f')](_0x1ed0c4[_0xf9c8('0x164')]['phone'])||_0x1ed0c4['Contact'][_0xf9c8('0x165')]===null){return _0xb506bc(msgResponse(_0xf9c8('0x162'),_0xf9c8('0x13d'),'contact\x20is\x20undefine'));}var _0x35973a={'XMD-CALLERID':_0x5d402c[_0xf9c8('0x22')][_0x4625e9]['getCaller'](),'XMD-AGI':_0x1a98df[_0xf9c8('0x100')]?util[_0xf9c8('0x71')](_0xf9c8('0x166'),ipAgi,_0x1a98df[_0xf9c8('0x100')]):_0xf9c8('0x167'),'XMD-AGIAFTER':_0x1a98df['dialQueueProject2']?util[_0xf9c8('0x71')](_0xf9c8('0x166'),ipAgi,_0x1a98df[_0xf9c8('0x108')]):_0xf9c8('0x167'),'XMD-QUEUE':_0x1a98df[_0xf9c8('0x4a')]==='outbound'?util[_0xf9c8('0x71')](_0xf9c8('0x168'),_0x1a98df[_0xf9c8('0x3b')],_0x1a98df[_0xf9c8('0x169')]||'',_0x1a98df[_0xf9c8('0x109')]?'c':'',_0x1a98df[_0xf9c8('0x16a')]||0x3):_0xf9c8('0x167'),'XMD-CONTACTID':_0x1ed0c4[_0xf9c8('0xcd')],'XMD-CDRTYPE':_0xf9c8('0x16b'),'CALLERID(all)':_0x5d402c[_0xf9c8('0x22')][_0x4625e9][_0xf9c8('0x16c')](),'XMD-AMD':_0x1a98df['dialAMDActive']?'ACTIVE':_0xf9c8('0x167'),'XMD-DESTINATION':_0xf9c8('0x16d')};if(_0x1a98df['dialAMDActive']){_0x35973a[_0xf9c8('0x16e')]=_0x1a98df[_0xf9c8('0x16f')]||0x9c4;_0x35973a[_0xf9c8('0x170')]=_0x1a98df['dialAMDGreeting']||0x5dc;_0x35973a[_0xf9c8('0x171')]=_0x1a98df[_0xf9c8('0x172')]||0x320;_0x35973a[_0xf9c8('0x173')]=_0x1a98df[_0xf9c8('0x174')]||0x1388;_0x35973a['XMD-AMDMINWORDLENGTH']=_0x1a98df[_0xf9c8('0x175')]||0x64;_0x35973a['XMD-AMDBETWEENWORDSSILENCE']=_0x1a98df['dialAMDBetweenWordsSilence']||0x32;_0x35973a[_0xf9c8('0x176')]=_0x1a98df[_0xf9c8('0x177')]||0x3;_0x35973a[_0xf9c8('0x178')]=_0x1a98df[_0xf9c8('0x179')]||0x100;_0x35973a[_0xf9c8('0x17a')]=_0x1a98df[_0xf9c8('0x17b')]||0x1388;}if(_0x1a98df[_0xf9c8('0x4a')]==='outbound'){_0x35973a[_0xf9c8('0x17c')]=_0x1ed0c4[_0xf9c8('0xd0')];}else{_0x35973a[_0xf9c8('0x17d')]=_0x1ed0c4['CampaignId'];}for(var _0x5e5bba in _0x1ed0c4[_0xf9c8('0x164')]){if(typeof _0x1ed0c4[_0xf9c8('0x164')][_0x5e5bba]!==_0xf9c8('0x95')){if(isNotNull(_0x1ed0c4[_0xf9c8('0x164')][_0x5e5bba])&&_0x5e5bba!=='id'&&_0x5e5bba!==_0xf9c8('0x17e')&&_0x5e5bba!==_0xf9c8('0x17f')&&_0x5e5bba!=='updatedAt'){_0x35973a[util[_0xf9c8('0x71')](_0xf9c8('0x180'),_0xf9c8('0x181'),_[_0xf9c8('0x182')](_0x5e5bba))]=_0x1ed0c4[_0xf9c8('0x164')][_0x5e5bba];}}}var _0x5a8162=_0x5d402c[_0xf9c8('0xd6')](_0x1a98df[_0xf9c8('0x70')])?getCallerId(_0x1a98df['Trunk'][_0xf9c8('0x183')],_0x1a98df['dialOriginateCallerIdName'],_0x1a98df[_0xf9c8('0x184')]>0x0?getCallerIdRandom(_0x1a98df[_0xf9c8('0x58')],_0x1a98df['dialRandomLastDigitCallerIdNumber']):_0x1a98df['dialOriginateCallerIdNumber']):getCallerId(_[_0xf9c8('0xa7')](_0x1a98df['TrunkBackup'])?_0x1a98df['Trunk'][_0xf9c8('0x183')]:_0x1a98df[_0xf9c8('0x138')][_0xf9c8('0x183')],_0x1a98df['dialOriginateCallerIdName'],_0x1a98df[_0xf9c8('0x184')]>0x0?getCallerIdRandom(_0x1a98df[_0xf9c8('0x58')],_0x1a98df[_0xf9c8('0x184')]):_0x1a98df[_0xf9c8('0x58')]);if(_0x5a8162){_0x35973a['XMD-ORIGINATECALLERIDNAME']=_0x5d402c[_0xf9c8('0x22')][_0x4625e9][_0xf9c8('0x185')]=extractCalleridName(_0x5a8162);_0x35973a[_0xf9c8('0x186')]=_0x5d402c['actions'][_0x4625e9][_0xf9c8('0x187')]=extractCalleridNumber(_0x5a8162);}return ami[_0xf9c8('0xa8')]({'actionid':_0x4625e9,'action':'originate','channel':_0x5d402c['isTrunkReachable'](_0x1a98df[_0xf9c8('0x70')])?util[_0xf9c8('0x71')](_0xf9c8('0x188'),_0x1a98df[_0xf9c8('0x70')][_0xf9c8('0x3b')],isNotNull(_0x1a98df[_0xf9c8('0x5a')])?_0x1a98df['dialPrefix'][_0xf9c8('0x189')]()||'':'',_0x1a98df['dialCutDigit']>0x0?_0x1ed0c4[_0xf9c8('0x164')][_0xf9c8('0x165')][_0xf9c8('0x18a')](_0x1a98df[_0xf9c8('0x18b')]):_0x1ed0c4[_0xf9c8('0x164')]['phone']):util[_0xf9c8('0x71')]('SIP/%s/%s%s',_['isNil'](_0x1a98df['TrunkBackup'])?_0x1a98df[_0xf9c8('0x70')][_0xf9c8('0x3b')]:_0x1a98df[_0xf9c8('0x138')]['name'],isNotNull(_0x1a98df[_0xf9c8('0x5a')])?_0x1a98df[_0xf9c8('0x5a')][_0xf9c8('0x189')]()||'':'',_0x1a98df['dialCutDigit']>0x0?_0x1ed0c4['Contact'][_0xf9c8('0x165')][_0xf9c8('0x18a')](_0x1a98df[_0xf9c8('0x18b')]):_0x1ed0c4[_0xf9c8('0x164')][_0xf9c8('0x165')]),'callerid':_0x5a8162,'Exten':'xcally-motion-dialer','Context':_0xf9c8('0x18c'),'Priority':'1','variable':_0x35973a,'timeout':(_0x1a98df[_0xf9c8('0x59')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4625e9})[_0xf9c8('0xb4')](function(_0x3c3edf){return _0x31fdee(_0x3c3edf);})['catch'](function(_0x3e70b0){_0x1a98df[_0xf9c8('0x64')]+=0x1;var _0x5be02b=new History(_0x5d402c[_0xf9c8('0x22')][_0x4625e9]);logger['error'](util[_0xf9c8('0x71')](_0xf9c8('0x18d'),JSON[_0xf9c8('0x45')](_0x3e70b0)));_0x5be02b[_0xf9c8('0xa2')]=0xe;_0x5be02b['statedesc']=_0xf9c8('0x18e');_0x5be02b[_0xf9c8('0x117')]=moment()[_0xf9c8('0x71')](_0xf9c8('0xfe'));_0x5be02b['endtime']=_0x5be02b['starttime'];_0x5d402c[_0xf9c8('0xc4')](_0x5be02b)[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0x18f')));_0x5d402c[_0xf9c8('0xc3')](_0x5be02b)[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0x18f')))[_0xf9c8('0x1a')](function(){delete _0x5d402c[_0xf9c8('0x22')][_0x4625e9];return _0xb506bc(msgResponse(_0xf9c8('0x162'),'Error',_0xf9c8('0x190')));});});});};Dialer[_0xf9c8('0x18')][_0xf9c8('0x2d')]=function(_0x56aefc){var _0x2c65aa=this[_0xf9c8('0x22')][_0x56aefc[_0xf9c8('0x11f')]];if(_0x2c65aa){delete this[_0xf9c8('0x22')][_0x56aefc[_0xf9c8('0x11f')]];_0x2c65aa[_0xf9c8('0x10f')]=moment()['format'](_0xf9c8('0xfe'));var _0x4503f8=_0x2c65aa[_0xf9c8('0x4a')]===_0xf9c8('0x73')?this[_0xf9c8('0x1e')][_0x2c65aa[_0xf9c8('0xad')]]:this[_0xf9c8('0x1d')][_0x2c65aa[_0xf9c8('0x191')]()];if(!this[_0xf9c8('0xd4')](_0x56aefc['response'])){this[_0xf9c8('0xac')](_0x4503f8);return this[_0xf9c8('0x192')](_0x2c65aa,_0x4503f8,_0x56aefc)['catch'](loggerCatch(_0xf9c8('0x193')));}this[_0xf9c8('0x23')][_0x56aefc[_0xf9c8('0xda')]]=_0x2c65aa;}};Dialer['prototype'][_0xf9c8('0x194')]=function(_0x470ca9,_0x2f63ce,_0x16efb5){var _0x28554b=new History(_0x2f63ce);if(_0x28554b[_0xf9c8('0xe9')]+_0x28554b[_0xf9c8('0xea')]+_0x28554b[_0xf9c8('0xeb')]+_0x28554b[_0xf9c8('0xec')]+_0x28554b['countdropretry']+_0x28554b[_0xf9c8('0xee')]+_0x28554b[_0xf9c8('0xef')]+_0x28554b[_0xf9c8('0xf0')]>=_0x16efb5[_0xf9c8('0xf1')]-0x1){return!![];}switch(_0x470ca9){case 0x3:if(_0x28554b['countnoanswerretry']>=_0x16efb5[_0xf9c8('0x195')]-0x1){return!![];}this[_0xf9c8('0xba')]({'active':![],'countnoanswerretry':_0x28554b[_0xf9c8('0xeb')]+=0x1,'scheduledat':moment()['add'](_0x16efb5[_0xf9c8('0x196')],_0xf9c8('0xfd'))[_0xf9c8('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x28554b[_0xf9c8('0xcd')],'ListId':_0x28554b[_0xf9c8('0xce')],'VoiceQueueId':_0x28554b[_0xf9c8('0xd0')]||undefined,'CampaignId':_0x28554b[_0xf9c8('0xd1')]||undefined})[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0x197')));break;case 0x5:if(_0x28554b[_0xf9c8('0xe9')]>=_0x16efb5[_0xf9c8('0x198')]-0x1){return!![];}this[_0xf9c8('0xba')]({'active':![],'countbusyretry':_0x28554b[_0xf9c8('0xe9')]+=0x1,'scheduledat':moment()[_0xf9c8('0xf5')](_0x16efb5[_0xf9c8('0x199')],_0xf9c8('0xfd'))[_0xf9c8('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x28554b[_0xf9c8('0xcd')],'ListId':_0x28554b[_0xf9c8('0xce')],'VoiceQueueId':_0x28554b[_0xf9c8('0xd0')]||undefined,'CampaignId':_0x28554b[_0xf9c8('0xd1')]||undefined})[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0x19a')));break;case 0x8:if(_0x28554b['countcongestionretry']>=_0x16efb5['dialCongestionMaxRetry']-0x1){return!![];}this[_0xf9c8('0xba')]({'active':![],'countcongestionretry':_0x28554b['countcongestionretry']+=0x1,'scheduledat':moment()[_0xf9c8('0xf5')](_0x16efb5['dialCongestionRetryFrequency'],_0xf9c8('0xfd'))[_0xf9c8('0x71')](_0xf9c8('0xfe')),'ContactId':_0x28554b[_0xf9c8('0xcd')],'ListId':_0x28554b['ListId'],'VoiceQueueId':_0x28554b['VoiceQueueId']||undefined,'CampaignId':_0x28554b['CampaignId']||undefined})[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0x19b')));break;case 0x0:if(_0x28554b[_0xf9c8('0xec')]>=_0x16efb5['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0xf9c8('0xba')]({'active':![],'countnosuchnumberretry':_0x28554b[_0xf9c8('0xec')]+=0x1,'scheduledat':moment()['add'](_0x16efb5['dialNoSuchNumberRetryFrequency'],_0xf9c8('0xfd'))[_0xf9c8('0x71')](_0xf9c8('0xfe')),'ContactId':_0x28554b[_0xf9c8('0xcd')],'ListId':_0x28554b['ListId'],'VoiceQueueId':_0x28554b[_0xf9c8('0xd0')]||undefined,'CampaignId':_0x28554b[_0xf9c8('0xd1')]||undefined})[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0x19c')));}break;case 0xa:if(_0x28554b[_0xf9c8('0xed')]>=_0x16efb5[_0xf9c8('0x114')]-0x1){return!![];}this[_0xf9c8('0xba')]({'active':![],'countdropretry':_0x28554b[_0xf9c8('0xed')]+=0x1,'scheduledat':moment()[_0xf9c8('0xf5')](_0x16efb5['dialDropRetryFrequency'],_0xf9c8('0xfd'))['format'](_0xf9c8('0xfe')),'ContactId':_0x28554b[_0xf9c8('0xcd')],'ListId':_0x28554b[_0xf9c8('0xce')],'VoiceQueueId':_0x28554b[_0xf9c8('0xd0')]||undefined,'CampaignId':_0x28554b['CampaignId']||undefined})[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0x116')));break;case 0xb:if(_0x28554b[_0xf9c8('0xee')]>=_0x16efb5[_0xf9c8('0x19d')]-0x1){return!![];}this[_0xf9c8('0xba')]({'active':![],'countabandonedretry':_0x28554b['countabandonedretry']+=0x1,'scheduledat':moment()[_0xf9c8('0xf5')](_0x16efb5['dialAbandonedRetryFrequency'],_0xf9c8('0xfd'))[_0xf9c8('0x71')](_0xf9c8('0xfe')),'ContactId':_0x28554b['ContactId'],'ListId':_0x28554b[_0xf9c8('0xce')],'VoiceQueueId':_0x28554b['VoiceQueueId']||undefined,'CampaignId':_0x28554b[_0xf9c8('0xd1')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x28554b[_0xf9c8('0xef')]>=_0x16efb5[_0xf9c8('0xf4')]-0x1){return!![];}this[_0xf9c8('0xba')]({'active':![],'countmachineretry':_0x28554b['countmachineretry']+=0x1,'scheduledat':moment()[_0xf9c8('0xf5')](_0x16efb5[_0xf9c8('0xfc')],'minutes')[_0xf9c8('0x71')](_0xf9c8('0xfe')),'ContactId':_0x28554b[_0xf9c8('0xcd')],'ListId':_0x28554b['ListId'],'VoiceQueueId':_0x28554b[_0xf9c8('0xd0')]||undefined,'CampaignId':_0x28554b[_0xf9c8('0xd1')]||undefined})[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0xf6')));break;case 0x14:if(_0x28554b['countagentrejectretry']>=_0x16efb5[_0xf9c8('0x19e')]-0x1){return!![];}this[_0xf9c8('0xba')]({'active':![],'countagentrejectretry':_0x28554b[_0xf9c8('0xf0')]+=0x1,'scheduledat':moment()['add'](_0x16efb5[_0xf9c8('0x19f')],_0xf9c8('0xfd'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x28554b[_0xf9c8('0xcd')],'ListId':_0x28554b[_0xf9c8('0xce')],'VoiceQueueId':_0x28554b['VoiceQueueId']||undefined,'CampaignId':_0x28554b['CampaignId']||undefined})[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0x1a0')));break;default:return!![];}};Dialer['prototype'][_0xf9c8('0x192')]=function(_0x17567e,_0x277c9e,_0x407807){var _0x6aa739=this;var _0x46f63c=new History(_0x17567e);return new BPromise(function(_0x762669,_0x17d210){if(_[_0xf9c8('0x7f')](_0x277c9e)&&typeof _0x277c9e!==_0xf9c8('0x161')){return _0x17d210(msgResponse(_0xf9c8('0x1a1'),_0xf9c8('0x13d'),'entity\x20is\x20undefine'));}if(_[_0xf9c8('0x7f')](_0x407807)&&typeof _0x407807!==_0xf9c8('0x161')){return _0x17d210(msgResponse(_0xf9c8('0x1a1'),_0xf9c8('0x13d'),_0xf9c8('0x1a2')));}switch(_0x407807[_0xf9c8('0x105')]){case'0':_0x277c9e[_0xf9c8('0x63')]+=0x1;_0x46f63c[_0xf9c8('0xa2')]=0x0;_0x46f63c['statedesc']='NoSuchNumber';_0x46f63c[_0xf9c8('0xec')]+=0x1;_0x46f63c[_0xf9c8('0xf9')]+=0x1;ami['emit'](_0xf9c8('0x1a3'),ut[_0xf9c8('0xe4')](_0x17567e,_0xf9c8('0x1a4')));_0x6aa739[_0xf9c8('0xc4')](_0x46f63c)[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0xfa')));if(_0x6aa739[_0xf9c8('0x194')](0x0,_0x17567e,_0x277c9e)){if(_0x46f63c['countnosuchnumberretry']>=_0x277c9e[_0xf9c8('0x1a5')]){_0x6aa739[_0xf9c8('0x1a6')](_0x46f63c,_0x762669,_0x17d210,'reason\x200\x20no\x20such\x20number....');}else{_0x6aa739[_0xf9c8('0xf2')](_0x46f63c,_0x762669,_0x17d210,_0xf9c8('0x1a7'));}}break;case'3':_0x277c9e[_0xf9c8('0x62')]+=0x1;_0x46f63c['state']=0x3;_0x46f63c[_0xf9c8('0xe1')]=_0xf9c8('0x1a8');_0x46f63c['countnoanswerretry']+=0x1;_0x46f63c[_0xf9c8('0xf9')]+=0x1;ami[_0xf9c8('0x49')](_0xf9c8('0x1a9'),ut[_0xf9c8('0xe4')](_0x17567e,_0xf9c8('0x1aa')));_0x6aa739[_0xf9c8('0xc4')](_0x46f63c)['catch'](loggerCatch(_0xf9c8('0x1ab')));if(_0x6aa739[_0xf9c8('0x194')](0x3,_0x17567e,_0x277c9e)){if(_0x46f63c[_0xf9c8('0xeb')]>=_0x277c9e[_0xf9c8('0x195')]){_0x6aa739[_0xf9c8('0x1a6')](_0x46f63c,_0x762669,_0x17d210,_0xf9c8('0x1ac'));}else{_0x6aa739[_0xf9c8('0xf2')](_0x46f63c,_0x762669,_0x17d210,_0xf9c8('0x1ac'));}}break;case'5':_0x277c9e[_0xf9c8('0x5e')]+=0x1;_0x46f63c[_0xf9c8('0xa2')]=0x5;_0x46f63c[_0xf9c8('0xe1')]=_0xf9c8('0x1ad');_0x46f63c[_0xf9c8('0xe9')]+=0x1;_0x46f63c[_0xf9c8('0xf9')]+=0x1;ami['emit'](_0xf9c8('0x1ae'),ut['buildObj'](_0x17567e,_0xf9c8('0x1af')));_0x6aa739[_0xf9c8('0xc4')](_0x46f63c)[_0xf9c8('0xaa')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x6aa739[_0xf9c8('0x194')](0x5,_0x17567e,_0x277c9e)){if(_0x46f63c[_0xf9c8('0xe9')]>=_0x277c9e[_0xf9c8('0x198')]){_0x6aa739[_0xf9c8('0x1a6')](_0x46f63c,_0x762669,_0x17d210,_0xf9c8('0x1b0'));}else{_0x6aa739[_0xf9c8('0xf2')](_0x46f63c,_0x762669,_0x17d210,_0xf9c8('0x1b0'));}}break;case'8':_0x277c9e['outboundCongestionCallsDay']+=0x1;_0x46f63c[_0xf9c8('0xa2')]=0x8;_0x46f63c[_0xf9c8('0xe1')]=_0xf9c8('0x1b1');_0x46f63c[_0xf9c8('0xea')]+=0x1;_0x46f63c[_0xf9c8('0xf9')]+=0x1;ami[_0xf9c8('0x49')](_0xf9c8('0x1b2'),ut['buildObj'](_0x17567e,'congestion'));_0x6aa739['createHistory'](_0x46f63c)['catch'](loggerCatch(_0xf9c8('0x1b3')));if(_0x6aa739[_0xf9c8('0x194')](0x8,_0x17567e,_0x277c9e)){if(_0x46f63c['countcongestionretry']>=_0x277c9e['dialCongestionMaxRetry']){_0x6aa739['createStateFinal'](_0x46f63c,_0x762669,_0x17d210,_0xf9c8('0x1b4'));}else{_0x6aa739[_0xf9c8('0xf2')](_0x46f63c,_0x762669,_0x17d210,'reason\x208\x20congestion');}}break;case'11':_0x277c9e[_0xf9c8('0x1b5')]+=0x1;_0x46f63c['state']=0xb;_0x46f63c[_0xf9c8('0xe1')]=_0xf9c8('0x11b');_0x46f63c[_0xf9c8('0xee')]+=0x1;_0x46f63c[_0xf9c8('0xf9')]+=0x1;_0x6aa739[_0xf9c8('0xc4')](_0x46f63c)[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0x11e')));if(_0x6aa739['checkRetriveMax'](0xb,_0x17567e,_0x277c9e)){if(_0x46f63c[_0xf9c8('0xee')]>=_0x277c9e[_0xf9c8('0x19d')]){_0x6aa739[_0xf9c8('0x1a6')](_0x46f63c,_0x762669,_0x17d210,_0xf9c8('0x1b6'));}else{_0x6aa739[_0xf9c8('0xf2')](_0x46f63c,_0x762669,_0x17d210,_0xf9c8('0x1b6'));}}break;case'20':_0x277c9e[_0xf9c8('0x65')]+=0x1;_0x46f63c[_0xf9c8('0xa2')]=0x14;_0x46f63c['statedesc']=_0xf9c8('0x1b7');_0x46f63c[_0xf9c8('0xf0')]+=0x1;_0x46f63c[_0xf9c8('0xf9')]+=0x1;ami[_0xf9c8('0x49')]('custom:agentreject',ut['buildObj'](_0x17567e,'agentreject'));_0x6aa739[_0xf9c8('0xc4')](_0x46f63c)[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0x1b8')));if(_0x6aa739[_0xf9c8('0x194')](0x14,_0x17567e,_0x277c9e)){if(_0x46f63c[_0xf9c8('0xf0')]>=_0x277c9e['dialAgentRejectMaxRetry']){_0x6aa739[_0xf9c8('0x1a6')](_0x46f63c,_0x762669,_0x17d210,_0xf9c8('0x1b9'));}else{_0x6aa739[_0xf9c8('0xf2')](_0x46f63c,_0x762669,_0x17d210,'reason\x2020\x20agentreject');}}break;default:_0x277c9e[_0xf9c8('0x66')]+=0x1;_0x46f63c[_0xf9c8('0xa2')]=0xc;_0x46f63c[_0xf9c8('0xe1')]=_0x407807[_0xf9c8('0x105')];_0x6aa739['createHistory'](_0x46f63c)[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0x1ba')));if(_0x6aa739[_0xf9c8('0x194')](_0x407807['reason'],_0x17567e,_0x277c9e)){if(_0x46f63c[_0xf9c8('0xe9')]+_0x46f63c[_0xf9c8('0xea')]+_0x46f63c['countnoanswerretry']+_0x46f63c[_0xf9c8('0xec')]+_0x46f63c[_0xf9c8('0xed')]+_0x46f63c[_0xf9c8('0xee')]+_0x46f63c[_0xf9c8('0xef')]+_0x46f63c[_0xf9c8('0xf0')]>=_0x277c9e['dialGlobalMaxRetry']){_0x6aa739[_0xf9c8('0xf2')](_0x46f63c,_0x762669,_0x17d210,_0x407807[_0xf9c8('0x105')]);}else{_0x6aa739['createStateFinal'](_0x46f63c,_0x762669,_0x17d210,_0x407807[_0xf9c8('0x105')]);}}}});};Dialer[_0xf9c8('0x18')][_0xf9c8('0xf2')]=function(_0x3ed689,_0x525132,_0x4ac804,_0x56f30b){var _0x560436=new Final(_0x3ed689);_0x560436[_0xf9c8('0xa2')]=0xf;_0x560436[_0xf9c8('0xe1')]=_0xf9c8('0x1bb');this[_0xf9c8('0x1a6')](_0x560436,_0x525132,_0x4ac804,_0x56f30b);};Dialer[_0xf9c8('0x18')][_0xf9c8('0x1a6')]=function(_0x341cb9,_0x2a1b09,_0x307071,_0x3b372){this['moveContactManagedDialer'](_0x341cb9)['then'](function(){return _0x2a1b09(msgResponse(_0xf9c8('0x1a1'),_0xf9c8('0xd5'),_0x3b372));})[_0xf9c8('0xaa')](function(){return _0x307071(msgResponse(_0xf9c8('0x1bc'),_0xf9c8('0x13d'),_0xf9c8('0x1bd')));});};Dialer[_0xf9c8('0x18')][_0xf9c8('0x7')]=function(_0x47ccf2){var _0x38cb7c=_0x47ccf2[_0xf9c8('0x1be')]/0x64;var _0x81d84a=_0x47ccf2['outboundDropCallsDayTimeout']/(_0x47ccf2[_0xf9c8('0x61')]+_0x47ccf2[_0xf9c8('0x5c')]);var _0x4cd71b=Math['round'](_0x47ccf2[_0xf9c8('0x6c')]*(_0x47ccf2[_0xf9c8('0x1bf')]/0x64));var _0x5ae2c2=Math[_0xf9c8('0x1c0')](_0x47ccf2[_0xf9c8('0x6c')]*(_0x47ccf2['predictiveIntervalMinThreshold']/0x64));var _0x1a44ee=_0x47ccf2[_0xf9c8('0x9c')]+_0x47ccf2[_0xf9c8('0x51')];var _0xdb431e=Math['floor'](_0x47ccf2['erlangCalls']*_0x47ccf2[_0xf9c8('0x88')]*_0x47ccf2[_0xf9c8('0x1c1')]*_0x47ccf2['predictiveIntervalMultiplicativeFactor']);if(_[_0xf9c8('0x7f')](_0x47ccf2[_0xf9c8('0x8a')])){if(!_[_0xf9c8('0x7f')](_0x47ccf2[_0xf9c8('0x25')])){_0x47ccf2[_0xf9c8('0x25')]=undefined;loggerPredictive['error'](_0xf9c8('0x1c2'),_0xf9c8('0x1c3'));}if(!_['isUndefined'](_0x47ccf2['handlePredictive'])){loggerPredictive[_0xf9c8('0x91')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x47ccf2[_0xf9c8('0x8c')]);_0x47ccf2[_0xf9c8('0x8c')]=undefined;}_0x47ccf2[_0xf9c8('0x8a')]=moment()[_0xf9c8('0x71')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xf9c8('0x76')](_0x47ccf2[_0xf9c8('0x3b')],_0xf9c8('0x1c4'),_0x47ccf2[_0xf9c8('0x8a')]);this['handlePower'](_0x47ccf2,0x1);}else if(ifInterval(_0x47ccf2['dialPredictiveInterval'],_0x47ccf2[_0xf9c8('0x8a')])){this[_0xf9c8('0x154')](_0x47ccf2,0x1);loggerPredictiveCalls[_0xf9c8('0x76')](_0xf9c8('0x1c5'),_0x47ccf2[_0xf9c8('0x8a')],_0x47ccf2['name']);_0x47ccf2[_0xf9c8('0x1c6')]=0x0;_0x47ccf2['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x38cb7c<_0x81d84a&&_0x47ccf2[_0xf9c8('0x1c7')]===_0xf9c8('0x1c8')){freeVariablesPredictive(_0x47ccf2);loggerPredictive[_0xf9c8('0x76')](_0xf9c8('0x1c9'),_0xf9c8('0x1ca'),_0x81d84a,_0xf9c8('0x8a'),_0x47ccf2[_0xf9c8('0x3b')]);}else if(_0xdb431e<_0x47ccf2[_0xf9c8('0x110')]&&_0x47ccf2['dialPredictiveOptimization']===_0xf9c8('0x1c8')){freeVariablesPredictive(_0x47ccf2);loggerPredictive['info'](_0xf9c8('0x1cb'),'Max\x20Drop\x20',_0xdb431e,'Drop\x20in\x20this\x20interval',_0x47ccf2[_0xf9c8('0x110')],_0xf9c8('0x8a'),_0x47ccf2[_0xf9c8('0x3b')]);}else if(!ifInterval(_0x47ccf2[_0xf9c8('0x1cc')],_0x47ccf2[_0xf9c8('0x8a')])&&_['isUndefined'](_0x47ccf2['startPredictive'])&&!_[_0xf9c8('0x7f')](_0x47ccf2[_0xf9c8('0x8a')])){_0x47ccf2[_0xf9c8('0x25')]=moment()[_0xf9c8('0x71')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x47ccf2[_0xf9c8('0x3b')],_0xf9c8('0x1cd'),_0x47ccf2['startPredictive']);this[_0xf9c8('0xb7')](_0x47ccf2[_0xf9c8('0x1cc')])[_0xf9c8('0xb4')](this['getDataPredictive'](_0x47ccf2))['then'](mergeDataErlangB(_0x47ccf2))[_0xf9c8('0xb4')](this[_0xf9c8('0x1ce')](_0x47ccf2))['catch'](loggerCatchPredictive(_0xf9c8('0x1cf'),_0x47ccf2));}else if(!ifInterval(_0x47ccf2[_0xf9c8('0x1cc')],_0x47ccf2[_0xf9c8('0x25')])){_0x47ccf2[_0xf9c8('0x110')]=0x0;_0x47ccf2[_0xf9c8('0x25')]=moment()[_0xf9c8('0x71')](_0xf9c8('0xfe'));loggerPredictive[_0xf9c8('0x76')](_0x47ccf2[_0xf9c8('0x3b')],_0xf9c8('0x1d0'),_0x47ccf2[_0xf9c8('0x25')]);clearInterval(_0x47ccf2['handlePredictive']);_0x47ccf2[_0xf9c8('0x8c')]=undefined;this[_0xf9c8('0xb7')](_0x47ccf2['dialPredictiveInterval'])[_0xf9c8('0xb4')](this['getDataPredictive'](_0x47ccf2))[_0xf9c8('0xb4')](mergeDataErlangB(_0x47ccf2))[_0xf9c8('0xb4')](this[_0xf9c8('0x1ce')](_0x47ccf2))[_0xf9c8('0xaa')](loggerCatchPredictive(_0xf9c8('0x1d1'),_0x47ccf2));}else if(_0x47ccf2[_0xf9c8('0x6c')]&&_0x1a44ee<_0x47ccf2[_0xf9c8('0x6c')]-_0x5ae2c2){freeVariablesPredictive(_0x47ccf2);loggerPredictive[_0xf9c8('0x76')](_0x47ccf2[_0xf9c8('0x3b')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x1a44ee,_0xf9c8('0x1d2'),_0x47ccf2[_0xf9c8('0x6c')],'-',_0x5ae2c2,'=',_0x47ccf2['predictiveIntervalAvailable']-_0x5ae2c2,')');}else if(_0x47ccf2['predictiveIntervalAvailable']&&_0x1a44ee>_0x47ccf2[_0xf9c8('0x6c')]+_0x4cd71b){freeVariablesPredictive(_0x47ccf2);loggerPredictive[_0xf9c8('0x76')](_0x47ccf2['name'],_0xf9c8('0x1d3'),_0x1a44ee,')\x20are\x20more\x20than\x20threshold\x20(',_0x47ccf2['predictiveIntervalAvailable'],'+',_0x4cd71b,'=',_0x47ccf2[_0xf9c8('0x6c')]+_0x4cd71b,')');}};Dialer[_0xf9c8('0x18')][_0xf9c8('0x1d4')]=function(_0x220edf){var _0x2c1656=this;return function(_0x6d9d49){return new BPromise(function(_0x394268,_0x5de3dd){_['merge'](_0x220edf,_0x6d9d49[0x0]);if(checkGetDataPredictive(_0x6d9d49[0x0])){var _0x205e72=_0x220edf['predictiveIntervalAvailable']=_0x220edf[_0xf9c8('0x51')]+_0x220edf[_0xf9c8('0x9c')];var _0x4012b9=_0x220edf[_0xf9c8('0x1cc')]*0x3c;var _0x5e00f6=_0x6d9d49[0x0][_0xf9c8('0x69')]+_0x6d9d49[0x0]['predictiveIntervalAvgHoldtime'];var _0x2a0db2=(_0x6d9d49[0x0]['predictiveIntervalAnsweredCalls']+_0x6d9d49[0x0][_0xf9c8('0x6b')]+_0x6d9d49[0x0][_0xf9c8('0x6a')])/_0x6d9d49[0x0]['predictiveIntervalTotalCalls'];_0x220edf['predictiveIntervalHitRate']=_0x2a0db2>0x0?_0x2a0db2:0x1;switch(_0x220edf[_0xf9c8('0x1c7')]){case'dropRate':var _0x2150c4=_0x220edf['dialPredictiveOptimizationPercentage']/0x64;return _0x2c1656[_0xf9c8('0x1d5')](_0x205e72,_0x4012b9,_0x5e00f6,_0x2a0db2,_0x2150c4)[_0xf9c8('0xb4')](function(_0x1f82e6){return _0x394268(_0x1f82e6);});case _0xf9c8('0x1d6'):var _0x1dd619=_0x220edf[_0xf9c8('0x1be')]/0x64;return _0x2c1656[_0xf9c8('0x1d7')](_0x205e72,_0x4012b9,_0x5e00f6,_0x2a0db2,_0x1dd619)['then'](function(_0x280fca){return _0x394268(_0x280fca);});default:return _0x5de3dd(msgResponse('[getDataPredictive]',_0xf9c8('0x13d'),_0xf9c8('0x1d8')));}}else{return _0x5de3dd(msgResponse(_0xf9c8('0x1d9'),'Failure',_0xf9c8('0x1da')));}});};};Dialer[_0xf9c8('0x18')][_0xf9c8('0x1db')]=function(_0x574b4c){var _0x2ed1a7=this;return function(_0x59168a){return new BPromise(function(_0x21af7d,_0x55bfee){_[_0xf9c8('0x89')](_0x574b4c,_0x59168a[0x0]);if(checkGetDataPredictive(_0x59168a[0x0])){loggerPredictive[_0xf9c8('0x76')](JSON[_0xf9c8('0x45')](_0x59168a[0x0]));if(_0x574b4c['dialPredictiveOptimization']===_0xf9c8('0x1c8')){return _0x2ed1a7[_0xf9c8('0xc1')](_0x574b4c['id'])[_0xf9c8('0xb4')](function(_0x38a6a3){var _0x3696e4=_0x574b4c[_0xf9c8('0x4c')]-_0x38a6a3[0x0][_0xf9c8('0x1dc')];var _0x51ca5f=_0x574b4c[_0xf9c8('0x1cc')]*0x3c;var _0xb0a06=_0x59168a[0x0][_0xf9c8('0x69')]+_0x59168a[0x0][_0xf9c8('0x68')];var _0x10301a=(_0x59168a[0x0][_0xf9c8('0x67')]+_0x59168a[0x0][_0xf9c8('0x6b')]+_0x59168a[0x0][_0xf9c8('0x6a')])/_0x59168a[0x0][_0xf9c8('0x6d')];var _0x13a616=_0x574b4c[_0xf9c8('0x1be')]/0x64;_0x574b4c[_0xf9c8('0x1dd')]=_0x38a6a3[0x0][_0xf9c8('0x1dc')]||0x0;_0x574b4c[_0xf9c8('0x1c1')]=_0x10301a>0x0?_0x10301a:0x1;return _0x2ed1a7[_0xf9c8('0x1d5')](_0x3696e4,_0x51ca5f,_0xb0a06,_0x10301a,_0x13a616);})[_0xf9c8('0xb4')](function(_0x47a7ae){return _0x21af7d(_0x47a7ae);})[_0xf9c8('0xaa')](function(_0x1c44e2){return _0x55bfee(msgResponse(_0xf9c8('0x1de'),_0xf9c8('0x13d'),JSON[_0xf9c8('0x45')](_0x1c44e2)));});}if(_0x574b4c['dialPredictiveOptimization']===_0xf9c8('0x1d6')){return _0x2ed1a7[_0xf9c8('0xc1')](_0x574b4c['id'])[_0xf9c8('0xb4')](function(_0x20e9a0){var _0x2e1b71=_0x574b4c[_0xf9c8('0x4c')]-_0x20e9a0[0x0]['outboundQueuePauses'];var _0x3e60fb=_0x574b4c[_0xf9c8('0x1cc')]*0x3c;var _0x174dc4=_0x59168a[0x0][_0xf9c8('0x69')]+_0x59168a[0x0][_0xf9c8('0x68')];var _0x3f8d65=(_0x59168a[0x0][_0xf9c8('0x67')]+_0x59168a[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x59168a[0x0][_0xf9c8('0x6a')])/_0x59168a[0x0]['predictiveIntervalTotalCalls'];var _0x238648=_0x574b4c['dialPredictiveOptimizationPercentage']/0x64;_0x574b4c[_0xf9c8('0x1dd')]=_0x20e9a0[0x0][_0xf9c8('0x1dc')]||0x0;_0x574b4c[_0xf9c8('0x1c1')]=_0x3f8d65>0x0?_0x3f8d65:0x1;return _0x2ed1a7[_0xf9c8('0x1d7')](_0x2e1b71,_0x3e60fb,_0x174dc4,_0x3f8d65,_0x238648);})[_0xf9c8('0xb4')](function(_0x1a6f11){return _0x21af7d(_0x1a6f11);})[_0xf9c8('0xaa')](function(_0x16ce7f){return _0x55bfee(msgResponse(_0xf9c8('0x1de'),_0xf9c8('0x13d'),JSON[_0xf9c8('0x45')](_0x16ce7f)));});}}else{return _0x55bfee(msgResponse(_0xf9c8('0x1d9'),_0xf9c8('0x13d'),'check\x20failure'));}});};};Dialer['prototype']['startMethodPredictive']=function(_0x21d32f){var _0x549fe5=this;return function(){var _0x208c6f=0x0;var _0x3124e9=Math[_0xf9c8('0x1df')](_0x21d32f[_0xf9c8('0x85')]*0x3e8);if(_0x3124e9>0x0){_0x3124e9=_0x3124e9<0x64?0x64:_0x3124e9;loggerPredictive[_0xf9c8('0x76')](_0x21d32f[_0xf9c8('0x3b')],_0xf9c8('0x1e0'),_0x3124e9,_0xf9c8('0x46'));_0x21d32f[_0xf9c8('0x8c')]=setInterval(function(){_0x549fe5[_0xf9c8('0x8c')](_0x21d32f);loggerPredictiveCalls[_0xf9c8('0x76')](_0xf9c8('0x1e1'),_0x208c6f+=0x1);},_0x3124e9);}else{loggerPredictive[_0xf9c8('0x76')](_0x21d32f[_0xf9c8('0x3b')],_0xf9c8('0x1e2'));}};};Dialer[_0xf9c8('0x18')][_0xf9c8('0x1e3')]=function(_0x3226f0,_0x1c8024){var _0x157997=this;return function(_0x4ff847){if(_[_0xf9c8('0x75')](_0x4ff847)){if(_['isNil'](_0x1c8024[_0xf9c8('0xcf')])||!_0x1c8024[_0xf9c8('0x1e4')]){if(_0x3226f0['dialMethod']===_0xf9c8('0x1e5')){_0x3226f0[_0xf9c8('0x125')]=_[_0xf9c8('0x7f')](_0x3226f0[_0xf9c8('0x125')])?!![]:_0x3226f0[_0xf9c8('0x125')];var _0x1cfebd=uuid['v4']();_0x157997[_0xf9c8('0x22')][_0x1cfebd]=new Action(_0x3226f0,_0x1c8024,_0x1cfebd);loggerBooked['info'](_0xf9c8('0x1e6'),_0x1cfebd,_0xf9c8('0x1e7'),JSON[_0xf9c8('0x45')](_0x3226f0['queueStatusComplete']),'Queue:\x20',_0x3226f0[_0xf9c8('0x3b')]);if(_0x3226f0[_0xf9c8('0x125')]){_0x3226f0['queueStatusComplete']=![];_0x157997[_0xf9c8('0x26')][_0x157997[_0xf9c8('0x22')][_0x1cfebd][_0xf9c8('0xad')]]=[];ami[_0xf9c8('0xa8')]({'actionid':_0x1cfebd,'action':_0xf9c8('0x1e8'),'queue':_0x3226f0['name']})['catch'](function(){_0x157997['updateOriginated'](_0x3226f0);_0x157997['rescheduleContact']({'active':![],'ContactId':_0x157997['actions'][_0x1cfebd][_0xf9c8('0xcd')],'ListId':_0x157997[_0xf9c8('0x22')][_0x1cfebd]['ListId'],'VoiceQueueId':_0x157997[_0xf9c8('0x22')][_0x1cfebd]['VoiceQueueId']||undefined,'CampaignId':_0x157997['actions'][_0x1cfebd][_0xf9c8('0xd1')]||undefined})[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0x1e9')));delete _0x157997['actions'][_0x1cfebd];});}else{loggerBooked[_0xf9c8('0x76')]('[booked][checkContactBlack][else]',JSON[_0xf9c8('0x45')](_0x3226f0[_0xf9c8('0x125')]),_0xf9c8('0x1ea'),_0x3226f0['name']);_0x157997[_0xf9c8('0xac')](_0x3226f0);_0x157997[_0xf9c8('0xba')]({'active':![],'ContactId':_0x157997[_0xf9c8('0x22')][_0x1cfebd]['ContactId'],'ListId':_0x157997[_0xf9c8('0x22')][_0x1cfebd][_0xf9c8('0xce')],'VoiceQueueId':_0x157997[_0xf9c8('0x22')][_0x1cfebd][_0xf9c8('0xd0')]||undefined,'CampaignId':_0x157997[_0xf9c8('0x22')][_0x1cfebd][_0xf9c8('0xd1')]||undefined})[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0x1e9')));delete _0x157997[_0xf9c8('0x22')][_0x1cfebd];}}else{return _0x157997[_0xf9c8('0x160')](_0x3226f0,_0x1c8024);}}else{if(getDiff(_0x1c8024[_0xf9c8('0x1eb')])<_0x3226f0[_0xf9c8('0x1ec')]*0x3c){if(_0x1c8024[_0xf9c8('0x1ed')]&&!_0x1c8024['Agent'][_0xf9c8('0x1ee')]){_0x157997[_0xf9c8('0x1c')][_0xf9c8('0x127')](_0x1c8024['id'])[_0xf9c8('0x1a')](function(){_0x157997['updateOriginated'](_0x3226f0);});}else{_0x157997[_0xf9c8('0xbc')]({'active':![]},_0x1c8024['id'],0x1)[_0xf9c8('0x1a')](function(){_0x157997['updateOriginated'](_0x3226f0);});}}else{_0x3226f0[_0xf9c8('0x1ef')]+=0x1;_0x157997[_0xf9c8('0xac')](_0x3226f0);if(_0x3226f0['dialRecallInQueue']){_0x157997['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1c8024[_0xf9c8('0xcd')],'ListId':_0x1c8024[_0xf9c8('0xce')],'VoiceQueueId':_0x1c8024['VoiceQueueId']||undefined,'CampaignId':_0x1c8024[_0xf9c8('0xd1')]||undefined})[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0x1f0')));_0x157997['createHistory'](createObjHistory(_0x3226f0,_0x1c8024,_0xf9c8('0x1f1'),0x17,'RecallInQueue'))[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0x1f2')));}else{_0x157997[_0xf9c8('0xcb')](createObjHistory(_0x3226f0,_0x1c8024,_0xf9c8('0x1f3'),0x16,_0xf9c8('0x1f4')),_0xf9c8('0x1f5'),_0xf9c8('0x1f6'));}}}}else{_0x3226f0[_0xf9c8('0x5d')]+=0x1;_0x157997[_0xf9c8('0xcb')](createObjHistory(_0x3226f0,_0x1c8024,'BLACKLIST',0xd,_0xf9c8('0x1f7')),'[Originate][historyBlacklist]',_0xf9c8('0x1f8'));throw _0xf9c8('0x1f9');}};};Dialer[_0xf9c8('0x18')][_0xf9c8('0x156')]=function(_0x5c3201){var _0x440dbc=this;var _0x5b0bd8=_0x5c3201[_0xf9c8('0x1fa')]-_0x5c3201[_0xf9c8('0x6e')]-_0x5c3201[_0xf9c8('0xbe')];emitCampaignSummary(_0x5c3201);if(_0x5b0bd8>0x0){if(_0x5b0bd8>this[_0xf9c8('0x21')]){_0x5b0bd8=this[_0xf9c8('0x21')];}_0x5c3201['temp']+=_0x5b0bd8;this[_0xf9c8('0xc0')](_0x5c3201['id'],_0x5b0bd8,_0x5c3201[_0xf9c8('0x1fb')],_0x5c3201)['then'](function(_0x53ef72){_0x5c3201[_0xf9c8('0xbe')]-=_0x5b0bd8;_0x5c3201[_0xf9c8('0xbe')]=_0x5c3201[_0xf9c8('0xbe')]>0x0?_0x5c3201[_0xf9c8('0xbe')]:0x0;if(!checkContactEmpty(_0x53ef72)){_0x5c3201[_0xf9c8('0x39')]='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0xf9c8('0x1fc')+_0x5c3201[_0xf9c8('0x3b')]);}else{_0x5c3201[_0xf9c8('0x6e')]+=_0x53ef72['length'];_0x5c3201[_0xf9c8('0x39')]=_0xf9c8('0x1fd');for(var _0x32eae9=0x0;_0x32eae9<_0x53ef72[_0xf9c8('0x94')];_0x32eae9+=0x1){_0x5c3201[_0xf9c8('0x1fe')]+=0x1;if(_[_0xf9c8('0xa7')](_0x53ef72[_0x32eae9])||_[_0xf9c8('0xa7')](_0x53ef72[_0x32eae9][_0xf9c8('0x164')])||_['isNil'](_0x53ef72[_0x32eae9][_0xf9c8('0x164')][_0xf9c8('0x165')])){_0x440dbc[_0xf9c8('0xc9')](_0xf9c8('0x1ff'),_0x5c3201,_0x53ef72[_0x32eae9]);}else{_0x440dbc['checkIsBlackListIvr'](_[_0xf9c8('0xcc')](_0x53ef72[_0x32eae9],['CampaignId',_0xf9c8('0x200')]))[_0xf9c8('0xb4')](_0x440dbc['checkContactBlack'](_0x5c3201,_0x53ef72[_0x32eae9]))[_0xf9c8('0xaa')](_0x440dbc[_0xf9c8('0xc8')](_0xf9c8('0x201'),_0x5c3201));}}}})[_0xf9c8('0xaa')](loggerGetContactDialer(_0xf9c8('0x202'),_0x5c3201,_0x5b0bd8));}};Dialer[_0xf9c8('0x18')][_0xf9c8('0x154')]=function(_0xd4ac72,_0x3c0a59){var _0x4fa2e0=this;var _0xcf1bbe=[];var _0x420c3e=_0x3c0a59>=0x1?_0x3c0a59:0x1;if(_0xd4ac72[_0xf9c8('0x57')]===_0xf9c8('0x1e5')){_0x420c3e=0x1;}var _0x167d9b=Math[_0xf9c8('0x1df')](_0xd4ac72[_0xf9c8('0x9c')]*_0x420c3e)-_0xd4ac72[_0xf9c8('0x6e')]-_0xd4ac72[_0xf9c8('0xbe')];emitVoiceQueueSummary(_0xd4ac72);if(_0xd4ac72['dialLimitQueue']>0x0){var _0x3f7d48=_0xd4ac72['dialLimitQueue']-_0xd4ac72[_0xf9c8('0x6e')]-_0xd4ac72[_0xf9c8('0x51')]-_0xd4ac72['temp']-_0xd4ac72[_0xf9c8('0x4d')];if(_0x167d9b>_0x3f7d48){_0x167d9b=_0x3f7d48;}}if(_0x167d9b>0x0){if(_0xd4ac72[_0xf9c8('0x57')]===_0xf9c8('0x1e5')){_0x167d9b=0x1;}if(_0x167d9b>this[_0xf9c8('0x21')]){_0x167d9b=this['maxNumberOriginate'];}_0xd4ac72[_0xf9c8('0xbe')]+=_0x167d9b;for(var _0x540d62 in this['agents']){if(typeof this['agents'][_0x540d62]!==_0xf9c8('0x95')){if(this[_0xf9c8('0x1f')][_0x540d62][_0xf9c8('0xa2')]==='not_inuse'&&this[_0xf9c8('0x1f')][_0x540d62][_0xf9c8('0xa9')]==='reachable'){_0xcf1bbe['push'](this['agents'][_0x540d62]['id']);}}}this[_0xf9c8('0xbd')](_0xd4ac72['id'],_0xcf1bbe,_0x167d9b,_0xd4ac72[_0xf9c8('0x1fb')],_0xd4ac72)['then'](function(_0x4c97d5){_0xd4ac72['temp']-=_0x167d9b;_0xd4ac72[_0xf9c8('0xbe')]=_0xd4ac72['temp']>0x0?_0xd4ac72[_0xf9c8('0xbe')]:0x0;if(!checkContactEmpty(_0x4c97d5)){_0x4fa2e0[_0xf9c8('0xb0')](_0xd4ac72)[_0xf9c8('0xb4')](sendMessageReschedule(_0xd4ac72))[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0xb2')));}else{_0xd4ac72['originated']+=_0x4c97d5[_0xf9c8('0x94')];_0xd4ac72['message']=_0xd4ac72[_0xf9c8('0x57')]===_0xf9c8('0x1e5')?_0xf9c8('0x203'):'RUNNING';for(var _0x92c5d7=0x0;_0x92c5d7<_0x4c97d5[_0xf9c8('0x94')];_0x92c5d7+=0x1){if(_[_0xf9c8('0xa7')](_0x4c97d5[_0x92c5d7])||_[_0xf9c8('0xa7')](_0x4c97d5[_0x92c5d7][_0xf9c8('0x164')])||_[_0xf9c8('0xa7')](_0x4c97d5[_0x92c5d7]['Contact'][_0xf9c8('0x165')])){_0x4fa2e0[_0xf9c8('0xc9')]('[actionOriginate]\x20',_0xd4ac72,_0x4c97d5[_0x92c5d7]);}else{_0x4fa2e0[_0xf9c8('0xb3')](_[_0xf9c8('0xcc')](_0x4c97d5[_0x92c5d7],[_0xf9c8('0xd0'),_0xf9c8('0x200')]))[_0xf9c8('0xb4')](_0x4fa2e0['checkContactBlack'](_0xd4ac72,_0x4c97d5[_0x92c5d7]))[_0xf9c8('0xaa')](_0x4fa2e0[_0xf9c8('0xc8')](_0xf9c8('0x1ff'),_0xd4ac72));}}}})[_0xf9c8('0xaa')](loggerGetContactDialer(_0xf9c8('0x204'),_0xd4ac72,_0x167d9b));}};Dialer[_0xf9c8('0x18')]['handlePredictive']=function(_0x5157bf){if(_0x5157bf[_0xf9c8('0x205')]>0x0){var _0x4bf32e=_0x5157bf[_0xf9c8('0x205')]-_0x5157bf[_0xf9c8('0x6e')]-_0x5157bf['talking'];if(_0x4bf32e>0x0){this[_0xf9c8('0x206')](_0x5157bf);}else{loggerPredictiveCalls[_0xf9c8('0x76')]('[handlePredictive][limitChannel]');}}else{this[_0xf9c8('0x206')](_0x5157bf);}};Dialer[_0xf9c8('0x18')][_0xf9c8('0x206')]=function(_0x56af9f){var _0x19295f=this;var _0x3cd08b=[];_0x56af9f[_0xf9c8('0x6e')]+=0x1;for(var _0x361f03 in this[_0xf9c8('0x1f')]){if(typeof this['agents'][_0x361f03]!==_0xf9c8('0x95')){if(this[_0xf9c8('0x1f')][_0x361f03]['state']===_0xf9c8('0x207')&&this[_0xf9c8('0x1f')][_0x361f03][_0xf9c8('0xa9')]===_0xf9c8('0x208')){_0x3cd08b['push'](this['agents'][_0x361f03]['id']);}}}this[_0xf9c8('0xbd')](_0x56af9f['id'],_0x3cd08b,0x1,_0x56af9f[_0xf9c8('0x1fb')],_0x56af9f)['then'](function(_0x10bdd3){if(!checkContactEmpty(_0x10bdd3)){checkContactLowerLimitOriginate(_0x56af9f,0x1,0x0);_0x19295f['countReScheduled'](_0x56af9f)[_0xf9c8('0xb4')](sendMessageReschedule(_0x56af9f))[_0xf9c8('0xaa')](loggerCatch(_0xf9c8('0xb2')));}else{_0x56af9f['message']=_0xf9c8('0x1fd');if(_[_0xf9c8('0xa7')](_0x10bdd3[0x0])||_[_0xf9c8('0xa7')](_0x10bdd3[0x0][_0xf9c8('0x164')])||_[_0xf9c8('0xa7')](_0x10bdd3[0x0]['Contact'][_0xf9c8('0x165')])){_0x19295f[_0xf9c8('0xc9')](_0xf9c8('0x1ff'),_0x56af9f,_0x10bdd3[0x0]);}else{_0x19295f[_0xf9c8('0xb3')](_[_0xf9c8('0xcc')](_0x10bdd3[0x0],[_0xf9c8('0xd0'),_0xf9c8('0x200')]))[_0xf9c8('0xb4')](_0x19295f[_0xf9c8('0x1e3')](_0x56af9f,_0x10bdd3[0x0]))[_0xf9c8('0xaa')](_0x19295f[_0xf9c8('0xc8')](_0xf9c8('0x209'),_0x56af9f));}}})[_0xf9c8('0xaa')](loggerGetContactDialer('[getContactDialerPredictive]',_0x56af9f,0x1));emitVoiceQueueSummary(_0x56af9f);};Dialer['prototype'][_0xf9c8('0x1d5')]=function(_0xfd59d8,_0x59374d,_0x1b472a,_0x12c1dc,_0x324fe2,_0x3d0f3a){loggerPredictive[_0xf9c8('0x76')](_0xf9c8('0x20a'));loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xfd59d8);loggerPredictive[_0xf9c8('0x76')](_0xf9c8('0x20b'),_0x59374d);loggerPredictive['info'](_0xf9c8('0x20c'),_0x1b472a);loggerPredictive['info'](_0xf9c8('0x20d'),_0x12c1dc);loggerPredictive[_0xf9c8('0x76')](_0xf9c8('0x20e'),_0x324fe2);loggerPredictive[_0xf9c8('0x76')](_0xf9c8('0x7d'));return new BPromise(function(_0x4d0f8f,_0x33b75e){if(_0xfd59d8<=0x0||isNaN(_0xfd59d8)){return _0x33b75e(msgResponse(_0xf9c8('0x20f'),'Error',_0xf9c8('0x210')+_0xfd59d8));}if(_0x1b472a<=0x0||isNaN(_0x1b472a)){return _0x33b75e(msgResponse(_0xf9c8('0x20f'),'Error',_0xf9c8('0x211')+_0x1b472a));}if(_0x12c1dc<=0x0||isNaN(_0x12c1dc)){return _0x33b75e(msgResponse('[abandonmentRate]',_0xf9c8('0x44'),_0xf9c8('0x212')+_0x12c1dc));}if(_0x59374d<=0x0||isNaN(_0x59374d)){return _0x33b75e(msgResponse(_0xf9c8('0x20f'),_0xf9c8('0x44'),_0xf9c8('0x213')+_0x59374d));}if(_0x324fe2<=0x0||isNaN(_0x324fe2)){return _0x33b75e(msgResponse(_0xf9c8('0x20f'),_0xf9c8('0x44'),_0xf9c8('0x214')+_0x324fe2));}_0x3d0f3a=_0x3d0f3a||0x0;var _0x13dd61=0x1/_0x1b472a;var _0x18bc6e=0x0;var _0xba65c8=0x0;var _0x4b6604=0x0;var _0x526e9b=0x0;for(var _0x300068=0x0;_0x4b6604<_0x324fe2;_0x300068+=0x1){_0xba65c8=_0x300068/_0x59374d;_0x18bc6e=(_0x12c1dc*_0xba65c8+_0x3d0f3a)/_0x13dd61;_0x4b6604=erlangb(_0x18bc6e,_0xfd59d8);_0x526e9b=_0x18bc6e/_0xfd59d8*(0x1-erlangb(_0x18bc6e,_0xfd59d8));}return _0x4d0f8f({'erlangCalls':_0x300068,'erlangCallToSecond':_0x59374d/_0x300068,'erlangAbandonmentRate':_0x4b6604,'erlangBusyFactor':_0x526e9b});});};Dialer['prototype'][_0xf9c8('0x1d7')]=function(_0x48cd6b,_0x440a9d,_0x5c28ee,_0x566543,_0x304989,_0x12a095){loggerPredictive[_0xf9c8('0x76')](_0xf9c8('0x215'));loggerPredictive[_0xf9c8('0x76')](_0xf9c8('0x216'),_0x48cd6b);loggerPredictive[_0xf9c8('0x76')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x440a9d);loggerPredictive[_0xf9c8('0x76')]('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',_0x5c28ee);loggerPredictive[_0xf9c8('0x76')](_0xf9c8('0x20d'),_0x566543);loggerPredictive['info']('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x304989);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x2515cb,_0x43a5ff){if(_0x48cd6b<=0x0||isNaN(_0x48cd6b)){return _0x43a5ff(msgResponse(_0xf9c8('0x217'),'Error',_0xf9c8('0x210')+_0x48cd6b));}if(_0x5c28ee<=0x0||isNaN(_0x5c28ee)){return _0x43a5ff(msgResponse(_0xf9c8('0x217'),'Error',_0xf9c8('0x211')+_0x5c28ee));}if(_0x566543<=0x0||isNaN(_0x566543)){return _0x43a5ff(msgResponse('[busyFactor]',_0xf9c8('0x44'),_0xf9c8('0x212')+_0x566543));}if(_0x440a9d<=0x0||isNaN(_0x440a9d)){return _0x43a5ff(msgResponse('[busyFactor]','Error',_0xf9c8('0x213')+_0x440a9d));}if(_0x304989<=0x0||isNaN(_0x304989)){return _0x43a5ff(msgResponse('[busyFactor]',_0xf9c8('0x44'),_0xf9c8('0x218')+_0x304989));}_0x12a095=_0x12a095||0x0;var _0xc96aff=0x1/_0x5c28ee;var _0x23c46d=0x0;var _0x56c85a=0x0;var _0x171334=0x0;var _0x4589b3=0x0;for(var _0x5045c8=0x0;_0x4589b3<_0x304989;_0x5045c8+=0x1){_0x56c85a=_0x5045c8/_0x440a9d;_0x23c46d=(_0x566543*_0x56c85a+_0x12a095)/_0xc96aff;_0x171334=erlangb(_0x23c46d,_0x48cd6b);_0x4589b3=_0x23c46d/_0x48cd6b*(0x1-erlangb(_0x23c46d,_0x48cd6b));}return _0x2515cb({'erlangCalls':_0x5045c8,'erlangCallToSecond':_0x440a9d/_0x5045c8,'erlangAbandonmentRate':_0x171334,'erlangBusyFactor':_0x4589b3});});};module[_0xf9c8('0x219')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 0c36daf..041f38d 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 _0xcc80=['ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','responsetime','droptime','endtime','ringtime','starttime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0xbd60a7,_0x195fad){var _0x45b4fc=function(_0x5b5503){while(--_0x5b5503){_0xbd60a7['push'](_0xbd60a7['shift']());}};_0x45b4fc(++_0x195fad);}(_0xcc80,0xb7));var _0x0cc8=function(_0x4bf81f,_0x689674){_0x4bf81f=_0x4bf81f-0x0;var _0x5042c4=_0xcc80[_0x4bf81f];return _0x5042c4;};'use strict';var util=require(_0x0cc8('0x0'));var _=require('lodash');var moment=require(_0x0cc8('0x1'));function getSeconds(_0x3dc6d8,_0x397c36){var _0x104b82=moment(_0x3dc6d8)[_0x0cc8('0x2')](0x0);var _0xcd8595=moment(_0x397c36)[_0x0cc8('0x2')](0x0);return _0x104b82[_0x0cc8('0x3')](_0xcd8595,_0x0cc8('0x4'));}function QueueCallerAbandon(_0x1c5b49,_0x29067d){this[_0x0cc8('0x5')]=_0x1c5b49[_0x0cc8('0x5')];this[_0x0cc8('0x6')]=_0x1c5b49[_0x0cc8('0x6')];this[_0x0cc8('0x7')]=_0x1c5b49[_0x0cc8('0x6')]===_0x0cc8('0x8')?_0x0cc8('0x9'):_0x1c5b49['type'];this['countbusyretry']=_0x1c5b49[_0x0cc8('0xa')];this[_0x0cc8('0xb')]=_0x1c5b49[_0x0cc8('0xb')];this[_0x0cc8('0xc')]=_0x1c5b49['countnoanswerretry'];this[_0x0cc8('0xd')]=_0x1c5b49[_0x0cc8('0xa')]+_0x1c5b49[_0x0cc8('0xb')]+_0x1c5b49[_0x0cc8('0xc')]+_0x1c5b49[_0x0cc8('0xe')]+_0x1c5b49[_0x0cc8('0xf')]+_0x1c5b49[_0x0cc8('0x10')]+_0x1c5b49[_0x0cc8('0x11')]+_0x1c5b49[_0x0cc8('0x12')];this[_0x0cc8('0xe')]=_0x1c5b49[_0x0cc8('0xe')];this[_0x0cc8('0xf')]=_0x1c5b49[_0x0cc8('0xf')];this[_0x0cc8('0x10')]=_0x1c5b49[_0x0cc8('0x10')];this[_0x0cc8('0x11')]=_0x1c5b49['countmachineretry'];this[_0x0cc8('0x12')]=_0x1c5b49[_0x0cc8('0x12')];this[_0x0cc8('0x13')]=_0x29067d[_0x0cc8('0x13')];this[_0x0cc8('0x14')]=_0x1c5b49[_0x0cc8('0x15')];this[_0x0cc8('0x16')]=_0x1c5b49['number'];this['starttime']=_0x1c5b49['starttime'];this[_0x0cc8('0x17')]=_0x1c5b49[_0x0cc8('0x17')];this[_0x0cc8('0x18')]=_0x1c5b49[_0x0cc8('0x18')];this[_0x0cc8('0x19')]=this[_0x0cc8('0x18')];this[_0x0cc8('0x1a')]=getSeconds(_0x1c5b49[_0x0cc8('0x17')],_0x1c5b49[_0x0cc8('0x1b')]);this['holdtime']=getSeconds(this[_0x0cc8('0x18')],_0x1c5b49[_0x0cc8('0x17')]);this[_0x0cc8('0x1c')]=0x0;this[_0x0cc8('0x9')]=_0x29067d['queue'];this[_0x0cc8('0x1d')]=_0x29067d[_0x0cc8('0x1e')];this['reason']=_0x29067d[_0x0cc8('0x1f')];this[_0x0cc8('0x20')]=_0x1c5b49[_0x0cc8('0x20')];this['callbackuniqueid']=_0x1c5b49[_0x0cc8('0x21')];this[_0x0cc8('0x22')]=_0x1c5b49[_0x0cc8('0x22')];this[_0x0cc8('0x23')]=_0x1c5b49['recallme'];this[_0x0cc8('0x24')]=_0x1c5b49[_0x0cc8('0x24')];this['ListId']=_0x1c5b49[_0x0cc8('0x25')];this[_0x0cc8('0x26')]=_0x1c5b49[_0x0cc8('0x26')];this[_0x0cc8('0x27')]=_0x1c5b49[_0x0cc8('0x27')];this['CampaignId']=_0x1c5b49[_0x0cc8('0x28')];this[_0x0cc8('0x29')]=_0x1c5b49[_0x0cc8('0x29')]||'';this[_0x0cc8('0x2a')]=_0x1c5b49[_0x0cc8('0x2a')]||'';}module[_0x0cc8('0x2b')]=QueueCallerAbandon; \ No newline at end of file +var _0x45c6=['campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','ringtime','holdtime','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','diff','seconds','scheduledat','type'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x45c6,0x74));var _0x645c=function(_0x204403,_0x2ca01a){_0x204403=_0x204403-0x0;var _0x265470=_0x45c6[_0x204403];return _0x265470;};'use strict';var util=require('util');var _=require(_0x645c('0x0'));var moment=require(_0x645c('0x1'));function getSeconds(_0x13d41d,_0x5e072c){var _0x16cd2b=moment(_0x13d41d)[_0x645c('0x2')](0x0);var _0x5dc6ea=moment(_0x5e072c)[_0x645c('0x2')](0x0);return _0x16cd2b[_0x645c('0x3')](_0x5dc6ea,_0x645c('0x4'));}function QueueCallerAbandon(_0x3a8962,_0x5b028e){this[_0x645c('0x5')]=_0x3a8962['scheduledat'];this['type']=_0x3a8962[_0x645c('0x6')];this[_0x645c('0x7')]=_0x3a8962[_0x645c('0x6')]===_0x645c('0x8')?_0x645c('0x9'):_0x3a8962[_0x645c('0x6')];this[_0x645c('0xa')]=_0x3a8962['countbusyretry'];this[_0x645c('0xb')]=_0x3a8962[_0x645c('0xb')];this[_0x645c('0xc')]=_0x3a8962['countnoanswerretry'];this[_0x645c('0xd')]=_0x3a8962[_0x645c('0xa')]+_0x3a8962[_0x645c('0xb')]+_0x3a8962[_0x645c('0xc')]+_0x3a8962[_0x645c('0xe')]+_0x3a8962['countdropretry']+_0x3a8962[_0x645c('0xf')]+_0x3a8962[_0x645c('0x10')]+_0x3a8962[_0x645c('0x11')];this[_0x645c('0xe')]=_0x3a8962[_0x645c('0xe')];this['countdropretry']=_0x3a8962['countdropretry'];this['countabandonedretry']=_0x3a8962[_0x645c('0xf')];this[_0x645c('0x10')]=_0x3a8962[_0x645c('0x10')];this[_0x645c('0x11')]=_0x3a8962[_0x645c('0x11')];this[_0x645c('0x12')]=_0x5b028e[_0x645c('0x12')];this[_0x645c('0x13')]=_0x3a8962[_0x645c('0x14')];this[_0x645c('0x15')]=_0x3a8962[_0x645c('0x16')];this[_0x645c('0x17')]=_0x3a8962[_0x645c('0x17')];this[_0x645c('0x18')]=_0x3a8962[_0x645c('0x18')];this[_0x645c('0x19')]=_0x3a8962['droptime'];this['endtime']=this[_0x645c('0x19')];this[_0x645c('0x1a')]=getSeconds(_0x3a8962[_0x645c('0x18')],_0x3a8962[_0x645c('0x17')]);this[_0x645c('0x1b')]=getSeconds(this[_0x645c('0x19')],_0x3a8962[_0x645c('0x18')]);this[_0x645c('0x1c')]=0x0;this['queue']=_0x5b028e[_0x645c('0x9')];this['membername']=_0x5b028e[_0x645c('0x1d')];this[_0x645c('0x1e')]=_0x5b028e[_0x645c('0x1e')];this[_0x645c('0x1f')]=_0x3a8962[_0x645c('0x1f')];this[_0x645c('0x20')]=_0x3a8962[_0x645c('0x20')];this[_0x645c('0x21')]=_0x3a8962['callbackat'];this[_0x645c('0x22')]=_0x3a8962[_0x645c('0x22')];this[_0x645c('0x23')]=_0x3a8962['ContactId'];this[_0x645c('0x24')]=_0x3a8962[_0x645c('0x24')];this['UserId']=_0x3a8962['UserId'];this[_0x645c('0x25')]=_0x3a8962[_0x645c('0x25')];this[_0x645c('0x26')]=_0x3a8962['CampaignId'];this[_0x645c('0x27')]=_0x3a8962[_0x645c('0x27')]||'';this[_0x645c('0x28')]=_0x3a8962['originatecalleridname']||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index aa16e12..48d7d28 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(_0x36c1f0,_0x24b59f){var _0x39394a=function(_0x5ad06f){while(--_0x5ad06f){_0x36c1f0['push'](_0x36c1f0['shift']());}};_0x39394a(++_0x24b59f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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(_0x7f6d73,_0x50ba11){var _0x5bfb43=function(_0x31ad2f){while(--_0x31ad2f){_0x7f6d73['push'](_0x7f6d73['shift']());}};_0x5bfb43(++_0x50ba11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index c7ba3b2..bf19f9b 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 _0x9c00=['remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','reason','AttachmentId','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','%s/%s.tif','dir','XMF-PATH','Action','variablesAction','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','moment','path','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','prototype','context','hasOwnProperty','localstationid','channels','uniqueid','channel','name','\x20syncNewchannel\x20','info','variable','value','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20'];(function(_0x41e8b6,_0x306cc2){var _0x13f112=function(_0x484f85){while(--_0x484f85){_0x41e8b6['push'](_0x41e8b6['shift']());}};_0x13f112(++_0x306cc2);}(_0x9c00,0x1a0));var _0x09c0=function(_0x3c62ab,_0x33f23d){_0x3c62ab=_0x3c62ab-0x0;var _0x536970=_0x9c00[_0x3c62ab];return _0x536970;};'use strict';var util=require(_0x09c0('0x0'));var _=require(_0x09c0('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x09c0('0x2'));var path=require(_0x09c0('0x3'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x09c0('0x4'));var logger=require(_0x09c0('0x5'))(_0x09c0('0x6'));var ami=require(_0x09c0('0x7'));var rpcDb=require(_0x09c0('0x8'));var Channel=require('./channel');var ut=require('./util/util');var Action=require(_0x09c0('0x9'));var faxAccount=require(_0x09c0('0xa'));var attachment=require(_0x09c0('0xb'));var faxMessage=require(_0x09c0('0xc'));function Fax(_0x17cd9d){this['channels']={};this[_0x09c0('0xd')]=_0x17cd9d[_0x09c0('0xd')];this[_0x09c0('0xe')]=_0x17cd9d[_0x09c0('0xe')];this[_0x09c0('0xf')]={};ami['on'](_0x09c0('0x10'),this[_0x09c0('0x11')][_0x09c0('0x12')](this));ami['on'](_0x09c0('0x13'),this[_0x09c0('0x14')][_0x09c0('0x12')](this));ami['on'](_0x09c0('0x15'),this[_0x09c0('0x16')][_0x09c0('0x12')](this));ami['on'](_0x09c0('0x17'),this[_0x09c0('0x18')][_0x09c0('0x12')](this));ami['on'](_0x09c0('0x19'),this[_0x09c0('0x1a')][_0x09c0('0x12')](this));ami['on'](_0x09c0('0x1b'),this[_0x09c0('0x1c')][_0x09c0('0x12')](this));ami['on'](_0x09c0('0x1d'),this[_0x09c0('0x1e')][_0x09c0('0x12')](this));ami['on']('originateresponse',this['syncOriginateResponse']['bind'](this));}Fax[_0x09c0('0x1f')][_0x09c0('0x11')]=function(_0x3991c6){if(_0x3991c6[_0x09c0('0x20')]==='from-voip-provider'){for(var _0x2c4440 in this['faxAccounts']){if(this['faxAccounts'][_0x09c0('0x21')](_0x2c4440)){if(_0x3991c6['exten']===this[_0x09c0('0xd')][_0x2c4440][_0x09c0('0x22')]){this[_0x09c0('0x23')][_0x3991c6['uniqueid']]={};this[_0x09c0('0x23')][_0x3991c6[_0x09c0('0x24')]][_0x09c0('0x25')]=_0x3991c6[_0x09c0('0x25')];this[_0x09c0('0x23')][_0x3991c6[_0x09c0('0x24')]]['id']=this[_0x09c0('0xd')][_0x2c4440]['id'];this['channels'][_0x3991c6[_0x09c0('0x24')]][_0x09c0('0x26')]=this[_0x09c0('0xd')][_0x2c4440][_0x09c0('0x26')];logger['info'](_0x3991c6['uniqueid'],_0x09c0('0x27'));}}}}if(this[_0x09c0('0xf')][_0x3991c6[_0x09c0('0x24')]]){this[_0x09c0('0x23')][_0x3991c6['uniqueid']]={};this[_0x09c0('0x23')][_0x3991c6[_0x09c0('0x24')]]['channel']=_0x3991c6[_0x09c0('0x25')];logger[_0x09c0('0x28')](_0x3991c6[_0x09c0('0x24')],_0x09c0('0x27'));}};Fax[_0x09c0('0x1f')][_0x09c0('0x14')]=function(_0x45cc64){if(this[_0x09c0('0x23')][_0x45cc64[_0x09c0('0x24')]]){for(var _0x1aa80e in _0x45cc64[_0x09c0('0x29')]){if(_0x45cc64['variable'][_0x09c0('0x21')](_0x1aa80e)){this[_0x09c0('0x23')][_0x45cc64['uniqueid']][_0x1aa80e]=_0x45cc64[_0x09c0('0x2a')];}}}};Fax['prototype'][_0x09c0('0x16')]=function(_0x4d6bdc){if(this[_0x09c0('0x23')][_0x4d6bdc[_0x09c0('0x24')]]){this[_0x09c0('0x23')][_0x4d6bdc[_0x09c0('0x24')]]['channelstate']=_0x4d6bdc['channelstate'];this[_0x09c0('0x23')][_0x4d6bdc[_0x09c0('0x24')]][_0x09c0('0x2b')]=_0x4d6bdc['channelstatedesc'];}};Fax[_0x09c0('0x1f')]['syncNewExten']=function(_0x350cd3){if(this[_0x09c0('0x23')][_0x350cd3[_0x09c0('0x24')]]){for(var _0x500cf8 in _0x350cd3[_0x09c0('0x29')]){if(_0x350cd3[_0x09c0('0x29')][_0x09c0('0x21')](_0x500cf8)){this[_0x09c0('0x23')][_0x350cd3[_0x09c0('0x24')]][_0x500cf8]=_0x350cd3[_0x09c0('0x2a')];}}}};Fax[_0x09c0('0x1f')]['syncFaxStatus']=function(_0x26da22){if(this[_0x09c0('0x23')][_0x26da22[_0x09c0('0x24')]]){this[_0x09c0('0x23')][_0x26da22[_0x09c0('0x24')]]['operation']=_0x26da22[_0x09c0('0x2c')];this[_0x09c0('0x23')][_0x26da22[_0x09c0('0x24')]][_0x09c0('0x2d')]=_0x26da22[_0x09c0('0x2d')];this['channels'][_0x26da22[_0x09c0('0x24')]][_0x09c0('0x22')]=_0x26da22[_0x09c0('0x22')];this[_0x09c0('0x23')][_0x26da22[_0x09c0('0x24')]][_0x09c0('0x2e')]=_0x26da22[_0x09c0('0x2e')];logger['info'](_0x26da22[_0x09c0('0x24')],_0x09c0('0x2f'));}};Fax[_0x09c0('0x1f')][_0x09c0('0x1c')]=function(_0x453c23){var _0x4e98f1=this;if(this['channels'][_0x453c23['uniqueid']]){var _0x4a14dc=this[_0x09c0('0x23')][_0x453c23[_0x09c0('0x24')]]['id'];this[_0x09c0('0x23')][_0x453c23[_0x09c0('0x24')]][_0x09c0('0x30')]=_0x453c23['remotestationid'];this[_0x09c0('0x23')][_0x453c23[_0x09c0('0x24')]]['pagestransferred']=_0x453c23[_0x09c0('0x31')];this['channels'][_0x453c23[_0x09c0('0x24')]]['localstationid']=_0x453c23[_0x09c0('0x22')];this[_0x09c0('0x23')][_0x453c23['uniqueid']][_0x09c0('0x32')]=_0x453c23[_0x09c0('0x32')];this['channels'][_0x453c23[_0x09c0('0x24')]][_0x09c0('0x33')]=_0x453c23[_0x09c0('0x33')];this[_0x09c0('0x23')][_0x453c23[_0x09c0('0x24')]][_0x09c0('0x2e')]=_0x453c23['filename'];this[_0x09c0('0x23')][_0x453c23[_0x09c0('0x24')]][_0x09c0('0x34')]=_0x453c23['calleridnum'];if(this[_0x09c0('0x23')][_0x453c23[_0x09c0('0x24')]][_0x09c0('0x31')]>0x0){tiff2pdf(_0x453c23['filename'],_0x09c0('0x35'),function(_0x59d188){logger['info'](_0x453c23['uniqueid'],_0x09c0('0x36'),_0x59d188[_0x09c0('0x37')]);attachment['create']({'name':path[_0x09c0('0x38')](_0x453c23[_0x09c0('0x2e')])['name'],'basename':path[_0x09c0('0x38')](_0x453c23[_0x09c0('0x2e')])[_0x09c0('0x26')]+_0x09c0('0x39'),'type':_0x09c0('0x3a')})['then'](function(_0x330fe7){faxAccount['notify'](_0x4a14dc,{'from':_0x453c23['calleridnum'],'mapKey':_0x09c0('0x6'),'body':path[_0x09c0('0x38')](_0x453c23[_0x09c0('0x2e')])[_0x09c0('0x26')]+_0x09c0('0x39'),'AttachmentId':_0x330fe7['id']})[_0x09c0('0x3b')](function(_0x52a4ff){logger['error'](_0x453c23['uniqueid'],_0x09c0('0x3c'),JSON[_0x09c0('0x3d')](_0x52a4ff));});})[_0x09c0('0x3b')](function(_0x56ec01){logger[_0x09c0('0x3e')](_0x453c23[_0x09c0('0x24')],_0x09c0('0x3f'),JSON[_0x09c0('0x3d')](_0x56ec01));});});}logger[_0x09c0('0x28')](_0x453c23[_0x09c0('0x24')],_0x09c0('0x3f'));}};Fax[_0x09c0('0x1f')][_0x09c0('0x40')]=function(_0x38085c){if(this[_0x09c0('0xf')][_0x38085c[_0x09c0('0x24')]]){_[_0x09c0('0x41')](this[_0x09c0('0x23')][_0x38085c[_0x09c0('0x24')]],_[_0x09c0('0x42')](_0x38085c,[_0x09c0('0x43'),_0x09c0('0x44')]));}};function updateStatus(_0x3ae68f){if(_0x3ae68f[_0x09c0('0x45')]){faxMessage['update'](_0x3ae68f[_0x09c0('0x45')],{'failMessage':_0x09c0('0x46')})[_0x09c0('0x47')](function(_0x30206e){ut[_0x09c0('0x48')]('[Fax][Message][Error][Updated]',_0x30206e);})[_0x09c0('0x3b')](function(_0x866d31){ut[_0x09c0('0x48')]('[Fax][Message][Error][NoUpdate1]',_0x866d31);});}else{ut[_0x09c0('0x48')](_0x09c0('0x49'));}}Fax[_0x09c0('0x1f')][_0x09c0('0x4a')]=function(_0x55b0f0,_0xebfd6d,_0x45ecd0){var _0x499905=this;var _0x1285f8={};if(_0xebfd6d){_0x1285f8={'read':_0xebfd6d};}else{_0x1285f8={'failMessage':_0x45ecd0};}if(this[_0x09c0('0xf')][_0x55b0f0][_0x09c0('0x45')]){faxMessage[_0x09c0('0x4b')](this[_0x09c0('0xf')][_0x55b0f0][_0x09c0('0x45')],_0x1285f8)[_0x09c0('0x47')](function(_0x4987cf){ut['logger'](_0x09c0('0x4c'),_0x4987cf);})[_0x09c0('0x3b')](function(_0x1ab662){ut['logger'](_0x09c0('0x4d'),_0x1ab662);})['finally'](function(){delete _0x499905[_0x09c0('0x23')][_0x55b0f0];delete _0x499905[_0x09c0('0xf')][_0x55b0f0];});}else{ut[_0x09c0('0x48')](_0x09c0('0x4e'));delete this[_0x09c0('0x23')][_0x55b0f0];delete this[_0x09c0('0xf')][_0x55b0f0];}};Fax[_0x09c0('0x1f')]['syncHangup']=function(_0xa201bf){var _0x2d6201=this;if(this[_0x09c0('0x23')][_0xa201bf[_0x09c0('0x24')]]){if(this[_0x09c0('0xf')][_0xa201bf[_0x09c0('0x24')]]){this[_0x09c0('0x23')][_0xa201bf[_0x09c0('0x24')]]['id']=this[_0x09c0('0xf')][_0xa201bf[_0x09c0('0x24')]]['id'];this[_0x09c0('0x23')][_0xa201bf['uniqueid']][_0x09c0('0x26')]=this[_0x09c0('0xf')][_0xa201bf[_0x09c0('0x24')]][_0x09c0('0x26')];}logger['info'](_0xa201bf[_0x09c0('0x24')],this['actions'][_0xa201bf[_0x09c0('0x24')]]?_0x09c0('0x4f'):_0x09c0('0x50'),JSON['stringify'](this['channels'][_0xa201bf[_0x09c0('0x24')]]));if(this[_0x09c0('0xf')][_0xa201bf[_0x09c0('0x24')]]){if(this[_0x09c0('0x23')][_0xa201bf['uniqueid']][_0x09c0('0x51')]>0x0&&this[_0x09c0('0x23')][_0xa201bf['uniqueid']][_0x09c0('0x19')]===_0x09c0('0x52')){this[_0x09c0('0x4a')](_0xa201bf[_0x09c0('0x24')],!![]);}else{this['updateStatus'](_0xa201bf[_0x09c0('0x24')],![],this[_0x09c0('0x23')][_0xa201bf[_0x09c0('0x24')]][_0x09c0('0x53')]?_0x09c0('0x54')+this[_0x09c0('0x23')][_0xa201bf[_0x09c0('0x24')]][_0x09c0('0x53')]:_0x09c0('0x55'));}}}};Fax[_0x09c0('0x1f')][_0x09c0('0x56')]=function(_0x2906cb){var _0x2d67e8=this;return new BPromise(function(_0x484df5,_0x13f3af){_0x2d67e8[_0x09c0('0x57')](_0x2906cb,_0x2d67e8[_0x09c0('0xd')][_0x2906cb[_0x09c0('0x58')]])[_0x09c0('0x47')](function(_0x54295a){ut[_0x09c0('0x48')](_0x09c0('0x59'),_0x54295a);_0x484df5(ut[_0x09c0('0x37')](_0x09c0('0x5a')));})['catch'](function(_0x1d395e){ut[_0x09c0('0x48')]('[Fax][execOriginate][failure]',_0x1d395e);updateStatus(_0x2906cb);_0x13f3af(ut[_0x09c0('0x37')](_0x09c0('0x5b')));});});};Fax[_0x09c0('0x1f')][_0x09c0('0x5c')]=function(_0x1e9dd5){var _0x5a9516=this;return new BPromise(function(_0x19503e,_0x302c81){var _0x3a3f24=_0x5a9516[_0x09c0('0x5d')](_0x5a9516[_0x09c0('0xd')][_0x1e9dd5['FaxAccountId']][_0x09c0('0x5e')],_0x1e9dd5);if(_0x3a3f24[_0x09c0('0x5f')]){_0x19503e(ut[_0x09c0('0x37')](_0x09c0('0x60')));}else{_0x302c81(ut[_0x09c0('0x37')](_0x3a3f24[_0x09c0('0x37')]));}});};function originate(_0x59c57a,_0x51fc84,_0x583c0d){return new BPromise(function(_0x52fe65,_0x7c1cb8){if(_0x583c0d){var _0x1dcd69=util[_0x09c0('0x61')]('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[_0x09c0('0x38')](_0x59c57a['path'])[_0x09c0('0x26')],_0x59c57a[_0x09c0('0x3')]);gs['execute'](_0x1dcd69)[_0x09c0('0x47')](function(){_0x59c57a['path']=util['format'](_0x09c0('0x62'),path[_0x09c0('0x38')](_0x59c57a[_0x09c0('0x3')])[_0x09c0('0x63')],path[_0x09c0('0x38')](_0x59c57a[_0x09c0('0x3')])[_0x09c0('0x26')]);_0x51fc84[_0x09c0('0x64')]=_0x59c57a[_0x09c0('0x3')];ut[_0x09c0('0x48')]('Convert\x20pdf\x20to\x20tif','');ami[_0x09c0('0x65')](ut[_0x09c0('0x66')](_0x59c57a,_0x51fc84))['then'](function(_0x4e1d42){_0x52fe65(_0x4e1d42);})[_0x09c0('0x3b')](function(_0x164bac){_0x7c1cb8(_0x164bac);});})[_0x09c0('0x3b')](function(_0x302e0d){_0x7c1cb8(_0x302e0d);});}else{ami[_0x09c0('0x65')](ut[_0x09c0('0x66')](_0x59c57a,_0x51fc84))[_0x09c0('0x47')](function(_0x53c5dd){_0x52fe65(_0x53c5dd);})[_0x09c0('0x3b')](function(_0x56b94b){_0x7c1cb8(_0x56b94b);});}});}Fax[_0x09c0('0x1f')][_0x09c0('0x57')]=function(_0x3ecf97,_0x1a81b1){var _0x2d97cb=this;return new BPromise(function(_0x4f35d1,_0x167303){var _0x4ce49a=uuid['v4']();var _0x28e4b7=ut['addVariables'](_0x3ecf97,_0x1a81b1);_0x2d97cb[_0x09c0('0xf')][_0x4ce49a]=new Action(_0x4ce49a,_0x1a81b1,_0x3ecf97);var _0x3e8b19=_0x2d97cb[_0x09c0('0xf')][_0x4ce49a];if(path[_0x09c0('0x38')](_0x3ecf97[_0x09c0('0x3')])[_0x09c0('0x67')]===_0x09c0('0x39')){originate(_0x3e8b19,_0x28e4b7,!![])['then'](function(_0x4ab50d){_0x4f35d1(_0x4ab50d);})[_0x09c0('0x3b')](function(_0x430a78){_0x167303(_0x430a78);});}else{originate(_0x3e8b19,_0x28e4b7,![])[_0x09c0('0x47')](function(_0x309d0a){_0x4f35d1(_0x309d0a);})[_0x09c0('0x3b')](function(_0x1041d9){_0x167303(_0x1041d9);});}});};Fax[_0x09c0('0x1f')][_0x09c0('0x68')]=function(_0x97cc44){return!_[_0x09c0('0x69')](_0x97cc44)&&!_['isNil'](_0x97cc44['name'])&&!_['isNil'](_0x97cc44[_0x09c0('0x6a')])&&_0x97cc44[_0x09c0('0x6a')]&&!_[_0x09c0('0x69')](this['trunks'][util['format'](_0x09c0('0x6b'),_0x97cc44['name'])])&&!_[_0x09c0('0x69')](this[_0x09c0('0xe')][util['format'](_0x09c0('0x6b'),_0x97cc44['name'])][_0x09c0('0x2d')])&&(this[_0x09c0('0xe')][util[_0x09c0('0x61')]('SIP/%s',_0x97cc44[_0x09c0('0x26')])][_0x09c0('0x2d')]===_0x09c0('0x6c')||this[_0x09c0('0xe')][util[_0x09c0('0x61')](_0x09c0('0x6b'),_0x97cc44[_0x09c0('0x26')])][_0x09c0('0x2d')]===_0x09c0('0x6d'));};Fax[_0x09c0('0x1f')][_0x09c0('0x5d')]=function(_0xf25624,_0x592151){if(!this[_0x09c0('0x68')](_0xf25624)){ut[_0x09c0('0x48')](_0x09c0('0x6e'),_[_0x09c0('0x69')](_0xf25624)?'':_0xf25624[_0x09c0('0x26')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x09c0('0x6f')};}if(_['isNil'](_0x592151['fax'])){ut[_0x09c0('0x48')](_0x09c0('0x70'),JSON[_0x09c0('0x3d')](_0x592151));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x09c0('0x69')](_0x592151[_0x09c0('0x3')])){ut[_0x09c0('0x48')](_0x09c0('0x71'),JSON[_0x09c0('0x3d')](_0x592151));return{'isValid':![],'message':_0x09c0('0x72')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x09c0('0x73')]=Fax; \ No newline at end of file +var _0xbc9d=['notify','error','\x20notify\x20','stringify','catch','merge','response','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','update','[Fax][Message][Updated]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','.pdf','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','checkTrunk','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewState','faxstatus','syncFaxStatus','receivefax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channels','channel','name','\x20syncNewchannel\x20','info','variable','value','channelstate','syncNewExten','status','filename','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','then'];(function(_0x2f44f5,_0x4553df){var _0x239a8c=function(_0x2794b4){while(--_0x2794b4){_0x2f44f5['push'](_0x2f44f5['shift']());}};_0x239a8c(++_0x4553df);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x2a362a,_0x3c9015){_0x2a362a=_0x2a362a-0x0;var _0x3a77d9=_0xbc9d[_0x2a362a];return _0x3a77d9;};'use strict';var util=require(_0xdbc9('0x0'));var _=require(_0xdbc9('0x1'));var BPromise=require(_0xdbc9('0x2'));var uuid=require(_0xdbc9('0x3'));var moment=require(_0xdbc9('0x4'));var path=require('path');var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require(_0xdbc9('0x5'))(_0xdbc9('0x6'));var ami=require(_0xdbc9('0x7'));var rpcDb=require(_0xdbc9('0x8'));var Channel=require(_0xdbc9('0x9'));var ut=require(_0xdbc9('0xa'));var Action=require(_0xdbc9('0xb'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0xdbc9('0xc'));var faxMessage=require(_0xdbc9('0xd'));function Fax(_0x3d4918){this['channels']={};this[_0xdbc9('0xe')]=_0x3d4918['faxAccounts'];this['trunks']=_0x3d4918[_0xdbc9('0xf')];this[_0xdbc9('0x10')]={};ami['on'](_0xdbc9('0x11'),this[_0xdbc9('0x12')]['bind'](this));ami['on'](_0xdbc9('0x13'),this[_0xdbc9('0x14')][_0xdbc9('0x15')](this));ami['on'](_0xdbc9('0x16'),this[_0xdbc9('0x17')][_0xdbc9('0x15')](this));ami['on']('newexten',this['syncNewExten'][_0xdbc9('0x15')](this));ami['on'](_0xdbc9('0x18'),this[_0xdbc9('0x19')][_0xdbc9('0x15')](this));ami['on'](_0xdbc9('0x1a'),this['syncReceiveFax'][_0xdbc9('0x15')](this));ami['on'](_0xdbc9('0x1b'),this[_0xdbc9('0x1c')]['bind'](this));ami['on'](_0xdbc9('0x1d'),this[_0xdbc9('0x1e')]['bind'](this));}Fax[_0xdbc9('0x1f')][_0xdbc9('0x12')]=function(_0x2a2bd2){if(_0x2a2bd2[_0xdbc9('0x20')]===_0xdbc9('0x21')){for(var _0x33f1bd in this[_0xdbc9('0xe')]){if(this[_0xdbc9('0xe')][_0xdbc9('0x22')](_0x33f1bd)){if(_0x2a2bd2[_0xdbc9('0x23')]===this['faxAccounts'][_0x33f1bd][_0xdbc9('0x24')]){this['channels'][_0x2a2bd2[_0xdbc9('0x25')]]={};this[_0xdbc9('0x26')][_0x2a2bd2['uniqueid']][_0xdbc9('0x27')]=_0x2a2bd2['channel'];this['channels'][_0x2a2bd2['uniqueid']]['id']=this['faxAccounts'][_0x33f1bd]['id'];this[_0xdbc9('0x26')][_0x2a2bd2[_0xdbc9('0x25')]]['name']=this[_0xdbc9('0xe')][_0x33f1bd][_0xdbc9('0x28')];logger['info'](_0x2a2bd2[_0xdbc9('0x25')],_0xdbc9('0x29'));}}}}if(this[_0xdbc9('0x10')][_0x2a2bd2[_0xdbc9('0x25')]]){this[_0xdbc9('0x26')][_0x2a2bd2[_0xdbc9('0x25')]]={};this[_0xdbc9('0x26')][_0x2a2bd2[_0xdbc9('0x25')]][_0xdbc9('0x27')]=_0x2a2bd2['channel'];logger[_0xdbc9('0x2a')](_0x2a2bd2[_0xdbc9('0x25')],_0xdbc9('0x29'));}};Fax[_0xdbc9('0x1f')][_0xdbc9('0x14')]=function(_0x50c3ee){if(this[_0xdbc9('0x26')][_0x50c3ee[_0xdbc9('0x25')]]){for(var _0x5300bd in _0x50c3ee['variable']){if(_0x50c3ee[_0xdbc9('0x2b')][_0xdbc9('0x22')](_0x5300bd)){this[_0xdbc9('0x26')][_0x50c3ee['uniqueid']][_0x5300bd]=_0x50c3ee[_0xdbc9('0x2c')];}}}};Fax['prototype']['syncNewState']=function(_0x210a40){if(this['channels'][_0x210a40['uniqueid']]){this[_0xdbc9('0x26')][_0x210a40[_0xdbc9('0x25')]][_0xdbc9('0x2d')]=_0x210a40['channelstate'];this[_0xdbc9('0x26')][_0x210a40[_0xdbc9('0x25')]]['channelstatedesc']=_0x210a40['channelstatedesc'];}};Fax[_0xdbc9('0x1f')][_0xdbc9('0x2e')]=function(_0x1e0fec){if(this[_0xdbc9('0x26')][_0x1e0fec[_0xdbc9('0x25')]]){for(var _0x16c9db in _0x1e0fec[_0xdbc9('0x2b')]){if(_0x1e0fec['variable'][_0xdbc9('0x22')](_0x16c9db)){this[_0xdbc9('0x26')][_0x1e0fec[_0xdbc9('0x25')]][_0x16c9db]=_0x1e0fec[_0xdbc9('0x2c')];}}}};Fax[_0xdbc9('0x1f')][_0xdbc9('0x19')]=function(_0x537af2){if(this[_0xdbc9('0x26')][_0x537af2['uniqueid']]){this['channels'][_0x537af2['uniqueid']]['operation']=_0x537af2['operation'];this[_0xdbc9('0x26')][_0x537af2[_0xdbc9('0x25')]][_0xdbc9('0x2f')]=_0x537af2['status'];this[_0xdbc9('0x26')][_0x537af2[_0xdbc9('0x25')]][_0xdbc9('0x24')]=_0x537af2[_0xdbc9('0x24')];this[_0xdbc9('0x26')][_0x537af2[_0xdbc9('0x25')]]['filename']=_0x537af2[_0xdbc9('0x30')];logger[_0xdbc9('0x2a')](_0x537af2[_0xdbc9('0x25')],'\x20syncFaxStatus\x20');}};Fax[_0xdbc9('0x1f')][_0xdbc9('0x31')]=function(_0x30fa5c){var _0x1767bd=this;if(this['channels'][_0x30fa5c['uniqueid']]){var _0x115ef4=this[_0xdbc9('0x26')][_0x30fa5c[_0xdbc9('0x25')]]['id'];this[_0xdbc9('0x26')][_0x30fa5c['uniqueid']][_0xdbc9('0x32')]=_0x30fa5c[_0xdbc9('0x32')];this[_0xdbc9('0x26')][_0x30fa5c['uniqueid']][_0xdbc9('0x33')]=_0x30fa5c[_0xdbc9('0x33')];this[_0xdbc9('0x26')][_0x30fa5c['uniqueid']][_0xdbc9('0x24')]=_0x30fa5c[_0xdbc9('0x24')];this['channels'][_0x30fa5c['uniqueid']][_0xdbc9('0x34')]=_0x30fa5c[_0xdbc9('0x34')];this[_0xdbc9('0x26')][_0x30fa5c[_0xdbc9('0x25')]]['transferrate']=_0x30fa5c[_0xdbc9('0x35')];this[_0xdbc9('0x26')][_0x30fa5c['uniqueid']][_0xdbc9('0x30')]=_0x30fa5c[_0xdbc9('0x30')];this['channels'][_0x30fa5c[_0xdbc9('0x25')]][_0xdbc9('0x36')]=_0x30fa5c[_0xdbc9('0x36')];if(this[_0xdbc9('0x26')][_0x30fa5c[_0xdbc9('0x25')]][_0xdbc9('0x33')]>0x0){tiff2pdf(_0x30fa5c[_0xdbc9('0x30')],'/var/opt/motion2/server/files/attachments/',function(_0x5bf8af){logger[_0xdbc9('0x2a')](_0x30fa5c[_0xdbc9('0x25')],_0xdbc9('0x37'),_0x5bf8af[_0xdbc9('0x38')]);attachment[_0xdbc9('0x39')]({'name':path[_0xdbc9('0x3a')](_0x30fa5c[_0xdbc9('0x30')])[_0xdbc9('0x28')],'basename':path[_0xdbc9('0x3a')](_0x30fa5c[_0xdbc9('0x30')])[_0xdbc9('0x28')]+'.pdf','type':'application/pdf'})[_0xdbc9('0x3b')](function(_0xecaed6){faxAccount[_0xdbc9('0x3c')](_0x115ef4,{'from':_0x30fa5c[_0xdbc9('0x36')],'mapKey':_0xdbc9('0x6'),'body':path[_0xdbc9('0x3a')](_0x30fa5c[_0xdbc9('0x30')])[_0xdbc9('0x28')]+'.pdf','AttachmentId':_0xecaed6['id']})['catch'](function(_0xf24b3f){logger[_0xdbc9('0x3d')](_0x30fa5c[_0xdbc9('0x25')],_0xdbc9('0x3e'),JSON[_0xdbc9('0x3f')](_0xf24b3f));});})[_0xdbc9('0x40')](function(_0x1a5825){logger[_0xdbc9('0x3d')](_0x30fa5c[_0xdbc9('0x25')],'\x20receiveFax\x20',JSON[_0xdbc9('0x3f')](_0x1a5825));});});}logger[_0xdbc9('0x2a')](_0x30fa5c['uniqueid'],'\x20receiveFax\x20');}};Fax[_0xdbc9('0x1f')][_0xdbc9('0x1e')]=function(_0x133a13){if(this['actions'][_0x133a13[_0xdbc9('0x25')]]){_[_0xdbc9('0x41')](this[_0xdbc9('0x26')][_0x133a13[_0xdbc9('0x25')]],_['pick'](_0x133a13,[_0xdbc9('0x42'),_0xdbc9('0x43')]));}};function updateStatus(_0x468b58){if(_0x468b58[_0xdbc9('0x44')]){faxMessage['update'](_0x468b58[_0xdbc9('0x44')],{'failMessage':_0xdbc9('0x45')})[_0xdbc9('0x3b')](function(_0x2897ec){ut[_0xdbc9('0x46')](_0xdbc9('0x47'),_0x2897ec);})[_0xdbc9('0x40')](function(_0xa31276){ut['logger'](_0xdbc9('0x48'),_0xa31276);});}else{ut['logger'](_0xdbc9('0x49'));}}Fax[_0xdbc9('0x1f')]['updateStatus']=function(_0x561737,_0xc7335d,_0x4b55df){var _0x1f96f0=this;var _0x3c5f0a={};if(_0xc7335d){_0x3c5f0a={'read':_0xc7335d};}else{_0x3c5f0a={'failMessage':_0x4b55df};}if(this[_0xdbc9('0x10')][_0x561737]['AttachmentId']){faxMessage[_0xdbc9('0x4a')](this[_0xdbc9('0x10')][_0x561737][_0xdbc9('0x44')],_0x3c5f0a)[_0xdbc9('0x3b')](function(_0x1cddde){ut[_0xdbc9('0x46')](_0xdbc9('0x4b'),_0x1cddde);})[_0xdbc9('0x40')](function(_0x551681){ut['logger']('[Fax][Message][NoUpdate1]',_0x551681);})[_0xdbc9('0x4c')](function(){delete _0x1f96f0[_0xdbc9('0x26')][_0x561737];delete _0x1f96f0[_0xdbc9('0x10')][_0x561737];});}else{ut['logger']('[Fax][Message][NoUpdate2]');delete this[_0xdbc9('0x26')][_0x561737];delete this[_0xdbc9('0x10')][_0x561737];}};Fax['prototype']['syncHangup']=function(_0x7b0e49){var _0x3e9f8f=this;if(this[_0xdbc9('0x26')][_0x7b0e49[_0xdbc9('0x25')]]){if(this[_0xdbc9('0x10')][_0x7b0e49[_0xdbc9('0x25')]]){this['channels'][_0x7b0e49[_0xdbc9('0x25')]]['id']=this[_0xdbc9('0x10')][_0x7b0e49[_0xdbc9('0x25')]]['id'];this['channels'][_0x7b0e49[_0xdbc9('0x25')]][_0xdbc9('0x28')]=this[_0xdbc9('0x10')][_0x7b0e49['uniqueid']][_0xdbc9('0x28')];}logger['info'](_0x7b0e49[_0xdbc9('0x25')],this[_0xdbc9('0x10')][_0x7b0e49[_0xdbc9('0x25')]]?_0xdbc9('0x4d'):_0xdbc9('0x4e'),JSON[_0xdbc9('0x3f')](this['channels'][_0x7b0e49[_0xdbc9('0x25')]]));if(this['actions'][_0x7b0e49[_0xdbc9('0x25')]]){if(this[_0xdbc9('0x26')][_0x7b0e49['uniqueid']][_0xdbc9('0x4f')]>0x0&&this[_0xdbc9('0x26')][_0x7b0e49['uniqueid']]['faxstatus']===_0xdbc9('0x50')){this[_0xdbc9('0x51')](_0x7b0e49[_0xdbc9('0x25')],!![]);}else{this['updateStatus'](_0x7b0e49[_0xdbc9('0x25')],![],this[_0xdbc9('0x26')][_0x7b0e49['uniqueid']][_0xdbc9('0x52')]?_0xdbc9('0x53')+this['channels'][_0x7b0e49['uniqueid']][_0xdbc9('0x52')]:_0xdbc9('0x54'));}}}};Fax[_0xdbc9('0x1f')][_0xdbc9('0x55')]=function(_0x3e93d3){var _0x14cbf4=this;return new BPromise(function(_0x35903a,_0x26c599){_0x14cbf4['execOriginate'](_0x3e93d3,_0x14cbf4[_0xdbc9('0xe')][_0x3e93d3[_0xdbc9('0x56')]])[_0xdbc9('0x3b')](function(_0x555f3b){ut[_0xdbc9('0x46')](_0xdbc9('0x57'),_0x555f3b);_0x35903a(ut[_0xdbc9('0x38')](_0xdbc9('0x58')));})['catch'](function(_0x2062c3){ut['logger'](_0xdbc9('0x59'),_0x2062c3);updateStatus(_0x3e93d3);_0x26c599(ut['message'](_0xdbc9('0x5a')));});});};Fax[_0xdbc9('0x1f')]['checkAfterSend']=function(_0x517e24){var _0x5bf1a8=this;return new BPromise(function(_0x408e8f,_0x378962){var _0x1ce4fc=_0x5bf1a8['checkTrunk'](_0x5bf1a8[_0xdbc9('0xe')][_0x517e24[_0xdbc9('0x56')]][_0xdbc9('0x5b')],_0x517e24);if(_0x1ce4fc[_0xdbc9('0x5c')]){_0x408e8f(ut[_0xdbc9('0x38')](_0xdbc9('0x5d')));}else{_0x378962(ut[_0xdbc9('0x38')](_0x1ce4fc[_0xdbc9('0x38')]));}});};function originate(_0xfdfb20,_0x5e6522,_0x2787d9){return new BPromise(function(_0x2c3223,_0x511778){if(_0x2787d9){var _0x5980ac=util[_0xdbc9('0x5e')](_0xdbc9('0x5f'),path[_0xdbc9('0x3a')](_0xfdfb20[_0xdbc9('0x60')])[_0xdbc9('0x28')],_0xfdfb20[_0xdbc9('0x60')]);gs[_0xdbc9('0x61')](_0x5980ac)['then'](function(){_0xfdfb20[_0xdbc9('0x60')]=util[_0xdbc9('0x5e')](_0xdbc9('0x62'),path['parse'](_0xfdfb20[_0xdbc9('0x60')])[_0xdbc9('0x63')],path[_0xdbc9('0x3a')](_0xfdfb20[_0xdbc9('0x60')])[_0xdbc9('0x28')]);_0x5e6522[_0xdbc9('0x64')]=_0xfdfb20[_0xdbc9('0x60')];ut[_0xdbc9('0x46')](_0xdbc9('0x65'),'');ami[_0xdbc9('0x66')](ut[_0xdbc9('0x67')](_0xfdfb20,_0x5e6522))[_0xdbc9('0x3b')](function(_0x5197eb){_0x2c3223(_0x5197eb);})['catch'](function(_0x4586fc){_0x511778(_0x4586fc);});})['catch'](function(_0x5257a3){_0x511778(_0x5257a3);});}else{ami[_0xdbc9('0x66')](ut[_0xdbc9('0x67')](_0xfdfb20,_0x5e6522))[_0xdbc9('0x3b')](function(_0x4c7022){_0x2c3223(_0x4c7022);})[_0xdbc9('0x40')](function(_0x7a534a){_0x511778(_0x7a534a);});}});}Fax[_0xdbc9('0x1f')]['execOriginate']=function(_0x1d1da4,_0x2572c1){var _0x54643f=this;return new BPromise(function(_0x12c44a,_0x24a851){var _0x285ae7=uuid['v4']();var _0x188596=ut[_0xdbc9('0x68')](_0x1d1da4,_0x2572c1);_0x54643f['actions'][_0x285ae7]=new Action(_0x285ae7,_0x2572c1,_0x1d1da4);var _0x4f984b=_0x54643f[_0xdbc9('0x10')][_0x285ae7];if(path[_0xdbc9('0x3a')](_0x1d1da4['path'])[_0xdbc9('0x69')]===_0xdbc9('0x6a')){originate(_0x4f984b,_0x188596,!![])[_0xdbc9('0x3b')](function(_0x5802fc){_0x12c44a(_0x5802fc);})[_0xdbc9('0x40')](function(_0x3d3fc3){_0x24a851(_0x3d3fc3);});}else{originate(_0x4f984b,_0x188596,![])[_0xdbc9('0x3b')](function(_0x43d6ff){_0x12c44a(_0x43d6ff);})[_0xdbc9('0x40')](function(_0x42516a){_0x24a851(_0x42516a);});}});};Fax[_0xdbc9('0x1f')][_0xdbc9('0x6b')]=function(_0x49bf6f){return!_[_0xdbc9('0x6c')](_0x49bf6f)&&!_[_0xdbc9('0x6c')](_0x49bf6f[_0xdbc9('0x28')])&&!_[_0xdbc9('0x6c')](_0x49bf6f['active'])&&_0x49bf6f[_0xdbc9('0x6d')]&&!_['isNil'](this['trunks'][util[_0xdbc9('0x5e')](_0xdbc9('0x6e'),_0x49bf6f['name'])])&&!_[_0xdbc9('0x6c')](this[_0xdbc9('0xf')][util[_0xdbc9('0x5e')](_0xdbc9('0x6e'),_0x49bf6f[_0xdbc9('0x28')])][_0xdbc9('0x2f')])&&(this[_0xdbc9('0xf')][util['format']('SIP/%s',_0x49bf6f[_0xdbc9('0x28')])][_0xdbc9('0x2f')]===_0xdbc9('0x6f')||this['trunks'][util[_0xdbc9('0x5e')](_0xdbc9('0x6e'),_0x49bf6f[_0xdbc9('0x28')])][_0xdbc9('0x2f')]===_0xdbc9('0x70'));};Fax[_0xdbc9('0x1f')][_0xdbc9('0x71')]=function(_0x1a4d5b,_0x330d44){if(!this[_0xdbc9('0x6b')](_0x1a4d5b)){ut[_0xdbc9('0x46')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0xdbc9('0x6c')](_0x1a4d5b)?'':_0x1a4d5b['name']+_0xdbc9('0x72'));return{'isValid':![],'message':_0xdbc9('0x73')};}if(_[_0xdbc9('0x6c')](_0x330d44[_0xdbc9('0x6')])){ut[_0xdbc9('0x46')](_0xdbc9('0x74'),JSON[_0xdbc9('0x3f')](_0x330d44));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xdbc9('0x6c')](_0x330d44[_0xdbc9('0x60')])){ut[_0xdbc9('0x46')](_0xdbc9('0x75'),JSON['stringify'](_0x330d44));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0xdbc9('0x76')};};module[_0xdbc9('0x77')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 39f5b16..e1ce462 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 _0x21d0=['notify','resolve','then','catch','[Notify]\x20','util','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect'];(function(_0xf5c560,_0x345eb5){var _0x5c90d1=function(_0x272f6c){while(--_0x272f6c){_0xf5c560['push'](_0xf5c560['shift']());}};_0x5c90d1(++_0x345eb5);}(_0x21d0,0x155));var _0x021d=function(_0x2f0a33,_0x1ab7b2){_0x2f0a33=_0x2f0a33-0x0;var _0x5c1071=_0x21d0[_0x2f0a33];return _0x5c1071;};'use strict';var util=require(_0x021d('0x0'));var BPromise=require('bluebird');var logger=require(_0x021d('0x1'))(_0x021d('0x2'));var _=require(_0x021d('0x3'));var faxAccount=require(_0x021d('0x4'));function loggerCatch(_0xf364b3){return function(_0x103089){logger[_0x021d('0x5')](_0xf364b3,util[_0x021d('0x6')](_0x103089,{'showHidden':![],'depth':null}));};}exports[_0x021d('0x7')]=function(_0x519e89,_0x589983){return BPromise[_0x021d('0x8')]()[_0x021d('0x9')](faxAccount[_0x021d('0x7')](_0x519e89,_0x589983))[_0x021d('0xa')](loggerCatch(_0x021d('0xb')));}; \ No newline at end of file +var _0x9a60=['../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','then','catch','[Notify]\x20','bluebird'];(function(_0x37a4f1,_0x3893f6){var _0x5ad34f=function(_0x2cafed){while(--_0x2cafed){_0x37a4f1['push'](_0x37a4f1['shift']());}};_0x5ad34f(++_0x3893f6);}(_0x9a60,0xf1));var _0x09a6=function(_0x50c621,_0xfc25a6){_0x50c621=_0x50c621-0x0;var _0x1e7438=_0x9a60[_0x50c621];return _0x1e7438;};'use strict';var util=require('util');var BPromise=require(_0x09a6('0x0'));var logger=require(_0x09a6('0x1'))(_0x09a6('0x2'));var _=require(_0x09a6('0x3'));var faxAccount=require(_0x09a6('0x4'));function loggerCatch(_0x3995ee){return function(_0x68d9fb){logger[_0x09a6('0x5')](_0x3995ee,util[_0x09a6('0x6')](_0x68d9fb,{'showHidden':![],'depth':null}));};}exports[_0x09a6('0x7')]=function(_0xcbe332,_0x30c655){return BPromise['resolve']()[_0x09a6('0x8')](faxAccount[_0x09a6('0x7')](_0xcbe332,_0x30c655))[_0x09a6('0x9')](loggerCatch(_0x09a6('0xa')));}; \ 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 66e2109..87a5eef 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 _0x7e7c=['bluebird','exec','execute','Exec\x20gs','info','inspect','util','fax'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7e7c,0x17e));var _0xc7e7=function(_0x58cbde,_0x4b0f62){_0x58cbde=_0x58cbde-0x0;var _0x5799f3=_0x7e7c[_0x58cbde];return _0x5799f3;};'use strict';var util=require(_0xc7e7('0x0'));var logger=require('../../../../config/logger')(_0xc7e7('0x1'));var BPromise=require(_0xc7e7('0x2'));var exec=require('child_process')[_0xc7e7('0x3')];exports[_0xc7e7('0x4')]=function(_0x1b8fb1){return new BPromise(function(_0x9c4537,_0x3d8bbb){exec(_0x1b8fb1,function(_0x517f39,_0x57c6c5,_0x3d8428){logger['info'](_0xc7e7('0x5'),_0x57c6c5);if(_0x517f39){logger[_0xc7e7('0x6')](_0xc7e7('0x5'),'\x20Error\x20:',util[_0xc7e7('0x7')](_0x517f39,{'showHidden':![],'depth':null}),_0x57c6c5,_0x3d8428);_0x3d8bbb(_0x517f39);}_0x9c4537(_0x57c6c5);});});}; \ No newline at end of file +var _0x288e=['info','Exec\x20gs','inspect','util','../../../../config/logger','bluebird','child_process','exec','execute'];(function(_0x4fb9ed,_0x187ea0){var _0x263645=function(_0x11c604){while(--_0x11c604){_0x4fb9ed['push'](_0x4fb9ed['shift']());}};_0x263645(++_0x187ea0);}(_0x288e,0xc9));var _0xe288=function(_0x205941,_0x410eb2){_0x205941=_0x205941-0x0;var _0x32478e=_0x288e[_0x205941];return _0x32478e;};'use strict';var util=require(_0xe288('0x0'));var logger=require(_0xe288('0x1'))('fax');var BPromise=require(_0xe288('0x2'));var exec=require(_0xe288('0x3'))[_0xe288('0x4')];exports[_0xe288('0x5')]=function(_0x52f588){return new BPromise(function(_0x19faa8,_0x517913){exec(_0x52f588,function(_0x198e94,_0xb456d,_0x254a50){logger[_0xe288('0x6')]('Exec\x20gs',_0xb456d);if(_0x198e94){logger[_0xe288('0x6')](_0xe288('0x7'),'\x20Error\x20:',util[_0xe288('0x8')](_0x198e94,{'showHidden':![],'depth':null}),_0xb456d,_0x254a50);_0x517913(_0x198e94);}_0x19faa8(_0xb456d);});});}; \ 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 356b3aa..9f8134d 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 _0x7061=['inspect','ecm','headerinfo','minrate','format','\x22%s\x22','modem','gateway','t38timeout','path','uniqueid','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','localstationid','moment','../../../../config/logger','message','logger','info'];(function(_0x279343,_0x50e310){var _0x2b069e=function(_0x13163e){while(--_0x13163e){_0x279343['push'](_0x279343['shift']());}};_0x2b069e(++_0x50e310);}(_0x7061,0xf7));var _0x1706=function(_0x8f6f11,_0x5c11d){_0x8f6f11=_0x8f6f11-0x0;var _0x40cab1=_0x7061[_0x8f6f11];return _0x40cab1;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x1706('0x0'));var logger=require(_0x1706('0x1'))('fax');exports[_0x1706('0x2')]=function(_0x1062d5){return{'message':_0x1062d5};};exports[_0x1706('0x3')]=function(_0x3595e9,_0x380022){logger[_0x1706('0x4')](_0x3595e9,util[_0x1706('0x5')](_0x380022,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x3abe56,_0x75c269){var _0x482cf2={'XMF-ECM':_0x75c269[_0x1706('0x6')],'XMF-HEADERINFO':_0x75c269[_0x1706('0x7')],'XMF-MINRATE':_0x75c269[_0x1706('0x8')],'XMF-MAXRATE':_0x75c269['maxrate'],'XMF-MODEM':util[_0x1706('0x9')](_0x1706('0xa'),_0x75c269[_0x1706('0xb')]),'XMF-GATEWAY':_0x75c269[_0x1706('0xc')],'XMF-FAXDETECT':_0x75c269['faxdetect'],'XMF-T38TIMEOUT':_0x75c269[_0x1706('0xd')],'XMF-LOCALSTATIONID':_0x75c269['localstationid'],'XMF-PATH':_0x3abe56[_0x1706('0xe')]};return _0x482cf2;};exports['variablesAction']=function(_0xd97f2c,_0x4802ad){return{'actionid':_0xd97f2c[_0x1706('0xf')],'action':'originate','channel':_0xd97f2c[_0x1706('0x10')],'Exten':_0x1706('0x11'),'Context':_0x1706('0x12'),'Priority':'1','callerid':util[_0x1706('0x9')](_0x1706('0x13'),_0xd97f2c[_0x1706('0x7')]?_0xd97f2c[_0x1706('0x7')]:'',_0xd97f2c[_0x1706('0x14')]),'variable':_0x4802ad,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xd97f2c[_0x1706('0xf')]};}; \ No newline at end of file +var _0x8086=['ecm','minrate','format','\x22%s\x22','faxdetect','t38timeout','variablesAction','uniqueid','originate','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','headerinfo','localstationid','moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x8086,0xd4));var _0x6808=function(_0x3cf2f5,_0xd015b2){_0x3cf2f5=_0x3cf2f5-0x0;var _0x3c5a1a=_0x8086[_0x3cf2f5];return _0x3c5a1a;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x6808('0x0'));var logger=require(_0x6808('0x1'))(_0x6808('0x2'));exports[_0x6808('0x3')]=function(_0x1f466a){return{'message':_0x1f466a};};exports[_0x6808('0x4')]=function(_0x3d8ac2,_0x2cd27c){logger[_0x6808('0x5')](_0x3d8ac2,util[_0x6808('0x6')](_0x2cd27c,{'showHidden':![],'depth':null}));};exports[_0x6808('0x7')]=function(_0x3c2dfa,_0xf8536f){var _0x2484a9={'XMF-ECM':_0xf8536f[_0x6808('0x8')],'XMF-HEADERINFO':_0xf8536f['headerinfo'],'XMF-MINRATE':_0xf8536f[_0x6808('0x9')],'XMF-MAXRATE':_0xf8536f['maxrate'],'XMF-MODEM':util[_0x6808('0xa')](_0x6808('0xb'),_0xf8536f['modem']),'XMF-GATEWAY':_0xf8536f['gateway'],'XMF-FAXDETECT':_0xf8536f[_0x6808('0xc')],'XMF-T38TIMEOUT':_0xf8536f[_0x6808('0xd')],'XMF-LOCALSTATIONID':_0xf8536f['localstationid'],'XMF-PATH':_0x3c2dfa['path']};return _0x2484a9;};exports[_0x6808('0xe')]=function(_0x403a67,_0xed25ef){return{'actionid':_0x403a67[_0x6808('0xf')],'action':_0x6808('0x10'),'channel':_0x403a67[_0x6808('0x11')],'Exten':_0x6808('0x12'),'Context':'from-sip','Priority':'1','callerid':util[_0x6808('0xa')](_0x6808('0x13'),_0x403a67[_0x6808('0x14')]?_0x403a67[_0x6808('0x14')]:'',_0x403a67[_0x6808('0x15')]),'variable':_0xed25ef,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x403a67['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 7aeedaf..c79fd84 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 _0xeb3f=['initAgents','then','getTelephones','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','inspect','listen','[index.js][main]','util','moment','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','get','hour','resolve','getAgents'];(function(_0x4a90dc,_0x94e0a9){var _0x2fad99=function(_0x373eee){while(--_0x373eee){_0x4a90dc['push'](_0x4a90dc['shift']());}};_0x2fad99(++_0x94e0a9);}(_0xeb3f,0x7a));var _0xfeb3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xeb3f[_0x17d9e3];return _0x14192d;};'use strict';var BPromise=require('bluebird');var util=require(_0xfeb3('0x0'));var moment=require(_0xfeb3('0x1'));var server=require('./server');var Realtime=require(_0xfeb3('0x2'));var Report=require(_0xfeb3('0x3'));var Acw=require(_0xfeb3('0x4'));var Trigger=require(_0xfeb3('0x5'));var Dialer=require(_0xfeb3('0x6'));var Preview=require(_0xfeb3('0x7'));var Fax=require(_0xfeb3('0x8'));var user=require('./rpc/user');var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xfeb3('0x9'));var voiceCallReport=require(_0xfeb3('0xa'));var trunk=require('./rpc/trunk');var trigger=require(_0xfeb3('0xb'));var template=require(_0xfeb3('0xc'));var cmHopperHistory=require(_0xfeb3('0xd'));var campaign=require(_0xfeb3('0xe'));var voiceExtension=require(_0xfeb3('0xf'));var faxAccount=require(_0xfeb3('0x10'));var zendesk=require(_0xfeb3('0x11'));var salesforce=require(_0xfeb3('0x12'));var sugarcrm=require(_0xfeb3('0x13'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require('./rpc/integrations/desk');var zoho=require(_0xfeb3('0x14'));var vtiger=require(_0xfeb3('0x15'));var freshsales=require(_0xfeb3('0x16'));var servicenow=require(_0xfeb3('0x17'));var dynamics365=require(_0xfeb3('0x18'));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(_0xfeb3('0x19'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xfeb3('0x1a')](_0xfeb3('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xfeb3('0x1a')](_0xfeb3('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xfeb3('0x1c')]()['then'](user[_0xfeb3('0x1d')]())['then'](realtime[_0xfeb3('0x1e')]())[_0xfeb3('0x1f')](user[_0xfeb3('0x20')]())['then'](realtime[_0xfeb3('0x21')]())[_0xfeb3('0x1f')](trunk['getTrunks']())[_0xfeb3('0x1f')](realtime[_0xfeb3('0x22')]())[_0xfeb3('0x1f')](voiceQueue[_0xfeb3('0x23')]())['then'](realtime[_0xfeb3('0x24')]())[_0xfeb3('0x1f')](trigger[_0xfeb3('0x25')]())['then'](realtime[_0xfeb3('0x26')]())[_0xfeb3('0x1f')](template[_0xfeb3('0x27')]())['then'](realtime[_0xfeb3('0x28')]())['then'](zendesk[_0xfeb3('0x29')]())[_0xfeb3('0x1f')](realtime[_0xfeb3('0x2a')]())[_0xfeb3('0x1f')](salesforce['getSalesforceAccounts']())[_0xfeb3('0x1f')](realtime[_0xfeb3('0x2b')]())['then'](sugarcrm[_0xfeb3('0x2c')]())[_0xfeb3('0x1f')](realtime[_0xfeb3('0x2d')]())[_0xfeb3('0x1f')](freshdesk[_0xfeb3('0x2e')]())[_0xfeb3('0x1f')](realtime[_0xfeb3('0x2f')]())[_0xfeb3('0x1f')](desk[_0xfeb3('0x30')]())[_0xfeb3('0x1f')](realtime[_0xfeb3('0x31')]())[_0xfeb3('0x1f')](zoho[_0xfeb3('0x32')]())[_0xfeb3('0x1f')](realtime['initZohoAccounts']())[_0xfeb3('0x1f')](vtiger[_0xfeb3('0x33')]())['then'](realtime['initVtigerAccounts']())[_0xfeb3('0x1f')](freshsales[_0xfeb3('0x34')]())['then'](realtime[_0xfeb3('0x35')]())['then'](servicenow[_0xfeb3('0x36')]())[_0xfeb3('0x1f')](realtime[_0xfeb3('0x37')]())[_0xfeb3('0x1f')](dynamics365[_0xfeb3('0x38')]())[_0xfeb3('0x1f')](realtime[_0xfeb3('0x39')]())[_0xfeb3('0x1f')](campaign[_0xfeb3('0x3a')]())[_0xfeb3('0x1f')](realtime[_0xfeb3('0x3b')]())[_0xfeb3('0x1f')](voiceExtension[_0xfeb3('0x3c')]())[_0xfeb3('0x1f')](realtime[_0xfeb3('0x3d')]())[_0xfeb3('0x1f')](faxAccount[_0xfeb3('0x3e')]())['then'](realtime[_0xfeb3('0x3f')]())[_0xfeb3('0x1f')](function(){return realtime;});}function initParams(){return BPromise[_0xfeb3('0x1c')]()['then'](voiceQueueReport[_0xfeb3('0x40')]())[_0xfeb3('0x1f')](realtime[_0xfeb3('0x41')]())[_0xfeb3('0x1f')](cmHopperHistory[_0xfeb3('0x42')]())['then'](realtime[_0xfeb3('0x43')]())['then'](cmHopperHistory['getCampaignHopperHistory']())['then'](realtime[_0xfeb3('0x44')]())[_0xfeb3('0x1f')](voiceCallReport[_0xfeb3('0x45')]())[_0xfeb3('0x1f')](realtime[_0xfeb3('0x46')]())[_0xfeb3('0x47')](function(_0x212b44){logger[_0xfeb3('0x48')]('[index.js][initParams]',util[_0xfeb3('0x49')](_0x212b44,{'showHidden':![],'depth':null}));});}function main(){return server[_0xfeb3('0x4a')](realtime,preview,fax)[_0xfeb3('0x1f')](function(_0x436e70){return initRealtime();})['then'](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x397aa8){logger['error'](_0xfeb3('0x4b'),util[_0xfeb3('0x49')](_0x397aa8,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xf691=['getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','bluebird','./server','./realtime','./acw','./preview','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts'];(function(_0x432fb3,_0x48cd6c){var _0x5cbf50=function(_0x55a585){while(--_0x55a585){_0x432fb3['push'](_0x432fb3['shift']());}};_0x5cbf50(++_0x48cd6c);}(_0xf691,0x1ce));var _0x1f69=function(_0x4466b8,_0x1fd0da){_0x4466b8=_0x4466b8-0x0;var _0x29c18a=_0xf691[_0x4466b8];return _0x29c18a;};'use strict';var BPromise=require(_0x1f69('0x0'));var util=require('util');var moment=require('moment');var server=require(_0x1f69('0x1'));var Realtime=require(_0x1f69('0x2'));var Report=require('./report');var Acw=require(_0x1f69('0x3'));var Trigger=require('./trigger');var Dialer=require('./dialer');var Preview=require(_0x1f69('0x4'));var Fax=require(_0x1f69('0x5'));var user=require('./rpc/user');var voiceQueue=require(_0x1f69('0x6'));var voiceQueueReport=require(_0x1f69('0x7'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require('./rpc/trunk');var trigger=require('./rpc/trigger');var template=require(_0x1f69('0x8'));var cmHopperHistory=require(_0x1f69('0x9'));var campaign=require(_0x1f69('0xa'));var voiceExtension=require(_0x1f69('0xb'));var faxAccount=require(_0x1f69('0xc'));var zendesk=require(_0x1f69('0xd'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x1f69('0xe'));var freshdesk=require(_0x1f69('0xf'));var desk=require(_0x1f69('0x10'));var zoho=require(_0x1f69('0x11'));var vtiger=require(_0x1f69('0x12'));var freshsales=require(_0x1f69('0x13'));var servicenow=require(_0x1f69('0x14'));var dynamics365=require(_0x1f69('0x15'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x1f69('0x16'))(_0x1f69('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get']('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x1f69('0x18')](_0x1f69('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x1f69('0x1a')]()[_0x1f69('0x1b')](user[_0x1f69('0x1c')]())[_0x1f69('0x1b')](realtime[_0x1f69('0x1d')]())[_0x1f69('0x1b')](user[_0x1f69('0x1e')]())[_0x1f69('0x1b')](realtime[_0x1f69('0x1f')]())[_0x1f69('0x1b')](trunk[_0x1f69('0x20')]())['then'](realtime['initTrunks']())[_0x1f69('0x1b')](voiceQueue[_0x1f69('0x21')]())[_0x1f69('0x1b')](realtime[_0x1f69('0x22')]())[_0x1f69('0x1b')](trigger[_0x1f69('0x23')]())['then'](realtime[_0x1f69('0x24')]())[_0x1f69('0x1b')](template[_0x1f69('0x25')]())[_0x1f69('0x1b')](realtime[_0x1f69('0x26')]())[_0x1f69('0x1b')](zendesk[_0x1f69('0x27')]())[_0x1f69('0x1b')](realtime[_0x1f69('0x28')]())[_0x1f69('0x1b')](salesforce['getSalesforceAccounts']())[_0x1f69('0x1b')](realtime[_0x1f69('0x29')]())[_0x1f69('0x1b')](sugarcrm[_0x1f69('0x2a')]())[_0x1f69('0x1b')](realtime[_0x1f69('0x2b')]())[_0x1f69('0x1b')](freshdesk[_0x1f69('0x2c')]())[_0x1f69('0x1b')](realtime['initFreshdeskAccounts']())[_0x1f69('0x1b')](desk[_0x1f69('0x2d')]())[_0x1f69('0x1b')](realtime[_0x1f69('0x2e')]())[_0x1f69('0x1b')](zoho[_0x1f69('0x2f')]())[_0x1f69('0x1b')](realtime[_0x1f69('0x30')]())[_0x1f69('0x1b')](vtiger[_0x1f69('0x31')]())[_0x1f69('0x1b')](realtime[_0x1f69('0x32')]())[_0x1f69('0x1b')](freshsales[_0x1f69('0x33')]())[_0x1f69('0x1b')](realtime[_0x1f69('0x34')]())[_0x1f69('0x1b')](servicenow[_0x1f69('0x35')]())[_0x1f69('0x1b')](realtime[_0x1f69('0x36')]())[_0x1f69('0x1b')](dynamics365[_0x1f69('0x37')]())[_0x1f69('0x1b')](realtime['initDynamics365Accounts']())[_0x1f69('0x1b')](campaign[_0x1f69('0x38')]())[_0x1f69('0x1b')](realtime['initCampaigns']())[_0x1f69('0x1b')](voiceExtension['getVoiceExtensions']())['then'](realtime[_0x1f69('0x39')]())['then'](faxAccount[_0x1f69('0x3a')]())[_0x1f69('0x1b')](realtime['initFaxAccounts']())[_0x1f69('0x1b')](function(){return realtime;});}function initParams(){return BPromise[_0x1f69('0x1a')]()['then'](voiceQueueReport[_0x1f69('0x3b')]())[_0x1f69('0x1b')](realtime[_0x1f69('0x3c')]())['then'](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x1f69('0x1b')](realtime[_0x1f69('0x3d')]())[_0x1f69('0x1b')](cmHopperHistory[_0x1f69('0x3e')]())['then'](realtime[_0x1f69('0x3f')]())['then'](voiceCallReport[_0x1f69('0x40')]())[_0x1f69('0x1b')](realtime[_0x1f69('0x41')]())[_0x1f69('0x42')](function(_0x1b1630){logger[_0x1f69('0x43')](_0x1f69('0x44'),util[_0x1f69('0x45')](_0x1b1630,{'showHidden':![],'depth':null}));});}function main(){return server[_0x1f69('0x46')](realtime,preview,fax)[_0x1f69('0x1b')](function(_0x4f3f43){return initRealtime();})[_0x1f69('0x1b')](function(){return initParams();})[_0x1f69('0x1b')](function(){report[_0x1f69('0x47')]();setInterval(initRealtime,0x1388);})[_0x1f69('0x42')](function(_0x728458){logger[_0x1f69('0x43')](_0x1f69('0x48'),util[_0x1f69('0x45')](_0x728458,{'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 4337c8d..366d0e9 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 _0xe706=['address','phone','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','updateStatusRealtime','not_inuse','inuse','talking','format','interface','stringify','md5','user:%s','emit','user:presence','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status'];(function(_0x425a8d,_0x1745b0){var _0x434378=function(_0x117a39){while(--_0x117a39){_0x425a8d['push'](_0x425a8d['shift']());}};_0x434378(++_0x1745b0);}(_0xe706,0xa3));var _0x6e70=function(_0x13992d,_0x3029ea){_0x13992d=_0x13992d-0x0;var _0x3d15bf=_0xe706[_0x13992d];return _0x3d15bf;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var md5=require('md5');var Redis=require(_0x6e70('0x3'));var config=require(_0x6e70('0x4'));config[_0x6e70('0x5')]=_[_0x6e70('0x6')](config[_0x6e70('0x5')],{'host':_0x6e70('0x7'),'port':0x18eb});var io=require(_0x6e70('0x8'))(new Redis(config[_0x6e70('0x5')]));function Agent(_0x1b0389){this['id']=_0x1b0389['id']||0x0;this[_0x6e70('0x9')]=_0x1b0389[_0x6e70('0x9')]||'';this[_0x6e70('0xa')]=_0x1b0389[_0x6e70('0xa')]||'';this[_0x6e70('0xb')]=_0x1b0389[_0x6e70('0xb')]||'';this[_0x6e70('0xc')]=_0x1b0389[_0x6e70('0xc')]||'';this[_0x6e70('0xd')]=_0x6e70('0xe');this[_0x6e70('0xf')]=0x0;this[_0x6e70('0x10')]=_0x6e70('0xe');this[_0x6e70('0x11')]='';this[_0x6e70('0x12')]='';this['mobile']='';this['interface']='';this[_0x6e70('0x13')]=_0x1b0389[_0x6e70('0x13')]||![];this[_0x6e70('0x14')]=_0x6e70('0xe');this[_0x6e70('0x15')]=0x0;this[_0x6e70('0x16')]='';this[_0x6e70('0x17')]='';this[_0x6e70('0x18')]=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x6e70('0x19')]=function(_0x5a37a6){var _0x53aed0;if(_0x5a37a6&&_0x5a37a6[_0x6e70('0xd')]){_0x53aed0=_0x5a37a6[_0x6e70('0xd')]['toLowerCase']();switch(_0x53aed0){case _0x6e70('0x1a'):_0x53aed0='idle';break;case _0x6e70('0x1b'):_0x53aed0=_0x6e70('0x1c');break;}}if(_0x53aed0&&this['voiceStatus']!==_0x53aed0||_0x5a37a6['statePause']){this[_0x6e70('0x15')]=_['toNumber'](moment()[_0x6e70('0x1d')]('x'));}if(_0x53aed0){this[_0x6e70('0x14')]=_0x53aed0;}var _0x53acdc={'id':this['id'],'name':this['name'],'email':this[_0x6e70('0xa')],'accountcode':this[_0x6e70('0xb')],'fullname':this[_0x6e70('0xc')],'state':this[_0x6e70('0xd')],'stateTime':this[_0x6e70('0xf')],'status':this[_0x6e70('0x10')],'address':this[_0x6e70('0x11')],'online':this[_0x6e70('0x13')],'voiceStatus':this[_0x6e70('0x14')],'voiceStatusTime':this[_0x6e70('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x6e70('0x17')],'interface':this[_0x6e70('0x1e')],'onhold':this[_0x6e70('0x18')]};var _0x502b2d=md5(JSON[_0x6e70('0x1f')](_0x53acdc));if(this[_0x6e70('0x20')]!==_0x502b2d){this[_0x6e70('0x20')]=_0x502b2d;io['to'](util['format'](_0x6e70('0x21'),_0x53acdc['name']))['emit']('user:save',_0x53acdc);io[_0x6e70('0x22')](_0x6e70('0x23'),_0x53acdc);}};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(_0x566458,_0x2e4161){var _0x2fa342=function(_0x5bca98){while(--_0x5bca98){_0x566458['push'](_0x566458['shift']());}};_0x2fa342(++_0x2e4161);}(_0x70e0,0x17b));var _0x070e=function(_0x221383,_0x1a6219){_0x221383=_0x221383-0x0;var _0x4e28a0=_0x70e0[_0x221383];return _0x4e28a0;};'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 555a520..bee7ada 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 _0x385e=['dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime'];(function(_0x115ef0,_0x5a83b2){var _0x420f5a=function(_0x102b2d){while(--_0x102b2d){_0x115ef0['push'](_0x115ef0['shift']());}};_0x420f5a(++_0x5a83b2);}(_0x385e,0x100));var _0xe385=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x385e[_0x1b6186];return _0x186121;};'use strict';function Campaign(_0x2dfd52){this['id']=_0x2dfd52['id']||0x0;this[_0xe385('0x0')]=_0x2dfd52[_0xe385('0x0')]||'';this[_0xe385('0x1')]=_0x2dfd52[_0xe385('0x1')]||_0xe385('0x2');this['originated']=0x0;this[_0xe385('0x3')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0xe385('0x4')]=0x0;this[_0xe385('0x5')]='';this[_0xe385('0x6')]=!![];this['active']=_0x2dfd52[_0xe385('0x7')];this[_0xe385('0x8')]=_0x2dfd52['limitCalls'];this['dialTimezone']=_0x2dfd52[_0xe385('0x9')]||null;this[_0xe385('0xa')]=_0x2dfd52[_0xe385('0xa')]?_0x2dfd52[_0xe385('0xa')]:null;this[_0xe385('0xb')]=_0x2dfd52[_0xe385('0xb')];this['dialOriginateCallerIdNumber']=_0x2dfd52[_0xe385('0xc')];this[_0xe385('0xd')]=_0x2dfd52[_0xe385('0xd')]||0x1e;this[_0xe385('0xe')]=_0x2dfd52[_0xe385('0xe')];this[_0xe385('0xf')]=_0x2dfd52[_0xe385('0xf')];this[_0xe385('0x10')]=_0x2dfd52[_0xe385('0x10')];this[_0xe385('0x11')]=_0x2dfd52['dialBusyRetryFrequency'];this[_0xe385('0x12')]=_0x2dfd52['dialNoAnswerMaxRetry'];this[_0xe385('0x13')]=_0x2dfd52['dialNoAnswerRetryFrequency'];this[_0xe385('0x14')]=_0x2dfd52[_0xe385('0x14')];this[_0xe385('0x15')]=_0x2dfd52['dialNoSuchNumberMaxRetry']||0x3;this[_0xe385('0x16')]=_0x2dfd52[_0xe385('0x16')]||0x96;this[_0xe385('0x17')]=_0x2dfd52[_0xe385('0x17')]||0x3;this[_0xe385('0x18')]=_0x2dfd52[_0xe385('0x18')]||0x96;this[_0xe385('0x19')]=_0x2dfd52['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x2dfd52[_0xe385('0x1a')]||0x96;this['dialMachineMaxRetry']=_0x2dfd52[_0xe385('0x1b')]||0x3;this[_0xe385('0x1c')]=_0x2dfd52['dialMachineRetryFrequency']||0x96;this[_0xe385('0x1d')]=_0x2dfd52[_0xe385('0x1d')]||0x3;this['dialAgentRejectRetryFrequency']=_0x2dfd52['dialAgentRejectRetryFrequency']||0x96;this['dialOrderByScheduledAt']=_0x2dfd52['dialOrderByScheduledAt']||_0xe385('0x1e');this[_0xe385('0x1f')]=_0x2dfd52[_0xe385('0x1f')]||undefined;this[_0xe385('0x20')]=_0x2dfd52[_0xe385('0x20')]||undefined;this[_0xe385('0x21')]=_0x2dfd52[_0xe385('0x21')]||undefined;this[_0xe385('0x22')]=_0x2dfd52[_0xe385('0x22')]?_0x2dfd52['TrunkBackup']:undefined;this[_0xe385('0x23')]=_0x2dfd52['Trunk']?_0x2dfd52[_0xe385('0x23')]:undefined;this[_0xe385('0x24')]=_0x2dfd52['Interval']?_0x2dfd52['Interval']:undefined;this[_0xe385('0x25')]=_0x2dfd52[_0xe385('0x25')]?_0x2dfd52[_0xe385('0x25')]:undefined;this[_0xe385('0x26')]=_0x2dfd52['SquareProject']?_0x2dfd52['SquareProject'][_0xe385('0x0')]:undefined;this[_0xe385('0x27')]=_0x2dfd52['dialAMDActive']||![];this[_0xe385('0x28')]=_0x2dfd52[_0xe385('0x28')];this[_0xe385('0x29')]=_0x2dfd52[_0xe385('0x29')];this[_0xe385('0x2a')]=_0x2dfd52[_0xe385('0x2a')];this['dialAMDTotalAnalysisTime']=_0x2dfd52[_0xe385('0x2b')];this[_0xe385('0x2c')]=_0x2dfd52[_0xe385('0x2c')];this['dialAMDBetweenWordsSilence']=_0x2dfd52[_0xe385('0x2d')];this[_0xe385('0x2e')]=_0x2dfd52[_0xe385('0x2e')];this[_0xe385('0x2f')]=_0x2dfd52[_0xe385('0x2f')];this[_0xe385('0x30')]=_0x2dfd52[_0xe385('0x30')];}module[_0xe385('0x31')]=Campaign; \ No newline at end of file +var _0x24ba=['dialOriginateCallerIdNumber','dialOriginateTimeout','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','type','campaign','originated','temp','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName'];(function(_0x39caaa,_0x1f37bc){var _0x9b9c7d=function(_0x2da02c){while(--_0x2da02c){_0x39caaa['push'](_0x39caaa['shift']());}};_0x9b9c7d(++_0x1f37bc);}(_0x24ba,0x8d));var _0xa24b=function(_0x525181,_0x52f2ca){_0x525181=_0x525181-0x0;var _0x13672b=_0x24ba[_0x525181];return _0x13672b;};'use strict';function Campaign(_0xc097e){this['id']=_0xc097e['id']||0x0;this['name']=_0xc097e['name']||'';this['type']=_0xc097e[_0xa24b('0x0')]||_0xa24b('0x1');this[_0xa24b('0x2')]=0x0;this[_0xa24b('0x3')]=0x0;this[_0xa24b('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0xa24b('0x5')]='';this[_0xa24b('0x6')]=!![];this[_0xa24b('0x7')]=_0xc097e[_0xa24b('0x7')];this[_0xa24b('0x8')]=_0xc097e['limitCalls'];this[_0xa24b('0x9')]=_0xc097e[_0xa24b('0x9')]||null;this[_0xa24b('0xa')]=_0xc097e[_0xa24b('0xa')]?_0xc097e[_0xa24b('0xa')]:null;this['dialOriginateCallerIdName']=_0xc097e[_0xa24b('0xb')];this[_0xa24b('0xc')]=_0xc097e[_0xa24b('0xc')];this['dialOriginateTimeout']=_0xc097e[_0xa24b('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0xc097e['dialCongestionMaxRetry'];this[_0xa24b('0xe')]=_0xc097e[_0xa24b('0xe')];this[_0xa24b('0xf')]=_0xc097e['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0xc097e[_0xa24b('0x10')];this['dialNoAnswerMaxRetry']=_0xc097e[_0xa24b('0x11')];this[_0xa24b('0x12')]=_0xc097e[_0xa24b('0x12')];this['dialGlobalMaxRetry']=_0xc097e[_0xa24b('0x13')];this[_0xa24b('0x14')]=_0xc097e[_0xa24b('0x14')]||0x3;this[_0xa24b('0x15')]=_0xc097e[_0xa24b('0x15')]||0x96;this[_0xa24b('0x16')]=_0xc097e['dialDropMaxRetry']||0x3;this[_0xa24b('0x17')]=_0xc097e[_0xa24b('0x17')]||0x96;this[_0xa24b('0x18')]=_0xc097e[_0xa24b('0x18')]||0x3;this['dialAbandonedRetryFrequency']=_0xc097e[_0xa24b('0x19')]||0x96;this[_0xa24b('0x1a')]=_0xc097e['dialMachineMaxRetry']||0x3;this[_0xa24b('0x1b')]=_0xc097e[_0xa24b('0x1b')]||0x96;this[_0xa24b('0x1c')]=_0xc097e[_0xa24b('0x1c')]||0x3;this[_0xa24b('0x1d')]=_0xc097e[_0xa24b('0x1d')]||0x96;this[_0xa24b('0x1e')]=_0xc097e[_0xa24b('0x1e')]||_0xa24b('0x1f');this[_0xa24b('0x20')]=_0xc097e[_0xa24b('0x20')]||undefined;this[_0xa24b('0x21')]=_0xc097e[_0xa24b('0x21')]||undefined;this['dialCutDigit']=_0xc097e[_0xa24b('0x22')]||undefined;this['TrunkBackup']=_0xc097e[_0xa24b('0x23')]?_0xc097e['TrunkBackup']:undefined;this[_0xa24b('0x24')]=_0xc097e['Trunk']?_0xc097e[_0xa24b('0x24')]:undefined;this[_0xa24b('0x25')]=_0xc097e[_0xa24b('0x25')]?_0xc097e[_0xa24b('0x25')]:undefined;this['SquareProject']=_0xc097e['SquareProject']?_0xc097e[_0xa24b('0x26')]:undefined;this[_0xa24b('0x27')]=_0xc097e[_0xa24b('0x26')]?_0xc097e[_0xa24b('0x26')]['name']:undefined;this[_0xa24b('0x28')]=_0xc097e[_0xa24b('0x28')]||![];this[_0xa24b('0x29')]=_0xc097e[_0xa24b('0x29')];this[_0xa24b('0x2a')]=_0xc097e['dialAMDGreeting'];this[_0xa24b('0x2b')]=_0xc097e[_0xa24b('0x2b')];this[_0xa24b('0x2c')]=_0xc097e['dialAMDTotalAnalysisTime'];this[_0xa24b('0x2d')]=_0xc097e['dialAMDMinWordLength'];this[_0xa24b('0x2e')]=_0xc097e[_0xa24b('0x2e')];this[_0xa24b('0x2f')]=_0xc097e[_0xa24b('0x2f')];this[_0xa24b('0x30')]=_0xc097e[_0xa24b('0x30')];this[_0xa24b('0x31')]=_0xc097e['dialAMDMaximumWordLength'];}module[_0xa24b('0x32')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index cddb216..54873c0 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 _0x672d=['exports','starttime','destinationchannel','calleridnum','accountcode','context','linkedid','answered','answertime','endtime','unmanaged','abandoned','lastapplication','duration','billableseconds','holdtime','type','tag','disposition','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x672d,0x181));var _0xd672=function(_0x1455fb,_0x394bef){_0x1455fb=_0x1455fb-0x0;var _0x28a572=_0x672d[_0x1455fb];return _0x28a572;};'use strict';function Channel(){this[_0xd672('0x0')]=null;this['channel']='';this[_0xd672('0x1')]='';this[_0xd672('0x2')]=0x0;this['calleridname']='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this[_0xd672('0x3')]=0x0;this[_0xd672('0x4')]='';this['uniqueid']=0x0;this[_0xd672('0x5')]=0x0;this['exten']=0x0;this[_0xd672('0x6')]=![];this[_0xd672('0x7')]=null;this[_0xd672('0x8')]=null;this[_0xd672('0x9')]=![];this[_0xd672('0xa')]=![];this[_0xd672('0xb')]='';this['lastdata']='';this[_0xd672('0xc')]=0x0;this[_0xd672('0xd')]=0x0;this[_0xd672('0xe')]=0x0;this[_0xd672('0xf')]=null;this[_0xd672('0x10')]=null;this[_0xd672('0x11')]=null;this['monitor']=![];this['monitorFilename']=null;this[_0xd672('0x12')]=null;this[_0xd672('0x13')]=[];this[_0xd672('0x14')]=undefined;this[_0xd672('0x15')]=undefined;this[_0xd672('0x16')]=undefined;this['mohtime']=0x0;}module[_0xd672('0x17')]=Channel; \ No newline at end of file +var _0xb19a=['disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','exports','starttime','calleridnum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','endtime','unmanaged','lastapplication','duration','billableseconds','holdtime','type','tag'];(function(_0x4fdc81,_0x3c1170){var _0x3ec57b=function(_0x362738){while(--_0x362738){_0x4fdc81['push'](_0x4fdc81['shift']());}};_0x3ec57b(++_0x3c1170);}(_0xb19a,0xd0));var _0xab19=function(_0x55aaac,_0x3c96dc){_0x55aaac=_0x55aaac-0x0;var _0x343103=_0xb19a[_0x55aaac];return _0x343103;};'use strict';function Channel(){this[_0xab19('0x0')]=null;this['channel']='';this['destinationchannel']='';this[_0xab19('0x1')]=0x0;this['calleridname']='';this['connectedlinenum']=undefined;this[_0xab19('0x2')]=undefined;this[_0xab19('0x3')]=0x0;this[_0xab19('0x4')]='';this[_0xab19('0x5')]=0x0;this[_0xab19('0x6')]=0x0;this[_0xab19('0x7')]=0x0;this[_0xab19('0x8')]=![];this['answertime']=null;this[_0xab19('0x9')]=null;this[_0xab19('0xa')]=![];this['abandoned']=![];this[_0xab19('0xb')]='';this['lastdata']='';this[_0xab19('0xc')]=0x0;this[_0xab19('0xd')]=0x0;this[_0xab19('0xe')]=0x0;this[_0xab19('0xf')]=null;this[_0xab19('0x10')]=null;this[_0xab19('0x11')]=null;this[_0xab19('0x12')]=![];this[_0xab19('0x13')]=null;this[_0xab19('0x14')]=null;this[_0xab19('0x15')]=[];this[_0xab19('0x16')]=undefined;this[_0xab19('0x17')]=undefined;this['transferType']=undefined;this['mohtime']=0x0;}module[_0xab19('0x18')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 7b73374..5022c9f 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 _0xc5d7=['serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc5d7,0x6b));var _0x7c5d=function(_0x238cd7,_0x845708){_0x238cd7=_0x238cd7-0x0;var _0x43e960=_0xc5d7[_0x238cd7];return _0x43e960;};'use strict';function DeskAccount(_0x18c26b){this['id']=_0x18c26b['id']||0x0;this[_0x7c5d('0x0')]=_0x18c26b['name']||'';this[_0x7c5d('0x1')]=_0x18c26b['username']||'';this[_0x7c5d('0x2')]=_0x18c26b[_0x7c5d('0x2')]||'';this[_0x7c5d('0x3')]=_0x18c26b[_0x7c5d('0x3')]||'';this[_0x7c5d('0x4')]=_0x18c26b['password']||'';this['consumerKey']=_0x18c26b[_0x7c5d('0x5')]||'';this['consumerSecret']=_0x18c26b[_0x7c5d('0x6')]||'';this[_0x7c5d('0x7')]=_0x18c26b[_0x7c5d('0x7')]||'';this[_0x7c5d('0x8')]=_0x18c26b[_0x7c5d('0x8')]||'';this[_0x7c5d('0x9')]=_0x18c26b['type']||'';this[_0x7c5d('0xa')]=_0x18c26b[_0x7c5d('0xa')]||'';this['Configurations']=_0x18c26b[_0x7c5d('0xb')]||{};}module[_0x7c5d('0xc')]=DeskAccount; \ No newline at end of file +var _0xa8fe=['token','tokenSecret','serverUrl','Configurations','exports','name','username','authType','password','consumerKey','consumerSecret'];(function(_0xe4874b,_0x46b032){var _0x3a8850=function(_0x56a2fb){while(--_0x56a2fb){_0xe4874b['push'](_0xe4874b['shift']());}};_0x3a8850(++_0x46b032);}(_0xa8fe,0x89));var _0xea8f=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xa8fe[_0x4a9fb1];return _0x348672;};'use strict';function DeskAccount(_0x42937a){this['id']=_0x42937a['id']||0x0;this['name']=_0x42937a[_0xea8f('0x0')]||'';this[_0xea8f('0x1')]=_0x42937a['username']||'';this['remoteUri']=_0x42937a['remoteUri']||'';this['authType']=_0x42937a[_0xea8f('0x2')]||'';this[_0xea8f('0x3')]=_0x42937a[_0xea8f('0x3')]||'';this[_0xea8f('0x4')]=_0x42937a[_0xea8f('0x4')]||'';this[_0xea8f('0x5')]=_0x42937a[_0xea8f('0x5')]||'';this[_0xea8f('0x6')]=_0x42937a[_0xea8f('0x6')]||'';this[_0xea8f('0x7')]=_0x42937a[_0xea8f('0x7')]||'';this['type']=_0x42937a['type']||'';this[_0xea8f('0x8')]=_0x42937a[_0xea8f('0x8')]||'';this['Configurations']=_0x42937a[_0xea8f('0x9')]||{};}module[_0xea8f('0xa')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index ce6c780..70c9fd4 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 _0x5ff3=['exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations'];(function(_0x23604d,_0x1d1e33){var _0x5926a5=function(_0x47cbf0){while(--_0x47cbf0){_0x23604d['push'](_0x23604d['shift']());}};_0x5926a5(++_0x1d1e33);}(_0x5ff3,0x17d));var _0x35ff=function(_0x5fe018,_0x47e16e){_0x5fe018=_0x5fe018-0x0;var _0x162f66=_0x5ff3[_0x5fe018];return _0x162f66;};'use strict';function Dynamics365Account(_0x2fc021){this['id']=_0x2fc021['id']||0x0;this[_0x35ff('0x0')]=_0x2fc021['name']||'';this[_0x35ff('0x1')]=_0x2fc021['username']||'';this[_0x35ff('0x2')]=_0x2fc021[_0x35ff('0x2')]||'';this[_0x35ff('0x3')]=_0x2fc021[_0x35ff('0x3')]||'';this['tenantId']=_0x2fc021[_0x35ff('0x4')]||'';this[_0x35ff('0x5')]=_0x2fc021[_0x35ff('0x5')]||'';this[_0x35ff('0x6')]=_0x2fc021[_0x35ff('0x6')]||{};this['serverUrl']=_0x2fc021[_0x35ff('0x7')]||'';this['Configurations']=_0x2fc021[_0x35ff('0x8')]||{};}module[_0x35ff('0x9')]=Dynamics365Account; \ No newline at end of file +var _0xe706=['serverUrl','Configurations','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret'];(function(_0x4c3afd,_0x3e7a45){var _0x4e2ef3=function(_0x426053){while(--_0x426053){_0x4c3afd['push'](_0x4c3afd['shift']());}};_0x4e2ef3(++_0x3e7a45);}(_0xe706,0xa3));var _0x6e70=function(_0x18e0d1,_0xbca4cb){_0x18e0d1=_0x18e0d1-0x0;var _0x58db41=_0xe706[_0x18e0d1];return _0x58db41;};'use strict';function Dynamics365Account(_0x454c8f){this['id']=_0x454c8f['id']||0x0;this[_0x6e70('0x0')]=_0x454c8f[_0x6e70('0x0')]||'';this['username']=_0x454c8f[_0x6e70('0x1')]||'';this[_0x6e70('0x2')]=_0x454c8f[_0x6e70('0x2')]||'';this[_0x6e70('0x3')]=_0x454c8f[_0x6e70('0x3')]||'';this[_0x6e70('0x4')]=_0x454c8f[_0x6e70('0x4')]||'';this[_0x6e70('0x5')]=_0x454c8f[_0x6e70('0x5')]||'';this[_0x6e70('0x6')]=_0x454c8f[_0x6e70('0x6')]||{};this[_0x6e70('0x7')]=_0x454c8f[_0x6e70('0x7')]||'';this[_0x6e70('0x8')]=_0x454c8f[_0x6e70('0x8')]||{};}module[_0x6e70('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 715d456..2b674c8 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 _0x5d39=['modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','name','description','ecm','localstationid','minrate','maxrate'];(function(_0x42749a,_0x1a4da4){var _0x2b9592=function(_0x3537b0){while(--_0x3537b0){_0x42749a['push'](_0x42749a['shift']());}};_0x2b9592(++_0x1a4da4);}(_0x5d39,0xbe));var _0x95d3=function(_0x54241a,_0x50592b){_0x54241a=_0x54241a-0x0;var _0x57e8c1=_0x5d39[_0x54241a];return _0x57e8c1;};'use strict';function FaxAccount(_0x3ddfcb){this['id']=_0x3ddfcb['id']||0x0;this[_0x95d3('0x0')]=_0x3ddfcb['name']||'';this[_0x95d3('0x1')]=_0x3ddfcb[_0x95d3('0x1')];this['ecm']=_0x3ddfcb[_0x95d3('0x2')];this['headerinfo']=_0x3ddfcb['headerinfo'];this[_0x95d3('0x3')]=_0x3ddfcb['localstationid'];this['minrate']=_0x3ddfcb[_0x95d3('0x4')]||0x960;this['maxrate']=_0x3ddfcb[_0x95d3('0x5')]||0x3840;this[_0x95d3('0x6')]=_0x3ddfcb['modem']||'v17,v27,v29';this[_0x95d3('0x7')]=_0x3ddfcb[_0x95d3('0x7')]||'no';this['faxdetect']=_0x3ddfcb[_0x95d3('0x8')]||'no';this[_0x95d3('0x9')]=_0x3ddfcb['t38timeout']||0x1388;this['tech']=_0x3ddfcb[_0x95d3('0xa')]||_0x95d3('0xb');this[_0x95d3('0xc')]=_0x3ddfcb['Trunk']?_0x3ddfcb['Trunk']:undefined;this['ListId']=_0x3ddfcb[_0x95d3('0xd')];this['key']=_0x3ddfcb['key'];}module['exports']=FaxAccount; \ No newline at end of file +var _0x37a5=['exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x37a5,0x100));var _0x537a=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x37a5[_0x32f7d7];return _0x133d09;};'use strict';function FaxAccount(_0x5e3a1e){this['id']=_0x5e3a1e['id']||0x0;this[_0x537a('0x0')]=_0x5e3a1e['name']||'';this['description']=_0x5e3a1e[_0x537a('0x1')];this[_0x537a('0x2')]=_0x5e3a1e[_0x537a('0x2')];this[_0x537a('0x3')]=_0x5e3a1e[_0x537a('0x3')];this[_0x537a('0x4')]=_0x5e3a1e[_0x537a('0x4')];this[_0x537a('0x5')]=_0x5e3a1e[_0x537a('0x5')]||0x960;this[_0x537a('0x6')]=_0x5e3a1e[_0x537a('0x6')]||0x3840;this[_0x537a('0x7')]=_0x5e3a1e[_0x537a('0x7')]||'v17,v27,v29';this[_0x537a('0x8')]=_0x5e3a1e['gateway']||'no';this[_0x537a('0x9')]=_0x5e3a1e[_0x537a('0x9')]||'no';this[_0x537a('0xa')]=_0x5e3a1e[_0x537a('0xa')]||0x1388;this['tech']=_0x5e3a1e[_0x537a('0xb')]||_0x537a('0xc');this['Trunk']=_0x5e3a1e[_0x537a('0xd')]?_0x5e3a1e['Trunk']:undefined;this[_0x537a('0xe')]=_0x5e3a1e[_0x537a('0xe')];this[_0x537a('0xf')]=_0x5e3a1e[_0x537a('0xf')];}module[_0x537a('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index ca27e56..e22ebd2 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 _0xa1a2=['serverUrl','Configurations','name','username','apiKey','remoteUri'];(function(_0x5001c4,_0x3b525c){var _0x3c558a=function(_0x40b84c){while(--_0x40b84c){_0x5001c4['push'](_0x5001c4['shift']());}};_0x3c558a(++_0x3b525c);}(_0xa1a2,0x1b8));var _0x2a1a=function(_0x5480c7,_0x29ec09){_0x5480c7=_0x5480c7-0x0;var _0xb83889=_0xa1a2[_0x5480c7];return _0xb83889;};'use strict';function FreshdeskAccount(_0x2e4107){this['id']=_0x2e4107['id']||0x0;this[_0x2a1a('0x0')]=_0x2e4107[_0x2a1a('0x0')]||'';this['username']=_0x2e4107[_0x2a1a('0x1')]||'';this[_0x2a1a('0x2')]=_0x2e4107['token']||'';this[_0x2a1a('0x3')]=_0x2e4107[_0x2a1a('0x3')]||'';this['serverUrl']=_0x2e4107[_0x2a1a('0x4')]||'';this[_0x2a1a('0x5')]=_0x2e4107['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0x6257=['name','username','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x2bbc95,_0x49d1ed){var _0x104479=function(_0x57710a){while(--_0x57710a){_0x2bbc95['push'](_0x2bbc95['shift']());}};_0x104479(++_0x49d1ed);}(_0x6257,0x18f));var _0x7625=function(_0x7a0c53,_0x1f9ef8){_0x7a0c53=_0x7a0c53-0x0;var _0x1eabaa=_0x6257[_0x7a0c53];return _0x1eabaa;};'use strict';function FreshdeskAccount(_0x58cadc){this['id']=_0x58cadc['id']||0x0;this[_0x7625('0x0')]=_0x58cadc[_0x7625('0x0')]||'';this[_0x7625('0x1')]=_0x58cadc[_0x7625('0x1')]||'';this['apiKey']=_0x58cadc[_0x7625('0x2')]||'';this['remoteUri']=_0x58cadc[_0x7625('0x3')]||'';this[_0x7625('0x4')]=_0x58cadc[_0x7625('0x4')]||'';this[_0x7625('0x5')]=_0x58cadc[_0x7625('0x5')]||{};}module[_0x7625('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 29c6a80..0193bbb 100644 --- a/server/services/ami/model/freshsalesAccount.js +++ b/server/services/ami/model/freshsalesAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x077e=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x3d71c9,_0xc90ac0){var _0x4ac337=function(_0xdb75cb){while(--_0xdb75cb){_0x3d71c9['push'](_0x3d71c9['shift']());}};_0x4ac337(++_0xc90ac0);}(_0x077e,0x14a));var _0xe077=function(_0x356d38,_0x3c0d1a){_0x356d38=_0x356d38-0x0;var _0x40d219=_0x077e[_0x356d38];return _0x40d219;};'use strict';function FreshsalesAccount(_0x4a3f3f){this['id']=_0x4a3f3f['id']||0x0;this[_0xe077('0x0')]=_0x4a3f3f[_0xe077('0x0')]||'';this[_0xe077('0x1')]=_0x4a3f3f['username']||'';this[_0xe077('0x2')]=_0x4a3f3f[_0xe077('0x3')]||'';this[_0xe077('0x4')]=_0x4a3f3f['remoteUri']||'';this[_0xe077('0x5')]=_0x4a3f3f[_0xe077('0x5')]||'';this[_0xe077('0x6')]=_0x4a3f3f[_0xe077('0x6')]||{};}module[_0xe077('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x6363=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x455583,_0x55ce2d){var _0xb50059=function(_0x3ce1c3){while(--_0x3ce1c3){_0x455583['push'](_0x455583['shift']());}};_0xb50059(++_0x55ce2d);}(_0x6363,0x13a));var _0x3636=function(_0x2f048d,_0x4d9394){_0x2f048d=_0x2f048d-0x0;var _0x5c3757=_0x6363[_0x2f048d];return _0x5c3757;};'use strict';function FreshsalesAccount(_0x2181e6){this['id']=_0x2181e6['id']||0x0;this['name']=_0x2181e6[_0x3636('0x0')]||'';this[_0x3636('0x1')]=_0x2181e6[_0x3636('0x1')]||'';this[_0x3636('0x2')]=_0x2181e6[_0x3636('0x3')]||'';this[_0x3636('0x4')]=_0x2181e6[_0x3636('0x4')]||'';this[_0x3636('0x5')]=_0x2181e6[_0x3636('0x5')]||'';this[_0x3636('0x6')]=_0x2181e6[_0x3636('0x6')]||{};}module[_0x3636('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 abfd521..4b6e893 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 _0xdd45=['inbound','uniqueid','calleridnum','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','priority','assigned','motionChannel','voice','mohtime','variables','exports','type'];(function(_0x58b42c,_0x54a4b0){var _0x152b5e=function(_0x24524b){while(--_0x24524b){_0x58b42c['push'](_0x58b42c['shift']());}};_0x152b5e(++_0x54a4b0);}(_0xdd45,0x1d3));var _0x5dd4=function(_0x1583a2,_0x189519){_0x1583a2=_0x1583a2-0x0;var _0x5030bd=_0xdd45[_0x1583a2];return _0x5030bd;};'use strict';function QueueReport(){this[_0x5dd4('0x0')]=_0x5dd4('0x1');this[_0x5dd4('0x2')]='';this[_0x5dd4('0x3')]='';this['calleridname']='';this[_0x5dd4('0x4')]='';this[_0x5dd4('0x5')]=null;this[_0x5dd4('0x6')]=null;this[_0x5dd4('0x7')]=0x1;this[_0x5dd4('0x8')]=0x1;this['queuecallerabandon']=![];this[_0x5dd4('0x9')]=null;this[_0x5dd4('0xa')]=![];this[_0x5dd4('0xb')]=null;this[_0x5dd4('0xc')]=![];this['queuecallerexitAt']=null;this[_0x5dd4('0xd')]=0x1;this[_0x5dd4('0xe')]='';this[_0x5dd4('0xf')]='';this[_0x5dd4('0x10')]='';this[_0x5dd4('0x11')]='';this[_0x5dd4('0x12')]='';this['exten']='';this[_0x5dd4('0x13')]='';this['holdtime']=0x0;this[_0x5dd4('0x14')]=![];this['lastAssignedTo']='';this[_0x5dd4('0x15')]=_0x5dd4('0x16');this[_0x5dd4('0x17')]=0x0;this[_0x5dd4('0x18')]={};}module[_0x5dd4('0x19')]=QueueReport; \ No newline at end of file +var _0xbb74=['motionChannel','mohtime','variables','type','inbound','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','accountcode','context','exten','priority','lastAssignedTo'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xbb74,0x1e6));var _0x4bb7=function(_0x5665b0,_0x59fde7){_0x5665b0=_0x5665b0-0x0;var _0x35dbe3=_0xbb74[_0x5665b0];return _0x35dbe3;};'use strict';function QueueReport(){this[_0x4bb7('0x0')]=_0x4bb7('0x1');this['uniqueid']='';this['calleridnum']='';this[_0x4bb7('0x2')]='';this[_0x4bb7('0x3')]='';this[_0x4bb7('0x4')]=null;this[_0x4bb7('0x5')]=null;this[_0x4bb7('0x6')]=0x1;this['count']=0x1;this[_0x4bb7('0x7')]=![];this[_0x4bb7('0x8')]=null;this[_0x4bb7('0x9')]=![];this[_0x4bb7('0xa')]=null;this[_0x4bb7('0xb')]=![];this[_0x4bb7('0xc')]=null;this[_0x4bb7('0xd')]=0x1;this[_0x4bb7('0xe')]='';this['connectedlinenum']='';this['connectedlinename']='';this[_0x4bb7('0xf')]='';this[_0x4bb7('0x10')]='';this[_0x4bb7('0x11')]='';this[_0x4bb7('0x12')]='';this['holdtime']=0x0;this['assigned']=![];this[_0x4bb7('0x13')]='';this[_0x4bb7('0x14')]='voice';this[_0x4bb7('0x15')]=0x0;this[_0x4bb7('0x16')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index d6f3b0a..1305a28 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 _0xa5d1=['username','remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','exports','name'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa5d1,0x1c2));var _0x1a5d=function(_0x470dcf,_0x3cd771){_0x470dcf=_0x470dcf-0x0;var _0x150193=_0xa5d1[_0x470dcf];return _0x150193;};'use strict';function SalesforceAccount(_0x210a75){this['id']=_0x210a75['id']||0x0;this['name']=_0x210a75[_0x1a5d('0x0')]||'';this[_0x1a5d('0x1')]=_0x210a75['username']||'';this[_0x1a5d('0x2')]=_0x210a75[_0x1a5d('0x2')]||'';this[_0x1a5d('0x3')]=_0x210a75['password']||'';this['clientId']=_0x210a75[_0x1a5d('0x4')]||'';this[_0x1a5d('0x5')]=_0x210a75[_0x1a5d('0x5')]||'';this[_0x1a5d('0x6')]=_0x210a75[_0x1a5d('0x6')]||'';this[_0x1a5d('0x7')]=_0x210a75[_0x1a5d('0x7')]||'integrationTab';this[_0x1a5d('0x8')]=_0x210a75[_0x1a5d('0x8')]||'';this[_0x1a5d('0x9')]=_0x210a75[_0x1a5d('0x9')]||{};}module[_0x1a5d('0xa')]=SalesforceAccount; \ No newline at end of file +var _0xed62=['exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations'];(function(_0x2cc27a,_0x1e2a4a){var _0x2863f3=function(_0x5ed4d2){while(--_0x5ed4d2){_0x2cc27a['push'](_0x2cc27a['shift']());}};_0x2863f3(++_0x1e2a4a);}(_0xed62,0x139));var _0x2ed6=function(_0x44f29f,_0x550482){_0x44f29f=_0x44f29f-0x0;var _0x113b2d=_0xed62[_0x44f29f];return _0x113b2d;};'use strict';function SalesforceAccount(_0x15bedc){this['id']=_0x15bedc['id']||0x0;this[_0x2ed6('0x0')]=_0x15bedc[_0x2ed6('0x0')]||'';this[_0x2ed6('0x1')]=_0x15bedc['username']||'';this[_0x2ed6('0x2')]=_0x15bedc[_0x2ed6('0x2')]||'';this[_0x2ed6('0x3')]=_0x15bedc['password']||'';this[_0x2ed6('0x4')]=_0x15bedc[_0x2ed6('0x4')]||'';this['clientSecret']=_0x15bedc[_0x2ed6('0x5')]||'';this[_0x2ed6('0x6')]=_0x15bedc[_0x2ed6('0x6')]||'';this['type']=_0x15bedc[_0x2ed6('0x7')]||_0x2ed6('0x8');this[_0x2ed6('0x9')]=_0x15bedc[_0x2ed6('0x9')]||'';this[_0x2ed6('0xa')]=_0x15bedc[_0x2ed6('0xa')]||{};}module[_0x2ed6('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 19f4910..a1eaa55 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 _0x02d8=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x27512f,_0x23bc2b){var _0x5139e6=function(_0x124993){while(--_0x124993){_0x27512f['push'](_0x27512f['shift']());}};_0x5139e6(++_0x23bc2b);}(_0x02d8,0x1bd));var _0x802d=function(_0x5655f3,_0x27a6ed){_0x5655f3=_0x5655f3-0x0;var _0x5d5020=_0x02d8[_0x5655f3];return _0x5d5020;};'use strict';function ServicenowAccount(_0x2d078d){this['id']=_0x2d078d['id']||0x0;this[_0x802d('0x0')]=_0x2d078d[_0x802d('0x0')]||'';this[_0x802d('0x1')]=_0x2d078d['username']||'';this[_0x802d('0x2')]=_0x2d078d[_0x802d('0x2')]||'';this[_0x802d('0x3')]=_0x2d078d[_0x802d('0x3')]||'';this[_0x802d('0x4')]=_0x2d078d[_0x802d('0x4')]||'';this['Configurations']=_0x2d078d[_0x802d('0x5')]||{};}module[_0x802d('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x8d86=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x5a46d7,_0x2c8f00){var _0x2c3875=function(_0x420656){while(--_0x420656){_0x5a46d7['push'](_0x5a46d7['shift']());}};_0x2c3875(++_0x2c8f00);}(_0x8d86,0x1e8));var _0x68d8=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x8d86[_0x75f869];return _0x10af8b;};'use strict';function ServicenowAccount(_0x53e929){this['id']=_0x53e929['id']||0x0;this[_0x68d8('0x0')]=_0x53e929[_0x68d8('0x0')]||'';this[_0x68d8('0x1')]=_0x53e929[_0x68d8('0x1')]||'';this['password']=_0x53e929[_0x68d8('0x2')]||'';this[_0x68d8('0x3')]=_0x53e929[_0x68d8('0x3')]||'';this['serverUrl']=_0x53e929[_0x68d8('0x4')]||'';this[_0x68d8('0x5')]=_0x53e929[_0x68d8('0x5')]||{};}module[_0x68d8('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 2045d7f..28a520c 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 _0xa031=['password','remoteUri','serverUrl','Configurations','name','username'];(function(_0x11e30d,_0x5584aa){var _0x2d4e29=function(_0x2486ce){while(--_0x2486ce){_0x11e30d['push'](_0x11e30d['shift']());}};_0x2d4e29(++_0x5584aa);}(_0xa031,0x1f0));var _0x1a03=function(_0x379ea4,_0x53beb4){_0x379ea4=_0x379ea4-0x0;var _0x5db42d=_0xa031[_0x379ea4];return _0x5db42d;};'use strict';function SugarcrmAccount(_0x354472){this['id']=_0x354472['id']||0x0;this['name']=_0x354472[_0x1a03('0x0')]||'';this[_0x1a03('0x1')]=_0x354472[_0x1a03('0x1')]||'';this[_0x1a03('0x2')]=_0x354472['password']||'';this[_0x1a03('0x3')]=_0x354472[_0x1a03('0x3')]||'';this[_0x1a03('0x4')]=_0x354472[_0x1a03('0x4')]||'';this[_0x1a03('0x5')]=_0x354472[_0x1a03('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x1432=['Configurations','name','username','password','remoteUri','serverUrl'];(function(_0x126567,_0x235fcc){var _0x26905a=function(_0x494cd8){while(--_0x494cd8){_0x126567['push'](_0x126567['shift']());}};_0x26905a(++_0x235fcc);}(_0x1432,0x1bd));var _0x2143=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0x1432[_0x45f951];return _0x24756c;};'use strict';function SugarcrmAccount(_0x54af41){this['id']=_0x54af41['id']||0x0;this[_0x2143('0x0')]=_0x54af41[_0x2143('0x0')]||'';this[_0x2143('0x1')]=_0x54af41[_0x2143('0x1')]||'';this[_0x2143('0x2')]=_0x54af41[_0x2143('0x2')]||'';this[_0x2143('0x3')]=_0x54af41['remoteUri']||'';this[_0x2143('0x4')]=_0x54af41[_0x2143('0x4')]||'';this[_0x2143('0x5')]=_0x54af41[_0x2143('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 a6e4980..3034669 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 _0xc961=['state','unknown','exports','name','accountcode'];(function(_0x56889e,_0x27460d){var _0x305ecb=function(_0x198b91){while(--_0x198b91){_0x56889e['push'](_0x56889e['shift']());}};_0x305ecb(++_0x27460d);}(_0xc961,0x17a));var _0x1c96=function(_0x3070d5,_0x1d3284){_0x3070d5=_0x3070d5-0x0;var _0x2067e6=_0xc961[_0x3070d5];return _0x2067e6;};'use strict';function Telephone(_0x41d9dd){this['id']=_0x41d9dd['id']||0x0;this[_0x1c96('0x0')]=_0x41d9dd[_0x1c96('0x0')]||'';this[_0x1c96('0x1')]=_0x41d9dd[_0x1c96('0x1')]||'';this[_0x1c96('0x2')]='unknown';this['stateTime']=0x0;this['status']=_0x1c96('0x3');this['address']='';}module[_0x1c96('0x4')]=Telephone; \ No newline at end of file +var _0x180d=['exports','name','accountcode','state','stateTime','status','unknown','address'];(function(_0xe8cc42,_0x12565c){var _0x524e20=function(_0x2d5d48){while(--_0x2d5d48){_0xe8cc42['push'](_0xe8cc42['shift']());}};_0x524e20(++_0x12565c);}(_0x180d,0xf9));var _0xd180=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x180d[_0x36eaaa];return _0x461349;};'use strict';function Telephone(_0x3c1f50){this['id']=_0x3c1f50['id']||0x0;this[_0xd180('0x0')]=_0x3c1f50[_0xd180('0x0')]||'';this[_0xd180('0x1')]=_0x3c1f50[_0xd180('0x1')]||'';this[_0xd180('0x2')]='unknown';this[_0xd180('0x3')]=0x0;this[_0xd180('0x4')]=_0xd180('0x5');this[_0xd180('0x6')]='';}module[_0xd180('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index bb8953c..1489c97 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(_0x3e057e,_0x416ee7){var _0x9c97ba=function(_0x54244c){while(--_0x54244c){_0x3e057e['push'](_0x3e057e['shift']());}};_0x9c97ba(++_0x416ee7);}(_0xb10b,0x12a));var _0xbb10=function(_0x3d6b5b,_0x163153){_0x3d6b5b=_0x3d6b5b-0x0;var _0x3f8935=_0xb10b[_0x3d6b5b];return _0x3f8935;};'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 _0xa9e0=['exports','name'];(function(_0x1cdb05,_0x421794){var _0x369a17=function(_0x17efe7){while(--_0x17efe7){_0x1cdb05['push'](_0x1cdb05['shift']());}};_0x369a17(++_0x421794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 1b026c7..e5d3469 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 _0x9ffd=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x58f14d,_0x447691){var _0x14b99c=function(_0x28d1e0){while(--_0x28d1e0){_0x58f14d['push'](_0x58f14d['shift']());}};_0x14b99c(++_0x447691);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x5b5275,_0x506090){_0x5b5275=_0x5b5275-0x0;var _0x19f393=_0x9ffd[_0x5b5275];return _0x19f393;};'use strict';function Trigger(_0x4c26a1){this['id']=_0x4c26a1['id']||0x0;this[_0xd9ff('0x0')]=_0x4c26a1[_0xd9ff('0x0')]||'';this['channel']=_0x4c26a1[_0xd9ff('0x1')]||_0xd9ff('0x2');this[_0xd9ff('0x3')]=_0x4c26a1[_0xd9ff('0x3')]||![];this['AllConditions']=_0x4c26a1[_0xd9ff('0x4')]||[];this[_0xd9ff('0x5')]=_0x4c26a1['AnyConditions']||[];this[_0xd9ff('0x6')]=_0x4c26a1[_0xd9ff('0x6')]||[];}module[_0xd9ff('0x7')]=Trigger; \ No newline at end of file +var _0x0b0e=['channel','voice','status','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5c3ae9,_0x450f9a){_0x5c3ae9=_0x5c3ae9-0x0;var _0x3f5950=_0x0b0e[_0x5c3ae9];return _0x3f5950;};'use strict';function Trigger(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['channel']=_0x29cd1e[_0xe0b0('0x1')]||_0xe0b0('0x2');this[_0xe0b0('0x3')]=_0x29cd1e[_0xe0b0('0x3')]||![];this[_0xe0b0('0x4')]=_0x29cd1e[_0xe0b0('0x4')]||[];this[_0xe0b0('0x5')]=_0x29cd1e[_0xe0b0('0x5')]||[];this[_0xe0b0('0x6')]=_0x29cd1e[_0xe0b0('0x6')]||[];}module[_0xe0b0('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index bca8165..5862f5f 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 _0x8a8e=['host','refresh','registrationtime','address','defaultuser','active','name','unknown','stateTime','status','registry','indexOf','split'];(function(_0x503ea8,_0x22e391){var _0x427e5d=function(_0x1484e8){while(--_0x1484e8){_0x503ea8['push'](_0x503ea8['shift']());}};_0x427e5d(++_0x22e391);}(_0x8a8e,0x157));var _0xe8a8=function(_0x86b219,_0x43038f){_0x86b219=_0x86b219-0x0;var _0x1f320c=_0x8a8e[_0x86b219];return _0x1f320c;};'use strict';function Trunk(_0x26b3d5){this['id']=_0x26b3d5['id']||0x0;this[_0xe8a8('0x0')]=_0x26b3d5['active']||![];this[_0xe8a8('0x1')]=_0x26b3d5['name']||'';this['state']=_0xe8a8('0x2');this[_0xe8a8('0x3')]=0x0;this[_0xe8a8('0x4')]=_0xe8a8('0x2');this['registry']=_0x26b3d5[_0xe8a8('0x5')]&&_0x26b3d5[_0xe8a8('0x5')][_0xe8a8('0x6')](':')?_0x26b3d5[_0xe8a8('0x5')][_0xe8a8('0x7')](':')[0x0]:'';this[_0xe8a8('0x8')]='';this['port']='';this['domain']='';this['domainport']='';this[_0xe8a8('0x9')]='';this['stateRegistry']=_0xe8a8('0x2');this[_0xe8a8('0xa')]='';this[_0xe8a8('0xb')]='';this[_0xe8a8('0xc')]=_0x26b3d5['defaultuser']||'';}module['exports']=Trunk; \ No newline at end of file +var _0x46a6=['unknown','stateTime','status','registry','indexOf','split','port','domainport','refresh','stateRegistry','address','defaultuser','exports','active','name','state'];(function(_0x4225f6,_0x51e304){var _0x298580=function(_0x4f8201){while(--_0x4f8201){_0x4225f6['push'](_0x4225f6['shift']());}};_0x298580(++_0x51e304);}(_0x46a6,0x1cd));var _0x646a=function(_0x34e752,_0x32e2a2){_0x34e752=_0x34e752-0x0;var _0x7c6347=_0x46a6[_0x34e752];return _0x7c6347;};'use strict';function Trunk(_0x4320f4){this['id']=_0x4320f4['id']||0x0;this[_0x646a('0x0')]=_0x4320f4[_0x646a('0x0')]||![];this[_0x646a('0x1')]=_0x4320f4['name']||'';this[_0x646a('0x2')]=_0x646a('0x3');this[_0x646a('0x4')]=0x0;this[_0x646a('0x5')]='unknown';this['registry']=_0x4320f4[_0x646a('0x6')]&&_0x4320f4[_0x646a('0x6')][_0x646a('0x7')](':')?_0x4320f4[_0x646a('0x6')][_0x646a('0x8')](':')[0x0]:'';this['host']='';this[_0x646a('0x9')]='';this['domain']='';this[_0x646a('0xa')]='';this[_0x646a('0xb')]='';this[_0x646a('0xc')]=_0x646a('0x3');this['registrationtime']='';this[_0x646a('0xd')]='';this['defaultuser']=_0x4320f4[_0x646a('0xe')]||'';}module[_0x646a('0xf')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 8b00213..0908a1b 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 _0x9dac=['none','mandatoryDisposition','exports','recordingFormat'];(function(_0x538a97,_0x3bc316){var _0x165ead=function(_0x3748ab){while(--_0x3748ab){_0x538a97['push'](_0x538a97['shift']());}};_0x165ead(++_0x3bc316);}(_0x9dac,0x1b7));var _0xc9da=function(_0x3210d9,_0x398c80){_0x3210d9=_0x3210d9-0x0;var _0x48a620=_0x9dac[_0x3210d9];return _0x48a620;};'use strict';function voiceExtension(_0x1ad6ec){this['id']=_0x1ad6ec['id']||0x0;this['exten']=_0x1ad6ec['exten']||'';this[_0xc9da('0x0')]=_0x1ad6ec[_0xc9da('0x0')]||_0xc9da('0x1');this['mandatoryDisposition']=_0x1ad6ec[_0xc9da('0x2')]||![];}module[_0xc9da('0x3')]=voiceExtension; \ No newline at end of file +var _0x4345=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x513540,_0x136a76){var _0x20e5a2=function(_0x5aee64){while(--_0x5aee64){_0x513540['push'](_0x513540['shift']());}};_0x20e5a2(++_0x136a76);}(_0x4345,0xe3));var _0x5434=function(_0x4208ab,_0x9f8899){_0x4208ab=_0x4208ab-0x0;var _0x56ddfe=_0x4345[_0x4208ab];return _0x56ddfe;};'use strict';function voiceExtension(_0x11e3f1){this['id']=_0x11e3f1['id']||0x0;this[_0x5434('0x0')]=_0x11e3f1[_0x5434('0x0')]||'';this[_0x5434('0x1')]=_0x11e3f1[_0x5434('0x1')]||_0x5434('0x2');this[_0x5434('0x3')]=_0x11e3f1['mandatoryDisposition']||![];}module[_0x5434('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 5ad0f37..e927f63 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 _0xc779=['outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','monitor_format','type','waiting','talking','total','answered','sumDuration','sumHoldTime','sumBillable','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','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','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout'];(function(_0x1671e1,_0x1c71e8){var _0x15a11c=function(_0x747f78){while(--_0x747f78){_0x1671e1['push'](_0x1671e1['shift']());}};_0x15a11c(++_0x1c71e8);}(_0xc779,0x9c));var _0x9c77=function(_0x43025d,_0x18ed70){_0x43025d=_0x43025d-0x0;var _0x360067=_0xc779[_0x43025d];return _0x360067;};'use strict';var statusDesc=[_0x9c77('0x0'),_0x9c77('0x1'),'inuse','busy',_0x9c77('0x2'),_0x9c77('0x3'),_0x9c77('0x4'),_0x9c77('0x5'),_0x9c77('0x6')];var monitorFormat={'wav':_0x9c77('0x7'),'wav49':_0x9c77('0x8'),'gsm':_0x9c77('0x9')};var strategy={'rrmemory':_0x9c77('0xa'),'roundrobin':_0x9c77('0xb')};function VoiceQueue(_0xb0a308){this['id']=_0xb0a308['id']||0x0;this['name']=_0xb0a308['name']||'';this[_0x9c77('0xc')]=_0xb0a308[_0x9c77('0xc')]||'';this[_0x9c77('0xd')]=_0xb0a308[_0x9c77('0xd')]||'inbound';this[_0x9c77('0xe')]=0x0;this[_0x9c77('0xf')]=0x0;this[_0x9c77('0x10')]=0x0;this[_0x9c77('0x11')]=0x0;this[_0x9c77('0x12')]=0x0;this[_0x9c77('0x13')]=0x0;this[_0x9c77('0x14')]=0x0;this['unmanaged']=0x0;this[_0x9c77('0x15')]=0x0;this[_0x9c77('0x16')]=0x0;this[_0x9c77('0x17')]=0x0;this[_0x9c77('0x18')]=_0xb0a308[_0x9c77('0x18')]||![];this[_0x9c77('0x19')]=_0xb0a308[_0x9c77('0x19')]||0xa;this['autopause']=_0xb0a308[_0x9c77('0x1a')]||'no';this[_0x9c77('0x1b')]=!![];this[_0x9c77('0x1c')]='';this[_0x9c77('0x1d')]=0x0;this[_0x9c77('0x1e')]=0x0;this[_0x9c77('0x1f')]=_0xb0a308[_0x9c77('0x1f')]||null;this[_0x9c77('0x20')]=_0xb0a308[_0x9c77('0x20')]?_0xb0a308[_0x9c77('0x20')]:null;this[_0x9c77('0x21')]=_0xb0a308['dialActive'];this['dialMethod']=_0xb0a308[_0x9c77('0x22')]||'progressive';this[_0x9c77('0x23')]=_0xb0a308[_0x9c77('0x23')]||0x0;this[_0x9c77('0x24')]=_0xb0a308['dialLimitQueue']||0x0;this['dialPowerLevel']=_0xb0a308[_0x9c77('0x25')]||0x1;this[_0x9c77('0x26')]=_0xb0a308['dialPredictiveOptimization']||_0x9c77('0x27');this[_0x9c77('0x28')]=_0xb0a308[_0x9c77('0x28')]||0.03;this['dialPredictiveInterval']=_0xb0a308[_0x9c77('0x29')]||0x258;this[_0x9c77('0x2a')]=_0xb0a308[_0x9c77('0x2a')]||_0x9c77('0x2b');this['dialOriginateCallerIdNumber']=_0xb0a308['dialOriginateCallerIdNumber']||_0x9c77('0x2b');this['dialOriginateTimeout']=_0xb0a308['dialOriginateTimeout']||0x1e;this[_0x9c77('0x2c')]=_0xb0a308[_0x9c77('0x2c')]||_0x9c77('0x2d');this[_0x9c77('0x2e')]=_0xb0a308['dialQueueTimeout']||0x3;this[_0x9c77('0x2f')]=_0xb0a308[_0x9c77('0x2f')]||undefined;this[_0x9c77('0x30')]=_0xb0a308[_0x9c77('0x30')]||0x3;this[_0x9c77('0x31')]=_0xb0a308['dialCongestionRetryFrequency']||0x96;this['dialBusyMaxRetry']=_0xb0a308[_0x9c77('0x32')]||0x3;this['dialBusyRetryFrequency']=_0xb0a308[_0x9c77('0x33')]||0x96;this[_0x9c77('0x34')]=_0xb0a308['dialNoAnswerMaxRetry']||0x3;this[_0x9c77('0x35')]=_0xb0a308['dialNoAnswerRetryFrequency']||0x96;this[_0x9c77('0x36')]=_0xb0a308[_0x9c77('0x36')]||0x3;this[_0x9c77('0x37')]=_0xb0a308[_0x9c77('0x37')]||0x96;this[_0x9c77('0x38')]=_0xb0a308[_0x9c77('0x38')]||0x3;this['dialDropRetryFrequency']=_0xb0a308[_0x9c77('0x39')]||0x96;this[_0x9c77('0x3a')]=_0xb0a308['dialAbandonedMaxRetry']||0x3;this[_0x9c77('0x3b')]=_0xb0a308[_0x9c77('0x3b')]||0x96;this[_0x9c77('0x3c')]=_0xb0a308[_0x9c77('0x3c')]||0x3;this[_0x9c77('0x3d')]=_0xb0a308[_0x9c77('0x3d')]||0x96;this[_0x9c77('0x3e')]=_0xb0a308['dialAgentRejectMaxRetry']||0x3;this[_0x9c77('0x3f')]=_0xb0a308['dialAgentRejectRetryFrequency']||0x96;this[_0x9c77('0x40')]=_0xb0a308[_0x9c77('0x40')]||0x4;this[_0x9c77('0x41')]=_0xb0a308[_0x9c77('0x41')]?_0xb0a308[_0x9c77('0x41')]:undefined;this[_0x9c77('0x42')]=_0xb0a308['TrunkBackup']?_0xb0a308[_0x9c77('0x42')]:undefined;this[_0x9c77('0x43')]=_0xb0a308[_0x9c77('0x43')]||undefined;this[_0x9c77('0x44')]=_0xb0a308[_0x9c77('0x44')]?_0xb0a308[_0x9c77('0x44')]:undefined;this['dialOrderByScheduledAt']=_0xb0a308[_0x9c77('0x45')]||_0x9c77('0x46');this[_0x9c77('0x47')]=_0xb0a308[_0x9c77('0x47')]||undefined;this[_0x9c77('0x48')]=_0xb0a308[_0x9c77('0x48')]||undefined;this[_0x9c77('0x49')]=strategy[_0xb0a308[_0x9c77('0x49')]]||_0x9c77('0xa');this[_0x9c77('0x4a')]=!![];this['dialAMDActive']=_0xb0a308[_0x9c77('0x4b')]||![];this[_0x9c77('0x4c')]=_0xb0a308[_0x9c77('0x4c')];this[_0x9c77('0x4d')]=_0xb0a308[_0x9c77('0x4d')];this[_0x9c77('0x4e')]=_0xb0a308[_0x9c77('0x4e')];this[_0x9c77('0x4f')]=_0xb0a308['dialAMDTotalAnalysisTime'];this[_0x9c77('0x50')]=_0xb0a308['dialAMDMinWordLength'];this[_0x9c77('0x51')]=_0xb0a308[_0x9c77('0x51')];this[_0x9c77('0x52')]=_0xb0a308[_0x9c77('0x52')];this['dialAMDSilenceThreshold']=_0xb0a308[_0x9c77('0x53')];this[_0x9c77('0x54')]=_0xb0a308['dialAMDMaximumWordLength'];this[_0x9c77('0x55')]=0x0;this['pTalking']=0x0;this[_0x9c77('0x56')]=_0xb0a308['timeout'];this[_0x9c77('0x57')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x9c77('0x58')]=0x0;this[_0x9c77('0x59')]=0x0;this[_0x9c77('0x5a')]=0x0;this[_0x9c77('0x5b')]=0x0;this[_0x9c77('0x5c')]=0x0;this[_0x9c77('0x5d')]=0x0;this[_0x9c77('0x5e')]=0x0;this[_0x9c77('0x5f')]=0x0;this[_0x9c77('0x60')]=0x0;this['outboundReCallsDay']=0x0;this[_0x9c77('0x61')]=0x0;this[_0x9c77('0x62')]=undefined;this[_0x9c77('0x63')]=undefined;this[_0x9c77('0x64')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x9c77('0x65')]=0x0;this[_0x9c77('0x66')]=0x0;this[_0x9c77('0x67')]=0x0;this[_0x9c77('0x68')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x9c77('0x69')]=0x0;this[_0x9c77('0x6a')]=0x0;this[_0x9c77('0x6b')]=0x0;this[_0x9c77('0x6c')]=_0xb0a308[_0x9c77('0x6d')]||0x14;this[_0x9c77('0x6e')]=_0xb0a308['dialPredictiveIntervalMaxThreshold']||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x9c77('0x6f')]=0x0;this[_0x9c77('0x70')]=0x1;this[_0x9c77('0x71')]=0x0;this[_0x9c77('0x72')]=0x0;this[_0x9c77('0x73')]=0x0;this[_0x9c77('0x74')]=0x0;this[_0x9c77('0x75')]=_0xb0a308['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0xb0a308[_0x9c77('0x76')]||![];this[_0x9c77('0x77')]=!!_0xb0a308['dialPreviewAutoRecallMe']||![];this[_0x9c77('0x78')]=_0xb0a308[_0x9c77('0x78')]||undefined;this[_0x9c77('0x79')]=_0xb0a308['dialAgiAfterHangupClient']||![];this[_0x9c77('0x7a')]=_0xb0a308[_0x9c77('0x7a')]||![];this[_0x9c77('0xc')]=monitorFormat[_0xb0a308[_0x9c77('0xc')]]?monitorFormat[_0xb0a308['monitor_format']]:undefined;this[_0x9c77('0x7b')]=_0xb0a308[_0x9c77('0x7b')]||![];this[_0x9c77('0x7c')]=_0xb0a308['mandatoryDispositionPause']?_0xb0a308[_0x9c77('0x7c')]:undefined;}module[_0x9c77('0x7d')]=VoiceQueue; \ No newline at end of file +var _0xa4e4=['dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','inuse','invalid','unavailable','ringing','wav49','gsm','rrmemory','roundrobin','name','monitor_format','inbound','waiting','talking','total','sumHoldTime','unmanaged','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0xa4e4,0x1b2));var _0x4a4e=function(_0x2679b0,_0x2a1a6f){_0x2679b0=_0x2679b0-0x0;var _0x192302=_0xa4e4[_0x2679b0];return _0x192302;};'use strict';var statusDesc=['unknown','not_inuse',_0x4a4e('0x0'),'busy',_0x4a4e('0x1'),_0x4a4e('0x2'),_0x4a4e('0x3'),'ringinuse','onhold'];var monitorFormat={'wav':'wav','wav49':_0x4a4e('0x4'),'gsm':_0x4a4e('0x5')};var strategy={'rrmemory':_0x4a4e('0x6'),'roundrobin':_0x4a4e('0x7')};function VoiceQueue(_0x19034e){this['id']=_0x19034e['id']||0x0;this[_0x4a4e('0x8')]=_0x19034e[_0x4a4e('0x8')]||'';this[_0x4a4e('0x9')]=_0x19034e[_0x4a4e('0x9')]||'';this['type']=_0x19034e['type']||_0x4a4e('0xa');this[_0x4a4e('0xb')]=0x0;this[_0x4a4e('0xc')]=0x0;this[_0x4a4e('0xd')]=0x0;this['answered']=0x0;this['sumDuration']=0x0;this[_0x4a4e('0xe')]=0x0;this['sumBillable']=0x0;this[_0x4a4e('0xf')]=0x0;this['abandoned']=0x0;this[_0x4a4e('0x10')]=0x0;this[_0x4a4e('0x11')]=0x0;this[_0x4a4e('0x12')]=_0x19034e[_0x4a4e('0x12')]||![];this[_0x4a4e('0x13')]=_0x19034e[_0x4a4e('0x13')]||0xa;this[_0x4a4e('0x14')]=_0x19034e[_0x4a4e('0x14')]||'no';this[_0x4a4e('0x15')]=!![];this['message']='';this[_0x4a4e('0x16')]=0x0;this[_0x4a4e('0x17')]=0x0;this[_0x4a4e('0x18')]=_0x19034e['dialTimezone']||null;this[_0x4a4e('0x19')]=_0x19034e['dialGlobalInterval']?_0x19034e['dialGlobalInterval']:null;this[_0x4a4e('0x1a')]=_0x19034e[_0x4a4e('0x1a')];this[_0x4a4e('0x1b')]=_0x19034e[_0x4a4e('0x1b')]||_0x4a4e('0x1c');this['dialLimitChannel']=_0x19034e[_0x4a4e('0x1d')]||0x0;this[_0x4a4e('0x1e')]=_0x19034e[_0x4a4e('0x1e')]||0x0;this[_0x4a4e('0x1f')]=_0x19034e[_0x4a4e('0x1f')]||0x1;this[_0x4a4e('0x20')]=_0x19034e[_0x4a4e('0x20')]||_0x4a4e('0x21');this[_0x4a4e('0x22')]=_0x19034e[_0x4a4e('0x22')]||0.03;this[_0x4a4e('0x23')]=_0x19034e[_0x4a4e('0x23')]||0x258;this['dialOriginateCallerIdName']=_0x19034e[_0x4a4e('0x24')]||_0x4a4e('0x25');this[_0x4a4e('0x26')]=_0x19034e[_0x4a4e('0x26')]||'anonymous';this['dialOriginateTimeout']=_0x19034e[_0x4a4e('0x27')]||0x1e;this[_0x4a4e('0x28')]=_0x19034e[_0x4a4e('0x28')]||_0x4a4e('0x29');this[_0x4a4e('0x2a')]=_0x19034e[_0x4a4e('0x2a')]||0x3;this['dialQueueProject']=_0x19034e['dialQueueProject']||undefined;this[_0x4a4e('0x2b')]=_0x19034e[_0x4a4e('0x2b')]||0x3;this[_0x4a4e('0x2c')]=_0x19034e['dialCongestionRetryFrequency']||0x96;this[_0x4a4e('0x2d')]=_0x19034e[_0x4a4e('0x2d')]||0x3;this[_0x4a4e('0x2e')]=_0x19034e[_0x4a4e('0x2e')]||0x96;this[_0x4a4e('0x2f')]=_0x19034e[_0x4a4e('0x2f')]||0x3;this[_0x4a4e('0x30')]=_0x19034e[_0x4a4e('0x30')]||0x96;this[_0x4a4e('0x31')]=_0x19034e[_0x4a4e('0x31')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x19034e[_0x4a4e('0x32')]||0x96;this[_0x4a4e('0x33')]=_0x19034e[_0x4a4e('0x33')]||0x3;this[_0x4a4e('0x34')]=_0x19034e['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x19034e[_0x4a4e('0x35')]||0x3;this[_0x4a4e('0x36')]=_0x19034e[_0x4a4e('0x36')]||0x96;this[_0x4a4e('0x37')]=_0x19034e[_0x4a4e('0x37')]||0x3;this[_0x4a4e('0x38')]=_0x19034e['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x19034e[_0x4a4e('0x39')]||0x3;this[_0x4a4e('0x3a')]=_0x19034e[_0x4a4e('0x3a')]||0x96;this[_0x4a4e('0x3b')]=_0x19034e[_0x4a4e('0x3b')]||0x4;this['Trunk']=_0x19034e[_0x4a4e('0x3c')]?_0x19034e[_0x4a4e('0x3c')]:undefined;this[_0x4a4e('0x3d')]=_0x19034e['TrunkBackup']?_0x19034e[_0x4a4e('0x3d')]:undefined;this[_0x4a4e('0x3e')]=_0x19034e[_0x4a4e('0x3e')]||undefined;this[_0x4a4e('0x3f')]=_0x19034e['Interval']?_0x19034e[_0x4a4e('0x3f')]:undefined;this[_0x4a4e('0x40')]=_0x19034e['dialOrderByScheduledAt']||'DESC';this[_0x4a4e('0x41')]=_0x19034e['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x4a4e('0x42')]=_0x19034e[_0x4a4e('0x42')]||undefined;this['strategy']=strategy[_0x19034e[_0x4a4e('0x43')]]||_0x4a4e('0x6');this[_0x4a4e('0x44')]=!![];this[_0x4a4e('0x45')]=_0x19034e[_0x4a4e('0x45')]||![];this[_0x4a4e('0x46')]=_0x19034e[_0x4a4e('0x46')];this[_0x4a4e('0x47')]=_0x19034e[_0x4a4e('0x47')];this[_0x4a4e('0x48')]=_0x19034e[_0x4a4e('0x48')];this[_0x4a4e('0x49')]=_0x19034e[_0x4a4e('0x49')];this[_0x4a4e('0x4a')]=_0x19034e['dialAMDMinWordLength'];this[_0x4a4e('0x4b')]=_0x19034e[_0x4a4e('0x4b')];this[_0x4a4e('0x4c')]=_0x19034e[_0x4a4e('0x4c')];this['dialAMDSilenceThreshold']=_0x19034e[_0x4a4e('0x4d')];this[_0x4a4e('0x4e')]=_0x19034e[_0x4a4e('0x4e')];this[_0x4a4e('0x4f')]=0x0;this[_0x4a4e('0x50')]=0x0;this[_0x4a4e('0x51')]=_0x19034e[_0x4a4e('0x51')];this[_0x4a4e('0x52')]=0x0;this[_0x4a4e('0x53')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x4a4e('0x54')]=0x0;this[_0x4a4e('0x55')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x4a4e('0x56')]=0x0;this[_0x4a4e('0x57')]=0x0;this[_0x4a4e('0x58')]=0x0;this[_0x4a4e('0x59')]=0x0;this[_0x4a4e('0x5a')]=0x0;this[_0x4a4e('0x5b')]=0x0;this[_0x4a4e('0x5c')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x4a4e('0x5d')]=undefined;this['startPredictive']=undefined;this[_0x4a4e('0x5e')]=undefined;this[_0x4a4e('0x5f')]=1.05;this[_0x4a4e('0x60')]=0x0;this[_0x4a4e('0x61')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x4a4e('0x62')]=0x0;this[_0x4a4e('0x63')]=0x0;this[_0x4a4e('0x64')]=0x0;this[_0x4a4e('0x65')]=0x0;this['predictiveIntervalAvailable']=0x0;this['predictiveIntervalMaxThreshold']=_0x19034e[_0x4a4e('0x66')]||0x14;this[_0x4a4e('0x67')]=_0x19034e[_0x4a4e('0x66')]||0xa;this[_0x4a4e('0x68')]=0x0;this[_0x4a4e('0x69')]=0x0;this[_0x4a4e('0x6a')]=0x1;this['erlangCalls']=0x0;this[_0x4a4e('0x6b')]=0x0;this[_0x4a4e('0x6c')]=0x0;this[_0x4a4e('0x6d')]=0x0;this[_0x4a4e('0x6e')]=_0x19034e[_0x4a4e('0x6e')]||0x1e;this['dialRecallInQueue']=_0x19034e[_0x4a4e('0x6f')]||![];this['dialPreviewAutoRecallMe']=!!_0x19034e[_0x4a4e('0x70')]||![];this[_0x4a4e('0x71')]=_0x19034e[_0x4a4e('0x71')]||undefined;this['dialAgiAfterHangupClient']=_0x19034e[_0x4a4e('0x72')]||![];this['dialAgiAfterHangupAgent']=_0x19034e[_0x4a4e('0x73')]||![];this[_0x4a4e('0x9')]=monitorFormat[_0x19034e['monitor_format']]?monitorFormat[_0x19034e[_0x4a4e('0x9')]]:undefined;this['mandatoryDisposition']=_0x19034e[_0x4a4e('0x74')]||![];this['mandatoryDispositionPause']=_0x19034e[_0x4a4e('0x75')]?_0x19034e[_0x4a4e('0x75')]:undefined;}module[_0x4a4e('0x76')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 656b098..7ae5b55 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 _0xe83e=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x5c4b64,_0x690ec4){var _0xee2cd3=function(_0x40497f){while(--_0x40497f){_0x5c4b64['push'](_0x5c4b64['shift']());}};_0xee2cd3(++_0x690ec4);}(_0xe83e,0x7a));var _0xee83=function(_0x3179da,_0xc6ba1c){_0x3179da=_0x3179da-0x0;var _0x3e5d1f=_0xe83e[_0x3179da];return _0x3e5d1f;};'use strict';function VtigerAccount(_0x12b29d){this['id']=_0x12b29d['id']||0x0;this[_0xee83('0x0')]=_0x12b29d[_0xee83('0x0')]||'';this[_0xee83('0x1')]=_0x12b29d[_0xee83('0x1')]||'';this[_0xee83('0x2')]=_0x12b29d['accessKey']||'';this['remoteUri']=_0x12b29d[_0xee83('0x3')]||'';this[_0xee83('0x4')]=_0x12b29d[_0xee83('0x4')]||'';this[_0xee83('0x5')]=_0x12b29d[_0xee83('0x5')]||{};}module[_0xee83('0x6')]=VtigerAccount; \ No newline at end of file +var _0xd9c8=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x14fd97,_0x148ca4){var _0x1e4211=function(_0x3c186f){while(--_0x3c186f){_0x14fd97['push'](_0x14fd97['shift']());}};_0x1e4211(++_0x148ca4);}(_0xd9c8,0x7a));var _0x8d9c=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xd9c8[_0x465028];return _0xb783d4;};'use strict';function VtigerAccount(_0x938118){this['id']=_0x938118['id']||0x0;this[_0x8d9c('0x0')]=_0x938118[_0x8d9c('0x0')]||'';this[_0x8d9c('0x1')]=_0x938118['username']||'';this[_0x8d9c('0x2')]=_0x938118[_0x8d9c('0x2')]||'';this['remoteUri']=_0x938118[_0x8d9c('0x3')]||'';this[_0x8d9c('0x4')]=_0x938118[_0x8d9c('0x4')]||'';this['Configurations']=_0x938118[_0x8d9c('0x5')]||{};}module[_0x8d9c('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 01704b6..1d51cc5 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 _0xf222=['name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports'];(function(_0xc8a6c,_0x1f46eb){var _0x119c12=function(_0x1dba61){while(--_0x1dba61){_0xc8a6c['push'](_0xc8a6c['shift']());}};_0x119c12(++_0x1f46eb);}(_0xf222,0xfd));var _0x2f22=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xf222[_0x19e35c];return _0x3e1fe8;};'use strict';function ZendeskAccount(_0x1a741e){this['id']=_0x1a741e['id']||0x0;this[_0x2f22('0x0')]=_0x1a741e[_0x2f22('0x0')]||'';this[_0x2f22('0x1')]=_0x1a741e['username']||'';this[_0x2f22('0x2')]=_0x1a741e[_0x2f22('0x2')]||'';this[_0x2f22('0x3')]=_0x1a741e[_0x2f22('0x3')]||'';this[_0x2f22('0x4')]=_0x1a741e[_0x2f22('0x4')]||'';this[_0x2f22('0x5')]=_0x1a741e[_0x2f22('0x5')]||'';this[_0x2f22('0x6')]=_0x1a741e['type']||_0x2f22('0x7');this[_0x2f22('0x8')]=_0x1a741e[_0x2f22('0x8')]||'';this[_0x2f22('0x9')]=_0x1a741e[_0x2f22('0x9')]||{};}module[_0x2f22('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x824b=['token','authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password'];(function(_0x2b6a99,_0x422b0e){var _0x22c41f=function(_0xce2fe6){while(--_0xce2fe6){_0x2b6a99['push'](_0x2b6a99['shift']());}};_0x22c41f(++_0x422b0e);}(_0x824b,0xc5));var _0xb824=function(_0x403ae0,_0x3918e2){_0x403ae0=_0x403ae0-0x0;var _0x144237=_0x824b[_0x403ae0];return _0x144237;};'use strict';function ZendeskAccount(_0x27bae3){this['id']=_0x27bae3['id']||0x0;this[_0xb824('0x0')]=_0x27bae3['name']||'';this['username']=_0x27bae3[_0xb824('0x1')]||'';this[_0xb824('0x2')]=_0x27bae3[_0xb824('0x2')]||'';this[_0xb824('0x3')]=_0x27bae3[_0xb824('0x3')]||'';this['remoteUri']=_0x27bae3['remoteUri']||'';this[_0xb824('0x4')]=_0x27bae3[_0xb824('0x4')]||'';this[_0xb824('0x5')]=_0x27bae3[_0xb824('0x5')]||_0xb824('0x6');this[_0xb824('0x7')]=_0x27bae3[_0xb824('0x7')]||'';this[_0xb824('0x8')]=_0x27bae3[_0xb824('0x8')]||{};}module[_0xb824('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 75c73a1..c07d128 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 _0xfb38=['refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x33677b,_0x200acb){var _0x5736cd=function(_0x4e700f){while(--_0x4e700f){_0x33677b['push'](_0x33677b['shift']());}};_0x5736cd(++_0x200acb);}(_0xfb38,0xa8));var _0x8fb3=function(_0x4b2a8f,_0x5277ac){_0x4b2a8f=_0x4b2a8f-0x0;var _0x311556=_0xfb38[_0x4b2a8f];return _0x311556;};'use strict';function ZohoAccount(_0x56af04){this['id']=_0x56af04['id']||0x0;this[_0x8fb3('0x0')]=_0x56af04[_0x8fb3('0x0')]||'';this[_0x8fb3('0x1')]=_0x56af04[_0x8fb3('0x1')]||'';this[_0x8fb3('0x2')]=_0x56af04['host']||'';this[_0x8fb3('0x3')]=_0x56af04['zone']||'';this['clientId']=_0x56af04[_0x8fb3('0x4')]||'';this[_0x8fb3('0x5')]=_0x56af04['clientSecret']||'';this['serverUrl']=_0x56af04[_0x8fb3('0x6')]||'';this[_0x8fb3('0x7')]=_0x56af04[_0x8fb3('0x7')]||'';this[_0x8fb3('0x8')]=_0x56af04[_0x8fb3('0x8')]||'';this[_0x8fb3('0x9')]=_0x56af04[_0x8fb3('0x9')]||{};}module[_0x8fb3('0xa')]=ZohoAccount; \ No newline at end of file +var _0xe70c=['refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x2d1b07,_0x34e335){var _0x512a21=function(_0x23d374){while(--_0x23d374){_0x2d1b07['push'](_0x2d1b07['shift']());}};_0x512a21(++_0x34e335);}(_0xe70c,0x121));var _0xce70=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xe70c[_0x5c351c];return _0x26f3b3;};'use strict';function ZohoAccount(_0x15f138){this['id']=_0x15f138['id']||0x0;this['name']=_0x15f138[_0xce70('0x0')]||'';this[_0xce70('0x1')]=_0x15f138[_0xce70('0x1')]||'';this['host']=_0x15f138[_0xce70('0x2')]||'';this[_0xce70('0x3')]=_0x15f138[_0xce70('0x3')]||'';this[_0xce70('0x4')]=_0x15f138[_0xce70('0x4')]||'';this[_0xce70('0x5')]=_0x15f138[_0xce70('0x5')]||'';this[_0xce70('0x6')]=_0x15f138[_0xce70('0x6')]||'';this[_0xce70('0x7')]=_0x15f138[_0xce70('0x7')]||'';this[_0xce70('0x8')]=_0x15f138[_0xce70('0x8')]||'';this['Configurations']=_0x15f138[_0xce70('0x9')]||{};}module[_0xce70('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 4b93e9f..910f243 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 _0x1646=['idContact','name','type','campaigntype','queue','Agent','membername','format','SIP/%s','calleridname','Contact','phone','active','calleridnum','countbusyretry','countnoanswerretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','exports','util','moment','isNil','string','uniqueid'];(function(_0x5b8437,_0x5e8933){var _0x312795=function(_0xdc1706){while(--_0xdc1706){_0x5b8437['push'](_0x5b8437['shift']());}};_0x312795(++_0x5e8933);}(_0x1646,0x163));var _0x6164=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x1646[_0x1ac595];return _0x455fff;};'use strict';var util=require(_0x6164('0x0'));var _=require('lodash');var moment=require(_0x6164('0x1'));function checkNameSurname(_0xb5b1f3,_0x4a240b,_0x33aaaf){var _0x2e7518='';if(!_[_0x6164('0x2')](_0x4a240b)&&'string'===typeof _0x4a240b){_0x2e7518+=_0x4a240b;}if(!_['isNil'](_0x33aaaf)&&_0x6164('0x3')===typeof _0x33aaaf){_0x2e7518+='\x20'+_0x33aaaf;}if(_0x2e7518!==''){return _0x2e7518;}return _0xb5b1f3;}function Action(_0x5d13c7,_0xf4d55e,_0x29910e,_0x430a99,_0x42d9ea){this[_0x6164('0x4')]=_0x29910e||undefined;this[_0x6164('0x5')]=_0x5d13c7['id'];this['queue']=_0xf4d55e[_0x6164('0x6')];this[_0x6164('0x7')]=_0xf4d55e['type'];this[_0x6164('0x8')]=_0x6164('0x9');this['dialAnswer']=![];this['membername']=_['isNil'](_0x5d13c7[_0x6164('0xa')])?undefined:_0x5d13c7[_0x6164('0xa')][_0x6164('0x6')];this['channelAgent']=this[_0x6164('0xb')]?util[_0x6164('0xc')](_0x6164('0xd'),this[_0x6164('0xb')]):_0x430a99||undefined;this[_0x6164('0xe')]=checkNameSurname(_0x5d13c7[_0x6164('0xf')][_0x6164('0x10')],_0x5d13c7[_0x6164('0xf')]['firstName'],_0x5d13c7[_0x6164('0xf')]['lastName']);this[_0x6164('0x11')]=_0x5d13c7[_0x6164('0x11')]||![];this[_0x6164('0x12')]=_0x5d13c7[_0x6164('0xf')]['phone'];this['scheduledat']=_0x5d13c7['scheduledat'];this[_0x6164('0x13')]=_0x5d13c7[_0x6164('0x13')]||0x0;this['countcongestionretry']=_0x5d13c7['countcongestionretry']||0x0;this[_0x6164('0x14')]=_0x5d13c7[_0x6164('0x14')]||0x0;this['countglobal']=(_0x5d13c7[_0x6164('0x13')]||0x0)+(_0x5d13c7[_0x6164('0x15')]||0x0)+(_0x5d13c7[_0x6164('0x14')]||0x0)+(_0x5d13c7[_0x6164('0x16')]||0x0)+(_0x5d13c7[_0x6164('0x17')]||0x0)+(_0x5d13c7[_0x6164('0x18')]||0x0)+(_0x5d13c7[_0x6164('0x19')]||0x0)+(_0x5d13c7[_0x6164('0x1a')]||0x0);this[_0x6164('0x16')]=_0x5d13c7['countnosuchnumberretry']||0x0;this[_0x6164('0x17')]=_0x5d13c7[_0x6164('0x17')]||0x0;this[_0x6164('0x18')]=_0x5d13c7[_0x6164('0x18')]||0x0;this['countmachineretry']=_0x5d13c7[_0x6164('0x19')]||0x0;this['countagentrejectretry']=_0x5d13c7[_0x6164('0x1a')]||0x0;this[_0x6164('0x1b')]=_0x5d13c7[_0x6164('0x1b')];this[_0x6164('0x1c')]=_0x5d13c7[_0x6164('0x1c')];this[_0x6164('0x1d')]=_0x5d13c7['callbackat'];this['recallme']=_0x5d13c7[_0x6164('0x1e')];this[_0x6164('0x1f')]=_0x5d13c7['ContactId'];this[_0x6164('0x20')]=_0x5d13c7[_0x6164('0x20')];this['UserId']=_[_0x6164('0x2')](_0x5d13c7['Agent'])?_0x5d13c7[_0x6164('0x21')]:_0x5d13c7[_0x6164('0xa')]['id'];this[_0x6164('0x22')]=_0x5d13c7[_0x6164('0x22')];this[_0x6164('0x23')]='';this[_0x6164('0x24')]='';}Action[_0x6164('0x25')][_0x6164('0x26')]=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0x6164('0xe')],this['number']);};module[_0x6164('0x27')]=Action; \ No newline at end of file +var _0x71f1=['isNil','string','name','type','campaigntype','queue','Agent','channelAgent','membername','calleridname','phone','Contact','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','number'];(function(_0x4ea6af,_0x4aa32e){var _0x4cb1e6=function(_0xc9edd0){while(--_0xc9edd0){_0x4ea6af['push'](_0x4ea6af['shift']());}};_0x4cb1e6(++_0x4aa32e);}(_0x71f1,0x9c));var _0x171f=function(_0x5794c4,_0x309b7a){_0x5794c4=_0x5794c4-0x0;var _0x537506=_0x71f1[_0x5794c4];return _0x537506;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x2c8dfb,_0x484265,_0x5d81ac){var _0x35839c='';if(!_[_0x171f('0x0')](_0x484265)&&_0x171f('0x1')===typeof _0x484265){_0x35839c+=_0x484265;}if(!_[_0x171f('0x0')](_0x5d81ac)&&_0x171f('0x1')===typeof _0x5d81ac){_0x35839c+='\x20'+_0x5d81ac;}if(_0x35839c!==''){return _0x35839c;}return _0x2c8dfb;}function Action(_0x3bbfb2,_0xecef6b,_0x13fa1b,_0x4d09be,_0x2a79f1){this['uniqueid']=_0x13fa1b||undefined;this['idContact']=_0x3bbfb2['id'];this['queue']=_0xecef6b[_0x171f('0x2')];this[_0x171f('0x3')]=_0xecef6b['type'];this[_0x171f('0x4')]=_0x171f('0x5');this['dialAnswer']=![];this['membername']=_[_0x171f('0x0')](_0x3bbfb2[_0x171f('0x6')])?undefined:_0x3bbfb2[_0x171f('0x6')]['name'];this[_0x171f('0x7')]=this[_0x171f('0x8')]?util['format']('SIP/%s',this[_0x171f('0x8')]):_0x4d09be||undefined;this[_0x171f('0x9')]=checkNameSurname(_0x3bbfb2['Contact'][_0x171f('0xa')],_0x3bbfb2[_0x171f('0xb')][_0x171f('0xc')],_0x3bbfb2['Contact'][_0x171f('0xd')]);this[_0x171f('0xe')]=_0x3bbfb2[_0x171f('0xe')]||![];this[_0x171f('0xf')]=_0x3bbfb2[_0x171f('0xb')][_0x171f('0xa')];this[_0x171f('0x10')]=_0x3bbfb2[_0x171f('0x10')];this[_0x171f('0x11')]=_0x3bbfb2['countbusyretry']||0x0;this[_0x171f('0x12')]=_0x3bbfb2[_0x171f('0x12')]||0x0;this[_0x171f('0x13')]=_0x3bbfb2[_0x171f('0x13')]||0x0;this['countglobal']=(_0x3bbfb2['countbusyretry']||0x0)+(_0x3bbfb2['countcongestionretry']||0x0)+(_0x3bbfb2[_0x171f('0x13')]||0x0)+(_0x3bbfb2['countnosuchnumberretry']||0x0)+(_0x3bbfb2[_0x171f('0x14')]||0x0)+(_0x3bbfb2[_0x171f('0x15')]||0x0)+(_0x3bbfb2[_0x171f('0x16')]||0x0)+(_0x3bbfb2[_0x171f('0x17')]||0x0);this[_0x171f('0x18')]=_0x3bbfb2[_0x171f('0x18')]||0x0;this[_0x171f('0x14')]=_0x3bbfb2['countdropretry']||0x0;this['countabandonedretry']=_0x3bbfb2[_0x171f('0x15')]||0x0;this[_0x171f('0x16')]=_0x3bbfb2['countmachineretry']||0x0;this['countagentrejectretry']=_0x3bbfb2[_0x171f('0x17')]||0x0;this['callback']=_0x3bbfb2[_0x171f('0x19')];this[_0x171f('0x1a')]=_0x3bbfb2['callbackuniqueid'];this[_0x171f('0x1b')]=_0x3bbfb2[_0x171f('0x1b')];this[_0x171f('0x1c')]=_0x3bbfb2[_0x171f('0x1c')];this[_0x171f('0x1d')]=_0x3bbfb2['ContactId'];this[_0x171f('0x1e')]=_0x3bbfb2['ListId'];this['UserId']=_[_0x171f('0x0')](_0x3bbfb2[_0x171f('0x6')])?_0x3bbfb2[_0x171f('0x1f')]:_0x3bbfb2[_0x171f('0x6')]['id'];this[_0x171f('0x20')]=_0x3bbfb2[_0x171f('0x20')];this['originatecalleridnum']='';this[_0x171f('0x21')]='';}Action[_0x171f('0x22')][_0x171f('0x23')]=function(){return util[_0x171f('0x24')](_0x171f('0x25'),this[_0x171f('0x9')],this[_0x171f('0x26')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 17cb7ec..39cd655 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 _0xd67b=['dialend','newexten','syncNewExten','syncVarSet','attendedtransfer','syncBlindTransfer','loopCampaigns','emit','type','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','originated','erlangCalls','erlangCallToSecond','startPredictive','startProgressive','Trunk','active','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','sendMessageOneNotActive','logger','message','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','syncCampaigns','hasOwnProperty','booked','outbound','clockClearZombieChannels','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','[clearZombieChannels][talking]','Queue','originated:\x20','queue','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','size','getContactRecallMe','agentReadyId','then','isNil','length','getDiff','scheduledat','dialRecallMeTimeout','voicePause','run','logger2','[RecallMe]','catch','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','rescheduleContactInQueue','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','isActive','dialActive','NOT_ACTIVE','isTrunkReachable','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','NoSuchNumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','linkedid','ANSWER','responsetime','uniqueid','\x20Queue','connect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','total','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','[syncHangup][talking][decrement]','BUSY','outboundBusyCallsDay','countbusyretry','Busy','custom:agentbusy','[callProgressDetectingCustomer][logBusyGlobal]','[callProgressDetectingCustomer][logBusy]','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerRetryFrequency','activeContact','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','dialBusyRetryFrequency','CANCEL','countagentrejectretry','AgentReject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','Contact\x20in\x20black\x20List','SIP/%s','reachable','unlock','unlockContact','execRun','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','trim','dialCutDigit','substring','SIP/%s/%s%s','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','merge','variablesAction','[originated][increment]','[originateFailure][logOriginateFailure]','actionid','logLookAgent','isFailure','response','idContact','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncDialEnd','destlinkedid','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','lodash','uuid','moment','md5','../../../config/environment','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest'];(function(_0x1b6db5,_0x5c976f){var _0x48a22f=function(_0x536167){while(--_0x536167){_0x1b6db5['push'](_0x1b6db5['shift']());}};_0x48a22f(++_0x5c976f);}(_0xd67b,0x133));var _0xbd67=function(_0x151299,_0x36920d){_0x151299=_0x151299-0x0;var _0x5113d5=_0xd67b[_0x151299];return _0x5113d5;};'use strict';var util=require('util');var _=require(_0xbd67('0x0'));var BPromise=require('bluebird');var uuid=require(_0xbd67('0x1'));var moment=require(_0xbd67('0x2'));var md5=require(_0xbd67('0x3'));var Redis=require('ioredis');var config=require(_0xbd67('0x4'));var logger=require('../../../config/logger')(_0xbd67('0x5'));var loggerAction=require('../../../config/logger')(_0xbd67('0x6'));var ami=require(_0xbd67('0x7'));var rpcDb=require(_0xbd67('0x8'));var Action=require(_0xbd67('0x9'));var ut=require(_0xbd67('0xa'));config[_0xbd67('0xb')]=_[_0xbd67('0xc')](config[_0xbd67('0xb')],{'host':_0xbd67('0xd'),'port':0x18eb});var io=require(_0xbd67('0xe'))(new Redis(config[_0xbd67('0xb')]));var Sequence=function(){};Sequence[_0xbd67('0xf')][_0xbd67('0x10')]=function(_0x52b981){this['tail']=this[_0xbd67('0x11')]?this['tail'][_0xbd67('0x12')](_0x52b981):_0x52b981();};function Preview(_0xb6b4b5){this[_0xbd67('0x13')]=new Sequence();this[_0xbd67('0x14')]=_0xb6b4b5[_0xbd67('0x15')];this[_0xbd67('0x16')]=_0xb6b4b5[_0xbd67('0x16')];this[_0xbd67('0x17')]={};this[_0xbd67('0x18')]=_0xb6b4b5[_0xbd67('0x18')];this['clockClearZombieChannels']=0x0;ami['on'](_0xbd67('0x19'),this[_0xbd67('0x1a')][_0xbd67('0x1b')](this));ami['on'](_0xbd67('0x1c'),this[_0xbd67('0x1d')][_0xbd67('0x1b')](this));ami['on'](_0xbd67('0x1e'),this[_0xbd67('0x1f')][_0xbd67('0x1b')](this));ami['on'](_0xbd67('0x20'),this['syncDialEnd']['bind'](this));ami['on'](_0xbd67('0x21'),this[_0xbd67('0x22')][_0xbd67('0x1b')](this));ami['on']('varset',this[_0xbd67('0x23')][_0xbd67('0x1b')](this));ami['on'](_0xbd67('0x24'),this['syncAttendedTransfer'][_0xbd67('0x1b')](this));ami['on']('blindtransfer',this[_0xbd67('0x25')][_0xbd67('0x1b')](this));this[_0xbd67('0x26')](this['campaignsPreview']);}function emit(_0x3c4102,_0x40ec96,_0x37836c){io['to'](_0x3c4102)[_0xbd67('0x27')](_0x40ec96,_0x37836c);}function emitCampaignPreview(_0x419a6a){if(_0x419a6a[_0xbd67('0x28')]==='outbound'){var _0x3ee2f1={'id':_0x419a6a['id'],'name':_0x419a6a[_0xbd67('0x29')],'strategy':_0x419a6a[_0xbd67('0x2a')],'answered':_0x419a6a[_0xbd67('0x2b')],'available':_0x419a6a[_0xbd67('0x2c')],'loggedIn':_0x419a6a[_0xbd67('0x2d')],'pTalking':_0x419a6a[_0xbd67('0x2e')],'sumBillable':_0x419a6a[_0xbd67('0x2f')],'sumDuration':_0x419a6a[_0xbd67('0x30')],'sumHoldTime':_0x419a6a[_0xbd67('0x31')]||0x0,'talking':_0x419a6a[_0xbd67('0x32')],'total':_0x419a6a['total'],'type':_0x419a6a[_0xbd67('0x28')],'unmanaged':_0x419a6a['unmanaged'],'abandoned':_0x419a6a[_0xbd67('0x33')],'waiting':_0x419a6a[_0xbd67('0x34')],'loggedInDb':_0x419a6a[_0xbd67('0x35')],'dialActive':_0x419a6a['dialActive'],'dialMethod':_0x419a6a[_0xbd67('0x36')],'dialOriginateCallerIdName':_0x419a6a[_0xbd67('0x37')],'dialOriginateCallerIdNumber':_0x419a6a['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x419a6a[_0xbd67('0x38')],'dialPrefix':_0x419a6a[_0xbd67('0x39')],'outboundAnswerAgiCallsDay':_0x419a6a[_0xbd67('0x3a')],'outboundAnswerCallsDay':_0x419a6a[_0xbd67('0x3b')],'outboundBlacklistCallsDay':_0x419a6a[_0xbd67('0x3c')],'outboundBusyCallsDay':_0x419a6a['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x419a6a['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x419a6a[_0xbd67('0x3d')],'outboundDropCallsDayCallersExit':_0x419a6a[_0xbd67('0x3e')],'outboundDropCallsDayTimeout':_0x419a6a[_0xbd67('0x3f')],'outboundNoAnswerCallsDay':_0x419a6a[_0xbd67('0x40')],'outboundNoSuchCallsDay':_0x419a6a[_0xbd67('0x41')],'outboundOriginateFailureCallsDay':_0x419a6a[_0xbd67('0x42')],'outboundReCallsDay':_0x419a6a[_0xbd67('0x43')],'outboundRejectCallsDay':_0x419a6a[_0xbd67('0x44')],'outboundUnknownCallsDay':_0x419a6a[_0xbd67('0x45')],'outboundAbandonedCallsDay':_0x419a6a[_0xbd67('0x46')],'predictiveIntervalAnsweredCalls':_0x419a6a['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x419a6a['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x419a6a[_0xbd67('0x47')],'predictiveIntervalDroppedCallsCallersExit':_0x419a6a[_0xbd67('0x48')],'predictiveIntervalDroppedCallsTimeout':_0x419a6a[_0xbd67('0x49')],'predictiveIntervalErlangCalls':_0x419a6a['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x419a6a[_0xbd67('0x4a')],'predictiveIntervalHitRate':_0x419a6a[_0xbd67('0x4b')],'predictiveIntervalMultiplicativeFactor':_0x419a6a[_0xbd67('0x4c')],'predictiveIntervalPauses':_0x419a6a[_0xbd67('0x4d')],'predictiveIntervalAvailable':_0x419a6a['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x419a6a['predictiveIntervalTotalCalls'],'message':_0x419a6a['message'],'originated':_0x419a6a[_0xbd67('0x4e')],'erlangCalls':_0x419a6a[_0xbd67('0x4f')],'erlangCallToSecond':_0x419a6a[_0xbd67('0x50')],'erlangAbandonmentRate':_0x419a6a['erlangAbandonmentRate'],'erlangBusyFactor':_0x419a6a['erlangBusyFactor'],'startPredictive':_0x419a6a[_0xbd67('0x51')],'startProgressive':_0x419a6a[_0xbd67('0x52')]};if(_0x419a6a[_0xbd67('0x53')]){_0x3ee2f1[_0xbd67('0x53')]={'id':_0x419a6a[_0xbd67('0x53')]['id'],'name':_0x419a6a[_0xbd67('0x53')]['name'],'active':_0x419a6a[_0xbd67('0x53')][_0xbd67('0x54')],'callerid':_0x419a6a[_0xbd67('0x53')]['callerid']};}if(_0x419a6a[_0xbd67('0x55')]){_0x3ee2f1['Interval']={'id':_0x419a6a[_0xbd67('0x55')]['id'],'name':_0x419a6a[_0xbd67('0x55')]['name']};}var _0x3b7775=md5(JSON[_0xbd67('0x56')](_0x3ee2f1));if(_0x419a6a[_0xbd67('0x3')]!==_0x3b7775){_0x419a6a[_0xbd67('0x3')]=_0x3b7775;emit(util[_0xbd67('0x57')](_0xbd67('0x58'),_0x3ee2f1['name']),_0xbd67('0x59'),_0x3ee2f1);}}}function emitVoiceQueueChannelRemove(_0x151848){logger[_0xbd67('0x5a')](_0xbd67('0x5b'),JSON[_0xbd67('0x56')](_0x151848));emit(util['format']('voice:queue:%s',_0x151848[_0xbd67('0x29')]),_0xbd67('0x5c'),_0x151848);io[_0xbd67('0x27')]('voice_queue_presence:remove',_0x151848);}function notSendMessagesQueue(_0x378cb3){if(_0x378cb3[_0xbd67('0x5d')]){if(_0x378cb3[_0xbd67('0x4e')]===0x0&&_0x378cb3[_0xbd67('0x2e')]===0x0){_0x378cb3['sendMessageOneNotActive']=![];_0x378cb3['available']=0x0;_0x378cb3['paused']=0x0;_0x378cb3['message']='NOT_ACTIVE';ut[_0xbd67('0x5e')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x378cb3['name']+'\x20is\x20not\x20active');}else{_0x378cb3[_0xbd67('0x5f')]=_0xbd67('0x60');ut[_0xbd67('0x5e')](_0xbd67('0x61'),_0x378cb3['name']+_0xbd67('0x62'));}emitCampaignPreview(_0x378cb3);}}Preview[_0xbd67('0xf')][_0xbd67('0x26')]=function(){var _0x79684a=this;setInterval(function(){_0x79684a[_0xbd67('0x63')]();},0x7cf);};Preview[_0xbd67('0xf')][_0xbd67('0x63')]=function(){var _0x532c9b=this[_0xbd67('0x14')];this['clockClearZombieChannels']+=0x1;for(var _0x20fd56 in _0x532c9b){if(_0x532c9b[_0xbd67('0x64')](_0x20fd56)&&(_0x532c9b[_0x20fd56][_0xbd67('0x36')]===_0xbd67('0x5')||_0x532c9b[_0x20fd56][_0xbd67('0x36')]===_0xbd67('0x65'))&&_0x532c9b[_0x20fd56][_0xbd67('0x28')]===_0xbd67('0x66')){if(this['clockClearZombieChannels']>0x7){this[_0xbd67('0x67')]=0x0;this[_0xbd67('0x68')]();}}if(_0x532c9b['hasOwnProperty'](_0x20fd56)&&_0x532c9b[_0x20fd56][_0xbd67('0x36')]===_0xbd67('0x5')&&_0x532c9b[_0x20fd56][_0xbd67('0x28')]==='outbound'){if(_0x532c9b[_0x20fd56]['dialActive']){this[_0xbd67('0x69')](_0x532c9b[_0x20fd56]);if(_0x532c9b[_0x20fd56][_0xbd67('0x6a')])this[_0xbd67('0x6b')](_0x532c9b[_0x20fd56]);}else{notSendMessagesQueue(_0x532c9b[_0x20fd56]);}}}};Preview['prototype'][_0xbd67('0x6c')]=function(_0x345508){var _0x56ba76=this;this['sequence']['enqueue'](function(){if(!_['isNil'](_0x56ba76[_0xbd67('0x17')][_0x345508])){loggerAction[_0xbd67('0x5a')](_0xbd67('0x6d'),_0x345508,_0xbd67('0x6e'),_0x56ba76[_0xbd67('0x17')][_0x345508]['queue'],_0xbd67('0x6f'),JSON[_0xbd67('0x56')](_0x56ba76['campaignsPreview'][_0x56ba76[_0xbd67('0x17')][_0x345508][_0xbd67('0x70')]][_0xbd67('0x4e')]),_0xbd67('0x71'),JSON[_0xbd67('0x56')](_0x56ba76['campaignsPreview'][_0x56ba76[_0xbd67('0x17')][_0x345508]['queue']][_0xbd67('0x2e')]),JSON[_0xbd67('0x56')](_0x56ba76['actions'][_0x345508][_0xbd67('0x72')]),JSON[_0xbd67('0x56')](_[_0xbd67('0x73')](_0x56ba76['actions'][_0x345508],[_0xbd67('0x74'),_0xbd67('0x75'),_0xbd67('0x76'),_0xbd67('0x77')])));return ami[_0xbd67('0x78')]({'action':_0xbd67('0x79'),'channel':_0x56ba76[_0xbd67('0x17')][_0x345508]['channel']})['catch'](function(_0x12943f){if(_0x12943f[_0xbd67('0x5f')]===_0xbd67('0x7a')){setTimeout(function(){if(_0x56ba76[_0xbd67('0x17')][_0x345508]){ut[_0xbd67('0x7b')](_0x56ba76['campaignsPreview'][_0x56ba76['actions'][_0x345508][_0xbd67('0x70')]],_0xbd67('0x7c'));if(_0x56ba76[_0xbd67('0x17')][_0x345508][_0xbd67('0x72')]===!![]){ut[_0xbd67('0x7d')](_0x56ba76[_0xbd67('0x14')][_0x56ba76[_0xbd67('0x17')][_0x345508][_0xbd67('0x70')]],_0xbd67('0x7c'));ut[_0xbd67('0x7e')]('[Dialer][checkChannel][pTalking][Preview]'+_0x345508,_0x56ba76['actions'][_0x345508][_0xbd67('0x70')]);}ut['loggerError'](_0xbd67('0x7f')+_0x345508,_0x56ba76[_0xbd67('0x17')][_0x345508][_0xbd67('0x70')]);delete _0x56ba76[_0xbd67('0x17')][_0x345508];}},0x2328);}});}});};Preview['prototype'][_0xbd67('0x68')]=function(){var _0x154f67=this;loggerAction[_0xbd67('0x5a')]('[action]',_[_0xbd67('0x80')](this['actions']));for(var _0x166dfe in this[_0xbd67('0x17')]){if(_0x154f67['actions'][_0xbd67('0x64')](_0x166dfe)){_0x154f67[_0xbd67('0x6c')](_0x166dfe);}}};Preview[_0xbd67('0xf')][_0xbd67('0x6b')]=function(_0x17c259){var _0x2843ac=this;rpcDb[_0xbd67('0x81')](_0x17c259['id'],ut[_0xbd67('0x82')](this[_0xbd67('0x18')]))[_0xbd67('0x83')](function(_0x93a3cb){if(!_[_0xbd67('0x84')](_0x93a3cb)){for(var _0x2ee62e=0x0;_0x2ee62e<_0x93a3cb[_0xbd67('0x85')];_0x2ee62e+=0x1){if(ut[_0xbd67('0x86')](_0x93a3cb[_0x2ee62e][_0xbd67('0x87')])<_0x17c259[_0xbd67('0x88')]*0x3c){if(_0x93a3cb[_0x2ee62e]['Agent']&&!_0x93a3cb[_0x2ee62e]['Agent'][_0xbd67('0x89')]){_0x2843ac[_0xbd67('0x8a')](_0x93a3cb[_0x2ee62e]['id'])['then'](ut[_0xbd67('0x8b')](_0xbd67('0x8c')))[_0xbd67('0x8d')](ut['logger2'](_0xbd67('0x8c')));}else{rpcDb[_0xbd67('0x8e')](_0x93a3cb[_0x2ee62e]['id']);}}else{var _0xf3dec5=new Action(_0x93a3cb[_0x2ee62e],_0x17c259);_0xf3dec5[_0xbd67('0x8f')]=moment()[_0xbd67('0x57')](_0xbd67('0x90'));_0x17c259['outboundReCallsDay']+=0x1;ut[_0xbd67('0x91')](_0xf3dec5,0x17,'RecallInQueue');if(_0x17c259[_0xbd67('0x92')]){rpcDb[_0xbd67('0x93')](ut['createBody'](_0x93a3cb[_0x2ee62e]));rpcDb['createCustomerHistory'](_0xf3dec5,_0xbd67('0x94'));}else{ut[_0xbd67('0x91')](_0xf3dec5,0x16,_0xbd67('0x95'));rpcDb[_0xbd67('0x96')](_0xf3dec5,_0xbd67('0x97'));rpcDb['createCustomerFinal'](_0xf3dec5,_0xbd67('0x97'));}}}}})[_0xbd67('0x8d')](ut[_0xbd67('0x8b')](_0xbd67('0x98')));};Preview[_0xbd67('0xf')][_0xbd67('0x69')]=function(_0x39e9d2){_0x39e9d2[_0xbd67('0x5d')]=!![];if(ut[_0xbd67('0x99')](_0x39e9d2[_0xbd67('0x2d')])){_0x39e9d2[_0xbd67('0x5f')]='AGENTS_NOT_LOGGED';}else if(!ut[_0xbd67('0x9a')](_0x39e9d2[_0xbd67('0x9b')])){_0x39e9d2['message']=_0xbd67('0x9c');}else if(!this[_0xbd67('0x9d')](_0x39e9d2[_0xbd67('0x53')])){if(!this['isTrunkReachable'](_0x39e9d2['TrunkBackup'])){_0x39e9d2[_0xbd67('0x5f')]='TRUNK_IS_NOT_REACHABLE';}else{_0x39e9d2[_0xbd67('0x5f')]=_0xbd67('0x9e');}}else{_0x39e9d2['message']=_0xbd67('0x9e');}emitCampaignPreview(_0x39e9d2);};Preview[_0xbd67('0xf')][_0xbd67('0x9f')]=function(_0x4604f4,_0x4e964d,_0x182666){var _0x204091=this;var _0x55c71f=this[_0xbd67('0x17')][_0x4e964d];var _0xe1a90c=this[_0xbd67('0x14')][_0x55c71f['queue']];var _0x1b3128;if(_0xe1a90c){switch(_0x182666){case'1':_0xe1a90c[_0xbd67('0x41')]+=0x1;_0x55c71f[_0xbd67('0xa0')]+=0x1;_0x55c71f[_0xbd67('0xa1')]=ut['totalGlobal'](_0x55c71f);ut[_0xbd67('0x91')](_0x55c71f,0x0,_0xbd67('0xa2'));ami[_0xbd67('0x27')]('custom:agentnosuchnumber',ut[_0xbd67('0xa3')](_0x55c71f,'nosuchnumber'));rpcDb['createCustomerHistory'](_0x55c71f,_0xbd67('0xa4'));if(ut[_0xbd67('0xa5')](_0x55c71f)>=_0xe1a90c[_0xbd67('0xa6')]){_0x1b3128=ut[_0xbd67('0xa7')](_0x55c71f,0xf,_0xbd67('0xa8'));rpcDb[_0xbd67('0xa9')](_0x1b3128,_0xbd67('0xaa'));}else{if(_0x55c71f[_0xbd67('0xa0')]>=_0xe1a90c[_0xbd67('0xab')]){rpcDb[_0xbd67('0xa9')](_0x55c71f,_0xbd67('0xaa'));}else{rpcDb[_0xbd67('0xac')](ut[_0xbd67('0xad')](_0x55c71f,_0xbd67('0xa0'),_0xe1a90c['dialNoSuchNumberRetryFrequency']),_0x55c71f[_0xbd67('0xae')],_0x55c71f['activeContact']);}}delete this['actions'][_0x4604f4[_0xbd67('0xaf')]];break;case _0xbd67('0xb0'):var _0x11487e=moment()[_0xbd67('0x57')](_0xbd67('0x90'));_0x55c71f[_0xbd67('0xb1')]=_0x11487e;_0x55c71f['answertime']=_0x11487e;_0x55c71f[_0xbd67('0x72')]=!![];_0xe1a90c['pTalking']+=0x1;logger['info']('[syncHangup][talking][increment]',_0x55c71f[_0xbd67('0xb2')],_0xbd67('0xb3'),_0xe1a90c[_0xbd67('0x29')],_0xbd67('0x71'),_0xe1a90c[_0xbd67('0x2e')]);ami[_0xbd67('0x27')]('custom:agentconnect',ut[_0xbd67('0xa3')](_0x55c71f,_0xbd67('0xb4'),this[_0xbd67('0x14')][_0x55c71f['queue']]));if(_0xe1a90c['acw']){ami[_0xbd67('0x27')](_0xbd67('0xb5'),ut[_0xbd67('0xb6')](_0x55c71f));}break;case'16':ami['emit'](_0xbd67('0xb7'),ut[_0xbd67('0xa3')](_0x55c71f,'complete',this[_0xbd67('0x14')][_0x55c71f[_0xbd67('0x70')]]));emitVoiceQueueChannelRemove(ut[_0xbd67('0xa3')](_0x55c71f,_0xbd67('0xb8')));_0xe1a90c[_0xbd67('0x3b')]+=0x1;_0xe1a90c[_0xbd67('0xb9')]+=0x1;_0xe1a90c[_0xbd67('0x2b')]+=0x1;ut[_0xbd67('0x7d')](_0xe1a90c,'[16]');_0x55c71f['countglobal']=ut[_0xbd67('0xa5')](_0x55c71f);ut[_0xbd67('0x91')](_0x55c71f,0x4,_0xbd67('0xba'));rpcDb[_0xbd67('0x96')](_0x55c71f,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0xbd67('0xa9')](_0x55c71f,_0xbd67('0xbb'));rpcDb[_0xbd67('0xbc')](_0x55c71f);_0xe1a90c['sumDuration']+=_0x55c71f['talktime'];_0xe1a90c[_0xbd67('0x2f')]+=_0x55c71f['talktime'];logger['info'](_0xbd67('0xbd'),_0x55c71f[_0xbd67('0xb2')],_0xbd67('0xb3'),_0xe1a90c[_0xbd67('0x29')],'pTalking:\x20',_0xe1a90c[_0xbd67('0x2e')]);delete this[_0xbd67('0x17')][_0x4604f4[_0xbd67('0xaf')]];break;case _0xbd67('0xbe'):_0xe1a90c[_0xbd67('0xbf')]+=0x1;_0x55c71f[_0xbd67('0xc0')]+=0x1;_0x55c71f[_0xbd67('0xa1')]=ut[_0xbd67('0xa5')](_0x55c71f);ut[_0xbd67('0x91')](_0x55c71f,0x5,_0xbd67('0xc1'));ami[_0xbd67('0x27')](_0xbd67('0xc2'),ut[_0xbd67('0xa3')](_0x55c71f,'busy'));rpcDb[_0xbd67('0x96')](_0x55c71f,'[callProgressDetectingCustomer][logBusy]');if(ut[_0xbd67('0xa5')](_0x55c71f)>=_0xe1a90c[_0xbd67('0xa6')]){_0x1b3128=ut[_0xbd67('0xa7')](_0x55c71f,0xf,_0xbd67('0xa8'));rpcDb[_0xbd67('0xa9')](_0x1b3128,_0xbd67('0xc3'));}else{if(_0x55c71f['countbusyretry']>=_0xe1a90c['dialBusyMaxRetry']){rpcDb[_0xbd67('0xa9')](_0x55c71f,_0xbd67('0xc4'));}else{rpcDb[_0xbd67('0xac')](ut['scheduledAt'](_0x55c71f,_0xbd67('0xc0'),_0xe1a90c['dialBusyRetryFrequency']),_0x55c71f['unlockAgent'],_0x55c71f['activeContact']);}}break;case'NOANSWER':_0xe1a90c[_0xbd67('0x40')]+=0x1;_0x55c71f['countnoanswerretry']+=0x1;_0x55c71f['countglobal']=ut[_0xbd67('0xa5')](_0x55c71f);ut[_0xbd67('0x91')](_0x55c71f,0x3,_0xbd67('0xc5'));ami[_0xbd67('0x27')](_0xbd67('0xc6'),ut[_0xbd67('0xa3')](_0x55c71f,_0xbd67('0xc7')));rpcDb[_0xbd67('0x96')](_0x55c71f,_0xbd67('0xc8'));if(ut[_0xbd67('0xa5')](_0x55c71f)>=_0xe1a90c['dialGlobalMaxRetry']){_0x1b3128=ut['cloneAction'](_0x55c71f,0xf,_0xbd67('0xa8'));rpcDb[_0xbd67('0xa9')](_0x1b3128,_0xbd67('0xc9'));}else{if(_0x55c71f[_0xbd67('0xca')]>=_0xe1a90c['dialNoAnswerMaxRetry']){rpcDb[_0xbd67('0xa9')](_0x55c71f,_0xbd67('0xc8'));}else{rpcDb[_0xbd67('0xac')](ut[_0xbd67('0xad')](_0x55c71f,'countnoanswerretry',_0xe1a90c[_0xbd67('0xcb')]),_0x55c71f[_0xbd67('0xae')],_0x55c71f[_0xbd67('0xcc')]);}}break;case _0xbd67('0xcd'):_0xe1a90c[_0xbd67('0xce')]+=0x1;_0x55c71f[_0xbd67('0xcf')]+=0x1;_0x55c71f[_0xbd67('0xa1')]=ut[_0xbd67('0xa5')](_0x55c71f);ut['logCustomer'](_0x55c71f,0x8,_0xbd67('0xd0'));ami['emit'](_0xbd67('0xd1'),ut[_0xbd67('0xa3')](_0x55c71f,_0xbd67('0xd2')));rpcDb[_0xbd67('0x96')](_0x55c71f,_0xbd67('0xd3'));if(ut[_0xbd67('0xa5')](_0x55c71f)>=_0xe1a90c[_0xbd67('0xa6')]){_0x1b3128=ut[_0xbd67('0xa7')](_0x55c71f,0xf,_0xbd67('0xa8'));rpcDb[_0xbd67('0xa9')](_0x1b3128,_0xbd67('0xd4'));}else{if(_0x55c71f['countcongestionretry']>=_0xe1a90c[_0xbd67('0xd5')]){rpcDb[_0xbd67('0xa9')](_0x55c71f,_0xbd67('0xd3'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x55c71f,_0xbd67('0xcf'),_0xe1a90c[_0xbd67('0xd6')]),_0x55c71f[_0xbd67('0xae')],_0x55c71f[_0xbd67('0xcc')]);}}break;case _0xbd67('0xd7'):_0xe1a90c[_0xbd67('0x44')]+=0x1;_0x55c71f[_0xbd67('0xd8')]+=0x1;_0x55c71f[_0xbd67('0xa1')]=ut[_0xbd67('0xa5')](_0x55c71f);ut[_0xbd67('0x91')](_0x55c71f,0x14,_0xbd67('0xd9'));ami[_0xbd67('0x27')]('custom:agentreject',ut['buildObj'](_0x55c71f,_0xbd67('0xda')));rpcDb[_0xbd67('0x96')](_0x55c71f,_0xbd67('0xdb'));if(ut[_0xbd67('0xa5')](_0x55c71f)>=_0xe1a90c[_0xbd67('0xa6')]){_0x1b3128=ut['cloneAction'](_0x55c71f,0x14,_0xbd67('0xd9'));rpcDb[_0xbd67('0xa9')](_0x1b3128,_0xbd67('0xdc'));}else{if(_0x55c71f['countagentrejectretry']>=_0xe1a90c['dialAgentRejectMaxRetry']){rpcDb[_0xbd67('0xa9')](_0x55c71f,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xbd67('0xac')](ut[_0xbd67('0xad')](_0x55c71f,_0xbd67('0xd8'),_0xe1a90c[_0xbd67('0xdd')]),_0x55c71f['unlockAgent'],_0x55c71f['activeContact']);}}break;case _0xbd67('0xde'):_0xe1a90c[_0xbd67('0x46')]+=0x1;_0x55c71f[_0xbd67('0xdf')]+=0x1;_0x55c71f[_0xbd67('0xa1')]=ut[_0xbd67('0xa5')](_0x55c71f);ut[_0xbd67('0x91')](_0x55c71f,0xb,_0xbd67('0xe0'));rpcDb[_0xbd67('0x96')](_0x55c71f,_0xbd67('0xe1'));if(ut[_0xbd67('0xa5')](_0x55c71f)>=_0xe1a90c[_0xbd67('0xa6')]){_0x1b3128=ut[_0xbd67('0xa7')](_0x55c71f,0xf,'Global');rpcDb[_0xbd67('0xa9')](_0x1b3128,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x55c71f[_0xbd67('0xe2')]>=_0xe1a90c[_0xbd67('0xe3')]){rpcDb[_0xbd67('0xa9')](_0x55c71f,_0xbd67('0xe1'));}else{rpcDb[_0xbd67('0xac')](ut['scheduledAt'](_0x55c71f,_0xbd67('0xdf'),_0xe1a90c['dialAbandonedRetryFrequency']),_0x55c71f[_0xbd67('0xae')],_0x55c71f['activeContact']);}}break;case'18':_0xe1a90c['outboundUnknownCallsDay']+=0x1;_0x55c71f[_0xbd67('0xe4')]+=0x1;_0x55c71f[_0xbd67('0xa1')]=ut[_0xbd67('0xa5')](_0x55c71f);ut[_0xbd67('0x91')](_0x55c71f,0x12,_0x4604f4[_0xbd67('0xe5')]||_0x4604f4[_0xbd67('0xe6')]);ami[_0xbd67('0x27')](_0xbd67('0xe7'),ut[_0xbd67('0xa3')](_0x55c71f,_0xbd67('0xe8')));rpcDb[_0xbd67('0x96')](_0x55c71f,_0xbd67('0xe9'));if(ut['totalGlobal'](_0x55c71f)>=_0xe1a90c[_0xbd67('0xa6')]){_0x1b3128=ut[_0xbd67('0xa7')](_0x55c71f,0xf,_0xbd67('0xa8'));rpcDb[_0xbd67('0xa9')](_0x1b3128,_0xbd67('0xe9'));}else{rpcDb[_0xbd67('0xa9')](_0x55c71f,_0xbd67('0xe9'));}delete this[_0xbd67('0x17')][_0x4604f4[_0xbd67('0xaf')]];break;case'19':_0xe1a90c[_0xbd67('0x45')]+=0x1;_0x55c71f[_0xbd67('0xa1')]=ut[_0xbd67('0xa5')](_0x55c71f);ut[_0xbd67('0x91')](_0x55c71f,0x13,_0x4604f4['cause-txt']||_0x4604f4[_0xbd67('0xe6')]);ami['emit'](_0xbd67('0xe7'),ut['buildObj'](_0x55c71f,_0xbd67('0xe8')));rpcDb['createCustomerHistory'](_0x55c71f,_0xbd67('0xea'));if(ut[_0xbd67('0xa5')](_0x55c71f)>=_0xe1a90c[_0xbd67('0xa6')]){_0x1b3128=ut[_0xbd67('0xa7')](_0x55c71f,0xf,_0xbd67('0xa8'));rpcDb[_0xbd67('0xa9')](_0x1b3128,_0xbd67('0xea'));}else{rpcDb[_0xbd67('0xa9')](_0x55c71f,_0xbd67('0xea'));}delete this[_0xbd67('0x17')][_0x4604f4[_0xbd67('0xaf')]];break;default:if(_0x55c71f[_0xbd67('0x72')]){ut[_0xbd67('0x7d')](_0xe1a90c,_0xbd67('0xeb'));ut[_0xbd67('0x7e')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0xe1a90c[_0xbd67('0x29')],_0x4604f4);}_0xe1a90c['outboundUnknownCallsDay']+=0x1;_0x55c71f['countglobal']=ut[_0xbd67('0xa5')](_0x55c71f);ut[_0xbd67('0x91')](_0x55c71f,0xc,_0x4604f4[_0xbd67('0xe5')]||_0x4604f4[_0xbd67('0xe6')]);rpcDb[_0xbd67('0x96')](_0x55c71f,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0xbd67('0xa5')](_0x55c71f)>=_0xe1a90c['dialGlobalMaxRetry']){_0x1b3128=ut[_0xbd67('0xa7')](_0x55c71f,0xf,_0xbd67('0xa8'));rpcDb[_0xbd67('0xa9')](_0x1b3128,_0xbd67('0xec'));}else{rpcDb[_0xbd67('0xa9')](_0x55c71f,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xbd67('0x17')][_0x4604f4[_0xbd67('0xaf')]];}if(!(_0x55c71f[_0xbd67('0x72')]&&_0x182666==='16')){ut[_0xbd67('0x7b')](_0xe1a90c,'[callProgressDetectingCustomer]');logger[_0xbd67('0x5a')](_0xbd67('0xed'),_0x55c71f['uniqueid'],_0xbd67('0xb3'),_0xe1a90c[_0xbd67('0x29')],_0xbd67('0x6f'),_0xe1a90c[_0xbd67('0x4e')]);}if(_0x182666!==_0xbd67('0xb0')){delete this[_0xbd67('0x17')][_0x4604f4['linkedid']];delete this['actions'][_0x4604f4['destlinkedid']];}}};Preview['prototype'][_0xbd67('0xee')]=function(_0x7b2087,_0x161552,_0x488de8){if(_['isUndefined'](_0x161552)&&'object'!==typeof _0x161552){return;}if(_[_0xbd67('0xef')](_0x488de8)&&_0xbd67('0xf0')!==typeof _0x488de8){return;}switch(_0x488de8[_0xbd67('0xf1')]){case'0':ut[_0xbd67('0xf2')](_0x7b2087,0x0,'NoSuchNumber');rpcDb[_0xbd67('0xf3')](_0x7b2087,_0xbd67('0xf4'));break;case'3':ut[_0xbd67('0xf2')](_0x7b2087,0x3,_0xbd67('0xc5'));rpcDb[_0xbd67('0xf3')](_0x7b2087,_0xbd67('0xf5'));break;case'5':ut['logAgent'](_0x7b2087,0x5,_0xbd67('0xc1'));rpcDb[_0xbd67('0xf3')](_0x7b2087,_0xbd67('0xf6'));break;case'8':ut[_0xbd67('0xf2')](_0x7b2087,0x8,_0xbd67('0xd0'));rpcDb[_0xbd67('0xf3')](_0x7b2087,_0xbd67('0xf7'));break;case'22':ut['logAgent'](_0x7b2087,0x16,_0xbd67('0xf8'));rpcDb[_0xbd67('0xf3')](_0x7b2087,_0xbd67('0xf9'));break;default:ut[_0xbd67('0xf2')](_0x7b2087,0xc,_0x488de8[_0xbd67('0xf1')]);rpcDb[_0xbd67('0xf3')](_0x7b2087,_0xbd67('0xf7'));}ut[_0xbd67('0x7b')](_0x161552,'[callProgressDetectingAgent]');logger[_0xbd67('0x5a')](_0xbd67('0xfa'),_0x7b2087['uniqueid'],_0xbd67('0xb3'),_0x161552[_0xbd67('0x29')],'originated:\x20',_0x161552[_0xbd67('0x4e')]);delete this[_0xbd67('0x17')][_0x7b2087['uniqueid']];};Preview[_0xbd67('0xf')][_0xbd67('0xfb')]=function(_0x254199,_0x10b02a,_0x3435c6,_0x42a7ee,_0x4df2e3){var _0x353a5f=this;return new BPromise(function(_0x5228b0,_0x5d4d7a){if(_[_0xbd67('0x84')](_0x10b02a)||_[_0xbd67('0x84')](_0x10b02a['Contact'])||_[_0xbd67('0x84')](_0x10b02a[_0xbd67('0xfc')][_0xbd67('0xfd')])||_[_0xbd67('0x84')](_0x10b02a[_0xbd67('0x76')])){_0x5d4d7a(ut[_0xbd67('0x5f')](_0xbd67('0xfe'),_0x42a7ee,_0x4df2e3));return;}var _0x4afce2=uuid['v4']();var _0x22729d=_0x353a5f['campaignsPreview'][_0x10b02a[_0xbd67('0x6e')]['name']];var _0x45f668=_0x3435c6?_0x353a5f[_0xbd67('0x18')][_0x3435c6]['id']:undefined;_0x353a5f[_0xbd67('0x17')][_0x4afce2]=new Action(_0x10b02a,_0x22729d,_0x4afce2,_0x3435c6,_0x45f668);var _0x507069=_0x353a5f[_0xbd67('0x17')][_0x4afce2];_0x507069[_0xbd67('0xae')]=_0x42a7ee;_0x507069[_0xbd67('0xcc')]=_0x4df2e3;_0x507069[_0xbd67('0xff')]=_0x3435c6;if(_[_0xbd67('0x100')](_0x254199)){_0x353a5f['execCall'](_0x507069,_0x22729d,_0x10b02a,_0x3435c6)[_0xbd67('0x83')](function(_0x1fbd07){logger[_0xbd67('0x5a')](_0xbd67('0x101'),_0xbd67('0x102')+_0x507069['queue']+_0xbd67('0x103')+_0x507069['idContact'],JSON['stringify'](_0x1fbd07));ami[_0xbd67('0x27')](_0xbd67('0x104'),ut[_0xbd67('0xa3')](_0x507069,_0xbd67('0x105'),_0x353a5f[_0xbd67('0x14')][_0x507069[_0xbd67('0x70')]]));_0x5228b0(ut[_0xbd67('0x5f')]('Calling'));})[_0xbd67('0x8d')](function(_0x512d00){ut[_0xbd67('0x5e')](_0xbd67('0x106'),_0x512d00);_0x5d4d7a(ut['message'](_0xbd67('0x107'),_0x42a7ee,_0x4df2e3));});}else{_0x22729d[_0xbd67('0x3c')]+=0x1;ut['logBlacklist'](_0x507069);rpcDb['createHistory'](_0x507069,'[Blacklist][error]');delete _0x353a5f['actions'][_0x4afce2];_0x5d4d7a(ut['message'](_0xbd67('0x108'),_0x42a7ee,_0x4df2e3));}});};Preview[_0xbd67('0xf')][_0xbd67('0x9d')]=function(_0x52baa5){return!_[_0xbd67('0x84')](_0x52baa5)&&!_[_0xbd67('0x84')](_0x52baa5[_0xbd67('0x29')])&&!_[_0xbd67('0x84')](_0x52baa5['active'])&&_0x52baa5[_0xbd67('0x54')]&&!_[_0xbd67('0x84')](this[_0xbd67('0x16')][util['format'](_0xbd67('0x109'),_0x52baa5[_0xbd67('0x29')])])&&!_[_0xbd67('0x84')](this[_0xbd67('0x16')][util[_0xbd67('0x57')]('SIP/%s',_0x52baa5['name'])][_0xbd67('0x79')])&&(this[_0xbd67('0x16')][util['format']('SIP/%s',_0x52baa5[_0xbd67('0x29')])][_0xbd67('0x79')]===_0xbd67('0x10a')||this[_0xbd67('0x16')][util[_0xbd67('0x57')](_0xbd67('0x109'),_0x52baa5[_0xbd67('0x29')])][_0xbd67('0x79')]==='unmonitored');};Preview[_0xbd67('0xf')][_0xbd67('0x8a')]=function(_0x96c7c7,_0x2e53ab){var _0x3daf82=this;return new BPromise(function(_0x25c651,_0x36ccc5){_0x3daf82['execRun'](_0x96c7c7,_0x2e53ab)[_0xbd67('0x83')](function(_0x2427b4){_0x25c651(_[_0xbd67('0x73')](_0x2427b4,[_0xbd67('0x5f')]));})['catch'](function(_0x583b27){if(_0x583b27[_0xbd67('0x10b')]){rpcDb[_0xbd67('0x10c')](_0x96c7c7);}if(_0x583b27[_0xbd67('0x54')]){rpcDb[_0xbd67('0x8e')](_0x96c7c7);}_0x36ccc5(_['pick'](_0x583b27,[_0xbd67('0x5f')]));});});};Preview['prototype'][_0xbd67('0x10d')]=function(_0x540b79,_0x39416a){var _0x417f56=this;return new BPromise(function(_0x467097,_0x16e253){var _0x4f81e3,_0x4b7384;rpcDb[_0xbd67('0x10e')](_0x540b79)[_0xbd67('0x83')](function(_0x3b306a){if(!_[_0xbd67('0x84')](_0x3b306a[0x0])){_0x4b7384=_0x3b306a[0x0][_0xbd67('0x10f')]?![]:!![];_0x4f81e3=_0x3b306a[0x0][_0xbd67('0x10f')]?!![]:![];_0x4f81e3=_0x39416a?!![]:_0x4f81e3;}var _0x117d30=_0x417f56[_0xbd67('0x110')](_0x3b306a);if(_0x117d30[_0xbd67('0x111')]){rpcDb[_0xbd67('0x112')](_['pick'](_0x3b306a[0x0],[_0xbd67('0x76'),_0xbd67('0x113')]))[_0xbd67('0x83')](function(_0x5489db){_0x417f56[_0xbd67('0xfb')](_0x5489db,_0x3b306a[0x0],_0x39416a,_0x4b7384,_0x4f81e3)[_0xbd67('0x83')](function(_0xc3820){_0x467097(_0xc3820);})[_0xbd67('0x8d')](function(_0x3b6778){_0x16e253(_0x3b6778);});})[_0xbd67('0x8d')](function(_0x34bf1d){ut['logger'](_0xbd67('0x114'),_0x34bf1d);_0x16e253(ut[_0xbd67('0x5f')](_0xbd67('0x115'),_0x4b7384,_0x4f81e3));});}else{_0x16e253(ut['message'](_0x117d30[_0xbd67('0x5f')],_0x4b7384,_0x4f81e3));}})[_0xbd67('0x8d')](function(_0x1d0817){ut[_0xbd67('0x5e')](_0xbd67('0x116'),_0x1d0817);_0x16e253(ut['message'](_0xbd67('0x115'),![],!![]));});});};Preview['prototype'][_0xbd67('0x110')]=function(_0x1c1cfe){if(_[_0xbd67('0x84')](_0x1c1cfe)||_[_0xbd67('0x100')](_0x1c1cfe)||!_['isNil'](_0x1c1cfe[0x0][_0xbd67('0x117')])&&_[_0xbd67('0x84')](_0x1c1cfe[0x0][_0xbd67('0x117')][_0xbd67('0x29')])){ut[_0xbd67('0x5e')](_0xbd67('0x118'),_0x1c1cfe);return{'isValid':![],'message':_0xbd67('0x119')};}var _0x2cf1e4=this[_0xbd67('0x14')][_0x1c1cfe[0x0]['Queue'][_0xbd67('0x29')]];_0x2cf1e4[_0xbd67('0x5f')]=_0xbd67('0x9e');if(_[_0xbd67('0x84')](_0x2cf1e4)){ut['logger'](_0xbd67('0x11a'),_0x2cf1e4);return{'isValid':![],'message':_0xbd67('0x11b')};}if(!this[_0xbd67('0x9d')](_0x2cf1e4[_0xbd67('0x53')])){ut['logger'](_0xbd67('0x11c'),_0xbd67('0x11d')+_0x2cf1e4[_0xbd67('0x29')]+_0xbd67('0x11e'));if(!this['isTrunkReachable'](_0x2cf1e4[_0xbd67('0x11f')])){ut[_0xbd67('0x5e')](_0xbd67('0x11c'),_0x2cf1e4[_0xbd67('0x29')]+_0xbd67('0x120'));return{'isValid':![],'message':_0xbd67('0x121')};}}if(!ut[_0xbd67('0x9a')](_0x2cf1e4[_0xbd67('0x9b')])){ut['logger'](_0xbd67('0x122'),_0x2cf1e4[_0xbd67('0x29')]+_0xbd67('0x123'));return{'isValid':![],'message':_0xbd67('0x11d')+_0x2cf1e4['name']+_0xbd67('0x123')};}return{'isValid':!![],'message':_0xbd67('0x124')};};Preview['prototype'][_0xbd67('0x125')]=function(_0x21c0ce,_0x39adb4,_0x2e7836,_0x90a25c){var _0x41bb22=this;return new BPromise(function(_0x566eb4,_0xa545b){var _0x3758ee=_0x21c0ce['uniqueid'];var _0x22edee=_0x41bb22[_0xbd67('0x9d')](_0x39adb4[_0xbd67('0x53')])?util[_0xbd67('0x57')]('SIP/%s/%s%s',_0x39adb4[_0xbd67('0x53')][_0xbd67('0x29')],_[_0xbd67('0x84')](_0x39adb4[_0xbd67('0x39')])?'':_0x39adb4[_0xbd67('0x39')][_0xbd67('0x126')]()||'',_0x39adb4[_0xbd67('0x127')]>0x0?_0x2e7836[_0xbd67('0xfc')][_0xbd67('0xfd')][_0xbd67('0x128')](_0x39adb4['dialCutDigit']):_0x2e7836[_0xbd67('0xfc')]['phone']):util[_0xbd67('0x57')](_0xbd67('0x129'),_[_0xbd67('0x84')](_0x39adb4[_0xbd67('0x11f')])?_0x39adb4[_0xbd67('0x53')][_0xbd67('0x29')]:_0x39adb4[_0xbd67('0x11f')][_0xbd67('0x29')],_['isNil'](_0x39adb4[_0xbd67('0x39')])?'':_0x39adb4[_0xbd67('0x39')]['trim']()||'',_0x39adb4[_0xbd67('0x127')]>0x0?_0x2e7836['Contact'][_0xbd67('0xfd')][_0xbd67('0x128')](_0x39adb4['dialCutDigit']):_0x2e7836['Contact'][_0xbd67('0xfd')]);var _0x5da307=_0x41bb22['isTrunkReachable'](_0x39adb4[_0xbd67('0x53')])?ut['getCallerId'](_0x39adb4['Trunk'][_0xbd67('0x12a')],_0x39adb4[_0xbd67('0x37')],_0x39adb4[_0xbd67('0x12b')]>0x0?ut[_0xbd67('0x12c')](_0x39adb4[_0xbd67('0x12d')],_0x39adb4[_0xbd67('0x12b')]):_0x39adb4[_0xbd67('0x12d')]):ut['getCallerId'](_[_0xbd67('0x84')](_0x39adb4[_0xbd67('0x11f')])?_0x39adb4['Trunk']['callerid']:_0x39adb4[_0xbd67('0x11f')][_0xbd67('0x12a')],_0x39adb4[_0xbd67('0x37')],_0x39adb4[_0xbd67('0x12b')]>0x0?ut['getCallerIdRandom'](_0x39adb4['dialOriginateCallerIdNumber'],_0x39adb4[_0xbd67('0x12b')]):_0x39adb4['dialOriginateCallerIdNumber']);if(_0x5da307){_0x21c0ce[_0xbd67('0x12e')]=ut[_0xbd67('0x12f')](_0x5da307);_0x21c0ce[_0xbd67('0x130')]=ut['extractCalleridNumber'](_0x5da307);}var _0x4b7be0=ut[_0xbd67('0x131')](_0x39adb4,_0x2e7836,_0x22edee,_0x5da307,_0x3758ee,_0x21c0ce);_[_0xbd67('0x132')](_0x21c0ce,ut['toLowerVariables'](_0x4b7be0));_0x21c0ce[_0xbd67('0x8f')]=moment()[_0xbd67('0x57')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0xbd67('0x78')](ut[_0xbd67('0x133')](_0x21c0ce,_0x39adb4,_0x4b7be0,_0x21c0ce[_0xbd67('0xcc')],_0x90a25c))[_0xbd67('0x83')](function(_0x51047b){_0x39adb4[_0xbd67('0x4e')]+=0x1;logger['info'](_0xbd67('0x134'),_0x3758ee,'\x20Queue',_0x39adb4['name'],_0xbd67('0x6f'),_0x39adb4[_0xbd67('0x4e')]);_0x566eb4(_0x51047b);})[_0xbd67('0x8d')](function(_0x184fb2){ut['logAgent'](_0x21c0ce,0xe,'OriginateError');rpcDb['createAgentHistory'](_0x21c0ce,_0xbd67('0x135'));_0xa545b(_0x184fb2);});});};Preview[_0xbd67('0xf')][_0xbd67('0x22')]=function(_0x290f6f){if(this[_0xbd67('0x17')][_0x290f6f[_0xbd67('0xaf')]]){this[_0xbd67('0x17')][_0x290f6f['linkedid']]['channel']=_0x290f6f['channel'];}};Preview[_0xbd67('0xf')]['syncOriginateResponse']=function(_0x59dcd4){var _0x2ddf55=this;var _0x51b04e=this[_0xbd67('0x17')][_0x59dcd4[_0xbd67('0x136')]];if(_0x51b04e){if(_0x51b04e[_0xbd67('0xff')]&&this['agents'][_0x51b04e[_0xbd67('0xff')]]){ut[_0xbd67('0x137')](_0x51b04e,this[_0xbd67('0x18')][_0x51b04e[_0xbd67('0xff')]][_0xbd67('0x29')],this['agents'][_0x51b04e[_0xbd67('0xff')]]['id']);}var _0x2bd260=_['clone'](_0x51b04e);_0x2bd260[_0xbd67('0xb1')]=moment()[_0xbd67('0x57')](_0xbd67('0x90'));var _0x14a2e0=_0x2ddf55[_0xbd67('0x14')][_0x51b04e[_0xbd67('0x70')]];if(ut[_0xbd67('0x138')](_0x59dcd4[_0xbd67('0x139')])){if(_0x51b04e['unlockAgent']){rpcDb['unlockContact'](_0x51b04e['idContact']);}if(_0x51b04e[_0xbd67('0xcc')]){rpcDb[_0xbd67('0x8e')](_0x51b04e[_0xbd67('0x13a')]);}ami[_0xbd67('0x27')]('custom:agentringnoanswer',ut[_0xbd67('0xa3')](_0x51b04e,_0xbd67('0x13b'),this[_0xbd67('0x14')][_0x51b04e[_0xbd67('0x70')]]));this[_0xbd67('0xee')](_0x2bd260,_0x14a2e0,_0x59dcd4);}else{_0x51b04e['starttime']=moment()[_0xbd67('0x57')](_0xbd67('0x90'));ut['logAgent'](_0x2bd260,0x4,_0xbd67('0xba'));rpcDb['createAgentHistory'](_0x2bd260,_0xbd67('0x13c'));}}};Preview[_0xbd67('0xf')]['syncHangup']=function(_0x14e960){var _0x493c94=this;var _0x351cbe=this[_0xbd67('0x17')][_0x14e960[_0xbd67('0xaf')]];var _0x2b3212;if(_0x351cbe){_0x2b3212=this[_0xbd67('0x14')][_0x351cbe[_0xbd67('0x70')]];logger[_0xbd67('0x5a')](_0xbd67('0x13d'),_0x14e960[_0xbd67('0xaf')],_0xbd67('0xb3'),_0x2b3212['name'],_0xbd67('0x71'),_0x2b3212[_0xbd67('0x2e')]);}if(this['actions'][_0x14e960['linkedid']]&&_0x14e960[_0xbd67('0xaf')]!==_0x14e960[_0xbd67('0xb2')]){if(_0x14e960['cause']==='16'&&this[_0xbd67('0x17')][_0x14e960[_0xbd67('0xaf')]]['dialAnswer']){this[_0xbd67('0x9f')](_0x14e960,_0x14e960['linkedid'],_0x14e960[_0xbd67('0x13e')]);}else if(this[_0xbd67('0x17')][_0x14e960[_0xbd67('0xaf')]][_0xbd67('0x72')]){logger['info'](_0xbd67('0x13f'),_0x14e960[_0xbd67('0xaf')],_0x14e960[_0xbd67('0x13e')],_0xbd67('0xb3'),_0x2b3212[_0xbd67('0x29')],_0xbd67('0x71'),_0x2b3212[_0xbd67('0x2e')]);this[_0xbd67('0x9f')](_0x14e960,_0x14e960['linkedid'],_0x14e960[_0xbd67('0x13e')]);}}else if(_0x351cbe&&_['isNil'](_0x351cbe[_0xbd67('0x140')])&&_0x2b3212[_0xbd67('0x141')]&&_0x14e960[_0xbd67('0xaf')]===_0x14e960[_0xbd67('0xb2')]&&_[_0xbd67('0x84')](_0x14e960[_0xbd67('0xf1')])&&_0x14e960[_0xbd67('0x13e')]==='16'&&_0x14e960[_0xbd67('0x142')]==='6'&&_[_0xbd67('0xef')](_0x351cbe[_0xbd67('0x143')])){if(_0x351cbe[_0xbd67('0xae')]){rpcDb[_0xbd67('0x10c')](_0x351cbe[_0xbd67('0x13a')]);}if(_0x351cbe[_0xbd67('0xcc')]){rpcDb['disableContact'](_0x351cbe['idContact']);}_0x14e960['reason']='22';this['callProgressDetectingAgent'](_0x351cbe,_0x2b3212,_0x14e960);}else if(_0x351cbe&&_0x351cbe[_0xbd67('0x143')]){if(_0x14e960[_0xbd67('0x13e')]==='16'&&this[_0xbd67('0x17')][_0x14e960[_0xbd67('0xaf')]]['dialAnswer']){logger[_0xbd67('0x5a')](_0xbd67('0x144'),_0x14e960[_0xbd67('0xaf')],_0x14e960[_0xbd67('0x13e')],'\x20Queue',_0x2b3212[_0xbd67('0x29')],'pTalking:\x20',_0x2b3212['pTalking']);this[_0xbd67('0x9f')](_0x14e960,_0x14e960[_0xbd67('0xaf')],_0x14e960[_0xbd67('0x13e')]);}else if(this[_0xbd67('0x17')][_0x14e960['linkedid']][_0xbd67('0x72')]){logger['info'](_0xbd67('0x13f'),_0x14e960[_0xbd67('0xaf')],_0x14e960[_0xbd67('0x13e')],_0xbd67('0xb3'),_0x2b3212[_0xbd67('0x29')],'pTalking:\x20',_0x2b3212[_0xbd67('0x2e')]);this[_0xbd67('0x9f')](_0x14e960,_0x14e960['linkedid'],_0x14e960['cause']);}}};Preview['prototype'][_0xbd67('0x145')]=function(_0x33c787){if(this[_0xbd67('0x17')][_0x33c787['destlinkedid']]&&_0x33c787[_0xbd67('0x146')]!==_0x33c787['destuniqueid']){this[_0xbd67('0x9f')](_0x33c787,_0x33c787['destlinkedid'],_0x33c787['dialstatus']);}};Preview[_0xbd67('0xf')]['syncHangupRequest']=function(_0x51fa0c){if(this['actions'][_0x51fa0c[_0xbd67('0xaf')]]&&_0x51fa0c[_0xbd67('0xaf')]!==_0x51fa0c[_0xbd67('0xb2')]&&!this['actions'][_0x51fa0c[_0xbd67('0xaf')]][_0xbd67('0x72')]){if(_0x51fa0c[_0xbd67('0x13e')]==='1'){this[_0xbd67('0x9f')](_0x51fa0c,_0x51fa0c['linkedid'],_0x51fa0c[_0xbd67('0x13e')]);}}};Preview['prototype'][_0xbd67('0x147')]=function(_0xf4ad5e,_0x1ddeab,_0x4913b7){if(this[_0xbd67('0x17')][_0xf4ad5e]){if(_[_0xbd67('0x84')](this[_0xbd67('0x17')][_0xf4ad5e][_0xbd67('0x148')])){this[_0xbd67('0x17')][_0xf4ad5e][_0xbd67('0x148')]={};}this[_0xbd67('0x17')][_0xf4ad5e][_0xbd67('0x148')][_0x1ddeab]=_0x4913b7;}};Preview['prototype']['syncVarSet']=function(_0xa693c5){try{if(!_[_0xbd67('0x84')](_0xa693c5)){if(ut[_0xbd67('0x149')](_[_0xbd67('0x14a')](_0xa693c5[_0xbd67('0x14b')])[0x0])){this[_0xbd67('0x147')](_0xa693c5[_0xbd67('0xb2')],_[_0xbd67('0x14a')](_0xa693c5[_0xbd67('0x14b')])[0x0],_0xa693c5[_0xbd67('0x14c')]);}}}catch(_0x5e97db){logger[_0xbd67('0x14d')](_0xbd67('0x14e'),util[_0xbd67('0x14f')](_0x5e97db,{'showHidden':![],'depth':null}));}};Preview[_0xbd67('0xf')]['syncAttendedTransfer']=function(_0x5932eb){if(_0x5932eb){if(this[_0xbd67('0x17')][_0x5932eb[_0xbd67('0x150')]]){this[_0xbd67('0x17')][_0x5932eb['transfertargetlinkedid']][_0xbd67('0x143')]=!![];}}};Preview[_0xbd67('0xf')][_0xbd67('0x25')]=function(_0x50c87c){if(_0x50c87c){if(this['actions'][_0x50c87c[_0xbd67('0x151')]]){this[_0xbd67('0x17')][_0x50c87c[_0xbd67('0x151')]][_0xbd67('0x143')]=!![];}}};module[_0xbd67('0x152')]=Preview; \ No newline at end of file +var _0x5ad3=['Busy','custom:agentbusy','busy','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','scheduledAt','dialBusyRetryFrequency','unlockAgent','NOANSWER','countnoanswerretry','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','countcongestionretry','Congestion','custom:agentcongestion','congestion','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','destlinkedid','isUndefined','object','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','checkInBlack','Contact','phone','lookAgent','then','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','validateContact','checkIsBlackList','Contact.phone','[Preview][getContactPreview]','Call\x20unsuccessful','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','TrunkBackup','[Preview][validateContact][Trunk\x20not\x20work]','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','trim','dialCutDigit','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','extractCalleridName','originatecalleridnum','merge','toLowerVariables','Action','variablesAction','[originateFailure][logOriginateFailure]','syncOriginateResponse','actionid','logLookAgent','isFailure','response','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','dialQueueProject','channelstate','transfer','disableContact','[syncHangup][talking][transfer]','variables','filterKey','keys','variable','addVariable','value','inspect','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','util','lodash','bluebird','uuid','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','redis','defaults','socket.io-emitter','enqueue','tail','sequence','campaignsPreview','trunks','agents','clockClearZombieChannels','originateresponse','bind','hangup','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','syncAttendedTransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','available','loggedIn','sumBillable','sumDuration','talking','total','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoSuchCallsDay','outboundReCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','message','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','pTalking','paused','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','logger','\x20is\x20disactive','prototype','syncCampaigns','hasOwnProperty','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','actions','[clearZombieChannels][talking]','Queue','queue','stringify','pick','UserId','VoiceQueueId','ListId','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','loggerError','[Dialer][checkChannel][Preview]','[action]','getContactRecallMe','agentReadyId','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','createCustomerFinal','IsNotLoggedIn','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','custom:agentnosuchnumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','totalGlobal','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','rescheduleContact','dialNoSuchNumberRetryFrequency','activeContact','ANSWER','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','pTalking:\x20','connect','acw','custom:agentConnectPreview','buildAcw','complete','outboundAnswerCallsDay','decrementTalkink','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','linkedid','countbusyretry'];(function(_0x510eec,_0xbac291){var _0x35d729=function(_0x5526d4){while(--_0x5526d4){_0x510eec['push'](_0x510eec['shift']());}};_0x35d729(++_0xbac291);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x4c80d7,_0x2bef29){_0x4c80d7=_0x4c80d7-0x0;var _0x3c5095=_0x5ad3[_0x4c80d7];return _0x3c5095;};'use strict';var util=require(_0x35ad('0x0'));var _=require(_0x35ad('0x1'));var BPromise=require(_0x35ad('0x2'));var uuid=require(_0x35ad('0x3'));var moment=require('moment');var md5=require(_0x35ad('0x4'));var Redis=require(_0x35ad('0x5'));var config=require(_0x35ad('0x6'));var logger=require(_0x35ad('0x7'))(_0x35ad('0x8'));var loggerAction=require(_0x35ad('0x7'))(_0x35ad('0x9'));var ami=require(_0x35ad('0xa'));var rpcDb=require(_0x35ad('0xb'));var Action=require(_0x35ad('0xc'));var ut=require('./util/util');config[_0x35ad('0xd')]=_[_0x35ad('0xe')](config[_0x35ad('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0x35ad('0xf'))(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype'][_0x35ad('0x10')]=function(_0x3e9830){this['tail']=this[_0x35ad('0x11')]?this[_0x35ad('0x11')]['finally'](_0x3e9830):_0x3e9830();};function Preview(_0x4b31a1){this[_0x35ad('0x12')]=new Sequence();this[_0x35ad('0x13')]=_0x4b31a1['voiceQueues'];this[_0x35ad('0x14')]=_0x4b31a1[_0x35ad('0x14')];this['actions']={};this['agents']=_0x4b31a1[_0x35ad('0x15')];this[_0x35ad('0x16')]=0x0;ami['on'](_0x35ad('0x17'),this['syncOriginateResponse'][_0x35ad('0x18')](this));ami['on'](_0x35ad('0x19'),this['syncHangup'][_0x35ad('0x18')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0x35ad('0x18')](this));ami['on'](_0x35ad('0x1a'),this[_0x35ad('0x1b')]['bind'](this));ami['on'](_0x35ad('0x1c'),this[_0x35ad('0x1d')][_0x35ad('0x18')](this));ami['on'](_0x35ad('0x1e'),this[_0x35ad('0x1f')][_0x35ad('0x18')](this));ami['on']('attendedtransfer',this[_0x35ad('0x20')][_0x35ad('0x18')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x35ad('0x18')](this));this[_0x35ad('0x21')](this['campaignsPreview']);}function emit(_0x21f611,_0x32735e,_0x496620){io['to'](_0x21f611)[_0x35ad('0x22')](_0x32735e,_0x496620);}function emitCampaignPreview(_0x40e5e8){if(_0x40e5e8[_0x35ad('0x23')]===_0x35ad('0x24')){var _0x1be6d2={'id':_0x40e5e8['id'],'name':_0x40e5e8[_0x35ad('0x25')],'strategy':_0x40e5e8[_0x35ad('0x26')],'answered':_0x40e5e8[_0x35ad('0x27')],'available':_0x40e5e8[_0x35ad('0x28')],'loggedIn':_0x40e5e8[_0x35ad('0x29')],'pTalking':_0x40e5e8['pTalking'],'sumBillable':_0x40e5e8[_0x35ad('0x2a')],'sumDuration':_0x40e5e8[_0x35ad('0x2b')],'sumHoldTime':_0x40e5e8['sumHoldTime']||0x0,'talking':_0x40e5e8[_0x35ad('0x2c')],'total':_0x40e5e8[_0x35ad('0x2d')],'type':_0x40e5e8[_0x35ad('0x23')],'unmanaged':_0x40e5e8[_0x35ad('0x2e')],'abandoned':_0x40e5e8[_0x35ad('0x2f')],'waiting':_0x40e5e8['waiting'],'loggedInDb':_0x40e5e8[_0x35ad('0x30')],'dialActive':_0x40e5e8[_0x35ad('0x31')],'dialMethod':_0x40e5e8[_0x35ad('0x32')],'dialOriginateCallerIdName':_0x40e5e8[_0x35ad('0x33')],'dialOriginateCallerIdNumber':_0x40e5e8[_0x35ad('0x34')],'dialOriginateTimeout':_0x40e5e8[_0x35ad('0x35')],'dialPrefix':_0x40e5e8[_0x35ad('0x36')],'outboundAnswerAgiCallsDay':_0x40e5e8[_0x35ad('0x37')],'outboundAnswerCallsDay':_0x40e5e8['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x40e5e8[_0x35ad('0x38')],'outboundBusyCallsDay':_0x40e5e8[_0x35ad('0x39')],'outboundCongestionCallsDay':_0x40e5e8[_0x35ad('0x3a')],'outboundDropCallsDayACS':_0x40e5e8[_0x35ad('0x3b')],'outboundDropCallsDayCallersExit':_0x40e5e8[_0x35ad('0x3c')],'outboundDropCallsDayTimeout':_0x40e5e8['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x40e5e8['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x40e5e8[_0x35ad('0x3d')],'outboundOriginateFailureCallsDay':_0x40e5e8['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x40e5e8[_0x35ad('0x3e')],'outboundRejectCallsDay':_0x40e5e8['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x40e5e8['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x40e5e8['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x40e5e8['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x40e5e8[_0x35ad('0x3f')],'predictiveIntervalAvgTalktime':_0x40e5e8['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x40e5e8['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x40e5e8[_0x35ad('0x40')],'predictiveIntervalErlangCalls':_0x40e5e8['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x40e5e8[_0x35ad('0x41')],'predictiveIntervalHitRate':_0x40e5e8['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x40e5e8[_0x35ad('0x42')],'predictiveIntervalPauses':_0x40e5e8['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x40e5e8[_0x35ad('0x43')],'predictiveIntervalTotalCalls':_0x40e5e8['predictiveIntervalTotalCalls'],'message':_0x40e5e8[_0x35ad('0x44')],'originated':_0x40e5e8[_0x35ad('0x45')],'erlangCalls':_0x40e5e8[_0x35ad('0x46')],'erlangCallToSecond':_0x40e5e8['erlangCallToSecond'],'erlangAbandonmentRate':_0x40e5e8[_0x35ad('0x47')],'erlangBusyFactor':_0x40e5e8[_0x35ad('0x48')],'startPredictive':_0x40e5e8[_0x35ad('0x49')],'startProgressive':_0x40e5e8[_0x35ad('0x4a')]};if(_0x40e5e8[_0x35ad('0x4b')]){_0x1be6d2['Trunk']={'id':_0x40e5e8['Trunk']['id'],'name':_0x40e5e8[_0x35ad('0x4b')][_0x35ad('0x25')],'active':_0x40e5e8[_0x35ad('0x4b')][_0x35ad('0x4c')],'callerid':_0x40e5e8['Trunk'][_0x35ad('0x4d')]};}if(_0x40e5e8[_0x35ad('0x4e')]){_0x1be6d2[_0x35ad('0x4e')]={'id':_0x40e5e8[_0x35ad('0x4e')]['id'],'name':_0x40e5e8[_0x35ad('0x4e')][_0x35ad('0x25')]};}var _0x49c33d=md5(JSON['stringify'](_0x1be6d2));if(_0x40e5e8[_0x35ad('0x4')]!==_0x49c33d){_0x40e5e8[_0x35ad('0x4')]=_0x49c33d;emit(util[_0x35ad('0x4f')](_0x35ad('0x50'),_0x1be6d2[_0x35ad('0x25')]),_0x35ad('0x51'),_0x1be6d2);}}}function emitVoiceQueueChannelRemove(_0x11e7e2){logger[_0x35ad('0x52')](_0x35ad('0x53'),JSON['stringify'](_0x11e7e2));emit(util[_0x35ad('0x4f')]('voice:queue:%s',_0x11e7e2[_0x35ad('0x25')]),_0x35ad('0x54'),_0x11e7e2);io[_0x35ad('0x22')](_0x35ad('0x55'),_0x11e7e2);}function notSendMessagesQueue(_0x1ad7e6){if(_0x1ad7e6[_0x35ad('0x56')]){if(_0x1ad7e6[_0x35ad('0x45')]===0x0&&_0x1ad7e6[_0x35ad('0x57')]===0x0){_0x1ad7e6[_0x35ad('0x56')]=![];_0x1ad7e6['available']=0x0;_0x1ad7e6[_0x35ad('0x58')]=0x0;_0x1ad7e6[_0x35ad('0x44')]=_0x35ad('0x59');ut['logger'](_0x35ad('0x5a'),_0x1ad7e6[_0x35ad('0x25')]+_0x35ad('0x5b'));}else{_0x1ad7e6[_0x35ad('0x44')]=_0x35ad('0x5c');ut[_0x35ad('0x5d')](_0x35ad('0x5a'),_0x1ad7e6[_0x35ad('0x25')]+_0x35ad('0x5e'));}emitCampaignPreview(_0x1ad7e6);}}Preview[_0x35ad('0x5f')][_0x35ad('0x21')]=function(){var _0x557bf4=this;setInterval(function(){_0x557bf4[_0x35ad('0x60')]();},0x7cf);};Preview['prototype'][_0x35ad('0x60')]=function(){var _0x3b80c0=this[_0x35ad('0x13')];this[_0x35ad('0x16')]+=0x1;for(var _0x1785b5 in _0x3b80c0){if(_0x3b80c0[_0x35ad('0x61')](_0x1785b5)&&(_0x3b80c0[_0x1785b5][_0x35ad('0x32')]===_0x35ad('0x8')||_0x3b80c0[_0x1785b5][_0x35ad('0x32')]==='booked')&&_0x3b80c0[_0x1785b5][_0x35ad('0x23')]===_0x35ad('0x24')){if(this[_0x35ad('0x16')]>0x7){this[_0x35ad('0x16')]=0x0;this[_0x35ad('0x62')]();}}if(_0x3b80c0['hasOwnProperty'](_0x1785b5)&&_0x3b80c0[_0x1785b5][_0x35ad('0x32')]===_0x35ad('0x8')&&_0x3b80c0[_0x1785b5]['type']==='outbound'){if(_0x3b80c0[_0x1785b5][_0x35ad('0x31')]){this[_0x35ad('0x63')](_0x3b80c0[_0x1785b5]);if(_0x3b80c0[_0x1785b5][_0x35ad('0x64')])this[_0x35ad('0x65')](_0x3b80c0[_0x1785b5]);}else{notSendMessagesQueue(_0x3b80c0[_0x1785b5]);}}}};Preview['prototype'][_0x35ad('0x66')]=function(_0x1e3794){var _0x3c148a=this;this[_0x35ad('0x12')][_0x35ad('0x10')](function(){if(!_[_0x35ad('0x67')](_0x3c148a[_0x35ad('0x68')][_0x1e3794])){loggerAction['info'](_0x35ad('0x69'),_0x1e3794,_0x35ad('0x6a'),_0x3c148a[_0x35ad('0x68')][_0x1e3794]['queue'],'originated:\x20',JSON['stringify'](_0x3c148a[_0x35ad('0x13')][_0x3c148a[_0x35ad('0x68')][_0x1e3794][_0x35ad('0x6b')]][_0x35ad('0x45')]),'pTalking:\x20',JSON[_0x35ad('0x6c')](_0x3c148a[_0x35ad('0x13')][_0x3c148a[_0x35ad('0x68')][_0x1e3794][_0x35ad('0x6b')]][_0x35ad('0x57')]),JSON[_0x35ad('0x6c')](_0x3c148a['actions'][_0x1e3794]['dialAnswer']),JSON[_0x35ad('0x6c')](_[_0x35ad('0x6d')](_0x3c148a['actions'][_0x1e3794],['contactId',_0x35ad('0x6e'),_0x35ad('0x6f'),_0x35ad('0x70')])));return ami['Action']({'action':'status','channel':_0x3c148a[_0x35ad('0x68')][_0x1e3794][_0x35ad('0x71')]})[_0x35ad('0x72')](function(_0x5a8155){if(_0x5a8155[_0x35ad('0x44')]===_0x35ad('0x73')){setTimeout(function(){if(_0x3c148a[_0x35ad('0x68')][_0x1e3794]){ut[_0x35ad('0x74')](_0x3c148a[_0x35ad('0x13')][_0x3c148a[_0x35ad('0x68')][_0x1e3794]['queue']],_0x35ad('0x75'));if(_0x3c148a[_0x35ad('0x68')][_0x1e3794][_0x35ad('0x76')]===!![]){ut['decrementTalkink'](_0x3c148a[_0x35ad('0x13')][_0x3c148a[_0x35ad('0x68')][_0x1e3794][_0x35ad('0x6b')]],_0x35ad('0x75'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x1e3794,_0x3c148a[_0x35ad('0x68')][_0x1e3794][_0x35ad('0x6b')]);}ut[_0x35ad('0x77')](_0x35ad('0x78')+_0x1e3794,_0x3c148a[_0x35ad('0x68')][_0x1e3794]['queue']);delete _0x3c148a[_0x35ad('0x68')][_0x1e3794];}},0x2328);}});}});};Preview[_0x35ad('0x5f')][_0x35ad('0x62')]=function(){var _0xae2c85=this;loggerAction[_0x35ad('0x52')](_0x35ad('0x79'),_['size'](this['actions']));for(var _0x33da9c in this[_0x35ad('0x68')]){if(_0xae2c85[_0x35ad('0x68')][_0x35ad('0x61')](_0x33da9c)){_0xae2c85[_0x35ad('0x66')](_0x33da9c);}}};Preview[_0x35ad('0x5f')][_0x35ad('0x65')]=function(_0x5cef35){var _0x1da9a7=this;rpcDb[_0x35ad('0x7a')](_0x5cef35['id'],ut[_0x35ad('0x7b')](this[_0x35ad('0x15')]))['then'](function(_0x12735e){if(!_[_0x35ad('0x67')](_0x12735e)){for(var _0x4baa80=0x0;_0x4baa80<_0x12735e[_0x35ad('0x7c')];_0x4baa80+=0x1){if(ut[_0x35ad('0x7d')](_0x12735e[_0x4baa80][_0x35ad('0x7e')])<_0x5cef35[_0x35ad('0x7f')]*0x3c){if(_0x12735e[_0x4baa80][_0x35ad('0x80')]&&!_0x12735e[_0x4baa80][_0x35ad('0x80')][_0x35ad('0x81')]){_0x1da9a7[_0x35ad('0x82')](_0x12735e[_0x4baa80]['id'])['then'](ut[_0x35ad('0x83')](_0x35ad('0x84')))[_0x35ad('0x72')](ut['logger2'](_0x35ad('0x84')));}else{rpcDb['disableContact'](_0x12735e[_0x4baa80]['id']);}}else{var _0x24cfdc=new Action(_0x12735e[_0x4baa80],_0x5cef35);_0x24cfdc[_0x35ad('0x85')]=moment()[_0x35ad('0x4f')](_0x35ad('0x86'));_0x5cef35['outboundReCallsDay']+=0x1;ut[_0x35ad('0x87')](_0x24cfdc,0x17,_0x35ad('0x88'));if(_0x5cef35[_0x35ad('0x89')]){rpcDb[_0x35ad('0x8a')](ut[_0x35ad('0x8b')](_0x12735e[_0x4baa80]));rpcDb['createCustomerHistory'](_0x24cfdc,_0x35ad('0x8c'));}else{ut['logCustomer'](_0x24cfdc,0x16,_0x35ad('0x8d'));rpcDb[_0x35ad('0x8e')](_0x24cfdc,'[HistoryRecallClose]');rpcDb[_0x35ad('0x8f')](_0x24cfdc,'[HistoryRecallClose]');}}}}})[_0x35ad('0x72')](ut[_0x35ad('0x83')]('[getContactRecallMe]'));};Preview[_0x35ad('0x5f')][_0x35ad('0x63')]=function(_0x39f642){_0x39f642[_0x35ad('0x56')]=!![];if(ut[_0x35ad('0x90')](_0x39f642[_0x35ad('0x29')])){_0x39f642[_0x35ad('0x44')]='AGENTS_NOT_LOGGED';}else if(!ut[_0x35ad('0x91')](_0x39f642[_0x35ad('0x31')])){_0x39f642[_0x35ad('0x44')]=_0x35ad('0x59');}else if(!this[_0x35ad('0x92')](_0x39f642[_0x35ad('0x4b')])){if(!this[_0x35ad('0x92')](_0x39f642['TrunkBackup'])){_0x39f642[_0x35ad('0x44')]=_0x35ad('0x93');}else{_0x39f642[_0x35ad('0x44')]=_0x35ad('0x94');}}else{_0x39f642[_0x35ad('0x44')]='ACTIVE';}emitCampaignPreview(_0x39f642);};Preview[_0x35ad('0x5f')][_0x35ad('0x95')]=function(_0x5b8b1d,_0x139a89,_0x2265f7){var _0x891ab4=this;var _0x286543=this['actions'][_0x139a89];var _0x351f14=this['campaignsPreview'][_0x286543[_0x35ad('0x6b')]];var _0x468331;if(_0x351f14){switch(_0x2265f7){case'1':_0x351f14[_0x35ad('0x3d')]+=0x1;_0x286543['countnosuchnumberretry']+=0x1;_0x286543[_0x35ad('0x96')]=ut['totalGlobal'](_0x286543);ut[_0x35ad('0x87')](_0x286543,0x0,'NoSuchNumber');ami['emit'](_0x35ad('0x97'),ut[_0x35ad('0x98')](_0x286543,'nosuchnumber'));rpcDb[_0x35ad('0x8e')](_0x286543,_0x35ad('0x99'));if(ut[_0x35ad('0x9a')](_0x286543)>=_0x351f14['dialGlobalMaxRetry']){_0x468331=ut['cloneAction'](_0x286543,0xf,'Global');rpcDb['createCustomerFinal'](_0x468331,_0x35ad('0x9b'));}else{if(_0x286543[_0x35ad('0x9c')]>=_0x351f14[_0x35ad('0x9d')]){rpcDb[_0x35ad('0x8f')](_0x286543,_0x35ad('0x9b'));}else{rpcDb[_0x35ad('0x9e')](ut['scheduledAt'](_0x286543,_0x35ad('0x9c'),_0x351f14[_0x35ad('0x9f')]),_0x286543['unlockAgent'],_0x286543[_0x35ad('0xa0')]);}}delete this[_0x35ad('0x68')][_0x5b8b1d['linkedid']];break;case _0x35ad('0xa1'):var _0x31f8bb=moment()[_0x35ad('0x4f')](_0x35ad('0x86'));_0x286543['responsetime']=_0x31f8bb;_0x286543[_0x35ad('0xa2')]=_0x31f8bb;_0x286543[_0x35ad('0x76')]=!![];_0x351f14[_0x35ad('0x57')]+=0x1;logger[_0x35ad('0x52')](_0x35ad('0xa3'),_0x286543[_0x35ad('0xa4')],_0x35ad('0xa5'),_0x351f14[_0x35ad('0x25')],_0x35ad('0xa6'),_0x351f14[_0x35ad('0x57')]);ami['emit']('custom:agentconnect',ut[_0x35ad('0x98')](_0x286543,_0x35ad('0xa7'),this['campaignsPreview'][_0x286543[_0x35ad('0x6b')]]));if(_0x351f14[_0x35ad('0xa8')]){ami[_0x35ad('0x22')](_0x35ad('0xa9'),ut[_0x35ad('0xaa')](_0x286543));}break;case'16':ami[_0x35ad('0x22')]('custom:agentcomplete',ut[_0x35ad('0x98')](_0x286543,_0x35ad('0xab'),this[_0x35ad('0x13')][_0x286543[_0x35ad('0x6b')]]));emitVoiceQueueChannelRemove(ut[_0x35ad('0x98')](_0x286543,_0x35ad('0xab')));_0x351f14[_0x35ad('0xac')]+=0x1;_0x351f14[_0x35ad('0x2d')]+=0x1;_0x351f14['answered']+=0x1;ut[_0x35ad('0xad')](_0x351f14,_0x35ad('0xae'));_0x286543[_0x35ad('0x96')]=ut[_0x35ad('0x9a')](_0x286543);ut['logCustomer'](_0x286543,0x4,_0x35ad('0xaf'));rpcDb['createCustomerHistory'](_0x286543,_0x35ad('0xb0'));rpcDb['createCustomerFinal'](_0x286543,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x35ad('0xb1')](_0x286543);_0x351f14[_0x35ad('0x2b')]+=_0x286543[_0x35ad('0xb2')];_0x351f14['sumBillable']+=_0x286543[_0x35ad('0xb2')];logger['info'](_0x35ad('0xb3'),_0x286543[_0x35ad('0xa4')],_0x35ad('0xa5'),_0x351f14[_0x35ad('0x25')],'pTalking:\x20',_0x351f14[_0x35ad('0x57')]);delete this['actions'][_0x5b8b1d[_0x35ad('0xb4')]];break;case'BUSY':_0x351f14[_0x35ad('0x39')]+=0x1;_0x286543[_0x35ad('0xb5')]+=0x1;_0x286543['countglobal']=ut['totalGlobal'](_0x286543);ut['logCustomer'](_0x286543,0x5,_0x35ad('0xb6'));ami[_0x35ad('0x22')](_0x35ad('0xb7'),ut[_0x35ad('0x98')](_0x286543,_0x35ad('0xb8')));rpcDb['createCustomerHistory'](_0x286543,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x35ad('0x9a')](_0x286543)>=_0x351f14['dialGlobalMaxRetry']){_0x468331=ut[_0x35ad('0xb9')](_0x286543,0xf,'Global');rpcDb[_0x35ad('0x8f')](_0x468331,_0x35ad('0xba'));}else{if(_0x286543[_0x35ad('0xb5')]>=_0x351f14[_0x35ad('0xbb')]){rpcDb['createCustomerFinal'](_0x286543,_0x35ad('0xbc'));}else{rpcDb[_0x35ad('0x9e')](ut[_0x35ad('0xbd')](_0x286543,_0x35ad('0xb5'),_0x351f14[_0x35ad('0xbe')]),_0x286543[_0x35ad('0xbf')],_0x286543[_0x35ad('0xa0')]);}}break;case _0x35ad('0xc0'):_0x351f14['outboundNoAnswerCallsDay']+=0x1;_0x286543[_0x35ad('0xc1')]+=0x1;_0x286543[_0x35ad('0x96')]=ut['totalGlobal'](_0x286543);ut['logCustomer'](_0x286543,0x3,'NoAnswer');ami[_0x35ad('0x22')](_0x35ad('0xc2'),ut[_0x35ad('0x98')](_0x286543,_0x35ad('0xc3')));rpcDb['createCustomerHistory'](_0x286543,_0x35ad('0xc4'));if(ut[_0x35ad('0x9a')](_0x286543)>=_0x351f14[_0x35ad('0xc5')]){_0x468331=ut[_0x35ad('0xb9')](_0x286543,0xf,_0x35ad('0xc6'));rpcDb[_0x35ad('0x8f')](_0x468331,_0x35ad('0xc7'));}else{if(_0x286543[_0x35ad('0xc1')]>=_0x351f14[_0x35ad('0xc8')]){rpcDb[_0x35ad('0x8f')](_0x286543,_0x35ad('0xc4'));}else{rpcDb['rescheduleContact'](ut[_0x35ad('0xbd')](_0x286543,_0x35ad('0xc1'),_0x351f14[_0x35ad('0xc9')]),_0x286543[_0x35ad('0xbf')],_0x286543[_0x35ad('0xa0')]);}}break;case'CONGESTION':_0x351f14['outboundCongestionCallsDay']+=0x1;_0x286543[_0x35ad('0xca')]+=0x1;_0x286543[_0x35ad('0x96')]=ut[_0x35ad('0x9a')](_0x286543);ut[_0x35ad('0x87')](_0x286543,0x8,_0x35ad('0xcb'));ami[_0x35ad('0x22')](_0x35ad('0xcc'),ut[_0x35ad('0x98')](_0x286543,_0x35ad('0xcd')));rpcDb[_0x35ad('0x8e')](_0x286543,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0x35ad('0x9a')](_0x286543)>=_0x351f14[_0x35ad('0xc5')]){_0x468331=ut[_0x35ad('0xb9')](_0x286543,0xf,_0x35ad('0xc6'));rpcDb[_0x35ad('0x8f')](_0x468331,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x286543[_0x35ad('0xca')]>=_0x351f14[_0x35ad('0xce')]){rpcDb[_0x35ad('0x8f')](_0x286543,_0x35ad('0xcf'));}else{rpcDb['rescheduleContact'](ut[_0x35ad('0xbd')](_0x286543,_0x35ad('0xca'),_0x351f14['dialBusyRetryFrequency']),_0x286543['unlockAgent'],_0x286543[_0x35ad('0xa0')]);}}break;case _0x35ad('0xd0'):_0x351f14['outboundRejectCallsDay']+=0x1;_0x286543[_0x35ad('0xd1')]+=0x1;_0x286543[_0x35ad('0x96')]=ut[_0x35ad('0x9a')](_0x286543);ut['logCustomer'](_0x286543,0x14,_0x35ad('0xd2'));ami['emit'](_0x35ad('0xd3'),ut['buildObj'](_0x286543,_0x35ad('0xd4')));rpcDb[_0x35ad('0x8e')](_0x286543,_0x35ad('0xd5'));if(ut[_0x35ad('0x9a')](_0x286543)>=_0x351f14[_0x35ad('0xc5')]){_0x468331=ut['cloneAction'](_0x286543,0x14,_0x35ad('0xd2'));rpcDb[_0x35ad('0x8f')](_0x468331,_0x35ad('0xd6'));}else{if(_0x286543[_0x35ad('0xd1')]>=_0x351f14['dialAgentRejectMaxRetry']){rpcDb['createCustomerFinal'](_0x286543,_0x35ad('0xd6'));}else{rpcDb['rescheduleContact'](ut[_0x35ad('0xbd')](_0x286543,'countagentrejectretry',_0x351f14[_0x35ad('0xd7')]),_0x286543['unlockAgent'],_0x286543['activeContact']);}}break;case _0x35ad('0xd8'):_0x351f14['outboundAbandonedCallsDay']+=0x1;_0x286543[_0x35ad('0xd9')]+=0x1;_0x286543[_0x35ad('0x96')]=ut[_0x35ad('0x9a')](_0x286543);ut[_0x35ad('0x87')](_0x286543,0xb,_0x35ad('0xda'));rpcDb[_0x35ad('0x8e')](_0x286543,_0x35ad('0xdb'));if(ut[_0x35ad('0x9a')](_0x286543)>=_0x351f14['dialGlobalMaxRetry']){_0x468331=ut[_0x35ad('0xb9')](_0x286543,0xf,_0x35ad('0xc6'));rpcDb[_0x35ad('0x8f')](_0x468331,_0x35ad('0xdb'));}else{if(_0x286543['countabandonedetry']>=_0x351f14[_0x35ad('0xdc')]){rpcDb[_0x35ad('0x8f')](_0x286543,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb['rescheduleContact'](ut[_0x35ad('0xbd')](_0x286543,_0x35ad('0xd9'),_0x351f14[_0x35ad('0xdd')]),_0x286543['unlockAgent'],_0x286543[_0x35ad('0xa0')]);}}break;case'18':_0x351f14['outboundUnknownCallsDay']+=0x1;_0x286543[_0x35ad('0xde')]+=0x1;_0x286543[_0x35ad('0x96')]=ut[_0x35ad('0x9a')](_0x286543);ut[_0x35ad('0x87')](_0x286543,0x12,_0x5b8b1d[_0x35ad('0xdf')]||_0x5b8b1d[_0x35ad('0xe0')]);ami[_0x35ad('0x22')](_0x35ad('0xe1'),ut[_0x35ad('0x98')](_0x286543,'amd'));rpcDb[_0x35ad('0x8e')](_0x286543,_0x35ad('0xe2'));if(ut[_0x35ad('0x9a')](_0x286543)>=_0x351f14['dialGlobalMaxRetry']){_0x468331=ut['cloneAction'](_0x286543,0xf,_0x35ad('0xc6'));rpcDb[_0x35ad('0x8f')](_0x468331,_0x35ad('0xe2'));}else{rpcDb[_0x35ad('0x8f')](_0x286543,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0x35ad('0x68')][_0x5b8b1d[_0x35ad('0xb4')]];break;case'19':_0x351f14[_0x35ad('0xe3')]+=0x1;_0x286543[_0x35ad('0x96')]=ut[_0x35ad('0x9a')](_0x286543);ut[_0x35ad('0x87')](_0x286543,0x13,_0x5b8b1d[_0x35ad('0xdf')]||_0x5b8b1d[_0x35ad('0xe0')]);ami[_0x35ad('0x22')](_0x35ad('0xe1'),ut['buildObj'](_0x286543,'amd'));rpcDb[_0x35ad('0x8e')](_0x286543,_0x35ad('0xe4'));if(ut[_0x35ad('0x9a')](_0x286543)>=_0x351f14[_0x35ad('0xc5')]){_0x468331=ut[_0x35ad('0xb9')](_0x286543,0xf,_0x35ad('0xc6'));rpcDb[_0x35ad('0x8f')](_0x468331,'[callProgressDetectingCustomer][machine]');}else{rpcDb['createCustomerFinal'](_0x286543,_0x35ad('0xe4'));}delete this[_0x35ad('0x68')][_0x5b8b1d['linkedid']];break;default:if(_0x286543['dialAnswer']){ut[_0x35ad('0xad')](_0x351f14,'[default]');ut[_0x35ad('0x77')](_0x35ad('0xe5')+_0x351f14[_0x35ad('0x25')],_0x5b8b1d);}_0x351f14['outboundUnknownCallsDay']+=0x1;_0x286543['countglobal']=ut['totalGlobal'](_0x286543);ut[_0x35ad('0x87')](_0x286543,0xc,_0x5b8b1d[_0x35ad('0xdf')]||_0x5b8b1d[_0x35ad('0xe0')]);rpcDb[_0x35ad('0x8e')](_0x286543,_0x35ad('0xe6'));if(ut[_0x35ad('0x9a')](_0x286543)>=_0x351f14[_0x35ad('0xc5')]){_0x468331=ut[_0x35ad('0xb9')](_0x286543,0xf,'Global');rpcDb[_0x35ad('0x8f')](_0x468331,_0x35ad('0xe7'));}else{rpcDb[_0x35ad('0x8f')](_0x286543,_0x35ad('0xe7'));}delete this['actions'][_0x5b8b1d[_0x35ad('0xb4')]];}if(!(_0x286543['dialAnswer']&&_0x2265f7==='16')){ut[_0x35ad('0x74')](_0x351f14,_0x35ad('0xe8'));logger[_0x35ad('0x52')](_0x35ad('0xe9'),_0x286543['uniqueid'],_0x35ad('0xa5'),_0x351f14[_0x35ad('0x25')],_0x35ad('0xea'),_0x351f14['originated']);}if(_0x2265f7!==_0x35ad('0xa1')){delete this[_0x35ad('0x68')][_0x5b8b1d[_0x35ad('0xb4')]];delete this[_0x35ad('0x68')][_0x5b8b1d[_0x35ad('0xeb')]];}}};Preview[_0x35ad('0x5f')]['callProgressDetectingAgent']=function(_0x333369,_0x22d76b,_0x1c2af7){if(_[_0x35ad('0xec')](_0x22d76b)&&_0x35ad('0xed')!==typeof _0x22d76b){return;}if(_[_0x35ad('0xec')](_0x1c2af7)&&_0x35ad('0xed')!==typeof _0x1c2af7){return;}switch(_0x1c2af7[_0x35ad('0xee')]){case'0':ut[_0x35ad('0xef')](_0x333369,0x0,_0x35ad('0xf0'));rpcDb[_0x35ad('0xf1')](_0x333369,_0x35ad('0xf2'));break;case'3':ut[_0x35ad('0xef')](_0x333369,0x3,_0x35ad('0xf3'));rpcDb[_0x35ad('0xf1')](_0x333369,_0x35ad('0xf4'));break;case'5':ut[_0x35ad('0xef')](_0x333369,0x5,'Busy');rpcDb[_0x35ad('0xf1')](_0x333369,_0x35ad('0xf5'));break;case'8':ut[_0x35ad('0xef')](_0x333369,0x8,_0x35ad('0xcb'));rpcDb[_0x35ad('0xf1')](_0x333369,_0x35ad('0xf6'));break;case'22':ut[_0x35ad('0xef')](_0x333369,0x16,_0x35ad('0xf7'));rpcDb[_0x35ad('0xf1')](_0x333369,_0x35ad('0xf8'));break;default:ut[_0x35ad('0xef')](_0x333369,0xc,_0x1c2af7['reason']);rpcDb[_0x35ad('0xf1')](_0x333369,'[callProgressDetectingAgent][logCongestion]');}ut[_0x35ad('0x74')](_0x22d76b,'[callProgressDetectingAgent]');logger[_0x35ad('0x52')]('[originated][decrement][callProgressDetectingAgent]',_0x333369[_0x35ad('0xa4')],_0x35ad('0xa5'),_0x22d76b[_0x35ad('0x25')],_0x35ad('0xea'),_0x22d76b[_0x35ad('0x45')]);delete this['actions'][_0x333369[_0x35ad('0xa4')]];};Preview[_0x35ad('0x5f')][_0x35ad('0xf9')]=function(_0xa95c70,_0x5b5c8f,_0x30c05e,_0x18aeb0,_0x35dbbe){var _0x502cba=this;return new BPromise(function(_0x4fa7df,_0x2cceb9){if(_[_0x35ad('0x67')](_0x5b5c8f)||_[_0x35ad('0x67')](_0x5b5c8f[_0x35ad('0xfa')])||_[_0x35ad('0x67')](_0x5b5c8f[_0x35ad('0xfa')][_0x35ad('0xfb')])||_[_0x35ad('0x67')](_0x5b5c8f['VoiceQueueId'])){_0x2cceb9(ut[_0x35ad('0x44')]('Contact\x20is\x20undefined',_0x18aeb0,_0x35dbbe));return;}var _0x420701=uuid['v4']();var _0x3a82bc=_0x502cba['campaignsPreview'][_0x5b5c8f['Queue'][_0x35ad('0x25')]];var _0x46ddb3=_0x30c05e?_0x502cba[_0x35ad('0x15')][_0x30c05e]['id']:undefined;_0x502cba['actions'][_0x420701]=new Action(_0x5b5c8f,_0x3a82bc,_0x420701,_0x30c05e,_0x46ddb3);var _0x23fe9b=_0x502cba['actions'][_0x420701];_0x23fe9b[_0x35ad('0xbf')]=_0x18aeb0;_0x23fe9b[_0x35ad('0xa0')]=_0x35dbbe;_0x23fe9b[_0x35ad('0xfc')]=_0x30c05e;if(_['isEmpty'](_0xa95c70)){_0x502cba['execCall'](_0x23fe9b,_0x3a82bc,_0x5b5c8f,_0x30c05e)[_0x35ad('0xfd')](function(_0x515b71){logger[_0x35ad('0x52')](_0x35ad('0xfe'),_0x35ad('0xff')+_0x23fe9b[_0x35ad('0x6b')]+_0x35ad('0x100')+_0x23fe9b[_0x35ad('0x101')],JSON[_0x35ad('0x6c')](_0x515b71));ami[_0x35ad('0x22')](_0x35ad('0x102'),ut[_0x35ad('0x98')](_0x23fe9b,_0x35ad('0x103'),_0x502cba[_0x35ad('0x13')][_0x23fe9b['queue']]));_0x4fa7df(ut[_0x35ad('0x44')](_0x35ad('0x104')));})[_0x35ad('0x72')](function(_0x181e1a){ut[_0x35ad('0x5d')](_0x35ad('0x105'),_0x181e1a);_0x2cceb9(ut[_0x35ad('0x44')](_0x35ad('0x106'),_0x18aeb0,_0x35dbbe));});}else{_0x3a82bc['outboundBlacklistCallsDay']+=0x1;ut[_0x35ad('0x107')](_0x23fe9b);rpcDb[_0x35ad('0x108')](_0x23fe9b,_0x35ad('0x109'));delete _0x502cba[_0x35ad('0x68')][_0x420701];_0x2cceb9(ut[_0x35ad('0x44')]('Contact\x20in\x20black\x20List',_0x18aeb0,_0x35dbbe));}});};Preview['prototype'][_0x35ad('0x92')]=function(_0x4e8ca9){return!_['isNil'](_0x4e8ca9)&&!_['isNil'](_0x4e8ca9[_0x35ad('0x25')])&&!_[_0x35ad('0x67')](_0x4e8ca9[_0x35ad('0x4c')])&&_0x4e8ca9[_0x35ad('0x4c')]&&!_[_0x35ad('0x67')](this[_0x35ad('0x14')][util[_0x35ad('0x4f')](_0x35ad('0x10a'),_0x4e8ca9[_0x35ad('0x25')])])&&!_[_0x35ad('0x67')](this[_0x35ad('0x14')][util['format'](_0x35ad('0x10a'),_0x4e8ca9[_0x35ad('0x25')])]['status'])&&(this['trunks'][util[_0x35ad('0x4f')](_0x35ad('0x10a'),_0x4e8ca9[_0x35ad('0x25')])][_0x35ad('0x10b')]===_0x35ad('0x10c')||this[_0x35ad('0x14')][util[_0x35ad('0x4f')](_0x35ad('0x10a'),_0x4e8ca9[_0x35ad('0x25')])][_0x35ad('0x10b')]===_0x35ad('0x10d'));};Preview[_0x35ad('0x5f')]['run']=function(_0x3f6b5d,_0x215096){var _0xdfc473=this;return new BPromise(function(_0x12f28e,_0x299c73){_0xdfc473[_0x35ad('0x10e')](_0x3f6b5d,_0x215096)[_0x35ad('0xfd')](function(_0x2af5ba){_0x12f28e(_['pick'](_0x2af5ba,[_0x35ad('0x44')]));})[_0x35ad('0x72')](function(_0x50cacb){if(_0x50cacb[_0x35ad('0x10f')]){rpcDb[_0x35ad('0x110')](_0x3f6b5d);}if(_0x50cacb[_0x35ad('0x4c')]){rpcDb['disableContact'](_0x3f6b5d);}_0x299c73(_['pick'](_0x50cacb,[_0x35ad('0x44')]));});});};Preview[_0x35ad('0x5f')][_0x35ad('0x10e')]=function(_0x21949f,_0x156de8){var _0x5038a5=this;return new BPromise(function(_0x1257da,_0x9d1163){var _0x1b8bc8,_0xba3bc8;rpcDb[_0x35ad('0x111')](_0x21949f)[_0x35ad('0xfd')](function(_0x39a1db){if(!_[_0x35ad('0x67')](_0x39a1db[0x0])){_0xba3bc8=_0x39a1db[0x0]['recallme']?![]:!![];_0x1b8bc8=_0x39a1db[0x0]['recallme']?!![]:![];_0x1b8bc8=_0x156de8?!![]:_0x1b8bc8;}var _0x9db0c8=_0x5038a5[_0x35ad('0x112')](_0x39a1db);if(_0x9db0c8['isValid']){rpcDb[_0x35ad('0x113')](_['pick'](_0x39a1db[0x0],[_0x35ad('0x6f'),_0x35ad('0x114')]))[_0x35ad('0xfd')](function(_0xbf8aea){_0x5038a5[_0x35ad('0xf9')](_0xbf8aea,_0x39a1db[0x0],_0x156de8,_0xba3bc8,_0x1b8bc8)[_0x35ad('0xfd')](function(_0x370db0){_0x1257da(_0x370db0);})[_0x35ad('0x72')](function(_0x1f0fcb){_0x9d1163(_0x1f0fcb);});})[_0x35ad('0x72')](function(_0x52f291){ut[_0x35ad('0x5d')]('[Preview][checkIsBlackList]',_0x52f291);_0x9d1163(ut['message']('Call\x20unsuccessful',_0xba3bc8,_0x1b8bc8));});}else{_0x9d1163(ut['message'](_0x9db0c8[_0x35ad('0x44')],_0xba3bc8,_0x1b8bc8));}})[_0x35ad('0x72')](function(_0x42929e){ut['logger'](_0x35ad('0x115'),_0x42929e);_0x9d1163(ut[_0x35ad('0x44')](_0x35ad('0x116'),![],!![]));});});};Preview[_0x35ad('0x5f')][_0x35ad('0x112')]=function(_0x5547a7){if(_[_0x35ad('0x67')](_0x5547a7)||_[_0x35ad('0x117')](_0x5547a7)||!_[_0x35ad('0x67')](_0x5547a7[0x0][_0x35ad('0x80')])&&_[_0x35ad('0x67')](_0x5547a7[0x0][_0x35ad('0x80')][_0x35ad('0x25')])){ut[_0x35ad('0x5d')](_0x35ad('0x118'),_0x5547a7);return{'isValid':![],'message':_0x35ad('0x119')};}var _0x17ed92=this[_0x35ad('0x13')][_0x5547a7[0x0][_0x35ad('0x6a')]['name']];_0x17ed92[_0x35ad('0x44')]='ACTIVE';if(_[_0x35ad('0x67')](_0x17ed92)){ut['logger'](_0x35ad('0x11a'),_0x17ed92);return{'isValid':![],'message':_0x35ad('0x11b')};}if(!this[_0x35ad('0x92')](_0x17ed92['Trunk'])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0x35ad('0x11c')+_0x17ed92['name']+'\x20Trunk\x20is\x20not\x20active');if(!this[_0x35ad('0x92')](_0x17ed92[_0x35ad('0x11d')])){ut[_0x35ad('0x5d')](_0x35ad('0x11e'),_0x17ed92[_0x35ad('0x25')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x35ad('0x11f')};}}if(!ut[_0x35ad('0x91')](_0x17ed92[_0x35ad('0x31')])){ut[_0x35ad('0x5d')](_0x35ad('0x120'),_0x17ed92[_0x35ad('0x25')]+'\x20Not\x20Active');return{'isValid':![],'message':_0x35ad('0x11c')+_0x17ed92[_0x35ad('0x25')]+_0x35ad('0x121')};}return{'isValid':!![],'message':_0x35ad('0x122')};};Preview[_0x35ad('0x5f')][_0x35ad('0x123')]=function(_0x5dc83e,_0xc77534,_0x2a59e3,_0x42a01){var _0x357f2d=this;return new BPromise(function(_0x30d3d6,_0x2e9350){var _0x47b122=_0x5dc83e['uniqueid'];var _0x44a6da=_0x357f2d[_0x35ad('0x92')](_0xc77534[_0x35ad('0x4b')])?util['format'](_0x35ad('0x124'),_0xc77534[_0x35ad('0x4b')][_0x35ad('0x25')],_[_0x35ad('0x67')](_0xc77534[_0x35ad('0x36')])?'':_0xc77534[_0x35ad('0x36')][_0x35ad('0x125')]()||'',_0xc77534['dialCutDigit']>0x0?_0x2a59e3['Contact']['phone']['substring'](_0xc77534[_0x35ad('0x126')]):_0x2a59e3[_0x35ad('0xfa')][_0x35ad('0xfb')]):util[_0x35ad('0x4f')]('SIP/%s/%s%s',_[_0x35ad('0x67')](_0xc77534[_0x35ad('0x11d')])?_0xc77534[_0x35ad('0x4b')][_0x35ad('0x25')]:_0xc77534[_0x35ad('0x11d')]['name'],_[_0x35ad('0x67')](_0xc77534[_0x35ad('0x36')])?'':_0xc77534[_0x35ad('0x36')]['trim']()||'',_0xc77534[_0x35ad('0x126')]>0x0?_0x2a59e3[_0x35ad('0xfa')][_0x35ad('0xfb')]['substring'](_0xc77534[_0x35ad('0x126')]):_0x2a59e3['Contact'][_0x35ad('0xfb')]);var _0xe23530=_0x357f2d[_0x35ad('0x92')](_0xc77534[_0x35ad('0x4b')])?ut[_0x35ad('0x127')](_0xc77534[_0x35ad('0x4b')]['callerid'],_0xc77534[_0x35ad('0x33')],_0xc77534[_0x35ad('0x128')]>0x0?ut[_0x35ad('0x129')](_0xc77534['dialOriginateCallerIdNumber'],_0xc77534['dialRandomLastDigitCallerIdNumber']):_0xc77534[_0x35ad('0x34')]):ut[_0x35ad('0x127')](_[_0x35ad('0x67')](_0xc77534[_0x35ad('0x11d')])?_0xc77534[_0x35ad('0x4b')][_0x35ad('0x4d')]:_0xc77534['TrunkBackup']['callerid'],_0xc77534['dialOriginateCallerIdName'],_0xc77534[_0x35ad('0x128')]>0x0?ut[_0x35ad('0x129')](_0xc77534[_0x35ad('0x34')],_0xc77534['dialRandomLastDigitCallerIdNumber']):_0xc77534['dialOriginateCallerIdNumber']);if(_0xe23530){_0x5dc83e['originatecalleridname']=ut[_0x35ad('0x12a')](_0xe23530);_0x5dc83e[_0x35ad('0x12b')]=ut['extractCalleridNumber'](_0xe23530);}var _0x2adf3b=ut['addVariables'](_0xc77534,_0x2a59e3,_0x44a6da,_0xe23530,_0x47b122,_0x5dc83e);_[_0x35ad('0x12c')](_0x5dc83e,ut[_0x35ad('0x12d')](_0x2adf3b));_0x5dc83e['starttime']=moment()[_0x35ad('0x4f')](_0x35ad('0x86'));ami[_0x35ad('0x12e')](ut[_0x35ad('0x12f')](_0x5dc83e,_0xc77534,_0x2adf3b,_0x5dc83e[_0x35ad('0xa0')],_0x42a01))[_0x35ad('0xfd')](function(_0x1cdbd5){_0xc77534[_0x35ad('0x45')]+=0x1;logger[_0x35ad('0x52')]('[originated][increment]',_0x47b122,_0x35ad('0xa5'),_0xc77534[_0x35ad('0x25')],_0x35ad('0xea'),_0xc77534[_0x35ad('0x45')]);_0x30d3d6(_0x1cdbd5);})['catch'](function(_0x42e7ae){ut['logAgent'](_0x5dc83e,0xe,'OriginateError');rpcDb[_0x35ad('0xf1')](_0x5dc83e,_0x35ad('0x130'));_0x2e9350(_0x42e7ae);});});};Preview['prototype']['syncNewExten']=function(_0x10f1cb){if(this[_0x35ad('0x68')][_0x10f1cb['linkedid']]){this[_0x35ad('0x68')][_0x10f1cb[_0x35ad('0xb4')]]['channel']=_0x10f1cb[_0x35ad('0x71')];}};Preview[_0x35ad('0x5f')][_0x35ad('0x131')]=function(_0x28252c){var _0x3d15b5=this;var _0xc67ff1=this[_0x35ad('0x68')][_0x28252c[_0x35ad('0x132')]];if(_0xc67ff1){if(_0xc67ff1[_0x35ad('0xfc')]&&this['agents'][_0xc67ff1[_0x35ad('0xfc')]]){ut[_0x35ad('0x133')](_0xc67ff1,this['agents'][_0xc67ff1[_0x35ad('0xfc')]][_0x35ad('0x25')],this[_0x35ad('0x15')][_0xc67ff1[_0x35ad('0xfc')]]['id']);}var _0x55aabf=_['clone'](_0xc67ff1);_0x55aabf['responsetime']=moment()['format'](_0x35ad('0x86'));var _0x521f45=_0x3d15b5[_0x35ad('0x13')][_0xc67ff1['queue']];if(ut[_0x35ad('0x134')](_0x28252c[_0x35ad('0x135')])){if(_0xc67ff1[_0x35ad('0xbf')]){rpcDb[_0x35ad('0x110')](_0xc67ff1['idContact']);}if(_0xc67ff1[_0x35ad('0xa0')]){rpcDb['disableContact'](_0xc67ff1[_0x35ad('0x101')]);}ami[_0x35ad('0x22')](_0x35ad('0x136'),ut[_0x35ad('0x98')](_0xc67ff1,_0x35ad('0x137'),this[_0x35ad('0x13')][_0xc67ff1[_0x35ad('0x6b')]]));this[_0x35ad('0x138')](_0x55aabf,_0x521f45,_0x28252c);}else{_0xc67ff1[_0x35ad('0x85')]=moment()[_0x35ad('0x4f')](_0x35ad('0x86'));ut[_0x35ad('0xef')](_0x55aabf,0x4,_0x35ad('0xaf'));rpcDb['createAgentHistory'](_0x55aabf,_0x35ad('0x139'));}}};Preview[_0x35ad('0x5f')][_0x35ad('0x13a')]=function(_0xd241e8){var _0x50efb3=this;var _0x5a1de6=this[_0x35ad('0x68')][_0xd241e8[_0x35ad('0xb4')]];var _0x4419a8;if(_0x5a1de6){_0x4419a8=this[_0x35ad('0x13')][_0x5a1de6['queue']];logger[_0x35ad('0x52')](_0x35ad('0x13b'),_0xd241e8['linkedid'],_0x35ad('0xa5'),_0x4419a8[_0x35ad('0x25')],_0x35ad('0xa6'),_0x4419a8[_0x35ad('0x57')]);}if(this['actions'][_0xd241e8[_0x35ad('0xb4')]]&&_0xd241e8[_0x35ad('0xb4')]!==_0xd241e8[_0x35ad('0xa4')]){if(_0xd241e8[_0x35ad('0x13c')]==='16'&&this[_0x35ad('0x68')][_0xd241e8[_0x35ad('0xb4')]]['dialAnswer']){this[_0x35ad('0x95')](_0xd241e8,_0xd241e8[_0x35ad('0xb4')],_0xd241e8[_0x35ad('0x13c')]);}else if(this[_0x35ad('0x68')][_0xd241e8[_0x35ad('0xb4')]][_0x35ad('0x76')]){logger[_0x35ad('0x52')]('[syncHangup][talking][cause]',_0xd241e8['linkedid'],_0xd241e8[_0x35ad('0x13c')],_0x35ad('0xa5'),_0x4419a8[_0x35ad('0x25')],_0x35ad('0xa6'),_0x4419a8[_0x35ad('0x57')]);this[_0x35ad('0x95')](_0xd241e8,_0xd241e8['linkedid'],_0xd241e8[_0x35ad('0x13c')]);}}else if(_0x5a1de6&&_[_0x35ad('0x67')](_0x5a1de6['statedesc'])&&_0x4419a8[_0x35ad('0x13d')]&&_0xd241e8[_0x35ad('0xb4')]===_0xd241e8[_0x35ad('0xa4')]&&_['isNil'](_0xd241e8['reason'])&&_0xd241e8[_0x35ad('0x13c')]==='16'&&_0xd241e8[_0x35ad('0x13e')]==='6'&&_['isUndefined'](_0x5a1de6[_0x35ad('0x13f')])){if(_0x5a1de6[_0x35ad('0xbf')]){rpcDb[_0x35ad('0x110')](_0x5a1de6[_0x35ad('0x101')]);}if(_0x5a1de6[_0x35ad('0xa0')]){rpcDb[_0x35ad('0x140')](_0x5a1de6['idContact']);}_0xd241e8[_0x35ad('0xee')]='22';this['callProgressDetectingAgent'](_0x5a1de6,_0x4419a8,_0xd241e8);}else if(_0x5a1de6&&_0x5a1de6[_0x35ad('0x13f')]){if(_0xd241e8[_0x35ad('0x13c')]==='16'&&this['actions'][_0xd241e8[_0x35ad('0xb4')]][_0x35ad('0x76')]){logger[_0x35ad('0x52')](_0x35ad('0x141'),_0xd241e8['linkedid'],_0xd241e8['cause'],_0x35ad('0xa5'),_0x4419a8[_0x35ad('0x25')],_0x35ad('0xa6'),_0x4419a8[_0x35ad('0x57')]);this['callProgressDetectingCustomer'](_0xd241e8,_0xd241e8[_0x35ad('0xb4')],_0xd241e8['cause']);}else if(this[_0x35ad('0x68')][_0xd241e8[_0x35ad('0xb4')]][_0x35ad('0x76')]){logger[_0x35ad('0x52')]('[syncHangup][talking][cause]',_0xd241e8[_0x35ad('0xb4')],_0xd241e8[_0x35ad('0x13c')],_0x35ad('0xa5'),_0x4419a8[_0x35ad('0x25')],_0x35ad('0xa6'),_0x4419a8[_0x35ad('0x57')]);this[_0x35ad('0x95')](_0xd241e8,_0xd241e8[_0x35ad('0xb4')],_0xd241e8[_0x35ad('0x13c')]);}}};Preview['prototype'][_0x35ad('0x1b')]=function(_0x3ec9ed){if(this['actions'][_0x3ec9ed[_0x35ad('0xeb')]]&&_0x3ec9ed['destlinkedid']!==_0x3ec9ed['destuniqueid']){this[_0x35ad('0x95')](_0x3ec9ed,_0x3ec9ed[_0x35ad('0xeb')],_0x3ec9ed[_0x35ad('0xe0')]);}};Preview[_0x35ad('0x5f')]['syncHangupRequest']=function(_0x2691e2){if(this[_0x35ad('0x68')][_0x2691e2[_0x35ad('0xb4')]]&&_0x2691e2[_0x35ad('0xb4')]!==_0x2691e2['uniqueid']&&!this['actions'][_0x2691e2[_0x35ad('0xb4')]]['dialAnswer']){if(_0x2691e2[_0x35ad('0x13c')]==='1'){this[_0x35ad('0x95')](_0x2691e2,_0x2691e2[_0x35ad('0xb4')],_0x2691e2['cause']);}}};Preview[_0x35ad('0x5f')]['addVariable']=function(_0x3171e0,_0x425732,_0x499fcf){if(this[_0x35ad('0x68')][_0x3171e0]){if(_[_0x35ad('0x67')](this['actions'][_0x3171e0][_0x35ad('0x142')])){this[_0x35ad('0x68')][_0x3171e0]['variables']={};}this[_0x35ad('0x68')][_0x3171e0][_0x35ad('0x142')][_0x425732]=_0x499fcf;}};Preview[_0x35ad('0x5f')]['syncVarSet']=function(_0x432863){try{if(!_['isNil'](_0x432863)){if(ut[_0x35ad('0x143')](_[_0x35ad('0x144')](_0x432863[_0x35ad('0x145')])[0x0])){this[_0x35ad('0x146')](_0x432863[_0x35ad('0xa4')],_[_0x35ad('0x144')](_0x432863[_0x35ad('0x145')])[0x0],_0x432863[_0x35ad('0x147')]);}}}catch(_0x33b595){logger['error']('[syncVarSet][Preview]',util[_0x35ad('0x148')](_0x33b595,{'showHidden':![],'depth':null}));}};Preview[_0x35ad('0x5f')]['syncAttendedTransfer']=function(_0x58b9e8){if(_0x58b9e8){if(this[_0x35ad('0x68')][_0x58b9e8[_0x35ad('0x149')]]){this[_0x35ad('0x68')][_0x58b9e8[_0x35ad('0x149')]][_0x35ad('0x13f')]=!![];}}};Preview[_0x35ad('0x5f')][_0x35ad('0x14a')]=function(_0x3e97ca){if(_0x3e97ca){if(this[_0x35ad('0x68')][_0x3e97ca[_0x35ad('0x14b')]]){this[_0x35ad('0x68')][_0x3e97ca[_0x35ad('0x14b')]][_0x35ad('0x13f')]=!![];}}};module['exports']=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 583cd80..dc59884 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 _0x2f2b=['queuecallercompleteAt','membername','context','exten','xcally-motion-preview','assigned','lastAssignedTo','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt'];(function(_0x10d3a5,_0x1f3b6f){var _0x24d921=function(_0x57e781){while(--_0x57e781){_0x10d3a5['push'](_0x10d3a5['shift']());}};_0x24d921(++_0x1f3b6f);}(_0x2f2b,0xd9));var _0xb2f2=function(_0x32f2b7,_0x40a3a2){_0x32f2b7=_0x32f2b7-0x0;var _0x5e8b4e=_0x2f2b[_0x32f2b7];return _0x5e8b4e;};'use strict';var util=require('util');var BPromise=require(_0xb2f2('0x0'));var logger=require(_0xb2f2('0x1'))(_0xb2f2('0x2'));var _=require('lodash');var cmHopper=require(_0xb2f2('0x3'));var cmHopperFinal=require(_0xb2f2('0x4'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xb2f2('0x5'));var voiceQueueRt=require(_0xb2f2('0x6'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xb2f2('0x7'));function loggerCatch(_0x391aa1){return function(_0x2721e6){logger[_0xb2f2('0x8')](_0x391aa1,util['inspect'](_0x2721e6,{'showHidden':![],'depth':null}));};}function create(_0x1f5fbd){return BPromise[_0xb2f2('0x9')]()[_0xb2f2('0xa')](cmHopperHistory[_0xb2f2('0xb')](_0x1f5fbd))[_0xb2f2('0xc')](loggerCatch(_0xb2f2('0xd')));}function createAgent(_0x331786){return BPromise[_0xb2f2('0x9')]()[_0xb2f2('0xa')](agentReportPreview[_0xb2f2('0xb')](_0x331786))[_0xb2f2('0xc')](loggerCatch(_0xb2f2('0xd')));}function moveContact(_0x105eb6){return BPromise[_0xb2f2('0x9')]()[_0xb2f2('0xa')](cmHopper[_0xb2f2('0xe')](_0x105eb6,!![]))[_0xb2f2('0xc')](loggerCatch(_0xb2f2('0xf')));}exports[_0xb2f2('0x10')]=function(_0x3cea2d){return BPromise[_0xb2f2('0x9')]()[_0xb2f2('0xa')](cmHopperBlack['checkIsBlackList'](_0x3cea2d))[_0xb2f2('0xc')](loggerCatch(_0xb2f2('0x11')));};exports[_0xb2f2('0x12')]=function(_0x10a2d5){return BPromise[_0xb2f2('0x9')]()[_0xb2f2('0xa')](cmHopper[_0xb2f2('0x12')](_0x10a2d5))['catch'](loggerCatch('[getContactPreview]\x20'));};exports[_0xb2f2('0xb')]=function(_0x2f01e8,_0x50e633){create(_0x2f01e8)[_0xb2f2('0xc')](loggerCatch(_0x50e633));moveContact(_0x2f01e8)[_0xb2f2('0xc')](loggerCatch(_0x50e633));};exports[_0xb2f2('0x13')]=function(_0x569387,_0xa3abc7){createAgent(_0x569387)[_0xb2f2('0xc')](loggerCatch(_0xa3abc7));};exports[_0xb2f2('0x14')]=function(_0x24a55f,_0x539eda){create(_0x24a55f)[_0xb2f2('0xc')](loggerCatch(_0x539eda));};exports[_0xb2f2('0x15')]=function(_0x5834e7,_0x539b95){moveContact(_0x5834e7)[_0xb2f2('0xc')](loggerCatch(_0x539b95));};exports[_0xb2f2('0x16')]=function(_0x546122,_0x18c565,_0x306d33){if(_0x18c565){_0x546122[_0xb2f2('0x17')]=null;}if(_0x306d33){_0x546122['active']=![];}return BPromise[_0xb2f2('0x9')]()[_0xb2f2('0xa')](cmHopper[_0xb2f2('0x16')](_0x546122))['catch'](loggerCatch(_0xb2f2('0x18')));};exports['countReScheduled']=function(_0x5a87f2){return BPromise[_0xb2f2('0x9')]()[_0xb2f2('0xa')](cmHopper[_0xb2f2('0x19')](_0x5a87f2))[_0xb2f2('0xc')](loggerCatch(_0xb2f2('0x1a')));};exports[_0xb2f2('0x1b')]=function(_0x2bfe0a){return BPromise['resolve']()[_0xb2f2('0xa')](cmHopper[_0xb2f2('0x1b')]({'UserId':null},_0x2bfe0a,0x1))[_0xb2f2('0xc')](loggerCatch('[unlockContact]\x20'));};exports['disableContact']=function(_0x4e29c9){return BPromise['resolve']()[_0xb2f2('0xa')](cmHopper[_0xb2f2('0x1b')]({'active':![]},_0x4e29c9,0x1))['catch'](loggerCatch(_0xb2f2('0x1c')));};exports[_0xb2f2('0x1d')]=function(_0x355ed3){var _0x19f7d5={};_0x19f7d5[_0xb2f2('0x1e')]=_0x355ed3[_0xb2f2('0x1e')];_0x19f7d5[_0xb2f2('0x1f')]=_0x355ed3[_0xb2f2('0x1f')];_0x19f7d5['calleridnum']=_0x355ed3[_0xb2f2('0x20')];_0x19f7d5[_0xb2f2('0x21')]=_0x355ed3[_0xb2f2('0x21')];_0x19f7d5['queue']=_0x355ed3[_0xb2f2('0x22')];_0x19f7d5[_0xb2f2('0x23')]=_0x355ed3[_0xb2f2('0x24')];_0x19f7d5[_0xb2f2('0x25')]=_0x355ed3[_0xb2f2('0x24')];_0x19f7d5['queuecallercomplete']=0x1;_0x19f7d5[_0xb2f2('0x26')]=_0x355ed3['endtime'];_0x19f7d5['connectedlinename']=_0x355ed3[_0xb2f2('0x27')];_0x19f7d5[_0xb2f2('0x28')]='from-sip';_0x19f7d5[_0xb2f2('0x29')]=_0xb2f2('0x2a');_0x19f7d5['holdtime']=0x0;_0x19f7d5[_0xb2f2('0x2b')]=0x1;_0x19f7d5[_0xb2f2('0x2c')]=_0x355ed3[_0xb2f2('0x27')];_0x19f7d5['queuecallerexitreason']='COMPLETED';return BPromise[_0xb2f2('0x9')]()[_0xb2f2('0xa')](voiceQueueReport[_0xb2f2('0x2d')](_0x19f7d5))['catch'](loggerCatch(_0xb2f2('0x2e')));};exports[_0xb2f2('0x2f')]=function(_0x58140c,_0x5906e3){return BPromise[_0xb2f2('0x9')]()['then'](cmHopper['getContactRecallMe'](_0x58140c,_0x5906e3))[_0xb2f2('0xc')](loggerCatch(_0xb2f2('0x30')));};exports[_0xb2f2('0x31')]=function(_0x5b963d){return BPromise['resolve']()[_0xb2f2('0xa')](cmHopper[_0xb2f2('0x16')](_0x5b963d,!![],!![]))['catch'](loggerCatch(_0xb2f2('0x32')));}; \ No newline at end of file +var _0x0c16=['bluebird','../../../config/logger','preview','lodash','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect','resolve','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','type','uniqueid','calleridnum','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','from-sip','holdtime','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util'];(function(_0x79702,_0x34931c){var _0x417e6b=function(_0x55294a){while(--_0x55294a){_0x79702['push'](_0x79702['shift']());}};_0x417e6b(++_0x34931c);}(_0x0c16,0x149));var _0x60c1=function(_0x26158a,_0x35e5ab){_0x26158a=_0x26158a-0x0;var _0x1cf4ac=_0x0c16[_0x26158a];return _0x1cf4ac;};'use strict';var util=require(_0x60c1('0x0'));var BPromise=require(_0x60c1('0x1'));var logger=require(_0x60c1('0x2'))(_0x60c1('0x3'));var _=require(_0x60c1('0x4'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x60c1('0x5'));var cmHopperHistory=require(_0x60c1('0x6'));var cmHopperBlack=require(_0x60c1('0x7'));var voiceQueueRt=require(_0x60c1('0x8'));var agentReportPreview=require(_0x60c1('0x9'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x1874d8){return function(_0x277c93){logger[_0x60c1('0xa')](_0x1874d8,util[_0x60c1('0xb')](_0x277c93,{'showHidden':![],'depth':null}));};}function create(_0x4b72ad){return BPromise[_0x60c1('0xc')]()['then'](cmHopperHistory[_0x60c1('0xd')](_0x4b72ad))[_0x60c1('0xe')](loggerCatch(_0x60c1('0xf')));}function createAgent(_0x1a80a9){return BPromise[_0x60c1('0xc')]()[_0x60c1('0x10')](agentReportPreview[_0x60c1('0xd')](_0x1a80a9))['catch'](loggerCatch('[createHistory]\x20'));}function moveContact(_0x254d15){return BPromise[_0x60c1('0xc')]()[_0x60c1('0x10')](cmHopper[_0x60c1('0x11')](_0x254d15,!![]))[_0x60c1('0xe')](loggerCatch(_0x60c1('0x12')));}exports[_0x60c1('0x13')]=function(_0x5db03c){return BPromise[_0x60c1('0xc')]()[_0x60c1('0x10')](cmHopperBlack['checkIsBlackList'](_0x5db03c))['catch'](loggerCatch(_0x60c1('0x14')));};exports[_0x60c1('0x15')]=function(_0x950e50){return BPromise[_0x60c1('0xc')]()[_0x60c1('0x10')](cmHopper['getContactPreview'](_0x950e50))[_0x60c1('0xe')](loggerCatch(_0x60c1('0x16')));};exports[_0x60c1('0xd')]=function(_0x2131d7,_0x21bfc0){create(_0x2131d7)[_0x60c1('0xe')](loggerCatch(_0x21bfc0));moveContact(_0x2131d7)['catch'](loggerCatch(_0x21bfc0));};exports[_0x60c1('0x17')]=function(_0x2001d0,_0x4ca840){createAgent(_0x2001d0)[_0x60c1('0xe')](loggerCatch(_0x4ca840));};exports['createCustomerHistory']=function(_0x590ad2,_0x443e0b){create(_0x590ad2)[_0x60c1('0xe')](loggerCatch(_0x443e0b));};exports[_0x60c1('0x18')]=function(_0xb04295,_0x7f7395){moveContact(_0xb04295)[_0x60c1('0xe')](loggerCatch(_0x7f7395));};exports[_0x60c1('0x19')]=function(_0x372e26,_0x2ac4a5,_0x1009e2){if(_0x2ac4a5){_0x372e26[_0x60c1('0x1a')]=null;}if(_0x1009e2){_0x372e26[_0x60c1('0x1b')]=![];}return BPromise[_0x60c1('0xc')]()[_0x60c1('0x10')](cmHopper[_0x60c1('0x19')](_0x372e26))[_0x60c1('0xe')](loggerCatch(_0x60c1('0x1c')));};exports[_0x60c1('0x1d')]=function(_0x56dade){return BPromise[_0x60c1('0xc')]()['then'](cmHopper[_0x60c1('0x1d')](_0x56dade))['catch'](loggerCatch(_0x60c1('0x1e')));};exports[_0x60c1('0x1f')]=function(_0x457760){return BPromise[_0x60c1('0xc')]()[_0x60c1('0x10')](cmHopper[_0x60c1('0x1f')]({'UserId':null},_0x457760,0x1))['catch'](loggerCatch(_0x60c1('0x20')));};exports['disableContact']=function(_0x13a953){return BPromise[_0x60c1('0xc')]()[_0x60c1('0x10')](cmHopper[_0x60c1('0x1f')]({'active':![]},_0x13a953,0x1))['catch'](loggerCatch(_0x60c1('0x21')));};exports['crateCustomerReportQueue']=function(_0x583b2f){var _0x2da04b={};_0x2da04b[_0x60c1('0x22')]=_0x583b2f[_0x60c1('0x22')];_0x2da04b[_0x60c1('0x23')]=_0x583b2f[_0x60c1('0x23')];_0x2da04b[_0x60c1('0x24')]=_0x583b2f[_0x60c1('0x24')];_0x2da04b['calleridname']=_0x583b2f['calleridname'];_0x2da04b['queue']=_0x583b2f[_0x60c1('0x25')];_0x2da04b[_0x60c1('0x26')]=_0x583b2f['answertime'];_0x2da04b[_0x60c1('0x27')]=_0x583b2f[_0x60c1('0x28')];_0x2da04b[_0x60c1('0x29')]=0x1;_0x2da04b[_0x60c1('0x2a')]=_0x583b2f['endtime'];_0x2da04b[_0x60c1('0x2b')]=_0x583b2f[_0x60c1('0x2c')];_0x2da04b[_0x60c1('0x2d')]=_0x60c1('0x2e');_0x2da04b['exten']='xcally-motion-preview';_0x2da04b[_0x60c1('0x2f')]=0x0;_0x2da04b['assigned']=0x1;_0x2da04b['lastAssignedTo']=_0x583b2f[_0x60c1('0x2c')];_0x2da04b[_0x60c1('0x30')]=_0x60c1('0x31');return BPromise[_0x60c1('0xc')]()[_0x60c1('0x10')](voiceQueueReport['create'](_0x2da04b))[_0x60c1('0xe')](loggerCatch(_0x60c1('0x32')));};exports[_0x60c1('0x33')]=function(_0x198e90,_0x54f12b){return BPromise[_0x60c1('0xc')]()[_0x60c1('0x10')](cmHopper[_0x60c1('0x33')](_0x198e90,_0x54f12b))[_0x60c1('0xe')](loggerCatch(_0x60c1('0x34')));};exports[_0x60c1('0x35')]=function(_0xd5a95c){return BPromise[_0x60c1('0xc')]()[_0x60c1('0x10')](cmHopper[_0x60c1('0x19')](_0xd5a95c,!![],!![]))[_0x60c1('0xe')](loggerCatch(_0x60c1('0x36')));}; \ 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 41450e8..cf6424c 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 _0x2cee=['rtpaudioqosrttbridged','rtpaudioqoslossbridged','bridgepvtcallid','getCallerIdRandom','pow','replace','random','extractCalleridName','match','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','inspect','info','error','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','XMD-','toUpper','toLowerVariables','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','Blacklist','responsetime','endtime','logAgent','state','statedesc','ringtime','starttime','membername','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','from-sip','timeout','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','scheduledat','add','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','name','queue','channelAgent','motionChannel','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','reachable','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','active','countbusyretry','countcongestionretry','callback','recallme','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt'];(function(_0x5427fe,_0x3c4d64){var _0x4c33c8=function(_0x234462){while(--_0x234462){_0x5427fe['push'](_0x5427fe['shift']());}};_0x4c33c8(++_0x3c4d64);}(_0x2cee,0x1ad));var _0xe2ce=function(_0x50b563,_0x6c4c4a){_0x50b563=_0x50b563-0x0;var _0x127e89=_0x2cee[_0x50b563];return _0x127e89;};'use strict';var util=require(_0xe2ce('0x0'));var _=require(_0xe2ce('0x1'));var moment=require(_0xe2ce('0x2'));var logger=require(_0xe2ce('0x3'))(_0xe2ce('0x4'));var ipAgi=process[_0xe2ce('0x5')][_0xe2ce('0x6')]||_0xe2ce('0x7');function getSeconds(_0x2d60ac,_0x54a4a8){var _0xeb1499=moment(_0x2d60ac)[_0xe2ce('0x8')](0x0);var _0x46fe01=moment(_0x54a4a8)[_0xe2ce('0x8')](0x0);return _0xeb1499[_0xe2ce('0x9')](_0x46fe01,_0xe2ce('0xa'));}exports[_0xe2ce('0xb')]=function(_0x3ef61f){return function(_0x527c3b){logger['error'](_0x3ef61f,util[_0xe2ce('0xc')](_0x527c3b,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x5df0f9,_0x21f234){logger[_0xe2ce('0xd')](_0x5df0f9,util[_0xe2ce('0xc')](_0x21f234,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x9f8fa3,_0x475961){logger[_0xe2ce('0xe')](_0x9f8fa3,util[_0xe2ce('0xc')](_0x475961,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0xbfaafc){return function(_0x20f1fb){logger[_0xe2ce('0xd')](_0xbfaafc,util[_0xe2ce('0xc')](_0x20f1fb,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x53e79a,_0x295df3,_0x3bd4ed){return{'message':_0x53e79a,'unlock':_0x295df3,'active':_0x3bd4ed};};exports[_0xe2ce('0xf')]=function(_0x5c3481,_0x218654,_0x3f6f12){if(!_['isUndefined'](_0x3f6f12)&&_0xe2ce('0x10')===typeof _0x3f6f12&&!_[_0xe2ce('0x11')](_0x3f6f12)){if(!_[_0xe2ce('0x12')](_0x218654)&&_0xe2ce('0x10')===typeof _0x218654&&!_[_0xe2ce('0x11')](_0x218654)){return util[_0xe2ce('0x13')]('\x22%s\x22\x20<%s>',_0x218654,_0x3f6f12);}return util['format'](_0xe2ce('0x14'),_0x3f6f12,_0x3f6f12);}if(!_['isUndefined'](_0x5c3481)&&'string'===typeof _0x5c3481&&!_[_0xe2ce('0x11')](_0x5c3481)){return _0x5c3481;}return _0xe2ce('0x15');};exports[_0xe2ce('0x16')]=function(_0x54527f){if(_[_0xe2ce('0x17')](_0x54527f)){return![];}return _0x54527f;};exports[_0xe2ce('0x18')]=function(_0x3229f8,_0x4d9b41,_0x414a0c,_0x4716cd,_0x54707e,_0x201869){var _0x526448={'XMD-QUEUE':_0x4d9b41['Queue']?_0x4d9b41[_0xe2ce('0x19')]['name']:'','XMD-CALLERID':_0x4716cd,'XMD-CALLERID-PREVIEW':_0x201869?util[_0xe2ce('0x13')](_0xe2ce('0x14'),_0x201869[_0xe2ce('0x1a')],_0x201869[_0xe2ce('0x1b')]):_0x4716cd,'XMD-DIALID':_0x54707e,'XMD-CONTACTID':_0x4d9b41[_0xe2ce('0x1c')],'XMD-CDRTYPE':_0xe2ce('0x1d'),'CALLERID(all)':_0x4716cd,'XMD-VOICEQUEUEID':_0x4d9b41[_0xe2ce('0x1e')],'XMD-DIALCHANNEL':_0x414a0c,'XMD-DIALTIMEOUT':_0x3229f8[_0xe2ce('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0xe2ce('0x13')](_0xe2ce('0x20'),_0x3229f8[_0xe2ce('0x21')]?'g':'',_[_0xe2ce('0x11')](_0x3229f8[_0xe2ce('0x22')])?'':_0xe2ce('0x23')),'XMD-DIALURL':_0x3229f8['dialPreviewUrl']||'','XMD-AGI':_0x3229f8[_0xe2ce('0x24')]?util[_0xe2ce('0x13')](_0xe2ce('0x25'),ipAgi,_0x3229f8[_0xe2ce('0x24')]):'NONE','XMD-AGIAFTER':_0x3229f8[_0xe2ce('0x21')]?util[_0xe2ce('0x13')](_0xe2ce('0x25'),ipAgi,_0x3229f8[_0xe2ce('0x21')]):_0xe2ce('0x26'),'XMD-ORIGINATECALLERIDNUM':_0x201869?_0x201869[_0xe2ce('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x201869?_0x201869['originatecalleridname']:'','XMD-DESTINATION':_0xe2ce('0x28'),'SIPADDHEADER':_0xe2ce('0x29')};if(!_[_0xe2ce('0x11')](_0x3229f8['monitor_format'])){_0x526448[util['format']('%s',_0xe2ce('0x2a'))]=_0x3229f8[_0xe2ce('0x22')];_0x526448[util[_0xe2ce('0x13')]('%s',_0xe2ce('0x2b'))]=_0x54707e;}if(_0x4d9b41&&_0x4d9b41['Contact']){for(var _0x254128 in _0x4d9b41[_0xe2ce('0x2c')]){if(_0x4d9b41[_0xe2ce('0x2c')][_0xe2ce('0x2d')](_0x254128)){if(!_[_0xe2ce('0x17')](_0x4d9b41[_0xe2ce('0x2c')][_0x254128])&&_0x254128!=='id'&&_0x254128!==_0xe2ce('0x2e')&&_0x254128!==_0xe2ce('0x2f')&&_0x254128!=='updatedAt'){_0x526448[util[_0xe2ce('0x13')]('%s%s',_0xe2ce('0x30'),_[_0xe2ce('0x31')](_0x254128))]=_0x4d9b41[_0xe2ce('0x2c')][_0x254128];}}}}return _0x526448;};exports[_0xe2ce('0x32')]=function(_0x467d51){var _0x706657={};for(var _0x23c9e2 in _0x467d51){if(_0x467d51[_0xe2ce('0x2d')](_0x23c9e2)){_0x706657[util[_0xe2ce('0x13')]('%s',_[_0xe2ce('0x33')](_0x23c9e2))]=_0x467d51[_0x23c9e2];}}return{'variables':_0x706657};};exports['updateOriginated']=function(_0x5e357f,_0x15b56a){if(!_[_0xe2ce('0x17')](_0x5e357f)){if(_0x5e357f[_0xe2ce('0x2d')](_0xe2ce('0x34'))){if(_0x5e357f['originated']>0x0){_0x5e357f[_0xe2ce('0x34')]-=0x1;}else{logger[_0xe2ce('0xe')](_0xe2ce('0x35'),_0x15b56a);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x15b56a);}};exports[_0xe2ce('0x36')]=function(_0x172aa6){var _0x5c214c=moment()[_0xe2ce('0x13')](_0xe2ce('0x37'));_0x172aa6['state']=0xd;_0x172aa6['statedesc']=_0xe2ce('0x38');_0x172aa6['starttime']=_0x5c214c;_0x172aa6[_0xe2ce('0x39')]=_0x5c214c;_0x172aa6[_0xe2ce('0x3a')]=_0x5c214c;};exports[_0xe2ce('0x3b')]=function(_0x3be411,_0x299f44,_0x35912d){var _0x50928a=moment()['format'](_0xe2ce('0x37'));_0x3be411[_0xe2ce('0x3c')]=_0x299f44;_0x3be411[_0xe2ce('0x3d')]=_0x35912d;_0x3be411[_0xe2ce('0x39')]=_0x50928a;_0x3be411[_0xe2ce('0x3e')]=getSeconds(_0x3be411[_0xe2ce('0x39')],_0x3be411[_0xe2ce('0x3f')]);};exports['logLookAgent']=function(_0x423027,_0x517445,_0x3731ad){_0x423027[_0xe2ce('0x40')]=_0x517445;_0x423027[_0xe2ce('0x41')]=_0x3731ad;};exports[_0xe2ce('0x42')]=function(_0x1b1c60,_0x4edfb5,_0x27a74f){var _0xf32fa1=moment()['format'](_0xe2ce('0x37'));_0x1b1c60[_0xe2ce('0x3c')]=_0x4edfb5;_0x1b1c60['statedesc']=_0x27a74f;_0x1b1c60[_0xe2ce('0x39')]=_0x1b1c60[_0xe2ce('0x39')]?_0x1b1c60[_0xe2ce('0x39')]:_0xf32fa1;_0x1b1c60[_0xe2ce('0x3a')]=_0x1b1c60[_0xe2ce('0x3a')]?_0x1b1c60['endtime']:_0xf32fa1;_0x1b1c60[_0xe2ce('0x3e')]=getSeconds(_0x1b1c60[_0xe2ce('0x39')]||0x0,_0x1b1c60[_0xe2ce('0x3f')]||0x0);_0x1b1c60[_0xe2ce('0x43')]=_0x1b1c60['answertime']?getSeconds(_0x1b1c60[_0xe2ce('0x3a')],_0x1b1c60[_0xe2ce('0x44')]):0x0;};exports[_0xe2ce('0x45')]=function(_0x22f4a5){return _0x22f4a5===_0xe2ce('0x46');};exports[_0xe2ce('0x47')]=function(_0x4416d4,_0x138d88,_0x3f80cd,_0x5467ec,_0x5e3e36){var _0x5d335e=_0x5467ec?_0xe2ce('0x48'):_0x4416d4[_0xe2ce('0x1a')];_0x5d335e=_0x5e3e36?_0xe2ce('0x49'):_0x5d335e;return{'actionid':_0x4416d4[_0xe2ce('0x4a')],'action':_0xe2ce('0x4b'),'channel':_0x4416d4['channelAgent'],'callerid':util[_0xe2ce('0x13')](_0xe2ce('0x14'),_0x5d335e,_0x4416d4[_0xe2ce('0x1b')]),'Exten':_0xe2ce('0x28'),'Context':_0xe2ce('0x4c'),'Priority':'1','variable':_0x3f80cd,'timeout':(_0x138d88[_0xe2ce('0x4d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4416d4[_0xe2ce('0x4a')]};};exports['totalGlobal']=function(_0x317d1b){return _0x317d1b['countbusyretry']+_0x317d1b['countcongestionretry']+_0x317d1b[_0xe2ce('0x4e')]+_0x317d1b[_0xe2ce('0x4f')]+_0x317d1b['countnosuchnumberretry'];};exports[_0xe2ce('0x50')]=function(_0x552164){var _0x403269=_[_0xe2ce('0x51')](_0x552164);_0x403269[_0xe2ce('0x3c')]=0xf;_0x403269['statedesc']=_0xe2ce('0x52');return _0x403269;};exports['scheduledAt']=function(_0x33ba1a,_0x2bb07e,_0x55504d){var _0x104ca3={};_0x104ca3[_0x2bb07e]=_0x33ba1a[_0x2bb07e];_0x104ca3['active']=![];_0x104ca3[_0xe2ce('0x53')]=moment()[_0xe2ce('0x54')](_0x55504d,_0xe2ce('0x55'))[_0xe2ce('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x104ca3[_0xe2ce('0x1c')]=_0x33ba1a['ContactId'];_0x104ca3[_0xe2ce('0x56')]=_0x33ba1a[_0xe2ce('0x56')];_0x104ca3['VoiceQueueId']=_0x33ba1a[_0xe2ce('0x1e')]||undefined;return _0x104ca3;};exports['decrementTalkink']=function(_0x418f8b,_0x287546){if(!_[_0xe2ce('0x17')](_0x418f8b)){if(_0x418f8b[_0xe2ce('0x57')]>0x0){_0x418f8b['pTalking']-=0x1;}else{logger['error'](_0x287546,_0xe2ce('0x58'));}}else{logger[_0xe2ce('0xe')](_0x287546,_0xe2ce('0x59'));}};exports[_0xe2ce('0x5a')]=function(_0x18dc3c){if(_0x18dc3c<=0x0){return!![];}return![];};exports[_0xe2ce('0x5b')]=function(_0x499c2a,_0x3171f8,_0x23c1f4){_0x499c2a[_0xe2ce('0x5c')]=_0x3171f8;_0x499c2a[_0xe2ce('0x5d')]=_0x499c2a[_0xe2ce('0x5e')];_0x499c2a['interface']=_0x499c2a[_0xe2ce('0x5f')];_0x499c2a[_0xe2ce('0x60')]='voice';if(_0x23c1f4){_0x499c2a[_0xe2ce('0x61')]=_0x23c1f4[_0xe2ce('0x61')];}return _0x499c2a;};exports[_0xe2ce('0x62')]=function(_0x3e9e4f){var _0x404f37={};_0x404f37[_0xe2ce('0x5e')]=_0x3e9e4f[_0xe2ce('0x5e')];_0x404f37['interface']=_0x3e9e4f[_0xe2ce('0x5f')];_0x404f37[_0xe2ce('0x4a')]=_0x3e9e4f[_0xe2ce('0x4a')];return _0x404f37;};exports[_0xe2ce('0x63')]=function(_0x3bc08d){var _0x17c267=[];for(var _0x701f28 in _0x3bc08d){if(_0x3bc08d[_0xe2ce('0x2d')](_0x701f28)){if(!_[_0xe2ce('0x17')](_0x3bc08d[_0x701f28])&&_0x3bc08d[_0x701f28][_0xe2ce('0x3c')]===_0xe2ce('0x64')&&_0x3bc08d[_0x701f28]['status']===_0xe2ce('0x65')){_0x17c267['push'](_0x3bc08d[_0x701f28]['id']);}}}return _0x17c267;};exports[_0xe2ce('0x66')]=function(_0x28af65){var _0x34fd8c=moment()['milliseconds'](0x0);var _0x1c6ead=moment(_0x28af65)[_0xe2ce('0x8')](0x0);return _0x34fd8c['diff'](_0x1c6ead,_0xe2ce('0xa'));};exports[_0xe2ce('0x67')]=function(_0x2fcd94){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2fcd94['ContactId'],'ListId':_0x2fcd94[_0xe2ce('0x56')],'VoiceQueueId':_0x2fcd94[_0xe2ce('0x1e')]||undefined,'CampaignId':_0x2fcd94[_0xe2ce('0x68')]||undefined};};exports[_0xe2ce('0x69')]=function(_0x181ba6){if(_0x181ba6===_0xe2ce('0x4a')||_0x181ba6===_0xe2ce('0x6a')||_0x181ba6===_0xe2ce('0x5e')||_0x181ba6===_0xe2ce('0x6b')||_0x181ba6===_0xe2ce('0x6c')||_0x181ba6==='dialAnswer'||_0x181ba6===_0xe2ce('0x40')||_0x181ba6===_0xe2ce('0x5f')||_0x181ba6===_0xe2ce('0x1a')||_0x181ba6===_0xe2ce('0x6d')||_0x181ba6===_0xe2ce('0x1b')||_0x181ba6===_0xe2ce('0x53')||_0x181ba6===_0xe2ce('0x6e')||_0x181ba6===_0xe2ce('0x6f')||_0x181ba6===_0xe2ce('0x4e')||_0x181ba6==='countglobal'||_0x181ba6===_0xe2ce('0x70')||_0x181ba6==='callbackuniqueid'||_0x181ba6==='callbackat'||_0x181ba6===_0xe2ce('0x71')||_0x181ba6==='ContactId'||_0x181ba6==='ListId'||_0x181ba6===_0xe2ce('0x41')||_0x181ba6===_0xe2ce('0x1e')||_0x181ba6==='sipcallid'||_0x181ba6==='xmd-voicequeueid'||_0x181ba6===_0xe2ce('0x72')||_0x181ba6===_0xe2ce('0x73')||_0x181ba6===_0xe2ce('0x74')||_0x181ba6===_0xe2ce('0x75')||_0x181ba6===_0xe2ce('0x76')||_0x181ba6===_0xe2ce('0x77')||_0x181ba6==='xmd-dialid'||_0x181ba6===_0xe2ce('0x78')||_0x181ba6===_0xe2ce('0x79')||_0x181ba6==='xmd-cdrtype'||_0x181ba6===_0xe2ce('0x7a')||_0x181ba6===_0xe2ce('0x7b')||_0x181ba6===_0xe2ce('0x7c')||_0x181ba6===_0xe2ce('0x7d')||_0x181ba6===_0xe2ce('0x7e')||_0x181ba6===_0xe2ce('0x7f')||_0x181ba6===_0xe2ce('0x80')||_0x181ba6===_0xe2ce('0x81')||_0x181ba6==='rtpaudioqoslossbridged'||_0x181ba6===_0xe2ce('0x82')||_0x181ba6===_0xe2ce('0x83')||_0x181ba6===_0xe2ce('0x7d')||_0x181ba6==='rtpaudioqosbridged'||_0x181ba6===_0xe2ce('0x7f')||_0x181ba6==='rtpaudioqosjitterbridged'||_0x181ba6===_0xe2ce('0x81')||_0x181ba6===_0xe2ce('0x84')||_0x181ba6===_0xe2ce('0x82')||_0x181ba6===_0xe2ce('0x83')||_0x181ba6==='bridgepeer'||_0x181ba6===_0xe2ce('0x85')||_0x181ba6===_0xe2ce('0x3c')||_0x181ba6==='statedesc'){return![];}return!![];};exports[_0xe2ce('0x86')]=function(_0x52547a,_0x3a1fd5){var _0x548ead,_0x484f45,_0x3fe3d3;if(_0x3a1fd5<=0x0){_0x3a1fd5=0x1;}_0x548ead=new RegExp('\x5cw{0,'+_0x3a1fd5+'}$');_0x484f45=Math['pow'](0xa,_0x3a1fd5-0x1);_0x3fe3d3=Math[_0xe2ce('0x87')](0xa,_0x3a1fd5)-0x1;return util[_0xe2ce('0x13')]('%s',_[_0xe2ce('0x88')](_0x52547a,_0x548ead,_[_0xe2ce('0x89')](_0x484f45,_0x3fe3d3)));};exports[_0xe2ce('0x8a')]=function(_0x32f60e){var _0x2d40a2=_0x32f60e[_0xe2ce('0x8b')](/"(.*?)"/);return _0x2d40a2?_0x2d40a2[0x1]:_0x32f60e;};exports['extractCalleridNumber']=function(_0x577634){var _0x10823c=_0x577634['match'](/<(.*?)>/);return _0x10823c?_0x10823c[0x1]:_0x577634;}; \ No newline at end of file +var _0x85af=['minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','buildObj','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildAcw','channelAgent','agentReadyId','not_inuse','status','getDiff','createBody','CampaignId','filterKey','idContact','campaigntype','dialAnswer','countglobal','callback','callbackuniqueid','callbackat','UserId','sipcallid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqos','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','env','milliseconds','diff','seconds','error','logger','info','loggerError','inspect','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','name','format','calleridname','calleridnum','ContactId','dialer','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','originatecalleridname','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','createdAt','%s%s','XMD-','toUpper','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','Blacklist','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','starttime','membername','logCustomer','talktime','answertime','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','xcally-motion-preview','from-sip','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','statedesc','Global','active','scheduledat','add'];(function(_0x22e77d,_0x2a6f25){var _0x3939b4=function(_0x4e2496){while(--_0x4e2496){_0x22e77d['push'](_0x22e77d['shift']());}};_0x3939b4(++_0x2a6f25);}(_0x85af,0xc7));var _0xf85a=function(_0xf6455b,_0x55ce97){_0xf6455b=_0xf6455b-0x0;var _0x348cfa=_0x85af[_0xf6455b];return _0x348cfa;};'use strict';var util=require(_0xf85a('0x0'));var _=require(_0xf85a('0x1'));var moment=require(_0xf85a('0x2'));var logger=require(_0xf85a('0x3'))(_0xf85a('0x4'));var ipAgi=process[_0xf85a('0x5')]['XCALLY_IP_AGI']||'127.0.0.1';function getSeconds(_0x3ba1ce,_0x570220){var _0xd05a6c=moment(_0x3ba1ce)[_0xf85a('0x6')](0x0);var _0x4844cd=moment(_0x570220)['milliseconds'](0x0);return _0xd05a6c[_0xf85a('0x7')](_0x4844cd,_0xf85a('0x8'));}exports['loggerCatch']=function(_0x53c885){return function(_0x3193fb){logger[_0xf85a('0x9')](_0x53c885,util['inspect'](_0x3193fb,{'showHidden':![],'depth':null}));};};exports[_0xf85a('0xa')]=function(_0x1438d4,_0x1b4468){logger[_0xf85a('0xb')](_0x1438d4,util['inspect'](_0x1b4468,{'showHidden':![],'depth':null}));};exports[_0xf85a('0xc')]=function(_0x24f185,_0x11ab87){logger[_0xf85a('0x9')](_0x24f185,util[_0xf85a('0xd')](_0x11ab87,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x17b845){return function(_0x190172){logger[_0xf85a('0xb')](_0x17b845,util[_0xf85a('0xd')](_0x190172,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x525b19,_0x46da80,_0x25a4eb){return{'message':_0x525b19,'unlock':_0x46da80,'active':_0x25a4eb};};exports[_0xf85a('0xe')]=function(_0x3074ac,_0x56029d,_0xc3d51b){if(!_[_0xf85a('0xf')](_0xc3d51b)&&_0xf85a('0x10')===typeof _0xc3d51b&&!_[_0xf85a('0x11')](_0xc3d51b)){if(!_[_0xf85a('0xf')](_0x56029d)&&_0xf85a('0x10')===typeof _0x56029d&&!_['isEmpty'](_0x56029d)){return util['format'](_0xf85a('0x12'),_0x56029d,_0xc3d51b);}return util['format'](_0xf85a('0x12'),_0xc3d51b,_0xc3d51b);}if(!_['isUndefined'](_0x3074ac)&&_0xf85a('0x10')===typeof _0x3074ac&&!_[_0xf85a('0x11')](_0x3074ac)){return _0x3074ac;}return _0xf85a('0x13');};exports[_0xf85a('0x14')]=function(_0x2ecd40){if(_[_0xf85a('0x15')](_0x2ecd40)){return![];}return _0x2ecd40;};exports[_0xf85a('0x16')]=function(_0x5f53f8,_0x337518,_0x164d3d,_0x5c9cb2,_0x440846,_0x384f16){var _0x37ac4b={'XMD-QUEUE':_0x337518['Queue']?_0x337518['Queue'][_0xf85a('0x17')]:'','XMD-CALLERID':_0x5c9cb2,'XMD-CALLERID-PREVIEW':_0x384f16?util[_0xf85a('0x18')]('\x22%s\x22\x20<%s>',_0x384f16[_0xf85a('0x19')],_0x384f16[_0xf85a('0x1a')]):_0x5c9cb2,'XMD-DIALID':_0x440846,'XMD-CONTACTID':_0x337518[_0xf85a('0x1b')],'XMD-CDRTYPE':_0xf85a('0x1c'),'CALLERID(all)':_0x5c9cb2,'XMD-VOICEQUEUEID':_0x337518['VoiceQueueId'],'XMD-DIALCHANNEL':_0x164d3d,'XMD-DIALTIMEOUT':_0x5f53f8['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0xf85a('0x18')](_0xf85a('0x1d'),_0x5f53f8[_0xf85a('0x1e')]?'g':'',_[_0xf85a('0x11')](_0x5f53f8[_0xf85a('0x1f')])?'':_0xf85a('0x20')),'XMD-DIALURL':_0x5f53f8[_0xf85a('0x21')]||'','XMD-AGI':_0x5f53f8[_0xf85a('0x22')]?util[_0xf85a('0x18')]('\x22agi://%s/square,%s\x22',ipAgi,_0x5f53f8[_0xf85a('0x22')]):_0xf85a('0x23'),'XMD-AGIAFTER':_0x5f53f8[_0xf85a('0x1e')]?util[_0xf85a('0x18')](_0xf85a('0x24'),ipAgi,_0x5f53f8[_0xf85a('0x1e')]):_0xf85a('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x384f16?_0x384f16['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x384f16?_0x384f16[_0xf85a('0x25')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0xf85a('0x11')](_0x5f53f8['monitor_format'])){_0x37ac4b[util[_0xf85a('0x18')]('%s',_0xf85a('0x26'))]=_0x5f53f8[_0xf85a('0x1f')];_0x37ac4b[util[_0xf85a('0x18')]('%s',_0xf85a('0x27'))]=_0x440846;}if(_0x337518&&_0x337518[_0xf85a('0x28')]){for(var _0x1d207e in _0x337518['Contact']){if(_0x337518[_0xf85a('0x28')]['hasOwnProperty'](_0x1d207e)){if(!_[_0xf85a('0x15')](_0x337518['Contact'][_0x1d207e])&&_0x1d207e!=='id'&&_0x1d207e!==_0xf85a('0x29')&&_0x1d207e!==_0xf85a('0x2a')&&_0x1d207e!=='updatedAt'){_0x37ac4b[util['format'](_0xf85a('0x2b'),_0xf85a('0x2c'),_[_0xf85a('0x2d')](_0x1d207e))]=_0x337518[_0xf85a('0x28')][_0x1d207e];}}}}return _0x37ac4b;};exports[_0xf85a('0x2e')]=function(_0x312b26){var _0xb00c95={};for(var _0x10e07b in _0x312b26){if(_0x312b26[_0xf85a('0x2f')](_0x10e07b)){_0xb00c95[util[_0xf85a('0x18')]('%s',_[_0xf85a('0x30')](_0x10e07b))]=_0x312b26[_0x10e07b];}}return{'variables':_0xb00c95};};exports[_0xf85a('0x31')]=function(_0x24fe56,_0x167fee){if(!_['isNil'](_0x24fe56)){if(_0x24fe56[_0xf85a('0x2f')](_0xf85a('0x32'))){if(_0x24fe56['originated']>0x0){_0x24fe56[_0xf85a('0x32')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x167fee);}}}else{logger[_0xf85a('0x9')](_0xf85a('0x33'),_0x167fee);}};exports[_0xf85a('0x34')]=function(_0x54d812){var _0x1ba864=moment()[_0xf85a('0x18')]('YYYY-MM-DD\x20HH:mm:ss');_0x54d812[_0xf85a('0x35')]=0xd;_0x54d812['statedesc']=_0xf85a('0x36');_0x54d812['starttime']=_0x1ba864;_0x54d812[_0xf85a('0x37')]=_0x1ba864;_0x54d812[_0xf85a('0x38')]=_0x1ba864;};exports[_0xf85a('0x39')]=function(_0x5271d7,_0x4101a1,_0x7c192a){var _0xe335f2=moment()[_0xf85a('0x18')](_0xf85a('0x3a'));_0x5271d7[_0xf85a('0x35')]=_0x4101a1;_0x5271d7['statedesc']=_0x7c192a;_0x5271d7['responsetime']=_0xe335f2;_0x5271d7[_0xf85a('0x3b')]=getSeconds(_0x5271d7[_0xf85a('0x37')],_0x5271d7[_0xf85a('0x3c')]);};exports['logLookAgent']=function(_0x5e6147,_0x23ca8c,_0x470cab){_0x5e6147[_0xf85a('0x3d')]=_0x23ca8c;_0x5e6147['UserId']=_0x470cab;};exports[_0xf85a('0x3e')]=function(_0x52b774,_0x35adde,_0x575951){var _0x4fa4e8=moment()[_0xf85a('0x18')](_0xf85a('0x3a'));_0x52b774[_0xf85a('0x35')]=_0x35adde;_0x52b774['statedesc']=_0x575951;_0x52b774[_0xf85a('0x37')]=_0x52b774[_0xf85a('0x37')]?_0x52b774['responsetime']:_0x4fa4e8;_0x52b774[_0xf85a('0x38')]=_0x52b774['endtime']?_0x52b774[_0xf85a('0x38')]:_0x4fa4e8;_0x52b774[_0xf85a('0x3b')]=getSeconds(_0x52b774[_0xf85a('0x37')]||0x0,_0x52b774[_0xf85a('0x3c')]||0x0);_0x52b774[_0xf85a('0x3f')]=_0x52b774[_0xf85a('0x40')]?getSeconds(_0x52b774[_0xf85a('0x38')],_0x52b774['answertime']):0x0;};exports['isFailure']=function(_0x3ec43a){return _0x3ec43a===_0xf85a('0x41');};exports[_0xf85a('0x42')]=function(_0x5cd195,_0x3744c7,_0x2c1c26,_0x39991a,_0x2ec1d1){var _0x327230=_0x39991a?_0xf85a('0x43'):_0x5cd195['calleridname'];_0x327230=_0x2ec1d1?_0xf85a('0x44'):_0x327230;return{'actionid':_0x5cd195[_0xf85a('0x45')],'action':_0xf85a('0x46'),'channel':_0x5cd195['channelAgent'],'callerid':util['format']('\x22%s\x22\x20<%s>',_0x327230,_0x5cd195['calleridnum']),'Exten':_0xf85a('0x47'),'Context':_0xf85a('0x48'),'Priority':'1','variable':_0x2c1c26,'timeout':(_0x3744c7['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x5cd195[_0xf85a('0x45')]};};exports['totalGlobal']=function(_0xed731d){return _0xed731d[_0xf85a('0x49')]+_0xed731d[_0xf85a('0x4a')]+_0xed731d[_0xf85a('0x4b')]+_0xed731d[_0xf85a('0x4c')]+_0xed731d[_0xf85a('0x4d')];};exports[_0xf85a('0x4e')]=function(_0x45d09a){var _0xab5bad=_[_0xf85a('0x4f')](_0x45d09a);_0xab5bad[_0xf85a('0x35')]=0xf;_0xab5bad[_0xf85a('0x50')]=_0xf85a('0x51');return _0xab5bad;};exports['scheduledAt']=function(_0xd99151,_0x1428a2,_0x3f3538){var _0x345d7e={};_0x345d7e[_0x1428a2]=_0xd99151[_0x1428a2];_0x345d7e[_0xf85a('0x52')]=![];_0x345d7e[_0xf85a('0x53')]=moment()[_0xf85a('0x54')](_0x3f3538,_0xf85a('0x55'))[_0xf85a('0x18')](_0xf85a('0x3a'));_0x345d7e['ContactId']=_0xd99151[_0xf85a('0x1b')];_0x345d7e[_0xf85a('0x56')]=_0xd99151[_0xf85a('0x56')];_0x345d7e[_0xf85a('0x57')]=_0xd99151[_0xf85a('0x57')]||undefined;return _0x345d7e;};exports[_0xf85a('0x58')]=function(_0x26ce64,_0xcbcbd1){if(!_[_0xf85a('0x15')](_0x26ce64)){if(_0x26ce64[_0xf85a('0x59')]>0x0){_0x26ce64[_0xf85a('0x59')]-=0x1;}else{logger['error'](_0xcbcbd1,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger['error'](_0xcbcbd1,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x76dba0){if(_0x76dba0<=0x0){return!![];}return![];};exports[_0xf85a('0x5a')]=function(_0x25f05f,_0x4a025f,_0x3aca23){_0x25f05f[_0xf85a('0x5b')]=_0x4a025f;_0x25f05f[_0xf85a('0x17')]=_0x25f05f[_0xf85a('0x5c')];_0x25f05f[_0xf85a('0x5d')]=_0x25f05f['channelAgent'];_0x25f05f[_0xf85a('0x5e')]=_0xf85a('0x5f');if(_0x3aca23){_0x25f05f[_0xf85a('0x60')]=_0x3aca23['mandatoryDisposition'];}return _0x25f05f;};exports[_0xf85a('0x61')]=function(_0x34268e){var _0x24195f={};_0x24195f[_0xf85a('0x5c')]=_0x34268e[_0xf85a('0x5c')];_0x24195f[_0xf85a('0x5d')]=_0x34268e[_0xf85a('0x62')];_0x24195f[_0xf85a('0x45')]=_0x34268e[_0xf85a('0x45')];return _0x24195f;};exports[_0xf85a('0x63')]=function(_0x509c1e){var _0x1b2cc6=[];for(var _0x56489e in _0x509c1e){if(_0x509c1e[_0xf85a('0x2f')](_0x56489e)){if(!_[_0xf85a('0x15')](_0x509c1e[_0x56489e])&&_0x509c1e[_0x56489e][_0xf85a('0x35')]===_0xf85a('0x64')&&_0x509c1e[_0x56489e][_0xf85a('0x65')]==='reachable'){_0x1b2cc6['push'](_0x509c1e[_0x56489e]['id']);}}}return _0x1b2cc6;};exports[_0xf85a('0x66')]=function(_0x3c6499){var _0x5d4e71=moment()[_0xf85a('0x6')](0x0);var _0x4af5fe=moment(_0x3c6499)[_0xf85a('0x6')](0x0);return _0x5d4e71[_0xf85a('0x7')](_0x4af5fe,_0xf85a('0x8'));};exports[_0xf85a('0x67')]=function(_0x3c7e04){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3c7e04['ContactId'],'ListId':_0x3c7e04['ListId'],'VoiceQueueId':_0x3c7e04[_0xf85a('0x57')]||undefined,'CampaignId':_0x3c7e04[_0xf85a('0x68')]||undefined};};exports[_0xf85a('0x69')]=function(_0x51cd2e){if(_0x51cd2e===_0xf85a('0x45')||_0x51cd2e===_0xf85a('0x6a')||_0x51cd2e===_0xf85a('0x5c')||_0x51cd2e==='type'||_0x51cd2e===_0xf85a('0x6b')||_0x51cd2e===_0xf85a('0x6c')||_0x51cd2e===_0xf85a('0x3d')||_0x51cd2e===_0xf85a('0x62')||_0x51cd2e===_0xf85a('0x19')||_0x51cd2e===_0xf85a('0x52')||_0x51cd2e===_0xf85a('0x1a')||_0x51cd2e===_0xf85a('0x53')||_0x51cd2e===_0xf85a('0x49')||_0x51cd2e===_0xf85a('0x4a')||_0x51cd2e===_0xf85a('0x4b')||_0x51cd2e===_0xf85a('0x6d')||_0x51cd2e===_0xf85a('0x6e')||_0x51cd2e===_0xf85a('0x6f')||_0x51cd2e===_0xf85a('0x70')||_0x51cd2e==='recallme'||_0x51cd2e===_0xf85a('0x1b')||_0x51cd2e===_0xf85a('0x56')||_0x51cd2e===_0xf85a('0x71')||_0x51cd2e===_0xf85a('0x57')||_0x51cd2e===_0xf85a('0x72')||_0x51cd2e==='xmd-voicequeueid'||_0x51cd2e==='xmd-queue'||_0x51cd2e===_0xf85a('0x73')||_0x51cd2e===_0xf85a('0x74')||_0x51cd2e===_0xf85a('0x75')||_0x51cd2e===_0xf85a('0x76')||_0x51cd2e===_0xf85a('0x77')||_0x51cd2e===_0xf85a('0x78')||_0x51cd2e===_0xf85a('0x79')||_0x51cd2e===_0xf85a('0x7a')||_0x51cd2e===_0xf85a('0x7b')||_0x51cd2e==='xmd-callerid'||_0x51cd2e===_0xf85a('0x7c')||_0x51cd2e===_0xf85a('0x7d')||_0x51cd2e==='rtpaudioqos'||_0x51cd2e===_0xf85a('0x7e')||_0x51cd2e===_0xf85a('0x7f')||_0x51cd2e===_0xf85a('0x80')||_0x51cd2e===_0xf85a('0x81')||_0x51cd2e===_0xf85a('0x82')||_0x51cd2e==='rtpaudioqosrtt'||_0x51cd2e===_0xf85a('0x83')||_0x51cd2e===_0xf85a('0x84')||_0x51cd2e==='rtpaudioqosbridged'||_0x51cd2e===_0xf85a('0x7f')||_0x51cd2e===_0xf85a('0x80')||_0x51cd2e===_0xf85a('0x81')||_0x51cd2e===_0xf85a('0x82')||_0x51cd2e==='rtpaudioqosrtt'||_0x51cd2e===_0xf85a('0x83')||_0x51cd2e===_0xf85a('0x85')||_0x51cd2e===_0xf85a('0x86')||_0x51cd2e==='state'||_0x51cd2e===_0xf85a('0x50')){return![];}return!![];};exports[_0xf85a('0x87')]=function(_0x328043,_0x582867){var _0x599782,_0x94c761,_0x2c82bf;if(_0x582867<=0x0){_0x582867=0x1;}_0x599782=new RegExp(_0xf85a('0x88')+_0x582867+'}$');_0x94c761=Math[_0xf85a('0x89')](0xa,_0x582867-0x1);_0x2c82bf=Math[_0xf85a('0x89')](0xa,_0x582867)-0x1;return util[_0xf85a('0x18')]('%s',_[_0xf85a('0x8a')](_0x328043,_0x599782,_[_0xf85a('0x8b')](_0x94c761,_0x2c82bf)));};exports['extractCalleridName']=function(_0x5e22bd){var _0x437c80=_0x5e22bd[_0xf85a('0x8c')](/"(.*?)"/);return _0x437c80?_0x437c80[0x1]:_0x5e22bd;};exports[_0xf85a('0x8d')]=function(_0x2ab603){var _0x498a95=_0x2ab603[_0xf85a('0x8c')](/<(.*?)>/);return _0x498a95?_0x498a95[0x1]:_0x2ab603;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 469b36f..a513695 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 _0x1528=['queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string','number','boolean','queueremove'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x1528,0x73));var _0x8152=function(_0x10b9dc,_0x14ad95){_0x10b9dc=_0x10b9dc-0x0;var _0x4e3f93=_0x1528[_0x10b9dc];return _0x4e3f93;};'use strict';exports[_0x8152('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x8152('0x1'),'required':!![]},'penalty':{'type':_0x8152('0x2'),'required':![]},'paused':{'type':_0x8152('0x3'),'required':![]}};exports[_0x8152('0x4')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x8152('0x5')]={'interface':{'type':_0x8152('0x1'),'required':!![]},'paused':{'type':_0x8152('0x3')},'reason':{'type':_0x8152('0x1'),'required':![]}};exports[_0x8152('0x6')]={'module':{'type':_0x8152('0x1'),'required':![]}};exports[_0x8152('0x7')]={'uniqueid':{'type':_0x8152('0x1'),'required':!![]}};exports[_0x8152('0x8')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x8152('0x1')},'format':{'type':_0x8152('0x1')},'mixmonitorid':{'type':_0x8152('0x1')}};exports[_0x8152('0x9')]={'uniqueid':{'type':_0x8152('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x8152('0x1'),'required':!![]},'exten':{'type':_0x8152('0x1'),'required':!![]},'context':{'type':_0x8152('0x1')}}; \ No newline at end of file +var _0x1a9d=['queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelredirect','queueadd','string','boolean'];(function(_0x5c8533,_0x312262){var _0x4e439a=function(_0x387c5b){while(--_0x387c5b){_0x5c8533['push'](_0x5c8533['shift']());}};_0x4e439a(++_0x312262);}(_0x1a9d,0x75));var _0xd1a9=function(_0x4b593a,_0x1b3d43){_0x4b593a=_0x4b593a-0x0;var _0x2a9274=_0x1a9d[_0x4b593a];return _0x2a9274;};'use strict';exports[_0xd1a9('0x0')]={'queue':{'type':_0xd1a9('0x1'),'required':!![]},'interface':{'type':_0xd1a9('0x1'),'required':!![]},'membername':{'type':_0xd1a9('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0xd1a9('0x2'),'required':![]}};exports[_0xd1a9('0x3')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':'string','required':!![]},'paused':{'type':_0xd1a9('0x2')},'reason':{'type':_0xd1a9('0x1'),'required':![]}};exports[_0xd1a9('0x4')]={'module':{'type':_0xd1a9('0x1'),'required':![]}};exports[_0xd1a9('0x5')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xd1a9('0x6')]={'uniqueid':{'type':_0xd1a9('0x1'),'required':!![]},'filename':{'type':_0xd1a9('0x1')},'format':{'type':_0xd1a9('0x1')},'mixmonitorid':{'type':_0xd1a9('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':'string','required':!![]}};exports[_0xd1a9('0x7')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xd1a9('0x1'),'required':!![]},'context':{'type':_0xd1a9('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 32c85cd..296f923 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 _0x4056=['dynamics365Accounts','freshsalesAccounts','faxAccounts','hasOwnProperty','mapKeys','format','SIP/%s','name','isNil','interface','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','total','unmanaged','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','initTelephones','initTrunks','isUndefined','trunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','disposition','ANSWERED','duration','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts'];(function(_0xc91292,_0x5dc1ff){var _0x50afa2=function(_0x5cdac9){while(--_0x5cdac9){_0xc91292['push'](_0xc91292['shift']());}};_0x50afa2(++_0x5dc1ff);}(_0x4056,0x1a6));var _0x6405=function(_0x45dfab,_0x3ab4b1){_0x45dfab=_0x45dfab-0x0;var _0x4060ba=_0x4056[_0x45dfab];return _0x4060ba;};'use strict';var BPromise=require('bluebird');var util=require(_0x6405('0x0'));var _=require(_0x6405('0x1'));var moment=require(_0x6405('0x2'));var Agent=require(_0x6405('0x3'));var Telephone=require(_0x6405('0x4'));var Trunk=require(_0x6405('0x5'));var VoiceQueue=require(_0x6405('0x6'));var Trigger=require(_0x6405('0x7'));var Template=require(_0x6405('0x8'));var Campaign=require(_0x6405('0x9'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x6405('0xa'));var FreshdeskAccount=require(_0x6405('0xb'));var SugarcrmAccount=require(_0x6405('0xc'));var ZohoAccount=require(_0x6405('0xd'));var DeskAccount=require(_0x6405('0xe'));var VtigerAccount=require(_0x6405('0xf'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x6405('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x6405('0x11'));var Realtime=function(){this[_0x6405('0x12')]={};this[_0x6405('0x13')]={};this['trunks']={};this[_0x6405('0x14')]={};this[_0x6405('0x15')]={};this[_0x6405('0x16')]={};this[_0x6405('0x17')]={};this[_0x6405('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x6405('0x19')]={};this[_0x6405('0x1a')]={};this[_0x6405('0x1b')]={};this[_0x6405('0x1c')]={};this[_0x6405('0x1d')]={};this[_0x6405('0x1e')]={};this['zendeskAccounts']={};this[_0x6405('0x1f')]={};this[_0x6405('0x20')]={};this[_0x6405('0x21')]={};this[_0x6405('0x22')]={};this[_0x6405('0x23')]={};this[_0x6405('0x24')]={};this[_0x6405('0x25')]={};this[_0x6405('0x26')]={};this[_0x6405('0x27')]={};this[_0x6405('0x28')]={};};function freeIsNotKey(_0x1db268,_0x204f98,_0xc3f694){var _0x344fdc=_['mapKeys'](_0x1db268,function(_0x38eece,_0x51b7fe){return _0x38eece[_0xc3f694];});for(var _0xc89814 in _0x204f98){if(_0x204f98[_0x6405('0x29')](_0xc89814)){if(!_0x344fdc[_0xc89814]){delete _0x204f98[_0xc89814];}}}}function freeIsNotKeySip(_0x3abc9c,_0x4cfe0c){var _0x58b7d8=_[_0x6405('0x2a')](_0x3abc9c,function(_0x492d1a,_0x400423){return util[_0x6405('0x2b')](_0x6405('0x2c'),_0x492d1a[_0x6405('0x2d')]);});for(var _0x43cd5f in _0x4cfe0c){if(_0x4cfe0c[_0x6405('0x29')](_0x43cd5f)){if(!_0x58b7d8[_0x43cd5f]){delete _0x4cfe0c[_0x43cd5f];}}}}function freeIsNotKeyAgent(_0x552bcf,_0x1f80af){var _0x3121cc=_[_0x6405('0x2a')](_0x552bcf,function(_0x410537,_0x1790d8){var _0x55b646=_[_0x6405('0x2e')](_0x410537[_0x6405('0x2f')])?util[_0x6405('0x2b')](_0x6405('0x2c'),_0x410537[_0x6405('0x2d')]):_0x410537[_0x6405('0x2f')];return _0x55b646;});for(var _0x9e382e in _0x1f80af){if(_0x1f80af[_0x6405('0x29')](_0x9e382e)){if(!_0x3121cc[_0x9e382e]){delete _0x1f80af[_0x9e382e];}}}}function clearVoiceCallReports(_0x480b43){_0x480b43['total']=0x0;_0x480b43[_0x6405('0x30')]=0x0;_0x480b43[_0x6405('0x31')]=0x0;_0x480b43[_0x6405('0x32')]=0x0;_0x480b43[_0x6405('0x33')]=0x0;}function clearCampaigns(_0x40a6ab){if(!_[_0x6405('0x34')](_0x40a6ab)){for(var _0x3140cd in _0x40a6ab){if(_0x40a6ab[_0x6405('0x29')](_0x3140cd)){_0x40a6ab[_0x3140cd][_0x6405('0x35')]=0x0;_0x40a6ab[_0x3140cd]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x133dda){if(!_[_0x6405('0x34')](_0x133dda)){for(var _0x3a603f in _0x133dda){if(_0x133dda[_0x6405('0x29')](_0x3a603f)){_0x133dda[_0x3a603f][_0x6405('0x36')]=0x0;_0x133dda[_0x3a603f][_0x6405('0x30')]=0x0;_0x133dda[_0x3a603f][_0x6405('0x37')]=0x0;_0x133dda[_0x3a603f]['abandoned']=0x0;_0x133dda[_0x3a603f][_0x6405('0x31')]=0x0;_0x133dda[_0x3a603f][_0x6405('0x32')]=0x0;_0x133dda[_0x3a603f][_0x6405('0x33')]=0x0;_0x133dda[_0x3a603f][_0x6405('0x38')]=0x0;_0x133dda[_0x3a603f][_0x6405('0x39')]=0x0;_0x133dda[_0x3a603f][_0x6405('0x3a')]=0x0;_0x133dda[_0x3a603f][_0x6405('0x3b')]=0x0;_0x133dda[_0x3a603f]['outboundNoSuchCallsDay']=0x0;_0x133dda[_0x3a603f]['outboundUnknownCallsDay']=0x0;_0x133dda[_0x3a603f]['outboundDropCallsDayTimeout']=0x0;_0x133dda[_0x3a603f]['outboundDropCallsDayCallersExit']=0x0;_0x133dda[_0x3a603f][_0x6405('0x3c')]=0x0;_0x133dda[_0x3a603f][_0x6405('0x3d')]=0x0;_0x133dda[_0x3a603f][_0x6405('0x3e')]=0x0;_0x133dda[_0x3a603f][_0x6405('0x3f')]=0x0;_0x133dda[_0x3a603f]['outboundAnswerAgiCallsDay']=0x0;_0x133dda[_0x3a603f]['outboundAnswerCallsDay']=0x0;_0x133dda[_0x3a603f][_0x6405('0x40')]=!![];}}}}Realtime['prototype'][_0x6405('0x41')]=function(_0x3b4b54,_0x508a02){for(var _0x3ff2fe in _0x508a02){if(_0x3b4b54[_0x6405('0x29')](_0x3ff2fe)){_0x3b4b54[_0x3ff2fe]=_0x508a02[_0x3ff2fe];}}};Realtime[_0x6405('0x42')][_0x6405('0x43')]=function(){var _0x1fc368=this;return function(_0xf76b0b){if(_0xf76b0b){freeIsNotKeyAgent(_0xf76b0b,_0x1fc368[_0x6405('0x12')]);for(var _0x4b1763=0x0,_0x56df64={},_0xef0fdd={};_0x4b1763<_0xf76b0b[_0x6405('0x44')];_0x4b1763+=0x1){_0x56df64=_0xf76b0b[_0x4b1763];var _0x1ad5c0=_[_0x6405('0x2e')](_0x56df64[_0x6405('0x2f')])?util['format'](_0x6405('0x2c'),_0x56df64[_0x6405('0x2d')]):_0x56df64['interface'];if(_['isUndefined'](_0x1fc368[_0x6405('0x12')][_0x1ad5c0])){_0x1fc368[_0x6405('0x12')][_0x1ad5c0]=new Agent(_0x56df64);}else{_0x1fc368['mergeFromDatabase'](_0x1fc368[_0x6405('0x12')][_0x1ad5c0],_0x56df64);}}}return _0x1fc368[_0x6405('0x12')];};};Realtime['prototype'][_0x6405('0x45')]=function(){var _0x7a6642=this;return function(_0x5aadf2){if(_0x5aadf2){freeIsNotKeySip(_0x5aadf2,_0x7a6642[_0x6405('0x13')]);for(var _0x264aae=0x0,_0x43824b={},_0x54ae32={};_0x264aae<_0x5aadf2['length'];_0x264aae+=0x1){_0x43824b=_0x5aadf2[_0x264aae];if(_['isUndefined'](_0x7a6642[_0x6405('0x13')][util[_0x6405('0x2b')](_0x6405('0x2c'),_0x43824b[_0x6405('0x2d')])])){_0x7a6642['telephones'][util[_0x6405('0x2b')](_0x6405('0x2c'),_0x43824b['name'])]=new Telephone(_0x43824b);}else{_0x7a6642[_0x6405('0x41')](_0x7a6642[_0x6405('0x13')][util[_0x6405('0x2b')](_0x6405('0x2c'),_0x43824b[_0x6405('0x2d')])],_0x43824b);}}}return _0x7a6642[_0x6405('0x13')];};};Realtime[_0x6405('0x42')][_0x6405('0x46')]=function(){var _0x31fc7e=this;return function(_0x2ae448){if(_0x2ae448){freeIsNotKeySip(_0x2ae448,_0x31fc7e['trunks']);for(var _0x2764d0=0x0,_0x591823={},_0x615083={};_0x2764d0<_0x2ae448['length'];_0x2764d0+=0x1){_0x591823=_0x2ae448[_0x2764d0];if(_[_0x6405('0x47')](_0x31fc7e['trunks'][util[_0x6405('0x2b')](_0x6405('0x2c'),_0x591823[_0x6405('0x2d')])])){_0x31fc7e[_0x6405('0x48')][util[_0x6405('0x2b')]('SIP/%s',_0x591823[_0x6405('0x2d')])]=new Trunk(_0x591823);}else{_0x31fc7e[_0x6405('0x41')](_0x31fc7e[_0x6405('0x48')][util[_0x6405('0x2b')](_0x6405('0x2c'),_0x591823['name'])],_0x591823);}}}return _0x31fc7e[_0x6405('0x48')];};};Realtime[_0x6405('0x42')][_0x6405('0x49')]=function(){var _0x208c15=this;return function(_0x6272ab){if(_0x6272ab){freeIsNotKey(_0x6272ab,_0x208c15[_0x6405('0x14')],_0x6405('0x2d'));for(var _0x25cea5=0x0,_0x14e456={},_0x2ca8a4={};_0x25cea5<_0x6272ab[_0x6405('0x44')];_0x25cea5+=0x1){_0x14e456=_0x6272ab[_0x25cea5];if(_[_0x6405('0x47')](_0x208c15[_0x6405('0x14')][_0x14e456['name']])){_0x208c15[_0x6405('0x14')][_0x14e456['name']]=new VoiceQueue(_0x14e456);}else{_0x208c15['mergeFromDatabase'](_0x208c15[_0x6405('0x14')][_0x14e456[_0x6405('0x2d')]],_0x14e456);}}}return _0x208c15[_0x6405('0x14')];};};Realtime['prototype'][_0x6405('0x4a')]=function(){var _0x5df42a=this;return function(_0x5010bc){if(_0x5010bc){freeIsNotKey(_0x5010bc,_0x5df42a[_0x6405('0x15')],'id');for(var _0x58d695=0x0,_0x4a1e27={},_0x6f46e6={};_0x58d695<_0x5010bc[_0x6405('0x44')];_0x58d695+=0x1){_0x4a1e27=_0x5010bc[_0x58d695];if(_['isUndefined'](_0x5df42a[_0x6405('0x15')][_0x4a1e27['id']])){_0x5df42a[_0x6405('0x15')][_0x4a1e27['id']]=new Trigger(_0x4a1e27);}else{_0x5df42a['mergeFromDatabase'](_0x5df42a[_0x6405('0x15')][_0x4a1e27['id']],_0x4a1e27);}}}return _0x5df42a['triggers'];};};Realtime[_0x6405('0x42')][_0x6405('0x4b')]=function(){var _0x1ba343=this;return function(_0x2b4ec2){if(_0x2b4ec2){freeIsNotKey(_0x2b4ec2,_0x1ba343[_0x6405('0x17')],'id');for(var _0x21ba4f=0x0,_0x3de93a={},_0x5a8fe7={};_0x21ba4f<_0x2b4ec2['length'];_0x21ba4f+=0x1){_0x3de93a=_0x2b4ec2[_0x21ba4f];if(_[_0x6405('0x47')](_0x1ba343[_0x6405('0x17')][_0x3de93a['id']])){_0x1ba343['templates'][_0x3de93a['id']]=new Template(_0x3de93a);}else{_0x1ba343[_0x6405('0x41')](_0x1ba343[_0x6405('0x17')][_0x3de93a['id']],_0x3de93a);}}}return _0x1ba343[_0x6405('0x17')];};};Realtime[_0x6405('0x42')][_0x6405('0x4c')]=function(){var _0x81bc2b=this;return function(_0x8cd742){if(_0x8cd742){freeIsNotKey(_0x8cd742,_0x81bc2b[_0x6405('0x4d')],'id');for(var _0x5e9858=0x0,_0x3297d7={},_0x459bd2={};_0x5e9858<_0x8cd742[_0x6405('0x44')];_0x5e9858+=0x1){_0x3297d7=_0x8cd742[_0x5e9858];if(_[_0x6405('0x47')](_0x81bc2b[_0x6405('0x4d')][_0x3297d7['id']])){_0x81bc2b[_0x6405('0x4d')][_0x3297d7['id']]=new ZendeskAccount(_0x3297d7);}else{_0x81bc2b[_0x6405('0x41')](_0x81bc2b[_0x6405('0x4d')][_0x3297d7['id']],_0x3297d7);}}}return _0x81bc2b[_0x6405('0x4d')];};};Realtime[_0x6405('0x42')][_0x6405('0x4e')]=function(){var _0x29e7cd=this;return function(_0x1c6772){if(_0x1c6772){freeIsNotKey(_0x1c6772,_0x29e7cd[_0x6405('0x1f')],'id');for(var _0x487c09=0x0,_0x4f6cc5={},_0x2955c6={};_0x487c09<_0x1c6772[_0x6405('0x44')];_0x487c09+=0x1){_0x4f6cc5=_0x1c6772[_0x487c09];if(_[_0x6405('0x47')](_0x29e7cd['salesforceAccounts'][_0x4f6cc5['id']])){_0x29e7cd[_0x6405('0x1f')][_0x4f6cc5['id']]=new SalesforceAccount(_0x4f6cc5);}else{_0x29e7cd['mergeFromDatabase'](_0x29e7cd[_0x6405('0x1f')][_0x4f6cc5['id']],_0x4f6cc5);}}}return _0x29e7cd[_0x6405('0x1f')];};};Realtime[_0x6405('0x42')][_0x6405('0x4f')]=function(){var _0x170fb6=this;return function(_0x14d93f){if(_0x14d93f){freeIsNotKey(_0x14d93f,_0x170fb6[_0x6405('0x21')],'id');for(var _0x3bb6a1=0x0,_0x52e477={},_0x29f825={};_0x3bb6a1<_0x14d93f[_0x6405('0x44')];_0x3bb6a1+=0x1){_0x52e477=_0x14d93f[_0x3bb6a1];if(_[_0x6405('0x47')](_0x170fb6[_0x6405('0x21')][_0x52e477['id']])){_0x170fb6[_0x6405('0x21')][_0x52e477['id']]=new FreshdeskAccount(_0x52e477);}else{_0x170fb6[_0x6405('0x41')](_0x170fb6[_0x6405('0x21')][_0x52e477['id']],_0x52e477);}}}return _0x170fb6[_0x6405('0x21')];};};Realtime[_0x6405('0x42')][_0x6405('0x50')]=function(){var _0x3e9dd4=this;return function(_0x3e5a84){if(_0x3e5a84){freeIsNotKey(_0x3e5a84,_0x3e9dd4['zohoAccounts'],'id');for(var _0x14ccc1=0x0,_0x204e3a={},_0x337f80={};_0x14ccc1<_0x3e5a84[_0x6405('0x44')];_0x14ccc1+=0x1){_0x204e3a=_0x3e5a84[_0x14ccc1];if(_[_0x6405('0x47')](_0x3e9dd4[_0x6405('0x22')][_0x204e3a['id']])){_0x3e9dd4[_0x6405('0x22')][_0x204e3a['id']]=new ZohoAccount(_0x204e3a);}else{_0x3e9dd4[_0x6405('0x41')](_0x3e9dd4[_0x6405('0x22')][_0x204e3a['id']],_0x204e3a);}}}return _0x3e9dd4[_0x6405('0x22')];};};Realtime[_0x6405('0x42')][_0x6405('0x51')]=function(){var _0x562a39=this;return function(_0x46009b){if(_0x46009b){freeIsNotKey(_0x46009b,_0x562a39[_0x6405('0x23')],'id');for(var _0x41b33e=0x0,_0x255a6c={},_0x37c6b3={};_0x41b33e<_0x46009b[_0x6405('0x44')];_0x41b33e+=0x1){_0x255a6c=_0x46009b[_0x41b33e];if(_[_0x6405('0x47')](_0x562a39[_0x6405('0x23')][_0x255a6c['id']])){_0x562a39[_0x6405('0x23')][_0x255a6c['id']]=new DeskAccount(_0x255a6c);}else{_0x562a39[_0x6405('0x41')](_0x562a39[_0x6405('0x23')][_0x255a6c['id']],_0x255a6c);}}}return _0x562a39['deskAccounts'];};};Realtime[_0x6405('0x42')][_0x6405('0x52')]=function(){var _0x345cfe=this;return function(_0x543764){if(_0x543764){freeIsNotKey(_0x543764,_0x345cfe[_0x6405('0x20')],'id');for(var _0x481cdc=0x0,_0x2a7dae={},_0x51364b={};_0x481cdc<_0x543764[_0x6405('0x44')];_0x481cdc+=0x1){_0x2a7dae=_0x543764[_0x481cdc];if(_[_0x6405('0x47')](_0x345cfe[_0x6405('0x20')][_0x2a7dae['id']])){_0x345cfe[_0x6405('0x20')][_0x2a7dae['id']]=new SugarcrmAccount(_0x2a7dae);}else{_0x345cfe[_0x6405('0x41')](_0x345cfe['sugarcrmAccounts'][_0x2a7dae['id']],_0x2a7dae);}}}return _0x345cfe[_0x6405('0x20')];};};Realtime['prototype'][_0x6405('0x53')]=function(){var _0x4f058d=this;return function(_0x568052){if(_0x568052){freeIsNotKey(_0x568052,_0x4f058d[_0x6405('0x24')],'id');for(var _0x37b38b=0x0,_0x257a80={},_0x565762={};_0x37b38b<_0x568052[_0x6405('0x44')];_0x37b38b+=0x1){_0x257a80=_0x568052[_0x37b38b];if(_[_0x6405('0x47')](_0x4f058d[_0x6405('0x24')][_0x257a80['id']])){_0x4f058d['vtigerAccounts'][_0x257a80['id']]=new VtigerAccount(_0x257a80);}else{_0x4f058d[_0x6405('0x41')](_0x4f058d[_0x6405('0x24')][_0x257a80['id']],_0x257a80);}}}return _0x4f058d[_0x6405('0x24')];};};Realtime['prototype'][_0x6405('0x54')]=function(){var _0x5b1795=this;return function(_0x184b76){if(_0x184b76){freeIsNotKey(_0x184b76,_0x5b1795[_0x6405('0x25')],'id');for(var _0x329822=0x0,_0x55c329={},_0x5422cf={};_0x329822<_0x184b76[_0x6405('0x44')];_0x329822+=0x1){_0x55c329=_0x184b76[_0x329822];if(_['isUndefined'](_0x5b1795[_0x6405('0x25')][_0x55c329['id']])){_0x5b1795['servicenowAccounts'][_0x55c329['id']]=new ServicenowAccount(_0x55c329);}else{_0x5b1795[_0x6405('0x41')](_0x5b1795[_0x6405('0x25')][_0x55c329['id']],_0x55c329);}}}return _0x5b1795[_0x6405('0x25')];};};Realtime[_0x6405('0x42')][_0x6405('0x55')]=function(){var _0x18ebe6=this;return function(_0x40be5c){if(_0x40be5c){freeIsNotKey(_0x40be5c,_0x18ebe6[_0x6405('0x26')],'id');for(var _0x2d98d3=0x0,_0x13f609={},_0x4720e5={};_0x2d98d3<_0x40be5c['length'];_0x2d98d3+=0x1){_0x13f609=_0x40be5c[_0x2d98d3];if(_[_0x6405('0x47')](_0x18ebe6[_0x6405('0x26')][_0x13f609['id']])){_0x18ebe6[_0x6405('0x26')][_0x13f609['id']]=new Dynamics365Account(_0x13f609);}else{_0x18ebe6[_0x6405('0x41')](_0x18ebe6[_0x6405('0x26')][_0x13f609['id']],_0x13f609);}}}return _0x18ebe6[_0x6405('0x26')];};};Realtime[_0x6405('0x42')][_0x6405('0x56')]=function(){var _0x52f4d0=this;return function(_0x45473f){if(_0x45473f){freeIsNotKey(_0x45473f,_0x52f4d0[_0x6405('0x27')],'id');for(var _0x1ff82e=0x0,_0xf945e1={},_0x3e30f3={};_0x1ff82e<_0x45473f[_0x6405('0x44')];_0x1ff82e+=0x1){_0xf945e1=_0x45473f[_0x1ff82e];if(_[_0x6405('0x47')](_0x52f4d0['freshsalesAccounts'][_0xf945e1['id']])){_0x52f4d0[_0x6405('0x27')][_0xf945e1['id']]=new FreshsalesAccount(_0xf945e1);}else{_0x52f4d0[_0x6405('0x41')](_0x52f4d0[_0x6405('0x27')][_0xf945e1['id']],_0xf945e1);}}}return _0x52f4d0[_0x6405('0x27')];};};Realtime['prototype'][_0x6405('0x57')]=function(){var _0x562267=this;return function(_0x143861){for(var _0x2fcabb=0x0;_0x2fcabb<_0x143861[_0x6405('0x44')];_0x2fcabb+=0x1){_[_0x6405('0x58')](_0x562267[_0x6405('0x14')][_0x143861[_0x2fcabb][_0x6405('0x2d')]],_0x143861[_0x2fcabb]);}return _0x562267['voiceQueues'];};};Realtime[_0x6405('0x42')][_0x6405('0x59')]=function(){var _0x3aa131=this;return function(_0xf5e3b7){clearVoiceQueues(_0x3aa131[_0x6405('0x14')]);if(_0xf5e3b7){_0xf5e3b7=_[_0x6405('0x5a')](_0xf5e3b7,_0x6405('0x5b'));for(var _0x17de95 in _0xf5e3b7){if(_0xf5e3b7[_0x6405('0x29')](_0x17de95)){var _0x597067={};for(var _0x4f5a75=0x0;_0x4f5a75<_0xf5e3b7[_0x17de95][_0x6405('0x44')];_0x4f5a75+=0x1){var _0x2b26a8=_0xf5e3b7[_0x17de95][_0x4f5a75][_0x6405('0x5c')];if(_0x3aa131['voiceQueues'][_0x2b26a8]){if(_0xf5e3b7[_0x17de95][_0x4f5a75][_0x6405('0x5d')]){_0x3aa131[_0x6405('0x14')][_0x2b26a8][_0x6405('0x37')]+=0x1;}if(_0xf5e3b7[_0x17de95][_0x4f5a75][_0x6405('0x5e')]){_0x3aa131[_0x6405('0x14')][_0x2b26a8][_0x6405('0x5f')]+=0x1;}_0x3aa131[_0x6405('0x14')][_0x2b26a8][_0x6405('0x31')]+=moment(_0xf5e3b7[_0x17de95][_0x4f5a75][_0x6405('0x60')])[_0x6405('0x61')](moment(_0xf5e3b7[_0x17de95][_0x4f5a75][_0x6405('0x62')]),_0x6405('0x63'))||0x0;if(_0x4f5a75===_0xf5e3b7[_0x17de95][_0x6405('0x44')]-0x1){_0x3aa131[_0x6405('0x14')][_0x2b26a8][_0x6405('0x32')]+=moment(_0xf5e3b7[_0x17de95][_0x4f5a75][_0x6405('0x64')]||_0xf5e3b7[_0x17de95][_0x4f5a75]['queuecallerabandonAt']||_0xf5e3b7[_0x17de95][_0x4f5a75][_0x6405('0x65')])[_0x6405('0x61')](moment(_0xf5e3b7[_0x17de95][_0x4f5a75][_0x6405('0x62')]),'seconds')||0x0;_0x3aa131[_0x6405('0x14')][_0x2b26a8][_0x6405('0x36')]+=0x1;if(_0xf5e3b7[_0x17de95][_0x4f5a75][_0x6405('0x66')]){_0x3aa131['voiceQueues'][_0x2b26a8][_0x6405('0x30')]+=0x1;_0x3aa131[_0x6405('0x14')][_0x2b26a8][_0x6405('0x33')]+=moment(_0xf5e3b7[_0x17de95][_0x4f5a75][_0x6405('0x64')])[_0x6405('0x61')](moment(_0xf5e3b7[_0x17de95][_0x4f5a75][_0x6405('0x60')]),_0x6405('0x63'))||0x0;}}else{_0x3aa131[_0x6405('0x14')][_0x2b26a8]['sumDuration']+=_0x3aa131['voiceQueues'][_0x2b26a8][_0x6405('0x31')]||0x0;}}}}}}return _0x3aa131[_0x6405('0x14')];};};Realtime[_0x6405('0x42')][_0x6405('0x67')]=function(){var _0x205b17=this;return function(_0x222883){clearVoiceCallReports(_0x205b17[_0x6405('0x18')]);if(_0x222883){for(var _0x5e9fbe=0x0;_0x5e9fbe<_0x222883[_0x6405('0x44')];_0x5e9fbe+=0x1){_0x205b17['outbound'][_0x6405('0x36')]+=0x1;_0x205b17[_0x6405('0x18')][_0x6405('0x32')]+=_0x222883[_0x5e9fbe]['duration'];if(_0x222883[_0x5e9fbe][_0x6405('0x68')]===_0x6405('0x69')){_0x205b17[_0x6405('0x18')]['answered']+=0x1;_0x205b17[_0x6405('0x18')][_0x6405('0x31')]+=_0x222883[_0x5e9fbe][_0x6405('0x6a')]-_0x222883[_0x5e9fbe][_0x6405('0x6b')]||0x0;_0x205b17[_0x6405('0x18')][_0x6405('0x33')]+=_0x222883[_0x5e9fbe][_0x6405('0x6b')];}}}return _0x205b17[_0x6405('0x18')];};};Realtime[_0x6405('0x42')][_0x6405('0x6c')]=function(){var _0x43c6b3=this;return function(_0x53b742){if(_0x53b742){freeIsNotKey(_0x53b742,_0x43c6b3[_0x6405('0x16')],_0x6405('0x2d'));for(var _0x384f33=0x0,_0x38835f={};_0x384f33<_0x53b742[_0x6405('0x44')];_0x384f33+=0x1){_0x38835f=_0x53b742[_0x384f33];if(_[_0x6405('0x47')](_0x43c6b3[_0x6405('0x16')][_0x38835f[_0x6405('0x2d')]])){_0x43c6b3[_0x6405('0x16')][_0x38835f[_0x6405('0x2d')]]=new Campaign(_0x38835f);}else{_0x43c6b3[_0x6405('0x41')](_0x43c6b3[_0x6405('0x16')][_0x38835f[_0x6405('0x2d')]],_0x38835f);_0x43c6b3[_0x6405('0x16')][_0x38835f[_0x6405('0x2d')]][_0x6405('0x6d')]=_0x38835f[_0x6405('0x6e')]?_0x38835f[_0x6405('0x6e')]['name']:undefined;}}}return _0x43c6b3[_0x6405('0x16')];};};Realtime[_0x6405('0x42')][_0x6405('0x6f')]=function(){var _0x248752=this;return function(_0x6b3b15){if(_0x6b3b15){freeIsNotKey(_0x6b3b15,_0x248752['voiceExtensions'],'id');for(var _0x47fab0=0x0,_0x27a516={};_0x47fab0<_0x6b3b15[_0x6405('0x44')];_0x47fab0+=0x1){_0x27a516=_0x6b3b15[_0x47fab0];if(_[_0x6405('0x47')](_0x248752['voiceExtensions'][_0x27a516['id']])){_0x248752['voiceExtensions'][_0x27a516['id']]=new VoiceExtension(_0x27a516);}else{_0x248752['mergeFromDatabase'](_0x248752['voiceExtensions'][_0x27a516['id']],_0x27a516);}}}return _0x248752[_0x6405('0x19')];};};Realtime['prototype'][_0x6405('0x70')]=function(){var _0x4dfcce=this;return function(_0x2723a8){clearCampaigns(_0x4dfcce[_0x6405('0x16')]);for(var _0x346de5=0x0;_0x346de5<_0x2723a8['length'];_0x346de5+=0x1){_[_0x6405('0x58')](_0x4dfcce[_0x6405('0x16')][_0x2723a8[_0x346de5][_0x6405('0x2d')]],_0x2723a8[_0x346de5]);}return _0x4dfcce[_0x6405('0x16')];};};Realtime[_0x6405('0x42')][_0x6405('0x71')]=function(){var _0x4572be=this;return function(_0x5b0e65){if(_0x5b0e65){freeIsNotKey(_0x5b0e65,_0x4572be[_0x6405('0x28')],'id');for(var _0x143cb2=0x0,_0x34d99b={},_0x4c551e={};_0x143cb2<_0x5b0e65[_0x6405('0x44')];_0x143cb2+=0x1){_0x34d99b=_0x5b0e65[_0x143cb2];if(_[_0x6405('0x47')](_0x4572be[_0x6405('0x28')][_0x34d99b['id']])){_0x4572be[_0x6405('0x28')][_0x34d99b['id']]=new FaxAccount(_0x34d99b);}else{_0x4572be['mergeFromDatabase'](_0x4572be[_0x6405('0x28')][_0x34d99b['id']],_0x34d99b);}}}return _0x4572be[_0x6405('0x28')];};};module[_0x6405('0x72')]=Realtime; \ No newline at end of file +var _0x71f2=['settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','isNil','interface','total','answered','sumHoldTime','sumBillable','isEmpty','unmanaged','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','mergeFromDatabase','prototype','initAgents','length','isUndefined','initTelephones','initVoiceQueues','initTriggers','initTemplates','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','groupBy','uniqueid','queue','queuecallerexit','abandoned','diff','queuecallerjoinAt','seconds','sumDuration','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','disposition','ANSWERED','duration','billableseconds','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','bluebird','lodash','moment','../model/agent','../model/trunk','../model/trigger','../model/campaign','../model/salesforceAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','templates','outbound','voiceExtensions','channels'];(function(_0x4d6aec,_0x3643d8){var _0x25ca03=function(_0x3fbd42){while(--_0x3fbd42){_0x4d6aec['push'](_0x4d6aec['shift']());}};_0x25ca03(++_0x3643d8);}(_0x71f2,0x1ca));var _0x271f=function(_0x5073ff,_0xb286d9){_0x5073ff=_0x5073ff-0x0;var _0x499d38=_0x71f2[_0x5073ff];return _0x499d38;};'use strict';var BPromise=require(_0x271f('0x0'));var util=require('util');var _=require(_0x271f('0x1'));var moment=require(_0x271f('0x2'));var Agent=require(_0x271f('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0x271f('0x4'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x271f('0x5'));var Template=require('../model/template');var Campaign=require(_0x271f('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x271f('0x7'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x271f('0x8'));var DeskAccount=require(_0x271f('0x9'));var VtigerAccount=require(_0x271f('0xa'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x271f('0xb'));var FaxAccount=require(_0x271f('0xc'));var Realtime=function(){this[_0x271f('0xd')]={};this[_0x271f('0xe')]={};this[_0x271f('0xf')]={};this[_0x271f('0x10')]={};this[_0x271f('0x11')]={};this['campaigns']={};this[_0x271f('0x12')]={};this[_0x271f('0x13')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x271f('0x14')]={};this[_0x271f('0x15')]={};this['queueChannels']={};this['outboundChannels']={};this['timers']={};this[_0x271f('0x16')]={};this[_0x271f('0x17')]={};this[_0x271f('0x18')]={};this[_0x271f('0x19')]={};this[_0x271f('0x1a')]={};this[_0x271f('0x1b')]={};this[_0x271f('0x1c')]={};this['vtigerAccounts']={};this[_0x271f('0x1d')]={};this[_0x271f('0x1e')]={};this['freshsalesAccounts']={};this[_0x271f('0x1f')]={};};function freeIsNotKey(_0x53d979,_0x69a3ce,_0x3354d7){var _0x3c9ca6=_[_0x271f('0x20')](_0x53d979,function(_0x180faa,_0x1ab874){return _0x180faa[_0x3354d7];});for(var _0x356602 in _0x69a3ce){if(_0x69a3ce['hasOwnProperty'](_0x356602)){if(!_0x3c9ca6[_0x356602]){delete _0x69a3ce[_0x356602];}}}}function freeIsNotKeySip(_0x4df1d3,_0x93174b){var _0x177082=_[_0x271f('0x20')](_0x4df1d3,function(_0x25928c,_0x3c31e0){return util[_0x271f('0x21')](_0x271f('0x22'),_0x25928c[_0x271f('0x23')]);});for(var _0x59eb4c in _0x93174b){if(_0x93174b[_0x271f('0x24')](_0x59eb4c)){if(!_0x177082[_0x59eb4c]){delete _0x93174b[_0x59eb4c];}}}}function freeIsNotKeyAgent(_0x40caf4,_0x3fb60){var _0x149554=_[_0x271f('0x20')](_0x40caf4,function(_0x54850d,_0x3f57df){var _0x444a77=_[_0x271f('0x25')](_0x54850d[_0x271f('0x26')])?util[_0x271f('0x21')](_0x271f('0x22'),_0x54850d['name']):_0x54850d[_0x271f('0x26')];return _0x444a77;});for(var _0x5d72ee in _0x3fb60){if(_0x3fb60[_0x271f('0x24')](_0x5d72ee)){if(!_0x149554[_0x5d72ee]){delete _0x3fb60[_0x5d72ee];}}}}function clearVoiceCallReports(_0x3d7c99){_0x3d7c99[_0x271f('0x27')]=0x0;_0x3d7c99[_0x271f('0x28')]=0x0;_0x3d7c99[_0x271f('0x29')]=0x0;_0x3d7c99['sumDuration']=0x0;_0x3d7c99[_0x271f('0x2a')]=0x0;}function clearCampaigns(_0x2e3665){if(!_[_0x271f('0x2b')](_0x2e3665)){for(var _0x129c18 in _0x2e3665){if(_0x2e3665['hasOwnProperty'](_0x129c18)){_0x2e3665[_0x129c18]['ivrTotalCallsDays']=0x0;_0x2e3665[_0x129c18]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x43c121){if(!_[_0x271f('0x2b')](_0x43c121)){for(var _0x2b6030 in _0x43c121){if(_0x43c121['hasOwnProperty'](_0x2b6030)){_0x43c121[_0x2b6030][_0x271f('0x27')]=0x0;_0x43c121[_0x2b6030][_0x271f('0x28')]=0x0;_0x43c121[_0x2b6030][_0x271f('0x2c')]=0x0;_0x43c121[_0x2b6030]['abandoned']=0x0;_0x43c121[_0x2b6030][_0x271f('0x29')]=0x0;_0x43c121[_0x2b6030]['sumDuration']=0x0;_0x43c121[_0x2b6030][_0x271f('0x2a')]=0x0;_0x43c121[_0x2b6030][_0x271f('0x2d')]=0x0;_0x43c121[_0x2b6030][_0x271f('0x2e')]=0x0;_0x43c121[_0x2b6030][_0x271f('0x2f')]=0x0;_0x43c121[_0x2b6030][_0x271f('0x30')]=0x0;_0x43c121[_0x2b6030][_0x271f('0x31')]=0x0;_0x43c121[_0x2b6030][_0x271f('0x32')]=0x0;_0x43c121[_0x2b6030][_0x271f('0x33')]=0x0;_0x43c121[_0x2b6030]['outboundDropCallsDayCallersExit']=0x0;_0x43c121[_0x2b6030]['outboundBlacklistCallsDay']=0x0;_0x43c121[_0x2b6030][_0x271f('0x34')]=0x0;_0x43c121[_0x2b6030][_0x271f('0x35')]=0x0;_0x43c121[_0x2b6030][_0x271f('0x36')]=0x0;_0x43c121[_0x2b6030][_0x271f('0x2d')]=0x0;_0x43c121[_0x2b6030][_0x271f('0x37')]=0x0;_0x43c121[_0x2b6030]['queueStatusComplete']=!![];}}}}Realtime['prototype'][_0x271f('0x38')]=function(_0x342980,_0x5f9dfc){for(var _0x4cd038 in _0x5f9dfc){if(_0x342980['hasOwnProperty'](_0x4cd038)){_0x342980[_0x4cd038]=_0x5f9dfc[_0x4cd038];}}};Realtime[_0x271f('0x39')][_0x271f('0x3a')]=function(){var _0x3e098b=this;return function(_0x10a70a){if(_0x10a70a){freeIsNotKeyAgent(_0x10a70a,_0x3e098b['agents']);for(var _0x3f3f55=0x0,_0x2d6032={},_0x4e3a8b={};_0x3f3f55<_0x10a70a[_0x271f('0x3b')];_0x3f3f55+=0x1){_0x2d6032=_0x10a70a[_0x3f3f55];var _0x294459=_[_0x271f('0x25')](_0x2d6032[_0x271f('0x26')])?util['format'](_0x271f('0x22'),_0x2d6032[_0x271f('0x23')]):_0x2d6032['interface'];if(_[_0x271f('0x3c')](_0x3e098b[_0x271f('0xd')][_0x294459])){_0x3e098b[_0x271f('0xd')][_0x294459]=new Agent(_0x2d6032);}else{_0x3e098b[_0x271f('0x38')](_0x3e098b[_0x271f('0xd')][_0x294459],_0x2d6032);}}}return _0x3e098b[_0x271f('0xd')];};};Realtime[_0x271f('0x39')][_0x271f('0x3d')]=function(){var _0x4dd5e9=this;return function(_0x57b4c2){if(_0x57b4c2){freeIsNotKeySip(_0x57b4c2,_0x4dd5e9[_0x271f('0xe')]);for(var _0x20eedc=0x0,_0x158974={},_0x41151e={};_0x20eedc<_0x57b4c2[_0x271f('0x3b')];_0x20eedc+=0x1){_0x158974=_0x57b4c2[_0x20eedc];if(_[_0x271f('0x3c')](_0x4dd5e9[_0x271f('0xe')][util[_0x271f('0x21')](_0x271f('0x22'),_0x158974[_0x271f('0x23')])])){_0x4dd5e9[_0x271f('0xe')][util[_0x271f('0x21')](_0x271f('0x22'),_0x158974[_0x271f('0x23')])]=new Telephone(_0x158974);}else{_0x4dd5e9[_0x271f('0x38')](_0x4dd5e9['telephones'][util[_0x271f('0x21')](_0x271f('0x22'),_0x158974[_0x271f('0x23')])],_0x158974);}}}return _0x4dd5e9[_0x271f('0xe')];};};Realtime[_0x271f('0x39')]['initTrunks']=function(){var _0x1777d9=this;return function(_0x579cd6){if(_0x579cd6){freeIsNotKeySip(_0x579cd6,_0x1777d9[_0x271f('0xf')]);for(var _0x560bbb=0x0,_0x16e9ba={},_0x4d52a9={};_0x560bbb<_0x579cd6[_0x271f('0x3b')];_0x560bbb+=0x1){_0x16e9ba=_0x579cd6[_0x560bbb];if(_[_0x271f('0x3c')](_0x1777d9[_0x271f('0xf')][util[_0x271f('0x21')](_0x271f('0x22'),_0x16e9ba[_0x271f('0x23')])])){_0x1777d9[_0x271f('0xf')][util[_0x271f('0x21')](_0x271f('0x22'),_0x16e9ba[_0x271f('0x23')])]=new Trunk(_0x16e9ba);}else{_0x1777d9['mergeFromDatabase'](_0x1777d9[_0x271f('0xf')][util[_0x271f('0x21')]('SIP/%s',_0x16e9ba[_0x271f('0x23')])],_0x16e9ba);}}}return _0x1777d9[_0x271f('0xf')];};};Realtime[_0x271f('0x39')][_0x271f('0x3e')]=function(){var _0x2ad3f2=this;return function(_0x19858a){if(_0x19858a){freeIsNotKey(_0x19858a,_0x2ad3f2[_0x271f('0x10')],'name');for(var _0x3cfe13=0x0,_0x2e1599={},_0x258136={};_0x3cfe13<_0x19858a['length'];_0x3cfe13+=0x1){_0x2e1599=_0x19858a[_0x3cfe13];if(_[_0x271f('0x3c')](_0x2ad3f2[_0x271f('0x10')][_0x2e1599[_0x271f('0x23')]])){_0x2ad3f2[_0x271f('0x10')][_0x2e1599[_0x271f('0x23')]]=new VoiceQueue(_0x2e1599);}else{_0x2ad3f2[_0x271f('0x38')](_0x2ad3f2[_0x271f('0x10')][_0x2e1599[_0x271f('0x23')]],_0x2e1599);}}}return _0x2ad3f2[_0x271f('0x10')];};};Realtime['prototype'][_0x271f('0x3f')]=function(){var _0x470142=this;return function(_0x19cf5d){if(_0x19cf5d){freeIsNotKey(_0x19cf5d,_0x470142[_0x271f('0x11')],'id');for(var _0x5bc9e4=0x0,_0x2748e4={},_0x33a06b={};_0x5bc9e4<_0x19cf5d[_0x271f('0x3b')];_0x5bc9e4+=0x1){_0x2748e4=_0x19cf5d[_0x5bc9e4];if(_[_0x271f('0x3c')](_0x470142[_0x271f('0x11')][_0x2748e4['id']])){_0x470142['triggers'][_0x2748e4['id']]=new Trigger(_0x2748e4);}else{_0x470142['mergeFromDatabase'](_0x470142[_0x271f('0x11')][_0x2748e4['id']],_0x2748e4);}}}return _0x470142[_0x271f('0x11')];};};Realtime[_0x271f('0x39')][_0x271f('0x40')]=function(){var _0x1e1703=this;return function(_0x5f0477){if(_0x5f0477){freeIsNotKey(_0x5f0477,_0x1e1703['templates'],'id');for(var _0x1871b0=0x0,_0x21ba27={},_0x219dc0={};_0x1871b0<_0x5f0477[_0x271f('0x3b')];_0x1871b0+=0x1){_0x21ba27=_0x5f0477[_0x1871b0];if(_[_0x271f('0x3c')](_0x1e1703[_0x271f('0x12')][_0x21ba27['id']])){_0x1e1703[_0x271f('0x12')][_0x21ba27['id']]=new Template(_0x21ba27);}else{_0x1e1703[_0x271f('0x38')](_0x1e1703[_0x271f('0x12')][_0x21ba27['id']],_0x21ba27);}}}return _0x1e1703[_0x271f('0x12')];};};Realtime['prototype']['initZendeskAccounts']=function(){var _0x460af=this;return function(_0xab8bc9){if(_0xab8bc9){freeIsNotKey(_0xab8bc9,_0x460af[_0x271f('0x17')],'id');for(var _0x2b5805=0x0,_0x530481={},_0x47424d={};_0x2b5805<_0xab8bc9[_0x271f('0x3b')];_0x2b5805+=0x1){_0x530481=_0xab8bc9[_0x2b5805];if(_['isUndefined'](_0x460af[_0x271f('0x17')][_0x530481['id']])){_0x460af['zendeskAccounts'][_0x530481['id']]=new ZendeskAccount(_0x530481);}else{_0x460af[_0x271f('0x38')](_0x460af[_0x271f('0x17')][_0x530481['id']],_0x530481);}}}return _0x460af[_0x271f('0x17')];};};Realtime[_0x271f('0x39')]['initSalesforceAccounts']=function(){var _0x58e15c=this;return function(_0xd33c91){if(_0xd33c91){freeIsNotKey(_0xd33c91,_0x58e15c['salesforceAccounts'],'id');for(var _0x1e0ecb=0x0,_0x139500={},_0x591fd6={};_0x1e0ecb<_0xd33c91[_0x271f('0x3b')];_0x1e0ecb+=0x1){_0x139500=_0xd33c91[_0x1e0ecb];if(_[_0x271f('0x3c')](_0x58e15c[_0x271f('0x18')][_0x139500['id']])){_0x58e15c[_0x271f('0x18')][_0x139500['id']]=new SalesforceAccount(_0x139500);}else{_0x58e15c['mergeFromDatabase'](_0x58e15c['salesforceAccounts'][_0x139500['id']],_0x139500);}}}return _0x58e15c['salesforceAccounts'];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x1acbc5=this;return function(_0x388c94){if(_0x388c94){freeIsNotKey(_0x388c94,_0x1acbc5['freshdeskAccounts'],'id');for(var _0x5e4df5=0x0,_0x5a0e1b={},_0x2642bc={};_0x5e4df5<_0x388c94[_0x271f('0x3b')];_0x5e4df5+=0x1){_0x5a0e1b=_0x388c94[_0x5e4df5];if(_['isUndefined'](_0x1acbc5['freshdeskAccounts'][_0x5a0e1b['id']])){_0x1acbc5['freshdeskAccounts'][_0x5a0e1b['id']]=new FreshdeskAccount(_0x5a0e1b);}else{_0x1acbc5[_0x271f('0x38')](_0x1acbc5[_0x271f('0x1a')][_0x5a0e1b['id']],_0x5a0e1b);}}}return _0x1acbc5['freshdeskAccounts'];};};Realtime[_0x271f('0x39')]['initZohoAccounts']=function(){var _0x440f89=this;return function(_0x98ffdb){if(_0x98ffdb){freeIsNotKey(_0x98ffdb,_0x440f89['zohoAccounts'],'id');for(var _0x5e4227=0x0,_0x4e7b17={},_0xbf085={};_0x5e4227<_0x98ffdb['length'];_0x5e4227+=0x1){_0x4e7b17=_0x98ffdb[_0x5e4227];if(_[_0x271f('0x3c')](_0x440f89[_0x271f('0x1b')][_0x4e7b17['id']])){_0x440f89['zohoAccounts'][_0x4e7b17['id']]=new ZohoAccount(_0x4e7b17);}else{_0x440f89[_0x271f('0x38')](_0x440f89[_0x271f('0x1b')][_0x4e7b17['id']],_0x4e7b17);}}}return _0x440f89[_0x271f('0x1b')];};};Realtime[_0x271f('0x39')]['initDeskAccounts']=function(){var _0x297fc1=this;return function(_0xe10dbb){if(_0xe10dbb){freeIsNotKey(_0xe10dbb,_0x297fc1[_0x271f('0x1c')],'id');for(var _0x3157cd=0x0,_0x404fe4={},_0x29fa61={};_0x3157cd<_0xe10dbb[_0x271f('0x3b')];_0x3157cd+=0x1){_0x404fe4=_0xe10dbb[_0x3157cd];if(_[_0x271f('0x3c')](_0x297fc1[_0x271f('0x1c')][_0x404fe4['id']])){_0x297fc1[_0x271f('0x1c')][_0x404fe4['id']]=new DeskAccount(_0x404fe4);}else{_0x297fc1[_0x271f('0x38')](_0x297fc1[_0x271f('0x1c')][_0x404fe4['id']],_0x404fe4);}}}return _0x297fc1[_0x271f('0x1c')];};};Realtime[_0x271f('0x39')][_0x271f('0x41')]=function(){var _0x2453c4=this;return function(_0xbf8f4b){if(_0xbf8f4b){freeIsNotKey(_0xbf8f4b,_0x2453c4[_0x271f('0x19')],'id');for(var _0x33ae4d=0x0,_0x3c18d9={},_0x1038ba={};_0x33ae4d<_0xbf8f4b[_0x271f('0x3b')];_0x33ae4d+=0x1){_0x3c18d9=_0xbf8f4b[_0x33ae4d];if(_[_0x271f('0x3c')](_0x2453c4[_0x271f('0x19')][_0x3c18d9['id']])){_0x2453c4[_0x271f('0x19')][_0x3c18d9['id']]=new SugarcrmAccount(_0x3c18d9);}else{_0x2453c4[_0x271f('0x38')](_0x2453c4[_0x271f('0x19')][_0x3c18d9['id']],_0x3c18d9);}}}return _0x2453c4[_0x271f('0x19')];};};Realtime['prototype'][_0x271f('0x42')]=function(){var _0x37d150=this;return function(_0x323e2a){if(_0x323e2a){freeIsNotKey(_0x323e2a,_0x37d150[_0x271f('0x43')],'id');for(var _0x75139=0x0,_0x5aa95b={},_0x20a3b5={};_0x75139<_0x323e2a['length'];_0x75139+=0x1){_0x5aa95b=_0x323e2a[_0x75139];if(_[_0x271f('0x3c')](_0x37d150[_0x271f('0x43')][_0x5aa95b['id']])){_0x37d150[_0x271f('0x43')][_0x5aa95b['id']]=new VtigerAccount(_0x5aa95b);}else{_0x37d150[_0x271f('0x38')](_0x37d150['vtigerAccounts'][_0x5aa95b['id']],_0x5aa95b);}}}return _0x37d150[_0x271f('0x43')];};};Realtime[_0x271f('0x39')][_0x271f('0x44')]=function(){var _0x545e23=this;return function(_0x472a23){if(_0x472a23){freeIsNotKey(_0x472a23,_0x545e23[_0x271f('0x1d')],'id');for(var _0x49be53=0x0,_0x3d7c0e={},_0x473794={};_0x49be53<_0x472a23['length'];_0x49be53+=0x1){_0x3d7c0e=_0x472a23[_0x49be53];if(_[_0x271f('0x3c')](_0x545e23['servicenowAccounts'][_0x3d7c0e['id']])){_0x545e23[_0x271f('0x1d')][_0x3d7c0e['id']]=new ServicenowAccount(_0x3d7c0e);}else{_0x545e23[_0x271f('0x38')](_0x545e23[_0x271f('0x1d')][_0x3d7c0e['id']],_0x3d7c0e);}}}return _0x545e23[_0x271f('0x1d')];};};Realtime[_0x271f('0x39')][_0x271f('0x45')]=function(){var _0xdd5500=this;return function(_0x4f8e9c){if(_0x4f8e9c){freeIsNotKey(_0x4f8e9c,_0xdd5500['dynamics365Accounts'],'id');for(var _0x25ba4e=0x0,_0x2cb31b={},_0x2f577c={};_0x25ba4e<_0x4f8e9c[_0x271f('0x3b')];_0x25ba4e+=0x1){_0x2cb31b=_0x4f8e9c[_0x25ba4e];if(_[_0x271f('0x3c')](_0xdd5500['dynamics365Accounts'][_0x2cb31b['id']])){_0xdd5500['dynamics365Accounts'][_0x2cb31b['id']]=new Dynamics365Account(_0x2cb31b);}else{_0xdd5500[_0x271f('0x38')](_0xdd5500['dynamics365Accounts'][_0x2cb31b['id']],_0x2cb31b);}}}return _0xdd5500[_0x271f('0x1e')];};};Realtime[_0x271f('0x39')][_0x271f('0x46')]=function(){var _0x2b52e5=this;return function(_0xc05b6b){if(_0xc05b6b){freeIsNotKey(_0xc05b6b,_0x2b52e5[_0x271f('0x47')],'id');for(var _0x57b086=0x0,_0x4772ed={},_0x3b8d9a={};_0x57b086<_0xc05b6b[_0x271f('0x3b')];_0x57b086+=0x1){_0x4772ed=_0xc05b6b[_0x57b086];if(_[_0x271f('0x3c')](_0x2b52e5[_0x271f('0x47')][_0x4772ed['id']])){_0x2b52e5[_0x271f('0x47')][_0x4772ed['id']]=new FreshsalesAccount(_0x4772ed);}else{_0x2b52e5[_0x271f('0x38')](_0x2b52e5[_0x271f('0x47')][_0x4772ed['id']],_0x4772ed);}}}return _0x2b52e5[_0x271f('0x47')];};};Realtime['prototype'][_0x271f('0x48')]=function(){var _0x34c854=this;return function(_0xbd0d05){for(var _0x183606=0x0;_0x183606<_0xbd0d05[_0x271f('0x3b')];_0x183606+=0x1){_['merge'](_0x34c854[_0x271f('0x10')][_0xbd0d05[_0x183606][_0x271f('0x23')]],_0xbd0d05[_0x183606]);}return _0x34c854[_0x271f('0x10')];};};Realtime[_0x271f('0x39')]['initVoiceQueueReports']=function(){var _0x2a2275=this;return function(_0x4e74ac){clearVoiceQueues(_0x2a2275[_0x271f('0x10')]);if(_0x4e74ac){_0x4e74ac=_[_0x271f('0x49')](_0x4e74ac,_0x271f('0x4a'));for(var _0x2643e4 in _0x4e74ac){if(_0x4e74ac[_0x271f('0x24')](_0x2643e4)){var _0x178e66={};for(var _0x58b968=0x0;_0x58b968<_0x4e74ac[_0x2643e4][_0x271f('0x3b')];_0x58b968+=0x1){var _0x336f91=_0x4e74ac[_0x2643e4][_0x58b968][_0x271f('0x4b')];if(_0x2a2275[_0x271f('0x10')][_0x336f91]){if(_0x4e74ac[_0x2643e4][_0x58b968][_0x271f('0x4c')]){_0x2a2275[_0x271f('0x10')][_0x336f91]['unmanaged']+=0x1;}if(_0x4e74ac[_0x2643e4][_0x58b968]['queuecallerabandon']){_0x2a2275[_0x271f('0x10')][_0x336f91][_0x271f('0x4d')]+=0x1;}_0x2a2275['voiceQueues'][_0x336f91][_0x271f('0x29')]+=moment(_0x4e74ac[_0x2643e4][_0x58b968]['queuecallerleaveAt'])[_0x271f('0x4e')](moment(_0x4e74ac[_0x2643e4][_0x58b968][_0x271f('0x4f')]),_0x271f('0x50'))||0x0;if(_0x58b968===_0x4e74ac[_0x2643e4][_0x271f('0x3b')]-0x1){_0x2a2275[_0x271f('0x10')][_0x336f91][_0x271f('0x51')]+=moment(_0x4e74ac[_0x2643e4][_0x58b968][_0x271f('0x52')]||_0x4e74ac[_0x2643e4][_0x58b968][_0x271f('0x53')]||_0x4e74ac[_0x2643e4][_0x58b968][_0x271f('0x54')])[_0x271f('0x4e')](moment(_0x4e74ac[_0x2643e4][_0x58b968][_0x271f('0x4f')]),_0x271f('0x50'))||0x0;_0x2a2275['voiceQueues'][_0x336f91][_0x271f('0x27')]+=0x1;if(_0x4e74ac[_0x2643e4][_0x58b968][_0x271f('0x55')]){_0x2a2275[_0x271f('0x10')][_0x336f91][_0x271f('0x28')]+=0x1;_0x2a2275['voiceQueues'][_0x336f91][_0x271f('0x2a')]+=moment(_0x4e74ac[_0x2643e4][_0x58b968][_0x271f('0x52')])[_0x271f('0x4e')](moment(_0x4e74ac[_0x2643e4][_0x58b968]['queuecallerleaveAt']),_0x271f('0x50'))||0x0;}}else{_0x2a2275[_0x271f('0x10')][_0x336f91][_0x271f('0x51')]+=_0x2a2275['voiceQueues'][_0x336f91][_0x271f('0x29')]||0x0;}}}}}}return _0x2a2275[_0x271f('0x10')];};};Realtime[_0x271f('0x39')]['initVoiceCallReports']=function(){var _0x3f4ce0=this;return function(_0x15edfe){clearVoiceCallReports(_0x3f4ce0[_0x271f('0x13')]);if(_0x15edfe){for(var _0x4e1255=0x0;_0x4e1255<_0x15edfe['length'];_0x4e1255+=0x1){_0x3f4ce0[_0x271f('0x13')][_0x271f('0x27')]+=0x1;_0x3f4ce0[_0x271f('0x13')][_0x271f('0x51')]+=_0x15edfe[_0x4e1255]['duration'];if(_0x15edfe[_0x4e1255][_0x271f('0x56')]===_0x271f('0x57')){_0x3f4ce0[_0x271f('0x13')][_0x271f('0x28')]+=0x1;_0x3f4ce0[_0x271f('0x13')][_0x271f('0x29')]+=_0x15edfe[_0x4e1255][_0x271f('0x58')]-_0x15edfe[_0x4e1255][_0x271f('0x59')]||0x0;_0x3f4ce0[_0x271f('0x13')][_0x271f('0x2a')]+=_0x15edfe[_0x4e1255][_0x271f('0x59')];}}}return _0x3f4ce0['outbound'];};};Realtime[_0x271f('0x39')]['initCampaigns']=function(){var _0x3f1549=this;return function(_0x515356){if(_0x515356){freeIsNotKey(_0x515356,_0x3f1549['campaigns'],_0x271f('0x23'));for(var _0x4f9fb0=0x0,_0x2c3ea7={};_0x4f9fb0<_0x515356[_0x271f('0x3b')];_0x4f9fb0+=0x1){_0x2c3ea7=_0x515356[_0x4f9fb0];if(_['isUndefined'](_0x3f1549[_0x271f('0x5a')][_0x2c3ea7[_0x271f('0x23')]])){_0x3f1549[_0x271f('0x5a')][_0x2c3ea7[_0x271f('0x23')]]=new Campaign(_0x2c3ea7);}else{_0x3f1549[_0x271f('0x38')](_0x3f1549['campaigns'][_0x2c3ea7['name']],_0x2c3ea7);_0x3f1549['campaigns'][_0x2c3ea7[_0x271f('0x23')]][_0x271f('0x5b')]=_0x2c3ea7[_0x271f('0x5c')]?_0x2c3ea7['SquareProject'][_0x271f('0x23')]:undefined;}}}return _0x3f1549[_0x271f('0x5a')];};};Realtime[_0x271f('0x39')][_0x271f('0x5d')]=function(){var _0x526fc9=this;return function(_0x2c27fe){if(_0x2c27fe){freeIsNotKey(_0x2c27fe,_0x526fc9['voiceExtensions'],'id');for(var _0x3416cf=0x0,_0x24a011={};_0x3416cf<_0x2c27fe['length'];_0x3416cf+=0x1){_0x24a011=_0x2c27fe[_0x3416cf];if(_[_0x271f('0x3c')](_0x526fc9[_0x271f('0x14')][_0x24a011['id']])){_0x526fc9[_0x271f('0x14')][_0x24a011['id']]=new VoiceExtension(_0x24a011);}else{_0x526fc9['mergeFromDatabase'](_0x526fc9['voiceExtensions'][_0x24a011['id']],_0x24a011);}}}return _0x526fc9[_0x271f('0x14')];};};Realtime[_0x271f('0x39')][_0x271f('0x5e')]=function(){var _0xe8248a=this;return function(_0x4c7e7a){clearCampaigns(_0xe8248a[_0x271f('0x5a')]);for(var _0x58c270=0x0;_0x58c270<_0x4c7e7a['length'];_0x58c270+=0x1){_['merge'](_0xe8248a[_0x271f('0x5a')][_0x4c7e7a[_0x58c270]['name']],_0x4c7e7a[_0x58c270]);}return _0xe8248a['campaigns'];};};Realtime[_0x271f('0x39')][_0x271f('0x5f')]=function(){var _0x218a8e=this;return function(_0x4e3e72){if(_0x4e3e72){freeIsNotKey(_0x4e3e72,_0x218a8e[_0x271f('0x1f')],'id');for(var _0xa3a718=0x0,_0x5273e6={},_0xe83f8e={};_0xa3a718<_0x4e3e72[_0x271f('0x3b')];_0xa3a718+=0x1){_0x5273e6=_0x4e3e72[_0xa3a718];if(_[_0x271f('0x3c')](_0x218a8e['faxAccounts'][_0x5273e6['id']])){_0x218a8e[_0x271f('0x1f')][_0x5273e6['id']]=new FaxAccount(_0x5273e6);}else{_0x218a8e[_0x271f('0x38')](_0x218a8e[_0x271f('0x1f')][_0x5273e6['id']],_0x5273e6);}}}return _0x218a8e['faxAccounts'];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index b936c0f..f148ff6 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 _0xf54e=['monitorFilename','filename','createdAt','connectedlinename','xcally-motion-dialer','isArray','forEach','voiceDialReport','startsWith','substring','indexOf','mobile','phone','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','agents','telephones','sync','realtime','disabled','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindTransfer','attendedTransfer','prototype','findAgent','find','accountcode','name','isNil','interface','SIP/%s','length','connectedlinenum','assigned','queuecallercomplete','queuecallercompleteAt','format','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','match','keys','getCallType','channel','split','getAgentByInternal','calleridnum','outbound','internal','destination','exten','type','lastapplication','queue','lastdata','context','callerid','xcally-motion-preview','calleridpreview','destinationchannel','originatecalleridnum','disposition','ANSWERED','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','membername','create','monitor','monitors'];(function(_0x29c243,_0x290caa){var _0x15326b=function(_0x232b34){while(--_0x232b34){_0x29c243['push'](_0x29c243['shift']());}};_0x15326b(++_0x290caa);}(_0xf54e,0x65));var _0xef54=function(_0x458363,_0x1675db){_0x458363=_0x458363-0x0;var _0x4d0290=_0xf54e[_0x458363];return _0x4d0290;};'use strict';var _=require(_0xef54('0x0'));var moment=require(_0xef54('0x1'));var util=require(_0xef54('0x2'));var config=require(_0xef54('0x3'));var ami=require(_0xef54('0x4'));var RpcVoiceAgentReport=require(_0xef54('0x5'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0xef54('0x6'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xef54('0x7'));var RpcVoiceTransferReport=require(_0xef54('0x8'));var VoiceQueueReport=require(_0xef54('0x9'));var VoiceCallReport=require(_0xef54('0xa'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xef54('0xb'));var UserReport=require('./userReport');function Report(_0x4e8259){this['realtime']=_0x4e8259;this['agents']=_0x4e8259[_0xef54('0xc')];this[_0xef54('0xd')]=_0x4e8259['telephones'];}Report['prototype'][_0xef54('0xe')]=function(_0x5078fb){var _0x263dd2=new VoiceQueueReport(this[_0xef54('0xf')]);var _0x24f9cc=new VoiceAgentReport(this[_0xef54('0xf')]);var _0x2e61d1=new VoiceDialReport(this[_0xef54('0xf')]);var _0x31b848=new VoiceCallReport(this['realtime']);var _0x3c47ec=new UserReport(this[_0xef54('0xf')]);if(config['xdr']&&config['xdr'][_0xef54('0x10')]){ami['on']('custom:voiceQueueReport',this[_0xef54('0x11')][_0xef54('0x12')](this));ami['on']('custom:voiceCallReport',this[_0xef54('0x13')][_0xef54('0x12')](this));ami['on'](_0xef54('0x14'),this[_0xef54('0x15')][_0xef54('0x12')](this));ami['on'](_0xef54('0x16'),this['voiceDialReport']['bind'](this));ami['on']('blindtransfer',this[_0xef54('0x17')]['bind'](this));ami['on']('attendedtransfer',this[_0xef54('0x18')][_0xef54('0x12')](this));}};Report[_0xef54('0x19')][_0xef54('0x1a')]=function(_0x39b0a1){var _0xcf1296;_0xcf1296=_[_0xef54('0x1b')](this[_0xef54('0xc')],function(_0x5813d2){return _0x5813d2[_0xef54('0x1c')]==_0x39b0a1||_0x5813d2[_0xef54('0x1d')]==_0x39b0a1;});if(_[_0xef54('0x1e')](_0xcf1296)){var _0x3fb7b2=_[_0xef54('0x1b')](this[_0xef54('0xd')],function(_0x4368d0){return _0x4368d0[_0xef54('0x1c')]==_0x39b0a1||_0x4368d0[_0xef54('0x1d')]==_0x39b0a1;});if(_0x3fb7b2){_0xcf1296=_[_0xef54('0x1b')](this[_0xef54('0xc')],function(_0x48ff97){return _0x48ff97[_0xef54('0x1f')]==util['format'](_0xef54('0x20'),_0x3fb7b2[_0xef54('0x1d')]);});}}return _0xcf1296;};Report['prototype'][_0xef54('0x11')]=function(_0x17684c){for(var _0x49f517=0x0;_0x49f517<_0x17684c[_0xef54('0x21')];_0x49f517+=0x1){var _0x109880=this[_0xef54('0x1a')](_0x17684c[_0x49f517][_0xef54('0x22')]);if(_0x109880){_0x17684c[_0x49f517][_0xef54('0x1c')]=_0x109880[_0xef54('0x1c')];_0x17684c[_0x49f517][_0xef54('0x23')]=!![];_0x17684c[_0x49f517]['lastAssignedTo']=_0x109880[_0xef54('0x1d')];_0x17684c[_0x49f517][_0xef54('0x1f')]=_[_0xef54('0x1e')](_0x109880[_0xef54('0x1f')])?util['format'](_0xef54('0x20'),_0x109880['name']):_0x109880[_0xef54('0x1f')];if(_0x17684c[_0x49f517][_0xef54('0x24')]){_0x17684c[_0x49f517][_0xef54('0x25')]=moment()[_0xef54('0x26')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x17684c[_0x49f517][_0xef54('0x27')]){_0x17684c[_0x49f517][_0xef54('0x28')]=moment()['format'](_0xef54('0x29'));}RpcMemberReport[_0xef54('0x11')](_0x17684c[_0x49f517]);}RpcVoiceQueueReport['create'](_0x17684c[_0x49f517]);}};function extractCalleridNumber(_0x722cbd){var _0x108f3d=_0x722cbd[_0xef54('0x2a')](/<(.*?)>/);return _0x108f3d?_0x108f3d[0x1]:_0x722cbd;}Report['prototype']['getAgentByInternal']=function(_0x2004d1){for(var _0x5b77e0=0x0;_0x5b77e0',_0x13d141[_0xef54('0x41')],_0x13d141['calleridnum']);}if(RpcVoiceTransferReport[_0xef54('0x42')][_0x13d141[_0xef54('0x43')]]){var _0x18a3c7=RpcVoiceTransferReport['transfers'][_0x13d141[_0xef54('0x43')]];_0x18a3c7[_0xef54('0x44')]=_0x13d141[_0xef54('0x45')];RpcVoiceTransferReport[_0xef54('0x17')](_0x18a3c7);delete RpcVoiceTransferReport[_0xef54('0x42')][_0x13d141[_0xef54('0x43')]];}if(_['isNil'](_0x13d141[_0xef54('0x35')])){_0x13d141[_0xef54('0x35')]=this[_0xef54('0x2c')](_0x13d141);}if(_[_0xef54('0x1e')](_0x13d141[_0xef54('0x46')])){var _0x3d2745=_0x13d141[_0xef54('0x2d')][_0xef54('0x2e')]('-')[0x0];var _0x9e0dab=this['agents'][_0x3d2745];if(!_0x9e0dab)_0x9e0dab=this[_0xef54('0x2f')](_0x13d141[_0xef54('0x1c')]);if(_0x9e0dab){_0x13d141[_0xef54('0x46')]=_0x9e0dab['id'];_0x13d141[_0xef54('0x47')]=_0x9e0dab['name'];}}RpcVoiceCallReport[_0xef54('0x48')](_0x13d141);if(_0x13d141[_0xef54('0x49')]){for(var _0x42d410=0x0;_0x42d410<_0x13d141[_0xef54('0x4a')][_0xef54('0x21')];_0x42d410+=0x1){_0x13d141[_0xef54('0x4b')]=_0x13d141['monitors'][_0x42d410][_0xef54('0x4c')];_0x13d141[_0xef54('0x4d')]=_0x13d141['monitors'][_0x42d410]['createdAt'];if(_0x13d141[_0xef54('0x34')]==_0xef54('0x3b')){_0x13d141[_0xef54('0x30')]=_0x13d141[_0xef54('0x22')];_0x13d141[_0xef54('0x41')]=_0x13d141['connectedlinename'];_0x13d141[_0xef54('0x22')]=_0x13d141[_0xef54('0x1c')];_0x13d141[_0xef54('0x4e')]=_0x13d141[_0xef54('0x47')];_0x13d141['exten']=_0x13d141[_0xef54('0x3e')];}else if(_0x13d141[_0xef54('0x34')]==_0xef54('0x4f')){_0x13d141['calleridnum']=_0x13d141[_0xef54('0x33')];_0x13d141['exten']=_0x13d141[_0xef54('0x3e')];}RpcVoiceRecording[_0xef54('0x48')](_0x13d141);}}};Report[_0xef54('0x19')][_0xef54('0x15')]=function(_0x4e3226){if(_[_0xef54('0x50')](_0x4e3226)){_0x4e3226[_0xef54('0x51')](function(_0x3c8beb){RpcVoiceAgentReport[_0xef54('0x48')](_0x3c8beb);});}else{RpcVoiceAgentReport[_0xef54('0x48')](_0x4e3226);}};Report[_0xef54('0x19')][_0xef54('0x52')]=function(_0x4889c7){RpcVoiceDialReport[_0xef54('0x48')](_0x4889c7);var _0x39ea8c;var _0x25d52b;var _0xa96ca1=_0x4889c7[_0xef54('0x2d')];if(_[_0xef54('0x53')](_0xa96ca1,'Local')){_0x25d52b=_0xa96ca1[_0xef54('0x54')](_0xa96ca1['indexOf']('/')+0x1,_0xa96ca1[_0xef54('0x55')]('@'));_0x39ea8c=_[_0xef54('0x1b')](this[_0xef54('0xc')],function(_0x1caaae){return _0x1caaae[_0xef54('0x56')]==_0x25d52b||_0x1caaae[_0xef54('0x57')]==_0x25d52b||_0x1caaae['accountcode']==_0x25d52b;});}else{_0x25d52b=_0xa96ca1[_0xef54('0x54')](_0xa96ca1[_0xef54('0x55')]('/')+0x1,_0xa96ca1['lastIndexOf']('-'));_0x39ea8c=this[_0xef54('0x1a')](_0x25d52b);}if(_0x39ea8c){_0x4889c7['interface']=_['isNil'](_0x39ea8c[_0xef54('0x1f')])?util[_0xef54('0x26')](_0xef54('0x20'),_0x39ea8c[_0xef54('0x1d')]):_0x39ea8c[_0xef54('0x1f')];_0x4889c7['membername']=_0x39ea8c[_0xef54('0x1d')];_0x4889c7[_0xef54('0x1c')]=_0x39ea8c['accountcode'];RpcMemberReport[_0xef54('0x52')](_0x4889c7);}};Report[_0xef54('0x19')][_0xef54('0x17')]=function(_0xc35f60){RpcVoiceTransferReport[_0xef54('0x42')][_0xc35f60['transfererlinkedid']]=_0xc35f60;};Report['prototype'][_0xef54('0x18')]=function(_0x556ce3){RpcVoiceTransferReport[_0xef54('0x18')](_0x556ce3);};module['exports']=Report; \ No newline at end of file +var _0x3f68=['custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','find','accountcode','isNil','name','format','voiceQueueReport','length','lastAssignedTo','interface','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','getAgentByInternal','keys','getCallType','channel','split','calleridnum','internal','voiceCallReport','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','xcally-motion-preview','originatecalleridnum','destinationchannel','calleridpreview','disposition','ANSWERED','\x22%s\x22\x20<%s>','transfers','linkedid','transfereelinkedid','uniqueid','UserId','membername','monitor','monitors','filename','createdAt','connectedlinenum','connectedlinename','isArray','startsWith','Local','substring','mobile','indexOf','lastIndexOf','transfererlinkedid','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','xdr','custom:voiceQueueReport','bind'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3f68,0x157));var _0x83f6=function(_0x75713c,_0x1266ae){_0x75713c=_0x75713c-0x0;var _0x4e668c=_0x3f68[_0x75713c];return _0x4e668c;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x83f6('0x0'));var config=require(_0x83f6('0x1'));var ami=require(_0x83f6('0x2'));var RpcVoiceAgentReport=require(_0x83f6('0x3'));var RpcVoiceCallReport=require(_0x83f6('0x4'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x83f6('0x5'));var RpcVoiceQueueReport=require(_0x83f6('0x6'));var RpcVoiceRecording=require(_0x83f6('0x7'));var RpcVoiceTransferReport=require(_0x83f6('0x8'));var VoiceQueueReport=require(_0x83f6('0x9'));var VoiceCallReport=require(_0x83f6('0xa'));var VoiceAgentReport=require(_0x83f6('0xb'));var VoiceDialReport=require(_0x83f6('0xc'));var UserReport=require(_0x83f6('0xd'));function Report(_0x30572f){this[_0x83f6('0xe')]=_0x30572f;this[_0x83f6('0xf')]=_0x30572f[_0x83f6('0xf')];this[_0x83f6('0x10')]=_0x30572f['telephones'];}Report[_0x83f6('0x11')]['sync']=function(_0x2c74d2){var _0xfb4f63=new VoiceQueueReport(this['realtime']);var _0x416d8b=new VoiceAgentReport(this[_0x83f6('0xe')]);var _0x38309b=new VoiceDialReport(this[_0x83f6('0xe')]);var _0x5e563e=new VoiceCallReport(this['realtime']);var _0xde4f58=new UserReport(this[_0x83f6('0xe')]);if(config[_0x83f6('0x12')]&&config['xdr']['disabled']){ami['on'](_0x83f6('0x13'),this['voiceQueueReport'][_0x83f6('0x14')](this));ami['on'](_0x83f6('0x15'),this['voiceCallReport'][_0x83f6('0x14')](this));ami['on'](_0x83f6('0x16'),this[_0x83f6('0x17')][_0x83f6('0x14')](this));ami['on'](_0x83f6('0x18'),this[_0x83f6('0x19')][_0x83f6('0x14')](this));ami['on'](_0x83f6('0x1a'),this[_0x83f6('0x1b')][_0x83f6('0x14')](this));ami['on']('attendedtransfer',this[_0x83f6('0x1c')]['bind'](this));}};Report[_0x83f6('0x11')][_0x83f6('0x1d')]=function(_0x5d9566){var _0x5c18c;_0x5c18c=_[_0x83f6('0x1e')](this[_0x83f6('0xf')],function(_0x4ac612){return _0x4ac612[_0x83f6('0x1f')]==_0x5d9566||_0x4ac612['name']==_0x5d9566;});if(_[_0x83f6('0x20')](_0x5c18c)){var _0x1b3f86=_[_0x83f6('0x1e')](this['telephones'],function(_0x46af10){return _0x46af10[_0x83f6('0x1f')]==_0x5d9566||_0x46af10[_0x83f6('0x21')]==_0x5d9566;});if(_0x1b3f86){_0x5c18c=_['find'](this['agents'],function(_0x1662d0){return _0x1662d0['interface']==util[_0x83f6('0x22')]('SIP/%s',_0x1b3f86['name']);});}}return _0x5c18c;};Report[_0x83f6('0x11')][_0x83f6('0x23')]=function(_0x1fb480){for(var _0xd1b32c=0x0;_0xd1b32c<_0x1fb480[_0x83f6('0x24')];_0xd1b32c+=0x1){var _0x58dfaa=this[_0x83f6('0x1d')](_0x1fb480[_0xd1b32c]['connectedlinenum']);if(_0x58dfaa){_0x1fb480[_0xd1b32c][_0x83f6('0x1f')]=_0x58dfaa[_0x83f6('0x1f')];_0x1fb480[_0xd1b32c]['assigned']=!![];_0x1fb480[_0xd1b32c][_0x83f6('0x25')]=_0x58dfaa[_0x83f6('0x21')];_0x1fb480[_0xd1b32c][_0x83f6('0x26')]=_[_0x83f6('0x20')](_0x58dfaa['interface'])?util[_0x83f6('0x22')](_0x83f6('0x27'),_0x58dfaa[_0x83f6('0x21')]):_0x58dfaa[_0x83f6('0x26')];if(_0x1fb480[_0xd1b32c][_0x83f6('0x28')]){_0x1fb480[_0xd1b32c][_0x83f6('0x29')]=moment()[_0x83f6('0x22')](_0x83f6('0x2a'));}if(_0x1fb480[_0xd1b32c][_0x83f6('0x2b')]){_0x1fb480[_0xd1b32c][_0x83f6('0x2c')]=moment()[_0x83f6('0x22')](_0x83f6('0x2a'));}RpcMemberReport[_0x83f6('0x23')](_0x1fb480[_0xd1b32c]);}RpcVoiceQueueReport[_0x83f6('0x2d')](_0x1fb480[_0xd1b32c]);}};function extractCalleridNumber(_0x5eb09e){var _0x3f9940=_0x5eb09e['match'](/<(.*?)>/);return _0x3f9940?_0x3f9940[0x1]:_0x5eb09e;}Report[_0x83f6('0x11')][_0x83f6('0x2e')]=function(_0x259043){for(var _0x46db8b=0x0;_0x46db8b0x0?_0xa44995:0x0;this[_0x35bc('0x12')][_0xa54ad2[_0x35bc('0x69')]]['talking']=this[_0x35bc('0x12')][_0xa54ad2[_0x35bc('0x69')]][_0x35bc('0x31')]>_['toNumber'](_0xa54ad2[_0x35bc('0x6d')])?_[_0x35bc('0x6b')](_0xa54ad2['loggedin']):this[_0x35bc('0x12')][_0xa54ad2[_0x35bc('0x69')]][_0x35bc('0x31')];this[_0x35bc('0x6e')](this[_0x35bc('0x12')][_0xa54ad2[_0x35bc('0x69')]],_0x35bc('0x67'));}logger[_0x35bc('0x60')](_0x35bc('0x6f'),util[_0x35bc('0x3f')](this[_0x35bc('0x12')][_0xa54ad2[_0x35bc('0x69')]],{'showHidden':![],'depth':null}));ami[_0x35bc('0x45')]('custom:queuesummary',this[_0x35bc('0x12')][_0xa54ad2[_0x35bc('0x69')]]);}}}catch(_0x1930fb){logger[_0x35bc('0x3d')](_0x35bc('0x70'),util[_0x35bc('0x3f')](_0x1930fb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x35bc('0xa')][_0x35bc('0x18')]=function(_0x27cbb0){logger[_0x35bc('0x60')](_0x35bc('0x71'),util[_0x35bc('0x3f')](_0x27cbb0,{'showHidden':![],'depth':null}));this[_0x35bc('0x66')]=!![];};VoiceQueueReport[_0x35bc('0xa')]['syncQueueCallerJoin']=function(_0x2f3d91){try{if(this[_0x35bc('0x63')](_0x2f3d91)){logger[_0x35bc('0x60')](_0x35bc('0x72'),_0x2f3d91[_0x35bc('0x47')],util[_0x35bc('0x3f')](_0x2f3d91,{'showHidden':![],'depth':null}));if(_[_0x35bc('0x64')](this[_0x35bc('0xe')][_0x2f3d91['uniqueid']]))this[_0x35bc('0xe')][_0x2f3d91[_0x35bc('0x47')]]=[];if(_[_0x35bc('0x64')](this[_0x35bc('0x10')][_0x2f3d91['uniqueid']]))this[_0x35bc('0x10')][_0x2f3d91['uniqueid']]={};var _0x9c9f42=new QueueReport();_0x9c9f42[_0x35bc('0x49')]=_0x2f3d91[_0x35bc('0x69')];_0x9c9f42[_0x35bc('0x58')]=this[_0x35bc('0x12')][_0x9c9f42[_0x35bc('0x49')]]&&this[_0x35bc('0x12')][_0x9c9f42['name']][_0x35bc('0x58')]?this['voiceQueues'][_0x9c9f42[_0x35bc('0x49')]][_0x35bc('0x58')]||_0x35bc('0x51'):_0x35bc('0x51');_0x9c9f42[_0x35bc('0x69')]=_0x2f3d91['queue'];_0x9c9f42[_0x35bc('0x73')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x9c9f42[_0x35bc('0x74')]=_0x2f3d91[_0x35bc('0x74')];_0x9c9f42[_0x35bc('0x75')]=_0x2f3d91[_0x35bc('0x75')];_0x9c9f42['uniqueid']=_0x2f3d91[_0x35bc('0x47')];_0x9c9f42[_0x35bc('0x76')]=this[_0x35bc('0x10')][_0x2f3d91[_0x35bc('0x47')]][_0x35bc('0x76')];logger[_0x35bc('0x6a')](_0x35bc('0x77'),_0x9c9f42[_0x35bc('0x49')],_0x9c9f42[_0x35bc('0x58')]);_['merge'](_0x9c9f42,_['pick'](_0x2f3d91,_[_0x35bc('0x78')](_0x9c9f42)));this[_0x35bc('0xe')][_0x2f3d91[_0x35bc('0x47')]]['push'](_0x9c9f42);this[_0x35bc('0x10')][_0x2f3d91[_0x35bc('0x47')]]=_0x9c9f42;this[_0x35bc('0x46')](_0x9c9f42,_0x35bc('0x19'));}}catch(_0x27258c){logger[_0x35bc('0x3d')](_0x35bc('0x72'),_0x2f3d91[_0x35bc('0x47')],util[_0x35bc('0x3f')](_0x27258c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x35bc('0xa')][_0x35bc('0x79')]=function(_0xa3f4a){try{if(this[_0x35bc('0x63')](_0xa3f4a)){logger[_0x35bc('0x60')](_0x35bc('0x7a'),_0xa3f4a['uniqueid'],util[_0x35bc('0x3f')](_0xa3f4a,{'showHidden':![],'depth':null}));if(this[_0x35bc('0xe')][_0xa3f4a[_0x35bc('0x47')]]){var _0x4d302a=_['last'](this[_0x35bc('0xe')][_0xa3f4a['uniqueid']]);_0x4d302a[_0x35bc('0x7b')]=![];_0x4d302a[_0x35bc('0x7c')]=null;_0x4d302a[_0x35bc('0x7d')]=_0xa3f4a[_0x35bc('0x7d')];_0x4d302a['originalposition']=_0xa3f4a[_0x35bc('0x7e')];_0x4d302a[_0x35bc('0x1b')]=!![];_0x4d302a[_0x35bc('0x7f')]=moment()[_0x35bc('0x4e')](_0x35bc('0x80'));_0x4d302a[_0x35bc('0x81')]='ABANDONED';_0x4d302a['lastAssignedTo']=null;logger[_0x35bc('0x6a')](_0x35bc('0x82'),_0x4d302a['name'],_0x4d302a[_0x35bc('0x58')]);this[_0x35bc('0x10')][_0xa3f4a[_0x35bc('0x47')]]=_0x4d302a;this[_0x35bc('0x43')](_0x4d302a,_0x35bc('0x1b'));}}}catch(_0x2b587a){logger['error'](_0x35bc('0x7a'),_0xa3f4a['uniqueid'],util[_0x35bc('0x3f')](_0x2b587a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x35bc('0x1d')]=function(_0x45d062){try{if(this[_0x35bc('0x63')](_0x45d062)){logger['debug']('[%s][voiceQueueReport][queuecallerleave]',_0x45d062[_0x35bc('0x47')],util['inspect'](_0x45d062,{'showHidden':![],'depth':null}));if(this[_0x35bc('0xe')][_0x45d062[_0x35bc('0x47')]]){var _0x4bbe31=_[_0x35bc('0x83')](this[_0x35bc('0xe')][_0x45d062[_0x35bc('0x47')]]);_0x4bbe31['queuecallerleaveAt']=moment()[_0x35bc('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x4bbe31[_0x35bc('0x84')]=_0x45d062['connectedlinenum'];_0x4bbe31[_0x35bc('0x85')]=_0x45d062[_0x35bc('0x85')];logger[_0x35bc('0x6a')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x4bbe31[_0x35bc('0x49')],_0x4bbe31[_0x35bc('0x58')],_0x45d062['connectedlinenum'],_0x45d062[_0x35bc('0x85')]);this['channels'][_0x45d062[_0x35bc('0x47')]]=_0x4bbe31;this['emitVoiceQueueChannelSave'](_0x4bbe31,_0x35bc('0x1c'));}}}catch(_0x30ec9e){logger[_0x35bc('0x3d')](_0x35bc('0x86'),_0x45d062[_0x35bc('0x47')],util[_0x35bc('0x3f')](_0x30ec9e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x35bc('0xa')][_0x35bc('0x20')]=function(_0x171c32){try{if(this['isNotNull'](_0x171c32)){logger['debug']('[%s][voiceQueueReport][agentconnect]',_0x171c32[_0x35bc('0x47')],util[_0x35bc('0x3f')](_0x171c32,{'showHidden':![],'depth':null}));if(this[_0x35bc('0xe')][_0x171c32[_0x35bc('0x47')]]){var _0x34426e=_[_0x35bc('0x83')](this[_0x35bc('0xe')][_0x171c32[_0x35bc('0x47')]]);_0x34426e[_0x35bc('0x7b')]=!![];_0x34426e[_0x35bc('0x81')]=_0x35bc('0x87');logger[_0x35bc('0x6a')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x34426e[_0x35bc('0x49')],_0x34426e[_0x35bc('0x58')]);}}}catch(_0x414af2){logger[_0x35bc('0x3d')](_0x35bc('0x88'),_0x171c32[_0x35bc('0x47')],util[_0x35bc('0x3f')](_0x414af2,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x35bc('0x89')]=function(_0x3490c0){try{if(this[_0x35bc('0x63')](_0x3490c0)){logger[_0x35bc('0x60')](_0x35bc('0x8a'),_0x3490c0[_0x35bc('0x47')],util[_0x35bc('0x3f')](_0x3490c0,{'showHidden':![],'depth':null}));if(this[_0x35bc('0xe')][_0x3490c0[_0x35bc('0x47')]]){var _0x139aa8=_[_0x35bc('0x83')](this[_0x35bc('0xe')][_0x3490c0[_0x35bc('0x47')]]);_0x139aa8[_0x35bc('0x1b')]=![];_0x139aa8['queuecallerabandonAt']=null;_0x139aa8[_0x35bc('0x8b')]=!![];_0x139aa8[_0x35bc('0x8c')]=_0x3490c0['membername'];_0x139aa8[_0x35bc('0x7d')]=_0x3490c0['holdtime'];_0x139aa8[_0x35bc('0x7b')]=!![];_0x139aa8[_0x35bc('0x8d')]=![];_0x139aa8[_0x35bc('0x8e')]=null;if(!_0x139aa8[_0x35bc('0x8f')]){if(_0x3490c0[_0x35bc('0x90')]=='transfer'){_0x139aa8['queuecallerexitreason']=_0x35bc('0x91');logger[_0x35bc('0x6a')](_0x35bc('0x92'),_0x139aa8[_0x35bc('0x49')],_0x139aa8[_0x35bc('0x58')]);}else{if(_[_0x35bc('0x93')](_0x3490c0['channel'][_0x35bc('0x94')](),'local/')){if(this[_0x35bc('0xe')][_0x3490c0[_0x35bc('0x95')]]){var _0x4e8b57=_[_0x35bc('0x83')](this[_0x35bc('0xe')][_0x3490c0[_0x35bc('0x95')]]);_0x4e8b57[_0x35bc('0x7b')]=![];_0x4e8b57['queuecallerexit']=!![];_0x4e8b57[_0x35bc('0x8e')]=moment(_0x139aa8['queuecallerjoinAt'])[_0x35bc('0x96')](_0x3490c0[_0x35bc('0x7d')],_0x35bc('0x97'))[_0x35bc('0x4e')](_0x35bc('0x80'));_0x4e8b57[_0x35bc('0x81')]='FORWARDTRANSFER';_0x4e8b57[_0x35bc('0x8f')]=!![];_0x4e8b57[_0x35bc('0x98')]=_0x35bc('0x99');_0x4e8b57[_0x35bc('0x9a')]=_0x3490c0[_0x35bc('0x9b')];_0x4e8b57[_0x35bc('0x9c')]=_0x3490c0[_0x35bc('0x47')];logger[_0x35bc('0x6a')](_0x35bc('0x9d'),_0x4e8b57[_0x35bc('0x49')],_0x4e8b57[_0x35bc('0x58')]);var _0xf8eb20=this[_0x35bc('0xe')][_0x3490c0[_0x35bc('0x95')]];this[_0x35bc('0xe')][_0x3490c0[_0x35bc('0x95')]]=this['queueReports'][_0x3490c0[_0x35bc('0x47')]];this[_0x35bc('0xe')][_0x3490c0[_0x35bc('0x47')]]=_0xf8eb20;}}else{_0x139aa8['queuecallerexitreason']='COMPLETEDBY'+_0x3490c0[_0x35bc('0x90')][_0x35bc('0x9e')]();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x139aa8[_0x35bc('0x49')],_0x139aa8[_0x35bc('0x58')],_0x139aa8[_0x35bc('0x81')]);}}}this['channels'][_0x3490c0[_0x35bc('0x47')]]=_0x139aa8;this[_0x35bc('0x43')](_0x139aa8,'agentcomplete');}}}catch(_0x3d3057){logger[_0x35bc('0x3d')](_0x35bc('0x8a'),_0x3490c0[_0x35bc('0x47')],util[_0x35bc('0x3f')](_0x3d3057,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x35bc('0xa')][_0x35bc('0x21')]=function(_0x2b0c43){try{if(this[_0x35bc('0x63')](_0x2b0c43)){logger[_0x35bc('0x60')](_0x35bc('0x9f'),_0x2b0c43[_0x35bc('0x47')],util[_0x35bc('0x3f')](_0x2b0c43,{'showHidden':![],'depth':null}));this['addVariable'](_0x2b0c43[_0x35bc('0x47')],_[_0x35bc('0x78')](_0x2b0c43[_0x35bc('0xa0')])[0x0],_0x2b0c43['value']);if(this[_0x35bc('0xe')][_0x2b0c43[_0x35bc('0x47')]]){var _0x457179=_['last'](this['queueReports'][_0x2b0c43['uniqueid']]);if(_0x457179){if(this[_0x35bc('0x63')](_0x2b0c43[_0x35bc('0xa0')])&&this[_0x35bc('0x63')](_0x2b0c43[_0x35bc('0xa0')][_0x35bc('0xa1')])){switch(_0x2b0c43[_0x35bc('0xa2')]){case _0x35bc('0xa3'):_0x457179['queuecallerexit']=![];_0x457179['queuecallerexitAt']=null;break;case _0x35bc('0xa4'):_0x457179['lastevent']=_0x35bc('0xa5');_0x457179[_0x35bc('0x8d')]=!![];_0x457179[_0x35bc('0x8e')]=moment()[_0x35bc('0x4e')](_0x35bc('0x80'));_0x457179['queuecallerleaveAt']=moment()[_0x35bc('0x4e')](_0x35bc('0x80'));logger[_0x35bc('0x60')](_0x35bc('0xa6'),_0x2b0c43[_0x35bc('0x47')],util[_0x35bc('0x3f')](_0x457179,{'showHidden':![],'depth':null}));ami[_0x35bc('0x45')](_0x35bc('0xa7'),_0x457179);break;default:_0x457179[_0x35bc('0x8d')]=!![];_0x457179['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x457179[_0x35bc('0xa8')]=moment()[_0x35bc('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');}_0x457179['queuecallerabandon']=![];_0x457179[_0x35bc('0x7f')]=null;_0x457179['queuecallerexitreason']=_0x2b0c43[_0x35bc('0xa2')];this[_0x35bc('0x10')][_0x2b0c43[_0x35bc('0x47')]]=_0x457179;this[_0x35bc('0x43')](_0x457179,'varset');}else if(this[_0x35bc('0x63')](_0x2b0c43[_0x35bc('0xa0')])&&this['isNotNull'](_0x2b0c43[_0x35bc('0xa0')][_0x35bc('0xa9')])){if(!_0x457179[_0x35bc('0x1b')]){_0x457179['queuecallerexit']=!![];_0x457179[_0x35bc('0x8e')]=moment()['format'](_0x35bc('0x80'));_0x457179[_0x35bc('0x81')]=_0x35bc('0xaa');_0x457179[_0x35bc('0xa8')]=moment()['format'](_0x35bc('0x80'));this['channels'][_0x2b0c43[_0x35bc('0x47')]]=_0x457179;}}logger[_0x35bc('0x6a')](_0x35bc('0xab'),_0x2b0c43['uniqueid'],_0x457179[_0x35bc('0x49')],_0x457179[_0x35bc('0x58')],_['keys'](_0x2b0c43[_0x35bc('0xa0')])[0x0],_0x2b0c43[_0x35bc('0xa2')]);_0x457179[_0x35bc('0x14')]=this[_0x35bc('0x14')][_0x2b0c43[_0x35bc('0x47')]];}}}}catch(_0x5622fb){logger['error'](_0x35bc('0x9f'),_0x2b0c43[_0x35bc('0x47')],util[_0x35bc('0x3f')](_0x5622fb,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['addVariable']=function(_0x163ae3,_0x4ad526,_0x593148){var _0x50bce1=[_0x35bc('0xac'),_0x35bc('0xad'),_0x35bc('0xae'),'rtpaudioqosjitterbridged',_0x35bc('0xaf'),_0x35bc('0xb0'),'rtpaudioqosrtt',_0x35bc('0xb1'),_0x35bc('0xb2'),_0x35bc('0xb3'),'bridgepeer',_0x35bc('0xb4'),'membercalls',_0x35bc('0xb5'),_0x35bc('0xb6'),_0x35bc('0xb7'),_0x35bc('0xb8'),_0x35bc('0xb9'),_0x35bc('0xba')];if(!_[_0x35bc('0x38')](_0x4ad526)&&!_[_0x35bc('0xbb')](_0x50bce1,_0x4ad526)){if(_[_0x35bc('0x64')](this[_0x35bc('0x14')][_0x163ae3])){this['variables'][_0x163ae3]={};}this['variables'][_0x163ae3][_0x4ad526]=_0x593148;}};VoiceQueueReport[_0x35bc('0xa')]['syncHangup']=function(_0x50940f){try{if(this[_0x35bc('0x63')](_0x50940f)){logger[_0x35bc('0x60')](_0x35bc('0xbc'),_0x50940f[_0x35bc('0x47')],util[_0x35bc('0x3f')](_0x50940f,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x50940f[_0x35bc('0x47')]]){for(var _0x45cda9=0x0,_0x40ccca={};_0x45cda90x0?_0x17edb0:0x0;this['voiceQueues'][_0x47be99[_0x5b80('0x67')]][_0x5b80('0x56')]=this[_0x5b80('0x13')][_0x47be99[_0x5b80('0x67')]][_0x5b80('0x56')]>_[_0x5b80('0x6b')](_0x47be99['loggedin'])?_[_0x5b80('0x6b')](_0x47be99[_0x5b80('0x6d')]):this[_0x5b80('0x13')][_0x47be99[_0x5b80('0x67')]][_0x5b80('0x56')];this['emitVoiceQueueSummary'](this[_0x5b80('0x13')][_0x47be99[_0x5b80('0x67')]],_0x5b80('0x64'));}logger[_0x5b80('0x4b')](_0x5b80('0x6e'),util[_0x5b80('0x3c')](this[_0x5b80('0x13')][_0x47be99[_0x5b80('0x67')]],{'showHidden':![],'depth':null}));ami[_0x5b80('0x44')](_0x5b80('0x6f'),this[_0x5b80('0x13')][_0x47be99[_0x5b80('0x67')]]);}}}catch(_0xaf5224){logger[_0x5b80('0x3a')]('[voiceQueueReport][queuesummary]',util[_0x5b80('0x3c')](_0xaf5224,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5b80('0xd')][_0x5b80('0x18')]=function(_0x61af49){logger[_0x5b80('0x4b')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x5b80('0x3c')](_0x61af49,{'showHidden':![],'depth':null}));this[_0x5b80('0x14')]=!![];};VoiceQueueReport[_0x5b80('0xd')][_0x5b80('0x19')]=function(_0x535398){try{if(this[_0x5b80('0x60')](_0x535398)){logger[_0x5b80('0x4b')](_0x5b80('0x70'),_0x535398[_0x5b80('0x4d')],util[_0x5b80('0x3c')](_0x535398,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x5b80('0x3d')][_0x535398[_0x5b80('0x4d')]]))this[_0x5b80('0x3d')][_0x535398[_0x5b80('0x4d')]]=[];if(_['isUndefined'](this[_0x5b80('0x11')][_0x535398[_0x5b80('0x4d')]]))this['channels'][_0x535398[_0x5b80('0x4d')]]={};var _0x187806=new QueueReport();_0x187806[_0x5b80('0x49')]=_0x535398[_0x5b80('0x67')];_0x187806[_0x5b80('0x50')]=this[_0x5b80('0x13')][_0x187806[_0x5b80('0x49')]]&&this[_0x5b80('0x13')][_0x187806[_0x5b80('0x49')]][_0x5b80('0x50')]?this['voiceQueues'][_0x187806[_0x5b80('0x49')]][_0x5b80('0x50')]||_0x5b80('0x51'):'inbound';_0x187806[_0x5b80('0x67')]=_0x535398[_0x5b80('0x67')];_0x187806['queuecallerjoinAt']=moment()[_0x5b80('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x187806[_0x5b80('0x71')]=_0x535398[_0x5b80('0x71')];_0x187806[_0x5b80('0x72')]=_0x535398['count'];_0x187806[_0x5b80('0x4d')]=_0x535398[_0x5b80('0x4d')];_0x187806[_0x5b80('0x73')]=this['channels'][_0x535398[_0x5b80('0x4d')]][_0x5b80('0x73')];logger['info']('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x187806['name'],_0x187806[_0x5b80('0x50')]);_['merge'](_0x187806,_[_0x5b80('0x74')](_0x535398,_['keys'](_0x187806)));this[_0x5b80('0x3d')][_0x535398[_0x5b80('0x4d')]][_0x5b80('0x75')](_0x187806);this[_0x5b80('0x11')][_0x535398[_0x5b80('0x4d')]]=_0x187806;this[_0x5b80('0x45')](_0x187806,'queuecallerjoin');}}catch(_0xf376cb){logger['error'](_0x5b80('0x70'),_0x535398[_0x5b80('0x4d')],util['inspect'](_0xf376cb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5b80('0xd')][_0x5b80('0x1b')]=function(_0x5e7a56){try{if(this[_0x5b80('0x60')](_0x5e7a56)){logger['debug'](_0x5b80('0x76'),_0x5e7a56[_0x5b80('0x4d')],util['inspect'](_0x5e7a56,{'showHidden':![],'depth':null}));if(this[_0x5b80('0x3d')][_0x5e7a56[_0x5b80('0x4d')]]){var _0x4f07d3=_['last'](this['queueReports'][_0x5e7a56[_0x5b80('0x4d')]]);_0x4f07d3['queuecallercomplete']=![];_0x4f07d3[_0x5b80('0x77')]=null;_0x4f07d3[_0x5b80('0x78')]=_0x5e7a56['holdtime'];_0x4f07d3['originalposition']=_0x5e7a56[_0x5b80('0x79')];_0x4f07d3['queuecallerabandon']=!![];_0x4f07d3['queuecallerabandonAt']=moment()[_0x5b80('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x4f07d3[_0x5b80('0x7a')]=_0x5b80('0x7b');_0x4f07d3[_0x5b80('0x7c')]=null;logger['info'](_0x5b80('0x7d'),_0x4f07d3[_0x5b80('0x49')],_0x4f07d3[_0x5b80('0x50')]);this[_0x5b80('0x11')][_0x5e7a56['uniqueid']]=_0x4f07d3;this[_0x5b80('0x42')](_0x4f07d3,_0x5b80('0x1a'));}}}catch(_0xf59ea8){logger[_0x5b80('0x3a')](_0x5b80('0x76'),_0x5e7a56[_0x5b80('0x4d')],util['inspect'](_0xf59ea8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5b80('0xd')][_0x5b80('0x7e')]=function(_0x4ba35c){try{if(this[_0x5b80('0x60')](_0x4ba35c)){logger[_0x5b80('0x4b')](_0x5b80('0x7f'),_0x4ba35c[_0x5b80('0x4d')],util['inspect'](_0x4ba35c,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4ba35c[_0x5b80('0x4d')]]){var _0x27b86c=_[_0x5b80('0x80')](this[_0x5b80('0x3d')][_0x4ba35c['uniqueid']]);_0x27b86c[_0x5b80('0x81')]=moment()[_0x5b80('0x5e')](_0x5b80('0x82'));_0x27b86c[_0x5b80('0x83')]=_0x4ba35c[_0x5b80('0x83')];_0x27b86c[_0x5b80('0x84')]=_0x4ba35c[_0x5b80('0x84')];logger[_0x5b80('0x69')](_0x5b80('0x85'),_0x27b86c['name'],_0x27b86c['type'],_0x4ba35c[_0x5b80('0x83')],_0x4ba35c['connectedlinename']);this[_0x5b80('0x11')][_0x4ba35c[_0x5b80('0x4d')]]=_0x27b86c;this['emitVoiceQueueChannelSave'](_0x27b86c,_0x5b80('0x86'));}}}catch(_0x3b2364){logger[_0x5b80('0x3a')]('[%s][voiceQueueReport][queuecallerleave]',_0x4ba35c[_0x5b80('0x4d')],util[_0x5b80('0x3c')](_0x3b2364,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x5b80('0x1e')]=function(_0x20c8a6){try{if(this['isNotNull'](_0x20c8a6)){logger[_0x5b80('0x4b')]('[%s][voiceQueueReport][agentconnect]',_0x20c8a6[_0x5b80('0x4d')],util[_0x5b80('0x3c')](_0x20c8a6,{'showHidden':![],'depth':null}));if(this[_0x5b80('0x3d')][_0x20c8a6[_0x5b80('0x4d')]]){var _0x48d0c0=_[_0x5b80('0x80')](this[_0x5b80('0x3d')][_0x20c8a6[_0x5b80('0x4d')]]);_0x48d0c0[_0x5b80('0x87')]=!![];_0x48d0c0[_0x5b80('0x7a')]=_0x5b80('0x88');logger[_0x5b80('0x69')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x48d0c0[_0x5b80('0x49')],_0x48d0c0[_0x5b80('0x50')]);}}}catch(_0x2fae7a){logger['error']('[%s][voiceQueueReport][agentconnect]',_0x20c8a6[_0x5b80('0x4d')],util[_0x5b80('0x3c')](_0x2fae7a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x2cc1c4){try{if(this[_0x5b80('0x60')](_0x2cc1c4)){logger[_0x5b80('0x4b')](_0x5b80('0x89'),_0x2cc1c4['uniqueid'],util[_0x5b80('0x3c')](_0x2cc1c4,{'showHidden':![],'depth':null}));if(this[_0x5b80('0x3d')][_0x2cc1c4[_0x5b80('0x4d')]]){var _0x455c94=_[_0x5b80('0x80')](this[_0x5b80('0x3d')][_0x2cc1c4[_0x5b80('0x4d')]]);_0x455c94[_0x5b80('0x1a')]=![];_0x455c94[_0x5b80('0x8a')]=null;_0x455c94[_0x5b80('0x8b')]=!![];_0x455c94[_0x5b80('0x7c')]=_0x2cc1c4[_0x5b80('0x8c')];_0x455c94[_0x5b80('0x78')]=_0x2cc1c4['holdtime'];_0x455c94[_0x5b80('0x87')]=!![];_0x455c94['queuecallerexit']=![];_0x455c94[_0x5b80('0x8d')]=null;if(!_0x455c94[_0x5b80('0x8e')]){if(_0x2cc1c4['reason']==_0x5b80('0x8e')){_0x455c94[_0x5b80('0x7a')]='COMPLETED';logger[_0x5b80('0x69')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x455c94[_0x5b80('0x49')],_0x455c94[_0x5b80('0x50')]);}else{if(_[_0x5b80('0x8f')](_0x2cc1c4[_0x5b80('0x36')]['toLowerCase'](),'local/')){if(this['queueReports'][_0x2cc1c4[_0x5b80('0x90')]]){var _0x354bb7=_[_0x5b80('0x80')](this['queueReports'][_0x2cc1c4[_0x5b80('0x90')]]);_0x354bb7[_0x5b80('0x87')]=![];_0x354bb7['queuecallerexit']=!![];_0x354bb7[_0x5b80('0x8d')]=moment(_0x455c94[_0x5b80('0x91')])['add'](_0x2cc1c4[_0x5b80('0x78')],_0x5b80('0x92'))[_0x5b80('0x5e')](_0x5b80('0x82'));_0x354bb7[_0x5b80('0x7a')]='FORWARDTRANSFER';_0x354bb7[_0x5b80('0x8e')]=!![];_0x354bb7[_0x5b80('0x93')]='FORWARD';_0x354bb7[_0x5b80('0x94')]=_0x2cc1c4[_0x5b80('0x95')];_0x354bb7['transferuniqueid']=_0x2cc1c4[_0x5b80('0x4d')];logger[_0x5b80('0x69')](_0x5b80('0x96'),_0x354bb7['name'],_0x354bb7[_0x5b80('0x50')]);var _0x3c1e4b=this[_0x5b80('0x3d')][_0x2cc1c4['linkedid']];this[_0x5b80('0x3d')][_0x2cc1c4['linkedid']]=this['queueReports'][_0x2cc1c4[_0x5b80('0x4d')]];this[_0x5b80('0x3d')][_0x2cc1c4[_0x5b80('0x4d')]]=_0x3c1e4b;}}else{_0x455c94[_0x5b80('0x7a')]='COMPLETEDBY'+_0x2cc1c4[_0x5b80('0x97')]['toUpperCase']();logger['info'](_0x5b80('0x98'),_0x455c94[_0x5b80('0x49')],_0x455c94[_0x5b80('0x50')],_0x455c94[_0x5b80('0x7a')]);}}}this[_0x5b80('0x11')][_0x2cc1c4['uniqueid']]=_0x455c94;this[_0x5b80('0x42')](_0x455c94,_0x5b80('0x99'));}}}catch(_0x171e15){logger[_0x5b80('0x3a')]('[%s][voiceQueueReport][agentcomplete]',_0x2cc1c4[_0x5b80('0x4d')],util[_0x5b80('0x3c')](_0x171e15,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x5b80('0x9a')]=function(_0x403311){try{if(this[_0x5b80('0x60')](_0x403311)){logger[_0x5b80('0x4b')](_0x5b80('0x9b'),_0x403311[_0x5b80('0x4d')],util[_0x5b80('0x3c')](_0x403311,{'showHidden':![],'depth':null}));this['addVariable'](_0x403311[_0x5b80('0x4d')],_[_0x5b80('0x9c')](_0x403311['variable'])[0x0],_0x403311[_0x5b80('0x9d')]);if(this['queueReports'][_0x403311[_0x5b80('0x4d')]]){var _0x79ee56=_[_0x5b80('0x80')](this['queueReports'][_0x403311['uniqueid']]);if(_0x79ee56){if(this[_0x5b80('0x60')](_0x403311[_0x5b80('0x9e')])&&this['isNotNull'](_0x403311[_0x5b80('0x9e')][_0x5b80('0x9f')])){switch(_0x403311[_0x5b80('0x9d')]){case _0x5b80('0xa0'):_0x79ee56['queuecallerexit']=![];_0x79ee56[_0x5b80('0x8d')]=null;break;case _0x5b80('0xa1'):_0x79ee56[_0x5b80('0xa2')]=_0x5b80('0xa3');_0x79ee56[_0x5b80('0xa4')]=!![];_0x79ee56[_0x5b80('0x8d')]=moment()[_0x5b80('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x79ee56[_0x5b80('0x81')]=moment()['format'](_0x5b80('0x82'));logger[_0x5b80('0x4b')](_0x5b80('0xa5'),_0x403311['uniqueid'],util['inspect'](_0x79ee56,{'showHidden':![],'depth':null}));ami[_0x5b80('0x44')](_0x5b80('0xa6'),_0x79ee56);break;default:_0x79ee56[_0x5b80('0xa4')]=!![];_0x79ee56['queuecallerexitAt']=moment()['format'](_0x5b80('0x82'));_0x79ee56['queuecallerleaveAt']=moment()[_0x5b80('0x5e')](_0x5b80('0x82'));}_0x79ee56[_0x5b80('0x1a')]=![];_0x79ee56[_0x5b80('0x8a')]=null;_0x79ee56[_0x5b80('0x7a')]=_0x403311[_0x5b80('0x9d')];this[_0x5b80('0x11')][_0x403311['uniqueid']]=_0x79ee56;this[_0x5b80('0x42')](_0x79ee56,'varset');}else if(this[_0x5b80('0x60')](_0x403311[_0x5b80('0x9e')])&&this[_0x5b80('0x60')](_0x403311[_0x5b80('0x9e')][_0x5b80('0xa7')])){if(!_0x79ee56[_0x5b80('0x1a')]){_0x79ee56[_0x5b80('0xa4')]=!![];_0x79ee56[_0x5b80('0x8d')]=moment()[_0x5b80('0x5e')](_0x5b80('0x82'));_0x79ee56[_0x5b80('0x7a')]='EXITWITHKEY';_0x79ee56[_0x5b80('0x81')]=moment()[_0x5b80('0x5e')](_0x5b80('0x82'));this[_0x5b80('0x11')][_0x403311[_0x5b80('0x4d')]]=_0x79ee56;}}logger[_0x5b80('0x69')](_0x5b80('0xa8'),_0x403311[_0x5b80('0x4d')],_0x79ee56['name'],_0x79ee56[_0x5b80('0x50')],_[_0x5b80('0x9c')](_0x403311['variable'])[0x0],_0x403311[_0x5b80('0x9d')]);_0x79ee56[_0x5b80('0x16')]=this['variables'][_0x403311[_0x5b80('0x4d')]];}}}}catch(_0x3d6a29){logger[_0x5b80('0x3a')](_0x5b80('0x9b'),_0x403311[_0x5b80('0x4d')],util['inspect'](_0x3d6a29,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5b80('0xd')]['addVariable']=function(_0x15c415,_0x48e5ec,_0x564349){var _0x2738b9=[_0x5b80('0xa9'),_0x5b80('0xaa'),'rtpaudioqosjitter',_0x5b80('0xab'),_0x5b80('0xac'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0x5b80('0xad'),_0x5b80('0xae'),_0x5b80('0xaf'),_0x5b80('0xb0'),'bridgepvtcallid','membercalls',_0x5b80('0xb1'),'memberinterface','memberlastcall',_0x5b80('0x8c'),'memberpenalty',_0x5b80('0xb2')];if(!_[_0x5b80('0x33')](_0x48e5ec)&&!_[_0x5b80('0xb3')](_0x2738b9,_0x48e5ec)){if(_[_0x5b80('0x61')](this[_0x5b80('0x16')][_0x15c415])){this[_0x5b80('0x16')][_0x15c415]={};}this['variables'][_0x15c415][_0x48e5ec]=_0x564349;}};VoiceQueueReport[_0x5b80('0xd')][_0x5b80('0x20')]=function(_0x1b647d){try{if(this['isNotNull'](_0x1b647d)){logger['debug']('[%s][voiceQueueReport][hangup]',_0x1b647d['uniqueid'],util[_0x5b80('0x3c')](_0x1b647d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1b647d[_0x5b80('0x4d')]]){for(var _0x4a997d=0x0,_0x209222={};_0x4a997d=0x0?moment(_0x2717ef[_0x1ead('0x19')])[_0x1ead('0xb')](_0x2717ef['starttime'],_0x1ead('0xd')):null,'data1':'outbound','data2':_0x2717ef[_0x1ead('0x12')],'data3':_0x2717ef[_0x1ead('0xf')],'data4':_0x2717ef[_0x1ead('0x1a')]||null,'role':'agent','internal':_0x2717ef[_0x1ead('0x12')]?_[_0x1ead('0x13')](_0x2717ef[_0x1ead('0x12')]):undefined,'uniqueid':_0x2717ef[_0x1ead('0x14')]},'log':_0x1ead('0x15')});}; \ No newline at end of file +var _0x9b4e=['TALKING','starttime','endtime','diff','outbound','moment','lodash','util','../client','voiceQueueReport','Request','CreateMemberReport','isNil','interface','format','SIP/%s','lastAssignedTo','queuecallerleaveAt','seconds','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','uniqueid','voiceDialReport','voice'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b4e,0x19b));var _0xe9b4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9b4e[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xe9b4('0x0'));var _=require(_0xe9b4('0x1'));var util=require(_0xe9b4('0x2'));var client=require(_0xe9b4('0x3'));exports[_0xe9b4('0x4')]=function(_0x597cd3){var _0x2eefb8=_0x597cd3['queuecallercompleteAt']||_0x597cd3['queuecallerexitAt'];return client[_0xe9b4('0x5')](_0xe9b4('0x6'),{'body':{'channel':'voice','membername':_0x597cd3['lastAssignedTo'],'interface':_[_0xe9b4('0x7')](_0x597cd3[_0xe9b4('0x8')])?util[_0xe9b4('0x9')](_0xe9b4('0xa'),_0x597cd3[_0xe9b4('0xb')]):_0x597cd3[_0xe9b4('0x8')],'type':'TALKING','enterAt':_0x597cd3[_0xe9b4('0xc')],'exitAt':_0x2eefb8,'duration':moment(_0x2eefb8)['diff'](_0x597cd3['queuecallerleaveAt'],_0xe9b4('0xd')),'data1':_0xe9b4('0xe'),'data2':_0x597cd3[_0xe9b4('0xf')],'data3':_0x597cd3[_0xe9b4('0x10')],'data4':null,'data5':_0x597cd3[_0xe9b4('0x11')],'role':_0xe9b4('0x12'),'internal':_0x597cd3[_0xe9b4('0x13')]?_[_0xe9b4('0x14')](_0x597cd3[_0xe9b4('0x13')]):undefined,'uniqueid':_0x597cd3[_0xe9b4('0x15')]},'log':_0xe9b4('0x6')});};exports[_0xe9b4('0x16')]=function(_0x539e22){return client['Request'](_0xe9b4('0x6'),{'body':{'channel':_0xe9b4('0x17'),'membername':_0x539e22['membername'],'interface':_0x539e22[_0xe9b4('0x8')],'type':_0xe9b4('0x18'),'enterAt':_0x539e22[_0xe9b4('0x19')],'exitAt':_0x539e22['endtime'],'duration':moment(_0x539e22[_0xe9b4('0x1a')])[_0xe9b4('0x1b')](_0x539e22['starttime'],_0xe9b4('0xd'))>=0x0?moment(_0x539e22[_0xe9b4('0x1a')])[_0xe9b4('0x1b')](_0x539e22[_0xe9b4('0x19')],'seconds'):null,'data1':_0xe9b4('0x1c'),'data2':_0x539e22[_0xe9b4('0x13')],'data3':_0x539e22['exten'],'data4':_0x539e22['dialstring']||null,'role':_0xe9b4('0x12'),'internal':_0x539e22[_0xe9b4('0x13')]?_[_0xe9b4('0x14')](_0x539e22[_0xe9b4('0x13')]):undefined,'uniqueid':_0x539e22[_0xe9b4('0x15')]},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index f3c7f77..7bbc4f0 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 _0xcb18=['stopRecordingOnTransfer','Request'];(function(_0x2a4de3,_0x5af2a3){var _0x23e387=function(_0x457b5d){while(--_0x457b5d){_0x2a4de3['push'](_0x2a4de3['shift']());}};_0x23e387(++_0x5af2a3);}(_0xcb18,0x159));var _0x8cb1=function(_0x13a78e,_0x512517){_0x13a78e=_0x13a78e-0x0;var _0x251ea3=_0xcb18[_0x13a78e];return _0x251ea3;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0x8cb1('0x0')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x8cb1('0x1')]},'log':'GetSettings'});}; \ No newline at end of file +var _0x1e1a=['ShowSetting','stopRecordingOnTransfer','GetSettings','getSettings','Request'];(function(_0x4aa736,_0x424f1a){var _0x4349e6=function(_0x3c8cef){while(--_0x3c8cef){_0x4aa736['push'](_0x4aa736['shift']());}};_0x4349e6(++_0x424f1a);}(_0x1e1a,0x175));var _0xa1e1=function(_0x57055e,_0x5e41f8){_0x57055e=_0x57055e-0x0;var _0x434c43=_0x1e1a[_0x57055e];return _0x434c43;};'use strict';var client=require('../client');exports[_0xa1e1('0x0')]=function(){return client[_0xa1e1('0x1')](_0xa1e1('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xa1e1('0x3')]},'log':_0xa1e1('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 166c9a6..712a157 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 _0xa45d=['name','html','../client','getTemplates','Request','GetTemplate'];(function(_0x352541,_0x1ba48a){var _0x28926c=function(_0x2db92d){while(--_0x2db92d){_0x352541['push'](_0x352541['shift']());}};_0x28926c(++_0x1ba48a);}(_0xa45d,0x19a));var _0xda45=function(_0x327d77,_0xf95180){_0x327d77=_0x327d77-0x0;var _0x3406fc=_0xa45d[_0x327d77];return _0x3406fc;};'use strict';var client=require(_0xda45('0x0'));exports[_0xda45('0x1')]=function(_0x5ee65f){return function(_0xf2f125){return client[_0xda45('0x2')](_0xda45('0x3'),{'options':{'raw':!![],'attributes':['id',_0xda45('0x4'),_0xda45('0x5')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0xda27=['Request','GetTemplate','name','../client','getTemplates'];(function(_0x1d1310,_0x378afc){var _0x2cbf2e=function(_0x73741c){while(--_0x73741c){_0x1d1310['push'](_0x1d1310['shift']());}};_0x2cbf2e(++_0x378afc);}(_0xda27,0x1cf));var _0x7da2=function(_0x4e8dfc,_0x448b97){_0x4e8dfc=_0x4e8dfc-0x0;var _0x3c47e0=_0xda27[_0x4e8dfc];return _0x3c47e0;};'use strict';var client=require(_0x7da2('0x0'));exports[_0x7da2('0x1')]=function(_0x1a848e){return function(_0x1873a8){return client[_0x7da2('0x2')](_0x7da2('0x3'),{'options':{'raw':!![],'attributes':['id',_0x7da2('0x4'),'html']},'log':_0x7da2('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index ada0384..2a30373 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 _0xa1a8=['getTriggers','GetTrigger','name','channel','status','Condition','AllConditions','operator','AnyConditions','field','value','Actions','action','data1','data5','data6','../client'];(function(_0x3fda91,_0x44676e){var _0x3308c1=function(_0x378e98){while(--_0x378e98){_0x3fda91['push'](_0x3fda91['shift']());}};_0x3308c1(++_0x44676e);}(_0xa1a8,0x10f));var _0x8a1a=function(_0x629d44,_0x1bf85d){_0x629d44=_0x629d44-0x0;var _0x47a41e=_0xa1a8[_0x629d44];return _0x47a41e;};'use strict';var client=require(_0x8a1a('0x0'));exports[_0x8a1a('0x1')]=function(_0x15aa90){return function(_0x132d02){return client['Request'](_0x8a1a('0x2'),{'options':{'raw':![],'attributes':['id',_0x8a1a('0x3'),_0x8a1a('0x4'),_0x8a1a('0x5')],'include':[{'model':_0x8a1a('0x6'),'as':_0x8a1a('0x7'),'attributes':['id','field',_0x8a1a('0x8'),'value']},{'model':'Condition','as':_0x8a1a('0x9'),'attributes':['id',_0x8a1a('0xa'),_0x8a1a('0x8'),_0x8a1a('0xb')]},{'model':'Action','as':_0x8a1a('0xc'),'attributes':['id',_0x8a1a('0xd'),_0x8a1a('0xe'),'data2','data3','data4',_0x8a1a('0xf'),_0x8a1a('0x10'),'data7']}]},'log':_0x8a1a('0x2')});};}; \ No newline at end of file +var _0x20bf=['operator','Action','Actions','action','data1','data2','data3','data4','data5','data6','data7','Request','GetTrigger','name','channel','status','AllConditions','field','value','Condition','AnyConditions'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x20bf,0x11c));var _0xf20b=function(_0x475526,_0x4418f9){_0x475526=_0x475526-0x0;var _0x4ab9cb=_0x20bf[_0x475526];return _0x4ab9cb;};'use strict';var client=require('../client');exports['getTriggers']=function(_0x1d9262){return function(_0x4338e3){return client[_0xf20b('0x0')](_0xf20b('0x1'),{'options':{'raw':![],'attributes':['id',_0xf20b('0x2'),_0xf20b('0x3'),_0xf20b('0x4')],'include':[{'model':'Condition','as':_0xf20b('0x5'),'attributes':['id',_0xf20b('0x6'),'operator',_0xf20b('0x7')]},{'model':_0xf20b('0x8'),'as':_0xf20b('0x9'),'attributes':['id','field',_0xf20b('0xa'),'value']},{'model':_0xf20b('0xb'),'as':_0xf20b('0xc'),'attributes':['id',_0xf20b('0xd'),_0xf20b('0xe'),_0xf20b('0xf'),_0xf20b('0x10'),_0xf20b('0x11'),_0xf20b('0x12'),_0xf20b('0x13'),_0xf20b('0x14')]}]},'log':_0xf20b('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 0f83fcb..3629e1a 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 _0xc69e=['Request','GetTrunk','name','registry','defaultuser','../client','getTrunks'];(function(_0x2a59b7,_0x4ba37f){var _0x5c9b6d=function(_0x2c1f3e){while(--_0x2c1f3e){_0x2a59b7['push'](_0x2a59b7['shift']());}};_0x5c9b6d(++_0x4ba37f);}(_0xc69e,0xfa));var _0xec69=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xc69e[_0x4e676e];return _0x336a3c;};'use strict';var client=require(_0xec69('0x0'));exports[_0xec69('0x1')]=function(_0x1b656a){return function(_0x2d5b10){return client[_0xec69('0x2')](_0xec69('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xec69('0x4'),_0xec69('0x5'),_0xec69('0x6')]},'log':_0xec69('0x3')});};}; \ No newline at end of file +var _0x655e=['GetTrunk','../client','getTrunks','Request','name','defaultuser'];(function(_0x292d27,_0x12842c){var _0x223821=function(_0x4c5e3e){while(--_0x4c5e3e){_0x292d27['push'](_0x292d27['shift']());}};_0x223821(++_0x12842c);}(_0x655e,0x19f));var _0xe655=function(_0x55c93b,_0x24b1a8){_0x55c93b=_0x55c93b-0x0;var _0x411435=_0x655e[_0x55c93b];return _0x411435;};'use strict';var client=require(_0xe655('0x0'));exports[_0xe655('0x1')]=function(_0x47a855){return function(_0xb8e7a8){return client[_0xe655('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xe655('0x3'),'registry',_0xe655('0x4')]},'log':_0xe655('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 128c4d0..7023499 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xe706,0xa3));var _0x6e70=function(_0x42fe9c,_0x8ea8df){_0x42fe9c=_0x42fe9c-0x0;var _0xe8737f=_0xe706[_0x42fe9c];return _0xe8737f;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file +var _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x2844c3,_0x25b977){var _0x384a72=function(_0xfaad4e){while(--_0xfaad4e){_0x2844c3['push'](_0x2844c3['shift']());}};_0x384a72(++_0x25b977);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index a49464d..0be2a2f 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 _0x8808=['Request','CreateVoiceAgentReport','UpdateVoiceAgentReport','../client','create'];(function(_0x5af221,_0x5b2255){var _0x4c110f=function(_0xad529f){while(--_0xad529f){_0x5af221['push'](_0x5af221['shift']());}};_0x4c110f(++_0x5b2255);}(_0x8808,0x14d));var _0x8880=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x8808[_0x3e5086];return _0xfeb102;};'use strict';var client=require(_0x8880('0x0'));exports[_0x8880('0x1')]=function(_0x3650f4){return client[_0x8880('0x2')](_0x8880('0x3'),{'body':_0x3650f4,'log':_0x8880('0x3')});};exports['update']=function(_0x9359f5,_0x308e1c,_0x18c606){return client[_0x8880('0x2')](_0x8880('0x4'),{'body':_0x9359f5,'options':{'where':{'uniqueid':_0x308e1c,'interface':_0x18c606,'agentcomplete':!![]}},'log':_0x8880('0x4')});}; \ No newline at end of file +var _0xe9ba=['update','UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x4359a5,_0x53fe11){var _0x133281=function(_0x15a48a){while(--_0x15a48a){_0x4359a5['push'](_0x4359a5['shift']());}};_0x133281(++_0x53fe11);}(_0xe9ba,0xaa));var _0xae9b=function(_0xdd9a5f,_0x3ced93){_0xdd9a5f=_0xdd9a5f-0x0;var _0x3464b7=_0xe9ba[_0xdd9a5f];return _0x3464b7;};'use strict';var client=require(_0xae9b('0x0'));exports[_0xae9b('0x1')]=function(_0x2d9039){return client[_0xae9b('0x2')](_0xae9b('0x3'),{'body':_0x2d9039,'log':'CreateVoiceAgentReport'});};exports[_0xae9b('0x4')]=function(_0x5598fd,_0x593345,_0x504d46){return client[_0xae9b('0x2')](_0xae9b('0x5'),{'body':_0x5598fd,'options':{'where':{'uniqueid':_0x593345,'interface':_0x504d46,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index a35e996..45bbbdc 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 _0x7e33=['callerid','DOCUMENTATION','Request','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','type','duration','billableseconds','util','lodash','../client','create','CreateVoiceCallReport','context'];(function(_0x4d3ebb,_0x5146b6){var _0x124599=function(_0x945bf3){while(--_0x945bf3){_0x4d3ebb['push'](_0x4d3ebb['shift']());}};_0x124599(++_0x5146b6);}(_0x7e33,0x1c5));var _0x37e3=function(_0x387437,_0xa167ad){_0x387437=_0x387437-0x0;var _0x41d87f=_0x7e33[_0x387437];return _0x41d87f;};'use strict';var moment=require('moment');var util=require(_0x37e3('0x0'));var _=require(_0x37e3('0x1'));var client=require(_0x37e3('0x2'));exports[_0x37e3('0x3')]=function(_0x52da2d){return client['Request'](_0x37e3('0x4'),{'body':_['merge'](_0x52da2d,{'source':_0x52da2d['calleridnum'],'destinationcontext':_0x52da2d[_0x37e3('0x5')],'callerid':_0x52da2d[_0x37e3('0x6')],'amaflags':_0x37e3('0x7')}),'log':_0x37e3('0x4')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x37e3('0x8')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x37e3('0x9')],'createdAt':{'$between':[moment()[_0x37e3('0xa')](_0x37e3('0xb'))[_0x37e3('0xc')](_0x37e3('0xd')),moment()['endOf'](_0x37e3('0xb'))['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x37e3('0xe'),'disposition',_0x37e3('0xf'),_0x37e3('0x10')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0xff5e=['Request','CreateVoiceCallReport','calleridnum','context','callerid','getVoiceCallReports','GetVoiceCallReport','outbound','day','YYYY-MM-DD\x20HH:mm:ss','endOf','format','type','disposition','duration','GetVoiceCallReports','moment','util','create'];(function(_0x2f9438,_0x712092){var _0x39287a=function(_0x4ef976){while(--_0x4ef976){_0x2f9438['push'](_0x2f9438['shift']());}};_0x39287a(++_0x712092);}(_0xff5e,0x6f));var _0xeff5=function(_0x258bee,_0x14f9e4){_0x258bee=_0x258bee-0x0;var _0x106d03=_0xff5e[_0x258bee];return _0x106d03;};'use strict';var moment=require(_0xeff5('0x0'));var util=require(_0xeff5('0x1'));var _=require('lodash');var client=require('../client');exports[_0xeff5('0x2')]=function(_0xf4fe45){return client[_0xeff5('0x3')](_0xeff5('0x4'),{'body':_['merge'](_0xf4fe45,{'source':_0xf4fe45[_0xeff5('0x5')],'destinationcontext':_0xf4fe45[_0xeff5('0x6')],'callerid':_0xf4fe45[_0xeff5('0x7')],'amaflags':'DOCUMENTATION'}),'log':_0xeff5('0x4')});};exports[_0xeff5('0x8')]=function(){return function(){return client['Request'](_0xeff5('0x9'),{'options':{'where':{'type':[_0xeff5('0xa')],'createdAt':{'$between':[moment()['startOf'](_0xeff5('0xb'))['format'](_0xeff5('0xc')),moment()[_0xeff5('0xd')](_0xeff5('0xb'))[_0xeff5('0xe')](_0xeff5('0xc'))]}},'attributes':[_0xeff5('0xf'),_0xeff5('0x10'),_0xeff5('0x11'),'billableseconds']},'log':_0xeff5('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index c49a064..611a4db 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 _0x38bd=['CreateVoiceDialReport','create'];(function(_0x271dc1,_0x5c9b8c){var _0x151678=function(_0x5f1005){while(--_0x5f1005){_0x271dc1['push'](_0x271dc1['shift']());}};_0x151678(++_0x5c9b8c);}(_0x38bd,0xb9));var _0xd38b=function(_0x2e3822,_0x209c2f){_0x2e3822=_0x2e3822-0x0;var _0x4250e4=_0x38bd[_0x2e3822];return _0x4250e4;};'use strict';var client=require('../client');exports[_0xd38b('0x0')]=function(_0x3308f1){return client['Request'](_0xd38b('0x1'),{'body':_0x3308f1,'log':_0xd38b('0x1')});}; \ No newline at end of file +var _0x74f0=['create','Request','../client'];(function(_0x44ab2f,_0x5838be){var _0xbcf44c=function(_0x50674a){while(--_0x50674a){_0x44ab2f['push'](_0x44ab2f['shift']());}};_0xbcf44c(++_0x5838be);}(_0x74f0,0x155));var _0x074f=function(_0x2be240,_0x1e119d){_0x2be240=_0x2be240-0x0;var _0x123543=_0x74f0[_0x2be240];return _0x123543;};'use strict';var client=require(_0x074f('0x0'));exports[_0x074f('0x1')]=function(_0xd10b47){return client[_0x074f('0x2')]('CreateVoiceDialReport',{'body':_0xd10b47,'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 72a4fdf..f16f90c 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 _0xe5b5=['getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat','../client'];(function(_0x5de390,_0x3b9908){var _0x12bf75=function(_0x2d382f){while(--_0x2d382f){_0x5de390['push'](_0x5de390['shift']());}};_0x12bf75(++_0x3b9908);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x3d5351,_0x27bc80){_0x3d5351=_0x3d5351-0x0;var _0x1db4db=_0xe5b5[_0x3d5351];return _0x1db4db;};'use strict';var client=require(_0x5e5b('0x0'));exports[_0x5e5b('0x1')]=function(){return function(){return client[_0x5e5b('0x2')](_0x5e5b('0x3'),{'options':{'raw':!![],'attributes':['id',_0x5e5b('0x4'),_0x5e5b('0x5')],'where':{'VoiceExtensionId':null}},'log':_0x5e5b('0x1')});};}; \ No newline at end of file +var _0x195e=['getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat','../client'];(function(_0x1bb580,_0x4b3948){var _0x54fbf0=function(_0x537c47){while(--_0x537c47){_0x1bb580['push'](_0x1bb580['shift']());}};_0x54fbf0(++_0x4b3948);}(_0x195e,0xfb));var _0xe195=function(_0x6c61c9,_0x3e0bf8){_0x6c61c9=_0x6c61c9-0x0;var _0x297f6b=_0x195e[_0x6c61c9];return _0x297f6b;};'use strict';var client=require(_0xe195('0x0'));exports[_0xe195('0x1')]=function(){return function(){return client[_0xe195('0x2')](_0xe195('0x3'),{'options':{'raw':!![],'attributes':['id',_0xe195('0x4'),_0xe195('0x5')],'where':{'VoiceExtensionId':null}},'log':_0xe195('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 4e09bfb..88b73ff 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 _0x4da5=['active','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','getVoiceQueues','Request','GetVoiceQueue','acw','autopause','monitor_format','type','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','name','callerid'];(function(_0x5a3a5d,_0x36d1e6){var _0x6b607f=function(_0x42de58){while(--_0x42de58){_0x5a3a5d['push'](_0x5a3a5d['shift']());}};_0x6b607f(++_0x36d1e6);}(_0x4da5,0x1b7));var _0x54da=function(_0x2cf130,_0x3bd3f7){_0x2cf130=_0x2cf130-0x0;var _0xc74f15=_0x4da5[_0x2cf130];return _0xc74f15;};'use strict';var client=require('../client');exports[_0x54da('0x0')]=function(){return function(){return client[_0x54da('0x1')](_0x54da('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x54da('0x3'),'acwTimeout',_0x54da('0x4'),_0x54da('0x5'),_0x54da('0x6'),_0x54da('0x7'),'dialMethod',_0x54da('0x8'),_0x54da('0x9'),_0x54da('0xa'),_0x54da('0xb'),_0x54da('0xc'),_0x54da('0xd'),_0x54da('0xe'),'dialOriginateCallerIdNumber',_0x54da('0xf'),_0x54da('0x10'),_0x54da('0x11'),'dialQueueProject',_0x54da('0x12'),'dialCongestionRetryFrequency','dialBusyMaxRetry',_0x54da('0x13'),_0x54da('0x14'),_0x54da('0x15'),_0x54da('0x16'),_0x54da('0x17'),_0x54da('0x18'),_0x54da('0x19'),_0x54da('0x1a'),_0x54da('0x1b'),_0x54da('0x1c'),_0x54da('0x1d'),_0x54da('0x1e'),_0x54da('0x1f'),'dialAMDMinWordLength',_0x54da('0x20'),_0x54da('0x21'),_0x54da('0x22'),_0x54da('0x23'),'timeout',_0x54da('0x24'),_0x54da('0x25'),_0x54da('0x26'),_0x54da('0x27'),_0x54da('0x28'),_0x54da('0x29'),'monitor_format',_0x54da('0x2a'),_0x54da('0x2b'),'dialCutDigit',_0x54da('0x2c'),_0x54da('0x2d'),'dialDropMaxRetry','dialDropRetryFrequency',_0x54da('0x2e'),'dialAbandonedRetryFrequency',_0x54da('0x2f'),_0x54da('0x30'),'dialAgentRejectMaxRetry',_0x54da('0x31'),_0x54da('0x32'),_0x54da('0x33'),_0x54da('0x34'),_0x54da('0x35')],'include':[{'model':_0x54da('0x36'),'as':_0x54da('0x36'),'attributes':['id',_0x54da('0x37'),_0x54da('0x38'),_0x54da('0x39')]},{'model':'Pause','as':_0x54da('0x3a'),'attributes':['id',_0x54da('0x37')]},{'model':_0x54da('0x36'),'as':_0x54da('0x3b'),'attributes':['id',_0x54da('0x37'),_0x54da('0x38'),'active']},{'model':_0x54da('0x3c'),'as':_0x54da('0x3c'),'attributes':['id',_0x54da('0x37')],'include':[{'model':_0x54da('0x3c'),'as':_0x54da('0x3d'),'attributes':['id',_0x54da('0x37'),'interval']}]}]},'log':_0x54da('0x0')});};}; \ No newline at end of file +var _0x8ba0=['dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x8ba0,0x1c7));var _0x08ba=function(_0x1df768,_0x42e7ab){_0x1df768=_0x1df768-0x0;var _0x46ca4c=_0x8ba0[_0x1df768];return _0x46ca4c;};'use strict';var client=require(_0x08ba('0x0'));exports[_0x08ba('0x1')]=function(){return function(){return client[_0x08ba('0x2')](_0x08ba('0x3'),{'options':{'raw':![],'attributes':['id',_0x08ba('0x4'),'acw','acwTimeout',_0x08ba('0x5'),_0x08ba('0x6'),_0x08ba('0x7'),_0x08ba('0x8'),_0x08ba('0x9'),_0x08ba('0xa'),'dialLimitQueue',_0x08ba('0xb'),_0x08ba('0xc'),_0x08ba('0xd'),_0x08ba('0xe'),_0x08ba('0xf'),'dialOriginateCallerIdNumber',_0x08ba('0x10'),'dialQueueOptions',_0x08ba('0x11'),'dialQueueProject',_0x08ba('0x12'),_0x08ba('0x13'),_0x08ba('0x14'),_0x08ba('0x15'),_0x08ba('0x16'),_0x08ba('0x17'),_0x08ba('0x18'),_0x08ba('0x19'),_0x08ba('0x1a'),_0x08ba('0x1b'),_0x08ba('0x1c'),_0x08ba('0x1d'),'dialAMDInitialSilence',_0x08ba('0x1e'),_0x08ba('0x1f'),_0x08ba('0x20'),_0x08ba('0x21'),_0x08ba('0x22'),_0x08ba('0x23'),'dialAMDSilenceThreshold',_0x08ba('0x24'),_0x08ba('0x25'),_0x08ba('0x26'),_0x08ba('0x27'),_0x08ba('0x28'),'dialAgiAfterHangupAgent',_0x08ba('0x29'),_0x08ba('0x2a'),'monitor_format',_0x08ba('0x2b'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0x08ba('0x2c'),_0x08ba('0x2d'),_0x08ba('0x2e'),_0x08ba('0x2f'),_0x08ba('0x30'),_0x08ba('0x31'),_0x08ba('0x32'),'dialMachineRetryFrequency','dialAgentRejectMaxRetry',_0x08ba('0x33'),'mandatoryDisposition',_0x08ba('0x34'),_0x08ba('0x35'),'dialPreviewAutoRecallMe'],'include':[{'model':_0x08ba('0x36'),'as':_0x08ba('0x36'),'attributes':['id',_0x08ba('0x4'),_0x08ba('0x37'),_0x08ba('0x38')]},{'model':_0x08ba('0x39'),'as':_0x08ba('0x3a'),'attributes':['id',_0x08ba('0x4')]},{'model':_0x08ba('0x36'),'as':_0x08ba('0x3b'),'attributes':['id',_0x08ba('0x4'),_0x08ba('0x37'),'active']},{'model':_0x08ba('0x3c'),'as':_0x08ba('0x3c'),'attributes':['id',_0x08ba('0x4')],'include':[{'model':_0x08ba('0x3c'),'as':_0x08ba('0x3d'),'attributes':['id',_0x08ba('0x4'),_0x08ba('0x3e')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index f480ce3..f23ad2f 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(_0x55870d,_0x5eba07){var _0x3d53b3=function(_0x2745af){while(--_0x2745af){_0x55870d['push'](_0x55870d['shift']());}};_0x3d53b3(++_0x5eba07);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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(_0x40b40a,_0x3d08a9){var _0x41a776=function(_0x47e923){while(--_0x47e923){_0x40b40a['push'](_0x40b40a['shift']());}};_0x41a776(++_0x3d08a9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 2e51b8e..b7a5975 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 _0x9798=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x35145b,_0xb7a72a){var _0x4d3fba=function(_0x301125){while(--_0x301125){_0x35145b['push'](_0x35145b['shift']());}};_0x4d3fba(++_0xb7a72a);}(_0x9798,0x1cf));var _0x8979=function(_0x256b1d,_0xc6af1c){_0x256b1d=_0x256b1d-0x0;var _0x41211c=_0x9798[_0x256b1d];return _0x41211c;};'use strict';var client=require(_0x8979('0x0'));exports[_0x8979('0x1')]=function(_0xb2e010){return function(){return client[_0x8979('0x2')](_0x8979('0x3'),{'options':{'where':{'VoiceQueueId':_0xb2e010,'paused':!![]},'raw':!![]},'log':_0x8979('0x1')});};}; \ No newline at end of file +var _0x8b7c=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x342544,_0x391d8f){var _0x389266=function(_0x4a088e){while(--_0x4a088e){_0x342544['push'](_0x342544['shift']());}};_0x389266(++_0x391d8f);}(_0x8b7c,0x111));var _0xc8b7=function(_0x118d61,_0x2410d8){_0x118d61=_0x118d61-0x0;var _0x45c03c=_0x8b7c[_0x118d61];return _0x45c03c;};'use strict';var client=require(_0xc8b7('0x0'));exports[_0xc8b7('0x1')]=function(_0x4b9b7){return function(){return client[_0xc8b7('0x2')](_0xc8b7('0x3'),{'options':{'where':{'VoiceQueueId':_0x4b9b7,'paused':!![]},'raw':!![]},'log':_0xc8b7('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index c49c0be..cb724e4 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(_0x349d8c,_0x40fa81){var _0x16af20=function(_0x184065){while(--_0x184065){_0x349d8c['push'](_0x349d8c['shift']());}};_0x16af20(++_0x40fa81);}(_0x7a54,0x106));var _0x47a5=function(_0x5be6e6,_0x1a8750){_0x5be6e6=_0x5be6e6-0x0;var _0x51f9ff=_0x7a54[_0x5be6e6];return _0x51f9ff;};'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(_0x56b3b8,_0x11192){var _0xa9ba80=function(_0x846772){while(--_0x846772){_0x56b3b8['push'](_0x56b3b8['shift']());}};_0xa9ba80(++_0x11192);}(_0x7a54,0x106));var _0x47a5=function(_0x22fcf0,_0x5eefd9){_0x22fcf0=_0x22fcf0-0x0;var _0x11dec7=_0x7a54[_0x22fcf0];return _0x11dec7;};'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 0615353..b870bde 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 _0xfa34=['transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','extension','blind','CreateVoiceTransferReport','origtransfererchannel','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','isexternal','origtransferercontext','attended','../client','transfers','blindTransfer','Request','result','transferercalleridnum','transfererconnectedlinename','transferercontext','transfererexten','transfereechannel','transfereecalleridname','transfereeconnectedlinenum'];(function(_0x5a059b,_0x4f70b3){var _0x59ed58=function(_0x134476){while(--_0x134476){_0x5a059b['push'](_0x5a059b['shift']());}};_0x59ed58(++_0x4f70b3);}(_0xfa34,0xe9));var _0x4fa3=function(_0x4f0c2b,_0x2c9d14){_0x4f0c2b=_0x4f0c2b-0x0;var _0x526436=_0xfa34[_0x4f0c2b];return _0x526436;};'use strict';var client=require(_0x4fa3('0x0'));exports[_0x4fa3('0x1')]={};exports[_0x4fa3('0x2')]=function(_0x300161){return client[_0x4fa3('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x300161[_0x4fa3('0x4')],'transfererchannel':_0x300161['transfererchannel'],'transferercalleridnum':_0x300161[_0x4fa3('0x5')],'transferercalleridname':_0x300161['transferercalleridname'],'transfererconnectedlinenum':_0x300161['transfererconnectedlinenum'],'transfererconnectedlinename':_0x300161[_0x4fa3('0x6')],'transfereraccountcode':_0x300161['transfereraccountcode'],'transferercontext':_0x300161[_0x4fa3('0x7')],'transfererexten':_0x300161[_0x4fa3('0x8')],'transfererlinkedid':_0x300161['transfererlinkedid'],'transfereechannel':_0x300161[_0x4fa3('0x9')],'transfereecalleridnum':_0x300161['transfereecalleridnum'],'transfereecalleridname':_0x300161[_0x4fa3('0xa')],'transfereeconnectedlinenum':_0x300161[_0x4fa3('0xb')],'transfereeconnectedlinename':_0x300161[_0x4fa3('0xc')],'transfereeaccountcode':_0x300161[_0x4fa3('0xd')],'transfereecontext':_0x300161[_0x4fa3('0xe')],'transfereeexten':_0x300161[_0x4fa3('0xf')],'transfereelinkedid':_0x300161[_0x4fa3('0x10')],'isexternal':_0x300161['isexternal'],'context':_0x300161[_0x4fa3('0x11')],'extension':_0x300161[_0x4fa3('0x12')],'type':_0x4fa3('0x13')},'log':_0x4fa3('0x14')});};exports['attendedTransfer']=function(_0x474dcb){return client[_0x4fa3('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x474dcb[_0x4fa3('0x4')],'transfererchannel':_0x474dcb[_0x4fa3('0x15')],'transferercalleridnum':_0x474dcb['origtransferercalleridnum'],'transferercalleridname':_0x474dcb['origtransferercalleridname'],'transfererconnectedlinenum':_0x474dcb[_0x4fa3('0x16')],'transfererconnectedlinename':_0x474dcb['secondtransfererconnectedlinename'],'transfereraccountcode':_0x474dcb[_0x4fa3('0x17')],'transferercontext':_0x474dcb[_0x4fa3('0x18')],'transfererexten':_0x474dcb[_0x4fa3('0x19')],'transfererlinkedid':_0x474dcb[_0x4fa3('0x1a')],'transfereechannel':_0x474dcb['transfertargetchannel'],'transfereecalleridnum':_0x474dcb['transfertargetcalleridnum'],'transfereecalleridname':_0x474dcb[_0x4fa3('0x1b')],'transfereeconnectedlinenum':_0x474dcb['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x474dcb[_0x4fa3('0x1c')],'transfereeaccountcode':_0x474dcb[_0x4fa3('0x1d')],'transfereecontext':_0x474dcb[_0x4fa3('0x1e')],'transfereeexten':_0x474dcb['transfertargetexten'],'transfereelinkedid':_0x474dcb[_0x4fa3('0x1f')],'isexternal':_0x474dcb[_0x4fa3('0x20')],'context':_0x474dcb[_0x4fa3('0x21')],'extension':_0x474dcb['origtransfererexten'],'type':_0x4fa3('0x22')},'log':_0x4fa3('0x14')});}; \ No newline at end of file +var _0x4efc=['origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transfererconnectedlinenum','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','context','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum'];(function(_0x2e8a64,_0x609d87){var _0x2131ae=function(_0x5d4f8a){while(--_0x5d4f8a){_0x2e8a64['push'](_0x2e8a64['shift']());}};_0x2131ae(++_0x609d87);}(_0x4efc,0x1bc));var _0xc4ef=function(_0x106ee2,_0x30284a){_0x106ee2=_0x106ee2-0x0;var _0xfd26da=_0x4efc[_0x106ee2];return _0xfd26da;};'use strict';var client=require(_0xc4ef('0x0'));exports[_0xc4ef('0x1')]={};exports[_0xc4ef('0x2')]=function(_0x2ae067){return client[_0xc4ef('0x3')](_0xc4ef('0x4'),{'body':{'result':_0x2ae067[_0xc4ef('0x5')],'transfererchannel':_0x2ae067[_0xc4ef('0x6')],'transferercalleridnum':_0x2ae067['transferercalleridnum'],'transferercalleridname':_0x2ae067['transferercalleridname'],'transfererconnectedlinenum':_0x2ae067[_0xc4ef('0x7')],'transfererconnectedlinename':_0x2ae067['transfererconnectedlinename'],'transfereraccountcode':_0x2ae067['transfereraccountcode'],'transferercontext':_0x2ae067[_0xc4ef('0x8')],'transfererexten':_0x2ae067[_0xc4ef('0x9')],'transfererlinkedid':_0x2ae067[_0xc4ef('0xa')],'transfereechannel':_0x2ae067[_0xc4ef('0xb')],'transfereecalleridnum':_0x2ae067[_0xc4ef('0xc')],'transfereecalleridname':_0x2ae067[_0xc4ef('0xd')],'transfereeconnectedlinenum':_0x2ae067['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x2ae067[_0xc4ef('0xe')],'transfereeaccountcode':_0x2ae067[_0xc4ef('0xf')],'transfereecontext':_0x2ae067[_0xc4ef('0x10')],'transfereeexten':_0x2ae067['transfereeexten'],'transfereelinkedid':_0x2ae067[_0xc4ef('0x11')],'isexternal':_0x2ae067[_0xc4ef('0x12')],'context':_0x2ae067[_0xc4ef('0x13')],'extension':_0x2ae067['extension'],'type':_0xc4ef('0x14')},'log':_0xc4ef('0x4')});};exports[_0xc4ef('0x15')]=function(_0x347044){return client[_0xc4ef('0x3')](_0xc4ef('0x4'),{'body':{'result':_0x347044[_0xc4ef('0x5')],'transfererchannel':_0x347044[_0xc4ef('0x16')],'transferercalleridnum':_0x347044[_0xc4ef('0x17')],'transferercalleridname':_0x347044[_0xc4ef('0x18')],'transfererconnectedlinenum':_0x347044[_0xc4ef('0x19')],'transfererconnectedlinename':_0x347044[_0xc4ef('0x1a')],'transfereraccountcode':_0x347044[_0xc4ef('0x1b')],'transferercontext':_0x347044[_0xc4ef('0x1c')],'transfererexten':_0x347044[_0xc4ef('0x1d')],'transfererlinkedid':_0x347044['origtransfererlinkedid'],'transfereechannel':_0x347044['transfertargetchannel'],'transfereecalleridnum':_0x347044[_0xc4ef('0x1e')],'transfereecalleridname':_0x347044[_0xc4ef('0x1f')],'transfereeconnectedlinenum':_0x347044[_0xc4ef('0x20')],'transfereeconnectedlinename':_0x347044[_0xc4ef('0x21')],'transfereeaccountcode':_0x347044[_0xc4ef('0x22')],'transfereecontext':_0x347044['transfertargetcontext'],'transfereeexten':_0x347044[_0xc4ef('0x23')],'transfereelinkedid':_0x347044[_0xc4ef('0x24')],'isexternal':_0x347044[_0xc4ef('0x12')],'context':_0x347044['origtransferercontext'],'extension':_0x347044[_0xc4ef('0x25')],'type':_0xc4ef('0x26')},'log':_0xc4ef('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 626a9a4..5210439 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 _0x3fa4=['name','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','omit','undefined','values','channels','voicechannel','validate','find','%s.%s','wav','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','uniqueid','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','resolve','StopMixMonitor','destinationchannel','stop','filename','toLowerCase','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','context','telephones','trunks','outboundChannels','campaigns','run','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','checkAfterSend','server','127.0.0.1','lodash','bluebird','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','timers','timer','agents','updateStatusRealtime','QueuePause','asterisk','ami\x20disconnected','join','keys','module','action','Reload','Action','then','catch','error','message','isConnected','username','command','Command','content','voiceQueues'];(function(_0x446f40,_0x203d4e){var _0x54bef1=function(_0x5c09ff){while(--_0x5c09ff){_0x446f40['push'](_0x446f40['shift']());}};_0x54bef1(++_0x203d4e);}(_0x3fa4,0xf0));var _0x43fa=function(_0x15c1b5,_0x14cdd5){_0x15c1b5=_0x15c1b5-0x0;var _0x46b77b=_0x3fa4[_0x15c1b5];return _0x46b77b;};'use strict';var _=require(_0x43fa('0x0'));var util=require('util');var jayson=require('jayson/promise');var schema=require('validate');var BPromise=require(_0x43fa('0x1'));var moment=require(_0x43fa('0x2'));var config=require(_0x43fa('0x3'));var properties=require(_0x43fa('0x4'));var ami=require(_0x43fa('0x5'));exports[_0x43fa('0x6')]=function(_0x41ded6,_0x4cd7ec,_0x2c7789){return new BPromise(function(_0x1e53b3,_0x6df71c){var _0x584209={'QueuePause':function(_0x3dc891){return new Promise(function(_0x46adc7,_0x1dc401){var _0x5a3921=util[_0x43fa('0x7')](_0x43fa('0x8'),'SIP',_0x3dc891['name']);if(_0x41ded6[_0x43fa('0x9')]&&_0x41ded6[_0x43fa('0x9')][_0x5a3921]&&_0x41ded6[_0x43fa('0x9')][_0x5a3921][_0x43fa('0xa')]){_0x41ded6[_0x43fa('0x9')][_0x5a3921]['updateAcw']();}if(_0x41ded6[_0x43fa('0xb')][_0x5a3921]){_0x41ded6[_0x43fa('0xb')][_0x5a3921][_0x43fa('0xc')]({'statePause':_0x3dc891['pause']?!![]:![]});}_0x46adc7({'code':0xc8,'message':_0x43fa('0xd')});});},'Reload':function(_0x4353c1){var _0x4665c1=this;return new Promise(function(_0x529c85,_0x24fb1e){if(ami['isConnected']()==![]){return _0x24fb1e(_0x4665c1['error'](0x1f4,[config['asterisk']['ip'],config[_0x43fa('0xe')]['username'],_0x43fa('0xf')][_0x43fa('0x10')]('\x20')));}_0x4353c1=_['pick'](_0x4353c1,_[_0x43fa('0x11')](properties[_0x43fa('0x12')]));_0x4353c1[_0x43fa('0x13')]=_0x43fa('0x14');return ami[_0x43fa('0x15')](_0x4353c1)[_0x43fa('0x16')](function(_0x5d12ac){_0x529c85({'code':0xc8,'message':_0x5d12ac['message']});})[_0x43fa('0x17')](function(_0x29b8aa){_0x24fb1e(_0x4665c1[_0x43fa('0x18')](0x1f5,_0x29b8aa[_0x43fa('0x19')]));});});},'Command':function(_0x660f61){var _0x15e594=this;return new Promise(function(_0xdf68a6,_0x2d8594){if(ami[_0x43fa('0x1a')]()==![]){return _0x2d8594(_0x15e594['error'](0x1f4,[config[_0x43fa('0xe')]['ip'],config[_0x43fa('0xe')][_0x43fa('0x1b')],_0x43fa('0xf')][_0x43fa('0x10')]('\x20')));}_0x660f61=_['pick'](_0x660f61,_0x43fa('0x1c'));_0x660f61[_0x43fa('0x13')]=_0x43fa('0x1d');return ami[_0x43fa('0x15')](_0x660f61)[_0x43fa('0x16')](function(_0x1d3328){_0xdf68a6({'code':0xc8,'message':_0x1d3328[_0x43fa('0x1e')]});})[_0x43fa('0x17')](function(_0x427426){_0x2d8594(_0x15e594['error'](0x1f5,_0x427426['message']));});});},'VoiceQueues':function(_0xdb62ec){return new Promise(function(_0x197eac,_0x28f695){var _0x78f105=[];for(var _0x40969a in _0x41ded6[_0x43fa('0x1f')]){if(_0x41ded6['voiceQueues']['hasOwnProperty'](_0x40969a)){var _0x1fa077=_0x41ded6[_0x43fa('0x1f')][_0x40969a];var _0x3d6365={'id':_0x1fa077['id'],'name':_0x1fa077[_0x43fa('0x20')],'strategy':_0x1fa077['strategy'],'answered':_0x1fa077[_0x43fa('0x21')],'available':_0x1fa077[_0x43fa('0x22')],'loggedIn':_0x1fa077[_0x43fa('0x23')],'pTalking':_0x1fa077[_0x43fa('0x24')],'sumBillable':_0x1fa077['sumBillable'],'sumDuration':_0x1fa077[_0x43fa('0x25')],'sumHoldTime':_0x1fa077[_0x43fa('0x26')]||0x0,'talking':_0x1fa077[_0x43fa('0x27')],'total':_0x1fa077[_0x43fa('0x28')],'type':_0x1fa077[_0x43fa('0x29')],'unmanaged':_0x1fa077[_0x43fa('0x2a')],'abandoned':_0x1fa077[_0x43fa('0x2b')],'waiting':_0x1fa077[_0x43fa('0x2c')],'loggedInDb':_0x1fa077[_0x43fa('0x2d')]};if(_0x1fa077[_0x43fa('0x29')]===_0x43fa('0x2e')){_0x3d6365[_0x43fa('0x2f')]=_0x1fa077['dialActive'];_0x3d6365['dialMethod']=_0x1fa077[_0x43fa('0x30')];_0x3d6365[_0x43fa('0x31')]=_0x1fa077[_0x43fa('0x31')];_0x3d6365[_0x43fa('0x32')]=_0x1fa077['dialOriginateCallerIdNumber'];_0x3d6365[_0x43fa('0x33')]=_0x1fa077[_0x43fa('0x33')];_0x3d6365[_0x43fa('0x34')]=_0x1fa077['dialPrefix'];_0x3d6365[_0x43fa('0x35')]=_0x1fa077[_0x43fa('0x35')];_0x3d6365[_0x43fa('0x36')]=_0x1fa077[_0x43fa('0x36')];_0x3d6365['outboundAnswerCallsDay']=_0x1fa077[_0x43fa('0x37')];_0x3d6365['outboundBlacklistCallsDay']=_0x1fa077[_0x43fa('0x38')];_0x3d6365[_0x43fa('0x39')]=_0x1fa077[_0x43fa('0x39')];_0x3d6365['outboundCongestionCallsDay']=_0x1fa077[_0x43fa('0x3a')];_0x3d6365['outboundDropCallsDayACS']=_0x1fa077['outboundDropCallsDayACS'];_0x3d6365[_0x43fa('0x3b')]=_0x1fa077[_0x43fa('0x3b')];_0x3d6365[_0x43fa('0x3c')]=_0x1fa077['outboundDropCallsDayTimeout'];_0x3d6365[_0x43fa('0x3d')]=_0x1fa077[_0x43fa('0x3d')];_0x3d6365[_0x43fa('0x3e')]=_0x1fa077[_0x43fa('0x3e')];_0x3d6365[_0x43fa('0x3f')]=_0x1fa077['outboundOriginateFailureCallsDay'];_0x3d6365[_0x43fa('0x40')]=_0x1fa077[_0x43fa('0x40')];_0x3d6365[_0x43fa('0x41')]=_0x1fa077[_0x43fa('0x41')];_0x3d6365['outboundUnknownCallsDay']=_0x1fa077['outboundUnknownCallsDay'];_0x3d6365[_0x43fa('0x42')]=_0x1fa077[_0x43fa('0x42')];_0x3d6365[_0x43fa('0x43')]=_0x1fa077[_0x43fa('0x43')];_0x3d6365[_0x43fa('0x44')]=_0x1fa077['predictiveIntervalAvgTalktime'];_0x3d6365[_0x43fa('0x45')]=_0x1fa077['predictiveIntervalDroppedCallsCallersExit'];_0x3d6365['predictiveIntervalDroppedCallsTimeout']=_0x1fa077[_0x43fa('0x46')];_0x3d6365['predictiveIntervalErlangCalls']=_0x1fa077[_0x43fa('0x47')];_0x3d6365[_0x43fa('0x48')]=_0x1fa077[_0x43fa('0x48')];_0x3d6365[_0x43fa('0x49')]=_0x1fa077['predictiveIntervalHitRate'];_0x3d6365['predictiveIntervalMultiplicativeFactor']=_0x1fa077['predictiveIntervalMultiplicativeFactor'];_0x3d6365[_0x43fa('0x4a')]=_0x1fa077[_0x43fa('0x4a')];_0x3d6365['predictiveIntervalAvailable']=_0x1fa077[_0x43fa('0x4b')];_0x3d6365[_0x43fa('0x4c')]=_0x1fa077[_0x43fa('0x4c')];_0x3d6365[_0x43fa('0x19')]=_0x1fa077['message'];_0x3d6365[_0x43fa('0x4d')]=_0x1fa077[_0x43fa('0x4d')];_0x3d6365['erlangCalls']=_0x1fa077['erlangCalls'];_0x3d6365[_0x43fa('0x4e')]=_0x1fa077['erlangCallToSecond'];_0x3d6365[_0x43fa('0x4f')]=_0x1fa077[_0x43fa('0x4f')];_0x3d6365['erlangBusyFactor']=_0x1fa077[_0x43fa('0x50')];_0x3d6365['startPredictive']=_0x1fa077[_0x43fa('0x51')];_0x3d6365[_0x43fa('0x52')]=_0x1fa077[_0x43fa('0x52')];}if(_0x1fa077['Trunk']){_0x3d6365[_0x43fa('0x53')]={'id':_0x1fa077[_0x43fa('0x53')]['id'],'name':_0x1fa077[_0x43fa('0x53')][_0x43fa('0x20')],'active':_0x1fa077[_0x43fa('0x53')][_0x43fa('0x54')],'callerid':_0x1fa077['Trunk'][_0x43fa('0x55')]};}if(_0x1fa077['Interval']){_0x3d6365[_0x43fa('0x56')]={'id':_0x1fa077['Interval']['id'],'name':_0x1fa077[_0x43fa('0x56')][_0x43fa('0x20')]};}_0x78f105[_0x43fa('0x57')](_0x3d6365);}}_0x197eac({'count':_0x78f105[_0x43fa('0x58')],'rows':_0x78f105});});},'UpdateVoiceQueue':function(_0x1b8851){return new Promise(function(_0x5575a7,_0x2fffef){var _0x5c96e1=_['find'](_0x41ded6['voiceQueues'],{'id':parseInt(_0x1b8851['id'])});var _0x436da4=_[_0x43fa('0x59')](_0x1b8851,['id']);if(_0x5c96e1){for(var _0x2c246e in _0x436da4){if(typeof _0x436da4[_0x2c246e]!==_0x43fa('0x5a')&&typeof _0x5c96e1[_0x2c246e]!==_0x43fa('0x5a')){_0x5c96e1[_0x2c246e]=_0x436da4[_0x2c246e];}}_0x5575a7(_0x5c96e1);}else{_0x2fffef();}});},'VoiceChannels':function(_0x4d3522){return new Promise(function(_0x42bf1c,_0x1662d5){var _0x305e90=_[_0x43fa('0x5b')](_0x41ded6[_0x43fa('0x5c')]);_0x42bf1c({'count':_0x305e90[_0x43fa('0x58')],'rows':_0x305e90});});},'VoiceChannelMixMonitor':function(_0x1e2acd){var _0x33f828=this;return new Promise(function(_0x345c65,_0x458e11){if(ami[_0x43fa('0x1a')]()==![]){return _0x458e11(_0x33f828['error'](0x1f4,[config[_0x43fa('0xe')]['ip'],config[_0x43fa('0xe')]['username'],_0x43fa('0xf')]['join']('\x20')));}var _0x193a0b=schema(properties[_0x43fa('0x5d')])[_0x43fa('0x5e')](_0x1e2acd);if(_0x193a0b[_0x43fa('0x58')]>0x0){return _0x458e11(_0x33f828[_0x43fa('0x18')](0x1f4,_['map'](_0x193a0b,_0x43fa('0x19'))['join'](',\x20')));}var _0x12ac3f=_[_0x43fa('0x5f')](_0x41ded6[_0x43fa('0x5c')],{'uniqueid':_0x1e2acd['uniqueid']});if(_0x12ac3f&&_0x12ac3f['channel']){var _0xc3f7aa=util['format'](_0x43fa('0x60'),_0x1e2acd['filename']||_0x1e2acd['uniqueid'],_0x1e2acd[_0x43fa('0x7')]||_0x43fa('0x61'));return ami['Action']({'action':_0x43fa('0x62'),'channel':_0x12ac3f[_0x43fa('0x63')],'file':_0xc3f7aa,'options':_0x43fa('0x64')})[_0x43fa('0x16')](function(_0x51d224){var _0xb03adb=_[_0x43fa('0x5f')](_0x12ac3f[_0x43fa('0x65')],{'filename':_0x43fa('0x66')+_0xc3f7aa['toLowerCase']()});if(_['isNil'](_0xb03adb)){_0x12ac3f[_0x43fa('0x65')]['push']({'filename':'/var/spool/asterisk/monitor/'+_0xc3f7aa['toLowerCase'](),'createdAt':moment()[_0x43fa('0x7')](_0x43fa('0x67')),'mixmonitorid':_0x51d224[_0x43fa('0x68')],'status':_0x43fa('0x69')});}else{_0xb03adb[_0x43fa('0x68')]=_0x51d224[_0x43fa('0x68')];_0xb03adb[_0x43fa('0x6a')]='rec';}_0x345c65({'code':0xc8,'message':[_0x1e2acd[_0x43fa('0x6b')],_0x43fa('0x6c'),_0x51d224['mixmonitorid']][_0x43fa('0x10')]('\x20'),'mixmonitorid':_0x51d224['mixmonitorid']});})[_0x43fa('0x17')](function(_0x18cea7){_0x458e11(_0x33f828[_0x43fa('0x18')](0x1f5,[_0x1e2acd[_0x43fa('0x6b')],_0x18cea7['message']['toLowerCase']()][_0x43fa('0x10')]('\x20')));});}else{return _0x458e11(_0x33f828[_0x43fa('0x18')](0x1f5,_0x43fa('0x6d')));}});},'VoiceChannelStopMixMonitor':function(_0x3ba2e0){var _0x5aa7af=this;return new Promise(function(_0x4cfc61,_0x4045d1){if(ami['isConnected']()==![]){return _0x4045d1(_0x5aa7af[_0x43fa('0x18')](0x1f4,[config[_0x43fa('0xe')]['ip'],config[_0x43fa('0xe')][_0x43fa('0x1b')],'ami\x20disconnected']['join']('\x20')));}var _0x220e2a=schema(properties['voicechannel'])[_0x43fa('0x5e')](_0x3ba2e0);if(_0x220e2a[_0x43fa('0x58')]>0x0){return _0x4045d1(_0x5aa7af[_0x43fa('0x18')](0x1f4,_[_0x43fa('0x6e')](_0x220e2a,_0x43fa('0x19'))[_0x43fa('0x10')](',\x20')));}var _0x3f89f4=_['find'](_0x41ded6[_0x43fa('0x5c')],{'uniqueid':_0x3ba2e0[_0x43fa('0x6b')]});if(_0x3f89f4){return BPromise[_0x43fa('0x6f')]()[_0x43fa('0x16')](function(){if(_0x3f89f4[_0x43fa('0x63')]){return ami['Action']({'action':_0x43fa('0x70'),'channel':_0x3f89f4[_0x43fa('0x63')],'mixmonitorid':_0x3ba2e0[_0x43fa('0x68')]})[_0x43fa('0x17')](function(_0x78f0a9){});}})[_0x43fa('0x16')](function(){if(_0x3f89f4[_0x43fa('0x71')]){return ami[_0x43fa('0x15')]({'action':_0x43fa('0x70'),'channel':_0x3f89f4['destinationchannel'],'mixmonitorid':_0x3ba2e0[_0x43fa('0x68')]})[_0x43fa('0x17')](function(_0x2d8a01){});}})[_0x43fa('0x16')](function(_0x31fdeb){var _0x4e9f30=_['find'](_0x3f89f4[_0x43fa('0x65')],{'mixmonitorid':_0x3ba2e0[_0x43fa('0x68')]});if(_0x4e9f30){_0x4e9f30[_0x43fa('0x6a')]=_0x43fa('0x72');}})[_0x43fa('0x16')](function(){var _0x2bae57=util[_0x43fa('0x7')](_0x43fa('0x60'),_0x3ba2e0[_0x43fa('0x73')]||_0x3ba2e0[_0x43fa('0x6b')],_0x3ba2e0[_0x43fa('0x7')]||_0x43fa('0x61'));var _0xa96468=_[_0x43fa('0x5f')](_0x3f89f4[_0x43fa('0x65')],{'filename':_0x43fa('0x66')+_0x2bae57[_0x43fa('0x74')]()});if(_0xa96468){_0xa96468[_0x43fa('0x6a')]=_0x43fa('0x72');}})[_0x43fa('0x16')](function(){_0x4cfc61({'code':0xc8,'message':[_0x3ba2e0[_0x43fa('0x6b')],_0x43fa('0x75')]['join']('\x20')});})['catch'](function(_0x2840d9){_0x4045d1(_0x5aa7af[_0x43fa('0x18')](0x1f5,[_0x3ba2e0['uniqueid'],_0x2840d9[_0x43fa('0x19')]['toLowerCase']()][_0x43fa('0x10')]('\x20')));});}else{return _0x4045d1(_0x5aa7af['error'](0x1f5,_0x43fa('0x6d')));}});},'VoiceQueuesChannels':function(_0x6679e0){return new Promise(function(_0x1b79b3,_0x149093){var _0x61aef=_['values'](_0x41ded6[_0x43fa('0x76')]);_0x1b79b3({'count':_0x61aef['length'],'rows':_0x61aef});});},'VoiceQueuesChannel':function(_0x1ea3a0){var _0x310232=this;return new Promise(function(_0x2ed970,_0x1619ae){var _0x195c8b=schema(properties['voicequeuechannel'])[_0x43fa('0x5e')](_0x1ea3a0);if(_0x195c8b[_0x43fa('0x58')]>0x0){return _0x1619ae(_0x310232['error'](0x1f4,_[_0x43fa('0x6e')](_0x195c8b,'message')[_0x43fa('0x10')](',\x20')));}var _0x3c138c=_['find'](_0x41ded6[_0x43fa('0x76')],{'uniqueid':_0x1ea3a0[_0x43fa('0x6b')]});if(_0x3c138c){_0x2ed970(_0x3c138c);}else{return _0x1619ae(_0x310232[_0x43fa('0x18')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x5c2538){var _0x43088a=this;return new Promise(function(_0x334642,_0x161e93){if(ami[_0x43fa('0x1a')]()==![]){return _0x161e93(_0x43088a['error'](0x1f4,[config[_0x43fa('0xe')]['ip'],config['asterisk']['username'],_0x43fa('0xf')][_0x43fa('0x10')]('\x20')));}var _0xb7596=schema(properties[_0x43fa('0x77')])[_0x43fa('0x5e')](_0x5c2538);if(_0xb7596[_0x43fa('0x58')]>0x0){return _0x161e93(_0x43088a['error'](0x1f4,_[_0x43fa('0x6e')](_0xb7596,_0x43fa('0x19'))[_0x43fa('0x10')](',\x20')));}var _0x5779d1=_[_0x43fa('0x5f')](_0x41ded6[_0x43fa('0x76')],{'uniqueid':_0x5c2538[_0x43fa('0x6b')]});if(_0x5779d1&&_0x5779d1['channel']){return ami[_0x43fa('0x15')]({'action':_0x43fa('0x78'),'channel':_0x5779d1['channel']})['then'](function(_0xa71bb){_0x334642({'code':0xc8,'message':[_0x5c2538[_0x43fa('0x6b')],_0xa71bb[_0x43fa('0x19')][_0x43fa('0x74')]()][_0x43fa('0x10')]('\x20')});})[_0x43fa('0x17')](function(_0x241200){_0x161e93(_0x43088a[_0x43fa('0x18')](0x1f5,[_0x5c2538[_0x43fa('0x6b')],_0x241200[_0x43fa('0x19')][_0x43fa('0x74')]()][_0x43fa('0x10')]('\x20')));});}else{return _0x161e93(_0x43088a[_0x43fa('0x18')](0x1f5,_0x43fa('0x6d')));}});},'VoiceQueuesChannelRedirect':function(_0x41ea25){var _0x33b067=this;return new Promise(function(_0x5d3d43,_0x2c3333){if(ami[_0x43fa('0x1a')]()==![]){return _0x2c3333(_0x33b067[_0x43fa('0x18')](0x1f4,[config[_0x43fa('0xe')]['ip'],config['asterisk'][_0x43fa('0x1b')],'ami\x20disconnected']['join']('\x20')));}var _0x4931dd=schema(properties[_0x43fa('0x79')])['validate'](_0x41ea25);if(_0x4931dd[_0x43fa('0x58')]>0x0){return _0x2c3333(_0x33b067[_0x43fa('0x18')](0x1f4,_[_0x43fa('0x6e')](_0x4931dd,_0x43fa('0x19'))[_0x43fa('0x10')](',\x20')));}var _0x521d7a=_[_0x43fa('0x5f')](_0x41ded6[_0x43fa('0x76')],{'uniqueid':_0x41ea25[_0x43fa('0x6b')]});if(_0x521d7a&&_0x521d7a[_0x43fa('0x63')]){return ami['Action']({'action':'Redirect','channel':_0x521d7a['channel'],'exten':_0x41ea25['exten'],'context':_0x41ea25[_0x43fa('0x7a')]||_0x521d7a[_0x43fa('0x7a')],'priority':0x1})[_0x43fa('0x16')](function(_0x583deb){_0x5d3d43({'code':0xc8,'message':[_0x41ea25[_0x43fa('0x6b')],_0x583deb[_0x43fa('0x19')][_0x43fa('0x74')]()][_0x43fa('0x10')]('\x20')});})['catch'](function(_0x170e69){_0x2c3333(_0x33b067[_0x43fa('0x18')](0x1f5,[_0x41ea25[_0x43fa('0x6b')],_0x170e69[_0x43fa('0x19')][_0x43fa('0x74')]()][_0x43fa('0x10')]('\x20')));});}else{return _0x2c3333(_0x33b067[_0x43fa('0x18')](0x1f5,_0x43fa('0x6d')));}});},'Agents':function(_0x5c98df){return new Promise(function(_0x4b31b2,_0x278242){var _0xe218b0=_[_0x43fa('0x5b')](_0x41ded6['agents']);_0x4b31b2({'count':_0xe218b0[_0x43fa('0x58')],'rows':_0xe218b0});});},'Telephones':function(_0x3f4839){return new Promise(function(_0x268cb2,_0x563487){var _0x3a3771=_[_0x43fa('0x5b')](_0x41ded6[_0x43fa('0x7b')]);_0x268cb2({'count':_0x3a3771['length'],'rows':_0x3a3771});});},'Trunks':function(_0x10123f){return new Promise(function(_0x457006,_0x461abd){var _0x5272eb=_[_0x43fa('0x5b')](_0x41ded6[_0x43fa('0x7c')]);_0x457006({'count':_0x5272eb['length'],'rows':_0x5272eb});});},'OutboundChannels':function(_0x733caf){return new Promise(function(_0x941b71,_0xb7fb97){var _0x50a4a9=_[_0x43fa('0x5b')](_0x41ded6[_0x43fa('0x7d')]);_0x941b71({'count':_0x50a4a9[_0x43fa('0x58')],'rows':_0x50a4a9});});},'Outbound':function(_0x1d033b){return new Promise(function(_0x2ee768,_0xb7474f){_0x2ee768(_0x41ded6['outbound']);});},'Campaigns':function(_0x179678){return new Promise(function(_0x1e2e8e,_0x302f7c){var _0x1f7593=_[_0x43fa('0x5b')](_0x41ded6[_0x43fa('0x7e')]);_0x1e2e8e({'count':_0x1f7593[_0x43fa('0x58')],'rows':_0x1f7593});});},'VoiceQueuesPreview':function(_0x2a56a9){var _0x59cda3=this;return new Promise(function(_0x5a615c,_0x1c881d){_0x4cd7ec[_0x43fa('0x7f')](_0x2a56a9['id'])[_0x43fa('0x16')](function(_0x1f1dd0){_0x5a615c({'code':0xc8,'message':_0x1f1dd0['message']});})[_0x43fa('0x17')](function(_0x374039){_0x1c881d(_0x59cda3['error'](0x1f4,_0x374039[_0x43fa('0x19')]));});});},'EventManager':function(_0x1f240a){var _0x3c2c3c=this;return new Promise(function(_0x1f5df6,_0x187b74){if(!_0x1f240a['event']){return _0x187b74(_0x3c2c3c[_0x43fa('0x18')](0x1f4,_0x43fa('0x80')));}ami[_0x43fa('0x81')](_0x43fa('0x82')+_0x1f240a[_0x43fa('0x83')],_0x1f240a[_0x43fa('0x19')]);_0x1f5df6({'code':0xc8,'message':_0x1f240a});});},'FaxAccounts':function(_0x303923){return new Promise(function(_0xac5e4f,_0x121f31){var _0x5af6e3=_[_0x43fa('0x5b')](_0x41ded6[_0x43fa('0x84')]);_0xac5e4f({'count':_0x5af6e3[_0x43fa('0x58')],'rows':_0x5af6e3});});},'SendFax':function(_0x3ef055){var _0x15230c=this;return new Promise(function(_0x3480c6,_0x1d4217){_0x2c7789['send'](_0x3ef055)[_0x43fa('0x16')](function(_0x5250b4){_0x3480c6({'code':0xc8,'message':_0x5250b4[_0x43fa('0x19')]});})[_0x43fa('0x17')](function(_0x484c73){_0x1d4217(_0x15230c['error'](0x1f4,_0x484c73[_0x43fa('0x19')]));});});},'CheckAfterSend':function(_0x12a889){var _0x30a504=this;return new Promise(function(_0x262aee,_0x131afb){_0x2c7789[_0x43fa('0x85')](_0x12a889)[_0x43fa('0x16')](function(_0xdec4bc){_0x262aee({'code':0xc8,'message':_0xdec4bc['message']});})[_0x43fa('0x17')](function(_0x1c41a1){_0x131afb(_0x30a504[_0x43fa('0x18')](0x1f4,_0x1c41a1[_0x43fa('0x19')]));});});}};var _0x377a73=jayson[_0x43fa('0x86')](_0x584209)['http']();_0x377a73['on']('error',function(_0x5c75b0){return _0x6df71c(_0x5c75b0);});_0x377a73[_0x43fa('0x6')](0x232a,_0x43fa('0x87'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x1e53b3('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0x0f4d=['telephones','outboundChannels','outbound','run','event','Event\x20name\x20mandatory','emit','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','validate','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','name','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','username','keys','module','action','Reload','Action','then','message','catch','error','ami\x20disconnected','join','pick','command','Command','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','type','unmanaged','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','omit','undefined','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','ai(mixmonitorid)','find','monitors','toLowerCase','isNil','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','stop','wav','StopMixMonitor\x20Success','values','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context'];(function(_0x1f29a8,_0x15ee9b){var _0xc62ab7=function(_0x276fce){while(--_0x276fce){_0x1f29a8['push'](_0x1f29a8['shift']());}};_0xc62ab7(++_0x15ee9b);}(_0x0f4d,0x12c));var _0xd0f4=function(_0x56a52c,_0x4adc35){_0x56a52c=_0x56a52c-0x0;var _0x10ba36=_0x0f4d[_0x56a52c];return _0x10ba36;};'use strict';var _=require('lodash');var util=require('util');var jayson=require('jayson/promise');var schema=require(_0xd0f4('0x0'));var BPromise=require('bluebird');var moment=require(_0xd0f4('0x1'));var config=require(_0xd0f4('0x2'));var properties=require(_0xd0f4('0x3'));var ami=require(_0xd0f4('0x4'));exports[_0xd0f4('0x5')]=function(_0x2a0efc,_0x37c481,_0x1d9a9d){return new BPromise(function(_0x531f85,_0x1164da){var _0x27acb8={'QueuePause':function(_0x4d0ab0){return new Promise(function(_0x3992be,_0x2a0057){var _0x4c826e=util[_0xd0f4('0x6')](_0xd0f4('0x7'),'SIP',_0x4d0ab0[_0xd0f4('0x8')]);if(_0x2a0efc[_0xd0f4('0x9')]&&_0x2a0efc[_0xd0f4('0x9')][_0x4c826e]&&_0x2a0efc['timers'][_0x4c826e]['timer']){_0x2a0efc[_0xd0f4('0x9')][_0x4c826e][_0xd0f4('0xa')]();}if(_0x2a0efc[_0xd0f4('0xb')][_0x4c826e]){_0x2a0efc[_0xd0f4('0xb')][_0x4c826e][_0xd0f4('0xc')]({'statePause':_0x4d0ab0[_0xd0f4('0xd')]?!![]:![]});}_0x3992be({'code':0xc8,'message':_0xd0f4('0xe')});});},'Reload':function(_0x5679a7){var _0x2eac6f=this;return new Promise(function(_0x30c904,_0x51656c){if(ami[_0xd0f4('0xf')]()==![]){return _0x51656c(_0x2eac6f['error'](0x1f4,[config[_0xd0f4('0x10')]['ip'],config['asterisk'][_0xd0f4('0x11')],'ami\x20disconnected']['join']('\x20')));}_0x5679a7=_['pick'](_0x5679a7,_[_0xd0f4('0x12')](properties[_0xd0f4('0x13')]));_0x5679a7[_0xd0f4('0x14')]=_0xd0f4('0x15');return ami[_0xd0f4('0x16')](_0x5679a7)[_0xd0f4('0x17')](function(_0xe8cefc){_0x30c904({'code':0xc8,'message':_0xe8cefc[_0xd0f4('0x18')]});})[_0xd0f4('0x19')](function(_0x5de07b){_0x51656c(_0x2eac6f[_0xd0f4('0x1a')](0x1f5,_0x5de07b[_0xd0f4('0x18')]));});});},'Command':function(_0x32605d){var _0xa0662=this;return new Promise(function(_0x5cb3cb,_0x11d9ba){if(ami[_0xd0f4('0xf')]()==![]){return _0x11d9ba(_0xa0662[_0xd0f4('0x1a')](0x1f4,[config[_0xd0f4('0x10')]['ip'],config['asterisk'][_0xd0f4('0x11')],_0xd0f4('0x1b')][_0xd0f4('0x1c')]('\x20')));}_0x32605d=_[_0xd0f4('0x1d')](_0x32605d,_0xd0f4('0x1e'));_0x32605d[_0xd0f4('0x14')]=_0xd0f4('0x1f');return ami['Action'](_0x32605d)[_0xd0f4('0x17')](function(_0x327696){_0x5cb3cb({'code':0xc8,'message':_0x327696[_0xd0f4('0x20')]});})[_0xd0f4('0x19')](function(_0x4d49c0){_0x11d9ba(_0xa0662[_0xd0f4('0x1a')](0x1f5,_0x4d49c0['message']));});});},'VoiceQueues':function(_0x32585c){return new Promise(function(_0xbdfcf1,_0x1cf493){var _0x567eb4=[];for(var _0x42d944 in _0x2a0efc[_0xd0f4('0x21')]){if(_0x2a0efc[_0xd0f4('0x21')][_0xd0f4('0x22')](_0x42d944)){var _0x366af6=_0x2a0efc['voiceQueues'][_0x42d944];var _0x3860e8={'id':_0x366af6['id'],'name':_0x366af6[_0xd0f4('0x8')],'strategy':_0x366af6[_0xd0f4('0x23')],'answered':_0x366af6[_0xd0f4('0x24')],'available':_0x366af6[_0xd0f4('0x25')],'loggedIn':_0x366af6[_0xd0f4('0x26')],'pTalking':_0x366af6[_0xd0f4('0x27')],'sumBillable':_0x366af6[_0xd0f4('0x28')],'sumDuration':_0x366af6[_0xd0f4('0x29')],'sumHoldTime':_0x366af6['sumHoldTime']||0x0,'talking':_0x366af6[_0xd0f4('0x2a')],'total':_0x366af6[_0xd0f4('0x2b')],'type':_0x366af6[_0xd0f4('0x2c')],'unmanaged':_0x366af6[_0xd0f4('0x2d')],'abandoned':_0x366af6['abandoned'],'waiting':_0x366af6[_0xd0f4('0x2e')],'loggedInDb':_0x366af6['loggedInDb']};if(_0x366af6['type']==='outbound'){_0x3860e8[_0xd0f4('0x2f')]=_0x366af6[_0xd0f4('0x2f')];_0x3860e8[_0xd0f4('0x30')]=_0x366af6[_0xd0f4('0x30')];_0x3860e8[_0xd0f4('0x31')]=_0x366af6[_0xd0f4('0x31')];_0x3860e8[_0xd0f4('0x32')]=_0x366af6[_0xd0f4('0x32')];_0x3860e8['dialOriginateTimeout']=_0x366af6[_0xd0f4('0x33')];_0x3860e8['dialPrefix']=_0x366af6[_0xd0f4('0x34')];_0x3860e8[_0xd0f4('0x35')]=_0x366af6['temp'];_0x3860e8['outboundAnswerAgiCallsDay']=_0x366af6[_0xd0f4('0x36')];_0x3860e8['outboundAnswerCallsDay']=_0x366af6[_0xd0f4('0x37')];_0x3860e8[_0xd0f4('0x38')]=_0x366af6['outboundBlacklistCallsDay'];_0x3860e8[_0xd0f4('0x39')]=_0x366af6[_0xd0f4('0x39')];_0x3860e8['outboundCongestionCallsDay']=_0x366af6['outboundCongestionCallsDay'];_0x3860e8[_0xd0f4('0x3a')]=_0x366af6[_0xd0f4('0x3a')];_0x3860e8['outboundDropCallsDayCallersExit']=_0x366af6[_0xd0f4('0x3b')];_0x3860e8['outboundDropCallsDayTimeout']=_0x366af6[_0xd0f4('0x3c')];_0x3860e8[_0xd0f4('0x3d')]=_0x366af6['outboundNoAnswerCallsDay'];_0x3860e8[_0xd0f4('0x3e')]=_0x366af6[_0xd0f4('0x3e')];_0x3860e8[_0xd0f4('0x3f')]=_0x366af6[_0xd0f4('0x3f')];_0x3860e8[_0xd0f4('0x40')]=_0x366af6['outboundReCallsDay'];_0x3860e8[_0xd0f4('0x41')]=_0x366af6[_0xd0f4('0x41')];_0x3860e8[_0xd0f4('0x42')]=_0x366af6[_0xd0f4('0x42')];_0x3860e8['predictiveIntervalAnsweredCalls']=_0x366af6[_0xd0f4('0x43')];_0x3860e8[_0xd0f4('0x44')]=_0x366af6[_0xd0f4('0x44')];_0x3860e8[_0xd0f4('0x45')]=_0x366af6[_0xd0f4('0x45')];_0x3860e8[_0xd0f4('0x46')]=_0x366af6['predictiveIntervalDroppedCallsCallersExit'];_0x3860e8[_0xd0f4('0x47')]=_0x366af6[_0xd0f4('0x47')];_0x3860e8[_0xd0f4('0x48')]=_0x366af6['predictiveIntervalErlangCalls'];_0x3860e8[_0xd0f4('0x49')]=_0x366af6[_0xd0f4('0x49')];_0x3860e8['predictiveIntervalHitRate']=_0x366af6[_0xd0f4('0x4a')];_0x3860e8[_0xd0f4('0x4b')]=_0x366af6['predictiveIntervalMultiplicativeFactor'];_0x3860e8['predictiveIntervalPauses']=_0x366af6[_0xd0f4('0x4c')];_0x3860e8[_0xd0f4('0x4d')]=_0x366af6[_0xd0f4('0x4d')];_0x3860e8['predictiveIntervalTotalCalls']=_0x366af6[_0xd0f4('0x4e')];_0x3860e8['message']=_0x366af6[_0xd0f4('0x18')];_0x3860e8['originated']=_0x366af6[_0xd0f4('0x4f')];_0x3860e8[_0xd0f4('0x50')]=_0x366af6[_0xd0f4('0x50')];_0x3860e8[_0xd0f4('0x51')]=_0x366af6['erlangCallToSecond'];_0x3860e8[_0xd0f4('0x52')]=_0x366af6[_0xd0f4('0x52')];_0x3860e8[_0xd0f4('0x53')]=_0x366af6['erlangBusyFactor'];_0x3860e8['startPredictive']=_0x366af6[_0xd0f4('0x54')];_0x3860e8[_0xd0f4('0x55')]=_0x366af6[_0xd0f4('0x55')];}if(_0x366af6[_0xd0f4('0x56')]){_0x3860e8[_0xd0f4('0x56')]={'id':_0x366af6[_0xd0f4('0x56')]['id'],'name':_0x366af6[_0xd0f4('0x56')][_0xd0f4('0x8')],'active':_0x366af6[_0xd0f4('0x56')][_0xd0f4('0x57')],'callerid':_0x366af6[_0xd0f4('0x56')][_0xd0f4('0x58')]};}if(_0x366af6['Interval']){_0x3860e8[_0xd0f4('0x59')]={'id':_0x366af6[_0xd0f4('0x59')]['id'],'name':_0x366af6['Interval'][_0xd0f4('0x8')]};}_0x567eb4[_0xd0f4('0x5a')](_0x3860e8);}}_0xbdfcf1({'count':_0x567eb4[_0xd0f4('0x5b')],'rows':_0x567eb4});});},'UpdateVoiceQueue':function(_0x2d4df6){return new Promise(function(_0x209da0,_0x44c49d){var _0x286f92=_['find'](_0x2a0efc[_0xd0f4('0x21')],{'id':parseInt(_0x2d4df6['id'])});var _0x17ea48=_[_0xd0f4('0x5c')](_0x2d4df6,['id']);if(_0x286f92){for(var _0x4835de in _0x17ea48){if(typeof _0x17ea48[_0x4835de]!==_0xd0f4('0x5d')&&typeof _0x286f92[_0x4835de]!==_0xd0f4('0x5d')){_0x286f92[_0x4835de]=_0x17ea48[_0x4835de];}}_0x209da0(_0x286f92);}else{_0x44c49d();}});},'VoiceChannels':function(_0x1d7b59){return new Promise(function(_0x39594c,_0x1ff891){var _0x563759=_['values'](_0x2a0efc['channels']);_0x39594c({'count':_0x563759[_0xd0f4('0x5b')],'rows':_0x563759});});},'VoiceChannelMixMonitor':function(_0x16b676){var _0x401613=this;return new Promise(function(_0x2efc1d,_0x5da831){if(ami[_0xd0f4('0xf')]()==![]){return _0x5da831(_0x401613[_0xd0f4('0x1a')](0x1f4,[config['asterisk']['ip'],config[_0xd0f4('0x10')][_0xd0f4('0x11')],_0xd0f4('0x1b')][_0xd0f4('0x1c')]('\x20')));}var _0x431977=schema(properties[_0xd0f4('0x5e')])[_0xd0f4('0x0')](_0x16b676);if(_0x431977[_0xd0f4('0x5b')]>0x0){return _0x5da831(_0x401613[_0xd0f4('0x1a')](0x1f4,_[_0xd0f4('0x5f')](_0x431977,_0xd0f4('0x18'))[_0xd0f4('0x1c')](',\x20')));}var _0x3c7389=_['find'](_0x2a0efc[_0xd0f4('0x60')],{'uniqueid':_0x16b676[_0xd0f4('0x61')]});if(_0x3c7389&&_0x3c7389[_0xd0f4('0x62')]){var _0x52fb3d=util[_0xd0f4('0x6')](_0xd0f4('0x63'),_0x16b676[_0xd0f4('0x64')]||_0x16b676['uniqueid'],_0x16b676[_0xd0f4('0x6')]||'wav');return ami[_0xd0f4('0x16')]({'action':'MixMonitor','channel':_0x3c7389['channel'],'file':_0x52fb3d,'options':_0xd0f4('0x65')})[_0xd0f4('0x17')](function(_0xcf50d3){var _0x1f033d=_[_0xd0f4('0x66')](_0x3c7389[_0xd0f4('0x67')],{'filename':'/var/spool/asterisk/monitor/'+_0x52fb3d[_0xd0f4('0x68')]()});if(_[_0xd0f4('0x69')](_0x1f033d)){_0x3c7389[_0xd0f4('0x67')][_0xd0f4('0x5a')]({'filename':_0xd0f4('0x6a')+_0x52fb3d[_0xd0f4('0x68')](),'createdAt':moment()['format'](_0xd0f4('0x6b')),'mixmonitorid':_0xcf50d3['mixmonitorid'],'status':'rec'});}else{_0x1f033d[_0xd0f4('0x6c')]=_0xcf50d3[_0xd0f4('0x6c')];_0x1f033d[_0xd0f4('0x6d')]='rec';}_0x2efc1d({'code':0xc8,'message':[_0x16b676[_0xd0f4('0x61')],_0xd0f4('0x6e'),_0xcf50d3[_0xd0f4('0x6c')]][_0xd0f4('0x1c')]('\x20'),'mixmonitorid':_0xcf50d3[_0xd0f4('0x6c')]});})[_0xd0f4('0x19')](function(_0x1248a2){_0x5da831(_0x401613[_0xd0f4('0x1a')](0x1f5,[_0x16b676[_0xd0f4('0x61')],_0x1248a2[_0xd0f4('0x18')]['toLowerCase']()][_0xd0f4('0x1c')]('\x20')));});}else{return _0x5da831(_0x401613[_0xd0f4('0x1a')](0x1f5,_0xd0f4('0x6f')));}});},'VoiceChannelStopMixMonitor':function(_0x13180b){var _0x4c33e1=this;return new Promise(function(_0xb83d39,_0x14218f){if(ami[_0xd0f4('0xf')]()==![]){return _0x14218f(_0x4c33e1[_0xd0f4('0x1a')](0x1f4,[config[_0xd0f4('0x10')]['ip'],config[_0xd0f4('0x10')]['username'],'ami\x20disconnected'][_0xd0f4('0x1c')]('\x20')));}var _0x1fede8=schema(properties[_0xd0f4('0x5e')])[_0xd0f4('0x0')](_0x13180b);if(_0x1fede8[_0xd0f4('0x5b')]>0x0){return _0x14218f(_0x4c33e1[_0xd0f4('0x1a')](0x1f4,_['map'](_0x1fede8,_0xd0f4('0x18'))[_0xd0f4('0x1c')](',\x20')));}var _0x383d99=_['find'](_0x2a0efc[_0xd0f4('0x60')],{'uniqueid':_0x13180b[_0xd0f4('0x61')]});if(_0x383d99){return BPromise['resolve']()['then'](function(){if(_0x383d99[_0xd0f4('0x62')]){return ami['Action']({'action':_0xd0f4('0x70'),'channel':_0x383d99[_0xd0f4('0x62')],'mixmonitorid':_0x13180b['mixmonitorid']})[_0xd0f4('0x19')](function(_0x264ca6){});}})['then'](function(){if(_0x383d99[_0xd0f4('0x71')]){return ami[_0xd0f4('0x16')]({'action':_0xd0f4('0x70'),'channel':_0x383d99['destinationchannel'],'mixmonitorid':_0x13180b['mixmonitorid']})[_0xd0f4('0x19')](function(_0x31a1b7){});}})['then'](function(_0x351461){var _0x4202ae=_['find'](_0x383d99[_0xd0f4('0x67')],{'mixmonitorid':_0x13180b[_0xd0f4('0x6c')]});if(_0x4202ae){_0x4202ae[_0xd0f4('0x6d')]=_0xd0f4('0x72');}})[_0xd0f4('0x17')](function(){var _0x5dcf78=util[_0xd0f4('0x6')]('%s.%s',_0x13180b[_0xd0f4('0x64')]||_0x13180b[_0xd0f4('0x61')],_0x13180b[_0xd0f4('0x6')]||_0xd0f4('0x73'));var _0x2a45da=_['find'](_0x383d99['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x5dcf78[_0xd0f4('0x68')]()});if(_0x2a45da){_0x2a45da[_0xd0f4('0x6d')]=_0xd0f4('0x72');}})[_0xd0f4('0x17')](function(){_0xb83d39({'code':0xc8,'message':[_0x13180b[_0xd0f4('0x61')],_0xd0f4('0x74')][_0xd0f4('0x1c')]('\x20')});})[_0xd0f4('0x19')](function(_0x34d989){_0x14218f(_0x4c33e1[_0xd0f4('0x1a')](0x1f5,[_0x13180b[_0xd0f4('0x61')],_0x34d989[_0xd0f4('0x18')]['toLowerCase']()]['join']('\x20')));});}else{return _0x14218f(_0x4c33e1[_0xd0f4('0x1a')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0xecbf13){return new Promise(function(_0x57aa73,_0xa4a234){var _0x4ec015=_[_0xd0f4('0x75')](_0x2a0efc[_0xd0f4('0x76')]);_0x57aa73({'count':_0x4ec015[_0xd0f4('0x5b')],'rows':_0x4ec015});});},'VoiceQueuesChannel':function(_0x3344ea){var _0x4b9892=this;return new Promise(function(_0xca7aa7,_0x4a822a){var _0x1f751b=schema(properties[_0xd0f4('0x77')])[_0xd0f4('0x0')](_0x3344ea);if(_0x1f751b[_0xd0f4('0x5b')]>0x0){return _0x4a822a(_0x4b9892[_0xd0f4('0x1a')](0x1f4,_[_0xd0f4('0x5f')](_0x1f751b,_0xd0f4('0x18'))[_0xd0f4('0x1c')](',\x20')));}var _0x3698e7=_[_0xd0f4('0x66')](_0x2a0efc[_0xd0f4('0x76')],{'uniqueid':_0x3344ea[_0xd0f4('0x61')]});if(_0x3698e7){_0xca7aa7(_0x3698e7);}else{return _0x4a822a(_0x4b9892['error'](0x1f5,_0xd0f4('0x6f')));}});},'VoiceQueuesChannelHangup':function(_0x3d0f40){var _0x5eed6a=this;return new Promise(function(_0x5cd6c4,_0x4c4fa7){if(ami[_0xd0f4('0xf')]()==![]){return _0x4c4fa7(_0x5eed6a[_0xd0f4('0x1a')](0x1f4,[config[_0xd0f4('0x10')]['ip'],config['asterisk'][_0xd0f4('0x11')],_0xd0f4('0x1b')][_0xd0f4('0x1c')]('\x20')));}var _0x29838a=schema(properties[_0xd0f4('0x78')])['validate'](_0x3d0f40);if(_0x29838a[_0xd0f4('0x5b')]>0x0){return _0x4c4fa7(_0x5eed6a[_0xd0f4('0x1a')](0x1f4,_['map'](_0x29838a,_0xd0f4('0x18'))[_0xd0f4('0x1c')](',\x20')));}var _0x4871af=_['find'](_0x2a0efc['queueChannels'],{'uniqueid':_0x3d0f40[_0xd0f4('0x61')]});if(_0x4871af&&_0x4871af[_0xd0f4('0x62')]){return ami[_0xd0f4('0x16')]({'action':_0xd0f4('0x79'),'channel':_0x4871af[_0xd0f4('0x62')]})[_0xd0f4('0x17')](function(_0x1bc3e9){_0x5cd6c4({'code':0xc8,'message':[_0x3d0f40[_0xd0f4('0x61')],_0x1bc3e9[_0xd0f4('0x18')][_0xd0f4('0x68')]()][_0xd0f4('0x1c')]('\x20')});})[_0xd0f4('0x19')](function(_0x4a9707){_0x4c4fa7(_0x5eed6a[_0xd0f4('0x1a')](0x1f5,[_0x3d0f40[_0xd0f4('0x61')],_0x4a9707[_0xd0f4('0x18')][_0xd0f4('0x68')]()]['join']('\x20')));});}else{return _0x4c4fa7(_0x5eed6a[_0xd0f4('0x1a')](0x1f5,_0xd0f4('0x6f')));}});},'VoiceQueuesChannelRedirect':function(_0x1772eb){var _0x3ee9a2=this;return new Promise(function(_0x5cd6db,_0x5a43d4){if(ami[_0xd0f4('0xf')]()==![]){return _0x5a43d4(_0x3ee9a2['error'](0x1f4,[config[_0xd0f4('0x10')]['ip'],config[_0xd0f4('0x10')][_0xd0f4('0x11')],'ami\x20disconnected'][_0xd0f4('0x1c')]('\x20')));}var _0x1f67c9=schema(properties[_0xd0f4('0x7a')])[_0xd0f4('0x0')](_0x1772eb);if(_0x1f67c9[_0xd0f4('0x5b')]>0x0){return _0x5a43d4(_0x3ee9a2[_0xd0f4('0x1a')](0x1f4,_[_0xd0f4('0x5f')](_0x1f67c9,_0xd0f4('0x18'))[_0xd0f4('0x1c')](',\x20')));}var _0x2b6ab5=_[_0xd0f4('0x66')](_0x2a0efc[_0xd0f4('0x76')],{'uniqueid':_0x1772eb[_0xd0f4('0x61')]});if(_0x2b6ab5&&_0x2b6ab5[_0xd0f4('0x62')]){return ami[_0xd0f4('0x16')]({'action':_0xd0f4('0x7b'),'channel':_0x2b6ab5[_0xd0f4('0x62')],'exten':_0x1772eb[_0xd0f4('0x7c')],'context':_0x1772eb[_0xd0f4('0x7d')]||_0x2b6ab5[_0xd0f4('0x7d')],'priority':0x1})[_0xd0f4('0x17')](function(_0xd3d4c1){_0x5cd6db({'code':0xc8,'message':[_0x1772eb[_0xd0f4('0x61')],_0xd3d4c1[_0xd0f4('0x18')][_0xd0f4('0x68')]()][_0xd0f4('0x1c')]('\x20')});})[_0xd0f4('0x19')](function(_0x554fa0){_0x5a43d4(_0x3ee9a2['error'](0x1f5,[_0x1772eb['uniqueid'],_0x554fa0[_0xd0f4('0x18')]['toLowerCase']()][_0xd0f4('0x1c')]('\x20')));});}else{return _0x5a43d4(_0x3ee9a2['error'](0x1f5,_0xd0f4('0x6f')));}});},'Agents':function(_0x52e1bd){return new Promise(function(_0x4744a2,_0x306536){var _0x3047ea=_[_0xd0f4('0x75')](_0x2a0efc[_0xd0f4('0xb')]);_0x4744a2({'count':_0x3047ea[_0xd0f4('0x5b')],'rows':_0x3047ea});});},'Telephones':function(_0x448230){return new Promise(function(_0x5c739d,_0x4084be){var _0x46fc20=_[_0xd0f4('0x75')](_0x2a0efc[_0xd0f4('0x7e')]);_0x5c739d({'count':_0x46fc20[_0xd0f4('0x5b')],'rows':_0x46fc20});});},'Trunks':function(_0x33c184){return new Promise(function(_0x3b2806,_0x5387b9){var _0x3abb01=_['values'](_0x2a0efc['trunks']);_0x3b2806({'count':_0x3abb01[_0xd0f4('0x5b')],'rows':_0x3abb01});});},'OutboundChannels':function(_0x4a933d){return new Promise(function(_0x29bb5d,_0x3a1082){var _0x98daba=_[_0xd0f4('0x75')](_0x2a0efc[_0xd0f4('0x7f')]);_0x29bb5d({'count':_0x98daba[_0xd0f4('0x5b')],'rows':_0x98daba});});},'Outbound':function(_0x304e1b){return new Promise(function(_0x39d496,_0x36347d){_0x39d496(_0x2a0efc[_0xd0f4('0x80')]);});},'Campaigns':function(_0x2eba1e){return new Promise(function(_0x1f9fe0,_0xf07e9d){var _0x458517=_[_0xd0f4('0x75')](_0x2a0efc['campaigns']);_0x1f9fe0({'count':_0x458517['length'],'rows':_0x458517});});},'VoiceQueuesPreview':function(_0xaa8a15){var _0x96b70a=this;return new Promise(function(_0x4cfd35,_0x3420a7){_0x37c481[_0xd0f4('0x81')](_0xaa8a15['id'])[_0xd0f4('0x17')](function(_0x37ffcf){_0x4cfd35({'code':0xc8,'message':_0x37ffcf[_0xd0f4('0x18')]});})[_0xd0f4('0x19')](function(_0x3fd476){_0x3420a7(_0x96b70a[_0xd0f4('0x1a')](0x1f4,_0x3fd476[_0xd0f4('0x18')]));});});},'EventManager':function(_0x449571){var _0x3ebeb0=this;return new Promise(function(_0x23a765,_0x50b5cc){if(!_0x449571[_0xd0f4('0x82')]){return _0x50b5cc(_0x3ebeb0[_0xd0f4('0x1a')](0x1f4,_0xd0f4('0x83')));}ami[_0xd0f4('0x84')]('custom:'+_0x449571['event'],_0x449571[_0xd0f4('0x18')]);_0x23a765({'code':0xc8,'message':_0x449571});});},'FaxAccounts':function(_0x1c6fa2){return new Promise(function(_0x1e4a88,_0x3721a1){var _0x20a2ac=_['values'](_0x2a0efc[_0xd0f4('0x85')]);_0x1e4a88({'count':_0x20a2ac[_0xd0f4('0x5b')],'rows':_0x20a2ac});});},'SendFax':function(_0x2895c7){var _0x3935b8=this;return new Promise(function(_0x872301,_0x442976){_0x1d9a9d[_0xd0f4('0x86')](_0x2895c7)[_0xd0f4('0x17')](function(_0x5e3890){_0x872301({'code':0xc8,'message':_0x5e3890[_0xd0f4('0x18')]});})[_0xd0f4('0x19')](function(_0x38958d){_0x442976(_0x3935b8[_0xd0f4('0x1a')](0x1f4,_0x38958d[_0xd0f4('0x18')]));});});},'CheckAfterSend':function(_0x2e8887){var _0x3c4379=this;return new Promise(function(_0xa43103,_0x3607b1){_0x1d9a9d[_0xd0f4('0x87')](_0x2e8887)[_0xd0f4('0x17')](function(_0x3e0b37){_0xa43103({'code':0xc8,'message':_0x3e0b37[_0xd0f4('0x18')]});})[_0xd0f4('0x19')](function(_0x2a5142){_0x3607b1(_0x3c4379[_0xd0f4('0x1a')](0x1f4,_0x2a5142['message']));});});}};var _0x2d5b00=jayson[_0xd0f4('0x88')](_0x27acb8)[_0xd0f4('0x89')]();_0x2d5b00['on'](_0xd0f4('0x1a'),function(_0x2bb6ec){return _0x1164da(_0x2bb6ec);});_0x2d5b00[_0xd0f4('0x5')](0x232a,_0xd0f4('0x8a'),function(){console[_0xd0f4('0x8b')](_0xd0f4('0x8c'),0x232a);return _0x531f85(_0xd0f4('0x8d')+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 58b5695..fb1c090 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 _0x9c44=['','Unknown','destcalleridname','createContact','[CM][%s][%s]\x20Contact\x20created:%s','destcalleridnum','push','format','name','trigger:%s','action','merge','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','socket.io-emitter','info','[CM][%s][%s]','stringify','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','firstName','lastName','mobile','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','length','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','calleridnum','calleridname'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require(_0x49c4('0x0'));var util=require(_0x49c4('0x1'));var config=require(_0x49c4('0x2'));var logger=require(_0x49c4('0x3'))(_0x49c4('0x4'));var cmContactRpc=require(_0x49c4('0x5'));config['redis']=_['defaults'](config[_0x49c4('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0x7'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x69bc41,_0x2c4e2e,_0x436234,_0x511d53,_0x11c586){logger[_0x49c4('0x8')](_0x49c4('0x9'),_0x69bc41,_0x2c4e2e['id'],_0x436234,_0x511d53,JSON[_0x49c4('0xa')](_0x11c586));io['to'](_0x436234)['emit'](_0x511d53,_0x11c586);}exports['exec']=function(_0x451ea6,_0x313e73,_0x58cad7,_0xb611a1){var _0x459d09,_0x4adb3c;var _0x536d42={};var _0x1d19bf=Number(_0x58cad7[_0x49c4('0xb')]);var _0x5487cd=_0x58cad7[_0x49c4('0xc')]?Boolean(Number(_0x58cad7[_0x49c4('0xc')])):![];var _0x5f2fd9;var _0x1909fe=![];if(!_[_0x49c4('0xd')](_0x58cad7[_0x49c4('0xe')])){if(_0x58cad7[_0x49c4('0xe')]=='1')_0x1909fe=!![];}if(!_0x1909fe){if(_0xb611a1[_0x49c4('0xf')]){_0x536d42['id']=_0xb611a1[_0x49c4('0xf')];}}if(!_0x536d42['id']){_0x536d42[_0x49c4('0x10')]=_0x1d19bf;_0x5f2fd9=_0x58cad7[_0x49c4('0x11')]&&_0x58cad7['data3']!=='0'?_0x58cad7[_0x49c4('0x11')][_0x49c4('0x12')](','):[_0x49c4('0x13')];_0x536d42[_0x49c4('0x14')]=_[_0x49c4('0x15')](_0x5f2fd9,function(_0x53e3a2){var _0x44e607={};_0x44e607[_0x53e3a2]=_0xb611a1[_0x49c4('0x16')]?_0xb611a1['destcalleridnum']:_0xb611a1['calleridnum'];return _0x44e607;});}var _0x3c782d=['id',_0x49c4('0x17'),_0x49c4('0x18'),'phone',_0x49c4('0x19'),'fax',_0x49c4('0x10'),_0x49c4('0x1a'),_0x49c4('0x1b'),_0x49c4('0x1c')];var _0x382040=_[_0x49c4('0x1d')](_0x3c782d,_0x5f2fd9);BPromise[_0x49c4('0x1e')]()[_0x49c4('0x1f')](cmContactRpc[_0x49c4('0x20')]({'attributes':_0x382040,'where':_0x536d42}))['then'](function(_0x527126){_0x4adb3c=_0x527126;if(!_['isEmpty'](_0x4adb3c)){if(_0x4adb3c[_0x49c4('0x21')]===0x1){_0x459d09=_0x4adb3c[0x0];logger['info']('[CM][%s][%s]\x20Contact\x20found:%s',_0xb611a1[_0x49c4('0x22')],_0x313e73['id'],_0x459d09['id']);}else{logger[_0x49c4('0x8')](_0x49c4('0x23'),_0xb611a1[_0x49c4('0x22')],_0x313e73['id'],_['map'](_0x4adb3c,'id')['join'](','));}return;}else{logger[_0x49c4('0x8')](_0x49c4('0x24'),_0xb611a1['uniqueid'],_0x313e73['id']);var _0x207358={'ListId':_0x1d19bf};var _0x43e014=_0x58cad7[_0x49c4('0x25')]&&_0x58cad7[_0x49c4('0x25')]!=='0'?_0x58cad7['data4']:'phone';if(_0x5487cd){logger[_0x49c4('0x8')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0xb611a1[_0x49c4('0x22')],_0x313e73['id']);_0x207358[_0x43e014]=_[_0x49c4('0xd')](_0xb611a1[_0x49c4('0x16')])?_0xb611a1[_0x49c4('0x26')]:_0xb611a1['destcalleridnum'];if(_[_0x49c4('0xd')](_0xb611a1[_0x49c4('0x16')])){_0x207358[_0x49c4('0x17')]=_0xb611a1[_0x49c4('0x27')]&&_0xb611a1[_0x49c4('0x27')]!==_0x49c4('0x28')?_0xb611a1[_0x49c4('0x27')]:_0x49c4('0x29');}else{_0x207358[_0x49c4('0x17')]=_0xb611a1[_0x49c4('0x2a')]&&_0xb611a1[_0x49c4('0x2a')]!==''?_0xb611a1['destcalleridname']:'Unknown';}return BPromise[_0x49c4('0x1e')]()[_0x49c4('0x1f')](cmContactRpc[_0x49c4('0x2b')](_0x207358))[_0x49c4('0x1f')](function(_0x28eb47){_0x459d09=_0x28eb47;_0x4adb3c['push'](_0x28eb47);if(_0x459d09){logger[_0x49c4('0x8')](_0x49c4('0x2c'),_0xb611a1[_0x49c4('0x22')],_0x313e73['id'],_0x459d09['id']);}return;});}else{logger[_0x49c4('0x8')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0xb611a1['uniqueid'],_0x313e73['id']);_0x207358[_0x43e014]=_[_0x49c4('0xd')](_0xb611a1[_0x49c4('0x16')])?_0xb611a1[_0x49c4('0x26')]:_0xb611a1[_0x49c4('0x2d')];if(_[_0x49c4('0xd')](_0xb611a1['routeId'])){_0x207358[_0x49c4('0x17')]=_0xb611a1[_0x49c4('0x27')]&&_0xb611a1[_0x49c4('0x27')]!==''?_0xb611a1['calleridname']:_0x49c4('0x29');}else{_0x207358[_0x49c4('0x17')]=_0xb611a1[_0x49c4('0x2a')]&&_0xb611a1[_0x49c4('0x2a')]!==_0x49c4('0x28')?_0xb611a1[_0x49c4('0x2a')]:_0x49c4('0x29');}_0x459d09=_0x207358;_0x4adb3c[_0x49c4('0x2e')](_0x207358);return;}}})[_0x49c4('0x1f')](function(){if(_0x451ea6){emit(_0xb611a1['uniqueid'],_0x313e73,util[_0x49c4('0x2f')]('user:%s',_0x451ea6[_0x49c4('0x30')]),util[_0x49c4('0x2f')](_0x49c4('0x31'),_0x58cad7[_0x49c4('0x32')]['toLowerCase']()),{'evt':_[_0x49c4('0x33')](_0xb611a1,{'autoCreate':_0x5487cd}),'contact':_0x459d09===undefined?{}:_0x459d09,'contacts':_0x4adb3c[_0x49c4('0x21')]===0x0?undefined:_0x4adb3c});}});}; \ No newline at end of file +var _0xd0bb=['format','user:%s','name','trigger:%s','merge','lodash','bluebird','ioredis','../../../../config/environment','trigger','../../rpc/cmContact','defaults','localhost','socket.io-emitter','redis','info','[CM][%s][%s]','stringify','data1','data2','isNil','data5','xmd-contactid','data3','split','phone','$or','routeId','destcalleridnum','calleridnum','firstName','fax','ListId','createdAt','scheduledAt','union','resolve','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','calleridname','','destcalleridname','Unknown','then','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled'];(function(_0x4629ed,_0x59ef85){var _0x52ca04=function(_0x59dc63){while(--_0x59dc63){_0x4629ed['push'](_0x4629ed['shift']());}};_0x52ca04(++_0x59ef85);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0xd12233,_0x19c37e){_0xd12233=_0xd12233-0x0;var _0x89aefd=_0xd0bb[_0xd12233];return _0x89aefd;};'use strict';var _=require(_0xbd0b('0x0'));var BPromise=require(_0xbd0b('0x1'));var Redis=require(_0xbd0b('0x2'));var util=require('util');var config=require(_0xbd0b('0x3'));var logger=require('../../../../config/logger')(_0xbd0b('0x4'));var cmContactRpc=require(_0xbd0b('0x5'));config['redis']=_[_0xbd0b('0x6')](config['redis'],{'host':_0xbd0b('0x7'),'port':0x18eb});var io=require(_0xbd0b('0x8'))(new Redis(config[_0xbd0b('0x9')]));function emit(_0x37c205,_0x809599,_0x5eb975,_0x2a4075,_0x4533ff){logger[_0xbd0b('0xa')](_0xbd0b('0xb'),_0x37c205,_0x809599['id'],_0x5eb975,_0x2a4075,JSON[_0xbd0b('0xc')](_0x4533ff));io['to'](_0x5eb975)['emit'](_0x2a4075,_0x4533ff);}exports['exec']=function(_0x14bc5b,_0x110cf1,_0x4a69ff,_0x26b834){var _0x196beb,_0x526258;var _0x1e3173={};var _0x15919b=Number(_0x4a69ff[_0xbd0b('0xd')]);var _0x315ed9=_0x4a69ff[_0xbd0b('0xe')]?Boolean(Number(_0x4a69ff[_0xbd0b('0xe')])):![];var _0x420f96;var _0x1f25b6=![];if(!_[_0xbd0b('0xf')](_0x4a69ff[_0xbd0b('0x10')])){if(_0x4a69ff[_0xbd0b('0x10')]=='1')_0x1f25b6=!![];}if(!_0x1f25b6){if(_0x26b834['xmd-contactid']){_0x1e3173['id']=_0x26b834[_0xbd0b('0x11')];}}if(!_0x1e3173['id']){_0x1e3173['ListId']=_0x15919b;_0x420f96=_0x4a69ff['data3']&&_0x4a69ff[_0xbd0b('0x12')]!=='0'?_0x4a69ff[_0xbd0b('0x12')][_0xbd0b('0x13')](','):[_0xbd0b('0x14')];_0x1e3173[_0xbd0b('0x15')]=_['map'](_0x420f96,function(_0x55e0a1){var _0x2136ef={};_0x2136ef[_0x55e0a1]=_0x26b834[_0xbd0b('0x16')]?_0x26b834[_0xbd0b('0x17')]:_0x26b834[_0xbd0b('0x18')];return _0x2136ef;});}var _0x1c0a7c=['id',_0xbd0b('0x19'),'lastName',_0xbd0b('0x14'),'mobile',_0xbd0b('0x1a'),_0xbd0b('0x1b'),_0xbd0b('0x1c'),_0xbd0b('0x1d'),'updatedAt'];var _0x403c91=_[_0xbd0b('0x1e')](_0x1c0a7c,_0x420f96);BPromise[_0xbd0b('0x1f')]()['then'](cmContactRpc[_0xbd0b('0x20')]({'attributes':_0x403c91,'where':_0x1e3173}))['then'](function(_0xc66b8){_0x526258=_0xc66b8;if(!_[_0xbd0b('0x21')](_0x526258)){if(_0x526258[_0xbd0b('0x22')]===0x1){_0x196beb=_0x526258[0x0];logger[_0xbd0b('0xa')](_0xbd0b('0x23'),_0x26b834['uniqueid'],_0x110cf1['id'],_0x196beb['id']);}else{logger[_0xbd0b('0xa')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x26b834[_0xbd0b('0x24')],_0x110cf1['id'],_[_0xbd0b('0x25')](_0x526258,'id')[_0xbd0b('0x26')](','));}return;}else{logger[_0xbd0b('0xa')](_0xbd0b('0x27'),_0x26b834[_0xbd0b('0x24')],_0x110cf1['id']);var _0x4fe9ed={'ListId':_0x15919b};var _0x382f76=_0x4a69ff[_0xbd0b('0x28')]&&_0x4a69ff[_0xbd0b('0x28')]!=='0'?_0x4a69ff[_0xbd0b('0x28')]:_0xbd0b('0x14');if(_0x315ed9){logger[_0xbd0b('0xa')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x26b834[_0xbd0b('0x24')],_0x110cf1['id']);_0x4fe9ed[_0x382f76]=_[_0xbd0b('0xf')](_0x26b834[_0xbd0b('0x16')])?_0x26b834['calleridnum']:_0x26b834['destcalleridnum'];if(_[_0xbd0b('0xf')](_0x26b834[_0xbd0b('0x16')])){_0x4fe9ed[_0xbd0b('0x19')]=_0x26b834[_0xbd0b('0x29')]&&_0x26b834[_0xbd0b('0x29')]!==_0xbd0b('0x2a')?_0x26b834[_0xbd0b('0x29')]:'Unknown';}else{_0x4fe9ed[_0xbd0b('0x19')]=_0x26b834[_0xbd0b('0x2b')]&&_0x26b834['destcalleridname']!==''?_0x26b834[_0xbd0b('0x2b')]:_0xbd0b('0x2c');}return BPromise['resolve']()[_0xbd0b('0x2d')](cmContactRpc[_0xbd0b('0x2e')](_0x4fe9ed))[_0xbd0b('0x2d')](function(_0x417e25){_0x196beb=_0x417e25;_0x526258[_0xbd0b('0x2f')](_0x417e25);if(_0x196beb){logger[_0xbd0b('0xa')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x26b834[_0xbd0b('0x24')],_0x110cf1['id'],_0x196beb['id']);}return;});}else{logger[_0xbd0b('0xa')](_0xbd0b('0x30'),_0x26b834[_0xbd0b('0x24')],_0x110cf1['id']);_0x4fe9ed[_0x382f76]=_[_0xbd0b('0xf')](_0x26b834[_0xbd0b('0x16')])?_0x26b834[_0xbd0b('0x18')]:_0x26b834[_0xbd0b('0x17')];if(_[_0xbd0b('0xf')](_0x26b834[_0xbd0b('0x16')])){_0x4fe9ed[_0xbd0b('0x19')]=_0x26b834[_0xbd0b('0x29')]&&_0x26b834[_0xbd0b('0x29')]!==_0xbd0b('0x2a')?_0x26b834['calleridname']:_0xbd0b('0x2c');}else{_0x4fe9ed[_0xbd0b('0x19')]=_0x26b834['destcalleridname']&&_0x26b834[_0xbd0b('0x2b')]!==_0xbd0b('0x2a')?_0x26b834[_0xbd0b('0x2b')]:_0xbd0b('0x2c');}_0x196beb=_0x4fe9ed;_0x526258[_0xbd0b('0x2f')](_0x4fe9ed);return;}}})[_0xbd0b('0x2d')](function(){if(_0x14bc5b){emit(_0x26b834['uniqueid'],_0x110cf1,util[_0xbd0b('0x31')](_0xbd0b('0x32'),_0x14bc5b[_0xbd0b('0x33')]),util[_0xbd0b('0x31')](_0xbd0b('0x34'),_0x4a69ff['action']['toLowerCase']()),{'evt':_[_0xbd0b('0x35')](_0x26b834,{'autoCreate':_0x315ed9}),'contact':_0x196beb===undefined?{}:_0x196beb,'contacts':_0x526258[_0xbd0b('0x22')]===0x0?undefined:_0x526258});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index f937c19..589388b 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 _0x20dc=['user:%s','name','format','action','toLowerCase','trigger:%s','exec','integration','accounts','queue','routeId','script','parse','query','search','replace','every','checkConditions','channel','AnyConditions','some','account','chat','AccountId','operator','value','upperFirst','event','agent','lastevent','mailSubstatus','substatus','exports','util','url','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','defaults','redis','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','custom:agentcalled','syncCustomEvent','custom:agentconnect','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:outgoingmessage','custom:rejectmessage','prototype','stringify','clone','motionChannel','undefined','voice','checkTriggers','interface','status','checkTrigger','merge','Actions','length','contactmanager','browser','data1','TemplateId','html','data2','uri','buildUri','isNil','data3','data4','location','uriLocation','data5','800','windowHeight','600','data6','winApplication','render','winArguments','emit'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x20dc,0x115));var _0xc20d=function(_0x423c7e,_0x30107b){_0x423c7e=_0x423c7e-0x0;var _0x55a96d=_0x20dc[_0x423c7e];return _0x55a96d;};'use strict';var util=require(_0xc20d('0x0'));var _=require('lodash');var url=require(_0xc20d('0x1'));var Mustache=require(_0xc20d('0x2'));var Redis=require(_0xc20d('0x3'));var urlforward=require(_0xc20d('0x4'));var integration=require(_0xc20d('0x5'));var cmContact=require(_0xc20d('0x6'));var script=require(_0xc20d('0x7'));var config=require(_0xc20d('0x8'));var logger=require(_0xc20d('0x9'))(_0xc20d('0xa'));var ami=require(_0xc20d('0xb'));config['redis']=_[_0xc20d('0xc')](config[_0xc20d('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0xc20d('0xe'))(new Redis(config['redis']));var operators={'equals':function(_0x1f46e4,_0x4e4a58){return _0x1f46e4==_0x4e4a58;},'not_equals':function(_0x49e473,_0x3f82b4){return _0x49e473!=_0x3f82b4;}};var barAndWebActions=[_0xc20d('0xf'),_0xc20d('0x1'),_0xc20d('0x10')];function Trigger(_0x414e80){this[_0xc20d('0x11')]=_0x414e80[_0xc20d('0x11')];this[_0xc20d('0x12')]=_0x414e80[_0xc20d('0x12')];this[_0xc20d('0x13')]=_0x414e80[_0xc20d('0x13')];this[_0xc20d('0x14')]=_0x414e80['templates'];this[_0xc20d('0x15')]=_0x414e80[_0xc20d('0x15')];this['zendeskAccounts']=_0x414e80[_0xc20d('0x16')];this['freshdeskAccounts']=_0x414e80[_0xc20d('0x17')];this['salesforceAccounts']=_0x414e80[_0xc20d('0x18')];this[_0xc20d('0x19')]=_0x414e80[_0xc20d('0x19')];this[_0xc20d('0x1a')]=_0x414e80['zohoAccounts'];this[_0xc20d('0x1b')]=_0x414e80[_0xc20d('0x1b')];this[_0xc20d('0x1c')]=_0x414e80[_0xc20d('0x1c')];this[_0xc20d('0x1d')]=_0x414e80[_0xc20d('0x1d')];this[_0xc20d('0x1e')]=_0x414e80['dynamics365Accounts'];this[_0xc20d('0x1f')]=_0x414e80[_0xc20d('0x1f')];this['accounts']={'zendesk':this[_0xc20d('0x16')],'salesforce':this[_0xc20d('0x18')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0xc20d('0x19')],'zoho':this['zohoAccounts'],'desk':this[_0xc20d('0x1b')],'vtiger':this[_0xc20d('0x1c')],'dynamics365':this[_0xc20d('0x1e')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0xc20d('0x1d')]};ami['on'](_0xc20d('0x20'),this[_0xc20d('0x21')]['bind'](this));ami['on'](_0xc20d('0x22'),this[_0xc20d('0x21')][_0xc20d('0x23')](this));ami['on'](_0xc20d('0x24'),this['syncCustomEvent'][_0xc20d('0x23')](this));ami['on'](_0xc20d('0x25'),this['syncCustomEvent'][_0xc20d('0x23')](this));ami['on'](_0xc20d('0x26'),this[_0xc20d('0x21')][_0xc20d('0x23')](this));ami['on'](_0xc20d('0x27'),this[_0xc20d('0x21')][_0xc20d('0x23')](this));ami['on']('custom:agentbusy',this[_0xc20d('0x21')][_0xc20d('0x23')](this));ami['on'](_0xc20d('0x28'),this[_0xc20d('0x21')][_0xc20d('0x23')](this));ami['on'](_0xc20d('0x29'),this[_0xc20d('0x21')]['bind'](this));ami['on'](_0xc20d('0x2a'),this['syncCustomEvent'][_0xc20d('0x23')](this));ami['on'](_0xc20d('0x2b'),this['syncCustomEvent']['bind'](this));ami['on'](_0xc20d('0x2c'),this[_0xc20d('0x21')][_0xc20d('0x23')](this));ami['on'](_0xc20d('0x2d'),this[_0xc20d('0x2e')][_0xc20d('0x23')](this));ami['on'](_0xc20d('0x2f'),this[_0xc20d('0x2e')]['bind'](this));ami['on'](_0xc20d('0x30'),this[_0xc20d('0x2e')][_0xc20d('0x23')](this));ami['on'](_0xc20d('0x31'),this[_0xc20d('0x21')][_0xc20d('0x23')](this));ami['on'](_0xc20d('0x32'),this[_0xc20d('0x21')][_0xc20d('0x23')](this));ami['on'](_0xc20d('0x33'),this['syncCustomEvent'][_0xc20d('0x23')](this));ami['on']('custom:incomingmessage',this['syncCustomEvent'][_0xc20d('0x23')](this));ami['on'](_0xc20d('0x34'),this[_0xc20d('0x21')][_0xc20d('0x23')](this));ami['on']('custom:acceptmessage',this[_0xc20d('0x21')]['bind'](this));ami['on'](_0xc20d('0x35'),this[_0xc20d('0x21')][_0xc20d('0x23')](this));}Trigger[_0xc20d('0x36')]['emit']=function(_0xceba7,_0x54b90f,_0x4bb1fd){logger['info'](_0xceba7,_0x54b90f,JSON[_0xc20d('0x37')](_0x4bb1fd));io['to'](_0xceba7)['emit'](_0x54b90f,_0x4bb1fd);};Trigger[_0xc20d('0x36')][_0xc20d('0x21')]=function(_0x460e1f){var _0x5bcd03=_[_0xc20d('0x38')](_0x460e1f);if(typeof _0x5bcd03[_0xc20d('0x39')]===_0xc20d('0x3a')){_0x5bcd03['motionChannel']=_0xc20d('0x3b');}this[_0xc20d('0x3c')](_0x5bcd03);};Trigger[_0xc20d('0x36')][_0xc20d('0x2e')]=function(_0x39c737){if(this[_0xc20d('0x12')][_0x39c737[_0xc20d('0x3d')]]){this['syncCustomEvent'](_0x39c737);}};Trigger[_0xc20d('0x36')][_0xc20d('0x3c')]=function(_0xe2b6e8){var _0x41e332;for(var _0x132626 in this[_0xc20d('0x11')]){if(this[_0xc20d('0x11')]['hasOwnProperty'](_0x132626)){if(this[_0xc20d('0x11')][_0x132626][_0xc20d('0x3e')]){_0x41e332=this[_0xc20d('0x3f')](this[_0xc20d('0x11')][_0x132626],_0xe2b6e8);if(_0x41e332){_[_0xc20d('0x40')](_0xe2b6e8,_0xe2b6e8['variables']);for(var _0x2b11f7=0x0,_0x3fdfa6,_0x4b0855,_0x5b4951;_0x2b11f70x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ No newline at end of file +var _0x3e74=['customField','content','idField','custom_fields','variable','variableName','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Enduser\x20ID\x20is:','trigger:desk:display','trigger:browser:url','%s/agent/tickets/%s','stringify','unmanaged','monitor_format','lastevent','toUpperCase','calleridnum','lodash','md5','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','then','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','debug','[HTTP]','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','total_entries','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length','forEach','includes','string','picklist','type','nameField'];(function(_0x24649d,_0x59ee2a){var _0x40b3af=function(_0x422e73){while(--_0x422e73){_0x24649d['push'](_0x24649d['shift']());}};_0x40b3af(++_0x59ee2a);}(_0x3e74,0x175));var _0x43e7=function(_0x8d23d9,_0x5e8f4e){_0x8d23d9=_0x8d23d9-0x0;var _0x1cb2b3=_0x3e74[_0x8d23d9];return _0x1cb2b3;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var md5=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var Redis=require(_0x43e7('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x43e7('0x4'))('desk');config[_0x43e7('0x5')]=_[_0x43e7('0x6')](config[_0x43e7('0x5')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config['redis']));function emit(_0x45a0d1,_0x3491d6,_0x2ede2d){io['to'](_0x45a0d1)[_0x43e7('0x9')](_0x3491d6,_0x2ede2d);}var headers={'Content-Type':_0x43e7('0xa'),'Accept':'application/json'};function getUser(_0x212c6c,_0x554d44){if(intUtil['validateEmail'](_0x554d44)===!![]){logger[_0x43e7('0xb')](_0x43e7('0xc'),_0x554d44);return request({'uri':util['format'](_0x43e7('0xd'),_0x212c6c['remoteUri'])})[_0x43e7('0xe')](function(_0x37302c){if(_0x37302c['total_entries']){return _[_0x43e7('0xf')](_0x37302c[_0x43e7('0x10')][_0x43e7('0x11')],{'email':_0x554d44});}})[_0x43e7('0xe')](function(_0x4e008c){if(_0x4e008c){logger['info'](_0x43e7('0x12'));return _0x4e008c;}else{logger[_0x43e7('0xb')](_0x43e7('0x13'));return request({'uri':util['format']('%s/users/me',_0x212c6c[_0x43e7('0x14')])});}});}else{logger[_0x43e7('0xb')](_0x43e7('0x15'));return request({'uri':util[_0x43e7('0x16')]('%s/users/me',_0x212c6c['remoteUri'])});}}function request(_0xdf16c){logger[_0x43e7('0x17')](_0x43e7('0x18'),JSON['stringify'](_0xdf16c));return rp(_['defaults'](_0xdf16c,{'method':_0x43e7('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x1ca758){var _0x9037d3;if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1b')){_0x9037d3=util[_0x43e7('0x16')](_0x43e7('0x1c'),_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1e')]);}else if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1f')){_0x9037d3=util[_0x43e7('0x16')]('%s/token:%s',_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1f')]);}return util['format'](_0x43e7('0x20'),new Buffer(_0x9037d3)[_0x43e7('0x21')](_0x43e7('0x22')));}function getEndUser(_0x28aacc,_0x4077fb,_0x2f4cb4){logger['info'](_0x43e7('0x23'),_0x2f4cb4);return request({'uri':util['format']('%s/customers/search',_0x28aacc[_0x43e7('0x14')]),'qs':{'phone':_0x2f4cb4}})[_0x43e7('0xe')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x24')]){logger['info'](_0x43e7('0x25'));return _0x4b2b9f['_embedded'][_0x43e7('0x11')][0x0];}else{logger[_0x43e7('0xb')](_0x43e7('0x26'));return request({'uri':util[_0x43e7('0x16')]('%s/customers',_0x28aacc['remoteUri']),'method':_0x43e7('0x27'),'body':{'first_name':_0x4077fb,'title':_0x4077fb,'phone_numbers':[{'type':'work','value':_0x2f4cb4}]}});}});}function getTags(_0x2dd5f,_0x40dc8f){var _0x3565cf=[];if(_0x2dd5f&&_0x2dd5f[_0x43e7('0x28')]>0x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 0c33214..ef17331 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 _0x57d2=['recordingFormat','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','./util','md5','../../../../config/logger','dynamics365','../../../../config/environment','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','then','GET','value','email','userEmail','length','internalemailaddress',']\x20Agent\x20found\x20','systemuserid','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','message','outbound','calleridnum','/systemusers(','Bearer\x20','4.0','odata-entityid','substring','lastIndexOf','enduserId','toLowerCase','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','contactid',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','nameField','idField','indexOf','content','ticketType','incident','incidents','Subjects','getString','Descriptions','Fields','phonecall','phonecalls','assign','queue','callDirection','headers','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingURL'];(function(_0x2a2e4b,_0x3f9187){var _0x5bfc58=function(_0xd52eb7){while(--_0xd52eb7){_0x2a2e4b['push'](_0x2a2e4b['shift']());}};_0x5bfc58(++_0x3f9187);}(_0x57d2,0x185));var _0x257d=function(_0x365950,_0x5602ad){_0x365950=_0x365950-0x0;var _0x71c302=_0x57d2[_0x365950];return _0x71c302;};'use strict';var _=require(_0x257d('0x0'));var BPromise=require(_0x257d('0x1'));var rp=require(_0x257d('0x2'));var util=require(_0x257d('0x3'));var intUtil=require(_0x257d('0x4'));var md5=require(_0x257d('0x5'));var Redis=require('ioredis');var logger=require(_0x257d('0x6'))(_0x257d('0x7'));var config=require(_0x257d('0x8'));config['redis']=_[_0x257d('0x9')](config['redis'],{'host':_0x257d('0xa'),'port':0x18eb});var io=require(_0x257d('0xb'))(new Redis(config['redis']));function getAuthToken(_0x3e9637,_0xcab7e0,_0x1c5857){var _0x543427={'method':_0x257d('0xc'),'uri':_0xcab7e0,'form':{'client_id':_0x3e9637[_0x257d('0xd')],'resource':_0x3e9637[_0x257d('0xe')],'username':_0x3e9637[_0x257d('0xf')],'password':_0x3e9637[_0x257d('0x10')],'grant_type':_0x257d('0x10'),'client_secret':_0x3e9637[_0x257d('0x11')]},'json':!![]};return rp(_0x543427)['then'](function(_0x5d8851){return _0x5d8851[_0x257d('0x12')];})[_0x257d('0x13')](function(_0x4025c2){logger[_0x257d('0x14')]('['+[_0x1c5857[_0x257d('0x15')]()]+_0x257d('0x16'));return _0x4025c2['message'];});}function getUser(_0x31aba2,_0x589128,_0x3a3dfc,_0x520ceb,_0x1cec5a,_0x24dde0){return new BPromise(function(_0x433488,_0x4bf271){return getAuthToken(_0x589128,_0x520ceb,_0x24dde0)[_0x257d('0x17')](function(_0x117ba3){var _0x4aa477={'method':_0x257d('0x18'),'uri':_0x1cec5a+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':'Bearer\x20'+_0x117ba3,'OData-Version':'4.0'},'json':!![]};return rp(_0x4aa477);})[_0x257d('0x17')](function(_0x3745aa){var _0x378cff=_0x3745aa[_0x257d('0x19')];var _0x1a6f80=![];var _0x4c57e6=null;if(!_['isNil'](_0x3a3dfc)){if(intUtil['validateEmail'](_0x3a3dfc[_0x257d('0x1a')])){_0x31aba2[_0x257d('0x1b')]=_0x3a3dfc[_0x257d('0x1a')];for(_0x4c57e6=0x0;_0x4c57e6<_0x378cff[_0x257d('0x1c')];_0x4c57e6++){if(_0x378cff[_0x4c57e6][_0x257d('0x1d')]===_0x3a3dfc[_0x257d('0x1a')]&&!_0x378cff[_0x4c57e6]['isdisabled']){_0x1a6f80=!![];logger['info']('['+[_0x24dde0[_0x257d('0x15')]()]+_0x257d('0x1e')+_0x378cff[_0x4c57e6][_0x257d('0x1f')]+'!');_0x31aba2['userId']=_0x378cff[_0x4c57e6][_0x257d('0x1f')];}}}}if(!_0x1a6f80){logger[_0x257d('0x20')]('['+[_0x24dde0[_0x257d('0x15')]()]+_0x257d('0x21'));_0x31aba2[_0x257d('0x1b')]=_0x589128['username'];for(_0x4c57e6=0x0;_0x4c57e6<_0x378cff[_0x257d('0x1c')];_0x4c57e6++){if(_0x378cff[_0x4c57e6][_0x257d('0x1d')]===_0x589128[_0x257d('0xf')]){_0x31aba2[_0x257d('0x22')]=_0x378cff[_0x4c57e6][_0x257d('0x1f')];}}}_0x433488(_0x31aba2);})[_0x257d('0x13')](function(_0x1214b7){_0x4bf271(_0x1214b7[_0x257d('0x23')]);});});}function createEndUser(_0x17664e,_0x25226c,_0x52047f,_0x43efb1,_0x28edab,_0x5efba1){return new BPromise(function(_0x34131b,_0x3f41b8){return getAuthToken(_0x25226c,_0x52047f,_0x5efba1)[_0x257d('0x17')](function(_0x59f10b){var _0x42e303=_0x5efba1['toLowerCase']()===_0x257d('0x24')?_0x28edab['destcalleridnum']:_0x28edab[_0x257d('0x25')];var _0x5248d1={'method':_0x257d('0xc'),'uri':_0x43efb1+'contacts','body':{'telephone1':_0x42e303,'fullname':_0x42e303,'firstname':_0x42e303,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x257d('0x26')+_0x17664e['userId']+')'},'headers':{'Authorization':_0x257d('0x27')+_0x59f10b,'OData-Version':_0x257d('0x28')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x5248d1);})[_0x257d('0x17')](function(_0x3fb2ef){var _0x50d0b8=_0x3fb2ef['headers'][_0x257d('0x29')];var _0x4908a7=_0x50d0b8[_0x257d('0x2a')](_0x50d0b8[_0x257d('0x2b')]('(')+0x1,_0x50d0b8['lastIndexOf'](')'));_0x17664e[_0x257d('0x2c')]=_0x4908a7;_0x34131b(_0x17664e);})[_0x257d('0x13')](function(_0x23780f){_0x3f41b8(_0x23780f['message']);});});}function getEndUser(_0x4245f2,_0x19b56a,_0x2a8339,_0x19db38,_0x245cc0,_0x29626d){return new BPromise(function(_0x3413b8,_0x46e194){var _0x709110=_0x29626d[_0x257d('0x2d')]()==='outbound'?_0x245cc0['destcalleridnum']:_0x245cc0[_0x257d('0x25')];return getAuthToken(_0x19b56a,_0x2a8339,_0x29626d)[_0x257d('0x17')](function(_0x4161c7){var _0x333b43={'method':'GET','uri':_0x19db38+_0x257d('0x2e')+_0x709110[_0x257d('0x2f')]('+','%2b')+'\x27','headers':{'Authorization':_0x257d('0x27')+_0x4161c7,'If-None-Match':null,'OData-Version':_0x257d('0x28')},'json':!![]};return rp(_0x333b43);})[_0x257d('0x17')](function(_0x3e70c3){var _0x52d23=null;if(_0x3e70c3){var _0x360f19=_0x3e70c3[_0x257d('0x19')];var _0x4ecc9d=![];for(_0x52d23=0x0;_0x52d23<_0x360f19[_0x257d('0x1c')];_0x52d23++){if(_0x360f19[_0x52d23]['telephone1']===_0x709110){_0x4ecc9d=!![];_0x4245f2[_0x257d('0x2c')]=_0x360f19[_0x52d23][_0x257d('0x30')];}}if(_0x4ecc9d){_0x3413b8(_0x4245f2);}else{return createEndUser(_0x4245f2,_0x19b56a,_0x2a8339,_0x19db38,_0x245cc0,_0x29626d)[_0x257d('0x17')](function(_0x180775){logger['info']('['+[_0x29626d[_0x257d('0x15')]()]+_0x257d('0x31'),_0x180775[_0x257d('0x2c')]);_0x3413b8(_0x180775);});}}else{return createEndUser(_0x4245f2,_0x19b56a,_0x2a8339,_0x19db38,_0x245cc0,_0x29626d)['then'](function(_0x48042c){logger[_0x257d('0x20')]('['+[_0x29626d[_0x257d('0x15')]()]+']\x20Enduser\x20Created!',_0x48042c[_0x257d('0x2c')]);_0x3413b8(_0x48042c);});}});});}function getCustomFields(_0x164ee4,_0x56c668,_0x5dc4f1){var _0x263edd={};if(_0x164ee4['length']>0x0){_[_0x257d('0x32')](_0x164ee4,function(_0xd51230){if(_[_0x257d('0x33')]([_0x257d('0x34'),_0x257d('0x35')],_0xd51230[_0x257d('0x36')])&&_0xd51230[_0x257d('0x37')]&&!_0xd51230['customField']){var _0x47281b=_0xd51230[_0x257d('0x38')]['toLowerCase']();var _0x1a9ce3=_0x47281b[_0x257d('0x2a')](0x0,_0x47281b[_0x257d('0x39')]('_'));var _0x7bac73=_0x47281b['substring'](_0x47281b['indexOf']('_')+0x1);if(_0x1a9ce3===_0x5dc4f1){_0x263edd[_0x7bac73]=_0xd51230[_0x257d('0x3a')];}}});}return _0x263edd;}function getTicket(_0x2d38fc,_0x20d3df,_0x2c6476,_0x4f7dae,_0x5bc27a,_0x3e4be2,_0x56260d){return new BPromise(function(_0xed5628,_0x52b235){var _0x3ecfb2;return getAuthToken(_0x20d3df,_0x2c6476,_0x56260d)[_0x257d('0x17')](function(_0x5f3431){if(_0x3e4be2[_0x257d('0x3b')]===_0x257d('0x3c')){_0x3ecfb2={'method':_0x257d('0xc'),'uri':_0x4f7dae+_0x257d('0x3d'),'body':Object['assign']({},{'title':intUtil['getString'](_0x3e4be2[_0x257d('0x3e')],_0x5bc27a,'\x20'),'description':intUtil[_0x257d('0x3f')](_0x3e4be2[_0x257d('0x40')],_0x5bc27a,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x2d38fc[_0x257d('0x2c')]+')','ownerid@odata.bind':'/systemusers('+_0x2d38fc[_0x257d('0x22')]+')','caseorigincode':'1'},getCustomFields(_0x3e4be2[_0x257d('0x41')],_0x5bc27a,_0x3e4be2[_0x257d('0x3b')])),'headers':{'Authorization':_0x257d('0x27')+_0x5f3431,'OData-Version':_0x257d('0x28')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3e4be2['ticketType']===_0x257d('0x42')){_0x3ecfb2={'method':'POST','uri':_0x4f7dae+_0x257d('0x43'),'body':Object[_0x257d('0x44')]({},{'subject':intUtil[_0x257d('0x3f')](_0x3e4be2[_0x257d('0x3e')],_0x5bc27a,'\x20'),'phonenumber':String(_0x5bc27a[_0x257d('0x25')]),'description':intUtil[_0x257d('0x3f')](_0x3e4be2['Descriptions'],_0x5bc27a,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x2d38fc[_0x257d('0x2c')]+')','ownerid@odata.bind':_0x257d('0x26')+_0x2d38fc[_0x257d('0x22')]+')','directioncode':_0x2d38fc['callDirection']===_0x257d('0x45')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x257d('0x26')+_0x2d38fc[_0x257d('0x22')]+')','participationtypemask':_0x2d38fc[_0x257d('0x46')]===_0x257d('0x45')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x2d38fc[_0x257d('0x2c')]+')','participationtypemask':_0x2d38fc[_0x257d('0x46')]===_0x257d('0x45')?0x1:0x2}]},getCustomFields(_0x3e4be2['Fields'],_0x5bc27a,_0x3e4be2[_0x257d('0x3b')])),'headers':{'Authorization':_0x257d('0x27')+_0x5f3431,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3ecfb2);})[_0x257d('0x17')](function(_0x218e1f){var _0x1dedda=_0x218e1f[_0x257d('0x47')][_0x257d('0x29')];var _0x1038e1=_0x1dedda[_0x257d('0x2a')](_0x1dedda[_0x257d('0x2b')]('(')+0x1,_0x1dedda[_0x257d('0x2b')](')'));_0x2d38fc[_0x257d('0x48')]=_0x1038e1;_0xed5628(_0x2d38fc);})[_0x257d('0x13')](function(_0xe0171e){_0x52b235(_0xe0171e[_0x257d('0x23')]);});});}function emit(_0xdf88b9,_0x1ee68d,_0x3b0246,_0x490fd5){var _0x106d1f={'uri':util[_0x257d('0x49')](_0x257d('0x4a'),_0xdf88b9,_0x3b0246,_0x490fd5)};io['to'](util[_0x257d('0x49')](_0x257d('0x4b'),_0x1ee68d))[_0x257d('0x4c')](_0x257d('0x4d'),_0x106d1f);}exports['cs']=function(_0x4edce4,_0x37b10f,_0x50f09c,_0x9b9a19,_0x90fd98,_0x5a3a70,_0x431657,_0x324072){var _0x9d45b9={};_0x5a3a70[_0x257d('0xe')]=intUtil[_0x257d('0x4e')](_0x5a3a70[_0x257d('0xe')]);_0x5a3a70[_0x257d('0x4f')]=intUtil[_0x257d('0x4e')](_0x5a3a70[_0x257d('0x4f')]);_0x9d45b9[_0x257d('0x46')]=_0x324072==='queue'||_0x324072==='unmanaged'?_0x257d('0x45'):_0x257d('0x24');var _0x4522b4=util[_0x257d('0x49')](_0x257d('0x50'),_0x5a3a70[_0x257d('0xe')]);var _0x2b4316=util['format']('https://login.microsoftonline.com/%s/oauth2/token',_0x5a3a70[_0x257d('0x51')]);var _0x14322f=util[_0x257d('0x49')](_0x257d('0x52'),_0x5a3a70['serverUrl'],_0x37b10f['uniqueid'],md5(_0x37b10f[_0x257d('0x53')]));if(_0x90fd98&&_0x90fd98[_0x257d('0x54')]){logger[_0x257d('0x20')]('[QUEUE]','Recording\x20is\x20enabled!');_0x37b10f[_0x257d('0x55')]=_0x14322f;}else if(_0x431657&&_0x431657[_0x257d('0x56')]&&_0x431657['recordingFormat']!=='none'){logger[_0x257d('0x20')]('[OUTBOUND]',_0x257d('0x57'));_0x37b10f[_0x257d('0x55')]=_0x14322f;}else{_0x37b10f[_0x257d('0x55')]='';}return getUser(_0x9d45b9,_0x5a3a70,_0x9b9a19,_0x2b4316,_0x4522b4,_0x324072)['then'](function(_0x3d1f38){logger[_0x257d('0x20')]('['+_0x324072[_0x257d('0x15')]()+_0x257d('0x58'),_0x3d1f38[_0x257d('0x22')]);logger['info']('['+_0x324072[_0x257d('0x15')]()+']\x20The\x20User\x20email\x20is:',_0x3d1f38[_0x257d('0x1b')]);return getEndUser(_0x3d1f38,_0x5a3a70,_0x2b4316,_0x4522b4,_0x37b10f,_0x324072);})[_0x257d('0x17')](function(_0x44fab4){logger[_0x257d('0x20')]('['+_0x324072[_0x257d('0x15')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x44fab4[_0x257d('0x2c')]);logger[_0x257d('0x20')]('['+_0x324072[_0x257d('0x15')]()+_0x257d('0x59'),_0x37b10f[_0x257d('0x25')]);return getTicket(_0x44fab4,_0x5a3a70,_0x2b4316,_0x4522b4,_0x37b10f,_0x50f09c,_0x324072);})[_0x257d('0x17')](function(_0xe821ab){logger[_0x257d('0x20')](util[_0x257d('0x49')]('['+_0x324072[_0x257d('0x15')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x50f09c[_0x257d('0x3b')],_0xe821ab[_0x257d('0x48')]));logger[_0x257d('0x20')](util[_0x257d('0x49')]('['+_0x324072[_0x257d('0x15')]()+_0x257d('0x5a'),_0x324072));if(_0x324072!==_0x257d('0x5b')){logger['info']('['+_0x324072[_0x257d('0x15')]()+']',_0x257d('0x5c'));emit(_0x5a3a70[_0x257d('0xe')],_0x9b9a19['name'],_0x50f09c[_0x257d('0x3b')],_0xe821ab[_0x257d('0x48')]);}})['catch'](function(_0x1e1f7a){logger[_0x257d('0x14')]('['+_0x324072[_0x257d('0x15')]()+_0x257d('0x5d'),util[_0x257d('0x5e')](_0x1e1f7a,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x61c6=['toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','replace','%2b','Bearer\x20','value','telephone1','enduserId','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','type','customField','idField','indexOf','content','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','ticketType','phonecall','callDirection','queue','lastIndexOf','ticketId','format','user:%s','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','error','inspect','lodash','bluebird','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','then','access_token','catch',']\x20Wrong\x20credentials!','GET','4.0','isNil','validateEmail','email','userEmail','length','internalemailaddress','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','message'];(function(_0x545e86,_0x46a2ed){var _0xa98055=function(_0x41aa23){while(--_0x41aa23){_0x545e86['push'](_0x545e86['shift']());}};_0xa98055(++_0x46a2ed);}(_0x61c6,0x9b));var _0x661c=function(_0x34dbaa,_0xc4c565){_0x34dbaa=_0x34dbaa-0x0;var _0x2ea643=_0x61c6[_0x34dbaa];return _0x2ea643;};'use strict';var _=require(_0x661c('0x0'));var BPromise=require(_0x661c('0x1'));var rp=require('request-promise');var util=require('util');var intUtil=require(_0x661c('0x2'));var md5=require(_0x661c('0x3'));var Redis=require(_0x661c('0x4'));var logger=require(_0x661c('0x5'))(_0x661c('0x6'));var config=require(_0x661c('0x7'));config[_0x661c('0x8')]=_['defaults'](config[_0x661c('0x8')],{'host':_0x661c('0x9'),'port':0x18eb});var io=require(_0x661c('0xa'))(new Redis(config['redis']));function getAuthToken(_0x3ab338,_0x29031d,_0x2cdc3a){var _0x4f7f75={'method':_0x661c('0xb'),'uri':_0x29031d,'form':{'client_id':_0x3ab338[_0x661c('0xc')],'resource':_0x3ab338[_0x661c('0xd')],'username':_0x3ab338[_0x661c('0xe')],'password':_0x3ab338['password'],'grant_type':_0x661c('0xf'),'client_secret':_0x3ab338['clientSecret']},'json':!![]};return rp(_0x4f7f75)[_0x661c('0x10')](function(_0xa30997){return _0xa30997[_0x661c('0x11')];})[_0x661c('0x12')](function(_0x5f50eb){logger['error']('['+[_0x2cdc3a['toUpperCase']()]+_0x661c('0x13'));return _0x5f50eb['message'];});}function getUser(_0x2abf31,_0x4d0582,_0x2f1aa8,_0x546ad6,_0x7641eb,_0xd92464){return new BPromise(function(_0x3977f2,_0x1175fc){return getAuthToken(_0x4d0582,_0x546ad6,_0xd92464)[_0x661c('0x10')](function(_0x280413){var _0x376a77={'method':_0x661c('0x14'),'uri':_0x7641eb+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':'Bearer\x20'+_0x280413,'OData-Version':_0x661c('0x15')},'json':!![]};return rp(_0x376a77);})[_0x661c('0x10')](function(_0x1278bd){var _0x30434a=_0x1278bd['value'];var _0x8f7a2e=![];var _0x2ac455=null;if(!_[_0x661c('0x16')](_0x2f1aa8)){if(intUtil[_0x661c('0x17')](_0x2f1aa8[_0x661c('0x18')])){_0x2abf31[_0x661c('0x19')]=_0x2f1aa8['email'];for(_0x2ac455=0x0;_0x2ac455<_0x30434a[_0x661c('0x1a')];_0x2ac455++){if(_0x30434a[_0x2ac455][_0x661c('0x1b')]===_0x2f1aa8[_0x661c('0x18')]&&!_0x30434a[_0x2ac455]['isdisabled']){_0x8f7a2e=!![];logger[_0x661c('0x1c')]('['+[_0xd92464[_0x661c('0x1d')]()]+_0x661c('0x1e')+_0x30434a[_0x2ac455][_0x661c('0x1f')]+'!');_0x2abf31[_0x661c('0x20')]=_0x30434a[_0x2ac455]['systemuserid'];}}}}if(!_0x8f7a2e){logger[_0x661c('0x1c')]('['+[_0xd92464[_0x661c('0x1d')]()]+_0x661c('0x21'));_0x2abf31['userEmail']=_0x4d0582[_0x661c('0xe')];for(_0x2ac455=0x0;_0x2ac455<_0x30434a[_0x661c('0x1a')];_0x2ac455++){if(_0x30434a[_0x2ac455][_0x661c('0x1b')]===_0x4d0582[_0x661c('0xe')]){_0x2abf31['userId']=_0x30434a[_0x2ac455]['systemuserid'];}}}_0x3977f2(_0x2abf31);})[_0x661c('0x12')](function(_0x3dd49c){_0x1175fc(_0x3dd49c[_0x661c('0x22')]);});});}function createEndUser(_0x13ce28,_0x2fc875,_0x3fdf6e,_0x18bfe2,_0x38e244,_0x5810d0){return new BPromise(function(_0x1d438a,_0x175319){return getAuthToken(_0x2fc875,_0x3fdf6e,_0x5810d0)[_0x661c('0x10')](function(_0x399617){var _0xf359b7=_0x5810d0[_0x661c('0x23')]()===_0x661c('0x24')?_0x38e244[_0x661c('0x25')]:_0x38e244[_0x661c('0x26')];var _0xc5a31b={'method':_0x661c('0xb'),'uri':_0x18bfe2+_0x661c('0x27'),'body':{'telephone1':_0xf359b7,'fullname':_0xf359b7,'firstname':_0xf359b7,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x661c('0x28')+_0x13ce28['userId']+')'},'headers':{'Authorization':'Bearer\x20'+_0x399617,'OData-Version':_0x661c('0x15')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0xc5a31b);})[_0x661c('0x10')](function(_0x47bff2){var _0x3cc5a9=_0x47bff2[_0x661c('0x29')][_0x661c('0x2a')];var _0x51aa75=_0x3cc5a9[_0x661c('0x2b')](_0x3cc5a9['lastIndexOf']('(')+0x1,_0x3cc5a9['lastIndexOf'](')'));_0x13ce28['enduserId']=_0x51aa75;_0x1d438a(_0x13ce28);})[_0x661c('0x12')](function(_0x41115a){_0x175319(_0x41115a['message']);});});}function getEndUser(_0x51aea4,_0x1f9a10,_0x2aa248,_0x3ac0be,_0xaa5006,_0x181e88){return new BPromise(function(_0x11e769,_0x31d48b){var _0x44591c=_0x181e88[_0x661c('0x23')]()===_0x661c('0x24')?_0xaa5006[_0x661c('0x25')]:_0xaa5006['calleridnum'];return getAuthToken(_0x1f9a10,_0x2aa248,_0x181e88)[_0x661c('0x10')](function(_0x119de7){var _0x4d398={'method':_0x661c('0x14'),'uri':_0x3ac0be+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x44591c[_0x661c('0x2c')]('+',_0x661c('0x2d'))+'\x27','headers':{'Authorization':_0x661c('0x2e')+_0x119de7,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4d398);})[_0x661c('0x10')](function(_0xe0ea26){var _0x4c325b=null;if(_0xe0ea26){var _0x4fab8c=_0xe0ea26[_0x661c('0x2f')];var _0x946165=![];for(_0x4c325b=0x0;_0x4c325b<_0x4fab8c[_0x661c('0x1a')];_0x4c325b++){if(_0x4fab8c[_0x4c325b][_0x661c('0x30')]===_0x44591c){_0x946165=!![];_0x51aea4[_0x661c('0x31')]=_0x4fab8c[_0x4c325b][_0x661c('0x32')];}}if(_0x946165){_0x11e769(_0x51aea4);}else{return createEndUser(_0x51aea4,_0x1f9a10,_0x2aa248,_0x3ac0be,_0xaa5006,_0x181e88)[_0x661c('0x10')](function(_0x13d085){logger[_0x661c('0x1c')]('['+[_0x181e88['toUpperCase']()]+_0x661c('0x33'),_0x13d085['enduserId']);_0x11e769(_0x13d085);});}}else{return createEndUser(_0x51aea4,_0x1f9a10,_0x2aa248,_0x3ac0be,_0xaa5006,_0x181e88)['then'](function(_0x527dbd){logger['info']('['+[_0x181e88[_0x661c('0x1d')]()]+_0x661c('0x34'),_0x527dbd['enduserId']);_0x11e769(_0x527dbd);});}});});}function getCustomFields(_0x5863de,_0x3acd9b,_0x50c5c6){var _0xa91b2e={};if(_0x5863de[_0x661c('0x1a')]>0x0){_[_0x661c('0x35')](_0x5863de,function(_0x293d59){if(_[_0x661c('0x36')]([_0x661c('0x37'),'picklist'],_0x293d59[_0x661c('0x38')])&&_0x293d59['nameField']&&!_0x293d59[_0x661c('0x39')]){var _0x2ba20a=_0x293d59[_0x661c('0x3a')][_0x661c('0x23')]();var _0x3bbf6e=_0x2ba20a[_0x661c('0x2b')](0x0,_0x2ba20a[_0x661c('0x3b')]('_'));var _0x66cc6f=_0x2ba20a[_0x661c('0x2b')](_0x2ba20a['indexOf']('_')+0x1);if(_0x3bbf6e===_0x50c5c6){_0xa91b2e[_0x66cc6f]=_0x293d59[_0x661c('0x3c')];}}});}return _0xa91b2e;}function getTicket(_0x14916d,_0x64e278,_0x2dc7e8,_0x42f2c7,_0x12e227,_0x345144,_0xe59cb0){return new BPromise(function(_0x1bb97b,_0x5c5df8){var _0x47985a;return getAuthToken(_0x64e278,_0x2dc7e8,_0xe59cb0)[_0x661c('0x10')](function(_0x37a68e){if(_0x345144['ticketType']==='incident'){_0x47985a={'method':_0x661c('0xb'),'uri':_0x42f2c7+_0x661c('0x3d'),'body':Object[_0x661c('0x3e')]({},{'title':intUtil[_0x661c('0x3f')](_0x345144[_0x661c('0x40')],_0x12e227,'\x20'),'description':intUtil['getString'](_0x345144[_0x661c('0x41')],_0x12e227,'\x0a'),'customerid_contact@odata.bind':_0x661c('0x42')+_0x14916d[_0x661c('0x31')]+')','ownerid@odata.bind':'/systemusers('+_0x14916d[_0x661c('0x20')]+')','caseorigincode':'1'},getCustomFields(_0x345144[_0x661c('0x43')],_0x12e227,_0x345144[_0x661c('0x44')])),'headers':{'Authorization':_0x661c('0x2e')+_0x37a68e,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x345144[_0x661c('0x44')]===_0x661c('0x45')){_0x47985a={'method':'POST','uri':_0x42f2c7+'phonecalls','body':Object['assign']({},{'subject':intUtil[_0x661c('0x3f')](_0x345144[_0x661c('0x40')],_0x12e227,'\x20'),'phonenumber':String(_0x12e227[_0x661c('0x26')]),'description':intUtil['getString'](_0x345144[_0x661c('0x41')],_0x12e227,'\x0a'),'regardingobjectid_contact@odata.bind':_0x661c('0x42')+_0x14916d[_0x661c('0x31')]+')','ownerid@odata.bind':_0x661c('0x28')+_0x14916d[_0x661c('0x20')]+')','directioncode':_0x14916d[_0x661c('0x46')]===_0x661c('0x47')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x14916d['userId']+')','participationtypemask':_0x14916d[_0x661c('0x46')]===_0x661c('0x47')?0x2:0x1},{'partyid_contact@odata.bind':_0x661c('0x42')+_0x14916d[_0x661c('0x31')]+')','participationtypemask':_0x14916d['callDirection']==='queue'?0x1:0x2}]},getCustomFields(_0x345144[_0x661c('0x43')],_0x12e227,_0x345144['ticketType'])),'headers':{'Authorization':_0x661c('0x2e')+_0x37a68e,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x47985a);})[_0x661c('0x10')](function(_0x37171e){var _0x441528=_0x37171e[_0x661c('0x29')][_0x661c('0x2a')];var _0x31b4f3=_0x441528['substring'](_0x441528[_0x661c('0x48')]('(')+0x1,_0x441528[_0x661c('0x48')](')'));_0x14916d[_0x661c('0x49')]=_0x31b4f3;_0x1bb97b(_0x14916d);})['catch'](function(_0x1a295d){_0x5c5df8(_0x1a295d[_0x661c('0x22')]);});});}function emit(_0x292832,_0x2c39cf,_0x475605,_0x49829c){var _0x402986={'uri':util[_0x661c('0x4a')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x292832,_0x475605,_0x49829c)};io['to'](util[_0x661c('0x4a')](_0x661c('0x4b'),_0x2c39cf))['emit']('trigger:browser:url',_0x402986);}exports['cs']=function(_0x567495,_0x55a95e,_0x5aad81,_0x44914f,_0x44f447,_0x261933,_0x155cfa,_0x2db258){var _0x46c73c={};_0x261933[_0x661c('0xd')]=intUtil[_0x661c('0x4c')](_0x261933[_0x661c('0xd')]);_0x261933['serverUrl']=intUtil[_0x661c('0x4c')](_0x261933[_0x661c('0x4d')]);_0x46c73c[_0x661c('0x46')]=_0x2db258===_0x661c('0x47')||_0x2db258===_0x661c('0x4e')?'queue':_0x661c('0x24');var _0x5d3ccd=util[_0x661c('0x4a')](_0x661c('0x4f'),_0x261933[_0x661c('0xd')]);var _0x3e95a0=util['format'](_0x661c('0x50'),_0x261933['tenantId']);var _0x210694=util[_0x661c('0x4a')](_0x661c('0x51'),_0x261933['serverUrl'],_0x55a95e[_0x661c('0x52')],md5(_0x55a95e['uniqueid']));if(_0x44f447&&_0x44f447[_0x661c('0x53')]){logger[_0x661c('0x1c')](_0x661c('0x54'),_0x661c('0x55'));_0x55a95e['recordingURL']=_0x210694;}else if(_0x155cfa&&_0x155cfa[_0x661c('0x56')]&&_0x155cfa[_0x661c('0x56')]!=='none'){logger[_0x661c('0x1c')](_0x661c('0x57'),_0x661c('0x55'));_0x55a95e[_0x661c('0x58')]=_0x210694;}else{_0x55a95e[_0x661c('0x58')]='';}return getUser(_0x46c73c,_0x261933,_0x44914f,_0x3e95a0,_0x5d3ccd,_0x2db258)[_0x661c('0x10')](function(_0x24b06f){logger['info']('['+_0x2db258[_0x661c('0x1d')]()+']\x20The\x20User\x20ID\x20is:',_0x24b06f[_0x661c('0x20')]);logger['info']('['+_0x2db258['toUpperCase']()+_0x661c('0x59'),_0x24b06f[_0x661c('0x19')]);return getEndUser(_0x24b06f,_0x261933,_0x3e95a0,_0x5d3ccd,_0x55a95e,_0x2db258);})[_0x661c('0x10')](function(_0x184a24){logger[_0x661c('0x1c')]('['+_0x2db258[_0x661c('0x1d')]()+_0x661c('0x5a'),_0x184a24[_0x661c('0x31')]);logger['info']('['+_0x2db258[_0x661c('0x1d')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x55a95e['calleridnum']);return getTicket(_0x184a24,_0x261933,_0x3e95a0,_0x5d3ccd,_0x55a95e,_0x5aad81,_0x2db258);})['then'](function(_0x4b96ff){logger[_0x661c('0x1c')](util[_0x661c('0x4a')]('['+_0x2db258['toUpperCase']()+_0x661c('0x5b'),_0x5aad81[_0x661c('0x44')],_0x4b96ff[_0x661c('0x49')]));logger[_0x661c('0x1c')](util['format']('['+_0x2db258[_0x661c('0x1d')]()+']\x20Call\x20direction:\x20%s',_0x2db258));if(_0x2db258!==_0x661c('0x4e')){logger[_0x661c('0x1c')]('['+_0x2db258[_0x661c('0x1d')]()+']',_0x661c('0x5c'));emit(_0x261933[_0x661c('0xd')],_0x44914f['name'],_0x5aad81[_0x661c('0x44')],_0x4b96ff['ticketId']);}})[_0x661c('0x12')](function(_0x5dbefb){logger[_0x661c('0x5d')]('['+_0x2db258[_0x661c('0x1d')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0x661c('0x5e')](_0x5dbefb,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index fd2c86d..5767778 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 _0x93e3=['Ticket\x20created!','%s/api/v2/agents','Agent\x20found!','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','Enduser\x20created.','apiKey','toString','base64','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','variableName','push','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','email','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','lastevent','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','
','Tags','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','then','info'];(function(_0x4fb443,_0x2b1a95){var _0x28af7f=function(_0x3fb74f){while(--_0x3fb74f){_0x4fb443['push'](_0x4fb443['shift']());}};_0x28af7f(++_0x2b1a95);}(_0x93e3,0x147));var _0x393e=function(_0x479160,_0x3ab560){_0x479160=_0x479160-0x0;var _0x47ac6d=_0x93e3[_0x479160];return _0x47ac6d;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x393e('0x0'));var util=require(_0x393e('0x1'));var Redis=require(_0x393e('0x2'));var intUtil=require(_0x393e('0x3'));var config=require(_0x393e('0x4'));var logger=require(_0x393e('0x5'))('freshdesk');config[_0x393e('0x6')]=_[_0x393e('0x7')](config[_0x393e('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x393e('0x6')]));var headers={'Content-Type':_0x393e('0x8'),'Accept':_0x393e('0x8')};function emit(_0x9b05c1,_0x5ef6cc,_0x423ae7){io['to'](_0x9b05c1)[_0x393e('0x9')](_0x5ef6cc,_0x423ae7);}function getTicket(_0xb4804a,_0x1aaf11,_0x294971,_0xf070d6,_0xf1591c){logger['info'](_0x393e('0xa'));var _0x26ce38=_[_0x393e('0xb')]({'responder_id':_0x1aaf11['id'],'requester_id':_0x294971['id'],'name':util[_0x393e('0xc')](_0x393e('0xd'),_0xf1591c[_0x393e('0xe')]),'phone':_0xf1591c[_0x393e('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0xf070d6['Subjects'],_0xf1591c,'\x20'),'description':intUtil[_0x393e('0x10')](_0xf070d6[_0x393e('0x11')],_0xf1591c,_0x393e('0x12')),'tags':getTags(_0xf070d6[_0x393e('0x13')],'name')},getCustomFields(_0xf070d6[_0x393e('0x14')],_0xf1591c));_0x26ce38[_0x393e('0x15')]=_[_0x393e('0x16')](_[_0x393e('0x17')](_0x26ce38[_0x393e('0x15')],'id'),_0x393e('0x18'));return request({'uri':util[_0x393e('0xc')](_0x393e('0x19'),_0xb4804a[_0x393e('0x1a')]),'method':'POST','body':_0x26ce38})[_0x393e('0x1b')](function(_0x5b4127){logger[_0x393e('0x1c')](_0x393e('0x1d'));return _0x5b4127;});}function getUser(_0x26001c,_0x2e4e3b){if(intUtil['validateEmail'](_0x2e4e3b)){return request({'uri':util['format'](_0x393e('0x1e'),_0x26001c[_0x393e('0x1a')]),'qs':{'email':_0x2e4e3b}})[_0x393e('0x1b')](function(_0x51d97e){if(_0x51d97e['length']){logger[_0x393e('0x1c')](_0x393e('0x1f'));return _[_0x393e('0x20')](_0x51d97e,function(_0x3e87d7){return _0x3e87d7[_0x393e('0x21')]['email']===_0x2e4e3b;});}else{logger['info'](_0x393e('0x22'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x26001c['remoteUri'])})[_0x393e('0x1b')](function(_0xfe6896){logger[_0x393e('0x1c')](_0x393e('0x23'));return _0xfe6896;});}});}else{logger[_0x393e('0x1c')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x393e('0x24'),_0x26001c[_0x393e('0x1a')])})[_0x393e('0x1b')](function(_0x1becad){logger[_0x393e('0x1c')](_0x393e('0x23'));return _0x1becad;});}}function getEndUser(_0x383a9c,_0x24692e,_0x68a6d){logger[_0x393e('0x1c')](_0x393e('0x25'),_0x68a6d);return request({'uri':util[_0x393e('0xc')](_0x393e('0x26'),_0x383a9c[_0x393e('0x1a')]),'qs':{'phone':_0x68a6d}})[_0x393e('0x1b')](function(_0x7d5420){if(_0x7d5420[_0x393e('0x27')]){logger[_0x393e('0x1c')](_0x393e('0x28'));return _[_0x393e('0x20')](_0x7d5420,{'phone':_0x68a6d});}else{logger[_0x393e('0x1c')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x393e('0xc')](_0x393e('0x26'),_0x383a9c['remoteUri']),'method':'POST','body':{'name':_0x24692e,'phone':_0x68a6d}})[_0x393e('0x1b')](function(_0x4db913){logger['info'](_0x393e('0x29'));return _0x4db913;});}});}function getAuth(_0x823f69){return util[_0x393e('0xc')]('Basic\x20%s',new Buffer(_0x823f69[_0x393e('0x2a')]+':X')[_0x393e('0x2b')](_0x393e('0x2c')));}function request(_0x17df08){logger['debug'](_0x393e('0x2d'),JSON[_0x393e('0x2e')](_0x17df08));return rp(_['defaults'](_0x17df08,{'method':_0x393e('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x3b1551,_0x4294dc){var _0x35fd1a=[];if(_0x3b1551&&_0x3b1551[_0x393e('0x27')]>0x0){_0x35fd1a=_[_0x393e('0x30')](_0x3b1551,_0x4294dc);}return _0x35fd1a;}function getCustomFields(_0x27fc67,_0x39774c){var _0x10fdef=[];var _0x19a0cd={'custom_fields':[]};if(_0x27fc67['length']>0x0){_[_0x393e('0x31')](_0x27fc67,function(_0x561ec9){if(_[_0x393e('0x32')]([_0x393e('0x33'),_0x393e('0x34')],_0x561ec9[_0x393e('0x35')])&&_0x561ec9[_0x393e('0x36')]&&!_0x561ec9[_0x393e('0x37')]){_0x19a0cd[_0x561ec9[_0x393e('0x36')][_0x393e('0x38')]()]=_0x561ec9[_0x393e('0x39')][_0x393e('0x2b')]();}else if(_['includes']([_0x393e('0x33'),_0x393e('0x34')],_0x561ec9[_0x393e('0x35')])&&_0x561ec9[_0x393e('0x3a')]&&_0x561ec9[_0x393e('0x37')]){_0x19a0cd[_0x393e('0x15')]['push']({'id':_0x561ec9[_0x393e('0x3a')],'value':_0x561ec9['content'][_0x393e('0x2b')]()});}else if(_0x561ec9[_0x393e('0x35')]==='variable'&&_0x561ec9[_0x393e('0x3b')]&&_0x561ec9[_0x393e('0x3a')]&&_0x561ec9[_0x393e('0x37')]){_0x39774c[_0x561ec9['variableName']]&&_0x19a0cd['custom_fields'][_0x393e('0x3c')]({'id':_0x561ec9[_0x393e('0x3a')],'value':_0x39774c[_0x561ec9[_0x393e('0x3b')]][_0x393e('0x2b')]()});}else if(_0x561ec9[_0x393e('0x35')]==='customVariable'&&_0x561ec9['Variable']&&_0x561ec9[_0x393e('0x3d')][_0x393e('0x3e')]&&_0x561ec9[_0x393e('0x3a')]&&_0x561ec9[_0x393e('0x37')]){_0x39774c[_0x561ec9[_0x393e('0x3d')][_0x393e('0x3e')][_0x393e('0x38')]()]&&_0x19a0cd[_0x393e('0x15')][_0x393e('0x3c')]({'id':_0x561ec9[_0x393e('0x3a')],'value':_0x39774c[_0x561ec9[_0x393e('0x3d')][_0x393e('0x3e')][_0x393e('0x38')]()][_0x393e('0x2b')]()});}});}return _0x19a0cd;}exports[_0x393e('0x3f')]=function(_0x454d18,_0x324b53,_0xed55e3,_0x388612,_0x1188bd,_0xba1e66){var _0x175ccd,_0x200dcd;_0xba1e66[_0x393e('0x1a')]=intUtil[_0x393e('0x40')](_0xba1e66[_0x393e('0x1a')]);_0xba1e66['serverUrl']=intUtil[_0x393e('0x40')](_0xba1e66[_0x393e('0x41')]);if(_0x1188bd&&_0x1188bd[_0x393e('0x42')]){logger['info'](_0x393e('0x43'),'Recording\x20is\x20enabled!');_0x324b53['recordingURL']=util[_0x393e('0xc')](_0x393e('0x44'),_0xba1e66['serverUrl'],_0x324b53[_0x393e('0x45')],md5(_0x324b53[_0x393e('0x45')]));}else{_0x324b53[_0x393e('0x46')]='';}headers[_0x393e('0x47')]=getAuth(_0xba1e66);return getUser(_0xba1e66,_0x388612['email'])[_0x393e('0x1b')](function(_0x1cebeb){_0x175ccd=_0x1cebeb;logger['info'](_0x393e('0x48'),_0x175ccd['id']);return getEndUser(_0xba1e66,_0x324b53[_0x393e('0xe')],_0x324b53['calleridnum']);})[_0x393e('0x1b')](function(_0x31fc82){_0x200dcd=_0x31fc82;logger[_0x393e('0x1c')](_0x393e('0x49'),_0x200dcd['id']);return getTicket(_0xba1e66,_0x175ccd,_0x200dcd,_0xed55e3,_0x324b53);})[_0x393e('0x1b')](function(_0x4bedcf){if(_0x4bedcf&&_0x4bedcf['id']){logger['info'](_0x393e('0x1d'));logger[_0x393e('0x1c')](_0x393e('0x4a'),_0x4bedcf['id']);logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x393e('0xc')]('user:%s',_0x388612[_0x393e('0x3e')]),_0x393e('0x4b'),{'uri':util[_0x393e('0xc')](_0x393e('0x4c'),_0xba1e66[_0x393e('0x1a')],_0x4bedcf['id'])});}})[_0x393e('0x4d')](function(_0x2454f1){logger[_0x393e('0x4e')](_0x393e('0x43'),JSON[_0x393e('0x2e')](_0x2454f1));});};exports[_0x393e('0x4f')]=function(_0x318ac4,_0x49b46b,_0x1881c1,_0x225641,_0x190535,_0x5f1df5,_0x766c45){var _0x23b8b2,_0x547bff;_0x5f1df5['remoteUri']=intUtil['stripTrailingSlash'](_0x5f1df5[_0x393e('0x1a')]);_0x5f1df5['serverUrl']=intUtil[_0x393e('0x40')](_0x5f1df5['serverUrl']);if(_0x766c45&&_0x766c45[_0x393e('0x50')]&&_0x766c45[_0x393e('0x50')]!=='none'){logger[_0x393e('0x1c')](_0x393e('0x51'),_0x393e('0x52'));_0x49b46b[_0x393e('0x46')]=util[_0x393e('0xc')](_0x393e('0x44'),_0x5f1df5[_0x393e('0x41')],_0x49b46b['uniqueid'],md5(_0x49b46b[_0x393e('0x45')]));}headers[_0x393e('0x47')]=getAuth(_0x5f1df5);return getUser(_0x5f1df5,_0x225641[_0x393e('0x53')])[_0x393e('0x1b')](function(_0x1b5eb3){_0x23b8b2=_0x1b5eb3;logger['info']('The\x20User\x20ID\x20is:',_0x23b8b2['id']);return getEndUser(_0x5f1df5,_0x49b46b[_0x393e('0x54')],_0x49b46b[_0x393e('0x55')]);})[_0x393e('0x1b')](function(_0x43b671){_0x547bff=_0x43b671;logger[_0x393e('0x1c')](_0x393e('0x49'),_0x547bff['id']);return getTicket(_0x5f1df5,_0x23b8b2,_0x547bff,_0x1881c1,_0x49b46b);})[_0x393e('0x1b')](function(_0xebf7bf){if(_0xebf7bf&&_0xebf7bf['id']){logger[_0x393e('0x1c')](_0x393e('0x1d'));logger[_0x393e('0x1c')]('The\x20Ticket\x20ID\x20is:',_0xebf7bf['id']);logger[_0x393e('0x1c')](_0x393e('0x51'),_0x393e('0x56'));emit(util[_0x393e('0xc')]('user:%s',_0x225641[_0x393e('0x3e')]),_0x393e('0x4b'),{'uri':util[_0x393e('0xc')](_0x393e('0x4c'),_0x5f1df5[_0x393e('0x1a')],_0xebf7bf['id'])});}})[_0x393e('0x4d')](function(_0x1b4b3d){logger[_0x393e('0x4e')](_0x393e('0x51'),JSON[_0x393e('0x2e')](_0x1b4b3d));});};exports[_0x393e('0x57')]=function(_0x43f06d,_0x427cde,_0x4c6e0b,_0x42637b,_0x4d991b,_0x595419){var _0x535e83,_0x1a5dbb;_0x595419[_0x393e('0x1a')]=intUtil[_0x393e('0x40')](_0x595419[_0x393e('0x1a')]);_0x595419['serverUrl']=intUtil[_0x393e('0x40')](_0x595419[_0x393e('0x41')]);if(_0x4d991b&&_0x4d991b[_0x393e('0x42')]){logger[_0x393e('0x1c')]('['+_0x427cde[_0x393e('0x58')]['toUpperCase']()+']',_0x393e('0x52'));_0x427cde[_0x393e('0x46')]=util[_0x393e('0xc')](_0x393e('0x44'),_0x595419['serverUrl'],_0x427cde[_0x393e('0x45')],md5(_0x427cde['uniqueid']));}else{_0x427cde[_0x393e('0x46')]='';}headers[_0x393e('0x47')]=getAuth(_0x595419);return getUser(_0x595419,'')[_0x393e('0x1b')](function(_0x5c67c6){_0x535e83=_0x5c67c6;logger['info'](_0x393e('0x48'),_0x535e83['id']);return getEndUser(_0x595419,_0x427cde[_0x393e('0xe')],_0x427cde[_0x393e('0xf')]);})[_0x393e('0x1b')](function(_0x4da442){_0x1a5dbb=_0x4da442;logger[_0x393e('0x1c')]('The\x20Enduser\x20ID\x20is:',_0x1a5dbb['id']);return getTicket(_0x595419,_0x535e83,_0x1a5dbb,_0x4c6e0b,_0x427cde);})[_0x393e('0x1b')](function(_0x511a7d){if(_0x511a7d){logger['info']('Ticket\x20created!');logger['info'](_0x393e('0x4a'),_0x511a7d['id']);}})[_0x393e('0x4d')](function(_0x1970e2){logger[_0x393e('0x4e')]('['+_0x427cde['lastevent']['toUpperCase']()+']',JSON[_0x393e('0x2e')](_0x1970e2));});}; \ No newline at end of file +var _0x8857=['Searching\x20enduser\x20with\x20phone','Enduser\x20found!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','string','picklist','nameField','toLowerCase','includes','type','idField','customField','push','content','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','recordingURL','destcalleridname','destcalleridnum','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','unmanaged','monitor_format','lastevent','toUpperCase','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','
','name','Fields','custom_fields','mapValues','%s/api/v2/tickets','remoteUri','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!'];(function(_0x559b21,_0x1d2330){var _0x537de5=function(_0x1b3988){while(--_0x1b3988){_0x559b21['push'](_0x559b21['shift']());}};_0x537de5(++_0x1d2330);}(_0x8857,0x161));var _0x7885=function(_0x327e8c,_0x491fb2){_0x327e8c=_0x327e8c-0x0;var _0xf071ba=_0x8857[_0x327e8c];return _0xf071ba;};'use strict';var _=require(_0x7885('0x0'));var rp=require(_0x7885('0x1'));var md5=require('md5');var util=require(_0x7885('0x2'));var Redis=require(_0x7885('0x3'));var intUtil=require(_0x7885('0x4'));var config=require(_0x7885('0x5'));var logger=require(_0x7885('0x6'))(_0x7885('0x7'));config[_0x7885('0x8')]=_[_0x7885('0x9')](config[_0x7885('0x8')],{'host':_0x7885('0xa'),'port':0x18eb});var io=require(_0x7885('0xb'))(new Redis(config['redis']));var headers={'Content-Type':'application/json','Accept':_0x7885('0xc')};function emit(_0x3be935,_0x5d89e6,_0x20ba35){io['to'](_0x3be935)[_0x7885('0xd')](_0x5d89e6,_0x20ba35);}function getTicket(_0x2d58d9,_0x3b61dd,_0x7aa3ee,_0x2238a1,_0x436a2e){logger[_0x7885('0xe')](_0x7885('0xf'));var _0x492408=_[_0x7885('0x10')]({'responder_id':_0x3b61dd['id'],'requester_id':_0x7aa3ee['id'],'name':util[_0x7885('0x11')](_0x7885('0x12'),_0x436a2e[_0x7885('0x13')]),'phone':_0x436a2e[_0x7885('0x14')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x2238a1['Subjects'],_0x436a2e,'\x20'),'description':intUtil[_0x7885('0x15')](_0x2238a1[_0x7885('0x16')],_0x436a2e,_0x7885('0x17')),'tags':getTags(_0x2238a1['Tags'],_0x7885('0x18'))},getCustomFields(_0x2238a1[_0x7885('0x19')],_0x436a2e));_0x492408[_0x7885('0x1a')]=_[_0x7885('0x1b')](_['keyBy'](_0x492408[_0x7885('0x1a')],'id'),'value');return request({'uri':util[_0x7885('0x11')](_0x7885('0x1c'),_0x2d58d9[_0x7885('0x1d')]),'method':'POST','body':_0x492408})[_0x7885('0x1e')](function(_0x43a1b4){logger[_0x7885('0xe')](_0x7885('0x1f'));return _0x43a1b4;});}function getUser(_0x593ade,_0x4693b1){if(intUtil[_0x7885('0x20')](_0x4693b1)){return request({'uri':util['format'](_0x7885('0x21'),_0x593ade[_0x7885('0x1d')]),'qs':{'email':_0x4693b1}})[_0x7885('0x1e')](function(_0x5a5eb1){if(_0x5a5eb1[_0x7885('0x22')]){logger[_0x7885('0xe')](_0x7885('0x23'));return _[_0x7885('0x24')](_0x5a5eb1,function(_0x44cac4){return _0x44cac4[_0x7885('0x25')][_0x7885('0x26')]===_0x4693b1;});}else{logger[_0x7885('0xe')](_0x7885('0x27'));return request({'uri':util[_0x7885('0x11')](_0x7885('0x28'),_0x593ade['remoteUri'])})[_0x7885('0x1e')](function(_0x18683f){logger[_0x7885('0xe')](_0x7885('0x29'));return _0x18683f;});}});}else{logger['info'](_0x7885('0x2a'));return request({'uri':util['format'](_0x7885('0x28'),_0x593ade[_0x7885('0x1d')])})[_0x7885('0x1e')](function(_0x37a22b){logger[_0x7885('0xe')](_0x7885('0x29'));return _0x37a22b;});}}function getEndUser(_0x118510,_0x2a8831,_0x41458a){logger[_0x7885('0xe')](_0x7885('0x2b'),_0x41458a);return request({'uri':util[_0x7885('0x11')]('%s/api/v2/contacts',_0x118510[_0x7885('0x1d')]),'qs':{'phone':_0x41458a}})[_0x7885('0x1e')](function(_0x178cf5){if(_0x178cf5['length']){logger['info'](_0x7885('0x2c'));return _[_0x7885('0x24')](_0x178cf5,{'phone':_0x41458a});}else{logger[_0x7885('0xe')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x7885('0x11')](_0x7885('0x2d'),_0x118510['remoteUri']),'method':'POST','body':{'name':_0x2a8831,'phone':_0x41458a}})['then'](function(_0x57490e){logger['info'](_0x7885('0x2e'));return _0x57490e;});}});}function getAuth(_0x11216c){return util['format'](_0x7885('0x2f'),new Buffer(_0x11216c[_0x7885('0x30')]+':X')[_0x7885('0x31')](_0x7885('0x32')));}function request(_0x564a16){logger[_0x7885('0x33')](_0x7885('0x34'),JSON[_0x7885('0x35')](_0x564a16));return rp(_[_0x7885('0x9')](_0x564a16,{'method':_0x7885('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x4bda49,_0x3ed310){var _0x28497f=[];if(_0x4bda49&&_0x4bda49[_0x7885('0x22')]>0x0){_0x28497f=_[_0x7885('0x37')](_0x4bda49,_0x3ed310);}return _0x28497f;}function getCustomFields(_0xbaf135,_0x219d89){var _0x355d00=[];var _0x2f11fe={'custom_fields':[]};if(_0xbaf135[_0x7885('0x22')]>0x0){_[_0x7885('0x38')](_0xbaf135,function(_0xa9c457){if(_['includes']([_0x7885('0x39'),_0x7885('0x3a')],_0xa9c457['type'])&&_0xa9c457['nameField']&&!_0xa9c457['customField']){_0x2f11fe[_0xa9c457[_0x7885('0x3b')][_0x7885('0x3c')]()]=_0xa9c457['content']['toString']();}else if(_[_0x7885('0x3d')]([_0x7885('0x39'),_0x7885('0x3a')],_0xa9c457[_0x7885('0x3e')])&&_0xa9c457[_0x7885('0x3f')]&&_0xa9c457[_0x7885('0x40')]){_0x2f11fe[_0x7885('0x1a')][_0x7885('0x41')]({'id':_0xa9c457[_0x7885('0x3f')],'value':_0xa9c457[_0x7885('0x42')]['toString']()});}else if(_0xa9c457[_0x7885('0x3e')]===_0x7885('0x43')&&_0xa9c457[_0x7885('0x44')]&&_0xa9c457[_0x7885('0x3f')]&&_0xa9c457[_0x7885('0x40')]){_0x219d89[_0xa9c457[_0x7885('0x44')]]&&_0x2f11fe[_0x7885('0x1a')][_0x7885('0x41')]({'id':_0xa9c457[_0x7885('0x3f')],'value':_0x219d89[_0xa9c457['variableName']][_0x7885('0x31')]()});}else if(_0xa9c457[_0x7885('0x3e')]===_0x7885('0x45')&&_0xa9c457[_0x7885('0x46')]&&_0xa9c457[_0x7885('0x46')][_0x7885('0x18')]&&_0xa9c457[_0x7885('0x3f')]&&_0xa9c457[_0x7885('0x40')]){_0x219d89[_0xa9c457[_0x7885('0x46')]['name']['toLowerCase']()]&&_0x2f11fe['custom_fields']['push']({'id':_0xa9c457[_0x7885('0x3f')],'value':_0x219d89[_0xa9c457[_0x7885('0x46')][_0x7885('0x18')][_0x7885('0x3c')]()][_0x7885('0x31')]()});}});}return _0x2f11fe;}exports[_0x7885('0x47')]=function(_0x4bdf2b,_0x4a5275,_0x2dd606,_0x18d53a,_0x5e2008,_0x26df7c){var _0x21ac8c,_0x315362;_0x26df7c[_0x7885('0x1d')]=intUtil['stripTrailingSlash'](_0x26df7c[_0x7885('0x1d')]);_0x26df7c['serverUrl']=intUtil[_0x7885('0x48')](_0x26df7c[_0x7885('0x49')]);if(_0x5e2008&&_0x5e2008['monitor_format']){logger['info']('[QUEUE]',_0x7885('0x4a'));_0x4a5275['recordingURL']=util[_0x7885('0x11')](_0x7885('0x4b'),_0x26df7c[_0x7885('0x49')],_0x4a5275['uniqueid'],md5(_0x4a5275[_0x7885('0x4c')]));}else{_0x4a5275['recordingURL']='';}headers[_0x7885('0x4d')]=getAuth(_0x26df7c);return getUser(_0x26df7c,_0x18d53a[_0x7885('0x26')])[_0x7885('0x1e')](function(_0x354017){_0x21ac8c=_0x354017;logger['info'](_0x7885('0x4e'),_0x21ac8c['id']);return getEndUser(_0x26df7c,_0x4a5275['calleridname'],_0x4a5275['calleridnum']);})[_0x7885('0x1e')](function(_0x1bd91b){_0x315362=_0x1bd91b;logger['info'](_0x7885('0x4f'),_0x315362['id']);return getTicket(_0x26df7c,_0x21ac8c,_0x315362,_0x2dd606,_0x4a5275);})[_0x7885('0x1e')](function(_0x4a5351){if(_0x4a5351&&_0x4a5351['id']){logger[_0x7885('0xe')](_0x7885('0x1f'));logger[_0x7885('0xe')](_0x7885('0x50'),_0x4a5351['id']);logger[_0x7885('0xe')](_0x7885('0x51'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x7885('0x52'),_0x18d53a['name']),_0x7885('0x53'),{'uri':util[_0x7885('0x11')]('%s/helpdesk/tickets/%d',_0x26df7c[_0x7885('0x1d')],_0x4a5351['id'])});}})[_0x7885('0x54')](function(_0x521e8b){logger[_0x7885('0x55')](_0x7885('0x51'),JSON[_0x7885('0x35')](_0x521e8b));});};exports[_0x7885('0x56')]=function(_0xd4396,_0x4a2235,_0x5bd798,_0x4cf040,_0x35d0d7,_0x210d50,_0x38d82b){var _0x2a5e37,_0x50baaf;_0x210d50[_0x7885('0x1d')]=intUtil[_0x7885('0x48')](_0x210d50[_0x7885('0x1d')]);_0x210d50[_0x7885('0x49')]=intUtil['stripTrailingSlash'](_0x210d50[_0x7885('0x49')]);if(_0x38d82b&&_0x38d82b[_0x7885('0x57')]&&_0x38d82b[_0x7885('0x57')]!==_0x7885('0x58')){logger[_0x7885('0xe')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a2235[_0x7885('0x59')]=util[_0x7885('0x11')](_0x7885('0x4b'),_0x210d50[_0x7885('0x49')],_0x4a2235[_0x7885('0x4c')],md5(_0x4a2235[_0x7885('0x4c')]));}headers[_0x7885('0x4d')]=getAuth(_0x210d50);return getUser(_0x210d50,_0x4cf040[_0x7885('0x26')])['then'](function(_0x538160){_0x2a5e37=_0x538160;logger[_0x7885('0xe')]('The\x20User\x20ID\x20is:',_0x2a5e37['id']);return getEndUser(_0x210d50,_0x4a2235[_0x7885('0x5a')],_0x4a2235[_0x7885('0x5b')]);})[_0x7885('0x1e')](function(_0x1672fe){_0x50baaf=_0x1672fe;logger[_0x7885('0xe')](_0x7885('0x4f'),_0x50baaf['id']);return getTicket(_0x210d50,_0x2a5e37,_0x50baaf,_0x5bd798,_0x4a2235);})[_0x7885('0x1e')](function(_0x1322b6){if(_0x1322b6&&_0x1322b6['id']){logger['info']('Ticket\x20created!');logger[_0x7885('0xe')](_0x7885('0x50'),_0x1322b6['id']);logger[_0x7885('0xe')](_0x7885('0x5c'),_0x7885('0x5d'));emit(util[_0x7885('0x11')](_0x7885('0x52'),_0x4cf040[_0x7885('0x18')]),_0x7885('0x53'),{'uri':util[_0x7885('0x11')](_0x7885('0x5e'),_0x210d50['remoteUri'],_0x1322b6['id'])});}})[_0x7885('0x54')](function(_0x28d0bc){logger[_0x7885('0x55')]('[OUTBOUND]',JSON[_0x7885('0x35')](_0x28d0bc));});};exports[_0x7885('0x5f')]=function(_0x354ada,_0x506b80,_0x31cbf0,_0x10a0a7,_0x2d7233,_0x26eba2){var _0x3ca841,_0xf93dbc;_0x26eba2['remoteUri']=intUtil[_0x7885('0x48')](_0x26eba2[_0x7885('0x1d')]);_0x26eba2[_0x7885('0x49')]=intUtil[_0x7885('0x48')](_0x26eba2['serverUrl']);if(_0x2d7233&&_0x2d7233[_0x7885('0x60')]){logger[_0x7885('0xe')]('['+_0x506b80[_0x7885('0x61')][_0x7885('0x62')]()+']',_0x7885('0x4a'));_0x506b80[_0x7885('0x59')]=util['format'](_0x7885('0x4b'),_0x26eba2[_0x7885('0x49')],_0x506b80[_0x7885('0x4c')],md5(_0x506b80[_0x7885('0x4c')]));}else{_0x506b80[_0x7885('0x59')]='';}headers[_0x7885('0x4d')]=getAuth(_0x26eba2);return getUser(_0x26eba2,'')[_0x7885('0x1e')](function(_0x1b1084){_0x3ca841=_0x1b1084;logger[_0x7885('0xe')](_0x7885('0x4e'),_0x3ca841['id']);return getEndUser(_0x26eba2,_0x506b80['calleridname'],_0x506b80[_0x7885('0x14')]);})[_0x7885('0x1e')](function(_0x181209){_0xf93dbc=_0x181209;logger[_0x7885('0xe')](_0x7885('0x4f'),_0xf93dbc['id']);return getTicket(_0x26eba2,_0x3ca841,_0xf93dbc,_0x31cbf0,_0x506b80);})['then'](function(_0x16d0a1){if(_0x16d0a1){logger['info']('Ticket\x20created!');logger[_0x7885('0xe')](_0x7885('0x50'),_0x16d0a1['id']);}})[_0x7885('0x54')](function(_0x5eebad){logger['error']('['+_0x506b80[_0x7885('0x61')]['toUpperCase']()+']',JSON['stringify'](_0x5eebad));});}; \ 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 17e4615..5a9a80b 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 _0x1438=['Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','trigger:browser:url','apiKey','remoteUri','stripTrailingSlash','adminEmail','username','destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','moment','bluebird','ioredis','../../../../config/logger','freshsales','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','Getting\x20admin\x20information','users','length','email','info','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','message','headers','Getting\x20user\x20list','then','agentEmail','Getting\x20user\x20with\x20email','userId','User\x20found:','error','toUpperCase','/api/lookup?q=','&f=','&entities=contact','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId'];(function(_0x3f553b,_0x49a9c2){var _0x183c4e=function(_0x873b22){while(--_0x873b22){_0x3f553b['push'](_0x3f553b['shift']());}};_0x183c4e(++_0x49a9c2);}(_0x1438,0x1d5));var _0x8143=function(_0x5426e2,_0x5f2968){_0x5426e2=_0x5426e2-0x0;var _0x920dc=_0x1438[_0x5426e2];return _0x920dc;};'use strict';var _=require(_0x8143('0x0'));var rp=require(_0x8143('0x1'));var md5=require(_0x8143('0x2'));var util=require('util');var moment=require(_0x8143('0x3'));var Promise=require(_0x8143('0x4'));var Redis=require(_0x8143('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x8143('0x6'))(_0x8143('0x7'));config['redis']=_[_0x8143('0x8')](config['redis'],{'host':_0x8143('0x9'),'port':0x18eb});var io=require(_0x8143('0xa'))(new Redis(config['redis']));function getAdminId(_0x3f021a,_0x201964,_0x2e8d96,_0xc600cb){return new Promise(function(_0x234fe8,_0x41e825){var _0x19255d=![];var _0x425ab0={'method':_0x8143('0xb'),'uri':_0xc600cb+_0x8143('0xc'),'json':!![]};_0x425ab0['headers']=_0x2e8d96;logger['info'](_0x8143('0xd'));return rp(_0x425ab0)['then'](function(_0x371f79){if(_0x371f79){var _0x31ff06=_0x371f79[_0x8143('0xe')];var _0x798541=null;for(_0x798541=0x0;_0x798541<_0x31ff06[_0x8143('0xf')];_0x798541++){if(_0x31ff06[_0x798541][_0x8143('0x10')]===_0x3f021a['adminEmail']){_0x3f021a['adminId']=_0x31ff06[_0x798541]['id'];_0x19255d=!![];}}if(_0x19255d){logger[_0x8143('0x11')](_0x8143('0x12'),_0x3f021a[_0x8143('0x13')]);_0x234fe8(_0x3f021a);}else{_0x41e825({'statusCode':0x194,'message':_0x8143('0x14')});}}else{_0x41e825({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x8143('0x15')](function(_0x4577b6){logger['error']('['+[_0x201964['toUpperCase']()]+']',_0x4577b6[_0x8143('0x16')]);_0x41e825(_0x4577b6);});});}function getUser(_0x5018c4,_0x5b43b9,_0x3c5d83){return function(_0x54f068){return new Promise(function(_0x1c984f,_0x1e455a){var _0x36346e={'method':'GET','uri':_0x3c5d83+_0x8143('0xc'),'json':!![]};_0x36346e[_0x8143('0x17')]=_0x5b43b9;logger[_0x8143('0x11')](_0x8143('0x18'));return rp(_0x36346e)[_0x8143('0x19')](function(_0x1cc7da){if(_0x1cc7da){var _0x46e6ec=_0x1cc7da['users'];var _0x2d980b=![];var _0xdfe3f6=null;if(_0x54f068[_0x8143('0x1a')]!==null){logger[_0x8143('0x11')](_0x8143('0x1b'),_0x54f068[_0x8143('0x1a')]);_0x54f068['userEmail']=_0x54f068[_0x8143('0x1a')];for(_0xdfe3f6=0x0;_0xdfe3f6<_0x46e6ec[_0x8143('0xf')];_0xdfe3f6++){if(_0x46e6ec[_0xdfe3f6][_0x8143('0x10')]===_0x54f068[_0x8143('0x1a')]){_0x2d980b=!![];_0x54f068[_0x8143('0x1c')]=_0x46e6ec[_0xdfe3f6]['id'];logger[_0x8143('0x11')](_0x8143('0x1d'),_0x54f068[_0x8143('0x1c')]);}}}if(!_0x2d980b){logger[_0x8143('0x11')]('Admin\x20selected');_0x54f068['userEmail']=_0x54f068['adminEmail'];_0x54f068[_0x8143('0x1c')]=_0x54f068['adminId'];_0x2d980b=!![];}if(_0x2d980b){_0x1c984f(_0x54f068);}else{_0x1e455a({'statusCode':0x194,'message':_0x8143('0x14')});}}else{_0x1e455a({'statusCode':0x194,'message':_0x8143('0x14')});}})[_0x8143('0x15')](function(_0x5b5ec7){logger[_0x8143('0x1e')]('['+[_0x5018c4[_0x8143('0x1f')]()]+']',_0x5b5ec7[_0x8143('0x16')]);_0x1e455a(_0x5b5ec7);});});};}function searchContact(_0x2dbbed,_0x3a0a32,_0x2e0cda,_0x3b4f13){return new Promise(function(_0x4259ce,_0x2b9f1b){var _0x2f081c={'method':'GET','headers':_0x3a0a32,'uri':_0x2dbbed+_0x8143('0x20')+_0x3b4f13+_0x8143('0x21')+_0x2e0cda+_0x8143('0x22'),'json':!![]};rp(_0x2f081c)[_0x8143('0x19')](function(_0x5b471a){var _0x877710=_['find'](_0x5b471a[_0x8143('0x23')][_0x8143('0x23')],[_0x2e0cda,_0x3b4f13]);_0x4259ce(_0x877710);})['catch'](function(_0x46e5b2){_0x2b9f1b(_0x46e5b2);});});}function getEndUser(_0x4b8463,_0x1560d2,_0x5575e3){return function(_0x995ac){return new Promise(function(_0x59d79b,_0x523318){logger[_0x8143('0x11')](util[_0x8143('0x24')](_0x8143('0x25'),_0x995ac[_0x8143('0x26')]));searchContact(_0x5575e3,_0x1560d2,_0x8143('0x27'),_0x995ac[_0x8143('0x26')])[_0x8143('0x19')](function(_0x15a276){if(_0x15a276){_0x995ac[_0x8143('0x28')]=_0x15a276['id'];logger[_0x8143('0x11')](_0x8143('0x29'),_0x995ac['endUserId']);return _0x59d79b(_0x995ac);}searchContact(_0x5575e3,_0x1560d2,_0x8143('0x2a'),_0x995ac[_0x8143('0x26')])[_0x8143('0x19')](function(_0x340b3e){if(_0x340b3e){_0x995ac['endUserId']=_0x340b3e['id'];logger[_0x8143('0x11')](_0x8143('0x2b'),_0x995ac['endUserId']);return _0x59d79b(_0x995ac);}createEndUser(_0x995ac,_0x4b8463,_0x1560d2,_0x5575e3)[_0x8143('0x19')](function(_0x1bb26d){logger[_0x8143('0x11')](_0x8143('0x2c'),_0x1bb26d[_0x8143('0x28')]);return _0x59d79b(_0x1bb26d);});});})['catch'](function(_0x49c216){_0x523318(_0x49c216);});});};}function createEndUser(_0x4e7adb,_0xb02f1f,_0x476be7,_0x507228){return new Promise(function(_0x5490be,_0x443270){var _0x187cac=moment();var _0x36a884={'method':_0x8143('0x2d'),'uri':_0x507228+_0x8143('0x2e'),'body':{'contact':{'last_name':_0x4e7adb['contactNumber'],'work_number':_0x4e7adb[_0x8143('0x26')],'mobile_number':_0x4e7adb[_0x8143('0x26')],'owner_id':_0x4e7adb[_0x8143('0x1c')],'created_at':_0x187cac[_0x8143('0x24')](_0x8143('0x2f'))}},'json':!![]};_0x36a884[_0x8143('0x17')]=_0x476be7;logger[_0x8143('0x11')](_0x8143('0x30'));return rp(_0x36a884)[_0x8143('0x19')](function(_0x418b5d){_0x4e7adb[_0x8143('0x28')]=_0x418b5d[_0x8143('0x31')]['id'];_0x5490be(_0x4e7adb);})[_0x8143('0x15')](function(_0x330cde){logger[_0x8143('0x1e')]('['+[_0xb02f1f[_0x8143('0x1f')]()]+']',_0x330cde[_0x8143('0x16')]);_0x443270(_0x330cde[_0x8143('0x16')]);});});}function getTicket(_0x3401d7,_0x5970be,_0x320c99,_0x4a9f0e,_0x4492fb){return function(_0x2bc0a6){logger[_0x8143('0x11')](_0x8143('0x32'));return new Promise(function(_0x329423,_0xf112f7){var _0x1576d2=moment();var _0x5b9b2b={'method':'POST','uri':_0x320c99+_0x8143('0x33'),'body':{'title':intUtil[_0x8143('0x34')](_0x4a9f0e['Subjects'],_0x4492fb,'\x20'),'description':intUtil[_0x8143('0x34')](_0x4a9f0e[_0x8143('0x35')],_0x4492fb,'\x0a'),'owner_id':_0x2bc0a6['userId'],'creater_id':_0x2bc0a6[_0x8143('0x13')],'targetable_id':_0x2bc0a6[_0x8143('0x28')],'targetable_type':_0x8143('0x36'),'created_at':_0x1576d2['format']('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x1576d2[_0x8143('0x37')](0x1e,'m')[_0x8143('0x24')](_0x8143('0x2f'))},'json':!![]};_0x5b9b2b[_0x8143('0x17')]=_0x5970be;return rp(_0x5b9b2b)[_0x8143('0x19')](function(_0x5073d5){_0x2bc0a6[_0x8143('0x38')]=_0x5073d5[_0x8143('0x39')]['id'];logger[_0x8143('0x11')](_0x8143('0x3a'),_0x2bc0a6[_0x8143('0x38')]);_0x329423(_0x2bc0a6);})['catch'](function(_0x599107){logger[_0x8143('0x1e')]('['+[_0x3401d7[_0x8143('0x1f')]()]+']',_0x599107[_0x8143('0x16')]);_0xf112f7(_0x599107['message']);});});};}function emit(_0x1f97ea,_0x238891,_0x5b2cbc){var _0x381eef={'uri':_0x1f97ea+_0x8143('0x3b')+_0x5b2cbc};io['to'](util[_0x8143('0x24')](_0x8143('0x3c'),_0x238891))['emit'](_0x8143('0x3d'),_0x381eef);}exports['cs']=function(_0x681704,_0x579c43,_0x7dfff4,_0x2d57ca,_0x39352d,_0x770f68,_0x22ff43,_0x4ad3ab){var _0x3282ca={};var _0x4b15f8={'Authorization':'Token\x20token='+_0x770f68[_0x8143('0x3e')]};_0x770f68[_0x8143('0x3f')]=intUtil[_0x8143('0x40')](_0x770f68[_0x8143('0x3f')]);_0x770f68['serverUrl']=intUtil['stripTrailingSlash'](_0x770f68['serverUrl']);var _0x40de19=_0x770f68[_0x8143('0x3f')];_0x3282ca[_0x8143('0x41')]=_0x770f68[_0x8143('0x42')];_0x3282ca[_0x8143('0x26')]=_0x4ad3ab['toLowerCase']()==='outbound'?_0x579c43[_0x8143('0x43')]:_0x579c43[_0x8143('0x44')];_0x3282ca[_0x8143('0x45')]=_0x4ad3ab===_0x8143('0x46')||_0x4ad3ab===_0x8143('0x47')?_0x8143('0x46'):_0x8143('0x48');if(_0x2d57ca){_0x3282ca[_0x8143('0x1a')]=_0x2d57ca['email'];}var _0x468f1e=util[_0x8143('0x24')](_0x8143('0x49'),_0x770f68[_0x8143('0x4a')],_0x579c43[_0x8143('0x4b')],md5(_0x579c43[_0x8143('0x4b')]));if(_0x39352d&&_0x39352d[_0x8143('0x4c')]){logger[_0x8143('0x11')]('[QUEUE]',_0x8143('0x4d'));_0x579c43[_0x8143('0x4e')]=_0x468f1e;}else if(_0x22ff43&&_0x22ff43[_0x8143('0x4f')]&&_0x22ff43[_0x8143('0x4f')]!==_0x8143('0x50')){logger[_0x8143('0x11')](_0x8143('0x51'),_0x8143('0x4d'));_0x579c43[_0x8143('0x4e')]=_0x468f1e;}else{_0x579c43['recordingURL']='';}return getAdminId(_0x3282ca,_0x4ad3ab,_0x4b15f8,_0x40de19)[_0x8143('0x19')](getUser(_0x4ad3ab,_0x4b15f8,_0x40de19))[_0x8143('0x19')](getEndUser(_0x4ad3ab,_0x4b15f8,_0x40de19))[_0x8143('0x19')](getTicket(_0x4ad3ab,_0x4b15f8,_0x40de19,_0x7dfff4,_0x579c43))['then'](function(_0x2f61c7){logger[_0x8143('0x11')](util[_0x8143('0x24')]('The\x20ticket\x20ID\x20is:\x20%s',_0x2f61c7[_0x8143('0x38')]));if(_0x4ad3ab!=='unmanaged'){logger[_0x8143('0x11')]('['+[_0x4ad3ab[_0x8143('0x1f')]()]+']',_0x8143('0x52'));emit(_0x40de19,_0x2d57ca[_0x8143('0x53')],_0x2f61c7[_0x8143('0x28')]);}})[_0x8143('0x15')](function(_0x237968){logger[_0x8143('0x1e')]('['+[_0x4ad3ab[_0x8143('0x1f')]()]+_0x8143('0x54'),util['inspect'](_0x237968,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xd8c9=['[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','Getting\x20admin\x20information','then','users','length','adminEmail','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','email','userId','Admin\x20selected','adminId','catch','/api/lookup?q=','&f=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','username','destcalleridnum','unmanaged','queue','outbound','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat'];(function(_0x4f6c3c,_0x167865){var _0x24ebdd=function(_0x23852f){while(--_0x23852f){_0x4f6c3c['push'](_0x4f6c3c['shift']());}};_0x24ebdd(++_0x167865);}(_0xd8c9,0x155));var _0x9d8c=function(_0x58833e,_0x426eea){_0x58833e=_0x58833e-0x0;var _0x534169=_0xd8c9[_0x58833e];return _0x534169;};'use strict';var _=require('lodash');var rp=require(_0x9d8c('0x0'));var md5=require('md5');var util=require(_0x9d8c('0x1'));var moment=require(_0x9d8c('0x2'));var Promise=require(_0x9d8c('0x3'));var Redis=require(_0x9d8c('0x4'));var intUtil=require(_0x9d8c('0x5'));var config=require(_0x9d8c('0x6'));var logger=require(_0x9d8c('0x7'))(_0x9d8c('0x8'));config[_0x9d8c('0x9')]=_[_0x9d8c('0xa')](config[_0x9d8c('0x9')],{'host':_0x9d8c('0xb'),'port':0x18eb});var io=require(_0x9d8c('0xc'))(new Redis(config[_0x9d8c('0x9')]));function getAdminId(_0x5c3992,_0x1c92d8,_0x3a0a33,_0x585b76){return new Promise(function(_0xfc3b41,_0x530b14){var _0x20d1ac=![];var _0x183992={'method':_0x9d8c('0xd'),'uri':_0x585b76+_0x9d8c('0xe'),'json':!![]};_0x183992[_0x9d8c('0xf')]=_0x3a0a33;logger['info'](_0x9d8c('0x10'));return rp(_0x183992)[_0x9d8c('0x11')](function(_0x415e92){if(_0x415e92){var _0x31e046=_0x415e92[_0x9d8c('0x12')];var _0x35e76f=null;for(_0x35e76f=0x0;_0x35e76f<_0x31e046[_0x9d8c('0x13')];_0x35e76f++){if(_0x31e046[_0x35e76f]['email']===_0x5c3992[_0x9d8c('0x14')]){_0x5c3992['adminId']=_0x31e046[_0x35e76f]['id'];_0x20d1ac=!![];}}if(_0x20d1ac){logger[_0x9d8c('0x15')](_0x9d8c('0x16'),_0x5c3992['adminId']);_0xfc3b41(_0x5c3992);}else{_0x530b14({'statusCode':0x194,'message':_0x9d8c('0x17')});}}else{_0x530b14({'statusCode':0x194,'message':_0x9d8c('0x17')});}})['catch'](function(_0x47e66a){logger[_0x9d8c('0x18')]('['+[_0x1c92d8[_0x9d8c('0x19')]()]+']',_0x47e66a[_0x9d8c('0x1a')]);_0x530b14(_0x47e66a);});});}function getUser(_0x3dd815,_0x2a159c,_0x117d55){return function(_0x745d51){return new Promise(function(_0x5c3718,_0x233345){var _0x20e172={'method':_0x9d8c('0xd'),'uri':_0x117d55+_0x9d8c('0xe'),'json':!![]};_0x20e172[_0x9d8c('0xf')]=_0x2a159c;logger[_0x9d8c('0x15')](_0x9d8c('0x1b'));return rp(_0x20e172)[_0x9d8c('0x11')](function(_0x2248df){if(_0x2248df){var _0x4be3cc=_0x2248df[_0x9d8c('0x12')];var _0x389036=![];var _0x4ec90d=null;if(_0x745d51[_0x9d8c('0x1c')]!==null){logger[_0x9d8c('0x15')](_0x9d8c('0x1d'),_0x745d51[_0x9d8c('0x1c')]);_0x745d51[_0x9d8c('0x1e')]=_0x745d51[_0x9d8c('0x1c')];for(_0x4ec90d=0x0;_0x4ec90d<_0x4be3cc['length'];_0x4ec90d++){if(_0x4be3cc[_0x4ec90d][_0x9d8c('0x1f')]===_0x745d51[_0x9d8c('0x1c')]){_0x389036=!![];_0x745d51[_0x9d8c('0x20')]=_0x4be3cc[_0x4ec90d]['id'];logger[_0x9d8c('0x15')]('User\x20found:',_0x745d51[_0x9d8c('0x20')]);}}}if(!_0x389036){logger[_0x9d8c('0x15')](_0x9d8c('0x21'));_0x745d51[_0x9d8c('0x1e')]=_0x745d51[_0x9d8c('0x14')];_0x745d51[_0x9d8c('0x20')]=_0x745d51[_0x9d8c('0x22')];_0x389036=!![];}if(_0x389036){_0x5c3718(_0x745d51);}else{_0x233345({'statusCode':0x194,'message':_0x9d8c('0x17')});}}else{_0x233345({'statusCode':0x194,'message':_0x9d8c('0x17')});}})[_0x9d8c('0x23')](function(_0xc12646){logger[_0x9d8c('0x18')]('['+[_0x3dd815['toUpperCase']()]+']',_0xc12646['message']);_0x233345(_0xc12646);});});};}function searchContact(_0x442708,_0x1bc5d4,_0x35cbbb,_0x4c15a1){return new Promise(function(_0x1b4a58,_0x1fb168){var _0x2a8ff4={'method':'GET','headers':_0x1bc5d4,'uri':_0x442708+_0x9d8c('0x24')+_0x4c15a1+_0x9d8c('0x25')+_0x35cbbb+'&entities=contact','json':!![]};rp(_0x2a8ff4)[_0x9d8c('0x11')](function(_0x41cc61){var _0x3d3693=_[_0x9d8c('0x26')](_0x41cc61['contacts'][_0x9d8c('0x27')],[_0x35cbbb,_0x4c15a1]);_0x1b4a58(_0x3d3693);})[_0x9d8c('0x23')](function(_0x979c5e){_0x1fb168(_0x979c5e);});});}function getEndUser(_0x84f89,_0x3c528d,_0x50bbd5){return function(_0x1080e1){return new Promise(function(_0x63385b,_0x1e2097){logger[_0x9d8c('0x15')](util[_0x9d8c('0x28')](_0x9d8c('0x29'),_0x1080e1[_0x9d8c('0x2a')]));searchContact(_0x50bbd5,_0x3c528d,_0x9d8c('0x2b'),_0x1080e1[_0x9d8c('0x2a')])[_0x9d8c('0x11')](function(_0xf7df2){if(_0xf7df2){_0x1080e1[_0x9d8c('0x2c')]=_0xf7df2['id'];logger[_0x9d8c('0x15')](_0x9d8c('0x2d'),_0x1080e1['endUserId']);return _0x63385b(_0x1080e1);}searchContact(_0x50bbd5,_0x3c528d,'work_number',_0x1080e1['contactNumber'])['then'](function(_0x40c7d1){if(_0x40c7d1){_0x1080e1[_0x9d8c('0x2c')]=_0x40c7d1['id'];logger[_0x9d8c('0x15')]('Contact\x20found\x20work_number:',_0x1080e1[_0x9d8c('0x2c')]);return _0x63385b(_0x1080e1);}createEndUser(_0x1080e1,_0x84f89,_0x3c528d,_0x50bbd5)[_0x9d8c('0x11')](function(_0x2979e8){logger[_0x9d8c('0x15')](_0x9d8c('0x2e'),_0x2979e8[_0x9d8c('0x2c')]);return _0x63385b(_0x2979e8);});});})['catch'](function(_0x28aaee){_0x1e2097(_0x28aaee);});});};}function createEndUser(_0x1f0faa,_0x43b6be,_0x56b652,_0x61761e){return new Promise(function(_0x57e211,_0x54e1b2){var _0x3f102b=moment();var _0x2c8ad4={'method':_0x9d8c('0x2f'),'uri':_0x61761e+_0x9d8c('0x30'),'body':{'contact':{'last_name':_0x1f0faa['contactNumber'],'work_number':_0x1f0faa[_0x9d8c('0x2a')],'mobile_number':_0x1f0faa[_0x9d8c('0x2a')],'owner_id':_0x1f0faa[_0x9d8c('0x20')],'created_at':_0x3f102b[_0x9d8c('0x28')](_0x9d8c('0x31'))}},'json':!![]};_0x2c8ad4[_0x9d8c('0xf')]=_0x56b652;logger[_0x9d8c('0x15')](_0x9d8c('0x32'));return rp(_0x2c8ad4)[_0x9d8c('0x11')](function(_0x2ae346){_0x1f0faa[_0x9d8c('0x2c')]=_0x2ae346[_0x9d8c('0x33')]['id'];_0x57e211(_0x1f0faa);})[_0x9d8c('0x23')](function(_0x1ba4e1){logger[_0x9d8c('0x18')]('['+[_0x43b6be[_0x9d8c('0x19')]()]+']',_0x1ba4e1[_0x9d8c('0x1a')]);_0x54e1b2(_0x1ba4e1[_0x9d8c('0x1a')]);});});}function getTicket(_0x1c7e71,_0x606d0c,_0x39f0fc,_0xe42dbf,_0x361151){return function(_0x1532f2){logger['info']('Creating\x20new\x20task');return new Promise(function(_0x67e00a,_0x379847){var _0x525d31=moment();var _0x227192={'method':_0x9d8c('0x2f'),'uri':_0x39f0fc+_0x9d8c('0x34'),'body':{'title':intUtil[_0x9d8c('0x35')](_0xe42dbf[_0x9d8c('0x36')],_0x361151,'\x20'),'description':intUtil['getString'](_0xe42dbf[_0x9d8c('0x37')],_0x361151,'\x0a'),'owner_id':_0x1532f2[_0x9d8c('0x20')],'creater_id':_0x1532f2[_0x9d8c('0x22')],'targetable_id':_0x1532f2[_0x9d8c('0x2c')],'targetable_type':_0x9d8c('0x38'),'created_at':_0x525d31['format']('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x525d31[_0x9d8c('0x39')](0x1e,'m')[_0x9d8c('0x28')](_0x9d8c('0x31'))},'json':!![]};_0x227192[_0x9d8c('0xf')]=_0x606d0c;return rp(_0x227192)[_0x9d8c('0x11')](function(_0x32b776){_0x1532f2[_0x9d8c('0x3a')]=_0x32b776[_0x9d8c('0x3b')]['id'];logger[_0x9d8c('0x15')](_0x9d8c('0x3c'),_0x1532f2[_0x9d8c('0x3a')]);_0x67e00a(_0x1532f2);})['catch'](function(_0x586f04){logger['error']('['+[_0x1c7e71[_0x9d8c('0x19')]()]+']',_0x586f04[_0x9d8c('0x1a')]);_0x379847(_0x586f04[_0x9d8c('0x1a')]);});});};}function emit(_0x316ba6,_0xc2a7a6,_0x8b66f2){var _0x3ecfbc={'uri':_0x316ba6+_0x9d8c('0x3d')+_0x8b66f2};io['to'](util['format']('user:%s',_0xc2a7a6))[_0x9d8c('0x3e')](_0x9d8c('0x3f'),_0x3ecfbc);}exports['cs']=function(_0x4a341d,_0x183862,_0x43de02,_0x73d800,_0x4eafc0,_0x1519c5,_0x5038fb,_0x116cd4){var _0x5cf3d8={};var _0x2dd6b2={'Authorization':_0x9d8c('0x40')+_0x1519c5[_0x9d8c('0x41')]};_0x1519c5['remoteUri']=intUtil['stripTrailingSlash'](_0x1519c5[_0x9d8c('0x42')]);_0x1519c5[_0x9d8c('0x43')]=intUtil[_0x9d8c('0x44')](_0x1519c5[_0x9d8c('0x43')]);var _0x58c45d=_0x1519c5[_0x9d8c('0x42')];_0x5cf3d8[_0x9d8c('0x14')]=_0x1519c5[_0x9d8c('0x45')];_0x5cf3d8['contactNumber']=_0x116cd4['toLowerCase']()==='outbound'?_0x183862[_0x9d8c('0x46')]:_0x183862['calleridnum'];_0x5cf3d8['callDirection']=_0x116cd4==='queue'||_0x116cd4===_0x9d8c('0x47')?_0x9d8c('0x48'):_0x9d8c('0x49');if(_0x73d800){_0x5cf3d8['agentEmail']=_0x73d800[_0x9d8c('0x1f')];}var _0x20253b=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1519c5['serverUrl'],_0x183862['uniqueid'],md5(_0x183862['uniqueid']));if(_0x4eafc0&&_0x4eafc0[_0x9d8c('0x4a')]){logger[_0x9d8c('0x15')](_0x9d8c('0x4b'),_0x9d8c('0x4c'));_0x183862[_0x9d8c('0x4d')]=_0x20253b;}else if(_0x5038fb&&_0x5038fb[_0x9d8c('0x4e')]&&_0x5038fb[_0x9d8c('0x4e')]!=='none'){logger['info'](_0x9d8c('0x4f'),'Recording\x20is\x20enabled!');_0x183862[_0x9d8c('0x4d')]=_0x20253b;}else{_0x183862[_0x9d8c('0x4d')]='';}return getAdminId(_0x5cf3d8,_0x116cd4,_0x2dd6b2,_0x58c45d)[_0x9d8c('0x11')](getUser(_0x116cd4,_0x2dd6b2,_0x58c45d))[_0x9d8c('0x11')](getEndUser(_0x116cd4,_0x2dd6b2,_0x58c45d))[_0x9d8c('0x11')](getTicket(_0x116cd4,_0x2dd6b2,_0x58c45d,_0x43de02,_0x183862))[_0x9d8c('0x11')](function(_0x3126fe){logger[_0x9d8c('0x15')](util[_0x9d8c('0x28')](_0x9d8c('0x50'),_0x3126fe[_0x9d8c('0x3a')]));if(_0x116cd4!==_0x9d8c('0x47')){logger[_0x9d8c('0x15')]('['+[_0x116cd4['toUpperCase']()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x58c45d,_0x73d800[_0x9d8c('0x51')],_0x3126fe[_0x9d8c('0x2c')]);}})[_0x9d8c('0x23')](function(_0x44ae31){logger['error']('['+[_0x116cd4[_0x9d8c('0x19')]()]+_0x9d8c('0x52'),util[_0x9d8c('0x53')](_0x44ae31,{'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 383944d..76fcb97 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 _0x81d1=['util','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','servicenow','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','lodash'];(function(_0x152ee9,_0x1be480){var _0x52a994=function(_0x3c0816){while(--_0x3c0816){_0x152ee9['push'](_0x152ee9['shift']());}};_0x52a994(++_0x1be480);}(_0x81d1,0x13f));var _0x181d=function(_0x36436d,_0x20292c){_0x36436d=_0x36436d-0x0;var _0x34615d=_0x81d1[_0x36436d];return _0x34615d;};'use strict';var _=require(_0x181d('0x0'));var util=require(_0x181d('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x181d('0x2'));var sugarcrm=require(_0x181d('0x3'));var freshdesk=require(_0x181d('0x4'));var zoho=require(_0x181d('0x5'));var desk=require(_0x181d('0x6'));var vtiger=require(_0x181d('0x7'));var servicenow=require(_0x181d('0x8'));var dynamics365=require(_0x181d('0x9'));var freshsales=require(_0x181d('0xa'));var integrations=[_0x181d('0xb'),_0x181d('0xc'),_0x181d('0xd'),_0x181d('0xe'),_0x181d('0xf'),_0x181d('0x10'),_0x181d('0x11'),_0x181d('0x12'),'freshsales','servicenow'];exports[_0x181d('0x13')]=function(_0x3b57cc,_0x3daa6f,_0x567ba7,_0x58a14b,_0x480a50,_0x290c6b){if(_0x567ba7){if(_[_0x181d('0x14')](integrations,_0x3b57cc[_0x181d('0x15')]['toLowerCase']())){try{var _0x3f5afb=null;var _0x45c4a5='';var _0x16bf08=_0x567ba7[_0x3b57cc[_0x181d('0x15')][_0x181d('0x16')]()];if(_0x16bf08){var _0x2b9f4f=_0x16bf08[_0x3b57cc[_0x181d('0x17')]];if(_0x2b9f4f){var _0x4a5c93=_[_0x181d('0x18')](_0x2b9f4f[_0x181d('0x19')],{'id':parseInt(_0x3b57cc[_0x181d('0x1a')],0xa)});if(_0x4a5c93){if(_0x58a14b){if(_0x480a50&&_0x3daa6f[_0x181d('0x1b')]){_0x45c4a5=_0x181d('0x1b');}else if(_0x3daa6f[_0x181d('0x1c')]){_0x45c4a5=_0x181d('0x1d');}else{console[_0x181d('0x1e')](_0x181d('0x1f'),_0x3daa6f);}}else{_0x45c4a5=_0x181d('0x20');}switch(_0x3b57cc[_0x181d('0x15')]['toLowerCase']()){case _0x181d('0xb'):zendesk[_0x45c4a5](_0x3b57cc,_0x3daa6f,_0x4a5c93,_0x58a14b,_0x480a50,_0x2b9f4f,_0x290c6b);break;case _0x181d('0xc'):salesforce[_0x45c4a5](_0x3b57cc,_0x3daa6f,_0x4a5c93,_0x58a14b,_0x480a50,_0x2b9f4f,_0x290c6b);break;case _0x181d('0xd'):sugarcrm[_0x45c4a5](_0x3b57cc,_0x3daa6f,_0x4a5c93,_0x58a14b,_0x480a50,_0x2b9f4f,_0x290c6b);break;case'freshdesk':freshdesk[_0x45c4a5](_0x3b57cc,_0x3daa6f,_0x4a5c93,_0x58a14b,_0x480a50,_0x2b9f4f,_0x290c6b);break;case'zoho':zoho[_0x45c4a5](_0x3b57cc,_0x3daa6f,_0x4a5c93,_0x58a14b,_0x480a50,_0x2b9f4f,_0x290c6b);break;case _0x181d('0x10'):desk[_0x45c4a5](_0x3b57cc,_0x3daa6f,_0x4a5c93,_0x58a14b,_0x480a50,_0x2b9f4f,_0x290c6b);break;case _0x181d('0x11'):vtiger[_0x45c4a5](_0x3b57cc,_0x3daa6f,_0x4a5c93,_0x58a14b,_0x480a50,_0x2b9f4f,_0x290c6b);break;case'freshsales':freshsales['cs'](_0x3b57cc,_0x3daa6f,_0x4a5c93,_0x58a14b,_0x480a50,_0x2b9f4f,_0x290c6b,_0x45c4a5);break;case _0x181d('0x21'):servicenow['cs'](_0x3b57cc,_0x3daa6f,_0x4a5c93,_0x58a14b,_0x480a50,_0x2b9f4f,_0x290c6b,_0x45c4a5);break;case _0x181d('0x12'):dynamics365['cs'](_0x3b57cc,_0x3daa6f,_0x4a5c93,_0x58a14b,_0x480a50,_0x2b9f4f,_0x290c6b,_0x45c4a5);break;default:console[_0x181d('0x1e')](_0x181d('0x22'));}}else{_0x3f5afb=require(_0x181d('0x23'))(_0x3b57cc[_0x181d('0x15')][_0x181d('0x16')]());_0x3f5afb[_0x181d('0x24')](_0x181d('0x25'),util[_0x181d('0x26')]('%s\x20configuration\x20#%s\x20not\x20found',_0x3b57cc[_0x181d('0x15')][_0x181d('0x16')](),_0x3b57cc[_0x181d('0x1a')]));}}else{_0x3f5afb=require(_0x181d('0x23'))(_0x3b57cc[_0x181d('0x15')]['toLowerCase']());_0x3f5afb[_0x181d('0x24')](_0x181d('0x25'),util['format'](_0x181d('0x27'),_0x3b57cc[_0x181d('0x15')]['toLowerCase'](),_0x3b57cc[_0x181d('0x17')]));}}else{}}catch(_0x4bc5de){console[_0x181d('0x24')](_0x4bc5de);}}}}; \ No newline at end of file +var _0x84eb=['./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','sugarcrm','freshdesk','zoho','vtiger','dynamics365','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','salesforce','desk','unknown\x20integration','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','util','./sugarcrm','./zoho'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x84eb,0x107));var _0xb84e=function(_0xe7785a,_0x199def){_0xe7785a=_0xe7785a-0x0;var _0x124d7a=_0x84eb[_0xe7785a];return _0x124d7a;};'use strict';var _=require('lodash');var util=require(_0xb84e('0x0'));var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require(_0xb84e('0x1'));var freshdesk=require('./freshdesk');var zoho=require(_0xb84e('0x2'));var desk=require(_0xb84e('0x3'));var vtiger=require(_0xb84e('0x4'));var servicenow=require(_0xb84e('0x5'));var dynamics365=require(_0xb84e('0x6'));var freshsales=require(_0xb84e('0x7'));var integrations=[_0xb84e('0x8'),'salesforce',_0xb84e('0x9'),_0xb84e('0xa'),_0xb84e('0xb'),'desk',_0xb84e('0xc'),_0xb84e('0xd'),'freshsales',_0xb84e('0xe')];exports[_0xb84e('0xf')]=function(_0x29d514,_0x1916f0,_0x35895d,_0x77001b,_0x254d90,_0x7e933f){if(_0x35895d){if(_[_0xb84e('0x10')](integrations,_0x29d514[_0xb84e('0x11')][_0xb84e('0x12')]())){try{var _0x4241c9=null;var _0x3fafce='';var _0x16595e=_0x35895d[_0x29d514[_0xb84e('0x11')][_0xb84e('0x12')]()];if(_0x16595e){var _0x2c7e06=_0x16595e[_0x29d514[_0xb84e('0x13')]];if(_0x2c7e06){var _0x134d87=_[_0xb84e('0x14')](_0x2c7e06[_0xb84e('0x15')],{'id':parseInt(_0x29d514[_0xb84e('0x16')],0xa)});if(_0x134d87){if(_0x77001b){if(_0x254d90&&_0x1916f0[_0xb84e('0x17')]){_0x3fafce=_0xb84e('0x17');}else if(_0x1916f0[_0xb84e('0x18')]){_0x3fafce=_0xb84e('0x19');}else{console[_0xb84e('0x1a')](_0xb84e('0x1b'),_0x1916f0);}}else{_0x3fafce=_0xb84e('0x1c');}switch(_0x29d514[_0xb84e('0x11')][_0xb84e('0x12')]()){case _0xb84e('0x8'):zendesk[_0x3fafce](_0x29d514,_0x1916f0,_0x134d87,_0x77001b,_0x254d90,_0x2c7e06,_0x7e933f);break;case _0xb84e('0x1d'):salesforce[_0x3fafce](_0x29d514,_0x1916f0,_0x134d87,_0x77001b,_0x254d90,_0x2c7e06,_0x7e933f);break;case _0xb84e('0x9'):sugarcrm[_0x3fafce](_0x29d514,_0x1916f0,_0x134d87,_0x77001b,_0x254d90,_0x2c7e06,_0x7e933f);break;case'freshdesk':freshdesk[_0x3fafce](_0x29d514,_0x1916f0,_0x134d87,_0x77001b,_0x254d90,_0x2c7e06,_0x7e933f);break;case _0xb84e('0xb'):zoho[_0x3fafce](_0x29d514,_0x1916f0,_0x134d87,_0x77001b,_0x254d90,_0x2c7e06,_0x7e933f);break;case _0xb84e('0x1e'):desk[_0x3fafce](_0x29d514,_0x1916f0,_0x134d87,_0x77001b,_0x254d90,_0x2c7e06,_0x7e933f);break;case _0xb84e('0xc'):vtiger[_0x3fafce](_0x29d514,_0x1916f0,_0x134d87,_0x77001b,_0x254d90,_0x2c7e06,_0x7e933f);break;case'freshsales':freshsales['cs'](_0x29d514,_0x1916f0,_0x134d87,_0x77001b,_0x254d90,_0x2c7e06,_0x7e933f,_0x3fafce);break;case _0xb84e('0xe'):servicenow['cs'](_0x29d514,_0x1916f0,_0x134d87,_0x77001b,_0x254d90,_0x2c7e06,_0x7e933f,_0x3fafce);break;case _0xb84e('0xd'):dynamics365['cs'](_0x29d514,_0x1916f0,_0x134d87,_0x77001b,_0x254d90,_0x2c7e06,_0x7e933f,_0x3fafce);break;default:console['log'](_0xb84e('0x1f'));}}else{_0x4241c9=require('../../../../config/logger')(_0x29d514[_0xb84e('0x11')][_0xb84e('0x12')]());_0x4241c9[_0xb84e('0x20')](_0xb84e('0x21'),util[_0xb84e('0x22')](_0xb84e('0x23'),_0x29d514[_0xb84e('0x11')]['toLowerCase'](),_0x29d514[_0xb84e('0x16')]));}}else{_0x4241c9=require(_0xb84e('0x24'))(_0x29d514[_0xb84e('0x11')][_0xb84e('0x12')]());_0x4241c9[_0xb84e('0x20')](_0xb84e('0x21'),util[_0xb84e('0x22')](_0xb84e('0x25'),_0x29d514[_0xb84e('0x11')]['toLowerCase'](),_0x29d514[_0xb84e('0x13')]));}}else{}}catch(_0x4a4d91){console['error'](_0x4a4d91);}}}}; \ 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 e48404e..0f8a567 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 _0xfa96=['Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','display_name','identity','moduleSearch','cloneDeep','additionalSearchContact','$or','Contact','execute','additionalSearchLead','merge','Lead','account_contact_lead','additionalSearchAccount','Account','first','Name','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','upperFirst','forEach','includes','string','picklist','idField','content','variable','variableName','toString','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','[QUEUE]','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','catch','lastevent','toUpperCase','calleridnum',']\x20Ticket\x20%s\x20created.','lodash','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','Subjects','getString','Descriptions','ticketType','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','ContactId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','validateEmail','sobject','User','find','then','length','Email','Agent\x20%s\x20found.','resolve'];(function(_0x1c0f41,_0x26d95d){var _0x369a9f=function(_0x251234){while(--_0x251234){_0x1c0f41['push'](_0x1c0f41['shift']());}};_0x369a9f(++_0x26d95d);}(_0xfa96,0x1e0));var _0x6fa9=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xfa96[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0x6fa9('0x0'));var rp=require('request-promise');var moment=require(_0x6fa9('0x1'));var BPromise=require(_0x6fa9('0x2'));var md5=require(_0x6fa9('0x3'));var jsforce=require(_0x6fa9('0x4'));var util=require(_0x6fa9('0x5'));var Redis=require(_0x6fa9('0x6'));var intUtil=require(_0x6fa9('0x7'));var config=require(_0x6fa9('0x8'));var logger=require(_0x6fa9('0x9'))(_0x6fa9('0xa'));config[_0x6fa9('0xb')]=_[_0x6fa9('0xc')](config['redis'],{'host':_0x6fa9('0xd'),'port':0x18eb});var io=require(_0x6fa9('0xe'))(new Redis(config['redis']));function emit(_0x25a8d9,_0x2557bf,_0x279326){io['to'](_0x25a8d9)[_0x6fa9('0xf')](_0x2557bf,_0x279326);}function getTicket(_0x107912,_0x12fb20,_0x46ef7c,_0x269112,_0x17914f,_0x10b513,_0x230907,_0x268771){var _0x4d1b96=Object['assign']({},{'OwnerId':_0x12fb20['id'],'Subject':intUtil['getString'](_0x269112[_0x6fa9('0x10')],_0x17914f,'\x20'),'Description':intUtil[_0x6fa9('0x11')](_0x269112[_0x6fa9('0x12')],_0x17914f,'\x0a')},getCustomFields(_0x10b513,_0x17914f));if(_0x46ef7c){if(_0x269112[_0x6fa9('0x13')]==='Task'){_0x4d1b96['ActivityDate']=moment[_0x6fa9('0x14')]();_0x4d1b96[_0x6fa9('0x15')]=![];_0x4d1b96[_0x6fa9('0x16')]=![];if(_0x46ef7c[_0x6fa9('0x17')]===_0x6fa9('0x18')||_0x46ef7c[_0x6fa9('0x17')]===_0x6fa9('0x19')){_0x4d1b96[_0x6fa9('0x1a')]=_0x46ef7c['id'];}else if(_0x46ef7c[_0x6fa9('0x17')]===_0x6fa9('0x1b')){_0x4d1b96[_0x6fa9('0x1c')]=_0x46ef7c['id'];}}else if(_0x269112[_0x6fa9('0x13')]==='Case'){if(_0x46ef7c[_0x6fa9('0x17')]==='contact'){_0x4d1b96[_0x6fa9('0x1d')]=_0x46ef7c['id'];}else if(_0x46ef7c[_0x6fa9('0x17')]===_0x6fa9('0x1b')){_0x4d1b96['AccountId']=_0x46ef7c['id'];}else if(_0x46ef7c['endUserType']===_0x6fa9('0x19')&&_0x269112['leadId']){_0x4d1b96[_0x269112[_0x6fa9('0x1e')]]=_0x46ef7c['id'];}else{logger[_0x6fa9('0x1f')](_0x6fa9('0x20'));}}}return _0x230907['sobject'](_0x269112[_0x6fa9('0x13')])[_0x6fa9('0x21')](_0x4d1b96);}function getUser(_0x53907e,_0x18cb4b,_0x5a1fc8){if(!_[_0x6fa9('0x22')](_0x18cb4b)&&intUtil[_0x6fa9('0x23')](_0x18cb4b)){var _0x50c4b9={'Email':_0x18cb4b};var _0x39c14d={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5a1fc8[_0x6fa9('0x24')](_0x6fa9('0x25'))[_0x6fa9('0x26')](_0x50c4b9,_0x39c14d)['execute']()[_0x6fa9('0x27')](function(_0x4b72d9){if(_0x4b72d9[_0x6fa9('0x28')]){var _0x47b4cc=_['find'](_0x4b72d9,function(_0x31af53){return _0x31af53[_0x6fa9('0x29')]===_0x18cb4b;});if(_0x47b4cc){logger[_0x6fa9('0x1f')](_0x6fa9('0x2a'),_0x18cb4b);return BPromise[_0x6fa9('0x2b')]({'id':_0x47b4cc['Id'],'name':_0x47b4cc['Name']});}}else{logger[_0x6fa9('0x1f')](_0x6fa9('0x2c'),_0x18cb4b);return _0x5a1fc8['identity']()[_0x6fa9('0x27')](function(_0x3601fe){return BPromise[_0x6fa9('0x2b')]({'id':_0x3601fe[_0x6fa9('0x2d')],'name':_0x3601fe[_0x6fa9('0x2e')]});});}});}else{logger['info'](_0x6fa9('0x2c'),_0x18cb4b);return _0x5a1fc8[_0x6fa9('0x2f')]()[_0x6fa9('0x27')](function(_0x5569ac){return BPromise[_0x6fa9('0x2b')]({'id':_0x5569ac[_0x6fa9('0x2d')],'name':_0x5569ac['display_name']});});}}function getEndUser(_0x1ccdcf,_0x162592,_0x66e688,_0x59933c,_0x5a6482){var _0x31216e={'$or':{'Phone':_0x59933c}};var _0x20539b={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x6fa9('0x2b')]()['then'](function(){logger[_0x6fa9('0x1f')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x59933c,_0x162592[_0x6fa9('0x30')]);switch(_0x162592['moduleSearch']){case'contact_lead':var _0x5d9361=_[_0x6fa9('0x31')](_0x31216e);if(_0x162592[_0x6fa9('0x32')]){var _0x2bf920={};_0x2bf920[_0x162592[_0x6fa9('0x32')]]=_0x59933c;_['merge'](_0x5d9361[_0x6fa9('0x33')],_0x2bf920);}return _0x5a6482[_0x6fa9('0x24')](_0x6fa9('0x34'))[_0x6fa9('0x26')](_0x5d9361,_0x20539b)[_0x6fa9('0x35')]()['then'](function(_0x40e277){if(_0x40e277&&_0x40e277[_0x6fa9('0x28')]){return _0x40e277;}else{var _0x225552=_[_0x6fa9('0x31')](_0x31216e);if(_0x162592['additionalSearchLead']){var _0x38e6c2={};_0x38e6c2[_0x162592[_0x6fa9('0x36')]]=_0x59933c;_[_0x6fa9('0x37')](_0x225552[_0x6fa9('0x33')],_0x38e6c2);}return _0x5a6482[_0x6fa9('0x24')](_0x6fa9('0x38'))[_0x6fa9('0x26')](_0x225552,_0x20539b);}});case _0x6fa9('0x39'):var _0xfaf398=_[_0x6fa9('0x31')](_0x31216e);if(_0x162592[_0x6fa9('0x3a')]){var _0x2bf920={};_0x2bf920[_0x162592[_0x6fa9('0x3a')]]=_0x59933c;_[_0x6fa9('0x37')](_0xfaf398['$or'],_0x2bf920);}return _0x5a6482[_0x6fa9('0x24')](_0x6fa9('0x3b'))[_0x6fa9('0x26')](_0xfaf398,_0x20539b)[_0x6fa9('0x35')]()[_0x6fa9('0x27')](function(_0x505235){if(_0x505235&&_0x505235[_0x6fa9('0x28')]){return _0x505235;}else{var _0x1005dc=_[_0x6fa9('0x31')](_0x31216e);if(_0x162592['additionalSearchContact']){var _0x42776b={};_0x42776b[_0x162592[_0x6fa9('0x32')]]=_0x59933c;_[_0x6fa9('0x37')](_0x1005dc[_0x6fa9('0x33')],_0x42776b);}return _0x5a6482[_0x6fa9('0x24')](_0x6fa9('0x34'))[_0x6fa9('0x26')](_0x1005dc,_0x20539b)[_0x6fa9('0x27')](function(_0x3c6a4d){if(_0x3c6a4d&&_0x3c6a4d[_0x6fa9('0x28')]){return _0x3c6a4d;}else{var _0x47ad96=_['cloneDeep'](_0x31216e);if(_0x162592['additionalSearchLead']){var _0x47a22b={};_0x47a22b[_0x162592[_0x6fa9('0x36')]]=_0x59933c;_[_0x6fa9('0x37')](_0x47ad96[_0x6fa9('0x33')],_0x47a22b);}return _0x5a6482['sobject'](_0x6fa9('0x38'))['find'](_0x47ad96,_0x20539b);}});}});case _0x6fa9('0x18'):var _0x5d9361=_[_0x6fa9('0x31')](_0x31216e);if(_0x162592[_0x6fa9('0x32')]){var _0x2bf920={};_0x2bf920[_0x162592[_0x6fa9('0x32')]]=_0x59933c;_[_0x6fa9('0x37')](_0x5d9361[_0x6fa9('0x33')],_0x2bf920);}return _0x5a6482[_0x6fa9('0x24')](_0x6fa9('0x34'))[_0x6fa9('0x26')](_0x5d9361,_0x20539b)[_0x6fa9('0x35')]();case _0x6fa9('0x19'):var _0x379a11=_[_0x6fa9('0x31')](_0x31216e);if(_0x162592[_0x6fa9('0x36')]){var _0x2bf920={};_0x2bf920[_0x162592[_0x6fa9('0x36')]]=_0x59933c;_[_0x6fa9('0x37')](_0x379a11['$or'],_0x2bf920);}return _0x5a6482[_0x6fa9('0x24')](_0x6fa9('0x38'))[_0x6fa9('0x26')](_0x379a11,_0x20539b);case _0x6fa9('0x1b'):var _0xfaf398=_[_0x6fa9('0x31')](_0x31216e);if(_0x162592[_0x6fa9('0x3a')]){var _0x2bf920={};_0x2bf920[_0x162592[_0x6fa9('0x3a')]]=_0x59933c;_[_0x6fa9('0x37')](_0xfaf398[_0x6fa9('0x33')],_0x2bf920);}return _0x5a6482[_0x6fa9('0x24')](_0x6fa9('0x3b'))[_0x6fa9('0x26')](_0xfaf398,_0x20539b);default:return null;}})[_0x6fa9('0x27')](function(_0x3c93f3){if(_0x3c93f3&&_0x3c93f3[_0x6fa9('0x28')]){var _0x711932=_[_0x6fa9('0x3c')](_0x3c93f3);if(_0x711932){return BPromise[_0x6fa9('0x2b')]({'id':_0x711932['Id'],'name':_0x711932[_0x6fa9('0x3d')],'phone':_0x711932[_0x6fa9('0x3e')],'endUserType':_0x711932[_0x6fa9('0x3f')][_0x6fa9('0x40')][_0x6fa9('0x41')]()});}}})[_0x6fa9('0x27')](function(_0x5bf088){if(_0x5bf088){logger[_0x6fa9('0x1f')](_0x6fa9('0x42'),_0x5bf088[_0x6fa9('0x17')],_0x59933c);return BPromise[_0x6fa9('0x2b')](_0x5bf088);}else{logger[_0x6fa9('0x1f')](_0x6fa9('0x43'),_0x59933c);var _0x4466f0={'Phone':_0x59933c};if(_0x162592[_0x6fa9('0x44')]){if(_0x162592['moduleCreate']==='contact'){logger['info'](_0x6fa9('0x45'),_0x59933c,_0x162592[_0x6fa9('0x44')]);_0x4466f0[_0x6fa9('0x46')]=_0x66e688!==_0x6fa9('0x47')?_0x66e688:util[_0x6fa9('0x48')](_0x6fa9('0x49'),_0x59933c);}else if(_0x162592[_0x6fa9('0x44')]===_0x6fa9('0x19')){logger[_0x6fa9('0x1f')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x59933c,_0x162592[_0x6fa9('0x44')]);_0x4466f0[_0x6fa9('0x46')]=_0x66e688!==''?_0x66e688:util[_0x6fa9('0x48')](_0x6fa9('0x49'),_0x59933c);_0x4466f0['Company']='No\x20Company';}else if(_0x162592[_0x6fa9('0x44')]===_0x6fa9('0x1b')){logger['info'](_0x6fa9('0x45'),_0x59933c,_0x162592[_0x6fa9('0x44')]);_0x4466f0[_0x6fa9('0x3d')]=_0x66e688!==''?_0x66e688:util['format'](_0x6fa9('0x49'),_0x59933c);}else{return null;}}return _0x5a6482[_0x6fa9('0x24')](_[_0x6fa9('0x4a')](_0x162592[_0x6fa9('0x44')]))[_0x6fa9('0x21')](_0x4466f0)[_0x6fa9('0x27')](function(_0x49ad44){return BPromise['resolve']({'id':_0x49ad44['id'],'endUserType':_0x162592[_0x6fa9('0x44')]});});}});}function getCustomFields(_0x255430,_0x3f535){var _0x55c580={};if(_0x255430[_0x6fa9('0x28')]>0x0){_[_0x6fa9('0x4b')](_0x255430,function(_0x304586){if(_[_0x6fa9('0x4c')]([_0x6fa9('0x4d'),_0x6fa9('0x4e')],_0x304586[_0x6fa9('0x40')])&&_0x304586[_0x6fa9('0x4f')]){_0x55c580[_0x304586[_0x6fa9('0x4f')]]=_0x304586[_0x6fa9('0x50')]['toString']();}else if(_0x304586['type']===_0x6fa9('0x51')&&_0x304586['variableName']&&_0x304586['idField']){_0x3f535[_0x304586[_0x6fa9('0x52')]]&&(_0x55c580[_0x304586[_0x6fa9('0x4f')]]=_0x3f535[_0x304586[_0x6fa9('0x52')]][_0x6fa9('0x53')]());}else if(_0x304586[_0x6fa9('0x40')]==='customVariable'&&_0x304586[_0x6fa9('0x54')]&&_0x304586[_0x6fa9('0x54')][_0x6fa9('0x55')]&&_0x304586['idField']){_0x3f535[_0x304586[_0x6fa9('0x54')]['name'][_0x6fa9('0x41')]()]&&(_0x55c580[_0x304586['idField']]=_0x3f535[_0x304586[_0x6fa9('0x54')]['name'][_0x6fa9('0x41')]()][_0x6fa9('0x53')]());}});}return _0x55c580;}function getConnection(_0x36aafa){var _0x1bce82=_0x36aafa[_0x6fa9('0x56')][_0x6fa9('0x57')](_0x36aafa[_0x6fa9('0x58')]);var _0x7e253a=new jsforce[(_0x6fa9('0x59'))]({'oauth2':{'loginUrl':_0x36aafa[_0x6fa9('0x5a')]||_0x6fa9('0x5b'),'clientId':_0x36aafa[_0x6fa9('0x5c')],'clientSecret':_0x36aafa[_0x6fa9('0x5d')]}});return _0x7e253a[_0x6fa9('0x5e')](_0x36aafa[_0x6fa9('0x5f')],_0x1bce82)[_0x6fa9('0x27')](function(){logger[_0x6fa9('0x1f')]('Connection\x20established.');return _0x7e253a;});}exports[_0x6fa9('0x60')]=function(_0xb15cc4,_0x30818b,_0x16dbb4,_0x179caa,_0xd38f2a,_0x7bec7e){var _0x381b92,_0x36a860,_0x2a983b,_0x2cba41;_0x7bec7e['serverUrl']=intUtil[_0x6fa9('0x61')](_0x7bec7e[_0x6fa9('0x62')]);_0x7bec7e['remoteUri']=intUtil[_0x6fa9('0x61')](_0x7bec7e[_0x6fa9('0x5a')]);if(_0xd38f2a&&_0xd38f2a[_0x6fa9('0x63')]){logger['info']('[QUEUE]',_0x6fa9('0x64'));_0x30818b[_0x6fa9('0x65')]=util[_0x6fa9('0x48')](_0x6fa9('0x66'),_0x7bec7e[_0x6fa9('0x62')],_0x30818b[_0x6fa9('0x67')],md5(_0x30818b[_0x6fa9('0x67')]));}else{_0x30818b[_0x6fa9('0x65')]='';}return getConnection(_0x7bec7e)[_0x6fa9('0x27')](function(_0x30ecfb){_0x2cba41=_0x30ecfb;return getUser(_0x7bec7e,_0x179caa[_0x6fa9('0x68')],_0x2cba41);})[_0x6fa9('0x27')](function(_0x529e6f){_0x381b92=_0x529e6f;return getEndUser(_0x7bec7e,_0x16dbb4,_0x30818b[_0x6fa9('0x69')],_0x30818b['calleridnum'],_0x2cba41);})['then'](function(_0x3dfee6){_0x36a860=_0x3dfee6;return getTicket(_0x7bec7e,_0x381b92,_0x36a860,_0x16dbb4,_0x30818b,_0x16dbb4['Fields'],_0x2cba41,'queue');})[_0x6fa9('0x27')](function(_0x292084){_0x2a983b=_0x292084;logger[_0x6fa9('0x1f')](_0x6fa9('0x6a'),_0x2a983b['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x2a983b['id'],_0x179caa['name'],_0x7bec7e[_0x6fa9('0x40')]);switch(_0x7bec7e[_0x6fa9('0x40')]){case _0x6fa9('0x6b'):emit(util[_0x6fa9('0x48')](_0x6fa9('0x6c'),_0x179caa[_0x6fa9('0x55')]),_0x6fa9('0x6d'),{'recordId':_0x2a983b['id']});break;case _0x6fa9('0x6e'):emit(util[_0x6fa9('0x48')](_0x6fa9('0x6c'),_0x179caa[_0x6fa9('0x55')]),_0x6fa9('0x6f'),{'uri':util[_0x6fa9('0x48')](_0x6fa9('0x70'),_0x2cba41['instanceUrl'],_0x2a983b['id'])});break;default:logger[_0x6fa9('0x71')](_0x6fa9('0x72'));}})['catch'](function(_0x371a28){logger[_0x6fa9('0x71')](_0x6fa9('0x73'),_0x371a28);});};exports[_0x6fa9('0x74')]=function(_0x417e40,_0xb8c29d,_0x444fb0,_0xd52325,_0x26ebea,_0x113cf5,_0x5f564c){var _0x266ff7,_0x23bed6,_0x36f3d1,_0x8aa5a9;_0x113cf5['serverUrl']=intUtil[_0x6fa9('0x61')](_0x113cf5[_0x6fa9('0x62')]);_0x113cf5[_0x6fa9('0x5a')]=intUtil[_0x6fa9('0x61')](_0x113cf5[_0x6fa9('0x5a')]);if(_0x5f564c&&_0x5f564c[_0x6fa9('0x75')]&&_0x5f564c[_0x6fa9('0x75')]!=='none'){logger[_0x6fa9('0x1f')](_0x6fa9('0x76'),_0x6fa9('0x64'));_0xb8c29d[_0x6fa9('0x65')]=util[_0x6fa9('0x48')](_0x6fa9('0x66'),_0x113cf5[_0x6fa9('0x62')],_0xb8c29d[_0x6fa9('0x67')],md5(_0xb8c29d['uniqueid']));}return getConnection(_0x113cf5)[_0x6fa9('0x27')](function(_0x1027ec){_0x8aa5a9=_0x1027ec;return getUser(_0x113cf5,_0xd52325['email'],_0x8aa5a9);})[_0x6fa9('0x27')](function(_0x533be2){_0x266ff7=_0x533be2;return getEndUser(_0x113cf5,_0x444fb0,_0xb8c29d[_0x6fa9('0x77')],_0xb8c29d[_0x6fa9('0x78')],_0x8aa5a9);})[_0x6fa9('0x27')](function(_0x5030b8){_0x23bed6=_0x5030b8;return getTicket(_0x113cf5,_0x266ff7,_0x23bed6,_0x444fb0,_0xb8c29d,_0x444fb0[_0x6fa9('0x79')],_0x8aa5a9,_0x6fa9('0x74'));})[_0x6fa9('0x27')](function(_0x186e6b){_0x36f3d1=_0x186e6b;logger[_0x6fa9('0x1f')](_0x6fa9('0x7a'),_0x36f3d1['id']);logger[_0x6fa9('0x1f')](_0x6fa9('0x7b'),_0x36f3d1['id'],_0xd52325['name'],_0x113cf5['type']);switch(_0x113cf5[_0x6fa9('0x40')]){case _0x6fa9('0x6b'):emit(util['format']('user:%s',_0xd52325[_0x6fa9('0x55')]),_0x6fa9('0x6d'),{'recordId':_0x36f3d1['id']});break;case _0x6fa9('0x6e'):emit(util[_0x6fa9('0x48')](_0x6fa9('0x6c'),_0xd52325[_0x6fa9('0x55')]),_0x6fa9('0x6f'),{'uri':util['format'](_0x6fa9('0x70'),_0x8aa5a9[_0x6fa9('0x7c')],_0x36f3d1['id'])});break;default:logger[_0x6fa9('0x71')](_0x6fa9('0x76'),_0x6fa9('0x7d'));}})[_0x6fa9('0x7e')](function(_0x3b3207){logger[_0x6fa9('0x71')](_0x6fa9('0x76'),_0x3b3207);});};exports['unmanaged']=function(_0x575a37,_0x5c620b,_0x1b111c,_0xa4b2c6,_0x299a75,_0x51a5c3){var _0x34aa01,_0x1e233f,_0x55b9cd,_0x2d3b35;_0x51a5c3[_0x6fa9('0x62')]=intUtil['stripTrailingSlash'](_0x51a5c3[_0x6fa9('0x62')]);_0x51a5c3['remoteUri']=intUtil['stripTrailingSlash'](_0x51a5c3[_0x6fa9('0x5a')]);if(_0x299a75&&_0x299a75[_0x6fa9('0x63')]){logger[_0x6fa9('0x1f')]('['+_0x5c620b[_0x6fa9('0x7f')][_0x6fa9('0x80')]()+']',_0x6fa9('0x64'));_0x5c620b[_0x6fa9('0x65')]=util[_0x6fa9('0x48')](_0x6fa9('0x66'),_0x51a5c3[_0x6fa9('0x62')],_0x5c620b[_0x6fa9('0x67')],md5(_0x5c620b[_0x6fa9('0x67')]));}else{_0x5c620b[_0x6fa9('0x65')]='';}return getConnection(_0x51a5c3)['then'](function(_0x32b1e7){_0x2d3b35=_0x32b1e7;if(!_[_0x6fa9('0x22')](_0xa4b2c6)){return getUser(_0x51a5c3,_0xa4b2c6[_0x6fa9('0x55')],_0x2d3b35);}else{return getUser(_0x51a5c3,null,_0x2d3b35);}})[_0x6fa9('0x27')](function(_0x256663){_0x34aa01=_0x256663;return getEndUser(_0x51a5c3,_0x1b111c,_0x5c620b['calleridname'],_0x5c620b[_0x6fa9('0x81')],_0x2d3b35);})[_0x6fa9('0x27')](function(_0x23de58){_0x1e233f=_0x23de58;return getTicket(_0x51a5c3,_0x34aa01,_0x1e233f,_0x1b111c,_0x5c620b,_0x1b111c['Fields'],_0x2d3b35);})[_0x6fa9('0x27')](function(_0xeef7d0){_0x55b9cd=_0xeef7d0;logger[_0x6fa9('0x1f')]('['+_0x5c620b['lastevent'][_0x6fa9('0x80')]()+_0x6fa9('0x82'),_0x55b9cd['id']);logger[_0x6fa9('0x1f')]('['+_0x5c620b[_0x6fa9('0x7f')][_0x6fa9('0x80')]()+']\x20Integration\x20account\x20type\x20%s.',_0x51a5c3[_0x6fa9('0x40')]);})[_0x6fa9('0x7e')](function(_0x4fa124){logger[_0x6fa9('0x71')]('['+_0x5c620b[_0x6fa9('0x7f')][_0x6fa9('0x80')]()+']',_0x4fa124);});}; \ No newline at end of file +var _0xfc62=['Descriptions','ticketType','utc','IsReminderSet','endUserType','contact','WhoId','WhatId','Case','ContactId','account','AccountId','lead','info','sobject','isNil','validateEmail','execute','then','length','Email','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','resolve','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','merge','$or','Contact','find','cloneDeep','additionalSearchLead','Lead','additionalSearchAccount','Account','Phone','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','','Caller\x20-\x20%s','Company','No\x20Company','format','upperFirst','create','forEach','string','picklist','type','idField','content','variable','variableName','toString','Variable','name','password','securityToken','Connection','remoteUri','https://login.salesforce.com','clientSecret','login','username','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','Fields','queue','integrationTab','user:%s','trigger:salesforce:display','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','newTab','trigger:browser:url','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','jsforce','util','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','Subjects','getString'];(function(_0x374b41,_0x2434b4){var _0x394a22=function(_0x59fb3e){while(--_0x59fb3e){_0x374b41['push'](_0x374b41['shift']());}};_0x394a22(++_0x2434b4);}(_0xfc62,0xe8));var _0x2fc6=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xfc62[_0x465a0c];return _0x1e202e;};'use strict';var _=require('lodash');var rp=require(_0x2fc6('0x0'));var moment=require(_0x2fc6('0x1'));var BPromise=require(_0x2fc6('0x2'));var md5=require(_0x2fc6('0x3'));var jsforce=require(_0x2fc6('0x4'));var util=require(_0x2fc6('0x5'));var Redis=require('ioredis');var intUtil=require(_0x2fc6('0x6'));var config=require(_0x2fc6('0x7'));var logger=require(_0x2fc6('0x8'))(_0x2fc6('0x9'));config[_0x2fc6('0xa')]=_[_0x2fc6('0xb')](config[_0x2fc6('0xa')],{'host':_0x2fc6('0xc'),'port':0x18eb});var io=require(_0x2fc6('0xd'))(new Redis(config[_0x2fc6('0xa')]));function emit(_0xed7da9,_0x54930b,_0x18a943){io['to'](_0xed7da9)[_0x2fc6('0xe')](_0x54930b,_0x18a943);}function getTicket(_0x1f1c2e,_0x53cbf6,_0x3bc6b6,_0x44149a,_0x559513,_0x154b9d,_0x5911a9,_0x2c9198){var _0x32eb79=Object[_0x2fc6('0xf')]({},{'OwnerId':_0x53cbf6['id'],'Subject':intUtil['getString'](_0x44149a[_0x2fc6('0x10')],_0x559513,'\x20'),'Description':intUtil[_0x2fc6('0x11')](_0x44149a[_0x2fc6('0x12')],_0x559513,'\x0a')},getCustomFields(_0x154b9d,_0x559513));if(_0x3bc6b6){if(_0x44149a[_0x2fc6('0x13')]==='Task'){_0x32eb79['ActivityDate']=moment[_0x2fc6('0x14')]();_0x32eb79[_0x2fc6('0x15')]=![];_0x32eb79['IsRecurrence']=![];if(_0x3bc6b6[_0x2fc6('0x16')]===_0x2fc6('0x17')||_0x3bc6b6[_0x2fc6('0x16')]==='lead'){_0x32eb79[_0x2fc6('0x18')]=_0x3bc6b6['id'];}else if(_0x3bc6b6[_0x2fc6('0x16')]==='account'){_0x32eb79[_0x2fc6('0x19')]=_0x3bc6b6['id'];}}else if(_0x44149a[_0x2fc6('0x13')]===_0x2fc6('0x1a')){if(_0x3bc6b6[_0x2fc6('0x16')]===_0x2fc6('0x17')){_0x32eb79[_0x2fc6('0x1b')]=_0x3bc6b6['id'];}else if(_0x3bc6b6[_0x2fc6('0x16')]===_0x2fc6('0x1c')){_0x32eb79[_0x2fc6('0x1d')]=_0x3bc6b6['id'];}else if(_0x3bc6b6[_0x2fc6('0x16')]===_0x2fc6('0x1e')&&_0x44149a['leadId']){_0x32eb79[_0x44149a['leadId']]=_0x3bc6b6['id'];}else{logger[_0x2fc6('0x1f')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x5911a9[_0x2fc6('0x20')](_0x44149a['ticketType'])['create'](_0x32eb79);}function getUser(_0x5ecf9f,_0x4ce0ae,_0x5bed5e){if(!_[_0x2fc6('0x21')](_0x4ce0ae)&&intUtil[_0x2fc6('0x22')](_0x4ce0ae)){var _0x3728ee={'Email':_0x4ce0ae};var _0x365e5e={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5bed5e[_0x2fc6('0x20')]('User')['find'](_0x3728ee,_0x365e5e)[_0x2fc6('0x23')]()[_0x2fc6('0x24')](function(_0x3b5e1d){if(_0x3b5e1d[_0x2fc6('0x25')]){var _0x111522=_['find'](_0x3b5e1d,function(_0x425a1a){return _0x425a1a[_0x2fc6('0x26')]===_0x4ce0ae;});if(_0x111522){logger[_0x2fc6('0x1f')]('Agent\x20%s\x20found.',_0x4ce0ae);return BPromise['resolve']({'id':_0x111522['Id'],'name':_0x111522[_0x2fc6('0x27')]});}}else{logger['info'](_0x2fc6('0x28'),_0x4ce0ae);return _0x5bed5e[_0x2fc6('0x29')]()[_0x2fc6('0x24')](function(_0x29d218){return BPromise['resolve']({'id':_0x29d218[_0x2fc6('0x2a')],'name':_0x29d218[_0x2fc6('0x2b')]});});}});}else{logger[_0x2fc6('0x1f')](_0x2fc6('0x28'),_0x4ce0ae);return _0x5bed5e[_0x2fc6('0x29')]()[_0x2fc6('0x24')](function(_0x589101){return BPromise['resolve']({'id':_0x589101[_0x2fc6('0x2a')],'name':_0x589101[_0x2fc6('0x2b')]});});}}function getEndUser(_0x56622d,_0x50dd40,_0x562631,_0x3854ee,_0x41111){var _0x4b1db5={'$or':{'Phone':_0x3854ee}};var _0x5b3e9a={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x2fc6('0x2c')]()['then'](function(){logger['info'](_0x2fc6('0x2d'),_0x3854ee,_0x50dd40[_0x2fc6('0x2e')]);switch(_0x50dd40['moduleSearch']){case _0x2fc6('0x2f'):var _0x302df6=_['cloneDeep'](_0x4b1db5);if(_0x50dd40['additionalSearchContact']){var _0x166b77={};_0x166b77[_0x50dd40[_0x2fc6('0x30')]]=_0x3854ee;_[_0x2fc6('0x31')](_0x302df6[_0x2fc6('0x32')],_0x166b77);}return _0x41111['sobject'](_0x2fc6('0x33'))[_0x2fc6('0x34')](_0x302df6,_0x5b3e9a)[_0x2fc6('0x23')]()[_0x2fc6('0x24')](function(_0x21c50f){if(_0x21c50f&&_0x21c50f[_0x2fc6('0x25')]){return _0x21c50f;}else{var _0x491fe3=_[_0x2fc6('0x35')](_0x4b1db5);if(_0x50dd40[_0x2fc6('0x36')]){var _0x4f6d43={};_0x4f6d43[_0x50dd40[_0x2fc6('0x36')]]=_0x3854ee;_['merge'](_0x491fe3[_0x2fc6('0x32')],_0x4f6d43);}return _0x41111[_0x2fc6('0x20')](_0x2fc6('0x37'))[_0x2fc6('0x34')](_0x491fe3,_0x5b3e9a);}});case'account_contact_lead':var _0x24df6d=_[_0x2fc6('0x35')](_0x4b1db5);if(_0x50dd40[_0x2fc6('0x38')]){var _0x166b77={};_0x166b77[_0x50dd40[_0x2fc6('0x38')]]=_0x3854ee;_[_0x2fc6('0x31')](_0x24df6d[_0x2fc6('0x32')],_0x166b77);}return _0x41111[_0x2fc6('0x20')](_0x2fc6('0x39'))['find'](_0x24df6d,_0x5b3e9a)[_0x2fc6('0x23')]()[_0x2fc6('0x24')](function(_0x578466){if(_0x578466&&_0x578466['length']){return _0x578466;}else{var _0x1dd032=_[_0x2fc6('0x35')](_0x4b1db5);if(_0x50dd40['additionalSearchContact']){var _0x2c3241={};_0x2c3241[_0x50dd40[_0x2fc6('0x30')]]=_0x3854ee;_[_0x2fc6('0x31')](_0x1dd032[_0x2fc6('0x32')],_0x2c3241);}return _0x41111[_0x2fc6('0x20')](_0x2fc6('0x33'))[_0x2fc6('0x34')](_0x1dd032,_0x5b3e9a)[_0x2fc6('0x24')](function(_0x22c938){if(_0x22c938&&_0x22c938[_0x2fc6('0x25')]){return _0x22c938;}else{var _0x2707c3=_[_0x2fc6('0x35')](_0x4b1db5);if(_0x50dd40['additionalSearchLead']){var _0x2539a9={};_0x2539a9[_0x50dd40['additionalSearchLead']]=_0x3854ee;_[_0x2fc6('0x31')](_0x2707c3['$or'],_0x2539a9);}return _0x41111[_0x2fc6('0x20')](_0x2fc6('0x37'))[_0x2fc6('0x34')](_0x2707c3,_0x5b3e9a);}});}});case _0x2fc6('0x17'):var _0x302df6=_[_0x2fc6('0x35')](_0x4b1db5);if(_0x50dd40[_0x2fc6('0x30')]){var _0x166b77={};_0x166b77[_0x50dd40[_0x2fc6('0x30')]]=_0x3854ee;_[_0x2fc6('0x31')](_0x302df6[_0x2fc6('0x32')],_0x166b77);}return _0x41111[_0x2fc6('0x20')]('Contact')[_0x2fc6('0x34')](_0x302df6,_0x5b3e9a)[_0x2fc6('0x23')]();case _0x2fc6('0x1e'):var _0x498ce8=_[_0x2fc6('0x35')](_0x4b1db5);if(_0x50dd40[_0x2fc6('0x36')]){var _0x166b77={};_0x166b77[_0x50dd40[_0x2fc6('0x36')]]=_0x3854ee;_['merge'](_0x498ce8[_0x2fc6('0x32')],_0x166b77);}return _0x41111[_0x2fc6('0x20')](_0x2fc6('0x37'))[_0x2fc6('0x34')](_0x498ce8,_0x5b3e9a);case _0x2fc6('0x1c'):var _0x24df6d=_['cloneDeep'](_0x4b1db5);if(_0x50dd40[_0x2fc6('0x38')]){var _0x166b77={};_0x166b77[_0x50dd40[_0x2fc6('0x38')]]=_0x3854ee;_[_0x2fc6('0x31')](_0x24df6d[_0x2fc6('0x32')],_0x166b77);}return _0x41111[_0x2fc6('0x20')](_0x2fc6('0x39'))['find'](_0x24df6d,_0x5b3e9a);default:return null;}})[_0x2fc6('0x24')](function(_0x1c50a4){if(_0x1c50a4&&_0x1c50a4[_0x2fc6('0x25')]){var _0xc2bf54=_['first'](_0x1c50a4);if(_0xc2bf54){return BPromise[_0x2fc6('0x2c')]({'id':_0xc2bf54['Id'],'name':_0xc2bf54[_0x2fc6('0x27')],'phone':_0xc2bf54[_0x2fc6('0x3a')],'endUserType':_0xc2bf54[_0x2fc6('0x3b')]['type'][_0x2fc6('0x3c')]()});}}})['then'](function(_0x58c2cf){if(_0x58c2cf){logger[_0x2fc6('0x1f')](_0x2fc6('0x3d'),_0x58c2cf['endUserType'],_0x3854ee);return BPromise['resolve'](_0x58c2cf);}else{logger['info'](_0x2fc6('0x3e'),_0x3854ee);var _0x145d6a={'Phone':_0x3854ee};if(_0x50dd40[_0x2fc6('0x3f')]){if(_0x50dd40[_0x2fc6('0x3f')]===_0x2fc6('0x17')){logger[_0x2fc6('0x1f')](_0x2fc6('0x40'),_0x3854ee,_0x50dd40[_0x2fc6('0x3f')]);_0x145d6a[_0x2fc6('0x41')]=_0x562631!==_0x2fc6('0x42')?_0x562631:util['format'](_0x2fc6('0x43'),_0x3854ee);}else if(_0x50dd40['moduleCreate']===_0x2fc6('0x1e')){logger['info'](_0x2fc6('0x40'),_0x3854ee,_0x50dd40[_0x2fc6('0x3f')]);_0x145d6a[_0x2fc6('0x41')]=_0x562631!==''?_0x562631:util['format']('Caller\x20-\x20%s',_0x3854ee);_0x145d6a[_0x2fc6('0x44')]=_0x2fc6('0x45');}else if(_0x50dd40[_0x2fc6('0x3f')]===_0x2fc6('0x1c')){logger['info'](_0x2fc6('0x40'),_0x3854ee,_0x50dd40[_0x2fc6('0x3f')]);_0x145d6a[_0x2fc6('0x27')]=_0x562631!==_0x2fc6('0x42')?_0x562631:util[_0x2fc6('0x46')](_0x2fc6('0x43'),_0x3854ee);}else{return null;}}return _0x41111[_0x2fc6('0x20')](_[_0x2fc6('0x47')](_0x50dd40['moduleCreate']))[_0x2fc6('0x48')](_0x145d6a)[_0x2fc6('0x24')](function(_0x450ea6){return BPromise[_0x2fc6('0x2c')]({'id':_0x450ea6['id'],'endUserType':_0x50dd40['moduleCreate']});});}});}function getCustomFields(_0x20c6cd,_0x3924af){var _0x1635d5={};if(_0x20c6cd[_0x2fc6('0x25')]>0x0){_[_0x2fc6('0x49')](_0x20c6cd,function(_0x21572c){if(_['includes']([_0x2fc6('0x4a'),_0x2fc6('0x4b')],_0x21572c[_0x2fc6('0x4c')])&&_0x21572c[_0x2fc6('0x4d')]){_0x1635d5[_0x21572c[_0x2fc6('0x4d')]]=_0x21572c[_0x2fc6('0x4e')]['toString']();}else if(_0x21572c[_0x2fc6('0x4c')]===_0x2fc6('0x4f')&&_0x21572c[_0x2fc6('0x50')]&&_0x21572c[_0x2fc6('0x4d')]){_0x3924af[_0x21572c['variableName']]&&(_0x1635d5[_0x21572c[_0x2fc6('0x4d')]]=_0x3924af[_0x21572c[_0x2fc6('0x50')]][_0x2fc6('0x51')]());}else if(_0x21572c[_0x2fc6('0x4c')]==='customVariable'&&_0x21572c[_0x2fc6('0x52')]&&_0x21572c[_0x2fc6('0x52')]['name']&&_0x21572c[_0x2fc6('0x4d')]){_0x3924af[_0x21572c['Variable'][_0x2fc6('0x53')][_0x2fc6('0x3c')]()]&&(_0x1635d5[_0x21572c[_0x2fc6('0x4d')]]=_0x3924af[_0x21572c['Variable']['name'][_0x2fc6('0x3c')]()][_0x2fc6('0x51')]());}});}return _0x1635d5;}function getConnection(_0xb39399){var _0x8ad446=_0xb39399[_0x2fc6('0x54')]['concat'](_0xb39399[_0x2fc6('0x55')]);var _0x1b55b8=new jsforce[(_0x2fc6('0x56'))]({'oauth2':{'loginUrl':_0xb39399[_0x2fc6('0x57')]||_0x2fc6('0x58'),'clientId':_0xb39399['clientId'],'clientSecret':_0xb39399[_0x2fc6('0x59')]}});return _0x1b55b8[_0x2fc6('0x5a')](_0xb39399[_0x2fc6('0x5b')],_0x8ad446)[_0x2fc6('0x24')](function(){logger[_0x2fc6('0x1f')]('Connection\x20established.');return _0x1b55b8;});}exports['queue']=function(_0xe7c936,_0x25ad4c,_0x2c7181,_0x296e0f,_0x34cf49,_0x5000ca){var _0x42c65d,_0x36c837,_0x2303d8,_0x997df2;_0x5000ca[_0x2fc6('0x5c')]=intUtil[_0x2fc6('0x5d')](_0x5000ca[_0x2fc6('0x5c')]);_0x5000ca['remoteUri']=intUtil['stripTrailingSlash'](_0x5000ca[_0x2fc6('0x57')]);if(_0x34cf49&&_0x34cf49[_0x2fc6('0x5e')]){logger[_0x2fc6('0x1f')](_0x2fc6('0x5f'),_0x2fc6('0x60'));_0x25ad4c[_0x2fc6('0x61')]=util[_0x2fc6('0x46')](_0x2fc6('0x62'),_0x5000ca['serverUrl'],_0x25ad4c[_0x2fc6('0x63')],md5(_0x25ad4c[_0x2fc6('0x63')]));}else{_0x25ad4c[_0x2fc6('0x61')]='';}return getConnection(_0x5000ca)[_0x2fc6('0x24')](function(_0x2d211f){_0x997df2=_0x2d211f;return getUser(_0x5000ca,_0x296e0f[_0x2fc6('0x64')],_0x997df2);})[_0x2fc6('0x24')](function(_0x322b1c){_0x42c65d=_0x322b1c;return getEndUser(_0x5000ca,_0x2c7181,_0x25ad4c['calleridname'],_0x25ad4c[_0x2fc6('0x65')],_0x997df2);})['then'](function(_0x380958){_0x36c837=_0x380958;return getTicket(_0x5000ca,_0x42c65d,_0x36c837,_0x2c7181,_0x25ad4c,_0x2c7181[_0x2fc6('0x66')],_0x997df2,_0x2fc6('0x67'));})[_0x2fc6('0x24')](function(_0x4074b7){_0x2303d8=_0x4074b7;logger[_0x2fc6('0x1f')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x2303d8['id']);logger[_0x2fc6('0x1f')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x2303d8['id'],_0x296e0f[_0x2fc6('0x53')],_0x5000ca[_0x2fc6('0x4c')]);switch(_0x5000ca[_0x2fc6('0x4c')]){case _0x2fc6('0x68'):emit(util[_0x2fc6('0x46')](_0x2fc6('0x69'),_0x296e0f[_0x2fc6('0x53')]),_0x2fc6('0x6a'),{'recordId':_0x2303d8['id']});break;case'newTab':emit(util[_0x2fc6('0x46')](_0x2fc6('0x69'),_0x296e0f['name']),'trigger:browser:url',{'uri':util[_0x2fc6('0x46')]('%s/%s/e',_0x997df2[_0x2fc6('0x6b')],_0x2303d8['id'])});break;default:logger[_0x2fc6('0x6c')](_0x2fc6('0x6d'));}})[_0x2fc6('0x6e')](function(_0x1b9f3a){logger[_0x2fc6('0x6c')]('[QUEUE]',_0x1b9f3a);});};exports[_0x2fc6('0x6f')]=function(_0xae581,_0x465568,_0x3f70ad,_0x30e463,_0x550df1,_0x8ab784,_0x5df198){var _0x58ced5,_0x4b3366,_0x134d5a,_0x2590b3;_0x8ab784[_0x2fc6('0x5c')]=intUtil[_0x2fc6('0x5d')](_0x8ab784[_0x2fc6('0x5c')]);_0x8ab784[_0x2fc6('0x57')]=intUtil[_0x2fc6('0x5d')](_0x8ab784[_0x2fc6('0x57')]);if(_0x5df198&&_0x5df198[_0x2fc6('0x70')]&&_0x5df198[_0x2fc6('0x70')]!==_0x2fc6('0x71')){logger[_0x2fc6('0x1f')](_0x2fc6('0x72'),_0x2fc6('0x60'));_0x465568['recordingURL']=util[_0x2fc6('0x46')](_0x2fc6('0x62'),_0x8ab784[_0x2fc6('0x5c')],_0x465568[_0x2fc6('0x63')],md5(_0x465568[_0x2fc6('0x63')]));}return getConnection(_0x8ab784)[_0x2fc6('0x24')](function(_0x44cbda){_0x2590b3=_0x44cbda;return getUser(_0x8ab784,_0x30e463[_0x2fc6('0x64')],_0x2590b3);})[_0x2fc6('0x24')](function(_0x4db23a){_0x58ced5=_0x4db23a;return getEndUser(_0x8ab784,_0x3f70ad,_0x465568['destcalleridname'],_0x465568[_0x2fc6('0x73')],_0x2590b3);})[_0x2fc6('0x24')](function(_0x258c49){_0x4b3366=_0x258c49;return getTicket(_0x8ab784,_0x58ced5,_0x4b3366,_0x3f70ad,_0x465568,_0x3f70ad['Fields'],_0x2590b3,_0x2fc6('0x6f'));})[_0x2fc6('0x24')](function(_0x54cd83){_0x134d5a=_0x54cd83;logger[_0x2fc6('0x1f')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x134d5a['id']);logger['info']('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x134d5a['id'],_0x30e463[_0x2fc6('0x53')],_0x8ab784['type']);switch(_0x8ab784[_0x2fc6('0x4c')]){case'integrationTab':emit(util[_0x2fc6('0x46')](_0x2fc6('0x69'),_0x30e463[_0x2fc6('0x53')]),_0x2fc6('0x6a'),{'recordId':_0x134d5a['id']});break;case _0x2fc6('0x74'):emit(util[_0x2fc6('0x46')](_0x2fc6('0x69'),_0x30e463[_0x2fc6('0x53')]),_0x2fc6('0x75'),{'uri':util[_0x2fc6('0x46')](_0x2fc6('0x76'),_0x2590b3[_0x2fc6('0x6b')],_0x134d5a['id'])});break;default:logger['error'](_0x2fc6('0x72'),_0x2fc6('0x77'));}})[_0x2fc6('0x6e')](function(_0x4d456c){logger[_0x2fc6('0x6c')](_0x2fc6('0x72'),_0x4d456c);});};exports[_0x2fc6('0x78')]=function(_0x20b76d,_0x493863,_0x3c8445,_0x2b9541,_0x3f7ec1,_0x2540e0){var _0x5dc5bc,_0x5c06a3,_0x353455,_0x3e3464;_0x2540e0['serverUrl']=intUtil[_0x2fc6('0x5d')](_0x2540e0['serverUrl']);_0x2540e0['remoteUri']=intUtil[_0x2fc6('0x5d')](_0x2540e0[_0x2fc6('0x57')]);if(_0x3f7ec1&&_0x3f7ec1[_0x2fc6('0x5e')]){logger[_0x2fc6('0x1f')]('['+_0x493863[_0x2fc6('0x79')][_0x2fc6('0x7a')]()+']',_0x2fc6('0x60'));_0x493863[_0x2fc6('0x61')]=util['format'](_0x2fc6('0x62'),_0x2540e0['serverUrl'],_0x493863[_0x2fc6('0x63')],md5(_0x493863[_0x2fc6('0x63')]));}else{_0x493863[_0x2fc6('0x61')]='';}return getConnection(_0x2540e0)[_0x2fc6('0x24')](function(_0xf8c7e4){_0x3e3464=_0xf8c7e4;if(!_['isNil'](_0x2b9541)){return getUser(_0x2540e0,_0x2b9541[_0x2fc6('0x53')],_0x3e3464);}else{return getUser(_0x2540e0,null,_0x3e3464);}})[_0x2fc6('0x24')](function(_0x495000){_0x5dc5bc=_0x495000;return getEndUser(_0x2540e0,_0x3c8445,_0x493863['calleridname'],_0x493863[_0x2fc6('0x65')],_0x3e3464);})['then'](function(_0xfd8ac5){_0x5c06a3=_0xfd8ac5;return getTicket(_0x2540e0,_0x5dc5bc,_0x5c06a3,_0x3c8445,_0x493863,_0x3c8445[_0x2fc6('0x66')],_0x3e3464);})[_0x2fc6('0x24')](function(_0x5e4cc2){_0x353455=_0x5e4cc2;logger[_0x2fc6('0x1f')]('['+_0x493863[_0x2fc6('0x79')][_0x2fc6('0x7a')]()+_0x2fc6('0x7b'),_0x353455['id']);logger[_0x2fc6('0x1f')]('['+_0x493863[_0x2fc6('0x79')][_0x2fc6('0x7a')]()+_0x2fc6('0x7c'),_0x2540e0[_0x2fc6('0x4c')]);})[_0x2fc6('0x6e')](function(_0x466cd4){logger[_0x2fc6('0x6c')]('['+_0x493863['lastevent'][_0x2fc6('0x7a')]()+']',_0x466cd4);});}; \ 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 de731da..5fa3926 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 _0xe19e=['queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','inspect','bluebird','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','result','sys_id','toUpperCase','catch','error','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','info','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm','message',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','picklist','type','nameField','toLowerCase','includes','string','idField','content','toString','variable','variableName','customField','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','all','push','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','calleridnum','unmanaged'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0xe19e,0x1ba));var _0xee19=function(_0x1a6896,_0x5504d1){_0x1a6896=_0x1a6896-0x0;var _0x2b047e=_0xe19e[_0x1a6896];return _0x2b047e;};'use strict';var _=require('lodash');var Promise=require(_0xee19('0x0'));var rp=require(_0xee19('0x1'));var util=require('util');var md5=require(_0xee19('0x2'));var Redis=require(_0xee19('0x3'));var intUtil=require(_0xee19('0x4'));var config=require(_0xee19('0x5'));var logger=require(_0xee19('0x6'))(_0xee19('0x7'));config[_0xee19('0x8')]=_[_0xee19('0x9')](config[_0xee19('0x8')],{'host':_0xee19('0xa'),'port':0x18eb});var io=require(_0xee19('0xb'))(new Redis(config[_0xee19('0x8')]));function getAdminUser(_0x51a8a3,_0x489046,_0x160f95,_0x3ea836,_0x22d6be,_0x9ab441){return new Promise(function(_0x4eb04f,_0x50b5fc){var _0x5b573c={'method':_0xee19('0xc'),'uri':_0x3ea836+_0xee19('0xd')+'&'+_0x22d6be+'&'+_0x9ab441,'auth':_0x489046,'json':!![]};return rp(_0x5b573c)[_0xee19('0xe')](function(_0x512b17){if(_0x512b17['result'][_0xee19('0xf')]>0x0){_0x160f95[_0xee19('0x10')]=_0x512b17[_0xee19('0x11')][0x0][_0xee19('0x12')];}logger['info']('['+[_0x51a8a3[_0xee19('0x13')]()]+'],\x20getAdminUser\x20crm',_0x160f95);_0x4eb04f(_0x160f95);})[_0xee19('0x14')](function(_0xb06c28){logger[_0xee19('0x15')]('['+[_0x51a8a3[_0xee19('0x13')]()]+']',_0xb06c28['message']);_0x50b5fc(_0xb06c28['message']);});});}function getUser(_0x312e08,_0x4e98b0,_0x1fde0c,_0x2bcb44,_0x1fe21f){return function(_0x137ee6){logger['info']('['+[_0x312e08[_0xee19('0x13')]()]+_0xee19('0x16'),_0x137ee6);return new Promise(function(_0x4d9acc,_0x1de41e){if(intUtil[_0xee19('0x17')](_0x137ee6[_0xee19('0x18')])){var _0x454f97={'method':'GET','uri':_0x1fde0c+_0xee19('0x19')+_0x137ee6[_0xee19('0x18')]+'&'+_0x2bcb44+'&'+_0x1fe21f,'auth':_0x4e98b0,'json':!![]};logger[_0xee19('0x1a')]('['+[_0x312e08[_0xee19('0x13')]()]+_0xee19('0x1b'),_0x454f97);return rp(_0x454f97)['then'](function(_0x57c4ab){logger[_0xee19('0x1a')]('['+[_0x312e08[_0xee19('0x13')]()]+_0xee19('0x1c'),_0x57c4ab);if(_0x57c4ab[_0xee19('0x11')][_0xee19('0xf')]>0x0&&String(_0x57c4ab['result'][0x0][_0xee19('0x1d')])===_0xee19('0x1e')){_0x137ee6[_0xee19('0x1f')]=_0x57c4ab[_0xee19('0x11')][0x0]['sys_id'];}else{_0x137ee6['userId']=_0x137ee6[_0xee19('0x10')];_0x137ee6[_0xee19('0x18')]=_0x137ee6[_0xee19('0x20')];}logger[_0xee19('0x1a')]('['+[_0x312e08['toUpperCase']()]+_0xee19('0x21'),_0x137ee6);_0x4d9acc(_0x137ee6);})[_0xee19('0x14')](function(_0x4d1e1f){logger[_0xee19('0x15')]('['+[_0x312e08[_0xee19('0x13')]()]+']',_0x4d1e1f[_0xee19('0x22')]);_0x1de41e(_0x4d1e1f[_0xee19('0x22')]);});}else{logger[_0xee19('0x1a')]('['+[_0x312e08['toUpperCase']()]+_0xee19('0x23'));_0x137ee6[_0xee19('0x1f')]=_0x137ee6[_0xee19('0x10')];_0x137ee6[_0xee19('0x18')]=_0x137ee6[_0xee19('0x20')];_0x4d9acc(_0x137ee6);}});};}function createEndUser(_0x492ffa,_0x503827,_0x45e359,_0x26bc20,_0x1aedfb){logger[_0xee19('0x1a')]('['+[_0x492ffa['toUpperCase']()]+_0xee19('0x24'),_0x45e359);return new Promise(function(_0x29c41e,_0x49da4c){var _0x43ef6d={'method':_0xee19('0x25'),'uri':_0x26bc20+_0xee19('0x26')+_0x1aedfb,'body':{'user_name':_0x45e359[_0xee19('0x27')],'roles':_0xee19('0x28'),'first_name':_0x45e359['endUserNumber'],'active':_0xee19('0x1e'),'date_format':'System','phone':_0x45e359[_0xee19('0x27')]},'auth':_0x503827,'json':!![]};return rp(_0x43ef6d)[_0xee19('0xe')](function(_0x4ba987){logger['info']('['+[_0x492ffa[_0xee19('0x13')]()]+_0xee19('0x29'),_0x4ba987[_0xee19('0x11')]);_0x45e359[_0xee19('0x2a')]=_0x4ba987['result'][_0xee19('0x12')];_0x29c41e(_0x45e359);})[_0xee19('0x14')](function(_0x527dd4){logger[_0xee19('0x15')]('['+[_0x492ffa[_0xee19('0x13')]()]+']',_0x527dd4['message']);_0x49da4c(_0x527dd4[_0xee19('0x22')]);});});}function getEndUser(_0x1be77f,_0x522d81,_0x27c976,_0x13f5cd,_0x5489da){return function(_0x311708){logger[_0xee19('0x1a')]('['+[_0x1be77f[_0xee19('0x13')]()]+'],\x20getEndUser\x20input\x20crm',_0x311708);return new Promise(function(_0x63d76d,_0x14bd39){var _0x241edb={'method':_0xee19('0xc'),'uri':_0x27c976+_0xee19('0x2b')+_0x311708['endUserNumber']+'&'+_0x13f5cd+'&'+_0x5489da,'auth':_0x522d81,'json':!![]};return rp(_0x241edb)[_0xee19('0xe')](function(_0x45e7dd){if(_0x45e7dd[_0xee19('0x11')][_0xee19('0xf')]>0x0){_0x311708[_0xee19('0x2a')]=_0x45e7dd[_0xee19('0x11')][0x0][_0xee19('0x12')];logger[_0xee19('0x1a')]('['+[_0x1be77f[_0xee19('0x13')]()]+_0xee19('0x2c'),_0x311708);_0x63d76d(_0x311708);}else{return createEndUser(_0x1be77f,_0x522d81,_0x311708,_0x27c976,_0x13f5cd)[_0xee19('0xe')](function(_0x4dd60d){logger[_0xee19('0x1a')]('['+[_0x1be77f[_0xee19('0x13')]()]+_0xee19('0x2d'),_0x4dd60d);_0x63d76d(_0x4dd60d);});}})['catch'](function(_0x3956f3){logger[_0xee19('0x15')]('['+[_0x1be77f['toUpperCase']()]+']',_0x3956f3['message']);_0x14bd39(_0x3956f3[_0xee19('0x22')]);});});};}function getCustomFields(_0x81b9c5,_0xebd5c8){var _0x5243d6={};if(_0x81b9c5[_0xee19('0xf')]>0x0){_[_0xee19('0x2e')](_0x81b9c5,function(_0x1a8510){if(_['includes'](['string',_0xee19('0x2f')],_0x1a8510[_0xee19('0x30')])&&_0x1a8510[_0xee19('0x31')]&&!_0x1a8510['customField']){_0x5243d6[_0x1a8510[_0xee19('0x31')][_0xee19('0x32')]()]=_0x1a8510['content']['toString']();}else if(_[_0xee19('0x33')]([_0xee19('0x34'),_0xee19('0x2f')],_0x1a8510[_0xee19('0x30')])&&_0x1a8510[_0xee19('0x35')]&&_0x1a8510['customField']){_0x5243d6[_0x1a8510['idField'][_0xee19('0x32')]()]=_0x1a8510[_0xee19('0x36')][_0xee19('0x37')]();}else if(_0x1a8510[_0xee19('0x30')]===_0xee19('0x38')&&_0x1a8510[_0xee19('0x39')]&&_0x1a8510[_0xee19('0x35')]&&_0x1a8510[_0xee19('0x3a')]){_0x5243d6[_0x1a8510['idField']['toLowerCase']()]=_0xebd5c8[_0x1a8510[_0xee19('0x39')]][_0xee19('0x37')]();}else if(_0x1a8510['type']==='customVariable'&&_0x1a8510[_0xee19('0x3b')]&&_0x1a8510[_0xee19('0x3b')][_0xee19('0x3c')]&&_0x1a8510[_0xee19('0x35')]&&_0x1a8510[_0xee19('0x3a')]){_0x5243d6[_0x1a8510[_0xee19('0x35')][_0xee19('0x32')]()]=_0xebd5c8[_0x1a8510[_0xee19('0x3b')][_0xee19('0x3c')][_0xee19('0x32')]()]['toString']();}});}return _0x5243d6;}function getTicket(_0x3410e7,_0x54394a,_0x42515e,_0x110462,_0x5477b0,_0x3fe838){return function(_0x109c24){logger['info']('['+[_0x3410e7[_0xee19('0x13')]()]+_0xee19('0x3d'),_0x109c24);return new Promise(function(_0x120342,_0x55e323){var _0x316053=_0x3410e7[_0xee19('0x32')]()===_0xee19('0x3e')?_0x109c24[_0xee19('0x1f')]:_0x109c24[_0xee19('0x2a')];var _0xf761ac={'method':_0xee19('0x25'),'uri':_0x42515e+_0xee19('0x3f')+'?'+_0x3fe838,'body':Object[_0xee19('0x40')]({},{'active':'true','caller_id':_0x316053,'assigned_to':_0x109c24[_0xee19('0x1f')],'short_description':intUtil[_0xee19('0x41')](_0x110462[_0xee19('0x42')],_0x5477b0,'\x20'),'description':intUtil[_0xee19('0x41')](_0x110462[_0xee19('0x43')],_0x5477b0,'\x0a')},getCustomFields(_0x110462['Fields'],_0x5477b0)),'auth':_0x54394a,'json':!![]};return rp(_0xf761ac)[_0xee19('0xe')](function(_0x9790d5){logger['info']('['+[_0x3410e7[_0xee19('0x13')]()]+_0xee19('0x44'),_0x9790d5['result']);_0x109c24[_0xee19('0x45')]=_0x9790d5[_0xee19('0x11')][_0xee19('0x12')];_0x109c24[_0xee19('0x46')]=_0x9790d5['result'][_0xee19('0x47')];logger['info']('['+[_0x3410e7[_0xee19('0x13')]()]+_0xee19('0x48'),_0x109c24);_0x120342(_0x109c24);})['catch'](function(_0x4d91a0){logger[_0xee19('0x15')]('['+[_0x3410e7[_0xee19('0x13')]()]+']',_0x4d91a0[_0xee19('0x22')]);_0x55e323(_0x4d91a0['message']);});});};}function createRemoteTag(_0x4a6653,_0x426959,_0x718b49,_0x785d8b){return new Promise(function(_0x10a3d1,_0x15f63a){var _0x514c72={'method':_0xee19('0x25'),'uri':_0x718b49+_0xee19('0x49')+'?'+_0x785d8b,'body':{'short_description':_0x4a6653,'global':!![],'active':!![],'name':_0x4a6653},'auth':_0x426959,'json':!![]};return rp(_0x514c72)['then'](function(_0xed8c7c){var _0xf6f4e=_0xed8c7c[_0xee19('0x11')][_0xee19('0x12')];_0x10a3d1(_0xf6f4e);});});}function getRemoteTag(_0x584078,_0x4b1625,_0x325ec3,_0x43bbfc,_0x43b2c3){return new Promise(function(_0x7759cc,_0x43deed){var _0x5edab8={'method':'GET','uri':_0x325ec3+_0xee19('0x49')+_0xee19('0x4a')+_0x584078+'&'+_0x43bbfc,'auth':_0x4b1625,'json':!![]};return rp(_0x5edab8)[_0xee19('0xe')](function(_0x2e8076){if(_0x2e8076[_0xee19('0x11')][_0xee19('0xf')]>0x0){var _0x1b03bb=_0x2e8076[_0xee19('0x11')][0x0][_0xee19('0x12')];_0x7759cc(_0x1b03bb);}else{return createRemoteTag(_0x584078,_0x4b1625,_0x325ec3,_0x43bbfc)[_0xee19('0xe')](function(_0x355776){_0x7759cc(_0x355776);});}});});}function assignTagToIncident(_0x263ded,_0x3ed407,_0x18615d,_0x45d944,_0x24901c){return new Promise(function(_0x40664c,_0x27bea8){var _0x1732cd={'method':_0xee19('0x25'),'uri':_0x18615d+_0xee19('0x4b')+'?'+_0x24901c,'body':{'label':_0x263ded,'table':_0xee19('0x3f'),'id_type':_0xee19('0x4c'),'table_key':_0x45d944[_0xee19('0x45')],'title':_0xee19('0x4d')+_0x45d944[_0xee19('0x46')],'id_display':_0x45d944[_0xee19('0x46')]},'auth':_0x3ed407,'json':!![]};return rp(_0x1732cd)[_0xee19('0xe')](function(_0x4d49dc){_0x40664c();})[_0xee19('0x14')](function(){_0x40664c();});});}function manageTags(_0x51812f,_0x281673,_0x110e4e,_0x36dd4d,_0x2390ee,_0x426505,_0x199e20){return new Promise(function(_0x377bb5,_0x384473){var _0x2d0dce=[];_0x281673['forEach'](function(_0x2abea7){_0x2d0dce['push'](getRemoteTag(_0x2abea7,_0x110e4e,_0x36dd4d,_0x426505,_0x199e20));});return Promise[_0xee19('0x4e')](_0x2d0dce)['then'](function(_0x410728){if(_0x410728[_0xee19('0xf')]){logger[_0xee19('0x1a')]('['+[_0x51812f[_0xee19('0x13')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x410728);var _0x2a24a9=[];_0x410728[_0xee19('0x2e')](function(_0x39be62){_0x2a24a9[_0xee19('0x4f')](assignTagToIncident(_0x39be62,_0x110e4e,_0x36dd4d,_0x2390ee,_0x426505));});return Promise[_0xee19('0x4e')](_0x2a24a9)[_0xee19('0xe')](function(){_0x377bb5();})[_0xee19('0x14')](function(){_0x377bb5();});}else{_0x377bb5();}});});}function getTags(_0x596e19,_0x4218e1,_0x536073,_0x4ca471,_0x20ef65,_0x2fbf2a){return function(_0x3e1bca){return new Promise(function(_0x5e30ef,_0x28814e){var _0x519c7d=[];var _0x443fc3=_0x4ca471['Tags'];if(_0x443fc3&&_0x443fc3[_0xee19('0xf')]>0x0){_0x519c7d=_['map'](_0x443fc3,'name');}if(_0x519c7d['length']>0x0){return manageTags(_0x596e19,_0x519c7d,_0x4218e1,_0x536073,_0x3e1bca,_0x20ef65,_0x2fbf2a)[_0xee19('0xe')](function(){_0x5e30ef(_0x3e1bca);});}else{_0x5e30ef(_0x3e1bca);}});};}function emit(_0x1d3a24,_0x5cfd94,_0x51f410){var _0x56864c=_0xee19('0x50')+_0xee19('0x51')+_0xee19('0x52')+'%255EORDERBYDESCnumber';var _0x5369ef={'uri':_0x1d3a24+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x51f410+_0x56864c};io['to'](util[_0xee19('0x53')](_0xee19('0x54'),_0x5cfd94))[_0xee19('0x55')](_0xee19('0x56'),_0x5369ef);}exports['cs']=function(_0x2958db,_0x117db4,_0x4514ee,_0x3af235,_0x213df8,_0x412cb5,_0x4e3466,_0x28000c){var _0x534899={};var _0x1b15a8={'user':_0x412cb5[_0xee19('0x57')],'pass':_0x412cb5[_0xee19('0x58')]};var _0x30cde1=_0xee19('0x59');var _0x31bc8d='sysparm_display_value=true';_0x412cb5[_0xee19('0x5a')]=intUtil[_0xee19('0x5b')](_0x412cb5[_0xee19('0x5a')]);_0x412cb5[_0xee19('0x5c')]=intUtil['stripTrailingSlash'](_0x412cb5[_0xee19('0x5c')]);var _0x104b39=util[_0xee19('0x53')](_0xee19('0x5d'),_0x412cb5['remoteUri']);_0x534899[_0xee19('0x18')]=!_[_0xee19('0x5e')](_0x3af235)?_0x3af235['email']:null;_0x534899[_0xee19('0x20')]=_0x412cb5[_0xee19('0x5f')];_0x534899[_0xee19('0x27')]=_0x28000c[_0xee19('0x32')]()===_0xee19('0x3e')?_0x117db4['destcalleridnum']:_0x117db4[_0xee19('0x60')];_0x534899['callDirection']=_0x28000c==='queue'||_0x28000c===_0xee19('0x61')?_0xee19('0x62'):_0xee19('0x3e');var _0x5e3c1d=util[_0xee19('0x53')](_0xee19('0x63'),_0x412cb5[_0xee19('0x5c')],_0x117db4[_0xee19('0x64')],md5(_0x117db4[_0xee19('0x64')]));if(_0x213df8&&_0x213df8[_0xee19('0x65')]){logger[_0xee19('0x1a')](_0xee19('0x66'),'Recording\x20is\x20enabled!');_0x117db4[_0xee19('0x67')]=_0x5e3c1d;}else if(_0x4e3466&&_0x4e3466['recordingFormat']&&_0x4e3466['recordingFormat']!=='none'){logger[_0xee19('0x1a')](_0xee19('0x68'),'Recording\x20is\x20enabled!');_0x117db4[_0xee19('0x67')]=_0x5e3c1d;}else{_0x117db4['recordingURL']='';}return getAdminUser(_0x28000c,_0x1b15a8,_0x534899,_0x104b39,_0x31bc8d,_0x30cde1)['then'](getUser(_0x28000c,_0x1b15a8,_0x104b39,_0x31bc8d,_0x30cde1))['then'](getEndUser(_0x28000c,_0x1b15a8,_0x104b39,_0x31bc8d,_0x30cde1))[_0xee19('0xe')](getTicket(_0x28000c,_0x1b15a8,_0x104b39,_0x4514ee,_0x117db4,_0x31bc8d))['then'](function(_0x43c9b7){logger['info'](util[_0xee19('0x53')](_0xee19('0x69'),_0x43c9b7['ticketId']));logger['info'](util[_0xee19('0x53')](_0xee19('0x6a'),_0x28000c));if(_0x28000c!==_0xee19('0x61')){logger[_0xee19('0x1a')]('['+[_0x28000c['toUpperCase']()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x412cb5[_0xee19('0x5a')],_0x3af235[_0xee19('0x3c')],_0x43c9b7[_0xee19('0x45')]);}})[_0xee19('0x14')](function(_0x3544e8){logger['error']('['+[_0x28000c[_0xee19('0x13')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xee19('0x6b')](_0x3544e8,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x72ea=['Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','format','user:%s','emit','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','queue','unmanaged','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','ticketId','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','request-promise','util','md5','ioredis','../../../../config/environment','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','true','userId','adminEmail','catch',']\x20using\x20admin\x20profile','POST','endUserNumber','sys_user?sysparm_query=phone%3D','endUserId','],\x20createEndUser\x20crm','includes','string','type','nameField','toLowerCase','content','picklist','idField','toString','variable','customField','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','incident','assign','getString','Subjects','ticketNumber','label','label_entry','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label'];(function(_0xc0e19a,_0x51dd6c){var _0x53b3d1=function(_0x535b3f){while(--_0x535b3f){_0xc0e19a['push'](_0xc0e19a['shift']());}};_0x53b3d1(++_0x51dd6c);}(_0x72ea,0x152));var _0xa72e=function(_0x59d463,_0x15a828){_0x59d463=_0x59d463-0x0;var _0x30edc2=_0x72ea[_0x59d463];return _0x30edc2;};'use strict';var _=require(_0xa72e('0x0'));var Promise=require('bluebird');var rp=require(_0xa72e('0x1'));var util=require(_0xa72e('0x2'));var md5=require(_0xa72e('0x3'));var Redis=require(_0xa72e('0x4'));var intUtil=require('./util');var config=require(_0xa72e('0x5'));var logger=require('../../../../config/logger')(_0xa72e('0x6'));config[_0xa72e('0x7')]=_[_0xa72e('0x8')](config['redis'],{'host':_0xa72e('0x9'),'port':0x18eb});var io=require(_0xa72e('0xa'))(new Redis(config['redis']));function getAdminUser(_0x4155e9,_0x5002fd,_0x2b79f3,_0x153991,_0x32185f,_0x52fb8e){return new Promise(function(_0x47bdf2,_0x9828ea){var _0x45cf41={'method':_0xa72e('0xb'),'uri':_0x153991+_0xa72e('0xc')+'&'+_0x32185f+'&'+_0x52fb8e,'auth':_0x5002fd,'json':!![]};return rp(_0x45cf41)[_0xa72e('0xd')](function(_0x5a5656){if(_0x5a5656[_0xa72e('0xe')][_0xa72e('0xf')]>0x0){_0x2b79f3[_0xa72e('0x10')]=_0x5a5656[_0xa72e('0xe')][0x0][_0xa72e('0x11')];}logger[_0xa72e('0x12')]('['+[_0x4155e9[_0xa72e('0x13')]()]+_0xa72e('0x14'),_0x2b79f3);_0x47bdf2(_0x2b79f3);})['catch'](function(_0x1845a5){logger[_0xa72e('0x15')]('['+[_0x4155e9[_0xa72e('0x13')]()]+']',_0x1845a5['message']);_0x9828ea(_0x1845a5[_0xa72e('0x16')]);});});}function getUser(_0x360394,_0x4c38a2,_0x51f7fc,_0x4bf0c1,_0x5027b7){return function(_0x2a5ec){logger[_0xa72e('0x12')]('['+[_0x360394[_0xa72e('0x13')]()]+_0xa72e('0x17'),_0x2a5ec);return new Promise(function(_0x1b4a62,_0x52f84d){if(intUtil[_0xa72e('0x18')](_0x2a5ec[_0xa72e('0x19')])){var _0x2436bb={'method':_0xa72e('0xb'),'uri':_0x51f7fc+_0xa72e('0x1a')+_0x2a5ec['userEmail']+'&'+_0x4bf0c1+'&'+_0x5027b7,'auth':_0x4c38a2,'json':!![]};logger[_0xa72e('0x12')]('['+[_0x360394['toUpperCase']()]+_0xa72e('0x1b'),_0x2436bb);return rp(_0x2436bb)[_0xa72e('0xd')](function(_0x44fa4b){logger[_0xa72e('0x12')]('['+[_0x360394[_0xa72e('0x13')]()]+_0xa72e('0x1c'),_0x44fa4b);if(_0x44fa4b[_0xa72e('0xe')]['length']>0x0&&String(_0x44fa4b[_0xa72e('0xe')][0x0]['active'])===_0xa72e('0x1d')){_0x2a5ec[_0xa72e('0x1e')]=_0x44fa4b['result'][0x0]['sys_id'];}else{_0x2a5ec[_0xa72e('0x1e')]=_0x2a5ec['adminId'];_0x2a5ec[_0xa72e('0x19')]=_0x2a5ec[_0xa72e('0x1f')];}logger[_0xa72e('0x12')]('['+[_0x360394[_0xa72e('0x13')]()]+'],\x20getUser\x20crm',_0x2a5ec);_0x1b4a62(_0x2a5ec);})[_0xa72e('0x20')](function(_0x216684){logger['error']('['+[_0x360394[_0xa72e('0x13')]()]+']',_0x216684[_0xa72e('0x16')]);_0x52f84d(_0x216684[_0xa72e('0x16')]);});}else{logger['info']('['+[_0x360394[_0xa72e('0x13')]()]+_0xa72e('0x21'));_0x2a5ec['userId']=_0x2a5ec[_0xa72e('0x10')];_0x2a5ec[_0xa72e('0x19')]=_0x2a5ec[_0xa72e('0x1f')];_0x1b4a62(_0x2a5ec);}});};}function createEndUser(_0x4f2b26,_0x3cd6e6,_0x2adf4b,_0x2cb845,_0x377e20){logger[_0xa72e('0x12')]('['+[_0x4f2b26[_0xa72e('0x13')]()]+'],\x20createEndUser\x20input\x20crm',_0x2adf4b);return new Promise(function(_0x4d6c8d,_0x234968){var _0x24a44f={'method':_0xa72e('0x22'),'uri':_0x2cb845+'sys_user?'+_0x377e20,'body':{'user_name':_0x2adf4b[_0xa72e('0x23')],'roles':'user','first_name':_0x2adf4b[_0xa72e('0x23')],'active':_0xa72e('0x1d'),'date_format':'System','phone':_0x2adf4b[_0xa72e('0x23')]},'auth':_0x3cd6e6,'json':!![]};return rp(_0x24a44f)['then'](function(_0x167c3d){logger[_0xa72e('0x12')]('['+[_0x4f2b26[_0xa72e('0x13')]()]+'],\x20EndUser\x20schema',_0x167c3d[_0xa72e('0xe')]);_0x2adf4b['endUserId']=_0x167c3d[_0xa72e('0xe')][_0xa72e('0x11')];_0x4d6c8d(_0x2adf4b);})['catch'](function(_0x57fd11){logger[_0xa72e('0x15')]('['+[_0x4f2b26[_0xa72e('0x13')]()]+']',_0x57fd11[_0xa72e('0x16')]);_0x234968(_0x57fd11[_0xa72e('0x16')]);});});}function getEndUser(_0x20a0f2,_0x260582,_0x150beb,_0x17162f,_0x110534){return function(_0x2f6359){logger[_0xa72e('0x12')]('['+[_0x20a0f2[_0xa72e('0x13')]()]+'],\x20getEndUser\x20input\x20crm',_0x2f6359);return new Promise(function(_0x1e1ec2,_0xd6c451){var _0x5f1f4e={'method':_0xa72e('0xb'),'uri':_0x150beb+_0xa72e('0x24')+_0x2f6359[_0xa72e('0x23')]+'&'+_0x17162f+'&'+_0x110534,'auth':_0x260582,'json':!![]};return rp(_0x5f1f4e)['then'](function(_0x3f39d4){if(_0x3f39d4[_0xa72e('0xe')][_0xa72e('0xf')]>0x0){_0x2f6359[_0xa72e('0x25')]=_0x3f39d4[_0xa72e('0xe')][0x0]['sys_id'];logger[_0xa72e('0x12')]('['+[_0x20a0f2['toUpperCase']()]+'],\x20getEndUser\x20crm',_0x2f6359);_0x1e1ec2(_0x2f6359);}else{return createEndUser(_0x20a0f2,_0x260582,_0x2f6359,_0x150beb,_0x17162f)[_0xa72e('0xd')](function(_0x5253f0){logger[_0xa72e('0x12')]('['+[_0x20a0f2['toUpperCase']()]+_0xa72e('0x26'),_0x5253f0);_0x1e1ec2(_0x5253f0);});}})[_0xa72e('0x20')](function(_0x8cc8a1){logger[_0xa72e('0x15')]('['+[_0x20a0f2[_0xa72e('0x13')]()]+']',_0x8cc8a1[_0xa72e('0x16')]);_0xd6c451(_0x8cc8a1[_0xa72e('0x16')]);});});};}function getCustomFields(_0x49f94b,_0x98ec28){var _0x39e259={};if(_0x49f94b['length']>0x0){_['forEach'](_0x49f94b,function(_0xa815f0){if(_[_0xa72e('0x27')]([_0xa72e('0x28'),'picklist'],_0xa815f0[_0xa72e('0x29')])&&_0xa815f0[_0xa72e('0x2a')]&&!_0xa815f0['customField']){_0x39e259[_0xa815f0[_0xa72e('0x2a')][_0xa72e('0x2b')]()]=_0xa815f0[_0xa72e('0x2c')]['toString']();}else if(_[_0xa72e('0x27')]([_0xa72e('0x28'),_0xa72e('0x2d')],_0xa815f0[_0xa72e('0x29')])&&_0xa815f0[_0xa72e('0x2e')]&&_0xa815f0['customField']){_0x39e259[_0xa815f0['idField']['toLowerCase']()]=_0xa815f0['content'][_0xa72e('0x2f')]();}else if(_0xa815f0['type']===_0xa72e('0x30')&&_0xa815f0['variableName']&&_0xa815f0[_0xa72e('0x2e')]&&_0xa815f0[_0xa72e('0x31')]){_0x39e259[_0xa815f0[_0xa72e('0x2e')][_0xa72e('0x2b')]()]=_0x98ec28[_0xa815f0[_0xa72e('0x32')]][_0xa72e('0x2f')]();}else if(_0xa815f0[_0xa72e('0x29')]===_0xa72e('0x33')&&_0xa815f0['Variable']&&_0xa815f0[_0xa72e('0x34')][_0xa72e('0x35')]&&_0xa815f0[_0xa72e('0x2e')]&&_0xa815f0[_0xa72e('0x31')]){_0x39e259[_0xa815f0[_0xa72e('0x2e')][_0xa72e('0x2b')]()]=_0x98ec28[_0xa815f0[_0xa72e('0x34')][_0xa72e('0x35')][_0xa72e('0x2b')]()]['toString']();}});}return _0x39e259;}function getTicket(_0x3986fe,_0x5c69ff,_0x5ce253,_0x4fde0e,_0x130ad3,_0x3ca056){return function(_0x4ba2b1){logger[_0xa72e('0x12')]('['+[_0x3986fe[_0xa72e('0x13')]()]+_0xa72e('0x36'),_0x4ba2b1);return new Promise(function(_0x18a981,_0x442df4){var _0x559fc1=_0x3986fe[_0xa72e('0x2b')]()==='outbound'?_0x4ba2b1[_0xa72e('0x1e')]:_0x4ba2b1[_0xa72e('0x25')];var _0x415a8c={'method':_0xa72e('0x22'),'uri':_0x5ce253+_0xa72e('0x37')+'?'+_0x3ca056,'body':Object[_0xa72e('0x38')]({},{'active':'true','caller_id':_0x559fc1,'assigned_to':_0x4ba2b1['userId'],'short_description':intUtil[_0xa72e('0x39')](_0x4fde0e[_0xa72e('0x3a')],_0x130ad3,'\x20'),'description':intUtil['getString'](_0x4fde0e['Descriptions'],_0x130ad3,'\x0a')},getCustomFields(_0x4fde0e['Fields'],_0x130ad3)),'auth':_0x5c69ff,'json':!![]};return rp(_0x415a8c)['then'](function(_0x239c38){logger[_0xa72e('0x12')]('['+[_0x3986fe[_0xa72e('0x13')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x239c38['result']);_0x4ba2b1['ticketId']=_0x239c38[_0xa72e('0xe')][_0xa72e('0x11')];_0x4ba2b1[_0xa72e('0x3b')]=_0x239c38[_0xa72e('0xe')]['number'];logger[_0xa72e('0x12')]('['+[_0x3986fe[_0xa72e('0x13')]()]+']\x20getTicket\x20crm',_0x4ba2b1);_0x18a981(_0x4ba2b1);})[_0xa72e('0x20')](function(_0x2cc1c6){logger[_0xa72e('0x15')]('['+[_0x3986fe['toUpperCase']()]+']',_0x2cc1c6['message']);_0x442df4(_0x2cc1c6[_0xa72e('0x16')]);});});};}function createRemoteTag(_0x3508b0,_0x156af4,_0x3bc48e,_0x2ae912){return new Promise(function(_0x163102,_0x385615){var _0x54f853={'method':_0xa72e('0x22'),'uri':_0x3bc48e+_0xa72e('0x3c')+'?'+_0x2ae912,'body':{'short_description':_0x3508b0,'global':!![],'active':!![],'name':_0x3508b0},'auth':_0x156af4,'json':!![]};return rp(_0x54f853)['then'](function(_0x38cdf0){var _0x3ad90b=_0x38cdf0['result'][_0xa72e('0x11')];_0x163102(_0x3ad90b);});});}function getRemoteTag(_0x3a315d,_0x45c4b3,_0x154a91,_0x5393c9,_0x3aaff5){return new Promise(function(_0xadf79e,_0x1423c7){var _0x497d75={'method':_0xa72e('0xb'),'uri':_0x154a91+'label'+'?sysparm_query=name%3D'+_0x3a315d+'&'+_0x5393c9,'auth':_0x45c4b3,'json':!![]};return rp(_0x497d75)[_0xa72e('0xd')](function(_0xa0f35){if(_0xa0f35['result'][_0xa72e('0xf')]>0x0){var _0x5d9776=_0xa0f35['result'][0x0][_0xa72e('0x11')];_0xadf79e(_0x5d9776);}else{return createRemoteTag(_0x3a315d,_0x45c4b3,_0x154a91,_0x5393c9)[_0xa72e('0xd')](function(_0xb947ab){_0xadf79e(_0xb947ab);});}});});}function assignTagToIncident(_0x107eda,_0x506286,_0x93c3e,_0x10f636,_0x3e7a93){return new Promise(function(_0x5dd523,_0x32ba30){var _0x213960={'method':'POST','uri':_0x93c3e+_0xa72e('0x3d')+'?'+_0x3e7a93,'body':{'label':_0x107eda,'table':_0xa72e('0x37'),'id_type':'Incident','table_key':_0x10f636['ticketId'],'title':'Incident\x20-\x20'+_0x10f636['ticketNumber'],'id_display':_0x10f636[_0xa72e('0x3b')]},'auth':_0x506286,'json':!![]};return rp(_0x213960)[_0xa72e('0xd')](function(_0x97e919){_0x5dd523();})['catch'](function(){_0x5dd523();});});}function manageTags(_0x26294b,_0x21b19e,_0x17fca3,_0xa707ec,_0x3d0abc,_0x2f9b0c,_0x4e5e93){return new Promise(function(_0x3355fc,_0x4622d0){var _0x5a2afa=[];_0x21b19e[_0xa72e('0x3e')](function(_0x4f8af0){_0x5a2afa[_0xa72e('0x3f')](getRemoteTag(_0x4f8af0,_0x17fca3,_0xa707ec,_0x2f9b0c,_0x4e5e93));});return Promise[_0xa72e('0x40')](_0x5a2afa)[_0xa72e('0xd')](function(_0x2bf6f3){if(_0x2bf6f3[_0xa72e('0xf')]){logger[_0xa72e('0x12')]('['+[_0x26294b[_0xa72e('0x13')]()]+_0xa72e('0x41'),_0x2bf6f3);var _0x1f4d85=[];_0x2bf6f3['forEach'](function(_0x35d2c0){_0x1f4d85[_0xa72e('0x3f')](assignTagToIncident(_0x35d2c0,_0x17fca3,_0xa707ec,_0x3d0abc,_0x2f9b0c));});return Promise[_0xa72e('0x40')](_0x1f4d85)['then'](function(){_0x3355fc();})[_0xa72e('0x20')](function(){_0x3355fc();});}else{_0x3355fc();}});});}function getTags(_0x10d617,_0x381746,_0x1e068e,_0x49eff9,_0x7265cd,_0x407212){return function(_0x5e4f50){return new Promise(function(_0xa3cf8f,_0x592f5a){var _0x453521=[];var _0x47bff7=_0x49eff9[_0xa72e('0x42')];if(_0x47bff7&&_0x47bff7[_0xa72e('0xf')]>0x0){_0x453521=_[_0xa72e('0x43')](_0x47bff7,_0xa72e('0x35'));}if(_0x453521[_0xa72e('0xf')]>0x0){return manageTags(_0x10d617,_0x453521,_0x381746,_0x1e068e,_0x5e4f50,_0x7265cd,_0x407212)[_0xa72e('0xd')](function(){_0xa3cf8f(_0x5e4f50);});}else{_0xa3cf8f(_0x5e4f50);}});};}function emit(_0x5a08b2,_0x3c8ceb,_0x2917bd){var _0x556ab7=_0xa72e('0x44')+_0xa72e('0x45')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0xa72e('0x46');var _0x2afc0e={'uri':_0x5a08b2+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x2917bd+_0x556ab7};io['to'](util[_0xa72e('0x47')](_0xa72e('0x48'),_0x3c8ceb))[_0xa72e('0x49')]('trigger:browser:url',_0x2afc0e);}exports['cs']=function(_0x4c5b6d,_0x2b1218,_0x58c81d,_0x181b7e,_0x26ebaf,_0x31b112,_0x4f6f0b,_0x25b714){var _0x412424={};var _0x1d4d18={'user':_0x31b112[_0xa72e('0x4a')],'pass':_0x31b112[_0xa72e('0x4b')]};var _0x31a391=_0xa72e('0x4c');var _0xfc9ee3=_0xa72e('0x4d');_0x31b112['remoteUri']=intUtil[_0xa72e('0x4e')](_0x31b112[_0xa72e('0x4f')]);_0x31b112[_0xa72e('0x50')]=intUtil[_0xa72e('0x4e')](_0x31b112[_0xa72e('0x50')]);var _0x36b77a=util[_0xa72e('0x47')](_0xa72e('0x51'),_0x31b112[_0xa72e('0x4f')]);_0x412424['userEmail']=!_[_0xa72e('0x52')](_0x181b7e)?_0x181b7e[_0xa72e('0x53')]:null;_0x412424['adminEmail']=_0x31b112[_0xa72e('0x53')];_0x412424[_0xa72e('0x23')]=_0x25b714[_0xa72e('0x2b')]()===_0xa72e('0x54')?_0x2b1218[_0xa72e('0x55')]:_0x2b1218[_0xa72e('0x56')];_0x412424['callDirection']=_0x25b714===_0xa72e('0x57')||_0x25b714===_0xa72e('0x58')?_0xa72e('0x57'):_0xa72e('0x54');var _0x1e395d=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x31b112[_0xa72e('0x50')],_0x2b1218[_0xa72e('0x59')],md5(_0x2b1218['uniqueid']));if(_0x26ebaf&&_0x26ebaf['monitor_format']){logger[_0xa72e('0x12')](_0xa72e('0x5a'),_0xa72e('0x5b'));_0x2b1218[_0xa72e('0x5c')]=_0x1e395d;}else if(_0x4f6f0b&&_0x4f6f0b[_0xa72e('0x5d')]&&_0x4f6f0b[_0xa72e('0x5d')]!==_0xa72e('0x5e')){logger[_0xa72e('0x12')](_0xa72e('0x5f'),_0xa72e('0x5b'));_0x2b1218[_0xa72e('0x5c')]=_0x1e395d;}else{_0x2b1218[_0xa72e('0x5c')]='';}return getAdminUser(_0x25b714,_0x1d4d18,_0x412424,_0x36b77a,_0xfc9ee3,_0x31a391)[_0xa72e('0xd')](getUser(_0x25b714,_0x1d4d18,_0x36b77a,_0xfc9ee3,_0x31a391))[_0xa72e('0xd')](getEndUser(_0x25b714,_0x1d4d18,_0x36b77a,_0xfc9ee3,_0x31a391))['then'](getTicket(_0x25b714,_0x1d4d18,_0x36b77a,_0x58c81d,_0x2b1218,_0xfc9ee3))[_0xa72e('0xd')](function(_0x1dca6b){logger[_0xa72e('0x12')](util['format'](_0xa72e('0x60'),_0x1dca6b[_0xa72e('0x61')]));logger[_0xa72e('0x12')](util['format'](_0xa72e('0x62'),_0x25b714));if(_0x25b714!=='unmanaged'){logger['info']('['+[_0x25b714['toUpperCase']()]+']',_0xa72e('0x63'));emit(_0x31b112[_0xa72e('0x4f')],_0x181b7e[_0xa72e('0x35')],_0x1dca6b[_0xa72e('0x61')]);}})[_0xa72e('0x20')](function(_0x282462){logger[_0xa72e('0x15')]('['+[_0x25b714['toUpperCase']()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xa72e('0x64')](_0x282462,{'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 fe4d39e..91fafc7 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 _0x99f7=['phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','[HTTP]','merge','map','string','nameField','toLowerCase','content','type','custom_fields','customField','customVariable','Variable','POST','login','username','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','uri','recordingFormat','[OUTBOUND]','recordingURL','The\x20User\x20ID\x20is:','destcalleridnum','Outbound','unmanaged','lastevent','Recording\x20is\x20enabled!','Inbound','toUpperCase','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','socket.io-emitter','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','date_start','toISOString','replace','duration_hours','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','push','idField','variableName','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','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','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22'];(function(_0x318040,_0x4b720e){var _0x55e2ec=function(_0x6013aa){while(--_0x6013aa){_0x318040['push'](_0x318040['shift']());}};_0x55e2ec(++_0x4b720e);}(_0x99f7,0x134));var _0x799f=function(_0x144ca3,_0x29e665){_0x144ca3=_0x144ca3-0x0;var _0x323938=_0x99f7[_0x144ca3];return _0x323938;};'use strict';var _=require(_0x799f('0x0'));var rp=require(_0x799f('0x1'));var BPromise=require(_0x799f('0x2'));var md5=require(_0x799f('0x3'));var util=require('util');var Redis=require(_0x799f('0x4'));var intUtil=require(_0x799f('0x5'));var config=require(_0x799f('0x6'));var logger=require(_0x799f('0x7'))('sugarcrm');config['redis']=_['defaults'](config[_0x799f('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x799f('0x9'))(new Redis(config[_0x799f('0x8')]));var def={'method':'POST','json':!![]};function emit(_0x30eb79,_0x4a04ff,_0x2607d9){io['to'](_0x30eb79)['emit'](_0x4a04ff,_0x2607d9);}function getTicket(_0x1a67f4,_0x3389af,_0x2bcc54,_0x1fe9c5,_0x21b36b,_0x8b6e63,_0x364898,_0x47578f){logger['info'](_0x799f('0xa'));var _0x426dd3=new Date();var _0xef40a=[{'name':_0x799f('0xb'),'value':intUtil[_0x799f('0xc')](_0x1fe9c5[_0x799f('0xd')],_0x21b36b,'\x20')},{'name':_0x799f('0xe'),'value':_0x3389af['id']},{'name':_0x799f('0xf'),'value':_0x3389af['id']},{'name':_0x799f('0x10'),'value':intUtil['getString'](_0x1fe9c5['Descriptions'],_0x21b36b,'\x0a')},{'name':_0x799f('0x11'),'value':_0x426dd3[_0x799f('0x12')]()['slice'](0x0,0x13)[_0x799f('0x13')]('T','\x20')},{'name':_0x799f('0x14'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x799f('0x15'),'value':_0x2bcc54['id']},{'name':_0x799f('0x16'),'value':_0x799f('0x17')},{'name':_0x799f('0x18'),'value':_0x2bcc54['name']},{'name':_0x799f('0x19'),'value':_0x47578f}];if(_0x8b6e63[_0x799f('0x1a')]){_[_0x799f('0x1b')](_0x8b6e63,function(_0x4900e4){if(_0x21b36b[_0x4900e4['variableName']]){_0xef40a[_0x799f('0x1c')]({'name':_0x4900e4[_0x799f('0x1d')],'value':_0x21b36b[_0x4900e4[_0x799f('0x1e')]]});}});}return request({'form':{'method':_0x799f('0x1f'),'input_type':_0x799f('0x20'),'response_type':_0x799f('0x20'),'rest_data':JSON[_0x799f('0x21')]({'session':_0x364898['id'],'module_name':_0x799f('0x22'),'name_value_list':_0xef40a})}});}function getAuth(_0x14334c){return util[_0x799f('0x23')](_0x799f('0x24'),new Buffer(_0x14334c[_0x799f('0x25')]+':X')[_0x799f('0x26')](_0x799f('0x27')));}function getServerInfo(_0x421888){return request({'form':{'method':_0x799f('0x28'),'input_type':_0x799f('0x20'),'response_type':_0x799f('0x20'),'rest_data':JSON[_0x799f('0x21')]({'session':_0x421888['id']})}});}function getUser(_0x4f9dbd,_0x5676db,_0x3feb81){if(!_['isNil'](_0x5676db)){logger[_0x799f('0x29')](_0x799f('0x2a'),_0x5676db);return request({'form':{'method':_0x799f('0x2b'),'input_type':_0x799f('0x20'),'response_type':_0x799f('0x20'),'rest_data':JSON[_0x799f('0x21')]({'session':_0x3feb81['id'],'module_name':_0x799f('0x2c'),'query':util['format'](_0x799f('0x2d'),_0x5676db),'order_by':'','offset':'0','select_fields':['id',_0x799f('0xb'),_0x799f('0x2e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x799f('0x2f')](function(_0x325321){if(_0x325321[_0x799f('0x30')]['length']){var _0x3b749c=_[_0x799f('0x31')](_0x325321[_0x799f('0x30')],function(_0x5d9e87){return _0x5d9e87[_0x799f('0x32')]['user_name'][_0x799f('0x33')]===_0x5676db;});if(_0x3b749c){logger[_0x799f('0x29')](_0x799f('0x34'));return BPromise[_0x799f('0x35')]({'id':_0x3b749c['name_value_list']['id'][_0x799f('0x33')],'name':_0x3b749c['name_value_list'][_0x799f('0xb')][_0x799f('0x33')]});}}logger[_0x799f('0x29')](_0x799f('0x36'));return BPromise['resolve']({'id':_0x3feb81[_0x799f('0x32')][_0x799f('0x37')][_0x799f('0x33')],'name':_0x3feb81[_0x799f('0x32')][_0x799f('0x2e')][_0x799f('0x33')]});});}else{logger[_0x799f('0x29')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x3feb81['name_value_list']['user_id'][_0x799f('0x33')],'name':_0x3feb81[_0x799f('0x32')][_0x799f('0x2e')][_0x799f('0x33')]});}}function getEndUser(_0x539bb8,_0x22719d,_0x485be5,_0x5ea67f){logger['info'](_0x799f('0x38'),_0x485be5);return request({'form':{'method':_0x799f('0x2b'),'input_type':_0x799f('0x20'),'response_type':_0x799f('0x20'),'rest_data':JSON[_0x799f('0x21')]({'session':_0x5ea67f['id'],'module_name':_0x799f('0x17'),'query':util[_0x799f('0x23')](_0x799f('0x39'),_0x485be5),'order_by':'','offset':'0','select_fields':['id',_0x799f('0xb'),_0x799f('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x799f('0x2f')](function(_0x418d23){if(_0x418d23['entry_list'][_0x799f('0x1a')]){var _0x16a16d=_[_0x799f('0x31')](_0x418d23['entry_list'],function(_0xc05827){return _0xc05827[_0x799f('0x32')][_0x799f('0x3a')][_0x799f('0x33')]===_0x485be5;});if(_0x16a16d){logger[_0x799f('0x29')]('Enduser\x20found!');return BPromise[_0x799f('0x35')]({'id':_0x16a16d[_0x799f('0x32')]['id'][_0x799f('0x33')],'name':_0x16a16d[_0x799f('0x32')][_0x799f('0xb')][_0x799f('0x33')],'phone':_0x16a16d[_0x799f('0x32')][_0x799f('0x3a')][_0x799f('0x33')]});}}else{logger[_0x799f('0x29')](_0x799f('0x3b'));return request({'form':{'method':_0x799f('0x1f'),'input_type':_0x799f('0x20'),'response_type':_0x799f('0x20'),'rest_data':JSON[_0x799f('0x21')]({'session':_0x5ea67f['id'],'module_name':_0x799f('0x17'),'name_value_list':[{'name':_0x799f('0x3c'),'value':_0x22719d!==_0x799f('0x3d')?_0x22719d:util['format'](_0x799f('0x3e'),_0x485be5)},{'name':'phone_home','value':_0x485be5}]})}})[_0x799f('0x2f')](function(_0x29f081){logger['info'](_0x799f('0x3f'));return BPromise[_0x799f('0x35')]({'id':_0x29f081['id'],'name':_0x29f081[_0x799f('0x30')][_0x799f('0x3c')][_0x799f('0x33')],'phone':_0x29f081[_0x799f('0x30')]['phone_home'][_0x799f('0x33')]});});}});}function request(_0xfe3520){logger['debug'](_0x799f('0x40'),JSON[_0x799f('0x21')](_0xfe3520));return rp(_[_0x799f('0x41')](def,_0xfe3520));}function getTags(_0x19fd50,_0x60b0a9){var _0x1c4e8b=[];if(_0x19fd50&&_0x19fd50[_0x799f('0x1a')]>0x0){_0x1c4e8b=_[_0x799f('0x42')](_0x19fd50,_0x60b0a9);}return _0x1c4e8b;}function getCustomFields(_0x8a6c45,_0x18d9d6){var _0x2ea93b=[];var _0x2358e7={'custom_fields':[]};if(_0x8a6c45['length']>0x0){_[_0x799f('0x1b')](_0x8a6c45,function(_0x3b973b){if(_0x3b973b['type']===_0x799f('0x43')&&_0x3b973b[_0x799f('0x44')]&&!_0x3b973b['customField']){_0x2358e7[_0x3b973b[_0x799f('0x44')][_0x799f('0x45')]()]=_0x3b973b[_0x799f('0x46')][_0x799f('0x26')]();}else if(_0x3b973b[_0x799f('0x47')]===_0x799f('0x43')&&_0x3b973b[_0x799f('0x1d')]&&_0x3b973b['customField']){_0x2358e7[_0x799f('0x48')][_0x799f('0x1c')]({'id':_0x3b973b['idField'],'value':_0x3b973b['content'][_0x799f('0x26')]()});}else if(_0x3b973b[_0x799f('0x47')]==='variable'&&_0x3b973b[_0x799f('0x1e')]&&_0x3b973b[_0x799f('0x1d')]&&_0x3b973b[_0x799f('0x49')]){_0x18d9d6[_0x3b973b['variableName']]&&_0x2358e7[_0x799f('0x48')][_0x799f('0x1c')]({'id':_0x3b973b[_0x799f('0x1d')],'value':_0x18d9d6[_0x3b973b[_0x799f('0x1e')]][_0x799f('0x26')]()});}else if(_0x3b973b['type']===_0x799f('0x4a')&&_0x3b973b[_0x799f('0x4b')]&&_0x3b973b[_0x799f('0x4b')][_0x799f('0xb')]&&_0x3b973b['idField']&&_0x3b973b[_0x799f('0x49')]){_0x18d9d6[_0x3b973b['Variable']['name']['toLowerCase']()]&&_0x2358e7[_0x799f('0x48')]['push']({'id':_0x3b973b[_0x799f('0x1d')],'value':_0x18d9d6[_0x3b973b[_0x799f('0x4b')][_0x799f('0xb')][_0x799f('0x45')]()][_0x799f('0x26')]()});}});}return _0x2358e7;}function getConnection(_0x35265e){return request({'method':_0x799f('0x4c'),'form':{'method':_0x799f('0x4d'),'input_type':_0x799f('0x20'),'response_type':_0x799f('0x20'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x35265e[_0x799f('0x4e')],'password':_0x35265e[_0x799f('0x4f')],'encryption':_0x799f('0x50')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x799f('0x2f')](function(_0x25430a){var _0x58f104=_0x25430a;if(_0x58f104['id']){def[_0x799f('0x51')]=_0x58f104['id'];return BPromise[_0x799f('0x35')](_0x58f104);}else{throw new Error(util[_0x799f('0x23')](_0x799f('0x52'),_0x35265e['id']));}});}function setRelationship(_0x12f7f1,_0x27e422,_0x477bf7,_0x5f0b9b){return request({'form':{'method':_0x799f('0x53'),'input_type':_0x799f('0x20'),'response_type':_0x799f('0x20'),'rest_data':JSON['stringify']({'session':_0x12f7f1['id'],'module_name':_0x799f('0x22'),'module_id':_0x477bf7['id'],'link_field_name':_0x5f0b9b,'related_ids':[_0x27e422['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x799f('0x54')]=function(_0x45a7dc,_0x258a07,_0x1c3be2,_0x1e4ac8,_0x26bbbb,_0x4b99f1){var _0x53a978,_0x5958ab,_0x41ab46,_0x5a3c7d;_0x4b99f1['remoteUri']=intUtil[_0x799f('0x55')](_0x4b99f1[_0x799f('0x56')]);_0x4b99f1[_0x799f('0x57')]=intUtil[_0x799f('0x55')](_0x4b99f1[_0x799f('0x57')]);def['uri']=util['format'](_0x799f('0x58'),_0x4b99f1[_0x799f('0x56')]);if(_0x26bbbb&&_0x26bbbb[_0x799f('0x59')]){logger[_0x799f('0x29')](_0x799f('0x5a'),'Recording\x20is\x20enabled!');_0x258a07['recordingURL']=util[_0x799f('0x23')](_0x799f('0x5b'),_0x4b99f1[_0x799f('0x57')],_0x258a07[_0x799f('0x5c')],md5(_0x258a07[_0x799f('0x5c')]));}else{_0x258a07['recordingURL']='';}return getConnection(_0x4b99f1)[_0x799f('0x2f')](function(_0x48858d){_0x5a3c7d=_0x48858d;return getUser(_0x4b99f1,_0x1e4ac8['name'],_0x5a3c7d);})['then'](function(_0x42c938){_0x53a978=_0x42c938;logger[_0x799f('0x29')]('The\x20User\x20ID\x20is:',_0x53a978['id']);return getEndUser(_0x4b99f1,_0x258a07[_0x799f('0x5d')],_0x258a07['calleridnum'],_0x5a3c7d);})[_0x799f('0x2f')](function(_0x17ad22){_0x5958ab=_0x17ad22;logger[_0x799f('0x29')](_0x799f('0x5e'),_0x5958ab['id']);return getTicket(_0x4b99f1,_0x53a978,_0x5958ab,_0x1c3be2,_0x258a07,_0x1c3be2[_0x799f('0x5f')],_0x5a3c7d,'Inbound');})['then'](function(_0x24c24b){_0x41ab46=_0x24c24b;logger[_0x799f('0x29')](_0x799f('0x60'));logger[_0x799f('0x29')](_0x799f('0x61'),_0x41ab46['id']);return setRelationship(_0x5a3c7d,_0x53a978,_0x41ab46,_0x799f('0x62'));})[_0x799f('0x2f')](function(){return setRelationship(_0x5a3c7d,_0x5958ab,_0x41ab46,_0x799f('0x63'));})[_0x799f('0x2f')](function(){return getServerInfo(_0x5a3c7d);})[_0x799f('0x2f')](function(_0x48b54c){var _0x483253=parseInt(_0x48b54c[_0x799f('0x64')][_0x799f('0x65')](0x0));var _0x40efe8=util[_0x799f('0x23')](_0x799f('0x66'),_0x4b99f1['remoteUri'],_0x41ab46['id']);if(_0x483253>0x6){_0x40efe8=util[_0x799f('0x23')](_0x799f('0x67'),_0x4b99f1[_0x799f('0x56')],_0x41ab46['id']);}logger['info']('[QUEUE]',_0x799f('0x68'));emit(util[_0x799f('0x23')](_0x799f('0x69'),_0x1e4ac8[_0x799f('0xb')]),_0x799f('0x6a'),{'uri':_0x40efe8});})[_0x799f('0x6b')](function(_0x1cc95d){logger[_0x799f('0x6c')](_0x799f('0x5a'),JSON[_0x799f('0x21')](_0x1cc95d));});};exports[_0x799f('0x6d')]=function(_0x32489a,_0x26fd2a,_0x19c1ba,_0x4e0f61,_0x1d45e7,_0xd453a9,_0x1e971e){var _0x118d1a,_0x338f85,_0x573822,_0x1c9bee;_0xd453a9[_0x799f('0x56')]=intUtil[_0x799f('0x55')](_0xd453a9[_0x799f('0x56')]);_0xd453a9[_0x799f('0x57')]=intUtil[_0x799f('0x55')](_0xd453a9[_0x799f('0x57')]);def[_0x799f('0x6e')]=util[_0x799f('0x23')]('%s/service/v4_1/rest.php',_0xd453a9[_0x799f('0x56')]);if(_0x1e971e&&_0x1e971e[_0x799f('0x6f')]&&_0x1e971e[_0x799f('0x6f')]!=='none'){logger[_0x799f('0x29')](_0x799f('0x70'),'Recording\x20is\x20enabled!');_0x26fd2a[_0x799f('0x71')]=util[_0x799f('0x23')](_0x799f('0x5b'),_0xd453a9[_0x799f('0x57')],_0x26fd2a[_0x799f('0x5c')],md5(_0x26fd2a['uniqueid']));}return getConnection(_0xd453a9)['then'](function(_0x4d0e33){_0x1c9bee=_0x4d0e33;return getUser(_0xd453a9,_0x4e0f61[_0x799f('0xb')],_0x1c9bee);})[_0x799f('0x2f')](function(_0x277878){_0x118d1a=_0x277878;logger[_0x799f('0x29')](_0x799f('0x72'),_0x118d1a['id']);return getEndUser(_0xd453a9,_0x26fd2a['destcalleridname'],_0x26fd2a[_0x799f('0x73')],_0x1c9bee);})[_0x799f('0x2f')](function(_0x276a45){_0x338f85=_0x276a45;logger[_0x799f('0x29')](_0x799f('0x5e'),_0x338f85['id']);return getTicket(_0xd453a9,_0x118d1a,_0x338f85,_0x19c1ba,_0x26fd2a,_0x19c1ba['Fields'],_0x1c9bee,_0x799f('0x74'));})['then'](function(_0x488b52){_0x573822=_0x488b52;logger[_0x799f('0x29')](_0x799f('0x60'));logger[_0x799f('0x29')](_0x799f('0x61'),_0x573822['id']);return setRelationship(_0x1c9bee,_0x118d1a,_0x573822,_0x799f('0x62'));})[_0x799f('0x2f')](function(){return setRelationship(_0x1c9bee,_0x338f85,_0x573822,'contacts');})[_0x799f('0x2f')](function(){return getServerInfo(_0x1c9bee);})['then'](function(_0x2bdb29){var _0x217a44=parseInt(_0x2bdb29[_0x799f('0x64')][_0x799f('0x65')](0x0));var _0x157f82=util['format'](_0x799f('0x66'),_0xd453a9[_0x799f('0x56')],_0x573822['id']);if(_0x217a44>0x6){_0x157f82=util[_0x799f('0x23')](_0x799f('0x67'),_0xd453a9['remoteUri'],_0x573822['id']);}logger[_0x799f('0x29')](_0x799f('0x70'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x799f('0x23')]('user:%s',_0x4e0f61[_0x799f('0xb')]),_0x799f('0x6a'),{'uri':_0x157f82});})[_0x799f('0x6b')](function(_0x17987b){logger['error'](_0x799f('0x70'),JSON[_0x799f('0x21')](_0x17987b));});};exports[_0x799f('0x75')]=function(_0x22c1a2,_0x3989fe,_0x20c6e9,_0x5cce50,_0x18d258,_0x42cbb0){var _0x12a787,_0xedede7,_0x2238d1,_0x14d6d7;_0x42cbb0['remoteUri']=intUtil['stripTrailingSlash'](_0x42cbb0['remoteUri']);_0x42cbb0['serverUrl']=intUtil[_0x799f('0x55')](_0x42cbb0['serverUrl']);def[_0x799f('0x6e')]=util[_0x799f('0x23')](_0x799f('0x58'),_0x42cbb0['remoteUri']);if(_0x18d258&&_0x18d258[_0x799f('0x59')]){logger[_0x799f('0x29')]('['+_0x3989fe[_0x799f('0x76')]['toUpperCase']()+']',_0x799f('0x77'));_0x3989fe[_0x799f('0x71')]=util['format'](_0x799f('0x5b'),_0x42cbb0['serverUrl'],_0x3989fe[_0x799f('0x5c')],md5(_0x3989fe[_0x799f('0x5c')]));}else{_0x3989fe[_0x799f('0x71')]='';}return getConnection(_0x42cbb0)[_0x799f('0x2f')](function(_0x4857c3){_0x14d6d7=_0x4857c3;if(!_['isNil'](_0x5cce50)){return getUser(_0x42cbb0,_0x5cce50[_0x799f('0xb')],_0x14d6d7);}else{return getUser(_0x42cbb0,null,_0x14d6d7);}})[_0x799f('0x2f')](function(_0x5947c1){_0x12a787=_0x5947c1;logger['info'](_0x799f('0x72'),_0x12a787['id']);return getEndUser(_0x42cbb0,_0x3989fe[_0x799f('0x5d')],_0x3989fe['calleridnum'],_0x14d6d7);})['then'](function(_0x249d78){_0xedede7=_0x249d78;logger[_0x799f('0x29')]('The\x20Enduser\x20ID\x20is:',_0xedede7['id']);return getTicket(_0x42cbb0,_0x12a787,_0xedede7,_0x20c6e9,_0x3989fe,_0x20c6e9['Fields'],_0x14d6d7,_0x799f('0x78'));})[_0x799f('0x2f')](function(_0x3d4c03){_0x2238d1=_0x3d4c03;logger[_0x799f('0x29')](_0x799f('0x60'));logger[_0x799f('0x29')](_0x799f('0x61'),_0x2238d1['id']);return setRelationship(_0x14d6d7,_0x12a787,_0x2238d1,'users');})['then'](function(){return setRelationship(_0x14d6d7,_0xedede7,_0x2238d1,_0x799f('0x63'));})[_0x799f('0x2f')](function(){return getServerInfo(_0x14d6d7);})[_0x799f('0x6b')](function(_0x263e9d){logger[_0x799f('0x6c')]('['+_0x3989fe[_0x799f('0x76')][_0x799f('0x79')]()+']',JSON[_0x799f('0x21')](_0x263e9d));});}; \ No newline at end of file +var _0x8763=['Inbound','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','outbound','stripTrailingSlash','none','Outbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','user:%s','lastevent','toUpperCase','lodash','util','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','Contacts','length','forEach','variableName','push','idField','JSON','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','stringify','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','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','format','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','type','string','nameField','customField','toLowerCase','content','custom_fields','variable','Variable','username','password','PLAIN','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','queue','remoteUri','serverUrl','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'];(function(_0x4d785f,_0xf8868f){var _0x6ab99e=function(_0x286447){while(--_0x286447){_0x4d785f['push'](_0x4d785f['shift']());}};_0x6ab99e(++_0xf8868f);}(_0x8763,0x89));var _0x3876=function(_0x559cfc,_0x89480e){_0x559cfc=_0x559cfc-0x0;var _0x22734f=_0x8763[_0x559cfc];return _0x22734f;};'use strict';var _=require(_0x3876('0x0'));var rp=require('request-promise');var BPromise=require('bluebird');var md5=require('md5');var util=require(_0x3876('0x1'));var Redis=require('ioredis');var intUtil=require(_0x3876('0x2'));var config=require(_0x3876('0x3'));var logger=require(_0x3876('0x4'))(_0x3876('0x5'));config[_0x3876('0x6')]=_[_0x3876('0x7')](config[_0x3876('0x6')],{'host':_0x3876('0x8'),'port':0x18eb});var io=require(_0x3876('0x9'))(new Redis(config[_0x3876('0x6')]));var def={'method':_0x3876('0xa'),'json':!![]};function emit(_0x23cc22,_0x47b711,_0x3f14b5){io['to'](_0x23cc22)[_0x3876('0xb')](_0x47b711,_0x3f14b5);}function getTicket(_0x1efe70,_0x140bbb,_0x117d23,_0x48c82b,_0x4d37c0,_0x25f160,_0x396691,_0x1eed83){logger[_0x3876('0xc')](_0x3876('0xd'));var _0x4463f7=new Date();var _0xf9036d=[{'name':_0x3876('0xe'),'value':intUtil[_0x3876('0xf')](_0x48c82b[_0x3876('0x10')],_0x4d37c0,'\x20')},{'name':_0x3876('0x11'),'value':_0x140bbb['id']},{'name':_0x3876('0x12'),'value':_0x140bbb['id']},{'name':_0x3876('0x13'),'value':intUtil[_0x3876('0xf')](_0x48c82b[_0x3876('0x14')],_0x4d37c0,'\x0a')},{'name':'date_start','value':_0x4463f7[_0x3876('0x15')]()[_0x3876('0x16')](0x0,0x13)[_0x3876('0x17')]('T','\x20')},{'name':_0x3876('0x18'),'value':'0'},{'name':_0x3876('0x19'),'value':'15'},{'name':_0x3876('0x1a'),'value':_0x117d23['id']},{'name':'parent_type','value':_0x3876('0x1b')},{'name':'parent_name','value':_0x117d23[_0x3876('0xe')]},{'name':'direction','value':_0x1eed83}];if(_0x25f160[_0x3876('0x1c')]){_[_0x3876('0x1d')](_0x25f160,function(_0x1f1e90){if(_0x4d37c0[_0x1f1e90[_0x3876('0x1e')]]){_0xf9036d[_0x3876('0x1f')]({'name':_0x1f1e90[_0x3876('0x20')],'value':_0x4d37c0[_0x1f1e90[_0x3876('0x1e')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x3876('0x21'),'response_type':_0x3876('0x21'),'rest_data':JSON['stringify']({'session':_0x396691['id'],'module_name':'Calls','name_value_list':_0xf9036d})}});}function getAuth(_0x237654){return util['format']('Basic\x20%s',new Buffer(_0x237654[_0x3876('0x22')]+':X')[_0x3876('0x23')](_0x3876('0x24')));}function getServerInfo(_0x5a73ba){return request({'form':{'method':_0x3876('0x25'),'input_type':_0x3876('0x21'),'response_type':_0x3876('0x21'),'rest_data':JSON['stringify']({'session':_0x5a73ba['id']})}});}function getUser(_0x39d908,_0x45f06c,_0x5af75b){if(!_[_0x3876('0x26')](_0x45f06c)){logger[_0x3876('0xc')](_0x3876('0x27'),_0x45f06c);return request({'form':{'method':_0x3876('0x28'),'input_type':'JSON','response_type':_0x3876('0x21'),'rest_data':JSON[_0x3876('0x29')]({'session':_0x5af75b['id'],'module_name':_0x3876('0x2a'),'query':util['format'](_0x3876('0x2b'),_0x45f06c),'order_by':'','offset':'0','select_fields':['id','name',_0x3876('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3876('0x2d')](function(_0x276f17){if(_0x276f17[_0x3876('0x2e')][_0x3876('0x1c')]){var _0x2de532=_[_0x3876('0x2f')](_0x276f17['entry_list'],function(_0xa96226){return _0xa96226[_0x3876('0x30')][_0x3876('0x2c')][_0x3876('0x31')]===_0x45f06c;});if(_0x2de532){logger['info'](_0x3876('0x32'));return BPromise[_0x3876('0x33')]({'id':_0x2de532[_0x3876('0x30')]['id'][_0x3876('0x31')],'name':_0x2de532['name_value_list'][_0x3876('0xe')][_0x3876('0x31')]});}}logger[_0x3876('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x3876('0x33')]({'id':_0x5af75b[_0x3876('0x30')][_0x3876('0x34')][_0x3876('0x31')],'name':_0x5af75b[_0x3876('0x30')][_0x3876('0x2c')][_0x3876('0x31')]});});}else{logger[_0x3876('0xc')](_0x3876('0x35'));return BPromise['resolve']({'id':_0x5af75b[_0x3876('0x30')][_0x3876('0x34')]['value'],'name':_0x5af75b[_0x3876('0x30')][_0x3876('0x2c')]['value']});}}function getEndUser(_0x413367,_0x538c53,_0x5bb692,_0x3f3ff3){logger['info']('Searching\x20enduser\x20with\x20phone',_0x5bb692);return request({'form':{'method':_0x3876('0x28'),'input_type':'JSON','response_type':_0x3876('0x21'),'rest_data':JSON['stringify']({'session':_0x3f3ff3['id'],'module_name':'Contacts','query':util[_0x3876('0x36')](_0x3876('0x37'),_0x5bb692),'order_by':'','offset':'0','select_fields':['id',_0x3876('0xe'),_0x3876('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3876('0x2d')](function(_0x10d199){if(_0x10d199[_0x3876('0x2e')]['length']){var _0x4004a1=_['find'](_0x10d199['entry_list'],function(_0x37aa43){return _0x37aa43[_0x3876('0x30')][_0x3876('0x38')][_0x3876('0x31')]===_0x5bb692;});if(_0x4004a1){logger[_0x3876('0xc')](_0x3876('0x39'));return BPromise['resolve']({'id':_0x4004a1[_0x3876('0x30')]['id'][_0x3876('0x31')],'name':_0x4004a1[_0x3876('0x30')][_0x3876('0xe')][_0x3876('0x31')],'phone':_0x4004a1[_0x3876('0x30')][_0x3876('0x38')][_0x3876('0x31')]});}}else{logger['info'](_0x3876('0x3a'));return request({'form':{'method':_0x3876('0x3b'),'input_type':'JSON','response_type':_0x3876('0x21'),'rest_data':JSON[_0x3876('0x29')]({'session':_0x3f3ff3['id'],'module_name':_0x3876('0x1b'),'name_value_list':[{'name':_0x3876('0x3c'),'value':_0x538c53!==_0x3876('0x3d')?_0x538c53:util[_0x3876('0x36')](_0x3876('0x3e'),_0x5bb692)},{'name':_0x3876('0x38'),'value':_0x5bb692}]})}})[_0x3876('0x2d')](function(_0x2f20dc){logger[_0x3876('0xc')](_0x3876('0x3f'));return BPromise[_0x3876('0x33')]({'id':_0x2f20dc['id'],'name':_0x2f20dc[_0x3876('0x2e')]['first_name']['value'],'phone':_0x2f20dc['entry_list'][_0x3876('0x38')][_0x3876('0x31')]});});}});}function request(_0x3340b2){logger[_0x3876('0x40')](_0x3876('0x41'),JSON[_0x3876('0x29')](_0x3340b2));return rp(_['merge'](def,_0x3340b2));}function getTags(_0x38aaa7,_0x391e2e){var _0x100915=[];if(_0x38aaa7&&_0x38aaa7[_0x3876('0x1c')]>0x0){_0x100915=_['map'](_0x38aaa7,_0x391e2e);}return _0x100915;}function getCustomFields(_0x3a7c94,_0x2a106d){var _0x3a93d2=[];var _0x19713e={'custom_fields':[]};if(_0x3a7c94[_0x3876('0x1c')]>0x0){_[_0x3876('0x1d')](_0x3a7c94,function(_0x5dc1a3){if(_0x5dc1a3[_0x3876('0x42')]===_0x3876('0x43')&&_0x5dc1a3[_0x3876('0x44')]&&!_0x5dc1a3[_0x3876('0x45')]){_0x19713e[_0x5dc1a3[_0x3876('0x44')][_0x3876('0x46')]()]=_0x5dc1a3[_0x3876('0x47')][_0x3876('0x23')]();}else if(_0x5dc1a3[_0x3876('0x42')]==='string'&&_0x5dc1a3[_0x3876('0x20')]&&_0x5dc1a3['customField']){_0x19713e[_0x3876('0x48')][_0x3876('0x1f')]({'id':_0x5dc1a3[_0x3876('0x20')],'value':_0x5dc1a3[_0x3876('0x47')][_0x3876('0x23')]()});}else if(_0x5dc1a3['type']===_0x3876('0x49')&&_0x5dc1a3[_0x3876('0x1e')]&&_0x5dc1a3[_0x3876('0x20')]&&_0x5dc1a3['customField']){_0x2a106d[_0x5dc1a3['variableName']]&&_0x19713e[_0x3876('0x48')]['push']({'id':_0x5dc1a3[_0x3876('0x20')],'value':_0x2a106d[_0x5dc1a3['variableName']][_0x3876('0x23')]()});}else if(_0x5dc1a3[_0x3876('0x42')]==='customVariable'&&_0x5dc1a3[_0x3876('0x4a')]&&_0x5dc1a3[_0x3876('0x4a')][_0x3876('0xe')]&&_0x5dc1a3[_0x3876('0x20')]&&_0x5dc1a3['customField']){_0x2a106d[_0x5dc1a3[_0x3876('0x4a')]['name']['toLowerCase']()]&&_0x19713e['custom_fields'][_0x3876('0x1f')]({'id':_0x5dc1a3[_0x3876('0x20')],'value':_0x2a106d[_0x5dc1a3[_0x3876('0x4a')][_0x3876('0xe')]['toLowerCase']()][_0x3876('0x23')]()});}});}return _0x19713e;}function getConnection(_0x46e89d){return request({'method':_0x3876('0xa'),'form':{'method':'login','input_type':_0x3876('0x21'),'response_type':_0x3876('0x21'),'rest_data':JSON[_0x3876('0x29')]({'user_auth':{'user_name':_0x46e89d[_0x3876('0x4b')],'password':_0x46e89d[_0x3876('0x4c')],'encryption':_0x3876('0x4d')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x3876('0x2d')](function(_0x12e388){var _0x496056=_0x12e388;if(_0x496056['id']){def['sessionID']=_0x496056['id'];return BPromise['resolve'](_0x496056);}else{throw new Error(util['format'](_0x3876('0x4e'),_0x46e89d['id']));}});}function setRelationship(_0x402e32,_0x365885,_0x47de2c,_0x1abbf2){return request({'form':{'method':_0x3876('0x4f'),'input_type':_0x3876('0x21'),'response_type':_0x3876('0x21'),'rest_data':JSON[_0x3876('0x29')]({'session':_0x402e32['id'],'module_name':_0x3876('0x50'),'module_id':_0x47de2c['id'],'link_field_name':_0x1abbf2,'related_ids':[_0x365885['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x3876('0x51')]=function(_0x20183d,_0x2536e4,_0x3f5138,_0x5391b9,_0x1caa99,_0x24449c){var _0x2f83d3,_0x19ef19,_0x488d2b,_0x37ad8e;_0x24449c['remoteUri']=intUtil['stripTrailingSlash'](_0x24449c[_0x3876('0x52')]);_0x24449c[_0x3876('0x53')]=intUtil['stripTrailingSlash'](_0x24449c[_0x3876('0x53')]);def[_0x3876('0x54')]=util[_0x3876('0x36')](_0x3876('0x55'),_0x24449c['remoteUri']);if(_0x1caa99&&_0x1caa99[_0x3876('0x56')]){logger[_0x3876('0xc')](_0x3876('0x57'),_0x3876('0x58'));_0x2536e4[_0x3876('0x59')]=util[_0x3876('0x36')](_0x3876('0x5a'),_0x24449c[_0x3876('0x53')],_0x2536e4[_0x3876('0x5b')],md5(_0x2536e4['uniqueid']));}else{_0x2536e4[_0x3876('0x59')]='';}return getConnection(_0x24449c)['then'](function(_0x34944b){_0x37ad8e=_0x34944b;return getUser(_0x24449c,_0x5391b9[_0x3876('0xe')],_0x37ad8e);})[_0x3876('0x2d')](function(_0xdacdd0){_0x2f83d3=_0xdacdd0;logger[_0x3876('0xc')](_0x3876('0x5c'),_0x2f83d3['id']);return getEndUser(_0x24449c,_0x2536e4[_0x3876('0x5d')],_0x2536e4[_0x3876('0x5e')],_0x37ad8e);})[_0x3876('0x2d')](function(_0x12e9ae){_0x19ef19=_0x12e9ae;logger['info'](_0x3876('0x5f'),_0x19ef19['id']);return getTicket(_0x24449c,_0x2f83d3,_0x19ef19,_0x3f5138,_0x2536e4,_0x3f5138[_0x3876('0x60')],_0x37ad8e,_0x3876('0x61'));})[_0x3876('0x2d')](function(_0x19121d){_0x488d2b=_0x19121d;logger[_0x3876('0xc')]('Ticket\x20created!');logger[_0x3876('0xc')]('The\x20Ticket\x20ID\x20is:',_0x488d2b['id']);return setRelationship(_0x37ad8e,_0x2f83d3,_0x488d2b,'users');})[_0x3876('0x2d')](function(){return setRelationship(_0x37ad8e,_0x19ef19,_0x488d2b,_0x3876('0x62'));})[_0x3876('0x2d')](function(){return getServerInfo(_0x37ad8e);})[_0x3876('0x2d')](function(_0x53715f){var _0x5ce1a9=parseInt(_0x53715f[_0x3876('0x63')][_0x3876('0x64')](0x0));var _0x101735=util[_0x3876('0x36')](_0x3876('0x65'),_0x24449c[_0x3876('0x52')],_0x488d2b['id']);if(_0x5ce1a9>0x6){_0x101735=util[_0x3876('0x36')](_0x3876('0x66'),_0x24449c[_0x3876('0x52')],_0x488d2b['id']);}logger[_0x3876('0xc')](_0x3876('0x57'),_0x3876('0x67'));emit(util[_0x3876('0x36')]('user:%s',_0x5391b9[_0x3876('0xe')]),_0x3876('0x68'),{'uri':_0x101735});})[_0x3876('0x69')](function(_0x4d7bcb){logger[_0x3876('0x6a')](_0x3876('0x57'),JSON[_0x3876('0x29')](_0x4d7bcb));});};exports[_0x3876('0x6b')]=function(_0xd9c98b,_0x1f55e9,_0x4484ef,_0x26b75e,_0x6c2c22,_0x34eb6c,_0x55187e){var _0xacb4d8,_0x35533d,_0x38a308,_0xac9320;_0x34eb6c[_0x3876('0x52')]=intUtil[_0x3876('0x6c')](_0x34eb6c['remoteUri']);_0x34eb6c['serverUrl']=intUtil[_0x3876('0x6c')](_0x34eb6c[_0x3876('0x53')]);def[_0x3876('0x54')]=util[_0x3876('0x36')](_0x3876('0x55'),_0x34eb6c['remoteUri']);if(_0x55187e&&_0x55187e['recordingFormat']&&_0x55187e['recordingFormat']!==_0x3876('0x6d')){logger[_0x3876('0xc')]('[OUTBOUND]',_0x3876('0x58'));_0x1f55e9['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x34eb6c[_0x3876('0x53')],_0x1f55e9[_0x3876('0x5b')],md5(_0x1f55e9['uniqueid']));}return getConnection(_0x34eb6c)[_0x3876('0x2d')](function(_0x5f1f14){_0xac9320=_0x5f1f14;return getUser(_0x34eb6c,_0x26b75e[_0x3876('0xe')],_0xac9320);})[_0x3876('0x2d')](function(_0x3777a1){_0xacb4d8=_0x3777a1;logger[_0x3876('0xc')](_0x3876('0x5c'),_0xacb4d8['id']);return getEndUser(_0x34eb6c,_0x1f55e9['destcalleridname'],_0x1f55e9['destcalleridnum'],_0xac9320);})['then'](function(_0x2a83bf){_0x35533d=_0x2a83bf;logger[_0x3876('0xc')](_0x3876('0x5f'),_0x35533d['id']);return getTicket(_0x34eb6c,_0xacb4d8,_0x35533d,_0x4484ef,_0x1f55e9,_0x4484ef[_0x3876('0x60')],_0xac9320,_0x3876('0x6e'));})[_0x3876('0x2d')](function(_0x52ddcf){_0x38a308=_0x52ddcf;logger['info'](_0x3876('0x6f'));logger['info'](_0x3876('0x70'),_0x38a308['id']);return setRelationship(_0xac9320,_0xacb4d8,_0x38a308,_0x3876('0x71'));})['then'](function(){return setRelationship(_0xac9320,_0x35533d,_0x38a308,'contacts');})[_0x3876('0x2d')](function(){return getServerInfo(_0xac9320);})[_0x3876('0x2d')](function(_0x5663d0){var _0x1bb5be=parseInt(_0x5663d0[_0x3876('0x63')][_0x3876('0x64')](0x0));var _0x5d934c=util[_0x3876('0x36')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x34eb6c['remoteUri'],_0x38a308['id']);if(_0x1bb5be>0x6){_0x5d934c=util[_0x3876('0x36')](_0x3876('0x66'),_0x34eb6c[_0x3876('0x52')],_0x38a308['id']);}logger[_0x3876('0xc')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3876('0x36')](_0x3876('0x72'),_0x26b75e[_0x3876('0xe')]),'trigger:browser:url',{'uri':_0x5d934c});})['catch'](function(_0xf950b2){logger['error']('[OUTBOUND]',JSON[_0x3876('0x29')](_0xf950b2));});};exports['unmanaged']=function(_0x5d2c0e,_0x2ec309,_0x16323e,_0x14aafe,_0x2eb2dd,_0x35726c){var _0x157586,_0x4715b6,_0x54bd94,_0x1db34c;_0x35726c[_0x3876('0x52')]=intUtil['stripTrailingSlash'](_0x35726c[_0x3876('0x52')]);_0x35726c[_0x3876('0x53')]=intUtil[_0x3876('0x6c')](_0x35726c[_0x3876('0x53')]);def[_0x3876('0x54')]=util[_0x3876('0x36')]('%s/service/v4_1/rest.php',_0x35726c[_0x3876('0x52')]);if(_0x2eb2dd&&_0x2eb2dd[_0x3876('0x56')]){logger['info']('['+_0x2ec309[_0x3876('0x73')][_0x3876('0x74')]()+']',_0x3876('0x58'));_0x2ec309['recordingURL']=util['format'](_0x3876('0x5a'),_0x35726c[_0x3876('0x53')],_0x2ec309[_0x3876('0x5b')],md5(_0x2ec309[_0x3876('0x5b')]));}else{_0x2ec309[_0x3876('0x59')]='';}return getConnection(_0x35726c)[_0x3876('0x2d')](function(_0x2fe0e9){_0x1db34c=_0x2fe0e9;if(!_['isNil'](_0x14aafe)){return getUser(_0x35726c,_0x14aafe[_0x3876('0xe')],_0x1db34c);}else{return getUser(_0x35726c,null,_0x1db34c);}})[_0x3876('0x2d')](function(_0x125d2d){_0x157586=_0x125d2d;logger[_0x3876('0xc')]('The\x20User\x20ID\x20is:',_0x157586['id']);return getEndUser(_0x35726c,_0x2ec309[_0x3876('0x5d')],_0x2ec309['calleridnum'],_0x1db34c);})[_0x3876('0x2d')](function(_0x39c63a){_0x4715b6=_0x39c63a;logger[_0x3876('0xc')](_0x3876('0x5f'),_0x4715b6['id']);return getTicket(_0x35726c,_0x157586,_0x4715b6,_0x16323e,_0x2ec309,_0x16323e[_0x3876('0x60')],_0x1db34c,_0x3876('0x61'));})[_0x3876('0x2d')](function(_0x5ecfc5){_0x54bd94=_0x5ecfc5;logger['info'](_0x3876('0x6f'));logger['info'](_0x3876('0x70'),_0x54bd94['id']);return setRelationship(_0x1db34c,_0x157586,_0x54bd94,_0x3876('0x71'));})[_0x3876('0x2d')](function(){return setRelationship(_0x1db34c,_0x4715b6,_0x54bd94,_0x3876('0x62'));})[_0x3876('0x2d')](function(){return getServerInfo(_0x1db34c);})[_0x3876('0x69')](function(_0x7c9183){logger[_0x3876('0x6a')]('['+_0x2ec309[_0x3876('0x73')][_0x3876('0x74')]()+']',JSON[_0x3876('0x29')](_0x7c9183));});}; \ 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 887741c..1dd2a18 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 _0xa540=['slice','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','%s:\x20%s','keyContent','keyType','key','format','join'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0xa540,0x155));var _0x0a54=function(_0x29aefc,_0x4dcf53){_0x29aefc=_0x29aefc-0x0;var _0x11be36=_0xa540[_0x29aefc];return _0x11be36;};'use strict';var _=require(_0x0a54('0x0'));var util=require(_0x0a54('0x1'));exports[_0x0a54('0x2')]=function(_0x55af57,_0x1f82ef,_0x55d678){var _0x14cad5=[];if(_0x55af57[_0x0a54('0x3')]>0x0){var _0x806683=_[_0x0a54('0x4')](_0x55af57,['id']);for(var _0x337bac=0x0;_0x337bac<_0x806683[_0x0a54('0x3')];_0x337bac++){var _0x15ecbd=_0x806683[_0x337bac];if(_0x15ecbd[_0x0a54('0x5')]===_0x0a54('0x6')){_0x14cad5[_0x0a54('0x7')](_0x15ecbd[_0x0a54('0x8')]);}else if(_0x15ecbd[_0x0a54('0x5')]===_0x0a54('0x9')&&_0x15ecbd[_0x0a54('0xa')]){_0x1f82ef[_0x15ecbd[_0x0a54('0xa')]]&&_0x14cad5[_0x0a54('0x7')](_0x1f82ef[_0x15ecbd[_0x0a54('0xa')]][_0x0a54('0xb')]());}else if(_0x15ecbd[_0x0a54('0x5')]===_0x0a54('0xc')&&_0x15ecbd[_0x0a54('0xd')]&&_0x15ecbd[_0x0a54('0xd')][_0x0a54('0xe')]){_0x1f82ef[_0x15ecbd[_0x0a54('0xd')]['name'][_0x0a54('0xf')]()]&&_0x14cad5['push'](_0x1f82ef[_0x15ecbd[_0x0a54('0xd')][_0x0a54('0xe')][_0x0a54('0xf')]()]['toString']());}else if(_0x15ecbd[_0x0a54('0x5')]===_0x0a54('0x10')){if(_0x15ecbd['keyType']===_0x0a54('0x6')&&_0x15ecbd['key']){_0x14cad5['push'](util['format'](_0x0a54('0x11'),_0x15ecbd['key'],_0x15ecbd[_0x0a54('0x12')]));}else if(_0x15ecbd[_0x0a54('0x13')]===_0x0a54('0x9')&&_0x15ecbd[_0x0a54('0xa')]&&_0x15ecbd[_0x0a54('0x14')]){_0x1f82ef[_0x15ecbd[_0x0a54('0xa')]]&&_0x14cad5[_0x0a54('0x7')](util[_0x0a54('0x15')]('%s:\x20%s',_0x15ecbd[_0x0a54('0x14')],_0x1f82ef[_0x15ecbd['variableName']]));}else if(_0x15ecbd['keyType']===_0x0a54('0xc')&&_0x15ecbd[_0x0a54('0xd')]&&_0x15ecbd[_0x0a54('0xd')][_0x0a54('0xe')]&&_0x15ecbd[_0x0a54('0x14')]){_0x1f82ef[_0x15ecbd[_0x0a54('0xd')]['name']['toLowerCase']()]&&_0x14cad5[_0x0a54('0x7')](util['format'](_0x0a54('0x11'),_0x15ecbd[_0x0a54('0x14')],_0x1f82ef[_0x15ecbd[_0x0a54('0xd')][_0x0a54('0xe')][_0x0a54('0xf')]()]));}}}}return _0x14cad5[_0x0a54('0x16')](_0x55d678);};exports['stripTrailingSlash']=function(_0x33fb71){var _0xf6b4b9=_0x33fb71[_0x0a54('0x17')](-0x1);if(_0xf6b4b9==='/'){_0x33fb71=_0x33fb71['substring'](0x0,_0x33fb71[_0x0a54('0x18')](_0xf6b4b9));}return _0x33fb71;};exports[_0x0a54('0x19')]=function(_0xbf144f){if(!_[_0x0a54('0x1a')](_0xbf144f)&&_0xbf144f!==''){var _0x3a66c5=/^(([^<>()\[\]\\.,;:\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 _0x3a66c5[_0x0a54('0x1b')](String(_0xbf144f)[_0x0a54('0xf')]());}else{return![];}}; \ No newline at end of file +var _0xd9c9=['type','string','content','variable','variableName','push','toString','Variable','name','toLowerCase','keyValue','keyType','format','%s:\x20%s','key','keyContent','slice','substring','lastIndexOf','isNil','test','lodash','util','getString','length'];(function(_0x795fcc,_0x57d6ba){var _0x5d634e=function(_0x417344){while(--_0x417344){_0x795fcc['push'](_0x795fcc['shift']());}};_0x5d634e(++_0x57d6ba);}(_0xd9c9,0x1be));var _0x9d9c=function(_0x59e903,_0x303626){_0x59e903=_0x59e903-0x0;var _0x21e3f6=_0xd9c9[_0x59e903];return _0x21e3f6;};'use strict';var _=require(_0x9d9c('0x0'));var util=require(_0x9d9c('0x1'));exports[_0x9d9c('0x2')]=function(_0x95dc7e,_0x1ed1cf,_0x14f20c){var _0x8fd703=[];if(_0x95dc7e['length']>0x0){var _0x19b931=_['sortBy'](_0x95dc7e,['id']);for(var _0x9c2eaa=0x0;_0x9c2eaa<_0x19b931[_0x9d9c('0x3')];_0x9c2eaa++){var _0x388913=_0x19b931[_0x9c2eaa];if(_0x388913[_0x9d9c('0x4')]===_0x9d9c('0x5')){_0x8fd703['push'](_0x388913[_0x9d9c('0x6')]);}else if(_0x388913[_0x9d9c('0x4')]===_0x9d9c('0x7')&&_0x388913[_0x9d9c('0x8')]){_0x1ed1cf[_0x388913[_0x9d9c('0x8')]]&&_0x8fd703[_0x9d9c('0x9')](_0x1ed1cf[_0x388913[_0x9d9c('0x8')]][_0x9d9c('0xa')]());}else if(_0x388913['type']==='customVariable'&&_0x388913['Variable']&&_0x388913[_0x9d9c('0xb')][_0x9d9c('0xc')]){_0x1ed1cf[_0x388913[_0x9d9c('0xb')][_0x9d9c('0xc')][_0x9d9c('0xd')]()]&&_0x8fd703[_0x9d9c('0x9')](_0x1ed1cf[_0x388913[_0x9d9c('0xb')][_0x9d9c('0xc')][_0x9d9c('0xd')]()][_0x9d9c('0xa')]());}else if(_0x388913[_0x9d9c('0x4')]===_0x9d9c('0xe')){if(_0x388913[_0x9d9c('0xf')]===_0x9d9c('0x5')&&_0x388913['key']){_0x8fd703[_0x9d9c('0x9')](util[_0x9d9c('0x10')](_0x9d9c('0x11'),_0x388913[_0x9d9c('0x12')],_0x388913[_0x9d9c('0x13')]));}else if(_0x388913[_0x9d9c('0xf')]==='variable'&&_0x388913[_0x9d9c('0x8')]&&_0x388913[_0x9d9c('0x12')]){_0x1ed1cf[_0x388913[_0x9d9c('0x8')]]&&_0x8fd703['push'](util[_0x9d9c('0x10')](_0x9d9c('0x11'),_0x388913['key'],_0x1ed1cf[_0x388913[_0x9d9c('0x8')]]));}else if(_0x388913['keyType']==='customVariable'&&_0x388913['Variable']&&_0x388913[_0x9d9c('0xb')][_0x9d9c('0xc')]&&_0x388913[_0x9d9c('0x12')]){_0x1ed1cf[_0x388913[_0x9d9c('0xb')][_0x9d9c('0xc')][_0x9d9c('0xd')]()]&&_0x8fd703[_0x9d9c('0x9')](util[_0x9d9c('0x10')](_0x9d9c('0x11'),_0x388913['key'],_0x1ed1cf[_0x388913['Variable'][_0x9d9c('0xc')][_0x9d9c('0xd')]()]));}}}}return _0x8fd703['join'](_0x14f20c);};exports['stripTrailingSlash']=function(_0x4caadf){var _0x215b4b=_0x4caadf[_0x9d9c('0x14')](-0x1);if(_0x215b4b==='/'){_0x4caadf=_0x4caadf[_0x9d9c('0x15')](0x0,_0x4caadf[_0x9d9c('0x16')](_0x215b4b));}return _0x4caadf;};exports['validateEmail']=function(_0x3155e2){if(!_[_0x9d9c('0x17')](_0x3155e2)&&_0x3155e2!==''){var _0x1c0ca0=/^(([^<>()\[\]\\.,;:\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 _0x1c0ca0[_0x9d9c('0x18')](String(_0x3155e2)[_0x9d9c('0xd')]());}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 97747cf..36254c5 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 _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(_0x7d62cb,_0x7622c){var _0x3a6266=function(_0x1cc5fa){while(--_0x1cc5fa){_0x7d62cb['push'](_0x7d62cb['shift']());}};_0x3a6266(++_0x7622c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'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 +var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x2fe11a,_0x8848c6){var _0xe60e7b=function(_0x23f6d2){while(--_0x23f6d2){_0x2fe11a['push'](_0x2fe11a['shift']());}};_0xe60e7b(++_0x8848c6);}(_0x9c44,0x178));var _0x49c4=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9c44[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 79095d3..e94faf5 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 _0xca66=['Basic\x20%s','toString','debug','GET','map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','idField','push','variable','variableName','customVariable','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','trigger:browser:url','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','lastevent','lodash','request-promise','md5','util','./util','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','info','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','end-user','first','Enduser\x20found!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','username','password','token','%s/token:%s'];(function(_0x2a6a20,_0x15c025){var _0x4ddd35=function(_0x25fa21){while(--_0x25fa21){_0x2a6a20['push'](_0x2a6a20['shift']());}};_0x4ddd35(++_0x15c025);}(_0xca66,0xa8));var _0x6ca6=function(_0x4c15ed,_0xafbd63){_0x4c15ed=_0x4c15ed-0x0;var _0x18f12d=_0xca66[_0x4c15ed];return _0x18f12d;};'use strict';var _=require(_0x6ca6('0x0'));var rp=require(_0x6ca6('0x1'));var md5=require(_0x6ca6('0x2'));var util=require(_0x6ca6('0x3'));var Redis=require('ioredis');var intUtil=require(_0x6ca6('0x4'));var config=require('../../../../config/environment');var logger=require(_0x6ca6('0x5'))(_0x6ca6('0x6'));config['redis']=_['defaults'](config[_0x6ca6('0x7')],{'host':_0x6ca6('0x8'),'port':0x18eb});var io=require(_0x6ca6('0x9'))(new Redis(config['redis']));function emit(_0x373f9b,_0x23f708,_0x52840a){io['to'](_0x373f9b)[_0x6ca6('0xa')](_0x23f708,_0x52840a);}var headers={'Content-Type':_0x6ca6('0xb'),'Accept':_0x6ca6('0xb')};function getTicket(_0x284ea1,_0x137b4c,_0x10821c,_0x3a81d6,_0x196aee){logger['info'](_0x6ca6('0xc'));return request({'uri':util[_0x6ca6('0xd')](_0x6ca6('0xe'),_0x284ea1[_0x6ca6('0xf')]),'method':_0x6ca6('0x10'),'body':{'ticket':_[_0x6ca6('0x11')]({'requester_id':_0x10821c['id'],'submitter_id':_0x137b4c?_0x137b4c['id']:undefined,'assignee_id':_0x137b4c?_0x137b4c['id']:undefined,'tags':getTags(_0x3a81d6[_0x6ca6('0x12')],_0x6ca6('0x13')),'subject':intUtil[_0x6ca6('0x14')](_0x3a81d6[_0x6ca6('0x15')],_0x196aee,'\x20'),'description':intUtil['getString'](_0x3a81d6[_0x6ca6('0x16')],_0x196aee,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x3a81d6[_0x6ca6('0x16')],_0x196aee,'\x0a')}},getCustomFields(_0x3a81d6[_0x6ca6('0x17')],_0x196aee))}})[_0x6ca6('0x18')](function(_0x368ae4){logger[_0x6ca6('0x19')](_0x6ca6('0x1a'));return _0x368ae4['ticket'];});}function getUser(_0x434eb4,_0x1c562f){if(intUtil[_0x6ca6('0x1b')](_0x1c562f)){logger[_0x6ca6('0x19')](_0x6ca6('0x1c'),_0x1c562f);return request({'uri':util[_0x6ca6('0xd')](_0x6ca6('0x1d'),_0x434eb4['remoteUri']),'qs':{'query':util[_0x6ca6('0xd')](_0x6ca6('0x1e'),_0x1c562f)}})[_0x6ca6('0x18')](function(_0x5d406d){if(_0x5d406d[_0x6ca6('0x1f')]){logger[_0x6ca6('0x19')](_0x6ca6('0x20'));return _[_0x6ca6('0x21')](_0x5d406d[_0x6ca6('0x22')],{'email':_0x1c562f,'role':_0x6ca6('0x23')});}else{logger['info'](_0x6ca6('0x24'));return request({'uri':util[_0x6ca6('0xd')](_0x6ca6('0x25'),_0x434eb4[_0x6ca6('0xf')])})[_0x6ca6('0x18')](function(_0x5dab90){logger[_0x6ca6('0x19')]('Admin\x20account\x20selected.');return _0x5dab90[_0x6ca6('0x26')];});}});}else{logger[_0x6ca6('0x19')](_0x6ca6('0x24'));return request({'uri':util[_0x6ca6('0xd')]('%s/users/me.json',_0x434eb4[_0x6ca6('0xf')])})['then'](function(_0x444892){logger[_0x6ca6('0x19')](_0x6ca6('0x27'));return _0x444892[_0x6ca6('0x26')];});}}function getEndUser(_0x2e28a3,_0x4d428e,_0x1bd3ec){logger[_0x6ca6('0x19')](_0x6ca6('0x28'),_0x1bd3ec);return request({'uri':util[_0x6ca6('0xd')](_0x6ca6('0x1d'),_0x2e28a3[_0x6ca6('0xf')]),'qs':{'query':util['format'](_0x6ca6('0x29'),_0x1bd3ec)}})[_0x6ca6('0x18')](function(_0x3972ef){var _0x141642;if(_0x3972ef['results'][_0x6ca6('0x2a')]){_0x3972ef[_0x6ca6('0x22')]=_['filter'](_0x3972ef[_0x6ca6('0x22')],{'suspended':![],'role':_0x6ca6('0x2b')});if(_0x3972ef[_0x6ca6('0x22')][_0x6ca6('0x2a')]){_0x141642=_[_0x6ca6('0x2c')](_0x3972ef[_0x6ca6('0x22')]);}}if(_0x141642){logger[_0x6ca6('0x19')](_0x6ca6('0x2d'));return _0x141642;}else{logger[_0x6ca6('0x19')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x6ca6('0xd')](_0x6ca6('0x2e'),_0x2e28a3[_0x6ca6('0xf')]),'method':'POST','body':{'user':{'role':_0x6ca6('0x2b'),'name':util[_0x6ca6('0xd')](_0x6ca6('0x2f'),_0x4d428e||_0x1bd3ec),'phone':_0x1bd3ec}}})[_0x6ca6('0x18')](function(_0x10fe7e){logger['info'](_0x6ca6('0x30'));return _0x10fe7e[_0x6ca6('0x26')];});}});}function getAuth(_0x1e5041){var _0x2b2999;if(_0x1e5041[_0x6ca6('0x31')]==='password'){_0x2b2999=util[_0x6ca6('0xd')]('%s:%s',_0x1e5041[_0x6ca6('0x32')],_0x1e5041[_0x6ca6('0x33')]);}else if(_0x1e5041[_0x6ca6('0x31')]===_0x6ca6('0x34')){_0x2b2999=util['format'](_0x6ca6('0x35'),_0x1e5041[_0x6ca6('0x32')],_0x1e5041['token']);}return util[_0x6ca6('0xd')](_0x6ca6('0x36'),new Buffer(_0x2b2999)[_0x6ca6('0x37')]('base64'));}function request(_0x5d373d){logger[_0x6ca6('0x38')]('[HTTP]',JSON['stringify'](_0x5d373d));return rp(_['defaults'](_0x5d373d,{'method':_0x6ca6('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x4c26ee,_0xba4e85){var _0x293df7=[];if(_0x4c26ee&&_0x4c26ee[_0x6ca6('0x2a')]>0x0){_0x293df7=_[_0x6ca6('0x3a')](_0x4c26ee,_0xba4e85);}return _0x293df7;}function getCustomFields(_0x2ffe74,_0x2aa599){var _0x1f92d1=[];var _0x102b0a={'custom_fields':[]};if(_0x2ffe74[_0x6ca6('0x2a')]>0x0){_[_0x6ca6('0x3b')](_0x2ffe74,function(_0x441692){if(_[_0x6ca6('0x3c')]([_0x6ca6('0x3d'),_0x6ca6('0x3e')],_0x441692['type'])&&_0x441692[_0x6ca6('0x3f')]&&!_0x441692[_0x6ca6('0x40')]){_0x102b0a[_0x441692[_0x6ca6('0x3f')][_0x6ca6('0x41')]()]=_0x441692[_0x6ca6('0x42')][_0x6ca6('0x37')]();}else if(_[_0x6ca6('0x3c')](['string',_0x6ca6('0x3e')],_0x441692[_0x6ca6('0x43')])&&_0x441692[_0x6ca6('0x44')]&&_0x441692[_0x6ca6('0x40')]){_0x102b0a['custom_fields'][_0x6ca6('0x45')]({'id':_0x441692[_0x6ca6('0x44')],'value':_0x441692[_0x6ca6('0x42')][_0x6ca6('0x37')]()});}else if(_0x441692[_0x6ca6('0x43')]===_0x6ca6('0x46')&&_0x441692[_0x6ca6('0x47')]&&_0x441692[_0x6ca6('0x44')]&&_0x441692['customField']){_0x2aa599[_0x441692[_0x6ca6('0x47')]]&&_0x102b0a['custom_fields']['push']({'id':_0x441692['idField'],'value':_0x2aa599[_0x441692['variableName']][_0x6ca6('0x37')]()});}else if(_0x441692['type']===_0x6ca6('0x48')&&_0x441692[_0x6ca6('0x49')]&&_0x441692[_0x6ca6('0x49')][_0x6ca6('0x13')]&&_0x441692[_0x6ca6('0x44')]&&_0x441692[_0x6ca6('0x40')]){_0x2aa599[_0x441692[_0x6ca6('0x49')][_0x6ca6('0x13')][_0x6ca6('0x41')]()]&&_0x102b0a['custom_fields'][_0x6ca6('0x45')]({'id':_0x441692[_0x6ca6('0x44')],'value':_0x2aa599[_0x441692[_0x6ca6('0x49')]['name']['toLowerCase']()][_0x6ca6('0x37')]()});}});}return _0x102b0a;}exports[_0x6ca6('0x4a')]=function(_0x305397,_0x5a67de,_0xcd51a9,_0x5544c0,_0x3771f0,_0x98121){var _0x176344,_0x18b704;_0x98121[_0x6ca6('0xf')]=intUtil['stripTrailingSlash'](_0x98121[_0x6ca6('0xf')]);_0x98121[_0x6ca6('0x4b')]=intUtil[_0x6ca6('0x4c')](_0x98121[_0x6ca6('0x4b')]);if(_0x3771f0&&_0x3771f0[_0x6ca6('0x4d')]){logger[_0x6ca6('0x19')](_0x6ca6('0x4e'),_0x6ca6('0x4f'));_0x5a67de[_0x6ca6('0x50')]=util[_0x6ca6('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x98121[_0x6ca6('0x4b')],_0x5a67de['uniqueid'],md5(_0x5a67de[_0x6ca6('0x51')]));}else{_0x5a67de[_0x6ca6('0x50')]='';}headers[_0x6ca6('0x52')]=getAuth(_0x98121);return getUser(_0x98121,_0x5544c0[_0x6ca6('0x53')])['then'](function(_0x5d1653){_0x176344=_0x5d1653;logger[_0x6ca6('0x19')](_0x6ca6('0x54'),_0x176344['id']);return getEndUser(_0x98121,_0x5a67de[_0x6ca6('0x55')],_0x5a67de[_0x6ca6('0x56')]);})['then'](function(_0x40009a){_0x18b704=_0x40009a;logger[_0x6ca6('0x19')](_0x6ca6('0x57'),_0x18b704['id']);return getTicket(_0x98121,_0x176344,_0x18b704,_0xcd51a9,_0x5a67de);})['then'](function(_0x271d3a){if(_0x271d3a){logger[_0x6ca6('0x19')](_0x6ca6('0x58'),_0x271d3a['id']);switch(_0x98121['type']){case _0x6ca6('0x59'):logger[_0x6ca6('0x19')]('[QUEUE]',_0x6ca6('0x5a'));return request({'uri':util[_0x6ca6('0xd')](_0x6ca6('0x5b'),_0x98121[_0x6ca6('0xf')],_0x176344['id'],_0x271d3a['id']),'method':'POST'});case _0x6ca6('0x5c'):logger[_0x6ca6('0x19')](_0x6ca6('0x4e'),_0x6ca6('0x5d'));emit(util['format']('user:%s',_0x5544c0[_0x6ca6('0x13')]),'trigger:browser:url',{'uri':util[_0x6ca6('0xd')](_0x6ca6('0x5e'),_0x98121[_0x6ca6('0xf')][_0x6ca6('0x5f')](_0x6ca6('0x60'),''),_0x271d3a['id'])});break;default:logger[_0x6ca6('0x61')]('[QUEUE]',_0x6ca6('0x62'));}}})[_0x6ca6('0x63')](function(_0x16972c){logger[_0x6ca6('0x61')](_0x6ca6('0x64'),util[_0x6ca6('0x65')](_0x16972c,{'showHidden':!![],'depth':null}));});};exports[_0x6ca6('0x66')]=function(_0x1821f2,_0x12764f,_0x2e7c01,_0x5f21a7,_0x3b7722,_0x43a283,_0x44bec6){var _0x2166bb,_0x399f0a;_0x43a283['remoteUri']=intUtil[_0x6ca6('0x4c')](_0x43a283['remoteUri']);_0x43a283[_0x6ca6('0x4b')]=intUtil[_0x6ca6('0x4c')](_0x43a283[_0x6ca6('0x4b')]);if(_0x44bec6&&_0x44bec6['recordingFormat']&&_0x44bec6[_0x6ca6('0x67')]!==_0x6ca6('0x68')){logger['info'](_0x6ca6('0x69'),'Recording\x20is\x20enabled!');_0x12764f[_0x6ca6('0x50')]=util[_0x6ca6('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x43a283[_0x6ca6('0x4b')],_0x12764f['uniqueid'],md5(_0x12764f[_0x6ca6('0x51')]));}headers['Authorization']=getAuth(_0x43a283);return getUser(_0x43a283,_0x5f21a7[_0x6ca6('0x53')])['then'](function(_0x5c3ba8){_0x2166bb=_0x5c3ba8;logger['info'](_0x6ca6('0x54'),_0x2166bb['id']);return getEndUser(_0x43a283,_0x12764f[_0x6ca6('0x6a')],_0x12764f['destcalleridnum']);})['then'](function(_0x3361b5){_0x399f0a=_0x3361b5;logger[_0x6ca6('0x19')](_0x6ca6('0x57'),_0x399f0a['id']);return getTicket(_0x43a283,_0x2166bb,_0x399f0a,_0x2e7c01,_0x12764f);})['then'](function(_0x4fbb90){if(_0x4fbb90){logger[_0x6ca6('0x19')]('The\x20Ticket\x20ID\x20is:',_0x4fbb90['id']);switch(_0x43a283[_0x6ca6('0x43')]){case'integrationTab':logger[_0x6ca6('0x19')]('[OUTBOUND]',_0x6ca6('0x5a'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x43a283[_0x6ca6('0xf')],_0x2166bb['id'],_0x4fbb90['id']),'method':'POST'});case _0x6ca6('0x5c'):logger[_0x6ca6('0x19')](_0x6ca6('0x69'),_0x6ca6('0x5d'));emit(util[_0x6ca6('0xd')]('user:%s',_0x5f21a7[_0x6ca6('0x13')]),_0x6ca6('0x6b'),{'uri':util[_0x6ca6('0xd')](_0x6ca6('0x5e'),_0x43a283[_0x6ca6('0xf')][_0x6ca6('0x5f')](_0x6ca6('0x60'),''),_0x4fbb90['id'])});break;default:logger['error'](_0x6ca6('0x69'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x23fa54){logger[_0x6ca6('0x61')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x23fa54,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x5efbcb,_0x4a7a8b,_0x2c5fb4,_0x2fdd39,_0x3c914d,_0x1653d9){var _0x49899b,_0x97bb73;_0x1653d9[_0x6ca6('0xf')]=intUtil['stripTrailingSlash'](_0x1653d9[_0x6ca6('0xf')]);_0x1653d9[_0x6ca6('0x4b')]=intUtil[_0x6ca6('0x4c')](_0x1653d9['serverUrl']);if(_0x3c914d&&_0x3c914d['monitor_format']){logger[_0x6ca6('0x19')]('['+_0x4a7a8b['lastevent'][_0x6ca6('0x6c')]()+']',_0x6ca6('0x4f'));_0x4a7a8b[_0x6ca6('0x50')]=util[_0x6ca6('0xd')](_0x6ca6('0x6d'),_0x1653d9[_0x6ca6('0x4b')],_0x4a7a8b['uniqueid'],md5(_0x4a7a8b['uniqueid']));}else{_0x4a7a8b[_0x6ca6('0x50')]='';}headers[_0x6ca6('0x52')]=getAuth(_0x1653d9);return getUser(_0x1653d9)[_0x6ca6('0x18')](function(_0x5b52a5){_0x49899b=_0x5b52a5;logger[_0x6ca6('0x19')](_0x6ca6('0x54'),_0x49899b['id']);return getEndUser(_0x1653d9,_0x4a7a8b[_0x6ca6('0x55')],_0x4a7a8b['calleridnum']);})[_0x6ca6('0x18')](function(_0x2301c1){_0x97bb73=_0x2301c1;logger[_0x6ca6('0x19')]('The\x20Enduser\x20ID\x20is:',_0x97bb73['id']);return getTicket(_0x1653d9,_0x49899b,_0x97bb73,_0x2c5fb4,_0x4a7a8b);})[_0x6ca6('0x18')](function(_0x3eb298){if(_0x3eb298){logger[_0x6ca6('0x19')](_0x6ca6('0x58'),_0x3eb298['id']);}})[_0x6ca6('0x63')](function(_0x5a0021){logger[_0x6ca6('0x61')]('['+_0x4a7a8b[_0x6ca6('0x6e')][_0x6ca6('0x6c')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x5a0021,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x421d=['custom_fields','push','variable','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','trigger:browser:url','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','The\x20Ticket\x20ID\x20is:','integrationTab','[OUTBOUND]','%s/agent/tickets/%s','replace','lastevent','toUpperCase','lodash','md5','util','ioredis','./util','../../../../config/environment','zendesk','defaults','redis','localhost','socket.io-emitter','emit','application/json','info','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','then','count','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','authType','password','%s:%s','username','token','%s/token:%s','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','type','customField','nameField','content','toString','picklist','idField'];(function(_0x3dce5d,_0x2657d7){var _0x303d00=function(_0x2f0175){while(--_0x2f0175){_0x3dce5d['push'](_0x3dce5d['shift']());}};_0x303d00(++_0x2657d7);}(_0x421d,0x16d));var _0xd421=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x421d[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0xd421('0x0'));var rp=require('request-promise');var md5=require(_0xd421('0x1'));var util=require(_0xd421('0x2'));var Redis=require(_0xd421('0x3'));var intUtil=require(_0xd421('0x4'));var config=require(_0xd421('0x5'));var logger=require('../../../../config/logger')(_0xd421('0x6'));config['redis']=_[_0xd421('0x7')](config[_0xd421('0x8')],{'host':_0xd421('0x9'),'port':0x18eb});var io=require(_0xd421('0xa'))(new Redis(config['redis']));function emit(_0x4add72,_0xb2430d,_0x40afef){io['to'](_0x4add72)[_0xd421('0xb')](_0xb2430d,_0x40afef);}var headers={'Content-Type':_0xd421('0xc'),'Accept':_0xd421('0xc')};function getTicket(_0x46fa2b,_0x5a045f,_0x38739f,_0x1cc442,_0x29a318){logger[_0xd421('0xd')]('Creating\x20new\x20ticket...');return request({'uri':util[_0xd421('0xe')](_0xd421('0xf'),_0x46fa2b[_0xd421('0x10')]),'method':_0xd421('0x11'),'body':{'ticket':_[_0xd421('0x12')]({'requester_id':_0x38739f['id'],'submitter_id':_0x5a045f?_0x5a045f['id']:undefined,'assignee_id':_0x5a045f?_0x5a045f['id']:undefined,'tags':getTags(_0x1cc442[_0xd421('0x13')],_0xd421('0x14')),'subject':intUtil[_0xd421('0x15')](_0x1cc442[_0xd421('0x16')],_0x29a318,'\x20'),'description':intUtil[_0xd421('0x15')](_0x1cc442[_0xd421('0x17')],_0x29a318,'\x0a'),'comment':{'public':![],'body':intUtil[_0xd421('0x15')](_0x1cc442[_0xd421('0x17')],_0x29a318,'\x0a')}},getCustomFields(_0x1cc442[_0xd421('0x18')],_0x29a318))}})['then'](function(_0x2a0e70){logger[_0xd421('0xd')]('Ticket\x20created!');return _0x2a0e70[_0xd421('0x19')];});}function getUser(_0x56cdd4,_0x3c4749){if(intUtil[_0xd421('0x1a')](_0x3c4749)){logger[_0xd421('0xd')](_0xd421('0x1b'),_0x3c4749);return request({'uri':util['format'](_0xd421('0x1c'),_0x56cdd4[_0xd421('0x10')]),'qs':{'query':util[_0xd421('0xe')]('type:user\x20role:agent\x20email:%s',_0x3c4749)}})[_0xd421('0x1d')](function(_0x1622d9){if(_0x1622d9[_0xd421('0x1e')]){logger[_0xd421('0xd')]('Agent\x20found!');return _[_0xd421('0x1f')](_0x1622d9[_0xd421('0x20')],{'email':_0x3c4749,'role':_0xd421('0x21')});}else{logger[_0xd421('0xd')](_0xd421('0x22'));return request({'uri':util[_0xd421('0xe')](_0xd421('0x23'),_0x56cdd4[_0xd421('0x10')])})[_0xd421('0x1d')](function(_0x4b7fc3){logger[_0xd421('0xd')](_0xd421('0x24'));return _0x4b7fc3[_0xd421('0x25')];});}});}else{logger[_0xd421('0xd')](_0xd421('0x22'));return request({'uri':util[_0xd421('0xe')]('%s/users/me.json',_0x56cdd4[_0xd421('0x10')])})[_0xd421('0x1d')](function(_0x18ba68){logger[_0xd421('0xd')](_0xd421('0x24'));return _0x18ba68['user'];});}}function getEndUser(_0x5da4cf,_0x4630c2,_0x4c911c){logger[_0xd421('0xd')]('Searching\x20enduser\x20with\x20phone',_0x4c911c);return request({'uri':util['format'](_0xd421('0x1c'),_0x5da4cf['remoteUri']),'qs':{'query':util['format'](_0xd421('0x26'),_0x4c911c)}})['then'](function(_0x5aa5ac){var _0x2a4630;if(_0x5aa5ac[_0xd421('0x20')][_0xd421('0x27')]){_0x5aa5ac[_0xd421('0x20')]=_[_0xd421('0x28')](_0x5aa5ac[_0xd421('0x20')],{'suspended':![],'role':_0xd421('0x29')});if(_0x5aa5ac['results'][_0xd421('0x27')]){_0x2a4630=_[_0xd421('0x2a')](_0x5aa5ac[_0xd421('0x20')]);}}if(_0x2a4630){logger[_0xd421('0xd')]('Enduser\x20found!');return _0x2a4630;}else{logger[_0xd421('0xd')](_0xd421('0x2b'));return request({'uri':util[_0xd421('0xe')]('%s/users.json',_0x5da4cf[_0xd421('0x10')]),'method':_0xd421('0x11'),'body':{'user':{'role':_0xd421('0x29'),'name':util[_0xd421('0xe')](_0xd421('0x2c'),_0x4630c2||_0x4c911c),'phone':_0x4c911c}}})[_0xd421('0x1d')](function(_0x5ad336){logger[_0xd421('0xd')]('Enduser\x20created.');return _0x5ad336[_0xd421('0x25')];});}});}function getAuth(_0x25f1ea){var _0x41138d;if(_0x25f1ea[_0xd421('0x2d')]===_0xd421('0x2e')){_0x41138d=util['format'](_0xd421('0x2f'),_0x25f1ea[_0xd421('0x30')],_0x25f1ea[_0xd421('0x2e')]);}else if(_0x25f1ea[_0xd421('0x2d')]===_0xd421('0x31')){_0x41138d=util[_0xd421('0xe')](_0xd421('0x32'),_0x25f1ea[_0xd421('0x30')],_0x25f1ea[_0xd421('0x31')]);}return util[_0xd421('0xe')]('Basic\x20%s',new Buffer(_0x41138d)['toString'](_0xd421('0x33')));}function request(_0x2d30a4){logger[_0xd421('0x34')](_0xd421('0x35'),JSON[_0xd421('0x36')](_0x2d30a4));return rp(_[_0xd421('0x7')](_0x2d30a4,{'method':_0xd421('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x5a73c7,_0x17cd47){var _0x14611b=[];if(_0x5a73c7&&_0x5a73c7['length']>0x0){_0x14611b=_[_0xd421('0x38')](_0x5a73c7,_0x17cd47);}return _0x14611b;}function getCustomFields(_0x5b679e,_0x1244a7){var _0x2c4708=[];var _0x1f7a25={'custom_fields':[]};if(_0x5b679e[_0xd421('0x27')]>0x0){_[_0xd421('0x39')](_0x5b679e,function(_0x5c293c){if(_[_0xd421('0x3a')]([_0xd421('0x3b'),'picklist'],_0x5c293c[_0xd421('0x3c')])&&_0x5c293c['nameField']&&!_0x5c293c[_0xd421('0x3d')]){_0x1f7a25[_0x5c293c[_0xd421('0x3e')]['toLowerCase']()]=_0x5c293c[_0xd421('0x3f')][_0xd421('0x40')]();}else if(_[_0xd421('0x3a')](['string',_0xd421('0x41')],_0x5c293c[_0xd421('0x3c')])&&_0x5c293c[_0xd421('0x42')]&&_0x5c293c[_0xd421('0x3d')]){_0x1f7a25[_0xd421('0x43')][_0xd421('0x44')]({'id':_0x5c293c[_0xd421('0x42')],'value':_0x5c293c[_0xd421('0x3f')]['toString']()});}else if(_0x5c293c[_0xd421('0x3c')]===_0xd421('0x45')&&_0x5c293c[_0xd421('0x46')]&&_0x5c293c[_0xd421('0x42')]&&_0x5c293c[_0xd421('0x3d')]){_0x1244a7[_0x5c293c[_0xd421('0x46')]]&&_0x1f7a25[_0xd421('0x43')][_0xd421('0x44')]({'id':_0x5c293c[_0xd421('0x42')],'value':_0x1244a7[_0x5c293c[_0xd421('0x46')]]['toString']()});}else if(_0x5c293c[_0xd421('0x3c')]===_0xd421('0x47')&&_0x5c293c['Variable']&&_0x5c293c['Variable'][_0xd421('0x14')]&&_0x5c293c[_0xd421('0x42')]&&_0x5c293c['customField']){_0x1244a7[_0x5c293c[_0xd421('0x48')]['name'][_0xd421('0x49')]()]&&_0x1f7a25[_0xd421('0x43')]['push']({'id':_0x5c293c[_0xd421('0x42')],'value':_0x1244a7[_0x5c293c[_0xd421('0x48')]['name']['toLowerCase']()][_0xd421('0x40')]()});}});}return _0x1f7a25;}exports[_0xd421('0x4a')]=function(_0x2abafa,_0x476c90,_0x465740,_0xa5492e,_0x4c6c1a,_0x59f60c){var _0x27c1e5,_0x243edf;_0x59f60c['remoteUri']=intUtil[_0xd421('0x4b')](_0x59f60c['remoteUri']);_0x59f60c[_0xd421('0x4c')]=intUtil[_0xd421('0x4b')](_0x59f60c[_0xd421('0x4c')]);if(_0x4c6c1a&&_0x4c6c1a['monitor_format']){logger[_0xd421('0xd')](_0xd421('0x4d'),_0xd421('0x4e'));_0x476c90[_0xd421('0x4f')]=util[_0xd421('0xe')](_0xd421('0x50'),_0x59f60c[_0xd421('0x4c')],_0x476c90[_0xd421('0x51')],md5(_0x476c90['uniqueid']));}else{_0x476c90[_0xd421('0x4f')]='';}headers[_0xd421('0x52')]=getAuth(_0x59f60c);return getUser(_0x59f60c,_0xa5492e['email'])[_0xd421('0x1d')](function(_0x4ea10f){_0x27c1e5=_0x4ea10f;logger[_0xd421('0xd')](_0xd421('0x53'),_0x27c1e5['id']);return getEndUser(_0x59f60c,_0x476c90[_0xd421('0x54')],_0x476c90[_0xd421('0x55')]);})[_0xd421('0x1d')](function(_0x55d5ce){_0x243edf=_0x55d5ce;logger[_0xd421('0xd')](_0xd421('0x56'),_0x243edf['id']);return getTicket(_0x59f60c,_0x27c1e5,_0x243edf,_0x465740,_0x476c90);})[_0xd421('0x1d')](function(_0x33378d){if(_0x33378d){logger[_0xd421('0xd')]('The\x20Ticket\x20ID\x20is:',_0x33378d['id']);switch(_0x59f60c[_0xd421('0x3c')]){case'integrationTab':logger[_0xd421('0xd')](_0xd421('0x4d'),_0xd421('0x57'));return request({'uri':util[_0xd421('0xe')](_0xd421('0x58'),_0x59f60c[_0xd421('0x10')],_0x27c1e5['id'],_0x33378d['id']),'method':_0xd421('0x11')});case _0xd421('0x59'):logger[_0xd421('0xd')](_0xd421('0x4d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd421('0xe')](_0xd421('0x5a'),_0xa5492e[_0xd421('0x14')]),_0xd421('0x5b'),{'uri':util[_0xd421('0xe')]('%s/agent/tickets/%s',_0x59f60c[_0xd421('0x10')]['replace'](_0xd421('0x5c'),''),_0x33378d['id'])});break;default:logger[_0xd421('0x5d')](_0xd421('0x4d'),_0xd421('0x5e'));}}})[_0xd421('0x5f')](function(_0xe31a2e){logger[_0xd421('0x5d')](_0xd421('0x60'),util[_0xd421('0x61')](_0xe31a2e,{'showHidden':!![],'depth':null}));});};exports[_0xd421('0x62')]=function(_0x246de5,_0xe29e43,_0x3e97e7,_0x443ada,_0x3284c2,_0x4f8522,_0x2b404e){var _0x20f75c,_0x245182;_0x4f8522['remoteUri']=intUtil[_0xd421('0x4b')](_0x4f8522[_0xd421('0x10')]);_0x4f8522['serverUrl']=intUtil[_0xd421('0x4b')](_0x4f8522[_0xd421('0x4c')]);if(_0x2b404e&&_0x2b404e[_0xd421('0x63')]&&_0x2b404e['recordingFormat']!==_0xd421('0x64')){logger[_0xd421('0xd')]('[OUTBOUND]',_0xd421('0x4e'));_0xe29e43[_0xd421('0x4f')]=util[_0xd421('0xe')](_0xd421('0x50'),_0x4f8522[_0xd421('0x4c')],_0xe29e43[_0xd421('0x51')],md5(_0xe29e43[_0xd421('0x51')]));}headers[_0xd421('0x52')]=getAuth(_0x4f8522);return getUser(_0x4f8522,_0x443ada['email'])[_0xd421('0x1d')](function(_0x278ad4){_0x20f75c=_0x278ad4;logger[_0xd421('0xd')]('The\x20User\x20ID\x20is:',_0x20f75c['id']);return getEndUser(_0x4f8522,_0xe29e43['destcalleridname'],_0xe29e43['destcalleridnum']);})['then'](function(_0x258704){_0x245182=_0x258704;logger[_0xd421('0xd')](_0xd421('0x56'),_0x245182['id']);return getTicket(_0x4f8522,_0x20f75c,_0x245182,_0x3e97e7,_0xe29e43);})['then'](function(_0x89246f){if(_0x89246f){logger[_0xd421('0xd')](_0xd421('0x65'),_0x89246f['id']);switch(_0x4f8522[_0xd421('0x3c')]){case _0xd421('0x66'):logger[_0xd421('0xd')](_0xd421('0x67'),_0xd421('0x57'));return request({'uri':util[_0xd421('0xe')](_0xd421('0x58'),_0x4f8522[_0xd421('0x10')],_0x20f75c['id'],_0x89246f['id']),'method':_0xd421('0x11')});case _0xd421('0x59'):logger[_0xd421('0xd')](_0xd421('0x67'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd421('0xe')]('user:%s',_0x443ada[_0xd421('0x14')]),_0xd421('0x5b'),{'uri':util['format'](_0xd421('0x68'),_0x4f8522[_0xd421('0x10')][_0xd421('0x69')](_0xd421('0x5c'),''),_0x89246f['id'])});break;default:logger['error']('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xd421('0x5f')](function(_0x28ab08){logger[_0xd421('0x5d')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x28ab08,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x3359b3,_0x332f0b,_0xaf18f0,_0x5de9ea,_0x277196,_0x1a4dc1){var _0x807b00,_0x2a7948;_0x1a4dc1['remoteUri']=intUtil[_0xd421('0x4b')](_0x1a4dc1[_0xd421('0x10')]);_0x1a4dc1[_0xd421('0x4c')]=intUtil[_0xd421('0x4b')](_0x1a4dc1['serverUrl']);if(_0x277196&&_0x277196['monitor_format']){logger[_0xd421('0xd')]('['+_0x332f0b[_0xd421('0x6a')][_0xd421('0x6b')]()+']',_0xd421('0x4e'));_0x332f0b[_0xd421('0x4f')]=util[_0xd421('0xe')](_0xd421('0x50'),_0x1a4dc1[_0xd421('0x4c')],_0x332f0b[_0xd421('0x51')],md5(_0x332f0b[_0xd421('0x51')]));}else{_0x332f0b[_0xd421('0x4f')]='';}headers['Authorization']=getAuth(_0x1a4dc1);return getUser(_0x1a4dc1)[_0xd421('0x1d')](function(_0x4dcc57){_0x807b00=_0x4dcc57;logger[_0xd421('0xd')]('The\x20User\x20ID\x20is:',_0x807b00['id']);return getEndUser(_0x1a4dc1,_0x332f0b[_0xd421('0x54')],_0x332f0b[_0xd421('0x55')]);})['then'](function(_0x27300e){_0x2a7948=_0x27300e;logger[_0xd421('0xd')](_0xd421('0x56'),_0x2a7948['id']);return getTicket(_0x1a4dc1,_0x807b00,_0x2a7948,_0xaf18f0,_0x332f0b);})[_0xd421('0x1d')](function(_0x16cf09){if(_0x16cf09){logger['info']('The\x20Ticket\x20ID\x20is:',_0x16cf09['id']);}})[_0xd421('0x5f')](function(_0x5ede68){logger[_0xd421('0x5d')]('['+_0x332f0b[_0xd421('0x6a')][_0xd421('0x6b')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x5ede68,{'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 51c5196..22af8f2 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 _0xfe17=['trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','zoho.eu','com','destcalleridname','destcalleridnum','unmanaged','toUpperCase','calleridname','lodash','request-promise','md5','util','./util','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','length','forEach','string','picklist','type','idField','toString','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','user','profile','The\x20failing\x20result\x20is','stringify','error','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','data','enduserType','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','startCase','log','CREATE\x20ERROR','contact_lead','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Creating\x20new\x20call...','Owner','Subject','Description','getString','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','mm:ss','answertime','utc','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','Call_Result','Called','complete','Answered','Rejected','abandoned','Abandoned','timeout','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','code','SUCCESS','Call\x20created!','details','err','queue','host','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','/downloads?type=uniqueid&token=','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s'];(function(_0x1e56a6,_0xd738){var _0x2fc61b=function(_0x1d19d0){while(--_0x1d19d0){_0x1e56a6['push'](_0x1e56a6['shift']());}};_0x2fc61b(++_0xd738);}(_0xfe17,0x147));var _0x7fe1=function(_0x8de0d9,_0x464925){_0x8de0d9=_0x8de0d9-0x0;var _0x584c98=_0xfe17[_0x8de0d9];return _0x584c98;};'use strict';var _=require(_0x7fe1('0x0'));var rp=require(_0x7fe1('0x1'));var md5=require(_0x7fe1('0x2'));var util=require(_0x7fe1('0x3'));var intUtil=require(_0x7fe1('0x4'));var moment=require(_0x7fe1('0x5'));var Redis=require(_0x7fe1('0x6'));var BPromise=require('bluebird');var config=require(_0x7fe1('0x7'));var logger=require(_0x7fe1('0x8'))(_0x7fe1('0x9'));config[_0x7fe1('0xa')]=_[_0x7fe1('0xb')](config['redis'],{'host':_0x7fe1('0xc'),'port':0x18eb});var io=require(_0x7fe1('0xd'))(new Redis(config[_0x7fe1('0xa')]));function emit(_0x37b6a0,_0x856a9a,_0x2a29dd){io['to'](_0x37b6a0)[_0x7fe1('0xe')](_0x856a9a,_0x2a29dd);}function request(_0x112e3e){logger[_0x7fe1('0xf')]('[HTTP]',JSON['stringify'](_0x112e3e));return rp(_0x112e3e);}function getCustomFields(_0x501e79,_0x1f0f54){var _0x2abd29={};if(_0x501e79[_0x7fe1('0x10')]>0x0){_[_0x7fe1('0x11')](_0x501e79,function(_0x206ab4){if(_['includes']([_0x7fe1('0x12'),_0x7fe1('0x13')],_0x206ab4[_0x7fe1('0x14')])&&_0x206ab4[_0x7fe1('0x15')]){_0x2abd29[_0x206ab4['idField']]=_0x206ab4['content'][_0x7fe1('0x16')]();}else if(_0x206ab4['type']==='variable'&&_0x206ab4['variableName']&&_0x206ab4['idField']&&_0x1f0f54[_0x206ab4[_0x7fe1('0x17')]]){_0x2abd29[_0x206ab4['idField']]=_0x1f0f54[_0x206ab4[_0x7fe1('0x17')]][_0x7fe1('0x16')]();}else if(_0x206ab4[_0x7fe1('0x14')]===_0x7fe1('0x18')&&_0x206ab4[_0x7fe1('0x19')]&&_0x206ab4[_0x7fe1('0x19')][_0x7fe1('0x1a')]&&_0x206ab4[_0x7fe1('0x15')]&&_0x1f0f54[_0x206ab4[_0x7fe1('0x19')][_0x7fe1('0x1a')][_0x7fe1('0x1b')]()]){_0x2abd29[_0x206ab4['idField']]=_0x1f0f54[_0x206ab4[_0x7fe1('0x19')][_0x7fe1('0x1a')][_0x7fe1('0x1b')]()][_0x7fe1('0x16')]();}});}return _0x2abd29;}function getName(_0x9e8d09){if(_0x9e8d09[_0x7fe1('0x1c')]('\x20')>0x0){var _0x1f3e30=_0x9e8d09[_0x7fe1('0x1d')](/ (.+)/);if(_0x1f3e30[0x1]){return _0x1f3e30;}}return[_0x9e8d09,_0x9e8d09];}var accountsTokens={};function getAccessToken(_0xff32db){return new Promise(function(_0x286a0f,_0x4264d6){if(!_['isNil'](accountsTokens[_0xff32db['id']])&&!_[_0x7fe1('0x1e')](accountsTokens[_0xff32db['id']][_0x7fe1('0x1f')])){if(moment()[_0x7fe1('0x20')](accountsTokens[_0xff32db['id']][_0x7fe1('0x21')])){_0x286a0f(accountsTokens[_0xff32db['id']][_0x7fe1('0x1f')]);}}var _0x1bf1f1;switch(_0xff32db[_0x7fe1('0x22')]){case'US':_0x1bf1f1=_0x7fe1('0x23');break;case'AU':_0x1bf1f1=_0x7fe1('0x24');break;case'EU':_0x1bf1f1='https://accounts.zoho.eu';break;case'IN':_0x1bf1f1=_0x7fe1('0x25');break;case'CN':_0x1bf1f1=_0x7fe1('0x26');break;default:_0x1bf1f1=_0x7fe1('0x27');break;}var _0x52de79={'method':_0x7fe1('0x28'),'uri':_0x1bf1f1+_0x7fe1('0x29'),'qs':{'refresh_token':_0xff32db[_0x7fe1('0x2a')],'client_id':_0xff32db[_0x7fe1('0x2b')],'client_secret':_0xff32db[_0x7fe1('0x2c')],'grant_type':_0x7fe1('0x2d')},'json':!![]};return rp(_0x52de79)[_0x7fe1('0x2e')](function(_0x311c88){accountsTokens[_0xff32db['id']]={'access_token':_0x311c88[_0x7fe1('0x1f')],'expires_in':moment()[_0x7fe1('0x2f')](_0x311c88[_0x7fe1('0x21')],_0x7fe1('0x30'))};_0x286a0f(_0x311c88['access_token']);})['catch'](function(_0x3e53eb){logger['error'](_0x7fe1('0x31'),_0x3e53eb[_0x7fe1('0x32')]);_0x4264d6(_0x3e53eb);});});}function getUser(_0x599b02,_0x1e8a08,_0x3a1372,_0xbb82dc){logger[_0x7fe1('0x33')](_0x7fe1('0x34'));return request({'method':_0x7fe1('0x35'),'uri':util[_0x7fe1('0x36')](_0x7fe1('0x37'),_0x1e8a08),'qs':{'type':_0x7fe1('0x38')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x599b02},'json':!![]})[_0x7fe1('0x2e')](function(_0x3aa65b){if(_0x3aa65b[_0x7fe1('0x39')]){var _0x1495e3=-0x1;if(_[_0x7fe1('0x3a')](_0x3aa65b[_0x7fe1('0x39')])){if(!_[_0x7fe1('0x1e')](_0xbb82dc)){_0x1495e3=_[_0x7fe1('0x3b')](_0x3aa65b['users'],function(_0xd44a72){return _0xd44a72[_0x7fe1('0x3c')]===_0xbb82dc;});}if(_0x1495e3>=0x0){logger[_0x7fe1('0x33')](_0x7fe1('0x3d'));}else{logger[_0x7fe1('0x33')](_0x7fe1('0x3e'));_0x1495e3=_[_0x7fe1('0x3b')](_0x3aa65b[_0x7fe1('0x39')],function(_0x349da2){return _0x349da2['profile'][_0x7fe1('0x1a')]==='Administrator';});}return _0x3aa65b[_0x7fe1('0x39')][_0x1495e3];}else{if(_0x3aa65b[_0x7fe1('0x3f')][_0x7fe1('0x40')][_0x7fe1('0x1a')]==='Administrator'){logger[_0x7fe1('0x33')](_0x7fe1('0x3e'));user=_0x3aa65b[_0x7fe1('0x3f')];return user;}else{logger['error'](_0x7fe1('0x41'),JSON[_0x7fe1('0x42')](_0x3aa65b));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x7fe1('0x42')](_0x3aa65b));}}}else{logger[_0x7fe1('0x43')]('The\x20failing\x20result\x20is',JSON[_0x7fe1('0x42')](_0x3aa65b));throw new Error(_0x7fe1('0x44')+JSON[_0x7fe1('0x42')](_0x3aa65b));}})[_0x7fe1('0x45')](function(_0x58fcfc){console['error'](_0x58fcfc);});}function getZohoUser(_0x4327f4,_0x2acce5){return new BPromise(function(_0x10e688,_0x1e37c5){request(_0x4327f4)[_0x7fe1('0x2e')](function(_0x41d7d1){var _0x3a35f0=null;if(_0x41d7d1){_0x3a35f0=_0x41d7d1[_0x7fe1('0x46')][0x0];_0x3a35f0[_0x7fe1('0x47')]=_0x2acce5;}_0x10e688(_0x3a35f0);})['catch'](function(_0x3655a0){_0x1e37c5(_0x3655a0);});});}function createEndUser(_0x2c3a92,_0x307e77,_0x5e537,_0x5eeced,_0x7aad83,_0x2f3fb7){var _0x5e537=getName(_0x5e537);return request({'method':'POST','uri':'https://www.zohoapis.'+_0x307e77+'/crm/v2/'+_['startCase'](_0x2f3fb7[_0x7fe1('0x48')])+'s','body':{'data':[{'Last_Name':_0x5e537[0x1],'First_Name':_0x5e537[0x0],'Phone':_0x5eeced,'Owner':{'name':!_[_0x7fe1('0x1e')](_0x7aad83['role'][_0x7fe1('0x1a')])?_0x7aad83[_0x7fe1('0x49')][_0x7fe1('0x1a')]:!_[_0x7fe1('0x1e')](_0x7aad83['first_name'])?_0x7aad83[_0x7fe1('0x4a')]+'\x20'+_0x7aad83[_0x7fe1('0x4b')]:_0x7aad83['last_name'],'id':_0x7aad83['id']}}]},'headers':{'Authorization':_0x7fe1('0x4c')+_0x2c3a92},'json':!![]})[_0x7fe1('0x2e')](function(_0x1d041c){if(_0x1d041c&&_0x1d041c[_0x7fe1('0x46')][0x0]['code']==='SUCCESS'){var _0x46bcfd=_0x1d041c[_0x7fe1('0x46')][0x0]['details'];_0x46bcfd[_0x7fe1('0x47')]=_[_0x7fe1('0x4d')](_0x2f3fb7[_0x7fe1('0x48')])+'s';return _0x46bcfd;}logger[_0x7fe1('0x43')](_0x7fe1('0x41'),JSON[_0x7fe1('0x42')](data));throw new Error('Error:\x20'+JSON[_0x7fe1('0x42')](data));})[_0x7fe1('0x45')](function(_0x399660){console[_0x7fe1('0x4e')](_0x7fe1('0x4f'),_0x399660);});}function getEndUser(_0x174b7d,_0x559636,_0x1a2a0a,_0x569fc0,_0x41a12f,_0x418444,_0x17a432){var _0x1aad9b={'method':_0x7fe1('0x35'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x174b7d},'json':!![]};switch(_0x17a432['moduleSearch']){case _0x7fe1('0x50'):_0x1aad9b['uri']=_0x7fe1('0x51')+_0x559636+_0x7fe1('0x52')+_0x41a12f+'))';return getZohoUser(_0x1aad9b,'Contacts')[_0x7fe1('0x2e')](function(_0x5007cd){if(_0x5007cd)return _0x5007cd;_0x1aad9b[_0x7fe1('0x53')]=_0x7fe1('0x51')+_0x559636+_0x7fe1('0x54')+_0x41a12f+'))';return getZohoUser(_0x1aad9b,_0x7fe1('0x55'))[_0x7fe1('0x2e')](function(_0x5b58f4){if(_0x5b58f4)return _0x5b58f4;if(_0x17a432[_0x7fe1('0x48')]!=_0x7fe1('0x56')){return createEndUser(_0x174b7d,_0x559636,_0x569fc0,_0x41a12f,_0x418444,_0x17a432);}else{return{};}});});break;case _0x7fe1('0x57'):_0x1aad9b[_0x7fe1('0x53')]=_0x7fe1('0x51')+_0x559636+_0x7fe1('0x52')+_0x41a12f+'))';return getZohoUser(_0x1aad9b,'Contacts')[_0x7fe1('0x2e')](function(_0x55e235){if(_0x55e235)return _0x55e235;if(_0x17a432[_0x7fe1('0x48')]!=_0x7fe1('0x56')){return createEndUser(_0x174b7d,_0x559636,_0x569fc0,_0x41a12f,_0x418444,_0x17a432);}else{return{};}});break;case'lead':_0x1aad9b[_0x7fe1('0x53')]=_0x7fe1('0x51')+_0x559636+_0x7fe1('0x54')+_0x41a12f+'))';return getZohoUser(_0x1aad9b,_0x7fe1('0x55'))[_0x7fe1('0x2e')](function(_0x105ee1){if(_0x105ee1)return _0x105ee1;if(_0x17a432[_0x7fe1('0x48')]!=_0x7fe1('0x56')){return createEndUser(_0x174b7d,_0x559636,_0x569fc0,_0x41a12f,_0x418444,_0x17a432);}else{return{};}});break;}}function getCall(_0x25d123,_0x43b6ed,_0x14cb28,_0x562475,_0x1fb904,_0x1892a2,_0x532b32,_0x55b90d){logger[_0x7fe1('0x33')](_0x7fe1('0x58'));var _0xb7114d={};_0xb7114d[_0x7fe1('0x59')]={'name':!_['isNil'](_0x562475['role'][_0x7fe1('0x1a')])&&!_[_0x7fe1('0x1e')](_0x562475[_0x7fe1('0x40')][_0x7fe1('0x1a')])&&_0x562475[_0x7fe1('0x40')][_0x7fe1('0x1a')]==='administrator'?_0x562475[_0x7fe1('0x49')][_0x7fe1('0x1a')]:!_['isNil'](_0x562475['first_name'])?_0x562475['first_name']+'\x20'+_0x562475[_0x7fe1('0x4b')]:_0x562475['last_name'],'id':_0x562475['id']};_0xb7114d[_0x7fe1('0x5a')]=intUtil['getString'](_0x1892a2['Subjects'],_0x532b32,'\x20');_0xb7114d[_0x7fe1('0x5b')]=intUtil[_0x7fe1('0x5c')](_0x1892a2['Descriptions'],_0x532b32,'\x0a');if(_0x1fb904[_0x7fe1('0x47')]==='Contacts'){_0xb7114d[_0x7fe1('0x5d')]={'name':!_[_0x7fe1('0x1e')](_0x1fb904[_0x7fe1('0x5e')])?_0x1fb904['Full_Name']:!_[_0x7fe1('0x1e')](_0x1fb904[_0x7fe1('0x5f')])?_0x1fb904['First_Name']+'\x20'+_0x1fb904['Last_Name']:_0x1fb904[_0x7fe1('0x60')],'id':_0x1fb904['id']};}if(_0x1fb904[_0x7fe1('0x47')]===_0x7fe1('0x55')){_0xb7114d[_0x7fe1('0x61')]={'name':!_[_0x7fe1('0x1e')](_0x1fb904[_0x7fe1('0x5e')])?_0x1fb904[_0x7fe1('0x5e')]:!_[_0x7fe1('0x1e')](_0x1fb904[_0x7fe1('0x5f')])?_0x1fb904['First_Name']+'\x20'+_0x1fb904['Last_Name']:_0x1fb904[_0x7fe1('0x60')],'id':_0x1fb904['id']};_0xb7114d[_0x7fe1('0x62')]=_[_0x7fe1('0x4d')](_0x1fb904[_0x7fe1('0x47')]);}if(_0x532b32[_0x7fe1('0x63')]){_0xb7114d[_0x7fe1('0x64')]=moment['utc'](parseInt(_0x532b32[_0x7fe1('0x63')])*0x3e8)[_0x7fe1('0x36')](_0x7fe1('0x65'));}else if(_0x532b32[_0x7fe1('0x66')]&&_0x532b32['endtime']){_0xb7114d['Call_Duration']=moment[_0x7fe1('0x67')](moment(_0x532b32['endtime'],_0x7fe1('0x68'))['diff'](moment(_0x532b32[_0x7fe1('0x69')],_0x7fe1('0x68'))))[_0x7fe1('0x36')](_0x7fe1('0x65'));}switch(_0x532b32[_0x7fe1('0x6a')]){case _0x7fe1('0x6b'):_0xb7114d[_0x7fe1('0x6c')]=_0x7fe1('0x6d');break;case _0x7fe1('0x6e'):case'connect':_0xb7114d[_0x7fe1('0x6c')]=_0x7fe1('0x6f');break;case'rejected':_0xb7114d[_0x7fe1('0x6c')]=_0x7fe1('0x70');break;case _0x7fe1('0x71'):_0xb7114d[_0x7fe1('0x6c')]=_0x7fe1('0x72');break;case _0x7fe1('0x73'):_0xb7114d[_0x7fe1('0x6c')]='Timeout';default:}_0xb7114d['Call_Start_Time']=(_0x55b90d===_0x7fe1('0x74')?moment(_0x532b32[_0x7fe1('0x69')])[_0x7fe1('0x36')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x532b32[_0x7fe1('0x75')])[_0x7fe1('0x36')](_0x7fe1('0x68')))||moment()[_0x7fe1('0x36')](_0x7fe1('0x68'));_0xb7114d[_0x7fe1('0x76')]=_0x55b90d||_0x7fe1('0x77');_0xb7114d=_[_0x7fe1('0x78')](_0xb7114d,getCustomFields(_0x1892a2[_0x7fe1('0x79')],_0x532b32));return request({'method':'POST','uri':_0x7fe1('0x51')+_0x43b6ed+_0x7fe1('0x7a'),'headers':{'Authorization':_0x7fe1('0x4c')+_0x25d123},'body':{'data':[_0xb7114d]},'json':!![]})[_0x7fe1('0x2e')](function(_0x2fdd2b){if(_0x2fdd2b&&_0x2fdd2b[_0x7fe1('0x46')][0x0][_0x7fe1('0x7b')]===_0x7fe1('0x7c')){logger[_0x7fe1('0x33')](_0x7fe1('0x7d'));return{'id':_0x2fdd2b[_0x7fe1('0x46')][0x0][_0x7fe1('0x7e')]['id']};}})[_0x7fe1('0x45')](function(_0x261b91){logger['info'](_0x7fe1('0x7f'),_0x261b91[_0x7fe1('0x32')]);console[_0x7fe1('0x4e')](_0x7fe1('0x7f'),_0x261b91);});}exports[_0x7fe1('0x80')]=function(_0x44f4eb,_0x175985,_0xd60ab6,_0x24577d,_0x1fb2c2,_0x40cdcd){var _0xf53f30,_0x1d53a7,_0x14dbb6;_0x40cdcd[_0x7fe1('0x81')]=intUtil['stripTrailingSlash'](_0x40cdcd['host']);_0x40cdcd[_0x7fe1('0x82')]=intUtil['stripTrailingSlash'](_0x40cdcd[_0x7fe1('0x82')]);if(_0x1fb2c2&&_0x1fb2c2[_0x7fe1('0x83')]){logger[_0x7fe1('0x33')](_0x7fe1('0x84'),_0x7fe1('0x85'));_0x175985['recordingURL']=_0x40cdcd[_0x7fe1('0x82')]+'/api/voice/recordings/'+_0x175985['uniqueid']+_0x7fe1('0x86')+md5(_0x175985['uniqueid']);}else{_0x175985[_0x7fe1('0x87')]='';}var _0x285732=_0x40cdcd[_0x7fe1('0x81')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x40cdcd)[_0x7fe1('0x2e')](function(_0x1fc695){_0x14dbb6=_0x1fc695;return getUser(_0x14dbb6,_0x285732,_0x40cdcd,_0x24577d['email']);})['then'](function(_0x2e53c5){_0xf53f30=_0x2e53c5;logger[_0x7fe1('0x33')](_0x7fe1('0x88'),_0xf53f30['id']);return getEndUser(_0x14dbb6,_0x285732,_0x40cdcd,_0x175985['calleridname'],_0x175985[_0x7fe1('0x89')],_0xf53f30,_0xd60ab6);})['then'](function(_0x5913fd){_0x1d53a7=_0x5913fd;return getCall(_0x14dbb6,_0x285732,_0x40cdcd,_0xf53f30,_0x1d53a7,_0xd60ab6,_0x175985,_0x7fe1('0x77'));})[_0x7fe1('0x2e')](function(_0x371d96){if(_0x371d96){logger[_0x7fe1('0x33')](_0x7fe1('0x8a'),_0x371d96['id']);logger[_0x7fe1('0x33')](_0x7fe1('0x84'),_0x7fe1('0x8b'));emit(util[_0x7fe1('0x36')](_0x7fe1('0x8c'),_0x24577d[_0x7fe1('0x1a')]),_0x7fe1('0x8d'),{'uri':_0x7fe1('0x8e')+_0x40cdcd[_0x7fe1('0x81')]+_0x7fe1('0x8f')+_0x371d96['id']});}})['catch'](function(_0x55e564){logger[_0x7fe1('0x43')](_0x7fe1('0x84'),JSON[_0x7fe1('0x42')](_0x55e564));});};exports[_0x7fe1('0x74')]=function(_0x4179e4,_0x535d65,_0x4a0be5,_0x109f49,_0x530dd4,_0x28733e,_0x3c3eee){var _0x174fca,_0x23bc96,_0x355f99;_0x28733e['host']=intUtil[_0x7fe1('0x90')](_0x28733e[_0x7fe1('0x81')]);_0x28733e['serverUrl']=intUtil[_0x7fe1('0x90')](_0x28733e[_0x7fe1('0x82')]);if(_0x3c3eee&&_0x3c3eee[_0x7fe1('0x91')]&&_0x3c3eee['recordingFormat']!==_0x7fe1('0x92')){logger['info'](_0x7fe1('0x93'),_0x7fe1('0x85'));_0x535d65[_0x7fe1('0x87')]=_0x28733e['serverUrl']+'/api/voice/recordings/'+_0x535d65[_0x7fe1('0x94')]+'/downloads?type=uniqueid&token='+md5(_0x535d65[_0x7fe1('0x94')]);}var _0x15bafb=_0x28733e[_0x7fe1('0x81')]===_0x7fe1('0x95')?'eu':_0x7fe1('0x96');return getAccessToken(_0x28733e)[_0x7fe1('0x2e')](function(_0x327c67){_0x355f99=_0x327c67;return getUser(_0x355f99,_0x15bafb,_0x28733e,_0x109f49[_0x7fe1('0x3c')]);})['then'](function(_0x13d3e4){_0x174fca=_0x13d3e4;logger[_0x7fe1('0x33')](_0x7fe1('0x88'),_0x174fca['id']);return getEndUser(_0x355f99,_0x15bafb,_0x28733e,_0x535d65[_0x7fe1('0x97')],_0x535d65[_0x7fe1('0x98')],_0x174fca,_0x4a0be5);})[_0x7fe1('0x2e')](function(_0x311257){_0x23bc96=_0x311257;return getCall(_0x355f99,_0x15bafb,_0x28733e,_0x174fca,_0x23bc96,_0x4a0be5,_0x535d65,'Outbound');})[_0x7fe1('0x2e')](function(_0x276c3c){if(_0x276c3c){logger['info'](_0x7fe1('0x8a'),_0x276c3c['id']);logger[_0x7fe1('0x33')]('[OUTBOUND]',_0x7fe1('0x8b'));emit(util[_0x7fe1('0x36')]('user:%s',_0x109f49[_0x7fe1('0x1a')]),_0x7fe1('0x8d'),{'uri':_0x7fe1('0x8e')+_0x28733e['host']+_0x7fe1('0x8f')+_0x276c3c['id']});}})['catch'](function(_0x224a43){logger[_0x7fe1('0x43')](_0x7fe1('0x93'),JSON[_0x7fe1('0x42')](_0x224a43));});};exports[_0x7fe1('0x99')]=function(_0x9de5ae,_0x4d8f88,_0x708083,_0x37cd22,_0x2d72e4,_0x26325a){var _0xe70e8e,_0x199765,_0x1e86c4;_0x26325a['host']=intUtil[_0x7fe1('0x90')](_0x26325a[_0x7fe1('0x81')]);_0x26325a[_0x7fe1('0x82')]=intUtil['stripTrailingSlash'](_0x26325a[_0x7fe1('0x82')]);if(_0x2d72e4&&_0x2d72e4[_0x7fe1('0x83')]){logger[_0x7fe1('0x33')]('['+_0x4d8f88[_0x7fe1('0x6a')][_0x7fe1('0x9a')]()+']','Recording\x20is\x20enabled!');_0x4d8f88[_0x7fe1('0x87')]=_0x26325a[_0x7fe1('0x82')]+'/api/voice/recordings/'+_0x4d8f88[_0x7fe1('0x94')]+_0x7fe1('0x86')+md5(_0x4d8f88[_0x7fe1('0x94')]);}else{_0x4d8f88[_0x7fe1('0x87')]='';}var _0x5b506a=_0x26325a[_0x7fe1('0x81')]===_0x7fe1('0x95')?'eu':_0x7fe1('0x96');return getAccessToken(_0x26325a)['then'](function(_0x3e57f4){_0x1e86c4=_0x3e57f4;return getUser(_0x1e86c4,_0x5b506a,_0x26325a);})[_0x7fe1('0x2e')](function(_0x2bfeaf){_0xe70e8e=_0x2bfeaf;logger[_0x7fe1('0x33')](_0x7fe1('0x88'),_0xe70e8e['id']);return getEndUser(_0x1e86c4,_0x5b506a,_0x26325a,_0x4d8f88[_0x7fe1('0x9b')],_0x4d8f88[_0x7fe1('0x89')],_0xe70e8e,_0x708083);})[_0x7fe1('0x2e')](function(_0x51d984){_0x199765=_0x51d984;return getCall(_0x1e86c4,_0x5b506a,_0x26325a,_0xe70e8e,_0x199765,_0x708083,_0x4d8f88,_0x7fe1('0x77'));})[_0x7fe1('0x2e')](function(_0x33f808){if(_0x33f808){logger[_0x7fe1('0x33')]('The\x20Call\x20ID\x20is:',_0x33f808['id']);}})[_0x7fe1('0x45')](function(_0x14e814){logger['error']('['+_0x4d8f88[_0x7fe1('0x6a')]['toUpperCase']()+']',JSON[_0x7fe1('0x42')](_0x14e814));});}; \ No newline at end of file +var _0x5718=['complete','connect','rejected','Rejected','abandoned','Abandoned','timeout','Call_Start_Time','outbound','Call_Type','Inbound','/crm/v2/Calls','Call\x20created!','err','queue','stripTrailingSlash','host','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','Outbound','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','redis','localhost','[HTTP]','forEach','string','picklist','idField','content','toString','type','variable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','refreshToken','clientSecret','refresh_token','then','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','format','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','info','profile','user','Administrator','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','stringify','data','enduserType','POST','/crm/v2/','moduleCreate','role','first_name','last_name','code','SUCCESS','details','startCase','Error:\x20','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','lead','https://www.zohoapis.','Leads','Creating\x20new\x20call...','Owner','getString','Subjects','Description','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','utc','talktime','mm:ss','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','Call_Result','Called'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x5718,0xb9));var _0x8571=function(_0x38c8ea,_0x1191b3){_0x38c8ea=_0x38c8ea-0x0;var _0x3ded68=_0x5718[_0x38c8ea];return _0x3ded68;};'use strict';var _=require(_0x8571('0x0'));var rp=require(_0x8571('0x1'));var md5=require(_0x8571('0x2'));var util=require(_0x8571('0x3'));var intUtil=require(_0x8571('0x4'));var moment=require(_0x8571('0x5'));var Redis=require(_0x8571('0x6'));var BPromise=require(_0x8571('0x7'));var config=require(_0x8571('0x8'));var logger=require(_0x8571('0x9'))('zoho');config['redis']=_['defaults'](config[_0x8571('0xa')],{'host':_0x8571('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8571('0xa')]));function emit(_0x424a95,_0x21cafd,_0x8cc9d6){io['to'](_0x424a95)['emit'](_0x21cafd,_0x8cc9d6);}function request(_0x26d338){logger['debug'](_0x8571('0xc'),JSON['stringify'](_0x26d338));return rp(_0x26d338);}function getCustomFields(_0x706b9b,_0x2d6e8e){var _0x40d400={};if(_0x706b9b['length']>0x0){_[_0x8571('0xd')](_0x706b9b,function(_0x45e477){if(_['includes']([_0x8571('0xe'),_0x8571('0xf')],_0x45e477['type'])&&_0x45e477[_0x8571('0x10')]){_0x40d400[_0x45e477[_0x8571('0x10')]]=_0x45e477[_0x8571('0x11')][_0x8571('0x12')]();}else if(_0x45e477[_0x8571('0x13')]===_0x8571('0x14')&&_0x45e477['variableName']&&_0x45e477[_0x8571('0x10')]&&_0x2d6e8e[_0x45e477['variableName']]){_0x40d400[_0x45e477['idField']]=_0x2d6e8e[_0x45e477['variableName']][_0x8571('0x12')]();}else if(_0x45e477[_0x8571('0x13')]==='customVariable'&&_0x45e477[_0x8571('0x15')]&&_0x45e477[_0x8571('0x15')][_0x8571('0x16')]&&_0x45e477[_0x8571('0x10')]&&_0x2d6e8e[_0x45e477['Variable']['name'][_0x8571('0x17')]()]){_0x40d400[_0x45e477[_0x8571('0x10')]]=_0x2d6e8e[_0x45e477['Variable']['name'][_0x8571('0x17')]()][_0x8571('0x12')]();}});}return _0x40d400;}function getName(_0x243da7){if(_0x243da7[_0x8571('0x18')]('\x20')>0x0){var _0x220010=_0x243da7[_0x8571('0x19')](/ (.+)/);if(_0x220010[0x1]){return _0x220010;}}return[_0x243da7,_0x243da7];}var accountsTokens={};function getAccessToken(_0x325240){return new Promise(function(_0x285437,_0x4bb1cf){if(!_[_0x8571('0x1a')](accountsTokens[_0x325240['id']])&&!_[_0x8571('0x1a')](accountsTokens[_0x325240['id']][_0x8571('0x1b')])){if(moment()[_0x8571('0x1c')](accountsTokens[_0x325240['id']][_0x8571('0x1d')])){_0x285437(accountsTokens[_0x325240['id']][_0x8571('0x1b')]);}}var _0xeaa8e9;switch(_0x325240['zone']){case'US':_0xeaa8e9=_0x8571('0x1e');break;case'AU':_0xeaa8e9=_0x8571('0x1f');break;case'EU':_0xeaa8e9='https://accounts.zoho.eu';break;case'IN':_0xeaa8e9=_0x8571('0x20');break;case'CN':_0xeaa8e9=_0x8571('0x21');break;default:_0xeaa8e9='https://accounts.zoho.eu';break;}var _0x2ccc01={'method':'POST','uri':_0xeaa8e9+'/oauth/v2/token','qs':{'refresh_token':_0x325240[_0x8571('0x22')],'client_id':_0x325240['clientId'],'client_secret':_0x325240[_0x8571('0x23')],'grant_type':_0x8571('0x24')},'json':!![]};return rp(_0x2ccc01)[_0x8571('0x25')](function(_0x1edf03){accountsTokens[_0x325240['id']]={'access_token':_0x1edf03[_0x8571('0x1b')],'expires_in':moment()['add'](_0x1edf03['expires_in'],_0x8571('0x26'))};_0x285437(_0x1edf03[_0x8571('0x1b')]);})[_0x8571('0x27')](function(_0x11a6e5){logger[_0x8571('0x28')](_0x8571('0x29'),_0x11a6e5[_0x8571('0x2a')]);_0x4bb1cf(_0x11a6e5);});});}function getUser(_0x13adf8,_0x448d52,_0x21e04a,_0x5e9712){logger['info'](_0x8571('0x2b'));return request({'method':'GET','uri':util[_0x8571('0x2c')]('https://www.zohoapis.%s/crm/v2/users',_0x448d52),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x8571('0x2d')+_0x13adf8},'json':!![]})[_0x8571('0x25')](function(_0x526a7a){if(_0x526a7a[_0x8571('0x2e')]){var _0xd1261c=-0x1;if(_[_0x8571('0x2f')](_0x526a7a['users'])){if(!_[_0x8571('0x1a')](_0x5e9712)){_0xd1261c=_[_0x8571('0x30')](_0x526a7a['users'],function(_0x2c27fd){return _0x2c27fd[_0x8571('0x31')]===_0x5e9712;});}if(_0xd1261c>=0x0){logger['info']('Agent\x20found!');}else{logger[_0x8571('0x32')]('Using\x20the\x20admin\x20account!');_0xd1261c=_['findIndex'](_0x526a7a['users'],function(_0x5ca44e){return _0x5ca44e[_0x8571('0x33')]['name']==='Administrator';});}return _0x526a7a[_0x8571('0x2e')][_0xd1261c];}else{if(_0x526a7a[_0x8571('0x34')]['profile']['name']===_0x8571('0x35')){logger[_0x8571('0x32')](_0x8571('0x36'));user=_0x526a7a[_0x8571('0x34')];return user;}else{logger[_0x8571('0x28')](_0x8571('0x37'),JSON['stringify'](_0x526a7a));throw new Error(_0x8571('0x38')+JSON[_0x8571('0x39')](_0x526a7a));}}}else{logger[_0x8571('0x28')](_0x8571('0x37'),JSON[_0x8571('0x39')](_0x526a7a));throw new Error(_0x8571('0x38')+JSON[_0x8571('0x39')](_0x526a7a));}})[_0x8571('0x27')](function(_0x2dd582){console['error'](_0x2dd582);});}function getZohoUser(_0xc76b9f,_0x16f376){return new BPromise(function(_0x56cc1e,_0x267e47){request(_0xc76b9f)[_0x8571('0x25')](function(_0x341dc9){var _0x6a8bc=null;if(_0x341dc9){_0x6a8bc=_0x341dc9[_0x8571('0x3a')][0x0];_0x6a8bc[_0x8571('0x3b')]=_0x16f376;}_0x56cc1e(_0x6a8bc);})[_0x8571('0x27')](function(_0x19163a){_0x267e47(_0x19163a);});});}function createEndUser(_0x2dfb6f,_0x59dd8d,_0xf4a316,_0x5bf7bc,_0x38d625,_0x4a2207){var _0xf4a316=getName(_0xf4a316);return request({'method':_0x8571('0x3c'),'uri':'https://www.zohoapis.'+_0x59dd8d+_0x8571('0x3d')+_['startCase'](_0x4a2207[_0x8571('0x3e')])+'s','body':{'data':[{'Last_Name':_0xf4a316[0x1],'First_Name':_0xf4a316[0x0],'Phone':_0x5bf7bc,'Owner':{'name':!_[_0x8571('0x1a')](_0x38d625[_0x8571('0x3f')][_0x8571('0x16')])?_0x38d625[_0x8571('0x3f')][_0x8571('0x16')]:!_[_0x8571('0x1a')](_0x38d625[_0x8571('0x40')])?_0x38d625[_0x8571('0x40')]+'\x20'+_0x38d625[_0x8571('0x41')]:_0x38d625[_0x8571('0x41')],'id':_0x38d625['id']}}]},'headers':{'Authorization':_0x8571('0x2d')+_0x2dfb6f},'json':!![]})[_0x8571('0x25')](function(_0x375891){if(_0x375891&&_0x375891[_0x8571('0x3a')][0x0][_0x8571('0x42')]===_0x8571('0x43')){var _0x159741=_0x375891[_0x8571('0x3a')][0x0][_0x8571('0x44')];_0x159741[_0x8571('0x3b')]=_[_0x8571('0x45')](_0x4a2207[_0x8571('0x3e')])+'s';return _0x159741;}logger['error'](_0x8571('0x37'),JSON[_0x8571('0x39')](data));throw new Error(_0x8571('0x46')+JSON[_0x8571('0x39')](data));})[_0x8571('0x27')](function(_0x534ec5){console['log']('CREATE\x20ERROR',_0x534ec5);});}function getEndUser(_0x5142f,_0x54b876,_0x1649a3,_0x2bfafb,_0xbee778,_0x2ff40a,_0x419311){var _0x4b1214={'method':'GET','uri':'','headers':{'Authorization':_0x8571('0x2d')+_0x5142f},'json':!![]};switch(_0x419311[_0x8571('0x47')]){case _0x8571('0x48'):_0x4b1214[_0x8571('0x49')]='https://www.zohoapis.'+_0x54b876+_0x8571('0x4a')+_0xbee778+'))';return getZohoUser(_0x4b1214,_0x8571('0x4b'))[_0x8571('0x25')](function(_0x563fa1){if(_0x563fa1)return _0x563fa1;_0x4b1214[_0x8571('0x49')]='https://www.zohoapis.'+_0x54b876+_0x8571('0x4c')+_0xbee778+'))';return getZohoUser(_0x4b1214,'Leads')[_0x8571('0x25')](function(_0xd3af57){if(_0xd3af57)return _0xd3af57;if(_0x419311[_0x8571('0x3e')]!=_0x8571('0x4d')){return createEndUser(_0x5142f,_0x54b876,_0x2bfafb,_0xbee778,_0x2ff40a,_0x419311);}else{return{};}});});break;case _0x8571('0x4e'):_0x4b1214[_0x8571('0x49')]='https://www.zohoapis.'+_0x54b876+_0x8571('0x4a')+_0xbee778+'))';return getZohoUser(_0x4b1214,_0x8571('0x4b'))[_0x8571('0x25')](function(_0x22232c){if(_0x22232c)return _0x22232c;if(_0x419311[_0x8571('0x3e')]!=_0x8571('0x4d')){return createEndUser(_0x5142f,_0x54b876,_0x2bfafb,_0xbee778,_0x2ff40a,_0x419311);}else{return{};}});break;case _0x8571('0x4f'):_0x4b1214[_0x8571('0x49')]=_0x8571('0x50')+_0x54b876+_0x8571('0x4c')+_0xbee778+'))';return getZohoUser(_0x4b1214,_0x8571('0x51'))[_0x8571('0x25')](function(_0x389615){if(_0x389615)return _0x389615;if(_0x419311[_0x8571('0x3e')]!='nothing'){return createEndUser(_0x5142f,_0x54b876,_0x2bfafb,_0xbee778,_0x2ff40a,_0x419311);}else{return{};}});break;}}function getCall(_0x331dd7,_0x20208d,_0x3b3aae,_0x164302,_0x8cde5f,_0x59e0b4,_0x5bcba8,_0x219faa){logger[_0x8571('0x32')](_0x8571('0x52'));var _0x137658={};_0x137658[_0x8571('0x53')]={'name':!_[_0x8571('0x1a')](_0x164302[_0x8571('0x3f')][_0x8571('0x16')])&&!_['isNil'](_0x164302[_0x8571('0x33')][_0x8571('0x16')])&&_0x164302['profile']['name']==='administrator'?_0x164302[_0x8571('0x3f')][_0x8571('0x16')]:!_['isNil'](_0x164302[_0x8571('0x40')])?_0x164302[_0x8571('0x40')]+'\x20'+_0x164302[_0x8571('0x41')]:_0x164302[_0x8571('0x41')],'id':_0x164302['id']};_0x137658['Subject']=intUtil[_0x8571('0x54')](_0x59e0b4[_0x8571('0x55')],_0x5bcba8,'\x20');_0x137658[_0x8571('0x56')]=intUtil['getString'](_0x59e0b4['Descriptions'],_0x5bcba8,'\x0a');if(_0x8cde5f[_0x8571('0x3b')]===_0x8571('0x4b')){_0x137658[_0x8571('0x57')]={'name':!_[_0x8571('0x1a')](_0x8cde5f[_0x8571('0x58')])?_0x8cde5f[_0x8571('0x58')]:!_['isNil'](_0x8cde5f[_0x8571('0x59')])?_0x8cde5f[_0x8571('0x59')]+'\x20'+_0x8cde5f[_0x8571('0x5a')]:_0x8cde5f[_0x8571('0x5a')],'id':_0x8cde5f['id']};}if(_0x8cde5f[_0x8571('0x3b')]===_0x8571('0x51')){_0x137658[_0x8571('0x5b')]={'name':!_[_0x8571('0x1a')](_0x8cde5f[_0x8571('0x58')])?_0x8cde5f[_0x8571('0x58')]:!_['isNil'](_0x8cde5f[_0x8571('0x59')])?_0x8cde5f['First_Name']+'\x20'+_0x8cde5f[_0x8571('0x5a')]:_0x8cde5f[_0x8571('0x5a')],'id':_0x8cde5f['id']};_0x137658[_0x8571('0x5c')]=_[_0x8571('0x45')](_0x8cde5f[_0x8571('0x3b')]);}if(_0x5bcba8['talktime']){_0x137658[_0x8571('0x5d')]=moment[_0x8571('0x5e')](parseInt(_0x5bcba8[_0x8571('0x5f')])*0x3e8)[_0x8571('0x2c')](_0x8571('0x60'));}else if(_0x5bcba8['answertime']&&_0x5bcba8[_0x8571('0x61')]){_0x137658[_0x8571('0x5d')]=moment[_0x8571('0x5e')](moment(_0x5bcba8['endtime'],_0x8571('0x62'))[_0x8571('0x63')](moment(_0x5bcba8[_0x8571('0x64')],_0x8571('0x62'))))[_0x8571('0x2c')](_0x8571('0x60'));}switch(_0x5bcba8['lastevent']){case'called':_0x137658[_0x8571('0x65')]=_0x8571('0x66');break;case _0x8571('0x67'):case _0x8571('0x68'):_0x137658['Call_Result']='Answered';break;case _0x8571('0x69'):_0x137658[_0x8571('0x65')]=_0x8571('0x6a');break;case _0x8571('0x6b'):_0x137658[_0x8571('0x65')]=_0x8571('0x6c');break;case _0x8571('0x6d'):_0x137658[_0x8571('0x65')]='Timeout';default:}_0x137658[_0x8571('0x6e')]=(_0x219faa===_0x8571('0x6f')?moment(_0x5bcba8[_0x8571('0x64')])[_0x8571('0x2c')](_0x8571('0x62')):moment(_0x5bcba8['agentcalledAt'])[_0x8571('0x2c')](_0x8571('0x62')))||moment()[_0x8571('0x2c')](_0x8571('0x62'));_0x137658[_0x8571('0x70')]=_0x219faa||_0x8571('0x71');_0x137658=_['merge'](_0x137658,getCustomFields(_0x59e0b4['Fields'],_0x5bcba8));return request({'method':'POST','uri':'https://www.zohoapis.'+_0x20208d+_0x8571('0x72'),'headers':{'Authorization':_0x8571('0x2d')+_0x331dd7},'body':{'data':[_0x137658]},'json':!![]})['then'](function(_0x258f91){if(_0x258f91&&_0x258f91[_0x8571('0x3a')][0x0][_0x8571('0x42')]===_0x8571('0x43')){logger[_0x8571('0x32')](_0x8571('0x73'));return{'id':_0x258f91[_0x8571('0x3a')][0x0][_0x8571('0x44')]['id']};}})[_0x8571('0x27')](function(_0x24a4a8){logger[_0x8571('0x32')](_0x8571('0x74'),_0x24a4a8[_0x8571('0x2a')]);console['log'](_0x8571('0x74'),_0x24a4a8);});}exports[_0x8571('0x75')]=function(_0x4190bc,_0x1163ad,_0x96acc0,_0x4cbe29,_0x1334aa,_0x45dfa2){var _0x4dab99,_0x13c487,_0x197aa8;_0x45dfa2['host']=intUtil[_0x8571('0x76')](_0x45dfa2[_0x8571('0x77')]);_0x45dfa2[_0x8571('0x78')]=intUtil['stripTrailingSlash'](_0x45dfa2[_0x8571('0x78')]);if(_0x1334aa&&_0x1334aa[_0x8571('0x79')]){logger['info'](_0x8571('0x7a'),_0x8571('0x7b'));_0x1163ad[_0x8571('0x7c')]=_0x45dfa2[_0x8571('0x78')]+_0x8571('0x7d')+_0x1163ad[_0x8571('0x7e')]+_0x8571('0x7f')+md5(_0x1163ad[_0x8571('0x7e')]);}else{_0x1163ad['recordingURL']='';}var _0x545f25=_0x45dfa2[_0x8571('0x77')]===_0x8571('0x80')?'eu':_0x8571('0x81');return getAccessToken(_0x45dfa2)[_0x8571('0x25')](function(_0x2436ca){_0x197aa8=_0x2436ca;return getUser(_0x197aa8,_0x545f25,_0x45dfa2,_0x4cbe29[_0x8571('0x31')]);})[_0x8571('0x25')](function(_0x48017f){_0x4dab99=_0x48017f;logger[_0x8571('0x32')]('The\x20User\x20ID\x20is:',_0x4dab99['id']);return getEndUser(_0x197aa8,_0x545f25,_0x45dfa2,_0x1163ad['calleridname'],_0x1163ad[_0x8571('0x82')],_0x4dab99,_0x96acc0);})[_0x8571('0x25')](function(_0x35b476){_0x13c487=_0x35b476;return getCall(_0x197aa8,_0x545f25,_0x45dfa2,_0x4dab99,_0x13c487,_0x96acc0,_0x1163ad,_0x8571('0x71'));})['then'](function(_0x429318){if(_0x429318){logger['info'](_0x8571('0x83'),_0x429318['id']);logger[_0x8571('0x32')](_0x8571('0x7a'),_0x8571('0x84'));emit(util[_0x8571('0x2c')](_0x8571('0x85'),_0x4cbe29[_0x8571('0x16')]),'trigger:browser:url',{'uri':_0x8571('0x86')+_0x45dfa2['host']+_0x8571('0x87')+_0x429318['id']});}})[_0x8571('0x27')](function(_0x541fd1){logger[_0x8571('0x28')]('[QUEUE]',JSON['stringify'](_0x541fd1));});};exports['outbound']=function(_0x20bb41,_0x318e7d,_0x448643,_0x4b45b3,_0x38f47f,_0x5c93a5,_0x1f1fdc){var _0x550aca,_0x216a5d,_0x38b3a2;_0x5c93a5[_0x8571('0x77')]=intUtil['stripTrailingSlash'](_0x5c93a5[_0x8571('0x77')]);_0x5c93a5[_0x8571('0x78')]=intUtil[_0x8571('0x76')](_0x5c93a5[_0x8571('0x78')]);if(_0x1f1fdc&&_0x1f1fdc[_0x8571('0x88')]&&_0x1f1fdc[_0x8571('0x88')]!==_0x8571('0x89')){logger['info'](_0x8571('0x8a'),'Recording\x20is\x20enabled!');_0x318e7d['recordingURL']=_0x5c93a5[_0x8571('0x78')]+'/api/voice/recordings/'+_0x318e7d[_0x8571('0x7e')]+_0x8571('0x7f')+md5(_0x318e7d[_0x8571('0x7e')]);}var _0x48bf22=_0x5c93a5[_0x8571('0x77')]===_0x8571('0x80')?'eu':_0x8571('0x81');return getAccessToken(_0x5c93a5)[_0x8571('0x25')](function(_0x57437d){_0x38b3a2=_0x57437d;return getUser(_0x38b3a2,_0x48bf22,_0x5c93a5,_0x4b45b3[_0x8571('0x31')]);})[_0x8571('0x25')](function(_0x3c31c4){_0x550aca=_0x3c31c4;logger['info'](_0x8571('0x8b'),_0x550aca['id']);return getEndUser(_0x38b3a2,_0x48bf22,_0x5c93a5,_0x318e7d['destcalleridname'],_0x318e7d['destcalleridnum'],_0x550aca,_0x448643);})[_0x8571('0x25')](function(_0x243c31){_0x216a5d=_0x243c31;return getCall(_0x38b3a2,_0x48bf22,_0x5c93a5,_0x550aca,_0x216a5d,_0x448643,_0x318e7d,_0x8571('0x8c'));})[_0x8571('0x25')](function(_0x33dbea){if(_0x33dbea){logger[_0x8571('0x32')](_0x8571('0x83'),_0x33dbea['id']);logger[_0x8571('0x32')]('[OUTBOUND]',_0x8571('0x84'));emit(util[_0x8571('0x2c')](_0x8571('0x85'),_0x4b45b3[_0x8571('0x16')]),'trigger:browser:url',{'uri':_0x8571('0x86')+_0x5c93a5['host']+_0x8571('0x87')+_0x33dbea['id']});}})[_0x8571('0x27')](function(_0x1144d9){logger[_0x8571('0x28')](_0x8571('0x8a'),JSON['stringify'](_0x1144d9));});};exports[_0x8571('0x8d')]=function(_0x32553,_0x5e60f7,_0x153475,_0x50034d,_0x54d851,_0x4219bf){var _0x3b75d7,_0x26ed4a,_0x4355b8;_0x4219bf['host']=intUtil[_0x8571('0x76')](_0x4219bf['host']);_0x4219bf[_0x8571('0x78')]=intUtil['stripTrailingSlash'](_0x4219bf[_0x8571('0x78')]);if(_0x54d851&&_0x54d851[_0x8571('0x79')]){logger[_0x8571('0x32')]('['+_0x5e60f7[_0x8571('0x8e')][_0x8571('0x8f')]()+']',_0x8571('0x7b'));_0x5e60f7[_0x8571('0x7c')]=_0x4219bf[_0x8571('0x78')]+_0x8571('0x7d')+_0x5e60f7[_0x8571('0x7e')]+_0x8571('0x7f')+md5(_0x5e60f7['uniqueid']);}else{_0x5e60f7[_0x8571('0x7c')]='';}var _0x458ba5=_0x4219bf[_0x8571('0x77')]==='zoho.eu'?'eu':_0x8571('0x81');return getAccessToken(_0x4219bf)[_0x8571('0x25')](function(_0x54481c){_0x4355b8=_0x54481c;return getUser(_0x4355b8,_0x458ba5,_0x4219bf);})[_0x8571('0x25')](function(_0x456389){_0x3b75d7=_0x456389;logger[_0x8571('0x32')]('The\x20User\x20ID\x20is:',_0x3b75d7['id']);return getEndUser(_0x4355b8,_0x458ba5,_0x4219bf,_0x5e60f7['calleridname'],_0x5e60f7[_0x8571('0x82')],_0x3b75d7,_0x153475);})[_0x8571('0x25')](function(_0x5782d8){_0x26ed4a=_0x5782d8;return getCall(_0x4355b8,_0x458ba5,_0x4219bf,_0x3b75d7,_0x26ed4a,_0x153475,_0x5e60f7,_0x8571('0x71'));})[_0x8571('0x25')](function(_0x36fbab){if(_0x36fbab){logger[_0x8571('0x32')](_0x8571('0x83'),_0x36fbab['id']);}})[_0x8571('0x27')](function(_0x4e9ea2){logger['error']('['+_0x5e60f7[_0x8571('0x8e')]['toUpperCase']()+']',JSON['stringify'](_0x4e9ea2));});}; \ 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 16032e2..b3129af 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 _0x327e=['../../../../config/logger','trigger','data2','Script','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','shelljs','mustache'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x327e,0x7f));var _0xe327=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x327e[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xe327('0x0'));var sh=require(_0xe327('0x1'));var Mustache=require(_0xe327('0x2'));var logger=require(_0xe327('0x3'))(_0xe327('0x4'));exports['exec']=function(_0x1a9bfb,_0x4210c7){var _0x24e689=_0x1a9bfb[_0xe327('0x5')]?_0x1a9bfb['data2']:_0xe327('0x6');var _0x2235ea=_0x1a9bfb[_0xe327('0x7')]?Mustache[_0xe327('0x8')](_0x1a9bfb['data3'],_0x4210c7):_0x4210c7;sh['exec'](_0x2235ea,function(_0x5dc8f5,_0x486ace,_0xa50795){if(_0x5dc8f5!==0x0){logger[_0xe327('0x9')](util[_0xe327('0xa')](_0xe327('0xb'),_0x24e689,_0x2235ea,_0x5dc8f5,_0xa50795));}else{logger[_0xe327('0xc')](util[_0xe327('0xa')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x24e689,_0x2235ea,_0x486ace));}});}; \ No newline at end of file +var _0x1f53=['%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','../../../../config/logger','trigger','exec','data2','Script','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s'];(function(_0x35c243,_0x5ace82){var _0x29a1f7=function(_0x188cc3){while(--_0x188cc3){_0x35c243['push'](_0x35c243['shift']());}};_0x29a1f7(++_0x5ace82);}(_0x1f53,0x7a));var _0x31f5=function(_0x2531fb,_0x1075f6){_0x2531fb=_0x2531fb-0x0;var _0x3afcc2=_0x1f53[_0x2531fb];return _0x3afcc2;};'use strict';var util=require(_0x31f5('0x0'));var sh=require('shelljs');var Mustache=require('mustache');var logger=require(_0x31f5('0x1'))(_0x31f5('0x2'));exports[_0x31f5('0x3')]=function(_0x509d3e,_0x26b9a5){var _0x103a70=_0x509d3e[_0x31f5('0x4')]?_0x509d3e['data2']:_0x31f5('0x5');var _0x259dbd=_0x509d3e['data3']?Mustache['render'](_0x509d3e[_0x31f5('0x6')],_0x26b9a5):_0x26b9a5;sh[_0x31f5('0x3')](_0x259dbd,function(_0x22e260,_0x118011,_0x26c667){if(_0x22e260!==0x0){logger[_0x31f5('0x7')](util[_0x31f5('0x8')](_0x31f5('0x9'),_0x103a70,_0x259dbd,_0x22e260,_0x26c667));}else{logger['info'](util[_0x31f5('0x8')](_0x31f5('0xa'),_0x103a70,_0x259dbd,_0x118011));}});}; \ 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 ef5f7e4..93b657c 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 _0x419d=['format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','isNil',',\x20request\x20body:\x20','object','info','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','data2','data5','number','data6','render','error','GET','POST','data7','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format'];(function(_0x4d521e,_0x58ba39){var _0x3beb42=function(_0x1a7bd2){while(--_0x1a7bd2){_0x4d521e['push'](_0x4d521e['shift']());}};_0x3beb42(++_0x58ba39);}(_0x419d,0x1cb));var _0xd419=function(_0x41054b,_0xe82034){_0x41054b=_0x41054b-0x0;var _0x468e13=_0x419d[_0x41054b];return _0x468e13;};'use strict';var rp=require(_0xd419('0x0'));var util=require(_0xd419('0x1'));var _=require(_0xd419('0x2'));var Mustache=require(_0xd419('0x3'));var logger=require(_0xd419('0x4'))(_0xd419('0x5'));exports[_0xd419('0x6')]=function(_0x26a56e,_0x441170){var _0x49dd20,_0x126bc3;var _0x3c0eb2={'method':_0x26a56e[_0xd419('0x7')][_0xd419('0x8')](),'uri':Mustache['render'](_0x26a56e[_0xd419('0x9')],_0x441170),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x26a56e[_0xd419('0xa')])===_0xd419('0xb')&&parseInt(_0x26a56e['data5'])>=0x1&&parseInt(_0x26a56e[_0xd419('0xa')])<=0xa?parseInt(_0x26a56e[_0xd419('0xa')])*0x3e8:0x5*0x3e8};try{_0x3c0eb2['headers']=_0x26a56e[_0xd419('0xc')]?JSON['parse'](Mustache[_0xd419('0xd')](_0x26a56e[_0xd419('0xc')],_0x441170)):{};}catch(_0x5cac0a){logger[_0xd419('0xe')](_0x5cac0a['stack']);}switch(_0x26a56e[_0xd419('0x7')][_0xd419('0x8')]()){case _0xd419('0xf'):case'DELETE':_0x49dd20=null;_0x3c0eb2['qs']=_0x441170;break;case _0xd419('0x10'):case'PUT':if(_0x26a56e[_0xd419('0x11')]){try{_0x49dd20=JSON['parse'](Mustache['render'](_0x26a56e[_0xd419('0x11')],_0x441170));_0x3c0eb2[_0xd419('0x12')]=_0x49dd20;}catch(_0x530e1e){logger[_0xd419('0xe')](_0x530e1e[_0xd419('0x13')]);logger[_0xd419('0xe')](_0xd419('0x14'));}}else{_0x49dd20=_0x441170;_0x3c0eb2[_0xd419('0x12')]=_0x49dd20;}break;}logger['info'](util[_0xd419('0x15')](_0xd419('0x16'),_0x26a56e[_0xd419('0x7')],_0x26a56e[_0xd419('0x9')],JSON[_0xd419('0x17')](_0x3c0eb2)));rp(_0x3c0eb2)['then'](function(_0x2d1250){_0x49dd20=!_[_0xd419('0x18')](_0x49dd20)?_0xd419('0x19')+_0x49dd20:'';_0x126bc3=typeof _0x2d1250[_0xd419('0x12')]===_0xd419('0x1a')?JSON['stringify'](_0x2d1250['body']):_0x2d1250[_0xd419('0x12')];logger[_0xd419('0x1b')](util[_0xd419('0x15')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x26a56e[_0xd419('0x7')],_0x26a56e[_0xd419('0x9')],_0x2d1250['statusCode'],_0x126bc3));})[_0xd419('0x1c')](function(_0x13934d){logger[_0xd419('0xe')](util[_0xd419('0x15')](_0xd419('0x1d'),_0x26a56e['data1'],_0x26a56e[_0xd419('0x9')],_0x13934d['statusCode'],_0x13934d[_0xd419('0x1e')],_0x13934d[_0xd419('0x1f')]));});}; \ No newline at end of file +var _0x1e43=['request-promise','lodash','../../../../config/logger','trigger','exec','render','data2','data5','headers','data6','parse','error','stack','data1','toUpperCase','GET','DELETE','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','info','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message'];(function(_0x4ddd0c,_0x286347){var _0x1bb998=function(_0x18c844){while(--_0x18c844){_0x4ddd0c['push'](_0x4ddd0c['shift']());}};_0x1bb998(++_0x286347);}(_0x1e43,0x1ba));var _0x31e4=function(_0x3f4568,_0x9eb0ee){_0x3f4568=_0x3f4568-0x0;var _0xee2340=_0x1e43[_0x3f4568];return _0xee2340;};'use strict';var rp=require(_0x31e4('0x0'));var util=require('util');var _=require(_0x31e4('0x1'));var Mustache=require('mustache');var logger=require(_0x31e4('0x2'))(_0x31e4('0x3'));exports[_0x31e4('0x4')]=function(_0x1eae83,_0x1fda10){var _0x2ef30c,_0x316721;var _0x3266e0={'method':_0x1eae83['data1']['toUpperCase'](),'uri':Mustache[_0x31e4('0x5')](_0x1eae83[_0x31e4('0x6')],_0x1fda10),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1eae83[_0x31e4('0x7')])==='number'&&parseInt(_0x1eae83[_0x31e4('0x7')])>=0x1&&parseInt(_0x1eae83[_0x31e4('0x7')])<=0xa?parseInt(_0x1eae83['data5'])*0x3e8:0x5*0x3e8};try{_0x3266e0[_0x31e4('0x8')]=_0x1eae83[_0x31e4('0x9')]?JSON[_0x31e4('0xa')](Mustache[_0x31e4('0x5')](_0x1eae83[_0x31e4('0x9')],_0x1fda10)):{};}catch(_0x49ff6d){logger[_0x31e4('0xb')](_0x49ff6d[_0x31e4('0xc')]);}switch(_0x1eae83[_0x31e4('0xd')][_0x31e4('0xe')]()){case _0x31e4('0xf'):case _0x31e4('0x10'):_0x2ef30c=null;_0x3266e0['qs']=_0x1fda10;break;case'POST':case _0x31e4('0x11'):if(_0x1eae83['data7']){try{_0x2ef30c=JSON[_0x31e4('0xa')](Mustache[_0x31e4('0x5')](_0x1eae83[_0x31e4('0x12')],_0x1fda10));_0x3266e0[_0x31e4('0x13')]=_0x2ef30c;}catch(_0x5b9aad){logger[_0x31e4('0xb')](_0x5b9aad[_0x31e4('0xc')]);logger[_0x31e4('0xb')](_0x31e4('0x14'));}}else{_0x2ef30c=_0x1fda10;_0x3266e0[_0x31e4('0x13')]=_0x2ef30c;}break;}logger['info'](util[_0x31e4('0x15')](_0x31e4('0x16'),_0x1eae83['data1'],_0x1eae83[_0x31e4('0x6')],JSON[_0x31e4('0x17')](_0x3266e0)));rp(_0x3266e0)[_0x31e4('0x18')](function(_0x269d7f){_0x2ef30c=!_[_0x31e4('0x19')](_0x2ef30c)?_0x31e4('0x1a')+_0x2ef30c:'';_0x316721=typeof _0x269d7f[_0x31e4('0x13')]===_0x31e4('0x1b')?JSON[_0x31e4('0x17')](_0x269d7f['body']):_0x269d7f[_0x31e4('0x13')];logger[_0x31e4('0x1c')](util['format']('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x1eae83['data1'],_0x1eae83[_0x31e4('0x6')],_0x269d7f[_0x31e4('0x1d')],_0x316721));})[_0x31e4('0x1e')](function(_0x46c57e){logger[_0x31e4('0xb')](util[_0x31e4('0x15')](_0x31e4('0x1f'),_0x1eae83[_0x31e4('0xd')],_0x1eae83[_0x31e4('0x6')],_0x46c57e[_0x31e4('0x1d')],_0x46c57e[_0x31e4('0x20')],_0x46c57e[_0x31e4('0x21')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 200c7be..666f121 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 _0x20cf=['error','result','catch','exports','jayson/promise','routing','client','http','Request','request','then','debug','rpc'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x20cf,0xad));var _0xf20c=function(_0x29014d,_0x50ce25){_0x29014d=_0x29014d-0x0;var _0x3e2caa=_0x20cf[_0x29014d];return _0x3e2caa;};'use strict';var jayson=require(_0xf20c('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')(_0xf20c('0x1'));var client=jayson[_0xf20c('0x2')][_0xf20c('0x3')]({'port':0x2329});client[_0xf20c('0x4')]=function(_0x5f40ee,_0x6c6d21){return new BPromise(function(_0x2f070e,_0x3a42ea){return client[_0xf20c('0x5')](_0x5f40ee,_0x6c6d21)[_0xf20c('0x6')](function(_0x22be34){logger[_0xf20c('0x7')](_0xf20c('0x8'),'routing',_0x5f40ee,_0x6c6d21,_0x22be34);if(_0x22be34[_0xf20c('0x9')]){logger['error'](_0xf20c('0x8'),_0xf20c('0x1'),_0x5f40ee,_0x22be34[_0xf20c('0x9')]['message'],_0x6c6d21);return _0x3a42ea(_0x22be34['error']['message']);}else{return _0x2f070e(_0x22be34[_0xf20c('0xa')]);}})[_0xf20c('0xb')](function(_0x3baedc){logger['error'](_0xf20c('0x8'),_0xf20c('0x1'),_0x5f40ee,_0x3baedc,_0x6c6d21);return _0x3a42ea(_0x3baedc);});});};module[_0xf20c('0xc')]=client; \ No newline at end of file +var _0x2121=['rpc','routing','error','message','result','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','debug'];(function(_0x100d98,_0x1eecea){var _0x28617b=function(_0x473b8b){while(--_0x473b8b){_0x100d98['push'](_0x100d98['shift']());}};_0x28617b(++_0x1eecea);}(_0x2121,0x1cd));var _0x1212=function(_0x3a8b95,_0x4e0cc5){_0x3a8b95=_0x3a8b95-0x0;var _0x4adc23=_0x2121[_0x3a8b95];return _0x4adc23;};'use strict';var jayson=require(_0x1212('0x0'));var BPromise=require(_0x1212('0x1'));var logger=require(_0x1212('0x2'))('routing');var client=jayson[_0x1212('0x3')][_0x1212('0x4')]({'port':0x2329});client[_0x1212('0x5')]=function(_0x3312d0,_0x2e020a){return new BPromise(function(_0x15c80c,_0x26e3cd){return client['request'](_0x3312d0,_0x2e020a)['then'](function(_0x414359){logger[_0x1212('0x6')](_0x1212('0x7'),_0x1212('0x8'),_0x3312d0,_0x2e020a,_0x414359);if(_0x414359[_0x1212('0x9')]){logger[_0x1212('0x9')]('rpc',_0x1212('0x8'),_0x3312d0,_0x414359['error'][_0x1212('0xa')],_0x2e020a);return _0x26e3cd(_0x414359[_0x1212('0x9')][_0x1212('0xa')]);}else{return _0x15c80c(_0x414359[_0x1212('0xb')]);}})['catch'](function(_0x5addb9){logger[_0x1212('0x9')](_0x1212('0x7'),_0x1212('0x8'),_0x3312d0,_0x5addb9,_0x2e020a);return _0x26e3cd(_0x5addb9);});});};module[_0x1212('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 988a594..0a58276 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 _0xb826=['listen','getSettings','catch','log','./realtime','./lib/email','./rpc/mailAccount','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts'];(function(_0x3b4919,_0x2d495f){var _0xab1c7c=function(_0x39fd50){while(--_0x39fd50){_0x3b4919['push'](_0x3b4919['shift']());}};_0xab1c7c(++_0x2d495f);}(_0xb826,0x149));var _0x6b82=function(_0x397a81,_0x26ab76){_0x397a81=_0x397a81-0x0;var _0x4e74e6=_0xb826[_0x397a81];return _0x4e74e6;};'use strict';var BPromise=require('bluebird');var server=require('./server');var Realtime=require(_0x6b82('0x0'));var EmailChannel=require(_0x6b82('0x1'));var mailAccount=require(_0x6b82('0x2'));var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x6b82('0x3')]()[_0x6b82('0x4')](mailAccount[_0x6b82('0x5')]())[_0x6b82('0x4')](realtime[_0x6b82('0x6')]())[_0x6b82('0x4')](function(){email[_0x6b82('0x7')](realtime[_0x6b82('0x8')]);return realtime;});}function main(){return server[_0x6b82('0x9')](realtime,email)[_0x6b82('0x4')](function(){return initRealtime();})[_0x6b82('0x4')](function(){return setting[_0x6b82('0xa')]();})[_0x6b82('0x4')](function(_0x83dac0){return setInterval(initRealtime,_0x83dac0['loginMailFrequency']*0x3e8);})[_0x6b82('0xb')](function(_0x4c26f9){console[_0x6b82('0xc')](_0x4c26f9);});}main(); \ No newline at end of file +var _0xd6bc=['bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','getMailAccounts','then','refresh','mailAccounts','listen','getSettings','log'];(function(_0x576540,_0x246be7){var _0x4f3124=function(_0x4ee38a){while(--_0x4ee38a){_0x576540['push'](_0x576540['shift']());}};_0x4f3124(++_0x246be7);}(_0xd6bc,0x1a0));var _0xcd6b=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xd6bc[_0x2be8c2];return _0x97f531;};'use strict';var BPromise=require(_0xcd6b('0x0'));var server=require(_0xcd6b('0x1'));var Realtime=require(_0xcd6b('0x2'));var EmailChannel=require(_0xcd6b('0x3'));var mailAccount=require(_0xcd6b('0x4'));var setting=require(_0xcd6b('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()['then'](mailAccount[_0xcd6b('0x6')]())['then'](realtime['initMailAccounts']())[_0xcd6b('0x7')](function(){email[_0xcd6b('0x8')](realtime[_0xcd6b('0x9')]);return realtime;});}function main(){return server[_0xcd6b('0xa')](realtime,email)[_0xcd6b('0x7')](function(){return initRealtime();})[_0xcd6b('0x7')](function(){return setting[_0xcd6b('0xb')]();})[_0xcd6b('0x7')](function(_0x2ff2e4){return setInterval(initRealtime,_0x2ff2e4['loginMailFrequency']*0x3e8);})['catch'](function(_0x49b431){console[_0xcd6b('0xc')](_0x49b431);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index c84b205..aeb1a9a 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 _0x059e=['lastSync','verify','verified','lodash','moment','bluebird','md5','ioredis','../../../config/logger','defaults','redis','localhost','socket.io-emitter','./imap','./smtp','info','mailAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','isNil','mailAccount:update','hasOwnProperty','imapAccounts','handleImapBox','bind','email','end','error','handleImapError','disabled','connected','messages','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','stringify','handleImapEnd','sendMail','send','Smtp'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x059e,0x176));var _0xe059=function(_0xce9f1a,_0x461261){_0xce9f1a=_0xce9f1a-0x0;var _0x191fc9=_0x059e[_0xce9f1a];return _0x191fc9;};'use strict';var _=require(_0xe059('0x0'));var moment=require(_0xe059('0x1'));var BPromise=require(_0xe059('0x2'));var md5=require(_0xe059('0x3'));var Redis=require(_0xe059('0x4'));var config=require('../../../config/environment');var logger=require(_0xe059('0x5'))('email');config['redis']=_[_0xe059('0x6')](config[_0xe059('0x7')],{'host':_0xe059('0x8'),'port':0x18eb});var io=require(_0xe059('0x9'))(new Redis(config[_0xe059('0x7')]));var EmailImap=require(_0xe059('0xa'));var EmailSmtp=require(_0xe059('0xb'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x264580){logger[_0xe059('0xc')]('start\x20email\x20channel');this[_0xe059('0xd')]=_0x264580['mailAccounts'];this['imapAccounts']={};this[_0xe059('0xe')]=new EmailSmtp();}EmailChannel[_0xe059('0xf')][_0xe059('0x10')]=function(_0x1b9fbd){var _0x3c2621=this['mailAccounts'][_0x1b9fbd];var _0x1d0e46={'id':_0x3c2621['id'],'name':_0x3c2621[_0xe059('0x11')],'key':_0x3c2621[_0xe059('0x12')],'active':_0x3c2621[_0xe059('0x13')],'Imap':{'status':_0x3c2621[_0xe059('0x14')][_0xe059('0x15')],'messageStatus':_0x3c2621[_0xe059('0x14')][_0xe059('0x16')],'total':_0x3c2621[_0xe059('0x14')][_0xe059('0x17')]}};if(_[_0xe059('0x18')](md5Accounts[_0x1b9fbd])){md5Accounts[_0x1b9fbd]={};}var _0x53a2eb=md5(JSON['stringify'](_0x1d0e46));if(md5Accounts[_0x1b9fbd][_0xe059('0x3')]!==_0x53a2eb){md5Accounts[_0x1b9fbd][_0xe059('0x3')]=_0x53a2eb;io[_0xe059('0x10')](_0xe059('0x19'),_0x1d0e46);}};EmailChannel[_0xe059('0xf')]['refresh']=function(_0x977cb1){for(var _0x59ef43 in _0x977cb1){if(_0x977cb1[_0xe059('0x1a')](_0x59ef43)){if(_0x977cb1[_0x59ef43][_0xe059('0x14')]&&_0x977cb1[_0x59ef43][_0xe059('0x13')]){var _0x60ec67=_0x977cb1[_0x59ef43][_0xe059('0x14')];if(!this[_0xe059('0x1b')]['hasOwnProperty'](_0x60ec67['id'])){this[_0xe059('0x1b')][_0x60ec67['id']]=new EmailImap(_0x60ec67,_0x977cb1[_0x59ef43]['email']);this[_0xe059('0x1b')][_0x60ec67['id']]['on']('box',this[_0xe059('0x1c')][_0xe059('0x1d')](this,_0x59ef43));this[_0xe059('0x1b')][_0x60ec67['id']]['on'](_0xe059('0x1e'),this['handleImapEmail'][_0xe059('0x1d')](this,_0x59ef43));this[_0xe059('0x1b')][_0x60ec67['id']]['on'](_0xe059('0x1f'),this['handleImapEnd'][_0xe059('0x1d')](this,_0x59ef43));this[_0xe059('0x1b')][_0x60ec67['id']]['on'](_0xe059('0x20'),this[_0xe059('0x21')][_0xe059('0x1d')](this,_0x59ef43));}}else{if(_[_0xe059('0x18')](this[_0xe059('0xd')][_0x59ef43]['Imap'])){this[_0xe059('0xd')][_0x59ef43]['Imap']={};}this[_0xe059('0xd')][_0x59ef43][_0xe059('0x14')]['status']=_0xe059('0x22');this[_0xe059('0xd')][_0x59ef43][_0xe059('0x14')]['messageStatus']='';this[_0xe059('0x10')](_0x59ef43);}}}};EmailChannel[_0xe059('0xf')][_0xe059('0x1c')]=function(_0x13dc25,_0x13be7f){if(this[_0xe059('0xd')][_0x13dc25]){this[_0xe059('0xd')][_0x13dc25][_0xe059('0x14')][_0xe059('0x15')]=_0xe059('0x23');this[_0xe059('0xd')][_0x13dc25][_0xe059('0x14')][_0xe059('0x16')]=_0x13be7f[_0xe059('0x11')];if(_0x13be7f[_0xe059('0x24')]){this[_0xe059('0xd')][_0x13dc25][_0xe059('0x14')][_0xe059('0x17')]=_0x13be7f[_0xe059('0x24')]['total'];}return this[_0xe059('0x10')](_0x13dc25);}};EmailChannel[_0xe059('0xf')][_0xe059('0x25')]=function(_0x319c04,_0x2d1bc6){logger[_0xe059('0xc')](_0xe059('0x26'),_0x2d1bc6[_0xe059('0x27')],_0x2d1bc6['lastName'],_0x2d1bc6[_0xe059('0x28')],_0x319c04);if(this[_0xe059('0xd')][_0x319c04]){return mailAccount[_0xe059('0x29')](_0x319c04,_0x2d1bc6)[_0xe059('0x2a')](function(_0x1b5d86){if(_0x1b5d86){logger[_0xe059('0xc')](_0xe059('0x2b'));}})[_0xe059('0x2c')](function(_0x128a15){logger[_0xe059('0x20')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xe059('0x2d')](_0x128a15));});}};EmailChannel[_0xe059('0xf')][_0xe059('0x2e')]=function(_0xb3f12b){if(this[_0xe059('0xd')][_0xb3f12b]&&this[_0xe059('0xd')][_0xb3f12b][_0xe059('0x14')]){if(this[_0xe059('0x1b')][this[_0xe059('0xd')][_0xb3f12b][_0xe059('0x14')]['id']]){delete this[_0xe059('0x1b')][this[_0xe059('0xd')][_0xb3f12b][_0xe059('0x14')]['id']];}this[_0xe059('0xd')][_0xb3f12b][_0xe059('0x14')]['lastSync']=moment();this[_0xe059('0x10')](_0xb3f12b);}};EmailChannel[_0xe059('0xf')][_0xe059('0x21')]=function(_0x179120,_0x14a8e4){if(this[_0xe059('0xd')][_0x179120]){this['mailAccounts'][_0x179120][_0xe059('0x14')][_0xe059('0x15')]=_0xe059('0x20');this[_0xe059('0xd')][_0x179120][_0xe059('0x14')]['messageStatus']=_0x14a8e4;return this['emit'](_0x179120);}};EmailChannel[_0xe059('0xf')][_0xe059('0x2f')]=function(_0x2ec9b8,_0x12ceb2){return this['smtp'][_0xe059('0x30')](_0x2ec9b8,_0x12ceb2);};EmailChannel[_0xe059('0xf')]['verifySmtp']=function(_0x21e21f){var _0x4c4eed=this;if(this[_0xe059('0xd')][_0x21e21f['id']]){if(_[_0xe059('0x18')](this['mailAccounts'][_0x21e21f['id']][_0xe059('0x31')])){this[_0xe059('0xd')][_0x21e21f['id']][_0xe059('0x31')]={};}this[_0xe059('0xd')][_0x21e21f['id']][_0xe059('0x31')][_0xe059('0x32')]=moment();return new BPromise(function(_0x5de851,_0x405c29){return _0x4c4eed[_0xe059('0xe')][_0xe059('0x33')](_0x21e21f)['then'](function(_0x46951d){_0x4c4eed[_0xe059('0xd')][_0x21e21f['id']][_0xe059('0x31')][_0xe059('0x15')]=_0xe059('0x34');_0x4c4eed['mailAccounts'][_0x21e21f['id']]['Smtp'][_0xe059('0x16')]='';_0x4c4eed[_0xe059('0x10')](_0x21e21f['id']);_0x5de851(_0x46951d);})['catch'](function(_0x550e66){_0x4c4eed[_0xe059('0xd')][_0x21e21f['id']][_0xe059('0x31')]['status']=_0xe059('0x20');_0x4c4eed[_0xe059('0xd')][_0x21e21f['id']][_0xe059('0x31')][_0xe059('0x16')]=_0x550e66;_0x4c4eed['emit'](_0x21e21f['id']);_0x405c29(_0x550e66);});});}return this[_0xe059('0xe')][_0xe059('0x33')](_0x21e21f);};module['exports']=EmailChannel; \ No newline at end of file +var _0xd62a=['defaults','localhost','socket.io-emitter','./imap','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','key','active','Imap','status','messageStatus','isNil','md5','mailAccount:update','hasOwnProperty','email','box','handleImapBox','handleImapEmail','bind','end','handleImapEnd','error','disabled','connected','name','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','handleImapError','sendMail','verifySmtp','Smtp','then','verified','verify','exports','moment','bluebird','ioredis','../../../config/environment','../../../config/logger','redis'];(function(_0x3220bb,_0x342a03){var _0x23415c=function(_0x56cc05){while(--_0x56cc05){_0x3220bb['push'](_0x3220bb['shift']());}};_0x23415c(++_0x342a03);}(_0xd62a,0x138));var _0xad62=function(_0x15600f,_0xd8daf6){_0x15600f=_0x15600f-0x0;var _0x2c4b0d=_0xd62a[_0x15600f];return _0x2c4b0d;};'use strict';var _=require('lodash');var moment=require(_0xad62('0x0'));var BPromise=require(_0xad62('0x1'));var md5=require('md5');var Redis=require(_0xad62('0x2'));var config=require(_0xad62('0x3'));var logger=require(_0xad62('0x4'))('email');config[_0xad62('0x5')]=_[_0xad62('0x6')](config[_0xad62('0x5')],{'host':_0xad62('0x7'),'port':0x18eb});var io=require(_0xad62('0x8'))(new Redis(config[_0xad62('0x5')]));var EmailImap=require(_0xad62('0x9'));var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x32b98b){logger[_0xad62('0xa')](_0xad62('0xb'));this['mailAccounts']=_0x32b98b[_0xad62('0xc')];this[_0xad62('0xd')]={};this[_0xad62('0xe')]=new EmailSmtp();}EmailChannel[_0xad62('0xf')][_0xad62('0x10')]=function(_0x17288e){var _0x4bab5d=this[_0xad62('0xc')][_0x17288e];var _0x24a931={'id':_0x4bab5d['id'],'name':_0x4bab5d['name'],'key':_0x4bab5d[_0xad62('0x11')],'active':_0x4bab5d[_0xad62('0x12')],'Imap':{'status':_0x4bab5d[_0xad62('0x13')][_0xad62('0x14')],'messageStatus':_0x4bab5d[_0xad62('0x13')][_0xad62('0x15')],'total':_0x4bab5d[_0xad62('0x13')]['total']}};if(_[_0xad62('0x16')](md5Accounts[_0x17288e])){md5Accounts[_0x17288e]={};}var _0x10ffdb=md5(JSON['stringify'](_0x24a931));if(md5Accounts[_0x17288e][_0xad62('0x17')]!==_0x10ffdb){md5Accounts[_0x17288e][_0xad62('0x17')]=_0x10ffdb;io[_0xad62('0x10')](_0xad62('0x18'),_0x24a931);}};EmailChannel[_0xad62('0xf')]['refresh']=function(_0x54f044){for(var _0x13c06e in _0x54f044){if(_0x54f044[_0xad62('0x19')](_0x13c06e)){if(_0x54f044[_0x13c06e][_0xad62('0x13')]&&_0x54f044[_0x13c06e][_0xad62('0x12')]){var _0x289ae3=_0x54f044[_0x13c06e][_0xad62('0x13')];if(!this['imapAccounts'][_0xad62('0x19')](_0x289ae3['id'])){this[_0xad62('0xd')][_0x289ae3['id']]=new EmailImap(_0x289ae3,_0x54f044[_0x13c06e][_0xad62('0x1a')]);this[_0xad62('0xd')][_0x289ae3['id']]['on'](_0xad62('0x1b'),this[_0xad62('0x1c')]['bind'](this,_0x13c06e));this[_0xad62('0xd')][_0x289ae3['id']]['on']('email',this[_0xad62('0x1d')][_0xad62('0x1e')](this,_0x13c06e));this[_0xad62('0xd')][_0x289ae3['id']]['on'](_0xad62('0x1f'),this[_0xad62('0x20')][_0xad62('0x1e')](this,_0x13c06e));this[_0xad62('0xd')][_0x289ae3['id']]['on'](_0xad62('0x21'),this['handleImapError']['bind'](this,_0x13c06e));}}else{if(_[_0xad62('0x16')](this[_0xad62('0xc')][_0x13c06e]['Imap'])){this[_0xad62('0xc')][_0x13c06e][_0xad62('0x13')]={};}this[_0xad62('0xc')][_0x13c06e]['Imap'][_0xad62('0x14')]=_0xad62('0x22');this[_0xad62('0xc')][_0x13c06e]['Imap'][_0xad62('0x15')]='';this['emit'](_0x13c06e);}}}};EmailChannel['prototype'][_0xad62('0x1c')]=function(_0x59887f,_0x2c7c2d){if(this[_0xad62('0xc')][_0x59887f]){this[_0xad62('0xc')][_0x59887f]['Imap']['status']=_0xad62('0x23');this[_0xad62('0xc')][_0x59887f][_0xad62('0x13')][_0xad62('0x15')]=_0x2c7c2d[_0xad62('0x24')];if(_0x2c7c2d['messages']){this[_0xad62('0xc')][_0x59887f][_0xad62('0x13')][_0xad62('0x25')]=_0x2c7c2d['messages']['total'];}return this['emit'](_0x59887f);}};EmailChannel['prototype'][_0xad62('0x1d')]=function(_0x23043b,_0xf4b7e){logger['info'](_0xad62('0x26'),_0xf4b7e[_0xad62('0x27')],_0xf4b7e[_0xad62('0x28')],_0xf4b7e['from'],_0x23043b);if(this['mailAccounts'][_0x23043b]){return mailAccount['notify'](_0x23043b,_0xf4b7e)['then'](function(_0x1d9a75){if(_0x1d9a75){logger['info']('Mail\x20accepted\x20from\x20routing');}})[_0xad62('0x29')](function(_0x1a08b4){logger[_0xad62('0x21')](_0xad62('0x2a'),JSON[_0xad62('0x2b')](_0x1a08b4));});}};EmailChannel[_0xad62('0xf')][_0xad62('0x20')]=function(_0x29417c){if(this['mailAccounts'][_0x29417c]&&this[_0xad62('0xc')][_0x29417c]['Imap']){if(this[_0xad62('0xd')][this['mailAccounts'][_0x29417c]['Imap']['id']]){delete this[_0xad62('0xd')][this[_0xad62('0xc')][_0x29417c]['Imap']['id']];}this[_0xad62('0xc')][_0x29417c][_0xad62('0x13')][_0xad62('0x2c')]=moment();this[_0xad62('0x10')](_0x29417c);}};EmailChannel[_0xad62('0xf')][_0xad62('0x2d')]=function(_0x539aa6,_0xa79fc8){if(this[_0xad62('0xc')][_0x539aa6]){this[_0xad62('0xc')][_0x539aa6][_0xad62('0x13')]['status']=_0xad62('0x21');this[_0xad62('0xc')][_0x539aa6][_0xad62('0x13')][_0xad62('0x15')]=_0xa79fc8;return this[_0xad62('0x10')](_0x539aa6);}};EmailChannel[_0xad62('0xf')][_0xad62('0x2e')]=function(_0x14991b,_0x3ea3f3){return this[_0xad62('0xe')]['send'](_0x14991b,_0x3ea3f3);};EmailChannel[_0xad62('0xf')][_0xad62('0x2f')]=function(_0x5565d8){var _0x5a3cbc=this;if(this[_0xad62('0xc')][_0x5565d8['id']]){if(_[_0xad62('0x16')](this[_0xad62('0xc')][_0x5565d8['id']][_0xad62('0x30')])){this[_0xad62('0xc')][_0x5565d8['id']]['Smtp']={};}this[_0xad62('0xc')][_0x5565d8['id']][_0xad62('0x30')][_0xad62('0x2c')]=moment();return new BPromise(function(_0x3d0751,_0x565190){return _0x5a3cbc[_0xad62('0xe')]['verify'](_0x5565d8)[_0xad62('0x31')](function(_0x2854d4){_0x5a3cbc[_0xad62('0xc')][_0x5565d8['id']]['Smtp'][_0xad62('0x14')]=_0xad62('0x32');_0x5a3cbc[_0xad62('0xc')][_0x5565d8['id']][_0xad62('0x30')]['messageStatus']='';_0x5a3cbc[_0xad62('0x10')](_0x5565d8['id']);_0x3d0751(_0x2854d4);})['catch'](function(_0x244cc5){_0x5a3cbc[_0xad62('0xc')][_0x5565d8['id']]['Smtp']['status']=_0xad62('0x21');_0x5a3cbc[_0xad62('0xc')][_0x5565d8['id']][_0xad62('0x30')][_0xad62('0x15')]=_0x244cc5;_0x5a3cbc[_0xad62('0x10')](_0x5565d8['id']);_0x565190(_0x244cc5);});});}return this['smtp'][_0xad62('0x33')](_0x5565d8);};module[_0xad62('0x34')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 21f04b5..cd4035e 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 _0xbffb=['end','error','prototype','connTimeout','authTimeout','isNil','authentication','user','password','host','tls','autotls','service','port','anonymous@xcally.com','handleReady','openBox','handleOpenBox','handleError','emit','box','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchError','handleFetchEnd','closeBox','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleEnd','textCode','exports','path','util','imap','lodash','mailparser','iconv','Iconv','events','EventEmitter','./utils','email','mailbox','INBOX','getAccount','account','once','bind'];(function(_0x179477,_0x88be93){var _0x5d765c=function(_0x45de6f){while(--_0x45de6f){_0x179477['push'](_0x179477['shift']());}};_0x5d765c(++_0x88be93);}(_0xbffb,0x1b7));var _0xbbff=function(_0x262d71,_0x486be0){_0x262d71=_0x262d71-0x0;var _0x38a5e5=_0xbffb[_0x262d71];return _0x38a5e5;};'use strict';var fs=require('fs');var path=require(_0xbbff('0x0'));var util=require(_0xbbff('0x1'));var Imap=require(_0xbbff('0x2'));var _=require(_0xbbff('0x3'));var rs=require('randomstring');var simpleParser=require(_0xbbff('0x4'))['simpleParser'];var Iconv=require(_0xbbff('0x5'))[_0xbbff('0x6')];var EventEmitter=require(_0xbbff('0x7'))[_0xbbff('0x8')];var utils=require(_0xbbff('0x9'));var logger=require('../../../config/logger')(_0xbbff('0xa'));function EmailImap(_0x1e0c7b,_0x28d992){this[_0xbbff('0xb')]=_0xbbff('0xc');this['account']=this[_0xbbff('0xd')](_0x1e0c7b,_0x28d992);this[_0xbbff('0x2')]=new Imap(this[_0xbbff('0xe')]);this['imap'][_0xbbff('0xf')]('ready',this['handleReady'][_0xbbff('0x10')](this));this[_0xbbff('0x2')][_0xbbff('0xf')](_0xbbff('0x11'),this['handleEnd'][_0xbbff('0x10')](this));this[_0xbbff('0x2')]['on'](_0xbbff('0x12'),this['handleError'][_0xbbff('0x10')](this));this[_0xbbff('0x2')]['connect']();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xbbff('0x13')]['getAccount']=function(_0x357a57,_0x5607fe){var _0x34dd31={'connTimeout':_0x357a57[_0xbbff('0x14')]?_0x357a57[_0xbbff('0x14')]*0x3e8:0x2710,'authTimeout':_0x357a57[_0xbbff('0x15')]?_0x357a57['authTimeout']*0x3e8:0x1388};if(_[_0xbbff('0x16')](_0x357a57['service'])){if(_0x357a57[_0xbbff('0x17')]){_0x34dd31[_0xbbff('0x18')]=_0x357a57[_0xbbff('0x18')];_0x34dd31[_0xbbff('0x19')]=_0x357a57['password'];}_0x34dd31['host']=_0x357a57[_0xbbff('0x1a')];_0x34dd31['port']=_0x357a57['port']||0x3e1;if(_0x357a57[_0xbbff('0x1b')]){_0x34dd31['tls']=!![];}else{_0x34dd31['tls']=![];_0x34dd31[_0xbbff('0x1c')]='required';}}else{_0x34dd31[_0xbbff('0x18')]=_0x357a57[_0xbbff('0x18')];_0x34dd31[_0xbbff('0x19')]=_0x357a57['password'];_0x34dd31[_0xbbff('0x1a')]=utils['getHost'](_0x357a57[_0xbbff('0x1d')]);_0x34dd31[_0xbbff('0x1e')]=0x3e1;_0x34dd31[_0xbbff('0x1b')]=!![];}_0x34dd31[_0xbbff('0xa')]=_0x5607fe||_0x357a57[_0xbbff('0x18')]||_0xbbff('0x1f');return _0x34dd31;};EmailImap[_0xbbff('0x13')][_0xbbff('0x20')]=function(){this['imap'][_0xbbff('0x21')](this[_0xbbff('0xb')],![],this[_0xbbff('0x22')][_0xbbff('0x10')](this));};EmailImap[_0xbbff('0x13')]['handleOpenBox']=function(_0x57ac72,_0x48d608){if(_0x57ac72){this[_0xbbff('0x23')](_0x57ac72,!![]);}else{this[_0xbbff('0x24')](_0xbbff('0x25'),_0x48d608);this['readUnseen']();}};EmailImap[_0xbbff('0x13')][_0xbbff('0x26')]=function(_0x2a85c8){if(_0x2a85c8){this['handleError'](_0x2a85c8,!![]);}else{this[_0xbbff('0x2')][_0xbbff('0x11')]();}};EmailImap[_0xbbff('0x13')]['readUnseen']=function(){this[_0xbbff('0x2')][_0xbbff('0x27')]([_0xbbff('0x28')],this[_0xbbff('0x29')]['bind'](this));};EmailImap[_0xbbff('0x13')][_0xbbff('0x29')]=function(_0x1a4aeb,_0x588d6e){if(_0x1a4aeb){this[_0xbbff('0x23')](_0x1a4aeb,!![]);}else{if(_0x588d6e[_0xbbff('0x2a')]){try{var _0x437bf6=this[_0xbbff('0x2')][_0xbbff('0x2b')](_0x588d6e,{'bodies':'','markSeen':!![]});_0x437bf6['on'](_0xbbff('0x2c'),this['handleFetchMessage']['bind'](this));_0x437bf6['once'](_0xbbff('0x12'),this[_0xbbff('0x2d')][_0xbbff('0x10')](this));_0x437bf6[_0xbbff('0xf')](_0xbbff('0x11'),this[_0xbbff('0x2e')][_0xbbff('0x10')](this));}catch(_0x24a985){logger[_0xbbff('0x12')](_0x24a985);}}else{this[_0xbbff('0x2')][_0xbbff('0x2f')](!![],this[_0xbbff('0x26')][_0xbbff('0x10')](this));}}};EmailImap[_0xbbff('0x13')]['handleFetchMessage']=function(_0x37477e,_0x13a9e7){_0x37477e['on']('body',this[_0xbbff('0x30')][_0xbbff('0x10')](this));_0x37477e[_0xbbff('0xf')](_0xbbff('0x31'),this[_0xbbff('0x32')]['bind'](this));_0x37477e[_0xbbff('0xf')](_0xbbff('0x11'),this[_0xbbff('0x33')][_0xbbff('0x10')](this));};EmailImap['prototype'][_0xbbff('0x30')]=function(_0x555650,_0x252a81){simpleParser(_0x555650,{'Iconv':Iconv},this[_0xbbff('0x34')][_0xbbff('0x10')](this));};EmailImap['prototype'][_0xbbff('0x32')]=function(_0x55eee8){};EmailImap[_0xbbff('0x13')][_0xbbff('0x33')]=function(){};EmailImap['prototype'][_0xbbff('0x34')]=function(_0x603f38,_0x504e19){if(_0x603f38){logger[_0xbbff('0x12')](_0x603f38);}else{var _0x34d8b5=this;utils[_0xbbff('0x35')](this[_0xbbff('0xe')],_0x504e19,function(_0x187236){_0x34d8b5[_0xbbff('0x24')](_0xbbff('0xa'),_0x187236);});}};EmailImap['prototype']['handleFetchEnd']=function(){this[_0xbbff('0x2')][_0xbbff('0x2f')](!![],this[_0xbbff('0x26')][_0xbbff('0x10')](this));};EmailImap['prototype'][_0xbbff('0x2d')]=function(_0x381b8e){this['handleError'](_0x381b8e);this[_0xbbff('0x2')]['closeBox'](!![],this[_0xbbff('0x26')][_0xbbff('0x10')](this));};EmailImap[_0xbbff('0x13')][_0xbbff('0x36')]=function(){this[_0xbbff('0x24')](_0xbbff('0x11'));};EmailImap[_0xbbff('0x13')][_0xbbff('0x23')]=function(_0x43a537,_0x43e5be){logger[_0xbbff('0x12')](_0xbbff('0x23'),this['account'][_0xbbff('0xa')],JSON['stringify'](_0x43a537));var _0x221d4f='';if(_0x43a537){if(_0x43a537[_0xbbff('0x37')]){_0x221d4f=_0x43a537[_0xbbff('0x37')];}else{for(var _0x2abdcd in _0x43a537){if(_0x43a537['hasOwnProperty'](_0x2abdcd)){_0x221d4f+=_['upperFirst'](_0x2abdcd)+':\x20'+_0x43a537[_0x2abdcd]+'\x0a';}}}}if(_0x43e5be){this['imap'][_0xbbff('0x11')]();}else{this[_0xbbff('0x24')](_0xbbff('0x12'),_0x221d4f);this[_0xbbff('0x24')](_0xbbff('0x11'));}};module[_0xbbff('0x38')]=EmailImap; \ No newline at end of file +var _0x07a5=['path','util','imap','randomstring','mailparser','simpleParser','Iconv','EventEmitter','./utils','../../../config/logger','email','INBOX','account','getAccount','ready','bind','once','end','handleEnd','error','connect','inherits','connTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','prototype','handleReady','openBox','handleOpenBox','handleError','box','handleCloseBox','search','handleReadUnseen','length','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','emit','textCode','upperFirst','exports'];(function(_0xe7ac98,_0x276438){var _0x45b7df=function(_0x184218){while(--_0x184218){_0xe7ac98['push'](_0xe7ac98['shift']());}};_0x45b7df(++_0x276438);}(_0x07a5,0x1e8));var _0x507a=function(_0x2de41e,_0x12a7dc){_0x2de41e=_0x2de41e-0x0;var _0x2e70d1=_0x07a5[_0x2de41e];return _0x2e70d1;};'use strict';var fs=require('fs');var path=require(_0x507a('0x0'));var util=require(_0x507a('0x1'));var Imap=require(_0x507a('0x2'));var _=require('lodash');var rs=require(_0x507a('0x3'));var simpleParser=require(_0x507a('0x4'))[_0x507a('0x5')];var Iconv=require('iconv')[_0x507a('0x6')];var EventEmitter=require('events')[_0x507a('0x7')];var utils=require(_0x507a('0x8'));var logger=require(_0x507a('0x9'))(_0x507a('0xa'));function EmailImap(_0x2ee80a,_0x5b14d5){this['mailbox']=_0x507a('0xb');this[_0x507a('0xc')]=this[_0x507a('0xd')](_0x2ee80a,_0x5b14d5);this['imap']=new Imap(this['account']);this['imap']['once'](_0x507a('0xe'),this['handleReady'][_0x507a('0xf')](this));this['imap'][_0x507a('0x10')](_0x507a('0x11'),this[_0x507a('0x12')][_0x507a('0xf')](this));this[_0x507a('0x2')]['on'](_0x507a('0x13'),this['handleError'][_0x507a('0xf')](this));this['imap'][_0x507a('0x14')]();}util[_0x507a('0x15')](EmailImap,EventEmitter);EmailImap['prototype'][_0x507a('0xd')]=function(_0x43fc17,_0x5bb8da){var _0x14e7c8={'connTimeout':_0x43fc17[_0x507a('0x16')]?_0x43fc17[_0x507a('0x16')]*0x3e8:0x2710,'authTimeout':_0x43fc17['authTimeout']?_0x43fc17['authTimeout']*0x3e8:0x1388};if(_[_0x507a('0x17')](_0x43fc17[_0x507a('0x18')])){if(_0x43fc17[_0x507a('0x19')]){_0x14e7c8[_0x507a('0x1a')]=_0x43fc17['user'];_0x14e7c8['password']=_0x43fc17[_0x507a('0x1b')];}_0x14e7c8[_0x507a('0x1c')]=_0x43fc17[_0x507a('0x1c')];_0x14e7c8[_0x507a('0x1d')]=_0x43fc17[_0x507a('0x1d')]||0x3e1;if(_0x43fc17[_0x507a('0x1e')]){_0x14e7c8[_0x507a('0x1e')]=!![];}else{_0x14e7c8['tls']=![];_0x14e7c8[_0x507a('0x1f')]=_0x507a('0x20');}}else{_0x14e7c8['user']=_0x43fc17[_0x507a('0x1a')];_0x14e7c8['password']=_0x43fc17['password'];_0x14e7c8['host']=utils[_0x507a('0x21')](_0x43fc17[_0x507a('0x18')]);_0x14e7c8[_0x507a('0x1d')]=0x3e1;_0x14e7c8[_0x507a('0x1e')]=!![];}_0x14e7c8[_0x507a('0xa')]=_0x5bb8da||_0x43fc17[_0x507a('0x1a')]||_0x507a('0x22');return _0x14e7c8;};EmailImap[_0x507a('0x23')][_0x507a('0x24')]=function(){this[_0x507a('0x2')][_0x507a('0x25')](this['mailbox'],![],this[_0x507a('0x26')][_0x507a('0xf')](this));};EmailImap[_0x507a('0x23')][_0x507a('0x26')]=function(_0x1bb330,_0x506076){if(_0x1bb330){this[_0x507a('0x27')](_0x1bb330,!![]);}else{this['emit'](_0x507a('0x28'),_0x506076);this['readUnseen']();}};EmailImap[_0x507a('0x23')][_0x507a('0x29')]=function(_0x4db07d){if(_0x4db07d){this['handleError'](_0x4db07d,!![]);}else{this[_0x507a('0x2')][_0x507a('0x11')]();}};EmailImap[_0x507a('0x23')]['readUnseen']=function(){this[_0x507a('0x2')][_0x507a('0x2a')](['UNSEEN'],this[_0x507a('0x2b')][_0x507a('0xf')](this));};EmailImap['prototype'][_0x507a('0x2b')]=function(_0x3d2f91,_0xb4110e){if(_0x3d2f91){this[_0x507a('0x27')](_0x3d2f91,!![]);}else{if(_0xb4110e[_0x507a('0x2c')]){try{var _0x7fb260=this[_0x507a('0x2')]['fetch'](_0xb4110e,{'bodies':'','markSeen':!![]});_0x7fb260['on'](_0x507a('0x2d'),this[_0x507a('0x2e')][_0x507a('0xf')](this));_0x7fb260[_0x507a('0x10')](_0x507a('0x13'),this[_0x507a('0x2f')][_0x507a('0xf')](this));_0x7fb260[_0x507a('0x10')]('end',this[_0x507a('0x30')][_0x507a('0xf')](this));}catch(_0x1625d7){logger['error'](_0x1625d7);}}else{this['imap'][_0x507a('0x31')](!![],this[_0x507a('0x29')][_0x507a('0xf')](this));}}};EmailImap[_0x507a('0x23')][_0x507a('0x2e')]=function(_0x10b68a,_0x1810d0){_0x10b68a['on'](_0x507a('0x32'),this[_0x507a('0x33')]['bind'](this));_0x10b68a[_0x507a('0x10')](_0x507a('0x34'),this[_0x507a('0x35')][_0x507a('0xf')](this));_0x10b68a['once'](_0x507a('0x11'),this[_0x507a('0x36')][_0x507a('0xf')](this));};EmailImap[_0x507a('0x23')][_0x507a('0x33')]=function(_0x2f498f,_0x17af81){simpleParser(_0x2f498f,{'Iconv':Iconv},this[_0x507a('0x37')][_0x507a('0xf')](this));};EmailImap[_0x507a('0x23')]['handleMessageAttributes']=function(_0x153861){};EmailImap[_0x507a('0x23')][_0x507a('0x36')]=function(){};EmailImap[_0x507a('0x23')][_0x507a('0x37')]=function(_0x455eaf,_0x426fba){if(_0x455eaf){logger[_0x507a('0x13')](_0x455eaf);}else{var _0x588d87=this;utils[_0x507a('0x38')](this[_0x507a('0xc')],_0x426fba,function(_0x195e36){_0x588d87[_0x507a('0x39')](_0x507a('0xa'),_0x195e36);});}};EmailImap[_0x507a('0x23')][_0x507a('0x30')]=function(){this[_0x507a('0x2')]['closeBox'](!![],this[_0x507a('0x29')]['bind'](this));};EmailImap[_0x507a('0x23')][_0x507a('0x2f')]=function(_0x19d0e9){this[_0x507a('0x27')](_0x19d0e9);this[_0x507a('0x2')][_0x507a('0x31')](!![],this['handleCloseBox'][_0x507a('0xf')](this));};EmailImap['prototype'][_0x507a('0x12')]=function(){this[_0x507a('0x39')](_0x507a('0x11'));};EmailImap[_0x507a('0x23')][_0x507a('0x27')]=function(_0x3eb5f4,_0x395384){logger[_0x507a('0x13')](_0x507a('0x27'),this[_0x507a('0xc')]['email'],JSON['stringify'](_0x3eb5f4));var _0x430d8f='';if(_0x3eb5f4){if(_0x3eb5f4[_0x507a('0x3a')]){_0x430d8f=_0x3eb5f4[_0x507a('0x3a')];}else{for(var _0x36b8e7 in _0x3eb5f4){if(_0x3eb5f4['hasOwnProperty'](_0x36b8e7)){_0x430d8f+=_[_0x507a('0x3b')](_0x36b8e7)+':\x20'+_0x3eb5f4[_0x36b8e7]+'\x0a';}}}}if(_0x395384){this[_0x507a('0x2')][_0x507a('0x11')]();}else{this[_0x507a('0x39')](_0x507a('0x13'),_0x430d8f);this['emit'](_0x507a('0x11'));}};module[_0x507a('0x3c')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 68b375d..c18fa3d 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 _0xcc0f=['Not\x20verifired','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','use','compile','toString','verify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcc0f,0x1c5));var _0xfcc0=function(_0x4506d9,_0x404f93){_0x4506d9=_0x4506d9-0x0;var _0x7b1b3f=_0xcc0f[_0x4506d9];return _0x7b1b3f;};'use strict';var nodemailer=require(_0xfcc0('0x0'));var BPromise=require(_0xfcc0('0x1'));var inlineBase64=require(_0xfcc0('0x2'));function EmailSmtp(){}EmailSmtp[_0xfcc0('0x3')][_0xfcc0('0x4')]=function(_0x4fe2db,_0xd042b4){return new BPromise(function(_0x395e52,_0x4ba9ce){var _0x285a4c=nodemailer['createTransport'](_0x4fe2db);_0x285a4c[_0xfcc0('0x5')](_0xfcc0('0x6'),inlineBase64());_0x285a4c['sendMail'](_0xd042b4,function(_0xf97012,_0x251c47){if(_0xf97012){_0x4ba9ce(_0xf97012[_0xfcc0('0x7')]());}else{_0x395e52(_0x251c47);}});});};EmailSmtp['prototype'][_0xfcc0('0x8')]=function(_0x5992dd){return new BPromise(function(_0xab5dce,_0x1f290c){var _0x3849f7=nodemailer['createTransport'](_0x5992dd);_0x3849f7[_0xfcc0('0x8')](function(_0x513cc6,_0x1286ab){if(_0x513cc6){_0x1f290c(_0x513cc6['toString']());}else{if(_0x1286ab){_0xab5dce(_0x1286ab);}else{_0x1f290c(_0xfcc0('0x9'));}}});});};module[_0xfcc0('0xa')]=EmailSmtp; \ No newline at end of file +var _0xfc9f=['send','use','compile','sendMail','toString','createTransport','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype'];(function(_0x537c37,_0x536e74){var _0x241f84=function(_0x3fe709){while(--_0x3fe709){_0x537c37['push'](_0x537c37['shift']());}};_0x241f84(++_0x536e74);}(_0xfc9f,0x11d));var _0xffc9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfc9f[_0x3dd15e];return _0x231fd0;};'use strict';var nodemailer=require(_0xffc9('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0xffc9('0x1'));function EmailSmtp(){}EmailSmtp[_0xffc9('0x2')][_0xffc9('0x3')]=function(_0x29b17a,_0x2b7aea){return new BPromise(function(_0x4c43c6,_0x5ac73d){var _0x5c26fb=nodemailer['createTransport'](_0x29b17a);_0x5c26fb[_0xffc9('0x4')](_0xffc9('0x5'),inlineBase64());_0x5c26fb[_0xffc9('0x6')](_0x2b7aea,function(_0x5a52c6,_0x33c03e){if(_0x5a52c6){_0x5ac73d(_0x5a52c6[_0xffc9('0x7')]());}else{_0x4c43c6(_0x33c03e);}});});};EmailSmtp[_0xffc9('0x2')]['verify']=function(_0x19cbaa){return new BPromise(function(_0x5e59a2,_0x39642b){var _0x5c14d5=nodemailer[_0xffc9('0x8')](_0x19cbaa);_0x5c14d5[_0xffc9('0x9')](function(_0x2bd814,_0x431a46){if(_0x2bd814){_0x39642b(_0x2bd814[_0xffc9('0x7')]());}else{if(_0x431a46){_0x5e59a2(_0x431a46);}else{_0x39642b(_0xffc9('0xa'));}}});});};module[_0xffc9('0xb')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 2120042..0f16056 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 _0x4888=['

Empty\x20message

','Attachments','Title','Data','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','moment','randomstring','path','util','node-tnef','../../../config/logger','email','head','value','address','name','indexOf','split','slice','join','length','pop','isEmpty','generate','@xcally.com','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body','0x1?_0x468896[_0x8488('0xd')](0x0,-0x1)[_0x8488('0xe')]('\x20'):_0x151528['name'];}return'Anonymous';}function getLastName(_0x150b52){var _0x496dd1=_[_0x8488('0x7')](_0x150b52['value']);if(_0x496dd1&&_0x496dd1['name']){var _0x24d0a0=_0x496dd1[_0x8488('0xa')][_0x8488('0xc')](/\s+/);return _0x24d0a0[_0x8488('0xf')]>0x1?_0x24d0a0[_0x8488('0x10')]():'';}return'';}function getMails(_0x8d3b3d,_0x165139){var _0x4e44af='';for(var _0x3dad45=0x0;_0x3dad45<_0x165139[_0x8488('0x8')][_0x8488('0xf')];_0x3dad45+=0x1){if(_0x165139[_0x8488('0x8')][_0x3dad45][_0x8488('0x9')]!==_0x8d3b3d){if(!_[_0x8488('0x11')](_0x4e44af)){_0x4e44af+=',';}_0x4e44af+=_0x165139[_0x8488('0x8')][_0x3dad45][_0x8488('0xa')]||_0x165139[_0x8488('0x8')][_0x3dad45][_0x8488('0x9')]||'';_0x4e44af+='\x20<';_0x4e44af+=_0x165139[_0x8488('0x8')][_0x3dad45][_0x8488('0x9')]?_0x165139[_0x8488('0x8')][_0x3dad45]['address']:'anonymous'+random[_0x8488('0x12')](0x6)+_0x8488('0x13');_0x4e44af+='>';}}return _0x4e44af;}function parseEmail(_0xbb10fe,_0x3c9fc2,_0x892236){if(_0x3c9fc2[_0x8488('0x14')]){var _0x43b672=/)<[^<]*)*<\/script>/gi;while(_0x43b672[_0x8488('0x15')](_0x3c9fc2[_0x8488('0x14')])){_0x3c9fc2['html']=_0x3c9fc2[_0x8488('0x14')][_0x8488('0x16')](_0x43b672,'');}if(_0x3c9fc2[_0x8488('0x14')][_0x8488('0x17')](_0x8488('0x18'))){var _0x54ecda=[];_0x3c9fc2['attachments']['forEach'](_0x59b5e2=>{_0x54ecda[_0x8488('0x19')](_0x59b5e2['filename']);});var _0x58057a=/]+>/g;var _0x26bdbb=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2f350a=_0x3c9fc2[_0x8488('0x14')][_0x8488('0x16')](_0x26bdbb,_0x8488('0x1a'));var _0x503b83=_0x2f350a[_0x8488('0x16')](_0x58057a,_0x8488('0x1b'));for(let _0xf9720e=0x0;_0xf9720e<_0x54ecda[_0x8488('0xf')];_0xf9720e++){var _0x460001=_0x503b83[_0x8488('0x16')](_0x8488('0x1b'),_0x8488('0x1c')+_0x54ecda[_0xf9720e]+_0x8488('0x1d'));_0x503b83=_0x460001;}_0x3c9fc2[_0x8488('0x14')]=_0x503b83;}_0x892236[_0x8488('0x1e')]=_0x3c9fc2['html'];}else{_0x892236['body']=_0x3c9fc2['textAsHtml'];}if(_0x892236[_0x8488('0x1e')]){_0x892236[_0x8488('0x1e')]=_0x892236[_0x8488('0x1e')][_0x8488('0x16')](/0x0){var _0x28bc84=[_0x8488('0x30'),_0x8488('0x31'),_0x8488('0x32')];for(var _0x496ea0=0x0;_0x496ea0<_0x3c9fc2[_0x8488('0x2f')][_0x8488('0xf')];_0x496ea0++){var _0x891cff=_['indexOf'](_0x28bc84,_0x3c9fc2[_0x8488('0x2f')][_0x496ea0]['line']);if(_0x891cff>=0x0){_0x892236[_0x8488('0x33')]=!![];}}}return _0x892236;}exports[_0x8488('0x34')]=function(_0x5cbd11,_0x22a3f3,_0x4023ac){var _0x10cc1f={'from':getAddress(_0x22a3f3[_0x8488('0x35')]),'firstName':getFirstName(_0x22a3f3[_0x8488('0x35')]),'lastName':getLastName(_0x22a3f3['from']),'mapKey':_0x8488('0x6'),'message':{'from':getMails(_0x5cbd11['email'],_0x22a3f3[_0x8488('0x35')]),'to':_0x5cbd11[_0x8488('0x6')],'cc':'','subject':_0x22a3f3[_0x8488('0x36')]||'','messageId':_0x22a3f3[_0x8488('0x37')],'inReplyTo':_0x22a3f3[_0x8488('0x38')],'sentAt':moment(_0x22a3f3[_0x8488('0x39')])[_0x8488('0x28')](_0x8488('0x3a')),'attach':![],'attachments':[]}};if(!_0x22a3f3[_0x8488('0x14')]&&!_0x22a3f3[_0x8488('0x3b')]){var _0xa4351b=_[_0x8488('0x3c')](_0x22a3f3[_0x8488('0x24')],{'contentType':_0x8488('0x3d')});if(_0xa4351b[_0x8488('0xf')]){logger[_0x8488('0x3e')](util[_0x8488('0x28')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x22a3f3[_0x8488('0x37')]));tnef[_0x8488('0x3f')](_[_0x8488('0x40')](_0xa4351b)[_0x8488('0x2e')],function(_0x5067fa,_0x44e74f){if(_0x44e74f){_0x22a3f3[_0x8488('0x14')]=_0x44e74f[_0x8488('0x41')]||_0x8488('0x42');if(_0x44e74f['Attachments']){for(var _0x1f0516=0x0;_0x1f0516<_0x44e74f[_0x8488('0x43')][_0x8488('0xf')];_0x1f0516++){var _0x33d6c9=_0x44e74f[_0x8488('0x43')][_0x1f0516];_0x10cc1f[_0x8488('0x20')][_0x8488('0x24')][_0x8488('0x19')]({'filename':_0x33d6c9[_0x8488('0x44')],'content':Buffer[_0x8488('0x35')](_0x33d6c9[_0x8488('0x45')])});}}}_0x4023ac(parseEmail(_0x5cbd11,_0x22a3f3,_0x10cc1f));});}else{_0x22a3f3[_0x8488('0x14')]=_0x8488('0x42');_0x4023ac(parseEmail(_0x5cbd11,_0x22a3f3,_0x10cc1f));}}else{_0x4023ac(parseEmail(_0x5cbd11,_0x22a3f3,_0x10cc1f));}};exports['getHost']=function(_0x56bc65){switch(_0x56bc65){case _0x8488('0x46'):return _0x8488('0x47');case _0x8488('0x48'):return _0x8488('0x49');case _0x8488('0x4a'):return _0x8488('0x4b');case _0x8488('0x4c'):return _0x8488('0x4d');}return _0x8488('0x4e');}; \ No newline at end of file +var _0x1867=['content','push','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','indexOf','isAutoreply','parser','from','subject','messageId','inReplyTo','date','format','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','Attachments','Data','

Empty\x20message

','getHost','gmail','imap.gmail.com','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','path','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','name','substring','split','length','join','Anonymous','pop','isEmpty','html','replace','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x5dad55['slice'](0x0,-0x1)[_0x7186('0x10')]('\x20'):_0x1ccbd[_0x7186('0xc')];}return _0x7186('0x11');}function getLastName(_0x33110a){var _0x489e35=_['head'](_0x33110a['value']);if(_0x489e35&&_0x489e35[_0x7186('0xc')]){var _0x1aa34c=_0x489e35[_0x7186('0xc')][_0x7186('0xe')](/\s+/);return _0x1aa34c['length']>0x1?_0x1aa34c[_0x7186('0x12')]():'';}return'';}function getMails(_0x1cc347,_0x915126){var _0x396e13='';for(var _0x6508f5=0x0;_0x6508f5<_0x915126[_0x7186('0x8')][_0x7186('0xf')];_0x6508f5+=0x1){if(_0x915126[_0x7186('0x8')][_0x6508f5]['address']!==_0x1cc347){if(!_[_0x7186('0x13')](_0x396e13)){_0x396e13+=',';}_0x396e13+=_0x915126[_0x7186('0x8')][_0x6508f5]['name']||_0x915126[_0x7186('0x8')][_0x6508f5][_0x7186('0x9')]||'';_0x396e13+='\x20<';_0x396e13+=_0x915126[_0x7186('0x8')][_0x6508f5]['address']?_0x915126['value'][_0x6508f5][_0x7186('0x9')]:'anonymous'+random[_0x7186('0xb')](0x6)+'@xcally.com';_0x396e13+='>';}}return _0x396e13;}function parseEmail(_0x599116,_0x54ca4e,_0x3f932b){if(_0x54ca4e[_0x7186('0x14')]){var _0x48bfaf=/)<[^<]*)*<\/script>/gi;while(_0x48bfaf['test'](_0x54ca4e['html'])){_0x54ca4e['html']=_0x54ca4e[_0x7186('0x14')][_0x7186('0x15')](_0x48bfaf,'');}if(_0x54ca4e[_0x7186('0x14')]['includes'](_0x7186('0x16'))){var _0x182338=[];_0x54ca4e[_0x7186('0x17')][_0x7186('0x18')](_0x1baf5b=>{_0x182338['push'](_0x1baf5b[_0x7186('0x19')]);});var _0x207b9e=/]+>/g;var _0x4782ca=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x142bde=_0x54ca4e[_0x7186('0x14')][_0x7186('0x15')](_0x4782ca,_0x7186('0x1a'));var _0xf2db43=_0x142bde['replace'](_0x207b9e,_0x7186('0x1b'));for(let _0x463f1e=0x0;_0x463f1e<_0x182338['length'];_0x463f1e++){var _0x40356a=_0xf2db43['replace'](_0x7186('0x1b'),_0x7186('0x1c')+_0x182338[_0x463f1e]+_0x7186('0x1d'));_0xf2db43=_0x40356a;}_0x54ca4e[_0x7186('0x14')]=_0xf2db43;}_0x3f932b[_0x7186('0x1e')]=_0x54ca4e['html'];}else{_0x3f932b[_0x7186('0x1e')]=_0x54ca4e[_0x7186('0x1f')];}if(_0x3f932b[_0x7186('0x1e')]){_0x3f932b[_0x7186('0x1e')]=_0x3f932b[_0x7186('0x1e')]['replace'](/0x0){var _0x375dec=[_0x7186('0x2f'),_0x7186('0x30'),_0x7186('0x31')];for(var _0x3c63c1=0x0;_0x3c63c1<_0x54ca4e[_0x7186('0x2e')][_0x7186('0xf')];_0x3c63c1++){var _0x41081e=_[_0x7186('0x32')](_0x375dec,_0x54ca4e[_0x7186('0x2e')][_0x3c63c1]['line']);if(_0x41081e>=0x0){_0x3f932b[_0x7186('0x33')]=!![];}}}return _0x3f932b;}exports[_0x7186('0x34')]=function(_0x496d81,_0x3eae46,_0x11a524){var _0x494ddf={'from':getAddress(_0x3eae46[_0x7186('0x35')]),'firstName':getFirstName(_0x3eae46[_0x7186('0x35')]),'lastName':getLastName(_0x3eae46[_0x7186('0x35')]),'mapKey':_0x7186('0x5'),'message':{'from':getMails(_0x496d81['email'],_0x3eae46[_0x7186('0x35')]),'to':_0x496d81[_0x7186('0x5')],'cc':'','subject':_0x3eae46[_0x7186('0x36')]||'','messageId':_0x3eae46[_0x7186('0x37')],'inReplyTo':_0x3eae46[_0x7186('0x38')],'sentAt':moment(_0x3eae46[_0x7186('0x39')])[_0x7186('0x3a')](_0x7186('0x3b')),'attach':![],'attachments':[]}};if(!_0x3eae46[_0x7186('0x14')]&&!_0x3eae46[_0x7186('0x1f')]){var _0x26bf48=_[_0x7186('0x3c')](_0x3eae46[_0x7186('0x17')],{'contentType':_0x7186('0x3d')});if(_0x26bf48['length']){logger['info'](util[_0x7186('0x3a')](_0x7186('0x3e'),_0x3eae46['messageId']));tnef[_0x7186('0x3f')](_['first'](_0x26bf48)[_0x7186('0x2c')],function(_0x101c58,_0x556aab){if(_0x556aab){_0x3eae46[_0x7186('0x14')]=_0x556aab['BodyHTML']||'

Empty\x20message

';if(_0x556aab[_0x7186('0x40')]){for(var _0x214686=0x0;_0x214686<_0x556aab['Attachments'][_0x7186('0xf')];_0x214686++){var _0x2daf8b=_0x556aab[_0x7186('0x40')][_0x214686];_0x494ddf[_0x7186('0x21')][_0x7186('0x17')][_0x7186('0x2d')]({'filename':_0x2daf8b['Title'],'content':Buffer[_0x7186('0x35')](_0x2daf8b[_0x7186('0x41')])});}}}_0x11a524(parseEmail(_0x496d81,_0x3eae46,_0x494ddf));});}else{_0x3eae46[_0x7186('0x14')]=_0x7186('0x42');_0x11a524(parseEmail(_0x496d81,_0x3eae46,_0x494ddf));}}else{_0x11a524(parseEmail(_0x496d81,_0x3eae46,_0x494ddf));}};exports[_0x7186('0x43')]=function(_0x5ab66a){switch(_0x5ab66a){case _0x7186('0x44'):return _0x7186('0x45');case'yahoo':return _0x7186('0x46');case'hotmail':return _0x7186('0x47');case _0x7186('0x48'):return _0x7186('0x49');}return _0x7186('0x4a');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index c6950ae..eadfc2e 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 _0xc6c7=['name','Service','key','SERV','active','Imap','Smtp','exports'];(function(_0x59c6dc,_0x2f43d2){var _0x3ae1b6=function(_0x155bd3){while(--_0x155bd3){_0x59c6dc['push'](_0x59c6dc['shift']());}};_0x3ae1b6(++_0x2f43d2);}(_0xc6c7,0xa8));var _0x7c6c=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xc6c7[_0x21549c];return _0x426cbd;};'use strict';var _=require('lodash');function MailAccount(_0x237d09){this['id']=_0x237d09['id']||0x0;this['name']=_0x237d09[_0x7c6c('0x0')]||_0x7c6c('0x1');this[_0x7c6c('0x2')]=_0x237d09[_0x7c6c('0x2')]||_0x7c6c('0x3');this['active']=_0x237d09[_0x7c6c('0x4')]||![];this['Imap']=_0x237d09[_0x7c6c('0x5')]||[];this[_0x7c6c('0x6')]=_0x237d09[_0x7c6c('0x6')]||[];}module[_0x7c6c('0x7')]=MailAccount; \ No newline at end of file +var _0x3b13=['Smtp','exports','lodash','name','Service','key','SERV','active','Imap'];(function(_0x530309,_0x14376a){var _0x4a657c=function(_0x1c543b){while(--_0x1c543b){_0x530309['push'](_0x530309['shift']());}};_0x4a657c(++_0x14376a);}(_0x3b13,0x158));var _0x33b1=function(_0x549278,_0x450754){_0x549278=_0x549278-0x0;var _0x1ea9a1=_0x3b13[_0x549278];return _0x1ea9a1;};'use strict';var _=require(_0x33b1('0x0'));function MailAccount(_0x4a13d6){this['id']=_0x4a13d6['id']||0x0;this[_0x33b1('0x1')]=_0x4a13d6[_0x33b1('0x1')]||_0x33b1('0x2');this[_0x33b1('0x3')]=_0x4a13d6[_0x33b1('0x3')]||_0x33b1('0x4');this[_0x33b1('0x5')]=_0x4a13d6['active']||![];this[_0x33b1('0x6')]=_0x4a13d6['Imap']||[];this[_0x33b1('0x7')]=_0x4a13d6[_0x33b1('0x7')]||[];}module[_0x33b1('0x8')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 3d2cef4..b1f1ac2 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 _0x6247=['hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','mailAccounts','isUndefined','merge','exports','lodash','../model/mailAccount','mapKeys'];(function(_0x3da678,_0x3e4029){var _0x4c7ad4=function(_0x52b6ec){while(--_0x52b6ec){_0x3da678['push'](_0x3da678['shift']());}};_0x4c7ad4(++_0x3e4029);}(_0x6247,0x6b));var _0x7624=function(_0x384c7f,_0x2d8817){_0x384c7f=_0x384c7f-0x0;var _0x45143d=_0x6247[_0x384c7f];return _0x45143d;};'use strict';var _=require(_0x7624('0x0'));var MailAccount=require(_0x7624('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x476e5f,_0x457ec0,_0x44e1e8){var _0x5e2e90=_[_0x7624('0x2')](_0x476e5f,function(_0x28ec05,_0x1fc73d){return _0x28ec05[_0x44e1e8];});for(var _0x5dff29 in _0x457ec0){if(_0x457ec0[_0x7624('0x3')](_0x5dff29)){if(!_0x5e2e90[_0x5dff29]){delete _0x457ec0[_0x5dff29];}}}}Realtime[_0x7624('0x4')][_0x7624('0x5')]=function(_0x36ee7a,_0xece08a){for(var _0x27a659 in _0xece08a){if(_0x36ee7a[_0x7624('0x3')](_0x27a659)){_0x36ee7a[_0x27a659]=_0xece08a[_0x27a659];}}};Realtime[_0x7624('0x4')][_0x7624('0x6')]=function(){var _0x5860a9=this;return function(_0x1e7756){if(_0x1e7756){freeIsNotKey(_0x1e7756,_0x5860a9[_0x7624('0x7')],'id');for(var _0x130d2c=0x0,_0x282182={},_0x1e71da={};_0x130d2c<_0x1e7756['length'];_0x130d2c+=0x1){_0x282182=_0x1e7756[_0x130d2c];if(_[_0x7624('0x8')](_0x5860a9[_0x7624('0x7')][_0x282182['id']])){_0x5860a9[_0x7624('0x7')][_0x282182['id']]=new MailAccount(_0x282182);}else{_[_0x7624('0x9')](_0x5860a9[_0x7624('0x7')][_0x282182['id']],_0x282182);}}}return _0x5860a9[_0x7624('0x7')];};};module[_0x7624('0xa')]=Realtime; \ No newline at end of file +var _0xe48a=['length','isUndefined','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase'];(function(_0x333fc8,_0x2b292c){var _0x432439=function(_0x5501b6){while(--_0x5501b6){_0x333fc8['push'](_0x333fc8['shift']());}};_0x432439(++_0x2b292c);}(_0xe48a,0xf5));var _0xae48=function(_0x49dd98,_0x8dc77f){_0x49dd98=_0x49dd98-0x0;var _0x590ce3=_0xe48a[_0x49dd98];return _0x590ce3;};'use strict';var _=require(_0xae48('0x0'));var MailAccount=require(_0xae48('0x1'));var Realtime=function(){this[_0xae48('0x2')]={};};function freeIsNotKey(_0x3f5cd8,_0x2516bf,_0x3fe6fa){var _0x25a591=_[_0xae48('0x3')](_0x3f5cd8,function(_0x321839,_0x457bbd){return _0x321839[_0x3fe6fa];});for(var _0x599a35 in _0x2516bf){if(_0x2516bf[_0xae48('0x4')](_0x599a35)){if(!_0x25a591[_0x599a35]){delete _0x2516bf[_0x599a35];}}}}Realtime[_0xae48('0x5')][_0xae48('0x6')]=function(_0x20e7c6,_0x3d2502){for(var _0x18bb71 in _0x3d2502){if(_0x20e7c6['hasOwnProperty'](_0x18bb71)){_0x20e7c6[_0x18bb71]=_0x3d2502[_0x18bb71];}}};Realtime[_0xae48('0x5')]['initMailAccounts']=function(){var _0x455523=this;return function(_0x2aec60){if(_0x2aec60){freeIsNotKey(_0x2aec60,_0x455523['mailAccounts'],'id');for(var _0x3a5aec=0x0,_0x47b500={},_0x258817={};_0x3a5aec<_0x2aec60[_0xae48('0x7')];_0x3a5aec+=0x1){_0x47b500=_0x2aec60[_0x3a5aec];if(_[_0xae48('0x8')](_0x455523[_0xae48('0x2')][_0x47b500['id']])){_0x455523['mailAccounts'][_0x47b500['id']]=new MailAccount(_0x47b500);}else{_['merge'](_0x455523[_0xae48('0x2')][_0x47b500['id']],_0x47b500);}}}return _0x455523[_0xae48('0x2')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 88c5002..1a90797 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 _0x855f=['getMailAccount','notify','NotifyMailAccount','../client','Request','GetMailAccount','name','service','email','key','ListId','Imap','MailServerOut','Smtp'];(function(_0x231e61,_0x583c32){var _0x7201dc=function(_0x33695){while(--_0x33695){_0x231e61['push'](_0x231e61['shift']());}};_0x7201dc(++_0x583c32);}(_0x855f,0x145));var _0xf855=function(_0x590b32,_0x588f63){_0x590b32=_0x590b32-0x0;var _0x40fed0=_0x855f[_0x590b32];return _0x40fed0;};'use strict';var client=require(_0xf855('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0xf855('0x1')](_0xf855('0x2'),{'options':{'attributes':['id',_0xf855('0x3'),_0xf855('0x4'),_0xf855('0x5'),'active',_0xf855('0x6'),_0xf855('0x7'),'TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':_0xf855('0x8')},{'model':_0xf855('0x9'),'as':_0xf855('0xa')}]},'log':_0xf855('0xb')});};};exports[_0xf855('0xc')]=function(_0x3a9bda,_0x23f738){return client['Request'](_0xf855('0xd'),{'account':{'id':_0x3a9bda},'body':_0x23f738,'log':_0xf855('0xd')});}; \ No newline at end of file +var _0x908d=['service','email','active','key','ListId','MailServerIn','Imap','MailServerOut','getMailAccount','NotifyMailAccount','../client','Request','GetMailAccount'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x908d,0x176));var _0xd908=function(_0x56d551,_0x18845c){_0x56d551=_0x56d551-0x0;var _0x220843=_0x908d[_0x56d551];return _0x220843;};'use strict';var client=require(_0xd908('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0xd908('0x1')](_0xd908('0x2'),{'options':{'attributes':['id','name',_0xd908('0x3'),_0xd908('0x4'),_0xd908('0x5'),_0xd908('0x6'),_0xd908('0x7'),'TemplateId'],'raw':![],'include':[{'model':_0xd908('0x8'),'as':_0xd908('0x9')},{'model':_0xd908('0xa'),'as':'Smtp'}]},'log':_0xd908('0xb')});};};exports['notify']=function(_0x362fb3,_0x2f82dc){return client[_0xd908('0x1')](_0xd908('0xc'),{'account':{'id':_0x362fb3},'body':_0x2f82dc,'log':_0xd908('0xc')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 2bed0a7..8fa22de 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 _0x718d=['ShowSetting','GetSettings','../client','getSettings'];(function(_0x42f4ce,_0x255c27){var _0x409b04=function(_0x3065e0){while(--_0x3065e0){_0x42f4ce['push'](_0x42f4ce['shift']());}};_0x409b04(++_0x255c27);}(_0x718d,0x1f2));var _0xd718=function(_0x73d87c,_0xcf6660){_0x73d87c=_0x73d87c-0x0;var _0xa27c94=_0x718d[_0x73d87c];return _0xa27c94;};'use strict';var client=require(_0xd718('0x0'));exports[_0xd718('0x1')]=function(){return client['Request'](_0xd718('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xd718('0x3')});}; \ No newline at end of file +var _0x5e95=['ShowSetting','loginMailFrequency','GetSettings','../client','getSettings'];(function(_0x3f7f98,_0x4a83c8){var _0xaa12b9=function(_0x2d5d43){while(--_0x2d5d43){_0x3f7f98['push'](_0x3f7f98['shift']());}};_0xaa12b9(++_0x4a83c8);}(_0x5e95,0xe9));var _0x55e9=function(_0x209417,_0x229b93){_0x209417=_0x209417-0x0;var _0x5acf23=_0x5e95[_0x209417];return _0x5acf23;};'use strict';var client=require(_0x55e9('0x0'));exports[_0x55e9('0x1')]=function(){return client['Request'](_0x55e9('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x55e9('0x3')]},'log':_0x55e9('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index a895bfa..b3539cd 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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 254c855..399e613 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 _0x9763=['http','express','sticky-session','ioredis','../../config/environment','createServer','port','websocket','polling','defaults','redis','adapter','socket.io-redis','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash'];(function(_0x36facf,_0x4dfa10){var _0x5c2435=function(_0x1059e2){while(--_0x1059e2){_0x36facf['push'](_0x36facf['shift']());}};_0x5c2435(++_0x4dfa10);}(_0x9763,0x1cd));var _0x3976=function(_0x3ff598,_0x37e3a2){_0x3ff598=_0x3ff598-0x0;var _0x2fe97b=_0x9763[_0x3ff598];return _0x2fe97b;};'use strict';var _=require(_0x3976('0x0'));var http=require(_0x3976('0x1'));var express=require(_0x3976('0x2'));var sticky=require(_0x3976('0x3'));var Redis=require(_0x3976('0x4'));var config=require(_0x3976('0x5'));var app=express();var server=http[_0x3976('0x6')](app);server['timeout']=0xdbba0;if(sticky['listen'](server,config[_0x3976('0x7')])){var socketio=require('socket.io')(server,{'transports':[_0x3976('0x8'),_0x3976('0x9')]});config['redis']=_[_0x3976('0xa')](config[_0x3976('0xb')],{'host':'localhost','port':0x18eb});socketio[_0x3976('0xc')](require(_0x3976('0xd'))({'pubClient':new Redis(config[_0x3976('0xb')]),'subClient':new Redis(config[_0x3976('0xb')])}));require(_0x3976('0xe'))['default']();require(_0x3976('0xf'))[_0x3976('0x10')](socketio);require(_0x3976('0x11'))[_0x3976('0x10')](app);require(_0x3976('0x12'))[_0x3976('0x10')](app);}else{server[_0x3976('0x13')]('listening',function(){console[_0x3976('0x14')](_0x3976('0x15'),config[_0x3976('0x7')]);});}exports=module['exports']=app; \ No newline at end of file +var _0x252e=['ioredis','../../config/environment','timeout','listen','port','websocket','polling','redis','defaults','localhost','adapter','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session'];(function(_0x1b02bb,_0x3d9fde){var _0x131245=function(_0x2fd1d8){while(--_0x2fd1d8){_0x1b02bb['push'](_0x1b02bb['shift']());}};_0x131245(++_0x3d9fde);}(_0x252e,0x15a));var _0xe252=function(_0x21971f,_0x2ded6e){_0x21971f=_0x21971f-0x0;var _0x35b83e=_0x252e[_0x21971f];return _0x35b83e;};'use strict';var _=require(_0xe252('0x0'));var http=require(_0xe252('0x1'));var express=require(_0xe252('0x2'));var sticky=require(_0xe252('0x3'));var Redis=require(_0xe252('0x4'));var config=require(_0xe252('0x5'));var app=express();var server=http['createServer'](app);server[_0xe252('0x6')]=0xdbba0;if(sticky[_0xe252('0x7')](server,config[_0xe252('0x8')])){var socketio=require('socket.io')(server,{'transports':[_0xe252('0x9'),_0xe252('0xa')]});config[_0xe252('0xb')]=_[_0xe252('0xc')](config[_0xe252('0xb')],{'host':_0xe252('0xd'),'port':0x18eb});socketio[_0xe252('0xe')](require('socket.io-redis')({'pubClient':new Redis(config[_0xe252('0xb')]),'subClient':new Redis(config[_0xe252('0xb')])}));require(_0xe252('0xf'))['default']();require(_0xe252('0x10'))[_0xe252('0x11')](socketio);require(_0xe252('0x12'))[_0xe252('0x11')](app);require(_0xe252('0x13'))[_0xe252('0x11')](app);}else{server[_0xe252('0x14')](_0xe252('0x15'),function(){console[_0xe252('0x16')](_0xe252('0x17'),config['port']);});}exports=module[_0xe252('0x18')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index f483a5e..a35d60b 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 _0x0cb7=['bluebird','../../config/logger','routing','client','Request','then','debug','error','rpc','message','result','catch','exports'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x0cb7,0x1c7));var _0x70cb=function(_0x47d6b2,_0x374239){_0x47d6b2=_0x47d6b2-0x0;var _0x3367af=_0x0cb7[_0x47d6b2];return _0x3367af;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x70cb('0x0'));var logger=require(_0x70cb('0x1'))(_0x70cb('0x2'));var client=jayson[_0x70cb('0x3')]['http']({'port':0x2329});client[_0x70cb('0x4')]=function(_0x2d18be,_0x8b04d4){return new BPromise(function(_0x29450f,_0x3f0a50){return client['request'](_0x2d18be,_0x8b04d4)[_0x70cb('0x5')](function(_0x52b3b5){logger[_0x70cb('0x6')]('rpc',_0x70cb('0x2'),_0x2d18be,_0x8b04d4,_0x52b3b5);if(_0x52b3b5[_0x70cb('0x7')]){logger['error'](_0x70cb('0x8'),'routing',_0x2d18be,_0x52b3b5['error'][_0x70cb('0x9')],_0x8b04d4);return _0x3f0a50(_0x52b3b5[_0x70cb('0x7')][_0x70cb('0x9')]);}else{return _0x29450f(_0x52b3b5[_0x70cb('0xa')]);}})[_0x70cb('0xb')](function(_0x3f9312){logger['error'](_0x70cb('0x8'),'routing',_0x2d18be,_0x3f9312,_0x8b04d4);return _0x3f0a50(_0x3f9312);});});};module[_0x70cb('0xc')]=client; \ No newline at end of file +var _0x49af=['jayson/promise','bluebird','client','http','Request','request','then','debug','rpc','error','message','result','catch','routing','exports'];(function(_0x41e588,_0x1af274){var _0x269ca5=function(_0x10c381){while(--_0x10c381){_0x41e588['push'](_0x41e588['shift']());}};_0x269ca5(++_0x1af274);}(_0x49af,0x14a));var _0xf49a=function(_0x429ab6,_0x55eaf1){_0x429ab6=_0x429ab6-0x0;var _0x56a2a3=_0x49af[_0x429ab6];return _0x56a2a3;};'use strict';var jayson=require(_0xf49a('0x0'));var BPromise=require(_0xf49a('0x1'));var logger=require('../../config/logger')('routing');var client=jayson[_0xf49a('0x2')][_0xf49a('0x3')]({'port':0x2329});client[_0xf49a('0x4')]=function(_0x3fe339,_0x13c085){return new BPromise(function(_0x3f9cd7,_0xc18291){return client[_0xf49a('0x5')](_0x3fe339,_0x13c085)[_0xf49a('0x6')](function(_0x990985){logger[_0xf49a('0x7')](_0xf49a('0x8'),'routing',_0x3fe339,_0x13c085,_0x990985);if(_0x990985[_0xf49a('0x9')]){logger[_0xf49a('0x9')](_0xf49a('0x8'),'routing',_0x3fe339,_0x990985['error'][_0xf49a('0xa')],_0x13c085);return _0xc18291(_0x990985[_0xf49a('0x9')]['message']);}else{return _0x3f9cd7(_0x990985[_0xf49a('0xb')]);}})[_0xf49a('0xc')](function(_0x5cf9e2){logger[_0xf49a('0x9')](_0xf49a('0x8'),_0xf49a('0xd'),_0x3fe339,_0x5cf9e2,_0x13c085);return _0xc18291(_0x5cf9e2);});});};module[_0xf49a('0xe')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 1dc0d40..ddba0a8 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 _0x09bf=['./server','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','initIntervals','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','bluebird'];(function(_0x199269,_0xc012fb){var _0xb06637=function(_0x4d6be2){while(--_0x4d6be2){_0x199269['push'](_0x199269['shift']());}};_0xb06637(++_0xc012fb);}(_0x09bf,0x15f));var _0xf09b=function(_0x3cbb56,_0xdab55b){_0x3cbb56=_0x3cbb56-0x0;var _0x3ca3cc=_0x09bf[_0x3cbb56];return _0x3ca3cc;};'use strict';var BPromise=require(_0xf09b('0x0'));var server=require(_0xf09b('0x1'));var Realtime=require(_0xf09b('0x2'));var user=require('./rpc/user');var interval=require(_0xf09b('0x3'));var openchannelQueue=require(_0xf09b('0x4'));var chatQueue=require(_0xf09b('0x5'));var smsQueue=require(_0xf09b('0x6'));var mailQueue=require(_0xf09b('0x7'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0xf09b('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xf09b('0x9')]()[_0xf09b('0xa')](user[_0xf09b('0xb')]())[_0xf09b('0xa')](realtime[_0xf09b('0xc')]())['then'](interval['getIntervals']())[_0xf09b('0xa')](realtime[_0xf09b('0xd')]())[_0xf09b('0xa')](openchannelQueue['getOpenchannelQueues']())['then'](realtime['initOpenchannelQueues']())[_0xf09b('0xa')](chatQueue['getChatQueues']())[_0xf09b('0xa')](realtime['initChatQueues']())[_0xf09b('0xa')](smsQueue[_0xf09b('0xe')]())[_0xf09b('0xa')](realtime[_0xf09b('0xf')]())[_0xf09b('0xa')](mailQueue[_0xf09b('0x10')]())['then'](realtime[_0xf09b('0x11')]())['then'](faxQueue[_0xf09b('0x12')]())[_0xf09b('0xa')](realtime['initFaxQueues']())[_0xf09b('0xa')](whatsappQueue[_0xf09b('0x13')]())[_0xf09b('0xa')](realtime[_0xf09b('0x14')]())[_0xf09b('0xa')](function(){return realtime;});}function main(){return server[_0xf09b('0x15')](realtime)[_0xf09b('0xa')](function(_0x54d3ff){return initRealtime();})['then'](function(_0x11e8d9){return setInterval(initRealtime,0x1388);})['catch'](function(_0x322a55){console['log'](_0x322a55);});}main(); \ No newline at end of file +var _0x0e89=['initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','getAgents','initAgents','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues'];(function(_0x3c2166,_0x41fc16){var _0x30ccc3=function(_0x689bc3){while(--_0x689bc3){_0x3c2166['push'](_0x3c2166['shift']());}};_0x30ccc3(++_0x41fc16);}(_0x0e89,0x100));var _0x90e8=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0e89[_0xa464c9];return _0x3d73c4;};'use strict';var BPromise=require(_0x90e8('0x0'));var server=require(_0x90e8('0x1'));var Realtime=require(_0x90e8('0x2'));var user=require(_0x90e8('0x3'));var interval=require(_0x90e8('0x4'));var openchannelQueue=require(_0x90e8('0x5'));var chatQueue=require(_0x90e8('0x6'));var smsQueue=require(_0x90e8('0x7'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x90e8('0x8'));var whatsappQueue=require(_0x90e8('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x90e8('0xa')](user[_0x90e8('0xb')]())[_0x90e8('0xa')](realtime[_0x90e8('0xc')]())[_0x90e8('0xa')](interval['getIntervals']())[_0x90e8('0xa')](realtime[_0x90e8('0xd')]())[_0x90e8('0xa')](openchannelQueue[_0x90e8('0xe')]())['then'](realtime['initOpenchannelQueues']())['then'](chatQueue[_0x90e8('0xf')]())[_0x90e8('0xa')](realtime[_0x90e8('0x10')]())['then'](smsQueue[_0x90e8('0x11')]())[_0x90e8('0xa')](realtime[_0x90e8('0x12')]())['then'](mailQueue['getMailQueues']())[_0x90e8('0xa')](realtime[_0x90e8('0x13')]())['then'](faxQueue[_0x90e8('0x14')]())[_0x90e8('0xa')](realtime[_0x90e8('0x15')]())[_0x90e8('0xa')](whatsappQueue[_0x90e8('0x16')]())[_0x90e8('0xa')](realtime[_0x90e8('0x17')]())[_0x90e8('0xa')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x90e8('0xa')](function(_0x479af9){return initRealtime();})[_0x90e8('0xa')](function(_0x214ee8){return setInterval(initRealtime,0x1388);})['catch'](function(_0x5aa135){console[_0x90e8('0x18')](_0x5aa135);});}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 bc2a237..86f06bc 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(_0xff47bd,_0x2e4ccf){var _0x4ff7ed=function(_0x282a10){while(--_0x282a10){_0xff47bd['push'](_0xff47bd['shift']());}};_0x4ff7ed(++_0x2e4ccf);}(_0x7a54,0x106));var _0x47a5=function(_0x1f6160,_0x8dfe69){_0x1f6160=_0x1f6160-0x0;var _0xaeaf9=_0x7a54[_0x1f6160];return _0xaeaf9;};'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 _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x275f4a,_0x2077d4){var _0x4b4a21=function(_0x391bab){while(--_0x391bab){_0x275f4a['push'](_0x275f4a['shift']());}};_0x4b4a21(++_0x2077d4);}(_0x326f,0xd1));var _0xf326=function(_0x16859e,_0x4c61d0){_0x16859e=_0x16859e-0x0;var _0x49021f=_0x326f[_0x16859e];return _0x49021f;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index d12207e..0bd9925 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 _0x37b3=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','request','then','error','message','result'];(function(_0x4d33f7,_0x1bb0da){var _0x361fb6=function(_0x5cc2b4){while(--_0x5cc2b4){_0x4d33f7['push'](_0x4d33f7['shift']());}};_0x361fb6(++_0x1bb0da);}(_0x37b3,0x14d));var _0x337b=function(_0x44d9ab,_0x76bc69){_0x44d9ab=_0x44d9ab-0x0;var _0x31485e=_0x37b3[_0x44d9ab];return _0x31485e;};'use strict';var BPromise=require(_0x337b('0x0'));var jayson=require(_0x337b('0x1'));var client=jayson[_0x337b('0x2')]['http']({'port':0x232b});function request(_0x2e7a95,_0xdc8e74){return new BPromise(function(_0x2caba1,_0x4c9322){return client[_0x337b('0x3')](_0x2e7a95,_0xdc8e74)[_0x337b('0x4')](function(_0x1769bd){if(_0x1769bd[_0x337b('0x5')]){return _0x4c9322(_0x1769bd[_0x337b('0x5')][_0x337b('0x6')]);}else{return _0x2caba1(_0x1769bd[_0x337b('0x7')]);}})[_0x337b('0x8')](function(_0x47206f){return _0x4c9322(_0x47206f);});});}exports[_0x337b('0x9')]=function(_0x123c70,_0x3f0317){return request(_0x337b('0xa'),{'account':_0x123c70,'message':_0x3f0317});}; \ No newline at end of file +var _0x3b21=['jayson/promise','then','error','catch','SendMail'];(function(_0x2984d0,_0x1a7211){var _0x2885f2=function(_0x42f3da){while(--_0x42f3da){_0x2984d0['push'](_0x2984d0['shift']());}};_0x2885f2(++_0x1a7211);}(_0x3b21,0x73));var _0x13b2=function(_0x2e578e,_0x2f7d47){_0x2e578e=_0x2e578e-0x0;var _0x351206=_0x3b21[_0x2e578e];return _0x351206;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x13b2('0x0'));var client=jayson['client']['http']({'port':0x232b});function request(_0x10b6a5,_0x5ec4c5){return new BPromise(function(_0x31e6ed,_0x770ae0){return client['request'](_0x10b6a5,_0x5ec4c5)[_0x13b2('0x1')](function(_0x27a6dd){if(_0x27a6dd[_0x13b2('0x2')]){return _0x770ae0(_0x27a6dd[_0x13b2('0x2')]['message']);}else{return _0x31e6ed(_0x27a6dd['result']);}})[_0x13b2('0x3')](function(_0x23e190){return _0x770ae0(_0x23e190);});});}exports['sendMailMessage']=function(_0x33071e,_0x3d0c00){return request(_0x13b2('0x4'),{'account':_0x33071e,'message':_0x3d0c00});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 4747bef..3fb88bf 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 _0x1ef7=['chatCapacity','chatCurrentCapacity','mailStatus','mailCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','md5','updateRealtime','getChannelStatus','Capacity','CurrentCapacity','mail','chat','openchannel','fax','whatsapp','length','StatusTime','toNumber','format','Status','chatStatusTime','mailCurrentCapacity','faxStatusTime','smsCurrentCapacity','whatsappCurrentCapacity','busy','stringify','emit','user:save','exports','moment','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown'];(function(_0x706861,_0x1d6a77){var _0x42c0c2=function(_0x122834){while(--_0x122834){_0x706861['push'](_0x706861['shift']());}};_0x42c0c2(++_0x1d6a77);}(_0x1ef7,0x173));var _0x71ef=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x1ef7[_0x32d457];return _0x338386;};'use strict';var _=require('lodash');var moment=require(_0x71ef('0x0'));var md5=require('md5');var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0x71ef('0x1')],{'host':_0x71ef('0x2'),'port':0x18eb});var io=require(_0x71ef('0x3'))(new Redis(config['redis']));function Agent(_0x3ad150){this['id']=_0x3ad150['id']||0x0;this['name']=_0x3ad150[_0x71ef('0x4')]||'';this[_0x71ef('0x5')]=_0x3ad150['online']||!![];this['voicePause']=_0x3ad150[_0x71ef('0x6')]||![];this[_0x71ef('0x7')]=_0x3ad150[_0x71ef('0x7')]||![];this[_0x71ef('0x8')]=_0x3ad150['mailPause']||![];this['faxPause']=_0x3ad150[_0x71ef('0x9')]||![];this[_0x71ef('0xa')]=_0x3ad150[_0x71ef('0xa')]||![];this[_0x71ef('0xb')]=_0x3ad150[_0x71ef('0xb')]||![];this[_0x71ef('0xc')]=_0x71ef('0xd');this['chatStatusTime']=0x0;this[_0x71ef('0xe')]=_0x3ad150[_0x71ef('0xe')]||0x0;this[_0x71ef('0xf')]=0x0;this[_0x71ef('0x10')]=_0x71ef('0xd');this['mailStatusTime']=0x0;this[_0x71ef('0x11')]=_0x3ad150[_0x71ef('0x11')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x71ef('0x12')]=_0x71ef('0xd');this['faxStatusTime']=0x0;this[_0x71ef('0x13')]=_0x3ad150[_0x71ef('0x13')]||0x0;this[_0x71ef('0x14')]=0x0;this[_0x71ef('0x15')]=_0x71ef('0xd');this[_0x71ef('0x16')]=0x0;this['smsCapacity']=_0x3ad150[_0x71ef('0x17')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x71ef('0x18')]=_0x71ef('0xd');this[_0x71ef('0x19')]=0x0;this['whatsappCapacity']=_0x3ad150[_0x71ef('0x1a')]||0x0;this['whatsappCurrentCapacity']=0x0;this['openchannelStatus']=_0x71ef('0xd');this[_0x71ef('0x1b')]=0x0;this['openchannelCapacity']=_0x3ad150[_0x71ef('0x1c')]||0x0;this[_0x71ef('0x1d')]=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0x71ef('0x1e')]='';this[_0x71ef('0x1f')]();}Agent['prototype'][_0x71ef('0x20')]=function(_0x2bcd3a){if(this[_0x2bcd3a+'CurrentCapacity']>0x0){if(this[_0x2bcd3a+_0x71ef('0x21')]>0x0&&this[_0x2bcd3a+_0x71ef('0x22')]>=this[_0x2bcd3a+'Capacity']){return'maxcapacity';}else{return'working';}}else{return'idle';}};Agent['prototype'][_0x71ef('0x1f')]=function(){var _0x452ebe=[_0x71ef('0x23'),_0x71ef('0x24'),_0x71ef('0x25'),_0x71ef('0x26'),'sms',_0x71ef('0x27')];for(var _0x5ce7c3=0x0;_0x5ce7c3<_0x452ebe[_0x71ef('0x28')];_0x5ce7c3+=0x1){var _0x1c81c8=this[_0x71ef('0x20')](_0x452ebe[_0x5ce7c3]);if(this[_0x452ebe[_0x5ce7c3]+'Status']!==_0x1c81c8){this[_0x452ebe[_0x5ce7c3]+_0x71ef('0x29')]=_[_0x71ef('0x2a')](moment()[_0x71ef('0x2b')]('x'));}this[_0x452ebe[_0x5ce7c3]+_0x71ef('0x2c')]=_0x1c81c8;}var _0x48d826={'id':this['id'],'name':this[_0x71ef('0x4')],'online':this[_0x71ef('0x5')],'voicePause':this[_0x71ef('0x6')],'chatPause':this[_0x71ef('0x7')],'mailPause':this['mailPause'],'smsPause':this[_0x71ef('0xa')],'faxPause':this['faxPause'],'openchannelPause':this[_0x71ef('0xb')],'chatStatus':this[_0x71ef('0xc')],'chatStatusTime':this[_0x71ef('0x2d')],'chatCapacity':this[_0x71ef('0xe')],'chatCurrentCapacity':this[_0x71ef('0xf')],'mailStatus':this['mailStatus'],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x71ef('0x11')],'mailCurrentCapacity':this[_0x71ef('0x2e')],'faxStatus':this[_0x71ef('0x12')],'faxStatusTime':this[_0x71ef('0x2f')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x71ef('0x14')],'smsStatus':this[_0x71ef('0x15')],'smsStatusTime':this[_0x71ef('0x16')],'smsCapacity':this[_0x71ef('0x17')],'smsCurrentCapacity':this[_0x71ef('0x30')],'whatsappStatus':this[_0x71ef('0x18')],'whatsappStatusTime':this[_0x71ef('0x19')],'whatsappCapacity':this[_0x71ef('0x1a')],'whatsappCurrentCapacity':this[_0x71ef('0x31')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x71ef('0x1b')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x71ef('0x1d')],'busy':this[_0x71ef('0x32')],'busyQueue':this['busyQueue']};var _0x9923db=md5(JSON[_0x71ef('0x33')](_0x48d826));if(this[_0x71ef('0x1e')]!==_0x9923db){this[_0x71ef('0x1e')]=_0x9923db;io[_0x71ef('0x34')](_0x71ef('0x35'),_0x48d826);}};module[_0x71ef('0x36')]=Agent; \ No newline at end of file +var _0x8d33=['idle','updateRealtime','mail','chat','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','chatStatusTime','mailStatus','faxCurrentCapacity','smsStatus','emit','user:save','lodash','moment','ioredis','../../../config/environment','redis','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','prototype','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','working'];(function(_0x23f58d,_0x22b11c){var _0x515d10=function(_0x18fe4a){while(--_0x18fe4a){_0x23f58d['push'](_0x23f58d['shift']());}};_0x515d10(++_0x22b11c);}(_0x8d33,0x144));var _0x38d3=function(_0x1b37ce,_0x5c38fe){_0x1b37ce=_0x1b37ce-0x0;var _0x2b2123=_0x8d33[_0x1b37ce];return _0x2b2123;};'use strict';var _=require(_0x38d3('0x0'));var moment=require(_0x38d3('0x1'));var md5=require('md5');var Redis=require(_0x38d3('0x2'));var config=require(_0x38d3('0x3'));config[_0x38d3('0x4')]=_['defaults'](config[_0x38d3('0x4')],{'host':_0x38d3('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x38d3('0x4')]));function Agent(_0x2c4538){this['id']=_0x2c4538['id']||0x0;this[_0x38d3('0x6')]=_0x2c4538[_0x38d3('0x6')]||'';this[_0x38d3('0x7')]=_0x2c4538[_0x38d3('0x7')]||!![];this[_0x38d3('0x8')]=_0x2c4538[_0x38d3('0x8')]||![];this['chatPause']=_0x2c4538[_0x38d3('0x9')]||![];this[_0x38d3('0xa')]=_0x2c4538[_0x38d3('0xa')]||![];this['faxPause']=_0x2c4538[_0x38d3('0xb')]||![];this[_0x38d3('0xc')]=_0x2c4538['smsPause']||![];this[_0x38d3('0xd')]=_0x2c4538[_0x38d3('0xd')]||![];this['chatStatus']=_0x38d3('0xe');this['chatStatusTime']=0x0;this['chatCapacity']=_0x2c4538[_0x38d3('0xf')]||0x0;this[_0x38d3('0x10')]=0x0;this['mailStatus']=_0x38d3('0xe');this[_0x38d3('0x11')]=0x0;this['mailCapacity']=_0x2c4538['mailCapacity']||0x0;this[_0x38d3('0x12')]=0x0;this[_0x38d3('0x13')]=_0x38d3('0xe');this[_0x38d3('0x14')]=0x0;this[_0x38d3('0x15')]=_0x2c4538['faxCapacity']||0x0;this['faxCurrentCapacity']=0x0;this['smsStatus']=_0x38d3('0xe');this[_0x38d3('0x16')]=0x0;this[_0x38d3('0x17')]=_0x2c4538[_0x38d3('0x17')]||0x0;this[_0x38d3('0x18')]=0x0;this[_0x38d3('0x19')]='unknown';this[_0x38d3('0x1a')]=0x0;this[_0x38d3('0x1b')]=_0x2c4538['whatsappCapacity']||0x0;this[_0x38d3('0x1c')]=0x0;this[_0x38d3('0x1d')]='unknown';this[_0x38d3('0x1e')]=0x0;this[_0x38d3('0x1f')]=_0x2c4538[_0x38d3('0x1f')]||0x0;this[_0x38d3('0x20')]=0x0;this[_0x38d3('0x21')]=![];this[_0x38d3('0x22')]=undefined;this[_0x38d3('0x23')]='';this['updateRealtime']();}Agent[_0x38d3('0x24')][_0x38d3('0x25')]=function(_0x1cab3c){if(this[_0x1cab3c+'CurrentCapacity']>0x0){if(this[_0x1cab3c+_0x38d3('0x26')]>0x0&&this[_0x1cab3c+_0x38d3('0x27')]>=this[_0x1cab3c+_0x38d3('0x26')]){return _0x38d3('0x28');}else{return _0x38d3('0x29');}}else{return _0x38d3('0x2a');}};Agent[_0x38d3('0x24')][_0x38d3('0x2b')]=function(){var _0x2709e5=[_0x38d3('0x2c'),_0x38d3('0x2d'),_0x38d3('0x2e'),_0x38d3('0x2f'),_0x38d3('0x30'),_0x38d3('0x31')];for(var _0x3d756f=0x0;_0x3d756f<_0x2709e5[_0x38d3('0x32')];_0x3d756f+=0x1){var _0x2b06cd=this[_0x38d3('0x25')](_0x2709e5[_0x3d756f]);if(this[_0x2709e5[_0x3d756f]+_0x38d3('0x33')]!==_0x2b06cd){this[_0x2709e5[_0x3d756f]+_0x38d3('0x34')]=_[_0x38d3('0x35')](moment()[_0x38d3('0x36')]('x'));}this[_0x2709e5[_0x3d756f]+'Status']=_0x2b06cd;}var _0x5cfe5f={'id':this['id'],'name':this[_0x38d3('0x6')],'online':this[_0x38d3('0x7')],'voicePause':this[_0x38d3('0x8')],'chatPause':this[_0x38d3('0x9')],'mailPause':this[_0x38d3('0xa')],'smsPause':this[_0x38d3('0xc')],'faxPause':this[_0x38d3('0xb')],'openchannelPause':this[_0x38d3('0xd')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x38d3('0x37')],'chatCapacity':this[_0x38d3('0xf')],'chatCurrentCapacity':this[_0x38d3('0x10')],'mailStatus':this[_0x38d3('0x38')],'mailStatusTime':this[_0x38d3('0x11')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x38d3('0x15')],'faxCurrentCapacity':this[_0x38d3('0x39')],'smsStatus':this[_0x38d3('0x3a')],'smsStatusTime':this[_0x38d3('0x16')],'smsCapacity':this[_0x38d3('0x17')],'smsCurrentCapacity':this[_0x38d3('0x18')],'whatsappStatus':this[_0x38d3('0x19')],'whatsappStatusTime':this[_0x38d3('0x1a')],'whatsappCapacity':this[_0x38d3('0x1b')],'whatsappCurrentCapacity':this[_0x38d3('0x1c')],'openchannelStatus':this[_0x38d3('0x1d')],'openchannelStatusTime':this[_0x38d3('0x1e')],'openchannelCapacity':this[_0x38d3('0x1f')],'openchannelCurrentCapacity':this[_0x38d3('0x20')],'busy':this[_0x38d3('0x21')],'busyQueue':this[_0x38d3('0x22')]};var _0x693061=md5(JSON['stringify'](_0x5cfe5f));if(this[_0x38d3('0x23')]!==_0x693061){this['md5']=_0x693061;io[_0x38d3('0x3b')](_0x38d3('0x3c'),_0x5cfe5f);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 4fe6200..dc124ff 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 _0xe892=['mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online','paused','available','waiting','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe892,0xa1));var _0x2e89=function(_0x1a5c00,_0x2bb9bd){_0x1a5c00=_0x1a5c00-0x0;var _0x131497=_0xe892[_0x1a5c00];return _0x131497;};'use strict';var _=require(_0x2e89('0x0'));var md5=require(_0x2e89('0x1'));var util=require(_0x2e89('0x2'));var Redis=require(_0x2e89('0x3'));var config=require(_0x2e89('0x4'));config[_0x2e89('0x5')]=_[_0x2e89('0x6')](config[_0x2e89('0x5')],{'host':_0x2e89('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2e89('0x5')]));function ChatQueue(_0x2760a9){this['id']=_0x2760a9['id']||0x0;this[_0x2e89('0x8')]=_0x2760a9[_0x2e89('0x8')]||'';this[_0x2e89('0x9')]=_0x2760a9['timeout']||0xa;this[_0x2e89('0xa')]=_0x2760a9[_0x2e89('0xa')]||_0x2e89('0xb');this[_0x2e89('0xc')]=_0x2760a9[_0x2e89('0xc')];this[_0x2e89('0xd')]={};this['waiting']=0x0;this[_0x2e89('0x1')]='';this[_0x2e89('0xe')]();this[_0x2e89('0xf')]();}ChatQueue[_0x2e89('0x10')][_0x2e89('0xe')]=function(){var _0x4a2553=this[_0x2e89('0xd')][_0x2e89('0x11')];this[_0x2e89('0xd')]=_[_0x2e89('0x12')](this[_0x2e89('0xc')],'id');this[_0x2e89('0xd')][_0x2e89('0x11')]=_0x4a2553;};ChatQueue[_0x2e89('0x10')]['updateRealtime']=function(){this[_0x2e89('0x13')]=0x0;this['paused']=0x0;for(var _0x18dec2=0x0;_0x18dec2=0x0?this[_0x2e89('0x17')]:0x0;var _0x4935aa={'id':this['id'],'available':this[_0x2e89('0x17')],'loggedIn':this[_0x2e89('0x13')],'name':this[_0x2e89('0x8')],'paused':this[_0x2e89('0x16')],'waiting':this[_0x2e89('0x18')]};var _0x18aa38=md5(JSON['stringify'](_0x4935aa));if(this[_0x2e89('0x1')]!==_0x18aa38){this[_0x2e89('0x1')]=_0x18aa38;io['to'](util['format'](_0x2e89('0x19'),_0x4935aa[_0x2e89('0x8')]))[_0x2e89('0x1a')](_0x2e89('0x1b'),_0x4935aa);}};module[_0x2e89('0x1c')]=ChatQueue; \ No newline at end of file +var _0xf177=['format','chat:queue:%s','emit','chat_queue:save','exports','lodash','util','redis','defaults','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','paused','length','online','chatPause','available','loggedIn','stringify'];(function(_0x30ef67,_0xae5198){var _0x499344=function(_0x2e30e3){while(--_0x2e30e3){_0x30ef67['push'](_0x30ef67['shift']());}};_0x499344(++_0xae5198);}(_0xf177,0x19b));var _0x7f17=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf177[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x7f17('0x0'));var md5=require('md5');var util=require(_0x7f17('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x7f17('0x2')]=_[_0x7f17('0x3')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x7f17('0x4'))(new Redis(config['redis']));function ChatQueue(_0x492eaf){this['id']=_0x492eaf['id']||0x0;this[_0x7f17('0x5')]=_0x492eaf[_0x7f17('0x5')]||'';this['timeout']=_0x492eaf['timeout']||0xa;this[_0x7f17('0x6')]=_0x492eaf[_0x7f17('0x6')]||_0x7f17('0x7');this[_0x7f17('0x8')]=_0x492eaf[_0x7f17('0x8')];this[_0x7f17('0x9')]={};this[_0x7f17('0xa')]=0x0;this[_0x7f17('0xb')]='';this[_0x7f17('0xc')]();this[_0x7f17('0xd')]();}ChatQueue[_0x7f17('0xe')]['updateRouting']=function(){var _0x176734=this[_0x7f17('0x9')][_0x7f17('0xf')];this['mapAgentsId']=_[_0x7f17('0x10')](this['Agents'],'id');this[_0x7f17('0x9')][_0x7f17('0xf')]=_0x176734;};ChatQueue['prototype'][_0x7f17('0xd')]=function(){this['loggedIn']=0x0;this[_0x7f17('0x11')]=0x0;for(var _0x172005=0x0;_0x172005=0x0?this[_0x7f17('0x15')]:0x0;var _0x4db6bc={'id':this['id'],'available':this['available'],'loggedIn':this[_0x7f17('0x16')],'name':this[_0x7f17('0x5')],'paused':this[_0x7f17('0x11')],'waiting':this['waiting']};var _0x3ce14d=md5(JSON[_0x7f17('0x17')](_0x4db6bc));if(this[_0x7f17('0xb')]!==_0x3ce14d){this[_0x7f17('0xb')]=_0x3ce14d;io['to'](util[_0x7f17('0x18')](_0x7f17('0x19'),_0x4db6bc[_0x7f17('0x5')]))[_0x7f17('0x1a')](_0x7f17('0x1b'),_0x4db6bc);}};module[_0x7f17('0x1c')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 317e2d0..26d0c69 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 _0x7b65=['loggedIn','paused','length','online','faxPause','available','stringify','fax:queue:%s','emit','fax_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7b65,0xc7));var _0x57b6=function(_0x20dfdf,_0x59c448){_0x20dfdf=_0x20dfdf-0x0;var _0x29a3b5=_0x7b65[_0x20dfdf];return _0x29a3b5;};'use strict';var _=require(_0x57b6('0x0'));var md5=require(_0x57b6('0x1'));var util=require(_0x57b6('0x2'));var Redis=require(_0x57b6('0x3'));var config=require(_0x57b6('0x4'));config[_0x57b6('0x5')]=_['defaults'](config[_0x57b6('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x57b6('0x6'))(new Redis(config['redis']));function FaxQueue(_0x57d449){this['id']=_0x57d449['id']||0x0;this[_0x57b6('0x7')]=_0x57d449[_0x57b6('0x7')]||'';this[_0x57b6('0x8')]=_0x57d449['timeout']||0xa;this[_0x57b6('0x9')]=_0x57d449[_0x57b6('0x9')]||_0x57b6('0xa');this[_0x57b6('0xb')]=_0x57d449[_0x57b6('0xb')];this[_0x57b6('0xc')]={};this[_0x57b6('0xd')]=0x0;this[_0x57b6('0x1')]='';this[_0x57b6('0xe')]();this[_0x57b6('0xf')]();}FaxQueue[_0x57b6('0x10')][_0x57b6('0xe')]=function(){var _0x490555=this[_0x57b6('0xc')]['_rr'];this[_0x57b6('0xc')]=_['map'](this[_0x57b6('0xb')],'id');this[_0x57b6('0xc')]['_rr']=_0x490555;};FaxQueue['prototype'][_0x57b6('0xf')]=function(){this[_0x57b6('0x11')]=0x0;this[_0x57b6('0x12')]=0x0;for(var _0x2cc97f=0x0;_0x2cc97f=0x0?this[_0x57b6('0x16')]:0x0;var _0x2ca3e5={'id':this['id'],'available':this[_0x57b6('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x57b6('0x7')],'paused':this[_0x57b6('0x12')],'waiting':this['waiting']};var _0x207c97=md5(JSON[_0x57b6('0x17')](_0x2ca3e5));if(this['md5']!==_0x207c97){this[_0x57b6('0x1')]=_0x207c97;io['to'](util['format'](_0x57b6('0x18'),_0x2ca3e5[_0x57b6('0x7')]))[_0x57b6('0x19')](_0x57b6('0x1a'),_0x2ca3e5);}};module['exports']=FaxQueue; \ No newline at end of file +var _0xeef3=['length','faxPause','paused','available','stringify','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn'];(function(_0xa9235d,_0x13a12d){var _0x141e89=function(_0x336ecd){while(--_0x336ecd){_0xa9235d['push'](_0xa9235d['shift']());}};_0x141e89(++_0x13a12d);}(_0xeef3,0x175));var _0x3eef=function(_0x18abd2,_0x22d4b3){_0x18abd2=_0x18abd2-0x0;var _0x1dcad6=_0xeef3[_0x18abd2];return _0x1dcad6;};'use strict';var _=require(_0x3eef('0x0'));var md5=require(_0x3eef('0x1'));var util=require(_0x3eef('0x2'));var Redis=require(_0x3eef('0x3'));var config=require(_0x3eef('0x4'));config[_0x3eef('0x5')]=_['defaults'](config['redis'],{'host':_0x3eef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3eef('0x5')]));function FaxQueue(_0x14bdaf){this['id']=_0x14bdaf['id']||0x0;this[_0x3eef('0x7')]=_0x14bdaf['name']||'';this['timeout']=_0x14bdaf[_0x3eef('0x8')]||0xa;this['strategy']=_0x14bdaf[_0x3eef('0x9')]||_0x3eef('0xa');this['Agents']=_0x14bdaf[_0x3eef('0xb')];this[_0x3eef('0xc')]={};this[_0x3eef('0xd')]=0x0;this[_0x3eef('0x1')]='';this[_0x3eef('0xe')]();this[_0x3eef('0xf')]();}FaxQueue['prototype'][_0x3eef('0xe')]=function(){var _0xf0972e=this[_0x3eef('0xc')]['_rr'];this[_0x3eef('0xc')]=_['map'](this[_0x3eef('0xb')],'id');this[_0x3eef('0xc')][_0x3eef('0x10')]=_0xf0972e;};FaxQueue[_0x3eef('0x11')][_0x3eef('0xf')]=function(){this[_0x3eef('0x12')]=0x0;this['paused']=0x0;for(var _0x40c938=0x0;_0x40c938=0x0?this[_0x3eef('0x16')]:0x0;var _0x564ab3={'id':this['id'],'available':this[_0x3eef('0x16')],'loggedIn':this[_0x3eef('0x12')],'name':this['name'],'paused':this[_0x3eef('0x15')],'waiting':this[_0x3eef('0xd')]};var _0x9f4a9=md5(JSON[_0x3eef('0x17')](_0x564ab3));if(this[_0x3eef('0x1')]!==_0x9f4a9){this[_0x3eef('0x1')]=_0x9f4a9;io['to'](util['format'](_0x3eef('0x18'),_0x564ab3[_0x3eef('0x7')]))[_0x3eef('0x19')](_0x3eef('0x1a'),_0x564ab3);}};module[_0x3eef('0x1b')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 85f08fe..b9d6037 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 _0x6d83=['Intervals','exports','name'];(function(_0x43d19e,_0x1ce5c8){var _0xb262fe=function(_0x37b910){while(--_0x37b910){_0x43d19e['push'](_0x43d19e['shift']());}};_0xb262fe(++_0x1ce5c8);}(_0x6d83,0xc8));var _0x36d8=function(_0x58de43,_0xcb8233){_0x58de43=_0x58de43-0x0;var _0x2ec8e4=_0x6d83[_0x58de43];return _0x2ec8e4;};'use strict';function Interval(_0x44054d){this['id']=_0x44054d['id']||0x0;this[_0x36d8('0x0')]=_0x44054d['name']||'';this[_0x36d8('0x1')]=_0x44054d['Intervals']||{};}module[_0x36d8('0x2')]=Interval; \ No newline at end of file +var _0x7fac=['Intervals','exports','name'];(function(_0xb06307,_0x4fb583){var _0x524811=function(_0x308516){while(--_0x308516){_0xb06307['push'](_0xb06307['shift']());}};_0x524811(++_0x4fb583);}(_0x7fac,0x19a));var _0xc7fa=function(_0x16bb0e,_0x343132){_0x16bb0e=_0x16bb0e-0x0;var _0x102b8b=_0x7fac[_0x16bb0e];return _0x102b8b;};'use strict';function Interval(_0x5d36bc){this['id']=_0x5d36bc['id']||0x0;this[_0xc7fa('0x0')]=_0x5d36bc['name']||'';this[_0xc7fa('0x1')]=_0x5d36bc[_0xc7fa('0x1')]||{};}module[_0xc7fa('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 9145910..a98094e 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 _0xab6f=['Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','paused','length','loggedIn','mailPause','available','stringify','emit','mail_queue:save','lodash','md5','util','ioredis','redis','defaults','localhost','name','timeout','strategy','beepall'];(function(_0x13340b,_0x33c98a){var _0x75805=function(_0x463481){while(--_0x463481){_0x13340b['push'](_0x13340b['shift']());}};_0x75805(++_0x33c98a);}(_0xab6f,0x11e));var _0xfab6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab6f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfab6('0x0'));var md5=require(_0xfab6('0x1'));var util=require(_0xfab6('0x2'));var Redis=require(_0xfab6('0x3'));var config=require('../../../config/environment');config[_0xfab6('0x4')]=_[_0xfab6('0x5')](config['redis'],{'host':_0xfab6('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfab6('0x4')]));function MailQueue(_0x54b0c7){this['id']=_0x54b0c7['id']||0x0;this['name']=_0x54b0c7[_0xfab6('0x7')]||'';this[_0xfab6('0x8')]=_0x54b0c7[_0xfab6('0x8')]||0xa;this[_0xfab6('0x9')]=_0x54b0c7[_0xfab6('0x9')]||_0xfab6('0xa');this[_0xfab6('0xb')]=_0x54b0c7[_0xfab6('0xb')];this[_0xfab6('0xc')]={};this[_0xfab6('0xd')]=0x0;this['md5']='';this[_0xfab6('0xe')]();this[_0xfab6('0xf')]();}MailQueue[_0xfab6('0x10')]['updateRouting']=function(){var _0x2fa54d=this[_0xfab6('0xc')][_0xfab6('0x11')];this[_0xfab6('0xc')]=_[_0xfab6('0x12')](this[_0xfab6('0xb')],'id');this[_0xfab6('0xc')][_0xfab6('0x11')]=_0x2fa54d;};MailQueue[_0xfab6('0x10')][_0xfab6('0xf')]=function(){this['loggedIn']=0x0;this[_0xfab6('0x13')]=0x0;for(var _0x454dd1=0x0;_0x454dd1=0x0?this[_0xfab6('0x17')]:0x0;var _0x440046={'id':this['id'],'available':this[_0xfab6('0x17')],'loggedIn':this['loggedIn'],'name':this[_0xfab6('0x7')],'paused':this[_0xfab6('0x13')],'waiting':this[_0xfab6('0xd')]};var _0x1cec12=md5(JSON[_0xfab6('0x18')](_0x440046));if(this[_0xfab6('0x1')]!==_0x1cec12){this['md5']=_0x1cec12;io['to'](util['format']('mail:queue:%s',_0x440046[_0xfab6('0x7')]))[_0xfab6('0x19')](_0xfab6('0x1a'),_0x440046);}};module['exports']=MailQueue; \ No newline at end of file +var _0xa661=['defaults','localhost','socket.io-emitter','name','strategy','Agents','mapAgentsId','waiting','md5','prototype','updateRouting','map','_rr','loggedIn','paused','online','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','util','redis'];(function(_0x3a16d4,_0x23ecda){var _0x31ea9c=function(_0x35fea8){while(--_0x35fea8){_0x3a16d4['push'](_0x3a16d4['shift']());}};_0x31ea9c(++_0x23ecda);}(_0xa661,0xd5));var _0x1a66=function(_0x3973da,_0x3e8345){_0x3973da=_0x3973da-0x0;var _0x455279=_0xa661[_0x3973da];return _0x455279;};'use strict';var _=require(_0x1a66('0x0'));var md5=require('md5');var util=require(_0x1a66('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x1a66('0x2')]=_[_0x1a66('0x3')](config[_0x1a66('0x2')],{'host':_0x1a66('0x4'),'port':0x18eb});var io=require(_0x1a66('0x5'))(new Redis(config[_0x1a66('0x2')]));function MailQueue(_0x1f309c){this['id']=_0x1f309c['id']||0x0;this[_0x1a66('0x6')]=_0x1f309c[_0x1a66('0x6')]||'';this['timeout']=_0x1f309c['timeout']||0xa;this[_0x1a66('0x7')]=_0x1f309c[_0x1a66('0x7')]||'beepall';this[_0x1a66('0x8')]=_0x1f309c[_0x1a66('0x8')];this[_0x1a66('0x9')]={};this[_0x1a66('0xa')]=0x0;this[_0x1a66('0xb')]='';this['updateRouting']();this['updateRealtime']();}MailQueue[_0x1a66('0xc')][_0x1a66('0xd')]=function(){var _0x2221dd=this['mapAgentsId']['_rr'];this[_0x1a66('0x9')]=_[_0x1a66('0xe')](this[_0x1a66('0x8')],'id');this['mapAgentsId'][_0x1a66('0xf')]=_0x2221dd;};MailQueue[_0x1a66('0xc')]['updateRealtime']=function(){this[_0x1a66('0x10')]=0x0;this[_0x1a66('0x11')]=0x0;for(var _0x45e65f=0x0;_0x45e65f=0x0?this[_0x1a66('0x14')]:0x0;var _0x409e4d={'id':this['id'],'available':this['available'],'loggedIn':this[_0x1a66('0x10')],'name':this[_0x1a66('0x6')],'paused':this[_0x1a66('0x11')],'waiting':this[_0x1a66('0xa')]};var _0x18147d=md5(JSON[_0x1a66('0x15')](_0x409e4d));if(this[_0x1a66('0xb')]!==_0x18147d){this[_0x1a66('0xb')]=_0x18147d;io['to'](util[_0x1a66('0x16')](_0x1a66('0x17'),_0x409e4d[_0x1a66('0x6')]))[_0x1a66('0x18')](_0x1a66('0x19'),_0x409e4d);}};module[_0x1a66('0x1a')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index b65a043..22cfeef 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(_0x410f56,_0x515002){var _0x5bb39a=function(_0x22a5bd){while(--_0x22a5bd){_0x410f56['push'](_0x410f56['shift']());}};_0x5bb39a(++_0x515002);}(_0x814b,0x1a2));var _0xb814=function(_0x2ae22a,_0x4fe753){_0x2ae22a=_0x2ae22a-0x0;var _0x286a82=_0x814b[_0x2ae22a];return _0x286a82;};'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(_0x469f53,_0x246087){var _0x15784c=function(_0x4b842c){while(--_0x4b842c){_0x469f53['push'](_0x469f53['shift']());}};_0x15784c(++_0x246087);}(_0x814b,0x1a2));var _0xb814=function(_0x11ba46,_0x1d6752){_0x11ba46=_0x11ba46-0x0;var _0x1c8c6f=_0x814b[_0x11ba46];return _0x1c8c6f;};'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 33f9780..40ed55b 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 _0xbf6e=['loggedIn','paused','online','smsPause','available','stringify','format','emit','sms_queue:save','exports','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','waiting','md5','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','map'];(function(_0x214323,_0x54ede8){var _0x255ec3=function(_0x580abf){while(--_0x580abf){_0x214323['push'](_0x214323['shift']());}};_0x255ec3(++_0x54ede8);}(_0xbf6e,0x149));var _0xebf6=function(_0x152ec6,_0x3716ed){_0x152ec6=_0x152ec6-0x0;var _0x44465d=_0xbf6e[_0x152ec6];return _0x44465d;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xebf6('0x0'));var Redis=require(_0xebf6('0x1'));var config=require(_0xebf6('0x2'));config[_0xebf6('0x3')]=_[_0xebf6('0x4')](config[_0xebf6('0x3')],{'host':_0xebf6('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xebf6('0x3')]));function SmsQueue(_0x6ff2a3){this['id']=_0x6ff2a3['id']||0x0;this[_0xebf6('0x6')]=_0x6ff2a3[_0xebf6('0x6')]||'';this[_0xebf6('0x7')]=_0x6ff2a3[_0xebf6('0x7')]||0xa;this[_0xebf6('0x8')]=_0x6ff2a3['strategy']||_0xebf6('0x9');this[_0xebf6('0xa')]=_0x6ff2a3[_0xebf6('0xa')];this['mapAgentsId']={};this[_0xebf6('0xb')]=0x0;this[_0xebf6('0xc')]='';this['updateRouting']();this[_0xebf6('0xd')]();}SmsQueue[_0xebf6('0xe')][_0xebf6('0xf')]=function(){var _0x3954f4=this[_0xebf6('0x10')][_0xebf6('0x11')];this['mapAgentsId']=_[_0xebf6('0x12')](this[_0xebf6('0xa')],'id');this['mapAgentsId'][_0xebf6('0x11')]=_0x3954f4;};SmsQueue[_0xebf6('0xe')][_0xebf6('0xd')]=function(){this[_0xebf6('0x13')]=0x0;this[_0xebf6('0x14')]=0x0;for(var _0x4dbf51=0x0;_0x4dbf51=0x0?this[_0xebf6('0x17')]:0x0;var _0x308480={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xebf6('0x6')],'paused':this[_0xebf6('0x14')],'waiting':this[_0xebf6('0xb')]};var _0x410f06=md5(JSON[_0xebf6('0x18')](_0x308480));if(this[_0xebf6('0xc')]!==_0x410f06){this[_0xebf6('0xc')]=_0x410f06;io['to'](util[_0xebf6('0x19')]('sms:queue:%s',_0x308480[_0xebf6('0x6')]))[_0xebf6('0x1a')](_0xebf6('0x1b'),_0x308480);}};module[_0xebf6('0x1c')]=SmsQueue; \ No newline at end of file +var _0x6fad=['localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','updateRealtime','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','util','ioredis','redis'];(function(_0x4787a0,_0x53bfb0){var _0x117c9e=function(_0x48802c){while(--_0x48802c){_0x4787a0['push'](_0x4787a0['shift']());}};_0x117c9e(++_0x53bfb0);}(_0x6fad,0x174));var _0xd6fa=function(_0x182f71,_0x2a9c96){_0x182f71=_0x182f71-0x0;var _0x18b7e6=_0x6fad[_0x182f71];return _0x18b7e6;};'use strict';var _=require(_0xd6fa('0x0'));var md5=require(_0xd6fa('0x1'));var util=require(_0xd6fa('0x2'));var Redis=require(_0xd6fa('0x3'));var config=require('../../../config/environment');config[_0xd6fa('0x4')]=_['defaults'](config[_0xd6fa('0x4')],{'host':_0xd6fa('0x5'),'port':0x18eb});var io=require(_0xd6fa('0x6'))(new Redis(config[_0xd6fa('0x4')]));function SmsQueue(_0x58325c){this['id']=_0x58325c['id']||0x0;this[_0xd6fa('0x7')]=_0x58325c[_0xd6fa('0x7')]||'';this[_0xd6fa('0x8')]=_0x58325c[_0xd6fa('0x8')]||0xa;this['strategy']=_0x58325c[_0xd6fa('0x9')]||'beepall';this[_0xd6fa('0xa')]=_0x58325c[_0xd6fa('0xa')];this[_0xd6fa('0xb')]={};this[_0xd6fa('0xc')]=0x0;this[_0xd6fa('0x1')]='';this['updateRouting']();this['updateRealtime']();}SmsQueue[_0xd6fa('0xd')][_0xd6fa('0xe')]=function(){var _0x4e91f4=this[_0xd6fa('0xb')][_0xd6fa('0xf')];this['mapAgentsId']=_['map'](this[_0xd6fa('0xa')],'id');this['mapAgentsId']['_rr']=_0x4e91f4;};SmsQueue[_0xd6fa('0xd')][_0xd6fa('0x10')]=function(){this[_0xd6fa('0x11')]=0x0;this[_0xd6fa('0x12')]=0x0;for(var _0x3cd6fa=0x0;_0x3cd6fa=0x0?this['available']:0x0;var _0xe458aa={'id':this['id'],'available':this['available'],'loggedIn':this[_0xd6fa('0x11')],'name':this['name'],'paused':this[_0xd6fa('0x12')],'waiting':this[_0xd6fa('0xc')]};var _0x2ee97a=md5(JSON[_0xd6fa('0x17')](_0xe458aa));if(this[_0xd6fa('0x1')]!==_0x2ee97a){this[_0xd6fa('0x1')]=_0x2ee97a;io['to'](util[_0xd6fa('0x18')](_0xd6fa('0x19'),_0xe458aa[_0xd6fa('0x7')]))[_0xd6fa('0x1a')](_0xd6fa('0x1b'),_0xe458aa);}};module[_0xd6fa('0x1c')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 284c08a..11bc5b5 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 _0x3c82=['ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','loggedIn','paused','length','available','stringify','md5','format','emit','whatsapp_queue:save','exports','lodash'];(function(_0x1c78be,_0x1b796f){var _0x2fafb7=function(_0x152df8){while(--_0x152df8){_0x1c78be['push'](_0x1c78be['shift']());}};_0x2fafb7(++_0x1b796f);}(_0x3c82,0x194));var _0x23c8=function(_0x5e8757,_0x2f7976){_0x5e8757=_0x5e8757-0x0;var _0xc27e47=_0x3c82[_0x5e8757];return _0xc27e47;};'use strict';var _=require(_0x23c8('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x23c8('0x1'));var config=require(_0x23c8('0x2'));config[_0x23c8('0x3')]=_['defaults'](config['redis'],{'host':_0x23c8('0x4'),'port':0x18eb});var io=require(_0x23c8('0x5'))(new Redis(config[_0x23c8('0x3')]));function WhatsappQueue(_0x2345f8){this['id']=_0x2345f8['id']||0x0;this[_0x23c8('0x6')]=_0x2345f8[_0x23c8('0x6')]||'';this[_0x23c8('0x7')]=_0x2345f8[_0x23c8('0x7')]||0xa;this[_0x23c8('0x8')]=_0x2345f8['strategy']||_0x23c8('0x9');this[_0x23c8('0xa')]=_0x2345f8['Agents'];this['mapAgentsId']={};this[_0x23c8('0xb')]=0x0;this['md5']='';this[_0x23c8('0xc')]();this[_0x23c8('0xd')]();}WhatsappQueue[_0x23c8('0xe')][_0x23c8('0xc')]=function(){var _0x270085=this['mapAgentsId']['_rr'];this[_0x23c8('0xf')]=_['map'](this[_0x23c8('0xa')],'id');this[_0x23c8('0xf')][_0x23c8('0x10')]=_0x270085;};WhatsappQueue['prototype'][_0x23c8('0xd')]=function(){this[_0x23c8('0x11')]=0x0;this[_0x23c8('0x12')]=0x0;for(var _0x242d07=0x0;_0x242d07=0x0?this[_0x23c8('0x14')]:0x0;var _0xe65989={'id':this['id'],'available':this[_0x23c8('0x14')],'loggedIn':this[_0x23c8('0x11')],'name':this[_0x23c8('0x6')],'paused':this[_0x23c8('0x12')],'waiting':this[_0x23c8('0xb')]};var _0x5301bb=md5(JSON[_0x23c8('0x15')](_0xe65989));if(this[_0x23c8('0x16')]!==_0x5301bb){this[_0x23c8('0x16')]=_0x5301bb;io['to'](util[_0x23c8('0x17')]('whatsapp:queue:%s',_0xe65989[_0x23c8('0x6')]))[_0x23c8('0x18')](_0x23c8('0x19'),_0xe65989);}};module[_0x23c8('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0xfa28=['defaults','localhost','name','timeout','beepall','Agents','waiting','updateRouting','_rr','mapAgentsId','map','prototype','loggedIn','online','whatsappPause','paused','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis'];(function(_0x3e5000,_0x21d585){var _0x301a98=function(_0x4f5cdd){while(--_0x4f5cdd){_0x3e5000['push'](_0x3e5000['shift']());}};_0x301a98(++_0x21d585);}(_0xfa28,0xff));var _0x8fa2=function(_0x1ebce2,_0x10e903){_0x1ebce2=_0x1ebce2-0x0;var _0x4a330c=_0xfa28[_0x1ebce2];return _0x4a330c;};'use strict';var _=require(_0x8fa2('0x0'));var md5=require(_0x8fa2('0x1'));var util=require(_0x8fa2('0x2'));var Redis=require(_0x8fa2('0x3'));var config=require(_0x8fa2('0x4'));config[_0x8fa2('0x5')]=_[_0x8fa2('0x6')](config['redis'],{'host':_0x8fa2('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8fa2('0x5')]));function WhatsappQueue(_0x2663de){this['id']=_0x2663de['id']||0x0;this[_0x8fa2('0x8')]=_0x2663de[_0x8fa2('0x8')]||'';this[_0x8fa2('0x9')]=_0x2663de['timeout']||0xa;this['strategy']=_0x2663de['strategy']||_0x8fa2('0xa');this[_0x8fa2('0xb')]=_0x2663de['Agents'];this['mapAgentsId']={};this[_0x8fa2('0xc')]=0x0;this[_0x8fa2('0x1')]='';this[_0x8fa2('0xd')]();this['updateRealtime']();}WhatsappQueue['prototype'][_0x8fa2('0xd')]=function(){var _0x172d5c=this['mapAgentsId'][_0x8fa2('0xe')];this[_0x8fa2('0xf')]=_[_0x8fa2('0x10')](this[_0x8fa2('0xb')],'id');this['mapAgentsId']['_rr']=_0x172d5c;};WhatsappQueue[_0x8fa2('0x11')]['updateRealtime']=function(){this[_0x8fa2('0x12')]=0x0;this['paused']=0x0;for(var _0x49a2fd=0x0;_0x49a2fd=0x0?this[_0x8fa2('0x16')]:0x0;var _0x5a5c98={'id':this['id'],'available':this['available'],'loggedIn':this[_0x8fa2('0x12')],'name':this[_0x8fa2('0x8')],'paused':this[_0x8fa2('0x15')],'waiting':this[_0x8fa2('0xc')]};var _0x3f128d=md5(JSON[_0x8fa2('0x17')](_0x5a5c98));if(this[_0x8fa2('0x1')]!==_0x3f128d){this[_0x8fa2('0x1')]=_0x3f128d;io['to'](util[_0x8fa2('0x18')](_0x8fa2('0x19'),_0x5a5c98['name']))[_0x8fa2('0x1a')](_0x8fa2('0x1b'),_0x5a5c98);}};module[_0x8fa2('0x1c')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 30fa6dd..75969bd 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x4ef38a,_0x24083b){var _0x437a7e=function(_0x5915e1){while(--_0x5915e1){_0x4ef38a['push'](_0x4ef38a['shift']());}};_0x437a7e(++_0x24083b);}(_0xb10b,0x12a));var _0xbb10=function(_0x43e4b3,_0x1444de){_0x43e4b3=_0x43e4b3-0x0;var _0x10c655=_0xb10b[_0x43e4b3];return _0x10c655;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x371686,_0xf0a80b){var _0x3f9219=function(_0x563598){while(--_0x563598){_0x371686['push'](_0x371686['shift']());}};_0x3f9219(++_0xf0a80b);}(_0xb10b,0x12a));var _0xbb10=function(_0x2040dd,_0x156a63){_0x2040dd=_0x2040dd-0x0;var _0x27688f=_0xb10b[_0x2040dd];return _0x27688f;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index adbd0ae..398d9c4 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 _0x436e=['addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','updateChatInteraction'];(function(_0x591f49,_0x37727c){var _0x5e58f3=function(_0x30d6da){while(--_0x30d6da){_0x591f49['push'](_0x591f49['shift']());}};_0x5e58f3(++_0x37727c);}(_0x436e,0x9f));var _0xe436=function(_0x810611,_0x4466d3){_0x810611=_0x810611-0x0;var _0x3c7749=_0x436e[_0x810611];return _0x3c7749;};'use strict';var client=require(_0xe436('0x0'));exports[_0xe436('0x1')]=function(_0x181204,_0x1cb8f9){return client['Request']('UpdateChatInteraction',{'body':_0x1cb8f9,'options':{'where':{'id':_0x181204}},'log':_0xe436('0x2')});};exports[_0xe436('0x3')]=function(_0x177fe1,_0x48263c){return client['Request'](_0xe436('0x4'),{'body':_0x48263c,'options':{'where':{'id':_0x177fe1}},'log':_0xe436('0x5')});}; \ No newline at end of file +var _0x7c76=['AddTagsToChatInteraction','addTagsToChatInteraction','update','Request','addTags'];(function(_0x60e43a,_0x2a2b01){var _0x32bbda=function(_0x3b8b73){while(--_0x3b8b73){_0x60e43a['push'](_0x60e43a['shift']());}};_0x32bbda(++_0x2a2b01);}(_0x7c76,0x1ce));var _0x67c7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7c76[_0x14add3];return _0x4a174f;};'use strict';var client=require('../client');exports[_0x67c7('0x0')]=function(_0x1b0139,_0x57732e){return client[_0x67c7('0x1')]('UpdateChatInteraction',{'body':_0x57732e,'options':{'where':{'id':_0x1b0139}},'log':'updateChatInteraction'});};exports[_0x67c7('0x2')]=function(_0xde6cab,_0x5a854f){return client[_0x67c7('0x1')](_0x67c7('0x3'),{'body':_0x5a854f,'options':{'where':{'id':_0xde6cab}},'log':_0x67c7('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index ed93e9b..7218326 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 _0x2806=['createChatMessage','../client','CreateChatMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2806,0x1c6));var _0x6280=function(_0xa52839,_0x3e1b19){_0xa52839=_0xa52839-0x0;var _0x167912=_0x2806[_0xa52839];return _0x167912;};'use strict';var client=require(_0x6280('0x0'));exports['create']=function(_0x320ba){return client['Request'](_0x6280('0x1'),{'body':_0x320ba,'log':_0x6280('0x2')});}; \ No newline at end of file +var _0xcdee=['CreateChatMessage','create','Request'];(function(_0x503950,_0x5022eb){var _0x1657a9=function(_0x4c1e8f){while(--_0x4c1e8f){_0x503950['push'](_0x503950['shift']());}};_0x1657a9(++_0x5022eb);}(_0xcdee,0x64));var _0xecde=function(_0x41cd90,_0x36f0fb){_0x41cd90=_0x41cd90-0x0;var _0x186856=_0xcdee[_0x41cd90];return _0x186856;};'use strict';var client=require('../client');exports[_0xecde('0x0')]=function(_0x15d1d8){return client[_0xecde('0x1')](_0xecde('0x2'),{'body':_0x15d1d8,'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 4decdf8..cd723d1 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 _0x5fd1=['name','User','Agents','chatPause','getChatQueues','../client','Request','GetChatQueue'];(function(_0x3f83e7,_0x49ea4f){var _0x55af14=function(_0x47f536){while(--_0x47f536){_0x3f83e7['push'](_0x3f83e7['shift']());}};_0x55af14(++_0x49ea4f);}(_0x5fd1,0x155));var _0x15fd=function(_0x2f02af,_0x5c6fee){_0x2f02af=_0x2f02af-0x0;var _0x38c95c=_0x5fd1[_0x2f02af];return _0x38c95c;};'use strict';var client=require(_0x15fd('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x15fd('0x1')](_0x15fd('0x2'),{'options':{'raw':![],'attributes':['id',_0x15fd('0x3'),'timeout','strategy'],'include':[{'model':_0x15fd('0x4'),'as':_0x15fd('0x5'),'attributes':['id',_0x15fd('0x3'),'online',_0x15fd('0x6')]}]},'log':_0x15fd('0x7')});};}; \ No newline at end of file +var _0x6b8f=['name','online','chatPause','getChatQueues','GetChatQueue','strategy','User'];(function(_0x1e2e30,_0x48b693){var _0x49169c=function(_0x220462){while(--_0x220462){_0x1e2e30['push'](_0x1e2e30['shift']());}};_0x49169c(++_0x48b693);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x46c42b,_0x38a505){_0x46c42b=_0x46c42b-0x0;var _0x8af215=_0x6b8f[_0x46c42b];return _0x8af215;};'use strict';var client=require('../client');exports[_0xf6b8('0x0')]=function(){return function(){return client['Request'](_0xf6b8('0x1'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xf6b8('0x2')],'include':[{'model':_0xf6b8('0x3'),'as':'Agents','attributes':['id',_0xf6b8('0x4'),_0xf6b8('0x5'),_0xf6b8('0x6')]}]},'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 baf645c..3e55d4b 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 _0x057a=['Request','UpdateChatQueueReport','../client','create','CreateChatQueueReport','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x057a,0x1a6));var _0xa057=function(_0x238b97,_0x4506d2){_0x238b97=_0x238b97-0x0;var _0x119eb9=_0x057a[_0x238b97];return _0x119eb9;};'use strict';var client=require(_0xa057('0x0'));exports[_0xa057('0x1')]=function(_0x32f0b5){return client['Request'](_0xa057('0x2'),{'body':_0x32f0b5,'log':'CreateChatQueueReport'});};exports[_0xa057('0x3')]=function(_0x92634f,_0x5481b7){return client[_0xa057('0x4')](_0xa057('0x5'),{'body':_0x5481b7,'options':{'where':{'uniqueid':_0x92634f},'order':[['id','DESC']],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x43b1=['create','CreateChatQueueReport','update','Request','UpdateChatQueueReport','DESC','../client'];(function(_0x1f2c15,_0x202189){var _0x16a8bf=function(_0x2dbdca){while(--_0x2dbdca){_0x1f2c15['push'](_0x1f2c15['shift']());}};_0x16a8bf(++_0x202189);}(_0x43b1,0x7d));var _0x143b=function(_0x39d630,_0x113ea5){_0x39d630=_0x39d630-0x0;var _0x4ef7aa=_0x43b1[_0x39d630];return _0x4ef7aa;};'use strict';var client=require(_0x143b('0x0'));exports[_0x143b('0x1')]=function(_0x426f2c){return client['Request'](_0x143b('0x2'),{'body':_0x426f2c,'log':'CreateChatQueueReport'});};exports[_0x143b('0x3')]=function(_0x4388c5,_0x223e86){return client[_0x143b('0x4')](_0x143b('0x5'),{'body':_0x223e86,'options':{'where':{'uniqueid':_0x4388c5},'order':[['id',_0x143b('0x6')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index d5a9f0e..96dcd5e 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(_0x58c976,_0x51f797){var _0x5237df=function(_0x1895e4){while(--_0x1895e4){_0x58c976['push'](_0x58c976['shift']());}};_0x5237df(++_0x51f797);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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(_0x5a4b42,_0x2b9c18){var _0x5e81d6=function(_0x595077){while(--_0x595077){_0x5a4b42['push'](_0x5a4b42['shift']());}};_0x5e81d6(++_0x2b9c18);}(_0x7a54,0x106));var _0x47a5=function(_0x2eac0c,_0x2cf8a8){_0x2eac0c=_0x2eac0c-0x0;var _0x21fd28=_0x7a54[_0x2eac0c];return _0x21fd28;};'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 548b298..73674f2 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 _0xf655=['../client','Request','createFaxMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf655,0xd2));var _0x5f65=function(_0x11f238,_0x418d9f){_0x11f238=_0x11f238-0x0;var _0x201974=_0xf655[_0x11f238];return _0x201974;};'use strict';var client=require(_0x5f65('0x0'));exports['create']=function(_0x53ab37){return client[_0x5f65('0x1')]('CreateFaxMessage',{'body':_0x53ab37,'log':_0x5f65('0x2')});}; \ No newline at end of file +var _0x5db6=['CreateFaxMessage','createFaxMessage','../client','create','Request'];(function(_0x1d48af,_0x294079){var _0x181c5b=function(_0x4abd16){while(--_0x4abd16){_0x1d48af['push'](_0x1d48af['shift']());}};_0x181c5b(++_0x294079);}(_0x5db6,0xac));var _0x65db=function(_0x38080e,_0x95512d){_0x38080e=_0x38080e-0x0;var _0x4e4c87=_0x5db6[_0x38080e];return _0x4e4c87;};'use strict';var client=require(_0x65db('0x0'));exports[_0x65db('0x1')]=function(_0x2d86f6){return client[_0x65db('0x2')](_0x65db('0x3'),{'body':_0x2d86f6,'log':_0x65db('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index b71657e..3b2ec41 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 _0x23eb=['strategy','User','Agents','online','faxPause','Request','GetFaxQueue','name','timeout'];(function(_0x408047,_0x19125f){var _0x2f297c=function(_0x3976e5){while(--_0x3976e5){_0x408047['push'](_0x408047['shift']());}};_0x2f297c(++_0x19125f);}(_0x23eb,0x16d));var _0xb23e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x23eb[_0x501510];return _0x1e6ee5;};'use strict';var client=require('../client');exports['getFaxQueues']=function(){return function(){return client[_0xb23e('0x0')](_0xb23e('0x1'),{'options':{'raw':![],'attributes':['id',_0xb23e('0x2'),_0xb23e('0x3'),_0xb23e('0x4')],'include':[{'model':_0xb23e('0x5'),'as':_0xb23e('0x6'),'attributes':['id',_0xb23e('0x2'),_0xb23e('0x7'),_0xb23e('0x8')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x52a6=['getFaxQueues','timeout','strategy','User','Agents','name','online','faxPause','../client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x52a6,0x8f));var _0x652a=function(_0x262f36,_0x54bd2d){_0x262f36=_0x262f36-0x0;var _0x355624=_0x52a6[_0x262f36];return _0x355624;};'use strict';var client=require(_0x652a('0x0'));exports[_0x652a('0x1')]=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id','name',_0x652a('0x2'),_0x652a('0x3')],'include':[{'model':_0x652a('0x4'),'as':_0x652a('0x5'),'attributes':['id',_0x652a('0x6'),_0x652a('0x7'),_0x652a('0x8')]}]},'log':_0x652a('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 6c6b4ad..e8d7616 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 _0x9e16=['CreateFaxQueueReport','UpdateFaxQueueReport','DESC','../client','create','Request'];(function(_0x146f03,_0xad2335){var _0x18a3c5=function(_0x2f13de){while(--_0x2f13de){_0x146f03['push'](_0x146f03['shift']());}};_0x18a3c5(++_0xad2335);}(_0x9e16,0x19b));var _0x69e1=function(_0x1c6f8f,_0x481765){_0x1c6f8f=_0x1c6f8f-0x0;var _0x5d6770=_0x9e16[_0x1c6f8f];return _0x5d6770;};'use strict';var client=require(_0x69e1('0x0'));exports[_0x69e1('0x1')]=function(_0x4c7c51){return client[_0x69e1('0x2')](_0x69e1('0x3'),{'body':_0x4c7c51,'log':'CreateFaxQueueReport'});};exports['update']=function(_0x50c2f9,_0x43c8cd){return client[_0x69e1('0x2')](_0x69e1('0x4'),{'body':_0x43c8cd,'options':{'where':{'uniqueid':_0x50c2f9},'order':[['id',_0x69e1('0x5')]],'limit':0x1},'log':_0x69e1('0x4')});}; \ No newline at end of file +var _0x7d13=['UpdateFaxQueueReport','DESC','../client','create','Request','CreateFaxQueueReport','update'];(function(_0x2eaee9,_0x2ee388){var _0xd81ab5=function(_0x54b5b6){while(--_0x54b5b6){_0x2eaee9['push'](_0x2eaee9['shift']());}};_0xd81ab5(++_0x2ee388);}(_0x7d13,0x1de));var _0x37d1=function(_0x11da1e,_0x597cc5){_0x11da1e=_0x11da1e-0x0;var _0x404daa=_0x7d13[_0x11da1e];return _0x404daa;};'use strict';var client=require(_0x37d1('0x0'));exports[_0x37d1('0x1')]=function(_0x51c159){return client[_0x37d1('0x2')](_0x37d1('0x3'),{'body':_0x51c159,'log':_0x37d1('0x3')});};exports[_0x37d1('0x4')]=function(_0x24b2c2,_0x49c42f){return client[_0x37d1('0x2')](_0x37d1('0x5'),{'body':_0x49c42f,'options':{'where':{'uniqueid':_0x24b2c2},'order':[['id',_0x37d1('0x6')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 9e1b7c2..e50c4cf 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 _0x7ce3=['getIntervals','GetInterval','name','Interval','Intervals','../client'];(function(_0x1d2bbd,_0x40a3b6){var _0x5e67b2=function(_0x342ab9){while(--_0x342ab9){_0x1d2bbd['push'](_0x1d2bbd['shift']());}};_0x5e67b2(++_0x40a3b6);}(_0x7ce3,0x83));var _0x37ce=function(_0x1a9e87,_0x1bbb03){_0x1a9e87=_0x1a9e87-0x0;var _0x554db1=_0x7ce3[_0x1a9e87];return _0x554db1;};'use strict';var client=require(_0x37ce('0x0'));exports[_0x37ce('0x1')]=function(){return function(){return client['Request'](_0x37ce('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x37ce('0x3')],'include':[{'model':_0x37ce('0x4'),'as':_0x37ce('0x5'),'attributes':['id',_0x37ce('0x3'),'interval']}]},'log':_0x37ce('0x1')});};}; \ No newline at end of file +var _0x185e=['interval','../client','Request','name','Interval'];(function(_0x1e1d5d,_0x213f5b){var _0x1830ac=function(_0x55efb0){while(--_0x55efb0){_0x1e1d5d['push'](_0x1e1d5d['shift']());}};_0x1830ac(++_0x213f5b);}(_0x185e,0xab));var _0xe185=function(_0x586cab,_0x5b0d02){_0x586cab=_0x586cab-0x0;var _0x15a859=_0x185e[_0x586cab];return _0x15a859;};'use strict';var client=require(_0xe185('0x0'));exports['getIntervals']=function(){return function(){return client[_0xe185('0x1')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xe185('0x2')],'include':[{'model':_0xe185('0x3'),'as':'Intervals','attributes':['id',_0xe185('0x2'),_0xe185('0x4')]}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index de5112f..3e0d0ad 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 _0xd7d1=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x7b5cdd,_0x8c88d8){var _0x3a29ae=function(_0x17859a){while(--_0x17859a){_0x7b5cdd['push'](_0x7b5cdd['shift']());}};_0x3a29ae(++_0x8c88d8);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x26f91b,_0x4831d9){_0x26f91b=_0x26f91b-0x0;var _0x56607f=_0xd7d1[_0x26f91b];return _0x56607f;};'use strict';var client=require(_0x1d7d('0x0'));exports[_0x1d7d('0x1')]=function(_0xce4540,_0x447083){return client[_0x1d7d('0x2')](_0x1d7d('0x3'),{'body':_0x447083,'options':{'where':{'id':_0xce4540}},'log':_0x1d7d('0x4')});};exports[_0x1d7d('0x5')]=function(_0x1ac097,_0x1adb6b){return client[_0x1d7d('0x2')](_0x1d7d('0x6'),{'body':_0x1adb6b,'options':{'where':{'id':_0x1ac097}},'log':_0x1d7d('0x7')});}; \ No newline at end of file +var _0x57ca=['UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','update','Request'];(function(_0x24fd0d,_0x341be2){var _0x18ef2e=function(_0x2ad6e4){while(--_0x2ad6e4){_0x24fd0d['push'](_0x24fd0d['shift']());}};_0x18ef2e(++_0x341be2);}(_0x57ca,0x108));var _0xa57c=function(_0x2a5afa,_0x51510c){_0x2a5afa=_0x2a5afa-0x0;var _0x6874ca=_0x57ca[_0x2a5afa];return _0x6874ca;};'use strict';var client=require('../client');exports[_0xa57c('0x0')]=function(_0x4ad696,_0x4b1712){return client[_0xa57c('0x1')](_0xa57c('0x2'),{'body':_0x4b1712,'options':{'where':{'id':_0x4ad696}},'log':_0xa57c('0x3')});};exports[_0xa57c('0x4')]=function(_0x1da469,_0x48be2d){return client[_0xa57c('0x1')](_0xa57c('0x5'),{'body':_0x48be2d,'options':{'where':{'id':_0x1da469}},'log':_0xa57c('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index ce13fa8..380c053 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 _0x6949=['CreateMailMessage','createMailMessage','../client'];(function(_0x5f1e6a,_0x4f15e3){var _0x5d7976=function(_0x364f41){while(--_0x364f41){_0x5f1e6a['push'](_0x5f1e6a['shift']());}};_0x5d7976(++_0x4f15e3);}(_0x6949,0x74));var _0x9694=function(_0x102881,_0x58d723){_0x102881=_0x102881-0x0;var _0x5c63d0=_0x6949[_0x102881];return _0x5c63d0;};'use strict';var client=require(_0x9694('0x0'));exports['create']=function(_0x545d22){return client['Request'](_0x9694('0x1'),{'body':_0x545d22,'log':_0x9694('0x2')});}; \ No newline at end of file +var _0xb12f=['../client','create','CreateMailMessage','createMailMessage'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0xb12f,0xd8));var _0xfb12=function(_0x2e666f,_0x1bc5f3){_0x2e666f=_0x2e666f-0x0;var _0x455047=_0xb12f[_0x2e666f];return _0x455047;};'use strict';var client=require(_0xfb12('0x0'));exports[_0xfb12('0x1')]=function(_0x3958eb){return client['Request'](_0xfb12('0x2'),{'body':_0x3958eb,'log':_0xfb12('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 205d7c1..d4a5587 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 _0x86ae=['GetMailQueue','name','timeout','User','online','../client','getMailQueues'];(function(_0x2cc64c,_0x762d58){var _0xeca5b8=function(_0x596d16){while(--_0x596d16){_0x2cc64c['push'](_0x2cc64c['shift']());}};_0xeca5b8(++_0x762d58);}(_0x86ae,0xfa));var _0xe86a=function(_0xf4ed25,_0x37dc35){_0xf4ed25=_0xf4ed25-0x0;var _0xa201ec=_0x86ae[_0xf4ed25];return _0xa201ec;};'use strict';var client=require(_0xe86a('0x0'));exports[_0xe86a('0x1')]=function(){return function(){return client['Request'](_0xe86a('0x2'),{'options':{'raw':![],'attributes':['id',_0xe86a('0x3'),_0xe86a('0x4'),'strategy'],'include':[{'model':_0xe86a('0x5'),'as':'Agents','attributes':['id',_0xe86a('0x3'),_0xe86a('0x6'),'mailPause']}]},'log':_0xe86a('0x1')});};}; \ No newline at end of file +var _0xc4b3=['GetMailQueue','name','timeout','strategy','Agents','online','mailPause','getMailQueues','../client'];(function(_0x4c4e18,_0x130b42){var _0x43fbc3=function(_0x2e6821){while(--_0x2e6821){_0x4c4e18['push'](_0x4c4e18['shift']());}};_0x43fbc3(++_0x130b42);}(_0xc4b3,0x179));var _0x3c4b=function(_0x5b08ae,_0x15acb3){_0x5b08ae=_0x5b08ae-0x0;var _0x2f8f1d=_0xc4b3[_0x5b08ae];return _0x2f8f1d;};'use strict';var client=require(_0x3c4b('0x0'));exports['getMailQueues']=function(){return function(){return client['Request'](_0x3c4b('0x1'),{'options':{'raw':![],'attributes':['id',_0x3c4b('0x2'),_0x3c4b('0x3'),_0x3c4b('0x4')],'include':[{'model':'User','as':_0x3c4b('0x5'),'attributes':['id','name',_0x3c4b('0x6'),_0x3c4b('0x7')]}]},'log':_0x3c4b('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 4bdfa62..d9b2d81 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 _0x54f3=['CreateMailQueueReport','update','Request','DESC','UpdateMailQueueReport','../client','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x54f3,0xec));var _0x354f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x54f3[_0x40a045];return _0x1a687c;};'use strict';var client=require(_0x354f('0x0'));exports[_0x354f('0x1')]=function(_0x1fa9de){return client['Request'](_0x354f('0x2'),{'body':_0x1fa9de,'log':'CreateMailQueueReport'});};exports[_0x354f('0x3')]=function(_0xa2db9f,_0x48f384){return client[_0x354f('0x4')]('UpdateMailQueueReport',{'body':_0x48f384,'options':{'where':{'uniqueid':_0xa2db9f},'order':[['id',_0x354f('0x5')]],'limit':0x1},'log':_0x354f('0x6')});}; \ No newline at end of file +var _0x3caa=['DESC','../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x437d7f,_0x1feb46){var _0x31058c=function(_0x49dd1a){while(--_0x49dd1a){_0x437d7f['push'](_0x437d7f['shift']());}};_0x31058c(++_0x1feb46);}(_0x3caa,0x112));var _0xa3ca=function(_0x169644,_0x15c0a0){_0x169644=_0x169644-0x0;var _0xa36241=_0x3caa[_0x169644];return _0xa36241;};'use strict';var client=require(_0xa3ca('0x0'));exports[_0xa3ca('0x1')]=function(_0x37a130){return client[_0xa3ca('0x2')](_0xa3ca('0x3'),{'body':_0x37a130,'log':'CreateMailQueueReport'});};exports[_0xa3ca('0x4')]=function(_0x148d27,_0x1d0c58){return client[_0xa3ca('0x2')](_0xa3ca('0x5'),{'body':_0x1d0c58,'options':{'where':{'uniqueid':_0x148d27},'order':[['id',_0xa3ca('0x6')]],'limit':0x1},'log':_0xa3ca('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 612d66a..8a9ea52 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 _0xb429=['../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x355d4e,_0x1924bf){var _0x19f203=function(_0x37480a){while(--_0x37480a){_0x355d4e['push'](_0x355d4e['shift']());}};_0x19f203(++_0x1924bf);}(_0xb429,0x173));var _0x9b42=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb429[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x9b42('0x0'));exports[_0x9b42('0x1')]=function(_0x43634e,_0x268d3c){return client[_0x9b42('0x2')](_0x9b42('0x3'),{'body':_0x268d3c,'options':{'where':{'id':_0x43634e}},'log':_0x9b42('0x4')});};exports['addTags']=function(_0x5bd306,_0x216c41){return client['Request'](_0x9b42('0x5'),{'body':_0x216c41,'options':{'where':{'id':_0x5bd306}},'log':_0x9b42('0x6')});}; \ No newline at end of file +var _0x6a94=['UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','Request','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','update'];(function(_0x422749,_0x18f5ab){var _0x1a3d11=function(_0x34e1e1){while(--_0x34e1e1){_0x422749['push'](_0x422749['shift']());}};_0x1a3d11(++_0x18f5ab);}(_0x6a94,0x1e9));var _0x46a9=function(_0x28b0fc,_0x432bfe){_0x28b0fc=_0x28b0fc-0x0;var _0x2b23f4=_0x6a94[_0x28b0fc];return _0x2b23f4;};'use strict';var client=require('../client');exports[_0x46a9('0x0')]=function(_0x7eabd,_0x781b36){return client['Request'](_0x46a9('0x1'),{'body':_0x781b36,'options':{'where':{'id':_0x7eabd}},'log':_0x46a9('0x2')});};exports[_0x46a9('0x3')]=function(_0x47b364,_0x53f11d){return client[_0x46a9('0x4')](_0x46a9('0x5'),{'body':_0x53f11d,'options':{'where':{'id':_0x47b364}},'log':_0x46a9('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 0e795d5..93abc6e 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 _0xf035=['createOpenchannelMessage','../client','create','Request'];(function(_0xefdb99,_0xc0aa0f){var _0x1120c7=function(_0x120752){while(--_0x120752){_0xefdb99['push'](_0xefdb99['shift']());}};_0x1120c7(++_0xc0aa0f);}(_0xf035,0xa9));var _0x5f03=function(_0x4a66e5,_0x44d5ea){_0x4a66e5=_0x4a66e5-0x0;var _0x13f1e2=_0xf035[_0x4a66e5];return _0x13f1e2;};'use strict';var client=require(_0x5f03('0x0'));exports[_0x5f03('0x1')]=function(_0x36b1ef){return client[_0x5f03('0x2')]('CreateOpenchannelMessage',{'body':_0x36b1ef,'log':_0x5f03('0x3')});}; \ No newline at end of file +var _0xfbe0=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x5f47bb,_0x3ea650){var _0x5da984=function(_0xc8dca3){while(--_0xc8dca3){_0x5f47bb['push'](_0x5f47bb['shift']());}};_0x5da984(++_0x3ea650);}(_0xfbe0,0xd1));var _0x0fbe=function(_0x16a7d7,_0x5bcd19){_0x16a7d7=_0x16a7d7-0x0;var _0xda03e3=_0xfbe0[_0x16a7d7];return _0xda03e3;};'use strict';var client=require(_0x0fbe('0x0'));exports[_0x0fbe('0x1')]=function(_0x14c268){return client[_0x0fbe('0x2')](_0x0fbe('0x3'),{'body':_0x14c268,'log':_0x0fbe('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 27f0fb6..3fe1c7a 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 _0x1f37=['getOpenchannelQueues','Request','GetOpenchannelQueue','timeout','Agents'];(function(_0x51da41,_0x57104c){var _0x2e32df=function(_0x191c36){while(--_0x191c36){_0x51da41['push'](_0x51da41['shift']());}};_0x2e32df(++_0x57104c);}(_0x1f37,0xbe));var _0x71f3=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x1f37[_0x311c35];return _0x5cc50c;};'use strict';var client=require('../client');exports[_0x71f3('0x0')]=function(){return function(){return client[_0x71f3('0x1')](_0x71f3('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x71f3('0x3'),'strategy'],'include':[{'model':'User','as':_0x71f3('0x4'),'attributes':['id','name','online','openchannelPause']}]},'log':_0x71f3('0x0')});};}; \ No newline at end of file +var _0x86f5=['Agents','name','online','openchannelPause','../client','Request','GetOpenchannelQueue','timeout'];(function(_0x5434e8,_0x59a3be){var _0x32df09=function(_0x1afa96){while(--_0x1afa96){_0x5434e8['push'](_0x5434e8['shift']());}};_0x32df09(++_0x59a3be);}(_0x86f5,0x74));var _0x586f=function(_0x1df3e5,_0x2d37f1){_0x1df3e5=_0x1df3e5-0x0;var _0x422d0c=_0x86f5[_0x1df3e5];return _0x422d0c;};'use strict';var client=require(_0x586f('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x586f('0x1')](_0x586f('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x586f('0x3'),'strategy'],'include':[{'model':'User','as':_0x586f('0x4'),'attributes':['id',_0x586f('0x5'),_0x586f('0x6'),_0x586f('0x7')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 3bf7e59..627cd2b 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 _0x6e6c=['CreateOpenchannelQueueReport','DESC','UpdateOpenchannelQueueReport','../client','create','Request'];(function(_0x31e584,_0x4d9f7f){var _0x5686d0=function(_0x1f9e99){while(--_0x1f9e99){_0x31e584['push'](_0x31e584['shift']());}};_0x5686d0(++_0x4d9f7f);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xc6e6('0x0'));exports[_0xc6e6('0x1')]=function(_0x545f2c){return client[_0xc6e6('0x2')](_0xc6e6('0x3'),{'body':_0x545f2c,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0x2e97f5,_0x5a9e2b){return client[_0xc6e6('0x2')]('UpdateOpenchannelQueueReport',{'body':_0x5a9e2b,'options':{'where':{'uniqueid':_0x2e97f5},'order':[['id',_0xc6e6('0x4')]],'limit':0x1},'log':_0xc6e6('0x5')});}; \ No newline at end of file +var _0xb40a=['create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client'];(function(_0x2bba02,_0x1c0443){var _0x310a95=function(_0x1bfb01){while(--_0x1bfb01){_0x2bba02['push'](_0x2bba02['shift']());}};_0x310a95(++_0x1c0443);}(_0xb40a,0x117));var _0xab40=function(_0x10763a,_0xb6da1b){_0x10763a=_0x10763a-0x0;var _0x4c2617=_0xb40a[_0x10763a];return _0x4c2617;};'use strict';var client=require(_0xab40('0x0'));exports[_0xab40('0x1')]=function(_0x29518e){return client[_0xab40('0x2')](_0xab40('0x3'),{'body':_0x29518e,'log':_0xab40('0x3')});};exports[_0xab40('0x4')]=function(_0xf3fc07,_0x38de04){return client[_0xab40('0x2')](_0xab40('0x5'),{'body':_0x38de04,'options':{'where':{'uniqueid':_0xf3fc07},'order':[['id',_0xab40('0x6')]],'limit':0x1},'log':_0xab40('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 65d806f..bdbb4d0 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 _0x1928=['../client','update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x31e2ce,_0x4d6517){var _0x3882c8=function(_0x29c3ca){while(--_0x29c3ca){_0x31e2ce['push'](_0x31e2ce['shift']());}};_0x3882c8(++_0x4d6517);}(_0x1928,0x138));var _0x8192=function(_0x4f12aa,_0x478f32){_0x4f12aa=_0x4f12aa-0x0;var _0x348ec9=_0x1928[_0x4f12aa];return _0x348ec9;};'use strict';var client=require(_0x8192('0x0'));exports[_0x8192('0x1')]=function(_0x2a432c,_0x49fae0){return client[_0x8192('0x2')](_0x8192('0x3'),{'body':_0x49fae0,'options':{'where':{'id':_0x2a432c}},'log':_0x8192('0x4')});};exports[_0x8192('0x5')]=function(_0x16f410,_0x11fa71){return client[_0x8192('0x2')](_0x8192('0x6'),{'body':_0x11fa71,'options':{'where':{'id':_0x16f410}},'log':_0x8192('0x7')});}; \ No newline at end of file +var _0xfd7b=['addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','update','Request','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x23171d,_0x5ce28f){var _0x2cf63b=function(_0x447b51){while(--_0x447b51){_0x23171d['push'](_0x23171d['shift']());}};_0x2cf63b(++_0x5ce28f);}(_0xfd7b,0x1df));var _0xbfd7=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xfd7b[_0x13d07a];return _0x5ee0ee;};'use strict';var client=require('../client');exports[_0xbfd7('0x0')]=function(_0x381d71,_0x3138e8){return client[_0xbfd7('0x1')](_0xbfd7('0x2'),{'body':_0x3138e8,'options':{'where':{'id':_0x381d71}},'log':_0xbfd7('0x3')});};exports[_0xbfd7('0x4')]=function(_0x221ad1,_0x249e59){return client[_0xbfd7('0x1')](_0xbfd7('0x5'),{'body':_0x249e59,'options':{'where':{'id':_0x221ad1}},'log':_0xbfd7('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 04e707e..450d834 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 _0xecca=['../client','Request','CreateSmsMessage','createSmsMessage'];(function(_0x570697,_0x281ef1){var _0x1d98c4=function(_0xaaedb2){while(--_0xaaedb2){_0x570697['push'](_0x570697['shift']());}};_0x1d98c4(++_0x281ef1);}(_0xecca,0x114));var _0xaecc=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xecca[_0x39096d];return _0x13da4f;};'use strict';var client=require(_0xaecc('0x0'));exports['create']=function(_0x24f588){return client[_0xaecc('0x1')](_0xaecc('0x2'),{'body':_0x24f588,'log':_0xaecc('0x3')});}; \ No newline at end of file +var _0xf731=['CreateSmsMessage','../client','create'];(function(_0x3b91ad,_0x4feee7){var _0x36f0cc=function(_0x59dbc4){while(--_0x59dbc4){_0x3b91ad['push'](_0x3b91ad['shift']());}};_0x36f0cc(++_0x4feee7);}(_0xf731,0x1b1));var _0x1f73=function(_0x1182e1,_0x10535e){_0x1182e1=_0x1182e1-0x0;var _0x13e4c1=_0xf731[_0x1182e1];return _0x13e4c1;};'use strict';var client=require(_0x1f73('0x0'));exports[_0x1f73('0x1')]=function(_0x1c458d){return client['Request'](_0x1f73('0x2'),{'body':_0x1c458d,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index a0b699f..973d0da 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 _0x9c44=['Request','GetSmsQueue','name','timeout','strategy','User','online','getSmsQueues'];(function(_0xe36709,_0x2fc52f){var _0x231493=function(_0x4e3720){while(--_0x4e3720){_0xe36709['push'](_0xe36709['shift']());}};_0x231493(++_0x2fc52f);}(_0x9c44,0x178));var _0x49c4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9c44[_0x465a0c];return _0x1e202e;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'attributes':['id',_0x49c4('0x2'),_0x49c4('0x3'),_0x49c4('0x4')],'include':[{'model':_0x49c4('0x5'),'as':'Agents','attributes':['id','name',_0x49c4('0x6'),'smsPause']}]},'log':_0x49c4('0x7')});};}; \ No newline at end of file +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 diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 220e806..7481473 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x1e54a7,_0x4e7ea3){var _0x41d78e=function(_0xbf0801){while(--_0xbf0801){_0x1e54a7['push'](_0x1e54a7['shift']());}};_0x41d78e(++_0x4e7ea3);}(_0x008c,0x188));var _0xc008=function(_0x326407,_0x2c9181){_0x326407=_0x326407-0x0;var _0x1b69f1=_0x008c[_0x326407];return _0x1b69f1;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file +var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x164df2,_0x4083ee){var _0x4abfa1=function(_0x226c9b){while(--_0x226c9b){_0x164df2['push'](_0x164df2['shift']());}};_0x4abfa1(++_0x4083ee);}(_0x008c,0x188));var _0xc008=function(_0x53b398,_0x39bfd8){_0x53b398=_0x53b398-0x0;var _0x32c9ed=_0x008c[_0x53b398];return _0x32c9ed;};'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 f10b9cd..f34b543 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(_0x23d4da,_0x2d0714){var _0xae73d8=function(_0x3206d2){while(--_0x3206d2){_0x23d4da['push'](_0x23d4da['shift']());}};_0xae73d8(++_0x2d0714);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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(_0x1d062b,_0x851ac3){var _0x3b487b=function(_0x2dae2c){while(--_0x2dae2c){_0x1d062b['push'](_0x1d062b['shift']());}};_0x3b487b(++_0x851ac3);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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 82aea51..4ba13a2 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 _0xcedf=['UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction','../client','update'];(function(_0x622035,_0x1a4b91){var _0x326cf2=function(_0x5c3002){while(--_0x5c3002){_0x622035['push'](_0x622035['shift']());}};_0x326cf2(++_0x1a4b91);}(_0xcedf,0x1b6));var _0xfced=function(_0x1d518e,_0x5002d5){_0x1d518e=_0x1d518e-0x0;var _0x5cd8c2=_0xcedf[_0x1d518e];return _0x5cd8c2;};'use strict';var client=require(_0xfced('0x0'));exports[_0xfced('0x1')]=function(_0x1ce4e6,_0x157ed6){return client['Request'](_0xfced('0x2'),{'body':_0x157ed6,'options':{'where':{'id':_0x1ce4e6}},'log':_0xfced('0x3')});};exports['addTags']=function(_0x5b16af,_0x1dad76){return client['Request'](_0xfced('0x4'),{'body':_0x1dad76,'options':{'where':{'id':_0x5b16af}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x8921=['../client','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x3b77e7,_0xf3b904){var _0x44615b=function(_0x4f933f){while(--_0x4f933f){_0x3b77e7['push'](_0x3b77e7['shift']());}};_0x44615b(++_0xf3b904);}(_0x8921,0x9a));var _0x1892=function(_0x4e679b,_0xa34259){_0x4e679b=_0x4e679b-0x0;var _0x119de3=_0x8921[_0x4e679b];return _0x119de3;};'use strict';var client=require(_0x1892('0x0'));exports['update']=function(_0x2fa8a8,_0x37e629){return client[_0x1892('0x1')](_0x1892('0x2'),{'body':_0x37e629,'options':{'where':{'id':_0x2fa8a8}},'log':_0x1892('0x3')});};exports[_0x1892('0x4')]=function(_0x28a89b,_0x15aa1b){return client[_0x1892('0x1')](_0x1892('0x5'),{'body':_0x15aa1b,'options':{'where':{'id':_0x28a89b}},'log':_0x1892('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 7d8ee1f..2322e72 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 _0xb862=['create','Request','CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0x569bda,_0x383e42){var _0x1b8c62=function(_0x48970b){while(--_0x48970b){_0x569bda['push'](_0x569bda['shift']());}};_0x1b8c62(++_0x383e42);}(_0xb862,0x103));var _0x2b86=function(_0x9cb2b2,_0x4a5879){_0x9cb2b2=_0x9cb2b2-0x0;var _0x168c0c=_0xb862[_0x9cb2b2];return _0x168c0c;};'use strict';var client=require(_0x2b86('0x0'));exports[_0x2b86('0x1')]=function(_0x134de8){return client[_0x2b86('0x2')](_0x2b86('0x3'),{'body':_0x134de8,'log':_0x2b86('0x4')});}; \ No newline at end of file +var _0x02cd=['Request','CreateWhatsappMessage','createWhatsappMessage','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x02cd,0x93));var _0xd02c=function(_0x34d533,_0x161449){_0x34d533=_0x34d533-0x0;var _0x4731f5=_0x02cd[_0x34d533];return _0x4731f5;};'use strict';var client=require('../client');exports[_0xd02c('0x0')]=function(_0xf274d7){return client[_0xd02c('0x1')](_0xd02c('0x2'),{'body':_0xf274d7,'log':_0xd02c('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index ea8ee85..51201dd 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 _0x6ff5=['Agents','online','whatsappPause','../client','getWhatsappQueues','Request','name','strategy','User'];(function(_0x3f578f,_0x51f172){var _0x32c754=function(_0x1bd873){while(--_0x1bd873){_0x3f578f['push'](_0x3f578f['shift']());}};_0x32c754(++_0x51f172);}(_0x6ff5,0x150));var _0x56ff=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x6ff5[_0x40220a];return _0x3903cc;};'use strict';var client=require(_0x56ff('0x0'));exports[_0x56ff('0x1')]=function(){return function(){return client[_0x56ff('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x56ff('0x3'),'timeout',_0x56ff('0x4')],'include':[{'model':_0x56ff('0x5'),'as':_0x56ff('0x6'),'attributes':['id','name',_0x56ff('0x7'),_0x56ff('0x8')]}]},'log':_0x56ff('0x1')});};}; \ No newline at end of file +var _0xb46d=['whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','strategy','User'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xb46d,0xb5));var _0xdb46=function(_0x509273,_0x13fc9f){_0x509273=_0x509273-0x0;var _0x38ef40=_0xb46d[_0x509273];return _0x38ef40;};'use strict';var client=require(_0xdb46('0x0'));exports[_0xdb46('0x1')]=function(){return function(){return client[_0xdb46('0x2')](_0xdb46('0x3'),{'options':{'raw':![],'attributes':['id',_0xdb46('0x4'),_0xdb46('0x5'),_0xdb46('0x6')],'include':[{'model':_0xdb46('0x7'),'as':'Agents','attributes':['id',_0xdb46('0x4'),'online',_0xdb46('0x8')]}]},'log':_0xdb46('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 36f62df..827a468 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 _0x63bb=['DESC','UpdateWhatsappQueueReport','../client','create','Request','CreateWhatsappQueueReport','update'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0x63bb,0x159));var _0xb63b=function(_0x52b7b9,_0x43ed4b){_0x52b7b9=_0x52b7b9-0x0;var _0x5b5d30=_0x63bb[_0x52b7b9];return _0x5b5d30;};'use strict';var client=require(_0xb63b('0x0'));exports[_0xb63b('0x1')]=function(_0x4cdc70){return client[_0xb63b('0x2')]('CreateWhatsappQueueReport',{'body':_0x4cdc70,'log':_0xb63b('0x3')});};exports[_0xb63b('0x4')]=function(_0x1b9d4e,_0x17fefa){return client['Request']('UpdateWhatsappQueueReport',{'body':_0x17fefa,'options':{'where':{'uniqueid':_0x1b9d4e},'order':[['id',_0xb63b('0x5')]],'limit':0x1},'log':_0xb63b('0x6')});}; \ No newline at end of file +var _0x1633=['UpdateWhatsappQueueReport','DESC','../client','create','Request','CreateWhatsappQueueReport','update'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x1633,0x6b));var _0x3163=function(_0x4a5888,_0x5c3fde){_0x4a5888=_0x4a5888-0x0;var _0x117a90=_0x1633[_0x4a5888];return _0x117a90;};'use strict';var client=require(_0x3163('0x0'));exports[_0x3163('0x1')]=function(_0x11caef){return client[_0x3163('0x2')](_0x3163('0x3'),{'body':_0x11caef,'log':'CreateWhatsappQueueReport'});};exports[_0x3163('0x4')]=function(_0x187ac0,_0xc22c9e){return client['Request'](_0x3163('0x5'),{'body':_0xc22c9e,'options':{'where':{'uniqueid':_0x187ac0},'order':[['id',_0x3163('0x6')]],'limit':0x1},'log':_0x3163('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 17335c3..8ac0e59 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 _0xed0a=['timeout','createQueue','atimeout','channel','START:%s','end','close','rules','complete','info','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','format','[%s][AGENT][NAME:%s][STATUS:%s]','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','stop','agents','name'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xed0a,0xd3));var _0xaed0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xed0a[_0x321bb2];return _0x9c12ed;};'use strict';var schema=require(_0xaed0('0x0'));var _=require(_0xaed0('0x1'));var util=require(_0xaed0('0x2'));var seqqueue=require(_0xaed0('0x3'));var logger=require(_0xaed0('0x4'))(_0xaed0('0x5'));var strategy=require(_0xaed0('0x6'));var queue=schema({'name':{'type':_0xaed0('0x7'),'required':!![],'message':_0xaed0('0x8')},'timeout':{'type':_0xaed0('0x9'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x2dac95,_0xb7a7f6,_0x4e45bd){return logger['info'](util[_0xaed0('0xa')](_0xaed0('0xb'),_0x2dac95,_0xb7a7f6['name'],_0x4e45bd));}function handleFindAgent(_0x5c7388){return function(_0x172a8d){return _0x172a8d['name']['toLowerCase']()===_0x5c7388[_0xaed0('0xc')]();};}exports[_0xaed0('0xd')]=function(_0x3834db,_0x2c287c,_0x1fa8d2,_0x35012f){return function(_0x767141){try{var _0x46d48f={'name':_0x2c287c[0x0],'timeout':_0x2c287c[0x1]};var _0x19d25e=queue[_0xaed0('0x0')](_0x46d48f,{'typecast':!![]});if(_0x19d25e[_0xaed0('0xe')]){logger[_0xaed0('0xf')](_0xaed0('0x10'),_0x3834db,_[_0xaed0('0x11')](_0x19d25e,_0xaed0('0x12'))[_0xaed0('0x13')](',\x20'));_0x767141[_0xaed0('0x14')]();}else{var _0x2d0483=_['find'](_0x1fa8d2[_0xaed0('0x15')],handleFindAgent(_0x46d48f[_0xaed0('0x16')]));if(_0x2d0483){var _0x3465f3=(_0x46d48f[_0xaed0('0x17')]||0xa)*0x3e8;var _0xc42bba,_0x428577;var _0x1e9be4=seqqueue[_0xaed0('0x18')](_0x3465f3);_0x1e9be4['id']=_0x3834db;_0x1e9be4[_0xaed0('0x19')]=_0x3465f3;_0x1e9be4['channel']=_0x35012f[_0xaed0('0x1a')];writeLog(_0x3834db,_0x2d0483,util[_0xaed0('0xa')](_0xaed0('0x1b'),_0x3465f3));_0x1fa8d2['rules'][_0x3834db]['on'](_0xaed0('0x1c'),function(){logger['info']('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x3834db);clearTimeout(_0x428577);_0x428577=undefined;_0x1e9be4[_0xaed0('0x1d')]();if(_0x1fa8d2[_0xaed0('0x1e')][_0x3834db]){delete _0x1fa8d2[_0xaed0('0x1e')][_0x3834db];}_0x767141[_0xaed0('0x14')]();});_0x1fa8d2['rules'][_0x3834db]['on'](_0xaed0('0x1f'),function(){if(_0x1fa8d2[_0xaed0('0x1e')][_0x3834db]){delete _0x1fa8d2[_0xaed0('0x1e')][_0x3834db];}});_0x428577=setTimeout(function(){logger[_0xaed0('0x20')](_0xaed0('0x21'),_0x3834db);clearTimeout(_0x428577);_0x1e9be4[_0xaed0('0x1d')]();_0x767141[_0xaed0('0x22')]();},_0x3465f3);strategy[_0xaed0('0x23')](_0x1e9be4,_0x2d0483,_0x1fa8d2,_0x35012f);}else{logger[_0xaed0('0xf')](_0xaed0('0x24'),_0x3834db,_0x46d48f[_0xaed0('0x16')]);_0x767141[_0xaed0('0x14')]();}}}catch(_0x21e874){console[_0xaed0('0x25')](_0x21e874);logger['error']('[%s][QUEUE]\x20%s',_0x3834db,_0x21e874[_0xaed0('0x26')]);_0x767141['stop']();}};}; \ No newline at end of file +var _0xf008=['seq-queue','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','[%s][AGENT]\x20%s','map','message','join','stop','agents','timeout','createQueue','channel','START:%s','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][AGENT]\x20ROUTING\x20END','agent','error','[%s][QUEUE]\x20%s','stack','validate','util'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xf008,0x152));var _0x8f00=function(_0xa11493,_0x4683cc){_0xa11493=_0xa11493-0x0;var _0x4f46d9=_0xf008[_0xa11493];return _0x4f46d9;};'use strict';var schema=require(_0x8f00('0x0'));var _=require('lodash');var util=require(_0x8f00('0x1'));var seqqueue=require(_0x8f00('0x2'));var logger=require('../../../../config/logger')(_0x8f00('0x3'));var strategy=require(_0x8f00('0x4'));var queue=schema({'name':{'type':_0x8f00('0x5'),'required':!![],'message':_0x8f00('0x6')},'timeout':{'type':_0x8f00('0x7'),'message':_0x8f00('0x8')}});function writeLog(_0xc52384,_0x20a401,_0x118b45){return logger[_0x8f00('0x9')](util['format'](_0x8f00('0xa'),_0xc52384,_0x20a401[_0x8f00('0xb')],_0x118b45));}function handleFindAgent(_0x156fc5){return function(_0x25e986){return _0x25e986['name'][_0x8f00('0xc')]()===_0x156fc5['toLowerCase']();};}exports[_0x8f00('0xd')]=function(_0x2088ec,_0x28307c,_0x29b362,_0x5627a3){return function(_0x3c124f){try{var _0x178978={'name':_0x28307c[0x0],'timeout':_0x28307c[0x1]};var _0x44e6f9=queue[_0x8f00('0x0')](_0x178978,{'typecast':!![]});if(_0x44e6f9['length']){logger['error'](_0x8f00('0xe'),_0x2088ec,_[_0x8f00('0xf')](_0x44e6f9,_0x8f00('0x10'))[_0x8f00('0x11')](',\x20'));_0x3c124f[_0x8f00('0x12')]();}else{var _0x44bfcd=_['find'](_0x29b362[_0x8f00('0x13')],handleFindAgent(_0x178978[_0x8f00('0xb')]));if(_0x44bfcd){var _0x15be9c=(_0x178978[_0x8f00('0x14')]||0xa)*0x3e8;var _0x69364f,_0x55412a;var _0x5ddd4c=seqqueue[_0x8f00('0x15')](_0x15be9c);_0x5ddd4c['id']=_0x2088ec;_0x5ddd4c['atimeout']=_0x15be9c;_0x5ddd4c[_0x8f00('0x16')]=_0x5627a3['channel'];writeLog(_0x2088ec,_0x44bfcd,util['format'](_0x8f00('0x17'),_0x15be9c));_0x29b362['rules'][_0x2088ec]['on'](_0x8f00('0x18'),function(){logger[_0x8f00('0x9')](_0x8f00('0x19'),_0x2088ec);clearTimeout(_0x55412a);_0x55412a=undefined;_0x5ddd4c[_0x8f00('0x1a')]();if(_0x29b362[_0x8f00('0x1b')][_0x2088ec]){delete _0x29b362[_0x8f00('0x1b')][_0x2088ec];}_0x3c124f[_0x8f00('0x12')]();});_0x29b362[_0x8f00('0x1b')][_0x2088ec]['on'](_0x8f00('0x1c'),function(){if(_0x29b362[_0x8f00('0x1b')][_0x2088ec]){delete _0x29b362['rules'][_0x2088ec];}});_0x55412a=setTimeout(function(){logger[_0x8f00('0x9')](_0x8f00('0x1d'),_0x2088ec);clearTimeout(_0x55412a);_0x5ddd4c[_0x8f00('0x1a')]();_0x3c124f['next']();},_0x15be9c);strategy[_0x8f00('0x1e')](_0x5ddd4c,_0x44bfcd,_0x29b362,_0x5627a3);}else{logger[_0x8f00('0x1f')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x2088ec,_0x178978[_0x8f00('0xb')]);_0x3c124f[_0x8f00('0x12')]();}}}catch(_0x173b41){console['log'](_0x173b41);logger[_0x8f00('0x1f')](_0x8f00('0x20'),_0x2088ec,_0x173b41[_0x8f00('0x21')]);_0x3c124f[_0x8f00('0x12')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 5a4709a..231049a 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 _0x51cd=['providerResponse','dialogState','Failed','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','interaction','chat','ChatWebsiteId','upperFirst','AccountId','isEmpty','body','Message','create','then','catch','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerName'];(function(_0x97c6ea,_0x4cffce){var _0x2d7f50=function(_0x54010e){while(--_0x54010e){_0x97c6ea['push'](_0x97c6ea['shift']());}};_0x2d7f50(++_0x4cffce);}(_0x51cd,0x90));var _0xd51c=function(_0x542c2d,_0x5ec895){_0x542c2d=_0x542c2d-0x0;var _0x2cd0fa=_0x51cd[_0x542c2d];return _0x2cd0fa;};'use strict';var _=require('lodash');var moment=require(_0xd51c('0x0'));var AWS=require('aws-sdk');var utils=require(_0xd51c('0x1'));var logger=require(_0xd51c('0x2'))(_0xd51c('0x3'));var rpc={'chatMessage':require(_0xd51c('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xd51c('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xd51c('0x6'))};exports[_0xd51c('0x7')]=function(_0x4f586e,_0x362935){return function(_0x1217fd){try{if(!_[_0xd51c('0x8')](this['interaction'][_0xd51c('0x9')])){logger[_0xd51c('0xa')](_0xd51c('0xb'),_0x4f586e,_0xd51c('0xc'));return _0x1217fd[_0xd51c('0xd')]();}var _0x1e7a15={'ContactId':this[_0xd51c('0xe')]['id'],'sentAt':moment()[_0xd51c('0xf')](_0xd51c('0x10')),'direction':_0xd51c('0x11')};if(this[_0xd51c('0x12')]===_0xd51c('0x13')||this[_0xd51c('0x12')]===_0xd51c('0x14')){_0x1e7a15[_0xd51c('0x15')]=this[_0xd51c('0x16')][_0xd51c('0x15')];}var _0x502bb4=this['channel'];if(_0x502bb4===_0xd51c('0x17')){_0x1e7a15[_0xd51c('0x18')]=this['account']['id'];}else{_0x1e7a15[_[_0xd51c('0x19')](_0x502bb4)+_0xd51c('0x1a')]=this['account']['id'];}_0x1e7a15[_['upperFirst'](_0x502bb4)+'InteractionId']=this[_0xd51c('0x16')]['id'];if(this['interaction']['created']){var _0x1287c7=_0x362935[0x4];if(!_[_0xd51c('0x1b')](_0x1287c7)){_0x1e7a15[_0xd51c('0x1c')]=utils['getMustacheRender'](_0x1287c7,this);return rpc[_0x502bb4+_0xd51c('0x1d')][_0xd51c('0x1e')](_0x1e7a15)[_0xd51c('0x1f')](function(_0x3cce61){logger[_0xd51c('0xa')](_0xd51c('0xb'),_0x4f586e,_0x1e7a15[_0xd51c('0x1c')]);})[_0xd51c('0x20')](function(_0x500302){logger[_0xd51c('0x21')](_0xd51c('0xb'),_0x4f586e,JSON[_0xd51c('0x22')](_0x500302));})['finally'](function(){logger[_0xd51c('0xa')](_0xd51c('0x23'),_0x4f586e);_0x1217fd[_0xd51c('0x24')]();});}else{logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x4f586e);_0x1217fd[_0xd51c('0x24')]();}}else{var _0x11aeb6=this;var _0x73b202=new AWS[(_0xd51c('0x25'))]({'accessKeyId':_0x362935[0x0],'secretAccessKey':_0x362935[0x1],'region':_0x362935[0x2]});var _0x1d829c={'botAlias':_0xd51c('0x26'),'botName':_0x362935[0x3],'inputText':this[_0xd51c('0x27')][_0xd51c('0x1c')],'userId':this[_0xd51c('0x12')]+':'+this['interaction']['id'][_0xd51c('0x28')]()};_0x73b202[_0xd51c('0x29')](_0x1d829c,function(_0x1c14f2,_0x20fc2){if(_0x1c14f2){logger[_0xd51c('0x21')](_0xd51c('0xb'),_0x4f586e,_0x1c14f2['message']);_0x1217fd['next']();}else if(_0x20fc2&&_0x20fc2[_0xd51c('0x27')]){_0x11aeb6[_0xd51c('0x1c')][_0xd51c('0x2a')]=_0x20fc2;_0x1e7a15[_0xd51c('0x1c')]=_0x20fc2['message'];_0x1e7a15[_0xd51c('0x2b')]=_0xd51c('0x2a');_0x1e7a15[_0xd51c('0x2c')]=JSON[_0xd51c('0x22')](_0x20fc2);return rpc[_0x502bb4+_0xd51c('0x1d')]['create'](_0x1e7a15)[_0xd51c('0x1f')](function(_0x5ee75c){logger[_0xd51c('0xa')]('[%s][AMAZONLEX]\x20%s',_0x4f586e,_0x1e7a15['body']);if(_0x20fc2[_0xd51c('0x2d')]==_0xd51c('0x2e')){_0x1217fd[_0xd51c('0xd')]();}else{_0x1217fd[_0xd51c('0x24')]();}})[_0xd51c('0x20')](function(_0x4fe4b5){logger['error'](_0xd51c('0xb'),_0x4f586e,JSON[_0xd51c('0x22')](_0x4fe4b5));_0x1217fd['next']();});}else{_0x1217fd[_0xd51c('0xd')]();}});}}catch(_0x32366){logger[_0xd51c('0x21')](_0xd51c('0xb'),_0x4f586e,JSON['stringify'](_0x32366));_0x1217fd[_0xd51c('0x24')]();}};}; \ No newline at end of file +var _0x2802=['../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','account','AccountId','upperFirst','InteractionId','interaction','created','isEmpty','body','getMustacheRender','Message','create','then','info','catch','error','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','toString','postText','amazonlex','providerResponse','stringify','dialogState','Failed','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage'];(function(_0xce3a0b,_0x5b271b){var _0x1ca1b9=function(_0x1acd40){while(--_0x1acd40){_0xce3a0b['push'](_0xce3a0b['shift']());}};_0x1ca1b9(++_0x5b271b);}(_0x2802,0x1aa));var _0x2280=function(_0x55fa03,_0xcb96c2){_0x55fa03=_0x55fa03-0x0;var _0x2cd7cd=_0x2802[_0x55fa03];return _0x2cd7cd;};'use strict';var _=require(_0x2280('0x0'));var moment=require(_0x2280('0x1'));var AWS=require('aws-sdk');var utils=require(_0x2280('0x2'));var logger=require(_0x2280('0x3'))(_0x2280('0x4'));var rpc={'chatMessage':require(_0x2280('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x2280('0x6')),'whatsappMessage':require(_0x2280('0x7'))};exports[_0x2280('0x8')]=function(_0xeedcb0,_0x5a990e){return function(_0x5f0355){try{if(!_['isNil'](this['interaction'][_0x2280('0x9')])){logger['info'](_0x2280('0xa'),_0xeedcb0,_0x2280('0xb'));return _0x5f0355[_0x2280('0xc')]();}var _0x42a9f5={'ContactId':this[_0x2280('0xd')]['id'],'sentAt':moment()[_0x2280('0xe')](_0x2280('0xf')),'direction':_0x2280('0x10')};if(this[_0x2280('0x11')]==='sms'||this[_0x2280('0x11')]===_0x2280('0x12')){_0x42a9f5[_0x2280('0x13')]=this['interaction'][_0x2280('0x13')];}var _0x51c125=this['channel'];if(_0x51c125===_0x2280('0x14')){_0x42a9f5['ChatWebsiteId']=this[_0x2280('0x15')]['id'];}else{_0x42a9f5[_['upperFirst'](_0x51c125)+_0x2280('0x16')]=this[_0x2280('0x15')]['id'];}_0x42a9f5[_[_0x2280('0x17')](_0x51c125)+_0x2280('0x18')]=this[_0x2280('0x19')]['id'];if(this[_0x2280('0x19')][_0x2280('0x1a')]){var _0x54e2b4=_0x5a990e[0x4];if(!_[_0x2280('0x1b')](_0x54e2b4)){_0x42a9f5[_0x2280('0x1c')]=utils[_0x2280('0x1d')](_0x54e2b4,this);return rpc[_0x51c125+_0x2280('0x1e')][_0x2280('0x1f')](_0x42a9f5)[_0x2280('0x20')](function(_0x1c88eb){logger[_0x2280('0x21')](_0x2280('0xa'),_0xeedcb0,_0x42a9f5[_0x2280('0x1c')]);})[_0x2280('0x22')](function(_0x4edd05){logger[_0x2280('0x23')](_0x2280('0xa'),_0xeedcb0,JSON['stringify'](_0x4edd05));})['finally'](function(){logger[_0x2280('0x21')](_0x2280('0x24'),_0xeedcb0);_0x5f0355[_0x2280('0x25')]();});}else{logger[_0x2280('0x21')](_0x2280('0x26'),_0xeedcb0);_0x5f0355[_0x2280('0x25')]();}}else{var _0x33a78c=this;var _0x54b13a=new AWS['LexRuntime']({'accessKeyId':_0x5a990e[0x0],'secretAccessKey':_0x5a990e[0x1],'region':_0x5a990e[0x2]});var _0x5afaf4={'botAlias':_0x2280('0x27'),'botName':_0x5a990e[0x3],'inputText':this[_0x2280('0x28')][_0x2280('0x1c')],'userId':this[_0x2280('0x11')]+':'+this[_0x2280('0x19')]['id'][_0x2280('0x29')]()};_0x54b13a[_0x2280('0x2a')](_0x5afaf4,function(_0x1559ca,_0x1af1bb){if(_0x1559ca){logger['error']('[%s][AMAZONLEX]\x20%s',_0xeedcb0,_0x1559ca[_0x2280('0x28')]);_0x5f0355[_0x2280('0xc')]();}else if(_0x1af1bb&&_0x1af1bb[_0x2280('0x28')]){_0x33a78c[_0x2280('0x1c')][_0x2280('0x2b')]=_0x1af1bb;_0x42a9f5[_0x2280('0x1c')]=_0x1af1bb[_0x2280('0x28')];_0x42a9f5['providerName']=_0x2280('0x2b');_0x42a9f5[_0x2280('0x2c')]=JSON[_0x2280('0x2d')](_0x1af1bb);return rpc[_0x51c125+_0x2280('0x1e')]['create'](_0x42a9f5)[_0x2280('0x20')](function(_0x5e3981){logger[_0x2280('0x21')](_0x2280('0xa'),_0xeedcb0,_0x42a9f5[_0x2280('0x1c')]);if(_0x1af1bb[_0x2280('0x2e')]==_0x2280('0x2f')){_0x5f0355[_0x2280('0xc')]();}else{_0x5f0355['stop']();}})[_0x2280('0x22')](function(_0x53d452){logger['error']('[%s][AMAZONLEX]\x20%s',_0xeedcb0,JSON['stringify'](_0x53d452));_0x5f0355[_0x2280('0xc')]();});}else{_0x5f0355[_0x2280('0xc')]();}});}}catch(_0x4f08eb){logger['error'](_0x2280('0xa'),_0xeedcb0,JSON['stringify'](_0x4f08eb));_0x5f0355['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 20ba42d..55802ab 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 _0xb1c9=['headers','All','auto_reply','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','channel','mail','body','isAutoreply','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','Message','Smtp','service','host','port','secure','authentication','auth','user','pass','inReplyTo','messageId','html','replace',''];(function(_0x2929f5,_0x585578){var _0x3f460e=function(_0x18e2ad){while(--_0x18e2ad){_0x2929f5['push'](_0x2929f5['shift']());}};_0x3f460e(++_0x585578);}(_0xb1c9,0x158));var _0x9b1c=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xb1c9[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x9b1c('0x0'));var moment=require(_0x9b1c('0x1'));var utils=require(_0x9b1c('0x2'));var logger=require(_0x9b1c('0x3'))(_0x9b1c('0x4'));var rpc={'chatMessage':require(_0x9b1c('0x5')),'openchannelMessage':require(_0x9b1c('0x6')),'mailMessage':require(_0x9b1c('0x7')),'smsMessage':require(_0x9b1c('0x8')),'faxMessage':require(_0x9b1c('0x9')),'whatsappMessage':require(_0x9b1c('0xa')),'chatInteraction':require(_0x9b1c('0xb')),'openchannelInteraction':require(_0x9b1c('0xc')),'mailInteraction':require(_0x9b1c('0xd')),'smsInteraction':require(_0x9b1c('0xe')),'faxInteraction':require(_0x9b1c('0xf')),'whatsappInteraction':require(_0x9b1c('0x10'))};var mailRpc=require('../../mailRpc');exports[_0x9b1c('0x11')]=function(_0xbe8f0b,_0x425392,_0x132989,_0x2083f8){return function(_0x14615a){try{var _0x3aa2b3=this[_0x9b1c('0x12')];if(_0x3aa2b3===_0x9b1c('0x13')&&_0x2083f8[_0x9b1c('0x14')][_0x9b1c('0x15')]){logger[_0x9b1c('0x16')]('[%s][AUTOREPLY]\x20%s',_0xbe8f0b,_0x9b1c('0x17'));return _0x14615a[_0x9b1c('0x18')]();}if(_0x425392[0x0]==='1'&&(_[_0x9b1c('0x19')](this[_0x9b1c('0x1a')][_0x9b1c('0x1b')])||!this[_0x9b1c('0x1a')][_0x9b1c('0x1b')])){logger[_0x9b1c('0x16')](_0x9b1c('0x1c'),_0xbe8f0b,_0x9b1c('0x1d'));return _0x14615a[_0x9b1c('0x18')]();}if(_0x425392[0x0]==='2'&&this[_0x9b1c('0x1a')][_0x9b1c('0x1e')]){logger['info'](_0x9b1c('0x1f'),_0xbe8f0b,'One\x20Time\x20already\x20sent');return _0x14615a[_0x9b1c('0x18')]();}var _0x4fbbe7={'ContactId':this[_0x9b1c('0x20')]['id'],'sentAt':moment()[_0x9b1c('0x21')](_0x9b1c('0x22')),'direction':_0x9b1c('0x23')};if(this[_0x9b1c('0x12')]===_0x9b1c('0x13')){_0x4fbbe7[_0x9b1c('0x14')]=utils[_0x9b1c('0x24')](_0x425392[0x2],this);}else{_0x4fbbe7[_0x9b1c('0x14')]=utils[_0x9b1c('0x24')](_0x425392[0x1],this);}if(this[_0x9b1c('0x25')]){_0x4fbbe7['to']=this[_0x9b1c('0x25')]['from']||'';if(this[_0x9b1c('0x12')]===_0x9b1c('0x13')&&_0x425392[0x1]==='1'){_0x4fbbe7['cc']=this[_0x9b1c('0x25')]['cc']||'';}_0x4fbbe7[_0x9b1c('0x26')]=this[_0x9b1c('0x25')]['to']||'';_0x4fbbe7[_0x9b1c('0x27')]=this['message'][_0x9b1c('0x27')]||'';_0x4fbbe7['read']=!![];if(this['message'][_0x9b1c('0x28')]){_0x4fbbe7[_0x9b1c('0x28')]='';_0x4fbbe7[_0x9b1c('0x28')]+=_[_0x9b1c('0x29')](this['message'][_0x9b1c('0x28')],_0x9b1c('0x2a'))?'':_0x9b1c('0x2b');_0x4fbbe7[_0x9b1c('0x28')]+=this[_0x9b1c('0x25')][_0x9b1c('0x28')];}}if(this[_0x9b1c('0x12')]===_0x9b1c('0x2c')){_0x4fbbe7[_0x9b1c('0x2d')]=this[_0x9b1c('0x2e')]['id'];}else{_0x4fbbe7[_['upperFirst'](this[_0x9b1c('0x12')])+_0x9b1c('0x2f')]=this[_0x9b1c('0x2e')]['id'];}_0x4fbbe7[_[_0x9b1c('0x30')](this['channel'])+_0x9b1c('0x31')]=this[_0x9b1c('0x1a')]['id'];var _0x553c37=this['interaction'];if(rpc[this[_0x9b1c('0x12')]+_0x9b1c('0x32')]){if(this[_0x9b1c('0x12')]===_0x9b1c('0x13')){var _0x435422={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0x9b1c('0x33')][_0x9b1c('0x34')]){_0x435422['service']=this[_0x9b1c('0x2e')][_0x9b1c('0x33')]['service'];}else{_0x435422[_0x9b1c('0x35')]=this[_0x9b1c('0x2e')][_0x9b1c('0x33')][_0x9b1c('0x35')];_0x435422[_0x9b1c('0x36')]=this[_0x9b1c('0x2e')][_0x9b1c('0x33')]['port'];_0x435422['secure']=this[_0x9b1c('0x2e')][_0x9b1c('0x33')][_0x9b1c('0x37')];}if(this['account'][_0x9b1c('0x33')][_0x9b1c('0x38')]){_0x435422[_0x9b1c('0x39')]={'user':this['account'][_0x9b1c('0x33')][_0x9b1c('0x3a')],'pass':this[_0x9b1c('0x2e')]['Smtp'][_0x9b1c('0x3b')]};}_0x4fbbe7[_0x9b1c('0x3c')]=this[_0x9b1c('0x25')][_0x9b1c('0x3d')];_0x4fbbe7[_0x9b1c('0x3e')]=''+_[_0x9b1c('0x3f')](_0x4fbbe7[_0x9b1c('0x14')],'','replace','','headers','auto-replied','All','then','create','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../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','out','getMustacheRender','message','from','phone','subject','startsWith','Re:','Re:\x20','chat','account','upperFirst','AccountId','InteractionId','Message','Smtp','service','host','port','secure','auth','user'];(function(_0x26c19d,_0x3f7b9b){var _0x37d676=function(_0x4d091e){while(--_0x4d091e){_0x26c19d['push'](_0x26c19d['shift']());}};_0x37d676(++_0x3f7b9b);}(_0x026a,0x14f));var _0xa026=function(_0x13b07a,_0x49cfc3){_0x13b07a=_0x13b07a-0x0;var _0xdcbe0=_0x026a[_0x13b07a];return _0xdcbe0;};'use strict';var _=require(_0xa026('0x0'));var moment=require(_0xa026('0x1'));var utils=require(_0xa026('0x2'));var logger=require(_0xa026('0x3'))(_0xa026('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xa026('0x5')),'smsMessage':require(_0xa026('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xa026('0x7')),'chatInteraction':require(_0xa026('0x8')),'openchannelInteraction':require(_0xa026('0x9')),'mailInteraction':require(_0xa026('0xa')),'smsInteraction':require(_0xa026('0xb')),'faxInteraction':require(_0xa026('0xc')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0xa026('0xd'));exports[_0xa026('0xe')]=function(_0x462d82,_0x4a29c8,_0x43f5b1,_0x4ed04e){return function(_0x373c13){try{var _0xf23448=this[_0xa026('0xf')];if(_0xf23448===_0xa026('0x10')&&_0x4ed04e[_0xa026('0x11')][_0xa026('0x12')]){logger[_0xa026('0x13')](_0xa026('0x14'),_0x462d82,_0xa026('0x15'));return _0x373c13[_0xa026('0x16')]();}if(_0x4a29c8[0x0]==='1'&&(_[_0xa026('0x17')](this[_0xa026('0x18')]['created'])||!this[_0xa026('0x18')][_0xa026('0x19')])){logger['info']('[%s][AUTOREPLY]\x20%s',_0x462d82,_0xa026('0x1a'));return _0x373c13[_0xa026('0x16')]();}if(_0x4a29c8[0x0]==='2'&&this[_0xa026('0x18')][_0xa026('0x1b')]){logger[_0xa026('0x13')](_0xa026('0x1c'),_0x462d82,_0xa026('0x1d'));return _0x373c13[_0xa026('0x16')]();}var _0x324c21={'ContactId':this[_0xa026('0x1e')]['id'],'sentAt':moment()[_0xa026('0x1f')](_0xa026('0x20')),'direction':_0xa026('0x21')};if(this[_0xa026('0xf')]===_0xa026('0x10')){_0x324c21[_0xa026('0x11')]=utils[_0xa026('0x22')](_0x4a29c8[0x2],this);}else{_0x324c21[_0xa026('0x11')]=utils['getMustacheRender'](_0x4a29c8[0x1],this);}if(this[_0xa026('0x23')]){_0x324c21['to']=this[_0xa026('0x23')][_0xa026('0x24')]||'';if(this['channel']===_0xa026('0x10')&&_0x4a29c8[0x1]==='1'){_0x324c21['cc']=this[_0xa026('0x23')]['cc']||'';}_0x324c21['from']=this['message']['to']||'';_0x324c21[_0xa026('0x25')]=this['message']['phone']||'';_0x324c21['read']=!![];if(this[_0xa026('0x23')][_0xa026('0x26')]){_0x324c21[_0xa026('0x26')]='';_0x324c21['subject']+=_[_0xa026('0x27')](this[_0xa026('0x23')][_0xa026('0x26')],_0xa026('0x28'))?'':_0xa026('0x29');_0x324c21[_0xa026('0x26')]+=this[_0xa026('0x23')][_0xa026('0x26')];}}if(this[_0xa026('0xf')]===_0xa026('0x2a')){_0x324c21['ChatWebsiteId']=this[_0xa026('0x2b')]['id'];}else{_0x324c21[_[_0xa026('0x2c')](this[_0xa026('0xf')])+_0xa026('0x2d')]=this[_0xa026('0x2b')]['id'];}_0x324c21[_[_0xa026('0x2c')](this[_0xa026('0xf')])+_0xa026('0x2e')]=this[_0xa026('0x18')]['id'];var _0x34c99d=this[_0xa026('0x18')];if(rpc[this['channel']+_0xa026('0x2f')]){if(this[_0xa026('0xf')]===_0xa026('0x10')){var _0x344c29={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0xa026('0x30')][_0xa026('0x31')]){_0x344c29[_0xa026('0x31')]=this[_0xa026('0x2b')][_0xa026('0x30')]['service'];}else{_0x344c29[_0xa026('0x32')]=this[_0xa026('0x2b')][_0xa026('0x30')]['host'];_0x344c29['port']=this['account'][_0xa026('0x30')][_0xa026('0x33')];_0x344c29['secure']=this['account'][_0xa026('0x30')][_0xa026('0x34')];}if(this[_0xa026('0x2b')][_0xa026('0x30')]['authentication']){_0x344c29[_0xa026('0x35')]={'user':this[_0xa026('0x2b')][_0xa026('0x30')][_0xa026('0x36')],'pass':this['account'][_0xa026('0x30')][_0xa026('0x37')]};}_0x324c21[_0xa026('0x38')]=this['message'][_0xa026('0x39')];_0x324c21[_0xa026('0x3a')]=_0xa026('0x3b')+_[_0xa026('0x3c')](_0x324c21[_0xa026('0x11')],_0xa026('0x3d'),_0xa026('0x3e'))+_0xa026('0x3f');_0x324c21[_0xa026('0x40')]={'Auto-Submitted':_0xa026('0x41'),'X-Auto-Response-Suppress':_0xa026('0x42'),'Precedence':'auto_reply'};return mailRpc['sendMailMessage'](_0x344c29,_0x324c21)[_0xa026('0x43')](function(_0x1f1ac4){logger['info']('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x462d82);_0x324c21[_0xa026('0x39')]=_0x1f1ac4[_0xa026('0x23')][_0xa026('0x39')];return rpc[_0xf23448+_0xa026('0x2f')][_0xa026('0x44')](_0x324c21);})[_0xa026('0x43')](function(_0x537948){logger['info'](_0xa026('0x14'),_0x462d82,JSON[_0xa026('0x45')](_0x537948));})['catch'](function(_0x1d9289){logger[_0xa026('0x46')](_0xa026('0x47'),_0x462d82,JSON[_0xa026('0x45')](_0x1d9289));})[_0xa026('0x48')](function(){Promise[_0xa026('0x49')]()[_0xa026('0x43')](function(){if(_0x4a29c8[0x0]!=='2'||_0x34c99d[_0xa026('0x1b')])return;return rpc[_0xf23448+_0xa026('0x4a')]['update'](_0x34c99d['id'],{'autoreplyExecuted':!![]})[_0xa026('0x43')](function(_0x29f224){logger['info'](_0xa026('0x1c'),_0x462d82,JSON[_0xa026('0x45')](_0x29f224));})['catch'](function(_0x17098f){logger[_0xa026('0x46')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x462d82,JSON[_0xa026('0x45')](_0x17098f));});})[_0xa026('0x43')](function(){_0x373c13[_0xa026('0x16')]();});});}else{return rpc[this[_0xa026('0xf')]+'Message'][_0xa026('0x44')](_0x324c21)[_0xa026('0x43')](function(_0x290c1e){logger[_0xa026('0x13')](_0xa026('0x14'),_0x462d82,_0x324c21['body']);})['catch'](function(_0xdf4181){logger[_0xa026('0x46')](_0xa026('0x14'),_0x462d82,JSON[_0xa026('0x45')](_0xdf4181));})[_0xa026('0x48')](function(){Promise['resolve']()['then'](function(){if(_0x4a29c8[0x0]!=='2'||_0x34c99d[_0xa026('0x1b')])return;return rpc[_0xf23448+'Interaction']['update'](_0x34c99d['id'],{'autoreplyExecuted':!![]})['then'](function(_0x4200d3){logger[_0xa026('0x13')](_0xa026('0x1c'),_0x462d82,JSON['stringify'](_0x4200d3));})[_0xa026('0x4b')](function(_0x132f06){logger[_0xa026('0x46')](_0xa026('0x4c'),_0x462d82,JSON[_0xa026('0x45')](_0x132f06));});})['then'](function(){_0x373c13[_0xa026('0x16')]();});});}}}catch(_0x4c1992){logger[_0xa026('0x46')](_0xa026('0x14'),_0x462d82,JSON[_0xa026('0x45')](_0x4c1992));_0x373c13[_0xa026('0x4d')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index e9d3d51..b31b64c 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d05=['../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','channel','interaction','then','catch','[%s][CLOSE]\x20%s','stringify','finally','stop','moment'];(function(_0x2dadc5,_0x4e090c){var _0xddd04a=function(_0x5e3e8c){while(--_0x5e3e8c){_0x2dadc5['push'](_0x2dadc5['shift']());}};_0xddd04a(++_0x4e090c);}(_0x2d05,0xbc));var _0x52d0=function(_0x4c2ad3,_0x37e133){_0x4c2ad3=_0x4c2ad3-0x0;var _0x29976d=_0x2d05[_0x4c2ad3];return _0x29976d;};'use strict';var moment=require(_0x52d0('0x0'));var logger=require(_0x52d0('0x1'))(_0x52d0('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x52d0('0x3')),'smsInteraction':require(_0x52d0('0x4')),'mailInteraction':require(_0x52d0('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x52d0('0x6'))};exports[_0x52d0('0x7')]=function(_0x5dac55,_0xf33739,_0x25b8ee,_0x3b403b){return function(_0x543475){try{logger[_0x52d0('0x8')](_0x52d0('0x9'),_0x5dac55,_0xf33739[0x0]);var _0x360c02={'closed':0x1,'closedAt':moment()['format'](_0x52d0('0xa')),'closeReason':_0x52d0('0xb'),'disposition':_0xf33739[0x0]};if(rpc[_0x3b403b['channel']+_0x52d0('0xc')]){rpc[_0x3b403b[_0x52d0('0xd')]+_0x52d0('0xc')]['update'](_0x3b403b[_0x52d0('0xe')]['id'],_0x360c02)[_0x52d0('0xf')](function(_0x289a6d){logger[_0x52d0('0x8')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x5dac55,_0x3b403b[_0x52d0('0xe')]['id']);})[_0x52d0('0x10')](function(_0x1e996b){logger['error'](_0x52d0('0x11'),_0x5dac55,JSON[_0x52d0('0x12')](_0x1e996b));})[_0x52d0('0x13')](function(){_0x543475[_0x52d0('0x14')]();});}}catch(_0x5400b7){logger['error'](_0x52d0('0x11'),_0x5dac55,JSON[_0x52d0('0x12')](_0x5400b7));_0x543475[_0x52d0('0x14')]();}};}; \ No newline at end of file +var _0xd347=['../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','error','[%s][CLOSE]\x20%s','finally','stringify','stop','moment','../../../../config/logger','routing','../../rpc/openchannelInteraction'];(function(_0x46307f,_0x55db2f){var _0x5a3320=function(_0x5c7abf){while(--_0x5c7abf){_0x46307f['push'](_0x46307f['shift']());}};_0x5a3320(++_0x55db2f);}(_0xd347,0xc2));var _0x7d34=function(_0x2af15b,_0x67e18){_0x2af15b=_0x2af15b-0x0;var _0x58e37f=_0xd347[_0x2af15b];return _0x58e37f;};'use strict';var moment=require(_0x7d34('0x0'));var logger=require(_0x7d34('0x1'))(_0x7d34('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x7d34('0x3')),'smsInteraction':require(_0x7d34('0x4')),'mailInteraction':require(_0x7d34('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x7d34('0x6'))};exports['consequence']=function(_0x1444c7,_0x4e767a,_0x3f66f1,_0x16db5e){return function(_0x2781b1){try{logger['info']('[%s][CLOSE]\x20reason\x20%s',_0x1444c7,_0x4e767a[0x0]);var _0x5360ef={'closed':0x1,'closedAt':moment()[_0x7d34('0x7')](_0x7d34('0x8')),'closeReason':_0x7d34('0x9'),'disposition':_0x4e767a[0x0]};if(rpc[_0x16db5e[_0x7d34('0xa')]+_0x7d34('0xb')]){rpc[_0x16db5e[_0x7d34('0xa')]+_0x7d34('0xb')][_0x7d34('0xc')](_0x16db5e['interaction']['id'],_0x5360ef)['then'](function(_0x5c39c9){logger[_0x7d34('0xd')](_0x7d34('0xe'),_0x1444c7,_0x16db5e[_0x7d34('0xf')]['id']);})[_0x7d34('0x10')](function(_0x170ad5){logger[_0x7d34('0x11')](_0x7d34('0x12'),_0x1444c7,JSON['stringify'](_0x170ad5));})[_0x7d34('0x13')](function(){_0x2781b1['stop']();});}}catch(_0x400b46){logger[_0x7d34('0x11')](_0x7d34('0x12'),_0x1444c7,JSON[_0x7d34('0x14')](_0x400b46));_0x2781b1[_0x7d34('0x15')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index cd9a899..b586ddb 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8daf=['isNil','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','then','[%s][DIALOGFLOW]\x20%s','body','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','result','fulfillment','speech','dialogflow','providerResponse','create','info','metadata','endConversation','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence'];(function(_0x5f4940,_0x334823){var _0x5da33d=function(_0x460b4c){while(--_0x460b4c){_0x5f4940['push'](_0x5f4940['shift']());}};_0x5da33d(++_0x334823);}(_0x8daf,0x15c));var _0xf8da=function(_0x1f23b1,_0x57c83f){_0x1f23b1=_0x1f23b1-0x0;var _0x3c9197=_0x8daf[_0x1f23b1];return _0x3c9197;};'use strict';var _=require('lodash');var moment=require('moment');var apiai=require('apiai-promise');var md5=require('md5');var utils=require(_0xf8da('0x0'));var logger=require(_0xf8da('0x1'))('routing');var rpc={'chatMessage':require(_0xf8da('0x2')),'openchannelMessage':require(_0xf8da('0x3')),'mailMessage':require(_0xf8da('0x4')),'smsMessage':require(_0xf8da('0x5')),'faxMessage':require(_0xf8da('0x6')),'whatsappMessage':require(_0xf8da('0x7'))};exports[_0xf8da('0x8')]=function(_0x4565a9,_0xef5c26){return function(_0x585e0c){try{if(!_[_0xf8da('0x9')](this['interaction'][_0xf8da('0xa')])){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x4565a9,_0xf8da('0xb'));return _0x585e0c[_0xf8da('0xc')]();}var _0xbd4f48={'ContactId':this[_0xf8da('0xd')]['id'],'sentAt':moment()[_0xf8da('0xe')](_0xf8da('0xf')),'direction':_0xf8da('0x10')};if(this[_0xf8da('0x11')]==='sms'||this[_0xf8da('0x11')]===_0xf8da('0x12')){_0xbd4f48[_0xf8da('0x13')]=this[_0xf8da('0x14')]['phone'];}var _0x26deca=this['channel'];if(_0x26deca===_0xf8da('0x15')){_0xbd4f48[_0xf8da('0x16')]=this[_0xf8da('0x17')]['id'];}else{_0xbd4f48[_[_0xf8da('0x18')](_0x26deca)+_0xf8da('0x19')]=this['account']['id'];}_0xbd4f48[_[_0xf8da('0x18')](_0x26deca)+_0xf8da('0x1a')]=this[_0xf8da('0x14')]['id'];if(this[_0xf8da('0x14')][_0xf8da('0x1b')]){var _0x41257e=_0xef5c26[0x2];if(!_[_0xf8da('0x1c')](_0x41257e)){_0xbd4f48['body']=utils[_0xf8da('0x1d')](_0x41257e,this);return rpc[_0x26deca+'Message']['create'](_0xbd4f48)[_0xf8da('0x1e')](function(_0x2611c2){logger['info'](_0xf8da('0x1f'),_0x4565a9,_0xbd4f48[_0xf8da('0x20')]);})[_0xf8da('0x21')](function(_0x73afe5){logger[_0xf8da('0x22')](_0xf8da('0x1f'),_0x4565a9,JSON[_0xf8da('0x23')](_0x73afe5));})[_0xf8da('0x24')](function(){logger['info'](_0xf8da('0x25'),_0x4565a9);_0x585e0c[_0xf8da('0x26')]();});}else{logger['info'](_0xf8da('0x27'),_0x4565a9);_0x585e0c[_0xf8da('0x26')]();}}else{var _0x4ca909=this;var _0x5a295f=apiai(_0xef5c26[0x0],{'language':_0xef5c26[0x1]||'en'});return _0x5a295f[_0xf8da('0x28')](this[_0xf8da('0x29')][_0xf8da('0x20')],{'sessionId':md5(this[_0xf8da('0x14')]['id'])})['then'](function(_0x4f7ceb){_0x4ca909['body']['dialogflow']=_0x4f7ceb;_0xbd4f48[_0xf8da('0x20')]=_0x4f7ceb[_0xf8da('0x2a')][_0xf8da('0x2b')][_0xf8da('0x2c')];_0xbd4f48['providerName']=_0xf8da('0x2d');_0xbd4f48[_0xf8da('0x2e')]=JSON[_0xf8da('0x23')](_0x4f7ceb);return rpc[_0x26deca+'Message'][_0xf8da('0x2f')](_0xbd4f48)['then'](function(_0x2c0866){logger[_0xf8da('0x30')](_0xf8da('0x1f'),_0x4565a9,_0xbd4f48[_0xf8da('0x20')]);if(_0x4f7ceb[_0xf8da('0x2a')][_0xf8da('0x31')][_0xf8da('0x32')]){_0x585e0c[_0xf8da('0xc')]();}else{_0x585e0c['stop']();}})[_0xf8da('0x21')](function(_0x552ed3){logger['error'](_0xf8da('0x1f'),_0x4565a9,JSON[_0xf8da('0x23')](_0x552ed3));_0x585e0c[_0xf8da('0xc')]();});})[_0xf8da('0x21')](function(_0x41cee6){logger['error'](_0xf8da('0x1f'),_0x4565a9,_0x41cee6['message']);_0x585e0c['next']();});}}catch(_0x5eda69){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x4565a9,JSON[_0xf8da('0x23')](_0x5eda69));_0x585e0c['stop']();}};}; \ No newline at end of file +var _0x6657=['Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','chat','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','dialogflow','providerResponse','stringify','result','metadata','endConversation','message','lodash','apiai-promise','md5','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x6657,0x17f));var _0x7665=function(_0x57e14f,_0x17f93c){_0x57e14f=_0x57e14f-0x0;var _0x39fce2=_0x6657[_0x57e14f];return _0x39fce2;};'use strict';var _=require(_0x7665('0x0'));var moment=require('moment');var apiai=require(_0x7665('0x1'));var md5=require(_0x7665('0x2'));var utils=require(_0x7665('0x3'));var logger=require(_0x7665('0x4'))('routing');var rpc={'chatMessage':require(_0x7665('0x5')),'openchannelMessage':require(_0x7665('0x6')),'mailMessage':require(_0x7665('0x7')),'smsMessage':require(_0x7665('0x8')),'faxMessage':require(_0x7665('0x9')),'whatsappMessage':require(_0x7665('0xa'))};exports[_0x7665('0xb')]=function(_0x3387d8,_0x4c0b5c){return function(_0x31da89){try{if(!_[_0x7665('0xc')](this[_0x7665('0xd')][_0x7665('0xe')])){logger[_0x7665('0xf')](_0x7665('0x10'),_0x3387d8,_0x7665('0x11'));return _0x31da89[_0x7665('0x12')]();}var _0x5ca72e={'ContactId':this[_0x7665('0x13')]['id'],'sentAt':moment()[_0x7665('0x14')](_0x7665('0x15')),'direction':'out'};if(this[_0x7665('0x16')]==='sms'||this[_0x7665('0x16')]===_0x7665('0x17')){_0x5ca72e['phone']=this[_0x7665('0xd')][_0x7665('0x18')];}var _0x4dd9aa=this[_0x7665('0x16')];if(_0x4dd9aa===_0x7665('0x19')){_0x5ca72e['ChatWebsiteId']=this[_0x7665('0x1a')]['id'];}else{_0x5ca72e[_[_0x7665('0x1b')](_0x4dd9aa)+_0x7665('0x1c')]=this[_0x7665('0x1a')]['id'];}_0x5ca72e[_[_0x7665('0x1b')](_0x4dd9aa)+_0x7665('0x1d')]=this[_0x7665('0xd')]['id'];if(this[_0x7665('0xd')][_0x7665('0x1e')]){var _0x334ee6=_0x4c0b5c[0x2];if(!_[_0x7665('0x1f')](_0x334ee6)){_0x5ca72e[_0x7665('0x20')]=utils[_0x7665('0x21')](_0x334ee6,this);return rpc[_0x4dd9aa+_0x7665('0x22')][_0x7665('0x23')](_0x5ca72e)[_0x7665('0x24')](function(_0x522944){logger[_0x7665('0xf')](_0x7665('0x10'),_0x3387d8,_0x5ca72e['body']);})[_0x7665('0x25')](function(_0x2033a5){logger[_0x7665('0x26')](_0x7665('0x10'),_0x3387d8,JSON['stringify'](_0x2033a5));})[_0x7665('0x27')](function(){logger[_0x7665('0xf')](_0x7665('0x28'),_0x3387d8);_0x31da89[_0x7665('0x29')]();});}else{logger[_0x7665('0xf')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x3387d8);_0x31da89[_0x7665('0x29')]();}}else{var _0x51d577=this;var _0x37be5d=apiai(_0x4c0b5c[0x0],{'language':_0x4c0b5c[0x1]||'en'});return _0x37be5d[_0x7665('0x2a')](this['message']['body'],{'sessionId':md5(this[_0x7665('0xd')]['id'])})[_0x7665('0x24')](function(_0x4a9a25){_0x51d577[_0x7665('0x20')][_0x7665('0x2b')]=_0x4a9a25;_0x5ca72e[_0x7665('0x20')]=_0x4a9a25['result']['fulfillment']['speech'];_0x5ca72e['providerName']=_0x7665('0x2b');_0x5ca72e[_0x7665('0x2c')]=JSON[_0x7665('0x2d')](_0x4a9a25);return rpc[_0x4dd9aa+'Message'][_0x7665('0x23')](_0x5ca72e)[_0x7665('0x24')](function(_0x50bfa5){logger['info'](_0x7665('0x10'),_0x3387d8,_0x5ca72e[_0x7665('0x20')]);if(_0x4a9a25[_0x7665('0x2e')][_0x7665('0x2f')][_0x7665('0x30')]){_0x31da89[_0x7665('0x12')]();}else{_0x31da89['stop']();}})[_0x7665('0x25')](function(_0x55d046){logger['error'](_0x7665('0x10'),_0x3387d8,JSON[_0x7665('0x2d')](_0x55d046));_0x31da89[_0x7665('0x12')]();});})[_0x7665('0x25')](function(_0x264b6e){logger[_0x7665('0x26')](_0x7665('0x10'),_0x3387d8,_0x264b6e[_0x7665('0x31')]);_0x31da89[_0x7665('0x12')]();});}}catch(_0x415cb8){logger[_0x7665('0x26')](_0x7665('0x10'),_0x3387d8,JSON[_0x7665('0x2d')](_0x415cb8));_0x31da89[_0x7665('0x29')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 4b0eb12..6a3d44a 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf227=['SessionsClient','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_ENDCONVERSATION','boolValue','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerResponse','fulfillmentText','push','all','stringify','message','lodash','dialogflow','md5','moment','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','clone','body','Message','create','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','then','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','replace'];(function(_0x67f95e,_0x3ca797){var _0x538f5a=function(_0xc919e9){while(--_0xc919e9){_0x67f95e['push'](_0x67f95e['shift']());}};_0x538f5a(++_0x3ca797);}(_0xf227,0x18f));var _0x7f22=function(_0x1d01f8,_0x2018d9){_0x1d01f8=_0x1d01f8-0x0;var _0x15a72c=_0xf227[_0x1d01f8];return _0x15a72c;};'use strict';var _=require(_0x7f22('0x0'));var dialogflow=require(_0x7f22('0x1'));var md5=require(_0x7f22('0x2'));var moment=require(_0x7f22('0x3'));var Promise=require('bluebird');var logger=require('../../../../config/logger')(_0x7f22('0x4'));var utils=require(_0x7f22('0x5'));var rpc={'chatMessage':require(_0x7f22('0x6')),'openchannelMessage':require(_0x7f22('0x7')),'mailMessage':require(_0x7f22('0x8')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x7f22('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x169e33,_0x3678f1,_0x542df7,_0x1c5a0f){return new Promise(function(_0x44d809,_0x3ba4a7){var _0x298b14=_[_0x7f22('0xa')](_0x542df7);_0x298b14[_0x7f22('0xb')]=_0x1c5a0f;return rpc[_0x3678f1+_0x7f22('0xc')][_0x7f22('0xd')](_0x298b14)['then'](function(){logger[_0x7f22('0xe')](_0x7f22('0xf'),_0x169e33,_0x298b14[_0x7f22('0xb')]);_0x44d809();})[_0x7f22('0x10')](function(_0x45aa8e){logger[_0x7f22('0x11')](_0x7f22('0xf'),_0x169e33,JSON['stringify'](_0x45aa8e));_0x3ba4a7(_0x45aa8e);});});}exports[_0x7f22('0x12')]=function(_0x3a8301,_0xe9a1d4){return function(_0x5b2d9d){try{if(!_[_0x7f22('0x13')](this[_0x7f22('0x14')][_0x7f22('0x15')])){logger[_0x7f22('0xe')](_0x7f22('0xf'),_0x3a8301,_0x7f22('0x16'));return _0x5b2d9d[_0x7f22('0x17')]();}var _0x5d1c2a={'ContactId':this[_0x7f22('0x18')]['id'],'sentAt':moment()[_0x7f22('0x19')](_0x7f22('0x1a')),'direction':_0x7f22('0x1b')};if(this[_0x7f22('0x1c')]===_0x7f22('0x1d')||this[_0x7f22('0x1c')]===_0x7f22('0x1e')){_0x5d1c2a[_0x7f22('0x1f')]=this[_0x7f22('0x14')][_0x7f22('0x1f')];}var _0x1bc6cb=this[_0x7f22('0x1c')];if(_0x1bc6cb===_0x7f22('0x20')){_0x5d1c2a['ChatWebsiteId']=this[_0x7f22('0x21')]['id'];}else{_0x5d1c2a[_[_0x7f22('0x22')](_0x1bc6cb)+_0x7f22('0x23')]=this[_0x7f22('0x21')]['id'];}_0x5d1c2a[_['upperFirst'](_0x1bc6cb)+_0x7f22('0x24')]=this[_0x7f22('0x14')]['id'];if(this['interaction'][_0x7f22('0x25')]){var _0x64a528=_0xe9a1d4[0x4];if(!_[_0x7f22('0x26')](_0x64a528)){_0x5d1c2a[_0x7f22('0xb')]=utils[_0x7f22('0x27')](_0x64a528,this);return rpc[_0x1bc6cb+_0x7f22('0xc')][_0x7f22('0xd')](_0x5d1c2a)[_0x7f22('0x28')](function(_0x54e5e0){logger[_0x7f22('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x3a8301,_0x5d1c2a[_0x7f22('0xb')]);})[_0x7f22('0x10')](function(_0x186d6e){logger[_0x7f22('0x11')](_0x7f22('0xf'),_0x3a8301,JSON['stringify'](_0x186d6e));})[_0x7f22('0x29')](function(){logger[_0x7f22('0xe')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x3a8301);_0x5b2d9d['stop']();});}else{logger[_0x7f22('0xe')](_0x7f22('0x2a'),_0x3a8301);_0x5b2d9d[_0x7f22('0x2b')]();}}else{var _0x598e0f=this;var _0x35462f=_0xe9a1d4[0x2][_0x7f22('0x2c')](/\\n/g,'\x0a');var _0x12bdd7={'credentials':{'private_key':_0x35462f,'client_email':_0xe9a1d4[0x1]}};var _0x329d14=new dialogflow[(_0x7f22('0x2d'))](_0x12bdd7);var _0x389e85=_0x329d14['sessionPath'](_0xe9a1d4[0x0],md5(_0x598e0f['interaction']['id']));var _0x225915={'session':_0x389e85,'queryInput':{'text':{'text':_0x598e0f['message']['body'],'languageCode':_0xe9a1d4[0x3]||'en'}}};return _0x329d14[_0x7f22('0x2e')](_0x225915)['then'](function(_0x17ebd4){if(_0x17ebd4&&_0x17ebd4['length']){_0x598e0f[_0x7f22('0xb')][_0x7f22('0x2f')]=_0x17ebd4;var _0x3be780=_0x17ebd4[0x0];var _0x5e18d9=_0x3be780[_0x7f22('0x30')][_0x7f22('0x31')]&&_0x3be780[_0x7f22('0x30')][_0x7f22('0x31')][_0x7f22('0x32')]?_0x3be780[_0x7f22('0x30')]['diagnosticInfo'][_0x7f22('0x32')][_0x7f22('0x33')]['boolValue']:![];_0x598e0f['body'][_0x7f22('0x34')]=_0x3be780['queryResult'][_0x7f22('0x35')];_0x598e0f['body'][_0x7f22('0x36')]=_0x3be780[_0x7f22('0x30')]['allRequiredParamsPresent'];_0x598e0f['body'][_0x7f22('0x37')]=_0x3be780[_0x7f22('0x30')]['diagnosticInfo']&&_0x3be780['queryResult'][_0x7f22('0x31')][_0x7f22('0x32')]?_0x3be780[_0x7f22('0x30')][_0x7f22('0x31')][_0x7f22('0x32')][_0x7f22('0x33')][_0x7f22('0x38')]:![];_0x598e0f[_0x7f22('0xb')][_0x7f22('0x39')]=_0x3be780[_0x7f22('0x30')][_0x7f22('0x3a')][_0x7f22('0x3b')];_0x598e0f[_0x7f22('0xb')][_0x7f22('0x3c')]=_0x3be780[_0x7f22('0x30')][_0x7f22('0x3a')][_0x7f22('0x3d')];_0x598e0f['body'][_0x7f22('0x3e')]=_0x3be780[_0x7f22('0x30')][_0x7f22('0x3a')]['isFallback'];_0x598e0f[_0x7f22('0xb')][_0x7f22('0x3f')]=_0x3be780[_0x7f22('0x30')]['languageCode'];_0x598e0f[_0x7f22('0xb')][_0x7f22('0x40')]=_0x3be780['queryResult'][_0x7f22('0x41')];_0x598e0f[_0x7f22('0xb')][_0x7f22('0x42')]=_0x3be780[_0x7f22('0x30')][_0x7f22('0x43')];_0x5d1c2a['providerName']=_0x7f22('0x2f');_0x5d1c2a[_0x7f22('0x44')]=JSON['stringify'](_0x17ebd4);var _0x3c825d=[];for(var _0x7bf235=0x0;_0x7bf235<_0x17ebd4['length'];_0x7bf235++){var _0x4f9ec2=_0x17ebd4[_0x7bf235];if(_0x4f9ec2&&_0x4f9ec2[_0x7f22('0x30')]&&_0x4f9ec2[_0x7f22('0x30')][_0x7f22('0x45')]){_0x3c825d[_0x7f22('0x46')](createMessage(_0x3a8301,_0x1bc6cb,_0x5d1c2a,_0x4f9ec2[_0x7f22('0x30')]['fulfillmentText']));}}return Promise[_0x7f22('0x47')](_0x3c825d)[_0x7f22('0x28')](function(){if(_0x5e18d9){_0x5b2d9d[_0x7f22('0x17')]();}else{_0x5b2d9d[_0x7f22('0x2b')]();}})[_0x7f22('0x10')](function(_0x2efe7e){logger[_0x7f22('0x11')](_0x7f22('0xf'),_0x3a8301,JSON[_0x7f22('0x48')](_0x2efe7e));_0x5b2d9d[_0x7f22('0x17')]();});}})[_0x7f22('0x10')](function(_0x4a2e5f){logger[_0x7f22('0x11')](_0x7f22('0xf'),_0x3a8301,_0x4a2e5f[_0x7f22('0x49')]);_0x5b2d9d[_0x7f22('0x17')]();});}}catch(_0x587b61){logger[_0x7f22('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x3a8301,JSON[_0x7f22('0x48')](_0x587b61));_0x5b2d9d['stop']();}};}; \ No newline at end of file +var _0x240e=['[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','length','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','name','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','providerName','dialogflowV2','providerResponse','fulfillmentText','lodash','dialogflow','md5','../../../../config/logger','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','Message','create','then','[%s][DIALOGFLOWV2]\x20%s','body','catch','error','stringify','consequence','isNil','interaction','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','getMustacheRender','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop'];(function(_0x5bed4b,_0x4c3583){var _0xbf5560=function(_0x350ec1){while(--_0x350ec1){_0x5bed4b['push'](_0x5bed4b['shift']());}};_0xbf5560(++_0x4c3583);}(_0x240e,0x176));var _0xe240=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x240e[_0x487b0c];return _0x1adbdc;};'use strict';var _=require(_0xe240('0x0'));var dialogflow=require(_0xe240('0x1'));var md5=require(_0xe240('0x2'));var moment=require('moment');var Promise=require('bluebird');var logger=require(_0xe240('0x3'))('routing');var utils=require(_0xe240('0x4'));var rpc={'chatMessage':require(_0xe240('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xe240('0x6')),'smsMessage':require(_0xe240('0x7')),'faxMessage':require(_0xe240('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x177745,_0x421a12,_0x30c79d,_0x532c46){return new Promise(function(_0xa4c18f,_0x53e2ba){var _0x15e9cf=_['clone'](_0x30c79d);_0x15e9cf['body']=_0x532c46;return rpc[_0x421a12+_0xe240('0x9')][_0xe240('0xa')](_0x15e9cf)[_0xe240('0xb')](function(){logger['info'](_0xe240('0xc'),_0x177745,_0x15e9cf[_0xe240('0xd')]);_0xa4c18f();})[_0xe240('0xe')](function(_0x10ab3f){logger[_0xe240('0xf')](_0xe240('0xc'),_0x177745,JSON[_0xe240('0x10')](_0x10ab3f));_0x53e2ba(_0x10ab3f);});});}exports[_0xe240('0x11')]=function(_0x6390e0,_0x4bf755){return function(_0x4d4de2){try{if(!_[_0xe240('0x12')](this[_0xe240('0x13')]['UserId'])){logger[_0xe240('0x14')](_0xe240('0xc'),_0x6390e0,_0xe240('0x15'));return _0x4d4de2[_0xe240('0x16')]();}var _0x4148f9={'ContactId':this[_0xe240('0x17')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xe240('0x18')};if(this[_0xe240('0x19')]===_0xe240('0x1a')||this['channel']===_0xe240('0x1b')){_0x4148f9[_0xe240('0x1c')]=this[_0xe240('0x13')]['phone'];}var _0xb0fd24=this['channel'];if(_0xb0fd24===_0xe240('0x1d')){_0x4148f9[_0xe240('0x1e')]=this[_0xe240('0x1f')]['id'];}else{_0x4148f9[_[_0xe240('0x20')](_0xb0fd24)+'AccountId']=this[_0xe240('0x1f')]['id'];}_0x4148f9[_[_0xe240('0x20')](_0xb0fd24)+_0xe240('0x21')]=this[_0xe240('0x13')]['id'];if(this[_0xe240('0x13')][_0xe240('0x22')]){var _0x20e068=_0x4bf755[0x4];if(!_[_0xe240('0x23')](_0x20e068)){_0x4148f9['body']=utils[_0xe240('0x24')](_0x20e068,this);return rpc[_0xb0fd24+_0xe240('0x9')][_0xe240('0xa')](_0x4148f9)['then'](function(_0x4f095f){logger[_0xe240('0x14')]('[%s][DIALOGFLOWV2]\x20%s',_0x6390e0,_0x4148f9[_0xe240('0xd')]);})['catch'](function(_0x416cbf){logger[_0xe240('0xf')]('[%s][DIALOGFLOWV2]\x20%s',_0x6390e0,JSON[_0xe240('0x10')](_0x416cbf));})[_0xe240('0x25')](function(){logger['info'](_0xe240('0x26'),_0x6390e0);_0x4d4de2[_0xe240('0x27')]();});}else{logger['info'](_0xe240('0x28'),_0x6390e0);_0x4d4de2['stop']();}}else{var _0x3c429e=this;var _0x2d217e=_0x4bf755[0x2][_0xe240('0x29')](/\\n/g,'\x0a');var _0x5a629b={'credentials':{'private_key':_0x2d217e,'client_email':_0x4bf755[0x1]}};var _0x4719b1=new dialogflow[(_0xe240('0x2a'))](_0x5a629b);var _0x4bebbe=_0x4719b1[_0xe240('0x2b')](_0x4bf755[0x0],md5(_0x3c429e[_0xe240('0x13')]['id']));var _0x455f9e={'session':_0x4bebbe,'queryInput':{'text':{'text':_0x3c429e[_0xe240('0x2c')][_0xe240('0xd')],'languageCode':_0x4bf755[0x3]||'en'}}};return _0x4719b1[_0xe240('0x2d')](_0x455f9e)[_0xe240('0xb')](function(_0x4a2759){if(_0x4a2759&&_0x4a2759[_0xe240('0x2e')]){_0x3c429e[_0xe240('0xd')]['dialogflowV2']=_0x4a2759;var _0x18c47c=_0x4a2759[0x0];var _0x9e992e=_0x18c47c[_0xe240('0x2f')][_0xe240('0x30')]&&_0x18c47c[_0xe240('0x2f')][_0xe240('0x30')]['fields']?_0x18c47c[_0xe240('0x2f')][_0xe240('0x30')][_0xe240('0x31')][_0xe240('0x32')][_0xe240('0x33')]:![];_0x3c429e['body'][_0xe240('0x34')]=_0x18c47c['queryResult'][_0xe240('0x35')];_0x3c429e[_0xe240('0xd')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x18c47c[_0xe240('0x2f')]['allRequiredParamsPresent'];_0x3c429e[_0xe240('0xd')][_0xe240('0x36')]=_0x18c47c[_0xe240('0x2f')][_0xe240('0x30')]&&_0x18c47c['queryResult'][_0xe240('0x30')][_0xe240('0x31')]?_0x18c47c[_0xe240('0x2f')][_0xe240('0x30')][_0xe240('0x31')]['end_conversation'][_0xe240('0x33')]:![];_0x3c429e[_0xe240('0xd')][_0xe240('0x37')]=_0x18c47c['queryResult']['intent'][_0xe240('0x38')];_0x3c429e[_0xe240('0xd')][_0xe240('0x39')]=_0x18c47c[_0xe240('0x2f')][_0xe240('0x3a')][_0xe240('0x3b')];_0x3c429e[_0xe240('0xd')][_0xe240('0x3c')]=_0x18c47c[_0xe240('0x2f')]['intent'][_0xe240('0x3d')];_0x3c429e['body'][_0xe240('0x3e')]=_0x18c47c['queryResult']['languageCode'];_0x3c429e[_0xe240('0xd')][_0xe240('0x3f')]=_0x18c47c[_0xe240('0x2f')]['queryText'];_0x3c429e[_0xe240('0xd')][_0xe240('0x40')]=_0x18c47c[_0xe240('0x2f')]['intentDetectionConfidence'];_0x4148f9[_0xe240('0x41')]=_0xe240('0x42');_0x4148f9[_0xe240('0x43')]=JSON[_0xe240('0x10')](_0x4a2759);var _0x46dba4=[];for(var _0x504bf7=0x0;_0x504bf7<_0x4a2759[_0xe240('0x2e')];_0x504bf7++){var _0x1e1035=_0x4a2759[_0x504bf7];if(_0x1e1035&&_0x1e1035[_0xe240('0x2f')]&&_0x1e1035[_0xe240('0x2f')][_0xe240('0x44')]){_0x46dba4['push'](createMessage(_0x6390e0,_0xb0fd24,_0x4148f9,_0x1e1035[_0xe240('0x2f')]['fulfillmentText']));}}return Promise['all'](_0x46dba4)[_0xe240('0xb')](function(){if(_0x9e992e){_0x4d4de2[_0xe240('0x16')]();}else{_0x4d4de2[_0xe240('0x27')]();}})[_0xe240('0xe')](function(_0x1cd483){logger[_0xe240('0xf')](_0xe240('0xc'),_0x6390e0,JSON[_0xe240('0x10')](_0x1cd483));_0x4d4de2[_0xe240('0x16')]();});}})[_0xe240('0xe')](function(_0xbd48e6){logger[_0xe240('0xf')]('[%s][DIALOGFLOWV2]\x20%s',_0x6390e0,_0xbd48e6[_0xe240('0x2c')]);_0x4d4de2[_0xe240('0x16')]();});}}catch(_0x1341ec){logger['error'](_0xe240('0xc'),_0x6390e0,JSON[_0xe240('0x10')](_0x1341ec));_0x4d4de2[_0xe240('0x27')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 638b624..4d46009 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2e8=['validate','lodash','html-to-text','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','length','error','[%s][GOTOIF]\x20%s','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','message','stringify'];(function(_0x3f3026,_0x14ab55){var _0x3f3f8b=function(_0x4837dc){while(--_0x4837dc){_0x3f3026['push'](_0x3f3026['shift']());}};_0x3f3f8b(++_0x14ab55);}(_0xb2e8,0x15e));var _0x8b2e=function(_0x150496,_0x579813){_0x150496=_0x150496-0x0;var _0x14ef6c=_0xb2e8[_0x150496];return _0x14ef6c;};'use strict';var schema=require(_0x8b2e('0x0'));var _=require(_0x8b2e('0x1'));var htmlToText=require(_0x8b2e('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var gotoif=schema({'condition':{'type':_0x8b2e('0x3'),'required':!![],'message':_0x8b2e('0x4')},'priorityTrue':{'type':_0x8b2e('0x5'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x8b2e('0x5'),'message':_0x8b2e('0x6')}});exports[_0x8b2e('0x7')]=function(_0x2e0ff2,_0x5a8ba3){return function(_0x1fe790){try{var _0x115b8d={'condition':htmlToText[_0x8b2e('0x8')](utils['getMustacheRender'](_0x5a8ba3[0x0],this),{'wordwrap':![]})[_0x8b2e('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5a8ba3[0x1],'priorityFalse':_0x5a8ba3[0x2]};var _0x3dd3bc=gotoif[_0x8b2e('0x0')](_0x115b8d,{'typecast':!![]});if(_0x3dd3bc[_0x8b2e('0xa')]){logger[_0x8b2e('0xb')](_0x8b2e('0xc'),_0x2e0ff2,_['map'](_0x3dd3bc,'message')[_0x8b2e('0xd')](',\x20'));_0x1fe790[_0x8b2e('0xe')]();}else{try{var _0x4ce13d=eval('('+_0x115b8d[_0x8b2e('0xf')]+')');var _0x3d4de5=_0x4ce13d?_0x115b8d[_0x8b2e('0x10')]:_0x115b8d[_0x8b2e('0x11')];logger[_0x8b2e('0x12')](_0x8b2e('0x13'),_0x2e0ff2,_0x115b8d[_0x8b2e('0xf')],_0x4ce13d,_0x3d4de5||_0x8b2e('0x14'));if(_0x3d4de5){var _0x327b2e=_[_0x8b2e('0x15')](_0x1fe790['rules'](),{'p':_0x3d4de5});if(_0x327b2e>=0x0){logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x2e0ff2,_0x3d4de5||'next',_0x327b2e);_0x1fe790[_0x8b2e('0x14')](_0x327b2e);}else{logger[_0x8b2e('0x12')](_0x8b2e('0x16'),_0x2e0ff2,_0x3d4de5||_0x8b2e('0x14'));_0x1fe790[_0x8b2e('0xe')]();}}else{_0x1fe790[_0x8b2e('0x14')]();}}catch(_0x2143bd){logger[_0x8b2e('0xb')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x2e0ff2,_0x2143bd[_0x8b2e('0x17')]);_0x1fe790['stop']();}}}catch(_0x56b2a7){logger['error']('[%s][GOTOIF]\x20%s',_0x2e0ff2,JSON[_0x8b2e('0x18')](_0x56b2a7));_0x1fe790['stop']();}};}; \ No newline at end of file +var _0xb264=['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','stringify','validate','lodash','html-to-text','routing','string','number','priority\x20false\x20is\x20a\x20number','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','message','join','stop','condition','priorityTrue','priorityFalse'];(function(_0x3a9b75,_0xf7f505){var _0x2d4fa4=function(_0x4fe5de){while(--_0x4fe5de){_0x3a9b75['push'](_0x3a9b75['shift']());}};_0x2d4fa4(++_0xf7f505);}(_0xb264,0xbe));var _0x4b26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb264[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0x4b26('0x0'));var _=require(_0x4b26('0x1'));var htmlToText=require(_0x4b26('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x4b26('0x3'));var gotoif=schema({'condition':{'type':_0x4b26('0x4'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x4b26('0x5'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x4b26('0x5'),'message':_0x4b26('0x6')}});exports['consequence']=function(_0xc71555,_0x4696c7){return function(_0x34e50a){try{var _0x483aa1={'condition':htmlToText['fromString'](utils[_0x4b26('0x7')](_0x4696c7[0x0],this),{'wordwrap':![]})[_0x4b26('0x8')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4696c7[0x1],'priorityFalse':_0x4696c7[0x2]};var _0x4dea7e=gotoif[_0x4b26('0x0')](_0x483aa1,{'typecast':!![]});if(_0x4dea7e[_0x4b26('0x9')]){logger[_0x4b26('0xa')](_0x4b26('0xb'),_0xc71555,_['map'](_0x4dea7e,_0x4b26('0xc'))[_0x4b26('0xd')](',\x20'));_0x34e50a[_0x4b26('0xe')]();}else{try{var _0x2a975d=eval('('+_0x483aa1[_0x4b26('0xf')]+')');var _0x19c31e=_0x2a975d?_0x483aa1[_0x4b26('0x10')]:_0x483aa1[_0x4b26('0x11')];logger[_0x4b26('0x12')](_0x4b26('0x13'),_0xc71555,_0x483aa1[_0x4b26('0xf')],_0x2a975d,_0x19c31e||'next');if(_0x19c31e){var _0x322ebd=_[_0x4b26('0x14')](_0x34e50a[_0x4b26('0x15')](),{'p':_0x19c31e});if(_0x322ebd>=0x0){logger[_0x4b26('0x12')](_0x4b26('0x16'),_0xc71555,_0x19c31e||'next',_0x322ebd);_0x34e50a[_0x4b26('0x17')](_0x322ebd);}else{logger['info'](_0x4b26('0x18'),_0xc71555,_0x19c31e||_0x4b26('0x17'));_0x34e50a[_0x4b26('0xe')]();}}else{_0x34e50a[_0x4b26('0x17')]();}}catch(_0x489072){logger[_0x4b26('0xa')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0xc71555,_0x489072['message']);_0x34e50a[_0x4b26('0xe')]();}}}catch(_0x32d7b3){logger['error'](_0x4b26('0xb'),_0xc71555,JSON[_0x4b26('0x19')](_0x32d7b3));_0x34e50a[_0x4b26('0xe')]();}};}; \ 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 6a75e57..eb59588 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 _0x8ddc=['info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','stop'];(function(_0x8863d6,_0x4052a2){var _0x23ce92=function(_0x1dd846){while(--_0x1dd846){_0x8863d6['push'](_0x8863d6['shift']());}};_0x23ce92(++_0x4052a2);}(_0x8ddc,0x1bb));var _0xc8dd=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x8ddc[_0x521929];return _0x632436;};'use strict';var schema=require(_0xc8dd('0x0'));var _=require(_0xc8dd('0x1'));var logger=require(_0xc8dd('0x2'))(_0xc8dd('0x3'));var gotop=schema({'priority':{'type':_0xc8dd('0x4'),'required':!![],'message':_0xc8dd('0x5')}});exports[_0xc8dd('0x6')]=function(_0x3b545a,_0x4ee59d){return function(_0xd32ad6){try{var _0x4aa5c7={'priority':_0x4ee59d[0x0]};var _0x105b90=gotop[_0xc8dd('0x0')](_0x4aa5c7,{'typecast':!![]});if(_0x105b90[_0xc8dd('0x7')]){logger[_0xc8dd('0x8')](_0xc8dd('0x9'),_0x3b545a,_[_0xc8dd('0xa')](_0x105b90,_0xc8dd('0xb'))['join'](',\x20'));_0xd32ad6[_0xc8dd('0xc')]();}else{logger[_0xc8dd('0xd')](_0xc8dd('0xe'),_0x3b545a,_0x4aa5c7['priority']);if(_0x4aa5c7[_0xc8dd('0xf')]){var _0x1da230=_[_0xc8dd('0x10')](_0xd32ad6['rules'](),{'p':_0x4aa5c7[_0xc8dd('0xf')]});if(_0x1da230>=0x0){logger['info']('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3b545a,_0x4aa5c7[_0xc8dd('0xf')]||_0xc8dd('0x11'),_0x1da230);_0xd32ad6['next'](_0x1da230);}else{logger[_0xc8dd('0xd')](_0xc8dd('0x12'),_0x3b545a,_0x4aa5c7[_0xc8dd('0xf')]||'next');_0xd32ad6[_0xc8dd('0xc')]();}}else{_0xd32ad6[_0xc8dd('0x11')]();}}}catch(_0x30dbda){logger[_0xc8dd('0x8')](_0xc8dd('0x9'),_0x3b545a,JSON['stringify'](_0x30dbda));_0xd32ad6[_0xc8dd('0xc')]();}};}; \ No newline at end of file +var _0xd01b=['[%s][GOTOP]\x20priority\x20%s','priority','findIndex','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','[%s][GOTOP]\x20%s','map','stop','info'];(function(_0x47fd42,_0x4f7d3a){var _0x11ba79=function(_0x4f4996){while(--_0x4f4996){_0x47fd42['push'](_0x47fd42['shift']());}};_0x11ba79(++_0x4f7d3a);}(_0xd01b,0xf4));var _0xbd01=function(_0x2a65f9,_0x2cf7af){_0x2a65f9=_0x2a65f9-0x0;var _0x2502f0=_0xd01b[_0x2a65f9];return _0x2502f0;};'use strict';var schema=require(_0xbd01('0x0'));var _=require(_0xbd01('0x1'));var logger=require(_0xbd01('0x2'))('routing');var gotop=schema({'priority':{'type':_0xbd01('0x3'),'required':!![],'message':_0xbd01('0x4')}});exports['consequence']=function(_0x44028e,_0x1bbdb8){return function(_0x2bcd50){try{var _0x1778bb={'priority':_0x1bbdb8[0x0]};var _0x29c07a=gotop[_0xbd01('0x0')](_0x1778bb,{'typecast':!![]});if(_0x29c07a[_0xbd01('0x5')]){logger[_0xbd01('0x6')](_0xbd01('0x7'),_0x44028e,_[_0xbd01('0x8')](_0x29c07a,'message')['join'](',\x20'));_0x2bcd50[_0xbd01('0x9')]();}else{logger[_0xbd01('0xa')](_0xbd01('0xb'),_0x44028e,_0x1778bb[_0xbd01('0xc')]);if(_0x1778bb[_0xbd01('0xc')]){var _0xaf8b66=_[_0xbd01('0xd')](_0x2bcd50['rules'](),{'p':_0x1778bb[_0xbd01('0xc')]});if(_0xaf8b66>=0x0){logger[_0xbd01('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x44028e,_0x1778bb[_0xbd01('0xc')]||_0xbd01('0xe'),_0xaf8b66);_0x2bcd50[_0xbd01('0xe')](_0xaf8b66);}else{logger[_0xbd01('0xa')](_0xbd01('0xf'),_0x44028e,_0x1778bb['priority']||_0xbd01('0xe'));_0x2bcd50[_0xbd01('0x9')]();}}else{_0x2bcd50['next']();}}}catch(_0x4fa1dc){logger[_0xbd01('0x6')]('[%s][GOTOP]\x20%s',_0x44028e,JSON[_0xbd01('0x10')](_0x4fa1dc));_0x2bcd50[_0xbd01('0x9')]();}};}; \ 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 860d7df..3c4586e 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 _0x790c=['AccountId','InteractionId','Message','create','then','info','[%s][MESSAGE]\x20%s','body','catch','error','stringify','stop','lodash','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact','ChatWebsiteId','account','upperFirst','channel'];(function(_0x2daef6,_0xcac228){var _0x62d030=function(_0x26a7d6){while(--_0x26a7d6){_0x2daef6['push'](_0x2daef6['shift']());}};_0x62d030(++_0xcac228);}(_0x790c,0x106));var _0xc790=function(_0x555e23,_0x46355b){_0x555e23=_0x555e23-0x0;var _0x1c191b=_0x790c[_0x555e23];return _0x1c191b;};'use strict';var _=require(_0xc790('0x0'));var utils=require(_0xc790('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xc790('0x2')),'mailMessage':require(_0xc790('0x3')),'smsMessage':require(_0xc790('0x4')),'faxMessage':require(_0xc790('0x5')),'whatsappMessage':require(_0xc790('0x6'))};exports['consequence']=function(_0x2c1d64,_0x3a42da){return function(_0x46a8b2){try{var _0x530ec0={'body':utils[_0xc790('0x7')](_0x3a42da[0x0],this),'ContactId':this[_0xc790('0x8')]['id']};if(this['channel']==='chat'){_0x530ec0[_0xc790('0x9')]=this[_0xc790('0xa')]['id'];}else{_0x530ec0[_[_0xc790('0xb')](this[_0xc790('0xc')])+_0xc790('0xd')]=this[_0xc790('0xa')]['id'];}_0x530ec0[_[_0xc790('0xb')](this[_0xc790('0xc')])+_0xc790('0xe')]=this['interaction']['id'];if(rpc[this['channel']+_0xc790('0xf')]){return rpc[this['channel']+'Message'][_0xc790('0x10')](_0x530ec0)[_0xc790('0x11')](function(_0x43924a){logger[_0xc790('0x12')](_0xc790('0x13'),_0x2c1d64,_0x530ec0[_0xc790('0x14')]);_0x46a8b2['next']();})[_0xc790('0x15')](function(_0x13dc93){logger[_0xc790('0x16')]('[%s][MESSAGE]\x20%s',_0x2c1d64,JSON[_0xc790('0x17')](_0x13dc93));_0x46a8b2[_0xc790('0x18')]();});}}catch(_0x5f56d1){logger[_0xc790('0x16')](_0xc790('0x13'),_0x2c1d64,JSON[_0xc790('0x17')](_0x5f56d1));_0x46a8b2[_0xc790('0x18')]();}};}; \ No newline at end of file +var _0x7d4b=['account','upperFirst','AccountId','InteractionId','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact','channel','chat'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x7d4b,0x12d));var _0xb7d4=function(_0x3c459b,_0x9301b9){_0x3c459b=_0x3c459b-0x0;var _0x4be591=_0x7d4b[_0x3c459b];return _0x4be591;};'use strict';var _=require(_0xb7d4('0x0'));var utils=require(_0xb7d4('0x1'));var logger=require('../../../../config/logger')(_0xb7d4('0x2'));var rpc={'chatMessage':require(_0xb7d4('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xb7d4('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xb7d4('0x5')),'whatsappMessage':require(_0xb7d4('0x6'))};exports['consequence']=function(_0x429bb5,_0x54c387){return function(_0x54d5b3){try{var _0x368487={'body':utils[_0xb7d4('0x7')](_0x54c387[0x0],this),'ContactId':this[_0xb7d4('0x8')]['id']};if(this[_0xb7d4('0x9')]===_0xb7d4('0xa')){_0x368487['ChatWebsiteId']=this[_0xb7d4('0xb')]['id'];}else{_0x368487[_[_0xb7d4('0xc')](this['channel'])+_0xb7d4('0xd')]=this[_0xb7d4('0xb')]['id'];}_0x368487[_[_0xb7d4('0xc')](this['channel'])+_0xb7d4('0xe')]=this['interaction']['id'];if(rpc[this['channel']+_0xb7d4('0xf')]){return rpc[this[_0xb7d4('0x9')]+_0xb7d4('0xf')][_0xb7d4('0x10')](_0x368487)[_0xb7d4('0x11')](function(_0x345749){logger[_0xb7d4('0x12')](_0xb7d4('0x13'),_0x429bb5,_0x368487[_0xb7d4('0x14')]);_0x54d5b3[_0xb7d4('0x15')]();})[_0xb7d4('0x16')](function(_0x20d91f){logger[_0xb7d4('0x17')](_0xb7d4('0x13'),_0x429bb5,JSON[_0xb7d4('0x18')](_0x20d91f));_0x54d5b3[_0xb7d4('0x19')]();});}}catch(_0x4a777a){logger[_0xb7d4('0x17')]('[%s][MESSAGE]\x20%s',_0x429bb5,JSON[_0xb7d4('0x18')](_0x4a777a));_0x54d5b3[_0xb7d4('0x19')]();}};}; \ 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 8535e3f..fe90f39 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 _0x77ab=['./utils','../../../../config/logger','routing','consequence','[%s][NOOP]\x20%s','getMustacheRender','next','stringify','stop'];(function(_0x4fd767,_0x25cdca){var _0x48e469=function(_0xec9baa){while(--_0xec9baa){_0x4fd767['push'](_0x4fd767['shift']());}};_0x48e469(++_0x25cdca);}(_0x77ab,0x13b));var _0xb77a=function(_0x123c3f,_0x475b7a){_0x123c3f=_0x123c3f-0x0;var _0x1745ca=_0x77ab[_0x123c3f];return _0x1745ca;};'use strict';var utils=require(_0xb77a('0x0'));var logger=require(_0xb77a('0x1'))(_0xb77a('0x2'));exports[_0xb77a('0x3')]=function(_0x1a87c8,_0xe2186c){return function(_0x3e1724){try{logger['info'](_0xb77a('0x4'),_0x1a87c8,utils[_0xb77a('0x5')](_0xe2186c[0x0],this));_0x3e1724[_0xb77a('0x6')]();}catch(_0x139404){logger['error'](_0xb77a('0x4'),_0x1a87c8,JSON[_0xb77a('0x7')](_0x139404));_0x3e1724[_0xb77a('0x8')]();}};}; \ No newline at end of file +var _0x5a36=['info','[%s][NOOP]\x20%s','error','stringify','stop','./utils','../../../../config/logger','routing','consequence'];(function(_0x169590,_0x57ed1d){var _0x3df381=function(_0x54c46d){while(--_0x54c46d){_0x169590['push'](_0x169590['shift']());}};_0x3df381(++_0x57ed1d);}(_0x5a36,0x1eb));var _0x65a3=function(_0x57c972,_0x510be5){_0x57c972=_0x57c972-0x0;var _0x2c5861=_0x5a36[_0x57c972];return _0x2c5861;};'use strict';var utils=require(_0x65a3('0x0'));var logger=require(_0x65a3('0x1'))(_0x65a3('0x2'));exports[_0x65a3('0x3')]=function(_0x2a056a,_0x1d8443){return function(_0x5a95f9){try{logger[_0x65a3('0x4')](_0x65a3('0x5'),_0x2a056a,utils['getMustacheRender'](_0x1d8443[0x0],this));_0x5a95f9['next']();}catch(_0x2ab716){logger[_0x65a3('0x6')](_0x65a3('0x5'),_0x2a056a,JSON[_0x65a3('0x7')](_0x2ab716));_0x5a95f9[_0x65a3('0x8')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index d608f2d..e668b7b 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 _0x7b9f=['upperFirst','QueueId','channel','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','name','QueueReport','create','catch','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','error','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','createQueue','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','rules','close','next','strategy','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list'];(function(_0x27beea,_0x3bc9f4){var _0x122645=function(_0x2c848){while(--_0x2c848){_0x27beea['push'](_0x27beea['shift']());}};_0x122645(++_0x3bc9f4);}(_0x7b9f,0xc8));var _0xf7b9=function(_0x494a38,_0x135879){_0x494a38=_0x494a38-0x0;var _0x385b9a=_0x7b9f[_0x494a38];return _0x385b9a;};'use strict';var schema=require(_0xf7b9('0x0'));var _=require(_0xf7b9('0x1'));var util=require('util');var seqqueue=require(_0xf7b9('0x2'));var moment=require(_0xf7b9('0x3'));var Redis=require(_0xf7b9('0x4'));var config=require(_0xf7b9('0x5'));var logger=require(_0xf7b9('0x6'))(_0xf7b9('0x7'));var strategy=require(_0xf7b9('0x8'));config[_0xf7b9('0x9')]=_[_0xf7b9('0xa')](config[_0xf7b9('0x9')],{'host':_0xf7b9('0xb'),'port':0x18eb});var io=require(_0xf7b9('0xc'))(new Redis(config[_0xf7b9('0x9')]));var attributes=['id',_0xf7b9('0xd'),_0xf7b9('0xe'),_0xf7b9('0xf'),'from','joinAt'];function emit(_0x113333,_0x14c25a,_0x4d0413){io['to'](_0x113333)['emit'](_0x14c25a,_0x4d0413);}function emitChannelQueueInteraction(_0x406aeb,_0x3036ef,_0xaf8687,_0x147132,_0x52733c,_0x1c4718,_0x2042b6,_0x1e69c7){var _0x4d31f1=_['clone'](_0xaf8687);_0x4d31f1[_0xf7b9('0xd')]=_0x1e69c7;_0x4d31f1[_0xf7b9('0xf')]=_0x3036ef;_0x4d31f1['account']=_0x147132;_0x4d31f1['id']=_0x52733c;if(_0x1c4718){_0x2042b6[util[_0xf7b9('0x10')](_0xf7b9('0x11'),_0x406aeb)][_0x52733c]=_[_0xf7b9('0x12')](_0x4d31f1,attributes);}else{delete _0x2042b6[util['format'](_0xf7b9('0x11'),_0x406aeb)][_0x52733c];}emit(util[_0xf7b9('0x10')](_0xf7b9('0x13'),_0x406aeb,_0x3036ef),util[_0xf7b9('0x10')](_0xf7b9('0x14'),_0x406aeb,_0x1c4718?_0xf7b9('0x15'):'remove'),_['pick'](_0x4d31f1,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xf7b9('0x16')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xf7b9('0x17')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xf7b9('0x18'))};var queue=schema({'name':{'type':_0xf7b9('0x19'),'required':!![],'message':_0xf7b9('0x1a')},'timeout':{'type':'number','message':_0xf7b9('0x1b')}});function startRouting(_0x10e94d,_0x3b5dad,_0x1c8706,_0x35cc6f){if(_0x10e94d&&_0x3b5dad&&_0x1c8706){_0x3b5dad[_0xf7b9('0x1c')]+=0x1;var _0x204e98={'uniqueid':_0x10e94d,'from':_0x1c8706['body']?_0x1c8706[_0xf7b9('0x1d')][_0xf7b9('0x1e')]:'','joinAt':moment()[_0xf7b9('0x10')](_0xf7b9('0x1f')),'ContactId':_0x1c8706[_0xf7b9('0x20')]?_0x1c8706[_0xf7b9('0x20')]['id']:null,'ListId':_0x1c8706['list']?_0x1c8706[_0xf7b9('0x21')]['id']:null};_0x204e98[_[_0xf7b9('0x22')](_0x1c8706['channel'])+_0xf7b9('0x23')]=_0x3b5dad['id']||null;_0x204e98[_['upperFirst'](_0x1c8706[_0xf7b9('0x24')])+_0xf7b9('0x25')]=_0x1c8706[_0xf7b9('0x26')]?_0x1c8706['interaction']['id']:null;_0x204e98[_[_0xf7b9('0x22')](_0x1c8706[_0xf7b9('0x24')])+_0xf7b9('0x27')]=_0x1c8706[_0xf7b9('0x28')]?_0x1c8706['message']['id']:null;_0x204e98[_[_0xf7b9('0x22')](_0x1c8706[_0xf7b9('0x24')])+(_0x1c8706[_0xf7b9('0x24')]!==_0xf7b9('0x29')?_0xf7b9('0x2a'):_0xf7b9('0x2b'))]=_0x1c8706[_0xf7b9('0xe')]?_0x1c8706[_0xf7b9('0xe')]['id']:null;logger[_0xf7b9('0x2c')](util[_0xf7b9('0x10')]('[%s][START:QUEUE][NAME:%s]',_0x10e94d,_0x3b5dad[_0xf7b9('0x2d')]));emitChannelQueueInteraction(_0x1c8706[_0xf7b9('0x24')],_0x3b5dad[_0xf7b9('0x2d')],_0x204e98,_0x1c8706[_0xf7b9('0xe')][_0xf7b9('0x2d')],_0x1c8706[_0xf7b9('0x28')]['id'],!![],_0x35cc6f,_0x3b5dad['id']);if(rpc[_0x1c8706[_0xf7b9('0x24')]+'QueueReport']){return rpc[_0x1c8706[_0xf7b9('0x24')]+_0xf7b9('0x2e')][_0xf7b9('0x2f')](_0x204e98)[_0xf7b9('0x30')](function(_0x14ebaf){logger['error'](_0xf7b9('0x31'));});}}}function stopRouting(_0x12b156,_0x3c75e4,_0x1fcb6c,_0xbb01c5){if(_0x12b156&&_0x3c75e4){_0x3c75e4['waiting']-=0x1;var _0x3b81fe={'leaveAt':moment()[_0xf7b9('0x10')](_0xf7b9('0x1f')),'acceptAt':moment()[_0xf7b9('0x10')](_0xf7b9('0x1f')),'reason':_0xf7b9('0x32')};logger[_0xf7b9('0x2c')](util[_0xf7b9('0x10')](_0xf7b9('0x33'),_0x12b156,_0x3c75e4[_0xf7b9('0x2d')]));emitChannelQueueInteraction(_0x1fcb6c[_0xf7b9('0x24')],_0x3c75e4['name'],_0x1fcb6c[_0xf7b9('0x1d')],_0x1fcb6c['account'][_0xf7b9('0x2d')],_0x1fcb6c[_0xf7b9('0x28')]['id'],![],_0xbb01c5,_0x3c75e4['id']);if(rpc[_0x1fcb6c[_0xf7b9('0x24')]+'QueueReport']){return rpc[_0x1fcb6c[_0xf7b9('0x24')]+_0xf7b9('0x2e')][_0xf7b9('0x34')](_0x12b156,_0x3b81fe)['catch'](function(_0x1bc404){logger[_0xf7b9('0x35')](_0xf7b9('0x36'));});}}}function endRouting(_0x364eb8,_0x6e2ca3,_0x55803e,_0x4c1737){if(_0x364eb8&&_0x6e2ca3){_0x6e2ca3['waiting']-=0x1;var _0x46282b={'leaveAt':moment()[_0xf7b9('0x10')](_0xf7b9('0x1f')),'exitAt':moment()['format'](_0xf7b9('0x1f')),'reason':_0xf7b9('0x37')};logger[_0xf7b9('0x2c')](util[_0xf7b9('0x10')](_0xf7b9('0x38'),_0x364eb8,_0x6e2ca3[_0xf7b9('0x2d')]));emitChannelQueueInteraction(_0x55803e['channel'],_0x6e2ca3[_0xf7b9('0x2d')],_0x55803e[_0xf7b9('0x1d')],_0x55803e['account'][_0xf7b9('0x2d')],_0x55803e[_0xf7b9('0x28')]['id'],![],_0x4c1737);if(rpc[_0x55803e['channel']+_0xf7b9('0x2e')]){return rpc[_0x55803e[_0xf7b9('0x24')]+_0xf7b9('0x2e')][_0xf7b9('0x34')](_0x364eb8,_0x46282b)[_0xf7b9('0x30')](function(_0x41bd51){logger[_0xf7b9('0x35')](_0xf7b9('0x36'));});}}}function handleFindQueue(_0x209f81){return function(_0x413f46){return _0x413f46[_0xf7b9('0x2d')][_0xf7b9('0x39')]()===_0x209f81[_0xf7b9('0x39')]();};}exports[_0xf7b9('0x3a')]=function(_0x3e64ee,_0x1dfc1c,_0x4a224f,_0x274057){return function(_0x183aad){try{var _0x80e185={'name':_0x1dfc1c[0x0],'timeout':_0x1dfc1c[0x1]};var _0x37de00=queue[_0xf7b9('0x0')](_0x80e185,{'typecast':!![]});if(_0x37de00[_0xf7b9('0x3b')]){logger[_0xf7b9('0x35')](_0xf7b9('0x3c'),_0x3e64ee,_[_0xf7b9('0x3d')](_0x37de00,'message')[_0xf7b9('0x3e')](',\x20'));_0x183aad[_0xf7b9('0x3f')]();}else{var _0x5448a5=_[_0xf7b9('0x40')](_0x4a224f[_0x274057[_0xf7b9('0x24')]+'Queues'],handleFindQueue(_0x80e185[_0xf7b9('0x2d')]));if(_0x5448a5){startRouting(_0x3e64ee,_0x5448a5,_0x274057,_0x4a224f);var _0x51668d=(_0x5448a5['timeout']||0xa)*0x3e8;var _0xacdf5e=(_0x80e185[_0xf7b9('0x37')]||0x14)*0x3e8;var _0x529e09,_0x511bac;if(_0x51668d>_0xacdf5e){_0xacdf5e=_0x51668d;}var _0x46aa86=seqqueue[_0xf7b9('0x41')](_0x51668d);_0x46aa86['id']=_0x3e64ee;_0x46aa86[_0xf7b9('0x42')]=_0x51668d;_0x46aa86[_0xf7b9('0x43')]=_0xacdf5e;_0x46aa86[_0xf7b9('0x24')]=_0x274057[_0xf7b9('0x24')];_0x4a224f['rules'][_0x3e64ee]['on'](_0xf7b9('0x44'),function(){logger[_0xf7b9('0x2c')](_0xf7b9('0x45'),_0x3e64ee);stopRouting(_0x3e64ee,_0x5448a5,_0x274057,_0x4a224f);clearTimeout(_0x529e09);_0x529e09=undefined;_0x46aa86['close'](!![]);if(_0x4a224f[_0xf7b9('0x46')][_0x3e64ee]){delete _0x4a224f[_0xf7b9('0x46')][_0x3e64ee];}_0x183aad['stop']();});_0x4a224f['rules'][_0x3e64ee]['on']('complete',function(){if(_0x4a224f['rules'][_0x3e64ee]){delete _0x4a224f[_0xf7b9('0x46')][_0x3e64ee];}});_0x529e09=setTimeout(function(){logger[_0xf7b9('0x2c')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x3e64ee);endRouting(_0x3e64ee,_0x5448a5,_0x274057,_0x4a224f);clearTimeout(_0x529e09);_0x46aa86[_0xf7b9('0x47')](!![]);_0x183aad[_0xf7b9('0x48')]();},_0xacdf5e);switch(_0x5448a5[_0xf7b9('0x49')]){case'rrmemory':strategy['rrmemory'](_0x46aa86,_0x5448a5,_0x4a224f,_0x274057);break;default:strategy[_0xf7b9('0x4a')](_0x46aa86,_0x5448a5,_0x4a224f,_0x274057);}}else{logger['error'](_0xf7b9('0x4b'),_0x3e64ee,_0x80e185['name']);_0x183aad[_0xf7b9('0x3f')]();}}}catch(_0x36aa24){console[_0xf7b9('0x4c')](_0x36aa24);logger[_0xf7b9('0x35')](_0xf7b9('0x3c'),_0x3e64ee,_0x36aa24[_0xf7b9('0x4d')]);_0x183aad['stop']();}};}; \ No newline at end of file +var _0x3e70=['QueueId','channel','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','[%s][STOP:QUEUE][NAME:%s]','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','timeout','createQueue','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','next','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','defaults','localhost','queue_id','account','from','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','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst'];(function(_0x15eb76,_0x1946fb){var _0x104569=function(_0x43d6a4){while(--_0x43d6a4){_0x15eb76['push'](_0x15eb76['shift']());}};_0x104569(++_0x1946fb);}(_0x3e70,0x71));var _0x03e7=function(_0xb018e,_0x36c28a){_0xb018e=_0xb018e-0x0;var _0x4401=_0x3e70[_0xb018e];return _0x4401;};'use strict';var schema=require(_0x03e7('0x0'));var _=require(_0x03e7('0x1'));var util=require(_0x03e7('0x2'));var seqqueue=require(_0x03e7('0x3'));var moment=require(_0x03e7('0x4'));var Redis=require(_0x03e7('0x5'));var config=require(_0x03e7('0x6'));var logger=require(_0x03e7('0x7'))(_0x03e7('0x8'));var strategy=require('./strategy');config[_0x03e7('0x9')]=_[_0x03e7('0xa')](config[_0x03e7('0x9')],{'host':_0x03e7('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x03e7('0x9')]));var attributes=['id',_0x03e7('0xc'),_0x03e7('0xd'),'queue',_0x03e7('0xe'),'joinAt'];function emit(_0x10fd37,_0x74ff5a,_0x297e0a){io['to'](_0x10fd37)[_0x03e7('0xf')](_0x74ff5a,_0x297e0a);}function emitChannelQueueInteraction(_0x20e3f1,_0xde6fb7,_0x27cf82,_0x4c0e95,_0x3b18ad,_0xdbe9a3,_0x16498a,_0x10dcbc){var _0x2ac848=_[_0x03e7('0x10')](_0x27cf82);_0x2ac848[_0x03e7('0xc')]=_0x10dcbc;_0x2ac848[_0x03e7('0x11')]=_0xde6fb7;_0x2ac848[_0x03e7('0xd')]=_0x4c0e95;_0x2ac848['id']=_0x3b18ad;if(_0xdbe9a3){_0x16498a[util[_0x03e7('0x12')](_0x03e7('0x13'),_0x20e3f1)][_0x3b18ad]=_[_0x03e7('0x14')](_0x2ac848,attributes);}else{delete _0x16498a[util[_0x03e7('0x12')](_0x03e7('0x13'),_0x20e3f1)][_0x3b18ad];}emit(util[_0x03e7('0x12')](_0x03e7('0x15'),_0x20e3f1,_0xde6fb7),util[_0x03e7('0x12')](_0x03e7('0x16'),_0x20e3f1,_0xdbe9a3?_0x03e7('0x17'):_0x03e7('0x18')),_[_0x03e7('0x14')](_0x2ac848,attributes));}var rpc={'openchannelQueueReport':require(_0x03e7('0x19')),'mailQueueReport':require(_0x03e7('0x1a')),'chatQueueReport':require(_0x03e7('0x1b')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x03e7('0x1c')),'whatsappQueueReport':require(_0x03e7('0x1d'))};var queue=schema({'name':{'type':_0x03e7('0x1e'),'required':!![],'message':_0x03e7('0x1f')},'timeout':{'type':'number','message':_0x03e7('0x20')}});function startRouting(_0x255c49,_0x1b96ba,_0x4ea22c,_0x4c526d){if(_0x255c49&&_0x1b96ba&&_0x4ea22c){_0x1b96ba[_0x03e7('0x21')]+=0x1;var _0x570368={'uniqueid':_0x255c49,'from':_0x4ea22c[_0x03e7('0x22')]?_0x4ea22c[_0x03e7('0x22')][_0x03e7('0xe')]:'','joinAt':moment()['format'](_0x03e7('0x23')),'ContactId':_0x4ea22c[_0x03e7('0x24')]?_0x4ea22c[_0x03e7('0x24')]['id']:null,'ListId':_0x4ea22c[_0x03e7('0x25')]?_0x4ea22c[_0x03e7('0x25')]['id']:null};_0x570368[_[_0x03e7('0x26')](_0x4ea22c['channel'])+_0x03e7('0x27')]=_0x1b96ba['id']||null;_0x570368[_[_0x03e7('0x26')](_0x4ea22c[_0x03e7('0x28')])+'InteractionId']=_0x4ea22c[_0x03e7('0x29')]?_0x4ea22c['interaction']['id']:null;_0x570368[_[_0x03e7('0x26')](_0x4ea22c[_0x03e7('0x28')])+_0x03e7('0x2a')]=_0x4ea22c[_0x03e7('0x2b')]?_0x4ea22c[_0x03e7('0x2b')]['id']:null;_0x570368[_[_0x03e7('0x26')](_0x4ea22c[_0x03e7('0x28')])+(_0x4ea22c[_0x03e7('0x28')]!==_0x03e7('0x2c')?_0x03e7('0x2d'):_0x03e7('0x2e'))]=_0x4ea22c[_0x03e7('0xd')]?_0x4ea22c[_0x03e7('0xd')]['id']:null;logger[_0x03e7('0x2f')](util[_0x03e7('0x12')](_0x03e7('0x30'),_0x255c49,_0x1b96ba[_0x03e7('0x31')]));emitChannelQueueInteraction(_0x4ea22c[_0x03e7('0x28')],_0x1b96ba[_0x03e7('0x31')],_0x570368,_0x4ea22c[_0x03e7('0xd')][_0x03e7('0x31')],_0x4ea22c['message']['id'],!![],_0x4c526d,_0x1b96ba['id']);if(rpc[_0x4ea22c['channel']+'QueueReport']){return rpc[_0x4ea22c[_0x03e7('0x28')]+_0x03e7('0x32')][_0x03e7('0x33')](_0x570368)[_0x03e7('0x34')](function(_0x1daf42){logger[_0x03e7('0x35')](_0x03e7('0x36'));});}}}function stopRouting(_0x595adc,_0x5e164c,_0x4e404f,_0x45efcf){if(_0x595adc&&_0x5e164c){_0x5e164c[_0x03e7('0x21')]-=0x1;var _0x330ae0={'leaveAt':moment()[_0x03e7('0x12')](_0x03e7('0x23')),'acceptAt':moment()[_0x03e7('0x12')](_0x03e7('0x23')),'reason':'accepted'};logger['info'](util[_0x03e7('0x12')](_0x03e7('0x37'),_0x595adc,_0x5e164c[_0x03e7('0x31')]));emitChannelQueueInteraction(_0x4e404f[_0x03e7('0x28')],_0x5e164c[_0x03e7('0x31')],_0x4e404f['body'],_0x4e404f['account'][_0x03e7('0x31')],_0x4e404f['message']['id'],![],_0x45efcf,_0x5e164c['id']);if(rpc[_0x4e404f[_0x03e7('0x28')]+'QueueReport']){return rpc[_0x4e404f[_0x03e7('0x28')]+'QueueReport']['update'](_0x595adc,_0x330ae0)[_0x03e7('0x34')](function(_0x82edda){logger['error'](_0x03e7('0x38'));});}}}function endRouting(_0x467063,_0x8c77d1,_0x11adc4,_0x4c0b2b){if(_0x467063&&_0x8c77d1){_0x8c77d1[_0x03e7('0x21')]-=0x1;var _0x452a99={'leaveAt':moment()[_0x03e7('0x12')](_0x03e7('0x23')),'exitAt':moment()[_0x03e7('0x12')](_0x03e7('0x23')),'reason':'timeout'};logger[_0x03e7('0x2f')](util['format'](_0x03e7('0x39'),_0x467063,_0x8c77d1[_0x03e7('0x31')]));emitChannelQueueInteraction(_0x11adc4[_0x03e7('0x28')],_0x8c77d1['name'],_0x11adc4[_0x03e7('0x22')],_0x11adc4[_0x03e7('0xd')]['name'],_0x11adc4[_0x03e7('0x2b')]['id'],![],_0x4c0b2b);if(rpc[_0x11adc4[_0x03e7('0x28')]+_0x03e7('0x32')]){return rpc[_0x11adc4['channel']+_0x03e7('0x32')]['update'](_0x467063,_0x452a99)[_0x03e7('0x34')](function(_0x1c5a1a){logger['error'](_0x03e7('0x38'));});}}}function handleFindQueue(_0x505e24){return function(_0x48d04e){return _0x48d04e[_0x03e7('0x31')][_0x03e7('0x3a')]()===_0x505e24[_0x03e7('0x3a')]();};}exports[_0x03e7('0x3b')]=function(_0x486a4c,_0x3f8f43,_0x355323,_0x3884a7){return function(_0x2d2889){try{var _0x34e498={'name':_0x3f8f43[0x0],'timeout':_0x3f8f43[0x1]};var _0x48e61b=queue[_0x03e7('0x0')](_0x34e498,{'typecast':!![]});if(_0x48e61b[_0x03e7('0x3c')]){logger['error'](_0x03e7('0x3d'),_0x486a4c,_[_0x03e7('0x3e')](_0x48e61b,_0x03e7('0x2b'))[_0x03e7('0x3f')](',\x20'));_0x2d2889[_0x03e7('0x40')]();}else{var _0x43b055=_[_0x03e7('0x41')](_0x355323[_0x3884a7[_0x03e7('0x28')]+'Queues'],handleFindQueue(_0x34e498[_0x03e7('0x31')]));if(_0x43b055){startRouting(_0x486a4c,_0x43b055,_0x3884a7,_0x355323);var _0x383be0=(_0x43b055[_0x03e7('0x42')]||0xa)*0x3e8;var _0x3d4b96=(_0x34e498[_0x03e7('0x42')]||0x14)*0x3e8;var _0x2a3502,_0x3d2af5;if(_0x383be0>_0x3d4b96){_0x3d4b96=_0x383be0;}var _0x546079=seqqueue[_0x03e7('0x43')](_0x383be0);_0x546079['id']=_0x486a4c;_0x546079['atimeout']=_0x383be0;_0x546079['qtimeout']=_0x3d4b96;_0x546079[_0x03e7('0x28')]=_0x3884a7[_0x03e7('0x28')];_0x355323[_0x03e7('0x44')][_0x486a4c]['on']('end',function(){logger[_0x03e7('0x2f')](_0x03e7('0x45'),_0x486a4c);stopRouting(_0x486a4c,_0x43b055,_0x3884a7,_0x355323);clearTimeout(_0x2a3502);_0x2a3502=undefined;_0x546079[_0x03e7('0x46')](!![]);if(_0x355323['rules'][_0x486a4c]){delete _0x355323[_0x03e7('0x44')][_0x486a4c];}_0x2d2889[_0x03e7('0x40')]();});_0x355323['rules'][_0x486a4c]['on']('complete',function(){if(_0x355323['rules'][_0x486a4c]){delete _0x355323[_0x03e7('0x44')][_0x486a4c];}});_0x2a3502=setTimeout(function(){logger[_0x03e7('0x2f')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x486a4c);endRouting(_0x486a4c,_0x43b055,_0x3884a7,_0x355323);clearTimeout(_0x2a3502);_0x546079['close'](!![]);_0x2d2889[_0x03e7('0x47')]();},_0x3d4b96);switch(_0x43b055['strategy']){case _0x03e7('0x48'):strategy['rrmemory'](_0x546079,_0x43b055,_0x355323,_0x3884a7);break;default:strategy['beepall'](_0x546079,_0x43b055,_0x355323,_0x3884a7);}}else{logger['error'](_0x03e7('0x49'),_0x486a4c,_0x34e498[_0x03e7('0x31')]);_0x2d2889[_0x03e7('0x40')]();}}}catch(_0xac5595){console[_0x03e7('0x4a')](_0xac5595);logger['error']('[%s][QUEUE]\x20%s',_0x486a4c,_0xac5595[_0x03e7('0x4b')]);_0x2d2889['stop']();}};}; \ 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 b56cc8c..766ef54 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 _0xf881=['TIMEOUT','exports','lodash','uuid','routing','squeue','realtime','handleRun','handleTimeout','bind','timeout','drained','handleDrained','push','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','busy','busyQueue','showNotification','RINGING','forcedOwnership','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','notificationId','writeLog','STOP'];(function(_0x545e76,_0x1da0f4){var _0x3cd9a1=function(_0x49f3ab){while(--_0x49f3ab){_0x545e76['push'](_0x545e76['shift']());}};_0x3cd9a1(++_0x1da0f4);}(_0xf881,0x10a));var _0x1f88=function(_0x1a2a43,_0x59bd00){_0x1a2a43=_0x1a2a43-0x0;var _0x3ec17d=_0xf881[_0x1a2a43];return _0x3ec17d;};'use strict';var _=require(_0x1f88('0x0'));var uuid=require(_0x1f88('0x1'));var util=require('./util');var logger=require('../../../../../config/logger')(_0x1f88('0x2'));var Agent=function(_0x50d577,_0x42e1e2,_0xb47589,_0x2eb88a){this['notificationId']=uuid['v4']();this[_0x1f88('0x3')]=_0x50d577;this['agent']=_0x42e1e2;this[_0x1f88('0x4')]=_0xb47589;this[_0x1f88('0x2')]=_0x2eb88a;this[_0x1f88('0x3')]['push'](this[_0x1f88('0x5')]['bind'](this),this[_0x1f88('0x6')][_0x1f88('0x7')](this));this['squeue']['on'](_0x1f88('0x8'),this[_0x1f88('0x6')][_0x1f88('0x7')](this));this[_0x1f88('0x3')]['on'](_0x1f88('0x9'),this[_0x1f88('0xa')]['bind'](this));};Agent['prototype'][_0x1f88('0xb')]=function(){this[_0x1f88('0x3')][_0x1f88('0xb')](this[_0x1f88('0x5')][_0x1f88('0x7')](this),this[_0x1f88('0x6')][_0x1f88('0x7')](this));};Agent[_0x1f88('0xc')][_0x1f88('0xa')]=function(){this[_0x1f88('0x6')](!![]);};Agent[_0x1f88('0xc')][_0x1f88('0x5')]=function(_0x39ea8){logger[_0x1f88('0xd')](_0x1f88('0xe'),this['squeue']['id'],this[_0x1f88('0xf')]['id']);if(_[_0x1f88('0x10')](this['realtime'][_0x1f88('0x11')][this['agent']['id']])){logger['info'](_0x1f88('0x12'),this[_0x1f88('0x3')]['id'],this[_0x1f88('0xf')]['id']);setTimeout(this[_0x1f88('0xb')]['bind'](this),0x3e8);}else{if(this[_0x1f88('0x2')]['forcedOwnership']||util[_0x1f88('0x13')](this[_0x1f88('0x3')]['id'],this[_0x1f88('0x4')]['agents'][this['agent']['id']],this[_0x1f88('0x3')][_0x1f88('0x14')],![])){this['realtime'][_0x1f88('0x11')][this[_0x1f88('0xf')]['id']][_0x1f88('0x15')]=!![];this[_0x1f88('0x4')][_0x1f88('0x11')][this[_0x1f88('0xf')]['id']][_0x1f88('0x16')]=undefined;util[_0x1f88('0x17')](this['notificationId'],this[_0x1f88('0x3')]['id'],this[_0x1f88('0x4')]['agents'][this[_0x1f88('0xf')]['id']],null,this[_0x1f88('0x2')]);util['writeLog'](this[_0x1f88('0x3')]['id'],this[_0x1f88('0x4')][_0x1f88('0x11')][this[_0x1f88('0xf')]['id']],_0x1f88('0x18')+(this[_0x1f88('0x2')][_0x1f88('0x19')]?':FORCED':''));}else{logger[_0x1f88('0xd')](_0x1f88('0x1a'),this[_0x1f88('0x3')]['id'],this[_0x1f88('0xf')]['id']);setTimeout(this['push'][_0x1f88('0x7')](this),0x3e8);}}};Agent['prototype']['handleTimeout']=function(_0x407fc3){if(_['isNil'](this[_0x1f88('0x4')]['agents'][this[_0x1f88('0xf')]['id']])){return logger['info'](_0x1f88('0x12'),this[_0x1f88('0x3')]['id'],this['agent']['id']);}else{logger['info']('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x1f88('0x3')]['id'],this[_0x1f88('0xf')]['id']);util[_0x1f88('0x1b')](this[_0x1f88('0x1c')],this[_0x1f88('0x3')]['id'],this[_0x1f88('0x4')][_0x1f88('0x11')][this[_0x1f88('0xf')]['id']],null,this[_0x1f88('0x2')]);this[_0x1f88('0x4')]['agents'][this[_0x1f88('0xf')]['id']][_0x1f88('0x15')]=![];this[_0x1f88('0x4')][_0x1f88('0x11')][this['agent']['id']][_0x1f88('0x16')]=undefined;util[_0x1f88('0x1d')](this[_0x1f88('0x3')]['id'],this[_0x1f88('0x4')][_0x1f88('0x11')][this[_0x1f88('0xf')]['id']],_0x407fc3?_0x1f88('0x1e'):_0x1f88('0x1f'));}if(!_0x407fc3){setTimeout(this[_0x1f88('0xb')][_0x1f88('0x7')](this),0x3e8);}};function agent(_0x15dc0c,_0x54b761,_0xbbe8a,_0x37822c){return new Agent(_0x15dc0c,_0x54b761,_0xbbe8a,_0x37822c);}module[_0x1f88('0x20')]=agent; \ No newline at end of file +var _0xe1ec=['info','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','realtime','busy','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','busyQueue','STOP','TIMEOUT','exports','lodash','uuid','./util','routing','notificationId','squeue','agent','push','handleRun','handleTimeout','timeout','bind','prototype'];(function(_0xeff2c3,_0x3a5a82){var _0x2cade6=function(_0x5a26a1){while(--_0x5a26a1){_0xeff2c3['push'](_0xeff2c3['shift']());}};_0x2cade6(++_0x3a5a82);}(_0xe1ec,0x1d3));var _0xce1e=function(_0x2d72a8,_0x1496b4){_0x2d72a8=_0x2d72a8-0x0;var _0x549561=_0xe1ec[_0x2d72a8];return _0x549561;};'use strict';var _=require(_0xce1e('0x0'));var uuid=require(_0xce1e('0x1'));var util=require(_0xce1e('0x2'));var logger=require('../../../../../config/logger')(_0xce1e('0x3'));var Agent=function(_0x58c3dc,_0x53790b,_0x189e1f,_0x1feccc){this[_0xce1e('0x4')]=uuid['v4']();this[_0xce1e('0x5')]=_0x58c3dc;this[_0xce1e('0x6')]=_0x53790b;this['realtime']=_0x189e1f;this[_0xce1e('0x3')]=_0x1feccc;this[_0xce1e('0x5')][_0xce1e('0x7')](this[_0xce1e('0x8')]['bind'](this),this[_0xce1e('0x9')]['bind'](this));this[_0xce1e('0x5')]['on'](_0xce1e('0xa'),this['handleTimeout'][_0xce1e('0xb')](this));this[_0xce1e('0x5')]['on']('drained',this['handleDrained'][_0xce1e('0xb')](this));};Agent[_0xce1e('0xc')][_0xce1e('0x7')]=function(){this[_0xce1e('0x5')][_0xce1e('0x7')](this[_0xce1e('0x8')][_0xce1e('0xb')](this),this[_0xce1e('0x9')][_0xce1e('0xb')](this));};Agent[_0xce1e('0xc')]['handleDrained']=function(){this[_0xce1e('0x9')](!![]);};Agent[_0xce1e('0xc')][_0xce1e('0x8')]=function(_0x373bf6){logger[_0xce1e('0xd')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0xce1e('0x5')]['id'],this[_0xce1e('0x6')]['id']);if(_['isNil'](this['realtime'][_0xce1e('0xe')][this[_0xce1e('0x6')]['id']])){logger[_0xce1e('0xd')](_0xce1e('0xf'),this[_0xce1e('0x5')]['id'],this[_0xce1e('0x6')]['id']);setTimeout(this[_0xce1e('0x7')][_0xce1e('0xb')](this),0x3e8);}else{if(this[_0xce1e('0x3')][_0xce1e('0x10')]||util[_0xce1e('0x11')](this[_0xce1e('0x5')]['id'],this[_0xce1e('0x12')]['agents'][this[_0xce1e('0x6')]['id']],this[_0xce1e('0x5')]['channel'],![])){this[_0xce1e('0x12')][_0xce1e('0xe')][this[_0xce1e('0x6')]['id']][_0xce1e('0x13')]=!![];this[_0xce1e('0x12')]['agents'][this['agent']['id']]['busyQueue']=undefined;util['showNotification'](this[_0xce1e('0x4')],this['squeue']['id'],this[_0xce1e('0x12')]['agents'][this[_0xce1e('0x6')]['id']],null,this['routing']);util[_0xce1e('0x14')](this['squeue']['id'],this[_0xce1e('0x12')][_0xce1e('0xe')][this[_0xce1e('0x6')]['id']],_0xce1e('0x15')+(this[_0xce1e('0x3')][_0xce1e('0x10')]?_0xce1e('0x16'):''));}else{logger[_0xce1e('0xd')](_0xce1e('0x17'),this[_0xce1e('0x5')]['id'],this[_0xce1e('0x6')]['id']);setTimeout(this[_0xce1e('0x7')][_0xce1e('0xb')](this),0x3e8);}}};Agent['prototype'][_0xce1e('0x9')]=function(_0x1daf54){if(_[_0xce1e('0x18')](this[_0xce1e('0x12')]['agents'][this[_0xce1e('0x6')]['id']])){return logger[_0xce1e('0xd')](_0xce1e('0xf'),this[_0xce1e('0x5')]['id'],this[_0xce1e('0x6')]['id']);}else{logger[_0xce1e('0xd')](_0xce1e('0x19'),this['squeue']['id'],this[_0xce1e('0x6')]['id']);util['hideNotification'](this[_0xce1e('0x4')],this['squeue']['id'],this['realtime'][_0xce1e('0xe')][this[_0xce1e('0x6')]['id']],null,this['routing']);this['realtime'][_0xce1e('0xe')][this[_0xce1e('0x6')]['id']]['busy']=![];this['realtime'][_0xce1e('0xe')][this[_0xce1e('0x6')]['id']][_0xce1e('0x1a')]=undefined;util[_0xce1e('0x14')](this[_0xce1e('0x5')]['id'],this[_0xce1e('0x12')][_0xce1e('0xe')][this[_0xce1e('0x6')]['id']],_0x1daf54?_0xce1e('0x1b'):_0xce1e('0x1c'));}if(!_0x1daf54){setTimeout(this[_0xce1e('0x7')][_0xce1e('0xb')](this),0x3e8);}};function agent(_0x235846,_0x3f91e1,_0x18f64f,_0x30f97d){return new Agent(_0x235846,_0x3f91e1,_0x18f64f,_0x30f97d);}module[_0xce1e('0x1d')]=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 464bdcf..18bd67a 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 _0xc1fa=['notificationId','squeue','queue','realtime','push','handleRun','bind','handleTimeout','timeout','prototype','handleDrained','isNil','Agents','length','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','RINGING','busy','busyQueue','name','info','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','writeLog','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing'];(function(_0x3d94c9,_0x58f96d){var _0x3bbc33=function(_0x1c9b15){while(--_0x1c9b15){_0x3d94c9['push'](_0x3d94c9['shift']());}};_0x3bbc33(++_0x58f96d);}(_0xc1fa,0x83));var _0xac1f=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0xc1fa[_0x2aa0e7];return _0x1472c0;};'use strict';var _=require(_0xac1f('0x0'));var uuid=require(_0xac1f('0x1'));var util=require(_0xac1f('0x2'));var logger=require(_0xac1f('0x3'))(_0xac1f('0x4'));var Beepall=function(_0x171cd7,_0x565d7f,_0x3c1307,_0x3ad940){this[_0xac1f('0x5')]=uuid['v4']();this[_0xac1f('0x6')]=_0x171cd7;this[_0xac1f('0x7')]=_0x565d7f;this[_0xac1f('0x8')]=_0x3c1307;this[_0xac1f('0x4')]=_0x3ad940;this[_0xac1f('0x6')][_0xac1f('0x9')](this[_0xac1f('0xa')][_0xac1f('0xb')](this),this[_0xac1f('0xc')]['bind'](this));this[_0xac1f('0x6')]['on'](_0xac1f('0xd'),this[_0xac1f('0xc')][_0xac1f('0xb')](this));this[_0xac1f('0x6')]['on']('drained',this['handleDrained'][_0xac1f('0xb')](this));};Beepall['prototype']['push']=function(){this[_0xac1f('0x6')][_0xac1f('0x9')](this['handleRun'][_0xac1f('0xb')](this),this[_0xac1f('0xc')][_0xac1f('0xb')](this));};Beepall[_0xac1f('0xe')][_0xac1f('0xf')]=function(_0x2b470a){this[_0xac1f('0xc')](!![]);};Beepall[_0xac1f('0xe')][_0xac1f('0xa')]=function(_0x1ab6dc){var _0x38bb3a=!![];if(!_[_0xac1f('0x10')](this[_0xac1f('0x7')])&&!_['isNil'](this[_0xac1f('0x7')][_0xac1f('0x11')])&&this[_0xac1f('0x7')]['Agents'][_0xac1f('0x12')]>0x0){for(var _0x5c7847=0x0,_0xb825f3;_0x5c78470x0){for(var _0xd86cdb=0x0,_0x54d0c8;_0xd86cdb0x0&&_0x2bbbcb[_0x16bd22+_0x5029('0x1f')]>=_0x2bbbcb[_0x16bd22+_0x5029('0x1e')]){writeLog(_0x1eb228,_0x2bbbcb,_0x16bd22['toUpperCase']()+_0x5029('0x20'));return![];}}return!![];};exports[_0x5029('0x21')]=function(_0x5e45c4,_0x2b6d99,_0x31f0a0,_0x16ad8b,_0x4a24b9){return sendNotification(!![],_0x5e45c4,_0x2b6d99,_0x31f0a0,_0x16ad8b,_0x4a24b9);};exports[_0x5029('0x22')]=function(_0x251f99,_0xe5313e,_0x4b6f92,_0x2cedf6,_0x2bb398){return sendNotification(![],_0x251f99,_0xe5313e,_0x4b6f92,_0x2cedf6,_0x2bb398);};exports['writeLog']=writeLog; \ No newline at end of file +var _0xc6ac=['user:%s','name','split','account','notificationSound','body','queue','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','error','format','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','CurrentCapacity','Capacity','toUpperCase','showNotification','hideNotification','writeLog','lodash','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','emit'];(function(_0x375c25,_0x44da04){var _0x314fec=function(_0x4efb48){while(--_0x4efb48){_0x375c25['push'](_0x375c25['shift']());}};_0x314fec(++_0x44da04);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x402780,_0x53daa5){_0x402780=_0x402780-0x0;var _0x1e130f=_0xc6ac[_0x402780];return _0x1e130f;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var utils=require(_0xcc6a('0x2'));var Mustache=require(_0xcc6a('0x3'));var Redis=require(_0xcc6a('0x4'));var config=require(_0xcc6a('0x5'));var logger=require(_0xcc6a('0x6'))(_0xcc6a('0x7'));config[_0xcc6a('0x8')]=_[_0xcc6a('0x9')](config[_0xcc6a('0x8')],{'host':_0xcc6a('0xa'),'port':0x18eb});var io=require(_0xcc6a('0xb'))(new Redis(config[_0xcc6a('0x8')]));function emit(_0x5f3887,_0x3dd497,_0x11b919){io['to'](_0x5f3887)[_0xcc6a('0xc')](_0x3dd497,_0x11b919);}function sendNotification(_0x560cc4,_0x43e3bf,_0x210f63,_0x7806a0,_0x463ebb,_0x3eb04a){io['to'](util['format'](_0xcc6a('0xd'),_0x7806a0[_0xcc6a('0xe')]))[_0xcc6a('0xc')]('user:save',_0x7806a0);var _0x1d91a5=_0x3eb04a||{};var _0x9e9a63=_0x210f63[_0xcc6a('0xf')]('.');var _0x55af93={'uniqueid':_0x43e3bf,'channel':_0x9e9a63[0x0],'id':_0x9e9a63[0x1],'title':_0x9e9a63[0x0]+'\x20interaction','interactionId':_0x9e9a63[0x2],'queue':_0x463ebb?_0x463ebb[_0xcc6a('0xe')]:null,'sound':_0x1d91a5[_0xcc6a('0x10')][_0xcc6a('0x11')],'shake':_0x1d91a5['account']['notificationShake']};try{if(!_0x1d91a5[_0xcc6a('0x12')]){_0x1d91a5[_0xcc6a('0x12')]={};}if(_0x463ebb){_0x1d91a5[_0xcc6a('0x12')][_0xcc6a('0x13')]=_0x463ebb;}else if(_0x1d91a5[_0xcc6a('0x12')][_0xcc6a('0x13')]){delete _0x1d91a5[_0xcc6a('0x12')][_0xcc6a('0x13')];}_0x55af93['msg']=utils['getMustacheRender'](_0x1d91a5['account'][_0xcc6a('0x14')],_0x1d91a5);}catch(_0x44910f){_0x55af93[_0xcc6a('0x15')]=_0xcc6a('0x16');logger[_0xcc6a('0x17')](util[_0xcc6a('0x18')](_0xcc6a('0x19'),_0x43e3bf,_0x44910f[_0xcc6a('0x1a')]));}io['to'](util[_0xcc6a('0x18')](_0xcc6a('0xd'),_0x7806a0[_0xcc6a('0xe')]))['emit'](util[_0xcc6a('0x18')](_0xcc6a('0x1b'),_0x560cc4?_0xcc6a('0x1c'):_0xcc6a('0x1d')),_0x55af93);}function writeLog(_0x1495d8,_0x30b8ed,_0x36c80f){return logger[_0xcc6a('0x1e')](util[_0xcc6a('0x18')](_0xcc6a('0x1f'),_0x1495d8,_0x30b8ed[_0xcc6a('0xe')],_0x36c80f));}exports[_0xcc6a('0x20')]=function(_0x51be9a,_0x41c4c8,_0x3a081e,_0x38f812){if(_0x41c4c8['busy']){writeLog(_0x51be9a,_0x41c4c8,_0xcc6a('0x21'));return![];}if(!_0x41c4c8[_0xcc6a('0x22')]){writeLog(_0x51be9a,_0x41c4c8,_0xcc6a('0x23'));return![];}if(_0x41c4c8[_0x3a081e+_0xcc6a('0x24')]){writeLog(_0x51be9a,_0x41c4c8,_0xcc6a('0x25'));return![];}if(_0x38f812&&_0x41c4c8[_0xcc6a('0x26')](_0x3a081e+'Capacity')&&_0x41c4c8[_0xcc6a('0x26')](_0x3a081e+_0xcc6a('0x27'))){if(_0x41c4c8[_0x3a081e+_0xcc6a('0x28')]>0x0&&_0x41c4c8[_0x3a081e+'CurrentCapacity']>=_0x41c4c8[_0x3a081e+_0xcc6a('0x28')]){writeLog(_0x51be9a,_0x41c4c8,_0x3a081e[_0xcc6a('0x29')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0xcc6a('0x2a')]=function(_0x8b1b2b,_0x3233d1,_0x473f88,_0x5d7399,_0x194aab){return sendNotification(!![],_0x8b1b2b,_0x3233d1,_0x473f88,_0x5d7399,_0x194aab);};exports[_0xcc6a('0x2b')]=function(_0x2c6d88,_0x4f176b,_0x2590a2,_0x5308d4,_0x4f67d3){return sendNotification(![],_0x2c6d88,_0x4f176b,_0x2590a2,_0x5308d4,_0x4f67d3);};exports[_0xcc6a('0x2c')]=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 94243c0..0db3304 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 _0x5137=['[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][SYSTEM]\x20%s','map','join','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','replace','info','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','isObject'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x5137,0x1e5));var _0x7513=function(_0x1e61e3,_0x5ae917){_0x1e61e3=_0x1e61e3-0x0;var _0x10c207=_0x5137[_0x1e61e3];return _0x10c207;};'use strict';var schema=require(_0x7513('0x0'));var sh=require(_0x7513('0x1'));var _=require(_0x7513('0x2'));var utils=require('./utils');var logger=require(_0x7513('0x3'))('routing');var system=schema({'command':{'type':_0x7513('0x4'),'required':!![],'message':_0x7513('0x5')}});exports['consequence']=function(_0x1c89d0,_0x199ce0){return function(_0x4fcdc5){try{var _0x5c7bdc={'command':_0x199ce0[0x0]};var _0x1ceb08=system['validate'](_0x5c7bdc,{'typecast':!![]});if(_0x1ceb08[_0x7513('0x6')]){logger[_0x7513('0x7')](_0x7513('0x8'),_0x1c89d0,_[_0x7513('0x9')](_0x1ceb08,'message')[_0x7513('0xa')](',\x20'));logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x1c89d0);_0x4fcdc5['next']();}else{var _0x4f9e9=this;var _0x10195a=utils[_0x7513('0xb')](_0x199ce0[0x0],this);logger['info'](_0x7513('0xc'),_0x1c89d0,_0x10195a);sh[_0x7513('0xd')](_['trim'](_0x10195a),function(_0x1e97c1,_0x192495){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x1c89d0,_0x1e97c1);if(_0x1e97c1==0x0){var _0x22b40a=_0x192495[_0x7513('0xe')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x199ce0[0x1])||_['isEmpty'](_0x199ce0[0x1])){logger[_0x7513('0xf')](_0x7513('0x10'),_0x1c89d0);_0x4f9e9[_0x7513('0x11')][_0x199ce0[0x1]]=_0x22b40a;}else{logger[_0x7513('0xf')](_0x7513('0x12'),_0x1c89d0,_0x199ce0[0x1],_0x22b40a);_0x4f9e9['body'][_0x199ce0[0x1]]=_0x22b40a;}}_0x4fcdc5[_0x7513('0x13')]();});}}catch(_0xd4ebf4){logger['error'](_0x7513('0x8'),_0x1c89d0,_[_0x7513('0x14')](_0xd4ebf4)?JSON['stringify'](_0xd4ebf4):_0xd4ebf4);logger['info'](_0x7513('0x15'),_0x1c89d0);_0x4fcdc5[_0x7513('0x13')]();}};}; \ No newline at end of file +var _0xb6b1=['error','map','message','join','info','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','[%s][SYSTEM]\x20%s','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','lodash','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x5005ba,_0x423ed1){var _0x21278c=function(_0x49799b){while(--_0x49799b){_0x5005ba['push'](_0x5005ba['shift']());}};_0x21278c(++_0x423ed1);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0xb6b1[_0x4b73a2];return _0x383c66;};'use strict';var schema=require(_0x1b6b('0x0'));var sh=require('shelljs');var _=require(_0x1b6b('0x1'));var utils=require('./utils');var logger=require(_0x1b6b('0x2'))(_0x1b6b('0x3'));var system=schema({'command':{'type':'string','required':!![],'message':_0x1b6b('0x4')}});exports['consequence']=function(_0x2a2c45,_0xb1a61e){return function(_0x2c4040){try{var _0xdbbe22={'command':_0xb1a61e[0x0]};var _0x5870ca=system[_0x1b6b('0x0')](_0xdbbe22,{'typecast':!![]});if(_0x5870ca['length']){logger[_0x1b6b('0x5')]('[%s][SYSTEM]\x20%s',_0x2a2c45,_[_0x1b6b('0x6')](_0x5870ca,_0x1b6b('0x7'))[_0x1b6b('0x8')](',\x20'));logger[_0x1b6b('0x9')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x2a2c45);_0x2c4040['next']();}else{var _0x475423=this;var _0x43d9f0=utils[_0x1b6b('0xa')](_0xb1a61e[0x0],this);logger[_0x1b6b('0x9')](_0x1b6b('0xb'),_0x2a2c45,_0x43d9f0);sh[_0x1b6b('0xc')](_[_0x1b6b('0xd')](_0x43d9f0),function(_0x5d45dd,_0x360a8b){logger[_0x1b6b('0x9')](_0x1b6b('0xe'),_0x2a2c45,_0x5d45dd);if(_0x5d45dd==0x0){var _0x5abe44=_0x360a8b[_0x1b6b('0xf')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0xb1a61e[0x1])||_['isEmpty'](_0xb1a61e[0x1])){logger[_0x1b6b('0x9')](_0x1b6b('0x10'),_0x2a2c45);_0x475423[_0x1b6b('0x11')][_0xb1a61e[0x1]]=_0x5abe44;}else{logger[_0x1b6b('0x9')](_0x1b6b('0x12'),_0x2a2c45,_0xb1a61e[0x1],_0x5abe44);_0x475423[_0x1b6b('0x11')][_0xb1a61e[0x1]]=_0x5abe44;}}_0x2c4040[_0x1b6b('0x13')]();});}}catch(_0x553a6d){logger[_0x1b6b('0x5')](_0x1b6b('0x14'),_0x2a2c45,_[_0x1b6b('0x15')](_0x553a6d)?JSON[_0x1b6b('0x16')](_0x553a6d):_0x553a6d);logger['info'](_0x1b6b('0x17'),_0x2a2c45);_0x2c4040[_0x1b6b('0x13')]();}};}; \ 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 6105883..8fd44da 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 _0xeda0=['../../rpc/faxInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][TAG]\x20%s','map','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','error','stringify','finally','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction'];(function(_0x6aa402,_0xb582bb){var _0x4c86c5=function(_0x16d504){while(--_0x16d504){_0x6aa402['push'](_0x6aa402['shift']());}};_0x4c86c5(++_0xb582bb);}(_0xeda0,0x1e1));var _0x0eda=function(_0x28f2c8,_0x539559){_0x28f2c8=_0x28f2c8-0x0;var _0x14d3f8=_0xeda0[_0x28f2c8];return _0x14d3f8;};'use strict';var schema=require(_0x0eda('0x0'));var _=require(_0x0eda('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x0eda('0x2')),'smsInteraction':require(_0x0eda('0x3')),'mailInteraction':require(_0x0eda('0x4')),'faxInteraction':require(_0x0eda('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require('../../../../config/logger')(_0x0eda('0x6'));var tag=schema({'tag':{'type':_0x0eda('0x7'),'required':!![],'message':_0x0eda('0x8')}});exports[_0x0eda('0x9')]=function(_0x4b9933,_0x4f6ea5,_0x23de5e,_0x4bd9e2){return function(_0x6bb75d){try{var _0x45eaba={'tag':_0x4f6ea5[0x0]};var _0x161bdf=tag[_0x0eda('0x0')](_0x45eaba,{'typecast':!![]});if(_0x161bdf[_0x0eda('0xa')]){logger['error'](_0x0eda('0xb'),_0x4b9933,_[_0x0eda('0xc')](_0x161bdf,_0x0eda('0xd'))[_0x0eda('0xe')](',\x20'));logger['info'](_0x0eda('0xf'),_0x4b9933);_0x6bb75d[_0x0eda('0x10')]();}else{var _0x347390={'ids':[_0x4f6ea5[0x0]]};if(rpc[_0x4bd9e2[_0x0eda('0x11')]+_0x0eda('0x12')]){rpc[_0x4bd9e2[_0x0eda('0x11')]+_0x0eda('0x12')][_0x0eda('0x13')](_0x4bd9e2[_0x0eda('0x14')]['id'],_0x347390)[_0x0eda('0x15')](function(_0x5237e0){logger[_0x0eda('0x16')](_0x0eda('0x17'),_0x4b9933,_0x4f6ea5[0x1],_0x4bd9e2['channel'],_0x4bd9e2[_0x0eda('0x14')]['id']);})['catch'](function(_0x57904f){logger[_0x0eda('0x18')]('[%s][TAG]\x20%s',_0x4b9933,JSON[_0x0eda('0x19')](_0x57904f));logger[_0x0eda('0x16')](_0x0eda('0xf'),_0x4b9933);})[_0x0eda('0x1a')](function(){_0x6bb75d['next']();});}}}catch(_0x5946af){logger[_0x0eda('0x18')](_0x0eda('0xb'),_0x4b9933,_['isObject'](_0x5946af)?JSON[_0x0eda('0x19')](_0x5946af):_0x5946af);logger['info'](_0x0eda('0xf'),_0x4b9933);_0x6bb75d[_0x0eda('0x10')]();}};}; \ No newline at end of file +var _0x8b02=['catch','stringify','finally','isObject','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','validate','length','error','[%s][TAG]\x20%s','map','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s'];(function(_0x13a7a2,_0x4b625c){var _0x3c6964=function(_0x1d6145){while(--_0x1d6145){_0x13a7a2['push'](_0x13a7a2['shift']());}};_0x3c6964(++_0x4b625c);}(_0x8b02,0x1cf));var _0x28b0=function(_0x5e2020,_0xda7587){_0x5e2020=_0x5e2020-0x0;var _0xdd6f0=_0x8b02[_0x5e2020];return _0xdd6f0;};'use strict';var schema=require('validate');var _=require(_0x28b0('0x0'));var rpc={'chatInteraction':require(_0x28b0('0x1')),'openchannelInteraction':require(_0x28b0('0x2')),'smsInteraction':require(_0x28b0('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x28b0('0x4')),'whatsappInteraction':require(_0x28b0('0x5'))};var logger=require('../../../../config/logger')(_0x28b0('0x6'));var tag=schema({'tag':{'type':_0x28b0('0x7'),'required':!![],'message':_0x28b0('0x8')}});exports['consequence']=function(_0x530e67,_0x8bbf24,_0x464d43,_0x51ac42){return function(_0x2d0797){try{var _0xba524f={'tag':_0x8bbf24[0x0]};var _0x5ee760=tag[_0x28b0('0x9')](_0xba524f,{'typecast':!![]});if(_0x5ee760[_0x28b0('0xa')]){logger[_0x28b0('0xb')](_0x28b0('0xc'),_0x530e67,_[_0x28b0('0xd')](_0x5ee760,'message')[_0x28b0('0xe')](',\x20'));logger[_0x28b0('0xf')](_0x28b0('0x10'),_0x530e67);_0x2d0797[_0x28b0('0x11')]();}else{var _0x3d4e72={'ids':[_0x8bbf24[0x0]]};if(rpc[_0x51ac42[_0x28b0('0x12')]+_0x28b0('0x13')]){rpc[_0x51ac42[_0x28b0('0x12')]+'Interaction'][_0x28b0('0x14')](_0x51ac42[_0x28b0('0x15')]['id'],_0x3d4e72)['then'](function(_0x1e2b1e){logger['info'](_0x28b0('0x16'),_0x530e67,_0x8bbf24[0x1],_0x51ac42[_0x28b0('0x12')],_0x51ac42[_0x28b0('0x15')]['id']);})[_0x28b0('0x17')](function(_0x208530){logger[_0x28b0('0xb')]('[%s][TAG]\x20%s',_0x530e67,JSON[_0x28b0('0x18')](_0x208530));logger[_0x28b0('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x530e67);})[_0x28b0('0x19')](function(){_0x2d0797[_0x28b0('0x11')]();});}}}catch(_0x95c738){logger[_0x28b0('0xb')]('[%s][TAG]\x20%s',_0x530e67,_[_0x28b0('0x1a')](_0x95c738)?JSON[_0x28b0('0x18')](_0x95c738):_0x95c738);logger[_0x28b0('0xf')](_0x28b0('0x10'),_0x530e67);_0x2d0797[_0x28b0('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 7b32d54..2767002 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 _0x2c89=['jsonrpc','2.0','method','push','params','stringify','utf8','POST','application/json-rpc','then','parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','catch','[%s][TVOX]\x20%s','isObject','stop','next','request-promise','routing','replace','\x20-\x20','includes','urlOnAnswer','urlOnRing','title'];(function(_0x1d69e5,_0x2a29af){var _0x17da11=function(_0x36c61f){while(--_0x36c61f){_0x1d69e5['push'](_0x1d69e5['shift']());}};_0x17da11(++_0x2a29af);}(_0x2c89,0x1c9));var _0x92c8=function(_0x176ffa,_0x1af7de){_0x176ffa=_0x176ffa-0x0;var _0x3b9c5c=_0x2c89[_0x176ffa];return _0x3b9c5c;};'use strict';var rp=require(_0x92c8('0x0'));var logger=require('../../../../config/logger')(_0x92c8('0x1'));var _=require('lodash');var arr=[];exports['consequence']=function(_0x54e92b,_0x2ed442){return function(_0x3676b9){var _0x477f21=_0x2ed442[0xa];var _0x36bf4e=_0x2ed442[0xb];var _0x1d6c08=_0x2ed442[0xc];var _0x465185=_0x2ed442[0xd];var _0x2389e6=_0x2ed442[0xe];var _0x5756c5=_0x2ed442[0xf][_0x92c8('0x2')](/\n/g,_0x92c8('0x3'));var _0x55cd26=_0x2ed442[0x10][_0x92c8('0x2')](/\n/g,'\x20');if(!arr[_0x92c8('0x4')](_0x36bf4e)){arr['push'](_0x36bf4e);var _0x4f9cf0=_0x2ed442[0x3];var _0x415a42=_0x2ed442[0x4];var _0x27abb0=_0x2ed442[0x1];var _0x5b6060=_0x2ed442[0x0];var _0x2a2b35={};_0x2a2b35[_0x92c8('0x5')]=_0x2ed442[0x8]+'?params='+_0x1d6c08+'|'+_0x477f21+'|'+_0x465185+'|'+_0x36bf4e+'|'+_0x2389e6;_0x2a2b35[_0x92c8('0x6')]=_0x2ed442[0x7]+'?params='+_0x1d6c08+'|'+_0x477f21+'|'+_0x465185+'|'+_0x36bf4e+'|'+_0x2389e6+'|'+_0x5756c5+'|'+_0x55cd26;_0x2a2b35[_0x92c8('0x7')]=_0x2ed442[0x9];var _0x394529={};_0x394529[_0x92c8('0x8')]=_0x92c8('0x9');_0x394529[_0x92c8('0xa')]='login';var _0x3e465d=[];_0x3e465d['push'](_0x2ed442[0x2]);_0x3e465d[_0x92c8('0xb')](_0x2ed442[0x5]);_0x3e465d[_0x92c8('0xb')](_0x2ed442[0x6]);_0x394529[_0x92c8('0xc')]=_0x3e465d;_0x394529['id']=0x1;var _0x287537=JSON[_0x92c8('0xd')](_0x394529);var _0x2d4511={'encoding':_0x92c8('0xe'),'method':_0x92c8('0xf'),'timeout':0x2710,'url':_0x4f9cf0,'headers':{'Content-Type':_0x92c8('0x10')},'body':_0x287537};return rp(_0x2d4511)[_0x92c8('0x11')](function(_0x2fbe36){const _0x1b7c69=JSON[_0x92c8('0x12')](_0x2fbe36);if(!_0x1b7c69['result'][_0x92c8('0x13')]){throw new Error(_0x92c8('0x14'));}var _0xca6835=_0x36bf4e;var _0x456f58=_0x92c8('0x15')+_0x27abb0+'&serviceId='+_0x5b6060+_0x92c8('0x16')+_0xca6835+_0x92c8('0x17')+JSON[_0x92c8('0xd')](_0x2a2b35);var _0xacd560=_0x415a42+'?'+_0x456f58;return rp(_0xacd560);})['then'](function(_0x57e2ce){logger[_0x92c8('0x18')](_0x92c8('0x19'),_0x54e92b,_0x57e2ce);_0x3676b9['stop']();})[_0x92c8('0x1a')](function(_0x2792bf){logger['error'](_0x92c8('0x1b'),_0x54e92b,_[_0x92c8('0x1c')](_0x2792bf)?JSON['stringify'](_0x2792bf):_0x2792bf);_0x3676b9[_0x92c8('0x1d')]();});}else{logger[_0x92c8('0x18')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x54e92b);_0x3676b9[_0x92c8('0x1e')]();}};}; \ No newline at end of file +var _0x4639=['params','utf8','POST','then','parse','&serviceId=','&sessionId=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','error','[%s][TVOX]\x20%s','isObject','stringify','stop','next','request-promise','../../../../config/logger','routing','lodash','replace','includes','urlOnAnswer','?params=','title','jsonrpc','method','login'];(function(_0xc3aae7,_0x3bfa91){var _0x1f365a=function(_0x465838){while(--_0x465838){_0xc3aae7['push'](_0xc3aae7['shift']());}};_0x1f365a(++_0x3bfa91);}(_0x4639,0x153));var _0x9463=function(_0x2483f6,_0x70bc75){_0x2483f6=_0x2483f6-0x0;var _0x44f7b9=_0x4639[_0x2483f6];return _0x44f7b9;};'use strict';var rp=require(_0x9463('0x0'));var logger=require(_0x9463('0x1'))(_0x9463('0x2'));var _=require(_0x9463('0x3'));var arr=[];exports['consequence']=function(_0x48ed44,_0xfab252){return function(_0x567577){var _0x387fe3=_0xfab252[0xa];var _0x29f000=_0xfab252[0xb];var _0x5a7a42=_0xfab252[0xc];var _0x3cd905=_0xfab252[0xd];var _0x341c9c=_0xfab252[0xe];var _0x2b3a8a=_0xfab252[0xf][_0x9463('0x4')](/\n/g,'\x20-\x20');var _0x5926b5=_0xfab252[0x10][_0x9463('0x4')](/\n/g,'\x20');if(!arr[_0x9463('0x5')](_0x29f000)){arr['push'](_0x29f000);var _0x2a2d76=_0xfab252[0x3];var _0x64ea3e=_0xfab252[0x4];var _0x4b9317=_0xfab252[0x1];var _0x57d7c5=_0xfab252[0x0];var _0x2cfbf1={};_0x2cfbf1[_0x9463('0x6')]=_0xfab252[0x8]+_0x9463('0x7')+_0x5a7a42+'|'+_0x387fe3+'|'+_0x3cd905+'|'+_0x29f000+'|'+_0x341c9c;_0x2cfbf1['urlOnRing']=_0xfab252[0x7]+_0x9463('0x7')+_0x5a7a42+'|'+_0x387fe3+'|'+_0x3cd905+'|'+_0x29f000+'|'+_0x341c9c+'|'+_0x2b3a8a+'|'+_0x5926b5;_0x2cfbf1[_0x9463('0x8')]=_0xfab252[0x9];var _0x2837ee={};_0x2837ee[_0x9463('0x9')]='2.0';_0x2837ee[_0x9463('0xa')]=_0x9463('0xb');var _0x457d7c=[];_0x457d7c['push'](_0xfab252[0x2]);_0x457d7c['push'](_0xfab252[0x5]);_0x457d7c['push'](_0xfab252[0x6]);_0x2837ee[_0x9463('0xc')]=_0x457d7c;_0x2837ee['id']=0x1;var _0x50acc8=JSON['stringify'](_0x2837ee);var _0x373eca={'encoding':_0x9463('0xd'),'method':_0x9463('0xe'),'timeout':0x2710,'url':_0x2a2d76,'headers':{'Content-Type':'application/json-rpc'},'body':_0x50acc8};return rp(_0x373eca)[_0x9463('0xf')](function(_0x473812){const _0x1781dd=JSON[_0x9463('0x10')](_0x473812);if(!_0x1781dd['result']['logged']){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x98a976=_0x29f000;var _0xc9b488='channelId='+_0x4b9317+_0x9463('0x11')+_0x57d7c5+_0x9463('0x12')+_0x98a976+'&data='+JSON['stringify'](_0x2cfbf1);var _0x5ee08c=_0x64ea3e+'?'+_0xc9b488;return rp(_0x5ee08c);})[_0x9463('0xf')](function(_0x48b43b){logger[_0x9463('0x13')](_0x9463('0x14'),_0x48ed44,_0x48b43b);_0x567577['stop']();})['catch'](function(_0x26bac1){logger[_0x9463('0x15')](_0x9463('0x16'),_0x48ed44,_[_0x9463('0x17')](_0x26bac1)?JSON[_0x9463('0x18')](_0x26bac1):_0x26bac1);_0x567577[_0x9463('0x19')]();});}else{logger[_0x9463('0x13')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x48ed44);_0x567577[_0x9463('0x1a')]();}};}; \ 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 17602c5..ce8bb15 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x1f1a5b,_0x4d882c){var _0x518f15=function(_0x5b4657){while(--_0x5b4657){_0x1f1a5b['push'](_0x1f1a5b['shift']());}};_0x518f15(++_0x4d882c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file +var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x17882d,_0x273e6e){var _0x114475=function(_0x625a6c){while(--_0x625a6c){_0x17882d['push'](_0x17882d['shift']());}};_0x114475(++_0x273e6e);}(_0x9c44,0x178));var _0x49c4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9c44[_0x1035c1];return _0x308d67;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 975975d..48651e7 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 _0x68fc=['push','slice','dialogflow','split','dialogflowv2','amazonlex','tag','getMustacheRender','account','notificationTemplate','ChatWebsiteId','body','./interval','condition','intervals','./applications/','consequence','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','emit','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','paused','mailQueues','waiting','openchannelQueues','name','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','stringify','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','util','path','uuid','../../../config/environment','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','isArray','applications','length','existsSync','join','.js','app','toLowerCase','autoreply','appdata','mail'];(function(_0x5e76f4,_0x636835){var _0x5babd1=function(_0x3eb024){while(--_0x3eb024){_0x5e76f4['push'](_0x5e76f4['shift']());}};_0x5babd1(++_0x636835);}(_0x68fc,0xa5));var _0xc68f=function(_0x223ba4,_0x5936da){_0x223ba4=_0x223ba4-0x0;var _0x3b90d5=_0x68fc[_0x223ba4];return _0x3b90d5;};'use strict';var _=require(_0xc68f('0x0'));var util=require(_0xc68f('0x1'));var path=require(_0xc68f('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require('bluebird');var uuid=require(_0xc68f('0x3'));var utils=require('./applications/utils');var config=require(_0xc68f('0x4'));var logger=require('../../../config/logger')('routing');var rpc={'openchannelQueueReport':require(_0xc68f('0x5')),'mailQueueReport':require(_0xc68f('0x6')),'chatQueueReport':require(_0xc68f('0x7')),'smsQueueReport':require(_0xc68f('0x8')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0xc68f('0x9'));function getId(_0x2bf3fd,_0x370977,_0x17aaaa){return util[_0xc68f('0xa')](_0xc68f('0xb'),_0x2bf3fd,_0x370977||0x0,_0x17aaaa||0x0);}function getIntervals(_0x1d542b,_0x3bd373){var _0x5a8226=[];if(!_[_0xc68f('0xc')](_0x3bd373['IntervalId'])&&!_[_0xc68f('0xc')](_0x1d542b[_0x3bd373[_0xc68f('0xd')]])&&!_[_0xc68f('0xc')](_0x1d542b[_0x3bd373[_0xc68f('0xd')]][_0xc68f('0xe')])){_0x5a8226=_[_0xc68f('0xf')](_0x1d542b[_0x3bd373[_0xc68f('0xd')]][_0xc68f('0xe')],_0xc68f('0x10'));}else if(!_[_0xc68f('0xc')](_0x3bd373[_0xc68f('0x10')])){_0x5a8226=[_0x3bd373['interval']];}return _0x5a8226;}exports[_0xc68f('0x11')]=function(_0x90ccbd){_0x90ccbd[_0xc68f('0x12')]={};return new BPromise(function(_0xe6e7db,_0x286ed4){var _0x2673b4={'Start':function(_0x3d1406){var _0x209d16=this;return new Promise(function(_0x4648c6,_0x5e1e5b){if(_0x3d1406){try{var _0x541828=[];var _0x3a6c06=getId(_0x3d1406[_0xc68f('0x13')],_0x3d1406[_0xc68f('0x14')]?_0x3d1406[_0xc68f('0x14')]['id']:0x0,_0x3d1406[_0xc68f('0x15')]?_0x3d1406[_0xc68f('0x15')]['id']:0x0);if(_0x3d1406['applications']&&_[_0xc68f('0x16')](_0x3d1406[_0xc68f('0x17')])&&_0x3d1406[_0xc68f('0x17')][_0xc68f('0x18')]){for(var _0x5068fd=0x0;_0x5068fd<_0x3d1406[_0xc68f('0x17')][_0xc68f('0x18')];_0x5068fd+=0x1){var _0x3c32c8=_0x3d1406['applications'][_0x5068fd];if(fs[_0xc68f('0x19')](path[_0xc68f('0x1a')](__dirname,_0xc68f('0x17'),_0x3c32c8['app']+_0xc68f('0x1b')))){var _0x1daac5=[];switch(_0x3c32c8[_0xc68f('0x1c')][_0xc68f('0x1d')]()){case _0xc68f('0x1e'):var _0x3da6d9=_0x3c32c8[_0xc68f('0x1f')]['split'](',');if(_0x3d1406[_0xc68f('0x13')]===_0xc68f('0x20')){_0x1daac5['push'](_0x3da6d9[0x0]);_0x1daac5[_0xc68f('0x21')](_0x3da6d9[0x1]);_0x1daac5[_0xc68f('0x21')](_0x3da6d9[_0xc68f('0x22')](0x2,_0x3da6d9[_0xc68f('0x18')])[_0xc68f('0x1a')](','));}else{_0x1daac5['push'](_0x3da6d9[0x0]);_0x1daac5[_0xc68f('0x21')](_0x3da6d9[_0xc68f('0x22')](0x1,_0x3da6d9['length'])[_0xc68f('0x1a')](','));}break;case _0xc68f('0x23'):var _0x4d26e3=_0x3c32c8[_0xc68f('0x1f')][_0xc68f('0x24')](',');_0x1daac5[_0xc68f('0x21')](_0x4d26e3[0x0]);_0x1daac5[_0xc68f('0x21')](_0x4d26e3[0x1]);_0x1daac5['push'](_0x4d26e3[_0xc68f('0x22')](0x2,_0x4d26e3[_0xc68f('0x18')])[_0xc68f('0x1a')](','));break;case _0xc68f('0x25'):var _0x1ba1ac=_0x3c32c8[_0xc68f('0x1f')][_0xc68f('0x24')](',');_0x1daac5[_0xc68f('0x21')](_0x1ba1ac[0x0]);_0x1daac5['push'](_0x1ba1ac[0x1]);_0x1daac5[_0xc68f('0x21')](_0x1ba1ac[0x2]);_0x1daac5[_0xc68f('0x21')](_0x1ba1ac[0x3]);_0x1daac5['push'](_0x1ba1ac[_0xc68f('0x22')](0x4,_0x1ba1ac[_0xc68f('0x18')])[_0xc68f('0x1a')](','));break;case _0xc68f('0x26'):var _0x51e82c=_0x3c32c8[_0xc68f('0x1f')][_0xc68f('0x24')](',');_0x1daac5['push'](_0x51e82c[0x0]);_0x1daac5[_0xc68f('0x21')](_0x51e82c[0x1]);_0x1daac5[_0xc68f('0x21')](_0x51e82c[0x2]);_0x1daac5[_0xc68f('0x21')](_0x51e82c[0x3]);_0x1daac5[_0xc68f('0x21')](_0x51e82c[_0xc68f('0x22')](0x4,_0x51e82c['length'])['join'](','));break;case _0xc68f('0x14'):_0x1daac5[_0xc68f('0x21')](_0x3c32c8[_0xc68f('0x1f')]);break;case _0xc68f('0x27'):_0x1daac5[_0xc68f('0x21')](_0x3c32c8['TagId']);_0x1daac5['push'](_0x3c32c8[_0xc68f('0x1f')]);break;case'tvox':var _0x378e75=utils[_0xc68f('0x28')](_0x3d1406[_0xc68f('0x29')][_0xc68f('0x2a')],_0x3d1406);var _0x11ef0c=_0x3c32c8[_0xc68f('0x1f')][_0xc68f('0x24')](',');_0x1daac5['push'](_0x11ef0c[0x0]);_0x1daac5[_0xc68f('0x21')](_0x11ef0c[0x1]);_0x1daac5[_0xc68f('0x21')](_0x11ef0c[0x2]);_0x1daac5[_0xc68f('0x21')](_0x11ef0c[0x3]);_0x1daac5[_0xc68f('0x21')](_0x11ef0c[0x4]);_0x1daac5[_0xc68f('0x21')](_0x11ef0c[0x5]);_0x1daac5[_0xc68f('0x21')](_0x11ef0c[0x6]);_0x1daac5[_0xc68f('0x21')](_0x11ef0c[0x7]);_0x1daac5[_0xc68f('0x21')](_0x11ef0c[0x8]);_0x1daac5[_0xc68f('0x21')](_0x11ef0c[0x9]);_0x1daac5[_0xc68f('0x21')](_0x11ef0c[0xa]);_0x1daac5[_0xc68f('0x21')](_0x3d1406['interaction']['id']);_0x1daac5['push'](_0x3d1406['message']['id']);_0x1daac5[_0xc68f('0x21')](_0x3c32c8[_0xc68f('0x2b')]);_0x1daac5[_0xc68f('0x21')](_0x3d1406[_0xc68f('0x15')]['ContactId']);_0x1daac5[_0xc68f('0x21')](_0x3d1406[_0xc68f('0x2c')][_0xc68f('0x2c')]);_0x1daac5['push'](_0x378e75);break;default:_0x1daac5=_[_0xc68f('0xc')](_0x3c32c8[_0xc68f('0x1f')])?[]:_0x3c32c8['appdata'][_0xc68f('0x24')](',');}var _0x236684={'id':util[_0xc68f('0xa')]('%s:%s:%s',_0x3a6c06,_0x3c32c8['id'],_0x3c32c8[_0xc68f('0x1c')]),'condition':require(_0xc68f('0x2d'))[_0xc68f('0x2e')](_0x3a6c06,getIntervals(_0x90ccbd[_0xc68f('0x2f')],_0x3c32c8),_0x90ccbd),'consequence':require(_0xc68f('0x30')+_0x3c32c8[_0xc68f('0x1c')])[_0xc68f('0x31')](_0x3a6c06,_0x1daac5,_0x90ccbd,_0x3d1406),'p':_0x3c32c8['priority']||0x0};logger[_0xc68f('0x32')](_0xc68f('0x33'),_0x236684['id'],_0xc68f('0x34'),getIntervals(_0x90ccbd[_0xc68f('0x2f')],_0x3c32c8)[_0xc68f('0x1a')](_0xc68f('0x35')));_0x541828[_0xc68f('0x21')](_0x236684);}else{logger[_0xc68f('0x36')](_0xc68f('0x37'),path['join'](__dirname,_0xc68f('0x17'),_0x3c32c8[_0xc68f('0x1c')]+_0xc68f('0x1b')));}}_0x90ccbd[_0xc68f('0x12')][_0x3a6c06]=new RuleEngine(_0x541828);_0x90ccbd[_0xc68f('0x12')][_0x3a6c06][_0xc68f('0x38')](_0x3d1406,function(_0x3e7b43){logger['info'](_0xc68f('0x39'),JSON['stringify'](_0x3e7b43['matchPath']));if(_0x90ccbd[_0xc68f('0x12')][_0x3a6c06]){_0x90ccbd[_0xc68f('0x12')][_0x3a6c06]['emit']('complete');}});return _0x4648c6({'code':0xc8,'message':_0x3d1406});}else{logger[_0xc68f('0x32')](_0xc68f('0x3a'));return _0x4648c6({'code':0xc8,'message':_0x3d1406});}}catch(_0x45e58e){logger[_0xc68f('0x36')](_0x45e58e[_0xc68f('0x3b')]);return _0x5e1e5b(_0x209d16[_0xc68f('0x36')](0x1f4,_0x45e58e));}}return _0x5e1e5b(_0xc68f('0x3c'));});},'AcceptMessage':function(_0x45cb76){var _0x3fea74=this;return new Promise(function(_0x184f8a,_0x4b9de7){if(_0x45cb76['agent']&&_0x45cb76[_0xc68f('0x3d')]['id']){if(_0x90ccbd['agents'][_0x45cb76[_0xc68f('0x3d')]['id']]){_0x90ccbd[_0xc68f('0x3e')][_0x45cb76['agent']['id']][_0xc68f('0x3f')]=![];_0x90ccbd[_0xc68f('0x3e')][_0x45cb76[_0xc68f('0x3d')]['id']][_0xc68f('0x40')]=undefined;}}if(_0x45cb76[_0xc68f('0x14')]&&_0x45cb76[_0xc68f('0x14')]['id']){try{var _0x30ac87=getId(_0x45cb76[_0xc68f('0x13')],_0x45cb76['message']?_0x45cb76[_0xc68f('0x14')]['id']:0x0,_0x45cb76[_0xc68f('0x15')]?_0x45cb76[_0xc68f('0x15')]['id']:0x0);if(_0x90ccbd['rules'][_0x30ac87]){_0x90ccbd['rules'][_0x30ac87]['emit'](_0xc68f('0x41'));if(rpc[_0x45cb76[_0xc68f('0x13')]+'QueueReport']){rpc[_0x45cb76[_0xc68f('0x13')]+'QueueReport'][_0xc68f('0x42')](_0x30ac87,{'UserId':_0x45cb76[_0xc68f('0x14')][_0xc68f('0x43')]})[_0xc68f('0x44')](function(_0x3b9a4c){logger[_0xc68f('0x36')](_0xc68f('0x45'));});}}return _0x184f8a({'code':0xc8,'message':_0x45cb76});}catch(_0x273236){logger[_0xc68f('0x36')](_0x273236[_0xc68f('0x3b')]);return _0x4b9de7(_0x3fea74[_0xc68f('0x36')](0x1f4,_0x273236));}}logger['error'](_0xc68f('0x46'));return _0x4b9de7(_0x3fea74[_0xc68f('0x36')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x5ee8ba){var _0x341779=this;return new Promise(function(_0x26f74f,_0xa9c6b1){if(_0x5ee8ba['agent']&&_0x5ee8ba[_0xc68f('0x3d')]['id']){try{if(_0x90ccbd[_0xc68f('0x3e')][_0x5ee8ba['agent']['id']]){_0x90ccbd['agents'][_0x5ee8ba[_0xc68f('0x3d')]['id']][_0xc68f('0x3f')]=![];_0x90ccbd[_0xc68f('0x3e')][_0x5ee8ba[_0xc68f('0x3d')]['id']][_0xc68f('0x40')]=undefined;}return _0x26f74f({'code':0xc8,'message':_0x5ee8ba});}catch(_0x20b222){logger[_0xc68f('0x36')](_0x20b222[_0xc68f('0x3b')]);return _0xa9c6b1(_0x341779[_0xc68f('0x36')](0x1f4,_0x20b222));}}logger[_0xc68f('0x36')](_0xc68f('0x46'));return _0xa9c6b1(_0x341779[_0xc68f('0x36')](0x1f4,_0xc68f('0x46')));});},'AbandonInteraction':function(_0x331d9b){var _0x23ebdd=this;return new Promise(function(_0x1733fe,_0x272295){if(_0x331d9b[_0xc68f('0x13')]&&_0x331d9b[_0xc68f('0x15')]&&_0x331d9b[_0xc68f('0x15')]['id']){try{var _0x10389f=getId(_0x331d9b['channel'],_0x331d9b['message']?_0x331d9b[_0xc68f('0x14')]['id']:0x0,_0x331d9b[_0xc68f('0x15')]?_0x331d9b[_0xc68f('0x15')]['id']:0x0);if(_0x90ccbd[_0xc68f('0x12')][_0x10389f]){_0x90ccbd[_0xc68f('0x12')][_0x10389f][_0xc68f('0x47')]('end');}return _0x1733fe({'code':0xc8,'message':_0x331d9b});}catch(_0x3d0c5f){logger[_0xc68f('0x36')](_0x3d0c5f[_0xc68f('0x3b')]);return _0x272295(_0x23ebdd['error'](0x1f4,_0x3d0c5f));}}logger[_0xc68f('0x36')]('message\x20is\x20empty');return _0x272295(_0x23ebdd[_0xc68f('0x36')](0x1f4,_0xc68f('0x46')));});},'AgentCapacity':function(_0xd6a2fb){var _0x3f3836=this;return new Promise(function(_0xddc0cf,_0x527be7){if(_0x90ccbd[_0xc68f('0x3e')]['hasOwnProperty'](_0xd6a2fb['id'])){for(var _0x432ff0 in _0xd6a2fb[_0xc68f('0x48')]){if(_0xd6a2fb[_0xc68f('0x48')][_0xc68f('0x49')](_0x432ff0)){if(_0x90ccbd['agents'][_0xd6a2fb['id']]['hasOwnProperty'](_0x432ff0+_0xc68f('0x4a'))){_0x90ccbd[_0xc68f('0x3e')][_0xd6a2fb['id']][_0x432ff0+'CurrentCapacity']=parseInt(_0xd6a2fb[_0xc68f('0x48')][_0x432ff0],0xa);}}}_0x90ccbd['agents'][_0xd6a2fb['id']][_0xc68f('0x4b')]();return _0xddc0cf({'code':0xc8,'message':_0x90ccbd[_0xc68f('0x3e')][_0xd6a2fb['id']]});}else{return _0x527be7(_0x3f3836[_0xc68f('0x36')](0x1f4,_0xc68f('0x4c')));}});},'Agents':function(_0x27ce21){return new Promise(function(_0x5b680f,_0x49b319){var _0x477fe8=_[_0xc68f('0x4d')](_0x90ccbd[_0xc68f('0x3e')]);_0x5b680f({'count':_0x477fe8[_0xc68f('0x18')],'rows':_0x477fe8});});},'ChatQueues':function(_0x4ba07b){return new Promise(function(_0x35f8c1,_0x1f91a5){var _0x378b00=[];for(var _0x4327a3 in _0x90ccbd[_0xc68f('0x4e')]){if(_0x90ccbd[_0xc68f('0x4e')]['hasOwnProperty'](_0x4327a3)){var _0xedc6df=_0x90ccbd[_0xc68f('0x4e')][_0x4327a3];var _0x52a18c={'id':_0xedc6df['id'],'available':_0xedc6df[_0xc68f('0x4f')],'loggedIn':_0xedc6df[_0xc68f('0x50')],'name':_0xedc6df['name'],'paused':_0xedc6df[_0xc68f('0x51')],'waiting':_0xedc6df['waiting']};_0x378b00[_0xc68f('0x21')](_0x52a18c);}}_0x35f8c1({'count':_0x378b00[_0xc68f('0x18')],'rows':_0x378b00});});},'MailQueues':function(_0x1e48c7){return new Promise(function(_0x9fb50b,_0x5cdfb7){var _0x1beb4f=[];for(var _0x54159e in _0x90ccbd['mailQueues']){if(_0x90ccbd[_0xc68f('0x52')][_0xc68f('0x49')](_0x54159e)){var _0x36daa3=_0x90ccbd[_0xc68f('0x52')][_0x54159e];var _0x55562c={'id':_0x36daa3['id'],'available':_0x36daa3['available'],'loggedIn':_0x36daa3['loggedIn'],'name':_0x36daa3['name'],'paused':_0x36daa3[_0xc68f('0x51')],'waiting':_0x36daa3[_0xc68f('0x53')]};_0x1beb4f[_0xc68f('0x21')](_0x55562c);}}_0x9fb50b({'count':_0x1beb4f[_0xc68f('0x18')],'rows':_0x1beb4f});});},'OpenchannelQueues':function(_0x2b576c){return new Promise(function(_0x11785a,_0x3b16dc){var _0x38755e=[];for(var _0x3091db in _0x90ccbd['openchannelQueues']){if(_0x90ccbd['openchannelQueues']['hasOwnProperty'](_0x3091db)){var _0x177733=_0x90ccbd[_0xc68f('0x54')][_0x3091db];var _0x1c6ed9={'id':_0x177733['id'],'available':_0x177733['available'],'loggedIn':_0x177733['loggedIn'],'name':_0x177733[_0xc68f('0x55')],'paused':_0x177733['paused'],'waiting':_0x177733[_0xc68f('0x53')]};_0x38755e['push'](_0x1c6ed9);}}_0x11785a({'count':_0x38755e['length'],'rows':_0x38755e});});},'SmsQueues':function(_0x113b7c){return new Promise(function(_0x44d8a3,_0x2a7060){var _0x1266fb=[];for(var _0x10a4bd in _0x90ccbd[_0xc68f('0x56')]){if(_0x90ccbd[_0xc68f('0x56')]['hasOwnProperty'](_0x10a4bd)){var _0x2f5954=_0x90ccbd[_0xc68f('0x56')][_0x10a4bd];var _0x458cd3={'id':_0x2f5954['id'],'available':_0x2f5954[_0xc68f('0x4f')],'loggedIn':_0x2f5954[_0xc68f('0x50')],'name':_0x2f5954['name'],'paused':_0x2f5954[_0xc68f('0x51')],'waiting':_0x2f5954[_0xc68f('0x53')]};_0x1266fb[_0xc68f('0x21')](_0x458cd3);}}_0x44d8a3({'count':_0x1266fb[_0xc68f('0x18')],'rows':_0x1266fb});});},'FaxQueues':function(_0xc05a){return new Promise(function(_0x556587,_0x2a3c11){var _0x457a85=[];for(var _0x41fd9e in _0x90ccbd['faxQueues']){if(_0x90ccbd['faxQueues']['hasOwnProperty'](_0x41fd9e)){var _0x2ac238=_0x90ccbd[_0xc68f('0x57')][_0x41fd9e];var _0x23973e={'id':_0x2ac238['id'],'available':_0x2ac238[_0xc68f('0x4f')],'loggedIn':_0x2ac238['loggedIn'],'name':_0x2ac238['name'],'paused':_0x2ac238[_0xc68f('0x51')],'waiting':_0x2ac238[_0xc68f('0x53')]};_0x457a85[_0xc68f('0x21')](_0x23973e);}}_0x556587({'count':_0x457a85[_0xc68f('0x18')],'rows':_0x457a85});});},'WhatsappQueues':function(_0x156a0b){return new Promise(function(_0x1335fe,_0x47b849){var _0x27796b=[];for(var _0x2e6989 in _0x90ccbd[_0xc68f('0x58')]){if(_0x90ccbd[_0xc68f('0x58')][_0xc68f('0x49')](_0x2e6989)){var _0x5a525e=_0x90ccbd[_0xc68f('0x58')][_0x2e6989];var _0x120fee={'id':_0x5a525e['id'],'available':_0x5a525e[_0xc68f('0x4f')],'loggedIn':_0x5a525e[_0xc68f('0x50')],'name':_0x5a525e[_0xc68f('0x55')],'paused':_0x5a525e[_0xc68f('0x51')],'waiting':_0x5a525e[_0xc68f('0x53')]};_0x27796b['push'](_0x120fee);}}_0x1335fe({'count':_0x27796b['length'],'rows':_0x27796b});});},'ChatQueuesWaitingInteractions':function(_0x129a84){return new Promise(function(_0x3214d3,_0x394f7f){var _0x26869c=_[_0xc68f('0x4d')](_0x90ccbd[_0xc68f('0x59')]);_0x3214d3({'count':_0x26869c[_0xc68f('0x18')],'rows':_0x26869c});});},'MailQueuesWaitingInteractions':function(_0x21ba96){return new Promise(function(_0x22f1f6,_0x532498){var _0x32a15f=_['values'](_0x90ccbd[_0xc68f('0x5a')]);_0x22f1f6({'count':_0x32a15f['length'],'rows':_0x32a15f});});},'OpenchannelQueuesWaitingInteractions':function(_0x2a14ff){return new Promise(function(_0x2b4a12,_0x21d6d8){var _0x57572c=_[_0xc68f('0x4d')](_0x90ccbd[_0xc68f('0x5b')]);_0x2b4a12({'count':_0x57572c[_0xc68f('0x18')],'rows':_0x57572c});});},'SmsQueuesWaitingInteractions':function(_0x863c5d){return new Promise(function(_0x2864bd,_0xf25ead){var _0x2c1c8a=_['values'](_0x90ccbd[_0xc68f('0x5c')]);_0x2864bd({'count':_0x2c1c8a[_0xc68f('0x18')],'rows':_0x2c1c8a});});},'FaxQueuesWaitingInteractions':function(_0xc5c9cf){return new Promise(function(_0x10f814,_0x237e81){var _0x51f7ad=_[_0xc68f('0x4d')](_0x90ccbd[_0xc68f('0x5d')]);_0x10f814({'count':_0x51f7ad['length'],'rows':_0x51f7ad});});},'WhatsappQueuesWaitingInteractions':function(_0x50118e){return new Promise(function(_0x5c31a1,_0x34fc63){var _0x35e978=_[_0xc68f('0x4d')](_0x90ccbd[_0xc68f('0x5e')]);_0x5c31a1({'count':_0x35e978[_0xc68f('0x18')],'rows':_0x35e978});});}};var _0x2a5f7e=jayson[_0xc68f('0x5f')](_0x2673b4)['http']();_0x2a5f7e['on'](_0xc68f('0x36'),function(_0x50d8fa){logger[_0xc68f('0x36')](JSON[_0xc68f('0x60')](_0x50d8fa));return _0x286ed4(_0x50d8fa);});_0x2a5f7e[_0xc68f('0x11')](0x232c,_0xc68f('0x61'),function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0xe6e7db(_0xc68f('0x62')+0x232c);});});}; \ No newline at end of file +var _0xcf14=['amazonlex','tag','TagId','tvox','getMustacheRender','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','busy','agents','busyQueue','end','QueueReport','UserId','catch','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','chatQueues','available','loggedIn','paused','waiting','mailQueues','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','lodash','path','jayson/promise','uuid','./applications/utils','../../../config/environment','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','isArray','applications','length','existsSync','join','app','toLowerCase','autoreply','appdata','push','slice','dialogflow','split','dialogflowv2'];(function(_0x9ccf99,_0x5381b8){var _0x4e5882=function(_0x4b6cb5){while(--_0x4b6cb5){_0x9ccf99['push'](_0x9ccf99['shift']());}};_0x4e5882(++_0x5381b8);}(_0xcf14,0xa1));var _0x4cf1=function(_0x4ee023,_0x2c7078){_0x4ee023=_0x4ee023-0x0;var _0x153223=_0xcf14[_0x4ee023];return _0x153223;};'use strict';var _=require(_0x4cf1('0x0'));var util=require('util');var path=require(_0x4cf1('0x1'));var fs=require('fs');var jayson=require(_0x4cf1('0x2'));var BPromise=require('bluebird');var uuid=require(_0x4cf1('0x3'));var utils=require(_0x4cf1('0x4'));var config=require(_0x4cf1('0x5'));var logger=require(_0x4cf1('0x6'))('routing');var rpc={'openchannelQueueReport':require(_0x4cf1('0x7')),'mailQueueReport':require(_0x4cf1('0x8')),'chatQueueReport':require(_0x4cf1('0x9')),'smsQueueReport':require(_0x4cf1('0xa')),'faxQueueReport':require(_0x4cf1('0xb')),'whatsappQueueReport':require(_0x4cf1('0xc'))};var RuleEngine=require(_0x4cf1('0xd'));function getId(_0x50273f,_0x4094d4,_0x208cdd){return util[_0x4cf1('0xe')](_0x4cf1('0xf'),_0x50273f,_0x4094d4||0x0,_0x208cdd||0x0);}function getIntervals(_0x2736c7,_0x3722fa){var _0x207aea=[];if(!_[_0x4cf1('0x10')](_0x3722fa[_0x4cf1('0x11')])&&!_[_0x4cf1('0x10')](_0x2736c7[_0x3722fa[_0x4cf1('0x11')]])&&!_[_0x4cf1('0x10')](_0x2736c7[_0x3722fa[_0x4cf1('0x11')]][_0x4cf1('0x12')])){_0x207aea=_['map'](_0x2736c7[_0x3722fa[_0x4cf1('0x11')]][_0x4cf1('0x12')],_0x4cf1('0x13'));}else if(!_[_0x4cf1('0x10')](_0x3722fa[_0x4cf1('0x13')])){_0x207aea=[_0x3722fa[_0x4cf1('0x13')]];}return _0x207aea;}exports[_0x4cf1('0x14')]=function(_0x3f365c){_0x3f365c[_0x4cf1('0x15')]={};return new BPromise(function(_0x6c10f9,_0x3e320f){var _0xec2510={'Start':function(_0xcfa115){var _0x2a8cf7=this;return new Promise(function(_0xe257a5,_0x4fa520){if(_0xcfa115){try{var _0x3e3cd8=[];var _0x527dca=getId(_0xcfa115[_0x4cf1('0x16')],_0xcfa115[_0x4cf1('0x17')]?_0xcfa115[_0x4cf1('0x17')]['id']:0x0,_0xcfa115[_0x4cf1('0x18')]?_0xcfa115[_0x4cf1('0x18')]['id']:0x0);if(_0xcfa115['applications']&&_[_0x4cf1('0x19')](_0xcfa115[_0x4cf1('0x1a')])&&_0xcfa115[_0x4cf1('0x1a')][_0x4cf1('0x1b')]){for(var _0x52b5a2=0x0;_0x52b5a2<_0xcfa115['applications'][_0x4cf1('0x1b')];_0x52b5a2+=0x1){var _0x83ad6a=_0xcfa115['applications'][_0x52b5a2];if(fs[_0x4cf1('0x1c')](path[_0x4cf1('0x1d')](__dirname,_0x4cf1('0x1a'),_0x83ad6a[_0x4cf1('0x1e')]+'.js'))){var _0x3469ac=[];switch(_0x83ad6a[_0x4cf1('0x1e')][_0x4cf1('0x1f')]()){case _0x4cf1('0x20'):var _0x21eb0c=_0x83ad6a[_0x4cf1('0x21')]['split'](',');if(_0xcfa115[_0x4cf1('0x16')]==='mail'){_0x3469ac[_0x4cf1('0x22')](_0x21eb0c[0x0]);_0x3469ac[_0x4cf1('0x22')](_0x21eb0c[0x1]);_0x3469ac[_0x4cf1('0x22')](_0x21eb0c[_0x4cf1('0x23')](0x2,_0x21eb0c[_0x4cf1('0x1b')])[_0x4cf1('0x1d')](','));}else{_0x3469ac[_0x4cf1('0x22')](_0x21eb0c[0x0]);_0x3469ac[_0x4cf1('0x22')](_0x21eb0c[_0x4cf1('0x23')](0x1,_0x21eb0c[_0x4cf1('0x1b')])[_0x4cf1('0x1d')](','));}break;case _0x4cf1('0x24'):var _0x2a17ce=_0x83ad6a['appdata'][_0x4cf1('0x25')](',');_0x3469ac[_0x4cf1('0x22')](_0x2a17ce[0x0]);_0x3469ac[_0x4cf1('0x22')](_0x2a17ce[0x1]);_0x3469ac[_0x4cf1('0x22')](_0x2a17ce[_0x4cf1('0x23')](0x2,_0x2a17ce[_0x4cf1('0x1b')])[_0x4cf1('0x1d')](','));break;case _0x4cf1('0x26'):var _0x2c0803=_0x83ad6a[_0x4cf1('0x21')][_0x4cf1('0x25')](',');_0x3469ac['push'](_0x2c0803[0x0]);_0x3469ac[_0x4cf1('0x22')](_0x2c0803[0x1]);_0x3469ac[_0x4cf1('0x22')](_0x2c0803[0x2]);_0x3469ac['push'](_0x2c0803[0x3]);_0x3469ac[_0x4cf1('0x22')](_0x2c0803[_0x4cf1('0x23')](0x4,_0x2c0803[_0x4cf1('0x1b')])[_0x4cf1('0x1d')](','));break;case _0x4cf1('0x27'):var _0x2f4b60=_0x83ad6a['appdata'][_0x4cf1('0x25')](',');_0x3469ac['push'](_0x2f4b60[0x0]);_0x3469ac[_0x4cf1('0x22')](_0x2f4b60[0x1]);_0x3469ac[_0x4cf1('0x22')](_0x2f4b60[0x2]);_0x3469ac[_0x4cf1('0x22')](_0x2f4b60[0x3]);_0x3469ac[_0x4cf1('0x22')](_0x2f4b60[_0x4cf1('0x23')](0x4,_0x2f4b60['length'])[_0x4cf1('0x1d')](','));break;case'message':_0x3469ac['push'](_0x83ad6a['appdata']);break;case _0x4cf1('0x28'):_0x3469ac[_0x4cf1('0x22')](_0x83ad6a[_0x4cf1('0x29')]);_0x3469ac[_0x4cf1('0x22')](_0x83ad6a[_0x4cf1('0x21')]);break;case _0x4cf1('0x2a'):var _0x37f6a2=utils[_0x4cf1('0x2b')](_0xcfa115['account']['notificationTemplate'],_0xcfa115);var _0x48d93a=_0x83ad6a[_0x4cf1('0x21')][_0x4cf1('0x25')](',');_0x3469ac[_0x4cf1('0x22')](_0x48d93a[0x0]);_0x3469ac[_0x4cf1('0x22')](_0x48d93a[0x1]);_0x3469ac[_0x4cf1('0x22')](_0x48d93a[0x2]);_0x3469ac[_0x4cf1('0x22')](_0x48d93a[0x3]);_0x3469ac[_0x4cf1('0x22')](_0x48d93a[0x4]);_0x3469ac[_0x4cf1('0x22')](_0x48d93a[0x5]);_0x3469ac[_0x4cf1('0x22')](_0x48d93a[0x6]);_0x3469ac[_0x4cf1('0x22')](_0x48d93a[0x7]);_0x3469ac[_0x4cf1('0x22')](_0x48d93a[0x8]);_0x3469ac[_0x4cf1('0x22')](_0x48d93a[0x9]);_0x3469ac[_0x4cf1('0x22')](_0x48d93a[0xa]);_0x3469ac['push'](_0xcfa115['interaction']['id']);_0x3469ac[_0x4cf1('0x22')](_0xcfa115[_0x4cf1('0x17')]['id']);_0x3469ac[_0x4cf1('0x22')](_0x83ad6a[_0x4cf1('0x2c')]);_0x3469ac[_0x4cf1('0x22')](_0xcfa115[_0x4cf1('0x18')][_0x4cf1('0x2d')]);_0x3469ac['push'](_0xcfa115[_0x4cf1('0x2e')][_0x4cf1('0x2e')]);_0x3469ac[_0x4cf1('0x22')](_0x37f6a2);break;default:_0x3469ac=_[_0x4cf1('0x10')](_0x83ad6a[_0x4cf1('0x21')])?[]:_0x83ad6a[_0x4cf1('0x21')]['split'](',');}var _0x5348f5={'id':util[_0x4cf1('0xe')](_0x4cf1('0x2f'),_0x527dca,_0x83ad6a['id'],_0x83ad6a[_0x4cf1('0x1e')]),'condition':require(_0x4cf1('0x30'))[_0x4cf1('0x31')](_0x527dca,getIntervals(_0x3f365c[_0x4cf1('0x32')],_0x83ad6a),_0x3f365c),'consequence':require(_0x4cf1('0x33')+_0x83ad6a[_0x4cf1('0x1e')])[_0x4cf1('0x34')](_0x527dca,_0x3469ac,_0x3f365c,_0xcfa115),'p':_0x83ad6a[_0x4cf1('0x35')]||0x0};logger[_0x4cf1('0x36')]('Push\x20new\x20rule',_0x5348f5['id'],_0x4cf1('0x37'),getIntervals(_0x3f365c[_0x4cf1('0x32')],_0x83ad6a)['join'](_0x4cf1('0x38')));_0x3e3cd8[_0x4cf1('0x22')](_0x5348f5);}else{logger[_0x4cf1('0x39')](_0x4cf1('0x3a'),path[_0x4cf1('0x1d')](__dirname,'applications',_0x83ad6a[_0x4cf1('0x1e')]+'.js'));}}_0x3f365c['rules'][_0x527dca]=new RuleEngine(_0x3e3cd8);_0x3f365c[_0x4cf1('0x15')][_0x527dca][_0x4cf1('0x3b')](_0xcfa115,function(_0x17f59e){logger[_0x4cf1('0x36')](_0x4cf1('0x3c'),JSON[_0x4cf1('0x3d')](_0x17f59e[_0x4cf1('0x3e')]));if(_0x3f365c[_0x4cf1('0x15')][_0x527dca]){_0x3f365c[_0x4cf1('0x15')][_0x527dca][_0x4cf1('0x3f')](_0x4cf1('0x40'));}});return _0xe257a5({'code':0xc8,'message':_0xcfa115});}else{logger[_0x4cf1('0x36')](_0x4cf1('0x41'));return _0xe257a5({'code':0xc8,'message':_0xcfa115});}}catch(_0x2133fe){logger[_0x4cf1('0x39')](_0x2133fe[_0x4cf1('0x42')]);return _0x4fa520(_0x2a8cf7['error'](0x1f4,_0x2133fe));}}return _0x4fa520(_0x4cf1('0x43'));});},'AcceptMessage':function(_0x2aa51e){var _0x1dbabe=this;return new Promise(function(_0x1ecde5,_0x38d584){if(_0x2aa51e[_0x4cf1('0x44')]&&_0x2aa51e[_0x4cf1('0x44')]['id']){if(_0x3f365c['agents'][_0x2aa51e[_0x4cf1('0x44')]['id']]){_0x3f365c['agents'][_0x2aa51e[_0x4cf1('0x44')]['id']][_0x4cf1('0x45')]=![];_0x3f365c[_0x4cf1('0x46')][_0x2aa51e[_0x4cf1('0x44')]['id']][_0x4cf1('0x47')]=undefined;}}if(_0x2aa51e[_0x4cf1('0x17')]&&_0x2aa51e['message']['id']){try{var _0x4fb90b=getId(_0x2aa51e['channel'],_0x2aa51e[_0x4cf1('0x17')]?_0x2aa51e[_0x4cf1('0x17')]['id']:0x0,_0x2aa51e[_0x4cf1('0x18')]?_0x2aa51e['interaction']['id']:0x0);if(_0x3f365c[_0x4cf1('0x15')][_0x4fb90b]){_0x3f365c[_0x4cf1('0x15')][_0x4fb90b]['emit'](_0x4cf1('0x48'));if(rpc[_0x2aa51e[_0x4cf1('0x16')]+_0x4cf1('0x49')]){rpc[_0x2aa51e[_0x4cf1('0x16')]+_0x4cf1('0x49')]['update'](_0x4fb90b,{'UserId':_0x2aa51e[_0x4cf1('0x17')][_0x4cf1('0x4a')]})[_0x4cf1('0x4b')](function(_0x77418c){logger[_0x4cf1('0x39')]('error\x20update\x20queue\x20report');});}}return _0x1ecde5({'code':0xc8,'message':_0x2aa51e});}catch(_0x3a4723){logger[_0x4cf1('0x39')](_0x3a4723['stack']);return _0x38d584(_0x1dbabe['error'](0x1f4,_0x3a4723));}}logger['error'](_0x4cf1('0x4c'));return _0x38d584(_0x1dbabe[_0x4cf1('0x39')](0x1f4,_0x4cf1('0x4c')));});},'RejectMessage':function(_0x5c26ba){var _0x35049a=this;return new Promise(function(_0x31e3db,_0x296065){if(_0x5c26ba['agent']&&_0x5c26ba[_0x4cf1('0x44')]['id']){try{if(_0x3f365c[_0x4cf1('0x46')][_0x5c26ba[_0x4cf1('0x44')]['id']]){_0x3f365c[_0x4cf1('0x46')][_0x5c26ba['agent']['id']][_0x4cf1('0x45')]=![];_0x3f365c[_0x4cf1('0x46')][_0x5c26ba['agent']['id']][_0x4cf1('0x47')]=undefined;}return _0x31e3db({'code':0xc8,'message':_0x5c26ba});}catch(_0x3e3218){logger[_0x4cf1('0x39')](_0x3e3218['stack']);return _0x296065(_0x35049a[_0x4cf1('0x39')](0x1f4,_0x3e3218));}}logger[_0x4cf1('0x39')](_0x4cf1('0x4c'));return _0x296065(_0x35049a[_0x4cf1('0x39')](0x1f4,_0x4cf1('0x4c')));});},'AbandonInteraction':function(_0x2e93cc){var _0x2d161f=this;return new Promise(function(_0x574411,_0x5bc4c9){if(_0x2e93cc[_0x4cf1('0x16')]&&_0x2e93cc['interaction']&&_0x2e93cc[_0x4cf1('0x18')]['id']){try{var _0x39b15a=getId(_0x2e93cc[_0x4cf1('0x16')],_0x2e93cc[_0x4cf1('0x17')]?_0x2e93cc[_0x4cf1('0x17')]['id']:0x0,_0x2e93cc[_0x4cf1('0x18')]?_0x2e93cc[_0x4cf1('0x18')]['id']:0x0);if(_0x3f365c['rules'][_0x39b15a]){_0x3f365c[_0x4cf1('0x15')][_0x39b15a][_0x4cf1('0x3f')]('end');}return _0x574411({'code':0xc8,'message':_0x2e93cc});}catch(_0x38aa06){logger[_0x4cf1('0x39')](_0x38aa06[_0x4cf1('0x42')]);return _0x5bc4c9(_0x2d161f['error'](0x1f4,_0x38aa06));}}logger[_0x4cf1('0x39')](_0x4cf1('0x4c'));return _0x5bc4c9(_0x2d161f[_0x4cf1('0x39')](0x1f4,_0x4cf1('0x4c')));});},'AgentCapacity':function(_0x4a31cd){var _0x4900a6=this;return new Promise(function(_0x3fe67f,_0x304ca7){if(_0x3f365c['agents'][_0x4cf1('0x4d')](_0x4a31cd['id'])){for(var _0xf04cd1 in _0x4a31cd[_0x4cf1('0x4e')]){if(_0x4a31cd['capacity'][_0x4cf1('0x4d')](_0xf04cd1)){if(_0x3f365c[_0x4cf1('0x46')][_0x4a31cd['id']][_0x4cf1('0x4d')](_0xf04cd1+'CurrentCapacity')){_0x3f365c[_0x4cf1('0x46')][_0x4a31cd['id']][_0xf04cd1+_0x4cf1('0x4f')]=parseInt(_0x4a31cd[_0x4cf1('0x4e')][_0xf04cd1],0xa);}}}_0x3f365c[_0x4cf1('0x46')][_0x4a31cd['id']]['updateRealtime']();return _0x3fe67f({'code':0xc8,'message':_0x3f365c[_0x4cf1('0x46')][_0x4a31cd['id']]});}else{return _0x304ca7(_0x4900a6['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0xc97376){return new Promise(function(_0x32a71a,_0x18cc9f){var _0x1bf6a9=_['values'](_0x3f365c[_0x4cf1('0x46')]);_0x32a71a({'count':_0x1bf6a9[_0x4cf1('0x1b')],'rows':_0x1bf6a9});});},'ChatQueues':function(_0x35001f){return new Promise(function(_0x4ca89f,_0x5ce4da){var _0x7feee=[];for(var _0x3cbab0 in _0x3f365c['chatQueues']){if(_0x3f365c[_0x4cf1('0x50')]['hasOwnProperty'](_0x3cbab0)){var _0x2f8d03=_0x3f365c[_0x4cf1('0x50')][_0x3cbab0];var _0x5138b4={'id':_0x2f8d03['id'],'available':_0x2f8d03[_0x4cf1('0x51')],'loggedIn':_0x2f8d03[_0x4cf1('0x52')],'name':_0x2f8d03['name'],'paused':_0x2f8d03[_0x4cf1('0x53')],'waiting':_0x2f8d03[_0x4cf1('0x54')]};_0x7feee[_0x4cf1('0x22')](_0x5138b4);}}_0x4ca89f({'count':_0x7feee[_0x4cf1('0x1b')],'rows':_0x7feee});});},'MailQueues':function(_0x332886){return new Promise(function(_0x5cebfc,_0x3989ff){var _0x4d2977=[];for(var _0x49603d in _0x3f365c[_0x4cf1('0x55')]){if(_0x3f365c[_0x4cf1('0x55')][_0x4cf1('0x4d')](_0x49603d)){var _0x531898=_0x3f365c[_0x4cf1('0x55')][_0x49603d];var _0x427da1={'id':_0x531898['id'],'available':_0x531898[_0x4cf1('0x51')],'loggedIn':_0x531898[_0x4cf1('0x52')],'name':_0x531898[_0x4cf1('0x56')],'paused':_0x531898[_0x4cf1('0x53')],'waiting':_0x531898[_0x4cf1('0x54')]};_0x4d2977['push'](_0x427da1);}}_0x5cebfc({'count':_0x4d2977[_0x4cf1('0x1b')],'rows':_0x4d2977});});},'OpenchannelQueues':function(_0x1f840b){return new Promise(function(_0x38ab3a,_0x5b19ec){var _0x1e831f=[];for(var _0x40bee0 in _0x3f365c[_0x4cf1('0x57')]){if(_0x3f365c[_0x4cf1('0x57')]['hasOwnProperty'](_0x40bee0)){var _0x3d3c4f=_0x3f365c[_0x4cf1('0x57')][_0x40bee0];var _0x4b0304={'id':_0x3d3c4f['id'],'available':_0x3d3c4f['available'],'loggedIn':_0x3d3c4f['loggedIn'],'name':_0x3d3c4f[_0x4cf1('0x56')],'paused':_0x3d3c4f[_0x4cf1('0x53')],'waiting':_0x3d3c4f[_0x4cf1('0x54')]};_0x1e831f['push'](_0x4b0304);}}_0x38ab3a({'count':_0x1e831f['length'],'rows':_0x1e831f});});},'SmsQueues':function(_0x4dff1c){return new Promise(function(_0x387781,_0x2cee5f){var _0xcfa9b8=[];for(var _0x21a26b in _0x3f365c[_0x4cf1('0x58')]){if(_0x3f365c[_0x4cf1('0x58')]['hasOwnProperty'](_0x21a26b)){var _0x123d5a=_0x3f365c['smsQueues'][_0x21a26b];var _0x4987e2={'id':_0x123d5a['id'],'available':_0x123d5a[_0x4cf1('0x51')],'loggedIn':_0x123d5a[_0x4cf1('0x52')],'name':_0x123d5a[_0x4cf1('0x56')],'paused':_0x123d5a[_0x4cf1('0x53')],'waiting':_0x123d5a['waiting']};_0xcfa9b8['push'](_0x4987e2);}}_0x387781({'count':_0xcfa9b8['length'],'rows':_0xcfa9b8});});},'FaxQueues':function(_0x5df18e){return new Promise(function(_0xcf5d72,_0x3e816d){var _0x472086=[];for(var _0x38f101 in _0x3f365c['faxQueues']){if(_0x3f365c[_0x4cf1('0x59')][_0x4cf1('0x4d')](_0x38f101)){var _0x4ac9b6=_0x3f365c['faxQueues'][_0x38f101];var _0x31345a={'id':_0x4ac9b6['id'],'available':_0x4ac9b6[_0x4cf1('0x51')],'loggedIn':_0x4ac9b6[_0x4cf1('0x52')],'name':_0x4ac9b6[_0x4cf1('0x56')],'paused':_0x4ac9b6[_0x4cf1('0x53')],'waiting':_0x4ac9b6[_0x4cf1('0x54')]};_0x472086[_0x4cf1('0x22')](_0x31345a);}}_0xcf5d72({'count':_0x472086['length'],'rows':_0x472086});});},'WhatsappQueues':function(_0x5323c4){return new Promise(function(_0x3689cc,_0x3a0ed6){var _0x3e4a03=[];for(var _0x19be88 in _0x3f365c[_0x4cf1('0x5a')]){if(_0x3f365c['whatsappQueues'][_0x4cf1('0x4d')](_0x19be88)){var _0x233293=_0x3f365c['whatsappQueues'][_0x19be88];var _0x2f58d4={'id':_0x233293['id'],'available':_0x233293[_0x4cf1('0x51')],'loggedIn':_0x233293[_0x4cf1('0x52')],'name':_0x233293[_0x4cf1('0x56')],'paused':_0x233293['paused'],'waiting':_0x233293[_0x4cf1('0x54')]};_0x3e4a03[_0x4cf1('0x22')](_0x2f58d4);}}_0x3689cc({'count':_0x3e4a03[_0x4cf1('0x1b')],'rows':_0x3e4a03});});},'ChatQueuesWaitingInteractions':function(_0x276913){return new Promise(function(_0x830af9,_0x52cb5c){var _0x2ed0e5=_[_0x4cf1('0x5b')](_0x3f365c[_0x4cf1('0x5c')]);_0x830af9({'count':_0x2ed0e5[_0x4cf1('0x1b')],'rows':_0x2ed0e5});});},'MailQueuesWaitingInteractions':function(_0x13d24a){return new Promise(function(_0x21c13d,_0x2587f5){var _0x2a93d6=_['values'](_0x3f365c['mailQueuesWaitingInteractions']);_0x21c13d({'count':_0x2a93d6[_0x4cf1('0x1b')],'rows':_0x2a93d6});});},'OpenchannelQueuesWaitingInteractions':function(_0x5076e8){return new Promise(function(_0x1fce14,_0x278d2f){var _0x4d1ce3=_[_0x4cf1('0x5b')](_0x3f365c[_0x4cf1('0x5d')]);_0x1fce14({'count':_0x4d1ce3[_0x4cf1('0x1b')],'rows':_0x4d1ce3});});},'SmsQueuesWaitingInteractions':function(_0x250d1e){return new Promise(function(_0x5b6053,_0x171faf){var _0x3d8a82=_['values'](_0x3f365c[_0x4cf1('0x5e')]);_0x5b6053({'count':_0x3d8a82['length'],'rows':_0x3d8a82});});},'FaxQueuesWaitingInteractions':function(_0x24bfbe){return new Promise(function(_0x312dc2,_0x593074){var _0x33a0d4=_[_0x4cf1('0x5b')](_0x3f365c[_0x4cf1('0x5f')]);_0x312dc2({'count':_0x33a0d4['length'],'rows':_0x33a0d4});});},'WhatsappQueuesWaitingInteractions':function(_0x5922b3){return new Promise(function(_0x20d6c2,_0x3d68b7){var _0x5a5327=_[_0x4cf1('0x5b')](_0x3f365c[_0x4cf1('0x60')]);_0x20d6c2({'count':_0x5a5327[_0x4cf1('0x1b')],'rows':_0x5a5327});});}};var _0x12d7b1=jayson[_0x4cf1('0x61')](_0xec2510)[_0x4cf1('0x62')]();_0x12d7b1['on'](_0x4cf1('0x39'),function(_0x24b665){logger[_0x4cf1('0x39')](JSON[_0x4cf1('0x3d')](_0x24b665));return _0x3e320f(_0x24b665);});_0x12d7b1[_0x4cf1('0x14')](0x232c,_0x4cf1('0x63'),function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x6c10f9('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 6dce251..cf00d5f 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 _0xf1b1=['when','log','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','request','then','error','message','catch','rules','stop','length','push','Command','format','iftime\x20%s','true','[%s][INTERVAL]\x20%s','some','info'];(function(_0x276d91,_0x180e8f){var _0x4f69b8=function(_0x2f80ef){while(--_0x2f80ef){_0x276d91['push'](_0x276d91['shift']());}};_0x4f69b8(++_0x180e8f);}(_0xf1b1,0xc9));var _0x1f1b=function(_0x2aa83a,_0x4b5c0b){_0x2aa83a=_0x2aa83a-0x0;var _0x36a653=_0xf1b1[_0x2aa83a];return _0x36a653;};'use strict';var util=require(_0x1f1b('0x0'));var BPromise=require(_0x1f1b('0x1'));var jayson=require(_0x1f1b('0x2'));var _=require(_0x1f1b('0x3'));var logger=require(_0x1f1b('0x4'))(_0x1f1b('0x5'));var client=jayson[_0x1f1b('0x6')]['http']({'port':0x232a});function request(_0x13c56f,_0x44ceaa){return new BPromise(function(_0x5de8c6,_0x81360c){return client[_0x1f1b('0x7')](_0x13c56f,_0x44ceaa)[_0x1f1b('0x8')](function(_0x2719ee){if(_0x2719ee[_0x1f1b('0x9')]){return _0x81360c(_0x2719ee['error'][_0x1f1b('0xa')]);}else{return _0x5de8c6(_0x2719ee['result']);}})[_0x1f1b('0xb')](function(_0x4a660f){return _0x81360c(_0x4a660f);});});}exports['condition']=function(_0x376d22,_0x49216b,_0x1905bc){return function(_0x5a2bf7){if(_0x1905bc[_0x1f1b('0xc')]&&!_0x1905bc['rules'][_0x376d22]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x376d22);return _0x5a2bf7[_0x1f1b('0xd')]();}var _0x3ddbeb=[];for(var _0x7426f1=0x0;_0x7426f1<_0x49216b[_0x1f1b('0xe')];_0x7426f1+=0x1){_0x3ddbeb[_0x1f1b('0xf')](request(_0x1f1b('0x10'),{'command':util[_0x1f1b('0x11')](_0x1f1b('0x12'),_0x49216b[_0x7426f1])})[_0x1f1b('0x8')](function(_0x3a6edd){return _0x3a6edd&&_0x3a6edd[_0x1f1b('0xa')]&&_0x3a6edd[_0x1f1b('0xa')]['indexOf'](_0x1f1b('0x13'))>=0x0?!![]:![];})[_0x1f1b('0xb')](function(_0x51cec3){logger['error'](_0x1f1b('0x14'),_0x376d22,_0x49216b[_0x7426f1]);}));}BPromise['all'](_0x3ddbeb)[_0x1f1b('0x8')](function(_0x3f9474){var _0x2a54a8=_[_0x1f1b('0x15')](_0x3f9474);logger[_0x1f1b('0x16')]('[%s][INTERVAL]\x20%s\x20%s',_0x376d22,_0x49216b['join']('\x20|\x20'),_0x2a54a8);_0x5a2bf7[_0x1f1b('0x17')](_0x2a54a8);})[_0x1f1b('0xb')](function(_0x7f5f41){console[_0x1f1b('0x18')](_0x7f5f41);logger[_0x1f1b('0x9')](_0x1f1b('0x19'),_0x376d22,_0x49216b[_0x1f1b('0x1a')](_0x1f1b('0x1b')),_0x7f5f41['stack']);_0x5a2bf7[_0x1f1b('0xd')]();});};}; \ No newline at end of file +var _0x5e64=['lodash','../../../config/logger','http','request','then','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','format','iftime\x20%s','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','log','stack','util','bluebird','jayson/promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5e64,0x1cd));var _0x45e6=function(_0x5cc908,_0x307fe5){_0x5cc908=_0x5cc908-0x0;var _0x4078d6=_0x5e64[_0x5cc908];return _0x4078d6;};'use strict';var util=require(_0x45e6('0x0'));var BPromise=require(_0x45e6('0x1'));var jayson=require(_0x45e6('0x2'));var _=require(_0x45e6('0x3'));var logger=require(_0x45e6('0x4'))('routing');var client=jayson['client'][_0x45e6('0x5')]({'port':0x232a});function request(_0x182b0d,_0x3ef53f){return new BPromise(function(_0x5d25e2,_0x5bb9d7){return client[_0x45e6('0x6')](_0x182b0d,_0x3ef53f)[_0x45e6('0x7')](function(_0x5b0e2e){if(_0x5b0e2e[_0x45e6('0x8')]){return _0x5bb9d7(_0x5b0e2e['error'][_0x45e6('0x9')]);}else{return _0x5d25e2(_0x5b0e2e[_0x45e6('0xa')]);}})[_0x45e6('0xb')](function(_0x13cc5a){return _0x5bb9d7(_0x13cc5a);});});}exports[_0x45e6('0xc')]=function(_0x2e1a05,_0x19b8ea,_0x1749e9){return function(_0x150e44){if(_0x1749e9[_0x45e6('0xd')]&&!_0x1749e9['rules'][_0x2e1a05]){logger[_0x45e6('0xe')](_0x45e6('0xf'),_0x2e1a05);return _0x150e44[_0x45e6('0x10')]();}var _0x456d01=[];for(var _0x5e49df=0x0;_0x5e49df<_0x19b8ea[_0x45e6('0x11')];_0x5e49df+=0x1){_0x456d01['push'](request('Command',{'command':util[_0x45e6('0x12')](_0x45e6('0x13'),_0x19b8ea[_0x5e49df])})[_0x45e6('0x7')](function(_0x435f85){return _0x435f85&&_0x435f85[_0x45e6('0x9')]&&_0x435f85[_0x45e6('0x9')]['indexOf'](_0x45e6('0x14'))>=0x0?!![]:![];})['catch'](function(_0x584b33){logger[_0x45e6('0x8')](_0x45e6('0x15'),_0x2e1a05,_0x19b8ea[_0x5e49df]);}));}BPromise[_0x45e6('0x16')](_0x456d01)['then'](function(_0x3dd14c){var _0x4b2903=_[_0x45e6('0x17')](_0x3dd14c);logger[_0x45e6('0xe')](_0x45e6('0x18'),_0x2e1a05,_0x19b8ea[_0x45e6('0x19')](_0x45e6('0x1a')),_0x4b2903);_0x150e44['when'](_0x4b2903);})[_0x45e6('0xb')](function(_0x22e481){console[_0x45e6('0x1b')](_0x22e481);logger[_0x45e6('0x8')](_0x45e6('0x18'),_0x2e1a05,_0x19b8ea[_0x45e6('0x19')](_0x45e6('0x1a')),_0x22e481[_0x45e6('0x1c')]);_0x150e44[_0x45e6('0x10')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index ead3010..1e55a59 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 _0xa9e0=['complete','[%s][agents][agentcomplete]','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfertype','blind','transferexten','extension','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfer','ATTENDED','transfereeuniqueid','agententerreason','clone','calleridname','[%s][agents][attendedtransfer]\x20agent:%s','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','./utils','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','calleridnum','connectedlinenum','lastevent','type','agentacw','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','format','[%s][agents][agentcalled]','agentcalledAt','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','now','reason','timeout','ringtime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','talktime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var utils=require(_0x0a9e('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5dd881,_0x550fbc){utils[_0x0a9e('0x3')](util['format'](_0x0a9e('0x4'),_0x5dd881[_0x0a9e('0x5')],_0x5dd881[_0x0a9e('0x6')],_0x5dd881[_0x0a9e('0x7')],_0x5dd881[_0x0a9e('0x8')],_0x5dd881['interface'],_0x5dd881[_0x0a9e('0x9')],_0x5dd881[_0x0a9e('0xa')],_0x5dd881[_0x0a9e('0xb')]));if(_0x5dd881['queue']){utils['getVoiceQueueByName'](_0x5dd881[_0x0a9e('0x7')])['then'](function(_0x52cace){if(_0x52cace){_0x5dd881[_0x0a9e('0xc')]=_0x52cace[_0x0a9e('0xc')];_0x5dd881[_0x0a9e('0xd')]=_0x5dd881[_0x0a9e('0xe')]?_0x52cace[_0x0a9e('0xf')]:![];_0x5dd881[_0x0a9e('0x10')]=_0x5dd881['agentacw']?_0x52cace['acwTimeout']:0x0;}utils['request']('CreateVoiceAgentReport',_0x5dd881);});}else{utils[_0x0a9e('0x11')](_0x0a9e('0x12'),_0x5dd881);}if(_0x550fbc){delete transfers[_0x5dd881[_0x0a9e('0x5')]];}else{delete agents[_0x5dd881[_0x0a9e('0x13')]];}}exports[_0x0a9e('0x14')]=function(_0x69aeb7){try{utils['debug'](util[_0x0a9e('0x15')](_0x0a9e('0x16'),_0x69aeb7[_0x0a9e('0x5')]),_0x69aeb7);agents[_0x69aeb7[_0x0a9e('0x13')]]=_0x69aeb7;agents[_0x69aeb7[_0x0a9e('0x13')]][_0x0a9e('0x17')]=utils['now']();agents[_0x69aeb7[_0x0a9e('0x13')]]['lastevent']=_0x0a9e('0x18');agents[_0x69aeb7['destuniqueid']][_0x0a9e('0xa')]=null;agents[_0x69aeb7[_0x0a9e('0x13')]]['connectedlinename']=null;utils[_0x0a9e('0x3')](util['format'](_0x0a9e('0x19'),_0x69aeb7[_0x0a9e('0x5')],agents[_0x69aeb7[_0x0a9e('0x13')]][_0x0a9e('0x8')],_0x69aeb7[_0x0a9e('0x13')]));}catch(_0x2eb11f){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x16'),_0x69aeb7[_0x0a9e('0x5')]),_0x2eb11f);}};exports[_0x0a9e('0x1b')]=function(_0x105080){try{if(!_['isNil'](agents[_0x105080[_0x0a9e('0x13')]])){utils[_0x0a9e('0x1c')](util['format'](_0x0a9e('0x1d'),_0x105080['uniqueid']),_0x105080);utils['info'](util[_0x0a9e('0x15')](_0x0a9e('0x1e'),_0x105080[_0x0a9e('0x5')],agents[_0x105080[_0x0a9e('0x13')]]['membername'],_0x105080[_0x0a9e('0x13')]));agents[_0x105080[_0x0a9e('0x13')]][_0x0a9e('0x1b')]=!![];agents[_0x105080[_0x0a9e('0x13')]][_0x0a9e('0x1f')]=utils[_0x0a9e('0x20')]();agents[_0x105080[_0x0a9e('0x13')]]['lastevent']='timeout';agents[_0x105080[_0x0a9e('0x13')]][_0x0a9e('0x21')]=_0x0a9e('0x22');agents[_0x105080[_0x0a9e('0x13')]]['holdtime']=_0x105080[_0x0a9e('0x23')]?parseInt(_0x105080['ringtime'])/0x3e8:0x0;agents[_0x105080[_0x0a9e('0x13')]]['talktime']=0x0;unanswered[_0x0a9e('0x24')](_0x105080[_0x0a9e('0x13')]);}}catch(_0x25fba9){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x1d'),_0x105080[_0x0a9e('0x5')]),_0x25fba9);}};exports[_0x0a9e('0x25')]=function(_0x5a101a){try{_[_0x0a9e('0x26')](agents,function(_0x468813,_0x2b1f27){if(_0x468813[_0x0a9e('0x5')]==_0x5a101a['uniqueid']&&!_[_0x0a9e('0x27')](unanswered,_0x468813[_0x0a9e('0x13')])){utils[_0x0a9e('0x1c')](util[_0x0a9e('0x15')](_0x0a9e('0x28'),_0x5a101a[_0x0a9e('0x5')]),_0x5a101a);utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')](_0x0a9e('0x29'),_0x5a101a['uniqueid'],_0x468813[_0x0a9e('0x8')],_0x468813['destuniqueid']));_0x468813[_0x0a9e('0x1b')]=!![];_0x468813[_0x0a9e('0x1f')]=utils[_0x0a9e('0x20')]();_0x468813[_0x0a9e('0xb')]=_0x0a9e('0x2a');_0x468813['reason']=_0x0a9e('0x2a');_0x468813[_0x0a9e('0x2b')]=_0x5a101a[_0x0a9e('0x2b')];_0x468813[_0x0a9e('0x2c')]=0x0;writeDB(_0x468813);}});}catch(_0x2b45ea){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x28'),_0x5a101a['uniqueid']),_0x2b45ea);}};exports[_0x0a9e('0x2d')]=function(_0x5e7238){try{if(agents[_0x5e7238[_0x0a9e('0x13')]]){utils[_0x0a9e('0x1c')](util[_0x0a9e('0x15')](_0x0a9e('0x2e'),_0x5e7238['uniqueid']),_0x5e7238);utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')](_0x0a9e('0x2f'),_0x5e7238[_0x0a9e('0x5')],agents[_0x5e7238['destuniqueid']]['membername'],_0x5e7238[_0x0a9e('0x13')]));agents[_0x5e7238['destuniqueid']][_0x0a9e('0x30')]=utils[_0x0a9e('0x20')]();agents[_0x5e7238[_0x0a9e('0x13')]][_0x0a9e('0xa')]=_0x5e7238['connectedlinenum'];agents[_0x5e7238[_0x0a9e('0x13')]][_0x0a9e('0x31')]=_0x5e7238[_0x0a9e('0x31')];agents[_0x5e7238['destuniqueid']][_0x0a9e('0x2b')]=_0x5e7238[_0x0a9e('0x23')];agents[_0x5e7238[_0x0a9e('0x13')]]['lastevent']='connect';_[_0x0a9e('0x26')](agents,function(_0x40d766,_0x5adda1){if(_0x40d766[_0x0a9e('0x13')]!=_0x5e7238[_0x0a9e('0x13')]&&_0x40d766[_0x0a9e('0x5')]==_0x5e7238[_0x0a9e('0x5')]){_0x40d766['talktime']=0x0;_0x40d766['holdtime']=_0x5e7238[_0x0a9e('0x23')];_0x40d766[_0x0a9e('0x1b')]=!![];_0x40d766['agentringnoanswerAt']=utils[_0x0a9e('0x20')]();_0x40d766[_0x0a9e('0xb')]=_0x0a9e('0x32');_0x40d766['reason']=_0x0a9e('0x32');_0x40d766[_0x0a9e('0x33')]=_0x5e7238[_0x0a9e('0x13')];_0x40d766[_0x0a9e('0x34')]=_0x5e7238[_0x0a9e('0x8')];writeDB(_0x40d766);}});}}catch(_0xeaa5e5){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x2e'),_0x5e7238[_0x0a9e('0x5')]),_0xeaa5e5);}};exports[_0x0a9e('0xe')]=function(_0x148007){try{if(!_[_0x0a9e('0x35')](agents[_0x148007[_0x0a9e('0x13')]])){utils[_0x0a9e('0x1c')](util['format']('[%s][agents][agentcomplete]',_0x148007[_0x0a9e('0x5')]),_0x148007);utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')](_0x0a9e('0x36'),_0x148007[_0x0a9e('0x5')],agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0x8')],_0x148007[_0x0a9e('0x13')]));agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0xe')]=!![];agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0x37')]=utils['now']();agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0x2c')]=utils[_0x0a9e('0x38')](agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0x37')],agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0x30')]);agents[_0x148007[_0x0a9e('0x13')]]['reason']=_0x148007[_0x0a9e('0x21')];agents[_0x148007['destuniqueid']][_0x0a9e('0xb')]=_0x0a9e('0x39');writeDB(agents[_0x148007[_0x0a9e('0x13')]]);}}catch(_0x562fb4){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x3a'),_0x148007[_0x0a9e('0x5')]),_0x562fb4);}};exports[_0x0a9e('0x3b')]=function(_0x37be73){try{if(!_[_0x0a9e('0x35')](agents[_0x37be73['transfereruniqueid']])){utils[_0x0a9e('0x1c')](util[_0x0a9e('0x15')](_0x0a9e('0x3c'),_0x37be73[_0x0a9e('0x5')]),_0x37be73);utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')](_0x0a9e('0x3d'),_0x37be73[_0x0a9e('0x5')],agents[_0x37be73[_0x0a9e('0x3e')]]['membername'],agents[_0x37be73[_0x0a9e('0x3e')]][_0x0a9e('0x5')]));agents[_0x37be73['transfereruniqueid']]['transfer']=!![];agents[_0x37be73['transfereruniqueid']][_0x0a9e('0x3f')]=_0x0a9e('0x40');agents[_0x37be73[_0x0a9e('0x3e')]][_0x0a9e('0x41')]=_0x37be73[_0x0a9e('0x42')];agents[_0x37be73[_0x0a9e('0x3e')]][_0x0a9e('0x43')]=agents[_0x37be73[_0x0a9e('0x3e')]]['uniqueid'];}}catch(_0x4b1b9f){utils['error'](util[_0x0a9e('0x15')](_0x0a9e('0x3c'),_0x37be73[_0x0a9e('0x5')]),_0x4b1b9f);}};exports['attendedtransfer']=function(_0x2b69d9){try{utils[_0x0a9e('0x1c')](util['format']('[%s][agents][attendedtransfer]',_0x2b69d9[_0x0a9e('0x44')]),_0x2b69d9);if(_0x2b69d9['origtransfereruniqueid']==_0x2b69d9[_0x0a9e('0x45')]){if(!_['isNil'](agents[_0x2b69d9[_0x0a9e('0x46')]])){utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x2b69d9[_0x0a9e('0x44')],agents[_0x2b69d9[_0x0a9e('0x46')]]['membername']));agents[_0x2b69d9['secondtransfereruniqueid']][_0x0a9e('0x47')]=!![];agents[_0x2b69d9[_0x0a9e('0x46')]]['transfertype']=_0x0a9e('0x48');agents[_0x2b69d9['secondtransfereruniqueid']][_0x0a9e('0x41')]=_0x2b69d9['origtransfererexten'];agents[_0x2b69d9[_0x0a9e('0x46')]]['transferuniqueid']=_0x2b69d9['origtransfereruniqueid'];}if(_0x2b69d9['transfereeuniqueid']&&agents[_0x2b69d9[_0x0a9e('0x49')]]){agents[_0x2b69d9['transfereeuniqueid']][_0x0a9e('0x4a')]=0x1;transfers[_0x2b69d9[_0x0a9e('0x49')]]=_[_0x0a9e('0x4b')](agents[_0x2b69d9[_0x0a9e('0x49')]]);transfers[_0x2b69d9[_0x0a9e('0x49')]][_0x0a9e('0x9')]=agents[_0x2b69d9[_0x0a9e('0x46')]][_0x0a9e('0x9')];transfers[_0x2b69d9['transfereeuniqueid']][_0x0a9e('0x4c')]=agents[_0x2b69d9[_0x0a9e('0x46')]][_0x0a9e('0x4c')];transfers[_0x2b69d9[_0x0a9e('0x49')]][_0x0a9e('0x17')]=utils[_0x0a9e('0x20')]();transfers[_0x2b69d9['transfereeuniqueid']][_0x0a9e('0x30')]=utils[_0x0a9e('0x20')]();transfers[_0x2b69d9['transfereeuniqueid']][_0x0a9e('0x2b')]=0x0;transfers[_0x2b69d9['transfereeuniqueid']][_0x0a9e('0x4a')]=0x2;}}else if(_0x2b69d9['secondtransfereruniqueid']==_0x2b69d9['secondtransfererlinkedid']){if(!_['isNil'](agents[_0x2b69d9[_0x0a9e('0x44')]])){utils['info'](util[_0x0a9e('0x15')](_0x0a9e('0x4d'),_0x2b69d9[_0x0a9e('0x44')],agents[_0x2b69d9[_0x0a9e('0x44')]][_0x0a9e('0x8')]));agents[_0x2b69d9[_0x0a9e('0x44')]]['transfer']=!![];agents[_0x2b69d9[_0x0a9e('0x44')]]['transfertype']=_0x0a9e('0x48');agents[_0x2b69d9[_0x0a9e('0x44')]][_0x0a9e('0x41')]=_0x2b69d9['secondtransfererexten'];agents[_0x2b69d9[_0x0a9e('0x44')]][_0x0a9e('0x43')]=_0x2b69d9[_0x0a9e('0x46')];}if(_0x2b69d9[_0x0a9e('0x4e')]&&agents[_0x2b69d9['transfertargetuniqueid']]){agents[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x4a')]=0x1;transfers[_0x2b69d9['transfertargetuniqueid']]=_[_0x0a9e('0x4b')](agents[_0x2b69d9[_0x0a9e('0x4e')]]);transfers[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x9')]=agents[_0x2b69d9[_0x0a9e('0x44')]]['calleridnum'];transfers[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x4c')]=agents[_0x2b69d9[_0x0a9e('0x44')]]['calleridname'];transfers[_0x2b69d9[_0x0a9e('0x4e')]]['agentcalledAt']=utils['now']();transfers[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x30')]=utils[_0x0a9e('0x20')]();transfers[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x2b')]=0x0;transfers[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x4a')]=0x2;}}}catch(_0x54a37d){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x4f'),_0x2b69d9[_0x0a9e('0x44')]),_0x54a37d);}};exports[_0x0a9e('0x50')]=function(_0x2b8192){try{utils[_0x0a9e('0x1c')](util[_0x0a9e('0x15')](_0x0a9e('0x51'),_0x2b8192[_0x0a9e('0x5')]),_0x2b8192);if(agents[_0x2b8192['uniqueid']]&&agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')]===_0x0a9e('0x22')){if(_0x2b8192['cause']==='21'){agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')]='rejected';agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0xb')]=_0x0a9e('0x52');}utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x2b8192['uniqueid'],agents[_0x2b8192['uniqueid']][_0x0a9e('0x8')],agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')],agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0xb')]));writeDB(agents[_0x2b8192[_0x0a9e('0x5')]]);var _0xeef20=unanswered[_0x0a9e('0x53')](_0x2b8192['uniqueid']);if(_0xeef20>-0x1){unanswered[_0x0a9e('0x54')](_0xeef20,0x1);}}if(transfers[_0x2b8192[_0x0a9e('0x5')]]){transfers[_0x2b8192[_0x0a9e('0x5')]]['agentcomplete']=!![];transfers[_0x2b8192[_0x0a9e('0x5')]]['agentcompleteAt']=utils[_0x0a9e('0x20')]();transfers[_0x2b8192[_0x0a9e('0x5')]]['talktime']=utils[_0x0a9e('0x38')](transfers[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x37')],transfers[_0x2b8192[_0x0a9e('0x5')]]['agentconnectAt']);transfers[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')]=_0x0a9e('0x55');transfers[_0x2b8192[_0x0a9e('0x5')]]['lastevent']=_0x0a9e('0x39');utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')](_0x0a9e('0x56'),_0x2b8192['uniqueid'],transfers[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x8')],transfers[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')],transfers[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0xb')]));writeDB(transfers[_0x2b8192[_0x0a9e('0x5')]],!![]);}if(agents[_0x2b8192[_0x0a9e('0x5')]]&&agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x30')]){agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0xe')]=!![];agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x37')]=utils['now']();agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x2c')]=utils[_0x0a9e('0x38')](agents[_0x2b8192['uniqueid']][_0x0a9e('0x37')],agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x30')]);agents[_0x2b8192[_0x0a9e('0x5')]]['reason']=agents[_0x2b8192['uniqueid']][_0x0a9e('0x47')]?_0x0a9e('0x47'):'agent';agents[_0x2b8192[_0x0a9e('0x5')]]['lastevent']=_0x0a9e('0x39');utils[_0x0a9e('0x3')](util['format'](_0x0a9e('0x56'),_0x2b8192[_0x0a9e('0x5')],agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x8')],agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')],agents[_0x2b8192[_0x0a9e('0x5')]]['lastevent']));writeDB(agents[_0x2b8192[_0x0a9e('0x5')]]);}}catch(_0x3ca9b9){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')]('[%s][agents][hangup]',_0x2b8192[_0x0a9e('0x5')]),_0x3ca9b9);}}; \ No newline at end of file +var _0x96cc=['rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','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','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acwtime','acwTimeout','CreateVoiceAgentReport','request','agentcalled','debug','destuniqueid','agentcalledAt','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','reason','timeout','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','agentconnectAt','connectedlinename','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','calleridnum','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','clone','hangup','[%s][agents][hangup]','cause'];(function(_0x29183c,_0x8eed2d){var _0x487e7b=function(_0x2a799c){while(--_0x2a799c){_0x29183c['push'](_0x29183c['shift']());}};_0x487e7b(++_0x8eed2d);}(_0x96cc,0x16c));var _0xc96c=function(_0x33541d,_0xaee09e){_0x33541d=_0x33541d-0x0;var _0x52d9a5=_0x96cc[_0x33541d];return _0x52d9a5;};'use strict';var _=require(_0xc96c('0x0'));var util=require('util');var utils=require(_0xc96c('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5f11f2,_0x30bf8a){utils[_0xc96c('0x2')](util[_0xc96c('0x3')](_0xc96c('0x4'),_0x5f11f2[_0xc96c('0x5')],_0x5f11f2[_0xc96c('0x6')],_0x5f11f2[_0xc96c('0x7')],_0x5f11f2[_0xc96c('0x8')],_0x5f11f2[_0xc96c('0x9')],_0x5f11f2['calleridnum'],_0x5f11f2[_0xc96c('0xa')],_0x5f11f2[_0xc96c('0xb')]));if(_0x5f11f2[_0xc96c('0x7')]){utils[_0xc96c('0xc')](_0x5f11f2[_0xc96c('0x7')])[_0xc96c('0xd')](function(_0x36b2b4){if(_0x36b2b4){_0x5f11f2['type']=_0x36b2b4[_0xc96c('0xe')];_0x5f11f2[_0xc96c('0xf')]=_0x5f11f2[_0xc96c('0x10')]?_0x36b2b4['acw']:![];_0x5f11f2[_0xc96c('0x11')]=_0x5f11f2['agentacw']?_0x36b2b4[_0xc96c('0x12')]:0x0;}utils['request'](_0xc96c('0x13'),_0x5f11f2);});}else{utils[_0xc96c('0x14')](_0xc96c('0x13'),_0x5f11f2);}if(_0x30bf8a){delete transfers[_0x5f11f2[_0xc96c('0x5')]];}else{delete agents[_0x5f11f2['destuniqueid']];}}exports[_0xc96c('0x15')]=function(_0x43fcaa){try{utils[_0xc96c('0x16')](util[_0xc96c('0x3')]('[%s][agents][agentcalled]',_0x43fcaa[_0xc96c('0x5')]),_0x43fcaa);agents[_0x43fcaa[_0xc96c('0x17')]]=_0x43fcaa;agents[_0x43fcaa[_0xc96c('0x17')]][_0xc96c('0x18')]=utils[_0xc96c('0x19')]();agents[_0x43fcaa[_0xc96c('0x17')]][_0xc96c('0xb')]=_0xc96c('0x1a');agents[_0x43fcaa[_0xc96c('0x17')]][_0xc96c('0xa')]=null;agents[_0x43fcaa[_0xc96c('0x17')]]['connectedlinename']=null;utils['info'](util[_0xc96c('0x3')](_0xc96c('0x1b'),_0x43fcaa[_0xc96c('0x5')],agents[_0x43fcaa[_0xc96c('0x17')]]['membername'],_0x43fcaa[_0xc96c('0x17')]));}catch(_0x100fdb){utils[_0xc96c('0x1c')](util[_0xc96c('0x3')](_0xc96c('0x1d'),_0x43fcaa[_0xc96c('0x5')]),_0x100fdb);}};exports[_0xc96c('0x1e')]=function(_0x41daba){try{if(!_[_0xc96c('0x1f')](agents[_0x41daba[_0xc96c('0x17')]])){utils[_0xc96c('0x16')](util[_0xc96c('0x3')](_0xc96c('0x20'),_0x41daba[_0xc96c('0x5')]),_0x41daba);utils[_0xc96c('0x2')](util[_0xc96c('0x3')](_0xc96c('0x21'),_0x41daba['uniqueid'],agents[_0x41daba[_0xc96c('0x17')]][_0xc96c('0x8')],_0x41daba[_0xc96c('0x17')]));agents[_0x41daba[_0xc96c('0x17')]][_0xc96c('0x1e')]=!![];agents[_0x41daba[_0xc96c('0x17')]][_0xc96c('0x22')]=utils[_0xc96c('0x19')]();agents[_0x41daba[_0xc96c('0x17')]][_0xc96c('0xb')]='timeout';agents[_0x41daba[_0xc96c('0x17')]][_0xc96c('0x23')]=_0xc96c('0x24');agents[_0x41daba[_0xc96c('0x17')]]['holdtime']=_0x41daba['ringtime']?parseInt(_0x41daba[_0xc96c('0x25')])/0x3e8:0x0;agents[_0x41daba[_0xc96c('0x17')]][_0xc96c('0x26')]=0x0;unanswered[_0xc96c('0x27')](_0x41daba[_0xc96c('0x17')]);}}catch(_0x5e1727){utils[_0xc96c('0x1c')](util[_0xc96c('0x3')](_0xc96c('0x20'),_0x41daba[_0xc96c('0x5')]),_0x5e1727);}};exports[_0xc96c('0x28')]=function(_0x40c72b){try{_[_0xc96c('0x29')](agents,function(_0x328ee4,_0x556108){if(_0x328ee4[_0xc96c('0x5')]==_0x40c72b['uniqueid']&&!_[_0xc96c('0x2a')](unanswered,_0x328ee4[_0xc96c('0x17')])){utils[_0xc96c('0x16')](util['format'](_0xc96c('0x2b'),_0x40c72b[_0xc96c('0x5')]),_0x40c72b);utils[_0xc96c('0x2')](util[_0xc96c('0x3')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x40c72b['uniqueid'],_0x328ee4[_0xc96c('0x8')],_0x328ee4[_0xc96c('0x17')]));_0x328ee4[_0xc96c('0x1e')]=!![];_0x328ee4['agentringnoanswerAt']=utils[_0xc96c('0x19')]();_0x328ee4[_0xc96c('0xb')]=_0xc96c('0x2c');_0x328ee4[_0xc96c('0x23')]='abandoned';_0x328ee4[_0xc96c('0x2d')]=_0x40c72b[_0xc96c('0x2d')];_0x328ee4['talktime']=0x0;writeDB(_0x328ee4);}});}catch(_0x2b1dec){utils[_0xc96c('0x1c')](util[_0xc96c('0x3')](_0xc96c('0x2b'),_0x40c72b[_0xc96c('0x5')]),_0x2b1dec);}};exports[_0xc96c('0x2e')]=function(_0x4e8241){try{if(agents[_0x4e8241[_0xc96c('0x17')]]){utils[_0xc96c('0x16')](util[_0xc96c('0x3')](_0xc96c('0x2f'),_0x4e8241[_0xc96c('0x5')]),_0x4e8241);utils[_0xc96c('0x2')](util['format']('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x4e8241[_0xc96c('0x5')],agents[_0x4e8241[_0xc96c('0x17')]]['membername'],_0x4e8241['destuniqueid']));agents[_0x4e8241[_0xc96c('0x17')]][_0xc96c('0x30')]=utils[_0xc96c('0x19')]();agents[_0x4e8241[_0xc96c('0x17')]][_0xc96c('0xa')]=_0x4e8241[_0xc96c('0xa')];agents[_0x4e8241[_0xc96c('0x17')]][_0xc96c('0x31')]=_0x4e8241[_0xc96c('0x31')];agents[_0x4e8241[_0xc96c('0x17')]][_0xc96c('0x2d')]=_0x4e8241['ringtime'];agents[_0x4e8241[_0xc96c('0x17')]][_0xc96c('0xb')]=_0xc96c('0x32');_[_0xc96c('0x29')](agents,function(_0x4eb180,_0x167671){if(_0x4eb180[_0xc96c('0x17')]!=_0x4e8241[_0xc96c('0x17')]&&_0x4eb180['uniqueid']==_0x4e8241['uniqueid']){_0x4eb180[_0xc96c('0x26')]=0x0;_0x4eb180[_0xc96c('0x2d')]=_0x4e8241[_0xc96c('0x25')];_0x4eb180['agentringnoanswer']=!![];_0x4eb180[_0xc96c('0x22')]=utils[_0xc96c('0x19')]();_0x4eb180[_0xc96c('0xb')]=_0xc96c('0x33');_0x4eb180[_0xc96c('0x23')]=_0xc96c('0x33');_0x4eb180[_0xc96c('0x34')]=_0x4e8241[_0xc96c('0x17')];_0x4eb180[_0xc96c('0x35')]=_0x4e8241['membername'];writeDB(_0x4eb180);}});}}catch(_0x4c3088){utils[_0xc96c('0x1c')](util[_0xc96c('0x3')](_0xc96c('0x2f'),_0x4e8241[_0xc96c('0x5')]),_0x4c3088);}};exports['agentcomplete']=function(_0x5ee6ac){try{if(!_[_0xc96c('0x1f')](agents[_0x5ee6ac[_0xc96c('0x17')]])){utils[_0xc96c('0x16')](util[_0xc96c('0x3')](_0xc96c('0x36'),_0x5ee6ac[_0xc96c('0x5')]),_0x5ee6ac);utils[_0xc96c('0x2')](util['format'](_0xc96c('0x37'),_0x5ee6ac[_0xc96c('0x5')],agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0x8')],_0x5ee6ac['destuniqueid']));agents[_0x5ee6ac['destuniqueid']][_0xc96c('0x10')]=!![];agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0x38')]=utils[_0xc96c('0x19')]();agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0x26')]=utils[_0xc96c('0x39')](agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0x38')],agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0x30')]);agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0x23')]=_0x5ee6ac['reason'];agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0xb')]=_0xc96c('0x3a');writeDB(agents[_0x5ee6ac[_0xc96c('0x17')]]);}}catch(_0x56bce1){utils[_0xc96c('0x1c')](util['format'](_0xc96c('0x36'),_0x5ee6ac[_0xc96c('0x5')]),_0x56bce1);}};exports['blindtransfer']=function(_0x2581ae){try{if(!_[_0xc96c('0x1f')](agents[_0x2581ae[_0xc96c('0x3b')]])){utils[_0xc96c('0x16')](util[_0xc96c('0x3')](_0xc96c('0x3c'),_0x2581ae['uniqueid']),_0x2581ae);utils['info'](util['format'](_0xc96c('0x3d'),_0x2581ae['uniqueid'],agents[_0x2581ae[_0xc96c('0x3b')]][_0xc96c('0x8')],agents[_0x2581ae[_0xc96c('0x3b')]][_0xc96c('0x5')]));agents[_0x2581ae[_0xc96c('0x3b')]][_0xc96c('0x3e')]=!![];agents[_0x2581ae[_0xc96c('0x3b')]][_0xc96c('0x3f')]=_0xc96c('0x40');agents[_0x2581ae[_0xc96c('0x3b')]]['transferexten']=_0x2581ae[_0xc96c('0x41')];agents[_0x2581ae[_0xc96c('0x3b')]][_0xc96c('0x42')]=agents[_0x2581ae[_0xc96c('0x3b')]][_0xc96c('0x5')];}}catch(_0xcde9){utils[_0xc96c('0x1c')](util[_0xc96c('0x3')]('[%s][agents][blindtransfer]',_0x2581ae['uniqueid']),_0xcde9);}};exports['attendedtransfer']=function(_0x5c3d95){try{utils[_0xc96c('0x16')](util[_0xc96c('0x3')](_0xc96c('0x43'),_0x5c3d95[_0xc96c('0x44')]),_0x5c3d95);if(_0x5c3d95[_0xc96c('0x44')]==_0x5c3d95[_0xc96c('0x45')]){if(!_[_0xc96c('0x1f')](agents[_0x5c3d95['secondtransfereruniqueid']])){utils[_0xc96c('0x2')](util[_0xc96c('0x3')](_0xc96c('0x46'),_0x5c3d95[_0xc96c('0x44')],agents[_0x5c3d95[_0xc96c('0x47')]][_0xc96c('0x8')]));agents[_0x5c3d95[_0xc96c('0x47')]]['transfer']=!![];agents[_0x5c3d95[_0xc96c('0x47')]][_0xc96c('0x3f')]=_0xc96c('0x48');agents[_0x5c3d95[_0xc96c('0x47')]][_0xc96c('0x49')]=_0x5c3d95[_0xc96c('0x4a')];agents[_0x5c3d95[_0xc96c('0x47')]][_0xc96c('0x42')]=_0x5c3d95[_0xc96c('0x44')];}if(_0x5c3d95[_0xc96c('0x4b')]&&agents[_0x5c3d95[_0xc96c('0x4b')]]){agents[_0x5c3d95[_0xc96c('0x4b')]][_0xc96c('0x4c')]=0x1;transfers[_0x5c3d95[_0xc96c('0x4b')]]=_['clone'](agents[_0x5c3d95[_0xc96c('0x4b')]]);transfers[_0x5c3d95[_0xc96c('0x4b')]][_0xc96c('0x4d')]=agents[_0x5c3d95[_0xc96c('0x47')]][_0xc96c('0x4d')];transfers[_0x5c3d95['transfereeuniqueid']][_0xc96c('0x4e')]=agents[_0x5c3d95[_0xc96c('0x47')]][_0xc96c('0x4e')];transfers[_0x5c3d95[_0xc96c('0x4b')]]['agentcalledAt']=utils[_0xc96c('0x19')]();transfers[_0x5c3d95[_0xc96c('0x4b')]]['agentconnectAt']=utils['now']();transfers[_0x5c3d95['transfereeuniqueid']][_0xc96c('0x2d')]=0x0;transfers[_0x5c3d95[_0xc96c('0x4b')]][_0xc96c('0x4c')]=0x2;}}else if(_0x5c3d95[_0xc96c('0x47')]==_0x5c3d95[_0xc96c('0x4f')]){if(!_['isNil'](agents[_0x5c3d95['origtransfereruniqueid']])){utils[_0xc96c('0x2')](util[_0xc96c('0x3')](_0xc96c('0x46'),_0x5c3d95[_0xc96c('0x44')],agents[_0x5c3d95[_0xc96c('0x44')]]['membername']));agents[_0x5c3d95[_0xc96c('0x44')]][_0xc96c('0x3e')]=!![];agents[_0x5c3d95[_0xc96c('0x44')]][_0xc96c('0x3f')]='ATTENDED';agents[_0x5c3d95['origtransfereruniqueid']][_0xc96c('0x49')]=_0x5c3d95[_0xc96c('0x50')];agents[_0x5c3d95['origtransfereruniqueid']][_0xc96c('0x42')]=_0x5c3d95['secondtransfereruniqueid'];}if(_0x5c3d95[_0xc96c('0x51')]&&agents[_0x5c3d95[_0xc96c('0x51')]]){agents[_0x5c3d95[_0xc96c('0x51')]][_0xc96c('0x4c')]=0x1;transfers[_0x5c3d95[_0xc96c('0x51')]]=_[_0xc96c('0x52')](agents[_0x5c3d95[_0xc96c('0x51')]]);transfers[_0x5c3d95[_0xc96c('0x51')]][_0xc96c('0x4d')]=agents[_0x5c3d95[_0xc96c('0x44')]]['calleridnum'];transfers[_0x5c3d95[_0xc96c('0x51')]]['calleridname']=agents[_0x5c3d95[_0xc96c('0x44')]][_0xc96c('0x4e')];transfers[_0x5c3d95['transfertargetuniqueid']][_0xc96c('0x18')]=utils['now']();transfers[_0x5c3d95[_0xc96c('0x51')]][_0xc96c('0x30')]=utils[_0xc96c('0x19')]();transfers[_0x5c3d95[_0xc96c('0x51')]][_0xc96c('0x2d')]=0x0;transfers[_0x5c3d95[_0xc96c('0x51')]][_0xc96c('0x4c')]=0x2;}}}catch(_0xbd6525){utils[_0xc96c('0x1c')](util['format'](_0xc96c('0x43'),_0x5c3d95[_0xc96c('0x44')]),_0xbd6525);}};exports[_0xc96c('0x53')]=function(_0x43f94e){try{utils['debug'](util[_0xc96c('0x3')](_0xc96c('0x54'),_0x43f94e['uniqueid']),_0x43f94e);if(agents[_0x43f94e['uniqueid']]&&agents[_0x43f94e[_0xc96c('0x5')]]['reason']===_0xc96c('0x24')){if(_0x43f94e[_0xc96c('0x55')]==='21'){agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x23')]=_0xc96c('0x56');agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0xb')]=_0xc96c('0x56');}utils[_0xc96c('0x2')](util['format'](_0xc96c('0x57'),_0x43f94e[_0xc96c('0x5')],agents[_0x43f94e[_0xc96c('0x5')]]['membername'],agents[_0x43f94e['uniqueid']][_0xc96c('0x23')],agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0xb')]));writeDB(agents[_0x43f94e[_0xc96c('0x5')]]);var _0x1efa88=unanswered[_0xc96c('0x58')](_0x43f94e[_0xc96c('0x5')]);if(_0x1efa88>-0x1){unanswered['splice'](_0x1efa88,0x1);}}if(transfers[_0x43f94e[_0xc96c('0x5')]]){transfers[_0x43f94e[_0xc96c('0x5')]]['agentcomplete']=!![];transfers[_0x43f94e[_0xc96c('0x5')]]['agentcompleteAt']=utils[_0xc96c('0x19')]();transfers[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x26')]=utils[_0xc96c('0x39')](transfers[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x38')],transfers[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x30')]);transfers[_0x43f94e[_0xc96c('0x5')]]['reason']=_0xc96c('0x59');transfers[_0x43f94e[_0xc96c('0x5')]]['lastevent']=_0xc96c('0x3a');utils['info'](util[_0xc96c('0x3')](_0xc96c('0x57'),_0x43f94e[_0xc96c('0x5')],transfers[_0x43f94e['uniqueid']][_0xc96c('0x8')],transfers[_0x43f94e[_0xc96c('0x5')]]['reason'],transfers[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0xb')]));writeDB(transfers[_0x43f94e[_0xc96c('0x5')]],!![]);}if(agents[_0x43f94e['uniqueid']]&&agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x30')]){agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x10')]=!![];agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x38')]=utils[_0xc96c('0x19')]();agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x26')]=utils[_0xc96c('0x39')](agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x38')],agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x30')]);agents[_0x43f94e[_0xc96c('0x5')]]['reason']=agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x3e')]?_0xc96c('0x3e'):_0xc96c('0x59');agents[_0x43f94e[_0xc96c('0x5')]]['lastevent']=_0xc96c('0x3a');utils[_0xc96c('0x2')](util[_0xc96c('0x3')](_0xc96c('0x57'),_0x43f94e[_0xc96c('0x5')],agents[_0x43f94e['uniqueid']]['membername'],agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x23')],agents[_0x43f94e['uniqueid']][_0xc96c('0xb')]));writeDB(agents[_0x43f94e[_0xc96c('0x5')]]);}}catch(_0x563449){utils[_0xc96c('0x1c')](util[_0xc96c('0x3')]('[%s][agents][hangup]',_0x43f94e[_0xc96c('0x5')]),_0x563449);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index e846e74..249262e 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 _0x0958=['set','startsWith','appdata','toLowerCase','cdr','split','lastIndexOf','includes','hangup','execif','gotoif','lastdata','lodash','util','./utils','NO\x20ANSWER','FAILED','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','interface','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','blinds','recording','newchannel','[%s][calls][newchannel]','linkedid','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','debug','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','disposition','toNumber','[%s][calls][newstate]','[%s][calls][hangup]','callerid','calleridnum','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','diffTime','endtime','starttime','billableseconds','answertime','attendedtransfer','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','_attended','transfertargetchannel','origtransfererchannel','userfield','[%s][calls][attendedtransfer]','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','variable','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','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application'];(function(_0x1731a9,_0x4fb551){var _0x22b9a5=function(_0x3b62fd){while(--_0x3b62fd){_0x1731a9['push'](_0x1731a9['shift']());}};_0x22b9a5(++_0x4fb551);}(_0x0958,0x7c));var _0x8095=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0958[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x8095('0x0'));var util=require(_0x8095('0x1'));var utils=require(_0x8095('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0x8095('0x3'),_0x8095('0x4'),'FAILED','NO\x20ANSWER',_0x8095('0x3'),_0x8095('0x3'),'ANSWERED','BUSY',_0x8095('0x4'),_0x8095('0x4'),_0x8095('0x4')];var channels={};function writeDB(_0x1dac39){var _0x1fac84;if(transfers['blinds'][_0x1dac39['uniqueid']]){_0x1fac84=_0x1dac39[_0x8095('0x5')];_0x1dac39[_0x8095('0x5')]=transfers['blinds'][_0x1dac39['uniqueid']][_0x8095('0x6')];}utils['info'](util[_0x8095('0x7')](_0x8095('0x8'),_0x1dac39[_0x8095('0x5')],_0x1dac39[_0x8095('0x9')],_0x1dac39[_0x8095('0xa')],_0x1dac39['membername'],_0x1dac39[_0x8095('0xb')],_0x1dac39['calleridnum'],_0x1dac39[_0x8095('0xc')],_0x1dac39[_0x8095('0xd')]));if(_0x1dac39[_0x8095('0xe')]){utils[_0x8095('0xf')](_0x1dac39[_0x8095('0xe')])[_0x8095('0x10')](function(_0x5cfc5f){if(_0x5cfc5f){_0x1dac39[_0x8095('0x11')]=_0x5cfc5f['id'];}utils[_0x8095('0x12')](_0x8095('0x13'),_0x1dac39);});}else{utils['request'](_0x8095('0x13'),_0x1dac39);}if(channels[_0x1dac39[_0x8095('0x5')]]){delete channels[_0x1dac39[_0x8095('0x5')]];}else if(_0x1fac84&&channels[_0x1fac84]){if(!transfers[_0x8095('0x14')][_0x1fac84][_0x8095('0x15')])delete transfers['blinds'][_0x1fac84];delete channels[_0x1fac84];}}exports[_0x8095('0x16')]=function(_0x463d6e){try{utils['debug'](util['format'](_0x8095('0x17'),_0x463d6e['uniqueid']),_0x463d6e);if(_0x463d6e[_0x8095('0x5')]==_0x463d6e[_0x8095('0x18')]&&_0x463d6e[_0x8095('0x9')]!='OutgoingSpoolFailed'){utils[_0x8095('0x19')](util[_0x8095('0x7')](_0x8095('0x1a'),_0x463d6e['uniqueid'],_0x463d6e[_0x8095('0x1b')],_0x463d6e[_0x8095('0x1c')]));channels[_0x463d6e[_0x8095('0x5')]]={'uniqueid':_0x463d6e['uniqueid'],'accountcode':_0x463d6e[_0x8095('0xe')],'source':_0x463d6e['calleridnum'],'destination':_0x463d6e[_0x8095('0x1c')],'destinationcontext':_0x463d6e[_0x8095('0x1b')],'channel':_0x463d6e[_0x8095('0x9')],'starttime':utils[_0x8095('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x8095('0x3'),'amaflags':_0x8095('0x1e')};}}catch(_0x2a7bb6){utils[_0x8095('0x1f')](util[_0x8095('0x7')](_0x8095('0x17'),_0x463d6e[_0x8095('0x5')]),_0x2a7bb6);}};exports[_0x8095('0x20')]=function(_0x33397a){try{utils[_0x8095('0x21')](util['format']('[%s][calls][newstate]',_0x33397a[_0x8095('0x5')]),_0x33397a);if(!_[_0x8095('0x22')](channels[_0x33397a[_0x8095('0x5')]])&&_0x33397a[_0x8095('0x23')]==0x6){utils[_0x8095('0x19')](util[_0x8095('0x7')](_0x8095('0x24'),_0x33397a[_0x8095('0x5')],_0x33397a[_0x8095('0x1b')],_0x33397a[_0x8095('0x9')]));if(_[_0x8095('0x22')](channels[_0x33397a[_0x8095('0x5')]][_0x8095('0x25')])){channels[_0x33397a[_0x8095('0x5')]][_0x8095('0x25')]=utils[_0x8095('0x1d')]();}}else if(!_[_0x8095('0x22')](channels[_0x33397a[_0x8095('0x18')]])&&_0x33397a['channelstate']==0x6&&_0x33397a[_0x8095('0x1b')]!=_0x8095('0x26')){utils[_0x8095('0x19')](util[_0x8095('0x7')](_0x8095('0x27'),_0x33397a[_0x8095('0x5')],_0x33397a[_0x8095('0x18')],_0x33397a['context'],_0x33397a['channel']));channels[_0x33397a['linkedid']][_0x8095('0xe')]=_0x33397a['accountcode'];channels[_0x33397a[_0x8095('0x18')]][_0x8095('0x28')]=_0x33397a[_0x8095('0x9')];if(_[_0x8095('0x22')](channels[_0x33397a[_0x8095('0x18')]]['answertime'])){channels[_0x33397a['linkedid']]['answertime']=utils[_0x8095('0x1d')]();}channels[_0x33397a[_0x8095('0x18')]][_0x8095('0x29')]=dispositions[_[_0x8095('0x2a')](_0x33397a[_0x8095('0x23')])]||'ANSWERED';}}catch(_0xf83cdc){utils[_0x8095('0x1f')](util['format'](_0x8095('0x2b'),_0x33397a[_0x8095('0x5')]),_0xf83cdc);}};exports['hangup']=function(_0x6ce708){try{if(!_[_0x8095('0x22')](channels[_0x6ce708[_0x8095('0x5')]])){utils[_0x8095('0x21')](util['format'](_0x8095('0x2c'),_0x6ce708[_0x8095('0x5')]),_0x6ce708);if(_[_0x8095('0x22')](channels[_0x6ce708[_0x8095('0x5')]][_0x8095('0x2d')])){channels[_0x6ce708[_0x8095('0x5')]][_0x8095('0x2d')]=_0x6ce708['calleridname']+'\x20<'+_0x6ce708[_0x8095('0x2e')]+'>';}utils[_0x8095('0x19')](util['format'](_0x8095('0x2f'),_0x6ce708[_0x8095('0x5')],channels[_0x6ce708[_0x8095('0x5')]]['callerid'],_0x6ce708[_0x8095('0x30')]));channels[_0x6ce708[_0x8095('0x5')]]['endtime']=utils[_0x8095('0x1d')]();channels[_0x6ce708[_0x8095('0x5')]][_0x8095('0x31')]=utils[_0x8095('0x32')](channels[_0x6ce708['uniqueid']][_0x8095('0x33')],channels[_0x6ce708[_0x8095('0x5')]][_0x8095('0x34')]);channels[_0x6ce708[_0x8095('0x5')]][_0x8095('0x35')]=channels[_0x6ce708[_0x8095('0x5')]][_0x8095('0x36')]?utils['diffTime'](channels[_0x6ce708[_0x8095('0x5')]][_0x8095('0x33')],channels[_0x6ce708[_0x8095('0x5')]][_0x8095('0x36')]):0x0;writeDB(channels[_0x6ce708['uniqueid']]);}}catch(_0x202a0f){utils[_0x8095('0x1f')](util['format'](_0x8095('0x2c'),_0x6ce708['uniqueid']),_0x202a0f);}};exports[_0x8095('0x37')]=function(_0x2aeac2){try{if(!_[_0x8095('0x22')](channels[_0x2aeac2[_0x8095('0x38')]])){utils[_0x8095('0x21')](util['format']('[%s][calls][attendedtransfer]',_0x2aeac2['origtransfereruniqueid']),_0x2aeac2);if(channels[_0x2aeac2[_0x8095('0x38')]][_0x8095('0x9')]==_0x2aeac2[_0x8095('0x39')]){utils[_0x8095('0x19')](util[_0x8095('0x7')](_0x8095('0x3a'),_0x2aeac2[_0x8095('0x3b')],_0x2aeac2[_0x8095('0x38')],_0x2aeac2[_0x8095('0x3c')]));channels[_0x2aeac2[_0x8095('0x38')]][_0x8095('0x28')]=_0x2aeac2[_0x8095('0x3c')];channels[_0x2aeac2[_0x8095('0x38')]]['userfield']=_0x8095('0x3d');}else if(channels[_0x2aeac2[_0x8095('0x38')]]['channel']=_0x2aeac2[_0x8095('0x3e')]){utils['info'](util[_0x8095('0x7')](_0x8095('0x3a'),_0x2aeac2[_0x8095('0x3b')],_0x2aeac2[_0x8095('0x38')],_0x2aeac2[_0x8095('0x3f')]));channels[_0x2aeac2[_0x8095('0x38')]][_0x8095('0x28')]=_0x2aeac2[_0x8095('0x3f')];channels[_0x2aeac2['localtwolinkedid']][_0x8095('0x40')]=_0x8095('0x3d');}}}catch(_0x27d78f){utils[_0x8095('0x1f')](util[_0x8095('0x7')](_0x8095('0x41'),_0x2aeac2[_0x8095('0x3b')]),_0x27d78f);}};exports[_0x8095('0x42')]=function(_0x2893aa){try{if(!_[_0x8095('0x22')](channels[_0x2893aa[_0x8095('0x5')]])){utils[_0x8095('0x21')](util['format'](_0x8095('0x43'),_0x2893aa['uniqueid']),_0x2893aa);channels[_0x2893aa['uniqueid']][_0x8095('0x44')]=utils[_0x8095('0x1d')]();utils['info'](util['format'](_0x8095('0x45'),_0x2893aa[_0x8095('0x5')],channels[_0x2893aa['uniqueid']][_0x8095('0x44')]));}}catch(_0x238962){utils[_0x8095('0x1f')](util[_0x8095('0x7')](_0x8095('0x43'),_0x2893aa[_0x8095('0x5')]),_0x238962);}};exports[_0x8095('0x46')]=function(_0x5e6764){try{if(!_['isNil'](channels[_0x5e6764[_0x8095('0x5')]])){utils['debug'](util[_0x8095('0x7')]('[%s][calls][musiconholdstop]',_0x5e6764[_0x8095('0x5')]),_0x5e6764);if(!_[_0x8095('0x22')](channels[_0x5e6764['uniqueid']][_0x8095('0x44')])){channels[_0x5e6764[_0x8095('0x5')]]['mohtime']+=utils[_0x8095('0x32')](utils['now'](),channels[_0x5e6764[_0x8095('0x5')]]['musiconholdstartAt']);utils[_0x8095('0x19')](util[_0x8095('0x7')](_0x8095('0x47'),_0x5e6764[_0x8095('0x5')],channels[_0x5e6764[_0x8095('0x5')]][_0x8095('0x48')]));delete channels[_0x5e6764['uniqueid']][_0x8095('0x44')];}}}catch(_0x33fec2){utils[_0x8095('0x1f')](util[_0x8095('0x7')](_0x8095('0x49'),_0x5e6764['uniqueid']),_0x33fec2);}};exports[_0x8095('0x4a')]=function(_0x3f80c0){try{if(!_[_0x8095('0x22')](channels[_0x3f80c0[_0x8095('0x5')]])){utils[_0x8095('0x21')](util['format'](_0x8095('0x4b'),_0x3f80c0['uniqueid']),_0x3f80c0);if(!_[_0x8095('0x22')](_0x3f80c0['variable']['xmd-originatecalleridnum'])){utils[_0x8095('0x19')](util[_0x8095('0x7')](_0x8095('0x4c'),_0x3f80c0[_0x8095('0x5')],_0x3f80c0[_0x8095('0x4d')]));channels[_0x3f80c0[_0x8095('0x5')]]['source']=_0x3f80c0[_0x8095('0x4d')];}if(!_[_0x8095('0x22')](_0x3f80c0[_0x8095('0x4e')][_0x8095('0x4f')])){utils['info'](util[_0x8095('0x7')](_0x8095('0x50'),_0x3f80c0['uniqueid'],_0x3f80c0[_0x8095('0x4d')]));channels[_0x3f80c0[_0x8095('0x5')]][_0x8095('0x51')]=_0x3f80c0[_0x8095('0x4d')];channels[_0x3f80c0[_0x8095('0x5')]][_0x8095('0x2d')]='\x22'+_0x3f80c0[_0x8095('0x4d')]+_0x8095('0x52')+_0x3f80c0[_0x8095('0x4d')]+'>';}if(!_[_0x8095('0x22')](_0x3f80c0[_0x8095('0x4e')][_0x8095('0x53')])||!_[_0x8095('0x22')](_0x3f80c0[_0x8095('0x4e')][_0x8095('0x54')])){utils[_0x8095('0x19')](util[_0x8095('0x7')](_0x8095('0x55'),_0x3f80c0[_0x8095('0x5')],!_[_0x8095('0x22')](_0x3f80c0[_0x8095('0x4e')][_0x8095('0x53')])?_0x8095('0x53'):_0x8095('0x54'),_0x3f80c0[_0x8095('0x4d')]));channels[_0x3f80c0['uniqueid']][_0x8095('0x2d')]=_0x3f80c0['value'];}if(!_[_0x8095('0x22')](_0x3f80c0[_0x8095('0x4e')][_0x8095('0x56')])||!_['isNil'](_0x3f80c0[_0x8095('0x4e')][_0x8095('0x57')])){utils['info'](util[_0x8095('0x7')](_0x8095('0x55'),_0x3f80c0[_0x8095('0x5')],!_[_0x8095('0x22')](_0x3f80c0['variable'][_0x8095('0x56')])?_0x8095('0x56'):'xmcs-queue',_0x3f80c0[_0x8095('0x4d')]));channels[_0x3f80c0[_0x8095('0x5')]][_0x8095('0x58')]='Queue';channels[_0x3f80c0['uniqueid']]['lastdata']=_0x3f80c0[_0x8095('0x4d')];channels[_0x3f80c0[_0x8095('0x5')]][_0x8095('0xa')]=!![];}if(!_['isNil'](_0x3f80c0[_0x8095('0x4e')][_0x8095('0x59')])){utils['info'](util[_0x8095('0x7')](_0x8095('0x5a'),_0x3f80c0['uniqueid'],_0x3f80c0[_0x8095('0x4d')]));channels[_0x3f80c0['uniqueid']][_0x8095('0x5b')]=_0x3f80c0[_0x8095('0x4d')];}if(!_[_0x8095('0x22')](_0x3f80c0[_0x8095('0x4e')][_0x8095('0x5c')])){utils[_0x8095('0x19')](util['format']('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x3f80c0[_0x8095('0x5')],_0x3f80c0[_0x8095('0x4d')]));channels[_0x3f80c0[_0x8095('0x5')]][_0x8095('0x5d')]=_0x3f80c0[_0x8095('0x4d')];}if(!_['isNil'](_0x3f80c0[_0x8095('0x4e')]['outboundrouteid'])){utils['info'](util[_0x8095('0x7')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x3f80c0[_0x8095('0x5')],_0x3f80c0['value']));channels[_0x3f80c0[_0x8095('0x5')]][_0x8095('0x5e')]=_0x3f80c0[_0x8095('0x4d')];}if(!_[_0x8095('0x22')](_0x3f80c0[_0x8095('0x4e')]['sipcallid'])){utils[_0x8095('0x19')](util[_0x8095('0x7')](_0x8095('0x5f'),_0x3f80c0['uniqueid'],_0x3f80c0[_0x8095('0x4d')]));channels[_0x3f80c0[_0x8095('0x5')]][_0x8095('0x60')]=_0x3f80c0['value'];}}}catch(_0x17a5c6){utils['error'](util[_0x8095('0x7')]('[%s][calls][varset]',_0x3f80c0['uniqueid']),_0x17a5c6);}};exports['newexten']=function(_0x48840a){try{if(!_[_0x8095('0x22')](channels[_0x48840a[_0x8095('0x5')]])){utils[_0x8095('0x21')](util[_0x8095('0x7')](_0x8095('0x61'),_0x48840a[_0x8095('0x5')]),_0x48840a);utils[_0x8095('0x19')](util[_0x8095('0x7')](_0x8095('0x62'),_0x48840a['uniqueid'],_0x48840a['application'],_0x48840a['appdata']));if(_0x48840a[_0x8095('0x63')]['toLowerCase']()==_0x8095('0x64')&&_[_0x8095('0x65')](_0x48840a[_0x8095('0x66')][_0x8095('0x67')](),_0x8095('0x68'))){var _0x103a10=_0x48840a[_0x8095('0x66')][_0x8095('0x69')]('=');var _0x44019e=_0x103a10[0x0]['substring'](_0x103a10[0x0][_0x8095('0x6a')]('(')+0x1,_0x103a10[0x0][_0x8095('0x6a')](')'));var _0x501785=_0x103a10[0x1];channels[_0x48840a[_0x8095('0x5')]][_0x44019e]=_0x501785;}if(!_[_0x8095('0x6b')]([_0x8095('0x6c'),'noop',_0x8095('0x6d'),_0x8095('0x64'),_0x8095('0x6e')],_0x48840a[_0x8095('0x63')]['toLowerCase']())){channels[_0x48840a[_0x8095('0x5')]]['lastapplication']=_0x48840a['application'];channels[_0x48840a[_0x8095('0x5')]][_0x8095('0x6f')]=_0x48840a[_0x8095('0x66')];}}}catch(_0x4a1427){utils[_0x8095('0x1f')](util[_0x8095('0x7')](_0x8095('0x61'),_0x48840a[_0x8095('0x5')]),_0x4a1427);}}; \ No newline at end of file +var _0x0c23=['./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','connectedlinenum','lastevent','accountcode','getUserByInternal','then','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','DOCUMENTATION','error','newstate','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','isNil','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][attendedtransfer]','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','includes','gotoif','application','lodash','util','./utils'];(function(_0x29c10d,_0x174049){var _0x2d2d12=function(_0x32780d){while(--_0x32780d){_0x29c10d['push'](_0x29c10d['shift']());}};_0x2d2d12(++_0x174049);}(_0x0c23,0x13e));var _0x30c2=function(_0x91ce25,_0x53ff1b){_0x91ce25=_0x91ce25-0x0;var _0x38baaa=_0x0c23[_0x91ce25];return _0x38baaa;};'use strict';var _=require(_0x30c2('0x0'));var util=require(_0x30c2('0x1'));var utils=require(_0x30c2('0x2'));var transfers=require(_0x30c2('0x3'));var dispositions=[_0x30c2('0x4'),_0x30c2('0x5'),_0x30c2('0x5'),'NO\x20ANSWER',_0x30c2('0x4'),_0x30c2('0x4'),_0x30c2('0x6'),_0x30c2('0x7'),_0x30c2('0x5'),_0x30c2('0x5'),'FAILED'];var channels={};function writeDB(_0x406fd0){var _0x41b74d;if(transfers[_0x30c2('0x8')][_0x406fd0[_0x30c2('0x9')]]){_0x41b74d=_0x406fd0[_0x30c2('0x9')];_0x406fd0['uniqueid']=transfers[_0x30c2('0x8')][_0x406fd0[_0x30c2('0x9')]]['transfereeuniqueid'];}utils[_0x30c2('0xa')](util[_0x30c2('0xb')](_0x30c2('0xc'),_0x406fd0[_0x30c2('0x9')],_0x406fd0[_0x30c2('0xd')],_0x406fd0[_0x30c2('0xe')],_0x406fd0['membername'],_0x406fd0['interface'],_0x406fd0['calleridnum'],_0x406fd0[_0x30c2('0xf')],_0x406fd0[_0x30c2('0x10')]));if(_0x406fd0[_0x30c2('0x11')]){utils[_0x30c2('0x12')](_0x406fd0[_0x30c2('0x11')])[_0x30c2('0x13')](function(_0x2712dc){if(_0x2712dc){_0x406fd0['UserId']=_0x2712dc['id'];}utils[_0x30c2('0x14')](_0x30c2('0x15'),_0x406fd0);});}else{utils['request'](_0x30c2('0x15'),_0x406fd0);}if(channels[_0x406fd0[_0x30c2('0x9')]]){delete channels[_0x406fd0[_0x30c2('0x9')]];}else if(_0x41b74d&&channels[_0x41b74d]){if(!transfers[_0x30c2('0x8')][_0x41b74d][_0x30c2('0x16')])delete transfers[_0x30c2('0x8')][_0x41b74d];delete channels[_0x41b74d];}}exports[_0x30c2('0x17')]=function(_0x271d10){try{utils[_0x30c2('0x18')](util[_0x30c2('0xb')](_0x30c2('0x19'),_0x271d10[_0x30c2('0x9')]),_0x271d10);if(_0x271d10['uniqueid']==_0x271d10[_0x30c2('0x1a')]&&_0x271d10['channel']!='OutgoingSpoolFailed'){utils[_0x30c2('0xa')](util[_0x30c2('0xb')](_0x30c2('0x1b'),_0x271d10['uniqueid'],_0x271d10[_0x30c2('0x1c')],_0x271d10[_0x30c2('0x1d')]));channels[_0x271d10[_0x30c2('0x9')]]={'uniqueid':_0x271d10[_0x30c2('0x9')],'accountcode':_0x271d10[_0x30c2('0x11')],'source':_0x271d10[_0x30c2('0x1e')],'destination':_0x271d10[_0x30c2('0x1d')],'destinationcontext':_0x271d10[_0x30c2('0x1c')],'channel':_0x271d10['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x30c2('0x4'),'amaflags':_0x30c2('0x1f')};}}catch(_0x55d4e1){utils[_0x30c2('0x20')](util[_0x30c2('0xb')]('[%s][calls][newchannel]',_0x271d10[_0x30c2('0x9')]),_0x55d4e1);}};exports[_0x30c2('0x21')]=function(_0x1a11b1){try{utils['debug'](util[_0x30c2('0xb')](_0x30c2('0x22'),_0x1a11b1[_0x30c2('0x9')]),_0x1a11b1);if(!_['isNil'](channels[_0x1a11b1[_0x30c2('0x9')]])&&_0x1a11b1[_0x30c2('0x23')]==0x6){utils[_0x30c2('0xa')](util['format'](_0x30c2('0x24'),_0x1a11b1[_0x30c2('0x9')],_0x1a11b1[_0x30c2('0x1c')],_0x1a11b1[_0x30c2('0xd')]));if(_['isNil'](channels[_0x1a11b1['uniqueid']][_0x30c2('0x25')])){channels[_0x1a11b1['uniqueid']][_0x30c2('0x25')]=utils[_0x30c2('0x26')]();}}else if(!_[_0x30c2('0x27')](channels[_0x1a11b1['linkedid']])&&_0x1a11b1[_0x30c2('0x23')]==0x6&&_0x1a11b1[_0x30c2('0x1c')]!='transfer'){utils[_0x30c2('0xa')](util[_0x30c2('0xb')](_0x30c2('0x28'),_0x1a11b1[_0x30c2('0x9')],_0x1a11b1[_0x30c2('0x1a')],_0x1a11b1[_0x30c2('0x1c')],_0x1a11b1[_0x30c2('0xd')]));channels[_0x1a11b1[_0x30c2('0x1a')]][_0x30c2('0x11')]=_0x1a11b1[_0x30c2('0x11')];channels[_0x1a11b1[_0x30c2('0x1a')]][_0x30c2('0x29')]=_0x1a11b1[_0x30c2('0xd')];if(_[_0x30c2('0x27')](channels[_0x1a11b1[_0x30c2('0x1a')]][_0x30c2('0x2a')])){channels[_0x1a11b1[_0x30c2('0x1a')]]['answertime']=utils['now']();}channels[_0x1a11b1[_0x30c2('0x1a')]]['disposition']=dispositions[_['toNumber'](_0x1a11b1[_0x30c2('0x23')])]||_0x30c2('0x6');}}catch(_0x4f9ee4){utils['error'](util[_0x30c2('0xb')](_0x30c2('0x22'),_0x1a11b1[_0x30c2('0x9')]),_0x4f9ee4);}};exports[_0x30c2('0x2b')]=function(_0x3aa7af){try{if(!_[_0x30c2('0x27')](channels[_0x3aa7af[_0x30c2('0x9')]])){utils['debug'](util[_0x30c2('0xb')](_0x30c2('0x2c'),_0x3aa7af[_0x30c2('0x9')]),_0x3aa7af);if(_['isNil'](channels[_0x3aa7af['uniqueid']][_0x30c2('0x2d')])){channels[_0x3aa7af[_0x30c2('0x9')]][_0x30c2('0x2d')]=_0x3aa7af[_0x30c2('0x2e')]+'\x20<'+_0x3aa7af[_0x30c2('0x1e')]+'>';}utils[_0x30c2('0xa')](util[_0x30c2('0xb')](_0x30c2('0x2f'),_0x3aa7af[_0x30c2('0x9')],channels[_0x3aa7af[_0x30c2('0x9')]]['callerid'],_0x3aa7af[_0x30c2('0x30')]));channels[_0x3aa7af[_0x30c2('0x9')]][_0x30c2('0x31')]=utils[_0x30c2('0x26')]();channels[_0x3aa7af[_0x30c2('0x9')]][_0x30c2('0x32')]=utils[_0x30c2('0x33')](channels[_0x3aa7af[_0x30c2('0x9')]][_0x30c2('0x31')],channels[_0x3aa7af[_0x30c2('0x9')]][_0x30c2('0x34')]);channels[_0x3aa7af['uniqueid']][_0x30c2('0x35')]=channels[_0x3aa7af[_0x30c2('0x9')]][_0x30c2('0x2a')]?utils[_0x30c2('0x33')](channels[_0x3aa7af[_0x30c2('0x9')]][_0x30c2('0x31')],channels[_0x3aa7af['uniqueid']][_0x30c2('0x2a')]):0x0;writeDB(channels[_0x3aa7af[_0x30c2('0x9')]]);}}catch(_0x2d2af6){utils[_0x30c2('0x20')](util[_0x30c2('0xb')]('[%s][calls][hangup]',_0x3aa7af[_0x30c2('0x9')]),_0x2d2af6);}};exports[_0x30c2('0x36')]=function(_0x5388c7){try{if(!_[_0x30c2('0x27')](channels[_0x5388c7[_0x30c2('0x37')]])){utils['debug'](util[_0x30c2('0xb')]('[%s][calls][attendedtransfer]',_0x5388c7[_0x30c2('0x38')]),_0x5388c7);if(channels[_0x5388c7[_0x30c2('0x37')]][_0x30c2('0xd')]==_0x5388c7[_0x30c2('0x39')]){utils[_0x30c2('0xa')](util[_0x30c2('0xb')](_0x30c2('0x3a'),_0x5388c7[_0x30c2('0x38')],_0x5388c7[_0x30c2('0x37')],_0x5388c7[_0x30c2('0x3b')]));channels[_0x5388c7[_0x30c2('0x37')]][_0x30c2('0x29')]=_0x5388c7[_0x30c2('0x3b')];channels[_0x5388c7['localtwolinkedid']][_0x30c2('0x3c')]=_0x30c2('0x3d');}else if(channels[_0x5388c7[_0x30c2('0x37')]][_0x30c2('0xd')]=_0x5388c7[_0x30c2('0x3e')]){utils[_0x30c2('0xa')](util[_0x30c2('0xb')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x5388c7[_0x30c2('0x38')],_0x5388c7[_0x30c2('0x37')],_0x5388c7[_0x30c2('0x3f')]));channels[_0x5388c7[_0x30c2('0x37')]][_0x30c2('0x29')]=_0x5388c7['origtransfererchannel'];channels[_0x5388c7[_0x30c2('0x37')]][_0x30c2('0x3c')]=_0x30c2('0x3d');}}}catch(_0x240918){utils[_0x30c2('0x20')](util[_0x30c2('0xb')](_0x30c2('0x40'),_0x5388c7['origtransfereruniqueid']),_0x240918);}};exports[_0x30c2('0x41')]=function(_0x3fa210){try{if(!_['isNil'](channels[_0x3fa210[_0x30c2('0x9')]])){utils[_0x30c2('0x18')](util[_0x30c2('0xb')](_0x30c2('0x42'),_0x3fa210[_0x30c2('0x9')]),_0x3fa210);channels[_0x3fa210[_0x30c2('0x9')]][_0x30c2('0x43')]=utils[_0x30c2('0x26')]();utils[_0x30c2('0xa')](util[_0x30c2('0xb')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x3fa210['uniqueid'],channels[_0x3fa210['uniqueid']][_0x30c2('0x43')]));}}catch(_0xc8efc5){utils[_0x30c2('0x20')](util[_0x30c2('0xb')](_0x30c2('0x42'),_0x3fa210['uniqueid']),_0xc8efc5);}};exports['musiconholdstop']=function(_0x38212e){try{if(!_[_0x30c2('0x27')](channels[_0x38212e['uniqueid']])){utils[_0x30c2('0x18')](util['format'](_0x30c2('0x44'),_0x38212e[_0x30c2('0x9')]),_0x38212e);if(!_[_0x30c2('0x27')](channels[_0x38212e[_0x30c2('0x9')]][_0x30c2('0x43')])){channels[_0x38212e[_0x30c2('0x9')]][_0x30c2('0x45')]+=utils[_0x30c2('0x33')](utils['now'](),channels[_0x38212e[_0x30c2('0x9')]][_0x30c2('0x43')]);utils[_0x30c2('0xa')](util['format'](_0x30c2('0x46'),_0x38212e['uniqueid'],channels[_0x38212e[_0x30c2('0x9')]][_0x30c2('0x45')]));delete channels[_0x38212e[_0x30c2('0x9')]][_0x30c2('0x43')];}}}catch(_0x5f1d52){utils['error'](util[_0x30c2('0xb')](_0x30c2('0x44'),_0x38212e[_0x30c2('0x9')]),_0x5f1d52);}};exports[_0x30c2('0x47')]=function(_0x449c29){try{if(!_[_0x30c2('0x27')](channels[_0x449c29[_0x30c2('0x9')]])){utils[_0x30c2('0x18')](util['format'](_0x30c2('0x48'),_0x449c29[_0x30c2('0x9')]),_0x449c29);if(!_['isNil'](_0x449c29[_0x30c2('0x49')]['xmd-originatecalleridnum'])){utils[_0x30c2('0xa')](util[_0x30c2('0xb')](_0x30c2('0x4a'),_0x449c29[_0x30c2('0x9')],_0x449c29['value']));channels[_0x449c29['uniqueid']]['source']=_0x449c29[_0x30c2('0x4b')];}if(!_[_0x30c2('0x27')](_0x449c29[_0x30c2('0x49')][_0x30c2('0x4c')])){utils[_0x30c2('0xa')](util[_0x30c2('0xb')](_0x30c2('0x4d'),_0x449c29['uniqueid'],_0x449c29[_0x30c2('0x4b')]));channels[_0x449c29[_0x30c2('0x9')]]['destination']=_0x449c29[_0x30c2('0x4b')];channels[_0x449c29[_0x30c2('0x9')]][_0x30c2('0x2d')]='\x22'+_0x449c29[_0x30c2('0x4b')]+_0x30c2('0x4e')+_0x449c29[_0x30c2('0x4b')]+'>';}if(!_['isNil'](_0x449c29[_0x30c2('0x49')][_0x30c2('0x4f')])||!_['isNil'](_0x449c29[_0x30c2('0x49')]['xmd-callerid'])){utils[_0x30c2('0xa')](util[_0x30c2('0xb')](_0x30c2('0x50'),_0x449c29['uniqueid'],!_['isNil'](_0x449c29[_0x30c2('0x49')]['xmd-callerid-preview'])?'xmd-callerid-preview':'xmd-callerid',_0x449c29['value']));channels[_0x449c29[_0x30c2('0x9')]][_0x30c2('0x2d')]=_0x449c29[_0x30c2('0x4b')];}if(!_[_0x30c2('0x27')](_0x449c29['variable'][_0x30c2('0x51')])||!_[_0x30c2('0x27')](_0x449c29[_0x30c2('0x49')]['xmcs-queue'])){utils[_0x30c2('0xa')](util[_0x30c2('0xb')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x449c29[_0x30c2('0x9')],!_['isNil'](_0x449c29[_0x30c2('0x49')][_0x30c2('0x51')])?_0x30c2('0x51'):_0x30c2('0x52'),_0x449c29[_0x30c2('0x4b')]));channels[_0x449c29[_0x30c2('0x9')]][_0x30c2('0x53')]=_0x30c2('0x54');channels[_0x449c29['uniqueid']][_0x30c2('0x55')]=_0x449c29[_0x30c2('0x4b')];channels[_0x449c29['uniqueid']]['queue']=!![];}if(!_[_0x30c2('0x27')](_0x449c29[_0x30c2('0x49')]['xmd-contactid'])){utils['info'](util['format'](_0x30c2('0x56'),_0x449c29[_0x30c2('0x9')],_0x449c29[_0x30c2('0x4b')]));channels[_0x449c29[_0x30c2('0x9')]]['ContactId']=_0x449c29['value'];}if(!_[_0x30c2('0x27')](_0x449c29[_0x30c2('0x49')]['xmd-cdrtype'])){utils[_0x30c2('0xa')](util[_0x30c2('0xb')](_0x30c2('0x57'),_0x449c29[_0x30c2('0x9')],_0x449c29[_0x30c2('0x4b')]));channels[_0x449c29['uniqueid']][_0x30c2('0x58')]=_0x449c29[_0x30c2('0x4b')];}if(!_[_0x30c2('0x27')](_0x449c29[_0x30c2('0x49')][_0x30c2('0x59')])){utils[_0x30c2('0xa')](util[_0x30c2('0xb')](_0x30c2('0x5a'),_0x449c29[_0x30c2('0x9')],_0x449c29[_0x30c2('0x4b')]));channels[_0x449c29[_0x30c2('0x9')]][_0x30c2('0x5b')]=_0x449c29['value'];}if(!_['isNil'](_0x449c29[_0x30c2('0x49')][_0x30c2('0x5c')])){utils[_0x30c2('0xa')](util['format'](_0x30c2('0x5d'),_0x449c29['uniqueid'],_0x449c29[_0x30c2('0x4b')]));channels[_0x449c29[_0x30c2('0x9')]][_0x30c2('0x5c')]=_0x449c29[_0x30c2('0x4b')];}}}catch(_0x254354){utils[_0x30c2('0x20')](util['format']('[%s][calls][varset]',_0x449c29[_0x30c2('0x9')]),_0x254354);}};exports[_0x30c2('0x5e')]=function(_0x13f444){try{if(!_[_0x30c2('0x27')](channels[_0x13f444[_0x30c2('0x9')]])){utils[_0x30c2('0x18')](util[_0x30c2('0xb')](_0x30c2('0x5f'),_0x13f444[_0x30c2('0x9')]),_0x13f444);utils[_0x30c2('0xa')](util[_0x30c2('0xb')](_0x30c2('0x60'),_0x13f444['uniqueid'],_0x13f444['application'],_0x13f444[_0x30c2('0x61')]));if(_0x13f444['application'][_0x30c2('0x62')]()==_0x30c2('0x63')&&_[_0x30c2('0x64')](_0x13f444[_0x30c2('0x61')][_0x30c2('0x62')](),_0x30c2('0x65'))){var _0x1de6f4=_0x13f444[_0x30c2('0x61')]['split']('=');var _0x233c89=_0x1de6f4[0x0][_0x30c2('0x66')](_0x1de6f4[0x0]['lastIndexOf']('(')+0x1,_0x1de6f4[0x0][_0x30c2('0x67')](')'));var _0x19eec2=_0x1de6f4[0x1];channels[_0x13f444['uniqueid']][_0x233c89]=_0x19eec2;}if(!_[_0x30c2('0x68')]([_0x30c2('0x2b'),'noop','execif',_0x30c2('0x63'),_0x30c2('0x69')],_0x13f444[_0x30c2('0x6a')][_0x30c2('0x62')]())){channels[_0x13f444['uniqueid']]['lastapplication']=_0x13f444[_0x30c2('0x6a')];channels[_0x13f444[_0x30c2('0x9')]][_0x30c2('0x55')]=_0x13f444[_0x30c2('0x61')];}}}catch(_0xa81df3){utils[_0x30c2('0x20')](util['format'](_0x30c2('0x5f'),_0x13f444['uniqueid']),_0xa81df3);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 99574a4..b3db02e 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 _0x4c6b=['managerevent','connect','[core]\x20connected','shutdown','info','[core]\x20shutdown','[core]\x20fullybooted','error','[core]\x20error','close'];(function(_0x1d2bc8,_0x2860bc){var _0x1857e1=function(_0x3a3073){while(--_0x3a3073){_0x1d2bc8['push'](_0x1d2bc8['shift']());}};_0x1857e1(++_0x2860bc);}(_0x4c6b,0x79));var _0xb4c6=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4c6b[_0xfae23b];return _0x200640;};'use strict';var utils=require('./utils');exports[_0xb4c6('0x0')]=function(){utils['info'](_0xb4c6('0x1'));};exports[_0xb4c6('0x2')]=function(){utils[_0xb4c6('0x3')](_0xb4c6('0x4'));};exports['fullybooted']=function(){utils[_0xb4c6('0x3')](_0xb4c6('0x5'));};exports[_0xb4c6('0x6')]=function(_0x3b2862){utils[_0xb4c6('0x6')](_0xb4c6('0x7'),_0x3b2862);};exports[_0xb4c6('0x8')]=function(){utils['info']('[core]\x20close');};exports[_0xb4c6('0x9')]=function(_0x3cda98){}; \ No newline at end of file +var _0x0999=['error','[core]\x20error','close','./utils','info','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted'];(function(_0x44939b,_0x219c50){var _0x800f0=function(_0x1821be){while(--_0x1821be){_0x44939b['push'](_0x44939b['shift']());}};_0x800f0(++_0x219c50);}(_0x0999,0xa5));var _0x9099=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x0999[_0x3947c9];return _0x2e7871;};'use strict';var utils=require(_0x9099('0x0'));exports['connect']=function(){utils[_0x9099('0x1')]('[core]\x20connected');};exports[_0x9099('0x2')]=function(){utils['info'](_0x9099('0x3'));};exports[_0x9099('0x4')]=function(){utils[_0x9099('0x1')](_0x9099('0x5'));};exports[_0x9099('0x6')]=function(_0xc90c83){utils[_0x9099('0x6')](_0x9099('0x7'),_0xc90c83);};exports[_0x9099('0x8')]=function(){utils[_0x9099('0x1')]('[core]\x20close');};exports['managerevent']=function(_0x441c99){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 02b299d..6c560eb 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 _0x8b3a=['complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','info','format','uniqueid','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','application','toLowerCase','startsWith','appdata','split','varset','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','[%s][dials][varset]','dialbegin','isNil','[%s][dials][dialbegin]','assign','starttime','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','ANSWER','answertime','now','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8b3a,0x64));var _0xa8b3=function(_0x2ceba7,_0x451ce4){_0x2ceba7=_0x2ceba7-0x0;var _0x5348eb=_0x8b3a[_0x2ceba7];return _0x5348eb;};'use strict';var _=require(_0xa8b3('0x0'));var util=require(_0xa8b3('0x1'));var utils=require(_0xa8b3('0x2'));var dials={};function writeDB(_0x595ba3){utils[_0xa8b3('0x3')](util[_0xa8b3('0x4')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x595ba3[_0xa8b3('0x5')],_0x595ba3['channel'],_0x595ba3['dialstring'],_0x595ba3[_0xa8b3('0x6')],_0x595ba3[_0xa8b3('0x7')],_0x595ba3[_0xa8b3('0x8')]));utils['request'](_0xa8b3('0x9'),_0x595ba3);delete dials[_0x595ba3[_0xa8b3('0x5')]];}exports[_0xa8b3('0xa')]=function(_0xb62531){try{utils[_0xa8b3('0xb')](util['format'](_0xa8b3('0xc'),_0xb62531[_0xa8b3('0x5')]),_0xb62531);utils[_0xa8b3('0x3')](util[_0xa8b3('0x4')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0xb62531['uniqueid'],_0xb62531[_0xa8b3('0xd')],_0xb62531['appdata']));if(_0xb62531[_0xa8b3('0xd')][_0xa8b3('0xe')]()=='set'&&_[_0xa8b3('0xf')](_0xb62531[_0xa8b3('0x10')][_0xa8b3('0xe')](),'cdr(routeid)')){var _0x22c791=_0xb62531['appdata'][_0xa8b3('0x11')]('=');dials[_0xb62531['uniqueid']]={'routeId':_0x22c791[0x1]};}}catch(_0x4dc46b){utils['error'](util[_0xa8b3('0x4')](_0xa8b3('0xc'),_0xb62531[_0xa8b3('0x5')]),_0x4dc46b);}};exports[_0xa8b3('0x12')]=function(_0x5291a9){try{utils[_0xa8b3('0xb')](util[_0xa8b3('0x4')]('[%s][dials][varset]',_0x5291a9[_0xa8b3('0x5')]),_0x5291a9);if(!_['isNil'](_0x5291a9[_0xa8b3('0x13')]['outboundrouteid'])){utils['info'](util[_0xa8b3('0x4')](_0xa8b3('0x14'),_0x5291a9[_0xa8b3('0x5')],_0x5291a9[_0xa8b3('0x15')]));dials[_0x5291a9[_0xa8b3('0x5')]]={'routeId':_0x5291a9[_0xa8b3('0x15')]};}}catch(_0x42ae46){utils[_0xa8b3('0x16')](util[_0xa8b3('0x4')](_0xa8b3('0x17'),_0x5291a9[_0xa8b3('0x5')]),_0x42ae46);}};exports[_0xa8b3('0x18')]=function(_0x4ea094){try{if(!_[_0xa8b3('0x19')](dials[_0x4ea094[_0xa8b3('0x5')]])){utils['debug'](util[_0xa8b3('0x4')](_0xa8b3('0x1a'),_0x4ea094['uniqueid']),_0x4ea094);dials[_0x4ea094[_0xa8b3('0x5')]]=_[_0xa8b3('0x1b')](dials[_0x4ea094[_0xa8b3('0x5')]],_0x4ea094);dials[_0x4ea094[_0xa8b3('0x5')]][_0xa8b3('0x1c')]=utils['now']();dials[_0x4ea094[_0xa8b3('0x5')]][_0xa8b3('0x1d')]='called';utils[_0xa8b3('0x3')](util[_0xa8b3('0x4')](_0xa8b3('0x1e'),_0x4ea094[_0xa8b3('0x5')],dials[_0x4ea094['uniqueid']][_0xa8b3('0x1c')]));}}catch(_0x3939de){utils[_0xa8b3('0x16')](util[_0xa8b3('0x4')](_0xa8b3('0x1a'),_0x4ea094[_0xa8b3('0x5')]),_0x3939de);}};exports['dialend']=function(_0x2cf46d){try{if(!_['isNil'](dials[_0x2cf46d[_0xa8b3('0x5')]])){utils['debug'](util[_0xa8b3('0x4')](_0xa8b3('0x1f'),_0x2cf46d[_0xa8b3('0x5')]),_0x2cf46d);dials[_0x2cf46d['uniqueid']]['dialstatus']=_0x2cf46d[_0xa8b3('0x8')];if(_0x2cf46d[_0xa8b3('0x8')]==_0xa8b3('0x20')){dials[_0x2cf46d[_0xa8b3('0x5')]]=_[_0xa8b3('0x1b')](dials[_0x2cf46d[_0xa8b3('0x5')]],_0x2cf46d);dials[_0x2cf46d[_0xa8b3('0x5')]][_0xa8b3('0x21')]=utils[_0xa8b3('0x22')]();dials[_0x2cf46d['uniqueid']][_0xa8b3('0x1d')]='connect';utils[_0xa8b3('0x3')](util[_0xa8b3('0x4')](_0xa8b3('0x23'),_0x2cf46d[_0xa8b3('0x5')],_0x2cf46d['dialstatus'],dials[_0x2cf46d['uniqueid']][_0xa8b3('0x21')]));}else{utils[_0xa8b3('0x3')](util['format'](_0xa8b3('0x24'),_0x2cf46d[_0xa8b3('0x5')],_0x2cf46d[_0xa8b3('0x8')]));}}}catch(_0x537f16){utils[_0xa8b3('0x16')](util[_0xa8b3('0x4')](_0xa8b3('0x1f'),_0x2cf46d[_0xa8b3('0x5')]),_0x537f16);}};exports[_0xa8b3('0x25')]=function(_0xa2a55d){try{if(!_[_0xa8b3('0x19')](dials[_0xa2a55d['uniqueid']])){utils[_0xa8b3('0xb')](util['format'](_0xa8b3('0x26'),_0xa2a55d['uniqueid']),_0xa2a55d);utils[_0xa8b3('0x3')](util[_0xa8b3('0x4')](_0xa8b3('0x27'),_0xa2a55d['uniqueid'],_0xa2a55d['calleridnum'],_0xa2a55d[_0xa8b3('0x28')],_0xa2a55d['cause-txt']));dials[_0xa2a55d['uniqueid']]=_['assign'](dials[_0xa2a55d[_0xa8b3('0x5')]],{'endtime':utils[_0xa8b3('0x22')](),'lastevent':_0xa8b3('0x29')});dials[_0xa2a55d[_0xa8b3('0x5')]][_0xa8b3('0x2a')]=utils[_0xa8b3('0x2b')](dials[_0xa2a55d[_0xa8b3('0x5')]][_0xa8b3('0x2c')],dials[_0xa2a55d[_0xa8b3('0x5')]][_0xa8b3('0x1c')]);dials[_0xa2a55d[_0xa8b3('0x5')]][_0xa8b3('0x2d')]=utils[_0xa8b3('0x2b')](dials[_0xa2a55d['uniqueid']]['answertime']||dials[_0xa2a55d['uniqueid']][_0xa8b3('0x2c')],dials[_0xa2a55d['uniqueid']][_0xa8b3('0x1c')]);dials[_0xa2a55d[_0xa8b3('0x5')]][_0xa8b3('0x2e')]=dials[_0xa2a55d[_0xa8b3('0x5')]][_0xa8b3('0x21')]?utils['diffTime'](dials[_0xa2a55d[_0xa8b3('0x5')]][_0xa8b3('0x2c')],dials[_0xa2a55d['uniqueid']][_0xa8b3('0x21')]):0x0;writeDB(dials[_0xa2a55d[_0xa8b3('0x5')]]);}}catch(_0x4e3503){utils[_0xa8b3('0x16')](util[_0xa8b3('0x4')](_0xa8b3('0x26'),_0xa2a55d[_0xa8b3('0x5')]),_0x4e3503);}}; \ No newline at end of file +var _0x4083=['assign','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','duration','endtime','holdtime','diffTime','billableseconds','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','uniqueid','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','split','error','debug','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','starttime','now','lastevent','called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','ANSWER'];(function(_0x19936d,_0x2e9787){var _0x2725e3=function(_0x7aee5b){while(--_0x7aee5b){_0x19936d['push'](_0x19936d['shift']());}};_0x2725e3(++_0x2e9787);}(_0x4083,0x1d9));var _0x3408=function(_0x21de1e,_0x304b33){_0x21de1e=_0x21de1e-0x0;var _0xa0eb39=_0x4083[_0x21de1e];return _0xa0eb39;};'use strict';var _=require(_0x3408('0x0'));var util=require(_0x3408('0x1'));var utils=require(_0x3408('0x2'));var dials={};function writeDB(_0x127514){utils[_0x3408('0x3')](util[_0x3408('0x4')](_0x3408('0x5'),_0x127514['uniqueid'],_0x127514[_0x3408('0x6')],_0x127514[_0x3408('0x7')],_0x127514[_0x3408('0x8')],_0x127514[_0x3408('0x9')],_0x127514[_0x3408('0xa')]));utils[_0x3408('0xb')]('CreateVoiceDialReport',_0x127514);delete dials[_0x127514['uniqueid']];}exports['newexten']=function(_0x583319){try{utils['debug'](util['format']('[%s][dials][newexten]',_0x583319[_0x3408('0xc')]),_0x583319);utils[_0x3408('0x3')](util[_0x3408('0x4')](_0x3408('0xd'),_0x583319['uniqueid'],_0x583319[_0x3408('0xe')],_0x583319[_0x3408('0xf')]));if(_0x583319[_0x3408('0xe')][_0x3408('0x10')]()==_0x3408('0x11')&&_[_0x3408('0x12')](_0x583319[_0x3408('0xf')][_0x3408('0x10')](),'cdr(routeid)')){var _0x29748a=_0x583319['appdata'][_0x3408('0x13')]('=');dials[_0x583319[_0x3408('0xc')]]={'routeId':_0x29748a[0x1]};}}catch(_0x3fffe8){utils[_0x3408('0x14')](util[_0x3408('0x4')]('[%s][dials][newexten]',_0x583319['uniqueid']),_0x3fffe8);}};exports['varset']=function(_0xdd8008){try{utils[_0x3408('0x15')](util[_0x3408('0x4')](_0x3408('0x16'),_0xdd8008[_0x3408('0xc')]),_0xdd8008);if(!_[_0x3408('0x17')](_0xdd8008[_0x3408('0x18')][_0x3408('0x19')])){utils[_0x3408('0x3')](util[_0x3408('0x4')](_0x3408('0x1a'),_0xdd8008[_0x3408('0xc')],_0xdd8008[_0x3408('0x1b')]));dials[_0xdd8008['uniqueid']]={'routeId':_0xdd8008['value']};}}catch(_0x51c082){utils['error'](util[_0x3408('0x4')]('[%s][dials][varset]',_0xdd8008[_0x3408('0xc')]),_0x51c082);}};exports[_0x3408('0x1c')]=function(_0x9551e7){try{if(!_['isNil'](dials[_0x9551e7[_0x3408('0xc')]])){utils[_0x3408('0x15')](util[_0x3408('0x4')]('[%s][dials][dialbegin]',_0x9551e7[_0x3408('0xc')]),_0x9551e7);dials[_0x9551e7[_0x3408('0xc')]]=_['assign'](dials[_0x9551e7[_0x3408('0xc')]],_0x9551e7);dials[_0x9551e7[_0x3408('0xc')]][_0x3408('0x1d')]=utils[_0x3408('0x1e')]();dials[_0x9551e7[_0x3408('0xc')]][_0x3408('0x1f')]=_0x3408('0x20');utils['info'](util[_0x3408('0x4')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x9551e7[_0x3408('0xc')],dials[_0x9551e7[_0x3408('0xc')]][_0x3408('0x1d')]));}}catch(_0x39d038){utils[_0x3408('0x14')](util[_0x3408('0x4')](_0x3408('0x21'),_0x9551e7['uniqueid']),_0x39d038);}};exports[_0x3408('0x22')]=function(_0xd7aa5a){try{if(!_['isNil'](dials[_0xd7aa5a[_0x3408('0xc')]])){utils[_0x3408('0x15')](util[_0x3408('0x4')](_0x3408('0x23'),_0xd7aa5a[_0x3408('0xc')]),_0xd7aa5a);dials[_0xd7aa5a['uniqueid']]['dialstatus']=_0xd7aa5a[_0x3408('0xa')];if(_0xd7aa5a[_0x3408('0xa')]==_0x3408('0x24')){dials[_0xd7aa5a[_0x3408('0xc')]]=_[_0x3408('0x25')](dials[_0xd7aa5a[_0x3408('0xc')]],_0xd7aa5a);dials[_0xd7aa5a[_0x3408('0xc')]]['answertime']=utils[_0x3408('0x1e')]();dials[_0xd7aa5a['uniqueid']]['lastevent']=_0x3408('0x26');utils[_0x3408('0x3')](util['format'](_0x3408('0x27'),_0xd7aa5a[_0x3408('0xc')],_0xd7aa5a[_0x3408('0xa')],dials[_0xd7aa5a[_0x3408('0xc')]][_0x3408('0x28')]));}else{utils[_0x3408('0x3')](util['format'](_0x3408('0x29'),_0xd7aa5a['uniqueid'],_0xd7aa5a[_0x3408('0xa')]));}}}catch(_0x581b1d){utils['error'](util[_0x3408('0x4')](_0x3408('0x23'),_0xd7aa5a['uniqueid']),_0x581b1d);}};exports[_0x3408('0x2a')]=function(_0x531bba){try{if(!_[_0x3408('0x17')](dials[_0x531bba[_0x3408('0xc')]])){utils[_0x3408('0x15')](util['format'](_0x3408('0x2b'),_0x531bba[_0x3408('0xc')]),_0x531bba);utils[_0x3408('0x3')](util[_0x3408('0x4')](_0x3408('0x2c'),_0x531bba[_0x3408('0xc')],_0x531bba[_0x3408('0x8')],_0x531bba[_0x3408('0x2d')],_0x531bba['cause-txt']));dials[_0x531bba[_0x3408('0xc')]]=_[_0x3408('0x25')](dials[_0x531bba[_0x3408('0xc')]],{'endtime':utils[_0x3408('0x1e')](),'lastevent':'complete'});dials[_0x531bba[_0x3408('0xc')]][_0x3408('0x2e')]=utils['diffTime'](dials[_0x531bba[_0x3408('0xc')]][_0x3408('0x2f')],dials[_0x531bba['uniqueid']][_0x3408('0x1d')]);dials[_0x531bba[_0x3408('0xc')]][_0x3408('0x30')]=utils[_0x3408('0x31')](dials[_0x531bba[_0x3408('0xc')]]['answertime']||dials[_0x531bba[_0x3408('0xc')]][_0x3408('0x2f')],dials[_0x531bba['uniqueid']][_0x3408('0x1d')]);dials[_0x531bba[_0x3408('0xc')]][_0x3408('0x32')]=dials[_0x531bba['uniqueid']][_0x3408('0x28')]?utils[_0x3408('0x31')](dials[_0x531bba[_0x3408('0xc')]][_0x3408('0x2f')],dials[_0x531bba[_0x3408('0xc')]][_0x3408('0x28')]):0x0;writeDB(dials[_0x531bba[_0x3408('0xc')]]);}}catch(_0xed33cf){utils['error'](util[_0x3408('0x4')]('[%s][dials][hangup]',_0x531bba[_0x3408('0xc')]),_0xed33cf);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 3fdb98e..541aff6 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 _0x6fe2=['[%s][index][dialend]','./utils','util','asterisk','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','[%s]dialbegin','dialend'];(function(_0x5a7f64,_0x347d57){var _0x3d30f1=function(_0x4bd1d6){while(--_0x4bd1d6){_0x5a7f64['push'](_0x5a7f64['shift']());}};_0x3d30f1(++_0x347d57);}(_0x6fe2,0x1dd));var _0x26fe=function(_0x444fd8,_0x3a6c12){_0x444fd8=_0x444fd8-0x0;var _0xff9a3f=_0x6fe2[_0x444fd8];return _0xff9a3f;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require(_0x26fe('0x0'));var util=require(_0x26fe('0x1'));var ami=new AsteriskManager(config[_0x26fe('0x2')]['port'],config[_0x26fe('0x2')]['ip'],config[_0x26fe('0x2')][_0x26fe('0x3')],config[_0x26fe('0x2')][_0x26fe('0x4')],!![]);ami[_0x26fe('0x5')]();if(config[_0x26fe('0x6')]&&config[_0x26fe('0x6')][_0x26fe('0x7')]){utils[_0x26fe('0x8')](_0x26fe('0x9'));}else{var agents=require('./agents.controller');var calls=require(_0x26fe('0xa'));var queues=require(_0x26fe('0xb'));var recordings=require(_0x26fe('0xc'));var members=require(_0x26fe('0xd'));var dials=require(_0x26fe('0xe'));var transfers=require(_0x26fe('0xf'));var core=require(_0x26fe('0x10'));ami['on'](_0x26fe('0x11'),core[_0x26fe('0x11')]);ami['on'](_0x26fe('0x12'),core['shutdown']);ami['on'](_0x26fe('0x13'),core[_0x26fe('0x13')]);ami['on'](_0x26fe('0x14'),core['error']);ami['on']('close',core[_0x26fe('0x15')]);ami['on'](_0x26fe('0x16'),core[_0x26fe('0x16')]);ami['on'](_0x26fe('0x17'),function(_0x16db95){try{utils[_0x26fe('0x18')](util[_0x26fe('0x19')](_0x26fe('0x1a'),_0x16db95[_0x26fe('0x1b')]),_0x16db95);members[_0x26fe('0x17')](_0x16db95);}catch(_0x2615c3){utils[_0x26fe('0x14')](util[_0x26fe('0x19')](_0x26fe('0x1a'),_0x16db95[_0x26fe('0x1b')]),_0x2615c3);}});ami['on'](_0x26fe('0x1c'),function(_0x589955){try{utils[_0x26fe('0x18')](util[_0x26fe('0x19')](_0x26fe('0x1d'),_0x589955['uniqueid']),_0x589955);agents[_0x26fe('0x1c')](_0x589955);}catch(_0x254c53){utils[_0x26fe('0x14')](util['format'](_0x26fe('0x1d'),_0x589955[_0x26fe('0x1e')]),_0x254c53);}});ami['on'](_0x26fe('0x1f'),function(_0x5537fd){try{utils[_0x26fe('0x18')](util['format']('[%s][index][agentringnoanswer]',_0x5537fd[_0x26fe('0x1e')]),_0x5537fd);agents[_0x26fe('0x1f')](_0x5537fd);}catch(_0x5adf68){utils[_0x26fe('0x14')](util[_0x26fe('0x19')](_0x26fe('0x20'),_0x5537fd[_0x26fe('0x1e')]),_0x5adf68);}});ami['on']('agentconnect',function(_0x1d50d3){try{utils[_0x26fe('0x18')](util['format'](_0x26fe('0x21'),_0x1d50d3[_0x26fe('0x1e')]),_0x1d50d3);agents[_0x26fe('0x22')](_0x1d50d3);queues['agentconnect'](_0x1d50d3);}catch(_0x34dc93){utils['error'](util[_0x26fe('0x19')](_0x26fe('0x21'),_0x1d50d3['uniqueid']),_0x34dc93);}});ami['on'](_0x26fe('0x23'),function(_0x15f800){try{utils[_0x26fe('0x18')](util['format']('[%s][index][agentcomplete]',_0x15f800[_0x26fe('0x1e')]),_0x15f800);agents[_0x26fe('0x23')](_0x15f800);queues[_0x26fe('0x23')](_0x15f800);members[_0x26fe('0x23')](_0x15f800);}catch(_0x3cd836){utils[_0x26fe('0x14')](util[_0x26fe('0x19')](_0x26fe('0x24'),_0x15f800[_0x26fe('0x1e')]),_0x3cd836);}});ami['on']('queuecallerabandon',function(_0x3c06d4){try{utils[_0x26fe('0x18')](util['format']('[%s][index][queuecallerabandon]',_0x3c06d4[_0x26fe('0x1e')]),_0x3c06d4);agents['queuecallerabandon'](_0x3c06d4);queues[_0x26fe('0x25')](_0x3c06d4);}catch(_0x50a584){utils[_0x26fe('0x14')](util[_0x26fe('0x19')](_0x26fe('0x26'),_0x3c06d4[_0x26fe('0x1e')]),_0x50a584);}});ami['on'](_0x26fe('0x27'),function(_0xbcfff9){try{utils[_0x26fe('0x18')](util[_0x26fe('0x19')](_0x26fe('0x28'),_0xbcfff9[_0x26fe('0x1e')]),_0xbcfff9);queues['queuecallerjoin'](_0xbcfff9);recordings[_0x26fe('0x27')](_0xbcfff9);}catch(_0x2f106a){utils[_0x26fe('0x14')](util[_0x26fe('0x19')]('[%s][index][queuecallerjoin]',_0xbcfff9['uniqueid']),_0x2f106a);}});ami['on'](_0x26fe('0x29'),function(_0x3df05b){try{utils[_0x26fe('0x18')](util[_0x26fe('0x19')](_0x26fe('0x2a'),_0x3df05b[_0x26fe('0x1e')]),_0x3df05b);queues[_0x26fe('0x29')](_0x3df05b);}catch(_0x2eb27e){utils['error'](util['format'](_0x26fe('0x2a'),_0x3df05b[_0x26fe('0x1e')]),_0x2eb27e);}});ami['on'](_0x26fe('0x2b'),function(_0x14d674){try{utils[_0x26fe('0x18')](util[_0x26fe('0x19')](_0x26fe('0x2c'),_0x14d674[_0x26fe('0x1e')]),_0x14d674);queues[_0x26fe('0x2b')](_0x14d674);calls[_0x26fe('0x2b')](_0x14d674);}catch(_0x2e05ba){utils[_0x26fe('0x14')](util[_0x26fe('0x19')]('[%s][index][musiconholdstart]',_0x14d674['uniqueid']),_0x2e05ba);}});ami['on'](_0x26fe('0x2d'),function(_0x4b752a){try{utils[_0x26fe('0x18')](util['format']('[%s][index][musiconholdstop]',_0x4b752a['uniqueid']),_0x4b752a);queues['musiconholdstop'](_0x4b752a);calls[_0x26fe('0x2d')](_0x4b752a);}catch(_0x496edc){utils[_0x26fe('0x14')](util['format'](_0x26fe('0x2e'),_0x4b752a['uniqueid']),_0x496edc);}});ami['on'](_0x26fe('0x2f'),function(_0x5b4584){try{utils[_0x26fe('0x18')](util[_0x26fe('0x19')](_0x26fe('0x30'),_0x5b4584[_0x26fe('0x1e')]),_0x5b4584);calls[_0x26fe('0x2f')](_0x5b4584);recordings[_0x26fe('0x2f')](_0x5b4584);}catch(_0xeae078){utils[_0x26fe('0x14')](util[_0x26fe('0x19')]('[%s][index][newstate]',_0x5b4584['uniqueid']),_0xeae078);}});ami['on'](_0x26fe('0x31'),function(_0x3dcf97){try{utils[_0x26fe('0x18')](util[_0x26fe('0x19')]('[%s][index][hangup]',_0x3dcf97[_0x26fe('0x1e')]),_0x3dcf97);calls[_0x26fe('0x31')](_0x3dcf97);recordings[_0x26fe('0x31')](_0x3dcf97);dials['hangup'](_0x3dcf97);agents[_0x26fe('0x31')](_0x3dcf97);queues[_0x26fe('0x31')](_0x3dcf97);}catch(_0x44410a){utils[_0x26fe('0x14')](util[_0x26fe('0x19')](_0x26fe('0x32'),_0x3dcf97['uniqueid']),_0x44410a);}});ami['on']('cdr',function(_0x175e17){try{utils[_0x26fe('0x18')](util['format'](_0x26fe('0x33'),_0x175e17[_0x26fe('0x1e')]),_0x175e17);members[_0x26fe('0x34')](_0x175e17);}catch(_0x8d0bdb){utils[_0x26fe('0x14')](util[_0x26fe('0x19')](_0x26fe('0x33'),_0x175e17[_0x26fe('0x1e')]),_0x8d0bdb);}});ami['on'](_0x26fe('0x35'),function(_0x4c6a36){try{utils[_0x26fe('0x18')](util[_0x26fe('0x19')](_0x26fe('0x36'),_0x4c6a36[_0x26fe('0x1e')]),_0x4c6a36);queues['blindtransfer'](_0x4c6a36);agents[_0x26fe('0x35')](_0x4c6a36);transfers[_0x26fe('0x35')](_0x4c6a36);recordings['blindtransfer'](_0x4c6a36);}catch(_0x3a22d9){utils['error'](util[_0x26fe('0x19')](_0x26fe('0x36'),_0x4c6a36[_0x26fe('0x1e')]),_0x3a22d9);}});ami['on'](_0x26fe('0x37'),function(_0x4a2faa){try{utils[_0x26fe('0x18')](util[_0x26fe('0x19')](_0x26fe('0x38'),_0x4a2faa[_0x26fe('0x39')]),_0x4a2faa);queues['attendedtransfer'](_0x4a2faa);transfers[_0x26fe('0x37')](_0x4a2faa);agents['attendedtransfer'](_0x4a2faa);calls[_0x26fe('0x37')](_0x4a2faa);}catch(_0x588713){utils[_0x26fe('0x14')](util['format'](_0x26fe('0x38'),_0x4a2faa[_0x26fe('0x39')]),_0x588713);}});ami['on'](_0x26fe('0x3a'),function(_0x2a24a5){try{utils[_0x26fe('0x18')](util[_0x26fe('0x19')](_0x26fe('0x3b'),_0x2a24a5[_0x26fe('0x1e')]),_0x2a24a5);queues['varset'](_0x2a24a5);recordings[_0x26fe('0x3a')](_0x2a24a5);calls[_0x26fe('0x3a')](_0x2a24a5);dials['varset'](_0x2a24a5);}catch(_0x442da0){utils[_0x26fe('0x14')](util[_0x26fe('0x19')](_0x26fe('0x3b'),_0x2a24a5[_0x26fe('0x1e')]),_0x442da0);}});ami['on'](_0x26fe('0x3c'),function(_0x4cb59c){try{utils['debug'](util[_0x26fe('0x19')]('[%s][index][newexten]',_0x4cb59c[_0x26fe('0x1e')]),_0x4cb59c);calls[_0x26fe('0x3c')](_0x4cb59c);recordings[_0x26fe('0x3c')](_0x4cb59c);dials[_0x26fe('0x3c')](_0x4cb59c);}catch(_0x5524fb){utils['error'](util['format'](_0x26fe('0x3d'),_0x4cb59c[_0x26fe('0x1e')]),_0x5524fb);}});ami['on'](_0x26fe('0x3e'),function(_0x50f14c){try{utils[_0x26fe('0x18')](util[_0x26fe('0x19')](_0x26fe('0x3f'),_0x50f14c[_0x26fe('0x1e')]),_0x50f14c);calls[_0x26fe('0x3e')](_0x50f14c);recordings[_0x26fe('0x3e')](_0x50f14c);}catch(_0x2fc2e0){utils[_0x26fe('0x14')](util[_0x26fe('0x19')](_0x26fe('0x3f'),_0x50f14c[_0x26fe('0x1e')]),_0x2fc2e0);}});ami['on']('dialbegin',function(_0x3d4355){try{utils[_0x26fe('0x18')](util[_0x26fe('0x19')](_0x26fe('0x40'),_0x3d4355[_0x26fe('0x1e')]),_0x3d4355);dials['dialbegin'](_0x3d4355);}catch(_0x4022cf){utils[_0x26fe('0x14')](util[_0x26fe('0x19')](_0x26fe('0x41'),_0x3d4355['uniqueid']),_0x4022cf);}});ami['on'](_0x26fe('0x42'),function(_0x5b51ec){try{utils[_0x26fe('0x18')](util[_0x26fe('0x19')](_0x26fe('0x43'),_0x5b51ec[_0x26fe('0x1e')]),_0x5b51ec);dials[_0x26fe('0x42')](_0x5b51ec);}catch(_0x4a007a){utils['error'](util[_0x26fe('0x19')](_0x26fe('0x43'),_0x5b51ec[_0x26fe('0x1e')]),_0x4a007a);}});} \ No newline at end of file +var _0x1bb5=['[%s][index][agentringnoanswer]','uniqueid','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','asterisk','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','[%s][index][devicestatechange]','device','format','agentcalled','[%s][index][agentcalled]','agentringnoanswer','debug'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x1bb5,0xe9));var _0x51bb=function(_0x436849,_0x430b00){_0x436849=_0x436849-0x0;var _0x5c5f73=_0x1bb5[_0x436849];return _0x5c5f73;};var AsteriskManager=require(_0x51bb('0x0'));var config=require('../../config/environment');var utils=require(_0x51bb('0x1'));var util=require(_0x51bb('0x2'));var ami=new AsteriskManager(config['asterisk']['port'],config['asterisk']['ip'],config[_0x51bb('0x3')][_0x51bb('0x4')],config[_0x51bb('0x3')][_0x51bb('0x5')],!![]);ami[_0x51bb('0x6')]();if(config[_0x51bb('0x7')]&&config[_0x51bb('0x7')][_0x51bb('0x8')]){utils[_0x51bb('0x9')](_0x51bb('0xa'));}else{var agents=require(_0x51bb('0xb'));var calls=require(_0x51bb('0xc'));var queues=require('./queues.controller');var recordings=require('./recordings.controller');var members=require(_0x51bb('0xd'));var dials=require(_0x51bb('0xe'));var transfers=require(_0x51bb('0xf'));var core=require(_0x51bb('0x10'));ami['on'](_0x51bb('0x11'),core[_0x51bb('0x11')]);ami['on'](_0x51bb('0x12'),core[_0x51bb('0x12')]);ami['on']('fullybooted',core[_0x51bb('0x13')]);ami['on'](_0x51bb('0x14'),core['error']);ami['on']('close',core[_0x51bb('0x15')]);ami['on'](_0x51bb('0x16'),core[_0x51bb('0x16')]);ami['on'](_0x51bb('0x17'),function(_0x508cfe){try{utils['debug'](util['format'](_0x51bb('0x18'),_0x508cfe[_0x51bb('0x19')]),_0x508cfe);members['devicestatechange'](_0x508cfe);}catch(_0x62b21e){utils['error'](util[_0x51bb('0x1a')](_0x51bb('0x18'),_0x508cfe[_0x51bb('0x19')]),_0x62b21e);}});ami['on'](_0x51bb('0x1b'),function(_0x23bbb2){try{utils['debug'](util[_0x51bb('0x1a')](_0x51bb('0x1c'),_0x23bbb2['uniqueid']),_0x23bbb2);agents[_0x51bb('0x1b')](_0x23bbb2);}catch(_0x505910){utils['error'](util[_0x51bb('0x1a')](_0x51bb('0x1c'),_0x23bbb2['uniqueid']),_0x505910);}});ami['on'](_0x51bb('0x1d'),function(_0x21440e){try{utils[_0x51bb('0x1e')](util[_0x51bb('0x1a')](_0x51bb('0x1f'),_0x21440e['uniqueid']),_0x21440e);agents[_0x51bb('0x1d')](_0x21440e);}catch(_0x14d16d){utils[_0x51bb('0x14')](util[_0x51bb('0x1a')](_0x51bb('0x1f'),_0x21440e[_0x51bb('0x20')]),_0x14d16d);}});ami['on'](_0x51bb('0x21'),function(_0x912e09){try{utils['debug'](util['format'](_0x51bb('0x22'),_0x912e09['uniqueid']),_0x912e09);agents[_0x51bb('0x21')](_0x912e09);queues[_0x51bb('0x21')](_0x912e09);}catch(_0x771e93){utils[_0x51bb('0x14')](util[_0x51bb('0x1a')]('[%s][index][agentconnect]',_0x912e09[_0x51bb('0x20')]),_0x771e93);}});ami['on']('agentcomplete',function(_0x1effd1){try{utils[_0x51bb('0x1e')](util['format'](_0x51bb('0x23'),_0x1effd1[_0x51bb('0x20')]),_0x1effd1);agents[_0x51bb('0x24')](_0x1effd1);queues['agentcomplete'](_0x1effd1);members[_0x51bb('0x24')](_0x1effd1);}catch(_0x42ae34){utils[_0x51bb('0x14')](util[_0x51bb('0x1a')](_0x51bb('0x23'),_0x1effd1[_0x51bb('0x20')]),_0x42ae34);}});ami['on'](_0x51bb('0x25'),function(_0x178de7){try{utils[_0x51bb('0x1e')](util[_0x51bb('0x1a')](_0x51bb('0x26'),_0x178de7['uniqueid']),_0x178de7);agents[_0x51bb('0x25')](_0x178de7);queues[_0x51bb('0x25')](_0x178de7);}catch(_0x23b21c){utils[_0x51bb('0x14')](util['format'](_0x51bb('0x26'),_0x178de7[_0x51bb('0x20')]),_0x23b21c);}});ami['on'](_0x51bb('0x27'),function(_0x35943e){try{utils['debug'](util['format']('[%s][index][queuecallerjoin]',_0x35943e[_0x51bb('0x20')]),_0x35943e);queues[_0x51bb('0x27')](_0x35943e);recordings['queuecallerjoin'](_0x35943e);}catch(_0x5a0c5f){utils[_0x51bb('0x14')](util[_0x51bb('0x1a')](_0x51bb('0x28'),_0x35943e[_0x51bb('0x20')]),_0x5a0c5f);}});ami['on'](_0x51bb('0x29'),function(_0xc4202a){try{utils['debug'](util['format'](_0x51bb('0x2a'),_0xc4202a[_0x51bb('0x20')]),_0xc4202a);queues[_0x51bb('0x29')](_0xc4202a);}catch(_0x1e7462){utils[_0x51bb('0x14')](util['format']('[%s][index][queuecallerleave]',_0xc4202a[_0x51bb('0x20')]),_0x1e7462);}});ami['on'](_0x51bb('0x2b'),function(_0x16b1ca){try{utils['debug'](util[_0x51bb('0x1a')](_0x51bb('0x2c'),_0x16b1ca[_0x51bb('0x20')]),_0x16b1ca);queues['musiconholdstart'](_0x16b1ca);calls['musiconholdstart'](_0x16b1ca);}catch(_0x2f2ae4){utils['error'](util['format']('[%s][index][musiconholdstart]',_0x16b1ca[_0x51bb('0x20')]),_0x2f2ae4);}});ami['on'](_0x51bb('0x2d'),function(_0x131112){try{utils['debug'](util[_0x51bb('0x1a')](_0x51bb('0x2e'),_0x131112['uniqueid']),_0x131112);queues[_0x51bb('0x2d')](_0x131112);calls[_0x51bb('0x2d')](_0x131112);}catch(_0x3cac1f){utils[_0x51bb('0x14')](util[_0x51bb('0x1a')](_0x51bb('0x2e'),_0x131112[_0x51bb('0x20')]),_0x3cac1f);}});ami['on'](_0x51bb('0x2f'),function(_0x499482){try{utils[_0x51bb('0x1e')](util[_0x51bb('0x1a')]('[%s][index][newstate]',_0x499482['uniqueid']),_0x499482);calls[_0x51bb('0x2f')](_0x499482);recordings[_0x51bb('0x2f')](_0x499482);}catch(_0x3c03f9){utils[_0x51bb('0x14')](util[_0x51bb('0x1a')](_0x51bb('0x30'),_0x499482['uniqueid']),_0x3c03f9);}});ami['on']('hangup',function(_0x45fa01){try{utils[_0x51bb('0x1e')](util['format'](_0x51bb('0x31'),_0x45fa01[_0x51bb('0x20')]),_0x45fa01);calls['hangup'](_0x45fa01);recordings['hangup'](_0x45fa01);dials[_0x51bb('0x32')](_0x45fa01);agents[_0x51bb('0x32')](_0x45fa01);queues[_0x51bb('0x32')](_0x45fa01);}catch(_0x138ae1){utils[_0x51bb('0x14')](util[_0x51bb('0x1a')](_0x51bb('0x31'),_0x45fa01['uniqueid']),_0x138ae1);}});ami['on'](_0x51bb('0x33'),function(_0xad6a5e){try{utils['debug'](util[_0x51bb('0x1a')](_0x51bb('0x34'),_0xad6a5e[_0x51bb('0x20')]),_0xad6a5e);members[_0x51bb('0x33')](_0xad6a5e);}catch(_0x26cb45){utils[_0x51bb('0x14')](util[_0x51bb('0x1a')]('[%s][index][cdr]',_0xad6a5e[_0x51bb('0x20')]),_0x26cb45);}});ami['on'](_0x51bb('0x35'),function(_0x4745e9){try{utils['debug'](util['format'](_0x51bb('0x36'),_0x4745e9['uniqueid']),_0x4745e9);queues['blindtransfer'](_0x4745e9);agents[_0x51bb('0x35')](_0x4745e9);transfers[_0x51bb('0x35')](_0x4745e9);recordings[_0x51bb('0x35')](_0x4745e9);}catch(_0x204767){utils['error'](util[_0x51bb('0x1a')](_0x51bb('0x36'),_0x4745e9[_0x51bb('0x20')]),_0x204767);}});ami['on'](_0x51bb('0x37'),function(_0x41a5d5){try{utils[_0x51bb('0x1e')](util[_0x51bb('0x1a')](_0x51bb('0x38'),_0x41a5d5['origtransfereruniqueid']),_0x41a5d5);queues[_0x51bb('0x37')](_0x41a5d5);transfers[_0x51bb('0x37')](_0x41a5d5);agents[_0x51bb('0x37')](_0x41a5d5);calls[_0x51bb('0x37')](_0x41a5d5);}catch(_0x3a6ba9){utils[_0x51bb('0x14')](util[_0x51bb('0x1a')](_0x51bb('0x38'),_0x41a5d5['origtransfereruniqueid']),_0x3a6ba9);}});ami['on'](_0x51bb('0x39'),function(_0x52e92f){try{utils[_0x51bb('0x1e')](util[_0x51bb('0x1a')](_0x51bb('0x3a'),_0x52e92f[_0x51bb('0x20')]),_0x52e92f);queues['varset'](_0x52e92f);recordings[_0x51bb('0x39')](_0x52e92f);calls[_0x51bb('0x39')](_0x52e92f);dials[_0x51bb('0x39')](_0x52e92f);}catch(_0x2eca1){utils['error'](util[_0x51bb('0x1a')]('[%s][index][varset]',_0x52e92f[_0x51bb('0x20')]),_0x2eca1);}});ami['on']('newexten',function(_0x4cf79c){try{utils[_0x51bb('0x1e')](util[_0x51bb('0x1a')](_0x51bb('0x3b'),_0x4cf79c[_0x51bb('0x20')]),_0x4cf79c);calls[_0x51bb('0x3c')](_0x4cf79c);recordings[_0x51bb('0x3c')](_0x4cf79c);dials[_0x51bb('0x3c')](_0x4cf79c);}catch(_0x36e48d){utils[_0x51bb('0x14')](util[_0x51bb('0x1a')](_0x51bb('0x3b'),_0x4cf79c['uniqueid']),_0x36e48d);}});ami['on']('newchannel',function(_0x5c1729){try{utils[_0x51bb('0x1e')](util[_0x51bb('0x1a')]('[%s][index][newchannel]',_0x5c1729[_0x51bb('0x20')]),_0x5c1729);calls[_0x51bb('0x3d')](_0x5c1729);recordings['newchannel'](_0x5c1729);}catch(_0xb39d73){utils['error'](util[_0x51bb('0x1a')]('[%s][index][newchannel]',_0x5c1729[_0x51bb('0x20')]),_0xb39d73);}});ami['on'](_0x51bb('0x3e'),function(_0x28231c){try{utils[_0x51bb('0x1e')](util[_0x51bb('0x1a')](_0x51bb('0x3f'),_0x28231c[_0x51bb('0x20')]),_0x28231c);dials[_0x51bb('0x3e')](_0x28231c);}catch(_0x1ee82a){utils[_0x51bb('0x14')](util['format']('[%s]dialbegin',_0x28231c[_0x51bb('0x20')]),_0x1ee82a);}});ami['on'](_0x51bb('0x40'),function(_0x2f6f73){try{utils['debug'](util[_0x51bb('0x1a')](_0x51bb('0x41'),_0x2f6f73[_0x51bb('0x20')]),_0x2f6f73);dials[_0x51bb('0x40')](_0x2f6f73);}catch(_0x570f22){utils[_0x51bb('0x14')](util[_0x51bb('0x1a')](_0x51bb('0x41'),_0x2f6f73[_0x51bb('0x20')]),_0x570f22);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 66cd549..4856929 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 _0x57af=['data1','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','./utils','Local/_attended@transfer','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','type','getUserByInterface','then','membername','name','internal','CreateMemberReport','getUserByName','split','request','catch','error','some','startsWith','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','INUSE','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','format','[%s][members][devicestatechange]','agentcomplete','debug','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','data2','source','data3','destination'];(function(_0x15dc24,_0x9c179a){var _0x269d8c=function(_0x193681){while(--_0x193681){_0x15dc24['push'](_0x15dc24['shift']());}};_0x269d8c(++_0x9c179a);}(_0x57af,0xcb));var _0xf57a=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x57af[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0xf57a('0x0'));var util=require('util');var utils=require(_0xf57a('0x1'));var members={};var exclude=[_0xf57a('0x2'),'Queue:'];function writeDB(_0x5a9f02){utils[_0xf57a('0x3')](util['format'](_0xf57a('0x4'),_0x5a9f02[_0xf57a('0x5')],_0x5a9f02[_0xf57a('0x6')],_0x5a9f02[_0xf57a('0x7')],_0x5a9f02['data2'],_0x5a9f02['membername'],_0x5a9f02[_0xf57a('0x8')]));if(_0x5a9f02[_0xf57a('0x6')]){utils[_0xf57a('0x9')](_0x5a9f02[_0xf57a('0x6')])[_0xf57a('0xa')](function(_0x425327){if(_0x425327){_0x5a9f02[_0xf57a('0xb')]=_0x425327[_0xf57a('0xc')];_0x5a9f02['internal']=_0x425327[_0xf57a('0xd')];utils['request'](_0xf57a('0xe'),_0x5a9f02);}else{utils[_0xf57a('0xf')](_0x5a9f02[_0xf57a('0x6')][_0xf57a('0x10')]('/')[0x1])[_0xf57a('0xa')](function(_0x3088cb){if(_0x3088cb){_0x5a9f02[_0xf57a('0xb')]=_0x3088cb['name'];_0x5a9f02[_0xf57a('0xd')]=_0x3088cb[_0xf57a('0xd')];utils[_0xf57a('0x11')](_0xf57a('0xe'),_0x5a9f02);}});}})[_0xf57a('0x12')](function(_0x27b664){utils[_0xf57a('0x13')](util['format']('[%s][members][writeDB]',_0x5a9f02[_0xf57a('0x5')]),_0x27b664);});}delete members[_0x5a9f02[_0xf57a('0x6')]];}function startsWith(_0x23cafa,_0x748627){return _[_0xf57a('0x14')](_0x23cafa,function(_0x346302){return _[_0xf57a('0x15')](_0x748627,_0x346302);});}exports['devicestatechange']=function(_0x3893a3){try{utils['debug'](util['format']('[%s][members][devicestatechange]',members[_0x3893a3[_0xf57a('0x16')]]?members[_0x3893a3[_0xf57a('0x16')]][_0xf57a('0x5')]:_0x3893a3[_0xf57a('0x16')]),_0x3893a3);utils[_0xf57a('0x3')](util['format'](_0xf57a('0x17'),members[_0x3893a3[_0xf57a('0x16')]]?members[_0x3893a3[_0xf57a('0x16')]][_0xf57a('0x5')]:_0x3893a3['device'],_0x3893a3['state'],_0x3893a3[_0xf57a('0x16')]));switch(_0x3893a3['state']){case _0xf57a('0x18'):case'BUSY':if(!startsWith(exclude,_0x3893a3[_0xf57a('0x16')])){members[_0x3893a3['device']]={'channel':_0xf57a('0x19'),'interface':_0x3893a3[_0xf57a('0x16')],'type':_0xf57a('0x1a'),'enterAt':utils[_0xf57a('0x1b')](),'role':_0xf57a('0x1c')};}break;case _0xf57a('0x1d'):if(!_[_0xf57a('0x1e')](members[_0x3893a3[_0xf57a('0x16')]])){members[_0x3893a3[_0xf57a('0x16')]][_0xf57a('0x1f')]=utils['now']();members[_0x3893a3[_0xf57a('0x16')]][_0xf57a('0x20')]=utils[_0xf57a('0x21')](members[_0x3893a3['device']][_0xf57a('0x1f')],members[_0x3893a3[_0xf57a('0x16')]][_0xf57a('0x22')]);if(members[_0x3893a3[_0xf57a('0x16')]][_0xf57a('0x5')]){writeDB(members[_0x3893a3[_0xf57a('0x16')]]);}}break;default:break;}}catch(_0x33c057){utils['error'](util[_0xf57a('0x23')](_0xf57a('0x24'),members[_0x3893a3['device']]?members[_0x3893a3[_0xf57a('0x16')]][_0xf57a('0x5')]:_0x3893a3['device']),_0x33c057);}};exports[_0xf57a('0x25')]=function(_0x1af955){try{if(!_[_0xf57a('0x1e')](members[_0x1af955[_0xf57a('0x6')]])){utils[_0xf57a('0x26')](util[_0xf57a('0x23')]('[%s][members][agentcomplete]',_0x1af955['uniqueid']),_0x1af955);utils[_0xf57a('0x3')](util[_0xf57a('0x23')](_0xf57a('0x27'),_0x1af955[_0xf57a('0x5')],_0x1af955['interface'],_0x1af955[_0xf57a('0x28')]));members[_0x1af955[_0xf57a('0x6')]]=_[_0xf57a('0x29')](members[_0x1af955['interface']],{'data4':_0x1af955[_0xf57a('0x28')],'uniqueid':_0x1af955[_0xf57a('0x5')]});}}catch(_0x1ffbfe){utils[_0xf57a('0x13')](util[_0xf57a('0x23')]('[%s][members][agentcomplete]',_0x1af955[_0xf57a('0x5')]),_0x1ffbfe);}};exports[_0xf57a('0x2a')]=function(_0x132580){try{utils[_0xf57a('0x26')](util[_0xf57a('0x23')]('[%s][members][cdr]',_0x132580[_0xf57a('0x5')]),_0x132580);if(_0x132580['channel']){var _0x521e51=_0x132580[_0xf57a('0x7')][_0xf57a('0x10')]('-')[0x0];if(!_[_0xf57a('0x1e')](members[_0x521e51])){members[_0x521e51]=_[_0xf57a('0x29')](members[_0x521e51],{'data1':members[_0x521e51]['data1']||_0x132580['type'],'data2':members[_0x521e51][_0xf57a('0x2b')]||_0x132580[_0xf57a('0x2c')],'data3':members[_0x521e51][_0xf57a('0x2d')]||_0x132580[_0xf57a('0x2e')],'uniqueid':members[_0x521e51][_0xf57a('0x5')]||_0x132580[_0xf57a('0x5')]});utils[_0xf57a('0x3')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x132580[_0xf57a('0x5')],members[_0x521e51][_0xf57a('0x2f')],members[_0x521e51][_0xf57a('0x2b')],members[_0x521e51][_0xf57a('0x2d')]));if(members[_0x521e51]['exitAt']){writeDB(members[_0x521e51]);}}}if(_0x132580[_0xf57a('0x30')]){var _0x3382a7=_0x132580[_0xf57a('0x30')]['split']('-')[0x0];if(!_['isNil'](members[_0x3382a7])){members[_0x3382a7]=_[_0xf57a('0x29')](members[_0x3382a7],{'data1':members[_0x3382a7][_0xf57a('0x2f')]||_0x132580[_0xf57a('0x8')],'data2':members[_0x3382a7][_0xf57a('0x2b')]||_0x132580['source'],'data3':members[_0x3382a7][_0xf57a('0x2d')]||_0x132580['destination'],'uniqueid':members[_0x3382a7][_0xf57a('0x5')]||_0x132580[_0xf57a('0x5')]});utils[_0xf57a('0x3')](util[_0xf57a('0x23')](_0xf57a('0x31'),_0x132580[_0xf57a('0x5')],members[_0x3382a7]['data1'],members[_0x3382a7][_0xf57a('0x2b')],members[_0x3382a7][_0xf57a('0x2d')]));if(members[_0x3382a7][_0xf57a('0x1f')]){writeDB(members[_0x3382a7]);}}}}catch(_0xc6cde1){utils[_0xf57a('0x13')](util[_0xf57a('0x23')]('[%s][members][cdr]',_0x132580[_0xf57a('0x5')]),_0xc6cde1);}}; \ No newline at end of file +var _0xc551=['getUserByInterface','membername','name','internal','request','CreateMemberReport','getUserByName','split','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','voice','TALKING','now','agent','isNil','duration','exitAt','enterAt','[%s][members][devicestatechange]','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','[%s][members][cdr]','data1','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','data3','lodash','./utils','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','type'];(function(_0x27c4ac,_0x5b33ab){var _0x488be5=function(_0x42018c){while(--_0x42018c){_0x27c4ac['push'](_0x27c4ac['shift']());}};_0x488be5(++_0x5b33ab);}(_0xc551,0xbd));var _0x1c55=function(_0x43c14b,_0x1c838f){_0x43c14b=_0x43c14b-0x0;var _0x1f2502=_0xc551[_0x43c14b];return _0x1f2502;};'use strict';var _=require(_0x1c55('0x0'));var util=require('util');var utils=require(_0x1c55('0x1'));var members={};var exclude=['Local/_attended@transfer',_0x1c55('0x2')];function writeDB(_0x5d76e3){utils[_0x1c55('0x3')](util[_0x1c55('0x4')](_0x1c55('0x5'),_0x5d76e3[_0x1c55('0x6')],_0x5d76e3[_0x1c55('0x7')],_0x5d76e3[_0x1c55('0x8')],_0x5d76e3[_0x1c55('0x9')],_0x5d76e3['membername'],_0x5d76e3[_0x1c55('0xa')]));if(_0x5d76e3['interface']){utils[_0x1c55('0xb')](_0x5d76e3[_0x1c55('0x7')])['then'](function(_0x5905ed){if(_0x5905ed){_0x5d76e3[_0x1c55('0xc')]=_0x5905ed[_0x1c55('0xd')];_0x5d76e3[_0x1c55('0xe')]=_0x5905ed['internal'];utils[_0x1c55('0xf')](_0x1c55('0x10'),_0x5d76e3);}else{utils[_0x1c55('0x11')](_0x5d76e3['interface'][_0x1c55('0x12')]('/')[0x1])['then'](function(_0x478120){if(_0x478120){_0x5d76e3[_0x1c55('0xc')]=_0x478120[_0x1c55('0xd')];_0x5d76e3['internal']=_0x478120[_0x1c55('0xe')];utils[_0x1c55('0xf')]('CreateMemberReport',_0x5d76e3);}});}})[_0x1c55('0x13')](function(_0x42a5c4){utils[_0x1c55('0x14')](util[_0x1c55('0x4')](_0x1c55('0x15'),_0x5d76e3[_0x1c55('0x6')]),_0x42a5c4);});}delete members[_0x5d76e3['interface']];}function startsWith(_0x3fb108,_0x2904c6){return _[_0x1c55('0x16')](_0x3fb108,function(_0xca1824){return _[_0x1c55('0x17')](_0x2904c6,_0xca1824);});}exports[_0x1c55('0x18')]=function(_0x2ffca0){try{utils[_0x1c55('0x19')](util[_0x1c55('0x4')]('[%s][members][devicestatechange]',members[_0x2ffca0[_0x1c55('0x1a')]]?members[_0x2ffca0['device']][_0x1c55('0x6')]:_0x2ffca0['device']),_0x2ffca0);utils[_0x1c55('0x3')](util[_0x1c55('0x4')](_0x1c55('0x1b'),members[_0x2ffca0[_0x1c55('0x1a')]]?members[_0x2ffca0[_0x1c55('0x1a')]][_0x1c55('0x6')]:_0x2ffca0[_0x1c55('0x1a')],_0x2ffca0[_0x1c55('0x1c')],_0x2ffca0[_0x1c55('0x1a')]));switch(_0x2ffca0[_0x1c55('0x1c')]){case'INUSE':case _0x1c55('0x1d'):if(!startsWith(exclude,_0x2ffca0[_0x1c55('0x1a')])){members[_0x2ffca0['device']]={'channel':_0x1c55('0x1e'),'interface':_0x2ffca0[_0x1c55('0x1a')],'type':_0x1c55('0x1f'),'enterAt':utils[_0x1c55('0x20')](),'role':_0x1c55('0x21')};}break;case'NOT_INUSE':if(!_[_0x1c55('0x22')](members[_0x2ffca0[_0x1c55('0x1a')]])){members[_0x2ffca0[_0x1c55('0x1a')]]['exitAt']=utils[_0x1c55('0x20')]();members[_0x2ffca0[_0x1c55('0x1a')]][_0x1c55('0x23')]=utils['diffTime'](members[_0x2ffca0['device']][_0x1c55('0x24')],members[_0x2ffca0['device']][_0x1c55('0x25')]);if(members[_0x2ffca0[_0x1c55('0x1a')]][_0x1c55('0x6')]){writeDB(members[_0x2ffca0[_0x1c55('0x1a')]]);}}break;default:break;}}catch(_0x5976fb){utils[_0x1c55('0x14')](util[_0x1c55('0x4')](_0x1c55('0x26'),members[_0x2ffca0['device']]?members[_0x2ffca0[_0x1c55('0x1a')]][_0x1c55('0x6')]:_0x2ffca0[_0x1c55('0x1a')]),_0x5976fb);}};exports[_0x1c55('0x27')]=function(_0x3cdb7b){try{if(!_[_0x1c55('0x22')](members[_0x3cdb7b[_0x1c55('0x7')]])){utils[_0x1c55('0x19')](util[_0x1c55('0x4')]('[%s][members][agentcomplete]',_0x3cdb7b[_0x1c55('0x6')]),_0x3cdb7b);utils['info'](util[_0x1c55('0x4')](_0x1c55('0x28'),_0x3cdb7b[_0x1c55('0x6')],_0x3cdb7b[_0x1c55('0x7')],_0x3cdb7b['queue']));members[_0x3cdb7b[_0x1c55('0x7')]]=_[_0x1c55('0x29')](members[_0x3cdb7b[_0x1c55('0x7')]],{'data4':_0x3cdb7b[_0x1c55('0x2a')],'uniqueid':_0x3cdb7b[_0x1c55('0x6')]});}}catch(_0x40cc87){utils['error'](util[_0x1c55('0x4')]('[%s][members][agentcomplete]',_0x3cdb7b[_0x1c55('0x6')]),_0x40cc87);}};exports[_0x1c55('0x2b')]=function(_0x5c09aa){try{utils[_0x1c55('0x19')](util[_0x1c55('0x4')](_0x1c55('0x2c'),_0x5c09aa[_0x1c55('0x6')]),_0x5c09aa);if(_0x5c09aa['channel']){var _0x4975fc=_0x5c09aa['channel'][_0x1c55('0x12')]('-')[0x0];if(!_[_0x1c55('0x22')](members[_0x4975fc])){members[_0x4975fc]=_[_0x1c55('0x29')](members[_0x4975fc],{'data1':members[_0x4975fc][_0x1c55('0x2d')]||_0x5c09aa['type'],'data2':members[_0x4975fc][_0x1c55('0x9')]||_0x5c09aa['source'],'data3':members[_0x4975fc]['data3']||_0x5c09aa[_0x1c55('0x2e')],'uniqueid':members[_0x4975fc][_0x1c55('0x6')]||_0x5c09aa[_0x1c55('0x6')]});utils['info'](util[_0x1c55('0x4')](_0x1c55('0x2f'),_0x5c09aa[_0x1c55('0x6')],members[_0x4975fc][_0x1c55('0x2d')],members[_0x4975fc][_0x1c55('0x9')],members[_0x4975fc]['data3']));if(members[_0x4975fc][_0x1c55('0x24')]){writeDB(members[_0x4975fc]);}}}if(_0x5c09aa[_0x1c55('0x30')]){var _0x77f33d=_0x5c09aa[_0x1c55('0x30')]['split']('-')[0x0];if(!_['isNil'](members[_0x77f33d])){members[_0x77f33d]=_[_0x1c55('0x29')](members[_0x77f33d],{'data1':members[_0x77f33d][_0x1c55('0x2d')]||_0x5c09aa[_0x1c55('0xa')],'data2':members[_0x77f33d][_0x1c55('0x9')]||_0x5c09aa['source'],'data3':members[_0x77f33d][_0x1c55('0x31')]||_0x5c09aa[_0x1c55('0x2e')],'uniqueid':members[_0x77f33d][_0x1c55('0x6')]||_0x5c09aa['uniqueid']});utils['info'](util[_0x1c55('0x4')](_0x1c55('0x2f'),_0x5c09aa[_0x1c55('0x6')],members[_0x77f33d][_0x1c55('0x2d')],members[_0x77f33d][_0x1c55('0x9')],members[_0x77f33d][_0x1c55('0x31')]));if(members[_0x77f33d][_0x1c55('0x24')]){writeDB(members[_0x77f33d]);}}}}catch(_0x1dac2b){utils[_0x1c55('0x14')](util[_0x1c55('0x4')](_0x1c55('0x2c'),_0x5c09aa[_0x1c55('0x6')]),_0x1dac2b);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index d9189bc..57b874e 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 _0xd129=['clone','transfertargetuniqueid','calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','ATTENDEDTRANSFER','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','now','error','[%s][queues][queuecallerjoin]','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][hangup]','queuestatus','value','toUpperCase','CONTINUE','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','variable','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','queuecallerabandonAt','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','diffTime','queuecallerjoinAt','position','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','origtransfererlinkedid','transfereelinkedid'];(function(_0xb87a50,_0x4446e4){var _0x3ef828=function(_0x44e79e){while(--_0x44e79e){_0xb87a50['push'](_0xb87a50['shift']());}};_0x3ef828(++_0x4446e4);}(_0xd129,0x1ba));var _0x9d12=function(_0x46ce95,_0x1e1f8d){_0x46ce95=_0x46ce95-0x0;var _0x4446f4=_0xd129[_0x46ce95];return _0x4446f4;};'use strict';var _=require(_0x9d12('0x0'));var util=require('util');var utils=require(_0x9d12('0x1'));var queues={};function writeDB(_0x4f4dc6){utils[_0x9d12('0x2')](util[_0x9d12('0x3')](_0x9d12('0x4'),_0x4f4dc6[_0x9d12('0x5')],_0x4f4dc6['channel'],_0x4f4dc6[_0x9d12('0x6')],_0x4f4dc6[_0x9d12('0x7')],_0x4f4dc6[_0x9d12('0x8')],_0x4f4dc6[_0x9d12('0x9')],_0x4f4dc6[_0x9d12('0xa')]));if(_0x4f4dc6[_0x9d12('0x6')]){utils[_0x9d12('0xb')](_0x4f4dc6[_0x9d12('0x6')])[_0x9d12('0xc')](function(_0x54d3f9){if(_0x54d3f9){_0x4f4dc6['type']=_0x54d3f9[_0x9d12('0xd')];}utils[_0x9d12('0xe')](_0x9d12('0xf'),_0x4f4dc6);});}else{utils[_0x9d12('0xe')]('CreateVoiceQueueReport',_0x4f4dc6);}if(_0x4f4dc6[_0x9d12('0x10')]){delete queues[_0x4f4dc6['transfereduniqueid']];}else{delete queues[_0x4f4dc6[_0x9d12('0x5')]];}}exports['queuecallerjoin']=function(_0x104251){try{utils[_0x9d12('0x11')](util[_0x9d12('0x3')]('[%s][queues][queuecallerjoin]',_0x104251[_0x9d12('0x5')]),_0x104251);utils[_0x9d12('0x2')](util[_0x9d12('0x3')](_0x9d12('0x12'),_0x104251[_0x9d12('0x5')],_0x104251['queue'],_0x104251['position']));queues[_0x104251[_0x9d12('0x5')]]=_[_0x9d12('0x13')](_0x104251,{'originalposition':_0x104251['position'],'queuecallerjoinAt':utils[_0x9d12('0x14')](),'mohtime':0x0});}catch(_0x17d168){utils[_0x9d12('0x15')](util[_0x9d12('0x3')](_0x9d12('0x16'),_0x104251[_0x9d12('0x5')]),_0x17d168);}};exports[_0x9d12('0x17')]=function(_0x5f5bb7){try{if(!_[_0x9d12('0x18')](queues[_0x5f5bb7[_0x9d12('0x5')]])){utils[_0x9d12('0x11')](util[_0x9d12('0x3')]('[%s][queues][hangup]',_0x5f5bb7[_0x9d12('0x5')]),_0x5f5bb7);if(queues[_0x5f5bb7[_0x9d12('0x5')]][_0x9d12('0x19')]){if(!queues[_0x5f5bb7[_0x9d12('0x5')]][_0x9d12('0x1a')]&&!queues[_0x5f5bb7[_0x9d12('0x5')]][_0x9d12('0x1b')]){queues[_0x5f5bb7['uniqueid']][_0x9d12('0x1c')]=!![];queues[_0x5f5bb7[_0x9d12('0x5')]][_0x9d12('0x1d')]=utils[_0x9d12('0x14')]();queues[_0x5f5bb7[_0x9d12('0x5')]][_0x9d12('0xa')]=_0x9d12('0x1e');}utils[_0x9d12('0x2')](util['format'](_0x9d12('0x1f'),_0x5f5bb7['uniqueid'],queues[_0x5f5bb7['uniqueid']][_0x9d12('0x20')],queues[_0x5f5bb7['uniqueid']][_0x9d12('0xa')]));writeDB(queues[_0x5f5bb7[_0x9d12('0x5')]]);}else if(queues[_0x5f5bb7[_0x9d12('0x5')]][_0x9d12('0x10')]){utils['info'](util['format'](_0x9d12('0x21'),_0x5f5bb7['uniqueid'],queues[_0x5f5bb7[_0x9d12('0x5')]][_0x9d12('0x20')],queues[_0x5f5bb7[_0x9d12('0x5')]][_0x9d12('0x10')]));queues[queues[_0x5f5bb7[_0x9d12('0x5')]]['transfereduniqueid']]=queues[_0x5f5bb7['uniqueid']];queues[queues[_0x5f5bb7[_0x9d12('0x5')]][_0x9d12('0x10')]][_0x9d12('0x22')]=0x2;delete queues[_0x5f5bb7[_0x9d12('0x5')]];}}}catch(_0xe85fd2){utils[_0x9d12('0x15')](util[_0x9d12('0x3')](_0x9d12('0x23'),_0x5f5bb7[_0x9d12('0x5')]),_0xe85fd2);}};exports['varset']=function(_0x289419){try{utils[_0x9d12('0x11')](util[_0x9d12('0x3')]('[%s][queues][varset]',_0x289419[_0x9d12('0x5')]),_0x289419);if(!_[_0x9d12('0x18')](_0x289419['variable'][_0x9d12('0x24')])&&_0x289419[_0x9d12('0x25')][_0x9d12('0x26')]()!==_0x9d12('0x27')){if(!_[_0x9d12('0x18')](queues[_0x289419['uniqueid']])){queues[_0x289419['uniqueid']][_0x9d12('0x1a')]=![];queues[_0x289419['uniqueid']]['queuecallerabandonAt']=null;queues[_0x289419['uniqueid']]['queuecallerexit']=!![];queues[_0x289419[_0x9d12('0x5')]][_0x9d12('0x28')]=utils[_0x9d12('0x14')]();queues[_0x289419[_0x9d12('0x5')]][_0x9d12('0xa')]=_0x289419[_0x9d12('0x25')]['toUpperCase']();utils[_0x9d12('0x2')](util[_0x9d12('0x3')](_0x9d12('0x29'),_0x289419[_0x9d12('0x5')],queues[_0x289419[_0x9d12('0x5')]][_0x9d12('0x20')],_0x289419['value'],queues[_0x289419['uniqueid']][_0x9d12('0xa')]));writeDB(queues[_0x289419[_0x9d12('0x5')]]);}}else if(!_[_0x9d12('0x18')](_0x289419[_0x9d12('0x2a')][_0x9d12('0x2b')])){if(!_['isNil'](queues[_0x289419[_0x9d12('0x5')]])&&!queues[_0x289419['uniqueid']][_0x9d12('0x1a')]){queues[_0x289419[_0x9d12('0x5')]]['queuecallerabandon']=![];queues[_0x289419[_0x9d12('0x5')]]['queuecallerabandonAt']=null;queues[_0x289419[_0x9d12('0x5')]][_0x9d12('0x1b')]=!![];queues[_0x289419[_0x9d12('0x5')]]['queuecallerexitAt']=utils[_0x9d12('0x14')]();queues[_0x289419[_0x9d12('0x5')]]['queuecallerexitreason']=_0x9d12('0x2c');utils[_0x9d12('0x2')](util[_0x9d12('0x3')](_0x9d12('0x2d'),_0x289419['uniqueid'],queues[_0x289419[_0x9d12('0x5')]][_0x9d12('0x20')],_0x289419[_0x9d12('0x25')],queues[_0x289419[_0x9d12('0x5')]]['queuecallerexitreason']));}}}catch(_0x4672d2){utils[_0x9d12('0x15')](util['format'](_0x9d12('0x2e'),_0x289419[_0x9d12('0x5')]),_0x4672d2);}};exports[_0x9d12('0x1a')]=function(_0x595766){try{if(!_[_0x9d12('0x18')](queues[_0x595766['uniqueid']])){utils['debug'](util['format'](_0x9d12('0x2f'),_0x595766[_0x9d12('0x5')]),_0x595766);queues[_0x595766['uniqueid']][_0x9d12('0x1b')]=![];queues[_0x595766[_0x9d12('0x5')]]['queuecallerexitAt']=null;queues[_0x595766[_0x9d12('0x5')]][_0x9d12('0x1a')]=!![];queues[_0x595766[_0x9d12('0x5')]][_0x9d12('0x30')]=utils['now']();queues[_0x595766['uniqueid']][_0x9d12('0xa')]=_0x9d12('0x31');utils[_0x9d12('0x2')](util[_0x9d12('0x3')](_0x9d12('0x32'),_0x595766[_0x9d12('0x5')],queues[_0x595766[_0x9d12('0x5')]][_0x9d12('0x20')],queues[_0x595766['uniqueid']][_0x9d12('0xa')]));}}catch(_0x3dc30b){utils[_0x9d12('0x15')](util[_0x9d12('0x3')]('[%s][queues][queuecallerabandon]',_0x595766[_0x9d12('0x5')]),_0x3dc30b);}};exports[_0x9d12('0x33')]=function(_0x42bcff){try{if(!_[_0x9d12('0x18')](queues[_0x42bcff[_0x9d12('0x5')]])){utils[_0x9d12('0x11')](util[_0x9d12('0x3')](_0x9d12('0x34'),_0x42bcff[_0x9d12('0x5')]),_0x42bcff);utils[_0x9d12('0x2')](util[_0x9d12('0x3')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x42bcff['uniqueid'],queues[_0x42bcff[_0x9d12('0x5')]]['name'],_0x42bcff[_0x9d12('0x35')],_0x42bcff['connectedlinename']));queues[_0x42bcff[_0x9d12('0x5')]]['queuecallerleave']=!![];queues[_0x42bcff['uniqueid']][_0x9d12('0x19')]=utils[_0x9d12('0x14')]();queues[_0x42bcff[_0x9d12('0x5')]]['holdtime']=utils[_0x9d12('0x36')](queues[_0x42bcff[_0x9d12('0x5')]][_0x9d12('0x19')],queues[_0x42bcff[_0x9d12('0x5')]][_0x9d12('0x37')]);queues[_0x42bcff[_0x9d12('0x5')]][_0x9d12('0x38')]=_0x42bcff[_0x9d12('0x38')];queues[_0x42bcff[_0x9d12('0x5')]][_0x9d12('0x39')]=_0x42bcff['count'];queues[_0x42bcff[_0x9d12('0x5')]][_0x9d12('0x35')]=_0x42bcff[_0x9d12('0x35')];queues[_0x42bcff[_0x9d12('0x5')]][_0x9d12('0x3a')]=_0x42bcff['connectedlinename'];}}catch(_0x2d8abd){utils[_0x9d12('0x15')](util[_0x9d12('0x3')](_0x9d12('0x34'),_0x42bcff[_0x9d12('0x5')]),_0x2d8abd);}};exports[_0x9d12('0x3b')]=function(_0x560a55){try{if(!_[_0x9d12('0x18')](queues[_0x560a55[_0x9d12('0x5')]])){utils[_0x9d12('0x11')](util[_0x9d12('0x3')](_0x9d12('0x3c'),_0x560a55['uniqueid']),_0x560a55);utils[_0x9d12('0x2')](util[_0x9d12('0x3')](_0x9d12('0x3d'),_0x560a55['uniqueid'],queues[_0x560a55[_0x9d12('0x5')]][_0x9d12('0x20')],_0x560a55[_0x9d12('0x3e')],_0x560a55[_0x9d12('0x3f')]));queues[_0x560a55[_0x9d12('0x5')]][_0x9d12('0x1a')]=![];queues[_0x560a55[_0x9d12('0x5')]][_0x9d12('0x1a')]=![];queues[_0x560a55[_0x9d12('0x5')]]['queuecallerabandonAt']=null;queues[_0x560a55['uniqueid']][_0x9d12('0x1b')]=![];queues[_0x560a55[_0x9d12('0x5')]][_0x9d12('0xa')]=null;queues[_0x560a55[_0x9d12('0x5')]][_0x9d12('0x28')]=null;queues[_0x560a55[_0x9d12('0x5')]][_0x9d12('0x40')]=!![];queues[_0x560a55[_0x9d12('0x5')]][_0x9d12('0x9')]=_0x560a55[_0x9d12('0x3f')];queues[_0x560a55['uniqueid']][_0x9d12('0x7')]=_0x560a55['membername'];}}catch(_0x2df4dc){utils[_0x9d12('0x15')](util[_0x9d12('0x3')](_0x9d12('0x3c'),_0x560a55[_0x9d12('0x5')]),_0x2df4dc);}};exports[_0x9d12('0x41')]=function(_0x510cf8){try{if(!_[_0x9d12('0x18')](queues[_0x510cf8[_0x9d12('0x5')]])){if(queues[_0x510cf8[_0x9d12('0x5')]][_0x9d12('0x19')]){utils['debug'](util[_0x9d12('0x3')](_0x9d12('0x42'),_0x510cf8[_0x9d12('0x5')]),_0x510cf8);queues[_0x510cf8['uniqueid']][_0x9d12('0x1a')]=![];queues[_0x510cf8[_0x9d12('0x5')]][_0x9d12('0x1a')]=![];queues[_0x510cf8['uniqueid']][_0x9d12('0x30')]=null;queues[_0x510cf8['uniqueid']][_0x9d12('0x1b')]=![];queues[_0x510cf8[_0x9d12('0x5')]]['queuecallerexitAt']=null;queues[_0x510cf8[_0x9d12('0x5')]][_0x9d12('0x40')]=!![];queues[_0x510cf8['uniqueid']][_0x9d12('0x7')]=_0x510cf8['membername'];queues[_0x510cf8['uniqueid']][_0x9d12('0x1c')]=!![];queues[_0x510cf8[_0x9d12('0x5')]]['queuecallercompleteAt']=utils[_0x9d12('0x14')]();if(_0x510cf8[_0x9d12('0x43')]==_0x9d12('0x44')){if(!queues[_0x510cf8[_0x9d12('0x5')]]['transfer']){queues[_0x510cf8[_0x9d12('0x5')]][_0x9d12('0xa')]=_0x9d12('0x45');}}else{queues[_0x510cf8[_0x9d12('0x5')]]['queuecallerexitreason']=_0x9d12('0x46')+_0x510cf8['reason']['toUpperCase']();}utils['info'](util[_0x9d12('0x3')](_0x9d12('0x47'),_0x510cf8[_0x9d12('0x5')],queues[_0x510cf8[_0x9d12('0x5')]][_0x9d12('0x20')],_0x510cf8['membername'],queues[_0x510cf8['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x510cf8[_0x9d12('0x5')]]);}}}catch(_0x135d3c){utils[_0x9d12('0x15')](util[_0x9d12('0x3')](_0x9d12('0x42'),_0x510cf8[_0x9d12('0x5')]),_0x135d3c);}};exports[_0x9d12('0x48')]=function(_0xc69362){try{if(!_['isNil'](queues[_0xc69362[_0x9d12('0x49')]])){utils[_0x9d12('0x11')](util[_0x9d12('0x3')](_0x9d12('0x4a'),_0xc69362[_0x9d12('0x5')]),_0xc69362);queues[_0xc69362[_0x9d12('0x49')]][_0x9d12('0x44')]=!![];queues[_0xc69362[_0x9d12('0x49')]][_0x9d12('0x4b')]=_0x9d12('0x4c');queues[_0xc69362[_0x9d12('0x49')]][_0x9d12('0x4d')]=_0xc69362[_0x9d12('0x4e')];queues[_0xc69362['transfereeuniqueid']][_0x9d12('0x4f')]=_0xc69362[_0x9d12('0x49')];queues[_0xc69362[_0x9d12('0x49')]][_0x9d12('0xa')]='BLINDTRANSFER';utils[_0x9d12('0x2')](util[_0x9d12('0x3')](_0x9d12('0x50'),_0xc69362['uniqueid'],queues[_0xc69362['transfereeuniqueid']]['name'],_0xc69362['transfereeuniqueid'],_0xc69362[_0x9d12('0x4e')]));}}catch(_0x3531b5){utils[_0x9d12('0x15')](util['format'](_0x9d12('0x4a'),_0xc69362[_0x9d12('0x5')]),_0x3531b5);}};exports['attendedtransfer']=function(_0x50002b){try{utils[_0x9d12('0x11')](util[_0x9d12('0x3')](_0x9d12('0x51'),_0x50002b[_0x9d12('0x52')]),_0x50002b);if(_0x50002b[_0x9d12('0x52')]==_0x50002b['origtransfererlinkedid']){if(!_['isNil'](queues[_0x50002b[_0x9d12('0x53')]])){utils[_0x9d12('0x2')](util['format'](_0x9d12('0x54'),_0x50002b['origtransfereruniqueid'],queues[_0x50002b['secondtransfererlinkedid']][_0x9d12('0x20')],_0x50002b[_0x9d12('0x55')]));queues[_0x50002b[_0x9d12('0x53')]]['transfer']=!![];queues[_0x50002b['secondtransfererlinkedid']][_0x9d12('0x4b')]='ATTENDED';queues[_0x50002b[_0x9d12('0x53')]][_0x9d12('0x4d')]=_0x50002b[_0x9d12('0x55')];queues[_0x50002b[_0x9d12('0x53')]]['transferuniqueid']=_0x50002b['origtransfereruniqueid'];queues[_0x50002b[_0x9d12('0x53')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0x9d12('0x18')](queues[_0x50002b[_0x9d12('0x56')]])){if(_0x50002b[_0x9d12('0x57')]&&queues[_0x50002b['transfereelinkedid']]){queues[_0x50002b[_0x9d12('0x57')]][_0x9d12('0x22')]=0x1;queues[_0x50002b[_0x9d12('0x49')]]=_[_0x9d12('0x58')](queues[_0x50002b[_0x9d12('0x57')]]);queues[_0x50002b['transfereeuniqueid']][_0x9d12('0x10')]=_0x50002b[_0x9d12('0x59')];queues[_0x50002b[_0x9d12('0x49')]][_0x9d12('0x22')]=0x2;queues[_0x50002b[_0x9d12('0x49')]]['calleridnum']=queues[_0x50002b[_0x9d12('0x53')]]['calleridnum'];queues[_0x50002b[_0x9d12('0x49')]][_0x9d12('0x5a')]=queues[_0x50002b[_0x9d12('0x53')]][_0x9d12('0x5a')];queues[_0x50002b[_0x9d12('0x49')]][_0x9d12('0x37')]=utils['now']();queues[_0x50002b['transfereeuniqueid']][_0x9d12('0x19')]=utils[_0x9d12('0x14')]();queues[_0x50002b[_0x9d12('0x49')]][_0x9d12('0x5b')]=0x0;queues[_0x50002b[_0x9d12('0x49')]][_0x9d12('0x5c')]=0x0;utils[_0x9d12('0x2')](util[_0x9d12('0x3')](_0x9d12('0x5d'),_0x50002b[_0x9d12('0x52')],queues[_0x50002b[_0x9d12('0x49')]][_0x9d12('0x20')],queues[_0x50002b[_0x9d12('0x49')]][_0x9d12('0x8')],queues[_0x50002b[_0x9d12('0x49')]][_0x9d12('0x5a')]));}else{utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x50002b[_0x9d12('0x52')],queues[_0x50002b[_0x9d12('0x56')]][_0x9d12('0x20')],_0x50002b[_0x9d12('0x53')]));queues[_0x50002b[_0x9d12('0x56')]][_0x9d12('0x10')]=_0x50002b[_0x9d12('0x53')];}}}else if(_0x50002b[_0x9d12('0x5e')]==_0x50002b[_0x9d12('0x53')]){if(!_['isNil'](queues[_0x50002b['origtransfererlinkedid']])){utils[_0x9d12('0x2')](util[_0x9d12('0x3')](_0x9d12('0x5f'),_0x50002b['origtransfereruniqueid'],queues[_0x50002b[_0x9d12('0x56')]][_0x9d12('0x20')],_0x50002b['secondtransfereruniqueid'],_0x50002b['secondtransfererexten']));queues[_0x50002b[_0x9d12('0x56')]]['transfer']=!![];queues[_0x50002b['origtransfererlinkedid']][_0x9d12('0x4b')]=_0x9d12('0x60');queues[_0x50002b['origtransfererlinkedid']][_0x9d12('0x4d')]=_0x50002b['secondtransfererexten'];queues[_0x50002b[_0x9d12('0x56')]][_0x9d12('0x4f')]=_0x50002b['secondtransfereruniqueid'];queues[_0x50002b[_0x9d12('0x56')]][_0x9d12('0xa')]=_0x9d12('0x61');}if(!_[_0x9d12('0x18')](queues[_0x50002b[_0x9d12('0x53')]])){if(_0x50002b[_0x9d12('0x62')]&&queues[_0x50002b['transfertargetlinkedid']]){queues[_0x50002b[_0x9d12('0x62')]][_0x9d12('0x22')]=0x1;queues[_0x50002b[_0x9d12('0x59')]]=_[_0x9d12('0x58')](queues[_0x50002b[_0x9d12('0x62')]]);queues[_0x50002b[_0x9d12('0x59')]][_0x9d12('0x10')]=_0x50002b[_0x9d12('0x59')];queues[_0x50002b[_0x9d12('0x59')]][_0x9d12('0x22')]=0x2;queues[_0x50002b[_0x9d12('0x59')]]['calleridnum']=queues[_0x50002b[_0x9d12('0x56')]][_0x9d12('0x8')];queues[_0x50002b[_0x9d12('0x59')]]['calleridname']=queues[_0x50002b['origtransfererlinkedid']][_0x9d12('0x5a')];queues[_0x50002b[_0x9d12('0x59')]]['queuecallerjoinAt']=utils[_0x9d12('0x14')]();queues[_0x50002b[_0x9d12('0x59')]]['queuecallerleaveAt']=utils[_0x9d12('0x14')]();queues[_0x50002b[_0x9d12('0x59')]][_0x9d12('0x5b')]=0x0;queues[_0x50002b[_0x9d12('0x59')]]['mohtime']=0x0;utils['info'](util[_0x9d12('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x50002b[_0x9d12('0x52')],queues[_0x50002b[_0x9d12('0x59')]][_0x9d12('0x20')],queues[_0x50002b[_0x9d12('0x59')]][_0x9d12('0x10')],queues[_0x50002b['transfertargetuniqueid']][_0x9d12('0x8')],queues[_0x50002b[_0x9d12('0x59')]]['calleridname']));}else{utils[_0x9d12('0x2')](util[_0x9d12('0x3')](_0x9d12('0x63'),_0x50002b[_0x9d12('0x52')],queues[_0x50002b[_0x9d12('0x53')]][_0x9d12('0x20')],_0x50002b[_0x9d12('0x56')]));queues[_0x50002b[_0x9d12('0x53')]]['transfereduniqueid']=_0x50002b[_0x9d12('0x56')];}}}}catch(_0x5658f7){utils[_0x9d12('0x15')](util[_0x9d12('0x3')](_0x9d12('0x51'),_0x50002b[_0x9d12('0x52')]),_0x5658f7);}};exports[_0x9d12('0x64')]=function(_0x497c62){try{if(!_['isNil'](queues[_0x497c62[_0x9d12('0x5')]])){utils[_0x9d12('0x11')](util['format'](_0x9d12('0x65'),_0x497c62[_0x9d12('0x5')]),_0x497c62);queues[_0x497c62['uniqueid']][_0x9d12('0x66')]=utils['now']();utils[_0x9d12('0x2')](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x497c62['uniqueid'],queues[_0x497c62[_0x9d12('0x5')]][_0x9d12('0x20')],queues[_0x497c62[_0x9d12('0x5')]][_0x9d12('0x66')]));}}catch(_0xc81beb){utils[_0x9d12('0x15')](util['format'](_0x9d12('0x65'),_0x497c62[_0x9d12('0x5')]),_0xc81beb);}};exports[_0x9d12('0x67')]=function(_0x3330f9){try{if(!_[_0x9d12('0x18')](queues[_0x3330f9[_0x9d12('0x5')]])){if(!_[_0x9d12('0x18')](queues[_0x3330f9[_0x9d12('0x5')]][_0x9d12('0x66')])){utils[_0x9d12('0x11')](util['format'](_0x9d12('0x68'),_0x3330f9['uniqueid']),_0x3330f9);queues[_0x3330f9['uniqueid']][_0x9d12('0x5c')]+=utils['diffTime'](utils[_0x9d12('0x14')](),queues[_0x3330f9[_0x9d12('0x5')]]['musiconholdstartAt']);utils[_0x9d12('0x2')](util[_0x9d12('0x3')](_0x9d12('0x69'),_0x3330f9[_0x9d12('0x5')],queues[_0x3330f9[_0x9d12('0x5')]][_0x9d12('0x20')],queues[_0x3330f9[_0x9d12('0x5')]][_0x9d12('0x5c')]));delete queues[_0x3330f9[_0x9d12('0x5')]]['musiconholdstartAt'];}}}catch(_0x79ca3e){utils[_0x9d12('0x15')](util[_0x9d12('0x3')](_0x9d12('0x68'),_0x3330f9[_0x9d12('0x5')]),_0x79ca3e);}}; \ No newline at end of file +var _0xb517=['uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','getVoiceQueueByName','then','type','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','variable','queuestatus','toUpperCase','CONTINUE','queuecallerabandonAt','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queuecallerexitreason','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','queuecallerexit','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleaveAt','holdtime','diffTime','count','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','extension','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','transferexten','origtransfererexten','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','lodash','util','format'];(function(_0x23dcde,_0x2b3d14){var _0x345a6f=function(_0x5a38a3){while(--_0x5a38a3){_0x23dcde['push'](_0x23dcde['shift']());}};_0x345a6f(++_0x2b3d14);}(_0xb517,0x13e));var _0x7b51=function(_0x59162a,_0x10e547){_0x59162a=_0x59162a-0x0;var _0x35e50d=_0xb517[_0x59162a];return _0x35e50d;};'use strict';var _=require(_0x7b51('0x0'));var util=require(_0x7b51('0x1'));var utils=require('./utils');var queues={};function writeDB(_0xbdb8a6){utils['info'](util[_0x7b51('0x2')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0xbdb8a6[_0x7b51('0x3')],_0xbdb8a6[_0x7b51('0x4')],_0xbdb8a6[_0x7b51('0x5')],_0xbdb8a6[_0x7b51('0x6')],_0xbdb8a6[_0x7b51('0x7')],_0xbdb8a6[_0x7b51('0x8')],_0xbdb8a6['queuecallerexitreason']));if(_0xbdb8a6['queue']){utils[_0x7b51('0x9')](_0xbdb8a6['queue'])[_0x7b51('0xa')](function(_0x49b63b){if(_0x49b63b){_0xbdb8a6[_0x7b51('0xb')]=_0x49b63b[_0x7b51('0xb')];}utils['request']('CreateVoiceQueueReport',_0xbdb8a6);});}else{utils[_0x7b51('0xc')]('CreateVoiceQueueReport',_0xbdb8a6);}if(_0xbdb8a6[_0x7b51('0xd')]){delete queues[_0xbdb8a6['transfereduniqueid']];}else{delete queues[_0xbdb8a6[_0x7b51('0x3')]];}}exports[_0x7b51('0xe')]=function(_0x3835a6){try{utils[_0x7b51('0xf')](util[_0x7b51('0x2')](_0x7b51('0x10'),_0x3835a6[_0x7b51('0x3')]),_0x3835a6);utils[_0x7b51('0x11')](util[_0x7b51('0x2')](_0x7b51('0x12'),_0x3835a6[_0x7b51('0x3')],_0x3835a6[_0x7b51('0x5')],_0x3835a6[_0x7b51('0x13')]));queues[_0x3835a6[_0x7b51('0x3')]]=_[_0x7b51('0x14')](_0x3835a6,{'originalposition':_0x3835a6[_0x7b51('0x13')],'queuecallerjoinAt':utils[_0x7b51('0x15')](),'mohtime':0x0});}catch(_0x4fa346){utils[_0x7b51('0x16')](util[_0x7b51('0x2')]('[%s][queues][queuecallerjoin]',_0x3835a6[_0x7b51('0x3')]),_0x4fa346);}};exports[_0x7b51('0x17')]=function(_0x36510a){try{if(!_[_0x7b51('0x18')](queues[_0x36510a[_0x7b51('0x3')]])){utils['debug'](util[_0x7b51('0x2')](_0x7b51('0x19'),_0x36510a[_0x7b51('0x3')]),_0x36510a);if(queues[_0x36510a[_0x7b51('0x3')]]['queuecallerleaveAt']){if(!queues[_0x36510a['uniqueid']][_0x7b51('0x1a')]&&!queues[_0x36510a['uniqueid']]['queuecallerexit']){queues[_0x36510a[_0x7b51('0x3')]][_0x7b51('0x1b')]=!![];queues[_0x36510a[_0x7b51('0x3')]][_0x7b51('0x1c')]=utils[_0x7b51('0x15')]();queues[_0x36510a[_0x7b51('0x3')]]['queuecallerexitreason']=_0x7b51('0x1d');}utils[_0x7b51('0x11')](util[_0x7b51('0x2')](_0x7b51('0x1e'),_0x36510a[_0x7b51('0x3')],queues[_0x36510a[_0x7b51('0x3')]][_0x7b51('0x1f')],queues[_0x36510a['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x36510a[_0x7b51('0x3')]]);}else if(queues[_0x36510a[_0x7b51('0x3')]][_0x7b51('0xd')]){utils[_0x7b51('0x11')](util[_0x7b51('0x2')](_0x7b51('0x20'),_0x36510a[_0x7b51('0x3')],queues[_0x36510a['uniqueid']][_0x7b51('0x1f')],queues[_0x36510a['uniqueid']][_0x7b51('0xd')]));queues[queues[_0x36510a[_0x7b51('0x3')]]['transfereduniqueid']]=queues[_0x36510a[_0x7b51('0x3')]];queues[queues[_0x36510a['uniqueid']][_0x7b51('0xd')]][_0x7b51('0x21')]=0x2;delete queues[_0x36510a[_0x7b51('0x3')]];}}}catch(_0x21594d){utils[_0x7b51('0x16')](util[_0x7b51('0x2')](_0x7b51('0x19'),_0x36510a[_0x7b51('0x3')]),_0x21594d);}};exports[_0x7b51('0x22')]=function(_0x4b05ba){try{utils[_0x7b51('0xf')](util[_0x7b51('0x2')]('[%s][queues][varset]',_0x4b05ba[_0x7b51('0x3')]),_0x4b05ba);if(!_['isNil'](_0x4b05ba[_0x7b51('0x23')][_0x7b51('0x24')])&&_0x4b05ba['value'][_0x7b51('0x25')]()!==_0x7b51('0x26')){if(!_[_0x7b51('0x18')](queues[_0x4b05ba['uniqueid']])){queues[_0x4b05ba['uniqueid']][_0x7b51('0x1a')]=![];queues[_0x4b05ba[_0x7b51('0x3')]][_0x7b51('0x27')]=null;queues[_0x4b05ba[_0x7b51('0x3')]]['queuecallerexit']=!![];queues[_0x4b05ba[_0x7b51('0x3')]]['queuecallerexitAt']=utils[_0x7b51('0x15')]();queues[_0x4b05ba['uniqueid']]['queuecallerexitreason']=_0x4b05ba[_0x7b51('0x28')][_0x7b51('0x25')]();utils['info'](util[_0x7b51('0x2')](_0x7b51('0x29'),_0x4b05ba[_0x7b51('0x3')],queues[_0x4b05ba['uniqueid']][_0x7b51('0x1f')],_0x4b05ba[_0x7b51('0x28')],queues[_0x4b05ba[_0x7b51('0x3')]][_0x7b51('0x2a')]));writeDB(queues[_0x4b05ba[_0x7b51('0x3')]]);}}else if(!_['isNil'](_0x4b05ba[_0x7b51('0x23')]['queueposition'])){if(!_[_0x7b51('0x18')](queues[_0x4b05ba['uniqueid']])&&!queues[_0x4b05ba[_0x7b51('0x3')]][_0x7b51('0x1a')]){queues[_0x4b05ba['uniqueid']][_0x7b51('0x1a')]=![];queues[_0x4b05ba[_0x7b51('0x3')]][_0x7b51('0x27')]=null;queues[_0x4b05ba[_0x7b51('0x3')]]['queuecallerexit']=!![];queues[_0x4b05ba[_0x7b51('0x3')]]['queuecallerexitAt']=utils[_0x7b51('0x15')]();queues[_0x4b05ba[_0x7b51('0x3')]][_0x7b51('0x2a')]=_0x7b51('0x2b');utils[_0x7b51('0x11')](util[_0x7b51('0x2')](_0x7b51('0x2c'),_0x4b05ba['uniqueid'],queues[_0x4b05ba[_0x7b51('0x3')]]['name'],_0x4b05ba[_0x7b51('0x28')],queues[_0x4b05ba[_0x7b51('0x3')]][_0x7b51('0x2a')]));}}}catch(_0x3bd22c){utils[_0x7b51('0x16')](util[_0x7b51('0x2')](_0x7b51('0x2d'),_0x4b05ba[_0x7b51('0x3')]),_0x3bd22c);}};exports[_0x7b51('0x1a')]=function(_0x131aa8){try{if(!_['isNil'](queues[_0x131aa8[_0x7b51('0x3')]])){utils[_0x7b51('0xf')](util[_0x7b51('0x2')](_0x7b51('0x2e'),_0x131aa8[_0x7b51('0x3')]),_0x131aa8);queues[_0x131aa8['uniqueid']][_0x7b51('0x2f')]=![];queues[_0x131aa8[_0x7b51('0x3')]]['queuecallerexitAt']=null;queues[_0x131aa8[_0x7b51('0x3')]][_0x7b51('0x1a')]=!![];queues[_0x131aa8[_0x7b51('0x3')]]['queuecallerabandonAt']=utils[_0x7b51('0x15')]();queues[_0x131aa8[_0x7b51('0x3')]][_0x7b51('0x2a')]=_0x7b51('0x30');utils['info'](util[_0x7b51('0x2')](_0x7b51('0x31'),_0x131aa8[_0x7b51('0x3')],queues[_0x131aa8[_0x7b51('0x3')]][_0x7b51('0x1f')],queues[_0x131aa8[_0x7b51('0x3')]][_0x7b51('0x2a')]));}}catch(_0x44745d){utils[_0x7b51('0x16')](util[_0x7b51('0x2')](_0x7b51('0x2e'),_0x131aa8[_0x7b51('0x3')]),_0x44745d);}};exports[_0x7b51('0x32')]=function(_0x1ae7ac){try{if(!_[_0x7b51('0x18')](queues[_0x1ae7ac[_0x7b51('0x3')]])){utils['debug'](util[_0x7b51('0x2')](_0x7b51('0x33'),_0x1ae7ac['uniqueid']),_0x1ae7ac);utils[_0x7b51('0x11')](util['format'](_0x7b51('0x34'),_0x1ae7ac[_0x7b51('0x3')],queues[_0x1ae7ac[_0x7b51('0x3')]][_0x7b51('0x1f')],_0x1ae7ac[_0x7b51('0x35')],_0x1ae7ac[_0x7b51('0x36')]));queues[_0x1ae7ac[_0x7b51('0x3')]][_0x7b51('0x32')]=!![];queues[_0x1ae7ac[_0x7b51('0x3')]][_0x7b51('0x37')]=utils[_0x7b51('0x15')]();queues[_0x1ae7ac[_0x7b51('0x3')]][_0x7b51('0x38')]=utils[_0x7b51('0x39')](queues[_0x1ae7ac[_0x7b51('0x3')]][_0x7b51('0x37')],queues[_0x1ae7ac['uniqueid']]['queuecallerjoinAt']);queues[_0x1ae7ac[_0x7b51('0x3')]]['position']=_0x1ae7ac[_0x7b51('0x13')];queues[_0x1ae7ac[_0x7b51('0x3')]][_0x7b51('0x3a')]=_0x1ae7ac[_0x7b51('0x3a')];queues[_0x1ae7ac[_0x7b51('0x3')]][_0x7b51('0x35')]=_0x1ae7ac[_0x7b51('0x35')];queues[_0x1ae7ac[_0x7b51('0x3')]][_0x7b51('0x36')]=_0x1ae7ac[_0x7b51('0x36')];}}catch(_0x380b46){utils[_0x7b51('0x16')](util[_0x7b51('0x2')]('[%s][queues][queuecallerleave]',_0x1ae7ac['uniqueid']),_0x380b46);}};exports['agentconnect']=function(_0x4e2c5f){try{if(!_[_0x7b51('0x18')](queues[_0x4e2c5f[_0x7b51('0x3')]])){utils[_0x7b51('0xf')](util['format'](_0x7b51('0x3b'),_0x4e2c5f['uniqueid']),_0x4e2c5f);utils[_0x7b51('0x11')](util['format'](_0x7b51('0x3c'),_0x4e2c5f['uniqueid'],queues[_0x4e2c5f[_0x7b51('0x3')]][_0x7b51('0x1f')],_0x4e2c5f[_0x7b51('0x3d')],_0x4e2c5f[_0x7b51('0x3e')]));queues[_0x4e2c5f[_0x7b51('0x3')]][_0x7b51('0x1a')]=![];queues[_0x4e2c5f[_0x7b51('0x3')]][_0x7b51('0x1a')]=![];queues[_0x4e2c5f[_0x7b51('0x3')]]['queuecallerabandonAt']=null;queues[_0x4e2c5f['uniqueid']][_0x7b51('0x2f')]=![];queues[_0x4e2c5f[_0x7b51('0x3')]]['queuecallerexitreason']=null;queues[_0x4e2c5f[_0x7b51('0x3')]]['queuecallerexitAt']=null;queues[_0x4e2c5f[_0x7b51('0x3')]][_0x7b51('0x3f')]=!![];queues[_0x4e2c5f[_0x7b51('0x3')]][_0x7b51('0x8')]=_0x4e2c5f[_0x7b51('0x3e')];queues[_0x4e2c5f['uniqueid']][_0x7b51('0x6')]=_0x4e2c5f[_0x7b51('0x3d')];}}catch(_0x537b8d){utils[_0x7b51('0x16')](util[_0x7b51('0x2')]('[%s][queues][agentconnect]',_0x4e2c5f[_0x7b51('0x3')]),_0x537b8d);}};exports[_0x7b51('0x40')]=function(_0x162403){try{if(!_[_0x7b51('0x18')](queues[_0x162403[_0x7b51('0x3')]])){if(queues[_0x162403['uniqueid']]['queuecallerleaveAt']){utils[_0x7b51('0xf')](util[_0x7b51('0x2')](_0x7b51('0x41'),_0x162403['uniqueid']),_0x162403);queues[_0x162403['uniqueid']]['queuecallerabandon']=![];queues[_0x162403[_0x7b51('0x3')]]['queuecallerabandon']=![];queues[_0x162403[_0x7b51('0x3')]][_0x7b51('0x27')]=null;queues[_0x162403[_0x7b51('0x3')]][_0x7b51('0x2f')]=![];queues[_0x162403['uniqueid']]['queuecallerexitAt']=null;queues[_0x162403['uniqueid']][_0x7b51('0x3f')]=!![];queues[_0x162403[_0x7b51('0x3')]][_0x7b51('0x6')]=_0x162403[_0x7b51('0x3d')];queues[_0x162403[_0x7b51('0x3')]][_0x7b51('0x1b')]=!![];queues[_0x162403[_0x7b51('0x3')]][_0x7b51('0x1c')]=utils['now']();if(_0x162403[_0x7b51('0x42')]==_0x7b51('0x43')){if(!queues[_0x162403[_0x7b51('0x3')]][_0x7b51('0x43')]){queues[_0x162403['uniqueid']][_0x7b51('0x2a')]=_0x7b51('0x44');}}else{queues[_0x162403['uniqueid']]['queuecallerexitreason']='COMPLETEDBY'+_0x162403[_0x7b51('0x42')][_0x7b51('0x25')]();}utils[_0x7b51('0x11')](util[_0x7b51('0x2')](_0x7b51('0x45'),_0x162403[_0x7b51('0x3')],queues[_0x162403[_0x7b51('0x3')]][_0x7b51('0x1f')],_0x162403[_0x7b51('0x3d')],queues[_0x162403[_0x7b51('0x3')]]['queuecallerexitreason']));writeDB(queues[_0x162403[_0x7b51('0x3')]]);}}}catch(_0x3c9cf1){utils[_0x7b51('0x16')](util['format'](_0x7b51('0x41'),_0x162403[_0x7b51('0x3')]),_0x3c9cf1);}};exports[_0x7b51('0x46')]=function(_0x556ce0){try{if(!_[_0x7b51('0x18')](queues[_0x556ce0[_0x7b51('0x47')]])){utils[_0x7b51('0xf')](util['format'](_0x7b51('0x48'),_0x556ce0[_0x7b51('0x3')]),_0x556ce0);queues[_0x556ce0['transfereeuniqueid']][_0x7b51('0x43')]=!![];queues[_0x556ce0[_0x7b51('0x47')]][_0x7b51('0x49')]=_0x7b51('0x4a');queues[_0x556ce0[_0x7b51('0x47')]]['transferexten']=_0x556ce0[_0x7b51('0x4b')];queues[_0x556ce0[_0x7b51('0x47')]]['transferuniqueid']=_0x556ce0['transfereeuniqueid'];queues[_0x556ce0['transfereeuniqueid']][_0x7b51('0x2a')]=_0x7b51('0x4c');utils['info'](util[_0x7b51('0x2')](_0x7b51('0x4d'),_0x556ce0[_0x7b51('0x3')],queues[_0x556ce0['transfereeuniqueid']][_0x7b51('0x1f')],_0x556ce0['transfereeuniqueid'],_0x556ce0['extension']));}}catch(_0x1a36b0){utils[_0x7b51('0x16')](util[_0x7b51('0x2')](_0x7b51('0x48'),_0x556ce0[_0x7b51('0x3')]),_0x1a36b0);}};exports[_0x7b51('0x4e')]=function(_0x3b9b44){try{utils[_0x7b51('0xf')](util[_0x7b51('0x2')](_0x7b51('0x4f'),_0x3b9b44[_0x7b51('0x50')]),_0x3b9b44);if(_0x3b9b44[_0x7b51('0x50')]==_0x3b9b44[_0x7b51('0x51')]){if(!_[_0x7b51('0x18')](queues[_0x3b9b44[_0x7b51('0x52')]])){utils[_0x7b51('0x11')](util[_0x7b51('0x2')](_0x7b51('0x53'),_0x3b9b44[_0x7b51('0x50')],queues[_0x3b9b44[_0x7b51('0x52')]][_0x7b51('0x1f')],_0x3b9b44['origtransfererexten']));queues[_0x3b9b44['secondtransfererlinkedid']][_0x7b51('0x43')]=!![];queues[_0x3b9b44[_0x7b51('0x52')]][_0x7b51('0x49')]=_0x7b51('0x54');queues[_0x3b9b44[_0x7b51('0x52')]][_0x7b51('0x55')]=_0x3b9b44[_0x7b51('0x56')];queues[_0x3b9b44[_0x7b51('0x52')]][_0x7b51('0x57')]=_0x3b9b44[_0x7b51('0x50')];queues[_0x3b9b44[_0x7b51('0x52')]][_0x7b51('0x2a')]=_0x7b51('0x58');}if(!_[_0x7b51('0x18')](queues[_0x3b9b44[_0x7b51('0x51')]])){if(_0x3b9b44[_0x7b51('0x59')]&&queues[_0x3b9b44[_0x7b51('0x59')]]){queues[_0x3b9b44[_0x7b51('0x59')]][_0x7b51('0x21')]=0x1;queues[_0x3b9b44[_0x7b51('0x47')]]=_[_0x7b51('0x5a')](queues[_0x3b9b44[_0x7b51('0x59')]]);queues[_0x3b9b44[_0x7b51('0x47')]]['transfereduniqueid']=_0x3b9b44[_0x7b51('0x5b')];queues[_0x3b9b44[_0x7b51('0x47')]][_0x7b51('0x21')]=0x2;queues[_0x3b9b44['transfereeuniqueid']]['calleridnum']=queues[_0x3b9b44['secondtransfererlinkedid']][_0x7b51('0x7')];queues[_0x3b9b44[_0x7b51('0x47')]][_0x7b51('0x5c')]=queues[_0x3b9b44['secondtransfererlinkedid']][_0x7b51('0x5c')];queues[_0x3b9b44[_0x7b51('0x47')]][_0x7b51('0x5d')]=utils[_0x7b51('0x15')]();queues[_0x3b9b44['transfereeuniqueid']]['queuecallerleaveAt']=utils[_0x7b51('0x15')]();queues[_0x3b9b44[_0x7b51('0x47')]]['holdtime']=0x0;queues[_0x3b9b44['transfereeuniqueid']]['mohtime']=0x0;utils[_0x7b51('0x11')](util[_0x7b51('0x2')](_0x7b51('0x5e'),_0x3b9b44[_0x7b51('0x50')],queues[_0x3b9b44[_0x7b51('0x47')]]['name'],queues[_0x3b9b44[_0x7b51('0x47')]][_0x7b51('0x7')],queues[_0x3b9b44['transfereeuniqueid']][_0x7b51('0x5c')]));}else{utils[_0x7b51('0x11')](util['format'](_0x7b51('0x5f'),_0x3b9b44[_0x7b51('0x50')],queues[_0x3b9b44[_0x7b51('0x51')]]['name'],_0x3b9b44[_0x7b51('0x52')]));queues[_0x3b9b44[_0x7b51('0x51')]][_0x7b51('0xd')]=_0x3b9b44['secondtransfererlinkedid'];}}}else if(_0x3b9b44[_0x7b51('0x60')]==_0x3b9b44[_0x7b51('0x52')]){if(!_[_0x7b51('0x18')](queues[_0x3b9b44[_0x7b51('0x51')]])){utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x3b9b44[_0x7b51('0x50')],queues[_0x3b9b44[_0x7b51('0x51')]][_0x7b51('0x1f')],_0x3b9b44[_0x7b51('0x60')],_0x3b9b44[_0x7b51('0x61')]));queues[_0x3b9b44[_0x7b51('0x51')]][_0x7b51('0x43')]=!![];queues[_0x3b9b44['origtransfererlinkedid']][_0x7b51('0x49')]=_0x7b51('0x54');queues[_0x3b9b44[_0x7b51('0x51')]][_0x7b51('0x55')]=_0x3b9b44[_0x7b51('0x61')];queues[_0x3b9b44['origtransfererlinkedid']][_0x7b51('0x57')]=_0x3b9b44[_0x7b51('0x60')];queues[_0x3b9b44[_0x7b51('0x51')]][_0x7b51('0x2a')]=_0x7b51('0x58');}if(!_['isNil'](queues[_0x3b9b44[_0x7b51('0x52')]])){if(_0x3b9b44[_0x7b51('0x62')]&&queues[_0x3b9b44['transfertargetlinkedid']]){queues[_0x3b9b44['transfertargetlinkedid']][_0x7b51('0x21')]=0x1;queues[_0x3b9b44[_0x7b51('0x5b')]]=_['clone'](queues[_0x3b9b44[_0x7b51('0x62')]]);queues[_0x3b9b44[_0x7b51('0x5b')]][_0x7b51('0xd')]=_0x3b9b44[_0x7b51('0x5b')];queues[_0x3b9b44[_0x7b51('0x5b')]][_0x7b51('0x21')]=0x2;queues[_0x3b9b44['transfertargetuniqueid']]['calleridnum']=queues[_0x3b9b44[_0x7b51('0x51')]]['calleridnum'];queues[_0x3b9b44[_0x7b51('0x5b')]][_0x7b51('0x5c')]=queues[_0x3b9b44[_0x7b51('0x51')]][_0x7b51('0x5c')];queues[_0x3b9b44[_0x7b51('0x5b')]][_0x7b51('0x5d')]=utils[_0x7b51('0x15')]();queues[_0x3b9b44[_0x7b51('0x5b')]][_0x7b51('0x37')]=utils['now']();queues[_0x3b9b44[_0x7b51('0x5b')]][_0x7b51('0x38')]=0x0;queues[_0x3b9b44['transfertargetuniqueid']][_0x7b51('0x63')]=0x0;utils[_0x7b51('0x11')](util['format'](_0x7b51('0x64'),_0x3b9b44[_0x7b51('0x50')],queues[_0x3b9b44[_0x7b51('0x5b')]][_0x7b51('0x1f')],queues[_0x3b9b44[_0x7b51('0x5b')]]['transfereduniqueid'],queues[_0x3b9b44[_0x7b51('0x5b')]]['calleridnum'],queues[_0x3b9b44[_0x7b51('0x5b')]][_0x7b51('0x5c')]));}else{utils['info'](util[_0x7b51('0x2')](_0x7b51('0x5f'),_0x3b9b44[_0x7b51('0x50')],queues[_0x3b9b44['secondtransfererlinkedid']][_0x7b51('0x1f')],_0x3b9b44[_0x7b51('0x51')]));queues[_0x3b9b44[_0x7b51('0x52')]][_0x7b51('0xd')]=_0x3b9b44[_0x7b51('0x51')];}}}}catch(_0x589506){utils[_0x7b51('0x16')](util['format']('[%s][queues][attendedtransfer]',_0x3b9b44['origtransfereruniqueid']),_0x589506);}};exports[_0x7b51('0x65')]=function(_0x34e44e){try{if(!_[_0x7b51('0x18')](queues[_0x34e44e[_0x7b51('0x3')]])){utils['debug'](util[_0x7b51('0x2')](_0x7b51('0x66'),_0x34e44e['uniqueid']),_0x34e44e);queues[_0x34e44e['uniqueid']]['musiconholdstartAt']=utils[_0x7b51('0x15')]();utils[_0x7b51('0x11')](util['format'](_0x7b51('0x67'),_0x34e44e[_0x7b51('0x3')],queues[_0x34e44e['uniqueid']][_0x7b51('0x1f')],queues[_0x34e44e[_0x7b51('0x3')]][_0x7b51('0x68')]));}}catch(_0x3e1b6d){utils['error'](util[_0x7b51('0x2')]('[%s][queues][musiconholdstart]',_0x34e44e[_0x7b51('0x3')]),_0x3e1b6d);}};exports[_0x7b51('0x69')]=function(_0xa4d44a){try{if(!_[_0x7b51('0x18')](queues[_0xa4d44a['uniqueid']])){if(!_[_0x7b51('0x18')](queues[_0xa4d44a[_0x7b51('0x3')]]['musiconholdstartAt'])){utils['debug'](util[_0x7b51('0x2')]('[%s][queues][musiconholdstop]',_0xa4d44a['uniqueid']),_0xa4d44a);queues[_0xa4d44a['uniqueid']][_0x7b51('0x63')]+=utils[_0x7b51('0x39')](utils[_0x7b51('0x15')](),queues[_0xa4d44a[_0x7b51('0x3')]][_0x7b51('0x68')]);utils['info'](util[_0x7b51('0x2')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0xa4d44a[_0x7b51('0x3')],queues[_0xa4d44a[_0x7b51('0x3')]][_0x7b51('0x1f')],queues[_0xa4d44a['uniqueid']][_0x7b51('0x63')]));delete queues[_0xa4d44a[_0x7b51('0x3')]][_0x7b51('0x68')];}}}catch(_0x726670){utils['error'](util[_0x7b51('0x2')](_0x7b51('0x6a'),_0xa4d44a[_0x7b51('0x3')]),_0x726670);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index c548f75..70a2b97 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 _0xbbea=['newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','accountcode','then','membername','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','variable','mixmonitor_filename','[%s][recordings][varset]','value','.wav49','.WAV','monitors','hangup','[%s][recordings][hangup]','cause-txt','calleridnum','calleridname','connectedlinenum','connectedlinename','outbound','forEach','clone'];(function(_0x35c5a8,_0x8ecb48){var _0x34782c=function(_0x1b23ec){while(--_0x1b23ec){_0x35c5a8['push'](_0x35c5a8['shift']());}};_0x34782c(++_0x8ecb48);}(_0xbbea,0x1ad));var _0xabbe=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xbbea[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xabbe('0x0'));var util=require(_0xabbe('0x1'));var utils=require(_0xabbe('0x2'));var transfers=require(_0xabbe('0x3'));var recordings={};function writeDB(_0x1b7fe2){var _0x16b17;utils[_0xabbe('0x4')](util[_0xabbe('0x5')](_0xabbe('0x6'),_0x1b7fe2[_0xabbe('0x7')]));if(transfers[_0xabbe('0x8')][_0x1b7fe2[_0xabbe('0x7')]]){_0x16b17=_0x1b7fe2[_0xabbe('0x7')];_0x1b7fe2[_0xabbe('0x7')]=transfers[_0xabbe('0x8')][_0x1b7fe2['uniqueid']]['transfereeuniqueid'];}if(_0x1b7fe2[_0xabbe('0x9')]){utils['getUserByInternal'](_0x1b7fe2[_0xabbe('0x9')])[_0xabbe('0xa')](function(_0x123ec5){if(_0x123ec5){_0x1b7fe2[_0xabbe('0xb')]=_0x123ec5['name'];_0x1b7fe2['UserId']=_0x123ec5['id'];}utils[_0xabbe('0xc')]('CreateVoiceRecording',_0x1b7fe2);});}else{utils[_0xabbe('0xc')](_0xabbe('0xd'),_0x1b7fe2);}if(_0x16b17)delete transfers[_0xabbe('0x8')][_0x16b17];}exports[_0xabbe('0xe')]=function(_0x172245){try{utils[_0xabbe('0xf')](util[_0xabbe('0x5')](_0xabbe('0x10'),_0x172245[_0xabbe('0x7')]),_0x172245);if(_0x172245[_0xabbe('0x7')]==_0x172245[_0xabbe('0x11')]){utils['info'](util[_0xabbe('0x5')](_0xabbe('0x12'),_0x172245[_0xabbe('0x7')],_0x172245[_0xabbe('0x13')],_0x172245[_0xabbe('0x14')]));recordings[_0x172245['uniqueid']]={'uniqueid':_0x172245[_0xabbe('0x7')],'accountcode':_0x172245[_0xabbe('0x9')],'exten':_0x172245[_0xabbe('0x14')],'context':_0x172245['context'],'channel':_0x172245[_0xabbe('0x15')],'monitors':[]};}}catch(_0x3c7fff){utils[_0xabbe('0x16')](util[_0xabbe('0x5')](_0xabbe('0x10'),_0x172245['uniqueid']),_0x3c7fff);}};exports[_0xabbe('0x17')]=function(_0xf6b15a){try{utils[_0xabbe('0xf')](util[_0xabbe('0x5')]('[%s][recordings][newstate]',_0xf6b15a[_0xabbe('0x7')]),_0xf6b15a);if(!_[_0xabbe('0x18')](recordings[_0xf6b15a[_0xabbe('0x7')]])&&_0xf6b15a[_0xabbe('0x19')]==0x6){utils['info'](util[_0xabbe('0x5')](_0xabbe('0x1a'),_0xf6b15a['uniqueid'],_0xf6b15a[_0xabbe('0x13')],_0xf6b15a['channel']));}else if(!_[_0xabbe('0x18')](recordings[_0xf6b15a[_0xabbe('0x11')]])&&_0xf6b15a['channelstate']==0x6&&_0xf6b15a['context']!=_0xabbe('0x1b')){utils[_0xabbe('0x4')](util[_0xabbe('0x5')](_0xabbe('0x1c'),_0xf6b15a[_0xabbe('0x7')],_0xf6b15a[_0xabbe('0x11')],_0xf6b15a[_0xabbe('0x13')],_0xf6b15a[_0xabbe('0x15')]));recordings[_0xf6b15a['linkedid']][_0xabbe('0x9')]=_0xf6b15a['accountcode'];}}catch(_0x11e7a2){utils[_0xabbe('0x16')](util[_0xabbe('0x5')](_0xabbe('0x1d'),_0xf6b15a[_0xabbe('0x7')]),_0x11e7a2);}};exports['varset']=function(_0x5217a8){try{if(!_[_0xabbe('0x18')](_0x5217a8[_0xabbe('0x1e')])&&!_[_0xabbe('0x18')](_0x5217a8[_0xabbe('0x1e')][_0xabbe('0x1f')])){utils[_0xabbe('0xf')](util[_0xabbe('0x5')](_0xabbe('0x20'),_0x5217a8[_0xabbe('0x7')]),_0x5217a8);utils[_0xabbe('0x4')](util[_0xabbe('0x5')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x5217a8[_0xabbe('0x7')],_0x5217a8[_0xabbe('0x1e')],_0x5217a8[_0xabbe('0x21')]));if(_['endsWith'](_0x5217a8[_0xabbe('0x21')],_0xabbe('0x22'))){_0x5217a8[_0xabbe('0x21')]=_0x5217a8['value']['replace'](_0xabbe('0x22'),_0xabbe('0x23'));}if(recordings[_0x5217a8[_0xabbe('0x11')]]){var _0x54ddc8=_['find'](recordings[_0x5217a8[_0xabbe('0x11')]][_0xabbe('0x24')],{'value':_0x5217a8['value']});if(_['isNil'](_0x54ddc8)){recordings[_0x5217a8['linkedid']][_0xabbe('0x24')]['push']({'value':_0x5217a8[_0xabbe('0x21')]});}}}}catch(_0x269ed3){utils[_0xabbe('0x16')](util[_0xabbe('0x5')](_0xabbe('0x20'),_0x5217a8['uniqueid']),_0x269ed3);}};exports[_0xabbe('0x25')]=function(_0x4f6543){try{if(!_[_0xabbe('0x18')](recordings[_0x4f6543[_0xabbe('0x7')]])){utils[_0xabbe('0xf')](util['format'](_0xabbe('0x26'),_0x4f6543[_0xabbe('0x7')]),_0x4f6543);utils[_0xabbe('0x4')](util[_0xabbe('0x5')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x4f6543[_0xabbe('0x7')],_0x4f6543['calleridnum'],_0x4f6543['calleridname'],_0x4f6543[_0xabbe('0x27')]));recordings[_0x4f6543[_0xabbe('0x7')]]['calleridnum']=_0x4f6543[_0xabbe('0x28')];recordings[_0x4f6543[_0xabbe('0x7')]][_0xabbe('0x29')]=_0x4f6543['calleridname'];recordings[_0x4f6543[_0xabbe('0x7')]][_0xabbe('0x2a')]=_0x4f6543[_0xabbe('0x2a')];recordings[_0x4f6543[_0xabbe('0x7')]]['connectedlinename']=_0x4f6543[_0xabbe('0x2b')];if(recordings[_0x4f6543['uniqueid']]['type']==_0xabbe('0x2c')&&recordings[_0x4f6543['uniqueid']][_0xabbe('0x9')]){recordings[_0x4f6543[_0xabbe('0x7')]]['connectedlinenum']=recordings[_0x4f6543[_0xabbe('0x7')]][_0xabbe('0x9')];recordings[_0x4f6543['uniqueid']][_0xabbe('0x2b')]='';}recordings[_0x4f6543[_0xabbe('0x7')]][_0xabbe('0x24')][_0xabbe('0x2d')](function(_0x299d9f){var _0x10c818=_[_0xabbe('0x2e')](recordings[_0x4f6543[_0xabbe('0x7')]]);_0x10c818['value']=_0x299d9f[_0xabbe('0x21')];writeDB(_0x10c818);});delete recordings[_0x4f6543[_0xabbe('0x7')]];}}catch(_0x203aa1){utils['error'](util[_0xabbe('0x5')](_0xabbe('0x26'),_0x4f6543[_0xabbe('0x7')]),_0x203aa1);}};exports[_0xabbe('0x2f')]=function(_0x40407e){try{if(!_[_0xabbe('0x18')](recordings[_0x40407e['uniqueid']])){utils['debug'](util[_0xabbe('0x5')](_0xabbe('0x30'),_0x40407e[_0xabbe('0x7')]),_0x40407e);utils[_0xabbe('0x4')](util[_0xabbe('0x5')](_0xabbe('0x31'),_0x40407e['uniqueid'],_0x40407e['application'],_0x40407e[_0xabbe('0x32')]));if(_0x40407e[_0xabbe('0x33')][_0xabbe('0x34')]()==_0xabbe('0x35')&&_[_0xabbe('0x36')](_0x40407e[_0xabbe('0x32')]['toLowerCase'](),'cdr')){var _0x30cb47=_0x40407e[_0xabbe('0x32')][_0xabbe('0x37')]('=');var _0x1d3980=_0x30cb47[0x0][_0xabbe('0x38')](_0x30cb47[0x0][_0xabbe('0x39')]('(')+0x1,_0x30cb47[0x0][_0xabbe('0x39')](')'));var _0x2b71ba=_0x30cb47[0x1];recordings[_0x40407e[_0xabbe('0x7')]][_0x1d3980]=_0x2b71ba;}}}catch(_0x3db0f7){utils['error'](util['format']('[%s][recordings][newexten]',_0x40407e[_0xabbe('0x7')]),_0x3db0f7);}};exports[_0xabbe('0x3a')]=function(_0x3cd280){try{if(!_[_0xabbe('0x18')](recordings[_0x3cd280[_0xabbe('0x7')]])){utils[_0xabbe('0xf')](util[_0xabbe('0x5')](_0xabbe('0x3b'),_0x3cd280[_0xabbe('0x7')]),_0x3cd280);utils['info'](util[_0xabbe('0x5')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x3cd280[_0xabbe('0x7')],_0x3cd280[_0xabbe('0x3c')]));recordings[_0x3cd280[_0xabbe('0x7')]]['queue']=_0x3cd280[_0xabbe('0x3c')];}}catch(_0x2b523b){utils[_0xabbe('0x16')](util[_0xabbe('0x5')]('[%s][recordings][queuecallerjoin]',_0x3cd280[_0xabbe('0x7')]),_0x2b523b);}};exports[_0xabbe('0x3d')]=function(_0x1a8d1a){try{utils[_0xabbe('0xf')](util[_0xabbe('0x5')](_0xabbe('0x3e'),_0x1a8d1a['uniqueid']),_0x1a8d1a);utils[_0xabbe('0x4')](util[_0xabbe('0x5')](_0xabbe('0x3f'),_0x1a8d1a[_0xabbe('0x7')],_0x1a8d1a['transferercalleridnum'],_0x1a8d1a[_0xabbe('0x40')],_0x1a8d1a['transfereecalleridnum'],_0x1a8d1a[_0xabbe('0x41')]));if(recordings[_0x1a8d1a['transfereruniqueid']]&&transfers[_0xabbe('0x8')][_0x1a8d1a[_0xabbe('0x42')]]){transfers[_0xabbe('0x8')][_0x1a8d1a[_0xabbe('0x42')]][_0xabbe('0x43')]=!![];}}catch(_0x34225a){utils[_0xabbe('0x16')](util[_0xabbe('0x5')](_0xabbe('0x3e'),_0x1a8d1a['uniqueid']),_0x34225a);}}; \ No newline at end of file +var _0x9431=['lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','util','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','name','UserId','request','CreateVoiceRecording','[%s][recordings][newchannel]','linkedid','context','exten','channel','error','newstate','debug','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','replace','.WAV','find','monitors','push','[%s][recordings][varset]','hangup','calleridnum','calleridname','cause-txt','connectedlinename','type','outbound','forEach','[%s][recordings][hangup]','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr','split','substring'];(function(_0x5a6720,_0x31a329){var _0x4065c9=function(_0x273874){while(--_0x273874){_0x5a6720['push'](_0x5a6720['shift']());}};_0x4065c9(++_0x31a329);}(_0x9431,0x16a));var _0x1943=function(_0x1a3c47,_0x1af5bd){_0x1a3c47=_0x1a3c47-0x0;var _0x4bb467=_0x9431[_0x1a3c47];return _0x4bb467;};'use strict';var _=require('lodash');var util=require(_0x1943('0x0'));var utils=require('./utils');var transfers=require(_0x1943('0x1'));var recordings={};function writeDB(_0x152c44){var _0x5975ae;utils[_0x1943('0x2')](util[_0x1943('0x3')](_0x1943('0x4'),_0x152c44[_0x1943('0x5')]));if(transfers[_0x1943('0x6')][_0x152c44['uniqueid']]){_0x5975ae=_0x152c44[_0x1943('0x5')];_0x152c44['uniqueid']=transfers[_0x1943('0x6')][_0x152c44[_0x1943('0x5')]][_0x1943('0x7')];}if(_0x152c44[_0x1943('0x8')]){utils[_0x1943('0x9')](_0x152c44['accountcode'])[_0x1943('0xa')](function(_0x3611ab){if(_0x3611ab){_0x152c44['membername']=_0x3611ab[_0x1943('0xb')];_0x152c44[_0x1943('0xc')]=_0x3611ab['id'];}utils[_0x1943('0xd')](_0x1943('0xe'),_0x152c44);});}else{utils['request']('CreateVoiceRecording',_0x152c44);}if(_0x5975ae)delete transfers[_0x1943('0x6')][_0x5975ae];}exports['newchannel']=function(_0x368b04){try{utils['debug'](util['format'](_0x1943('0xf'),_0x368b04[_0x1943('0x5')]),_0x368b04);if(_0x368b04[_0x1943('0x5')]==_0x368b04[_0x1943('0x10')]){utils[_0x1943('0x2')](util[_0x1943('0x3')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x368b04[_0x1943('0x5')],_0x368b04[_0x1943('0x11')],_0x368b04['exten']));recordings[_0x368b04['uniqueid']]={'uniqueid':_0x368b04[_0x1943('0x5')],'accountcode':_0x368b04['accountcode'],'exten':_0x368b04[_0x1943('0x12')],'context':_0x368b04['context'],'channel':_0x368b04[_0x1943('0x13')],'monitors':[]};}}catch(_0x772dfe){utils[_0x1943('0x14')](util[_0x1943('0x3')](_0x1943('0xf'),_0x368b04[_0x1943('0x5')]),_0x772dfe);}};exports[_0x1943('0x15')]=function(_0x2c74c1){try{utils[_0x1943('0x16')](util[_0x1943('0x3')](_0x1943('0x17'),_0x2c74c1[_0x1943('0x5')]),_0x2c74c1);if(!_[_0x1943('0x18')](recordings[_0x2c74c1['uniqueid']])&&_0x2c74c1['channelstate']==0x6){utils[_0x1943('0x2')](util[_0x1943('0x3')](_0x1943('0x19'),_0x2c74c1['uniqueid'],_0x2c74c1[_0x1943('0x11')],_0x2c74c1['channel']));}else if(!_['isNil'](recordings[_0x2c74c1[_0x1943('0x10')]])&&_0x2c74c1['channelstate']==0x6&&_0x2c74c1['context']!=_0x1943('0x1a')){utils['info'](util[_0x1943('0x3')](_0x1943('0x1b'),_0x2c74c1[_0x1943('0x5')],_0x2c74c1[_0x1943('0x10')],_0x2c74c1['context'],_0x2c74c1[_0x1943('0x13')]));recordings[_0x2c74c1['linkedid']][_0x1943('0x8')]=_0x2c74c1[_0x1943('0x8')];}}catch(_0x2f853c){utils[_0x1943('0x14')](util[_0x1943('0x3')](_0x1943('0x17'),_0x2c74c1[_0x1943('0x5')]),_0x2f853c);}};exports['varset']=function(_0x3f36dc){try{if(!_[_0x1943('0x18')](_0x3f36dc['variable'])&&!_[_0x1943('0x18')](_0x3f36dc[_0x1943('0x1c')][_0x1943('0x1d')])){utils['debug'](util[_0x1943('0x3')]('[%s][recordings][varset]',_0x3f36dc['uniqueid']),_0x3f36dc);utils[_0x1943('0x2')](util['format'](_0x1943('0x1e'),_0x3f36dc[_0x1943('0x5')],_0x3f36dc[_0x1943('0x1c')],_0x3f36dc[_0x1943('0x1f')]));if(_[_0x1943('0x20')](_0x3f36dc[_0x1943('0x1f')],'.wav49')){_0x3f36dc[_0x1943('0x1f')]=_0x3f36dc[_0x1943('0x1f')][_0x1943('0x21')]('.wav49',_0x1943('0x22'));}if(recordings[_0x3f36dc[_0x1943('0x10')]]){var _0x13a279=_[_0x1943('0x23')](recordings[_0x3f36dc[_0x1943('0x10')]]['monitors'],{'value':_0x3f36dc[_0x1943('0x1f')]});if(_['isNil'](_0x13a279)){recordings[_0x3f36dc['linkedid']][_0x1943('0x24')][_0x1943('0x25')]({'value':_0x3f36dc[_0x1943('0x1f')]});}}}}catch(_0xdbf0b4){utils['error'](util['format'](_0x1943('0x26'),_0x3f36dc[_0x1943('0x5')]),_0xdbf0b4);}};exports[_0x1943('0x27')]=function(_0x4e8422){try{if(!_[_0x1943('0x18')](recordings[_0x4e8422[_0x1943('0x5')]])){utils[_0x1943('0x16')](util[_0x1943('0x3')]('[%s][recordings][hangup]',_0x4e8422[_0x1943('0x5')]),_0x4e8422);utils['info'](util[_0x1943('0x3')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x4e8422['uniqueid'],_0x4e8422[_0x1943('0x28')],_0x4e8422[_0x1943('0x29')],_0x4e8422[_0x1943('0x2a')]));recordings[_0x4e8422[_0x1943('0x5')]][_0x1943('0x28')]=_0x4e8422['calleridnum'];recordings[_0x4e8422[_0x1943('0x5')]][_0x1943('0x29')]=_0x4e8422[_0x1943('0x29')];recordings[_0x4e8422[_0x1943('0x5')]]['connectedlinenum']=_0x4e8422['connectedlinenum'];recordings[_0x4e8422[_0x1943('0x5')]][_0x1943('0x2b')]=_0x4e8422[_0x1943('0x2b')];if(recordings[_0x4e8422[_0x1943('0x5')]][_0x1943('0x2c')]==_0x1943('0x2d')&&recordings[_0x4e8422['uniqueid']][_0x1943('0x8')]){recordings[_0x4e8422[_0x1943('0x5')]]['connectedlinenum']=recordings[_0x4e8422[_0x1943('0x5')]][_0x1943('0x8')];recordings[_0x4e8422[_0x1943('0x5')]]['connectedlinename']='';}recordings[_0x4e8422[_0x1943('0x5')]][_0x1943('0x24')][_0x1943('0x2e')](function(_0xa9108a){var _0x7e2fe4=_['clone'](recordings[_0x4e8422['uniqueid']]);_0x7e2fe4[_0x1943('0x1f')]=_0xa9108a[_0x1943('0x1f')];writeDB(_0x7e2fe4);});delete recordings[_0x4e8422[_0x1943('0x5')]];}}catch(_0x20c590){utils['error'](util[_0x1943('0x3')](_0x1943('0x2f'),_0x4e8422[_0x1943('0x5')]),_0x20c590);}};exports['newexten']=function(_0x920cfb){try{if(!_[_0x1943('0x18')](recordings[_0x920cfb[_0x1943('0x5')]])){utils[_0x1943('0x16')](util[_0x1943('0x3')](_0x1943('0x30'),_0x920cfb[_0x1943('0x5')]),_0x920cfb);utils['info'](util[_0x1943('0x3')](_0x1943('0x31'),_0x920cfb[_0x1943('0x5')],_0x920cfb[_0x1943('0x32')],_0x920cfb['appdata']));if(_0x920cfb[_0x1943('0x32')][_0x1943('0x33')]()==_0x1943('0x34')&&_[_0x1943('0x35')](_0x920cfb[_0x1943('0x36')][_0x1943('0x33')](),_0x1943('0x37'))){var _0x84a5c=_0x920cfb[_0x1943('0x36')][_0x1943('0x38')]('=');var _0x4db834=_0x84a5c[0x0][_0x1943('0x39')](_0x84a5c[0x0][_0x1943('0x3a')]('(')+0x1,_0x84a5c[0x0]['lastIndexOf'](')'));var _0xd0f4c3=_0x84a5c[0x1];recordings[_0x920cfb['uniqueid']][_0x4db834]=_0xd0f4c3;}}}catch(_0x5bc3ca){utils[_0x1943('0x14')](util[_0x1943('0x3')](_0x1943('0x30'),_0x920cfb[_0x1943('0x5')]),_0x5bc3ca);}};exports[_0x1943('0x3b')]=function(_0x4c7304){try{if(!_['isNil'](recordings[_0x4c7304[_0x1943('0x5')]])){utils[_0x1943('0x16')](util[_0x1943('0x3')](_0x1943('0x3c'),_0x4c7304['uniqueid']),_0x4c7304);utils[_0x1943('0x2')](util[_0x1943('0x3')](_0x1943('0x3d'),_0x4c7304[_0x1943('0x5')],_0x4c7304['queue']));recordings[_0x4c7304[_0x1943('0x5')]][_0x1943('0x3e')]=_0x4c7304['queue'];}}catch(_0xf4f61f){utils['error'](util[_0x1943('0x3')](_0x1943('0x3c'),_0x4c7304[_0x1943('0x5')]),_0xf4f61f);}};exports['blindtransfer']=function(_0xaac72f){try{utils[_0x1943('0x16')](util[_0x1943('0x3')](_0x1943('0x3f'),_0xaac72f[_0x1943('0x5')]),_0xaac72f);utils[_0x1943('0x2')](util['format']('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0xaac72f[_0x1943('0x5')],_0xaac72f[_0x1943('0x40')],_0xaac72f[_0x1943('0x41')],_0xaac72f[_0x1943('0x42')],_0xaac72f[_0x1943('0x43')]));if(recordings[_0xaac72f[_0x1943('0x44')]]&&transfers['blinds'][_0xaac72f[_0x1943('0x44')]]){transfers['blinds'][_0xaac72f[_0x1943('0x44')]][_0x1943('0x45')]=!![];}}catch(_0x2ff4cb){utils[_0x1943('0x14')](util[_0x1943('0x3')](_0x1943('0x3f'),_0xaac72f[_0x1943('0x5')]),_0x2ff4cb);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 5142c94..571c2a5 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 _0xb15e=['format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','blinds','blindtransfer','debug','transferercalleridname','transfereecalleridnum','blind','transfereruniqueid','error','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetaccountcode','transfertargetlinkedid','util','info'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb15e,0x1ba));var _0xeb15=function(_0x1b08e9,_0x38f022){_0x1b08e9=_0x1b08e9-0x0;var _0x3cd67b=_0xb15e[_0x1b08e9];return _0x3cd67b;};'use strict';var _=require('lodash');var util=require(_0xeb15('0x0'));var utils=require('./utils');function writeDB(_0x4ec6de){utils[_0xeb15('0x1')](util[_0xeb15('0x2')](_0xeb15('0x3'),_0x4ec6de[_0xeb15('0x4')]===_0xeb15('0x5')?_0x4ec6de[_0xeb15('0x6')]:_0x4ec6de[_0xeb15('0x7')],_0x4ec6de['type']));utils[_0xeb15('0x8')]('CreateVoiceTransferReport',_0x4ec6de);}exports[_0xeb15('0x9')]={};exports[_0xeb15('0xa')]=function(_0x17f4e6){try{utils[_0xeb15('0xb')](util[_0xeb15('0x2')]('[%s][transfers][blindtransfer]',_0x17f4e6[_0xeb15('0x7')]),_0x17f4e6);utils[_0xeb15('0x1')](util[_0xeb15('0x2')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x17f4e6[_0xeb15('0x7')],_0x17f4e6['transferercalleridnum'],_0x17f4e6[_0xeb15('0xc')],_0x17f4e6[_0xeb15('0xd')],_0x17f4e6['transfereecalleridname']));_0x17f4e6['type']=_0xeb15('0xe');exports[_0xeb15('0x9')][_0x17f4e6[_0xeb15('0xf')]]=_0x17f4e6;writeDB(_0x17f4e6);}catch(_0x37595e){utils[_0xeb15('0x10')](util[_0xeb15('0x2')](_0xeb15('0x11'),_0x17f4e6[_0xeb15('0x7')]),_0x37595e);}};exports[_0xeb15('0x12')]=function(_0x537ba8){try{utils[_0xeb15('0xb')](util['format'](_0xeb15('0x13'),_0x537ba8[_0xeb15('0x6')]),_0x537ba8);utils[_0xeb15('0x1')](util[_0xeb15('0x2')](_0xeb15('0x14'),_0x537ba8['origtransfereruniqueid'],_0x537ba8[_0xeb15('0x15')],_0x537ba8[_0xeb15('0x16')],_0x537ba8[_0xeb15('0x17')],_0x537ba8[_0xeb15('0x18')]));_0x537ba8=_[_0xeb15('0x19')](_0x537ba8,{'transfererchannel':_0x537ba8[_0xeb15('0x1a')],'transferercalleridnum':_0x537ba8['origtransferercalleridnum'],'transferercalleridname':_0x537ba8[_0xeb15('0x16')],'transfererconnectedlinenum':_0x537ba8['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x537ba8['secondtransfererconnectedlinename'],'transfereraccountcode':_0x537ba8[_0xeb15('0x1b')],'transferercontext':_0x537ba8['secondtransferercontext'],'transfererexten':_0x537ba8[_0xeb15('0x1c')],'transfererlinkedid':_0x537ba8[_0xeb15('0x1d')],'context':_0x537ba8[_0xeb15('0x1e')],'extension':_0x537ba8[_0xeb15('0x1f')],'type':_0xeb15('0x5')});if(_[_0xeb15('0x20')](_0x537ba8[_0xeb15('0x21')])){_0x537ba8=_[_0xeb15('0x19')](_0x537ba8,{'transfereechannel':_0x537ba8[_0xeb15('0x22')],'transfereecalleridnum':_0x537ba8['transfertargetcalleridnum'],'transfereecalleridname':_0x537ba8['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x537ba8['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x537ba8['transfertargetconnectedlinename'],'transfereeaccountcode':_0x537ba8[_0xeb15('0x23')],'transfereecontext':_0x537ba8['transfertargetcontext'],'transfereeexten':_0x537ba8['transfertargetexten'],'transfereelinkedid':_0x537ba8[_0xeb15('0x24')]});}writeDB(_0x537ba8);}catch(_0x1fa254){utils[_0xeb15('0x10')](util[_0xeb15('0x2')](_0xeb15('0x13'),_0x537ba8['origtransfereruniqueid']),_0x1fa254);}}; \ No newline at end of file +var _0xbf3d=['origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','blind','transfereruniqueid','error','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s'];(function(_0x39e85a,_0x1cd71c){var _0x5a7457=function(_0x4a9ba4){while(--_0x4a9ba4){_0x39e85a['push'](_0x39e85a['shift']());}};_0x5a7457(++_0x1cd71c);}(_0xbf3d,0xfa));var _0xdbf3=function(_0x330634,_0x51c09c){_0x330634=_0x330634-0x0;var _0x479f3e=_0xbf3d[_0x330634];return _0x479f3e;};'use strict';var _=require(_0xdbf3('0x0'));var util=require(_0xdbf3('0x1'));var utils=require(_0xdbf3('0x2'));function writeDB(_0x9d3f23){utils[_0xdbf3('0x3')](util[_0xdbf3('0x4')](_0xdbf3('0x5'),_0x9d3f23[_0xdbf3('0x6')]===_0xdbf3('0x7')?_0x9d3f23[_0xdbf3('0x8')]:_0x9d3f23['uniqueid'],_0x9d3f23[_0xdbf3('0x6')]));utils[_0xdbf3('0x9')](_0xdbf3('0xa'),_0x9d3f23);}exports[_0xdbf3('0xb')]={};exports[_0xdbf3('0xc')]=function(_0x24f9c5){try{utils[_0xdbf3('0xd')](util[_0xdbf3('0x4')]('[%s][transfers][blindtransfer]',_0x24f9c5[_0xdbf3('0xe')]),_0x24f9c5);utils[_0xdbf3('0x3')](util[_0xdbf3('0x4')](_0xdbf3('0xf'),_0x24f9c5[_0xdbf3('0xe')],_0x24f9c5[_0xdbf3('0x10')],_0x24f9c5[_0xdbf3('0x11')],_0x24f9c5['transfereecalleridnum'],_0x24f9c5[_0xdbf3('0x12')]));_0x24f9c5[_0xdbf3('0x6')]=_0xdbf3('0x13');exports[_0xdbf3('0xb')][_0x24f9c5[_0xdbf3('0x14')]]=_0x24f9c5;writeDB(_0x24f9c5);}catch(_0x368549){utils[_0xdbf3('0x15')](util['format'](_0xdbf3('0x16'),_0x24f9c5[_0xdbf3('0xe')]),_0x368549);}};exports[_0xdbf3('0x17')]=function(_0xa584fd){try{utils[_0xdbf3('0xd')](util[_0xdbf3('0x4')](_0xdbf3('0x18'),_0xa584fd[_0xdbf3('0x8')]),_0xa584fd);utils[_0xdbf3('0x3')](util[_0xdbf3('0x4')](_0xdbf3('0x19'),_0xa584fd[_0xdbf3('0x8')],_0xa584fd[_0xdbf3('0x1a')],_0xa584fd[_0xdbf3('0x1b')],_0xa584fd[_0xdbf3('0x1c')],_0xa584fd[_0xdbf3('0x1d')]));_0xa584fd=_['assign'](_0xa584fd,{'transfererchannel':_0xa584fd[_0xdbf3('0x1e')],'transferercalleridnum':_0xa584fd[_0xdbf3('0x1a')],'transferercalleridname':_0xa584fd[_0xdbf3('0x1b')],'transfererconnectedlinenum':_0xa584fd[_0xdbf3('0x1f')],'transfererconnectedlinename':_0xa584fd[_0xdbf3('0x20')],'transfereraccountcode':_0xa584fd[_0xdbf3('0x21')],'transferercontext':_0xa584fd[_0xdbf3('0x22')],'transfererexten':_0xa584fd[_0xdbf3('0x23')],'transfererlinkedid':_0xa584fd[_0xdbf3('0x24')],'context':_0xa584fd[_0xdbf3('0x25')],'extension':_0xa584fd[_0xdbf3('0x26')],'type':_0xdbf3('0x7')});if(_[_0xdbf3('0x27')](_0xa584fd[_0xdbf3('0x28')])){_0xa584fd=_['assign'](_0xa584fd,{'transfereechannel':_0xa584fd['transfertargetchannel'],'transfereecalleridnum':_0xa584fd[_0xdbf3('0x1c')],'transfereecalleridname':_0xa584fd[_0xdbf3('0x1d')],'transfereeconnectedlinenum':_0xa584fd[_0xdbf3('0x29')],'transfereeconnectedlinename':_0xa584fd['transfertargetconnectedlinename'],'transfereeaccountcode':_0xa584fd[_0xdbf3('0x2a')],'transfereecontext':_0xa584fd[_0xdbf3('0x2b')],'transfereeexten':_0xa584fd[_0xdbf3('0x2c')],'transfereelinkedid':_0xa584fd[_0xdbf3('0x2d')]});}writeDB(_0xa584fd);}catch(_0x5eb1ae){utils[_0xdbf3('0x15')](util['format'](_0xdbf3('0x18'),_0xa584fd['origtransfereruniqueid']),_0x5eb1ae);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 9393f17..9bca9c9 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 _0x34c0=['now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','internal','interface','[utils][getUser]\x20where:%s','stringify','length','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','name','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','result','[utils][getVoiceQueueByName]','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','seconds','diffTime','diff'];(function(_0x12c076,_0x5bef17){var _0x2ddd18=function(_0x436336){while(--_0x436336){_0x12c076['push'](_0x12c076['shift']());}};_0x2ddd18(++_0x5bef17);}(_0x34c0,0x96));var _0x034c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x34c0[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require(_0x034c('0x0'));var jayson=require(_0x034c('0x1'));var moment=require(_0x034c('0x2'));var util=require(_0x034c('0x3'));var client=jayson[_0x034c('0x4')]['http']({'port':0x2329});var logger=require(_0x034c('0x5'))(_0x034c('0x6'));exports[_0x034c('0x7')]=function(_0x2784af,_0x11cd95){logger['info'](_0x2784af,_0x11cd95?util[_0x034c('0x8')](_0x11cd95,{'showHidden':![],'depth':null}):'');};exports[_0x034c('0x9')]=function(_0x410e65,_0x4e0065){logger['debug'](_0x410e65,_0x4e0065?util[_0x034c('0x8')](_0x4e0065,{'showHidden':![],'depth':null}):'');};exports[_0x034c('0xa')]=function(_0x4cc074,_0x240ed9){logger[_0x034c('0xa')](_0x4cc074,_0x240ed9?util[_0x034c('0x8')](_0x240ed9,{'showHidden':![],'depth':null}):'');};exports[_0x034c('0xb')]=function(_0x5f5950,_0x591f69){return client['request'](_0x5f5950,{'body':_0x591f69})[_0x034c('0xc')](function(_0x37d0cf){logger[_0x034c('0x9')](_0x034c('0xd'),_0x5f5950,_0x37d0cf?util[_0x034c('0x8')](_0x37d0cf,{'showHidden':![],'depth':null}):'');})[_0x034c('0xe')](function(_0x223af9){logger[_0x034c('0xa')](_0x034c('0xd'),_0x5f5950,_0x223af9?util[_0x034c('0x8')](_0x223af9,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1a5f5b){return client[_0x034c('0xb')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x034c('0xf'),'name',_0x034c('0x10')],'where':_0x1a5f5b,'limit':0x1}})[_0x034c('0xc')](function(_0x2e9ef4){logger[_0x034c('0x9')](_0x034c('0x11'),JSON[_0x034c('0x12')](_0x1a5f5b),_0x2e9ef4?util[_0x034c('0x8')](_0x2e9ef4,{'showHidden':![],'depth':null}):'');return _0x2e9ef4['result'][_0x034c('0x13')]?_0x2e9ef4['result'][0x0]:null;});}exports['getUserByInternal']=function(_0x44962c){return new BPromise(function(_0x1b9b48,_0x2b1bde){if(_0x44962c){return getUser({'internal':_0x44962c})[_0x034c('0xc')](function(_0x4e9d75){logger[_0x034c('0x7')](_0x034c('0x14'),_0x44962c,_0x4e9d75?_0x034c('0x15'):_0x034c('0x16'));return _0x1b9b48(_0x4e9d75);})[_0x034c('0xe')](function(_0x5effb4){logger['error']('[utils][getUserByInternal]',_0x5effb4?util[_0x034c('0x8')](_0x5effb4,{'showHidden':![],'depth':null}):'');return _0x1b9b48(null);});}return _0x1b9b48(null);});};exports[_0x034c('0x17')]=function(_0x43ef21){return new BPromise(function(_0x5e5109,_0x198e74){if(_0x43ef21){return getUser({'interface':_0x43ef21})['then'](function(_0x2fe037){logger[_0x034c('0x7')](_0x034c('0x18'),_0x43ef21,_0x2fe037?_0x034c('0x15'):_0x034c('0x16'));return _0x5e5109(_0x2fe037);})[_0x034c('0xe')](function(_0x3062c7){logger[_0x034c('0xa')](_0x034c('0x19'),_0x3062c7?util[_0x034c('0x8')](_0x3062c7,{'showHidden':![],'depth':null}):'');return _0x5e5109(null);});}return _0x5e5109(null);});};exports[_0x034c('0x1a')]=function(_0x23eb3c){return new BPromise(function(_0x3ce7b5,_0x1d433b){if(_0x23eb3c){return getUser({'name':_0x23eb3c})['then'](function(_0x149664){logger[_0x034c('0x7')](_0x034c('0x1b'),_0x23eb3c,_0x149664?'found':_0x034c('0x16'));return _0x3ce7b5(_0x149664);})[_0x034c('0xe')](function(_0x148007){logger['error'](_0x034c('0x1c'),_0x148007?util['inspect'](_0x148007,{'showHidden':![],'depth':null}):'');return _0x3ce7b5(null);});}return _0x3ce7b5(null);});};exports[_0x034c('0x1d')]=function(_0x143f92){return new BPromise(function(_0x2e3965,_0x149bd2){if(_0x143f92){return client['request'](_0x034c('0x1e'),{'options':{'raw':!![],'attributes':['id',_0x034c('0x1f'),_0x034c('0x20'),_0x034c('0x21'),_0x034c('0x22')],'where':{'name':_0x143f92},'limit':0x1}})[_0x034c('0xc')](function(_0x6f47b2){logger['debug'](_0x034c('0x23'),_0x143f92,_0x6f47b2?util[_0x034c('0x8')](_0x6f47b2,{'showHidden':![],'depth':null}):'');logger[_0x034c('0x7')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x143f92,_0x6f47b2?'found':_0x034c('0x16'));return _0x2e3965(_0x6f47b2[_0x034c('0x24')][_0x034c('0x13')]?_0x6f47b2[_0x034c('0x24')][0x0]:null);})[_0x034c('0xe')](function(_0x171156){logger[_0x034c('0xa')](_0x034c('0x25'),_0x171156?util[_0x034c('0x8')](_0x171156,{'showHidden':![],'depth':null}):'');return _0x2e3965(null);});}return _0x2e3965(null);});};exports[_0x034c('0x26')]=function(_0x171532,_0x373769){return moment(_0x171532)[_0x034c('0x27')](_0x373769,'seconds')[_0x034c('0x28')](_0x034c('0x29'));};exports[_0x034c('0x2a')]=function(_0x190f46,_0x26eb64){return moment(_0x190f46)['subtract'](_0x26eb64,_0x034c('0x2b'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x034c('0x2c')]=function(_0xcca56a,_0x5ee619){return moment(_0xcca56a)[_0x034c('0x2d')](moment(_0x5ee619),_0x034c('0x2b'));};exports['sumTime']=function(_0x1f6013,_0x53ab8d){return parseInt(_0x1f6013,0xa)+parseInt(_0x53ab8d,0xa);};exports[_0x034c('0x2e')]=function(){return moment()[_0x034c('0x28')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x034c('0x2f')]=function(_0x25e275,_0x229d6e){if(_0x229d6e){return moment(_0x25e275)[_0x034c('0x2f')](_0x229d6e);}return!![];};exports[_0x034c('0x30')]=function(_0x34e077,_0xfa8ed0){if(_0xfa8ed0){return moment(_0x34e077)[_0x034c('0x30')](_0xfa8ed0);}else if(_0x34e077){return!![];}return![];}; \ No newline at end of file +var _0xcfbf=['diffTime','diff','seconds','sumTime','now','isAfter','isBefore','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','found','length','addTime','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract'];(function(_0x620627,_0x1e3682){var _0x4ca056=function(_0x47d7a1){while(--_0x47d7a1){_0x620627['push'](_0x620627['shift']());}};_0x4ca056(++_0x1e3682);}(_0xcfbf,0x1f1));var _0xfcfb=function(_0xef284a,_0xf6fe93){_0xef284a=_0xef284a-0x0;var _0x20ced3=_0xcfbf[_0xef284a];return _0x20ced3;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xfcfb('0x0'));var moment=require(_0xfcfb('0x1'));var util=require(_0xfcfb('0x2'));var client=jayson[_0xfcfb('0x3')][_0xfcfb('0x4')]({'port':0x2329});var logger=require(_0xfcfb('0x5'))(_0xfcfb('0x6'));exports[_0xfcfb('0x7')]=function(_0x4c56ff,_0xf2ed04){logger['info'](_0x4c56ff,_0xf2ed04?util['inspect'](_0xf2ed04,{'showHidden':![],'depth':null}):'');};exports[_0xfcfb('0x8')]=function(_0x311d4d,_0x4159a6){logger['debug'](_0x311d4d,_0x4159a6?util[_0xfcfb('0x9')](_0x4159a6,{'showHidden':![],'depth':null}):'');};exports[_0xfcfb('0xa')]=function(_0x268336,_0x38b9a5){logger[_0xfcfb('0xa')](_0x268336,_0x38b9a5?util[_0xfcfb('0x9')](_0x38b9a5,{'showHidden':![],'depth':null}):'');};exports[_0xfcfb('0xb')]=function(_0x2aa931,_0x2c277a){return client[_0xfcfb('0xb')](_0x2aa931,{'body':_0x2c277a})[_0xfcfb('0xc')](function(_0x43ba25){logger[_0xfcfb('0x8')](_0xfcfb('0xd'),_0x2aa931,_0x43ba25?util[_0xfcfb('0x9')](_0x43ba25,{'showHidden':![],'depth':null}):'');})[_0xfcfb('0xe')](function(_0x2619dd){logger[_0xfcfb('0xa')]('[utils][request]\x20name:%s',_0x2aa931,_0x2619dd?util[_0xfcfb('0x9')](_0x2619dd,{'showHidden':![],'depth':null}):'');});};function getUser(_0x4f096d){return client[_0xfcfb('0xb')](_0xfcfb('0xf'),{'options':{'raw':!![],'attributes':['id',_0xfcfb('0x10'),_0xfcfb('0x11'),_0xfcfb('0x12')],'where':_0x4f096d,'limit':0x1}})[_0xfcfb('0xc')](function(_0x5e5d27){logger[_0xfcfb('0x8')](_0xfcfb('0x13'),JSON[_0xfcfb('0x14')](_0x4f096d),_0x5e5d27?util[_0xfcfb('0x9')](_0x5e5d27,{'showHidden':![],'depth':null}):'');return _0x5e5d27[_0xfcfb('0x15')]['length']?_0x5e5d27[_0xfcfb('0x15')][0x0]:null;});}exports[_0xfcfb('0x16')]=function(_0x2119e3){return new BPromise(function(_0x12c50d,_0x318b03){if(_0x2119e3){return getUser({'internal':_0x2119e3})[_0xfcfb('0xc')](function(_0x10e68e){logger['info']('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x2119e3,_0x10e68e?'found':_0xfcfb('0x17'));return _0x12c50d(_0x10e68e);})[_0xfcfb('0xe')](function(_0x12023d){logger[_0xfcfb('0xa')](_0xfcfb('0x18'),_0x12023d?util[_0xfcfb('0x9')](_0x12023d,{'showHidden':![],'depth':null}):'');return _0x12c50d(null);});}return _0x12c50d(null);});};exports['getUserByInterface']=function(_0x568d36){return new BPromise(function(_0x1d94eb,_0xfe2da6){if(_0x568d36){return getUser({'interface':_0x568d36})[_0xfcfb('0xc')](function(_0x9e62f9){logger['info']('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x568d36,_0x9e62f9?'found':_0xfcfb('0x17'));return _0x1d94eb(_0x9e62f9);})[_0xfcfb('0xe')](function(_0x3b4c88){logger['error'](_0xfcfb('0x19'),_0x3b4c88?util['inspect'](_0x3b4c88,{'showHidden':![],'depth':null}):'');return _0x1d94eb(null);});}return _0x1d94eb(null);});};exports[_0xfcfb('0x1a')]=function(_0x119c78){return new BPromise(function(_0x2bc43b,_0x3bdd88){if(_0x119c78){return getUser({'name':_0x119c78})['then'](function(_0x38aae4){logger['info'](_0xfcfb('0x1b'),_0x119c78,_0x38aae4?'found':_0xfcfb('0x17'));return _0x2bc43b(_0x38aae4);})['catch'](function(_0x3fdfde){logger[_0xfcfb('0xa')](_0xfcfb('0x1c'),_0x3fdfde?util[_0xfcfb('0x9')](_0x3fdfde,{'showHidden':![],'depth':null}):'');return _0x2bc43b(null);});}return _0x2bc43b(null);});};exports[_0xfcfb('0x1d')]=function(_0x13302b){return new BPromise(function(_0x5ff1eb,_0x23ea59){if(_0x13302b){return client[_0xfcfb('0xb')](_0xfcfb('0x1e'),{'options':{'raw':!![],'attributes':['id',_0xfcfb('0x11'),_0xfcfb('0x1f'),_0xfcfb('0x20'),_0xfcfb('0x21')],'where':{'name':_0x13302b},'limit':0x1}})['then'](function(_0x4012c3){logger['debug'](_0xfcfb('0x22'),_0x13302b,_0x4012c3?util[_0xfcfb('0x9')](_0x4012c3,{'showHidden':![],'depth':null}):'');logger[_0xfcfb('0x7')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x13302b,_0x4012c3?_0xfcfb('0x23'):_0xfcfb('0x17'));return _0x5ff1eb(_0x4012c3[_0xfcfb('0x15')][_0xfcfb('0x24')]?_0x4012c3[_0xfcfb('0x15')][0x0]:null);})[_0xfcfb('0xe')](function(_0x4e5a44){logger['error']('[utils][getVoiceQueueByName]',_0x4e5a44?util[_0xfcfb('0x9')](_0x4e5a44,{'showHidden':![],'depth':null}):'');return _0x5ff1eb(null);});}return _0x5ff1eb(null);});};exports[_0xfcfb('0x25')]=function(_0x289a08,_0x4f1a92){return moment(_0x289a08)['add'](_0x4f1a92,'seconds')[_0xfcfb('0x26')](_0xfcfb('0x27'));};exports[_0xfcfb('0x28')]=function(_0xcf9789,_0x2d6d11){return moment(_0xcf9789)[_0xfcfb('0x29')](_0x2d6d11,'seconds')['format'](_0xfcfb('0x27'));};exports[_0xfcfb('0x2a')]=function(_0x159c5d,_0x560da4){return moment(_0x159c5d)[_0xfcfb('0x2b')](moment(_0x560da4),_0xfcfb('0x2c'));};exports[_0xfcfb('0x2d')]=function(_0x2594a5,_0x2bfe98){return parseInt(_0x2594a5,0xa)+parseInt(_0x2bfe98,0xa);};exports[_0xfcfb('0x2e')]=function(){return moment()[_0xfcfb('0x26')](_0xfcfb('0x27'));};exports[_0xfcfb('0x2f')]=function(_0x56526b,_0x5be88b){if(_0x5be88b){return moment(_0x56526b)[_0xfcfb('0x2f')](_0x5be88b);}return!![];};exports['isBefore']=function(_0xd4ecb7,_0x451215){if(_0x451215){return moment(_0xd4ecb7)[_0xfcfb('0x30')](_0x451215);}else if(_0xd4ecb7){return!![];}return![];}; \ No newline at end of file -- 1.7.1